Built motion from commit 0d6db5f4.|2.5.49
authorAndrea Amorese <andrea.amorese@xenialab.it>
Thu, 20 Jan 2022 15:36:12 +0000 (16:36 +0100)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Thu, 20 Jan 2022 15:36:12 +0000 (16:36 +0100)
1175 files changed:
apidoc/api_project.js
apidoc/api_project.json
package.json
public/index.html
public/scripts/app.0b7982cb.js [moved from public/scripts/app.be82faff.js with 53% similarity]
public/styles/app.712019a1.css [moved from public/styles/app.ba338534.css with 83% similarity]
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authActiveDirectory/authActiveDirectory.controller.js
server/api/authActiveDirectory/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.events.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/client-side-logs.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.oauth.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.events.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/teamVoicePrefix/teamVoicePrefix.attributes.js
server/api/teamVoicePrefix/teamVoicePrefix.model.js
server/api/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user-setting/index.js
server/api/user-setting/user-setting.attributes.js
server/api/user-setting/user-setting.controller.js
server/api/user-setting/user-setting.events.js
server/api/user-setting/user-setting.model.js
server/api/user-setting/user-setting.socket.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoicePrefix/userVoicePrefix.attributes.js
server/api/userVoicePrefix/userVoicePrefix.model.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/integrations/configuration.js
server/components/interaction/service.js
server/components/license/service.js
server/components/parsers/advancedSearch.js
server/components/parsers/qs.js
server/config/express.js
server/config/license/hardware.js
server/config/license/index.js
server/config/license/util.js
server/config/local.env.js
server/config/logger.js
server/config/pm2/config.js
server/config/pm2/index.js
server/config/schedule/chat.js
server/config/schedule/cloud-provider.js
server/config/schedule/index.js
server/config/schedule/transcribe.js
server/config/schedule/whatsapp.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.js
server/errors/index.js
server/migrations/2.5.48.js
server/migrations/2.5.49.js [new file with mode: 0644]
server/mysqldb/index.js
server/routes.js
server/rpc/index.js
server/services/agi/channel.js
server/services/agi/error.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/google/index.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/action.js
server/services/ami/dialer/agentComplete.js
server/services/ami/dialer/final.js
server/services/ami/dialer/hangup.js
server/services/ami/dialer/history.js
server/services/ami/dialer/index.js
server/services/ami/dialer/queueCallerAbandon.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/dynamics365Account.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/freshsalesAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/servicenowAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/dynamics365.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/freshsales.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/servicenow.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/setting.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/dynamics365.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/freshsales.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/servicenow.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/script/index.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/rpc/setting.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/model/whatsappQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/rpc/whatsappInteraction.js
server/services/routing/rpc/whatsappMessage.js
server/services/routing/rpc/whatsappQueue.js
server/services/routing/rpc/whatsappQueueReport.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/dialogflowV2.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/tvox.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js
server/utils/client-side-logger.js
server/utils/loggers.js
server/utils/mask-sensitive-data.js
server/utils/safe-template.js

index d1471ee..524c65b 100644 (file)
@@ -1,6 +1,6 @@
 define({
   "name": "xCALLY Motion API",
-  "version": "2.5.48",
+  "version": "2.5.49",
   "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
   "title": "xCALLY MOTION API",
   "header": {
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-01-20T14:08:45.777Z",
+    "time": "2022-01-20T15:10:40.573Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 4d0a20e..c018ec3 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "xCALLY Motion API",
-  "version": "2.5.48",
+  "version": "2.5.49",
   "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
   "title": "xCALLY MOTION API",
   "header": {
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-01-20T14:08:45.777Z",
+    "time": "2022-01-20T15:10:40.573Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index c5310d8..dda6068 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "motion",
-  "version": "2.5.48",
+  "version": "2.5.49",
   "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
   "main": "server/app.js",
   "engines": {
index 558d827..f8bfeec 100644 (file)
@@ -16,7 +16,7 @@
 
   <link rel="stylesheet" href="styles/vendor.57a94b79.css">
 
-  <link rel="stylesheet" href="styles/app.ba338534.css">
+  <link rel="stylesheet" href="styles/app.712019a1.css">
 
   <!-- <link href='//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700italic,700,900,900italic'
               rel='stylesheet' type='text/css'> -->
@@ -68,7 +68,7 @@
   <script src="assets/plugins/angular-material-form-builder/dist/angular-material-form-builder.min.js"></script>
   <!-- ANGULAR-MATERIAL-FORM-BUILDER -->
 
-  <script src="scripts/app.be82faff.js"></script>
+  <script src="scripts/app.0b7982cb.js"></script>
 
   <!-- CKEDITOR -->
   <script src="assets/plugins/ckeditor/ckeditor.js"></script>
similarity index 53%
rename from public/scripts/app.be82faff.js
rename to public/scripts/app.0b7982cb.js
index 4482649..cb345be 100644 (file)
@@ -1 +1 @@
-!function(){"use strict";angular.module("app.auth",[])}(),function(){"use strict";angular.module("app.client-side-logging",[])}(),function(){"use strict";angular.module("app.core",["ngAnimate","ngAria","ngCookies","ngMessages","ngResource","ngSanitize","ngMaterial","pascalprecht.translate","ui.router","ui.router.state.events","gridster","ds.clock","angucomplete-alt"])}(),function(){"use strict";function e(e,n){e.state("app.errors_error-404",{url:"/errors/error-404",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-404":{templateUrl:"app/errors/404/error-404.html",controller:"Error404Controller as vm"}},params:{status:404,statusText:"",data:{},config:{}},bodyClass:"error-404"}),n.addPart("app/errors/404")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-404",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.errors_error-500",{url:"/errors/error-500",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-500":{templateUrl:"app/errors/500/error-500.html",controller:"Error500Controller as vm"}},params:{status:500,statusText:"",data:{},config:{}},bodyClass:"error-500"}),n.addPart("app/errors/500")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-500",[]).config(e)}(),function(){"use strict";angular.module("app.errors",["app.errors.error-404","app.errors.error-500"])}(),function(){"use strict";function e(e){e.addPart("app/footer")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.footer",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.forgot",{url:"/forgot",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.forgot":{templateUrl:"app/forgot/forgot.html",controller:"ForgotPasswordController as vm"}},bodyClass:"forgot"}),n.addPart("app/forgot")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.forgot",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/header")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.header",[]).config(e)}(),function(){"use strict";angular.module("motion",["angular-toasty","app.core","app.auth","app.navigation","app.toolbar","app.quick-panel","app.header","app.footer","app.realtime","app.dashboards","app.staff","app.contactmanager","app.voice","app.chat","app.mail","app.sms","app.openchannel","app.fax","app.tools","app.callysquare","app.analytics","app.integrations","app.settings","app.motiondialer","app.help","app.jscripty","app.marketplace","app.plugins","app.video","app.whatsapp","app.login","app.forgot","app.reset","app.errors","app.user-setting","app.client-side-logging"])}(),function(){"use strict";function e(e,n){e.state("app.login",{url:"/login?token&userId",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.login":{templateUrl:"app/login/login.html",controller:"LoginController as vm"}},bodyClass:"login"}),n.addPart("app/login")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.login",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.analytics",{abstract:!0,url:"/analytics"}).state("app.analytics.metrics",{url:"/metrics",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/metrics/metrics.html",controller:"MetricsController as vm"}},resolve:{metrics:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("analyticMetric@get",{fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Metrics",fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1201})}]},authenticate:!0,permissionId:1201,bodyClass:"analytics"}).state("app.analytics.extractedReports",{url:"/extractedReports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/extractedReports/extractedReports.html",controller:"ExtractedReportsController as vm"}},resolve:{extractedReports:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("analyticExtractedReport@get",{fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ExtractedReports",fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1202})}]},authenticate:!0,permissionId:1202,bodyClass:"analytics"}),n.addPart("app/main/apps/analytics")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.analytics",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.analytics.reports"]).config(e)}(),function(){"use strict";function e(e){e.state("app.analytics.reports",{url:"/reports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/reports.html",controller:"ReportsController as vm"}},resolve:{treeReports:["apiResolver",function(e){return e.resolve("analyticTreeReport@get",{fields:"id,tree",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"}).state("app.analytics.reports.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/edit/view.html",controller:"ReportController as vm"}},resolve:{report:["apiResolver","$stateParams","$q","describeTable",function(e,n,a,i){var s;return e.resolve("analyticCustomReport@get",{fields:"createdAt,updatedAt,id,name,description,table,conditions,joins",id:n.id}).then(function(e){var n=[];if((s=e).joins)try{s.joins=JSON.parse(s.joins);for(var t=0;t<s.joins.length;t+=1)n.push(i.getColumns(s.joins[t].foreignTable))}catch(e){console.log(e)}return a.all(n)}).then(function(e){for(var n=0;n<e.length;n+=1)s.joins[n].foreignTableFields=_.difference(_.keys(e[n]),["$promise","$resolved"]);return s})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"})}e.$inject=["$stateProvider"],angular.module("app.analytics.reports",["ngJsTree"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.callysquare",{abstract:!0,url:"/callysquare"}).state("app.callysquare.odbcs",{url:"/odbcs",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/odbcs/odbcs.html",controller:"OdbcsController as vm"}},resolve:{odbcs:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ODBC",fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1101})}]},authenticate:!0,permissionId:1101,bodyClass:"callysquare"}).state("app.callysquare.squareRecordings",{url:"/squareRecordings",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",controller:"SquareRecordingsController as vm"}},resolve:{squareRecordings:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareRecording@get",{fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareRecordings",fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadCallySquareRecordings",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1102})}]},authenticate:!0,permissionId:1102,bodyClass:"callysquare"}),n.addPart("app/main/apps/callysquare")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.callysquare",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.callysquare.projects"]).config(e)}(),function(){"use strict";function e(e){e.state("app.callysquare.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/projects.html",controller:"ProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"}).state("app.callysquare.projects.edit",{url:"/:id",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/edit/view.html",controller:"ProjectController as vm"}},params:{crudPermissions:void 0},resolve:{project:["apiResolver","$stateParams",function(e,n){return e.resolve("squareProject@get",{id:n.id})}],users:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Users",mergeResources:!0,fields:"id,fullname,role",sort:"name",nolimit:!0})}],trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",sort:"name",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",type:"inbound",fields:"id,name",sort:"name",nolimit:!0})}],sounds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("sound@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Sounds",fields:"id,name",sort:"name",nolimit:!0})}],variables:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("variable@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Variables",fields:"id,name",sort:"name",nolimit:!0})}],databases:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ODBC",fields:"id,name",sort:"name",nolimit:!0})}],projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name",sort:"name",nolimit:!0})}],contexts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceContext@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Contexts",fields:"id,name",sort:"name",nolimit:!0})}],intervals:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("interval@get",{fields:"id,name,IntervalId",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Intervals",fields:"id,name,IntervalId",sort:"name",nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"id,name",sort:"name",nolimit:!0})}],templates:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("template@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Templates",fields:"id,name",sort:"name",nolimit:!0})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"name",nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"id,name",sort:"name",nolimit:!0})}],pauses:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("pause@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Pauses",fields:"id,name",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"})}e.$inject=["$stateProvider"],angular.module("app.callysquare.projects",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.chat",{abstract:!0,url:"/chat"}).state("app.chat.chatQueues",{url:"/chatQueues",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/chatQueues.html",controller:"ChatQueuesController as vm"}},resolve:{chatQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatQueues.edit",{url:"/:id?tab",params:{chatQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/edit/view.html",controller:"ChatQueueController as vm"}},resolve:{chatQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatWebsites",{url:"/chatWebsites",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/chatWebsites.html",controller:"ChatWebsitesController as vm"}},resolve:{chatWebsites:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}).state("app.chat.chatWebsites.edit",{url:"/:id?tab",params:{chatWebsite:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/edit/view.html",controller:"ChatWebsiteController as vm"}},resolve:{chatWebsite:["apiResolver","$stateParams",function(e,n){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}),n.addPart("app/main/apps/chat")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.chat",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.chat.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.chat.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/chat/views/realtime/realtime.html",controller:"ChatRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:510})}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.agents",{url:"/agents",params:{channel:"chat"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.queues",{url:"/queues",controller:"QueuesChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"ChatQueues":void 0,channel:"chat",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:510})}e.$inject=["$stateProvider"],angular.module("app.chat.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.contactmanager",{abstract:!0,url:"/contactmanager"}).state("app.contactmanager.lists",{url:"/lists",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/lists.html",controller:"ListsController as vm"}},resolve:{lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadContactManagerLists",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.lists.edit",{url:"/:id?tab",params:{list:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/edit/view.html",controller:"ListController as vm"}},resolve:{list:["apiResolver","$stateParams",function(e,n){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.companies",{url:"/companies",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/companies.html",controller:"CompaniesController as vm"}},resolve:{companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies",fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.companies.edit",{url:"/:id?tab",params:{company:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/edit/view.html",controller:"CompanyController as vm"}},resolve:{company:["apiResolver","$stateParams",function(e,n){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.globalCustomFields",{url:"/globalCustomFields",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",controller:"GlobalCustomFieldsController as vm"}},resolve:{globalCustomFields:["apiResolver","Auth",function(e,n){return e.resolve("cmCustomField@get",{fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",sort:"-updatedAt",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:304})}]},authenticate:!0,permissionId:304,bodyClass:"contactmanager"}),n.addPart("app/main/apps/contactmanager")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.contactmanager",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.contactmanager.contacts"]).config(e)}(),function(){"use strict";function e(e){e.state("app.contactmanager.contacts",{url:"/contacts?ListId&CompanyId",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/contacts.html",controller:"ContactsController as vm"}},resolve:{contacts:["apiResolver","Auth","$stateParams",function(e,n,t){return n.hasRole("admin")?e.resolve("cmContact@get",_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0},t)):e.resolve("userProfile@getResources",_.merge({id:n.getCurrentUser().userProfileId,section:"Contacts",includeAll:!0,sort:"-updatedAt",limit:10,offset:0},t))}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],listsMap:["lists",function(e){for(var n={},t=0;t<e.rows.length;t++)n[e.rows[t].id]=e.rows[t].name;return n}],companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies",fields:"id,name",sort:"name",nolimit:!0})}],companiesMap:["companies",function(e){for(var n={},t=0;t<e.rows.length;t++)n[e.rows[t].id]=e.rows[t].name;return n}],tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags",fields:"id,name",sort:"name",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"}).state("app.contactmanager.contacts.edit",{url:"/:id?tab",params:{crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/edit/view.html",controller:"ContactController as vm"}},resolve:{contact:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@get",{id:n.id}).then(function(e){return e.dateOfBirth&&(e.dateOfBirth=new Date(e.dateOfBirth)),e}).catch(function(e){console.error(e)})}],hoppers:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHoppers",{id:n.id,fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,offset:0})}],finals:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHopperFinals",{id:n.id,fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,offset:0})}],histories:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHopperHistories",{id:n.id,fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,offset:0})}],jscriptySessions:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getJscriptySessions",{id:n.id,fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,offset:0})}],companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get"):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies"})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],customFields:["apiResolver","contact",function(e,n){return n.ListId?e.resolve("cmList@getCustomFields",{id:n.ListId}):null}],tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{sort:"name"}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"})}e.$inject=["$stateProvider"],angular.module("app.contactmanager.contacts",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.dashboards",{abstract:!0,url:"/dashboards"}),n.addPart("app/main/apps/dashboards")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.dashboards",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.dashboards.general","app.dashboards.custom"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.custom",{url:"/custom/:id",views:{"content@app":{templateUrl:"app/main/apps/dashboards/views/custom/custom.html",controller:"DashboardCustomController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("voiceQueue@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"VoiceQueues",mergeResources:!0,fields:"id,name",channel:"voice",nolimit:!0})).then(function(e){return t=e,n.resolve("rpc@getVoiceQueues",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)t&&t.id===e.rows[n].id?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged,a.abandoned+=e.rows[n].abandoned):(a=_.find(t.rows,{id:e.rows[n].id}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged","abandoned"]));return t})}],faxAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("faxAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"FaxAccounts",mergeResources:!0,fields:"id,name",channel:"fax",nolimit:!0})).then(function(e){return t=e,n.resolve("faxInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].FaxAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].FaxAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],chatWebsites:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("chatWebsite@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"ChatWebsites",mergeResources:!0,fields:"id,name",channel:"chat",nolimit:!0})).then(function(e){return t=e,n.resolve("chatInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].ChatWebsiteId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.abandoned+=e.rows[n].abandoned,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].ChatWebsiteId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","abandoned","unmanaged"]));return t})}],smsAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("smsAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"SmsAccounts",mergeResources:!0,fields:"id,name",channel:"sms",nolimit:!0})).then(function(e){return t=e,n.resolve("smsInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].SmsAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].SmsAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],openchannelAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("openchannelAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"OpenchannelAccounts",mergeResources:!0,fields:"id,name",channel:"openchannel",nolimit:!0})).then(function(e){return t=e,n.resolve("openchannelInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].OpenchannelAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].OpenchannelAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],mailAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("mailAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"MailAccounts",mergeResources:!0,fields:"id,name",channel:"mail",nolimit:!0})).then(function(e){return t=e,n.resolve("mailInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].MailAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].MailAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],whatsappAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("whatsappAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"WhatsappAccounts",mergeResources:!0,fields:"id,name",channel:"whatsapp",nolimit:!0})).then(function(e){return t=e,n.resolve("whatsappInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].WhatsappAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].WhatsappAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:100})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.custom",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general",{url:"/general",views:{"content@app":{templateProvider:["$stateParams","$templateFactory","Auth","$window",function(e,n,t,a){var i=t.getCurrentUser();return null===a.localStorage.getItem("motion2.user:"+i.id)&&a.localStorage.setItem("motion2.user:"+i.id,JSON.stringify({authenticationType:"google"})),t.isAgent()?n.fromUrl("app/main/apps/dashboards/views/general/agent/agent.general.html",e):n.fromUrl("app/main/apps/dashboards/views/general/user/user.general.html",e)}],controllerProvider:["Auth",function(e){return e.isAgent()?"AgentDashboardGeneralController as vm":"UserDashboardGeneralController as vm"}]}},resolve:{globalUserLists:["apiResolver","Auth",function(e,n){return e.resolve("user@getLists",{id:n.getCurrentUser().id,sort:"name",nolimit:!0})}],globalLists:["apiResolver",function(e){return e.resolve("cmList@get",{sort:"name",nolimit:!0})}],globalTags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0})}],globalCompanies:["apiResolver",function(e){return e.resolve("cmCompany@get",{sort:"name",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general",["ngMaterialDateRangePicker","app.dashboards.general.user"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general.voice",{url:"/voice",data:{selectedTab:0},views:{voice:{templateUrl:"app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",controller:"UserVoiceDashboardGeneralController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],inboundQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"id,name",type:"inbound",channel:"voice",nolimit:!0})}],outbound:["apiResolver",function(e){return e.resolve("rpc@getOutbound")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.dialer",{url:"/dialer",data:{selectedTab:1},views:{dialer:{templateUrl:"app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",controller:"UserVoiceDashboardDialerController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],outboundQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"id,name",type:"outbound",channel:"voice",nolimit:!0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.chat",{url:"/chat",data:{selectedTab:2},views:{chat:{templateUrl:"app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",controller:"UserChatDashboardGeneralController as vm"}},resolve:{chatInteractions:["apiResolver",function(e){return e.resolve("chatInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],chatWebsites:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.mail",{url:"/mail",data:{selectedTab:3},views:{mail:{templateUrl:"app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",controller:"UserMailDashboardGeneralController as vm"}},resolve:{mailInteractions:["apiResolver",function(e){return e.resolve("mailInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.sms",{url:"/sms",data:{selectedTab:4},views:{sms:{templateUrl:"app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",controller:"UserSmsDashboardGeneralController as vm"}},resolve:{smsInteractions:["apiResolver",function(e){return e.resolve("smsInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,applicationId,accountId,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,applicationId,accountId,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.openchannel",{url:"/openchannel",data:{selectedTab:5},views:{openchannel:{templateUrl:"app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",controller:"UserOpenchannelDashboardGeneralController as vm"}},resolve:{openchannelInteractions:["apiResolver",function(e){return e.resolve("openchannelInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],openchannelAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.fax",{url:"/fax",data:{selectedTab:6},views:{fax:{templateUrl:"app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",controller:"UserFaxDashboardGeneralController as vm"}},resolve:{faxInteractions:["apiResolver",function(e){return e.resolve("faxInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.whatsapp",{url:"/whatsapp",data:{selectedTab:7},views:{whatsapp:{templateUrl:"app/main/apps/dashboards/views/general/user/whatsapp/user.general.whatsapp.html",controller:"UserWhatsappDashboardGeneralController as vm"}},resolve:{whatsappInteractions:["apiResolver",function(e){return e.resolve("whatsappInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],whatsappAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,whatsappMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,whatsappMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general.user",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.fax",{abstract:!0,url:"/fax"}).state("app.fax.faxQueues",{url:"/faxQueues",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/faxQueues.html",controller:"FaxQueuesController as vm"}},resolve:{faxQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxQueues.edit",{url:"/:id?tab",params:{faxQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/edit/view.html",controller:"FaxQueueController as vm"}},resolve:{faxQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxAccounts",{url:"/faxAccounts",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/faxAccounts.html",controller:"FaxAccountsController as vm"}},resolve:{faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}).state("app.fax.faxAccounts.edit",{url:"/:id?tab",params:{faxAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/edit/view.html",controller:"FaxAccountController as vm"}},resolve:{faxAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}),n.addPart("app/main/apps/fax")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.fax",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.fax.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.fax.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/fax/views/realtime/realtime.html",controller:"FaxRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:910})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.agents",{url:"/agents",params:{channel:"fax"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.trunks",{url:"/trunks",controller:"TrunksFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.queues",{url:"/queues",controller:"QueuesFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"FaxQueues":void 0,channel:"fax",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.accounts",{url:"/accounts",controller:"FaxAccountsRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/accounts/view.html",resolve:{faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}],rpcFaxAccounts:["apiResolver",function(e){return e.resolve("rpc@getFaxAccounts")}]},authenticate:!0,permissionId:910})}e.$inject=["$stateProvider"],angular.module("app.fax.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.help",{abstract:!0,url:"/help"}),n.addPart("app/main/apps/help")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.help",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.help.about"]).config(e)}(),function(){"use strict";function e(e){e.state("app.help.about",{url:"/about",views:{"content@app":{templateUrl:"app/main/apps/help/views/about/about.html",controller:"AboutController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1600,bodyClass:"help"})}e.$inject=["$stateProvider"],angular.module("app.help.about",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.integrations",{abstract:!0,url:"/integrations"}).state("app.integrations.zendeskAccounts",{url:"/zendeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",controller:"ZendeskAccountsController as vm"}},resolve:{zendeskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ZendeskAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.zendeskAccounts.edit",{url:"/:id?tab",params:{zendeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/view.html",controller:"ZendeskAccountController as vm"}},resolve:{zendeskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts",{url:"/salesforceAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",controller:"SalesforceAccountsController as vm"}},resolve:{salesforceAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SalesforceAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts.edit",{url:"/:id?tab",params:{salesforceAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/view.html",controller:"SalesforceAccountController as vm"}},resolve:{salesforceAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts",{url:"/freshdeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",controller:"FreshdeskAccountsController as vm"}},resolve:{freshdeskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FreshdeskAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts.edit",{url:"/:id?tab",params:{freshdeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",controller:"FreshdeskAccountController as vm"}},resolve:{freshdeskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts",{url:"/sugarcrmAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",controller:"SugarcrmAccountsController as vm"}},resolve:{sugarcrmAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SugarcrmAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts.edit",{url:"/:id?tab",params:{sugarcrmAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",controller:"SugarcrmAccountController as vm"}},resolve:{sugarcrmAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.deskAccounts",{url:"/deskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/deskAccounts.html",controller:"DeskAccountsController as vm"}},resolve:{deskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"DeskAccounts",fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.deskAccounts.edit",{url:"/:id?tab",params:{deskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/view.html",controller:"DeskAccountController as vm"}},resolve:{deskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.zohoAccounts",{url:"/zohoAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",controller:"ZohoAccountsController as vm"}},resolve:{zohoAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ZohoAccounts",fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.zohoAccounts.edit",{url:"/:id?tab",params:{zohoAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/view.html",controller:"ZohoAccountController as vm"}},resolve:{zohoAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts",{url:"/vtigerAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",controller:"VtigerAccountsController as vm"}},resolve:{vtigerAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VtigerAccounts",fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts.edit",{url:"/:id?tab",params:{vtigerAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/view.html",controller:"VtigerAccountController as vm"}},resolve:{vtigerAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts",{url:"/dynamics365Accounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",controller:"Dynamics365AccountsController as vm"}},resolve:{dynamics365Accounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication,CloudProviderId",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dynamics365Accounts",fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",type:"Dynamics365",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts.edit",{url:"/:id?tab",params:{dynamics365Account:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",controller:"Dynamics365AccountController as vm"}},resolve:{dynamics365Account:["apiResolver","$stateParams",function(e,n){return e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication,CloudProviderId",id:n.id})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",type:"Dynamics365",limit:10,offset:0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts",{url:"/servicenowAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",controller:"ServicenowAccountsController as vm"}},resolve:{servicenowAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ServicenowAccounts",fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts.edit",{url:"/:id?tab",params:{servicenowAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/view.html",controller:"ServicenowAccountController as vm"}},resolve:{servicenowAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.freshsalesAccounts",{url:"/freshsalesAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/freshsalesAccounts.html",controller:"FreshsalesAccountsController as vm"}},resolve:{freshsalesAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intFreshsalesAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FreshsalesAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1304})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}).state("app.integrations.freshsalesAccounts.edit",{url:"/:id?tab",params:{freshsalesAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/view.html",controller:"FreshsalesAccountController as vm"}},resolve:{freshsalesAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intFreshsalesAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1304})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}),n.addPart("app/main/apps/integrations")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.integrations",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.jscripty",{abstract:!0,url:"/jscripty"}).state("app.jscripty.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/projects.html",controller:"JscriptyProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Projects",fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadJscriptySessions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}).state("app.jscripty.projects.edit",{url:"/:id?tab",params:{project:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/edit/view.html",controller:"JscriptyProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,n){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadJscriptySessions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}),n.addPart("app/main/apps/jscripty")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.jscripty",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.mail",{abstract:!0,url:"/mail"}).state("app.mail.mailQueues",{url:"/mailQueues",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/mailQueues.html",controller:"MailQueuesController as vm"}},resolve:{mailQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailQueues.edit",{url:"/:id?tab",params:{mailQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/edit/view.html",controller:"MailQueueController as vm"}},resolve:{mailQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailAccounts",{url:"/mailAccounts",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/mailAccounts.html",controller:"MailAccountsController as vm"}},resolve:{mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailAccounts.edit",{url:"/:id?tab",params:{mailAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/edit/view.html",controller:"MailAccountController as vm"}},resolve:{mailAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailSubtatuses",{url:"/mailSubtatuses",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",controller:"MailSubstatusesController as vm"}},resolve:{mailSubtatuses:["apiResolver",function(e){return e.resolve("mailSubstatus@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:603})}]},authenticate:!0,permissionId:603,bodyClass:"mail"}),n.addPart("app/main/apps/mail")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.mail",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.mail.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.mail.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/mail/views/realtime/realtime.html",controller:"MailRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:610})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.agents",{url:"/agents",params:{channel:"mail"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.queues",{url:"/queues",controller:"QueuesMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"MailQueues":void 0,channel:"mail",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.accounts",{url:"/accounts",controller:"MailAccountsRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/accounts/view.html",resolve:{mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}],rpcMailAccounts:["apiResolver",function(e){return e.resolve("rpc@getMailAccounts")}]},authenticate:!0,permissionId:610})}e.$inject=["$stateProvider"],angular.module("app.mail.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.marketplace",{abstract:!0,url:"/marketplace"}).state("app.marketplace.plugins",{url:"/plugins",views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/plugins.html",controller:"MarketplacePluginsController as vm"}},resolve:{plugins:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Plugins",fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}).state("app.marketplace.plugins.edit",{url:"/:id?tab",params:{plugin:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/edit/view.html",controller:"MarketplacePluginController as vm"}},resolve:{plugin:["apiResolver","$stateParams",function(e,n){return e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}),n.addPart("app/main/apps/marketplace")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.marketplace",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.motiondialer",{abstract:!0,url:"/motiondialer"}).state("app.motiondialer.queueCampaigns",{url:"/queueCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",controller:"QueueCampaignsController as vm"}},resolve:{queueCampaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe,dialPreviewRecallmeReminder",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.queueCampaigns.edit",{url:"/:id?tab",params:{queueCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",controller:"QueueCampaignController as vm"}},resolve:{queueCampaign:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe,dialPreviewRecallmeReminder",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns",{url:"/ivrCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",controller:"IvrCampaignsController as vm"}},resolve:{ivrCampaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"IvrCampaigns",fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns.edit",{url:"/:id?tab",params:{ivrCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",controller:"IvrCampaignController as vm"}},resolve:{ivrCampaign:["apiResolver","$stateParams",function(e,n){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}),n.addPart("app/main/apps/motiondialer")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.motiondialer",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.motiondialer.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.hopperdate",{url:"/hopperdate",views:{"hopperdate@app":{templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",controller:"HopperdateController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1500,bodyClass:"motiondialer"})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.hopperdate",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/realtime/realtime.html",controller:"MotionDialerRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1510})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.agents",{url:"/agents",params:{channel:"voice",direction:"outbound"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queues",{url:"/queues",controller:"QueuesMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"QueueCampaigns":void 0,channel:"voice",type:"outbound",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.ivr_campaigns",{url:"/ivr_campaigns",controller:"IvrCampaignsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",resolve:{campaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("campaign@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"IvrCampaigns",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,permissionId:1510})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.openchannel",{abstract:!0,url:"/openchannel"}).state("app.openchannel.openchannelQueues",{url:"/openchannelQueues",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",controller:"OpenchannelQueuesController as vm"}},resolve:{openchannelQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelQueues.edit",{url:"/:id?tab",params:{openchannelQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/view.html",controller:"OpenchannelQueueController as vm"}},resolve:{openchannelQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts",{url:"/openchannelAccounts",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",controller:"OpenchannelAccountsController as vm"}},resolve:{openchannelAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts.edit",{url:"/:id?tab",params:{openchannelAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",controller:"OpenchannelAccountController as vm"}},resolve:{openchannelAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}),n.addPart("app/main/apps/openchannel")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.openchannel",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.openchannel.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.openchannel.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/realtime/realtime.html",controller:"OpenchannelRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:810})}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.agents",{url:"/agents",params:{channel:"openchannel"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.queues",{url:"/queues",controller:"QueuesOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"OpenchannelQueues":void 0,channel:"openchannel",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:810})}e.$inject=["$stateProvider"],angular.module("app.openchannel.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.plugins",{abstract:!0,url:"/plugins"}),n.addPart("app/main/apps/plugins")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.plugins",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.plugins.plugin"]).config(e)}(),function(){"use strict";function e(e){e.state("app.plugins.plugin",{url:"/plugin/:id",views:{"content@app":{templateUrl:"app/main/apps/plugins/views/plugin/plugin.html",controller:"PluginController as vm"}},resolve:{},authenticate:!0,bodyClass:"plugins"})}e.$inject=["$stateProvider"],angular.module("app.plugins.plugin",[]).config(e)}(),function(){"use strict";angular.module("app.realtime",[])}(),function(){"use strict";function e(e,n){e.state("app.settings",{abstract:!0,url:"/settings"}).state("app.settings.generals",{url:"/generals",views:{"content@app":{templateUrl:"app/main/apps/settings/views/generals/generals.html",controller:"GeneralsController as vm"}},resolve:{generals:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,min_internal,securePassword,callRecordingEncryption,chatTimeout,phoneBarAutoUpdater,defaultScreenRecordingPath,phoneBarAutoUpdaterUrl,enableEmailPreview,split,splitSizeCsv,splitSizePdf,splitSizeXlsx,searchOnEnterKey,messagesAlignment,phoneBarRememberMeEnabled,rtlSupport,allowedLoginAttempts,blockDuration,loginMailFrequency,language,bucket,transcribe,transcribeRegion,transcribeAccountId,sentiment,sentimentRegion,sentimentAccountId,googleSsoEnabled,enforcePasswordHistory,passwordHistoryLimit,enablePrivacyPolicyEmail,privacyPolicyEmail,enablePrivacyPolicyName,privacyPolicyName,enablePrivacyPolicyNumber,privacyPolicyNumber,chatInteractionsReloadTimeout,mailInteractionsReloadTimeout,openchannelInteractionsReloadTimeout,smsInteractionsReloadTimeout,whatsappInteractionsReloadTimeout,stopRecordingOnTransfer,adSsoEnabled,disabledCookie,previewRecallmeReminderInterval,limitTabs",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.smtps",{url:"/smtps",views:{"content@app":{templateUrl:"app/main/apps/settings/views/smtps/smtps.html",controller:"SmtpController as vm"}},resolve:{mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,service,provider,name,email,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,description",service:"1",limit:10,offset:0})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.networks",{url:"/networks",views:{"content@app":{templateUrl:"app/main/apps/settings/views/networks/networks.html",controller:"NetworksController as vm"}},resolve:{networks:["apiResolver",function(e){return e.resolve("network@get",{fields:"createdAt,updatedAt,id,type,value,username,password",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.customizations",{url:"/customizations",views:{"content@app":{templateUrl:"app/main/apps/settings/views/customizations/customizations.html",controller:"CustomizationsController as vm"}},resolve:{customizations:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,defaultLogo,defaultLoginLogo,defaultFavicon,defaultHeaderWhiteLabel,headerWhiteLabel,defaultPageTitle,pageTitle,defaultPreferred",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.cloudProviders",{url:"/cloudProviders",views:{"content@app":{templateUrl:"app/main/apps/settings/views/cloudProviders/cloudProviders.html",controller:"CloudProvidersController as vm"}},resolve:{cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}),n.addPart("app/main/apps/settings")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.settings",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.settings.updates","app.settings.license","app.settings.system"]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.license",{url:"/license",views:{"content@app":{templateUrl:"app/main/apps/settings/views/license/license.html",controller:"LicenseController as vm"}},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.license",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.system",{url:"/system?tab",views:{"content@app":{templateUrl:"app/main/apps/settings/views/system/system.html",controller:"SystemController as vm"}},resolve:{system:["apiResolver",function(e){return e.resolve("system@get")}],processes:["apiResolver",function(e){return e.resolve("pm2@get")}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.system",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.updates",{url:"/updates",views:{"content@app":{templateUrl:"app/main/apps/settings/views/updates/updates.html",controller:"UpdatesController as vm"}},resolve:{version:["apiResolver",function(e){return e.resolve("version@get",{latest:!0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1400})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.updates",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.sms",{abstract:!0,url:"/sms"}).state("app.sms.smsQueues",{url:"/smsQueues",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/smsQueues.html",controller:"SmsQueuesController as vm"}},resolve:{smsQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsQueues.edit",{url:"/:id?tab",params:{smsQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/edit/view.html",controller:"SmsQueueController as vm"}},resolve:{smsQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsAccounts",{url:"/smsAccounts",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/smsAccounts.html",controller:"SmsAccountsController as vm"}},resolve:{smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}).state("app.sms.smsAccounts.edit",{url:"/:id?tab",params:{smsAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/edit/view.html",controller:"SmsAccountController as vm"}},resolve:{smsAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}),n.addPart("app/main/apps/sms")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.sms",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.sms.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.sms.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/sms/views/realtime/realtime.html",controller:"SmsRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:710})}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.agents",{url:"/agents",params:{channel:"sms"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.queues",{url:"/queues",controller:"QueuesSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"SmsQueues":void 0,channel:"sms",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:710})}e.$inject=["$stateProvider"],angular.module("app.sms.realtime",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.staff",{abstract:!0,url:"/staff"}).state("app.staff.users",{url:"/users",views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/users.html",controller:"UsersController as vm"}},resolve:{users:["apiResolver",function(e){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled",role:"admin,user",sort:"-updatedAt",userSetting:!0,limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.users.edit",{url:"/:id?tab",params:{user:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/edit/view.html",controller:"UserController as vm"}},resolve:{user:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled",id:n.id,userSetting:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.agents",{url:"/agents",views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/agents.html",controller:"AgentsController as vm"}},resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled",role:"agent",sort:"-updatedAt",userSetting:!0,limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled",role:"agent",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.agents.edit",{url:"/:id?tab",params:{agent:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/edit/view.html",controller:"AgentController as vm"}},resolve:{agent:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled",id:n.id,userSetting:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.telephones",{url:"/telephones",views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/telephones.html",controller:"TelephonesController as vm"}},resolve:{telephones:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Telephones",fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.telephones.edit",{url:"/:id?tab",params:{telephone:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/edit/view.html",controller:"TelephoneController as vm"}},resolve:{telephone:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.teams",{url:"/teams",views:{"content@app":{templateUrl:"app/main/apps/staff/views/teams/teams.html",controller:"TeamsController as vm"}},resolve:{teams:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("team@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Teams",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:204})}]},authenticate:!0,permissionId:204,bodyClass:"staff"}).state("app.staff.userProfiles",{url:"/userProfiles",views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/userProfiles.html",controller:"UserProfilesController as vm"}},resolve:{userProfiles:["apiResolver",function(e){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}).state("app.staff.userProfiles.edit",{url:"/:id?tab",params:{userProfile:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/edit/view.html",controller:"UserProfileController as vm"}},resolve:{userProfile:["apiResolver","$stateParams",function(e,n){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}),n.addPart("app/main/apps/staff")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.staff",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.tools",{abstract:!0,url:"/tools"}).state("app.tools.cannedAnswers",{url:"/cannedAnswers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",controller:"CannedAnswersController as vm"}},resolve:{cannedAnswers:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cannedAnswer@get",{fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"CannedAnswers",fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1001})}]},authenticate:!0,permissionId:1001,bodyClass:"tools"}).state("app.tools.customDashboards",{url:"/customDashboards",views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/customDashboards.html",controller:"CustomDashboardsController as vm"}},resolve:{customDashboards:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"CustomDashboards",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.customDashboards.edit",{url:"/:id?tab",params:{customDashboard:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/edit/view.html",controller:"CustomDashboardController as vm"}},resolve:{customDashboard:["apiResolver","$stateParams",function(e,n){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.intervals",{url:"/intervals",views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/intervals.html",controller:"IntervalsController as vm"}},resolve:{intervals:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Intervals",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.intervals.edit",{url:"/:id?tab",params:{interval:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/edit/view.html",controller:"IntervalController as vm"}},resolve:{interval:["apiResolver","$stateParams",function(e,n){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.pauses",{url:"/pauses",views:{"content@app":{templateUrl:"app/main/apps/tools/views/pauses/pauses.html",controller:"PausesController as vm"}},resolve:{pauses:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("pause@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Pauses",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1005})}]},authenticate:!0,permissionId:1005,bodyClass:"tools"}).state("app.tools.schedules",{url:"/schedules",views:{"content@app":{templateUrl:"app/main/apps/tools/views/schedules/schedules.html",controller:"SchedulesController as vm"}},resolve:{schedules:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("schedule@get",{fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Scheduler",fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1006})}]},authenticate:!0,permissionId:1006,bodyClass:"tools"}).state("app.tools.sounds",{url:"/sounds",views:{"content@app":{templateUrl:"app/main/apps/tools/views/sounds/sounds.html",controller:"SoundsController as vm"}},resolve:{sounds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("sound@get",{fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Sounds",fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1007})}]},authenticate:!0,permissionId:1007,bodyClass:"tools"}).state("app.tools.tags",{url:"/tags",views:{"content@app":{templateUrl:"app/main/apps/tools/views/tags/tags.html",controller:"TagsController as vm"}},resolve:{tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags",fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1008})}]},authenticate:!0,permissionId:1008,bodyClass:"tools"}).state("app.tools.templates",{url:"/templates",views:{"content@app":{templateUrl:"app/main/apps/tools/views/templates/templates.html",controller:"TemplatesController as vm"}},resolve:{templates:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("template@get",{fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Templates",fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1009})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.trunks",{url:"/trunks",views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/trunks.html",controller:"TrunksController as vm"}},resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.trunks.edit",{url:"/:id?tab",params:{trunk:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/edit/view.html",controller:"TrunkController as vm"}},resolve:{trunk:["apiResolver","$stateParams",function(e,n){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.variables",{url:"/variables",views:{"content@app":{templateUrl:"app/main/apps/tools/views/variables/variables.html",controller:"VariablesController as vm"}},resolve:{variables:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("variable@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Variables",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1012})}]},authenticate:!0,permissionId:1012,bodyClass:"tools"}),n.addPart("app/main/apps/tools")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.tools",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.tools.dispositions","app.tools.triggers"]).config(e)}(),function(){"use strict";function e(e){e.state("app.tools.dispositions",{url:"/dispositions",views:{"content@app":{templateUrl:"app/main/apps/tools/views/dispositions/dispositions.html",controller:"DispositionsController as vm"}},resolve:{dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1002})}]},authenticate:!0,permissionId:1002,bodyClass:"tools"})}e.$inject=["$stateProvider"],angular.module("app.tools.dispositions",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.tools.triggers",{url:"/triggers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/triggers.html",controller:"TriggersController as vm"}},resolve:{triggers:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Triggers",fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.triggers.edit",{url:"/:id?tab",params:{trigger:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/edit/view.html",controller:"TriggerController as vm"}},resolve:{trigger:["apiResolver","$stateParams",function(e,n){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"})}e.$inject=["$stateProvider"],angular.module("app.tools.triggers",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.video",{abstract:!0,url:"/video"}).state("app.video.screenRecordings",{url:"/screenRecordings",views:{"content@app":{templateUrl:"app/main/apps/video/views/screenRecordings/screenRecordings.html",controller:"ScreenRecordingsController as vm"}},resolve:{screenRecordings:["apiResolver","Auth","msUtils",function(e,n,t){return n.hasRole("admin")?e.resolve("screenRecording@get",{fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:t.firstLastDayMonth(),includeAll:"true",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ScreenRecordings",fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:t.firstLastDayMonth(),includeAll:"true",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadScreenRecordings",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2001})}]},authenticate:!0,permissionId:2001,bodyClass:"video"}),n.addPart("app/main/apps/video")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.video",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.inboundRoutes",{url:"/inboundRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundRoutes/inboundRoutes.html",controller:"InboundRoutesController as vm"}},resolve:{inboundRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"InboundRoutes",fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.inboundRoutes.edit",{url:"/:id?tab",params:{inboundRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundRoutes/edit/view.html",controller:"InboundRouteController as vm"}},resolve:{inboundRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.inboundRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.internalRoutes",{url:"/internalRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalRoutes/internalRoutes.html",controller:"InternalRoutesController as vm"}},resolve:{internalRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"InternalRoutes",fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.internalRoutes.edit",{url:"/:id?tab",params:{internalRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalRoutes/edit/view.html",controller:"InternalRouteController as vm"}},resolve:{internalRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.internalRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.outboundRoutes",{url:"/outboundRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundRoutes/outboundRoutes.html",controller:"OutboundRoutesController as vm"}},resolve:{outboundRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OutboundRoutes",fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.outboundRoutes.edit",{url:"/:id?tab",params:{outboundRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundRoutes/edit/view.html",controller:"OutboundRouteController as vm"}},resolve:{outboundRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.outboundRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/voice/views/realtime/realtime.html",controller:"VoiceRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:411})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.agents",{url:"/agents",params:{channel:"voice",direction:"inbound"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.telephones",{url:"/telephones",controller:"TelephonesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/telephones/view.html",resolve:{telephones:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Telephones",fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}],rpcTelephones:["apiResolver",function(e){return e.resolve("rpc@getTelephones")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.trunks",{url:"/trunks",controller:"TrunksVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queues",{url:"/queues",controller:"QueuesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"VoiceQueues":void 0,channel:"voice",type:"inbound",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.outbound_calls",{url:"/outbound_calls",controller:"OutboundCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/outbound_calls/view.html",resolve:{rpcCalls:["apiResolver",function(e){return e.resolve("rpc@getOutboundChannels")}]},authenticate:!0,permissionId:411})}e.$inject=["$stateProvider"],angular.module("app.voice.realtime",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.voice",{abstract:!0,url:"/voice"}).state("app.voice.voiceQueues",{url:"/voiceQueues",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/voiceQueues.html",controller:"VoiceQueuesController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.voiceQueues.edit",{url:"/:id?tab",params:{voiceQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/edit/view.html",controller:"VoiceQueueController as vm"}},resolve:{voiceQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.contexts",{url:"/contexts",views:{"content@app":{templateUrl:"app/main/apps/voice/views/contexts/contexts.html",controller:"ContextsController as vm"}},resolve:{contexts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceContext@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Contexts",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:405})}]},authenticate:!0,permissionId:405,bodyClass:"voice"}).state("app.voice.voicemails",{url:"/voicemails",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/voicemails.html",controller:"VoicemailsController as vm"}},resolve:{voicemails:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Voicemails",fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.voicemails.edit",{url:"/:id?tab",params:{voicemail:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/edit/view.html",controller:"VoicemailController as vm"}},resolve:{voicemail:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.musiconholds",{url:"/musiconholds",views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/musiconholds.html",controller:"MusicOnHoldsController as vm"}},resolve:{musiconholds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MusicOnHolds",fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.musiconholds.edit",{url:"/:id?tab",params:{musiconhold:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/edit/view.html",controller:"MusicOnHoldController as vm"}},resolve:{musiconhold:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.voiceRecordings",{url:"/voiceRecordings",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",controller:"VoiceRecordingsController as vm"}},resolve:{voiceRecordings:["apiResolver","Auth","msUtils",function(e,n,t){return n.hasRole("admin")?e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:t.firstLastDayMonth(),limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceRecordings",fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:t.firstLastDayMonth(),limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadVoiceRecordings,privacyEnabled",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.voiceRecordings.edit",{url:"/:id?tab",params:{voiceRecording:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/edit/view.html",controller:"VoiceRecordingController as vm"}},resolve:{voiceRecording:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadVoiceRecordings,privacyEnabled",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.chanSpies",{url:"/chanSpies",views:{"content@app":{templateUrl:"app/main/apps/voice/views/chanSpies/chanSpies.html",controller:"ChanSpiesController as vm"}},resolve:{chanSpies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceChanSpy@get",{fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChanSpies",fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:409})}]},authenticate:!0,permissionId:409,bodyClass:"voice"}).state("app.voice.voicePrefixes",{url:"/voicePrefixes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",controller:"VoicePrefixesController as vm"}},resolve:{voicePrefixes:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voicePrefix@get",{fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoicePrefixes",fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:410})}]},authenticate:!0,permissionId:410,bodyClass:"voice"}),n.addPart("app/main/apps/voice")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.voice",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.voice.inboundRoutes","app.voice.outboundRoutes","app.voice.internalRoutes","app.voice.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.whatsapp.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/realtime/realtime.html",controller:"WhatsappRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2110})}]},authenticate:!0,permissionId:2110}).state("app.whatsapp.realtime.agents",{url:"/agents",params:{channel:"whatsapp"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:2110}).state("app.whatsapp.realtime.queues",{url:"/queues",controller:"QueuesWhatsappRealtimeController as vm",templateUrl:"app/main/apps/whatsapp/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"WhatsappQueues":void 0,channel:"whatsapp",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2110})}e.$inject=["$stateProvider"],angular.module("app.whatsapp.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.whatsapp",{abstract:!0,url:"/whatsapp"}).state("app.whatsapp.whatsappQueues",{url:"/whatsappQueues",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/whatsappQueues.html",controller:"WhatsappQueuesController as vm"}},resolve:{whatsappQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2101,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappQueues.edit",{url:"/:id?tab",params:{whatsappQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/view.html",controller:"WhatsappQueueController as vm"}},resolve:{whatsappQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("whatsappQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2101,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappAccounts",{url:"/whatsappAccounts",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/whatsappAccounts.html",controller:"WhatsappAccountsController as vm"}},resolve:{whatsappAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappAccounts",fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2102})}]},authenticate:!0,permissionId:2102,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappAccounts.edit",{url:"/:id?tab",params:{whatsappAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/view.html",controller:"WhatsappAccountController as vm"}},resolve:{whatsappAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2102})}]},authenticate:!0,permissionId:2102,bodyClass:"whatsapp"}),n.addPart("app/main/apps/whatsapp")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.whatsapp",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.whatsapp.realtime"]).config(e)}(),function(){"use strict";angular.module("app.navigation",[]).config(function(){})}(),function(){"use strict";function e(e,n){e.addPart("app/quick-panel")}e.$inject=["$translatePartialLoaderProvider","msApiProvider"],angular.module("app.quick-panel",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.reset",{url:"/reset/:token",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.reset":{templateUrl:"app/reset/reset.html",controller:"ResetPasswordController as vm"}},bodyClass:"reset"}),n.addPart("app/reset")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.reset",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/toolbar")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.toolbar",[]).config(e)}(),function(){"use strict";angular.module("app.user-setting",[])}(),function(){"use strict";function e(e){e.interceptors.push("authInterceptor")}e.$inject=["$httpProvider"],angular.module("app.auth").config(e)}(),function(){"use strict";function e(e){e.onBefore({to:function(e){return!0===e.authenticate}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService;return n.isLoggedIn()?n.retrieveUser().catch(function(){return t.target("app.login",void 0,{reload:!0})}):t.target("app.login",void 0,{reload:!0})}),e.onStart({to:function(e){return"app.login"!==e.name}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService,a=e.$to();if(n.hasRole("agent")&&"app.dashboards.general"!=a.name)return t.target("app.dashboards.general",{redirect:!1},{reload:!0})}),e.onFinish({to:function(e){return"app.help"===e.parent.name}},function(e){var n=e.router.stateService;if("app.help"===e.$to().parent.name){var t=e.injector().get("settingsManager"),a=t?t.get():null;if(!a||!a.viewHelpSection)return n.target("app.dashboards.general",{redirect:!1},{reload:!0})}}),e.onFinish({to:function(e){return e.permissionId}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService,a=e.$to();if(n.hasRole("user")){if(!n.hasPermission(a.permissionId))return t.target("app.dashboards.general",{redirect:!1},{reload:!0});var i=e.params().id?Number(e.params().id):void 0;if(i)return n.hasResourcePermission(a.permissionId,i).catch(function(){return t.target(a.parent.name,{redirect:!1},{reload:!0})})}}),e.onFinish({to:function(e){return"app.dashboards.general"===e.parent.name}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService;e.$to();if(n.hasRole("user")&&!n.hasPermission(100))return t.target("app.dashboards.general",{redirect:!1},{reload:!0})})}e.$inject=["$transitions"],angular.module("app.auth").run(e)}(),function(){"use strict";function e(a,e,o,i,s,r,l,d,c){var m;return{getToken:n,getCurrentUser:u,getPermissions:A,hasChildrenPermissions:function(e){return!!e&&_.some(e,function(e){return t(e)})},hasModulePermissions:function(i){return o(function(a,n){f()?a(!0):r.userProfileSection.get({userProfileId:m.userProfileId}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(_.isEmpty(n))a(!1);else{var t=_.filter(n,function(e){return e.enabled});a(_.some(t,["category",i]))}}).catch(function(e){n(e)})})},hasModulesPermissions:function(s){return o(function(a,n){var i={};f()?(s.forEach(function(e){i[e]=!0}),a(i)):r.userProfileSection.get({userProfileId:m.userProfileId}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(_.isEmpty(n))a({});else{var t=_(n).filter(function(e){return e.enabled&&_.includes(s,e.category)}).uniqBy(function(e){return e.category}).map(function(e){return e.category}).value();t.forEach(function(e){i[e]=!0}),a(i)}}).catch(function(e){n(e)})})},hasRole:function(e){return!!m&&m.role===e},hasPermission:t,hasResourcePermission:function(e,s){return o(function(a,i){return r.userProfileSection.get({userProfileId:m.userProfileId,sectionId:e}).$promise.then(function(e){var n=e.rows[0];if(n.autoAssociation)return a();var t=l.getActiveItem().node;return t.permissions&&!1===t.permissions.association?a():r.userProfileResource.get({sectionId:n.id,nolimit:!0}).$promise.then(function(e){var n=e.rows;_.some(n,["resourceId",s])?a():i()})}).catch(function(e){i("Error retrieving user profile permissions",e)})})},hasSectionPermissions:function(a){return o(function(e,n){var t={};return E().then(function(){_.includes(m.permissions,a)&&(t[a]=!0),e(t)}).catch(function(e){n(e)})})},hasSectionsPermissions:function(a){return o(function(e,n){var t={};if(!f())return E().then(function(){a.forEach(function(e){_.includes(m.permissions,e)&&(t[e]=!0)}),e(t)}).catch(function(e){n(e)});a.forEach(function(e){t[e]=!0}),e(t)})},isAgent:h,isAdmin:f,isLoggedIn:function(){return!!n()},isTelephone:function(){return"telephone"===m.role},isUser:b,login:function(e){return o(function(n,t){r.auth.local(e).$promise.then(function(e){return d.get().secureCookieEnabled?c.set("motion.token",e.token,{secure:!0,sameSite:"none"}):c.set("motion.token",e.token),r.user.get({id:e.id}).$promise}).then(function(e){(m=e).lastLoginAt=moment().format("YYYY-MM-DD HH:mm:ss"),y("LOCAL_LOGIN")}).then(function(){if(h()&&1===m.showWebBar&&m.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return h()&&0!==m.showWebBar?p(e):f()||b()?g(!0):void 0}).then(function(e){m=_.assign(m,e),n()}).catch(function(e){t(e)})})},logout:function(t){return o(function(e,n){t?(v(),e()):o.resolve().then(function(){return h()&&0!==m.showWebBar?o(function(e,n){r.user.logout({id:m.id,device:"web"}).$promise.then(function(){e()}).catch(function(e){n(e)})}):f()||b()?g(!1):void 0}).then(function(){v(),e()}).catch(function(e){n(e)})})},parseCrudPermissions:function(e){return f()?{readOnly:!1,canEdit:!0,canDelete:!0}:e?{readOnly:!(!_.includes(e,"r")||1!==e.length),canEdit:!!_.includes(e,"e"),canDelete:!!_.includes(e,"d")}:{readOnly:!0,canEdit:!1,canDelete:!1}},queueLogin:p,reloadPermissions:E,removeCookies:v,retrieveUser:function(){return o(function(n,t){r.user.whoami({userSetting:!0}).$promise.then(function(n){return"user"===n.role?A(n.userProfileId).then(function(e){return n.permissions=e,n}):n}).then(function(e){n(m=e)}).catch(function(e){t(e)})})},setCurrentUser:function(e){m=_.merge(m,e)},getAuthenticationType:function(){var e=u(),n=i.localStorage.getItem("motion2.user:"+e.id);if(n)return JSON.parse(n).authenticationType;return"NONE"},loginSSO:function(e){"google"!==e&&y("SSO_LOGIN");return"/api/auth/"+e},loginAD:function(e){return o(function(n,t){r.auth.activedirectory(e).$promise.then(function(e){return d.get().secureCookieEnabled?c.set("motion.token",e.token,{secure:!0,sameSite:"none"}):c.set("motion.token",e.token),r.user.get({id:e.id}).$promise}).then(function(e){(m=e).lastLoginAt=moment().format("YYYY-MM-DD HH:mm:ss"),y("SSO_LOGIN")}).then(function(){if(h()&&1===m.showWebBar&&m.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return h()&&0!==m.showWebBar?p(e):f()||b()?g(!0):void 0}).then(function(e){m=_.assign(m,e),n()}).catch(function(e){t(e)})})}};function n(){return e.get("motion.token")}function u(){return m}function p(e){return o(function(n,t){r.user.login({id:m.id,device:"web",intrf:e}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}function g(a){return o(function(n,t){var e={online:a,lastLoginAt:a?moment().format("YYYY-MM-DD HH:mm:ss"):void 0};r.user.update({id:m.id},e).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}function v(){e.remove("motion.token"),m&&(i.localStorage.removeItem("motion.user:"+m.id),m=null)}function h(){return"agent"===m.role}function f(){return"admin"===m.role}function b(){return"user"===m.role}function t(e){return!!m&&_.includes(m.permissions,e)}function A(e){var a=[];return o(function(n,t){return e||n(a),r.userProfile.getSections({id:e}).$promise.then(function(e){for(var n=0;n<e.length;n++){var t=e[n];a.push(t.sectionId),t.subsections&&(a=_.concat(a,t.subsections))}return a}).then(function(e){n(e)}).catch(function(e){t("Error retrieving user profile permissions",e)})})}function E(){return o(function(n,t){A(m.userProfileId).then(function(e){m.permissions=e,n()}).catch(function(e){t(e)})})}function y(e){var n=u(),t={authenticationType:e};i.localStorage.setItem("motion2.user:"+n.id,JSON.stringify(t))}}e.$inject=["$mdDialog","$cookies","$q","$window","$document","api","msNavigationService","settingsManager","jscookie"],angular.module("app.auth").factory("Auth",e)}(),function(){"use strict";function e(n,e){this.telephones=e,this.closeDialog=function(e){n.hide(e)},e.count&&(this.name=e.rows[0].name)}e.$inject=["$mdDialog","telephones"],angular.module("app.auth").controller("HotDeskDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s;return{request:function(e){var n=t.get("motion.token");return e.headers=e.headers||{},i.isSameOrigin(e.url)&&n&&(e.headers.Authorization="Bearer "+n),e},responseError:function(e){switch(e.status){case 401:t.remove("motion.token"),(s||(s=a.get("$state"))).go("app.login")}return n.reject(e)}}}e.$inject=["$rootScope","$q","$cookies","$injector","Util"],angular.module("app.auth").factory("authInterceptor",e)}(),function(){"use strict";function e(n){var t={safeCb:function(e){return angular.isFunction(e)?e:angular.noop},urlParse:function(e){var n=document.createElement("a");return n.href=e,""===n.host&&(n.href=n.href),n},isSameOrigin:function(i,e){return i=t.urlParse(i),(e=(e=e&&[].concat(e)||[]).map(t.urlParse)).push(n.location),1<=(e=e.filter(function(e){var n=i.hostname===e.hostname,t=i.protocol===e.protocol,a=i.port===e.port||""===e.port&&("80"===i.port||"443"===i.port);return n&&t&&a})).length}};return t}e.$inject=["$window"],angular.module("app.auth").factory("Util",e)}(),function(){"use strict";function e(e,n,t){var a={initLogger:function(){return i.init({uri:t.baseUrl+"logs/client-logs",initial_state_name:"client-logs",flushInterval:6e4,debounceInterval:10,sizeLimit:300,silent:!1,autoLog:["error"],heartbeat:!1,logUnload:!1,logPerformance:!1}),i.addHeaderBuilder(function(){return(e=n.get("motion.token"))?{Authorization:"Bearer "+e}:{};var e}),i}},i=e.$logger;if(!i)throw new Error("Beaver Logger not found");return a}function n(d,e,t){var n={getLogger:function(l){var e=function(r){return function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];var a=n[0],i=n.slice(1),s="string"!=typeof a||"string"==typeof a&&0===i.length?l:a,o=1<n.length&&"string"==typeof a?i:n;(function(e,n,t){if(!d.isLoggedIn())return;var a=d.getCurrentUser();if(!a||!a.userSetting.clientSideLoggingEnabled)return;if(i=e,!(c.indexOf(i)>=c.indexOf(m)))return;var i;var s=n,o=t;"string"==typeof n&&void 0===t&&(s=e,o=n);u[e].call(u,s,{data:p(o)})}).call(this,r,s,o)}};return{error:e("error"),warn:e("warn"),info:e("info"),debug:e("debug")}},getLoggingColors:function(){return{disabled:{color:"#616161"},debug:{color:"#283593"},info:{color:"#000000"},warning:{color:"#FBC02D"},error:{color:"#FF5252"}}},flush:a},c=["debug","info","warn","error"],m="debug",u=e.initLogger();function p(t){return Array.isArray(t)?t.map(p):null===t||"object"!=typeof t?t:_.isPlainObject(t)?t:t&&"function"==typeof t.toJSON?t.toJSON():t instanceof Error?Object.getOwnPropertyNames(t).reduce(function(e,n){return e[n]=p(t[n]),e},{}):JSON.parse(JSON.stringifyOnce(t))}function a(){return u.flush()}return t.$on("local:user-setting-updated",function(e,n){n.clientSideLoggingEnabled?t.$broadcast("client-side-logging:enabled"):(a(),t.$broadcast("client-side-logging:disabled")),m=n.clientSideLoggingLevel}),t.$on("local:user-logout",function(){m="debug"}),JSON.stringifyOnce=function(i,s,e){var o=[],r=[];return e||(e=2),JSON.stringify(i,function(e,t){if(2e3<o.length)return"object too long";var a=!1;if(o.forEach(function(e,n){e===t&&(a=n)}),""==e)return o.push(i),r.push("root"),t;if(a+""!="false"&&"object"==typeof t)return"root"==r[a]?"(pointer to root)":"(see "+(t&&t.constructor?t.constructor.name.toLowerCase():typeof t)+" with key "+r[a]+")";var n=e||"(empty key)";return o.push(t),r.push(n),s?s(e,t):t},e)},n}e.$inject=["$window","$cookies","api"],n.$inject=["Auth","clientSideLogger","$rootScope"],angular.module("app.client-side-logging").factory("clientSideLogger",e).service("ClientSideLoggingService",n)}(),function(){"use strict";angular.module("app.core").provider("motionConfig",function(){var t={disableCustomScrollbars:!1,disableMdInkRippleOnMobile:!0,disableCustomScrollbarsOnMobile:!0};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){var e={getConfig:function(e){if(angular.isUndefined(t[e]))return!1;return t[e]},setConfig:function(e,n){t[e]=n}};return e}})}(),function(){"use strict";function e(e,n,t){n.debugEnabled(!0),e.config({tabindex:!1}),t.config({disableCustomScrollbars:!1,disableCustomScrollbarsOnMobile:!0,disableMdInkRippleOnMobile:!0})}e.$inject=["$ariaProvider","$logProvider","motionConfigProvider"],angular.module("app.core").config(e)}(),function(){"use strict";function e(e,n,t){(n.generate(),t.getConfig("disableMdInkRippleOnMobile")&&e.isMobile())&&angular.element("body").attr("md-no-ink",!0);e.isMobile()&&angular.element("html").addClass("is-mobile");var a=e.detectBrowser();if(a){var i=a.browser+" "+a.version+" "+a.os;angular.element("html").addClass(i)}}e.$inject=["msUtils","motionGenerator","motionConfig"],angular.module("app.core").run(e)}(),function(){"use strict";function e(n,e,t,a,i,s){var l=this;function o(){var e=_.filter(l.searchOptions.conditions,["disabled",!1]),o=[],r="";if(_(e).groupBy("name").forEach(function(e){var n=e[0],t=1<e.length,a=n.query.column;if(t){var i=_(e).groupBy(function(e){return e.query.operator}).mapValues(function(e){return _.chain(e).map(function(e){return e.query.value}).flattenDeep().value()}).value(),s=[];_.keys(i).forEach(function(e){var n=i[e],t=e;_.includes(["$between","$in","$notIn"],e)?t+="["+n+"]":n.forEach(function(e){t+="["+e+"]"}),s.push(t)}),r+=a+":="+s.join(":=")}else r=a+":="+n.query.operator+"["+n.query.value+"]";o.push(r)}),0!==o.length){var n="["+l.searchOptions.matchType+"]";return n+=o.join("||")}}function r(){var e=n.localStorage.getItem("motion2."+s+":"+l.currentUser.id);return e?JSON.parse(e):{}}function d(e){n.localStorage.setItem("motion2."+s+":"+l.currentUser.id,JSON.stringify(e))}function c(){if(s){var e=r();e.advancedSearch=_.omit(l.searchOptions,"fields"),d(e)}}function m(){return!!r().advancedSearch}l.currentUser=t.getCurrentUser(),l.searchOptions={matchType:"$and",conditions:[],fields:i},l.toolbarColor=a,l.onInit=function(){if(s){var e=r();e.hasOwnProperty("advancedSearch")&&(l.searchOptions=_.merge(l.searchOptions,e.advancedSearch))}},l.applyFilter=function(){c(),e.hide({apply:!0,value:o()})},l.clearConditions=function(){l.searchOptions.conditions=[],function(){if(s){var e=r();delete e.advancedSearch,e.query&&delete e.query.search,d(e)}}()},l.minimize=function(){c(),e.hide({apply:!m(),value:o()||m()?!_.isEmpty(l.searchOptions.conditions):void 0})},l.close=function(){e.hide({apply:!m(),value:o()||m()?!_.isEmpty(l.searchOptions.conditions):void 0})}}e.$inject=["$window","$mdDialog","Auth","color","fields","storagePath"],angular.module("app.core").controller("AdvancedSearchController",e)}(),function(){"use strict";function e(a){return{restrict:"A",link:function(e,n,t){e.$watch(t.focusOn,function(e){a(function(){e?n[0].focus():n[0].blur()})})}}}e.$inject=["$timeout"],angular.module("app.core").directive("focusOn",e)}(),function(){"use strict";function e(o,l,d){return{restrict:"E",compile:function(e,n){var s;return n.code||(s=e.html(),e.empty()),function(t,a,r){r.code&&(s=t.$eval(r.code));var i=t.$eval(r.shouldInterpolate);l.when(s).then(function(e){if(e){i&&(e=d(e)(t));var n=angular.element('<pre><code class="highlight" ng-non-bindable></code></pre>');a.append(n),o(function(){!function(e,n){var t=n.find("code"),a=e.split("\n"),i=(a=a.filter(function(e){return e.trim().length}))[0].match(/^\s*/)[0],s=new RegExp("^"+i);a=a.map(function(e){return e.replace(s,"").replace(/\s+$/,"")});var o=hljs.highlight(r.language||r.lang,a.join("\n"),!0);o.value=o.value.replace(/=<span class="hljs-value">""<\/span>/gi,"").replace("<head>","").replace("<head/>",""),t.append(o.value).addClass("highlight")}(e,n)},34,!1)}})}}}}e.$inject=["$timeout","$q","$interpolate"],angular.module("app.core").directive("hljs",e)}(),function(){"use strict";function e(s,o,e,t){var r=this;function n(){var a=r.selectedField.options&&!_.isEmpty(r.selectedField.options.extraOperators),i=r.selectedField.options&&!_.isEmpty(r.selectedField.options.excludedOperators);r.availableOperators=_.filter(r.operators,function(n){var e=!n.applyTo||_.includes(n.applyTo,r.selectedField.type);n.isExtra=a&&_.some(r.selectedField.options.extraOperators,function(e){return e===n.type});var t=_.includes(n.excludeFrom,r.selectedField.type)||i&&_.includes(r.selectedField.options.excludedOperators,n.type);if((e||n.isExtra)&&!t)return n})}function l(n){return e[n.model][n.action](n.params).$promise.then(function(e){if("autocomplete"!==r.selectedField.type)return e.rows;var n=r.searchText?_.filter(e.rows,function(e){e.displayValue="";for(var n=0;n<r.selectedField.options.searchFields.length;n++){var t=e[r.selectedField.options.searchFields[n]]||"";e.displayValue+=t+" "}return _.trimEnd(e.displayValue),_.includes(e.displayValue.toLowerCase(),r.searchText.toLowerCase())}):[];return o.when(n)}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:n.model.toUpperCase()+"."+n.action.toUpperCase(),msg:e.data?JSON.stringify(e.data.message):e.toString()})})}function a(){!r.value||_.isArray(r.value)&&_.isEmpty(r.value)?r.isValidCondition=!1:r.selectedOperator?r.selectedOperator&&"$between"===r.selectedOperator.type?r.isValidCondition=!(!r.endRangeValue||!r.isValidRange):r.isValidCondition=!0:r.isValidCondition=!1}function i(){"number"===r.selectedField.type?_.isNumber(r.endRangeValue)?r.isValidRange=Number(r.endRangeValue)>Number(r.value):r.isValidRange=!0:"date"===r.selectedField.type&&(r.maxDateRange=moment(r.endRangeValue).subtract(1,"day"),r.isValidRange=!0),a()}function d(){var e=m();r.options.conditions.push(e),p()}function c(){var e=m(),n=_.findIndex(r.options.conditions,"style");r.options.conditions.splice(n,1,e),p(),r.pendingCondition.style=null,r.pendingCondition=void 0}function m(){return{name:r.selectedField.name,operator:s.instant("DASHBOARDS."+r.selectedOperator.translate),value:r.value,endValue:r.endRangeValue,displayValue:u(r.value),displayEndValue:u(r.endRangeValue),query:{column:r.selectedField.column,operator:r.selectedOperator.type,value:function(){var e,n=r.value,t=r.endRangeValue;switch(r.selectedField.type){case"date":var a=moment(n).utcOffset(0,!0).format("YYYY-MM-DD");if("$between"===r.selectedOperator.type){var i=moment(t).utcOffset(0,!0).format("YYYY-MM-DD");e=[a,i]}else e=a;break;case"number":e="$between"===r.selectedOperator.type?[n,t]:n;break;case"multiselect":var s=r.selectedField.options.field||"name";e=_.map(n,s);break;case"select":e=n.id;break;case"autocomplete":e=r.selectedOperator.isExtra?n:n.id;break;default:e=n}return e}()},disabled:!1}}function u(e){var n;if(e){switch(r.selectedField.type){case"date":n=moment(e).format("YYYY-MM-DD");break;case"multiselect":var t=_.map(e,function(e){return e.name});n="$eq"===r.selectedOperator.type?t.join(" or "):t.join(" and ");break;case"select":n=e.name;break;case"autocomplete":n=r.selectedOperator.isExtra?e:e.displayValue;break;default:n=e}return n}}function p(){r.value=null,r.endRangeValue=null,r.minDateRange=null,r.maxDateRange=null,r.isValidCondition=!1}r.operators=r.availableOperators=[{type:"$eq",symbol:"=",translate:"EQUALS",excludeFrom:["multiselect"]},{type:"$ne",symbol:"≠",translate:"IS_NOT_EQUAL",excludeFrom:["multiselect"]},{type:"$in",symbol:"∈",translate:"IS_AMONG",applyTo:["multiselect"]},{type:"$notIn",symbol:"∉",translate:"IS_NOT_AMONG",applyTo:["multiselect"]},{type:"$substring",symbol:"⊃",translate:"CONTAINS",applyTo:["text"]},{type:"$startsWith",symbol:"a..",translate:"STARTS_WITH",applyTo:["text"]},{type:"$endsWith",symbol:"..a",translate:"ENDS_WITH",applyTo:["text"]},{type:"$lt",symbol:"<",translate:"IS_LESS_THAN",applyTo:["date","number"]},{type:"$gt",symbol:">",translate:"IS_GREATER_THAN",applyTo:["date","number"]},{type:"$lte",symbol:"≤",translate:"IS_LESS_THAN_OR_EQUAL_TO",applyTo:["date","number"]},{type:"$gte",symbol:"≥",translate:"IS_GREATER_THAN_OR_EQUAL_TO",applyTo:["date","number"]},{type:"$between",symbol:"≬",translate:"IS_BETWEEN",applyTo:["date","number"]}],r.addCondition=d,r.editCondition=function(e){r.pendingCondition=e,r.pendingCondition.style="md-amber-200-bg",r.selectedField=_.find(r.options.fields,["name",r.pendingCondition.name]),n(),r.selectedOperator=_.find(r.availableOperators,["type",r.pendingCondition.query.operator]),"date"===r.selectedField.type&&"string"==typeof r.pendingCondition.value?(r.value=new Date(r.pendingCondition.value),r.minDateRange=moment(r.value).add(1,"day"),r.endRangeValue=r.pendingCondition.endValue?new Date(r.pendingCondition.endValue):void 0):(r.value=r.pendingCondition.value,r.endRangeValue=r.pendingCondition.endValue);r.isValidRange=!0,r.isValidCondition=!0},r.updateCondition=c,r.cancelUpdateCondition=function(){r.pendingCondition.style=null,r.pendingCondition=void 0},r.setConditionStatus=function(e){e.style=e.disabled?void 0:"chip-disabled",e.disabled=!e.disabled},r.removeCondition=function(){_.isEmpty(r.options.conditions)&&r.clearFilter()},r.getValues=function(){{if(r.selectedField.options.routes&&Array.isArray(r.selectedField.options.routes)){var e=angular.copy(r.selectedField.options.routes),n=_.map(e,function(e){return l(e)});return o.all(n).then(function(e){r.selectedField.values=_.flatten(e)})}var t=angular.copy(r.selectedField.options.route);if("autocomplete"===r.selectedField.type)for(var a=0;a<Object.keys(t.params).length;a++){var i=Object.keys(t.params)[a];"@autocomplete"===t.params[i]&&(t.params[i]=r.searchText)}if(!r.selectedField.values)return l(t).then(function(e){r.selectedField.values=_.flatten(e)});r.selectedField.values.forEach(function(e){e.translate&&(e.name=s.instant(e.translate))})}},r.onFieldChange=function(){r.value=void 0,r.endRangeValue=void 0,r.searchText=void 0,r.isValidCondition=!1,n(),r.autoSelectOperator=1===r.availableOperators.length,r.autoSelectOperator||(r.selectedOperator=void 0)},r.onOperatorChange=function(e){r.isValidRange=!0,r.selectedOperator&&(e?e.applyTo?0<_.difference(r.selectedOperator.applyTo,e.applyTo).length&&(r.value=null):r.selectedOperator.applyTo&&(r.value=null):r.value||(r.value=null),"between"!=r.selectedOperator.type&&(r.endRangeValue=null),r.selectedField.options&&!_.isEmpty(r.selectedField.options.extraOperators)&&(r.selectedOperator.isExtra=_.some(r.selectedField.options.extraOperators,function(e){return e===r.selectedOperator.type})));a()},r.onValueChange=function(){r.selectedOperator&&"$between"===r.selectedOperator.type?"number"===r.selectedField.type?i():"date"===r.selectedField.type&&(r.minDateRange=moment(r.value).add(1,"day"),a()):a()},r.checkRange=i,r.handleKeyboardAction=function(){r.pendingCondition?c():d()}}e.$inject=["$translate","$q","api","toasty"],angular.module("app.core").directive("msAdvancedSearch",function(){return{restrict:"E",scope:{options:"=",clearFilter:"&"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-advanced-search/ms-advanced-search.html"}})}(),function(){"use strict";angular.module("app.core").directive("msCard",function(){return{restrict:"E",scope:{templatePath:"=template",card:"=ngModel",vm:"=viewModel"},template:'<div class="ms-card-content-wrapper" ng-include="templatePath" onload="cardTemplateLoaded()"></div>',compile:function(e){return e.addClass("ms-card"),function(e,n){e.cardTemplateLoaded=function(){e.$emit("msCard::cardTemplateLoaded",n)}}}}})}(),function(){"use strict";angular.module("app.core").directive("msChipColor",function(){return{restrict:"A",link:function(e,i,n){n.$observe("msChipColor",function(e){var n=i.parent().parent();if(n.hasClass("md-background-bg md-hue-3")||n.addClass("md-background-bg md-hue-3"),_.isEmpty(e)){var t=n[0].className.split(" "),a=t.indexOf("md-hue-3");t.length=a+1,n[0].className=t.join(" ")}else n.addClass(e)})}}})}(),function(){"use strict";angular.module("app.core").directive("msClickToCall",function(){return{restrict:"E",scope:{type:"=",disabled:"=",target:"=",prefix:"=",license:"="},controller:["$scope","$rootScope","$http","$translate","$document","$mdDialog","Auth","toasty","api",function(t,n,a,i,s,o,e,r,l){function d(e){switch(t.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/originate/"+c(e));case 2:return n.$broadcast("webrtc::call",{target:c(e)})}}function c(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function m(e){return a.get(e).success(function(){r.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){r.error({title:"PhoneBar API Error",msg:i.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}t.currentUser=e.getCurrentUser(),t.privacy=t.currentUser.privacyEnabled,t.showMenu=function(){return t.target&&t.target.indexOf("@")<0&&t.target!=t.currentUser.internal&&t.target!=t.currentUser.name&&(0==t.currentUser.showWebBar&&t.currentUser.phoneBarRemoteControl||2==t.currentUser.showWebBar&&t.license.webrtc)&&!t.disabled},t.call=function(e){return 2!==t.currentUser.showWebBar?(n=e,l.user.getVoicePrefixes({id:t.currentUser.id}).$promise.then(function(e){if(e.count)return o.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{prefixes:e,required:t.currentUser.phoneBarPrefixRequired}})}).then(function(e){t.currentUser.phoneBarPrefixRequired?e&&-1!==e&&d(e+n):e&&-1!==e?d(e+n):e||d(n)})):d(e);var n},t.transfer=function(e){switch(t.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+c(e));case 2:n.$broadcast("webrtc::transfer",{target:c(e)})}}}],templateUrl:"app/core/directives/ms-click-to-call/ms-click-to-call.html"}})}(),function(){"use strict";n.$inject=["ClientSideLoggingService","$rootScope","$translate"];var e={bindings:{user:"<"},controller:n,controllerAs:"vm",templateUrl:"app/core/directives/ms-client-side-logging/ms-client-side-logging-icon.html"};function n(e,n,t){var a=this,i=e.getLoggingColors();function s(){a.tooltipHTML=a.user.userSetting.clientSideLoggingEnabled?[t.instant("STAFF.CLIENT_LOGS_ENABLED"),t.instant("STAFF.CLIENT_LOGS_LOGLEVEL",{logLevel:a.user.userSetting.clientSideLoggingLevel}),t.instant("STAFF.CLIENT_LOGS_ENABLED_SINCE",{enabledSince:moment(a.user.userSetting.clientSideLoggingEnabledSince).format("LLLL")})].join("<br>"):t.instant("STAFF.CLIENT_LOGS_DISABLED")}a.tooltipHTML=t.instant("STAFF.CLIENT_LOGS_DISABLED"),a.styleColor=i.disabled,a.styleIcon=a.user.userSetting&&a.user.userSetting.clientSideLoggingEnabled?"icon-checkbox-marked-circle":"icon-close",a.$onInit=function(){if(!a.user.userSetting)return;var e=a.user.userSetting.clientSideLoggingEnabled?a.user.userSetting.clientSideLoggingLevel:"disabled";a.styleColor=i[e],"info"===e&&(a.styleIcon="icon-checkbox-marked-circle-outline");return s()},a.$onDestroy=function(){o()};var o=n.$on("$translateChangeSuccess",s)}angular.module("app.core").component("msClientSideLoggingIcon",e)}(),function(){"use strict";n.$inject=["ClientSideLoggingService","UserSettingService","$q","$translate","$rootScope","$interval"];var e={bindings:{user:"<",onUserUpdate:"&"},controller:n,controllerAs:"vm",templateUrl:"app/core/directives/ms-client-side-logging/ms-client-side-logging.html"};function n(e,t,n,a,i,s){var o=this,r=e.getLoggingColors(),l=null;function d(){l&&s.cancel(l)}o.styleProperties=r.disabled,o.clientSideLoggingEnabledSince="",o.$onInit=function(){m().then(function(){d(),l=s(u,6e4)})},o.$onChanges=function(e){e&&n.resolve().then(m)},o.$onDestroy=function(){d(),c()},o.onEnabledSwitchChange=function(){var e=o.user.userSetting.clientSideLoggingEnabled,n=o.user.userSetting.clientSideLoggingLevel;return p(e,n)},o.onLogLevelSelectionChange=function(){var e=o.user.userSetting.clientSideLoggingEnabled,n=o.user.userSetting.clientSideLoggingLevel;p(e,n)},o.computeStyleForLoggingLevel=function(e){return r[e]};var c=i.$on("$translateChangeSuccess",u);function m(){o.availableClientSideLoggingLevels=Object.keys(r).filter(function(e){return"disabled"!==e});var e=o.user.userSetting&&o.user.userSetting.clientSideLoggingEnabled?o.user.userSetting.clientSideLoggingLevel:"disabled";return o.styleProperties=r[e],u()}function u(){if(o.user.userSetting)return o.user.userSetting.clientSideLoggingEnabled?void(o.clientSideLoggingEnabledSince=a.instant("STAFF.CLIENT_LOGS_ENABLED_SINCE",{enabledSince:moment(moment(o.user.userSetting.clientSideLoggingEnabledSince).format()).fromNow()})):o.clientSideLoggingEnabledSince=""}function p(e,n){return t.updateUserSettingById(o.user.userSetting.id,{clientSideLoggingEnabled:e,clientSideLoggingLevel:n}).then(function(){"function"==typeof o.onUserUpdate&&o.onUserUpdate()})}}angular.module("app.core").component("msClientSideLogging",e)}(),function(){"use strict";function e(i){return{require:"ngModel",priority:1,link:function(e,n,t,a){a.$formatters.push(i.formatter),a.$parsers.push(i.parser)}}}e.$inject=["msDatepickerFixConfig"],angular.module("app.core").provider("msDatepickerFixConfig",function(){var n={formatter:function(e){return e?""===e?e:new Date(e):""},parser:function(e){return e?moment(e).add(moment(e).utcOffset(),"m").toDate():""}};this.config=function(e){n=angular.extend({},n,e)},this.$get=function(){return n}}).directive("msDatepickerFix",e)}(),function(){"use strict";function e(s){return{restrict:"E",scope:{id:"=",model:"=",element:"=",title:"=",path:"="},replace:!0,link:function(n,e){var t=!1,a={};a.id=n.id,_.isNil(n.path)||(a.path=n.path);var i=document.createElement(n.element);i.setAttribute("preload","none"),i.setAttribute("controls","true"),"audio"===n.element&&i.setAttribute("style","width: 265px;"),"video"===n.element&&i.setAttribute("style","max-width: 500px;"),i.setAttribute("title",n.title),i.setAttribute("src"," "),i.onplay=function(e){t||(t=!0,e.preventDefault(),s[n.model].download(a).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type});i.setAttribute("type",e.type),i.setAttribute("src",URL.createObjectURL(t)),i.play()}).catch(function(e){console.error(e)}))},e.append(i)}}}e.$inject=["api"],angular.module("app.core").directive("msDialogRecording",e)}(),function(){"use strict";function e(i){return{restrict:"A",link:function(t,a){a.bind("click",function(e){var n=i('<div layout="row" class="spinner-overlay" layout-sm="column" layout-align="center center" aria-label="wait"><md-progress-circular md-mode="indeterminate"></md-progress-circular></div>')(t);a.closest("md-dialog").prepend(n)})}}}e.$inject=["$compile"],angular.module("app.core").directive("msDialogSpinner",e)}(),function(){"use strict";function e(){var o=this;function a(e,n,t,a){var i=[];if(0<=t)i.push(e[t]),n.push(e[t]),e.splice(t,1);else{for(var s=0;s<e.length;s++)void 0!==e[s].isValid&&e[s].isValid&&n.push(e[s]);for(s=e.length-1;0<=s;s--)e[s].isValid&&e.splice(s,1);i=n}o.options.transferCallback&&o.options.transferCallback(i,a)}o.canTransfer=function(e,n,t){if(void 0!==e.isValid&&e.isValid)return t?a(n.selectedItems,n.items,n.selectedItems.indexOf(e),t):a(n.items,n.selectedItems,n.items.indexOf(e),t)},o.transfer=a,o.getLine=function(e,n){var t="";if(_.isNil(n))return t;{if(_.isArray(n)){for(var a=0;a<n.length;a++)t+=" "+(e[n[a]]?e[n[a]]:"");return t}return e[n]?e[n]:""}}}angular.module("app.core").directive("msDualMultiselect",function(){return{restrict:"E",scope:{options:"=",readOnly:"=",addDisabled:"<"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html"}})}(),function(){"use strict";function e(a){return{restrict:"E",replace:!0,scope:{onReply:"&",ngModel:"=",ctrlMethods:"=",pickerPosition:"=",search:"=",recentEmojis:"=",placeholder:"="},template:'<textarea class="emojionearea"></textarea>',link:function(t,e){var n=e.emojioneArea({pickerPosition:t.pickerPosition,search:t.search,recentEmojis:t.recentEmojis,placeholder:a.instant(t.placeholder||"Type a message"),attributes:{spellcheck:!0},events:{keyup:function(e,n){t.ngModel=this.getText(),t.onReply({event:n,body:this.getText()})},emojibtn_click:function(){t.ngModel=this.getText()}}});t.ngModel&&n[0].emojioneArea.setText(t.ngModel),t.internalControl=t.ctrlMethods||{},t.internalControl.setText=function(e){n[0].emojioneArea.setText(e)},t.internalControl.getText=function(){return n[0].emojioneArea.getText()},t.$watch("ngModel",function(e){e||n[0].emojioneArea.setText("")})}}}e.$inject=["$translate"],angular.module("app.core").directive("msEmojiArea",e)}(),function(){"use strict";angular.module("app.core").directive("msFontFamily",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.fonts=[{option:"Arial",value:"Arial,Helvetica,sans-serif"},{option:"Century Gothic",value:"Century Gothic,Futura,Didact Gothic,san-serif"},{option:"Calibri",value:"Calibri, Verdana, Geneva, sans-serif"},{option:"Comic Sans MS",value:"Comic Sans MS,cursive"},{option:"Courier New",value:"Courier New,Courier,monospace"},{option:"Georgia",value:"Georgia,serif"},{option:"Lucida Sans Unicode",value:"Lucida Sans Unicode,Lucida Grande,sans-serif"},{option:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{option:"Times New Roman",value:"Times New Roman,Times,serif"},{option:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{option:"Verdana",value:"Verdana,Geneva,sans-serif"}]}],templateUrl:"app/core/directives/ms-font-family/ms-font-family.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsFormWizardController",function(){var n=this;function e(){return n.forms.length}function t(){return 0===n.selectedIndex}function a(){return n.selectedIndex===e()-1}n.forms=[],n.selectedIndex=0,n.registerForm=function(e){n.forms.push(e)},n.previousStep=function(){if(t())return;n.selectedIndex--},n.nextStep=function(){if(a())return;n.selectedIndex++},n.firstStep=function(){n.selectedIndex=0},n.lastStep=function(){n.selectedIndex=e()-1},n.totalSteps=e,n.isFirstStep=t,n.isLastStep=a,n.currentStepInvalid=function(){return angular.isDefined(n.forms[n.selectedIndex])&&n.forms[n.selectedIndex].$invalid},n.previousStepInvalid=function(){return 0<n.selectedIndex&&angular.isDefined(n.forms[n.selectedIndex-1])&&n.forms[n.selectedIndex-1].$invalid},n.formsIncomplete=function(){for(var e=0;e<n.forms.length;e++)if(n.forms[e].$invalid)return!0;return!1},n.resetForm=function(){for(var e=n.selectedIndex=0;e<n.forms.length;e++)n.forms[e].$setPristine(),n.forms[e].$setUntouched()}}).directive("msFormWizard",function(){return{restrict:"E",scope:!0,controller:"MsFormWizardController as msWizard",compile:function(e){return e.addClass("ms-form-wizard"),function(){}}}}).directive("msFormWizardForm",function(){return{restrict:"A",require:["form","^msFormWizard"],compile:function(e){return e.addClass("ms-form-wizard-form"),function(e,n,t,a){var i=a[0],s=a[1];s.registerForm(i)}}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{onClose:"&"},transclude:!0,templateUrl:"app/core/directives/ms-info-bar/ms-info-bar.html",link:function(e,n){var t=i.find("ms-info-bar-active"),a="ms-info-bar-active";t.addClass(a),e.removeInfoBar=function(){t.removeClass(a),n.remove(),e.onClose&&e.onClose(),e.$destroy()}}}}e.$inject=["$document"],angular.module("app.core").directive("msInfoBar",e)}(),function(){"use strict";function e(r,a,l,e){var d=this,n={columnCount:5,respectItemOrder:!1,reLayoutDebounce:400,responsive:{md:3,sm:2,xs:1}},t=!0;function i(){t&&e.cancel(t),t=e(function(){!function(){d.containerPos=d.container[0].getBoundingClientRect(),function(){d.columnCount=d.options.columnCount,l("gt-md")?d.columnCount=d.options.columnCount:l("md")?d.columnCount=d.columnCount>d.options.responsive.md?d.options.responsive.md:d.columnCount:l("sm")?d.columnCount=d.columnCount>d.options.responsive.sm?d.options.responsive.sm:d.columnCount:d.columnCount=d.options.responsive.xs;d.columnWidth=d.containerPos.width/d.columnCount}(),r.$broadcast("msMasonry:relayoutStarted"),d.items=d.container.find("ms-masonry-item");for(var e=Array.apply(null,new Array(d.columnCount)).map(function(){return 0}),n=0;n<d.items.length;n++){var t,a,i,s,o=d.items[n];(o=angular.element(o)).scope()&&o.scope().$broadcast("msMasonryItem:startReLayout"),o.css({width:d.columnWidth}),d.options.respectItemOrder?(i=n%d.columnCount,s=e[i]):(s=Math.min.apply(Math,e),i=e.indexOf(s)),e[i]=s+o[0].getBoundingClientRect().height,t=Math.round(i*d.columnWidth),a=s,o.css({transform:"translate3d("+t+"px,"+a+"px,0px)"}),o.addClass("placed"),o.scope()&&o.scope().$broadcast("msMasonryItem:finishReLayout")}}(),r.$broadcast("msMasonry:relayoutFinished")},d.options.reLayoutDebounce)}d.options=null,d.container=[],d.containerPos="",d.columnWidth="",d.items=[],d.reLayout=i,d.initialize=function(){d.options=d.options?angular.extend(n,d.options):n,r.$watch(function(){return d.container.width()},function(e,n){e!==n&&i()})},d.waitImagesLoaded=function(e,n){if("undefined"!=typeof imagesLoaded){var t=a.imagesLoaded(e);t.on("done",function(){n()})}else n()},r.$on("msMasonry:relayout",function(){i()})}function n(o){return{restrict:"AEC",controller:"msMasonryController",compile:function(i,s){return{pre:function(e,n,t,a){a.options=angular.fromJson(s.options||"{}"),a.container=i},post:function(e,n,t,a){o(function(){a.initialize()})}}}}}e.$inject=["$scope","$window","$mdMedia","$timeout"],n.$inject=["$timeout"],angular.module("app.core").controller("msMasonryController",e).directive("msMasonry",n).directive("msMasonryItem",function(){return{restrict:"AEC",require:"^msMasonry",priority:1,link:function(e,n,t,a){a.waitImagesLoaded(n,function(){a.reLayout()}),e.$on("msMasonryItem:finishReLayout",function(){e.$watch(function(){return n.height()},function(e,n){e!==n&&a.reLayout()})}),n.on("$destroy",function(){a.reLayout()})}}})}(),function(){"use strict";function e(t,e,a,i){var s=this;function o(e,n){s.selectedPalette=e,s.selectedHues=n}function r(){o(!(s.selectedColor={palette:"",hue:"",class:""}),!1),d()}function l(e,n){s.selectedColor={palette:e,hue:n,class:"md-"+e+"-"+n+"-bg",bgColorValue:i.rgba(s.palettes[e][n].value),fgColorValue:i.rgba(s.palettes[e][n].contrast)},"obj"!==s.msModelType||angular.equals(s.selectedColor,s.modelCtrl.$viewValue)||d(),o(e,s.palettes[e]),t.$selectedColor=s.selectedColor}function d(){"class"===s.msModelType?s.modelCtrl.$setViewValue(s.selectedColor.class):"obj"===s.msModelType&&s.modelCtrl.$setViewValue(s.selectedColor)}s.palettes=e,s.selectedPalette=!1,s.selectedHues=!1,t.$selectedColor={},s.activateHueSelection=o,s.selectColor=function(e,n){l(e,n),d(),a.hide()},s.removeColor=r,t.$watch("ngModel",function(){if(!s.modelCtrl.$viewValue||""===s.modelCtrl.$viewValue)return void r();var e,n;if("class"===s.msModelType){var t=s.modelCtrl.$viewValue.split("-");n=5<=t.length?(e=t[1]+"-"+t[2],t[3]):(e=t[1],t[2])}else"obj"===s.msModelType&&(e=s.modelCtrl.$viewValue.palette,n=s.modelCtrl.$viewValue.hue||500);l(e,n)})}e.$inject=["$scope","$mdColorPalette","$mdMenu","motionGenerator"],angular.module("app.core").controller("msMaterialColorPickerController",e).directive("msMaterialColorPicker",function(){return{require:["msMaterialColorPicker","ngModel"],restrict:"E",scope:{ngModel:"=",msModelType:"@?"},controller:"msMaterialColorPickerController as vm",transclude:!0,templateUrl:"app/core/directives/ms-material-color-picker/ms-material-color-picker.html",link:function(e,n,t,a,i){var s=a[0];s.modelCtrl=a[1],s.msModelType=e.msModelType||"class",i(e,function(e){(e=e.filter(function(e,n){return 1===n.nodeType})).length&&n.find("ms-color-picker-button").replaceWith(e)})}}})}(),function(){"use strict";function e(p,g,v){return{restrict:"A",link:function(e,n,t){var a="true"===t.msNavIsFolded,i=!1,s=angular.element(p[0].body),o=angular.element('<div id="ms-nav-fold-open-overlay"></div>'),r=angular.element('<div id="ms-nav-fold-close-overlay"></div>'),l=n.parent();function d(){s.addClass("ms-nav-folded"),g.$broadcast("msNav::forceCollapse"),n.scrollTop(0),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function c(e){angular.isDefined(e)&&e.preventDefault(),s.addClass("ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),l.find(o).remove(),l.parent().append(r),r.on("mouseenter touchstart",function(e){m(e),i=!1})}function m(e){angular.isDefined(e)&&e.preventDefault(),g.$broadcast("msNav::forceCollapse"),n.scrollTop(0),s.removeClass("ms-nav-folded-open"),l.parent().find(r).remove(),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function u(){s.removeClass("ms-nav-folded ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),n.off("mouseenter mouseleave")}v.setFoldable(e,n,a),a?d():u(),e.toggleFold=function(){(a=!a)?d():u()},e.openFolded=c,e.closeFolded=m,e.isNavFoldedOpen=function(){return i},e.$on("$destroy",function(){o.off("mouseenter touchstart"),r.off("mouseenter touchstart"),n.off("mouseenter mouseleave")})}}}function n(t,a,i){return{restrict:"E",scope:{},controller:"MsNavController",compile:function(e){return e.addClass("ms-nav"),function(e){t.$broadcast("msNav::expandMatchingToggles");var n=t.$on("$stateChangeSuccess",function(){t.$broadcast("msNav::expandMatchingToggles"),a.when("navigation").then(function(e){e.close(),i.isNavFoldedOpen()&&i.closeFolded()})});e.$on("$destroy",function(){n()})}}}}function t(m,u,p,g){return{restrict:"A",require:"^msNav",scope:!0,compile:function(e,n){return e.addClass("ms-nav-toggle"),angular.isUndefined(n.collapsed)&&(n.collapsed=!0),e.attr("collapsed",n.collapsed),function(a,i,e,t){var s={expanded:"expanded",expandAnimation:"expand-animation",collapseAnimation:"collapse-animation"},n=i.find("a"),o=[],r=/\(.*\)/g;function l(){return"true"===i.attr("collapsed")}function d(){var e=u.defer();if(!l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!1);var n=angular.element(i.find("ms-nav-toggle-items")[0]);n.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var t=n[0].offsetHeight;return n.css({position:"",visibility:"",display:"",height:""}),a.$evalAsync(function(){p.animate(n,{display:"block",height:"0px"},{height:t+"px"},s.expandAnimation).then(function(){n.addClass(s.expanded),n.css({height:""}),e.resolve({success:!0})})}),e.promise}function c(){var e=u.defer();if(l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!0);var n=angular.element(i.find("ms-nav-toggle-items")[0]),t=n[0].offsetHeight;return a.$evalAsync(function(){p.animate(n,{height:t+"px"},{height:"0px"},s.collapseAnimation).then(function(){n.removeClass(s.expanded),n.css({display:"",height:""}),e.resolve({success:!0})})}),e.promise}angular.forEach(n,function(e){var n=angular.element(e).attr("ui-sref");angular.isUndefined(n)||(n=n.replace(r,""),o.push(n))}),t.setToggleItem(i,a),i.children(".ms-nav-button").on("click",function(){if(t.isDisabled())return;t.disable(),l()?(t.clearLockedItems(),a.$emit("msNav::pushToLockedList"),m.$broadcast("msNav::collapse"),d().then(function(){t.enable()})):a.$broadcast("msNav::forceCollapse")}),a.$on("$destroy",function(){i.children(".ms-nav-button").off("click")}),a.$on("msNav::collapse",function(){var e=t.getLockedItems(),n=!1;angular.forEach(e,function(e){angular.equals(e.scope,a)&&(n=!0)}),n||c().then(function(){t.enable()})}),a.$on("msNav::forceCollapse",function(){c().then(function(){t.enable()})}),a.$on("msNav::expandMatchingToggles",function(){var n=g.current.name,t=!1;angular.forEach(o,function(e){n===e&&(t=!0)}),t?d():c()}),a.$on("msNav::pushToLockedList",function(){t.setLockedItem(i,a)})}}}}e.$inject=["$document","$rootScope","msNavFoldService"],n.$inject=["$rootScope","$mdComponentRegistry","msNavFoldService"],t.$inject=["$rootScope","$q","$animate","$state"],angular.module("app.core").factory("msNavFoldService",function(){var t={};return{setFoldable:function(e,n){t={scope:e,element:n}},isNavFoldedOpen:function(){return t.scope.isNavFoldedOpen()},toggleFold:function(){t.scope.toggleFold()},openFolded:function(){t.scope.openFolded()},closeFolded:function(){t.scope.closeFolded()}}}).directive("msNavIsFolded",e).controller("MsNavController",function(){var e=this,n=!1,t=[],a=[];e.isDisabled=function(){return n},e.enable=function(){n=!1},e.disable=function(){n=!0},e.setToggleItem=function(e,n){t.push({element:e,scope:n})},e.getLockedItems=function(){return a},e.setLockedItem=function(e,n){a.push({element:e,scope:n})},e.clearLockedItems=function(){a=[]}}).directive("msNav",n).directive("msNavTitle",function(){return{restrict:"A",compile:function(e){return e.addClass("ms-nav-title"),function(){}}}}).directive("msNavButton",function(){return{restrict:"AE",compile:function(e){return e.addClass("ms-nav-button"),function(){}}}}).directive("msNavToggle",t)}(),function(){"use strict";function e(e,n){e.root?this.navigation=n.getNavigation(e.root):this.navigation=n.getNavigation(),this.toggleHorizontalMobileMenu=function(){angular.element("body").toggleClass("ms-navigation-horizontal-mobile-menu-active")},n.sort()}function n(c,m,u,p){return{restrict:"E",scope:{folded:"=",root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/vertical.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation"),function(e,n){var t=angular.element("body"),a=angular.element('<div id="ms-navigation-fold-expander"></div>'),i=angular.element('<div id="ms-navigation-fold-collapser"></div>'),s=u("navigation");function o(e){if(p.setFolded(e),e)c.$broadcast("msNavigation::collapse"),t.addClass("ms-navigation-folded"),r();else{var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched"),t.removeClass("ms-navigation-folded ms-navigation-folded-open"),i.remove()}}function r(){n.parent().append(a),m(function(){a.on("mouseenter touchstart",l)})}function l(e){e&&e.preventDefault(),p.setFoldedOpen(!0);var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched"),t.addClass("ms-navigation-folded-open"),a.remove(),t.find("#main").append(i),i.on("mouseenter touchstart",d)}function d(e){e&&e.preventDefault(),p.setFoldedOpen(!1),c.$broadcast("msNavigation::collapse"),t.removeClass("ms-navigation-folded-open"),i.remove(),r()}p.setNavigationScope(e),function(){null===p.getFolded()&&p.setFolded(e.folded);p.getFolded()&&(m(function(){c.$broadcast("msNavigation::collapse")}),t.addClass("ms-navigation-folded"),r())}(),e.$watch(function(){return s.isLockedOpen()},function(e,n){if(!angular.isUndefined(e)&&!angular.equals(e,n)&&p.getFolded())if(e)c.$broadcast("msNavigation::collapse");else{var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched")}}),e.$watch("folded",function(e,n){angular.isUndefined(e)||angular.equals(e,n)||o(e)}),e.toggleFolded=function(){o(!p.getFolded())},e.$on("$stateChangeStart",function(){s.close()}),e.$on("$destroy",function(){i.off("mouseenter touchstart"),a.off("mouseenter touchstart")})}}}}function t(t,e,a,i,n,s){var o=this;o.element=e,o.node=t.node,o.hasChildren=void 0,o.collapsed=void 0,o.collapsable=void 0,o.group=void 0,o.animateHeightClass="animate-height",o.toggleCollapsed=function(){o.collapsed?o.expand():o.collapse()},o.collapse=function(){var e=o.element.children("ul"),n=e[0].offsetHeight;t.$evalAsync(function(){o.collapsed=!0,o.element.addClass("collapsing"),i.animate(e,{display:"block",height:n+"px"},{height:"0px"},o.animateHeightClass).then(function(){e.css({display:"",height:""}),o.element.removeClass("collapsing")}),t.$broadcast("msNavigation::collapse")})},o.expand=function(){var e=o.element.children("ul");e.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var n=e[0].offsetHeight;e.css({position:"",visibility:"",display:"",height:""}),t.$evalAsync(function(){o.collapsed=!1,o.element.addClass("expanding"),i.animate(e,{display:"block",height:"0px"},{height:n+"px"},o.animateHeightClass).then(function(){e.css({height:""}),o.element.removeClass("expanding")}),a.$broadcast("msNavigation::collapse",o.node._path)})},o.getClass=function(){return o.node.class},o.isHidden=function(){if(angular.isDefined(o.node.hidden)&&angular.isFunction(o.node.hidden))return o.node.hidden();return!1},function(){o.hasChildren=0<o.node.children.length,o.group=!(!angular.isDefined(o.node.group)||!0!==o.node.group),!o.hasChildren||o.group?o.collapsable=!1:o.collapsable=!(!angular.isUndefined(o.node.collapsable)&&"boolean"==typeof o.node.collapsable&&!0!==o.node.collapsable);o.collapsable?o.collapsed=!(!angular.isUndefined(o.node.collapsed)&&"boolean"==typeof o.node.collapsed&&!0!==o.node.collapsed):o.collapsed=!1;if(o.node.state===n.current.name||n.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;t.$emit("msNavigation::stateMatched"),s.setActiveItem(o.node,t)}t.$on("msNavigation::stateMatched",function(){o.collapsable&&o.collapsed&&t.$evalAsync(function(){o.collapsed=!1})}),t.$on("msNavigation::collapse",function(e,n){if(!o.collapsed&&o.collapsable)if(angular.isUndefined(n))o.collapse();else{var t=n.split("."),a=[],i=s.getActiveItem();if(i&&(a=i.node._path.split(".")),-1<t.indexOf(o.node._id))return;if(-1<a.indexOf(o.node._id))return;o.collapse()}}),t.$on("$stateChangeSuccess",function(){if(o.node.state===n.current.name){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;s.setActiveItem(o.node,t),a.$broadcast("msNavigation::collapse",o.node._path)}if(n.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;t.$emit("msNavigation::stateMatched")}})}()}function a(n){return{restrict:"E",scope:{root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/horizontal.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation-horizontal"),function(e){n.setNavigationScope(e)}}}}function i(t,e,n,a,i){var s=this;s.element=e,s.node=t.node,s.hasChildren=void 0,s.group=void 0,s.getClass=function(){return s.node.class},function(){if(s.isActive=!1,s.hasChildren=0<s.node.children.length,s.group=!(!angular.isDefined(s.node.group)||!0!==s.node.group),s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;t.$emit("msNavigation::stateMatched"),i.setActiveItem(s.node,t)}t.$on("msNavigation::stateMatched",function(){s.hasChildren&&t.$evalAsync(function(){s.isActive=!0})}),t.$on("msNavigation::clearActive",function(){if(s.hasChildren){var e=[],n=i.getActiveItem();n&&(e=n.node._path.split(".")),-1<e.indexOf(s.node._id)?t.$evalAsync(function(){s.isActive=!0}):t.$evalAsync(function(){s.isActive=!1})}}),t.$on("$stateChangeSuccess",function(){if(s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;i.setActiveItem(s.node,t),n.$broadcast("msNavigation::clearActive")}})}()}function s(i){return{restrict:"A",require:"^msNavigationHorizontalNode",compile:function(e){return e.addClass("ms-navigation-horizontal-item"),function(e,n,t,a){n.on("click",function(){if(!a.hasChildren||i("gt-md"))return;n.toggleClass("expanded")}),e.$on("$destroy",function(){n.off("click")})}}}}e.$inject=["$scope","msNavigationService"],n.$inject=["$rootScope","$timeout","$mdSidenav","msNavigationService"],t.$inject=["$scope","$element","$rootScope","$animate","$state","msNavigationService"],a.$inject=["msNavigationService"],i.$inject=["$scope","$element","$rootScope","$state","msNavigationService"],s.$inject=["$mdMedia"],angular.module("app.core").provider("msNavigationService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function d(e,n){if(angular.isString(e)){for(var t=e.split("."),a=t[t.length-1],i=function(e){var n=l;if(1===e.length)return n;e.pop();for(var t=0;t<e.length;t++){for(var a=e[t],i=!0,s=0;s<n.length;s++)if(n[s]._id===a){n=n[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};n.push(o),n=o.children}}return n}(t),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,n),s.uisref=u(s)):(n.children=[],!angular.isUndefined(n.weight)&&angular.isNumber(n.weight)||(n.weight=1),n._id=a,n._path=e,n.uisref=u(n),i.push(n))}else r.error("path must be a string (eg. `dashboard.project`)")}function c(e){if(angular.isString(e)){for(var n=l,t=e.split("."),a=0;a<t.length;a++)for(var i=t[a],s=0;s<n.length;s++)if(n[s]._id===i){if(n[s]._path===e)return n.splice(s,1),!0;n=n[s].children;break}return!1}r.error("path must be a string (eg. `dashboard.project`)")}function m(e){e||(e=l).sort(a);for(var n=0;n<e.length;n++){var t=e[n].children;1<t.length&&t.sort(a),0<t.length&&m(t)}}function a(e,n){return parseInt(e.weight)-parseInt(n.weight)}function u(e){var n="";return angular.isDefined(e.state)&&(n=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(n=n+"("+angular.toJson(e.stateParams)+")")),n}this.saveItem=d,this.deleteItem=c,this.sortByWeight=m,this.$get=function(){var t=null,n=null,a=null,i=null,e={saveItem:d,deleteItem:c,sort:m,clearNavigation:function(){l=[],n&&(n.vm.navigation=l)},setActiveItem:function(e,n){t={node:e,scope:n}},getActiveItem:function(){return t},getNavigation:s,getFlatNavigation:o,setNavigationScope:function(e){n=e},setFolded:function(e){a=e},getFolded:function(){return a},setFoldedOpen:function(e){i=e},getFoldedOpen:function(){return i},toggleFolded:function(){n.toggleFolded()},getSectionId:function(n,t){var e=o(),a=_.find(e,function(e){return t?e.route===n&&e.title.toLowerCase()===t.toLowerCase():e.route===n});return a?a.id:0}};return e;function s(e){if(e){for(var n=0;n<l.length;n++)if(l[n]._id===e)return[l[n]];return null}return l}function o(e){var n=s(e);return function e(n){var t=[];for(var a=0;a<n.length;a++){var i=angular.copy(n[a]);i.children=[],t.push(i),0<n[a].children.length&&(t=t.concat(e(n[a].children)))}return t}(n)}}}).controller("MsNavigationController",e).directive("msNavigation",n).controller("MsNavigationNodeController",t).directive("msNavigationNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationNode"},controller:"MsNavigationNodeController as vm",compile:function(e){return e.addClass("ms-navigation-node"),function(e,n,t,a){n.addClass(a.getClass()),a.group&&n.addClass("group")}}}}).directive("msNavigationItem",function(){return{restrict:"A",require:"^msNavigationNode",compile:function(e){return e.addClass("ms-navigation-item"),function(e,n,t,a){a.collapsable&&n.on("click",a.toggleCollapsed),e.$on("$destroy",function(){n.off("click")})}}}}).directive("msNavigationHorizontal",a).controller("MsNavigationHorizontalNodeController",i).directive("msNavigationHorizontalNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationHorizontalNode"},controller:"MsNavigationHorizontalNodeController as vm",compile:function(e){return e.addClass("ms-navigation-horizontal-node"),function(e,n,t,a){n.addClass(a.getClass()),a.group&&n.addClass("group")}}}}).directive("msNavigationHorizontalItem",s)}(),function(){"use strict";function e(p,t,g,e,a,i,n,u,s,o,v,h,f,b,r,A,l){var E=this,d=["ringingId","speakerId","microphoneId","ringingVolume","speakerVolume","microphoneVolume","ringingMute","speakerMute","microphoneMute"],c=JSON.parse(n.localStorage.getItem("motion2.user:"+E.conf.id))||{webrtc:{ringingVolume:.5,speakerVolume:.5,microphoneVolume:1,ringingMute:!1,speakerMute:!1,microphoneMute:!1}};e(function(){},999);var y=l.getLogger("jssip","ms-phonebar");function m(l){var d,c,m;return E.initDeviceInProgress=!0,navigator.mediaDevices.getUserMedia({audio:!0}).then(function(e){return E.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/silence.ogg"),E.soundPlayer.play().catch(function(e){y.error(e.message)}),e.getTracks().forEach(function(e){e.stop()}),navigator.mediaDevices.enumerateDevices()}).then(function(e){var n=_.filter(e,function(e){return"audioinput"===e.kind&&"default"!==e.deviceId&&"communications"!==e.deviceId});if(0<n.length){var t=_.find(e,function(e){return"default"===e.deviceId&&"audioinput"===e.kind});if(m=_.find(n,function(e){return e.groupId===t.groupId}),E.conf.microphoneId&&!l){var a=_.find(n,function(e){return e.deviceId===E.conf.microphoneId});a&&(m=a)}E.conf.microphoneId=m.deviceId}else v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_MICROPHONE_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"});E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0,x("microphone",!1);var i=_.filter(e,function(e){return"audiooutput"===e.kind&&"default"!==e.deviceId&&"communications"!==e.deviceId});if(0<i.length){var s=_.find(e,function(e){return"default"===e.deviceId&&"audiooutput"===e.kind});if(c=d=_.find(i,function(e){return e.groupId===s.groupId}),E.conf.speakerId&&!l){var o=_.find(i,function(e){return e.deviceId===E.conf.speakerId});o&&(c=o)}if(E.conf.speakerId=c.deviceId,E.conf.ringingId&&!l){var r=_.find(i,function(e){return e.deviceId===E.conf.ringingId});r&&(d=r)}E.conf.ringingId=d.deviceId}else v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_SPEAKER_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"});return x("speaker",!1)}).then(function(){return x("ringing",!1)}).then(function(){if(jabra)return jabra.init().then(function(){return E.isJabraInitialized=!0,jabra.getInstallInfo()}).then(function(){return jabra.getUserDeviceMediaExt()}).then(function(e){m&&c&&d&&e&&_.includes([m.groupId,c.groupId,d.groupId],e.deviceInfo.browserGroupId)&&(y.info("Jabra library correctly initialized and device correctly installed"),E.isJabraEnabled=!0,jabra.onHook(),jabra.addEventListener("acceptcall",function(e){var n=_.last(E.sessions);n?"incoming"===n.direction&&n.isInProgress()?E.answer(n):y.error("Unable to find a valid call to answer",e):y.error("Unable to answer the call",e)}.bind(this)),jabra.addEventListener("mute",function(){x("microphone",E.conf.microphoneMute=!0)}.bind(this)),jabra.addEventListener("unmute",function(){E.conf.microphoneMute=!1,x("microphone",!0)}.bind(this)),jabra.addEventListener("flash",function(){E.jabraSession.localHold?E.unhold(E.jabraSession):E.hold(E.jabraSession)}.bind(this)),jabra.addEventListener("endcall",function(){o(function(e){for(var n=null,t=0;t<E.sessions.length;t++)_.has(E.sessions[t],"localHold")&&E.sessions[t].localHold||(n=E.sessions[t]);e(n)}).then(function(e){null!==e&&E.terminate(e)})}.bind(this)))}).catch(function(e){y.warn("Error initializing Jabra integration",e)})}).catch(function(e){y.error("Unable to init media devices",e),"NotFoundError"===e.name&&v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}).finally(function(){E.initDeviceInProgress=!1,S(),DetectRTC.load(function(){E.conf.hasMicrophone=DetectRTC.hasMicrophone,E.conf.hasSpeakers="Chrome"!==DetectRTC.browser.name&&"Edge"!==DetectRTC.browser.name&&"Opera"!==DetectRTC.browser.name||DetectRTC.hasSpeakers,E.conf.isWebRTCSupported=DetectRTC.isWebRTCSupported,E.conf.osName=DetectRTC.osName,E.conf.osVersion=DetectRTC.osVersion,E.conf.browserName=DetectRTC.browser.name,E.conf.browserVersion=DetectRTC.browser.version,E.conf.license&&E.conf.isWebRTCSupported&&E.conf.hasMicrophone&&E.conf.hasSpeakers&&"https"===E.conf.protocol&&("chrome"===E.conf.browserName.toLowerCase()||"opera"===E.conf.browserName.toLowerCase()||"safari"===E.conf.browserName.toLowerCase())?E.register||E.ua.start():E.conf.license||v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}.bind(this))})}function S(){c.webrtc=_.pick(E.conf,d),n.localStorage.setItem("motion2.user:"+E.conf.id,JSON.stringify(c))}function T(e,n,t){y.debug("addCall -> target, inbound, fullname",e,n,t),E.calls.unshift({target:e,fullname:t||e,inbound:n,time:moment().format("HH:mm")}),50<E.calls.length&&E.calls.pop()}function I(e){y.debug("answer -> session",e._request),e.notification&&(e.notification.close(),e.notification=null),E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0,e.answer(E.sessionConf),E.isJabraEnabled&&(jabra.offHook(),E.jabraSession=e)}function O(e,n){y.debug("terminate -> session",e._request),e.notification&&(e.notification.close(),e.notification=null);var t={};if(n?t.status_code=n:e.isEstablished()||(t.status_code=603),e.terminate(t),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var a=_.last(E.sessions);a.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=a):jabra.offHook()}}function C(t){return y.debug("getVoiceChannels -> session",t._request),h.rpc.getVoiceChannels().$promise.then(function(e){var n=_.find(e.rows,function(e){return e.sipcalllinkedid===t.call_id?e:e.sipcalluniqueid===t.call_id?e:null});n&&(t.monitor=n.monitor,t.uniqueid=n.uniqueid,t.monitors=n.monitors)})}function w(e){y.debug("onAddstream -> data",e),this.remotePlayer.srcObject=e.stream,this.remotePlayer.play()}function R(){E.canGoInConference=!1,E.isInConference=!1,E.currentconferenceSessions=[]}function x(e,n){switch(e){case"ringing":E.soundPlayer.muted=E.conf.ringingMute,E.conf.ringingId&&E.soundPlayer.setSinkId(E.conf.ringingId).then(function(){E.soundPlayer.volume=E.conf.ringingVolume}).then(function(){n&&S()}).catch(function(e){y.info(e.message,E.conf.ringingId)});break;case"speaker":E.remotePlayer.muted=E.conf.speakerMute,E.conf.speakerId&&E.remotePlayer.setSinkId(E.conf.speakerId).then(function(){E.remotePlayer.volume=E.conf.speakerVolume}).then(function(){n&&S()}).catch(function(e){y.info(e.message,E.conf.speakerId)});break;case"microphone":for(var t=0;t<E.sessions.length;t+=1)E.conf.microphoneMute?E.sessions[t].mute():E.sessions[t].unmute();jabra&&E.isJabraEnabled&&(E.conf.microphoneMute?jabra.mute():jabra.unmute()),n&&S();break;default:y.info("unknown device")}}function N(){E.target="",document.getElementById("ms-target").blur(),document.getElementById("ms-target").value="",p.$broadcast("angucomplete-alt:clearInput","ms-target-wrap")}function D(n){return h.user.getVoicePrefixes({id:E.conf.id}).$promise.then(function(e){if(e.count)return a.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{prefixes:e,required:E.conf.phoneBarPrefixRequired}})}).then(function(e){if(E.conf.phoneBarPrefixRequired){if(e&&-1!==e)return e+n}else{if(e&&-1!==e)return e+n;if(!e)return n}})}function P(){if(E.isInConference){var e=E.sessions[0].connection.getReceivers()[0],n=E.sessions[1].connection.getReceivers()[0],t=new MediaStream;t.addTrack(e.track),t.addTrack(n.track);var a=document.getElementById("remote-audio");a.srcObject=t;var i=a.play();void 0!==i&&i.then(function(){}).catch(function(e){y.error(e)})}}function L(e,n,t,a){return y.debug("onReferCallback -> session, textContent, position, delay",e._request,n,t,a),function(){i.show(i.simple().textContent(n).position(t).hideDelay(a)),O(e)}}function k(n){return y.debug("findSessionBySessionId -> sessionId, vm_pb.sessions",n,E.sessions),_.find(E.sessions,function(e){return e.call_id==n})}function M(e,n){return y.debug("callCallback -> url, params",e,n),s({url:e,method:"GET",params:n})}E.currentUser=b.getCurrentUser(),E.direction="right",E.selectedMode="md-scale",E.target="",E.showDialpad=!1,E.soundPlayer=document.getElementById(E.conf.soundPlayerId),E.remotePlayer=document.getElementById(E.conf.remotePlayerId),E.soundPlayer.volume=1,E.sessionConf={mediaConstraints:{audio:!0,video:!1},pcConfig:{iceServers:[]}},E.sessions=[],E.calls=[],E.callbackQueue=[],E.canGoInConference=!1,E.isInConference=!1,E.currentConferenceSessions=[],E.ua=new JsSIP.UA({sockets:[new JsSIP.WebSocketInterface("wss://"+E.conf.host+":"+E.conf.wssPort+"/ws")],uri:new JsSIP.URI("sip",E.conf.name,E.conf.host,5060,null,null).toString(),authorization_user:E.conf.name,ha1:E.conf.ha1,realm:E.conf.realm,user_agent:E.conf.ua,session_timers_refresh_method:"invite",register_expires:E.conf.phoneBarExpires||60,register:!0}),E.conf=_.merge(c.webrtc,E.conf),E.initDeviceInProgress=!1,E.isJabraEnabled=!1,E.isJabraInitialized=!1,E.jabraSession=null,E.jabraClicked=!1,E.buttonClicked=!1,E.originateInProgress=!1,t.bind("keyup",function(e){switch(e.keyCode){case 27:g(function(){E.showDialpad=!1})}}),E.$onInit=function(){m(!1),navigator.mediaDevices.ondevicechange=function(){E.initDeviceInProgress||(E.initDeviceInProgress=!0,jabra&&E.isJabraInitialized?jabra.shutdown().then(function(){E.isJabraInitialized=!1,m(!(E.isJabraEnabled=!1))}).catch(function(e){y.error("Unable to shutdown Jabra library",e)}):m(!0))};var e=[h.network.get({type:"turn",nolimit:!0}).$promise,h.network.get({type:"stun",nolimit:!0}).$promise];o.all(e).then(function(e){var n=e[0].rows,t=e[1].rows,a=[],i=[];t.forEach(function(e){i.push("stun:"+e.value)}),a.push({urls:i}),n.forEach(function(e){var n={urls:"turn:"+e.value};e.username&&(n.username=e.username),e.password&&(n.credential=e.password),a.push(n)}),E.sessionConf.pcConfig={iceServers:a}}),this.ua.on("registered",function(){this.registered=!0}.bind(this)),this.ua.on("unregistered",function(){this.registered=!1}.bind(this)),this.ua.on("newRTCSession",function(e){y.debug("onNewRTCSession -> data",e);var n,t,a,i,s,o=e.session,r=!0,l="",d=0;switch(e.originator){case"local":o.outgoing=!0,o.name=e.request.ruri.user,o.user=e.request.ruri.user,T(o.user,!1),t=e.request.extraHeaders,a="X-callback-url",s=_.find(t,function(e){return _.startsWith(e,a)}),n=!!s&&_.trim(s.replace(a,"").replace(i||":","")),E.isJabraEnabled&&(E.jabraSession&&jabra.resume(),E.jabraSession=o,jabra.offHook());break;case"remote":var c=b.getCurrentUser();c.voicePause&&c.phoneBarDnd&&(r=!1);var m=e.request.getHeader("Call-Type")||"";if(c.ignorePauseForPreviewCalls&&"PREVIEW"===m&&(r=!0),E.originateInProgress&&(r=!1),r&&(o.incoming=!0,o.name=e.request.from.display_name,o.user=e.request.from.uri.user,l=e.request.getHeader("X-Answer-Mode")||"",d=e.request.getHeader("X-Answer-After")||0,function(n){y.debug("getNotification -> session",n._request);var e=n.name?n.name+" <"+n.user+">":n.user;E.currentUser.privacyEnabled&&(e=A.mask(e)),f.create("Incoming call from: ",e,null,function(){I(n)},function(){O(n)},E.conf.autoAnswer).then(function(e){n.notification=e}).catch(function(e){y.error("Error creating notification for incoming call",e)})}(e.session),T(e.session.user,!0),E.isJabraEnabled&&jabra.ring(),E.conf.autoAnswer&&g(function(){o.isInProgress()&&(o.autoAnswer=!0,I(o))},E.conf.autoAnswerDelay?1e3*E.conf.autoAnswerDelay:0),y.debug("xAnswerMode",l),y.debug("xAnswerAfterSec",d),"auto"==l.toLowerCase())){var u=0==d?500:1e3*d;y.debug("auto answer enabled after:"+u+" ms"),g(function(){o.isInProgress()&&(o.autoAnswer=!0,I(o))},u)}}r?(o.call_id=e.request.call_id,n&&M(E.callbackQueue[o.call_id]=n,{call_id:o.call_id}).then(function(){y.info('callbackurl:"'+n+'" called successfully')}).catch(function(e){y.error('fail callbackurl:"'+n+'" err:',e)}),o.connection&&(o.connection.onaddstream=w.bind(this)),o.iceCandidateTimeout=null,o.on("progress",function(e,n){y.debug("onProgress -> session, data",e._request,n),y.error("onProgress -> session, data",e._request,n);var t=!1;switch(n.originator){case"local":this.conf.ringingMute||(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/incoming-call.ogg"),t=!0);break;case"remote":this.putOtherCallsOnHold(e),this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/outgoing-call.ogg"),t=!0}E.originateInProgress&&(E.originateInProgress=!1),t&&(this.soundPlayer.loop="loop",this.soundPlayer.play().catch(function(e){y.error(e.message)})),C(e).then(function(){var n=E.callbackQueue[e.call_id];n&&M(n,{uniqueid:e.uniqueid,call_id:e.call_id,number_called:e.user}).then(function(){y.info('callbackurl:"'+n+'" called successfully')}).catch(function(e){y.error('fail callbackurl:"'+n+'" err:',e)}).finally(function(){delete E.callbackQueue[e.call_id]})}).catch(function(e){y.error("Unable to retrieve voice channels",e)})}.bind(this,o)),o.on("confirmed",function(e,n){y.debug("onConfirmed -> session, data",e._request,n);var t=document.getElementById("div_session_"+e.id.substr(0,32));t&&$(t).scope().$broadcast("timer-start"),e.confirmed=!0,"remote"===n.originator&&e.connection&&(e.connection.onaddstream=w.bind(this),_.head(e.connection.getRemoteStreams())&&(this.remotePlayer.srcObject=_.head(e.connection.getRemoteStreams()),this.remotePlayer.play())),this.soundPlayer.pause(),this.soundPlayer.loop=null,this.putOtherCallsOnHold(e),e.autoAnswer&&(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/beep.ogg"),this.soundPlayer.play().catch(function(e){y.error("Unable to play autoAnswer notification",e)})),E.canGoInConference=2==E.sessions.length,C(e).catch(function(e){y.error("Unable to retrieve voice channels",e)})}.bind(this,o)),o.on("hold",function(e,n){y.debug("onHold -> session, data",e._request,n),"local"===n.originator&&(e.localHold=!0)}.bind(this,o)),o.on("unhold",function(e,n){y.debug("onUnhold -> session, data",e._request,n),"local"===n.originator&&(e.localHold=!1)}.bind(this,o)),o.on("ended",function(e,n){if(y.debug("onEnded -> session, data",e._request,n),E.isInConference&&_.includes(E.currentConferenceSessions,e.id)&&(R(),E.buttonClicked=!0),_.remove(this.sessions,{id:e.id}),2!==E.sessions.length&&(E.canGoInConference=!1),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var t=_.last(E.sessions);t.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=t):jabra.offHook()}0===E.sessions.length&&E.currentUser.voicePause&&h.user.pause({id:E.currentUser.id,type:_.startsWith(E.currentUser.pauseType,"#")?E.currentUser.pauseType.substring(1):E.currentUser.pauseType}).$promise.catch(function(e){v.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})}),E.conf.microphoneMute=!1,E.initDevice("microphone",!0)}.bind(this,o)),o.on("failed",function(e,n){if(y.debug("onFailed -> session, data",e._request,n),this.soundPlayer.pause(),this.soundPlayer.loop=null,e.notification&&e.notification.close(),E.isInConference&&_.includes(E.currentConferenceSessions,e.id)&&R(),E.originateInProgress&&(E.originateInProgress=!1),_.remove(this.sessions,{id:e.id}),2!==E.sessions.length&&(E.canGoInConference=!1),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var t=_.last(E.sessions);t.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=t):jabra.offHook()}}.bind(this,o)),o.on("icecandidate",function(e,n){y.debug("onIcecandidate -> session, data",e._request,n),null!==e.iceCandidateTimeout&&clearTimeout(e.iceCandidateTimeout),e.iceCandidateTimeout=setTimeout(n.ready,1e3)}.bind(this,o)),E.sessions.push(o),g(function(){p.$apply(),y.debug("onNewRTCSession -> vm_pb.sessions",E.sessions)})):O(o,486)}.bind(this)),r.on("webbar:originate",function(e){y.debug("originateHook -> payload",e);var n=e.callNumber,t=e.callerId,a=e.callbackUrl;E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0;var i=n.replace(/ /g,"");if(i=(i=i.replace(/\(/g,"")).replace(/\)/g,"")){var s=angular.copy(E.sessionConf);s.extraHeaders=[],t&&s.extraHeaders.push("X-CID: "+t),a&&s.extraHeaders.push("X-callback-url: "+a),E.originateInProgress=!0,E.ua.call(i,s)}}.bind(this)),r.on("webbar:hangup",function(e){y.debug("hangupHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];y.info("hangupHook -> sessionToHangup",a),E.terminate(a)}}.bind(this)),r.on("webbar:answer",function(e){var n;y.debug("answerHook -> payload",e),n=e.sessionId?k(e.sessionId):_.find(E.sessions,function(e){return e.incoming&&!e.confirmed}),e.sessionId&&!n&&y.warn("call with session Id "+e.sessionId+" not found"),n&&E.answer(n)}.bind(this)),r.on("webbar:hold",function(e){y.debug("holdHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];E.hold(a)}}.bind(this)),r.on("webbar:unhold",function(e){y.debug("unholdHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];E.unhold(a)}}.bind(this)),r.on("webbar:transfer",function(e){if(y.debug("transferHook -> payload",e),e.sessionId)if(e.transferNumber){var n=k(e.sessionId);n?n.refer(e.transferNumber,{eventHandlers:{requestSucceeded:L(n,"requestSucceeded","top right",3e3),requestFailed:L(n,"requestFailed","top right",3e3)}}):y.warn("call with session Id "+e.sessionId+" not found")}else y.error("transferNumber required");else y.error("sessionId required")}.bind(this)),r.on("webbar:stopmonitors",function(e){if(e.agentId===E.currentUser.id){var n=_.find(E.sessions,["uniqueid",e.uniqueid]);if(!n)return;n.monitors.forEach(function(e){e.status="pause"}),n.monitor=!1}}.bind(this))}.bind(this),E.type=function(e,n){var t=e;switch(E.target||(E.target=""),n&&(E.target+=e,p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target)),e){case"*":t="asterisk";break;case"#":t="pound"}E.conf.enableDtmfTone&&(E.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/dialpad/"+t+".ogg"),E.soundPlayer.play().catch(function(e){y.error(e.message)}));for(var a=0;a<E.sessions.length;a+=1)E.sessions[a].isEstablished()&&!E.sessions[a].isOnHold().local&&E.sessions[a].sendDTMF(e)},E.call=function(){if(E.target&&E.target!==E.conf.name&&E.target!==E.conf.internal){E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0;var e=E.target.replace(/ /g,"");return D(e=(e=e.replace(/\(/g,"")).replace(/\)/g,"")).then(function(e){e&&E.ua.call(e,E.sessionConf)}).then(function(){N()})}},E.hold=function(e){y.debug("hold -> session",e._request),e.hold({useUpdate:!1}),E.isJabraEnabled&&(jabra.hold(),jabra.onHook())},E.refer=function(n){y.debug("refer -> session",n._request);var e=a.prompt().title("Transfer").textContent("Type the target").placeholder("Target").ariaLabel("Target").ok("Transfer").cancel("Cancel");a.show(e).then(function(e){return D(e.replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,""))}).then(function(e){n.refer(e,{eventHandlers:{requestSucceeded:L(n,"requestSucceeded","top right",3e3),requestFailed:L(n,"requestFailed","top right",3e3)}})})},E.record=function(e){y.debug("record -> session",e._request),a.show({controller:"RecordDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/record/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:E.sessions}})},E.unhold=function(e){y.debug("unhold -> session",e._request),e.unhold({useUpdate:!1}),E.putOtherCallsOnHold(e),E.isJabraEnabled&&(jabra.offHook(),jabra.resume())},E.answer=I,E.terminate=O,E.selectSession=function(e){y.debug("selectSession -> session",e._request),E.unhold(e)},E.typeWrapper=function(e){switch(e.key.toLowerCase()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"*":case"#":E.type(e.key);break;case"enter":E.call()}},E.toggleDialpad=function(){E.showDialpad=!E.showDialpad},E.referAttended=function(e){y.debug("referAttended -> session",e._request),a.show({controller:"ReferAttendedDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/referAttended/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:_.reject(E.sessions,{id:e.id}),isJabraEnabled:E.isJabraEnabled}})},E.closeDialpad=function(){E.showDialpad=!1},E.initDevice=x,E.putOtherCallsOnHold=function(e){if(y.debug("putOtherCallsOnHold -> session",e._request),1<E.sessions.length)for(var n=0;n<E.sessions.length;n+=1)E.sessions[n].id===e.id||E.sessions[n].isOnHold().remote||E.sessions[n].hold({useUpdate:!1})},E.targetChanged=function(e){e?/^(\w|\.|\+|#|\*|\(|\)|\s|-)*$/.test(e)?(E.target=e,p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target)):E.target?p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target):N():N()},E.targetSelected=function(e){e&&(E.target=e.originalObject.target,E.call(),N())},E.start3WayConf=function(){E.isInConference=!0,E.canGoInConference=!1,E.currentConferenceSessions.push(E.sessions[0].id),E.currentConferenceSessions.push(E.sessions[1].id);var e=new AudioContext,n=E.sessions[0].connection.getSenders()[0],t=E.sessions[0].connection.getReceivers()[0];t.track.addEventListener("unmute",function(){setTimeout(function(){P()},1e3)},!1);var a=E.sessions[1].connection.getSenders()[0],i=E.sessions[1].connection.getReceivers()[0];i.track.addEventListener("unmute",function(){setTimeout(function(){P()},1e3)},!1),E.sessions[0].unhold({useUpdate:!1}),E.sessions[1].unhold({useUpdate:!1}),t.track.enabled=!0,i.track.enabled=!0;var s=new MediaStream,o=e.createMediaStreamDestination();o=(e=new AudioContext).createMediaStreamDestination();var r=e.createMediaStreamSource(new MediaStream([i.track]));r.connect(o),(r=e.createMediaStreamSource(new MediaStream([n.track]))).connect(o),n.replaceTrack(o.stream.getTracks()[0]).then(function(){}),o=e.createMediaStreamDestination(),(r=e.createMediaStreamSource(new MediaStream([t.track]))).connect(o),(r=e.createMediaStreamSource(new MediaStream([a.track]))).connect(o),a.replaceTrack(o.stream.getTracks()[0]).then(function(){s.addTrack(t.track),s.addTrack(i.track);var e=document.getElementById("remote-audio");e.srcObject=s;var n=e.play();void 0!==n&&n.then(function(){}).catch(function(e){y.error(e)})})},E.patchConference=P,p.$on("webrtc::settings",function(e){a.show({controller:"SettingsController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/settings/settings.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{devices:function(){return navigator.mediaDevices.enumerateDevices()}},locals:{conf:E.conf,activeSessions:E.sessions}}).then(function(e){e&&(E.conf=e,E.initDeviceInProgress||(E.initDeviceInProgress=!0,jabra&&E.isJabraInitialized?jabra.shutdown().then(function(){E.isJabraInitialized=!1,m(E.isJabraEnabled=!1)}).catch(function(e){y.error("Unable to shutdown Jabra library",e)}):m(!1)))})}),p.$on("webrtc::logout",function(){E.ua.stop(),jabra&&E.isJabraInitialized&&jabra.shutdown(),navigator.mediaDevices.ondevicechange=function(){}}),p.$on("webrtc::call",function(e,n){y.debug("onRemoteCall -> evt, data",e,n),n.target&&(E.target=n.target,E.call())}),p.$on("webrtc::transfer",function(e,n){if(y.debug("onRemoteTransfer -> evt, data",e,n),n.target)for(var t=0;t<E.sessions.length;t+=1)if(E.sessions[t].isEstablished()&&!E.sessions[t].isOnHold().local)return D(n.target).then(function(e){e&&E.sessions[t].refer(e,{eventHandlers:{requestSucceeded:L(E.sessions[t],"requestSucceeded","top right",3e3),requestFailed:L(E.sessions[t],"requestFailed","top right",3e3)}})})}),p.$on("$destroy",function(){y.debug("$destroy event fired"),r.removeAllListeners("webbar:originate"),r.removeAllListeners("webbar:hangup"),r.removeAllListeners("webbar:answer"),r.removeAllListeners("webbar:hold"),r.removeAllListeners("webbar:unhold"),r.removeAllListeners("webbar:transfer"),r.removeAllListeners("webbar:stopmonitors")})}e.$inject=["$scope","$document","$timeout","$interval","$mdDialog","$mdToast","$window","$translate","$http","$q","toasty","api","motNotification","Auth","socket","privacyManager","ClientSideLoggingService"],angular.module("app.core").controller("MsPhonebarController",e).directive("msPhonebar",function(){return{restrict:"E",scope:{conf:"=",sessions:"="},require:"msPhonebar",controller:"MsPhonebarController",controllerAs:"vm_pb",bindToController:!0,templateUrl:"assets/ms-phonebar/ms-phonebar.html"}})}(),function(){"use strict";function e(n,e,t){var a=this;a.prefixes=e,a.required=t,a.closeDialog=function(e){n.hide(e)},a.keyPress=function(e){13===e.keyCode&&this.call()},a.call=function(){n.hide(a.prefix)}}e.$inject=["$mdDialog","prefixes","required"],angular.module("app.core").controller("PrefixDialogController",e)}(),function(){"use strict";function e(i){return{restrict:"C",controller:["$scope","$element",function(e,n){function t(){n.css("display","inline"),i(a,1e3)}function a(){n.css("display","none"),i(t,1e3)}t()}],replace:!0}}function n(n,i,s,e,t){var o=this;function a(n,e){console.log("startMonitor");var t=i.defer(),a=(e||n.filename.replace(/^.*[\\\/]/,"")).split(".")[0];return s.rpc.startMonitor({uniqueid:o.session.uniqueid,filename:a,format:"wav"}).$promise.then(function(e){n.filename=a+".wav",n.mixmonitorid=e.mixmonitorid,n.status="rec",o.session.monitor=!0,t.resolve(n)}).catch(function(e){t.reject(e)}),t.promise}o.title="Record",o.sessions=e,o.session=t,o.closeDialog=function(){n.hide()},o.addRecording=function(){var e=n.prompt({skipHide:!0}).title("Start new recording").textContent("Type the file name.").placeholder("File name").ariaLabel("File name").initialValue(function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}()).ok("Start").cancel("Cancel");n.show(e).then(function(e){return a({},e)}).then(function(e){o.session.monitors.push(e)})},o.stop=function(n){return console.log("stopMonitor"),s.rpc.stopMonitor({uniqueid:o.session.uniqueid,mixmonitorid:n.mixmonitorid}).$promise.then(function(e){n.status="pause",o.session.monitor=_.includes(o.session.monitors,{status:"rec"})}).catch(function(e){console.error(e)})},o.start=a}e.$inject=["$timeout"],n.$inject=["$mdDialog","$q","api","sessions","session"],angular.module("app.core").directive("msBlink",e).controller("RecordDialogController",n)}(),function(){"use strict";function e(n,s,a,i,e){var o=this;function r(e,n,t,a,i){return console.debug("onTransferCallback -> session, textContent, position, delay",e,n,t,a),function(){s.show(s.simple().textContent(n).position(t).hideDelay(a)),e.terminate(),jabra&&i&&jabra.onHook(),l()}}function l(e){n.hide(e)}o.title="Refer Attended",o.sessions=a,o.session=i,o.isJabraEnabled=e,o.sessionTarget=null,a.length&&(o.target=a[0].user),o.closeDialog=l,o.transfer=function(){var e,n,t=_.find(a,function(e){if(e.user===o.target)return e});n=t.outgoing?(e=t,o.session):(e=o.session,t);n.refer(e.user,{replaces:e,eventHandlers:{requestSucceeded:r(i,"requestSucceeded","top right",3e3,o.isJabraEnabled),requestFailed:r(i,"requestFailed","top right",3e3,o.isJabraEnabled)}})}}e.$inject=["$mdDialog","$mdToast","sessions","session","isJabraEnabled"],angular.module("app.core").controller("ReferAttendedDialogController",e)}(),function(){"use strict";function e(e,s,n,t){var a=this;function i(e,n,t){var a;if(s[t]){if(a=_.find(e,function(e){return e.deviceId===s[t]}))return a.deviceId;var i=_.findIndex(e,function(e){return e.kind===n});if(0<=i)return e[i].deviceId}else(a=_.find(e,function(e){return e.kind===n}))&&(s[t]=a.deviceId);return s[t]||null}_.remove(n,function(e){return"audioinput"===e.kind&&("default"===e.deviceId||"communications"===e.deviceId)||"audiooutput"===e.kind&&("default"===e.deviceId||"communications"===e.deviceId)}),s.ringingId=i(n,"audiooutput","ringingId"),s.speakerId=i(n,"audiooutput","speakerId"),s.microphoneId=i(n,"audioinput","microphoneId"),s.ringingVolume=s.ringingVolume||.5,s.speakerVolume=s.speakerVolume||.5,s.microphoneVolume=s.microphoneVolume||1,s.ringingMute=s.ringingMute||!1,s.speakerMute=s.speakerMute||!1,s.microphoneMute=s.microphoneMute||!1,a.conf=angular.copy(s),a.devices=n,a.activeSessions=t,a.saveSettings=function(){e.hide(a.conf)},a.closeDialog=function(){e.hide()},a.isCompatibleBrowser=function(){return"chrome"===a.conf.browserName.toLowerCase()||"opera"===a.conf.browserName.toLowerCase()||"safari"===a.conf.browserName.toLowerCase()}}e.$inject=["$mdDialog","conf","devices","activeSessions"],angular.module("app.toolbar").controller("SettingsController",e)}(),function(){"use strict";function e(t,a){var i=this;function s(e){var n=e.key,t={param:i.query[n],resources:e.options,placeholder:e.placeholder,ngValue:e.ngValue};a.setPlaceholder(t).then(function(e){i.placeholders[n]=e})}i.pickerModels={},i.placeholders={},i.localizationMap=t.localizationMap,i.onMultiselectInit=function(e){s(e)},i.onDateRangeInit=function(e){var n=e.key;i.query[n]?i.pickerModels[n]=t.setSelectedDate(i.query[n]):i.pickerModels[n]={dateStart:null}},i.onMultiselectSelection=function(e,n){n&&(s(e),i.search())},i.onDateRangeSelection=function(e){var n=e.key;i.pickerModels[n].dateStart?!0===e.useFromToKeys?i.query[n]={from:moment(i.pickerModels[n].dateStart).utcOffset(0,!0).format(),to:moment(i.pickerModels[n].dateEnd).utcOffset(0,!0).add(23,"hours").add(59,"minutes").add(59,"seconds").format()}:i.query[n]={$gte:moment(i.pickerModels[n].dateStart).utcOffset(0,!0).format(),$lte:moment(i.pickerModels[n].dateEnd).utcOffset(0,!0).add(23,"hours").add(59,"minutes").add(59,"seconds").format()}:i.query[n]=void 0;i.search()},i.clearDate=function(e){var n=e.key;i.pickerModels[n]={dateStart:null},delete i.query[n],i.search()},i.clearSelection=function(e){var n=e.key,t=e.ngValue||"id";i.query[n]=!1===e.clearAll?[_.head(e.options)[t]]:[],s(e),i.search()},i.selectAll=function(e){var n=e.key,t=e.ngValue||"id";i.query[n]=_.map(e.options,t),s(e),i.search()}}function n(p,e){var g={localizationMap:e,setSelectedDate:function(e){var n=e.$gte?new Date(moment.utc(e.$gte).format("YYYY-MM-DD")):new Date(moment.utc(e.from).format("YYYY-MM-DD")),t=e.$lte?new Date(moment.utc(e.$lte).format("YYYY-MM-DD")):new Date(moment.utc(e.to).format("YYYY-MM-DD")),a={dateStart:new Date(n.getFullYear(),n.getMonth(),n.getDate()),dateEnd:new Date(t.getFullYear(),t.getMonth(),t.getDate())};return a.selectedTemplateName=(i=a,moment(i.dateStart).isSame(i.dateEnd)?(u=i,moment().startOf("day").isSame(u.dateStart)?g.localizationMap.Today:(m=i,moment().subtract(1,"days").startOf("day").isSame(m.dateStart)?g.localizationMap.Yesterday:p("date")(i.dateStart,"dd MMM yyyy"))):(c=i,moment().startOf("isoWeek").isSame(c.dateStart,"day")&&moment().endOf("isoWeek").isSame(c.dateEnd,"day")?g.localizationMap["This Week"]:(d=i,moment().subtract(1,"weeks").startOf("isoWeek").isSame(d.dateStart,"day")&&moment().subtract(1,"weeks").endOf("isoWeek").isSame(d.dateEnd,"day")?g.localizationMap["Last Week"]:(l=i,moment().startOf("month").isSame(l.dateStart,"day")&&moment().endOf("month").isSame(l.dateEnd,"day")?g.localizationMap["This Month"]:(r=i,moment().subtract(1,"months").startOf("month").isSame(r.dateStart,"day")&&moment().subtract(1,"months").endOf("month").isSame(r.dateEnd,"day")?g.localizationMap["Last Month"]:(o=i,moment().startOf("year").isSame(o.dateStart,"day")&&moment().endOf("year").isSame(o.dateEnd,"day")?g.localizationMap["This Year"]:(s=i,moment().subtract(1,"years").startOf("year").isSame(s.dateStart,"day")&&moment().subtract(1,"years").endOf("year").isSame(s.dateEnd,"day")?g.localizationMap["Last Year"]:p("date")(i.dateStart,"dd"+(i.dateStart.getMonth()!==i.dateEnd.getMonth()||i.dateStart.getFullYear()!==i.dateEnd.getFullYear()?" MMM":"")+(i.dateStart.getFullYear()!==i.dateEnd.getFullYear()?" yyyy":""))+" - "+p("date")(i.dateEnd,"dd MMM yyyy")))))))),a;var i,s,o,r,l,d,c,m,u}};return g}n.$inject=["$filter","dateFilterLocalizationFactory"],e.$inject=["dateRangeManager","quickFilterManager"],angular.module("app.core").directive("msQuickFilter",function(){return{restrict:"E",scope:{query:"=",filters:"=",search:"&"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-quick-filter/ms-quick-filter.html"}}).factory("dateRangeManager",n)}(),function(){"use strict";angular.module("app.core").directive("msRandomClass",function(){return{restrict:"A",scope:{msRandomClass:"="},link:function(e,n){var t=e.msRandomClass[Math.floor(Math.random()*e.msRandomClass.length)];n.addClass(t)}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{id:"=",model:"=",download:"="},replace:!0,link:function(n,e){var t=!1,a=document.createElement("audio");n.download||a.setAttribute("controlsList","nodownload"),a.setAttribute("preload","none"),a.setAttribute("controls",""),a.setAttribute("style","width: 265px;"),a.setAttribute("src"," "),a.onplay=function(e){t||(t=!0,e.preventDefault(),i[n.model||"voiceRecording"].download({id:n.id}).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type});a.setAttribute("type",e.type),a.setAttribute("src",URL.createObjectURL(t)),a.play()}).catch(function(e){console.error(e)}))},e.append(a)}}}e.$inject=["api"],angular.module("app.core").directive("msRecording",e)}(),function(){"use strict";angular.module("app.core").directive("msResponsiveTable",function(){return{restrict:"A",link:function(e,n){var t=angular.element('<div class="ms-responsive-table-wrapper"></div>');n.after(t),t.append(n)}}})}(),function(){"use strict";function e(n,i,s,e){var o=this;function t(){angular.isArray(o.onSearch)?a(o.onSearch):o.onResultClick?(o.resultsLoading=!0,n.$parent.$eval("vm.search(query)",{query:o.query.filter}).then(function(e){a(e)}).catch(function(){a([])}).finally(function(){o.resultsLoading=!1})):o.onSearch()}function a(e){o.expanded&&(void 0===e||angular.isArray(e)||null===e)&&(o.selectedResultIndex=0,o.results=e)}function r(){o.expanded=!0,o.displayOn=!0,n.expand()}function l(e){!1!==e&&(o.query.filter=void 0,o.onResultClick?a(null):t()),o.expanded=!1,n.collapse()}function d(e){o.onResultClick&&o.onResultClick({item:e}),l()}function c(){var e=i.find(".ms-search-bar-results"),n=angular.element(e.find(".result")[o.selectedResultIndex]);if(e&&n){var t=n.position().top-8,a=n.position().top+n.outerHeight()+8;o.ignoreMouseEvents=!0,s.cancel(o.mouseEventIgnoreTimeout),o.mouseEventIgnoreTimeout=s(function(){o.ignoreMouseEvents=!1},250),e.scrollTop()>t&&e.scrollTop(t),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}}o.queryOptions={debounce:o.debounce||0},o.searchOnEnterKey=e.get().searchOnEnterKey||!1,o.resultsLoading=!1,o.results=null,o.selectedResultIndex=0,o.ignoreMouseEvents=!1,o.expandBar=r,o.collapseBar=l,o.blurCollapse=function(){if(!o.collapseOnBlur)return;l()},o.onKeyDown=function(e){var n=e.keyCode;-1<[27,38,40].indexOf(n)&&e.preventDefault();switch(n){case 13:if(!o.onResultClick)return t();if(!o.results)return;d(o.results[o.selectedResultIndex]);break;case 27:l();break;case 38:0<=o.selectedResultIndex-1&&(o.selectedResultIndex--,c());break;case 40:if(!o.results)return;o.selectedResultIndex+1<o.results.length&&(o.selectedResultIndex++,c())}},o.absorbEvent=function(e){e.preventDefault()},o.handleMouseenter=function(e){if(o.ignoreMouseEvents)return;o.selectedResultIndex=e},o.handleResultClick=d,n.$watch("vm.displayOn",function(e){angular.isUndefined(e)||(!0!==e||o.expanded?e||!1===o.expanded||l(!1):r())}),n.$watch("vm.query.filter",function(e,n){if(!angular.isUndefined(e)&&0!==e.length&&!angular.equals(e,n)&&!1!==o.displayOn){if(o.expanded){if(!0===o.searchOnEnterKey&&!o.onResultClick)return;if(o.minChars&&o.minChars>e.length)return}else r();t()}})}function n(a){return{restrict:"E",scope:{query:"=?",debounce:"=?",direction:"@",iconColor:"@",onSearch:"&",onResultClick:"&?",onExpand:"&?",onCollapse:"&?",collapseOnBlur:"<?",minChars:"<?",displayOn:"=?"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-search-bar/ms-search-bar.html",compile:function(e){return e.addClass("ms-search-bar"),{post:function(n,t){n.collapse=function(){if(t.removeClass("expanded"),"down"===n.vm.direction){t.removeClass("down");var e=t.closest("md-toolbar");e&&e.removeClass("h-128")}a.find("body").removeClass("ms-search-bar-expanded")},n.expand=function(){if(t.addClass("expanded"),"down"===n.vm.direction){t.addClass("down");var e=t.closest("md-toolbar");e&&e.addClass("h-128")}a.find("body").addClass("ms-search-bar-expanded")}}}}}}e.$inject=["$scope","$element","$timeout","settingsManager"],n.$inject=["$document"],angular.module("app.core").controller("MsSearchBarController",e).directive("msSearchBar",n)}(),function(){"use strict";function e(e,t,i,o,r,l){var d=this;d.query="",d.queryOptions={debounce:300},d.resultsLoading=!1,d.selectedResultIndex=0,d.ignoreMouseEvents=!1,d.mobileBarActive=!1,d.results=null,d.shortcuts=[],d.sortableOptions={ghostClass:"ghost",forceFallback:!0,fallbackClass:"dragging",onSort:function(){d.saveShortcuts()}},d.populateResults=function(){for(var e=[],n=l.getFlatNavigation(),t=r.defer(),a=0;a<n.length;a++)n[a].uisref&&e.push(n[a]);if(d.query){e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(d.query)))return!0});for(var i=0;i<e.length;i++){e[i].hasShortcut=!1;for(var s=0;s<d.shortcuts.length;s++)if(d.shortcuts[s]._id===e[i]._id){e[i].hasShortcut=!0;break}}}else 0<d.shortcuts.length&&(e=d.shortcuts);return d.selectedResultIndex=0,o(function(){t.resolve(e)},250),t.promise},d.loadShortcuts=function(){var e=r.defer(),n=angular.fromJson(t.get("motion.shortcuts"));angular.isUndefined(n)&&(n=[{title:"Agents",icon:"icon-account-multiple",state:"app.staff.agents",weight:5,children:[],uisref:"app.staff.agents",hasShortcut:!0},{title:"License",icon:"icon-cog",state:"app.settings.license",weight:10,children:[],uisref:"app.settings.license",hasShortcut:!0}],t.put("motion.shortcuts",angular.toJson(n)));return e.resolve(n),e.promise},d.saveShortcuts=function(){var e=r.defer();return t.put("motion.shortcuts",angular.toJson(d.shortcuts)),o(function(){e.resolve({success:!0})},250),e.promise},d.addShortcut=function(e){e.hasShortcut=!0,d.shortcuts.push(e),d.saveShortcuts()},d.removeShortcut=function(e){e.hasShortcut=!1;for(var n=0;n<d.shortcuts.length;n++)d.shortcuts[n]._id===e._id&&(d.shortcuts.splice(n,1),d.query||(0===d.shortcuts.length?d.results=null:n>=d.shortcuts.length&&(d.selectedResultIndex=d.shortcuts.length-1)));d.saveShortcuts()},d.handleResultClick=function(e){e.hasShortcut?d.removeShortcut(e):d.addShortcut(e)},d.absorbEvent=function(e){e.preventDefault()},d.handleKeydown=function(e){var n=e.keyCode;-1<[38,40].indexOf(n)&&e.preventDefault();switch(n){case 13:d.handleResultClick(d.results[d.selectedResultIndex]);break;case 38:0<=d.selectedResultIndex-1&&(d.selectedResultIndex--,d.ensureSelectedResultIsVisible());break;case 40:d.selectedResultIndex+1<d.results.length&&(d.selectedResultIndex++,d.ensureSelectedResultIsVisible())}},d.handleMouseenter=function(e){if(d.ignoreMouseEvents)return;d.selectedResultIndex=e},d.temporarilyIgnoreMouseEvents=function(){d.ignoreMouseEvents=!0,o.cancel(d.mouseEventIgnoreTimeout),d.mouseEventIgnoreTimeout=o(function(){d.ignoreMouseEvents=!1},250)},d.ensureSelectedResultIsVisible=function(){var e=i.find("#ms-shortcut-add-menu").find(".results"),n=angular.element(e.find(".result")[d.selectedResultIndex]);if(e&&n){var t=n.position().top-8,a=n.position().top+n.outerHeight()+8;d.temporarilyIgnoreMouseEvents(),e.scrollTop()>t&&e.scrollTop(t),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},d.toggleMobileBar=function(){d.mobileBarActive=!d.mobileBarActive},d.loadShortcuts().then(function(e){d.shortcuts=e,0<d.shortcuts.length&&(d.results=e)}),e.$watch("MsShortcuts.query",function(e,n){angular.isUndefined(e)||angular.equals(e,n)||(d.resultsLoading=!0,d.populateResults().then(function(e){d.results=e},function(){d.results=[]}).finally(function(){d.resultsLoading=!1}))})}e.$inject=["$scope","$cookies","$document","$timeout","$q","msNavigationService"],angular.module("app.core").controller("MsShortcutsController",e).directive("msShortcuts",function(){return{restrict:"E",scope:{},require:"msShortcuts",controller:"MsShortcutsController as MsShortcuts",bindToController:{},templateUrl:"app/core/directives/ms-shortcuts/ms-shortcuts.html",compile:function(e){return e.addClass("ms-shortcuts"),function(e,n){}}}})}(),function(){"use strict";angular.module("app.core").directive("msSidenavHelper",function(){return{restrict:"A",require:"^mdSidenav",link:function(e,n,t,a){e.$watch(function(){return a.isOpen()&&!a.isLockedOpen()},function(e){angular.isUndefined(e)||(n.parent().toggleClass("full-height",e),angular.element("html").toggleClass("sidenav-open",e))})}}})}(),function(){"use strict";function e(a){return{restrict:"E",link:function(e,n){var t=e.$on("msSplashScreen::remove",function(){a.leave(n).then(function(){t(),e=n=null})})}}}e.$inject=["$animate"],angular.module("app.core").directive("msSplashScreen",e)}(),function(){"use strict";function e(e){var i=this;function n(){i.setCurrentStep(1)}function t(e){return o(e)?i.steps[e-1].scope.optionalStep:null}function a(e){return o(e)?!!i.steps[e-1].scope.hideStep:null}function s(e){return o(e)?!!t(e)||i.steps[e-1].form.$valid:null}function o(e){return!(angular.isUndefined(e)||e<1||e>i.steps.length)}i.mainForm=void 0,i.orientation="horizontal",i.steps=[],i.currentStep=void 0,i.currentStepNumber=1,i.setOrientation=function(e){i.orientation=e||"horizontal"},i.registerMainForm=function(e){i.mainForm=e},i.registerStep=function(e,n,t){var a={element:e,scope:n,form:t,stepNumber:n.step||i.steps.length+1,stepTitle:n.stepTitle,stepTitleTranslate:n.stepTitleTranslate};return i.steps.push(a),i.steps.sort(function(e,n){return e.stepNumber-n.stepNumber}),a},i.setupSteps=function(){i.setCurrentStep(i.currentStepNumber)},i.resetForm=function(){e(function(){for(var e=0;e<i.steps.length;e++)i.steps[e].form.$setPristine(),i.steps[e].form.$setUntouched();i.mainForm.$setPristine(),i.mainForm.$setUntouched(),n()})},i.setCurrentStep=function(e){if(!o(e))return;if(i.currentStepNumber=e,"horizontal"===i.orientation){for(var n=0;n<i.steps.length;n++)i.steps[n].element.hide();i.steps[i.currentStepNumber-1].element.show()}else if("vertical"===i.orientation){for(var t=0;t<i.steps.length;t++)i.steps[t].element.find(".ms-stepper-step-content").hide();i.steps[i.currentStepNumber-1].element.find(".ms-stepper-step-content").show()}},i.gotoStep=function(e){if(a(e))return;i.setCurrentStep(e)},i.gotoPreviousStep=function(){for(var e=i.currentStepNumber-1,n=e;1<=n;n--)if(!a(n)){e=n;break}i.setCurrentStep(e)},i.gotoNextStep=function(){for(var e=i.currentStepNumber+1,n=e;n<=i.steps.length;n++)if(!a(n)){e=n;break}i.setCurrentStep(e)},i.gotoFirstStep=n,i.gotoLastStep=function(){i.setCurrentStep(i.steps.length)},i.isFirstStep=function(){return 1===i.currentStepNumber},i.isLastStep=function(){return i.currentStepNumber===i.steps.length},i.isStepCurrent=function(e){return o(e)?i.currentStepNumber===e:null},i.isStepDisabled=function(e){if(!o(e))return null;for(var n=!1,t=1;t<e;t++)if(!s(t)){n=!0;break}return n},i.isStepOptional=t,i.isStepHidden=a,i.filterHiddenStep=function(e){return!a(e.stepNumber)},i.isStepValid=s,i.isStepNumberValid=o,i.isFormValid=function(){return i.mainForm.$valid}}function n(o){return{restrict:"A",scope:{},require:["form","msVerticalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/vertical.html",compile:function(e){return e.addClass("ms-stepper"),function(e,n,t,a){var i=a[0],s=a[1];o(function(){s.setOrientation("vertical"),s.registerMainForm(i),s.setupSteps()})}}}}e.$inject=["$timeout"],n.$inject=["$timeout"],angular.module("app.core").controller("MsStepperController",e).directive("msHorizontalStepper",function(){return{restrict:"A",scope:{},require:["form","msHorizontalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/horizontal/horizontal.html",compile:function(e){return e.addClass("ms-stepper"),function(e,n,t,a){var i=a[0],s=a[1];s.setOrientation("horizontal"),s.registerMainForm(i),s.setupSteps()}}}}).directive("msHorizontalStepperStep",function(){return{restrict:"E",require:["form","^msHorizontalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},compile:function(e){return e.addClass("ms-stepper-step"),function(e,n,t,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(t.optionalStep),s.registerStep(n,e,i),n.hide()}}}}).directive("msVerticalStepper",n).directive("msVerticalStepperStep",function(){return{restrict:"E",require:["form","^msVerticalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",compile:function(e){return e.addClass("ms-stepper-step"),function(e,n,t,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(t.optionalStep),e.stepInfo=s.registerStep(n,e,i),e.MsStepper=s,n.find(".ms-stepper-step-content").hide()}}}})}(),function(){"use strict";function e(e){return{restrict:"E",scope:{},transclude:!0,controller:"MsTabScrollController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-tab-scroll/ms-tab-scroll.html",compile:function(e){return e.addClass("ms-tab-scroll"),function(e,n){}}}}e.$inject=["$document"],angular.module("app.core").controller("MsTabScrollController",function(){function n(){var e=document.getElementById("bar-container"),n=document.getElementById("tab-container");return n.scrollWidth>e.scrollWidth&&0==e.scrollLeft&&0==n.scrollLeft?"right":n.scrollWidth>e.scrollWidth&&n.scrollLeft>e.scrollLeft&&e.scrollWidth+n.scrollLeft>=n.scrollWidth?"left":n.scrollWidth>e.scrollWidth&&n.scrollLeft>e.scrollLeft&&e.scrollWidth+n.scrollLeft<n.scrollWidth?"both":"none"}this.onTabScroll=function(e){"left"==e?$("#tab-container").stop().animate({scrollLeft:"-=400"},1e3):$("#tab-container").stop().animate({scrollLeft:"+=400"},1e3)},this.canScroll=function(e){switch(n()){case"both":return!0;case"left":return"left"==e;case"right":return"right"==e;case"none":default:return!1}}}).directive("msTabScroll",e)}(),function(){"use strict";function e(m,u){return{scope:!0,require:"^msTimeline",compile:function(e){return e.addClass("ms-timeline-item").addClass("hidden"),function(e,t,n,a){var i=72,s=!1,o=!1,r=a.getScrollEl();!function(){t.find("ms-card")?e.$on("msCard::cardTemplateLoaded",function(e,n){var t=angular.element(n[0]);d(t).then(function(){m(function(){s=!0})})}):d(t).then(function(){m(function(){s=!0})});r.on("scroll",c),c()}();var l=e.$watch(function(){return s&&o},function(e,n){angular.equals(e,n)||e&&(t.removeClass("hidden").addClass("animate"),l())},!0);function d(e){var n=u.defer(),t=e.find("img");return 0<t.length?t.on("load",function(){n.resolve("Image is loaded")}):n.resolve("No images"),n.promise}function c(){r.scrollTop()+r.height()>t.position().top+i&&(m(function(){o=!0}),r.off("scroll",c))}}}}}e.$inject=["$timeout","$q"],angular.module("app.core").controller("MsTimelineController",function(){var n=this;n.scrollEl=void 0,n.setScrollEl=function(e){n.scrollEl=e},n.getScrollEl=function(){return n.scrollEl}}).directive("msTimeline",function(){return{scope:{msTimeline:"=?",loadMore:"&?msTimelineLoadMore"},controller:"MsTimelineController",compile:function(e){return e.addClass("ms-timeline"),function(e,n,t,a){var i=angular.element('<div class="ms-timeline-loader md-accent-bg md-whiteframe-4dp"><span class="spinner"></span></div>');n.append(i);var s={scrollEl:"#content"};s=angular.extend(s,e.msTimeline,{});var o=angular.element(s.scrollEl);a.setScrollEl(o);var r=144;function l(){o.scrollTop()+o.height()+r>i.position().top&&(i.addClass("show"),c(),e.loadMore&&e.loadMore().then(function(){i.removeClass("show"),d()},function(){i.remove()}))}function d(){o.on("scroll",l)}function c(){o.off("scroll",l)}d(),e.$on("$destroy",function(){c()})}}}}).directive("msTimelineItem",e)}(),function(){"use strict";function e(a,e,n,i,t){var r=this;function s(){!function(){r.millis=l().diff(moment(r.startingTime));var e=moment.duration(r.millis),n=e.seconds(),t=e.minutes(),a=e.hours(),i=e.days(),s=e.months(),o=e.years();r.seconds=n<10?"0"+n:n,r.minutes=t<10?"0"+t:t,r.hours=a<10?"0"+a:a,r.days=i<10?"0"+i:i,r.months=s<10?"0"+s:s,r.years=o<10?"0"+o:o,r.timer=0<r.days?r.days+"d ":r.hours+":"+r.minutes+":"+r.seconds}(),r.timeoutId=setTimeout(function(){s(),a.$digest()},r.interval)}function l(e){var n=(e||moment()).utcOffset(a.serverDateOffset).format("YYYY-MM-DD HH:mm:ss");return moment(n)}function o(){n(function(n,t){try{if(a.serverDateOffset)return void n(l());i.setting.getDate().$promise.then(function(e){a.serverDateOffset=e.offset,n(moment(e.now))})}catch(e){t(e)}}).then(function(e){var n=r.startTime?moment(r.startTime):void 0;r.startTime?n.isAfter(e,"hour")||n.isBefore(e,"hour")?r.startingTime=l(n):r.startingTime=n:r.startingTime=e,s()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.getDate",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}o(),a.$watch("vm.startTime",function(e,n){angular.isUndefined(e)||0!==e.length&&(angular.equals(e,n)||o())}),a.$on("timer-start",function(){r.startTime=void 0,o()}),e.bind("$destroy",function(){r.timeoutId&&clearTimeout(r.timeoutId)})}e.$inject=["$scope","$element","$q","api","toasty"],angular.module("app.core").directive("timer",function(){return{restrict:"EA",replace:!1,scope:{startTime:"=?",interval:"=?"},template:"<span ng-cloak>{{ vm.timer }}</span>",compile:function(){return{pre:function(e,n,t){e.interval=t.interval||1e3}}},controller:e,controllerAs:"vm",bindToController:!0}})}(),function(){"use strict";angular.module("app.core").directive("msTimezone",function(){return{restrict:"E",scope:{ngModel:"=",ngChange:"&"},controller:["$scope",function(e){e.timezone=[{name:"Europe/Andorra",utcOffset:60,offsetStr:"+01:00",countries:["AD"]},{name:"Asia/Dubai",utcOffset:240,offsetStr:"+04:00",countries:["AE","OM"]},{name:"Asia/Kabul",utcOffset:270,offsetStr:"+04:30",countries:["AF"]},{name:"Europe/Tirane",utcOffset:60,offsetStr:"+01:00",countries:["AL"]},{name:"Asia/Yerevan",utcOffset:240,offsetStr:"+04:00",countries:["AM"]},{name:"Antarctica/Rothera",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Palmer",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Mawson",utcOffset:300,offsetStr:"+05:00",countries:["AQ"]},{name:"Antarctica/Davis",utcOffset:420,offsetStr:"+07:00",countries:["AQ"]},{name:"Antarctica/Casey",utcOffset:480,offsetStr:"+08:00",countries:["AQ"]},{name:"Antarctica/Vostok",utcOffset:360,offsetStr:"+06:00",countries:["AQ"]},{name:"Antarctica/DumontDUrville",utcOffset:600,offsetStr:"+10:00",countries:["AQ"]},{name:"Antarctica/Syowa",utcOffset:180,offsetStr:"+03:00",countries:["AQ"]},{name:"Antarctica/Troll",utcOffset:0,offsetStr:"+00:00",countries:["AQ"]},{name:"America/Argentina/Buenos_Aires",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Cordoba",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Salta",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Jujuy",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Tucuman",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Catamarca",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/La_Rioja",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Juan",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Mendoza",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Luis",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Rio_Gallegos",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Ushuaia",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"Pacific/Pago_Pago",utcOffset:-660,offsetStr:"-11:00",countries:["AS","UM"]},{name:"Europe/Vienna",utcOffset:60,offsetStr:"+01:00",countries:["AT"]},{name:"Australia/Lord_Howe",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Antarctica/Macquarie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Hobart",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Currie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Melbourne",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Sydney",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Broken_Hill",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Brisbane",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Lindeman",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Adelaide",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Darwin",utcOffset:570,offsetStr:"+09:30",countries:["AU"]},{name:"Australia/Perth",utcOffset:480,offsetStr:"+08:00",countries:["AU"]},{name:"Australia/Eucla",utcOffset:525,offsetStr:"+08:45",countries:["AU"]},{name:"Asia/Baku",utcOffset:240,offsetStr:"+04:00",countries:["AZ"]},{name:"America/Barbados",utcOffset:-240,offsetStr:"-04:00",countries:["BB"]},{name:"Asia/Dhaka",utcOffset:360,offsetStr:"+06:00",countries:["BD"]},{name:"Europe/Brussels",utcOffset:60,offsetStr:"+01:00",countries:["BE"]},{name:"Europe/Sofia",utcOffset:120,offsetStr:"+02:00",countries:["BG"]},{name:"Atlantic/Bermuda",utcOffset:-240,offsetStr:"-04:00",countries:["BM"]},{name:"Asia/Brunei",utcOffset:480,offsetStr:"+08:00",countries:["BN"]},{name:"America/La_Paz",utcOffset:-240,offsetStr:"-04:00",countries:["BO"]},{name:"America/Noronha",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Belem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Fortaleza",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Recife",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Araguaina",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Maceio",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Bahia",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Sao_Paulo",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Campo_Grande",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Cuiaba",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Santarem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Porto_Velho",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Boa_Vista",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Manaus",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Eirunepe",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Rio_Branco",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Nassau",utcOffset:-300,offsetStr:"-05:00",countries:["BS"]},{name:"Asia/Thimphu",utcOffset:360,offsetStr:"+06:00",countries:["BT"]},{name:"Europe/Minsk",utcOffset:180,offsetStr:"+03:00",countries:["BY"]},{name:"America/Belize",utcOffset:-360,offsetStr:"-06:00",countries:["BZ"]},{name:"America/St_Johns",utcOffset:-210,offsetStr:"-03:30",countries:["CA"]},{name:"America/Halifax",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Glace_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Moncton",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Goose_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Blanc-Sablon",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Toronto",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Nipigon",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Thunder_Bay",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Iqaluit",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Pangnirtung",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Resolute",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Atikokan",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Rankin_Inlet",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Winnipeg",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Rainy_River",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Regina",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Swift_Current",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Edmonton",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Cambridge_Bay",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Yellowknife",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Inuvik",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Creston",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Dawson_Creek",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Fort_Nelson",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Vancouver",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Whitehorse",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Dawson",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"Indian/Cocos",utcOffset:390,offsetStr:"+06:30",countries:["CC"]},{name:"Europe/Zurich",utcOffset:60,offsetStr:"+01:00",countries:["CH","DE","LI"]},{name:"Africa/Abidjan",utcOffset:0,offsetStr:"+00:00",countries:["CI","BF","GM","GN","ML","MR","SH","SL","SN","ST","TG"]},{name:"Pacific/Rarotonga",utcOffset:-600,offsetStr:"-10:00",countries:["CK"]},{name:"America/Santiago",utcOffset:-180,offsetStr:"-03:00",countries:["CL"]},{name:"Pacific/Easter",utcOffset:-300,offsetStr:"-05:00",countries:["CL"]},{name:"Asia/Shanghai",utcOffset:480,offsetStr:"+08:00",countries:["CN"]},{name:"Asia/Urumqi",utcOffset:360,offsetStr:"+06:00",countries:["CN"]},{name:"America/Bogota",utcOffset:-300,offsetStr:"-05:00",countries:["CO"]},{name:"America/Costa_Rica",utcOffset:-360,offsetStr:"-06:00",countries:["CR"]},{name:"America/Havana",utcOffset:-300,offsetStr:"-05:00",countries:["CU"]},{name:"Atlantic/Cape_Verde",utcOffset:-60,offsetStr:"-01:00",countries:["CV"]},{name:"America/Curacao",utcOffset:-240,offsetStr:"-04:00",countries:["CW","AW","BQ","SX"]},{name:"Indian/Christmas",utcOffset:420,offsetStr:"+07:00",countries:["CX"]},{name:"Asia/Nicosia",utcOffset:120,offsetStr:"+02:00",countries:["CY"]},{name:"Europe/Prague",utcOffset:60,offsetStr:"+01:00",countries:["CZ","SK"]},{name:"Europe/Berlin",utcOffset:60,offsetStr:"+01:00",countries:["DE"]},{name:"Europe/Copenhagen",utcOffset:60,offsetStr:"+01:00",countries:["DK"]},{name:"America/Santo_Domingo",utcOffset:-240,offsetStr:"-04:00",countries:["DO"]},{name:"Africa/Algiers",utcOffset:60,offsetStr:"+01:00",countries:["DZ"]},{name:"America/Guayaquil",utcOffset:-300,offsetStr:"-05:00",countries:["EC"]},{name:"Pacific/Galapagos",utcOffset:-360,offsetStr:"-06:00",countries:["EC"]},{name:"Europe/Tallinn",utcOffset:120,offsetStr:"+02:00",countries:["EE"]},{name:"Africa/Cairo",utcOffset:120,offsetStr:"+02:00",countries:["EG"]},{name:"Africa/El_Aaiun",utcOffset:0,offsetStr:"+00:00",countries:["EH"]},{name:"Europe/Madrid",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Africa/Ceuta",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Atlantic/Canary",utcOffset:0,offsetStr:"+00:00",countries:["ES"]},{name:"Europe/Helsinki",utcOffset:120,offsetStr:"+02:00",countries:["FI","AX"]},{name:"Pacific/Fiji",utcOffset:720,offsetStr:"+12:00",countries:["FJ"]},{name:"Atlantic/Stanley",utcOffset:-180,offsetStr:"-03:00",countries:["FK"]},{name:"Pacific/Chuuk",utcOffset:600,offsetStr:"+10:00",countries:["FM"]},{name:"Pacific/Pohnpei",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Pacific/Kosrae",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Atlantic/Faroe",utcOffset:0,offsetStr:"+00:00",countries:["FO"]},{name:"Europe/Paris",utcOffset:60,offsetStr:"+01:00",countries:["FR"]},{name:"Europe/London",utcOffset:0,offsetStr:"+00:00",countries:["GB","GG","IM","JE"]},{name:"Asia/Tbilisi",utcOffset:240,offsetStr:"+04:00",countries:["GE"]},{name:"America/Cayenne",utcOffset:-180,offsetStr:"-03:00",countries:["GF"]},{name:"Africa/Accra",utcOffset:0,offsetStr:"+00:00",countries:["GH"]},{name:"Europe/Gibraltar",utcOffset:60,offsetStr:"+01:00",countries:["GI"]},{name:"America/Godthab",utcOffset:-180,offsetStr:"-03:00",countries:["GL"]},{name:"America/Danmarkshavn",utcOffset:0,offsetStr:"+00:00",countries:["GL"]},{name:"America/Scoresbysund",utcOffset:-60,offsetStr:"-01:00",countries:["GL"]},{name:"America/Thule",utcOffset:-240,offsetStr:"-04:00",countries:["GL"]},{name:"Europe/Athens",utcOffset:120,offsetStr:"+02:00",countries:["GR"]},{name:"Atlantic/South_Georgia",utcOffset:-120,offsetStr:"-02:00",countries:["GS"]},{name:"America/Guatemala",utcOffset:-360,offsetStr:"-06:00",countries:["GT"]},{name:"Pacific/Guam",utcOffset:600,offsetStr:"+10:00",countries:["GU","MP"]},{name:"Africa/Bissau",utcOffset:0,offsetStr:"+00:00",countries:["GW"]},{name:"America/Guyana",utcOffset:-240,offsetStr:"-04:00",countries:["GY"]},{name:"Asia/Hong_Kong",utcOffset:480,offsetStr:"+08:00",countries:["HK"]},{name:"America/Tegucigalpa",utcOffset:-360,offsetStr:"-06:00",countries:["HN"]},{name:"America/Port-au-Prince",utcOffset:-300,offsetStr:"-05:00",countries:["HT"]},{name:"Europe/Budapest",utcOffset:60,offsetStr:"+01:00",countries:["HU"]},{name:"Asia/Jakarta",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Pontianak",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Makassar",utcOffset:480,offsetStr:"+08:00",countries:["ID"]},{name:"Asia/Jayapura",utcOffset:540,offsetStr:"+09:00",countries:["ID"]},{name:"Europe/Dublin",utcOffset:0,offsetStr:"+00:00",countries:["IE"]},{name:"Asia/Jerusalem",utcOffset:120,offsetStr:"+02:00",countries:["IL"]},{name:"Asia/Kolkata",utcOffset:330,offsetStr:"+05:30",countries:["IN"]},{name:"Indian/Chagos",utcOffset:360,offsetStr:"+06:00",countries:["IO"]},{name:"Asia/Baghdad",utcOffset:180,offsetStr:"+03:00",countries:["IQ"]},{name:"Asia/Tehran",utcOffset:210,offsetStr:"+03:30",countries:["IR"]},{name:"Atlantic/Reykjavik",utcOffset:0,offsetStr:"+00:00",countries:["IS"]},{name:"Europe/Rome",utcOffset:60,offsetStr:"+01:00",countries:["IT","SM","VA"]},{name:"America/Jamaica",utcOffset:-300,offsetStr:"-05:00",countries:["JM"]},{name:"Asia/Amman",utcOffset:120,offsetStr:"+02:00",countries:["JO"]},{name:"Asia/Tokyo",utcOffset:540,offsetStr:"+09:00",countries:["JP"]},{name:"Africa/Nairobi",utcOffset:180,offsetStr:"+03:00",countries:["KE","DJ","ER","ET","KM","MG","SO","TZ","UG","YT"]},{name:"Asia/Bishkek",utcOffset:360,offsetStr:"+06:00",countries:["KG"]},{name:"Pacific/Tarawa",utcOffset:720,offsetStr:"+12:00",countries:["KI"]},{name:"Pacific/Enderbury",utcOffset:780,offsetStr:"+13:00",countries:["KI"]},{name:"Pacific/Kiritimati",utcOffset:840,offsetStr:"+14:00",countries:["KI"]},{name:"Asia/Pyongyang",utcOffset:510,offsetStr:"+08:30",countries:["KP"]},{name:"Asia/Seoul",utcOffset:540,offsetStr:"+09:00",countries:["KR"]},{name:"America/Cayman",utcOffset:-300,offsetStr:"-05:00",countries:["KY"]},{name:"Asia/Almaty",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Qyzylorda",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Aqtobe",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Aqtau",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Oral",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Beirut",utcOffset:120,offsetStr:"+02:00",countries:["LB"]},{name:"Asia/Colombo",utcOffset:330,offsetStr:"+05:30",countries:["LK"]},{name:"Africa/Monrovia",utcOffset:0,offsetStr:"+00:00",countries:["LR"]},{name:"Europe/Vilnius",utcOffset:120,offsetStr:"+02:00",countries:["LT"]},{name:"Europe/Luxembourg",utcOffset:60,offsetStr:"+01:00",countries:["LU"]},{name:"Europe/Riga",utcOffset:120,offsetStr:"+02:00",countries:["LV"]},{name:"Africa/Tripoli",utcOffset:120,offsetStr:"+02:00",countries:["LY"]},{name:"Africa/Casablanca",utcOffset:0,offsetStr:"+00:00",countries:["MA"]},{name:"Europe/Monaco",utcOffset:60,offsetStr:"+01:00",countries:["MC"]},{name:"Europe/Chisinau",utcOffset:120,offsetStr:"+02:00",countries:["MD"]},{name:"Pacific/Majuro",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Pacific/Kwajalein",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Asia/Rangoon",utcOffset:390,offsetStr:"+06:30",countries:["MM"]},{name:"Asia/Ulaanbaatar",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Hovd",utcOffset:420,offsetStr:"+07:00",countries:["MN"]},{name:"Asia/Choibalsan",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Macau",utcOffset:480,offsetStr:"+08:00",countries:["MO"]},{name:"America/Martinique",utcOffset:-240,offsetStr:"-04:00",countries:["MQ"]},{name:"Europe/Malta",utcOffset:60,offsetStr:"+01:00",countries:["MT"]},{name:"Indian/Mauritius",utcOffset:240,offsetStr:"+04:00",countries:["MU"]},{name:"Indian/Maldives",utcOffset:300,offsetStr:"+05:00",countries:["MV"]},{name:"America/Mexico_City",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Cancun",utcOffset:-300,offsetStr:"-05:00",countries:["MX"]},{name:"America/Merida",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Monterrey",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Matamoros",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Mazatlan",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Chihuahua",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Ojinaga",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Hermosillo",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Tijuana",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Santa_Isabel",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Bahia_Banderas",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"Asia/Kuala_Lumpur",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Asia/Kuching",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Africa/Maputo",utcOffset:120,offsetStr:"+02:00",countries:["MZ","BI","BW","CD","MW","RW","ZM","ZW"]},{name:"Africa/Windhoek",utcOffset:120,offsetStr:"+02:00",countries:["NA"]},{name:"Pacific/Noumea",utcOffset:660,offsetStr:"+11:00",countries:["NC"]},{name:"Pacific/Norfolk",utcOffset:660,offsetStr:"+11:00",countries:["NF"]},{name:"Africa/Lagos",utcOffset:60,offsetStr:"+01:00",countries:["NG","AO","BJ","CD","CF","CG","CM","GA","GQ","NE"]},{name:"America/Managua",utcOffset:-360,offsetStr:"-06:00",countries:["NI"]},{name:"Europe/Amsterdam",utcOffset:60,offsetStr:"+01:00",countries:["NL"]},{name:"Europe/Oslo",utcOffset:60,offsetStr:"+01:00",countries:["NO","SJ"]},{name:"Asia/Kathmandu",utcOffset:345,offsetStr:"+05:45",countries:["NP"]},{name:"Pacific/Nauru",utcOffset:720,offsetStr:"+12:00",countries:["NR"]},{name:"Pacific/Niue",utcOffset:-660,offsetStr:"-11:00",countries:["NU"]},{name:"Pacific/Auckland",utcOffset:780,offsetStr:"+13:00",countries:["NZ","AQ"]},{name:"Pacific/Chatham",utcOffset:825,offsetStr:"+13:45",countries:["NZ"]},{name:"America/Panama",utcOffset:-300,offsetStr:"-05:00",countries:["PA"]},{name:"America/Lima",utcOffset:-300,offsetStr:"-05:00",countries:["PE"]},{name:"Pacific/Tahiti",utcOffset:-600,offsetStr:"-10:00",countries:["PF"]},{name:"Pacific/Marquesas",utcOffset:-570,offsetStr:"-09:30",countries:["PF"]},{name:"Pacific/Gambier",utcOffset:-540,offsetStr:"-09:00",countries:["PF"]},{name:"Pacific/Port_Moresby",utcOffset:600,offsetStr:"+10:00",countries:["PG"]},{name:"Pacific/Bougainville",utcOffset:660,offsetStr:"+11:00",countries:["PG"]},{name:"Asia/Manila",utcOffset:480,offsetStr:"+08:00",countries:["PH"]},{name:"Asia/Karachi",utcOffset:300,offsetStr:"+05:00",countries:["PK"]},{name:"Europe/Warsaw",utcOffset:60,offsetStr:"+01:00",countries:["PL"]},{name:"America/Miquelon",utcOffset:-180,offsetStr:"-03:00",countries:["PM"]},{name:"Pacific/Pitcairn",utcOffset:-480,offsetStr:"-08:00",countries:["PN"]},{name:"America/Puerto_Rico",utcOffset:-240,offsetStr:"-04:00",countries:["PR"]},{name:"Asia/Gaza",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Asia/Hebron",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Europe/Lisbon",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Madeira",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Azores",utcOffset:-60,offsetStr:"-01:00",countries:["PT"]},{name:"Pacific/Palau",utcOffset:540,offsetStr:"+09:00",countries:["PW"]},{name:"America/Asuncion",utcOffset:-180,offsetStr:"-03:00",countries:["PY"]},{name:"Asia/Qatar",utcOffset:180,offsetStr:"+03:00",countries:["QA","BH"]},{name:"Indian/Reunion",utcOffset:240,offsetStr:"+04:00",countries:["RE","TF"]},{name:"Europe/Bucharest",utcOffset:120,offsetStr:"+02:00",countries:["RO"]},{name:"Europe/Belgrade",utcOffset:60,offsetStr:"+01:00",countries:["RS","BA","HR","ME","MK","SI"]},{name:"Europe/Kaliningrad",utcOffset:120,offsetStr:"+02:00",countries:["RU"]},{name:"Europe/Moscow",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Simferopol",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Volgograd",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Samara",utcOffset:240,offsetStr:"+04:00",countries:["RU"]},{name:"Asia/Yekaterinburg",utcOffset:300,offsetStr:"+05:00",countries:["RU"]},{name:"Asia/Omsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novosibirsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novokuznetsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Krasnoyarsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Irkutsk",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Chita",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Yakutsk",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Khandyga",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Vladivostok",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Sakhalin",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Ust-Nera",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Magadan",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Srednekolymsk",utcOffset:660,offsetStr:"+11:00",countries:["RU"]},{name:"Asia/Kamchatka",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Anadyr",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Riyadh",utcOffset:180,offsetStr:"+03:00",countries:["SA","KW","YE"]},{name:"Pacific/Guadalcanal",utcOffset:660,offsetStr:"+11:00",countries:["SB"]},{name:"Indian/Mahe",utcOffset:240,offsetStr:"+04:00",countries:["SC"]},{name:"Africa/Khartoum",utcOffset:180,offsetStr:"+03:00",countries:["SD","SS"]},{name:"Europe/Stockholm",utcOffset:60,offsetStr:"+01:00",countries:["SE"]},{name:"Asia/Singapore",utcOffset:480,offsetStr:"+08:00",countries:["SG"]},{name:"America/Paramaribo",utcOffset:-180,offsetStr:"-03:00",countries:["SR"]},{name:"America/El_Salvador",utcOffset:-360,offsetStr:"-06:00",countries:["SV"]},{name:"Asia/Damascus",utcOffset:120,offsetStr:"+02:00",countries:["SY"]},{name:"America/Grand_Turk",utcOffset:-240,offsetStr:"-04:00",countries:["TC"]},{name:"Africa/Ndjamena",utcOffset:60,offsetStr:"+01:00",countries:["TD"]},{name:"Indian/Kerguelen",utcOffset:300,offsetStr:"+05:00",countries:["TF"]},{name:"Asia/Bangkok",utcOffset:420,offsetStr:"+07:00",countries:["TH","KH","LA","VN"]},{name:"Asia/Dushanbe",utcOffset:300,offsetStr:"+05:00",countries:["TJ"]},{name:"Pacific/Fakaofo",utcOffset:780,offsetStr:"+13:00",countries:["TK"]},{name:"Asia/Dili",utcOffset:540,offsetStr:"+09:00",countries:["TL"]},{name:"Asia/Ashgabat",utcOffset:300,offsetStr:"+05:00",countries:["TM"]},{name:"Africa/Tunis",utcOffset:60,offsetStr:"+01:00",countries:["TN"]},{name:"Pacific/Tongatapu",utcOffset:780,offsetStr:"+13:00",countries:["TO"]},{name:"Europe/Istanbul",utcOffset:120,offsetStr:"+02:00",countries:["TR"]},{name:"America/Port_of_Spain",utcOffset:-240,offsetStr:"-04:00",countries:["TT","AG","AI","BL","DM","GD","GP","KN","LC","MF","MS","VC","VG","VI"]},{name:"Pacific/Funafuti",utcOffset:720,offsetStr:"+12:00",countries:["TV"]},{name:"Asia/Taipei",utcOffset:480,offsetStr:"+08:00",countries:["TW"]},{name:"Europe/Kiev",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Uzhgorod",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Zaporozhye",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Pacific/Wake",utcOffset:720,offsetStr:"+12:00",countries:["UM"]},{name:"America/New_York",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Detroit",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Louisville",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Monticello",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Indianapolis",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vincennes",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Winamac",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Marengo",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Petersburg",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vevay",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Chicago",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Tell_City",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Knox",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Menominee",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Center",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/New_Salem",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Beulah",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Denver",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Boise",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Phoenix",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Los_Angeles",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Metlakatla",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Anchorage",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Juneau",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Sitka",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Yakutat",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Nome",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Adak",utcOffset:-600,offsetStr:"-10:00",countries:["US"]},{name:"Pacific/Honolulu",utcOffset:-600,offsetStr:"-10:00",countries:["US","UM"]},{name:"America/Montevideo",utcOffset:-180,offsetStr:"-03:00",countries:["UY"]},{name:"Asia/Samarkand",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"Asia/Tashkent",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"America/Caracas",utcOffset:-270,offsetStr:"-04:30",countries:["VE"]},{name:"Asia/Ho_Chi_Minh",utcOffset:420,offsetStr:"+07:00",countries:["VN"]},{name:"Pacific/Efate",utcOffset:660,offsetStr:"+11:00",countries:["VU"]},{name:"Pacific/Wallis",utcOffset:720,offsetStr:"+12:00",countries:["WF"]},{name:"Pacific/Apia",utcOffset:840,offsetStr:"+14:00",countries:["WS"]},{name:"Africa/Johannesburg",utcOffset:120,offsetStr:"+02:00",countries:["ZA","LS","SZ"]}]}],link:function(e,n,t,a){e.updateModel=function(e){a.$setViewValue(e)},"callysquare"in t&&e.timezone.push({name:"{CALLERID(dialTimezone)}",offsetStr:"caller timezone"})},templateUrl:"app/core/directives/ms-timezone/ms-timezone.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsWidgetEngineCounterController",function(){var s=this;s.filter=[],s.filtered=!1,s.fontSize=20,s.label="",s.getCount=function(a){var i=0;if(a){s.fontSize=a.attrs[2]&&a.attrs[2].value?parseInt(a.attrs[2].value)-parseInt(a.attrs[2].value)%2:20;var e=a.attrs.find(function(e){return"attrChannel"===e.name});e||a.attrs.push({name:"attrChannel",value:"voice"}),a.attrs.forEach(function(e,n){if("voice"!==a.attrs[3].value?"talking"===a.attrs[0].value?s.label="Opened":"answered"===a.attrs[0].value?s.label="Managed":s.label=a.attrs[0].value:s.label=a.attrs[0].value,!_.isEmpty(e.value))if(e.name.toLowerCase().includes("voice")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.voiceQueuesSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.voiceQueuesSelected);for(var t=0;t<a.voiceQueues.rows.length;t+=1)_.includes(s.filter,a.voiceQueues.rows[t].id)&&(i+=a.voiceQueues.rows[t][a.attrs[0].value]?parseInt(a.voiceQueues.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("chat")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.chatWebsitesSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.chatWebsitesSelected);for(var t=0;t<a.chatWebsites.rows.length;t+=1)_.includes(s.filter,a.chatWebsites.rows[t].id)&&(i+=a.chatWebsites.rows[t][a.attrs[0].value]?parseInt(a.chatWebsites.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("fax")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.faxAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.faxAccountsSelected);for(var t=0;t<a.faxAccounts.rows.length;t+=1)_.includes(s.filter,a.faxAccounts.rows[t].id)&&(i+=a.faxAccounts.rows[t][a.attrs[0].value]?parseInt(a.faxAccounts.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("mail")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.mailAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.mailAccountsSelected);for(var t=0;t<a.mailAccounts.rows.length;t+=1)_.includes(s.filter,a.mailAccounts.rows[t].id)&&(i+=a.mailAccounts.rows[t][a.attrs[0].value]?parseInt(a.mailAccounts.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("openchannel")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.openchannelAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.openchannelAccountsSelected);for(var t=0;t<a.openchannelAccounts.rows.length;t+=1)_.includes(s.filter,a.openchannelAccounts.rows[t].id)&&(i+=a.openchannelAccounts.rows[t][a.attrs[0].value]?parseInt(a.openchannelAccounts.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("whatsapp")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.whatsappAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.whatsappAccountsSelected);for(var t=0;t<a.whatsappAccounts.rows.length;t+=1)_.includes(s.filter,a.whatsappAccounts.rows[t].id)&&(i+=a.whatsappAccounts.rows[t][a.attrs[0].value]?parseInt(a.whatsappAccounts.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("sms")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.smsAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.smsAccountsSelected);for(var t=0;t<a.smsAccounts.rows.length;t+=1)_.includes(s.filter,a.smsAccounts.rows[t].id)&&(i+=a.smsAccounts.rows[t][a.attrs[0].value]?parseInt(a.smsAccounts.rows[t][a.attrs[0].value]):0)}})}return i}})}(),function(){"use strict";function e(r,e){var l=this;l.filter=[],l.filtered=!1,l.properties=[],l.multiBarChart={labels:["QUEUE_NAME"],series:["TOTAL"],data:[[50]],options:{responsive:!0,legend:{display:!0,fontColor:"#2196f3"},scales:{xAxes:[{gridLines:{display:!0},ticks:{fontColor:"#2196f3",stepSize:1,beginAtZero:!0}}],yAxes:[{gridLines:{display:!1},ticks:{fontColor:"#2196f3"}}]}}},l.getMultiBarChart=function(e){e&&(e.attrs&&function(e){switch(l.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[4].value){case"voice":e.attrs[3].value&&e.attrs[3].value.length?(l.filtered=!0,l.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(l.filtered=!1,l.filter=e.voiceQueuesSelected);break;case"sms":e.attrs[7].value&&e.attrs[7].value.length?(l.filtered=!0,l.filter=_.intersection(e.smsAccountsSelected,e.attrs[7].value)):(l.filtered=!1,l.filter=e.smsAccountsSelected);break;case"mail":e.attrs[5].value&&e.attrs[5].value.length?(l.filtered=!0,l.filter=_.intersection(e.mailAccountsSelected,e.attrs[5].value)):(l.filtered=!1,l.filter=e.mailAccountsSelected);break;case"chat":e.attrs[10].value&&e.attrs[10].value.length?(l.filtered=!0,l.filter=_.intersection(e.chatWebsitesSelected,e.attrs[10].value)):(l.filtered=!1,l.filter=e.chatWebsitesSelected);break;case"fax":e.attrs[6].value&&e.attrs[6].value.length?(l.filtered=!0,l.filter=_.intersection(e.faxAccountsSelected,e.attrs[6].value)):(l.filtered=!1,l.filter=e.faxAccountsSelected);break;case"openchannel":e.attrs[8].value&&e.attrs[8].value.length?(l.filtered=!0,l.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[8].value)):(l.filtered=!1,l.filter=e.openchannelAccountsSelected);break;case"whatsapp":e.attrs[9].value&&e.attrs[9].value.length?(l.filtered=!0,l.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[9].value)):(l.filtered=!1,l.filter=e.whatsappAccountsSelected);break;default:e.attrs[3].value&&e.attrs[3].value.length?(l.filtered=!0,l.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(l.filtered=!1,l.filter=e.voiceQueuesSelected)}if(l.multiBarChart.series.length>l.properties.length){var n=l.multiBarChart.series.length-l.properties.length;l.multiBarChart.series.splice(0,n),l.multiBarChart.data.splice(0,n)}for(var t=0;t<l.properties.length;t+=1){var a="";if(a="voice"!==e.attrs[4].value?"talking"===l.properties[t]?"Opened":"answered"===l.properties[t]?"Managed":l.properties[t]:l.properties[t],l.multiBarChart.series[t]=r.instant("TOOLS."+a.toUpperCase()),_.isNil(l.multiBarChart.data[t])&&(l.multiBarChart.data[t]=[]),l.multiBarChart.labels.length>l.filter.length){var i=l.multiBarChart.labels.length-l.filter.length;l.multiBarChart.labels.splice(0,i),l.multiBarChart.data[t].splice(0,i)}switch(e.attrs[4].value){case"voice":for(var s=0,o=0;s<e.voiceQueues.rows.length;s+=1)_.includes(l.filter,e.voiceQueues.rows[s].id)&&(l.multiBarChart.labels[o]=e.voiceQueues.rows[s].name,l.multiBarChart.data[t][o]=e.voiceQueues.rows[s][l.properties[t]]?parseInt(e.voiceQueues.rows[s][l.properties[t]]):0,o+=1);break;case"sms":for(var s=0,o=0;s<e.smsAccounts.rows.length;s+=1)_.includes(l.filter,e.smsAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.smsAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.smsAccounts.rows[s][l.properties[t]]?parseInt(e.smsAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"chat":for(var s=0,o=0;s<e.chatWebsites.rows.length;s+=1)_.includes(l.filter,e.chatWebsites.rows[s].id)&&(l.multiBarChart.labels[o]=e.chatWebsites.rows[s].name,l.multiBarChart.data[t][o]=e.chatWebsites.rows[s][l.properties[t]]?parseInt(e.chatWebsites.rows[s][l.properties[t]]):0,o+=1);break;case"fax":for(var s=0,o=0;s<e.faxAccounts.rows.length;s+=1)_.includes(l.filter,e.faxAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.faxAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.faxAccounts.rows[s][l.properties[t]]?parseInt(e.faxAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"mail":for(var s=0,o=0;s<e.mailAccounts.rows.length;s+=1)_.includes(l.filter,e.mailAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.mailAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.mailAccounts.rows[s][l.properties[t]]?parseInt(e.mailAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"openchannel":for(var s=0,o=0;s<e.openchannelAccounts.rows.length;s+=1)_.includes(l.filter,e.openchannelAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.openchannelAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.openchannelAccounts.rows[s][l.properties[t]]?parseInt(e.openchannelAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"whatsapp":for(var s=0,o=0;s<e.whatsappAccounts.rows.length;s+=1)_.includes(l.filter,e.whatsappAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.whatsappAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.whatsappAccounts.rows[s][l.properties[t]]?parseInt(e.whatsappAccounts.rows[s][l.properties[t]]):0,o+=1);break;default:for(var s=0,o=0;s<e.voiceQueues.rows.length;s+=1)_.includes(l.filter,e.voiceQueues.rows[s].id)&&(l.multiBarChart.labels[o]=e.voiceQueues.rows[s].name,l.multiBarChart.data[t][o]=e.voiceQueues.rows[s][l.properties[t]]?parseInt(e.voiceQueues.rows[s][l.properties[t]]):0,o+=1)}}}(e),e.foreground&&function(e){l.multiBarChart.options.legend.fontColor=e.foreground;for(var n=0;n<l.multiBarChart.options.scales.xAxes.length;n+=1)l.multiBarChart.options.scales.xAxes[n].ticks.fontColor=e.foreground;for(var t=0;t<l.multiBarChart.options.scales.yAxes.length;t+=1)l.multiBarChart.options.scales.yAxes[t].ticks.fontColor=e.foreground}(e))}}e.$inject=["$translate","socket"],angular.module("app.core").controller("MsWidgetEngineMultibarChartController",e)}(),function(){"use strict";function e(s){var o=this;o.filter=[],o.filtered=!1,o.properties=[],o.pieChart={labels:["ANSWERED"],data:[30],options:{responsive:!0,legend:{display:!0}}},o.getPieChart=function(e){e&&(e.attrs&&function(e){switch(o.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[4].value){case"voice":e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected);break;case"sms":e.attrs[7].value&&e.attrs[7].value.length?(o.filtered=!0,o.filter=_.intersection(e.smsAccountsSelected,e.attrs[7].value)):(o.filtered=!1,o.filter=e.smsAccountsSelected);break;case"mail":e.attrs[5].value&&e.attrs[5].value.length?(o.filtered=!0,o.filter=_.intersection(e.mailAccountsSelected,e.attrs[5].value)):(o.filtered=!1,o.filter=e.mailAccountsSelected);break;case"chat":e.attrs[10].value&&e.attrs[10].value.length?(o.filtered=!0,o.filter=_.intersection(e.chatWebsitesSelected,e.attrs[10].value)):(o.filtered=!1,o.filter=e.chatWebsitesSelected);break;case"fax":e.attrs[6].value&&e.attrs[6].value.length?(o.filtered=!0,o.filter=_.intersection(e.faxAccountsSelected,e.attrs[6].value)):(o.filtered=!1,o.filter=e.faxAccountsSelected);break;case"openchannel":e.attrs[8].value&&e.attrs[8].value.length?(o.filtered=!0,o.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[8].value)):(o.filtered=!1,o.filter=e.openchannelAccountsSelected);break;case"whatsapp":e.attrs[9].value&&e.attrs[9].value.length?(o.filtered=!0,o.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[9].value)):(o.filtered=!1,o.filter=e.whatsappAccountsSelected);break;default:e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected)}if(o.pieChart.labels.length>o.properties.length){var n=o.pieChart.labels.length-o.properties.length;o.pieChart.labels.splice(0,n),o.pieChart.data.splice(0,n)}for(var t=0,a=0;t<o.properties.length;t+=1){switch("voice"!==e.attrs[4].value?"talking"===o.properties[t]?o.pieChart.labels[t]=s.instant("TOOLS.OPENED"):"answered"===o.properties[t]?o.pieChart.labels[t]=s.instant("TOOLS.MANAGED"):o.pieChart.labels[t]=s.instant("TOOLS."+o.properties[t].toUpperCase()):o.pieChart.labels[t]=s.instant("TOOLS."+o.properties[t].toUpperCase()),e.attrs[4].value){case"voice":for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[t]]?parseInt(e.voiceQueues.rows[i][o.properties[t]]):0);break;case"sms":for(var i=0;i<e.smsAccounts.rows.length;i+=1)_.includes(o.filter,e.smsAccounts.rows[i].id)&&(a+=e.smsAccounts.rows[i][o.properties[t]]?parseInt(e.smsAccounts.rows[i][o.properties[t]]):0);break;case"chat":for(var i=0;i<e.chatWebsites.rows.length;i+=1)_.includes(o.filter,e.chatWebsites.rows[i].id)&&(a+=e.chatWebsites.rows[i][o.properties[t]]?parseInt(e.chatWebsites.rows[i][o.properties[t]]):0);break;case"fax":for(var i=0;i<e.faxAccounts.rows.length;i+=1)_.includes(o.filter,e.faxAccounts.rows[i].id)&&(a+=e.faxAccounts.rows[i][o.properties[t]]?parseInt(e.faxAccounts.rows[i][o.properties[t]]):0);break;case"mail":for(var i=0;i<e.mailAccounts.rows.length;i+=1)_.includes(o.filter,e.mailAccounts.rows[i].id)&&(a+=e.mailAccounts.rows[i][o.properties[t]]?parseInt(e.mailAccounts.rows[i][o.properties[t]]):0);break;case"openchannel":for(var i=0;i<e.openchannelAccounts.rows.length;i+=1)_.includes(o.filter,e.openchannelAccounts.rows[i].id)&&(a+=e.openchannelAccounts.rows[i][o.properties[t]]?parseInt(e.openchannelAccounts.rows[i][o.properties[t]]):0);break;case"whatsapp":for(var i=0;i<e.whatsappAccounts.rows.length;i+=1)_.includes(o.filter,e.whatsappAccounts.rows[i].id)&&(a+=e.whatsappAccounts.rows[i][o.properties[t]]?parseInt(e.whatsappAccounts.rows[i][o.properties[t]]):0);break;default:for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[t]]?parseInt(e.voiceQueues.rows[i][o.properties[t]]):0)}o.pieChart.data[t]=a,a=0}}(e),e.foreground&&(n=e,o.pieChart.options.legend.fontColor=n.foreground));var n}}e.$inject=["$translate"],angular.module("app.core").controller("MsWidgetEnginePieChartController",e)}(),function(){"use strict";function e(e,t,a,i){var s=this;function n(e){s.results=e||{count:0,rows:[]}}function o(){s.query.offset=(s.query.page-1)*s.query.limit,s.promise=i[s.reportRoute].run(s.query,n).$promise}s.countDown=0,s.refresh=0,s.title="",s.columns=[],s.results={rows:[],count:0},s.query={limit:10,page:1,startDate:moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),endDate:moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),output:"web"},s.onInit=function e(n){n&&n.attrs&&(n.attrs[0]&&n.attrs[0].value&&(s.query.id=n.attrs[0].value,i.analyticFieldReport.get({fields:"field,alias",nolimit:!0,DefaultReportId:"default"===n.attrs[0].type?n.attrs[0].value:void 0,CustomReportId:"custom"===n.attrs[0].type?n.attrs[0].value:void 0}).$promise.then(function(e){switch(e&&e.rows&&(s.columns=e.rows),n.attrs[0].type){case"default":s.reportRoute="analyticDefaultReport";break;case"custom":s.reportRoute="analyticCustomReport"}return i[s.reportRoute].get({id:n.attrs[0].value,fields:"id,name"}).$promise}).then(function(e){e&&e.name&&(s.title=e.name),o()}).catch(function(e){console.log(e)})),n.attrs[1]&&n.attrs[1].value&&(s.refresh=parseInt(n.attrs[1].value),!_.isNaN(s.refresh)&&0<s.refresh?(s.countDown=parseInt(n.attrs[1].value),s.interval=a(function(){s.countDown-=1},1e3,0),s.timeout=t(function(){s.interval&&a.cancel(s.interval),e(n)},1e3*s.refresh)):(s.interval&&a.cancel(s.interval),s.timeout&&t.cancel(s.timeout))))},s.getResults=o,s.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n},e.$on("$destroy",function(){s.interval&&a.cancel(s.interval),s.timeout&&t.cancel(s.timeout)})}e.$inject=["$scope","$timeout","$interval","api"],angular.module("app.core").controller("MsWidgetEngineWebReportController",e)}(),function(){"use strict";function e(e,n){this.getTrustedURL=function(e){return n.trustAsResourceUrl(e)}}function n(e){return{restrict:"E",scope:{config:"=?",onEdit:"&?",onDelete:"&?"},require:"msWidgetEngine",controller:"MsWidgetEngineController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-widget-engine/ms-widget-engine.html"}}e.$inject=["$mdDialog","$sce"],n.$inject=["$document"],angular.module("app.core").controller("MsWidgetEngineController",e).directive("msWidgetEngine",n)}(),function(){"use strict";function e(e,n){var t=this;t.flipped=!1,t.flip=function(){if(!angular.isDefined(e.flippable)||!0!==e.flippable)return;t.flipped=!t.flipped,n.toggleClass("flipped",t.flipped)}}e.$inject=["$scope","$element"],angular.module("app.core").controller("MsWidgetController",e).directive("msWidget",function(){return{restrict:"E",scope:{flippable:"=?"},controller:"MsWidgetController",transclude:!0,compile:function(e){return e.addClass("ms-widget"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)})}}}}).directive("msWidgetFront",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-front"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)}),e.flipWidget=a.flip}}}}).directive("msWidgetBack",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-back"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)}),e.flipWidget=a.flip}}}})}(),function(){"use strict";function e(s,n,o,r){return{restrict:"A",require:"?ngModel",link:function(t,a,e,i){o.isAdmin()||o.isTelephone()||(""!==e.privacy||o.getCurrentUser().privacyEnabled)&&!1!==t.$eval(e.privacy)&&(i?(i.$formatters.push(function(e){if(!e)return e;var n=r.mask(e);return i.$setViewValue(n),i.$render(),i.$viewValue}),i.$parsers.push(function(){return i.$modelValue}),a[0].disabled=!0):n(function(){s(a.contents())(t);var e=a.text();if(e){var n=r.mask(e);a.text(n)}}))}}}e.$inject=["$compile","$timeout","Auth","privacyManager"],angular.module("app.core").directive("privacy",e)}(),function(){"use strict";function e(o,r,i,l,d){var e={get:function(s,a){return o(function(n,t){0===a.offset&&(s=void 0);var e=_.merge({},a);i.cmContact.getJourney(e).$promise.then(function(e){var a,n=_(e.rows).uniqBy(function(e){return e.channel}).map("channel").value();return(a=n,o(function(e,n){var t=a.map(function(n){if("voice"!==n){var e="get"+_.startCase(n)+("chat"===n?"Websites":"Accounts");return i.user[e]({id:l.getCurrentUser().id,attributes:["id","name"],nolimit:!0}).$promise.then(function(e){c[n]=e.rows})}});return o.all(t).then(function(){e()}).catch(function(e){n(e)})})).then(function(){return e.rows.forEach(function(e){var n;e.canOpen=function(e){switch(e.channel){case"chat":return!!c.chat&&_.some(c.chat,["id",e.ChatWebsiteId]);case"fax":return!!c.fax&&_.some(c.fax,["id",e.FaxAccountId]);case"mail":return!!c.mail&&_.some(c.mail,["id",e.MailAccountId]);case"openchannel":return!!c.openchannel&&_.some(c.openchannel,["id",e.OpenchannelAccountId]);case"sms":return!!c.sms&&_.some(c.sms,["id",e.SmsAccountId]);case"voice":return!0;case"whatsapp":return!!c.whatsapp&&_.some(c.whatsapp,["id",e.WhatsappAccountId]);default:return!1}}(e),e.dispositionsValues=(n=e).disposition?"("+_.compact([n.disposition,n.secondDisposition,n.thirdDisposition]).join(" - ")+")":"("+r.instant("DASHBOARDS.NO_DISPOSITION_SET")+")",e.style=function(e){switch(e.channel){case"chat":return{color:"green-A700",icon:"icon-hangouts"};case"fax":return{color:"blue-grey-A200",icon:"icon-deskphone"};case"mail":return{color:"teal",icon:"icon-email"};case"openchannel":return{color:"amber-A200",icon:"icon-google-earth"};case"sms":return{color:"orange",icon:"icon-message-text"};case"voice":return{color:"blue-A700",icon:"icon-phone"};case"whatsapp":return{color:"lime-A700",icon:"icon-whatsapp"}}}(e)}),a=s,i=e,o(function(e,n){try{var t={journey:a?_.union(a,i.rows):i.rows};t.loadMore=0<i.count-t.journey.length,e(t)}catch(e){n(e)}});var a,i})}).then(function(e){n(e)}).catch(function(e){d.error({title:r.instant("CONTACTMANAGER.CUSTOMER_JOURNEY"),msg:r.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),t(e)})})},getQuery:function(){return{range:{from:moment().subtract(3,"M").startOf("month").format("YYYY-MM-DD HH:mm:ss"),to:moment().endOf("month").format("YYYY-MM-DD HH:mm:ss")},limit:10,offset:0}},getQuickFilters:function(){return[{name:"Channel",key:"channel",type:"select",label:"INTEGRATIONS.CHANNEL",customOptions:[{value:void 0,translate:"DASHBOARDS.ALL"},{value:"voice",translate:"DASHBOARDS.VOICE"},{value:"chat",translate:"DASHBOARDS.CHAT"},{value:"mail",translate:"DASHBOARDS.MAIL"},{value:"sms",translate:"DASHBOARDS.SMS"},{value:"fax",translate:"DASHBOARDS.FAX"},{value:"openchannel",translate:"DASHBOARDS.OPENCHANNEL"},{value:"whatsapp",translate:"DASHBOARDS.WHATSAPP"}]},{name:"Start Date",key:"range",type:"date",label:"DASHBOARDS.SELECT_DATE",useFromToKeys:!0}]}},c={};return e}e.$inject=["$q","$translate","api","Auth","toasty"],angular.module("app.core").factory("customerJourneyManager",e)}(),function(){"use strict";function e(t,a,n,i,s){var o={},r={},l={},d={};function c(){r=i.getCurrentUser();var e=n.localStorage.getItem("motion2.home:"+r.id);if(l=e?JSON.parse(e).currentSidebarTab:"dashboard",d=n.localStorage.getItem("motion2.home."+l+":"+r.id)){var a=JSON.parse(d);a.drafts?r.privacyEnabled&&Object.keys(a.drafts).forEach(function(e){var n=a.drafts[e].title,t=n.split(/-(.+)/)[1].trim();a.drafts[e].title=n.replace(t,s.mask(t))}):a.drafts={},d=a}else d={drafts:{}};return d.drafts}function m(){_.isEmpty(o.drafts)?delete d.drafts:d.drafts=o.drafts,n.localStorage.setItem("motion2.home."+l+":"+r.id,JSON.stringify(d))}return o.init=function(){o.drafts=c()},o.getByInteraction=function(n){return o.drafts=c(),_.find(_.values(o.drafts),function(e){return e.interaction&&e.interaction.id===n})},o.removeByInteraction=function(n){o.drafts=c();var e=_.find(_.values(o.drafts),function(e){return e.interaction&&e.interaction.id===n});e&&(delete o.drafts[e.id],m())},o.add=function(e){o.drafts=c();var n=a.instant("DASHBOARDS.UNTITLED");e.contact?n=e.contact.firstName||e.contact.email:_.isEmpty(e.message.subject)||(n=e.message.subject);var t={type:"draft",title:e.account.key+" - "+n,channel:e.channel,content:e.message,account:e.account,interaction:e.interaction,id:_.random(1e10),openedAt:new Date,saved:!1};o.drafts[t.id]=t,m()},o.update=function(e){o.drafts=c();var n=o.drafts[e.id];n&&(n.content=e.message,o.drafts[e.id]=n,m())},o.open=function(e){o.drafts=c();var n=o.drafts[e];n&&t.$broadcast("open"+_.startCase(l)+"Draft",n)},o.remove=function(e){o.drafts=c(),o.drafts[e]&&(delete o.drafts[e],m())},o}e.$inject=["$rootScope","$translate","$window","Auth","privacyManager"],angular.module("app.core").factory("draftManager",e)}(),function(){"use strict";function e(s){var o=[];return function(n,e){e||(e="global-exception");var t,a=s.get("ClientSideLoggingService").getLogger("global-exception"),i=o.findIndex(function(e){return e===n});-1<i?(t=i,o.splice(t,1)):(!function(e){if(100<=o.length){var n=o.length-100+1;o.splice(0,n)}o.push(e)}(n),a.error(e,n))}}e.$inject=["$injector"],angular.module("app.core").factory("$exceptionHandler",e)}(),function(){"use strict";function e(i){function s(e,n){var t=i.localStorage.getItem(e),a=t?JSON.parse(t):{};return n?a[n]:a}function o(e,n){return i.localStorage.setItem(e,JSON.stringify(n))}return{get:s,set:o,update:function(e,n,t){var a=s(e);t?a[t]=n:a=n;return o(e,a)}}}e.$inject=["$window"],angular.module("app.core").factory("localStorageManager",e)}(),function(){"use strict";function e(i){function s(e,n){var t=i.get(),a=0;if(t)switch(n){case"email":a=t.privacyPolicyEmail;break;case"number":a=t.privacyPolicyNumber;break;default:a=t.privacyPolicyName}return _.isNil(a)?e:0===a||a>e.length?e.replace(/./g,"*"):e.substring(0,e.length-a).padEnd(e.length,"*")}function o(e){return _.startsWith(e,"<")&&_.endsWith(e,">")&&(e=e.substring(1,e.length-1)),/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function r(e){if(_.startsWith(e,"<")&&_.endsWith(e,">")){var n=!0;e=e.substring(1,e.length-1)}var t=e.split("@")[0],a=e.split("@")[1],i="";return n&&(i+="<"),i+=s(t,"email"),i+="@",i+=s(a,"email"),n&&(i+=">"),i}return{mask:function n(e){t=e,e=t.replace(/\s\s+/g," ").trim();var t;{if(o(e))return r(e);if(/^[+]?[0-9|.|\-|\s]*$/.test(e))return s(e,"number");var a=[],i=e.split(" ");return 1===i.length?s(e):(i.forEach(function(e){a.push(n(e))}),a.join(" "))}}}}e.$inject=["settingsManager"],angular.module("app.core").factory("privacyManager",e)}(),function(){"use strict";function e(e,s){return{setPlaceholder:function(a){var i;return e(function(n,e){try{if(_.isEmpty(a.resources))i=s.instant("DASHBOARDS.NONE");else if(_.isEmpty(a.param))i=a.placeholder?s.instant(a.placeholder):s.instant("DASHBOARDS.CHOOSE");else if(a.param.length===a.resources.length)i=s.instant("DASHBOARDS.ALL");else{var t=a.ngValue||"id";i=_(a.resources).filter(function(e){return _.includes(a.param,e[t])}).map("name").value().join(", ")}n(i)}catch(e){console.log("QuickFilterManager::setPlaceholder",e),n(null)}})}}}e.$inject=["$q","$translate"],angular.module("app.core").factory("quickFilterManager",e)}(),function(){"use strict";function e(t){var e={getAgentStatus:function(e){var n="unknown";n=o(e)?"pause":o(e,!0)?"*pause":function(e){if("idle"!==e.voiceStatus&&e.voicePause)return!(e.voiceStatus="pause");return _.every([e.chatStatus,e.faxStatus,e.mailStatus,e.openchannelStatus,e.smsStatus,e.voiceStatus,e.whatsappStatus],r)}(e)?"idle":"busy";return n},setAgentStatusDisplayValue:function(e){var n=e.globalStatus;"pause"===e.globalStatus?n=e.pauseType||t.instant("VOICE.DEFAULT_PAUSE"):"*pause"===e.globalStatus&&(n="*"+(e.pauseType||t.instant("VOICE.DEFAULT_PAUSE")));e.globalStatusDisplayValue=n},updateBusyCounter:s,updateQueue:function(e,n,t,a){var i=t.paused;!1===e.online?(t.online=!1,n.loggedInDb-=1,t.paused?(t.paused=!1,n.paused-=1):n.available-=1):t.online?!e[a+"Pause"]||t.paused||o(e,!0)?!e[a+"Pause"]&&t.paused?(t.paused=!1,t.talking||t.busy||(n.paused-=1,n.available+=1)):e[a+"Pause"]&&t.paused&&(t.talking||t.busy||(n.busy-=1,i||(n.paused+=1))):(t.paused=!0,t.talking||t.busy||(i||(n.paused+=1),0<n.available&&(n.available-=1))):(t.online=!0,n.loggedInDb+=1,n.available+=1);s(n)},updateVoiceQueue:function(e,n){e.loggedIn===e.available&&0<e.waiting&&(e.available-=e.waiting);var t=e.loggedIn-e.available-e.talking-e.waiting-n.paused;t<0?(n.paused-=Math.abs(t),n.waitingOrTalking=!0):0<t&&n.waitingOrTalking&&(n.paused+=1,delete n.waitingOrTalking);_.merge(n,_.pick(e,"inbound"===n.type?a:i)),"outbound"===n.type&&_.isNil(e.startPredictive)&&(n.startPredictive=void 0);s(n)}},a=["loggedIn","available","waiting","talking","paused"],i=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused","startPredictive","startProgressive","erlangCalls","erlangCallToSecond","erlangAbandonmentRate","erlangBusyFactor","dialPredictiveInterval","dialPredictiveIntervalMaxThreshold","dialPredictiveIntervalMinThreshold","predictiveIntervalAvailable","predictiveIntervalTotalCalls","predictiveIntervalAnsweredCalls","predictiveIntervalDroppedCallsTimeout","predictiveIntervalDroppedCallsCallersExit","predictiveIntervalAvgHoldtime","predictiveIntervalAvgTalktime"];function s(e){var n=_.filter(e.agents,["busy",!0]).length,t=e.loggedInDb-e.available-e.paused-e.talking-e.waiting;t<0&&(t=0),e.busy=t<n?n:t}function o(e,n){var t=[e.chatPause,e.faxPause,e.mailPause,e.openchannelPause,e.smsPause,e.voicePause,e.whatsappPause];if(!n)return _.every(t);var a=_.filter(t);return 0<a.length&&a.length<t.length}function r(e){if(_.isNil(e))return!0;return _.includes(["idle","unknown","unavailable","ringing"],e)}return e}e.$inject=["$translate"],angular.module("app.core").factory("realtimeManager",e)}(),function(){"use strict";angular.module("app.core").factory("settingsManager",function(){var n={};return{get:function(){return n},set:function(e){e&&(n=e.toJSON())}}})}(),function(){"use strict";function e(c,m){function u(e,n,t){if(_.isEmpty(n))return t;for(var a=0;a<n.length;a++){var i=n[a].key,s=_.find(e,function(e){return e[i]===n[a].value});s&&(_.some(t,["id",s.id])||(s.canSelect=!1,t.push(s)))}return t}return{getResources:function(a,i,s,o,r,l,d){return c(function(t,n){o||(o={}),d||(d="get"),a[s][d](o).$promise.then(function(e){var t=e.rows;if("admin"===i.role)return t;var n=m.getSectionId(s,l);return a.userProfileSection.get({userProfileId:i.userProfileId,sectionId:n}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?t:a.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(t,{id:e.resourceId})});return u(t,r,n)}):c.resolve().then(function(){return e=s,_.includes(["voiceContext"],e)?(o.defaultEntry=1,a[s][d](o).$promise.then(function(e){return e.rows})):[];var e}).then(function(e){return u(t,r,e)})})}).then(function(e){var n={rows:_.orderBy(e,[o.sort]),count:e.length};t(n)}).catch(function(e){n(e)})})}}}e.$inject=["$q","msNavigationService"],angular.module("app.core").factory("userProfileManager",e)}(),function(){"use strict";angular.module("app.core").filter("altDate",function(){return function(e){var n=Date.now()-new Date(e);return n<36e5?moment(e).fromNow():n<864e5?moment(e).format("HH:mm"):n<6048e5?moment(e).format("dddd"):moment(e).calendar()}})}(),function(){"use strict";function e(n){return function(e){return n.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("app.core").filter("toTrusted",e).filter("htmlToPlaintext",function(){return function(e){return String(e).replace(/<[^>]+>/gm,"")}}).filter("nospace",function(){return function(e){return e?e.replace(/ /g,""):""}}).filter("humanizeDoc",function(){return function(e){if(e)return"directive"===e.type?e.name.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):e.label||e.name}})}(),function(){"use strict";angular.module("app.core").filter("capitalize",function(){return function(e){return e?_.capitalize(e):""}})}(),function(){"use strict";angular.module("app.core").filter("filterByIds",function(){return function(e,n){if(0===e.length||!n)return e;if(0===n.length)return[];for(var t=[],a=0;a<e.length;a++){for(var i=e[a],s=!1,o=0;o<n.length;o++){var r=n[o];if(i.id===r){s=!0;break}}s&&t.push(i)}return t}})}(),function(){"use strict";angular.module("app.core").filter("filterByPropIds",function(){return function(e,n,t){if(0===e.length||!t||0===t.length)return e;for(var a=[],i=0;i<e.length;i++){for(var s=e[i],o=!1,r=0;r<t.length;r++){var l=t[r];if(-1<s[n].indexOf(l)){o=!0;break}}o&&a.push(s)}return a}})}(),function(){"use strict";angular.module("app.core").filter("getOptionByValue",function(){return function(n,e,t){if(void 0===n)return"";if(!e)return"";t||(t="option");var a=_.find(e,function(e){return e.value==n});return a?a[t]:""}})}(),function(){"use strict";angular.module("app.core").filter("orderByDate",function(){return function(e){var n=[];return angular.forEach(e,function(e){n.push(e)}),n.sort(function(e,n){return e.hasOwnProperty("openedAt")&&n.hasOwnProperty("openedAt")?e.openedAt>n.openedAt?1:-1:1}),n}})}(),function(){"use strict";angular.module("app.core").filter("secToTime",function(){return function(e){e&&(e=e.toString().replace(",",""));var n=Math.floor(e/86400),t=e%86400,a=new Date(1e3*t).toISOString().substring(11,19);return a.replace(/^(\d+)/,function(e){return(""+(Number(e)+24*n)).padStart(2,"0")})}})}(),function(){"use strict";angular.module("app.core").filter("snakecase",function(){return function(e){return e?_.snakeCase(e):""}})}(),function(){"use strict";angular.module("app.core").filter("startcase",function(){return function(e){return e?_.startCase(e):""}})}(),function(){"use strict";angular.module("app.core").filter("filterByTags",function(){return function(e,t){if(0===e.length||0===t.length)return e;var a=[];return e.forEach(function(e){var n=t.every(function(n){var t=!1;return e.tags.forEach(function(e){e.name!==n.name||(t=!0)}),t});n&&a.push(e)}),a}}).filter("filterSingleByTags",function(){return function(e,n){if(0!==e.length&&0!==n.length){if(e.length<n.length)return[];var t=[],a=n.every(function(n){var t=!1;return e.forEach(function(e){e.name!==n.name||(t=!0)}),t});return a&&t.push(e),t}}})}(),function(){"use strict";angular.module("app.core").filter("toInteger",function(){return function(e){if(e&&"string"==typeof e)return parseInt(e)}})}(),function(){"use strict";function m(e,n,t,a){this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.title=e,this.body=n,this.accept=t,this.reject=a,this.close=i}function u(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function i(){var t=this;navigator.serviceWorker.ready.then(function(e){e.getNotifications().then(function(e){var n=_.find(e,function(e){return e.data.id===t.id});n&&n.close()})})}angular.module("app.dashboards").provider("motNotification",function(){return{$get:[function(){var d,t,c=[];"serviceWorker"in navigator&&u()?navigator.serviceWorker.register("notification.js").then(function(e){(d=e).update(),d.installing?t=d.installing:d.waiting?t=d.waiting:d.active&&(t=d.active)}).catch(function(e){console.error("Service worker registration failed",e)}):console.error("Service Worker is not supported");return navigator.serviceWorker.addEventListener("message",function(e){if(e.source===t){var n=_.find(c,{id:e.data.id});if(n)switch(e.data.action){case"accept":n.accept&&n.accept();break;case"reject":n.reject&&n.reject()}}}),{create:function(e,i,s,o,r,l){return new Promise(function(t,n){var a;u()&&(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)?(a=new m(e||"MyTitle",i||"MyBody",o,r),c.push(a),a?window.Notification.requestPermission().then(function(e){if("granted"===e)return d.showNotification(a.title,{body:a.body,requireInteraction:!0,icon:s||"assets/images/business/queueCampaigns.jpg",data:{id:a.id},actions:[{action:"accept",title:"Accept"},{action:"reject",title:"Reject"}]})}).then(function(e){if(l){for(var n=0;n<c.length;n++)c[n].close();t()}else t(a)}).catch(function(e){n(e)}):n(new Error("Notification creating error"))):t()})}}}]}})}(),function(){"use strict";function e(l,d,c){return{resolve:function(e,n){var t=e.split("@"),a=t[0],i=t[1],s=n||{};if(!a||!i)return d.error("apiResolver.resolve requires correct action parameter (ResourceName@methodName)"),!1;var o=l.defer(),r=function(e){for(var n=e.split("."),t=c,a=0;a<n.length;a++){if(angular.isUndefined(t[n[a]])){d.error('Resource part "'+n[a]+'" is not defined!'),t=!1;break}t=t[n[a]]}return t||!1}(a);r?r[i](s,function(e){o.resolve(e)},function(e){o.reject(e)}):(d.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!'));return o.promise}}}e.$inject=["$q","$log","api"],angular.module("app.core").factory("apiResolver",e)}(),function(){"use strict";function e(e){return{showLoadingIndicator:function(){e.loadingProgress=!0},hideLoadingIndicator:function(){e.loadingProgress=!1}}}e.$inject=["$rootScope"],angular.module("app.core").factory("LoadingIndicatorService",e)}(),function(){"use strict";angular.module("app.core").provider("msApi",function(){var t=angular.injector(["ng"]).get("$log"),a="",v=[];function n(e){a=e}function i(){return a}function s(e,n){angular.isString(e)?angular.isArray(n)?v[e]={url:a+(n[0]||""),paramDefaults:n[1]||[],actions:n[2]||[],options:n[3]||{}}:t.error('"resource" must be an array and it must follow $resource definition'):t.error('"path" must be a string (eg. `dashboard.project`)')}this.setBaseUrl=n,this.getBaseUrl=i,this.getApiObject=function(){return v},this.register=s,this.$get=["$log","$q","$resource","$rootScope",function(m,u,p,g){var e={setBaseUrl:n,getBaseUrl:i,register:s,resolve:function(e,n){g.$broadcast("msApi::resolveStart");var t=e.split("@"),a=t[0],i=t[1],s=n||{};if(!a||!i)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var o=u.defer(),r=v[a];if(r){var l=p(r.url,r.paramDefaults,r.actions,r.options);l[i](s,function(e){o.resolve(e),g.$broadcast("msApi::resolveSuccess")},function(e){o.reject(e),g.$broadcast("msApi::resolveError")})}else m.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!');return o.promise},request:function(e,n,t,a){g.$broadcast("msApi::requestStart");var i=e.split("@"),s=i[0],o=i[1],r=n||{};if(!s||!o)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var l=u.defer(),d=v[s];if(d){var c=p(d.url,d.paramDefaults,d.actions,d.options);c[o](r,function(e){g.$broadcast("msApi::requestSuccess"),l.resolve(e),angular.isDefined(t)&&angular.isFunction(t)&&t(e)},function(e){g.$broadcast("msApi::requestError"),l.reject(e),angular.isDefined(a)&&angular.isFunction(a)&&a(e)})}else m.error('Resource "'+s+'" is not defined in the api service!'),l.reject('Resource "'+s+'" is not defined in the api service!');return l.promise}};return e}]})}(),function(){"use strict";function e(l){var e=new MobileDetect(l.navigator.userAgent),d=null;return{exists:function(e,n){return-1<n.indexOf(e)},detectBrowser:function(){if(d)return d;var e=[{string:l.navigator.userAgent,subString:"Edge",versionSearch:"Edge",identity:"Edge"},{string:l.navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:l.navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:l.navigator.vendor,subString:"Apple",versionSearch:"Version",identity:"Safari"},{prop:l.opera,identity:"Opera"},{string:l.navigator.vendor,subString:"iCab",identity:"iCab"},{string:l.navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:l.navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:l.navigator.vendor,subString:"Camino",identity:"Camino"},{string:l.navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:l.navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:l.navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],n=[{string:l.navigator.platform,subString:"Win",identity:"Windows"},{string:l.navigator.platform,subString:"Mac",identity:"Mac"},{string:l.navigator.platform,subString:"Linux",identity:"Linux"},{string:l.navigator.platform,subString:"iPhone",identity:"iPhone"},{string:l.navigator.platform,subString:"iPod",identity:"iPod"},{string:l.navigator.platform,subString:"iPad",identity:"iPad"},{string:l.navigator.platform,subString:"Android",identity:"Android"}],i="";function t(e){for(var n=0;n<e.length;n++){var t=e[n].string,a=e[n].prop;if(i=e[n].versionSearch||e[n].identity,t){if(-1!==t.indexOf(e[n].subString))return e[n].identity}else if(a)return e[n].identity}}function a(e){var n=e.indexOf(i);if(-1!==n)return parseInt(e.substring(n+i.length+1))}var s=t(e)||"unknown-browser",o=a(l.navigator.userAgent)||a(l.navigator.appVersion)||"unknown-version",r=t(n)||"unknown-os";return s=s.toLowerCase(),o=s+"-"+o,r=r.toLowerCase(),d={browser:s,version:o,os:r}},guidGenerator:function(){var e=function(){return(65536*(1+Math.random())||0).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()},isMobile:function(){return e.mobile()},toggleInArray:function(e,n){-1===n.indexOf(e)?n.push(e):n.splice(n.indexOf(e),1)},firstLastDayMonth:function(){return{$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()}},getEmailProviders:function(){return[{name:"Custom",value:"custom"},{name:"Gmail",value:"gmail"},{name:"Hotmail",value:"hotmail"},{name:"Yahoo",value:"yahoo"},{name:"Outlook365",value:"outlook365"}]}}}e.$inject=["$window"],angular.module("app.core").factory("msUtils",e)}(),function(){"use strict";function e(e,n){var t=this;t.themes=n.themes,t.layoutModes=[{label:"Boxed",value:"boxed"},{label:"Wide",value:"wide"}],t.layoutStyles=[{label:"Vertical Navigation",value:"verticalNavigation",figure:"/assets/images/theme-options/vertical-nav.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar",value:"verticalNavigationFullwidthToolbar",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar 2",value:"verticalNavigationFullwidthToolbar2",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar-2.jpg"},{label:"Horizontal Navigation",value:"horizontalNavigation",figure:"/assets/images/theme-options/horizontal-nav.jpg"},{label:"Content with Toolbar",value:"contentWithToolbar",figure:"/assets/images/theme-options/content-with-toolbar.jpg"},{label:"Content Only",value:"contentOnly",figure:"/assets/images/theme-options/content-only.jpg"}],t.layoutMode="wide",t.layoutStyle=e.get("motion.layoutStyle")||"verticalNavigation",t.setActiveTheme=function(e){n.setActiveTheme(e)},t.getActiveTheme=function(){return n.themes.active},t.updateLayoutMode=function(){angular.element("body").toggleClass("boxed","boxed"===t.layoutMode)},t.updateLayoutStyle=function(){e.put("motion.layoutStyle",t.layoutStyle),location.reload()}}function n(n){return{restrict:"E",scope:{},controller:"MsThemeOptionsController as vm",templateUrl:"app/core/theme-options/theme-options.html",compile:function(e){return e.addClass("ms-theme-options"),function(e){e.toggleOptionsSidenav=function(){n("motion-theme-options").toggle()}}}}}e.$inject=["$cookies","motionTheming"],n.$inject=["$mdSidenav"],angular.module("app.core").controller("MsThemeOptionsController",e).directive("msThemeOptions",n)}(),function(){"use strict";function e(i,a,s){var o={};return{generate:function(){var e=angular.copy(s.getRegisteredThemes()),a=angular.copy(s.getRegisteredPalettes());angular.forEach(e,function(t){o[t.name]={},angular.forEach(t.colors,function(e,n){o[t.name][n]={name:e.name,levels:{default:{color:l(a[e.name][e.hues.default].value),contrast1:l(a[e.name][e.hues.default].contrast,1),contrast2:l(a[e.name][e.hues.default].contrast,2),contrast3:l(a[e.name][e.hues.default].contrast,3),contrast4:l(a[e.name][e.hues.default].contrast,4)},hue1:{color:l(a[e.name][e.hues["hue-1"]].value),contrast1:l(a[e.name][e.hues["hue-1"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-1"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-1"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-1"]].contrast,4)},hue2:{color:l(a[e.name][e.hues["hue-2"]].value),contrast1:l(a[e.name][e.hues["hue-2"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-2"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-2"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-2"]].contrast,4)},hue3:{color:l(a[e.name][e.hues["hue-3"]].value),contrast1:l(a[e.name][e.hues["hue-3"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-3"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-3"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-3"]].contrast,4)}}}})}),function(e){var n=angular.copy(e);angular.forEach(n,function(t){angular.forEach(t,function(e,n){t[n]=e.levels,t[n].color=e.levels.default.color,t[n].contrast1=e.levels.default.contrast1,t[n].contrast2=e.levels.default.contrast2,t[n].contrast3=e.levels.default.contrast3,t[n].contrast4=e.levels.default.contrast4,delete t[n].default})}),s.setThemesList(n);var t=i.get("motion.selectedTheme");t?s.setActiveTheme(t):s.setActiveTheme("default")}(o);var r={};angular.forEach(o,function(e,n){var t,a,i,s,o;(r={})["@themeName"]=n,angular.forEach(e,function(e,a){angular.forEach(e.levels,function(e,t){angular.forEach(e,function(e,n){r["@"+a+d(t)+d(n)]=e})})}),t=r,a=new RegExp(Object.keys(t).join("|"),"gi"),i='/* Content hack because they wont fix */\n/* https://github.com/angular/material/pull/8067 */\n[md-theme="@themeName"] md-content.md-hue-1,\nmd-content.md-@themeName-theme.md-hue-1 {\n    color: @backgroundHue1Contrast1;\n    background-color: @backgroundHue1Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-2,\nmd-content.md-@themeName-theme.md-hue-2 {\n    color: @backgroundHue2Contrast1;\n    background-color: @backgroundHue2Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-3,\n md-content.md-@themeName-theme.md-hue-3 {\n    color: @backgroundHue3Contrast1;\n    background-color: @backgroundHue3Color;\n}\n\n/* Text Colors */\n[md-theme="@themeName"] a {\n    color: @accentDefaultColor;\n}\n\n[md-theme="@themeName"] .secondary-text,\n[md-theme="@themeName"] .icon {\n    color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .hint-text,\n[md-theme="@themeName"] .disabled-text {\n    color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .fade-text,\n[md-theme="@themeName"] .divider {\n    color: @backgroundDefaultContrast4;\n}\n\n/* Primary */\n[md-theme="@themeName"] .md-primary-bg {\n    background-color: @primaryDefaultColor;\n    color: @primaryDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg .secondary-text,\n[md-theme="@themeName"] .md-primary-bg .icon {\n    color: @primaryDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg .hint-text,\n[md-theme="@themeName"] .md-primary-bg .disabled-text {\n    color: @primaryDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg .fade-text,\n[md-theme="@themeName"] .md-primary-bg .divider {\n    color: @primaryDefaultContrast4;\n}\n\n/* Primary, Hue-1 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 {\n    background-color: @primaryHue1Color;\n    color: @primaryHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .icon {\n    color: @primaryHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .disabled-text {\n    color: @primaryHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .divider {\n    color: @primaryHue1Contrast4;\n}\n\n/* Primary, Hue-2 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 {\n    background-color: @primaryHue2Color;\n    color: @primaryHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .icon {\n    color: @primaryHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .disabled-text {\n    color: @primaryHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .divider {\n    color: @primaryHue2Contrast4;\n}\n\n/* Primary, Hue-3 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 {\n    background-color: @primaryHue3Color;\n    color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .icon {\n    color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .disabled-text {\n    color: @primaryHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .divider {\n    color: @primaryHue3Contrast4;\n}\n\n/* Primary foreground */\n[md-theme="@themeName"] .md-primary-fg {\n    color: @primaryDefaultColor !important;\n}\n\n/* Primary foreground, Hue-1 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-1 {\n    color: @primaryHue1Color !important;\n}\n\n/* Primary foreground, Hue-2 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-2 {\n    color: @primaryHue2Color !important;\n}\n\n/* Primary foreground, Hue-3 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-3 {\n    color: @primaryHue3Color !important;\n}\n\n/* Accent */\n[md-theme="@themeName"] .md-accent-bg {\n    background-color: @accentDefaultColor;\n    color: @accentDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg .secondary-text,\n[md-theme="@themeName"] .md-accent-bg .icon {\n    color: @accentDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg .hint-text,\n[md-theme="@themeName"] .md-accent-bg .disabled-text {\n    color: @accentDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg .fade-text,\n[md-theme="@themeName"] .md-accent-bg .divider {\n    color: @accentDefaultContrast4;\n}\n\n/* Accent, Hue-1 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 {\n    background-color: @accentHue1Color;\n    color: @accentHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .icon {\n    color: @accentHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .disabled-text {\n    color: @accentHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .divider {\n    color: @accentHue1Contrast4;\n}\n\n/* Accent, Hue-2 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 {\n    background-color: @accentHue2Color;\n    color: @accentHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .icon {\n    color: @accentHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .disabled-text {\n    color: @accentHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .divider {\n    color: @accentHue2Contrast4;\n}\n\n/* Accent, Hue-3 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 {\n    background-color: @accentHue3Color;\n    color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .icon {\n    color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .disabled-text {\n    color: @accentHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .divider {\n    color: @accentHue3Contrast4;\n}\n\n/* Accent foreground */\n[md-theme="@themeName"] .md-accent-fg {\n    color: @accentDefaultColor !important;\n}\n\n/* Accent foreground, Hue-1 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-1 {\n    color: @accentHue1Color !important;\n}\n\n/* Accent foreground, Hue-2 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-2 {\n    color: @accentHue2Color !important;\n}\n\n/* Accent foreground, Hue-3 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-3 {\n    color: @accentHue3Color !important;\n}\n\n/* Warn */\n[md-theme="@themeName"] .md-warn-bg {\n    background-color: @warnDefaultColor;\n    color: @warnDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg .secondary-text,\n[md-theme="@themeName"] .md-warn-bg .icon {\n    color: @warnDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg .hint-text,\n[md-theme="@themeName"] .md-warn-bg .disabled-text {\n    color: @warnDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg .fade-text,\n[md-theme="@themeName"] .md-warn-bg .divider {\n    color: @warnDefaultContrast4;\n}\n\n/* Warn, Hue-1 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 {\n    background-color: @warnHue1Color;\n    color: @warnHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .icon {\n    color: @warnHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .disabled-text {\n    color: @warnHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .divider {\n    color: @warnHue1Contrast4;\n}\n\n/* Warn, Hue-2 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 {\n    background-color: @warnHue2Color;\n    color: @warnHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .icon {\n    color: @warnHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .disabled-text {\n    color: @warnHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .divider {\n    color: @warnHue2Contrast4;\n}\n\n/* Warn, Hue-3 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 {\n    background-color: @warnHue3Color;\n    color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .icon {\n    color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .disabled-text {\n    color: @warnHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .divider {\n    color: @warnHue3Contrast4;\n}\n\n/* Warn foreground */\n[md-theme="@themeName"] .md-warn-fg {\n    color: @warnDefaultColor !important;\n}\n\n/* Warn foreground, Hue-1 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-1 {\n    color: @warnHue1Color !important;\n}\n\n/* Warn foreground, Hue-2 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-2 {\n    color: @warnHue2Color !important;\n}\n\n/* Warn foreground, Hue-3 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-3 {\n    color: @warnHue3Color !important;\n}\n\n/* Background */\n[md-theme="@themeName"] .md-background-bg {\n    background-color: @backgroundDefaultColor;\n    color: @backgroundDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg .secondary-text,\n[md-theme="@themeName"] .md-background-bg .icon {\n    color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg .hint-text,\n[md-theme="@themeName"] .md-background-bg .disabled-text {\n    color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg .fade-text,\n[md-theme="@themeName"] .md-background-bg .divider {\n    color: @backgroundDefaultContrast4;\n}\n\n/* Background, Hue-1 */\n[md-theme="@themeName"] .md-background-bg.md-hue-1 {\n    background-color: @backgroundHue1Color;\n    color: @backgroundHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .icon {\n    color: @backgroundHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .disabled-text {\n    color: @backgroundHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .divider {\n    color: @backgroundHue1Contrast4;\n}\n\n/* Background, Hue-2 */\n[md-theme="@themeName"] .md-background-bg.md-hue-2 {\n    background-color: @backgroundHue2Color;\n    color: @backgroundHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .icon {\n    color: @backgroundHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .disabled-text {\n    color: @backgroundHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .divider {\n    color: @backgroundHue2Contrast4;\n}\n\n/* Background, Hue-3 */\n[md-theme="@themeName"] .md-background-bg.md-hue-3 {\n    background-color: @backgroundHue3Color;\n    color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .icon {\n    color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .disabled-text {\n    color: @backgroundHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .divider {\n    color: @backgroundHue3Contrast4;\n}\n\n/* Background foreground */\n[md-theme="@themeName"] .md-background-fg {\n    color: @backgroundDefaultColor !important;\n}\n\n/* Background foreground, Hue-1 */\n[md-theme="@themeName"] .md-background-fg.md-hue-1 {\n    color: @backgroundHue1Color !important;\n}\n\n/* Background foreground, Hue-2 */\n[md-theme="@themeName"] .md-background-fg.md-hue-2 {\n    color: @backgroundHue2Color !important;\n}\n\n/* Background foreground, Hue-3 */\n[md-theme="@themeName"] .md-background-fg.md-hue-3 {\n    color: @backgroundHue3Color !important;\n}'.replace(a,function(e){return t[e]}),s=angular.element("head"),(o=angular.element('<style type="text/css"></style>')).html(i),s.append(o)})},rgba:l};function l(e,n){var t=n||!1;return 4===e.length&&255===e[0]&&255===e[1]&&255===e[2]&&e.splice(3,4),t&&(e=function(e,n){var t={white:{1:"1",2:"0.7",3:"0.3",4:"0.12"},black:{1:"0.87",2:"0.54",3:"0.26",4:"0.12"}};255===e[0]&&255===e[1]&&255===e[2]?e[3]=t.white[n]:0===e[0]&&0===e[1]&&0===e[2]&&(e[3]=t.black[n]);return e}(e,t)),3===e.length?"rgb("+e.join(",")+")":4===e.length?"rgba("+e.join(",")+")":void a.error("Invalid number of arguments supplied in the color array: "+e.length+"\nThe array must have 3 or 4 colors.")}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}}e.$inject=["$cookies","$log","motionTheming"],angular.module("app.core").factory("motionGenerator",e)}(),function(){"use strict";angular.module("app.core").constant("motionPalettes",[{name:"motion-blue",options:{50:"#ebf1fa",100:"#c2d4ef",200:"#9ab8e5",300:"#78a0dc",400:"#5688d3",500:"#3470ca",600:"#2e62b1",700:"#275498",800:"#21467e",900:"#1a3865",A100:"#c2d4ef",A200:"#9ab8e5",A400:"#5688d3",A700:"#275498",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}},{name:"motion-paleblue",options:{50:"#ececee",100:"#c5c6cb",200:"#9ea1a9",300:"#7d818c",400:"#5c616f",500:"#3c4252",600:"#353a48",700:"#2d323e",800:"#262933",900:"#1e2129",A100:"#c5c6cb",A200:"#9ea1a9",A400:"#5c616f",A700:"#2d323e",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}}])}(),function(){"use strict";angular.module("app.core").constant("motionThemes",{default:{primary:{name:"motion-paleblue",hues:{default:"700","hue-1":"500","hue-2":"600","hue-3":"400"}},accent:{name:"light-blue",hues:{default:"600","hue-1":"400","hue-2":"700","hue-3":"A100"}},warn:{name:"red"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},pinkTheme:{primary:{name:"blue-grey",hues:{default:"800","hue-1":"600","hue-2":"400","hue-3":"A100"}},accent:{name:"pink",hues:{default:"400","hue-1":"300","hue-2":"600","hue-3":"A100"}},warn:{name:"blue"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},tealTheme:{primary:{name:"motion-blue",hues:{default:"900","hue-1":"600","hue-2":"500","hue-3":"A100"}},accent:{name:"teal",hues:{default:"500","hue-1":"400","hue-2":"600","hue-3":"A100"}},warn:{name:"deep-orange"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}}})}(),function(){"use strict";function e(t,e,n){var a;angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.getObject("motion.customTheme");i&&(n.custom=i),t.alwaysWatchTheme(!0),angular.forEach(e,function(e){t.definePalette(e.name,e.options)}),angular.forEach(n,function(e,n){t.theme(n).primaryPalette(e.primary.name,e.primary.hues).accentPalette(e.accent.name,e.accent.hues).warnPalette(e.warn.name,e.warn.hues).backgroundPalette(e.background.name,e.background.hues)})}e.$inject=["$mdThemingProvider","motionPalettes","motionThemes"],angular.module("app.core").config(e)}(),function(){"use strict";function e(n,t,e){var a={getRegisteredPalettes:function(){return e.PALETTES},getRegisteredThemes:function(){return e.THEMES},setActiveTheme:function(e){if(angular.isUndefined(a.themes.list[e]))return angular.isUndefined(a.themes.list.default)?void t.error('You must have at least one theme named "default"'):(t.warn('The theme "'+e+'" does not exist! Falling back to the "default" theme.'),a.themes.active.name="default",a.themes.active.theme=a.themes.list.default,void n.put("motion.selectedTheme",a.themes.active.name));a.themes.active.name=e,a.themes.active.theme=a.themes.list[e],n.put("motion.selectedTheme",e)},setThemesList:function(e){a.themes.list=e},themes:{list:{},active:{name:"",theme:{}}}};return a}e.$inject=["$cookies","$log","$mdTheming"],angular.module("app.core").service("motionTheming",e)}(),function(){"use strict";function e(n,s,o,r){this.search=function(n){for(var e=[],t=r.getFlatNavigation(),a=o.defer(),i=0;i<t.length;i+=1)t[i].uisref&&e.push(t[i]);n&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(n)))return!0}));return s(function(){a.resolve(e)},1e3),a.promise},this.searchResultClick=function(e){e.uisref&&(e.stateParams?n.go(e.state,e.stateParams):n.go(e.state))}}e.$inject=["$state","$timeout","$q","msNavigationService"],angular.module("app.errors.error-404").controller("Error404Controller",e)}(),function(){"use strict";function e(e,n){var t=this;t.code="",t.send=!1,t.error=e.params,t.sendReport=function(){n.post("/api/jira",t.error).then(function(e){t.send=!0,e.data&&(t.code=e.data.id)},function(e){t.send=!1})}}e.$inject=["$state","$http"],angular.module("app.errors.error-500").controller("Error500Controller",e)}(),function(){"use strict";function e(e,n,t){var a=this;a.currentUser=e.getCurrentUser(),a.cookieAlertHide=n.get("motion.cookieAlertHide:"+a.currentUser.id)||!1,a.cookieAlertOnClose=function(){n.put("motion.cookieAlertHide:"+a.currentUser.id,!0)},a.onInit=function(){t.setting.get({id:1}).$promise.then(function(e){e&&(a.cookieAlertHide=!e.disabledCookie)})},a.onInit()}e.$inject=["Auth","$cookies","api"],angular.module("app.footer").controller("FooterController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.form={},s.forgotPassword=function(){return i.auth.forgot(s.form).$promise.then(function(){n.success({title:t.instant("FORGOTPASSWORD.LINK_SENT"),msg:t.instant("FORGOTPASSWORD.LINNK_SENT_MESSAGE")})}).catch(function(e){e&&n.error({title:t.instant("FORGOTPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},s.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general")}}e.$inject=["Auth","toasty","$translate","$state","api"],angular.module("app.forgot").controller("ForgotPasswordController",e)}(),function(){"use strict";function e(e,n){var t=this;t.currentUser=e.getCurrentUser(),t.newsAlertHide=n.get("motion.newsAlertHide:"+t.currentUser.id)||!1,t.newsAlertOnClose=function(){n.put("motion.newsAlertHide:"+t.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.header").controller("HeaderController",e)}(),function(){"use strict";function e(e,o){var r={getResourcesByRole:function(e,n,t,a,i,s){return o.getResources(r,e,n,t,a,i,s)}};return r.baseUrl="api/",r.auth=e(r.baseUrl+"auth/local",{},{local:{method:"post",url:r.baseUrl+"auth/local"},forgot:{method:"post",url:r.baseUrl+"auth/local/forgot"},reset:{method:"post",url:r.baseUrl+"auth/local/reset/:token",params:{token:"@token"}},user:{method:"get",url:r.baseUrl+"auth/local/user/:token",params:{token:"@token"}},google:{method:"post",url:r.baseUrl+"auth/google"},activedirectory:{method:"post",url:r.baseUrl+"auth/activedirectory"}}),r.jira=e(r.baseUrl+"jira"),r.rpc=e(r.baseUrl+"rpc",{},{startMonitor:{method:"get",url:r.baseUrl+"rpc/voice/channels/:uniqueid/mixmonitor",params:{uniqueid:"@uniqueid"}},stopMonitor:{method:"get",url:r.baseUrl+"rpc/voice/channels/:uniqueid/stopmixmonitor",params:{uniqueid:"@uniqueid"}},getVoiceChannels:{method:"get",url:r.baseUrl+"rpc/voice/channels"},getVoiceQueues:{method:"get",url:r.baseUrl+"rpc/voice/queues"},getChatQueues:{method:"get",url:r.baseUrl+"rpc/chat/queues"},getMailQueues:{method:"get",url:r.baseUrl+"rpc/mail/queues"},getSmsQueues:{method:"get",url:r.baseUrl+"rpc/sms/queues"},getWhatsappQueues:{method:"get",url:r.baseUrl+"rpc/whatsapp/queues"},getOpenchannelQueues:{method:"get",url:r.baseUrl+"rpc/openchannel/queues"},getFaxQueues:{method:"get",url:r.baseUrl+"rpc/fax/queues"},getVoiceQueuesPreview:{method:"get",url:r.baseUrl+"rpc/voice/queues/preview/:id"},getVoiceQueuesChannels:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels"},getVoiceQueuesChannel:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid"},getVoiceQueuesChannelHangup:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid/hangup"},getVoiceQueuesChannelRedirect:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid/redirect/:exten"},getOutbound:{method:"get",url:r.baseUrl+"rpc/outbound"},getOutboundChannels:{method:"get",url:r.baseUrl+"rpc/outbound/channels"},getAgents:{method:"get",url:r.baseUrl+"rpc/agents"},setAgentCapacity:{method:"put",url:r.baseUrl+"rpc/agents/:id/capacity",params:{id:"@id"}},getTelephones:{method:"get",url:r.baseUrl+"rpc/telephones"},getTrunks:{method:"get",url:r.baseUrl+"rpc/trunks"},getCampaigns:{method:"get",url:r.baseUrl+"rpc/campaigns"},getMailAccounts:{method:"get",url:r.baseUrl+"rpc/mail/accounts"},getFaxAccounts:{method:"get",url:r.baseUrl+"rpc/fax/accounts"},getChatQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/chat/queues/waitinginteractions"},getMailQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/mail/queues/waitinginteractions"},getOpenchannelQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/openchannel/queues/waitinginteractions"},getOpenchannelQueuesIdWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/openchannel/queues/:id/waitinginteractions"},getSmsQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/sms/queues/waitinginteractions"},getFaxQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/fax/queues/waitinginteractions"},getWhatsappQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/whatsapp/queues/waitinginteractions"},mailQueueNotify:{method:"post",url:r.baseUrl+"rpc/mail/queues/:id/notify",params:{id:"@id"}},chatQueueNotify:{method:"post",url:r.baseUrl+"rpc/chat/queues/:id/notify",params:{id:"@id"}},faxQueueNotify:{method:"post",url:r.baseUrl+"rpc/fax/queues/:id/notify",params:{id:"@id"}},smsQueueNotify:{method:"post",url:r.baseUrl+"rpc/sms/queues/:id/notify",params:{id:"@id"}},openchannelQueueNotify:{method:"post",url:r.baseUrl+"rpc/openchannel/queues/:id/notify",params:{id:"@id"}},agentNotify:{method:"post",url:r.baseUrl+"rpc/agents/:id/notify",params:{id:"@id"}}}),r.version=e(r.baseUrl+"version",{},{fetch:{method:"get",url:r.baseUrl+"version/fetch"},reset:{method:"get",url:r.baseUrl+"version/reset"},pull:{method:"get",url:r.baseUrl+"version/pull"},restart:{method:"get",url:r.baseUrl+"version/restart"},migrations:{method:"get",url:r.baseUrl+"version/migrations"}}),r.system=e(r.baseUrl+"system",{},{killProcess:{method:"get",url:r.baseUrl+"system/process/:pid/kill",params:{pid:"@pid"}}}),r.pm2=e(r.baseUrl+"pm2/:id",{id:"@id"},{update:{method:"put",isArray:!0}}),r.user=e(r.baseUrl+"users/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"users/describe"},clone:{method:"post",url:r.baseUrl+"users/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/contacts"},bulkCreate:{isArray:!1,method:"post",url:r.baseUrl+"users/create_many"},changePassword:{isArray:!1,method:"put",url:r.baseUrl+"users/:id/password"},addQueues:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/queues"},addAvatar:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/avatar"},getAvatar:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/avatar"},getOpenTabs:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/open_tabs"},getContacts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/contacts"},getQueues:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/queues"},getVoiceQueuesRt:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/queues_rt"},getGroups:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/groups"},getRecordings:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/recordings"},getScreenRecordings:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/screen_recordings"},getChatInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/chat/interactions"},getOpenchannelInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/openchannel/interactions"},getMailInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/mail/interactions"},getSmsInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/sms/interactions"},getFaxInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/fax/interactions"},getWhatsappInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/whatsapp/interactions"},login:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/login"},logout:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/logout"},pause:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/pause"},unpause:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/unpause"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/teams"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/lists"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/agents"},addChatInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/chat_interactions"},removeChatInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/chat_interactions"},addMailInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/mail_interactions"},removeMailInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/mail_interactions"},addFaxInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/fax_interactions"},removeFaxInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/fax_interactions"},addSmsInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/sms_interactions"},removeSmsInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/sms_interactions"},addOpenchannelInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/openchannel_interactions"},removeOpenchannelInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/openchannel_interactions"},addWhatsappInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/whatsapp_interactions"},removeWhatsappInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/whatsapp_interactions"},getVoicePrefixes:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/prefixes"},getFaxAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/fax_accounts"},addFaxAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/fax_accounts"},removeFaxAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/fax_accounts"},getMailAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/mail_accounts"},addMailAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/mail_accounts"},removeMailAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/mail_accounts"},getOpenchannelAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/openchannel_accounts"},addOpenchannelAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/openchannel_accounts"},removeOpenchannelAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/openchannel_accounts"},getSmsAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/sms_accounts"},addSmsAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/sms_accounts"},removeSmsAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/sms_accounts"},getChatWebsites:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/chat_websites"},addChatWebsites:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/chat_websites"},removeChatWebsites:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/chat_websites"},getWhatsappAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/whatsapp_accounts"},addWhatsappAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/whatsapp_accounts"},removeWhatsappAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/whatsapp_accounts"},getSquareProjects:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/square_projects"},addSquareProjects:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/square_projects"},removeSquareProjects:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/square_projects"},getScheduledCalls:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/scheduled_calls"},getApiKey:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/api_key"},createApiKey:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/api_key"},removeApiKey:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/api_key"},whoami:{isArray:!1,method:"get",url:r.baseUrl+"users/whoami"},getPresence:{isArray:!1,method:"get",url:r.baseUrl+"users/presence"}}),r.voiceChanSpy=e(r.baseUrl+"voice/chanspy/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/chanspy/describe"},clone:{method:"post",url:r.baseUrl+"voice/chanspy/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceContext=e(r.baseUrl+"voice/contexts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/contexts/describe"},clone:{method:"post",url:r.baseUrl+"voice/contexts/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceExtension=e(r.baseUrl+"voice/extensions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/extensions/describe"},clone:{method:"post",url:r.baseUrl+"voice/extensions/:id/clone",params:{includeAll:"@includeAll"}},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"voice/extensions/:id/applications"}}),r.voiceMusicOnHold=e(r.baseUrl+"voice/mohs/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mohs/describe"},clone:{method:"post",url:r.baseUrl+"voice/mohs/:id/clone",params:{includeAll:"@includeAll"}},addSound:{isArray:!1,method:"post",url:r.baseUrl+"voice/mohs/:id/sounds"},removeSound:{isArray:!1,method:"delete",url:r.baseUrl+"voice/mohs/:id/sounds/:id2"},getSounds:{isArray:!1,method:"get",url:r.baseUrl+"voice/mohs/:id/sounds"}}),r.voiceQueue=e(r.baseUrl+"voice/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/queues/describe"},clone:{method:"post",url:r.baseUrl+"voice/queues/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_black"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"voice/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"voice/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/users"},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/members"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/lists"},addLists:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/lists"},removeLists:{isArray:!0,method:"delete",url:r.baseUrl+"voice/queues/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:r.baseUrl+"voice/queues/:id/blacklists"}}),r.voiceRecording=e(r.baseUrl+"voice/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/recordings/describe"},clone:{method:"post",url:r.baseUrl+"voice/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},downloads:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/downloads"},runTranscribe:{isArray:!1,method:"post",url:r.baseUrl+"voice/recordings/:id/transcribe"},downloadTranscribe:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/transcribe",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.screenRecording=e(r.baseUrl+"screen/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"screen/recordings/describe"},clone:{method:"post",url:r.baseUrl+"screen/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"screen/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.voiceMail=e(r.baseUrl+"voice/mails/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mails/describe"},clone:{method:"post",url:r.baseUrl+"voice/mails/:id/clone",params:{includeAll:"@includeAll"}},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"voice/mails/:id/messages"}}),r.voiceMailMessage=e(r.baseUrl+"voice/mails/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mails/messages/describe"},clone:{method:"post",url:r.baseUrl+"voice/mails/messages/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"voice/mails/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.voiceCallReport=e(r.baseUrl+"voice/calls/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/calls/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/calls/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceDialReport=e(r.baseUrl+"voice/dials/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/dials/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/dials/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceAgentReport=e(r.baseUrl+"voice/agents/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/agents/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/agents/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceQueueReport=e(r.baseUrl+"voice/queues/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/queues/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/queues/reports/:id/clone",params:{includeAll:"@includeAll"}},getVoiceQueuesReport:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/reports/index"}}),r.memberReport=e(r.baseUrl+"members/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"members/reports/describe"},clone:{method:"post",url:r.baseUrl+"members/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.trunk=e(r.baseUrl+"trunks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"trunks/describe"},clone:{method:"post",url:r.baseUrl+"trunks/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceTransferReport=e(r.baseUrl+"voice/transfers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/transfers/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/transfers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailServerOut=e(r.baseUrl+"mail/out_servers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/out_servers/describe"},clone:{method:"post",url:r.baseUrl+"mail/out_servers/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailAccount=e(r.baseUrl+"mail/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/accounts/describe"},clone:{method:"post",url:r.baseUrl+"mail/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/canned_answers"},getImap:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/in_servers"},addImap:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/in_servers"},removeImap:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/in_servers"},getSmtp:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/out_servers"},addSmtp:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/out_servers"},removeSmtp:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/out_servers"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/applications"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/messages"},send:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/send"},verifySmtp:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/verify"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"mail/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/users"}}),r.mailQueue=e(r.baseUrl+"mail/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/queues/describe"},clone:{method:"post",url:r.baseUrl+"mail/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"mail/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"mail/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"mail/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"mail/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/users"}}),r.mailSubstatus=e(r.baseUrl+"mail/substatuses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/substatuses/describe"},clone:{method:"post",url:r.baseUrl+"mail/substatuses/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailInteraction=e(r.baseUrl+"mail/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/interactions/describe"},clone:{method:"post",url:r.baseUrl+"mail/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"mail/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"mail/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"mail/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"mail/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"mail/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.mailMessage=e(r.baseUrl+"mail/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/messages/describe"},clone:{method:"post",url:r.baseUrl+"mail/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"mail/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"mail/messages/:id/reject"},download:{isArray:!1,method:"get",url:r.baseUrl+"mail/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.mailApplication=e(r.baseUrl+"mail/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/applications/describe"},clone:{method:"post",url:r.baseUrl+"mail/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailQueueReport=e(r.baseUrl+"mail/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"mail/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.dashboard=e(r.baseUrl+"dashboards/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dashboards/describe"},clone:{method:"post",url:r.baseUrl+"dashboards/:id/clone",params:{includeAll:"@includeAll"}},addItem:{isArray:!1,method:"post",url:r.baseUrl+"dashboards/:id/items"},getItems:{isArray:!1,method:"get",url:r.baseUrl+"dashboards/:id/items"}}),r.dashboardItem=e(r.baseUrl+"dashboards/items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dashboards/items/describe"},clone:{method:"post",url:r.baseUrl+"dashboards/items/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxAccount=e(r.baseUrl+"fax/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/accounts/describe"},clone:{method:"post",url:r.baseUrl+"fax/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/canned_answers"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/applications"},addAccountApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/addaccountapplications"},updateAccountApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/updateaccountapplications"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/messages"},send:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/send"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"fax/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/users"}}),r.faxApplication=e(r.baseUrl+"fax/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/applications/describe"},clone:{method:"post",url:r.baseUrl+"fax/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxInteraction=e(r.baseUrl+"fax/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/interactions/describe"},clone:{method:"post",url:r.baseUrl+"fax/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"fax/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"fax/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"fax/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"fax/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"fax/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.faxMessage=e(r.baseUrl+"fax/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/messages/describe"},clone:{method:"post",url:r.baseUrl+"fax/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"fax/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"fax/messages/:id/reject"},download:{isArray:!1,method:"get",url:r.baseUrl+"fax/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.faxQueue=e(r.baseUrl+"fax/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/queues/describe"},clone:{method:"post",url:r.baseUrl+"fax/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"fax/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"fax/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"fax/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"fax/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/users"}}),r.faxQueueReport=e(r.baseUrl+"fax/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"fax/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsAccount=e(r.baseUrl+"sms/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/accounts/describe"},clone:{method:"post",url:r.baseUrl+"sms/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/interactions"},send:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/send"},status:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/status"},statusGet:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/status"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"sms/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/users"}}),r.smsApplication=e(r.baseUrl+"sms/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/applications/describe"},clone:{method:"post",url:r.baseUrl+"sms/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsInteraction=e(r.baseUrl+"sms/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/interactions/describe"},clone:{method:"post",url:r.baseUrl+"sms/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"sms/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"sms/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"sms/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"sms/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"sms/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.smsMessage=e(r.baseUrl+"sms/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/messages/describe"},clone:{method:"post",url:r.baseUrl+"sms/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"sms/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"sms/messages/:id/reject"},status:{isArray:!1,method:"post",url:r.baseUrl+"sms/messages/:id/status"}}),r.smsQueue=e(r.baseUrl+"sms/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/queues/describe"},clone:{method:"post",url:r.baseUrl+"sms/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"sms/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"sms/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"sms/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"sms/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/users"}}),r.openchannelAccount=e(r.baseUrl+"openchannel/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/accounts/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/interactions"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/users"},send:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/send"}}),r.openchannelApplication=e(r.baseUrl+"openchannel/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/applications/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.openchannelInteraction=e(r.baseUrl+"openchannel/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/interactions/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.openchannelMessage=e(r.baseUrl+"openchannel/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/messages/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"openchannel/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"openchannel/messages/:id/reject"}}),r.openchannelQueue=e(r.baseUrl+"openchannel/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/queues/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/users"}}),r.chatWebsite=e(r.baseUrl+"chat/websites/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/websites/describe"},clone:{method:"post",url:r.baseUrl+"chat/websites/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/canned_answers"},addLogo:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/logo"},addAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/avatar"},addCustomerAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/customer_avatar"},addSystemAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/system_avatar"},getLogo:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/logo"},getAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/avatar"},getCustomerAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/customer_avatar"},getSystemAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/system_avatar"},notify:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/notify"},offline:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/offline"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/interactions"},getSnippet:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/snippet"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/applications"},addProactiveActions:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/proactive_actions"},getProactiveActions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/proactive_actions"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/fields"},getOfflineMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/offline_messages"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"chat/websites/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/users"}}),r.openchannelQueueReport=e(r.baseUrl+"openchannel/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatApplication=e(r.baseUrl+"chat/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/applications/describe"},clone:{method:"post",url:r.baseUrl+"chat/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatInteraction=e(r.baseUrl+"chat/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/interactions/describe"},clone:{method:"post",url:r.baseUrl+"chat/interactions/:id/clone",params:{includeAll:"@includeAll"}},createVidaooSession:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/vidaoo"},customUpdate:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/custom_update"},abandon:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/abandon"},attachmentUpload:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/attachment_upload"},attachmentDownload:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/attachment_download"},close:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/close"},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/messages"},getMyMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/my_messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"chat/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.chatMessage=e(r.baseUrl+"chat/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"chat/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"chat/messages/:id/reject"}}),r.chatOfflineMessage=e(r.baseUrl+"chat/offline_messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/offline_messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/offline_messages/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatQueue=e(r.baseUrl+"chat/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/queues/describe"},clone:{method:"post",url:r.baseUrl+"chat/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"chat/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"chat/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"chat/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"chat/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/users"}}),r.chatGroup=e(r.baseUrl+"chat/groups/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/groups/describe"},clone:{method:"post",url:r.baseUrl+"chat/groups/:id/clone",params:{includeAll:"@includeAll"}},getUnread:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/unread"},addMembers:{isArray:!0,method:"post",url:r.baseUrl+"chat/groups/:id/members"},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/members"},removeMembers:{isArray:!1,method:"delete",url:r.baseUrl+"chat/groups/:id/members"},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"chat/groups/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/messages"}}),r.chatProactiveAction=e(r.baseUrl+"chat/proactive_actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/proactive_actions/describe"},clone:{method:"post",url:r.baseUrl+"chat/proactive_actions/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmCompany=e(r.baseUrl+"cm/companies/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/companies/describe"},clone:{method:"post",url:r.baseUrl+"cm/companies/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!1,method:"post",url:r.baseUrl+"cm/companies/:id/contacts"},getContacts:{isArray:!1,method:"get",url:r.baseUrl+"cm/companies/:id/contacts"}}),r.cmContact=e(r.baseUrl+"cm/contacts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/contacts/describe"},clone:{method:"post",url:r.baseUrl+"cm/contacts/:id/clone",params:{includeAll:"@includeAll"}},merge:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/merge"},bulkCreate:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/create_many"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/tags"},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hopper_finals"},getJscriptySessions:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/jscripty_sessions"},uploadCsv:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/csv"},upload:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/upload"},import:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/upload/:id"},getJourney:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/journey"}}),r.cmHopper=e(r.baseUrl+"cm/hopper/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper/:id/clone",params:{includeAll:"@includeAll"}},getPreview:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/preview"},getPreviewRecall:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/previewrecall"},getOpenContacts:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/opencontacts"},getTimezones:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/timezones"},getTimezone:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/timezone"}}),r.cmHopperBlack=e(r.baseUrl+"cm/hopper_black/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_black/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_black/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmHopperFinal=e(r.baseUrl+"cm/hopper_final/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_final/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_final/:id/clone",params:{includeAll:"@includeAll"}},countContactsQueueCampaignHopperFinal:{isArray:!0,method:"get",url:r.baseUrl+"cm/hopper_final/voice/queue/countAttributes/:id"},countContactsIvrCampaignHopperFinal:{isArray:!0,method:"get",url:r.baseUrl+"cm/hopper_final/campaign/countAttributes/:id"},moveContactsQueueCampaignHopperFinal:{isArray:!0,method:"post",url:r.baseUrl+"cm/hopper_final/voice/queue/moveContacts/:id"},moveContactsIvrCampaignHopperFinal:{isArray:!0,method:"post",url:r.baseUrl+"cm/hopper_final/voice/campaign/moveContacts/:id"},checkContactHopper:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper_final/checkContactHopper"}}),r.cmHopperHistory=e(r.baseUrl+"cm/hopper_history/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_history/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_history/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmCustomField=e(r.baseUrl+"cm/custom_fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/custom_fields/describe"},clone:{method:"post",url:r.baseUrl+"cm/custom_fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.action=e(r.baseUrl+"actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"actions/describe"},clone:{method:"post",url:r.baseUrl+"actions/:id/clone",params:{includeAll:"@includeAll"}}}),r.automation=e(r.baseUrl+"automations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"automations/describe"},clone:{method:"post",url:r.baseUrl+"automations/:id/clone",params:{includeAll:"@includeAll"}},addConditions:{isArray:!1,method:"post",url:r.baseUrl+"automations/:id/conditions"},getConditions:{isArray:!1,method:"get",url:r.baseUrl+"automations/:id/conditions"},addActions:{isArray:!1,method:"post",url:r.baseUrl+"automations/:id/actions"},getActions:{isArray:!1,method:"get",url:r.baseUrl+"automations/:id/actions"}}),r.cannedAnswer=e(r.baseUrl+"canned_answers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"canned_answers/describe"},clone:{method:"post",url:r.baseUrl+"canned_answers/:id/clone",params:{includeAll:"@includeAll"}}}),r.disposition=e(r.baseUrl+"dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dispositions/describe"},clone:{method:"post",url:r.baseUrl+"dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),r.condition=e(r.baseUrl+"conditions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"conditions/describe"},clone:{method:"post",url:r.baseUrl+"conditions/:id/clone",params:{includeAll:"@includeAll"}}}),r.interval=e(r.baseUrl+"intervals/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"intervals/describe"},clone:{method:"post",url:r.baseUrl+"intervals/:id/clone",params:{includeAll:"@includeAll"}},addInterval:{isArray:!1,method:"post",url:r.baseUrl+"intervals/:id/sub_intervals"},getIntervals:{isArray:!1,method:"get",url:r.baseUrl+"intervals/:id/sub_intervals"},addIntervals:{isArray:!0,method:"post",url:r.baseUrl+"intervals/:id/sub_intervals/create_many"}}),r.pause=e(r.baseUrl+"pauses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"pauses/describe"},clone:{method:"post",url:r.baseUrl+"pauses/:id/clone",params:{includeAll:"@includeAll"}}}),r.cdr=e(r.baseUrl+"cdr/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cdr/describe"},clone:{method:"post",url:r.baseUrl+"cdr/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceQueuesLog=e(r.baseUrl+"voiceQueuesLog/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voiceQueuesLog/describe"},clone:{method:"post",url:r.baseUrl+"voiceQueuesLog/:id/clone",params:{includeAll:"@includeAll"}}}),r.schedule=e(r.baseUrl+"schedules/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"schedules/describe"},clone:{method:"post",url:r.baseUrl+"schedules/:id/clone",params:{includeAll:"@includeAll"}},run:{isArray:!1,method:"get",url:r.baseUrl+"schedules/:id/run"}}),r.sound=e(r.baseUrl+"sounds/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sounds/describe"},clone:{method:"post",url:r.baseUrl+"sounds/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"sounds/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},delete:{isArray:!1,method:"delete",url:r.baseUrl+"sounds/:id"}}),r.tag=e(r.baseUrl+"tags/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"tags/describe"},clone:{method:"post",url:r.baseUrl+"tags/:id/clone",params:{includeAll:"@includeAll"}}}),r.template=e(r.baseUrl+"templates/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"templates/describe"},clone:{method:"post",url:r.baseUrl+"templates/:id/clone",params:{includeAll:"@includeAll"}}}),r.trigger=e(r.baseUrl+"triggers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"triggers/describe"},clone:{method:"post",url:r.baseUrl+"triggers/:id/clone",params:{includeAll:"@includeAll"}},addAllCondition:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/all_conditions"},addAnyCondition:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/any_conditions"},getAllConditions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/all_conditions"},getAnyConditions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/any_conditions"},addAction:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/actions"},getActions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/actions"}}),r.variable=e(r.baseUrl+"variables/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"variables/describe"},clone:{method:"post",url:r.baseUrl+"variables/:id/clone",params:{includeAll:"@includeAll"}}}),r.integration=e(r.baseUrl+"integrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/:id/clone",params:{includeAll:"@includeAll"}}}),r.integrationReport=e(r.baseUrl+"integrations/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/reports/describe"},clone:{method:"post",url:r.baseUrl+"integrations/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.analyticCustomReport=e(r.baseUrl+"analytics/custom_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/custom_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/custom_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/preview"},run:{isArray:!1,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/run"},query:{isArray:!1,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/query"}}),r.analyticDefaultReport=e(r.baseUrl+"analytics/default_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/default_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/default_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:r.baseUrl+"analytics/default_reports/:id/preview"},run:{isArray:!1,method:"get",url:r.baseUrl+"analytics/default_reports/:id/run"},query:{isArray:!1,method:"get",url:r.baseUrl+"analytics/default_reports/:id/query"}}),r.analyticExtractedReport=e(r.baseUrl+"analytics/extracted_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/extracted_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/extracted_reports/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"analytics/extracted_reports/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.analyticMetric=e(r.baseUrl+"analytics/metrics/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/metrics/describe"},clone:{method:"post",url:r.baseUrl+"analytics/metrics/:id/clone",params:{includeAll:"@includeAll"}}}),r.analyticFieldReport=e(r.baseUrl+"analytics/field_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/field_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/field_reports/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:r.baseUrl+"analytics/field_reports/create_many",isArray:!0},bulkDestroy:{method:"delete",url:r.baseUrl+"analytics/field_reports/destroy_many",isArray:!0},addFields:{isArray:!0,method:"post",url:r.baseUrl+"analytics/field_reports/:id/create_many"}}),r.analyticTreeReport=e(r.baseUrl+"analytics/tree_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/tree_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/tree_reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.intSalesforceAccount=e(r.baseUrl+"integrations/salesforce/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/salesforce/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/accounts/:id/fields"}}),r.intSalesforceConfiguration=e(r.baseUrl+"integrations/salesforce/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/descriptions"}}),r.intSalesforceField=e(r.baseUrl+"integrations/salesforce/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intSugarcrmAccount=e(r.baseUrl+"integrations/sugarcrm/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/fields"}}),r.intSugarcrmConfiguration=e(r.baseUrl+"integrations/sugarcrm/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/descriptions"}}),r.intSugarcrmField=e(r.baseUrl+"integrations/sugarcrm/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intDeskAccount=e(r.baseUrl+"integrations/desk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/desk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/accounts/:id/fields"}}),r.intDeskConfiguration=e(r.baseUrl+"integrations/desk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/desk/configurations/:id/tags"}}),r.intDeskField=e(r.baseUrl+"integrations/desk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intZohoAccount=e(r.baseUrl+"integrations/zoho/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/zoho/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/accounts/:id/fields"}}),r.intZohoConfiguration=e(r.baseUrl+"integrations/zoho/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/descriptions"}}),r.intZohoField=e(r.baseUrl+"integrations/zoho/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intZendeskAccount=e(r.baseUrl+"integrations/zendesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/zendesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/accounts/:id/fields"}}),r.intZendeskConfiguration=e(r.baseUrl+"integrations/zendesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/zendesk/configurations/:id/tags"}}),r.intZendeskField=e(r.baseUrl+"integrations/zendesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intFreshdeskAccount=e(r.baseUrl+"integrations/freshdesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/:id/fields"}}),r.intFreshdeskConfiguration=e(r.baseUrl+"integrations/freshdesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/freshdesk/configurations/:id/tags"}}),r.intFreshdeskField=e(r.baseUrl+"integrations/freshdesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intVtigerAccount=e(r.baseUrl+"integrations/vtiger/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/vtiger/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/accounts/:id/fields"}}),r.intVtigerConfiguration=e(r.baseUrl+"integrations/vtiger/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/descriptions"}}),r.intVtigerField=e(r.baseUrl+"integrations/vtiger/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intServicenowAccount=e(r.baseUrl+"integrations/servicenow/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/servicenow/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/accounts/:id/fields"}}),r.intServicenowConfiguration=e(r.baseUrl+"integrations/servicenow/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/descriptions"}}),r.intServicenowField=e(r.baseUrl+"integrations/servicenow/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intDynamics365Account=e(r.baseUrl+"integrations/dynamics365/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/:id/fields"}}),r.intDynamics365Configuration=e(r.baseUrl+"integrations/dynamics365/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/descriptions"}}),r.intDynamics365Field=e(r.baseUrl+"integrations/dynamics365/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intFreshsalesAccount=e(r.baseUrl+"integrations/freshsales/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/freshsales/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/accounts/:id/fields"}}),r.intFreshsalesConfiguration=e(r.baseUrl+"integrations/freshsales/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/configurations/:id/clone",params:{includeAll:"@includeAll"}},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/descriptions"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/fields"}}),r.intFreshsalesField=e(r.baseUrl+"integrations/freshsales/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.network=e(r.baseUrl+"networks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"networks/describe"},clone:{method:"post",url:r.baseUrl+"networks/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatQueueReport=e(r.baseUrl+"chat/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"chat/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatInternalMessage=e(r.baseUrl+"chat/internal/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/internal/messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/internal/messages/:id/clone",params:{includeAll:"@includeAll"}},getUsers:{isArray:!1,method:"get",url:r.baseUrl+"chat/internal/messages/users"}}),r.jscriptyAnswerReport=e(r.baseUrl+"jscripty/answers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/answers/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/answers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptyQuestionReport=e(r.baseUrl+"jscripty/questions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/questions/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/questions/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptySessionReport=e(r.baseUrl+"jscripty/sessions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/sessions/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/sessions/reports/:id/clone",params:{includeAll:"@includeAll"}},getQuestions:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/sessions/reports/:id/questions"}}),r.smsQueueReport=e(r.baseUrl+"sms/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"sms/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareReport=e(r.baseUrl+"square/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/reports/describe"},clone:{method:"post",url:r.baseUrl+"square/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareReportDetail=e(r.baseUrl+"square/details/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/details/reports/describe"},clone:{method:"post",url:r.baseUrl+"square/details/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptyProject=e(r.baseUrl+"jscripty/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/projects/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/projects/:id/clone",params:{includeAll:"@includeAll"}},getSessions:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/sessions"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/answers"},getSummary:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/summary",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.setting=e(r.baseUrl+"settings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"settings/describe"},clone:{method:"post",url:r.baseUrl+"settings/:id/clone",params:{includeAll:"@includeAll"}},addLogo:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/logo"},addLogoLogin:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/logo_login"},getLogo:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/logo"},getLogoLogin:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/logo_login"},gdpr:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/gdpr"},addPreferred:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/preferred"},getPreferred:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/preferred"},addFavicon:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/favicon"},getFavicon:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/favicon"},getDate:{isArray:!1,method:"get",url:r.baseUrl+"settings/now"}}),r.squareOdbc=e(r.baseUrl+"square/odbc/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/odbc/describe"},clone:{method:"post",url:r.baseUrl+"square/odbc/:id/clone",params:{includeAll:"@includeAll"}},test:{isArray:!1,method:"get",url:r.baseUrl+"square/odbc/:id/test"}}),r.squareProject=e(r.baseUrl+"square/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/projects/describe"},clone:{method:"post",url:r.baseUrl+"square/projects/:id/clone",params:{includeAll:"@includeAll"}},addUsers:{isArray:!0,method:"post",url:r.baseUrl+"square/projects/:id/users"},removeUsers:{isArray:!1,method:"delete",url:r.baseUrl+"square/projects/:id/users"},getUsers:{isArray:!1,method:"get",url:r.baseUrl+"square/projects/:id/users"}}),r.squareRecording=e(r.baseUrl+"square/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/recordings/describe"},clone:{method:"post",url:r.baseUrl+"square/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"square/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.squareMessage=e(r.baseUrl+"square/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/messages/describe"},clone:{method:"post",url:r.baseUrl+"square/messages/:id/clone",params:{includeAll:"@includeAll"}}}),r.team=e(r.baseUrl+"teams/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"teams/describe"},clone:{method:"post",url:r.baseUrl+"teams/:id/clone",params:{includeAll:"@includeAll"}},getQueues:{isArray:!0,method:"get",url:r.baseUrl+"teams/:id/queues"},addQueues:{isArray:!0,method:"post",url:r.baseUrl+"teams/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:r.baseUrl+"teams/:id/queues"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"teams/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"teams/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"teams/:id/users"}}),r.license=e(r.baseUrl+"license/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"license/describe"},clone:{method:"post",url:r.baseUrl+"license/:id/clone",params:{includeAll:"@includeAll"}},downloadLogFile:{isArray:!1,method:"get",url:r.baseUrl+"license/download_log_file",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.campaign=e(r.baseUrl+"campaigns/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"campaigns/describe"},clone:{method:"post",url:r.baseUrl+"campaigns/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_black"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/lists"},addLists:{isArray:!0,method:"post",url:r.baseUrl+"campaigns/:id/lists"},removeLists:{isArray:!0,method:"delete",url:r.baseUrl+"campaigns/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:r.baseUrl+"campaigns/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:r.baseUrl+"campaigns/:id/blacklists"}}),r.migration=e(r.baseUrl+"migrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"migrations/describe"},clone:{method:"post",url:r.baseUrl+"migrations/:id/clone",params:{includeAll:"@includeAll"}}}),r.attachment=e(r.baseUrl+"attachments/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"attachments/describe"},clone:{method:"post",url:r.baseUrl+"attachments/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"attachments/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.plugin=e(r.baseUrl+"plugins/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"plugins/describe"},clone:{method:"post",url:r.baseUrl+"plugins/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"plugins/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},upload:{isArray:!1,method:"post",url:r.baseUrl+"plugins/"},delete:{isArray:!1,method:"delete",url:r.baseUrl+"plugins/:id"},webhookGet:{isArray:!1,method:"get",url:r.baseUrl+"plugins/webhook"},webhookPost:{isArray:!1,method:"post",url:r.baseUrl+"plugins/webhook"}}),r.mailTransferReport=e(r.baseUrl+"mail/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"mail/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatTransferReport=e(r.baseUrl+"chat/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"chat/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxTransferReport=e(r.baseUrl+"fax/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"fax/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.openchannelTransferReport=e(r.baseUrl+"openchannel/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsTransferReport=e(r.baseUrl+"sms/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"sms/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmList=e(r.baseUrl+"cm/lists/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/lists/describe"},clone:{method:"post",url:r.baseUrl+"cm/lists/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"cm/lists/:id/dispositions"},addContacts:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/contacts"},getContacts:{isArray:!0,method:"get",url:r.baseUrl+"cm/lists/:id/contacts"},getContactsCsv:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/contacts/csv",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},addCustomField:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/fields"},getCustomFields:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/fields"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"cm/lists/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"cm/lists/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/users"}}),r.voicePrefix=e(r.baseUrl+"voice/prefixes/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/prefixes/describe"},clone:{method:"post",url:r.baseUrl+"voice/prefixes/:id/clone",params:{includeAll:"@includeAll"}},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"voice/prefixes/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"voice/prefixes/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"voice/prefixes/:id/users"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"voice/prefixes/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"voice/prefixes/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"voice/prefixes/:id/teams"}}),r.userProfile=e(r.baseUrl+"userProfiles/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfiles/describe"},clone:{method:"post",url:r.baseUrl+"userProfiles/:id/clone",params:{includeAll:"@includeAll"}},addSections:{isArray:!0,method:"post",url:r.baseUrl+"userProfiles/:id/sections"},removeSections:{isArray:!1,method:"delete",url:r.baseUrl+"userProfiles/:id/sections"},getSections:{isArray:!0,method:"get",url:r.baseUrl+"userProfiles/:id/sections"},addResources:{isArray:!0,method:"post",url:r.baseUrl+"userProfiles/:id/resources"},removeResources:{isArray:!1,method:"delete",url:r.baseUrl+"userProfiles/:id/resources"},getResources:{isArray:!1,method:"get",url:r.baseUrl+"userProfiles/:id/resources"}}),r.userProfileSection=e(r.baseUrl+"userProfile/sections/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfile/sections/describe"},clone:{method:"post",url:r.baseUrl+"userProfile/sections/:id/clone",params:{includeAll:"@includeAll"}}}),r.userProfileResource=e(r.baseUrl+"userProfile/resources/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfile/resources/describe"},clone:{method:"post",url:r.baseUrl+"userProfile/resources/:id/clone",params:{includeAll:"@includeAll"}}}),r.userNotification=e(r.baseUrl+"userNotifications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userNotifications/describe"},clone:{method:"post",url:r.baseUrl+"userNotifications/:id/clone",params:{includeAll:"@includeAll"}},sendUserNotification:{isArray:!1,method:"post",url:r.baseUrl+"userNotifications/"}}),r.whatsappAccount=e(r.baseUrl+"whatsapp/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/accounts/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/users"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/applications"},notify:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/notify"},send:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/send"}}),r.whatsappApplication=e(r.baseUrl+"whatsapp/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/applications/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappInteraction=e(r.baseUrl+"whatsapp/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/interactions/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.whatsappMessage=e(r.baseUrl+"whatsapp/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/messages/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"whatsapp/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"whatsapp/messages/:id/reject"},status:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/messages/:id/status"}}),r.whatsappQueueReport=e(r.baseUrl+"whatsapp/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappTransferReport=e(r.baseUrl+"whatsapp/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappQueue=e(r.baseUrl+"whatsapp/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/queues/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/users"}}),r.cloudProvider=e(r.baseUrl+"cloudProviders/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cloudProviders/describe"},clone:{method:"post",url:r.baseUrl+"cloudProviders/:id/clone",params:{includeAll:"@includeAll"}},oauth2MicrosoftAuthorize:{method:"get",url:r.baseUrl+"cloudProviders/:id/oauth2/microsoft/authorize"}}),r.realtime=e(r.baseUrl+"realtime",{},{getAgents:{isArray:!1,method:"get",url:r.baseUrl+"realtime/agents"},getQueues:{isArray:!1,method:"get",url:r.baseUrl+"realtime/queues"}}),r.userSetting=e(r.baseUrl+"user-settings/:id",{id:"@id"},{update:{method:"put",isArray:!1}}),r}e.$inject=["$resource","userProfileManager"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(e,n){n.setConfig({position:"top-right",sound:!1,html:!0,theme:"material"}),e.useLoader("$translatePartialLoader",{urlTemplate:"{part}/i18n/{lang}.json"}),e.preferredLanguage("en"),e.fallbackLanguage("en"),e.useSanitizeValueStrategy(null)}e.$inject=["$translateProvider","toastyConfigProvider"],angular.module("motion").config(e)}(),function(){"use strict";angular.module("motion")}(),function(){"use strict";function e(e,n,t,a){var i=this;i.themes=e.themes,i.direction="ltr";var s=t.get("motion.language");s&&(n.use(s),0<=["ar","fa","he"].indexOf(s)&&a.setting.get({id:1}).$promise.then(function(e){e&&e.rtlSupport&&(i.direction="rtl")}).catch(function(e){e&&toasty.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})}))}e.$inject=["motionTheming","$translate","$cookies","api"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(a,i){return function(e){var n=new Date,t=new Date(e);return t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()?a("date")(t.getTime(),"shortTime"):t.getDate()===n.getDate()-1&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()?i.instant("DASHBOARDS.YESTERDAY")+" "+a("date")(t.getTime(),"shortTime"):a("date")(t.getTime(),"MMM d, y h:mm a")}}function n(e){return{Today:e.instant("DASHBOARDS.TODAY"),Yesterday:e.instant("DASHBOARDS.YESTERDAY"),"This Week":e.instant("DASHBOARDS.THIS_WEEK"),"Last Week":e.instant("DASHBOARDS.LAST_WEEK"),"This Month":e.instant("DASHBOARDS.THIS_MONTH"),"Last Month":e.instant("DASHBOARDS.LAST_MONTH"),"This Year":e.instant("DASHBOARDS.THIS_YEAR"),"Last Year":e.instant("DASHBOARDS.LAST_YEAR"),January:e.instant("DASHBOARDS.JANUARY"),February:e.instant("DASHBOARDS.FEBRUARY"),March:e.instant("DASHBOARDS.MARCH"),April:e.instant("DASHBOARDS.APRIL"),May:e.instant("DASHBOARDS.MAY"),June:e.instant("DASHBOARDS.JUNE"),July:e.instant("DASHBOARDS.JULY"),August:e.instant("DASHBOARDS.AUGUST"),September:e.instant("DASHBOARDS.SEPTEMBER"),October:e.instant("DASHBOARDS.OCTOBER"),November:e.instant("DASHBOARDS.NOVEMBER"),December:e.instant("DASHBOARDS.DECEMBER"),Mon:e.instant("DASHBOARDS.MON"),Tue:e.instant("DASHBOARDS.TUE"),Wed:e.instant("DASHBOARDS.WED"),Thu:e.instant("DASHBOARDS.THU"),Fri:e.instant("DASHBOARDS.FRI"),Sat:e.instant("DASHBOARDS.SAT"),Sun:e.instant("DASHBOARDS.SUN")}}e.$inject=["$filter","$translate"],n.$inject=["$translate"],angular.module("motion").filter("limitObjectFromTo",function(){return function(e,n,t){var a,i={},s=0;for(a in e)if(t<=s&&(i[a]=e[a]),++s===t+n)break;return i}}).filter("formatdate",e).factory("IndexFactory",function(){var e=[{value:"jan"},{value:"feb"},{value:"mar"},{value:"apr"},{value:"may"},{value:"jun"},{value:"jul"},{value:"aug"},{value:"sep"},{value:"oct"},{value:"nov"},{value:"dec"}],n=[{value:"1"},{value:"2"},{value:"3"},{value:"4"},{value:"5"},{value:"6"},{value:"7"},{value:"8"},{value:"9"},{value:"10"},{value:"11"},{value:"12"}],t=[{value:"mon"},{value:"tue"},{value:"wed"},{value:"thu"},{value:"fri"},{value:"sat"},{value:"sun"}],a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];return{getMonthName:function(){return e},getMonthNumber:function(){return n},getDaysOfWeek:function(){return t},getDaysOfMonth:function(){return a}}}).factory("dateFilterLocalizationFactory",n).factory("jscookie",function(){return Cookies}).factory("Sequence",function(){return{enqueue:function(e){this.tail=this.tail?this.tail.finally(e):e()}}})}(),function(){"use strict";function e(e,n,t){var a;t.html5Mode(!0),n.otherwise("/dashboards/general"),angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.get("motion.layoutStyle")||"verticalNavigation",s={verticalNavigation:{main:"app/core/layouts/vertical-navigation.html",toolbar:"app/toolbar/layouts/vertical-navigation/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html",header:"app/header/layouts/vertical-navigation/header.html",footer:"app/footer/layouts/vertical-navigation/footer.html"},verticalNavigationFullwidthToolbar:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html"},verticalNavigationFullwidthToolbar2:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar-2/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html"},horizontalNavigation:{main:"app/core/layouts/horizontal-navigation.html",toolbar:"app/toolbar/layouts/horizontal-navigation/toolbar.html",navigation:"app/navigation/layouts/horizontal-navigation/navigation.html"},contentOnly:{main:"app/core/layouts/content-only.html",toolbar:"",navigation:""},contentWithToolbar:{main:"app/core/layouts/content-with-toolbar.html",toolbar:"app/toolbar/layouts/content-with-toolbar/toolbar.html",navigation:""}};e.state("app",{abstract:!0,views:{"main@":{templateUrl:s[i].main,controller:"MainController as vm"},"toolbar@app":{templateUrl:s[i].toolbar,controller:"ToolbarController as vm"},"navigation@app":{templateUrl:s[i].navigation,controller:"NavigationController as vm"},"quickPanel@app":{templateUrl:"app/quick-panel/quick-panel.html",controller:"QuickPanelController as vm"},"header@app":{templateUrl:s[i].header,controller:"HeaderController as vm"},"footer@app":{templateUrl:s[i].footer,controller:"FooterController as vm"}},resolve:{license:["apiResolver",function(e){return e.resolve("license@get")}],setting:["apiResolver","settingsManager",function(e,n){return e.resolve("setting@get",{id:1}).then(function(e){return n.set(e),e})}]}})}e.$inject=["$stateProvider","$urlRouterProvider","$locationProvider"],angular.module("motion").config(e)}(),function(){"use strict";function e(e,n){e.onStart({},n.showLoadingIndicator),e.onFinish({},n.hideLoadingIndicator)}e.$inject=["$transitions","LoadingIndicatorService"],angular.module("motion").run(e)}(),function(){"use strict";function e(a,e){var i,o={};function s(){a.$broadcast("socket:connect"),i&&i.connected||(i=io({query:e.getCurrentUser()?"id="+e.getCurrentUser().id:void 0,transports:["websocket","polling"]})).once("disconnect",n)}function n(e){i.once("connect",s),"logout"===e?i.removeAllListeners():a.$broadcast("socket:disconnect"),i&&i.connected&&i.disconnect()}function r(e,n,t){o[e]||(o[e]=[]),o[e].push({wrapper:n,fn:t})}return{connect:s,disconnect:n,getListeners:function(e){return e?o[e]:o},on:function(e,n){n=n||angular.noop,i||s();var t=function(){var e=arguments;a.$applyAsync(function(){n.apply(i,e)})};r(e,t,n),i.on(e,t)},onWithoutApply:function(e,n){n=n||angular.noop,i||s();var t=function(){n.apply(i,arguments)};r(e,t,n),i.on(e,t)},emit:function(e,n,t){t=t||angular.noop,i||s(),i.emit(e,n,function(){var e=arguments;a.$applyAsync(function(){t.apply(i,e)})})},removeAllListeners:function(e){var n;i||s(),i.removeAllListeners(e),n=e,_.isEmpty(o[n])||delete o[n]},removeListener:function(e,n){i||s();var t=function(e,n){var t=o[e];if(!_.isEmpty(t))for(var a=0;a<t.length;a++){var i=t[a];if(i.fn===n){var s=i.wrapper;return t.splice(a,1),s}}}(e,n);i.removeListener(e,t)}}}e.$inject=["$rootScope","Auth"],angular.module("motion").factory("socket",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o,r){var l=this;l.progresslogin=!1,l.googleSsoEnabled=!1,l.adSsoEnabled=!1,l.login=function(){return l.progresslogin=!0,l.message="",s.login(l.form).then(function(){return n.go("app.dashboards.general")}).catch(function(e){l.message=e.data?e.data.message:e.message}).finally(function(){l.progresslogin=!1})},l.loginOauth=function(e){l.message="",t.location.href=s.loginSSO(e)},l.loginAD=function(){return l.progresslogin=!0,l.message="",s.loginAD(l.form).then(function(){return n.go("app.dashboards.general")}).catch(function(e){l.message=e.data?e.data.message:e.message}).finally(function(){l.progresslogin=!1})},l.onInit=function(){{if(n.params.token&&n.params.userId)return s.removeCookies(),l.progresslogin=!0,o.secureCookieEnabled?r.set("motion.token",n.params.token,{secure:!0,sameSite:"none"}):r.set("motion.token",n.params.token),i.user.get({id:n.params.userId}).$promise.then(function(e){e&&(s.setCurrentUser(e),n.go("app.dashboards.general"))}).finally(function(){l.progresslogin=!1});s.isLoggedIn()&&n.go("app.dashboards.general")}l.googleSsoEnabled=o.googleSsoEnabled,l.adSsoEnabled=o.adSsoEnabled},l.onInit()}e.$inject=["$state","$window","$cookies","$timeout","api","Auth","setting","jscookie"],angular.module("app.login").controller("LoginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_EXTRACTEDREPORT",g.extractedReport=angular.copy(l),g.extractedReports=r,g.newExtractedReport=!1,g.extractedReport||(g.extractedReport={},g.title="ANALYTICS.NEW_EXTRACTEDREPORT",g.newExtractedReport=!0),g.addNewExtractedReport=function(){g.errors=[],d.analyticExtractedReport.save(g.extractedReport).$promise.then(function(e){g.extractedReports.unshift(e.toJSON()),o.success({title:"ExtractedReport properly created",msg:g.extractedReport.name?g.extractedReport.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveExtractedReport=function(){g.errors=[],d.analyticExtractedReport.update({id:g.extractedReport.id},g.extractedReport).$promise.then(function(e){var n=_.find(g.extractedReports,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ExtractedReport properly saved!",msg:g.extractedReport.name?g.extractedReport.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteExtractedReport=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The extractedReport will be deleted.").ariaLabel("Delete ExtractedReport").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.analyticExtractedReport.delete({id:g.extractedReport.id}).$promise.then(function(){_.remove(g.extractedReports,{id:g.extractedReport.id}),o.success({title:"ExtractedReport properly deleted!",msg:(g.extractedReport.name||"extractedReport")+" has been deleted!"}),v(g.extractedReport)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","extractedReports","extractedReport","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditExtractedReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.extractedReports=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="extractedReports",f.listOrder="",f.listOrderAsc=null,f.selectedExtractedReports=[],f.query={fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{extractedReport:e,extractedReports:f.extractedReports.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.downloadfile2=function(s,e){return m.analyticExtractedReport.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.savename;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("extractedReport")+"?").htmlContent("<b>"+(e.name||"extractedReport")+"</b> will be deleted.").ariaLabel("delete extractedReport").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getExtractedReports=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.analyticExtractedReport.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ExtractedReports",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditExtractedReport=function(e,n){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{extractedReport:n,extractedReports:f.extractedReports.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteExtractedReport=y,f.exportSelectedExtractedReports=function(){var e=angular.copy(f.selectedExtractedReports);return f.selectedExtractedReports=[],e},f.deleteSelectedExtractedReports=function(e){var n=i.confirm().title("Are you sure want to delete the selected extractedReports?").htmlContent("<b>"+f.selectedExtractedReports.length+" selected</b> will be deleted.").ariaLabel("delete ExtractedReports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedExtractedReports.forEach(function(e){y(e)}),f.selectedExtractedReports=[]})},f.deselectExtractedReports=function(){f.selectedExtractedReports=[]},f.selectAllExtractedReports=function(){f.selectedExtractedReports=f.extractedReports.rows};var b=!0,A=1;function E(e){f.extractedReports=e||{count:0,rows:[]}}function y(e){m.analyticExtractedReport.delete({id:e.id}).$promise.then(function(){_.remove(f.extractedReports.rows,{id:e.id}),f.extractedReports.count-=1,f.extractedReports.rows.length||f.getExtractedReports(),p.success({title:_.startCase("ExtractedReport")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticExtractedReport"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticExtractedReport",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getExtractedReports())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","extractedReports","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.analytics").controller("ExtractedReportsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_METRIC",g.metric=angular.copy(l),g.metrics=r,g.newMetric=!1,g.metric||(g.metric={table:"report_agent"},g.title="ANALYTICS.NEW_METRIC",g.newMetric=!0),g.addNewMetric=function(){g.errors=[],d.analyticMetric.save(g.metric).$promise.then(function(e){g.metrics.unshift(e.toJSON()),o.success({title:"Metric properly created",msg:g.metric.name?g.metric.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMetric=function(){g.errors=[],d.analyticMetric.update({id:g.metric.id},g.metric).$promise.then(function(e){var n=_.find(g.metrics,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Metric properly saved!",msg:g.metric.name?g.metric.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMetric=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The metric will be deleted.").ariaLabel("Delete Metric").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.analyticMetric.delete({id:g.metric.id}).$promise.then(function(){_.remove(g.metrics,{id:g.metric.id}),o.success({title:"Metric properly deleted!",msg:(g.metric.name||"metric")+" has been deleted!"}),v(g.metric)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","metrics","metric","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditMetricDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.metrics=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="metrics",f.listOrder="",f.listOrderAsc=null,f.selectedMetrics=[],f.query={fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,page:1},f.arraytable=_.keyBy([{option:"Agent Report",value:"'report_agent'"},{option:"Call Report",value:"'report_call'"},{option:"CDR",value:"'cdr'"},{option:"Chat Website",value:"'chat_websites'"},{option:"Chat Interaction",value:"'chat_interactions'"},{option:"Chat Messages",value:"'chat_messages'"},{option:"Chat Offline Messages",value:"'chat_offline_messages'"},{option:"Chat Queues",value:"'chat_queues'"},{option:"Chat Report Queue",value:"'report_chat_queue'"},{option:"Chat Report Transfer",value:"'report_chat_transfer'"},{option:"Companies",value:"'cm_companies'"},{option:"Call transfer report",value:"'report_call_transfer'"},{option:"Contacts",value:"'cm_contacts'"},{option:"CSquare Report",value:"'report_square'"},{option:"CSquare Details Report",value:"'report_square_details'"},{option:"Dial Report",value:"'report_dial'"},{option:"Dialer Hopper Processing",value:"'cm_hopper'"},{option:"Dialer Hopper Logs",value:"'cm_hopper_history'"},{option:"Dialer Hopper Final",value:"'cm_hopper_final'"},{option:"Email Account",value:"'mail_accounts'"},{option:"Email Interaction",value:"'mail_interactions'"},{option:"Email Messages",value:"'mail_messages'"},{option:"Email Queues",value:"'mail_queues'"},{option:"Email Report Queue",value:"'report_mail_queue'"},{option:"Email Report Transfer",value:"'report_mail_transfer'"},{option:"Fax Account",value:"'fax_accounts'"},{option:"Fax Interaction",value:"'fax_interactions'"},{option:"Fax Messages",value:"'fax_messages'"},{option:"Fax Queues",value:"'fax_queues'"},{option:"Fax Report Queue",value:"'report_fax_queue'"},{option:"Fax Report Transfer",value:"'report_fax_transfer'"},{option:"Jscripty Sessions",value:"'report_jscripty_sessions'"},{option:"Jscripty Questions",value:"'report_jscripty_questions'"},{option:"Jscripty Answers",value:"'report_jscripty_answers'"},{option:"Lists",value:"'cm_lists'"},{option:"Member Report",value:"'report_member'"},{option:"Openchannel Account",value:"'openchannel_accounts'"},{option:"Openchannel Interaction",value:"'openchannel_interactions'"},{option:"Openchannel Messages",value:"'openchannel_messages'"},{option:"Openchannel Queues",value:"'openchannel_queues'"},{option:"Openchannel Report Queue",value:"'report_openchannel_queue'"},{option:"Openchannel Report Transfer",value:"'report_openchannel_transfer'"},{option:"Queue Report",value:"'report_queue'"},{option:"SMS Account",value:"'sms_accounts'"},{option:"SMS Interaction",value:"'sms_interactions'"},{option:"SMS Messages",value:"'sms_messages'"},{option:"SMS Queues",value:"'sms_queues'"},{option:"SMS Report Queue",value:"'report_sms_queue'"},{option:"SMS Report Transfer",value:"'report_sms_transfer'"},{option:"Users",value:"'users'"},{option:"Voice Recordings",value:"'voice_recordings'"},{option:"Whatsapp Account",value:"'whatsapp_accounts'"},{option:"Whatsapp Interaction",value:"'whatsapp_interactions'"},{option:"Whatsapp Messages",value:"'whatsapp_messages'"},{option:"Whatsapp Queues",value:"'whatsapp_queues'"},{option:"Whatsapp Report Queue",value:"'report_whatsapp_queue'"},{option:"Whatsapp Report Transfer",value:"'report_whatsapp_transfer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{metric:e,metrics:f.metrics.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("metric")+"?").htmlContent("<b>"+(e.name||"metric")+"</b> will be deleted.").ariaLabel("delete metric").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMetrics=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.analyticMetric.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Metrics",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMetric=function(e,n){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{metric:n,metrics:f.metrics.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMetric=y,f.exportSelectedMetrics=function(){var e=angular.copy(f.selectedMetrics);return f.selectedMetrics=[],e},f.deleteSelectedMetrics=function(e){var n=i.confirm().title("Are you sure want to delete the selected metrics?").htmlContent("<b>"+f.selectedMetrics.length+" selected</b> will be deleted.").ariaLabel("delete Metrics").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMetrics.forEach(function(e){y(e)}),f.selectedMetrics=[]})},f.deselectMetrics=function(){f.selectedMetrics=[]},f.selectAllMetrics=function(){f.selectedMetrics=f.metrics.rows};var b=!0,A=1;function E(e){f.metrics=e||{count:0,rows:[]}}function y(e){m.analyticMetric.delete({id:e.id}).$promise.then(function(){_.remove(f.metrics.rows,{id:e.id}),f.metrics.count-=1,f.metrics.rows.length||f.getMetrics(),p.success({title:_.startCase("Metric")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticMetric"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticMetric",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMetrics())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","metrics","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.analytics").controller("MetricsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o){var r=this;function l(){n.hide()}r.errors=[],r.report=angular.copy(t),r.report.name+="-copy",r.treeCustomData=o,r.treeCustomConfig={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},r.treeCustomEvents={select_node:function(e,n){r.currentNode=n.node}},r.copyReport=function(){var t;r.errors=[],i.analyticCustomReport.save({name:r.report.name,description:r.report.description,table:r.report.table,conditions:r.report.conditions,joins:r.report.joins,parent:r.currentNode.id}).$promise.then(function(e){t=e,a.success({title:"Report properly copied!",msg:r.report.name?r.report.name+" has been copied!":""});var n={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return n["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=r.report.id,i.analyticFieldReport.get(n).$promise}).then(function(e){var e=_.map(e.rows,function(e){return _.extend({},e,{CustomReportId:t.id})});return i.analyticFieldReport.bulkCreate(e).$promise}).then(function(){a.success({title:"Fields copied!",msg:"Fields has been copied!"}),l()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:COPYREPORT",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","treeCustomData"],angular.module("app.analytics").controller("CopyReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){n.hide()}c.errors=[],c.joinTables=[],c.title="ANALYTICS.EDIT_REPORT",c.crudPermissions=d,c.report=angular.copy(i),c.reports=a,c.newReport=!1,c.tables=l.getMap(),c.joinTypes=[{key:"join",value:"Join"},{key:"left_join",value:"Left Join"},{key:"right_join",value:"Right Join"},{key:"cross_join",value:"Cross Join"}],c.report||(c.report={name:"",table:"report_agent",description:"",parent:r.id},c.title="ANALYTICS.NEW_REPORT",c.newReport=!0),c.addNewReport=function(){c.errors=[],c.report.joins=_.map(c.joinTables||[],function(e){return{parentKey:e.parentKey,foreignTable:e.name,foreignKey:e.foreignKey,type:e.type.toLowerCase()}}),c.report.joins=JSON.stringify(c.report.joins),s[o].save(c.report).$promise.then(function(e){c.reports.unshift(e),t.success({title:"Report properly created",msg:c.report.name?c.report.name+" has been created!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.save"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveReport=function(){c.errors=[],s[o].update({id:c.report.id},c.report).$promise.then(function(e){var n=_.find(c.reports,{id:e.id});n&&_.merge(n,e),t.success({title:"Report properly saved!",msg:c.report.name?c.report.name+" has been saved!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.update"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteReport=function(){c.errors=[];var e=n.confirm().title("Are you sure?").content("The report will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(event);n.show(e).then(function(){s[o].delete({id:c.report.id}).$promise.then(function(){_.remove(c.reports,{id:c.report.id}),t.success({title:"Report properly deleted!",msg:c.report.name?c.report.name+" has been deleted!":""}),m()}).catch(function(e){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.delete"}]})},function(){})},c.closeDialog=m,c.selectedTableChange=function(e){e&&(delete c.selectedItem,c.joinTables.push(e))},c.removeJoin=function(e){c.joinTables.splice(e,1)},c.getFields=function(n,t,e){var a=_.find(c.tables,{name:e});a&&a.api&&s[a.api].describe().$promise.then(function(e){n[t]=_.difference(_.keys(e),["$promise","$resolved"])}).catch(function(e){console.error(e)})}}e.$inject=["$location","$mdDialog","toasty","reports","report","api","apiName","currentNode","describeTable","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportDialogController",e)}(),function(){"use strict";function e(i,s,o,e){var r=this;r.report={},r.conditions=e.getConditions,r.init=function(e,n){r.report=e,r.report.condition=angular.fromJson(e.conditions)||{group:{operator:"AND",rules:[]}},r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1};for(var t=0;t<r.report.condition.group.rules.length;t++)if(r.report.condition.group.rules[t].field){var a=r.report.condition.group.rules[t].field.split(".");1===a.length&&(r.report.condition.group.rules[t].field=r.report.table+"."+r.report.condition.group.rules[t].field)}s.getColumns(r.report.table).then(function(e){r.columns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt"])}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.addCondition=function(e){e.unshift({condition:"=",field:"",value:""})},r.addGroup=function(e){e.push({group:{operator:"AND",rules:[]}})},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the item?").htmlContent("The item will be deleted.").ariaLabel("delete item").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){e.splice(n,1)},function(){console.log("CANCEL")})},r.isValueByCondition=function(e){return!_.includes(["IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],e)}}e.$inject=["$mdDialog","describeTable","toasty","sqlUtil"],angular.module("app.analytics").controller("ReportConditionsController",e)}(),function(){"use strict";function e(a){var i={report_call_transfer:"voiceTransferReport",cm_companies:"cmCompany",cm_contacts:"cmContact",cm_hopper:"cmHopper",cm_hopper_final:"cmHopperFinal",cm_hopper_history:"cmHopperHistory",cm_lists:"cmList",chat_websites:"chatWebsite",chat_queues:"chatQueue",chat_interactions:"chatInteraction",chat_messages:"chatMessage",chat_offline_messages:"chatOfflineMessage",report_chat_queue:"chatQueueReport",report_chat_transfer:"chatTransferReport",mail_accounts:"mailAccount",mail_queues:"mailQueue",mail_interactions:"mailInteraction",mail_messages:"mailMessage",report_mail_queue:"mailQueueReport",report_mail_transfer:"mailTransferReport",openchannel_accounts:"openchannelAccount",openchannel_queues:"openchannelQueue",openchannel_interactions:"openchannelInteraction",openchannel_messages:"openchannelMessage",report_openchannel_queue:"openchannelQueueReport",report_openchannel_transfer:"openchannelTransferReport",sms_accounts:"smsAccount",sms_queues:"smsQueue",sms_interactions:"smsInteraction",sms_messages:"smsMessage",report_sms_queue:"smsQueueReport",report_sms_transfer:"smsTransferReport",fax_accounts:"faxAccount",fax_queues:"faxQueue",fax_interactions:"faxInteraction",fax_messages:"faxMessage",report_fax_transfer:"faxTransferReport",report_fax_queue:"faxQueueReport",report_call:"voiceCallReport",report_agent:"voiceAgentReport",report_square:"squareReport",report_member:"memberReport",report_queue:"voiceQueueReport",report_square_details:"squareReportDetail",report_dial:"voiceDialReport",report_jscripty_sessions:"jscriptySessionReport",report_jscripty_questions:"jscriptyQuestionReport",report_jscripty_answers:"jscriptyAnswerReport",users:"user",voice_recordings:"voiceRecording",cdr:"cdr",whatsapp_accounts:"whatsappAccount",whatsapp_queues:"whatsappQueue",whatsapp_interactions:"whatsappInteraction",whatsapp_messages:"whatsappMessage",report_whatsapp_queue:"whatsappQueueReport",report_whatsapp_transfer:"whatsappTransferReport"};return{getMap:function(){var t=[];return _.forIn(i,function(e,n){t.push({name:n,api:e})}),t},getColumns:function(e){var n=i[e],t={};return"cm_contacts"===e&&(t.analytics=!0),a[n].describe(t).$promise}}}e.$inject=["api"],angular.module("app.analytics").factory("describeTable",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;(u.errors=[],u.title="Edit Report Field",u.report=i,u.reportField=angular.copy(o),u.reportFields=s,u.metrics=r,u.columns=l,u.sqlUtil=d,u.newReportField=!1,u.crudPermissions=m,u.reportField)?(u.reportField.type=u.reportField.custom?"custom":u.reportField.MetricId?"metric":"column",u.reportField.field&&!u.reportField.custom&&_.isNil(u.reportField.MetricId)&&1===u.reportField.field.split(".").length&&(u.reportField.field=u.report.table+"."+u.reportField.field)):(u.reportField={type:"column",function:null,format:null,groupBy:!1,orderBy:null},u.title="New Report Field",u.newReportField=!0);function p(){t.hide()}u.addNewReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,u.reportField.CustomReportId=u.report.id,c.analyticFieldReport.save(u.reportField).$promise.then(function(e){u.reportFields.push(e),a.success({title:"Report field properly created",msg:u.reportField.field?u.reportField.field+" has been created!":u.reportField.type+" has been created!"}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.save"}]})},u.saveReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,c.analyticFieldReport.update({id:u.reportField.id},u.reportField).$promise.then(function(e){var n=_.find(u.reportFields,{id:e.id});n&&_.merge(n,e),a.success({title:"Report Field properly saved!",msg:u.reportField.field?u.reportField.field+" has been saved!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.update"}]})},u.deleteReportField=function(e){u.errors=[];var n=t.confirm().title("Are you sure?").content("The field will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){c.analyticFieldReport.delete({id:u.reportField.id}).$promise.then(function(){_.remove(u.reportFields,{id:u.reportField.id}),a.success({title:"Report Field properly deleted!",msg:u.reportField.field?u.reportField.field+" has been deleted!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReportField.delete"}]})},function(){})},u.closeDialog=p}e.$inject=["$scope","$location","$mdDialog","toasty","report","reportFields","reportField","metrics","columns","sqlUtil","api","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportFieldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;c.report={},c.reportFields={count:0,rows:[]},c.functions=_.keyBy(l.getFunctions,"value"),c.formats=_.keyBy(l.getFormats,"value"),c.groupBy=_.keyBy(l.getGroupBy,"value"),c.orderBy=_.keyBy(l.getOrderBy,"value"),c.selectedReportFields=[],c.query={fields:"createdAt,updatedAt,id,field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0},c.sortableTable={animation:100,onSort:function(e){o.analyticFieldReport.addFields({id:c.report.id},e.models).$promise.then(function(e){c.reportFields.rows=e}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDFIELDS"})})}},c.init=function(e,n){c.report=e,c.query.CustomReportId=c.report.id,c.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},c.sortableTable.disabled=!c.crudPermissions.canEdit,r.getColumns(c.report.table).then(function(e){return c.columns=_.difference(_.keys(e),["$promise","$resolved"]),o.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise}).then(function(e){c.metrics=e.rows}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.getReportFields()},c.deleteConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>"+e.field+"</b> will be deleted.").ariaLabel("delete field").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){p(e)},function(){console.log("CANCEL")})},c.success=u,c.getReportFields=function(){c.promise=o.analyticFieldReport.get(c.query,u).$promise},c.createOrEditReportField=function(e,n){a.show({controller:"CreateOrEditReportFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/edit/field/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:c.report,reportField:n,reportFields:c.reportFields.rows,metrics:c.metrics,columns:c.columns,setting:null,crudPermissions:c.crudPermissions}})},c.deleteReportField=p,c.deleteSelectedReportFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+c.selectedReportFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){c.selectedReportFields.forEach(function(e){p(e)}),c.selectedReportFields=[]})},c.getMetricName=function(e){var n=_.find(c.metrics,{id:e});return n?n.name:d.instant("ANALYTICS.NO_METRIC_FOUND")},c.getMetricValue=function(e){var n=_.find(c.metrics,{id:e});return n?n.metric:d.instant("ANALYTICS.NO_METRIC_FOUND")};var m=!0;function u(e){c.reportFields=e||{count:0,rows:[]}}function p(e){o.analyticFieldReport.delete({id:e.id}).$promise.then(function(){c.selectedReportFields=[],_.remove(c.reportFields.rows,{id:e.id}),c.reportFields.count-=1,c.reportFields.rows.length||c.getReportFields(),s.success({title:"Field deleted!",msg:e.field?e.field+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}n.$watch("vm_rf.query.filter",function(e,n){m?t(function(){m=!1}):c.getReportFields()})}e.$inject=["$cookies","$scope","$timeout","$mdDialog","$document","toasty","api","describeTable","sqlUtil","$translate"],angular.module("app.analytics").controller("ReportFieldsController",e)}(),function(){"use strict";angular.module("app.analytics").factory("sqlUtil",function(){return{getFunctions:[{value:"SUM",option:function(e){return"SUM ("+e+")"}},{value:"COUNT",option:function(e){return"COUNT ("+e+")"}},{value:"COUNT DISTINCT",option:function(e){return"COUNT (DISTINCT "+e+")"}},{value:"MAX",option:function(e){return"MAX ("+e+")"}},{value:"MIN",option:function(e){return"MIN ("+e+")"}},{value:"AVG",option:function(e){return"AVG ("+e+")"}},{value:"GROUP_CONCAT",option:function(e){return"GROUP_CONCAT ("+e+")"}},{value:"GROUP_CONCAT ASC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" ASC)"}},{value:"GROUP_CONCAT DESC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" DESC)"}}],getFormats:[{value:"SEC_TO_TIME",option:function(e){return"SEC_TO_TIME ("+e+")"}},{value:"DATE",option:function(e){return"DATE ("+e+")"}},{value:"HOUR",option:function(e){return"HOUR ("+e+")"}},{value:"ROUND",option:function(e){return"ROUND ("+e+")"}},{value:"UNIX_TIMESTAMP",option:function(e){return"UNIX_TIMESTAMP ("+e+")"}}],getGroupBy:[{value:!1,option:function(){return"No"}},{value:!0,option:function(e){return"GROUP BY "+e}}],getOrderBy:[{value:"ASC",option:function(e){return"ORDER BY "+e+" ASC"}},{value:"DESC",option:function(e){return"ORDER BY "+e+" DESC"}}],getConditions:["=","!=","<","<=",">",">=","LIKE","NOT LIKE","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"]}})}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(e){return _.isArray(e)}o.report=a||{},o.userProfileSection=s&&1==s.count?s.rows[0]:null,o.crudPermissions=i.parseCrudPermissions(o.userProfileSection?o.userProfileSection.crudPermissions:null),o.selectedTab=e.params.tab||0,o.gotoReports=function(){e.go("app.analytics.reports",{},{reload:"app.analytics.reports"})},o.saveReport=function(){o.report.conditions=angular.toJson(o.report.condition),t.analyticCustomReport.update({id:o.report.id},_.omit(o.report,"joins")).$promise.then(function(){n.success({title:"Report updated!",msg:o.report.name?o.report.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETreport",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.previewReport=function(){o.columns=[],o.rows=[],o.error=!1,t.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:o.report.id}).$promise.then(function(e){return o.columns=e?e.rows:[],t.analyticCustomReport.preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})},o.queryReport=function(){return o.queryResult="Loading...",t.analyticCustomReport.query({id:o.report.id}).$promise.then(function(e){o.queryResult=e.sql}).catch(function(e){o.queryResult="",console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})},o.mapArray=function(e,n){if(r(e))return _.map(e,n).join(",");return""},o.isArray=r,o.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n}}e.$inject=["$state","toasty","api","report","Auth","userProfileSection"],angular.module("app.analytics").controller("ReportController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.errors=[],o.report=angular.copy(a),o.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n},o.closeDialog=function(){n.hide()},function(){o.columns=[],o.rows=[],o.error=!1;var e={fields:"field,alias",nolimit:!0};e["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=o.report.id,o.promise=i.analyticFieldReport.get(e).$promise.then(function(e){return o.columns=e?e.rows:[],i[s].preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(o.error)})}()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName"],angular.module("app.analytics").controller("PreviewReportDialogController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,n,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.reports={count:0,rows:[]},p.userProfile=r,p.userProfileSection=l&&1==l.count?l.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.selectedReports=[],p.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},p.apiName=null,p.currentPath="",p.customTree=!0,p.editstate=function(e,n){s.go("app.analytics.reports.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.copydialog=function(e,n){i.show({controller:"CopyReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/copy/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,treeCustomData:p.treeCustomInstance.jstree(!0).get_json("#")}}).finally(function(){})},p.previewdialog=function(e,n){i.show({controller:"PreviewReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/preview/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName}})},p.rundialog=function(e,n){i.show({controller:"RunReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,currentPath:p.currentPath}})},p.downloadfile=function(a,e){var i;d.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise.then(function(e){i=_.keyBy(e.rows,"id");var n={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return n["analyticCustomReport"===p.apiName?"CustomReportId":"DefaultReportId"]=a.id,d.analyticFieldReport.get(n).$promise}).then(function(e){for(var n=0;n<e.rows.length;n+=1)e.rows[n].MetricId&&(e.rows[n].field=i[e.rows[n].MetricId].metric,e.rows[n].custom=!0),delete e.rows[n].MetricId;var t=o.document.createElement("a");t.href="data:text/json;charset=utf-8,"+o.encodeURIComponent(angular.toJson({name:a.name,description:a.description,table:a.table,conditions:a.conditions,joins:a.joins,fields:e.rows})),t.download=a.name+".json",t.target="_self",t.click(),m.success({title:"Report downloaded!",msg:a.name?a.name+" has been downloaded!":""})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the report?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete report").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){b(e)},function(){console.log("CANCEL")})},p.success=h,p.getReports=f,p.createOrEditReport=function(e,n){i.show({controller:"CreateOrEditReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:n,reports:p.reports.rows,apiName:p.apiName,currentNode:p.currentNode,setting:null,crudPermissions:p.crudPermissions}})},p.importReport=function(e,n,t){if("application/json"===e.file.type){var a=new FileReader;a.onload=function(e){console.log(e.target.result);try{var t=atob(e.target.result.split(",")[1]);t=angular.fromJson(t),d.analyticCustomReport.save({name:t.name,description:t.description,table:t.table,conditions:t.conditions,joins:t.joins,parent:p.currentNode.id}).$promise.then(function(n){p.reports.rows.unshift(n),m.success({title:"Report saved!",msg:n.name?n.name+" has been saved!":""});var e=_.map(t.fields,function(e){return _.extend({},e,{CustomReportId:n.id})});return d.analyticFieldReport.bulkCreate(e).$promise}).then(function(e){m.success({title:"Fields saved!",msg:"Fields has been saved!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETanalyticReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}catch(e){console.error(e),m.error({title:"Decode File Error",msg:e.toString()})}},a.readAsDataURL(e.file)}else m.error({title:"Format Error",msg:"Please use only json files"})},p.deleteReport=b,p.exportSelectedReports=function(){var e=angular.copy(p.selectedReports);return p.selectedReports=[],e},p.deleteSelectedReports=function(e){var n=i.confirm().title("Are you sure want to delete the selected reports?").htmlContent("<b>"+p.selectedReports.length+" selected</b> will be deleted.").ariaLabel("delete Reports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){p.selectedReports.forEach(function(e){b(e)}),p.selectedReports=[]})},p.deselectReports=function(){p.selectedReports=[]},p.selectAllReports=function(){p.selectedReports=p.reports.rows},p.treeDefaultData=c.rows[0]?angular.fromJson(c.rows[0].tree):[],p.treeCustomData=c.rows[1]?angular.fromJson(c.rows[1].tree):[],p.treeDefaultConfig=S(!1),p.treeCustomConfig=S(!0),p.treeDefaultEvents=T(!1),p.treeCustomEvents=T(!0);var g=!0,v=1;function h(e){p.reports=e||{count:0,rows:[]}}function f(){if(p.query.offset=(p.query.page-1)*p.query.limit,p.apiName)if("admin"===p.currentUser.role||p.userProfileSection.autoAssociation)p.promise=d[p.apiName].get(p.query,h).$promise;else{var a=[];p.promise=d[p.apiName].get(p.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:p.userProfileSection.id,type:"analyticDefaultReport"===p.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),h({count:t.length,rows:t})}return h(null)}):h(null)})}}function b(e){p.apiName&&d[p.apiName].delete({id:e.id}).$promise.then(function(){_.remove(p.reports.rows,{id:e.id}),p.reports.count-=1,p.reports.rows.length||p.getReports(),m.success({title:"Report deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.analyticreport.delete"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticreport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function A(e,n){p.treeDefaultInstance.jstree(!0).deselect_all(),p.treeDefaultInstance.jstree(!0).close_all(),p.currentNode=n.node,p.currentNode.custom=!0,p.currentPath=p.treeCustomInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticCustomReport",p.query.parent=n.node.id,f()}function E(e,n){p.treeCustomInstance.jstree(!0).deselect_all(),p.treeCustomInstance.jstree(!0).close_all(),p.currentNode=n.node,p.currentNode.custom=!1,p.currentPath=p.treeDefaultInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticDefaultReport",p.query.parent=n.node.id,f()}function y(e,n){var t,a,i;"rename_node"===e.type&&(a=(t=n).node.id,i="","custom"===t.node.parent?t.node.id.includes("custom_report_")||(i="custom_report_"+t.text):i=t.node.parent+"_"+t.text,p.treeCustomInstance.jstree(!0).set_id(t.node,"custom_report_"+i.toLowerCase()),t.node.a_attr.id=t.node.a_attr.id.replace(a,t.node.id),t.node.li_attr.id=t.node.id);var s=angular.toJson(p.treeCustomInstance.jstree(!0).get_json("#"));d.analyticTreeReport.update({id:2,tree:s}).$promise.then(function(){c.rows[1]&&(c.rows[1].tree=s),m.success({title:"Node Updated",msg:n.node.text?n.node.text+" has been updated!":"Node has been updated!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEanalyticTreeReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}function S(e){return{core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:e?["contextmenu","dnd","search","state","wholerow"]:["search","state","wholerow"],contextmenu:{items:function(t){var e={};return p.crudPermissions.canEdit&&_.assign(e,{create:{label:n.instant("ANALYTICS.CREATE"),action:function(){t=p.treeCustomInstance.jstree(!0).create_node(t),p.treeCustomInstance.jstree(!0).edit(t)}},rename:{_disabled:"#"===t.parent,label:n.instant("ANALYTICS.RENAME"),action:function(){p.treeCustomInstance.jstree(!0).edit(t)}}}),p.crudPermissions.canDelete&&_.assign(e,{remove:{_disabled:"#"===t.parent,label:n.instant("ANALYTICS.REMOVE"),action:function(){var e=i.confirm().title("Are you sure want to delete the node?").htmlContent("<b>"+(t.text?t.text:"Node")+"</b> and its subnode will be deleted.").ariaLabel("delete node").ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n=p.treeCustomInstance.jstree(!0).get_parent(t);n=p.treeCustomInstance.jstree(!0).get_node(n),p.treeCustomInstance.jstree(!0).delete_node(t),e=[t.id].concat(t.children_d||[]),d.analyticCustomReport.get({parent:e.join(","),fields:"id,name"}).$promise.then(function(e){e&&e.rows&&e.rows.forEach(function(e){b(e)})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEreportsByParents",msg:e.data?JSON.stringify(e.data):e.toString()})}),p.treeCustomInstance.jstree(!0).select_node(n)})}}}),e}}}}function T(e){return e?{create_node:y,rename_node:y,move_node:y,delete_node:y,select_node:A}:{select_node:E}}e.$watch("vm.query.filter",function(e,n){g?t(function(){g=!1}):(n||(v=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=v),p.getReports())}),e.$watch("vm.search",function(e,n){p.treeDefaultInstance&&p.treeDefaultInstance.jstree(!0).search(e),p.treeCustomInstance&&p.treeCustomInstance.jstree(!0).search(e)})}e.$inject=["$scope","$timeout","$document","$mdDialog","$state","$window","$translate","userProfile","userProfileSection","api","treeReports","toasty","Auth"],angular.module("app.analytics").controller("ReportsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r){var l=this;function d(){l.export={id:l.report.id,name:l.report.name,startDate:new Date(moment().startOf("day")),endDate:new Date(moment().endOf("day")),output:"xlsx",fullPath:r?r+"/"+l.report.name:l.report.name}}function c(){t.hide()}l.errors=[],l.report=angular.copy(n),l.export={},l.runReport=function(n){l.errors=[],l.exportDate=_.assign({},l.export,{startDate:moment(l.export.startDate).format("YYYY-MM-DD HH:mm:ss"),endDate:moment(l.export.endDate).format("YYYY-MM-DD HH:mm:ss")}),i[s].run(l.exportDate).$promise.then(function(e){"web"===l.export.output?t.show({controller:"WebReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/web/dialog.html",parent:angular.element(o.body),targetEvent:n,skipHide:!0,locals:{apiName:s,exportDate:l.exportDate,results:e},resolve:{columns:["apiResolver",function(e){var n={fields:"field,alias",nolimit:!0};return n["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=l.report.id,e.resolve("analyticFieldReport@get",n)}]}}):(a.success({title:"Report properly run!",msg:l.report.name?l.report.name+" has been run!":""}),c())}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.closeDialog=c,(l.refreshDate=d)()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","$document","currentPath"],angular.module("app.analytics").controller("RunReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o){var r=this;function l(e){r.results=e||{count:0,rows:[]}}r.errors=[],r.columns=a?a.rows:[],r.results=i||{rows:[],count:0},r.query={limit:10,page:1},r.closeDialog=function(){e.hide()},r.getResults=function(){o.offset=(r.query.page-1)*r.query.limit,o.limit=r.query.limit,r.promise=t[s].run(o,l).$promise},r.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n}}e.$inject=["$mdDialog","toasty","api","columns","results","apiName","exportDate"],angular.module("app.analytics").controller("WebReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_ODBC",g.odbc=angular.copy(l),g.odbcs=r,g.newOdbc=!1,g.odbc||(g.odbc={},g.title="CALLYSQUARE.NEW_ODBC",g.newOdbc=!0),g.addNewOdbc=function(){g.errors=[],d.squareOdbc.save(g.odbc).$promise.then(function(e){g.odbcs.unshift(e.toJSON()),o.success({title:"Odbc properly created",msg:g.odbc.name?g.odbc.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOdbc=function(){g.errors=[],d.squareOdbc.update({id:g.odbc.id},g.odbc).$promise.then(function(e){var n=_.find(g.odbcs,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Odbc properly saved!",msg:g.odbc.name?g.odbc.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOdbc=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The odbc will be deleted.").ariaLabel("Delete Odbc").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.squareOdbc.delete({id:g.odbc.id}).$promise.then(function(){_.remove(g.odbcs,{id:g.odbc.id}),o.success({title:"Odbc properly deleted!",msg:(g.odbc.name||"odbc")+" has been deleted!"}),v(g.odbc)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","odbcs","odbc","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditOdbcDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.odbcs=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="odbcs",f.listOrder="",f.listOrderAsc=null,f.selectedODBC=[],f.query={fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{odbc:e,odbcs:f.odbcs.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.testtestOdbc=function(e,n){return m.squareOdbc.test({id:e.id}).$promise.then(function(){p.success({title:"Square ODBC properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Square ODBC properly tested",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("odbc")+"?").htmlContent("<b>"+(e.name||"odbc")+"</b> will be deleted.").ariaLabel("delete odbc").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getODBC=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.squareOdbc.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ODBC",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOdbc=function(e,n){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{odbc:n,odbcs:f.odbcs.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOdbc=y,f.exportSelectedODBC=function(){var e=angular.copy(f.selectedODBC);return f.selectedODBC=[],e},f.deleteSelectedODBC=function(e){var n=i.confirm().title("Are you sure want to delete the selected odbcs?").htmlContent("<b>"+f.selectedODBC.length+" selected</b> will be deleted.").ariaLabel("delete Odbcs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedODBC.forEach(function(e){y(e)}),f.selectedODBC=[]})},f.deselectODBC=function(){f.selectedODBC=[]},f.selectAllODBC=function(){f.selectedODBC=f.odbcs.rows};var b=!0,A=1;function E(e){f.odbcs=e||{count:0,rows:[]}}function y(e){m.squareOdbc.delete({id:e.id}).$promise.then(function(){_.remove(f.odbcs.rows,{id:e.id}),f.odbcs.count-=1,f.odbcs.rows.length||f.getODBC(),p.success({title:_.startCase("Odbc")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareOdbc"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareOdbc",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getODBC())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","odbcs","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.callysquare").controller("OdbcsController",e)}(),function(){"use strict";function e(n,t,a,i,s,e,o,r,l,d){var c=this;function m(e){n.hide(e)}c.errors=[],c.title="CALLYSQUARE.EDIT_PROJECT",c.crudPermissions=d,c.project=angular.copy(o),c.newWindow=!0,c.projects=e,c.newProject=!1,c.openFromEditor=l,c.project||(c.project={name:"",description:""},c.title="CALLYSQUARE.NEW_PROJECT",c.newProject=!0),c.addNewProject=function(){c.errors=[],r.squareProject.save(c.project).$promise.then(function(e){return r.user.addSquareProjects({id:i.getCurrentUser().id,ids:[e.id]}).$promise,e}).then(function(e){c.projects.unshift(e),s.success({title:"Project properly created",msg:c.project.name?c.project.name+" has been created!":""}),m(e),c.openFromEditor&&(c.newWindow?t.open("/callysquare/projects/"+e.id,"_blank"):a.go("app.callysquare.projects.edit",{id:e.id}))}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveProject=function(){c.errors=[],r.squareProject.update({id:c.project.id},c.project).$promise.then(function(e){var n=_.find(c.projects,{id:e.id});n&&_.merge(n,e),s.success({title:"Project properly saved!",msg:c.project.name?c.project.name+" has been saved!":""}),m(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteProject=function(){c.errors=[];var e=n.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(event);n.show(e).then(function(){r.squareProject.delete({id:c.project.id}).$promise.then(function(){return r.squareProject.getUsers({id:c.project.id}).$promise}).then(function(e){for(var n=[],t=e.rows,a=0;a<t.length;a++)n.push(r.user.removeSquareProjects({id:i.getCurrentUser().id,ids:[c.project.id]}).$promise);return $q.all(n)}).then(function(){_.remove(c.projects,{id:c.project.id}),s.success({title:"Project properly deleted!",msg:c.project.name?c.project.name+" has been deleted!":""}),m(c.project)}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.delete"}]})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$window","$state","Auth","toasty","projects","project","api","openFromEditor","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareProjectDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S,T,I,O,C,w,R,x,N,D){var P=this,L={playback:["file_id"],answer:["timeout"],menu:["file_id","digit","response","retry"],getdigits:["file_id","variable_id","mindigit","maxdigit","retry"],getsecretdigits:["file_id","variable_id","mindigit","maxdigit","hiddendigitsnum","retry"],vswitch:["variable_id"],database:["odbc_id","query"],ext_dial:["trunk_name","phone","timeout"],set:["variable_id"],math:["variable_id"],gotoc:["context","extension","priority"],system:["command"],agi:["command"],gotoif:["condition"],saydigits:["digits"],saynumber:["number"],sayphonetic:["text"],record:["file","timeout"],goal:["goalname"],dial:["sip_id","timeout"],queue:["queue_id","timeout"],callback:["list_id","name","phone","delay"],gotoiftime:["interval_id"],voicemail:["mailbox"],subproject:["project_id"],sendSMS:["sms_account_id","to","sms_text"],sendMail:["account_id","to"],sendFax:["account_id","to","attachment_path"],google_cloud_tts:["apiKey","google_cloud_tts_text_type","text"],tts:["text"],ispeechtts:["text","key","speed"],ispeechasr:["key","timeout"],custom_app:["application"],googleasr:["key","timeout"],awspolly:["aws_access_key_id","aws_secret_access_key","text","aws_text_type"],lumenvoxtts:["text"],sestektts:["text"],lumenvoxasr:["grammar"],sestekasr:["grammar"],tildeasr:["appid","appsecret","uri"],login:["findBy"],pause:["findBy","pause_id"],unpause:["findBy"],logout:["findBy"],dialogflow:["key","text","dialogflow_language"],awslex:["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],sesteknda:["text","ndauth_url","username","password","ndassistant_url"],restapi:["url","method"],mrcpsynth:["text"],mrcprecog:["grammar"],dialogflowV2:["dialogflowV2_project_id","client_email","private_key","dialogflowV2_language","text"]},k={queue:["file_id"],database:["variable_id"],pause:["pause_id"]},M={sendMail:["to","cc","bcc"],voicemail:["mailbox"]};function U(e,n,t,a){return _.map(e,function(e){return{value:e[n],option:e[t],group:a?e[a]:void 0,canSelect:void 0===e.canSelect||e.canSelect}})}function F(){var e=Number(_.find(P.attributes,{name:"sip_id"}).value);if(!_.some(d,{id:e})&&0<e)return t.user.get({id:e,fields:"id,fullname,role"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,d.push(n),P.values.sip_id=U(d,"id","fullname","role")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_USER",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.sip_id=U(d,"id","fullname","role")}function $(){var e=Number(_.find(P.attributes,{name:"list_id"}).value);if(!_.some(E,{id:e})&&0<e)return t.cmList.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,E.push(n),P.values.list_id=U(E,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_LIST",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.list_id=U(E,"id","name")}function q(){var e=Number(_.find(P.attributes,{name:"trunk_id"}).value);if(!_.some(c,{id:e})&&0<e)return t.trunk.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,c.push(n),P.values.trunk_id=U(c,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.trunk_id=U(c,"id","name")}function G(){var e=_.find(P.attributes,{name:"trunk_name"}).value;if(!_.some(c,{name:e})&&e)return t.trunk.get({name:e,fields:"id,name"}).$promise.then(function(e){if(0<e.count&&0<e.rows.length){var n=e.rows[0];n.canSelect=!1,c.push(n),P.values.trunk_name=U(c,"name","name")}}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.trunk_name=U(c,"name","name")}function H(){var e=Number(_.find(P.attributes,{name:"queue_id"}).value);if(!_.some(m,{id:e})&&0<e)return t.voiceQueue.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,m.push(n),P.values.queue_id=U(m,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_QUEUE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.queue_id=U(m,"id","name")}function V(){var e=Number(_.find(P.attributes,{name:"file_id"}).value);if(!_.some(u,{id:e})&&0<e)return t.sound.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,u.push(n),P.values.file_id=U(u,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SOUND",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.file_id=U(u,"id","name")}function B(){var e=Number(_.find(P.attributes,{name:"variable_id"}).value);if(!_.some(p,{id:e})&&0<e)return t.variable.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,p.push(n),P.values.variable_id=U(p,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_VARIABLE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.variable_id=U(p,"id","name")}function Q(){var e=Number(_.find(P.attributes,{name:"odbc_id"}).value);if(!_.some(g,{id:e})&&0<e)return t.squareOdbc.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,g.push(n),P.values.odbc_id=U(g,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_ODBC",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.odbc_id=U(g,"id","name")}function W(){var e=Number(_.find(P.attributes,{name:"project_id"}).value);if(!_.some(v,{id:e})&&0<e)return t.squareProject.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,v.push(n),P.values.project_id=U(v,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PROJECT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.project_id=U(v,"id","name")}function j(){var e=Number(_.find(P.attributes,{name:"context"}).value);if(!_.some(h,{id:e})&&0<e)return t.voiceContext.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,h.push(n),P.values.context=U(h,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_CONTEXT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.context=U(h,"id","name")}function Y(){var e=Number(_.find(P.attributes,{name:"interval_id"}).value);if(!_.some(f,{id:e})&&0<e)return t.interval.get({id:e,fields:"id,name,IntervalId"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,f.push(n),P.values.interval_id=U(f,"id","name","IntervalId")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_INTERVAL",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.interval_id=U(f,"id","name","IntervalId")}function z(){var e=Number(_.find(P.attributes,{name:"account_id"}).value);if(!_.some(b,{id:e})&&0<e)return t.mailAccount.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,b.push(n),P.values.account_id=U(b,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_MAIL_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.account_id=U(b,"id","name")}function J(){var e=Number(_.find(P.attributes,{name:"sms_account_id"}).value);if(!_.some(O,{id:e})&&0<e)return t.smsAccount.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,O.push(n),P.values.sms_account_id=U(O,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SMS_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.sms_account_id=U(O,"id","name")}function K(){var e=Number(_.find(P.attributes,{name:"template_id"}).value);if(!_.some(A,{id:e})&&0<e)return t.template.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,A.push(n),P.values.template_id=U(A,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TEMPLATE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.template_id=U(A,"id","name")}function X(){var e=Number(_.find(P.attributes,{name:"pause_id"}).value);if(!_.some(C,{id:e})&&0<e)return t.pause.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,C.push(n),P.values.pause_id=U(C,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PAUSE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.pause_id=U(C,"id","name")}P.cellName=y.tagName,P.attributes=_.map(y.attributes,function(e){return{name:e.name,value:e.value,defaultValue:k[P.cellName]&&_.includes(k[P.cellName],e.name),required:L[P.cellName]&&_.includes(L[P.cellName],e.name),help:M[P.cellName]&&_.includes(M[P.cellName],e.name)}}),P.values={authMethod:[{value:"noauth",option:"NO AUTH"},{value:"hmac",option:"HMAC"}],answer:[{value:"yes",option:"Yes"},{value:"no",option:"No"}],ndagenerate_audio:[{value:1,option:"Yes"},{value:0,option:"No"}],ndaactivity_type:[{value:"message",option:"Message"},{value:"conversationUpdate",option:"Conversation Update"},{value:"contactRelationUpdate",option:"Contact Relation Update"},{value:"endOfConversation",option:"End of Conversation"}],hiddendigitspos:[{value:"first",option:"First"},{value:"last",option:"Last"}],recordingFormat:[{value:"wav",option:"Wav"},{value:"gsm",option:"Gsm"}],intkey:[{value:"#",option:"#"},{value:"*",option:"*"}],beep:[{value:"BEEP",option:"Yes"},{value:"NOBEEP",option:"No"}],model:e,ispeech_asr_language:i,ispeech_tts_language:o,languageCode:r,ssmlGender:[{value:"FEMALE",option:"Female"},{value:"MALE",option:"Male"}],google_tts_language:l,google_asr_language:s,google_cloud_tts_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],aws_polly_region:I,aws_polly_voice:T,aws_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],callback_priority:[{option:"Highest",value:4},{option:"High",value:3},{option:"Medium",value:2},{option:"Low",value:1},{option:"Lowest",value:0}],findBy:[{value:"internal",option:"Internal"},{value:"phone",option:"Phone"},{value:"mobile",option:"Mobile"}],dialogflow_language:w,dialogflowV2_language:R,aws_lex_region:x,method:[{value:"GET",option:"GET"},{value:"POST",option:"POST"},{value:"PUT",option:"PUT"},{value:"DELETE",option:"DELETE"}]},P.crudPermissions=D,P.onInit=function(){N.hasRole("admin")?(e={sip_id:U(d,"id","fullname","role"),trunk_name:U(c,"name","name"),trunk_id:U(c,"id","name"),queue_id:U(m,"id","name"),file_id:U(u,"id","name"),variable_id:U(p,"id","name"),odbc_id:U(g,"id","name"),project_id:U(v,"id","name"),context:U(h,"id","name"),interval_id:(t=f,a="id",i="name",s="IntervalId",o=_.filter(t,function(e){return null===e[s]}),r=[],_.forEach(o,function(n){r.push({value:n[a],option:n[i]});var e=_.filter(t,function(e){return e[s]===n.id});_.forEach(e,function(e){r.push({value:e[a],option:" - "+e[i]})})}),r),account_id:U(b,"id","name"),template_id:U(A,"id","name"),list_id:U(E,"id","name"),sms_account_id:U(O,"id","name"),pause_id:U(C,"id","name")},n=_.merge(P.values,e),P.values=n):function(){for(var e=["sip_id","trunk_name","trunk_id","queue_id","file_id","variable_id","odbc_id","project_id","context","interval_id","account_id","template_id","list_id","sms_account_id","pause_id"],n=0;n<P.attributes.length;n++)if(_.includes(e,P.attributes[n].name))switch(P.attributes[n].name){case"sip_id":F();break;case"trunk_name":G();break;case"trunk_id":q();break;case"queue_id":H();break;case"file_id":V();break;case"variable_id":B();break;case"odbc_id":Q();break;case"project_id":W();break;case"context":j();break;case"interval_id":Y();break;case"account_id":z();break;case"template_id":K();break;case"list_id":$();break;case"sms_account_id":J();break;case"pause_id":X()}}();var e,n,t,a,i,s,o,r},P.closeDialog=function(e){e&&S(P.attributes),n.hide()},P.getMap=U}e.$inject=["$mdDialog","api","toasty","ispeechAsrModel","ispeechAsrLanguage","googleAsrLanguage","ispeechTtsLanguage","googleCloudTtslanguageCode","googleTtsLanguage","users","trunks","queues","sounds","variables","databases","projects","contexts","intervals","mailAccounts","templates","lists","cell","saveCallback","awsPollyVoice","awsPollyRegion","smsAccounts","pauses","dialogFlowLanguage","dialogFlowV2Language","awsLexRegion","Auth","crudPermissions"],angular.module("app.callysquare").controller("MxGraphDialogController",e)}(),function(){"use strict";angular.module("app.callysquare").directive("stringToNumber",function(){return{require:"ngModel",link:function(e,n,t,a){a.$parsers.push(function(e){return""+e}),a.$formatters.push(function(e){return parseFloat(e)})}}})}(),function(){"use strict";angular.module("app.callysquare").factory("ispeechAsrModel",function(){return[{value:"0",option:"Default"},{value:"date",option:"Date"},{value:"usmoney",option:"US Money"},{value:"numbersto9",option:"Numbers to 9"},{value:"numbersto99",option:"Numbers to 99"},{value:"numbersto999",option:"Numbers to 999"},{value:"time",option:"Time"},{value:"phonenumber",option:"Phone number"},{value:"streets",option:"Streets"},{value:"citystate",option:"US City/States"}]}).factory("ispeechAsrLanguage",function(){return[{value:"en-US",option:"English (US)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (UK)"},{value:"en-AU",option:"English (Australia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"it-IT",option:"Italian (Italy) / Finnish (Finland)"},{value:"fr-FR",option:"German (Germany)"},{value:"fr-CA",option:"French (Canada)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ca-ES",option:"Catalan (Catalan)"},{value:"zh-TW",option:"Chinese (Taiwan)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"ko-KR",option:"Korean (Korea)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"zh-CN",option:"Chinese (China)"},{value:"zh-HK",option:"Chinese (Hong Kong)"}]}).factory("ispeechTtsLanguage",function(){return[{value:"usenglishfemale",option:"US English Female"},{value:"usenglishmale",option:"US English Male"},{value:"ukenglishfemale",option:"UK English Female"},{value:"ukenglishmale",option:"UK English Male"},{value:"auenglishfemale",option:"Australian English"},{value:"usspanishfemale",option:"US Spanish Female"},{value:"usspanishmale",option:"US Spanish Male"},{value:"chchinesefemale",option:"Chinese Female"},{value:"chchinesemale",option:"Chinese Male"},{value:"hkchinesefemale",option:"Hong Kong Cantonese Female"},{value:"twchinesefemale",option:"Taiwan Chinese Female"},{value:"jpjapanesefemale",option:"Japanese Female"},{value:"jpjapanesemale",option:"Japanese Male"},{value:"krkoreanfemale",option:"Korean Female"},{value:"krkoreanmale",option:"Korean Male"},{value:"caenglishfemale",option:"Canadian English Female"},{value:"huhungarianfemale",option:"Hungarian Female"},{value:"brportuguesefemale",option:"Brazilian Portuguese Female"},{value:"eurportuguesefemale",option:"European Portuguese Female"},{value:"eurportuguesemale",option:"European Portuguese Male"},{value:"eurspanishfemale",option:"European Spanish Female"},{value:"eurspanishmale",option:"European Spanish Male"},{value:"eurcatalanfemale",option:"European Catalan Female"},{value:"eurczechfemale",option:"European Czech Female"},{value:"eurdanishfemale",option:"European Danish Female"},{value:"eurfinnishfemale",option:"European Finnish Female"},{value:"eurfrenchfemale",option:"European French Female"},{value:"eurfrenchmale",option:"European French Male"},{value:"eurnorwegianfemale",option:"European Norwegian Female"},{value:"eurdutchfemale",option:"European Dutch Female"},{value:"eurpolishfemale",option:"European Polish Female"},{value:"euritalianfemale",option:"European Italian Female"},{value:"euritalianmale",option:"European Italian Male"},{value:"eurturkishfemale",option:"European Turkish Female"},{value:"eurturkishmale",option:"European Turkish Male"},{value:"eurgermanfemale",option:"European German Female"},{value:"eurgermanmale",option:"European German Male"},{value:"rurussianfemale",option:"Russian Female"},{value:"rurussianmale",option:"Russian Male"},{value:"swswedishfemale",option:"Swedish Female"},{value:"cafrenchfemale",option:"Canadian French Female"},{value:"cafrenchmale",option:"Canadian French Male"}]}).factory("googleCloudTtslanguageCode",function(){return[{value:"af-ZA",option:"Afrikaans (South Africa)"},{value:"ar-XA",option:"Arabic"},{value:"bn-IN",option:"Bengali (India)"},{value:"bg-BG",option:"Bulgarian (Bulgaria)"},{value:"ca-ES",option:"Catalan (Spain)"},{value:"yue-HK",option:"Chinese (Hong Kong)"},{value:"cs-CZ",option:"Czech (Czech Republic)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"nl-BE",option:"Dutch (Belgium)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"en-AU",option:"English (Australian)"},{value:"en-IN",option:"English (India)"},{value:"en-GB",option:"English (UK)"},{value:"en-US",option:"English (US)"},{value:"fi-FI",option:"Finnish (Finland)"},{value:"fil-PH",option:"Filipino (Philippines)"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"French (France)"},{value:"de-DE",option:"German (Germany)"},{value:"el-GR",option:"Greek (Greece)"},{value:"gu-IN",option:"Gujarati (India)"},{value:"hi-IN",option:"Hindi (India)"},{value:"hu-HU",option:"Hungarian (Hungary)"},{value:"is-IS",option:"Icelandic (Iceland)"},{value:"id-ID",option:"Indonesian (Indonesia)"},{value:"it-IT",option:"Italian (Italy)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"kn-IN",option:"Kannada (India)"},{value:"ko-KR",option:"Korean (South Korea)"},{value:"lv-LV",option:"Latvian (Latvia)"},{value:"ms-MY",option:"Malay (Malaysia)"},{value:"ml-IN",option:"Malayalam (India)"},{value:"cmn-CN",option:"Mandarin Chinese"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ro-RO",option:"Romanian (Romania)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sr-RS",option:"Serbian (Cyrillic)"},{value:"sk-SK",option:"Slovak (Slovakia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-US",option:"Spanish (US)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"ta-IN",option:"Tamil (India)"},{value:"te-IN",option:"Telugu (India)\t"},{value:"th-TH",option:"Thai (Thailand)"},{value:"tr-TR",option:"Turkish (Turkey)"},{value:"uk-UA",option:"Ukrainian (Ukraine)"},{value:"vi-VN",option:"Vietnamese (Vietnam)"}]}).factory("googleTtsLanguage",function(){return[{value:"af",option:"Afrikaans"},{value:"sq",option:"Albanian"},{value:"am",option:"Amharic"},{value:"ar",option:"Arabic"},{value:"hy",option:"Armenian"},{value:"az",option:"Azerbaijani"},{value:"eu",option:"Basque"},{value:"be",option:"Belarusian"},{value:"bn",option:"Bengali"},{value:"bh",option:"Bihari"},{value:"bs",option:"Bosnian"},{value:"br",option:"Breton"},{value:"bg",option:"Bulgarian"},{value:"km",option:"Cambodian"},{value:"ca",option:"Catalan"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"co",option:"Corsican"},{value:"hr",option:"Croatian"},{value:"cs",option:"Czech"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"eo",option:"Esperanto"},{value:"et",option:"Estonian"},{value:"fo",option:"Faroese"},{value:"tl",option:"Filipino"},{value:"fi",option:"Finnish"},{value:"fr",option:"French"},{value:"fy",option:"Frisian"},{value:"gl",option:"Galician"},{value:"ka",option:"Georgian"},{value:"de",option:"German"},{value:"el",option:"Greek"},{value:"gn",option:"Guarani"},{value:"gu",option:"Gujarati"},{value:"xx-hacker",option:"Hacker"},{value:"ha",option:"Hausa"},{value:"iw",option:"Hebrew"},{value:"hi",option:"Hindi"},{value:"hu",option:"Hungarian"},{value:"is",option:"Icelandic"},{value:"id",option:"Indonesian"},{value:"ia",option:"Interlingua"},{value:"ga",option:"Irish"},{value:"it",option:"Italian"},{value:"jw",option:"Javanese"},{value:"ja",option:"Japanese"},{value:"kn",option:"Kannada"},{value:"kk",option:"Kazakh"},{value:"rw",option:"Kinyarwanda"},{value:"rn",option:"Kirundi"},{value:"xx-klingon",option:"Klingon"},{value:"ku",option:"Kurdish"},{value:"ko",option:"Korean"},{value:"ky",option:"Kyrgyz"},{value:"lo",option:"Laothian"},{value:"la",option:"Latin"},{value:"lv",option:"Latvian"},{value:"ln",option:"Lingala"},{value:"lt",option:"Lithuanian"},{value:"mk",option:"Macedonian"},{value:"mg",option:"Malagasy"},{value:"ml",option:"Malayalam"},{value:"mt",option:"Maltese"},{value:"mi",option:"Maori"},{value:"mr",option:"Marathi"},{value:"mo",option:"Moldavian"},{value:"mn",option:"Mongolian"},{value:"sr-ME",option:"Montenegrin"},{value:"ne",option:"Nepali"},{value:"no",option:"Norwegian"},{value:"nn",option:"Norwegian (Nynorsk)"},{value:"oc",option:"Occitan"},{value:"or",option:"Oriya"},{value:"om",option:"Oromo"},{value:"ps",option:"Pashto"},{value:"fa",option:"Persian"},{value:"xx-pirate",option:"Pirate"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"pa",option:"Punjabi"},{value:"qu",option:"Quechua"},{value:"ro",option:"Romanian"},{value:"rm",option:"Romansh"},{value:"ru",option:"Russian"},{value:"gd",option:"Scots Gaelic"},{value:"sr",option:"Serbian"},{value:"sh",option:"Serbo-Croatian"},{value:"st",option:"Sesotho"},{value:"sn",option:"Shona"},{value:"sd",option:"Sindhi"},{value:"si",option:"Sinhalese"},{value:"sk",option:"Slovak"},{value:"sl",option:"Slovenian"},{value:"so",option:"Somali"},{value:"es",option:"Spanish"},{value:"su",option:"Sundanese"},{value:"sw",option:"Swahili"},{value:"sv",option:"Swedish"},{value:"tg",option:"Tajik"},{value:"ta",option:"Tamil"},{value:"tt",option:"Tatar"},{value:"te",option:"Telugu"},{value:"th",option:"Thai"},{value:"ti",option:"Tigrinya"},{value:"to",option:"Tonga"},{value:"tr",option:"Turkish"},{value:"tk",option:"Turkmen"},{value:"tw",option:"Twi"},{value:"ug",option:"Uighur"},{value:"uk",option:"Ukrainian"},{value:"ur",option:"Urdu"},{value:"uz",option:"Uzbek"},{value:"vi",option:"Vietnamese"},{value:"cy",option:"Welsh"},{value:"xh",option:"Xhosa"},{value:"yi",option:"Yiddish"},{value:"yo",option:"Yoruba"},{value:"zu",option:"Zulu"}]}).factory("googleAsrLanguage",function(){return[{option:"Afrikaans (South Africa)",value:"af-ZA"},{option:"Albanian (Albania)",value:"sq-AL"},{option:"Amharic (Ethiopia)",value:"am-ET"},{option:"Arabic (Algeria)",value:"ar-DZ"},{option:"Arabic (Bahrain)",value:"ar-BH"},{option:"Arabic (Egypt)",value:"ar-EG"},{option:"Arabic (Iraq)",value:"ar-IQ"},{option:"Arabic (Israel)",value:"ar-IL"},{option:"Arabic (Jordan)",value:"ar-JO"},{option:"Arabic (Kuwait)",value:"ar-KW"},{option:"Arabic (Lebanon)",value:"ar-LB"},{option:"Arabic (Morocco)",value:"ar-MA"},{option:"Arabic (Oman)",value:"ar-OM"},{option:"Arabic (Qatar)",value:"ar-QA"},{option:"Arabic (Saudi Arabia)",value:"ar-SA"},{option:"Arabic (State of Palestine)",value:"ar-PS"},{option:"Arabic (Tunisia)",value:"ar-TN"},{option:"Arabic (United Arab Emirates)",value:"ar-AE"},{option:"Arabic (Yemen)",value:"ar-YE"},{option:"Armenian (Armenia)",value:"hy-AM"},{option:"Azerbaijani (Azerbaijan)",value:"az-AZ"},{option:"Basque (Spain)",value:"eu-ES"},{option:"Bengali (Bangladesh)",value:"bn-BD"},{option:"Bengali (India)",value:"bn-IN"},{option:"Bosnian (Bosnia and Herzegovina)",value:"bs-BA"},{option:"Bulgarian (Bulgaria)",value:"bg-BG"},{option:"Burmese (Myanmar)",value:"my-MM"},{option:"Catalan (Spain)",value:"ca-ES"},{option:"Chinese, Cantonese (Traditional Hong Kong)",value:"yue-Hant-HK"},{option:"Chinese, Mandarin (Simplified, China)",value:"cmn-Hans-CN"},{option:"Croatian (Croatia)",value:"hr-HR"},{option:"Czech (Czech Republic)",value:"cs-CZ"},{option:"Danish (Denmark)",value:"da-DK"},{option:"Dutch (Belgium)",value:"nl-BE"},{option:"Dutch (Netherlands)",value:"nl-NL"},{option:"English (Australia)",value:"en-AU"},{option:"English (Canada)",value:"en-CA"},{option:"English (Ghana)",value:"en-GH"},{option:"English (Hong Kong)",value:"en-HK"},{option:"English (India)",value:"en-IN"},{option:"English (Ireland)",value:"en-IE"},{option:"English (Kenya)",value:"en-KE"},{option:"English (New Zealand)",value:"en-NZ"},{option:"English (Nigeria)",value:"en-NG"},{option:"English (Pakistan)",value:"en-PK"},{option:"English (Philippines)",value:"en-PH"},{option:"English (Singapore)",value:"en-SG"},{option:"English (South Africa)",value:"en-ZA"},{option:"English (Tanzania)",value:"en-TZ"},{option:"English (United Kingdom)",value:"en-GB"},{option:"English (United States)",value:"en-US"},{option:"Estonian (Estonia)",value:"et-EE"},{option:"Filipino (Philippines)",value:"fil-PH"},{option:"Finnish (Finland)",value:"fi-FI"},{option:"French (Belgium)",value:"fr-BE"},{option:"French (Canada)",value:"fr-CA"},{option:"French (France)",value:"fr-FR"},{option:"French (Switzerland)",value:"fr-CH"},{option:"Galician (Spain)",value:"gl-ES"},{option:"Georgian (Georgia)",value:"ka-GE"},{option:"German (Austria)",value:"de-AT"},{option:"German (Germany)",value:"de-DE"},{option:"German (Switzerland)",value:"de-CH"},{option:"Greek (Greece)",value:"el-GR"},{option:"Gujarati (India)",value:"gu-IN"},{option:"Hebrew (Israel)",value:"iw-IL"},{option:"Hindi (India)",value:"hi-IN"},{option:"Hungarian (Hungary)",value:"hu-HU"},{option:"Icelandic (Iceland)",value:"is-IS"},{option:"Indonesian (Indonesia)",value:"id-ID"},{option:"Italian (Italy)",value:"it-IT"},{option:"Italian (Switzerland)",value:"it-CH"},{option:"Japanese (Japan)",value:"ja-JP"},{option:"Javanese (Indonesia)",value:"jv-ID"},{option:"Kannada (India)",value:"kn-IN"},{option:"Kazakh (Kazakhstan)",value:"kk-KZ"},{option:"Khmer (Cambodia)",value:"km-KH"},{option:"Korean (South Korea)",value:"ko-KR"},{option:"Lao (Laos)",value:"lo-LA"},{option:"Latvian (Latvia)",value:"lv-LV"},{option:"Lithuanian (Lithuania)",value:"lt-LT"},{option:"Macedonian (North Macedonia)",value:"mk-MK"},{option:"Malay (Malaysia)",value:"ms-MY"},{option:"Malayalam (India)",value:"ml-IN"},{option:"Marathi (India)",value:"mr-IN"},{option:"Mongolian (Mongolia)",value:"mn-MN"},{option:"Nepali (Nepal)",value:"ne-NP"},{option:"Norwegian BokmÃ¥l (Norway)",value:"no-NO"},{option:"Persian (Iran)",value:"fa-IR"},{option:"Polish (Poland)",value:"pl-PL"},{option:"Portuguese (Brazil)",value:"pt-BR"},{option:"Portuguese (Portugal)",value:"pt-PT"},{option:"Punjabi (Gurmukhi India)",value:"pa-Guru-IN"},{option:"Romanian (Romania)",value:"ro-RO"},{option:"Russian (Russia)",value:"ru-RU"},{option:"Serbian (Serbia)",value:"sr-RS"},{option:"Sinhala (Sri Lanka)",value:"si-LK"},{option:"Slovak (Slovakia)",value:"sk-SK"},{option:"Slovenian (Slovenia)",value:"sl-SI"},{option:"Spanish (Argentina)",value:"es-AR"},{option:"Spanish (Bolivia)",value:"es-BO"},{option:"Spanish (Chile)",value:"es-CL"},{option:"Spanish (Colombia)",value:"es-CO"},{option:"Spanish (Costa Rica)",value:"es-CR"},{option:"Spanish (Dominican Republic)",value:"es-DO"},{option:"Spanish (Ecuador)",value:"es-EC"},{option:"Spanish (El Salvador)",value:"es-SV"},{option:"Spanish (Guatemala)",value:"es-GT"},{option:"Spanish (Honduras)",value:"es-HN"},{option:"Spanish (Mexico)",value:"es-MX"},{option:"Spanish (Nicaragua)",value:"es-NI"},{option:"Spanish (Panama)",value:"es-PA"},{option:"Spanish (Paraguay)",value:"es-PY"},{option:"Spanish (Peru)",value:"es-PE"},{option:"Spanish (Puerto Rico)",value:"es-PR"},{option:"Spanish (Spain)",value:"es-ES"},{option:"Spanish (United States)",value:"es-US"},{option:"Spanish (Uruguay)",value:"es-UY"},{option:"Spanish (Venezuela)",value:"es-VE"},{option:"Sundanese (Indonesia)",value:"su-ID"},{option:"Swahili (Kenya)",value:"sw-KE"},{option:"Swahili (Tanzania)",value:"sw-TZ"},{option:"Swedish (Sweden)",value:"sv-SE"},{option:"Tamil (India)",value:"ta-IN"},{option:"Tamil (Malaysia)",value:"ta-MY"},{option:"Tamil (Singapore)",value:"ta-SG"},{option:"Tamil (Sri Lanka)",value:"ta-LK"},{option:"Telugu (India)",value:"te-IN"},{option:"Thai (Thailand)",value:"th-TH"},{option:"Turkish (Turkey)",value:"tr-TR"},{option:"Ukrainian (Ukraine)",value:"uk-UA"},{option:"Urdu (India)",value:"ur-IN"},{option:"Urdu (Pakistan)",value:"ur-PK"},{option:"Uzbek (Uzbekistan)",value:"uz-UZ"},{option:"Vietnamese (Vietnam)",value:"vi-VN"},{option:"Zulu (South Africa)",value:"zu-ZA"}]}).factory("awsPollyVoice",function(){return[{value:"Zeina",option:"Zeina (Arabic, Female)"},{value:"Zhiyu",option:"Zhiyu (Chinese, Mandarin, Female)"},{value:"Naja",option:"Naja (Danish, Female)"},{value:"Mads",option:"Mads (Danish, Male)"},{value:"Lotte",option:"Lotte (Dutch, Female)"},{value:"Ruben",option:"Ruben (Dutch, Male)"},{value:"Nicole",option:"Nicole (English, Australian, Female)"},{value:"Olivia",option:"Olivia (English, Austrialian, Female)"},{value:"Russell",option:"Russell (English, Austrialian, Male)"},{value:"Amy",option:"Amy (English, British, Female)"},{value:"Emma",option:"Emma (English, British, Female)"},{value:"Brian",option:"Brian (English, British, Male)"},{value:"Aditi",option:"Aditi (English, Indian, Female)"},{value:"Raveena",option:"Raveena (English, Indian, Female)"},{value:"Aria",option:"Aria (English, New Zealand, Female)"},{value:"Ayanda",option:"Ayanda (English, South African, Female)"},{value:"Joanna",option:"Joanna (English, US, Female)"},{value:"Ivy",option:"Ivy (English, US, Female)"},{value:"Joey",option:"Joey (English, US, Male)"},{value:"Justin",option:"Justin (English, US, Male)"},{value:"Kendra",option:"Kendra (English, US, Female)"},{value:"Kimberly",option:"Kimberly (English, US, Female)"},{value:"Salli",option:"Salli (English, US, Female)"},{value:"Kevin",option:"Kevin (English, US, Male)"},{value:"Matthew",option:"Matthew (English, US, Male)"},{value:"Geraint",option:"Geraint (English, Welsh, Male)"},{value:"Celine",option:"Celine (French, Female)"},{value:"Mathieu",option:"Mathieu (French, Male)"},{value:"Léa",option:"Léa (French, Male)"},{value:"Chantal",option:"Chantal (French, Canadian, Female)"},{value:"Gabrielle",option:"Gabrielle (French, Canadian, Female)"},{value:"Vicki",option:"Vicki (German , Female)"},{value:"Hans",option:"Hans (German, Male)"},{value:"Marlene",option:"Marlene (German, Female)"},{value:"Aditi",option:"Aditi (Hindi , Female)"},{value:"Karl",option:"Karl (Icelandic, Male)"},{value:"Dora",option:"Dora (Icelandic, Female)"},{value:"Carla",option:"Carla (Italian, Female)"},{value:"Giorgio",option:"Giorgio (Italian, Male)"},{value:"Bianca",option:"Bianca (Italian, Male)"},{value:"Mizuki",option:"Mizuki (Japanese, Female)"},{value:"Takumi",option:"Takumi (Japanese, Male)"},{value:"Seoyeon",option:"Seoyeon (Korean, Female)"},{value:"Liv",option:"Liv (Norwegian, Female)"},{value:"Ewa",option:"Ewa (Polish, Female)"},{value:"Jacek",option:"Jacek (Polish, Male)"},{value:"Jan",option:"Jan (Polish, Male)"},{value:"Maja",option:"Maja (Polish, Female)"},{value:"Camila",option:"Camila (Portuguese, Brazilian, Female)"},{value:"Ricardo",option:"Ricardo (Portuguese, Brazilian, Male)"},{value:"Vitoria",option:"Vitoria (Portuguese, Brazilian, Female)"},{value:"Cristiano",option:"Cristiano (Portuguese, Male)"},{value:"Ines",option:"Ines (Portuguese, Female)"},{value:"Carmen",option:"Carmen (Romanian, Female)"},{value:"Maxim",option:"Maxim (Russian, Male)"},{value:"Tatyana",option:"Tatyana (Russian, Female)"},{value:"Conchita",option:"Conchita (Spanish, European, Female)"},{value:"Lucia",option:"Lucia (Spanish, European, Female)"},{value:"Enrique",option:"Enrique (Spanish, European, Male)"},{value:"Mia",option:"Mia (Spanish, Mexican, Female)"},{value:"Miguel",option:"Miguel (Spanish, US, Male)"},{value:"Penelope",option:"Penelope (Spanish, US, Female)"},{value:"Lupe",option:"Lupe (Spanish, US, Female)"},{value:"Astrid",option:"Astrid (Swedish, Female)"},{value:"Filiz",option:"Filiz (Turkish, Female)"},{value:"Gwyneth",option:"Gwyneth (Welsh , Female)"}]}).factory("awsPollyRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-east-2",option:"US East (Ohio)"},{value:"us-west-1",option:"US West (N. California)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"ca-central-1",option:"Canada (Central)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"eu-central-1",option:"EU (Frankfurt)"},{value:"eu-west-2",option:"EU (London)"},{value:"eu-west-3",option:"EU (Paris)"},{value:"ap-southeast-1",option:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"},{value:"ap-northeast-2",option:"Asia Pacific (Seoul)"},{value:"ap-northeast-1",option:"Asia Pacific (Tokyo)"},{value:"ap-south-1",option:"Asia Pacific (Mumbai)"},{value:"sa-east-1",option:"South America (São Paulo)"}]}).factory("awsLexRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"}]}).factory("dialogFlowLanguage",function(){return[{value:"da",option:"Danish"},{value:"en",option:"English"},{value:"de",option:"German"},{value:"it",option:"Italian"},{value:"es",option:"Spanish"},{value:"fr",option:"French"},{value:"id",option:"Indonesian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean (South Korea)"},{value:"nl",option:"Dutch"},{value:"no",option:"Norwegian"},{value:"pt",option:"Portuguese (European)"},{value:"pt-br",option:"Portuguese (Nrazilian)"},{value:"ru",option:"Russian"},{value:"sv",option:"Swedish"},{value:"th",option:"Thai"},{value:"uk",option:"Ukrainian"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-HK",option:"Chinese (Hong Kong)"},{value:"zh-TW",option:"Chinese (Traditional)"}]}).factory("dialogFlowV2Language",function(){return[{value:"zh-HK",option:"Chinese (Cantonese)"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"en-AU",option:"English (Australia)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (Great Britain)"},{value:"en-IN",option:"English (India)"},{value:"en-US",option:"English (US)"},{value:"fr",option:"French"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"France (France)"},{value:"de",option:"German"},{value:"hi",option:"Hindi"},{value:"id",option:"Indonesian"},{value:"it",option:"Italian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean"},{value:"no",option:"Norwegian"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ru",option:"Russian"},{value:"es",option:"Spanish"},{value:"es-419",option:"Spanish (Latin America)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"sw",option:"Swedish"},{value:"th",option:"Thai"},{value:"tr",option:"Turkish"},{value:"uk",option:"Ukrainian"}]})}(),function(){"use strict";function e(n,e,t,a){var i=this;i.project={preproduction:t},i.closeDialog=function(e){e?(a(i.project.preproduction),n.hide(i.project.preproduction)):n.hide()}}e.$inject=["$mdDialog","toasty","currentXML","saveCallback"],angular.module("app.callysquare").controller("MxGraphEditXMLController",e)}(),function(){"use strict";function e(n,t){var a=this;function i(e){e?(t(e),n.hide(e)):n.hide()}a.errors=[],a.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:5242880,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},a.ngFlow={flow:{}},a.dropping=!1,a.closeDialog=i,a.fileAdded=function(e){a.errors=[];_.includes(["xml"],e.getExtension())||a.errors.push({message:"The extension "+e.getExtension()+" is not supported!"});5242880<e.size&&a.errors.push({message:"The file is too big. The max allowed size is 5MB"});if(!a.errors.length){var n=new FileReader;n.onload=function(e){i(e.target.result)},n.readAsText(e.file)}}}e.$inject=["$mdDialog","saveCallback"],angular.module("app.callysquare").controller("MxGraphImportXMLController",e)}(),function(){"use strict";function e(n,t,e,a){var i=this;i.project=_.clone(e),i.closeDialog=function(){n.hide()},i.save=function(){i.errors=[],a.squareProject.update({id:i.project.id},{notes:i.project.notes,description:i.project.description}).$promise.then(function(e){t.success({title:"Project updated!",msg:i.project.name?i.project.name+" has been updated!":""}),n.hide(e)}).catch(function(e){console.error(e),i.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}]})}}e.$inject=["$mdDialog","toasty","project","api"],angular.module("app.callysquare").controller("MxGraphUpdateInfoController",e)}(),function(){"use strict";function e(n,e,t,a,i){var s=this;s.projects=t,s.id="",s.newWindow=!0,s.closeDialog=function(e){s.errors=[],e?(n.hide(),s.newWindow?a.open("/callysquare/projects/"+s.id,"_blank"):i.go("app.callysquare.projects.edit",{id:s.id})):n.hide()}}e.$inject=["$mdDialog","toasty","projects","$window","$state"],angular.module("app.callysquare").controller("MxGraphOpenProjectController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o){var r=this;function l(){return a.squareProject.getUsers({id:r.project.id,fields:"id,name,fullname,internal",nolimit:!0,role:"user"}).$promise.then(function(e){return r.selectedItems=e.rows?_.map(e.rows,function(e){return e}):[],r.dualMultiselectOptions.selectedItems=r.selectedItems,a.user.get({fields:"id,fullname,name,internal",role:"user",nolimit:!0}).$promise}).then(function(e){r.items=e.rows?_.map(e.rows,function(e){return e}):[],r.dualMultiselectOptions.items=_.differenceBy(r.items,r.selectedItems,"id")}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}r.project=n,r.penalty=0,r.items=[],r.selectedItems=[],r.closeDialog=function(){e.hide()},r.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("CALLYSQUARE.ALL_USERS"),labelSelected:s.instant("CALLYSQUARE.SELECTED_USERS"),transferCallback:function(e,n){a.squareProject[n?"removeUsers":"addUsers"]({id:r.project.id,ids:_.map(e,"id"),penalty:r.penalty||0}).$promise.then(function(){t.success({title:"Project properly "+(n?"removed":"added"),msg:"Project has been "+(n?"removed":"added")+"!"}),n||l()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:squareProjects.ADDUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},l()}e.$inject=["$mdDialog","toasty","api","project","projects","$translate","Auth"],angular.module("app.callysquare").controller("ProjectspermissionaddController",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o){var r=this;r.project=angular.copy(e),r.project.name+="_new",r.project.preproduction=a,r.newWindow=!0,r.closeDialog=function(){n.hide()},r.save=function(){delete r.project.id,i.squareProject.save(r.project).$promise.then(function(e){t.success({title:"Project properly created",msg:r.project.name?r.project.name+" has been created!":""}),n.hide(e),r.newWindow?s.open("/callysquare/projects/"+e.id,"_blank"):o.go("app.callysquare.projects.edit",{id:e.id})}).catch(function(e){console.error(e),r.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}]})}}e.$inject=["$mdDialog","toasty","project","currentXML","api","$window","$state"],angular.module("app.callysquare").controller("MxGraphSaveProjectAsController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,r,n,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S,T){var I=this;I.currentUser=T.getCurrentUser(),I.project=n||{},I.userProfileSection=S&&1==S.count?S.rows[0]:null,I.crudPermissions=T.parseCrudPermissions(I.userProfileSection?I.userProfileSection.crudPermissions:null),I.onInit=function(){new EditorUi(I,new Editor,document.getElementById("geEditor")).openString(I.project.preproduction,I.project.name,I.project)},I.saveOrPublishProject=function(e,n){var t={preproduction:e};n&&(t.production=e);r.squareProject.update({id:I.project.id},t).$promise.then(function(e){o.success({title:"Project "+(n?"published":"saved")+"!",msg:I.project.name?I.project.name+" has been "+(n?"published":"saved")+"!":""}),I.project.preproduction=e.preproduction}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsquareProject",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.openDialog=function(e,n){a.show({controller:"MxGraphDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{users:l.rows||[],trunks:d.rows||[],queues:c.rows||[],sounds:m.rows||[],variables:u.rows||[],databases:p.rows||[],contexts:g.rows||[],projects:v.rows||[],intervals:h.rows||[],mailAccounts:f.rows||[],smsAccounts:E.rows||[],pauses:y.rows||[],templates:b.rows||[],lists:A.rows||[],cell:e,saveCallback:n,crudPermissions:I.crudPermissions}})},I.newProject=function(e){a.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{project:e,projects:v.rows,openFromEditor:!0,license:null,setting:null,crudPermissions:I.crudPermissions}})},I.openProject=function(){a.show({controller:"MxGraphOpenProjectController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/open/open.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{projects:v.rows||[]}})},I.saveProjectAs=function(e){a.show({controller:"MxGraphSaveProjectAsController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{project:I.project,currentXML:e}}).then(function(e){e&&v.rows.push(e)})},I.newVariable=function(n){return i(function(a,n){return r.userProfileSection.get({userProfileId:I.currentUser.userProfileId,sectionId:1012}).$promise.then(function(e){var n=e.rows?e.rows[0]:null,t=T.parseCrudPermissions(n?n.crudPermissions:null);a(t)}).catch(function(e){n(e)})}).then(function(e){e.canEdit?a.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{variable:n,variables:u.rows,license:null,setting:null,crudPermissions:e}}):o.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE")})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:NEW_VARIABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.updateInfo=function(e){a.show({controller:"MxGraphUpdateInfoController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/info/info.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:I.project}}).then(function(e){e&&_.merge(I.project,e)})},I.editXML=function(e,n){a.show({controller:"MxGraphEditXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/edit/edit.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{currentXML:e,saveCallback:n}}).then(function(e){e&&(I.project.preproduction=e)})},I.importXML=function(e){a.show({controller:"MxGraphImportXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/import/import.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{saveCallback:e}}).then(function(e){e&&(I.project.preproduction=e)})},I.gotoProjects=function(){e.go("app.callysquare.projects",{},{reload:"app.callysquare.projects"})}}e.$inject=["$state","$document","$mdDialog","$q","$translate","toasty","api","project","users","trunks","queues","sounds","variables","databases","contexts","projects","intervals","mailAccounts","templates","lists","smsAccounts","pauses","userProfileSection","Auth"],angular.module("app.callysquare").controller("ProjectController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.projects=a||{count:0,rows:[]},p.userProfile=i,p.userProfileSection=s&&1==s.count?s.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.listOrder="",p.listOrderAsc=null,p.selectedProjects=[],p.query={fields:"id,name,description,notes",sort:"-updatedAt",limit:10,page:1},p.editstate=function(e,n){t.go("app.callysquare.projects.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.deleteconfirm=function(e,n){var t=l.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete project").targetEvent(n).ok("OK").cancel("CANCEL");l.show(t).then(function(){f(e)},function(){console.log("CANCEL")})},p.success=h,p.getProjects=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=o.squareProject.get(p.query,h).$promise:(p.query.id=p.userProfile.id,p.query.section="SquareProjects",p.promise=o.userProfile.getResources(p.query,h).$promise)},p.createOrEditProject=function(e,n){l.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(d.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:n,projects:p.projects.rows,openFromEditor:null,setting:null,crudPermissions:p.crudPermissions}})},p.deleteProject=f,p.exportSelectedProjects=function(){var e=angular.copy(p.selectedProjects);return p.selectedProjects=[],e},p.deleteSelectedProjects=function(e){var n=l.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+p.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");l.show(n).then(function(){p.selectedProjects.forEach(function(e){f(e)}),p.selectedProjects=[]})},p.deselectProjects=function(){p.selectedProjects=[]},p.selectAllProjects=function(){p.selectedProjects=p.projects.rows};var g=!0,v=1;function h(e){p.projects=e||{count:0,rows:[]}}function f(e){o.squareProject.delete({id:e.id}).$promise.then(function(){_.remove(p.projects.rows,{id:e.id}),p.projects.count-=1,p.projects.rows.length||p.getProjects(),m.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.project.delete"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.project.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){g?c(function(){g=!1}):(n||(v=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=v),p.getProjects())})}e.$inject=["$scope","$state","$mdSidenav","projects","userProfile","userProfileSection","api","msUtils","$mdDialog","$document","$timeout","toasty","Auth"],angular.module("app.callysquare").controller("ProjectsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_SQUARERECORDING",g.squareRecording=angular.copy(l),g.squareRecordings=r,g.newSquareRecording=!1,g.squareRecording||(g.squareRecording={},g.title="CALLYSQUARE.NEW_SQUARERECORDING",g.newSquareRecording=!0),g.addNewSquareRecording=function(){g.errors=[],d.squareRecording.save(g.squareRecording).$promise.then(function(e){g.squareRecordings.unshift(e.toJSON()),o.success({title:"SquareRecording properly created",msg:g.squareRecording.name?g.squareRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSquareRecording=function(){g.errors=[],d.squareRecording.update({id:g.squareRecording.id},g.squareRecording).$promise.then(function(e){var n=_.find(g.squareRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SquareRecording properly saved!",msg:g.squareRecording.name?g.squareRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSquareRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The squareRecording will be deleted.").ariaLabel("Delete SquareRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.squareRecording.delete({id:g.squareRecording.id}).$promise.then(function(){_.remove(g.squareRecordings,{id:g.squareRecording.id}),o.success({title:"SquareRecording properly deleted!",msg:(g.squareRecording.name||"squareRecording")+" has been deleted!"}),v(g.squareRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","squareRecordings","squareRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareRecordingDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.squareRecordings=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="squareRecordings",f.listOrder="",f.listOrderAsc=null,f.selectedSquareRecordings=[],f.query={fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,page:1},f.downloadfile2=function(s,e){return m.squareRecording.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid+s.format;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("squareRecording")+"?").htmlContent("<b>"+(e.name||"squareRecording")+"</b> will be deleted.").ariaLabel("delete squareRecording").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSquareRecordings=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.squareRecording.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SquareRecordings",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSquareRecording=function(e,n){i.show({controller:"CreateOrEditSquareRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/squareRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{squareRecording:n,squareRecordings:f.squareRecordings.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSquareRecording=y,f.exportSelectedSquareRecordings=function(){var e=angular.copy(f.selectedSquareRecordings);return f.selectedSquareRecordings=[],e},f.deleteSelectedSquareRecordings=function(e){var n=i.confirm().title("Are you sure want to delete the selected squareRecordings?").htmlContent("<b>"+f.selectedSquareRecordings.length+" selected</b> will be deleted.").ariaLabel("delete SquareRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSquareRecordings.forEach(function(e){y(e)}),f.selectedSquareRecordings=[]})},f.deselectSquareRecordings=function(){f.selectedSquareRecordings=[]},f.selectAllSquareRecordings=function(){f.selectedSquareRecordings=f.squareRecordings.rows};var b=!0,A=1;function E(e){f.squareRecordings=e||{count:0,rows:[]}}function y(e){m.squareRecording.delete({id:e.id}).$promise.then(function(){_.remove(f.squareRecordings.rows,{id:e.id}),f.squareRecordings.count-=1,f.squareRecordings.rows.length||f.getSquareRecordings(),p.success({title:_.startCase("SquareRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSquareRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","squareRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.callysquare").controller("SquareRecordingsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chatQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chatQueues",f.listOrder="",f.listOrderAsc=null,f.selectedChatQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.chat.chatQueues.edit",{id:e.id,chatQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:f.chatQueues?f.chatQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:f.chatQueues?f.chatQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chatQueue")+"?").htmlContent("<b>"+(e.name||"chatQueue")+"</b> will be deleted.").ariaLabel("delete chatQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.chat.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.chat.realtime.queues",{})}},f.success=E,f.getChatQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.chatQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChatQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditChatQueue=function(e,n){i.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:n,chatQueues:f.chatQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteChatQueue=y,f.exportSelectedChatQueues=function(){var e=angular.copy(f.selectedChatQueues);return f.selectedChatQueues=[],e},f.deleteSelectedChatQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected chatQueues?").htmlContent("<b>"+f.selectedChatQueues.length+" selected</b> will be deleted.").ariaLabel("delete ChatQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChatQueues.forEach(function(e){y(e)}),f.selectedChatQueues=[]})},f.deselectChatQueues=function(){f.selectedChatQueues=[]},f.selectAllChatQueues=function(){f.selectedChatQueues=f.chatQueues.rows};var b=!0,A=1;function E(e){f.chatQueues=e||{count:0,rows:[]}}function y(e){m.chatQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.chatQueues.rows,{id:e.id}),f.chatQueues.count-=1,f.chatQueues.rows.length||f.getChatQueues(),p.success({title:_.startCase("ChatQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChatQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.chat").controller("ChatQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATQUEUE",g.chatQueue=angular.copy(l),g.chatQueues=r,g.newChatQueue=!1,g.chatQueue||(g.chatQueue={strategy:"beepall",timeout:10},g.title="CHAT.NEW_CHATQUEUE",g.newChatQueue=!0),g.addNewChatQueue=function(){g.errors=[],d.chatQueue.save(g.chatQueue).$promise.then(function(e){g.chatQueues.unshift(e.toJSON()),o.success({title:"ChatQueue properly created",msg:g.chatQueue.name?g.chatQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatQueue=function(){g.errors=[],d.chatQueue.update({id:g.chatQueue.id},g.chatQueue).$promise.then(function(e){var n=_.find(g.chatQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatQueue properly saved!",msg:g.chatQueue.name?g.chatQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatQueue will be deleted.").ariaLabel("Delete ChatQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatQueue.delete({id:g.chatQueue.id}).$promise.then(function(){_.remove(g.chatQueues,{id:g.chatQueue.id}),o.success({title:"ChatQueue properly deleted!",msg:(g.chatQueue.name||"chatQueue")+" has been deleted!"}),v(g.chatQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatQueues","chatQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatQueue.getAgents({id:c.chatQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.chatQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.removeAgents({id:c.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.addAgents({id:c.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","chatQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatQueue.getTeams({id:l.chatQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.chatQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("CHAT.ALL_TEAMS"),labelSelected:t.instant("CHAT.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.removeTeams({id:l.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.addTeams({id:l.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.chatQueue=c||e.params.chatQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoChatQueues=function(){e.go("app.chat.chatQueues",{},{reload:"app.chat.chatQueues"})},u.saveChatQueue=function(){r.chatQueue.update({id:u.chatQueue.id},u.chatQueue).$promise.then(function(){l.success({title:"ChatQueue updated!",msg:u.chatQueue.name?u.chatQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatQueue","userProfileSection"],angular.module("app.chat").controller("ChatQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chatWebsites=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chatWebsites",f.listOrder="",f.listOrderAsc=null,f.selectedChatWebsites=[],f.query={fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,page:1},f.arrayagentIdentifier=_.keyBy([{option:"WebsiteAlias",value:"'website_alias'"},{option:"AgentAlias",value:"'agent_alias'"},{option:"AgentFullname",value:"'agent_fullname'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayheader_shape=_.keyBy([{option:"Rounded",value:"'rounded'"},{option:"Squared",value:"'squared'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayalignment=_.keyBy([{option:"bottom_right",value:"'bottom_right'"},{option:"right",value:"'right'"},{option:"left",value:"'left'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymessagesAlignment=_.keyBy([{option:"alternate",value:"'alternate'"},{option:"centered",value:"'centered'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayratingType=_.keyBy([{option:"Star",value:"'star'"},{option:"Thumb",value:"'thumb'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,chatWebsite:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,tab:10})},f.offlinemessagesgoto=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,tab:11})},f.agentadddialog=function(e,n){i.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:f.chatWebsites?f.chatWebsites.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chatWebsite")+"?").htmlContent("<b>"+(e.name||"chatWebsite")+"</b> will be deleted.").ariaLabel("delete chatWebsite").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getChatWebsites=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.chatWebsite.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChatWebsites",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditChatWebsite=function(e,n){i.show({controller:"CreateOrEditChatWebsiteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:n,chatWebsites:f.chatWebsites.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteChatWebsite=y,f.exportSelectedChatWebsites=function(){var e=angular.copy(f.selectedChatWebsites);return f.selectedChatWebsites=[],e},f.deleteSelectedChatWebsites=function(e){var n=i.confirm().title("Are you sure want to delete the selected chatWebsites?").htmlContent("<b>"+f.selectedChatWebsites.length+" selected</b> will be deleted.").ariaLabel("delete ChatWebsites").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChatWebsites.forEach(function(e){y(e)}),f.selectedChatWebsites=[]})},f.deselectChatWebsites=function(){f.selectedChatWebsites=[]},f.selectAllChatWebsites=function(){f.selectedChatWebsites=f.chatWebsites.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.chatWebsite&&(t=_.find(f.lists,{id:Number(f.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.chatWebsite&&(a=_.find(f.lists,{id:Number(f.chatWebsite.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.chatWebsite&&(t=_.find(f.interval,{id:Number(f.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.chatWebsite&&(a=_.find(f.interval,{id:Number(f.chatWebsite.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.chatWebsites=e||{count:0,rows:[]}}function y(e){m.chatWebsite.delete({id:e.id}).$promise.then(function(){_.remove(f.chatWebsites.rows,{id:e.id}),f.chatWebsites.count-=1,f.chatWebsites.rows.length||f.getChatWebsites(),p.success({title:_.startCase("ChatWebsite")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChatWebsites())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatWebsites","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.chat").controller("ChatWebsitesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATWEBSITE",g.chatWebsite=angular.copy(l),g.chatWebsites=r,g.newChatWebsite=!1,g.chatWebsite||(g.chatWebsite={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),header_shape:"rounded",alignment:"bottom_right",verticalAlignment:30,labelText:"CHAT",messagesAlignment:"alternate",IntervalId:"null",timezone:"null",waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300,vidaooTopic:"Generated by XCALLY Motion",vidaooNote:"Meeting generated for interaction #{{interaction.id}} by {{agent.name}}"},g.title="CHAT.NEW_CHATWEBSITE",g.newChatWebsite=!0),n.params.id&&(g.chatWebsite.ChatWebsiteId=n.params.id),g.addNewChatWebsite=function(){g.errors=[],d.chatWebsite.save(g.chatWebsite).$promise.then(function(e){g.chatWebsites.unshift(e.toJSON()),o.success({title:"ChatWebsite properly created",msg:g.chatWebsite.name?g.chatWebsite.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatWebsite=function(){g.errors=[],d.chatWebsite.update({id:g.chatWebsite.id},g.chatWebsite).$promise.then(function(e){var n=_.find(g.chatWebsites,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatWebsite properly saved!",msg:g.chatWebsite.name?g.chatWebsite.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatWebsite=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatWebsite will be deleted.").ariaLabel("Delete ChatWebsite").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatWebsite.delete({id:g.chatWebsite.id}).$promise.then(function(){_.remove(g.chatWebsites,{id:g.chatWebsite.id}),o.success({title:"ChatWebsite properly deleted!",msg:(g.chatWebsite.name||"chatWebsite")+" has been deleted!"}),v(g.chatWebsite)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.chatWebsite&&(t=_.find(g.lists,{id:Number(g.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.chatWebsite&&(a=_.find(g.lists,{id:Number(g.chatWebsite.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.chatWebsite&&(t=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.chatWebsite&&(a=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatWebsites","chatWebsite","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatWebsiteDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.chatWebsiteApps.rows.length){var t=r.chatWebsiteApps.rows[n]?r.chatWebsiteApps.rows[n]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsiteApp:t,chatWebsite:r.chatWebsite,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.chatWebsiteApps.rows[n]=e:r.chatWebsiteApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.chatWebsiteApps.rows.length;t++,0){var a=r.chatWebsiteApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.chatWebsite.context,a.exten=r.chatWebsite.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.chatWebsite.addApplications({id:r.chatWebsite.id},_.sortBy(n,"priority")).$promise.then(function(e){r.chatWebsiteApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.chatWebsiteApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.chatWebsite={},r.chatWebsiteApps={count:0,rows:[]},r.selectedChatWebsiteApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"ChatQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"chatQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:501}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",role:"agent",sort:"name",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"tvox",appType:"tvox",type:"tvox",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"serviceid",name:"serviceid",type:"text",param:0},{title:"channelid",name:"channelid",type:"text",param:1},{title:"tvoxurl",name:"tvoxurl",type:"text",param:2},{title:"tvoxloginurl",name:"tvoxloginurl",type:"text",param:3},{title:"tvoxsessionurl",name:"tvoxsessionurl",type:"text",param:4},{title:"tvoxusername",name:"tvoxusername",type:"text",param:5},{title:"tvoxpasswd",name:"tvoxpasswd",type:"password",param:6},{title:"motionurlonring",name:"motionurlonring",type:"text",param:7},{title:"motionurlonanswer",name:"motionurlonanswer",type:"text",param:8},{title:"motiontitle",name:"motiontitle",type:"text",param:9},{title:"motionurl",name:"motionurl",type:"text",param:10}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.chatWebsite=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getChatWebsiteApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.chatWebsiteApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getChatWebsiteApps=function(){r.promise=o.chatWebsite.getApplications(r.query,t).$promise},r.editChatWebsiteApp=n,r.editInterval=function(e,n){if(r.chatWebsiteApps.rows.length){var t=r.chatWebsiteApps.rows[n]?r.chatWebsiteApps.rows[n]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteChatWebsiteApp=function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedChatWebsiteApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedChatWebsiteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedChatWebsiteApps.forEach(function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id})}),r.selectedChatWebsiteApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatWebsite.getAgents({id:c.chatWebsite.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserChatWebsite?"penalty "+e.UserChatWebsite.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.chatWebsite=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatWebsite.removeAgents({id:c.chatWebsite.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatWebsite.addAgents({id:c.chatWebsite.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","chatWebsite","chatWebsites","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatWebsiteagentaddController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsiteagentAvatarController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditChatWebsiteAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("chat")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:501}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptagDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tvox=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tvox.appdata)switch(l.tvox.appType?l.tvox.appType.toLowerCase():l.tvox.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tvox.appdata.split(",");l.tvox.key=d[0],l.tvox.language=d[1],l.tvox.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tvox.appdata.split(",");l.tvox.projectId=d[0],l.tvox.clientEmail=d[1],l.tvox.privateKey=d[2],l.tvox.language=d[3],l.tvox.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tvox.appdata.split(",");l.tvox.accesskeyid=d[0],l.tvox.secretaccesskey=d[1],l.tvox.lexregion=d[2],l.tvox.botname=d[3],l.tvox.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tvox.appdata.split(",");l.tvox.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tvox.text=d.slice(1,d.length).join(",");break;case"message":l.tvox.text=l.tvox.appdata;break;case"set":l.tvox.name=l.tvox.appdata.split("=")[0],l.tvox.value=l.tvox.appdata.split("=")[1];break;case"agi":l.tvox.project=l.tvox.appdata;break;default:var c=l.tvox.appdata.split(",");l.tvox.serviceid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.tvox.channelid=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.tvox.tvoxurl=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.tvox.tvoxloginurl=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.tvox.tvoxsessionurl=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10),l.tvox.tvoxusername=_.isEmpty(c[5])?c[5]:isNaN(c[5])?c[5]:parseInt(c[5],10),l.tvox.tvoxpasswd=_.isEmpty(c[6])?c[6]:isNaN(c[6])?c[6]:parseInt(c[6],10),l.tvox.motionurlonring=_.isEmpty(c[7])?c[7]:isNaN(c[7])?c[7]:parseInt(c[7],10),l.tvox.motionurlonanswer=_.isEmpty(c[8])?c[8]:isNaN(c[8])?c[8]:parseInt(c[8],10),l.tvox.motiontitle=_.isEmpty(c[9])?c[9]:isNaN(c[9])?c[9]:parseInt(c[9],10),l.tvox.motionurl=_.isEmpty(c[10])?c[10]:isNaN(c[10])?c[10]:parseInt(c[10],10)}function m(e){n.hide(e)}l.tvox.type&&"outbound"===l.tvox.type.toLowerCase()&&"outbounddial"===l.tvox.appType.toLowerCase()&&(l.tvox.prefix=l.tvox.phone?l.tvox.phone.split("$")[0]:void 0,l.tvox.callerId=l.tvox.callerID?"CALLERID(all)="+l.tvox.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tvox.type&&"outbound"===l.tvox.type.toLowerCase()&&"outboundDial"===l.tvox.appType&&(l.tvox.phone=i.cutdigits?(l.tvox.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tvox.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tvox.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tvox.options+="U(xcally-mixmonitor-context)"):l.tvox.options=l.tvox.options.replace("U(xcally-mixmonitor-context)",""));if(l.tvox.appType&&"custom"===l.tvox.appType);else switch((l.tvox.app||l.tvox.appType).toLowerCase()){case"set":l.tvox.appdata=l.tvox.name+"="+l.tvox.value;break;case"custom":break;default:e[0]=l.tvox.serviceid,e[1]=l.tvox.channelid,e[2]=l.tvox.tvoxurl,e[3]=l.tvox.tvoxloginurl,e[4]=l.tvox.tvoxsessionurl,e[5]=l.tvox.tvoxusername,e[6]=l.tvox.tvoxpasswd,e[7]=l.tvox.motionurlonring,e[8]=l.tvox.motionurlonanswer,e[9]=l.tvox.motiontitle,e[10]=l.tvox.motionurl,l.tvox.appdata=e.join(",")}m(l.tvox)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptvoxDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteChatCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteChatCannedAnswers.rows,{id:e.id}),m.chatWebsiteChatCannedAnswers.count-=1,m.chatWebsiteChatCannedAnswers.rows.length||p(),l.success({title:"ChatCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteChatCannedAnswers={count:0,rows:[]},m.selectedChatWebsiteChatCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the chatCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("chatCannedAnswer #")+e.id||"chatCannedAnswer")+"</b> will be deleted.").ariaLabel("delete chatCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteChatCannedAnswers=p,m.createOrEditChatWebsiteChatCannedAnswer=function(e,n){o.show({controller:"CreateOrEditChatCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,chatCannedAnswer:n,chatCannedAnswers:m.chatWebsiteChatCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedChatWebsiteChatCannedAnswers=function(){var e=angular.copy(m.selectedChatWebsiteChatCannedAnswers);return m.selectedChatWebsiteChatCannedAnswers=[],e},m.deleteChatWebsiteChatCannedAnswer=g,m.deleteSelectedChatWebsiteChatCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected chatCannedAnswers?").htmlContent("<b>"+m.selectedChatWebsiteChatCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete chatCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteChatCannedAnswers.forEach(function(e){g(e)}),m.selectedChatWebsiteChatCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATCANNEDANSWER",g.chatCannedAnswer=angular.copy(l),g.chatCannedAnswers=r,g.newChatCannedAnswer=!1,g.chatCannedAnswer||(g.chatCannedAnswer={},g.title="CHAT.NEW_CHATCANNEDANSWER",g.newChatCannedAnswer=!0),n.params.id&&(g.chatCannedAnswer.ChatWebsiteId=n.params.id),g.addNewChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.chatCannedAnswer).$promise.then(function(e){g.chatCannedAnswers.unshift(e.toJSON()),o.success({title:"ChatCannedAnswer properly created",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.chatCannedAnswer.id},g.chatCannedAnswer).$promise.then(function(e){var n=_.find(g.chatCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatCannedAnswer properly saved!",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatCannedAnswer will be deleted.").ariaLabel("Delete ChatCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.chatCannedAnswer.id}).$promise.then(function(){_.remove(g.chatCannedAnswers,{id:g.chatCannedAnswer.id}),o.success({title:"ChatCannedAnswer properly deleted!",msg:(g.chatCannedAnswer.name||"chatCannedAnswer")+" has been deleted!"}),v(g.chatCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatCannedAnswers","chatCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.chatWebsite.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.chatWebsite=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.chatWebsite.id,field:"ChatWebsiteId",route:"chatWebsite"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteDispositionsController",e)}(),function(){"use strict";function e(t,e,a){var i=this;i.chatWebsite={},i.offlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"},{type:"upload",name:"Upload",icon:"icon-upload"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.offlineForm)&&(i.chatWebsite.offlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var n=0;n<e.rows.length;n++)i.customFields.push({key:"cf_"+e.rows[n].id,value:e.rows[n].alias});return a.cmContact.describe().$promise}).then(function(e){for(var n=_.keys(e),t=0;t<n.length;t++)_.includes(i.uselessFields,n[t])||_.startsWith(n[t],"cf_")||i.fields.unshift({key:n[t],value:n[t]});return a.variable.get().$promise}).then(function(e){return i.variables=e.rows,a.mailAccount.get({fields:"id,name",raw:!0}).$promise.then(function(e){i.email_accounts=e.rows})}).catch(function(e){console.error(e)})},i.up=function(e,n){if(0!==n){var t=i.chatWebsite.offlineForm.items[n-1];i.chatWebsite.offlineForm.items[n]=t,i.chatWebsite.offlineForm.items[n-1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===n?i.chatWebsite.offlineForm.fromKey--:i.chatWebsite.offlineForm.fromKey===n-1&&i.chatWebsite.offlineForm.fromKey++}},i.down=function(e,n){if(n!==i.chatWebsite.offlineForm.items.length-1){var t=i.chatWebsite.offlineForm.items[n+1];i.chatWebsite.offlineForm.items[n]=t,i.chatWebsite.offlineForm.items[n+1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===n?i.chatWebsite.offlineForm.fromKey++:i.chatWebsite.offlineForm.fromKey===n+1&&i.chatWebsite.offlineForm.fromKey--}},i.add=function(e){i.chatWebsite.offlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var n=t.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");t.show(n).then(function(){i.chatWebsite.offlineForm.items.splice(e,1)})},i.card_type="offline",i.email_accounts=[]}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteofflineFormController",e)}(),function(){"use strict";function e(t,e,a){var i=this;i.chatWebsite={},i.onlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.onlineForm)&&(i.chatWebsite.onlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var n=0;n<e.rows.length;n++)i.customFields.push({key:"cf_"+e.rows[n].id,value:e.rows[n].alias});return a.cmContact.describe().$promise}).then(function(e){for(var n=_.keys(e),t=0;t<n.length;t++)_.includes(i.uselessFields,n[t])||_.startsWith(n[t],"cf_")||i.fields.unshift({key:n[t],value:n[t]});return a.variable.get().$promise}).then(function(e){return i.variables=e.rows,a.mailAccount.get({fields:"id,name",raw:!0}).$promise.then(function(e){i.email_accounts=e.rows})}).catch(function(e){console.error(e)})},i.up=function(e,n){if(0!==n){var t=i.chatWebsite.onlineForm.items[n-1];i.chatWebsite.onlineForm.items[n]=t,i.chatWebsite.onlineForm.items[n-1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===n?i.chatWebsite.onlineForm.fromKey--:i.chatWebsite.onlineForm.fromKey===n-1&&i.chatWebsite.onlineForm.fromKey++}},i.down=function(e,n){if(n!==i.chatWebsite.onlineForm.items.length-1){var t=i.chatWebsite.onlineForm.items[n+1];i.chatWebsite.onlineForm.items[n]=t,i.chatWebsite.onlineForm.items[n+1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===n?i.chatWebsite.onlineForm.fromKey++:i.chatWebsite.onlineForm.fromKey===n+1&&i.chatWebsite.onlineForm.fromKey--}},i.add=function(e){i.chatWebsite.onlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var n=t.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");t.show(n).then(function(){i.chatWebsite.onlineForm.fromKey===e&&(i.chatWebsite.onlineForm.fromKey=null),i.chatWebsite.onlineForm.items.splice(e,1),i.chatWebsite.onlineForm.items.length||(i.chatWebsite.onlineForm.fromKey=null)})},i.card_type="online",i.email_accounts=[]}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteonlineFormController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/customer_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitecustomerAvatarController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"chatWebsite",action:"getDispositions",field:"name",params:{id:m.chatWebsite.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.chatWebsiteInteractions=e||{count:0,rows:[]};for(var n=0;n<m.chatWebsiteInteractions.rows.length;n+=1){var t=m.chatWebsiteInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatInteraction.get(m.query,p).$promise}function v(e){d.chatInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteInteractions.rows,{id:e.id}),m.chatWebsiteInteractions.count-=1,m.chatWebsiteInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteInteractions={count:0,rows:[]},m.selectedChatWebsiteInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Customer Ip",column:"customerIp",type:"text",options:{excludedOperators:["$eq","$ne","$startsWith","$endsWith"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.chatInteractionDownload=function(s,e,n){return d.chatInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="chat-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getChatWebsiteInteractions=g,m.createOrEditChatWebsiteInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,interaction:n,interactions:m.chatWebsiteInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spychatInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"chat",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"chat.chatWebsites"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||ChatWebsiteId:=$eq["+m.chatWebsite.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedChatWebsiteInteractions=function(){var e=angular.copy(m.selectedChatWebsiteInteractions);return m.selectedChatWebsiteInteractions=[],e},m.deleteChatWebsiteInteraction=v,m.deleteSelectedChatWebsiteInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedChatWebsiteInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteInteractions.forEach(function(e){v(e)}),m.selectedChatWebsiteInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteInteractionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/logo".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitelogoController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteOfflineMessages=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getOfflineMessages(m.query,u).$promise}function g(e){d.chatOfflineMessage.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteOfflineMessages.rows,{id:e.id}),m.chatWebsiteOfflineMessages.count-=1,m.chatWebsiteOfflineMessages.rows.length||p(),l.success({title:"OfflineMessage deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteOfflineMessages={count:0,rows:[]},m.selectedChatWebsiteOfflineMessages=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,attachments,Contact.firstName,ContactId,ChatWebsiteId",sort:"-createdAt",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the offlineMessage?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("offlineMessage #")+e.id||"offlineMessage")+"</b> will be deleted.").ariaLabel("delete offlineMessage").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteOfflineMessages=p,m.createOrEditChatWebsiteOfflineMessage=function(e,n){o.show({controller:"CreateOrEditOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,offlineMessage:n,offlineMessages:m.chatWebsiteOfflineMessages.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.showOfflineMessageChatWebsiteOfflineMessage=function(e,t){o.show({controller:"ShowOfflineMessageOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{message:["apiResolver","$stateParams",function(e,n){return e.resolve("chatOfflineMessage@get",{fields:"id,body",id:t.id})}],attachments:["apiResolver","$stateParams",function(e,n){return e.resolve("attachment@get",{fields:"id,name",ChatOfflineMessageId:t.id})}]}})},m.exportSelectedChatWebsiteOfflineMessages=function(){var e=angular.copy(m.selectedChatWebsiteOfflineMessages);return m.selectedChatWebsiteOfflineMessages=[],e},m.deleteChatWebsiteOfflineMessage=g,m.deleteSelectedChatWebsiteOfflineMessages=function(e){var n=o.confirm().title("Are you sure want to delete the selected offlineMessages?").htmlContent("<b>"+m.selectedChatWebsiteOfflineMessages.length+" selected</b> will be deleted.").ariaLabel("delete offlineMessages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteOfflineMessages.forEach(function(e){g(e)}),m.selectedChatWebsiteOfflineMessages=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteOfflineMessagesController",e)}(),function(){"use strict";function e(n,e,t,a,i){var s=this;s.title="CHAT.OFFLINE_MESSAGE",s.message=a,s.attachments=i.rows,s.closeDialog=function(e){n.hide(e)},s.download=function(i){return e.attachment.download({id:i.id}).$promise.then(function(e){if(e){var n=new Blob([e.buffer],{type:e.type}),t=document.createElement("a"),a=window.URL.createObjectURL(n);t.href=a,t.target="_self",t.download=i.name,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.isHtml=_.isNil(s.message.body.match(/\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i))}e.$inject=["$mdDialog","api","toasty","message","attachments"],angular.module("app.chat").controller("ShowOfflineMessageOfflineMessageDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteProactiveActions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getProactiveActions(m.query,u).$promise}function g(e){d.chatProactiveAction.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteProactiveActions.rows,{id:e.id}),m.chatWebsiteProactiveActions.count-=1,m.chatWebsiteProactiveActions.rows.length||p(),l.success({title:"ChatProactiveAction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteProactiveActions={count:0,rows:[]},m.selectedChatWebsiteProactiveActions=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,name,type,selector,timeout",limit:10,page:1},m.arraytype=_.keyBy([{option:"MouseOver",value:"'mouseOver'"},{option:"Timeout",value:"'timeout'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the chatProactiveAction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("chatProactiveAction #")+e.id||"chatProactiveAction")+"</b> will be deleted.").ariaLabel("delete chatProactiveAction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteProactiveActions=p,m.createOrEditChatWebsiteChatProactiveAction=function(e,n){o.show({controller:"CreateOrEditChatProactiveActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,chatProactiveAction:n,proactive:m.chatWebsiteProactiveActions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedChatWebsiteProactiveActions=function(){var e=angular.copy(m.selectedChatWebsiteProactiveActions);return m.selectedChatWebsiteProactiveActions=[],e},m.deleteChatWebsiteChatProactiveAction=g,m.deleteSelectedChatWebsiteProactiveActions=function(e){var n=o.confirm().title("Are you sure want to delete the selected proactive?").htmlContent("<b>"+m.selectedChatWebsiteProactiveActions.length+" selected</b> will be deleted.").ariaLabel("delete proactive").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteProactiveActions.forEach(function(e){g(e)}),m.selectedChatWebsiteProactiveActions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteProactiveActionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATPROACTIVEACTION",g.chatProactiveAction=angular.copy(l),g.proactive=r,g.newChatProactiveAction=!1,g.chatProactiveAction||(g.chatProactiveAction={type:"mouseOver"},g.title="CHAT.NEW_CHATPROACTIVEACTION",g.newChatProactiveAction=!0),n.params.id&&(g.chatProactiveAction.ChatWebsiteId=n.params.id),g.addNewChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.save(g.chatProactiveAction).$promise.then(function(e){g.proactive.unshift(e.toJSON()),o.success({title:"ChatProactiveAction properly created",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.update({id:g.chatProactiveAction.id},g.chatProactiveAction).$promise.then(function(e){var n=_.find(g.proactive,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatProactiveAction properly saved!",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatProactiveAction=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatProactiveAction will be deleted.").ariaLabel("Delete ChatProactiveAction").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatProactiveAction.delete({id:g.chatProactiveAction.id}).$promise.then(function(){_.remove(g.proactive,{id:g.chatProactiveAction.id}),o.success({title:"ChatProactiveAction properly deleted!",msg:(g.chatProactiveAction.name||"chatProactiveAction")+" has been deleted!"}),v(g.chatProactiveAction)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","proactive","chatProactiveAction","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatProactiveActionDialogController",e)}(),function(){"use strict";function e(e){var n=this;n.chatWebsite={},n.init=function(e){n.chatWebsite=e,n.start="\n\x3c!-- START Motion Chat Script --\x3e",n.script='\n    <script src="'+n.chatWebsite.remote+"/api/chat/websites/"+n.chatWebsite.id+"/snippet?token="+n.chatWebsite.token+'"><\/script>',n.end="\n\x3c!-- START Motion Chat Script --\x3e"},n.info={},e.$watch("vm_ac.chatWebsite.remote",function(e){n.script='\n    <script src="'+n.chatWebsite.remote+"/api/chat/websites/"+n.chatWebsite.id+"/snippet?token="+n.chatWebsite.token+'"><\/script>'})}e.$inject=["$scope"],angular.module("app.chat").controller("ChatWebsiteScriptController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/system_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitesystemAvatarController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.chatWebsite=c||e.params.chatWebsite||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:p.chatWebsites?p.chatWebsites.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoChatWebsites=function(){e.go("app.chat.chatWebsites",{},{reload:"app.chat.chatWebsites"})},p.saveChatWebsite=function(){r.chatWebsite.update({id:p.chatWebsite.id},p.chatWebsite).$promise.then(function(){l.success({title:"ChatWebsite updated!",msg:p.chatWebsite.name?p.chatWebsite.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.chatWebsite&&(t=_.find(p.lists,{id:Number(p.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.chatWebsite&&(a=_.find(p.lists,{id:Number(p.chatWebsite.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){p.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){p.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.interval,{id:e.resourceId})}),t=null;if(p.chatWebsite&&(t=_.find(p.interval,{id:Number(p.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.interval,{id:t.id});a.canSelect=!1,n.push(a)}p.interval=n})}else{var t=[],a=null;p.chatWebsite&&(a=_.find(p.interval,{id:Number(p.chatWebsite.IntervalId)}));for(var i=0;i<p.interval.length;i++)a&&p.interval[i].id===a.id&&(p.interval[i].canSelect=!1,t.push(p.interval[i]));p.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatWebsite","userProfile","userProfileSection"],angular.module("app.chat").controller("ChatWebsiteController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"ChatQueues":void 0,channel:"chat",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("CHAT.CHATQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:n,chatQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:n,chatQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("chat_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userChatQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.ChatQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userChatQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.ChatQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"chat")})}),e.$on("$destroy",function(){r.removeAllListeners("chat_queue:save"),r.removeAllListeners("userChatQueue:remove"),r.removeAllListeners("userChatQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.chat").controller("QueuesChatRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.chat.realtime.agents":this.selectedTab=0;break;case"app.chat.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.chat.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.chat.realtime.agents");break;case 1:t.go("app.chat.realtime.queues");break;default:t.go("app.chat.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.chat").controller("ChatRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.companies=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="companies",f.listOrder="",f.listOrderAsc=null,f.selectedCompanies=[],f.query={fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){a.go("app.contactmanager.companies.edit",{id:e.id,company:e,crudPermissions:f.crudPermissions})},f.gotocontactsgoto=function(t,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{CompanyId:t.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:t.id})}},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("company")+"?").htmlContent("<b>"+(e.name||"company")+"</b> will be deleted.").ariaLabel("delete company").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCompanies=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmCompany.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Companies",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCompany=function(e,n){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{company:n,companies:f.companies.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCompany=y,f.exportSelectedCompanies=function(){var e=angular.copy(f.selectedCompanies);return f.selectedCompanies=[],e},f.deleteSelectedCompanies=function(e){var n=i.confirm().title("Are you sure want to delete the selected companies?").htmlContent("<b>"+f.selectedCompanies.length+" selected</b> will be deleted.").ariaLabel("delete Companys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCompanies.forEach(function(e){y(e)}),f.selectedCompanies=[]})},f.deselectCompanies=function(){f.selectedCompanies=[]},f.selectAllCompanies=function(){f.selectedCompanies=f.companies.rows};var b=!0,A=1;function E(e){f.companies=e||{count:0,rows:[]}}function y(e){m.cmCompany.delete({id:e.id}).$promise.then(function(){_.remove(f.companies.rows,{id:e.id}),f.companies.count-=1,f.companies.rows.length||f.getCompanies(),p.success({title:_.startCase("Company")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCompany"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCompany",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCompanies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","companies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("CompaniesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_COMPANY",g.company=angular.copy(l),g.companies=r,g.newCompany=!1,g.company||(g.company={},g.title="CONTACTMANAGER.NEW_COMPANY",g.newCompany=!0),g.addNewCompany=function(){g.errors=[],d.cmCompany.save(g.company).$promise.then(function(e){g.companies.unshift(e.toJSON()),o.success({title:"Company properly created",msg:g.company.name?g.company.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCompany=function(){g.errors=[],d.cmCompany.update({id:g.company.id},g.company).$promise.then(function(e){var n=_.find(g.companies,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Company properly saved!",msg:g.company.name?g.company.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCompany=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The company will be deleted.").ariaLabel("Delete Company").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmCompany.delete({id:g.company.id}).$promise.then(function(){_.remove(g.companies,{id:g.company.id}),o.success({title:"Company properly deleted!",msg:(g.company.name||"company")+" has been deleted!"}),v(g.company)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","companies","company","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCompanyDialogController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.company=c||a.params.company||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(t,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{CompanyId:t.id}):l.info({title:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:t.id})}},u.alert=l.info,u.gotoCompanies=function(){a.go("app.contactmanager.companies",{},{reload:"app.contactmanager.companies"})},u.saveCompany=function(){r.cmCompany.update({id:u.company.id},u.company).$promise.then(function(){l.success({title:"Company updated!",msg:u.company.name?u.company.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmCompany",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","company","userProfileSection"],angular.module("app.contactmanager").controller("CompanyController",e)}(),function(){"use strict";function e(n,i,t,a,e,s,o,r,l,d,c,m,u,p,g,v,h,f,b){var A=this;A.currentUser=f.getCurrentUser(),A.license=b,A.userProfile=r,A.userProfileSection=l&&1==l.count?l.rows[0]:null,A.crudPermissions=f.parseCrudPermissions(A.userProfileSection?A.userProfileSection.crudPermissions:null);var E=60,y=1024*E*1024;A.ngFlowOptions={target:"api/cm/contacts/upload",singleFile:!0,maxChunkRetries:1,chunkSize:y,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},A.contacts=c||{count:0,rows:[]},A.options={hidden:!1,hover:!1,isOpen:!1},A.table="cm_contacts",A.selectedContacts=[],A.lists=m||{rows:[],count:0},A.companies=p||{rows:[],count:0},A.tags=v||{rows:[],count:0},A.listsMap=u,A.companiesMap=g,A.selectedTags=[],A.selectedList=null,A.selectedCompany=null,A.query=_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0,page:1},e),A.editdialog=function(e,n){a.go("app.contactmanager.contacts.edit",{id:e.id,crudPermissions:A.crudPermissions})},A.deleteconfirm=function(e,n){var t=s.confirm().title("Are you sure want to delete the contact?").htmlContent("<b>"+(e.firstName||e.email||e.phone||"Contact")+"</b> will be deleted.").ariaLabel("delete contact").targetEvent(n).ok("OK").cancel("CANCEL");s.show(t).then(function(){O(e)})},A.success=I,A.getContacts=function(){A.query.offset=(A.query.page-1)*A.query.limit,f.hasRole("admin")?A.promise=d.cmContact.get(A.query,I).$promise:(A.query.id=A.userProfile.id,A.query.ListId=A.query.ListId?A.query.ListId:_.map(A.lists.rows,"id"),A.query.CompanyId=A.query.CompanyId?A.query.CompanyId:_(A.companies.rows).filter({canSelect:void 0}).map("id").value(),A.query.section="Contacts",A.promise=d.userProfile.getResources(A.query,I).$promise)},A.getAssignedCompanies=function(){if(!f.hasRole("admin")){var e=_(A.contacts.rows).map(function(e){return{id:e.CompanyId}}).uniqBy("id").filter(function(e){return e.id&&0<e.id}).pullAllBy(A.companies.rows,"id").value();if(!_.isEmpty(e)){var n=[];e.forEach(function(e){n.push(d.cmCompany.get({id:e.id,fields:"id,name"}).$promise)}),o.all(n).then(function(e){e.forEach(function(e){var n=e.toJSON();n.canSelect=!1,A.companies.rows.push(n);var t={};t[n.id]=n.name,A.companiesMap=_.assignIn(A.companiesMap,t)})}).catch(function(e){h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}},A.mergeContact=function(e,n){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:A.contacts.rows}})},A.duplicateContact=function(e,n){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:A.contacts.rows}})},A.createOrEditContact=function(e,n){n&&n.dateOfBirth&&(n.dateOfBirth=new Date(n.dateOfBirth));s.show({controller:"CreateOrEditContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ListId:A.query.ListId||a.params.ListId,CompanyId:A.query.CompanyId||a.params.CompanyId,contact:n,contacts:A.contacts.rows,companies:A.companies,lists:A.lists,setting:null,crudPermissions:A.crudPermissions}})},A.deleteContact=O,A.exportSelectedContacts=function(){var e=angular.copy(A.selectedContacts);return A.selectedContacts=[],e},A.deleteSelectedContacts=function(e){var n=s.confirm().title("Are you sure want to delete the selected contacts?").htmlContent("<b>"+A.selectedContacts.length+" selected</b> will be deleted.").ariaLabel("delete Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(n).then(function(){A.selectedContacts.forEach(function(e){O(e)}),A.selectedContacts=[]})},A.deselectContacts=function(){A.selectedContacts=[]},A.selectAllContacts=function(){A.selectedContacts=A.contacts.rows},A.createTag=function(e){var n=s.prompt().title("What would you name your tag?").placeholder("Tag name").ariaLabel("Tag name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.tag.save({name:e});h.error({title:"Error creating tag!",msg:"Invalid tag name."})}).then(function(e){e&&(A.tags.rows.push(e),h.success({title:"Tag properly created!",msg:e.tag?e.name+" has been created!":""}))})},A.createList=function(e){var n=s.prompt().title("What would you name your list?").placeholder("List name").ariaLabel("List name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.cmList.save({name:e});h.error({title:"Error creating list!",msg:"Invalid list name."})}).then(function(e){e&&(A.lists.rows.push(e),h.success({title:"List properly created!",msg:e.name?e.name+" has been created!":""}))})},A.createCompany=function(e){var n=s.prompt().title("What would you name your company?").placeholder("Company name").ariaLabel("Company name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.cmCompany.save({name:e});h.error({title:"Error creating company!",msg:"Invalid company name."})}).then(function(e){e&&(A.companies.rows.push(e),h.success({title:"Company properly created!",msg:e.name?e.name+" has been created!":""}))})},A.importContacts=function(e,n,t){var a=JSON.parse(n);s.show({controller:"ImportContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/import.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:m,companies:p,file:a.file,fields:a.fields,license:A.license}}).then(function(){A.getContacts()}).catch(function(e){console.error()})},A.hasPermission=function(){return f.hasPermission(303)||f.hasRole("admin")},A.fileAdded=function(e){var n=["csv"];if(!_.includes(n,e.getExtension()))return h.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>y)return h.error({title:"File too big",msg:"The max allowed size is "+E+"MB"}),!1;return!0},a.params.ListId&&(A.selectedList=a.params.ListId),a.params.CompanyId&&(A.selectedCompany=a.params.CompanyId),n.$watch("vm.options.isOpen",function(e){e?t(function(){n.tooltipVisible=A.options.isOpen},600):n.tooltipVisible=A.options.isOpen});var S=!0,T=1;function I(e){A.contacts=e||{count:0,rows:[]}}function O(e){d.cmContact.delete({id:e.id}).$promise.then(function(){_.remove(A.contacts.rows,{id:e.id}),A.contacts.count-=1,A.contacts.rows.length||A.getContacts(),h.success({title:"Contact deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){A.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}];for(var n=0;n<e.data.errors.length;n++)h.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}n.$watch("vm.query.filter",function(e,n){S?t(function(){S=!1}):(n||(T=A.query.page),e!==n&&(A.query.page=1),e||(A.query.page=T),A.getContacts())},!0),n.$watch("vm.selectedList",function(e,n){e!==n&&(A.query.ListId=A.selectedList||void 0,A.getContacts())}),n.$watch("vm.selectedCompany",function(e,n){e!==n&&(A.query.CompanyId=A.selectedCompany||void 0,A.getContacts())}),n.$watch("vm.selectedTags",function(e,n){(e.length||n.length)&&A.getContacts()})}e.$inject=["$scope","$document","$timeout","$state","$stateParams","$mdDialog","$q","userProfile","userProfileSection","api","contacts","lists","listsMap","companies","companiesMap","tags","toasty","Auth","license"],angular.module("app.contactmanager").controller("ContactsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o,r,l,d){var c=this;function m(e){if(e)return l.cmList.getCustomFields({id:e}).$promise.then(function(e){if(e){c.customFields=e;var n=_.map(c.customFields.rows,function(e){return"cf_"+e.id});return l.cmContact.get({id:c.contact.id,attributes:n,raw:!0}).$promise.then(function(e){c.contact=_.merge(c.contact,e)})}}).then(function(){c.customFields.rows.forEach(function(e){"datetime"===e.type&&c.contact["cf_"+e.id]&&(c.contact["cf_"+e.id]=u(c.contact["cf_"+e.id]))}),Object.keys(c.contact).forEach(function(e){if(_.startsWith(e,"cf_")){var n=e.split("_")[1];_.some(c.customFields.rows,["id",Number(n)])||delete c.contact["cf_"+n]}})}).catch(function(e){console.error(e)});c.customFields={rows:[],count:0}}function u(e){return null===e?void 0:new Date(e)}function p(){t.hide()}c.errors=[],c.title="CONTACTMANAGER.EDIT_CONTACT",c.crudPermissions=d,c.contact=angular.copy(s),c.contacts=e||{rows:[],count:0},c.lists=n||{rows:[],count:0},c.companies=i||{rows:[],count:0},c.customFields={rows:[],count:0},c.newContact=!1,c.contact?(delete c.contact.List,m(c.contact.ListId)):(c.contact={ListId:o?parseInt(o,10):void 0,CompanyId:r?parseInt(r,10):void 0},c.title="CONTACTMANAGER.NEW_CONTACT",c.newContact=!0),c.addNewContact=function(){c.errors=[],l.cmContact.save(c.contact).$promise.then(function(e){c.contacts.unshift(e),a.success({title:"Contact properly created",msg:c.contact.name?c.contact.name+" has been created!":""}),p()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contacts.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveContact=function(){c.errors=[],l.cmContact.update({id:c.contact.id},c.contact).$promise.then(function(e){var n=_.find(c.contacts,{id:e.id});n&&_.merge(n,e),a.success({title:"Contact properly saved!",msg:c.contact.name?c.contact.name+" has been saved!":""}),p()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.contact.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteContact=function(e){c.errors=[];var n=t.confirm().title("Are you sure?").content("The contact will be deleted.").ariaLabel("Delete Contact").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){l.cmContact.delete({id:c.contact.id}).$promise.then(function(){_.remove(c.contacts,{id:c.contact.id}),a.success({title:"Contact properly deleted!",msg:c.contact.name?c.contact.name+" has been deleted!":""}),p()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},c.closeDialog=p,c.getCustomFields=m,c.getDateFromString=u}e.$inject=["$mdDialog","toasty","contacts","lists","companies","contact","ListId","CompanyId","api","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.title="CONTACTMANAGER.COPY_CONTACT",o.contact=angular.copy(t),o.lists=i||{rows:[],count:0},o.addNewContact=function(){o.errors=[],delete o.contact.id,o.contact.tags&&!o.contact.tags.length&&delete o.contact.tags;s.cmContact.save(o.contact).$promise.then(function(e){a.unshift(e),n.success({title:"Contact properly created",msg:o.contact.name?o.contact.name+" has been created!":""}),r()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("DuplicateContactDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="CONTACTMANAGER.EDIT_HOPPER",d.hopper=angular.copy(o),d.hoppers=s,d.newHopper=!1,d.crudPermissions=l,d.hopper||(d.hopper={},d.title="CONTACTMANAGER.NEW_HOPPER",d.newHopper=!0),d.saveHopper=function(){d.errors=[],r.cmHopper.update({id:d.hopper.id},d.hopper).$promise.then(function(e){var n=_.find(d.hoppers,{id:e.id});n&&_.merge(n,e),i.success({title:"Hopper properly saved!",msg:d.hopper.name?d.hopper.name+" has been saved!":""}),c(e)}).catch(function(e){console.error(e),d.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}]})},d.getDateFromString=function(e){return null===e?void 0:new Date(e)},d.closeDialog=c}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","crudPermissions"],angular.module("app.contactmanager.contacts").controller("EditHopperDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y){var S=this;function T(n){return function(e){S[n]=e||{count:0,rows:[]}}}function I(){S.queryHopper.offset=(S.queryHopper.page-1)*S.queryHopper.limit,S.queryHopper.id=S.contact.id,S.promise=r.cmContact.getHoppers(S.queryHopper,T("hoppers")).$promise}function O(){S.queryFinal.offset=(S.queryFinal.page-1)*S.queryFinal.limit,S.queryFinal.id=S.contact.id,S.promise=r.cmContact.getHopperFinals(S.queryFinal,T("finals")).$promise}function C(){S.queryHistory.offset=(S.queryHistory.page-1)*S.queryHistory.limit,S.queryHistory.id=S.contact.id,S.promise=r.cmContact.getHopperHistories(S.queryHistory,T("histories")).$promise}function w(e){S.journeyIsLoading=!0;var n=_.merge(S.journeyOptions,{id:S.contact.id,offset:e||0});return y.get(S.journey,n).then(function(e){S.journey=e.journey,S.canLoadMoreJourney=e.loadMore}).finally(function(){S.journeyIsLoading=!1})}S.currentUser=A.getCurrentUser(),S.license=b,S.journey=[],S.contact=l||{},S.hoppers=d||{rows:[],count:0},S.finals=c||{rows:[],count:0},S.histories=m||{rows:[],count:0},S.companies=p||{rows:[],count:0},S.lists=g||{rows:[],count:0},S.customFields=v||{rows:[],count:0},S.tags=h||{rows:[],count:0},S.jscriptySessions=f||{rows:[],count:0},S.journeyOptions=y.getQuery(),S.quickFilters=y.getQuickFilters(),S.journeyTimelineOptions={scrollEl:"#journey-content"},S.userProfileSection=E&&1==E.count?E.rows[0]:null,S.crudPermissions=A.parseCrudPermissions(S.userProfileSection?S.userProfileSection.crudPermissions:null),S.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),S.queryHopper={fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,page:1},S.queryFinal={fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-id",limit:10,page:1},S.queryHistory={fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-id",limit:10,page:1},S.queryJscriptySession={fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,page:1},S.selectedTab=n.params.tab||0,S.onInit=function(){A.hasRole("admin")||(function(){if(!_.some(S.companies.rows,{id:S.contact.CompanyId}))r.cmCompany.get({id:S.contact.CompanyId,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,S.companies.rows.push(n)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}(),function(){var e=_.map(S.contact.Tags,function(e){return{id:e.id,name:e.name}});if(!_.isEmpty(e))for(var n=0;n<e.length;n++)_.some(S.tags.rows,{id:e.id})||(e[n].canSelect=!1,S.tags.rows.push(e[n]))}());return r.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){S.users=e||{count:0,rows:[]},S.usersMap=_.mapValues(_.keyBy(S.users.rows,"id"),"fullname"),S.Tags=_.map(S.contact.Tags,"id")}).finally(function(){S.contact&&w()})},S.gotoContacts=function(){n.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},S.duplicateContact=function(e){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,resolve:{lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name"}):e.resolve("userProfile@getResources",{id:S.currentUser.userProfileId,section:"Lists",fields:"id,name"})}]},locals:{contacts:u.rows,contact:l}})},S.saveContact=function(){r.cmContact.update({id:S.contact.id},S.contact).$promise.then(function(){o.success({title:"Contact updated!",msg:S.contact.name?S.contact.name+" has been updated!":""})}).then(function(){return r.cmContact.setTags({id:S.contact.id,ids:S.Tags}).$promise}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEcontact",msg:e.data?JSON.stringify(e.data):e.toString()})})},S.editCompany=function(e,n){var t=_.find(S.companies.rows,{id:n});i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{companies:[],license:null,setting:null,crudPermissions:!1===t.canSelect?{readOnly:!0,canEdit:!1,canDelete:!1}:r.userProfileSection.get({userProfileId:S.currentUser.userProfileId,sectionId:302}).$promise.then(function(e){var n=e.rows?e.rows[0]:null;return A.parseCrudPermissions(n?n.crudPermissions:null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:GET_COMPANY_SECTION",msg:e.data?JSON.stringify(e.data):e.toString()})})},resolve:{company:["apiResolver",function(e){return e.resolve("cmCompany@get",{id:n})}]}})},S.onSelectList=function(e){if(S.contact.ListId){var n=i.confirm().title("You are selecting the list number: "+S.contact.ListId).textContent("Warning! You won't select a different list for the contact "+S.contact.firstName||S.contact.lastName||S.contact.id).targetEvent(e).ok("Ok").cancel("Cancel");return i.show(n).then(S.onSelectListSuccess).catch(function(){S.contact.ListId=null})}},S.onSelectListSuccess=function(){return r.cmList.getCustomFields({id:S.contact.ListId}).$promise.then(function(e){S.customFields=e||{rows:[],count:0}}).catch(function(e){console.error(e)})},S.getDateFromString=function(e){return null===e?void 0:new Date(e)},S.getHoppers=I,S.getFinals=O,S.getHistories=C,S.getJscriptySessions=function(){S.queryJscriptySession.offset=(S.queryJscriptySession.page-1)*S.queryJscriptySession.limit,S.queryJscriptySession.id=S.contact.id,S.promise=r.cmContact.getJscriptySessions(S.queryJscriptySession,T("jscriptySessions")).$promise},S.deleteconfirm=function(n,e){var t=i.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(n.phone||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){var e;e=n,r.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(S.hoppers.rows,{id:e.id}),S.hoppers.count--,S.hoppers.rows.length||S.getHoppers(),o.success({title:"Hopper deleted!",msg:e.phone?e.phone+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEhopper",msg:e.data?JSON.stringify(e.data):e.toString()})})},function(){console.log("CANCEL")})},S.editHopper=function(e,n){i.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.createOrEditIvrCampaignHopper=function(e,n){i.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.getCustomerJourney=w,S.loadMoreJourney=function(){return s(function(e,n){var t=S.journey.length;return e(w(t))})};var R=!0,x=1;e.$watch("vm.queryHopper.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryHopper.page),e!==n&&(S.queryHopper.page=1),e||(S.queryHopper.page=x),I())}),e.$watch("vm.queryFinal.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryFinal.page),e!==n&&(S.queryFinal.page=1),e||(S.queryFinal.page=x),O())}),e.$watch("vm.queryHistory.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryHistory.page),e!==n&&(S.queryHistory.page=1),e||(S.queryHistory.page=x),C())})}e.$inject=["$scope","$timeout","$state","$document","$mdDialog","$q","toasty","api","contact","hoppers","finals","histories","contacts","companies","lists","customFields","tags","jscriptySessions","license","Auth","userProfileSection","customerJourneyManager"],angular.module("app.contactmanager.contacts").controller("ContactController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1},{key:"dialTimezone",required:!1}],g.binding={},g.duplicate=[],g.lists=s||{rows:[],count:0},g.companies=o||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),n.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.import({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],n=0;n<g.result.errors.length;n+=1){var t=g.result.errors[n].row;t.contact_import_error=g.result.errors[n].message,e.push(t)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(t){i(function(){if(g.result.rows=t.rows,t.errors)for(var e=0;e<t.errors.length;e++)g.result.errors.push(t.errors[e]);if(t.finish){g.result.finish=!0,g.result.affectedRows=t.affectedRows,g.result.failedRows=g.result.errors.length;var n=g.result.rows-g.result.affectedRows-g.result.errors.length;n&&0<n&&(g.duplicates.length?g.result.duplicatedRows=n:g.result.failedRows+=n),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsDialogController",e)}(),function(){"use strict";function e(i,e,s,n,o,t,r){var a=this;a.errors=[],a.title="CONTACTMANAGER.MERGE_CONTACT",a.contact=angular.copy(n),a.lists=t||[],a.change=function(){a.searchTerm?r.cmContact.get({fields:"id,firstName,lastName,phone,email",filter:a.searchTerm,ListId:n.ListId}).$promise.then(function(e){a.contacts=e.rows}).catch(function(e){console.error(e)}):a.contacts=[]},a.showConfirm=function(e,n,t){var a=i.confirm({skipHide:!0}).title("Would you like to merge your contacs?").textContent("All unfilled values of the contact #"+t.id+" will be overwritten by the fields of the contact #"+n.id+".").targetEvent(e).ok("Ok").cancel("Cancel");i.show(a).then(function(){return r.cmContact.merge({to:t.id,from:n.id}).$promise}).then(function(e){i.hide({new:e,to:t,from:n}),_.remove(o,{id:t.id}),_.remove(o,{id:n.id}),o.unshift(e)}).then(function(){s.success({title:"Contact properly merged!"})}).catch(function(e){e&&e.status&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:MERGE_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.closeDialog=function(){i.hide()}}e.$inject=["$mdDialog","$scope","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("MergeContactDialogController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){t.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.globalCustomFieldForm.$pristine=!1}},g.globalCustomField=l,g.globalCustomFields=r,g.newGlobalCustomField=!1,g.globalCustomField||(g.globalCustomField={type:"text",actionType:"voice"},g.title="CONTACTMANAGER.NEW_GLOBALCUSTOMFIELD",g.newGlobalCustomField=!0),a.$watch("vm.globalCustomField.type",function(e,n){if(e!==n)switch(e){case"text":g.globalCustomField.values="";break;case"select":g.globalCustomField.values=[]}}),g.addNewGlobalCustomField=function(){g.errors=[],d.cmCustomField.save(g.globalCustomField).$promise.then(function(e){g.globalCustomFields.unshift(e.toJSON()),o.success({title:"GlobalCustomField properly created",msg:g.globalCustomField.name?g.globalCustomField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGlobalCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.globalCustomField.id},g.globalCustomField).$promise.then(function(e){var n=_.find(g.globalCustomFields,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"GlobalCustomField properly saved!",msg:g.globalCustomField.name?g.globalCustomField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGlobalCustomField=function(e){g.errors=[];var n=t.confirm().title("Are you sure?").content("The globalCustomField will be deleted.").ariaLabel("Delete GlobalCustomField").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmCustomField.delete({id:g.globalCustomField.id}).$promise.then(function(){_.remove(g.globalCustomFields,{id:g.globalCustomField.id}),o.success({title:"GlobalCustomField properly deleted!",msg:(g.globalCustomField.name||"globalCustomField")+" has been deleted!"}),v(g.globalCustomField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.globalCustomFieldForm.$pristine=!1},g.removeItem=function(e,n){e.splice(n,1),a.globalCustomFieldForm.$pristine=!1},g.removeItems=function(e){for(var n=e.length,t=0;t<n;t++)e.splice(0,1);a.globalCustomFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","globalCustomFields","globalCustomField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditGlobalCustomFieldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.globalCustomFields=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="globalCustomFields",f.listOrder="",f.listOrderAsc=null,f.selectedGlobalCustomFields=[],f.query={fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",sort:"-updatedAt",ListId:"null",limit:10,page:1},f.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayactionType=_.keyBy([{option:"Voice",value:"'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{globalCustomField:e,globalCustomFields:f.globalCustomFields.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("globalCustomField")+"?").htmlContent("<b>"+(e.name||"globalCustomField")+"</b> will be deleted.").ariaLabel("delete globalCustomField").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getGlobalCustomFields=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmCustomField.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="GlobalCustomFields",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditGlobalCustomField=function(e,n){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{globalCustomField:n,globalCustomFields:f.globalCustomFields.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteGlobalCustomField=y,f.exportSelectedGlobalCustomFields=function(){var e=angular.copy(f.selectedGlobalCustomFields);return f.selectedGlobalCustomFields=[],e},f.deleteSelectedGlobalCustomFields=function(e){var n=i.confirm().title("Are you sure want to delete the selected globalCustomFields?").htmlContent("<b>"+f.selectedGlobalCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete GlobalCustomFields").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedGlobalCustomFields.forEach(function(e){y(e)}),f.selectedGlobalCustomFields=[]})},f.deselectGlobalCustomFields=function(){f.selectedGlobalCustomFields=[]},f.selectAllGlobalCustomFields=function(){f.selectedGlobalCustomFields=f.globalCustomFields.rows};var b=!0,A=1;function E(e){f.globalCustomFields=e||{count:0,rows:[]}}function y(e){m.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(f.globalCustomFields.rows,{id:e.id}),f.globalCustomFields.count-=1,f.globalCustomFields.rows.length||f.getGlobalCustomFields(),p.success({title:_.startCase("GlobalCustomField")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCustomField"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCustomField",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getGlobalCustomFields())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","globalCustomFields","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("GlobalCustomFieldsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_LIST",g.list=angular.copy(l),g.lists=r,g.newList=!1,g.list||(g.list={},g.title="CONTACTMANAGER.NEW_LIST",g.newList=!0),g.addNewList=function(){g.errors=[],d.cmList.save(g.list).$promise.then(function(e){g.lists.unshift(e.toJSON()),o.success({title:"List properly created",msg:g.list.name?g.list.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveList=function(){g.errors=[],d.cmList.update({id:g.list.id},g.list).$promise.then(function(e){var n=_.find(g.lists,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"List properly saved!",msg:g.list.name?g.list.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteList=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The list will be deleted.").ariaLabel("Delete List").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmList.delete({id:g.list.id}).$promise.then(function(){_.remove(g.lists,{id:g.list.id}),o.success({title:"List properly deleted!",msg:(g.list.name||"list")+" has been deleted!"}),v(g.list)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","lists","list","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditListDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.cmList.getAgents({id:c.list.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserList?"penalty "+e.UserList.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.list=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.cmList.removeAgents({id:c.list.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.cmList.addAgents({id:c.list.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CONTACTMANAGER.ALL_AGENTS"),labelSelected:r.instant("CONTACTMANAGER.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","list","lists","realtime","$translate","Auth","crudPermissions"],angular.module("app.contactmanager").controller("ListagentaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.listCustomFields=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.cmList.getCustomFields(m.query,u).$promise}function g(e){d.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(m.listCustomFields.rows,{id:e.id}),m.listCustomFields.count-=1,m.listCustomFields.rows.length||p(),l.success({title:"CustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.list={},m.listCustomFields={count:0,rows:[]},m.selectedListCustomFields=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",limit:10,page:1},m.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.arrayactionType=_.keyBy([{option:"Voice",value:"'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.list=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ListId=m.list.id,m.query.id=m.list.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the customField?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("customField #")+e.id||"customField")+"</b> will be deleted.").ariaLabel("delete customField").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getListCustomFields=p,m.createOrEditListCustomField=function(e,n){o.show({controller:"CreateOrEditCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:m.list,customField:n,customFields:m.listCustomFields.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedListCustomFields=function(){var e=angular.copy(m.selectedListCustomFields);return m.selectedListCustomFields=[],e},m.deleteListCustomField=g,m.deleteSelectedListCustomFields=function(e){var n=o.confirm().title("Are you sure want to delete the selected customFields?").htmlContent("<b>"+m.selectedListCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete customFields").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedListCustomFields.forEach(function(e){g(e)}),m.selectedListCustomFields=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListCustomFieldsController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){t.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_CUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.customFieldForm.$pristine=!1}},g.customField=l,g.customFields=r,g.newCustomField=!1,g.customField||(g.customField={type:"text",actionType:"voice"},g.title="CONTACTMANAGER.NEW_CUSTOMFIELD",g.newCustomField=!0),e.params.id&&(g.customField.ListId=e.params.id),a.$watch("vm.customField.type",function(e,n){if(e!==n)switch(e){case"text":g.customField.values="";break;case"select":g.customField.values=[]}}),g.addNewCustomField=function(){g.errors=[],d.cmList.addCustomField({id:e.params.id},g.customField).$promise.then(function(e){g.customFields.unshift(e.toJSON()),o.success({title:"CustomField properly created",msg:g.customField.name?g.customField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.customField.id},g.customField).$promise.then(function(e){var n=_.find(g.customFields,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CustomField properly saved!",msg:g.customField.name?g.customField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomField=function(e){g.errors=[];var n=t.confirm().title("Are you sure?").content("The customField will be deleted.").ariaLabel("Delete CustomField").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmCustomField.delete({id:g.customField.id}).$promise.then(function(){_.remove(g.customFields,{id:g.customField.id}),o.success({title:"CustomField properly deleted!",msg:(g.customField.name||"customField")+" has been deleted!"}),v(g.customField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.customFieldForm.$pristine=!1},g.removeItem=function(e,n){e.splice(n,1),a.customFieldForm.$pristine=!1},g.removeItems=function(e){for(var n=e.length,t=0;t<n;t++)e.splice(0,1);a.customFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customFields","customField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCustomFieldDialogController",e)}(),function(){"use strict";function e(a,e,t,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.list=c||a.params.list||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(t,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{ListId:t.id}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:t.id})}},u.agentadddialog=function(e,n){t.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{list:e,lists:u.lists?u.lists.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoLists=function(){a.go("app.contactmanager.lists",{},{reload:"app.contactmanager.lists"})},u.saveList=function(){r.cmList.update({id:u.list.id},u.list).$promise.then(function(){l.success({title:"List updated!",msg:u.list.name?u.list.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","list","userProfileSection"],angular.module("app.contactmanager").controller("ListController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.cmList.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.list=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ListId=m.list.id,m.query.id=m.list.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.list.id,field:"ListId",route:"cmList"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.contactmanager").controller("ListDispositionsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.lists=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="lists",f.listOrder="",f.listOrderAsc=null,f.selectedLists=[],f.query={fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){a.go("app.contactmanager.lists.edit",{id:e.id,list:e,crudPermissions:f.crudPermissions})},f.gotocontactsgoto=function(t,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{ListId:t.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:t.id})}},f.exportcsvcontactsexport=function(i,e){return m.cmList.getContactsCsv({id:i.id,nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","exportContacts_"+i.id+".csv"),a.click()}else p.info({title:"EXPORT",msg:"The list is empty"})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.agentadddialog=function(e,n){i.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{list:e,lists:f.lists?f.lists.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("list")+"?").htmlContent("<b>"+(e.name||"list")+"</b> will be deleted.").ariaLabel("delete list").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getLists=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmList.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Lists",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditList=function(e,n){i.show({controller:"CreateOrEditListDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:n,lists:f.lists.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteList=y,f.exportSelectedLists=function(){var e=angular.copy(f.selectedLists);return f.selectedLists=[],e},f.deleteSelectedLists=function(e){var n=i.confirm().title("Are you sure want to delete the selected lists?").htmlContent("<b>"+f.selectedLists.length+" selected</b> will be deleted.").ariaLabel("delete Lists").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedLists.forEach(function(e){y(e)}),f.selectedLists=[]})},f.deselectLists=function(){f.selectedLists=[]},f.selectAllLists=function(){f.selectedLists=f.lists.rows};var b=!0,A=1;function E(e){f.lists=e||{count:0,rows:[]}}function y(e){m.cmList.delete({id:e.id}).$promise.then(function(){_.remove(f.lists.rows,{id:e.id}),f.lists.count-=1,f.lists.rows.length||f.getLists(),p.success({title:_.startCase("List")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmList"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getLists())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","lists","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("ListsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;function b(){return a.smsAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.smsAccounts=e,a.smsInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].SmsAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.smsAccounts.rows,{id:e.rows[t].SmsAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.smsAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.smsAccounts=n})})}function A(){return a.faxAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.faxAccounts=e,a.faxInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].FaxAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.faxAccounts.rows,{id:e.rows[t].FaxAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.faxAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.faxAccounts=n})})}function E(){return a.openchannelAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.openchannelAccounts=e,a.openchannelInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].OpenchannelAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.openchannelAccounts.rows,{id:e.rows[t].OpenchannelAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.openchannelAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.openchannelAccounts=n})})}function y(){return a.whatsappAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.whatsappAccounts=e,a.whatsappInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].WhatsappAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.whatsappAccounts.rows,{id:e.rows[t].WhatsappAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.whatsappAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.whatsappAccounts=n})})}function S(){return a.chatWebsite.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.chatWebsites=e,a.chatInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].ChatWebsiteId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.abandoned+=e.rows[t].abandoned,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.chatWebsites.rows,{id:e.rows[t].ChatWebsiteId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","abandoned","unmanaged"]));return f.chatWebsites}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.chatWebsites=n})})}function T(){return a.mailAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.mailAccounts=e,a.mailInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].MailAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.mailAccounts.rows,{id:e.rows[t].MailAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.mailAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.mailAccounts=n})})}function I(){for(var e=0;e<f.customDashboard.widgets.length;e+=1)f.customDashboard.widgets[e].voiceQueuesSelected=f.voiceQueuesSelected,f.customDashboard.widgets[e].chatWebsitesSelected=f.chatWebsitesSelected,f.customDashboard.widgets[e].smsAccountsSelected=f.smsAccountsSelected,f.customDashboard.widgets[e].faxAccountsSelected=f.faxAccountsSelected,f.customDashboard.widgets[e].mailAccountsSelected=f.mailAccountsSelected,f.customDashboard.widgets[e].openchannelAccountsSelected=f.openchannelAccountsSelected,f.customDashboard.widgets[e].whatsappAccountsSelected=f.whatsappAccountsSelected}f.currentUser=s.getCurrentUser(),f.userProfile=v,f.userProfileSection=h&&1===h.count?h.rows[0]:null,f.crudPermissions=s.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.customDashboard={},f.voiceQueues=l&&l.count?l:{count:0,rows:[]},f.voiceQueuesSelected=l&&l.count?_.map(l.rows,"id"):[],f.faxAccounts=d&&d.count?d:{count:0,rows:[]},f.faxAccountsSelected=d&&d.count?_.map(d.rows,"id"):[],f.chatWebsites=c&&c.count?c:{count:0,rows:[]},f.chatWebsitesSelected=c&&c.count?_.map(c.rows,"id"):[],f.smsAccounts=m&&m.count?m:{count:0,rows:[]},f.smsAccountsSelected=m&&m.count?_.map(m.rows,"id"):[],f.mailAccounts=u&&u.count?u:{count:0,rows:[]},f.mailAccountsSelected=u&&u.count?_.map(u.rows,"id"):[],f.openchannelAccounts=p&&p.count?p:{count:0,rows:[]},f.openchannelAccountsSelected=p&&p.count?_.map(p.rows,"id"):[],f.whatsappAccounts=g&&g.count?g:{count:0,rows:[]},f.whatsappAccountsSelected=g&&g.count?_.map(g.rows,"id"):[],f.interval=n(function(){},1e3),f.goToEdit=function(){e.go("app.tools.customDashboards.edit",{customDashboard:f.customDashboard,id:f.customDashboard.id,tab:1})},f.setFilter=function(e){o.show({controller:"FilterDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/custom/filter/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{vm_parent:f}}).then(function(e){f=e,I()})},f.updateWidget=I,i.onWithoutApply("voice_queue:save",function(e){var n=_.find(f.voiceQueues.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.onWithoutApply("sms_account:save",function(e){var n=_.find(f.smsAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("smsInteraction:update",b),i.on("smsInteraction:save",b),i.onWithoutApply("fax_account:save",function(e){var n=_.find(f.faxAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("faxInteraction:update",A),i.on("faxInteraction:save",A),i.onWithoutApply("mail_account:save",function(e){var n=_.find(f.mailAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("mailInteraction:update",T),i.on("mailInteraction:save",T),i.onWithoutApply("openchannel_account:save",function(e){var n=_.find(f.openchannelAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("openchannelInteraction:update",E),i.on("openchannelInteraction:save",E),i.onWithoutApply("whatsapp_account:save",function(e){var n=_.find(f.whatsappAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("whatsappInteraction:update",y),i.on("whatsappInteraction:save",y),i.onWithoutApply("chat_website:save",function(e){var n=_.find(f.chatWebsites.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("chatInteraction:update",S),i.on("chatInteraction:save",S),a.dashboard.get({id:e.params.id}).$promise.then(function(e){if(e)return f.customDashboard=e,f.customDashboard.widgets=[],f.customDashboard.preview=!0,f.customDashboard.draggable={enabled:!1},f.customDashboard.resizable={enabled:!1},a.dashboard.getItems({id:f.customDashboard.id}).$promise}).then(function(e){if(e&&e.count&&e.rows)for(var n=0;n<e.rows.length;n+=1)e.rows[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[n].type+"/ms-widget-engine."+e.rows[n].type+".html",e.rows[n].voiceQueues=f.voiceQueues,e.rows[n].voiceQueuesSelected=f.voiceQueuesSelected,e.rows[n].faxAccounts=f.faxAccounts,e.rows[n].faxAccountsSelected=f.faxAccountsSelected,e.rows[n].mailAccounts=f.mailAccounts,e.rows[n].mailAccountsSelected=f.mailAccountsSelected,e.rows[n].smsAccounts=f.smsAccounts,e.rows[n].smsAccountsSelected=f.smsAccountsSelected,e.rows[n].chatWebsites=f.chatWebsites,e.rows[n].chatWebsitesSelected=f.chatWebsitesSelected,e.rows[n].openchannelAccounts=f.openchannelAccounts,e.rows[n].openchannelAccountsSelected=f.openchannelAccountsSelected,e.rows[n].whatsappAccounts=f.whatsappAccounts,e.rows[n].whatsappAccountsSelected=f.whatsappAccountsSelected,f.customDashboard.widgets.push(e.rows[n])}).catch(function(){f.customDashboard=void 0}),t.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),i.removeAllListeners("sms_account:save"),i.removeAllListeners("fax_account:save"),i.removeAllListeners("mail_account:save"),i.removeAllListeners("openchannel_account:save"),i.removeAllListeners("whatsapp_account:save"),i.removeAllListeners("chat_website:save"),i.removeAllListeners("chatInteraction:save"),i.removeAllListeners("chatInteraction:update"),i.removeAllListeners("smsInteraction:save"),i.removeAllListeners("smsInteraction:update"),i.removeAllListeners("openchannelInteraction:save"),i.removeAllListeners("openchannelInteraction:update"),i.removeAllListeners("mailInteraction:save"),i.removeAllListeners("mailInteraction:update"),i.removeAllListeners("faxInteraction:save"),i.removeAllListeners("faxInteraction:update"),i.removeAllListeners("whatsappInteraction:save"),i.removeAllListeners("whatsappInteraction:update"),f.interval&&n.cancel(f.interval)})}e.$inject=["$state","$interval","$scope","api","socket","Auth","$mdDialog","$document","voiceQueues","faxAccounts","chatWebsites","smsAccounts","mailAccounts","openchannelAccounts","whatsappAccounts","userProfile","userProfileSection"],angular.module("app.dashboards.custom").controller("DashboardCustomController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){a.hide(c.parent)}c.title="DASHBOARDS.SETFILTERS",c.currentUser=l.getCurrentUser(),c.parent=d,c.onChangeFilter=function(e){for(var n=0;n<c.parent.customDashboard.widgets.length;n+=1)switch(e){case"voice":c.parent.customDashboard.widgets[n].voiceQueuesSelected=c.parent.voiceQueuesSelected;break;case"sms":c.parent.customDashboard.widgets[n].smsAccountsSelected=c.parent.smsAccountsSelected;break;case"chat":c.parent.customDashboard.widgets[n].chatAccountsSelected=c.parent.chatAccountsSelected;break;case"fax":c.parent.customDashboard.widgets[n].faxAccountsSelected=c.parent.faxAccountsSelected;break;case"mail":c.parent.customDashboard.widgets[n].mailAccountsSelected=c.parent.mailAccountsSelected;break;case"openchannel":c.parent.customDashboard.widgets[n].openchannelAccountsSelected=c.parent.openchannelAccountsSelected;break;case"whatsapp":c.parent.customDashboard.widgets[n].whatsappAccountsSelected=c.parent.whatsappAccountsSelected}},c.confirm=function(){m()},c.closeDialog=m}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","api","Auth","vm_parent"],angular.module("app.tools").controller("FilterDialogController",e)}(),function(){"use strict";function e(e,s,i,o,r,l,a,n,d,t,c,m,u,p,g,v,h,f,b,A,E){var y=this;y.license=v,y.setting=h,y.detectBrowser=b.detectBrowser(),y.user=n.getCurrentUser(),y.currentTab=0,y.notifications={},y.tabs={},y.agentCapacity={},y.autoClose=!1,y.globalUserLists=m||{count:0,rows:[]},y.globalLists=u||{count:0,rows:[]},y.globalCompanies=p||{count:0,rows:[]},y.globalTags=g||{count:0,rows:[]};var S=E.getLogger("dashboard","agent.general.contact");function T(e){var n={};for(var t in y.tabs)y.tabs.hasOwnProperty(t)&&(n[t]=_.pick(y.tabs[t],["type","title","channel","icon","color","autoCreate","id","saved","badges","openedAt"]),_.isNil(y.tabs[t].contact)||(n[t].contact=_.pick(y.tabs[t].contact,["id","ListId"])),_.isNil(y.tabs[t].calls)||(n[t].calls=y.tabs[t].calls),y.tabs[t].interaction&&(n[t].interaction=_.pick(y.tabs[t].interaction,["id","OpenchannelAccountId","MailAccountId","ChatWebsiteId","FaxAccountId","SmsAccountId","WhatsappAccountId","closed","draft"])));var a=JSON.parse(i.localStorage.getItem("motion2.user:"+y.user.id));a?(a.tabs=n,a.currentTab=y.currentTab,a.autoClose=y.autoClose):a={tabs:n,currentTab:y.currentTab,autoClose:y.autoClose},i.localStorage.setItem("motion2.user:"+y.user.id,JSON.stringify(a)),e&&I(e)}function I(e){if(_.isNil(e)||e&&"interaction"===e.type){var n={id:y.user.id,online:!0,capacity:{mail:0,fax:0,sms:0,whatsapp:0,openchannel:0,chat:0},interaction:{mail:[],fax:[],sms:[],whatsapp:[],openchannel:[],chat:[]}};for(var t in y.tabs)y.tabs.hasOwnProperty(t)&&n.capacity.hasOwnProperty(y.tabs[t].channel)&&y.tabs[t].interaction&&!y.tabs[t].interaction.closed&&(n.capacity[y.tabs[t].channel]+=1,n.interaction[y.tabs[t].channel].push(y.tabs[t].interaction.id));if(!_.isEqual(y.agentCapacity,n.capacity))return y.agentCapacity=n.capacity,d.rpc.setAgentCapacity(n)}}function O(e){y.tabs[e.id]&&(!function(e){if(e.channel&&e.interaction)d.user["remove"+_.upperFirst(e.channel)+"Interactions"]({id:y.user.id,ids:[e.interaction.id]}).$promise.catch(function(e){S.error(e)})}(y.tabs[e.id]),delete y.tabs[e.id],y.currentTab=0,T(e))}function C(e){Object.keys(y.tabs).length!==y.setting.limitTabs?(e.id=_.random(1e10),e.openedAt=(new Date).toISOString(),e.saved=!1,e.badges=0,y.tabs[e.id]=e,y.currentTab=e.id,T(e)):c.warning({title:"",msg:o.instant("DASHBOARD.LIMIT_TABS_REACHED")})}function w(n){return _.find(y.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id==n.interactionId&&e.channel==n.channel})}function R(n,t){var e,a,i={type:"contact",title:n?(e=n,a="",e&&(e.firstName||e.lastName?(e.firstName&&(a+=e.firstName+" "),e.lastName&&(a+=e.lastName)):e.phone&&(a=e.phone)),a=y.user.privacyEnabled?A.mask(a):a):o.instant("DASHBOARDS.NEW_CONTACT"),icon:"icon-account-circle",color:"red",contact:n,calls:t?[t]:[],autoCreate:t?t.autoCreate:0};if(t&&(t.answertime||(t.answertime=t.agentconnectAt),(t.agentcompleteAt||t.endtime)&&k(t)),n){var s=_.find(y.tabs,function(e){return e.contact&&e.contact.id?"contact"===e.type&&e.contact&&e.contact.id==n.id:"contact"===e.type&&e.contact&&e.contact.phone==n.phone});if(s){if(t)return d.voiceCallReport.get({uniqueid:t.uniqueid}).$promise.then(function(e){(e&&0<e.rows.length&&(t.disposedAt=_.first(e.rows).endtime),s.calls)?_.find(s.calls,function(e){return e.uniqueid===t.uniqueid})||s.calls.push(t):s.calls=[t];y.currentTab=s.id})}else{if(n.ListId)return d.disposition.get({ListId:n.ListId,nolimit:!0}).$promise.then(function(e){return i.dispositions=e,d.cmList.getCustomFields({id:n.ListId,nolimit:!0}).$promise}).then(function(e){i.customFields=e}).catch(M()).finally(function(){C(i)});C(i)}}else C(i)}function x(n,t){var e=_.find(y.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id===t.id&&e.channel===n});e?(e.isDraft=t.isDraft||!1,y.currentTab=e.id):C(e={type:"interaction",title:n?n.toUpperCase():"openchannel",icon:function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";case"whatsapp":return"icon-whatsapp";default:return"icon-hangouts"}}(n),color:function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";case"whatsapp":return"lime-A700";default:return"grey"}}(n),channel:n,interaction:t,isDraft:t.isDraft||!1})}function N(t){f.isSupported()?f.requestPermission().then(function(){var e,n;n={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"../../../../../../../assets/images/avatars/customer.png",body:(e=t).queue?"Queue: "+e.queue:"",focusOnclick:!0,closeOnClick:!0},f.show(e.title,n)},function(e){S.error("Please enable browser notifications!",e)}):S.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}function D(e){e&&e.uniqueid&&y.notifications[e.uniqueid]&&(c.clear(y.notifications[e.uniqueid]),delete y.notifications[e.uniqueid])}function P(n){var t=n.uniqueid;for(var e in S.debug("onVoiceChannelRemove -> evt",n),y.tabs)if(y.tabs.hasOwnProperty(e)){var a=y.tabs[e];if(a.calls){S.debug("onVoiceChannelRemove ->  key, tab, tab.calls",e,a,a.calls);var i=_.findIndex(a.calls,function(e){return e.uniqueid===t});i<0&&0<=(i=_.findIndex(a.calls,function(e){return e.uniqueid===n.linkedid}))&&(t=n.linkedid),0<=i&&!a.calls[i].disposedAt?(S.debug("Allowing disposition for call %s",a.calls[i].uniqueid),k(a.calls[i])):S.debug("Call %s not found or already completed",a.calls[i].uniqueid),a.contact&&a.contact.id&&l(L(t,a.contact.id,a),1e3)}}T()}function L(n,e,t){return function(){if(_.find(t.calls,function(e){return e.uniqueid===n}))return d.voiceCallReport.update({id:n,ContactId:e}).$promise.catch(function(e){S.error(e)})}}function k(e){e.disposedAt=new Date}function M(){return function(e){if(404===e.status)c.warning({title:o.instant("DASHBOARDS.ATTENTION"),msg:o.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){y.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}y.onClickTab=function(e){y.currentTab=e,T(y.tabs[e])},y.isActiveTab=function(e){return e===y.currentTab},y.alreadyExistsTab=w,y.addContactTab=R,y.addInteractionTab=x,y.addTab=C,y.removeTab=O,y.updateLocalStorage=T,y.closeTab=function(e){var n=!1,t=s.confirm().title("interaction"===e.type?"Do you want to close the interaction?":"Are you sure want to close the "+e.type+"?").textContent("interaction"===e.type?"":"The "+e.type+" has been modified. Closing will lose all changes!").ariaLabel("Close Contact").ok("interaction"===e.type?"YES":"OK").cancel("interaction"===e.type?"NO":"CANCEL");{if(!e.saved){var a=y.user.voicePause||y.user.chatPause||y.user.mailPause||y.user.openchannelPause||y.user.faxPause;return"interaction"===e.type&&(n=e.interaction.Account.mandatoryDisposition),s.show(t).then(function(){"interaction"===e.type&&s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(r.body),onRemoving:function(){y.user&&n&&!a&&d.user.unpause({id:y.user.id}).$promise.catch(function(e){S.error(e)})},clickOutsideToClose:!n,escapeToClose:!n,locals:{user:y.user,channel:e.channel,interaction:e.interaction}}),O(e)}).catch(function(){"interaction"===e.type&&O(e)})}if(_.forEach(e.calls,function(e){e.mandatoryDisposition&&(n=!0)}),"contact"===e.type&&0<e.calls.length){if(!n)return t._options.textContent="There is a call that hasn't been disposed yet.",s.show(t).then(function(){O(e)});var i=s.alert().title("Warning").textContent("There is a call that hasn't been disposed yet.").ok("OK");s.show(i).finally(function(){i=void 0})}else O(e)}},y.dialPreviewRecallReminder=function(e){var n=a("formatdate")(e.hopper.scheduledat),t="<div>"+o.instant("DASHBOARDS.PREVIEW_CALL_FOR")+"<b>"+e.hopper.Contact.firstName+" "+e.hopper.Contact.lastName+"</b> "+o.instant("DASHBOARDS.SCHEDULED_AT")+"<b>"+n+"</b></div>";t+="<div>"+o.instant("DASHBOARDS.LIST_NAME")+": "+e.hopper.List.name+"</div>",t+="<div style='margin-top:20px;margin-bottom:40px'>",t+="<div class='preview_cancel'><a href='#' onclick='dismissToasty("+e.hopper.id+")'>"+o.instant("DASHBOARDS.CANCEL")+"</a></div>",t+="<div class='preview_open'><a href='#' onclick='openContactTab("+e.hopper.id+")'>"+o.instant("DASHBOARDS.OPEN")+"</a></div>",t+="</div>",c.info({title:o.instant("DASHBOARDS.PREVIEW_CALL"),msg:t,showClose:!0,timeout:2e4,html:!0,onAdd:function(){y.notifications[e.hopper.id]=this.id}})},y.openContactTab=function(e){y.openPreviewDialog(e),n=e,y.toasty.clear(y.notifications[n]),delete y.notifications[n];var n},y.openPreviewDialog=function(e){d.cmHopper.getPreviewRecall({hopperId:e}).$promise.then(function(e){s.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!0,locals:{preview:e,currentUser:y.user},resolve:{customFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{nolimit:!0})}]}})})},y.toasty=c,function(){var e=i.localStorage.getItem("motion2.user:"+y.user.id);if(e)try{e=JSON.parse(e),y.tabs=e.tabs?e.tabs:{},y.currentTab=e.currentTab?e.currentTab:0,y.autoClose=!!e.autoClose&&e.autoClose,I(y.tabs[y.currentTab]),S.debug("Tabs initiated correctly")}catch(e){S.error(e)}}(),e.$on("$destroy",function(){for(var e in y.notifications)y.notifications.hasOwnProperty(e)&&D({uniqueid:e});t.removeAllListeners("trigger:contactmanager"),t.removeAllListeners("trigger:jscripty"),t.removeAllListeners("trigger:browser:url"),t.removeAllListeners("trigger:browser:popup"),t.removeAllListeners("notification:save"),t.removeAllListeners("notification:remove"),t.removeAllListeners("voice_queue_channel:remove"),t.removeAllListeners("voice_outbound_channel:remove")}),t.on("trigger:contactmanager",function(n){_.isNil(n.contacts)||1!==n.contacts.length?s.show({controller:"ContactSelectionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/selection/dialog.html",parent:angular.element(r.body),locals:{contacts:n.contacts,callNumber:n.evt.routeId?n.evt.destcalleridnum:n.evt.calleridnum}}).then(function(e){R(e,n.evt)}):R(n.contact,n.evt)}),t.on("trigger:jscripty",function(t){return d.jscriptyProject.get({id:t.ProjectId}).$promise.then(function(n){if(n){if(!_.isUndefined(t["xmd-contactid"]))return d.cmContact.get({id:t["xmd-contactid"]}).$promise.then(function(e){try{n.formData=Mustache.render(n.formData,_.merge(t,{user:y.user,contact:e}))}catch(e){S.error(e)}C({type:"jscripty",title:n.name,icon:"icon-script",color:"grey",project:n,call:t,contact:e})}).catch(M());try{n.formData=Mustache.render(n.formData,_.merge(t,{user:y.user}))}catch(e){S.error(e)}C({type:"jscripty",title:n.name,icon:"icon-script",color:"grey",project:n,call:t})}}).catch(M())}),t.on("trigger:bot",function(n){var t=n.calleridname&&"<unknown>"!==n.calleridname?n.calleridname:n.calleridnum,a=n.calleridnum;return d.squareMessage.get({fields:"id",limit:1,offset:0,uniqueid:n.uniqueid}).$promise.then(function(e){e.count&&C({type:"bot",title:t+" <"+a+">",icon:"fas fa-robot",color:"pink",data:{uniqueid:n.uniqueid}})})}),t.on("trigger:browser:url",function(e){if(e&&e.uri)if(e.uri=_.replace(e.uri,"&lt%3B",""),e.uri=_.replace(e.uri,"=&gt%3B=",""),e.uriLocation)switch(e.uriLocation){case"0":i.open(e.uri);break;case"1":i.open(e.uri,"_blank","width="+(e.windowWidth||"800")+",height="+e.windowHeight||"600");break;case"2":C({type:"iframe",title:e.uri,icon:"icon-google-earth",color:"blue",src:e.uri});break;default:i.open(e.uri)}else i.open(e.uri)}),t.on("trigger:browser:popup",function(e){e&&e.html&&C({type:"popup",title:e.calleridnum||"popup",icon:"icon-tablet",color:"grey",html:e.html})}),t.on("notification:save",function(e){if(e&&e.uniqueid){N(e);var n=w(e);if(n){if(d[e.channel+"Message"])return y.currentTab!==n.id&&(n.badges+=1),d[e.channel+"Message"].accept({id:e.id,UserId:y.user.id}).$promise.catch(M())}else c.wait({title:e.title,msg:e.msg||"",showClose:!1,clickToClose:!1,timeout:!1,sound:e.sound,html:!0,shake:e.shake||!1,onAdd:function(){y.notifications[e.uniqueid]=this.id},onAccept:function(){if(D(e),d[e.channel+"Message"])return d[e.channel+"Message"].accept({id:e.id,UserId:y.user.id,manual:!0}).$promise.then(function(e){x(e.channel,e.interaction),c.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(M())},onReject:function(){if(D(e),d[e.channel+"Message"])return d[e.channel+"Message"].reject({id:e.id,UserId:y.user.id}).$promise.then(function(){c.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(M())}})}}),t.on("notification:remove",D),t.on("voice_queue_channel:remove",P),t.on("voice_outbound_channel:remove",P),t.on("user:dialPreviewRecallReminder",y.dialPreviewRecallReminder)}e.$inject=["$scope","$mdDialog","$window","$translate","$document","$timeout","$filter","Auth","api","socket","toasty","globalUserLists","globalLists","globalCompanies","globalTags","license","setting","desktopNotification","msUtils","privacyManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentDashboardGeneralController",e)}(),function(){"use strict";angular.module("app.dashboards").provider("desktopNotification",function(){var f={autoClose:!0,duration:5,showOnPageHidden:!1};return{config:function(e){for(var n in e)f.hasOwnProperty(n)&&null!=e[n]&&(f[n]=e[n])},$get:["$q","$timeout","$window","PERMISSIONS",function(e,u,n,p){var g=n.Notification||n.mozNotification||n.webkitNotification;return{isSupported:v,currentPermission:h,requestPermission:function(){if(!v())return e.reject("Notification API not supported");var t=e.defer();Promise.resolve(g.requestPermission)==g.requestPermission?g.requestPermission().then(function(e){p.GRANTED===e?t.resolve(e):t.reject(e)}):g.requestPermission(function(e,n){p.GRANTED===e?t.resolve(e):t.reject(e)});return t.promise},show:function(e,n){if(n=n||{},!v()||(t=e,a=n,i=angular.isString(t),s=!a.onClick||angular.isFunction(a.onClick),!i||!s)||function(e){if(e||f.showOnPageHidden)return!(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)}(n.showOnPageHidden)||h()!==p.GRANTED)return;var t,a,i,s;var o=new g(e,n),r=n.duration||f.duration,l=void 0===n.autoClose?f.autoClose:n.autoClose;o.onclick=function(){n.onClick&&n.onClick(),n.focusOnclick&&window.focus(),n.closeOnClick&&o.close()},l&&(d=o,c=r,m=1e3*c,u(d.close.bind(d),m,!1));var d,c,m;return o},permissions:{default:p.DEFAULT,granted:p.GRANTED,denied:p.DENIED}};function v(){return!(void 0===g)}function h(){return(g||{}).permission}}]}}).provider("msNavigationAgentService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function n(e,n){if(angular.isString(e)){for(var t=e.split("."),a=t[t.length-1],i=function(e){var n=l;if(1===e.length)return n;e.pop();for(var t=0;t<e.length;t++){for(var a=e[t],i=!0,s=0;s<n.length;s++)if(n[s]._id===a){n=n[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};n.push(o),n=o.children}}return n}(t),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,n),s.uisref=d(s)):(n.children=[],!angular.isUndefined(n.weight)&&angular.isNumber(n.weight)||(n.weight=1),n._id=a,n._path=e,n.uisref=d(n),i.push(n))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){var n="";return angular.isDefined(e.state)&&(n=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(n=n+"("+angular.toJson(e.stateParams)+")")),n}this.saveItem=n,this.deleteItem=function(e){if(!angular.isString(e))return void r.error("path must be a string (eg. `dashboard.project`)");for(var n=l,t=e.split("."),a=0;a<t.length;a++)for(var i=t[a],s=0;s<n.length;s++)if(n[s]._id===i){if(n[s]._path===e)return n.splice(s,1),!0;n=n[s].children;break}return!1},this.$get=function(){var e={saveItem:n,getNavigation:function(e){if(e){for(var n=0;n<l.length;n++)if(l[n]._id===e)return[l[n]];return null}return l}};return e}}).constant("PERMISSIONS",{DEFAULT:"default",GRANTED:"granted",DENIED:"denied"})}(),function(){"use strict";function e(t){var a=this;a.setting={},a.messages={count:0,rows:[]},a.showInteraction=!1,a.init=function(e,n){{if(a.setting=n,a.tab=e,a.tab.saved=!0,a.tab&&a.tab.data&&a.tab.data.uniqueid)return t.squareMessage.get({uniqueid:a.tab.data.uniqueid}).$promise.then(function(e){a.messages=e}).finally(function(){a.showInteraction=!0});a.showInteraction=!0}},a.getMessagesAlignment=function(e){switch(a.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}}}e.$inject=["api"],angular.module("app.dashboards").controller("AgentGeneralBotController",e)}(),function(){"use strict";function e(a,d,c,t,m,i,u,p,s,o,e,r,l,n){var g=this;g.user=s.getCurrentUser(),g.detectBrowser=e.detectBrowser(),g.journey=[],g.queryHopper={fields:"id,phone,scheduledat",sort:"-updatedAt",limit:10,page:1},g.queryFinal={fields:"uniqueid,calleridnum,statedesc,starttime,disposition,secondDisposition,thirdDisposition",sort:"-updatedAt",limit:10,page:1},g.queryHistory={fields:"uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,page:1},g.hoppers={rows:[],count:0},g.finals={rows:[],count:0},g.histories={rows:[],count:0},g.journeyOptions=r.getQuery(),g.quickFilters=r.getQuickFilters(),g.addNewContact=h,g.saveContact=function(){g.errors=[],u.cmContact.update({id:g.contact.id},g.contact).$promise.then(function(e){var n=e.firstName||e.phone;return g.tab.title=g.user.privacyEnabled?l.mask(n):n,g.tab.contact=g.contact,m.$parent.vm.updateLocalStorage(),u.user.addContacts({id:s.getCurrentUser().id,ids:[e.id]})}).then(function(){return u.cmContact.setTags({id:g.contact.id,ids:g.tab.Tags}).$promise}).then(function(){g.detailForm.$pristine=!0,g.customFieldsForm.$pristine=!0,p.success({title:"Contact properly updated!",msg:g.contact.name?g.contact.name+" has been updated!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.getCustomFields=function(e){return u.cmList.getCustomFields({id:e}).$promise.then(function(e){g.tab.customFields=e}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"LIST:GETCustomFields",msg:e.data?JSON.stringify(e.data):e.toString()})})},g.call=m.$parent.vm.call,g.disposeCall=function(e,i){if(g.newContact)return void p.error({title:"ATTENTION",msg:"Please save the contact before disposing!"});d.show({controller:"DisposeCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",parent:angular.element(c.body),targetEvent:i,clickOutsideToClose:!i.mandatoryDisposition,escapeToClose:!i.mandatoryDisposition,resolve:{globalDispositions:["apiResolver",function(e){return e.resolve("disposition@get",{MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}]},onRemoving:function(){g.user&&i.mandatoryDisposition&&u.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{dispositions:g.tab.dispositions,contact:g.contact,call:i,availableCalls:g.tab.calls.length,autoClose:m.$parent.vm.autoClose}}).then(function(e){var n=e[0];for(var t in m.$parent.vm.autoClose=e[1],n&&("BLACKLIST"===n?p.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_DISPOSED")+" "+n}):"RECALLME"===n||"RESCHEDULE"===n||p.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_SAVED")})),m.$parent.$parent.$parent.vm.tabs)if(m.$parent.$parent.$parent.vm.tabs.hasOwnProperty(t)){var a=m.$parent.$parent.$parent.vm.tabs[t];_.remove(a.calls,function(e){return e.uniqueid===i.uniqueid})}0===g.tab.calls.length&&m.$parent.vm.autoClose&&m.$parent.vm.removeTab(g.tab),m.$parent.vm.updateLocalStorage()})},g.checkCallStatus=function(n){return g.checkingCallStatus=!0,u.voiceCallReport.get({uniqueid:n.uniqueid}).$promise.then(function(e){e&&0<e.rows.length&&(n.disposedAt=_.first(e.rows).endtime)}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"VOICE_CALL_REPORT:GET",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){g.checkingCallStatus=!1})},g.duplicateContact=function(e){d.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(c.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:g.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:s.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},g.mergeContact=function(e){d.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(c.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:g.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:s.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}}).then(function(e){if(e){for(var n in m.$parent.$parent.$parent.vm.tabs)if(m.$parent.$parent.$parent.vm.tabs.hasOwnProperty(n)){var t=m.$parent.$parent.$parent.vm.tabs[n];t&&t.contact&&(e.from&&e.from.id&&e.from.id===t.contact.id&&m.$parent.$parent.$parent.vm.removeTab(t),e.to&&e.to.id&&e.to.id===t.contact.id&&m.$parent.$parent.$parent.vm.removeTab(t))}e.new&&m.$parent.$parent.$parent.vm.addContactTab(e.new)}})},g.getDateFromString=y,g.addJscriptyTab=function(e){try{e.formData=Mustache.render(e.formData,{contact:g.contact,user:g.user})}catch(e){v.error(e)}try{m.$parent.$parent.$parent.vm.addTab({type:"jscripty",title:e.name,icon:"icon-script",color:"grey",project:e,contact:g.contact})}catch(e){p.error({title:"ERROR OPENING JSCRIPTY PROJECT",msg:"The project cannot be started"+JSON.stringify(e)})}},g.getHoppers=b,g.getFinals=A,g.getHistories=E,g.getJscriptyProjects=function(){if(g.jscriptyProjects)return;return g.loadingJscriptyProjects=!0,u.jscriptyProject.get({fields:"createdAt,updatedAt,id,name,description,createdAt,formData,enableUncompleteSave",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.jscriptyProjects=e||{count:0,rows:[]}}).catch(function(){p.error({title:o.instant("JSCRIPTY.JSCRIPTY"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.JSCRIPTY_GET_ERROR")})}).finally(function(){g.loadingJscriptyProjects=!1})},g.getAccounts=function(n){if(g[n+"Accounts"])return;var e="get"+_.startCase(n)+"Accounts";return g.loadingAccounts=!0,u.user[e]({id:g.user.id,attributes:["id","name"],nolimit:!0}).$promise.then(function(e){g[n+"Accounts"]=e||{count:0,rows:[]}}).catch(function(){p.error({title:o.instant(n.toUpperCase()+"."+n.toUpperCase()+"ACCOUNTS"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.ACCOUNTS_GET_ERROR",{channel:o.instant("DASHBOARDS."+n.toUpperCase())})})}).finally(function(){g.loadingAccounts=!1})},g.composeInteraction=function(e,o,r,n){var l=o.toLowerCase();d.show({controller:"Compose"+o+"InteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/"+o.toLowerCase()+"/dialog.html",parent:angular.element(c.body),clickOutsideToClose:!1,locals:{account:r,message:{to:"mail"==l?n:n.split(",")},type:"new",interaction:{Contact:g.contact}},fullscreen:!0}).then(function(s){if(!s||_.isNil(s.message)||!s.message.savedAsDraft)return u[l+"Account"].send({id:r.id},s).$promise.then(function(e){if("Mail"===o){var n=e;if(n&&n.Messages&&n.Messages.length){if(s.attachments&&s.attachments.length)for(var t=0;t<s.attachments.length;t+=1)u.attachment.update({id:s.attachments[t].id},{MailMessageId:_.head(n.Messages).id});if(p.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.closed){n.disposition=null;var a=!r.mandatoryDisposition,i=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause;d.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(c.body),onRemoving:function(){g.user&&r.mandatoryDisposition&&!i&&u.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},clickOutsideToClose:a,escapeToClose:a,locals:{user:g.user,channel:"mail",interaction:n}})}else m.$parent.vm.addInteractionTab("mail",n)}}else p.success({title:"Message properly sent!",msg:"Message has been sent!"}),m.$parent.vm.addInteractionTab(l,e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"fax"===l?p.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:o.toUpperCase()+"ACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});var e={type:"draft",channel:"mail",account:r,contact:g.contact,id:g.tab.id,openedAt:new Date,saved:!1,title:r.key+" - Untitled",content:s.message},n=a.localStorage.getItem("motion2.home.mail:"+g.user.id);if(n){var t=JSON.parse(n);t.drafts||(t.drafts={}),n=t}else n={drafts:{}};n.drafts[g.tab.id]=e,a.localStorage.setItem("motion2.home.mail:"+g.user.id,JSON.stringify(n))})},g.init=function(n,e){return g.tab=n,m.$watchGroup(["vm.detailForm.$pristine","vm.customFieldsForm.$pristine"],function(e){g.tab.saved=e[0]&&e[1]}),g.license=e,g.contact=g.tab.contact,g.newContact=!1,g.currentTab=0,u.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){g.users=e||{count:0,rows:[]},g.usersMap=_.mapValues(_.keyBy(g.users.rows,"id"),"fullname")}).then(function(){for(var e=[],n=0;n<g.tab.calls.length;n++){var t=g.tab.calls[n];e.push(u.voiceCallReport.get({uniqueid:t.uniqueid}).$promise.then(function(e){e&&0<e.rows.length&&(t.disposedAt=_.first(e.rows).endtime)}))}return i.all(e)}).then(function(){return u.user.getLists({id:g.user.id,nolimit:!0}).$promise}).then(function(e){if(g.lists=e||{count:0,rows:[]},g.contact&&g.contact.ListId){if(g.list=_.find(g.lists.rows,{id:g.contact.ListId}),g.list)return;return u.cmList.get({id:g.contact.ListId}).$promise.then(function(e){e&&(g.list=e,g.lists.rows=_.unionBy(g.lists.rows,[g.list]))})}}).then(function(){if(g.contact&&g.contact.id){var e={id:g.contact.id,ListId:g.contact.ListId,limit:1,offset:0,sort:"-updatedAt"};return u.cmContact.get(e).$promise.then(function(e){return g.contact=e,g.tab.contact=e,u.user.addContacts({id:g.user.id,ids:[g.contact.id]})}).then(function(){if(g.contact.ListId)return u.disposition.get({ListId:g.contact.ListId,nolimit:!0}).$promise.then(function(e){return g.tab.dispositions=e,u.cmList.getCustomFields({id:g.contact.ListId,nolimit:!0}).$promise}).then(function(e){g.tab.customFields=e})}).then(function(){try{g.tab.companies=m.$parent.$parent.$parent.vm.globalCompanies,g.tab.tags=m.$parent.$parent.$parent.vm.globalTags,g.tab.autoCreate=0}catch(e){}b(),A(),E()}).then(function(){return u.cmContact.getTags({id:g.contact.id}).$promise.then(function(e){g.tab.Tags=_.map(e.rows,"id")})})}return g.newContact=!0,n.autoCreate?h():void 0}).finally(function(){g.contact&&g.contact.id&&(S(),g.contact.dateOfBirth=y(g.contact.dateOfBirth))})},g.hasPermission=function(e){return s.hasPermission(e)},g.openInteraction=function(e){try{return m.$parent.$parent.$parent.vm.addInteractionTab(e.channel,e)}catch(e){p.error({title:o.instant("CONTACTMANAGER.CUSTOMER_JOURNEY"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.INTERACTION_OPEN_ERROR")})}},g.getCustomerJourney=S,g.loadMoreJourney=function(){return i(function(e){var n=g.journey.length;return e(S(n))})};var v=n.getLogger("agent.general.contact");function h(){g.errors=[],u.cmContact.save(g.contact).$promise.then(function(e){g.contact.id=e.id,g.newContact=!1;var n=e.firstName||e.phone;return g.tab.title=g.user.privacyEnabled?l.mask(n):n,g.tab.contact=g.contact,u.user.addContacts({id:s.getCurrentUser().id,ids:[e.id]})}).then(function(){g.detailForm.$pristine=!0,g.customFieldsForm.$pristine=!0,p.success({title:"Contact properly created",msg:g.contact.firstName?g.contact.firstName+" has been created!":""})}).then(function(){return u.cmContact.setTags({id:g.contact.id,ids:g.tab.Tags}).$promise}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}function f(n){return function(e){g[n]=e||{count:0,rows:[]}}}function b(){g.contact&&g.contact.id&&(g.queryHopper.ContactId=g.contact.id,g.queryHopper.offset=(g.queryHopper.page-1)*g.queryHopper.limit,g.promise=u.cmHopper.get(g.queryHopper,f("hoppers")).$promise)}function A(){g.contact&&g.contact.id&&(g.queryFinal.ContactId=g.contact.id,g.queryFinal.offset=(g.queryFinal.page-1)*g.queryFinal.limit,g.promise=u.cmHopperFinal.get(g.queryFinal,f("finals")).$promise)}function E(){g.contact&&g.contact.id&&(g.queryHistory.ContactId=g.contact.id,g.queryHistory.offset=(g.queryHistory.page-1)*g.queryHistory.limit,g.promise=u.cmHopperHistory.get(g.queryHistory,f("histories")).$promise)}function y(e){return null===e?void 0:new Date(e)}function S(e){g.journeyIsLoading=!0;var n=_.merge(g.journeyOptions,{id:g.contact.id,offset:e||0});return r.get(g.journey,n).then(function(e){g.journey=e.journey,g.canLoadMoreJourney=e.loadMore}).finally(function(){g.journeyIsLoading=!1})}m.$on("$destroy",function(){}),m.$watch("currentTab",function(){1===g.currentTab&&(b(),A(),E())});var T=!0,I=1;m.$watch("queryHopper.filter",function(e,n){T?t(function(){T=!1}):(n||(I=g.queryHopper.page),e!==n&&(g.queryHopper.page=1),e||(g.queryHopper.page=I),b())}),m.$watch("queryFinal.filter",function(e,n){T?t(function(){T=!1}):(n||(I=g.queryFinal.page),e!==n&&(g.queryFinal.page=1),e||(g.queryFinal.page=I),A())}),m.$watch("queryHistory.filter",function(e,n){T?t(function(){T=!1}):(n||(I=g.queryHistory.page),e!==n&&(g.queryHistory.page=1),e||(g.queryHistory.page=I),E())})}e.$inject=["$window","$mdDialog","$document","$timeout","$scope","$q","api","toasty","Auth","$translate","msUtils","customerJourneyManager","privacyManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentGeneralContactController",e)}(),function(){"use strict";function e(n,t,i,s,o,e,a,r,l,d,c,m,u,p,g){var v=this;v.user=d.getCurrentUser(),v.isReschedule=!1,v.recallme=!1,v.queueCampaign=void 0,v.queueCampaigns={count:0,rows:[]},v.dispositions=_.orderBy(_.concat([],e.rows,a.rows),["name"],["asc"]),v.contact=l,v.call=r,v.note=v.call.note||void 0,v.dialerCall=!1,v.hasBlackLists=!1,v.contactTZTime,v.availableCalls=m,v.autoClose=u,v.recalcTZTime=b,v.hopper={minDate:new Date,dateTime:new Date,scheduledAt:new Date},p.$watch("vm.contact.dialTimezone",function(){b()});var h=g.getLogger("dashboard","agent.general.contact.dispose");function f(){return i(function(n){o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name,dialActive,dialMethod",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){v.queueCampaigns=e||{count:0,rows:[]},n()}).catch(function(e){h.error(e),s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})})}function b(){var e=v.dialerCall?Number(v.call["xmd-voicequeueid"]):v.queueCampaign?v.queueCampaign.id:v.call["xmd-campaignid"]?Number(v.call["xmd-campaignid"]):null;if(e)o.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,_.isNil(v.contact.dialTimezone)&&(v.contact.dialTimezone=v.hopper.dialTimezone),n)o.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}});else{o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}}function A(){var e=v.selectedDisposition?v.selectedDisposition.name.toLowerCase():void 0;return{id:v.call.uniqueid,disposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,secondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,thirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null,dispositionat:moment(),amd:"amd"===e,fax:"fax"===e,blacklist:"blacklist"===e,recallme:"recallme"===e,UserId:"recallme"===e?d.getCurrentUser().id:null,OwnerId:d.getCurrentUser().id}}function E(e){t.hide([e,v.autoClose])}v.call&&v.call.variables&&v.call.variables["xmd-voicequeueid"]?(v.dialerCall=!0,o.voiceQueue.getBlackLists({id:v.call.variables["xmd-voicequeueid"]}).$promise.then(function(e){e&&e.rows&&0<e.rows.length&&(v.hasBlackLists=!0)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})):f(),v.onDispositionChange=function(e){switch(e){case"first":v.selectedDisposition=v.firstLevelDisposition,v.anySecondLevelDisposition=_.some(v.dispositions,["ParentId",v.firstLevelDisposition.id]),v.secondLevelDisposition=void 0,v.thirdLevelDisposition=void 0,v.anyThirdLevelDisposition=!1;break;case"second":v.selectedDisposition=v.secondLevelDisposition,v.anyThirdLevelDisposition=_.some(v.dispositions,["ParentId",v.secondLevelDisposition.id]);break;case"third":v.selectedDisposition=v.thirdLevelDisposition}},v.clearDispositionSelection=function(e){"second"===e?(v.secondLevelDisposition=void 0,v.thirdLevelDisposition=void 0,v.selectedDisposition=v.firstLevelDisposition):"third"===e&&(v.thirdLevelDisposition=void 0,v.selectedDisposition=v.secondLevelDisposition)},v.saveDisposition=function(e){v.selectedDisposition=_.isNil(e)?v.selectedDisposition:{name:e},e&&(v.firstLevelDisposition=v.selectedDisposition);v.call.note=v.note,o.voiceCallReport.update({id:v.call.uniqueid,userDisposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,userSecondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,userThirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null,note:v.note,UserId:d.getCurrentUser().id,ContactId:v.contact.id}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICECALLREPORT",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.voiceRecording.get({uniqueid:v.call.uniqueid}).$promise.then(function(e){if(e)for(var n=0;n<e.rows.length;n+=1)o.voiceRecording.update({id:e.rows[n].id,userDisposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,userSecondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,userThirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})}),v.dialerCall&&(o.cmHopperFinal.update(A()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERFINAL",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.cmHopperHistory.update(A()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERHISTORY",msg:e.data?JSON.stringify(e.data):e.toString()})}));if(_.isNil(v.selectedDisposition))E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"");else switch(v.selectedDisposition.name.toLowerCase()){case"blacklist":v.call&&v.call.variables&&v.call.variables["xmd-voicequeueid"]&&function(e){if(e)o.voiceQueue.getBlackLists({id:e,type:"outbound",fields:"id"}).$promise.then(function(e){var n=[];if(e&&0<e.count){for(var t=0;t<e.rows.length;t+=1){var a=angular.copy(v.contact);delete a.id,a.ListId=e.rows[t].id,n.push(o.cmContact.save(a).$promise)}return i.all(n)}s.success({title:c.instant("DASHBOARDS.INFO"),msg:c.instant("DASHBOARDS.NOTAVAILABLE")+" "+v.selectedDisposition}),v.selectedDisposition=void 0}).then(function(e){e&&E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEBLACKLIST",msg:e.data?JSON.stringify(e.data):e.toString()}),E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")})}(v.call.variables["xmd-voicequeueid"]);break;case"reschedule":v.isReschedule=!0,v.recallme=!1;break;case"recallme":v.isReschedule=!0,v.recallme=!0,v.user.selectRecallMeCampaign&&f().then(function(){v.originalCampaign=_.find(v.queueCampaigns.rows,["id",v.call.variables["xmd-voicequeueid"]]);var e=JSON.parse(n.localStorage.getItem("motion2.user:"+v.user.id));v.queueCampaign=e.previewCampaignId?_.find(v.queueCampaigns.rows,["id",Number(e.previewCampaignId)]):v.originalCampaign});break;default:E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}},v.closeDialog=function(){t.cancel()},v.saveReschedule=function(){v.disable=!0;var e=null;v.queueCampaign?e=v.queueCampaign.id:v.dialerCall&&(e=Number(v.call["xmd-voicequeueid"]));return o.cmHopper.save({phone:v.contact.phone,UserId:v.recallme?d.getCurrentUser().id:null,ContactId:v.contact.id,ListId:v.contact.ListId,VoiceQueueId:e,scheduledat:moment(v.hopper.scheduledAt).format("YYYY-MM-DD HH:mm:ss"),dialTimezone:v.contact.dialTimezone,priority:3,recallme:v.recallme,OwnerId:d.getCurrentUser().id}).$promise.then(function(){if(v.dialerCall&&(o.cmHopperFinal.update({id:v.call.uniqueid,rescheduled:!0,rescheduledat:moment(v.hopper.scheduledAt).format("YYYY-MM-DD HH:mm:ss"),recallme:v.recallme}).$promise.catch(function(e){h.error(e)}),v.user.selectRecallMeCampaign)){var e=JSON.parse(n.localStorage.getItem("motion2.user:"+v.user.id));e.previewCampaignId=v.queueCampaign.id,n.localStorage.setItem("motion2.user:"+v.user.id,JSON.stringify(e))}}).then(function(){return o.cmContact.update({id:v.contact.id,dialTimezone:v.contact.dialTimezone})}).then(function(){s.success({title:c.instant("DASHBOARDS.INFO"),msg:c.instant("DASHBOARDS.CALL_DISPOSED")+" "+(v.recallme?c.instant("DASHBOARDS.RECALLME"):c.instant("DASHBOARDS.RESCHEDULE"))})}).catch(function(e){h.error(e),E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}).finally(function(){v.disable=!1,E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")})}}e.$inject=["$window","$mdDialog","$q","toasty","api","dispositions","globalDispositions","call","contact","Auth","$translate","availableCalls","autoClose","$scope","ClientSideLoggingService"],angular.module("app.staff").controller("DisposeCallDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.call=l,u.contact=r,u.hopper={minDate:new Date,dateTime:new Date},u.closeDialog=function(){a.cancel()},u.saveDialog=function(){return u.disable=!0,o.cmHopper.save({phone:u.contact.phone,UserId:c?d.getCurrentUser().id:null,ContactId:u.contact.id,ListId:u.contact.ListId,VoiceQueueId:Number(u.call["xmd-voicequeueid"]),scheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c,OwnerId:d.getCurrentUser().id}).$promise.then(function(){o.cmHopperFinal.update({id:u.call.uniqueid,rescheduled:!0,rescheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c}).$promise}).then(function(){s.success({title:m.instant("DASHBOARDS.INFO"),msg:m.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c?m.instant("DASHBOARDS.RECALLME"):m.instant("DASHBOARDS.RESCHEDULE"))}),a.hide()}).catch(function(e){a.cancel(e)}).finally(function(){u.disable=!1})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","toasty","api","contact","call","Auth","recallme","$translate"],angular.module("app.staff").controller("RescheduleCallDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s){var o=this;o.callNumber=i,o.page=1,o.onInit=function(){n.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){o.lists=_.chain(e.rows).keyBy("id").mapValues("name").value(),n.cmCustomField.get({fields:"id,alias",nolimit:!0}).$promise.then(function(e){o.customFields=e.rows,o.contacts=_.map(t,function(t){return Object.keys(t).forEach(function(e){if(Number(t[e])===Number(o.callNumber))if(e.startsWith("cf_")){var n=_.find(o.customFields,["id",Number(_.trimStart(e,"cf_"))]);t.matchingField=n?n.alias:a.instant("DASHBOARDS.UNKNOWN")}else t.matchingField=e}),t})})}).then(function(){o.paginatedContacts=_.chunk(t,4)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.selectContact=function(){e.hide(o.selectedContact)}}e.$inject=["$mdDialog","$translate","api","contacts","callNumber","toasty"],angular.module("app.dashboards").controller("ContactSelectionController",e)}(),function(){"use strict";function e(e,n){var t=n(function(){},999);e.$on("$destroy",function(){t&&(n.cancel(t),t=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeAbandonedController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d){var c=this;function m(){return o.disposition.get({fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise.then(function(e){return c.dispositions=e?e.rows:[],o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise}).then(function(e){c.queues=e||{count:0,rows:[]},c.queuesMap=_.mapValues(_.keyBy(c.queues.rows,"name"),"name"),c.defaultQueues=c.queues.rows?_.map(c.queues.rows,"name").join(","):void 0}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.currentUser.name,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:c.queues.rows,ngValue:"name",clearAll:!1}]}).catch(function(e){console.log(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.abandoned.bull.calls:"+c.currentUser.id);if(e)(e=JSON.parse(e)).query&&(c.query=_.merge(e.query,c.query));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};c.query.createdAt=n}c.isSearchBarVisible=!!c.query.filter,u()})}function u(){c.query.queue=c.query.queue||c.defaultQueues.split(","),c.query.offset=(c.query.page-1)*c.query.limit;var e={query:c.query};t.localStorage.setItem("motion2.home.abandoned.bull.calls:"+c.currentUser.id,JSON.stringify(e)),c.promise=o.voiceQueueReport.getVoiceQueuesReport(c.query,p).$promise}function p(e){c.abandonedCalls=e||{count:0,rows:[]},c.refresh=!0}c.showTooltip=!1,c.refresh=!0,c.disable=[],c.dispositions={count:0,rows:[]},c.currentUser=r.getCurrentUser(),c.queues={},c.abandonedCalls={count:0,rows:[]},c.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},c.getAbandonedCalls=u,c.refreshAbandonedCalls=function(){c.showTooltip=!1,u()},c.onInit=m,c.reserved=function(e){e&&(c.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?c.currentUser.name:null,assigned:e.assigned}).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[e.id]=!1,e.lastAssignedTo=e.assigned?c.currentUser.name:null}))},c.dispose=function(t){a.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(i.body),targetEvent:t,locals:{dispositions:c.dispositions,call:t}}).then(function(e){if(e){c.disable[t.id]=!0;var n={id:t.id,lastAssignedTo:t.assigned?c.currentUser.name:null,assigned:t.assigned,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[t.id]=!1,t.disposition=e.firstLevel,t.secondDisposition=e.secondLevel,t.thirdDisposition=e.thirdLevel})}})},c.call=e.$parent.$parent.$parent.$parent.vm.call,c.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,c.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,c.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",function(e){c.queuesMap&&"outbound"===e.type&&c.queuesMap[e.queue]&&(c.showTooltip=!0)}),l.onWithoutApply("voiceQueueReport:update",function(e){if(e){var n=_.findIndex(c.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(c.abandonedCalls.rows[n],e)}}),m(),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeAbandonedBullController",e)}(),function(){"use strict";function e(n,e,t){var a=this;a.dispositions=e,a.call=t,a.note=a.call.note||void 0,a.onDispositionChange=function(e){switch(e){case"first":a.selectedDisposition=a.firstLevelDisposition,a.anySecondLevelDisposition=_.some(a.dispositions,["ParentId",a.firstLevelDisposition.id]),a.secondLevelDisposition=void 0,a.thirdLevelDisposition=void 0,a.anyThirdLevelDisposition=!1;break;case"second":a.selectedDisposition=a.secondLevelDisposition,a.anyThirdLevelDisposition=_.some(a.dispositions,["ParentId",a.secondLevelDisposition.id]);break;case"third":a.selectedDisposition=a.thirdLevelDisposition}},a.clearDispositionSelection=function(e){"second"===e?(a.secondLevelDisposition=void 0,a.thirdLevelDisposition=void 0,a.selectedDisposition=a.firstLevelDisposition):"third"===e&&(a.thirdLevelDisposition=void 0,a.selectedDisposition=a.secondLevelDisposition)},a.saveDisposition=function(){a.call.note=a.note;var e={firstLevel:a.firstLevelDisposition?a.firstLevelDisposition.name:void 0,secondLevel:a.secondLevelDisposition?a.secondLevelDisposition.name:void 0,thirdLevel:a.thirdLevelDisposition?a.thirdLevelDisposition.name:void 0};n.hide(e)},a.closeDialog=function(){n.cancel()}}e.$inject=["$mdDialog","dispositions","call"],angular.module("app.dashboards").controller("DisposeAbandonedCallDialogController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d){var c=this;function m(){return o.disposition.get({fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise.then(function(e){return c.dispositions=e?e.rows:[],o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise}).then(function(e){c.queues=e||{count:0,rows:[]},c.queuesMap=_.mapValues(_.keyBy(c.queues.rows,"name"),"name"),c.defaultQueues=c.queues.rows?_.map(c.queues.rows,"name").join(","):void 0}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.currentUser.name,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_QUEUE",options:c.queues.rows,ngValue:"name",clearAll:!1}]}).catch(function(e){console.log(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.abandoned.voice.calls:"+c.currentUser.id);if(e)(e=JSON.parse(e)).query&&(c.query=_.merge(e.query,c.query));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};c.query.createdAt=n}c.isSearchBarVisible=!!c.query.filter,u()})}function u(){c.query.queue=c.query.queue||c.defaultQueues.split(","),c.query.offset=(c.query.page-1)*c.query.limit;var e={query:c.query};t.localStorage.setItem("motion2.home.abandoned.voice.calls:"+c.currentUser.id,JSON.stringify(e)),c.promise=o.voiceQueueReport.getVoiceQueuesReport(c.query,p).$promise}function p(e){c.abandonedCalls=e||{count:0,rows:[]},c.refresh=!0}c.showTooltip=!1,c.refresh=!0,c.disable=[],c.dispositions={count:0,rows:[]},c.currentUser=r.getCurrentUser(),c.queues={},c.abandonedCalls={count:0,rows:[]},c.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},c.getAbandonedCalls=u,c.refreshAbandonedCalls=function(){c.showTooltip=!1,u()},c.onInit=m,c.reserved=function(e){e&&(c.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?c.currentUser.name:null,assigned:e.assigned}).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[e.id]=!1,e.lastAssignedTo=e.assigned?c.currentUser.name:null}))},c.dispose=function(t){a.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(i.body),targetEvent:t,locals:{dispositions:c.dispositions,call:t}}).then(function(e){if(e){c.disable[t.id]=!0;var n={id:t.id,lastAssignedTo:t.assigned?c.currentUser.name:null,assigned:t.assigned,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[t.id]=!1,t.disposition=e.firstLevel,t.secondDisposition=e.secondLevel,t.thirdDisposition=e.thirdLevel})}})},c.call=e.$parent.$parent.$parent.$parent.vm.call,c.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,c.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,c.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",function(e){c.queuesMap&&"inbound"===e.type&&c.queuesMap[e.queue]&&(c.showTooltip=!0)}),l.onWithoutApply("voiceQueueReport:update",function(e){if(e){var n=_.findIndex(c.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(c.abandonedCalls.rows[n],e)}}),m(),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeAbandonedVoiceController",e)}(),function(){"use strict";function e(n,a,t,e,i){var s=this;function o(){var e=angular.element(".agent-general-home-navbar button.current")[0];e&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}s.user=t.getCurrentUser(),s.license={},s.plugin={},s.setting={},s.sidebar="dashboard",s.draftManager=i,s.navigation=e.getNavigation(),s.addContactTab=n.$parent.vm.addContactTab,s.addInteractionTab=n.$parent.vm.addInteractionTab,s.init=function(e,n){s.license=e,s.setting=n;var t=a.localStorage.getItem("motion2.home:"+s.user.id);if(t){try{t=JSON.parse(t),s.sidebar=t.currentSidebarTab?t.currentSidebarTab:"dashboard"}catch(e){console.error(e),s.sidebar="dashboard"}"mail"===s.sidebar&&s.draftManager.init()}},s.changeSidebarTab=function(e){s.sidebar=e.view,"plugin"===s.sidebar&&(s.plugin=e.stateParams,s.pluginId=e.id,n.$broadcast("pluginUpdated",{plugin:s.plugin}));a.localStorage.setItem("motion2.home:"+s.user.id,JSON.stringify({currentSidebarTab:e.view}))},s.hasPermission=function(e){return t.hasPermission(e)},angular.element(a).on("resize",o),n.$on("$destroy",function(){angular.element(a).off("resize",o)}),n.$watch("vm_home.sidebar",function(e,n){"mail"===e?s.draftManager.init():s.draftManager.drafts={}})}e.$inject=["$scope","$window","Auth","msNavigationAgentService","draftManager"],angular.module("app.dashboards").controller("AgentGeneralHomeController",e)}(),function(){"use strict";function e(t,n,i,s,a,o,r,e,l,d){var c=this;function m(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(c.chatAccounts.rows,function(e){return{model:"chatWebsite",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function u(e){!c.reloadingInteractions&&0<c.setting.chatInteractionsReloadTimeout&&E(!0),c.searchInProgress=!1,c.reloadingInteractions=!1,c.chatInteractions=e||{count:0,rows:[]};for(var n=0;n<c.chatInteractions.rows.length;n+=1)g(c.chatInteractions.rows[n])}function p(e,n){c.searchInProgress=!0,e||(c.query.page=1),c.query.offset=(c.query.page-1)*c.query.limit;var t=a.localStorage.getItem("motion2.home.chat:"+c.user.id);(t=t?JSON.parse(t):{}).query=c.query,a.localStorage.setItem("motion2.home.chat:"+c.user.id,JSON.stringify(t)),c.promise=r.chatInteraction.get(c.query,u).$promise}function g(e){"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function v(e){var n=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function h(e){var n=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function f(e){if(e){var n=_.find(c.chatInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),c.query.sort){var t=_.startsWith(c.query.sort,"-")?"desc":"asc";c.chatInteractions.rows=_.orderBy(c.chatInteractions.rows,_.trimStart(c.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===c.setting.chatInteractionsReloadTimeout&&p(c.query.page)}}function b(e){if(e){var n=_.find(c.chatInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function A(e){if(e&&!e.secret){var n=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function E(e){e&&c.interactionsInterval&&n.cancel(c.interactionsInterval),c.interactionsInterval=n(function(){c.reloadingInteractions=!0,c.searchInProgress||p()},1e3*c.setting.chatInteractionsReloadTimeout)}c.user=e.getCurrentUser(),c.license={},c.setting={},c.tags={count:0,rows:[]},c.chatInteractions={count:0,rows:[]},c.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},c.sectionColor="green-A700",c.onInit=function(e,n){return c.license=e,c.setting=n,r.user["get"+_.upperFirst("ChatWebsites")]({id:c.user.id,nolimit:!0}).$promise.then(function(e){return c.chatAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){c.tags=e||{count:0,rows:[]}}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Website",key:"ChatWebsiteId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:c.chatAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:c.tags.rows,placeholder:"DASHBOARDS.TAGS"}],c.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Customer Ip",column:"customerIp",type:"text",options:{excludedOperators:["$eq","$ne","$startsWith","$endsWith"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Website",column:"ChatWebsiteId",type:"multiselect",options:{route:{model:"user",action:"getChatWebsites",params:{id:c.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:m("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:m("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:m("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.chat:"+c.user.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.merge(c.query,e.query),_.isEmpty(c.chatAccounts.rows)?c.query.ChatWebsiteId=[]:_.isEmpty(c.query.ChatWebsiteId)&&(c.query.ChatWebsiteId=_(c.chatAccounts.rows).map("id").take().value()),c.query.sort&&0<=c.query.sort.indexOf("lastMessage")&&(c.query=_.omit(c.query,"sort")),c.query.includeAll=!0,c.isSearchBarVisible=!(c.query.search||!c.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={ChatWebsiteId:_.map(c.chatAccounts.rows,"id"),createdAt:n};c.query=_.merge(c.query,t)}l.on("chatInteraction:save",f),l.on("chatInteraction:update",f),l.on("chatInteractionTags:save",b),l.on("chatMessage:save",A),l.on("chatMessage:update",A),l.on("user_has_chat_interactions:save",v),l.on("user_has_chat_interactions:remove",h),p(c.query.page),0<c.setting.chatInteractionsReloadTimeout&&E()})},c.success=u,c.getChatInteractions=p,c.showChatInteraction=function(e,n){t.$parent.vm.addInteractionTab("chat",n)},c.downloadChatInteraction=function(e,s,n){r.chatInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="chat-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadChatInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.disposeInteraction=function(e,t){var a=c.user.voicePause||c.user.chatPause||c.user.mailPause||c.user.openchannelPause||c.user.faxPause,n=!t.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){c.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:c.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:c.user,channel:"chat",interaction:t}})},c.getContactLabel=g,c.getAgentLabel=function(e){if(e.UserId)return e.UserId===c.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},c.getChatWebsiteLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},c.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:c.sectionColor,fields:c.advancedSearch.fields,storagePath:"home.chat"},fullscreen:!0}).then(function(e){c.isSearchBarVisible=!(e.value||!c.query.filter),e.apply&&(c.query.search=e.value,p())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},t.$on("$destroy",function(){l.removeAllListeners("chatMessage:save"),l.removeAllListeners("chatMessage:update"),l.removeAllListeners("chatInteraction:save"),l.removeAllListeners("chatInteractionTags:save"),l.removeAllListeners("chatInteraction:update"),l.removeAllListeners("user_has_chat_interactions:save"),l.removeAllListeners("user_has_chat_interactions:remove"),c.interactionsInterval&&n.cancel(c.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeChatController",e)}(),function(){"use strict";function e(t,n,e,a,i,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.contacts=e||{count:0,rows:[]}}function c(e,n){l.searchInProgress=!0,o.cmContact.describe({id:l.query.ListId}).$promise.then(function(e){return _(e.toJSON()).omit("UserId").values().map(function(e){return function(e){var n={name:_.startCase(e.displayName),column:e.columnName,options:{}};if(e.custom)switch(e.custom.type){case"text":n.type="text";break;case"select":n.type="multiselect",n.values=_.map(JSON.parse(e.custom.values),function(e,n){return{id:n,name:e.value,value:e.value}}),n.options.field="name";break;case"switch":n.type="select",n.values=[{id:1,translate:"DASHBOARDS.ENABLED"},{id:0,translate:"DASHBOARDS.DISABLED"}],n.options.excludedOperators=["$ne"];break;case"number":n.type="number";break;case"datetime":n.type="date"}else switch(e.columnName){case"dateOfBirth":n.type="date";break;case"CompanyId":n.name="Company",n.type="autocomplete",n.options.route={model:"cmCompany",action:"get",params:{fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;case"ListId":n.name="List",n.type="autocomplete",n.options.route={model:"user",action:"getLists",params:{id:l.currentUser.id,fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;default:_.includes(e.type.toLowerCase(),"int")?n.type="number":_.includes(e.type.toLowerCase(),"date")?n.type="date":n.type="text"}return n}(e)}).value()}).then(function(e){l.advancedSearch.fields=e;var n=_.findIndex(e,function(e){return _.startsWith(e.column,"cf_")})||e.length-1;n<0&&(n=e.length),l.advancedSearch.fields.splice(n,0,{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"DESCRIBE_CM_CONTACTS",msg:e.data?JSON.stringify(e.data.message):e.toString()})}),e||(l.query.page=1),l.query.offset=(l.query.page-1)*l.query.limit;var t=i.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);(t=t?JSON.parse(t):{}).query=l.query,i.localStorage.setItem("motion2.home.contacts:"+l.currentUser.id,JSON.stringify(t)),l.promise=o.cmContact.get(l.query,d).$promise}l.currentUser=s.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1},l.advancedSearch={fields:[]},l.sectionColor="red",l.getContacts=c,l.refreshContacts=function(){c()},l.mergeContact=function(e,n){a.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,n){a.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e){return o.cmContact.get({id:e}).$promise.then(function(e){n.$parent.vm.addContactTab(e)})},l.call=n.$parent.vm.call,l.onInit=function(){o.user.getLists({id:l.currentUser.id,fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),o.tag.get({sort:"name"}).$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"List",key:"ListId",type:"multiselect",label:"CONTACTMANAGER.SELECT_LIST",options:l.lists.rows,clearAll:!1},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:l.tags.rows,placeholder:"DASHBOARDS.TAGS"}]}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query),_.isEmpty(l.lists.rows)?l.query.ListId=[]:_.isEmpty(l.query.ListId)&&(l.query.ListId=_(l.lists.rows).map("id").take().value()))}catch(e){console.log(e)}else l.query.ListId=_.map(l.lists.rows,"id");l.isSearchBarVisible=!(l.query.search||!l.query.filter),c()})},l.openAdvancedSearch=function(){a.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{color:l.sectionColor,fields:l.advancedSearch.fields,storagePath:"home.contacts"},fullscreen:!0}).then(function(e){l.isSearchBarVisible=!(e.value||!l.query.filter),e.apply&&(l.query.search=e.value,c())}).catch(function(e){r.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}e.$inject=["$document","$scope","$timeout","$mdDialog","$window","Auth","api","toasty"],angular.module("app.dashboards").controller("AgentHomeContactsController",e)}(),function(){"use strict";function e(e,n){var t=n(function(){},999);e.$on("$destroy",function(){t&&(n.cancel(t),t=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeDashboardController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,n){c.rpcVoiceQueues[n]&&(c.voiceQueues[n].waiting=c.rpcVoiceQueues[n].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"outbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"outbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"outbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardBullController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcChatQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.chatQueuesTotal=e.count?e.count:0,c.chatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.chatQueues,function(e,n){c.rpcChatQueues[n]&&(c.chatQueues[n].waiting=c.rpcChatQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.chatQueues={},c.chatQueuesTotal=0,c.rpcChatQueues={},c.paginatedInteractions=[],c.deleteChatQueuesWaitingInteractions=[],c.rpcChatQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"chat",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getChatQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.chatQueues[e.id]&&c.rpcChatQueues[e.id]&&(_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onSaveChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]=_.pick(e,m))},c.onUpdateChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]&&_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),c.chatQueues[e.id]&&_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onRemoveChatQueue=function(e){_.isNil(e)||(delete c.rpcChatQueues[e.id],delete c.chatQueues[e.id])},c.onSaveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onRemoveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onSaveChatQueueChannel=function(e){c.chatQueues[e.queue_id]&&(c.rpcChatQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveChatQueueChannel=function(e){delete c.rpcChatQueuesWaitingInteractions[e.id],u&&c.deleteChatQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("chat_queue:save",c.onSaveQueue),l.onWithoutApply("chatQueue:save",c.onSaveChatQueue),l.onWithoutApply("chatQueue:update",c.onUpdateChatQueue),l.onWithoutApply("chatQueue:remove",c.onRemoveChatQueue),l.onWithoutApply("userChatQueue:save",c.onSaveUserChatQueue),l.onWithoutApply("userChatQueue:remove",c.onRemoveUserChatQueue),l.onWithoutApply("chat_queue_waiting_interaction:save",c.onSaveChatQueueChannel),l.onWithoutApply("chat_queue_waiting_interaction:remove",c.onRemoveChatQueueChannel),o.rpc.getChatQueues().$promise.then(function(e){c.rpcChatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"chat"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getChatQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcChatQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteChatQueuesWaitingInteractions.length;e+=1)delete c.rpcChatQueuesWaitingInteractions[c.deleteChatQueuesWaitingInteractions[e]];u=!1,c.deleteChatQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getChatQueues())}),e.$on("$destroy",function(){l.removeAllListeners("chat_queue:save"),l.removeAllListeners("chatQueue:save"),l.removeAllListeners("chatQueue:update"),l.removeAllListeners("chatQueue:remove"),l.removeAllListeners("userChatQueue:save"),l.removeAllListeners("userChatQueue:remove"),l.removeAllListeners("chat_queue_waiting_interaction:save"),l.removeAllListeners("chat_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelChatController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcFaxQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.faxQueuesTotal=e.count?e.count:0,c.faxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.faxQueues,function(e,n){c.rpcFaxQueues[n]&&(c.faxQueues[n].waiting=c.rpcFaxQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.faxQueues={},c.faxQueuesTotal=0,c.rpcFaxQueues={},c.paginatedInteractions=[],c.deleteFaxQueuesWaitingInteractions=[],c.rpcFaxQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"fax",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getFaxQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.faxQueues[e.id]&&c.rpcFaxQueues[e.id]&&(_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onSaveFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]=_.pick(e,m))},c.onUpdateFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]&&_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),c.faxQueues[e.id]&&_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onRemoveFaxQueue=function(e){_.isNil(e)||(delete c.rpcFaxQueues[e.id],delete c.faxQueues[e.id])},c.onSaveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onRemoveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onSaveFaxQueueChannel=function(e){c.faxQueues[e.queue_id]&&(c.rpcFaxQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveFaxQueueChannel=function(e){delete c.rpcFaxQueuesWaitingInteractions[e.id],u&&c.deleteFaxQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("fax_queue:save",c.onSaveQueue),l.onWithoutApply("faxQueue:save",c.onSaveFaxQueue),l.onWithoutApply("faxQueue:update",c.onUpdateFaxQueue),l.onWithoutApply("faxQueue:remove",c.onRemoveFaxQueue),l.onWithoutApply("userFaxQueue:save",c.onSaveUserFaxQueue),l.onWithoutApply("userFaxQueue:remove",c.onRemoveUserFaxQueue),l.onWithoutApply("fax_queue_waiting_interaction:save",c.onSaveFaxQueueChannel),l.onWithoutApply("fax_queue_waiting_interaction:remove",c.onRemoveFaxQueueChannel),o.rpc.getFaxQueues().$promise.then(function(e){c.rpcFaxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"fax"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getFaxQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcFaxQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteFaxQueuesWaitingInteractions.length;e+=1)delete c.rpcFaxQueuesWaitingInteractions[c.deleteFaxQueuesWaitingInteractions[e]];u=!1,c.deleteFaxQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getFaxQueues())}),e.$on("$destroy",function(){l.removeAllListeners("fax_queue:save"),l.removeAllListeners("faxQueue:save"),l.removeAllListeners("faxQueue:update"),l.removeAllListeners("faxQueue:remove"),l.removeAllListeners("userFaxQueue:save"),l.removeAllListeners("userFaxQueue:remove"),l.removeAllListeners("fax_queue_waiting_interaction:save"),l.removeAllListeners("fax_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelFaxController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcMailQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.mailQueuesTotal=e.count?e.count:0,c.mailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.mailQueues,function(e,n){c.rpcMailQueues[n]&&(c.mailQueues[n].waiting=c.rpcMailQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.mailQueues={},c.mailQueuesTotal=0,c.rpcMailQueues={},c.paginatedInteractions=[],c.deleteMailQueuesWaitingInteractions=[],c.rpcMailQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"mail",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getMailQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.mailQueues[e.id]&&c.rpcMailQueues[e.id]&&(_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onSaveMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]=_.pick(e,m))},c.onUpdateMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]&&_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),c.mailQueues[e.id]&&_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onRemoveMailQueue=function(e){_.isNil(e)||(delete c.rpcMailQueues[e.id],delete c.mailQueues[e.id])},c.onSaveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onRemoveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onSaveMailQueueChannel=function(e){c.mailQueues[e.queue_id]&&(c.rpcMailQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveMailQueueChannel=function(e){delete c.rpcMailQueuesWaitingInteractions[e.id],u&&c.deleteMailQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("mail_queue:save",c.onSaveQueue),l.onWithoutApply("mailQueue:save",c.onSaveMailQueue),l.onWithoutApply("mailQueue:update",c.onUpdateMailQueue),l.onWithoutApply("mailQueue:remove",c.onRemoveMailQueue),l.onWithoutApply("userMailQueue:save",c.onSaveUserMailQueue),l.onWithoutApply("userMailQueue:remove",c.onRemoveUserMailQueue),l.onWithoutApply("mail_queue_waiting_interaction:save",c.onSaveMailQueueChannel),l.onWithoutApply("mail_queue_waiting_interaction:remove",c.onRemoveMailQueueChannel),o.rpc.getMailQueues().$promise.then(function(e){c.rpcMailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"mail"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getMailQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcMailQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteMailQueuesWaitingInteractions.length;e+=1)delete c.rpcMailQueuesWaitingInteractions[c.deleteMailQueuesWaitingInteractions[e]];u=!1,c.deleteMailQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getMailQueues())}),e.$on("$destroy",function(){l.removeAllListeners("mail_queue:save"),l.removeAllListeners("mailQueue:save"),l.removeAllListeners("mailQueue:update"),l.removeAllListeners("mailQueue:remove"),l.removeAllListeners("userMailQueue:save"),l.removeAllListeners("userMailQueue:remove"),l.removeAllListeners("mail_queue_waiting_interaction:save"),l.removeAllListeners("mail_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelMailController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcOpenchannelQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.openchannelQueuesTotal=e.count?e.count:0,c.openchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.openchannelQueues,function(e,n){c.rpcOpenchannelQueues[n]&&(c.openchannelQueues[n].waiting=c.rpcOpenchannelQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.openchannelQueues={},c.openchannelQueuesTotal=0,c.rpcOpenchannelQueues={},c.paginatedInteractions=[],c.deleteOpenchannelQueuesWaitingInteractions=[],c.rpcOpenchannelQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"openchannel",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getOpenchannelQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.openchannelQueues[e.id]&&c.rpcOpenchannelQueues[e.id]&&(_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onSaveOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]=_.pick(e,m))},c.onUpdateOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]&&_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),c.openchannelQueues[e.id]&&_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onRemoveOpenchannelQueue=function(e){_.isNil(e)||(delete c.rpcOpenchannelQueues[e.id],delete c.openchannelQueues[e.id])},c.onSaveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onRemoveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onSaveOpenchannelQueueChannel=function(e){c.openchannelQueues[e.queue_id]&&(c.rpcOpenchannelQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveOpenchannelQueueChannel=function(e){delete c.rpcOpenchannelQueuesWaitingInteractions[e.id],u&&c.deleteOpenchannelQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("openchannel_queue:save",c.onSaveQueue),l.onWithoutApply("openchannelQueue:save",c.onSaveOpenchannelQueue),l.onWithoutApply("openchannelQueue:update",c.onUpdateOpenchannelQueue),l.onWithoutApply("openchannelQueue:remove",c.onRemoveOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:save",c.onSaveUserOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:remove",c.onRemoveUserOpenchannelQueue),l.onWithoutApply("openchannel_queue_waiting_interaction:save",c.onSaveOpenchannelQueueChannel),l.onWithoutApply("openchannel_queue_waiting_interaction:remove",c.onRemoveOpenchannelQueueChannel),o.rpc.getOpenchannelQueues().$promise.then(function(e){c.rpcOpenchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"openchannel"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getOpenchannelQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcOpenchannelQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteOpenchannelQueuesWaitingInteractions.length;e+=1)delete c.rpcOpenchannelQueuesWaitingInteractions[c.deleteOpenchannelQueuesWaitingInteractions[e]];u=!1,c.deleteOpenchannelQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getOpenchannelQueues())}),e.$on("$destroy",function(){l.removeAllListeners("openchannel_queue:save"),l.removeAllListeners("openchannelQueue:save"),l.removeAllListeners("openchannelQueue:update"),l.removeAllListeners("openchannelQueue:remove"),l.removeAllListeners("userOpenchannelQueue:save"),l.removeAllListeners("userOpenchannelQueue:remove"),l.removeAllListeners("openchannel_queue_waiting_interaction:save"),l.removeAllListeners("openchannel_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelOpenchannelController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcSmsQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.smsQueuesTotal=e.count?e.count:0,c.smsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.smsQueues,function(e,n){c.rpcSmsQueues[n]&&(c.smsQueues[n].waiting=c.rpcSmsQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.smsQueues={},c.smsQueuesTotal=0,c.rpcSmsQueues={},c.paginatedInteractions=[],c.deleteSmsQueuesWaitingInteractions=[],c.rpcSmsQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"sms",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getSmsQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.smsQueues[e.id]&&c.rpcSmsQueues[e.id]&&(_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onSaveSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]=_.pick(e,m))},c.onUpdateSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]&&_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),c.smsQueues[e.id]&&_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onRemoveSmsQueue=function(e){_.isNil(e)||(delete c.rpcSmsQueues[e.id],delete c.smsQueues[e.id])},c.onSaveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onRemoveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onSaveSmsQueueChannel=function(e){c.smsQueues[e.queue_id]&&(c.rpcSmsQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveSmsQueueChannel=function(e){delete c.rpcSmsQueuesWaitingInteractions[e.id],u&&c.deleteSmsQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("sms_queue:save",c.onSaveQueue),l.onWithoutApply("smsQueue:save",c.onSaveSmsQueue),l.onWithoutApply("smsQueue:update",c.onUpdateSmsQueue),l.onWithoutApply("smsQueue:remove",c.onRemoveSmsQueue),l.onWithoutApply("userSmsQueue:save",c.onSaveUserSmsQueue),l.onWithoutApply("userSmsQueue:remove",c.onRemoveUserSmsQueue),l.onWithoutApply("sms_queue_waiting_interaction:save",c.onSaveSmsQueueChannel),l.onWithoutApply("sms_queue_waiting_interaction:remove",c.onRemoveSmsQueueChannel),o.rpc.getSmsQueues().$promise.then(function(e){c.rpcSmsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"sms"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getSmsQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcSmsQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteSmsQueuesWaitingInteractions.length;e+=1)delete c.rpcSmsQueuesWaitingInteractions[c.deleteSmsQueuesWaitingInteractions[e]];u=!1,c.deleteSmsQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getSmsQueues())}),e.$on("$destroy",function(){l.removeAllListeners("sms_queue:save"),l.removeAllListeners("smsQueue:save"),l.removeAllListeners("smsQueue:update"),l.removeAllListeners("smsQueue:remove"),l.removeAllListeners("userSmsQueue:save"),l.removeAllListeners("userSmsQueue:remove"),l.removeAllListeners("sms_queue_waiting_interaction:save"),l.removeAllListeners("sms_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelSmsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,n){c.rpcVoiceQueues[n]&&(c.voiceQueues[n].waiting=c.rpcVoiceQueues[n].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"inbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"inbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.user.getQueues(c.query).$promise.then(function(e){return c.myQueues=e,o.rpc.getVoiceQueues().$promise}).then(function(e){for(var n=e.rows,t=_.keyBy(n,"id"),a=0;a<c.myQueues.count;a++){var i=c.myQueues.rows[a];c.rpcVoiceQueues[i.id]=t[i.id]}return o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,function(e){return!("inbound"!==e.type||e.queuecallerleaveAt||!_.find(c.myQueues.rows,{name:e.queue}))}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardVoiceController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcWhatsappQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.whatsappQueuesTotal=e.count?e.count:0,c.whatsappQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.whatsappQueues,function(e,n){c.rpcWhatsappQueues[n]&&(c.whatsappQueues[n].waiting=c.rpcWhatsappQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.whatsappQueues={},c.whatsappQueuesTotal=0,c.rpcWhatsappQueues={},c.paginatedInteractions=[],c.deleteWhatsappQueuesWaitingInteractions=[],c.rpcWhatsappQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"whatsapp",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getWhatsappQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.whatsappQueues[e.id]&&c.rpcWhatsappQueues[e.id]&&(_.merge(c.rpcWhatsappQueues[e.id],_.pick(e,m)),_.merge(c.whatsappQueues[e.id],_.pick(e,m)))},c.onSaveWhatsappQueue=function(e){_.isNil(e)||(c.rpcWhatsappQueues[e.id]=_.pick(e,m))},c.onUpdateWhatsappQueue=function(e){_.isNil(e)||(c.rpcWhatsappQueues[e.id]&&_.merge(c.rpcWhatsappQueues[e.id],_.pick(e,m)),c.whatsappQueues[e.id]&&_.merge(c.whatsappQueues[e.id],_.pick(e,m)))},c.onRemoveWhatsappQueue=function(e){_.isNil(e)||(delete c.rpcWhatsappQueues[e.id],delete c.whatsappQueues[e.id])},c.onSaveUserWhatsappQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getWhatsappQueues()},c.onRemoveUserWhatsappQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getWhatsappQueues()},c.onSaveWhatsappQueueChannel=function(e){c.whatsappQueues[e.queue_id]&&(c.rpcWhatsappQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveWhatsappQueueChannel=function(e){delete c.rpcWhatsappQueuesWaitingInteractions[e.id],u&&c.deleteWhatsappQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("whatsapp_queue:save",c.onSaveQueue),l.onWithoutApply("whatsappQueue:save",c.onSaveWhatsappQueue),l.onWithoutApply("whatsappQueue:update",c.onUpdateWhatsappQueue),l.onWithoutApply("whatsappQueue:remove",c.onRemoveWhatsappQueue),l.onWithoutApply("userWhatsappQueue:save",c.onSaveUserWhatsappQueue),l.onWithoutApply("userWhatsappQueue:remove",c.onRemoveUserWhatsappQueue),l.onWithoutApply("whatsapp_queue_waiting_interaction:save",c.onSaveWhatsappQueueChannel),l.onWithoutApply("whatsapp_queue_waiting_interaction:remove",c.onRemoveWhatsappQueueChannel),o.rpc.getWhatsappQueues().$promise.then(function(e){c.rpcWhatsappQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"whatsapp"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getWhatsappQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcWhatsappQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteWhatsappQueuesWaitingInteractions.length;e+=1)delete c.rpcWhatsappQueuesWaitingInteractions[c.deleteWhatsappQueuesWaitingInteractions[e]];u=!1,c.deleteWhatsappQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getWhatsappQueues())}),e.$on("$destroy",function(){l.removeAllListeners("whatsapp_queue:save"),l.removeAllListeners("whatsappQueue:save"),l.removeAllListeners("whatsappQueue:update"),l.removeAllListeners("whatsappQueue:remove"),l.removeAllListeners("userWhatsappQueue:save"),l.removeAllListeners("userWhatsappQueue:remove"),l.removeAllListeners("whatsapp_queue_waiting_interaction:save"),l.removeAllListeners("whatsapp_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelWhatsappController",e)}(),function(){"use strict";function e(i,t,s,o,a,n,r,e,l,d,c){var m=this;function u(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(m.faxAccounts.rows,function(e){return{model:"faxAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function p(e){!m.reloadingInteractions&&0<m.setting.faxInteractionsReloadTimeout&&function(e){e&&m.interactionsInterval&&t.cancel(m.interactionsInterval);m.interactionsInterval=t(function(){m.reloadingInteractions=!0,m.searchInProgress||g()},1e3*m.setting.faxInteractionsReloadTimeout)}(!0),m.searchInProgress=!1,m.reloadingInteractions=!1,m.faxInteractions=e||{count:0,rows:[]};for(var n=0;n<m.faxInteractions.rows.length;n+=1)v(m.faxInteractions.rows[n])}function g(e,n){m.searchInProgress=!0,e||(m.query.page=1),m.query.offset=(m.query.page-1)*m.query.limit;var t=a.localStorage.getItem("motion2.home.fax:"+m.user.id);(t=t?JSON.parse(t):{}).query=m.query,a.localStorage.setItem("motion2.home.fax:"+m.user.id,JSON.stringify(t)),m.promise=r.faxInteraction.get(m.query,p).$promise}function v(e){e.contactInfo=e.Contact?e.Contact.fax:void 0,"Unknown"===e.contactName&&(e.contactName=n.instant("DASHBOARDS.UNKNOWN"))}function h(e){var n=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function f(e){var n=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function b(e){if(e){var n=_.find(m.faxInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),m.query.sort){var t=_.startsWith(m.query.sort,"-")?"desc":"asc";m.faxInteractions.rows=_.orderBy(m.faxInteractions.rows,_.trimStart(m.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else g(m.query.page)}}function A(e){if(e){var n=_.find(m.faxInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function E(e){if(e&&!e.secret){var n=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}m.user=e.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.faxInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},m.sectionColor="blue-grey",m.onInit=function(e,n){return m.license=e,m.setting=n,r.user["get"+_.upperFirst("faxAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.faxAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"FaxAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:m.faxAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:m.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}],m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"FaxAccountId",type:"multiselect",options:{route:{model:"user",action:"getFaxAccounts",params:{id:m.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.fax:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),_.isEmpty(m.faxAccounts.rows)?m.query.FaxAccountId=[]:_.isEmpty(m.query.FaxAccountId)&&(m.query.FaxAccountId=_(m.faxAccounts.rows).map("id").take().value()),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0,m.isSearchBarVisible=!(m.query.search||!m.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={FaxAccountId:_.map(m.faxAccounts.rows,"id"),createdAt:n};m.query=_.merge(m.query,t)}l.on("faxInteraction:save",b),l.on("faxInteraction:update",b),l.on("faxInteractionTags:save",A),l.on("faxMessage:save",E),l.on("faxMessage:update",E),l.on("user_has_fax_interactions:save",h),l.on("user_has_fax_interactions:remove",f),g(m.query.page)})},m.success=p,m.getFaxInteractions=g,m.showFaxInteraction=function(e,n){i.$parent.vm.addInteractionTab("fax",n)},m.downloadFaxInteraction=function(e,s,n){r.faxInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="fax-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadFaxInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.disposeInteraction=function(e,t){var a=m.user.voicePause||m.user.chatPause||m.user.mailPause||m.user.openchannelPause||m.user.faxPause,n=!t.Account.mandatoryDisposition;s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){m.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:m.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:m.user,channel:"fax",interaction:t}})},m.getContactLabel=v,m.getAgentLabel=function(e){if(e.UserId)return e.UserId===m.user.id?n.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return n.instant("DASHBOARDS.NOT_ASSIGNED")},m.getFaxAccountLabel=function(e){if(e.Account)return e.Account.key;return n.instant("DASHBOARDS.UNKNOWN")},m.composeFaxInteraction=function(e,a){s.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:a,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var n=e;return r.faxAccount.send({id:a.id},n).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),i.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})}var t={channel:"fax",account:a,message:e.message,contact:e.contact};c.add(t)}})},m.openAdvancedSearch=function(){s.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{color:m.sectionColor,fields:m.advancedSearch.fields,storagePath:"home.fax"},fullscreen:!0}).then(function(e){m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply&&(m.query.search=e.value,g())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},i.$on("$destroy",function(){l.removeAllListeners("faxMessage:save"),l.removeAllListeners("faxMessage:update"),l.removeAllListeners("faxInteraction:save"),l.removeAllListeners("faxInteractionTags:save"),l.removeAllListeners("faxInteraction:update"),l.removeAllListeners("user_has_fax_interactions:save"),l.removeAllListeners("user_has_fax_interactions:remove"),m.interactionsInterval&&t.cancel(m.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeFaxController",e)}(),function(){"use strict";function e(o,n,r,l,m,t,d,e,a,c,u){var p=this;function i(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(p.mailAccounts.rows,function(e){return{model:"mailAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function s(e){!p.reloadingInteractions&&0<p.setting.mailInteractionsReloadTimeout&&S(!0),p.searchInProgress=!1,p.reloadingInteractions=!1,p.mailInteractions=e||{count:0,rows:[]};for(var n=0;n<p.mailInteractions.rows.length;n+=1)h(p.mailInteractions.rows[n])}function g(e,n){p.searchInProgress=!0,e||(p.query.page=1),(void 0===p.query.closed||null===p.query.closed||p.query.closed)&&delete p.query.substatus,p.query.offset=(p.query.page-1)*p.query.limit;var t=m.localStorage.getItem("motion2.home.mail:"+p.user.id);(t=t?JSON.parse(t):{}).query=p.query,m.localStorage.setItem("motion2.home.mail:"+p.user.id,JSON.stringify(t)),p.promise=d.mailInteraction.get(p.query,s).$promise}function v(e,n){o.$parent.vm.addInteractionTab("mail",n)}function h(e){_.isEmpty(e.to)||!e.Account||_.includes(e.to,e.Account.email)?e.contactInfo=e.Contact?e.Contact.email:void 0:e.contactInfo=e.to.split("<").pop().split(">")[0],"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function f(e){var n=_.find(p.mailInteractions.rows,{id:e.MailInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function b(e){var n=_.find(p.mailInteractions.rows,{id:e.MailInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function A(e){if(e){var n=_.find(p.mailInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),p.query.sort){var t=_.startsWith(p.query.sort,"-")?"desc":"asc";p.mailInteractions.rows=_.orderBy(p.mailInteractions.rows,_.trimStart(p.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===p.setting.mailInteractionsReloadTimeout&&g(p.query.page)}}function E(e){if(e){var n=_.find(p.mailInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function y(e){if(e&&!e.secret){var n=_.find(p.mailInteractions.rows,{id:e.MailInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function S(e){e&&p.interactionsInterval&&n.cancel(p.interactionsInterval),p.interactionsInterval=n(function(){p.reloadingInteractions=!0,p.searchInProgress||g()},1e3*p.setting.mailInteractionsReloadTimeout)}p.user=e.getCurrentUser(),p.license={},p.setting={},p.tags={count:0,rows:[]},p.mailInteractions={count:0,rows:[]},p.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},p.sectionColor="teal",p.onInit=function(e,n){return p.license=e,p.setting=n,d.user["get"+_.upperFirst("mailAccounts")]({id:p.user.id,nolimit:!0}).$promise.then(function(e){return p.mailAccounts=e||{count:0,rows:[]},d.tag.get({sort:"name"}).$promise}).then(function(e){p.tags=e||{count:0,rows:[]}}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){p.subStatuses=e||{count:0,rows:[]}}).then(function(){p.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Substatus",key:"substatus",type:"select",label:"DASHBOARDS.SELECT_SUBSTATUS",options:p.subStatuses.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NONE"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name",ngIf:"closed === 0"},{name:"Account",key:"MailAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:p.mailAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:p.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:p.tags.rows,placeholder:"DASHBOARDS.TAGS"}],p.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"plainBody",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Substatus",column:"substatus",type:"multiselect",options:{field:"name",route:{model:"mailSubstatus",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"MailAccountId",type:"multiselect",options:{route:{model:"user",action:"getMailAccounts",params:{id:p.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:i("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:i("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:i("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=m.localStorage.getItem("motion2.home.mail:"+p.user.id);if(e)try{(e=JSON.parse(e)).query&&(p.query=_.merge(p.query,e.query),_.isEmpty(p.mailAccounts.rows)?p.query.MailAccountId=[]:_.isEmpty(p.query.MailAccountId)&&(p.query.MailAccountId=_(p.mailAccounts.rows).map("id").take().value()),p.query.sort&&0<=p.query.sort.indexOf("lastMessage")&&(p.query=_.omit(p.query,"sort")),p.query.includeAll=!0,p.isSearchBarVisible=!(p.query.search||!p.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={MailAccountId:_.map(p.mailAccounts.rows,"id"),createdAt:n};p.query=_.merge(p.query,t)}a.on("mailInteraction:save",A),a.on("mailInteraction:update",A),a.on("mailInteractionTags:save",E),a.on("mailMessage:save",y),a.on("mailMessage:update",y),a.on("user_has_mail_interactions:save",f),a.on("user_has_mail_interactions:remove",b),g(p.query.page),0<p.setting.mailInteractionsReloadTimeout&&S()})},p.success=s,p.getMailInteractions=g,p.showMailInteraction=v,p.downloadMailInteraction=function(e,s,n){d.mailInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="mail-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadMailInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.disposeInteraction=function(e,t){var a=p.user.voicePause||p.user.chatPause||p.user.mailPause||p.user.openchannelPause||p.user.faxPause,n=!t.Account.mandatoryDisposition;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){p.user&&t.Account.mandatoryDisposition&&!a&&d.user.unpause({id:p.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:p.user,channel:"mail",interaction:t}})},p.getContactLabel=h,p.getAgentLabel=function(e){if(e.UserId)return e.UserId===p.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},p.getMailAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},p.composeMailInteraction=function(e,s){r.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{account:s,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var i=e;return d.mailAccount.send({id:s.id},i).$promise.then(function(e){if(e&&e.Messages&&e.Messages.length){if(i.attachments&&i.attachments.length)for(var n=0;n<i.attachments.length;n+=1)d.attachment.update({id:i.attachments[n].id},{MailMessageId:_.head(e.Messages).id});if(c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed){e.disposition=null;var t=!s.mandatoryDisposition,a=p.user.voicePause||p.user.chatPause||p.user.mailPause||p.user.openchannelPause||p.user.faxPause;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),onRemoving:function(e,n){p.user&&s.mandatoryDisposition&&!a&&d.user.unpause({id:p.user.id}).$promise.catch(function(e){console.error(e)})},clickOutsideToClose:t,escapeToClose:t,locals:{user:p.user,channel:"mail",interaction:e}})}else o.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var n={channel:"mail",account:s,message:e.message,contact:e.contact};u.add(n)}})},p.openAdvancedSearch=function(){r.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{color:p.sectionColor,fields:p.advancedSearch.fields,storagePath:"home.mail"},fullscreen:!0}).then(function(e){p.isSearchBarVisible=!(e.value||!p.query.filter),e.apply&&(p.query.search=e.value,g())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.$on("openMailDraft",function(e,s){s.interaction?(s.interaction.isDraft=!0,v(null,s.interaction)):r.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{account:s.account,message:s.content,type:"draft",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var i=e;return d.mailAccount.send({id:s.account.id},i).$promise.then(function(e){if(u.remove(s.id),e&&e.Messages&&e.Messages.length){if(i.attachments&&i.attachments.length)for(var n=0;n<i.attachments.length;n+=1)d.attachment.update({id:i.attachments[n].id},{MailMessageId:_.head(e.Messages).id});if(c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed){e.disposition=null;var t=!s.account.mandatoryDisposition,a=p.user.voicePause||p.user.chatPause||p.user.mailPause||p.user.openchannelPause||p.user.faxPause;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),onRemoving:function(e,n){p.user&&s.account.mandatoryDisposition&&!a&&d.user.unpause({id:p.user.id}).$promise.catch(function(e){console.error(e)})},clickOutsideToClose:t,escapeToClose:t,locals:{user:p.user,channel:"mail",interaction:e}})}else o.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var n={id:s.id,channel:"mail",account:e.account,message:e.message};u.update(n)}})}),p.resetTooltipPosition=function(e){var n=angular.element(e.currentTarget).children()[1],t=angular.element(n);t.css("top",""),t.css("left",""),t.css("bottom","")},p.adjustTooltipPosition=function(e){var n=angular.element(e.currentTarget).children(),t=n[0],a=n[1],i=angular.element(t),s=angular.element(a),o=m.innerHeight,r=i.offset(),l=r.top,d=r.left,c=o<216+l;s.css("left",d),c?(s.css("top",""),s.css("bottom",o-l)):(s.css("bottom",""),s.css("top",l))},o.$on("$destroy",function(){a.removeAllListeners("mailMessage:save"),a.removeAllListeners("mailMessage:update"),a.removeAllListeners("mailInteraction:save"),a.removeAllListeners("mailInteractionTags:save"),a.removeAllListeners("mailInteraction:update"),a.removeAllListeners("user_has_mail_interactions:save"),a.removeAllListeners("user_has_mail_interactions:remove"),p.interactionsInterval&&n.cancel(p.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeMailController",e)}(),function(){"use strict";function e(t,a,e,i,n,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.contacts=e||{count:0,rows:[]}}function c(e,n){l.searchInProgress=!0,s.cmContact.describe({id:l.query.ListId}).$promise.then(function(e){return _(e.toJSON()).omit("UserId").values().map(function(e){return function(e){var n={name:_.startCase(e.displayName),column:e.columnName,options:{}};if(e.custom)switch(e.custom.type){case"text":n.type="text";break;case"select":n.type="multiselect",n.values=_.map(JSON.parse(e.custom.values),function(e,n){return{id:n,name:e.value,value:e.value}}),n.options.field="name";break;case"switch":n.type="select",n.values=[{id:1,translate:"DASHBOARDS.ENABLED"},{id:0,translate:"DASHBOARDS.DISABLED"}],n.options.excludedOperators=["$ne"];break;case"number":n.type="number";break;case"datetime":n.type="date"}else switch(e.columnName){case"dateOfBirth":n.type="date";break;case"CompanyId":n.name="Company",n.type="autocomplete",n.options.route={model:"cmCompany",action:"get",params:{fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;case"ListId":n.name="List",n.type="autocomplete",n.options.route={model:"user",action:"getLists",params:{id:l.currentUser.id,fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;default:_.includes(e.type.toLowerCase(),"int")?n.type="number":_.includes(e.type.toLowerCase(),"date")?n.type="date":n.type="text"}return n}(e)}).value()}).then(function(e){l.advancedSearch.fields=e;var n=_.findIndex(e,function(e){return _.startsWith(e.column,"cf_")})||e.length-1;n<0&&(n=e.length),l.advancedSearch.fields.splice(n,0,{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"DESCRIBE_CM_CONTACTS",msg:e.data?JSON.stringify(e.data.message):e.toString()})}),e||(l.query.page=1),l.query.offset=(l.query.page-1)*l.query.limit;var t=o.localStorage.getItem("motion2.home.mycontacts:"+l.currentUser.id);(t=t?JSON.parse(t):{}).query=l.query,o.localStorage.setItem("motion2.home.mycontacts:"+l.currentUser.id,JSON.stringify(t)),l.query.search&&(l.advancedQuery=_.omit(l.query,"id")),l.promise=l.query.search?s.cmContact.get(l.advancedQuery,d).$promise:s.user.getContacts(l.query,d).$promise}l.currentUser=n.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,id:l.currentUser.id,sort:"-updatedAt",limit:10,page:1},l.advancedSearch={fields:[]},l.sectionColor="red",l.getContacts=c,l.refreshContacts=function(){c()},l.mergeContact=function(e,n){i.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,n){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e,n){a.$parent.vm.addContactTab(n)},l.call=a.$parent.vm.call,l.onInit=function(){s.cmList.get({fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),s.tag.get({sort:"name"}).$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"List",key:"ListId",type:"multiselect",label:"CONTACTMANAGER.SELECT_LIST",options:l.lists.rows,clearAll:!1},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:l.tags.rows,placeholder:"DASHBOARDS.TAGS"}]}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.mycontacts:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query),_.isEmpty(l.lists.rows)?l.query.ListId=[]:_.isEmpty(l.query.ListId)&&(l.query.ListId=_(l.lists.rows).map("id").take().value()))}catch(e){console.error(e)}else l.query.ListId=_.map(l.lists.rows,"id");l.isSearchBarVisible=!(l.query.search||!l.query.filter),c()})},l.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{color:l.sectionColor,fields:l.advancedSearch.fields,storagePath:"home.mycontacts"},fullscreen:!0}).then(function(e){l.isSearchBarVisible=!(e.value||!l.query.filter),e.apply&&(l.query.search=e.value?e.value+="||User:=$eq["+l.currentUser.id+"]":e.value,c())}).catch(function(e){r.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}e.$inject=["$document","$scope","$timeout","$mdDialog","Auth","api","$window","toasty"],angular.module("app.dashboards").controller("AgentHomeMyContactsController",e)}(),function(){"use strict";function e(i,n,s,o,a,t,r,e,l,d,c){var m=this;function u(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(m.openchannelAccounts.rows,function(e){return{model:"openchannelAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function p(e){!m.reloadingInteractions&&0<m.setting.openchannelInteractionsReloadTimeout&&y(!0),m.searchInProgress=!1,m.reloadingInteractions=!1,m.openchannelInteractions=e||{count:0,rows:[]};for(var n=0;n<m.openchannelInteractions.rows.length;n+=1)v(m.openchannelInteractions.rows[n])}function g(e,n){m.searchInProgress=!0,e||(m.query.page=1),m.query.offset=(m.query.page-1)*m.query.limit;var t=a.localStorage.getItem("motion2.home.openchannel:"+m.user.id);(t=t?JSON.parse(t):{}).query=m.query,a.localStorage.setItem("motion2.home.openchannel:"+m.user.id,JSON.stringify(t)),m.promise=r.openchannelInteraction.get(m.query,p).$promise}function v(e){"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function h(e){var n=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function f(e){var n=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function b(e){if(e){var n=_.find(m.openchannelInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),m.query.sort){var t=_.startsWith(m.query.sort,"-")?"desc":"asc";m.openchannelInteractions.rows=_.orderBy(m.openchannelInteractions.rows,_.trimStart(m.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===m.setting.openchannelInteractionsReloadTimeout&&g(m.query.page)}}function A(e){if(e){var n=_.find(m.openchannelInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function E(e){if(e&&!e.secret){var n=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function y(e){e&&m.interactionsInterval&&n.cancel(m.interactionsInterval),m.interactionsInterval=n(function(){m.reloadingInteractions=!0,m.searchInProgress||g()},1e3*m.setting.openchannelInteractionsReloadTimeout)}m.user=e.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.openchannelInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},m.sectionColor="amber",m.onInit=function(e,n){return m.license=e,m.setting=n,r.user["get"+_.upperFirst("openchannelAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.openchannelAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"OpenchannelAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:m.openchannelAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:m.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}],m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"OpenchannelAccountId",type:"multiselect",options:{route:{model:"user",action:"getOpenchannelAccounts",params:{id:m.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.openchannel:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),_.isEmpty(m.openchannelAccounts.rows)?m.query.OpenchannelAccountId=[]:_.isEmpty(m.query.OpenchannelAccountId)&&(m.query.OpenchannelAccountId=_(m.openchannelAccounts.rows).map("id").take().value()),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0,m.isSearchBarVisible=!(m.query.search||!m.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={OpenchannelAccountId:_.map(m.openchannelAccounts.rows,"id"),createdAt:n};m.query=_.merge(m.query,t)}l.on("openchannelInteraction:save",b),l.on("openchannelInteraction:update",b),l.on("openchannelInteractionTags:save",A),l.on("openchannelMessage:save",E),l.on("openchannelMessage:update",E),l.on("user_has_openchannel_interactions:save",h),l.on("user_has_openchannel_interactions:remove",f),g(m.query.page),0<m.setting.openchannelInteractionsReloadTimeout&&y()})},m.success=p,m.getOpenchannelInteractions=g,m.showOpenchannelInteraction=function(e,n){i.$parent.vm.addInteractionTab("openchannel",n)},m.downloadOpenchannelInteraction=function(e,s,n){r.openchannelInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="openchannel-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadOpenchannelInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.disposeInteraction=function(e,t){var a=m.user.voicePause||m.user.chatPause||m.user.mailPause||m.user.openchannelPause||m.user.faxPause,n=!t.Account.mandatoryDisposition;s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){m.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:m.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:m.user,channel:"openchannel",interaction:t}})},m.getContactLabel=v,m.getAgentLabel=function(e){if(e.UserId)return e.UserId===m.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},m.getOpenchannelAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},m.composeOpenchannelInteraction=function(e,a){s.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:a,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var n=e;return r.openchannelAccount.send({id:a.id},n).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),i.$parent.vm.addInteractionTab("openchannel",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"OPENCHANNELACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var t={channel:"openchannel",account:a,message:e.message,contact:e.contact};c.add(t)}})},m.openAdvancedSearch=function(){s.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{color:m.sectionColor,fields:m.advancedSearch.fields,storagePath:"home.openchannel"},fullscreen:!0}).then(function(e){m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply&&(m.query.search=e.value,g())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},i.$on("$destroy",function(){l.removeAllListeners("openchannelMessage:save"),l.removeAllListeners("openchannelMessage:update"),l.removeAllListeners("openchannelInteraction:save"),l.removeAllListeners("openchannelInteractionTags:save"),l.removeAllListeners("openchannelInteraction:update"),l.removeAllListeners("user_has_openchannel_interactions:save"),l.removeAllListeners("user_has_openchannel_interactions:remove"),m.interactionsInterval&&n.cancel(m.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeOpenchannelController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e,n,t){d.license=e,d.setting=n,d.plugin=t}d.currentUser=o.getCurrentUser(),d.plugin={},d.onInit=c,d.getTrustedURL=function(){return s.trustAsResourceUrl(d.plugin.agentUrl)},c(),n.$on("pluginUpdated",function(e,n){d.plugin=n.plugin})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","$sce","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomePluginsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(){d.agentsQuery.offset=(d.agentsQuery.page-1)*d.agentsQuery.limit,l.update("motion2.home.presence.agents:"+d.currentUser.id,d.agentsQuery,"query"),i.user.getPresence(d.agentsQuery).$promise.then(function(e){d.agents={count:e.count,rows:_.filter(e.rows,function(e){return e.id!==d.currentUser.id})}}).catch(function(){r.error({title:t.instant("DASHBOARDS.AGENT_PRESENCE"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")})})}function m(){d.queuesQuery.offset=(d.queuesQuery.page-1)*d.queuesQuery.limit,l.update("motion2.home.presence.queues:"+d.currentUser.id,d.queuesQuery,"query"),i.voiceQueue.get(d.queuesQuery).$promise.then(function(e){return d.voiceQueues=e||{rows:[],count:0},i.rpc.getVoiceQueuesChannels().$promise.then(function(e){e.rows.forEach(function(e){var n=_.find(d.voiceQueues.rows,["name",e.name]);n&&(n.calls||(n.calls=[]),n.calls.push(e))})})}).catch(function(){r.error({title:t.instant("VOICE.VOICEQUEUES"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")})})}function u(e){return 0===d.selectedTab?e:"xcallyQueueExtension"+e}function p(e,n,t,a){var i=_.find(d.agents.rows,["id",e]);i&&(i.status=!1===n?"offline":a?"pause":"unavailable"===t?t:_.includes(["idle","unknown","ringing",null,void 0],t)?"online":"busy")}function g(e){e.id!==d.currentUser.id&&p(e.id,e.online,e.voiceStatus,e.voicePause)}d.currentUser=s.getCurrentUser(),d.agents={count:0,rows:[]},d.agentsQuery={fields:"id,name,internal,online",role:"agent",sort:"name",limit:10,page:1},d.queuesQuery={fields:"id,name",type:"inbound",sort:"name",limit:10,page:1},d.onAgentsTabSelection=function(){if(d.agentsQuery.filter||d.agentsQuery.teams||d.agentsQuery.queues)return;_.merge(d.agentsQuery,l.get("motion2.home.presence.agents:"+d.currentUser.id,"query")),d.isSearchBarVisible=!!d.agentsQuery.filter,a.all([a(function(n,e){i.team.get({fields:"id,name",sort:"name",nolimit:!0}).$promise.then(function(e){d.teams=e||{rows:[],count:0},n()}).catch(function(){r.error({title:t.instant("STAFF.TEAMS"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),e()})}),a(function(n,e){i.voiceQueue.get({fields:"id,name",type:"inbound",sort:"name",nolimit:!0}).$promise.then(function(e){d.queues=e||{rows:[],count:0},n()}).catch(function(){r.error({title:t.instant("VOICE.VOICEQUEUES"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),e()})})]).then(function(){d.quickFilters=[{name:"Team",key:"teams",type:"multiselect",label:"DASHBOARDS.SELECT_TEAM",options:d.teams.rows},{name:"Queue",key:"queues",type:"multiselect",label:"DASHBOARDS.SELECT_QUEUE",options:d.queues.rows}],c()}).catch(function(){r.error({title:t.instant("DASHBOARDS.AGENT_PRESENCE"),msg:t.instant("DASHBOARDS.ERRORS.FAILED_INITIALIZATION")})})},d.onQueuesTabSelection=function(){if(d.queuesQuery.filter)return;_.merge(d.queuesQuery,l.get("motion2.home.presence.queues:"+d.currentUser.id,"query")),d.isSearchBarVisible=!!d.queuesQuery.filter,m()},d.getAgents=c,d.getVoiceQueues=m,d.originateCall=function(e){n.$broadcast("webrtc::call",{target:u(e)})},d.transferCall=function(e){n.$broadcast("webrtc::transfer",{target:u(e)})},o.on("user:presence",function(e){if(e.id===d.currentUser.id)return;p(e.id,e.online,e.voiceStatus,e.voicePause)}),o.on("user:update",g),o.on("voice_queue_presence:save",function(e){if(!d.voiceQueues&&d.voiceQueues.rows)return;var n=_.find(d.voiceQueues.rows,["name",e.name]);if(!n)return;n.calls||(n.calls=[]);if(_.some(n.calls,["uniqueid",e.uniqueid]))return;n.calls.push(e)}),o.on("voice_queue_presence:remove",function(e){var n=_.find(d.voiceQueues.rows,["name",e.name]);if(!n)return;_.remove(n.calls,["uniqueid",e.uniqueid])}),e.$on("$destroy",function(){o.removeListener("user:update",g),o.removeAllListeners("user:presence"),o.removeAllListeners("voice_queue_presence:save"),o.removeAllListeners("voice_queue_presence:remove")})}e.$inject=["$scope","$rootScope","$translate","$q","api","Auth","socket","toasty","localStorageManager"],angular.module("app.dashboards").controller("AgentHomePresenceController",e)}(),function(){"use strict";function e(e,t,n,a,o,i){var s=this;function r(e){s.searchInProgress=!1,s.voiceRecordings=e||{count:0,rows:[]}}function l(){s.searchInProgress=!0,s.query.offset=(s.query.page-1)*s.query.limit;var e={query:s.query};t.localStorage.setItem("motion2.home.recordings:"+s.currentUser.id,JSON.stringify(e)),s.promise=a.voiceRecording.get(s.query,r).$promise}s.currentUser=i.getCurrentUser(),s.voiceRecordings={},s.table="voiceRecordings",s.query={UserId:s.currentUser.id,fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,transcribeStatus,UserId",sort:"-updatedAt",limit:10,page:1,type:null},s.downloadfile=function(i,e){return a.voiceRecording.download({id:i.id,exists:!0}).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download",i.uniqueid+i.format),a.click()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.downloadtranscribe=function(s,e){return a.voiceRecording.downloadTranscribe({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.success=r,s.getVoiceRecordings=l,s.onInit=function(){s.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Type",key:"type",type:"select",label:"VOICE.SELECT_TYPE",customOptions:[{value:"internal",translate:"VOICE.INTERNAL"},{value:"inbound",translate:"VOICE.INBOUND"},{value:"outbound",translate:"VOICE.OUTBOUND"},{value:"dialer",translate:"VOICE.DIALER"},{value:null,translate:"VOICE.ALL"}]}];var e=t.localStorage.getItem("motion2.home.recordings:"+s.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(s.query=_.merge(s.query,e.query))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};s.query.createdAt=n}s.isSearchBarVisible=!!s.query.filter,l()}}e.$inject=["$scope","$window","$timeout","api","toasty","Auth"],angular.module("app.dashboards").controller("AgentHomeRecordingsController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,r,n){var l=this;function d(e){l.searchInProgress=!1,l.scheduledCalls=e||{count:0,rows:[]}}l.currentUser=n.getCurrentUser(),l.priorities=["Lowest","Low","Medium","High","Highest"],l.crudPermissions={readOnly:!1,canEdit:!0,canDelete:!0},l.scheduledCalls={},l.query={id:l.currentUser.id,fields:"id,phone,scheduledat,recallme,priority,UserId,OwnerId,dialTimezone",sort:"scheduledat",limit:10,page:1},l.queueCampaigns={rows:[],count:0},l.success=d,l.getScheduledCalls=function(){l.searchInProgress=!0,l.query.id=l.currentUser.id,l.query.includeAll=!0,l.query.offset=(l.query.page-1)*l.query.limit,l.query.fields="id,phone,scheduledat,recallme,priority,UserId,OwnerId,dialTimezone";var e={query:l.query};t.localStorage.setItem("motion2.home.scheduled:"+l.currentUser.id,JSON.stringify(e)),l.promise=r.user.getScheduledCalls(l.query,d).$promise},l.onInit=function(){r.user.getQueues({id:n.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){l.queueCampaigns=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"Start Date",key:"scheduledat",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Campaigns",key:"VoiceQueueId",type:"multiselect",label:"MOTIONDIALER.SELECT_CAMPAIGN",options:l.queueCampaigns.rows}]}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.scheduled:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.omit(e.query,["filter"]))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};l.query.scheduledat=n}l.getScheduledCalls()})},l.isDateBeforeToday=function(e){return moment(e).isBefore(moment())},l.createOrEditQueueCampaignHopper=function(e,n){i.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:null,hopper:n,hoppers:l.scheduledCalls.rows,license:null,setting:null,crudPermissions:l.crudPermissions}})},l.deleteConfirm=function(n,e){var t=i.confirm().title("Are you sure want to delete the scheduled call?").htmlContent("<b>Scheduled call</b> will be deleted.").ariaLabel("delete scheduled call").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){var e;e=n,r.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(l.scheduledCalls.rows,{id:e.id}),l.scheduledCalls.count-=1,l.scheduledCalls.rows.length||l.getScheduledCalls(),o.success({title:"Scheduled call deleted!",msg:e.name?"Scheduled call has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE_HOPPER"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETE_HOPPER",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})};var c=!0,m=1;e.$watch("vm.query.filter",function(e,n){c?a(function(){c=!1}):(n||(m=l.query.page),e!==n&&(l.query.page=1),e||(l.query.page=m),l.getScheduledCalls())})}e.$inject=["$scope","$window","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.dashboards").controller("AgentHomeScheduledCallsController",e)}(),function(){"use strict";function e(i,n,s,o,a,t,r,e,l,d,c){var m=this;function u(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(m.smsAccounts.rows,function(e){return{model:"smsAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function p(e){!m.reloadingInteractions&&0<m.setting.smsInteractionsReloadTimeout&&y(!0),m.searchInProgress=!1,m.reloadingInteractions=!1,m.smsInteractions=e||{count:0,rows:[]};for(var n=0;n<m.smsInteractions.rows.length;n+=1)v(m.smsInteractions.rows[n])}function g(e,n){m.searchInProgress=!0,e||(m.query.page=1),m.query.offset=(m.query.page-1)*m.query.limit;var t=a.localStorage.getItem("motion2.home.sms:"+m.user.id);(t=t?JSON.parse(t):{}).query=m.query,a.localStorage.setItem("motion2.home.sms:"+m.user.id,JSON.stringify(t)),m.promise=r.smsInteraction.get(m.query,p).$promise}function v(e){e.contactInfo=e.Contact?e.Contact.mobile:void 0,"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function h(e){var n=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function f(e){var n=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function b(e){if(e){var n=_.find(m.smsInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),m.query.sort){var t=_.startsWith(m.query.sort,"-")?"desc":"asc";m.smsInteractions.rows=_.orderBy(m.smsInteractions.rows,_.trimStart(m.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===m.setting.smsInteractionsReloadTimeout&&g(m.query.page)}}function A(e){if(e){var n=_.find(m.smsInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function E(e){if(e&&!e.secret){var n=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function y(e){e&&m.interactionsInterval&&n.cancel(m.interactionsInterval),m.interactionsInterval=n(function(){m.reloadingInteractions=!0,m.searchInProgress||g()},1e3*m.setting.smsInteractionsReloadTimeout)}m.user=e.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.smsInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},m.sectionColor="orange",m.onInit=function(e,n){return m.license=e,m.setting=n,r.user["get"+_.upperFirst("smsAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.smsAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"SmsAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:m.smsAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:m.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}],m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"SmsAccountId",type:"multiselect",options:{route:{model:"user",action:"getSmsAccounts",params:{id:m.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.sms:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),_.isEmpty(m.smsAccounts.rows)?m.query.SmsAccountId=[]:_.isEmpty(m.query.SmsAccountId)&&(m.query.SmsAccountId=_(m.smsAccounts.rows).map("id").take().value()),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0,m.isSearchBarVisible=!(m.query.search||!m.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={SmsAccountId:_.map(m.smsAccounts.rows,"id"),createdAt:n};m.query=_.merge(m.query,t)}l.on("smsInteraction:save",b),l.on("smsInteraction:update",b),l.on("smsInteractionTags:save",A),l.on("smsMessage:save",E),l.on("smsMessage:update",E),l.on("user_has_sms_interactions:save",h),l.on("user_has_sms_interactions:remove",f),g(m.query.page),0<m.setting.smsInteractionsReloadTimeout&&y()})},m.success=p,m.getSmsInteractions=g,m.showSmsInteraction=function(e,n){i.$parent.vm.addInteractionTab("sms",n)},m.downloadSmsInteraction=function(e,s,n){r.smsInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="sms-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadSmsInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.disposeInteraction=function(e,t){var a=m.user.voicePause||m.user.chatPause||m.user.mailPause||m.user.openchannelPause||m.user.faxPause,n=!t.Account.mandatoryDisposition;s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){m.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:m.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:m.user,channel:"sms",interaction:t}})},m.getContactLabel=v,m.getAgentLabel=function(e){if(e.UserId)return e.UserId===m.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},m.getSmsAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},m.composeSmsInteraction=function(e,a){s.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:a,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var n=e;return r.smsAccount.send({id:a.id},n).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),i.$parent.vm.addInteractionTab("sms",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SMSACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var t={channel:"sms",account:a,message:e.message,contact:e.contact};c.add(t)}})},m.openAdvancedSearch=function(){s.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{color:m.sectionColor,fields:m.advancedSearch.fields,storagePath:"home.sms"},fullscreen:!0}).then(function(e){m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply&&(m.query.search=e.value,g())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},i.$on("$destroy",function(){l.removeAllListeners("smsMessage:save"),l.removeAllListeners("smsMessage:update"),l.removeAllListeners("smsInteraction:save"),l.removeAllListeners("smsInteractionTags:save"),l.removeAllListeners("smsInteraction:update"),l.removeAllListeners("user_has_sms_interactions:save"),l.removeAllListeners("user_has_sms_interactions:remove"),m.interactionsInterval&&n.cancel(m.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeSmsController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.voiceCalls=e||{count:0,rows:[]}}function c(){l.searchInProgress=!0,l.query.offset=(l.query.page-1)*l.query.limit;var e={query:l.query};s.localStorage.setItem("motion2.home.voice:"+l.currentUser.id,JSON.stringify(e)),l.promise=a.voiceCallReport.get(l.query,d).$promise}l.currentUser=e.getCurrentUser(),l.voiceCalls={},l.table="voiceCalls",l.query={UserId:l.currentUser.id,fields:"id,type,uniqueid,tag,starttime,endtime,source,destination,userDisposition,userSecondDisposition,userThirdDisposition,note,duration,billableseconds,answertime",sort:"-updatedAt",limit:10,page:1,type:null},l.success=d,l.getVoiceCalls=c,l.onInit=function(){return a.tag.get({sort:"name"}).$promise.then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Type",key:"type",type:"select",label:"VOICE.SELECT_TYPE",customOptions:[{value:"internal",translate:"VOICE.INTERNAL"},{value:"inbound",translate:"VOICE.INBOUND"},{value:"outbound",translate:"VOICE.OUTBOUND"},{value:"dialer",translate:"VOICE.DIALER"},{value:null,translate:"VOICE.ALL"}]}]}).catch(function(e){i.error({title:"Init error",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}),l.tags={count:0,rows:[]}}).finally(function(){var e=s.localStorage.getItem("motion2.home.voice:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};l.query.createdAt=n}l.isSearchBarVisible=!!l.query.filter,c()})},l.showDetails=function(e){n.show({controller:"AgentHomeVoiceDetailsController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{call:e}})}}e.$inject=["$mdDialog","$document","api","toasty","Auth","$window","$scope","$timeout"],angular.module("app.dashboards").controller("AgentHomeVoiceController",e)}(),function(){"use strict";function e(e,n){this.call=n,this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","call"],angular.module("app.dashboards").controller("AgentHomeVoiceDetailsController",e)}(),function(){"use strict";function e(i,n,s,o,a,t,r,e,l,d,c){var m=this;function u(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(m.whatsappAccounts.rows,function(e){return{model:"whatsappAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function p(e){!m.reloadingInteractions&&0<m.setting.whatsappInteractionsReloadTimeout&&y(!0),m.searchInProgress=!1,m.reloadingInteractions=!1,m.whatsappInteractions=e||{count:0,rows:[]};for(var n=0;n<m.whatsappInteractions.rows.length;n+=1)v(m.whatsappInteractions.rows[n])}function g(e,n){m.searchInProgress=!0,e||(m.query.page=1),m.query.offset=(m.query.page-1)*m.query.limit;var t=a.localStorage.getItem("motion2.home.whatsapp:"+m.user.id);(t=t?JSON.parse(t):{}).query=m.query,a.localStorage.setItem("motion2.home.whatsapp:"+m.user.id,JSON.stringify(t)),m.promise=r.whatsappInteraction.get(m.query,p).$promise}function v(e){e.contactInfo=e.Contact?e.Contact.mobile:void 0,"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function h(e){var n=_.find(m.whatsappInteractions.rows,{id:e.WhatsappInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function f(e){var n=_.find(m.whatsappInteractions.rows,{id:e.WhatsappInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function b(e){if(e){var n=_.find(m.whatsappInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),m.query.sort){var t=_.startsWith(m.query.sort,"-")?"desc":"asc";m.whatsappInteractions.rows=_.orderBy(m.whatsappInteractions.rows,_.trimStart(m.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===m.setting.whatsappInteractionsReloadTimeout&&g(m.query.page)}}function A(e){if(e){var n=_.find(m.whatsappInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function E(e){if(e&&!e.secret){var n=_.find(m.whatsappInteractions.rows,{id:e.WhatsappInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function y(e){e&&m.interactionsInterval&&n.cancel(m.interactionsInterval),m.interactionsInterval=n(function(){m.reloadingInteractions=!0,m.searchInProgress||g()},1e3*m.setting.whatsappInteractionsReloadTimeout)}m.user=e.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.whatsappInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},m.sectionColor="lime-A700",m.onInit=function(e,n){return m.license=e,m.setting=n,r.user["get"+_.upperFirst("whatsappAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.whatsappAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"WhatsappAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:m.whatsappAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:m.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}],m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"WhatsappAccountId",type:"multiselect",options:{route:{model:"user",action:"getWhatsappAccounts",params:{id:m.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.whatsapp:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),_.isEmpty(m.whatsappAccounts.rows)?m.query.WhatsappAccountId=[]:_.isEmpty(m.query.WhatsappAccountId)&&(m.query.WhatsappAccountId=_(m.whatsappAccounts.rows).map("id").take().value()),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0,m.isSearchBarVisible=!(m.query.search||!m.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={WhatsappAccountId:_.map(m.whatsappAccounts.rows,"id"),createdAt:n};m.query=_.merge(m.query,t)}l.on("whatsappInteraction:save",b),l.on("whatsappInteraction:update",b),l.on("whatsappInteractionTags:save",A),l.on("whatsappMessage:save",E),l.on("whatsappMessage:update",E),l.on("user_has_whatsapp_interactions:save",h),l.on("user_has_whatsapp_interactions:remove",f),g(m.query.page),0<m.setting.whatsappInteractionsReloadTimeout&&y()})},m.success=p,m.getWhatsappInteractions=g,m.showWhatsappInteraction=function(e,n){i.$parent.vm.addInteractionTab("whatsapp",n)},m.downloadWhatsappInteraction=function(e,s,n){r.whatsappInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="whatsapp-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadWhatsappInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.disposeInteraction=function(e,t){var a=m.user.voicePause||m.user.chatPause||m.user.mailPause||m.user.openchannelPause||m.user.faxPause,n=!t.Account.mandatoryDisposition;s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){m.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:m.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:m.user,channel:"whatsapp",interaction:t}})},m.getContactLabel=v,m.getAgentLabel=function(e){if(e.UserId)return e.UserId===m.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},m.getWhatsappAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},m.composeWhatsappInteraction=function(e,a){s.show({controller:"ComposeWhatsappInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:a,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var n=e;return r.whatsappAccount.send({id:a.id},n).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),i.$parent.vm.addInteractionTab("whatsapp",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"WHATSAPPACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var t={channel:"whatsapp",account:a,message:e.message,contact:e.contact};c.add(t)}})},m.openAdvancedSearch=function(){s.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{color:m.sectionColor,fields:m.advancedSearch.fields,storagePath:"home.whatsapp"},fullscreen:!0}).then(function(e){m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply&&(m.query.search=e.value,g())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},i.$on("$destroy",function(){l.removeAllListeners("whatsappMessage:save"),l.removeAllListeners("whatsappMessage:update"),l.removeAllListeners("whatsappInteraction:save"),l.removeAllListeners("whatsappInteractionTags:save"),l.removeAllListeners("whatsappInteraction:update"),l.removeAllListeners("user_has_whatsapp_interactions:save"),l.removeAllListeners("user_has_whatsapp_interactions:remove"),m.interactionsInterval&&n.cancel(m.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeWhatsappController",e)}(),function(){"use strict";function e(e,n){var t=this;t.setting={},t.messages={count:0,rows:[]},t.showInteraction=!1,t.init=function(e,n){t.setting=n,t.tab=e,t.tab.saved=!0},t.getTrustedURL=function(){return n.trustAsResourceUrl(t.tab.src)}}e.$inject=["$scope","$sce"],angular.module("app.dashboards").controller("AgentGeneralIframeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this,f=25,b=1024*f*1024;function A(){var e=h.user.voicePause||h.user.chatPause||h.user.mailPause||h.user.openchannelPause||h.user.faxPause,n=!h.tab.interaction.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(t.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(){h.user&&h.interaction.Account.mandatoryDisposition&&!e&&l.user.unpause({id:h.user.id}).$promise.catch(function(e){d.error(e.data?e.data.message:e.toString())})},locals:{user:h.user,channel:h.tab.channel,interaction:h.tab.interaction}}).then(function(e){h.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(h.tab)})}function E(e,n){h.tab.message=n,i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:h.tab.message,type:e,interaction:h.interaction},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){if(e)if(e.message&&e.message.savedAsDraft)h.draft?p.update({id:h.draft.id,channel:"mail",account:h.account,message:e.message,contact:h.contact,interaction:h.interaction}):p.add({channel:"mail",account:h.account,message:e.message,contact:h.contact,interaction:h.interaction}),h.draft=p.getByInteraction(h.tab.interaction.id);else{var n=e;n&&S(n),n.Interaction&&h.interaction&&h.interaction.id&&(n.Interaction.id=h.interaction.id,l.mailInteraction.update(n.Interaction).$promise.then(function(e){e&&e.closed?(h.tab.saved=!0,h.interaction.closed=!0,A()):null!==n.Interaction.substatus&&(h.tab.saved=!0,h.tab.interaction.substatus=n.Interaction.substatus,a.$parent.$parent.$parent.vm.closeTab(h.tab))}).catch(function(e){d.error(e.data?e.data.message:e.toString())}))}}).finally(function(){h.tab.isDraft=!1})}function y(){"mail"!==h.tab.channel&&n(function(){var e=angular.element(t.find("md-content[name*='interaction-content-"+h.tab.id+"']"));e&&e[0]&&(e[0].scrollTop=e[0].scrollHeight)},0)}function S(i){if(i)return i["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"]=h.interaction["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"],i[_.capitalize(h.tab.channel)+"InteractionId"]=h.interaction.id,i.UserId=h.user.id,i.ContactId=h.interaction.ContactId,i.direction="out",i.secret=Boolean(h.tab.spy||i.secret),l[h.tab.channel+"Message"].save(i).$promise.then(function(e){if(e&&e.id&&!_.isEmpty(i.attachments)){for(var n=[],t=0;t<i.attachments.length;t++){var a=i.attachments[t];a.MailMessageId?n.push(l.attachment.clone({id:a.id},{name:a.name,basename:a.basename,type:a.type,MailMessageId:e.id}).$promise):n.push(l.attachment.update({id:a.id},{MailMessageId:e.id}).$promise)}return s.all(n)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SENDMESSAGE",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){"mail"===h.tab.channel&&i.isDraft&&(p.removeByInteraction(h.interaction.id),h.draft=null),h.tab.areaText="",y()})}function T(e){switch(h.tab.channel){case"mail":h.draft.content.originalMessage=e?_.find(h.interaction.Messages,["id",e]):h.interaction.Messages[h.interaction.Messages.length-1],E(h.draft.type,h.draft.content)}}function I(e){h.journeyIsLoading=!0;var n=_.merge(h.journeyOptions,{id:h.contact.id,offset:e||0});return g.get(h.journey,n).then(function(e){h.journey=e.journey,h.canLoadMoreJourney=e.loadMore}).finally(function(){h.journeyIsLoading=!1})}h.showFooter=!1,h.BTNLoadMore=0,h.showInteraction=!1,h.user=c.getCurrentUser(),h.detectBrowser=u.detectBrowser(),h.journey=[],h.acceptedMessages=[],h.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:b,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},h.ngFlow={flow:{}},h.selectedMailShowDetails={},h.selectedMailShowSystemMessage={},h.setting={},h.ctrlMethods={},h.embedOptions={fontSmiley:!0,sanitizeHtml:!0,emoji:!0,link:!0,linkTarget:"_blank"},h.journeyOptions=g.getQuery(),h.quickFilters=g.getQuickFilters(),h.init=function(e,n){h.tab=e,h.tab.saved=!0,h.tab.badges=0,h.setting=n||{},h.tab&&h.tab.channel&&h.tab.interaction&&(h.interaction=h.tab.interaction,l[h.tab.channel+"Interaction"].get({id:h.tab.interaction.id,includeAll:!0}).$promise.then(function(e){return e&&(h.interaction=e,h.tab.interaction=e),h.tab.saved=h.interaction.closed,h.queryMessage={id:h.interaction.id,includeAll:!0},"mail"===h.tab.channel?(h.queryMessage.sort="-id",h.queryMessage.offset=0,h.queryMessage.limit=3,h.queryMessage.inlineCss=!0):(h.queryMessage.sort="id",h.queryMessage.nolimit=!0),l[h.tab.channel+"Interaction"].getMessages(h.queryMessage).$promise}).then(function(e){return e&&(h.BTNLoadMore=e.count-h.queryMessage.limit),h.messages=e||{count:0,rows:[]},l["chat"===h.tab.channel?"chatWebsite":h.tab.channel+"Account"].get({id:h.interaction["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"]}).$promise}).then(function(e){if(h.account=e,h.tab.title=h.account.key||h.account.name,h.interaction.ContactId)return l.cmContact.get({id:h.interaction.ContactId}).$promise}).then(function(e){return e&&(h.contact=e),h.showInteraction=!0,h.contact?h.tab.title+=" - "+(h.user.privacyEnabled?v.mask(h.contact.firstName):h.contact.firstName):h.tab.title+=" - "+r.instant(h.tab.channel.toUpperCase()+".UNKNOWN"),l.user.get({fields:"id,fullname",nolimit:!0}).$promise}).then(function(e){h.users=e||{count:0,rows:[]},h.usersMap=_.mapValues(_.keyBy(h.users.rows,"id"),"fullname")}).then(function(){if(h.tab.channel&&h.interaction)return l.user["add"+_.upperFirst(h.tab.channel)+"Interactions"]({id:h.user.id,ids:[h.interaction.id]})}).then(function(){return l.mailSubstatus.get({sort:"name",nolimit:!0}).$promise}).then(function(e){h.subStatuses=e||{count:0,rows:[]}}).catch(function(){h.showInteraction=!0}).finally(function(){h.contact&&I(),function(){switch(h.user.role){case"admin":return h.downloadPermissions={attachments:!0,interactions:!0};case"agent":return h.downloadPermissions={attachments:h.user.downloadAttachments,interactions:h.user.downloadOmnichannelInteractions};case"user":l.userProfile.get({id:h.user.userProfileId,fields:"downloadAttachments,downloadOmnichannelInteractions"}).$promise.then(function(e){h.downloadPermissions={attachments:e.downloadAttachments,interactions:e.downloadOmnichannelInteractions}}).catch(function(){h.downloadPermissions={attachments:!1,interactions:!1}})}}(),function(){if(!h.tab.spy&&!h.interaction.closed){var t=[];if(h.messages.rows.forEach(function(e){if("in"===e.direction&&!e.read){var n=0===t.length;t.push(l[h.tab.channel+"Message"].accept({id:e.id,UserId:h.user.id,manual:n}).$promise),h.acceptedMessages.push(e.id)}}),"mail"===h.tab.channel){var e=_(h.interaction.Messages).filter({read:!1,direction:"in"}).differenceBy(h.messages.rows,"id").value();e.forEach(function(e){t.push(l.mailMessage.accept({id:e.id,UserId:h.user.id}).$promise),h.acceptedMessages.push(e.id)})}s.all(t)}}(),y(),m.on(h.tab.channel+"Message:save",h.onMessageSave),m.on(h.tab.channel+"Message:update",h.onMessageSave),m.on(h.tab.channel+"Interaction:save",h.onInteractionSave),m.on(h.tab.channel+"Interaction:update",h.onInteractionSave),m.on("user_has_"+h.tab.channel+"_interactions:save",h.onInteractionOpen),m.on("user_has_"+h.tab.channel+"_interactions:remove",h.onInteractionClose),h.tab.areaText=h.tab.areaText?h.tab.areaText:"",h.showFooter=!0,"mail"===h.tab.channel&&(h.draft=p.getByInteraction(h.tab.interaction.id),h.tab.isDraft&&(h.tab.interaction.closed?(p.removeByInteraction(h.tab.interaction.id),h.draft=null):T()))}))},h.getLabelByMessage=function(e){var n="loading...";if(e)return"in"===e.direction?e.Contact?e.Contact.firstName||"Anonymous":n:e.UserId?h.usersMap?h.usersMap[e.UserId]:n:"System"},h.openContact=function(e,n){try{h.tab&&!h.tab.spy&&a.$parent.$parent.$parent.vm.addContactTab(n||h.contact)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Unable to open the contact"})}},h.openInteraction=function(e){try{if(e.MailAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("mail",e);if(e.ChatWebsiteId)return a.$parent.$parent.$parent.vm.addInteractionTab("chat",e);if(e.SmsAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("sms",e);if(e.WhatsappAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("whatsapp",e);if(e.OpenchannelAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("openchannel",e);if(e.FaxAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("fax",e)}catch(e){d.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},h.disposeInteraction=A,h.tagInteraction=function(){i.show({controller:"TagInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,skipHide:Boolean(h.tab.spy),resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0,fields:"id,name,color"})}]},locals:{channel:h.tab.channel,interaction:h.tab.interaction}})},h.composeMailInteraction=function(n,e){if(e.inReplyTo){var t=_.find(h.messages.rows,{messageId:e.inReplyTo});if(!t)return l.mailMessage.get({messageId:e.inReplyTo}).$promise.then(function(e){E(n,e&&e.count?e.rows[0]:void 0)}).catch(function(e){d.error(e.data?e.data.message:e.toString()),E(n,void 0)});E(n,t)}else E(n,e)},h.composeFaxInteraction=function(e){var n={to:[]};n.to.push(h.contact.fax),i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0}).then(function(e){return l.faxAccount.send({id:h.account.id},e).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},h.composeSmsInteraction=function(e,n){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeWhatsappInteraction=function(e,n){i.show({controller:"ComposeWhatsappInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeChatInteraction=function(e,n){i.show({controller:"ComposeChatInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/chat/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeOpenchannelInteraction=function(e,n){i.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.transferLastMessage=function(){if(h.interaction){var e=_.findLast(h.messages.rows,function(e){return"in"===e.direction});e?i.show({controller:"TransferMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,interaction:h.interaction,message:e,channel:h.tab.channel},resolve:{agents:["apiResolver",function(e){var n={fields:"id,name",$id:{ne:h.user.id},role:"agent",online:!0,sort:"name",nolimit:!0};return n[h.tab.channel+"Pause"]=!1,e.resolve("user@get",n)}],queues:["apiResolver",function(e){return e.resolve(h.tab.channel+"Queue@get",{fields:"id,name",sort:"name",nolimit:!0})}]}}).then(function(e){h.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(h.tab)}):d.error({title:"Invalid transfer",msg:"Message not found!"})}},h.downloadMessage=function(s,e){h.tab.channel&&s.id&&l[h.tab.channel+"Message"].download({id:s.id,attachments:e}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=h.tab.channel+"-message"+s.id+".eml";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.downloadMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.downloadInteraction=function(s,e){h.tab.channel&&s.id&&l[h.tab.channel+"Interaction"].download({id:s.id,attachments:e}).$promise.then(function(e){var n=[e.buffer],t=h.tab.channel+"-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.inteactionMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.openDraft=T,h.createVidaooSession=function(e){var n={id:e.id,account:e.Account,contact:e.Contact};return l.chatInteraction.createVidaooSession(n).$promise.then(function(){d.success({title:"Start Video Call",msg:"Session properly created."})}).catch(function(){d.error({title:"Start Video Call",msg:"Unable to create session!"})})},h.reply=function(e,n){if(e&&13===e.keyCode&&e.shiftKey)return;if(e&&13!==e.keyCode)return;if(""===n.trim())return;S(function(e){var n={},t="chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId";n[t]=h.interaction[t].toString(),n[_.capitalize(h.tab.channel)+"InteractionId"]=h.interaction.id,("sms"===h.tab.channel||"whatsapp"===h.tab.channel)&&(n.phone=h.interaction.phone);e&&(n.UserId=h.user.id,n.ContactId=h.interaction.ContactId,n.body=e);return n}(n.trim()))},h.upload=function(){h.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},h.ngFlow.flow.upload()},h.fileAdded=function(e){if(e.size>b)return d.error({title:"File too big",msg:"The max allowed size is "+f+"MB"}),!1;return!0},h.fileSuccess=function(e,n){var t=JSON.parse(n),a=t.name;"chat"===h.tab.channel&&(a='<a href="'+(h.account.remote?h.account.remote:o.protocol()+"://"+o.host())+"/api/chat/interactions/"+h.interaction.id+"/attachment_download?attachId="+t.id+"&token="+h.account.token+'" target="_self">'+t.name+"</a>");S({body:a,AttachmentId:t.id})},h.onMessageSave=function(e){if(e&&h.interaction.id!=e[_.capitalize(h.tab.channel)+"InteractionId"])return;var n=!1;h.messages?n=_.find(h.messages.rows,{id:e.id}):h.messages={rows:[],count:0};n?_.merge(n,e):("mail"===h.tab.channel?h.messages.rows.unshift(e):h.messages.rows.push(e),y())},h.onInteractionSave=function(e){if(e&&h.interaction.id!==e.id)return;e.closed&&(h.tab.saved=!0);_.merge(h.interaction,e)},h.searchTextChange=function(n){var t=s.defer(),a=[],e={},i="chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId";return e.filter=n,e[i]=h.account.id,l.cannedAnswer.get(e).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},h.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:h.user,account:h.account,interaction:h.interaction,contact:h.interaction&&h.interaction.Contact?h.interaction.Contact:{}};""!==h.tab.areaText&&(h.tab.areaText+=" "),h.tab.areaText+=e(t),h.ctrlMethods.setText(h.tab.areaText)}catch(e){""!==h.tab.areaText&&(h.tab.areaText+=" "),h.tab.areaText+=n.value,h.ctrlMethods.setText(h.tab.areaText)}h.selectedItem=null,h.changeDisplayCannedAnswerInputValue()}},h.getMessagesAlignment=function(e){if(e.secret&&h.user.id!=e.UserId)return"in";switch(h.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}},h.displayCannedAnswerInput=!1,h.changeDisplayCannedAnswerInputValue=function(){h.displayCannedAnswerInput=!h.displayCannedAnswerInput},h.setAs=function(e){h.tab.channel&&h.interaction&&h.interaction.id&&l[h.tab.channel+"Interaction"].update({id:h.interaction.id,substatus:e}).$promise.catch(function(e){d.error(e.data?e.data.message:e.toString())})},h.markAsUnread=function(){if(h.tab.channel&&h.interaction&&h.interaction.id)if(h.acceptedMessages.length)for(var e=0;e<h.acceptedMessages.length;e+=1)l[h.tab.channel+"Message"].update({id:h.acceptedMessages[e],read:!1,UserId:null});else for(var n=0;n<h.messages.rows.length;n+=1)if("in"===h.messages.rows[n].direction){h.messages.rows[n].UserId===h.user.id?l[h.tab.channel+"Message"].update({id:h.messages.rows[n].id,read:!1,UserId:null}):d.error({title:"You can't mark as unread",msg:"You are not the owner of the last message!"});break}h.tab.saved=!0,a.$parent.$parent.$parent.vm.closeTab(h.tab)},h.getAttachments=function(n){return l.attachment.get({MailMessageId:n.id}).$promise.then(function(e){e&&e.rows&&(n.attachments=e.rows)}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},h.getAttachment=function(i){return l.attachment.download({id:i.id}).$promise.then(function(e){if(e){var n=new Blob([e.buffer],{type:e.type}),t=document.createElement("a"),a=window.URL.createObjectURL(n);t.href=a,t.target="_self",t.download=i.name,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},h.htmlToPlaintext=function(e){return e?String(e).replace(/<[^>]+>/gm,""):""},h.onInteractionOpen=function(e){var n;h.interaction.id==e[_.upperFirst(h.tab.channel)+"InteractionId"]&&(h.interaction.Users&&(n=_.find(h.interaction.Users,{id:e.UserId})),n||h.interaction.Users.push({id:e.UserId}))},h.onInteractionClose=function(e){h.interaction.id==e[_.upperFirst(h.tab.channel)+"InteractionId"]&&h.interaction.Users&&_.remove(h.interaction.Users,{id:e.UserId})},h.getCustomerJourney=I,h.loadNextPage=function(){var t=s.defer();if(h.queryMessage)return h.queryMessage.offset=h.messages.rows.length,l[h.tab.channel+"Interaction"].getMessages(h.queryMessage).$promise.then(function(e){for(var n=0;n<e.rows.length;n+=1)h.messages.rows.push(e.rows[n]),h.interaction.closed||"in"!==e.rows[n].direction||e.rows[n].read||(l[h.tab.channel+"Message"].accept({id:e.rows[n].id,UserId:h.user.id}),h.acceptedMessages.push(e.rows[n].id));return 0<e.rows.length&&(h.BTNLoadMore=h.BTNLoadMore-e.rows.length),t.resolve(e)}).catch(function(e){return t.reject(e)});return t.reject()},h.interactionTimelineOptions={scrollEl:"#interaction-content"},h.loadMoreJourney=function(){return s(function(e){var n=h.journey.length;return e(I(n))})},h.journeyTimelineOptions={scrollEl:"#journey-content"},a.$on("$destroy",function(){m.removeAllListeners(h.tab.channel+"Message:save"),m.removeAllListeners(h.tab.channel+"Message:update"),m.removeAllListeners(h.tab.channel+"Interaction:save"),m.removeAllListeners(h.tab.channel+"Interaction:update"),m.removeAllListeners("user_has_"+h.tab.channel+"_interactions:save"),m.removeAllListeners("user_has_"+h.tab.channel+"_interactions:remove")})}function n(a){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function(t){t.updateView=function(){var e,n=_.replace(t.ngBindHtmlUnsafe,'<div id="xm-mail-content"','<a style="cursor:pointer" class="toggle-details md-accent-color" onclick="document.getElementById(\''+(e="xm-mail-content-"+Math.floor(9999*Math.random()+1))+"').style.display='block'; this.parentNode.removeChild(this)\">See More</a><div id=\""+e+'" style="display:none"');t.trustedHtml=a.trustAsHtml(n)},t.$watch("ngBindHtmlUnsafe",function(e){t.updateView(e)})}}}e.$inject=["$cookies","$timeout","$document","$scope","$mdDialog","$q","$location","$translate","api","toasty","Auth","socket","msUtils","draftManager","customerJourneyManager","privacyManager"],n.$inject=["$sce"],angular.module("app.dashboards").directive("ngBindHtmlUnsafe",n).controller("AgentGeneralInteractionController",e)}(),function(){"use strict";angular.module("app.dashboards").factory("Emojis",function(){return{watchEmbedData:!1,sanitizeHtml:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank",pdf:{embed:!0},image:{embed:!0},audio:{embed:!0},basicVideo:!1,gdevAuth:"xxxxxxxx",video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,thumbnailQuality:"medium",autoPlay:!0},twitchtvEmbed:!0,dailymotionEmbed:!0,tedEmbed:!0,dotsubEmbed:!0,liveleakEmbed:!0,ustreamEmbed:!0,soundCloudEmbed:!0,soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},spotifyEmbed:!0,tweetEmbed:!0,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},code:{highlight:!0,lineNumbers:!1},codepenEmbed:!0,codepenHeight:300,jsfiddleEmbed:!0,jsfiddleHeight:300,jsbinEmbed:!0,jsbinHeight:300,plunkerEmbed:!0,githubgistEmbed:!0,ideoneEmbed:!0,ideoneHeight:300}})}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,ChatAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeChatInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=25,u=1024*m*1024;c.separatorKeys=[a.KEY_CODE.ENTER,a.KEY_CODE.COMMA,a.KEY_CODE.TAB],c.message={from:i.localstationid,to:_.isNil(s.to)||_.isEmpty(s.to)?[]:s.to,attachments:[]},c.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:u,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},c.ngFlow={flow:{}},c.send=function(e){1===c.message.attachments.length?c.message.to.length?(s.draft=void 0,t.hide({from:c.message.from,to:c.message.to,attach:c.message.attachments.length,attachments:c.message.attachments})):l.error("To is mandatory"):l.error("Attachment is mandatory")},c.upload=function(){c.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},c.ngFlow.flow.upload()},c.fileSuccess=function(e,n){try{(n=JSON.parse(n)).size=e.size,c.message.attachments.push(n)}catch(e){console.error(e)}},c.fileAdded=function(e){var n=["pdf","tif"];if(!_.includes(n,e.getExtension()))return l.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extensions: "+n.join()}),!1;if(e.size>u)return l.error({title:"File too big",msg:"The max allowed size is "+m+"MB"}),!1;return!0},c.getContact=function(e){var n="";e.firstName&&e.firstName!==e.fax&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.fax&&(n+=e.lastName+" ");return n+="<"+e.fax+">"},c.contactSearch=function(e){return i&&i.ListId?r.cmContact.get({ListId:i.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,fax"}).$promise.then(function(e){return e.rows}):[]},c.transformContact=function(e){var n=e;if(_.isObject(e))return e.fax;if(t=n,!/[&\/\\#,()$~%.'":;*?<>{}\s\\|a-zA-Z\pS!òàùè…_§°çéì-]/.test(t))return n;var t;return l.error("Fax "+n+" is not valid"),null},c.closeDialog=function(){s.draft=c.message,t.cancel()}}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q"],angular.module("app.dashboards").controller("ComposeFaxInteractionDialogController",e)}(),function(){"use strict";function e(n,e,i,t,a,s,o,r,l,d,c,m,u,p){var g=this,v=25,h=1024*v*1024;g.currentUser=m.getCurrentUser(),g.secret="note"===r,g.hiddenCC=!0,g.hiddenBCC=!0,g.verifySmtp=!0,g.errors=[],g.separatorKeys=[t.KEY_CODE.ENTER,t.KEY_CODE.COMMA,t.KEY_CODE.TAB],g.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,MailAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},g.selectedItemChange=function(n){if(n&&n.value&&g.ckEditorInstance)try{var e=_.template(n.value),t={user:g.currentUser,account:s,interaction:u,contact:u&&u.Contact?u.Contact:{}};g.ckEditorInstance.insertHtml(e(t))}catch(e){console.error(e),g.ckEditorInstance.insertHtml(n.value)}document.getElementById("html-area").focus(),g.selectedItem=null},g.onReadyEditor=function(e){try{g.ckEditorInstance=CKEDITOR.instances["html-area"]}catch(e){console.error("Unable to get Html Editor instance",e)}},_.templateSettings.interpolate=/{{([\s\S]+?)}}/g,g.fromTemplate=_.template("{{ name }} <{{ email }}>"),g.replyTemplate=_.template("On {{ date }}, at {{ time }}, {{ from }} wrote:"),g.forwardTemplate=_.template("Begin forwarded message:<br><br><strong>From:</strong> {{ from }}<br><strong>Subject:</strong> {{ subject }}<br><strong>Date:</strong> {{ date }}, at {{ time }}<br><strong>To:</strong> {{ to }}"),g.message={from:g.fromTemplate({name:s.name,email:s.email||s.Smtp.user}),to:[],cc:[],bcc:[],body:S(),type:r,attachments:[],showLastMessage:!0},g.draft=null,g.ckeditor={skin:"office2013",startupFocus:!0,language:"en",allowedContent:!0,extraPlugins:"font,colorbutton,autogrow,autoembed,autocorrect,googlethisterm,pastebase64",toolbarGroups:[{name:"styles",groups:["styles"]},{name:"clipboard",groups:["undo"]},{name:"colors",groups:["colors"]},{name:"basicstyles",groups:["basicstyles"]},{name:"paragraph",groups:["list","indent","align"]}],autoGrow_onStartup:!0,autoGrow_minHeight:g.secret?160:300,autoGrow_maxHeight:e.innerHeight-400,autocorrect_enabled:!0,disableNativeSpellChecker:!1,enterMode:CKEDITOR.ENTER_BR,font_defaultLabel:s.fontFamily?s.fontFamily.split(",")[0]:"Arial",fontSize_defaultLabel:s.fontSize||"12",removePlugins:"magicline"};for(var f=[],b=8;b<=72;b++)f.push(b+"/"+b+"pt");g.ckeditor.fontSize_sizes=f.join(";"),g.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:h,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},g.ngFlow={flow:{}},g.reply=function(e){angular.isDefined(o)&&(g.message.type="reply",g.message.to="in"===o.direction?o.from.split(","):o.to.split(","),g.message.subject=_.startsWith(o.subject,"Re:")?o.subject:"Re: "+o.subject,g.message.inReplyTo=o.messageId,g.message.body=S(),g.message.attachments=[],e&&o.cc&&(g.hiddenCC=!1,g.message.cc=o.cc.split(",")),g.message.showLastMessage=!1)},g.newMail=function(){angular.isDefined(o)&&(g.message.type="new",g.message.to=o.to?o.to.split(","):[])},g.forward=function(){if(angular.isDefined(o)){if(g.message.type="forward",g.message.subject=_.startsWith(o.subject,"Fwd:")?o.subject:"Fwd: "+o.subject,g.message.body=S(),o.Attachments&&o.Attachments.length)for(var e=0;e<o.Attachments.length;e++)g.message.attachments.push(o.Attachments[e]);g.message.showLastMessage=!1}},g.editDraft=function(){g.isDraft=!0,angular.isDefined(o)&&(o.savedAsDraft=!1,g.message=angular.copy(o),_.isEmpty(g.message.cc)||(g.hiddenCC=!1),_.isEmpty(g.message.bcc)||(g.hiddenBCC=!1))},g.send=function(e,n,t){if(!A&&g.message.to&&g.message.body)if(g.message.to.length)if(_.isEmpty(g.message.subject)){var a=i.confirm({skipHide:!0}).title("Warning").textContent("This message has no subject. Are you sure you want to send it?").ariaLabel("Warning").targetEvent(e).ok("Send Anyway").cancel("Cancel");i.show(a).then(function(){E(n,t)})}else E(n,t);else d.error("To is mandatory");A=!1},g.note=function(){g.type="note",g.secret=!0,g.message.body='<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'pt"><p></p></div>'},g.addNote=function(){g.message.body&&i.hide({secret:!0,body:g.message.body,attach:g.message.attachments.length,attachments:g.message.attachments})},g.upload=function(e){g.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+n.get("motion.token")},g.ngFlow.flow.upload()},g.fileSuccess=function(e,n){try{(n=JSON.parse(n)).size=e.size,g.message.attachments.push(n)}catch(e){console.error(e)}},g.removeAttachment=function(e){g.message.attachments=_.reject(g.message.attachments,{id:e.id}),e.MailMessageId||l.attachment.delete({id:e.id}).$promise.catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.attachment.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.fileAdded=function(e){if(e.size>h)return d.error({title:"File too big",msg:"The max allowed size is "+v+"MB"}),!1;return!0},g.getContact=function(e){var n="";e.firstName&&e.firstName!==e.email&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.email&&(n+=e.lastName+" ");return n+="<"+e.email+">"},g.contactSearch=function(e){return s&&s.ListId?l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,email"}).$promise.then(function(e){return e.rows}):[]},g.transformContact=function(e,n){if(_.isObject(e))return(g.contact=e).email;if(_.isString(e)){if(y(e))return g.contact={email:e},e;for(var t=e.split(","),a=0;a<t.length;a+=1)y(t[a])?_.isArray(n)&&_.indexOf(n,t[a])<0&&n.push(t[a]):d.error("Email "+t[a]+" is not valid");return g.contact={email:e.split(",")[0]},null}return d.error("Email field is not valid"),null},g.saveDraft=function(){g.message.savedAsDraft=!0,g.draft=p.getByInteraction(u.id);var e={account:s,message:g.message,contact:g.contact,interaction:u};if(g.draft&&!g.isDraft){var n=i.confirm({skipHide:!0}).title(a.instant("DASHBOARDS.DRAFT_SAVE_WARNING_TITLE")).content(a.instant("DASHBOARDS.DRAFT_SAVE_WARNING_MESSAGE")).ariaLabel("Save draft").ok(a.instant("DASHBOARDS.OVERWRITE")).cancel(a.instant("DASHBOARDS.CANCEL"));i.show(n).then(function(){i.hide(e)})}else i.hide(e)},g.closeDialog=function(){i.cancel()},g.loadLastMessage=function(){g.message.body+=T(g.message.type)};var A=!(g.keyPress=function(e){13===e.keyCode&&(A=!0)});switch(r){case"reply":g.reply(!1);break;case"replyAll":g.reply(!0);break;case"forward":g.forward();break;case"draft":g.editDraft();break;case"new":g.newMail();break;case"note":g.note()}function E(e,n){var t={from:g.message.from,to:g.message.to.join(","),cc:g.message.cc.join(","),bcc:g.message.bcc.join(","),subject:g.message.subject,body:g.message.showLastMessage?g.message.body:g.message.body+T(g.message.type),inReplyTo:g.message.inReplyTo,attach:g.message.attachments.length,attachments:g.message.attachments,Interaction:{lastMsgDirection:"out",substatus:n},isDraft:g.isDraft};t.html='<div id="xm-mail-content">'+_.replace(t.body,'<div id="xm-mail-content"',"<div")+"</div>",e&&(t.Interaction.closed=!0),i.hide(t)}function y(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function S(){return'<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'pt">'+function(){if(_.isNil(s.template))return"";try{return _.template(s.template)({user:g.currentUser,account:s,interaction:u,contact:u&&u.Contact?u.Contact:{}})}catch(e){return console.error(e),""}}()+"</div>"}function T(e){var n='<div id="xm-mail-content"><blockquote type="cite">';switch(e){case"reply":case"replyAll":n+=g.replyTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||""});break;case"forward":n+=g.forwardTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||"",to:_.escape(o.to)||"",subject:_.escape(o.subject)||""})}var t,a,i=g.message.showLastMessage&&o.originalMessage?o.originalMessage.body:o.body;return n+="<br><br>",n+=(t=i?_.replace(i,'<div id="xm-mail-content"',"<div"):"",(a=t.match(/\<body[^>]*\>([^]*)\<\/body/m))?a[1]:t),n+="</blockquote></div>",e?n:""}l.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){g.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),g.secret||l.mailAccount.verifySmtp({id:s.id}).$promise.catch(function(e){g.verifySmtp=!1,g.errors.push({message:e.data,type:e.status}),g.errors.push({message:"You can't reply or send an email. Please contact the administrator!",type:"500"})})}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","$translate","account","message","type","api","toasty","$q","Auth","interaction","draftManager"],angular.module("app.dashboards").controller("ComposeMailInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,OpenchannelAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e[s.mapKey]&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e[s.mapKey]&&(n+=e.lastName+" ");return n+="<"+e[s.mapKey]+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId){var n="firstName,lastName,phone,mobile";return s.mapKey&&(n+=","+s.mapKey),l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:n}).$promise.then(function(e){return e.rows})}return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e[s.mapKey];return n},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeOpenchannelInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,SmsAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeSmsInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,WhatsappAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeWhatsappInteractionDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.errors=[],r.dispositions=[],r.interaction=angular.copy(e),r.interaction.disposition||(r.interaction.disposition=null),r.channel=i,r.apiRoute=r.channel+"Interaction",r.apiAccountRoute=r.channel+("chat"===r.channel?"Website":"Account"),r.accountProperty=_.capitalize(r.channel)+("chat"===r.channel?"Website":"Account")+"Id",r.firstLevelDisposition=null,r.mandatoryDisposition=!1,r.mandatoryDispositionPause="",r.wasUserInPause=s.voicePause||s.chatPause||s.mailPause||s.openchannelPause||s.faxPause,r.onInit=function(){var n=[],t={fields:"id,name,level,ParentId",sort:"name",nolimit:!0};t[r.accountProperty]=e[r.accountProperty],a[r.apiAccountRoute].get({id:e[r.accountProperty]}).$promise.then(function(e){return r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name),a.disposition.get(t).$promise}).then(function(e){return e.rows.length&&(n=_.concat(n,e.rows)),a.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise}).then(function(e){e.rows.length&&(n=_.concat(n,e.rows))}).catch(function(e){console.error(e)}).finally(function(){r.dispositions=_.orderBy(n,["name"],["asc"]),r.mandatoryDisposition&&!r.wasUserInPause&&a.user.pause({id:s.id,type:r.mandatoryDispositionPause||"DEFAULT PAUSE"}).$promise.then(function(e){}).catch(function(e){console.error(e)})})},r.onDispositionChange=function(e){"first"===e?(r.anySecondLevelDisposition=!!r.firstLevelDisposition&&_.some(r.dispositions,["ParentId",r.firstLevelDisposition.id]),r.firstLevelDisposition||(r.secondLevelDisposition=void 0)):"second"===e&&(r.anyThirdLevelDisposition=_.some(r.dispositions,["ParentId",r.secondLevelDisposition.id]))},r.clearDispositionSelection=function(e){"second"===e?(r.secondLevelDisposition=void 0,r.thirdLevelDisposition=void 0):"third"===e&&(r.thirdLevelDisposition=void 0)},r.saveDisposition=function(){r.errors=[],r.interaction.UserId=s.id,r.interaction.closed=!0,r.interaction.closeReason="agent",r.interaction.disposition=r.firstLevelDisposition?r.firstLevelDisposition.name:null,r.interaction.secondDisposition=r.secondLevelDisposition?r.secondLevelDisposition.name:void 0,r.interaction.thirdDisposition=r.thirdLevelDisposition?r.thirdLevelDisposition.name:void 0,a[r.apiRoute]?a[r.apiRoute].update(_.pick(r.interaction,["MailAccountId","FaxAccountId","SmsAccountId","WhatsappAccountId","ChatWebsiteId","OpenchannelAccountId","closed","closeReason","disposition","secondDisposition","thirdDisposition","id","note","UserId"])).$promise.then(function(e){r.interaction=e,"mail"===r.channel&&o.removeByInteraction(r.interaction.id),t.success({title:"Interaction properly closed!",msg:"Interaction has been closed!"})}).then(function(){l(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})}):l(!1)},r.closeDialog=l}e.$inject=["$mdDialog","toasty","api","interaction","channel","user","draftManager"],angular.module("app.dashboards").controller("DisposeInteractionDialogController",e)}(),function(){"use strict";function e(n,t,e,a,i,s){var o=this;function r(e){n.hide(e)}o.errors=[],o.tags=s,o.interaction=angular.copy(a),o.interaction.Tags=_.map(o.interaction.Tags,function(e){return{id:e.id,name:e.name,color:e.color}}),o.channel=i,o.autocompleteRequireMatch=!0,o.saveTag=function(){{if(o.errors=[],e[o.apiRoute])return e[o.apiRoute].addTags({id:o.interaction.id,ids:_.map(o.interaction.Tags,"id")}).$promise.then(function(){t.success({title:"Interaction properly tagged!",msg:"Interaction has been tagged!"}),a.Tags=o.interaction.Tags,r(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})});r(!1)}},o.closeDialog=r,o.apiRoute=o.channel+"Interaction"}e.$inject=["$mdDialog","toasty","api","interaction","channel","tags"],angular.module("app.dashboards").controller("TagInteractionDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l,d){var c=this;function m(e){n.hide(e)}c.channel=s.toLowerCase(),c.message=o,c.account=r,c.agents=l,c.queues=d,c.transfer={id:0,type:c.account.queueTransfer?"queue":"agent"},c.onTransfer=function(){m(!0),e(function(){var e="agent"===c.transfer.type?"agentNotify":c.channel+"QueueNotify";return a.rpc[e]({id:c.transfer.id,messageId:c.message.id,channel:c.channel}).$promise.then(function(){i.success({title:t.instant("DASHBOARDS.INFO"),msg:"queue"===c.transfer.type?t.instant("DASHBOARDS.NOTIFICATIONS.TRANSFER_QUEUE_EXECUTED"):t.instant("DASHBOARDS.NOTIFICATIONS.TRANSFER_AGENT_EXECUTED")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.rpc.notify"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.rpc.notify",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},5e3)},c.closeDialog=m}e.$inject=["$mdDialog","$timeout","$translate","api","toasty","channel","message","account","agents","queues"],angular.module("app.dashboards").controller("TransferMessageDialogController",e)}(),function(){"use strict";function e(i,m,s,e,u,o,r,t,n,a,l){var p=this;function d(){try{i.$parent.$parent.$parent.vm.updateLocalStorage()}catch(e){o.error({title:"ERROR UPDATE LOCAL TABS",msg:"Error updating locally stored tabs"})}}function c(t,e){var n,a,l=[],d=[],c=r.getCurrentUser();(n=c,a=m.defer(),p.project.sendUnpauseOnSubmit?u.user.unpause({id:n.id}).$promise.then(function(e){a.resolve()}).catch(function(e){console.log("err"),a.resolve()}):a.resolve(),a.promise).then(function(){return u.jscriptySessionReport.save({starttime:p.starttime,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,VoiceQueueId:p.call&&p.call["xmd-voicequeueid"]?p.call["xmd-voicequeueid"]:void 0,ProjectId:p.project&&p.project.id?p.project.id:void 0,projectname:p.project&&p.project.name?p.project.name:void 0,ContactId:p.contact&&p.contact.id?p.contact.id:void 0,completed:e}).$promise}).then(function(e){if(e)for(var n=p.getResponseSheetHeaders(),t=p.getResponseSheetRow(),a=p.getQuestionWithResponseList(),i=0;i<n.length;i+=1)if(!_.isEmpty(String(t[i]))){try{l.push(u.jscriptyQuestionReport.save({question:n[i],answer:"date"===a[i].type?moment(String(t[i])).format("YYYY-MM-DD"):"time"===a[i].type?moment(String(t[i])).format("HH:mm"):String(t[i]),questionId:a[i].id,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,SessionId:e.id,ProjectId:p.project.id,projectname:p.project.name}))}catch(e){console.error("Unable to convert question",e)}for(var s=String(t[i]).split(";"),o=0;o<s.length;o+=1){var r=s[o].trim();try{d.push(u.jscriptyAnswerReport.save({question:n[i],questionId:a[i].id,answer:"date"===a[i].type?moment(r).format("YYYY-MM-DD"):"time"===a[i].type?moment(r).format("HH:mm"):r,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,SessionId:e.id,ProjectId:p.project.id,projectname:p.project.name}))}catch(e){console.error("Unable to convert answer",e)}}}return m.all(l).then(function(){return m.all(d).then(function(){return e})})}).then(function(e){e?t.resolve(!0):t.reject()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()});t.reject()})}p.formViewer={},p.showResetButton=!0,p.showIncompleteSubmitButton=!1,p.detectBrowser=l.detectBrowser(),p.onSubmit=function(e,n){var t=m.defer();if(n){var a=s.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("YES").cancel("NO");s.show(a).then(function(){c(t,!1)},function(){t.resolve()})}else c(t,!0);return t.promise.then(function(e){e&&(o.success({title:"Session saved",msg:"Your survey session has been properly saved!"}),function(e){try{i.$parent.$parent.$parent.vm.removeTab(e)}catch(e){o.error({title:"ERROR REMOVE TAB",msg:"Error while removing tab"})}}(p.tab))}).catch(function(e){o.error({title:"Session save error",msg:"There has been an error while trying to save your survey session!"})})},p.openContact=function(e,n){try{i.$parent.$parent.$parent.vm.addContactTab(n)}catch(e){o.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},p.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0},p.getResponseSheet=function(){return e.getResponseSheet(p.project.formData,p.project.responseData,!1)},p.getResponseSheetRow=function(){return e.getResponseSheetRow(p.project.formData,p.project.responseData)},p.getResponseSheetHeaders=function(){return e.getResponseSheetHeaders(p.project.formData,!1)},p.getQuestionWithResponseList=function(){return e.getQuestionWithResponseList(p.project.formData,p.project.responseData)},p.init=function(e){p.tab=e,p.tab&&(p.call=p.tab.call,p.starttime=p.tab.openedAt,p.contact=p.tab.contact,p.project=p.tab.project,p.project&&(_.isObjectLike(p.project.formData)?p.project.formData=p.project.formData:p.isJsonString(p.project.formData)?p.project.formData=JSON.parse(p.project.formData):p.project.formData=void 0,p.project.responseData=p.project.responseData||{},void 0!==p.project.currentPage&&a(function(){n.$broadcast("mwForm.pageEvents.changePage",{page:p.project.currentPage})}),i.$on("mwForm.pageEvents.pageCurrentChanged",function(e,n){if(n.currentPage&&(p.project.currentPage=n.currentPage.number-1,d(),p.project.enableUncompleteSave&&(1<=n.currentPage.number&&n.currentPage.number<p.project.formData.pages.length?p.showIncompleteSubmitButton=!0:p.showIncompleteSubmitButton=!1),p.project.formData&&p.project.formData.pages))for(var t=0,a=p.project.formData.pages.length;t<a;t++)if(n.currentPage.number<t+1&&p.project.formData.pages[t].elements)for(var i=0,s=p.project.formData.pages[t].elements.length;i<s;i++)"question"===p.project.formData.pages[t].elements[i].type&&p.project.formData.pages[t].elements[i].question&&delete p.project.responseData[p.project.formData.pages[t].elements[i].question.id]})))},p.resetViewer=function(e){if(p.formViewer.reset){var n=s.confirm().title(t.instant("JSCRIPTY.DO_YOU_WANT_TO_RESET_SESSION")).content(t.instant("JSCRIPTY.ALL_SURVEY_DATA_WILL_BE_LOST")).textContent("").ariaLabel("survey").targetEvent(e).ok(t.instant("JSCRIPTY.YES")).cancel(t.instant("JSCRIPTY.NO"));s.show(n).then(function(){p.showIncompleteSubmitButton=!1,p.project.currentPage=void 0,d(),p.formViewer.reset()})}}}e.$inject=["$scope","$q","$mdDialog","mwFormResponseUtils","api","toasty","Auth","$translate","$rootScope","$timeout","msUtils"],angular.module("app.dashboards").controller("AgentGeneralJscriptyController",e)}(),function(){"use strict";function e(t,a,e,n,i){var s=this;function o(){return function(e){if(404===e.status)a.info({title:t.instant("DASHBOARDS.ATTENTION"),msg:t.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}s.notification=e,s.user=i.getCurrentUser(),s.accept=function(e){{if(n[s.notification.channel+"Message"])return n[s.notification.channel+"Message"].accept({id:s.notification.id,UserId:s.user.id,manual:!0}).$promise.then(function(e){a.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(o());a.error({title:"API:ERROR",msg:"API accept message not found: "+s.notification.channel+"Message"})}},s.reject=function(e){{if(n[s.notification.channel+"Message"])return n[s.notification.channel+"Message"].reject({id:s.notification.id,UserId:s.user.id}).$promise.then(function(e){a.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(o());a.error({title:"API:ERROR",msg:"API reject message not found: "+s.notification.channel+"Message"})}}}e.$inject=["$translate","toasty","notification","api","Auth"],angular.module("app.dashboards").controller("NotificationController",e)}(),function(){"use strict";angular.module("app.dashboards").controller("AgentGeneralPopupController",function(){var n=this;n.init=function(e){n.tab=e,n.tab&&(n.tab.saved=!0,n.html=n.tab.html)}})}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&"abandoned"===e.disposition?(i.inbound.abandoned+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&!e.UserId&&e.disposition?(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.chatWebsites,{id:_.toNumber(e.ChatWebsiteId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.chatWebsites=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("chatInteraction:save",i.onSaveChatInteraction),n.on("chatInteraction:update",i.onUpdateChatInteraction),function(){if(0<Object.keys(i.chatWebsites).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("chatInteraction:save"),n.removeAllListeners("chatInteraction:update")})}e.$inject=["$scope","socket","chatInteractions","chatWebsites"],angular.module("app.dashboards").controller("UserChatDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){var l=this;function d(){s({queues:l.outboundQueues,rpcQueues:l.rpcQueues}).then(function(e){l.inbound=e})}function c(){o({rpcCampaigns:l.rpcCampaigns}).then(function(e){l.ivr=e})}l.outboundQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},l.rpcCampaigns=r?_.keyBy(r.rows?r.rows:[],"id"):{},l.ivr={originated:0,limitCalls:0},l.inbound={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0},l.onSaveQueue=function(e){l.outboundQueues[e.id]&&l.rpcQueues[e.id]&&(l.rpcQueues[e.id]=e)},l.onSaveCampaign=function(e){l.rpcCampaigns[e.id]&&(l.rpcCampaigns[e.id]=e)},t.onWithoutApply("voice_queue:save",l.onSaveQueue),l.interval=n(function(){d(),c()},999),t.onWithoutApply("campaign:save",l.onSaveCampaign),d(),c(),e.$on("$destroy",function(){t.removeListener("voice_queue:save",l.onSaveQueue),t.removeAllListeners("campaign:save"),l.interval&&n.cancel(l.interval)})}e.$inject=["$scope","$interval","socket","outboundQueues","rpcQueues","initializeRealtimeQueue","initializeRealtimeCampaign","rpcCampaigns"],angular.module("app.dashboards").controller("UserVoiceDashboardDialerController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.faxAccounts,{id:_.toNumber(e.FaxAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.faxAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("faxInteraction:save",i.onSaveFaxInteraction),n.on("faxInteraction:update",i.onUpdateFaxInteraction),function(){if(0<Object.keys(i.faxAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("faxInteraction:save"),n.removeAllListeners("faxInteraction:update")})}e.$inject=["$scope","socket","faxInteractions","faxAccounts"],angular.module("app.dashboards").controller("UserFaxDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.mailAccounts,{id:_.toNumber(e.MailAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.mailAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("mailInteraction:save",i.onSaveMailInteraction),n.on("mailInteraction:update",i.onUpdateMailInteraction),function(){if(0<Object.keys(i.mailAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("mailInteraction:save"),n.removeAllListeners("mailInteraction:update")})}e.$inject=["$scope","socket","mailInteractions","mailAccounts"],angular.module("app.dashboards").controller("UserMailDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.openchannelAccounts,{id:_.toNumber(e.OpenchannelAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.openchannelAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("openchannelInteraction:save",i.onSaveOpenchannelInteraction),n.on("openchannelInteraction:update",i.onUpdateOpenchannelInteraction),function(){if(0<Object.keys(i.openchannelAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("openchannelInteraction:save"),n.removeAllListeners("openchannelInteraction:update")})}e.$inject=["$scope","socket","openchannelInteractions","openchannelAccounts"],angular.module("app.dashboards").controller("UserOpenchannelDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.smsAccounts,{id:_.toNumber(e.SmsAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.smsAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("smsInteraction:save",i.onSaveSmsInteraction),n.on("smsInteraction:update",i.onUpdateSmsInteraction),function(){if(0<Object.keys(i.smsAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("smsInteraction:save"),n.removeAllListeners("smsInteraction:update")})}e.$inject=["$scope","socket","smsInteractions","smsAccounts"],angular.module("app.dashboards").controller("UserSmsDashboardGeneralController",e)}(),function(){"use strict";function e(t){var i=[],s=function(){var t=i[0],a={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,originated:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0};_.forIn(t.queues,function(e,n){t.rpcQueues[n]&&(a.waiting+=t.rpcQueues[n].waiting||0,a.talking+=(t.rpcQueues[n].talking||0)+(t.rpcQueues[n].pTalking||0),a.answered+=t.rpcQueues[n].answered||0,a.abandoned+=t.rpcQueues[n].abandoned||0,a.sumHoldTime+=t.rpcQueues[n].sumHoldTime||0,a.sumBillable+=t.rpcQueues[n].sumBillable||0,a.total+=t.rpcQueues[n].total||0,a.originated+=t.rpcQueues[n].originated||0,a.outboundDropCallsDayCallersExit+=t.rpcQueues[n].outboundDropCallsDayCallersExit||0,a.outboundDropCallsDayTimeout+=t.rpcQueues[n].outboundDropCallsDayTimeout||0)});var e=a.total-a.answered-a.abandoned;a.unmanaged=0<e?e:0,a.avgHoldTime=Math.round(0<a.total?a.sumHoldTime/a.total:0),a.avgHoldTime=new Date(1e3*a.avgHoldTime).toISOString().substr(11,8),a.avgTalkTime=Math.round(0<a.answered?a.sumBillable/a.answered:0),a.avgTalkTime=new Date(1e3*a.avgTalkTime).toISOString().substr(11,8),a.answerRate=Math.round((0<a.total?a.answered/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.abandonRate=Math.round((0<a.total?a.abandoned/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundDropRate=Math.round((0<a.total?a.outboundDropCallsDayTimeout/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundAbandonRate=Math.round((0<a.total?a.outboundDropCallsDayCallersExit/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundanswerRate=0<100-a.outboundDropRate-a.outboundAbandonRate&&a.total?100-a.outboundDropRate-a.outboundAbandonRate:0,i.shift(),t.defer.resolve(a),0<i.length&&s()};return function(e){var n=t.defer();return i.push({queues:e.queues,rpcQueues:e.rpcQueues,defer:n}),1===i.length&&s(),n.promise}}function n(t){var i=[],s=function(){var t=i[0],a={originated:0,limitCalls:0};_.forIn(t.rpcCampaigns,function(e,n){t.rpcCampaigns[n]&&(a.originated+=t.rpcCampaigns[n].originated||0,a.limitCalls+=t.rpcCampaigns[n].limitCalls||0)}),i.shift(),t.defer.resolve(a),0<i.length&&s()};return function(e){var n=t.defer();return i.push({rpcCampaigns:e.rpcCampaigns,defer:n}),1===i.length&&s(),n.promise}}function t(t,a,e){var i=this;i.license=e,i.onInit=function(){if(i.hasDashboardPermissions=!a.hasRole("user")||a.hasPermission(101),i.hasDashboardPermissions){var e=t.current.name;switch(e){case"app.dashboards.general":n=[],i.license.voice&&n.push("app.dashboards.general.voice"),i.license.dialer&&n.push("app.dashboards.general.dialer"),i.license.chat&&n.push("app.dashboards.general.chat"),i.license.mail&&n.push("app.dashboards.general.mail"),i.license.messaging&&n.push("app.dashboards.general.sms"),i.license.openchannel&&n.push("app.dashboards.general.openchannel"),i.license.fax&&n.push("app.dashboards.general.fax"),i.license.whatsapp&&n.push("app.dashboards.general.whatsapp"),0<n.length&&t.go(_.first(n));break;case"app.dashboards.general.voice":i.selectedTab=0;break;case"app.dashboards.general.dialer":i.selectedTab=1;break;case"app.dashboards.general.chat":i.selectedTab=2;break;case"app.dashboards.general.mail":i.selectedTab=3;break;case"app.dashboards.general.sms":i.selectedTab=4;break;case"app.dashboards.general.openchannel":i.selectedTab=5;break;case"app.dashboards.general.fax":i.selectedTab=6;break;case"app.dashboards.general.whatsapp":i.selectedTab=7}}var n}}e.$inject=["$q"],n.$inject=["$q"],t.$inject=["$state","Auth","license"],angular.module("app.dashboards").factory("initializeRealtimeQueue",e).factory("initializeRealtimeCampaign",n).controller("UserDashboardGeneralController",t)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(){s({queues:o.inboundQueues,rpcQueues:o.rpcQueues}).then(function(e){o.inbound=e})}o.inboundQueues=t?_.keyBy(t.rows?t.rows:[],"id"):{},o.rpcQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},o.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},o.outbound=i||{answered:0,sumBillable:0,sumDuration:0,sumHoldTime:0,total:0},o.onSaveQueue=function(e){o.inboundQueues[e.id]&&o.rpcQueues[e.id]&&(o.rpcQueues[e.id]=e,r())},o.onSaveOutbound=function(e){o.outbound=e},n.on("voice_queue:save",o.onSaveQueue),n.on("voice_outbound:save",o.onSaveOutbound),r(),e.$on("$destroy",function(){n.removeListener("voice_queue:save",o.onSaveQueue),n.removeAllListeners("voice_outbound:save")})}e.$inject=["$scope","socket","inboundQueues","rpcQueues","outbound","initializeRealtimeQueue"],angular.module("app.dashboards").controller("UserVoiceDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.whatsappAccounts,{id:_.toNumber(e.WhatsappAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.whatsappAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveWhatsappInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateWhatsappInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("whatsappInteraction:save",i.onSaveWhatsappInteraction),n.on("whatsappInteraction:update",i.onUpdateWhatsappInteraction),function(){if(0<Object.keys(i.whatsappAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("whatsappInteraction:save"),n.removeAllListeners("whatsappInteraction:update")})}e.$inject=["$scope","socket","whatsappInteractions","whatsappAccounts"],angular.module("app.dashboards").controller("UserWhatsappDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXACCOUNT",g.faxAccount=angular.copy(l),g.faxAccounts=r,g.newFaxAccount=!1,g.faxAccount||(g.faxAccount={waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="FAX.NEW_FAXACCOUNT",g.newFaxAccount=!0),n.params.id&&(g.faxAccount.FaxAccountId=n.params.id),g.addNewFaxAccount=function(){g.errors=[],d.faxAccount.addAccountApplications(g.faxAccount).$promise.then(function(e){g.faxAccounts.unshift(e.toJSON()),o.success({title:"FaxAccount properly created",msg:g.faxAccount.name?g.faxAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxAccount=function(){g.errors=[],d.faxAccount.updateAccountApplications(g.faxAccount).$promise.then(function(e){var n=_.find(g.faxAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FaxAccount properly saved!",msg:g.faxAccount.name?g.faxAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The faxAccount will be deleted.").ariaLabel("Delete FaxAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.faxAccount.delete({id:g.faxAccount.id}).$promise.then(function(){_.remove(g.faxAccounts,{id:g.faxAccount.id}),o.success({title:"FaxAccount properly deleted!",msg:(g.faxAccount.name||"faxAccount")+" has been deleted!"}),v(g.faxAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),t=null;if(g.faxAccount&&(t=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.trunks,{id:t.id});a.canSelect=!1,n.push(a)}g.trunks=n})}else{var t=[],a=null;g.faxAccount&&(a=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,t.push(g.trunks[i]));g.trunks=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.faxAccount&&(t=_.find(g.lists,{id:Number(g.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.faxAccount&&(a=_.find(g.lists,{id:Number(g.faxAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxAccounts","faxAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.faxAccountApps.rows.length){var t=r.faxAccountApps.rows[n]?r.faxAccountApps.rows[n]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccountApp:t,faxAccount:r.faxAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.faxAccountApps.rows[n]=e:r.faxAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.faxAccountApps.rows.length;t++,0){var a=r.faxAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.faxAccount.context,a.exten=r.faxAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.faxAccount.addApplications({id:r.faxAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.faxAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.faxAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.faxAccount={},r.faxAccountApps={count:0,rows:[]},r.selectedFaxAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"FaxQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"faxQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:901}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.faxAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getFaxAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.faxAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getFaxAccountApps=function(){r.promise=o.faxAccount.getApplications(r.query,t).$promise},r.editFaxAccountApp=n,r.editInterval=function(e,n){if(r.faxAccountApps.rows.length){var t=r.faxAccountApps.rows[n]?r.faxAccountApps.rows[n]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteFaxAccountApp=function(e){_.remove(r.faxAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedFaxAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedFaxAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedFaxAccountApps.forEach(function(e){_.remove(r.faxAccountApps.rows,{id:e.id})}),r.selectedFaxAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.fax").controller("FaxAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxAccount.getAgents({id:c.faxAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserFaxAccount?"penalty "+e.UserFaxAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.faxAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxAccount.removeAgents({id:c.faxAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxAccount.addAgents({id:c.faxAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","faxAccount","faxAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditFaxAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("fax")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:901}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountApptagDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.faxAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.faxAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.FaxAccountId=m.faxAccount.id,m.query.id=m.faxAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.faxAccount.id,field:"FaxAccountId",route:"faxAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.fax").controller("FaxAccountDispositionsController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"faxAccount",action:"getDispositions",field:"name",params:{id:m.faxAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.faxAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.faxAccountInteractions.rows.length;n+=1){var t=m.faxAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.faxInteraction.get(m.query,p).$promise}function v(e){d.faxInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.faxAccountInteractions.rows,{id:e.id}),m.faxAccountInteractions.count-=1,m.faxAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.fax):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.faxAccount={},m.faxAccountInteractions={count:0,rows:[]},m.selectedFaxAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.faxAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.FaxAccountId=m.faxAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.faxInteractionDownload=function(s,e,n){return d.faxInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="fax-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getFaxAccountInteractions=g,m.createOrEditFaxAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:m.faxAccount,interaction:n,interactions:m.faxAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spyfaxInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"fax",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"fax.faxAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||FaxAccountId:=$eq["+m.faxAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedFaxAccountInteractions=function(){var e=angular.copy(m.selectedFaxAccountInteractions);return m.selectedFaxAccountInteractions=[],e},m.deleteFaxAccountInteraction=v,m.deleteSelectedFaxAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedFaxAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedFaxAccountInteractions.forEach(function(e){v(e)}),m.selectedFaxAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountInteractionsController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=n,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=e.protocol()+"://"+e.host(),p.faxAccount=c||t.params.faxAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=t.params.tab||0,p.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.accounts",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.accounts",{})}},p.agentadddialog=function(e,n){a.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:p.faxAccounts?p.faxAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoFaxAccounts=function(){t.go("app.fax.faxAccounts",{},{reload:"app.fax.faxAccounts"})},p.saveFaxAccount=function(){r.faxAccount.updateAccountApplications(p.faxAccount).$promise.then(function(){l.success({title:"FaxAccount updated!",msg:p.faxAccount.name?p.faxAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.trunks,{id:e.resourceId})}),t=null;if(p.faxAccount&&(t=_.find(p.trunks,{id:Number(p.faxAccount.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.trunks,{id:t.id});a.canSelect=!1,n.push(a)}p.trunks=n})}else{var t=[],a=null;p.faxAccount&&(a=_.find(p.trunks,{id:Number(p.faxAccount.TrunkId)}));for(var i=0;i<p.trunks.length;i++)a&&p.trunks[i].id===a.id&&(p.trunks[i].canSelect=!1,t.push(p.trunks[i]));p.trunks=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.faxAccount&&(t=_.find(p.lists,{id:Number(p.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.faxAccount&&(a=_.find(p.lists,{id:Number(p.faxAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxAccount","userProfile","userProfileSection"],angular.module("app.fax").controller("FaxAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.faxAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="faxAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFaxAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.arrayecm=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayminrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymaxrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytech=_.keyBy([{option:"SIP",value:"'SIP'"},{option:"IAX",value:"'IAX'"},{option:"DADHI",value:"'DADHI'"},{option:"KHOMP",value:"'KHOMP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.fax.faxAccounts.edit",{id:e.id,faxAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.fax.faxAccounts.edit",{id:e.id,tab:5})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.accounts",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.accounts",{})}},f.agentadddialog=function(e,n){i.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:f.faxAccounts?f.faxAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("faxAccount")+"?").htmlContent("<b>"+(e.name||"faxAccount")+"</b> will be deleted.").ariaLabel("delete faxAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFaxAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.faxAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FaxAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFaxAccount=function(e,n){i.show({controller:"CreateOrEditFaxAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:n,faxAccounts:f.faxAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFaxAccount=y,f.exportSelectedFaxAccounts=function(){var e=angular.copy(f.selectedFaxAccounts);return f.selectedFaxAccounts=[],e},f.deleteSelectedFaxAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected faxAccounts?").htmlContent("<b>"+f.selectedFaxAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FaxAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFaxAccounts.forEach(function(e){y(e)}),f.selectedFaxAccounts=[]})},f.deselectFaxAccounts=function(){f.selectedFaxAccounts=[]},f.selectAllFaxAccounts=function(){f.selectedFaxAccounts=f.faxAccounts.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})}),a=null;a=[],f.faxAccounts.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.trunks,{id:e.id});n.canSelect=!1,t.push(n)}}),f.trunks=t})}else{var t=[],a=[];f.faxAccounts.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)});for(var i=0;i<f.trunks.length;i++){_.some(a,{id:f.trunks[i].id})&&(f.trunks[i].canSelect=!1,t.push(f.trunks[i]))}f.trunks=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.faxAccount&&(t=_.find(f.lists,{id:Number(f.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.faxAccount&&(a=_.find(f.lists,{id:Number(f.faxAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.faxAccounts=e||{count:0,rows:[]}}function y(e){m.faxAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.faxAccounts.rows,{id:e.id}),f.faxAccounts.count-=1,f.faxAccounts.rows.length||f.getFaxAccounts(),p.success({title:_.startCase("FaxAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFaxAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.fax").controller("FaxAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXQUEUE",g.faxQueue=angular.copy(l),g.faxQueues=r,g.newFaxQueue=!1,g.faxQueue||(g.faxQueue={strategy:"beepall",timeout:10},g.title="FAX.NEW_FAXQUEUE",g.newFaxQueue=!0),g.addNewFaxQueue=function(){g.errors=[],d.faxQueue.save(g.faxQueue).$promise.then(function(e){g.faxQueues.unshift(e.toJSON()),o.success({title:"FaxQueue properly created",msg:g.faxQueue.name?g.faxQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxQueue=function(){g.errors=[],d.faxQueue.update({id:g.faxQueue.id},g.faxQueue).$promise.then(function(e){var n=_.find(g.faxQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FaxQueue properly saved!",msg:g.faxQueue.name?g.faxQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The faxQueue will be deleted.").ariaLabel("Delete FaxQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.faxQueue.delete({id:g.faxQueue.id}).$promise.then(function(){_.remove(g.faxQueues,{id:g.faxQueue.id}),o.success({title:"FaxQueue properly deleted!",msg:(g.faxQueue.name||"faxQueue")+" has been deleted!"}),v(g.faxQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxQueues","faxQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxQueue.getAgents({id:c.faxQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.faxQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.removeAgents({id:c.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.addAgents({id:c.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","faxQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxQueue.getTeams({id:l.faxQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.faxQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("FAX.ALL_TEAMS"),labelSelected:t.instant("FAX.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.removeTeams({id:l.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.addTeams({id:l.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.faxQueue=c||e.params.faxQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoFaxQueues=function(){e.go("app.fax.faxQueues",{},{reload:"app.fax.faxQueues"})},u.saveFaxQueue=function(){r.faxQueue.update({id:u.faxQueue.id},u.faxQueue).$promise.then(function(){l.success({title:"FaxQueue updated!",msg:u.faxQueue.name?u.faxQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxQueue","userProfileSection"],angular.module("app.fax").controller("FaxQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.faxQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="faxQueues",f.listOrder="",f.listOrderAsc=null,f.selectedFaxQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.fax.faxQueues.edit",{id:e.id,faxQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:f.faxQueues?f.faxQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:f.faxQueues?f.faxQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("faxQueue")+"?").htmlContent("<b>"+(e.name||"faxQueue")+"</b> will be deleted.").ariaLabel("delete faxQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.queues",{})}},f.success=E,f.getFaxQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.faxQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FaxQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFaxQueue=function(e,n){i.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:n,faxQueues:f.faxQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFaxQueue=y,f.exportSelectedFaxQueues=function(){var e=angular.copy(f.selectedFaxQueues);return f.selectedFaxQueues=[],e},f.deleteSelectedFaxQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected faxQueues?").htmlContent("<b>"+f.selectedFaxQueues.length+" selected</b> will be deleted.").ariaLabel("delete FaxQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFaxQueues.forEach(function(e){y(e)}),f.selectedFaxQueues=[]})},f.deselectFaxQueues=function(){f.selectedFaxQueues=[]},f.selectAllFaxQueues=function(){f.selectedFaxQueues=f.faxQueues.rows};var b=!0,A=1;function E(e){f.faxQueues=e||{count:0,rows:[]}}function y(e){m.faxQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.faxQueues.rows,{id:e.id}),f.faxQueues.count-=1,f.faxQueues.rows.length||f.getFaxQueues(),p.success({title:_.startCase("FaxQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFaxQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.fax").controller("FaxQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){_.forIn(p.faxAccounts,function(e,n){p.rpcFaxAccounts[n]&&_.merge(e,p.rpcFaxAccounts[n])}),_.forIn(p.faxAccounts,function(n,e){var t={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),fields:"id,createdAt"};s.faxAccount.getMessages(t).$promise.then(function(e){return e&&(n.in=e.count||0,n.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),t.direction="out",s.faxAccount.getMessages(t).$promise}).then(function(e){e&&(n.out=e.count||0,n.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}p.currentUser=u.getCurrentUser(),p.count=l&&l.count?l.count:0,p.faxAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},p.rpcFaxAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.query={sort:"-name",limit:10,page:1},p.success=f,p.$onInit=g,p.getFaxAccounts=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=s.faxAccount.get(p.query,f).$promise:(p.query.id=p.userProfile.id,p.query.section="FaxAccounts",p.promise=s.userProfile.getResources(p.query,f).$promise)},p.onSave=function(e){p.faxAccounts[e.id]&&_.merge(p.faxAccounts[e.id],e)},p.onFaxMessageSave=function(e){p.faxAccounts[e.FaxAccountId]&&("in"==e.direction?(p.faxAccounts[e.FaxAccountId].in+=1,p.faxAccounts[e.FaxAccountId].lastIn=e.createdAt):(p.faxAccounts[e.FaxAccountId].out+=1,p.faxAccounts[e.FaxAccountId].lastOut=e.createdAt))},p.goToFaxAccount=function(e,n){i.go("app.fax.faxAccounts.edit",{id:n.id,faxAccount:n})},p.order=[],_.forIn(p.faxAccounts,function(e,n){p.order.push(e.id)}),o.on("faxAccount:save",p.onSave),o.on("faxAccount:update",p.onSave),o.on("faxMessage:save",p.onFaxMessageSave);var v=!0,h=1;function f(e){if(p.faxAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){p.order=[];for(var n=0;n<e.rows.length;n++)p.order.push(e.rows[n].id)}g()}e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=h),p.getFaxAccounts())}),e.$on("$destroy",function(){o.removeAllListeners("faxAccount:save"),o.removeAllListeners("faxAccount:update"),o.removeAllListeners("faxMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","faxAccounts","rpcFaxAccounts","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("FaxAccountsRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"FaxQueues":void 0,channel:"fax",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("FAX.FAXQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:n,faxQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:n,faxQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("fax_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userFaxQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.FaxQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userFaxQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.FaxQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"fax")})}),e.$on("$destroy",function(){r.removeAllListeners("fax_queue:save"),r.removeAllListeners("userFaxQueue:remove"),r.removeAllListeners("userFaxQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.fax").controller("QueuesFaxRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.fax.realtime.agents":this.selectedTab=0;break;case"app.fax.realtime.trunks":this.selectedTab=1;break;case"app.fax.realtime.queues":this.selectedTab=2;break;case"app.fax.realtime.accounts":this.selectedTab=3;break;default:this.selectedTab=0,t.go("app.fax.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.fax.realtime.agents");break;case 1:t.go("app.fax.realtime.trunks");break;case 2:t.go("app.fax.realtime.queues");break;case 3:t.go("app.fax.realtime.accounts");break;default:t.go("app.fax.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.fax").controller("FaxRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,n=0;n<u.trunks.length;n+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[n].id]))&&_.merge(u.trunks[n],_.pick(u.rpcTrunks[e],p))}function v(e,n,t){0<=n&&_.merge(e[n],_.pick(t,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},u.statusClass=r.status,u.stateClass=r.state,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,n){l.go("app.tools.trunks.edit",{id:n.id})},u.onSave=function(e){var n=_.findIndex(u.trunks,["id",e.id]),t=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,n,e),v(u.rpcTrunks,t,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("TrunksFaxRealtimeController",e)}(),function(){"use strict";function e(e,n){this.info=e,this.license=n}e.$inject=["info","license"],angular.module("app.help.about").controller("AboutController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKACCOUNT",g.deskAccount=angular.copy(l),g.deskAccounts=r,g.newDeskAccount=!1,g.deskAccount||(g.deskAccount={type:"integrationTab",authType:"basic",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_DESKACCOUNT",g.newDeskAccount=!0),g.addNewDeskAccount=function(){g.errors=[],d.intDeskAccount.save(g.deskAccount).$promise.then(function(e){g.deskAccounts.unshift(e.toJSON()),o.success({title:"DeskAccount properly created",msg:g.deskAccount.name?g.deskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskAccount=function(){g.errors=[],d.intDeskAccount.update({id:g.deskAccount.id},g.deskAccount).$promise.then(function(e){var n=_.find(g.deskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"DeskAccount properly saved!",msg:g.deskAccount.name?g.deskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The deskAccount will be deleted.").ariaLabel("Delete DeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDeskAccount.delete({id:g.deskAccount.id}).$promise.then(function(){_.remove(g.deskAccounts,{id:g.deskAccount.id}),o.success({title:"DeskAccount properly deleted!",msg:(g.deskAccount.name||"deskAccount")+" has been deleted!"}),v(g.deskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","deskAccounts","deskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.deskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="deskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedDeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayauthType=_.keyBy([{option:"Basic",value:"'basic'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.deskAccounts.edit",{id:e.id,deskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intDeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"DeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"DeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("deskAccount")+"?").htmlContent("<b>"+(e.name||"deskAccount")+"</b> will be deleted.").ariaLabel("delete deskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getDeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intDeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="DeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditDeskAccount=function(e,n){i.show({controller:"CreateOrEditDeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskAccount:n,deskAccounts:f.deskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteDeskAccount=y,f.exportSelectedDeskAccounts=function(){var e=angular.copy(f.selectedDeskAccounts);return f.selectedDeskAccounts=[],e},f.deleteSelectedDeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected deskAccounts?").htmlContent("<b>"+f.selectedDeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete DeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedDeskAccounts.forEach(function(e){y(e)}),f.selectedDeskAccounts=[]})},f.deselectDeskAccounts=function(){f.selectedDeskAccounts=[]},f.selectAllDeskAccounts=function(){f.selectedDeskAccounts=f.deskAccounts.rows};var b=!0,A=1;function E(e){f.deskAccounts=e||{count:0,rows:[]}}function y(e){m.intDeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.deskAccounts.rows,{id:e.id}),f.deskAccounts.count-=1,f.deskAccounts.rows.length||f.getDeskAccounts(),p.success({title:_.startCase("DeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getDeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","deskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("DeskAccountsController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.deskAccount={},o.deskConfiguration={},o.configurations=[],o.selectedDeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.deskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDeskAccount.getConfigurations({id:o.deskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDeskConfiguration=function(e){o.deskConfiguration=o.configurations[e],o.selectedDeskConfiguration=e,i.intDeskConfiguration.getSubjects({id:o.deskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDeskConfiguration.getDescriptions({id:o.deskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDeskConfiguration.getFields({id:o.deskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intDeskConfiguration.getTags({id:o.deskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDeskConfiguration=function(e,n){a.show({controller:"CreateOrEditDeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDeskConfiguration(0)})},o.deleteDeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the deskConfiguration?").htmlContent("<b>"+(n.name||"deskConfiguration")+"</b> will be deleted.").ariaLabel("delete deskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intDeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"DeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intDeskConfiguration.setTags({id:o.deskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("DeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKCONFIGURATION",g.deskConfiguration=angular.copy(l),g.configurations=r,g.newDeskConfiguration=!1,g.deskConfiguration||(g.deskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_DESKCONFIGURATION",g.newDeskConfiguration=!0),g.addNewDeskConfiguration=function(){g.errors=[],d.intDeskAccount.addConfiguration({id:n.params.id},g.deskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"DeskConfiguration properly created",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskConfiguration=function(){g.errors=[],d.intDeskConfiguration.update({id:g.deskConfiguration.id},g.deskConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"DeskConfiguration properly saved!",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The deskConfiguration will be deleted.").ariaLabel("Delete DeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDeskConfiguration.delete({id:g.deskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.deskConfiguration.id}),o.success({title:"DeskConfiguration properly deleted!",msg:(g.deskConfiguration.name||"deskConfiguration")+" has been deleted!"}),v(g.deskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","deskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.deskAccount=c||e.params.deskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoDeskAccounts=function(){e.go("app.integrations.deskAccounts",{},{reload:"app.integrations.deskAccounts"})},u.saveDeskAccount=function(){r.intDeskAccount.update({id:u.deskAccount.id},u.deskAccount).$promise.then(function(){l.success({title:"DeskAccount updated!",msg:u.deskAccount.name?u.deskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","deskAccount","userProfileSection"],angular.module("app.integrations").controller("DeskAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT",v.dynamics365Account=angular.copy(l),v.dynamics365Accounts=r,v.cloudProviders=d,v.newDynamics365Account=!1,v.dynamics365Account||(v.dynamics365Account={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},v.title="INTEGRATIONS.NEW_DYNAMICS365ACCOUNT",v.newDynamics365Account=!0),v.dynamics365Account.modernAuthentication=!!_.isNil(v.dynamics365Account.modernAuthentication)||v.dynamics365Account.modernAuthentication,v.isModernAuthenticationEnabled=v.dynamics365Account.modernAuthentication,v.addNewDynamics365Account=function(){v.errors=[],c.intDynamics365Account.save(v.dynamics365Account).$promise.then(function(e){v.dynamics365Accounts.unshift(e.toJSON()),o.success({title:"Dynamics365Account properly created",msg:v.dynamics365Account.name?v.dynamics365Account.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveDynamics365Account=function(){v.errors=[],c.intDynamics365Account.update({id:v.dynamics365Account.id},v.dynamics365Account).$promise.then(function(e){var n=_.find(v.dynamics365Accounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Dynamics365Account properly saved!",msg:v.dynamics365Account.name?v.dynamics365Account.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteDynamics365Account=function(e){v.errors=[];var n=a.confirm().title("Are you sure?").content("The dynamics365Account will be deleted.").ariaLabel("Delete Dynamics365Account").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDynamics365Account.delete({id:v.dynamics365Account.id}).$promise.then(function(){_.remove(v.dynamics365Accounts,{id:v.dynamics365Account.id}),o.success({title:"Dynamics365Account properly deleted!",msg:(v.dynamics365Account.name||"dynamics365Account")+" has been deleted!"}),h(v.dynamics365Account)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=h}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dynamics365Accounts","dynamics365Account","cloudProviders","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=h,b.setting=f,b.currentUser=v.getCurrentUser(),b.dynamics365Accounts=l||{count:0,rows:[]},b.cloudProviders=d||{count:0,rows:[]},b.userProfile=c,b.userProfileSection=m&&1==m.count?m.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="dynamics365Accounts",b.listOrder="",b.listOrderAsc=null,b.selectedDynamics365Accounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,n){t.go("app.integrations.dynamics365Accounts.edit",{id:e.id,dynamics365Account:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,n){return u.intDynamics365Account.getFields({id:e.id,test:!0}).$promise.then(function(){g.success({title:"Dynamics365Account properly tested",msg:"Connection succeded!"})}).catch(function(e){g.error({title:"Dynamics365Account properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("dynamics365Account")+"?").htmlContent("<b>"+(e.name||"dynamics365Account")+"</b> will be deleted.").ariaLabel("delete dynamics365Account").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDynamics365Accounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,v.hasRole("admin")?b.promise=u.intDynamics365Account.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Dynamics365Accounts",b.promise=u.userProfile.getResources(b.query,y).$promise)},b.createOrEditDynamics365Account=function(e,n){i.show({controller:"CreateOrEditDynamics365AccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Account:n,dynamics365Accounts:b.dynamics365Accounts.rows,cloudProviders:b.cloudProviders.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDynamics365Account=S,b.exportSelectedDynamics365Accounts=function(){var e=angular.copy(b.selectedDynamics365Accounts);return b.selectedDynamics365Accounts=[],e},b.deleteSelectedDynamics365Accounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected dynamics365Accounts?").htmlContent("<b>"+b.selectedDynamics365Accounts.length+" selected</b> will be deleted.").ariaLabel("delete Dynamics365Accounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){b.selectedDynamics365Accounts.forEach(function(e){S(e)}),b.selectedDynamics365Accounts=[]})},b.deselectDynamics365Accounts=function(){b.selectedDynamics365Accounts=[]},b.selectAllDynamics365Accounts=function(){b.selectedDynamics365Accounts=b.dynamics365Accounts.rows};var A=!0,E=1;function y(e){b.dynamics365Accounts=e||{count:0,rows:[]}}function S(e){u.intDynamics365Account.delete({id:e.id}).$promise.then(function(){_.remove(b.dynamics365Accounts.rows,{id:e.id}),b.dynamics365Accounts.count-=1,b.dynamics365Accounts.rows.length||b.getDynamics365Accounts(),g.success({title:_.startCase("Dynamics365Account")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDynamics365Account"}];for(var n=0;n<e.data.errors.length;n++)g.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else g.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDynamics365Account",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){A?o(function(){A=!1}):(n||(E=b.query.page),e!==n&&(b.query.page=1),e||(b.query.page=E),b.getDynamics365Accounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dynamics365Accounts","cloudProviders","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("Dynamics365AccountsController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.dynamics365Account={},o.dynamics365Configuration={},o.configurations=[],o.selectedDynamics365Configuration=-1,o.crudPermissions,o.init=function(e,n){o.dynamics365Account=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDynamics365Account.getConfigurations({id:o.dynamics365Account.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDynamics365Configuration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDynamics365Configuration=function(e){o.advancedForm&&o.advancedForm.$setPristine();o.dynamics365Configuration=o.configurations[e],o.selectedDynamics365Configuration=e,i.intDynamics365Configuration.getSubjects({id:o.dynamics365Configuration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDynamics365Configuration.getDescriptions({id:o.dynamics365Configuration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDynamics365Configuration.getFields({id:o.dynamics365Configuration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDynamics365Configuration=function(e,n){a.show({controller:"CreateOrEditDynamics365ConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Configuration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDynamics365Configuration(0)})},o.deleteDynamics365Configuration=function(e,n){var t=a.confirm().title("Are you sure want to delete the dynamics365Configuration?").htmlContent("<b>"+(n.name||"dynamics365Configuration")+"</b> will be deleted.").ariaLabel("delete dynamics365Configuration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intDynamics365Configuration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"Dynamics365Configuration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDynamics365Configuration(0)})},function(){console.log("CANCEL")})},o.saveDynamics365Configuration=function(){o.errors=[],i.intDynamics365Configuration.update({id:o.dynamics365Configuration.id},o.dynamics365Configuration).$promise.then(function(e){var n=_.find(o.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.advancedForm.$setPristine(),s.success({title:"Dynamics365Configuration properly saved!",msg:o.dynamics365Configuration.name?o.dynamics365Configuration.name+" has been saved!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("Dynamics365AccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DYNAMICS365CONFIGURATION",g.dynamics365Configuration=angular.copy(l),g.configurations=r,g.newDynamics365Configuration=!1,g.dynamics365Configuration||(g.dynamics365Configuration={channel:"voice",type:"inbound",ticketType:"incident"},g.title="INTEGRATIONS.NEW_DYNAMICS365CONFIGURATION",g.newDynamics365Configuration=!0),g.addNewDynamics365Configuration=function(){g.errors=[],d.intDynamics365Account.addConfiguration({id:n.params.id},g.dynamics365Configuration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"Dynamics365Configuration properly created",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDynamics365Configuration=function(){g.errors=[],d.intDynamics365Configuration.update({id:g.dynamics365Configuration.id},g.dynamics365Configuration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Dynamics365Configuration properly saved!",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDynamics365Configuration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The dynamics365Configuration will be deleted.").ariaLabel("Delete Dynamics365Configuration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDynamics365Configuration.delete({id:g.dynamics365Configuration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.dynamics365Configuration.id}),o.success({title:"Dynamics365Configuration properly deleted!",msg:(g.dynamics365Configuration.name||"dynamics365Configuration")+" has been deleted!"}),v(g.dynamics365Configuration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","dynamics365Configuration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365ConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDynamics365Field.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Account.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.dynamics365Account=c||e.params.dynamics365Account||{},p.cloudProviders=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.isModernAuthenticationEnabled=p.dynamics365Account.modernAuthentication,p.alert=l.info,p.gotoDynamics365Accounts=function(){e.go("app.integrations.dynamics365Accounts",{},{reload:"app.integrations.dynamics365Accounts"})},p.saveDynamics365Account=function(){r.intDynamics365Account.update({id:p.dynamics365Account.id},p.dynamics365Account).$promise.then(function(){l.success({title:"Dynamics365Account updated!",msg:p.dynamics365Account.name?p.dynamics365Account.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDynamics365Account",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","dynamics365Account","cloudProviders","userProfileSection"],angular.module("app.integrations").controller("Dynamics365AccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKACCOUNT",g.freshdeskAccount=angular.copy(l),g.freshdeskAccounts=r,g.newFreshdeskAccount=!1,g.freshdeskAccount||(g.freshdeskAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_FRESHDESKACCOUNT",g.newFreshdeskAccount=!0),g.addNewFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.save(g.freshdeskAccount).$promise.then(function(e){g.freshdeskAccounts.unshift(e.toJSON()),o.success({title:"FreshdeskAccount properly created",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.update({id:g.freshdeskAccount.id},g.freshdeskAccount).$promise.then(function(e){var n=_.find(g.freshdeskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshdeskAccount properly saved!",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshdeskAccount will be deleted.").ariaLabel("Delete FreshdeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshdeskAccount.delete({id:g.freshdeskAccount.id}).$promise.then(function(){_.remove(g.freshdeskAccounts,{id:g.freshdeskAccount.id}),o.success({title:"FreshdeskAccount properly deleted!",msg:(g.freshdeskAccount.name||"freshdeskAccount")+" has been deleted!"}),v(g.freshdeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshdeskAccounts","freshdeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshdeskAccount={},o.freshdeskConfiguration={},o.configurations=[],o.selectedFreshdeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.freshdeskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshdeskAccount.getConfigurations({id:o.freshdeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshdeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshdeskConfiguration=function(e){o.freshdeskConfiguration=o.configurations[e],o.selectedFreshdeskConfiguration=e,i.intFreshdeskConfiguration.getSubjects({id:o.freshdeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshdeskConfiguration.getDescriptions({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshdeskConfiguration.getFields({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intFreshdeskConfiguration.getTags({id:o.freshdeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshdeskConfiguration=function(e,n){a.show({controller:"CreateOrEditFreshdeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshdeskConfiguration(0)})},o.deleteFreshdeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the freshdeskConfiguration?").htmlContent("<b>"+(n.name||"freshdeskConfiguration")+"</b> will be deleted.").ariaLabel("delete freshdeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intFreshdeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"FreshdeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshdeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intFreshdeskConfiguration.setTags({id:o.freshdeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshdeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKCONFIGURATION",g.freshdeskConfiguration=angular.copy(l),g.configurations=r,g.newFreshdeskConfiguration=!1,g.freshdeskConfiguration||(g.freshdeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHDESKCONFIGURATION",g.newFreshdeskConfiguration=!0),g.addNewFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskAccount.addConfiguration({id:n.params.id},g.freshdeskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshdeskConfiguration properly created",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskConfiguration.update({id:g.freshdeskConfiguration.id},g.freshdeskConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshdeskConfiguration properly saved!",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshdeskConfiguration will be deleted.").ariaLabel("Delete FreshdeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshdeskConfiguration.delete({id:g.freshdeskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshdeskConfiguration.id}),o.success({title:"FreshdeskConfiguration properly deleted!",msg:(g.freshdeskConfiguration.name||"freshdeskConfiguration")+" has been deleted!"}),v(g.freshdeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshdeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intFreshdeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.freshdeskAccount=c||e.params.freshdeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshdeskAccounts=function(){e.go("app.integrations.freshdeskAccounts",{},{reload:"app.integrations.freshdeskAccounts"})},u.saveFreshdeskAccount=function(){r.intFreshdeskAccount.update({id:u.freshdeskAccount.id},u.freshdeskAccount).$promise.then(function(){l.success({title:"FreshdeskAccount updated!",msg:u.freshdeskAccount.name?u.freshdeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshdeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshdeskAccount","userProfileSection"],angular.module("app.integrations").controller("FreshdeskAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.freshdeskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="freshdeskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFreshdeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.freshdeskAccounts.edit",{id:e.id,freshdeskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intFreshdeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshdeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshdeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("freshdeskAccount")+"?").htmlContent("<b>"+(e.name||"freshdeskAccount")+"</b> will be deleted.").ariaLabel("delete freshdeskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFreshdeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intFreshdeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FreshdeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFreshdeskAccount=function(e,n){i.show({controller:"CreateOrEditFreshdeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskAccount:n,freshdeskAccounts:f.freshdeskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFreshdeskAccount=y,f.exportSelectedFreshdeskAccounts=function(){var e=angular.copy(f.selectedFreshdeskAccounts);return f.selectedFreshdeskAccounts=[],e},f.deleteSelectedFreshdeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected freshdeskAccounts?").htmlContent("<b>"+f.selectedFreshdeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshdeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFreshdeskAccounts.forEach(function(e){y(e)}),f.selectedFreshdeskAccounts=[]})},f.deselectFreshdeskAccounts=function(){f.selectedFreshdeskAccounts=[]},f.selectAllFreshdeskAccounts=function(){f.selectedFreshdeskAccounts=f.freshdeskAccounts.rows};var b=!0,A=1;function E(e){f.freshdeskAccounts=e||{count:0,rows:[]}}function y(e){m.intFreshdeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.freshdeskAccounts.rows,{id:e.id}),f.freshdeskAccounts.count-=1,f.freshdeskAccounts.rows.length||f.getFreshdeskAccounts(),p.success({title:_.startCase("FreshdeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshdeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshdeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFreshdeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshdeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("FreshdeskAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHSALESACCOUNT",g.freshsalesAccount=angular.copy(l),g.freshsalesAccounts=r,g.newFreshsalesAccount=!1,g.freshsalesAccount||(g.freshsalesAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_FRESHSALESACCOUNT",g.newFreshsalesAccount=!0),g.addNewFreshsalesAccount=function(){g.errors=[],d.intFreshsalesAccount.save(g.freshsalesAccount).$promise.then(function(e){g.freshsalesAccounts.unshift(e.toJSON()),o.success({title:"FreshsalesAccount properly created",msg:g.freshsalesAccount.name?g.freshsalesAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshsalesAccount=function(){g.errors=[],d.intFreshsalesAccount.update({id:g.freshsalesAccount.id},g.freshsalesAccount).$promise.then(function(e){var n=_.find(g.freshsalesAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshsalesAccount properly saved!",msg:g.freshsalesAccount.name?g.freshsalesAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshsalesAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshsalesAccount will be deleted.").ariaLabel("Delete FreshsalesAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshsalesAccount.delete({id:g.freshsalesAccount.id}).$promise.then(function(){_.remove(g.freshsalesAccounts,{id:g.freshsalesAccount.id}),o.success({title:"FreshsalesAccount properly deleted!",msg:(g.freshsalesAccount.name||"freshsalesAccount")+" has been deleted!"}),v(g.freshsalesAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshsalesAccounts","freshsalesAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshsalesAccount={},o.freshsalesConfiguration={},o.configurations=[],o.selectedFreshsalesConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.freshsalesAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshsalesAccount.getConfigurations({id:o.freshsalesAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshsalesConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshsalesConfiguration=function(e){o.freshsalesConfiguration=o.configurations[e],o.selectedFreshsalesConfiguration=e,i.intFreshsalesConfiguration.getSubjects({id:o.freshsalesConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshsalesConfiguration.getDescriptions({id:o.freshsalesConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshsalesConfiguration.getFields({id:o.freshsalesConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshsalesConfiguration=function(e,n){a.show({controller:"CreateOrEditFreshsalesConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshsalesConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshsalesConfiguration(0)})},o.deleteFreshsalesConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the freshsalesConfiguration?").htmlContent("<b>"+(n.name||"freshsalesConfiguration")+"</b> will be deleted.").ariaLabel("delete freshsalesConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intFreshsalesConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"FreshsalesConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshsalesConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshsalesAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHSALESCONFIGURATION",g.freshsalesConfiguration=angular.copy(l),g.configurations=r,g.newFreshsalesConfiguration=!1,g.freshsalesConfiguration||(g.freshsalesConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHSALESCONFIGURATION",g.newFreshsalesConfiguration=!0),g.addNewFreshsalesConfiguration=function(){g.errors=[],d.intFreshsalesAccount.addConfiguration({id:n.params.id},g.freshsalesConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshsalesConfiguration properly created",msg:g.freshsalesConfiguration.name?g.freshsalesConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshsalesConfiguration=function(){g.errors=[],d.intFreshsalesConfiguration.update({id:g.freshsalesConfiguration.id},g.freshsalesConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshsalesConfiguration properly saved!",msg:g.freshsalesConfiguration.name?g.freshsalesConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshsalesConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshsalesConfiguration will be deleted.").ariaLabel("Delete FreshsalesConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshsalesConfiguration.delete({id:g.freshsalesConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshsalesConfiguration.id}),o.success({title:"FreshsalesConfiguration properly deleted!",msg:(g.freshsalesConfiguration.name||"freshsalesConfiguration")+" has been deleted!"}),v(g.freshsalesConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshsalesConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshsalesField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshsalesField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intFreshsalesField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshsalesAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.freshsalesAccount=c||e.params.freshsalesAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshsalesAccounts=function(){e.go("app.integrations.freshsalesAccounts",{},{reload:"app.integrations.freshsalesAccounts"})},u.saveFreshsalesAccount=function(){r.intFreshsalesAccount.update({id:u.freshsalesAccount.id},u.freshsalesAccount).$promise.then(function(){l.success({title:"FreshsalesAccount updated!",msg:u.freshsalesAccount.name?u.freshsalesAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshsalesAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshsalesAccount","userProfileSection"],angular.module("app.integrations").controller("FreshsalesAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.freshsalesAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="freshsalesAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFreshsalesAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.freshsalesAccounts.edit",{id:e.id,freshsalesAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intFreshsalesAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshsalesAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshsalesAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("freshsalesAccount")+"?").htmlContent("<b>"+(e.name||"freshsalesAccount")+"</b> will be deleted.").ariaLabel("delete freshsalesAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFreshsalesAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intFreshsalesAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FreshsalesAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFreshsalesAccount=function(e,n){i.show({controller:"CreateOrEditFreshsalesAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshsalesAccount:n,freshsalesAccounts:f.freshsalesAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFreshsalesAccount=y,f.exportSelectedFreshsalesAccounts=function(){var e=angular.copy(f.selectedFreshsalesAccounts);return f.selectedFreshsalesAccounts=[],e},f.deleteSelectedFreshsalesAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected freshsalesAccounts?").htmlContent("<b>"+f.selectedFreshsalesAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshsalesAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFreshsalesAccounts.forEach(function(e){y(e)}),f.selectedFreshsalesAccounts=[]})},f.deselectFreshsalesAccounts=function(){f.selectedFreshsalesAccounts=[]},f.selectAllFreshsalesAccounts=function(){f.selectedFreshsalesAccounts=f.freshsalesAccounts.rows};var b=!0,A=1;function E(e){f.freshsalesAccounts=e||{count:0,rows:[]}}function y(e){m.intFreshsalesAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.freshsalesAccounts.rows,{id:e.id}),f.freshsalesAccounts.count-=1,f.freshsalesAccounts.rows.length||f.getFreshsalesAccounts(),p.success({title:_.startCase("FreshsalesAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshsalesAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshsalesAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFreshsalesAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshsalesAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("FreshsalesAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCEACCOUNT",g.salesforceAccount=angular.copy(l),g.salesforceAccounts=r,g.newSalesforceAccount=!1,g.salesforceAccount||(g.salesforceAccount={type:"integrationTab",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SALESFORCEACCOUNT",g.newSalesforceAccount=!0),g.addNewSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.save(g.salesforceAccount).$promise.then(function(e){g.salesforceAccounts.unshift(e.toJSON()),o.success({title:"SalesforceAccount properly created",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.update({id:g.salesforceAccount.id},g.salesforceAccount).$promise.then(function(e){var n=_.find(g.salesforceAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SalesforceAccount properly saved!",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The salesforceAccount will be deleted.").ariaLabel("Delete SalesforceAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSalesforceAccount.delete({id:g.salesforceAccount.id}).$promise.then(function(){_.remove(g.salesforceAccounts,{id:g.salesforceAccount.id}),o.success({title:"SalesforceAccount properly deleted!",msg:(g.salesforceAccount.name||"salesforceAccount")+" has been deleted!"}),v(g.salesforceAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","salesforceAccounts","salesforceAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function n(){return"Case"===o.salesforceConfiguration.ticketType&&("lead"===o.salesforceConfiguration.moduleCreate||_.includes(["lead","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch))}function r(){return _.includes(["lead","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function l(){return _.includes(["contact","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function d(){return _.includes(["account","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function c(){return i.intSalesforceConfiguration.update({id:o.salesforceConfiguration.id},o.salesforceConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function m(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function u(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.salesforceAccount={},o.salesforceConfiguration={},o.configurations=[],o.selectedSalesforceConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.salesforceAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSalesforceAccount.getConfigurations({id:o.salesforceAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSalesforceConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSalesforceConfiguration=function(e){o.salesforceConfiguration=o.configurations[e],o.salesforceConfiguration.isLead=n(),o.salesforceConfiguration.isLeadSearch=r(),o.salesforceConfiguration.isContactSearch=l(),o.salesforceConfiguration.isAccountSearch=d(),o.selectedSalesforceConfiguration=e,i.intSalesforceConfiguration.getSubjects({id:o.salesforceConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSalesforceConfiguration.getDescriptions({id:o.salesforceConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSalesforceConfiguration.getFields({id:o.salesforceConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSalesforceConfiguration=function(e,n){a.show({controller:"CreateOrEditSalesforceConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSalesforceConfiguration(0)})},o.deleteSalesforceConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the salesforceConfiguration?").htmlContent("<b>"+(n.name||"salesforceConfiguration")+"</b> will be deleted.").ariaLabel("delete salesforceConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intSalesforceConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"SalesforceConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSalesforceConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){o.salesforceConfiguration.isLead=n(),o.salesforceConfiguration.isLeadSearch=r(),o.salesforceConfiguration.isContactSearch=l(),o.salesforceConfiguration.isAccountSearch=d(),c()},o.salesforceConfiguration.isLead=!1,o.salesforceConfiguration.isLeadSearch=!1,o.salesforceConfiguration.isContactSearch=!1,o.salesforceConfiguration.isAccountSearch=!1,o.checkIsLead=n,o.checkIsLeadSearch=r,o.checkIsContactSearch=l,o.checkIsAccountSearch=d,o.saveSalesforceConfiguration=c,o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){m(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){m(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){u(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){u(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){p(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){p(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SalesforceAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCECONFIGURATION",g.salesforceConfiguration=angular.copy(l),g.configurations=r,g.newSalesforceConfiguration=!1,g.salesforceConfiguration||(g.salesforceConfiguration={channel:"voice",type:"inbound",ticketType:"Task"},g.title="INTEGRATIONS.NEW_SALESFORCECONFIGURATION",g.newSalesforceConfiguration=!0),g.addNewSalesforceConfiguration=function(){g.errors=[],d.intSalesforceAccount.addConfiguration({id:n.params.id},g.salesforceConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SalesforceConfiguration properly created",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceConfiguration=function(){g.errors=[],d.intSalesforceConfiguration.update({id:g.salesforceConfiguration.id},g.salesforceConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SalesforceConfiguration properly saved!",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The salesforceConfiguration will be deleted.").ariaLabel("Delete SalesforceConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSalesforceConfiguration.delete({id:g.salesforceConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.salesforceConfiguration.id}),o.success({title:"SalesforceConfiguration properly deleted!",msg:(g.salesforceConfiguration.name||"salesforceConfiguration")+" has been deleted!"}),v(g.salesforceConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","salesforceConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intSalesforceField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.salesforceAccount=c||e.params.salesforceAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSalesforceAccounts=function(){e.go("app.integrations.salesforceAccounts",{},{reload:"app.integrations.salesforceAccounts"})},u.saveSalesforceAccount=function(){r.intSalesforceAccount.update({id:u.salesforceAccount.id},u.salesforceAccount).$promise.then(function(){l.success({title:"SalesforceAccount updated!",msg:u.salesforceAccount.name?u.salesforceAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSalesforceAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","salesforceAccount","userProfileSection"],angular.module("app.integrations").controller("SalesforceAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.salesforceAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="salesforceAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSalesforceAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.salesforceAccounts.edit",{id:e.id,salesforceAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intSalesforceAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SalesforceAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SalesforceAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("salesforceAccount")+"?").htmlContent("<b>"+(e.name||"salesforceAccount")+"</b> will be deleted.").ariaLabel("delete salesforceAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSalesforceAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intSalesforceAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SalesforceAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSalesforceAccount=function(e,n){i.show({controller:"CreateOrEditSalesforceAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceAccount:n,salesforceAccounts:f.salesforceAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSalesforceAccount=y,f.exportSelectedSalesforceAccounts=function(){var e=angular.copy(f.selectedSalesforceAccounts);return f.selectedSalesforceAccounts=[],e},f.deleteSelectedSalesforceAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected salesforceAccounts?").htmlContent("<b>"+f.selectedSalesforceAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SalesforceAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSalesforceAccounts.forEach(function(e){y(e)}),f.selectedSalesforceAccounts=[]})},f.deselectSalesforceAccounts=function(){f.selectedSalesforceAccounts=[]},f.selectAllSalesforceAccounts=function(){f.selectedSalesforceAccounts=f.salesforceAccounts.rows};var b=!0,A=1;function E(e){f.salesforceAccounts=e||{count:0,rows:[]}}function y(e){m.intSalesforceAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.salesforceAccounts.rows,{id:e.id}),f.salesforceAccounts.count-=1,f.salesforceAccounts.rows.length||f.getSalesforceAccounts(),p.success({title:_.startCase("SalesforceAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSalesforceAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSalesforceAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSalesforceAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","salesforceAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("SalesforceAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWACCOUNT",g.servicenowAccount=angular.copy(l),g.servicenowAccounts=r,g.newServicenowAccount=!1,g.servicenowAccount||(g.servicenowAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SERVICENOWACCOUNT",g.newServicenowAccount=!0),g.addNewServicenowAccount=function(){g.errors=[],d.intServicenowAccount.save(g.servicenowAccount).$promise.then(function(e){g.servicenowAccounts.unshift(e.toJSON()),o.success({title:"ServicenowAccount properly created",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowAccount=function(){g.errors=[],d.intServicenowAccount.update({id:g.servicenowAccount.id},g.servicenowAccount).$promise.then(function(e){var n=_.find(g.servicenowAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ServicenowAccount properly saved!",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The servicenowAccount will be deleted.").ariaLabel("Delete ServicenowAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intServicenowAccount.delete({id:g.servicenowAccount.id}).$promise.then(function(){_.remove(g.servicenowAccounts,{id:g.servicenowAccount.id}),o.success({title:"ServicenowAccount properly deleted!",msg:(g.servicenowAccount.name||"servicenowAccount")+" has been deleted!"}),v(g.servicenowAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","servicenowAccounts","servicenowAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.servicenowAccount={},o.servicenowConfiguration={},o.configurations=[],o.selectedServicenowConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.servicenowAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intServicenowAccount.getConfigurations({id:o.servicenowAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getServicenowConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getServicenowConfiguration=function(e){o.servicenowConfiguration=o.configurations[e],o.selectedServicenowConfiguration=e,i.intServicenowConfiguration.getSubjects({id:o.servicenowConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intServicenowConfiguration.getDescriptions({id:o.servicenowConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intServicenowConfiguration.getFields({id:o.servicenowConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditServicenowConfiguration=function(e,n){a.show({controller:"CreateOrEditServicenowConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getServicenowConfiguration(0)})},o.deleteServicenowConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the servicenowConfiguration?").htmlContent("<b>"+(n.name||"servicenowConfiguration")+"</b> will be deleted.").ariaLabel("delete servicenowConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intServicenowConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"ServicenowConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getServicenowConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ServicenowAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWCONFIGURATION",g.servicenowConfiguration=angular.copy(l),g.configurations=r,g.newServicenowConfiguration=!1,g.servicenowConfiguration||(g.servicenowConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SERVICENOWCONFIGURATION",g.newServicenowConfiguration=!0),g.addNewServicenowConfiguration=function(){g.errors=[],d.intServicenowAccount.addConfiguration({id:n.params.id},g.servicenowConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ServicenowConfiguration properly created",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowConfiguration=function(){g.errors=[],d.intServicenowConfiguration.update({id:g.servicenowConfiguration.id},g.servicenowConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ServicenowConfiguration properly saved!",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The servicenowConfiguration will be deleted.").ariaLabel("Delete ServicenowConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intServicenowConfiguration.delete({id:g.servicenowConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.servicenowConfiguration.id}),o.success({title:"ServicenowConfiguration properly deleted!",msg:(g.servicenowConfiguration.name||"servicenowConfiguration")+" has been deleted!"}),v(g.servicenowConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","servicenowConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intServicenowField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.servicenowAccount=c||e.params.servicenowAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoServicenowAccounts=function(){e.go("app.integrations.servicenowAccounts",{},{reload:"app.integrations.servicenowAccounts"})},u.saveServicenowAccount=function(){r.intServicenowAccount.update({id:u.servicenowAccount.id},u.servicenowAccount).$promise.then(function(){l.success({title:"ServicenowAccount updated!",msg:u.servicenowAccount.name?u.servicenowAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintServicenowAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","servicenowAccount","userProfileSection"],angular.module("app.integrations").controller("ServicenowAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.servicenowAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="servicenowAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedServicenowAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.servicenowAccounts.edit",{id:e.id,servicenowAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intServicenowAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ServicenowAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ServicenowAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("servicenowAccount")+"?").htmlContent("<b>"+(e.name||"servicenowAccount")+"</b> will be deleted.").ariaLabel("delete servicenowAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getServicenowAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intServicenowAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ServicenowAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditServicenowAccount=function(e,n){i.show({controller:"CreateOrEditServicenowAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowAccount:n,servicenowAccounts:f.servicenowAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteServicenowAccount=y,f.exportSelectedServicenowAccounts=function(){var e=angular.copy(f.selectedServicenowAccounts);return f.selectedServicenowAccounts=[],e},f.deleteSelectedServicenowAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected servicenowAccounts?").htmlContent("<b>"+f.selectedServicenowAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ServicenowAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedServicenowAccounts.forEach(function(e){y(e)}),f.selectedServicenowAccounts=[]})},f.deselectServicenowAccounts=function(){f.selectedServicenowAccounts=[]},f.selectAllServicenowAccounts=function(){f.selectedServicenowAccounts=f.servicenowAccounts.rows};var b=!0,A=1;function E(e){f.servicenowAccounts=e||{count:0,rows:[]}}function y(e){m.intServicenowAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.servicenowAccounts.rows,{id:e.id}),f.servicenowAccounts.count-=1,f.servicenowAccounts.rows.length||f.getServicenowAccounts(),p.success({title:_.startCase("ServicenowAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintServicenowAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintServicenowAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getServicenowAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","servicenowAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ServicenowAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMACCOUNT",g.sugarcrmAccount=angular.copy(l),g.sugarcrmAccounts=r,g.newSugarcrmAccount=!1,g.sugarcrmAccount||(g.sugarcrmAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SUGARCRMACCOUNT",g.newSugarcrmAccount=!0),g.addNewSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.save(g.sugarcrmAccount).$promise.then(function(e){g.sugarcrmAccounts.unshift(e.toJSON()),o.success({title:"SugarcrmAccount properly created",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.update({id:g.sugarcrmAccount.id},g.sugarcrmAccount).$promise.then(function(e){var n=_.find(g.sugarcrmAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SugarcrmAccount properly saved!",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sugarcrmAccount will be deleted.").ariaLabel("Delete SugarcrmAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSugarcrmAccount.delete({id:g.sugarcrmAccount.id}).$promise.then(function(){_.remove(g.sugarcrmAccounts,{id:g.sugarcrmAccount.id}),o.success({title:"SugarcrmAccount properly deleted!",msg:(g.sugarcrmAccount.name||"sugarcrmAccount")+" has been deleted!"}),v(g.sugarcrmAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sugarcrmAccounts","sugarcrmAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.sugarcrmAccount={},o.sugarcrmConfiguration={},o.configurations=[],o.selectedSugarcrmConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.sugarcrmAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSugarcrmAccount.getConfigurations({id:o.sugarcrmAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSugarcrmConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSugarcrmConfiguration=function(e){o.sugarcrmConfiguration=o.configurations[e],o.selectedSugarcrmConfiguration=e,i.intSugarcrmConfiguration.getSubjects({id:o.sugarcrmConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSugarcrmConfiguration.getDescriptions({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSugarcrmConfiguration.getFields({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSugarcrmConfiguration=function(e,n){a.show({controller:"CreateOrEditSugarcrmConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSugarcrmConfiguration(0)})},o.deleteSugarcrmConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the sugarcrmConfiguration?").htmlContent("<b>"+(n.name||"sugarcrmConfiguration")+"</b> will be deleted.").ariaLabel("delete sugarcrmConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intSugarcrmConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"SugarcrmConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSugarcrmConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SugarcrmAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMCONFIGURATION",g.sugarcrmConfiguration=angular.copy(l),g.configurations=r,g.newSugarcrmConfiguration=!1,g.sugarcrmConfiguration||(g.sugarcrmConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SUGARCRMCONFIGURATION",g.newSugarcrmConfiguration=!0),g.addNewSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmAccount.addConfiguration({id:n.params.id},g.sugarcrmConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SugarcrmConfiguration properly created",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmConfiguration.update({id:g.sugarcrmConfiguration.id},g.sugarcrmConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SugarcrmConfiguration properly saved!",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sugarcrmConfiguration will be deleted.").ariaLabel("Delete SugarcrmConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSugarcrmConfiguration.delete({id:g.sugarcrmConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.sugarcrmConfiguration.id}),o.success({title:"SugarcrmConfiguration properly deleted!",msg:(g.sugarcrmConfiguration.name||"sugarcrmConfiguration")+" has been deleted!"}),v(g.sugarcrmConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","sugarcrmConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intSugarcrmField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.sugarcrmAccount=c||e.params.sugarcrmAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSugarcrmAccounts=function(){e.go("app.integrations.sugarcrmAccounts",{},{reload:"app.integrations.sugarcrmAccounts"})},u.saveSugarcrmAccount=function(){r.intSugarcrmAccount.update({id:u.sugarcrmAccount.id},u.sugarcrmAccount).$promise.then(function(){l.success({title:"SugarcrmAccount updated!",msg:u.sugarcrmAccount.name?u.sugarcrmAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSugarcrmAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","sugarcrmAccount","userProfileSection"],angular.module("app.integrations").controller("SugarcrmAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.sugarcrmAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="sugarcrmAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSugarcrmAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.sugarcrmAccounts.edit",{id:e.id,sugarcrmAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intSugarcrmAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SugarcrmAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SugarcrmAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("sugarcrmAccount")+"?").htmlContent("<b>"+(e.name||"sugarcrmAccount")+"</b> will be deleted.").ariaLabel("delete sugarcrmAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSugarcrmAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intSugarcrmAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SugarcrmAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSugarcrmAccount=function(e,n){i.show({controller:"CreateOrEditSugarcrmAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmAccount:n,sugarcrmAccounts:f.sugarcrmAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSugarcrmAccount=y,f.exportSelectedSugarcrmAccounts=function(){var e=angular.copy(f.selectedSugarcrmAccounts);return f.selectedSugarcrmAccounts=[],e},f.deleteSelectedSugarcrmAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected sugarcrmAccounts?").htmlContent("<b>"+f.selectedSugarcrmAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SugarcrmAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSugarcrmAccounts.forEach(function(e){y(e)}),f.selectedSugarcrmAccounts=[]})},f.deselectSugarcrmAccounts=function(){f.selectedSugarcrmAccounts=[]},f.selectAllSugarcrmAccounts=function(){f.selectedSugarcrmAccounts=f.sugarcrmAccounts.rows};var b=!0,A=1;function E(e){f.sugarcrmAccounts=e||{count:0,rows:[]}}function y(e){m.intSugarcrmAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.sugarcrmAccounts.rows,{id:e.id}),f.sugarcrmAccounts.count-=1,f.sugarcrmAccounts.rows.length||f.getSugarcrmAccounts(),p.success({title:_.startCase("SugarcrmAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSugarcrmAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSugarcrmAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSugarcrmAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sugarcrmAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("SugarcrmAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERACCOUNT",g.vtigerAccount=angular.copy(l),g.vtigerAccounts=r,g.newVtigerAccount=!1,g.vtigerAccount||(g.vtigerAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_VTIGERACCOUNT",g.newVtigerAccount=!0),g.addNewVtigerAccount=function(){g.errors=[],d.intVtigerAccount.save(g.vtigerAccount).$promise.then(function(e){g.vtigerAccounts.unshift(e.toJSON()),o.success({title:"VtigerAccount properly created",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerAccount=function(){g.errors=[],d.intVtigerAccount.update({id:g.vtigerAccount.id},g.vtigerAccount).$promise.then(function(e){var n=_.find(g.vtigerAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VtigerAccount properly saved!",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The vtigerAccount will be deleted.").ariaLabel("Delete VtigerAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intVtigerAccount.delete({id:g.vtigerAccount.id}).$promise.then(function(){_.remove(g.vtigerAccounts,{id:g.vtigerAccount.id}),o.success({title:"VtigerAccount properly deleted!",msg:(g.vtigerAccount.name||"vtigerAccount")+" has been deleted!"}),v(g.vtigerAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","vtigerAccounts","vtigerAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.vtigerAccount={},o.vtigerConfiguration={},o.configurations=[],o.selectedVtigerConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.vtigerAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intVtigerAccount.getConfigurations({id:o.vtigerAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getVtigerConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getVtigerConfiguration=function(e){o.vtigerConfiguration=o.configurations[e],o.selectedVtigerConfiguration=e,i.intVtigerConfiguration.getSubjects({id:o.vtigerConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intVtigerConfiguration.getDescriptions({id:o.vtigerConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intVtigerConfiguration.getFields({id:o.vtigerConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditVtigerConfiguration=function(e,n){a.show({controller:"CreateOrEditVtigerConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getVtigerConfiguration(0)})},o.deleteVtigerConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the vtigerConfiguration?").htmlContent("<b>"+(n.name||"vtigerConfiguration")+"</b> will be deleted.").ariaLabel("delete vtigerConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intVtigerConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"VtigerConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getVtigerConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("VtigerAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERCONFIGURATION",g.vtigerConfiguration=angular.copy(l),g.configurations=r,g.newVtigerConfiguration=!1,g.vtigerConfiguration||(g.vtigerConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_VTIGERCONFIGURATION",g.newVtigerConfiguration=!0),g.addNewVtigerConfiguration=function(){g.errors=[],d.intVtigerAccount.addConfiguration({id:n.params.id},g.vtigerConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"VtigerConfiguration properly created",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerConfiguration=function(){g.errors=[],d.intVtigerConfiguration.update({id:g.vtigerConfiguration.id},g.vtigerConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VtigerConfiguration properly saved!",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The vtigerConfiguration will be deleted.").ariaLabel("Delete VtigerConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intVtigerConfiguration.delete({id:g.vtigerConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.vtigerConfiguration.id}),o.success({title:"VtigerConfiguration properly deleted!",msg:(g.vtigerConfiguration.name||"vtigerConfiguration")+" has been deleted!"}),v(g.vtigerConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","vtigerConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intVtigerField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.vtigerAccount=c||e.params.vtigerAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVtigerAccounts=function(){e.go("app.integrations.vtigerAccounts",{},{reload:"app.integrations.vtigerAccounts"})},u.saveVtigerAccount=function(){r.intVtigerAccount.update({id:u.vtigerAccount.id},u.vtigerAccount).$promise.then(function(){l.success({title:"VtigerAccount updated!",msg:u.vtigerAccount.name?u.vtigerAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintVtigerAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","vtigerAccount","userProfileSection"],angular.module("app.integrations").controller("VtigerAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.vtigerAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="vtigerAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedVtigerAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.vtigerAccounts.edit",{id:e.id,vtigerAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intVtigerAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"VtigerAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"VtigerAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("vtigerAccount")+"?").htmlContent("<b>"+(e.name||"vtigerAccount")+"</b> will be deleted.").ariaLabel("delete vtigerAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVtigerAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intVtigerAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VtigerAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVtigerAccount=function(e,n){i.show({controller:"CreateOrEditVtigerAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerAccount:n,vtigerAccounts:f.vtigerAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVtigerAccount=y,f.exportSelectedVtigerAccounts=function(){var e=angular.copy(f.selectedVtigerAccounts);return f.selectedVtigerAccounts=[],e},f.deleteSelectedVtigerAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected vtigerAccounts?").htmlContent("<b>"+f.selectedVtigerAccounts.length+" selected</b> will be deleted.").ariaLabel("delete VtigerAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVtigerAccounts.forEach(function(e){y(e)}),f.selectedVtigerAccounts=[]})},f.deselectVtigerAccounts=function(){f.selectedVtigerAccounts=[]},f.selectAllVtigerAccounts=function(){f.selectedVtigerAccounts=f.vtigerAccounts.rows};var b=!0,A=1;function E(e){f.vtigerAccounts=e||{count:0,rows:[]}}function y(e){m.intVtigerAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.vtigerAccounts.rows,{id:e.id}),f.vtigerAccounts.count-=1,f.vtigerAccounts.rows.length||f.getVtigerAccounts(),p.success({title:_.startCase("VtigerAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintVtigerAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintVtigerAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVtigerAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","vtigerAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("VtigerAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKACCOUNT",g.zendeskAccount=angular.copy(l),g.zendeskAccounts=r,g.newZendeskAccount=!1,g.zendeskAccount||(g.zendeskAccount={type:"integrationTab",authType:"password",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_ZENDESKACCOUNT",g.newZendeskAccount=!0),g.addNewZendeskAccount=function(){g.errors=[],d.intZendeskAccount.save(g.zendeskAccount).$promise.then(function(e){g.zendeskAccounts.unshift(e.toJSON()),o.success({title:"ZendeskAccount properly created",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskAccount=function(){g.errors=[],d.intZendeskAccount.update({id:g.zendeskAccount.id},g.zendeskAccount).$promise.then(function(e){var n=_.find(g.zendeskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZendeskAccount properly saved!",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zendeskAccount will be deleted.").ariaLabel("Delete ZendeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZendeskAccount.delete({id:g.zendeskAccount.id}).$promise.then(function(){_.remove(g.zendeskAccounts,{id:g.zendeskAccount.id}),o.success({title:"ZendeskAccount properly deleted!",msg:(g.zendeskAccount.name||"zendeskAccount")+" has been deleted!"}),v(g.zendeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskAccounts","zendeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intZendeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.zendeskAccount=c||e.params.zendeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZendeskAccounts=function(){e.go("app.integrations.zendeskAccounts",{},{reload:"app.integrations.zendeskAccounts"})},u.saveZendeskAccount=function(){r.intZendeskAccount.update({id:u.zendeskAccount.id},u.zendeskAccount).$promise.then(function(){l.success({title:"ZendeskAccount updated!",msg:u.zendeskAccount.name?u.zendeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZendeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zendeskAccount","userProfileSection"],angular.module("app.integrations").controller("ZendeskAccountController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zendeskAccount={},o.zendeskConfiguration={},o.zendeskConfigurations=[],o.selectedZendeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.zendeskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZendeskAccount.getConfigurations({id:o.zendeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.zendeskConfigurations=e.rows?e.rows:[],o.zendeskConfigurations.length&&o.getZendeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZendeskConfiguration=function(e){o.zendeskConfiguration=o.zendeskConfigurations[e],o.selectedZendeskConfiguration=e,i.intZendeskConfiguration.getSubjects({id:o.zendeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZendeskConfiguration.getDescriptions({id:o.zendeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZendeskConfiguration.getFields({id:o.zendeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intZendeskConfiguration.getTags({id:o.zendeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZendeskConfiguration=function(e,n){a.show({controller:"CreateOrEditZendeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskConfiguration:n,zendeskConfigurations:o.zendeskConfigurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZendeskConfiguration(0)})},o.deleteZendeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the zendeskConfiguration?").htmlContent("<b>"+(n.name||"zendeskConfiguration")+"</b> will be deleted.").ariaLabel("delete zendeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intZendeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.zendeskConfigurations,{id:n.id}),s.success({title:"ZendeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZendeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intZendeskConfiguration.setTags({id:o.zendeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZendeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKCONFIGURATION",g.zendeskConfiguration=angular.copy(l),g.zendeskConfigurations=r,g.newZendeskConfiguration=!1,g.zendeskConfiguration||(g.zendeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZENDESKCONFIGURATION",g.newZendeskConfiguration=!0),g.addNewZendeskConfiguration=function(){g.errors=[],d.intZendeskAccount.addConfiguration({id:n.params.id},g.zendeskConfiguration).$promise.then(function(e){g.zendeskConfigurations.unshift(e.toJSON()),o.success({title:"ZendeskConfiguration properly created",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskConfiguration=function(){g.errors=[],d.intZendeskConfiguration.update({id:g.zendeskConfiguration.id},g.zendeskConfiguration).$promise.then(function(e){var n=_.find(g.zendeskConfigurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZendeskConfiguration properly saved!",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zendeskConfiguration will be deleted.").ariaLabel("Delete ZendeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZendeskConfiguration.delete({id:g.zendeskConfiguration.id}).$promise.then(function(){_.remove(g.zendeskConfigurations,{id:g.zendeskConfiguration.id}),o.success({title:"ZendeskConfiguration properly deleted!",msg:(g.zendeskConfiguration.name||"zendeskConfiguration")+" has been deleted!"}),v(g.zendeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskConfigurations","zendeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.zendeskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="zendeskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedZendeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayauthType=_.keyBy([{option:"Password",value:"'password'"},{option:"Token",value:"'token'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.zendeskAccounts.edit",{id:e.id,zendeskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intZendeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZendeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZendeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("zendeskAccount")+"?").htmlContent("<b>"+(e.name||"zendeskAccount")+"</b> will be deleted.").ariaLabel("delete zendeskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getZendeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intZendeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ZendeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditZendeskAccount=function(e,n){i.show({controller:"CreateOrEditZendeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskAccount:n,zendeskAccounts:f.zendeskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteZendeskAccount=y,f.exportSelectedZendeskAccounts=function(){var e=angular.copy(f.selectedZendeskAccounts);return f.selectedZendeskAccounts=[],e},f.deleteSelectedZendeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected zendeskAccounts?").htmlContent("<b>"+f.selectedZendeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZendeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedZendeskAccounts.forEach(function(e){y(e)}),f.selectedZendeskAccounts=[]})},f.deselectZendeskAccounts=function(){f.selectedZendeskAccounts=[]},f.selectAllZendeskAccounts=function(){f.selectedZendeskAccounts=f.zendeskAccounts.rows};var b=!0,A=1;function E(e){f.zendeskAccounts=e||{count:0,rows:[]}}function y(e){m.intZendeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.zendeskAccounts.rows,{id:e.id}),f.zendeskAccounts.count-=1,f.zendeskAccounts.rows.length||f.getZendeskAccounts(),p.success({title:_.startCase("ZendeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZendeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZendeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getZendeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zendeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ZendeskAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOACCOUNT",g.zohoAccount=angular.copy(l),g.zohoAccounts=r,g.newZohoAccount=!1,g.zohoAccount||(g.zohoAccount={host:"zoho.com",zone:"EU",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_ZOHOACCOUNT",g.newZohoAccount=!0),g.addNewZohoAccount=function(){g.errors=[],d.intZohoAccount.save(g.zohoAccount).$promise.then(function(e){g.zohoAccounts.unshift(e.toJSON()),o.success({title:"ZohoAccount properly created",msg:g.zohoAccount.name?g.zohoAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoAccount=function(){g.errors=[],d.intZohoAccount.update({id:g.zohoAccount.id},g.zohoAccount).$promise.then(function(e){var n=_.find(g.zohoAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZohoAccount properly saved!",msg:g.zohoAccount.name?g.zohoAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zohoAccount will be deleted.").ariaLabel("Delete ZohoAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZohoAccount.delete({id:g.zohoAccount.id}).$promise.then(function(){_.remove(g.zohoAccounts,{id:g.zohoAccount.id}),o.success({title:"ZohoAccount properly deleted!",msg:(g.zohoAccount.name||"zohoAccount")+" has been deleted!"}),v(g.zohoAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zohoAccounts","zohoAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zohoAccount={},o.zohoConfiguration={},o.configurations=[],o.selectedZohoConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.zohoAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZohoAccount.getConfigurations({id:o.zohoAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getZohoConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZohoConfiguration=function(e){o.zohoConfiguration=o.configurations[e],o.selectedZohoConfiguration=e,i.intZohoConfiguration.getSubjects({id:o.zohoConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZohoConfiguration.getDescriptions({id:o.zohoConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZohoConfiguration.getFields({id:o.zohoConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZohoConfiguration=function(e,n){a.show({controller:"CreateOrEditZohoConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZohoConfiguration(0)})},o.deleteZohoConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the zohoConfiguration?").htmlContent("<b>"+(n.name||"zohoConfiguration")+"</b> will be deleted.").ariaLabel("delete zohoConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intZohoConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"ZohoConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZohoConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){i.intZohoConfiguration.update({id:o.zohoConfiguration.id},o.zohoConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZohoAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOCONFIGURATION",g.zohoConfiguration=angular.copy(l),g.configurations=r,g.newZohoConfiguration=!1,g.zohoConfiguration||(g.zohoConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZOHOCONFIGURATION",g.newZohoConfiguration=!0),g.addNewZohoConfiguration=function(){g.errors=[],d.intZohoAccount.addConfiguration({id:n.params.id},g.zohoConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ZohoConfiguration properly created",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoConfiguration=function(){g.errors=[],d.intZohoConfiguration.update({id:g.zohoConfiguration.id},g.zohoConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZohoConfiguration properly saved!",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zohoConfiguration will be deleted.").ariaLabel("Delete ZohoConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZohoConfiguration.delete({id:g.zohoConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.zohoConfiguration.id}),o.success({title:"ZohoConfiguration properly deleted!",msg:(g.zohoConfiguration.name||"zohoConfiguration")+" has been deleted!"}),v(g.zohoConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","zohoConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intZohoField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.zohoAccount=c||e.params.zohoAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZohoAccounts=function(){e.go("app.integrations.zohoAccounts",{},{reload:"app.integrations.zohoAccounts"})},u.saveZohoAccount=function(){r.intZohoAccount.update({id:u.zohoAccount.id},u.zohoAccount).$promise.then(function(){l.success({title:"ZohoAccount updated!",msg:u.zohoAccount.name?u.zohoAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZohoAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zohoAccount","userProfileSection"],angular.module("app.integrations").controller("ZohoAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.zohoAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="zohoAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedZohoAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arrayhost=_.keyBy([{option:"zoho.com",value:"'zoho.com'"},{option:"zoho.eu",value:"'zoho.eu'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayzone=_.keyBy([{option:"US",value:"'US'"},{option:"AU",value:"'AU'"},{option:"EU",value:"'EU'"},{option:"IN",value:"'IN'"},{option:"CN",value:"'CN'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.zohoAccounts.edit",{id:e.id,zohoAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intZohoAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZohoAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZohoAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("zohoAccount")+"?").htmlContent("<b>"+(e.name||"zohoAccount")+"</b> will be deleted.").ariaLabel("delete zohoAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getZohoAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intZohoAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ZohoAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditZohoAccount=function(e,n){i.show({controller:"CreateOrEditZohoAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoAccount:n,zohoAccounts:f.zohoAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteZohoAccount=y,f.exportSelectedZohoAccounts=function(){var e=angular.copy(f.selectedZohoAccounts);return f.selectedZohoAccounts=[],e},f.deleteSelectedZohoAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected zohoAccounts?").htmlContent("<b>"+f.selectedZohoAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZohoAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedZohoAccounts.forEach(function(e){y(e)}),f.selectedZohoAccounts=[]})},f.deselectZohoAccounts=function(){f.selectedZohoAccounts=[]},f.selectAllZohoAccounts=function(){f.selectedZohoAccounts=f.zohoAccounts.rows};var b=!0,A=1;function E(e){f.zohoAccounts=e||{count:0,rows:[]}}function y(e){m.intZohoAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.zohoAccounts.rows,{id:e.id}),f.zohoAccounts.count-=1,f.zohoAccounts.rows.length||f.getZohoAccounts(),p.success({title:_.startCase("ZohoAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZohoAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZohoAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getZohoAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zohoAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ZohoAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="JSCRIPTY.EDIT_PROJECT",g.project=angular.copy(l),g.projects=r,g.newProject=!1,g.project||(g.project={enableUncompleteSave:!0,sendUnpauseOnSubmit:!0},g.title="JSCRIPTY.NEW_PROJECT",g.newProject=!0),g.addNewProject=function(){g.errors=[],d.jscriptyProject.save(g.project).$promise.then(function(e){g.projects.unshift(e.toJSON()),o.success({title:"Project properly created",msg:g.project.name?g.project.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveProject=function(){g.errors=[],d.jscriptyProject.update({id:g.project.id},g.project).$promise.then(function(e){var n=_.find(g.projects,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Project properly saved!",msg:g.project.name?g.project.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteProject=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.jscriptyProject.delete({id:g.project.id}).$promise.then(function(){_.remove(g.projects,{id:g.project.id}),o.success({title:"Project properly deleted!",msg:(g.project.name||"project")+" has been deleted!"}),v(g.project)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","projects","project","api","Auth","license","setting","crudPermissions"],angular.module("app.jscripty").controller("CreateOrEditProjectDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o){var r=this;r.currentUser=i.getCurrentUser(),r.project={},r.localizationMap=o;var l=new Date;r.pickerModel={dateStart:new Date(l.getFullYear(),l.getMonth(),1),dateEnd:new Date(l.getFullYear(),l.getMonth()+1,0),selectedTemplate:"TM"},r.init=function(e,n){r.project=e,r.userProfile=n,r.getAnswers()},r.getSummary=function(){return a.jscriptyProject.getSummary({id:r.project.id,startTime:{$gte:r.pickerModel.dateStart,$lte:moment(r.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format()},nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","jscriptyProjectSummary_"+r.project.id+".csv"),a.click()}else s.info({title:"EXPORT",msg:"No answers available"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.getSummary",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.getAnswers=function(){return r.hasIdAnswers=!1,a.jscriptyProject.getAnswers({id:r.project.id,sort:"-createdAt,questionId",createdAt:{$gte:moment(r.pickerModel.dateStart).add(0,"hours").add(0,"minutes").add(0,"seconds").utcOffset(0,!0).format(),$lte:moment(r.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").utcOffset(0,!0).format()},nolimit:!0}).$promise.then(function(e){if(e&&e.rows&&e.hasOwnProperty("count")){r.answers={};for(var n=0,t=e.count;n<t;n++)e.rows[n].questionId&&(r.hasIdAnswers=!0,r.answers.hasOwnProperty(e.rows[n].questionId)||(r.answers[e.rows[n].questionId]={question:e.rows[n].question,answers:{},sum:0}),""===e.rows[n].answer&&(e.rows[n].answer="NO_ANSWER"),r.answers[e.rows[n].questionId].answers[e.rows[n].answer]?r.answers[e.rows[n].questionId].answers[e.rows[n].answer]+=1:r.answers[e.rows[n].questionId].answers[e.rows[n].answer]=1,r.answers[e.rows[n].questionId].sum+=1)}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETANSWERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$mdDialog","$document","$window","api","Auth","toasty","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("ProjectAnswersController",e)}(),function(){"use strict";angular.module("app.jscripty").controller("ProjectBuilderController",function(){var n=this;n.project={},n.optionsBuilder={questionTypes:["text","textarea","radio","checkbox","select","number","date","time","email","range","url"],elementTypes:["question","paragraph"]},n.init=function(e){n.project=e,_.isObjectLike(e.formData)?n.project.formData=e.formData:n.isJsonString(e.formData)?n.project.formData=JSON.parse(e.formData):n.project.formData={}},n.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0}})}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newProject=!0,r.project=angular.copy(i),r.projects=s,r.title=o.instant("JSCRIPTY.CLONE_PROJECT"),i&&i.name&&(r.title+=": "+i.name),r.cloneProject=function(){return e.jscriptyProject.clone({id:i.id},r.project).$promise.then(function(e){r.projects.unshift(e.toJSON()),a.success({title:"Project properly cloned",msg:r.project.name?r.project.name+" has been cloned!":""}),t.go("app.jscripty.projects.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","project","projects","$translate"],angular.module("app.jscripty").controller("ProjectcloneController",e)}(),function(){"use strict";function e(a,i,n){var o=this;o.project={},o.responseData={},o.formViewer={},o.init=function(e){o.project=e,n.$on("mwForm.pageEvents.pageCurrentChanged",function(e,n){if(n.currentPage&&o.project.formData&&o.project.formData.pages)for(var t=0,a=o.project.formData.pages.length;t<a;t++)if(n.currentPage.number<t+1&&o.project.formData.pages[t].elements)for(var i=0,s=o.project.formData.pages[t].elements.length;i<s;i++)"question"===o.project.formData.pages[t].elements[i].type&&o.project.formData.pages[t].elements[i].question&&delete o.responseData[o.project.formData.pages[t].elements[i].question.id]})},o.onSubmit=function(e){var n=a.defer(),t=i.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("SAVE").cancel("CANCEL");return i.show(t).then(function(){n.resolve(!0)},function(){n.reject()}),n.promise},o.resetViewer=function(){o.formViewer.reset&&o.formViewer.reset()}}e.$inject=["$q","$mdDialog","$scope"],angular.module("app.jscripty").controller("ProjectViewerController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.projectSessions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.jscriptyProject.getSessions(m.query,u).$promise}function g(e){d.jscriptySessionReport.delete({id:e.id}).$promise.then(function(){_.remove(m.projectSessions.rows,{id:e.id}),m.projectSessions.count-=1,m.projectSessions.rows.length||p(),l.success({title:"Session deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETjscriptyProject"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.project={},m.projectSessions={count:0,rows:[]},m.selectedProjectSessions=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,starttime,endtime,membername,calleridnum,completed",sort:"-starttime",limit:10,page:1},m.init=function(e,n,t){m.project=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.id=m.project.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the session?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("session #")+e.id||"session")+"</b> will be deleted.").ariaLabel("delete session").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getProjectSessions=p,m.createOrEditProjectSession=function(e,n){o.show({controller:"CreateOrEditSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:m.project,session:n,sessions:m.projectSessions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.showQuestionsProjectSession=function(e,t){o.show({controller:"ShowQuestionsSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{questions:["apiResolver","$stateParams",function(e,n){return e.resolve("jscriptySessionReport@getQuestions",{fields:"question,answer",sort:"id",id:t.id})}]},locals:{project:m.project,session:t}})},m.exportSelectedProjectSessions=function(){var e=angular.copy(m.selectedProjectSessions);return m.selectedProjectSessions=[],e},m.deleteProjectSession=g,m.deleteSelectedProjectSessions=function(e){var n=o.confirm().title("Are you sure want to delete the selected sessions?").htmlContent("<b>"+m.selectedProjectSessions.length+" selected</b> will be deleted.").ariaLabel("delete sessions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedProjectSessions.forEach(function(e){g(e)}),m.selectedProjectSessions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.jscripty").controller("ProjectSessionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){this.title="JSCRIPTY.SESSION_RESULTS",this.session=s,this.questions=o,this.project=r,this.closeDialog=function(e){a.hide(e)}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","session","questions","project","api"],angular.module("app.jscripty").controller("ShowQuestionsSessionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.project=c||e.params.project||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.clonedialog=function(e,n){t.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{project:e,projects:p.projects?p.projects.rows:[],crudPermissions:p.crudPermissions}})},p.alert=l.info,p.gotoProjects=function(){e.go("app.jscripty.projects",{},{reload:"app.jscripty.projects"})},p.saveProject=function(){r.jscriptyProject.update({id:p.project.id},p.project).$promise.then(function(){l.success({title:"Project updated!",msg:p.project.name?p.project.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","project","userProfile","userProfileSection"],angular.module("app.jscripty").controller("JscriptyProjectController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.projects=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="projects",f.listOrder="",f.listOrderAsc=null,f.selectedProjects=[],f.query={fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.jscripty.projects.edit",{id:e.id,project:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{project:e,projects:f.projects?f.projects.rows:[],crudPermissions:f.crudPermissions}})},f.sessionsgoto=function(e,n){t.go("app.jscripty.projects.edit",{id:e.id,tab:3})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("project")+"?").htmlContent("<b>"+(e.name||"project")+"</b> will be deleted.").ariaLabel("delete project").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getProjects=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.jscriptyProject.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Projects",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditProject=function(e,n){i.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:n,projects:f.projects.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteProject=y,f.exportSelectedProjects=function(){var e=angular.copy(f.selectedProjects);return f.selectedProjects=[],e},f.deleteSelectedProjects=function(e){var n=i.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+f.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedProjects.forEach(function(e){y(e)}),f.selectedProjects=[]})},f.deselectProjects=function(){f.selectedProjects=[]},f.selectAllProjects=function(){f.selectedProjects=f.projects.rows};var b=!0,A=1;function E(e){f.projects=e||{count:0,rows:[]}}function y(e){m.jscriptyProject.delete({id:e.id}).$promise.then(function(){_.remove(f.projects.rows,{id:e.id}),f.projects.count-=1,f.projects.rows.length||f.getProjects(),p.success({title:_.startCase("Project")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEjscriptyProject"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getProjects())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","projects","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.jscripty").controller("JscriptyProjectsController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d,c,m,u){var p,g=this;function v(e){t.hide(e)}g.currentUser=l.getCurrentUser(),g.errors=[],g.setting=c,g.license=d,g.crudPermissions=m,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.mailAccount=angular.copy(s),g.mailAccounts=n,g.cloudProviders=o,g.providers=u.getEmailProviders(),g.newMailAccount=!1,g.mailAccount||(g.mailAccount={active:!0,service:"null",authentication:!0,fontSize:13,waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.newMailAccount=!0),e.params.id&&(g.mailAccount.MailAccountId=e.params.id),g.addNewMailAccount=function(){g.errors=[],r.mailAccount.save(g.mailAccount).$promise.then(function(e){g.mailAccounts.unshift(e.toJSON()),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_CREATED_SUCCESS_TITLE")}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailAccount=function(){g.errors=[],r.mailAccount.update({id:g.mailAccount.id},g.mailAccount).$promise.then(function(e){var n=_.find(g.mailAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_SAVED_SUCCESS_TITLE")}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailAccount=function(e){if(g.mailAccount.service)return i.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});g.errors=[];var n=t.confirm().title(a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_TITLE")).content(a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_MESSAGE",{name:g.mailAccount.name})).ariaLabel("Delete Mail Account").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){r.mailAccount.delete({id:g.mailAccount.id}).$promise.then(function(){_.remove(g.mailAccounts,{id:g.mailAccount.id}),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETED_SUCCESS_TITLE")}),v(g.mailAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.onProviderChange=function(){"custom"!==g.mailAccount.provider&&(g.mailAccount.authentication=!0);"outlook365"!==g.mailAccount.provider&&(g.mailAccount.modernAuthentication=!1)},g.closeDialog=v,p=[{key:"id",value:Number(g.mailAccount.ListId)}],r.getResourcesByRole(g.currentUser,"cmList",{fields:"id,name",sort:"name",nolimit:"true"},p).then(function(e){g.lists=e.rows}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$mdDialog","$translate","toasty","mailAccounts","mailAccount","cloudProviders","api","Auth","license","setting","crudPermissions","msUtils"],angular.module("app.mail").controller("CreateOrEditMailAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.mailAccountApps.rows.length){var t=r.mailAccountApps.rows[n]?r.mailAccountApps.rows[n]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccountApp:t,mailAccount:r.mailAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.mailAccountApps.rows[n]=e:r.mailAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.mailAccountApps.rows.length;t++,0){var a=r.mailAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.mailAccount.context,a.exten=r.mailAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.mailAccount.addApplications({id:r.mailAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.mailAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.mailAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.mailAccount={},r.mailAccountApps={count:0,rows:[]},r.selectedMailAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"MailQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"mailQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:601}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Reply_Type",name:"replyType",type:"select",defaultValue:"1",values:[{option:"Reply",value:"0"},{option:"Reply All",value:"1"}],required:!0,param:1},{title:"Text",name:"text",type:"html",required:!0,param:2}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.mailAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getMailAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.mailAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getMailAccountApps=function(){r.promise=o.mailAccount.getApplications(r.query,t).$promise},r.editMailAccountApp=n,r.editInterval=function(e,n){if(r.mailAccountApps.rows.length){var t=r.mailAccountApps.rows[n]?r.mailAccountApps.rows[n]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteMailAccountApp=function(e){_.remove(r.mailAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedMailAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedMailAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedMailAccountApps.forEach(function(e){_.remove(r.mailAccountApps.rows,{id:e.id})}),r.selectedMailAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.mail").controller("MailAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailAccount.getAgents({id:c.mailAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserMailAccount?"penalty "+e.UserMailAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.mailAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailAccount.removeAgents({id:c.mailAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailAccount.addAgents({id:c.mailAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","mailAccount","mailAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.agent.text=d.slice(2,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.autoreply.text=d.slice(2,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.replyType=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.autoreply.text=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.autoreply.times=1,l.autoreply.replyType=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.replyType,e[2]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.close.text=d.slice(2,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.gotoif.text=d.slice(2,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.gotop.text=d.slice(2,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditMailAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.noop.text=d.slice(2,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.queue.text=d.slice(2,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("mail")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:601}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.system.text=d.slice(2,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.tag.text=d.slice(2,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"mailAccount",action:"getDispositions",field:"name",params:{id:m.mailAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.mailAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.mailAccountInteractions.rows.length;n+=1){var t=m.mailAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,(void 0===m.query.closed||null===m.query.closed||m.query.closed)&&delete m.query.substatus,m.promise=d.mailInteraction.get(m.query,p).$promise}function v(e){d.mailInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.mailAccountInteractions.rows,{id:e.id}),m.mailAccountInteractions.count-=1,m.mailAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){_.isEmpty(e.to)||_.includes(e.to,m.mailAccount.email)?e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.email||""):e.contactName=i.instant("MAIL.UNKNOWN"):(e.contactName=e.to.split(" <")[0],e.contactInfo=e.to.split("<").pop().split(">")[0])}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.mailAccount={},m.mailAccountInteractions={count:0,rows:[]},m.selectedMailAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.mailAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.MailAccountId=m.mailAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"plainBody",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Substatus",column:"substatus",type:"multiselect",options:{field:"name",route:{model:"mailSubstatus",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){m.subStatuses=e||{count:0,rows:[]}})}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Substatus",key:"substatus",type:"select",label:"DASHBOARDS.SELECT_SUBSTATUS",options:m.subStatuses.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NONE"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name",ngIf:"closed === 0"},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.mailInteractionDownload=function(s,e,n){return d.mailInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="mail-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getMailAccountInteractions=g,m.createOrEditMailAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:m.mailAccount,interaction:n,interactions:m.mailAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spymailInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"mail",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"mail.mailAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||MailAccountId:=$eq["+m.mailAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedMailAccountInteractions=function(){var e=angular.copy(m.selectedMailAccountInteractions);return m.selectedMailAccountInteractions=[],e},m.deleteMailAccountInteraction=v,m.deleteSelectedMailAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedMailAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMailAccountInteractions.forEach(function(e){v(e)}),m.selectedMailAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.mailAccountMailCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.mailAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.mailAccountMailCannedAnswers.rows,{id:e.id}),m.mailAccountMailCannedAnswers.count-=1,m.mailAccountMailCannedAnswers.rows.length||p(),l.success({title:"MailCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.mailAccount={},m.mailAccountMailCannedAnswers={count:0,rows:[]},m.selectedMailAccountMailCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.mailAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.MailAccountId=m.mailAccount.id,m.query.id=m.mailAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the mailCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("mailCannedAnswer #")+e.id||"mailCannedAnswer")+"</b> will be deleted.").ariaLabel("delete mailCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getMailAccountMailCannedAnswers=p,m.createOrEditMailAccountMailCannedAnswer=function(e,n){o.show({controller:"CreateOrEditMailCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:m.mailAccount,mailCannedAnswer:n,mailCannedAnswers:m.mailAccountMailCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedMailAccountMailCannedAnswers=function(){var e=angular.copy(m.selectedMailAccountMailCannedAnswers);return m.selectedMailAccountMailCannedAnswers=[],e},m.deleteMailAccountMailCannedAnswer=g,m.deleteSelectedMailAccountMailCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected mailCannedAnswers?").htmlContent("<b>"+m.selectedMailAccountMailCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete mailCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMailAccountMailCannedAnswers.forEach(function(e){g(e)}),m.selectedMailAccountMailCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILCANNEDANSWER",g.mailCannedAnswer=angular.copy(l),g.mailCannedAnswers=r,g.newMailCannedAnswer=!1,g.mailCannedAnswer||(g.mailCannedAnswer={},g.title="MAIL.NEW_MAILCANNEDANSWER",g.newMailCannedAnswer=!0),n.params.id&&(g.mailCannedAnswer.MailAccountId=n.params.id),g.addNewMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.mailCannedAnswer).$promise.then(function(e){g.mailCannedAnswers.unshift(e.toJSON()),o.success({title:"MailCannedAnswer properly created",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.mailCannedAnswer.id},g.mailCannedAnswer).$promise.then(function(e){var n=_.find(g.mailCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailCannedAnswer properly saved!",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailCannedAnswer will be deleted.").ariaLabel("Delete MailCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.mailCannedAnswer.id}).$promise.then(function(){_.remove(g.mailCannedAnswers,{id:g.mailCannedAnswer.id}),o.success({title:"MailCannedAnswer properly deleted!",msg:(g.mailCannedAnswer.name||"mailCannedAnswer")+" has been deleted!"}),v(g.mailCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailCannedAnswers","mailCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.mailAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.mailAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.MailAccountId=m.mailAccount.id,m.query.id=m.mailAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.mailAccount.id,field:"MailAccountId",route:"mailAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.mail").controller("MailAccountDispositionsController",e)}(),function(){"use strict";function e(t,a,i,s,e,n,o,r,l,d,c,m,u,p,g){var v,h,f=this;f.currentUser=d.getCurrentUser(),f.license=n,f.setting=o,f.passwordPattern=f.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",f.mailAccount=c||t.params.mailAccount||{},f.cloudProviders=m||{rows:[],count:0},f.userProfile=u,f.userProfileSection=p&&1==p.count?p.rows[0]:null,f.crudPermissions=d.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.hasModulePermissions={},f.selectedTab=t.params.tab||0,f.providers=g.getEmailProviders(),f.goToRealtime=function(){return d.hasRole("admin")?t.go("app.mail.realtime.accounts",{}):r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n&&n.enabled)return t.go("app.mail.realtime.accounts",{});l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})})},f.addAgent=function(e,n){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:f.mailAccounts?f.mailAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.goToMailAccounts=function(){t.go("app.mail.mailAccounts",{},{reload:"app.mail.mailAccounts"})},f.saveMailAccount=function(){var e=angular.copy(f.mailAccount);"custom"===e.provider?e.provider=null:"outlook365"===e.provider&&(e.Smtp.modernAuthentication=e.Imap.modernAuthentication,e.Smtp.CloudProviderId=e.Imap.CloudProviderId,e.Smtp.user=e.Imap.user,e.Smtp.pass=e.Imap.password);r.mailAccount.update({id:f.mailAccount.id},e).$promise.then(function(){l.success({title:s.instant("MAIL.NOTIFICATIONS.ACCOUNT_SAVED_SUCCESS_TITLE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},e.all((h=[{key:"id",value:Number(f.mailAccount.ListId)}],r.getResourcesByRole(f.currentUser,"cmList",{fields:"id,name",sort:"name",nolimit:"true"},h).then(function(e){f.lists=e.rows}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})),(v=[{key:"id",value:Number(f.mailAccount.mandatoryDispositionPauseId)}],r.getResourcesByRole(f.currentUser,"pause",{fields:"id,name",sort:"name",nolimit:"true"},v).then(function(e){f.pauses=e.rows}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))}e.$inject=["$state","$mdDialog","$document","$translate","$q","license","setting","api","toasty","Auth","mailAccount","cloudProviders","userProfile","userProfileSection","msUtils"],angular.module("app.mail").controller("MailAccountController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,n,r,l,d,c,m,u,p){var g=this;function v(e){g.mailAccounts=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.hasRole("admin")?g.promise=d.mailAccount.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="MailAccounts",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){if(e.service)return c.error({msg:o.instant("MAIL.NOTIFICATIONS.ACCOUNT_SERVICE_DELETE")});d.mailAccount.delete({id:e.id}).$promise.then(function(){_.remove(g.mailAccounts.rows,{id:e.id}),g.mailAccounts.count-=1,g.mailAccounts.rows.length||h(),c.success({title:o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailAccount"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.mailAccounts=n||{count:0,rows:[]},g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedMailAccounts=[],g.query={fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},g.editstate=function(e){t.go("app.mail.mailAccounts.edit",{id:e.id,mailAccount:e,crudPermissions:g.crudPermissions})},g.verifySMTP=function(e){return e&&e.id?d.mailAccount.verifySmtp({id:e.id}).$promise.then(function(){c.success({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_SUCCESS_TITLE")})}).catch(function(e){c.error({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:e.data?JSON.stringify(e.data):e.toString()})}):c.error({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:o.instant("MAIL.NOTIFICATIONS.UNKNOWN_SMTP_SERVER")})},g.goToInteractions=function(e){t.go("app.mail.mailAccounts.edit",{id:e.id,tab:"custom"===e.provider?7:6})},g.goToRealtime=function(){return m.hasRole("admin")?t.go("app.mail.realtime.accounts",{}):d.userProfileSection.get({userProfileId:m.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n&&n.enabled)return t.go("app.mail.realtime.accounts",{});c.info({title:o.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:o.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})})},g.addAgent=function(e,n){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:g.mailAccounts?g.mailAccounts.rows:[],crudPermissions:g.crudPermissions,realtime:!1}})},g.deleteconfirm=function(e,n){var t=a.confirm().title(o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_TITLE")).content(o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_MESSAGE",{name:e.name})).ariaLabel("delete mail account").targetEvent(n).ok("OK").cancel(o.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.success=v,g.getMailAccounts=h,g.createOrEditMailAccount=function(e,n){a.show({controller:"CreateOrEditMailAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:n,mailAccounts:g.mailAccounts.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions},resolve:{cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}]}})},g.deleteMailAccount=f,g.exportSelectedMailAccounts=function(){var e=angular.copy(g.selectedMailAccounts);return g.selectedMailAccounts=[],e},g.deleteSelectedMailAccounts=function(e){var n=a.confirm().title(o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETE_TITLE")).content(o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETE_MESSAGE",{total:g.selectedMailAccounts.length})).ariaLabel("delete mail accounts").targetEvent(e).ok("OK").cancel(o.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedMailAccounts.forEach(function(e){f(e)}),g.selectedMailAccounts=[],c.success({title:o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETED_SUCCESS_TITLE")})})},g.deselectMailAccounts=function(){g.selectedMailAccounts=[]},g.selectAllMailAccounts=function(){g.selectedMailAccounts=g.mailAccounts.rows};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?s(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","mailAccounts","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILQUEUE",g.mailQueue=angular.copy(l),g.mailQueues=r,g.newMailQueue=!1,g.mailQueue||(g.mailQueue={strategy:"beepall",timeout:10},g.title="MAIL.NEW_MAILQUEUE",g.newMailQueue=!0),g.addNewMailQueue=function(){g.errors=[],d.mailQueue.save(g.mailQueue).$promise.then(function(e){g.mailQueues.unshift(e.toJSON()),o.success({title:"MailQueue properly created",msg:g.mailQueue.name?g.mailQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailQueue=function(){g.errors=[],d.mailQueue.update({id:g.mailQueue.id},g.mailQueue).$promise.then(function(e){var n=_.find(g.mailQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailQueue properly saved!",msg:g.mailQueue.name?g.mailQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailQueue will be deleted.").ariaLabel("Delete MailQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.mailQueue.delete({id:g.mailQueue.id}).$promise.then(function(){_.remove(g.mailQueues,{id:g.mailQueue.id}),o.success({title:"MailQueue properly deleted!",msg:(g.mailQueue.name||"mailQueue")+" has been deleted!"}),v(g.mailQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailQueues","mailQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailQueue.getAgents({id:c.mailQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.mailQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.removeAgents({id:c.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.addAgents({id:c.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","mailQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailQueue.getTeams({id:l.mailQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.mailQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MAIL.ALL_TEAMS"),labelSelected:t.instant("MAIL.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.removeTeams({id:l.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.addTeams({id:l.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.mailQueue=c||e.params.mailQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoMailQueues=function(){e.go("app.mail.mailQueues",{},{reload:"app.mail.mailQueues"})},u.saveMailQueue=function(){r.mailQueue.update({id:u.mailQueue.id},u.mailQueue).$promise.then(function(){l.success({title:"MailQueue updated!",msg:u.mailQueue.name?u.mailQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","mailQueue","userProfileSection"],angular.module("app.mail").controller("MailQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.mailQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="mailQueues",f.listOrder="",f.listOrderAsc=null,f.selectedMailQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.mail.mailQueues.edit",{id:e.id,mailQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:f.mailQueues?f.mailQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:f.mailQueues?f.mailQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("mailQueue")+"?").htmlContent("<b>"+(e.name||"mailQueue")+"</b> will be deleted.").ariaLabel("delete mailQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.mail.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.mail.realtime.queues",{})}},f.success=E,f.getMailQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.mailQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MailQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMailQueue=function(e,n){i.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:n,mailQueues:f.mailQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMailQueue=y,f.exportSelectedMailQueues=function(){var e=angular.copy(f.selectedMailQueues);return f.selectedMailQueues=[],e},f.deleteSelectedMailQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected mailQueues?").htmlContent("<b>"+f.selectedMailQueues.length+" selected</b> will be deleted.").ariaLabel("delete MailQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMailQueues.forEach(function(e){y(e)}),f.selectedMailQueues=[]})},f.deselectMailQueues=function(){f.selectedMailQueues=[]},f.selectAllMailQueues=function(){f.selectedMailQueues=f.mailQueues.rows};var b=!0,A=1;function E(e){f.mailQueues=e||{count:0,rows:[]}}function y(e){m.mailQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.mailQueues.rows,{id:e.id}),f.mailQueues.count-=1,f.mailQueues.rows.length||f.getMailQueues(),p.success({title:_.startCase("MailQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMailQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILSUBSTATUS",g.mailSubstatus=angular.copy(l),g.mailSubtatuses=r,g.newMailSubstatus=!1,g.mailSubstatus||(g.mailSubstatus={},g.title="MAIL.NEW_MAILSUBSTATUS",g.newMailSubstatus=!0),g.addNewMailSubstatus=function(){g.errors=[],d.mailSubstatus.save(g.mailSubstatus).$promise.then(function(e){g.mailSubtatuses.unshift(e.toJSON()),o.success({title:"MailSubstatus properly created",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailSubstatus=function(){g.errors=[],d.mailSubstatus.update({id:g.mailSubstatus.id},g.mailSubstatus).$promise.then(function(e){var n=_.find(g.mailSubtatuses,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailSubstatus properly saved!",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailSubstatus=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailSubstatus will be deleted.").ariaLabel("Delete MailSubstatus").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.mailSubstatus.delete({id:g.mailSubstatus.id}).$promise.then(function(){_.remove(g.mailSubtatuses,{id:g.mailSubstatus.id}),o.success({title:"MailSubstatus properly deleted!",msg:(g.mailSubstatus.name||"mailSubstatus")+" has been deleted!"}),v(g.mailSubstatus)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailSubtatuses","mailSubstatus","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailSubstatusDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.mailSubtatuses=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="mailSubtatuses",f.listOrder="",f.listOrderAsc=null,f.selectedMailSubstatuses=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailSubstatus:e,mailSubtatuses:f.mailSubtatuses.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("mailSubstatus")+"?").htmlContent("<b>"+(e.name||"mailSubstatus")+"</b> will be deleted.").ariaLabel("delete mailSubstatus").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMailSubstatuses=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.mailSubstatus.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MailSubstatuses",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMailSubstatus=function(e,n){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailSubstatus:n,mailSubtatuses:f.mailSubtatuses.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMailSubstatus=y,f.exportSelectedMailSubstatuses=function(){var e=angular.copy(f.selectedMailSubstatuses);return f.selectedMailSubstatuses=[],e},f.deleteSelectedMailSubstatuses=function(e){var n=i.confirm().title("Are you sure want to delete the selected mailSubtatuses?").htmlContent("<b>"+f.selectedMailSubstatuses.length+" selected</b> will be deleted.").ariaLabel("delete MailSubstatuss").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMailSubstatuses.forEach(function(e){y(e)}),f.selectedMailSubstatuses=[]})},f.deselectMailSubstatuses=function(){f.selectedMailSubstatuses=[]},f.selectAllMailSubstatuses=function(){f.selectedMailSubstatuses=f.mailSubtatuses.rows};var b=!0,A=1;function E(e){f.mailSubtatuses=e||{count:0,rows:[]}}function y(e){m.mailSubstatus.delete({id:e.id}).$promise.then(function(){_.remove(f.mailSubtatuses.rows,{id:e.id}),f.mailSubtatuses.count-=1,f.mailSubtatuses.rows.length||f.getMailSubstatuses(),p.success({title:_.startCase("MailSubstatus")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailSubstatus"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailSubstatus",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMailSubstatuses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailSubtatuses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailSubstatusesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){_.forIn(p.mailAccounts,function(e,n){p.rpcMailAccounts[n]&&_.merge(e,p.rpcMailAccounts[n])}),_.forIn(p.mailAccounts,function(n,e){var t={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),fields:"id,createdAt"};s.mailAccount.getMessages(t).$promise.then(function(e){return e&&(n.in=e.count||0,n.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),t.direction="out",s.mailAccount.getMessages(t).$promise}).then(function(e){e&&(n.out=e.count||0,n.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}p.currentUser=u.getCurrentUser(),p.count=l&&l.count?l.count:0,p.mailAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},p.rpcMailAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.query={sort:"-name",limit:10,page:1},p.success=f,p.$onInit=g,p.getMailAccounts=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=s.mailAccount.get(p.query,f).$promise:(p.query.id=p.userProfile.id,p.query.section="MailAccounts",p.promise=s.userProfile.getResources(p.query,f).$promise)},p.onSave=function(e){p.mailAccounts[e.id]&&_.merge(p.mailAccounts[e.id],e)},p.onMailMessageSave=function(e){p.mailAccounts[e.MailAccountId]&&("in"==e.direction?(p.mailAccounts[e.MailAccountId].in+=1,p.mailAccounts[e.MailAccountId].lastIn=e.createdAt):(p.mailAccounts[e.MailAccountId].out+=1,p.mailAccounts[e.MailAccountId].lastOut=e.createdAt))},p.goToMailAccount=function(e,n){i.go("app.mail.mailAccounts.edit",{id:n.id,mailAccount:n})},p.verifySmtp=function(e,n){{if(n&&n.id)return s.mailAccount.verifySmtp({id:n.id}).$promise.then(function(){r.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){r.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});r.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},p.order=[],_.forIn(p.mailAccounts,function(e,n){p.order.push(e.id)}),o.on("mailAccount:save",p.onSave),o.on("mailAccount:update",p.onSave),o.on("mailMessage:save",p.onMailMessageSave);var v=!0,h=1;function f(e){if(p.mailAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){p.order=[];for(var n=0;n<e.rows.length;n++)p.order.push(e.rows[n].id)}g()}e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=h),p.getMailAccounts())}),e.$on("$destroy",function(){o.removeAllListeners("mailAccount:save"),o.removeAllListeners("mailAccount:update"),o.removeAllListeners("mailMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","mailAccounts","rpcMailAccounts","userProfile","userProfileSection","Auth"],angular.module("app.mail").controller("MailAccountsRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"MailQueues":void 0,channel:"mail",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("MAIL.MAILQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:n,mailQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:n,mailQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("mail_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userMailQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.MailQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userMailQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.MailQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"mail")})}),e.$on("$destroy",function(){r.removeAllListeners("mail_queue:save"),r.removeAllListeners("userMailQueue:remove"),r.removeAllListeners("userMailQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.mail").controller("QueuesMailRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.mail.realtime.agents":this.selectedTab=0;break;case"app.mail.realtime.queues":this.selectedTab=1;break;case"app.mail.realtime.accounts":this.selectedTab=2;break;default:this.selectedTab=0,t.go("app.mail.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.mail.realtime.agents");break;case 1:t.go("app.mail.realtime.queues");break;case 2:t.go("app.mail.realtime.accounts");break;default:t.go("app.mail.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.mail").controller("MailRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MARKETPLACE.EDIT_PLUGIN",g.plugin=angular.copy(l),g.plugins=r,g.newPlugin=!1,g.plugin||(g.plugin={},g.title="MARKETPLACE.NEW_PLUGIN",g.newPlugin=!0),g.addNewPlugin=function(){g.errors=[],d.plugin.save(g.plugin).$promise.then(function(e){g.plugins.unshift(e.toJSON()),o.success({title:"Plugin properly created",msg:g.plugin.name?g.plugin.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePlugin=function(){g.errors=[],d.plugin.update({id:g.plugin.id},g.plugin).$promise.then(function(e){var n=_.find(g.plugins,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Plugin properly saved!",msg:g.plugin.name?g.plugin.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePlugin=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The plugin will be deleted.").ariaLabel("Delete Plugin").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.plugin.delete({id:g.plugin.id}).$promise.then(function(){_.remove(g.plugins,{id:g.plugin.id}),o.success({title:"Plugin properly deleted!",msg:(g.plugin.name||"plugin")+" has been deleted!"}),v(g.plugin)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","plugins","plugin","api","Auth","license","setting","crudPermissions"],angular.module("app.marketplace").controller("CreateOrEditPluginDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.plugin=c||e.params.plugin||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoPlugins=function(){e.go("app.marketplace.plugins",{},{reload:"app.marketplace.plugins"})},u.savePlugin=function(){r.plugin.update({id:u.plugin.id},u.plugin).$promise.then(function(){l.success({title:"Plugin updated!",msg:u.plugin.name?u.plugin.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETplugin",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","plugin","userProfileSection"],angular.module("app.marketplace").controller("MarketplacePluginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.plugins=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="plugins",f.listOrder="",f.listOrderAsc=null,f.selectedPlugins=[],f.query={fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,page:1},f.installing=!1,f.arraysidebar=_.keyBy([{option:"Always",value:"'always'"},{option:"Admin Only",value:"'adminOnly'"},{option:"Agent Only",value:"'agentOnly'"},{option:"Never",value:"'never'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.installplugin=function(e){{if("script"!==e.type)return e.active=!0,m.plugin.update({id:e.id},e).$promise.then(function(){p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});f.installing=!0,m.pm2.save({name:e.scriptName,script:e.path+"/"+e.scriptPath}).$promise.then(function(){return e.active=!0,m.plugin.update({id:e.id},e).$promise}).then(function(){f.installing=!1,p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.save"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.save",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}},f.editstate=function(e,n){t.go("app.marketplace.plugins.edit",{id:e.id,plugin:e,crudPermissions:f.crudPermissions})},f.stopplugin=function(e,n){var t=i.confirm().title("Are you sure want to stop the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be stoppped.").ariaLabel("stop plugin process").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){var t;t=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.update({id:n.pm_id,status:"stopped"}).$promise.then(function(){p.success({title:"Process stopped!",msg:"Attached pm2 process successfully stopped"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},f.restartplugin=function(e,n){var t=i.confirm().title("Are you sure want to restart the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be restarted.").ariaLabel("restart plugin process").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){var t;t=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.update({id:n.pm_id,status:"online"}).$promise.then(function(){p.success({title:"Process restarted!",msg:"Attached pm2 process successfully restarted"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},f.downloadfile2=function(s,e){return m.plugin.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.name.replace(" ","_").toLowerCase()+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.uninstallplugin=function(e,n){var t=i.confirm().title("Are you sure want to uninstall the plugin?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be uninstalled.").ariaLabel("uninstall plugin").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){!function(t){"script"===t.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.delete({id:n.pm_id,name:t.scriptName}).$promise}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});t.active=!1,m.plugin.update({id:t.id},t).$promise.then(function(){p.success({title:"Plugin uninstalled!",msg:t.name?t.name+" has been uninstalled!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}(e)},function(){console.log("CANCEL")})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("plugin")+"?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be deleted.").ariaLabel("delete plugin").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getPlugins=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.plugin.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Plugins",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditPlugin=function(e,n){i.show({controller:"CreateOrEditPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugin:n,plugins:f.plugins.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletePlugin=y,f.exportSelectedPlugins=function(){var e=angular.copy(f.selectedPlugins);return f.selectedPlugins=[],e},f.deleteSelectedPlugins=function(e){var n=i.confirm().title("Are you sure want to delete the selected plugins?").htmlContent("<b>"+f.selectedPlugins.length+" selected</b> will be deleted.").ariaLabel("delete Plugins").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedPlugins.forEach(function(e){y(e)}),f.selectedPlugins=[]})},f.deselectPlugins=function(){f.selectedPlugins=[]},f.selectAllPlugins=function(){f.selectedPlugins=f.plugins.rows},f.uploadPlugin=function(e){i.show({controller:"UploadPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugins:f.plugins.rows}})};var b=!0,A=1;function E(e){f.plugins=e||{count:0,rows:[]}}function y(t){t.active&&"script"==t.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)return p.error({title:"Plugin not deleted!",msg:"Failed to retrieve pm2 processes"});var n=_.find(e.rows,{name:t.scriptName});n?m.pm2.delete({id:n.pm_id,name:t.scriptName}).$promise:console.log("No '%s' process found",t.scriptName)}).catch(function(e){return p.error({title:"PM2 process not found!",msg:"Failed to delete the attached pm2 process"})}),m.plugin.delete({id:t.id}).$promise.then(function(){_.remove(f.plugins.rows,{id:t.id}),f.plugins.count-=1,f.plugins.rows.length||f.getPlugins(),p.success({title:_.startCase("Plugin")+" deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEplugin"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEplugin",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getPlugins())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","plugins","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.marketplace").controller("MarketplacePluginsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this,r=4,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="MARKETPLACE.UPLOAD_PLUGIN",o.plugins=a,o.uploadPlugins=[],o.uploadState="none",o.plugin={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/plugins"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var n=["zip"];if(!_.includes(n,e.getExtension()))return t.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>l)return t.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.plugin={id:e.uniqueIdentifier,file:e},o.uploadPlugins.unshift(o.plugin),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.plugins.unshift(JSON.parse(e)),angular.forEach(o.uploadPlugins,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result}}})},o.uploadError=function(e,n){o.ngFlow.flow.cancel(),t.error({title:"Upload error",msg:"Cannot upload the plugin"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",t.success({title:"Upload completed",msg:o.plugin.file.name+" uploaded successfully"}))},o.closeDialog=function(){n.hide()}}e.$inject=["$cookies","$mdDialog","toasty","plugins","api","Auth"],angular.module("app.marketplace").controller("UploadPluginDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=c.getCurrentUser(),v.errors=[],v.setting=u,v.license=m,v.crudPermissions=p,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="MOTIONDIALER.EDIT_HOPPER",v.hopper=angular.copy(l),v.hoppers=r,v.newHopper=!1,v.contact,v.dateTime,v.hopper||(v.hopper={},v.title="MOTIONDIALER.NEW_HOPPER",v.newHopper=!0),n.params.id&&("IvrCampaign"===g?v.hopper.CampaignId=n.params.id:"QueueCampaign"==g?v.hopper.VoiceQueueId=n.params.id:v.hopper.ContactId=n.params.id),v.addNewHopper=function(){v.errors=[],d.cmHopper.save(v.hopper).$promise.then(function(e){v.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:v.hopper.name?v.hopper.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveHopper=function(){var t,a,i,s;v.errors=[],v.hopper.UserId=v.hopper.recallme?v.hopper.UserId:null,v.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:v.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){v.hopper.dialTimezone=v.contact.dialTimezone,d.cmHopper.update({id:v.hopper.id},_.omit(v.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme}).$promise.then(function(){d.cmContact.update({id:a.ContactId,dialTimezone:v.contact.dialTimezone})})})});var n=_.find(v.hoppers,{id:e.id});n&&_.merge(n,_.pick(e.toJSON(),_.keys(n))),o.success({title:"Hopper properly saved!",msg:v.hopper.name?v.hopper.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},v.deleteHopper=function(e){v.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:v.hopper.id}).$promise.then(function(){_.remove(v.hoppers,{id:v.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(v.hopper.name||"hopper")+" has been deleted!"}),h(v.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=h,v.recalcTZTime=function(){if(_.isNil(v.hopper.VoiceQueueId)){var e=v.hopper.CampaignId;d.campaign.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.hopper.scheduledat=moment(v.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledat=moment(v.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}})}else{var e=v.hopper.VoiceQueueId;e&&d.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.hopper.scheduledat=moment(v.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledat=moment(v.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}})}},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){v.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){v.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(v.agents,{id:e.resourceId})}),t=null;if(v.hopper&&(t=_.find(v.agents,{id:Number(v.hopper.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(v.agents,{id:t.id});a.canSelect=!1,n.push(a)}v.agents=n})}else{var t=[],a=null;v.hopper&&(a=_.find(v.agents,{id:Number(v.hopper.UserId)}));for(var i=0;i<v.agents.length;i++)a&&v.agents[i].id===a.id&&(v.agents[i].canSelect=!1,t.push(v.agents[i]));v.agents=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.cmContact.get({id:v.hopper.ContactId,fields:"dialTimezone"}).$promise.then(function(e){var n;v.contact=e,_.isNil(v.hopper.VoiceQueueId)?(n=v.hopper.CampaignId)&&d.campaign.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;v.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.dateTime=moment(v.hopper.scheduledat).add(n-t,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.dateTime=moment(v.hopper.scheduledat).add(n-0,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):(n=v.hopper.VoiceQueueId)&&d.voiceQueue.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;v.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.dateTime=moment(v.hopper.scheduledat).add(n-t,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.dateTime=moment(v.hopper.scheduledat).add(n-0,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions","from"],angular.module("app.motiondialer").controller("HopperdateController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_IVRCAMPAIGN",g.ivrCampaign=angular.copy(l),g.ivrCampaigns=r,g.newIvrCampaign=!1,g.ivrCampaign||(g.ivrCampaign={active:!0,type:"ivr",dialCheckDuplicateType:"always",dialCutDigit:0,limitCalls:30,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialNoSuchNumberMaxRetry:3,dialNoSuchNumberRetryFrequency:150,dialDropMaxRetry:3,dialDropRetryFrequency:150,dialAbandonedMaxRetry:3,dialAbandonedRetryFrequency:150,dialMachineMaxRetry:3,dialMachineRetryFrequency:150,dialAgentRejectMaxRetry:3,dialAgentRejectRetryFrequency:150,dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3},g.title="MOTIONDIALER.NEW_IVRCAMPAIGN",g.newIvrCampaign=!0),g.addNewIvrCampaign=function(){g.errors=[],d.campaign.save(g.ivrCampaign).$promise.then(function(e){g.ivrCampaigns.unshift(e.toJSON()),o.success({title:"IvrCampaign properly created",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveIvrCampaign=function(){g.errors=[],d.campaign.update({id:g.ivrCampaign.id},g.ivrCampaign).$promise.then(function(e){var n=_.find(g.ivrCampaigns,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"IvrCampaign properly saved!",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteIvrCampaign=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The ivrCampaign will be deleted.").ariaLabel("Delete IvrCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.campaign.delete({id:g.ivrCampaign.id}).$promise.then(function(){_.remove(g.ivrCampaigns,{id:g.ivrCampaign.id}),o.success({title:"IvrCampaign properly deleted!",msg:(g.ivrCampaign.name||"ivrCampaign")+" has been deleted!"}),v(g.ivrCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})});g.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.trunks=n})}else g.trunks=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.projects,{id:e.resourceId})}),t=null;if(g.ivrCampaign&&(t=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.projects,{id:t.id});a.canSelect=!1,n.push(a)}g.projects=n})}else{var t=[],a=null;g.ivrCampaign&&(a=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)}));for(var i=0;i<g.projects.length;i++)a&&g.projects[i].id===a.id&&(g.projects[i].canSelect=!1,t.push(g.projects[i]));g.projects=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.ivrCampaign&&(t=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.ivrCampaign&&(a=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","ivrCampaigns","ivrCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditIvrCampaignDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=n,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignblacklistaddController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newIvrCampaign=!0,r.ivrCampaign=angular.copy(i),r.ivrCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_IVRCAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneIvrCampaign=function(){return e.campaign.clone({id:i.id},r.ivrCampaign).$promise.then(function(e){r.ivrCampaigns.unshift(e.toJSON()),a.success({title:"IvrCampaign properly cloned",msg:r.ivrCampaign.name?r.ivrCampaign.name+" has been cloned!":""}),t.go("app.motiondialer.ivrCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","ivrCampaign","ivrCampaigns","$translate"],angular.module("app.motiondialer").controller("IvrCampaigncloneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperBlacks=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperBlacks(m.query,u).$promise}function g(e){d.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperBlacks.rows,{id:e.id}),m.ivrCampaignHopperBlacks.count-=1,m.ivrCampaignHopperBlacks.rows.length||p(),l.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHopperBlacks={count:0,rows:[]},m.selectedIvrCampaignHopperBlacks=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperBlack #")+e.id||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperBlacks=p,m.createOrEditIvrCampaignHopperBlack=function(e,n){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperBlack:n,hopperBlacks:m.ivrCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperBlacks=function(){var e=angular.copy(m.selectedIvrCampaignHopperBlacks);return m.selectedIvrCampaignHopperBlacks=[],e},m.deleteIvrCampaignHopperBlack=g,m.deleteSelectedIvrCampaignHopperBlacks=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+m.selectedIvrCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperBlacks.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperBlacks=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperFinals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperFinals(m.query,u).$promise}function g(e){d.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperFinals.rows,{id:e.id}),m.ivrCampaignHopperFinals.count-=1,m.ivrCampaignHopperFinals.rows.length||p(),l.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){d.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){l.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var n,t;"Not Found"===e.data?d.cmHopper.save((n=a,t={},t.phone=n.calleridnum,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=0,t.countcongestionretry=0,t.countnoanswerretry=0,t.countglobal=0,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=n.deleted?null:n.UserId,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.priority=n.recallme?3:2,t.recallme=!!n.recallme,t)).$promise.then(function(e){var n,t;l.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&d.cmHopperHistory.save(((t={}).calleridnum=(n=a).calleridnum,t.calleridname=n.calleridname,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=n.countbusyretry,t.countcongestionretry=n.countcongestionretry,t.countnoanswerretry=n.countnoanswerretry,t.countglobal=n.countglobal,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=c.getCurrentUser().id,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),t.edited=!0,t.state=25,t.statedesc="Restored",t.campaign=n.campaign,t.campaigntype=n.VoiceQueueId?"queue":"ivr",t))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):l.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.contacts={},m.ivrCampaign={},m.ivrCampaignHopperFinals={count:0,rows:[]},m.selectedIvrCampaignHopperFinals=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperFinal #")+e.id||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperFinals=p,m.createOrEditIvrCampaignHopperFinal=function(e,n){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperFinal:n,hopperFinals:m.ivrCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperFinals=function(){var e=angular.copy(m.selectedIvrCampaignHopperFinals);return m.selectedIvrCampaignHopperFinals=[],e},m.deleteIvrCampaignHopperFinal=g,m.deleteSelectedIvrCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+m.selectedIvrCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperFinals.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperFinals=[]})},m.moveIvrCampaignHopperFinal=v,m.moveContactsIvrCampaignHopperFinal=function(e){d.cmHopperFinal.moveContactsIvrCampaignHopperFinal({id:m.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?l.info({title:"Restored Contacts",msg:"0"}):l.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.countContactsIvrCampaignHopperFinal=function(e){d.cmHopperFinal.countContactsIvrCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(m.contacts,e[0])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.moveConfirm=function(e,n){var t=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.moveSelectedIvrCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperFinals.forEach(function(e){v(e)}),m.selectedIvrCampaignHopperFinals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperHistories=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperHistories(m.query,u).$promise}function g(e){d.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperHistories.rows,{id:e.id}),m.ivrCampaignHopperHistories.count-=1,m.ivrCampaignHopperHistories.rows.length||p(),l.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHopperHistories={count:0,rows:[]},m.selectedIvrCampaignHopperHistories=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperHistory #")+e.id||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperHistories=p,m.createOrEditIvrCampaignHopperHistory=function(e,n){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperHistory:n,hopperHistories:m.ivrCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperHistories=function(){var e=angular.copy(m.selectedIvrCampaignHopperHistories);return m.selectedIvrCampaignHopperHistories=[],e},m.deleteIvrCampaignHopperHistory=g,m.deleteSelectedIvrCampaignHopperHistories=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+m.selectedIvrCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperHistories.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperHistories=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHoppers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHoppers(m.query,u).$promise}function g(e){d.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHoppers.rows,{id:e.id}),m.ivrCampaignHoppers.count-=1,m.ivrCampaignHoppers.rows.length||p(),l.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHoppers={count:0,rows:[]},m.selectedIvrCampaignHoppers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,scheduledat,priority",sort:"-updatedAt",limit:10,page:1},m.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopper #")+e.id||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHoppers=p,m.createOrEditIvrCampaignHopper=function(e,n){o.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopper:n,hoppers:m.ivrCampaignHoppers.rows,license:null,setting:null,crudPermissions:m.crudPermissions,from:"IvrCampaign"}})},m.exportSelectedIvrCampaignHoppers=function(){var e=angular.copy(m.selectedIvrCampaignHoppers);return m.selectedIvrCampaignHoppers=[],e},m.deleteIvrCampaignHopper=g,m.deleteSelectedIvrCampaignHoppers=function(e){var n=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+m.selectedIvrCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHoppers.forEach(function(e){g(e)}),m.selectedIvrCampaignHoppers=[]})},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.agents,{id:e.resourceId})});m.agents.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),m.agents=n})}else m.agents=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHoppersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),n.params.id&&(g.hopper.CampaignId=n.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var t,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.campaign.get({raw:!1,id:a.CampaignId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var n=_.find(g.hoppers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})});g.agents.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.agents=n})}else g.agents=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperCampaignIdDialogController",e)}(),function(){"use strict";function e(t,a){var i=this;i.ivrCampaign={},i.init=function(n){i.ivrCampaign=n,t.cmHopper.get({limit:0,CampaignId:n.id}).$promise.then(function(e){return i.total=e.count||0,t.cmHopper.get({limit:0,CampaignId:n.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0,countnosuchnumberretry:0,countdropretry:0,countabandonedretry:0,countmachineretry:0,countagentrejectretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,t.cmHopperFinal.get({limit:0,CampaignId:n.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("IvrCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=n,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignlistaddController",e)}(),function(){"use strict";function e(e,n,a,i,s,t,o,r){var l=this;function d(){n.hide()}function c(e,n){var t=n.id;o.enqueue(function(){return i.campaign.removeLists({id:e,ids:t}).$promise.then(function(){return i.campaign.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=t||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,n){return-1<n.indexOf(e)},l.toggle=function(e,n){var t=n.indexOf(e);-1<t?n.splice(t,1):n.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,n){for(var t=0;t<l.selected.length;t+=1)c(s.id,l.selected[t]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","ivrCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("IvrCampaignresetlistController",e)}(),function(){"use strict";function e(t,e,i,s,a,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.ivrCampaign=c||t.params.ivrCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,n){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,n){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.resetlistdialog=function(n,t){r.campaign.getLists({id:n.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(t).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n,t;e=u.ivrCampaign.id,n=a.rows[0],t=n.id,r.campaign.removeLists({id:e,ids:t}).$promise.then(function(){return r.campaign.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"IvrCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!1,locals:{ivrCampaign:n,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.ivr_campaigns",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.ivr_campaigns",{})}},u.alert=l.info,u.gotoIvrCampaigns=function(){t.go("app.motiondialer.ivrCampaigns",{},{reload:"app.motiondialer.ivrCampaigns"})},u.saveIvrCampaign=function(){r.campaign.update({id:u.ivrCampaign.id},u.ivrCampaign).$promise.then(function(){l.success({title:"IvrCampaign updated!",msg:u.ivrCampaign.name?u.ivrCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})});u.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.trunks=n})}else u.trunks=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),t=null;if(u.ivrCampaign&&(t=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.projects,{id:t.id});a.canSelect=!1,n.push(a)}u.projects=n})}else{var t=[],a=null;u.ivrCampaign&&(a=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),t=null;if(u.ivrCampaign&&(t=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.interval,{id:t.id});a.canSelect=!1,n.push(a)}u.interval=n})}else{var t=[],a=null;u.ivrCampaign&&(a=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,t.push(u.interval[i]));u.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","ivrCampaign","userProfileSection"],angular.module("app.motiondialer").controller("IvrCampaignController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.ivrCampaigns=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="ivrCampaigns",f.listOrder="",f.listOrderAsc=null,f.selectedIvrCampaigns=[],f.query={fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,page:1},f.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.motiondialer.ivrCampaigns.edit",{id:e.id,ivrCampaign:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.listadddialog=function(e,n){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.blacklistadddialog=function(e,n){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("ivrCampaign")+"?").htmlContent("<b>"+(e.name||"ivrCampaign")+"</b> will be deleted.").ariaLabel("delete ivrCampaign").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.ivr_campaigns",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.ivr_campaigns",{})}},f.success=E,f.getIvrCampaigns=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.campaign.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="IvrCampaigns",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditIvrCampaign=function(e,n){i.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:n,ivrCampaigns:f.ivrCampaigns.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteIvrCampaign=y,f.exportSelectedIvrCampaigns=function(){var e=angular.copy(f.selectedIvrCampaigns);return f.selectedIvrCampaigns=[],e},f.deleteSelectedIvrCampaigns=function(e){var n=i.confirm().title("Are you sure want to delete the selected ivrCampaigns?").htmlContent("<b>"+f.selectedIvrCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete IvrCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedIvrCampaigns.forEach(function(e){y(e)}),f.selectedIvrCampaigns=[]})},f.deselectIvrCampaigns=function(){f.selectedIvrCampaigns=[]},f.selectAllIvrCampaigns=function(){f.selectedIvrCampaigns=f.ivrCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})});f.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),f.trunks=n})}else f.trunks=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.projects=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.projects=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.projects,{id:e.resourceId})}),a=null;a=[],f.ivrCampaigns.rows.forEach(function(e){var n=_.find(f.projects,{id:Number(e.SquareProjectId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),f.projects=t})}else{var t=[],a=[];f.ivrCampaigns.rows.forEach(function(e){var n=_.find(f.projects,{id:Number(e.SquareProjectId)});a.push(n)});for(var i=0;i<f.projects.length;i++){_.some(a,{id:f.projects[i].id})&&(f.projects[i].canSelect=!1,t.push(f.projects[i]))}f.projects=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.ivrCampaign&&(t=_.find(f.interval,{id:Number(f.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.ivrCampaign&&(a=_.find(f.interval,{id:Number(f.ivrCampaign.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.ivrCampaigns=e||{count:0,rows:[]}}function y(e){m.campaign.delete({id:e.id}).$promise.then(function(){_.remove(f.ivrCampaigns.rows,{id:e.id}),f.ivrCampaigns.count-=1,f.ivrCampaigns.rows.length||f.getIvrCampaigns(),p.success({title:_.startCase("IvrCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcampaign"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getIvrCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","ivrCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.motiondialer").controller("IvrCampaignsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_QUEUECAMPAIGN",g.queueCampaign=angular.copy(l),g.queueCampaigns=r,g.newQueueCampaign=!1,g.queueCampaign||(g.queueCampaign={dialActive:!0,type:"outbound",dialCheckDuplicateType:"always",dialCutDigit:0,autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no",dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3,dialMethod:"progressive",dialPowerLevel:1,dialPredictiveOptimization:"dropRate",dialPredictiveOptimizationPercentage:3,dialPredictiveInterval:10,dialLimitQueue:0,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialQueueOptions:"tTxX",dialQueueTimeout:3,strategy:"rrmemory",timeout:3,retry:3,weight:1,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialNoSuchNumberMaxRetry:3,dialNoSuchNumberRetryFrequency:150,dialDropMaxRetry:3,dialDropRetryFrequency:150,dialAbandonedMaxRetry:3,dialAbandonedRetryFrequency:150,dialMachineMaxRetry:3,dialMachineRetryFrequency:150,dialAgentRejectMaxRetry:3,dialAgentRejectRetryFrequency:150,dialPredictiveIntervalMaxThreshold:20,dialPredictiveIntervalMinThreshold:10},g.title="MOTIONDIALER.NEW_QUEUECAMPAIGN",g.newQueueCampaign=!0),g.addNewQueueCampaign=function(){g.errors=[],d.voiceQueue.save(g.queueCampaign).$promise.then(function(e){g.queueCampaigns.unshift(e.toJSON()),o.success({title:"QueueCampaign properly created",msg:g.queueCampaign.name?g.queueCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveQueueCampaign=function(){g.errors=[],d.voiceQueue.update({id:g.queueCampaign.id},g.queueCampaign).$promise.then(function(e){var n=_.find(g.queueCampaigns,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"QueueCampaign properly saved!",msg:g.queueCampaign.name?g.queueCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteQueueCampaign=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The queueCampaign will be deleted.").ariaLabel("Delete QueueCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceQueue.delete({id:g.queueCampaign.id}).$promise.then(function(){_.remove(g.queueCampaigns,{id:g.queueCampaign.id}),o.success({title:"QueueCampaign properly deleted!",msg:(g.queueCampaign.name||"queueCampaign")+" has been deleted!"}),v(g.queueCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),t=null;if(g.queueCampaign&&(t=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.trunks,{id:t.id});a.canSelect=!1,n.push(a)}g.trunks=n})}else{var t=[],a=null;g.queueCampaign&&(a=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,t.push(g.trunks[i]));g.trunks=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.queueCampaign&&(t=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.queueCampaign&&(a=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","queueCampaigns","queueCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditQueueCampaignDialogController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.voiceQueue.getAgents({id:c.queueCampaign.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.queueCampaign=n,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.voiceQueue.removeAgents({id:c.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else{for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.voiceQueue.addAgents({id:c.queueCampaign.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MOTIONDIALER.ALL_AGENTS"),labelSelected:s.instant("MOTIONDIALER.SELECTED_AGENTS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","queueCampaigns","realtime","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=n,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignblacklistaddController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newQueueCampaign=!0,r.queueCampaign=angular.copy(i),r.queueCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_QUEUECAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneQueueCampaign=function(){return e.voiceQueue.clone({id:i.id},r.queueCampaign).$promise.then(function(e){r.queueCampaigns.unshift(e.toJSON()),a.success({title:"QueueCampaign properly cloned",msg:r.queueCampaign.name?r.queueCampaign.name+" has been cloned!":""}),t.go("app.motiondialer.queueCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","queueCampaign","queueCampaigns","$translate"],angular.module("app.motiondialer").controller("QueueCampaigncloneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperBlacks=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperBlacks(m.query,u).$promise}function g(e){d.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperBlacks.rows,{id:e.id}),m.queueCampaignHopperBlacks.count-=1,m.queueCampaignHopperBlacks.rows.length||p(),l.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHopperBlacks={count:0,rows:[]},m.selectedQueueCampaignHopperBlacks=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperBlack #")+e.id||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperBlacks=p,m.createOrEditQueueCampaignHopperBlack=function(e,n){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperBlack:n,hopperBlacks:m.queueCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperBlacks=function(){var e=angular.copy(m.selectedQueueCampaignHopperBlacks);return m.selectedQueueCampaignHopperBlacks=[],e},m.deleteQueueCampaignHopperBlack=g,m.deleteSelectedQueueCampaignHopperBlacks=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+m.selectedQueueCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperBlacks.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperBlacks=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperFinals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperFinals(m.query,u).$promise}function g(e){d.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperFinals.rows,{id:e.id}),m.queueCampaignHopperFinals.count-=1,m.queueCampaignHopperFinals.rows.length||p(),l.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){d.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){l.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var n,t;"Not Found"===e.data?d.cmHopper.save((n=a,t={},t.phone=n.calleridnum,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=0,t.countcongestionretry=0,t.countnoanswerretry=0,t.countglobal=0,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=n.deleted?null:n.UserId,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.priority=n.recallme?3:2,t.recallme=!!n.recallme,t)).$promise.then(function(e){var n,t;l.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&d.cmHopperHistory.save(((t={}).calleridnum=(n=a).calleridnum,t.calleridname=n.calleridname,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=n.countbusyretry,t.countcongestionretry=n.countcongestionretry,t.countnoanswerretry=n.countnoanswerretry,t.countglobal=n.countglobal,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=c.getCurrentUser().id,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),t.edited=!0,t.state=25,t.statedesc="Restored",t.campaign=n.campaign,t.campaigntype=n.VoiceQueueId?"queue":"ivr",t))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):l.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.contacts={},m.queueCampaign={},m.queueCampaignHopperFinals={count:0,rows:[]},m.selectedQueueCampaignHopperFinals=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,secondDisposition,thirdDisposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperFinal #")+e.id||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperFinals=p,m.createOrEditQueueCampaignHopperFinal=function(e,n){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperFinal:n,hopperFinals:m.queueCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperFinals=function(){var e=angular.copy(m.selectedQueueCampaignHopperFinals);return m.selectedQueueCampaignHopperFinals=[],e},m.deleteQueueCampaignHopperFinal=g,m.deleteSelectedQueueCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+m.selectedQueueCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperFinals.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperFinals=[]})},m.moveQueueCampaignHopperFinal=v,m.moveContactsQueueCampaignHopperFinal=function(e){d.cmHopperFinal.moveContactsQueueCampaignHopperFinal({id:m.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?l.info({title:"Restored Contacts",msg:"0"}):l.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.countContactsQueueCampaignHopperFinal=function(e){d.cmHopperFinal.countContactsQueueCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(m.contacts,e[0])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.moveConfirm=function(e,n){var t=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.moveSelectedQueueCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperFinals.forEach(function(e){v(e)}),m.selectedQueueCampaignHopperFinals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperHistories=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperHistories(m.query,u).$promise}function g(e){d.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperHistories.rows,{id:e.id}),m.queueCampaignHopperHistories.count-=1,m.queueCampaignHopperHistories.rows.length||p(),l.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHopperHistories={count:0,rows:[]},m.selectedQueueCampaignHopperHistories=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperHistory #")+e.id||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperHistories=p,m.createOrEditQueueCampaignHopperHistory=function(e,n){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperHistory:n,hopperHistories:m.queueCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperHistories=function(){var e=angular.copy(m.selectedQueueCampaignHopperHistories);return m.selectedQueueCampaignHopperHistories=[],e},m.deleteQueueCampaignHopperHistory=g,m.deleteSelectedQueueCampaignHopperHistories=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+m.selectedQueueCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperHistories.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperHistories=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHoppers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHoppers(m.query,u).$promise}function g(e){d.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHoppers.rows,{id:e.id}),m.queueCampaignHoppers.count-=1,m.queueCampaignHoppers.rows.length||p(),l.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHoppers={count:0,rows:[]},m.selectedQueueCampaignHoppers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,scheduledat,priority,recallme,UserId",sort:"-updatedAt",limit:10,page:1},m.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopper #")+e.id||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHoppers=p,m.createOrEditQueueCampaignHopper=function(e,n){o.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopper:n,hoppers:m.queueCampaignHoppers.rows,license:null,setting:null,crudPermissions:m.crudPermissions,from:"QueueCampaign"}})},m.exportSelectedQueueCampaignHoppers=function(){var e=angular.copy(m.selectedQueueCampaignHoppers);return m.selectedQueueCampaignHoppers=[],e},m.deleteQueueCampaignHopper=g,m.deleteSelectedQueueCampaignHoppers=function(e){var n=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+m.selectedQueueCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHoppers.forEach(function(e){g(e)}),m.selectedQueueCampaignHoppers=[]})},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.agents,{id:e.resourceId})}),t=null;if(m.queueCampaign&&(t=_.find(m.agents,{id:Number(m.queueCampaign.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(m.agents,{id:t.id});a.canSelect=!1,n.push(a)}m.agents=n})}else{var t=[],a=null;m.queueCampaign&&(a=_.find(m.agents,{id:Number(m.queueCampaign.UserId)}));for(var i=0;i<m.agents.length;i++)a&&m.agents[i].id===a.id&&(m.agents[i].canSelect=!1,t.push(m.agents[i]));m.agents=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHoppersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}function h(){console.log("recalcTZTime hopper",g.hopper);var e=g.hopper.Queue.id;if(e)d.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(g.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),_.isNil(g.dateTime)||(g.hopper.scheduledat=moment(g.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss"))})});else{d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),_.isNil(g.dateTime)||(g.hopper.scheduledat=moment(g.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss"))})}});else{d.cmHopper.getTimezone({id:g.hopper.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.hopper.scheduledat=moment(g.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.recalcTZTime=h,e.$watch("vm.contact.dialTimezone",function(){h()}),g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),n.params.id&&(g.hopper.VoiceQueueId=n.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var t,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,g.hopper.dialTimezone=g.contact.dialTimezone,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme}).$promise.then(function(){d.cmContact.update({id:a.ContactId,dialTimezone:g.contact.dialTimezone})})})});var n=_.find(g.hoppers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.dateTime,g.contact,d.cmContact.get({id:g.hopper.Contact.id,fields:"dialTimezone"}).$promise.then(function(e){var n;g.contact=e,console.log("initTZTime hopper",g.hopper),_.isNil(g.hopper.Queue.id)?(n=g.hopper.Campaign.id)&&d.campaign.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;g.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;g.dateTime=moment(g.hopper.scheduledat).add(n-t,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.dateTime=moment(g.hopper.scheduledat).add(n-0,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):(n=g.hopper.Queue.id)&&d.voiceQueue.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;g.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;g.dateTime=moment(g.hopper.scheduledat).add(n-t,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.dateTime=moment(g.hopper.scheduledat).add(n-0,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})})}),g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})}),t=null;if(g.hopper&&(t=_.find(g.agents,{id:Number(g.hopper.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.agents,{id:t.id});a.canSelect=!1,n.push(a)}g.agents=n})}else{var t=[],a=null;g.hopper&&(a=_.find(g.agents,{id:Number(g.hopper.UserId)}));for(var i=0;i<g.agents.length;i++)a&&g.agents[i].id===a.id&&(g.agents[i].canSelect=!1,t.push(g.agents[i]));g.agents=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperVoiceQueueIdDialogController",e)}(),function(){"use strict";function e(t,a){var i=this;i.queueCampaign={},i.init=function(n){i.queueCampaign=n,t.cmHopper.get({limit:0,VoiceQueueId:n.id}).$promise.then(function(e){return i.total=e.count||0,t.cmHopper.get({limit:0,VoiceQueueId:n.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0,countnosuchnumberretry:0,countdropretry:0,countabandonedretry:0,countmachineretry:0,countagentrejectretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,t.cmHopperFinal.get({limit:0,VoiceQueueId:n.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("QueueCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=n,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignlistaddController",e)}(),function(){"use strict";function e(e,n,a,i,s,t,o,r){var l=this;function d(){n.hide()}function c(e,n){var t=n.id;o.enqueue(function(){return i.voiceQueue.removeLists({id:e,ids:t}).$promise.then(function(){return i.voiceQueue.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=t||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,n){return-1<n.indexOf(e)},l.toggle=function(e,n){var t=n.indexOf(e);-1<t?n.splice(t,1):n.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,n){for(var t=0;t<l.selected.length;t+=1)c(s.id,l.selected[t]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","queueCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("QueueCampaignresetlistController",e)}(),function(){"use strict";function e(e,i,a,s,n,t,o,r){var l=this;function d(){return i(function(t,n){return i(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:i(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),i(function(n,t){return s.voiceQueue.getTeams({id:l.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.queueCampaign=n,l.crudPermissions=r,l.penalty=0,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"penalty",labelAll:t.instant("MOTIONDIALER.ALL_TEAMS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_TEAMS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+l.penalty});var t=_.xorWith(l.startingSelectedItems,l.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):i(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceWith(l.selectedItems,l.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,i(function(e,n){_.isEmpty(t)?e():s.voiceQueue.removeTeams({id:l.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return a=n,i(function(e,n){if(!_.isEmpty(a)){var t=_.map(a,function(e){return{id:e.id,penalty:_.trim(e.penalty,"penalty ")}});return s.voiceQueue.addTeams({id:l.queueCampaign.id,teams:t}).$promise.then(function(){e()}).catch(function(e){n(e)})}e()});var a}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignteamaddController",e)}(),function(){"use strict";function e(t,e,i,s,a,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.queueCampaign=c||t.params.queueCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,n){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,n){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.teamadddialog=function(e,n){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.resetlistdialog=function(n,t){r.voiceQueue.getLists({id:n.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(t).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n,t;e=u.queueCampaign.id,n=a.rows[0],t=n.id,r.voiceQueue.removeLists({id:e,ids:t}).$promise.then(function(){return r.voiceQueue.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"QueueCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!1,locals:{queueCampaign:n,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.queues",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.queues",{})}},u.alert=l.info,u.gotoQueueCampaigns=function(){t.go("app.motiondialer.queueCampaigns",{},{reload:"app.motiondialer.queueCampaigns"})},u.saveQueueCampaign=function(){r.voiceQueue.update({id:u.queueCampaign.id},u.queueCampaign).$promise.then(function(){l.success({title:"QueueCampaign updated!",msg:u.queueCampaign.name?u.queueCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.musiconholds,{name:u.queueCampaign.musiconhold})),t&&!_.some(n,["id",t.id])){var a=_.find(u.musiconholds,{id:t.id});a.canSelect=!1,n.push(a)}u.musiconholds=n}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.trunks,{id:t.id});a.canSelect=!1,n.push(a)}u.trunks=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)}));for(var i=0;i<u.trunks.length;i++)a&&u.trunks[i].id===a.id&&(u.trunks[i].canSelect=!1,t.push(u.trunks[i]));u.trunks=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.projects,{name:u.queueCampaign.dialQueueProject})),t&&!_.some(n,["id",t.id])){var a=_.find(u.projects,{id:t.id});a.canSelect=!1,n.push(a)}u.projects=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.projects,{name:u.queueCampaign.dialQueueProject}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.interval,{id:t.id});a.canSelect=!1,n.push(a)}u.interval=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,t.push(u.interval[i]));u.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.pauses=n})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","queueCampaign","userProfileSection"],angular.module("app.motiondialer").controller("QueueCampaignController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.queueCampaigns=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="queueCampaigns",f.listOrder="",f.listOrderAsc=null,f.selectedQueueCampaigns=[],f.query={fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},f.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialMethod=_.keyBy([{option:"Progressive",value:"'progressive'"},{option:"PowerDialing",value:"'power'"},{option:"Predictive",value:"'predictive'"},{option:"Preview",value:"'preview'"},{option:"BookedProgressive",value:"'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialPredictiveOptimization=_.keyBy([{option:"AgentBusyFactor",value:"'agentBusyFactor'"},{option:"DropRate",value:"'dropRate'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraystrategy=_.keyBy([{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Round Robin",value:"'roundrobin'",ngIf:"vm.queueCampaign.dialMethod === 'booked'"},{option:"Least Recent",value:"'leastrecent'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Fewest Calls",value:"'fewestcalls'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Random",value:"'random'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Linear",value:"'linear'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Weight Random",value:"'wrandom'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.motiondialer.queueCampaigns.edit",{id:e.id,queueCampaign:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.listadddialog=function(e,n){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.blacklistadddialog=function(e,n){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.teamadddialog=function(e,n){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("queueCampaign")+"?").htmlContent("<b>"+(e.name||"queueCampaign")+"</b> will be deleted.").ariaLabel("delete queueCampaign").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.queues",{})}},f.success=E,f.getQueueCampaigns=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="QueueCampaigns",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditQueueCampaign=function(e,n){i.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n,queueCampaigns:f.queueCampaigns.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteQueueCampaign=y,f.exportSelectedQueueCampaigns=function(){var e=angular.copy(f.selectedQueueCampaigns);return f.selectedQueueCampaigns=[],e},f.deleteSelectedQueueCampaigns=function(e){var n=i.confirm().title("Are you sure want to delete the selected queueCampaigns?").htmlContent("<b>"+f.selectedQueueCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete QueueCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedQueueCampaigns.forEach(function(e){y(e)}),f.selectedQueueCampaigns=[]})},f.deselectQueueCampaigns=function(){f.selectedQueueCampaigns=[]},f.selectAllQueueCampaigns=function(){f.selectedQueueCampaigns=f.queueCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})}),a=null;a=[],f.queueCampaigns.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.trunks,{id:e.id});n.canSelect=!1,t.push(n)}}),f.trunks=t})}else{var t=[],a=[];f.queueCampaigns.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)});for(var i=0;i<f.trunks.length;i++){_.some(a,{id:f.trunks[i].id})&&(f.trunks[i].canSelect=!1,t.push(f.trunks[i]))}f.trunks=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.queueCampaign&&(t=_.find(f.interval,{id:Number(f.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.queueCampaign&&(a=_.find(f.interval,{id:Number(f.queueCampaign.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.queueCampaigns=e||{count:0,rows:[]}}function y(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.queueCampaigns.rows,{id:e.id}),f.queueCampaigns.count-=1,f.queueCampaigns.rows.length||f.getQueueCampaigns(),p.success({title:_.startCase("QueueCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getQueueCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","queueCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.motiondialer").controller("QueueCampaignsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){return[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",options:g.agents.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:g.queues.rows,ngValue:"name"}]}function h(){return g.refresh=!1,0===g.queues.count?f(null):(g.query.queue=1===g.queues.count?g.queues.rows[0].name:g.query.queue,void 0===g.query.queue&&(g.query.queue=_.map(g.queues.rows,"name")),_.isEmpty(g.query.queue)?f(null):(g.query.offset=(g.query.page-1)*g.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.bull.abandonedCalls:"+g.currentUser.id,JSON.stringify({query:_.omit(g.query,"queue")})),void(g.promise=o.voiceQueueReport.getVoiceQueuesReport(g.query,f).$promise)))}function f(e){g.abandonedCalls=e||{count:0,rows:[]},!1,g.refresh=!0}g.currentUser=d.getCurrentUser(),g.agents=u||[],g.dispositions=p.rows,g.abandonedCalls={count:0,rows:[]},g.showTooltip=!1,g.refresh=!0,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=d.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},g.getAbandonedCalls=h,g.refreshAbandonedCalls=function(){g.showTooltip=!1,h()},g.assignTo=function(e,n){e&&o.voiceQueueReport.update({id:e.id,lastAssignedTo:n?n.name:null,assigned:!!n}).$promise.catch(function(e){console.log(e)})},g.dispose=function(t){n.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(a.body),targetEvent:t,locals:{dispositions:g.dispositions,call:t}}).then(function(e){if(e){var n={id:t.id,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)})}})},g.onSaveVoiceQueueReport=function(e){e&&g.queuesMap&&"outbound"===queue.type&&g.queuesMap[e.queue]&&(g.showTooltip=!0)},g.onUpdateVoiceQueueReport=function(e){if(e){var n=_.findIndex(g.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(g.abandonedCalls.rows[n],e)}},c.onWithoutApply("voiceQueueReport:save",g.onSaveVoiceQueueReport),c.on("voiceQueueReport:update",g.onUpdateVoiceQueueReport),function(){var e=i.localStorage.getItem("motion2.realtime.abandoned.bull.abandonedCalls:"+g.currentUser.id);if(e)(e=JSON.parse(e))&&e.query&&(g.query=_.merge(e.query,_.omit(g.query,["sort","limit","page"])),g.query=_.omit(g.query,"filter"));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};g.query.createdAt=n}d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()}):o.userProfile.getResources({id:g.currentUser.userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()})}();var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?t(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","agents","dispositions"],angular.module("app.motiondialer").controller("AbandonedCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d,c,m){var u=this,p=["name","active","limitCalls","message","originated","IntervalId","SquareProjectId","Trunk","TrunkId","ivrAnswerCallsDay","dialQueueProject","ivrTotalCallsDays","description"];function g(){_.forIn(u.campaigns,function(e,n){u.rpcCampaigns[n]&&_.merge(e,_.pick(u.rpcCampaigns[n],p))})}u.currentUser=m.getCurrentUser(),u.count=o.count,u.campaigns=o?_.keyBy(o.rows?o.rows:[],"id"):{},u.rpcCampaigns=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={sort:"-updatedAt",limit:10,page:1},u.success=f,u.getCampaigns=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=r.campaign.get(u.query,f).$promise:(u.query.id=u.userProfile.id,u.query.section="IvrCampaigns",u.promise=r.userProfile.getResources(u.query,f).$promise)},u.onSave=function(e){u.campaigns[e.id]&&(_.merge(u.campaigns[e.id],_.pick(e,p)),_.merge(u.rpcCampaigns[e.id],_.pick(e,p)))},u.$onInit=g,u.createOrEditIvrCampaign=function(e,n){a.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:n,ivrCampaigns:_.values(u.campaigns),license:null,setting:null,crudPermissions:u.crudPermissions}})},l.onWithoutApply("campaign:save",u.onSave),u.interval=n(function(){},999);var v=!0,h=1;function f(e){u.count=e.count,u.campaigns=e?_.keyBy(e.rows?e.rows:[],"id"):{},g()}e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=h),u.getCampaigns())}),e.$on("$destroy",function(){l.removeAllListeners("campaign:save"),u.interval&&n.cancel(u.interval)})}e.$inject=["$scope","$timeout","$mdDialog","$document","$interval","rpcCampaigns","campaigns","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("IvrCampaignsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,o,t,i,s,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.queues=t?_.keyBy(t.rows?t.rows:[],"name"):{},p.rpcVoiceQueuesChannelsTmp=i?_.keyBy(i.rows?_.filter(i.rows,{type:"outbound"}):[],"uniqueid"):{},p.rpcVoiceQueuesChannels={},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.queryChannels={limit:10,page:1},p.getAvailableAgents=function(){p.availableAgents=null,s.rpc.getAgents().$promise.then(function(e){for(var n=[],t=e?e.rows:[],a=_.filter(t,{online:!0,voicePause:!1,voiceStatus:"idle"}),i=0;i<a.length;i++){var s=_.find(o.rows,["id",a[i].id]);s&&n.push(s)}p.availableAgents=n}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.getSize=function(e){return _.size(e)},p.$onInit=function(){_.forIn(p.rpcVoiceQueuesChannelsTmp,function(e,n){_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[n]=e)})},p.onSave=function(e){"outbound"===e.type&&_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[e.uniqueid]=e)},p.onRemove=function(e){p.rpcVoiceQueuesChannels[e.uniqueid]&&delete p.rpcVoiceQueuesChannels[e.uniqueid]},p.hangup=function(n){return s.rpc.getVoiceQueuesChannelHangup({uniqueid:n}).$promise.then(function(e){d.success({title:"Channel "+n+" properly hangup!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToAgent=function(n,e,t){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e,context:t}).$promise.then(function(e){d.success({title:"Channel "+n+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToNumber=function(e,n){var t=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(t).then(function(e){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e}).$promise}).then(function(e){d.success({title:"Channel "+n+" properly redirect!",msg:e.message||""})}).catch(function(e){e&&d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},r.on("voice_queue_channel:save",p.onSave),r.on("voice_queue_channel:remove",p.onRemove),e.$on("$destroy",function(){r.removeAllListeners("voice_queue_channel:save"),r.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","queues","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["total","answered","sumHoldTime","sumDuration","sumBillable","outboundNoAnswerCallsDay","outboundBusyCallsDay","outboundCongestionCallsDay","outboundNoSuchCallsDay","outboundUnknownCallsDay","outboundDropCallsDayTimeout","outboundDropCallsDayCallersExit","outboundBlacklistCallsDay","outboundOriginateFailureCallsDay","outboundAnswerAgiCallsDay","outboundReCallsDay","outboundRejectCallsDay"];function u(){_.forIn(c.queues,function(e,n){c.rpcQueues[n]&&_.merge(e,_.pick(c.rpcQueues[n],m))})}c.count=a.count,c.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="QueueCampaigns",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){c.queues[e.id]&&_.merge(c.queues[e.id],_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=n(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&n.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueParamsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"QueueCampaigns":void 0,channel:"voice",type:"outbound",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("VOICE.VOICEQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n,queueCampaigns:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n,queueCampaigns:u.queues.rows,realtime:!0,crudPermissions:u.crudPermissions}})},u.showPredictiveQueueCampaignInfo=function(e,n){t.show({controller:"PredictiveQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queues/predictive/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n}})},r.onWithoutApply("voice_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&m.updateVoiceQueue(e,n)}),r.on("userVoiceQueueRt:save",function(e){var n=_.find(u.queues.rows,["id",e.MotionDialerQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("user:agentconnect",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);if(n){if(!t.agentconnected)return;t.queue?n.talking=!0:n.busy=!0,m.updateBusyCounter(e)}})}),r.on("user:agentcomplete",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&(n.talking?n.talking=!1:n.busy&&(n.busy=!1),m.updateBusyCounter(e))})}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"voice")})}),e.$on("$destroy",function(){r.removeAllListeners("voice_queue:save"),r.removeAllListeners("userVoiceQueueRt:save"),r.removeAllListeners("user:agentconnect"),r.removeAllListeners("user:agentcomplete"),r.removeAllListeners("user:update"),p&&n.cancel(p)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.motiondialer").controller("QueuesMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t){this.queueCampaign=t,this.addMinutes=function(e,n){return moment(e).add("m",n).format("HH:mm:ss")},this.setFormatTime=function(e){return moment(e).format("HH:mm:ss")},this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$interval","queueCampaign"],angular.module("app.motiondialer").controller("PredictiveQueueCampaignDialogController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.motiondialer.realtime.agents":this.selectedTab=0;break;case"app.motiondialer.realtime.queues":this.selectedTab=1;break;case"app.motiondialer.realtime.queue_calls":this.selectedTab=2;break;case"app.motiondialer.realtime.abandonedcalls":this.selectedTab=3;break;case"app.motiondialer.realtime.queue_params":this.selectedTab=4;break;case"app.motiondialer.realtime.ivr_campaigns":this.selectedTab=5;break;default:this.selectedTab=0,t.go("app.motiondialer.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.motiondialer.realtime.agents");break;case 1:t.go("app.motiondialer.realtime.queues");break;case 2:t.go("app.motiondialer.realtime.queue_calls");break;case 3:t.go("app.motiondialer.realtime.abandonedcalls");break;case 4:t.go("app.motiondialer.realtime.queue_params");break;case 5:t.go("app.motiondialer.realtime.ivr_campaigns");break;default:t.go("app.motiondialer.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.motiondialer").controller("MotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT",g.openchannelAccount=angular.copy(l),g.openchannelAccounts=r,g.newOpenchannelAccount=!1,g.openchannelAccount||(g.openchannelAccount={waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="OPENCHANNEL.NEW_OPENCHANNELACCOUNT",g.newOpenchannelAccount=!0),n.params.id&&(g.openchannelAccount.OpenchannelAccountId=n.params.id),g.addNewOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.save(g.openchannelAccount).$promise.then(function(e){g.openchannelAccounts.unshift(e.toJSON()),o.success({title:"OpenchannelAccount properly created",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.update({id:g.openchannelAccount.id},g.openchannelAccount).$promise.then(function(e){var n=_.find(g.openchannelAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelAccount properly saved!",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelAccount will be deleted.").ariaLabel("Delete OpenchannelAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.openchannelAccount.delete({id:g.openchannelAccount.id}).$promise.then(function(){_.remove(g.openchannelAccounts,{id:g.openchannelAccount.id}),o.success({title:"OpenchannelAccount properly deleted!",msg:(g.openchannelAccount.name||"openchannelAccount")+" has been deleted!"}),v(g.openchannelAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.openchannelAccount&&(t=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.openchannelAccount&&(a=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelAccounts","openchannelAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.openchannelAccountApps.rows.length){var t=r.openchannelAccountApps.rows[n]?r.openchannelAccountApps.rows[n]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccountApp:t,openchannelAccount:r.openchannelAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.openchannelAccountApps.rows[n]=e:r.openchannelAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.openchannelAccountApps.rows.length;t++,0){var a=r.openchannelAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.openchannelAccount.context,a.exten=r.openchannelAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.openchannelAccount.addApplications({id:r.openchannelAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.openchannelAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.openchannelAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.openchannelAccount={},r.openchannelAccountApps={count:0,rows:[]},r.selectedOpenchannelAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]},{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"OpenchannelQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"openchannelQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:801}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.openchannelAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getOpenchannelAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.openchannelAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getOpenchannelAccountApps=function(){r.promise=o.openchannelAccount.getApplications(r.query,t).$promise},r.editOpenchannelAccountApp=n,r.editInterval=function(e,n){if(r.openchannelAccountApps.rows.length){var t=r.openchannelAccountApps.rows[n]?r.openchannelAccountApps.rows[n]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteOpenchannelAccountApp=function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedOpenchannelAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedOpenchannelAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedOpenchannelAccountApps.forEach(function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id})}),r.selectedOpenchannelAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelAccount.getAgents({id:c.openchannelAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserOpenchannelAccount?"penalty "+e.UserOpenchannelAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelAccount.removeAgents({id:c.openchannelAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelAccount.addAgents({id:c.openchannelAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelAccount","openchannelAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditOpenchannelAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("openChannel")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:801}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"openchannelAccount",action:"getDispositions",field:"name",params:{id:m.openchannelAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.openchannelAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.openchannelAccountInteractions.rows.length;n+=1){var t=m.openchannelAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.openchannelInteraction.get(m.query,p).$promise}function v(e){d.openchannelInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.openchannelAccountInteractions.rows,{id:e.id}),m.openchannelAccountInteractions.count-=1,m.openchannelAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.from?e.contactName=e.from:e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("OPENCHANNEL.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.openchannelAccount={},m.openchannelAccountInteractions={count:0,rows:[]},m.selectedOpenchannelAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.openchannelAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.OpenchannelAccountId=m.openchannelAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.openchannelInteractionDownload=function(s,e,n){return d.openchannelInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="openchannel-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getOpenchannelAccountInteractions=g,m.createOrEditOpenchannelAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:m.openchannelAccount,interaction:n,interactions:m.openchannelAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spyopenchannelInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"openchannel",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"openchannel.openchannelAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||OpenchannelAccountId:=$eq["+m.openchannelAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedOpenchannelAccountInteractions=function(){var e=angular.copy(m.selectedOpenchannelAccountInteractions);return m.selectedOpenchannelAccountInteractions=[],e},m.deleteOpenchannelAccountInteraction=v,m.deleteSelectedOpenchannelAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedOpenchannelAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedOpenchannelAccountInteractions.forEach(function(e){v(e)}),m.selectedOpenchannelAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.openchannelAccountOpenchannelCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.openchannelAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.openchannelAccountOpenchannelCannedAnswers.rows,{id:e.id}),m.openchannelAccountOpenchannelCannedAnswers.count-=1,m.openchannelAccountOpenchannelCannedAnswers.rows.length||p(),l.success({title:"OpenchannelCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.openchannelAccount={},m.openchannelAccountOpenchannelCannedAnswers={count:0,rows:[]},m.selectedOpenchannelAccountOpenchannelCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.openchannelAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.OpenchannelAccountId=m.openchannelAccount.id,m.query.id=m.openchannelAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the openchannelCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("openchannelCannedAnswer #")+e.id||"openchannelCannedAnswer")+"</b> will be deleted.").ariaLabel("delete openchannelCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getOpenchannelAccountOpenchannelCannedAnswers=p,m.createOrEditOpenchannelAccountOpenchannelCannedAnswer=function(e,n){o.show({controller:"CreateOrEditOpenchannelCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:m.openchannelAccount,openchannelCannedAnswer:n,openchannelCannedAnswers:m.openchannelAccountOpenchannelCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedOpenchannelAccountOpenchannelCannedAnswers=function(){var e=angular.copy(m.selectedOpenchannelAccountOpenchannelCannedAnswers);return m.selectedOpenchannelAccountOpenchannelCannedAnswers=[],e},m.deleteOpenchannelAccountOpenchannelCannedAnswer=g,m.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected openchannelCannedAnswers?").htmlContent("<b>"+m.selectedOpenchannelAccountOpenchannelCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete openchannelCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedOpenchannelAccountOpenchannelCannedAnswers.forEach(function(e){g(e)}),m.selectedOpenchannelAccountOpenchannelCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER",g.openchannelCannedAnswer=angular.copy(l),g.openchannelCannedAnswers=r,g.newOpenchannelCannedAnswer=!1,g.openchannelCannedAnswer||(g.openchannelCannedAnswer={},g.title="OPENCHANNEL.NEW_OPENCHANNELCANNEDANSWER",g.newOpenchannelCannedAnswer=!0),n.params.id&&(g.openchannelCannedAnswer.OpenchannelAccountId=n.params.id),g.addNewOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.openchannelCannedAnswer).$promise.then(function(e){g.openchannelCannedAnswers.unshift(e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly created",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.openchannelCannedAnswer.id},g.openchannelCannedAnswer).$promise.then(function(e){var n=_.find(g.openchannelCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly saved!",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelCannedAnswer will be deleted.").ariaLabel("Delete OpenchannelCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.openchannelCannedAnswer.id}).$promise.then(function(){_.remove(g.openchannelCannedAnswers,{id:g.openchannelCannedAnswer.id}),o.success({title:"OpenchannelCannedAnswer properly deleted!",msg:(g.openchannelCannedAnswer.name||"openchannelCannedAnswer")+" has been deleted!"}),v(g.openchannelCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelCannedAnswers","openchannelCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.openchannelAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.openchannelAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.OpenchannelAccountId=m.openchannelAccount.id,m.query.id=m.openchannelAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.openchannelAccount.id,field:"OpenchannelAccountId",route:"openchannelAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.openchannelAccount=c||e.params.openchannelAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:p.openchannelAccounts?p.openchannelAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoOpenchannelAccounts=function(){e.go("app.openchannel.openchannelAccounts",{},{reload:"app.openchannel.openchannelAccounts"})},p.saveOpenchannelAccount=function(){r.openchannelAccount.update({id:p.openchannelAccount.id},p.openchannelAccount).$promise.then(function(){l.success({title:"OpenchannelAccount updated!",msg:p.openchannelAccount.name?p.openchannelAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.openchannelAccount&&(t=_.find(p.lists,{id:Number(p.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.openchannelAccount&&(a=_.find(p.lists,{id:Number(p.openchannelAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.cmContact.describe({id:p.openchannelAccount.ListId}).$promise.then(function(e){p.fields=[];e=_.values(e.toJSON());for(var n=["id","createdAt","updatedAt","deletedAt","scheduledat","ListId","CompanyId"],t=0;t<e.length;t++)_.includes(n,e[t].columnName)||p.fields.push(e[t])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelAccount","userProfile","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.openchannelAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="openchannelAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedOpenchannelAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.openchannel.openchannelAccounts.edit",{id:e.id,openchannelAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.openchannel.openchannelAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:f.openchannelAccounts?f.openchannelAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelAccount")+"?").htmlContent("<b>"+(e.name||"openchannelAccount")+"</b> will be deleted.").ariaLabel("delete openchannelAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getOpenchannelAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.openchannelAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="OpenchannelAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOpenchannelAccount=function(e,n){i.show({controller:"CreateOrEditOpenchannelAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:n,openchannelAccounts:f.openchannelAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOpenchannelAccount=y,f.exportSelectedOpenchannelAccounts=function(){var e=angular.copy(f.selectedOpenchannelAccounts);return f.selectedOpenchannelAccounts=[],e},f.deleteSelectedOpenchannelAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected openchannelAccounts?").htmlContent("<b>"+f.selectedOpenchannelAccounts.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedOpenchannelAccounts.forEach(function(e){y(e)}),f.selectedOpenchannelAccounts=[]})},f.deselectOpenchannelAccounts=function(){f.selectedOpenchannelAccounts=[]},f.selectAllOpenchannelAccounts=function(){f.selectedOpenchannelAccounts=f.openchannelAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.openchannelAccount&&(t=_.find(f.lists,{id:Number(f.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.openchannelAccount&&(a=_.find(f.lists,{id:Number(f.openchannelAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.openchannelAccounts=e||{count:0,rows:[]}}function y(e){m.openchannelAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.openchannelAccounts.rows,{id:e.id}),f.openchannelAccounts.count-=1,f.openchannelAccounts.rows.length||f.getOpenchannelAccounts(),p.success({title:_.startCase("OpenchannelAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getOpenchannelAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.openchannel").controller("OpenchannelAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELQUEUE",g.openchannelQueue=angular.copy(l),g.openchannelQueues=r,g.newOpenchannelQueue=!1,g.openchannelQueue||(g.openchannelQueue={strategy:"beepall",timeout:10},g.title="OPENCHANNEL.NEW_OPENCHANNELQUEUE",g.newOpenchannelQueue=!0),g.addNewOpenchannelQueue=function(){g.errors=[],d.openchannelQueue.save(g.openchannelQueue).$promise.then(function(e){g.openchannelQueues.unshift(e.toJSON()),o.success({title:"OpenchannelQueue properly created",msg:g.openchannelQueue.name?g.openchannelQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelQueue=function(){g.errors=[],d.openchannelQueue.update({id:g.openchannelQueue.id},g.openchannelQueue).$promise.then(function(e){var n=_.find(g.openchannelQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelQueue properly saved!",msg:g.openchannelQueue.name?g.openchannelQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelQueue will be deleted.").ariaLabel("Delete OpenchannelQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.openchannelQueue.delete({id:g.openchannelQueue.id}).$promise.then(function(){_.remove(g.openchannelQueues,{id:g.openchannelQueue.id}),o.success({title:"OpenchannelQueue properly deleted!",msg:(g.openchannelQueue.name||"openchannelQueue")+" has been deleted!"}),v(g.openchannelQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelQueues","openchannelQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelQueue.getAgents({id:c.openchannelQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.removeAgents({id:c.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.addAgents({id:c.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","openchannelQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelQueue.getTeams({id:l.openchannelQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.openchannelQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("OPENCHANNEL.ALL_TEAMS"),labelSelected:t.instant("OPENCHANNEL.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.removeTeams({id:l.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.addTeams({id:l.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.openchannelQueue=c||e.params.openchannelQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoOpenchannelQueues=function(){e.go("app.openchannel.openchannelQueues",{},{reload:"app.openchannel.openchannelQueues"})},u.saveOpenchannelQueue=function(){r.openchannelQueue.update({id:u.openchannelQueue.id},u.openchannelQueue).$promise.then(function(){l.success({title:"OpenchannelQueue updated!",msg:u.openchannelQueue.name?u.openchannelQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelQueue","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.openchannelQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="openchannelQueues",f.listOrder="",f.listOrderAsc=null,f.selectedOpenchannelQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.openchannel.openchannelQueues.edit",{id:e.id,openchannelQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:f.openchannelQueues?f.openchannelQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:f.openchannelQueues?f.openchannelQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelQueue")+"?").htmlContent("<b>"+(e.name||"openchannelQueue")+"</b> will be deleted.").ariaLabel("delete openchannelQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:810}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.openchannel.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.openchannel.realtime.queues",{})}},f.success=E,f.getOpenchannelQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.openchannelQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="OpenchannelQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOpenchannelQueue=function(e,n){i.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:n,openchannelQueues:f.openchannelQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOpenchannelQueue=y,f.exportSelectedOpenchannelQueues=function(){var e=angular.copy(f.selectedOpenchannelQueues);return f.selectedOpenchannelQueues=[],e},f.deleteSelectedOpenchannelQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected openchannelQueues?").htmlContent("<b>"+f.selectedOpenchannelQueues.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedOpenchannelQueues.forEach(function(e){y(e)}),f.selectedOpenchannelQueues=[]})},f.deselectOpenchannelQueues=function(){f.selectedOpenchannelQueues=[]},f.selectAllOpenchannelQueues=function(){f.selectedOpenchannelQueues=f.openchannelQueues.rows};var b=!0,A=1;function E(e){f.openchannelQueues=e||{count:0,rows:[]}}function y(e){m.openchannelQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.openchannelQueues.rows,{id:e.id}),f.openchannelQueues.count-=1,f.openchannelQueues.rows.length||f.getOpenchannelQueues(),p.success({title:_.startCase("OpenchannelQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getOpenchannelQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.openchannel").controller("OpenchannelQueuesController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"OpenchannelQueues":void 0,channel:"openchannel",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("OPENCHANNEL.OPENCHANNELQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:n,openchannelQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:n,openchannelQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("openchannel_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userOpenchannelQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.OpenchannelQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userOpenchannelQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.OpenchannelQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"openchannel")})}),e.$on("$destroy",function(){r.removeAllListeners("openchannel_queue:save"),r.removeAllListeners("userOpenchannelQueue:remove"),r.removeAllListeners("userOpenchannelQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.openchannel").controller("QueuesOpenchannelRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.openchannel.realtime.agents":this.selectedTab=0;break;case"app.openchannel.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.openchannel.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.openchannel.realtime.agents");break;case 1:t.go("app.openchannel.realtime.queues");break;default:t.go("app.openchannel.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.openchannel").controller("OpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.currentUser=s.getCurrentUser(),o.plugin={},o.getTrustedURL=function(){return t.trustAsResourceUrl(o.plugin.adminUrl)},a.plugin.get({id:e.params.id}).$promise.then(function(e){if(e)return o.plugin=e,a.plugin.get({id:o.plugin.id}).$promise}).catch(function(e){o.plugin=void 0})}e.$inject=["$state","$scope","$sce","api","socket","Auth"],angular.module("app.plugins.plugin").controller("PluginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this,h=t(function(){},999);function f(){v.agents.rows.forEach(function(e){g.setAgentStatusDisplayValue(e)})}function b(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.realtime.getAgents(v.query).$promise.then(function(e){v.agents=e,f()}).catch(function(e){c.error({title:s.instant("VOICE.AGENTS"),msg:e.status?JSON.stringify(e.data):e.toString()})})}function A(e){_.remove(v.agents.rows,["id",e.id])}v.currentUser=u.getCurrentUser(),v.channel=n.params.channel,v.queueType=n.params.direction,v.agents=o,v.pauses=r||{count:0,rows:[]},v.license=p,v.userProfileSection=m&&1==m.count?m.rows[0]:null,v.crudPermissions=u.parseCrudPermissions(v.userProfileSection?v.userProfileSection.crudPermissions:null),v.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},v.getAgents=b,v.logout=function(e){return l.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){A(e),c.success({title:"Agent logout",msg:e.fullname+"  properly logout"})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.LOGOUT"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.addQueue=function(e,n){a.show({controller:"AgentQueueAddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,channel:v.channel,direction:v.queueType,crudPermissions:v.crudPermissions}})},v.pause=function(e,n){return l.user.pause({id:e.id,type:n}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.PAUSE"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.unpause=function(e){return l.user.unpause({id:e.id}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.UNPAUSE"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.manageScreenRecording=function(e,n){return l.user.update({id:e.id},{screenrecording:n}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.SCREENRECORDING"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.on("user:save",function(e){var n=_.find(v.agents.rows,["id",e.id]);n&&(_.merge(n,e),n.globalStatus=g.getAgentStatus(n),g.setAgentStatusDisplayValue(n))}),d.on("user:update",function(e){var n=_.find(v.agents.rows,["id",e.id]);if(n){if(!1===e.online)return A(n);_.merge(n,e),n.globalStatus=g.getAgentStatus(n),g.setAgentStatusDisplayValue(n)}else e.online&&b()}),d.on("user:agentconnect",function(e){var n=_.find(v.agents.rows,["id",e.id]);if(n){if(!e.agentconnected)return;_.merge(n,_.pick(e,["queue","destconnectedlinenum","routealias"]))}}),d.on("user:agentcomplete",function(e){if("ATTENDED"===e.transfer)return;var n=_.find(v.agents.rows,["id",e.id]);n&&(delete n.queue,delete n.destconnectedlinenum,delete n.routealias)}),f(),e.$on("$destroy",function(){d.removeAllListeners("user:save"),d.removeAllListeners("user:update"),d.removeAllListeners("user:agentconnect"),d.removeAllListeners("user:agentcomplete"),h&&t.cancel(h)})}e.$inject=["$scope","$state","$interval","$mdDialog","$document","$translate","agents","pauses","api","socket","toasty","userProfileSection","Auth","license","realtimeManager"],angular.module("app.realtime").controller("AgentsRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u){var p=this;function g(e){p.cloudProviders=e||{count:0,rows:[]}}function v(e){r.cloudProvider.delete({id:e.id}).$promise.then(function(){_.remove(p.cloudProviders.rows,{id:e.id}),p.cloudProviders.count-=1,p.cloudProviders.rows.length||p.getAiTools(),d.success({title:s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcloudProvider"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcloudProvider",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}p.license=m,p.setting=u,p.currentUser=c.getCurrentUser(),p.cloudProviders=o||{count:0,rows:[]},p.selectedAiTools=[],p.query={fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data5,data6",sort:"-updatedAt",limit:10,page:1},p.services={AmazonAWS:"AmazonAWS",MicrosoftAzure:"Microsoft Azure"},p.editdialog=function(e,n){a.show({controller:"CreateOrEditCloudProviderDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/create/dialog.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{cloudProvider:e,cloudProviders:p.cloudProviders.rows,license:p.license,setting:null,crudPermissions:p.crudPermissions}})},p.deleteconfirm=function(e,n){var t=a.confirm().title(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_TITLE")).content(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_MESSAGE",{name:e.name})).ariaLabel("delete cloud provider").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){v(e)})},p.success=g,p.getAiTools=function(){p.query.offset=(p.query.page-1)*p.query.limit,c.hasRole("admin")?p.promise=r.cloudProvider.get(p.query,g).$promise:(p.query.id=p.userProfile.id,p.query.section="AiTools",p.promise=r.userProfile.getResources(p.query,g).$promise)},p.createOrEditCloudProvider=function(e,n){a.show({controller:"CreateOrEditCloudProviderDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{cloudProvider:n,cloudProviders:p.cloudProviders.rows,license:p.license,setting:p.setting,crudPermissions:p.crudPermissions}})},p.deleteCloudProvider=v,p.exportSelectedAiTools=function(){var e=angular.copy(p.selectedAiTools);return p.selectedAiTools=[],e},p.deleteSelectedAiTools=function(e){var n=a.confirm().title(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETE_TITLE")).content(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETE_MESSAGE",{total:p.selectedAiTools.length})).ariaLabel("delete CloudProviders").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){p.selectedAiTools.forEach(function(e){v(e)}),p.selectedAiTools=[],d.success({title:s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETED_SUCCESS_TITLE")})})},p.deselectAiTools=function(){p.selectedAiTools=[]},p.selectAllAiTools=function(){p.selectedAiTools=p.cloudProviders.rows},p.authenticateToMicrosoftIdentityPlatform=function(e){return r.cloudProvider.oauth2MicrosoftAuthorize({id:e.id}).$promise.then(function(e){p.loginWindow=n.open(e.url,"_blank","width=800,height=600")})},p.updateClientSecret=function(n,e){return a.show({controller:"UpdateClientSecretController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/updateSecret/updateSecret.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{cloudProvider:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,service,data3",id:n.id})}]}})},l.on("microsoftAuthorization:success",function(e){p.currentUser.id===e.id&&(p.loginWindow.close(),d.success({msg:s.instant("SETTINGS.NOTIFICATIONS.MICROSOFT_AUTHENTICATION_SUCCESS")}))}),l.on("microsoftAuthorization:error",function(e){p.currentUser.id===e.id&&(p.loginWindow.close(),d.error({msg:s.instant("SETTINGS.NOTIFICATIONS.MICROSOFT_AUTHENTICATION_FAIL")}))}),e.$on("$destroy",function(){l.removeAllListeners("microsoftAuthorization:success"),l.removeAllListeners("microsoftAuthorization:error")});var h=!0,f=1;e.$watch("vm.query.filter",function(e,n){h?i(function(){h=!1}):(n||(f=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=f),p.getAiTools())})}e.$inject=["$scope","$window","$mdDialog","$document","$timeout","$translate","cloudProviders","api","socket","toasty","Auth","license","setting"],angular.module("app.settings").controller("CloudProvidersController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r){var l=this;function d(e){t.hide(e)}l.currentUser=o.getCurrentUser(),l.license=r,l.cloudProvider=angular.copy(n),l.cloudProviders=e,l.newCloudProvider=!1,l.errors=[],l.cloudProvider||(l.cloudProvider={},l.newCloudProvider=!0),l.addNewCloudProvider=function(){l.errors=[],s.cloudProvider.save(l.cloudProvider).$promise.then(function(e){l.cloudProviders.unshift(e.toJSON()),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_CREATED_SUCCESS_TITLE")}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.saveCloudProvider=function(){l.errors=[],s.cloudProvider.update({id:l.cloudProvider.id},l.cloudProvider).$promise.then(function(e){var n=_.find(l.cloudProviders,{id:e.id});n&&_.merge(n,e.toJSON()),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_SAVED_SUCCESS_TITLE")}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.deleteCloudProvider=function(e){l.errors=[];var n=t.confirm().title(a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_TITLE")).content(a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_MESSAGE",{name:l.cloudProvider.name})).ariaLabel("Delete Cloud Provider").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){s.cloudProvider.delete({id:l.cloudProvider.id}).$promise.then(function(){_.remove(l.cloudProviders,{id:l.cloudProvider.id}),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETED_SUCCESS_TITLE")}),d(l.cloudProvider)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},l.closeDialog=d}e.$inject=["$mdDialog","$translate","toasty","cloudProviders","cloudProvider","api","Auth","license"],angular.module("app.settings").controller("CreateOrEditCloudProviderDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;function o(){e.hide()}s.cloudProvider=i,s.errors=[],s.saveSecret=function(){return s.errors=[],a.cloudProvider.update({id:i.id},{data3:s.newSecret}).$promise.then(function(){t.success({title:n.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_SECRET_UPDATE_SUCCESS_TITLE")}),o()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.update"}];for(var n=0;n<e.data.errors.length;n+=1)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},s.closeDialog=o}e.$inject=["$mdDialog","$translate","toasty","api","cloudProvider"],angular.module("app.settings").controller("UpdateClientSecretController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_CUSTOMIZATION",g.customization=angular.copy(l),g.customizations=r,g.newCustomization=!1,g.customization||(g.customization={},g.title="SETTINGS.NEW_CUSTOMIZATION",g.newCustomization=!0),g.addNewCustomization=function(){g.errors=[],d.setting.save(g.customization).$promise.then(function(e){g.customizations.unshift(e.toJSON()),o.success({title:"Customization properly created",msg:g.customization.name?g.customization.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomization=function(){g.errors=[],d.setting.update({id:g.customization.id},g.customization).$promise.then(function(e){var n=_.find(g.customizations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Customization properly saved!",msg:g.customization.name?g.customization.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomization=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The customization will be deleted.").ariaLabel("Delete Customization").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.setting.delete({id:g.customization.id}).$promise.then(function(){_.remove(g.customizations,{id:g.customization.id}),o.success({title:"Customization properly deleted!",msg:(g.customization.name||"customization")+" has been deleted!"}),v(g.customization)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customizations","customization","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditCustomizationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.customizations=e,s.customization={},s.customizations&&s.customizations.rows&&s.customizations.rows.length&&(s.customization=s.customizations.rows[0]),s.saveCustomization=function(){s.customization.id?n.setting.update({id:s.customization.id},s.customization).$promise.then(function(){t.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):n.setting.save(s.customization).$promise.then(function(e){_.merge(s.customization,e),t.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["customizations","api","toasty","license","Auth"],angular.module("app.settings").controller("CustomizationsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg","ico"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/favicon".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationfaviconController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogoController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo_login".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogologinController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/preferred".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationpreferredController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_GENERAL",g.general=angular.copy(l),g.generals=r,g.newGeneral=!1,g.general||(g.general={min_internal:1e3,chatTimeout:30,phoneBarAutoUpdater:!0,phoneBarAutoUpdaterUrl:"https://www.xcally.com/bar/phonebar/autoupdater.xml",splitSizeCsv:5e3,splitSizePdf:1e3,splitSizeXlsx:5e3,messagesAlignment:"alternate",phoneBarRememberMeEnabled:!0,allowedLoginAttempts:5,blockDuration:10,loginMailFrequency:10,enforcePasswordHistory:!0,passwordHistoryLimit:3},g.title="SETTINGS.NEW_GENERAL",g.newGeneral=!0),g.addNewGeneral=function(){g.errors=[],d.setting.save(g.general).$promise.then(function(e){g.generals.unshift(e.toJSON()),o.success({title:"General properly created",msg:g.general.name?g.general.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGeneral=function(){g.errors=[],d.setting.update({id:g.general.id},g.general).$promise.then(function(e){var n=_.find(g.generals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"General properly saved!",msg:g.general.name?g.general.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGeneral=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The general will be deleted.").ariaLabel("Delete General").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.setting.delete({id:g.general.id}).$promise.then(function(){_.remove(g.generals,{id:g.general.id}),o.success({title:"General properly deleted!",msg:(g.general.name||"general")+" has been deleted!"}),v(g.general)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.cloudProvider.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.cloudProviders=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CLOUDPROVIDERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","generals","general","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditGeneralDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.generals=e,s.general={},s.generals&&s.generals.rows&&s.generals.rows.length&&(s.general=s.generals.rows[0]),_.isNil(s.general.privacyPolicyEmail)||(s.general.enablePrivacyPolicyEmail=!0),_.isNil(s.general.privacyPolicyName)||(s.general.enablePrivacyPolicyName=!0),_.isNil(s.general.privacyPolicyNumber)||(s.general.enablePrivacyPolicyNumber=!0),n.cloudProvider.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){s.cloudProviders=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CLOUDPROVIDERS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.saveGeneral=function(){s.general.enablePrivacyPolicyEmail||(s.general.privacyPolicyEmail=null),s.general.enablePrivacyPolicyNumber||(s.general.privacyPolicyNumber=null),s.general.enablePrivacyPolicyName||(s.general.privacyPolicyName=null),s.general.id?n.setting.update({id:s.general.id},s.general).$promise.then(function(){t.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):n.setting.save(s.general).$promise.then(function(e){_.merge(s.general,e),t.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.onPrivacyPolicyChange=function(e){switch(e){case"email":s.general.enablePrivacyPolicyEmail&&!s.general.privacyPolicyEmail&&(s.general.privacyPolicyEmail=0);break;case"name":s.general.enablePrivacyPolicyName&&!s.general.privacyPolicyName&&(s.general.privacyPolicyName=0);break;case"number":s.general.enablePrivacyPolicyNumber&&!s.general.privacyPolicyNumber&&(s.general.privacyPolicyNumber=0)}}}e.$inject=["generals","api","toasty","license","Auth"],angular.module("app.settings").controller("GeneralsController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l){var d=this;d.license=i||{},d.agents=0,d.users=0,d.telephones=0,d.channels=[{name:"voice",icon:"icon-phone"},{name:"chat",icon:"icon-hangouts"},{name:"mail",icon:"icon-email"},{name:"messaging",icon:"icon-message-text"},{name:"fax",icon:"icon-deskphone"},{name:"openchannel",icon:"icon-google-earth"},{name:"whatsapp",icon:"icon-whatsapp"}],d.modules=[{name:"cm",icon:"icon-account-circle"},{name:"dialer",icon:"icon-crosshairs"},{name:"jscripty",icon:"icon-console"}],d.addons=[{name:"webrtc",icon:"icon-server-plus"},{name:"jaws",icon:"icon-fish"},{name:"custom",icon:"icon-table-edit"},{name:"screenrecording",icon:"icon-video"},{name:"ai",icon:"icon-text-to-speech"}],d.sessions=[{name:"callysquare",icon:"icon-sitemap",restart:!0,label:"channels",enabled:"voice"},{name:"virtual",icon:"icon-dots-horizontal",restart:!1,label:"sessions",enabled:"chat"}],d.others=[{name:"update",icon:"icon-cloud-download"}],d.requestLicense=function(e){t.show({controller:"RequestLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/request/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i,channels:d.channels,modules:d.modules,addons:d.addons,sessions:d.sessions,others:d.others}})},d.updateLicense=function(e){t.show({controller:"UpdateLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/update/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i}})},d.gotoProcess=function(e){a.go("app.settings.system",{tab:1})},d.alert=s.info,d.downloadLogFile=function(){return o.license.downloadLogFile().$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","license-info.log"),document.body.appendChild(a),a.click(),s.success({title:l.instant("SETTINGS.LICENSE_LOG_FILE"),msg:l.instant("SETTINGS.LICENSE_LOG_FILE_DOWNLOADED")})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.isAdmin=r.isAdmin(),o.user.get({fields:"id",role:"agent",online:!0}).$promise.then(function(e){return d.agents=e&&e.count?e.count:0,o.user.get({fields:"id",role:"user,admin"}).$promise}).then(function(e){return d.users=e&&e.count?e.count:0,o.user.get({fields:"id",role:"telephone"}).$promise}).then(function(e){d.telephones=e&&e.count?e.count:0}).catch(function(e){console.log(e)})}e.$inject=["$document","$window","$mdDialog","$state","license","toasty","api","Auth","$translate"],angular.module("app.settings.license").controller("LicenseController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(){e.hide()}m.errors=[],m.user=d.getCurrentUser(),m.license=angular.copy(t),m.channels=a,m.modules=i,m.addons=s,m.sessions=o,m.others=r,m.license.name=m.user.fullname,m.license.email=m.user.email,m.sendRequest=function(){for(var e in m.errors=[],m.table="||FIELD||OLD||NEW||\n",m.license)m.license.hasOwnProperty(e)&&!_.includes(["$promise","$resolved"],e)&&(t[e]===m.license[e]?m.table+="|"+e+"|"+(void 0!==t[e]?t[e]:"")+"|"+m.license[e]+"|\n":m.table+="|"+e+"|{color:red}"+(void 0!==t[e]?t[e]:"")+"{color}|*"+m.license[e]+"*|\n");l.jira.save({key:"MOTLICENSE",summary:"Motion License Request",description:m.table,issuetype:"License Request"}).$promise.then(function(e){n.success({title:"Request sent!",msg:c.instant("SETTINGS.LICENSE_REQUEST_SENT"),timeout:15e3}),u()}).catch(function(e){console.error(e),m.errors=[{message:c.instant("SETTINGS.JIRA_ERROR_MESSAGE"),type:"api.jira"}]})},m.closeDialog=u}e.$inject=["$mdDialog","toasty","license","channels","modules","addons","sessions","others","api","Auth","$translate"],angular.module("app.settings.license").controller("RequestLicenseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.errors=[],s.license=angular.copy(t),s.licenseKey,s.updateLicense=function(){return a.license.update({id:1,key:s.licenseKey}).$promise.then(function(e){e&&(e.demo?n.error({title:"License update failed!",msg:"Invalid license key"}):n.success({title:"License properly updated!",msg:"The license has been updated!"}))}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATElicense",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","toasty","license","api","$translate"],angular.module("app.settings.license").controller("UpdateLicenseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(e){a.hide(e)}p.currentUser=c.getCurrentUser(),p.errors=[],p.setting=u,p.license=m,p.hasModulePermissions={},p.passwordPattern=p.setting&&p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.title="SETTINGS.EDIT_NETWORK",p.network=angular.copy(l),p.networks=r,p.newNetwork=!1,p.network||(p.network={type:"localnet"},p.title="SETTINGS.NEW_NETWORK",p.newNetwork=!0),p.addNewNetwork=function(){p.errors=[],d.network.save(p.network).$promise.then(function(e){p.networks.unshift(e.toJSON()),o.success({title:"Network properly created",msg:p.network.name?p.network.name+" has been created!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveNetwork=function(){p.errors=[],d.network.update({id:p.network.id},p.network).$promise.then(function(e){var n=_.find(p.networks,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Network properly saved!",msg:p.network.name?p.network.name+" has been saved!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteNetwork=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The network will be deleted.").ariaLabel("Delete Network").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.network.delete({id:p.network.id}).$promise.then(function(){_.remove(p.networks,{id:p.network.id}),o.success({title:"Network properly deleted!",msg:(p.network.name||"network")+" has been deleted!"}),g(p.network)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.getDateFromString=function(e){return null===e?void 0:new Date(e)},p.closeDialog=g}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","networks","network","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditNetworkDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;v.license=p,v.setting=g,v.currentUser=u.getCurrentUser(),v.networks=l||{count:0,rows:[]},v.table="networks",v.listOrder="",v.listOrderAsc=null,v.selectedNetworks=[],v.query={fields:"createdAt,updatedAt,id,type,value,username,password",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"LocalNET",value:"'localnet'"},{option:"ExternIP",value:"'externip'"},{option:"Turn",value:"'turn'"},{option:"Stun",value:"'stun'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,n){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{network:e,networks:v.networks.rows,license:v.license,setting:null,crudPermissions:v.crudPermissions}})},v.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("network")+"?").htmlContent("<b>"+(e.name||"network")+"</b> will be deleted.").ariaLabel("delete network").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=b,v.getNetworks=function(){v.query.offset=(v.query.page-1)*v.query.limit,u.hasRole("admin")?v.promise=d.network.get(v.query,b).$promise:(v.query.id=v.userProfile.id,v.query.section="Networks",v.promise=d.userProfile.getResources(v.query,b).$promise)},v.createOrEditNetwork=function(e,n){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{network:n,networks:v.networks.rows,license:v.license,setting:v.setting,crudPermissions:v.crudPermissions}})},v.deleteNetwork=A,v.exportSelectedNetworks=function(){var e=angular.copy(v.selectedNetworks);return v.selectedNetworks=[],e},v.deleteSelectedNetworks=function(e){var n=i.confirm().title("Are you sure want to delete the selected networks?").htmlContent("<b>"+v.selectedNetworks.length+" selected</b> will be deleted.").ariaLabel("delete Networks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){v.selectedNetworks.forEach(function(e){A(e)}),v.selectedNetworks=[]})},v.deselectNetworks=function(){v.selectedNetworks=[]},v.selectAllNetworks=function(){v.selectedNetworks=v.networks.rows};var h=!0,f=1;function b(e){v.networks=e||{count:0,rows:[]}}function A(e){d.network.delete({id:e.id}).$promise.then(function(){_.remove(v.networks.rows,{id:e.id}),v.networks.count-=1,v.networks.rows.length||v.getNetworks(),m.success({title:_.startCase("Network")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEnetwork"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEnetwork",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){h?o(function(){h=!1}):(n||(f=v.query.page),e!==n&&(v.query.page=1),e||(v.query.page=f),v.getNetworks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","networks","api","msUtils","toasty","Auth","license","setting"],angular.module("app.settings").controller("NetworksController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;l.currentUser=o.getCurrentUser(),l.license=s,l.providers=r.getEmailProviders(),l.mailAccounts=e||{rows:[],count:0},l.cloudProviders=t||{rows:[],count:0},l.mailAccount={service:!0,Smtp:{}},0<l.mailAccounts.count&&(l.mailAccount=l.mailAccounts.rows[0]),l.saveSmtp=function(){var e=angular.copy(l.mailAccount);"custom"===e.provider?e.provider=null:e.Smtp.modernAuthentication;l.mailAccount.id?a.mailAccount.update({id:l.mailAccount.id},e).$promise.then(function(){i.success({msg:n.instant("SETTINGS.NOTIFICATIONS.SMTP_SAVED_SUCCESS_TITLE")})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}):a.mailAccount.save(e).$promise.then(function(e){_.merge(l.mailAccount,e),i.success({msg:n.instant("SETTINGS.NOTIFICATIONS.SMTP_SAVED_SUCCESS_TITLE")})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},l.verifySmtp=function(){a.mailAccount.verifySmtp({id:l.mailAccount.id}).$promise.then(function(){i.success({msg:n.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_SUCCESS_TITLE")})}).catch(function(e){i.error({title:n.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:e.data?JSON.stringify(e.data):e.toString(),timeout:1e4})})},l.onProviderChange=function(){"custom"!==l.mailAccount.provider&&(l.mailAccount.authentication=!0);"outlook365"!==l.mailAccount.provider&&(l.mailAccount.Smtp.modernAuthentication=!1)}}e.$inject=["$translate","mailAccounts","cloudProviders","api","toasty","license","Auth","msUtils"],angular.module("app.settings").controller("SmtpController",e)}(),function(){"use strict";function e(e,i,s,n,t,a,o,r){var l,d=this;d.system=t||{},d.processes=a?a.rows:[],d.processLimit=7,d.selectedTab=n.params.tab||0,d.getInfo=function(){return r.system.get().$promise.then(function(e){_.merge(d.system,e)}).catch(d.cancelInterval)},d.getProcesses=function(){return r.pm2.get().$promise.then(function(e){_.merge(d.processes,e?e.rows:[])}).catch(d.cancelInterval)},d.cancelInterval=function(e){i.cancel(l)},d.updateProcess=function(e,n,t){var a=s.confirm().title("Would you like to change the status of the process #"+n+"?").textContent("The status will be changed to: "+t.toUpperCase()).ariaLabel("Lucky day").targetEvent(e).ok("Ok").cancel("Cancel");s.show(a).then(function(){return r.pm2.update({id:n,status:t})}).then(function(){i(d.getProcesses,1e3,1)}).then(function(){o.success({title:"Process updated!",msg:"Status properly changed to: "+t})})},l=i(d.getInfo,5e3),e.$on("$destroy",function(){d.cancelInterval()})}e.$inject=["$scope","$interval","$mdDialog","$state","system","processes","toasty","api"],angular.module("app.settings.system").controller("SystemController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.title="SETTINGS.UPDATE",s.progress=0,s.updating=!0,s.output="Waiting...",s.success=!0,s.interval=n(function(){s.progress<90&&(s.progress+=1)},1e3),s.closeDialog=function(){e.hide()},s.reload=function(){t.location.reload()},s.stopInterval=function(){angular.isDefined(s.interval)&&(n.cancel(s.interval),s.interval=void 0);s.progress=100,s.updating=!1},i.version.fetch().$promise.then(function(e){return s.output=e.output+"...",i.version.reset().$promise}).then(function(e){return s.output=e.output+"...",i.version.pull().$promise}).then(function(e){return s.output=e.output+"...",i.version.migrations().$promise}).then(function(e){return s.output=e.output+"...",i.version.restart().$promise}).then(function(e){s.output="Waiting to restart motion...",a(function(){s.stopInterval()},3e4)}).catch(function(e){s.success=!1,s.stopInterval(),s.output=JSON.stringify(e)})}e.$inject=["$mdDialog","$interval","$window","$timeout","api"],angular.module("app.settings").controller("UpdateDialogController",e)}(),function(){"use strict";function e(t,e,a,n,i){this.version=n||{},this.updateConfirm=function(e){var n=t.confirm().title("Would you like to update your system?").htmlContent('The system request time for the update should be below 1 minute.<br><br>Do you agree the terms of this <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">End User License Agreement<a>?').ariaLabel("").targetEvent(e).clickOutsideToClose(!0).parent(angular.element(a.body)).ok("I agree").cancel("Disagree");t.show(n).then(function(){t.show({controller:"UpdateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/updates/update/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!1})})}}e.$inject=["$mdDialog","$interval","$document","version","toasty"],angular.module("app.settings").controller("UpdatesController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"SmsQueues":void 0,channel:"sms",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("SMS.SMSQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:n,smsQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:n,smsQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("sms_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userSmsQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.SmsQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userSmsQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.SmsQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"sms")})}),e.$on("$destroy",function(){r.removeAllListeners("sms_queue:save"),r.removeAllListeners("userSmsQueue:remove"),r.removeAllListeners("userSmsQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.sms").controller("QueuesSmsRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.sms.realtime.agents":this.selectedTab=0;break;case"app.sms.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.sms.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.sms.realtime.agents");break;case 1:t.go("app.sms.realtime.queues");break;default:t.go("app.sms.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.sms").controller("SmsRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSACCOUNT",g.smsAccount=angular.copy(l),g.smsAccounts=r,g.newSmsAccount=!1,g.smsAccount||(g.smsAccount={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),type:"twilio",waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="SMS.NEW_SMSACCOUNT",g.newSmsAccount=!0),n.params.id&&(g.smsAccount.SmsAccountId=n.params.id),g.addNewSmsAccount=function(){g.errors=[],d.smsAccount.save(g.smsAccount).$promise.then(function(e){g.smsAccounts.unshift(e.toJSON()),o.success({title:"SmsAccount properly created",msg:g.smsAccount.name?g.smsAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsAccount=function(){g.errors=[],d.smsAccount.update({id:g.smsAccount.id},g.smsAccount).$promise.then(function(e){var n=_.find(g.smsAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsAccount properly saved!",msg:g.smsAccount.name?g.smsAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsAccount will be deleted.").ariaLabel("Delete SmsAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.smsAccount.delete({id:g.smsAccount.id}).$promise.then(function(){_.remove(g.smsAccounts,{id:g.smsAccount.id}),o.success({title:"SmsAccount properly deleted!",msg:(g.smsAccount.name||"smsAccount")+" has been deleted!"}),v(g.smsAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.smsAccount&&(t=_.find(g.lists,{id:Number(g.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.smsAccount&&(a=_.find(g.lists,{id:Number(g.smsAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsAccounts","smsAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.smsAccountApps.rows.length){var t=r.smsAccountApps.rows[n]?r.smsAccountApps.rows[n]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccountApp:t,smsAccount:r.smsAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.smsAccountApps.rows[n]=e:r.smsAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.smsAccountApps.rows.length;t++,0){var a=r.smsAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.smsAccount.context,a.exten=r.smsAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.smsAccount.addApplications({id:r.smsAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.smsAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.smsAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.smsAccount={},r.smsAccountApps={count:0,rows:[]},r.selectedSmsAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"SmsQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"smsQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:701}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.smsAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getSmsAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.smsAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getSmsAccountApps=function(){r.promise=o.smsAccount.getApplications(r.query,t).$promise},r.editSmsAccountApp=n,r.editInterval=function(e,n){if(r.smsAccountApps.rows.length){var t=r.smsAccountApps.rows[n]?r.smsAccountApps.rows[n]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteSmsAccountApp=function(e){_.remove(r.smsAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedSmsAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedSmsAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedSmsAccountApps.forEach(function(e){_.remove(r.smsAccountApps.rows,{id:e.id})}),r.selectedSmsAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.sms").controller("SmsAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsAccount.getAgents({id:c.smsAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserSmsAccount?"penalty "+e.UserSmsAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.smsAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsAccount.removeAgents({id:c.smsAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsAccount.addAgents({id:c.smsAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","smsAccount","smsAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditSmsAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("sms")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"smsAccount",action:"getDispositions",field:"name",params:{id:m.smsAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.smsAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.smsAccountInteractions.rows.length;n+=1){var t=m.smsAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.smsInteraction.get(m.query,p).$promise}function v(e){d.smsInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.smsAccountInteractions.rows,{id:e.id}),m.smsAccountInteractions.count-=1,m.smsAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.mobile):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.smsAccount={},m.smsAccountInteractions={count:0,rows:[]},m.selectedSmsAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.smsAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.SmsAccountId=m.smsAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.smsInteractionDownload=function(s,e,n){return d.smsInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="sms-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getSmsAccountInteractions=g,m.createOrEditSmsAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:m.smsAccount,interaction:n,interactions:m.smsAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spysmsInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"sms",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"sms.smsAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||SmsAccountId:=$eq["+m.smsAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedSmsAccountInteractions=function(){var e=angular.copy(m.selectedSmsAccountInteractions);return m.selectedSmsAccountInteractions=[],e},m.deleteSmsAccountInteraction=v,m.deleteSelectedSmsAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedSmsAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedSmsAccountInteractions.forEach(function(e){v(e)}),m.selectedSmsAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.smsAccountSmsCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.smsAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.smsAccountSmsCannedAnswers.rows,{id:e.id}),m.smsAccountSmsCannedAnswers.count-=1,m.smsAccountSmsCannedAnswers.rows.length||p(),l.success({title:"SmsCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.smsAccount={},m.smsAccountSmsCannedAnswers={count:0,rows:[]},m.selectedSmsAccountSmsCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.smsAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.SmsAccountId=m.smsAccount.id,m.query.id=m.smsAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the smsCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("smsCannedAnswer #")+e.id||"smsCannedAnswer")+"</b> will be deleted.").ariaLabel("delete smsCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getSmsAccountSmsCannedAnswers=p,m.createOrEditSmsAccountSmsCannedAnswer=function(e,n){o.show({controller:"CreateOrEditSmsCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:m.smsAccount,smsCannedAnswer:n,smsCannedAnswers:m.smsAccountSmsCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedSmsAccountSmsCannedAnswers=function(){var e=angular.copy(m.selectedSmsAccountSmsCannedAnswers);return m.selectedSmsAccountSmsCannedAnswers=[],e},m.deleteSmsAccountSmsCannedAnswer=g,m.deleteSelectedSmsAccountSmsCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected smsCannedAnswers?").htmlContent("<b>"+m.selectedSmsAccountSmsCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete smsCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedSmsAccountSmsCannedAnswers.forEach(function(e){g(e)}),m.selectedSmsAccountSmsCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSCANNEDANSWER",g.smsCannedAnswer=angular.copy(l),g.smsCannedAnswers=r,g.newSmsCannedAnswer=!1,g.smsCannedAnswer||(g.smsCannedAnswer={},g.title="SMS.NEW_SMSCANNEDANSWER",g.newSmsCannedAnswer=!0),n.params.id&&(g.smsCannedAnswer.SmsAccountId=n.params.id),g.addNewSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.smsCannedAnswer).$promise.then(function(e){g.smsCannedAnswers.unshift(e.toJSON()),o.success({title:"SmsCannedAnswer properly created",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.smsCannedAnswer.id},g.smsCannedAnswer).$promise.then(function(e){var n=_.find(g.smsCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsCannedAnswer properly saved!",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsCannedAnswer will be deleted.").ariaLabel("Delete SmsCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.smsCannedAnswer.id}).$promise.then(function(){_.remove(g.smsCannedAnswers,{id:g.smsCannedAnswer.id}),o.success({title:"SmsCannedAnswer properly deleted!",msg:(g.smsCannedAnswer.name||"smsCannedAnswer")+" has been deleted!"}),v(g.smsCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsCannedAnswers","smsCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.smsAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.smsAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.SmsAccountId=m.smsAccount.id,m.query.id=m.smsAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.smsAccount.id,field:"SmsAccountId",route:"smsAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.sms").controller("SmsAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.smsAccount=c||e.params.smsAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:p.smsAccounts?p.smsAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoSmsAccounts=function(){e.go("app.sms.smsAccounts",{},{reload:"app.sms.smsAccounts"})},p.saveSmsAccount=function(){r.smsAccount.update({id:p.smsAccount.id},p.smsAccount).$promise.then(function(){l.success({title:"SmsAccount updated!",msg:p.smsAccount.name?p.smsAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.smsAccount&&(t=_.find(p.lists,{id:Number(p.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.smsAccount&&(a=_.find(p.lists,{id:Number(p.smsAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsAccount","userProfile","userProfileSection"],angular.module("app.sms").controller("SmsAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.smsAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="smsAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSmsAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Skebby",value:"'skebby'"},{option:"Connectel",value:"'connectel'"},{option:"ClickSend",value:"'clicksend'"},{option:"Plivo",value:"'plivo'"},{option:"Infobip",value:"'infobip'"},{option:"Clickatell",value:"'clickatell'"},{option:"Bandwidth",value:"'bandwidth'"},{option:"CSCTelecom",value:"'csc'"},{option:"Intelepeer",value:"'intelepeer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysmsMethod=_.keyBy([{option:"Basic",value:"'SI'"},{option:"Classic",value:"'TI'"},{option:"Classic+",value:"'GP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.sms.smsAccounts.edit",{id:e.id,smsAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.sms.smsAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:f.smsAccounts?f.smsAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("smsAccount")+"?").htmlContent("<b>"+(e.name||"smsAccount")+"</b> will be deleted.").ariaLabel("delete smsAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSmsAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.smsAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SmsAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSmsAccount=function(e,n){i.show({controller:"CreateOrEditSmsAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:n,smsAccounts:f.smsAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSmsAccount=y,f.exportSelectedSmsAccounts=function(){var e=angular.copy(f.selectedSmsAccounts);return f.selectedSmsAccounts=[],e},f.deleteSelectedSmsAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected smsAccounts?").htmlContent("<b>"+f.selectedSmsAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SmsAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSmsAccounts.forEach(function(e){y(e)}),f.selectedSmsAccounts=[]})},f.deselectSmsAccounts=function(){f.selectedSmsAccounts=[]},f.selectAllSmsAccounts=function(){f.selectedSmsAccounts=f.smsAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.smsAccount&&(t=_.find(f.lists,{id:Number(f.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.smsAccount&&(a=_.find(f.lists,{id:Number(f.smsAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.smsAccounts=e||{count:0,rows:[]}}function y(e){m.smsAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.smsAccounts.rows,{id:e.id}),f.smsAccounts.count-=1,f.smsAccounts.rows.length||f.getSmsAccounts(),p.success({title:_.startCase("SmsAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSmsAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.sms").controller("SmsAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSQUEUE",g.smsQueue=angular.copy(l),g.smsQueues=r,g.newSmsQueue=!1,g.smsQueue||(g.smsQueue={strategy:"beepall",timeout:10},g.title="SMS.NEW_SMSQUEUE",g.newSmsQueue=!0),g.addNewSmsQueue=function(){g.errors=[],d.smsQueue.save(g.smsQueue).$promise.then(function(e){g.smsQueues.unshift(e.toJSON()),o.success({title:"SmsQueue properly created",msg:g.smsQueue.name?g.smsQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsQueue=function(){g.errors=[],d.smsQueue.update({id:g.smsQueue.id},g.smsQueue).$promise.then(function(e){var n=_.find(g.smsQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsQueue properly saved!",msg:g.smsQueue.name?g.smsQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsQueue will be deleted.").ariaLabel("Delete SmsQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.smsQueue.delete({id:g.smsQueue.id}).$promise.then(function(){_.remove(g.smsQueues,{id:g.smsQueue.id}),o.success({title:"SmsQueue properly deleted!",msg:(g.smsQueue.name||"smsQueue")+" has been deleted!"}),v(g.smsQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsQueues","smsQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsQueue.getAgents({id:c.smsQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.smsQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.removeAgents({id:c.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.addAgents({id:c.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","smsQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsQueue.getTeams({id:l.smsQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.smsQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("SMS.ALL_TEAMS"),labelSelected:t.instant("SMS.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.removeTeams({id:l.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.addTeams({id:l.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.smsQueue=c||e.params.smsQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoSmsQueues=function(){e.go("app.sms.smsQueues",{},{reload:"app.sms.smsQueues"})},u.saveSmsQueue=function(){r.smsQueue.update({id:u.smsQueue.id},u.smsQueue).$promise.then(function(){l.success({title:"SmsQueue updated!",msg:u.smsQueue.name?u.smsQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsQueue","userProfileSection"],angular.module("app.sms").controller("SmsQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.smsQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="smsQueues",f.listOrder="",f.listOrderAsc=null,f.selectedSmsQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.sms.smsQueues.edit",{id:e.id,smsQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:f.smsQueues?f.smsQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:f.smsQueues?f.smsQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("smsQueue")+"?").htmlContent("<b>"+(e.name||"smsQueue")+"</b> will be deleted.").ariaLabel("delete smsQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:710}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.sms.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.sms.realtime.queues",{})}},f.success=E,f.getSmsQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.smsQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SmsQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSmsQueue=function(e,n){i.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:n,smsQueues:f.smsQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSmsQueue=y,f.exportSelectedSmsQueues=function(){var e=angular.copy(f.selectedSmsQueues);return f.selectedSmsQueues=[],e},f.deleteSelectedSmsQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected smsQueues?").htmlContent("<b>"+f.selectedSmsQueues.length+" selected</b> will be deleted.").ariaLabel("delete SmsQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSmsQueues.forEach(function(e){y(e)}),f.selectedSmsQueues=[]})},f.deselectSmsQueues=function(){f.selectedSmsQueues=[]},f.selectAllSmsQueues=function(){f.selectedSmsQueues=f.smsQueues.rows};var b=!0,A=1;function E(e){f.smsQueues=e||{count:0,rows:[]}}function y(e){m.smsQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.smsQueues.rows,{id:e.id}),f.smsQueues.count-=1,f.smsQueues.rows.length||f.getSmsQueues(),p.success({title:_.startCase("SmsQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSmsQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.sms").controller("SmsQueuesController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.agents=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,c.hasRole("admin")?g.promise=l.user.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="Agents",g.promise=l.userProfile.getResources(g.query,v).$promise)}function f(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(g.agents.rows,{id:e.id}),g.agents.count-=1,g.agents.rows.length||g.getAgents(),d.success({title:_.startCase("Agent")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=m,g.setting=u,g.currentUser=c.getCurrentUser(),g.agents=s||{count:0,rows:[]},g.userProfile=o,g.userProfileSection=r&&1==r.count?r.rows[0]:null,g.crudPermissions=c.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedAgents=[],g.query={fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled",role:"agent",userSetting:!0,sort:"-updatedAt",limit:10,page:1},g.showWebBarOptions=[{option:"Phonebar",value:0},{option:"External",value:1},{option:"WebRTC",value:2}],g.editstate=function(e){n.go("app.staff.agents.edit",{id:e.id,agent:e,crudPermissions:g.crudPermissions})},g.teamadddialog=function(e,n){a.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:g.agents?g.agents.rows:[],crudPermissions:g.crudPermissions}})},g.deleteconfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the "+_.startCase("agent")+"?").htmlContent("<b>"+(e.name||"agent")+"</b> will be deleted.").ariaLabel("delete agent").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){f(e)})},g.success=v,g.getAgents=h,g.createOrEditAgent=function(e,n){a.show({controller:"CreateOrEditAgentDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{agent:n,agents:g.agents.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}})},g.deleteAgent=f,g.exportSelectedAgents=function(){var e=angular.copy(g.selectedAgents);return g.selectedAgents=[],e},g.deleteSelectedAgents=function(e){var n=a.confirm().title("Are you sure want to delete the selected agents?").htmlContent("<b>"+g.selectedAgents.length+" selected</b> will be deleted.").ariaLabel("delete Agents").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){g.selectedAgents.forEach(function(e){f(e)}),g.selectedAgents=[]})},g.deselectAgents=function(){g.selectedAgents=[]},g.selectAllAgents=function(){g.selectedAgents=g.agents.rows};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),g.getAgents())}),p.on("user-setting:update",h),e.$on("$destroy",function(){p.removeListener("user-setting:update",h)})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","agents","userProfile","userProfileSection","api","toasty","Auth","license","setting","socket"],angular.module("app.staff").controller("AgentsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c){var m=this;function u(){return s.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.agent=e})}function p(e){t.hide(e)}m.currentUser=o.getCurrentUser(),m.errors=[],m.setting=l,m.license=r,m.crudPermissions=d,m.hasModulePermissions={},m.passwordPattern=m.setting&&m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.title="STAFF.EDIT_AGENT",m.agent=angular.copy(i),m.agents=n,m.newAgent=!1,m.agent||(m.agent={role:"agent",showWebBar:"0",autointernal:!0,wssPort:8089,type:"friend",context:"from-sip",phoneBarRemoteControl:!0,phoneBarRemoteControlPort:9888,allowmessenger:!0,downloadAttachments:!0,downloadOmnichannelInteractions:!0,downloadVoiceRecordings:!0},m.title="STAFF.NEW_AGENT",m.newAgent=!0),m.addNewAgent=function(){m.errors=[],s.user.save(m.agent).$promise.then(function(e){m.agents.unshift(e.toJSON()),a.success({title:"Agent properly created",msg:m.agent.name?m.agent.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveAgent=function(){m.errors=[],s.user.update({id:m.agent.id},m.agent).$promise.then(function(e){var n=_.find(m.agents,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"Agent properly saved!",msg:m.agent.name?m.agent.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteAgent=function(e){m.errors=[];var n=t.confirm().title("Are you sure?").content("The agent will be deleted.").ariaLabel("Delete Agent").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){s.user.delete({id:m.agent.id}).$promise.then(function(){_.remove(m.agents,{id:m.agent.id}),a.success({title:"Agent properly deleted!",msg:(m.agent.name||"agent")+" has been deleted!"}),p(m.agent)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.closeDialog=p;var g="user-setting:update:user-"+m.agent.id;c.on(g,u),e.$on("$destroy",function(){c.removeListener(g,u)})}e.$inject=["$scope","$mdDialog","toasty","agents","agent","api","Auth","license","setting","crudPermissions","socket"],angular.module("app.staff").controller("CreateOrEditAgentDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.agent={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.agent.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.agent.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.agent=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.agent.id+"/avatar",i.agent.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Agentchange_avatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.agent=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.agent.id,newPassword:r.password};r.currentUser.id==r.agent.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"Agent password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.agent.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.agent.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.agentForm.password.$setValidity("oldPasswordMatch",!1):t.agentForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","agent","setting","Auth"],angular.module("app.staff").controller("AgentchangepasswordController",e)}(),function(){"use strict";function e(e,n,i,t,s){var o=this;o.agent={},o.navigation=t.getNavigation(),o.crudPermissions,o.init=function(e,n){o.agent=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1}},o.onChange=function(n,t){if((t||n).enabled){if(t)t.enabled=!0,o.agent.permissions.push(t.id);else for(var e=0;e<n.children.length;e++)n.children[e].enabled=!0,o.agent.permissions.push(n.children[e].id);n.enabled=!0,o.agent.permissions.push(n.id)}else if(t)t.enabled=!1,_.remove(o.agent.permissions,function(e){return t.id===e}),_.filter(n.children,{enabled:!1}).length===n.children.length&&(n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e}));else{n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e});for(var a=0;a<n.children.length;a++)n.children[a].enabled=!1,_.remove(o.agent.permissions,function(e){return n.children[a].id===e})}return i.user.update({id:o.agent.id,permissions:_.uniq(o.agent.permissions)}).$promise.then(function(){s.success({title:"agent updated!",msg:o.agent.name?o.agent.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["$document","$mdDialog","api","msNavigationAgentService","toasty"],angular.module("app.staff").controller("AgentPermissionsController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d[c.apiName].get({fields:"id,name,strategy,type",channel:c.channel,type:"voice"===c.channel?c.direction:void 0,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.user.getQueues({id:c.agent.id,fields:"id,name,strategy,type,penalty",nolimit:!0,type:"voice"===c.channel?c.direction:void 0,channel:c.channel}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return"voice"===c.channel&&(n.penalty=void 0!==n&&void 0!==e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"penalty 0"),n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.agent=n,c.crudPermissions=r,c.penalty=0,c.channel=t,c.direction=i,c.apiName=c.channel+"Queue",c.title=s.instant("STAFF.ADD_AGENT_TO_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"type",line3:"voice"===c.channel?"penalty":"",labelAll:s.instant("STAFF.ALL_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),labelSelected:s.instant("STAFF.SELECTED_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}},c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){var e;switch(c.channel){case"voice":switch(c.direction){case"inbound":e="VoiceQueues";break;case"outbound":e="QueueCampaigns"}break;case"chat":e="ChatQueues";break;case"mail":e="MailQueues";break;case"sms":e="SmsQueues";break;case"openchannel":e="OpenchannelQueues";break;case"fax":e="FaxQueues"}d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:e}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveQueues=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.user.removeQueues({id:c.agent.id,ids:_.map(t,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else if("voice"===c.channel){for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.user.addQueues({id:c.agent.id,ids:_.map(o,"id"),channel:c.channel,penalty:_.trim(s,"penalty ")}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}else d.user.addQueues({id:c.agent.id,ids:_.map(r,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){n(e)})});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Queues association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:QUEUES_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","channel","direction","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentQueueAddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.user.getTeams({id:l.agent.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.agent=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("STAFF.ALL_TEAMS"),labelSelected:t.instant("STAFF.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.user.removeTeams({id:l.agent.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.user.addTeams({id:l.agent.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentteamaddController",e)}(),function(){"use strict";function e(e,n,i,s,t,a,o,r,l,d,c){var m=this;m.currentUser=l.getCurrentUser(),m.license=t,m.setting=a,m.passwordPattern=m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.location=n.protocol()+"://"+n.host(),m.agent=d||e.params.agent||{},m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=l.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.hasModulePermissions={},m.selectedTab=e.params.tab||0,m.queueaddchannel=function(e,n,t,a){i.show({controller:"AgentQueueAddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:m.agents?m.agents.rows:[],channel:n,direction:a||"inbound",crudPermissions:m.crudPermissions}})},m.teamadddialog=function(e,n){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:m.agents?m.agents.rows:[],crudPermissions:m.crudPermissions}})},m.changepassworddialog=function(e,n){i.show({controller:"AgentchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,setting:a,agents:m.agents?m.agents.rows:[],crudPermissions:m.crudPermissions}})},m.onEnableScreenRecordingByAgentSelection=function(){["phoneBarEnableAutomaticScreenRecording"].forEach(function(e){m.agent.phoneBarEnableScreenRecordingByAgent&&(m.agent[e]=!m.agent.phoneBarEnableScreenRecordingByAgent)})},m.onEnableAutomaticScreenRecordingSelection=function(){["phoneBarEnableScreenRecordingByAgent"].forEach(function(e){m.agent.phoneBarEnableAutomaticScreenRecording&&(m.agent[e]=!m.agent.phoneBarEnableAutomaticScreenRecording)})},m.alert=r.info,m.gotoAgents=function(){e.go("app.staff.agents",{},{reload:"app.staff.agents"})},m.saveAgent=function(){m.agent=_.omit(m.agent,"userpic"),o.user.update({id:m.agent.id},m.agent).$promise.then(function(){r.success({title:"Agent updated!",msg:m.agent.name?m.agent.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.refreshAgent=function(){return o.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.agent=e})},l.hasRole("admin")?o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.contexts,{id:e.resourceId})}),t=null;if(m.agent&&(t=_.find(m.contexts,{name:m.agent.context})),t&&!_.some(n,["id",t.id])){var a=_.find(m.contexts,{id:t.id});a.canSelect=!1,n.push(a)}m.contexts=n}):o.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){m.contexts=e.rows||[]})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","agent","userProfileSection"],angular.module("app.staff").controller("AgentController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TEAM",g.team=angular.copy(l),g.teams=r,g.newTeam=!1,g.team||(g.team={},g.title="STAFF.NEW_TEAM",g.newTeam=!0),g.addNewTeam=function(){g.errors=[],d.team.save(g.team).$promise.then(function(e){g.teams.unshift(e.toJSON()),o.success({title:"Team properly created",msg:g.team.name?g.team.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTeam=function(){g.errors=[],d.team.update({id:g.team.id},g.team).$promise.then(function(e){var n=_.find(g.teams,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Team properly saved!",msg:g.team.name?g.team.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTeam=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The team will be deleted.").ariaLabel("Delete Team").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.team.delete({id:g.team.id}).$promise.then(function(){_.remove(g.teams,{id:g.team.id}),o.success({title:"Team properly deleted!",msg:(g.team.name||"team")+" has been deleted!"}),v(g.team)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","teams","team","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTeamDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.team.getAgents({id:c.team.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.team=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.team.removeAgents({id:c.team.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.team.addAgents({id:c.team.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("STAFF.ALL_AGENTS"),labelSelected:r.instant("STAFF.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","team","teams","realtime","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("TeamagentaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.teams=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="teams",f.listOrder="",f.listOrderAsc=null,f.selectedTeams=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{team:e,teams:f.teams.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"TeamagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{team:e,teams:f.teams?f.teams.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("team")+"?").htmlContent("<b>"+(e.name||"team")+"</b> will be deleted.").ariaLabel("delete team").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTeams=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.team.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Teams",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTeam=function(e,n){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{team:n,teams:f.teams.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTeam=y,f.exportSelectedTeams=function(){var e=angular.copy(f.selectedTeams);return f.selectedTeams=[],e},f.deleteSelectedTeams=function(e){var n=i.confirm().title("Are you sure want to delete the selected teams?").htmlContent("<b>"+f.selectedTeams.length+" selected</b> will be deleted.").ariaLabel("delete Teams").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTeams.forEach(function(e){y(e)}),f.selectedTeams=[]})},f.deselectTeams=function(){f.selectedTeams=[]},f.selectAllTeams=function(){f.selectedTeams=f.teams.rows};var b=!0,A=1;function E(e){f.teams=e||{count:0,rows:[]}}function y(e){m.team.delete({id:e.id}).$promise.then(function(){_.remove(f.teams.rows,{id:e.id}),f.teams.count-=1,f.teams.rows.length||f.getTeams(),p.success({title:_.startCase("Team")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEteam"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEteam",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTeams())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","teams","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("TeamsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TELEPHONE",g.telephone=angular.copy(l),g.telephones=r,g.newTelephone=!1,g.telephone||(g.telephone={role:"telephone",autointernal:!0,context:"from-sip"},g.title="STAFF.NEW_TELEPHONE",g.newTelephone=!0),g.addNewTelephone=function(){g.errors=[],d.user.save(g.telephone).$promise.then(function(e){g.telephones.unshift(e.toJSON()),o.success({title:"Telephone properly created",msg:g.telephone.name?g.telephone.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTelephone=function(){g.errors=[],d.user.update({id:g.telephone.id},g.telephone).$promise.then(function(e){var n=_.find(g.telephones,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Telephone properly saved!",msg:g.telephone.name?g.telephone.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTelephone=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The telephone will be deleted.").ariaLabel("Delete Telephone").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.user.delete({id:g.telephone.id}).$promise.then(function(){_.remove(g.telephones,{id:g.telephone.id}),o.success({title:"Telephone properly deleted!",msg:(g.telephone.name||"telephone")+" has been deleted!"}),v(g.telephone)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","telephones","telephone","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTelephoneDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.telephone=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.telephone.id,newPassword:r.password};r.currentUser.id==r.telephone.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"Telephone password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.telephone.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.telephone.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.telephoneForm.password.$setValidity("oldPasswordMatch",!1):t.telephoneForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","telephone","setting","Auth"],angular.module("app.staff").controller("TelephonechangepasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.telephone=c||e.params.telephone||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.changepassworddialog=function(e,n){t.show({controller:"TelephonechangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{telephone:e,setting:o,telephones:u.telephones?u.telephones.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTelephones=function(){e.go("app.staff.telephones",{},{reload:"app.staff.telephones"})},u.saveTelephone=function(){r.user.update({id:u.telephone.id},u.telephone).$promise.then(function(){l.success({title:"Telephone updated!",msg:u.telephone.name?u.telephone.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.telephone&&(t=_.find(u.contexts,{name:u.telephone.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","telephone","userProfileSection"],angular.module("app.staff").controller("TelephoneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.telephones=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="telephones",f.listOrder="",f.listOrderAsc=null,f.selectedTelephones=[],f.query={fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,page:1},f.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.staff.telephones.edit",{id:e.id,telephone:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("telephone")+"?").htmlContent("<b>"+(e.name||"telephone")+"</b> will be deleted.").ariaLabel("delete telephone").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTelephones=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.user.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Telephones",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTelephone=function(e,n){i.show({controller:"CreateOrEditTelephoneDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{telephone:n,telephones:f.telephones.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTelephone=y,f.exportSelectedTelephones=function(){var e=angular.copy(f.selectedTelephones);return f.selectedTelephones=[],e},f.deleteSelectedTelephones=function(e){var n=i.confirm().title("Are you sure want to delete the selected telephones?").htmlContent("<b>"+f.selectedTelephones.length+" selected</b> will be deleted.").ariaLabel("delete Telephones").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTelephones.forEach(function(e){y(e)}),f.selectedTelephones=[]})},f.deselectTelephones=function(){f.selectedTelephones=[]},f.selectAllTelephones=function(){f.selectedTelephones=f.telephones.rows};var b=!0,A=1;function E(e){f.telephones=e||{count:0,rows:[]}}function y(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(f.telephones.rows,{id:e.id}),f.telephones.count-=1,f.telephones.rows.length||f.getTelephones(),p.success({title:_.startCase("Telephone")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTelephones())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","telephones","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("TelephonesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_USERPROFILE",g.userProfile=angular.copy(l),g.userProfiles=r,g.newUserProfile=!1,g.userProfile||(g.userProfile={crudPermissions:["r"],downloadAttachments:!0,downloadCallySquareRecordings:!0,downloadContactManagerLists:!0,downloadJscriptySessions:!0,downloadOmnichannelInteractions:!0,downloadScreenRecordings:!0,downloadVoiceRecordings:!0},g.title="STAFF.NEW_USERPROFILE",g.newUserProfile=!0),g.addNewUserProfile=function(){g.errors=[],d.userProfile.save(g.userProfile).$promise.then(function(e){var n,t;t=[],(n=e).crudPermissions.forEach(function(e){var n;switch(e){case"r":n="READ_PERMISSION";break;case"e":n="EDIT_PERMISSION";break;case"d":n="DELETE_PERMISSION"}t.push(s.instant("STAFF."+n))}),n.selectedcrudPermissions=t.join(", "),g.userProfiles.unshift(e.toJSON()),o.success({title:"UserProfile properly created",msg:g.userProfile.name?g.userProfile.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveUserProfile=function(){g.errors=[],d.userProfile.update({id:g.userProfile.id},g.userProfile).$promise.then(function(e){var n=_.find(g.userProfiles,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"UserProfile properly saved!",msg:g.userProfile.name?g.userProfile.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteUserProfile=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The userProfile will be deleted.").ariaLabel("Delete UserProfile").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.userProfile.delete({id:g.userProfile.id}).$promise.then(function(){_.remove(g.userProfiles,{id:g.userProfile.id}),o.success({title:"UserProfile properly deleted!",msg:(g.userProfile.name||"userProfile")+" has been deleted!"}),v(g.userProfile)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","userProfiles","userProfile","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditUserProfileDialogController",e)}(),function(){"use strict";function e(n,a,i,e,t,s,o){var r=this;function l(e){n.hide(e)}r.newUserProfile=!0,r.userProfile=angular.copy(t),r.userProfiles=s,r.title=o.instant("STAFF.CLONE_USERPROFILE"),t&&t.name&&(r.title+=": "+t.name),r.cloneUserProfile=function(){return e.userProfile.clone({id:t.id},r.userProfile).$promise.then(function(e){var n,t;t=[],(n=e).crudPermissions.forEach(function(e){var n;switch(e){case"r":n="READ_PERMISSION";break;case"e":n="EDIT_PERMISSION";break;case"d":n="DELETE_PERMISSION"}t.push(o.instant("STAFF."+n))}),n.selectedcrudPermissions=t.join(", "),r.userProfiles.unshift(e.toJSON()),i.success({title:"UserProfile properly cloned",msg:r.userProfile.name?r.userProfile.name+" has been cloned!":""}),a.go("app.staff.userProfiles.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.clone"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","userProfile","userProfiles","$translate"],angular.module("app.staff").controller("UserProfilecloneController",e)}(),function(){"use strict";function e(t,o,r,l,d,e,n,c){var m=this;function u(e,n){switch(e.allResourcesEnabled="full"===n,n){case"full":return _.find(m.statusList,["tag","full"]);case"partial":return _.find(m.statusList,["tag","partial"]);case"disabled":return _.find(m.statusList,["tag","disabled"]);case"unlicensed":return _.find(m.statusList,["tag","unlicensed"]);case"unknown":default:return _.find(m.statusList,["tag","unknown"])}}function p(e){return l(function(n,t){var o,a;void 0!==e.channel&&_.includes(e.route,"Queue")?(a=e,l(function(n,t){var e=void 0!==a.channel&&"bull"===a.channel?"outbound":"inbound";return d[a.route].get({fields:"id,name,strategy,type",channel:"bull"===a.channel?"voice":a.channel,type:e,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})).then(function(e){n(e)}).catch(function(e){t(e)}):(o=e,l(function(a,n){switch(o.route){case"voiceExtension":var e;switch(o.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}break;case"interval":var t=!0;break;case"disposition":var i=!0;break;case"user":var s;switch(o.title){case"Agents":s="agent";break;case"Telephones":s="telephone";break;case"Users":s="user"}}if("Reports"===o.title){if(!o.reportType)return d.analyticDefaultReport.get({nolimit:!0}).$promise.then(function(t){d.analyticCustomReport.get({nolimit:!0}).$promise.then(function(e){var n=_.union(t.rows,e.rows);a({count:n.length,rows:n.rows})})}).catch(function(e){n(e)});switch(o.reportType){case"default":o.route="analyticDefaultReport";break;case"custom":o.route="analyticCustomReport"}}return d[o.route].get({role:s||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:t?"null":void 0,MailAccountId:i?"null":void 0,FaxAccountId:i?"null":void 0,SmsAccountId:i?"null":void 0,OpenchannelAccountId:i?"null":void 0,ChatWebsiteId:i?"null":void 0,WhatsappAccountId:i?"null":void 0,ListId:i?"null":void 0,nolimit:!0}).$promise.then(function(e){a(e)}).catch(function(e){n(e)})})).then(function(e){n(e)}).catch(function(e){t(e)})})}function g(e,n,t){var a=e&&0<e.length?e[0]:null;if(!a)return t;var i,s,o=_.find(n,["sectionId",a.id]);return o?(n=_.remove(n,["sectionId",a.id]),(i=a,s=o.id,l(function(n,t){d.userProfileResource.get({sectionId:s}).$promise.then(function(n){return p(i).then(function(e){return _.differenceBy(n.rows,e.rows,"id")})}).then(function(e){_.isEmpty(e)?n():t()}).catch(function(e){t(e)})})).then(function(){return t="full",g(e.shift(),n,t)}).catch(function(e){return l.reject(e)})):void 0}function a(a){var t="Marketplace"===a.title?"AppZone":a.title;m.license?void 0===a.permissions||a.permissions.association?void 0===a.license||m.license[a.license]?d.userProfileSection.get({userProfileId:m.userProfile.id,category:t}).$promise.then(function(e){var n=e&&e.rows&&0<e.rows.length?e.rows:[];if("Dashboards"===a.title)return _.isEmpty(n)?"disabled":n[0].autoAssociation?"full":d.userProfileResource.get({sectionId:n[0].id,resourceId:101}).$promise.then(function(e){return(e&&e.rows?e.rows[0]:null)?"full":"partial"});var t=_.filter(a.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e});return n.length!==t.length?0===n.length?"disabled":"partial":_.every(n,["autoAssociation",!0])?"full":g(_.filter(t,function(e){return void 0===e.permissions||e.permissions.association?e:void 0}),n,"partial")}).then(function(e){a.status=u(a,e)}).catch(function(e){var n=e?"unknown":"partial";a.status=u(a,n),e&&c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GETRESOURCES("+t.toUpperCase()+")",msg:e.status?JSON.stringify(e.data):e.toString()})}):a.status=u(a,"unlicensed"):d.userProfileSection.get({userProfileId:m.userProfile.id,sectionId:a.id}).$promise.then(function(e){var n=(e&&1===e.rows.length?e.rows[0]:null)?"full":"disabled";a.status=u(a,n)}):a.status=u(a,"unknown")}m.userProfile={},m.license={},m.navigation=e.getNavigation(),m.modules=m.navigation[0].children,m.statusList=[{id:0,name:"Fully Enabled",color:"green-A700-bg",info:"All resources enabled",tag:"full"},{id:1,name:"Partially Enabled",color:"orange-A700-bg",info:"Some resources enabled",tag:"partial"},{id:2,name:"Disabled",color:"grey-A400-bg",info:"No resources enabled",tag:"disabled"},{id:3,name:"Unlicensed",color:"red-A700-bg",info:"Module not included in the license",tag:"unlicensed"},{id:4,name:"Unknown",color:"grey-A700-bg",info:"Unknown status",tag:"unknown"}],m.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],m.init=function(e,n){m.userProfile=e,m.license=n},m.onChangeEnableAllResources=function(n){var e=void 0!==n.permissions&&!n.permissions.association,a="Marketplace"===n.title?"AppZone":n.title;if("Fully Enabled"!==n.status.name){var i=[];if(e)return i.push({category:a,sectionId:n.id,name:a,enabled:!0,crudPermissions:"red"}),d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){n.status=u(n,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})});var t=o.confirm({skipHide:!0}).title("Warning").textContent(r.instant("STAFF.PERMISSIONS_WARNING_ENABLE_ALL",{sectionName:r.instant(n.translate)})).ariaLabel("Warning").ok(r.instant("STAFF.CONFIRM")).cancel(r.instant("STAFF.CANCEL"));o.show(t).then(function(){switch(a){case"Dashboards":_.map(m.dashboardSections,function(e){i.push({category:a,sectionId:e.id,name:e.title,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})});break;default:_.map(n.children,function(e){var n=!(void 0===e.permissions||!e.permissions.hidden);if(!n){var t=e.title;switch(a){case"CallySquare":t="Projects"===t?"SquareProjects":t}i.push({category:a,sectionId:e.id,name:t,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})}})}return d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){n.status=u(n,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})})}).catch(function(e){e?c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()}):n.status=u(n,n.status.tag)})}else if("Fully Enabled"===n.status.name){n.status=u(n,"disabled");var s=[];switch(a){case"Settings":case"Help":s=[n.id];break;case"Dashboards":s=_.map(m.dashboardSections,function(e){return e.id});break;default:s=_.map(n.children,function(e){return e.id})}return d.userProfile.removeSections({id:m.userProfile.id,ids:s}).$promise.then(function(){c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.REMOVESECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},m.manageResources=function(e,n){o.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!1,locals:{userProfile:m.userProfile,userProfiles:[],section:e}}).then(function(){a(e)})},m.checkSectionResources=a}e.$inject=["$document","$mdDialog","$translate","$q","api","msNavigationService","Auth","toasty"],angular.module("app.staff").controller("UserProfilePermissionsController",e)}(),function(){"use strict";function e(n,t,i,o,r,e,a,l,s,d){var c=this;function m(){var a=void 0!==c.selectedSection.pending&&c.selectedSection.pending;return i(function(t,n){r.userProfileSection.get({userProfileId:c.userProfile.id,sectionId:c.selectedSection.id}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;a||(c.selectedSection.enabled=!!n&&!!n.enabled,c.selectedSection.autoAssociation=!!n&&!!n.autoAssociation,c.selectedSection.crudPermissions=v(n?n.crudPermissions:c.userProfile.crudPermissions)),t(n)}).catch(function(e){n(e)})})}function u(){return i(function(n,t){c.loadedSection?r.userProfileResource.get({sectionId:c.loadedSection.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)}):n(null)})}function p(){return i(function(n,t){void 0!==c.selectedSection.channel&&_.includes(c.selectedSection.route,"Queue")?i(function(n,t){var e=void 0!==c.selectedSection.channel&&"bull"===c.selectedSection.channel?"outbound":"inbound";return r[c.selectedSection.route].get({fields:"id,name,strategy,type",channel:"bull"===c.selectedSection.channel?"voice":c.selectedSection.channel,type:e,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){n(e)}).catch(function(e){t(e)}):i(function(n,t){var e,a;if("voiceExtension"===c.selectedSection.route)switch(c.selectedSection.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}if("user"===c.selectedSection.route)switch(c.selectedSection.title){case"Agents":a="agent";break;case"Telephones":a="telephone";break;case"Users":a="user"}if("interval"===c.selectedSection.route)var i=!0;if("disposition"===c.selectedSection.route)var s=!0;if("Reports"===c.selectedSection.title&&(c.selectedSection.route="default"===c.selectedSection.reportType?"analyticDefaultReport":"analyticCustomReport"),"Dashboards"!==c.selectedSection.title)return r[c.selectedSection.route].get({role:a||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:i?"null":void 0,MailAccountId:s?"null":void 0,FaxAccountId:s?"null":void 0,SmsAccountId:s?"null":void 0,OpenchannelAccountId:s?"null":void 0,ChatWebsiteId:s?"null":void 0,WhatsappAccountId:s?"null":void 0,ListId:s?"null":void 0,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)});n({count:1,rows:[{id:101,name:l.instant("DASHBOARDS.GENERAL")}]})}).then(function(e){n(e)}).catch(function(e){t(e)})})}function g(){var i=void 0!==c.selectedSection.pending&&c.selectedSection.pending,s=[];return u().then(function(e){var n;return s=e&&e.rows?e.rows:[],"Reports"===c.selectedSection.title&&(c.associatedReports=c.associatedReports?c.associatedReports:s,n=c.associatedReports,s=_.filter(n,{type:"default"===c.selectedSection.reportType?"DefaultReports":"CustomReports"})),void 0===c.selectedSection.permissions||c.selectedSection.permissions.association?p():{rows:[]}}).then(function(e){c.items=e.rows?_.map(e.rows,function(e){var n,t;return"Reports"===c.selectedSection.title&&(e.fullPath=(n=e.parent,t=c.treeStructure[0].text,t=function e(n,t,a){if(!a||_.isEmpty(a.children))return n;var a=_.find(a.children,function(e){return _.includes(t,e.id)?e:void 0});return n+=a?"/"+a.text:"",e(n,t,a)}(t,n,c.treeStructure[0])).replace(" ","_")),e.isValid=!0,e}):[],i||(c.selectedSection.selectedItems=_.map(s,function(e){return _.find(c.items,{id:e.resourceId})}));var n,t=_.differenceBy(c.selectedSection.selectedItems,c.items,"id");switch(_.isEmpty(t)||(c.selectedSection.selectedItems=_.pullAllBy(c.selectedSection.selectedItems,t,"id")),c.selectedSection.title){case"Contexts":c.selectedSection.selectedItems=_.filter(c.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(s,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"MusicOnHolds":c.selectedSection.selectedItems=_.filter(c.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(s,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"Reports":var a=(n=c.allReportsSelected,_.filter(n,function(e){return _.startsWith(e.parent,"default"===c.selectedSection.reportType?"motion":"custom")}));c.selectedSection.selectedItems=b(c.selectedSection.selectedItems),c.selectedSection.selectedItems=_.unionBy(c.selectedSection.selectedItems,a,"id")}c.dualMultiselectOptions.selectedItems=c.selectedSection.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.items,c.dualMultiselectOptions.selectedItems,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+c.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})}function v(e){return e&&(c.selectedSection.allowEdit=!!_.includes(e,"e"),c.selectedSection.allowDelete=!!_.includes(e,"d")),function(){var e=["r"];if(c.selectedSection.allowEdit)e.push("e");else{var n=_.indexOf(e,["e"]);0<n&&c.selectedSection.crudPermissions.replace("e","")}if(c.selectedSection.allowDelete)e.push("d");else{var n=_.indexOf(e,["d"]);0<n&&c.selectedSection.crudPermissions.replace("d","")}return e}()}function h(e){var n=_.findIndex(c.subsections,function(e){return e.id==c.selectedSection.id});c.subsections[n].pending=e,f()}function f(){return c.pendingChanges=_.some(c.subsections,["pending",!0])}function b(e){return _.remove(e,function(e){return _.startsWith(e.parent,"default"===c.selectedSection.reportType?"motion":"custom")})}function A(){_.isEmpty(c.selectedSection.selectedItems)?c.allReportsSelected=_.remove(c.allReportsSelected,function(e){return e.type===("default"===c.selectedSection.reportType?"CustomReports":"DefaultReports")}):c.selectedSection.selectedItems.forEach(function(e){_.some(c.allReportsSelected,{id:e.id,parent:e.parent})||c.allReportsSelected.push(e)})}c.userProfile=e,c.penalty=0,c.section=angular.copy(d),c.title=l.instant("STAFF.PERMISSIONS_SECTION_TITLE",{sectionName:l.instant(c.section.translate)}),c.items=[],c.selectedItems=[],c.subsections=_.filter(c.section.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e}),c.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],c.dashboardItems=[],"Dashboards"===c.section.title&&(c.dashboardItems=c.subsections,c.subsections=c.dashboardSections),c.selectedSection=null,c.loadedSection=null,c.allReportsSelected=[],c.closeDialog=function(e){if(c.pendingChanges){var n=t.confirm({skipHide:!0}).title("Warning").textContent(l.instant("STAFF.PERMISSIONS_WARNING_CLOSE")).ariaLabel("Warning").targetEvent(e).ok(l.instant("STAFF.CLOSE")).cancel(l.instant("STAFF.CANCEL"));t.show(n).then(function(){t.hide()})}else t.hide()},c.onChangeSection=function(){return m().then(function(e){if(c.loadedSection=e,"Reports"===c.selectedSection.title)return i(function(n,t){r.analyticTreeReport.get({}).$promise.then(function(e){c.treeReports=e.rows||[],n(c.treeReports)}).catch(function(e){t(e)})}).then(function(){if(!c.selectedSection.reportType)return u().then(function(e){c.allReportsSelected=e?_.map(e.rows,function(e){return{id:e.resourceId,name:e.name,type:e.type}}):[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREE_REPORT_STRUCTURE",msg:e.data?JSON.stringify(e.data):e.toString()})});g()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+c.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})},c.onChangeVisibility=function(){c.selectedSection.enabled=!c.selectedSection.enabled,h(!0)},c.onChangeAutoAssociation=function(){if(!c.selectedSection.autoAssociation){for(var e=[],n=0;n<c.dualMultiselectOptions.items.length;n++)e.push(c.dualMultiselectOptions.items[n]),c.dualMultiselectOptions.selectedItems.push(c.dualMultiselectOptions.items[n]);c.dualMultiselectOptions.items=[],c.dualMultiselectOptions.transferCallback(e,!1)}h(!0)},c.onChangeReportType=function(){c.treeStructure="default"===c.selectedSection.reportType?c.treeReports[0]?angular.fromJson(c.treeReports[0].tree):[]:c.treeReports[1]?angular.fromJson(c.treeReports[1].tree):[],c.selectedSection.selectedItems&&(c.allReportsSelected=b(c.allReportsSelected),A());g()},c.setPermission=function(e){"edit"===e?c.selectedSection.allowEdit=!c.selectedSection.allowEdit:"delete"===e&&(c.selectedSection.allowDelete=!c.selectedSection.allowDelete);c.selectedSection.crudPermissions=v(),h(!0)},c.saveSection=function(){var a="Marketplace"===c.section.title?"AppZone":c.section.title,e=_(c.subsections).filter({pending:!0}).map(function(e){var n="CallySquare"===a&&"Projects"===e.title?"SquareProjects":e.title,t="Reports"===n?c.allReportsSelected:e.selectedItems;return"Integrations"===a&&(e.autoAssociation=!0),{category:a,sectionId:e.id,name:n,enabled:e.enabled,autoAssociation:e.autoAssociation,crudPermissions:_.map(e.crudPermissions).join(""),Resources:_.map(t,function(e){return{name:e.name,resourceId:e.id,type:function(e,n){if("Reports"!==e)return e;{if(n.parent){var t=_.startsWith(n.parent,"motion")?"Default":"Custom";return t+e}return n.type}}(n,e)}})}}).value();return r.userProfile.addSections({id:c.userProfile.id},e).$promise.then(function(){c.subsections.forEach(function(e){e.pending=void 0}),c.associatedReports=null,f(),"Reports"!==c.selectedSection.title||c.selectedSection.reportType||n.userProfileForm.$setPristine(),o.success({title:l.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_TITLE",{sectionName:l.instant(a.translate)}),msg:l.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_MESSAGE")})}).then(function(){return m().then(function(e){c.loadedSection=e})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",line4:"fullPath",labelAll:l.instant("STAFF.PERMISSIONS_ALL_RESOURCES"),labelSelected:l.instant("STAFF.PERMISSIONS_SELECTED_RESOURCES"),transferCallback:function(e,n){h(!0),n?(c.selectedSection.selectedItems=_.pullAllBy(c.selectedSection.selectedItems,e,"id"),c.selectedSection.autoAssociation=!1):c.selectedSection.selectedItems=_.unionBy(c.selectedSection.selectedItems,e,"id"),"Reports"===c.selectedSection.title&&A()}}}e.$inject=["$scope","$mdDialog","$q","toasty","api","userProfile","userProfiles","$translate","Auth","section"],angular.module("app.staff").controller("UserProfilepermissionsmanageController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.userProfile=c||e.params.userProfile||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.permissionsmanagedialog=function(e,n){t.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.clonedialog=function(e,n){t.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoUserProfiles=function(){e.go("app.staff.userProfiles",{},{reload:"app.staff.userProfiles"})},u.saveUserProfile=function(){r.userProfile.update({id:u.userProfile.id},u.userProfile).$promise.then(function(){l.success({title:"UserProfile updated!",msg:u.userProfile.name?u.userProfile.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuserProfile",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","userProfile","userProfileSection"],angular.module("app.staff").controller("UserProfileController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.userProfiles=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="userProfiles",f.listOrder="",f.listOrderAsc=null,f.selectedUserProfiles=[],f.query={fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",sort:"-updatedAt",limit:10,page:1},f.arraycrudPermissions=_.keyBy([{option:"Read_permission",value:"'r'",disabled:!0},{option:"Edit_permission",value:"'e'"},{option:"Delete_permission",value:"'d'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.userProfiles&&0<f.userProfiles.count&&f.userProfiles.rows.forEach(function(e){var n=[];e.crudPermissions.forEach(function(e){n.push(f.arraycrudPermissions[e].option)});var t=[];n.forEach(function(e){t.push(r.instant("STAFF."+e.toUpperCase()))}),e.selectedcrudPermissions=t.join(", ")}),f.editstate=function(e,n){t.go("app.staff.userProfiles.edit",{id:e.id,userProfile:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:f.userProfiles?f.userProfiles.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("userProfile")+"?").htmlContent("<b>"+(e.name||"userProfile")+"</b> will be deleted.").ariaLabel("delete userProfile").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getUserProfiles=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.userProfile.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="UserProfiles",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditUserProfile=function(e,n){i.show({controller:"CreateOrEditUserProfileDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{userProfile:n,userProfiles:f.userProfiles.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteUserProfile=y,f.exportSelectedUserProfiles=function(){var e=angular.copy(f.selectedUserProfiles);return f.selectedUserProfiles=[],e},f.deleteSelectedUserProfiles=function(e){var n=i.confirm().title("Are you sure want to delete the selected userProfiles?").htmlContent("<b>"+f.selectedUserProfiles.length+" selected</b> will be deleted.").ariaLabel("delete UserProfiles").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedUserProfiles.forEach(function(e){y(e)}),f.selectedUserProfiles=[]})},f.deselectUserProfiles=function(){f.selectedUserProfiles=[]},f.selectAllUserProfiles=function(){f.selectedUserProfiles=f.userProfiles.rows};var b=!0,A=1;function E(e){f.userProfiles=e||{count:0,rows:[]}}function y(e){m.userProfile.delete({id:e.id}).$promise.then(function(){_.remove(f.userProfiles.rows,{id:e.id}),f.userProfiles.count-=1,f.userProfiles.rows.length||f.getUserProfiles(),p.success({title:_.startCase("UserProfile")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuserProfile"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuserProfile",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getUserProfiles())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","userProfiles","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("UserProfilesController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c){var m=this;function u(){return s.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.user=e})}function p(e){t.hide(e)}m.currentUser=o.getCurrentUser(),m.errors=[],m.setting=l,m.license=r,m.crudPermissions=d,m.hasModulePermissions={},m.passwordPattern=m.setting&&m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.title="STAFF.EDIT_USER",m.user=angular.copy(i),m.users=n,m.newUser=!1,m.user||(m.user={role:"user",autointernal:!0,context:"from-sip"},m.title="STAFF.NEW_USER",m.newUser=!0),m.addNewUser=function(){m.errors=[],s.user.save(m.user).$promise.then(function(e){m.users.unshift(e.toJSON()),a.success({title:"User properly created",msg:m.user.name?m.user.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveUser=function(){m.errors=[],s.user.update({id:m.user.id},m.user).$promise.then(function(e){var n=_.find(m.users,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"User properly saved!",msg:m.user.name?m.user.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteUser=function(e){if(o.getCurrentUser().id===m.user.id)return a.error({title:"User not deleted!",msg:"You can't remove yourself"});m.errors=[];var n=t.confirm().title("Are you sure?").content("The user will be deleted.").ariaLabel("Delete User").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){s.user.delete({id:m.user.id}).$promise.then(function(){_.remove(m.users,{id:m.user.id}),a.success({title:"User properly deleted!",msg:(m.user.name||"user")+" has been deleted!"}),p(m.user)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.closeDialog=p,s.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.userProfiles=e.rows||[]}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var g="user-setting:update:user-"+m.user.id;c.on(g,u),e.$on("$destroy",function(){c.removeListener(g,u)})}e.$inject=["$scope","$mdDialog","toasty","users","user","api","Auth","license","setting","crudPermissions","socket"],angular.module("app.staff").controller("CreateOrEditUserDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;function o(){e.hide()}s.currentUser=i.getCurrentUser(),s.errors=[],s.user=a,s.generateApiKey=function(){s.errors=[],t.user.createApiKey({id:s.user.id}).$promise.then(function(e){s.user.apiKey=e.api_key||"N/A",n.success({title:"User API key updated!"}),o()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.createApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.createApiKey"}]})},s.removeApiKey=function(){s.errors=[],t.user.removeApiKey({id:s.user.id}).$promise.then(function(){s.user.apiKey="N/A",n.success({title:"User API key removed!"}),o()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.removeApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.removeApiKey"}]})},s.closeDialog=o}e.$inject=["$mdDialog","toasty","api","user","Auth"],angular.module("app.staff").controller("UserapikeymanagerController",e)}(),function(){"use strict";function e(e,a){var i=this;i.user={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.user.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.user.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.user=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.user.id+"/avatar",i.user.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Userchange_avatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.user=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.user.id,newPassword:r.password};r.currentUser.id==r.user.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"User password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.user.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.userForm.password.$setValidity("oldPasswordMatch",!1):t.userForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","user","setting","Auth"],angular.module("app.staff").controller("UserchangepasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;m.currentUser=l.getCurrentUser(),m.license=i,m.setting=s,m.passwordPattern=m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.location=n.protocol()+"://"+n.host(),m.user=d||e.params.user||{},m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=l.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.hasModulePermissions={},m.selectedTab=e.params.tab||0,m.apikeymanagerdialog=function(e,n){t.show({controller:"UserapikeymanagerController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,users:m.users?m.users.rows:[],crudPermissions:m.crudPermissions}})},m.changepassworddialog=function(e,n){t.show({controller:"UserchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,setting:s,users:m.users?m.users.rows:[],crudPermissions:m.crudPermissions}})},m.alert=r.info,m.gotoUsers=function(){e.go("app.staff.users",{},{reload:"app.staff.users"})},m.saveUser=function(){m.user=_.omit(m.user,"userpic"),o.user.update({id:m.user.id},m.user).$promise.then(function(){r.success({title:"User updated!",msg:m.user.name?m.user.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.refreshUser=function(){return o.user.get({id:m.user.id,userSetting:!0}).$promise.then(function(e){m.user=e})},o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.userProfiles=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.user.getApiKey({id:m.user.id}).$promise.then(function(e){m.user.apiKey=e.api_key?e.api_key:"N/A"}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_APIKEY",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","user","userProfileSection"],angular.module("app.staff").controller("UserController",e)}(),function(){"use strict";function e(e,t,a,i,s,n,o,r,l,d,c,m,u,p){var g=this;g.license=m,g.setting=u,g.currentUser=c.getCurrentUser(),g.users=n||{count:0,rows:[]},g.userProfile=o,g.userProfileSection=r&&1==r.count?r.rows[0]:null,g.crudPermissions=c.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.table="users",g.listOrder="",g.listOrderAsc=null,g.selectedUsers=[],g.query={fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled",role:"admin,user",userSetting:!0,sort:"-updatedAt",limit:10,page:1},g.arrayrole=_.keyBy([{option:"Admin",value:"'admin'"},{option:"User",value:"'user'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.editstate=function(e,n){t.go("app.staff.users.edit",{id:e.id,user:e,crudPermissions:g.crudPermissions})},g.deleteconfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the "+_.startCase("user")+"?").htmlContent("<b>"+(e.name||"user")+"</b> will be deleted.").ariaLabel("delete user").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){A(e)},function(){console.log("CANCEL")})},g.success=f,g.getUsers=b,g.createOrEditUser=function(e,n){a.show({controller:"CreateOrEditUserDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{user:n,users:g.users.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}})},g.deleteUser=A,g.exportSelectedUsers=function(){var e=angular.copy(g.selectedUsers);return g.selectedUsers=[],e},g.deleteSelectedUsers=function(e){var n=a.confirm().title("Are you sure want to delete the selected users?").htmlContent("<b>"+g.selectedUsers.length+" selected</b> will be deleted.").ariaLabel("delete Users").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){g.selectedUsers.forEach(function(e){A(e)}),g.selectedUsers=[]})},g.deselectUsers=function(){g.selectedUsers=[]},g.selectAllUsers=function(){g.selectedUsers=g.users.rows},l.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.userProfiles=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=!0,h=1;function f(e){g.users=e||{count:0,rows:[]}}function b(){g.query.offset=(g.query.page-1)*g.query.limit,c.hasRole("admin")?g.promise=l.user.get(g.query,f).$promise:(g.query.id=g.userProfile.id,g.query.section="Users",g.promise=l.userProfile.getResources(g.query,f).$promise)}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(g.users.rows,{id:e.id}),g.users.count-=1,g.users.rows.length||g.getUsers(),d.success({title:_.startCase("User")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){v?s(function(){v=!1}):(n||(h=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=h),g.getUsers())}),p.on("user-setting:update",b),e.$on("$destroy",function(){p.removeListener("user-setting:update",b)})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","users","userProfile","userProfileSection","api","toasty","Auth","license","setting","socket"],angular.module("app.staff").controller("UsersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.cannedAnswers=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="cannedAnswers",f.listOrder="",f.listOrderAsc=null,f.selectedCannedAnswers=[],f.query={fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{cannedAnswer:e,cannedAnswers:f.cannedAnswers.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("cannedAnswer")+"?").htmlContent("<b>"+(e.name||"cannedAnswer")+"</b> will be deleted.").ariaLabel("delete cannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCannedAnswers=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cannedAnswer.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="CannedAnswers",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCannedAnswer=function(e,n){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{cannedAnswer:n,cannedAnswers:f.cannedAnswers.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCannedAnswer=y,f.exportSelectedCannedAnswers=function(){var e=angular.copy(f.selectedCannedAnswers);return f.selectedCannedAnswers=[],e},f.deleteSelectedCannedAnswers=function(e){var n=i.confirm().title("Are you sure want to delete the selected cannedAnswers?").htmlContent("<b>"+f.selectedCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete CannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCannedAnswers.forEach(function(e){y(e)}),f.selectedCannedAnswers=[]})},f.deselectCannedAnswers=function(){f.selectedCannedAnswers=[]},f.selectAllCannedAnswers=function(){f.selectedCannedAnswers=f.cannedAnswers.rows};var b=!0,A=1;function E(e){f.cannedAnswers=e||{count:0,rows:[]}}function y(e){m.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(f.cannedAnswers.rows,{id:e.id}),f.cannedAnswers.count-=1,f.cannedAnswers.rows.length||f.getCannedAnswers(),p.success({title:_.startCase("CannedAnswer")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcannedAnswer"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcannedAnswer",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCannedAnswers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","cannedAnswers","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("CannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CANNEDANSWER",g.cannedAnswer=angular.copy(l),g.cannedAnswers=r,g.newCannedAnswer=!1,g.cannedAnswer||(g.cannedAnswer={},g.title="TOOLS.NEW_CANNEDANSWER",g.newCannedAnswer=!0),g.addNewCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.cannedAnswer).$promise.then(function(e){g.cannedAnswers.unshift(e.toJSON()),o.success({title:"CannedAnswer properly created",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.cannedAnswer.id},g.cannedAnswer).$promise.then(function(e){var n=_.find(g.cannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CannedAnswer properly saved!",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The cannedAnswer will be deleted.").ariaLabel("Delete CannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.cannedAnswer.id}).$promise.then(function(){_.remove(g.cannedAnswers,{id:g.cannedAnswer.id}),o.success({title:"CannedAnswer properly deleted!",msg:(g.cannedAnswer.name||"cannedAnswer")+" has been deleted!"}),v(g.cannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","cannedAnswers","cannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CUSTOMDASHBOARD",g.customDashboard=angular.copy(l),g.customDashboards=r,g.newCustomDashboard=!1,g.customDashboard||(g.customDashboard={},g.title="TOOLS.NEW_CUSTOMDASHBOARD",g.newCustomDashboard=!0),g.addNewCustomDashboard=function(){g.errors=[],d.dashboard.save(g.customDashboard).$promise.then(function(e){g.customDashboards.unshift(e.toJSON()),o.success({title:"CustomDashboard properly created",msg:g.customDashboard.name?g.customDashboard.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomDashboard=function(){g.errors=[],d.dashboard.update({id:g.customDashboard.id},g.customDashboard).$promise.then(function(e){var n=_.find(g.customDashboards,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CustomDashboard properly saved!",msg:g.customDashboard.name?g.customDashboard.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomDashboard=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The customDashboard will be deleted.").ariaLabel("Delete CustomDashboard").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.dashboard.delete({id:g.customDashboard.id}).$promise.then(function(){_.remove(g.customDashboards,{id:g.customDashboard.id}),o.success({title:"CustomDashboard properly deleted!",msg:(g.customDashboard.name||"customDashboard")+" has been deleted!"}),v(g.customDashboard)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customDashboards","customDashboard","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCustomDashboardDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.customDashboards=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="customDashboards",f.listOrder="",f.listOrderAsc=null,f.selectedCustomDashboards=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.tools.customDashboards.edit",{id:e.id,customDashboard:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:f.customDashboards?f.customDashboards.rows:[],crudPermissions:f.crudPermissions}})},f.gotodashboardgoto=function(e,n){t.go("app.dashboards.custom",{id:e.id})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("customDashboard")+"?").htmlContent("<b>"+(e.name||"customDashboard")+"</b> will be deleted.").ariaLabel("delete customDashboard").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCustomDashboards=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.dashboard.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="CustomDashboards",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCustomDashboard=function(e,n){i.show({controller:"CreateOrEditCustomDashboardDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{customDashboard:n,customDashboards:f.customDashboards.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCustomDashboard=y,f.exportSelectedCustomDashboards=function(){var e=angular.copy(f.selectedCustomDashboards);return f.selectedCustomDashboards=[],e},f.deleteSelectedCustomDashboards=function(e){var n=i.confirm().title("Are you sure want to delete the selected customDashboards?").htmlContent("<b>"+f.selectedCustomDashboards.length+" selected</b> will be deleted.").ariaLabel("delete CustomDashboards").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCustomDashboards.forEach(function(e){y(e)}),f.selectedCustomDashboards=[]})},f.deselectCustomDashboards=function(){f.selectedCustomDashboards=[]},f.selectAllCustomDashboards=function(){f.selectedCustomDashboards=f.customDashboards.rows};var b=!0,A=1;function E(e){f.customDashboards=e||{count:0,rows:[]}}function y(e){m.dashboard.delete({id:e.id}).$promise.then(function(){_.remove(f.customDashboards.rows,{id:e.id}),f.customDashboards.count-=1,f.customDashboards.rows.length||f.getCustomDashboards(),p.success({title:_.startCase("CustomDashboard")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdashboard"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCustomDashboards())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","customDashboards","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("CustomDashboardsController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newCustomDashboard=!0,r.customDashboard=angular.copy(i),r.customDashboards=s,r.title=o.instant("TOOLS.CLONE_CUSTOMDASHBOARD"),i&&i.name&&(r.title+=": "+i.name),r.cloneCustomDashboard=function(){return e.dashboard.clone({id:i.id,includeAll:!0},r.customDashboard).$promise.then(function(e){r.customDashboards.unshift(e.toJSON()),a.success({title:"CustomDashboard properly cloned",msg:r.customDashboard.name?r.customDashboard.name+" has been cloned!":""}),t.go("app.tools.customDashboards.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","customDashboard","customDashboards","$translate"],angular.module("app.tools").controller("CustomDashboardcloneController",e)}(),function(){"use strict";function e(t,a,e,i,s){var o=this;function r(e,n,t){return s.dashboardItem.update(t).$promise.catch(function(e){console.error(e)})}o.customDashboard={},o.voiceQueues=s.rpc.getVoiceQueues({fields:"id,name"}),s.smsAccount.get({fields:"id,name"}).$promise.then(function(e){o.smsAccounts=e||{count:0,rows:[]}}),s.faxAccount.get({fields:"id,name"}).$promise.then(function(e){o.faxAccounts=e||{count:0,rows:[]}}),s.mailAccount.get({fields:"id,name"}).$promise.then(function(e){o.mailAccounts=e||{count:0,rows:[]}}),s.openchannelAccount.get({fields:"id,name"}).$promise.then(function(e){o.openchannelAccounts=e||{count:0,rows:[]}}),s.whatsappAccount.get({fields:"id,name"}).$promise.then(function(e){o.whatsappAccounts=e||{count:0,rows:[]}}),s.chatWebsite.get({fields:"id,name"}).$promise.then(function(e){o.chatWebsites=e||{count:0,rows:[]}}),o.init=function(e,n){return o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},o.customDashboard=e,o.customDashboard.draggable={enabled:!0,handle:".draggable",stop:r},o.customDashboard.resizable={enabled:!0,handle:".resizable",stop:r},o.customDashboard.widgets=[],s.dashboard.getItems({id:e.id}).$promise.then(function(e){if(e&&e.count&&e.rows)for(var n=0;n<e.rows.length;n+=1)e.rows[n].voiceQueues=o.voiceQueues,e.rows[n].voiceQueuesSelected=_.map(o.voiceQueues.rows,"id"),e.rows[n].smsAccounts=o.smsAccounts,e.rows[n].smsAccountsSelected=_.map(o.smsAccounts.rows,"id"),e.rows[n].faxAccounts=o.faxAccounts,e.rows[n].faxAccountsSelected=_.map(o.faxAccounts.rows,"id"),e.rows[n].mailAccounts=o.mailAccounts,e.rows[n].mailAccountsSelected=_.map(o.mailAccounts.rows,"id"),e.rows[n].openchannelAccounts=o.openchannelAccounts,e.rows[n].openchannelAccountsSelected=_.map(o.openchannelAccounts.rows,"id"),e.rows[n].chatWebsites=o.chatWebsites,e.rows[n].chatWebsitesSelected=_.map(o.chatWebsites.rows,"id"),e.rows[n].whatsappAccounts=o.whatsappAccounts,e.rows[n].whatsappAccountsSelected=_.map(o.whatsappAccounts.rows,"id"),e.rows[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[n].type+"/ms-widget-engine."+e.rows[n].type+".html",o.customDashboard.widgets.push(e.rows[n])}).catch(function(e){console.error(e)})},o.createOrEditWidget=function(e){if(e&&e.attrs)for(var n=0;n<e.attrs.length;n+=1)"attrReport"===e.attrs[n].name&&(e.reportType=e.attrs[n].type),e[e.attrs[n].name]=e.attrs[n].value;t.show({controller:"CreateOrEditDashboardItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",parent:angular.element(a.body),clickOutsideToClose:!0,locals:{dashboarditem:e,dashboard:o.customDashboard.widgets,license:null,setting:null,crudPermissions:o.crudPermissions}}).then(function(e){if(e)for(var n=0;n<o.customDashboard.widgets.length;n+=1)o.customDashboard.widgets[n].id===e.id&&(o.customDashboard.widgets[n].attrs=e.attrs,o.customDashboard.widgets[n].voiceQueues=o.voiceQueues,o.customDashboard.widgets[n].voiceQueuesSelected=_.map(o.voiceQueues.rows,"id"),o.customDashboard.widgets[n].smsAccounts=o.smsAccounts,o.customDashboard.widgets[n].smsAccountsSelected=_.map(o.smsAccounts.rows,"id"),o.customDashboard.widgets[n].faxAccounts=o.faxAccounts,o.customDashboard.widgets[n].faxAccountsSelected=_.map(o.faxAccounts.rows,"id"),o.customDashboard.widgets[n].mailAccounts=o.mailAccounts,o.customDashboard.widgets[n].mailAccountsSelected=_.map(o.mailAccounts.rows,"id"),o.customDashboard.widgets[n].openchannelAccounts=o.openchannelAccounts,o.customDashboard.widgets[n].openchannelAccountsSelected=_.map(o.openchannelAccounts.rows,"id"),o.customDashboard.widgets[n].chatWebsites=o.chatWebsites,o.customDashboard.widgets[n].chatWebsitesSelected=_.map(o.chatWebsites.rows,"id"),o.customDashboard.widgets[n].whatsappAccounts=o.whatsappAccounts,o.customDashboard.widgets[n].whatsappAccountsSelected=_.map(o.whatsappAccounts.rows,"id"),o.customDashboard.widgets[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+o.customDashboard.widgets[n].type+"/ms-widget-engine."+o.customDashboard.widgets[n].type+".html")})},o.deleteWidget=function(n){var e=t.confirm().title("Would you like to delete "+n.title+"?").textContent("").ariaLabel("Delete Widget").ok("YES").cancel("NO");t.show(e).then(function(){return s.dashboardItem.delete({id:n.id}).$promise.then(function(e){_.remove(o.customDashboard.widgets,{id:n.id}),i.success({title:"Widget deleted!",msg:n.name?n.name+" has been deleted!":"Widget has been deleted!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","socket","toasty","api"],angular.module("app.tools").controller("CustomDashboardItemsController",e)}(),function(){"use strict";function e(n,e,t,a,o,i,s,r,l,d,c,m,u,p){var g=this;g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_DASHBOARDITEM",g.dashboarditem=angular.copy(l),g.dashboard=r,g.newDashboardItem=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.dashboarditem?"web-report"==g.dashboarditem.type&&(g.apiName="custom"===g.dashboarditem.reportType?"analyticCustomReport":"analyticDefaultReport",d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:g.dashboarditem.attrReport}),g.dashboarditem.report=g.currentReport.name,g.query.parent=g.currentReport.parent})):(g.dashboarditem={type:"counter",attrChannel:"voice",titleFontSize:12,attrUrl:"https://",attrHourFormat:"HH:mm:ss",attrTimezone:"0.00",attrMetric:"total",attrSerie1:"total",attrSerie2:"null",attrSerie3:"null",attrRefresh:10,attrFontSize:20,foreground:"#2196f3",background:"#ffffff"},g.title="TOOLS.NEW_DASHBOARDITEM",g.newDashboardItem=!0),g.addNewDashboardItem=function(){g.errors=[],d.dashboard.addItem({id:e.params.id},g.dashboarditem).$promise.then(function(e){g.dashboard.unshift(e.toJSON()),s.success({title:"DashboardItem properly created",msg:g.dashboarditem.name?g.dashboarditem.name+" has been created!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.save"}];for(var n=0;n<e.data.errors.length;n+=1)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDashboardItem=function(){g.errors=[],d.dashboardItem.update({id:g.dashboarditem.id},g.dashboarditem).$promise.then(function(e){var n=_.find(g.dashboard,{id:e.id});n&&_.merge(n,e.toJSON()),s.success({title:"DashboardItem properly saved!",msg:g.dashboarditem.name?g.dashboarditem.name+" has been saved!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDashboardItem=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The dashboarditem will be deleted.").ariaLabel("Delete DashboardItem").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.dashboardItem.delete({id:g.dashboarditem.id}).$promise.then(function(){_.remove(g.dashboard,{id:g.dashboarditem.id}),s.success({title:"DashboardItem properly deleted!",msg:(g.dashboarditem.name||"dashboarditem")+" has been deleted!"}),I(g.dashboarditem)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.delete"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.getReports=S,g.selectReport=function(){if(g.dashboarditem.report=g.selectedReport[0].name,g.dashboarditem.attrReport=g.selectedReport[0].id,g.dashboarditem.reportType=g.currentNode.custom?"custom":"default",!g.newDashboardItem){var e={name:"attrReport",type:g.dashboarditem.reportType,value:g.selectedReport[0].id};g.dashboarditem.attrs.splice(_.findIndex(g.dashboarditem.attrs,1,e))}n.dashboarditemForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.onTypeChange=function(){["web-report","iframe","clock","custom"].includes(g.dashboarditem.type)&&(g.dashboarditem.attrEmailAccounts=null,g.dashboarditem.attrFaxAccounts=null,g.dashboarditem.attrSmsAccounts=null,g.dashboarditem.attrOpenchannelAccounts=null,g.dashboarditem.attrWhatsappAccounts=null,g.dashboarditem.attrChatWebsites=null)},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(n={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,n}).catch(function(e){s.error({title:"ERROR",msg:e.message})}):n),g.treeDefaultEvents=f(!1),g.treeCustomEvents=f(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var n},g.closeDialog=I,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],h=null;function f(e){return e?{loaded:E,select_node:b}:{loaded:y,select_node:A}}function b(e,n){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=n.node.id,S()}function A(e,n){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=n.node.id,S()}function E(){if(!g.newDashboardItem&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(!g.newDashboardItem&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);A(0,{node:e,selected:e.id})}}function S(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,T).$promise;else{if(!g.userProfileSection)return T(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,T).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),T({count:t.length,rows:t})}return T(null)}):T(null)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function T(e){g.reports=e||{count:0,rows:[]},g.newDashboardItem||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function I(e){a.hide(e)}c.hasRole("admin")?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){g.voiceQueues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){h=e.rows||[]}).then(function(){for(var e=[],n=0;n<v.length;n++)e.push(d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:v[n].id}).$promise);return o.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<v.length;a++){var i=_.find(n,["sectionId",v[a].id]);if(i)if(i.autoAssociation){var s=[];h.forEach(function(e){e.type===v[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(t)}).then(function(e){var n=[],t=null;g.dashboarditem&&(t=_.find(h,{id:Number(g.dashboarditem.attrVoiceQueues)}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){n.push(e)})}t&&!_.some(n,["resourceId",t.id])&&h.forEach(function(e){e.id===t.id&&(e.canSelect=!1,n.push(e))}),g.voiceQueues=n}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.mailAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.mailAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:MailAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.mailAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.mailAccount,{id:Number(g.dashboarditem.attrEmailAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.mailAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.mailAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.mailAccount,{id:Number(g.dashboarditem.attrEmailAccounts)}));for(var i=0;i<g.mailAccount.length;i++)a&&g.mailAccount[i].id===a.id&&(g.mailAccount[i].canSelect=!1,t.push(g.mailAccount[i]));g.mailAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.faxAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.faxAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.faxAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.faxAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:FaxAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.faxAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.faxAccount,{id:Number(g.dashboarditem.attrFaxAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.faxAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.faxAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.faxAccount,{id:Number(g.dashboarditem.attrFaxAccounts)}));for(var i=0;i<g.faxAccount.length;i++)a&&g.faxAccount[i].id===a.id&&(g.faxAccount[i].canSelect=!1,t.push(g.faxAccount[i]));g.faxAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.smsAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.smsAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.smsAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.smsAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:SmsAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.smsAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.smsAccount,{id:Number(g.dashboarditem.attrSmsAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.smsAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.smsAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.smsAccount,{id:Number(g.dashboarditem.attrSmsAccounts)}));for(var i=0;i<g.smsAccount.length;i++)a&&g.smsAccount[i].id===a.id&&(g.smsAccount[i].canSelect=!1,t.push(g.smsAccount[i]));g.smsAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.openchannelAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.openchannelAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.openchannelAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.openchannelAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:OpenchannelAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.openchannelAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.openchannelAccount,{id:Number(g.dashboarditem.attrOpenchannelAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.openchannelAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.openchannelAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.openchannelAccount,{id:Number(g.dashboarditem.attrOpenchannelAccounts)}));for(var i=0;i<g.openchannelAccount.length;i++)a&&g.openchannelAccount[i].id===a.id&&(g.openchannelAccount[i].canSelect=!1,t.push(g.openchannelAccount[i]));g.openchannelAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.whatsappAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.whatsappAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_WHATSAPPACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.whatsappAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.whatsappAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:WhatsappAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.whatsappAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.whatsappAccount,{id:Number(g.dashboarditem.attrWhatsappAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.whatsappAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.whatsappAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.whatsappAccount,{id:Number(g.dashboarditem.attrWhatsappAccounts)}));for(var i=0;i<g.whatsappAccount.length;i++)a&&g.whatsappAccount[i].id===a.id&&(g.whatsappAccount[i].canSelect=!1,t.push(g.whatsappAccount[i]));g.whatsappAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.chatWebsite.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.chatWebsite=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATWEBSITE",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.chatWebsite.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.chatWebsite=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:ChatWebsites}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.chatWebsite,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.chatWebsite,{id:Number(g.dashboarditem.attrChatWebsites)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.chatWebsite,{id:t.id});a.canSelect=!1,n.push(a)}g.chatWebsite=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.chatWebsite,{id:Number(g.dashboarditem.attrChatWebsites)}));for(var i=0;i<g.chatWebsite.length;i++)a&&g.chatWebsite[i].id===a.id&&(g.chatWebsite[i].canSelect=!1,t.push(g.chatWebsite[i]));g.chatWebsite=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dashboard","dashboarditem","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditDashboardItemDialogController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.customDashboard=c||t.params.customDashboard||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){a.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:u.customDashboards?u.customDashboards.rows:[],crudPermissions:u.crudPermissions}})},u.gotogoto=function(e,n){t.go("app.dashboards.custom",{id:e.id})},u.alert=l.info,u.gotoCustomDashboards=function(){t.go("app.tools.customDashboards",{},{reload:"app.tools.customDashboards"})},u.saveCustomDashboard=function(){r.dashboard.update({id:u.customDashboard.id},u.customDashboard).$promise.then(function(){l.success({title:"CustomDashboard updated!",msg:u.customDashboard.name?u.customDashboard.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdashboard",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","customDashboard","userProfileSection"],angular.module("app.tools").controller("CustomDashboardController",e)}(),function(){"use strict";function e(a,i,o,r,e,l,d,n,t,s,c){var m=this;if(m.currentUser=n.getCurrentUser(),m.disposition=angular.copy(e),m.setting=c,m.license=s,m.crudPermissions=t,m.newDisposition=!1,m.errors=[],m.disposition||(m.disposition={level:"first"},m.newDisposition=!0),l){var u=l.field;m.disposition[u]=l.id}function p(){return o(function(t,n){d.disposition.get({fields:"id,name,level,ParentId",sort:"id",nolimit:"true"}).$promise.then(function(e){var n=e.rows||[];return t(n)}).catch(function(e){n(e)})})}function g(e){"first"===e.level?m.firstLevelDisposition=e:(m.anySecondLevelDisposition=!0,m.secondLevelDisposition=e,m.firstLevelDisposition=_.find(m.dispositions,["id",m.secondLevelDisposition.ParentId]),m.firstLevelDisposition||p().then(function(){m.firstLevelDisposition=_.find(m.allDispositions,["id",m.secondLevelDisposition.ParentId]),m.firstLevelDisposition.canSelect=!1,m.dispositions.push(m.firstLevelDisposition)}))}function v(e){a.hide(e)}m.onInit=function(){var n="disposition";l?n=l.route:"user"===m.currentUser.role&&(n="userProfile");var t="get";l?t="getDispositions":"user"===m.currentUser.role&&(t="getResources");var e={fields:"id,name,level,ParentId",id:l?l.id:void 0,section:"user"===m.currentUser.role?"Dispositions":void 0,MailAccountId:l?void 0:"null",FaxAccountId:l?void 0:"null",SmsAccountId:l?void 0:"null",OpenchannelAccountId:l?void 0:"null",ChatWebsiteId:l?void 0:"null",WhatsappAccountId:l?void 0:"null",ListId:l?void 0:"null",sort:"id",nolimit:"true"};(a=n,i=t,s=e,o(function(t,n){d[a][i](s).$promise.then(function(e){var n=e.rows||[];return t(n)}).catch(function(e){n(e)})})).then(function(e){m.dispositions=angular.copy(e),m.newDisposition||function(){if("first"===m.disposition.level)return;if(m.parentDisposition=_.find(m.dispositions,["id",m.disposition.ParentId]),!m.parentDisposition)return p().then(function(e){m.allDispositions=e;for(var n=0;n<m.allDispositions.length;n++){var t=m.allDispositions[n];if(t.id===m.disposition.ParentId){g(t),t.canSelect=!1,m.dispositions.push(t);break}}});g(m.parentDisposition)}()}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:["api",n,t].join(":"),msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});var a,i,s},m.onFirstLevelSelection=function(){m.secondLevelDisposition=void 0,m.anySecondLevelDisposition=_.some(m.dispositions,function(e){return e.ParentId===m.firstLevelDisposition.id&&e.id!=m.disposition.id})},m.addNewDisposition=function(){m.errors=[],m.secondLevelDisposition?(m.disposition.ParentId=m.secondLevelDisposition.id,m.disposition.level="third"):m.firstLevelDisposition&&(m.disposition.ParentId=m.firstLevelDisposition.id,m.disposition.level="second");d.disposition.save(m.disposition).$promise.then(function(e){m.dispositions.unshift(e.toJSON()),r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_CREATED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var n=0;n<e.data.errors.length;n+=1)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDisposition=function(){m.errors=[],m.secondLevelDisposition?(m.disposition.ParentId=m.secondLevelDisposition.id,m.disposition.level="third"):m.firstLevelDisposition&&(m.disposition.ParentId=m.firstLevelDisposition.id,m.disposition.level="second");d.disposition.update({id:m.disposition.id},m.disposition).$promise.then(function(e){var n=_.find(m.dispositions,{id:e.id});n&&_.merge(n,e.toJSON()),r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_SAVED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var n=0;n<e.data.errors.length;n++)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDisposition=function(e){m.errors=[];var n=_.some(m.dispositions,["ParentId",m.disposition.id]),t=a.confirm({skipHide:!0}).title(i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(i.instant("TOOLS.NOTIFICATIONS."+(n?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:m.disposition.name})).ariaLabel("Delete disposition").ok(i.instant("TOOLS.DELETE")).cancel(i.instant("TOOLS.CANCEL")).targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:m.disposition.id}).$promise.then(function(){r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var n=0;n<e.data.errors.length;n++)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.clearSelection=function(e){"first"===e?(m.firstLevelDisposition=void 0,m.secondLevelDisposition=void 0,m.anySecondLevelDisposition=!1):m.secondLevelDisposition=void 0},m.closeDialog=v}e.$inject=["$mdDialog","$translate","$q","toasty","disposition","model","api","Auth","crudPermissions","license","setting"],angular.module("app.tools").controller("CreateOrEditDispositionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this;function f(e){h.dispositions=e||{count:0,rows:[]}}function b(){h.query.offset=(h.query.page-1)*h.query.limit,p.isAdmin()?h.promise=m.disposition.get(h.query,f).$promise:(h.query.id=h.userProfile.id,h.query.section="Dispositions",h.promise=m.userProfile.getResources(h.query,f).$promise)}function A(e){m.disposition.delete({id:e.id}).$promise.then(function(){b(),u.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){h.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)u.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else u.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}h.license=g,h.setting=v,h.currentUser=p.getCurrentUser(),h.dispositions=l||{count:0,rows:[]},h.userProfile=d,h.userProfileSection=c&&1==c.count?c.rows[0]:null,h.crudPermissions=p.parseCrudPermissions(h.userProfileSection?h.userProfileSection.crudPermissions:null),h.selectedDispositions=[],h.levels={first:"1st",second:"2nd",third:"3rd"},h.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,page:1},h.deleteconfirm=function(e,n){var t=_.some(h.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){A(e)})},h.success=f,h.getDispositions=b,h.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:null,license:h.license,setting:h.setting,crudPermissions:h.crudPermissions}}).then(function(e){!0===e&&b()})},h.deleteDisposition=A,h.exportSelectedDispositions=function(){var e=angular.copy(h.selectedDispositions);return h.selectedDispositions=[],e},h.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:h.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){h.selectedDispositions.forEach(function(e){A(e)}),h.selectedDispositions=[]})},h.deselectDispositions=function(){h.selectedDispositions=[]},h.selectAllDispositions=function(){h.selectedDispositions=h.dispositions.rows};var E=!0,y=1;e.$watch("vm.query.filter",function(e,n){E?o(function(){E=!1}):(n||(y=h.query.page),e!==n&&(h.query.page=1),e||(h.query.page=y),b())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dispositions","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.tools").controller("DispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var n=_.find(g.intervals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditAppintervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.intervalIntervals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.interval.getIntervals(m.query,u).$promise}function g(e){d.interval.delete({id:e.id}).$promise.then(function(){_.remove(m.intervalIntervals.rows,{id:e.id}),m.intervalIntervals.count-=1,m.intervalIntervals.rows.length||p(),l.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETinterval"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.interval={},m.intervalIntervals={count:0,rows:[]},m.selectedIntervalIntervals=[],m.crudPermissions,m.sortableTable={animation:100,onSort:function(e){d.interval.addIntervals({id:m.interval.id},e.models).$promise.then(function(e){m.intervalIntervals.rows=e}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SORTABLETABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})}},m.query={fields:"createdAt,updatedAt,id,name,interval",nolimit:"true",limit:10,page:1},m.init=function(e,n){m.interval=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.sortableTable.disabled=!m.crudPermissions.canEdit,m.query.id=m.interval.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interval #")+e.id||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIntervalIntervals=p,m.createOrEditIntervalInterval=function(e,n){o.show({controller:"EditAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:m.interval,interval:n,intervals:m.intervalIntervals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIntervalIntervals=function(){var e=angular.copy(m.selectedIntervalIntervals);return m.selectedIntervalIntervals=[],e},m.deleteIntervalInterval=g,m.deleteSelectedIntervalIntervals=function(e){var n=o.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+m.selectedIntervalIntervals.length+" selected</b> will be deleted.").ariaLabel("delete intervals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIntervalIntervals.forEach(function(e){g(e)}),m.selectedIntervalIntervals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("IntervalIntervalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var n=_.find(g.intervals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.interval=c||e.params.interval||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoIntervals=function(){e.go("app.tools.intervals",{},{reload:"app.tools.intervals"})},u.saveInterval=function(){r.interval.update({id:u.interval.id},u.interval).$promise.then(function(){l.success({title:"Interval updated!",msg:u.interval.name?u.interval.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","interval","userProfileSection"],angular.module("app.tools").controller("IntervalController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.intervals=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="intervals",f.listOrder="",f.listOrderAsc=null,f.selectedIntervals=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,page:1},f.editstate=function(e,n){t.go("app.tools.intervals.edit",{id:e.id,interval:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("interval")+"?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getIntervals=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.interval.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Intervals",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditInterval=function(e,n){i.show({controller:"CreateOrEditIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:n,intervals:f.intervals.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteInterval=y,f.exportSelectedIntervals=function(){var e=angular.copy(f.selectedIntervals);return f.selectedIntervals=[],e},f.deleteSelectedIntervals=function(e){var n=i.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+f.selectedIntervals.length+" selected</b> will be deleted.").ariaLabel("delete Intervals").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedIntervals.forEach(function(e){y(e)}),f.selectedIntervals=[]})},f.deselectIntervals=function(){f.selectedIntervals=[]},f.selectAllIntervals=function(){f.selectedIntervals=f.intervals.rows};var b=!0,A=1;function E(e){f.intervals=e||{count:0,rows:[]}}function y(e){m.interval.delete({id:e.id}).$promise.then(function(){_.remove(f.intervals.rows,{id:e.id}),f.intervals.count-=1,f.intervals.rows.length||f.getIntervals(),p.success({title:_.startCase("Interval")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEinterval"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getIntervals())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","intervals","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("IntervalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_PAUSE",g.pause=angular.copy(l),g.pauses=r,g.newPause=!1,g.pause||(g.pause={},g.title="TOOLS.NEW_PAUSE",g.newPause=!0),g.addNewPause=function(){g.errors=[],d.pause.save(g.pause).$promise.then(function(e){g.pauses.unshift(e.toJSON()),o.success({title:"Pause properly created",msg:g.pause.name?g.pause.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePause=function(){g.errors=[],d.pause.update({id:g.pause.id},g.pause).$promise.then(function(e){var n=_.find(g.pauses,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Pause properly saved!",msg:g.pause.name?g.pause.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePause=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The pause will be deleted.").ariaLabel("Delete Pause").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.pause.delete({id:g.pause.id}).$promise.then(function(){_.remove(g.pauses,{id:g.pause.id}),o.success({title:"Pause properly deleted!",msg:(g.pause.name||"pause")+" has been deleted!"}),v(g.pause)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","pauses","pause","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditPauseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.pauses=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="pauses",f.listOrder="",f.listOrderAsc=null,f.selectedPauses=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{pause:e,pauses:f.pauses.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("pause")+"?").htmlContent("<b>"+(e.name||"pause")+"</b> will be deleted.").ariaLabel("delete pause").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getPauses=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.pause.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Pauses",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditPause=function(e,n){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{pause:n,pauses:f.pauses.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletePause=y,f.exportSelectedPauses=function(){var e=angular.copy(f.selectedPauses);return f.selectedPauses=[],e},f.deleteSelectedPauses=function(e){var n=i.confirm().title("Are you sure want to delete the selected pauses?").htmlContent("<b>"+f.selectedPauses.length+" selected</b> will be deleted.").ariaLabel("delete Pauses").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedPauses.forEach(function(e){y(e)}),f.selectedPauses=[]})},f.deselectPauses=function(){f.selectedPauses=[]},f.selectAllPauses=function(){f.selectedPauses=f.pauses.rows};var b=!0,A=1;function E(e){f.pauses=e||{count:0,rows:[]}}function y(e){m.pause.delete({id:e.id}).$promise.then(function(){_.remove(f.pauses.rows,{id:e.id}),f.pauses.count-=1,f.pauses.rows.length||f.getPauses(),p.success({title:_.startCase("Pause")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEpause"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEpause",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getPauses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","pauses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("PausesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;if(g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SCHEDULE",g.schedule=angular.copy(l),g.schedules=r,g.newSchedule=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.schedule){g.apiName=g.schedule.DefaultReportId?"analyticDefaultReport":"analyticCustomReport";var v=g.schedule.DefaultReportId?g.schedule.DefaultReportId:g.schedule.CustomReportId;d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:v}),g.schedule.report=g.currentReport.name,g.query.parent=g.currentReport.parent})}else g.schedule={output:"xlsx",active:!0,startAt:new Date,endAt:new Date(Date.now()+2592e6),cron:"0 0 * * *",subtractNumber:1,subtractUnit:"days",sendMail:!1,sendIfEmpty:!0},g.title="TOOLS.NEW_SCHEDULE",g.newSchedule=!0;function h(e){return e?{loaded:A,select_node:f}:{loaded:E,select_node:b}}function f(e,n){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=n.node.id,y()}function b(e,n){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=n.node.id,y()}function A(){if(!g.newSchedule&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);f(0,{node:e,selected:e.id})}}function E(){if(!g.newSchedule&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,S).$promise;else{if(!g.userProfileSection)return S(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,S).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),S({count:t.length,rows:t})}return S(null)}):S(null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function S(e){g.reports=e||{count:0,rows:[]},g.newSchedule||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function T(e){a.hide(e)}g.addNewSchedule=function(){g.errors=[],d.schedule.save(g.schedule).$promise.then(function(e){g.schedules.unshift(e.toJSON()),o.success({title:"Schedule properly created",msg:g.schedule.name?g.schedule.name+" has been created!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSchedule=function(){g.errors=[],d.schedule.update({id:g.schedule.id},g.schedule).$promise.then(function(e){var n=_.find(g.schedules,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Schedule properly saved!",msg:g.schedule.name?g.schedule.name+" has been saved!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSchedule=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The schedule will be deleted.").ariaLabel("Delete Schedule").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.schedule.delete({id:g.schedule.id}).$promise.then(function(){_.remove(g.schedules,{id:g.schedule.id}),o.success({title:"Schedule properly deleted!",msg:(g.schedule.name||"schedule")+" has been deleted!"}),T(g.schedule)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.getReports=y,g.selectReport=function(){g.schedule.report=g.selectedReport[0].name,g.currentNode.custom?(g.schedule.CustomReportId=g.selectedReport[0].id,delete g.schedule.DefaultReportId):(g.schedule.DefaultReportId=g.selectedReport[0].id,delete g.schedule.CustomReportId);e.scheduleForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(n={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,n}).catch(function(e){o.error({title:"ERROR",msg:e.message})}):n),g.treeDefaultEvents=h(!1),g.treeCustomEvents=h(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var n},g.closeDialog=T,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.mailAccounts,{id:e.resourceId})}),t=null;if(g.schedule&&(t=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.mailAccounts,{id:t.id});a.canSelect=!1,n.push(a)}g.mailAccounts=n})}else{var t=[],a=null;g.schedule&&(a=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)}));for(var i=0;i<g.mailAccounts.length;i++)a&&g.mailAccounts[i].id===a.id&&(g.mailAccounts[i].canSelect=!1,t.push(g.mailAccounts[i]));g.mailAccounts=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","schedules","schedule","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditScheduleDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.schedules=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="schedules",f.listOrder="",f.listOrderAsc=null,f.selectedScheduler=[],f.query={fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,page:1},f.arrayoutput=_.keyBy([{option:"CSV",value:"'csv'"},{option:"PDF",value:"'pdf'"},{option:"Excel",value:"'xlsx'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysubtractUnit=_.keyBy([{option:"Minutes",value:"'minutes'"},{option:"Hours",value:"'hours'"},{option:"Days",value:"'days'"},{option:"Weeks",value:"'weeks'"},{option:"Months",value:"'months'"},{option:"Quarters",value:"'quarters'"},{option:"Years",value:"'years'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{schedule:e,schedules:f.schedules.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.runconfirm=function(e,n){var t=i.confirm().title("Are you sure want to run the schedule?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be run.").ariaLabel("delete schedule").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){return m.schedule.run({id:e.id}).$promise},function(){console.log("CANCEL")})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("schedule")+"?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be deleted.").ariaLabel("delete schedule").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getScheduler=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.schedule.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Scheduler",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSchedule=function(e,n){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{schedule:n,schedules:f.schedules.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSchedule=y,f.exportSelectedScheduler=function(){var e=angular.copy(f.selectedScheduler);return f.selectedScheduler=[],e},f.deleteSelectedScheduler=function(e){var n=i.confirm().title("Are you sure want to delete the selected schedules?").htmlContent("<b>"+f.selectedScheduler.length+" selected</b> will be deleted.").ariaLabel("delete Schedules").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedScheduler.forEach(function(e){y(e)}),f.selectedScheduler=[]})},f.deselectScheduler=function(){f.selectedScheduler=[]},f.selectAllScheduler=function(){f.selectedScheduler=f.schedules.rows},m.analyticTreeReport.get({}).$promise.then(function(e){f.treeReports=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.mailAccounts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.mailAccounts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.mailAccounts,{id:e.resourceId})}),t=null;if(f.schedule&&(t=_.find(f.mailAccounts,{id:Number(f.schedule.MailAccountId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.mailAccounts,{id:t.id});a.canSelect=!1,n.push(a)}f.mailAccounts=n})}else{var t=[],a=null;f.schedule&&(a=_.find(f.mailAccounts,{id:Number(f.schedule.MailAccountId)}));for(var i=0;i<f.mailAccounts.length;i++)a&&f.mailAccounts[i].id===a.id&&(f.mailAccounts[i].canSelect=!1,t.push(f.mailAccounts[i]));f.mailAccounts=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.schedules=e||{count:0,rows:[]}}function y(e){m.schedule.delete({id:e.id}).$promise.then(function(){_.remove(f.schedules.rows,{id:e.id}),f.schedules.count-=1,f.schedules.rows.length||f.getScheduler(),p.success({title:_.startCase("Schedule")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEschedule"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEschedule",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getScheduler())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","schedules","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("SchedulesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SOUND",g.sound=angular.copy(l),g.sounds=r,g.newSound=!1,g.sound||(g.sound={},g.title="TOOLS.NEW_SOUND",g.newSound=!0),g.addNewSound=function(){g.errors=[],d.sound.save(g.sound).$promise.then(function(e){g.sounds.unshift(e.toJSON()),o.success({title:"Sound properly created",msg:g.sound.name?g.sound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSound=function(){g.errors=[],d.sound.update({id:g.sound.id},g.sound).$promise.then(function(e){var n=_.find(g.sounds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Sound properly saved!",msg:g.sound.name?g.sound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSound=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sound will be deleted.").ariaLabel("Delete Sound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.sound.delete({id:g.sound.id}).$promise.then(function(){_.remove(g.sounds,{id:g.sound.id}),o.success({title:"Sound properly deleted!",msg:(g.sound.name||"sound")+" has been deleted!"}),v(g.sound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sounds","sound","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.sounds=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="sounds",f.listOrder="",f.listOrderAsc=null,f.selectedSounds=[],f.query={fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{sound:e,sounds:f.sounds.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.downloadfile2=function(s,e){return m.sound.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("sound")+"?").htmlContent("<b>"+(e.name||"sound")+"</b> will be deleted.").ariaLabel("delete sound").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSounds=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.sound.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Sounds",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSound=function(e,n){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sound:n,sounds:f.sounds.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSound=y,f.exportSelectedSounds=function(){var e=angular.copy(f.selectedSounds);return f.selectedSounds=[],e},f.deleteSelectedSounds=function(e){var n=i.confirm().title("Are you sure want to delete the selected sounds?").htmlContent("<b>"+f.selectedSounds.length+" selected</b> will be deleted.").ariaLabel("delete Sounds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSounds.forEach(function(e){y(e)}),f.selectedSounds=[]})},f.deselectSounds=function(){f.selectedSounds=[]},f.selectAllSounds=function(){f.selectedSounds=f.sounds.rows},f.uploadSound=function(e){i.show({controller:"UploadSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sounds:f.sounds.rows}})};var b=!0,A=1;function E(e){f.sounds=e||{count:0,rows:[]}}function y(e){m.sound.delete({id:e.id}).$promise.then(function(){_.remove(f.sounds.rows,{id:e.id}),f.sounds.count-=1,f.sounds.rows.length||f.getSounds(),p.success({title:_.startCase("Sound")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsound"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsound",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSounds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sounds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("SoundsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this,r=15,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="TOOLS.UPLOAD_SOUND",o.sounds=a,o.uploadSounds=[],o.uploadState="none",o.sound={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/sounds"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var n=["wav","mp3","gsm"];if(!_.includes(n,e.getExtension()))return t.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>l)return t.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.sound={id:e.uniqueIdentifier,file:e},o.uploadSounds.unshift(o.sound),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.sounds.unshift(JSON.parse(e)),angular.forEach(o.uploadSounds,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result}}})},o.uploadError=function(e,n){o.ngFlow.flow.cancel(),t.error({title:"Upload error",msg:"Cannot upload the sound"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",t.success({title:"Upload completed",msg:o.sound.file.name+" uploaded successfully"}))},o.closeDialog=function(){n.hide()}}e.$inject=["$cookies","$mdDialog","toasty","sounds","api","Auth"],angular.module("app.tools").controller("UploadSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TAG",g.tag=angular.copy(l),g.tags=r,g.newTag=!1,g.tag||(g.tag={},g.title="TOOLS.NEW_TAG",g.newTag=!0),g.addNewTag=function(){g.errors=[],d.tag.save(g.tag).$promise.then(function(e){g.tags.unshift(e.toJSON()),o.success({title:"Tag properly created",msg:g.tag.name?g.tag.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTag=function(){g.errors=[],d.tag.update({id:g.tag.id},g.tag).$promise.then(function(e){var n=_.find(g.tags,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Tag properly saved!",msg:g.tag.name?g.tag.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTag=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The tag will be deleted.").ariaLabel("Delete Tag").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.tag.delete({id:g.tag.id}).$promise.then(function(){_.remove(g.tags,{id:g.tag.id}),o.success({title:"Tag properly deleted!",msg:(g.tag.name||"tag")+" has been deleted!"}),v(g.tag)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","tags","tag","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTagDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.tags=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="tags",f.listOrder="",f.listOrderAsc=null,f.selectedTags=[],f.query={fields:"createdAt,updatedAt,id,name,description,color",sort:"name,-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{tag:e,tags:f.tags.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("tag")+"?").htmlContent("<b>"+(e.name||"tag")+"</b> will be deleted.").ariaLabel("delete tag").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTags=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.tag.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Tags",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTag=function(e,n){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{tag:n,tags:f.tags.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTag=y,f.exportSelectedTags=function(){var e=angular.copy(f.selectedTags);return f.selectedTags=[],e},f.deleteSelectedTags=function(e){var n=i.confirm().title("Are you sure want to delete the selected tags?").htmlContent("<b>"+f.selectedTags.length+" selected</b> will be deleted.").ariaLabel("delete Tags").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTags.forEach(function(e){y(e)}),f.selectedTags=[]})},f.deselectTags=function(){f.selectedTags=[]},f.selectAllTags=function(){f.selectedTags=f.tags.rows};var b=!0,A=1;function E(e){f.tags=e||{count:0,rows:[]}}function y(e){m.tag.delete({id:e.id}).$promise.then(function(){_.remove(f.tags.rows,{id:e.id}),f.tags.count-=1,f.tags.rows.length||f.getTags(),p.success({title:_.startCase("Tag")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtag"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtag",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTags())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","tags","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TagsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TEMPLATE",g.template=angular.copy(l),g.templates=r,g.newTemplate=!1,g.template||(g.template={},g.title="TOOLS.NEW_TEMPLATE",g.newTemplate=!0),g.addNewTemplate=function(){g.errors=[],d.template.save(g.template).$promise.then(function(e){g.templates.unshift(e.toJSON()),o.success({title:"Template properly created",msg:g.template.name?g.template.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTemplate=function(){g.errors=[],d.template.update({id:g.template.id},g.template).$promise.then(function(e){var n=_.find(g.templates,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Template properly saved!",msg:g.template.name?g.template.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTemplate=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The template will be deleted.").ariaLabel("Delete Template").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.template.delete({id:g.template.id}).$promise.then(function(){_.remove(g.templates,{id:g.template.id}),o.success({title:"Template properly deleted!",msg:(g.template.name||"template")+" has been deleted!"}),v(g.template)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","templates","template","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTemplateDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.templates=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="templates",f.listOrder="",f.listOrderAsc=null,f.selectedTemplates=[],f.query={fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{template:e,templates:f.templates.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("template")+"?").htmlContent("<b>"+(e.name||"template")+"</b> will be deleted.").ariaLabel("delete template").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTemplates=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.template.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Templates",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTemplate=function(e,n){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{template:n,templates:f.templates.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTemplate=y,f.exportSelectedTemplates=function(){var e=angular.copy(f.selectedTemplates);return f.selectedTemplates=[],e},f.deleteSelectedTemplates=function(e){var n=i.confirm().title("Are you sure want to delete the selected templates?").htmlContent("<b>"+f.selectedTemplates.length+" selected</b> will be deleted.").ariaLabel("delete Templates").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTemplates.forEach(function(e){y(e)}),f.selectedTemplates=[]})},f.deselectTemplates=function(){f.selectedTemplates=[]},f.selectAllTemplates=function(){f.selectedTemplates=f.templates.rows};var b=!0,A=1;function E(e){f.templates=e||{count:0,rows:[]}}function y(e){m.template.delete({id:e.id}).$promise.then(function(){_.remove(f.templates.rows,{id:e.id}),f.templates.count-=1,f.templates.rows.length||f.getTemplates(),p.success({title:_.startCase("Template")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtemplate"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtemplate",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTemplates())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","templates","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TemplatesController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r,l,d){var c=this;function m(e){t.hide(e)}c.currentUser=o.getCurrentUser(),c.trigger=angular.copy(n),c.triggers=angular.copy(e),c.setting=l,c.license=r,c.crudPermissions=d,c.newTrigger=!1,c.errors=[],c.trigger||(c.trigger={channel:"voice"},c.newTrigger=!0),c.addNewTrigger=function(){c.errors=[],s.trigger.save(c.trigger).$promise.then(function(e){c.triggers.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_CREATED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveTrigger=function(){c.errors=[],s.trigger.update({id:c.trigger.id},c.trigger).$promise.then(function(){c.triggers=_.map(c.triggers,function(e){return e.id===c.trigger.id?c.trigger:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_SAVED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteTrigger=function(e){c.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_MESSAGE",{name:c.trigger.name})).ariaLabel("Delete trigger").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){s.trigger.delete({id:c.trigger.id}).$promise.then(function(){c.triggers=_.filter(c.triggers,function(e){return e.id!==c.trigger.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$translate","toasty","triggers","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTriggerDialogController",e)}(),function(){"use strict";function e(e,a,n,i,t,s,o,r){var l=this;function d(){_.some(l.triggerActions.rows,["action","contactManager"])&&(l.lists||(r.isAdmin()?o.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.lists=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.lists=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.lists,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var n=_.find(l.lists,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.lists,{id:e.id});n.canSelect=!1,t.push(n)}}),l.lists=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var n=_.find(l.lists,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<l.lists.length;i++)_.some(a,{id:l.lists[i].id})&&(l.lists[i].canSelect=!1,t.push(l.lists[i]));l.lists=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(l.triggerActions.rows,["action","integration"])&&_(l.triggerActions.rows).map(function(e){return"integration"===e.action?e.data1:void 0}).compact().uniq().value().forEach(function(e){var n=e+"Accounts";if(!l[n]){var t="int"+_.startCase(e)+"Account";o[t.replace(/\s+/g,"")].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l[n]=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+n.toUpperCase()+"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}),_.some(l.triggerActions.rows,function(e){return _.includes(["motionbar","browser"],e.action)})&&(l.templates||(r.isAdmin()?o.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l.templates=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l.templates=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.templates,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(l.templates,{id:Number(e.data2)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.templates,{id:e.id});n.canSelect=!1,t.push(n)}}),l.templates=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(l.templates,{id:Number(e.data2)});a.push(n)}});for(var i=0;i<l.templates.length;i++)_.some(a,{id:l.templates[i].id})&&(l.templates[i].canSelect=!1,t.push(l.templates[i]));l.templates=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(l.triggerActions.rows,["action","jscripty"])&&(l.projects||(r.isAdmin()?o.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.projects=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.projects=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.projects,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var n=_.find(l.projects,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),l.projects=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var n=_.find(l.projects,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<l.projects.length;i++)_.some(a,{id:l.projects[i].id})&&(l.projects[i].canSelect=!1,t.push(l.projects[i]));l.projects=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})))}function c(e){l.triggerActions=e||{count:0,rows:[]},d()}function m(){l.query.offset=(l.query.page-1)*l.query.limit,l.promise=o.trigger.getActions(l.query,c).$promise}function u(e,n){o.action.delete({id:e.id}).$promise.then(function(){m(),n&&s.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}l.currentUser=r.getCurrentUser(),l.trigger={},l.triggerActions={count:0,rows:[]},l.selectedTriggerActions=[],l.query={fields:"id,action,contact,data1,data2,data3,data4,data5,data6,data7,createdAt,updatedAt",limit:10,page:1},l.integrationTypes={zendesk:"Zendesk",salesforce:"Salesforce",sugarcrm:"SugarCRM",freshdesk:"Freshdesk",desk:"Desk",zoho:"Zoho",vtiger:"vTiger",dynamics365:"Dynamics365",servicenow:"ServiceNow",freshsales:"Freshsales"},l.motionBarOptions={0:"Popup",1:"CTI URL",2:"Windows App"},l.onInit=function(e,n){l.trigger=e,l.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},l.query.ActionId=l.trigger.id,l.query.id=l.trigger.id,m()},l.success=c,l.getTriggerActions=m,l.createOrEditTriggerAction=function(e,n){i.show({controller:"CreateOrEditActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/actions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:l.trigger,action:n,actions:l.triggerActions.rows,license:null,setting:null,crudPermissions:l.crudPermissions}}).then(function(e){e&&(l.triggerActions={count:e.length,rows:e},d())})},l.exportSelectedTriggerActions=function(){var e=angular.copy(l.selectedTriggerActions);return l.selectedTriggerActions=[],e},l.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETE_TITLE")).ariaLabel("Delete action").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){u(e,!0)})},l.deleteSelectedTriggerActions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETE_MESSAGE",{total:l.selectedTriggerActions.length})).ariaLabel("Delete actions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){l.selectedTriggerActions.forEach(function(e){u(e)}),l.selectedTriggerActions=[],s.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerActionsController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r,l,d,c,m){var u=this;function p(){return new Promise(function(n,t){l.hasSectionsPermissions([1301,1302,1303,1304,1305,1306,1307,1308,1309,1310]).then(function(e){u.hasSectionPermissions=_.merge(u.hasSectionPermissions,e),n(u.hasSectionPermissions)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SECTIONS_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()}),t()})})}function g(){r.cmList.getCustomFields({id:u.action.data1,ListId:u.action.data1}).$promise.then(function(e){u.listFields=_.filter(e.rows,["type","text"]),u.listFields.forEach(function(e){e.columnName="cf_"+e.id})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LIST_CUSTOM_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function v(){l.isAdmin()?r.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.templates,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(u.templates,{id:Number(e.data2)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.templates,{id:e.id});n.canSelect=!1,t.push(n)}}),u.templates=t})}else{var t=[],a=[];u.actions.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(u.templates,{id:Number(e.data2)});a.push(n)}});for(var i=0;i<u.templates.length;i++){_.some(a,{id:u.templates[i].id})&&(u.templates[i].canSelect=!1,t.push(u.templates[i]))}u.templates=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})})}function h(){switch(u.action.action){case"contactManager":u.lists||(l.isAdmin()?r.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if("contactManager"===e.action){var n=_.find(u.lists,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.lists,{id:e.id});n.canSelect=!1,t.push(n)}}),u.lists=t})}else{var t=[],a=[];u.actions.forEach(function(e){if("contactManager"===e.action){var n=_.find(u.lists,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<u.lists.length;i++)_.some(a,{id:u.lists[i].id})&&(u.lists[i].canSelect=!1,t.push(u.lists[i]));u.lists=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})),u.contactFields||r.cmContact.describe({}).$promise.then(function(e){u.contactFields=[],u.customFields=[];for(var n=_.values(e.toJSON()),t=0;t<n.length;t++)_.includes(u.allowedStandardFields,n[t].columnName)?u.contactFields.push(n[t]):_.startsWith(n[t].columnName,"cf_")&&"text"===n[t].custom.type&&u.customFields.push(n[t])}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE_CM_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})}),u.action.data3=u.action.data3?u.action.data3.split(","):["phone"],"1"!==u.action.data2||u.action.data4||(u.action.data4="phone");break;case"jscripty":u.projects||(l.isAdmin()?r.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if("jscripty"===e.action){var n=_.find(u.projects,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),u.projects=t})}else{var t=[],a=[];u.actions.forEach(function(e){if("jscripty"===e.action){var n=_.find(u.projects,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<u.projects.length;i++)_.some(a,{id:u.projects[i].id})&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"urlForward":u.action.data5||(u.action.data5=5)}}function f(){u.editAccount||(u.action.data2=void 0,u.action.data3=void 0),u.action.isIntegrationDisabled=!u.newAction&&!function(){switch(u.action.data1){case"zendesk":return u.hasSectionPermissions[1301];case"salesforce":return u.hasSectionPermissions[1302];case"sugarcrm":return u.hasSectionPermissions[1305];case"freshdesk":return u.hasSectionPermissions[1303];case"desk":return u.hasSectionPermissions[1306];case"zoho":return u.hasSectionPermissions[1307];case"vtiger":return u.hasSectionPermissions[1308];case"dynamics365":return u.hasSectionPermissions[1309];case"servicenow":return u.hasSectionPermissions[1310];case"freshsales":return u.hasSectionPermissions[1304]}}();var e="int"+_.capitalize(u.action.data1)+"Account";r[e].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.accounts=e.rows||[],u.editAccount=!1}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.action.data1.toUpperCase()+"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function b(){u.action.data3=u.action.data3?u.action.data3:void 0;var e="int"+_.capitalize(u.action.data1)+"Configuration";r[e].get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.configurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.action.data1.toUpperCase()+"CONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function A(){var e=angular.copy(u.action);return _.isArray(e.data3)&&(e.data3=u.action.data3.join(",")),e}function E(e){t.hide(e)}u.currentUser=l.getCurrentUser(),void 0!==s&&"urlForward"===s.action&&s.data5&&(s.data5=parseInt(s.data5)),u.action=angular.copy(s),u.actions=angular.copy(e),u.setting=c,u.license=d,u.crudPermissions=m,u.newAction=!1,u.errors=[],u.trigger=angular.copy(o),u.action?function(){switch(u.editAccount=!0,u.action.action){case"integration":return new Promise(function(e){e(p())}).then(function(){return u.editAccount||(u.action.data2=void 0,u.action.data3=void 0,h()),f()}).then(function(){return b()});case"motionbar":case"browser":v()}u.editAccount=!1}():(u.action={},u.newAction=!0),u.action.ActionId=n.params.id||void 0,u.allowedStandardFields=["phone","mobile","fax"],u.addNewAction=function(){u.errors=[];var e=A();r.trigger.addAction({id:n.params.id},e).$promise.then(function(e){u.actions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_CREATED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAction=function(){u.errors=[];var n=A();r.action.update({id:n.id},n).$promise.then(function(){u.actions=_.map(u.actions,function(e){return e.id===n.id?n:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_SAVED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAction=function(e){u.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETE_TITLE")).ariaLabel("Delete action").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){r.action.delete({id:u.action.id}).$promise.then(function(){u.actions=_.filter(u.actions,function(e){return e.id!==u.action.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.onActionInit=function(){l.hasModulePermissions("Integrations").then(function(e){u.hasIntegrationsPermissions=e}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MODULE_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),u.action.action&&h()},u.onIntegrationInit=p,u.onSearchFieldsInit=function(){u.newAction||g()},u.onActionSelection=function(){u.newAction&&(u.action.data1=void 0,u.action.data2=void 0,u.action.data3=void 0,u.action.data4=void 0,u.action.data5="urlForward"===u.action.action?5:void 0,h())},u.onIntegrationSelection=f,u.onListSelection=function(){g()},u.onTypeSelection=function(){"0"!==u.action.data1||u.templates?(u.action.data2=void 0,u.action.data4="1"===u.action.data1?0:void 0):v()},u.onAutocreateSelection=function(){"0"===u.action.data2&&(u.action.data4=void 0);u.action.data4||"1"!==u.action.data2||(u.action.data4="phone")},u.onIntegrationAccountSelection=b,u.closeDialog=E,u.onActionLocationChange=function(){u.editAccount||(u.action.data5=void 0,u.action.data6=void 0)}}e.$inject=["$state","$mdDialog","$translate","toasty","actions","action","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditActionDialogController",e)}(),function(){"use strict";function e(e,l,a,n,i,t,d,c,m){var u=this;function s(){var o,r;"voice"===u.trigger.channel?(_.some(u.allConditions.rows,["field","queue"])&&(u.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,m.isAdmin()?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(c.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];u.allConditions.rows.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),u.queues=t}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.allConditions.rows,["field","routeId"])&&(u.outboundRoutes||(m.isAdmin()?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.outboundRoutes,{id:e.resourceId})}),a=null;a=[],u.triggerAllConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),u.outboundRoutes=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<u.outboundRoutes.length;i++)_.some(a,{id:u.outboundRoutes[i].id})&&(u.outboundRoutes[i].canSelect=!1,t.push(u.outboundRoutes[i]));u.outboundRoutes=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.allConditions.rows,["field","agent"])&&(u.agents||(m.isAdmin()?c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.agents,{id:e.resourceId})}),a=null;a=[],u.triggerAllConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),u.agents=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}});for(var i=0;i<u.agents.length;i++)_.some(a,{id:u.agents[i].id})&&(u.agents[i].canSelect=!1,t.push(u.agents[i]));u.agents=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))):("mail"===u.trigger.channel&&c.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.mailSubstatuses=e.rows||[]}).catch(function(){d.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})}),function(){var e,s=u.trigger.channel+("chat"===u.trigger.channel?"Websites":"Accounts"),n=u.trigger.channel+("chat"===u.trigger.channel?"Website":"Account");switch(u.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}m.isAdmin()?c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u[s],{id:e.resourceId})}),a=null;a=[],u.allConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u[s],{id:e.id});n.canSelect=!1,t.push(n)}}),u[s]=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}});for(var i=0;i<u[s].length;i++)_.some(a,{id:u[s][i].id})&&(u[s][i].canSelect=!1,t.push(u[s][i]));u[s]=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}())}function o(e){u.allConditions=e||{count:0,rows:[]},s()}function r(){u.query.offset=(u.query.page-1)*u.query.limit,u.promise=c.trigger.getAllConditions(u.query,o).$promise}function p(e,n){c.condition.delete({id:e.id}).$promise.then(function(){r(),n&&d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}u.currentUser=m.getCurrentUser(),u.trigger={},u.allConditions={count:0,rows:[]},u.selectedAllConditions=[],u.query={fields:"id,field,operator,value,createdAt,updatedAt",limit:10,page:1},u.fields={queue:"Queue",lastevent:"Call_Status",routeId:"OutboundRoute",agent:"Agent",account:"Account",interaction:"Interaction",message:"Message",mailSubstatus:"Mail_Substatus",offlineMessage:"Offline_Message"},u.callStatuses={abandoned:"Abandon",timeout:"Timeout",complete:"Hangup",rejected:"Reject",called:"Ring",connect:"Answer",nosuchnumber:"NoSuchNumber",busy:"Busy",noanswer:"NoAnswer",congestion:"Congestion",agentreject:"AgentReject",amd:"AMD"},u.messageStatuses={in:"Incoming",out:"Outgoing",accept:"Accepted",reject:"Rejected"},u.onInit=function(e,n){u.trigger=e,u.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},u.query.TriggerAllId=u.trigger.id,u.query.id=u.trigger.id,r()},u.success=o,u.getAllConditions=r,u.createOrEditAllCondition=function(e,n){i.show({controller:"CreateOrEditAllConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/allconditions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:u.trigger,allCondition:n,allConditions:u.allConditions.rows,license:null,setting:null,crudPermissions:u.crudPermissions}}).then(function(e){e&&(u.allConditions={count:e.length,rows:e},s())})},u.exportSelectedAllConditions=function(){var e=angular.copy(u.selectedAllConditions);return u.selectedAllConditions=[],e},u.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){p(e,!0)})},u.deleteSelectedAllConditions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_MESSAGE",{total:u.selectedAllConditions.length})).ariaLabel("Delete conditions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){u.selectedAllConditions.forEach(function(e){p(e)}),u.selectedAllConditions=[],d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAllConditionsController",e)}(),function(){"use strict";function e(e,t,l,a,i,n,s,o,d,c,r,m,u){var p=this;function g(){switch(p.allCondition.field){case"queue":p.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,c.isAdmin()?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){p.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];p.allConditions.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),p.queues=t}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"routeId":p.outboundRoutes||(c.isAdmin()?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.outboundRoutes,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),p.outboundRoutes=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.outboundRoutes.length;i++)_.some(a,{id:p.outboundRoutes[i].id})&&(p.outboundRoutes[i].canSelect=!1,t.push(p.outboundRoutes[i]));p.outboundRoutes=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"agent":p.agents||(c.isAdmin()?d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.agents,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),p.agents=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}});for(var i=0;i<p.agents.length;i++)_.some(a,{id:p.agents[i].id})&&(p.agents[i].canSelect=!1,t.push(p.agents[i]));p.agents=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"account":!function(){var e,n=p.trigger.channel+("chat"===p.trigger.channel?"Website":"Account");switch(p.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}c.isAdmin()?d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.accounts,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.accounts,{id:e.id});n.canSelect=!1,t.push(n)}}),p.accounts=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.accounts.length;i++)_.some(a,{id:p.accounts[i].id})&&(p.accounts[i].canSelect=!1,t.push(p.accounts[i]));p.accounts=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}();break;case"mailSubstatus":d.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){p.mailSubstatuses=e.rows||[]}).catch(function(){i.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})})}var o,r}function v(e){t.hide(e)}p.currentUser=c.getCurrentUser(),p.allCondition=angular.copy(s),p.allConditions=angular.copy(n),p.setting=m,p.license=r,p.crudPermissions=u,p.hasModulePermissions={},p.newAllCondition=!1,p.errors=[],p.trigger=angular.copy(o),p.allCondition?g():(p.allCondition={operator:"equals"},p.newAllCondition=!0),p.allCondition.TriggerAllId=e.params.id||void 0,p.callStatuses=[{name:"Abandon",value:"abandoned"},{name:"Timeout",value:"timeout"},{name:"Hangup",value:"complete"},{name:"Reject",value:"rejected"},{name:"Ring",value:"called"},{name:"Answer",value:"connect"},{name:"NoSuchNumber",value:"nosuchnumber"},{name:"Busy",value:"busy"},{name:"NoAnswer",value:"noanswer"},{name:"Congestion",value:"congestion"},{name:"AgentReject",value:"agentreject"},{name:"AMD",value:"amd"}],p.onFieldSelection=function(){p.allCondition.value=void 0,g()},p.addNewAllCondition=function(){p.errors=[],d.trigger.addAllCondition({id:e.params.id},p.allCondition).$promise.then(function(e){p.allConditions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_CREATED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveAllCondition=function(){p.errors=[],d.condition.update({id:p.allCondition.id},p.allCondition).$promise.then(function(){p.allConditions=_.map(p.allConditions,function(e){return e.id===p.allCondition.id?p.allCondition:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_SAVED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteAllCondition=function(e){p.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){d.condition.delete({id:p.allCondition.id}).$promise.then(function(){p.allConditions=_.filter(p.allConditions,function(e){return e.id!==p.allCondition.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.closeDialog=v}e.$inject=["$state","$mdDialog","$q","$translate","toasty","allConditions","allCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAllConditionDialogController",e)}(),function(){"use strict";function e(e,l,a,n,i,t,d,c,m){var u=this;function s(){var o,r;"voice"===u.trigger.channel?(_.some(u.anyConditions.rows,["field","queue"])&&(u.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,m.isAdmin()?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(c.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),u.queues=t}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.anyConditions.rows,["field","routeId"])&&(u.outboundRoutes||(m.isAdmin()?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.outboundRoutes,{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),u.outboundRoutes=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<u.outboundRoutes.length;i++)_.some(a,{id:u.outboundRoutes[i].id})&&(u.outboundRoutes[i].canSelect=!1,t.push(u.outboundRoutes[i]));u.outboundRoutes=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.anyConditions.rows,["field","agent"])&&(u.agents||(m.isAdmin()?c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.agents,{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),u.agents=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}});for(var i=0;i<u.agents.length;i++)_.some(a,{id:u.agents[i].id})&&(u.agents[i].canSelect=!1,t.push(u.agents[i]));u.agents=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))):("mail"===u.trigger.channel&&c.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.mailSubstatuses=e.rows||[]}).catch(function(){d.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})}),function(){var e,s=u.trigger.channel+("chat"===u.trigger.channel?"Websites":"Accounts"),n=u.trigger.channel+("chat"===u.trigger.channel?"Website":"Account");switch(u.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}m.isAdmin()?c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u[s],{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u[s],{id:e.id});n.canSelect=!1,t.push(n)}}),u[s]=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}});for(var i=0;i<u[s].length;i++)_.some(a,{id:u[s][i].id})&&(u[s][i].canSelect=!1,t.push(u[s][i]));u[s]=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}())}function o(e){u.anyConditions=e||{count:0,rows:[]},s()}function r(){u.query.offset=(u.query.page-1)*u.query.limit,u.promise=c.trigger.getAnyConditions(u.query,o).$promise}function p(e,n){c.condition.delete({id:e.id}).$promise.then(function(){r(),n&&d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}u.currentUser=m.getCurrentUser(),u.trigger={},u.anyConditions={count:0,rows:[]},u.selectedAnyConditions=[],u.query={fields:"id,field,operator,value,createdAt,updatedAt",limit:10,page:1},u.fields={queue:"Queue",lastevent:"Call_Status",routeId:"OutboundRoute",agent:"Agent",account:"Account",interaction:"Interaction",message:"Message",mailSubstatus:"Mail_Substatus",offlineMessage:"Offline_Message"},u.callStatuses={abandoned:"Abandon",timeout:"Timeout",complete:"Hangup",rejected:"Reject",called:"Ring",connect:"Answer",nosuchnumber:"NoSuchNumber",busy:"Busy",noanswer:"NoAnswer",congestion:"Congestion",agentreject:"AgentReject",amd:"AMD"},u.messageStatuses={in:"Incoming",out:"Outgoing",accept:"Accepted",reject:"Rejected"},u.onInit=function(e,n){u.trigger=e,u.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},u.query.TriggerAnyId=u.trigger.id,u.query.id=u.trigger.id,r()},u.success=o,u.getAnyConditions=r,u.createOrEditAnyCondition=function(e,n){i.show({controller:"CreateOrEditAnyConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/anyconditions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:u.trigger,anyCondition:n,anyConditions:u.anyConditions.rows,license:null,setting:null,crudPermissions:u.crudPermissions}}).then(function(e){e&&(u.anyConditions={count:e.length,rows:e},s())})},u.exportSelectedAnyConditions=function(){var e=angular.copy(u.selectedAnyConditions);return u.selectedAnyConditions=[],e},u.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){p(e,!0)})},u.deleteAnyCondition=p,u.deleteSelectedAnyConditions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_MESSAGE",{total:u.selectedAnyConditions.length})).ariaLabel("Delete conditions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){u.selectedAnyConditions.forEach(function(e){p(e)}),u.selectedAnyConditions=[],d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAnyConditionsController",e)}(),function(){"use strict";function e(e,t,l,a,i,n,s,o,d,c,r,m,u){var p=this;function g(){switch(p.anyCondition.field){case"queue":p.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,c.isAdmin()?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){p.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];p.anyConditions.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),p.queues=t}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"routeId":p.outboundRoutes||(c.isAdmin()?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.outboundRoutes,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),p.outboundRoutes=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.outboundRoutes.length;i++)_.some(a,{id:p.outboundRoutes[i].id})&&(p.outboundRoutes[i].canSelect=!1,t.push(p.outboundRoutes[i]));p.outboundRoutes=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"agent":p.agents||(c.isAdmin()?d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.agents,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),p.agents=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}});for(var i=0;i<p.agents.length;i++)_.some(a,{id:p.agents[i].id})&&(p.agents[i].canSelect=!1,t.push(p.agents[i]));p.agents=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"account":!function(){var e,n=p.trigger.channel+("chat"===p.trigger.channel?"Website":"Account");switch(p.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}c.isAdmin()?d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.accounts,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.accounts,{id:e.id});n.canSelect=!1,t.push(n)}}),p.accounts=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.accounts.length;i++)_.some(a,{id:p.accounts[i].id})&&(p.accounts[i].canSelect=!1,t.push(p.accounts[i]));p.accounts=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}();break;case"mailSubstatus":d.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){p.mailSubstatuses=e.rows||[]}).catch(function(){i.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})})}var o,r}function v(e){t.hide(e)}p.currentUser=c.getCurrentUser(),p.anyCondition=angular.copy(s),p.anyConditions=angular.copy(n),p.setting=m,p.license=r,p.crudPermissions=u,p.hasModulePermissions={},p.newAnyCondition=!1,p.errors=[],p.trigger=angular.copy(o),p.anyCondition?g():(p.anyCondition={operator:"equals"},p.newAnyCondition=!0),p.anyCondition.TriggerAnyId=e.params.id||void 0,p.callStatuses=[{name:"Abandon",value:"abandoned"},{name:"Timeout",value:"timeout"},{name:"Hangup",value:"complete"},{name:"Reject",value:"rejected"},{name:"Ring",value:"called"},{name:"Answer",value:"connect"},{name:"NoSuchNumber",value:"nosuchnumber"},{name:"Busy",value:"busy"},{name:"NoAnswer",value:"noanswer"},{name:"Congestion",value:"congestion"},{name:"AgentReject",value:"agentreject"},{name:"AMD",value:"amd"}],p.onFieldSelection=function(){p.anyCondition.value=void 0,g()},p.addNewAnyCondition=function(){p.errors=[],d.trigger.addAnyCondition({id:e.params.id},p.anyCondition).$promise.then(function(e){p.anyConditions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_CREATED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveAnyCondition=function(){p.errors=[],d.condition.update({id:p.anyCondition.id},p.anyCondition).$promise.then(function(){p.anyConditions=_.map(p.anyConditions,function(e){return e.id===p.anyCondition.id?p.anyCondition:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_SAVED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteAnyCondition=function(e){p.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){d.condition.delete({id:p.anyCondition.id}).$promise.then(function(){p.anyConditions=_.filter(p.anyConditions,function(e){return e.id!==p.allCondition.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.closeDialog=v}e.$inject=["$state","$mdDialog","$q","$translate","toasty","anyConditions","anyCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAnyConditionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;d.currentUser=o.getCurrentUser(),d.license=t,d.setting=a,d.trigger=r||e.params.trigger||{},d.selectedTab=e.params.tab||0,e.params.crudPermissions?d.crudPermissions=e.params.crudPermissions:(d.userProfileSection=l&&1==l.count?l.rows[0]:null,d.crudPermissions=o.parseCrudPermissions(d.userProfileSection?d.userProfileSection.crudPermissions:null)),d.gotoTriggers=function(){e.go("app.tools.triggers",{},{reload:"app.tools.triggers"})},d.saveTrigger=function(){i.trigger.update({id:d.trigger.id},d.trigger).$promise.then(function(){s.success({title:n.instant("TOOLS.NOTIFICATIONS.TRIGGER_SAVED_SUCCESS_TITLE")})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$translate","license","setting","api","toasty","Auth","trigger","userProfileSection"],angular.module("app.tools").controller("TriggerController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){n.go("app.tools.triggers.edit",{id:e.id,trigger:e,crudPermissions:g.crudPermissions})}function h(e){g.triggers=e||{count:0,rows:[]}}function f(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.trigger.get(g.query,h).$promise:(g.query.id=g.userProfile.id,g.query.section="Triggers",g.promise=d.userProfile.getResources(g.query,h).$promise)}function b(e,n){d.trigger.delete({id:e.id}).$promise.then(function(){f(),n&&c.success({title:s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrigger"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.triggers=o||{count:0,rows:[]},g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedTriggers=[],g.query={fields:"id,name,channel,status,description,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},g.goToEditState=v,g.createOrEditTrigger=function(e,n){if(g.crudPermissions.readOnly||g.crudPermissions.canDelete&&!g.crudPermissions.canEdit)return void v(n);a.show({controller:"CreateOrEditTriggerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:n,triggers:g.triggers.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}}).then(function(e){e&&(g.triggers={count:e.length,rows:e})})},g.success=h,g.getTriggers=f,g.deleteconfirm=function(e,n){var t=a.confirm().title(s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_TITLE")).content(s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_MESSAGE",{name:e.name})).ariaLabel("Delete trigger").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){b(e,!0)})},g.exportSelectedTriggers=function(){var e=angular.copy(g.selectedTriggers);return g.selectedTriggers=[],e},g.deleteSelectedTriggers=function(e){var n=a.confirm().title(s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETE_TITLE")).content(s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETE_MESSAGE",{total:g.selectedTriggers.length})).ariaLabel("Delete triggers").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedTriggers.forEach(function(e){b(e)}),g.selectedTriggers=[],c.success({title:s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETED_SUCCESS_TITLE")})})},g.deselectTriggers=function(){g.selectedTriggers=[]},g.selectAllTriggers=function(){g.selectedTriggers=g.triggers.rows};var A=!0,E=1;e.$watch("vm.query.filter",function(e,n){A?i(function(){A=!1}):(n||(E=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=E),f())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","triggers","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.tools").controller("TriggersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TRUNK",g.trunk=angular.copy(l),g.trunks=r,g.newTrunk=!1,g.trunk||(g.trunk={active:!0,type:"friend",dtmfmode:"rfc2833",qualify:"yes",t38pt_udptl:"no"},g.title="TOOLS.NEW_TRUNK",g.newTrunk=!0),g.addNewTrunk=function(){g.errors=[],d.trunk.save(g.trunk).$promise.then(function(e){g.trunks.unshift(e.toJSON()),o.success({title:"Trunk properly created",msg:g.trunk.name?g.trunk.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTrunk=function(){g.errors=[],d.trunk.update({id:g.trunk.id},g.trunk).$promise.then(function(e){var n=_.find(g.trunks,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Trunk properly saved!",msg:g.trunk.name?g.trunk.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTrunk=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The trunk will be deleted.").ariaLabel("Delete Trunk").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.trunk.delete({id:g.trunk.id}).$promise.then(function(){_.remove(g.trunks,{id:g.trunk.id}),o.success({title:"Trunk properly deleted!",msg:(g.trunk.name||"trunk")+" has been deleted!"}),v(g.trunk)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","trunks","trunk","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTrunkDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newTrunk=!0,r.trunk=angular.copy(i),r.trunks=s,r.title=o.instant("TOOLS.CLONE_TRUNK"),i&&i.name&&(r.title+=": "+i.name),r.cloneTrunk=function(){return e.trunk.clone({id:i.id},r.trunk).$promise.then(function(e){r.trunks.unshift(e.toJSON()),a.success({title:"Trunk properly cloned",msg:r.trunk.name?r.trunk.name+" has been cloned!":""}),t.go("app.tools.trunks.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","trunk","trunks","$translate"],angular.module("app.tools").controller("TrunkcloneController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.trunk=c||t.params.trunk||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.trunks",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.trunks",{})}},u.clonedialog=function(e,n){a.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{trunk:e,trunks:u.trunks?u.trunks.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTrunks=function(){t.go("app.tools.trunks",{},{reload:"app.tools.trunks"})},u.saveTrunk=function(){r.trunk.update({id:u.trunk.id},u.trunk).$promise.then(function(){l.success({title:"Trunk updated!",msg:u.trunk.name?u.trunk.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunk",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.trunk&&(t=_.find(u.contexts,{name:u.trunk.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","trunk","userProfileSection"],angular.module("app.tools").controller("TrunkController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.trunks=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="trunks",f.listOrder="",f.listOrderAsc=null,f.selectedTrunks=[],f.query={fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydtmfmode=_.keyBy([{option:"rfc2833",value:"'rfc2833'"},{option:"info",value:"'info'"},{option:"shortinfo",value:"'shortinfo'"},{option:"inband",value:"'inband'"},{option:"auto",value:"'auto'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayqualify=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g723",value:"'g723'"},{option:"g726",value:"'g726'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"ilbc",value:"'ilbc'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayinsecure=_.keyBy([{option:"port",value:"'port'"},{option:"invite",value:"'invite'"},{option:"very",value:"'very'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydirectmedia=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"nonat",value:"'nonat'"},{option:"update",value:"'update'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraycallcounter=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayusereqphone=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytrustrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysendrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"pai",value:"'pai'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.tools.trunks.edit",{id:e.id,trunk:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{trunk:e,trunks:f.trunks?f.trunks.rows:[],crudPermissions:f.crudPermissions}})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.trunks",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.trunks",{})}},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("trunk")+"?").htmlContent("<b>"+(e.name||"trunk")+"</b> will be deleted.").ariaLabel("delete trunk").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTrunks=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.trunk.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Trunks",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTrunk=function(e,n){i.show({controller:"CreateOrEditTrunkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trunk:n,trunks:f.trunks.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTrunk=y,f.exportSelectedTrunks=function(){var e=angular.copy(f.selectedTrunks);return f.selectedTrunks=[],e},f.deleteSelectedTrunks=function(e){var n=i.confirm().title("Are you sure want to delete the selected trunks?").htmlContent("<b>"+f.selectedTrunks.length+" selected</b> will be deleted.").ariaLabel("delete Trunks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTrunks.forEach(function(e){y(e)}),f.selectedTrunks=[]})},f.deselectTrunks=function(){f.selectedTrunks=[]},f.selectAllTrunks=function(){f.selectedTrunks=f.trunks.rows};var b=!0,A=1;function E(e){f.trunks=e||{count:0,rows:[]}}function y(e){m.trunk.delete({id:e.id}).$promise.then(function(){_.remove(f.trunks.rows,{id:e.id}),f.trunks.count-=1,f.trunks.rows.length||f.getTrunks(),p.success({title:_.startCase("Trunk")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrunk"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrunk",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTrunks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","trunks","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TrunksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_VARIABLE",g.variable=angular.copy(l),g.variables=r,g.newVariable=!1,g.variable||(g.variable={},g.title="TOOLS.NEW_VARIABLE",g.newVariable=!0),g.addNewVariable=function(){g.errors=[],d.variable.save(g.variable).$promise.then(function(e){g.variables.unshift(e.toJSON()),o.success({title:"Variable properly created",msg:g.variable.name?g.variable.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVariable=function(){g.errors=[],d.variable.update({id:g.variable.id},g.variable).$promise.then(function(e){var n=_.find(g.variables,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Variable properly saved!",msg:g.variable.name?g.variable.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVariable=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The variable will be deleted.").ariaLabel("Delete Variable").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.variable.delete({id:g.variable.id}).$promise.then(function(){_.remove(g.variables,{id:g.variable.id}),o.success({title:"Variable properly deleted!",msg:(g.variable.name||"variable")+" has been deleted!"}),v(g.variable)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","variables","variable","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditVariableDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.variables=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="variables",f.listOrder="",f.listOrderAsc=null,f.selectedVariables=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{variable:e,variables:f.variables.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("variable")+"?").htmlContent("<b>"+(e.name||"variable")+"</b> will be deleted.").ariaLabel("delete variable").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVariables=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.variable.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Variables",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVariable=function(e,n){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{variable:n,variables:f.variables.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVariable=y,f.exportSelectedVariables=function(){var e=angular.copy(f.selectedVariables);return f.selectedVariables=[],e},f.deleteSelectedVariables=function(e){var n=i.confirm().title("Are you sure want to delete the selected variables?").htmlContent("<b>"+f.selectedVariables.length+" selected</b> will be deleted.").ariaLabel("delete Variables").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVariables.forEach(function(e){y(e)}),f.selectedVariables=[]})},f.deselectVariables=function(){f.selectedVariables=[]},f.selectAllVariables=function(){f.selectedVariables=f.variables.rows};var b=!0,A=1;function E(e){f.variables=e||{count:0,rows:[]}}function y(e){m.variable.delete({id:e.id}).$promise.then(function(){_.remove(f.variables.rows,{id:e.id}),f.variables.count-=1,f.variables.rows.length||f.getVariables(),p.success({title:_.startCase("Variable")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvariable"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvariable",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVariables())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","variables","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("VariablesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VIDEO.EDIT_SCREENRECORDING",g.screenRecording=angular.copy(l),g.screenRecordings=r,g.newscreenRecording=!1,g.screenRecording||(g.screenRecording={},g.title="VIDEO.NEW_SCREENRECORDING",g.newscreenRecording=!0),g.addNewscreenRecording=function(){g.errors=[],d.screenRecording.save(g.screenRecording).$promise.then(function(e){g.screenRecordings.unshift(e.toJSON()),o.success({title:"screenRecording properly created",msg:g.screenRecording.name?g.screenRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savescreenRecording=function(){g.errors=[],d.screenRecording.update({id:g.screenRecording.id},g.screenRecording).$promise.then(function(e){var n=_.find(g.screenRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"screenRecording properly saved!",msg:g.screenRecording.name?g.screenRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletescreenRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The screenRecording will be deleted.").ariaLabel("Delete screenRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.screenRecording.delete({id:g.screenRecording.id}).$promise.then(function(){_.remove(g.screenRecordings,{id:g.screenRecording.id}),o.success({title:"screenRecording properly deleted!",msg:(g.screenRecording.name||"screenRecording")+" has been deleted!"}),v(g.screenRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.user.get({fields:"id,name,fullname",sort:"name",nolimit:"true"}).$promise.then(function(e){g.users=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","screenRecordings","screenRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.video").controller("CreateOrEditscreenRecordingDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c,m=this;if(m.loading=!1,m.recording=Object.assign({},i),m.route="screenRecording",m.element=l,m.actionOptions=Object.assign({},s),m.path=r,m.label=o,m.app="video",m.model="screenRecording",console.log("TCL: vm.path",m.path),console.log("TCL: vm.recording[vm.path]",m.recording[m.path]),m.filename=-1<m.recording[m.path].indexOf("/")?m.recording[m.path].substring(m.recording[m.path].lastIndexOf("/")+1):-1<m.recording[m.path].indexOf("\\")?m.recording[m.path].substring(m.recording[m.path].lastIndexOf("\\")+1):m.recording[m.path],m.format=!1,_.isNil(m.recording.format)&&(m.recording.format=m.filename.slice(m.filename.lastIndexOf("."))),(".wav"===m.recording.format&&"audio"===m.element||".mp4"===m.recording.format&&"video"===m.element)&&(m.format=!0),m.found=!0,m.format&&(c=d.defer(),a.screenRecording.download({id:m.recording.id,path:String(m.path)}).$promise.then(function(e){m.format=!0,m.found=!0,c.resolve()}).catch(function(e){console.log("err"),m.format=!1,m.found=!1,c.resolve()}),c.promise),!_.isNil(s.properties)&&s.properties){if(m.properties=Object.assign({},i),Object.keys(i).forEach(function(e){String(e[0].toUpperCase())===String(e[0])&&delete m.properties[e]}),m.propertiesDefault={},!_.isNil(s.propertiesList)&&0<s.propertiesList.length){m.propertiesDefault=Object.assign({},i);var u=s.propertiesList,p=Object.keys(i),g=!0;p.forEach(function(n){g=!0,u.forEach(function(e){String(n)===String(e)&&(g=!1)}),g&&delete m.propertiesDefault[n]}),m.properties=m.propertiesDefault}if(!_.isNil(s.extraData)&&0<s.extraData.length){m.propertiesExtra={};for(var v=s.extraData,h=0;h<v.length;h++)for(var f=v[h].values,b=v[h].model,A=0;A<f.length;A++)m.propertiesExtra[f[A].text]=i[b][f[A].key];m.properties=Object.assign({},m.propertiesDefault,m.propertiesExtra)}}m.closeDialog=function(){n.hide()}}e.$inject=["$scope","$mdDialog","toasty","api","recording","actionOptions","label","varPath","elementTag","$q"],angular.module("app.video").controller("screenRecordingplayController",e)}(),function(){"use strict";function e(e,n,t,a,r,l,i,o,s,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.screenRecordings=s||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="screenRecordings",f.listOrder="",f.listOrderAsc=null,f.selectedScreenRecordings=[],f.query={fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:"@msUtils.firstLastDayMonth()",includeAll:"true",sort:"-updatedAt",limit:10,page:1},f.query.createdAt=u.firstLastDayMonth(),f.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE_RANGE"}],f.playrecording=function(e,n,t,a,i){var s={route:"screenRecording",name:"screenRecordings",model:"screenRecording",singular:"screenRecording"},a=String(a),o=String(t);console.log("TCL:  path",String(t)),r.show({controller:"screenRecordingplayController",controllerAs:"vm",templateUrl:"app/main/apps/video/views/screenRecordings/partialViews/play.html",parent:angular.element(l.body),targetEvent:n,clickOutsideToClose:!0,locals:{recording:e,recordings:f.screenRecordings.rows,license:f.license,setting:null,item:s,actionOptions:{upperTitle:!1,lowerTitle:!0,properties:!0,propertiesIcon:"icon-video",propertiesList:["format","interactionid","duration","startedAt","closedAt","createdAt"],extraData:[{model:"User",values:[{key:"name",text:"agentname"}]}]},label:a,varPath:o,elementTag:String(i)}})},f.downloadfile2=function(e,n){var t=!1,a=_.isNil(e.format)?e.value.substring(e.value.lastIndexOf(".")):e.format;t=".mp4"===a;var s=-1<e.value.lastIndexOf("/")?e.value.substring(e.value.lastIndexOf("/")+1):-1<e.value.lastIndexOf("\\")?e.value.substring(e.value.lastIndexOf("\\")+1):e.value;return m.screenRecording.download({id:e.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:o.instant("VIDEO.CANT_DOWNLOAD_THIS_FILE"),msg:o.instant("VIDEO.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:o.instant("VIDEO.CANT_DOWNLOAD_THIS_FILE"),msg:o.instant("VIDEO.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=r.confirm().title("Are you sure want to delete the "+_.startCase("screenRecording")+"?").htmlContent("<b>"+(e.name||"screenRecording")+"</b> will be deleted.").ariaLabel("delete screenRecording").targetEvent(n).ok("OK").cancel("CANCEL");r.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getScreenRecordings=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.screenRecording.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ScreenRecordings",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditscreenRecording=function(e,n){r.show({controller:"CreateOrEditscreenRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/video/views/screenRecordings/create/dialog.html",parent:angular.element(l.body),targetEvent:e,clickOutsideToClose:!0,locals:{screenRecording:n,screenRecordings:f.screenRecordings.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletescreenRecording=y,f.exportSelectedScreenRecordings=function(){var e=angular.copy(f.selectedScreenRecordings);return f.selectedScreenRecordings=[],e},f.deleteSelectedScreenRecordings=function(e){var n=r.confirm().title("Are you sure want to delete the selected screenRecordings?").htmlContent("<b>"+f.selectedScreenRecordings.length+" selected</b> will be deleted.").ariaLabel("delete screenRecordings").targetEvent(e).ok("OK").cancel("CANCEL");r.show(n).then(function(){f.selectedScreenRecordings.forEach(function(e){y(e)}),f.selectedScreenRecordings=[]})},f.deselectScreenRecordings=function(){f.selectedScreenRecordings=[]},f.selectAllScreenRecordings=function(){f.selectedScreenRecordings=f.screenRecordings.rows},f.convertDuration=function(e){var n=Math.floor(e/1e3%60),t=Math.floor(e/6e4%60),a=Math.floor(e/36e5%24),i=a<10?"0"+String(a):String(a),s=t<10?"0"+String(t):String(t),o=n<10?"0"+String(n):String(n);return i+":"+s+":"+o},m.user.get({fields:"id,name,fullname",sort:"name",nolimit:"true"}).$promise.then(function(e){f.users=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.screenRecordings=e||{count:0,rows:[]}}function y(e){m.screenRecording.delete({id:e.id}).$promise.then(function(){_.remove(f.screenRecordings.rows,{id:e.id}),f.screenRecordings.count-=1,f.screenRecordings.rows.length||f.getScreenRecordings(),p.success({title:_.startCase("screenRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEscreenRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEscreenRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getScreenRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","screenRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.video").controller("ScreenRecordingsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(e){return _.isEmpty(e)||isNaN(e)?e:parseInt(e,10)}function m(e){switch(e){case"sound":if(!d.application.appdata)return;return[{key:"save_name",value:d.application.appdata.split("/").pop()}];case"squareProject":if(!d.application.project)return;return[{key:"name",value:d.application.project.split(",")[1]}];case"tag":if(!d.application.tag)return;return[{key:"name",value:d.application.tag}];case"trunk":if(!d.application.trunk)return;return[{key:"name",value:d.application.trunk}];case"user":if(!d.application.user&&!d.application.users)return;return d.application.user?[{key:"name",value:d.application.user.split("/")[1]}]:_.map(d.application.users,function(e){return{key:"name",value:e.split("/")[1]}});case"variable":if(!d.application.name)return;return[{key:"name",value:d.application.name}];case"voiceContext":if(!d.application.context)return;return[{key:"name",value:d.application.context}];case"voiceMail":if(!d.application.voiceMail)return;return[{key:"mailbox",value:d.application.voiceMail.split("@")[0]}];case"voiceQueue":if(!d.application.queue)return;return[{key:"name",value:d.application.queue}]}}function u(){o.getResourcesByRole(d.currentUser,"trunk",{fields:"id,name",sort:"name",nolimit:"true"},m("trunk")).then(function(e){d.trunks=e}).catch(function(){s.error({title:i.instant("TOOLS.TRUNKS"),msg:i.instant("VOICE.NOTIFICATIONS.TRUNKS_GET_ERROR")})})}function p(){o.getResourcesByRole(d.currentUser,"sound",{fields:"id,name,save_name",sort:"name",nolimit:"true"},m("sound")).then(function(e){d.sounds=e}).catch(function(){s.error({title:i.instant("TOOLS.SOUNDS"),msg:i.instant("VOICE.NOTIFICATIONS.SOUNDS_GET_ERROR")})})}function g(){var e={fields:"id,name,role",sort:"name",nolimit:"true"},n=m("user"),t=[o.getResourcesByRole(d.currentUser,"user",_.merge(e,{role:"agent"}),n,"Agents"),o.getResourcesByRole(d.currentUser,"user",_.merge(e,{role:"telephone"}),n,"Telephones")];a.all(t).then(function(e){var n=_(e).flatMap(function(e){return e.rows}).orderBy([function(e){return e.name.toLowerCase()}]).value();d.users={rows:n,count:n.length}}).catch(function(){s.error({title:i.instant("STAFF.USERS"),msg:i.instant("VOICE.NOTIFICATIONS.USERS_GET_ERROR")})})}function v(){(d.application.appdata||"custom"===d.application.appType)&&e.hide(d.application),e.hide()}d.currentUser=r.getCurrentUser(),d.application=angular.copy(n),d.crudPermissions=l,d.errors=[],d.init=function(){d.application.appdata&&function(){var e=[];switch(d.application.appType){case"agi":d.application.project=d.application.appdata;break;case"dial":e=d.application.appdata.split(","),d.application.tech=c(e[0]),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"externalDial":e=d.application.appdata.split(","),d.application.trunk=e[0].split("/")[1],d.application.phone=e[0].split("/")[2],d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"goTo":e=d.application.appdata.split(","),d.application.context=c(e[0]),d.application.extension=c(e[1]),d.application.priority=c(e[2]);break;case"internalDial":e=d.application.appdata.split(","),d.application.user=c(e[0]),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"outboundDial":e=d.application.appdata.split(","),d.application.trunk=e[0].split("/")[1],d.application.phone=e[0].split("/")[2],d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]),d.application.prefix=d.application.phone?d.application.phone.split("$")[0]:void 0,d.application.callerId=d.application.callerID?"CALLERID(all)="+d.application.callerID:void 0;break;case"playback":e=d.application.appdata.split(","),d.application.appdata=c(e[0]),d.application.options=c(e[1]);break;case"queue":e=d.application.appdata.split(","),d.application.queue=c(e[0]),d.application.options=c(e[1]),d.application.URL=c(e[2]),d.application.sound=c(e[3]),d.application.timeout=c(e[4]),d.application.agi=c(e[5]),d.application.macro=c(e[6]),d.application.gosub=c(e[7]),d.application.rule=c(e[8]),d.application.position=c(e[9]);break;case"ringGroup":e=d.application.appdata.split(","),d.application.users=e[0].split("&"),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"set":e=d.application.appdata.split("="),d.application.name=e[0],d.application.value=e[1];break;case"voicemail":e=d.application.appdata.split(","),d.application.voiceMail=c(e[0]),d.application.options=c(e[1])}}();switch(d.application.appType){case"agi":o.getResourcesByRole(d.currentUser,"squareProject",{fields:"id,name",sort:"name",nolimit:"true"},m("squareProject")).then(function(e){d.projects=e}).catch(function(){s.error({title:i.instant("CALLYSQUARE.CALLYSQUARE")+" "+i.instant("CALLYSQUARE.PROJECTS"),msg:i.instant("VOICE.NOTIFICATIONS.CALLYSQUARE_PROJECTS_GET_ERROR")})});break;case"externalDial":u();break;case"goTo":o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:"true"},m("voiceContext")).then(function(e){d.contexts=e}).catch(function(){s.error({title:i.instant("VOICE.CONTEXTS"),msg:i.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});break;case"internalDial":g();break;case"outboundDial":o.getResourcesByRole(d.currentUser,"tag",{fields:"id,name",sort:"name",nolimit:"true"},m("tag")).then(function(e){d.tags=e}).catch(function(){s.error({title:i.instant("TOOLS.TAGS"),msg:i.instant("VOICE.NOTIFICATIONS.TAGS_GET_ERROR")})}),u();break;case"playback":p();break;case"queue":p(),o.getResourcesByRole(d.currentUser,"voiceQueue",{type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"},m("voiceQueue")).then(function(e){d.queues=e}).catch(function(){s.error({title:i.instant("VOICE.VOICEQUEUES"),msg:i.instant("VOICE.NOTIFICATIONS.QUEUES_GET_ERROR")})});break;case"ringGroup":g();break;case"set":o.getResourcesByRole(d.currentUser,"variable",{fields:"id,name",sort:"name",nolimit:"true"},m("variable")).then(function(e){d.variables=e}).catch(function(){s.error({title:i.instant("TOOLS.VARIABLES"),msg:i.instant("VOICE.NOTIFICATIONS.VARIABLES_GET_ERROR")})});break;case"voicemail":o.getResourcesByRole(d.currentUser,"voiceMail",{fields:"id,mailbox",sort:"mailbox",nolimit:"true"},m("voiceMail")).then(function(e){d.voiceMails=e}).catch(function(){s.error({title:i.instant("VOICE.VOICEMAILS"),msg:i.instant("VOICE.NOTIFICATIONS.VOICEMAILS_GET_ERROR")})})}},d.saveRoutingApp=function(){d.errors=[],function(){var e=[];switch(d.application.appType){case"agi":d.application.appdata=d.application.project;break;case"dial":e[0]=d.application.tech,e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"externalDial":e[0]=["SIP",d.application.trunk,d.application.phone].join("/"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"goTo":e[0]=d.application.context,e[1]=d.application.extension,e[2]=d.application.priority,d.application.appdata=e.join(",");break;case"internalDial":e[0]=d.application.user,e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"outboundDial":d.application.phone=t.cutdigits?(d.application.prefix||"")+"${EXTEN:"+t.cutdigits+"}":(d.application.prefix||"")+"${EXTEN}","none"===t.recordingFormat?d.application.options=d.application.options.replace("U(xcally-mixmonitor-context)",""):d.application.options.indexOf("U(xcally-mixmonitor-context)")<0&&(d.application.options+="U(xcally-mixmonitor-context)"),e[0]=["SIP",d.application.trunk,d.application.phone].join("/"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"playback":e[0]=d.application.appdata,e[1]=d.application.options,d.application.appdata=e.join(",");break;case"queue":e[0]=d.application.queue,e[1]=d.application.options,e[2]=d.application.URL,e[3]=d.application.sound,e[4]=d.application.timeout,e[5]=d.application.agi,e[6]=d.application.macro,e[7]=d.application.gosub,e[8]=d.application.rule,e[9]=d.application.position,d.application.appdata=e.join(",");break;case"ringGroup":e[0]=d.application.users.join("&"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"set":e[0]=d.application.name,e[1]=d.application.value,d.application.appdata=e.join("=");break;case"voicemail":e[0]=d.application.voiceMail,e[1]=d.application.options,d.application.appdata=e.join(",")}}(),v()},d.closeDialog=v}e.$inject=["$mdDialog","$q","$translate","toasty","application","route","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditRoutingAppDialogController",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o,r,l){var d=this;function c(){var e=[{key:"name",value:d.interval.IntervalId}];s.getResourcesByRole(d.currentUser,"interval",{fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0},e).then(function(e){d.intervals=e}).catch(function(){i.error({title:t.instant("TOOLS.INTERVALS"),msg:t.instant("VOICE.NOTIFICATIONS.INTERVALS_GET_ERROR")})})}function m(e){n.hide(e)}d.currentUser=o.getCurrentUser(),d.interval=angular.copy(e),d.intervals=a||{rows:[],count:0},d.types=["always","custom","list"],d.crudPermissions=r,d.errors=[],d.daysOfWeek=l.getDaysOfWeek(),d.monthNumber=l.getMonthNumber(),d.monthName=l.getMonthName(),d.daysOfMonth=l.getDaysOfMonth(),d.initialize=function(){if("*,*,*,*"===d.interval.interval)return d.type=d.interval.IntervalId&&d.interval.application?"list":"always",void("list"===d.type&&c());d.type="custom";var e=d.interval.interval.split(","),n=e[0],t=e[1],a=e[2],i=e[3];if("*"!==n){var s,o=n.split("-")[0],r=n.split("-")[1];(s=new Date).setHours(Number(o.split(":")[0])),s.setMinutes(Number(o.split(":")[1])),d.timeRangeFrom=s,(s=new Date).setHours(Number(r.split(":")[0])),s.setMinutes(Number(r.split(":")[1])),d.timeRangeTo=s}"*"!==t&&(d.dayOfWeekFrom=t.split("-")[0],d.dayOfWeekTo=t.split("-")[1]);"*"!==a&&(d.monthDayFrom=a.split("-")[0],d.monthDayTo=a.split("-")[1]);"*"!==i&&(d.monthFrom=i.split("-")[0],d.monthTo=i.split("-")[1])},d.onTypeChange=function(){"list"===d.type&&0===d.intervals.count&&c()},d.saveInterval=function(){d.errors=[],d.interval.interval=function(){if(["always","list"].includes(d.type))return"*,*,*,*";var e=[];if("*"!==d.timeRangeFrom&&d.timeRangeFrom&&d.timeRangeTo){var n=(d.timeRangeFrom.getHours()<10?"0":"")+d.timeRangeFrom.getHours()+":"+(d.timeRangeFrom.getMinutes()<10?"0":"")+d.timeRangeFrom.getMinutes(),t=(d.timeRangeTo.getHours()<10?"0":"")+d.timeRangeTo.getHours()+":"+(d.timeRangeTo.getMinutes()<10?"0":"")+d.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return d.dayOfWeekFrom?d.dayOfWeekTo?e.push(d.dayOfWeekFrom+"-"+d.dayOfWeekTo):e.push(d.dayOfWeekFrom):e.push("*"),d.monthDayFrom?d.monthDayTo?e.push(d.monthDayFrom+"-"+d.monthDayTo):e.push(d.monthDayFrom):e.push("*"),d.monthFrom?d.monthTo?e.push(d.monthFrom+"-"+d.monthTo):e.push(d.monthFrom):e.push("*"),e.join()}(),"list"!==d.type&&(d.interval.IntervalId=null);m(d.interval)},d.closeDialog=m}e.$inject=["$mdDialog","$translate","interval","intervals","toasty","api","Auth","crudPermissions","IndexFactory"],angular.module("app.voice").controller("EditRoutingIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chanSpies=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chanSpies",f.listOrder="",f.listOrderAsc=null,f.selectedChanSpies=[],f.query={fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,page:1},f.arrayoptions=_.keyBy([{option:"b: Only spy on channels involved in a bridged call.",value:"'b'"},{option:"B: Instead of whispering on a single channel barge in on both channels involved in the call.",value:"'B'"},{option:"E: Exit when the spied-on channel hangs up.",value:"'E'"},{option:"o: Only listen to audio coming from this channel.",value:"'o'"},{option:"q: Don't play a beep when beginning to spy on a channel, or speak the selected channel name.",value:"'q'"},{option:"s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.",value:"'s'"},{option:"S: Stop when no more channels are left to spy on.",value:"'S'"},{option:"w: Enable whisper mode, so the spying channel can talk to the spied-on channel.",value:"'w'"},{option:"W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.",value:"'W'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayrecordingFormat=_.keyBy([{option:"wav",value:"'wav'"},{option:"gsm",value:"'gsm'"},{option:"wav49",value:"'WAV'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chanSpy:e,chanSpies:f.chanSpies.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chanSpy")+"?").htmlContent("<b>"+(e.name||"chanSpy")+"</b> will be deleted.").ariaLabel("delete chanSpy").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getChanSpies=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceChanSpy.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChanSpies",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditchanSpy=function(e,n){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chanSpy:n,chanSpies:f.chanSpies.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletechanSpy=y,f.exportSelectedChanSpies=function(){var e=angular.copy(f.selectedChanSpies);return f.selectedChanSpies=[],e},f.deleteSelectedChanSpies=function(e){var n=i.confirm().title("Are you sure want to delete the selected chanSpies?").htmlContent("<b>"+f.selectedChanSpies.length+" selected</b> will be deleted.").ariaLabel("delete chanSpys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChanSpies.forEach(function(e){y(e)}),f.selectedChanSpies=[]})},f.deselectChanSpies=function(){f.selectedChanSpies=[]},f.selectAllChanSpies=function(){f.selectedChanSpies=f.chanSpies.rows};var b=!0,A=1;function E(e){f.chanSpies=e||{count:0,rows:[]}}function y(e){m.voiceChanSpy.delete({id:e.id}).$promise.then(function(){_.remove(f.chanSpies.rows,{id:e.id}),f.chanSpies.count-=1,f.chanSpies.rows.length||f.getChanSpies(),p.success({title:_.startCase("chanSpy")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceChanSpy"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceChanSpy",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChanSpies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chanSpies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("ChanSpiesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CHANSPY",g.chanSpy=angular.copy(l),g.chanSpies=r,g.newchanSpy=!1,g.chanSpy||(g.chanSpy={recordingFormat:"wav"},g.title="VOICE.NEW_CHANSPY",g.newchanSpy=!0),g.addNewchanSpy=function(){g.errors=[],d.voiceChanSpy.save(g.chanSpy).$promise.then(function(e){g.chanSpies.unshift(e.toJSON()),o.success({title:"chanSpy properly created",msg:g.chanSpy.name?g.chanSpy.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savechanSpy=function(){g.errors=[],d.voiceChanSpy.update({id:g.chanSpy.id},g.chanSpy).$promise.then(function(e){var n=_.find(g.chanSpies,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"chanSpy properly saved!",msg:g.chanSpy.name?g.chanSpy.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletechanSpy=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chanSpy will be deleted.").ariaLabel("Delete chanSpy").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceChanSpy.delete({id:g.chanSpy.id}).$promise.then(function(){_.remove(g.chanSpies,{id:g.chanSpy.id}),o.success({title:"chanSpy properly deleted!",msg:(g.chanSpy.name||"chanSpy")+" has been deleted!"}),v(g.chanSpy)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chanSpies","chanSpy","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditchanSpyDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.contexts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="contexts",f.listOrder="",f.listOrderAsc=null,f.selectedContexts=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{context:e,contexts:f.contexts.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("context")+"?").htmlContent("<b>"+(e.name||"context")+"</b> will be deleted.").ariaLabel("delete context").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getContexts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceContext.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Contexts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditContext=function(e,n){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{context:n,contexts:f.contexts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteContext=y,f.exportSelectedContexts=function(){var e=angular.copy(f.selectedContexts);return f.selectedContexts=[],e},f.deleteSelectedContexts=function(e){var n=i.confirm().title("Are you sure want to delete the selected contexts?").htmlContent("<b>"+f.selectedContexts.length+" selected</b> will be deleted.").ariaLabel("delete Contexts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedContexts.forEach(function(e){y(e)}),f.selectedContexts=[]})},f.deselectContexts=function(){f.selectedContexts=[]},f.selectAllContexts=function(){f.selectedContexts=f.contexts.rows};var b=!0,A=1;function E(e){f.contexts=e||{count:0,rows:[]}}function y(e){m.voiceContext.delete({id:e.id}).$promise.then(function(){_.remove(f.contexts.rows,{id:e.id}),f.contexts.count-=1,f.contexts.rows.length||f.getContexts(),p.success({title:_.startCase("Context")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceContext"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceContext",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getContexts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contexts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("ContextsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CONTEXT",g.context=angular.copy(l),g.contexts=r,g.newContext=!1,g.context||(g.context={},g.title="VOICE.NEW_CONTEXT",g.newContext=!0),g.addNewContext=function(){g.errors=[],d.voiceContext.save(g.context).$promise.then(function(e){g.contexts.unshift(e.toJSON()),o.success({title:"Context properly created",msg:g.context.name?g.context.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContext=function(){g.errors=[],d.voiceContext.update({id:g.context.id},g.context).$promise.then(function(e){var n=_.find(g.contexts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Context properly saved!",msg:g.context.name?g.context.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContext=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The context will be deleted.").ariaLabel("Delete Context").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceContext.delete({id:g.context.id}).$promise.then(function(){_.remove(g.contexts,{id:g.context.id}),o.success({title:"Context properly deleted!",msg:(g.context.name||"context")+" has been deleted!"}),v(g.context)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","contexts","context","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditContextDialogController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.inboundRoute=angular.copy(s),d.inboundRoutes=n,d.newInboundRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.inboundRoute||(d.inboundRoute={appdata:"Inbound Call",type:"inbound",context:"from-voip-provider"},d.newInboundRoute=!0);e=[{key:"name",value:d.inboundRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newinboundRoute)return;var e={sort:"priority",VoiceExtensionId:d.inboundRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewInboundRoute=function(){d.errors=[],o.voiceExtension.save(d.inboundRoute).$promise.then(function(e){c(e.id).then(function(){d.inboundRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveInboundRoute=function(){d.errors=[],o.voiceExtension.update({id:d.inboundRoute.id},d.inboundRoute).$promise.then(function(e){var n=_.find(d.inboundRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.inboundRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteInboundRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.inboundRoute.exten})).ariaLabel("Delete inbound route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.inboundRoute.id}).$promise.then(function(){_.remove(d.inboundRoutes,{id:d.inboundRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.inboundRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","inboundRoutes","inboundRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInboundRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.inboundRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.inboundRoute=l||e.params.inboundRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.inboundRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"AGI",appAlias:"CallySquare",appType:"agi",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"Dial",appType:"dial",context:"from-sip",type:"Inbound",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Inbound",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Inbound",interval:"*,*,*,*",options:"xX"},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Inbound",interval:"*,*,*,*",options:"xX"},{app:"Playback",appType:"playback",context:"from-sip",type:"Inbound",interval:"*,*,*,*",answer:!0},{app:"Queue",appType:"queue",context:"from-sip",type:"Inbound",options:"xX",appdata:",xX,,,300,,,,,",interval:"*,*,*,*",answer:!0},{app:"Set",appType:"set",context:"from-sip",type:"Inbound",separator:"=",interval:"*,*,*,*"},{app:"Voicemail",appType:"voicemail",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"goto",appType:"goTo",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"hangup",appType:"hangup",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Inbound",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.inboundRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoInboundRoutes=function(){e.go("app.voice.inboundRoutes",{},{reload:"app.voice.inboundRoutes"})},m.saveInboundRoute=function(){o.voiceExtension.update({id:m.inboundRoute.id},m.inboundRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.inboundRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","inboundRoute","contexts","userProfileSection"],angular.module("app.voice").controller("InboundRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.inboundRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="InboundRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.inboundRoutes.rows,{id:e.id}),g.inboundRoutes.count-=1,g.inboundRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.inboundRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedInboundRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.inboundRoutes.edit",{id:e.id,inboundRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditInboundRoute=function(e,n){a.show({controller:"CreateOrEditInboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundRoute:n,inboundRoutes:g.inboundRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getInboundRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedInboundRoutes=function(){var e=angular.copy(g.selectedInboundRoutes);return g.selectedInboundRoutes=[],e},g.deleteSelectedInboundRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedInboundRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedInboundRoutes.forEach(function(e){f(e)}),g.selectedInboundRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","inboundRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("InboundRoutesController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.internalRoute=angular.copy(s),d.internalRoutes=n,d.newInternalRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.internalRoute||(d.internalRoute={appdata:"Internal Call",type:"internal",context:"from-sip"},d.newInternalRoute=!0);e=[{key:"name",value:d.internalRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newInternalRoute)return;var e={sort:"priority",VoiceExtensionId:d.internalRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewInternalRoute=function(){d.errors=[],o.voiceExtension.save(d.internalRoute).$promise.then(function(e){c(e.id).then(function(){d.internalRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveInternalRoute=function(){d.errors=[],o.voiceExtension.update({id:d.internalRoute.id},d.internalRoute).$promise.then(function(e){var n=_.find(d.internalRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.internalRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteInternalRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.internalRoute.exten})).ariaLabel("Delete internal route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.internalRoute.id}).$promise.then(function(){_.remove(d.internalRoutes,{id:d.internalRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.internalRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","internalRoutes","internalRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInternalRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.internalRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.internalRoute=l||e.params.internalRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.internalRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"AGI",appAlias:"CallySquare",appType:"agi",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"Dial",appType:"dial",context:"from-sip",type:"Internal",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Internal",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Internal",interval:"*,*,*,*",options:"xX"},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Internal",interval:"*,*,*,*",options:"xX"},{app:"Playback",appType:"playback",context:"from-sip",type:"Internal",interval:"*,*,*,*",answer:!0},{app:"Queue",appType:"queue",context:"from-sip",type:"Internal",options:"xX",appdata:",xX,,,300,,,,,",interval:"*,*,*,*",answer:!0},{app:"Set",appType:"set",context:"from-sip",type:"Internal",separator:"=",interval:"*,*,*,*"},{app:"Voicemail",appType:"voicemail",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"goto",appType:"goTo",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"hangup",appType:"hangup",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Internal",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.internalRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoInternalRoutes=function(){e.go("app.voice.internalRoutes",{},{reload:"app.voice.internalRoutes"})},m.saveInternalRoute=function(){o.voiceExtension.update({id:m.internalRoute.id},m.internalRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.internalRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","internalRoute","contexts","userProfileSection"],angular.module("app.voice").controller("InternalRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.internalRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="InternalRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.internalRoutes.rows,{id:e.id}),g.internalRoutes.count-=1,g.internalRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.internalRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedInternalRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.internalRoutes.edit",{id:e.id,internalRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditInternalRoute=function(e,n){a.show({controller:"CreateOrEditInternalRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalRoute:n,internalRoutes:g.internalRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getInternalRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedInternalRoutes=function(){var e=angular.copy(g.selectedInternalRoutes);return g.selectedInternalRoutes=[],e},g.deleteSelectedInternalRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedInternalRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedInternalRoutes.forEach(function(e){f(e)}),g.selectedInternalRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","internalRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("InternalRoutesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MUSICONHOLD",g.musiconhold=angular.copy(l),g.musiconholds=r,g.newMusicOnHold=!1,g.musiconhold||(g.musiconhold={mode:"files"},g.title="VOICE.NEW_MUSICONHOLD",g.newMusicOnHold=!0),g.addNewMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.save(g.musiconhold).$promise.then(function(e){g.musiconholds.unshift(e.toJSON()),o.success({title:"MusicOnHold properly created",msg:g.musiconhold.name?g.musiconhold.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.musiconhold.id},g.musiconhold).$promise.then(function(e){var n=_.find(g.musiconholds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MusicOnHold properly saved!",msg:g.musiconhold.name?g.musiconhold.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMusicOnHold=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The musiconhold will be deleted.").ariaLabel("Delete MusicOnHold").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMusicOnHold.delete({id:g.musiconhold.id}).$promise.then(function(){_.remove(g.musiconholds,{id:g.musiconhold.id}),o.success({title:"MusicOnHold properly deleted!",msg:(g.musiconhold.name||"musiconhold")+" has been deleted!"}),v(g.musiconhold)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","musiconholds","musiconhold","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMusicOnHoldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.musiconholdMohSounds=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceMusicOnHold.getSounds(m.query,u).$promise}function g(e){d.voiceMusicOnHold.removeSound({id:t.params.id,id2:e.id}).$promise.then(function(){_.remove(m.musiconholdMohSounds.rows,{id:e.id}),m.musiconholdMohSounds.count-=1,m.musiconholdMohSounds.rows.length||p(),l.success({title:"MohSound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMusicOnHold"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.musiconhold={},m.musiconholdMohSounds={count:0,rows:[]},m.selectedMusicOnHoldMohSounds=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,save_name,converted_format,audio",limit:10,page:1},m.init=function(e,n){m.musiconhold=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceMusicOnHoldId=m.musiconhold.id,m.query.id=m.musiconhold.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the mohSound?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("mohSound #")+e.id||"mohSound")+"</b> will be deleted.").ariaLabel("delete mohSound").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.voiceMusicOnHoldDownload=function(s,e,n){return d.sound.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="mohSound"+s.id,a=new Blob(n,{type:e.type});t=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=u,m.getMusicOnHoldMohSounds=p,m.createOrEditMusicOnHoldMohSound=function(e,n){o.show({controller:"CreateOrEditMohSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:m.musiconhold,mohSound:n,mohSounds:m.musiconholdMohSounds.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedMusicOnHoldMohSounds=function(){var e=angular.copy(m.selectedMusicOnHoldMohSounds);return m.selectedMusicOnHoldMohSounds=[],e},m.deleteMusicOnHoldMohSound=g,m.deleteSelectedMusicOnHoldMohSounds=function(e){var n=o.confirm().title("Are you sure want to delete the selected mohSounds?").htmlContent("<b>"+m.selectedMusicOnHoldMohSounds.length+" selected</b> will be deleted.").ariaLabel("delete mohSounds").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMusicOnHoldMohSounds.forEach(function(e){g(e)}),m.selectedMusicOnHoldMohSounds=[]})},c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.sounds,{id:e.resourceId})}),t=null;if(m.musiconhold&&(t=_.find(m.sounds,{id:Number(m.musiconhold.id)})),t&&!_.some(n,["id",t.id])){var a=_.find(m.sounds,{id:t.id});a.canSelect=!1,n.push(a)}m.sounds=n})}else{var t=[],a=null;m.musiconhold&&(a=_.find(m.sounds,{id:Number(m.musiconhold.id)}));for(var i=0;i<m.sounds.length;i++)a&&m.sounds[i].id===a.id&&(m.sounds[i].canSelect=!1,t.push(m.sounds[i]));m.sounds=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("MusicOnHoldMohSoundsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MOHSOUND",g.mohSound=angular.copy(l),g.mohSounds=r,g.newMohSound=!1,g.mohSound||(g.mohSound={},g.title="VOICE.NEW_MOHSOUND",g.newMohSound=!0),n.params.id&&(g.mohSound.VoiceMusicOnHoldId=n.params.id),g.addNewMohSound=function(){g.errors=[],d.voiceMusicOnHold.addSound({id:n.params.id},g.mohSound).$promise.then(function(e){g.mohSounds.unshift(e.toJSON()),o.success({title:"MohSound properly created",msg:g.mohSound.name?g.mohSound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMohSound=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.mohSound.id},g.mohSound).$promise.then(function(e){var n=_.find(g.mohSounds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MohSound properly saved!",msg:g.mohSound.name?g.mohSound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMohSound=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mohSound will be deleted.").ariaLabel("Delete MohSound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMusicOnHold.delete({id:g.mohSound.id}).$promise.then(function(){_.remove(g.mohSounds,{id:g.mohSound.id}),o.success({title:"MohSound properly deleted!",msg:(g.mohSound.name||"mohSound")+" has been deleted!"}),v(g.mohSound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.sounds=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.sounds,{id:e.resourceId})}),t=null;if(g.mohSound&&(t=_.find(g.sounds,{id:Number(g.mohSound.id)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.sounds,{id:t.id});a.canSelect=!1,n.push(a)}g.sounds=n})}else{var t=[],a=null;g.mohSound&&(a=_.find(g.sounds,{id:Number(g.mohSound.id)}));for(var i=0;i<g.sounds.length;i++)a&&g.sounds[i].id===a.id&&(g.sounds[i].canSelect=!1,t.push(g.sounds[i]));g.sounds=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mohSounds","mohSound","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMohSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.musiconhold=c||e.params.musiconhold||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoMusicOnHolds=function(){e.go("app.voice.musiconholds",{},{reload:"app.voice.musiconholds"})},u.saveMusicOnHold=function(){r.voiceMusicOnHold.update({id:u.musiconhold.id},u.musiconhold).$promise.then(function(){l.success({title:"MusicOnHold updated!",msg:u.musiconhold.name?u.musiconhold.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","musiconhold","userProfileSection"],angular.module("app.voice").controller("MusicOnHoldController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.musiconholds=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="musiconholds",f.listOrder="",f.listOrderAsc=null,f.selectedMusicOnHolds=[],f.query={fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,page:1},f.arraymode=_.keyBy([{option:"Files",value:"'files'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysort=_.keyBy([{option:"Random",value:"'random'"},{option:"Alphabetical",value:"'alpha'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.musiconholds.edit",{id:e.id,musiconhold:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("musiconhold")+"?").htmlContent("<b>"+(e.name||"musiconhold")+"</b> will be deleted.").ariaLabel("delete musiconhold").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMusicOnHolds=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceMusicOnHold.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MusicOnHolds",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMusicOnHold=function(e,n){i.show({controller:"CreateOrEditMusicOnHoldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:n,musiconholds:f.musiconholds.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMusicOnHold=y,f.exportSelectedMusicOnHolds=function(){var e=angular.copy(f.selectedMusicOnHolds);return f.selectedMusicOnHolds=[],e},f.deleteSelectedMusicOnHolds=function(e){var n=i.confirm().title("Are you sure want to delete the selected musiconholds?").htmlContent("<b>"+f.selectedMusicOnHolds.length+" selected</b> will be deleted.").ariaLabel("delete MusicOnHolds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMusicOnHolds.forEach(function(e){y(e)}),f.selectedMusicOnHolds=[]})},f.deselectMusicOnHolds=function(){f.selectedMusicOnHolds=[]},f.selectAllMusicOnHolds=function(){f.selectedMusicOnHolds=f.musiconholds.rows};var b=!0,A=1;function E(e){f.musiconholds=e||{count:0,rows:[]}}function y(e){m.voiceMusicOnHold.delete({id:e.id}).$promise.then(function(){_.remove(f.musiconholds.rows,{id:e.id}),f.musiconholds.count-=1,f.musiconholds.rows.length||f.getMusicOnHolds(),p.success({title:_.startCase("MusicOnHold")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMusicOnHold"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMusicOnHolds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","musiconholds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("MusicOnHoldsController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.outboundRoute=angular.copy(s),d.outboundRoutes=n,d.newOutboundRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.outboundRoute||(d.outboundRoute={appdata:"Outbound Call",type:"outbound",context:"from-sip",recordingFormat:"none"},d.newOutboundRoute=!0);e=[{key:"name",value:d.outboundRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newOutboundRoute)return;var e={sort:"priority",VoiceExtensionId:d.outboundRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewOutboundRoute=function(){d.errors=[],o.voiceExtension.save(d.outboundRoute).$promise.then(function(e){c(e.id).then(function(){d.outboundRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveOutboundRoute=function(){d.errors=[],o.voiceExtension.update({id:d.outboundRoute.id},d.outboundRoute).$promise.then(function(e){var n=_.find(d.outboundRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.outboundRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteOutboundRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.outboundRoute.exten})).ariaLabel("Delete outbound route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.outboundRoute.id}).$promise.then(function(){_.remove(d.outboundRoutes,{id:d.outboundRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.outboundRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","outboundRoutes","outboundRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditOutboundRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.outboundRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.outboundRoute=l||e.params.outboundRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.outboundRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",options:"xX",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Outbound",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.outboundRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoOutboundRoutes=function(){e.go("app.voice.outboundRoutes",{},{reload:"app.voice.outboundRoutes"})},m.saveOutboundRoute=function(){o.voiceExtension.update({id:m.outboundRoute.id},m.outboundRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.outboundRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","outboundRoute","contexts","userProfileSection"],angular.module("app.voice").controller("OutboundRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.outboundRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="OutboundRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.outboundRoutes.rows,{id:e.id}),g.outboundRoutes.count-=1,g.outboundRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.outboundRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedOutboundRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.outboundRoutes.edit",{id:e.id,outboundRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditOutboundRoute=function(e,n){a.show({controller:"CreateOrEditOutboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundRoute:n,outboundRoutes:g.outboundRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getOutboundRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedOutboundRoutes=function(){var e=angular.copy(g.selectedOutboundRoutes);return g.selectedOutboundRoutes=[],e},g.deleteSelectedOutboundRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedOutboundRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedOutboundRoutes.forEach(function(e){f(e)}),g.selectedOutboundRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","outboundRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("OutboundRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){return[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",options:g.agents.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:g.queues.rows,ngValue:"name"}]}function h(){return g.refresh=!1,0===g.queues.count?f(null):(g.query.queue=1===g.queues.count?g.queues.rows[0].name:g.query.queue,void 0===g.query.queue&&(g.query.queue=_.map(g.queues.rows,"name")),_.isEmpty(g.query.queue)?f(null):(g.query.offset=(g.query.page-1)*g.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.voice.abandonedCalls:"+g.currentUser.id,JSON.stringify({query:_.omit(g.query,"queue")})),void(g.promise=o.voiceQueueReport.getVoiceQueuesReport(g.query,f).$promise)))}function f(e){g.abandonedCalls=e||{count:0,rows:[]},!1,g.refresh=!0}g.currentUser=d.getCurrentUser(),g.agents=u||[],g.dispositions=p.rows,g.abandonedCalls={count:0,rows:[]},g.showTooltip=!1,g.refresh=!0,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=d.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},g.getAbandonedCalls=h,g.refreshAbandonedCalls=function(){g.showTooltip=!1,h()},g.assignTo=function(e,n){e&&o.voiceQueueReport.update({id:e.id,lastAssignedTo:n?n.name:null,assigned:!!n}).$promise.catch(function(e){console.log(e)})},g.dispose=function(t){n.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(a.body),targetEvent:t,locals:{dispositions:g.dispositions,call:t}}).then(function(e){if(e){var n={id:t.id,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)})}})},g.onSaveVoiceQueueReport=function(e){e&&g.queuesMap&&"inbound"===queue.type&&g.queuesMap[e.queue]&&(g.showTooltip=!0)},g.onUpdateVoiceQueueReport=function(e){if(e){var n=_.findIndex(g.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(g.abandonedCalls.rows[n],e)}},c.onWithoutApply("voiceQueueReport:save",g.onSaveVoiceQueueReport),c.on("voiceQueueReport:update",g.onUpdateVoiceQueueReport),function(){var e=i.localStorage.getItem("motion2.realtime.abandoned.voice.abandonedCalls:"+g.currentUser.id);if(e)(e=JSON.parse(e))&&e.query&&(g.query=_.merge(e.query,_.omit(g.query,["sort","limit","page"])),g.query=_.omit(g.query,"filter"));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};g.query.createdAt=n}d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()}):o.userProfile.getResources({id:g.currentUser.userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()})}();var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?t(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","agents","dispositions"],angular.module("app.voice").controller("AbandonedCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.calls=i||{rows:[],count:0},o.query={limit:10,page:1},o.channelStatus=s.channelStatusOut,o.onSave=function(e){var n=_.find(o.calls.rows,{channel:e.channel});e.channelstatedesc=e.dialstatus?"up":"ring",n?_.merge(n,e):e.channel&&o.calls.rows.push(e)},o.onRemove=function(e){var n=_.findIndex(o.calls.rows,{channel:e.channel});0<=n&&(o.calls.rows[n].status="hangup");t(function(){o.calls.rows.splice(n,1)},5e3)},a.on("voice_outbound_channel:save",o.onSave),a.on("voice_outbound_channel:remove",o.onRemove),e.$on("$destroy",function(){a.removeAllListeners("voice_outbound_channel:save"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$scope","$timeout","api","socket","rpcCalls","helperClasses"],angular.module("app.voice").controller("OutboundCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,a,o,t,i,s,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.queues=t?_.keyBy(t.rows?t.rows:[],"name"):{},p.rpcVoiceQueuesChannelsTmp=i?_.keyBy(i.rows?_.filter(i.rows,{type:"inbound"}):[],"uniqueid"):{},p.rpcVoiceQueuesChannels={},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.queryChannels={limit:10,page:1},p.getAvailableAgents=function(){p.availableAgents=null,s.rpc.getAgents().$promise.then(function(e){for(var n=[],t=e?e.rows:[],a=_.filter(t,{online:!0,voicePause:!1,voiceStatus:"idle"}),i=0;i<a.length;i++){var s=_.find(o.rows,["id",a[i].id]);s&&n.push(s)}p.availableAgents=n}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.getSize=function(e){return _.size(e)},p.$onInit=function(){_.forIn(p.rpcVoiceQueuesChannelsTmp,function(e,n){_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[n]=e)})},p.onSave=function(e){"inbound"===e.type&&_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[e.uniqueid]=e)},p.onRemove=function(e){p.rpcVoiceQueuesChannels[e.uniqueid]&&delete p.rpcVoiceQueuesChannels[e.uniqueid]},p.hangup=function(n){return s.rpc.getVoiceQueuesChannelHangup({uniqueid:n}).$promise.then(function(e){d.success({title:"Channel "+n+" properly hangup!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToAgent=function(n,e,t){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e,context:t}).$promise.then(function(e){d.success({title:"Channel "+n+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToNumber=function(e,n){var t=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(t).then(function(e){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e}).$promise}).then(function(e){d.success({title:"Channel "+n+" properly redirect!",msg:e.message||""})}).catch(function(e){e&&d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},r.on("voice_queue_channel:save",p.onSave),r.on("voice_queue_channel:remove",p.onRemove),e.$on("$destroy",function(){r.removeAllListeners("voice_queue_channel:save"),r.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","queues","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["total","answered","unmanaged","abandoned","sumHoldTime","sumDuration","sumBillable"];function u(){_.forIn(c.queues,function(e,n){c.rpcQueues[n]&&_.merge(e,_.pick(c.rpcQueues[n],m))})}c.count=a.count,c.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="VoiceQueues",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){c.queues[e.id]&&_.merge(c.queues[e.id],_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=n(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&n.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueParamsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"VoiceQueues":void 0,channel:"voice",type:"inbound",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("VOICE.VOICEQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:n,voiceQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:n,voiceQueues:u.queues.rows,realtime:!0,crudPermissions:u.crudPermissions}})},r.onWithoutApply("voice_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&m.updateVoiceQueue(e,n)}),r.on("userVoiceQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.VoiceQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userVoiceQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.VoiceQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:agentconnect",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);if(n){if(!t.agentconnected)return;t.queue?n.talking=!0:n.busy=!0,m.updateBusyCounter(e)}})}),r.on("user:agentcomplete",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&(n.talking?n.talking=!1:n.busy&&(n.busy=!1),m.updateBusyCounter(e))})}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"voice")})}),e.$on("$destroy",function(){r.removeAllListeners("voice_queue:save"),r.removeAllListeners("userVoiceQueue:remove"),r.removeAllListeners("userVoiceQueue:save"),r.removeAllListeners("user:agentconnect"),r.removeAllListeners("user:agentcomplete"),r.removeAllListeners("user:update"),p&&n.cancel(p)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.voice").controller("QueuesVoiceRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){var a=this;switch(a.selectedTab=0,t.current.name){case"app.voice.realtime.agents":a.selectedTab=0;break;case"app.voice.realtime.telephones":a.selectedTab=1;break;case"app.voice.realtime.trunks":a.selectedTab=2;break;case"app.voice.realtime.queues":a.selectedTab=3;break;case"app.voice.realtime.queue_calls":a.selectedTab=4;break;case"app.voice.realtime.abandonedcalls":a.selectedTab=5;break;case"app.voice.realtime.queue_params":a.selectedTab=6;break;case"app.voice.realtime.outbound_calls":a.selectedTab=7;break;default:a.selectedTab=0,t.go("app.voice.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.voice.realtime.agents");break;case 1:t.go("app.voice.realtime.telephones");break;case 2:t.go("app.voice.realtime.trunks");break;case 3:t.go("app.voice.realtime.queues");break;case 4:t.go("app.voice.realtime.queue_calls");break;case 5:t.go("app.voice.realtime.abandonedcalls");break;case 6:t.go("app.voice.realtime.queue_params");break;case 7:t.go("app.voice.realtime.outbound_calls");break;default:t.go("app.voice.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.voice").controller("VoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c){var m=this,u=["fullname","internal","state","status"];function p(){_.forIn(m.telephones,function(e,n){m.rpcTelephones[n]&&_.merge(e,_.pick(m.rpcTelephones[n],u))})}m.count=a.count,m.attributes=["fullname","internal","state","status","address"],m.telephones=a?_.keyBy(a.rows?a.rows:[],"id"):{},m.rpcTelephones=i?_.keyBy(i.rows?i.rows:[],"id"):{},m.userProfile=l,m.userProfileSection=d&&1==d.count?d.rows[0]:null,m.crudPermissions=c.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={fields:"id,fullname,internal",role:"telephone",sort:"-updatedAt",limit:10,page:1},m.statusClass=r.status,m.stateClass=r.state,m.success=h,m.$onInit=p,m.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},m.getTelephones=function(){m.query.offset=(m.query.page-1)*m.query.limit,c.hasRole("admin")?m.promise=s.user.get(m.query,h).$promise:(m.query.id=m.userProfile.id,m.query.section="Telephones",m.promise=s.userProfile.getResources(m.query,h).$promise)},m.onSave=function(e){m.telephones[e.id]&&_.merge(m.telephones[e.id],_.pick(e,u))},o.on("telephone:save",m.onSave);var g=!0,v=1;function h(e){m.telephones=e?_.keyBy(e.rows?e.rows:[],"id"):{},p()}e.$watch("vm.query.filter",function(e,n){g?t(function(){g=!1}):(n||(v=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=v),m.getTelephones())}),e.$on("$destroy",function(){o.removeAllListeners("telephone:save")})}e.$inject=["$scope","$timeout","$mdDialog","telephones","rpcTelephones","api","socket","helperClasses","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TelephonesVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,n=0;n<u.trunks.length;n+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[n].id]))&&_.merge(u.trunks[n],_.pick(u.rpcTrunks[e],p))}function v(e,n,t){0<=n&&_.merge(e[n],_.pick(t,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},u.statusClass=r.status,u.stateClass=r.state,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,n){l.go("app.tools.trunks.edit",{id:n.id})},u.onSave=function(e){var n=_.findIndex(u.trunks,["id",e.id]),t=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,n,e),v(u.rpcTrunks,t,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TrunksVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEMAIL",g.voicemail=angular.copy(l),g.voicemails=r,g.newVoicemail=!1,g.voicemail||(g.voicemail={attach:"no"},g.title="VOICE.NEW_VOICEMAIL",g.newVoicemail=!0),g.addNewVoicemail=function(){g.errors=[],d.voiceMail.save(g.voicemail).$promise.then(function(e){g.voicemails.unshift(e.toJSON()),o.success({title:"Voicemail properly created",msg:g.voicemail.name?g.voicemail.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoicemail=function(){g.errors=[],d.voiceMail.update({id:g.voicemail.id},g.voicemail).$promise.then(function(e){var n=_.find(g.voicemails,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Voicemail properly saved!",msg:g.voicemail.name?g.voicemail.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoicemail=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voicemail will be deleted.").ariaLabel("Delete Voicemail").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMail.delete({id:g.voicemail.id}).$promise.then(function(){_.remove(g.voicemails,{id:g.voicemail.id}),o.success({title:"Voicemail properly deleted!",msg:(g.voicemail.name||"voicemail")+" has been deleted!"}),v(g.voicemail)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicemails","voicemail","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoicemailDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.voicemailMessages=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceMail.getMessages(m.query,u).$promise}function g(e){d.voiceMailMessage.delete({id:e.id}).$promise.then(function(){_.remove(m.voicemailMessages.rows,{id:e.id}),m.voicemailMessages.count-=1,m.voicemailMessages.rows.length||p(),l.success({title:"Message deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMail"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.voicemail={},m.voicemailMessages={count:0,rows:[]},m.selectedVoicemailMessages=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,callerid,duration,audio,stamp,msg_id",sort:"-stamp",limit:10,page:1},m.init=function(e,n){m.voicemail=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.id=m.voicemail.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the message?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("message #")+e.id||"message")+"</b> will be deleted.").ariaLabel("delete message").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.voiceMailMessageDownload=function(s,e,n){return d.voiceMailMessage.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="message"+s.id,a=new Blob(n,{type:e.type});t=s.msg_id+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=u,m.getVoicemailMessages=p,m.createOrEditVoicemailMessage=function(e,n){o.show({controller:"CreateOrEditMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/edit/messages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:m.voicemail,message:n,messages:m.voicemailMessages.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedVoicemailMessages=function(){var e=angular.copy(m.selectedVoicemailMessages);return m.selectedVoicemailMessages=[],e},m.deleteVoicemailMessage=g,m.deleteSelectedVoicemailMessages=function(e){var n=o.confirm().title("Are you sure want to delete the selected messages?").htmlContent("<b>"+m.selectedVoicemailMessages.length+" selected</b> will be deleted.").ariaLabel("delete messages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedVoicemailMessages.forEach(function(e){g(e)}),m.selectedVoicemailMessages=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("VoicemailMessagesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.voicemail=c||e.params.voicemail||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVoicemails=function(){e.go("app.voice.voicemails",{},{reload:"app.voice.voicemails"})},u.saveVoicemail=function(){r.voiceMail.update({id:u.voicemail.id},u.voicemail).$promise.then(function(){l.success({title:"Voicemail updated!",msg:u.voicemail.name?u.voicemail.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.voicemail&&(t=_.find(u.contexts,{name:u.voicemail.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voicemail","userProfileSection"],angular.module("app.voice").controller("VoicemailController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voicemails=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voicemails",f.listOrder="",f.listOrderAsc=null,f.selectedVoicemails=[],f.query={fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,page:1},f.arrayattach=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayenvelope=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydelete=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.voicemails.edit",{id:e.id,voicemail:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voicemail")+"?").htmlContent("<b>"+(e.name||"voicemail")+"</b> will be deleted.").ariaLabel("delete voicemail").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVoicemails=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceMail.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Voicemails",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVoicemail=function(e,n){i.show({controller:"CreateOrEditVoicemailDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:n,voicemails:f.voicemails.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVoicemail=y,f.exportSelectedVoicemails=function(){var e=angular.copy(f.selectedVoicemails);return f.selectedVoicemails=[],e},f.deleteSelectedVoicemails=function(e){var n=i.confirm().title("Are you sure want to delete the selected voicemails?").htmlContent("<b>"+f.selectedVoicemails.length+" selected</b> will be deleted.").ariaLabel("delete Voicemails").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoicemails.forEach(function(e){y(e)}),f.selectedVoicemails=[]})},f.deselectVoicemails=function(){f.selectedVoicemails=[]},f.selectAllVoicemails=function(){f.selectedVoicemails=f.voicemails.rows};var b=!0,A=1;function E(e){f.voicemails=e||{count:0,rows:[]}}function y(e){m.voiceMail.delete({id:e.id}).$promise.then(function(){_.remove(f.voicemails.rows,{id:e.id}),f.voicemails.count-=1,f.voicemails.rows.length||f.getVoicemails(),p.success({title:_.startCase("Voicemail")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMail"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoicemails())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicemails","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoicemailsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEPREFIX",g.voicePrefix=angular.copy(l),g.voicePrefixes=r,g.newvoicePrefix=!1,g.voicePrefix||(g.voicePrefix={},g.title="VOICE.NEW_VOICEPREFIX",g.newvoicePrefix=!0),g.addNewvoicePrefix=function(){g.errors=[],d.voicePrefix.save(g.voicePrefix).$promise.then(function(e){g.voicePrefixes.unshift(e.toJSON()),o.success({title:"voicePrefix properly created",msg:g.voicePrefix.name?g.voicePrefix.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savevoicePrefix=function(){g.errors=[],d.voicePrefix.update({id:g.voicePrefix.id},g.voicePrefix).$promise.then(function(e){var n=_.find(g.voicePrefixes,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"voicePrefix properly saved!",msg:g.voicePrefix.name?g.voicePrefix.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletevoicePrefix=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voicePrefix will be deleted.").ariaLabel("Delete voicePrefix").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voicePrefix.delete({id:g.voicePrefix.id}).$promise.then(function(){_.remove(g.voicePrefixes,{id:g.voicePrefix.id}),o.success({title:"voicePrefix properly deleted!",msg:(g.voicePrefix.name||"voicePrefix")+" has been deleted!"}),v(g.voicePrefix)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.outboundRoutes,{id:e.resourceId})}),t=null;if(g.voicePrefix&&(t=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.outboundRoutes,{id:t.id});a.canSelect=!1,n.push(a)}g.outboundRoutes=n})}else{var t=[],a=null;g.voicePrefix&&(a=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)}));for(var i=0;i<g.outboundRoutes.length;i++)a&&g.outboundRoutes[i].id===a.id&&(g.outboundRoutes[i].canSelect=!1,t.push(g.outboundRoutes[i]));g.outboundRoutes=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicePrefixes","voicePrefix","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditvoicePrefixDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.voicePrefix.getAgents({id:c.voicePrefix.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UservoicePrefix?"penalty "+e.UservoicePrefix.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.voicePrefix=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.removeAgents({id:c.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.addAgents({id:c.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("VOICE.ALL_AGENTS"),labelSelected:r.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","voicePrefixes","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.voicePrefix.getTeams({id:l.voicePrefix.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.voicePrefix=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("VOICE.ALL_TEAMS"),labelSelected:t.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.removeTeams({id:l.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.addTeams({id:l.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voicePrefixes=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voicePrefixes",f.listOrder="",f.listOrderAsc=null,f.selectedVoicePrefixes=[],f.query={fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"voicePrefixagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes?f.voicePrefixes.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.teamadddialog=function(e,n){i.show({controller:"voicePrefixteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes?f.voicePrefixes.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voicePrefix")+"?").htmlContent("<b>"+(e.name||"voicePrefix")+"</b> will be deleted.").ariaLabel("delete voicePrefix").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVoicePrefixes=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voicePrefix.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VoicePrefixes",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditvoicePrefix=function(e,n){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicePrefix:n,voicePrefixes:f.voicePrefixes.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletevoicePrefix=y,f.exportSelectedVoicePrefixes=function(){var e=angular.copy(f.selectedVoicePrefixes);return f.selectedVoicePrefixes=[],e},f.deleteSelectedVoicePrefixes=function(e){var n=i.confirm().title("Are you sure want to delete the selected voicePrefixes?").htmlContent("<b>"+f.selectedVoicePrefixes.length+" selected</b> will be deleted.").ariaLabel("delete voicePrefixs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoicePrefixes.forEach(function(e){y(e)}),f.selectedVoicePrefixes=[]})},f.deselectVoicePrefixes=function(){f.selectedVoicePrefixes=[]},f.selectAllVoicePrefixes=function(){f.selectedVoicePrefixes=f.voicePrefixes.rows},g.hasRole("admin")?m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){f.outboundRoutes=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){f.outboundRoutes=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.outboundRoutes,{id:e.resourceId})}),t=null;if(f.voicePrefix&&(t=_.find(f.outboundRoutes,{id:Number(f.voicePrefix.VoiceExtensionId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.outboundRoutes,{id:t.id});a.canSelect=!1,n.push(a)}f.outboundRoutes=n})}else{var t=[],a=null;f.voicePrefix&&(a=_.find(f.outboundRoutes,{id:Number(f.voicePrefix.VoiceExtensionId)}));for(var i=0;i<f.outboundRoutes.length;i++)a&&f.outboundRoutes[i].id===a.id&&(f.outboundRoutes[i].canSelect=!1,t.push(f.outboundRoutes[i]));f.outboundRoutes=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.voicePrefixes=e||{count:0,rows:[]}}function y(e){m.voicePrefix.delete({id:e.id}).$promise.then(function(){_.remove(f.voicePrefixes.rows,{id:e.id}),f.voicePrefixes.count-=1,f.voicePrefixes.rows.length||f.getVoicePrefixes(),p.success({title:_.startCase("voicePrefix")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoicePrefix"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoicePrefix",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoicePrefixes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicePrefixes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoicePrefixesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEQUEUE",g.voiceQueue=angular.copy(l),g.voiceQueues=r,g.newVoiceQueue=!1,g.voiceQueue||(g.voiceQueue={type:"inbound",strategy:"ringall",timeout:15,retry:2,random_periodic_announce:"no",announce_holdtime:"no",announce_position:"no",reportholdtime:"no",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no"},g.title="VOICE.NEW_VOICEQUEUE",g.newVoiceQueue=!0),g.addNewVoiceQueue=function(){g.errors=[],d.voiceQueue.save(g.voiceQueue).$promise.then(function(e){g.voiceQueues.unshift(e.toJSON()),o.success({title:"VoiceQueue properly created",msg:g.voiceQueue.name?g.voiceQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceQueue=function(){g.errors=[],d.voiceQueue.update({id:g.voiceQueue.id},g.voiceQueue).$promise.then(function(e){var n=_.find(g.voiceQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VoiceQueue properly saved!",msg:g.voiceQueue.name?g.voiceQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voiceQueue will be deleted.").ariaLabel("Delete VoiceQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceQueue.delete({id:g.voiceQueue.id}).$promise.then(function(){_.remove(g.voiceQueues,{id:g.voiceQueue.id}),o.success({title:"VoiceQueue properly deleted!",msg:(g.voiceQueue.name||"voiceQueue")+" has been deleted!"}),v(g.voiceQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceQueues","voiceQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceQueueDialogController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.voiceQueue.getAgents({id:c.voiceQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.voiceQueue=n,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.voiceQueue.removeAgents({id:c.voiceQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else{for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.voiceQueue.addAgents({id:c.voiceQueue.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("VOICE.ALL_AGENTS"),labelSelected:s.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","voiceQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueagentaddController",e)}(),function(){"use strict";function e(e,i,a,s,n,t,o,r){var l=this;function d(){return i(function(t,n){return i(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:i(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),i(function(n,t){return s.voiceQueue.getTeams({id:l.voiceQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.voiceQueue=n,l.crudPermissions=r,l.penalty=0,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"penalty",labelAll:t.instant("VOICE.ALL_TEAMS"),labelSelected:t.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+l.penalty});var t=_.xorWith(l.startingSelectedItems,l.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):i(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceWith(l.selectedItems,l.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,i(function(e,n){_.isEmpty(t)?e():s.voiceQueue.removeTeams({id:l.voiceQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return a=n,i(function(e,n){if(!_.isEmpty(a)){var t=_.map(a,function(e){return{id:e.id,penalty:_.trim(e.penalty,"penalty ")}});return s.voiceQueue.addTeams({id:l.voiceQueue.id,teams:t}).$promise.then(function(){e()}).catch(function(e){n(e)})}e()});var a}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueteamaddController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.voiceQueue=c||t.params.voiceQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.teamadddialog=function(e,n){a.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.queues",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.queues",{})}},u.alert=l.info,u.gotoVoiceQueues=function(){t.go("app.voice.voiceQueues",{},{reload:"app.voice.voiceQueues"})},u.saveVoiceQueue=function(){r.voiceQueue.update({id:u.voiceQueue.id},u.voiceQueue).$promise.then(function(){l.success({title:"VoiceQueue updated!",msg:u.voiceQueue.name?u.voiceQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),t=null;if(u.voiceQueue&&(t=_.find(u.musiconholds,{name:u.voiceQueue.musiconhold})),t&&!_.some(n,["id",t.id])){var a=_.find(u.musiconholds,{id:t.id});a.canSelect=!1,n.push(a)}u.musiconholds=n}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.sounds,{id:e.resourceId})});u.sounds.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.sounds=n})}else u.sounds=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.pauses=n})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceQueue","userProfileSection"],angular.module("app.voice").controller("VoiceQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voiceQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voiceQueues",f.listOrder="",f.listOrderAsc=null,f.selectedVoiceQueues=[],f.query={fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Ringall",value:"'ringall'"},{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Least Recent",value:"'leastrecent'"},{option:"Fewest Calls",value:"'fewestcalls'"},{option:"Random",value:"'random'"},{option:"Linear",value:"'linear'"},{option:"Weight Random",value:"'wrandom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayjoinempty=_.keyBy([{option:"no",value:"'no'",disabled:"vm.voiceQueue.joinempty.length === 1  && vm.voiceQueue.joinempty[0] === 'no'"},{option:"yes",value:"'yes'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'yes'"},{option:"strict",value:"'strict'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'strict'"},{option:"loose",value:"'loose'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'loose'"},{option:"paused",value:"'paused'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'paused'"},{option:"penalty",value:"'penalty'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'penalty'"},{option:"inuse",value:"'inuse'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'inuse'"},{option:"ringing",value:"'ringing'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'ringing'"},{option:"unavailable",value:"'unavailable'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'unavailable'"},{option:"invalid",value:"'invalid'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'invalid'"},{option:"unknown",value:"'unknown'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'unknown'"},{option:"wrapup",value:"'wrapup'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayleavewhenempty=_.keyBy([{option:"no",value:"'no'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'no'"},{option:"yes",value:"'yes'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'yes'"},{option:"strict",value:"'strict'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'strict'"},{option:"loose",value:"'loose'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'loose'"},{option:"paused",value:"'paused'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'paused'"},{option:"penalty",value:"'penalty'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'penalty'"},{option:"inuse",value:"'inuse'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'inuse'"},{option:"ringing",value:"'ringing'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'ringing'"},{option:"unavailable",value:"'unavailable'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'unavailable'"},{option:"invalid",value:"'invalid'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'invalid'"},{option:"unknown",value:"'unknown'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'unknown'"},{option:"wrapup",value:"'wrapup'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayrandom_periodic_announce=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayannounce_holdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Once",value:"'once'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayannounce_position=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Limit",value:"'limit'"},{option:"More",value:"'more'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayreportholdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.voiceQueues.edit",{id:e.id,voiceQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:f.voiceQueues?f.voiceQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:f.voiceQueues?f.voiceQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceQueue")+"?").htmlContent("<b>"+(e.name||"voiceQueue")+"</b> will be deleted.").ariaLabel("delete voiceQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.queues",{})}},f.success=E,f.getVoiceQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VoiceQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVoiceQueue=function(e,n){i.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:n,voiceQueues:f.voiceQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVoiceQueue=y,f.exportSelectedVoiceQueues=function(){var e=angular.copy(f.selectedVoiceQueues);return f.selectedVoiceQueues=[],e},f.deleteSelectedVoiceQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected voiceQueues?").htmlContent("<b>"+f.selectedVoiceQueues.length+" selected</b> will be deleted.").ariaLabel("delete VoiceQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoiceQueues.forEach(function(e){y(e)}),f.selectedVoiceQueues=[]})},f.deselectVoiceQueues=function(){f.selectedVoiceQueues=[]},f.selectAllVoiceQueues=function(){f.selectedVoiceQueues=f.voiceQueues.rows};var b=!0,A=1;function E(e){f.voiceQueues=e||{count:0,rows:[]}}function y(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.voiceQueues.rows,{id:e.id}),f.voiceQueues.count-=1,f.voiceQueues.rows.length||f.getVoiceQueues(),p.success({title:_.startCase("VoiceQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoiceQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoiceQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICERECORDING",g.voiceRecording=angular.copy(l),g.voiceRecordings=r,g.newVoiceRecording=!1,g.voiceRecording||(g.voiceRecording={},g.title="VOICE.NEW_VOICERECORDING",g.newVoiceRecording=!0),g.addNewVoiceRecording=function(){g.errors=[],d.voiceRecording.save(g.voiceRecording).$promise.then(function(e){g.voiceRecordings.unshift(e.toJSON()),o.success({title:"VoiceRecording properly created",msg:g.voiceRecording.name?g.voiceRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceRecording=function(){g.errors=[],d.voiceRecording.update({id:g.voiceRecording.id},g.voiceRecording).$promise.then(function(e){var n=_.find(g.voiceRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VoiceRecording properly saved!",msg:g.voiceRecording.name?g.voiceRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voiceRecording will be deleted.").ariaLabel("Delete VoiceRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceRecording.delete({id:g.voiceRecording.id}).$promise.then(function(){_.remove(g.voiceRecordings,{id:g.voiceRecording.id}),o.success({title:"VoiceRecording properly deleted!",msg:(g.voiceRecording.name||"voiceRecording")+" has been deleted!"}),v(g.voiceRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceRecordings","voiceRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceRecordingDialogController",e)}(),function(){"use strict";function e(e,n){var t=this;t.voiceRecording={},t.init=function(e){t.voiceRecording=e}}e.$inject=["api","toasty"],angular.module("app.voice").controller("VoiceRecordingSentimentStatisticsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.voiceRecording=c||e.params.voiceRecording||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.alert=l.info,p.gotoVoiceRecordings=function(){e.go("app.voice.voiceRecordings",{},{reload:"app.voice.voiceRecordings"})},p.saveVoiceRecording=function(){r.voiceRecording.update({id:p.voiceRecording.id},p.voiceRecording).$promise.then(function(){l.success({title:"VoiceRecording updated!",msg:p.voiceRecording.name?p.voiceRecording.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceRecording","userProfile","userProfileSection"],angular.module("app.voice").controller("VoiceRecordingController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,l,r,d,c,m,u,p,g,v,h,f){var b=this;function A(n,e){return m.voiceRecording.runTranscribe({id:n.id,runSentiment:!1}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING"),msg:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING")+" succeded!"}),n.transcribeStatus=e.transcribeStatus}).catch(function(e){p.error({title:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}function E(n,e){return m.voiceRecording.runTranscribe({id:n.id,runSentiment:!0}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING"),msg:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING")+" succeded!"}),n.transcribeStatus=e.transcribeStatus}).catch(function(e){p.error({title:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}function y(e,n){return m.voiceRecording.runTranscribe({id:e.id,runSentiment:!0}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING"),msg:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING")+" succeded!"})}).catch(function(e){p.error({title:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voiceRecordings=r||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voiceRecordings",b.listOrder="",b.listOrderAsc=null,b.selectedVoiceRecordings=[],b.query={fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:"@msUtils.firstLastDayMonth()",limit:10,page:1},b.query.createdAt=u.firstLastDayMonth(),b.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE_RANGE"}],b.editstate=function(e,n){t.go("app.voice.voiceRecordings.edit",{id:e.id,voiceRecording:e,crudPermissions:b.crudPermissions})},b.runtranscriberuntranscribesentiment=A,b.runtranscribesentimentruntranscribesentiment=E,b.runsentimentruntranscribesentiment=y,b.downloadtranscribefile2=function(s,e){var t=!1,n=_.isNil(s.format)?s.value.substring(s.value.lastIndexOf(".")):s.format;t=".mp4"===n;-1<s.value.lastIndexOf("/")?s.value.substring(s.value.lastIndexOf("/")+1):-1<s.value.lastIndexOf("\\")?s.value.substring(s.value.lastIndexOf("\\")+1):s.value;return m.voiceRecording.downloadTranscribe({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid+".txt";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.downloadfile2=function(r,e){var t=!1,n=_.isNil(r.format)?r.value.substring(r.value.lastIndexOf(".")):r.format;t=".mp4"===n;-1<r.value.lastIndexOf("/")?r.value.substring(r.value.lastIndexOf("/")+1):-1<r.value.lastIndexOf("\\")?r.value.substring(r.value.lastIndexOf("\\")+1):r.value;return m.voiceRecording.download({id:r.id}).$promise.then(function(e){var n,t,a=[e.buffer],i="download",s=new Blob(a,{type:e.type});n=r.value,t=-1<n.lastIndexOf("/")?n.substring(n.lastIndexOf("/")+1):-1<n.lastIndexOf("\\")?n.substring(n.lastIndexOf("\\")+1):n,i=(t=t.substring(0,t.lastIndexOf(".")))+r.format;var o=window.document.createElement("a");o.setAttribute("href",URL.createObjectURL(s)),o.setAttribute("download",i),document.body.appendChild(o),o.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceRecording")+"?").htmlContent("<b>"+(e.name||"voiceRecording")+"</b> will be deleted.").ariaLabel("delete voiceRecording").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){O(e)},function(){console.log("CANCEL")})},b.success=I,b.getVoiceRecordings=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceRecording.get(b.query,I).$promise:(b.query.id=b.userProfile.id,b.query.section="VoiceRecordings",b.promise=m.userProfile.getResources(b.query,I).$promise)},b.createOrEditVoiceRecording=function(e,n){i.show({controller:"CreateOrEditVoiceRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceRecording:n,voiceRecordings:b.voiceRecordings.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoiceRecording=O,b.exportSelectedVoiceRecordings=function(){var e=angular.copy(b.selectedVoiceRecordings);b.selectedVoiceRecordings=[],b.userProfile.privacyEnabled&&_.forEach(e,function(e){e.calleridnum=f.mask(e.calleridnum),e.exten=f.mask(e.exten),e.connectedlinenum=f.mask(e.connectedlinenum),e.membername=f.mask(e.membername)});return e},b.deleteSelectedVoiceRecordings=function(e){var n=i.confirm().title("Are you sure want to delete the selected voiceRecordings?").htmlContent("<b>"+b.selectedVoiceRecordings.length+" selected</b> will be deleted.").ariaLabel("delete VoiceRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){b.selectedVoiceRecordings.forEach(function(e){O(e)}),b.selectedVoiceRecordings=[]})},b.deselectVoiceRecordings=function(){b.selectedVoiceRecordings=[]},b.selectAllVoiceRecordings=function(){b.selectedVoiceRecordings=b.voiceRecordings.rows},b.runtranscribeSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){A(e,n)}),b.selectedVoiceRecordings=[]},b.runtranscribesentimentSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){E(e,n)}),b.selectedVoiceRecordings=[]},b.runsentimentSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){y(e,n)}),b.selectedVoiceRecordings=[]};var S=!0,T=1;function I(e){b.voiceRecordings=e||{count:0,rows:[]}}function O(e){m.voiceRecording.delete({id:e.id}).$promise.then(function(){_.remove(b.voiceRecordings.rows,{id:e.id}),b.voiceRecordings.count-=1,b.voiceRecordings.rows.length||b.getVoiceRecordings(),p.success({title:_.startCase("VoiceRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){S?o(function(){S=!1}):(n||(T=b.query.page),e!==n&&(b.query.page=1),e||(b.query.page=T),b.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","privacyManager"],angular.module("app.voice").controller("VoiceRecordingsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"WhatsappQueues":void 0,channel:"whatsapp",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("WHATSAPP.WHATSAPPQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditWhatsappQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappQueue:n,whatsappQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappQueue:n,whatsappQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("whatsapp_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userWhatsappQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.WhatsappQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userWhatsappQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.WhatsappQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"whatsapp")})}),e.$on("$destroy",function(){r.removeAllListeners("whatsapp_queue:save"),r.removeAllListeners("userWhatsappQueue:remove"),r.removeAllListeners("userWhatsappQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.whatsapp").controller("QueuesWhatsappRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.whatsapp.realtime.agents":this.selectedTab=0;break;case"app.whatsapp.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.whatsapp.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.whatsapp.realtime.agents");break;case 1:t.go("app.whatsapp.realtime.queues");break;default:t.go("app.whatsapp.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.whatsapp").controller("WhatsappRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){"twilio"===g.whatsappAccount.type&&(g.whatsappAccount.baseUrl=null)}function h(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPACCOUNT",g.whatsappAccount=angular.copy(l),g.whatsappAccounts=r,g.newWhatsappAccount=!1,g.whatsappAccount||(g.whatsappAccount={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),type:"twilio",notificationSound:!0,queueTransferTimeout:300,waitForTheAssignedAgent:10,agentTransferTimeout:300},g.title="WHATSAPP.NEW_WHATSAPPACCOUNT",g.newWhatsappAccount=!0),n.params.id&&(g.whatsappAccount.WhatsappAccountId=n.params.id),g.addNewWhatsappAccount=function(){g.errors=[],v(),d.whatsappAccount.save(g.whatsappAccount).$promise.then(function(e){g.whatsappAccounts.unshift(e.toJSON()),o.success({title:"WhatsappAccount properly created",msg:g.whatsappAccount.name?g.whatsappAccount.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappAccount=function(){g.errors=[],v(),d.whatsappAccount.update({id:g.whatsappAccount.id},g.whatsappAccount).$promise.then(function(e){var n=_.find(g.whatsappAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappAccount properly saved!",msg:g.whatsappAccount.name?g.whatsappAccount.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappAccount will be deleted.").ariaLabel("Delete WhatsappAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.whatsappAccount.delete({id:g.whatsappAccount.id}).$promise.then(function(){_.remove(g.whatsappAccounts,{id:g.whatsappAccount.id}),o.success({title:"WhatsappAccount properly deleted!",msg:(g.whatsappAccount.name||"whatsappAccount")+" has been deleted!"}),h(g.whatsappAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=h,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.whatsappAccount&&(t=_.find(g.lists,{id:Number(g.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.whatsappAccount&&(a=_.find(g.lists,{id:Number(g.whatsappAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){g.pauses=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){g.pauses=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.pauses,{id:e.resourceId})});g.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.pauses=n})}else g.pauses=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappAccounts","whatsappAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.whatsappAccountApps.rows.length){var t=r.whatsappAccountApps.rows[n]?r.whatsappAccountApps.rows[n]:r.whatsappAccountApps.rows[0];i.show({controller:"EditWhatsappAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccountApp:t,whatsappAccount:r.whatsappAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.whatsappAccountApps.rows[n]=e:r.whatsappAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.whatsappAccountApps.rows.length;t++,0){var a=r.whatsappAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.whatsappAccount.context,a.exten=r.whatsappAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.whatsappAccount.addApplications({id:r.whatsappAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.whatsappAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.whatsappAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.whatsappAccount={},r.whatsappAccountApps={count:0,rows:[]},r.selectedWhatsappAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"WhatsappQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"whatsappQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:2102}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.whatsappAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getWhatsappAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.whatsappAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getWhatsappAccountApps=function(){r.promise=o.whatsappAccount.getApplications(r.query,t).$promise},r.editWhatsappAccountApp=n,r.editInterval=function(e,n){if(r.whatsappAccountApps.rows.length){var t=r.whatsappAccountApps.rows[n]?r.whatsappAccountApps.rows[n]:r.whatsappAccountApps.rows[0];i.show({controller:"EditWhatsappAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteWhatsappAccountApp=function(e){_.remove(r.whatsappAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedWhatsappAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedWhatsappAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedWhatsappAccountApps.forEach(function(e){_.remove(r.whatsappAccountApps.rows,{id:e.id})}),r.selectedWhatsappAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappAccount.getAgents({id:c.whatsappAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserWhatsappAccount?"penalty "+e.UserWhatsappAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.whatsappAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappAccount.removeAgents({id:c.whatsappAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappAccount.addAgents({id:c.whatsappAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("WHATSAPP.ALL_AGENTS"),labelSelected:r.instant("WHATSAPP.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","whatsappAccount","whatsappAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditWhatsappAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("whatsapp")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.whatsappQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.whatsappQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:2102}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"whatsappAccount",action:"getDispositions",field:"name",params:{id:m.whatsappAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.whatsappAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.whatsappAccountInteractions.rows.length;n+=1){var t=m.whatsappAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.whatsappInteraction.get(m.query,p).$promise}function v(e){d.whatsappInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.whatsappAccountInteractions.rows,{id:e.id}),m.whatsappAccountInteractions.count-=1,m.whatsappAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.whatsappAccount={},m.whatsappAccountInteractions={count:0,rows:[]},m.selectedWhatsappAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.whatsappAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.WhatsappAccountId=m.whatsappAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.whatsappInteractionDownload=function(s,e,n){return d.whatsappInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="whatsapp-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getWhatsappAccountInteractions=g,m.createOrEditWhatsappAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:m.whatsappAccount,interaction:n,interactions:m.whatsappAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spywhatsappInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"whatsapp",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"whatsapp.whatsappAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||WhatsappAccountId:=$eq["+m.whatsappAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedWhatsappAccountInteractions=function(){var e=angular.copy(m.selectedWhatsappAccountInteractions);return m.selectedWhatsappAccountInteractions=[],e},m.deleteWhatsappAccountInteraction=v,m.deleteSelectedWhatsappAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedWhatsappAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedWhatsappAccountInteractions.forEach(function(e){v(e)}),m.selectedWhatsappAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.whatsappAccount=c||e.params.whatsappAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.baseUrl=[{name:"US Production",url:"https://us1.whatsapp.api.sinch.com"},{name:"EU Production",url:"https://eu1.whatsapp.api.sinch.com"}],p.agentadddialog=function(e,n){t.show({controller:"WhatsappAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappAccount:e,whatsappAccounts:p.whatsappAccounts?p.whatsappAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoWhatsappAccounts=function(){e.go("app.whatsapp.whatsappAccounts",{},{reload:"app.whatsapp.whatsappAccounts"})},p.saveWhatsappAccount=function(){"twilio"===p.whatsappAccount.type&&(p.whatsappAccount.baseUrl=null);r.whatsappAccount.update({id:p.whatsappAccount.id},p.whatsappAccount).$promise.then(function(){l.success({title:"WhatsappAccount updated!",msg:p.whatsappAccount.name?p.whatsappAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.whatsappAccount&&(t=_.find(p.lists,{id:Number(p.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.whatsappAccount&&(a=_.find(p.lists,{id:Number(p.whatsappAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","whatsappAccount","userProfile","userProfileSection"],angular.module("app.whatsapp").controller("WhatsappAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.whatsappAccountWhatsappCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.whatsappAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.whatsappAccountWhatsappCannedAnswers.rows,{id:e.id}),m.whatsappAccountWhatsappCannedAnswers.count-=1,m.whatsappAccountWhatsappCannedAnswers.rows.length||p(),l.success({title:"WhatsappCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.whatsappAccount={},m.whatsappAccountWhatsappCannedAnswers={count:0,rows:[]},m.selectedWhatsappAccountWhatsappCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.whatsappAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.WhatsappAccountId=m.whatsappAccount.id,m.query.id=m.whatsappAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the whatsappCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("whatsappCannedAnswer #")+e.id||"whatsappCannedAnswer")+"</b> will be deleted.").ariaLabel("delete whatsappCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getWhatsappAccountWhatsappCannedAnswers=p,m.createOrEditWhatsappAccountWhatsappCannedAnswer=function(e,n){o.show({controller:"CreateOrEditWhatsappCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/whatsappCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:m.whatsappAccount,whatsappCannedAnswer:n,whatsappCannedAnswers:m.whatsappAccountWhatsappCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedWhatsappAccountWhatsappCannedAnswers=function(){var e=angular.copy(m.selectedWhatsappAccountWhatsappCannedAnswers);return m.selectedWhatsappAccountWhatsappCannedAnswers=[],e},m.deleteWhatsappAccountWhatsappCannedAnswer=g,m.deleteSelectedWhatsappAccountWhatsappCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected whatsappCannedAnswers?").htmlContent("<b>"+m.selectedWhatsappAccountWhatsappCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete whatsappCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedWhatsappAccountWhatsappCannedAnswers.forEach(function(e){g(e)}),m.selectedWhatsappAccountWhatsappCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountWhatsappCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPCANNEDANSWER",g.whatsappCannedAnswer=angular.copy(l),g.whatsappCannedAnswers=r,g.newWhatsappCannedAnswer=!1,g.whatsappCannedAnswer||(g.whatsappCannedAnswer={},g.title="WHATSAPP.NEW_WHATSAPPCANNEDANSWER",g.newWhatsappCannedAnswer=!0),n.params.id&&(g.whatsappCannedAnswer.WhatsappAccountId=n.params.id),g.addNewWhatsappCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.whatsappCannedAnswer).$promise.then(function(e){g.whatsappCannedAnswers.unshift(e.toJSON()),o.success({title:"WhatsappCannedAnswer properly created",msg:g.whatsappCannedAnswer.name?g.whatsappCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.whatsappCannedAnswer.id},g.whatsappCannedAnswer).$promise.then(function(e){var n=_.find(g.whatsappCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappCannedAnswer properly saved!",msg:g.whatsappCannedAnswer.name?g.whatsappCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappCannedAnswer will be deleted.").ariaLabel("Delete WhatsappCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.whatsappCannedAnswer.id}).$promise.then(function(){_.remove(g.whatsappCannedAnswers,{id:g.whatsappCannedAnswer.id}),o.success({title:"WhatsappCannedAnswer properly deleted!",msg:(g.whatsappCannedAnswer.name||"whatsappCannedAnswer")+" has been deleted!"}),v(g.whatsappCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappCannedAnswers","whatsappCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.whatsappAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.whatsappAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.WhatsappAccountId=m.whatsappAccount.id,m.query.id=m.whatsappAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.whatsappAccount.id,field:"WhatsappAccountId",route:"whatsappAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.whatsappAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="whatsappAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedWhatsappAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Sinch",value:"'sinch'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.whatsapp.whatsappAccounts.edit",{id:e.id,whatsappAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.whatsapp.whatsappAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"WhatsappAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappAccount:e,whatsappAccounts:f.whatsappAccounts?f.whatsappAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("whatsappAccount")+"?").htmlContent("<b>"+(e.name||"whatsappAccount")+"</b> will be deleted.").ariaLabel("delete whatsappAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getWhatsappAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.whatsappAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="WhatsappAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditWhatsappAccount=function(e,n){i.show({controller:"CreateOrEditWhatsappAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:n,whatsappAccounts:f.whatsappAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteWhatsappAccount=y,f.exportSelectedWhatsappAccounts=function(){var e=angular.copy(f.selectedWhatsappAccounts);return f.selectedWhatsappAccounts=[],e},f.deleteSelectedWhatsappAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected whatsappAccounts?").htmlContent("<b>"+f.selectedWhatsappAccounts.length+" selected</b> will be deleted.").ariaLabel("delete WhatsappAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedWhatsappAccounts.forEach(function(e){y(e)}),f.selectedWhatsappAccounts=[]})},f.deselectWhatsappAccounts=function(){f.selectedWhatsappAccounts=[]},f.selectAllWhatsappAccounts=function(){f.selectedWhatsappAccounts=f.whatsappAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.whatsappAccount&&(t=_.find(f.lists,{id:Number(f.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.whatsappAccount&&(a=_.find(f.lists,{id:Number(f.whatsappAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){f.pauses=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){f.pauses=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.pauses,{id:e.resourceId})});f.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),f.pauses=n})}else f.pauses=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.whatsappAccounts=e||{count:0,rows:[]}}function y(e){m.whatsappAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.whatsappAccounts.rows,{id:e.id}),f.whatsappAccounts.count-=1,f.whatsappAccounts.rows.length||f.getWhatsappAccounts(),p.success({title:_.startCase("WhatsappAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getWhatsappAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","whatsappAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.whatsapp").controller("WhatsappAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPQUEUE",g.whatsappQueue=angular.copy(l),g.whatsappQueues=r,g.newWhatsappQueue=!1,g.whatsappQueue||(g.whatsappQueue={strategy:"beepall",timeout:10},g.title="WHATSAPP.NEW_WHATSAPPQUEUE",g.newWhatsappQueue=!0),g.addNewWhatsappQueue=function(){g.errors=[],d.whatsappQueue.save(g.whatsappQueue).$promise.then(function(e){g.whatsappQueues.unshift(e.toJSON()),o.success({title:"WhatsappQueue properly created",msg:g.whatsappQueue.name?g.whatsappQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappQueue=function(){g.errors=[],d.whatsappQueue.update({id:g.whatsappQueue.id},g.whatsappQueue).$promise.then(function(e){var n=_.find(g.whatsappQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappQueue properly saved!",msg:g.whatsappQueue.name?g.whatsappQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappQueue will be deleted.").ariaLabel("Delete WhatsappQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.whatsappQueue.delete({id:g.whatsappQueue.id}).$promise.then(function(){_.remove(g.whatsappQueues,{id:g.whatsappQueue.id}),o.success({title:"WhatsappQueue properly deleted!",msg:(g.whatsappQueue.name||"whatsappQueue")+" has been deleted!"}),v(g.whatsappQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappQueues","whatsappQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappQueue.getAgents({id:c.whatsappQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserWhatsappQueue?"penalty "+e.UserWhatsappQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.whatsappQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.removeAgents({id:c.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.addAgents({id:c.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("WHATSAPP.ALL_AGENTS"),labelSelected:r.instant("WHATSAPP.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","whatsappQueue","whatsappQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappQueue.getTeams({id:l.whatsappQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.whatsappQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("WHATSAPP.ALL_TEAMS"),labelSelected:t.instant("WHATSAPP.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.removeTeams({id:l.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.addTeams({id:l.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","whatsappQueue","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.whatsappQueue=c||e.params.whatsappQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"WhatsappQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:u.whatsappQueues?u.whatsappQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:u.whatsappQueues?u.whatsappQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoWhatsappQueues=function(){e.go("app.whatsapp.whatsappQueues",{},{reload:"app.whatsapp.whatsappQueues"})},u.saveWhatsappQueue=function(){r.whatsappQueue.update({id:u.whatsappQueue.id},u.whatsappQueue).$promise.then(function(){l.success({title:"WhatsappQueue updated!",msg:u.whatsappQueue.name?u.whatsappQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","whatsappQueue","userProfileSection"],angular.module("app.whatsapp").controller("WhatsappQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.whatsappQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="whatsappQueues",f.listOrder="",f.listOrderAsc=null,f.selectedWhatsappQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.whatsapp.whatsappQueues.edit",{id:e.id,whatsappQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"WhatsappQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:f.whatsappQueues?f.whatsappQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:f.whatsappQueues?f.whatsappQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("whatsappQueue")+"?").htmlContent("<b>"+(e.name||"whatsappQueue")+"</b> will be deleted.").ariaLabel("delete whatsappQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:2110}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.whatsapp.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.whatsapp.realtime.queues",{})}},f.success=E,f.getWhatsappQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.whatsappQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="WhatsappQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditWhatsappQueue=function(e,n){i.show({controller:"CreateOrEditWhatsappQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappQueue:n,whatsappQueues:f.whatsappQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteWhatsappQueue=y,f.exportSelectedWhatsappQueues=function(){var e=angular.copy(f.selectedWhatsappQueues);return f.selectedWhatsappQueues=[],e},f.deleteSelectedWhatsappQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected whatsappQueues?").htmlContent("<b>"+f.selectedWhatsappQueues.length+" selected</b> will be deleted.").ariaLabel("delete WhatsappQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedWhatsappQueues.forEach(function(e){y(e)}),f.selectedWhatsappQueues=[]})},f.deselectWhatsappQueues=function(){f.selectedWhatsappQueues=[]},f.selectAllWhatsappQueues=function(){f.selectedWhatsappQueues=f.whatsappQueues.rows};var b=!0,A=1;function E(e){f.whatsappQueues=e||{count:0,rows:[]}}function y(e){m.whatsappQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.whatsappQueues.rows,{id:e.id}),f.whatsappQueues.count-=1,f.whatsappQueues.rows.length||f.getWhatsappQueues(),p.success({title:_.startCase("WhatsappQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEwhatsappQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEwhatsappQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getWhatsappQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","whatsappQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.whatsapp").controller("WhatsappQueuesController",e)}(),function(){"use strict";function e(n,t,e,a,o,i,s,r,l,d,c,m,u){var p=this;function g(e,n){return{id:e,title:n.name||"NONAME",state:"app.dashboards.custom",stateParams:n,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(e)&&!r.hasRole("admin")}}}function v(e,n){return{id:e,title:n.name||"NONAME",state:"app.plugins.plugin",stateParams:n,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(e)&&!r.hasRole("admin")}}}function h(e,n){var t={user:_.pick(r.getCurrentUser(),["id","name","fullname","email","role","internal","interface"])};n.agentUrl=Mustache.render(n.agentUrl,t),i.saveItem("apps.home.plugin_"+e,{id:e,title:n.name,translate:n.name,state:"plugin_"+n.id,stateParams:n,view:"plugin",icon:n.icon,weight:12,hidden:function(){return!r.hasPermission(e)}})}function f(e){return _.map(e.children,function(e){return e.id})}s.clear(),p.isAgent=function(){return r.getCurrentUser()&&r.hasRole("agent")},o.saveItem("apps",{title:"APPS",group:!0,weight:1,hidden:function(){return r.hasRole("agent")}}),d.version.get().$promise.then(function(e){p.version=e&&e.current?e.current:"UNKNOWN"}).catch(function(){p.version="UNKNOWN"}).finally(function(){o.saveItem("version",{title:"VERSION "+p.version,group:!0,weight:2,hidden:function(){return r.hasRole("agent")}})}),r.isLoggedIn()&&(null===m.userSettings&&m.getUserSettingForUser(),l.gray&&s.warning({msg:e.instant("DASHBOARDS.LICENSE_EXPIRE_REMAINING_DAYS"),showClose:!0,timeout:!1}),d.dashboard.get().$promise.then(function(e){for(var n=0,t=0;t<e.rows.length;t+=1)n=99999+e.rows[t].id,o.saveItem("apps.dashboards.custom_"+n,g(n,e.rows[t]))}),d.plugin.get({active:!0}).$promise.then(function(e){var n=0;if(e.count){var t=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"agentOnly"!=e.sidebar});if(0<t.length){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",permissions:{hidden:!0},weight:17,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}});for(var a=0;a<t.length;a+=1)n=88888+t[a].id,o.saveItem("apps.plugins.plugin_"+n,v(n,t[a]));o.sort()}var i=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"adminOnly"!=e.sidebar});if(0<i.length)for(var s=0;s<i.length;s+=1)h(n=88888+i[s].id,i[s])}})),l.custom&&!c.defaultPageTitle&&c.pageTitle&&angular.element("#pageTitle").html(c.pageTitle),o.saveItem("apps.dashboards",{id:100,title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",icon:"icon-tile-four",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.dashboards.general",{id:101,title:"General",route:"",translate:"DASHBOARDS.GENERAL",state:"app.dashboards.general",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(101)&&!r.hasRole("admin")}}),o.saveItem("apps.staff",{id:200,title:"Staff",translate:"STAFF.STAFF",icon:"icon-account-multiple",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.staff.users",{id:201,title:"Users",route:"user",translate:"STAFF.USERS",state:"app.staff.users",permissions:{hidden:!0},weight:1,hidden:function(){return r.hasRole("agent")||r.hasRole("user")||!r.hasPermission(201)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.agents",{id:202,title:"Agents",route:"user",translate:"STAFF.AGENTS",state:"app.staff.agents",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(202)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.telephones",{id:203,title:"Telephones",route:"user",translate:"STAFF.TELEPHONES",state:"app.staff.telephones",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(203)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.teams",{id:204,title:"Teams",route:"team",translate:"STAFF.TEAMS",state:"app.staff.teams",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(204)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.userProfiles",{id:205,title:"UserProfiles",route:"userProfile",translate:"STAFF.USERPROFILES",state:"app.staff.userProfiles",permissions:{hidden:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(205)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager",{id:300,title:"ContactManager",translate:"CONTACTMANAGER.CONTACTMANAGER",icon:"icon-account-circle",license:"cm",weight:4,hidden:function(){return!l.cm||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.lists",{id:301,title:"Lists",route:"cmList",translate:"CONTACTMANAGER.LISTS",state:"app.contactmanager.lists",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(301)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.companies",{id:302,title:"Companies",route:"cmCompany",translate:"CONTACTMANAGER.COMPANIES",state:"app.contactmanager.companies",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(302)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.globalCustomFields",{id:304,title:"GlobalCustomFields",route:"cmCustomField",translate:"CONTACTMANAGER.GLOBALCUSTOMFIELDS",state:"app.contactmanager.globalCustomFields",permissions:{association:!1},weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(304)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.contacts",{id:303,title:"Contacts",route:"",translate:"CONTACTMANAGER.CONTACTS",state:"app.contactmanager.contacts",permissions:{association:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(303)&&!r.hasRole("admin")}}),o.saveItem("apps.voice",{id:400,title:"Voice",translate:"VOICE.VOICE",icon:"icon-phone",license:"voice",weight:5,hidden:function(){return!l.voice||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voiceQueues",{id:401,title:"VoiceQueues",route:"voiceQueue",channel:"voice",translate:"VOICE.VOICEQUEUES",state:"app.voice.voiceQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(401)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.contexts",{id:405,title:"Contexts",route:"voiceContext",translate:"VOICE.CONTEXTS",state:"app.voice.contexts",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(405)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voicemails",{id:406,title:"Voicemails",route:"voiceMail",translate:"VOICE.VOICEMAILS",state:"app.voice.voicemails",weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(406)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.musiconholds",{id:407,title:"MusicOnHolds",route:"voiceMusicOnHold",translate:"VOICE.MUSICONHOLDS",state:"app.voice.musiconholds",weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(407)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voiceRecordings",{id:408,title:"VoiceRecordings",route:"voiceRecording",translate:"VOICE.VOICERECORDINGS",state:"app.voice.voiceRecordings",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(408)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.chanSpies",{id:409,title:"ChanSpies",route:"voiceChanSpy",translate:"VOICE.CHANSPIES",state:"app.voice.chanSpies",weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(409)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voicePrefixes",{id:410,title:"VoicePrefixes",route:"voicePrefix",translate:"VOICE.VOICEPREFIXES",state:"app.voice.voicePrefixes",weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(410)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.inboundRoutes",{id:402,title:"InboundRoutes",route:"voiceExtension",translate:"VOICE.INBOUNDROUTES",state:"app.voice.inboundRoutes",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(402)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.outboundRoutes",{id:403,title:"OutboundRoutes",route:"voiceExtension",translate:"VOICE.OUTBOUNDROUTES",state:"app.voice.outboundRoutes",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(403)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.internalRoutes",{id:404,title:"InternalRoutes",route:"voiceExtension",translate:"VOICE.INTERNALROUTES",state:"app.voice.internalRoutes",weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(404)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.realtime",{id:411,title:"Realtime",route:"",translate:"VOICE.REALTIME",state:"app.voice.realtime",permissions:{association:!1,crud:!1},weight:11,hidden:function(){return r.hasRole("agent")||!r.hasPermission(411)&&!r.hasRole("admin")}}),o.saveItem("apps.chat",{id:500,title:"Chat",translate:"CHAT.CHAT",icon:"icon-hangouts",license:"chat",weight:6,hidden:function(){return!l.chat||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.chat.chatQueues",{id:501,title:"ChatQueues",route:"chatQueue",channel:"chat",translate:"CHAT.CHATQUEUES",state:"app.chat.chatQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(501)&&!r.hasRole("admin")}}),o.saveItem("apps.chat.chatWebsites",{id:502,title:"ChatWebsites",route:"chatWebsite",channel:"chat",translate:"CHAT.CHATWEBSITES",state:"app.chat.chatWebsites",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(502)&&!r.hasRole("admin")}}),o.saveItem("apps.chat.realtime",{id:510,title:"Realtime",route:"",translate:"CHAT.REALTIME",state:"app.chat.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(510)&&!r.hasRole("admin")}}),o.saveItem("apps.mail",{id:600,title:"Mail",translate:"MAIL.MAIL",icon:"icon-email",license:"mail",weight:7,hidden:function(){return!l.mail||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailQueues",{id:601,title:"MailQueues",route:"mailQueue",channel:"mail",translate:"MAIL.MAILQUEUES",state:"app.mail.mailQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(601)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailAccounts",{id:602,title:"MailAccounts",route:"mailAccount",channel:"mail",translate:"MAIL.MAILACCOUNTS",state:"app.mail.mailAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(602)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailSubtatuses",{id:603,title:"MailSubstatuses",route:"mailSubstatus",channel:"mail",translate:"MAIL.MAILSUBSTATUSES",state:"app.mail.mailSubtatuses",permissions:{association:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(603)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.realtime",{id:610,title:"Realtime",route:"",translate:"MAIL.REALTIME",state:"app.mail.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(610)&&!r.hasRole("admin")}}),o.saveItem("apps.sms",{id:700,title:"Sms",translate:"SMS.SMS",icon:"icon-message-text",license:"messaging",weight:8,hidden:function(){return!l.messaging||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.sms.smsQueues",{id:701,title:"SmsQueues",route:"smsQueue",channel:"sms",translate:"SMS.SMSQUEUES",state:"app.sms.smsQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(701)&&!r.hasRole("admin")}}),o.saveItem("apps.sms.smsAccounts",{id:702,title:"SmsAccounts",route:"smsAccount",channel:"sms",translate:"SMS.SMSACCOUNTS",state:"app.sms.smsAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(702)&&!r.hasRole("admin")}}),o.saveItem("apps.sms.realtime",{id:710,title:"Realtime",route:"",translate:"SMS.REALTIME",state:"app.sms.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(710)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel",{id:800,title:"Openchannel",translate:"OPENCHANNEL.OPENCHANNEL",icon:"icon-google-earth",license:"openchannel",weight:9,hidden:function(){return!l.openchannel||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.openchannelQueues",{id:801,title:"OpenchannelQueues",route:"openchannelQueue",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELQUEUES",state:"app.openchannel.openchannelQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(801)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.openchannelAccounts",{id:802,title:"OpenchannelAccounts",route:"openchannelAccount",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELACCOUNTS",state:"app.openchannel.openchannelAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(802)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.realtime",{id:810,title:"Realtime",route:"",translate:"OPENCHANNEL.REALTIME",state:"app.openchannel.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(810)&&!r.hasRole("admin")}}),o.saveItem("apps.fax",{id:900,title:"Fax",translate:"FAX.FAX",icon:"icon-deskphone",license:"fax",weight:10,hidden:function(){return!l.fax||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.fax.faxQueues",{id:901,title:"FaxQueues",route:"faxQueue",channel:"fax",translate:"FAX.FAXQUEUES",state:"app.fax.faxQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(901)&&!r.hasRole("admin")}}),o.saveItem("apps.fax.faxAccounts",{id:902,title:"FaxAccounts",route:"faxAccount",channel:"fax",translate:"FAX.FAXACCOUNTS",state:"app.fax.faxAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(902)&&!r.hasRole("admin")}}),o.saveItem("apps.fax.realtime",{id:910,title:"Realtime",route:"",translate:"FAX.REALTIME",state:"app.fax.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(910)&&!r.hasRole("admin")}}),o.saveItem("apps.tools",{id:1e3,title:"Tools",translate:"TOOLS.TOOLS",icon:"icon-auto-fix",weight:15,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.tools.cannedAnswers",{id:1001,title:"CannedAnswers",route:"cannedAnswer",translate:"TOOLS.CANNEDANSWERS",state:"app.tools.cannedAnswers",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1001)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.customDashboards",{id:1003,title:"CustomDashboards",route:"dashboard",translate:"TOOLS.CUSTOMDASHBOARDS",state:"app.tools.customDashboards",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1003)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.intervals",{id:1004,title:"Intervals",route:"interval",translate:"TOOLS.INTERVALS",state:"app.tools.intervals",weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1004)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.pauses",{id:1005,title:"Pauses",route:"pause",translate:"TOOLS.PAUSES",state:"app.tools.pauses",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1005)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.schedules",{id:1006,title:"Scheduler",route:"schedule",translate:"TOOLS.SCHEDULER",state:"app.tools.schedules",weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1006)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.sounds",{id:1007,title:"Sounds",route:"sound",translate:"TOOLS.SOUNDS",state:"app.tools.sounds",weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1007)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.tags",{id:1008,title:"Tags",route:"tag",translate:"TOOLS.TAGS",state:"app.tools.tags",weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1008)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.templates",{id:1009,title:"Templates",route:"template",translate:"TOOLS.TEMPLATES",state:"app.tools.templates",weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1009)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.trunks",{id:1011,title:"Trunks",route:"trunk",translate:"TOOLS.TRUNKS",state:"app.tools.trunks",weight:11,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1011)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.variables",{id:1012,title:"Variables",route:"variable",translate:"TOOLS.VARIABLES",state:"app.tools.variables",weight:12,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1012)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.dispositions",{id:1002,title:"Dispositions",route:"disposition",translate:"TOOLS.DISPOSITIONS",state:"app.tools.dispositions",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1002)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.triggers",{id:1010,title:"Triggers",route:"trigger",translate:"TOOLS.TRIGGERS",state:"app.tools.triggers",weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1010)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare",{id:1100,title:"CallySquare",translate:"CALLYSQUARE.CALLYSQUARE",icon:"icon-sitemap",license:"voice",weight:13,hidden:function(){return!l.voice||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.odbcs",{id:1101,title:"ODBC",route:"squareOdbc",translate:"CALLYSQUARE.ODBC",state:"app.callysquare.odbcs",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1101)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.squareRecordings",{id:1102,title:"SquareRecordings",route:"squareRecording",translate:"CALLYSQUARE.SQUARERECORDINGS",state:"app.callysquare.squareRecordings",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1102)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.projects",{id:1103,title:"Projects",route:"squareProject",translate:"CALLYSQUARE.PROJECTS",state:"app.callysquare.projects",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1103)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics",{id:1200,title:"Analytics",translate:"ANALYTICS.ANALYTICS",icon:"icon-chart-line",weight:16,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.metrics",{id:1201,title:"Metrics",route:"analyticMetric",translate:"ANALYTICS.METRICS",state:"app.analytics.metrics",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1201)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.extractedReports",{id:1202,title:"ExtractedReports",route:"analyticExtractedReport",translate:"ANALYTICS.EXTRACTEDREPORTS",state:"app.analytics.extractedReports",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1202)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.reports",{id:1203,title:"Reports",route:"",translate:"ANALYTICS.REPORTS",state:"app.analytics.reports",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1203)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations",{id:1300,title:"Integrations",translate:"INTEGRATIONS.INTEGRATIONS",icon:"icon-heart",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.zendeskAccounts",{id:1301,title:"ZendeskAccounts",route:"intZendeskAccount",translate:"INTEGRATIONS.ZENDESKACCOUNTS",state:"app.integrations.zendeskAccounts",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1301)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.salesforceAccounts",{id:1302,title:"SalesforceAccounts",route:"intSalesforceAccount",translate:"INTEGRATIONS.SALESFORCEACCOUNTS",state:"app.integrations.salesforceAccounts",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1302)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.freshdeskAccounts",{id:1303,title:"FreshdeskAccounts",route:"intFreshdeskAccount",translate:"INTEGRATIONS.FRESHDESKACCOUNTS",state:"app.integrations.freshdeskAccounts",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1303)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.sugarcrmAccounts",{id:1305,title:"SugarcrmAccounts",route:"intSugarcrmAccount",translate:"INTEGRATIONS.SUGARCRMACCOUNTS",state:"app.integrations.sugarcrmAccounts",permissions:{association:!1,loading:!0},weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1305)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.deskAccounts",{id:1306,title:"DeskAccounts",route:"intDeskAccount",translate:"INTEGRATIONS.DESKACCOUNTS",state:"app.integrations.deskAccounts",permissions:{association:!1,loading:!0},weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1306)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.zohoAccounts",{id:1307,title:"ZohoAccounts",route:"intZohoAccount",translate:"INTEGRATIONS.ZOHOACCOUNTS",state:"app.integrations.zohoAccounts",permissions:{association:!1,loading:!0},weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1307)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.vtigerAccounts",{id:1308,title:"VtigerAccounts",route:"intVtigerAccount",translate:"INTEGRATIONS.VTIGERACCOUNTS",state:"app.integrations.vtigerAccounts",permissions:{association:!1,loading:!0},weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1308)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.dynamics365Accounts",{id:1309,title:"Dynamics365Accounts",route:"intDynamics365Account",translate:"INTEGRATIONS.DYNAMICS365ACCOUNTS",state:"app.integrations.dynamics365Accounts",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1309)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.servicenowAccounts",{id:1310,title:"ServicenowAccounts",route:"intServicenowAccount",translate:"INTEGRATIONS.SERVICENOWACCOUNTS",state:"app.integrations.servicenowAccounts",permissions:{association:!1,loading:!0},weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1310)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.freshsalesAccounts",{id:1304,title:"FreshsalesAccounts",route:"intFreshsalesAccount",translate:"INTEGRATIONS.FRESHSALESACCOUNTS",state:"app.integrations.freshsalesAccounts",permissions:{association:!1,loading:!0},weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1304)&&!r.hasRole("admin")}}),o.saveItem("apps.settings",{id:1400,title:"Settings",translate:"SETTINGS.SETTINGS",icon:"icon-cog",permissions:{hidden:!0},weight:20,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")||r.hasRole("admin")&&!r.getCurrentUser().settingsEnabled}}),o.saveItem("apps.settings.generals",{id:1401,title:"General",route:"setting",translate:"SETTINGS.GENERAL",state:"app.settings.generals",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.smtps",{id:1402,title:"Smtp",route:"mailAccount",translate:"SETTINGS.SMTP",state:"app.settings.smtps",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.networks",{id:1403,title:"Networks",route:"network",translate:"SETTINGS.NETWORKS",state:"app.settings.networks",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.customizations",{id:1407,title:"Customizations",route:"setting",translate:"SETTINGS.CUSTOMIZATIONS",state:"app.settings.customizations",weight:1,hidden:function(){return!l.custom||r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.cloudProviders",{id:1408,title:"AiTools",route:"cloudProvider",translate:"SETTINGS.CLOUD_PROVIDERS",state:"app.settings.cloudProviders",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.updates",{id:1404,title:"Updates",route:"",translate:"SETTINGS.UPDATES",state:"app.settings.updates",weight:1,hidden:function(){return!l.update||r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.license",{id:1405,title:"License",route:"",translate:"SETTINGS.LICENSE",state:"app.settings.license",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.system",{id:1406,title:"System",route:"",translate:"SETTINGS.SYSTEM",state:"app.settings.system",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer",{id:1500,title:"MotionDialer",translate:"MOTIONDIALER.MOTIONDIALER",icon:"icon-fire",license:"dialer",weight:5,hidden:function(){return!l.dialer||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.queueCampaigns",{id:1501,title:"QueueCampaigns",route:"voiceQueue",channel:"bull",translate:"MOTIONDIALER.QUEUECAMPAIGNS",state:"app.motiondialer.queueCampaigns",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1501)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.ivrCampaigns",{id:1502,title:"IvrCampaigns",route:"campaign",translate:"MOTIONDIALER.IVRCAMPAIGNS",state:"app.motiondialer.ivrCampaigns",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1502)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.realtime",{id:1510,title:"Realtime",route:"",translate:"MOTIONDIALER.REALTIME",state:"app.motiondialer.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1510)&&!r.hasRole("admin")}}),o.saveItem("apps.help",{id:1600,title:"Help",translate:"HELP.HELP",icon:"icon-help",permissions:{association:!1},weight:21,hidden:function(){return!c.viewHelpSection||r.hasRole("agent")||!r.hasPermission(1600)&&!r.hasRole("admin")}}),o.saveItem("apps.help.about",{id:1601,title:"About",route:"",translate:"HELP.ABOUT",state:"app.help.about",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1600)&&!r.hasRole("admin")}}),o.saveItem("apps.jscripty",{id:1700,title:"jscripty",translate:"JSCRIPTY.JSCRIPTY",icon:"icon-script",license:"jscripty",weight:14,hidden:function(){return!l.jscripty||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.jscripty.projects",{id:1701,title:"Projects",route:"jscriptyProject",translate:"JSCRIPTY.PROJECTS",state:"app.jscripty.projects",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1701)&&!r.hasRole("admin")}}),o.saveItem("apps.marketplace",{id:1800,title:"Marketplace",translate:"MARKETPLACE.MARKETPLACE",icon:"icon-cart",weight:18,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.marketplace.plugins",{id:1801,title:"Plugins",route:"plugin",translate:"MARKETPLACE.PLUGINS",state:"app.marketplace.plugins",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1801)&&!r.hasRole("admin")}}),o.saveItem("apps.video",{id:2e3,title:"Video",translate:"VIDEO.VIDEO",icon:"icon-video",license:"screenrecording",weight:12,hidden:function(){return!l.screenrecording||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.video.screenRecordings",{id:2001,title:"ScreenRecordings",route:"screenRecording",translate:"VIDEO.SCREENRECORDINGS",state:"app.video.screenRecordings",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2001)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp",{id:2100,title:"Whatsapp",translate:"WHATSAPP.WHATSAPP",icon:"icon-whatsapp",license:"whatsapp",weight:11,hidden:function(){return!l.whatsapp||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.whatsappQueues",{id:2101,title:"WhatsappQueues",route:"whatsappQueue",channel:"whatsapp",translate:"WHATSAPP.WHATSAPPQUEUES",state:"app.whatsapp.whatsappQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2101)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.whatsappAccounts",{id:2102,title:"WhatsappAccounts",route:"whatsappAccount",channel:"whatsapp",translate:"WHATSAPP.WHATSAPPACCOUNTS",state:"app.whatsapp.whatsappAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2102)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.realtime",{id:2110,title:"Realtime",route:"",translate:"WHATSAPP.REALTIME",state:"app.whatsapp.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2110)&&!r.hasRole("admin")}}),o.sort(),i.saveItem("apps",{title:"APPS",group:!0,weight:1}),i.saveItem("apps.home",{id:100,title:"Home",translate:"DASHBOARDS.HOME",icon:"icon-home",weight:1}),i.saveItem("apps.home.dashboard",{id:101,title:"Dashboard",translate:"DASHBOARDS.DASHBOARD",state:"dashboard",view:"dashboard",icon:"icon-tile-four",iconClass:"cyan-500-fg",weight:1,hidden:function(){return!r.hasPermission(101)}}),i.saveItem("apps.home.agentPresence",{id:115,title:"AgentPresence",translate:"DASHBOARDS.AGENT_PRESENCE",state:"agentPresence",view:"agentPresence",icon:"icon-webcam",iconClass:"xenialab-violet-light-fg",weight:2,hidden:function(){return!r.hasPermission(115)}}),i.saveItem("apps.home.contacts",{id:102,title:"Contacts",translate:"DASHBOARDS.CONTACTS",state:"contacts",view:"contacts",icon:"icon-account-circle",iconClass:"red-fg",weight:3,hidden:function(){return!l.cm||!r.hasPermission(102)}}),i.saveItem("apps.home.mycontacts",{id:103,title:"Contacts",translate:"DASHBOARDS.MYCONTACTS",state:"mycontacts",view:"mycontacts",icon:"icon-account-multiple",iconClass:"red-fg",weight:4,hidden:function(){return!l.cm||!r.hasPermission(103)}}),i.saveItem("apps.home.scheduled",{id:113,title:"Scheduled Calls",translate:"DASHBOARDS.SCHEDULED_CALLS",state:"scheduled",view:"scheduled",icon:"icon-calendar-clock",iconClass:"blue-grey-fg",weight:5,hidden:function(){return!l.dialer||!r.hasPermission(113)}}),i.saveItem("apps.home.voice",{id:110,title:"Voice",translate:"DASHBOARDS.VOICE",state:"voice",view:"voice",icon:"icon-phone",iconClass:"blue-A700-fg",weight:6,hidden:function(){return!l.voice||!r.hasPermission(110)}}),i.saveItem("apps.home.abandoned",{id:111,title:"Abandoned",translate:"DASHBOARDS.ABANDONED",state:"abandoned",view:"abandoned",icon:"icon-phone-missed",iconClass:"blue-fg",weight:7,hidden:function(){return!l.voice||!r.hasPermission(111)}}),i.saveItem("apps.home.recordings",{id:104,title:"Recordings",translate:"DASHBOARDS.RECORDINGS",state:"recordings",view:"recordings",icon:"icon-audiobook",iconClass:"indigo-A100-fg",weight:8,hidden:function(){return!l.voice||!r.hasPermission(104)}}),i.saveItem("apps.home.chat",{id:105,title:"Chat",translate:"DASHBOARDS.CHAT",state:"chat",view:"chat",icon:"icon-hangouts",iconClass:"green-A700-fg",weight:9,hidden:function(){return!l.chat||!r.hasPermission(105)}}),i.saveItem("apps.home.mail",{id:106,title:"Mail",translate:"DASHBOARDS.MAIL",state:"mail",view:"mail",icon:"icon-email",iconClass:"teal-fg",weight:10,hidden:function(){return!l.mail||!r.hasPermission(106)}}),i.saveItem("apps.home.sms",{id:107,title:"Sms",translate:"DASHBOARDS.SMS",state:"sms",view:"sms",icon:"icon-message-text",iconClass:"orange-fg",weight:11,hidden:function(){return!l.messaging||!r.hasPermission(107)}}),i.saveItem("apps.home.openchannel",{id:108,title:"Openchannel",translate:"DASHBOARDS.OPENCHANNEL",state:"openchannel",view:"openchannel",icon:"icon-google-earth",iconClass:"amber-fg",weight:12,hidden:function(){return!l.openchannel||!r.hasPermission(108)}}),i.saveItem("apps.home.fax",{id:109,title:"Fax",translate:"DASHBOARDS.FAX",state:"fax",view:"fax",icon:"icon-deskphone",iconClass:"blue-grey-A200-fg",weight:13,hidden:function(){return!l.fax||!r.hasPermission(109)}}),i.saveItem("apps.home.whatsapp",{id:114,title:"Whatsapp",translate:"DASHBOARDS.WHATSAPP",state:"whatsapp",view:"whatsapp",icon:"icon-whatsapp",iconClass:"lime-A700-fg",weight:14,hidden:function(){return!l.whatsapp||!r.hasPermission(114)}}),n.$on("$viewContentAnimationEnded",function(e){e.targetScope.$id===n.$id&&t.$broadcast("msSplashScreen::remove")}),n.$on("socket:connect",function(){t.toastySocketLost&&(s.clear(t.toastySocketLost),t.toastySocketLost=void 0)}),n.$on("socket:disconnect",function(){t.toastySocketLost||s.warning({title:e.instant("TOOLBAR.WARNING"),msg:e.instant("DASHBOARDS.LOST_CONNECTION"),timeout:!1,onAdd:function(){t.toastySocketLost=this.id}})}),n.$on("client-side-logging:enabled",function(){"admin"!==r.getCurrentUser().role&&s.info({title:e.instant("STAFF.CLIENT_LOGS"),msg:e.instant("STAFF.CLIENT_LOGS_ENABLED_MSG")})}),n.$on("client-side-logging:disabled",function(){"admin"!==r.getCurrentUser().role&&s.info({title:e.instant("STAFF.CLIENT_LOGS"),msg:e.instant("STAFF.CLIENT_LOGS_DISABLED_MSG")})}),a.onbeforeunload=function(){r.isTelephone()||u.flush()}}e.$inject=["$scope","$rootScope","$translate","$window","msNavigationService","msNavigationAgentService","toasty","Auth","license","api","setting","UserSettingService","ClientSideLoggingService"],angular.module("motion").controller("MainController",e)}(),function(){"use strict";function e(e,n,t,a,o,r){var i=this;function s(e){if(e&&e.id){var n=99999+e.id;o.saveItem("apps.dashboards.custom_"+n,{id:n,title:e.name||"NONAME",state:"app.dashboards.custom",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(n)&&!r.hasRole("admin")}})}}function l(e){if(e&&e.id&&"never"!=e.sidebar)if(e.active){if("always"==e.sidebar||"adminOnly"==e.sidebar){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1900)&&!r.hasRole("admin")}});var n=88888+e.id;o.saveItem("apps.plugins.plugin_"+n,{id:n,title:e.name||"NONAME",state:"app.plugins.plugin",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(n)&&!r.hasRole("admin")}}),o.sort()}}else{n=88888+e.id;t=1900,a=n,i=o.getNavigation(),(s=_.find(i[0].children,{id:t}))&&_.some(s.children,{id:a})&&("always"==e.sidebar||"adminOnly"==e.sidebar)&&(o.deleteItem("apps.plugins.plugin_"+n),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}var t,a,i,s}function d(e){var n=o.getNavigation(),t=_.find(n[0].children,{id:e});return!!(t&&0<t.children.length)}i.bodyEl=angular.element("body"),i.setting=t,i.$onInit=function(){i.folded="true"===n.get("motion.folded")||!1},i.toggleMsNavigationFolded=function(){i.folded=!i.folded,n.put("motion.folded",i.folded)},i.getLogo=function(){return i.setting.defaultHeaderWhiteLabel?"xCALLY Motion":i.setting.headerWhiteLabel},a.on("dashboard:save",s),a.on("dashboard:update",s),a.on("dashboard:remove",function(e){if(e&&e.id){var n=99999+e.id;o.deleteItem("apps.dashboards.custom_"+n)}}),a.on("plugin:save",l),a.on("plugin:update",l),a.on("plugin:remove",function(e){if(e&&e.id&&"never"!=e.sidebar){var n=88888+e.id;"always"!=e.sidebar&&"adminOnly"!=e.sidebar||(o.deleteItem("apps.plugins.plugin_"+n),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}}),e.$on("$stateChangeSuccess",function(){i.bodyEl.removeClass("ms-navigation-horizontal-mobile-menu-active")})}e.$inject=["$scope","$cookies","setting","socket","msNavigationService","Auth"],angular.module("app.navigation").controller("NavigationController",e)}(),function(){"use strict";function e(e,a,i,n,t,s,o,r){var l=this;function d(t){o.isSupported()?o.requestPermission().then(function(){var e,n;n={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"api/users/"+(e=t).FromId+"/avatar",body:e.body||"",focusOnclick:!0,closeOnClick:!0},o.show(a.instant("QUICKPANEL.NEW_INTERNAL_MESSAGE"),n)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}l.date=moment().format(),l.currentUser=n.getCurrentUser(),l.license=r,l.unreadTotalMessages=0,l.unreadTotalGroupMessages=0,l.userIsNotPhonebar=function(){return"admin"===l.currentUser.role||"user"===l.currentUser.role||"agent"===l.currentUser.role&&0!==l.currentUser.showWebBar},l.onMessageSave=function(e){e.ToId===l.currentUser.id&&e.FromId!==l.currentUser.id&&!e.read&&e.ChatGroupId&&(l.unreadTotalGroupMessages++,d(e));e.ToId!==l.currentUser.id||e.ChatGroupId||(l.unreadTotalMessages+=1,d(e))},l.onMessageUpdate=function(e){e.ToId===l.currentUser.id&&e.read&&0<l.unreadTotalMessages&&!e.ChatGroupId&&(l.unreadTotalMessages-=1);e.ToId==l.currentUser.id&&e.FromId!==l.currentUser.id&&e.ChatGroupId&&e.read&&0<l.unreadTotalGroupMessages&&l.unreadTotalGroupMessages--},t.on("chatInternalMessage:save",l.onMessageSave),t.on("chatInternalMessage:update",l.onMessageUpdate),s.chatInternalMessage.get({fields:"FromId",ToId:l.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){return e&&e.count&&(l.unreadTotalMessages=e.count),s.user.getGroups({id:l.currentUser.id}).$promise}).then(function(e){for(var n=[],t=e.rows,a=0;a<t.length;a++)n.push(s.chatGroup.getUnread({id:t[a].id}).$promise);return i.all(n)}).then(function(e){for(var n=0;n<e.length;n++)l.unreadTotalGroupMessages+=e[n].count}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){t.removeAllListeners("chatInternalMessage:save"),t.removeAllListeners("chatInternalMessage:update")})}e.$inject=["$scope","$translate","$q","Auth","socket","api","desktopNotification","license"],angular.module("app.quick-panel").controller("QuickPanelController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;function p(e){var n=angular.element("#chat-dialog");a(function(){n.animate({scrollTop:n[0].scrollHeight},e)},0)}function g(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function v(e){return m.get(e).success(function(){n.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){n.error({title:"PhoneBar API Error",msg:d.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}u.currentUser=i.getCurrentUser(),u.user=void 0,u.users={count:0,rows:[]},u.standardDate=moment(0).format("YYYY-MM-DD HH:mm:ss"),u.unreadMessage={},u.replyMessage="",u.disabled=!1,u.init=function(e){u.license=e},u.toggleChat=function(e){if(e){if(!e.allowmessenger&&"agent"===e.role)return n.warning({title:d.instant("QUICKPANEL.WARNING"),msg:d.instant("QUICKPANEL.MESSENGER_DISABLED")}),void(u.user=void 0);u.user=e,u.replyMessage="",t.chatInternalMessage.get({sort:"createdAt",FromId:u.currentUser.id+","+e.id,ToId:u.currentUser.id+","+e.id,ChatGroupId:"null"}).$promise.then(function(e){if(e&&e.rows){u.user.messages=e;for(var n=0;n<u.user.messages.rows.length;n+=1)!1===u.user.messages.rows[n].read&&u.user.messages.rows[n].ToId===u.currentUser.id&&t.chatInternalMessage.update({id:u.user.messages.rows[n].id,read:!0})}}).finally(function(){p(0)})}else u.user=void 0},u.reply=function(){u.disabled=!0;Date.now();if(""===u.replyMessage)return void(u.disabled=!1);var e={FromId:u.currentUser.id,ToId:u.user.id,body:u.replyMessage,read:!1};u.replyMessage="",t.chatInternalMessage.save(e).$promise.then(function(e){u.user.messages.rows.push(e),u.user.lastMessageAt=e.createdAt,u.user.lastMessage=e,p(400)}).catch(function(e){}).finally(function(){u.disabled=!1})},u.onMessageSave=function(e){if(e.ToId===u.currentUser.id&&!e.ChatGroupId){u.user&&u.user.id===e.FromId?(u.user.messages.rows.push(e),p(0),t.chatInternalMessage.update({id:e.id,read:!0})):u.unreadMessage[e.FromId]=u.unreadMessage[e.FromId]?u.unreadMessage[e.FromId]+1:1;var n=_.find(u.users.rows,{id:e.FromId});n&&(n.lastMessageAt=e.createdAt,n.lastMessage=e)}},u.onMessageUpdate=function(e){if((e.FromId===u.currentUser.id||e.ToId===u.currentUser.id)&&!e.ChatGroupId){if(u.user){var n=_.find(u.user.messages.rows,{id:e.id});n&&_.merge(n,e)}var t=_.find(u.users.rows,{id:u.currentUser.id===e.FromId?e.ToId:e.FromId});t&&t.lastMessage&&_.merge(t.lastMessage,e),e.ToId===u.currentUser.id&&e.read&&0<u.unreadMessage[e.FromId]&&(u.unreadMessage[e.FromId]-=1)}},u.onUserUpdate=function(e){var n=_.find(u.users.rows,{id:e.id});n&&(_.isNil(e.online)||n.online===e.online||(n.online=e.online),_.isNil(e.allowmessenger)||n.allowmessenger===e.allowmessenger||(n.allowmessenger=e.allowmessenger))},u.webcall=function(e){c.$broadcast("webrtc::call",{target:g(e)})},u.call=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/originate/"+g(e))},u.transfer=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+g(e))},s.on("chatInternalMessage:save",u.onMessageSave),s.on("chatInternalMessage:update",u.onMessageUpdate),s.on("user:update",u.onUserUpdate),o("quick-panel").onClose(function(){u.user=void 0}),t.chatInternalMessage.get({fields:"FromId",ToId:u.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){u.unreadMessage=_.countBy(e.rows,"FromId")}).catch(function(e){}),t.chatInternalMessage.getUsers().$promise.then(function(e){u.users=e}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){s.removeAllListeners("chatInternalMessage:save"),s.removeAllListeners("chatInternalMessage:update"),s.removeAllListeners("user:update")})}e.$inject=["$scope","toasty","api","$timeout","Auth","socket","$mdSidenav","$q","$interval","$translate","$rootScope","$http"],angular.module("app.quick-panel").controller("ChatInternalController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="QUICKPANEL.EDIT_CHATGROUP",d.group=angular.copy(r),d.currentUser=o.getCurrentUser(),d.members=l,d.newChatGroup=!0,d.group||(d.group={write:!0,members:[]},d.title="QUICKPANEL.NEW_CHATGROUP"),d.saveChatGroup=function(){var t;return d.errors=[],s.chatGroup.save({name:d.group.name,write:d.group.write}).$promise.then(function(e){var n=_.map(d.group.members,"id");return n.unshift(d.currentUser.id),t=e,s.chatGroup.addMembers({id:t.id,ids:n}).$promise}).then(function(){i.success({title:"Group properly saved!",msg:t.name+" has been saved!"}),c(t)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.closeDialog=c,d.querySearch=function(e){return e?d.members.rows.filter((n=e,t=angular.lowercase(n),function(e){var n=e.name.toLowerCase();return-1!=n.indexOf(t)})):[];var n,t}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","group","members"],angular.module("app.quick-panel").controller("CreateOrEditChatGroupDialogController",e)}(),function(){"use strict";function e(e,t,a,s,n,o,i,r,l,d){var c=this;function m(){delete c.group}function u(e){var n=angular.element("#chat-group-dialog");a(function(){n.animate({scrollTop:n[0].scrollHeight},e)},0)}c.currentUser=i.getCurrentUser(),c.unreadGroupMessages={},c.groups={},c.participants,c.group,c.init=function(e){return c.license=e,r.user.getGroups({id:c.currentUser.id}).$promise.then(function(e){for(var n=0,t=[];n<e.rows.length;n++)e.rows[n].unreadGroupMessages=0,c.groups[e.rows[n].id]=e.rows[n],t.push(r.chatGroup.getUnread({id:e.rows[n].id}).$promise);return o.all(t)}).then(function(e){for(var n=0;n<e.length;n++)c.groups[e[n].id].unreadGroupMessages+=e[n].count}).catch(function(e){console.error(e)})},c.back=m,c.addGroup=function(e,n){s.show({controller:"CreateOrEditChatGroupDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/create/dialog.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{group:e,me:c.currentUser,license:null,setting:null},resolve:{members:function(){return i.hasRole("admin")?r.user.get({role:"agent"}).$promise:r.userProfile.getResources({id:i.getCurrentUser().userProfileId,section:"Agents",role:"agent"}).$promise}}}).then(function(e){e&&(c.groups[e.id]=e)}).catch(function(e){e&&console.error(e.message)})},c.deleteGroup=function(e,n){var t=s.confirm().title("Are you sure want to delete the selected group?").htmlContent("Group <b>"+e.name+"</b> will be deleted.").ariaLabel("delete Group").targetEvent(n).ok("OK").cancel("CANCEL");s.show(t).then(function(){return r.chatGroup.delete({id:e.id}).$promise}).then(function(){delete c.groups[e.id],d.success({title:"Group properly deleted!",msg:e.name+" has been deleted!"})}).catch(function(e){e&&d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatGroup.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.groupsToArray=function(){return _.values(c.groups)},c.showMessageInfo=function(e,i){s.show({controller:"ShowMessageInfoDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/info/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{message:i},resolve:{data:function(){var a={messages:[]};return r.chatInternalMessage.get({ChatInternalMessageId:i.id}).$promise.then(function(e){var n=[];a.messages=e.rows,a.messages.unshift(i);for(var t=0;t<a.messages.length;t++)n.push(r.user.get({id:a.messages[t].ToId,fields:"id,name,fullname,userpic"}).$promise);return o.all(n)}).then(function(e){return a.users=e,a}).catch(function(e){e&&console.error(e)})}}}).then(function(){}).catch(function(e){e&&console.error(e.message)})},c.toggleChat=function(n){c.group={id:n.id,write:n.write,messages:{}},r.chatGroup.getMembers({id:n.id,fields:"id,name,fullname"}).$promise.then(function(e){return c.group.membersByKeys=_.keyBy(e.rows,"id"),c.group.members=_.differenceBy(e.rows,[{id:c.currentUser.id}],"id"),c.participants=_.map(c.group.members,"fullname").join(", "),r.chatGroup.getMessages({id:n.id,nolimit:!0}).$promise}).then(function(e){for(var n,t=0,a=[];t<e.count;t++)e.rows[t].ToId===c.currentUser.id&&(n=e.rows[t],c.group.messages[n.id]=n,e.rows[t].ToId!=c.currentUser.id||e.rows[t].FromId===c.currentUser.id||n.read||a.push(r.chatInternalMessage.update({id:n.id,read:!0})));return o.all(a)}).then(function(){u(400)}).catch(function(e){console.error(e.message)})},c.reply=function(){if(!c.replyMessage)return;var t={id:c.group.id,FromId:c.currentUser.id,ToId:c.currentUser.id,body:c.replyMessage,read:!0},a=[];c.replyMessage="",r.chatGroup.addMessage(t).$promise.then(function(e){t.read=!1,t.ChatInternalMessageId=e.id;for(var n=0;n<c.group.members.length;n++)c.group.members[n].id!==c.currentUser.id&&(t.ToId=c.group.members[n].id,a.push(r.chatGroup.addMessage(angular.copy(t)).$promise));return o.all(a)}).catch(function(e){console.log(e)})},l.on("chatInternalMessage:save",function(n){if(!c.group&&n.ToId===c.currentUser.id&&n.FromId!==c.currentUser.id&&!n.read&&n.ChatGroupId){var e=c.groups[n.ChatGroupId];if(!e)return r.chatGroup.get({id:n.ChatGroupId}).$promise.then(function(e){e.unreadGroupMessages=1,c.groups[e.id]=e});e.unreadGroupMessages||(e.unreadGroupMessages=0),e.unreadGroupMessages++}c.group&&n.ChatGroupId===c.group.id&&n.ToId===c.currentUser.id&&r.chatInternalMessage.update({id:n.id,read:!0}).$promise.then(function(){var e;e=n,c.group.messages[e.id]=e,u(400)})}),l.on("chatInternalMessage:update",function(e){e.ToId==c.currentUser.id&&e.FromId!==c.currentUser.id&&e.ChatGroupId&&e.read&&(0<c.groups[e.ChatGroupId].unreadGroupMessages&&c.groups[e.ChatGroupId].unreadGroupMessages--,c.group.messages[e.id]&&(c.group.messages[e.id].read=!0))}),l.on("chatGroup:remove",function(e){c.groups[e.id]&&delete c.groups[e.id]}),n("quick-panel").onClose(m),e.$on("$destroy",function(){l.removeAllListeners("chatInternalMessage:save"),l.removeAllListeners("chatInternalMessage:update"),l.removeAllListeners("chatGroup:remove")})}e.$inject=["$scope","$document","$timeout","$mdDialog","$mdSidenav","$q","Auth","api","socket","toasty"],angular.module("app.quick-panel").controller("ChatGroupController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){this.data=r,this.title="QUICKPANEL.INFO",this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","data"],angular.module("app.quick-panel").controller("ShowMessageInfoDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.form={token:s.token},o.setting={},o.resetPassword=function(){return i.auth.reset(o.form).$promise.then(function(){n.success({title:t.instant("RESETPASSWORD.PASSWORD_RESET"),msg:t.instant("RESETPASSWORD.PASSWORD_RESET_MESSAGE")}),a.go("app.login")}).catch(function(e){e&&n.error({title:t.instant("RESETPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},o.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general");return i.setting.gdpr({id:1}).$promise.then(function(e){o.setting=e,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:""}).catch(function(e){e&&n.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})})}}e.$inject=["Auth","toasty","$translate","$state","api","$stateParams"],angular.module("app.reset").controller("ResetPasswordController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.errors=[],r.user=i,r.setting=s,r.reset=o,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.savePassword=function(){r.errors=[],a.user.changePassword({id:r.user.id},{oldPassword:r.oldPassword,newPassword:r.password}).$promise.then(function(){n.show(n.simple().textContent("Your password properly updated").position("top right").hideDelay(5e3)),l()}).catch(function(e){console.error(e),r.errors=e.data.errors&&e.data.errors.length?e.data.errors:[{message:e.data.message||"Authorization error",type:"api.user.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.changePasswordForm.password.$setValidity("oldPasswordMatch",!1):t.changePasswordForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","$mdToast","api","user","setting","reset"],angular.module("app.toolbar").controller("ChangePasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){var l=this;function d(e){_.isNil(e)&&s.cmHopper.update({id:l.preview.id,UserId:null}),a.hide()}l.customFieldsMap=r&&r.rows?_.mapValues(_.keyBy(r.rows,function(e){return"cf_"+e.id}),"name"):{},l.errors=[],l.hopperIds=[],l.preview=o,l.originated=!1,l.disable=!1,l.disableGetContact=!1,l.hopperIds.push(l.preview.id),l.originatePreview=function(){l.originated=!0,l.disable=!0,_.isEmpty(l.preview)?(i.error({title:"Message",msg:"Contact not available"}),l.disable=!1,l.hopperIds=[],d(!0)):s.rpc.getVoiceQueuesPreview({id:l.preview.id}).$promise.then(function(){d(!0)}).catch(function(e){i.error({title:"Message",msg:e.data}),d(!0)}).finally(function(){l.disable=!1,l.hopperIds=[]})},l.closeDialog=d,l.nextContact=function(){return l.disableGetContact=!0,s.cmHopper.getPreview({hopperIds:l.hopperIds,direction:"next"}).$promise.then(function(e){l.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(l.hopperIds=[],a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e,l.hopperIds.push(l.preview.id))}).catch(function(e){if(l.disableGetContact=!1,l.hopperIds=[],404===e.status)l.getFirstAvailableContact();else if(e.data&&e.data.errors&&e.data.errors.length){a.hide();for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.hide(),i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.previousContact=function(){if(l.disableGetContact=!0,1<l.hopperIds.length){var e=_.without(l.hopperIds,l.preview.id);return s.cmHopper.getPreview({hopperIds:e,direction:"prev"}).$promise.then(function(e){l.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(l.hopperIds=[],a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(_.remove(l.hopperIds,function(e){return e==l.preview.id}),l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e)}).catch(function(e){if(404===e.status)l.hopperIds=[l.preview.id],i.info({title:"PREVIEW",msg:"PREVIOUS CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){l.hopperIds=[],a.hide();for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.hopperIds=[],a.hide(),i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}},l.getFirstAvailableContact=function(){return l.disableGetContact=!0,i.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE. REWINDING THE LIST"}),s.cmHopper.getPreview({hopperIds:[l.preview.id],direction:"next"}).$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e,l.hopperIds.push(l.preview.id))}).catch(function(e){if(a.hide(),404===e.status)i.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){l.disableGetContact=!1})},l.isCustomField=function(e){return _.startsWith(e,"cf_")},l.isHiddenField=function(e){return _.includes(["Company","CompanyId","ListId","UserId","createdAt","deletedAt","id","dialTimezone","utcOffset","priority","scheduledat","tags","updatedAt","facebook","twitter","skype","wechat","teams","viber","line","telegram"],e)},l.isNil=function(e){return _.isNil(e)},e.$on("$destroy",function(){l.originated||s.cmHopper.update({id:l.preview.id,UserId:null})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","preview","customFields"],angular.module("app.toolbar").controller("PreviewDialogController",e)}(),function(){"use strict";function e(n,t,s,a,o,e,i,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S){var T,I=this;I.voiceQueues={},I.polling=!0,t.global={search:""},I.pauses=[],I.license=b,I.currentUser=v.getCurrentUser(),I.unreadTotalMessages=0,I.unreadTotalGroupMessages=0,I.contacts=0,"agent"===I.currentUser.role&&(T=E(function(){_.some(I.voiceQueues,{dialMethod:"preview",dialActive:!0})&&I.license.dialer&&I.polling?(I.polling=!1,f.cmHopper.getOpenContacts().$promise.then(function(e){e&&_.isNumber(e.contacts)&&(I.contacts=e.contacts)}).finally(function(){I.polling=!0})):I.contacts=0},14999)),I.setting=A,I.bodyEl=angular.element("body"),I.conf={realm:"asterisk",host:e.host(),protocol:e.protocol(),soundPlayerId:"local-audio",remotePlayerId:"remote-audio",ua:"Motion WebRTC Bar 0.2.0",license:I.license.webrtc,phoneBarExpires:I.currentUser.phoneBarExpires,phoneBarPrefixRequired:I.currentUser.phoneBarPrefixRequired,wssPort:I.currentUser.wssPort},I.webRTCSessions=[],I.query={id:v.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",nolimit:!0},I.userStatusOptions=[{title:"Online",icon:"icon-checkbox-marked-circle",color:"#4CAF50"},{title:"Away",icon:"icon-clock",color:"#FFC107"},{title:"Do not Disturb",icon:"icon-minus-circle",color:"#F44336"},{title:"Invisible",icon:"icon-checkbox-blank-circle-outline",color:"#BDBDBD"},{title:"Offline",icon:"icon-checkbox-blank-circle-outline",color:"#616161"}],I.languages={ar:{title:"Arabic",translation:"TOOLBAR.ARABIC",code:"ar",flag:"ar"},cs:{title:"Czech",translation:"TOOLBAR.CZECH",code:"cs",flag:"cs"},da:{title:"Danish",translation:"TOOLBAR.DANISH",code:"da",flag:"da"},de:{title:"German",translation:"TOOLBAR.GERMAN",code:"de",flag:"de"},en:{title:"English",translation:"TOOLBAR.ENGLISH",code:"en",flag:"us"},es:{title:"Spanish",translation:"TOOLBAR.SPANISH",code:"es",flag:"es"},fa:{title:"Persian",translation:"TOOLBAR.PERSIAN",code:"fa",flag:"fa"},fi:{title:"Finnish",translation:"TOOLBAR.FINNISH",code:"fi",flag:"fi"},fr:{title:"French",translation:"TOOLBAR.FRENCH",code:"fr",flag:"fr"},he:{title:"Hebrew",translation:"TOOLBAR.HEBREW",code:"he",flag:"he"},hi:{title:"Hindi",translation:"TOOLBAR.HINDI",code:"hi",flag:"hi"},hu:{title:"Hungarian",translation:"TOOLBAR.HUNGARIAN",code:"hu",flag:"hu"},id:{title:"Indonesian",translation:"TOOLBAR.INDONESIAN",code:"id",flag:"id"},it:{title:"Italian",translation:"TOOLBAR.ITALIAN",code:"it",flag:"it"},ja:{title:"Japanese",translation:"TOOLBAR.JAPANESE",code:"ja",flag:"ja"},ko:{title:"Korean",translation:"TOOLBAR.KOREAN",code:"ko",flag:"ko"},lv:{title:"Latvian",translation:"TOOLBAR.LATVIAN",code:"lv",flag:"lv"},nl:{title:"Dutch",translation:"TOOLBAR.DUTCH",code:"nl",flag:"nl"},no:{title:"Norwegian",translation:"TOOLBAR.NORWEGIAN",code:"no",flag:"no"},pl:{title:"Polish",translation:"TOOLBAR.POLISH",code:"pl",flag:"pl"},"pt-BR":{title:"Brazilian",translation:"TOOLBAR.BRAZILIAN",code:"pt-BR",flag:"pt-BR"},"pt-PT":{title:"Portuguese",translation:"TOOLBAR.PORTUGUESE",code:"pt-PT",flag:"pt-PT"},ru:{title:"Russian",translation:"TOOLBAR.RUSSIAN",code:"ru",flag:"ru"},sv:{title:"Swedish",translation:"TOOLBAR.SWEDISH",code:"sv",flag:"sv"},tr:{title:"Turkish",translation:"TOOLBAR.TURKISH",code:"tr",flag:"tr"},"zh-CN":{title:"ChineseSimplified",translation:"TOOLBAR.CHINESESIMPLIFIED",code:"zh-CN",flag:"zh-CN"},"zh-TW":{title:"ChineseTraditional",translation:"TOOLBAR.CHINESETRADITIONAL",code:"zh-TW",flag:"zh-TW"}};var O=["ar","fa","he"],C=S.getLogger("toolbar");function w(){h.connect(),h.on("user:update",I.onUserUpdate),h.on("user:called",I.onUserCalled),h.on("chatInternalMessage:save",I.onInternalMessageSave),h.on("chatInternalMessage:update",I.onInternalMessageUpdate),h.on("userVoiceQueue:save",I.onUserVoiceQueue),h.on("voiceQueue:save",I.onVoiceQueue),h.on("userVoiceQueue:remove",I.onUserVoiceQueue),h.on("voiceQueue:remove",I.onVoiceQueue),h.on("voiceQueue:update",I.onVoiceQueue),h.on("user:forcelogout",L),h.on("userNotification:send",k)}function R(){h.disconnect("logout")}function x(e){I.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}function N(){I.promise=f.user.getQueues(I.query,x).$promise}function D(e){return R(),s.resolve().then(function(){if(!v.isTelephone())return S.flush()}).then(function(){return v.logout(e)}).then(function(){return t.$broadcast("webrtc::logout"),a.go("app.login")}).catch(function(e){C.error(e)})}function P(e,n){c.show({controller:"ChangePasswordController",controllerAs:"vm",templateUrl:"app/toolbar/changepassword/changepassword.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!n,escapeToClose:!n,locals:{user:I.user,setting:A,reset:n}})}function L(e){if(C.debug("onForceLogout -> data",e),e.user.id===I.user.id&&0!==I.user.showWebBar)return R(),s.resolve().then(function(){if(!v.isTelephone())return S.flush()}).then(function(){return v.logout(!0)}).then(function(){t.$broadcast("webrtc::logout"),c.show(c.alert().parent(angular.element(m.body)).clickOutsideToClose(!1).escapeToClose(!1).title(r.instant("TOOLBAR.WARNING")).textContent(r.instant("TOOLBAR.USER_FORCE_LOGOUT",{ip:e.ip})).ok("OK")).then(function(){return a.go("app.login")})}).catch(function(e){C.error(e)})}function k(e){var n=e;if(I.currentUser.id===n.recipient){var t=r.instant("TOOLBAR.NOTIFICATION_TITLE",{sender:n.sender}),a=n.description?r.instant("TOOLBAR.NOTIFICATION_TITLE_RECIPIENT",{recipient:n.description}):null;p.wait({title:a?t+" "+a:t,msg:n.content,clickToClose:!1,timeout:!1,sound:n.beep,html:!0})}}I.toggleSidenav=function(e){i(e).toggle()},I.logout=D,I.changeLanguage=function(e){if(!I.languages.hasOwnProperty(e.code)){return void l.show({template:'<md-toast id="language-message" layout="column" layout-align="center start"><div class="md-toast-content">Motion supports multiple translations through angular-translate module, but currently we do not support the selected language. If you want to help us, send us a message.</div></md-toast>',hideDelay:7e3,position:"top right",parent:"#content"})}I.selectedLanguage=e,u.put("motion.language",e.code),r.use(e.code),"app.callysquare.projects.edit"===a.current.name&&d.location.reload();0<=O.indexOf(e.code)?p.info({title:r.instant("TOOLBAR.CHANGE_LANGUAGE_TITLE"),msg:r.instant("TOOLBAR.CHANGE_LANGUAGE_MESSAGE")}):n.$parent.$parent.vm.direction="ltr"},I.setUserStatus=function(e){I.userStatus=e},I.toggleHorizontalMobileMenu=function(){I.bodyEl.toggleClass("ms-navigation-horizontal-mobile-menu-active")},I.toggleMsNavigationFolded=function(){g.toggleFolded()},I.search=function(n){for(var e=[],t=g.getFlatNavigation(),a=s.defer(),i=0;i<t.length;i++)t[i].uisref&&e.push(t[i]);n&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(n)))return!0}));return o(function(){a.resolve(e)},1e3),a.promise},I.searchResultClick=function(e){e.uisref&&(e.stateParams?a.go(e.state,e.stateParams):a.go(e.state))},I.openSettings=function(){t.$broadcast("webrtc::settings")},I.changePassword=P,I.isAgent=function(){return v.getCurrentUser()&&v.hasRole("agent")},I.onUserUpdate=function(e){if(e.id===I.user.id)if("agent"===e.role&&_.isBoolean(e.online)&&!e.online)if(0!==I.user.showWebBar){var n;R();var t=c.confirm({title:r.instant("TOOLBAR.WARNING")+"!",htmlContent:"<span>"+r.instant("TOOLBAR.SOMEONE_LOGGED_YOU_OUT")+"</span><br><span>"+r.instant("TOOLBAR.SESSION_TIMEOUT")+"</span>",ariaLabel:r.instant("TOOLBAR.WARNING")+"!",ok:r.instant("TOOLBAR.STAY_LOGGED"),cancel:r.instant("TOOLBAR.LOGOUT"),onComplete:function(){n=setTimeout(function(){c.cancel()},6e4)}});c.show(t).then(function(){return clearTimeout(n),v.queueLogin().then(function(){w(),_.merge(I.user,e),v.setCurrentUser(I.user)})}).catch(function(){clearTimeout(n),D(!0)})}else D(!0);else _.merge(I.user,e),v.setCurrentUser(I.user)},I.onUserCalled=function(e){if(2===I.currentUser.showWebBar&&"agent"===I.currentUser.role){var n=I.currentUser.privacyEnabled?y.mask(e.calleridnum):e.calleridnum;p.info({title:"WebRTC Popup",msg:"<div>            <span>Call from: "+n+"</span><br>            <span>Queue: "+e.queue+"</span><br>            <span>Extra: "+(e.extravar?e.extravar:"Not defined")+"</span><br>            </div>",showClose:!0,timeout:1e4,html:!0})}},I.pause=function(e){var n=e||"DEFAULT PAUSE";_.some(I.webRTCSessions,["confirmed",!0])&&(n="#"+n);return f.user.pause({id:I.user.id,type:n}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},I.unpause=function(){return f.user.unpause({id:I.user.id}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UNPAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},I.preview=function(n){return I.disable=!0,f.cmHopper.getPreview().$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?p.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):c.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(m.body),targetEvent:n,clickOutsideToClose:!0,locals:{preview:e,currentUser:I.currentUser},resolve:{customFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{nolimit:!0})}]}})}).catch(function(e){if(404===e.status)p.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){I.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){I.disable=!1})},I.getLogo=function(){return I.setting.defaultHeaderWhiteLabel?"xCALLY Motion":I.setting.headerWhiteLabel},I.userIsNotPhonebar=function(){return"admin"===I.currentUser.role||"user"===I.currentUser.role||"agent"===I.currentUser.role&&0!==I.currentUser.showWebBar},I.onInternalMessageSave=function(e){e.ToId!==I.currentUser.id||e.ChatGroupId||(I.unreadTotalMessages+=1);e.ToId===I.currentUser.id&&e.FromId!==I.currentUser.id&&!e.read&&e.ChatGroupId&&I.unreadTotalGroupMessages++},I.onInternalMessageUpdate=function(e){e.ToId===I.currentUser.id&&e.read&&0<I.unreadTotalMessages&&!e.ChatGroupId&&(I.unreadTotalMessages-=1);e.ToId===I.currentUser.id&&e.read&&e.ChatGroupId&&0<I.unreadTotalGroupMessages&&I.unreadTotalGroupMessages--},I.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===v.getCurrentUser().id&&N()},I.onVoiceQueue=function(){N()},function(){I.user=v.getCurrentUser(),I.conf.ha1=I.user.md5secret,I.conf.id=I.user.id,I.conf.name=I.user.name,I.conf.fullname=I.user.fullname,I.conf.internal=I.user.internal,I.conf.recording=I.user.phoneBarEnableRecording,I.conf.autoAnswer=I.user.phoneBarAutoAnswer,I.conf.enableSettings=I.user.phoneBarEnableSettings,I.conf.enableDtmfTone=I.user.phoneBarEnableDtmfTone,I.conf.autoAnswerDelay=I.user.phoneBarAutoAnswerDelay,I.userStatus=I.userStatusOptions[0];var e=u.get("motion.language");e&&I.languages.hasOwnProperty(e)?I.selectedLanguage=I.languages[e]:I.selectedLanguage=I.languages[r.preferredLanguage()];if(f.pause.get({fields:"name",nolimit:!0}).$promise.then(function(e){I.pauses=e.rows?e.rows:[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETPAUSES",msg:e.status?JSON.stringify(e.data):e.toString()})}),"LOCAL_LOGIN"==v.getAuthenticationType()&&I.setting.securePassword)if(I.user.passwordResetAt){var n=moment(I.user.passwordResetAt).add(I.setting.passwordExpiresDays||90,"day");moment().isAfter(n)?P(null,!0):moment().add(15,"day").isAfter(n)&&p.warning({title:r.instant("TOOLBAR.WARNING")+"!",msg:r.instant("TOOLBAR.PASSWORD_EXPIRE_REMAINING_DAYS")+": "+Math.ceil(n.diff(moment(),"days",!0)),timeout:2e4})}else P(null,!0)}(),N(),w(),f.chatInternalMessage.get({fields:"FromId",ToId:I.currentUser.id,read:!1,nolimit:!0}).$promise.then(function(e){I.unreadTotalMessages=e.rows.length}),n.$on("$destroy",function(){h.removeAllListeners("user:called"),h.removeAllListeners("user:update"),h.removeAllListeners("chatInternalMessage:save"),h.removeAllListeners("chatInternalMessage:update"),h.removeAllListeners("userVoiceQueue:save"),h.removeAllListeners("voiceQueue:save"),h.removeAllListeners("userVoiceQueue:remove"),h.removeAllListeners("voiceQueue:remove"),h.removeAllListeners("voiceQueue:update"),h.removeAllListeners("user:forcelogout"),h.removeAllListeners("userNotification:send"),T&&(E.cancel(T),T=null)})}e.$inject=["$scope","$rootScope","$q","$state","$timeout","$location","$mdSidenav","$translate","$mdToast","$window","$mdDialog","$document","$cookies","toasty","msNavigationService","Auth","socket","api","license","setting","$interval","privacyManager","ClientSideLoggingService"],angular.module("app.toolbar").controller("ToolbarController",e)}(),function(){"use strict";function e(a,i,t,s,e){var n={updateUserSettingById:function(e,n){if("number"==typeof e)return i.userSetting.update({id:e},n).$promise;throw new Error("User setting id is missing")}},o=!1,r=a.getCurrentUser(),l=r?r.userSetting:null,d=function(e){var n="user-setting:update:user-"+e;t.$on("local:user-updated",c),s.on(n,c)};function c(){return o?e(function(e){e(l)}):(o=!0,function(e){var n=a.getCurrentUser(),t=null;t="admin"===n.role&&"number"==typeof e?i.user.get({id:e,userSetting:!0}).$promise:i.user.whoami({userSetting:!0}).$promise;return t.then(function(e){return a.setCurrentUser(e),e.userSetting})}().then(function(e){l=e,t.$emit("local:user-setting-updated",l)}).finally(function(){o=!1}))}return r&&d(r.id),t.$on("local:user-login",d),t.$on("local:user-logout",function(e){var n="user-setting:update:user-"+e;s.removeListener(n,c),l=null}),n}e.$inject=["Auth","api","$rootScope","socket","$q"],angular.module("app.user-setting").service("UserSettingService",e)}();var urlParams=function(e){var n=new Object,t=e.lastIndexOf("?");if(0<t)for(var a=e.substring(t+1).split("&"),i=0;i<a.length;i++)0<(t=a[i].indexOf("="))&&(n[a[i].substring(0,t)]=a[i].substring(t+1));return n}(window.location.href),t0=new Date,MAX_REQUEST_SIZE=10485760,MAX_WIDTH=12e3,MAX_HEIGHT=12e3,EXPORT_URL="http://exp.draw.io/ImageExport2/export",SHARE_HOST="http://localhost:3000",SAVE_URL="api/square/projects/",VARIABLE_URL="/api/variables",STENCIL_PATH="/assets/plugins/square/stencils",SHAPES_PATH="/assets/plugins/square/shapes",IMAGE_PATH="/assets/plugins/square/images",STYLE_PATH="/assets/plugins/square/styles",CSS_PATH="/assets/plugins/square/styles",OPEN_FORM="api/square/projects/open",TEMPLATE_PATH="/assets/plugins/square/templates",RESOURCES_PATH="/assets/plugins/square/resources",RESOURCE_BASE=RESOURCES_PATH+"/grapheditor",CRUD_PERMISSIONS={readOnly:!1,canEdit:!1,canDelete:!1},tapAndHoldStartsConnection=!0,showConnectorImg=!0,mxLoadResources=!1,mxLanguages=["it","fr","ko","es","sv","ru","de","ja","zh-CN","zh-TW","nl","fi","da","pt-BR","pt-PT","no","hi","tr","fa"],mxLanguage="en",match=document.cookie.match(new RegExp("(^| )motion.language=([^;]+)"));match&&mxLanguages.includes(match[2])&&(mxLanguage=match[2]);var mxBasePath="assets/plugins/mxgraph",mxClient={VERSION:"2.0.0.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/"),IS_OT:navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0,IS_GC:0<=navigator.userAgent.indexOf("Chrome/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/"),NO_FO:0<=navigator.userAgent.indexOf("Firefox/1.")||0<=navigator.userAgent.indexOf("Iceweasel/1.")||0<=navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/1.")||0<=navigator.userAgent.indexOf("Camino/1.")||0<=navigator.userAgent.indexOf("Epiphany/2.")||0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Mozilla/2."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_MAC:0<navigator.userAgent.toUpperCase().indexOf("MACINTOSH"),IS_TOUCH:0<navigator.userAgent.toUpperCase().indexOf("IPAD")||0<navigator.userAgent.toUpperCase().indexOf("IPOD")||0<navigator.userAgent.toUpperCase().indexOf("IPHONE")||0<navigator.userAgent.toUpperCase().indexOf("ANDROID"),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(e,n,t){if(t=t||document,mxClient.IS_IE6)t.write('<link rel="'+e+'" href="'+n+'" charset="ISO-8859-1" type="text/css"/>');else{var a=t.createElement("link");a.setAttribute("rel",e),a.setAttribute("href",n),a.setAttribute("charset","ISO-8859-1"),a.setAttribute("type","text/css"),t.getElementsByTagName("head")[0].appendChild(a)}},include:function(e){document.write('<script src="'+e+'"><\/script>')},dispose:function(){for(var e=0;e<mxEvent.objects.length;e++)null!=mxEvent.objects[e].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[e])}};if(mxClient.IS_OP&&mxClient.IS_OT?mxClient.CSS_PREFIX="O":mxClient.IS_SF||mxClient.IS_GC?mxClient.CSS_PREFIX="Webkit":mxClient.IS_MT?mxClient.CSS_PREFIX="Moz":mxClient.IS_IE&&9<=document.documentMode&&(mxClient.CSS_PREFIX="ms"),void 0===mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),void 0!==mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",mxClient.language=void 0!==mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),void 0!==mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_IE){if(9<=document.documentMode)mxClient.IS_VML=!1,mxClient.IS_SVG=!0;else{8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"));var ss=document.createStyleSheet();ss.cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}window.attachEvent("onunload",mxClient.dispose)}var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var e=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,n=document.createElement("table");n.setAttribute("width","100%"),n.setAttribute("height","100%");var t=document.createElement("tbody"),a=document.createElement("tr"),i=document.createElement("td");if(i.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",i.appendChild(mxLog.textarea),a.appendChild(i),t.appendChild(a),a=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),a.appendChild(mxLog.td),t.appendChild(a),n.appendChild(t),mxLog.addButton("Info",function(e){mxLog.info()}),mxLog.addButton("DOM",function(e){e=mxUtils.getInnerHtml(document.body),mxLog.debug(e)}),mxLog.addButton("Trace",function(e){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(e){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Show",function(e){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Clear",function(e){mxLog.textarea.value=""}),a=t=0,a="number"==typeof window.innerWidth?(t=window.innerHeight,window.innerWidth):(t=document.documentElement.clientHeight||document.body.clientHeight,document.body.clientWidth),mxLog.window=new mxWindow(e,n,Math.max(0,a-320),Math.max(0,t-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode){var s=mxLog.window.getElement();e=function(e,n){mxLog.textarea.style.height=Math.max(0,s.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,e),mxLog.window.addListener(mxEvent.MAXIMIZE,e),mxLog.window.addListener(mxEvent.NORMALIZE,e),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(e,n){var t=document.createElement("button");mxUtils.write(t,e),mxEvent.addListener(t,"click",n),mxLog.td.appendChild(t)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(e){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(e)},enter:function(e){if(mxLog.TRACE)return mxLog.writeln("Entering "+e),(new Date).getTime()},leave:function(e,n){if(mxLog.TRACE){var t=0!=n?" ("+((new Date).getTime()-n)+" ms)":"";mxLog.writeln("Leaving "+e+t)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var e="",n=0;n<arguments.length;n++)e+=arguments[n],n<arguments.length-1&&(e+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=e,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=e},writeln:function(){for(var e="",n=0;n<arguments.length;n++)e+=arguments[n],n<arguments.length-1&&(e+=" ");mxLog.write(e+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(e){if("object"==typeof e&&null==e[mxObjectIdentity.FIELD_NAME]){var n=mxUtils.getFunctionName(e.constructor);e[mxObjectIdentity.FIELD_NAME]=n+"#"+mxObjectIdentity.counter++}return e[mxObjectIdentity.FIELD_NAME]},clear:function(e){"object"==typeof e&&delete e[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(e){return e=mxObjectIdentity.get(e),this.map[e]},mxDictionary.prototype.put=function(e,n){var t=mxObjectIdentity.get(e),a=this.map[t];return this.map[t]=n,a},mxDictionary.prototype.remove=function(e){e=mxObjectIdentity.get(e);var n=this.map[e];return delete this.map[e],n},mxDictionary.prototype.getKeys=function(){var e,n=[];for(e in this.map)n.push(e);return n},mxDictionary.prototype.getValues=function(){var e,n=[];for(e in this.map)n.push(this.map[e]);return n},mxDictionary.prototype.visit=function(e){for(var n in this.map)e(n,this.map[n])};var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(e){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,e)},getDefaultBundle:function(e,n){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(n)?e+mxResources.extension:null},getSpecialBundle:function(e,n){if(null==mxClient.languages||!this.isLanguageSupported(n)){var t=n.indexOf("-");0<t&&(n=n.substring(0,t))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(n)&&n!=mxClient.defaultLanguage?e+"_"+n+mxResources.extension:null},add:function(e,n){if((n=null!=n?n:mxClient.language)!=mxConstants.NONE){var t=mxResources.getDefaultBundle(e,n);if(null!=t)try{var a=mxUtils.load(t);a.isReady()&&mxResources.parse(a.getText())}catch(e){}if(null!=(t=mxResources.getSpecialBundle(e,n)))try{(a=mxUtils.load(t)).isReady()&&mxResources.parse(a.getText())}catch(e){}}},parse:function(e){if(null!=e){e=e.split("\n");for(var n=0;n<e.length;n++)if("#"!=e[n].charAt(0)){var t=e[n].indexOf("=");if(0<t){var a=e[n].substring(0,t),i=e[n].length;13==e[n].charCodeAt(i-1)&&i--,t=e[n].substring(t+1,i),this.resourcesEncoded?(t=t.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[a]=unescape(t)):mxResources.resources[a]=t}}}},get:function(e,n,t){if(null==(e=mxResources.resources[e])&&(e=t),null!=e&&null!=n){t=[];for(var a=null,i=0;i<e.length;i++){var s=e.charAt(i);"{"==s?a="":null!=a&&"}"==s?(0<=(a=parseInt(a)-1)&&a<n.length&&t.push(n[a]),a=null):null!=a?a+=s:t.push(s)}e=t.join("")}return e}};function mxPoint(e,n){this.x=null!=e?e:0,this.y=null!=n?n:0}function mxRectangle(e,n,t,a){mxPoint.call(this,e,n),this.width=null!=t?t:0,this.height=null!=a?a:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(e){return e.x==this.x&&e.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(e,n,t,a){this.x=e,this.y=n,this.width=t,this.height=a},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(e){if(null!=e){var n=Math.min(this.x,e.x),t=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width);e=Math.max(this.y+this.height,e.y+e.height),this.x=n,this.y=t,this.width=a-n,this.height=e-t}},mxRectangle.prototype.grow=function(e){this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.equals=function(e){return e.x==this.x&&e.y==this.y&&e.width==this.width&&e.height==this.height};var mxEffects={animateChanges:function(l,d,c){var m=0,u=function(){for(var e=!1,n=0;n<d.length;n++){var t=d[n];if(t instanceof mxGeometryChange||t instanceof mxTerminalChange||t instanceof mxValueChange||t instanceof mxChildChange||t instanceof mxStyleChange){var a=l.getView().getState(t.cell||t.child,!1);if(null!=a)if(e=!0,t.constructor!=mxGeometryChange||l.model.isEdge(t.cell))mxUtils.setOpacity(a.shape.node,100*m/10);else{var i=l.getView().scale,s=(t.geometry.x-t.previous.x)*i,o=(t.geometry.y-t.previous.y)*i,r=(t.geometry.width-t.previous.width)*i;i=(t.geometry.height-t.previous.height)*i;0==m?(a.x-=s,a.y-=o,a.width-=r,a.height-=i):(a.x+=s/10,a.y+=o/10,a.width+=r/10,a.height+=i/10),l.cellRenderer.redraw(a),mxEffects.cascadeOpacity(l,t.cell,100*m/10)}}}m<10&&e?(m++,window.setTimeout(u,p)):null!=c&&c()},p=30;u()},cascadeOpacity:function(e,n,t){for(var a=e.model.getChildCount(n),i=0;i<a;i++){var s=e.model.getChildAt(n,i),o=e.getView().getState(s);null!=o&&(mxUtils.setOpacity(o.shape.node,t),mxEffects.cascadeOpacity(e,s,t))}if(null!=(n=e.model.getEdges(n)))for(i=0;i<n.length;i++)null!=(a=e.getView().getState(n[i]))&&mxUtils.setOpacity(a.shape.node,t)},fadeOut:function(e,n,t,a,i,s){a=a||40,i=i||30;var o=n||100;if(mxUtils.setOpacity(e,o),s||null==s){var r=function(){o=Math.max(o-a,0),mxUtils.setOpacity(e,o),0<o?window.setTimeout(r,i):(e.style.visibility="hidden",t&&e.parentNode&&e.parentNode.removeChild(e))};window.setTimeout(r,i)}else e.style.visibility="hidden",t&&e.parentNode&&e.parentNode.removeChild(e)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(e){if(null!=e.style&&(e.style.cursor=""),null!=(e=e.childNodes))for(var n=e.length,t=0;t<n;t+=1)mxUtils.removeCursors(e[t])},getCurrentStyle:mxClient.IS_IE?function(e){return null!=e?e.currentStyle:null}:function(e){return null!=e?window.getComputedStyle(e,""):null},hasScrollbars:function(e){return null!=(e=mxUtils.getCurrentStyle(e))&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(e,n){return function(){return n.apply(e,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+a)}else try{b=eval(a)}catch(e){mxLog.warn(e.message+" while evaluating "+a)}return b},findNode:function(e,n,t){var a=e.getAttribute(n);if(null!=a&&a==t)return e;for(e=e.firstChild;null!=e;){if(null!=(a=mxUtils.findNode(e,n,t)))return a;e=e.nextSibling}return null},findNodeByAttribute:9<=document.documentMode?function(e,n,t){var a=null;if(null!=e)if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.getAttribute(n)==t)a=e;else for(e=e.firstChild;null!=e&&null==a;)a=mxUtils.findNodeByAttribute(e,n,t),e=e.nextSibling;return a}:mxClient.IS_IE?function(e,n,t){return null==e?null:e.ownerDocument.selectSingleNode("//*[@"+n+"='"+t+"']")}:function(e,n,t){return null==e?null:e.ownerDocument.evaluate("//*[@"+n+"='"+t+"']",e.ownerDocument,null,XPathResult.ANY_TYPE,null).iterateNext()},getFunctionName:function(e){var n=null;if(null!=e)if(null!=e.name)n=e.name;else{for(e=e.toString(),n=9;" "==e.charAt(n);)n++;var t=e.indexOf("(",n);n=e.substring(n,t)}return n},indexOf:function(e,n){if(null!=e&&null!=n)for(var t=0;t<e.length;t++)if(e[t]==n)return t;return-1},remove:function(e,n){var t=null;if("object"==typeof n)for(var a=mxUtils.indexOf(n,e);0<=a;)n.splice(a,1),t=e,a=mxUtils.indexOf(n,e);for(var i in n)n[i]==e&&(delete n[i],t=e);return t},isNode:function(e,n,t,a){return!(null==e||isNaN(e.nodeType)||null!=n&&e.nodeName.toLowerCase()!=n.toLowerCase())&&(null==t||e.getAttribute(t)==a)},getChildNodes:function(e,n){n=n||mxConstants.NODETYPE_ELEMENT;for(var t=[],a=e.firstChild;null!=a;)a.nodeType==n&&t.push(a),a=a.nextSibling;return t},createXmlDocument:function(){var e=null;return document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLDOM")),e},parseXml:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){var n=mxUtils.createXmlDocument();return n.async="false",n.loadXML(e),n}:function(e){return(new DOMParser).parseFromString(e,"text/xml")},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:void 0,getPrettyXml:function(e,n,t){var a=[];if(null!=e)if(n=n||"  ",t=t||"",e.nodeType==mxConstants.NODETYPE_TEXT)a.push(e.nodeValue);else{a.push(t+"<"+e.nodeName);var i=e.attributes;if(null!=i)for(var s=0;s<i.length;s++){var o=mxUtils.htmlEntities(i[s].nodeValue);a.push(" "+i[s].nodeName+'="'+o+'"')}if(null!=(i=e.firstChild)){for(a.push(">\n");null!=i;)a.push(mxUtils.getPrettyXml(i,n,t+n)),i=i.nextSibling;a.push(t+"</"+e.nodeName+">\n")}else a.push("/>\n")}return a.join("")},removeWhitespace:function(e,n){for(var t=n?e.previousSibling:e.nextSibling;null!=t&&t.nodeType==mxConstants.NODETYPE_TEXT;){var a=n?t.previousSibling:t.nextSibling,i=mxUtils.getTextContent(t);0==mxUtils.trim(i).length&&t.parentNode.removeChild(t),t=a}},htmlEntities:function(e,n){return e=(e=(e=(e=(e=(e||"").replace(/&/g,"&amp;")).replace(/"/g,"&quot;")).replace(/\'/g,"&#39;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),(null==n||n)&&(e=e.replace(/\n/g,"&#xa;")),e},isVml:function(e){return null!=e&&"urn:schemas-microsoft-com:vml"==e.tagUrn},getXml:function(e,n){var t="";return null!=e&&(t=null==(t=e.xml)?e.innerHTML?e.innerHTML:(new XMLSerializer).serializeToString(e):t.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),t.replace(/\n/g,n||"&#xa;")},getTextContent:function(e){var n="";return null!=e&&(null!=e.firstChild&&(e=e.firstChild),n=e.nodeValue||""),n},getInnerHtml:mxClient.IS_IE?function(e){return null!=e?e.innerHTML:""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},getOuterHtml:mxClient.IS_IE?function(e){if(null==e)return"";if(null!=e.outerHTML)return e.outerHTML;var n=[];n.push("<"+e.nodeName);var t=e.attributes;if(null!=t)for(var a=0;a<t.length;a++){var i=t[a].nodeValue;null!=i&&0<i.length&&(n.push(" "),n.push(t[a].nodeName),n.push('="'),n.push(i),n.push('"'))}return 0==e.innerHTML.length?n.push("/>"):(n.push(">"),n.push(e.innerHTML),n.push("</"+e.nodeName+">")),n.join("")}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},write:function(e,n){var t=e.ownerDocument.createTextNode(n);return null!=e&&e.appendChild(t),t},writeln:function(e,n){var t=e.ownerDocument.createTextNode(n);return null!=e&&(e.appendChild(t),e.appendChild(document.createElement("br"))),t},br:function(e,n){n=n||1;for(var t=null,a=0;a<n;a++)null!=e&&(t=e.ownerDocument.createElement("br"),e.appendChild(t));return t},button:function(e,n,t){return t=(t=null!=t?t:document).createElement("button"),mxUtils.write(t,e),mxEvent.addListener(t,"click",function(e){n(e)}),t},para:function(e,n){var t=document.createElement("p");return mxUtils.write(t,n),null!=e&&e.appendChild(t),t},addTransparentBackgroundFilter:function(e){e.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(e,n,t,a,i){return mxUtils.link(e,n,function(){t.execute(a)},i)},linkInvoke:function(e,n,t,a,i,s){return mxUtils.link(e,n,function(){t[a](i)},s)},link:function(e,n,t,a){var i=document.createElement("span");return i.style.color="blue",i.style.textDecoration="underline",i.style.cursor="pointer",null!=a&&(i.style.paddingLeft=a+"px"),mxEvent.addListener(i,"click",t),mxUtils.write(i,n),null!=e&&e.appendChild(i),i},fit:function(e){var n=parseInt(e.offsetLeft),t=parseInt(e.offsetWidth),a=document.body,i=document.documentElement,s=(a.scrollLeft||i.scrollLeft)+(a.clientWidth||i.clientWidth);s<n+t&&(e.style.left=Math.max(a.scrollLeft||i.scrollLeft,s-t)+"px"),n=parseInt(e.offsetTop),t=parseInt(e.offsetHeight),(s=(a.scrollTop||i.scrollTop)+Math.max(a.clientHeight||0,i.clientHeight))<n+t&&(e.style.top=Math.max(a.scrollTop||i.scrollTop,s-t)+"px")},open:function(e){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return mxUtils.alert("Permission to read file denied."),""}var n=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);return n.initWithPath(e),n.exists()?((e=Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream)).init(n,1,4,null),(n=Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream)).init(e),n.read(n.available())):(mxUtils.alert("File not found."),"")}return e=(n=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(e,1)).readAll(),n.close(),e},save:function(e,n){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return void mxUtils.alert("Permission to write file denied.")}var t=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);t.initWithPath(e),t.exists()||t.create(0,420);var a=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);a.init(t,34,4,null),a.write(n,n.length),a.flush(),a.close()}else(t=new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(e,!0)).Write(n),t.Close()},saveAs:function(e){var n=document.createElement("iframe");n.setAttribute("src",""),n.style.visibility="hidden",document.body.appendChild(n);try{if(mxClient.IS_NS){var t=n.contentDocument;t.open(),t.write(e),t.close();try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),n.focus(),saveDocument(t)}catch(e){mxUtils.alert("Permission to save document denied.")}}else(t=n.contentWindow.document).write(e),t.execCommand("SaveAs",!1,document.location)}finally{document.body.removeChild(n)}},copy:function(e){if(window.clipboardData)window.clipboardData.setData("Text",e);else{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var n=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(n){var t=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(t){t.addDataFlavor("text/unicode");var a=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);a.data=e,t.setTransferData("text/unicode",a,2*e.length),n.setData(t,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}},load:function(e){return(e=new mxXmlRequest(e,null,"GET",!1)).send(),e},get:function(e,n,t){return new mxXmlRequest(e,null,"GET").send(n,t)},post:function(e,n,t,a){return new mxXmlRequest(e,n).send(t,a)},submit:function(e,n,t,a){return new mxXmlRequest(e,n).simulate(t,a)},loadInto:function(e,n,t){mxClient.IS_IE?n.onreadystatechange=function(){4==n.readyState&&t()}:n.addEventListener("load",t,!1),n.load(e)},getValue:function(e,n,t){return null==(e=null!=e?e[n]:null)&&(e=t),e},getNumber:function(e,n,t){return null==(e=null!=e?e[n]:null)&&(e=t||0),Number(e)},getColor:function(e,n,t){return null==(e=null!=e?e[n]:null)?e=t:e==mxConstants.NONE&&(e=null),e},clone:function(e,n,t){t=null!=t&&t;var a=null;if(null!=e&&"function"==typeof e.constructor){var i;a=new e.constructor;for(i in e)i!=mxObjectIdentity.FIELD_NAME&&(null==n||mxUtils.indexOf(n,i)<0)&&(a[i]=t||"object"!=typeof e[i]?e[i]:mxUtils.clone(e[i]))}return a},equalPoints:function(e,n){if(null==e&&null!=n||null!=e&&null==n||null!=e&&null!=n&&e.length!=n.length)return!1;if(null!=e&&null!=n)for(var t=0;t<e.length;t++)if(e[t]==n[t]||null!=e[t]&&!e[t].equals(n[t]))return!1;return!0},equalEntries:function(e,n){if(null==e&&null!=n||null!=e&&null==n||null!=e&&null!=n&&e.length!=n.length)return!1;if(null!=e&&null!=n)for(var t in e)if(e[t]!=n[t])return!1;return!0},extend:function(e,n){var t=function(){};t.prototype=n.prototype,e.prototype=new t,e.prototype.constructor=e},toString:function(e){var n,t="";for(n in e)try{if(null==e[n])t+=n+" = [null]\n";else if("function"==typeof e[n])t+=n+" => [Function]\n";else if("object"==typeof e[n])t=t+(n+" => [")+mxUtils.getFunctionName(e[n].constructor)+"]\n";else t+=n+" = "+e[n]+"\n"}catch(e){t+=n+"="+e.message}return t},toRadians:function(e){return Math.PI*e/180},arcToCurves:function(e,n,t,a,i,s,o,r,l){if(r-=e,l-=n,0===t||0===a)return h;t=Math.abs(t),a=Math.abs(a);var d=-r/2,c=-l/2,m=Math.cos(i*Math.PI/180);i=m*d+(h=Math.sin(i*Math.PI/180))*c;d=-1*h*d+m*c;r=m*(c=(s=1<(v=(c=i*i)/(g=t*t)+(p=d*d)/(A=a*a))?(t*=Math.sqrt(v),a*=Math.sqrt(v),0):(v=1,s===o&&(v=-1),v*Math.sqrt((g*A-g*p-A*c)/(g*p+A*c))))*t*d/a)-h*(p=-1*s*a*i/t)+r/2,l=h*c+m*p+l/2,s=0<=(g=Math.atan2((d-p)/a,(i-c)/t)-Math.atan2(0,1))?g:2*Math.PI+g,i=0<=(g=Math.atan2((-d-p)/a,(-i-c)/t)-Math.atan2((d-p)/a,(i-c)/t))?g:2*Math.PI+g,0==o&&0<i?i-=2*Math.PI:0!=o&&i<0&&(i+=2*Math.PI),o=2*i/Math.PI,i/=o=Math.ceil(o<0?-1*o:o),d=8/3*Math.sin(i/4)*Math.sin(i/4)/Math.sin(i/2),c=m*t,m*=a,t*=h,a*=h;for(var u=Math.cos(s),p=-d*(c*(b=Math.sin(s))+a*u),g=-d*(t*b-m*u),v=A=0,h=[],f=0;f<o;++f){s+=i;var b,A=c*(u=Math.cos(s))-a*(b=Math.sin(s))+r,E=(v=t*u+m*b+l,-d*(c*b+a*u));u=-d*(t*b-m*u);h[b=6*f]=Number(p+e),h[b+1]=Number(g+n),h[b+2]=Number(A-E+e),h[b+3]=Number(v-u+n),h[b+4]=Number(A+e),h[b+5]=Number(v+n),p=A+E,g=v+u}return h},getBoundingBox:function(e,n){var t=null;if(null!=e&&null!=n&&0!=n){var a=mxUtils.toRadians(n),i=(t=Math.cos(a),Math.sin(a)),s=new mxPoint(e.x+e.width/2,e.y+e.height/2),o=new mxPoint(e.x,e.y),r=new mxPoint((a=new mxPoint(e.x+e.width,e.y)).x,e.y+e.height),l=new mxPoint(e.x,r.y);o=mxUtils.getRotatedPoint(o,t,i,s),a=mxUtils.getRotatedPoint(a,t,i,s),r=mxUtils.getRotatedPoint(r,t,i,s),l=mxUtils.getRotatedPoint(l,t,i,s);(t=new mxRectangle(o.x,o.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),t.add(new mxRectangle(r.x,r.y,0,0)),t.add(new mxRectangle(l.x,l.y,0,0))}return t},getRotatedPoint:function(e,n,t,a){a=null!=a?a:new mxPoint;var i=e.x-a.x;return new mxPoint(i*n-(e=e.y-a.y)*t+a.x,e*n+i*t+a.y)},getPortConstraints:function(e,n,t,a){return null==(e=mxUtils.getValue(e.style,mxConstants.STYLE_PORT_CONSTRAINT,null))?a:(a=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,0<=a.indexOf(mxConstants.DIRECTION_NORTH)&&(e|=mxConstants.DIRECTION_MASK_NORTH),0<=a.indexOf(mxConstants.DIRECTION_WEST)&&(e|=mxConstants.DIRECTION_MASK_WEST),0<=a.indexOf(mxConstants.DIRECTION_SOUTH)&&(e|=mxConstants.DIRECTION_MASK_SOUTH),0<=a.indexOf(mxConstants.DIRECTION_EAST)&&(e|=mxConstants.DIRECTION_MASK_EAST),e)},reversePortConstraints:function(e){return(e&mxConstants.DIRECTION_MASK_WEST)<<3|(e&mxConstants.DIRECTION_MASK_NORTH)<<1|(e&mxConstants.DIRECTION_MASK_SOUTH)>>1|(e&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(e,n,t){var a=-1;if(0<e.absolutePoints.length)for(var i=e.absolutePoints[0],s=null,o=1;o<e.absolutePoints.length;o++){var r=e.absolutePoints[o];i=mxUtils.ptSegDistSq(i.x,i.y,r.x,r.y,n,t);(null==s||i<s)&&(s=i,a=o-1),i=r}return a},rectangleIntersectsSegment:function(e,n,t){var a=e.y,i=e.x,s=a+e.height,o=i+e.width;e=n.x;var r=t.x;if(n.x>t.x&&(e=t.x,r=n.x),o<r&&(r=o),e<i&&(e=i),r<e)return!1;i=n.y,o=t.y;var l=t.x-n.x;return 1e-7<Math.abs(l)&&(i=(t=(t.y-n.y)/l)*e+(n=n.y-t*n.x),o=t*r+n),o<i&&(n=o,o=i,i=n),s<o&&(o=s),i<a&&(i=a),!(o<i)},contains:function(e,n,t){return e.x<=n&&e.x+e.width>=n&&e.y<=t&&e.y+e.height>=t},intersects:function(e,n){var t=e.width,a=e.height,i=n.width,s=n.height;if(i<=0||s<=0||t<=0||a<=0)return!1;var o=e.x,r=e.y,l=n.x,d=n.y;s+=d,t+=o,a+=r;return((i=i+l)<l||o<i)&&(s<d||r<s)&&(t<o||l<t)&&(a<r||d<a)},intersectsHotspot:function(e,n,t,a,i,s){if(i=null!=i?i:0,s=null!=s?s:0,0<(a=null!=a?a:1)){var o=e.getCenterX(),r=e.getCenterY(),l=e.width,d=e.height,c=mxUtils.getValue(e.style,mxConstants.STYLE_STARTSIZE)*e.view.scale;return 0<c&&(mxUtils.getValue(e.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=e.y+c/2,d=c):(o=e.x+c/2,l=c)),l=Math.max(i,l*a),d=Math.max(i,d*a),0<s&&(l=Math.min(l,s),d=Math.min(d,s)),a=new mxRectangle(o-l/2,r-d/2,l,d),0!=(o=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(-o),s=Math.sin(-o),o=new mxPoint(e.getCenterX(),e.getCenterY()),n=(e=mxUtils.getRotatedPoint(new mxPoint(n,t),i,s,o)).x,t=e.y),mxUtils.contains(a,n,t)}return!0},getOffset:function(e,n){var t=0,a=0;if(null!=n&&n){var i=document.body,s=document.documentElement;t=t+(i.scrollLeft||s.scrollLeft),a=a+(i.scrollTop||s.scrollTop)}for(;e.offsetParent;)t+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;return new mxPoint(t,a)},getScrollOrigin:function(e){for(var n=document.body,t=document.documentElement,a=new mxPoint(n.scrollLeft||t.scrollLeft,n.scrollTop||t.scrollTop);null!=e&&e!=n&&e!=t;)!isNaN(e.scrollLeft)&&!isNaN(e.scrollTop)&&(a.x+=e.scrollLeft,a.y+=e.scrollTop),e=e.parentNode;return a},convertPoint:function(e,n,t){var a=mxUtils.getScrollOrigin(e);return(e=mxUtils.getOffset(e)).x-=a.x,e.y-=a.y,new mxPoint(n-e.x,t-e.y)},ltrim:function(e,n){return e.replace(RegExp("^["+(n||"\\s")+"]+","g"),"")},rtrim:function(e,n){return e.replace(RegExp("["+(n||"\\s")+"]+$","g"),"")},trim:function(e,n){return mxUtils.ltrim(mxUtils.rtrim(e,n),n)},isNumeric:function(e){return null!=e&&(null==e.length||0<e.length&&e.indexOf("0x")<0&&e.indexOf("0X")<0)&&!isNaN(e)},mod:function(e,n){return(e%n+n)%n},intersection:function(e,n,t,a,i,s,o,r){var l=(r-s)*(t-e)-(o-i)*(a-n);return o=((o-i)*(n-s)-(r-s)*(e-i))/l,i=((t-e)*(n-s)-(a-n)*(e-i))/l,0<=o&&o<=1&&0<=i&&i<=1?new mxPoint(e+o*(t-e),n+o*(a-n)):null},ptSegDistSq:function(e,n,t,a,i,s){return t=(i-=e)*(t-=e)+(s-=n)*(a-=n)<=0?0:(e=(i=t-i)*t+(s=a-s)*a)<=0?0:e*e/(t*t+a*a),(i=i*i+s*s-t)<0&&(i=0),i},relativeCcw:function(e,n,t,a,i,s){return 0==(e=(i-=e)*(a-=n)-(s-=n)*(t-=e))&&(0<(e=i*t+s*a)&&((e=(i-t)*t+(s-a)*a)<0&&(e=0))),e<0?-1:0<e?1:0},animateChanges:function(e,n){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(e,n,t){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(e,n,t,a,i,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(e,n){mxUtils.isVml(e)?e.style.filter=100<=n?null:"alpha(opacity="+n/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?e.style.filter=100<=n?null:"alpha(opacity="+n+")":e.style.opacity=n/100},createImage:function(e){var n=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((n=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",e),n.style.borderStyle="none"):((n=document.createElement("img")).setAttribute("src",e),n.setAttribute("border","0")),n},sortCells:function(e,i){i=null==i||i;var s=new mxDictionary;return e.sort(function(e,n){var t=s.get(e);null==t&&(t=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),s.put(e,t));var a=s.get(n);return null==a&&(a=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),s.put(n,a)),0==(t=mxCellPath.compare(t,a))?0:0<t==i?1:-1}),e},getStylename:function(e){return null!=e&&(e=e.split(";")[0]).indexOf("=")<0?e:""},getStylenames:function(e){var n=[];if(null!=e){e=e.split(";");for(var t=0;t<e.length;t++)e[t].indexOf("=")<0&&n.push(e[t])}return n},indexOfStylename:function(e,n){if(null!=e&&null!=n)for(var t=e.split(";"),a=0,i=0;i<t.length;i++){if(t[i]==n)return a;a+=t[i].length+1}return-1},addStylename:function(e,n){return mxUtils.indexOfStylename(e,n)<0&&(null==e?e="":0<e.length&&";"!=e.charAt(e.length-1)&&(e+=";"),e+=n),e},removeStylename:function(e,n){var t=[];if(null!=e)for(var a=e.split(";"),i=0;i<a.length;i++)a[i]!=n&&t.push(a[i]);return t.join(";")},removeAllStylenames:function(e){var n=[];if(null!=e){e=e.split(";");for(var t=0;t<e.length;t++)0<=e[t].indexOf("=")&&n.push(e[t])}return n.join(";")},setCellStyles:function(e,n,t,a){if(null!=n&&0<n.length){e.beginUpdate();try{for(var i=0;i<n.length;i++)if(null!=n[i]){var s=mxUtils.setStyle(e.getStyle(n[i]),t,a);e.setStyle(n[i],s)}}finally{e.endUpdate()}}},setStyle:function(e,n,t){var a=null!=t&&(void 0===t.length||0<t.length);if(null==e||0==e.length)a&&(e=n+"="+t);else{var i=e.indexOf(n+"=");i<0?a&&(a=";"==e.charAt(e.length-1)?"":";",e=e+a+n+"="+t):(n=a?n+"="+t:"",t=e.indexOf(";",i),a||t++,e=e.substring(0,i)+n+(i<t?e.substring(t):""))}return e},setCellStyleFlags:function(e,n,t,a,i){if(null!=n&&0<n.length){e.beginUpdate();try{for(var s=0;s<n.length;s++)if(null!=n[s]){var o=mxUtils.setStyleFlag(e.getStyle(n[s]),t,a,i);e.setStyle(n[s],o)}}finally{e.endUpdate()}}},setStyleFlag:function(e,n,t,a){if(null==e||0==e.length)e=a||null==a?n+"="+t:n+"=0";else{var i=e.indexOf(n+"=");if(i<0)i=";"==e.charAt(e.length-1)?"":";",e=a||null==a?e+i+n+"="+t:e+i+n+"=0";else{var s=e.indexOf(";",i),o="";o=s<0?e.substring(i+n.length+1):e.substring(i+n.length+1,s),o=null==a?parseInt(o)^t:a?parseInt(o)|t:parseInt(o)&~t;e=e.substring(0,i)+n+"="+o+(0<=s?e.substring(s):"")}}return e},getAlignmentAsPoint:function(e,n){var t=0,a=0;return e==mxConstants.ALIGN_CENTER?t=-.5:e==mxConstants.ALIGN_RIGHT&&(t=-1),n==mxConstants.ALIGN_MIDDLE?a=-.5:n==mxConstants.ALIGN_BOTTOM&&(a=-1),new mxPoint(t,a)},getSizeForString:function(e,n,t){n=null!=n?n:mxConstants.DEFAULT_FONTSIZE,t=null!=t?t:mxConstants.DEFAULT_FONTFAMILY;var a=document.createElement("div");return a.style.fontFamily=t,a.style.fontSize=Math.round(n)+"px",a.style.lineHeight=Math.round(n*mxConstants.LINE_HEIGHT)+"px",a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,document.body.appendChild(a),e=new mxRectangle(0,0,a.offsetWidth,a.offsetHeight),document.body.removeChild(a),e},getViewXml:function(e,n,t,a,i){a=null!=a?a:0,i=null!=i?i:0,n=null!=n?n:1,null==t&&(t=[e.getModel().getRoot()]);var s=e.getView(),o=null,r=s.isEventsEnabled();s.setEventsEnabled(!1);var l=s.drawPane,d=s.overlayPane;e.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1)),s.canvas.appendChild(s.overlayPane);var c=s.getTranslate();s.translate=new mxPoint(a,i),n=new mxTemporaryCellStates(e.getView(),n,t);try{o=(new mxCodec).encode(e.getView())}finally{n.destroy(),s.translate=c,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=l,s.overlayPane=d,s.setEventsEnabled(r)}return o},getScaleForPageCount:function(e,n,t,a){if(e<1)return 1;a=null!=a?a:0;var i=(t=null!=t?t:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*a;t=t.height-2*a,a=n.getGraphBounds().clone(),n=n.getView().getScale(),a.width/=n,a.height/=n,t=(n=a.width)/a.height/(i/t),a=Math.sqrt(e);var s=Math.sqrt(t);if(t=a*s,a/=s,t<1&&e<a){var o=a/e;a=e,t/=o}for(a<1&&e<t&&(o=t/e,t=e,a/=o),o=Math.ceil(t)*Math.ceil(a),s=0;e<o;){o=Math.floor(t)/t;var r=Math.floor(a)/a;if(1==o&&(o=Math.floor(t-1)/t),1==r&&(r=Math.floor(a-1)/a),t*=o=r<o?o:r,a*=o,o=Math.ceil(t)*Math.ceil(a),10<++s)break}return i*t/n*.99999},show:function(e,n,t,a){if(t=null!=t?t:0,a=null!=a?a:0,null==n?n=window.open().document:n.open(),t=-(i=e.getGraphBounds()).x+t,a=-i.y+a,mxClient.IS_IE){for(var i="<html><head>",s=document.getElementsByTagName("base"),o=0;o<s.length;o++)i+=s[o].outerHTML;for(i+="<style>",o=0;o<document.styleSheets.length;o++)try{i+=document.styleSheets(o).cssText}catch(e){}i+="</style></head>",i+="<body>",i+=e.container.innerHTML,i+="</body>",i+="<html>",n.writeln(i),n.close(),null!=(e=n.body.getElementsByTagName("DIV")[0])&&(e.style.position="absolute",e.style.left=t+"px",e.style.top=a+"px")}else{for(n.writeln("<html"),n.writeln("<head>"),s=document.getElementsByTagName("base"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("link"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("style"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(n.writeln("</head>"),n.writeln("</html>"),n.close(),null==n.body&&n.documentElement.appendChild(n.createElement("body")),n.body.style.overflow="auto",e=e.container.firstChild;null!=e;)o=e.cloneNode(!0),n.body.appendChild(o),e=e.nextSibling;null!=(e=n.getElementsByTagName("g")[0])&&(e.setAttribute("transform","translate("+t+","+a+")"),(t=e.ownerSVGElement).setAttribute("width",i.width+Math.max(i.x,0)+3),t.setAttribute("height",i.height+Math.max(i.y,0)+3))}return mxUtils.removeCursors(n.body),n},printScreen:function(e){var n=window.open();mxUtils.show(e,n.document),e=function(){n.focus(),n.print(),n.close()},mxClient.IS_GC?n.setTimeout(e,500):e()},popup:function(e,n){if(n){var t=document.createElement("div");t.style.overflow="scroll",t.style.width="636px",t.style.height="460px";var a=document.createElement("pre");a.innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),t.appendChild(a),(t=new mxWindow("Popup Window",t,document.body.clientWidth/2-320,(document.body.clientHeight||document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),t.setVisible(!0)}else mxClient.IS_NS?((t=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(e)+"</pre"),t.document.close()):((a=(t=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),t.document.body.appendChild(a))},alert:function(e){alert(e)},prompt:function(e,n){return prompt(e,n)},confirm:function(e){return confirm(e)},error:function(e,n,t,a){var i=document.createElement("div");i.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",a||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",i.appendChild(s),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),mxUtils.write(i,e),e=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight;var o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,i,(e-n)/2,a/4,n,null,!1,!0);return t&&(mxUtils.br(i),n=document.createElement("p"),t=document.createElement("button"),mxClient.IS_IE?t.style.cssText="float:right":t.setAttribute("style","float:right"),mxEvent.addListener(t,"click",function(e){o.destroy()}),mxUtils.write(t,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),n.appendChild(t),i.appendChild(n),mxUtils.br(i),o.setClosable(!0)),o.setVisible(!0),o},makeDraggable:function(e,n,t,i,a,s,o,r,l,d){return(e=new mxDragSource(e,t)).dragOffset=new mxPoint(null!=a?a:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),e.autoscroll=o,e.setGuidesEnabled(!1),null!=l&&(e.highlightDropTargets=l),null!=d&&(e.getDropTarget=d),e.getGraphForEvent=function(e){return"function"==typeof n?n(e):n},null!=i&&(e.createDragElement=function(){return i.cloneNode(!0)},r&&(e.createPreviewElement=function(e){var n=i.cloneNode(!0),t=parseInt(n.style.width),a=parseInt(n.style.height);return n.style.width=Math.round(t*e.view.scale)+"px",n.style.height=Math.round(a*e.view.scale)+"px",n})),e}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",HIGHLIGHT_STROKEWIDTH:3,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_BEND_HANDLE:"pointer",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:7,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,LINE_HEIGHT:1.2,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:10,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_OPACITY:"opacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_LOOP:"loopStyle",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_SHADOW:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_BLOCK:"block",ARROW_OPEN:"open",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(e){this.name=e,this.properties=[];for(var n=1;n<arguments.length;n+=2)null!=arguments[n+1]&&(this.properties[arguments[n]]=arguments[n+1])}function mxMouseEvent(e,n){this.evt=e,this.state=n}function mxEventSource(e){this.setEventSource(e)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(e){return this.properties[e]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(e){if(null!=e)for(var n=this.getSource();null!=n;){if(n==e.node)return!0;n=n.parentNode}return!1},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var e=this.getState();return null!=e?e.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(e){(null==e||e)&&this.evt.preventDefault&&this.evt.preventDefault(),this.evt.returnValue=!1,this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(e){this.eventsEnabled=e},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(e){this.eventSource=e},mxEventSource.prototype.addListener=function(e,n){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(e),this.eventListeners.push(n)},mxEventSource.prototype.removeListener=function(e){if(null!=this.eventListeners)for(var n=0;n<this.eventListeners.length;)this.eventListeners[n+1]==e?this.eventListeners.splice(n,2):n+=2},mxEventSource.prototype.fireEvent=function(e,n){if(null!=this.eventListeners&&this.isEventsEnabled()){null==e&&(e=new mxEventObject),null==n&&(n=this.getEventSource()),null==n&&(n=this);for(var t=[n,e],a=0;a<this.eventListeners.length;a+=2){var i=this.eventListeners[a];(null==i||i==e.getName())&&this.eventListeners[a+1].apply(this,t)}}};var mxEvent={objects:[],addListener:function(){var a=function(e,n,t){null==e.mxListenerList&&(e.mxListenerList=[],mxEvent.objects.push(e)),e.mxListenerList.push({name:n,f:t})};return window.addEventListener?function(e,n,t){e.addEventListener(n,t,!1),a(e,n,t)}:function(e,n,t){e.attachEvent("on"+n,t),a(e,n,t)}}(),removeListener:function(){var a=function(e,n,t){if(null!=e.mxListenerList){n=e.mxListenerList.length;for(var a=0;a<n;a++)if(e.mxListenerList[a].f==t){e.mxListenerList.splice(a,1);break}0==e.mxListenerList.length&&(e.mxListenerList=null)}};return window.removeEventListener?function(e,n,t){e.removeEventListener(n,t,!1),a(e,n,t)}:function(e,n,t){e.detachEvent("on"+n,t),a(e,n,t)}}(),removeAllListeners:function(e){var n=e.mxListenerList;if(null!=n)for(;0<n.length;){var t=n[0];mxEvent.removeListener(e,t.name,t.f)}},addGestureListeners:function(e,n,t,a){null!=n&&mxEvent.addListener(e,"mousedown",n),null!=t&&mxEvent.addListener(e,"mousemove",t),null!=a&&mxEvent.addListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=n&&mxEvent.addListener(e,"touchstart",n),null!=t&&mxEvent.addListener(e,"touchmove",t),null!=a&&mxEvent.addListener(e,"touchend",a))},removeGestureListeners:function(e,n,t,a){null!=n&&mxEvent.removeListener(e,"mousedown",n),null!=t&&mxEvent.removeListener(e,"mousemove",t),null!=a&&mxEvent.removeListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=n&&mxEvent.removeListener(e,"touchstart",n),null!=t&&mxEvent.removeListener(e,"touchmove",t),null!=a&&mxEvent.removeListener(e,"touchend",a))},redirectMouseEvents:function(e,t,n,a,i,s,o){var r=function(e){return"function"==typeof n?n(e):n};mxEvent.addGestureListeners(e,function(e){null!=a?a(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,r(e)))},function(e){null!=i?i(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))},function(e){null!=s?s(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e)))}),mxEvent.addListener(e,"dblclick",function(e){if(null!=o)o(e);else if(!mxEvent.isConsumed(e)){var n=r(e);t.dblClick(e,null!=n?n.cell:null)}})},release:function(e){if(null!=e&&(mxEvent.removeAllListeners(e),null!=(e=e.childNodes)))for(var n=e.length,t=0;t<n;t+=1)mxEvent.release(e[t])},addMouseWheelListener:function(t){if(null!=t){var e=function(e){null==e&&(e=window.event);var n=0;0!=(n=!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC?e.wheelDelta/120:-e.detail/2)&&t(e,0<n)};mxClient.IS_NS?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",e):mxEvent.addListener(document,"mousewheel",e)}},disableContextMenu:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){mxEvent.addListener(e,"contextmenu",function(){return!1})}:function(e){e.setAttribute("oncontextmenu","return false;")},getSource:function(e){return null!=e.srcElement?e.srcElement:e.target},isConsumed:function(e){return null!=e.isConsumed&&e.isConsumed},isLeftMouseButton:function(e){return e.button==(mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?1:0)},isRightMouseButton:function(e){return 2==e.button},isPopupTrigger:function(e){return mxEvent.isRightMouseButton(e)||mxEvent.isShiftDown(e)&&!mxEvent.isControlDown(e)},isShiftDown:function(e){return null!=e&&e.shiftKey},isAltDown:function(e){return null!=e&&e.altKey},isControlDown:function(e){return null!=e&&e.ctrlKey},isMetaDown:function(e){return null!=e&&e.metaKey},getMainEvent:function(e){return"touchstart"!=e.type&&"touchmove"!=e.type||null==e.touches||null==e.touches[0]?"touchend"==e.type&&null!=e.changedTouches&&null!=e.changedTouches[0]&&(e=e.changedTouches[0]):e=e.touches[0],e},getClientX:function(e){return mxEvent.getMainEvent(e).clientX},getClientY:function(e){return mxEvent.getMainEvent(e).clientY},consume:function(e,n,t){t=null==t||t,(null==n||n)&&(e.preventDefault?(t&&e.stopPropagation(),e.preventDefault()):t&&(e.cancelBubble=!0)),e.isConsumed=!0,e.returnValue=!1},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",SESSION:"session",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(e,n,t,a,i,s){this.url=e,this.params=n,this.method=t||"POST",this.async=null==a||a,this.username=i,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(e){this.binary=e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var e=this.getXml();return null!=e?e.documentElement:null},mxXmlRequest.prototype.getXml=function(){var e=this.request.responseXML;return(9<=document.documentMode||null==e||null==e.documentElement)&&(e=mxUtils.parseXml(this.request.responseText)),e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var e=new XMLHttpRequest;return this.isBinary()&&e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined"),e}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(e,n){this.request=this.create(),null!=this.request&&(null!=e&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(e(this),this.onreadystatechaange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(e,n){null!=n&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(e,n){var t=null;(e=e||document)==document&&(t=window.onbeforeunload,window.onbeforeunload=null);var a=e.createElement("form");a.setAttribute("method",this.method),a.setAttribute("action",this.url),null!=n&&a.setAttribute("target",n),a.style.display="none",a.style.visibility="hidden";for(var i=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),s=0;s<i.length;s++){if(0<(o=i[s].indexOf("="))){var o,r=i[s].substring(0,o),l=i[s].substring(o+1);(o=e.createElement("textarea")).setAttribute("name",r),l=l.replace(/\n/g,"&#xa;"),r=e.createTextNode(l),o.appendChild(r),a.appendChild(o)}}e.body.appendChild(a),a.submit(),e.body.removeChild(a),null!=t&&(window.onbeforeunload=t)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,isEmpty:function(){return null==mxClipboard.cells},cut:function(e,n){return n=mxClipboard.copy(e,n),mxClipboard.insertCount=0,mxClipboard.removeCells(e,n),n},removeCells:function(e,n){e.removeCells(n)},copy:function(e,n){n=n||e.getSelectionCells();var t=e.getExportableCells(n);return mxClipboard.insertCount=1,mxClipboard.cells=e.cloneCells(t),t},paste:function(e){if(null!=mxClipboard.cells){var n=e.getImportableCells(mxClipboard.cells),t=mxClipboard.insertCount*mxClipboard.STEPSIZE,a=e.getDefaultParent();n=e.importCells(n,t,t,a);mxClipboard.insertCount++,e.setSelectionCells(n)}}};function mxWindow(e,n,t,a,i,s,o,r,l,d){null!=n&&(o=null==o||o,this.content=n,this.init(t,a,i,s,d),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(e),(null==r||r)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}function mxForm(e){this.table=document.createElement("table"),this.table.className=e,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(e,n,t){this.src=e,this.width=n,this.height=t}function mxDivResizer(e,n){if("div"==e.nodeName.toLowerCase()){null==n&&(n=window),this.div=e;var t=mxUtils.getCurrentStyle(e);null!=t&&(this.resizeWidth="auto"==t.width,this.resizeHeight="auto"==t.height),mxEvent.addListener(n,"resize",mxUtils.bind(this,function(e){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(e,n){this.element=e,this.dropHandler=n,mxEvent.addGestureListeners(e,mxUtils.bind(this,this.mouseDown))}function mxToolbar(e){this.container=e}function mxSession(n,e,t,a){this.model=n,this.urlInit=e,this.urlPoll=t,this.urlNotify=a,null!=n&&(this.codec=new mxCodec,this.codec.lookup=function(e){return n.getCell(e)}),n.addListener(mxEvent.NOTIFY,mxUtils.bind(this,function(e,n){var t=n.getProperty("edit");(null!=t&&this.debug||this.connected&&!this.suspended)&&this.notify("<edit>"+this.encodeChanges(t.changes,t.undone)+"</edit>")}))}function mxUndoableEdit(e,n){this.source=e,this.changes=[],this.significant=null==n||n}function mxUndoManager(e){this.size=null!=e?e:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.content=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.title=!1,mxWindow.prototype.content=!1,mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.init=function(e,n,t,a,i){i=null!=i?i:"mxWindow",this.div=document.createElement("div"),this.div.className=i,this.div.style.left=e+"px",this.div.style.top=n+"px",this.table=document.createElement("table"),this.table.className=i,null!=t&&(mxClient.IS_IE||(this.div.style.width=t+"px"),this.table.style.width=t+"px"),null!=a&&(mxClient.IS_IE||(this.div.style.height=a+"px"),this.table.style.height=a+"px"),e=document.createElement("tbody"),n=document.createElement("tr"),this.title=document.createElement("td"),this.title.className=i+"Title",n.appendChild(this.title),e.appendChild(n),n=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=i+"Pane",this.contentWrapper=document.createElement("div"),this.contentWrapper.className=i+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_IE||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),n.appendChild(this.td),e.appendChild(n),this.table.appendChild(e),this.div.appendChild(this.table),i=mxUtils.bind(this,function(e){this.activate()}),mxEvent.addListener(this.title,"mousedown",i),mxEvent.addListener(this.table,"mousedown",i),mxClient.IS_TOUCH&&(mxEvent.addListener(this.title,"touchstart",i),mxEvent.addListener(this.table,"touchstart",i)),this.hide()},mxWindow.prototype.setTitle=function(e){for(var n=this.title.firstChild;null!=n;){var t=n.nextSibling;n.nodeType==mxConstants.NODETYPE_TEXT&&n.parentNode.removeChild(n),n=t}mxUtils.write(this.title,e||"")},mxWindow.prototype.setScrollable=function(e){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=e?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var e=null!=(e=mxUtils.getCurrentStyle(this.getElement()))?e.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}n=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(e){e?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif"),this.resize.style.cursor="nw-resize",mxEvent.addGestureListeners(this.resize,mxUtils.bind(this,function(e){this.activate();var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.div.offsetWidth,o=this.div.offsetHeight,n=mxUtils.bind(this,function(e){var n=mxEvent.getClientX(e)-a,t=mxEvent.getClientY(e)-i;this.setSize(s+n,o+t),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",e)),mxEvent.consume(e)}),t=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",e)),mxEvent.consume(e)}),null,null),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(e,n){e=Math.max(this.minimumSize.width,e),n=Math.max(this.minimumSize.height,n),mxClient.IS_IE||(this.div.style.width=e+"px",this.div.style.height=n+"px"),this.table.style.width=e+"px",this.table.style.height=n+"px",mxClient.IS_IE||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")},mxWindow.prototype.setMinimizable=function(e){this.minimize.style.display=e?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("align","right"),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginRight="1px",this.minimize.style.display="none",this.title.appendChild(this.minimize);var t=!1,a=null,i=null,e=mxUtils.bind(this,function(e){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=a,mxClient.IS_IE||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",a=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var n=this.getMinimumSize();0<n.height&&(mxClient.IS_IE||(this.div.style.height=n.height+"px"),this.table.style.height=n.height+"px"),0<n.width&&(mxClient.IS_IE||(this.div.style.width=n.width+"px"),this.table.style.width=n.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",e))}mxEvent.consume(e)});mxEvent.addListener(this.minimize,"mousedown",e),mxClient.IS_TOUCH&&mxEvent.addListener(this.minimize,"touchstart",e)},mxWindow.prototype.setMaximizable=function(e){this.maximize.style.display=e?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("align","right"),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="1px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.title.appendChild(this.maximize);var t=!1,a=null,i=null,s=null,o=null,e=mxUtils.bind(this,function(e){if(this.activate(),"none"!=this.maximize.style.display){if(t)t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.visibility="",this.div.style.left=a+"px",this.div.style.top=i+"px",mxClient.IS_IE||(this.div.style.height=s,this.div.style.width=o,"auto"!=(n=mxUtils.getCurrentStyle(this.contentWrapper)).overflow&&null==this.resize)||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.table.style.height=s,this.table.style.width=o,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{if(t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",this.minimize.style.visibility="hidden",a=parseInt(this.div.style.left),i=parseInt(this.div.style.top),s=this.table.style.height,o=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",mxClient.IS_IE||(this.div.style.height=document.body.clientHeight-2+"px",this.div.style.width=document.body.clientWidth-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=document.body.clientHeight-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_IE){var n=mxUtils.getCurrentStyle(this.contentWrapper);"auto"!=n.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",e))}mxEvent.consume(e)}});mxEvent.addGestureListeners(this.maximize,e),mxEvent.addListener(this.title,"dblclick",e)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(e){var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.getX(),o=this.getY(),n=mxUtils.bind(this,function(e){var n=mxEvent.getClientX(e)-a,t=mxEvent.getClientY(e)-i;this.setLocation(s+n,o+t),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",e)),mxEvent.consume(e)}),t=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",e)),mxEvent.consume(e)}))},mxWindow.prototype.setLocation=function(e,n){this.div.style.left=e+"px",this.div.style.top=n+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("align","right"),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.title.insertBefore(this.closeImg,this.title.firstChild),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",e)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(e)}))},mxWindow.prototype.setImage=function(e){this.image=document.createElement("img"),this.image.setAttribute("src",e),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(e){this.closeImg.style.display=e?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"hidden"!=this.div.style.visibility},mxWindow.prototype.setVisible=function(e){null!=this.div&&this.isVisible()!=e&&(e?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.visibility="",this.activate();var e=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_IE||"auto"!=e.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.visibility="hidden",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.contentWrapper=this.content=this.title=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(e,n){var t=document.createElement("tr"),a=document.createElement("td");t.appendChild(a);a=document.createElement("td");var i=document.createElement("button");mxUtils.write(i,mxResources.get("ok")||"OK"),a.appendChild(i),mxEvent.addListener(i,"click",function(){e()}),i=document.createElement("button"),mxUtils.write(i,mxResources.get("cancel")||"Cancel"),a.appendChild(i),mxEvent.addListener(i,"click",function(){n()}),t.appendChild(a),this.body.appendChild(t)},mxForm.prototype.addText=function(e,n){var t=document.createElement("input");return t.setAttribute("type","text"),t.value=n,this.addField(e,t)},mxForm.prototype.addCheckbox=function(e,n){var t=document.createElement("input");return t.setAttribute("type","checkbox"),this.addField(e,t),n&&(t.checked=!0),t},mxForm.prototype.addTextarea=function(e,n,t){var a=document.createElement("textarea");return mxClient.IS_NS&&t--,a.setAttribute("rows",t||2),a.value=n,this.addField(e,a)},mxForm.prototype.addCombo=function(e,n,t){var a=document.createElement("select");return null!=t&&a.setAttribute("size",t),n&&a.setAttribute("multiple","true"),this.addField(e,a)},mxForm.prototype.addOption=function(e,n,t,a){var i=document.createElement("option");mxUtils.writeln(i,n),i.setAttribute("value",t),a&&i.setAttribute("selected",a),e.appendChild(i)},mxForm.prototype.addField=function(e,n){var t=document.createElement("tr"),a=document.createElement("td");return mxUtils.write(a,e),t.appendChild(a),(a=document.createElement("td")).appendChild(n),t.appendChild(a),this.body.appendChild(t),n},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var e=this.getDocumentWidth(),n=this.getDocumentHeight(),t=parseInt(this.div.style.left),a=parseInt(this.div.style.right),i=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(t)&&!isNaN(a)&&0<=t&&0<=a&&0<e-a-t&&(this.div.style.width=e-a-t+"px"),this.resizeHeight&&!isNaN(i)&&!isNaN(s)&&0<=i&&0<=s&&0<n-i-s&&(this.div.style.height=n-i-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(e){this.enabled=e},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(e){this.guidesEnabled=e},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxDragSource.prototype.getGraphForEvent=function(e){return null},mxDragSource.prototype.getDropTarget=function(e,n,t){return e.getCellAt(n,t)},mxDragSource.prototype.createDragElement=function(e){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(e){return null},mxDragSource.prototype.mouseDown=function(e){this.enabled&&!mxEvent.isConsumed(e)&&null==this.mouseMoveHandler&&(this.startDrag(e),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxEvent.consume(e,!0,!1))},mxDragSource.prototype.startDrag=function(e){this.dragElement=this.createDragElement(e),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity)},mxDragSource.prototype.stopDrag=function(e){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.graphContainsEvent=function(e,n){var t=mxEvent.getClientX(n),a=mxEvent.getClientY(n),i=mxUtils.getOffset(e.container),s=mxUtils.getScrollOrigin();return t>=i.x-s.x&&a>=i.y-s.y&&t<=i.x-s.x+e.container.offsetWidth&&a<=i.y-s.y+e.container.offsetHeight},mxDragSource.prototype.mouseMove=function(e){if(null!=(n=this.getGraphForEvent(e))&&!this.graphContainsEvent(n,e)&&(n=null),n!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph),this.currentGraph=n,null!=this.currentGraph&&this.dragEnter(this.currentGraph)),null!=this.currentGraph&&this.dragOver(this.currentGraph,e),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(e),t=mxEvent.getClientY(e);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,t+=this.dragOffset.y),n+=document.body.scrollLeft||document.documentElement.scrollLeft,t+=document.body.scrollTop||document.documentElement.scrollTop,this.dragElement.style.left=n+"px",this.dragElement.style.top=t+"px"}mxEvent.consume(e)},mxDragSource.prototype.mouseUp=function(e){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var n=this.currentGraph.view.scale,t=this.currentGraph.view.translate;this.drop(this.currentGraph,e,this.currentDropTarget,this.currentPoint.x/n-t.x,this.currentPoint.y/n-t.y)}this.dragExit(this.currentGraph)}this.stopDrag(e),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.currentGraph=this.mouseUpHandler=this.mouseMoveHandler=null,mxEvent.consume(e)},mxDragSource.prototype.dragEnter=function(e){e.isMouseDown=!0,this.previewElement=this.createPreviewElement(e),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(e,e.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(e,mxConstants.DROP_TARGET_COLOR))},mxDragSource.prototype.dragExit=function(e){this.currentPoint=this.currentDropTarget=null,e.isMouseDown=!1,null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(e,n){var t=mxUtils.getOffset(e.container),a=mxUtils.getScrollOrigin(e.container),i=mxEvent.getClientX(n)-t.x+a.x;t=mxEvent.getClientY(n)-t.y+a.y;if(e.autoScroll&&(null==this.autoscroll||this.autoscroll)&&e.scrollPointToVisible(i,t,e.autoExtend),null!=this.currentHighlight&&e.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(e,i,t),a=e.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(a)),null!=this.previewElement){null==this.previewElement.parentNode&&(e.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");a=this.isGridEnabled()&&e.isGridEnabledEvent(n);var s=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(n))s=new mxRectangle(0,0,s=parseInt(this.previewElement.style.width),o=parseInt(this.previewElement.style.height)),t=new mxPoint(i,t),t=this.currentGuide.move(s,t,a),s=!1,i=t.x,t=t.y;else if(a){a=e.view.scale;var o=e.view.translate,r=e.gridSize/2;i=(e.snap(i/a-o.x-r)+o.x)*a,t=(e.snap(t/a-o.y-r)+o.y)*a}null!=this.currentGuide&&s&&this.currentGuide.hide(),null!=this.previewOffset&&(i+=this.previewOffset.x,t+=this.previewOffset.y),this.previewElement.style.left=Math.round(i)+"px",this.previewElement.style.top=Math.round(t)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(i,t)},mxDragSource.prototype.drop=function(e,n,t,a,i){this.dropHandler(e,n,t,a,i),e.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(e,n,t,a,i,s){var o=document.createElement(null!=n?"img":"button"),r=i||(null!=s?"mxToolbarMode":"mxToolbarItem");return o.className=r,o.setAttribute("src",n),null!=e&&(null!=n?o.setAttribute("title",e):mxUtils.write(o,e)),this.container.appendChild(o),null!=t&&(mxEvent.addListener(o,"click",t),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",t)),e=mxUtils.bind(this,function(e){null!=a?o.setAttribute("src",n):o.style.backgroundColor=""}),mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){if(null!=a?o.setAttribute("src",a):o.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var n=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu(),n!=o&&(this.currentImg=o,this.menu.factoryMethod=s,n=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight),this.menu.popup(n.x,n.y,null,e),this.menu.isMenuShowing()&&(o.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=r,this.currentImg=null}))}}),null,e),mxEvent.addListener(o,"mouseout",e),o},mxToolbar.prototype.addCombo=function(e){var n=document.createElement("div");n.style.display="inline",n.className="mxToolbarComboContainer";var t=document.createElement("select");return t.className=e||"mxToolbarCombo",n.appendChild(t),this.container.appendChild(n),t},mxToolbar.prototype.addActionCombo=function(e,n){var t=document.createElement("select");return t.className=n||"mxToolbarCombo",this.addOption(t,e,null),mxEvent.addListener(t,"change",function(e){var n=t.options[t.selectedIndex];t.selectedIndex=0,null!=n.funct&&n.funct(e)}),this.container.appendChild(t),t},mxToolbar.prototype.addOption=function(e,n,t){var a=document.createElement("option");return mxUtils.writeln(a,n),"function"==typeof t?a.funct=t:a.setAttribute("value",t),e.appendChild(a),a},mxToolbar.prototype.addSwitchMode=function(e,n,t,a,i){var s=document.createElement("img");return s.initialClassName=i||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",n),s.altIcon=a,null!=e&&s.setAttribute("title",e),mxEvent.addListener(s,"click",mxUtils.bind(this,function(e){null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),null!=(e=(this.selectedMode=s).altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),t()})),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),t()),s},mxToolbar.prototype.addMode=function(e,n,t,a,i,s){s=null==s||s;var o=document.createElement(null!=n?"img":"button");return o.initialClassName=i||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",n),o.altIcon=a,null!=e&&o.setAttribute("title",e),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,function(e){this.selectMode(o,t),this.noReset=!1})),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,function(e){this.selectMode(o,t),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=t,this.selectMode(o,t))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(e,n){if(this.selectedMode!=e){if(null!=this.selectedMode){var t=this.selectedMode.altIcon;null!=t?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",t)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=e,null!=(t=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",t)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",n))}},mxToolbar.prototype.resetMode=function(e){(e||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(e){return this.addItem(null,e,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var e=document.createElement("hr");e.style.marginRight="6px",e.setAttribute("size","1"),this.container.appendChild(e)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null,null!=this.menu&&this.menu.destroy()},mxSession.prototype=new mxEventSource,mxSession.prototype.constructor=mxSession,mxSession.prototype.model=null,mxSession.prototype.urlInit=null,mxSession.prototype.urlPoll=null,mxSession.prototype.urlNotify=null,mxSession.prototype.codec=null,mxSession.prototype.linefeed="&#xa;",mxSession.prototype.escapePostData=!0,mxSession.prototype.significantRemoteChanges=!0,mxSession.prototype.sent=0,mxSession.prototype.received=0,mxSession.prototype.debug=!1,mxSession.prototype.connected=!1,mxSession.prototype.suspended=!1,mxSession.prototype.polling=!1,mxSession.prototype.start=function(){this.debug?(this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT))):this.connected||this.get(this.urlInit,mxUtils.bind(this,function(e){this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT)),this.poll()}))},mxSession.prototype.suspend=function(){this.connected&&!this.suspended&&(this.suspended=!0,this.fireEvent(new mxEventObject(mxEvent.SUSPEND)))},mxSession.prototype.resume=function(e,n,t){this.connected&&this.suspended&&(this.suspended=!1,this.fireEvent(new mxEventObject(mxEvent.RESUME)),this.polling||this.poll())},mxSession.prototype.stop=function(e){this.connected&&(this.connected=!1),this.fireEvent(new mxEventObject(mxEvent.DISCONNECT,"reason",e))},mxSession.prototype.poll=function(){this.connected&&!this.suspended&&null!=this.urlPoll?(this.polling=!0,this.get(this.urlPoll,mxUtils.bind(this,function(){this.poll()}))):this.polling=!1},mxSession.prototype.notify=function(e,n,t){null!=e&&0<e.length&&(null!=this.urlNotify&&(this.debug?(mxLog.show(),mxLog.debug("mxSession.notify: "+this.urlNotify+" xml="+e)):(e="<message><delta>"+e+"</delta></message>",this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(this.urlNotify,"xml="+e,n,t))),this.sent+=e.length,this.fireEvent(new mxEventObject(mxEvent.NOTIFY,"url",this.urlNotify,"xml",e)))},mxSession.prototype.get=function(t,a,n){if(void 0!==mxUtils){var i=mxUtils.bind(this,function(e){null!=n?n(e):this.stop(e)});mxUtils.get(t,mxUtils.bind(this,function(e){if(void 0!==mxUtils)if(e.isReady()&&404!=e.getStatus()){if(this.received+=e.getText().length,this.fireEvent(new mxEventObject(mxEvent.GET,"url",t,"request",e)),this.isValidResponse(e)){if(0<e.getText().length){var n=e.getDocumentElement();null==n?i("Invalid response: "+e.getText()):this.receive(n)}null!=a&&a(e)}}else i("Response not ready")}),function(e){i("Transmission error")})}},mxSession.prototype.isValidResponse=function(e){return e.getText().indexOf("<?php")<0},mxSession.prototype.encodeChanges=function(e,n){for(var t="",a=n?-1:1,i=n?e.length-1:0;0<=i&&i<e.length;i+=a){var s=this.codec.encode(e[i]);t=t+mxUtils.getXml(s,this.linefeed)}return t},mxSession.prototype.receive=function(e){if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){var n=e.getAttribute("namespace");for(null!=n&&(this.model.prefix=n+"-"),n=e.firstChild;null!=n;){var t=n.nodeName.toLowerCase();"state"==t?this.processState(n):"delta"==t&&this.processDelta(n),n=n.nextSibling}this.fireEvent(new mxEventObject(mxEvent.RECEIVE,"node",e))}},mxSession.prototype.processState=function(e){new mxCodec(e.ownerDocument).decode(e.firstChild,this.model)},mxSession.prototype.processDelta=function(e){for(e=e.firstChild;null!=e;)"edit"==e.nodeName&&this.processEdit(e),e=e.nextSibling},mxSession.prototype.processEdit=function(e){if(0<(e=this.decodeChanges(e)).length){var n=this.createUndoableEdit(e);this.model.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",n,"changes",e)),this.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.fireEvent(new mxEventObject(mxEvent.FIRED,"edit",n))}},mxSession.prototype.createUndoableEdit=function(e){var n=new mxUndoableEdit(this.model,this.significantRemoteChanges);return n.changes=e,n.notify=function(){n.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",n,"changes",n.changes)),n.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",n,"changes",n.changes))},n},mxSession.prototype.decodeChanges=function(e){this.codec.document=e.ownerDocument;var n=[];for(e=e.firstChild;null!=e;){var t=this.decodeChange(e);null!=t&&n.push(t),e=e.nextSibling}return n},mxSession.prototype.decodeChange=function(e){var n=null;return e.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=(n="mxRootChange"==e.nodeName?new mxCodec(e.ownerDocument).decode(e):this.codec.decode(e))&&(n.model=this.model,n.execute(),"mxChildChange"==e.nodeName&&null==n.parent&&this.cellRemoved(n.child))),n},mxSession.prototype.cellRemoved=function(e,n){this.codec.putObject(e.getId(),e);for(var t=this.model.getChildCount(e),a=0;a<t;a++)this.cellRemoved(this.model.getChildAt(e,a))},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(e){this.changes.push(e)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length-1;0<=e;e--){var n=this.changes[e];null!=n.execute?n.execute():null!=n.undo&&n.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length,n=0;n<e;n++){var t=this.changes[n];null!=t.execute?t.execute():null!=t.redo&&t.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var e=this.history[--this.indexOfNextAdd];if(e.undo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var e=this.history.length;this.indexOfNextAdd<e;){var n=this.history[this.indexOfNextAdd++];if(n.redo(),n.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",n));break}}},mxUndoManager.prototype.undoableEditHappened=function(e){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(e),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",e))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var e=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),n=0;n<e.length;n++)e[n].die()};var mxUrlConverter=function(e){var t=!0,a=null,i=null;return{isEnabled:function(){return t},setEnabled:function(e){t=e},getBaseUrl:function(){return a},setBaseUrl:function(e){a=e},getBaseDomain:function(){return a},setBaseDomain:function(e){a=e},isRelativeUrl:function(e){return"http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8)&&"data:image"!=e.substring(0,10)},convert:function(e){if(t&&this.isRelativeUrl(e)){if(null==a){i=location.protocol+"//"+location.host;var n=(a=i+location.pathname).lastIndexOf("/");0<n&&(a=a.substring(0,n+1))}e="/"==e.charAt(0)?i+e:a+e}return e}}};function mxPanningManager(s){this.thread=null,this.active=!1,this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0,this.scrollbars=!1,this.scrollTop=this.scrollLeft=0,this.mouseListener={mouseDown:function(e,n){},mouseMove:function(e,n){},mouseUp:mxUtils.bind(this,function(e,n){this.active&&this.stop()})},s.addMouseListener(this.mouseListener),mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var o=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(s.container),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-s.container.scrollLeft-Math.ceil(this.dx),n=-s.container.scrollTop-Math.ceil(this.dy);s.panGraph(e,n),s.panDx=this.scrollLeft-s.container.scrollLeft,s.panDy=this.scrollTop-s.container.scrollTop,s.fireEvent(new mxEventObject(mxEvent.PAN))}else s.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=s.view.translate.x,this.t0y=s.view.translate.y,this.active=!0},this.panTo=function(e,n,t,a){this.active||this.start(),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,a=null!=a?a:0;var i=s.container;this.dx=e+(null!=t?t:0)-i.scrollLeft-i.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.dx=this.handleMouseOut?Math.max(this.dx,0):0,0==this.dx&&(this.dx=e-i.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0),this.dy=n+a-i.scrollTop-i.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0,0==this.dy&&(this.dy=n-i.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=o())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)s.panDx=0,s.panDy=0,s.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=s.panDx,n=s.panDy;0==e&&0==n||(s.panGraph(0,0),s.view.setTranslate(this.t0x+e/s.view.scale,this.t0y+n/s.view.scale))}},this.destroy=function(){s.removeMouseListener(this.mouseListener)}}function mxPopupMenu(e){null!=(this.factoryMethod=e)&&this.init()}function mxAutoSaveManager(e){this.changeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.graphModelChanged(n.getProperty("edit").changes)}),this.setGraph(e)}function mxAnimation(e){this.delay=null!=e?e:20}function mxMorphing(e,n,t,a){mxAnimation.call(this,a),this.graph=e,this.steps=null!=n?n:6,this.ease=null!=t?t:1.5}function mxImageBundle(e){this.images=[],this.alt=null!=e&&e}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(e){mxAbstractCanvas2D.call(this),this.root=e,this.writeDefaults()}function mxSvgCanvas2D(e,n){mxAbstractCanvas2D.call(this),this.root=e,this.gradients=[],this.defs=null,this.styleEnabled=null!=n&&n;var t=null;if(e.ownerDocument!=document)for(t=e;null!=t&&"svg"!=t.nodeName;)t=t.parentNode;null!=t&&(0<t.getElementsByTagName("defs").length&&(this.defs=t.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=t.firstChild?t.insertBefore(this.defs,t.firstChild):t.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(e){this.enabled=e},mxPopupMenu.prototype.isPopupTrigger=function(e){return e.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(e.getEvent())},mxPopupMenu.prototype.addItem=function(e,n,t,a,i,s){a=a||this,this.itemCount++,a.willAddSeparator&&(a.containsItems&&this.addSeparator(a,!0),a.willAddSeparator=!1),a.containsItems=!0;var o=document.createElement("tr");o.className="mxPopupMenuItem";var r=document.createElement("td");return r.className="mxPopupMenuIcon",null!=n?((i=document.createElement("img")).src=n,r.appendChild(i)):null!=i&&((n=document.createElement("div")).className=i,r.appendChild(n)),o.appendChild(r),this.labels&&((r=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),mxUtils.write(r,e),r.align="left",o.appendChild(r),(e=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),e.style.paddingRight="6px",e.style.textAlign="right",o.appendChild(e),null==a.div&&this.createSubmenu(a)),a.tbody.appendChild(o),(null==s||s)&&(mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){this.eventReceiver=o,a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),mxEvent.consume(e)}),mxUtils.bind(this,function(e){a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),this.autoExpand&&null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),o.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(e){this.eventReceiver==o&&(a.activeRow!=o&&this.hideMenu(),null!=t&&t(e)),this.eventReceiver=null,mxEvent.consume(e)})),mxEvent.addListener(o,"mouseout",mxUtils.bind(this,function(e){o.className="mxPopupMenuItem"}))),o},mxPopupMenu.prototype.createSubmenu=function(e){e.table=document.createElement("table"),e.table.className="mxPopupMenu",e.tbody=document.createElement("tbody"),e.table.appendChild(e.tbody),e.div=document.createElement("div"),e.div.className="mxPopupMenu",e.div.style.position="absolute",e.div.style.display="inline",e.div.style.zIndex=this.zIndex,e.div.appendChild(e.table);var n=document.createElement("img");n.setAttribute("src",this.submenuImage),td=e.firstChild.nextSibling.nextSibling,td.appendChild(n)},mxPopupMenu.prototype.showSubmenu=function(e,n){if(null!=n.div){n.div.style.left=e.div.offsetLeft+n.offsetLeft+n.offsetWidth-1+"px",n.div.style.top=e.div.offsetTop+n.offsetTop+"px",document.body.appendChild(n.div);var t=parseInt(n.div.offsetLeft),a=parseInt(n.div.offsetWidth),i=document.body,s=document.documentElement;t+a>(i.scrollLeft||s.scrollLeft)+(i.clientWidth||s.clientWidth)&&(n.div.style.left=e.div.offsetLeft-a+(mxClient.IS_IE?6:-6)+"px"),mxUtils.fit(n.div)}},mxPopupMenu.prototype.addSeparator=function(e,n){if(e=e||this,this.smartSeparators&&!n)e.willAddSeparator=!0;else if(null!=e.tbody){e.willAddSeparator=!1;var t=document.createElement("tr"),a=document.createElement("td");a.className="mxPopupMenuIcon",a.style.padding="0 0 0 0px",t.appendChild(a),(a=document.createElement("td")).style.padding="0 0 0 0px",a.setAttribute("colSpan","2");var i=document.createElement("hr");i.setAttribute("size","1"),a.appendChild(i),t.appendChild(a),e.tbody.appendChild(t)}},mxPopupMenu.prototype.popup=function(e,n,t,a){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=e+"px",this.div.style.top=n+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,t,a),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1)},mxPopupMenu.prototype.hideSubmenu=function(e){null!=e.activeRow&&(this.hideSubmenu(e.activeRow),null!=e.activeRow.div.parentNode&&e.activeRow.div.parentNode.removeChild(e.activeRow.div),e.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(e){this.enabled=e},mxAutoSaveManager.prototype.setGraph=function(e){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=e,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(e){(e=((new Date).getTime()-this.lastSnapshot)/1e3)>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){var e=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var n=0;n<this.cells.length;n++)this.animateCell(cells[n],e,!1);else this.animateCell(this.graph.getModel().getRoot(),e,!0);this.show(e),(e.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(e){e.show()},mxMorphing.prototype.animateCell=function(e,n,t){var a=this.graph.getView().getState(e),i=null;if(null!=a&&(i=this.getDelta(a),this.graph.getModel().isVertex(e)&&(0!=i.x||0!=i.y))){var s=this.graph.view.getTranslate(),o=this.graph.view.getScale();i.x+=s.x*o,i.y+=s.y*o,n.moveState(a,-i.x/this.ease,-i.y/this.ease)}if(t&&!this.stopRecursion(a,i))for(a=this.graph.getModel().getChildCount(e),i=0;i<a;i++)this.animateCell(this.graph.getModel().getChildAt(e,i),n,t)},mxMorphing.prototype.stopRecursion=function(e,n){return null!=n&&(0!=n.x||0!=n.y)},mxMorphing.prototype.getDelta=function(e){var n=this.getOriginForCell(e.cell),t=this.graph.getView().getTranslate(),a=this.graph.getView().getScale();return e=new mxPoint(e.x/a-t.x,e.y/a-t.y),new mxPoint((n.x-e.x)*a,(n.y-e.y)*a)},mxMorphing.prototype.getOriginForCell=function(e){var n=null;return null!=e&&(n=this.getOriginForCell(this.graph.getModel().getParent(e)),null!=(e=this.graph.getCellGeometry(e))&&(n.x+=e.x,n.y+=e.y)),null==n&&(n=new mxPoint(-(n=this.graph.view.getTranslate()).x,-n.y)),n},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(e,n,t){this.images[e]={value:n,fallback:t}},mxImageBundle.prototype.getImage=function(e){var n=null;return null!=e&&(null!=(e=this.images[e])&&(n=this.alt?e.fallback:e.value)),n},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(e,n){null!=e&&(this.visitStatesRecursive(e,n,this.drawCellState),this.includeOverlays&&this.visitStatesRecursive(e,n,this.drawOverlays))},mxImageExport.prototype.visitStatesRecursive=function(e,n,t){if(null!=e){t(e,n);for(var a=e.view.graph,i=a.model.getChildCount(e.cell),s=0;s<i;s++){var o=a.view.getState(a.model.getChildAt(e.cell,s));this.visitStatesRecursive(o,n,t)}}},mxImageExport.prototype.drawCellState=function(e,n){e.shape instanceof mxShape&&(n.save(),e.shape.paint(n),n.restore()),null!=e.text&&(n.save(),e.text.paint(n),n.restore())},mxImageExport.prototype.drawOverlays=function(e,t){null!=e.overlays&&e.overlays.visit(function(e,n){n instanceof mxShape&&n.paint(t)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillColor:null,fillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(e){return Math.round(parseFloat(e))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var e=this.state,n=2;n<arguments.length;n+=2)this.lastX=arguments[n-1],this.lastY=arguments[n],this.path.push(this.format((this.lastX+e.dx)*e.scale)),this.path.push(this.format((this.lastY+e.dy)*e.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(e,n,t,a,i){return t*=Math.PI/180,mxUtils.getRotatedPoint(new mxPoint(e,n),Math.cos(t),Math.sin(t),new mxPoint(a,i))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){this.state=this.states.pop()},mxAbstractCanvas2D.prototype.scale=function(e){this.state.scale*=e,this.state.strokeWidth*=e},mxAbstractCanvas2D.prototype.translate=function(e,n){this.state.dx+=e,this.state.dy+=n},mxAbstractCanvas2D.prototype.setAlpha=function(e){this.state.alpha=e},mxAbstractCanvas2D.prototype.setFillColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fillColor=e,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(e,n,t,a,i,s,o,r,l){(t=this.state).fillColor=e,t.fillAlpha=null!=r?r:1,t.gradientColor=n,t.gradientAlpha=null!=l?l:1,t.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(e){e==mxConstants.NONE&&(e=null),this.state.strokeColor=e},mxAbstractCanvas2D.prototype.setStrokeWidth=function(e){this.state.strokeWidth=e},mxAbstractCanvas2D.prototype.setDashed=function(e){this.state.dashed=e},mxAbstractCanvas2D.prototype.setDashPattern=function(e){this.state.dashPattern=e},mxAbstractCanvas2D.prototype.setLineCap=function(e){this.state.lineCap=e},mxAbstractCanvas2D.prototype.setLineJoin=function(e){this.state.lineJoin=e},mxAbstractCanvas2D.prototype.setMiterLimit=function(e){this.state.miterLimit=e},mxAbstractCanvas2D.prototype.setFontColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontColor=e},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBackgroundColor=e},mxAbstractCanvas2D.prototype.setFontBorderColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBorderColor=e},mxAbstractCanvas2D.prototype.setFontSize=function(e){this.state.fontSize=e},mxAbstractCanvas2D.prototype.setFontFamily=function(e){this.state.fontFamily=e},mxAbstractCanvas2D.prototype.setFontStyle=function(e){null==e&&(e=0),this.state.fontStyle=e},mxAbstractCanvas2D.prototype.setShadow=function(e){this.state.shadow=e},mxAbstractCanvas2D.prototype.setShadowColor=function(e){e==mxConstants.NONE&&(e=null),this.state.shadowColor=e},mxAbstractCanvas2D.prototype.setShadowAlpha=function(e){this.state.shadowAlpha=e},mxAbstractCanvas2D.prototype.setShadowOffset=function(e,n){this.state.shadowDx=e,this.state.shadowDy=n},mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(e,n){this.addOp(this.moveOp,e,n)},mxAbstractCanvas2D.prototype.lineTo=function(e,n){this.addOp(this.lineOp,e,n)},mxAbstractCanvas2D.prototype.quadTo=function(e,n,t,a){this.addOp(this.quadOp,e,n,t,a)},mxAbstractCanvas2D.prototype.curveTo=function(e,n,t,a,i,s){this.addOp(this.curveOp,e,n,t,a,i,s)},mxAbstractCanvas2D.prototype.arcTo=function(e,n,t,a,i,s,o){for(e=mxUtils.arcToCurves(this.lastX,this.lastY,e,n,t,a,i,s,o),n=0;n<e.length;n+=6)this.curveTo(e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5])},mxAbstractCanvas2D.prototype.close=function(e,n,t,a,i,s){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var e;(e=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(e),(e=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(e),(e=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(e),(e=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(e),(e=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),e.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(e)},mxXmlCanvas2D.prototype.format=function(e){return parseFloat(parseFloat(e).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(e){return this.root.ownerDocument.createElement(e)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(e){if(this.compressed){if(this.state.scale==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var n=this.createElement("scale");n.setAttribute("scale",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.translate=function(e,n){var t=this.createElement("translate");t.setAttribute("dx",this.format(e)),t.setAttribute("dy",this.format(n)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.rotate=function(e,n,t,a,i){var s=this.createElement("rotate");(0!=e||n||t)&&(s.setAttribute("theta",this.format(e)),s.setAttribute("flipH",n?"1":"0"),s.setAttribute("flipV",t?"1":"0"),s.setAttribute("cx",this.format(a)),s.setAttribute("cy",this.format(i)),this.root.appendChild(s))},mxXmlCanvas2D.prototype.setAlpha=function(e){if(this.compressed){if(this.state.alpha==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var n=this.createElement("alpha");n.setAttribute("alpha",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setFillColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fillColor==e)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var n=this.createElement("fillcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setGradient=function(e,n,t,a,i,s,o,r,l){if(null!=e&&null!=n){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var d=this.createElement("gradient");d.setAttribute("c1",e),d.setAttribute("c2",n),d.setAttribute("x",this.format(t)),d.setAttribute("y",this.format(a)),d.setAttribute("w",this.format(i)),d.setAttribute("h",this.format(s)),null!=o&&d.setAttribute("direction",o),null!=r&&d.setAttribute("alpha1",r),null!=l&&d.setAttribute("alpha2",l),this.root.appendChild(d)}},mxXmlCanvas2D.prototype.setStrokeColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.strokeColor==e)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var n=this.createElement("strokecolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setStrokeWidth=function(e){if(this.compressed){if(this.state.strokeWidth==e)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var n=this.createElement("strokewidth");n.setAttribute("width",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashed=function(e){if(this.compressed){if(this.state.dashed==e)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var n=this.createElement("dashed");n.setAttribute("dashed",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashPattern=function(e){if(this.compressed){if(this.state.dashPattern==e)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var n=this.createElement("dashpattern");n.setAttribute("pattern",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setLineCap=function(e){if(this.compressed){if(this.state.lineCap==e)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var n=this.createElement("linecap");n.setAttribute("cap",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setLineJoin=function(e){if(this.compressed){if(this.state.lineJoin==e)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var n=this.createElement("linejoin");n.setAttribute("join",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setMiterLimit=function(e){if(this.compressed){if(this.state.miterLimit==e)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var n=this.createElement("miterlimit");n.setAttribute("limit",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setFontColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontColor==e)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var n=this.createElement("fontcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBackgroundColor==e)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var n=this.createElement("fontbackgroundcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBorderColor==e)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var n=this.createElement("fontbordercolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontSize=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==e)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var n=this.createElement("fontsize");n.setAttribute("size",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontFamily=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==e)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var n=this.createElement("fontfamily");n.setAttribute("family",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontStyle=function(e){if(this.textEnabled){if(null==e&&(e=0),this.compressed){if(this.state.fontStyle==e)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var n=this.createElement("fontstyle");n.setAttribute("style",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setShadow=function(e){if(this.compressed){if(this.state.shadow==e)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var n=this.createElement("shadow");n.setAttribute("enabled",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowColor=function(e){if(this.compressed){if(e==mxConstants.NONE&&(e=null),this.state.shadowColor==e)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var n=this.createElement("shadowcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowAlpha=function(e){if(this.compressed){if(this.state.shadowAlpha==e)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var n=this.createElement("shadowalpha");n.setAttribute("alpha",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowOffset=function(e,n){if(this.compressed){if(this.state.shadowDx==e&&this.state.shadowDy==n)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var t=this.createElement("shadowoffset");t.setAttribute("dx",e),t.setAttribute("dy",n),this.root.appendChild(t)},mxXmlCanvas2D.prototype.rect=function(e,n,t,a){var i=this.createElement("rect");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(n)),i.setAttribute("w",this.format(t)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){var o=this.createElement("roundrect");o.setAttribute("x",this.format(e)),o.setAttribute("y",this.format(n)),o.setAttribute("w",this.format(t)),o.setAttribute("h",this.format(a)),o.setAttribute("dx",this.format(i)),o.setAttribute("dy",this.format(s)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(e,n,t,a){var i=this.createElement("ellipse");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(n)),i.setAttribute("w",this.format(t)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){i=this.converter.convert(i);var l=this.createElement("image");l.setAttribute("x",this.format(e)),l.setAttribute("y",this.format(n)),l.setAttribute("w",this.format(t)),l.setAttribute("h",this.format(a)),l.setAttribute("src",i),l.setAttribute("aspect",s?"1":"0"),l.setAttribute("flipH",o?"1":"0"),l.setAttribute("flipV",r?"1":"0"),this.root.appendChild(l)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastY=this.lastX=0},mxXmlCanvas2D.prototype.moveTo=function(e,n){var t=this.createElement("move");t.setAttribute("x",this.format(e)),t.setAttribute("y",this.format(n)),this.root.appendChild(t),this.lastX=e,this.lastY=n},mxXmlCanvas2D.prototype.lineTo=function(e,n){var t=this.createElement("line");t.setAttribute("x",this.format(e)),t.setAttribute("y",this.format(n)),this.root.appendChild(t),this.lastX=e,this.lastY=n},mxXmlCanvas2D.prototype.quadTo=function(e,n,t,a){var i=this.createElement("quad");i.setAttribute("x1",this.format(e)),i.setAttribute("y1",this.format(n)),i.setAttribute("x2",this.format(t)),i.setAttribute("y2",this.format(a)),this.root.appendChild(i),this.lastX=t,this.lastY=a},mxXmlCanvas2D.prototype.curveTo=function(e,n,t,a,i,s){var o=this.createElement("curve");o.setAttribute("x1",this.format(e)),o.setAttribute("y1",this.format(n)),o.setAttribute("x2",this.format(t)),o.setAttribute("y2",this.format(a)),o.setAttribute("x3",this.format(i)),o.setAttribute("y3",this.format(s)),this.root.appendChild(o),this.lastX=i,this.lastY=s},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){mxUtils.isNode(i)&&(i=mxUtils.getOuterHtml(i));var u=this.createElement("text");u.setAttribute("x",this.format(e)),u.setAttribute("y",this.format(n)),u.setAttribute("w",this.format(t)),u.setAttribute("h",this.format(a)),u.setAttribute("str",i),null!=s&&u.setAttribute("align",s),null!=o&&u.setAttribute("valign",o),u.setAttribute("wrap",r?"1":"0"),null==l&&(l=""),u.setAttribute("format",l),null!=d&&u.setAttribute("fill",d?"1":"0"),null!=c&&u.setAttribute("clip",c?"1":"0"),null!=m&&u.setAttribute("rotation",m),this.root.appendChild(u)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(e){return(e=this.createElement("style")).setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(e,n){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(n||mxConstants.NS_SVG,e);var t=this.root.ownerDocument.createElement(e);return null!=n&&t.setAttribute("xmlns",n),t},mxSvgCanvas2D.prototype.createGradientId=function(e,n,t,a,i){return"#"==e.charAt(0)&&(e=e.substring(1)),"#"==n.charAt(0)&&(n=n.substring(1)),e=e.toLowerCase()+"-"+t,n=n.toLowerCase()+"-"+a,(t=null)==i||i==mxConstants.DIRECTION_SOUTH?t="s":i==mxConstants.DIRECTION_EAST?t="e":(a=e,e=n,n=a,i==mxConstants.DIRECTION_NORTH?t="s":i==mxConstants.DIRECTION_WEST&&(t="e")),"mx-gradient-"+e+"-"+n+"-"+t},mxSvgCanvas2D.prototype.getSvgGradient=function(e,n,t,a,i){var s=this.createGradientId(e,n,t,a,i),o=this.gradients[s];if(null==o){var r=this.root.ownerSVGElement,l=0,d=s+"-"+l;if(null!=r)for(o=r.ownerDocument.getElementById(d);null!=o&&o.ownerSVGElement!=r;)d=s+"-"+l++,o=r.ownerDocument.getElementById(d);else d="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(e,n,t,a,i)).setAttribute("id",d),null!=this.defs?this.defs.appendChild(o):r.appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(e,n,t,a,i){var s=this.createElement("linearGradient");return s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==i||i==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):i==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):i==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):i==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%"),t=t<1?";stop-opacity:"+t:"",(i=this.createElement("stop")).setAttribute("offset","0%"),i.setAttribute("style","stop-color:"+e+t),s.appendChild(i),t=a<1?";stop-opacity:"+a:"",(i=this.createElement("stop")).setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+n+t),s.appendChild(i),s},mxSvgCanvas2D.prototype.addNode=function(e,n){var t=this.node,a=this.state;if(null!=t){if("path"==t.nodeName){if(!(null!=this.path&&0<this.path.length))return;t.setAttribute("d",this.path.join(" "))}e&&null!=a.fillColor?this.updateFill():this.styleEnabled||("ellipse"!=t.nodeName||!mxClient.IS_NS||mxClient.IS_GC||mxClient.IS_SF?t.setAttribute("fill","none"):t.setAttribute("fill","transparent"),e=!1),n&&null!=a.strokeColor?this.updateStroke():this.styleEnabled||t.setAttribute("stroke","none"),null!=a.transform&&0<a.transform.length&&t.setAttribute("transform",a.transform),a.shadow&&this.root.appendChild(this.createShadow(t)),0<this.strokeTolerance&&!e&&this.root.appendChild(this.createTolerance(t)),this.pointerEvents&&("path"!=t.nodeName||this.path[this.path.length-1]==this.closeOp)&&t.setAttribute("pointer-events","all"),this.root.appendChild(t)}},mxSvgCanvas2D.prototype.updateFill=function(){var e=this.state;e.alpha<1&&this.node.setAttribute("fill-opacity",e.alpha),null!=e.fillColor&&(null!=e.gradientColor?(e=this.getSvgGradient(e.fillColor,e.gradientColor,e.fillAlpha,e.gradientAlpha,e.gradientDirection),this.node.setAttribute("fill","url(#"+e+")")):this.node.setAttribute("fill",e.fillColor.toLowerCase()))},mxSvgCanvas2D.prototype.updateStroke=function(){var e=this.state;this.node.setAttribute("stroke",e.strokeColor.toLowerCase()),e.alpha<1&&this.node.setAttribute("stroke-opacity",e.alpha);var n=Math.max(1,this.format(e.strokeWidth*e.scale));1!=n&&this.node.setAttribute("stroke-width",n),"path"==this.node.nodeName&&this.updateStrokeAttributes(),e.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(n))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var e=this.state;if(null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap){var n=e.lineCap;"flat"==n&&(n="butt"),"butt"!=n&&this.node.setAttribute("stroke-linecap",n)}null!=e.miterLimit&&(!this.styleEnabled||10!=e.miterLimit)&&this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(e){var n=this.state.dashPattern.split(" "),t=[];if(0<n.length)for(var a=0;a<n.length;a++)t[a]=Number(n[a])*e;return t.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(e){e=e.cloneNode(!0);var n=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OP?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(e){e=e.cloneNode(!0);var n=this.state;return"none"!=e.getAttribute("fill")&&e.setAttribute("fill",n.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",n.shadowColor),e.setAttribute("transform","translate("+this.format(n.shadowDx*n.scale)+","+this.format(n.shadowDy*n.scale)+")"+(n.transform||"")),e.setAttribute("opacity",n.shadowAlpha),e},mxSvgCanvas2D.prototype.rotate=function(e,n,t,a,i){if(0!=e||n||t){var s=this.state;if(a+=s.dx,i+=s.dy,a*=s.scale,i*=s.scale,s.transform=s.transform||"",n&&t)e+=180;else if(n^t){var o=n?a:0,r=n?-1:1,l=t?i:0,d=t?-1:1;s.transform+="translate("+this.format(o)+","+this.format(l)+")scale("+this.format(r)+","+this.format(d)+")translate("+this.format(-o)+","+this.format(-l)+")"}(n?!t:t)&&(e*=-1),0!=e&&(s.transform+="rotate("+this.format(e)+","+this.format(a)+","+this.format(i)+")"),s.rotation+=e,s.rotationCx=a,s.rotationCy=i}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(e,n,t,a){var i=this.state,s=this.createElement("rect");s.setAttribute("x",this.format((e+i.dx)*i.scale)),s.setAttribute("y",this.format((n+i.dy)*i.scale)),s.setAttribute("width",this.format(t*i.scale)),s.setAttribute("height",this.format(a*i.scale)),this.node=s},mxSvgCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){this.rect(e,n,t,a),0<i&&this.node.setAttribute("rx",this.format(i*this.state.scale)),0<s&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(e,n,t,a){var i=this.state,s=this.createElement("ellipse");s.setAttribute("cx",Math.round((e+t/2+i.dx)*i.scale)),s.setAttribute("cy",Math.round((n+a/2+i.dy)*i.scale)),s.setAttribute("rx",t/2*i.scale),s.setAttribute("ry",a/2*i.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){i=this.converter.convert(i),s=null==s||s,o=null!=o&&o,r=null!=r&&r;var l=this.state;e+=l.dx,n+=l.dy;var d=this.createElement("image");if(d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(n*l.scale)),d.setAttribute("width",this.format(t*l.scale)),d.setAttribute("height",this.format(a*l.scale)),null==d.setAttributeNS?d.setAttribute("xlink:href",i):d.setAttributeNS(mxConstants.NS_XLINK,"href",i),s||d.setAttribute("preserveAspectRatio","none"),l.alpha<1&&d.setAttribute("opacity",l.alpha),i=this.state.transform||"",o||r){var c=s=1,m=0,u=0;o&&(s=-1,m=-t-2*e),r&&(c=-1,u=-a-2*n),i+="scale("+s+","+c+")translate("+m+","+u+")"}0<i.length&&d.setAttribute("transform",i),this.root.appendChild(d),this.blockImagePointerEvents&&(d.setAttribute("style","pointer-events:none"),(d=this.createElement("rect")).setAttribute("visibility","hidden"),d.setAttribute("pointer-events","fill"),d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(n*l.scale)),d.setAttribute("width",this.format(t*l.scale)),d.setAttribute("height",this.format(a*l.scale)),this.root.appendChild(d))},mxSvgCanvas2D.prototype.createDiv=function(e,n,t,a,i){return t=this.state,a="display:inline-block;font-size:"+Math.round(t.fontSize)+"px;font-family:"+t.fontFamily+";color:"+t.fontColor+";line-height:"+Math.round(t.fontSize*mxConstants.LINE_HEIGHT)+"px;"+a,(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight:bold;"),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style:italic;"),(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a+="font-decoration:underline;"),n==mxConstants.ALIGN_CENTER?a+="text-align:center;":n==mxConstants.ALIGN_RIGHT&&(a+="text-align:right;"),n="",null!=t.fontBackgroundColor&&(n+="background-color:"+t.fontBackgroundColor+";"),null!=t.fontBorderColor&&(n+="border:1px solid "+t.fontBorderColor+";"),mxUtils.isNode(e)||((t=document.createElement("textarea")).innerHTML=e.replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=t.value,i?a+=n:0<n.length&&(e='<div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;'+n+'">'+e+"</div>")),!mxClient.IS_IE&&document.createElementNS?((i=document.createElementNS("http://www.w3.org/1999/xhtml","div")).setAttribute("style",a),mxUtils.isNode(e)?this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e):i.innerHTML=e,i):(mxUtils.isNode(e)&&this.root.ownerDocument!=document&&(e=e.outerHTML),e=e.replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+a+'">'+e+"</div>").documentElement)},mxSvgCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){m=null!=m?m:0;var u=this.state;if(e+=u.dx,n+=u.dy,this.foEnabled&&"html"==l){var p="vertical-align:top;";if(c?(p+="overflow:hidden;",0<a&&(p+="max-height:"+Math.round(a)+"px;"),0<t&&(p+="width:"+Math.round(t)+"px;")):d&&(p+="width:"+Math.round(t)+"px;",0<a&&(p+="max-height:"+Math.round(a)+"px;")),r?(!c&&0<t&&(p+="width:"+Math.round(t)+"px;"),p+="white-space:normal;"):p+="white-space:nowrap;",r=this.createElement("g"),u.alpha<1&&r.setAttribute("opacity",u.alpha),(l=this.createElement("foreignObject")).setAttribute("pointer-events","all"),null!=(p=this.createDiv(i,s,o,p,d))){r.appendChild(l),this.root.appendChild(r);var g=0;if(mxClient.IS_IE&&!mxClient.IS_SVG){var v=document.createElement("div");v.style.cssText=p.getAttribute("style"),v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",v.style.visibility="hidden",v.innerHTML=mxUtils.isNode(i)?i.outerHTML:i,document.body.appendChild(v),g=v.offsetWidth,a=mxClient.IS_QUIRKS&&0<a&&c?Math.min(a,v.offsetHeight+2):v.offsetHeight,v.parentNode.removeChild(v),l.appendChild(p)}else this.root.ownerDocument!=document?(p.style.visibility="hidden",document.body.appendChild(p),g=p.offsetWidth,a=p.offsetHeight,l.appendChild(p),p.style.visibility=""):(l.appendChild(p),g=p.offsetWidth,a=p.offsetHeight);t=d?Math.max(t,g):g,u.alpha<1&&r.setAttribute("opacity",u.alpha),d=i=0,s==mxConstants.ALIGN_CENTER?i-=t/2:s==mxConstants.ALIGN_RIGHT&&(i-=t),e+=i,o==mxConstants.ALIGN_MIDDLE?d-=a/2:o==mxConstants.ALIGN_BOTTOM&&(d-=a),n+=d,s=1!=u.scale?"scale("+u.scale+")":"",0!=u.rotation&&this.rotateHtml?(s+="rotate("+u.rotation+","+t/2+","+a/2+")",e=(n=this.rotatePoint((e+t/2)*u.scale,(n+a/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy)).x-t*u.scale/2,n=n.y-a*u.scale/2):(e*=u.scale,n*=u.scale),0!=m&&(s+="rotate("+m+","+-i+","+-d+")"),r.setAttribute("transform","translate("+Math.round(e)+","+Math.round(n)+")"+s),l.setAttribute("width",Math.round(Math.max(1,t))),l.setAttribute("height",Math.round(Math.max(1,a)))}}else this.plainText(e,n,t,a,i,s,o,r,d,c,m)}},mxSvgCanvas2D.prototype.createClip=function(e,n,t,a){for(var i="mx-clip-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(t=Math.round(t))+"-"+(a=Math.round(a)),s=0,o=i+"-"+s;null!=document.getElementById(o);)o=i+"-"+ ++s;return clip=this.createElement("clipPath"),clip.setAttribute("id",o),(i=this.createElement("rect")).setAttribute("x",e),i.setAttribute("y",n),i.setAttribute("width",t),i.setAttribute("height",a),clip.appendChild(i),clip},mxSvgCanvas2D.prototype.plainText=function(e,n,t,a,i,s,o,r,l,d,c){c=null!=c?c:0,r=this.state;var m=Math.round(r.fontSize),u=this.createElement("g"),p=r.transform||"";if(0!=c&&(p+="rotate("+c+","+this.format(e*r.scale)+","+this.format(n*r.scale)+")"),d&&0<t&&0<a){var g=e;c=n,s==mxConstants.ALIGN_CENTER?g-=t/2:s==mxConstants.ALIGN_RIGHT&&(g-=t),o==mxConstants.ALIGN_MIDDLE?c-=a/2:o==mxConstants.ALIGN_BOTTOM&&(c-=a),c=this.createClip(g*r.scale-2,c*r.scale-2,t*r.scale+4,a*r.scale+4),null!=this.defs?this.defs.appendChild(c):this.root.appendChild(c),u.setAttribute("clip-path","url(#"+c.getAttribute("id")+")")}this.updateFont(u,s),"start"!=(c=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start")&&u.setAttribute("text-anchor",c),(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE)&&u.setAttribute("font-size",Math.round(m*r.scale)+"px"),0<p.length&&u.setAttribute("transform",p),r.alpha<1&&u.setAttribute("opacity",r.alpha);p=i.split("\n"),g=Math.round(m*mxConstants.LINE_HEIGHT);var v=m+(p.length-1)*g;for(c=n+m-1,o==mxConstants.ALIGN_MIDDLE?c-=(a=(this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)/2)+1:o==mxConstants.ALIGN_BOTTOM&&(c-=(a=this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)+2),a=0;a<p.length;a++)0<p[a].length&&0<mxUtils.trim(p[a]).length&&((d=this.createElement("text")).setAttribute("x",this.format(e*r.scale)),d.setAttribute("y",this.format(c*r.scale)),mxUtils.write(d,p[a]),u.appendChild(d)),c+=g;this.root.appendChild(u),this.addTextBackground(u,i,e,n,t,v,s,o,l)},mxSvgCanvas2D.prototype.updateFont=function(e){var n=this.state;e.setAttribute("fill",n.fontColor),(!this.styleEnabled||n.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&e.setAttribute("font-family",n.fontFamily),(n.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&e.setAttribute("font-weight","bold"),(n.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&e.setAttribute("font-style","italic"),(n.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(e,n,t,a,i,s,o,r,l){var d=this.state;if(null!=d.fontBackgroundColor||null!=d.fontBorderColor){var c=null;null!=(c=l?(o==mxConstants.ALIGN_CENTER?t-=i/2:o==mxConstants.ALIGN_RIGHT&&(t-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((t+1)*d.scale,a*d.scale,(i-2)*d.scale,(s+2)*d.scale)):null!=e.getBBox&&this.root.ownerDocument==document?(c=e.getBBox(),n=mxClient.IS_IE&&mxClient.IS_SVG,new mxRectangle(c.x,c.y+(n?0:1),c.width,c.height+(n?1:0))):((c=document.createElement("div")).style.lineHeight=Math.round(d.fontSize*mxConstants.LINE_HEIGHT)+"px",c.style.fontSize=Math.round(d.fontSize)+"px",c.style.fontFamily=d.fontFamily,c.style.whiteSpace="nowrap",c.style.position="absolute",c.style.visibility="hidden",c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",c.style.zoom="1",(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle="italic"),n=mxUtils.htmlEntities(n,!1),c.innerHTML=n.replace(/\n/g,"<br/>"),document.body.appendChild(c),i=c.offsetWidth,s=c.offsetHeight,c.parentNode.removeChild(c),o==mxConstants.ALIGN_CENTER?t-=i/2:o==mxConstants.ALIGN_RIGHT&&(t-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((t+1)*d.scale,(a+2)*d.scale,i*d.scale,(s+1)*d.scale)))&&((n=this.createElement("rect")).setAttribute("fill",d.fontBackgroundColor||"none"),n.setAttribute("stroke",d.fontBorderColor||"none"),n.setAttribute("x",Math.floor(c.x-1)),n.setAttribute("y",Math.floor(c.y-1)),n.setAttribute("width",Math.ceil(c.width+2)),n.setAttribute("height",Math.ceil(c.height)),d=null!=d.fontBorderColor?Math.max(1,this.format(d.scale)):0,n.setAttribute("stroke-width",d),this.root.ownerDocument==document&&1==mxUtils.mod(d,2)&&n.setAttribute("transform","translate(0.5, 0.5)"),e.insertBefore(n,e.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(e){mxAbstractCanvas2D.call(this),this.root=e};function mxGuide(e,n){this.graph=e,this.setStates(n)}function mxStencil(e){this.desc=e,this.parseDescription(),this.parseConstraints()}function mxShape(e){this.stencil=e,this.strokewidth=1,this.rotation=0,this.opacity=100,this.flipV=this.flipH=!1}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.addNode=function(e,n){var t=this.node,a=this.state;if(null!=t){if("shape"==t.nodeName){if(!(null!=this.path&&0<this.path.length))return;t.path=this.path.join(" ")+" e",t.style.width=this.root.style.width,t.style.height=this.root.style.height,t.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height)}t.strokeweight=this.format(Math.max(1,a.strokeWidth*a.scale/this.vmlScale))+"px",a.shadow&&this.root.appendChild(this.createShadow(t,e&&null!=a.fillColor,n&&null!=a.strokeColor)),n&&null!=a.strokeColor?(t.stroked="true",t.strokecolor=a.strokeColor):t.stroked="false",t.appendChild(this.createStroke()),e&&null!=a.fillColor?t.appendChild(this.createFill()):!this.pointerEvents||"shape"==t.nodeName&&this.path[this.path.length-1]!=this.closeOp?t.filled="false":t.appendChild(this.createTransparentFill()),this.root.appendChild(t)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.src=mxClient.imageBasePath+"/transparent.gif",e.type="tile",e},mxVmlCanvas2D.prototype.createFill=function(){var e=this.state,n=document.createElement(mxClient.VML_PREFIX+":fill");if(n.color=e.fillColor,null!=e.gradientColor){n.type="gradient",n.method="none",n.color2=e.gradientColor;var t=180-e.rotation;t=e.gradientDirection==mxConstants.DIRECTION_WEST?t-(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_EAST?t+(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_NORTH?t-(180+("y"==this.root.style.flip?-180:0)):t+("y"==this.root.style.flip?-180:0);"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(t*=-1),n.angle=mxUtils.mod(t,360),n.opacity=100*e.alpha*e.fillAlpha+"%",n.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*e.alpha*e.gradientAlpha+"%")}else e.alpha<1&&(n.opacity=100*e.alpha+"%");return n},mxVmlCanvas2D.prototype.createStroke=function(){var e=this.state,n=document.createElement(mxClient.VML_PREFIX+":stroke");return n.endcap=e.lineCap||"flat",n.joinstyle=e.lineJoin||"miter",n.miterlimit=e.miterLimit||"10",e.alpha<1&&(n.opacity=100*e.alpha+"%"),e.dashed&&(n.dashstyle=this.getVmlDashStyle()),n},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var e="dash";if(null!=this.state.dashPattern){var n=this.state.dashPattern.split(" ");0<n.length&&1==n[0]&&(e="0 2")}return e},mxVmlCanvas2D.prototype.createShadow=function(e,n,t){var a=this.state,i=-a.rotation*(Math.PI/180),s=Math.cos(i),o=(i=Math.sin(i),a.shadowDx*a.scale),r=a.shadowDy*a.scale;"x"==this.root.style.flip?o*=-1:"y"==this.root.style.flip&&(r*=-1);var l=e.cloneNode(!0);return l.style.marginLeft=Math.round(o*s-r*i)+"px",l.style.marginTop=Math.round(o*i+r*s)+"px",8==document.documentMode&&(l.strokeweight=e.strokeweight,"shape"==e.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(e.style.width)+" "+parseInt(e.style.height))),t?(l.strokecolor=a.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",n?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.color=this.state.shadowColor,e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.createShadowStroke=function(){var e=this.createStroke();return e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.rotate=function(e,n,t,a,i){n&&t?e+=180:n?this.root.style.flip="x":t&&(this.root.style.flip="y"),(n?!t:t)&&(e*=-1),this.root.style.rotation=e,this.state.rotation+=e,this.state.rotationCx=a,this.state.rotationCy=i},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=document.createElement(mxClient.VML_PREFIX+":shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(e,n,t,a){var i=this.state,s=(this.lastX+i.dx)*i.scale,o=(this.lastY+i.dy)*i.scale;e=(e+i.dx)*i.scale;o+=2/3*((n=(n+i.dy)*i.scale)-o);var r=(t=(t+i.dx)*i.scale)+2/3*(e-t);n=(a=(a+i.dy)*i.scale)+2/3*(n-a),this.path.push("c "+this.format(s+2/3*(e-s))+" "+this.format(o)+" "+this.format(r)+" "+this.format(n)+" "+this.format(t)+" "+this.format(a)),this.lastX=t/i.scale-i.dx,this.lastY=a/i.scale-i.dy},mxVmlCanvas2D.prototype.createRect=function(e,n,t,a,i){var s=this.state;return(e=document.createElement(e)).style.position="absolute",e.style.left=this.format((n+s.dx)*s.scale)+"px",e.style.top=this.format((t+s.dy)*s.scale)+"px",e.style.width=this.format(a*s.scale)+"px",e.style.height=this.format(i*s.scale)+"px",e},mxVmlCanvas2D.prototype.rect=function(e,n,t,a){this.node=this.createRect(mxClient.VML_PREFIX+":rect",e,n,t,a)},mxVmlCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){this.node=this.createRect(mxClient.VML_PREFIX+":roundrect",e,n,t,a),this.node.setAttribute("arcsize",Math.max(100*i/t,100*s/a)+"%")},mxVmlCanvas2D.prototype.ellipse=function(e,n,t,a){this.node=this.createRect(mxClient.VML_PREFIX+":oval",e,n,t,a)},mxVmlCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){var l=null;s?((l=this.createRect(mxClient.VML_PREFIX+":rect",e,n,t,a)).stroked="false",(e=document.createElement(mxClient.VML_PREFIX+":fill")).aspect=s?"atmost":"ignore",e.rotate="true",e.type="frame",e.src=i,l.appendChild(e)):(l=this.createRect(mxClient.VML_PREFIX+":image",e,n,t,a)).src=i,o&&r?l.style.rotation="180":o?l.style.flip="x":r&&(l.style.flip="y"),this.state.alpha<1&&(l.style.filter+="alpha(opacity="+100*this.state.alpha+")"),this.root.appendChild(l)},mxVmlCanvas2D.prototype.createDiv=function(e,n,t,a){t=document.createElement("div");var i=this.state,s="";return null!=i.fontBackgroundColor&&(s+="background-color:"+i.fontBackgroundColor+";"),null!=i.fontBorderColor&&(s+="border:1px solid "+i.fontBorderColor+";"),mxUtils.isNode(e)?t.appendChild(e):0<s.length&&!a?((a=document.createElement("div")).style.cssText=s,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,t.appendChild(a)):(t.style.cssText=s,t.innerHTML=e),(e=t.style).fontSize=Math.round(i.fontSize/this.vmlScale)+"px",e.fontFamily=i.fontFamily,e.color=i.fontColor,e.verticalAlign="top",e.textAlign=n||"left",e.lineHeight=Math.round(i.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale)+"px",(i.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e.fontWeight="bold"),(i.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e.fontStyle="italic"),(i.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(e.fontDecoration="underline"),t},mxVmlCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){var u=this.state;if("html"==l){null!=u.rotation&&(e=(n=this.rotatePoint(e,n,u.rotation,u.rotationCx,u.rotationCy)).x,n=n.y),8==document.documentMode?(e+=u.dx,n+=u.dy):(e*=u.scale,n*=u.scale),(l=8==document.documentMode?document.createElement(mxClient.VML_PREFIX+":group"):document.createElement("div")).style.position="absolute",l.style.display="inline",l.style.left=this.format(e)+"px",l.style.top=this.format(n)+"px",l.style.zoom=u.scale;var p=document.createElement("div");p.style.position="relative",p.style.display="inline";var g=(v=mxUtils.getAlignmentAsPoint(s,o)).x,v=v.y;if(i=this.createDiv(i,s,o,d),s=document.createElement("div"),r?(!c&&0<t&&(i.style.width=Math.round(t)+"px"),i.style.whiteSpace="normal"):i.style.whiteSpace="nowrap",r=u.rotation+(m||0),this.rotateHtml&&0!=r?(s.style.display="inline",s.style.zoom="1",s.appendChild(i),8==document.documentMode&&"DIV"!=this.root.nodeName?(p.appendChild(s),l.appendChild(p)):l.appendChild(s)):8==document.documentMode?(p.appendChild(i),l.appendChild(p)):(i.style.display="inline",l.appendChild(i)),"DIV"!=this.root.nodeName?((m=document.createElement(mxClient.VML_PREFIX+":rect")).stroked="false",m.filled="false",m.appendChild(l),this.root.appendChild(m)):this.root.appendChild(l),c?(i.style.overflow="hidden",0<t&&(i.style.width=Math.round(t)+"px"),0<a&&8==document.documentMode&&(i.style.maxHeight=Math.round(a)+"px")):d&&(i.style.width=t+"px",0<a&&(i.style.maxHeight=Math.round(a)+"px")),this.rotateHtml&&0!=r){t=r*(Math.PI/180),r=parseFloat(parseFloat(Math.cos(t)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-t)).toFixed(8)),(t%=2*Math.PI)<0&&(t+=2*Math.PI),(t%=Math.PI)>Math.PI/2&&(t=Math.PI-t),o=Math.cos(t);var h=Math.sin(t);8==document.documentMode&&(i.style.display="inline-block",s.style.display="inline-block",p.style.display="inline-block"),i.style.visibility="hidden",document.body.appendChild(i),t=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&(c||d)&&a<p&&(p=a,i.style.height=p+"px"),c=((a=p)-a*o+t*-h)/2-m*t*(g+.5)+r*a*(v+.5),d=(t-t*o+a*-h)/2+r*t*(g+.5)+m*a*(v+.5),"group"==l.nodeName&&"DIV"==this.root.nodeName?((g=document.createElement("div")).style.display="inline-block",g.style.position="absolute",g.style.left=this.format(e+(d-t/2)*u.scale)+"px",g.style.top=this.format(n+(c-a/2)*u.scale)+"px",l.parentNode.appendChild(g),g.appendChild(l)):(u=8==document.documentMode?1:u.scale,l.style.left=this.format(e+(d-t/2)*u)+"px",l.style.top=this.format(n+(c-a/2)*u)+"px"),s.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+m+", M21="+-m+", M22="+r+", sizingMethod='auto expand')",s.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(s.style.filter+="alpha(opacity="+100*this.state.alpha+")"),i.style.visibility="",s.appendChild(i)}else 8!=document.documentMode?(i.style.verticalAlign="top",this.state.alpha<1&&(l.style.filter="alpha(opacity="+100*this.state.alpha+")"),u=i.parentNode,i.style.visibility="hidden",document.body.appendChild(i),t=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&c&&a<p&&(p=a,i.style.height=p+"px"),a=p,i.style.visibility="",u.appendChild(i),l.style.left=this.format(e+t*g*this.state.scale)+"px",l.style.top=this.format(n+a*v*this.state.scale)+"px"):(this.state.alpha<1&&(i.style.filter="alpha(opacity="+100*this.state.alpha+")"),p.style.left=100*g+"%",p.style.top=100*v+"%")}else this.plainText(e,n,t,a,mxUtils.htmlEntities(i,!1),s,o,r,l,d,c,m)}},mxVmlCanvas2D.prototype.plainText=function(e,n,t,a,i,s,o,r,l,d,c,m){e=(e+(a=this.state).dx)*a.scale,n=(n+a.dy)*a.scale,(t=document.createElement(mxClient.VML_PREFIX+":shape")).style.width="1px",t.style.height="1px",t.stroked="false",(d=document.createElement(mxClient.VML_PREFIX+":fill")).color=a.fontColor,d.opacity=100*a.alpha+"%",t.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":path")).textpathok="true",d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),t.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":textpath")).style.cssText="v-text-align:"+s,d.style.align=s,d.style.fontFamily=a.fontFamily,d.string=i,d.on="true",s=Math.round(a.fontSize*a.scale/this.vmlScale),d.style.fontSize=s+"px",(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline"),a=s+((i=i.split("\n")).length-1)*s*mxConstants.LINE_HEIGHT,s=i=0,o==mxConstants.ALIGN_BOTTOM?s=-a/2:o!=mxConstants.ALIGN_MIDDLE&&(s=a/2),null!=m&&(o=(t.style.rotation=m)*(Math.PI/180),i=Math.sin(o)*s,s*=Math.cos(o)),t.appendChild(d),t.style.left=this.format(e-i)+"px",t.style.top=this.format(n+s)+"px",this.root.appendChild(t)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(e){this.states=e},mxGuide.prototype.isEnabledForEvent=function(e){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxGuide.prototype.createGuideShape=function(e){return(e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)).isDashed=!0,e},mxGuide.prototype.move=function(a,e,n){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=e){var t=this.graph.getView().translate,i=this.graph.getView().scale,s=e.x,o=e.y,r=!1,l=!1,d=f=this.getGuideTolerance(),c=f;(f=a.clone()).x+=e.x,f.y+=e.y;var m=f.x,u=f.x+f.width,p=f.getCenterX(),g=f.y,v=f.y+f.height,h=f.getCenterY();e=function(e){e+=this.graph.panDx;var n=!1;if(Math.abs(e-p)<d?(s=e-a.getCenterX(),d=Math.abs(e-p),n=!0):Math.abs(e-m)<d?(s=e-a.x,d=Math.abs(e-m),n=!0):Math.abs(e-u)<d&&(s=e-a.x-a.width,d=Math.abs(e-u),n=!0),n){null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()));var t=this.graph.container;e-=this.graph.panDx,this.guideX.points=[new mxPoint(e,-this.graph.panDy),new mxPoint(e,t.scrollHeight-3-this.graph.panDy)]}r=r||n};for(var f=function(e){e+=this.graph.panDy;var n=!1;if(Math.abs(e-h)<c?(o=e-a.getCenterY(),c=Math.abs(e-h),n=!0):Math.abs(e-g)<c?(o=e-a.y,c=Math.abs(e-g),n=!0):Math.abs(e-v)<c&&(o=e-a.y-a.height,c=Math.abs(e-v),n=!0),n){null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()));var t=this.graph.container;e-=this.graph.panDy,this.guideY.points=[new mxPoint(-this.graph.panDx,e),new mxPoint(t.scrollWidth-3-this.graph.panDx,e)]}l=l||n},b=0;b<this.states.length;b++){var A=this.states[b];null!=A&&(this.horizontal&&(e.call(this,A.getCenterX()),e.call(this,A.x),e.call(this,A.x+A.width)),this.vertical&&(f.call(this,A.getCenterY()),f.call(this,A.y),f.call(this,A.y+A.height)))}r||null==this.guideX?null!=this.guideX&&(this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",l||null==this.guideY?null!=this.guideY&&(this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",n&&(r||(n=a.x-(this.graph.snap(a.x/i-t.x)+t.x)*i,s=this.graph.snap(s/i)*i-n),l||(t=a.y-(this.graph.snap(a.y/i-t.y)+t.y)*i,o=this.graph.snap(o/i)*i-t)),e=new mxPoint(s,o)}return e},mxGuide.prototype.hide=function(){null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),null!=this.guideY&&(this.guideY.node.style.visibility="hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxStencil.defaultLocalized=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var e=this.desc.getAttribute("aspect");this.aspect=null!=e?e:"variable",e=this.desc.getAttribute("strokewidth"),this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var e=this.desc.getElementsByTagName("connections")[0];if(null!=e&&(null!=(e=mxUtils.getChildNodes(e))&&0<e.length)){this.constraints=[];for(var n=0;n<e.length;n++)this.constraints.push(this.parseConstraint(e[n]))}},mxStencil.prototype.parseConstraint=function(e){var n=Number(e.getAttribute("x")),t=Number(e.getAttribute("y"));return e="1"==e.getAttribute("perimeter"),new mxConnectionConstraint(new mxPoint(n,t),e)},mxStencil.prototype.evaluateTextAttribute=function(e,n,t){return n=this.evaluateAttribute(e,n,t),e=e.getAttribute("localized"),(mxStencil.defaultLocalized&&null==e||"1"==e)&&(n=mxResources.get(n)),n},mxStencil.prototype.evaluateAttribute=function(e,n,t){return null==(n=e.getAttribute(n))&&(null!=(e=mxUtils.getTextContent(e))&&("function"==typeof(e=mxUtils.eval(e))&&(n=e(t)))),n},mxStencil.prototype.drawShape=function(e,n,t,a,i,s){this.drawChildren(e,n,t,a,i,s,this.bgNode,!1),this.drawChildren(e,n,t,a,i,s,this.fgNode,!0)},mxStencil.prototype.drawChildren=function(e,n,t,a,i,s,o,r){if(null!=o){var l=mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,null);for(t=this.computeAspect(n.style,t,a,i,s,l),a=Math.min(t.width,t.height),a="inherit"==this.strokewidth?Number(mxUtils.getNumber(n.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a,e.setStrokeWidth(a),o=o.firstChild;null!=o;)o.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,n,o,t,r),o=o.nextSibling}},mxStencil.prototype.computeAspect=function(e,n,t,a,i,s){e=n,n=a/this.w0;var o=i/this.h0;if(s="north"==s||"south"==s){o=a/this.h0,n=i/this.w0;var r=(a-i)/2;e+=r,t-=r}return"fixed"==this.aspect&&(n=o=Math.min(n,o),s?(e+=(i-this.w0*n)/2,t+=(a-this.h0*o)/2):(e+=(a-this.w0*n)/2,t+=(i-this.h0*o)/2)),new mxRectangle(e,t,n,o)},mxStencil.prototype.drawNode=function(e,n,t,a,i){var s=t.nodeName,o=a.x,r=a.y,l=a.width,d=a.height,c=Math.min(l,d);if("save"==s)e.save();else if("restore"==s)e.restore();else if("path"==s)for(e.begin(),t=t.firstChild;null!=t;)t.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,n,t,a,i),t=t.nextSibling;else if("close"==s)e.close();else if("move"==s)e.moveTo(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("line"==s)e.lineTo(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("quad"==s)e.quadTo(o+Number(t.getAttribute("x1"))*l,r+Number(t.getAttribute("y1"))*d,o+Number(t.getAttribute("x2"))*l,r+Number(t.getAttribute("y2"))*d);else if("curve"==s)e.curveTo(o+Number(t.getAttribute("x1"))*l,r+Number(t.getAttribute("y1"))*d,o+Number(t.getAttribute("x2"))*l,r+Number(t.getAttribute("y2"))*d,o+Number(t.getAttribute("x3"))*l,r+Number(t.getAttribute("y3"))*d);else if("arc"==s)e.arcTo(Number(t.getAttribute("rx"))*l,Number(t.getAttribute("ry"))*d,Number(t.getAttribute("x-axis-rotation")),Number(t.getAttribute("large-arc-flag")),Number(t.getAttribute("sweep-flag")),o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("rect"==s)e.rect(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d);else if("roundrect"==s)0==(n=t.getAttribute("arcsize"))&&(n=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),c=Number(t.getAttribute("w"))*l,a=Number(t.getAttribute("h"))*d,n=Number(n)/100,n=Math.min(c*n,a*n),e.roundrect(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,c,a,n,n);else if("ellipse"==s)e.ellipse(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d);else if("image"==s)n=this.evaluateAttribute(t,"src",n),e.image(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d,n,!1,"1"==t.getAttribute("flipH"),"1"==t.getAttribute("flipV"));else if("text"==s){if(c=this.evaluateTextAttribute(t,"str",n),a="1"==t.getAttribute("vertical")?-90:0,"0"==t.getAttribute("align-shape")){var m=n.rotation,u=1==mxUtils.getValue(n.style,mxConstants.STYLE_FLIPH,0);n=1==mxUtils.getValue(n.style,mxConstants.STYLE_FLIPV,0),a=u&&n?a-m:u||n?a+m:a-m}a-=t.getAttribute("rotation"),e.text(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,0,0,c,t.getAttribute("align")||"left",t.getAttribute("valign")||"top",!1,"",!1,!1,a)}else if("include-shape"==s)null!=(m=mxStencilRegistry.getStencil(t.getAttribute("name")))&&(o+=Number(t.getAttribute("x"))*l,r+=Number(t.getAttribute("y"))*d,c=Number(t.getAttribute("w"))*l,a=Number(t.getAttribute("h"))*d,m.drawShape(e,n,o,r,c,a));else if("fillstroke"==s)e.fillAndStroke();else if("fill"==s)e.fill();else if("stroke"==s)e.stroke();else if("strokewidth"==s)e.setStrokeWidth(Number(t.getAttribute("width"))*c);else if("dashed"==s)e.setDashed("1"==t.getAttribute("dashed"));else if("dashpattern"==s){if(null!=(t=t.getAttribute("pattern"))){for(t=t.split(" "),l=[],d=0;d<t.length;d++)0<t[d].length&&l.push(Number(t[d])*c);t=l.join(" "),e.setDashPattern(t)}}else"strokecolor"==s?e.setStrokeColor(t.getAttribute("color")):"linecap"==s?e.setLineCap(t.getAttribute("cap")):"linejoin"==s?e.setLineJoin(t.getAttribute("join")):"miterlimit"==s?e.setMiterLimit(Number(t.getAttribute("limit"))):"fillcolor"==s?e.setFillColor(t.getAttribute("color")):"alpha"==s?e.setAlpha(t.getAttribute("alpha")):"fontcolor"==s?e.setFontColor(t.getAttribute("color")):"fontstyle"==s?e.setFontStyle(t.getAttribute("style")):"fontfamily"==s?e.setFontFamily(t.getAttribute("family")):"fontsize"==s&&e.setFontSize(Number(t.getAttribute("size"))*c);i&&("fillstroke"==s||"fill"==s||"stroke"==s)&&e.setShadow(!1)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.style=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=6,mxShape.prototype.pointerEvents=!0,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.init=function(e){null==this.node&&(this.node=this.create(e),null!=e&&e.appendChild(this.node))},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round(this.strokewidth*this.scale)),2)?.5:0},mxShape.prototype.create=function(e){return null!=e.ownerSVGElement?this.createSvg(e):8==document.documentMode||this.dialect==mxConstants.DIALECT_SVG||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(e):this.createVml(e)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e},mxShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.checkBounds()?(this.node.style.visibility="","DIV"==this.node.nodeName&&this.isHtmlAllowed()?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.updateBoundsFromPoints=function(){var e=this.points;if(null!=e&&0<e.length&&null!=e[0]){this.bounds=new mxRectangle(Number(e[0].x),Number(e[0].y),1,1);for(var n=1;n<this.points.length;n++)null!=e[n]&&this.bounds.add(new mxRectangle(Number(e[n].x),Number(e[n].y),1,1))}},mxShape.prototype.checkBounds=function(){return null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e.style.width=this.node.style.width,e.style.height=this.node.style.height,e},mxShape.prototype.redrawShape=function(){var e=this.createCanvas();for(e.pointerEvents=this.pointerEvents;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);this.paint(e),this.node!=e.root&&this.node.insertAdjacentHTML("beforeend",e.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",(null==this.stencil||!this.stencilPointerEvents)&&mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(e)},mxShape.prototype.createCanvas=function(){var e=null,n=null;if(null!=this.node.ownerSVGElement)(e=new mxSvgCanvas2D(this.node,!1)).strokeTolerance=this.svgStrokeTolerance,e.blockImagePointerEvents=mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC,0!=(n=this.getSvgScreenOffset())?this.node.setAttribute("transform","translate("+n+","+n+")"):this.node.removeAttribute("transform");else{this.updateVmlContainer();var t=Math.max(1,Math.round(this.bounds.width)),a=Math.max(1,Math.round(this.bounds.height));n=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(n,!1);""!=n.tagUrn&&(n.coordsize=t*this.vmlScale+","+a*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale),n=this.scale,e.translate(-Math.round(this.bounds.x/n),-Math.round(this.bounds.y/n))}return e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var e=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));this.node.style.width=e+"px",this.node.style.height=n+"px",this.node.style.overflow="visible"},mxShape.prototype.destroyCanvas=function(e){if(e instanceof mxSvgCanvas2D){for(var n in e.gradients){var t=e.gradients[n];t.mxRefCount=(t.mxRefCount||0)+1}this.releaseSvgGradients(this.oldGradients),this.oldGradients=e.gradients}},mxShape.prototype.paint=function(e){var n=this.scale,t=this.bounds.x/n,a=this.bounds.y/n,i=this.bounds.width/n,s=this.bounds.height/n;if(this.isPaintBoundsInverted()){t=t+(o=(i-s)/2),a=a-o;var o=i;i=s,s=o}if(this.updateTransform(e,t,a,i,s),this.configureCanvas(e,t,a,i,s),null!=this.stencil)this.paintStencilShape(e,t,a,i,s);else if(e.setStrokeWidth(this.strokewidth),null!=this.points){for(t=[],a=0;a<this.points.length;a++)t.push(new mxPoint(this.points[a].x/n,this.points[a].y/n));this.paintEdgeShape(e,t)}else this.paintVertexShape(e,t,a,i,s)},mxShape.prototype.configureCanvas=function(e,n,t,a,i){var s=null;null!=this.style&&(s=this.style.dashPattern),e.setAlpha(this.opacity/100),null!=this.isShadow&&e.setShadow(this.isShadow),null!=this.isDashed&&e.setDashed(this.isDashed),null!=s&&e.setDashPattern(s),null!=this.gradient?(n=this.getGradientBounds(e,n,t,a,i),e.setGradient(this.fill,this.gradient,n.x,n.y,n.width,n.height,this.gradientDirection)):e.setFillColor(this.fill),e.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(e,n,t,a,i){return new mxRectangle(n,t,a,i)},mxShape.prototype.updateTransform=function(e,n,t,a,i){e.scale(this.scale),e.rotate(this.getShapeRotation(),this.flipH,this.flipV,n+a/2,t+i/2)},mxShape.prototype.paintStencilShape=function(e,n,t,a,i){this.stencilPointerEvents&&(this.dialect==mxConstants.DIALECT_SVG?this.addTransparentBackgroundRectangle(this.node,n,t,a,i):8!=document.documentMode&&this.setTransparentBackgroundImage(this.node)),this.stencil.drawShape(e,this,n,t,a,i)},mxShape.prototype.paintVertexShape=function(e,n,t,a,i){this.paintBackground(e,n,t,a,i),e.setShadow(!1),this.paintForeground(e,n,t,a,i)},mxShape.prototype.paintBackground=function(e,n,t,a,i){},mxShape.prototype.paintForeground=function(e,n,t,a,i){},mxShape.prototype.paintEdgeShape=function(e,n){},mxShape.prototype.getArcSize=function(e,n){var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(e*t,n*t)},mxShape.prototype.paintGlassEffect=function(e,n,t,a,i,s){var o=Math.ceil(this.strokewidth/2);e.setGradient("#ffffff","#ffffff",n,t,a,.6*i,"south",.9,.1),e.begin(),s+=2*o,this.isRounded?(e.moveTo(n-o+s,t-o),e.quadTo(n-o,t-o,n-o,t-o+s),e.lineTo(n-o,t+.4*i),e.quadTo(n+.5*a,t+.7*i,n+a+o,t+.4*i),e.lineTo(n+a+o,t-o+s),e.quadTo(n+a+o,t-o,n+a+o-s,t-o)):(e.moveTo(n-o,t-o),e.lineTo(n-o,t+.4*i),e.quadTo(n+.5*a,t+.7*i,n+a+o,t+.4*i),e.lineTo(n+a+o,t-o)),e.close(),e.fill()},mxShape.prototype.apply=function(e){this.state=e,this.style=e.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),"north"!=this.direction&&"south"!=this.direction||(e=this.flipH,this.flipH=this.flipV,this.flipV=e),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),"none"==this.fill&&(this.fill=null),"none"==this.gradient&&(this.gradient=null),"none"==this.stroke&&(this.stroke=null))},mxShape.prototype.setCursor=function(e){null==e&&(e=""),this.cursor=e,null!=this.node&&(this.node.style.cursor=e)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.updateBoundingBox=function(){if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n)),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height)}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var e=this.bounds.clone();if(this.isPaintBoundsInverted()){var n=(e.width-e.height)/2;e.x+=n,e.y-=n,n=e.width,e.width=e.height,e.height=n}return e},mxShape.prototype.augmentBoundingBox=function(e){this.isShadow&&(e.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),e.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));var n=Math.ceil(this.strokewidth*this.scale);e.grow(Math.ceil(n/2))},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&("north"==this.direction||"south"==this.direction)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var e=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxShape.prototype.getShapeRotation=function(){var e=this.getRotation();return null!=this.direction&&("north"==this.direction?e+=270:"west"==this.direction?e+=180:"south"==this.direction&&(e+=90)),e},mxShape.prototype.addTransparentBackgroundRectangle=function(e,n,t,a,i){(e=document.createElementNS(mxConstants.NS_SVG,"rect")).setAttribute("x",n),e.setAttribute("y",t),e.setAttribute("width",a),e.setAttribute("height",i),e.setAttribute("fill","none"),e.setAttribute("stroke","none"),e.setAttribute("pointer-events","all"),this.node.appendChild(e)},mxShape.prototype.setTransparentBackgroundImage=function(e){e.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(e){if(null!=e)for(var n in e){var t=e[n];t.mxRefCount=(t.mxRefCount||0)-1,0==t.mxRefCount&&null!=t.parentNode&&t.parentNode.removeChild(t)}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null};var mxStencilRegistry={stencils:[],addStencil:function(e,n){mxStencilRegistry.stencils[e]=n},getStencil:function(e){return mxStencilRegistry.stencils[e]}},mxMarker={markers:[],addMarker:function(e,n){mxMarker.markers[e]=n},createMarker:function(e,n,t,a,i,s,o,r,l,d){var c=mxMarker.markers[t];return null!=c?c(e,n,t,a,i,s,o,r,l,d):null}};function mxActor(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxCloud(e,n,t,a){mxActor.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxRectangleShape(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxEllipse(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxDoubleEllipse(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxRhombus(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxPolyline(e,n,t){mxShape.call(this),this.points=e,this.stroke=n,this.strokewidth=null!=t?t:1}function mxArrow(e,n,t,a,i,s,o){mxShape.call(this),this.points=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1,this.arrowWidth=null!=i?i:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxText(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A){mxShape.call(this),this.value=e,this.bounds=n,this.color=null!=i?i:"black",this.align=null!=t?t:"",this.valign=null!=a?a:"",this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(l||2),this.spacingTop=this.spacing+parseInt(d||0),this.spacingRight=this.spacing+parseInt(c||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(u||0),this.horizontal=null==p||p,this.background=g,this.border=v,this.wrap=null!=h&&h,this.clipped=null!=f&&f,this.overflow=null!=b?b:"visible",this.labelPadding=null!=A?A:0,this.rotation=0}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(e,n,t){mxShape.call(this),this.bounds=e,this.stroke=n,this.strokewidth=null!=t?t:1}function mxImageShape(e,n,t,a,i){mxShape.call(this),this.bounds=e,this.image=n,this.fill=t,this.stroke=a,this.strokewidth=null!=i?i:1,this.shadow=!1}function mxLabel(e,n,t,a){mxRectangleShape.call(this,e,n,t,a)}function mxCylinder(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxConnector(e,n,t){mxPolyline.call(this,e,n,t)}function mxSwimlane(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxGraphLayout(e){this.graph=e}function mxStackLayout(e,n,t,a,i,s){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.spacing=null!=t?t:0,this.x0=null!=a?a:0,this.y0=null!=i?i:0,this.border=null!=s?s:0}function mxPartitionLayout(e,n,t,a){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.spacing=t||0,this.border=a||0}function mxCompactTreeLayout(e,n,t){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.invert=null!=t&&t}function WeightedCellSorter(e,n){this.cell=e,this.weightedValue=n}function mxFastOrganicLayout(e){mxGraphLayout.call(this,e)}function mxCircleLayout(e,n){mxGraphLayout.call(this,e),this.radius=null!=n?n:100}function mxParallelEdgeLayout(e){mxGraphLayout.call(this,e)}function mxCompositeLayout(e,n,t){mxGraphLayout.call(this,e),this.layouts=n,this.master=t}function mxEdgeLabelLayout(e,n){mxGraphLayout.call(this,e)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=e}function mxGraphHierarchyEdge(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=e}function mxGraphHierarchyModel(e,n,t,a,i){for(e.getGraph(),this.tightenToSource=i,this.roots=t,this.parent=a,this.vertexMapper={},this.edgeMapper={},this.maxRank=0,t=[],null==n&&(n=this.graph.getChildVertices(a)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(e,n,t),a=0;a<n.length;a++){i=t[a].connectsAsSource;for(var s=0;s<i.length;s++){var o=i[s];if(null!=(r=o.edges)&&0<r.length){var r=r[0],l=e.getVisibleTerminal(r,!1);l=mxCellPath.create(l),l=this.vertexMapper[l];t[a]==l&&(l=e.getVisibleTerminal(r,!0),l=mxCellPath.create(l),l=this.vertexMapper[l]),null!=l&&t[a]!=l&&(0==(o.target=l).connectsAsTarget.length&&(l.connectsAsTarget=[]),mxUtils.indexOf(l.connectsAsTarget,o)<0&&l.connectsAsTarget.push(o))}}t[a].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(e){this.layout=e}function MedianCellSorter(){}function mxMinimumCycleRemover(e){this.layout=e}function mxCoordinateAssignment(e,n,t,a,i,s){this.layout=e,this.intraCellSpacing=n,this.interRankCellSpacing=t,this.orientation=a,this.initialX=i,this.parallelEdgeSpacing=s}!function(){function e(e,n,t,a,i,s,o,r,l,d){n=1.118*i*l,r=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=n,c.y-=r,o=t!=mxConstants.ARROW_CLASSIC?1:.75,a.x+=-i*o-n,a.y+=-s*o-r,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i-s/2,c.y-s+i/2),t==mxConstants.ARROW_CLASSIC&&e.lineTo(c.x-3*i/4,c.y-3*s/4),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.close(),d?e.fillAndStroke():e.stroke()}}function n(e,n,t,a,i,s,o,r,l,d){r=t==mxConstants.ARROW_DIAMOND?.7071:.9862,n=i*l*r,r*=s*l,i*=o+l,s*=o+l;var c=a.clone();c.x-=n,c.y-=r,a.x+=-i-n,a.y+=-s-r;var m=t==mxConstants.ARROW_DIAMOND?2:3.4;return function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i/2-s/m,c.y+i/m-s/2),e.lineTo(c.x-i,c.y-s),e.lineTo(c.x-i/2+s/m,c.y-s/2-i/m),e.close(),d?e.fillAndStroke():e.stroke()}}mxMarker.addMarker("classic",e),mxMarker.addMarker("block",e),mxMarker.addMarker("open",function(e,n,t,a,i,s,o,r,l,d){n=1.118*i*l,t=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=n,c.y-=t,a.x+=2*-n,a.y+=2*-t,function(){e.begin(),e.moveTo(c.x-i-s/2,c.y-s+i/2),e.lineTo(c.x,c.y),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.stroke()}}),mxMarker.addMarker("oval",function(e,n,t,a,i,s,o,r,l,d){var c=o/2,m=a.clone();return a.x-=i*c,a.y-=s*c,function(){e.ellipse(m.x-c,m.y-c,o,o),d?e.fillAndStroke():e.stroke()}}),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(e,n,t,a,i){e.translate(n,t),e.begin(),this.redrawPath(e,n,t,a,i),e.fillAndStroke()},mxActor.prototype.redrawPath=function(e,n,t,a,i){n=a/3,e.moveTo(0,i),e.curveTo(0,3*i/5,0,2*i/5,a/2,2*i/5),e.curveTo(a/2-n,2*i/5,a/2-n,0,a/2,0),e.curveTo(a/2+n,0,a/2+n,2*i/5,a/2,2*i/5),e.curveTo(a,2*i/5,a,3*i/5,a,i),e.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(.25*a,.25*i),e.curveTo(.05*a,.25*i,0,.5*i,.16*a,.55*i),e.curveTo(0,.66*i,.18*a,.9*i,.31*a,.8*i),e.curveTo(.4*a,i,.7*a,i,.8*a,.8*i),e.curveTo(a,.8*i,a,.6*i,.875*a,.5*i),e.curveTo(a,.3*i,.8*a,.1*i,.625*a,.2*i),e.curveTo(.5*a,.05*i,.3*a,.05*i,.25*a,.25*i),e.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.isRounded&&!this.glass&&0==this.rotation},mxRectangleShape.prototype.paintBackground=function(e,n,t,a,i){if(this.isRounded){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;s=Math.min(a*s,i*s);e.roundrect(n,t,a,i,s,s)}else e.rect(n,t,a,i);e.fillAndStroke()},mxRectangleShape.prototype.paintForeground=function(e,n,t,a,i){this.glass&&this.paintGlassEffect(e,n,t,a,i,this.getArcSize(a+this.strokewidth,i+this.strokewidth))},mxRectangleShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxRectangleShape.prototype.updateHtmlBounds=function(e){var n=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);e.style.borderWidth=Math.max(1,n)+"px",e.style.overflow="hidden",e.style.left=Math.round(this.bounds.x-n/2)+"px",e.style.top=Math.round(this.bounds.y-n/2)+"px","CSS1Compat"==document.compatMode&&(n=-n),e.style.width=Math.round(Math.max(0,this.bounds.width+n))+"px",e.style.height=Math.round(Math.max(0,this.bounds.height+n))+"px"},mxRectangleShape.prototype.updateHtmlColors=function(e){var n=this.stroke;null!=n&&n!=mxConstants.NONE?(e.style.borderColor=n,this.isDashed?e.style.borderStyle="dashed":0<this.strokewidth&&(e.style.borderStyle="solid"),e.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):e.style.borderWidth="0px",null!=(n=this.fill)&&n!=mxConstants.NONE?(e.style.backgroundColor=n,e.style.backgroundImage="none"):this.pointerEvents?e.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(e):this.setTransparentBackgroundImage(e)},mxRectangleShape.prototype.updateHtmlFilters=function(e){var n="";if(this.opacity<100&&(n+="alpha(opacity="+this.opacity+")"),this.isShadow&&(n+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.SHADOWCOLOR+"')"),this.gradient){var t=this.fill,a=this.gradient,i="0",s={east:0,south:1,west:2,north:3},o=null!=this.direction?s[this.direction]:0;null!=this.gradientDirection&&(o=mxUtils.mod(o+s[this.gradientDirection]-1,4)),1==o?(i="1",s=t,t=a,a=s):2==o?(s=t,t=a,a=s):3==o&&(i="1"),n+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+t+"', endColorStr='"+a+"', gradientType='"+i+"')"}e.style.filter=n},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(e,n,t,a,i){e.ellipse(n,t,a,i),e.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(e,n,t,a,i){e.ellipse(n,t,a,i),e.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(e,n,t,a,i){var s=Math.min(4,Math.min(a/5,i/5));i-=2*s,0<(a-=2*s)&&0<i&&e.ellipse(n+s,t+s,a,i),e.stroke()},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(e,n,t,a,i){var s=a/2,o=i/2;e.begin(),e.moveTo(n+s,t),e.lineTo(n+a,t+o),e.lineTo(n+s,t+i),e.lineTo(n,t+o),e.close(),e.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.paintEdgeShape=function(e,n){this.paintLine(e,n,this.isRounded)},mxPolyline.prototype.paintLine=function(e,n,t){var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,i=n[0],s=n[n.length-1];e.begin(),e.moveTo(i.x,i.y);for(var o=1;o<n.length-1;o++){var r=n[o],l=i.x-r.x;i=i.y-r.y;if(t&&o<n.length-1&&(0!=l||0!=i)){var d=Math.sqrt(l*l+i*i);l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d;e.lineTo(r.x+l,r.y+i),l=(i=n[o+1]).x-r.x,i=i.y-r.y,d=Math.max(1,Math.sqrt(l*l+i*i)),l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d,l=r.x+l,i=r.y+i,e.quadTo(r.x,r.y,l,i),r=new mxPoint(l,i)}else e.lineTo(r.x,r.y);i=r}e.lineTo(s.x,s.y),e.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.paintEdgeShape=function(e,n){var t=mxConstants.ARROW_SPACING,a=mxConstants.ARROW_WIDTH,i=mxConstants.ARROW_SIZE,s=n[0],o=n[n.length-1],r=o.x-s.x,l=o.y-s.y,d=(c=Math.sqrt(r*r+l*l))-2*t-i,c=(r=r/c,a*(l=l/c)/3),m=(a=-a*r/3,(i=s.x-c/2+t*r)+c),u=(s=s.y-a/2+t*l)+a,p=m+d*r,g=p+c,v=(d=u+d*l)+a,h=g-3*c,f=v-3*a;e.begin(),e.moveTo(i,s),e.lineTo(m,u),e.lineTo(p,d),e.lineTo(g,v),e.lineTo(o.x-t*r,o.y-t*l),e.lineTo(h,f),e.lineTo(h+c,f+a),e.close(),e.fillAndStroke()},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!(null==this.bounds||isNaN(this.bounds.x)||isNaN(this.bounds.y)||isNaN(this.bounds.width)||isNaN(this.bounds.height))},mxText.prototype.updateBoundingBox=function(){var e=this.node;8==document.documentMode&&null!=e.firstChild&&(null!=(e=e.firstChild).firstChild&&(e=e.firstChild)),this.boundingBox=this.bounds.clone();var n=this.getTextRotation();if(this.ignoreStringSize||null==e||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize)this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height;else{var t=null,a=null;if(null!=e.ownerSVGElement)if(null!=e.firstChild&&null!=e.firstChild.firstChild&&"foreignObject"==e.firstChild.firstChild.nodeName)e=e.firstChild.firstChild,t=this.wrap?this.bounds.width:parseInt(e.getAttribute("width"))*this.scale,a=parseInt(e.getAttribute("height"))*this.scale;else{if(0==(n=e.getBBox()).width&&0==n.height)return;this.boundingBox=new mxRectangle(n.x,n.y,n.width,n.height),n=0}else a=this.state.view.textDiv,a=null!=this.offsetWidth&&null!=this.offsetHeight?(t=this.wrap?this.bounds.width:this.offsetWidth*this.scale,this.offsetHeight*this.scale):null!=a?(this.updateFont(a),this.updateSize(a),mxUtils.isNode(this.value)?a.innerHTML=this.value.outerHTML:(t=this.replaceLinefeeds?this.value.replace(/\n/g,"<br/>"):this.value,a.innerHTML=t),t=this.wrap?this.bounds.width:a.offsetWidth*this.scale,a.offsetHeight*this.scale):(t=this.wrap?this.bounds.width:e.offsetWidth*this.scale,e.offsetHeight*this.scale);null!=t&&null!=a&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*t,this.bounds.y+this.margin.y*a,t,a))}null!=this.boundingBox&&(0!=n&&(n=mxUtils.getBoundingBox(this.boundingBox,n),this.boundingBox.x=n.x,this.boundingBox.y=n.y,mxClient.IS_QUIRKS||(this.boundingBox.width=n.width,this.boundingBox.height=n.height)),this.boundingBox.x=Math.floor(this.boundingBox.x),this.boundingBox.y=Math.floor(this.boundingBox.y),this.boundingBox.width=Math.ceil(this.boundingBox.width),this.boundingBox.height=Math.ceil(this.boundingBox.height))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(e,n,t,a,i){mxShape.prototype.configureCanvas.apply(this,arguments),e.setFontColor(this.color),e.setFontBackgroundColor(this.background),e.setFontBorderColor(this.border),e.setFontFamily(this.family),e.setFontSize(this.size),e.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.paint=function(e){var n=this.scale,t=this.bounds.x/n,a=this.bounds.y/n,i=this.bounds.width/n;n=this.bounds.height/n;this.updateTransform(e,t,a,i,n),this.configureCanvas(e,t,a,i,n);var s=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=s||e instanceof mxVmlCanvas2D?"html":"",r=this.value;!s&&"html"==o&&(r=mxUtils.htmlEntities(r,!1)),r=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==o?r.replace(/\n/g,"<br/>"):r,e.text(t,a,i,n,r,this.align,this.valign,this.wrap,o,"fill"==this.overflow,this.clipped,this.getTextRotation())},mxText.prototype.redrawHtmlShape=function(){var e=this.node.style;e.opacity=this.opacity<1?this.opacity:"",e.overflow="",e.width="",e.height="",this.updateFont(this.node),this.updateSize(this.node),this.updateValue(),this.offsetHeight=this.offsetWidth=null,null!=mxClient.CSS_PREFIX?this.updateHtmlTransform():this.updateHtmlFilter()},mxText.prototype.updateHtmlTransform=function(){var e=this.getTextRotation(),n=this.node.style,t=this.margin.x,a=this.margin.y;0!=e?(n[mxClient.CSS_PREFIX+"TransformOrigin"]=100*-t+"% "+100*-a+"%",n[mxClient.CSS_PREFIX+"Transform"]="translate("+100*t+"%,"+100*a+"%)scale("+this.scale+") rotate("+e+"deg)"):(n[mxClient.CSS_PREFIX+"TransformOrigin"]="0% 0%",n[mxClient.CSS_PREFIX+"Transform"]="scale("+this.scale+")translate("+100*t+"%,"+100*a+"%)"),n.left=Math.round(this.bounds.x)+"px",n.top=Math.round(this.bounds.y)+"px"},mxText.prototype.updateHtmlFilter=function(){var e=this.node.style,n=this.margin.x,t=this.margin.y,a=this.scale;e.filter="";var i=0,s=0;if(null!=(r=null!=this.state?this.state.view.textDiv:null)){if(r.style.overflow="",r.style.height="",r.style.width="",this.updateFont(r),this.updateSize(r),mxUtils.isNode(this.value))r.innerHTML=this.value.outerHTML;else{var o=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(o=mxUtils.htmlEntities(o,!1)),o=this.replaceLinefeeds?o.replace(/\n/g,"<br/>"):o,r.innerHTML=o}i=r.offsetWidth+2,s=r.offsetHeight+2}else i=this.node.offsetWidth,s=this.node.offsetHeight+1;this.offsetWidth=i,this.offsetHeight=s,r=this.bounds.width/a,o=this.bounds.height/a,mxClient.IS_QUIRKS&&(this.clipped||"fill"==this.overflow)&&0<o?(o=Math.min(o,s),e.height=Math.round(o+1)+"px"):o=s,"fill"!=this.overflow&&(mxClient.IS_QUIRKS&&(this.clipped||this.wrap)&&0<r?(r=Math.min(r,i),e.width=Math.round(r)+"px"):r=i);o*=a;var r=r*a,l=(i=this.getTextRotation()*(Math.PI/180),s=parseFloat(parseFloat(Math.cos(i)).toFixed(8)),parseFloat(parseFloat(Math.sin(-i)).toFixed(8)));(i=i%(2*Math.PI))<0&&(i+=2*Math.PI),(i%=Math.PI)>Math.PI/2&&(i=Math.PI-i);var d=Math.cos(i),c=Math.sin(-i),m=(o-o*d+r*c)/2+l*(n=r*-(n+.5))-s*(t=o*-(t+.5));0!=i&&(e.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+s+", M12="+l+", M21="+-l+", M22="+s+", sizingMethod='auto expand')"),e.zoom=a,e.left=Math.round(this.bounds.x+((r-r*d+o*c)/2-s*n-l*t)-r/2)+"px",e.top=Math.round(this.bounds.y+m-o/2)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1));e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var n=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,t=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if(null!=n||null!=t)if("fill"==this.overflow)null!=n&&(this.node.style.backgroundColor=n),null!=t&&(this.node.style.border="1px solid "+t);else{var a="";null!=n&&(a+="background-color:"+n+";"),null!=t&&(a+="border:1px solid "+t+";"),e='<div style="zoom:1;'+a+"display:inline-block;_display:inline;padding-bottom:1px;padding-right:1px;line-height:"+this.node.style.lineHeight+'">'+e+"</div>",this.node.style.lineHeight=""}this.node.innerHTML=e}},mxText.prototype.updateFont=function(e){(e=e.style).lineHeight=Math.round(this.size*mxConstants.LINE_HEIGHT)+"px",e.fontSize=Math.round(this.size)+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,e.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",e.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",e.fontDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?"underline":"",e.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"},mxText.prototype.updateSize=function(e){var n=Math.round(this.bounds.width/this.scale),t=Math.round(this.bounds.height/this.scale);e=e.style,this.clipped?(e.overflow="hidden",0<t&&(e.maxHeight=t+"px"),0<n&&(e.width=n+"px")):"fill"==this.overflow&&(e.width=n+"px",0<t&&(e.maxHeight=t+"px")),this.wrap?(!this.clipped&&0<n&&(e.width=n+"px"),e.whiteSpace="normal"):e.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(0,0),e.lineTo(a,.5*i),e.lineTo(0,i),e.close()},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(.25*a,0),e.lineTo(.75*a,0),e.lineTo(a,.5*i),e.lineTo(.75*a,i),e.lineTo(.25*a,i),e.lineTo(0,.5*i),e.close()},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(e,n,t,a,i){t+=i/2,e.begin(),e.moveTo(n,t),e.lineTo(n+a,t),e.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return mxClient.IS_IE?0:.5},mxImageShape.prototype.apply=function(e){mxShape.prototype.apply.apply(this,arguments),this.gradient=this.stroke=this.fill=null,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER),this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxImageShape.prototype.paintVertexShape=function(e,n,t,a,i){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null==s&&null==o||(e.setFillColor(s),e.setStrokeColor(o),e.rect(n,t,a,i),e.fillAndStroke()),e.image(n,t,a,i,this.image,this.preserveImageAspect,!1,!1)}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.style.backgroundColor=this.fill||"",this.node.style.borderColor=this.stroke||"",this.node.innerHTML="",null!=this.image){var e=document.createElement(mxClient.IS_IE6||null==mxClient.CSS_PREFIX&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");e.style.position="absolute",e.src=this.image;var n=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=n,this.flipH&&this.flipV?n+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?n+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(n+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),e.style.filter!=n&&(e.style.filter=n),"image"==e.nodeName?e.style.rotation=this.rotation:e.style[mxClient.CSS_PREFIX+"Transform"]="rotate("+this.rotation+"deg)",e.style.width=this.node.style.width,e.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(e)}else this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(e){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorColor&&null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.bounds=this.bounds,this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(e,n,t,a,i){this.paintImage(e,n,t,a,i),this.paintIndicator(e,n,t,a,i),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(e,n,t,a,i){null!=this.image&&(n=this.getImageBounds(n,t,a,i),e.image(n.x,n.y,n.width,n.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(e,n,t,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return new mxRectangle(e=i==mxConstants.ALIGN_CENTER?e+(t-o)/2:i==mxConstants.ALIGN_RIGHT?e+(t-o-l):e+l,n=s==mxConstants.ALIGN_TOP?n+l:s==mxConstants.ALIGN_BOTTOM?n+(a-r-l):n+(a-r)/2,o,r)},mxLabel.prototype.paintIndicator=function(e,n,t,a,i){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(n,t,a,i),this.indicator.paint(e)):null!=this.indicatorImage&&(n=this.getIndicatorBounds(n,t,a,i),e.image(n.x,n.y,n.width,n.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(e,n,t,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;return new mxRectangle(e=i==mxConstants.ALIGN_RIGHT?e+(t-o-l):i==mxConstants.ALIGN_CENTER?e+(t-o)/2:e+l,n=s==mxConstants.ALIGN_BOTTOM?n+(a-r-l):s==mxConstants.ALIGN_TOP?n+l:n+(a-r)/2,o,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var e=document.createElement("img");e.style.position="relative",e.setAttribute("border","0");var n=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);n.x-=this.bounds.x,n.y-=this.bounds.y,e.style.left=Math.round(n.x)+"px",e.style.top=Math.round(n.y)+"px",e.style.width=Math.round(n.width)+"px",e.style.height=Math.round(n.height)+"px",e.src=this.image,this.node.appendChild(e)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(e,n,t,a,i){e.translate(n,t),e.begin(),this.redrawPath(e,n,t,a,i,!1),e.fillAndStroke(),e.setShadow(!1),e.begin(),this.redrawPath(e,n,t,a,i,!0),e.stroke()},mxCylinder.prototype.redrawPath=function(e,n,t,a,i,s){n=Math.min(this.maxHeight,Math.round(i/5)),(s&&null!=this.fill||!s&&null==this.fill)&&(e.moveTo(0,n),e.curveTo(0,2*n,a,2*n,a,n),s||(e.stroke(),e.begin())),s||(e.moveTo(0,n),e.curveTo(0,-n/3,a,-n/3,a,n),e.lineTo(a,i-n),e.curveTo(a,i+n/3,0,i+n/3,0,i-n),e.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.paintEdgeShape=function(e,n){var t=this.createMarker(e,n,!0),a=this.createMarker(e,n,!1);null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(e,n,this.isRounded):this.paintCurvedLine(e,n),e.setFillColor(this.stroke),e.setShadow(!1),e.setDashed(!1),null!=t&&t(),null!=a&&a()},mxConnector.prototype.paintCurvedLine=function(e,n){e.begin();var t=n[0],a=n.length;for(e.moveTo(t.x,t.y),t=1;t<a-2;t++){var i=n[t],s=n[t+1];e.quadTo(i.x,i.y,(i.x+s.x)/2,(i.y+s.y)/2)}i=n[a-2],s=n[a-1],e.quadTo(i.x,i.y,s.x,s.y),e.stroke()},mxConnector.prototype.createMarker=function(e,n,t){var a=n.length,i=t?n[1]:n[a-2],s=(a=(n=t?n[0]:n[a-1]).x-i.x,n.y-i.y),o=(i=a/(o=Math.max(1,Math.sqrt(a*a+s*s))),a=s/o,s=mxUtils.getNumber(this.style,t?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),mxUtils.getValue(this.style,t?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW));return mxMarker.createMarker(e,this,o,n,i,a,s,t,this.strokewidth,0!=this.style[t?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL])},mxConnector.prototype.augmentBoundingBox=function(e){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var n=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(n=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(n=Math.max(n,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),e.grow(Math.ceil(n*this.scale))},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.getGradientBounds=function(e,n,t,a,i){return new mxRectangle(n,t,a,Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)))},mxSwimlane.prototype.getRotation=function(){var e=mxShape.prototype.getRotation.apply(this,arguments);return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxSwimlane.prototype.getTextRotation=function(){return this.getRotation()},mxSwimlane.prototype.isPaintBoundsInverted=function(){return mxShape.prototype.isPaintBoundsInverted.apply(this,arguments)||1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.getArcSize=function(e,n,t){return 3*t*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)},mxSwimlane.prototype.paintVertexShape=function(e,n,t,a,i){var s=Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0;e.translate(n,t),this.isRounded?(l=this.getArcSize(a,i,s),this.paintRoundedSwimlane(e,n,t,a,i,s,l,o,r)):this.paintSwimlane(e,n,t,a,i,s,o,r),o=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE),this.paintSeparator(e,a,s,i,o),null!=this.image&&(i=this.getImageBounds(n,s,a,i),e.image(i.x-n,i.y-t,i.width,i.height,this.image,!1,!1,!1)),this.glass&&(e.setShadow(!1),this.paintGlassEffect(e,0,0,a,s,l))},mxSwimlane.prototype.paintSwimlane=function(e,n,t,a,i,s,o,r){o!=mxConstants.NONE&&(e.save(),e.setFillColor(o),e.rect(0,0,a,i),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(0,s),e.lineTo(0,0),e.lineTo(a,0),e.lineTo(a,s),r&&e.close(),e.fillAndStroke(),s<i&&o==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i),e.lineTo(a,i),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintRoundedSwimlane=function(e,n,t,a,i,s,o,r,l){r!=mxConstants.NONE&&(e.save(),e.setFillColor(r),e.roundrect(0,0,a,i,o,o),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(a,s),e.lineTo(a,o),e.quadTo(a,0,a-Math.min(a/2,o),0),e.lineTo(Math.min(a/2,o),0),e.quadTo(0,0,0,o),e.lineTo(0,s),l&&e.close(),e.fillAndStroke(),s<i&&r==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i-o),e.quadTo(0,i,Math.min(a/2,o),i),e.lineTo(a-Math.min(a/2,o),i),e.quadTo(a,i,a,i-o),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintSeparator=function(e,n,t,a,i){i!=mxConstants.NONE&&(e.setStrokeColor(i),e.setDashed(!0),e.begin(),e.moveTo(n,t),e.lineTo(n,a),e.stroke(),e.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(e,n,t,a){return new mxRectangle(e+t-this.imageSize,n,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(e,n,t){},mxGraphLayout.prototype.execute=function(e){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(e,n,t,a){return null!=(n=null!=(t=this.graph.view.getState(n))?t.style:this.graph.getCellStyle(n))?n[e]:null},mxGraphLayout.traverse=function(e,n,t,a,i){if(null!=t&&null!=e){n=null==n||n,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=t(i[s]=e,a))||a)&&0<(a=this.graph.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.graph.model.getEdgeAt(e,s),r=this.graph.model.getTerminal(o,!0)==e;n&&!r||(r=this.graph.view.getVisibleTerminal(o,!r),this.traverse(r,n,t,o,i))}}},mxGraphLayout.prototype.isVertexMovable=function(e){return this.graph.isCellMovable(e)},mxGraphLayout.prototype.isVertexIgnored=function(e){return!this.graph.getModel().isVertex(e)||!this.graph.isCellVisible(e)},mxGraphLayout.prototype.isEdgeIgnored=function(e){var n=this.graph.getModel();return!n.isEdge(e)||!this.graph.isCellVisible(e)||null==n.getTerminal(e,!0)||null==n.getTerminal(e,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(e,n){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,n?"0":"1",[e])},mxGraphLayout.prototype.setOrthogonalEdge=function(e,n){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,n?"1":"0",[e])},mxGraphLayout.prototype.getParentOffset=function(e){var n=new mxPoint;if(null!=e&&e!=this.parent){var t=this.graph.getModel();if(t.isAncestor(this.parent,e))for(var a=t.getGeometry(e);e!=this.parent;)n.x+=a.x,n.y+=a.y,e=t.getParent(e),a=t.getGeometry(e)}return n},mxGraphLayout.prototype.setEdgePoints=function(e,n){if(null!=e){var t=this.graph.model,a=t.getGeometry(e);if(null==a?(a=new mxGeometry).setRelative(!0):a=a.clone(),null!=this.parent&&null!=n)for(var i=t.getParent(e),s=(i=this.getParentOffset(i),0);s<n.length;s++)n[s].x-=i.x,n[s].y-=i.y;a.points=n,t.setGeometry(e,a)}},mxGraphLayout.prototype.setVertexLocation=function(e,n,t){var a=this.graph.getModel(),i=a.getGeometry(e),s=null;if(null!=i){if(s=new mxRectangle(n,t,i.width,i.height),this.useBoundingBox){var o=this.graph.getView().getState(e);if(null!=o&&null!=o.text&&null!=o.text.boundingBox){var r=this.graph.getView().scale,l=o.text.boundingBox;o.text.boundingBox.x<o.x&&(n+=(o.x-l.x)/r,s.width=l.width),o.text.boundingBox.y<o.y&&(t+=(o.y-l.y)/r,s.height=l.height)}}null!=this.parent&&(null!=(o=a.getParent(e))&&o!=this.parent&&(n-=(o=this.getParentOffset(o)).x,t-=o.y)),i.x==n&&i.y==t||((i=i.clone()).x=n,i.y=t,a.setGeometry(e,i))}return s},mxGraphLayout.prototype.getVertexBounds=function(e){var n=this.graph.getModel().getGeometry(e);if(this.useBoundingBox&&(null!=(r=this.graph.getView().getState(e))&&null!=r.text&&null!=r.text.boundingBox)){var t=this.graph.getView().scale,a=r.text.boundingBox,i=Math.max(r.x-a.x,0)/t,s=Math.max(r.y-a.y,0)/t,o=Math.max(a.x+a.width-(r.x+r.width),0)/t,r=Math.max(a.y+a.height-(r.y+r.height),0)/t;n=new mxRectangle(n.x-i,n.y-s,n.width+i+o,n.height+s+r)}return null!=this.parent&&(e=this.graph.getModel().getParent(e),n=n.clone(),null!=e&&e!=this.parent&&(e=this.getParentOffset(e),n.x+=e.x,n.y+=e.y)),new mxRectangle(n.x,n.y,n.width,n.height)},mxGraphLayout.prototype.arrangeGroups=function(e,n){this.graph.getModel().beginUpdate();try{for(var t=e.length-1;0<=t;t--){var a=e[t],i=this.graph.getChildVertices(a),s=this.graph.getBoundingBoxFromGeometry(i),o=this.graph.getCellGeometry(a),r=0,l=0;if(this.graph.isSwimlane(a)){var d=this.graph.getStartSize(a);r=d.width,l=d.height}null!=s&&null!=o&&((o=o.clone()).x=o.x+s.x-n-r,o.y=o.y+s.y-n-l,o.width=s.width+2*n+r,o.height=s.height+2*n+l,this.graph.getModel().setGeometry(a,o),this.graph.moveCells(i,n+r-s.x,n+l-s.y))}}finally{this.graph.getModel().endUpdate()}},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(e,n,t){var a=this.graph.getModel(),i=a.getParent(e),s=this.isHorizontal();if(null!=e&&null!=i){var o=0,r=0,l=a.getChildCount(i);for(n=s?n:t,null!=(o=this.graph.getView().getState(i))&&(n-=s?o.x:o.y),o=0;o<l;o++)if((t=a.getChildAt(i,o))!=e&&null!=(t=a.getGeometry(t))){if(t=s?t.x+t.width/2:t.y+t.height/2,r<n&&n<t)break;r=t}s=i.getIndex(e),s=Math.max(0,o-(s<o?1:0)),a.add(i,e,s)}},mxStackLayout.prototype.getParentSize=function(e){var n=this.graph.getModel(),t=n.getGeometry(e);return null!=this.graph.container&&(null==t&&n.isLayer(e)||e==this.graph.getView().currentRoot)&&(t=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),t},mxStackLayout.prototype.execute=function(e){if(null!=e){var n=this.isHorizontal(),t=this.graph.getModel(),a=this.getParentSize(e),i=0;null!=a&&(i=n?a.height:a.width);i=i-(2*this.spacing+2*this.border);var s=this.x0+this.border,o=this.y0+this.border;if(this.graph.isSwimlane(e)){var r=this.graph.getCellStyle(e),l=mxUtils.getValue(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);n==(r=mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0))&&(i-=l),n?o+=l:s+=l}t.beginUpdate();try{l=0,r=null;for(var d=t.getChildCount(e),c=0;c<d;c++){var m=t.getChildAt(e,c);if(!this.isVertexIgnored(m)&&this.isVertexMovable(m)){var u=t.getGeometry(m);null!=u&&(u=u.clone(),null!=this.wrap&&null!=r&&(n&&r.x+r.width+u.width+2*this.spacing>this.wrap||!n&&r.y+r.height+u.height+2*this.spacing>this.wrap)&&(r=null,n?o+=l+this.spacing:s+=l+this.spacing,l=0),l=Math.max(l,n?u.height:u.width),null!=r?n?u.x=r.x+r.width+this.spacing:u.y=r.y+r.height+this.spacing:this.keepFirstLocation||(n?u.x=s:u.y=o),n?u.y=o:u.x=s,this.fill&&0<i&&(n?u.height=i:u.width=i),t.setGeometry(m,u),r=u)}}this.resizeParent&&null!=a&&null!=r&&!this.graph.isCellCollapsed(e)?(a=a.clone(),n?a.width=r.x+r.width+this.spacing:a.height=r.y+r.height+this.spacing,t.setGeometry(e,a)):this.resizeLast&&null!=a&&null!=r&&(n?r.width=a.width-r.x-this.spacing:r.height=a.height-r.y-this.spacing)}finally{t.endUpdate()}}},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(e,n,t){var a=(t=this.graph.getModel()).getParent(e);if(null!=e&&null!=a){var i=0,s=0,o=t.getChildCount(a);for(i=0;i<o;i++){var r=t.getChildAt(a,i);if(null!=(r=this.getVertexBounds(r))){if(r=r.x+r.width/2,s<n&&n<r)break;s=r}}n=a.getIndex(e),n=Math.max(0,i-(n<i?1:0)),t.add(a,e,n)}},mxPartitionLayout.prototype.execute=function(e){var n=this.isHorizontal(),t=this.graph.getModel(),a=t.getGeometry(e);if(null!=this.graph.container&&(null==a&&t.isLayer(e)||e==this.graph.getView().currentRoot)&&(a=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=a){for(var i=[],s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}if(0<(s=i.length)){var l=this.border,d=this.border,c=(c=n?a.height:a.width)-2*this.border;if(e=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle,c-=n?e.height:e.width,l+=e.width,d+=e.height,e=this.border+(s-1)*this.spacing,0<(a=n?(a.width-l-e)/s:(a.height-d-e)/s)){t.beginUpdate();try{for(o=0;o<s;o++){r=i[o];var m=t.getGeometry(r);null!=m&&((m=m.clone()).x=l,m.y=d,n?(this.resizeVertices&&(m.width=a,m.height=c),l+=a+this.spacing):(this.resizeVertices&&(m.height=a,m.width=c),d+=a+this.spacing),t.setGeometry(r,m))}}finally{t.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(e,n){this.parent=e;var t=this.graph.getModel();if(null==n)if(0<this.graph.getEdges(e,t.getParent(e),this.invert,!this.invert,!1).length)n=e;else{if(0<(o=this.graph.findTreeRoots(e,!0,this.invert)).length)for(var a=0;a<o.length;a++)if(!this.isVertexIgnored(o[a])&&0<this.graph.getEdges(o[a],null,this.invert,!this.invert,!1).length){n=o[a];break}}if(null!=n){this.parentsChanged=this.resizeParent?{}:null,t.beginUpdate();try{var i=this.dfs(n,e);if(null!=i){this.layout(i);var s=this.graph.gridSize,o=s;if(!this.moveTree){var r=this.getVertexBounds(n);null!=r&&(s=r.x,o=r.y)}if((r=null)!=(r=this.isHorizontal()?this.horizontalLayout(i,s,o):this.verticalLayout(i,null,s,o))){var l=a=0;r.x<0&&(a=Math.abs(s-r.x)),r.y<0&&(l=Math.abs(o-r.y)),(0!=a||0!=l)&&this.moveNode(i,a,l),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(i)}}}finally{t.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(e,n,t){for(e.x+=n,e.y+=t,this.apply(e),e=e.child;null!=e;)this.moveNode(e,n,t),e=e.next},mxCompactTreeLayout.prototype.dfs=function(e,n,t){t=null!=t?t:[];var a=mxCellPath.create(e),i=null;if(null!=e&&null==t[a]&&!this.isVertexIgnored(e)){t[a]=e;i=this.createNode(e),a=this.graph.getModel();var s=null;e=this.graph.getEdges(e,n,this.invert,!this.invert,!1,!0);for(var o=this.graph.getView(),r=0;r<e.length;r++){var l=e[r];if(!this.isEdgeIgnored(l)){this.resetEdges&&this.setEdgePoints(l,null),this.edgeRouting&&(this.setEdgeStyleEnabled(l,!1),this.setEdgePoints(l,null));var d;l=null!=(d=o.getState(l))?d.getVisibleTerminal(this.invert):o.getVisibleTerminal(l,this.invert);null!=(d=this.dfs(l,n,t))&&null!=a.getGeometry(l)&&(null==s?i.child=d:s.next=d,s=d)}}}return i},mxCompactTreeLayout.prototype.layout=function(e){if(null!=e){for(var n=e.child;null!=n;)this.layout(n),n=n.next;null!=e.child?this.attachParent(e,this.join(e)):this.layoutLeaf(e)}},mxCompactTreeLayout.prototype.horizontalLayout=function(e,n,t,a){if(e.x+=n+e.offsetX,e.y+=t+e.offsetY,a=this.apply(e,a),null!=(n=e.child)){a=this.horizontalLayout(n,e.x,e.y,a),t=e.y+n.offsetY;for(var i=n.next;null!=i;)a=this.horizontalLayout(i,e.x+n.offsetX,t,a),t+=i.offsetY,i=i.next}return a},mxCompactTreeLayout.prototype.verticalLayout=function(e,n,t,a,i){if(e.x+=t+e.offsetY,e.y+=a+e.offsetX,i=this.apply(e,i),null!=(n=e.child))for(i=this.verticalLayout(n,e,e.x,e.y,i),t=e.x+n.offsetY,a=n.next;null!=a;)i=this.verticalLayout(a,e,t,e.y+n.offsetX,i),t+=a.offsetY,a=a.next;return i},mxCompactTreeLayout.prototype.attachParent=function(e,n){var t=this.nodeDistance+this.levelDistance,a=(n-e.width)/2-this.nodeDistance,i=a+e.width+2*this.nodeDistance-n;e.child.offsetX=t+e.height,e.child.offsetY=i,e.contour.upperHead=this.createLine(e.height,0,this.createLine(t,i,e.contour.upperHead)),e.contour.lowerHead=this.createLine(e.height,0,this.createLine(t,a,e.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(e){var n=2*this.nodeDistance;e.contour.upperTail=this.createLine(e.height+n,0),e.contour.upperHead=e.contour.upperTail,e.contour.lowerTail=this.createLine(0,-e.width-n),e.contour.lowerHead=this.createLine(e.height+n,0,e.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(e){var n=2*this.nodeDistance,t=e.child;e.contour=t.contour;var a=t.width+n,i=a;for(t=t.next;null!=t;){var s=this.merge(e.contour,t.contour);t.offsetY=s+a,t.offsetX=0,i+=s+(a=t.width+n),t=t.next}return i},mxCompactTreeLayout.prototype.merge=function(e,n){for(var t=0,a=0,i=0,s=e.lowerHead,o=n.upperHead;null!=o&&null!=s;){var r=this.offset(t,a,o.dx,o.dy,s.dx,s.dy);a=a+r,i=i+r;t+o.dx<=s.dx?(t+=o.dx,a+=o.dy,o=o.next):(t-=s.dx,a-=s.dy,s=s.next)}return null!=o?(t=this.bridge(e.upperTail,0,0,o,t,a),e.upperTail=null!=t.next?n.upperTail:t,e.lowerTail=n.lowerTail):null==(t=this.bridge(n.lowerTail,t,a,s,0,0)).next&&(e.lowerTail=t),e.lowerHead=n.lowerHead,i},mxCompactTreeLayout.prototype.offset=function(e,n,t,a,i,s){var o;return i<=e||e+t<=0?0:0<(o=0<i*a-t*s?e<0?e*a/t-n:0<e?e*s/i-n:-n:i<e+t?s-(n+(i-e)*a/t):e+t<i?(t+e)*s/i-(n+a):s-(n+a))?o:0},mxCompactTreeLayout.prototype.bridge=function(e,n,t,a,i,s){return n=i+a.dx-n,i=i=0,0==a.dx?i=a.dy:(i=n*a.dy,i/=a.dx),n=this.createLine(n,i,a.next),e.next=this.createLine(0,s+a.dy-i-t,n),n},mxCompactTreeLayout.prototype.createNode=function(e){var n={};return n.cell=e,n.x=0,n.y=0,n.width=0,n.height=0,null!=(e=this.getVertexBounds(e))&&(this.isHorizontal()?(n.width=e.height,n.height=e.width):(n.width=e.width,n.height=e.height)),n.offsetX=0,n.offsetY=0,n.contour={},n},mxCompactTreeLayout.prototype.apply=function(e,n){var t=this.graph.getModel(),a=e.cell,i=t.getGeometry(a);return null!=a&&null!=i&&(this.isVertexMovable(a)&&(i=this.setVertexLocation(a,e.x,e.y),this.resizeParent&&(t=t.getParent(a),a=mxCellPath.create(t),null==this.parentsChanged[a]&&(this.parentsChanged[a]=t))),n=null==n?new mxRectangle(i.x,i.y,i.width,i.height):new mxRectangle(Math.min(n.x,i.x),Math.min(n.y,i.y),Math.max(n.x+n.width,i.x+i.width),Math.max(n.y+n.height,i.y+i.height))),n},mxCompactTreeLayout.prototype.createLine=function(e,n,t){var a={};return a.dx=e,a.dy=n,a.next=t,a},mxCompactTreeLayout.prototype.adjustParents=function(){var e,n=[];for(e in this.parentsChanged)n.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(n,!0),this.groupPadding)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(e){for(this.processNodeOutgoing(e),e=e.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(e){for(var n=e.child,t=e.cell,a=0,i=[];null!=n;){a++;var s=n.x;this.horizontal&&(s=n.y),i.push(new WeightedCellSorter(n,s)),n=n.next}i.sort(WeightedCellSorter.prototype.compare),(s=e.width)>(o=(a+1)*this.prefHozEdgeSep)+2*this.prefHozEdgeSep&&(s-=2*this.prefHozEdgeSep),n=(e=s/a)/2,s>o+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep);s=this.minEdgeJetty-this.prefVertEdgeOff;for(var o=0,r=this.getVertexBounds(t),l=0;l<i.length;l++){for(var d=i[l].cell.cell,c=this.getVertexBounds(d),m=(d=this.graph.getEdgesBetween(t,d,!1),[]),u=0,p=0,g=0;g<d.length;g++)this.horizontal?(u=r.x+r.width,p=r.y+n,m.push(new mxPoint(u,p)),u=r.x+r.width+s,m.push(new mxPoint(u,p)),p=c.y+c.height/2):(u=r.x+n,p=r.y+r.height,m.push(new mxPoint(u,p)),p=r.y+r.height+s,m.push(new mxPoint(u,p)),u=c.x+c.width/2),m.push(new mxPoint(u,p)),this.setEdgePoints(d[g],m);l<a/2?s+=this.prefVertEdgeOff:a/2<l&&(s-=this.prefVertEdgeOff),n+=e,o=Math.max(o,s)}},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.weightedValue>e.weightedValue?1:n.weightedValue<e.weightedValue?-1:n.nudge?1:-1:0},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxFastOrganicLayout.prototype.execute=function(e){var n=this.graph.getModel();this.vertexArray=[];for(var t=this.graph.getChildVertices(e),a=0;a<t.length;a++)this.isVertexIgnored(t[a])||this.vertexArray.push(t[a]);var i=this.useInputOrigin?this.graph.view.getBounds(this.vertexArray):null,s=this.vertexArray.length;for(this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant,a=0;a<this.vertexArray.length;a++){var o=this.vertexArray[a];this.cellLocation[a]=[];var r=mxCellPath.create(o);this.indices[r]=a;var l=this.getVertexBounds(o),d=l.width,c=l.height,m=l.x,u=l.y;this.cellLocation[a][0]=m+d/2,this.cellLocation[a][1]=u+c/2,this.radius[a]=Math.min(d,c),this.radiusSquared[a]=this.radius[a]*this.radius[a]}n.beginUpdate();try{for(a=0;a<s;a++){this.dispX[a]=0,this.dispY[a]=0,this.isMoveable[a]=this.isVertexMovable(this.vertexArray[a]);var p=this.graph.getConnections(this.vertexArray[a],e);t=this.graph.getOpposites(p,this.vertexArray[a]);for(this.neighbours[a]=[],d=0;d<t.length;d++){this.resetEdges&&this.graph.resetEdge(p[d]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[d],!1);r=mxCellPath.create(t[d]);var g=this.indices[r];this.neighbours[a][d]=null!=g?g:a}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(s)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(e=t=null,a=0;a<this.vertexArray.length;a++)o=this.vertexArray[a],this.isVertexMovable(o)&&(null!=(l=this.getVertexBounds(o))&&(this.cellLocation[a][0]-=l.width/2,this.cellLocation[a][1]-=l.height/2,m=this.graph.snap(this.cellLocation[a][0]),u=this.graph.snap(this.cellLocation[a][1]),this.setVertexLocation(o,m,u),t=null==t?m:Math.min(t,m),e=null==e?u:Math.min(e,u)));a=1-(t||0),o=1-(e||0),null!=i&&(a+=i.x,o+=i.y),this.graph.moveCells(this.vertexArray,a,o)}finally{n.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var e=0;e<this.vertexArray.length;e++)if(this.isMoveable[e]){(t=Math.sqrt(this.dispX[e]*this.dispX[e]+this.dispY[e]*this.dispY[e]))<.001&&(t=.001);var n=this.dispX[e]/t*Math.min(t,this.temperature),t=this.dispY[e]/t*Math.min(t,this.temperature);this.dispX[e]=0,this.dispY[e]=0,this.cellLocation[e][0]+=n,this.cellLocation[e][1]+=t}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var e=0;e<this.vertexArray.length;e++)for(var n=0;n<this.neighbours[e].length;n++){var t=this.neighbours[e][n];if(e!=t&&this.isMoveable[e]&&this.isMoveable[t]){(a=(s=this.cellLocation[e][0]-this.cellLocation[t][0])*s+(o=this.cellLocation[e][1]-this.cellLocation[t][1])*o-this.radiusSquared[e]-this.radiusSquared[t])<this.minDistanceLimitSquared&&(a=this.minDistanceLimitSquared);var a,i=Math.sqrt(a),s=s/i*(a=a/this.forceConstant),o=o/i*a;this.dispX[e]-=s,this.dispY[e]-=o,this.dispX[t]+=s,this.dispY[t]+=o}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var e=this.vertexArray.length,n=0;n<e;n++)for(var t=n;t<e;t++){if(!this.allowedToRun)return;if(t!=n&&this.isMoveable[n]&&this.isMoveable[t]){var a=this.cellLocation[n][0]-this.cellLocation[t][0],i=this.cellLocation[n][1]-this.cellLocation[t][1];0==a&&(a=.01+Math.random()),0==i&&(i=.01+Math.random());var s=Math.sqrt(a*a+i*i),o=s-this.radius[n]-this.radius[t];o>this.maxDistanceLimit||(o<this.minDistanceLimit&&(o=this.minDistanceLimit),a=a/s*(o=this.forceConstantSquared/o),i=i/s*o,this.dispX[n]+=a,this.dispY[n]+=i,this.dispX[t]-=a,this.dispY[t]-=i)}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0,a=null,i=null,s=[],o=n.getChildCount(e),r=0;r<o;r++){var l=n.getChildAt(e,r);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{s.push(l);var d=this.getVertexBounds(l);a=null==a?d.y:Math.min(a,d.y),i=null==i?d.x:Math.min(i,d.x),t=Math.max(t,Math.max(d.width,d.height))}}var c=this.getRadius(s.length,t);this.moveCircle&&(i=this.x0,a=this.y0),this.circle(s,c,i,a)}finally{n.endUpdate()}},mxCircleLayout.prototype.getRadius=function(e,n){return Math.max(e*n/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(e,n,t,a){for(var i=e.length,s=2*Math.PI/i,o=0;o<i;o++)this.isVertexMovable(e[o])&&this.setVertexLocation(e[o],t+n+n*Math.sin(o*s),a+n+n*Math.cos(o*s))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(e){e=this.findParallels(e),this.graph.model.beginUpdate();try{for(var n in e){var t=e[n];1<t.length&&this.layout(t)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(e){for(var n=this.graph.getModel(),t=[],a=n.getChildCount(e),i=0;i<a;i++){var s=n.getChildAt(e,i);if(!this.isEdgeIgnored(s)){var o=this.getEdgeId(s);null!=o&&(null==t[o]&&(t[o]=[]),t[o].push(s))}}return t},mxParallelEdgeLayout.prototype.getEdgeId=function(e){var n=this.graph.getView(),t=n.getState(e),a=null!=t?t.getVisibleTerminal(!0):n.getVisibleTerminal(e,!0);return e=null!=t?t.getVisibleTerminal(!1):n.getVisibleTerminal(e,!1),null!=a&&null!=e?(a=mxCellPath.create(a),(e=mxCellPath.create(e))<a?e+"-"+a:a+"-"+e):null},mxParallelEdgeLayout.prototype.layout=function(e){var n=e[0];if((o=(t=this.graph.getModel()).getGeometry(t.getTerminal(n,!0)))==(s=t.getGeometry(t.getTerminal(n,!1)))){n=o.x+o.width+this.spacing;for(var t=o.y+o.height/2,a=0;a<e.length;a++)this.route(e[a],n,t),n+=this.spacing}else if(null!=o&&null!=s){n=o.x+o.width/2,t=o.y+o.height/2,a=s.x+s.width/2-n;var i=s.y+s.height/2-t,s=Math.sqrt(a*a+i*i),o=i*this.spacing/s;for(s=a*this.spacing/s,n=n+a/2+o*(e.length-1)/2,t=t+i/2-s*(e.length-1)/2,a=0;a<e.length;a++)this.route(e[a],n,t),n-=o,t+=s}},mxParallelEdgeLayout.prototype.route=function(e,n,t){this.graph.isCellMovable(e)&&this.setEdgePoints(e,[new mxPoint(n,t)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(e,n,t){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0;t<this.layouts.length;t++)this.layouts[t].execute.apply(this.layouts[t],arguments)}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(e){for(var n=this.graph.view,t=this.graph.getModel(),a=[],i=[],s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o),l=n.getState(r);null!=l&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||a.push(l):i.push(l))}this.placeLabels(i,a)},mxEdgeLabelLayout.prototype.placeLabels=function(e,n){var t=this.graph.getModel();t.beginUpdate();try{for(var a=0;a<n.length;a++){var i=n[a];if(null!=i&&null!=i.text&&null!=i.text.boundingBox)for(var s=0;s<e.length;s++){var o=e[s];null!=o&&this.avoid(i,o)}}}finally{t.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(e,n){var t=this.graph.getModel(),a=e.text.boundingBox;if(mxUtils.intersects(a,n)){var i=-a.y-a.height+n.y,s=-a.y+n.y+n.height;i=Math.abs(i)<Math.abs(s)?i:s,s=-a.x-a.width+n.x,a=-a.x+n.x+n.width,a=Math.abs(s)<Math.abs(a)?s:a;Math.abs(a)<Math.abs(i)?i=0:a=0,null!=(s=t.getGeometry(e.cell))&&(null!=(s=s.clone()).offset?(s.offset.x+=a,s.offset.y+=i):s.offset=new mxPoint(a,i),t.setGeometry(e.cell,s))}},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(e){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(e,n){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(e,n){this.isVertex()?this.x[0]=n:this.isEdge()&&(this.x[e-this.minRank-1]=n)},mxGraphAbstractHierarchyCell.prototype.getX=function(e){return this.isVertex()?this.x[0]:this.isEdge()?this.x[e-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(e,n){this.isVertex()?this.y[0]=n:this.isEdge()&&(this.y[e-this.minRank-1]=n)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.connectsAsTarget=[],mxGraphHierarchyNode.prototype.connectsAsSource=[],mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(e){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var n=0;n<this.connectsAsTarget.length;n++){var t=this.connectsAsTarget[n];-1==t.maxRank||t.maxRank==e+1?this.nextLayerConnectedCells[0].push(t.source):this.nextLayerConnectedCells[0].push(t)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var n=0;n<this.connectsAsSource.length;n++){var t=this.connectsAsSource[n];-1==t.minRank||t.minRank==e-1?this.previousLayerConnectedCells[0].push(t.target):this.previousLayerConnectedCells[0].push(t)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(e){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(e,n){this.temp[0]=n},mxGraphHierarchyNode.prototype.isAncestor=function(e){if(null!=e&&null!=this.hashCode&&null!=e.hashCode&&this.hashCode.length<e.hashCode.length){if(this.hashCode==e.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var n=0;n<this.hashCode.length;n++)if(this.hashCode[n]!=e.hashCode[n])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(e){e=this.source,this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var n=0;n<this.temp.length;n++)this.nextLayerConnectedCells[n]=[],n==this.temp.length-1?this.nextLayerConnectedCells[n].push(this.source):this.nextLayerConnectedCells[n].push(this)}return this.nextLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var n=0;n<this.temp.length;n++)this.previousLayerConnectedCells[n]=[],0==n?this.previousLayerConnectedCells[n].push(this.target):this.previousLayerConnectedCells[n].push(this)}return this.previousLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(e){return this.temp[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(e,n){this.temp[e-this.minRank-1]=n},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(e,n,t){for(var a=e.getGraph(),i=0;i<n.length;i++){t[i]=new mxGraphHierarchyNode(n[i]);var s=mxCellPath.create(n[i]);this.vertexMapper[s]=t[i],s=e.getEdges(n[i]),t[i].connectsAsSource=[];for(var o=0;o<s.length;o++){if((d=e.getVisibleTerminal(s[o],!1))!=n[i]&&d!=n[i]&&e.graph.model.isVertex(d)&&!e.isVertexIgnored(d)){var r=e.getEdgesBetween(n[i],d,!1),l=e.getEdgesBetween(n[i],d,!0),d=mxCellPath.create(r[0]);if(null!=r&&0<r.length&&null==this.edgeMapper[d]&&2*l.length>=r.length){l=new mxGraphHierarchyEdge(r);for(var c=0;c<r.length;c++){var m=r[c];d=mxCellPath.create(m);this.edgeMapper[d]=l,a.resetEdge(m),e.disableEdgeStyle&&(e.setEdgeStyleEnabled(m,!1),e.setOrthogonalEdge(m,!0))}l.source=t[i],mxUtils.indexOf(t[i].connectsAsSource,l)<0&&t[i].connectsAsSource.push(l)}}}t[i].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var e=[];if(null!=this.roots)for(var n=0;n<this.roots.length;n++){var t=mxCellPath.create(this.roots[n]);null!=(t=this.vertexMapper[t])&&e.push(t)}for(var a in this.vertexMapper)(t=this.vertexMapper[a]).temp[0]=-1;for(var i=e.slice();0<e.length;){var s,o;s=(t=e[0]).connectsAsTarget,o=t.connectsAsSource;var r=!0,l=this.SOURCESCANSTARTRANK;for(n=0;n<s.length;n++){var d=s[n];if(5270620!=d.temp[0]){r=!1;break}d=d.source,l=Math.min(l,d.temp[0]-1)}if(r){if(t.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=o)for(n=0;n<o.length;n++)(d=o[n]).temp[0]=5270620,-1==(d=d.target).temp[0]&&(e.push(d),d.temp[0]=-2);e.shift()}else if(n=e.shift(),e.push(t),n==t&&1==e.length)break}for(a in this.vertexMapper)(t=this.vertexMapper[a]).temp[0]-=this.maxRank;for(n=0;n<i.length;n++)for(e=0,s=(t=i[n]).connectsAsSource,a=0;a<s.length;a++)d=(d=s[a]).target,t.temp[0]=Math.max(e,d.temp[0]+1),e=t.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var s=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++)s[e]=[],this.ranks[e]=s[e];var n=null;if(null!=this.roots){var t=this.roots;for(n=[],e=0;e<t.length;e++){var a=mxCellPath.create(t[e]);n[e]=this.vertexMapper[a]}}this.visit(function(e,n,t,a,i){if(0==i&&n.maxRank<0&&n.minRank<0&&(s[n.temp[0]].push(n),n.maxRank=n.temp[0],n.minRank=n.temp[0],n.temp[0]=s[n.maxRank].length-1),null!=e&&null!=t&&1<e.maxRank-n.maxRank)for(t.maxRank=e.maxRank,t.minRank=n.maxRank,t.temp=[],t.x=[],t.y=[],e=t.minRank+1;e<t.maxRank;e++)s[e].push(t),t.setGeneralPurposeVariable(e,s[e].length-1)},n,!1,null)},mxGraphHierarchyModel.prototype.visit=function(e,n,t,a){if(null!=n){for(var i=0;i<n.length;i++){var s=n[i];null!=s&&(null==a&&(a={}),t?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=i,this.extendedDfs(null,s,null,e,a,s.hashCode,i,0)):this.dfs(null,s,null,e,a,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(e,n,t,a,i,s){if(null!=n){var o=mxCellPath.create(n.cell);if(null==i[o])for(a(e,i[o]=n,t,s,0),e=n.connectsAsSource.slice(),t=0;t<e.length;t++)o=e[t],this.dfs(n,o.target,o,a,i,s+1);else a(e,n,t,s,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(e,n,t,a,i,s,o,r){if(null!=n)if(null==e||null!=n.hashCode&&n.hashCode[0]==e.hashCode[0]||(s=e.hashCode.length+1,n.hashCode=e.hashCode.slice(),n.hashCode[s-1]=o),null==i[o=mxCellPath.create(n.cell)])for(a(e,i[o]=n,t,r,0),e=n.connectsAsSource.slice(),t=0;t<e.length;t++)o=e[t],this.extendedDfs(n,o.target,o,a,i,n.hashCode,t,r+1);else a(e,n,t,r,1)},mxHierarchicalLayoutStage.prototype.execute=function(e){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(e){e=this.layout.getModel(),this.nestedBestRanks=[];for(var n=0;n<e.ranks.length;n++)this.nestedBestRanks[n]=e.ranks[n].slice();var t=0,a=this.calculateCrossings(e);for(n=0;n<this.maxIterations&&t<this.maxNoImprovementIterations;n++){this.weightedMedian(n,e),this.transpose(n,e);var i=this.calculateCrossings(e);if(i<a)for(a=i,i=t=0;i<this.nestedBestRanks.length;i++)for(var s=e.ranks[i],o=0;o<s.length;o++){var r=s[o];this.nestedBestRanks[i][r.getGeneralPurposeVariable(i)]=r}else for(t++,i=0;i<this.nestedBestRanks.length;i++)for(s=e.ranks[i],o=0;o<s.length;o++)(r=s[o]).setGeneralPurposeVariable(i,o);if(0==a)break}for(t=[],a=[],n=0;n<e.maxRank+1;n++)a[n]=[],t[n]=a[n];for(n=0;n<this.nestedBestRanks.length;n++)for(i=0;i<this.nestedBestRanks[n].length;i++)a[n].push(this.nestedBestRanks[n][i]);e.ranks=t},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(e){for(var n=e.ranks.length,t=0,a=1;a<n;a++)t+=this.calculateRankCrossing(a,e);return t},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(e,n){for(var t=0,a=n.ranks[e],i=a.length,s=n.ranks[e-1].length,o=[],r=0;r<i;r++)o[r]=[];for(r=0;r<a.length;r++)for(var l=(c=a[r]).getGeneralPurposeVariable(e),d=c.getPreviousLayerConnectedCells(e),c=0;c<d.length;c++){var m=d[c].getGeneralPurposeVariable(e-1);o[l][m]=201207}for(r=0;r<i;r++)for(c=0;c<s;c++)if(201207==o[r][c]){for(a=r+1;a<i;a++)for(l=0;l<c;l++)201207==o[a][l]&&t++;for(a=0;a<r;a++)for(l=c+1;l<s;l++)201207==o[a][l]&&t++}return t/2},mxMedianHybridCrossingReduction.prototype.transpose=function(e,n){for(var t=!0,a=0;t&&a++<10;)for(var i=1==e%2&&1==a%2,s=(t=!1,0);s<n.ranks.length;s++){for(var o=n.ranks[s],r=[],l=0;l<o.length;l++){(b=(f=o[l]).getGeneralPurposeVariable(s))<0&&(b=l),r[b]=f}var d=b=f=null,c=null,m=null,u=null,p=null,g=null,v=null,h=null;for(l=0;l<o.length-1;l++){if(0==l){for(var f=(v=r[l]).getNextLayerConnectedCells(s),b=v.getPreviousLayerConnectedCells(s),A=(m=[],u=[],0);A<f.length;A++)m[A]=f[A].getGeneralPurposeVariable(s+1);for(A=0;A<b.length;A++)u[A]=b[A].getGeneralPurposeVariable(s-1)}else f=d,b=c,m=p,u=g,v=h;for(d=(h=r[l+1]).getNextLayerConnectedCells(s),c=h.getPreviousLayerConnectedCells(s),p=[],g=[],A=0;A<d.length;A++)p[A]=d[A].getGeneralPurposeVariable(s+1);for(A=0;A<c.length;A++)g[A]=c[A].getGeneralPurposeVariable(s-1);var E=0,y=0;for(A=0;A<m.length;A++)for(var S=0;S<p.length;S++)m[A]>p[S]&&E++,m[A]<p[S]&&y++;for(A=0;A<u.length;A++)for(S=0;S<g.length;S++)u[A]>g[S]&&E++,u[A]<g[S]&&y++;(y<E||y==E&&i)&&(d=v.getGeneralPurposeVariable(s),v.setGeneralPurposeVariable(s,h.getGeneralPurposeVariable(s)),h.setGeneralPurposeVariable(s,d),d=f,c=b,p=m,g=u,h=v,i||(t=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(e,n){var t=0==e%2;if(t)for(var a=n.maxRank-1;0<=a;a--)this.medianRank(a,t);else for(a=1;a<n.maxRank;a++)this.medianRank(a,t)},mxMedianHybridCrossingReduction.prototype.medianRank=function(e,n){for(var t=this.nestedBestRanks[e].length,a=[],i=[],s=0;s<t;s++){var o,r,l=this.nestedBestRanks[e][s],d=new MedianCellSorter;d.cell=l,r=n?e+1:e-1,null!=(o=n?l.getNextLayerConnectedCells(e):l.getPreviousLayerConnectedCells(e))&&0!=o.length?(d.medianValue=this.medianValue(o,r),a.push(d)):i[l.getGeneralPurposeVariable(e)]=!0}for(a.sort(MedianCellSorter.prototype.compare),s=0;s<t;s++)null==i[s]&&(l=a.shift().cell).setGeneralPurposeVariable(e,s)},mxMedianHybridCrossingReduction.prototype.medianValue=function(e,n){for(var t=[],a=0,i=0;i<e.length;i++){var s=e[i];t[a++]=s.getGeneralPurposeVariable(n)}return t.sort(function(e,n){return e-n}),1==a%2?t[Math.floor(a/2)]:2==a?(t[0]+t[1])/2:(s=t[(i=a/2)-1]-t[0],a=t[a-1]-t[i],(t[i-1]*a+t[i]*s)/(s+a))},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.medianValue>e.medianValue?-1:n.medianValue<e.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(e){var n=this.layout.getModel(),s={},o=mxUtils.clone(n.vertexMapper,null,!0),t=null;if(null!=n.roots){var a=n.roots;t=[];for(e=0;e<a.length;e++){var i=mxCellPath.create(a[e]);t[e]=n.vertexMapper[i]}}if(n.visit(function(e,n,t,a,i){n.isAncestor(e)&&(t.invert(),mxUtils.remove(t,e.connectsAsSource),e.connectsAsTarget.push(t),mxUtils.remove(t,n.connectsAsTarget),n.connectsAsSource.push(t)),e=mxCellPath.create(n.cell),s[e]=n,delete o[e]},t,!0,null),t=null,0<o.lenth&&(t=mxUtils.clone(o,null,!0)),e=mxUtils.clone(s,null,!0),n.visit(function(e,n,t,a,i){n.isAncestor(e)&&(t.invert(),mxUtils.remove(t,e.connectsAsSource),n.connectsAsSource.push(t),e.connectsAsTarget.push(t),mxUtils.remove(t,n.connectsAsTarget)),e=mxCellPath.create(n.cell),s[e]=n,delete o[e]},o,!0,e),a=this.layout.getGraph(),null!=t&&0<t.length)for(n=n.roots,e=0;e<t.length;e++)i=t[e].cell,0==a.getIncomingEdges(i).length&&n.push(i)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function WeightedCellSorter(e,n){this.cell=e,this.weightedValue=n}function mxHierarchicalLayout(e,n,t){mxGraphLayout.call(this,e),this.orientation=null!=n?n:mxConstants.DIRECTION_NORTH,this.deterministic=null==t||t}function mxGraphModel(e){this.currentEdit=this.createUndoableEdit(),null!=e?this.setRoot(e):this.clear()}function mxRootChange(e,n){this.model=e,this.previous=this.root=n}function mxChildChange(e,n,t,a){this.model=e,this.previous=this.parent=n,this.child=t,this.previousIndex=this.index=a}function mxTerminalChange(e,n,t,a){this.model=e,this.cell=n,this.previous=this.terminal=t,this.source=a}function mxValueChange(e,n,t){this.model=e,this.cell=n,this.previous=this.value=t}function mxStyleChange(e,n,t){this.model=e,this.cell=n,this.previous=this.style=t}function mxGeometryChange(e,n,t){this.model=e,this.cell=n,this.previous=this.geometry=t}function mxCollapseChange(e,n,t){this.model=e,this.cell=n,this.previous=this.collapsed=t}function mxVisibleChange(e,n,t){this.model=e,this.cell=n,this.previous=this.visible=t}function mxCellAttributeChange(e,n,t){this.cell=e,this.attribute=n,this.previous=this.value=t}function mxCell(e,n,t){this.value=e,this.setGeometry(n),this.setStyle(t),null!=this.onInit&&this.onInit()}function mxGeometry(e,n,t,a){mxRectangle.call(this,e,n,t,a)}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var e=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var n=0;n<e.ranks.length;n++){mxLog.write("Rank ",n," : ");for(var t=e.ranks[n],a=0;a<t.length;a++)mxLog.write(t[a].getGeneralPurposeVariable(n),"  ");mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(e){this.jettyPositions=[],e=this.layout.getModel(),this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var n=1e8;if(this.fineTuning)for(var t=0;t<this.maxIterations;t++){if(0!=t&&(this.medianPos(t,e),this.minNode(e)),this.currentXDelta<n){for(var a=0;a<e.ranks.length;a++)for(var i=e.ranks[a],s=0;s<i.length;s++){var o=i[s];o.setX(a,o.getGeneralPurposeVariable(a))}n=this.currentXDelta}else for(a=0;a<e.ranks.length;a++)for(i=e.ranks[a],s=0;s<i.length;s++)(o=i[s]).setGeneralPurposeVariable(a,o.getX(a));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(e){for(var n=[],t=[],a=[],i=0;i<=e.maxRank;i++){a[i]=e.ranks[i];for(var s=0;s<a[i].length;s++){var o=a[i][s];(r=new WeightedCellSorter(o,i)).rankIndex=s,r.visited=!0,n.push(r),t[o=mxCellPath.create(o.getCoreCell())]=r}}for(e=10*n.length,s=0;0<n.length&&s<=e;){i=(r=n.shift()).cell;var r,l=r.weightedValue,d=parseInt(r.rankIndex),c=(o=i.getNextLayerConnectedCells(l),i.getPreviousLayerConnectedCells(l)),m=o.length,u=c.length,p=this.medianXValue(o,l+1),g=this.medianXValue(c,l-1),v=m+u,h=i.getGeneralPurposeVariable(l),f=h;if(0<v&&(f=(p*m+g*u)/v),m=!1,f<h-1?0==d?(i.setGeneralPurposeVariable(l,f),m=!0):(h=(h=(d=a[l][d-1]).getGeneralPurposeVariable(l))+d.width/2+this.intraCellSpacing+i.width/2)<f?(i.setGeneralPurposeVariable(l,f),m=!0):h<i.getGeneralPurposeVariable(l)-1&&(i.setGeneralPurposeVariable(l,h),m=!0):h+1<f&&(d==a[l].length-1?(i.setGeneralPurposeVariable(l,f),m=!0):f<(h=(h=(d=a[l][d+1]).getGeneralPurposeVariable(l))-d.width/2-this.intraCellSpacing-i.width/2)?(i.setGeneralPurposeVariable(l,f),m=!0):h>i.getGeneralPurposeVariable(l)+1&&(i.setGeneralPurposeVariable(l,h),m=!0)),m){for(i=0;i<o.length;i++)l=o[i],null!=(l=t[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,n.push(l));for(i=0;i<c.length;i++)l=c[i],null!=(l=t[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,n.push(l))}r.visited=!1,s++}},mxCoordinateAssignment.prototype.medianPos=function(e,n){if(0==e%2)for(var t=n.maxRank;0<t;t--)this.rankMedianPosition(t-1,n,t);else for(t=0;t<n.maxRank-1;t++)this.rankMedianPosition(t+1,n,t)},mxCoordinateAssignment.prototype.rankMedianPosition=function(e,n,t){n=n.ranks[e];for(var a=[],i=[],s=0;s<n.length;s++){var o=n[s];a[s]=new WeightedCellSorter,a[s].cell=o,a[s].rankIndex=s;var r=mxCellPath.create(o.getCoreCell());i[r]=a[s];var l=null;l=t<e?o.getPreviousLayerConnectedCells(e):o.getNextLayerConnectedCells(e);a[s].weightedValue=this.calculatedWeightedValue(o,l)}for(a.sort(WeightedCellSorter.prototype.compare),s=0;s<a.length;s++){r=0,o=a[s].cell,r=0,null!=(l=t<e?o.getPreviousLayerConnectedCells(e).slice():o.getNextLayerConnectedCells(e).slice())&&(r=0<(r=l.length)?this.medianXValue(l,t):o.getGeneralPurposeVariable(e));for(var d=0,c=(l=-1e8,a[s].rankIndex-1);0<=c;){var m;if(null!=(m=i[m=mxCellPath.create(n[c].getCoreCell())])){var u=m.cell;m.visited?(l=u.getGeneralPurposeVariable(e)+u.width/2+this.intraCellSpacing+d+o.width/2,c=-1):(d+=u.width+this.intraCellSpacing,c--)}}for(d=0,u=1e8,c=a[s].rankIndex+1;c<a.length;)if(null!=(m=i[m=mxCellPath.create(n[c].getCoreCell())])){var p=m.cell;m.visited?(u=p.getGeneralPurposeVariable(e)-p.width/2-this.intraCellSpacing-d-o.width/2,c=a.length):(d+=p.width+this.intraCellSpacing,c++)}l<=r&&r<=u?o.setGeneralPurposeVariable(e,r):r<l?(o.setGeneralPurposeVariable(e,l),this.currentXDelta+=l-r):u<r&&(o.setGeneralPurposeVariable(e,u),this.currentXDelta+=r-u),a[s].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(e,n){for(var t=0,a=0;a<n.length;a++){var i=n[a];e.isVertex()&&i.isVertex()?t++:t=e.isEdge()&&i.isEdge()?t+8:t+2}return t},mxCoordinateAssignment.prototype.medianXValue=function(e,n){if(0==e.length)return 0;for(var t=[],a=0;a<e.length;a++)t[a]=e[a].getGeneralPurposeVariable(n);return t.sort(function(e,n){return e-n}),1==e.length%2?t[Math.floor(e.length/2)]:(t[(a=e.length/2)-1]+t[a])/2},mxCoordinateAssignment.prototype.initialCoords=function(e,n){this.calculateWidestRank(e,n);for(var t=this.widestRank;0<=t;t--)t<n.maxRank&&this.rankCoordinates(t,e,n);for(t=this.widestRank+1;t<=n.maxRank;t++)0<t&&this.rankCoordinates(t,e,n)},mxCoordinateAssignment.prototype.rankCoordinates=function(e,n,t){n=t.ranks[e],t=0;for(var a=this.initialX+(this.widestRankValue-this.rankWidths[e])/2,i=!1,s=0;s<n.length;s++){var o=n[s];if(o.isVertex()){var r=this.layout.getVertexBounds(o.cell);null!=r?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(o.width=r.width,o.height=r.height):(o.width=r.height,o.height=r.width):i=!0,t=Math.max(t,o.height)}else o.isEdge()&&(r=1,null!=o.edges?r=o.edges.length:mxLog.warn("edge.edges is null"),o.width=(r-1)*this.parallelEdgeSpacing);a+=o.width/2,o.setX(e,a),o.setGeneralPurposeVariable(e,a),a+=o.width/2,a+=this.intraCellSpacing}1==i&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(e,n){var t=-this.interRankCellSpacing,a=0;this.rankWidths=[],this.rankY=[];for(var i=n.maxRank;0<=i;i--){for(var s=0,o=n.ranks[i],r=this.initialX,l=!1,d=0;d<o.length;d++){var c=o[d];if(c.isVertex()){var m=this.layout.getVertexBounds(c.cell);null!=m?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(c.width=m.width,c.height=m.height):(c.width=m.height,c.height=m.width):l=!0,s=Math.max(s,c.height)}else c.isEdge()&&(m=1,null!=c.edges?m=c.edges.length:mxLog.warn("edge.edges is null"),c.width=(m-1)*this.parallelEdgeSpacing);r+=c.width/2,c.setX(i,r),c.setGeneralPurposeVariable(i,r),r+=c.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=i),this.rankWidths[i]=r}for(1==l&&mxLog.warn("At least one cell has no bounds"),this.rankY[i]=t,r=s/2+a/2+this.interRankCellSpacing,a=s,t=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?t+r:t-r,d=0;d<o.length;d++)o[d].setY(i,t)}},mxCoordinateAssignment.prototype.minPath=function(e,n){var t,a=n.edgeMapper;for(t in a){var i=a[t];if(!(i.maxRank-i.minRank-1<1)){for(var s=i.getGeneralPurposeVariable(i.minRank+1),o=!0,r=0,l=i.minRank+2;l<i.maxRank;l++){s!=(d=i.getGeneralPurposeVariable(l))?(o=!1,s=d):r++}if(!o){o=s=0;var d=[],c=[],m=i.getGeneralPurposeVariable(i.minRank+1);for(l=i.minRank+1;l<i.maxRank-1;l++){var u=i.getX(l+1);m==u?(d[l-i.minRank-1]=m,s++):this.repositionValid(n,i,l+1,m)?(d[l-i.minRank-1]=m,s++):m=d[l-i.minRank-1]=u}for(m=i.getX(l),l=i.maxRank-1;l>i.minRank+1;l--)m==(u=i.getX(l-1))?(c[l-i.minRank-2]=m,o++):this.repositionValid(n,i,l-1,m)?(c[l-i.minRank-2]=m,o++):(c[l-i.minRank-2]=i.getX(l-1),m=u);if(r<o||r<s)if(s<=o)for(l=i.maxRank-2;l>i.minRank;l--)i.setX(l,c[l-i.minRank-1]);else if(o<s)for(l=i.minRank+2;l<i.maxRank;l++)i.setX(l,d[l-i.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(e,n,t,a){e=e.ranks[t];for(var i=-1,s=0;s<e.length;s++)if(n==e[s]){i=s;break}if(i<0)return!1;if(a<(s=n.getGeneralPurposeVariable(t))){if(0==i)return!0;if(!((t=(t=(e=e[i-1]).getGeneralPurposeVariable(t))+e.width/2+this.intraCellSpacing+n.width/2)<=a))return!1}else if(s<a){if(i==e.length-1)return!0;if(!(a<=(t=(t=(e=e[i+1]).getGeneralPurposeVariable(t))-e.width/2-this.intraCellSpacing-n.width/2)))return!1}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(e,n){this.rankTopY=[],this.rankBottomY=[];for(var t=0;t<n.ranks.length;t++)this.rankTopY[t]=Number.MAX_VALUE,this.rankBottomY[t]=0;t=null,this.layout.resizeParent&&(t={});var a,i=n.edgeMapper,s=n.vertexMapper;for(a in s){var o=s[a];if(this.setVertexLocation(o),this.layout.resizeParent){o=e.model.getParent(o.cell);var r=mxCellPath.create(o);null==t[r]&&(t[r]=o)}}for(a in this.layout.resizeParent&&null!=t&&this.adjustParents(t),(this.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(n),i)this.setEdgePosition(i[a])},mxCoordinateAssignment.prototype.adjustParents=function(e){var n,t=[];for(n in e)t.push(e[n]);this.layout.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding)},mxCoordinateAssignment.prototype.localEdgeProcessing=function(e){for(var n=0;n<e.ranks.length;n++)for(var t=e.ranks[n],a=0;a<t.length;a++){var i=t[a];if(i.isVertex())for(var s=i.getPreviousLayerConnectedCells(n),o=n-1,r=0;r<2;r++){if(-1<o&&o<e.ranks.length&&null!=s&&0<s.length){for(var l=[],d=0;d<s.length;d++){var c=new WeightedCellSorter(s[d],s[d].getX(o));l.push(c)}l.sort(WeightedCellSorter.prototype.compare);var m=(c=i.x[0]-i.width/2)+i.width,u=s=0;for(o=[],d=0;d<l.length;d++){var p,g=l[d].cell;if(g.isVertex()){p=0==r?i.connectsAsSource:i.connectsAsTarget;for(var v=0;v<p.length;v++)p[v].source!=g&&p[v].target!=g||(s+=p[v].edges.length,u++,o.push(p[v]))}else s+=g.edges.length,u++,o.push(g)}for(i.width>(s+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep,m-=this.prefHozEdgeSep),c+=(l=(m-c)/s)/2,m=this.minEdgeJetty-this.prefVertEdgeOff,d=u=0;d<o.length;d++){for(g=o[d].edges.length,v=mxCellPath.create(o[d].edges[0]),null==(p=this.jettyPositions[v])&&(p=[],this.jettyPositions[v]=p),d<s/2?m+=this.prefVertEdgeOff:s/2<d&&(m-=this.prefVertEdgeOff),v=0;v<g;v++)p[4*v+2*r]=c,c+=l,p[4*v+2*r+1]=m;u=Math.max(u,m)}}s=i.getNextLayerConnectedCells(n),o=n+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(e){var n=0;if(101207!=e.temp[0]){var t=e.maxRank,a=e.minRank;t==a&&(t=e.source.maxRank,a=e.target.minRank);for(var i=0,s=mxCellPath.create(e.edges[0]),o=(s=this.jettyPositions[s],e.isReversed?e.target.cell:e.source.cell),r=this.layout.graph,l=0;l<e.edges.length;l++){var d=e.edges[l],c=this.layout.getVisibleTerminal(d,!0),m=r.model.getTerminal(d,!0),u=[],p=e.isReversed;if(c!=o&&(p=!p),null!=s){var g=p?2:0,v=p?this.rankTopY[a]:this.rankBottomY[t],h=s[4*i+1+g];p&&(h=-h),v+=h,g=s[4*i+g],m=r.model.getTerminal(d,!0),this.layout.isPort(m)&&r.model.getParent(m)==c&&(g=null!=(g=r.view.getState(m))?g.x:c.geometry.x+e.source.width*m.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(g,v)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v+h))):(u.push(new mxPoint(v,g)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v+h,g)))}for(g=e.x.length-1,v=h=-1,c=e.maxRank-1,p&&(g=0,h=e.x.length,v=1,c=e.minRank+1);e.maxRank!=e.minRank&&g!=h;g+=v){m=e.x[g]+n;var f=(this.rankTopY[c]+this.rankBottomY[c+1])/2,b=(this.rankTopY[c-1]+this.rankBottomY[c])/2;if(p){var A=f;f=b,b=A}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(m,f)),u.push(new mxPoint(m,b))):(u.push(new mxPoint(f,m)),u.push(new mxPoint(b,m))),this.limitX=Math.max(this.limitX,m),c+=v}null!=s&&(g=p?2:0,v=p?this.rankBottomY[t]:this.rankTopY[a],h=s[4*i+3-g],p&&(h=-h),v-=h,g=s[4*i+2-g],p=r.model.getTerminal(d,!1),c=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(p)&&r.model.getParent(p)==c&&(g=null!=(g=r.view.getState(p))?g.x:c.geometry.x+e.target.width*p.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v-h)),u.push(new mxPoint(g,v))):(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v-h,g)),u.push(new mxPoint(v,g)))),e.isReversed&&this.processReversedEdge(e,d),this.layout.setEdgePoints(d,u),n=0==n?this.parallelEdgeSpacing:0<n?-n:-n+this.parallelEdgeSpacing,i++}e.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(e){var n=e.cell,t=e.x[0]-e.width/2,a=e.y[0]-e.height/2;this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],a),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],a+e.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(n,t,a):this.layout.setVertexLocation(n,a,t),this.limitX=Math.max(this.limitX,t+e.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(e,n){},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.weightedValue>e.weightedValue?-1:n.weightedValue<e.weightedValue?1:n.nudge?-1:1:0},mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(e,n){this.parent=e;var t=this.graph.model;if(this.edgesCache={},null!=n||null!=e){if(null!=n&&null!=e){for(var a=[],i=0;i<n.length;i++)t.isAncestor(e,n[i])&&a.push(n[i]);this.roots=a}else this.roots=n;t.beginUpdate();try{this.run(e),this.resizeParent&&!this.graph.isCellCollapsed(e)&&this.graph.updateGroupBounds([e],this.parentBorder,this.moveParent)}finally{t.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(e,n){var t=[];if(null!=e&&null!=n){var a,i=this.graph.model,s=null,o=-1e5;for(a in n){var r=n[a];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var l=this.getEdges(r),d=0,c=0,m=0;m<l.length;m++)this.getVisibleTerminal(l[m],!0)==r?d++:c++;0==c&&0<d&&t.push(r),o<(l=d-c)&&(o=l,s=r)}}0==t.length&&null!=s&&t.push(s)}return t},mxHierarchicalLayout.prototype.getEdges=function(e){var n=mxCellPath.create(e);if(null!=this.edgesCache[n])return this.edgesCache[n];for(var t=this.graph.model,a=[],i=this.graph.isCellCollapsed(e),s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o);this.isPort(r)?a=a.concat(t.getEdges(r,!0,!0)):!i&&this.graph.isCellVisible(r)||(a=a.concat(t.getEdges(r,!0,!0)))}for(a=a.concat(t.getEdges(e,!0,!0)),t=[],o=0;o<a.length;o++)((i=this.getVisibleTerminal(a[o],!0))==(s=this.getVisibleTerminal(a[o],!1))||i!=s&&(s==e&&(null==this.parent||this.graph.isValidAncestor(i,this.parent,this.traverseAncestors))||i==e&&(null==this.parent||this.graph.isValidAncestor(s,this.parent,this.traverseAncestors))))&&t.push(a[o]);return this.edgesCache[n]=t},mxHierarchicalLayout.prototype.getVisibleTerminal=function(e,n){var t=null!=(t=this.graph.view.getState(e))?t.getVisibleTerminal(n):this.graph.view.getVisibleTerminal(e,n);return this.isPort(t)&&(t=this.graph.model.getParent(t)),t},mxHierarchicalLayout.prototype.run=function(e){var n=[],t=[];if(null==this.roots&&null!=e){var a={};this.filterDescendants(e,a),this.roots=[];var i,s=!0;for(i in a)if(null!=a[i]){s=!1;break}for(;!s;){var o=this.findRoots(e,a);for(s=0;s<o.length;s++){var r=[];n.push(r),this.traverse(o[s],!0,null,t,r,n,a)}for(s=0;s<o.length;s++)this.roots.push(o[s]);for(i in s=!0,a)if(null!=a[i]){s=!1;break}}}else for(s=0;s<roots.length;s++)r=[],n.push(r),traverse(roots.get(s),!0,null,t,r,n,null);for(s=t=0;s<n.length;s++){for(i in a=[],r=n[s])a.push(r[i]);this.model=new mxGraphHierarchyModel(this,a,this.roots,e,this.tightenToSource),this.cycleStage(e),this.layeringStage(),this.crossingStage(e),t=this.placementStage(t,e)}},mxHierarchicalLayout.prototype.filterDescendants=function(e,n){var t=this.graph.model;if(t.isVertex(e)&&e!=this.parent&&this.graph.isCellVisible(e)&&(n[mxCellPath.create(e)]=e),this.traverseAncestors||e==this.parent&&this.graph.isCellVisible(e))for(var a=t.getChildCount(e),i=0;i<a;i++){var s=t.getChildAt(e,i);this.isPort(s)||this.filterDescendants(s,n)}},mxHierarchicalLayout.prototype.isPort=function(e){return!!e.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=this.getVisibleTerminal(a[s],!0),r=this.getVisibleTerminal(a[s],!1);(o==e&&r==n||!t&&o==n&&r==e)&&i.push(a[s])}return i},mxHierarchicalLayout.prototype.traverse=function(e,n,t,a,i,s,o){if(null!=e&&null!=a){var r=mxCellPath.create(e);if(null!=a[r]||null!=o&&null==o[r]){if(null==i[r])for(t=0;t<s.length;t++)if(null!=(e=s[t])[r]){for(l in i)e[l]=i[l];return s.pop(),e}}else{null==i[r]&&(i[r]=e),null==a[r]&&(a[r]=e),delete o[r];var l=this.getEdges(e);for(t=0;t<l.length;t++)r=this.getVisibleTerminal(l[t],!0)==e,(!n||r)&&(r=this.getVisibleTerminal(l[t],!r),i=this.traverse(r,n,l[t],a,i,s,o))}}return i},mxHierarchicalLayout.prototype.cycleStage=function(e){new mxMinimumCycleRemover(this).execute(e)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(e){new mxMedianHybridCrossingReduction(this).execute(e)},mxHierarchicalLayout.prototype.placementStage=function(e,n){var t=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,e,this.parallelEdgeSpacing);return t.fineTuning=this.fineTuning,t.execute(n),t.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(e){this.createIds=e},mxGraphModel.prototype.createRoot=function(){var e=new mxCell;return e.insert(new mxCell),e},mxGraphModel.prototype.getCell=function(e){return null!=this.cells?this.cells[e]:null},mxGraphModel.prototype.filterCells=function(e,n){var t=null;if(null!=e){t=[];for(var a=0;a<e.length;a++)n(e[a])&&t.push(e[a])}return t},mxGraphModel.prototype.getDescendants=function(e){return this.filterDescendants(null,e)},mxGraphModel.prototype.filterDescendants=function(e,n){var t=[];n=n||this.getRoot(),(null==e||e(n))&&t.push(n);for(var a=this.getChildCount(n),i=0;i<a;i++){var s=this.getChildAt(n,i);t=t.concat(this.filterDescendants(e,s))}return t},mxGraphModel.prototype.getRoot=function(e){var n=e||this.root;if(null!=e)for(;null!=e;)n=e,e=this.getParent(e);return n},mxGraphModel.prototype.setRoot=function(e){return this.execute(new mxRootChange(this,e)),e},mxGraphModel.prototype.rootChanged=function(e){var n=this.root;return this.root=e,this.nextId=0,this.cells=null,this.cellAdded(e),n},mxGraphModel.prototype.isRoot=function(e){return null!=e&&this.root==e},mxGraphModel.prototype.isLayer=function(e){return this.isRoot(this.getParent(e))},mxGraphModel.prototype.isAncestor=function(e,n){for(;null!=n&&n!=e;)n=this.getParent(n);return n==e},mxGraphModel.prototype.contains=function(e){return this.isAncestor(this.root,e)},mxGraphModel.prototype.getParent=function(e){return null!=e?e.getParent():null},mxGraphModel.prototype.add=function(e,n,t){if(n!=e&&null!=e&&null!=n){null==t&&(t=this.getChildCount(e));var a=e!=this.getParent(n);this.execute(new mxChildChange(this,e,n,t)),this.maintainEdgeParent&&a&&this.updateEdgeParents(n)}return n},mxGraphModel.prototype.cellAdded=function(e){if(null!=e){if(null==e.getId()&&this.createIds&&e.setId(this.createId(e)),null!=e.getId())if((n=this.getCell(e.getId()))!=e){for(;null!=n;)e.setId(this.createId(e)),n=this.getCell(e.getId());null==this.cells&&(this.cells={}),this.cells[e.getId()]=e}mxUtils.isNumeric(e.getId())&&(this.nextId=Math.max(this.nextId,e.getId()));for(var n=this.getChildCount(e),t=0;t<n;t++)this.cellAdded(this.getChildAt(e,t))}},mxGraphModel.prototype.createId=function(e){return e=this.nextId,this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(e,n){n=n||this.getRoot(e);for(var t=this.getChildCount(e),a=0;a<t;a++){var i=this.getChildAt(e,a);this.updateEdgeParents(i,n)}for(i=this.getEdgeCount(e),t=[],a=0;a<i;a++)t.push(this.getEdgeAt(e,a));for(a=0;a<t.length;a++)i=t[a],this.isAncestor(n,i)&&this.updateEdgeParent(i,n)},mxGraphModel.prototype.updateEdgeParent=function(e,n){for(var t=this.getTerminal(e,!0),a=this.getTerminal(e,!1),i=null;null!=t&&!this.isEdge(t)&&null!=t.geometry&&t.geometry.relative;)t=this.getParent(t);for(;null!=a&&!this.isEdge(a)&&null!=a.geometry&&a.geometry.relative;)a=this.getParent(a);if(this.isAncestor(n,t)&&this.isAncestor(n,a)&&(null!=(i=t==a?this.getParent(t):this.getNearestCommonAncestor(t,a))&&(this.getParent(i)!=this.root||this.isAncestor(i,e))&&this.getParent(e)!=i)){if(null!=(t=this.getGeometry(e))){var s=this.getOrigin(this.getParent(e)),o=this.getOrigin(i);a=o.x-s.x,s=o.y-s.y;(t=t.clone()).translate(-a,-s),this.setGeometry(e,t)}this.add(i,e,this.getChildCount(i))}},mxGraphModel.prototype.getOrigin=function(e){var n=null;return null!=e?(n=this.getOrigin(this.getParent(e)),this.isEdge(e)||null!=(e=this.getGeometry(e))&&(n.x+=e.x,n.y+=e.y)):n=new mxPoint,n},mxGraphModel.prototype.getNearestCommonAncestor=function(e,n){if(null!=e&&null!=n&&(null!=(s=mxCellPath.create(n))&&0<s.length)){var t=e,a=mxCellPath.create(t);if(s.length<a.length){t=n;var i=a,s=(a=s,i)}for(;null!=t;){if(i=this.getParent(t),0==s.indexOf(a+mxCellPath.PATH_SEPARATOR)&&null!=i)return t;a=mxCellPath.getParentPath(a),t=i}}return null},mxGraphModel.prototype.remove=function(e){return e==this.root?this.setRoot(null):null!=this.getParent(e)&&this.execute(new mxChildChange(this,null,e)),e},mxGraphModel.prototype.cellRemoved=function(e){if(null!=e&&null!=this.cells){for(var n=this.getChildCount(e)-1;0<=n;n--)this.cellRemoved(this.getChildAt(e,n));null!=this.cells&&null!=e.getId()&&delete this.cells[e.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(e,n,t){var a=this.getParent(e);return null!=n?(n!=a||a.getIndex(e)!=t)&&n.insert(e,t):null!=a&&(t=a.getIndex(e),a.remove(t)),this.contains(a)||null==n?null==n&&this.cellRemoved(e):this.cellAdded(e),a},mxGraphModel.prototype.getChildCount=function(e){return null!=e?e.getChildCount():0},mxGraphModel.prototype.getChildAt=function(e,n){return null!=e?e.getChildAt(n):null},mxGraphModel.prototype.getChildren=function(e){return null!=e?e.children:null},mxGraphModel.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraphModel.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraphModel.prototype.getChildCells=function(e,n,t){n=null!=n&&n,t=null!=t&&t;for(var a=this.getChildCount(e),i=[],s=0;s<a;s++){var o=this.getChildAt(e,s);(!t&&!n||t&&this.isEdge(o)||n&&this.isVertex(o))&&i.push(o)}return i},mxGraphModel.prototype.getTerminal=function(e,n){return null!=e?e.getTerminal(n):null},mxGraphModel.prototype.setTerminal=function(e,n,t){var a=n!=this.getTerminal(e,t);return this.execute(new mxTerminalChange(this,e,n,t)),this.maintainEdgeParent&&a&&this.updateEdgeParent(e,this.getRoot()),n},mxGraphModel.prototype.setTerminals=function(e,n,t){this.beginUpdate();try{this.setTerminal(e,n,!0),this.setTerminal(e,t,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(e,n,t){var a=this.getTerminal(e,t);return null!=n?n.insertEdge(e,t):null!=a&&a.removeEdge(e,t),a},mxGraphModel.prototype.getEdgeCount=function(e){return null!=e?e.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(e,n){return null!=e?e.getEdgeAt(n):null},mxGraphModel.prototype.getDirectedEdgeCount=function(e,n,t){for(var a=0,i=this.getEdgeCount(e),s=0;s<i;s++){var o=this.getEdgeAt(e,s);o!=t&&this.getTerminal(o,n)==e&&a++}return a},mxGraphModel.prototype.getConnections=function(e){return this.getEdges(e,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(e){return this.getEdges(e,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(e){return this.getEdges(e,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(e,n,t,a){n=null==n||n,t=null==t||t,a=null==a||a;for(var i=this.getEdgeCount(e),s=[],o=0;o<i;o++){var r=this.getEdgeAt(e,o),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(a&&l==d||l!=d&&(n&&d==e||t&&l==e))&&s.push(r)}return s},mxGraphModel.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;var a=this.getEdgeCount(e),i=this.getEdgeCount(n),s=e,o=a;for(i<a&&(o=i,s=n),a=[],i=0;i<o;i++){var r=this.getEdgeAt(s,i),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(l==e&&d==n||!t&&(d==e&&l==n))&&a.push(r)}return a},mxGraphModel.prototype.getOpposites=function(e,n,t,a){t=null==t||t,a=null==a||a;var i=[];if(null!=e)for(var s=0;s<e.length;s++){var o=this.getTerminal(e[s],!0),r=this.getTerminal(e[s],!1);o==n&&null!=r&&r!=n&&a?i.push(r):r==n&&null!=o&&o!=n&&t&&i.push(o)}return i},mxGraphModel.prototype.getTopmostCells=function(e){for(var n=[],t=0;t<e.length;t++){for(var a=e[t],i=!0,s=this.getParent(a);null!=s;){if(0<=mxUtils.indexOf(e,s)){i=!1;break}s=this.getParent(s)}i&&n.push(a)}return n},mxGraphModel.prototype.isVertex=function(e){return null!=e&&e.isVertex()},mxGraphModel.prototype.isEdge=function(e){return null!=e&&e.isEdge()},mxGraphModel.prototype.isConnectable=function(e){return null!=e&&e.isConnectable()},mxGraphModel.prototype.getValue=function(e){return null!=e?e.getValue():null},mxGraphModel.prototype.setValue=function(e,n){return this.execute(new mxValueChange(this,e,n)),n},mxGraphModel.prototype.valueForCellChanged=function(e,n){return e.valueChanged(n)},mxGraphModel.prototype.getGeometry=function(e,n){return null!=e?e.getGeometry():null},mxGraphModel.prototype.setGeometry=function(e,n){return n!=this.getGeometry(e)&&this.execute(new mxGeometryChange(this,e,n)),n},mxGraphModel.prototype.geometryForCellChanged=function(e,n){var t=this.getGeometry(e);return e.setGeometry(n),t},mxGraphModel.prototype.getStyle=function(e){return null!=e?e.getStyle():null},mxGraphModel.prototype.setStyle=function(e,n){return n!=this.getStyle(e)&&this.execute(new mxStyleChange(this,e,n)),n},mxGraphModel.prototype.styleForCellChanged=function(e,n){var t=this.getStyle(e);return e.setStyle(n),t},mxGraphModel.prototype.isCollapsed=function(e){return null!=e&&e.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(e,n){return n!=this.isCollapsed(e)&&this.execute(new mxCollapseChange(this,e,n)),n},mxGraphModel.prototype.collapsedStateForCellChanged=function(e,n){var t=this.isCollapsed(e);return e.setCollapsed(n),t},mxGraphModel.prototype.isVisible=function(e){return null!=e&&e.isVisible()},mxGraphModel.prototype.setVisible=function(e,n){return n!=this.isVisible(e)&&this.execute(new mxVisibleChange(this,e,n)),n},mxGraphModel.prototype.visibleStateForCellChanged=function(e,n){var t=this.isVisible(e);return e.setVisible(n),t},mxGraphModel.prototype.execute=function(e){e.execute(),this.beginUpdate(),this.currentEdit.add(e),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",e)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var e=this.currentEdit;this.currentEdit=this.createUndoableEdit(),e.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(){var e=new mxUndoableEdit(this,!0);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(e,n,t){t=null==t||t,this.beginUpdate();try{var a={};for(var i in this.mergeChildrenImpl(e,n,t,a),a){var s=a[i],o=this.getTerminal(s,!0);null!=o&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!0)),null!=(o=this.getTerminal(s,!1))&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(e,n,t,a){this.beginUpdate();try{for(var i=e.getChildCount(),s=0;s<i;s++){var o=e.getChildAt(s);if("function"==typeof o.getId){var r=o.getId(),l=null==r||this.isEdge(o)&&t?null:this.getCell(r);if(null==l){var d=o.clone();d.setId(r),d.setTerminal(o.getTerminal(!0),!0),d.setTerminal(o.getTerminal(!1),!1),l=n.insert(d),this.cellAdded(l)}a[mxCellPath.create(o)]=l,this.mergeChildrenImpl(o,l,t,a)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(e){var n=[];if(null!=e)for(var t={},a=0;a<e.length;a++){var i=this.getParent(e[a]);if(null!=i){var s=mxCellPath.create(i);null==t[s]&&(t[s]=i,n.push(i))}}return n},mxGraphModel.prototype.cloneCell=function(e){return null!=e?this.cloneCells([e],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(e,n){for(var t={},a=[],i=0;i<e.length;i++)null!=e[i]?a.push(this.cloneCellImpl(e[i],t,n)):a.push(null);for(i=0;i<a.length;i++)null!=a[i]&&this.restoreClone(a[i],e[i],t);return a},mxGraphModel.prototype.cloneCellImpl=function(e,n,t){var a=this.cellCloned(e);if(n[mxObjectIdentity.get(e)]=a,t){t=this.getChildCount(e);for(var i=0;i<t;i++){var s=this.cloneCellImpl(this.getChildAt(e,i),n,!0);a.insert(s)}}return a},mxGraphModel.prototype.cellCloned=function(e){return e.clone()},mxGraphModel.prototype.restoreClone=function(e,n,t){null!=(a=this.getTerminal(n,!0))&&(null!=(a=t[mxObjectIdentity.get(a)])&&a.insertEdge(e,!0)),null!=(a=this.getTerminal(n,!1))&&(null!=(a=t[mxObjectIdentity.get(a)])&&a.insertEdge(e,!1));for(var a=this.getChildCount(e),i=0;i<a;i++)this.restoreClone(this.getChildAt(e,i),this.getChildAt(n,i),t)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var e=this.model.getParent(this.child),n=null!=e?e.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),e=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=e,this.index=this.previousIndex,this.previousIndex=n},mxChildChange.prototype.connect=function(e,n){n=null==n||n;var t=e.getTerminal(!0),a=e.getTerminal(!1);for(null!=t&&(n?this.model.terminalForCellChanged(e,t,!0):this.model.terminalForCellChanged(e,null,!0)),null!=a&&(n?this.model.terminalForCellChanged(e,a,!1):this.model.terminalForCellChanged(e,null,!1)),e.setTerminal(t,!0),e.setTerminal(a,!1),t=this.model.getChildCount(e),a=0;a<t;a++)this.connect(this.model.getChildAt(e,a),n)},mxTerminalChange.prototype.execute=function(){this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)},mxValueChange.prototype.execute=function(){this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous)},mxStyleChange.prototype.execute=function(){this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous)},mxGeometryChange.prototype.execute=function(){this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous)},mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)},mxVisibleChange.prototype.execute=function(){this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)},mxCellAttributeChange.prototype.execute=function(){var e=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=e},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient="id value parent source target children edges".split(" "),mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(e){this.id=e},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(e){this.value=e},mxCell.prototype.valueChanged=function(e){var n=this.getValue();return this.setValue(e),n},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(e){this.geometry=e},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(e){this.style=e},mxCell.prototype.isVertex=function(){return this.vertex},mxCell.prototype.setVertex=function(e){this.vertex=e},mxCell.prototype.isEdge=function(){return this.edge},mxCell.prototype.setEdge=function(e){this.edge=e},mxCell.prototype.isConnectable=function(){return this.connectable},mxCell.prototype.setConnectable=function(e){this.connectable=e},mxCell.prototype.isVisible=function(){return this.visible},mxCell.prototype.setVisible=function(e){this.visible=e},mxCell.prototype.isCollapsed=function(){return this.collapsed},mxCell.prototype.setCollapsed=function(e){this.collapsed=e},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(e){this.parent=e},mxCell.prototype.getTerminal=function(e){return e?this.source:this.target},mxCell.prototype.setTerminal=function(e,n){return n?this.source=e:this.target=e,e},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(e){return mxUtils.indexOf(this.children,e)},mxCell.prototype.getChildAt=function(e){return null==this.children?null:this.children[e]},mxCell.prototype.insert=function(e,n){return null!=e&&(null==n&&(n=this.getChildCount(),e.getParent()==this&&n--),e.removeFromParent(),e.setParent(this),null==this.children?(this.children=[],this.children.push(e)):this.children.splice(n,0,e)),e},mxCell.prototype.remove=function(e){var n=null;return null!=this.children&&0<=e&&(null!=(n=this.getChildAt(e))&&(this.children.splice(e,1),n.setParent(null))),n},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var e=this.parent.getIndex(this);this.parent.remove(e)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(e){return mxUtils.indexOf(this.edges,e)},mxCell.prototype.getEdgeAt=function(e){return null==this.edges?null:this.edges[e]},mxCell.prototype.insertEdge=function(e,n){return null!=e&&(e.removeFromTerminal(n),e.setTerminal(this,n),null==this.edges||e.getTerminal(!n)!=this||mxUtils.indexOf(this.edges,e)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(e)),e},mxCell.prototype.removeEdge=function(e,n){if(null!=e){if(e.getTerminal(!n)!=this&&null!=this.edges){var t=this.getEdgeIndex(e);0<=t&&this.edges.splice(t,1)}e.setTerminal(null,n)}return e},mxCell.prototype.removeFromTerminal=function(e){var n=this.getTerminal(e);null!=n&&n.removeEdge(this,e)},mxCell.prototype.getAttribute=function(e,n){var t=this.getValue();return(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT?t.getAttribute(e):null)||n},mxCell.prototype.setAttribute=function(e,n){var t=this.getValue();null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT&&t.setAttribute(e,n)},mxCell.prototype.clone=function(){var e=mxUtils.clone(this,this.mxTransient);return e.setValue(this.cloneValue()),e},mxCell.prototype.cloneValue=function(){var e=this.getValue();return null!=e&&("function"==typeof e.clone?e=e.clone():isNaN(e.nodeType)||(e=e.cloneNode(!0))),e},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=e}},mxGeometry.prototype.getTerminalPoint=function(e){return e?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(e,n){return n?this.sourcePoint=e:this.targetPoint=e,e},mxGeometry.prototype.translate=function(e,n){if(this.clone(),this.relative||(this.x+=e,this.y+=n),null!=this.sourcePoint&&(this.sourcePoint.x+=e,this.sourcePoint.y+=n),null!=this.targetPoint&&(this.targetPoint.x+=e,this.targetPoint.y+=n),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var t=this.points.length,a=0;a<t;a++){var i=this.points[a];null!=i&&(i.x+=e,i.y+=n)}};var mxCellPath={PATH_SEPARATOR:".",create:function(e){var n="";if(null!=e)for(var t=e.getParent();null!=t;)n=t.getIndex(e)+mxCellPath.PATH_SEPARATOR+n,t=(e=t).getParent();return 1<(e=n.length)&&(n=n.substring(0,e-1)),n},getParentPath:function(e){if(null!=e){var n=e.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=n)return e.substring(0,n);if(0<e.length)return""}return null},resolve:function(e,n){var t=e;if(null!=n)for(var a=n.split(mxCellPath.PATH_SEPARATOR),i=0;i<a.length;i++)t=t.getChildAt(parseInt(a[i]));return t},compare:function(e,n){for(var t=Math.min(e.length,n.length),a=0,i=0;i<t;i++)if(e[i]!=n[i]){a=0==e[i].length||0==n[i].length?e[i]==n[i]?0:e[i]>n[i]?1:-1:(t=parseInt(e[i]))==(i=parseInt(n[i]))?0:i<t?1:-1;break}return 0==a&&((t=e.length)!=(i=n.length)&&(a=i<t?1:-1)),a}},mxPerimeter={RectanglePerimeter:function(e,n,t,a){n=e.getCenterX();var i=e.getCenterY(),s=Math.atan2(t.y-i,t.x-n),o=new mxPoint(0,0),r=Math.PI,l=Math.PI/2-s,d=Math.atan2(e.height,e.width);return s<-r+d||r-d<s?(o.x=e.x,o.y=i-e.width*Math.tan(s)/2):s<-d?(o.y=e.y,o.x=n-e.height*Math.tan(l)/2):s<d?(o.x=e.x+e.width,o.y=i+e.width*Math.tan(s)/2):(o.y=e.y+e.height,o.x=n+e.height*Math.tan(l)/2),a&&(t.x>=e.x&&t.x<=e.x+e.width?o.x=t.x:t.y>=e.y&&t.y<=e.y+e.height&&(o.y=t.y),t.x<e.x?o.x=e.x:t.x>e.x+e.width&&(o.x=e.x+e.width),t.y<e.y?o.y=e.y:t.y>e.y+e.height&&(o.y=e.y+e.height)),o},EllipsePerimeter:function(e,n,t,a){var i=e.x,s=e.y,o=e.width/2,r=e.height/2,l=i+o,d=s+r;n=t.x,t=t.y;var c=parseInt(n-l),m=parseInt(t-d);if(0==c&&0!=m)return new mxPoint(l,d+r*m/Math.abs(m));if(0==c&&0==m)return new mxPoint(n,t);if(a){if(s<=t&&t<=s+e.height)return e=t-d,e=Math.sqrt(o*o*(1-e*e/(r*r)))||0,n<=i&&(e=-e),new mxPoint(l+e,t);if(i<=n&&n<=i+e.width)return e=n-l,e=Math.sqrt(r*r*(1-e*e/(o*o)))||0,t<=s&&(e=-e),new mxPoint(n,d+e)}return d-=(i=m/c)*l,l=i*(o=(-(e=-2*l*(s=o*o*i*i+r*r))+(r=Math.sqrt(e*e-4*s*(o*o*i*i*l*l+r*r*l*l-o*o*r*r))))/(2*s))+d,d=i*(r=(-e-r)/(2*s))+d,i=Math.sqrt(Math.pow(o-n,2)+Math.pow(l-t,2)),n=Math.sqrt(Math.pow(r-n,2)+Math.pow(d-t,2)),s=t=0,s=i<n?(t=o,l):(t=r,d),new mxPoint(t,s)},RhombusPerimeter:function(e,n,t,a){n=e.x;var i=e.y,s=e.width,o=n+s/2,r=i+(e=e.height)/2,l=t.x;if(t=t.y,o==l)return new mxPoint(o,t<r?i:i+e);if(r==t)return new mxPoint(l<o?n:n+s,r);var d=o,c=r;return a&&(n<=l&&l<=n+s?d=l:i<=t&&t<=i+e&&(c=t)),l<o?t<r?mxUtils.intersection(l,t,d,c,o,i,n,r):mxUtils.intersection(l,t,d,c,o,i+e,n,r):t<r?mxUtils.intersection(l,t,d,c,o,i,n+s,r):mxUtils.intersection(l,t,d,c,o,i+e,n+s,r)},TrianglePerimeter:function(e,n,t,a){var i=(n=null!=n?n.style[mxConstants.STYLE_DIRECTION]:null)==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH,s=e.x,o=e.y,r=e.width,l=s+r/2,d=o+(e=e.height)/2,c=new mxPoint(s,o),m=new mxPoint(s+r,d),u=new mxPoint(s,o+e);n==mxConstants.DIRECTION_NORTH?(c=u,m=new mxPoint(l,o),u=new mxPoint(s+r,o+e)):n==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(l,o+e),u=new mxPoint(s+r,o)):n==mxConstants.DIRECTION_WEST&&(c=new mxPoint(s+r,o),m=new mxPoint(s,d),u=new mxPoint(s+r,o+e));var p=t.x-l,g=t.y-d,v=(p=i?Math.atan2(p,g):Math.atan2(g,p),i?Math.atan2(r,e):Math.atan2(e,r));g=!1,g=n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_WEST?-v<p&&p<v:p<-Math.PI+v||p>Math.PI-v,v=null;return null==(v=g?a&&(i&&t.x>=c.x&&t.x<=u.x||!i&&t.y>=c.y&&t.y<=u.y)?i?new mxPoint(t.x,c.y):new mxPoint(c.x,t.y):n==mxConstants.DIRECTION_NORTH?new mxPoint(s+r/2+e*Math.tan(p)/2,o+e):n==mxConstants.DIRECTION_SOUTH?new mxPoint(s+r/2-e*Math.tan(p)/2,o):n==mxConstants.DIRECTION_WEST?new mxPoint(s+r,o+e/2+r*Math.tan(p)/2):new mxPoint(s,o+e/2-r*Math.tan(p)/2):(a&&(a=new mxPoint(l,d),t.y>=o&&t.y<=o+e?(a.x=i?l:n==mxConstants.DIRECTION_WEST?s+r:s,a.y=t.y):t.x>=s&&t.x<=s+r&&(a.x=t.x,a.y=i?n==mxConstants.DIRECTION_NORTH?o+e:o:d),l=a.x,d=a.y),i&&t.x<=s+r/2||!i&&t.y<=o+e/2?mxUtils.intersection(t.x,t.y,l,d,c.x,c.y,m.x,m.y):mxUtils.intersection(t.x,t.y,l,d,m.x,m.y,u.x,u.y)))&&(v=new mxPoint(l,d)),v}};function mxPrintPreview(e,n,t,a,i,s,o,r,l){this.graph=e,this.scale=null!=n?n:1/e.pageScale,this.border=null!=a?a:0,this.pageFormat=null!=t?t:e.pageFormat,this.title=null!=r?r:"Printer-friendly version",this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==l||l}function mxStylesheet(){this.styles={},this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(e,n,t){this.view=e,this.cell=n,this.style=t,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(e){this.graph=e,this.cells=[]}function mxSelectionChange(e,n,t){this.selectionModel=e,this.added=null!=n?n.slice():null,this.removed=null!=t?t.slice():null}function mxCellEditor(e){this.graph=e}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var e="";return 8==document.documentMode&&(e='<meta http-equiv="X-UA-Compatible" content="IE=8">'),e},mxPrintPreview.prototype.open=function(e){var n=this.graph.cellRenderer.initializeOverlay,t=null;try{if(this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(e,n){n.init(e.view.getDrawPane())}),null==this.wnd){this.wnd=window.open();var a=this.wnd.document,i=this.getDoctype();null!=i&&0<i.length&&a.writeln(i),a.writeln("<html>"),a.writeln("<head>"),this.writeHead(a,e),a.writeln("</head>"),a.writeln('<body class="mxPage">'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a),mxClient.IS_VML&&(a.namespaces.add("v","urn:schemas-microsoft-com:vml"),a.namespaces.add("o","urn:schemas-microsoft-com:office:office"),a.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css",a));var s=this.graph.getGraphBounds().clone(),o=this.graph.getView().getScale(),r=o/this.scale,l=this.graph.getView().getTranslate();this.autoOrigin||(this.x0=-l.x*this.scale,this.y0=-l.y*this.scale,s.width+=s.x,s.height+=s.y,s.x=0,this.border=s.y=0),s.width/=r,s.height/=r;var d=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border,m=Math.max(1,Math.ceil((s.width+this.x0)/d)),u=Math.max(1,Math.ceil((s.height+this.y0)/c));this.pageCount=m*u;var p=mxUtils.bind(this,function(){if(this.pageSelector&&(1<u||1<m)){var e=this.createPageSelector(u,m);if(a.body.appendChild(e),mxClient.IS_IE){e.style.position="absolute";var n=function(){e.style.top=a.body.scrollTop+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(e){n()}),mxEvent.addListener(this.wnd,"resize",function(e){n()})}}});if(e=function(e,n){if(null!=this.borderColor&&(e.style.borderColor=this.borderColor,e.style.borderStyle="solid",e.style.borderWidth="1px"),e.style.background="white",n&&(e.style.pageBreakAfter="always"),mxClient.IS_IE?(a.writeln(e.outerHTML),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),a.body.appendChild(e)),n){var t=a.createElement("hr");t.className="mxPageBreak",a.body.appendChild(t)}},null!=(f=this.getCoverPages(this.pageFormat.width,this.pageFormat.height)))for(var g=0;g<f.length;g++)e(f[g],!0);var v=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(g=0;g<u;g++)for(var h=g*c/this.scale-this.y0/this.scale+(s.y-l.y*o)/o,f=0;f<m;f++){if(null==this.wnd)return null;var b=f*d/this.scale-this.x0/this.scale+(s.x-l.x*o)/o,A=g*m+f+1;(t=this.renderPage(this.pageFormat.width,this.pageFormat.height,mxUtils.bind(this,function(e){this.addGraphFragment(-b,-h,this.scale,A,e)}))).setAttribute("id","mxPage-"+A),e(t,null!=v||g<u-1||f<m-1)}if(null!=v)for(g=0;g<v.length;g++)e(v[g],g<v.length);a.writeln("</body>"),a.writeln("</html>"),a.close(),p(),mxEvent.release(a.body)}this.wnd.focus()}catch(e){null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t)}finally{this.graph.cellRenderer.initializeOverlay=n}return this.wnd},mxPrintPreview.prototype.writeHead=function(e,n){null!=this.title&&e.writeln("<title>"+this.title+"</title>"),e.writeln('<style type="text/css">'),e.writeln("@media print {"),e.writeln("  table.mxPageSelector { display: none; }"),e.writeln("  hr.mxPageBreak { display: none; }"),e.writeln("}"),e.writeln("@media screen {"),e.writeln("  table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),e.writeln("  table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),e.writeln("  body.mxPage { background: gray; }"),e.writeln("}"),null!=n&&e.writeln(n),e.writeln("</style>")},mxPrintPreview.prototype.createPageSelector=function(e,n){var t=this.wnd.document,a=t.createElement("table");a.className="mxPageSelector",a.setAttribute("border","0");for(var i=t.createElement("tbody"),s=0;s<e;s++){for(var o=t.createElement("tr"),r=0;r<n;r++){var l=s*n+r+1,d=t.createElement("td");if(!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC){var c=t.createElement("a");c.setAttribute("href","#mxPage-"+l),mxUtils.write(c,l,t),d.appendChild(c)}else mxUtils.write(d,l,t);o.appendChild(d)}i.appendChild(o)}return a.appendChild(i),a},mxPrintPreview.prototype.renderPage=function(e,n,t){var a=document.createElement("div");try{a.style.width=e+"px",a.style.height=n+"px",a.style.overflow="hidden",a.style.pageBreakInside="avoid",a.style.position="relative";var i=document.createElement("div");i.style.top=this.border+"px",i.style.left=this.border+"px",i.style.width=e-2*this.border+"px",i.style.height=n-2*this.border+"px",i.style.overflow="hidden",this.graph.dialect==mxConstants.DIALECT_VML&&(i.style.position="absolute"),a.appendChild(i),document.body.appendChild(a),t(i)}catch(e){throw a.parentNode.removeChild(a),e}return a},mxPrintPreview.prototype.addGraphFragment=function(e,n,t,a,i){a=this.graph.getView();var s=this.graph.container;this.graph.container=i;var o=a.getCanvas(),r=a.getBackgroundPane(),l=a.getDrawPane(),d=a.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?a.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?a.createVml():a.createHtml();var c=a.isEventsEnabled();a.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var u=a.getTranslate();a.translate=new mxPoint(e,n),e=null;try{var p=[this.graph.getModel().getRoot()];e=new mxTemporaryCellStates(a,t,p)}finally{if(mxClient.IS_IE)a.overlayPane.innerHTML="";else for(t=i.firstChild;null!=t;)p=t.nextSibling,"svg"==(n=t.nodeName.toLowerCase())?(t.setAttribute("width",parseInt(i.style.width)),t.setAttribute("height",parseInt(i.style.height))):"default"!=t.style.cursor&&"table"!=n&&t.parentNode.removeChild(t),t=p;a.overlayPane.parentNode.removeChild(a.overlayPane),this.graph.setEnabled(m),this.graph.container=s,a.canvas=o,a.backgroundPane=r,a.drawPane=l,a.overlayPane=d,a.translate=u,e.destroy(),a.setEventsEnabled(c)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(){var e=this.open();null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.createDefaultVertexStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#774400",e},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,e[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#446299",e},mxStylesheet.prototype.putDefaultVertexStyle=function(e){this.putCellStyle("defaultVertex",e)},mxStylesheet.prototype.putDefaultEdgeStyle=function(e){this.putCellStyle("defaultEdge",e)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(e,n){this.styles[e]=n},mxStylesheet.prototype.getCellStyle=function(e,n){var t=n;if(null!=e&&0<e.length)for(var a=e.split(";"),i=(t=null!=t&&";"!=e.charAt(0)?mxUtils.clone(t):{},0);i<a.length;i++){var s=(o=a[i]).indexOf("=");if(0<=s){var o,r=o.substring(0,s);(o=o.substring(s+1))==mxConstants.NONE?delete t[r]:mxUtils.isNumeric(o)?t[r]=parseFloat(o):t[r]=o}else if(null!=(o=this.styles[o]))for(r in o)t[r]=o[r]}return t},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalid=!0,mxCellState.prototype.invalidOrder=!1,mxCellState.prototype.orderChanged=!1,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.getPerimeterBounds=function(e,n){if(e=e||0,n=null!=n?n:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil){var t=this.shape.stencil.computeAspect(this.style,n.x,n.y,n.width,n.height);n.x=t.x,n.y=t.y,n.width=this.shape.stencil.w0*t.width,n.height=this.shape.stencil.h0*t.height}return 0!=e&&n.grow(e),n},mxCellState.prototype.setAbsoluteTerminalPoint=function(e,n){n?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[0]=e):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(e)):1==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[this.absolutePoints.length-1]=e},mxCellState.prototype.setCursor=function(e){null!=this.shape&&this.shape.setCursor(e),null!=this.text&&this.text.setCursor(e)},mxCellState.prototype.getVisibleTerminal=function(e){return null!=(e=this.getVisibleTerminalState(e))?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(e){return e?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(e,n){n?this.visibleSourceState=e:this.visibleTargetState=e},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxCellState.prototype.clone=function(){var e=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){e.absolutePoints=[];for(var n=0;n<this.absolutePoints.length;n++)e.absolutePoints[n]=this.absolutePoints[n].clone()}return null!=this.origin&&(e.origin=this.origin.clone()),null!=this.absoluteOffset&&(e.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(e.boundingBox=this.boundingBox.clone()),e.terminalDistance=this.terminalDistance,e.segments=this.segments,e.length=this.length,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(e){this.singleSelection=e},mxGraphSelectionModel.prototype.isSelected=function(e){return null!=e&&0<=mxUtils.indexOf(this.cells,e)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(e){null!=e&&this.setCells([e])},mxGraphSelectionModel.prototype.setCells=function(e){if(null!=e){this.singleSelection&&(e=[this.getFirstSelectableCell(e)]);for(var n=[],t=0;t<e.length;t++)this.graph.isCellSelectable(e[t])&&n.push(e[t]);this.changeSelection(n,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(e){if(null!=e)for(var n=0;n<e.length;n++)if(this.graph.isCellSelectable(e[n]))return e[n];return null},mxGraphSelectionModel.prototype.addCell=function(e){null!=e&&this.addCells([e])},mxGraphSelectionModel.prototype.addCells=function(e){if(null!=e){var n=null;this.singleSelection&&(n=this.cells,e=[this.getFirstSelectableCell(e)]);for(var t=[],a=0;a<e.length;a++)!this.isSelected(e[a])&&this.graph.isCellSelectable(e[a])&&t.push(e[a]);this.changeSelection(t,n)}},mxGraphSelectionModel.prototype.removeCell=function(e){null!=e&&this.removeCells([e])},mxGraphSelectionModel.prototype.removeCells=function(e){if(null!=e){for(var n=[],t=0;t<e.length;t++)this.isSelected(e[t])&&n.push(e[t]);this.changeSelection(null,n)}},mxGraphSelectionModel.prototype.changeSelection=function(e,n){if(null!=e&&0<e.length&&null!=e[0]||null!=n&&0<n.length&&null!=n[0]){var t=new mxSelectionChange(this,e,n);t.execute();var a=new mxUndoableEdit(this,!1);a.add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a))}},mxGraphSelectionModel.prototype.cellAdded=function(e){null!=e&&!this.isSelected(e)&&this.cells.push(e)},mxGraphSelectionModel.prototype.cellRemoved=function(e){null!=e&&(0<=(e=mxUtils.indexOf(this.cells,e))&&this.cells.splice(e,1))},mxSelectionChange.prototype.execute=function(){var e=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var n=0;n<this.removed.length;n++)this.selectionModel.cellRemoved(this.removed[n]);if(null!=this.added)for(n=0;n<this.added.length;n++)this.selectionModel.cellAdded(this.added[n]);n=this.added,this.added=this.removed,this.removed=n,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",e),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.emptyLabelText="",mxCellEditor.prototype.textNode="",mxCellEditor.prototype.init=function(){this.textarea=document.createElement("textarea"),this.textarea.className="mxCellEditor",this.textarea.style.position="absolute",this.textarea.style.overflow="visible",this.textarea.setAttribute("cols","20"),this.textarea.setAttribute("rows","4"),mxClient.IS_NS&&(this.textarea.style.resize="none"),mxEvent.addListener(this.textarea,"blur",mxUtils.bind(this,function(e){this.focusLost()})),mxEvent.addListener(this.textarea,"keydown",mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(113==e.keyCode||this.graph.isEnterStopsCellEditing()&&13==e.keyCode&&!mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e)?(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode?(this.graph.stopEditing(!0),mxEvent.consume(e)):(this.clearOnChange&&(this.clearOnChange=!1,this.textarea.value=""),this.setModified(!0)))})),mxEvent.addListener(this.textarea,"keypress",mxUtils.bind(this,function(e){this.autoSize&&!mxEvent.isConsumed(e)&&setTimeout(mxUtils.bind(this,function(){this.resize()}),0)}))},mxCellEditor.prototype.resize=function(){if(null!=this.textDiv){var e=this.graph.getView().getState(this.editingCell),n=this.graph.isLabelClipped(e.cell),t=this.graph.isWrapping(e.cell);if(this.graph.getModel().isEdge(e.cell))this.bounds.x=e.absoluteOffset.x,this.bounds.y=e.absoluteOffset.y,this.bounds.width=0,this.bounds.height=0;else if(null!=this.bounds){this.bounds.x=e.x,this.bounds.y=e.y,this.bounds.width=e.width,this.bounds.height=e.height,(a=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?this.bounds.x-=e.width:a==mxConstants.ALIGN_RIGHT&&(this.bounds.x+=e.width),(a=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?this.bounds.y-=e.height:a==mxConstants.ALIGN_BOTTOM&&(this.bounds.y+=e.height)}"\n"!=(a=this.textarea.value).charAt(a.length-1)&&""!=a||(a+="&nbsp;"),a=mxUtils.htmlEntities(a,!1),t?(this.textDiv.style.whiteSpace="normal",this.textDiv.style.width=this.bounds.width+"px"):a=a.replace(/ /g,"&nbsp;"),a=a.replace(/\n/g,"<br/>"),this.textDiv.innerHTML=a;var a=this.textDiv.offsetWidth+30,i=this.textDiv.offsetHeight+16;a=Math.max(a,40),i=Math.max(i,20);n&&(a=Math.min(this.bounds.width-4,a),i=Math.min(this.bounds.height,i));var s=null!=e.text?e.text.margin:null;null==s&&(s=mxUtils.getValue(e.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getAlignmentAsPoint(s,e)),null!=s&&(!n&&t||(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-s.x*this.bounds.width+s.x*a)-3)+"px"),this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-s.y*this.bounds.height+s.y*i)+4)+"px"),!n&&t||(this.textarea.style.width=a+"px"),this.textarea.style.height=i+"px"}},mxCellEditor.prototype.isModified=function(){return this.modified},mxCellEditor.prototype.setModified=function(e){this.modified=e},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.startEditing=function(e,n){null==this.textarea&&this.init(),this.stopEditing(!0);var t=this.graph.getView().getState(e);if(null!=t){this.editingCell=e,this.trigger=n,(this.textNode=null)!=t.text&&this.isHideLabel(t)&&(this.textNode=t.text.node,this.textNode.style.visibility="hidden");var a=this.graph.getView().scale,i=(a=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)*a,mxUtils.getValue(t.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)),s=mxUtils.getValue(t.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,d=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.lineHeight=Math.round(a*mxConstants.LINE_HEIGHT)+"px",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=o,this.textarea.style.color=s,this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.textDecoration=d?"underline":"",this.textarea.style.overflow="auto",this.textarea.style.outline="none",this.bounds=a=this.getEditorBounds(t),this.textarea.style.left=a.x+"px",this.textarea.style.top=a.y+"px",this.textarea.style.width=a.width+"px",this.textarea.style.height=a.height+"px",this.textarea.style.zIndex=5,null==(t=this.getInitialValue(t,n))||0==t.length?(t=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=!1,this.setModified(!1),this.textarea.value=t,this.graph.container.appendChild(this.textarea),"none"!=this.textarea.style.display&&(this.autoSize&&(this.textDiv=this.createTextDiv(),document.body.appendChild(this.textDiv),this.resize()),this.textarea.focus(),this.textarea.select())}},mxCellEditor.prototype.createTextDiv=function(){var e=document.createElement("div"),n=e.style;return n.position="absolute",n.whiteSpace="nowrap",n.visibility="hidden",n.display=mxClient.IS_QUIRKS?"inline":"inline-block",n.zoom="1",n.verticalAlign="top",n.lineHeight=this.textarea.style.lineHeight,n.fontSize=this.textarea.style.fontSize,n.fontFamily=this.textarea.style.fontFamily,n.fontWeight=this.textarea.style.fontWeight,n.textAlign=this.textarea.style.textAlign,n.fontStyle=this.textarea.style.fontStyle,n.textDecoration=this.textarea.style.textDecoration,e},mxCellEditor.prototype.stopEditing=function(e){null!=this.editingCell&&(null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null),!e&&this.isModified()&&this.graph.labelChanged(this.editingCell,this.getCurrentValue(),this.trigger),null!=this.textDiv&&(document.body.removeChild(this.textDiv),this.textDiv=null),this.bounds=this.trigger=this.editingCell=null,this.textarea.blur(),this.textarea.parentNode.removeChild(this.textarea))},mxCellEditor.prototype.getInitialValue=function(e,n){return this.graph.getEditingValue(e.cell,n)},mxCellEditor.prototype.getCurrentValue=function(){return this.textarea.value.replace(/\r/g,"")},mxCellEditor.prototype.isHideLabel=function(e){return!0},mxCellEditor.prototype.getMinimumSize=function(e){var n=this.graph.getView().scale;return new mxRectangle(0,0,null==e.text?30:e.text.size*n+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(e){var n=this.graph.getModel().isEdge(e.cell),t=this.graph.getView().scale,a=(i=this.getMinimumSize(e)).width,i=i.height,s=parseInt(e.style[mxConstants.STYLE_SPACING]||2)*t,o=parseInt(e.style[mxConstants.STYLE_SPACING_TOP]||0)*t+s,r=parseInt(e.style[mxConstants.STYLE_SPACING_RIGHT]||0)*t+s,l=parseInt(e.style[mxConstants.STYLE_SPACING_BOTTOM]||0)*t+s;t=parseInt(e.style[mxConstants.STYLE_SPACING_LEFT]||0)*t+s,r=new mxRectangle(e.x,e.y,Math.max(a,e.width-t-r),Math.max(i,e.height-o-l));return n?(r.x=e.absoluteOffset.x,r.y=e.absoluteOffset.y,null!=e.text&&null!=e.text.boundingBox&&(0<e.text.boundingBox.x&&(r.x=e.text.boundingBox.x),0<e.text.boundingBox.y&&(r.y=e.text.boundingBox.y))):null!=e.text&&null!=e.text.boundingBox&&(r.x=Math.min(r.x,e.text.boundingBox.x),r.y=Math.min(r.y,e.text.boundingBox.y)),r.x+=t,r.y+=o,null!=e.text&&null!=e.text.boundingBox&&(n?(r.width=Math.max(a,e.text.boundingBox.width),r.height=Math.max(i,e.text.boundingBox.height)):(r.width=Math.max(r.width,e.text.boundingBox.width),r.height=Math.max(r.height,e.text.boundingBox.height))),this.graph.getModel().isVertex(e.cell)&&((n=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?r.x-=e.width:n==mxConstants.ALIGN_RIGHT&&(r.x+=e.width),(n=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?r.y-=e.height:n==mxConstants.ALIGN_BOTTOM&&(r.y+=e.height)),r},mxCellEditor.prototype.getEmptyLabelText=function(e){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null)},mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.defaultShapes={},mxCellRenderer.registerShape=function(e,n){mxCellRenderer.prototype.defaultShapes[e]=n},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initialize=function(e,n){var t=e.view.graph.getModel();null!=e.view.graph.container&&null==e.shape&&e.cell!=e.view.currentRoot&&(t.isVertex(e.cell)||t.isEdge(e.cell))&&(this.createShape(e),null==e.shape||null!=n&&!n||(this.initializeShape(e),e.view.graph.ordered||t.isEdge(e.cell)?e.invalidOrder=!0:e.view.graph.keepEdgesInForeground&&null!=this.firstEdge&&(this.firstEdge.parentNode==e.shape.node.parentNode?this.insertState(e,this.firstEdge):this.firstEdge=null),e.shape.scale=e.view.scale,this.createCellOverlays(e),this.installListeners(e)))},mxCellRenderer.prototype.initializeShape=function(e){e.shape.init(e.view.getDrawPane())},mxCellRenderer.prototype.getPreviousStateInContainer=function(e,n){for(var t=null,a=e.view.graph,i=a.getModel(),s=e.cell,o=i.getParent(s);null!=o&&null==t;)t=this.findPreviousStateInContainer(a,o,s,n),s=o,o=i.getParent(s);return t},mxCellRenderer.prototype.findPreviousStateInContainer=function(e,n,t,a){var i=null,s=e.getModel();for(t=null!=t?n.getIndex(t)-1:s.getChildCount(n)-1;0<=t&&null==i;t--)i=this.findPreviousStateInContainer(e,s.getChildAt(n,t),null,a);return null!=i||(null==(i=e.view.getState(n))||null!=i.shape&&null!=i.shape.node&&i.shape.node.parentNode==a)||(i=null),i},mxCellRenderer.prototype.order=function(e){var n=e.shape.node.parentNode,t=this.getPreviousStateInContainer(e,n),a=n.firstChild;null!=t&&(a=t.shape.node,null!=t.text&&null!=t.text.node&&t.text.node.parentNode==n&&(a=t.text.node),a=a.nextSibling),this.insertState(e,a)},mxCellRenderer.prototype.orderEdge=function(e){var n=(t=e.view).graph.getModel();if(t.graph.keepEdgesInForeground)null!=this.firstEdge&&null!=this.firstEdge.parentNode&&this.firstEdge.parentNode==e.shape.node.parentNode||(this.firstEdge=e.shape.node);else if(t.graph.keepEdgesInBackground){var t,a=e.shape.node,i=a.parentNode;n=n.getParent(e.cell);null!=(i=null!=(t=t.getState(n))&&null!=t.shape&&null!=t.shape.node?t.shape.node.nextSibling:i.firstChild)&&i!=a&&this.insertState(e,i)}},mxCellRenderer.prototype.insertState=function(e,n){e.shape.node.parentNode.insertBefore(e.shape.node,n),null!=e.text&&null!=e.text.node&&e.text.node.parentNode==e.shape.node.parentNode&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling)},mxCellRenderer.prototype.createShape=function(e){if(null!=e.style){var n=mxStencilRegistry.getStencil(e.style[mxConstants.STYLE_SHAPE]);null!=n?e.shape=new mxShape(n):(n=this.getShapeConstructor(e),e.shape=new n),e.shape.points=e.absolutePoints,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.dialect=e.view.graph.dialect,this.configureShape(e)}},mxCellRenderer.prototype.getShape=function(e){return null!=e?mxCellRenderer.prototype.defaultShapes[e]:null},mxCellRenderer.prototype.getShapeConstructor=function(e){var n=this.getShape(e.style[mxConstants.STYLE_SHAPE]);return null==n&&(n=e.view.graph.getModel().isEdge(e.cell)?this.defaultEdgeShape:this.defaultVertexShape),n},mxCellRenderer.prototype.configureShape=function(e){e.shape.apply(e),e.shape.image=e.view.graph.getImage(e),e.shape.indicatorShape=this.getShape(e.view.graph.getIndicatorShape(e)),e.shape.indicatorColor=e.view.graph.getIndicatorColor(e),e.shape.indicatorGradientColor=e.view.graph.getIndicatorGradientColor(e),e.shape.indicatorDirection=e.style[mxConstants.STYLE_INDICATOR_DIRECTION],e.shape.indicatorImage=e.view.graph.getIndicatorImage(e),this.postConfigureShape(e)},mxCellRenderer.prototype.postConfigureShape=function(e){null!=e.shape&&(this.resolveColor(e,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(e,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(e,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.resolveColor=function(e,n,t){var a=e.shape[n],i=e.view.graph,s=null;"inherit"==a?s=i.model.getParent(e.cell):"swimlane"==a?(s=null!=i.model.getTerminal(e.cell,!1)?i.model.getTerminal(e.cell,!1):e.cell,s=i.getSwimlane(s),t=i.swimlaneIndicatorColorAttribute):"indicated"==a&&(e.shape[n]=e.shape.indicatorColor),null!=s&&(a=i.getView().getState(s),(e.shape[n]=null)!=a&&(e.shape[n]=null!=a.shape&&"indicatorColor"!=n?a.shape[n]:a.style[t]))},mxCellRenderer.prototype.getLabelValue=function(e){return e.view.graph.getLabel(e.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var a=t.view.graph;if(a.getModel().isEdge(t.cell),0<t.style[mxConstants.STYLE_FONTSIZE]||null==t.style[mxConstants.STYLE_FONTSIZE]){var n=a.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,a.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],a.isWrapping(t.cell)&&a.isHtmlLabel(t.cell),a.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING]),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.state=t,this.initializeLabel(t);var i=!1,s=function(e){var n=t;return(mxClient.IS_TOUCH||i)&&(n=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,n,e),n=a.view.getState(a.getCellAt(e.x,e.y))),n};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),i=a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)}),mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,s(e)))}),mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,s(e))),i=!1)})),mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.dblClick(e,t.cell),mxEvent.consume(e))}))}},mxCellRenderer.prototype.initializeLabel=function(e){var n=e.view.graph;e.text.dialect!=mxConstants.DIALECT_SVG&&(mxClient.IS_SVG&&mxClient.NO_FO?e.text.init(n.container):mxUtils.isVml(e.view.getDrawPane())&&(null!=e.shape.label?e.text.init(e.shape.label):e.text.init(e.shape.node))),null==e.text.node&&(e.text.init(e.view.getDrawPane()),null!=e.shape&&null!=e.text&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling))},mxCellRenderer.prototype.createCellOverlays=function(e){var n=e.view.graph.getCellOverlays(e.cell),t=null;if(null!=n){t=new mxDictionary;for(var a=0;a<n.length;a++){var i=null!=e.overlays?e.overlays.remove(n[a]):null;null==i&&((i=new mxImageShape(new mxRectangle,n[a].image.src)).dialect=e.view.graph.dialect,i.preserveImageAspect=!1,i.overlay=n[a],this.initializeOverlay(e,i),this.installCellOverlayListeners(e,n[a],i),null!=n[a].cursor&&(i.node.style.cursor=n[a].cursor)),t.put(n[a],i)}}null!=e.overlays&&e.overlays.visit(function(e,n){n.destroy()}),e.overlays=t},mxCellRenderer.prototype.initializeOverlay=function(e,n){n.init(e.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(n,t,e){var a=n.view.graph;mxEvent.addListener(e.node,"click",function(e){a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),t.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",n.cell))}),mxEvent.addGestureListeners(e.node,function(e){mxEvent.consume(e)},function(e){a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n))}),mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchend",function(e){t.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",n.cell))})},mxCellRenderer.prototype.createControl=function(t){var a=t.view.graph,e=a.getFoldingImage(t);if(a.foldingEnabled&&null!=e){if(null==t.control){var n=new mxRectangle(0,0,e.width,e.height);t.control=new mxImageShape(n,e.src),t.control.preserveImageAspect=!1,t.control.dialect=a.dialect,this.initControl(t,t.control,!0,function(e){if(a.isEnabled()){var n=!a.isCellCollapsed(t.cell);a.foldCells(n,!1,[t.cell]),mxEvent.consume(e)}})}}else null!=t.control&&(t.control.destroy(),t.control=null)},mxCellRenderer.prototype.initControl=function(n,e,t,a){var i=n.view.graph;return i.isHtmlLabel(n.cell)&&mxClient.NO_FO&&i.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(i.container),e.node.style.zIndex=1):e.init(n.view.getOverlayPane()),e=e.innerNode||e.node,a&&(i.isEnabled()&&(e.style.cursor="pointer"),mxEvent.addListener(e,"click",a)),t&&mxEvent.addGestureListeners(e,function(e){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,n)),mxEvent.consume(e)},function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n))}),e},mxCellRenderer.prototype.isShapeEvent=function(e,n){return!0},mxCellRenderer.prototype.isLabelEvent=function(e,n){return!0},mxCellRenderer.prototype.installListeners=function(t){var a=t.view.graph,n=function(e){var n=t;return(a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName||mxClient.IS_TOUCH)&&(n=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,n,e),n=a.view.getState(a.getCellAt(e.x,e.y))),n},i=!1;mxEvent.addListener(t.shape.node,"gesturestart",mxUtils.bind(this,function(e){a.lastTouchTime=0,i=!0,mxEvent.consume(e)})),mxEvent.addGestureListeners(t.shape.node,mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:t)):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:n(e))):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:n(e))):i&&mxEvent.consume(e)}));var s=mxClient.IS_TOUCH?"gestureend":"dblclick";mxEvent.addListener(t.shape.node,s,mxUtils.bind(this,function(e){i=!1,"gestureend"==s?(a.lastTouchTime=0,a.gestureEnabled&&(a.handleGesture(t,e),mxEvent.consume(e))):this.isShapeEvent(t,e)&&(a.dblClick(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:t.cell),mxEvent.consume(e))}))},mxCellRenderer.prototype.redrawLabel=function(e,n){var t=this.getLabelValue(e);if(null==e.text&&null!=t&&(mxUtils.isNode(t)||0<t.length)?this.createLabel(e,t):null==e.text||null!=t&&0!=t.length||(e.text.destroy(),e.text=null),null!=e.text){var a=(i=e.view.graph).isWrapping(e.cell),i=i.isLabelClipped(e.cell),s=this.getLabelBounds(e);!n&&e.text.value==t&&e.text.isWrapping==a&&e.text.isClipping==i&&e.text.scale==e.view.scale&&e.text.bounds.equals(s)||(e.text.value=t,e.text.bounds=s,e.text.scale=this.getTextScale(e),e.text.isWrapping=a,e.text.isClipping=i,e.text.redraw())}},mxCellRenderer.prototype.getTextScale=function(e){return e.view.scale},mxCellRenderer.prototype.getLabelBounds=function(e){var n=e.view.graph,t=e.view.scale,a=n.getModel().isEdge(e.cell),i=new mxRectangle(e.absoluteOffset.x,e.absoluteOffset.y);return e.text.updateMargin(),a?(a=e.text.getSpacing(),i.x+=a.x*t,i.y+=a.y*t,null!=(n=n.getCellGeometry(e.cell))&&(i.width=Math.max(0,e.text.margin.x*n.width*t-e.text.spacingLeft*t-e.text.spacingRight*t),i.height=Math.max(0,e.text.margin.y*n.height*t-e.text.spacingTop*t-e.text.spacingBottom*t))):(e.text.isPaintBoundsInverted()&&(a=i.x,i.x=i.y,i.y=a),i.x+=e.x,i.y+=e.y,i.width=Math.max(1,e.width),i.height=Math.max(1,e.height),n.isSwimlane(e.cell)&&(0<(n=n.getStartSize(e.cell)).width?(a=Math.min(i.width,n.width*t),e.shape.flipH&&(i.x+=i.width-a),i.width=a):0<n.height&&(a=Math.min(i.height,n.height*t),e.shape.flipV&&(i.y+=i.height-a),i.height=a)),this.rotateLabelBounds(e,i)),i},mxCellRenderer.prototype.rotateLabelBounds=function(e,n){if(e.text.isPaintBoundsInverted()){var t=(e.width-e.height)/2;n.x+=t,n.y-=t,t=n.width,n.width=n.height,n.height=t}if(n.x-=e.text.margin.x*n.width,n.y-=e.text.margin.y*n.height,"fill"!=e.style[mxConstants.STYLE_OVERFLOW]){t=e.view.scale;var a=e.text.getSpacing();n.x+=a.x*t,n.y+=a.y*t,n.width=Math.max(0,n.width-e.text.spacingLeft*t-e.text.spacingRight*t),n.height=Math.max(0,n.height-e.text.spacingTop*t-e.text.spacingBottom*t)}var i=e.text.getTextRotation();0!=i&&null!=e&&e.view.graph.model.isVertex(e.cell)&&(t=e.getCenterX(),a=e.getCenterY(),n.x!=t||n.y!=a)&&(i*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(n.x,n.y),Math.cos(i),Math.sin(i),new mxPoint(t,a)),n.x=pt.x,n.y=pt.y)},mxCellRenderer.prototype.redrawCellOverlays=function(s,o){if(this.createCellOverlays(s),null!=s.overlays){var r=mxUtils.mod(mxUtils.getValue(s.style,mxConstants.STYLE_ROTATION,0),90),e=mxUtils.toRadians(r),l=Math.cos(e),d=Math.sin(e);s.overlays.visit(function(e,n){var t=n.overlay.getBounds(s);if(!s.view.graph.getModel().isEdge(s.cell)&&null!=s.shape&&0!=r){var a=t.getCenterX(),i=t.getCenterY();a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),l,d,new mxPoint(s.getCenterX(),s.getCenterY()))).x,i=i.y;t.x=Math.round(a-t.width/2),t.y=Math.round(i-t.height/2)}!o&&null!=n.bounds&&n.scale==s.view.scale&&n.bounds.equals(t)||(n.bounds=t,n.scale=s.view.scale,n.redraw())})}},mxCellRenderer.prototype.redrawControl=function(e,n){if(null!=e.control){var t=this.getControlBounds(e),a=this.legacyControlPosition?mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0):e.shape.getTextRotation(),i=e.view.scale;!n&&e.control.scale==i&&e.control.bounds.equals(t)&&e.control.rotation==a||(e.control.rotation=a,e.control.bounds=t,e.control.scale=i,e.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(e){if(null==e.control)return null;var n=e.control.scale,t=e.control.bounds.width/n,a=(n=e.control.bounds.height/n,e.view.scale),i=e.getCenterX(),s=e.getCenterY();if(!e.view.graph.getModel().isEdge(e.cell)&&(i=e.x+t*a,s=e.y+n*a,null!=e.shape)){var o=e.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0);else if(e.shape.isPaintBoundsInverted()){var r=(e.width-e.height)/2;i=i+r,s=s-r}0!=o&&(r=mxUtils.toRadians(o),o=Math.cos(r),r=Math.sin(r),i=(s=mxUtils.getRotatedPoint(new mxPoint(i,s),o,r,new mxPoint(e.getCenterX(),e.getCenterY()))).x,s=s.y)}return e.view.graph.getModel().isEdge(e.cell),new mxRectangle(Math.round(i-t/2*a),Math.round(s-n/2*a),Math.round(t*a),Math.round(n*a))},mxCellRenderer.prototype.redraw=function(e,n,t){if(null!=e.shape){var a=!1;e.view.graph.getModel().isEdge(e.cell),reconfigure=null!=n&&n,this.createControl(e),(e.orderChanged||e.invalidOrder)&&(e.view.graph.ordered?this.order(e):this.orderEdge(e)),!e.orderChanged&&mxUtils.equalEntries(e.shape.style,e.style)||(this.configureShape(e),n=!0),delete e.invalidOrder,delete e.orderChanged,!n&&null!=e.shape.bounds&&e.shape.scale==e.view.scale&&e.shape.bounds.equals(e)&&mxUtils.equalPoints(e.shape.points,e.absolutePoints)||(a=!0,e.shape.points=null!=e.absolutePoints?e.absolutePoints.slice():null,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.scale=e.view.scale,null==t||t?e.shape.redraw():e.shape.updateBoundingBox()),(null==t||t)&&(this.redrawLabel(e,a),this.redrawCellOverlays(e,a),this.redrawControl(e,a))}},mxCellRenderer.prototype.destroy=function(e){null!=e.shape&&(null!=e.text&&(e.text.destroy(),e.text=null),null!=e.overlays&&(e.overlays.visit(function(e,n){n.destroy()}),e.overlays=null),null!=e.control&&(e.control.destroy(),e.control=null),e.shape.destroy(),e.shape=null)};var mxEdgeStyle={EntityRelation:function(e,n,t,a,i){var s=e.view,o=s.graph;a=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale;var r=(d=e.absolutePoints)[0],l=d[d.length-1],d=!1;if(null!=r)(n=new mxCellState).x=r.x,n.y=r.y;else{if(null==n)return;var c=mxUtils.getPortConstraints(n,e,!0,mxConstants.DIRECTION_MASK_NONE);c!=mxConstants.DIRECTION_MASK_NONE?d=c==mxConstants.DIRECTION_MASK_WEST:(r=o.getCellGeometry(n.cell)).relative?d=r.x<=.5:null!=t&&(d=t.x+t.width<n.x)}r=!0,null!=l?((t=new mxCellState).x=l.x,t.y=l.y):null!=t&&((c=mxUtils.getPortConstraints(t,e,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE?r=c==mxConstants.DIRECTION_MASK_WEST:(e=o.getCellGeometry(t.cell)).relative?r=e.x<=.5:null!=n&&(r=n.x+n.width<t.x)),null!=n&&null!=t&&(e=d?n.x:n.x+n.width,n=s.getRoutingCenterY(n),o=r?t.x:t.x+t.width,t=s.getRoutingCenterY(t),s=new mxPoint(e+(d?-a:a),n),l=new mxPoint(o+(r?-a:a),t),d==r?(a=d?Math.min(e,o)-a:Math.max(e,o)+a,i.push(new mxPoint(a,n)),i.push(new mxPoint(a,t))):(s.x<l.x==d?(a=n+(t-n)/2,i.push(s),i.push(new mxPoint(s.x,a)),i.push(new mxPoint(l.x,a))):i.push(s),i.push(l)))},Loop:function(e,n,t,a,i){if(null!=n){var s=(t=e.view).graph;null!=(a=null!=a&&0<a.length?a[0]:null)&&(a=t.transformControlPoint(e,a),mxUtils.contains(n,a.x,a.y)&&(a=null));var o=0,r=0,l=0,d=0;s=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,s.gridSize)*t.scale;(e=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(o=t.getRoutingCenterX(n),r=s):(l=t.getRoutingCenterY(n),d=s),null==a||a.x<n.x||a.x>n.x+n.width?null!=a?(o=a.x,d=Math.max(Math.abs(l-a.y),d)):e==mxConstants.DIRECTION_NORTH?l=n.y-2*r:e==mxConstants.DIRECTION_SOUTH?l=n.y+n.height+2*r:o=e==mxConstants.DIRECTION_EAST?n.x-2*d:n.x+n.width+2*d:null!=a&&(o=t.getRoutingCenterX(n),r=Math.max(Math.abs(o-a.x),d),l=a.y,d=0),i.push(new mxPoint(o-r,l-d)),i.push(new mxPoint(o+r,l+d))}},ElbowConnector:function(e,n,t,a,i){var s=null!=a&&0<a.length?a[0]:null,o=!1,r=!1;if(null!=n&&null!=t)if(null!=s){var l=Math.min(n.x,t.x),d=Math.max(n.x+n.width,t.x+t.width),c=(r=Math.min(n.y,t.y),Math.max(n.y+n.height,t.y+t.height));o=(s=e.view.transformControlPoint(e,s)).y<r||s.y>c,r=s.x<l||s.x>d}else(o=(l=Math.max(n.x,t.x))==(d=Math.min(n.x+n.width,t.x+t.width)))||(r=(r=Math.max(n.y,t.y))==(c=Math.min(n.y+n.height,t.y+t.height)));r||!o&&e.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(e,n,t,a,i):mxEdgeStyle.TopToBottom(e,n,t,a,i)},SideToSide:function(e,n,t,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((n=new mxCellState).x=o.x,n.y=o.y),null!=r&&((t=new mxCellState).x=r.x,t.y=r.y),null!=n&&null!=t&&(e=Math.max(n.x,t.x),o=Math.min(n.x+n.width,t.x+t.width),e=null!=a?a.x:o+(e-o)/2,o=s.getRoutingCenterY(n),s=s.getRoutingCenterY(t),null!=a&&(a.y>=n.y&&a.y<=n.y+n.height&&(o=a.y),a.y>=t.y&&a.y<=t.y+t.height&&(s=a.y)),!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),!mxUtils.contains(t,e,s)&&!mxUtils.contains(n,e,s)&&i.push(new mxPoint(e,s)),1==i.length&&(null!=a?!mxUtils.contains(t,e,a.y)&&!mxUtils.contains(n,e,a.y)&&i.push(new mxPoint(e,a.y)):(s=Math.max(n.y,t.y),n=Math.min(n.y+n.height,t.y+t.height),i.push(new mxPoint(e,s+(n-s)/2)))))},TopToBottom:function(e,n,t,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((n=new mxCellState).x=o.x,n.y=o.y),null!=r&&((t=new mxCellState).x=r.x,t.y=r.y),null!=n&&null!=t&&(o=Math.max(n.y,t.y),r=Math.min(n.y+n.height,t.y+t.height),e=s.getRoutingCenterX(n),null!=a&&a.x>=n.x&&a.x<=n.x+n.width&&(e=a.x),o=null!=a?a.y:r+(o-r)/2,!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),e=null!=a&&a.x>=t.x&&a.x<=t.x+t.width?a.x:s.getRoutingCenterX(t),!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),1==i.length&&(null!=a&&1==i.length?!mxUtils.contains(t,a.x,o)&&!mxUtils.contains(n,a.x,o)&&i.push(new mxPoint(a.x,o)):(s=Math.max(n.x,t.x),n=Math.min(n.x+n.width,t.x+t.width),i.push(new mxPoint(s+(n-s)/2,o)))))},SegmentConnector:function(e,n,t,a,i){var s=e.absolutePoints,o=!0,r=null,l=s[0];null==l&&null!=n?l=new mxPoint(e.view.getRoutingCenterX(n),e.view.getRoutingCenterY(n)):null!=l&&(l=l.clone());var d=s.length-1;if(null!=a&&0<a.length){r=e.view.transformControlPoint(e,a[0]);for(var c=n,m=s[0],u=!1,p=!1,g=(u=r,a.length),v=0;v<2;v++){var h=null!=m&&m.x==u.x,f=null!=m&&m.y==u.y,b=null!=c&&u.y>=c.y&&u.y<=c.y+c.height;c=null!=c&&u.x>=c.x&&u.x<=c.x+c.width,u=f||null==m&&b,p=h||null==m&&c;if(null!=m&&!f&&!h&&(b||c)){o=!b;break}if(p||u){o=u,1==v&&(o=0==a.length%2?u:p);break}c=t,m=s[d],u=e.view.transformControlPoint(e,a[g-1])}for(o&&(null!=s[0]&&s[0].y!=r.y||null==s[0]&&null!=n&&(r.y<n.y||r.y>n.y+n.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[0]&&s[0].x!=r.x||null==s[0]&&null!=n&&(r.x<n.x||r.x>n.x+n.width))&&i.push(new mxPoint(r.x,l.y)),o?l.y=r.y:l.x=r.x,v=0;v<a.length;v++)o=!o,r=e.view.transformControlPoint(e,a[v]),o?l.y=r.y:l.x=r.x,i.push(l.clone())}else r=l,o=!0;if(null==(l=s[d])&&null!=t&&(l=new mxPoint(e.view.getRoutingCenterX(t),e.view.getRoutingCenterY(t))),o&&(null!=s[d]&&s[d].y!=r.y||null==s[d]&&null!=t&&(r.y<t.y||r.y>t.y+t.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[d]&&s[d].x!=r.x||null==s[d]&&null!=t&&(r.x<t.x||r.x>t.x+t.width))&&i.push(new mxPoint(r.x,l.y)),null==s[0]&&null!=n)for(;1<i.length&&mxUtils.contains(n,i[1].x,i[1].y);)i=i.splice(1,1);if(null==s[d]&&null!=t)for(;1<i.length&&mxUtils.contains(t,i[i.length-1].x,i[i.length-1].y);)i=i.splice(i.length-1,1)},orthBuffer:10,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,OrthConnector:function(e,n,t,a,i){var s=e.view.graph,o=null!=n&&s.getModel().isEdge(n.cell);s=null!=t&&s.getModel().isEdge(t.cell);if(null!=a&&0<a.length||o||s)mxEdgeStyle.SegmentConnector(e,n,t,a,i);else{var r=(a=e.absolutePoints)[0],l=a[a.length-1];a=null!=n?n.x:r.x;o=null!=n?n.y:r.y;var d=null!=n?n.width:1,c=null!=n?n.height:1,m=null!=t?t.x:l.x,u=null!=t?t.y:l.y,p=null!=t?t.width:1,g=null!=t?t.height:1,v=(s=e.view.scale*mxEdgeStyle.orthBuffer,[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL]);for(null!=n&&(v[0]=mxUtils.getPortConstraints(n,e,!0,mxConstants.DIRECTION_MASK_ALL)),null!=t&&(v[1]=mxUtils.getPortConstraints(t,e,!1,mxConstants.DIRECTION_MASK_ALL)),e=[0,0],a=[[a,o,d,c],[m,u,p,g]],d=0;d<2;d++)mxEdgeStyle.limits[d][1]=a[d][0]-s,mxEdgeStyle.limits[d][2]=a[d][1]-s,mxEdgeStyle.limits[d][4]=a[d][0]+a[d][2]+s,mxEdgeStyle.limits[d][8]=a[d][1]+a[d][3]+s;for(d=a[0][0]+a[0][2]/2-(a[1][0]+a[1][2]/2),c=a[0][1]+a[0][3]/2-(a[1][1]+a[1][3]/2),d<(o=0)?o=c<0?2:1:c<=0&&(o=3,0==d&&(o=2)),(c=null)!=n&&(c=r),n=[[.5,.5],[.5,.5]],d=0;d<2;d++)null!=c&&(n[d][0]=(c.x-a[d][0])/a[d][2],n[d][0]<.01?e[d]=mxConstants.DIRECTION_MASK_WEST:.99<n[d][0]&&(e[d]=mxConstants.DIRECTION_MASK_EAST),n[d][1]=(c.y-a[d][1])/a[d][3],n[d][1]<.01?e[d]=mxConstants.DIRECTION_MASK_NORTH:.99<n[d][1]&&(e[d]=mxConstants.DIRECTION_MASK_SOUTH)),(c=null)!=t&&(c=l);for(d=a[0][1]-(a[1][1]+a[1][3]),c=a[0][0]-(a[1][0]+a[1][2]),m=a[1][1]-(a[0][1]+a[0][3]),u=a[1][0]-(a[0][0]+a[0][2]),mxEdgeStyle.vertexSeperations[1]=Math.max(c-2*s,0),mxEdgeStyle.vertexSeperations[2]=Math.max(d-2*s,0),mxEdgeStyle.vertexSeperations[4]=Math.max(m-2*s,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-2*s,0),t=[],l=[],(r=[])[0]=u<=c?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,l[0]=m<=d?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,r[1]=mxUtils.reversePortConstraints(r[0]),l[1]=mxUtils.reversePortConstraints(l[0]),c=u<=c?c:u,m=m<=d?d:m,p=!(u=[[0,0],[0,0]]),d=0;d<2;d++)0==e[d]&&(0==(r[d]&v[d])&&(r[d]=mxUtils.reversePortConstraints(r[d])),0==(l[d]&v[d])&&(l[d]=mxUtils.reversePortConstraints(l[d])),u[d][0]=l[d],u[d][1]=r[d]);for(2*s<m&&2*s<c&&(0<(r[0]&v[0])&&0<(l[1]&v[1])?(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=l[1],u[1][1]=r[1],p=!0):0<(l[0]&v[0])&&0<(r[1]&v[1])&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=r[1],u[1][1]=l[1],p=!0)),2*s<m&&!p&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=l[1],u[1][1]=r[1],p=!0),2*s<c&&!p&&(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=r[1],u[1][1]=l[1]),d=0;d<2;d++)0==e[d]&&(0==(u[d][0]&v[d])&&(u[d][0]=u[d][1]),t[d]=u[d][0]&v[d],t[d]|=(u[d][1]&v[d])<<8,t[d]|=(u[1-d][d]&v[d])<<16,t[d]|=(u[1-d][1-d]&v[d])<<24,0==(15&t[d])&&(t[d]<<=8),0==(3840&t[d])&&(t[d]=15&t[d]|t[d]>>8),0==(983040&t[d])&&(t[d]=65535&t[d]|(251658240&t[d])>>8),e[d]=15&t[d],v[d]==mxConstants.DIRECTION_MASK_WEST||v[d]==mxConstants.DIRECTION_MASK_NORTH||v[d]==mxConstants.DIRECTION_MASK_EAST||v[d]==mxConstants.DIRECTION_MASK_SOUTH)&&(e[d]=v[d]);switch(d=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0],v=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(d-=o)<1&&(d+=4),(v-=o)<1&&(v+=4),v=mxEdgeStyle.routePatterns[d-1][v-1],mxEdgeStyle.wayPoints1[0][0]=a[0][0],mxEdgeStyle.wayPoints1[0][1]=a[0][1],e[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=s,mxEdgeStyle.wayPoints1[0][1]+=n[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=n[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]+=a[0][3]+s;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=a[0][2]+s,mxEdgeStyle.wayPoints1[0][1]+=n[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=n[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]-=s}for(r=t=(s=0)<(e[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,d=l=0;d<v.length;d++){g=(l=15&v[d])==mxConstants.DIRECTION_MASK_EAST?3:l,4<(g+=o)&&(g-=4),c=mxEdgeStyle.dirVectors[g-1],(l=0<g%2?0:1)!=t&&(s++,mxEdgeStyle.wayPoints1[s][0]=mxEdgeStyle.wayPoints1[s-1][0],mxEdgeStyle.wayPoints1[s][1]=mxEdgeStyle.wayPoints1[s-1][1]);var h=0<(v[d]&mxEdgeStyle.TARGET_MASK);p=0<(v[d]&mxEdgeStyle.SOURCE_MASK);15<(m=(m=(v[d]&mxEdgeStyle.SIDE_MASK)>>5)<<o)&&(m>>=4),u=0<(v[d]&mxEdgeStyle.CENTER_MASK),(p||h)&&m<9?(g=0,p=p?0:1,g=u&&0==l?a[p][0]+n[p][0]*a[p][2]:u?a[p][1]+n[p][1]*a[p][3]:mxEdgeStyle.limits[p][m],0==l?0<(m=(g-mxEdgeStyle.wayPoints1[s][0])*c[0])&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*m):0<(m=(g-mxEdgeStyle.wayPoints1[s][1])*c[1])&&(mxEdgeStyle.wayPoints1[s][1]+=c[1]*m)):u&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2),mxEdgeStyle.wayPoints1[s][1]+=c[1]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2)),0<s&&mxEdgeStyle.wayPoints1[s][l]==mxEdgeStyle.wayPoints1[s-1][l]?s--:t=l}for(d=0;d<=s&&(d!=s||((0<(e[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==r?0:1)==(s+1)%2);d++)i.push(new mxPoint(mxEdgeStyle.wayPoints1[d][0],mxEdgeStyle.wayPoints1[d][1]))}},getRoutePattern:function(e,n,t,a){var i=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0];return e=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(i-=n)<1&&(i+=4),(e-=n)<1&&(e+=4),n=routePatterns[i-1][e-1],0!=t&&0!=a||null!=inlineRoutePatterns[i-1][e-1]&&(n=inlineRoutePatterns[i-1][e-1]),n}},mxStyleRegistry={values:[],putValue:function(e,n){mxStyleRegistry.values[e]=n},getValue:function(e){return mxStyleRegistry.values[e]},getName:function(e){for(var n in mxStyleRegistry.values)if(mxStyleRegistry.values[n]==e)return n;return null}};function mxGraphView(e){this.graph=e,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(e,n){if(this.view=e,this.previous=this.root=n,this.isUp=null==n,!this.isUp)for(var t=this.view.currentRoot,a=this.view.graph.getModel();null!=t;){if(t==n){this.isUp=!0;break}t=a.getParent(t)}}function mxGraph(e,n,t,a){this.mouseListeners=null,this.renderHint=t,this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:t==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:t==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:t==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML,this.model=null!=n?n:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=a?a:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(e,n){this.graphModelChanged(n.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=e&&this.init(e),this.view.revalidate()}function mxCellOverlay(e,n,t,a,i,s){this.image=e,this.tooltip=n,this.align=null!=t?t:this.align,this.verticalAlign=null!=a?a:this.verticalAlign,this.offset=null!=i?i:new mxPoint,this.cursor=null!=s?s:"help"}function mxOutline(e,n){this.source=e,null!=n&&this.init(n)}function mxMultiplicity(e,n,t,a,i,s,o,r,l,d){this.source=e,this.type=n,this.attr=t,this.value=a,this.min=null!=i?i:0,this.max=null!=s?s:"n",this.validNeighbors=o,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(l)||l,this.validNeighborsAllowed=null==d||d}function mxLayoutManager(e){this.undoHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.beforeUndo(n.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsMoved(n.getProperty("cells"),n.getProperty("event"))}),this.setGraph(e)}function mxSpaceManager(e,n,t,a){this.resizeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.foldHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.shiftRightwards=null==n||n,this.shiftDownwards=null==t||t,this.extendParents=null==a||a,this.setGraph(e)}function mxSwimlaneManager(e,n,t,a){this.horizontal=null==n||n,this.addEnabled=null==t||t,this.resizeEnabled=null==a||a,this.addHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(n.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.setGraph(e)}function mxTemporaryCellStates(e,n,t){if(this.view=e,n=null!=n?n:1,this.oldBounds=e.getGraphBounds(),this.oldStates=e.getStates(),this.oldScale=e.getScale(),e.setStates(new mxDictionary),e.setScale(n),null!=t){n=e.createState(new mxCell);for(var a=0;a<t.length;a++)e.validateBounds(n,t[a]);var i=null;for(a=0;a<t.length;a++){var s=e.validatePoints(n,t[a]);null==i?i=s:i.add(s)}null==i&&(i=new mxRectangle),e.setGraphBounds(i)}}function mxCellStatePreview(e){this.graph=e,this.deltas={}}function mxConnectionConstraint(e,n){this.point=e,this.perimeter=null==n||n}function mxGraphHandler(e){this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape()}),this.graph.addListener(mxEvent.PAN,this.panHandler)}function mxPanningHandler(e,n){null!=e&&(this.graph=e,this.factoryMethod=n,this.graph.addMouseListener(this),this.init())}function mxCellMarker(e,n,t,a){mxEventSource.call(this),null!=e&&(this.graph=e,this.validColor=null!=n?n:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=n?t:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=a?a:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(e))}function mxSelectionCellsHandler(e){mxEventSource.call(this),this.graph=e,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(e,n){mxEventSource.call(this),null!=e&&(this.graph=e,this.factoryMethod=n,this.init())}function mxConstraintHandler(e){this.graph=e}function mxRubberband(e){null!=e&&(this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxVertexHandler(e){null!=e&&(this.state=e,this.init())}function mxEdgeHandler(e){null!=e&&(this.state=e,this.init())}function mxElbowEdgeHandler(e){mxEdgeHandler.call(this,e)}function mxEdgeSegmentHandler(e){mxEdgeHandler.call(this,e)}function mxKeyHandler(e,n){null!=e&&(this.graph=e,this.target=n||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],mxEvent.addListener(this.target,"keydown",mxUtils.bind(this,function(e){this.keyDown(e)})),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(e,n){null!=e&&(this.graph=e,this.delay=n||500,this.graph.addMouseListener(this))}function mxCellTracker(e,n,t){mxCellMarker.call(this,e,n),this.graph.addMouseListener(this),null!=t&&(this.getCell=t),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(e,n,t,a){null!=e&&(this.graph=e,this.highlightColor=null!=n?n:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=t?t:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=a&&a,this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(n){if(null!=n){this.editor=n,this.handler=new mxKeyHandler(n.graph);var t=this.handler.escape;this.handler.escape=function(e){t.apply(this,arguments),n.hideProperties(),n.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",e))}}}function mxDefaultPopupMenu(e){this.config=e}function mxDefaultToolbar(e,n){this.editor=n,null!=e&&null!=n&&this.init(e)}function mxEditor(e){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(e),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,!mxClient.IS_LOCAL&&null!=this.urlInit&&(this.session=this.createSession()),null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(e){this.graphBounds=e},mxGraphView.prototype.getBounds=function(e){var n=null;if(null!=e&&0<e.length)for(var t=this.graph.getModel(),a=0;a<e.length;a++)if(t.isVertex(e[a])||t.isEdge(e[a])){var i=this.getState(e[a]);null!=i&&(null==n?n=new mxRectangle(i.x,i.y,i.width,i.height):n.add(i))}return n},mxGraphView.prototype.setCurrentRoot=function(e){if(this.currentRoot!=e){var n=new mxCurrentRootChange(this,e);n.execute();var t=new mxUndoableEdit(this,!1);t.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)),this.graph.sizeDidChange()}return e},mxGraphView.prototype.scaleAndTranslate=function(e,n,t){var a=this.scale,i=new mxPoint(this.translate.x,this.translate.y);this.scale==e&&this.translate.x==n&&this.translate.y==t||(this.scale=e,this.translate.x=n,this.translate.y=t,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",e,"previousScale",a,"translate",this.translate,"previousTranslate",i))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(e){var n=this.scale;this.scale!=e&&(this.scale=e,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",e,"previousScale",n))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(e,n){var t=new mxPoint(this.translate.x,this.translate.y);this.translate.x==e&&this.translate.y==n||(this.translate.x=e,this.translate.y=n,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",t))},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(e,n,t){var a=this.graph.getModel();if(e=e||a.getRoot(),n=null!=n&&n,t=null==t||t,this.removeState(e),t&&(n||e!=this.currentRoot)){t=a.getChildCount(e);for(var i=0;i<t;i++)this.clear(a.getChildAt(e,i),n)}else this.invalidate(e)},mxGraphView.prototype.invalidate=function(e,n,t,a){var i=this.graph.getModel();if(e=e||i.getRoot(),n=null==n||n,t=null==t||t,a=null!=a&&a,null!=(o=this.getState(e))&&(o.invalid=!0,a&&(o.orderChanged=!0)),n)for(var s=i.getChildCount(e),o=0;o<s;o++){var r=i.getChildAt(e,o);this.invalidate(r,n,t,a)}if(t)for(a=i.getEdgeCount(e),o=0;o<a;o++)this.invalidate(i.getEdgeAt(e,o),n,t)},mxGraphView.prototype.validate=function(e){var n=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;var t=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode||mxClient.IS_QUIRKS)){t=this.canvas.style.display,this.canvas.style.display="none";var a=document.createElement("div");a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",document.body.appendChild(a),this.textDiv=a}e=e||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()),this.validateBounds(null,e),null==(e=this.validatePoints(null,e))&&(e=new mxRectangle),this.setGraphBounds(e),this.validateBackground(),null!=t&&(this.canvas.style.display=t,document.body.removeChild(this.textDiv),this.textDiv=null),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",n)},mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,"white","black")},mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var n=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(n,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);this.graph.pageVisible?(n=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(n),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=n,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.graph.pageFormat,n=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,e.width*n,e.height*n)},mxGraphView.prototype.redrawBackgroundImage=function(e,n){e.scale=this.scale,e.bounds.x=this.scale*this.translate.x,e.bounds.y=this.scale*this.translate.y,e.bounds.width=this.scale*n.width,e.bounds.height=this.scale*n.height,e.redraw()},mxGraphView.prototype.validateBounds=function(e,n){var t=this.graph.getModel(),a=this.getState(n,!0);if(null!=a&&a.invalid){if(this.graph.isCellVisible(n)){if(n!=this.currentRoot&&null!=e)if(a.absoluteOffset.x=0,a.absoluteOffset.y=0,a.origin.x=e.origin.x,a.origin.y=e.origin.y,null!=(s=this.graph.getCellGeometry(n))){if(!t.isEdge(n)){var i=s.offset||this.EMPTY_POINT;s.relative?(a.origin.x+=s.x*e.width/this.scale+i.x,a.origin.y+=s.y*e.height/this.scale+i.y):(a.absoluteOffset.x=this.scale*i.x,a.absoluteOffset.y=this.scale*i.y,a.origin.x+=s.x,a.origin.y+=s.y)}if(a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*s.width,a.height=this.scale*s.height,t.isVertex(n)){if(s.relative&&0!=(i=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"))){var s=Math.cos(i),o=(i=Math.sin(i),new mxPoint(a.getCenterX(),a.getCenterY())),r=new mxPoint(e.getCenterX(),e.getCenterY());s=mxUtils.getRotatedPoint(o,s,i,r);a.x=s.x-a.width/2,a.y=s.y-a.height/2}this.updateVertexLabelOffset(a)}}}else this.removeState(n);null!=(i=this.graph.getChildOffsetForCell(n))&&(a.origin.x+=i.x,a.origin.y+=i.y)}if(null!=a&&(!this.graph.isCellCollapsed(n)||n==this.currentRoot))for(s=t.getChildCount(n),i=0;i<s;i++)o=t.getChildAt(n,i),this.validateBounds(a,o)},mxGraphView.prototype.updateVertexLabelOffset=function(e){var n=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);n==mxConstants.ALIGN_LEFT?e.absoluteOffset.x-=e.width:n==mxConstants.ALIGN_RIGHT&&(e.absoluteOffset.x+=e.width),(n=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?e.absoluteOffset.y-=e.height:n==mxConstants.ALIGN_BOTTOM&&(e.absoluteOffset.y+=e.height)},mxGraphView.prototype.validatePoints=function(e,n){var t=this.graph.getModel(),a=this.getState(n),i=null;if(null!=a){if(a.invalid){var s=this.graph.getCellGeometry(n);if(null!=s&&t.isEdge(n)){var o=this.getState(this.getVisibleTerminal(n,!0));if(a.setVisibleTerminalState(o,!0),null!=o&&t.isEdge(o.cell)&&!t.isAncestor(o.cell,n)){var r=this.getState(t.getParent(o.cell));this.validatePoints(r,o.cell)}var l=this.getState(this.getVisibleTerminal(n,!1));a.setVisibleTerminalState(l,!1),null!=l&&t.isEdge(l.cell)&&!t.isAncestor(l.cell,n)&&(r=this.getState(t.getParent(l.cell)),this.validatePoints(r,l.cell)),this.updateFixedTerminalPoints(a,o,l),this.updatePoints(a,s.points,o,l),this.updateFloatingTerminalPoints(a,o,l),this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)}else null!=s&&s.relative&&null!=e&&t.isEdge(e.cell)&&(null!=(s=this.getPoint(e,s))&&(a.x=s.x,a.y=s.y,s.x=s.x/this.scale-this.translate.x,s.y=s.y/this.scale-this.translate.y,a.origin=s,this.childMoved(e,a)));a.invalid=!1,n!=this.currentRoot&&this.graph.cellRenderer.redraw(a,!1,this.isRendering())}(t.isEdge(n)||t.isVertex(n))&&(null!=a.shape&&null!=a.shape.boundingBox&&(i=a.shape.boundingBox.clone()),null!=a.text&&!this.graph.isLabelClipped(a.cell)&&null!=a.text.boundingBox&&(null!=i?i.add(a.text.boundingBox):i=a.text.boundingBox.clone()))}if(null!=a&&(!this.graph.isCellCollapsed(n)||n==this.currentRoot))for(s=t.getChildCount(n),o=0;o<s;o++)r=t.getChildAt(n,o),null!=(r=this.validatePoints(a,r))&&(null==i?i=r:i.add(r));return i},mxGraphView.prototype.childMoved=function(e,n){var t=n.cell;if(!this.graph.isCellCollapsed(t)||t==this.currentRoot)for(var a=this.graph.getModel(),i=a.getChildCount(t),s=0;s<i;s++)this.validateBounds(n,a.getChildAt(t,s))},mxGraphView.prototype.updateFixedTerminalPoints=function(e,n,t){this.updateFixedTerminalPoint(e,n,!0,this.graph.getConnectionConstraint(e,n,!0)),this.updateFixedTerminalPoint(e,t,!1,this.graph.getConnectionConstraint(e,t,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(e,n,t,a){var i=null;if(null!=a&&(i=this.graph.getConnectionPoint(n,a)),null==i&&null==n){n=this.scale,a=this.translate;var s=e.origin;null!=(i=this.graph.getCellGeometry(e.cell).getTerminalPoint(t))&&(i=new mxPoint(n*(a.x+i.x+s.x),n*(a.y+i.y+s.y)))}e.setAbsoluteTerminalPoint(i,t)},mxGraphView.prototype.updatePoints=function(e,n,t,a){if(null!=e){var i=[];i.push(e.absolutePoints[0]);var s=this.getEdgeStyle(e,n,t,a);if(null!=s)s(e,t=this.getTerminalPort(e,t,!0),a=this.getTerminalPort(e,a,!1),n,i);else if(null!=n)for(s=0;s<n.length;s++)null!=n[s]&&(a=mxUtils.clone(n[s]),i.push(this.transformControlPoint(e,a)));n=e.absolutePoints,i.push(n[n.length-1]),e.absolutePoints=i}},mxGraphView.prototype.transformControlPoint=function(e,n){var t=e.origin;return new mxPoint(this.scale*(n.x+this.translate.x+t.x),this.scale*(n.y+this.translate.y+t.y))},mxGraphView.prototype.getEdgeStyle=function(e,n,t,a){return"string"==typeof(e=null!=t&&t==a?mxUtils.getValue(e.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(e.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:e.style[mxConstants.STYLE_EDGE])&&(null==(n=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n),"function"==typeof e?e:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(e,n,t){var a=e.absolutePoints,i=a[0];null==a[a.length-1]&&null!=t&&this.updateFloatingTerminalPoint(e,t,n,!1),null==i&&null!=n&&this.updateFloatingTerminalPoint(e,n,t,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(e,n,t,a){n=this.getTerminalPort(e,n,a);var i=this.getNextPoint(e,t,a),s=this.graph.isOrthogonal(e);t=mxUtils.toRadians(Number(n.style[mxConstants.STYLE_ROTATION]||"0"));var o=new mxPoint(n.getCenterX(),n.getCenterY());if(0!=t){var r=Math.cos(-t),l=Math.sin(-t);i=mxUtils.getRotatedPoint(i,r,l,o)}r=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0),r+=parseFloat(e.style[a?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),n=this.getPerimeterPoint(n,i,0==t&&s,r),0!=t&&(r=Math.cos(t),l=Math.sin(t),n=mxUtils.getRotatedPoint(n,r,l,o)),e.setAbsoluteTerminalPoint(n,a)},mxGraphView.prototype.getTerminalPort=function(e,n,t){return null!=(e=mxUtils.getValue(e.style,t?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT))&&(null!=(e=this.getState(this.graph.getModel().getCell(e)))&&(n=e)),n},mxGraphView.prototype.getPerimeterPoint=function(e,n,t,a){var i=null;if(null!=e){var s=this.getPerimeterFunction(e);null!=s&&null!=n&&(0<(a=this.getPerimeterBounds(e,a)).width||0<a.height)&&(i=s(a,e,n,t)),null==i&&(i=this.getPoint(e))}return i},mxGraphView.prototype.getRoutingCenterX=function(e){var n=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return e.getCenterX()+n*e.width},mxGraphView.prototype.getRoutingCenterY=function(e){var n=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return e.getCenterY()+n*e.height},mxGraphView.prototype.getPerimeterBounds=function(e,n){return n=null!=n?n:0,null!=e&&(n+=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),e.getPerimeterBounds(n*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(e){if("string"==typeof(e=e.style[mxConstants.STYLE_PERIMETER])){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(e,n,t){var a=null;return null!=(e=e.absolutePoints)&&(t||2<e.length||null==n)&&(a=e.length,a=e[t?Math.min(1,a-1):Math.max(0,a-2)]),null==a&&null!=n&&(a=new mxPoint(n.getCenterX(),n.getCenterY())),a},mxGraphView.prototype.getVisibleTerminal=function(e,n){for(var t=this.graph.getModel(),a=t.getTerminal(e,n),i=a;null!=a&&a!=this.currentRoot;)this.graph.isCellVisible(i)&&!this.graph.isCellCollapsed(a)||(i=a),a=t.getParent(a);return t.getParent(i)==t.getRoot()&&(i=null),i},mxGraphView.prototype.updateEdgeBounds=function(e){var n=e.absolutePoints;if(e.length=0,null!=n&&0<n.length){var t=n[0],a=n[n.length-1];if(null==t||null==a)e.cell!=this.currentRoot&&this.clear(e.cell,!0);else{if(t.x!=a.x||t.y!=a.y){var i=a.x-t.x,s=a.y-t.y;e.terminalDistance=Math.sqrt(i*i+s*s)}else e.terminalDistance=0;a=0;var o=[];if(null!=(s=t)){t=s.x;for(var r=s.y,l=t,d=r,c=1;c<n.length;c++){var m=n[c];null!=m&&(i=s.x-m.x,s=s.y-m.y,i=Math.sqrt(i*i+s*s),o.push(i),a+=i,s=m,t=Math.min(s.x,t),r=Math.min(s.y,r),l=Math.max(s.x,l),d=Math.max(s.y,d))}e.length=a,e.segments=o,e.x=t,e.y=r,e.width=Math.max(1,l-t),e.height=Math.max(1,d-r)}}}},mxGraphView.prototype.getPoint=function(e,n){var t=e.getCenterX(),a=e.getCenterY();if(null==e.segments||null!=n&&!n.relative)null!=n&&(null!=(d=n.offset)&&(t+=d.x,a+=d.y));else{for(var i=e.absolutePoints.length,s=(.5+(null!=n?n.x/2:0))*e.length,o=e.segments[0],r=0,l=1;r+o<s&&l<i-1;)r+=o,o=e.segments[l++];if(i=0==o?0:(s-r)/o,s=e.absolutePoints[l-1],l=e.absolutePoints[l],null!=s&&null!=l){if(r=t=a=0,null!=n){a=n.y;var d=n.offset;null!=d&&(t=d.x,r=d.y)}d=l.x-s.x,l=l.y-s.y,t=s.x+d*i+((0==o?0:l/o)*a+t)*this.scale,a=s.y+l*i-((0==o?0:d/o)*a-r)*this.scale}}return new mxPoint(t,a)},mxGraphView.prototype.getRelativePoint=function(e,n,t){if(null!=(i=this.graph.getModel().getGeometry(e.cell))){var a=e.absolutePoints.length;if(i.relative&&1<a){for(var i=e.length,s=e.segments,o=e.absolutePoints[0],r=e.absolutePoints[1],l=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t),d=0,c=0,m=0,u=2;u<a;u++)c+=s[u-2],r=e.absolutePoints[u],(o=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t))<=l&&(l=o,d=u-1,m=c),o=r;return a=s[d],o=e.absolutePoints[d],l=(r=e.absolutePoints[d+1]).x,s=r.y,s=(l=(e=o.x-l)-(l=n-l))*e+(s=(d=o.y-s)-(s=t-s))*d,a<(e=Math.sqrt(s<=0?0:s*s/(e*e+d*d)))&&(e=a),a=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t)),-1==mxUtils.relativeCcw(o.x,o.y,r.x,r.y,n,t)&&(a=-a),new mxPoint((i/2-m-e)/i*-2,a/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(e){var n=e.absolutePoints;if(e.absoluteOffset.x=e.getCenterX(),e.absoluteOffset.y=e.getCenterY(),null!=n&&0<n.length&&null!=e.segments)if((i=this.graph.getCellGeometry(e.cell)).relative){null!=(t=this.getPoint(e,i))&&(e.absoluteOffset=t)}else{var t=n[0],a=n[n.length-1];if(null!=t&&null!=a){n=a.x-t.x;var i,s=a.y-t.y,o=a=0;null!=(i=i.offset)&&(a=i.x,o=i.y),i=t.y+s/2+o*this.scale,e.absoluteOffset.x=t.x+n/2+a*this.scale,e.absoluteOffset.y=i}}},mxGraphView.prototype.getState=function(e,n){n=n||!1;var t=null;return null!=e&&(t=this.states.get(e),this.graph.isCellVisible(e)&&(null==t&&n&&this.graph.isCellVisible(e)?(t=this.createState(e),this.states.put(e,t)):n&&null!=t&&this.updateStyle&&(t.style=this.graph.getCellStyle(e)))),t},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(e){this.rendering=e},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(e){this.allowEval=e},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(e){this.states=e},mxGraphView.prototype.getCellStates=function(e){if(null==e)return this.states;for(var n=[],t=0;t<e.length;t++){var a=this.getState(e[t]);null!=a&&n.push(a)}return n},mxGraphView.prototype.removeState=function(e){var n=null;return null!=e&&(null!=(n=this.states.remove(e))&&(this.graph.cellRenderer.destroy(n),n.destroy())),n},mxGraphView.prototype.createState=function(e){var n=this.graph.getCellStyle(e);return e=new mxCellState(this,e,n),this.graph.cellRenderer.initialize(e,this.isRendering()),e},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.isContainerEvent=function(e){return(e=mxEvent.getSource(e))==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane},mxGraphView.prototype.isScrollEvent=function(e){var n=mxUtils.getOffset(this.graph.container);e=new mxPoint(e.clientX-n.x,e.clientY-n.y);n=this.graph.container.offsetWidth;var t=this.graph.container.clientWidth;return t<n&&e.x>t+2&&e.x<=n||(n=this.graph.container.offsetHeight,(t=this.graph.container.clientHeight)<n&&e.y>t+2&&e.y<=n)},mxGraphView.prototype.init=function(){this.installListeners();var e=this.graph;e.dialect==mxConstants.DIALECT_SVG?this.createSvg():e.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var a=this.graph,i=a.container;if(null!=i){mxEvent.addGestureListeners(i,mxUtils.bind(this,function(e){mxClient.IS_TOUCH&&a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addListener(i,"dblclick",mxUtils.bind(this,function(e){a.dblClick(e)}));a.addMouseListener({mouseDown:function(e,n){a.panningHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(e){var n,t;null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide(),this.captureDocumentGesture&&a.isMouseDown&&!mxEvent.isConsumed(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,(n=e,t=null,mxClient.IS_TOUCH&&(t=mxEvent.getClientX(n),n=mxEvent.getClientY(n),n=mxUtils.convertPoint(i,t,n),t=a.view.getState(a.getCellAt(n.x,n.y))),t)))}),this.endHandler=mxUtils.bind(this,function(e){this.captureDocumentGesture&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var e=this.graph.container;null!=e&&(this.canvas=this.createHtmlPane("100%","100%"),this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas),mxClient.IS_QUIRKS&&(e=mxUtils.bind(this,function(e){e=this.getGraphBounds(),this.updateHtmlCanvasSize(e.x+e.width+this.graph.border,e.y+e.height+this.graph.border)}),mxEvent.addListener(window,"resize",e)))},mxGraphView.prototype.updateHtmlCanvasSize=function(e,n){if(null!=this.graph.container){var t=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<e?e+"px":"100%",this.canvas.style.height=t<n?n+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(e,n){var t=document.createElement("DIV");return null!=e&&null!=n?(t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width=e,t.style.height=n):t.style.position="relative",t},mxGraphView.prototype.createVml=function(){var e=this.graph.container;if(null!=e){var n=e.offsetWidth,t=e.offsetHeight;this.canvas=this.createVmlPane(n,t),this.backgroundPane=this.createVmlPane(n,t),this.drawPane=this.createVmlPane(n,t),this.overlayPane=this.createVmlPane(n,t),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(e,n){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width=e+"px",t.style.height=n+"px",t.setAttribute("coordsize",e+","+n),t.setAttribute("coordorigin","0,0"),t},mxGraphView.prototype.createSvg=function(){var e=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane);var n=document.createElementNS(mxConstants.NS_SVG,"svg");n.style.width="100%",n.style.height="100%",n.style.display="block",n.appendChild(this.canvas),null!=e&&(e.appendChild(n),"static"==mxUtils.getCurrentStyle(e).position&&(e.style.position="relative"))},mxGraphView.prototype.destroy=function(){var e=null!=this.canvas?this.canvas.ownerSVGElement:null;null==e&&(e=this.canvas),null!=e&&null!=e.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),e.parentNode.removeChild(e),this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)},mxCurrentRootChange.prototype.execute=function(){var e=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=e,null!=(e=this.view.graph.getTranslateForRoot(this.view.currentRoot))&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh(),this.isUp=!this.isUp},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.EMPTY_ARRAY=[],mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=700,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.gestureEnabled=!0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.ordered=!0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!0,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage("/assets/plugins/mxgraph/images/warning.gif",16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(e){this.container=e,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(e,"selectstart",mxUtils.bind(this,function(){return this.isEditing()}))),8==document.documentMode&&e.insertAdjacentHTML("beforeend",'<v:group style="DISPLAY: none;"></v:group>')},mxGraph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(e){this.stylesheet=e},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(e){this.selectionModel=e},mxGraph.prototype.getSelectionCellsForChanges=function(e){for(var n=[],t=0;t<e.length;t++){var a=e[t];if(a.constructor!=mxRootChange){var i=null;a instanceof mxChildChange&&null==a.previous?i=a.child:null!=a.cell&&a.cell instanceof mxCell&&(i=a.cell),null!=i&&mxUtils.indexOf(n,i)<0&&n.push(i)}}return this.getModel().getTopmostCells(n)},mxGraph.prototype.graphModelChanged=function(e){for(var n=0;n<e.length;n++)this.processChange(e[n]);this.removeSelectionCells(this.getRemovedCellsForChanges(e)),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.getRemovedCellsForChanges=function(e){for(var n=[],t=0;t<e.length;t++){var a=e[t];if(a instanceof mxRootChange)break;a instanceof mxChildChange?null!=a.previous&&null==a.parent&&(n=n.concat(this.model.getDescendants(a.child))):a instanceof mxVisibleChange&&(n=n.concat(this.model.getDescendants(a.cell)))}return n},mxGraph.prototype.processChange=function(e){if(e instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(e.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(e instanceof mxChildChange){var n=this.model.getParent(e.child);null!=n?this.view.invalidate(e.child,!0,!1,null!=e.previous):(this.removeStateForCell(e.child),this.view.currentRoot==e.child&&this.home()),n!=e.previous&&(null!=n&&this.view.invalidate(n,!1,!1),null!=e.previous&&this.view.invalidate(e.previous,!1,!1))}else e instanceof mxTerminalChange||e instanceof mxGeometryChange?this.view.invalidate(e.cell):e instanceof mxValueChange?this.view.invalidate(e.cell,!1,!1):e instanceof mxStyleChange?(this.view.invalidate(e.cell,!0,!0,!1),this.view.removeState(e.cell)):null!=e.cell&&e.cell instanceof mxCell&&this.removeStateForCell(e.cell)},mxGraph.prototype.removeStateForCell=function(e){for(var n=this.model.getChildCount(e),t=0;t<n;t++)this.removeStateForCell(this.model.getChildAt(e,t));this.view.removeState(e)},mxGraph.prototype.addCellOverlay=function(e,n){null==e.overlays&&(e.overlays=[]),e.overlays.push(n);var t=this.view.getState(e);return null!=t&&this.cellRenderer.redraw(t),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",e,"overlay",n)),n},mxGraph.prototype.getCellOverlays=function(e){return e.overlays},mxGraph.prototype.removeCellOverlay=function(e,n){if(null==n)this.removeCellOverlays(e);else{var t=mxUtils.indexOf(e.overlays,n);0<=t?(e.overlays.splice(t,1),0==e.overlays.length&&(e.overlays=null),null!=(t=this.view.getState(e))&&this.cellRenderer.redraw(t),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",n))):n=null}return n},mxGraph.prototype.removeCellOverlays=function(e){var n=e.overlays;if(null!=n){e.overlays=null;var t=this.view.getState(e);for(null!=t&&this.cellRenderer.redraw(t),t=0;t<n.length;t++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",n[t]))}return n},mxGraph.prototype.clearCellOverlays=function(e){e=null!=e?e:this.model.getRoot(),this.removeCellOverlays(e);for(var n=this.model.getChildCount(e),t=0;t<n;t++){var a=this.model.getChildAt(e,t);this.clearCellOverlays(a)}},mxGraph.prototype.setCellWarning=function(t,e,n,a){return null!=e&&0<e.length?(e=new mxCellOverlay(n=null!=n?n:this.warningImage,"<font color=red>"+e+"</font>"),a&&e.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,n){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,e)):(this.removeCellOverlays(t),null)},mxGraph.prototype.startEditing=function(e){this.startEditingAtCell(null,e)},mxGraph.prototype.startEditingAtCell=function(e,n){null==e&&(null!=(e=this.getSelectionCell())&&!this.isCellEditable(e)&&(e=null)),null!=e&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",e,"event",n)),this.cellEditor.startEditing(e,n))},mxGraph.prototype.getEditingValue=function(e,n){return this.convertValueToString(e)},mxGraph.prototype.stopEditing=function(e){this.cellEditor.stopEditing(e)},mxGraph.prototype.labelChanged=function(e,n,t){this.model.beginUpdate();try{this.cellLabelChanged(e,n,this.isAutoSizeCell(e)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",e,"value",n,"event",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellLabelChanged=function(e,n,t){this.model.beginUpdate();try{this.model.setValue(e,n),t&&this.cellSizeUpdated(e,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(e){this.stopEditing(!0),this.connectionHandler.reset(),this.graphHandler.reset(),e=this.getSelectionCells();for(var n=0;n<e.length;n++){var t=this.view.getState(e[n]);null!=t&&null!=t.handler&&t.handler.reset()}},mxGraph.prototype.click=function(e){var n=e.getEvent(),t=e.getCell(),a=new mxEventObject(mxEvent.CLICK,"event",n,"cell",t);e.isConsumed()&&a.consume(),this.fireEvent(a),this.isEnabled()&&!mxEvent.isConsumed(n)&&!a.isConsumed()&&(null!=t?this.selectCellForEvent(t,n):(t=null,this.isSwimlaneSelectionEnabled()&&(t=this.getSwimlaneAt(e.getGraphX(),e.getGraphY())),null!=t?this.selectCellForEvent(t,n):this.isToggleEvent(n)||this.clearSelection()))},mxGraph.prototype.dblClick=function(e,n){var t=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",n);this.fireEvent(t),this.isEnabled()&&!mxEvent.isConsumed(e)&&!t.isConsumed()&&null!=n&&this.isCellEditable(n)&&this.startEditingAtCell(n,e)},mxGraph.prototype.scrollPointToVisible=function(e,n,t,a){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.active&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(e+this.panDx,n+this.panDy));else{var i=this.container;if(a=null!=a?a:20,e>=i.scrollLeft&&n>=i.scrollTop&&e<=i.scrollLeft+i.clientWidth&&n<=i.scrollTop+i.clientHeight){var s=i.scrollLeft+i.clientWidth-e;if(s<a){if(e=i.scrollLeft,i.scrollLeft+=a-s,t&&e==i.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){e=this.view.getDrawPane().ownerSVGElement;var o=this.container.scrollWidth+a-s}else o=Math.max(i.clientWidth,i.scrollWidth)+a-s,e=this.view.getCanvas();e.style.width=o+"px",i.scrollLeft+=a-s}}else(s=e-i.scrollLeft)<a&&(i.scrollLeft-=a-s);(s=i.scrollTop+i.clientHeight-n)<a?(e=i.scrollTop,i.scrollTop+=a-s,e==i.scrollTop&&t&&(this.dialect==mxConstants.DIALECT_SVG?(e=this.view.getDrawPane().ownerSVGElement,n=this.container.scrollHeight+a-s):(n=Math.max(i.clientHeight,i.scrollHeight)+a-s,e=this.view.getCanvas()),e.style.height=n+"px",i.scrollTop+=a-s)):(s=n-i.scrollTop)<a&&(i.scrollTop-=a-s)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){function e(e){var n=0;n="thin"==e?2:"medium"==e?4:"thick"==e?6:parseInt(e);return isNaN(n)&&(n=0),n}var n=mxUtils.getCurrentStyle(this.container),t=new mxRectangle;return t.x=e(n.borderLeftWidth)+parseInt(n.paddingLeft||0),t.y=e(n.borderTopWidth)+parseInt(n.paddingTop||0),t.width=e(n.borderRightWidth)+parseInt(n.paddingRight||0),t.height=e(n.borderBottomWidth)+parseInt(n.paddingBottom||0),t},mxGraph.prototype.getPreferredPageSize=function(e,n,t){e=this.view.scale;var a=this.view.translate,i=this.pageFormat,s=e*this.pageScale;i=new mxRectangle(0,0,i.width*s,i.height*s);return n=this.pageBreaksVisible?Math.ceil(n/i.width):1,t=this.pageBreaksVisible?Math.ceil(t/i.height):1,new mxRectangle(0,0,n*i.width+2+a.x/e,t*i.height+2+a.y/e)},mxGraph.prototype.sizeDidChange=function(){var e=this.getGraphBounds();if(null!=this.container){var n=this.getBorder(),t=Math.max(0,e.x+e.width+1+n);n=Math.max(0,e.y+e.height+1+n);if(null!=this.minimumContainerSize&&(t=Math.max(t,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(t,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var a=this.getPreferredPageSize(e,t,n);null!=a&&(t=a.width,n=a.height)}null!=this.minimumGraphSize&&(t=Math.max(t,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),t=Math.ceil(t-1),n=Math.ceil(n-1),this.dialect==mxConstants.DIALECT_SVG?((a=this.view.getDrawPane().ownerSVGElement).style.minWidth=Math.max(1,t)+"px",a.style.minHeight=Math.max(1,n)+"px",a.style.width="100%",a.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,t),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,t)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px"),this.updatePageBreaks(this.pageBreaksVisible,t-1,n-1)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(e,n){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var t=this.getBorderSizes();e+=Math.max(2,t.x+t.width+1),n+=Math.max(2,t.y+t.height+1)}else 9<=document.documentMode?(e+=3,n+=5):(e+=1,n+=1);else n+=1;null!=this.maximumContainerSize&&(e=Math.min(this.maximumContainerSize.width,e),n=Math.min(this.maximumContainerSize.height,n)),this.container.style.width=Math.ceil(e)+"px",this.container.style.height=Math.ceil(n)+"px"},mxGraph.prototype.updatePageBreaks=function(e,n,t){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale;i=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o);if(e=e&&Math.min(i.width,i.height)>this.minPageBreakDist,i.x=mxUtils.mod(i.x,i.width),i.y=mxUtils.mod(i.y,i.height),s=e?Math.ceil((n-i.x)/i.width):0,e=e?Math.ceil((t-i.y)/i.height):0,null==this.horizontalPageBreaks&&0<s&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(o=0;o<=s;o++){var r=[new mxPoint(i.x+o*i.width,1),new mxPoint(i.x+o*i.width,t)];null!=this.horizontalPageBreaks[o]?(this.horizontalPageBreaks[o].scale=1,this.horizontalPageBreaks[o].points=r,this.horizontalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,this.scale)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.horizontalPageBreaks[o]=r)}for(o=s;o<this.horizontalPageBreaks.length;o++)this.horizontalPageBreaks[o].destroy();this.horizontalPageBreaks.splice(s,this.horizontalPageBreaks.length-s)}if(null==this.verticalPageBreaks&&0<e&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(o=0;o<=e;o++)r=[new mxPoint(1,i.y+o*i.height),new mxPoint(n,i.y+o*i.height)],null!=this.verticalPageBreaks[o]?(this.verticalPageBreaks[o].scale=1,this.verticalPageBreaks[o].points=r,this.verticalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,a)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.verticalPageBreaks[o]=r);for(o=e;o<this.verticalPageBreaks.length;o++)this.verticalPageBreaks[o].destroy();this.verticalPageBreaks.splice(e,this.verticalPageBreaks.length-e)}},mxGraph.prototype.getCellStyle=function(e){var n=this.model.getStyle(e),t=null;t=this.model.isEdge(e)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=n&&(t=this.postProcessCellStyle(this.stylesheet.getCellStyle(n,t))),null==t&&(t=mxGraph.prototype.EMPTY_ARRAY),t},mxGraph.prototype.postProcessCellStyle=function(e){if(null!=e){var n=e[mxConstants.STYLE_IMAGE],t=this.getImageFromBundles(n);null!=t?e[mxConstants.STYLE_IMAGE]=t:t=n,null!=t&&"data:image/"==t.substring(0,11)&&(0<(n=t.indexOf(","))&&(t=t.substring(0,n)+";base64,"+t.substring(n+1)),e[mxConstants.STYLE_IMAGE]=t)}return e},mxGraph.prototype.setCellStyle=function(e,n){if(null!=(n=n||this.getSelectionCells())){this.model.beginUpdate();try{for(var t=0;t<n.length;t++)this.model.setStyle(n[t],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(e,n,t){t=t||this.getSelectionCell(),this.toggleCellStyles(e,n,[t])},mxGraph.prototype.toggleCellStyles=function(e,n,t){var a;(n=null!=n&&n,null!=(t=t||this.getSelectionCells())&&0<t.length)&&(null!=(a=null!=(a=this.view.getState(t[0]))?a.style:this.getCellStyle(t[0]))&&(n=mxUtils.getValue(a,e,n)?0:1,this.setCellStyles(e,n,t)))},mxGraph.prototype.setCellStyles=function(e,n,t){t=t||this.getSelectionCells(),mxUtils.setCellStyles(this.model,t,e,n)},mxGraph.prototype.toggleCellStyleFlags=function(e,n,t){this.setCellStyleFlags(e,n,null,t)},mxGraph.prototype.setCellStyleFlags=function(e,n,t,a){if(null!=(a=a||this.getSelectionCells())&&0<a.length){var i;if(null==t)null!=(i=null!=(i=this.view.getState(a[0]))?i.style:this.getCellStyle(a[0]))&&(t=(parseInt(i[e]||0)&n)!=n);mxUtils.setCellStyleFlags(this.model,a,e,n,t)}},mxGraph.prototype.alignCells=function(e,n,t){if(null==n&&(n=this.getSelectionCells()),null!=n&&1<n.length){if(null==t)for(var a=0;a<n.length;a++){var i=this.getCellGeometry(n[a]);if(null!=i&&!this.model.isEdge(n[a]))if(null==t){if(e==mxConstants.ALIGN_CENTER){t=i.x+i.width/2;break}if(e==mxConstants.ALIGN_RIGHT)t=i.x+i.width;else if(e==mxConstants.ALIGN_TOP)t=i.y;else{if(e==mxConstants.ALIGN_MIDDLE){t=i.y+i.height/2;break}t=e==mxConstants.ALIGN_BOTTOM?i.y+i.height:i.x}}else t=e==mxConstants.ALIGN_RIGHT?Math.max(t,i.x+i.width):e==mxConstants.ALIGN_TOP?Math.min(t,i.y):e==mxConstants.ALIGN_BOTTOM?Math.max(t,i.y+i.height):Math.min(t,i.x)}if(null!=t){this.model.beginUpdate();try{for(a=0;a<n.length;a++)null!=(i=this.getCellGeometry(n[a]))&&!this.model.isEdge(n[a])&&(i=i.clone(),e==mxConstants.ALIGN_CENTER?i.x=t-i.width/2:e==mxConstants.ALIGN_RIGHT?i.x=t-i.width:e==mxConstants.ALIGN_TOP?i.y=t:e==mxConstants.ALIGN_MIDDLE?i.y=t-i.height/2:e==mxConstants.ALIGN_BOTTOM?i.y=t-i.height:i.x=t,this.model.setGeometry(n[a],i));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",e,"cells",n))}finally{this.model.endUpdate()}}}return n},mxGraph.prototype.flipEdge=function(e){if(null!=e&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var n=this.model.getStyle(e);null==n||0==n.length?this.model.setStyle(e,this.alternateEdgeStyle):this.model.setStyle(e,null),this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",e))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.addImageBundle=function(e){this.imageBundles.push(e)},mxGraph.prototype.removeImageBundle=function(e){for(var n=[],t=0;t<this.imageBundles.length;t++)this.imageBundles[t]!=e&&n.push(this.imageBundles[t]);this.imageBundles=n},mxGraph.prototype.getImageFromBundles=function(e){if(null!=e)for(var n=0;n<this.imageBundles.length;n++){var t=this.imageBundles[n].getImage(e);if(null!=t)return t}return null},mxGraph.prototype.orderCells=function(e,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(n,e),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",e,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsOrdered=function(e,n){if(null!=e){this.model.beginUpdate();try{for(var t=0;t<e.length;t++){var a=this.model.getParent(e[t]);n?this.model.add(a,e[t],t):this.model.add(a,e[t],this.model.getChildCount(a)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",n,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(e,n,t){null==t&&(t=mxUtils.sortCells(this.getSelectionCells(),!0)),t=this.getCellsForGroup(t),null==e&&(e=this.createGroupCell(t));var a=this.getBoundsForGroup(e,t,n);if(0<t.length&&null!=a){var i=this.model.getParent(e);null==i&&(i=this.model.getParent(t[0])),this.model.beginUpdate();try{null==this.getCellGeometry(e)&&this.model.setGeometry(e,new mxGeometry);var s=this.model.getChildCount(i);this.cellsAdded([e],i,s,null,null,!1),s=this.model.getChildCount(e),this.cellsAdded(t,e,s,null,null,!1,!1),this.cellsMoved(t,-a.x,-a.y,!1,!0),this.cellsResized([e],[a]),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",e,"border",n,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForGroup=function(e){var n=[];if(null!=e&&0<e.length){var t=this.model.getParent(e[0]);n.push(e[0]);for(var a=1;a<e.length;a++)this.model.getParent(e[a])==t&&n.push(e[a])}return n},mxGraph.prototype.getBoundsForGroup=function(e,n,t){return null!=(n=this.getBoundingBoxFromGeometry(n))&&(this.isSwimlane(e)&&(e=this.getStartSize(e),n.x-=e.width,n.y-=e.height,n.width+=e.width,n.height+=e.height),n.x-=t,n.y-=t,n.width+=2*t,n.height+=2*t),n},mxGraph.prototype.createGroupCell=function(e){return(e=new mxCell("")).setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(e){var n=[];if(null==e){e=this.getSelectionCells();for(var t=[],a=0;a<e.length;a++)0<this.model.getChildCount(e[a])&&t.push(e[a]);e=t}if(null!=e&&0<e.length){this.model.beginUpdate();try{for(a=0;a<e.length;a++){if(null!=(i=this.model.getChildren(e[a]))&&0<i.length){var i=i.slice(),s=this.model.getParent(e[a]),o=this.model.getChildCount(s);this.cellsAdded(i,s,o,null,null,!0),n=n.concat(i)}}this.cellsRemoved(this.addAllEdges(e)),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",e))}finally{this.model.endUpdate()}}return n},mxGraph.prototype.removeCellsFromParent=function(e){null==e&&(e=this.getSelectionCells()),this.model.beginUpdate();try{var n=this.getDefaultParent(),t=this.model.getChildCount(n);this.cellsAdded(e,n,t,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.updateGroupBounds=function(e,n,t){null==e&&(e=this.getSelectionCells()),n=null!=n?n:0,t=null!=t&&t,this.model.beginUpdate();try{for(var a=0;a<e.length;a++){if(null!=(r=this.getCellGeometry(e[a]))){var i=this.getChildCells(e[a]);if(null!=i&&0<i.length){var s=this.getBoundingBoxFromGeometry(i);if(0<s.width&&0<s.height){var o=this.isSwimlane(e[a])?this.getStartSize(e[a]):new mxRectangle,r=r.clone();t&&(r.x+=s.x-o.width-n,r.y+=s.y-o.height-n),r.width=s.width+o.width+2*n,r.height=s.height+o.height+2*n,this.model.setGeometry(e[a],r),this.moveCells(i,-s.x+o.width+n,-s.y+o.height+n)}}}}}finally{this.model.endUpdate()}return e},mxGraph.prototype.cloneCells=function(e,n){n=null==n||n;var t=null;if(null!=e){for(var a={},i=(t=[],0);i<e.length;i++){a[s=mxCellPath.create(e[i])]=e[i],t.push(e[i])}if(0<t.length){var s=this.view.scale,o=this.view.translate;for(t=this.model.cloneCells(e,!0),i=0;i<e.length;i++)if(!n&&this.model.isEdge(t[i])&&null!=this.getEdgeValidationError(t[i],this.model.getTerminal(t[i],!0),this.model.getTerminal(t[i],!1)))t[i]=null;else{var r=this.model.getGeometry(t[i]);if(null!=r){var l=this.view.getState(e[i]),d=this.view.getState(this.model.getParent(e[i]));if(null!=l&&null!=d){var c=d.origin.x;d=d.origin.y;if(this.model.isEdge(t[i])){l=l.absolutePoints;for(var m=this.model.getTerminal(e[i],!0),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);for(null==m&&r.setTerminalPoint(new mxPoint(l[0].x/s-o.x,l[0].y/s-o.y),!0),m=this.model.getTerminal(e[i],!1),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);if(null==m&&(m=l.length-1,r.setTerminalPoint(new mxPoint(l[m].x/s-o.x,l[m].y/s-o.y),!1)),null!=(r=r.points))for(l=0;l<r.length;l++)r[l].x+=c,r[l].y+=d}else r.x+=c,r.y+=d}}}}else t=[]}return t},mxGraph.prototype.insertVertex=function(e,n,t,a,i,s,o,r,l){return n=this.createVertex(e,n,t,a,i,s,o,r,l),this.addCell(n,e)},mxGraph.prototype.createVertex=function(e,n,t,a,i,s,o,r,l){return(e=new mxGeometry(a,i,s,o)).relative=null!=l&&l,(t=new mxCell(t,e,r)).setId(n),t.setVertex(!0),t.setConnectable(!0),t},mxGraph.prototype.insertEdge=function(e,n,t,a,i,s){return n=this.createEdge(e,n,t,a,i,s),this.addEdge(n,e,a,i)},mxGraph.prototype.createEdge=function(e,n,t,a,i,s){return(e=new mxCell(t,new mxGeometry,s)).setId(n),e.setEdge(!0),e.geometry.relative=!0,e},mxGraph.prototype.addEdge=function(e,n,t,a,i){return this.addCell(e,n,i,t,a)},mxGraph.prototype.addCell=function(e,n,t,a,i){return this.addCells([e],n,t,a,i)[0]},mxGraph.prototype.addCells=function(e,n,t,a,i){null==n&&(n=this.getDefaultParent()),null==t&&(t=this.model.getChildCount(n)),this.model.beginUpdate();try{this.cellsAdded(e,n,t,a,i,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",e,"parent",n,"index",t,"source",a,"target",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsAdded=function(e,n,t,a,i,s,o){if(null!=e&&null!=n&&null!=t){this.model.beginUpdate();try{for(var r=null!=(d=s?this.view.getState(n):null)?d.origin:null,l=new mxPoint(0,0),d=0;d<e.length;d++)if(null==e[d])t--;else{var c=this.model.getParent(e[d]);if(null!=r&&e[d]!=n&&n!=c){var m=this.view.getState(c),u=null!=m?m.origin:l;if(null!=(p=this.model.getGeometry(e[d]))){var p,g=u.x-r.x,v=u.y-r.y;(p=p.clone()).translate(g,v),!p.relative&&this.model.isVertex(e[d])&&!this.isAllowNegativeCoordinates()&&(p.x=Math.max(0,p.x),p.y=Math.max(0,p.y)),this.model.setGeometry(e[d],p)}}n==c&&t+d>this.model.getChildCount(n)&&t--,this.model.add(n,e[d],t+d),this.isExtendParentsOnAdd()&&this.isExtendParent(e[d])&&this.extendParent(e[d]),(null==o||o)&&this.constrainChild(e[d]),null!=a&&this.cellConnected(e[d],a,!0),null!=i&&this.cellConnected(e[d],i,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",e,"parent",n,"index",t,"source",a,"target",i,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.removeCells=function(e,n){n=null==n||n,null==e&&(e=this.getDeletableCells(this.getSelectionCells())),n&&(e=this.getDeletableCells(this.addAllEdges(e))),this.model.beginUpdate();try{this.cellsRemoved(e),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",e,"includeEdges",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsRemoved=function(e){if(null!=e&&0<e.length){var n=this.view.scale,t=this.view.translate;this.model.beginUpdate();try{for(var a={},i=0;i<e.length;i++){var s=mxCellPath.create(e[i]);a[s]=e[i]}for(i=0;i<e.length;i++){for(var o=this.getConnections(e[i]),r=0;r<o.length;r++)if(null==a[s=mxCellPath.create(o[r])]){if(null!=(d=this.model.getGeometry(o[r]))){var l=this.view.getState(o[r]);if(null!=l){var d=d.clone(),c=l.getVisibleTerminal(!0)==e[i],m=l.absolutePoints,u=c?0:m.length-1;d.setTerminalPoint(new mxPoint(m[u].x/n-t.x,m[u].y/n-t.y),c),this.model.setTerminal(o[r],null,c),this.model.setGeometry(o[r],d)}}}this.model.remove(e[i])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(e,n,t,a,i){a=a||0,i=i||0,null==t&&(t=this.cloneCells([e])[0]);var s=this.model.getParent(e),o=this.model.getTerminal(e,!0);this.model.beginUpdate();try{this.cellsMoved(n,a,i,!1,!1),this.cellsAdded(n,s,this.model.getChildCount(s),null,null,!0),this.cellsAdded([t],s,this.model.getChildCount(s),o,n[0],!1),this.cellConnected(e,n[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",e,"cells",n,"newEdge",t,"dx",a,"dy",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.toggleCells=function(e,n,t){null==n&&(n=this.getSelectionCells()),t&&(n=this.addAllEdges(n)),this.model.beginUpdate();try{this.cellsToggled(n,e),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",e,"cells",n,"includeEdges",t))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsToggled=function(e,n){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var t=0;t<e.length;t++)this.model.setVisible(e[t],n)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(e,n,t,a){n=null!=n&&n,null==t&&(t=this.getFoldableCells(this.getSelectionCells(),e)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(t,e,n,a),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",e,"recurse",n,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsFolded=function(e,n,t,a){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var i=0;i<e.length;i++)if((!a||this.isCellFoldable(e[i],n))&&n!=this.isCellCollapsed(e[i])&&(this.model.setCollapsed(e[i],n),this.swapBounds(e[i],n),this.isExtendParent(e[i])&&this.extendParent(e[i]),t)){var s=this.model.getChildren(e[i]);this.foldCells(s,n,t)}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",e,"collapse",n,"recurse",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(e,n){if(null!=e){var t=this.model.getGeometry(e);null!=t&&(t=t.clone(),this.updateAlternateBounds(e,t,n),t.swap(),this.model.setGeometry(e,t))}},mxGraph.prototype.updateAlternateBounds=function(e,n,t){if(null!=e&&null!=n){if(t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e),null==n.alternateBounds){var a=n;this.collapseToPreferredSize&&(null!=(e=this.getPreferredSizeForCell(e))&&(a=e,0<(e=mxUtils.getValue(t,mxConstants.STYLE_STARTSIZE))&&(a.height=Math.max(a.height,e)))),n.alternateBounds=new mxRectangle(0,0,a.width,a.height)}if(null!=n.alternateBounds){n.alternateBounds.x=n.x,n.alternateBounds.y=n.y;var i=mxUtils.toRadians(t[mxConstants.STYLE_ROTATION]||"0");0!=i&&(e=n.alternateBounds.getCenterX()-n.getCenterX(),t=n.alternateBounds.getCenterY()-n.getCenterY(),a=Math.cos(i),i=Math.sin(i),n.alternateBounds.x+=a*e-i*t-e,n.alternateBounds.y+=i*e+a*t-t)}}},mxGraph.prototype.addAllEdges=function(e){var n=e.slice();return n.concat(this.getAllEdges(e))},mxGraph.prototype.getAllEdges=function(e){var n=[];if(null!=e)for(var t=0;t<e.length;t++){for(var a=this.model.getEdgeCount(e[t]),i=0;i<a;i++)n.push(this.model.getEdgeAt(e[t],i));a=this.model.getChildren(e[t]),n=n.concat(this.getAllEdges(a))}return n},mxGraph.prototype.updateCellSize=function(e,n){n=null!=n&&n,this.model.beginUpdate();try{this.cellSizeUpdated(e,n),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",e,"ignoreChildren",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellSizeUpdated=function(e,n){if(null!=e){this.model.beginUpdate();try{var t=this.getPreferredSizeForCell(e),a=this.model.getGeometry(e);if(null!=t&&null!=a){var i=this.isCellCollapsed(e);a=a.clone();if(this.isSwimlane(e)){var s=this.view.getState(e),o=null!=s?s.style:this.getCellStyle(e),r=this.model.getStyle(e);null==r&&(r=""),mxUtils.getValue(o,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,t.height+8),i&&(a.height=t.height+8),a.width=t.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,t.width+8),i&&(a.width=t.width+8),a.height=t.height),this.model.setStyle(e,r)}else a.width=t.width,a.height=t.height;if(!n&&!i){var l=this.view.getBounds(this.model.getChildren(e));if(null!=l){var d=this.view.translate,c=this.view.scale,m=(l.y+l.height)/c-a.y-d.y;a.width=Math.max(a.width,(l.x+l.width)/c-a.x-d.x),a.height=Math.max(a.height,m)}}this.cellsResized([e],[a])}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(e){var n=null;if(null!=e){var t=this.view.getState(e),a=null!=t?t.style:this.getCellStyle(e);if(null!=a&&!this.model.isEdge(e)){var i=a[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,s=0;n=0;null==this.getImage(t)&&null==a[mxConstants.STYLE_IMAGE]||a[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(a[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(s+=parseFloat(a[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),a[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(n+=parseFloat(a[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),s+=2*(a[mxConstants.STYLE_SPACING]||0),s+=a[mxConstants.STYLE_SPACING_LEFT]||0,s+=a[mxConstants.STYLE_SPACING_RIGHT]||0,n+=2*(a[mxConstants.STYLE_SPACING]||0),n+=a[mxConstants.STYLE_SPACING_TOP]||0,n+=a[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(t=this.getFoldingImage(t))&&(s+=t.width+8),n=null!=(t=this.getLabel(e))&&0<t.length?(this.isHtmlLabel(e)||(t=t.replace(/\n/g,"<br>")),e=(i=mxUtils.getSizeForString(t,i,a[mxConstants.STYLE_FONTFAMILY])).width+s,n=i.height+n,mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)||(a=n,n=e,e=a),this.gridEnabled&&(e=this.snap(e+this.gridSize/2),n=this.snap(n+this.gridSize/2)),new mxRectangle(0,0,e,n)):new mxRectangle(0,0,a=4*this.gridSize,a)}}return n},mxGraph.prototype.handleGesture=function(e,n){if(.2<Math.abs(1-n.scale)){var t=this.view.scale,a=this.view.translate,i=e.width*n.scale,s=e.height*n.scale,o=e.y-(s-e.height)/2;t=new mxRectangle(this.snap((e.x-(i-e.width)/2)/t)-a.x,this.snap(o/t)-a.y,this.snap(i/t),this.snap(s/t));this.resizeCell(e.cell,t)}},mxGraph.prototype.resizeCell=function(e,n){return this.resizeCells([e],[n])[0]},mxGraph.prototype.resizeCells=function(e,n){this.model.beginUpdate();try{this.cellsResized(e,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",e,"bounds",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsResized=function(e,n){if(null!=e&&null!=n&&e.length==n.length){this.model.beginUpdate();try{for(var t=0;t<e.length;t++){var a=n[t],i=this.model.getGeometry(e[t]);if(null!=i&&(i.x!=a.x||i.y!=a.y||i.width!=a.width||i.height!=a.height)){if((i=i.clone()).relative){var s=i.offset;null!=s&&(s.x+=a.x-i.x,s.y+=a.y-i.y)}else i.x=a.x,i.y=a.y;i.width=a.width,i.height=a.height,!i.relative&&this.model.isVertex(e[t])&&!this.isAllowNegativeCoordinates()&&(i.x=Math.max(0,i.x),i.y=Math.max(0,i.y)),this.model.setGeometry(e[t],i),this.isExtendParent(e[t])&&this.extendParent(e[t])}}this.resetEdgesOnResize&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",e,"bounds",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.extendParent=function(e){if(null!=e){var n=this.model.getParent(e),t=this.model.getGeometry(n);null!=n&&null!=t&&!this.isCellCollapsed(n)&&(null!=(e=this.model.getGeometry(e))&&(t.width<e.x+e.width||t.height<e.y+e.height))&&((t=t.clone()).width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height),this.cellsResized([n],[t]))}},mxGraph.prototype.importCells=function(e,n,t,a,i){return this.moveCells(e,n,t,!0,a,i)},mxGraph.prototype.moveCells=function(e,n,t,a,i,s){if(n=null!=n?n:0,t=null!=t?t:0,a=null!=a&&a,null!=e&&(0!=n||0!=t||a||null!=i)){this.model.beginUpdate();try{a&&(e=this.cloneCells(e,this.isCloneInvalidEdges()),null==i&&(i=this.getDefaultParent()));var o=this.isAllowNegativeCoordinates();if(null!=i&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(e,n,t,!a&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==i),this.setAllowNegativeCoordinates(o),null!=i){var r=this.model.getChildCount(i);this.cellsAdded(e,i,r,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",e,"dx",n,"dy",t,"clone",a,"target",i,"event",s))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.cellsMoved=function(e,n,t,a,i){if(null!=e&&(0!=n||0!=t)){this.model.beginUpdate();try{a&&this.disconnectGraph(e);for(var s=0;s<e.length;s++)this.translateCell(e[s],n,t),i&&this.constrainChild(e[s]);this.resetEdgesOnMove&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",e,"dx",t,"dy",t,"disconnect",a))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(e,n,t){var a=this.model.getGeometry(e);null!=a&&((a=a.clone()).translate(n,t),!a.relative&&this.model.isVertex(e)&&!this.isAllowNegativeCoordinates()&&(a.x=Math.max(0,a.x),a.y=Math.max(0,a.y)),a.relative&&!this.model.isEdge(e)&&(null==a.offset?a.offset=new mxPoint(n,t):(a.offset.x+=n,a.offset.y+=t)),this.model.setGeometry(e,a))},mxGraph.prototype.getCellContainmentArea=function(e){if(null!=e&&!this.model.isEdge(e)){var n=this.model.getParent(e);if(n==this.getDefaultParent()||n==this.getCurrentRoot())return this.getMaximumGraphBounds();if(null!=n&&n!=this.getDefaultParent())if(null!=(i=this.model.getGeometry(n))){var t=e=0,a=i.width,i=i.height;return this.isSwimlane(n)&&(e=(n=this.getStartSize(n)).width,a-=n.width,t=n.height,i-=n.height),new mxRectangle(e,t,a,i)}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(e){if(null!=e){var n=this.model.getGeometry(e),t=this.isConstrainChild(e)?this.getCellContainmentArea(e):this.getMaximumGraphBounds();null!=n&&null!=t&&!n.relative&&(n.x<t.x||n.y<t.y||t.width<n.x+n.width||t.height<n.y+n.height)&&(e=this.getOverlap(e),0<t.width&&(n.x=Math.min(n.x,t.x+t.width-(1-e)*n.width)),0<t.height&&(n.y=Math.min(n.y,t.y+t.height-(1-e)*n.height)),n.x=Math.max(n.x,t.x-n.width*e),n.y=Math.max(n.y,t.y-n.height*e))}},mxGraph.prototype.resetEdges=function(e){if(null!=e){for(var n={},t=0;t<e.length;t++){var a=mxCellPath.create(e[t]);n[a]=e[t]}this.model.beginUpdate();try{for(t=0;t<e.length;t++){var i=this.model.getEdges(e[t]);if(null!=i)for(a=0;a<i.length;a++){var s=this.view.getState(i[a]),o=null!=s?s.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[a],!0),r=null!=s?s.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[a],!1),l=mxCellPath.create(o),d=mxCellPath.create(r);(null==n[l]||null==n[d])&&this.resetEdge(i[a])}this.resetEdges(this.model.getChildren(e[t]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(e){var n=this.model.getGeometry(e);return null!=n&&null!=n.points&&0<n.points.length&&((n=n.clone()).points=[],this.model.setGeometry(e,n)),e},mxGraph.prototype.getAllConnectionConstraints=function(e,n){return null!=e&&null!=e.shape&&null!=e.shape.stencil?e.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(e,n,t){n=null;var a=e.style[t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=a){var i=e.style[t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=i&&(n=new mxPoint(parseFloat(a),parseFloat(i)))}return a=!1,null!=n&&(a=mxUtils.getValue(e.style,t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(n,a)},mxGraph.prototype.setConnectionConstraint=function(e,n,t,a){if(null!=a){this.model.beginUpdate();try{null==a||null==a.point?(this.setCellStyles(t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e])):null!=a.point&&(this.setCellStyles(t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,a.point.x,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,a.point.y,[e]),a.perimeter?this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e]):this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[e]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(e,n){var t=null;if(null!=e){var a=this.view.getPerimeterBounds(e),i=new mxPoint(a.getCenterX(),a.getCenterY()),s=e.style[mxConstants.STYLE_DIRECTION],o=0;if(null!=s&&("north"==s?o+=270:"west"==s?o+=180:"south"==s&&(o+=90),"north"==s||"south"==s)){a.x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var r=a.width;a.width=a.height,a.height=r}if(null!=n.point){var l=t=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],u=e.style[mxConstants.STYLE_FLIPV];null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,u=1==mxUtils.getValue(e.style,"stencilFlipV",0)||u),"north"!=s&&"south"!=s||(r=m,m=u,u=r),m&&(t=-1,d=-a.width),u&&(l=-1,c=-a.height)}t=new mxPoint(a.x+n.point.x*a.width*t-d,a.y+n.point.y*a.height*l-c)}s=e.style[mxConstants.STYLE_ROTATION]||0,n.perimeter?(0!=o&&null!=t&&(r=a=0,90==o?r=1:180==o?a=-1:270==s&&(r=-1),t=mxUtils.getRotatedPoint(t,a,r,i)),null!=t&&n.perimeter&&(t=this.view.getPerimeterPoint(e,t,!1))):s+=o,0!=s&&null!=t&&(o=mxUtils.toRadians(s),a=Math.cos(o),r=Math.sin(o),t=mxUtils.getRotatedPoint(t,a,r,i))}return t},mxGraph.prototype.connectCell=function(e,n,t,a){this.model.beginUpdate();try{var i=this.model.getTerminal(e,t);this.cellConnected(e,n,t,a),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",e,"terminal",n,"source",t,"previous",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellConnected=function(e,n,t,a){if(null!=e){this.model.beginUpdate();try{var i=this.model.getTerminal(e,t);this.setConnectionConstraint(e,n,t,a),this.isPortsEnabled()&&(a=null,this.isPort(n)&&(a=n.getId(),n=this.getTerminalForPort(n,t)),this.setCellStyles(t?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,a,[e])),this.model.setTerminal(e,n,t),this.resetEdgesOnConnect&&this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",e,"terminal",n,"source",t,"previous",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(e){if(null!=e){this.model.beginUpdate();try{for(var n=this.view.scale,t=this.view.translate,a={},i=0;i<e.length;i++){a[mxCellPath.create(e[i])]=e[i]}for(i=0;i<e.length;i++)if(this.model.isEdge(e[i])){if(null!=(r=this.model.getGeometry(e[i]))){var s=this.view.getState(e[i]),o=this.view.getState(this.model.getParent(e[i]));if(null!=s&&null!=o){var r=r.clone(),l=-o.origin.x,d=-o.origin.y,c=s.absolutePoints,m=this.model.getTerminal(e[i],!0);if(null!=m&&this.isCellDisconnectable(e[i],m,!0)){for(var u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);null==m&&(r.setTerminalPoint(new mxPoint(c[0].x/n-t.x+l,c[0].y/n-t.y+d),!0),this.model.setTerminal(e[i],null,!0))}var p=this.model.getTerminal(e[i],!1);if(null!=p&&this.isCellDisconnectable(e[i],p,!1)){for(var g=mxCellPath.create(p);null!=p&&null==a[g];)p=this.model.getParent(p),g=mxCellPath.create(p);if(null==p){var v=c.length-1;r.setTerminalPoint(new mxPoint(c[v].x/n-t.x+l,c[v].y/n-t.y+d),!1),this.model.setTerminal(e[i],null,!1)}}this.model.setGeometry(e[i],r)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(e){return null},mxGraph.prototype.isPort=function(e){return!1},mxGraph.prototype.getTerminalForPort=function(e,n){return this.model.getParent(e)},mxGraph.prototype.getChildOffsetForCell=function(e){return null},mxGraph.prototype.enterGroup=function(e){null!=(e=e||this.getSelectionCell())&&this.isValidRoot(e)&&(this.view.setCurrentRoot(e),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var e=this.model.getRoot(),n=this.getCurrentRoot();if(null!=n){for(var t=this.model.getParent(n);t!=e&&!this.isValidRoot(t)&&this.model.getParent(t)!=e;)t=this.model.getParent(t);t==e||this.model.getParent(t)==e?this.view.setCurrentRoot(null):this.view.setCurrentRoot(t),null!=this.view.getState(n)&&this.setSelectionCell(n)}},mxGraph.prototype.home=function(){var e=this.getCurrentRoot();null!=e&&(this.view.setCurrentRoot(null),null!=this.view.getState(e)&&this.setSelectionCell(e))},mxGraph.prototype.isValidRoot=function(e){return null!=e},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(e,n,t){var a=[e];if(n&&(a=a.concat(this.model.getEdges(e))),a=this.view.getBounds(a),t){t=this.model.getChildCount(e);for(var i=0;i<t;i++){var s=this.getCellBounds(this.model.getChildAt(e,i),n,!0);null!=a?a.add(s):a=s}}return a},mxGraph.prototype.getBoundingBoxFromGeometry=function(e,n){n=null!=n&&n;var t=null;if(null!=e)for(var a=0;a<e.length;a++)if(n||this.model.isVertex(e[a])){var i=this.getCellGeometry(e[a]);if(null!=i){var s=i.points;if(null!=s&&0<s.length){for(var o=new mxRectangle(s[0].x,s[0].y,0,0),r=function(e){null!=e&&o.add(new mxRectangle(e.x,e.y,0,0))},l=1;l<s.length;l++)r(s[l]);r(i.getTerminalPoint(!0)),r(i.getTerminalPoint(!1))}null==t?t=new mxRectangle(i.x,i.y,i.width,i.height):t.add(i)}}return t},mxGraph.prototype.refresh=function(e){this.view.clear(e,null==e),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(e){return this.gridEnabled&&(e=Math.round(e/this.gridSize)*this.gridSize),e},mxGraph.prototype.panGraph=function(e,n){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-e,this.container.scrollTop=-n;else{var t=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==e&&0==n){if(mxClient.IS_IE?t.setAttribute("transform","translate("+e+","+n+")"):t.removeAttribute("transform"),null!=this.shiftPreview1){for(var a=this.shiftPreview1.firstChild;null!=a;){var i=a.nextSibling;this.container.appendChild(a),a=i}for(this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(t.parentNode),a=this.shiftPreview2.firstChild;null!=a;)i=a.nextSibling,this.container.appendChild(a),a=i;this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(t.setAttribute("transform","translate("+e+","+n+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;for(a=this.container.firstChild;null!=a;)i=a.nextSibling,a!=t.parentNode?s.appendChild(a):s=this.shiftPreview2,a=i;this.container.insertBefore(this.shiftPreview1,t.parentNode),this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=e+"px",this.shiftPreview1.style.top=n+"px",this.shiftPreview2.style.left=e+"px",this.shiftPreview2.style.top=n+"px"}else t.style.left=e+"px",t.style.top=n+"px";this.panDx=e,this.panDy=n,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(e,n){this.zoom(e/this.view.scale,n)},mxGraph.prototype.zoom=function(e,n){n=null!=n?n:this.centerZoom;var t=this.view.scale*e,a=this.view.getState(this.getSelectionCell());if(this.keepSelectionVisibleOnZoom&&null!=a)a=new mxRectangle(a.x*e,a.y*e,a.width*e,a.height*e),this.view.scale=t,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(t));else if(n&&!mxUtils.hasScrollbars(this.container)){a=this.container.offsetWidth;var i=this.container.offsetHeight;if(1<e){var s=(e-1)/(2*t);a=a*-s,i=i*-s}else a*=s=(1/e-1)/(2*this.view.scale),i*=s;this.view.scaleAndTranslate(t,this.view.translate.x+a,this.view.translate.y+i)}else this.view.setScale(t),mxUtils.hasScrollbars(this.container)&&(i=a=0,n&&(a=this.container.offsetWidth*(e-1)/2,i=this.container.offsetHeight*(e-1)/2),this.container.scrollLeft=Math.round(this.container.scrollLeft*e+a),this.container.scrollTop=Math.round(this.container.scrollTop*e+i))},mxGraph.prototype.zoomToRect=function(e){var n=this.container.clientWidth/e.width/(this.container.clientHeight/e.height);e.x=Math.max(0,e.x),e.y=Math.max(0,e.y);var t=Math.min(this.container.scrollWidth,e.x+e.width),a=Math.min(this.container.scrollHeight,e.y+e.height);e.width=t-e.x,e.height=a-e.y,n<1?(t=((n=e.height/n)-e.height)/2,e.height=n,n=Math.min(e.y,t),e.y-=n,a=Math.min(this.container.scrollHeight,e.y+e.height),e.height=a-e.y):(t=((n*=e.width)-e.width)/2,e.width=n,n=Math.min(e.x,t),e.x-=n,t=Math.min(this.container.scrollWidth,e.x+e.width),e.width=t-e.x),n=this.container.clientWidth/e.width,t=this.view.scale*n,mxUtils.hasScrollbars(this.container)?(this.view.setScale(t),this.container.scrollLeft=Math.round(e.x*n),this.container.scrollTop=Math.round(e.y*n)):this.view.scaleAndTranslate(t,this.view.translate.x-e.x/this.view.scale,this.view.translate.y-e.y/this.view.scale)},mxGraph.prototype.fit=function(e,n){if(null!=this.container){e=null!=e?e:0,n=null!=n&&n;var t=this.container.clientWidth,a=this.container.clientHeight,i=this.view.getGraphBounds();n&&null!=i.x&&null!=i.y&&(i.width+=i.x,i.height+=i.y,i.x=0,i.y=0);var s=this.view.scale,o=i.width/s,r=i.height/s;null!=this.backgroundImage&&(o=Math.max(o,this.backgroundImage.width-i.x/s),r=Math.max(r,this.backgroundImage.height-i.y/s));var l=n?e:2*e;t=Math.floor(100*Math.min(t/(o+l),a/(r+l)))/100;null!=this.minFitScale&&(t=Math.max(t,this.minFitScale)),null!=this.maxFitScale&&(t=Math.min(t,this.maxFitScale)),n?this.view.scale!=t&&this.view.setScale(t):mxUtils.hasScrollbars(this.container)?(this.view.setScale(t),null!=i.x&&(this.container.scrollLeft=Math.round(i.x/s)*t-e-Math.max(0,(this.container.clientWidth-o*t)/2)),null!=i.y&&(this.container.scrollTop=Math.round(i.y/s)*t-e-Math.max(0,(this.container.clientHeight-r*t)/2))):this.view.scaleAndTranslate(t,null!=i.x?Math.floor(this.view.translate.x-i.x/s+e+1):e,null!=i.y?Math.floor(this.view.translate.y-i.y/s+e+1):e)}return this.view.scale},mxGraph.prototype.scrollCellToVisible=function(e,n){var t=-this.view.translate.x,a=-this.view.translate.y,i=this.view.getState(e);null!=i&&(t=new mxRectangle(t+i.x,a+i.y,i.width,i.height),n&&null!=this.container&&(a=this.container.clientWidth,i=this.container.clientHeight,t.x=t.getCenterX()-a/2,t.width=a,t.y=t.getCenterY()-i/2,t.height=i),this.scrollRectToVisible(t)&&this.view.setTranslate(this.view.translate.x,this.view.translate.y))},mxGraph.prototype.scrollRectToVisible=function(e){var n=!1;if(null!=e){var t=this.container.offsetWidth,a=this.container.offsetHeight,i=Math.min(t,e.width),s=Math.min(a,e.height);if(mxUtils.hasScrollbars(this.container)){t=this.container,e.x+=this.view.translate.x,e.y+=this.view.translate.y;var o=t.scrollLeft-e.x;a=Math.max(o-t.scrollLeft,0);0<o?t.scrollLeft-=o+2:0<(o=e.x+i-t.scrollLeft-t.clientWidth)&&(t.scrollLeft+=o+2),i=t.scrollTop-e.y,o=Math.max(0,i-t.scrollTop),0<i?t.scrollTop-=i+2:0<(i=e.y+s-t.scrollTop-t.clientHeight)&&(t.scrollTop+=i+2),!this.useScrollbarsForPanning&&(0!=a||0!=o)&&this.view.setTranslate(a,o)}else{o=-this.view.translate.x;var r=-this.view.translate.y,l=this.view.scale;e.x+i>o+t&&(this.view.translate.x-=(e.x+i-t-o)/l,n=!0),e.y+s>r+a&&(this.view.translate.y-=(e.y+s-a-r)/l,n=!0),e.x<o&&(this.view.translate.x+=(o-e.x)/l,n=!0),e.y<r&&(this.view.translate.y+=(r-e.y)/l,n=!0),n&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return n},mxGraph.prototype.getCellGeometry=function(e){return this.model.getGeometry(e)},mxGraph.prototype.isCellVisible=function(e){return this.model.isVisible(e)},mxGraph.prototype.isCellCollapsed=function(e){return this.model.isCollapsed(e)},mxGraph.prototype.isCellConnectable=function(e){return this.model.isConnectable(e)},mxGraph.prototype.isOrthogonal=function(e){var n=e.style[mxConstants.STYLE_ORTHOGONAL];return null!=n?n:(e=this.view.getEdgeStyle(e))==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom||e==mxEdgeStyle.EntityRelation||e==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(e){var n=e.getVisibleTerminalState(!0);return e=e.getVisibleTerminalState(!1),null!=n&&n==e},mxGraph.prototype.isCloneEvent=function(e){return mxEvent.isControlDown(e)},mxGraph.prototype.isToggleEvent=function(e){return mxClient.IS_MAC?mxEvent.isMetaDown(e):mxEvent.isControlDown(e)},mxGraph.prototype.isGridEnabledEvent=function(e){return null!=e&&!mxEvent.isAltDown(e)},mxGraph.prototype.isConstrainedEvent=function(e){return mxEvent.isShiftDown(e)},mxGraph.prototype.isForceMarqueeEvent=function(e){return mxEvent.isAltDown(e)},mxGraph.prototype.validationAlert=function(e){mxUtils.alert(e)},mxGraph.prototype.isEdgeValid=function(e,n,t){return null==this.getEdgeValidationError(e,n,t)},mxGraph.prototype.getEdgeValidationError=function(e,n,t){if(null!=e&&!this.isAllowDanglingEdges()&&(null==n||null==t))return"";if(null!=e&&null==this.model.getTerminal(e,!0)&&null==this.model.getTerminal(e,!1))return null;if(!this.allowLoops&&n==t&&null!=n||!this.isValidConnection(n,t))return"";if(null==n||null==t)return this.allowDanglingEdges?null:"";var a="";this.multigraph||(1<(i=this.model.getEdgesBetween(n,t,!0)).length||1==i.length&&i[0]!=e)&&(a+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var i=this.model.getDirectedEdgeCount(n,!0,e),s=this.model.getDirectedEdgeCount(t,!1,e);if(null!=this.multiplicities)for(var o=0;o<this.multiplicities.length;o++){var r=this.multiplicities[o].check(this,e,n,t,i,s);null!=r&&(a+=r)}return null!=(r=this.validateEdge(e,n,t))&&(a+=r),0<a.length?a:null},mxGraph.prototype.validateEdge=function(e,n,t){return null},mxGraph.prototype.validateGraph=function(e,n){e=null!=e?e:this.model.getRoot(),n=null!=n?n:{};for(var t=!0,a=this.model.getChildCount(e),i=0;i<a;i++){var s=this.model.getChildAt(e,i),o=n;this.isValidRoot(s)&&(o={}),null!=(o=this.validateGraph(s,o))?this.setCellWarning(s,o.replace(/\n/g,"<br>")):this.setCellWarning(s,null),t=t&&null==o}return a="",this.isCellCollapsed(e)&&!t&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),a=this.model.isEdge(e)?a+(this.getEdgeValidationError(e,this.model.getTerminal(e,!0),this.model.getTerminal(e,!1))||""):a+(this.getCellValidationError(e)||""),null!=(i=this.validateCell(e,n))&&(a+=i),null==this.model.getParent(e)&&this.view.validate(),0<a.length||!t?a:null},mxGraph.prototype.getCellValidationError=function(e){var n=this.model.getDirectedEdgeCount(e,!0),t=this.model.getDirectedEdgeCount(e,!1);e=this.model.getValue(e);var a="";if(null!=this.multiplicities)for(var i=0;i<this.multiplicities.length;i++){var s=this.multiplicities[i];s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<n||1==s.min&&0==n||1==s.max&&1<n)?a+=s.countError+"\n":!s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<t||1==s.min&&0==t||1==s.max&&1<t)&&(a+=s.countError+"\n")}return 0<a.length?a:null},mxGraph.prototype.validateCell=function(e,n){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(e){this.backgroundImage=e},mxGraph.prototype.getFoldingImage=function(e){if(null!=e&&this.foldingEnabled&&!this.getModel().isEdge(e.cell)){var n=this.isCellCollapsed(e.cell);if(this.isCellFoldable(e.cell,!n))return n?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(e){if(null!=(e=this.model.getValue(e))){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(e){var n="";if(this.labelsVisible&&null!=e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);mxUtils.getValue(t,mxConstants.STYLE_NOLABEL,!1)||(n=this.convertValueToString(e))}return n},mxGraph.prototype.isHtmlLabel=function(e){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(e){this.htmlLabels=e},mxGraph.prototype.isWrapping=function(e){var n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&"wrap"==e[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(e){var n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&"hidden"==e[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(e,t,n,a){var i=null;return null!=e&&(null==e.control||t!=e.control.node&&t.parentNode!=e.control.node||(i=this.collapseExpandResource,i=mxResources.get(i)||i),null==i&&null!=e.overlays&&e.overlays.visit(function(e,n){null!=i||t!=n.node&&t.parentNode!=n.node||(i=n.overlay.toString())}),null==i&&(null!=(n=this.selectionCellsHandler.getHandler(e.cell))&&"function"==typeof n.getTooltipForNode&&(i=n.getTooltipForNode(t))),null==i&&(i=this.getTooltipForCell(e.cell))),i},mxGraph.prototype.getTooltipForCell=function(e){return null!=e&&null!=e.getTooltip?e.getTooltip():this.convertValueToString(e)},mxGraph.prototype.getCursorForCell=function(e){return null},mxGraph.prototype.getStartSize=function(e){var n=new mxRectangle,t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&(t=parseInt(mxUtils.getValue(e,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)?n.height=t:n.width=t),n},mxGraph.prototype.getImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(e){this.border=e},mxGraph.prototype.isSwimlane=function(e){var n;if(null!=e&&this.model.getParent(e)!=this.model.getRoot()&&(null!=(n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e))&&!this.model.isEdge(e)))return n[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE;return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(e){this.resizeContainer=e},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(e){this.enabled=e},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(e){this.escapeEnabled=e},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(e){this.invokesStopCellEditing=e},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(e){this.enterStopsCellEditing=e},mxGraph.prototype.isCellLocked=function(e){var n=this.model.getGeometry(e);return this.isCellsLocked()||null!=n&&this.model.isVertex(e)&&n.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(e){this.cellsLocked=e},mxGraph.prototype.getCloneableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(e){this.cellsCloneable=e},mxGraph.prototype.getExportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(e){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(e){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(e){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(e){this.cellsSelectable=e},mxGraph.prototype.getDeletableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(e){this.cellsDeletable=e},mxGraph.prototype.isLabelMovable=function(e){return!this.isCellLocked(e)&&(this.model.isEdge(e)&&this.edgeLabelsMovable||this.model.isVertex(e)&&this.vertexLabelsMovable)},mxGraph.prototype.getMovableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsMovable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(e){this.cellsMovable=e},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(e){this.portsEnabled=e},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(e){this.gridSize=e},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(e){this.tolerance=e},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(e){this.vertexLabelsMovable=e},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(e){this.edgeLabelsMovable=e},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(e){this.swimlaneNesting=e},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(e){this.swimlaneSelectionEnabled=e},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(e){this.multigraph=e},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(e){this.allowDanglingEdges=e},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(e){this.connectableEdges=e},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(e){this.cloneInvalidEdges=e},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(e){this.allowLoops=e},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(e){this.disconnectOnMove=e},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(e){this.dropEnabled=e},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(e){this.splitEnabled=e},mxGraph.prototype.isCellResizable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsResizable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_RESIZABLE]},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(e){this.cellsResizable=e},mxGraph.prototype.isTerminalPointMovable=function(e,n){return!0},mxGraph.prototype.isCellBendable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsBendable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(e){this.cellsBendable=e},mxGraph.prototype.isCellEditable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsEditable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(e){this.cellsEditable=e},mxGraph.prototype.isCellDisconnectable=function(e,n,t){return this.isCellsDisconnectable()&&!this.isCellLocked(e)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(e){this.cellsDisconnectable=e},mxGraph.prototype.isValidSource=function(e){return null==e&&this.allowDanglingEdges||null!=e&&(!this.model.isEdge(e)||this.connectableEdges)&&this.isCellConnectable(e)},mxGraph.prototype.isValidTarget=function(e){return this.isValidSource(e)},mxGraph.prototype.isValidConnection=function(e,n){return this.isValidSource(e)&&this.isValidTarget(n)},mxGraph.prototype.setConnectable=function(e){this.connectionHandler.setEnabled(e)},mxGraph.prototype.isConnectable=function(e){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(e){this.tooltipHandler.setEnabled(e)},mxGraph.prototype.setPanning=function(e){this.panningHandler.panningEnabled=e},mxGraph.prototype.isEditing=function(e){if(null==this.cellEditor)return!1;var n=this.cellEditor.getEditingCell();return null==e?null!=n:e==n},mxGraph.prototype.isAutoSizeCell=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(e){this.autoSizeCells=e},mxGraph.prototype.isExtendParent=function(e){return!this.getModel().isEdge(e)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(e){this.extendParents=e},mxGraph.prototype.isExtendParentsOnAdd=function(){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(e){this.extendParentsOnAdd=e},mxGraph.prototype.isConstrainChild=function(e){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(e))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(e){this.constrainChildren=e},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(e){this.allowNegativeCoordinates=e},mxGraph.prototype.getOverlap=function(e){return this.isAllowOverlapParent(e)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(e){return!1},mxGraph.prototype.getFoldableCells=function(e,n){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellFoldable(e,n)}))},mxGraph.prototype.isCellFoldable=function(e,n){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return 0<this.model.getChildCount(e)&&0!=t[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(e,n,t){return null!=e&&(this.isSplitEnabled()&&this.isSplitTarget(e,n,t)||!this.model.isEdge(e)&&(this.isSwimlane(e)||0<this.model.getChildCount(e)&&!this.isCellCollapsed(e)))},mxGraph.prototype.isSplitTarget=function(e,n,t){return!(!this.model.isEdge(e)||null==n||1!=n.length||!this.isCellConnectable(n[0])||null!=this.getEdgeValidationError(e,this.model.getTerminal(e,!0),n[0]))&&(t=this.model.getTerminal(e,!0),e=this.model.getTerminal(e,!1),!this.model.isAncestor(n[0],t)&&!this.model.isAncestor(n[0],e))},mxGraph.prototype.getDropTarget=function(e,n,t){if(!this.isSwimlaneNesting())for(var a=0;a<e.length;a++)if(this.isSwimlane(e[a]))return null;if((a=mxUtils.convertPoint(this.container,mxEvent.getClientX(n),mxEvent.getClientY(n))).x-=this.panDx,a.y-=this.panDy,a=this.getSwimlaneAt(a.x,a.y),null==t)t=a;else if(null!=a){for(var i=this.model.getParent(a);null!=i&&this.isSwimlane(i)&&i!=t;)i=this.model.getParent(i);i==t&&(t=a)}for(;null!=t&&!this.isValidDropTarget(t,e,n)&&!this.model.isLayer(t);)t=this.model.getParent(t);return!this.model.isLayer(t)&&mxUtils.indexOf(e,t)<0?t:null},mxGraph.prototype.getDefaultParent=function(){var e=this.defaultParent;return null==e&&(null==(e=this.getCurrentRoot())&&(e=this.model.getRoot(),e=this.model.getChildAt(e,0))),e},mxGraph.prototype.setDefaultParent=function(e){this.defaultParent=e},mxGraph.prototype.getSwimlane=function(e){for(;null!=e&&!this.isSwimlane(e);)e=this.model.getParent(e);return e},mxGraph.prototype.getSwimlaneAt=function(e,n,t){if(null!=(t=t||this.getDefaultParent()))for(var a=this.model.getChildCount(t),i=0;i<a;i++){var s=this.model.getChildAt(t,i),o=this.getSwimlaneAt(e,n,s);if(null!=o)return o;if(this.isSwimlane(s)&&(o=this.view.getState(s),this.intersects(o,e,n)))return s}return null},mxGraph.prototype.getCellAt=function(e,n,t,a,i){if(a=null==a||a,i=null==i||i,null!=(t=null!=t?t:this.getDefaultParent()))for(var s=this.model.getChildCount(t)-1;0<=s;s--){var o=this.model.getChildAt(t,s),r=this.getCellAt(e,n,o,a,i);if(null!=r)return r;if(this.isCellVisible(o)&&(i&&this.model.isEdge(o)||a&&this.model.isVertex(o))&&(r=this.view.getState(o),this.intersects(r,e,n)))return o}return null},mxGraph.prototype.intersects=function(e,n,t){if(null!=e){var a=e.absolutePoints;if(null!=a){e=this.tolerance*this.tolerance;for(var i=a[0],s=1;s<a.length;s++){var o=a[s];if(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,n,t)<=e)return!0;i=o}}else if(0!=(i=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(a=Math.cos(-i),i=Math.sin(-i),s=new mxPoint(e.getCenterX(),e.getCenterY()),n=(i=mxUtils.getRotatedPoint(new mxPoint(n,t),a,i,s)).x,t=i.y),mxUtils.contains(e,n,t))return!0}return!1},mxGraph.prototype.hitsSwimlaneContent=function(e,n,t){var a=this.getView().getState(e);if(e=this.getStartSize(e),null!=a){var i=this.getView().getScale();if(n-=a.x,t-=a.y,0<e.width&&0<n&&n>e.width*i||0<e.height&&0<t&&t>e.height*i)return!0}return!1},mxGraph.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraph.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraph.prototype.getChildCells=function(e,n,t){for(e=null!=e?e:this.getDefaultParent(),e=this.model.getChildCells(e,null!=n&&n,null!=t&&t),n=[],t=0;t<e.length;t++)this.isCellVisible(e[t])&&n.push(e[t]);return n},mxGraph.prototype.getConnections=function(e,n){return this.getEdges(e,n,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(e,n){return this.getEdges(e,n,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(e,n){return this.getEdges(e,n,!1,!0,!1)},mxGraph.prototype.getEdges=function(e,n,t,a,i,s){t=null==t||t,a=null==a||a,i=null==i||i,s=null!=s&&s;for(var o=[],r=this.isCellCollapsed(e),l=this.model.getChildCount(e),d=0;d<l;d++){var c=this.model.getChildAt(e,d);!r&&this.isCellVisible(c)||(o=o.concat(this.model.getEdges(c,t,a)))}for(o=o.concat(this.model.getEdges(e,t,a)),r=[],d=0;d<o.length;d++)l=null!=(c=this.view.getState(o[d]))?c.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[d],!0),c=null!=c?c.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[d],!1),(i&&l==c||l!=c&&(t&&c==e&&(null==n||this.isValidAncestor(l,n,s))||a&&l==e&&(null==n||this.isValidAncestor(c,n,s))))&&r.push(o[d]);return r},mxGraph.prototype.isValidAncestor=function(e,n,t){return t?this.model.isAncestor(n,e):this.model.getParent(e)==n},mxGraph.prototype.getOpposites=function(e,n,t,a){t=null==t||t,a=null==a||a;var i=[],s={};if(null!=e)for(var o=0;o<e.length;o++){var r=null!=(l=this.view.getState(e[o]))?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(e[o],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(e[o],!1);if(r==n&&null!=l&&l!=n&&a){var d=mxCellPath.create(l);null==s[d]&&(s[d]=l,i.push(l))}else l==n&&null!=r&&r!=n&&t&&(null==s[d=mxCellPath.create(r)]&&(s[d]=r,i.push(r)))}return i},mxGraph.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=null!=(r=this.view.getState(a[s]))?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[s],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[s],!1);(o==e&&r==n||!t&&o==n&&r==e)&&i.push(a[s])}return i},mxGraph.prototype.getPointForEvent=function(e,n){var t=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a=this.view.scale,i=this.view.translate,s=0!=n?this.gridSize/2:0;return t.x=this.snap(t.x/a-i.x-s),t.y=this.snap(t.y/a-i.y-s),t},mxGraph.prototype.getCells=function(e,n,t,a,i,s){if(s=null!=s?s:[],0<t||0<a){var o=e+t,r=n+a;if(null!=(i=i||this.getDefaultParent()))for(var l=this.model.getChildCount(i),d=0;d<l;d++){var c=this.model.getChildAt(i,d),m=this.view.getState(c);if(this.isCellVisible(c)&&null!=m){var u=m;0!=(m=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION)||0)&&(u=mxUtils.getBoundingBox(u,m)),u.x>=e&&u.y+u.height<=r&&u.y>=n&&u.x+u.width<=o?s.push(c):this.getCells(e,n,t,a,c,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(e,n,t,a,i){var s=[];if((a||i)&&(null==t&&(t=this.getDefaultParent()),null!=t))for(var o=this.model.getChildCount(t),r=0;r<o;r++){var l=this.model.getChildAt(t,r),d=this.view.getState(l);this.isCellVisible(l)&&null!=d&&(!a||d.x>=e)&&(!i||d.y>=n)&&s.push(l)}return s},mxGraph.prototype.findTreeRoots=function(e,n,t){n=null!=n&&n,t=null!=t&&t;var a=[];if(null!=e){for(var i=this.getModel(),s=i.getChildCount(e),o=null,r=0,l=0;l<s;l++){var d=i.getChildAt(e,l);if(this.model.isVertex(d)&&this.isCellVisible(d)){for(var c=this.getConnections(d,n?e:null),m=0,u=0,p=0;p<c.length;p++)this.view.getVisibleTerminal(c[p],!0)==d?m++:u++;(t&&0==m&&0<u||!t&&0==u&&0<m)&&a.push(d),r<(c=t?u-m:m-u)&&(r=c,o=d)}}0==a.length&&null!=o&&a.push(o)}return a},mxGraph.prototype.traverse=function(e,n,t,a,i){if(null!=t&&null!=e){n=null==n||n,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=t(i[s]=e,a))||a)&&0<(a=this.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.model.getEdgeAt(e,s),r=this.model.getTerminal(o,!0)==e;n&&!r||(r=this.model.getTerminal(o,!r),this.traverse(r,n,t,o,i))}}},mxGraph.prototype.isCellSelected=function(e){return this.getSelectionModel().isSelected(e)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(e){this.getSelectionModel().setCell(e)},mxGraph.prototype.setSelectionCells=function(e){this.getSelectionModel().setCells(e)},mxGraph.prototype.addSelectionCell=function(e){this.getSelectionModel().addCell(e)},mxGraph.prototype.addSelectionCells=function(e){this.getSelectionModel().addCells(e)},mxGraph.prototype.removeSelectionCell=function(e){this.getSelectionModel().removeCell(e)},mxGraph.prototype.removeSelectionCells=function(e){this.getSelectionModel().removeCells(e)},mxGraph.prototype.selectRegion=function(e,n){var t=this.getCells(e.x,e.y,e.width,e.height);return this.selectCellsForEvent(t,n),t},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(e,n,t){var a=0<(i=this.selectionModel).cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var i=null!=a?this.model.getParent(a):this.getDefaultParent(),s=this.model.getChildCount(i);null==a&&0<s?(e=this.model.getChildAt(i,0),this.setSelectionCell(e)):null!=a&&!n||null==this.view.getState(i)||null==this.model.getGeometry(i)?null!=a&&t?0<this.model.getChildCount(a)&&(e=this.model.getChildAt(a,0),this.setSelectionCell(e)):0<s&&(n=i.getIndex(a),e=e?(n++,this.model.getChildAt(i,n%s)):(n--,this.model.getChildAt(i,n<0?s-1:n)),this.setSelectionCell(e)):this.getCurrentRoot()!=i&&this.setSelectionCell(i)},mxGraph.prototype.selectAll=function(e){e=e||this.getDefaultParent(),null!=(e=this.model.getChildren(e))&&this.setSelectionCells(e)},mxGraph.prototype.selectVertices=function(e){this.selectCells(!0,!1,e)},mxGraph.prototype.selectEdges=function(e){this.selectCells(!1,!0,e)},mxGraph.prototype.selectCells=function(n,t,e){e=e||this.getDefaultParent();var a=mxUtils.bind(this,function(e){return null!=this.view.getState(e)&&0==this.model.getChildCount(e)&&(this.model.isVertex(e)&&n||this.model.isEdge(e)&&t)});e=this.model.filterDescendants(a,e),this.setSelectionCells(e)},mxGraph.prototype.selectCellForEvent=function(e,n){var t=this.isCellSelected(e);this.isToggleEvent(n)?t?this.removeSelectionCell(e):this.addSelectionCell(e):(!t||1!=this.getSelectionCount())&&this.setSelectionCell(e)},mxGraph.prototype.selectCellsForEvent=function(e,n){this.isToggleEvent(n)?this.addSelectionCells(e):this.setSelectionCells(e)},mxGraph.prototype.createHandler=function(e){var n=null;return null!=e&&(n=this.model.isEdge(e.cell)?(n=this.view.getEdgeStyle(e),this.isLoop(e)||n==mxEdgeStyle.ElbowConnector||n==mxEdgeStyle.SideToSide||n==mxEdgeStyle.TopToBottom?new mxElbowEdgeHandler(e):n==mxEdgeStyle.SegmentConnector||n==mxEdgeStyle.OrthConnector?new mxEdgeSegmentHandler(e):new mxEdgeHandler(e)):new mxVertexHandler(e)),n},mxGraph.prototype.addMouseListener=function(e){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(e)},mxGraph.prototype.removeMouseListener=function(e){if(null!=this.mouseListeners)for(var n=0;n<this.mouseListeners.length;n++)if(this.mouseListeners[n]==e){this.mouseListeners.splice(n,1);break}},mxGraph.prototype.updateMouseEvent=function(e){if(null==e.graphX||null==e.graphY){var n=mxUtils.convertPoint(this.container,e.getX(),e.getY());e.graphX=n.x-this.panDx,e.graphY=n.y-this.panDy}},mxGraph.prototype.fireMouseEvent=function(e,n,t){if(null==t&&(t=this),this.updateMouseEvent(n),e==mxEvent.MOUSE_DOWN&&(this.isMouseDown=!0),mxClient.IS_TOUCH&&this.doubleTapEnabled&&e==mxEvent.MOUSE_DOWN){var a=(new Date).getTime();a-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-n.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-n.getY())<this.doubleTapTolerance?(this.lastTouchTime=0,this.dblClick(n.getEvent(),n.getCell()),n.getEvent().cancelBubble=!0):(this.lastTouchX=n.getX(),this.lastTouchY=n.getY(),this.lastTouchTime=a)}if(a=2!=n.getEvent().detail,mxClient.IS_IE&&"CSS1Compat"==document.compatMode&&((null!=this.lastMouseX&&Math.abs(this.lastMouseX-n.getX())>this.doubleTapTolerance||null!=this.lastMouseY&&Math.abs(this.lastMouseY-n.getY())>this.doubleTapTolerance)&&(a=!0),e==mxEvent.MOUSE_UP&&(this.lastMouseX=n.getX(),this.lastMouseY=n.getY())),(e!=mxEvent.MOUSE_UP||this.isMouseDown)&&a){if(e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1),!this.isEditing()&&(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE&&mxClient.IS_SVG||n.getEvent().target!=this.container)){if(e==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&this.scrollPointToVisible(n.getGraphX(),n.getGraphY(),this.autoExtend),null!=this.mouseListeners)for(t=[t,n],n.getEvent().returnValue=!0,a=0;a<this.mouseListeners.length;a++){var i=this.mouseListeners[a];e==mxEvent.MOUSE_DOWN?i.mouseDown.apply(i,t):e==mxEvent.MOUSE_MOVE?i.mouseMove.apply(i,t):e==mxEvent.MOUSE_UP&&i.mouseUp.apply(i,t)}e==mxEvent.MOUSE_UP&&this.click(n)}}else e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1)},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(e){var n=e.view.graph.getModel().isEdge(e.cell),t=e.view.scale,a=null,i=this.image.width,s=this.image.height;return n?a=1==(n=e.absolutePoints).length%2?n[Math.floor(n.length/2)]:(e=n[(a=n.length/2)-1],n=n[a],new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2)):((a=new mxPoint).x=this.align==mxConstants.ALIGN_LEFT?e.x:this.align==mxConstants.ALIGN_CENTER?e.x+e.width/2:e.x+e.width,a.y=this.verticalAlign==mxConstants.ALIGN_TOP?e.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?e.y+e.height/2:e.y+e.height),new mxRectangle(Math.round(a.x-(i*this.defaultOverlap-this.offset.x)*t),Math.round(a.y-(s*this.defaultOverlap-this.offset.y)*t),i*t,s*t)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.suspended=!1,mxOutline.prototype.init=function(e){this.outline=new mxGraph(e,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet()),this.outline.foldingEnabled=!1,this.outline.autoScroll=!1;var n=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(e){!this.suspended&&null!=this.outline&&n.apply(this.outline,arguments)}),mxClient.IS_SVG&&((e=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),e.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=!1,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(e,n){!this.suspended&&!this.active&&this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this),(e=this.source.getView()).addListener(mxEvent.SCALE,this.updateHandler),e.addListener(mxEvent.TRANSLATE,this.updateHandler),e.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),e.addListener(mxEvent.DOWN,this.updateHandler),e.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(e){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(e){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.init(this.outline.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.outline),this.selectionBorder.node.style.background="",this.sizer=this.createSizer(),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="pointer"),mxEvent.addListener(this.sizer.node,mxClient.IS_TOUCH?"touchstart":"mousedown",mxUtils.bind(this,function(e){this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(e){this.enabled=e},mxOutline.prototype.setZoomEnabled=function(e){this.sizer.node.style.visibility=e?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){var e=null!=this.sizerImage?new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src):new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);return e.dialect=this.outline.dialect,e},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(e){return null},mxOutline.prototype.update=function(e){if(null!=this.source){var n=this.source.view.scale,t=new mxRectangle((t=this.source.getGraphBounds()).x/n+this.source.panDx,t.y/n+this.source.panDy,t.width/n,t.height/n),a=new mxRectangle(0,0,this.source.container.clientWidth/n,this.source.container.clientHeight/n);(s=t.clone()).add(a);var i=this.getSourceContainerSize(),s=(a=Math.max(i.width/n,s.width),n=Math.max(i.height/n,s.height),Math.max(0,this.outline.container.clientWidth-this.border));i=Math.max(0,this.outline.container.clientHeight-this.border);if(0<(s=Math.min(s/a,i/n))){this.outline.getView().scale!=s&&(this.outline.getView().scale=s,e=!0),(a=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&a.setCurrentRoot(this.source.getView().currentRoot);i=(n=this.source.view.translate).x+this.source.panDx;var o=n.y+this.source.panDy;null!=(s=this.getOutlineOffset(s))&&(i+=s.x,o+=s.y),t.x<0&&(i-=t.x),t.y<0&&(o-=t.y),a.translate.x==i&&a.translate.y==o||(a.translate.x=i,a.translate.y=o,e=!0);t=a.translate,i=(s=this.source.getView().scale)/a.scale,o=1/a.scale;var r=this.source.container;this.bounds=new mxRectangle((t.x-n.x-this.source.panDx)/o,(t.y-n.y-this.source.panDy)/o,r.clientWidth/i,r.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*a.scale/s,this.bounds.y+=this.source.container.scrollTop*a.scale/s,(t=this.selectionBorder.bounds).x==this.bounds.x&&t.y==this.bounds.y&&t.width==this.bounds.width&&t.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),t=this.sizer.bounds,a=new mxRectangle(this.bounds.x+this.bounds.width-t.width/2,this.bounds.y+this.bounds.height-t.height/2,t.width,t.height),t.x==a.x&&t.y==a.y&&t.width==a.width&&t.height==a.height||(this.sizer.bounds=a,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),e&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(e,n){this.enabled&&this.showViewport&&(this.zoom=n.isSource(this.sizer),this.startX=n.getX(),this.startY=n.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):this.dy0=this.dx0=0),n.consume()},mxOutline.prototype.mouseMove=function(e,n){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var t=n.getX()-this.startX,a=n.getY()-this.startY,i=null;if(this.zoom)a=t/((i=this.source.container).clientWidth/i.clientHeight),i=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+t),Math.max(1,this.bounds.height+a)),this.selectionBorder.bounds=i,this.selectionBorder.redraw();else{var s=this.outline.getView().scale;i=new mxRectangle(this.bounds.x+t,this.bounds.y+a,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=i,this.selectionBorder.redraw(),t=t/s*this.source.getView().scale,a=a/s*this.source.getView().scale,this.source.panGraph(-t-this.dx0,-a-this.dy0)}t=this.sizer.bounds,this.sizer.bounds=new mxRectangle(i.x+i.width-t.width/2,i.y+i.height-t.height/2,t.width,t.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),n.consume()}},mxOutline.prototype.mouseUp=function(e,n){if(this.active){var t=n.getX()-this.startX,a=n.getY()-this.startY;if(0<Math.abs(t)||0<Math.abs(a)){if(this.zoom){a=this.selectionBorder.bounds.width;var i=this.source.getView().scale;this.source.zoomTo(i-t*i/a,!1)}else this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),t/=this.outline.getView().scale,a/=this.outline.getView().scale,i=this.source.getView().translate,this.source.getView().setTranslate(i.x-t,i.y-a));this.update(),n.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(e,n,t,a,i,s){var o="";return(this.source&&this.checkTerminal(e,t,n)||!this.source&&this.checkTerminal(e,a,n))&&(null!=this.countError&&(this.source&&(0==this.max||i>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(e,n,t,a)||(o+=this.typeError+"\n"))),0<o.length?o:null},mxMultiplicity.prototype.checkNeighbors=function(e,n,t,a){n=e.model.getValue(t),a=e.model.getValue(a),t=!this.validNeighborsAllowed;for(var i=this.validNeighbors,s=0;s<i.length;s++){if(this.source&&this.checkType(e,a,i[s])){t=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(e,n,i[s])){t=this.validNeighborsAllowed;break}}return t},mxMultiplicity.prototype.checkTerminal=function(e,n,t){return n=e.model.getValue(n),this.checkType(e,n,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(e,n,t,a,i){return null!=n&&(isNaN(n.nodeType)?n==t:mxUtils.isNode(n,t,a,i))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(e){this.enabled=e},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(e){this.bubbling=e},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(e){if(null!=this.graph){var n=this.graph.getModel();n.removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler)}this.graph=e,null!=this.graph&&((n=this.graph.getModel()).addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(e){return null},mxLayoutManager.prototype.beforeUndo=function(e){e=this.getCellsForChanges(e.changes);var n=this.getGraph().getModel();if(this.isBubbling())for(var t=n.getParents(e);0<t.length;)e=e.concat(t),t=n.getParents(t);this.layoutCells(mxUtils.sortCells(e,!1))},mxLayoutManager.prototype.cellsMoved=function(e,n){if(null!=e&&null!=n)for(var t=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(n),mxEvent.getClientY(n)),a=this.getGraph().getModel(),i=0;i<e.length;i++){var s=this.getLayout(a.getParent(e[i]));null!=s&&s.moveCell(e[i],t.x,t.y)}},mxLayoutManager.prototype.getCellsForChanges=function(e){for(var n=[],t={},a=0;a<e.length;a++){if((i=e[a])instanceof mxRootChange)return[];for(var i=this.getCellsForChange(i),s=0;s<i.length;s++)if(null!=i[s]){var o=mxCellPath.create(i[s]);null==t[o]&&(t[o]=i[s],n.push(i[s]))}}return n},mxLayoutManager.prototype.getCellsForChange=function(e){var n=this.getGraph().getModel();return e instanceof mxChildChange?[e.child,e.previous,n.getParent(e.child)]:e instanceof mxTerminalChange||e instanceof mxGeometryChange?[e.cell,n.getParent(e.cell)]:[]},mxLayoutManager.prototype.layoutCells=function(e){if(0<e.length){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=null,a=0;a<e.length;a++)e[a]!=n.getRoot()&&e[a]!=t&&(t=e[a],this.executeLayout(this.getLayout(t),t));this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",e))}finally{n.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(e,n){null!=e&&null!=n&&e.execute(n)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSpaceManager.prototype=new mxEventSource,mxSpaceManager.prototype.constructor=mxSpaceManager,mxSpaceManager.prototype.graph=null,mxSpaceManager.prototype.enabled=!0,mxSpaceManager.prototype.shiftRightwards=!0,mxSpaceManager.prototype.shiftDownwards=!0,mxSpaceManager.prototype.extendParents=!0,mxSpaceManager.prototype.resizeHandler=null,mxSpaceManager.prototype.foldHandler=null,mxSpaceManager.prototype.isCellIgnored=function(e){return!this.getGraph().getModel().isVertex(e)},mxSpaceManager.prototype.isCellShiftable=function(e){return this.getGraph().getModel().isVertex(e)&&this.getGraph().isCellMovable(e)},mxSpaceManager.prototype.isEnabled=function(){return this.enabled},mxSpaceManager.prototype.setEnabled=function(e){this.enabled=e},mxSpaceManager.prototype.isShiftRightwards=function(){return this.shiftRightwards},mxSpaceManager.prototype.setShiftRightwards=function(e){this.shiftRightwards=e},mxSpaceManager.prototype.isShiftDownwards=function(){return this.shiftDownwards},mxSpaceManager.prototype.setShiftDownwards=function(e){this.shiftDownwards=e},mxSpaceManager.prototype.isExtendParents=function(){return this.extendParents},mxSpaceManager.prototype.setExtendParents=function(e){this.extendParents=e},mxSpaceManager.prototype.getGraph=function(){return this.graph},mxSpaceManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.resizeHandler),this.graph.removeListener(this.foldHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler),this.graph.addListener(mxEvent.FOLD_CELLS,this.foldHandler))},mxSpaceManager.prototype.cellsResized=function(e){if(null!=e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)if(!this.isCellIgnored(e[t])){this.cellResized(e[t]);break}}finally{n.endUpdate()}}},mxSpaceManager.prototype.cellResized=function(e){var n=this.getGraph(),t=n.getView(),a=n.getModel(),i=t.getState(e),s=t.getState(a.getParent(e));if(null!=i&&null!=s){var o=this.getCellsToShift(i),r=a.getGeometry(e);if(null!=o&&null!=r){var l=t.translate,d=t.scale,c=(t=i.x-s.origin.x-l.x*d,s=i.y-s.origin.y-l.y*d,l=i.x+i.width,i.y+i.height),m=i.width-r.width*d+t-r.x*d,u=i.height-r.height*d+s-r.y*d,p=1-r.width*d/i.width;i=1-r.height*d/i.height;a.beginUpdate();try{for(r=0;r<o.length;r++)o[r]!=e&&this.isCellShiftable(o[r])&&this.shiftCell(o[r],m,u,t,s,l,c,p,i,this.isExtendParents()&&n.isExtendParent(o[r]))}finally{a.endUpdate()}}}},mxSpaceManager.prototype.shiftCell=function(e,n,t,a,i,s,o,r,l,d){var c=(a=this.getGraph()).getView().getState(e);if(null!=c){var m=a.getModel();if(null!=(p=m.getGeometry(e))){m.beginUpdate();try{if(this.isShiftRightwards())if(c.x>=s)(p=p.clone()).translate(-n,0);else{var u=Math.max(0,c.x-x0);(p=p.clone()).translate(-r*u,0)}if(this.isShiftDownwards())if(c.y>=o)(p=p.clone()).translate(0,-t);else{var p,g=Math.max(0,c.y-i);(p=p.clone()).translate(0,-l*g)}p!=m.getGeometry(e)&&(m.setGeometry(e,p),d&&a.extendParent(e))}finally{m.endUpdate()}}}},mxSpaceManager.prototype.getCellsToShift=function(e){var n=this.getGraph(),t=n.getModel().getParent(e.cell),a=this.isShiftDownwards(),i=this.isShiftRightwards();return n.getCellsBeyond(e.x+(a?0:e.width),e.y+(a&&i?0:e.height),t,i,a)},mxSpaceManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(e){this.enabled=e},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(e){this.horizontal=e},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(e){this.addEnabled=e},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(e){this.resizeEnabled=e},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(e){return!this.getGraph().isSwimlane(e)},mxSwimlaneManager.prototype.isCellHorizontal=function(e){if(this.graph.isSwimlane(e)){var n=this.graph.view.getState(e);return e=null!=n?n.style:this.graph.getCellStyle(e),1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(e){if(null!=e){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)this.isSwimlaneIgnored(e[t])||this.swimlaneAdded(e[t])}finally{n.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(e){for(var n=this.getGraph().getModel(),t=n.getParent(e),a=n.getChildCount(t),i=null,s=0;s<a;s++){var o=n.getChildAt(t,s);if(o!=e&&!this.isSwimlaneIgnored(o)&&null!=(i=n.getGeometry(o)))break}null!=i&&this.resizeSwimlane(e,i.width,i.height)},mxSwimlaneManager.prototype.cellsResized=function(e){if(null!=e){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)if(!this.isSwimlaneIgnored(e[t])){var a=n.getGeometry(e[t]);if(null!=a){for(var i=new mxRectangle(0,0,a.width,a.height),s=o=e[t];null!=s;){var o=s,r=(s=n.getParent(s),this.graph.isSwimlane(s)?this.graph.getStartSize(s):new mxRectangle);i.width+=r.width,i.height+=r.height}this.resizeSwimlane(o,i.width,i.height)}}}finally{n.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(e,n,t){var a=this.getGraph().getModel();a.beginUpdate();try{if(!this.isSwimlaneIgnored(e))if(null!=(r=a.getGeometry(e))){var i=this.isCellHorizontal(e);(i&&r.height!=t||!i&&r.width!=n)&&(r=r.clone(),i?r.height=t:r.width=n,a.setGeometry(e,r))}var s=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;n-=s.width,t-=s.height;for(var o=a.getChildCount(e),r=0;r<o;r++){var l=a.getChildAt(e,r);this.resizeSwimlane(l,n,t)}}finally{a.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds)},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(e,n,t,a,i){a=null==a||a,i=null==i||i;var s=mxCellPath.create(e.cell),o=this.deltas[s];return null==o?(o=new mxPoint(n,t),this.deltas[s]=o,this.count++):a?(o.X+=n,o.Y+=t):(o.X=n,o.Y=t),i&&this.addEdges(e),o},mxCellStatePreview.prototype.show=function(e){var n,t=this.graph.getModel(),a=t.getRoot();for(n in this.deltas){var i=mxCellPath.resolve(a,n),s=this.graph.view.getState(i),o=this.deltas[n];i=this.graph.view.getState(t.getParent(i));this.translateState(i,s,o.x,o.y)}for(n in this.deltas)i=mxCellPath.resolve(a,n),s=this.graph.view.getState(i),o=this.deltas[n],i=this.graph.view.getState(t.getParent(i)),this.revalidateState(i,s,o.x,o.y,e)},mxCellStatePreview.prototype.translateState=function(e,n,t,a){if(null!=n){var i=this.graph.getModel();if(i.isVertex(n.cell)){n.invalid=!0,this.graph.view.validateBounds(e,n.cell),e=i.getGeometry(n.cell);var s=mxCellPath.create(n.cell);0==t&&0==a||null==e||e.relative&&null==this.deltas[s]||(n.x+=t,n.y+=a)}for(e=i.getChildCount(n.cell),s=0;s<e;s++)this.translateState(n,this.graph.view.getState(i.getChildAt(n.cell,s)),t,a)}},mxCellStatePreview.prototype.revalidateState=function(e,n,t,a,i){if(null!=n){n.invalid=!0,this.graph.view.validatePoints(e,n.cell);var s=mxCellPath.create(n.cell),o=this.graph.getModel(),r=this.graph.getCellGeometry(n.cell);for(0==t&&0==a||null==r||!r.relative||!o.isVertex(n.cell)||null!=e&&!o.isVertex(e.cell)&&null==this.deltas[s]||(n.x+=t,n.y+=a,this.graph.cellRenderer.redraw(n)),null!=i&&i(n),e=o.getChildCount(n.cell),s=0;s<e;s++)this.revalidateState(n,this.graph.view.getState(o.getChildAt(n.cell,s)),t,a,i)}},mxCellStatePreview.prototype.addEdges=function(e){for(var n=this.graph.getModel(),t=n.getEdgeCount(e.cell),a=0;a<t;a++){var i=this.graph.view.getState(n.getEdgeAt(e.cell,a));null!=i&&this.moveState(i,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(e){this.enabled=e},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(e){this.cloneEnabled=e},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(e){this.moveEnabled=e},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(e){this.selectEnabled=e},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(e){this.removeCellsFromParent=e},mxGraphHandler.prototype.getInitialCellForEvent=function(e){return e.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(e){return this.graph.isCellSelected(e)},mxGraphHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&null!=n.getState()){var t=this.getInitialCellForEvent(n);if(this.cell=null,this.delayedSelection=this.isDelayedSelection(t),this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(t,n.getEvent()),this.isMoveEnabled()){var a=this.graph.model,i=a.getGeometry(t);this.graph.isCellMovable(t)&&(!a.isEdge(t)||1<this.graph.getSelectionCount()||null!=i.points&&0<i.points.length||null==a.getTerminal(t,!0)||null==a.getTerminal(t,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(n.getEvent())&&this.graph.isCellsCloneable())&&this.start(t,n.getX(),n.getY()),this.cellWasClicked=!0,!mxClient.IS_SF&&!mxClient.IS_GC||"SELECT"!=n.getSource().nodeName?n.consume():mxClient.IS_SF&&"SELECT"==n.getSource().nodeName&&(this.cellWasClicked=!1,this.first=null)}}},mxGraphHandler.prototype.getGuideStates=function(){var e=this.graph.getDefaultParent(),n=this.graph.getModel(),t=mxUtils.bind(this,function(e){return null!=this.graph.view.getState(e)&&n.isVertex(e)&&null!=n.getGeometry(e)&&!n.getGeometry(e).relative});return this.graph.view.getCellStates(n.filterDescendants(t,e))},mxGraphHandler.prototype.getCells=function(e){return!this.delayedSelection&&this.graph.isCellMovable(e)?[e]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(e){return null!=(e=this.getBoundingBox(e))&&(e.grow(-1,-1),e.width<this.minimumSize&&(e.x-=(this.minimumSize-e.width)/2,e.width=this.minimumSize),e.height<this.minimumSize&&(e.y-=(this.minimumSize-e.height)/2,e.height=this.minimumSize)),e},mxGraphHandler.prototype.getBoundingBox=function(e){var n=null;if(null!=e&&0<e.length)for(var t=this.graph.getModel(),a=0;a<e.length;a++)if(t.isVertex(e[a])||t.isEdge(e[a])){var i=this.graph.view.getState(e[a]);if(null!=i){var s=i;t.isVertex(e[a])&&null!=i.shape&&null!=i.shape.boundingBox&&(s=i.shape.boundingBox),null==n?n=new mxRectangle(s.x,s.y,s.width,s.height):n.add(s)}}return n},mxGraphHandler.prototype.createPreviewShape=function(e){return(e=new mxRectangleShape(e,null,this.previewColor)).isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1),e},mxGraphHandler.prototype.start=function(e,n,t){this.cell=e,this.first=mxUtils.convertPoint(this.graph.container,n,t),this.cells=this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))},mxGraphHandler.prototype.useGuidesForEvent=function(e){return null==this.guide||this.guide.isEnabledForEvent(e.getEvent())},mxGraphHandler.prototype.snap=function(e){var n=this.scaleGrid?this.graph.view.scale:1;return e.x=this.graph.snap(e.x/n)*n,e.y=this.graph.snap(e.y/n)*n,e},mxGraphHandler.prototype.mouseMove=function(e,n){var t=this.graph;if(!n.isConsumed()&&t.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){var a=(s=mxUtils.convertPoint(t.container,n.getX(),n.getY())).x-this.first.x,i=s.y-this.first.y,s=t.tolerance;if(null!=this.shape||Math.abs(a)>s||Math.abs(i)>s){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var o=t.isGridEnabledEvent(n.getEvent());s=!0;if(null!=this.guide&&this.useGuidesForEvent(n))s=!1,a=(i=this.guide.move(this.bounds,new mxPoint(a,i),o)).x,i=i.y;else if(o){var r=t.getView().translate,l=t.getView().scale;o=this.bounds.x-(t.snap(this.bounds.x/l-r.x)+r.x)*l,r=this.bounds.y-(t.snap(this.bounds.y/l-r.y)+r.y)*l,a=(i=this.snap(new mxPoint(a,i))).x-o,i=i.y-r}for(null!=this.guide&&s&&this.guide.hide(),t.isConstrainedEvent(n.getEvent())&&(Math.abs(a)>Math.abs(i)?i=0:a=0),this.currentDx=a,this.currentDy=i,this.updatePreviewShape(),s=null,i=n.getCell(),t.isDropEnabled()&&this.highlightEnabled&&(s=t.getDropTarget(this.cells,n.getEvent(),i)),o=s,r=t.getModel();null!=o&&o!=this.cells[0];)o=r.getParent(o);l=t.isCloneEvent(n.getEvent())&&t.isCellsCloneable()&&this.isCloneEnabled();var d=!1;null==(a=t.getView().getState(s))||null!=o||r.getParent(this.cell)==s&&!l?(this.target=null,this.connectOnDrop&&null!=i&&1==this.cells.length&&t.getModel().isVertex(i)&&t.isCellConnectable(i)&&(null!=(a=t.getView().getState(i))&&(t=null==t.getEdgeValidationError(null,this.cell,i)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(t),d=!0))):(this.target!=s&&(this.target=s,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0),null!=a&&d?this.highlight.highlight(a):this.highlight.hide()}n.consume(),mxEvent.consume(n.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||n.isConsumed()||null==n.getState()||t.isMouseDown||(null==(a=t.getCursorForCell(n.getCell()))&&t.isEnabled()&&t.isCellMovable(n.getCell())&&(a=t.getModel().isEdge(n.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),n.getState().setCursor(a),n.consume())},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(e){null!=this.highlight&&this.highlight.setHighlightColor(e)},mxGraphHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()){var t=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var a=t.getView().scale,i=t.isCloneEvent(n.getEvent())&&t.isCellsCloneable()&&this.isCloneEnabled(),s=this.currentDx/a,o=(a=this.currentDy/a,n.getCell());this.connectOnDrop&&null==this.target&&null!=o&&t.getModel().isVertex(o)&&t.isCellConnectable(o)&&t.isEdgeValid(null,this.cell,o)?t.connectionHandler.connect(this.cell,o,n.getEvent()):(o=this.target,t.isSplitEnabled()&&t.isSplitTarget(o,this.cells,n.getEvent())?t.splitEdge(o,this.cells,null,s,a):this.moveCells(this.cells,s,a,i,this.target,n.getEvent()))}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(n)}this.cellWasClicked&&n.consume(),this.reset()},mxGraphHandler.prototype.selectDelayed=function(e){this.graph.selectCellForEvent(this.cell,e.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.delayedSelection=this.cellWasClicked=!1,this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,n,t){if(this.graph.getModel().isVertex(e)){if(e=this.graph.getView().getState(e),t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),0!=(a=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))){n=Math.cos(-a);var a=Math.sin(-a),i=new mxPoint(e.getCenterX(),e.getCenterY());t=mxUtils.getRotatedPoint(t,n,a,i)}return null!=e&&!mxUtils.contains(e,t.x,t.y)}return!1},mxGraphHandler.prototype.moveCells=function(e,n,t,a,i,s){a&&(e=this.graph.getCloneableCells(e)),null==i&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),e,s)&&(i=this.graph.getDefaultParent()),e=this.graph.moveCells(e,n-this.graph.panDx/this.graph.view.scale,t-this.graph.panDy/this.graph.view.scale,a,i,s),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(e[0]),a&&this.graph.setSelectionCells(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.destroyShapes()},mxPanningHandler.prototype=new mxPopupMenu,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.triggerX=null,mxPanningHandler.prototype.triggerY=null,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.selectOnPopup=!0,mxPanningHandler.prototype.clearSelectionOnBackground=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(e){this.panningEnabled=e},mxPanningHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addListener(this.div,mxClient.IS_TOUCH?"touchmove":"mousemove",mxUtils.bind(this,function(e){this.graph.tooltipHandler.hide()}))},mxPanningHandler.prototype.isPanningTrigger=function(e){var n=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())&&mxEvent.isLeftMouseButton(n)||mxEvent.isControlDown(n)&&mxEvent.isShiftDown(n)||this.usePopupTrigger&&mxEvent.isPopupTrigger(n)},mxPanningHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()){this.hideMenu(),this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop;var t=mxUtils.convertPoint(this.graph.container,n.getX(),n.getY());this.triggerX=t.x,this.triggerY=t.y,this.popupTrigger=this.isPopupTrigger(n),this.panningTrigger=this.isPanningEnabled()&&this.isPanningTrigger(n),this.startX=n.getX(),this.startY=n.getY(),this.panningTrigger&&this.consumePanningTrigger(n)}},mxPanningHandler.prototype.consumePanningTrigger=function(e){e.consume()},mxPanningHandler.prototype.mouseMove=function(e,n){var t=n.getX()-this.startX,a=n.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(t=this.graph.snap(t),a=this.graph.snap(a)),this.graph.panGraph(t+this.dx0,a+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",n)),n.consume();else if(this.panningTrigger){var i=this.active;this.active=Math.abs(t)>this.graph.tolerance||Math.abs(a)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",n))}},mxPanningHandler.prototype.mouseUp=function(e,n){var t=Math.abs(n.getX()-this.startX),a=Math.abs(n.getY()-this.startY);if(this.active){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){t=n.getX()-this.startX,a=n.getY()-this.startY,this.useGrid&&(t=this.graph.snap(t),a=this.graph.snap(a));var i=this.graph.getView().scale,s=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(s.x+t/i,s.y+a/i)}this.active=!1,this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",n)),n.consume()}else this.popupTrigger&&t<this.graph.tolerance&&a<this.graph.tolerance&&(t=this.getCellForPopupEvent(n),this.graph.isEnabled()&&this.selectOnPopup&&null!=t&&!this.graph.isCellSelected(t)?this.graph.setSelectionCell(t):this.clearSelectionOnBackground&&null==t&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),a=mxUtils.getScrollOrigin(),a=new mxPoint(n.getX()+a.x,n.getY()+a.y),this.popup(a.x+1,a.y+1,t,n.getEvent()),n.consume());this.popupTrigger=this.panningTrigger=!1},mxPanningHandler.prototype.getCellForPopupEvent=function(e){return e.getCell()},mxPanningHandler.prototype.panGraph=function(e,n){this.graph.getView().setTranslate(e,n)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(e){this.enabled=e},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(e){this.hotspot=e},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(e){this.hotspotEnabled=e},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(e){var n=null;if(this.isEnabled()){var t=null!=(n=this.getState(e))&&this.isValidState(n);e=this.getMarkerColor(e.getEvent(),n,t),this.validState=t?n:null,n==this.markedState&&e==this.currentColor||(this.currentColor=e,null!=n&&null!=this.currentColor?(this.markedState=n,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))}return n},mxCellMarker.prototype.markCell=function(e,n){var t=this.graph.getView().getState(e);null!=t&&(this.currentColor=null!=n?n:this.validColor,this.markedState=t,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(e){return!0},mxCellMarker.prototype.getMarkerColor=function(e,n,t){return t?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(e){var n=this.graph.getView();return cell=this.getCell(e),null!=(n=this.getStateToMark(n.getState(cell)))&&this.intersects(n,e)?n:null},mxCellMarker.prototype.getCell=function(e){return e.getCell()},mxCellMarker.prototype.getStateToMark=function(e){return e},mxCellMarker.prototype.intersects=function(e,n){return!this.hotspotEnabled||mxUtils.intersectsHotspot(e,n.getGraphX(),n.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(e){this.enabled=e},mxSelectionCellsHandler.prototype.getHandler=function(e){return this.handlers.get(e)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(e,n){n.reset.apply(n)})},mxSelectionCellsHandler.prototype.refresh=function(){var e=this.handlers;this.handlers=new mxDictionary;for(var n=this.graph.getSelectionCells(),t=0;t<n.length;t++){var a=this.graph.view.getState(n[t]);if(null!=a){var i=e.remove(n[t]);null!=i&&(i.state!=a?(i.destroy(),i=null):i.redraw()),null==i&&(i=this.graph.createHandler(a),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",a))),null!=i&&this.handlers.put(n[t],i)}}e.visit(mxUtils.bind(this,function(e,n){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",n.state)),n.destroy()}))},mxSelectionCellsHandler.prototype.mouseDown=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseDown.apply(n,t)})}},mxSelectionCellsHandler.prototype.mouseMove=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseMove.apply(n,t)})}},mxSelectionCellsHandler.prototype.mouseUp=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseUp.apply(n,t)})}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.tapAndHoldEnabled=!0,mxConnectionHandler.prototype.tapAndHoldDelay=500,mxConnectionHandler.prototype.tapAndHoldInProgress=!1,mxConnectionHandler.prototype.tapAndHoldValid=!1,mxConnectionHandler.prototype.tapAndHoldTolerance=4,mxConnectionHandler.prototype.initialTouchX=0,mxConnectionHandler.prototype.initialTouchY=0,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(e){this.enabled=e},mxConnectionHandler.prototype.isCreateTarget=function(){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(e){this.createTarget=e},mxConnectionHandler.prototype.createShape=function(){var e=new mxPolyline([],mxConstants.INVALID_COLOR);if(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=!0,this.graph.dialect==mxConstants.DIALECT_SVG)e.node.setAttribute("pointer-events","none");else{var n=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(e.node,this.graph,n)}return e},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(e){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?this.redrawIcons(this.icons,this.iconState):(this.destroyIcons(this.icons),this.previous=null),this.constraintHandler.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(e){this.destroyIcons(this.icons)}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(e){return!0},mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);return a.hotspotEnabled=!0,a.getCell=mxUtils.bind(this,function(e,n){return n=mxCellMarker.prototype.getCell.apply(a,arguments),this.error=null,this.isConnectableCell(n)?(null!=n?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,n),null!=this.error&&0==this.error.length&&(n=null,this.isCreateTarget()&&(this.error=null))):this.isValidSource(n)||(n=null):this.isConnecting()&&!this.isCreateTarget()&&!this.graph.allowDanglingEdges&&(this.error=""),n):null}),a.isValidState=mxUtils.bind(this,function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)}),a.getMarkerColor=mxUtils.bind(this,function(e,n,t){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null}),a.intersects=mxUtils.bind(this,function(e,n){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(a,arguments)}),a},mxConnectionHandler.prototype.start=function(e,n,t,a){this.previous=e,this.first=new mxPoint(n,t),this.edgeState=null!=a?a:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=e,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(e){return this.graph.isValidSource(e)},mxConnectionHandler.prototype.isValidTarget=function(e){return!0},mxConnectionHandler.prototype.validateConnection=function(e,n){return this.isValidTarget(n)?this.graph.getEdgeValidationError(null,e,n):""},mxConnectionHandler.prototype.getConnectImage=function(e){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(e){return null!=e.text&&e.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(e){if(null==(i=this.getConnectImage(e))||null==e)return null;this.iconState=e;var n=[],t=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src,null,null,0);t.preserveImageAspect=!1,this.isMoveIconToFrontForState(e)?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(t.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,t.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=t.node.previousSibling&&t.node.parentNode.insertBefore(t.node,t.node.parentNode.firstChild)),t.node.style.cursor=mxConstants.CURSOR_CONNECT;var a=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:e}),i=mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(this.icon=t,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,a())))});return mxEvent.redirectMouseEvents(t.node,this.graph,a,i),n.push(t),this.redrawIcons(n,this.iconState),n},mxConnectionHandler.prototype.redrawIcons=function(e,n){if(null!=e&&null!=e[0]&&null!=n){var t=this.getIconPosition(e[0],n);e[0].bounds.x=t.x,e[0].bounds.y=t.y,e[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(e,n){var t=this.graph.getView().scale,a=n.getCenterX(),i=n.getCenterY();if(this.graph.isSwimlane(n.cell)){a=0!=(s=this.graph.getStartSize(n.cell)).width?n.x+s.width*t/2:a,i=0!=s.height?n.y+s.height*t/2:i;if(0!=(s=mxUtils.toRadians(mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION)||0))){t=Math.cos(s);var s=Math.sin(s),o=new mxPoint(n.getCenterX(),n.getCenterY());a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),t,s,o)).x,i=i.y}}return new mxPoint(a-e.bounds.width/2,i-e.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(e){if(null!=e){this.iconState=null;for(var n=0;n<e.length;n++)e[n].destroy()}},mxConnectionHandler.prototype.isStartEvent=function(e){return!this.graph.isForceMarqueeEvent(e.getEvent())&&(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon))},mxConnectionHandler.prototype.mouseDown=function(e,n){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!n.isConsumed()&&!this.isConnecting()&&this.isStartEvent(n)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(n.getGraphX(),n.getGraphY()),this.edgeState=this.createEdgeState(n),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape()),null==this.previous&&null!=this.edgeState){var t=this.graph.getPointForEvent(n.getEvent());this.edgeState.cell.geometry.setTerminalPoint(t,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),n.consume()}else if(mxClient.IS_TOUCH&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress&&this.isEnabled()&&this.graph.isEnabled()&&!this.isConnecting()){this.tapAndHoldInProgress=!0,this.initialTouchX=n.getX(),this.initialTouchY=n.getY();var a=this.graph.view.getState(this.marker.getCell(n));this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(n,a),this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.tapAndHold=function(e,n){null!=n&&(this.marker.currentColor=this.marker.validColor,this.marker.markedState=n,this.marker.mark(),this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.previous=n,this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)))},mxConnectionHandler.prototype.isImmediateConnectSource=function(e){return!this.graph.isCellMovable(e.cell)},mxConnectionHandler.prototype.createEdgeState=function(e){return null},mxConnectionHandler.prototype.updateCurrentState=function(e){var n=this.marker.process(e);this.constraintHandler.update(e,null==this.first),this.currentState=n},mxConnectionHandler.prototype.convertWaypoint=function(e){var n=this.graph.getView().getScale(),t=this.graph.getView().getTranslate();e.x=e.x/n-t.x,e.y=e.y/n-t.y},mxConnectionHandler.prototype.mouseMove=function(e,n){if(this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-n.getX())<this.tapAndHoldTolerance&&Math.abs(this.initialTouchY-n.getY())<this.tapAndHoldTolerance),n.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{if(!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(this.icons),this.currentState=null),(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(n),null!=this.first){var t=this.graph.getView().scale,a=null,i=t=new mxPoint(this.graph.snap(n.getGraphX()/t)*t,this.graph.snap(n.getGraphY()/t)*t);null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint&&(a=this.constraintHandler.currentConstraint,i=this.constraintHandler.currentPoint.clone());var s=this.first;if(null!=this.selectedIcon){var o=this.selectedIcon.bounds.width,r=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(o=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=o.x,this.selectedIcon.bounds.y=o.y):(o=new mxRectangle(n.getGraphX()+this.connectIconOffset.x,n.getGraphY()+this.connectIconOffset.y,o,r),this.selectedIcon.bounds=o),this.selectedIcon.redraw()}if(null!=this.edgeState){if(this.edgeState.absolutePoints=[null,null!=this.currentState?null:i],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==a&&(a=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,a)),(s=null)!=this.waypoints)for(s=[],i=0;i<this.waypoints.length;i++)a=this.waypoints[i].clone(),this.convertWaypoint(a),s[i]=a;this.graph.view.updatePoints(this.edgeState,s,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState),i=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],s=this.edgeState.absolutePoints[0]}else null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(null!=(o=this.getTargetPerimeterPoint(this.currentState,n))&&(i=o)),null==this.sourceConstraint&&null!=this.previous&&(null!=(o=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:i,n))&&(s=o));if(null==this.currentState&&this.movePreviewAway){if(o=s,null!=this.edgeState&&2<this.edgeState.absolutePoints.length&&(null!=(a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(o=a)),a=i.x-o.x,o=i.y-o.y,0==(r=Math.sqrt(a*a+o*o)))return;i.x-=4*a/r,i.y-=4*o/r}null==this.shape&&(a=Math.abs(t.x-this.first.x),o=Math.abs(t.y-this.first.y),a>this.graph.tolerance||o>this.graph.tolerance)&&(this.shape=this.createShape(),this.updateCurrentState(n)),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(t=[s],null!=this.waypoints&&(t=t.concat(this.waypoints)),t.push(i),this.shape.points=t),this.drawPreview()),mxEvent.consume(n.getEvent()),n.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(this.icons),(this.icons=null)!=this.currentState&&null==this.error&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),n.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&null==this.icons&&!this.graph.isMouseDown&&n.consume():this.constraintHandler.reset();if(null!=this.constraintHandler.currentConstraint&&this.marker.reset(),!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(t=!1,s=n.getSource(),i=0;i<this.icons.length&&!t;i++)t=s==this.icons[i].node||s.parentNode==this.icons[i].node;t||this.updateIcons(this.currentState,this.icons,n)}}},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(e,n){var t=null,a=(i=e.view).getPerimeterFunction(e);if(null!=a){var i,s=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());null!=(i=a(i.getPerimeterBounds(e),this.edgeState,s,!1))&&(t=i)}else t=new mxPoint(e.getCenterX(),e.getCenterY());return t},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(e,n,t){t=null;var a=e.view,i=a.getPerimeterFunction(e),s=new mxPoint(e.getCenterX(),e.getCenterY());if(null!=i){var o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0),r=-o*(Math.PI/180);0!=o&&(n=mxUtils.getRotatedPoint(new mxPoint(n.x,n.y),Math.cos(r),Math.sin(r),s)),null!=(e=i(a.getPerimeterBounds(e),e,n,!1))&&(0!=o&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-r),Math.sin(-r),s)),t=e)}else t=s;return t},mxConnectionHandler.prototype.updateIcons=function(e,n,t){},mxConnectionHandler.prototype.isStopEvent=function(e){return null!=e.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(e){var n=mxUtils.convertPoint(this.graph.container,e.getX(),e.getY()),t=Math.abs(n.x-this.first.x);n=Math.abs(n.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(t>this.graph.tolerance||n>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),t=this.graph.view.scale,n=new mxPoint(this.graph.snap(e.getGraphX()/t)*t,this.graph.snap(e.getGraphY()/t)*t),this.waypoints.push(n))},mxConnectionHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(n))return this.addWaypointForEvent(n),void n.consume();if(null==this.error){var t=null!=this.previous?this.previous.cell:null,a=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),this.connect(t,a,n.getEvent(),n.getCell())}else null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons(this.icons),n.consume()}null!=this.first&&this.reset(),this.tapAndHoldValid=this.tapAndHoldInProgress=!1},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),this.destroyIcons(this.icons),this.icons=null,this.marker.reset(),this.constraintHandler.reset(),this.sourceConstraint=this.error=this.previous=this.edgeState=this.selectedIcon=null,this.mouseDownCounter=0,this.icon=this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){var e=null==this.error;this.shape.strokewidth=this.getEdgeWidth(e),e=this.getEdgeColor(e),this.shape.stroke=e,this.shape.redraw()},mxConnectionHandler.prototype.getEdgeColor=function(e){return e?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(e){return e?3:1},mxConnectionHandler.prototype.connect=function(e,n,t,a){if(null!=n||this.isCreateTarget()||this.graph.allowDanglingEdges){var i=this.graph.getModel(),s=null;i.beginUpdate();try{if(null!=e&&null==n&&this.isCreateTarget()&&null!=(n=this.createTargetVertex(t,e))){if(null!=(a=this.graph.getDropTarget([n],t,a))&&this.graph.getModel().isEdge(a))a=this.graph.getDefaultParent();else{var o=this.graph.getView().getState(a);if(null!=o){var r=i.getGeometry(n);r.x-=o.origin.x,r.y-=o.origin.y}}this.graph.addCell(n,a)}var l=this.graph.getDefaultParent();if(null!=e&&null!=n&&i.getParent(e)==i.getParent(n)&&i.getParent(i.getParent(e))!=i.getRoot()&&(l=i.getParent(e),null!=e.geometry&&e.geometry.relative&&null!=n.geometry&&n.geometry.relative&&(l=i.getParent(l))),r=o=null,null!=this.edgeState&&(o=this.edgeState.cell.value,r=this.edgeState.cell.style),null!=(s=this.insertEdge(l,null,o,e,n,r))){this.graph.setConnectionConstraint(s,e,!0,this.sourceConstraint),this.graph.setConnectionConstraint(s,n,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&i.setGeometry(s,this.edgeState.cell.geometry);var d=i.getGeometry(s);if(null==d&&((d=new mxGeometry).relative=!0,i.setGeometry(s,d)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,m=this.graph.view.translate;for(d.points=[],e=0;e<this.waypoints.length;e++){var u=this.waypoints[e];d.points.push(new mxPoint(u.x/c-m.x,u.y/c-m.y))}}null==n&&((u=this.graph.getPointForEvent(t,!1)).x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,d.setTerminalPoint(u,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",s,"event",t,"target",a))}}catch(e){mxLog.show(),mxLog.debug(e.message)}finally{i.endUpdate()}this.select&&this.selectCells(s,n)}},mxConnectionHandler.prototype.selectCells=function(e,n){this.graph.setSelectionCell(e)},mxConnectionHandler.prototype.insertEdge=function(e,n,t,a,i,s){return null==this.factoryMethod?this.graph.insertEdge(e,n,t,a,i,s):(n=this.createEdge(t,a,i,s),this.graph.addEdge(n,e,a,i))},mxConnectionHandler.prototype.createTargetVertex=function(e,n){for(var t=this.graph.getCellGeometry(n);null!=t&&t.relative;)n=this.graph.getModel().getParent(n),t=this.graph.getCellGeometry(n);var a=this.graph.cloneCells([n])[0];if(null!=(t=this.graph.getModel().getGeometry(a))){var i=this.graph.getPointForEvent(e);if(t.x=this.graph.snap(i.x-t.width/2)-this.graph.panDx/this.graph.view.scale,t.y=this.graph.snap(i.y-t.height/2)-this.graph.panDy/this.graph.view.scale,null!=this.first){var s=this.graph.view.getState(n);if(null!=s){var o=this.getAlignmentTolerance();Math.abs(this.graph.snap(this.first.x)-this.graph.snap(i.x))<=o?t.x=s.x:Math.abs(this.graph.snap(this.first.y)-this.graph.snap(i.y))<=o&&(t.y=s.y)}}}return a},mxConnectionHandler.prototype.getAlignmentTolerance=function(){return this.graph.isGridEnabled()?this.graph.gridSize:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(e,n,t,a){var i=null;return null!=this.factoryMethod&&(i=this.factoryMethod(n,t,a)),null==i&&((i=new mxCell(e||"")).setEdge(!0),i.setStyle(a),(e=new mxGeometry).relative=!0,i.setGeometry(e)),i},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(e){this.enabled=e},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var e=0;e<this.focusIcons.length;e++)this.focusIcons[e].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null},mxConstraintHandler.prototype.getTolerance=function(){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(e,n,t){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(e,n){return!1},mxConstraintHandler.prototype.update=function(e,n){if(this.isEnabled()&&!this.isEventIgnored(e)){var t=this.getTolerance(),a=new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t),i=null!=e.getCell()&&this.graph.isCellConnectable(e.getCell());if((null==this.currentFocusArea||!mxUtils.intersects(this.currentFocusArea,a)||null!=e.getState()&&null!=this.currentFocus&&i)&&(this.currentFocusArea=null,e.getState()!=this.currentFocus))if(this.currentFocus=null,this.constraints=null!=e.getState()&&i?this.graph.getAllConnectionConstraints(e.getState(),n):null,null!=this.constraints){if(this.currentFocus=e.getState(),this.currentFocusArea=new mxRectangle(e.getState().x,e.getState().y,e.getState().width,e.getState().height),null!=this.focusIcons){for(i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}for(this.focusIcons=[],this.focusPoints=[],i=0;i<this.constraints.length;i++){var s,o=this.graph.getConnectionPoint(e.getState(),this.constraints[i]),r=(s=this.getImageForConstraint(e.getState(),this.constraints[i],o)).src;(s=new mxImageShape(s=new mxRectangle(o.x-s.width/2,o.y-s.height/2,s.width,s.height),r)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.preserveImageAspect=!1,s.init(this.graph.getView().getOverlayPane()),null!=s.node.previousSibling&&s.node.parentNode.insertBefore(s.node,s.node.parentNode.firstChild),r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),s.redraw(),mxEvent.redirectMouseEvents(s.node,this.graph,r),this.currentFocusArea.add(s.bounds),this.focusIcons.push(s),this.focusPoints.push(o)}this.currentFocusArea.grow(t)}else if(null!=this.focusIcons){for(null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}if(this.currentPoint=this.currentConstraint=null,null!=this.focusIcons&&null!=this.constraints&&(null==e.getState()||this.currentFocus==e.getState()))for(i=0;i<this.focusIcons.length;i++)if(mxUtils.intersects(this.focusIcons[i].bounds,a)){this.currentConstraint=this.constraints[i],this.currentPoint=this.focusPoints[i],(t=this.focusIcons[i].bounds.clone()).grow(mxClient.IS_IE?3:2),mxClient.IS_IE&&(t.width-=1,t.height-=1),null==this.focusHighlight?((t=new mxRectangleShape(t,null,this.highlightColor,3)).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,t.init(this.graph.getView().getOverlayPane()),this.focusHighlight=t,r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),mxEvent.redirectMouseEvents(t.node,this.graph,r)):(this.focusHighlight.bounds=t,this.focusHighlight.redraw());break}null==this.currentConstraint&&null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)}},mxConstraintHandler.prototype.destroy=function(){this.reset()},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(e){this.enabled=e},mxRubberband.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(this.graph.isForceMarqueeEvent(n.getEvent())||null==n.getState())){var t=mxUtils.getOffset(this.graph.container),a=mxUtils.getScrollOrigin(this.graph.container);if(a.x-=t.x,a.y-=t.y,this.start(n.getX()+a.x,n.getY()+a.y),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var i=this.graph.container,s=function(e){e=new mxMouseEvent(e);var n=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=n.x,e.graphY=n.y,e};this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,s(e))}),this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,s(e))}),mxEvent.addListener(document,"mousemove",this.dragHandler),mxEvent.addListener(document,"mouseup",this.dropHandler)}n.consume(!1)}},mxRubberband.prototype.start=function(e,n){this.first=new mxPoint(e,n)},mxRubberband.prototype.mouseMove=function(e,n){if(!n.isConsumed()&&null!=this.first){var t=mxUtils.getScrollOrigin(this.graph.container),a=mxUtils.getOffset(this.graph.container);t.x-=a.x,t.y-=a.y;a=n.getX()+t.x,t=n.getY()+t.y;var i=this.first.x-a,s=this.first.y-t,o=this.graph.tolerance;(null!=this.div||Math.abs(i)>o||Math.abs(s)>o)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,t),n.consume())}},mxRubberband.prototype.createShape=function(){return null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv),this.sharedDiv},mxRubberband.prototype.mouseUp=function(e,n){var t=null!=this.div;this.reset(),t&&(t=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(t,n.getEvent()),n.consume())},mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div),null!=this.dragHandler&&(mxEvent.removeListener(document,"mousemove",this.dragHandler),this.dragHandler=null),null!=this.dropHandler&&(mxEvent.removeListener(document,"mouseup",this.dropHandler),this.dropHandler=null),this.currentY=this.currentX=0,this.div=this.first=null},mxRubberband.prototype.update=function(e,n){this.currentX=e,this.currentY=n,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var e=this.currentX-this.graph.panDx,n=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,e),this.y=Math.min(this.first.y,n),this.width=Math.max(this.first.x,e)-this.x,this.height=Math.max(this.first.y,n)-this.y,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.init(this.graph.getView().getOverlayPane()),this.graph.isCellMovable(this.state.cell)&&(this.selectionBorder.node.style.cursor=mxConstants.CURSOR_MOVABLE_VERTEX),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var e=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],e||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var n=0;e&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",n++)),this.sizers.push(this.createSizer("n-resize",n++)),this.sizers.push(this.createSizer("ne-resize",n++)),this.sizers.push(this.createSizer("w-resize",n++)),this.sizers.push(this.createSizer("e-resize",n++)),this.sizers.push(this.createSizer("sw-resize",n++)),this.sizers.push(this.createSizer("s-resize",n++))),this.sizers.push(this.createSizer("se-resize",n++))),null!=(e=this.graph.model.getGeometry(this.state.cell))&&!e.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,null,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.rotationEnabled&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(this.rotationShape=this.createSizer("pointer",mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.redraw()},mxVertexHandler.prototype.getSelectionBounds=function(e){return new mxRectangle(Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height))},mxVertexHandler.prototype.createSelectionShape=function(e){return(e=new mxRectangleShape(e,null,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(e,n,t,a){return t=new mxRectangle(0,0,t=t||mxConstants.HANDLE_SIZE,t),(a=this.createSizerShape(t,n,a)).isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(a.bounds.height-=1,a.bounds.width-=1,a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(a.node,this.graph,this.state),this.graph.isEnabled()&&(a.node.style.cursor=e),this.isSizerVisible(n)||(a.node.style.visibility="hidden"),a},mxVertexHandler.prototype.isSizerVisible=function(e){return!0},mxVertexHandler.prototype.createSizerShape=function(e,n,t){return null!=this.handleImage?(e.width=this.handleImage.width,e.height=this.handleImage.height,new mxImageShape(e,this.handleImage.src)):n==mxEvent.ROTATION_HANDLE?new mxEllipse(e,t||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(e,t||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(e,n,t){null!=e&&(e.bounds.x=Math.round(n-e.bounds.width/2),e.bounds.y=Math.round(t-e.bounds.height/2),e.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){if(e.isSource(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e.isSource(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var n=this.tolerance,t=(n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,0);t<this.sizers.length;t++)if(e.isSource(this.sizers[t])||null!=n&&mxUtils.intersects(this.sizers[t].bounds,n))return t;return null},mxVertexHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&(0<this.tolerance||n.getState()==this.state)){var t=this.getHandleForEvent(n);null!=t&&(this.start(n.getX(),n.getY(),t),n.consume())}},mxVertexHandler.prototype.start=function(e,n,t){e=mxUtils.convertPoint(this.graph.container,e,n),this.startX=e.x,this.startY=e.y,this.index=t,this.selectionBorder.node.style.display=t==mxEvent.ROTATION_HANDLE?"inline":"none",this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))},mxVertexHandler.prototype.mouseMove=function(e,n){if(n.isConsumed()||null==this.index)null!=this.getHandleForEvent(n)&&n.consume(!1);else{var t=new mxPoint(n.getGraphX(),n.getGraphY()),a=this.graph.isGridEnabledEvent(n.getEvent()),i=this.graph.getView().scale;if(this.index==mxEvent.LABEL_HANDLE)a&&(t.x=this.graph.snap(t.x/i)*i,t.y=this.graph.snap(t.y/i)*i),this.moveSizerTo(this.sizers[this.sizers.length-1],t.x,t.y);else if(this.index==mxEvent.ROTATION_HANDLE){var s=this.state.x+this.state.width/2-t.x,o=this.state.y+this.state.height/2-t.y;this.currentAlpha=0!=s?180*Math.atan(o/s)/Math.PI+90:o<0?180:0,0<s&&(this.currentAlpha-=180),this.rotationRaster&&(s=t.x-this.state.getCenterX(),o=t.y-this.state.getCenterY(),s=Math.abs(Math.sqrt(s*s+o*o)-this.state.height/2-20),s=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(s))))),this.currentAlpha=Math.round(this.currentAlpha/s)*s),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw()}else{var r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-r),d=Math.sin(-r),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=(s=t.x-this.startX,o=t.y-this.startY,t=this.graph.view.translate,d*s+l*o);s=l*s-d*o;this.bounds=this.union(this.selectionBounds,s,m,this.index,a,i,t),l=Math.cos(r),c=(d=Math.sin(r))*(s=(o=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY())).x-c.x)+l*(o=o.y-c.y)-o,this.bounds.x+=l*s-d*o-s,this.bounds.y+=c,this.drawPreview()}n.consume()}},mxVertexHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()&&null!=this.index&&null!=this.state){var t=new mxPoint(n.getGraphX(),n.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index==mxEvent.ROTATION_HANDLE)null!=this.currentAlpha&&this.rotateCell(this.state.cell,this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0));else{var a=this.graph.isGridEnabledEvent(n.getEvent()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(-i),o=Math.sin(-i),r=(t=o*(r=t.x-this.startX)+s*(l=t.y-this.startY),s*r-o*l),l=t,d=this.graph.view.scale;this.resizeCell(this.state.cell,r/d,l/d,this.index,a)}}finally{this.graph.getModel().endUpdate()}this.reset(),n.consume()}},mxVertexHandler.prototype.rotateCell=function(e,n){var t=this.graph.getModel();if(t.isVertex(e)){if(null!=(s=e==this.state?this.state:this.graph.view.getState(e))&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(s.style[mxConstants.STYLE_ROTATION]||0)+n,[e]),this.state.cell!=e&&(null!=(s=this.graph.getCellGeometry(e))&&!s.relative))if(0!=n){var a=this.graph.getModel().getParent(e),i=this.graph.getCellGeometry(a);if(!s.relative&&null!=i){var s,o=mxUtils.toRadians(n),r=(a=Math.cos(o),o=Math.sin(o),new mxPoint(s.getCenterX(),s.getCenterY()));i=new mxPoint(i.width/2,i.height/2),a=mxUtils.getRotatedPoint(r,a,o,i);(s=s.clone()).x=a.x-s.width/2,s.y=a.y-s.height/2,t.setGeometry(e,s)}}else(s=s.clone()).x+=dx,s.y+=dy,t.setGeometry(e,s);for(s=t.getChildCount(e),a=0;a<s;a++)this.rotateCell(t.getChildAt(e,a),n)}},mxVertexHandler.prototype.reset=function(){this.index=this.currentAlpha=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview())},mxVertexHandler.prototype.resizeCell=function(e,n,t,a,i){var s=this.graph.model.getGeometry(e);if(null!=s)if(a==mxEvent.LABEL_HANDLE)a=this.graph.view.scale,n=(this.labelShape.bounds.getCenterX()-this.startX)/a,t=(this.labelShape.bounds.getCenterY()-this.startY)/a,null==(s=s.clone()).offset?s.offset=new mxPoint(n,t):(s.offset.x+=n,s.offset.y+=t),this.graph.model.setGeometry(e,s);else{if(a=this.union(s,n,t,a,i,1,new mxPoint(0,0)),0!=(r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"))){n=a.getCenterX()-s.getCenterX(),t=a.getCenterY()-s.getCenterY(),i=Math.cos(r);var o=Math.sin(r),r=i*n-o*t-n;n=o*n+i*t-t,t=a.x-s.x;var l=a.y-s.y,d=i*t-o*l;i=o*t+i*l,a.x+=r,a.y+=n,this.graph.isCellCollapsed(e)||0==r&&0==n||(t=s.x-a.x+d,l=s.y-a.y+i,this.moveChildren(e,t,l))}this.graph.resizeCell(e,a)}},mxVertexHandler.prototype.moveChildren=function(e,n,t){for(var a=this.graph.getModel(),i=a.getChildCount(e),s=0;s<i;s++){var o=a.getChildAt(e,s);if(a.isVertex(o)){var r=this.graph.getCellGeometry(o);null!=r&&!r.relative&&((r=r.clone()).x+=n,r.y+=t,a.setGeometry(o,r))}}},mxVertexHandler.prototype.union=function(e,n,t,a,i,s,o){if(this.singleSizer){o=e.x+e.width+n;var r=e.y+e.height+t;return i&&(o=this.graph.snap(o/s)*s,r=this.graph.snap(r/s)*s),(s=new mxRectangle(e.x,e.y,0,0)).add(new mxRectangle(o,r,0,0)),s}var l=(r=e.x-o.x*s)+e.width,d=e.y-o.y*s;return e=d+e.height,4<a?(e+=t,i&&(e=this.graph.snap(e/s)*s)):a<3&&(d+=t,i&&(d=this.graph.snap(d/s)*s)),0==a||3==a||5==a?(r+=n,i&&(r=this.graph.snap(r/s)*s)):2!=a&&4!=a&&7!=a||(l+=n,i&&(l=this.graph.snap(l/s)*s)),e-=d,(i=l-r)<0&&(r+=i,i=Math.abs(i)),e<0&&(d+=e,e=Math.abs(e)),new mxRectangle(r+o.x*s,d+o.y*s,i,e)},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.state.x,this.state.y,this.state.width,this.state.height);var e=this.state;if(null!=this.sizers){var n=e.x+e.width,t=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],n,t);else{var a=e.x+e.width/2,i=e.y+e.height/2;if(1<this.sizers.length){var s=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),r=(s=Math.sin(s),new mxPoint(e.getCenterX(),e.getCenterY())),l=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),o,s,r);this.moveSizerTo(this.sizers[0],l.x,l.y),l.x=a,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[1],l.x,l.y),l.x=n,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[2],l.x,l.y),l.x=e.x,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[3],l.x,l.y),l.x=n,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[4],l.x,l.y),l.x=e.x,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[5],l.x,l.y),l.x=a,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[6],l.x,l.y),l.x=n,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[7],l.x,l.y),this.moveSizerTo(this.sizers[8],a+e.absoluteOffset.x,i+e.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],a+e.absoluteOffset.x,i+e.absoluteOffset.y):this.moveSizerTo(this.sizers[0],e.x,e.y)}}null!=this.rotationShape&&(s=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),s=Math.sin(s),r=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),l=mxUtils.getRotatedPoint(new mxPoint(e.x+e.width/2,e.y-16),o,s,r),this.moveSizerTo(this.rotationShape,l.x,l.y)),this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.drawPreview()},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.preview&&(this.preview.destroy(),this.preview=null),this.selectionBorder.destroy(),this.labelShape=this.selectionBorder=null,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy(),this.sizers[e]=null},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.svgStrokeTolerance=0,this.shape.node.style.cursor=mxConstants.CURSOR_MOVABLE_EDGE,mxEvent.addListener(this.shape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e,this.state.cell)})),mxEvent.addGestureListeners(this.shape.node,mxUtils.bind(this,function(e){this.addEnabled&&this.isAddPointEvent(e)?this.addPoint(this.state,e):this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,this.state))}),mxUtils.bind(this,function(e){var n=this.state.cell;if(null!=this.index){var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));n=this.graph.getCellAt(t.x,t.y);this.graph.isSwimlane(n)&&this.graph.hitsSwimlaneContent(n,t.x,t.y)&&(n=null)}this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,this.graph.getView().getState(n)))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,this.state))})),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var e=this.state.getVisibleTerminalState(!0);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container),this.preferHtml||null!=(e=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends()),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=new mxRectangleShape(new mxRectangle,mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR),this.labelShape.pointerEvents=!1,this.initBend(this.labelShape),this.labelShape.node.style.cursor=mxConstants.CURSOR_LABEL_HANDLE,mxEvent.redirectMouseEvents(this.labelShape.node,this.graph,this.state),this.redraw()},mxEdgeHandler.prototype.isAddPointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.isRemovePointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.getSelectionPoints=function(e){return e.absolutePoints},mxEdgeHandler.prototype.createSelectionShape=function(e){return(e=new mxPolyline(e,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(e){return!0},mxEdgeHandler.prototype.createMarker=function(){var e=new mxCellMarker(this.graph),a=this;return e.getCell=function(e){var n=mxCellMarker.prototype.getCell.apply(this,arguments);if(!a.isConnectableCell(n))return null;var t=a.graph.getModel();return(n==a.state.cell||null!=n&&!a.graph.connectableEdges&&t.isEdge(n))&&(n=null),n},e.isValidState=function(e){var n=a.graph.getModel();n=null!=(n=a.graph.view.getTerminalPort(e,a.graph.view.getState(n.getTerminal(a.state.cell,!a.isSource)),!a.isSource))?n.cell:null;return a.error=a.validateConnection(a.isSource?e.cell:n,a.isSource?n:e.cell),null==a.error},e},mxEdgeHandler.prototype.validateConnection=function(e,n){return this.graph.getEdgeValidationError(this.state.cell,e,n)},mxEdgeHandler.prototype.createBends=function(){for(var e=this.state.cell,n=[],t=0;t<this.abspoints.length;t++)if(this.isHandleVisible(t)){var a=t==this.abspoints.length-1;if((a=0==t||a)||this.graph.isCellBendable(e)){var i=this.createHandleShape(t);if(this.initBend(i),mxClient.IS_TOUCH&&i.node.setAttribute("pointer-events","none"),this.isHandleEnabled(t))if(mxClient.IS_TOUCH){var s=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(i.node,this.graph,s)}else i.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(i.node,this.graph,this.state);n.push(i),a||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}}return n},mxEdgeHandler.prototype.isHandleEnabled=function(e){return!0},mxEdgeHandler.prototype.isHandleVisible=function(e){return!0},mxEdgeHandler.prototype.createHandleShape=function(e){return null!=this.handleImage?new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src):(e=mxConstants.HANDLE_SIZE,this.preferHtml&&(e-=1),new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR))},mxEdgeHandler.prototype.initBend=function(e){this.preferHtml?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()))},mxEdgeHandler.prototype.getHandleForEvent=function(e){if(null!=this.bends)for(var n=this.tolerance,t=(n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,0);t<this.bends.length;t++)if((e.isSource(this.bends[t])||null!=n&&mxUtils.intersects(this.bends[t].bounds,n))&&"hidden"!=this.bends[t].node.style.visibility)return t;return!(e.isSource(this.labelShape)&&"hidden"!=this.labelShape.node.style.visibility||e.isSource(this.state.text))||(mxClient.IS_SF||mxClient.IS_GC)&&"SELECT"==e.getSource().nodeName?null:mxEvent.LABEL_HANDLE},mxEdgeHandler.prototype.mouseDown=function(e,n){var t=null;null!=(t=this.getHandleForEvent(n))&&!n.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&(this.removeEnabled&&this.isRemovePointEvent(n.getEvent())?this.removePoint(this.state,t):(t!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(n.getCell()))&&this.start(n.getX(),n.getY(),t),n.consume())},mxEdgeHandler.prototype.start=function(e,n,t){this.startX=e,this.startY=n,this.isSource=null!=this.bends&&0==t,this.isTarget=null!=this.bends&&t==this.bends.length-1,this.isLabel=t==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(e=this.state.cell,(null==(n=this.graph.model.getTerminal(e,this.isSource))&&this.graph.isTerminalPointMovable(e,this.isSource)||null!=n&&this.graph.isCellDisconnectable(e,n,this.isSource))&&(this.index=t)):this.index=t},mxEdgeHandler.prototype.clonePreviewState=function(e,n){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.getPointForEvent=function(e){var t=new mxPoint(e.getGraphX(),e.getGraphY()),a=this.getSnapToTerminalTolerance(),n=this.graph.getView(),i=!1,s=!1;if(this.snapToTerminals&&0<a){var o=function(e){if(null!=e){var n=e.x;Math.abs(t.x-n)<a&&(t.x=n,i=!0),e=e.y,Math.abs(t.y-e)<a&&(t.y=e,s=!0)}},r=function(e){null!=e&&o.call(this,new mxPoint(n.getRoutingCenterX(e),n.getRoutingCenterY(e)))};if(r.call(this,this.state.getVisibleTerminalState(!0)),r.call(this,this.state.getVisibleTerminalState(!1)),null!=this.abspoints)for(r=0;r<this.abspoints;r++)r!=this.index&&o.call(this,this.abspoints[r])}return this.graph.isGridEnabledEvent(e.getEvent())&&(e=n.scale,r=n.translate,i||(t.x=(this.graph.snap(t.x/e-r.x)+r.x)*e),s||(t.y=(this.graph.snap(t.y/e-r.y)+r.y)*e)),t},mxEdgeHandler.prototype.getPreviewTerminalState=function(e){this.constraintHandler.update(e,this.isSource),this.marker.process(e),e=this.marker.getValidState();var n=null;return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint&&this.marker.reset(),null!=e?n=e:null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(n=this.constraintHandler.currentFocus),n},mxEdgeHandler.prototype.getPreviewPoints=function(e){var n=null!=(n=this.graph.getCellGeometry(this.state.cell)).points?n.points.slice():null;return this.isSource||this.isTarget?this.graph.resetEdgesOnConnect&&(n=null):(this.convertPoint(e,!1),null==n?n=[e]:n[this.index-1]=e),n},mxEdgeHandler.prototype.updatePreviewState=function(e,n,t){var a=this.isSource?t:this.state.getVisibleTerminalState(!0),i=this.isTarget?t:this.state.getVisibleTerminalState(!1),s=this.graph.getConnectionConstraint(e,a,!0),o=this.graph.getConnectionConstraint(e,i,!1),r=this.constraintHandler.currentConstraint;null==r&&(r=new mxConnectionConstraint),this.isSource?s=r:this.isTarget&&(o=r),(!this.isSource||null!=a)&&e.view.updateFixedTerminalPoint(e,a,!0,s),(!this.isTarget||null!=i)&&e.view.updateFixedTerminalPoint(e,i,!1,o),(this.isSource||this.isTarget)&&null==t&&(e.setAbsoluteTerminalPoint(n,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),e.view.updatePoints(e,this.points,a,i),e.view.updateFloatingTerminalPoints(e,a,i)},mxEdgeHandler.prototype.mouseMove=function(e,n){if(null!=this.index&&null!=this.marker){var t=this.getPointForEvent(n);if(this.isLabel)this.label.x=t.x,this.label.y=t.y;else{this.points=this.getPreviewPoints(t);var a=this.isSource||this.isTarget?this.getPreviewTerminalState(n):null,i=this.clonePreviewState(t,null!=a?a.cell:null);this.updatePreviewState(i,t,a),this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor),this.abspoints=i.absolutePoints,this.active=!0}this.drawPreview(),mxEvent.consume(n.getEvent()),n.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(n)&&n.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(e,n){if(null!=this.index&&null!=this.marker){var t=this.state.cell;if(n.getX()!=this.startX||n.getY()!=this.startY)if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var a=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),null!=a)t=this.connect(t,a,this.isSource,this.graph.isCloneEvent(n.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable(),n);else if(this.graph.isAllowDanglingEdges()){(a=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=a.x/this.graph.view.scale-this.graph.view.translate.x,a.y=a.y/this.graph.view.scale-this.graph.view.translate.y;var i=this.graph.getView().getState(this.graph.getModel().getParent(t));null!=i&&(a.x-=i.origin.x,a.y-=i.origin.y),a.x-=this.graph.panDx/this.graph.view.scale,a.y-=this.graph.panDy/this.graph.view.scale,this.changeTerminalPoint(t,a,this.isSource)}}else this.active?this.changePoints(t,this.points):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().revalidate(this.state.cell));null!=this.marker&&(this.reset(),t!=this.state.cell&&this.graph.setSelectionCell(t)),n.consume()}},mxEdgeHandler.prototype.reset=function(){this.points=this.label=this.index=this.error=null,this.isTarget=this.isSource=this.isLabel=this.active=!1,this.marker.reset(),this.constraintHandler.reset(),this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(e){null!=this.shape&&(this.shape.stroke=e)},mxEdgeHandler.prototype.convertPoint=function(e,n){var t=this.graph.getView().getScale(),a=this.graph.getView().getTranslate();return n&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/t-a.x),e.y=Math.round(e.y/t-a.y),null!=(t=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell)))&&(e.x-=t.origin.x,e.y-=t.origin.y),e},mxEdgeHandler.prototype.moveLabel=function(e,n,t){var a=this.graph.getModel();if(null!=(i=a.getGeometry(e.cell))){var i=i.clone(),s=this.graph.getView().getRelativePoint(e,n,t);i.x=s.x,i.y=s.y;var o=this.graph.getView().scale;i.offset=new mxPoint(0,0),s=this.graph.view.getPoint(e,i),i.offset=new mxPoint((n-s.x)/o,(t-s.y)/o),a.setGeometry(e.cell,i)}},mxEdgeHandler.prototype.connect=function(e,n,t,a,i){var s=(i=this.graph.getModel()).getParent(e);i.beginUpdate();try{if(a){var o=e.clone();i.add(s,o,i.getChildCount(s));var r=i.getTerminal(e,!t);this.graph.connectCell(o,r,!t),e=o}var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(e,n,t,l)}finally{i.endUpdate()}return e},mxEdgeHandler.prototype.changeTerminalPoint=function(e,n,t){var a=this.graph.getModel(),i=a.getGeometry(e);if(null!=i){a.beginUpdate();try{(i=i.clone()).setTerminalPoint(n,t),a.setGeometry(e,i),this.graph.connectCell(e,null,t,new mxConnectionConstraint)}finally{a.endUpdate()}}},mxEdgeHandler.prototype.changePoints=function(e,n){var t=this.graph.getModel(),a=t.getGeometry(e);null!=a&&((a=a.clone()).points=n,t.setGeometry(e,a))},mxEdgeHandler.prototype.addPoint=function(e,n){var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),a=this.graph.isGridEnabledEvent(n);this.convertPoint(t,a),this.addPointAt(e,t.x,t.y),mxEvent.consume(n)},mxEdgeHandler.prototype.addPointAt=function(e,n,t){var a=this.graph.getCellGeometry(e.cell);if(n=new mxPoint(n,t),null!=a){a=a.clone(),t=this.graph.view.translate;var i=this.graph.view.scale;t=mxUtils.findNearestSegment(e,(n.x+t.x)*i,(n.y+t.y)*i),null==a.points?a.points=[n]:a.points.splice(t,0,n),this.graph.getModel().setGeometry(e.cell,a),this.destroy(),this.init()}},mxEdgeHandler.prototype.removePoint=function(e,n){if(0<n&&n<this.abspoints.length-1){var t=this.graph.getCellGeometry(this.state.cell);null!=t&&null!=t.points&&((t=t.clone()).points.splice(n-1,1),this.graph.getModel().setGeometry(e.cell,t),this.destroy(),this.init())}},mxEdgeHandler.prototype.getHandleFillColor=function(e){e=0==e;var n=this.state.cell,t=this.graph.getModel().getTerminal(n,e),a=mxConstants.HANDLE_FILLCOLOR;return null!=t&&!this.graph.isCellDisconnectable(n,t,e)||null==t&&!this.graph.isTerminalPointMovable(n,e)?a=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=t&&this.graph.isCellDisconnectable(n,t,e)&&(a=mxConstants.CONNECT_HANDLE_FILLCOLOR),a},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice();var e=this.state.cell,n=mxConstants.LABEL_HANDLE_SIZE;if(this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-n/2),Math.round(this.label.y-n/2),n,n),this.labelShape.redraw(),null!=(n=this.graph.getLabel(e))&&0<n.length&&this.graph.isLabelMovable(e)?this.labelShape.node.style.visibility="visible":this.labelShape.node.style.visibility="hidden",null!=this.bends&&0<this.bends.length){var t=this.abspoints.length-1,a=(e=this.abspoints[0],this.abspoints[0].y);n=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.round(this.abspoints[0].x-n.width/2),Math.round(a-n.height/2),n.width,n.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw();a=this.abspoints[t];var i=this.abspoints[t].x,s=(t=this.abspoints[t].y,this.bends.length-1);n=this.bends[s].bounds;this.bends[s].bounds=new mxRectangle(Math.round(i-n.width/2),Math.round(t-n.height/2),n.width,n.height),this.bends[s].fill=this.getHandleFillColor(s),this.bends[s].redraw(),this.redrawInnerBends(e,a)}this.drawPreview()},mxEdgeHandler.prototype.redrawInnerBends=function(e,n){var t=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=t){null==this.points&&(this.points=[]);for(var a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){var i=this.abspoints[a].x,s=this.abspoints[a].y,o=this.bends[a].bounds;this.bends[a].node.style.visibility="visible",this.bends[a].bounds=new mxRectangle(Math.round(i-o.width/2),Math.round(s-o.height/2),o.width,o.height),this.bends[a].redraw(),this.points[a-1]=t[a-1]}else this.bends[a].destroy(),this.bends[a]=null}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var e=mxConstants.LABEL_HANDLE_SIZE;e=new mxRectangle(Math.round(this.label.x-e/2),Math.round(this.label.y-e/2),e,e);this.labelShape.bounds=e,this.labelShape.redraw()}else this.shape.points=this.abspoints,this.shape.redraw()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.bends)for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null)},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype=new mxEdgeHandler,mxElbowEdgeHandler.prototype.constructor=mxElbowEdgeHandler,mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var e=[],n=this.createHandleShape(0);return this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e.push(this.createVirtualBend()),this.points.push(new mxPoint(0,0)),n=this.createHandleShape(2),this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e},mxElbowEdgeHandler.prototype.createVirtualBend=function(){var e=this.createHandleShape();this.initBend(e);var n=this.getCursorForBend();return e.node.style.cursor=n,n=mxUtils.bind(this,function(e){!mxEvent.isConsumed(e)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,e),mxEvent.consume(e))}),mxEvent.redirectMouseEvents(e.node,this.graph,this.state,null,null,null,n),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(e){var n=null;return null==this.bends||null==this.bends[1]||e!=this.bends[1].node&&e.parentNode!=this.bends[1].node||(n=this.doubleClickOrientationResource,n=mxResources.get(n)||n),n},mxElbowEdgeHandler.prototype.convertPoint=function(e,n){var t=this.graph.getView().getScale(),a=this.graph.getView().getTranslate(),i=this.state.origin;n&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/t-a.x-i.x),e.y=Math.round(e.y/t-a.y-i.y)},mxElbowEdgeHandler.prototype.redrawInnerBends=function(e,n){var t=null==(t=null!=(t=this.graph.getModel().getGeometry(this.state.cell).points)?t[0]:null)?new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2):new mxPoint(this.graph.getView().scale*(t.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(t.y+this.graph.getView().translate.y+this.state.origin.y)),a=(i=this.bends[1].bounds).width,i=i.height;null==this.handleImage&&(i=a=mxConstants.HANDLE_SIZE);var s=new mxRectangle(Math.round(t.x-a/2),Math.round(t.y-i/2),a,i);null==this.handleImage&&"hidden"!=this.labelShape.node.style.visibility&&mxUtils.intersects(s,this.labelShape.bounds)&&(a+=3,i+=3,s=new mxRectangle(Math.round(t.x-a/2),Math.round(t.y-i/2),a,i)),this.bends[1].bounds=s,this.bends[1].redraw()},mxUtils.extend(mxEdgeSegmentHandler,mxEdgeHandler),mxEdgeSegmentHandler.prototype=new mxElbowEdgeHandler,mxEdgeSegmentHandler.prototype.constructor=mxEdgeSegmentHandler,mxEdgeSegmentHandler.prototype.getPreviewPoints=function(e){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);this.convertPoint(e,!1);var n=this.state.absolutePoints,t=n[0].clone();this.convertPoint(t,!1);for(var a=[],i=1;i<n.length;i++){var s=n[i].clone();this.convertPoint(s,!1),i==this.index&&(t.x==s.x?(t.x=e.x,s.x=e.x):(t.y=e.y,s.y=e.y)),i<n.length-1&&a.push(s),t=s}if(1==a.length){if(t=this.state.view,i=this.state.getVisibleTerminalState(!0),null!=(s=this.state.getVisibleTerminalState(!1))&null!=i){var o=this.state.origin.x,r=this.state.origin.y;mxUtils.contains(s,a[0].x+o,a[0].y+r)?n[1].y==n[2].y?a[0].y=t.getRoutingCenterY(i)-r:a[0].x=t.getRoutingCenterX(i)-o:mxUtils.contains(i,a[0].x+o,a[0].y+r)&&(n[1].y==n[0].y?a[0].y=t.getRoutingCenterY(s)-r:a[0].x=t.getRoutingCenterX(s)-o)}}else 0==a.length&&(a=[e]);return a},mxEdgeSegmentHandler.prototype.createBends=function(){var e=[],n=this.createHandleShape(0);this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none");var t=this.state.absolutePoints;if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var a=0;a<t.length-1;a++)n=this.createVirtualBend(),e.push(n),n.node.style.cursor=0==t[a].x-t[a+1].x?"col-resize":"row-resize",this.points.push(new mxPoint(0,0)),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none")}return n=this.createHandleShape(t.length),this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.refresh=function(){if(null!=this.bends){for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null);this.bends=this.createBends()}},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(e,n){if(this.graph.isCellBendable(this.state.cell)){var t=mxConstants.HANDLE_SIZE,a=this.state.absolutePoints;if(null!=a&&1<a.length)for(var i=0;i<this.state.absolutePoints.length-1;i++)if(null!=this.bends[i+1]){e=a[i],n=a[i+1];var s=new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2);this.bends[i+1].bounds=new mxRectangle(Math.round(s.x-t/2),Math.round(s.y-t/2),t,t),this.bends[i+1].redraw()}}},mxEdgeSegmentHandler.prototype.changePoints=function(e,n){n=[];var t=this.abspoints;if(1<t.length)for(var a=t[0],i=t[1],s=2;s<t.length;s++){var o=t[s];Math.round(a.x)==Math.round(i.x)&&Math.round(i.x)==Math.round(o.x)||Math.round(a.y)==Math.round(i.y)&&Math.round(i.y)==Math.round(o.y)||(i=(a=i).clone(),this.convertPoint(i,!1),n.push(i)),i=o}mxElbowEdgeHandler.prototype.changePoints.apply(this,arguments)},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(e){this.enabled=e},mxKeyHandler.prototype.bindKey=function(e,n){this.normalKeys[e]=n},mxKeyHandler.prototype.bindShiftKey=function(e,n){this.shiftKeys[e]=n},mxKeyHandler.prototype.bindControlKey=function(e,n){this.controlKeys[e]=n},mxKeyHandler.prototype.bindControlShiftKey=function(e,n){this.controlShiftKeys[e]=n},mxKeyHandler.prototype.isControlDown=function(e){return mxEvent.isControlDown(e)},mxKeyHandler.prototype.getFunction=function(e){return null!=e?this.isControlDown(e)?mxEvent.isShiftDown(e)?this.controlShiftKeys[e.keyCode]:this.controlKeys[e.keyCode]:mxEvent.isShiftDown(e)?this.shiftKeys[e.keyCode]:this.normalKeys[e.keyCode]:null},mxKeyHandler.prototype.isGraphEvent=function(e){if((e=mxEvent.getSource(e))==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&e==this.graph.cellEditor.textarea)return!0;for(;null!=e;){if(e==this.graph.container)return!0;e=e.parentNode}return!1},mxKeyHandler.prototype.keyDown=function(e){if(this.graph.isEnabled()&&!mxEvent.isConsumed(e)&&this.isGraphEvent(e)&&this.isEnabled())if(27==e.keyCode)this.escape(e);else if(!this.graph.isEditing()){var n=this.getFunction(e);null!=n&&(n(e),mxEvent.consume(e))}},mxKeyHandler.prototype.escape=function(e){this.graph.isEscapeEnabled()&&this.graph.escape(e)},mxKeyHandler.prototype.destroy=function(){this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(e){this.enabled=e},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(e){this.hideOnHover=e},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",this.div.style.zIndex=this.zIndex,document.body.appendChild(this.div),mxEvent.addListener(this.div,"mousedown",mxUtils.bind(this,function(e){this.hideTooltip()})))},mxTooltipHandler.prototype.mouseDown=function(e,n){this.reset(n,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(e,n){n.getX()==this.lastX&&n.getY()==this.lastY||(this.reset(n,!0),(this.isHideOnHover()||n.getState()!=this.state||n.getSource()!=this.node&&(!this.stateSource||null!=n.getState()&&this.stateSource==(n.isSource(n.getState().shape)||!n.isSource(n.getState().text))))&&this.hideTooltip()),this.lastX=n.getX(),this.lastY=n.getY()},mxTooltipHandler.prototype.mouseUp=function(e,n){this.reset(n,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(e,n){if(this.resetTimer(),n&&this.isEnabled()&&null!=e.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var t=e.getState(),a=e.getSource(),i=e.getX(),s=e.getY(),o=e.isSource(t.shape)||e.isSource(t.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.panningHandler.isMenuShowing()){var e=this.graph.getTooltip(t,a,i,s);this.show(e,i,s),this.state=t,this.node=a,this.stateSource=o}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")},mxTooltipHandler.prototype.show=function(e,n,t){if(null!=e&&0<e.length){null==this.div&&this.init();var a=mxUtils.getScrollOrigin();this.div.style.left=n+a.x+"px",this.div.style.top=t+mxConstants.TOOLTIP_VERTICAL_OFFSET+a.y+"px",mxUtils.isNode(e)?(this.div.innerHTML="",this.div.appendChild(e)):this.div.innerHTML=e.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(e,n){},mxCellTracker.prototype.mouseMove=function(e,n){this.isEnabled()&&this.process(n)},mxCellTracker.prototype.mouseUp=function(e,n){this.reset()},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(e){this.highlightColor=e,null!=this.shape&&(this.shape.stroke=e)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var e=null;return(e=this.graph.model.isEdge(this.state.cell)?new mxPolyline(this.state.absolutePoints,this.highlightColor,this.strokeWidth):new mxRectangleShape(new mxRectangle,null,this.highlightColor,this.strokeWidth)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(e.node,this.graph,this.state),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=this.dashed,e},mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){var e=0;this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),e=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),0!=e&&(this.shape.rotation=e),this.shape.redraw()}},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(e){this.state!=e&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=e,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(e,n,t){var a=mxUtils.bind(this,function(){this.editor.execute(n)});t?this.handler.bindControlKey(e,a):this.handler.bindKey(e,a)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(e,n,t,a){if(null!=this.config){var i=this.createConditions(e,t,a);this.addItems(e,n,t,a,i,this.config.firstChild,null)}},mxDefaultPopupMenu.prototype.addItems=function(e,n,t,a,i,s,o){for(var r=!1;null!=s;){if("add"==s.nodeName){if(null==(l=s.getAttribute("if"))||i[l]){var l=s.getAttribute("as"),d=(l=mxResources.get(l)||l,mxUtils.eval(mxUtils.getTextContent(s))),c=s.getAttribute("action"),m=s.getAttribute("icon"),u=s.getAttribute("iconCls");r&&(n.addSeparator(o),r=!1),null!=m&&this.imageBasePath&&(m=this.imageBasePath+m),l=this.addAction(n,e,l,m,d,c,t,o,u),this.addItems(e,n,t,a,i,s.firstChild,l)}}else"separator"==s.nodeName&&(r=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(e,n,t,a,i,s,o,r,l){return e.addItem(t,a,function(e){"function"==typeof i&&i.call(n,n,o,e),null!=s&&n.execute(s,o,e)},r,l)},mxDefaultPopupMenu.prototype.createConditions=function(e,n,t){var a=e.graph.getModel(),i=a.getChildCount(n),s=[];for(s.nocell=null==n,s.ncells=1<e.graph.getSelectionCount(),s.notRoot=a.getRoot()!=a.getParent(e.graph.getDefaultParent()),s.cell=null!=n,a=null!=n&&1==e.graph.getSelectionCount(),s.nonEmpty=a&&0<i,s.expandable=a&&e.graph.isCellFoldable(n,!1),s.collapsable=a&&e.graph.isCellFoldable(n,!0),s.validRoot=a&&e.graph.isValidRoot(n),s.emptyValidRoot=s.validRoot&&0==i,s.swimlane=a&&e.graph.isSwimlane(n),i=this.config.getElementsByTagName("condition"),a=0;a<i.length;a++){var o=mxUtils.eval(mxUtils.getTextContent(i[a])),r=i[a].getAttribute("name");null!=r&&"function"==typeof o&&(s[r]=o(e,n,t))}return s},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(e){null!=e&&(this.toolbar=new mxToolbar(e),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(e,n){var t=n.getProperty("function");this.editor.insertFunction=null!=t?mxUtils.bind(this,function(){t.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(e,n,t,a){var i=mxUtils.bind(this,function(){null!=t&&0<t.length&&this.editor.execute(t)});return this.toolbar.addItem(e,n,i,a)},mxDefaultToolbar.prototype.addSeparator=function(e){e=e||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(e)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(e){return this.toolbar.addActionCombo(e)},mxDefaultToolbar.prototype.addActionOption=function(e,n,t){var a=mxUtils.bind(this,function(){this.editor.execute(t)});this.addOption(e,n,a)},mxDefaultToolbar.prototype.addOption=function(e,n,t){return this.toolbar.addOption(e,n,t)},mxDefaultToolbar.prototype.addMode=function(e,n,t,a,i){var s=mxUtils.bind(this,function(){this.editor.setMode(t),null!=i&&i(this.editor)});return this.toolbar.addSwitchMode(e,n,s,a)},mxDefaultToolbar.prototype.addPrototype=function(e,n,t,a,i,s){var o=function(){return"function"==typeof t?t():null!=t?t.clone():null},r=mxUtils.bind(this,function(e,n){"function"==typeof i?i(this.editor,o(),e,n):this.drop(o(),e,n),this.toolbar.resetMode(),mxEvent.consume(e)});return e=this.toolbar.addMode(e,n,r,a,null,s),this.installDropHandler(e,function(e,n,t){r(n,t)}),e},mxDefaultToolbar.prototype.drop=function(e,n,t){var a=this.editor.graph,i=a.getModel();if(null!=t&&!i.isEdge(t)&&this.connectOnDrop&&a.isCellConnectable(t))this.connect(e,n,t);else{for(;null!=t&&!a.isValidDropTarget(t,[e],n);)t=i.getParent(t);this.insert(e,n,t)}},mxDefaultToolbar.prototype.insert=function(e,n,t){var a=this.editor.graph;if(a.canImportCell(e)){var i=mxEvent.getClientX(n),s=mxEvent.getClientY(n);i=mxUtils.convertPoint(a.container,i,s);return a.isSplitEnabled()&&a.isSplitTarget(t,[e],n)?a.splitEdge(t,[e],null,i.x,i.y):this.editor.addVertex(t,e,i.x,i.y)}return null},mxDefaultToolbar.prototype.connect=function(e,n,t){var a=(n=this.editor.graph).getModel();if(null!=t&&n.isCellConnectable(e)&&n.isEdgeValid(null,t,e)){var i=null;a.beginUpdate();try{var s=a.getGeometry(t),o=a.getGeometry(e).clone();o.x=s.x+(s.width-o.width)/2,o.y=s.y+(s.height-o.height)/2;var r=this.spacing*n.gridSize,l=20*a.getDirectedEdgeCount(t,!0);this.editor.horizontalFlow?o.x+=(o.width+s.width)/2+r+l:o.y+=(o.height+s.height)/2+r+l,e.setGeometry(o);var d=a.getParent(t);if(n.addCell(e,d),n.constrainChild(e),i=this.editor.createEdge(t,e),null==a.getGeometry(i)){var c=new mxGeometry;c.relative=!0,a.setGeometry(i,c)}n.addEdge(i,d,t,e)}finally{a.endUpdate()}n.setSelectionCells([e,i]),n.scrollCellToVisible(e)}},mxDefaultToolbar.prototype.installDropHandler=function(n,t){var a=document.createElement("img");a.setAttribute("src",n.getAttribute("src"));var i=mxUtils.bind(this,function(e){a.style.width=2*n.offsetWidth+"px",a.style.height=2*n.offsetHeight+"px",mxUtils.makeDraggable(n,this.editor.graph,t,a),mxEvent.removeListener(a,"load",i)});mxClient.IS_IE?i():mxEvent.addListener(a,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.session=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="&#xa;",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.urlInit=null,mxEditor.prototype.urlNotify=null,mxEditor.prototype.urlPoll=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(e){this.modified=e},mxEditor.prototype.addActions=function(){this.addAction("save",function(e){e.save()}),this.addAction("print",function(e){new mxPrintPreview(e.graph,1).open()}),this.addAction("show",function(e){mxUtils.show(e.graph,null,10,10)}),this.addAction("exportImage",function(e){var n=e.getUrlImage();if(null==n||mxClient.IS_LOCAL)e.execute("show");else{var t=mxUtils.getViewXml(e.graph,1);t=mxUtils.getXml(t,"\n");mxUtils.submit(n,e.postParameterName+"="+encodeURIComponent(t),document,"_blank")}}),this.addAction("refresh",function(e){e.graph.refresh()}),this.addAction("cut",function(e){e.graph.isEnabled()&&mxClipboard.cut(e.graph)}),this.addAction("copy",function(e){e.graph.isEnabled()&&mxClipboard.copy(e.graph)}),this.addAction("paste",function(e){e.graph.isEnabled()&&mxClipboard.paste(e.graph)}),this.addAction("delete",function(e){e.graph.isEnabled()&&e.graph.removeCells()}),this.addAction("group",function(e){e.graph.isEnabled()&&e.graph.setSelectionCell(e.groupCells())}),this.addAction("ungroup",function(e){e.graph.isEnabled()&&e.graph.setSelectionCells(e.graph.ungroupCells())}),this.addAction("removeFromParent",function(e){e.graph.isEnabled()&&e.graph.removeCellsFromParent()}),this.addAction("undo",function(e){e.graph.isEnabled()&&e.undo()}),this.addAction("redo",function(e){e.graph.isEnabled()&&e.redo()}),this.addAction("zoomIn",function(e){e.graph.zoomIn()}),this.addAction("zoomOut",function(e){e.graph.zoomOut()}),this.addAction("actualSize",function(e){e.graph.zoomActual()}),this.addAction("fit",function(e){e.graph.fit()}),this.addAction("showProperties",function(e,n){e.showProperties(n)}),this.addAction("selectAll",function(e){e.graph.isEnabled()&&e.graph.selectAll()}),this.addAction("selectNone",function(e){e.graph.isEnabled()&&e.graph.clearSelection()}),this.addAction("selectVertices",function(e){e.graph.isEnabled()&&e.graph.selectVertices()}),this.addAction("selectEdges",function(e){e.graph.isEnabled()&&e.graph.selectEdges()}),this.addAction("edit",function(e,n){e.graph.isEnabled()&&e.graph.isCellEditable(n)&&e.graph.startEditingAtCell(n)}),this.addAction("toBack",function(e,n){e.graph.isEnabled()&&e.graph.orderCells(!0)}),this.addAction("toFront",function(e,n){e.graph.isEnabled()&&e.graph.orderCells(!1)}),this.addAction("enterGroup",function(e,n){e.graph.enterGroup(n)}),this.addAction("exitGroup",function(e){e.graph.exitGroup()}),this.addAction("home",function(e){e.graph.home()}),this.addAction("selectPrevious",function(e){e.graph.isEnabled()&&e.graph.selectPreviousCell()}),this.addAction("selectNext",function(e){e.graph.isEnabled()&&e.graph.selectNextCell()}),this.addAction("selectParent",function(e){e.graph.isEnabled()&&e.graph.selectParentCell()}),this.addAction("selectChild",function(e){e.graph.isEnabled()&&e.graph.selectChildCell()}),this.addAction("collapse",function(e){e.graph.isEnabled()&&e.graph.foldCells(!0)}),this.addAction("collapseAll",function(e){if(e.graph.isEnabled()){var n=e.graph.getChildVertices();e.graph.foldCells(!0,!1,n)}}),this.addAction("expand",function(e){e.graph.isEnabled()&&e.graph.foldCells(!1)}),this.addAction("expandAll",function(e){if(e.graph.isEnabled()){var n=e.graph.getChildVertices();e.graph.foldCells(!1,!1,n)}}),this.addAction("bold",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("shadow",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_SHADOW)}),this.addAction("alignCellsLeft",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(e){e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(e){var n=100*e.graph.getView().scale;n=parseFloat(mxUtils.prompt(mxResources.get(e.askZoomResource)||e.askZoomResource,n))/100;isNaN(n)||e.graph.getView().setScale(n)}),this.addAction("toggleTasks",function(e){null!=e.tasks?e.tasks.setVisible(!e.tasks.isVisible()):e.showTasks()}),this.addAction("toggleHelp",function(e){null!=e.help?e.help.setVisible(!e.help.isVisible()):e.showHelp()}),this.addAction("toggleOutline",function(e){null==e.outline?e.showOutline():e.outline.setVisible(!e.outline.isVisible())}),this.addAction("toggleConsole",function(e){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.createSession=function(){var e=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.SESSION,"session",e))});return this.connect(this.urlInit,this.urlPoll,this.urlNotify,e)},mxEditor.prototype.configure=function(e){null!=e&&(new mxCodec(e.ownerDocument).decode(e,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(e,n){this.actions[e]=n},mxEditor.prototype.execute=function(n,e,t){var a=this.actions[n];if(null!=a)try{var i=arguments;i[0]=this,a.apply(this,i)}catch(e){throw mxUtils.error("Cannot execute "+n+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+n,280,!0)},mxEditor.prototype.addTemplate=function(e,n){this.templates[e]=n},mxEditor.prototype.getTemplate=function(e){return this.templates[e]},mxEditor.prototype.createGraph=function(){var e=new mxGraph(null,null,this.graphRenderHint);return e.setTooltips(!0),e.setPanning(!0),this.installDblClickHandler(e),this.installUndoHandler(e),this.installDrillHandler(e),this.installChangeHandler(e),this.installInsertHandler(e),e.panningHandler.factoryMethod=mxUtils.bind(this,function(e,n,t){return this.createPopupMenu(e,n,t)}),e.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,n){return this.createEdge(e,n)}),this.createSwimlaneManager(e),this.createLayoutManager(e),e},mxEditor.prototype.createSwimlaneManager=function(e){return(e=new mxSwimlaneManager(e,!1)).isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(a){var e=new mxLayoutManager(a),i=this;return e.getLayout=function(e){var n=null,t=i.graph.getModel();return null!=t.getParent(e)&&(i.layoutSwimlanes&&a.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),n=i.swimlaneLayout):i.layoutDiagram&&(a.isValidRoot(e)||null==t.getParent(t.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),n=i.diagramLayout)),n},e},mxEditor.prototype.setGraphContainer=function(e){null==this.graph.container&&(this.graph.init(e),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(e),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.installDblClickHandler=function(a){a.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,n){var t=n.getProperty("cell");null!=t&&a.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,t),n.consume())}))},mxEditor.prototype.installUndoHandler=function(a){var e=mxUtils.bind(this,function(e,n){var t=n.getProperty("edit");this.undoManager.undoableEditHappened(t)});a.getModel().addListener(mxEvent.UNDO,e),a.getView().addListener(mxEvent.UNDO,e),e=function(e,n){var t=n.getProperty("edit").changes;a.setSelectionCells(a.getSelectionCellsForChanges(t))},this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(e){var n=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.ROOT))});e.getView().addListener(mxEvent.DOWN,n),e.getView().addListener(mxEvent.UP,n)},mxEditor.prototype.installChangeHandler=function(s){var e=mxUtils.bind(this,function(e,n){this.setModified(!0),1==this.validating&&s.validateGraph();for(var t=n.getProperty("edit").changes,a=0;a<t.length;a++){var i=t[a];if(i instanceof mxRootChange||i instanceof mxValueChange&&i.cell==this.graph.model.root||i instanceof mxCellAttributeChange&&i.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});s.getModel().addListener(mxEvent.CHANGE,e)},mxEditor.prototype.installInsertHandler=function(e){var t=this;e.addMouseListener({mouseDown:function(e,n){null==t.insertFunction||n.isPopupTrigger()||!t.forcedInserting&&null!=n.getState()||(t.graph.clearSelection(),t.insertFunction(n.getEvent(),n.getCell()),this.isActive=!0,n.consume())},mouseMove:function(e,n){this.isActive&&n.consume()},mouseUp:function(e,n){this.isActive&&(this.isActive=!1,n.consume())}})},mxEditor.prototype.createDiagramLayout=function(){var e=this.graph.gridSize,n=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*e,2*e);return n.isVertexIgnored=function(e){return!n.graph.isSwimlane(e)},n},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(e){this.toolbar.init(e),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.setStatusContainer=function(e){null==this.status&&(this.status=e,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var e=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+e)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.setStatus=function(e){null!=this.status&&null!=e&&(this.status.innerHTML=e)},mxEditor.prototype.setTitleContainer=function(n){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(e){n.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(n)},mxEditor.prototype.treeLayout=function(e,n){null!=e&&new mxCompactTreeLayout(this.graph,n).execute(e)},mxEditor.prototype.getTitle=function(){for(var e="",n=this.graph,t=n.getCurrentRoot();null!=t&&null!=n.getModel().getParent(n.getModel().getParent(t));)n.isValidRoot(t)&&(e=" > "+n.convertValueToString(t)+e),t=n.getModel().getParent(t);return this.getRootTitle()+e},mxEditor.prototype.getRootTitle=function(){var e=this.graph.getModel().getRoot();return this.graph.convertValueToString(e)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var e=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),e)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(e){if(null!=e){var n=mxUtils.load(e).getXml();this.readGraphModel(n.documentElement),this.filename=e,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",e))}},mxEditor.prototype.readGraphModel=function(e){new mxCodec(e.ownerDocument).decode(e,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(e,n){if(null!=(e=e||this.getUrlPost())&&0<e.length){var t=this.writeGraphModel(n);this.postDiagram(e,t),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",e))},mxEditor.prototype.postDiagram=function(n,t){this.escapePostData&&(t=encodeURIComponent(t)),mxUtils.post(n,this.postParameterName+"="+t,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.POST,"request",e,"url",n,"data",t))}))},mxEditor.prototype.writeGraphModel=function(e){e=null!=e?e:this.linefeed;var n=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(n,e)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.connect=function(e,n,t,a){var i=null;return mxClient.IS_LOCAL||((i=new mxSession(this.graph.getModel(),e,n,t)).addListener(mxEvent.RECEIVE,mxUtils.bind(this,function(e,n){null!=n.getProperty("node").getAttribute("namespace")&&this.resetHistory()})),i.addListener(mxEvent.DISCONNECT,a),i.addListener(mxEvent.CONNECT,a),i.addListener(mxEvent.NOTIFY,a),i.addListener(mxEvent.GET,a),i.start()),i},mxEditor.prototype.swapStyles=function(e,n){var t=this.graph.getStylesheet().styles[n];this.graph.getView().getStylesheet().putCellStyle(n,this.graph.getStylesheet().styles[e]),this.graph.getStylesheet().putCellStyle(e,t),this.graph.refresh()},mxEditor.prototype.showProperties=function(e){if(null==(e=e||this.graph.getSelectionCell())&&(null==(e=this.graph.getCurrentRoot())&&(e=this.graph.getModel().getRoot())),null!=e){this.graph.stopEditing(!0);var n=(t=mxUtils.getOffset(this.graph.container)).x+10,t=t.y;if(null==this.properties||this.movePropertiesDialog){var a=this.graph.getCellBounds(e);null!=a&&(n+=a.x+Math.min(200,a.width),t+=a.y)}else n=this.properties.getX(),t=this.properties.getY();this.hideProperties(),null!=(e=this.createProperties(e))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,e,n,t,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var a=this.graph.getModel(),e=a.getValue(t);if(mxUtils.isNode(e)){var n=new mxForm("properties");n.addText("ID",t.getId()).setAttribute("readonly","true");var i=null,s=null,o=null,r=null,l=null;a.isVertex(t)&&(null!=(i=a.getGeometry(t))&&(s=n.addText("top",i.y),o=n.addText("left",i.x),r=n.addText("width",i.width),l=n.addText("height",i.height)));var d=a.getStyle(t),c=n.addText("Style",d||""),m=e.attributes,u=[];for(e=0;e<m.length;e++)u[e]=n.addTextarea(m[e].nodeName,m[e].nodeValue,"label"==m[e].nodeName?4:2);return e=mxUtils.bind(this,function(){this.hideProperties(),a.beginUpdate();try{null!=i&&((i=i.clone()).x=parseFloat(o.value),i.y=parseFloat(s.value),i.width=parseFloat(r.value),i.height=parseFloat(l.value),a.setGeometry(t,i)),0<c.value.length?a.setStyle(t,c.value):a.setStyle(t,null);for(var e=0;e<m.length;e++){var n=new mxCellAttributeChange(t,m[e].nodeName,u[e].value);a.execute(n)}this.graph.isAutoSizeCell(t)&&this.graph.updateCellSize(t)}finally{a.endUpdate()}}),d=mxUtils.bind(this,function(){this.hideProperties()}),n.addButtons(e,d),n.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var n=document.createElement("div");n.style.padding="4px",n.style.paddingLeft="20px";var e=document.body.clientWidth;(e=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,n,e-220,this.tasksTop,200)).setClosable(!0),e.destroyOnClose=!1;var t=mxUtils.bind(this,function(e){mxEvent.release(n),n.innerHTML="",this.createTasks(n)});this.graph.getModel().addListener(mxEvent.CHANGE,t),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,t),this.graph.addListener(mxEvent.ROOT,t),null!=this.tasksWindowImage&&e.setImage(this.tasksWindowImage),this.tasks=e,this.createTasks(n)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(e){null!=this.tasks&&(e=this.tasks.content,mxEvent.release(e),e.innerHTML="",this.createTasks(e))},mxEditor.prototype.createTasks=function(e){},mxEditor.prototype.showHelp=function(e){if(null==this.help){var n=document.createElement("iframe");n.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),n.setAttribute("height","100%"),n.setAttribute("width","100%"),n.setAttribute("frameBorder","0"),n.style.backgroundColor="white",e=document.body.clientWidth;var t=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,n,(e-this.helpWidth)/2,(t-this.helpHeight)/3,this.helpWidth,this.helpHeight);a.setMaximizable(!0),a.setClosable(!0),a.destroyOnClose=!1,a.setResizable(!0),null!=this.helpWindowImage&&a.setImage(this.helpWindowImage),mxClient.IS_NS&&(e=function(e){n.setAttribute("height",a.div.offsetHeight-26+"px")},a.addListener(mxEvent.RESIZE_END,e),a.addListener(mxEvent.MAXIMIZE,e),a.addListener(mxEvent.NORMALIZE,e),a.addListener(mxEvent.SHOW,e)),this.help=a}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var e=document.createElement("div");e.style.overflow="hidden",e.style.width="100%",e.style.height="100%",e.style.background="white",e.style.cursor="move";var n=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,!1),t=new mxOutline(this.graph,e);n.setClosable(!0),n.setResizable(!0),n.destroyOnClose=!1,n.addListener(mxEvent.RESIZE_END,function(){t.update()}),this.outline=n,this.outline.outline=t}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(e){"select"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==e&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(e,n,t){this.popupHandler.createMenu(this,e,n,t)},mxEditor.prototype.createEdge=function(e,n){var t=null;if(null!=this.defaultEdge)t=this.graph.getModel().cloneCell(this.defaultEdge);else{(t=new mxCell("")).setEdge(!0);var a=new mxGeometry;a.relative=!0,t.setGeometry(a)}return null!=(a=this.getEdgeStyle())&&t.setStyle(a),t},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(e){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(e)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(e){if(null!=this.cycleAttributeName){var n=this.consumeCycleAttribute(e);null!=n&&e.setStyle(e.getStyle()+";"+this.cycleAttributeName+"="+n)}},mxEditor.prototype.addVertex=function(e,n,t,a){for(var i=this.graph.getModel();null!=e&&!this.graph.isValidDropTarget(e);)e=i.getParent(e);e=null!=e?e:this.graph.getSwimlaneAt(t,a);var s=this.graph.getView().scale,o=i.getGeometry(n),r=i.getGeometry(e);if(this.graph.isSwimlane(n)&&!this.graph.swimlaneNesting)e=null;else{if(null==e&&this.swimlaneRequired)return null;if(null!=e&&null!=r){var l=this.graph.getView().getState(e);if(null!=l){if(t-=l.origin.x*s,a-=l.origin.y*s,this.graph.isConstrainedMoving){r=o.width;var d=o.height,c=l.x+l.width;c<t+r&&(t-=t+r-c),(c=l.y+l.height)<a+d&&(a-=a+d-c)}}else null!=r&&(t-=r.x*s,a-=r.y*s)}}(o=o.clone()).x=this.graph.snap(t/s-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(a/s-this.graph.getView().translate.y-this.graph.gridSize/2),n.setGeometry(o),null==e&&(e=this.graph.getDefaultParent()),this.cycleAttribute(n),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",n,"parent",e)),i.beginUpdate();try{null!=(n=this.graph.addCell(n,e))&&(this.graph.constrainChild(n),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",n)))}finally{i.endUpdate()}return null!=n&&(this.graph.setSelectionCell(n),this.graph.scrollCellToVisible(n),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",n))),n},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(e){if(null!=e){var n=e.getName();mxCodecRegistry.codecs[n]=e;var t=mxUtils.getFunctionName(e.template.constructor);t!=n&&mxCodecRegistry.addAlias(t,n)}return e},addAlias:function(e,n){mxCodecRegistry.aliases[e]=n},getCodec:function(e){var n=null;if(null!=e){n=mxUtils.getFunctionName(e);var t=mxCodecRegistry.aliases[n];if(null!=t&&(n=t),null==(n=mxCodecRegistry.codecs[n]))try{n=new mxObjectCodec(new e),mxCodecRegistry.register(n)}catch(e){}}return n}};function mxCodec(e){this.document=e||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(e,n,t,a){for(var i in this.template=e,this.exclude=null!=n?n:[],this.idrefs=null!=t?t:[],this.mapping=null!=a?a:[],this.reverse={},this.mapping)this.reverse[this.mapping[i]]=i}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(e,n){return this.objects[e]=n},mxCodec.prototype.getObject=function(e){var n=null;return null!=e&&(null==(n=this.objects[e])&&(null==(n=this.lookup(e))&&(null!=(e=this.getElementById(e))&&(n=this.decode(e))))),n},mxCodec.prototype.lookup=function(e){return null},mxCodec.prototype.getElementById=function(e,n){return mxUtils.findNodeByAttribute(this.document.documentElement,null!=n?n:"id",e)},mxCodec.prototype.getId=function(e){var n=null;return null!=e&&(null==(n=this.reference(e))&&e instanceof mxCell&&(null==(n=e.getId())&&(0==(n=mxCellPath.create(e)).length&&(n="root")))),n},mxCodec.prototype.reference=function(e){return null},mxCodec.prototype.encode=function(e){var n=null;if(null!=e&&null!=e.constructor){var t=mxCodecRegistry.getCodec(e.constructor);null!=t?n=t.encode(this,e):mxUtils.isNode(e)?n=mxClient.IS_IE?e.cloneNode(!0):this.document.importNode(e,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(e.constructor))}return n},mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=null;try{d=eval(a.nodeName)}catch(e){}try{var f=mxCodecRegistry.getCodec(d);null!=f?c=f.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}catch(e){mxLog.debug("Cannot decode "+a.nodeName+": "+e.message)}}return c},mxCodec.prototype.encodeCell=function(e,n,t){if(n.appendChild(this.encode(e)),null==t||t){t=e.getChildCount();for(var a=0;a<t;a++)this.encodeCell(e.getChildAt(a),n)}},mxCodec.prototype.isCellCodec=function(e){return null!=e&&"function"==typeof e.isCellCodec&&e.isCellCodec()},mxCodec.prototype.decodeCell=function(e,n){n=null==n||n;var t=null;if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){if(t=mxCodecRegistry.getCodec(e.nodeName),!this.isCellCodec(t))for(var a=e.firstChild;null!=a&&!this.isCellCodec(t);)t=mxCodecRegistry.getCodec(a.nodeName),a=a.nextSibling;this.isCellCodec(t)||(t=mxCodecRegistry.getCodec(mxCell)),t=t.decode(this,e),n&&this.insertIntoGraph(t)}return t},mxCodec.prototype.insertIntoGraph=function(e){var n=e.parent,t=e.getTerminal(!0),a=e.getTerminal(!1);e.setTerminal(null,!1),e.setTerminal(null,!0),(e.parent=null)!=n&&n.insert(e),null!=t&&t.insertEdge(e,!0),null!=a&&a.insertEdge(e,!1)},mxCodec.prototype.setAttribute=function(e,n,t){null!=n&&null!=t&&e.setAttribute(n,t)},mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(e){if(null!=e){var n=this.reverse[e];null!=n&&(e=n)}return e},mxObjectCodec.prototype.getAttributeName=function(e){if(null!=e){var n=this.mapping[e];null!=n&&(e=n)}return e},mxObjectCodec.prototype.isExcluded=function(e,n,t,a){return n==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,n)},mxObjectCodec.prototype.isReference=function(e,n,t,a){return 0<=mxUtils.indexOf(this.idrefs,n)},mxObjectCodec.prototype.encode=function(e,n){var t=e.document.createElement(this.getName());return n=this.beforeEncode(e,n,t),this.encodeObject(e,n,t),this.afterEncode(e,n,t)},mxObjectCodec.prototype.encodeObject=function(e,n,t){for(var a in e.setAttribute(t,"id",e.getId(n)),n){var i=a,s=n[i];null!=s&&!this.isExcluded(n,i,s,!0)&&(mxUtils.isNumeric(i)&&(i=null),this.encodeValue(e,n,i,s,t))}},mxObjectCodec.prototype.encodeValue=function(e,n,t,a,i){if(null!=a){if(this.isReference(n,t,a,!0)){var s=e.getId(a);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+t+"="+a);a=s}s=this.template[t],(null==t||e.encodeDefaults||s!=a)&&(t=this.getAttributeName(t),this.writeAttribute(e,n,t,a,i))}},mxObjectCodec.prototype.writeAttribute=function(e,n,t,a,i){"object"!=typeof a?this.writePrimitiveAttribute(e,n,t,a,i):this.writeComplexAttribute(e,n,t,a,i)},mxObjectCodec.prototype.writePrimitiveAttribute=function(e,n,t,a,i){a=this.convertValueToXml(a),null==t?(n=e.document.createElement("add"),"function"==typeof a?n.appendChild(e.document.createTextNode(a)):e.setAttribute(n,"value",a),i.appendChild(n)):"function"!=typeof a&&e.setAttribute(i,t,a)},mxObjectCodec.prototype.writeComplexAttribute=function(e,n,t,a,i){null!=(e=e.encode(a))?(null!=t&&e.setAttribute("as",t),i.appendChild(e)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+t+": "+a)},mxObjectCodec.prototype.convertValueToXml=function(e){return void 0!==e.length||1!=e&&0!=e||(e=1==e?"1":"0"),e},mxObjectCodec.prototype.convertValueFromXml=function(e){return mxUtils.isNumeric(e)&&(e=parseFloat(e)),e},mxObjectCodec.prototype.beforeEncode=function(e,n,t){return n},mxObjectCodec.prototype.afterEncode=function(e,n,t){return t},mxObjectCodec.prototype.decode=function(e,n,t){var a=n.getAttribute("id"),i=e.objects[a];return null==i&&(i=t||this.cloneTemplate(),null!=a&&e.putObject(a,i)),n=this.beforeDecode(e,n,i),this.decodeNode(e,n,i),this.afterDecode(e,n,i)},mxObjectCodec.prototype.decodeNode=function(e,n,t){null!=n&&(this.decodeAttributes(e,n,t),this.decodeChildren(e,n,t))},mxObjectCodec.prototype.decodeAttributes=function(e,n,t){if(null!=(n=n.attributes))for(var a=0;a<n.length;a++)this.decodeAttribute(e,n[a],t)},mxObjectCodec.prototype.decodeAttribute=function(e,n,t){var a=n.nodeName;if("as"!=a&&"id"!=a){n="value"==a?n.nodeValue:this.convertValueFromXml(n.nodeValue);var i=this.getFieldName(a);if(this.isReference(t,i,n,!1)){if(null==(e=e.getObject(n)))return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+a+"="+n);n=e}this.isExcluded(t,a,n,!1)||(t[a]=n)}},mxObjectCodec.prototype.decodeChildren=function(e,n,t){for(n=n.firstChild;null!=n;){var a=n.nextSibling;n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,n,t)&&this.decodeChild(e,n,t),n=a}},mxObjectCodec.prototype.decodeChild=function(e,n,t){var a=this.getFieldName(n.getAttribute("as"));if(null==a||!this.isExcluded(t,a,n,!1)){var i=this.getFieldTemplate(t,a,n),s=null;"add"==n.nodeName?null==(s=n.getAttribute("value"))&&(s=mxUtils.eval(mxUtils.getTextContent(n))):s=e.decode(n,i),this.addObjectValue(t,a,s,i)}},mxObjectCodec.prototype.getFieldTemplate=function(e,n,t){return(e=e[n])instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(e,n,t,a){null!=t&&t!=a&&(null!=n&&0<n.length?e[n]=t:e.push(t))},mxObjectCodec.prototype.processInclude=function(e,n,t){if("include"!=n.nodeName)return!1;if(null!=(n=n.getAttribute("name")))try{var a=mxUtils.load(n).getDocumentElement();null!=a&&e.decode(a,t)}catch(e){}return!0},mxObjectCodec.prototype.beforeDecode=function(e,n,t){return n},mxObjectCodec.prototype.afterDecode=function(e,n,t){return t},mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return e.isCellCodec=function(){return!0},e.isExcluded=function(e,n,t,a){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||a&&"value"==n&&t.nodeType==mxConstants.NODETYPE_ELEMENT},e.afterEncode=function(e,n,t){if(null!=n.value&&n.value.nodeType==mxConstants.NODETYPE_ELEMENT){var a=t;(t=mxClient.IS_IE?n.value.cloneNode(!0):e.document.importNode(n.value,!0)).appendChild(a),e=a.getAttribute("id"),t.setAttribute("id",e),a.removeAttribute("id")}return t},e.beforeDecode=function(e,n,t){var a=n,i=this.getName();if(n.nodeName!=i?(null!=(a=n.getElementsByTagName(i)[0])&&a.parentNode==n?(mxUtils.removeWhitespace(a,!0),mxUtils.removeWhitespace(a,!1),a.parentNode.removeChild(a)):a=null,t.value=n.cloneNode(!0),null!=(n=t.value.getAttribute("id"))&&(t.setId(n),t.value.removeAttribute("id"))):t.setId(n.getAttribute("id")),null!=a)for(n=0;n<this.idrefs.length;n++){i=this.idrefs[n];var s=a.getAttribute(i);if(null!=s){a.removeAttribute(i);var o=e.objects[s]||e.lookup(s);null==o&&(null!=(s=e.getElementById(s))&&(o=(mxCodecRegistry.codecs[s.nodeName]||this).decode(e,s))),t[i]=o}}return a},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphModel);return e.encodeObject=function(e,n,t){var a=e.document.createElement("root");e.encodeCell(n.getRoot(),a),t.appendChild(a)},e.decodeChild=function(e,n,t){"root"==n.nodeName?this.decodeRoot(e,n,t):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeRoot=function(e,n,t){var a=null;for(n=n.firstChild;null!=n;){var i=e.decodeCell(n);null!=i&&null==i.getParent()&&(a=i),n=n.nextSibling}null!=a&&t.setRoot(a)},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return e.afterEncode=function(e,n,t){return e.encodeCell(n.root,t),t},e.beforeDecode=function(e,n,t){if(null!=n.firstChild&&n.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(n=n.cloneNode(!0)).firstChild;for(t.root=e.decodeCell(a,!1),t=a.nextSibling,a.parentNode.removeChild(a),a=t;null!=a;)t=a.nextSibling,e.decodeCell(a),a.parentNode.removeChild(a),a=t}return n},e.afterDecode=function(e,n,t){return t.previous=t.root,t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return e.isReference=function(e,n,t,a){return!("child"!=n||null==e.previous&&a)||0<=mxUtils.indexOf(this.idrefs,n)},e.afterEncode=function(e,n,t){return this.isReference(n,"child",n.child,!0)?t.setAttribute("child",e.getId(n.child)):e.encodeCell(n.child,t),t},e.beforeDecode=function(e,n,t){if(null!=n.firstChild&&n.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(n=n.cloneNode(!0)).firstChild;for(t.child=e.decodeCell(a,!1),t=a.nextSibling,a.parentNode.removeChild(a),a=t;null!=a;){if(t=a.nextSibling,a.nodeType==mxConstants.NODETYPE_ELEMENT){var i=a.getAttribute("id");null==e.lookup(i)&&e.decodeCell(a)}a.parentNode.removeChild(a),a=t}}else a=n.getAttribute("child"),t.child=e.getObject(a);return n},e.afterDecode=function(e,n,t){return t.child.parent=t.previous,t.previous=t.parent,t.previousIndex=t.index,t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return e.afterDecode=function(e,n,t){return t.previous=t.terminal,t},e}());var mxGenericChangeCodec=function(e,a){var n=new mxObjectCodec(e,["model","previous"],["cell"]);return n.afterDecode=function(e,n,t){return mxUtils.isNode(t.cell)&&(t.cell=e.decodeCell(t.cell,!1)),t.previous=t[a],t},n};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphView);return e.encode=function(e,n){return this.encodeCell(e,n,n.graph.getModel().getRoot())},e.encodeCell=function(e,n,t){var a=n.graph.getModel(),i=n.getState(t),s=a.getParent(t);if(null==s||null!=i){var o=a.getChildCount(t),r=n.graph.getCellGeometry(t),l=null;if(s==a.getRoot()?l="layer":null==s?l="graph":a.isEdge(t)?l="edge":0<o&&null!=r?l="group":a.isVertex(t)&&(l="vertex"),null!=l){var d=e.document.createElement(l);if(null!=n.graph.getLabel(t)&&(d.setAttribute("label",n.graph.getLabel(t)),n.graph.isHtmlLabel(t)&&d.setAttribute("html",!0)),null==s){var c=n.getGraphBounds();null!=c&&(d.setAttribute("x",Math.round(c.x)),d.setAttribute("y",Math.round(c.y)),d.setAttribute("width",Math.round(c.width)),d.setAttribute("height",Math.round(c.height))),d.setAttribute("scale",n.scale)}else if(null!=i&&null!=r){for(c in i.style)"function"==typeof(s=i.style[c])&&"object"==typeof s&&(s=mxStyleRegistry.getName(s)),null!=s&&"function"!=typeof s&&"object"!=typeof s&&d.setAttribute(c,s);if(null!=(s=i.absolutePoints)&&0<s.length){for(r=Math.round(s[0].x)+","+Math.round(s[0].y),c=1;c<s.length;c++)r+=" "+Math.round(s[c].x)+","+Math.round(s[c].y);d.setAttribute("points",r)}else d.setAttribute("x",Math.round(i.x)),d.setAttribute("y",Math.round(i.y)),d.setAttribute("width",Math.round(i.width)),d.setAttribute("height",Math.round(i.height));null!=(c=i.absoluteOffset)&&(0!=c.x&&d.setAttribute("dx",Math.round(c.x)),0!=c.y&&d.setAttribute("dy",Math.round(c.y)))}for(c=0;c<o;c++)null!=(i=this.encodeCell(e,n,a.getChildAt(t,c)))&&d.appendChild(i)}}return d},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxStylesheet);return e.encode=function(e,n){var t,a=e.document.createElement(this.getName());for(t in n.styles){var i=n.styles[t],s=e.document.createElement("add");if(null!=t){for(var o in s.setAttribute("as",t),i){var r=this.getStringValue(o,i[o]);if(null!=r){var l=e.document.createElement("add");l.setAttribute("value",r),l.setAttribute("as",o),s.appendChild(l)}}0<s.childNodes.length&&a.appendChild(s)}}return a},e.getStringValue=function(e,n){var t=typeof n;return"function"==t?n=mxStyleRegistry.getName(style[j]):"object"==t&&(n=null),n},e.decode=function(e,n,t){t=t||new this.template.constructor;var a=n.getAttribute("id");for(null!=a&&(e.objects[a]=t),n=n.firstChild;null!=n;){if(!this.processInclude(e,n,t)&&"add"==n.nodeName&&null!=(a=n.getAttribute("as"))){var i=n.getAttribute("extend"),s=null!=i?mxUtils.clone(t.styles[i]):null;for(null==s&&(null!=i&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+i+" not found to extend"),s={}),i=n.firstChild;null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT){var o=i.getAttribute("as");if("add"==i.nodeName){var r=mxUtils.getTextContent(i),l=null;null!=r&&0<r.length?l=mxUtils.eval(r):(l=i.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l))),null!=l&&(s[o]=l)}else"remove"==i.nodeName&&delete s[o]}i=i.nextSibling}t.putCellStyle(a,s)}n=n.nextSibling}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultKeyHandler);return e.encode=function(e,n){return null},e.decode=function(e,n,t){if(null!=t)for(n=n.firstChild;null!=n;){if(!this.processInclude(e,n,t)&&"add"==n.nodeName){var a=n.getAttribute("as"),i=n.getAttribute("action"),s=n.getAttribute("control");t.bindAction(a,i,s)}n=n.nextSibling}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultToolbar);return e.encode=function(e,n){return null},e.decode=function(e,n,t){if(null!=t){var a=t.editor;for(n=n.firstChild;null!=n;){if(n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,n,t))if("separator"==n.nodeName)t.addSeparator();else if("br"==n.nodeName)t.toolbar.addBreak();else if("hr"==n.nodeName)t.toolbar.addLine();else if("add"==n.nodeName){var i=n.getAttribute("as"),s=(i=mxResources.get(i)||i,n.getAttribute("icon")),o=n.getAttribute("pressedIcon"),r=n.getAttribute("action"),l=n.getAttribute("mode"),d=n.getAttribute("template"),c="0"!=n.getAttribute("toggle"),m=mxUtils.getTextContent(n),u=null;if(null!=r)u=t.addItem(i,s,r,o);else if(null!=l){var p=mxUtils.eval(m);u=t.addMode(i,s,l,o,p)}else if(null!=d||null!=m&&0<m.length)u=a.templates[d],d=n.getAttribute("style"),null!=u&&null!=d&&(u=u.clone()).setStyle(d),(d=null)!=m&&0<m.length&&(d=mxUtils.eval(m)),u=t.addPrototype(i,s,u,o,d,c);else if(0<(o=mxUtils.getChildNodes(n)).length)if(null==s)for(d=t.addActionCombo(i),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?t.addOption(d,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),c=c.getAttribute("action"),t.addActionOption(d,s,c));else{var g=null,v=t.addPrototype(i,s,function(){if(null==(e=a.templates[g.value]))return mxLog.warn("Template "+e+" not found"),null;var e=e.clone(),n=g.options[g.selectedIndex].cellStyle;return null!=n&&e.setStyle(n),e},null,null,c);g=t.addCombo();for(mxEvent.addListener(g,"change",function(){t.toolbar.selectMode(v,function(e){return e=mxUtils.convertPoint(a.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a.addVertex(null,p(),e.x,e.y)}),t.toolbar.noReset=!1}),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?t.addOption(g,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),m=c.getAttribute("template"),t.addOption(g,s,m||d).cellStyle=c.getAttribute("style"))}null!=u&&(null!=(d=n.getAttribute("id"))&&0<d.length&&u.setAttribute("id",d))}n=n.nextSibling}}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultPopupMenu);return e.encode=function(e,n){return null},e.decode=function(e,n,t){var a=n.getElementsByTagName("include")[0];return null!=a?this.processInclude(e,a,t):null!=t&&(t.config=n),t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxEditor,"modified lastSnapshot ignoredChanges undoManager graphContainer toolbarContainer".split(" "));return e.afterDecode=function(e,n,t){return null!=(e=n.getAttribute("defaultEdge"))&&(n.removeAttribute("defaultEdge"),t.defaultEdge=t.templates[e]),null!=(e=n.getAttribute("defaultGroup"))&&(n.removeAttribute("defaultGroup"),t.defaultGroup=t.templates[e]),t},e.decodeChild=function(e,n,t){if("Array"==n.nodeName){if("templates"==n.getAttribute("as"))return void this.decodeTemplates(e,n,t)}else if("ui"==n.nodeName)return void this.decodeUi(e,n,t);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeUi=function(e,n,t){for(e=n.firstChild;null!=e;){if("add"==e.nodeName){n=e.getAttribute("as");var a=e.getAttribute("element"),i=e.getAttribute("style"),s=null;if(null!=a)null!=(s=document.getElementById(a))&&null!=i&&(s.style.cssText+=";"+i);else{a=parseInt(e.getAttribute("x"));var o=parseInt(e.getAttribute("y")),r=e.getAttribute("width"),l=e.getAttribute("height");(s=document.createElement("div")).style.cssText=i,new mxWindow(mxResources.get(n)||n,s,a,o,r,l,!1,!0).setVisible(!0)}"graph"==n?t.setGraphContainer(s):"toolbar"==n?t.setToolbarContainer(s):"title"==n?t.setTitleContainer(s):"status"==n?t.setStatusContainer(s):"map"==n&&t.setMapContainer(s)}else"resource"==e.nodeName?mxResources.add(e.getAttribute("basename")):"stylesheet"==e.nodeName&&mxClient.link("stylesheet",e.getAttribute("name"));e=e.nextSibling}},e.decodeTemplates=function(e,n,t){null==t.templates&&(t.templates=[]),n=mxUtils.getChildNodes(n);for(var a=0;a<n.length;a++){for(var i=n[a].getAttribute("as"),s=n[a].firstChild;null!=s&&1!=s.nodeType;)s=s.nextSibling;null!=s&&(t.templates[i]=e.decodeCell(s))}},e}()),EditorUi=function(e,n,t){this.projectDesignController=e,this.editor=n||new Editor,this.container=t||document.body;var a=n.graph,i=this;CRUD_PERMISSIONS=this.projectDesignController.crudPermissions;var s=mxUtils.bind(this,function(e){return null==e&&(e=window.event),!!this.isEditingEnabled()&&a.isEditing()});this.container.style.overflow="hidden",(new Image).src=mxPopupMenu.prototype.submenuImage,null!=mxConnectionHandler.prototype.connectImage&&((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.actions=new Actions(this),this.menus=new Menus(this),this.createDivs(),this.refresh(),this.createUi(),this.container==document.body&&(this.menubarContainer.onselectstart=s,this.menubarContainer.onmousedown=s,this.toolbarContainer.onselectstart=s,this.toolbarContainer.onmousedown=s,this.diagramContainer.onselectstart=s,this.diagramContainer.onmousedown=s,this.sidebarContainer.onselectstart=s,this.sidebarContainer.onmousedown=s,this.footerContainer.onselectstart=s,this.footerContainer.onmousedown=s),mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?(mxEvent.addListener(this.diagramContainer,"contextmenu",s),mxEvent.addListener(this.sidebarContainer,"contextmenu",s)):(this.diagramContainer.oncontextmenu=s,this.sidebarContainer.oncontextmenu=s),a.init(this.diagramContainer),a.refresh(),a.setEnabled(this.isEditingEnabled()),a.container.setAttribute("tabindex","0"),a.container.style.cursor="default",a.container.style.backgroundImage="url("+n.gridImage+")",a.container.style.backgroundPosition="-1px -1px",a.container.focus();var o=a.fireMouseEvent;a.fireMouseEvent=function(e,n,t){e==mxEvent.MOUSE_DOWN&&this.container.focus(),o.apply(this,arguments)},this.createMultiplicities(a.multiplicities,["start","finally","end"],[[1,1],[1,1],[0,0]],[[0,0],[0,0],[1,"n"]]),this.createMultiplicities(a.multiplicities,["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[[1,1],[0,0],[0,1],[0,1],[0,1],[1,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["login","pause","unpause","logout"],[[1,2],[1,2],[1,2],[1,2]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["set","math"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["background","playback","menu","saydigits","saynumber","sayphonetic","google_cloud_tts","tts","ispeechtts","awspolly","getdigits","getsecretdigits","lumenvoxtts","sestektts","mrcpsynth"],[[1,"n"],[1,1],[1,"n"],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,"n"],[1,"n"],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["record"],[[1,1]],[[1,"n"]]),this.createMultiplicities(a.multiplicities,["database","ispeechasr","sendSMS","sendMail","sendFax","googleasr","lumenvoxasr","tildeasr","dialogflow","dialogflowV2","awslex","sesteknda","sestekasr","restapi","mrcprecog"],[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["gotoc","gotoif","gotoiftime","vswitch"],[[0,0],[1,2],[1,2],[1,"n"]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["queuelog","goal"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["noop","system","agi","subproject","custom_app"],[[1,1],[1,1],[0,1],[0,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),a.dblClick=function(e,t){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",t);this.fireEvent(n),mxEvent.isConsumed(e)||n.isConsumed()||(this.getModel().isEdge(t)?0<=["background","gotoif","gotoiftime","menu","getdigits","getsecretdigits","vswitch","login","pause","unpause","logout"].indexOf(t.source.value.tagName)&&this.startEditingAtCell(t):this.getModel().isVertex(t)&&i.projectDesignController.openDialog(t.getValue(),function(e){for(var n=0;n<e.length;n+=1)t.setAttribute(e[n].name,e[n].value);a.refresh(t)}),n.consume())},a.panningHandler.autoExpand=!0,a.panningHandler.factoryMethod=mxUtils.bind(this,function(e,n,t){this.isEditingEnabled()&&this.menus.createPopupMenu(e,n,t)}),n.outline.init(this.outlineContainer),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){a.panningHandler.hideMenu()})),mxClient.IS_TOUCH&&(mxEvent.addListener(a.container,"gesturechange",mxUtils.bind(this,function(e){a.view.getDrawPane().setAttribute("transform","scale("+e.scale+")"),a.view.getOverlayPane().style.visibility="hidden"})),mxEvent.addListener(a.container,"gestureend",mxUtils.bind(this,function(e){a.view.getDrawPane().removeAttribute("transform"),a.zoomToCenter=!0,a.zoom(e.scale),a.view.getOverlayPane().style.visibility="visible"})));var r=this.isEditingEnabled()?this.createKeyHandler(n):null;this.getKeyHandler=function(){return r},mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.refresh(),a.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.init(),this.open(),this.refresh()},EditorUi.prototype.splitSize=mxClient.IS_TOUCH?16:8,EditorUi.prototype.menubarHeight=33,EditorUi.prototype.toolbarHeight=36,EditorUi.prototype.footerHeight=0,EditorUi.prototype.hsplitPosition=204,EditorUi.prototype.vsplitPosition=190,EditorUi.prototype.init=function(){this.addUndoListener(),this.addSelectionListener();var e=this.actions.get("paste"),n=function(){e.setEnabled(!mxClipboard.isEmpty())},t=mxClipboard.cut;mxClipboard.cut=function(){t.apply(this,arguments),n()};var a=mxClipboard.copy;mxClipboard.copy=function(){a.apply(this,arguments),n()}},EditorUi.prototype.isEditingEnabled=function(){return!!CRUD_PERMISSIONS.canEdit},EditorUi.prototype.exportXML=function(e){var n=window.document.createElement("a");n.href="data:attachment/text;charset=utf-8,"+encodeURIComponent(e),n.download=this.editor.filename+".xml",n.target="_self",n.click()},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(e,n){try{var t=mxUtils.parseXml(e);this.editor.setGraphXml(t.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=n&&(this.editor.filename=n)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(e){}},EditorUi.prototype.openString=function(e,n,t){try{var a=mxUtils.parseXml(e);this.editor.setGraphXml(a.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=n&&(this.editor.filename=n),null!=t&&(this.editor.data=t)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}},EditorUi.prototype.validate=function(e,n){for(var t=this.editor.graph,a=(e=null!=e?e:t.model.getRoot(),n=null!=n?n:{},!0),i=t.model.getChildCount(e),s=0;s<i;s++){var o=t.model.getChildAt(e,s),r=n;t.isValidRoot(o)&&(r={}),null!=(r=this.validate(o,r))?t.setCellWarning(o,r.replace(/\n/g,"<br>")):t.setCellWarning(o,null),a=a&&null==r}if(i="",t.model.isVertex(e))switch(e.value.nodeName){case"start":i=this.validateBlock("start")?"":"Only one Start block is allowed\n";break;case"finally":i=this.validateBlock("finally")?"":"Only one Finally block is allowed\n";break;case"playback":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n";break;case"answer":i=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"menu":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("digit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("response")?"":mxResources.get("invalidTimeout")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getsecretdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("hiddendigitsnum")?"":mxResources.get("wrongHiddenDigitsnum")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"vswitch":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"database":i=0<e.value.getAttribute("odbc_id")?"":mxResources.get("noDatabaseSelected")+"\n",i+=""!==e.value.getAttribute("query")?"":mxResources.get("missingQuery")+"\n";break;case"set":case"math":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"gotoc":i=""!==e.value.getAttribute("context")?"":mxResources.get("noContextSelected")+"\n",i+=""!==e.value.getAttribute("extension")?"":mxResources.get("noExtensionSelected")+"\n",i+=1<=e.value.getAttribute("priority")?"":mxResources.get("invalidPriority")+"\n";break;case"system":case"agi":i=""!==e.value.getAttribute("command")?"":mxResources.get("noCommandSelected")+"\n";break;case"gotoif":i=""!==e.value.getAttribute("condition")?"":mxResources.get("noConditionSelected")+"\n";break;case"saydigits":i=""!==e.value.getAttribute("digits")?"":mxResources.get("noDigitsSelected")+"\n";break;case"saynumber":i=""!==e.value.getAttribute("number")?"":mxResources.get("noNumberSelected")+"\n";break;case"sayphonetic":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"record":i=""!==e.value.getAttribute("file")?"":mxResources.get("noFileSelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"goal":i=""!==e.value.getAttribute("goalname")?"":mxResources.get("noGoalSelected")+"\n";break;case"ext_dial":i="-1"!==e.value.getAttribute("trunk_name")?"":mxResources.get("noTrunkSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"dial":i=0<e.value.getAttribute("sip_id")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"queue":i="-1"!==e.value.getAttribute("queue_id")?"":mxResources.get("noQueueSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"callback":i="-1"!==e.value.getAttribute("list_id")?"":mxResources.get("noListSelected")+"\n",i+=""!==e.value.getAttribute("name")?"":mxResources.get("noFirstNameSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noPhoneSelected")+"\n",i+=""!==e.value.getAttribute("delay")?"":mxResources.get("invalidDelay")+"\n";break;case"gotoiftime":i=0<e.value.getAttribute("interval_id")?"":mxResources.get("noIntervalSelected")+"\n";break;case"voicemail":i=""!==e.value.getAttribute("mailbox")?"":mxResources.get("noBoxNumberSelected")+"\n";break;case"subproject":i=0<e.value.getAttribute("project_id")?"":mxResources.get("noProjectSelected")+"\n";break;case"sendSMS":i=0<e.value.getAttribute("sms_account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("sms_text")?"":mxResources.get("noTextSelected")+"\n";break;case"sendMail":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n";break;case"sendFax":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("attachment_path")?"":mxResources.get("noAttachmentSelected")+"\n";break;case"google_cloud_tts":i=""!==e.value.getAttribute("apiKey")?"":mxResources.get("noApiKeySelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"tts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"awspolly":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i+=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"awslex":i=""!==e.value.getAttribute("aws_bot_name")?"":mxResources.get("noNameSelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i+=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"ispeechtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-10<=e.value.getAttribute("speed")&&e.value.getAttribute("speed")<=10?"":mxResources.get("invalidSpeed")+"\n";break;case"lumenvoxtts":case"sestektts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"lumenvoxasr":case"sestekasr":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"ispeechasr":case"googleasr":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"tildeasr":i=""!==e.value.getAttribute("appid")?"":mxResources.get("noAppIdInserted")+"\n",i+=""!==e.value.getAttribute("appsecret")?"":mxResources.get("noAppSecretInserted")+"\n",i+=""!==e.value.getAttribute("uri")?"":mxResources.get("noUrlInserted")+"\n";break;case"custom_app":i=""!==e.value.getAttribute("application")?"":mxResources.get("noApplicationSelected")+"\n";break;case"login":case"pause":case"unpause":case"logout":i=""!==e.value.getAttribute("findBy")?"":mxResources.get("noFindBySelected")+"\n";break;case"sesteknda":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("ndauth_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("ndassistant_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("username")?"":mxResources.get("noUsernameSelected")+"\n",i+=""!==e.value.getAttribute("password")?"":mxResources.get("noPasswordSelected")+"\n";break;case"restapi":i=""!==e.value.getAttribute("url")?"":mxResources.get("noUrlSelected")+"\n",i+=""!==e.value.getAttribute("method")?"":mxResources.get("noMethodSelected")+"\n";case"mrcpsynth":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"mrcprecog":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"dialogflow":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("dialogflow_language")?"":mxResources.get("noDialogflowLanguageSelected")+"\n";break;case"dialogflowV2":i=""!==e.value.getAttribute("dialogflowV2_project_id")?"":mxResources.get("noDialogflowProjectSelected")+"\n",i+=""!==e.value.getAttribute("client_email")?"":mxResources.get("noClientEmailSelected")+"\n",i+=""!==e.value.getAttribute("private_key")?"":mxResources.get("noPrivateKeySelected")+"\n",i+=""!==e.value.getAttribute("dialogflowV2_language")?"":mxResources.get("noDialogflowLanguageSelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n"}if(t.model.isEdge(e))switch(t.model.getCell(e.source.getId()).value.nodeName){case"background":case"menu":if(void 0!==e.getValue()){var l=/^[0-9]+$|^[-]{1}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/;String(e.getValue()).split(",").forEach(function(e){i+=l.test(e)?"":mxResources.get("numberOrAll")+"\n"})}else i=i+mxResources.get("numberOrAll")+"\n";break;case"getsecretdigits":case"getdigits":if(void 0!==e.getValue())i+=(l=/^(x|i|-)$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrDefault")+"\n";else i=i+mxResources.get("numberOrInvalidOrDefault")+"\n";break;case"gotoif":case"gotoiftime":if(void 0!==e.getValue())i+=(l=/^(true){1}$|^(false){1}$/).test(String(e.getValue()))?"":mxResources.get("trueOrFalse")+"\n";else i=i+mxResources.get("trueOrFalse")+"\n";break;case"login":case"pause":case"unpause":case"logout":if(void 0!==e.getValue())i+=(l=/^(success){1}$|^(failure){1}$/).test(String(e.getValue()))?"":mxResources.get("successOrFailure")+"\n";else i=i+mxResources.get("successOrFailure")+"\n"}return t.isCellCollapsed(e)&&!a&&(i+=(mxResources.get(t.containsValidationErrorsResource)||t.containsValidationErrorsResource)+"\n"),i=t.model.isEdge(e)?i+(t.getEdgeValidationError(e,t.model.getTerminal(e,!0),t.model.getTerminal(e,!1))||""):i+(t.getCellValidationError(e)||""),null!=(s=t.validateCell(e,n))&&(i+=s),null==t.model.getParent(e)&&t.view.validate(),0<i.length||!a?i:null},EditorUi.prototype.validateBlock=function(n){var t=this.editor.graph,e=t.getDefaultParent(),a=0;return e.children.forEach(function(e){t.model.isVertex(e)&&e.value.nodeName==n&&a++}),!(1<a)},EditorUi.prototype.getUrl=function(e){var n=null!=e?e:window.location.pathname,t=0<n.indexOf("?")?1:0;for(var a in urlParams)n+=0==t?"?":"&",n+=a+"="+urlParams[a],t++;return n},EditorUi.prototype.addUndoListener=function(){var e=this.actions.get("undo"),n=this.actions.get("redo"),t=this.editor.undoManager,a=function(){e.setEnabled(t.canUndo()),n.setEnabled(t.canRedo())};t.addListener(mxEvent.ADD,a),t.addListener(mxEvent.UNDO,a),t.addListener(mxEvent.REDO,a),t.addListener(mxEvent.CLEAR,a),a()},EditorUi.prototype.addSelectionListener=function(){var e=mxUtils.bind(this,function(){var e=this.editor.graph,n=!e.isSelectionEmpty(),t=!1,a=!1,i=e.getSelectionCells();if(null!=i)for(var s=0;s<i.length;s++){var o=i[s];if(e.getModel().isEdge(o)&&(a=!0),e.getModel().isVertex(o)&&(t=!0),a&&t)break}var r=["cut","copy","delete","duplicate","bold","italic","style","underline","toFront","toBack","dashed","rounded","shadow","tilt","autosize"];for(s=0;s<r.length;s++)this.actions.get(r[s]).setEnabled(n);this.actions.get("curved").setEnabled(a),this.actions.get("rotation").setEnabled(t),this.actions.get("wordWrap").setEnabled(t),this.actions.get("group").setEnabled(1<e.getSelectionCount()),this.actions.get("ungroup").setEnabled(1==e.getSelectionCount()&&0<e.getModel().getChildCount(e.getSelectionCell()));var l=t&&1==e.getSelectionCount();this.actions.get("removeFromGroup").setEnabled(l&&e.getModel().isVertex(e.getModel().getParent(e.getSelectionCell())));var d=["fontFamily","fontSize","alignment","position","text","format","arrange","linewidth","spacing"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(n);d=["line","lineend","linestart"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(a);this.actions.get("setAsDefaultEdge").setEnabled(a),this.menus.get("align").setEnabled(1<e.getSelectionCount()),this.menus.get("direction").setEnabled(t||a&&e.isLoop(e.view.getState(e.getSelectionCell()))),this.menus.get("navigation").setEnabled(e.foldingEnabled&&(null!=e.view.currentRoot||1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell()))),this.actions.get("home").setEnabled(null!=e.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=e.view.currentRoot);var c=1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell());this.actions.get("enterGroup").setEnabled(c),this.actions.get("expand").setEnabled(c),this.actions.get("collapse").setEnabled(c),this.actions.get("editLink").setEnabled(1==e.getSelectionCount()),this.actions.get("openLink").setEnabled(1==e.getSelectionCount()&&null!=e.getLinkForCell(e.getSelectionCell()))});this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},EditorUi.prototype.refresh=function(){var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),n=this.container.clientWidth+390,t=this.container.clientHeight+190;this.container==document.body&&(n=document.body.clientWidth||document.documentElement.clientWidth,t=e&&document.body.clientHeight||document.documentElement.clientHeight);var a=Math.max(0,Math.min(this.hsplitPosition,n-this.splitSize-20)),i=Math.max(0,Math.min(this.vsplitPosition,t-this.menubarHeight-this.toolbarHeight-this.splitSize-1));this.menubarContainer.style.height=this.menubarHeight+"px",this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px";var s=this.menubarHeight+this.toolbarHeight;if(mxClient.IS_QUIRKS||(s+=1),this.sidebarContainer.style.top=s+"px",this.sidebarContainer.style.width=a+"px",this.outlineContainer.style.width=a+"px",this.outlineContainer.style.height=i+"px",this.diagramContainer.style.left=this.isEditingEnabled()?a+this.splitSize+"px":"0px",this.diagramContainer.style.top=this.sidebarContainer.style.top,this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.outlineContainer.style.bottom,this.hsplit.style.left=a+"px",this.vsplit.style.width=this.sidebarContainer.style.width,this.vsplit.style.bottom=i+this.footerHeight+"px",e){this.menubarContainer.style.width=n+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var o=t-i-this.splitSize-this.menubarHeight-this.toolbarHeight;this.sidebarContainer.style.height=o+"px",this.diagramContainer.style.width=n-a-this.splitSize+"px";var r=t-this.menubarHeight-this.toolbarHeight;this.diagramContainer.style.height=r+"px",this.hsplit.style.height=r+"px"}else this.sidebarContainer.style.bottom=i+this.splitSize+"px",this.diagramContainer.style.bottom=this.outlineContainer.style.bottom},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.outlineContainer=this.createDiv("geOutlineContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.vsplit=this.createDiv("geVsplit"),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.outlineContainer.style.bottom="0px",this.outlineContainer.style.left="0px",this.diagramContainer.style.overflow="scroll",this.diagramContainer.style.right="0px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.vsplit.style.left="0px",this.vsplit.style.height=this.splitSize+"px",this.hsplit.style.width=this.splitSize+"px"},EditorUi.prototype.createUi=function(){this.menubar=this.menus.createMenubar(this.createDiv("geMenubar")),this.menubarContainer.appendChild(this.menubar.container),this.toolbar=this.createToolbar(this.createDiv("geToolbar")),this.toolbarContainer.appendChild(this.toolbar.container),this.sidebar=this.createSidebar(this.sidebarContainer),this.footerContainer.appendChild(this.createFooter()),this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.isEditingEnabled()&&(this.container.appendChild(this.sidebarContainer),this.container.appendChild(this.hsplit),this.container.appendChild(this.vsplit)),this.container.appendChild(this.diagramContainer),this.container.appendChild(this.menubarContainer),this.container.appendChild(this.toolbarContainer),this.container.appendChild(this.outlineContainer),this.container.appendChild(this.footerContainer),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e,this.refresh(),this.editor.graph.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.addSplitHandler(this.vsplit,!1,this.footerHeight,mxUtils.bind(this,function(e){this.vsplitPosition=e,this.refresh(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()}))},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.setStatusText=function(e){this.statusContainer.innerHTML=e},EditorUi.prototype.createToolbar=function(e){return new Toolbar(this,e)},EditorUi.prototype.createSidebar=function(e){return new Sidebar(this,e)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(e){var n=document.createElement("div");return n.className=e,n},EditorUi.prototype.createHeader=function(e){return document.createElement(e)},EditorUi.prototype.createForm=function(e){var n=document.createElement("form");return n.className=e,n},EditorUi.prototype.addSplitHandler=function(n,t,a,i){var s=null,o=null;function r(e){if(null!=s){var n=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));i(Math.max(0,o+(t?n.x-s.x:s.y-n.y)-a)),mxEvent.consume(e)}}function e(e){r(e),o=s=null}mxEvent.addGestureListeners(n,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),o=parseInt(t?n.style.left:n.style.bottom),mxEvent.consume(e)}),mxEvent.addListener(document,"mousemove",r),mxEvent.addListener(document,"touchmove",r),mxEvent.addListener(document,"mouseup",e),mxEvent.addListener(document,"touchend",e)},EditorUi.prototype.executeLayout=function(e,n,t){var a=this.editor.graph,i=a.getSelectionCell();n=null!=this.animate?this.animate:n,a.getModel().beginUpdate();try{e.execute(a.getDefaultParent(),i)}catch(e){throw e}finally{if(n&&navigator.userAgent.indexOf("Camino")<0){var s=new mxMorphing(a);s.addListener(mxEvent.DONE,mxUtils.bind(this,function(){a.getModel().endUpdate()})),s.startAnimation()}else a.getModel().endUpdate()}},EditorUi.prototype.createKeyHandler=function(e){var a=this.editor.graph,o=new mxKeyHandler(a);function n(e){if(!a.isSelectionEmpty()){var n=0,t=0;37==e?n=-1:38==e?t=-1:39==e?n=1:40==e&&(t=1),a.moveCells(a.getSelectionCells(),n,t),a.scrollCellToVisible(a.getSelectionCell())}}o.isControlDown=function(e){return mxEvent.isControlDown(e)||mxClient.IS_MAC&&e.metaKey};var t=mxUtils.bind(this,function(e,n,t,a){var i=this.actions.get(t);if(null!=i){var s=function(){i.enabled&&i.funct()};n?a?o.bindControlShiftKey(e,s):o.bindControlKey(e,s):a?o.bindShiftKey(e,s):o.bindKey(e,s)}});return o.enter=function(){},o.bindKey(8,function(){a.foldCells(!0)}),o.bindKey(13,function(){a.foldCells(!1)}),o.bindKey(33,function(){a.exitGroup()}),o.bindKey(34,function(){a.enterGroup()}),o.bindKey(36,function(){a.home()}),o.bindKey(35,function(){a.refresh()}),o.bindKey(37,function(){n(37)}),o.bindKey(38,function(){n(38)}),o.bindKey(39,function(){n(39)}),o.bindKey(40,function(){n(40)}),o.bindKey(113,function(){a.startEditingAtCell()}),t(46,!1,"delete"),t(82,!0,"tilt"),t(83,!0,"save"),t(83,!0,"saveAs",!0),t(107,!1,"zoomIn"),t(109,!1,"zoomOut"),t(65,!0,"selectAll"),t(86,!0,"selectVertices",!0),t(69,!0,"selectEdges",!0),t(69,!0,"export"),t(66,!0,"toBack"),t(70,!0,"toFront"),t(68,!0,"duplicate"),t(90,!0,"undo"),t(89,!0,"redo"),t(88,!0,"cut"),t(67,!0,"copy"),t(81,!0,"connect"),t(86,!0,"paste"),t(71,!0,"group"),t(71,!0,"grid",!0),t(85,!0,"ungroup"),t(112,!1,"about"),t(80,!0,"publish",!0),o},EditorUi.prototype.createMultiplicities=function(e,n,t,a){for(var i=0;i<n.length;i++)e.push(new mxMultiplicity(!0,n[i],null,null,t[i][0],t[i][1],null,mxResources.get(n[i])+mxResources.get("musthave")+t[i][0]+mxResources.get("outgoingedge"),null)),e.push(new mxMultiplicity(!1,n[i],null,null,a[i][0],a[i][1],null,mxResources.get(n[i])+mxResources.get("musthave")+a[i][0]+mxResources.get("incomingedge"),null))};var useLocalStorage=(mxClient.IS_TOUCH||"local"==urlParams.storage)&&"undefined"!=typeof localStorage,fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList,touchStyle=mxClient.IS_TOUCH||"1"==urlParams.touch,counter=0;try{for(var op=window;null!=op.opener&&!isNaN(op.opener.counter);)op=op.opener;null!=op&&(op.counter++,counter=op.counter)}catch(e){}function Sidebar(e,n){this.editorUi=e,this.container=n,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=new Graph(document.createElement("div"),null,null,this.editorUi.editor.graph.getStylesheet()),this.graph.resetViewOnRootChange=!1,this.graph.foldingEnabled=!1,this.graph.setConnectable(!1),this.graph.autoScroll=!1,this.graph.setTooltips(!1),this.graph.setEnabled(!1),this.graph.container.style.visibility="hidden",this.graph.container.style.position="absolute",this.graph.container.style.overflow="hidden",this.graph.container.style.height="1px",this.graph.container.style.width="1px",mxClient.IS_IE||mxClient.IS_IE11||(this.graph.container.style.display="none"),document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(e){for(var n=mxEvent.getSource(e);null!=n;){if(n==this.currentElt)return;n=n.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(e){null==e.toElement&&null==e.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(n,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0})),this.init(),mxClient.IS_SVG||((new Image).src=IMAGE_PATH+"/tooltip.png")}function Actions(e){this.editorUi=e,this.actions=new Object,this.init()}function Action(e,n,t,a,i){mxEventSource.call(this),this.label=e,this.funct=n,this.enabled=null==t||t,this.iconCls=a,this.shortcut=i}function Menubar(e,n){this.editorUi=e,this.container=n,mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function Menu(e,n){mxEventSource.call(this),this.funct=e,this.enabled=null==n||n}function Toolbar(e,n){this.editorUi=e,this.container=n,this.init(),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function createCheckbox(e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),e&&n.setAttribute("checked",!0),n}function createDropdownFromApi(e,t,a,i,n,s,o,r){var l=new XMLHttpRequest;l.open("GET",e,!1),l.setRequestHeader("Authorization","Bearer "+n.editor.data.token),l.send(null);var d=[];200===l.status&&(d=JSON.parse(l.response));var c=document.createElement("select"),m=document.createElement("option");return m.text="-- None --",m.value="-1",c.appendChild(m),d.rows.forEach(function(n){r&&n[a]==r||((m=document.createElement("option")).text=n[a],s&&o?(m.value=o,s.forEach(function(e){m.value=m.value.replace("%"+e+"%",n[e])}),m.selected=m.value==t):(m.value=n[i],m.selected=n[i]==t),c.appendChild(m))}),c.className="form-control select2",c}function createDropdownWithOptgroupFromApi(e,n,t,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");d.text="-- None --",d.value="-1",l.appendChild(d);var c=_.groupBy(r.rows,s);for(var m in c)if(c.hasOwnProperty(m)){var u=document.createElement("optgroup");u.label=_.capitalize(m),c[m].forEach(function(e){(d=document.createElement("option")).text=e[t],d.value=e[a],d.selected=e[a]==n,u.appendChild(d)}),l.appendChild(u)}return l.className="form-control select2",l}function createGroupedDropdownFromApi(e,n,t,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");return d.text="-- None --",d.value="0",l.appendChild(d),r.rows.forEach(function(e){(d=document.createElement("option")).className="select-group-father",d.text=e[t].toUpperCase(),d.value=e[a],d.selected=e[a]==n,l.appendChild(d),e[s].forEach(function(e){(d=document.createElement("option")).className="select-group-son",d.text="-"+_.capitalize(e[t]),d.value=e[a],d.selected=e[a]==n,l.appendChild(d)})}),l.className="form-control select2",l}function createDropdownFromArray(e,n){var t=document.createElement("select");for(var a in e){var i=document.createElement("option");i.text=e[a],i.value=a,(0<n||""!=n)&&(i.selected=n===a),t.appendChild(i)}return t.className="form-control select2",t}function createDropdownFromTigerDialList(e){var n=document.createElement("select"),t=[],a=new XMLHttpRequest;try{if(a.open("POST","/api/rest/list/list",!1),a.send(JSON.stringify({page:1,size:6e5})),200===a.status){var i=JSON.parse(a.response);if(0<i.status){var s=i.response.RMI.rows;for(var o in s)t[s[o].id]=s[o].name}}}catch(e){console.log(e)}for(var r in t){var l=document.createElement("option");l.text=t[r],l.value=r,(0<e||""!=e)&&(l.selected=e===r),n.appendChild(l)}return n.className="form-control select2",n}function Dialog(e,n,t,a,i,s,o){var r=0;mxClient.IS_IE&&9!=document.documentMode&&(r=60),t+=r,a+=r;Math.max(0,Math.round((document.body.scrollWidth-t)/2)),Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-a)/3));var l=e.createDiv("geDialog");l.className="modal fade in center",l.style.display="block",l.style.paddingRight="12px";var d=e.createDiv("geModalDialog");d.className="modal-dialog",d.appendChild(n),l.appendChild(d),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.className="modal-backdrop fade in",mxClient.IS_QUIRKS&&new mxDivResizer(this.bg)),i&&document.body.appendChild(this.bg),document.body.appendChild(l),this.onDialogClose=o,this.container=l}function ImportDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("import")+" XML");var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-12"),d=document.createElement("textarea");d.style.width="100%",d.style.height="374px";var c=document.createElement("input");c.type="file",c.setAttribute("accept","text/xml"),c.addEventListener("change",function(e){var n=e.target.files[0];if(console.log(n),n)if("text/xml"===n.type){var t=new FileReader;t.onload=function(e){var n=e.target.result;mxUtils.write(d,n)},t.readAsText(n)}else alert("Failed to load format file");else alert("Failed to load file")},!1),l.appendChild(c),l.appendChild(d),r.appendChild(l),a.appendChild(r);var m=mxUtils.button(mxResources.get("import"),mxUtils.bind(this,function(e){var n=mxUtils.parseXml(d.value);t.editor.setGraphXml(n.documentElement),t.hideDialog()}));m.className="btn blue";var u=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});u.className="btn default",i.appendChild(m),i.appendChild(u),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function AboutDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("about")+" Cally Square");var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=document.createElement("img");r.style.border="0px",r.setAttribute("width","176"),r.setAttribute("width","151"),r.setAttribute("src",IMAGE_PATH+"/logo.png"),a.appendChild(r),mxUtils.br(a),mxUtils.write(a,"Powered by Xenialab "+mxClient.VERSION),mxUtils.br(a);var l=document.createElement("a");l.setAttribute("href","http://www.callysquare.com/"),l.setAttribute("target","_blank"),mxUtils.write(l,"www.callysquare.com"),a.appendChild(l),mxUtils.br(a),mxUtils.br(a);var d=mxUtils.button(mxResources.get("close"),function(){e.hideDialog()});d.className="btn default",i.appendChild(d),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function SaveDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("saveAs"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_copy"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("save"),function(){e.saveAs(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function NewDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("new"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_new"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("new"),function(){e.new(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function DescriptionDialog(e){console.log(e.editor.data);var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("description"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="description",d=e.editor.data.description||"",c=e.createDiv("form-group"),m=document.createElement("label");m.className="col-sm-4 control-label",mxUtils.write(m,mxResources.get(l)),c.appendChild(m);var u=document.createElement("input");u.setAttribute("value",d),u.className="form-control",u.setAttribute("id","_description");var p=e.createDiv("col-sm-8");p.appendChild(u),c.appendChild(p),r.appendChild(c),a.appendChild(r);var g=mxUtils.button(mxResources.get("update"),function(){e.description(u.value),e.hideDialog()});g.className="btn blue";var v=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});v.className="btn default",i.appendChild(g),i.appendChild(v),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function VariableDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("variable"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="name",d="_"+l,c="variable name",m=e.createDiv("form-group"),u=document.createElement("label");u.className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var p=document.createElement("input");p.setAttribute("value",c),p.className="form-control",p.setAttribute("id",d);var g=e.createDiv("col-sm-8");g.appendChild(p),m.appendChild(g),r.appendChild(m),d="_"+(l="description"),c="variable description",m=e.createDiv("form-group last"),(u=document.createElement("label")).className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var v=document.createElement("input");v.setAttribute("value",c),v.className="form-control",v.setAttribute("id",d),(g=e.createDiv("col-sm-8")).appendChild(v),m.appendChild(g),r.appendChild(m),a.appendChild(r);var h=mxUtils.button(mxResources.get("new"),function(){e.variable(p.value,v.value),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function OpenDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("open"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("row"),l=e.createDiv("col-md-4"),d=e.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=new XMLHttpRequest;m.open("GET","/api/square/projects",!1),m.setRequestHeader("Authorization","Bearer "+e.editor.data.token),m.send(null);var u=[];200===m.status&&(u=JSON.parse(m.response));for(var p=document.createElement("select"),g=0;g<u.length;g++){var v=document.createElement("option");v.text=u[g].name,v.value=u[g].id,p.appendChild(v)}p.className="form-control",d.appendChild(p),r.appendChild(l),r.appendChild(d),a.appendChild(r);var h=mxUtils.button(mxResources.get("open"),function(){console.log(p),console.log(p.value),window.open("square/project/"+p.value,"_blank"),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function RenameDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("rename"));var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-4"),d=t.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=t.editor.filename,u=document.createElement("input");u.setAttribute("value",m),u.className="form-control",d.appendChild(u),r.appendChild(l),r.appendChild(d),a.appendChild(r);var p=mxUtils.button(mxResources.get("save"),function(){var n=new XMLHttpRequest;n.open("PUT",SAVE_URL+t.editor.data.id,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("Authorization","Bearer "+t.editor.data.token),n.send("name="+u.value),n.onload=function(e){200===n.status?(t.editor.setStatus("Project successfully renamed"),t.editor.filename=u.value):(console.log(n.response),t.editor.setStatus(JSON.parse(n.response).errors[0].message))},n.onerror=function(e){mxUtils.alert(n.statusText)},t.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function EditFileDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("edit"));var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("row"),l=n.createDiv("col-md-12"),d=document.createElement("textarea");if(d.style.width="100%",d.style.height="374px",d.value=mxUtils.getPrettyXml(n.editor.getGraphXml()),fileSupport){d.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault()},!1),d.addEventListener("drop",function(e){if(e.stopPropagation(),e.preventDefault(),0<e.dataTransfer.files.length){var n=e.dataTransfer.files[0],t=new FileReader;t.onload=function(e){d.value=e.target.result},t.readAsText(n)}},!1)}l.appendChild(d),r.appendChild(l),a.appendChild(r);var c=mxUtils.button(mxResources.get("save"),function(){var e=mxUtils.parseXml(d.value);n.editor.setGraphXml(e.documentElement),n.hideDialog()});c.className="btn blue";var m=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});m.className="btn default",i.appendChild(c),i.appendChild(m),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function ExportDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body form"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("export")+" XML");var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("form-horizontal form-row-seperated"),l=n.createDiv("form-group last"),d=document.createElement("label");d.className="col-sm-4 control-label",mxUtils.write(d,mxResources.get("filename"));var c=document.createElement("input");c.setAttribute("value",n.editor.getOrCreateFilename()),c.className="form-control";var m=n.createDiv("col-sm-8");m.appendChild(c),l.appendChild(d),l.appendChild(m),r.appendChild(l),a.appendChild(r);var u=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(e){n.save(!1);encodeURIComponent(mxUtils.getXml(n.editor.getGraphXml()));new mxXmlRequest(SAVE_URL+n.editor.data.id+"/download","filename="+c.value,"GET").simulate(document,"_blank"),n.hideDialog()}));u.className="btn blue";var p=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});p.className="btn default",i.appendChild(u),i.appendChild(p),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function GeneralDialog(i,s){console.log("general");var o=i.editor.graph,e=i.createDiv("md-dialog"),n=i.createDiv("md-toolbar"),t=i.createDiv("md-dialog-content"),a=i.createDiv("md-dialog-actions"),r=i.createHeader("h4");mxUtils.write(r,mxResources.get("edit")+" "+mxResources.get(s.value.nodeName));var l=mxUtils.button("",function(){i.hideDialog()});l.className="close",n.appendChild(l),n.appendChild(r);for(var d=s.value.attributes.length,c=i.createDiv("form-horizontal form-row-seperated"),m=0;m<d;m++){var u,p=s.value.attributes[m].name,g="_"+p,v=s.value.attributes[m].value,h=i.createDiv(m==d-1?"form-group last":"form-group"),f=document.createElement("label");switch(f.className="col-sm-4 control-label",mxUtils.write(f,mxResources.get(p)),h.appendChild(f),p){case"sip_id":u=createDropdownWithOptgroupFromApi("/api/users/all",v,"fullname","id",i,"role");break;case"queue_id":u=createDropdownFromApi("/api/voice/queues",v,"name","name",i);break;case"trunk_name":u=createDropdownFromApi("/api/trunks",v,"name","name",i);break;case"variable_id":u=createDropdownFromApi("/api/variables",v,"name","id",i);break;case"account_id":u="sendMail"==s.value.nodeName?createDropdownFromApi("/api/mail/servers/out",v,"username","id",i):createDropdownFromApi("/api/sms/accounts",v,"name","id",i);break;case"template_id":u=createDropdownFromApi("/api/templates",v,"name","id",i);break;case"context":u=createDropdownFromApi("/api/voice/contexts",v,"name","name",i);break;case"mailbox":u=createDropdownFromApi("/api/voice/voicemails",v,"mailbox","id",i,["mailbox","context"],"%mailbox%@%context%");break;case"model":u=createDropdownFromArray(ISPEECHASRMODEL,v);break;case"ispeech_asr_language":u=createDropdownFromArray(ISPEECHASRLANG,v);break;case"beep":u=createDropdownFromArray(ISPEECHBEEP,v);break;case"hiddendigitspos":u=createDropdownFromArray(SECRETDIGITSPOS,v);break;case"ispeech_tts_language":u=createDropdownFromArray(ISPEECHLANG,v);break;case"google_tts_language":u=createDropdownFromArray(GOOGLETTSLANG,v);break;case"intKey":u=createDropdownFromArray(ASRINTKEYS,v);break;case"recordingFormat":u=createDropdownFromArray(RECORDINGFORMAT,v);break;case"answer":u=createDropdownFromArray(BOOLSELECT,v);break;case"list_id":u=createDropdownFromTigerDialList(v);break;case"interval_id":u=createGroupedDropdownFromApi("/api/intervals",v,"name","id",i,"SubIntervals");break;case"project_id":u=createDropdownFromApi("/api/square/projects",v,"name","id",i,null,null,i.editor.getOrCreateFilename());break;case"odbc_id":u=createDropdownFromApi("/api/square/odbc",v,"name","id",i);break;case"file_id":u=createDropdownFromApi("/api/sounds",v,"display_name","id",i);break;case"timeout":case"digit":case"mindigit":case"maxdigit":case"response":case"retry":case"speed":(u=document.createElement("input")).setAttribute("type","number"),u.setAttribute("min",0),u.setAttribute("max",1e3),u.setAttribute("value",v),u.className="form-control";break;case"text":case"key":case"query":case"condition":case"command":case"body":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control";break;case"sms_text":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control",u.setAttribute("maxlength","160");break;default:(u=document.createElement("input")).setAttribute("value",v),u.className="form-control"}u.setAttribute("id",g);var b=i.createDiv("col-sm-8");if(b.appendChild(u),mxResources.get("help_"+p)){var A=i.createDiv("p");A.className="help-block",mxUtils.write(A,mxResources.get("help_"+p)),b.appendChild(A)}h.appendChild(b),c.appendChild(h)}t.appendChild(c);var E=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(e){for(var n=0;n<s.value.attributes.length;n++){var t="_"+s.value.attributes[n].name,a=s.value.attributes[n].name;s.setAttribute(a,document.getElementById(t).value)}o.refresh(s),i.hideDialog()}));E.className="btn blue";var y=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});y.className="btn default",a.appendChild(E),a.appendChild(y),e.appendChild(n),e.appendChild(t),e.appendChild(a),this.container=e}Editor=function(){mxEventSource.call(this),this.init(),this.initStencilRegistry(),this.graph=new Graph,this.outline=new mxOutline(this.graph),this.outline.updateOnPan=!0,this.undoManager=this.createUndoManager(),this.status="",this.filename=null,this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[counter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(e){this.status=e,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.modified=!1,this.graphChangeListener=function(){this.modified=!0},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),window.onbeforeunload=mxUtils.bind(this,function(){if(this.modified)return mxResources.get("allChangesLost")}),this.graph.resetViewOnRootChange=!1,this.graph.scrollbars=!0,this.graph.background=null},mxUtils.extend(Editor,mxEventSource),Editor.prototype.gridImage=IMAGE_PATH+"/grid.gif",Editor.prototype.transparentImage=IMAGE_PATH+"/transparent.gif",Editor.prototype.setGraphXml=function(e){var n=new mxCodec(e.ownerDocument);if("mxGraphModel"==e.nodeName){this.graph.view.scale=Number(e.getAttribute("scale")||1),this.graph.gridEnabled="0"!=e.getAttribute("grid"),this.graph.graphHandler.guidesEnabled="0"!=e.getAttribute("guides"),this.graph.setTooltips("0"!=e.getAttribute("tooltips")),this.graph.setConnectable("0"!=e.getAttribute("connect")),this.graph.foldingEnabled="0"!=e.getAttribute("fold"),this.graph.scrollbars="0"!=e.getAttribute("scrollbars"),this.graph.scrollbars||(this.graph.container.scrollLeft=0,this.graph.container.scrollTop=0,this.graph.view.translate.x=Number(e.getAttribute("dx")||0),this.graph.view.translate.y=Number(e.getAttribute("dy")||0)),this.graph.pageVisible="1"==e.getAttribute("page"),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var t=e.getAttribute("pageScale");this.graph.pageScale=null!=t?t:1.5;var a=e.getAttribute("pageWidth"),i=e.getAttribute("pageHeight");null!=a&&null!=i&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(a),parseFloat(i)),this.outline.outline.pageFormat=this.graph.pageFormat);var s=e.getAttribute("background");null!=s&&0<s.length&&(this.graph.background=s),n.decode(e,this.graph.getModel()),this.updateGraphComponents()}},Editor.prototype.getGraphXml=function(){var e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel());return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),1!=this.graph.view.scale&&e.setAttribute("scale",Math.round(1e3*this.graph.view.scale)/1e3),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),this.graph.scrollbars||e.setAttribute("scrollbars","0"),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var e=this.graph,n=this.outline;if(null!=e.container&&null!=n.outline.container){null!=e.background?"none"==e.background?e.container.style.backgroundColor="transparent":(null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=e.background,e.view.backgroundPageShape.reconfigure()),e.container.style.backgroundColor=e.background):e.container.style.backgroundColor="",e.pageVisible?(e.container.style.backgroundColor="#ebebeb",e.container.style.borderStyle="solid",e.container.style.borderColor="#e5e5e5",e.container.style.borderTopWidth="1px",e.container.style.borderLeftWidth="1px",e.container.style.borderRightWidth="0px",e.container.style.borderBottomWidth="0px"):e.container.style.border="",n.outline.container.style.backgroundColor=e.container.style.backgroundColor,n.outline.pageVisible==e.pageVisible&&n.outline.pageScale==e.pageScale||(n.outline.pageScale=e.pageScale,n.outline.pageVisible=e.pageVisible,n.outline.view.validate()),e.scrollbars&&"hidden"==e.container.style.overflow&&!touchStyle?e.container.style.overflow="auto":e.scrollbars&&!touchStyle||(e.container.style.overflow="hidden");var t=mxClient.IS_IE&&9<=document.documentMode?"url("+this.transparentImage+")":"none";e.container.style.backgroundImage=!e.pageVisible&&e.isGridEnabled()?"url("+this.gridImage+")":t,null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+this.gridImage+")":"none")}},Editor.prototype.init=function(){mxClient.IS_IE6&&mxClient.link("stylesheet",CSS_PATH+"/grapheditor-ie6.css"),mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE),mxConstants.DEFAULT_HOTSPOT=.3;var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var t=e.apply(this,arguments);return t.intersects=mxUtils.bind(this,function(e,n){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(t,arguments)}),t},mxConstants.SHADOWCOLOR="#d0d0d0",mxConstants.HANDLE_FILLCOLOR="#99ccff",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,mxRubberband.prototype.defaultOpacity=30,mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,this.graph.background||"white","#cacaca")},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.getGraphBounds(),n=0<e.width?e.x/this.scale-this.translate.x:0,t=0<e.height?e.y/this.scale-this.translate.y:0,a=e.width/this.scale,i=e.height/this.scale,s=this.graph.pageFormat,o=this.graph.pageScale,r=s.width*o,l=s.height*o,d=Math.floor(Math.min(0,n)/r),c=Math.floor(Math.min(0,t)/l),m=Math.ceil(Math.max(1,n+a)/r)-d,u=Math.ceil(Math.max(1,t+i)/l)-c;return new mxRectangle(this.scale*(this.translate.x+d*r),this.scale*(this.translate.y+c*l),this.scale*m*r,this.scale*u*l)};var t=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(e,n){t.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=e+"px",this.view.backgroundPageShape.node.style.marginTop=n+"px")};var a=this;mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var n=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(n,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);if(this.graph.pageVisible){n=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(n),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(this.graph.container),this.graph.container.firstChild.style.position="absolute",this.graph.container.insertBefore(this.backgroundPageShape.node,this.graph.container.firstChild),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",this.backgroundPageShape.node.style.backgroundPosition="-1px -1px",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=n,this.backgroundPageShape.redraw()),this.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+a.gridImage+")":"none"}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraph.prototype.updatePageBreaks=function(e,n,t){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale,r=this.view.getBackgroundPageBounds();n=r.width,t=r.height;var l=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o),d=(e=e&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(n/l.width)-1:0,c=e?Math.ceil(t/l.height)-1:0,m=r.x+n,u=r.y+t;if(null==this.horizontalPageBreaks&&0<d&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(var p=0;p<=d;p++){var g=[new mxPoint(r.x+(p+1)*l.width,r.y),new mxPoint(r.x+(p+1)*l.width,u)];if(null!=this.horizontalPageBreaks[p])this.horizontalPageBreaks[p].scale=1,this.horizontalPageBreaks[p].points=g,this.horizontalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,this.scale)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.horizontalPageBreaks[p]=v}for(p=d;p<this.horizontalPageBreaks.length;p++)this.horizontalPageBreaks[p].destroy();this.horizontalPageBreaks.splice(d,this.horizontalPageBreaks.length-d)}if(null==this.verticalPageBreaks&&0<c&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(p=0;p<=c;p++){var v;g=[new mxPoint(r.x,r.y+(p+1)*l.height),new mxPoint(m,r.y+(p+1)*l.height)];if(null!=this.verticalPageBreaks[p])this.verticalPageBreaks[p].scale=1,this.verticalPageBreaks[p].points=g,this.verticalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,a)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.verticalPageBreaks[p]=v}for(p=c;p<this.verticalPageBreaks.length;p++)this.verticalPageBreaks[p].destroy();this.verticalPageBreaks.splice(c,this.verticalPageBreaks.length-c)}},mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0;var s=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,n,t){for(var a=0;a<n.length;a++)if(this.graph.getModel().isVertex(n[a])){var i=this.graph.getCellGeometry(n[a]);if(null!=i&&i.relative)return!1}return s.apply(this,arguments)},mxGuide.prototype.isEnabledForEvent=function(e){return!mxEvent.isAltDown(e)};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,n,t,a,i,s){var o=r.apply(this,arguments);return null==s||s||mxEvent.addListener(o,"mousedown",function(e){mxEvent.consume(e)}),o};var o=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(e){var n=this.graph.getModel(),t=n.getParent(this.graph.getSelectionCell()),a=o.apply(this,arguments),i=n.getParent(a);if(null==t||t!=a&&t!=i)for(;!this.graph.isCellSelected(a)&&!this.graph.isCellSelected(i)&&n.isVertex(i)&&!this.graph.isValidRoot(i);)a=i,i=this.graph.getModel().getParent(a);return a};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(e){var n=l.apply(this,arguments),t=this.graph.getModel(),a=t.getParent(this.graph.getSelectionCell()),i=t.getParent(e);return(null==a||a!=e&&a!=i)&&(this.graph.isCellSelected(e)||!t.isVertex(i)||this.graph.isValidRoot(i)||(n=!0)),n},mxGraphHandler.prototype.selectDelayed=function(e){var n=e.getCell();null==n&&(n=this.cell);for(var t=this.graph.getModel(),a=t.getParent(n);this.graph.isCellSelected(n)&&t.isVertex(a)&&!this.graph.isValidRoot(a);)n=a,a=t.getParent(n);this.graph.selectCellForEvent(n,e.getEvent())},mxPanningHandler.prototype.getCellForPopupEvent=function(e){for(var n=e.getCell(),t=this.graph.getModel(),a=t.getParent(n);t.isVertex(a)&&!this.graph.isValidRoot(a);)this.graph.isCellSelected(a)&&(n=a),a=t.getParent(a);return n}},Editor.prototype.createUndoManager=function(){var s=this.graph,t=new mxUndoManager,e=function(e,n){t.undoableEditHappened(n.getProperty("edit"))};s.getModel().addListener(mxEvent.UNDO,e),s.getView().addListener(mxEvent.UNDO,e);var n=function(e,n){for(var t=s.getSelectionCellsForChanges(n.getProperty("edit").changes),a=[],i=1;i<t.length;i++)null!=s.view.getState(t[i])&&a.push(t[i]);s.setSelectionCells(a)};return t.addListener(mxEvent.UNDO,n),t.addListener(mxEvent.REDO,n),t},Editor.prototype.initStencilRegistry=function(){mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/general.xml")},mxStencilRegistry.libraries={},mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(e){var n=mxStencilRegistry.stencils[e];if(null==n){var t=mxStencilRegistry.getBasenameForStencil(e);if(null!=t){var a=mxStencilRegistry.libraries[t];if(null!=a){if(null==mxStencilRegistry.packages[t]){mxStencilRegistry.packages[t]=1;for(var i=0;i<a.length;i++){var s=a[i];if(".xml"==s.toLowerCase().substring(s.length-4,s.length))mxStencilRegistry.loadStencilSet(s,null);else if(".js"==s.toLowerCase().substring(s.length-3,s.length)){var o=mxUtils.load(s);null!=o&&eval.call(window,o.getText())}}}}else mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+t+".xml",null);n=mxStencilRegistry.stencils[e]}}return n},mxStencilRegistry.getBasenameForStencil=function(e){var n=e.split("."),t=null;if(0<n.length&&"mxgraph"==n[0]){t=n[1];for(var a=2;a<n.length-1;a++)t+="/"+n[a]}return t},mxStencilRegistry.loadStencilSet=function(e,n,t){t=null!=t&&t;var a=mxStencilRegistry.packages[e];if(t||null==a){var i=!1;null==a&&(a=mxUtils.load(e).getXml(),mxStencilRegistry.packages[e]=a,i=!0),mxStencilRegistry.parseStencilSet(a,n,i)}},mxStencilRegistry.parseStencilSet=function(e,n,t){t=null==t||t;var a=e.documentElement,i=a.firstChild,s="",o=a.getAttribute("name");for(null!=o&&(s=o+".");null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(o=i.getAttribute("name"))){s=s.toLowerCase();var r=o.replace(/ /g,"_");if(t&&mxStencilRegistry.addStencil(s+r.toLowerCase(),new mxStencil(i)),null!=n){var l=i.getAttribute("w"),d=i.getAttribute("h");n(s,r,o,l=null==l?80:parseInt(l,10),d=null==d?80:parseInt(d,10))}}i=i.nextSibling}},OpenFile=function(e){this.producer=null,this.consumer=null,this.done=e},OpenFile.prototype.setConsumer=function(e){this.consumer=e,this.execute()},OpenFile.prototype.setData=function(e,n){this.data=e,this.filename=n,this.execute()},OpenFile.prototype.error=function(e){this.cancel(),mxUtils.alert(e)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.data&&(this.consumer(this.data,this.filename),this.cancel())},OpenFile.prototype.cancel=function(){null!=this.done&&this.done()},Sidebar.prototype.init=function(){var e=STENCIL_PATH;this.addSearchPalette(!0),this.addImagePalette("entry",mxResources.get("entry"),e+"/entry/","_128x128.png",["start","finally","end"],[mxResources.get("start"),mxResources.get("finally"),mxResources.get("end")]),this.addImagePalette("call_management",mxResources.get("call_management"),e+"/call_management/","_128x128.png",["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[mxResources.get("answer"),mxResources.get("hangup"),mxResources.get("dial"),mxResources.get("ext_dial"),mxResources.get("queue"),mxResources.get("voicemail"),mxResources.get("callback")]),this.addImagePalette("agent_management",mxResources.get("agent_management"),e+"/agent_management/","_128x128.png",["login","pause","unpause","logout"],[mxResources.get("login"),mxResources.get("pause"),mxResources.get("unpause"),mxResources.get("logout")]),this.addImagePalette("variable",mxResources.get("variable"),e+"/variable/","_128x128.png",["set","math"],[mxResources.get("set"),mxResources.get("math")]),this.addImagePalette("playback",mxResources.get("playback"),e+"/playback/","_128x128.png",["playback","menu","saydigits","saynumber","sayphonetic","getdigits","getsecretdigits"],[mxResources.get("playback"),mxResources.get("menu"),mxResources.get("saydigits"),mxResources.get("saynumber"),mxResources.get("sayphonetic"),mxResources.get("getdigits"),mxResources.get("getsecretdigits")]),this.addImagePalette("recording",mxResources.get("recording"),e+"/recording/","_128x128.png",["record"],[mxResources.get("record")]),this.addImagePalette("tts","TTS",e+"/tts/","_128x128.png",["google_cloud_tts","tts","ispeechtts","awspolly","lumenvoxtts","sestektts","mrcpsynth"],["Google Cloud TTS","GoogleTTS","ISpeechTTS","AWSPolly","LumenvoxTTS","SestekTTS","MRCPSynth"]),this.addImagePalette("asr","ASR",e+"/asr/","_128x128.png",["googleasr","ispeechasr","lumenvoxasr","tildeasr","sestekasr","mrcprecog"],["GoogleASR","ISpeechASR","LumenvoxASR","TildeASR","SestekASR","MRCPRecog"]),this.addImagePalette("integrationServer",mxResources.get("integrationServer"),e+"/integration_server/","_128x128.png",["database","sendMail","sendSMS","dialogflow","dialogflowV2","awslex","sesteknda","restapi"],[mxResources.get("database"),mxResources.get("sendMail"),mxResources.get("sendSMS"),"Dialogflow","DialogflowV2","AWSLex","SestekNDA","RestAPI"]),this.addImagePalette("callflow",mxResources.get("callflow"),e+"/callflow/","_128x128.png",["gotoc","gotoif","gotoiftime","vswitch"],[mxResources.get("gotoc"),mxResources.get("gotoif"),mxResources.get("gotoiftime"),mxResources.get("vswitch")]),this.addImagePalette("stats",mxResources.get("stats"),e+"/stats/","_128x128.png",["goal"],[mxResources.get("goal")]),this.addImagePalette("general",mxResources.get("general"),e+"/general/","_128x128.png",["noop","system","agi","subproject","custom_app"],[mxResources.get("noop"),mxResources.get("system"),mxResources.get("agi"),mxResources.get("subproject"),mxResources.get("custom_app")])},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.thumbWidth=36,Sidebar.prototype.thumbHeight=36,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2,Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Sidebar.prototype.showTooltip=function(c,m,u,p,g,v){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=c){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var e=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px",document.body.appendChild(this.tooltipImage)),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),u>this.maxTooltipWidth||p>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/u,this.maxTooltipHeight/p))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==v||v,this.graph2.addCells(m);var e=this.graph2.getGraphBounds(),n=e.width+2*this.tooltipBorder+4,t=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(t+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=n+"px",this.tooltipTitles&&null!=g&&0<g.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",mxClient.IS_SVG||(this.tooltipTitle.style.position="absolute"),this.tooltipTitle.style.paddingTop="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g);var a=this.tooltipTitle.offsetHeight+10;t+=a,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-a+"px":(t-=6,this.tooltipTitle.style.top=t-a+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=t+"px";var i=-Math.round(e.x-this.tooltipBorder),s=-Math.round(e.y-this.tooltipBorder),o=document.body,r=document.documentElement,l=(o.clientHeight||r.clientHeight,document.getElementById("vertical-navigation").offsetWidth+this.container.clientWidth),d=Math.max(0,this.getOffset(c).top-this.container.scrollTop-t/2+16);mxClient.IS_SVG?0!=i||0!=s?this.graph2.view.canvas.setAttribute("transform","translate("+i+","+s+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=i+"px",this.graph2.view.drawPane.style.top=s+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=l+"px",this.tooltip.style.top=d+"px",this.tooltipImage.style.left=l-13+"px",this.tooltipImage.style.top=d+t/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?e():this.thread=window.setTimeout(e,this.tooltipDelay),this.currentElt=c}},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},Sidebar.prototype.addEntry=function(e,n){if(null!=this.taglist&&null!=e&&0<e.length)for(var t=e.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),a=0;a<t.length;a++)if(t[a]=t[a].replace(/\.*\d*$/,""),1<t[a].length){var i=this.taglist[t[a]];null==i&&(i={entries:[],dict:new mxDictionary},this.taglist[t[a]]=i),null==i.dict.get(n)&&(i.dict.put(n,n),i.entries.push(n))}return n},Sidebar.prototype.searchEntries=function(e,n,t,a,i){if(null!=this.taglist&&null!=e){for(var s=e.toLowerCase().split(" "),o=new mxDictionary,r=(t+1)*n,l=[],d=0,c=0;c<s.length;c++)if(0<s[c].length){var m=this.taglist[s[c]],u=new mxDictionary;if(null!=m){var p=m.entries;l=[];for(var g=0;g<p.length;g++){m=p[g];if(0==d==(null==o.get(m))&&(u.put(m,m),l.push(m),c==s.length-1&&l.length==r))return void a(l.slice(t*n,r),r,!0)}}else l=[];o=u,d++}var v=l.length;a(l.slice(t*n,(t+1)*n),v,!1)}else a([])},Sidebar.prototype.filterTags=function(e){if(null==e)return null;for(var n=e.split(" "),t=[],a={},i=0;i<n.length;i++)null==a[n[i]]&&(a[n[i]]="1",t.push(n[i]));return t.join(" ")},Sidebar.prototype.cloneCell=function(e,n){var t=e.clone();return null!=n&&(t.value=n),t},Sidebar.prototype.addSearchPalette=function(e){var n=document.createElement("div");n.style.visibility="hidden",this.container.appendChild(n);var r=document.createElement("div");r.className="geSidebar",r.style.boxSizing="border-box",r.style.overflow="hidden",r.style.width="100%",r.style.padding="8px",r.style.paddingTop="14px",r.style.paddingBottom="0px",e||(r.style.display="none");var t=document.createElement("div");t.style.whiteSpace="nowrap",t.style.textOverflow="clip",t.style.paddingBottom="8px",t.style.cursor="default";var a=document.createElement("input");a.setAttribute("placeholder",mxResources.get("searchShapes")),a.setAttribute("type","text"),a.style.fontSize="12px",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.border="solid 1px #d5d5d5",a.style.borderRadius="4px",a.style.width="100%",a.style.outline="none",a.style.padding="6px",t.appendChild(a);var i,s=document.createElement("img");s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search")),s.style.position="relative",s.style.left="-18px",mxClient.IS_QUIRKS?(a.style.height="28px",s.style.top="-4px"):s.style.top="2px",s.style.background="url('"+this.editorUi.editor.transparentImage+"')",t.appendChild(s),r.appendChild(t);var l=document.createElement("center"),d=mxUtils.button(mxResources.get("moreResults"),function(){i()});d.style.display="none",d.style.lineHeight="normal",d.style.marginTop="4px",d.style.marginBottom="8px",l.style.paddingTop="4px",l.style.paddingBottom="8px",l.appendChild(d),r.appendChild(l);var c="",m=!1,u=!1,p=0,g=new Object,v=12,h=mxUtils.bind(this,function(){m=!1,this.currentSearch=null;for(var e=r.firstChild;null!=e;){var n=e.nextSibling;e!=t&&e!=l&&e.parentNode.removeChild(e),e=n}});i=mxUtils.bind(this,function(){if(v=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=a.value){if(null!=l.parentNode&&(c!=a.value&&(h(),c=a.value,g=new Object,u=!1,p=0),!m&&!u)){d.setAttribute("disabled","true"),d.style.display="",d.style.cursor="wait",d.innerHTML=mxResources.get("loading")+"...",m=!0;var o=new Object;this.currentSearch=o,this.searchEntries(c,v,p,mxUtils.bind(this,function(e,n,t){if(this.currentSearch==o){e=null!=e?e:[],m=!1,p++,l.parentNode.removeChild(l);for(var a=0;a<e.length;a++){var i=e[a]();null==g[i.innerHTML]&&(g[i.innerHTML]="1",r.appendChild(e[a]()))}if(t?(d.removeAttribute("disabled"),d.innerHTML=mxResources.get("moreResults")):(d.innerHTML=mxResources.get("reset"),d.style.display="none",u=!0),d.style.cursor="",0==e.length&&1==p){var s=document.createElement("div");s.className="geTitle",s.style.backgroundColor="transparent",s.style.borderColor="transparent",s.style.color="gray",s.style.padding="0px",s.style.margin="0px 8px 0px 8px",s.style.paddingTop="6px",s.style.textAlign="center",s.style.cursor="default",mxUtils.write(s,mxResources.get("noResultsFor",[c])),r.appendChild(s)}r.appendChild(l)}}),mxUtils.bind(this,function(){d.style.cursor=""}))}}else h(),a.value="",c="",g=new Object,d.style.display="none",u=!1,a.focus()}),mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){13==e.keyCode&&i()})),mxEvent.addListener(a,"focus",function(){a.style.paddingRight="",s.style.display="none"}),mxEvent.addListener(a,"blur",function(){a.style.paddingRight="20px",s.style.display=""}),a.style.paddingRight="20px",mxEvent.addListener(a,"keyup",mxUtils.bind(this,function(e){""==a.value?(u=!0,d.style.display="none"):a.value!=c?(d.style.display="none",u=!1):m||(d.style.display=u?"none":"")})),mxEvent.addListener(a,"mousedown",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}),mxEvent.addListener(a,"selectstart",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0});var o=document.createElement("div");o.appendChild(r),this.container.appendChild(o),this.palettes.search=[n,o]},Sidebar.prototype.createTitle=function(e){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.setAttribute("title",mxResources.get("sidebarTooltip")),n.className="geTitle",mxUtils.write(n,e),n},Sidebar.prototype.createThumb=function(e,n,t,a,i,s,o,r,l){this.graph.labelsVisible=null==s||s;var d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(e);var c=this.graph.getGraphBounds(),m=Math.floor(100*Math.min((n-2*this.thumbBorder)/c.width,(t-2*this.thumbBorder)/c.height))/100;this.graph.view.scaleAndTranslate(m,Math.floor((n-c.width*m)/2/m-c.x),Math.floor((t-c.height*m)/2/m-c.y));var u=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?(u=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML:u=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=d,mxClient.IS_IE6&&(a.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),u.style.position="relative",u.style.overflow="hidden",u.style.cursor="move",u.style.left=this.thumbBorder+"px",u.style.top=this.thumbBorder+"px",u.style.width=n+"px",u.style.height=t+"px",u.style.visibility="",u.style.minWidth="",u.style.minHeight="",a.appendChild(u),this.sidebarTitles&&null!=i&&0!=o){var p=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;a.style.height=this.thumbHeight+p+this.sidebarTitleSize+8+"px";var g=document.createElement("div");g.style.fontSize=this.sidebarTitleSize+"px",g.style.color="#303030",g.style.textAlign="center",g.style.whiteSpace="nowrap",mxClient.IS_IE&&(g.style.height=this.sidebarTitleSize+12+"px"),g.style.paddingTop="4px",mxUtils.write(g,i),a.appendChild(g)}return c},Sidebar.prototype.createItem=function(n,t,a,e,i,s,o){var r=document.createElement("a");r.setAttribute("href","javascript:void(0);"),r.className="geItem",r.style.overflow="hidden";var l=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+l+"px",r.style.height=this.thumbHeight+l+"px",r.style.padding=this.thumbPadding+"px",mxEvent.addListener(r,"click",function(e){mxEvent.consume(e)}),this.createThumb(n,this.thumbWidth,this.thumbHeight,r,t,a,e,i,s);var d=new mxRectangle(0,0,i,s);if(1<n.length||n[0].vertex){var c=this.createDragSource(r,this.createDropHandler(n,!0,o,d),this.createDragPreview(i,s),n,d);this.addClickHandler(r,c,n),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=n[0]&&n[0].edge){c=this.createDragSource(r,this.createDropHandler(n,!1,o,d),this.createDragPreview(i,s),n,d);this.addClickHandler(r,c,n)}return mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(e){this.showTooltip(r,n,d.width,d.height,t,a)})),r},Sidebar.prototype.createDropHandler=function(g,v,h,f){return h=null==h||h,mxUtils.bind(this,function(e,n,t,a,i){if(e.isEnabled()){if(0<(g=e.getImportableCells(g)).length){e.stopEditing();var s=null!=t&&e.isValidDropTarget(t,g,n),o=null;if(null==t||s||(t=null),!e.isCellLocked(t||e.getDefaultParent())){e.model.beginUpdate();try{if(a=Math.round(a),i=Math.round(i),v&&e.isSplitTarget(t,g,n)){var r=e.cloneCells(g);e.splitEdge(t,r,null,a-f.width/2,i-f.height/2),o=r}else 0<g.length&&(o=e.importCells(g,a,i,t));if(null!=e.layoutManager){var l=e.layoutManager.getLayout(t);if(null!=l)for(var d=e.view.scale,c=e.view.translate,m=(a+c.x)*d,u=(i+c.y)*d,p=0;p<o.length;p++)l.moveCell(o[p],m,u)}h&&e.fireEvent(new mxEventObject("cellsInserted","cells",o))}finally{e.model.endUpdate()}null!=o&&0<o.length&&(e.scrollCellToVisible(o[0]),e.setSelectionCells(o))}}mxEvent.consume(n)}})},Sidebar.prototype.createDragPreview=function(e,n){var t=document.createElement("div");return t.style.border="1px dashed black",t.style.width=e+"px",t.style.height=n+"px",t},Sidebar.prototype.createDragSource=function(e,n,t){var a=mxUtils.makeDraggable(e,this.editorUi.editor.graph,n,t,0,0,this.editorUi.editor.graph.autoscroll,!0,!0);return a.getDropTarget=function(e,n,t){var a=mxDragSource.prototype.getDropTarget.apply(this,arguments);return e.isValidRoot(a)||(a=null),a},a},Sidebar.prototype.addClickHandler=function(e,a){var i=this.editorUi.editor.graph,s=null;mxEvent.addGestureListeners(e,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e))});var o=a.mouseUp;a.mouseUp=function(e){if(!mxEvent.isPopupTrigger(e)&&null==this.currentGraph&&null!=s){var n=i.tolerance;if(Math.abs(s.x-mxEvent.getClientX(e))<=n&&Math.abs(s.y-mxEvent.getClientY(e))<=n){var t=i.getGridSize();a.drop(i,e,null,t,t)}}o.apply(this,arguments),s=null}},Sidebar.prototype.createVertexTemplateEntry=function(e,n,t,a,i,s,o,r){return r=null!=r&&0<r.length?r:i.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(e,n,t,a,i,s,o)}))},Sidebar.prototype.createXmlDocument=function(e,n,t,a){var i=mxUtils.createXmlDocument().createElement(e);return i.setAttribute("label",n),t.forEach(function(e,n){i.setAttribute(e,a[n]?a[n]:"")}),i},Sidebar.prototype.createVertexTemplate=function(e,n,t,a,i,s,o,r){var l=[],d=[];switch(a){case"answer":l=["timeout"],d=["0"];break;case"start":l=["answer"],d=["yes"];break;case"googleasr":l=["key","google_asr_language","timeout","intKey","beep"],d=["","it-IT","10","#","BEEP"];break;case"tildeasr":l=["uri","appid","appsecret","timeout","intKey","beep"],d=["wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE","","","10","#","BEEP"];break;case"ispeechasr":l=["key","model","ispeech_asr_language","timeout","intKey","beep"],d=["","","it-IT","10","#","BEEP"];break;case"playback":l=["file_id","opts"],d=["0"];break;case"background":l=["file_id","response","digit"],d=["0","5","1"];break;case"menu":l=["file_id","response","digit","retry","variable_id"],d=["0","5","1","1","0"];break;case"getdigits":l=["file_id","response","mindigit","maxdigit","retry","variable_id"],d=["0","5","1","10","1","0"];break;case"getsecretdigits":l=["file_id","response","mindigit","maxdigit","retry","hiddendigitsnum","hiddendigitspos","variable_id"],d=["0","5","1","10","1","0","first","0"];break;case"custom_app":l=["application","options"],d=["",""];break;case"set":l=["variable_id","variable_value"],d=["0",""];break;case"database":l=["odbc_id","query","variable_id"],d=["0","",""];break;case"noop":l=["output"],d=[];break;case"gotoc":l=["context","extension","priority"],d=["","","1"];break;case"system":l=["variable_id","command"],d=[];break;case"agi":l=["command","args"],d=[];break;case"gotoif":l=["condition"],d=[];break;case"gotoiftime":l=["interval_id"],d=["0"];break;case"vswitch":l=["variable_id"],d=["0"];break;case"saydigits":l=["digits","escape_digits"],d=["","#"];break;case"saynumber":l=["number","escape_digits"],d=["","#"];break;case"sayphonetic":l=["text","escape_digits"],d=["","#"];break;case"record":l=["file","recordingFormat","timeout","escape_digits"],d=["","wav","-1","#"];break;case"dial":l=["sip_id","timeout","opts","url"],d=["0","60"];break;case"ext_dial":l=["phone","trunk_name","timeout","opts","url"],d=["","-1","60"];break;case"google_cloud_tts":l=["apiKey","google_cloud_tts_text_type","text","languageCode","ssmlGender"],d=["","text","","en-US","FEMALE"];break;case"tts":l=["text","google_tts_language"],d=["","it"];break;case"ispeechtts":l=["text","key","ispeech_tts_language","speed","intKey"],d=["","","euritalianfemale","0","#"];break;case"lumenvoxtts":case"sestektts":l=["text","options"],d=["",""];break;case"lumenvoxasr":l=["grammar","options"],d=["",""];break;case"sestekasr":l=["grammar","options"],d=["/usr/local/unimrcp/data/grammar.xml",""];break;case"awspolly":l=["aws_access_key_id","aws_secret_access_key","aws_polly_region","aws_polly_voice","text","aws_text_type"],d=["","","eu-west-1","Amy","","text"];break;case"awslex":l=["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],d=["","","eu-west-1","",""];break;case"queue":l=["queue_id","opts","url","file_id","timeout","agi","macro","gosub","position"],d=["-1","xX","","","300"];break;case"voicemail":l=["mailbox","options"],d=["",""];break;case"subproject":l=["project_id"],d=["0"];break;case"math":l=["operation","variable_id"],d=["","0"];break;case"queuelog":l=["queuename","agent","queue_event","data1","data2","data3","data4","data5"],d=[];break;case"goal":l=["goalname"],d=[];break;case"callback":l=["name","lastName","phone","dialTimezone","list_id","delay","callback_priority"],d=["{CALLERID(name)}","","{CALLERID(num)}","{CALLERID(dialTimezone)}","-1","5","2"];break;case"sendSMS":l=["sms_account_id","to","sms_text"],d=["0"];break;case"sendMail":l=["account_id","to","cc","bcc","subject","text"],d=["0"];break;case"sendFax":l=["account_id","to","choose_attachment","attachment_name","attachment_type","attachment_path"],d=["0"];break;case"login":case"unpause":case"logout":l=["findBy"],d=["internal"];break;case"pause":l=["findBy","pause_id"],d=["internal",""];break;case"dialogflow":l=["key","text","dialogflow_language"],d=["","","it"];break;case"sesteknda":l=["ndauth_url","username","password","ndassistant_url","text","project","ndagenerate_audio","custom_action","custom_action_data","ndaactivity_type"],d=["","","","","","",1,"","","message"];break;case"restapi":l=["url","method","timeout","computedVariables","rawHeaders","rawBody","variable_id"],d=["","GET","5","","","",""];break;case"mrcpsynth":l=["text","options"],d=["",""];break;case"mrcprecog":l=["grammar","options"],d=["",""];break;case"dialogflowV2":l=["dialogflowV2_project_id","client_email","private_key","dialogflowV2_language","text"],d=["","","","en",""];break;default:l=[],d=[]}var c=[new mxCell(this.createXmlDocument(a,i,l,d),new mxGeometry(0,0,n,t),e)];return c[0].vertex=!0,this.createVertexTemplateFromCells(c,n,t,i,s,o,r)},Sidebar.prototype.createVertexTemplateFromCells=function(e,n,t,a,i,s,o){return this.createItem(e,a,i,s,n,t,o)},Sidebar.prototype.createEdgeTemplate=function(e,n,t,a,i,s,o){var r=new mxCell(null!=a?a:"",new mxGeometry(0,0,n,t),e);return r.geometry.setTerminalPoint(new mxPoint(0,t),!0),r.geometry.setTerminalPoint(new mxPoint(n,0),!1),r.geometry.relative=!0,r.edge=!0,this.createEdgeTemplateFromCells([r],n,t,i,s,o)},Sidebar.prototype.createEdgeTemplateFromCells=function(e,n,t,a,i,s){return this.createItem(e,a,i,!0,n,t,s)},Sidebar.prototype.addPaletteFunctions=function(e,n,t,a){this.addPalette(e,n,t,mxUtils.bind(this,function(e){for(var n=0;n<a.length;n++)e.appendChild(a[n](e))}))},Sidebar.prototype.addPalette=function(e,n,t,a){var i=this.createTitle(n);this.container.appendChild(i);var s=document.createElement("div");s.className="geSidebar",mxClient.IS_POINTER&&(s.style.touchAction="none"),mxEvent.addListener(s,"mousemove",mxUtils.bind(this,function(e){mxEvent.getSource(e)==s?s.setAttribute("title",mxResources.get("sidebarTooltip")):s.removeAttribute("title")})),t?(a(s),a=null):s.style.display="none",this.addFoldingHandler(i,s,a);var o=document.createElement("div");return o.appendChild(s),this.container.appendChild(o),null!=e&&(this.palettes[e]=[i,o]),s},Sidebar.prototype.addFoldingHandler=function(t,a,i){var s=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(t.style.backgroundImage="none"==a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="0% 50%",mxEvent.addListener(t,"click",mxUtils.bind(this,function(e){if("none"==a.style.display){if(s)a.style.display="block";else if(s=!0,null!=i){t.style.cursor="wait";var n=t.innerHTML;t.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,i(a),mxClient.NO_FO=e,a.style.display="block",t.style.cursor="",t.innerHTML=n},0)}else a.style.display="block";t.style.backgroundImage="url('"+this.expandedImage+"')"}else t.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none";mxEvent.consume(e)}))},Sidebar.prototype.addImagePalette=function(e,n,s,o,r,t,a){for(var l=[],d=0;d<r.length;d++)mxUtils.bind(this,function(e,n,t){if(null==t){var a=e.lastIndexOf("/"),i=e.lastIndexOf(".");t=e.substring(0<=a?a+1:0,0<=i?i:e.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;image="+s+e+o,this.defaultImageWidth,this.defaultImageHeight,r[d],n,!1,!0,this.filterTags(t)))})(r[d],null!=t?t[d]:null,null!=a?a[r[d]]:null);this.addPaletteFunctions(e,n,!1,l)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0),mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{if(null!=navigator&&null!=navigator.language){var e=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===e||"en-ca"===e||"es-mx"===e?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.gridColor="#e0e0e0",mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",Graph=function(e,n,t,a){mxGraph.call(this,e,n,t,a),this.setConnectable(!0),this.setDropEnabled(!1),this.setPanning(!0),this.setTooltips(!mxClient.IS_TOUCH),this.setAllowLoops(!1),this.setMultigraph(!1),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.connectionHandler.targetConnectImage=!0,this.setAllowDanglingEdges(!1),this.connectionHandler.setCreateTarget(!1),this.connectionHandler.isValidSource=function(){return mxConnectionHandler.prototype.isValidSource.apply(this,arguments)&&"2"!=urlParams.connect},this.alternateEdgeStyle="vertical",null==a&&this.loadStylesheet();var i=new mxRubberband(this);this.getRubberband=function(){return i},this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.container.style.cursor="pointer"})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.container.style.cursor="default"})),this.isHtmlLabel=function(e){var n=this.view.getState(e),t=null!=n?n.style:this.getCellStyle(e);return"1"==t.html||"wrap"==t.whiteSpace},this.cellRenderer.getLabelValue=function(e){var n=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return"wrap"==e.style.whiteSpace&&1!=e.style.html&&(n=mxUtils.htmlEntities(n,!1)),n},this.isCellLocked=function(e){return!1},this.connectionHandler.tapAndHoldTolerance=16;var s=this.connectionHandler.tapAndHold;this.connectionHandler.tapAndHold=function(e,n){null==n?this.graph.panningHandler.active||(i.start(e.getGraphX(),e.getGraphY()),this.graph.panningHandler.panningTrigger=!1):tapAndHoldStartsConnection?s.apply(this,arguments):this.graph.isCellSelected(n.cell)&&1<this.graph.getSelectionCount()&&this.graph.removeSelectionCell(n.cell)},touchStyle&&this.initTouch()},mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.loadStylesheet=function(){var e=mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();new mxCodec(e.ownerDocument).decode(e,this.getStylesheet())},Graph.prototype.flipEdge=function(e){if(null!=e){var n=this.view.getState(e),t=null!=n?n.style:this.getCellStyle(e);if(null!=t){var a=mxUtils.getValue(t,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,a,[e])}}},Graph.prototype.setDefaultEdge=function(e){if(null!=e&&this.getModel().isEdge(e)){var n=this.getModel().cloneCells([e])[0];null!=n.geometry&&(n.geometry.points=null);var t=n.getStyle();t=mxUtils.setStyle(t,mxConstants.STYLE_ENTRY_X,null),t=mxUtils.setStyle(t,mxConstants.STYLE_ENTRY_Y,null),t=mxUtils.setStyle(t,mxConstants.STYLE_EXIT_X,null),t=mxUtils.setStyle(t,mxConstants.STYLE_EXIT_Y,null),n.setStyle(t),this.connectionHandler.createEdgeState=function(e){return this.graph.view.createState(n)},this.connectionHandler.factoryMethod=function(){return this.graph.cloneCells([n])[0]}}},Graph.prototype.isCellFoldable=function(e){return this.foldingEnabled&&this.isSwimlane(e)},Graph.prototype.isValidRoot=function(e){return this.isSwimlane(e)},Graph.prototype.createGroupCell=function(){var e=mxGraph.prototype.createGroupCell.apply(this,arguments);return e.setStyle("group"),e},Graph.prototype.getTooltipForCell=function(e){var n="";return this.getModel().isVertex(e)?n+=mxResources.get("description_"+e.value.nodeName)||"":this.getModel().isEdge(e)&&(n=mxGraph.prototype.getTooltipForCell.apply(this,arguments)),n},Graph.prototype.convertValueToString=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("label"):mxGraph.prototype.convertValueToString.apply(this,arguments)},Graph.prototype.cellLabelChanged=function(e,n,t){if(null!=e.value&&"object"==typeof e.value){var a=e.value.cloneNode(!0);a.setAttribute("label",n),n=a}mxGraph.prototype.cellLabelChanged.apply(this,arguments)},Graph.prototype.setLinkForCell=function(e,n){var t=null;null!=e.value&&"object"==typeof e.value?t=e.value.cloneNode(!0):(t=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",e.value);null!=n&&0<n.length?t.setAttribute("link",n):t.removeAttribute("link"),this.model.setValue(e,t)},Graph.prototype.getLinkForCell=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("link"):null},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(e,n){this.panningHandler.hideMenu()});var s=!1,o=null;this.updateMouseEvent=function(e){if(mxGraph.prototype.updateMouseEvent.apply(this,arguments),null==e.getState()){var n=this.getCellAt(e.graphX,e.graphY);this.getModel().isEdge(n)&&(e.state=this.view.getState(n),null!=e.state&&null!=e.state.shape&&(this.container.style.cursor=e.state.shape.node.style.cursor))}null==e.getState()&&(this.container.style.cursor="default")},this.fireMouseEvent=function(e,n,t){if(e==mxEvent.MOUSE_DOWN)this.panningHandler.isMenuShowing()?(s=!1,o=null):(o=n.getCell(),s=null!=o?this.isCellSelected(o):this.isSelectionEmpty());else if(e==mxEvent.MOUSE_UP){if(s&&!this.isEditing()){if(!this.panningHandler.isMenuShowing()){var a=mxEvent.getClientX(n.getEvent()),i=mxEvent.getClientY(n.getEvent());this.panningHandler.popup(a+16,i,o,n.getEvent())}return s=!1,o=null,void n.consume()}s=!1,o=null}mxGraph.prototype.fireMouseEvent.apply(this,arguments),e==mxEvent.MOUSE_MOVE&&n.isConsumed()&&(s=!1,o=null)}},function(){if(mxVertexHandler.prototype.rotationEnabled=!0,mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,touchStyle){mxConstants.HANDLE_SIZE=16,mxConstants.LABEL_HANDLE_SIZE=7,mxClient.IS_TOUCH&&(mxVertexHandler.prototype.tolerance=4,mxEdgeHandler.prototype.tolerance=6,Graph.prototype.tolerance=14,Graph.prototype.gridSize=20,mxPanningHandler.prototype.selectOnPopup=!1,mxPanningHandler.prototype.useLeftButtonForPanning=!0,mxPanningHandler.prototype.isPanningTrigger=function(e){var n=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())||mxEvent.isControlDown(n)&&mxEvent.isShiftDown(n)||this.usePopupTrigger&&mxEvent.isPopupTrigger(n)});var t=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(e,n){t.apply(this,arguments),this.graph.isCellSelected(n.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)},Graph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxConnectionHandler.prototype.selectCells=function(e,n){touchStyle&&null!=n?this.graph.setSelectionCell(n):this.graph.setSelectionCell(e)};var a=mxGraph.prototype.dblClick;Graph.prototype.dblClick=function(e,n){if(null==n){var t=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));n=this.getCellAt(t.x,t.y)}a.call(this,e,n)};var e=new mxImage(IMAGE_PATH+"/touch-handle.png",16,16);mxVertexHandler.prototype.handleImage=e,mxEdgeHandler.prototype.handleImage=e,mxOutline.prototype.sizerImage=e,(new Image).src=e.src;var n=IMAGE_PATH+"/touch-connector.png",i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(this.connectorImg=mxUtils.createImage(n),this.connectorImg.style.cursor="pointer",this.connectorImg.style.width="29px",this.connectorImg.style.height="29px",this.connectorImg.style.position="absolute",mxClient.IS_TOUCH||(this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state)),this.connectorImg.style.padding="2px",mxEvent.addGestureListeners(this.connectorImg,mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,n.x,n.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};var s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+4+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};var o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,n){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)},(new Image).src=n}else{var r=new mxImage(IMAGE_PATH+"/connector.png",15,15);if(mxConnectionHandler.prototype.connectImage=r,(new Image).src=r.src,"2"==urlParams.connect){r=new mxImage(IMAGE_PATH+"/connector.png",15,15),i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(mxClient.IS_IE&&!mxClient.IS_SVG?(this.connectorImg=document.createElement("div"),this.connectorImg.style.backgroundImage="url("+r.src+")",this.connectorImg.style.backgroundPosition="center",this.connectorImg.style.backgroundRepeat="no-repeat",this.connectorImg.style.width=r.width+4+"px",this.connectorImg.style.height=r.height+4+"px",this.connectorImg.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):(this.connectorImg=mxUtils.createImage(r.src),this.connectorImg.style.width=r.width+"px",this.connectorImg.style.height=r.height+"px"),this.connectorImg.style.cursor="pointer",this.connectorImg.style.position="absolute",this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state),this.connectorImg.style.padding="2px",mxEvent.addListener(this.connectorImg,"mousedown",mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,n.x,n.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+2+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,n){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)}}}}(),Actions.prototype.init=function(){var n=this.editorUi,l=n.editor,d=l.graph;this.addAction("new",function(){n.projectDesignController.newProject()},CRUD_PERMISSIONS.canEdit),this.addAction("open",function(){n.projectDesignController.openProject()},CRUD_PERMISSIONS.canEdit),this.addAction("save",function(){n.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml())),n.editor.modified=!1},CRUD_PERMISSIONS.canEdit,null,"Ctrl+S"),this.addAction("saveAs",function(){n.projectDesignController.saveProjectAs(mxUtils.getPrettyXml(l.getGraphXml()))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+S"),this.addAction("publish",function(){n.editor.setStatus(""),null===n.validate()?(n.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml()),!0),n.editor.modified=!1):(n.editor.setStatus("...Error publishing! Please check the project and try again!"),setTimeout(function(){n.editor.setStatus("")},3e3))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+P"),this.addAction("variable",function(){n.projectDesignController.newVariable()},CRUD_PERMISSIONS.canEdit),this.addAction("import",function(){n.projectDesignController.importXML(function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("export",function(){n.exportXML(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+E"),this.addAction("editFile",function(){n.projectDesignController.editXML(mxUtils.getPrettyXml(l.getGraphXml()),function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("print",function(){mxUtils.printScreen(d)},null,"sprite-print","Ctrl+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){l.undoManager.undo()},null,"sprite-undo","Ctrl+Z"),this.addAction("redo",function(){l.undoManager.redo()},null,"sprite-redo","Ctrl+Y"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut","Ctrl+X"),this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy","Ctrl+C"),this.addAction("paste",function(){mxClipboard.paste(d)},!1,"sprite-paste","Ctrl+V"),this.addAction("delete",function(){d.removeCells()},null,null,"Delete"),this.addAction("duplicate",function(){var e=d.gridSize;d.setSelectionCells(d.moveCells(d.getSelectionCells(),e,e,!0))},null,null,"Ctrl+D"),this.addAction("selectVertices",function(){d.selectVertices()},null,null,"Ctrl+Shift+V"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,"Ctrl+Shift+E"),this.addAction("selectAll",function(){d.selectAll()},null,null,"Ctrl+A"),this.addAction("home",function(){d.home()},null,null,"Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,"Page Up"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,"Page Down"),this.addAction("expand",function(){d.foldCells(!1)},null,null,"Enter"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,"Backspace"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,"Ctrl+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,"Ctrl+B"),this.addAction("group",function(){d.setSelectionCell(d.groupCells(null,0))},null,null,"Ctrl+G"),this.addAction("ungroup",function(){d.setSelectionCells(d.ungroupCells())},null,null,"Ctrl+U"),this.addAction("removeFromGroup",function(){d.removeCellsFromParent()}),this.addAction("editLink",function(){var e=d.getSelectionCell(),n=d.getLinkForCell(e);null==n&&(n=""),null!=(n=mxUtils.prompt(mxResources.get("enterValue"),n))&&d.setLinkForCell(e,n)}),this.addAction("openLink",function(){var e=d.getSelectionCell(),n=d.getLinkForCell(e);null!=n&&window.open(n)}),this.addAction("autosize",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var n=0;n<e.length;n++){var t=e[n];d.getModel().getChildCount(t)?d.updateGroupBounds([t],20):d.updateCellSize(t)}}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var e=d.getView().getState(d.getSelectionCell()),n="wrap";null!=e&&"wrap"==e.style[mxConstants.STYLE_WHITE_SPACE]&&(n=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,n)}),this.addAction("rotation",function(){var e="0",n=d.getView().getState(d.getSelectionCell());null!=n&&(e=n.style[mxConstants.STYLE_ROTATION]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)",e))&&d.setCellStyles(mxConstants.STYLE_ROTATION,e)}),this.addAction("tilt",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var n=0;n<e.length;n++){var t=e[n];if(d.getModel().isVertex(t)&&0==d.getModel().getChildCount(t)){var a=d.getCellGeometry(t);if(null!=a){(a=a.clone()).x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var i=a.width;a.width=a.height,a.height=i,d.getModel().setGeometry(t,a);var s=d.view.getState(t);if(null!=s){var o=s.style[mxConstants.STYLE_DIRECTION]||"east";"east"==o?o="south":"south"==o?o="west":"west"==o?o="north":"north"==o&&(o="east"),d.setCellStyles(mxConstants.STYLE_DIRECTION,o,[t])}}}}}finally{d.getModel().endUpdate()}}},null,null,"Ctrl+R"),this.addAction("actualSize",function(){d.zoomTo(1)}),this.addAction("zoomIn",function(){d.zoomIn()},null,null,"Add"),this.addAction("zoomOut",function(){d.zoomOut()},null,null,"Subtract"),this.addAction("fitWindow",function(){d.fit()}),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,n=d.pageScale,t=d.container.clientWidth-20,a=d.container.clientHeight-20,i=Math.floor(100*Math.min(t/e.width/n,a/e.height/n))/100;d.zoomTo(i),d.container.scrollLeft=Math.round(d.view.translate.x*i-Math.max(10,(d.container.clientWidth-e.width*n*i)/2)),d.container.scrollTop=Math.round(d.view.translate.y*i-Math.max(10,(d.container.clientHeight-e.height*n*i)/2))})),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,n=d.pageScale,t=d.container.clientWidth-20,a=Math.floor(100*t/e.width/n)/100;d.zoomTo(a),d.container.scrollLeft=Math.round(d.view.translate.x*a-Math.max(10,(d.container.clientWidth-e.width*n*a)/2)),d.container.scrollTop=Math.round(d.view.translate.y*a-Math.max(10,(d.container.clientHeight-e.height*n*a)/2))})),this.put("customZoom",new Action(mxResources.get("custom"),function(){var e=mxUtils.prompt(mxResources.get("enterValue")+" (%)",parseInt(100*d.getView().getScale()));null!=e&&0<e.length&&!isNaN(parseInt(e))&&d.zoomTo(parseInt(e)/100)}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),l.updateGraphComponents()},null,null,"Ctrl+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("navigation",function(){d.foldingEnabled=!d.foldingEnabled,d.view.revalidate()})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),(e=this.addAction("scrollbars",function(){if(d.scrollbars=!d.scrollbars,l.updateGraphComponents(),d.scrollbars){var e=d.view.translate.x,n=d.view.translate.y;d.view.translate.x=0,d.view.translate.y=0,d.sizeDidChange(),d.container.scrollLeft-=Math.round(e*d.view.scale),d.container.scrollTop-=Math.round(n*d.view.scale)}else{var t=d.view.translate;d.view.setTranslate(t.x-d.container.scrollLeft/d.view.scale,t.y-d.container.scrollTop/d.view.scale),d.container.scrollLeft=0,d.container.scrollTop=0,d.sizeDidChange()}},!mxClient.IS_TOUCH)).setToggleAction(!0),e.setSelectedCallback(function(){return"auto"==d.container.style.overflow}),(e=this.addAction("pageView",mxUtils.bind(this,function(){d.pageVisible=!d.pageVisible,d.pageBreaksVisible=d.pageVisible,d.preferPageSize=d.pageBreaksVisible,d.view.validate(),d.sizeDidChange(),l.updateGraphComponents(),l.outline.update(),mxUtils.hasScrollbars(d.container)&&(d.pageVisible?(d.container.scrollLeft-=20,d.container.scrollTop-=20):(d.container.scrollLeft+=20,d.container.scrollTop+=20))}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connect",function(){d.setConnectable(!d.connectionHandler.isEnabled())},null,null,"Ctrl+Q")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),this.addAction("help",function(){window.open("https://wiki.xcallymotion.com/display/XMV/Cally+Square")}),this.put("about",new Action(mxResources.get("about")+" Cally Square",function(){window.open("http://callysquare.com/")},null,null,null));var t=mxUtils.bind(this,function(e,n){this.addAction(e,function(){d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,n)})});t("bold",mxConstants.FONT_BOLD),t("italic",mxConstants.FONT_ITALIC),t("underline",mxConstants.FONT_UNDERLINE),this.addAction("shadow",function(){d.toggleCellStyles(mxConstants.STYLE_SHADOW)}),this.addAction("dashed",function(){d.toggleCellStyles(mxConstants.STYLE_DASHED)}),this.addAction("rounded",function(){d.toggleCellStyles(mxConstants.STYLE_ROUNDED)}),this.addAction("curved",function(){d.toggleCellStyles(mxConstants.STYLE_CURVED)}),this.addAction("style",function(){var e=d.getSelectionCells();if(null!=e&&0<e.length){var n=d.getModel(),t=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("style")+")",n.getStyle(e[0])||"");null!=t&&d.setCellStyle(t,e)}}),this.addAction("setAsDefaultEdge",function(){d.setDefaultEdge(d.getSelectionCell())}),this.addAction("addWaypoint",function(){var e=d.getSelectionCell();if(null!=e&&d.getModel().isEdge(e)){var n=l.graph.selectionCellsHandler.getHandler(e);if(n instanceof mxEdgeHandler){var t=d.view.translate,a=d.view.scale,i=t.x,s=t.y,o=d.getModel().getParent(e),r=d.getCellGeometry(o);d.getModel().isVertex(o)&&null!=r&&(i+=r.x,s+=r.y),n.addPointAt(n.state,d.panningHandler.triggerX/a-i,d.panningHandler.triggerY/a-s)}}}),this.addAction("removeWaypoint",function(){var e=n.actions.get("removeWaypoint");null!=e.handler&&e.handler.removePoint(e.handler.state,e.index)}),this.addAction("image",function(){var e="",n=d.getView().getState(d.getSelectionCell());if(null!=n&&(e=n.style[mxConstants.STYLE_IMAGE]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("url")+")",e))&&0<e.length){var t=new Image;t.onload=function(){!function(e,n,t){var a=null,i=d.getSelectionCells();d.getModel().beginUpdate();try{if(0==i.length){var s=d.getGridSize();a=i=[d.insertVertex(d.getDefaultParent(),null,"",s,s,n,t)]}if(d.setCellStyles(mxConstants.STYLE_IMAGE,e,i),d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i),1==d.getSelectionCount()&&null!=n&&null!=t){var o=i[0],r=d.getModel().getGeometry(o);null!=r&&((r=r.clone()).width=n,r.height=t,d.getModel().setGeometry(o,r))}}finally{d.getModel().endUpdate()}null!=a&&(d.setSelectionCells(a),d.scrollCellToVisible(a[0]))}(e,t.width,t.height)},t.onerror=function(){mxUtils.alert(mxResources.get("fileNotFound"))},t.src=e}})},Actions.prototype.addAction=function(e,n,t,a,i){return this.put(e,new Action(mxResources.get(e),n,t,a,i))},Actions.prototype.put=function(e,n){return this.actions[e]=n},Actions.prototype.get=function(e){return this.actions[e]},mxUtils.extend(Action,mxEventSource),Action.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.setToggleAction=function(e){this.toggleAction=e},Action.prototype.setSelectedCallback=function(e){this.selectedCallback=e},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(e){this.editorUi=e,this.menus=new Object,this.init(),(new Image).src=IMAGE_PATH+"/checkmark.gif"},Menus.prototype.init=function(){var i=this.editorUi.editor.graph;this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,n){for(var t=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],a=0;a<t.length;a++){this.styleChange(e,t[a],[mxConstants.STYLE_FONTFAMILY],[t[a]],null,n).firstChild.nextSibling.style.fontFamily=t[a]}e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,n)}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(e,n){for(var t=[6,8,9,10,11,12,14,18,24,36,48,72],a=0;a<t.length;a++)this.styleChange(e,t[a],[mxConstants.STYLE_FONTSIZE],[t[a]],null,n);e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"(pt)","12",mxConstants.STYLE_FONTSIZE,n)}))),this.put("linewidth",new Menu(mxUtils.bind(this,function(e,n){for(var t=[1,2,3,4,8,12,16,24],a=0;a<t.length;a++)this.styleChange(e,t[a]+"px",[mxConstants.STYLE_STROKEWIDTH],[t[a]],null,n);e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"(px)","1",mxConstants.STYLE_STROKEWIDTH,n)}))),this.put("line",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("straight"),[mxConstants.STYLE_EDGE],[null],null,n),this.styleChange(e,mxResources.get("entityRelation"),[mxConstants.STYLE_EDGE],["entityRelationEdgeStyle"],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("horizontal"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","horizontal"],null,n),this.styleChange(e,mxResources.get("vertical"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","vertical"],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("manual"),[mxConstants.STYLE_EDGE],["segmentEdgeStyle"],null,n),this.styleChange(e,mxResources.get("automatic"),[mxConstants.STYLE_EDGE],["orthogonalEdgeStyle"],null,n)}))),this.put("lineend",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_CLASSIC],null,n),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OPEN],null,n),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OVAL],null,n),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND],null,n),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND_THIN],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_ENDARROW],[mxConstants.NONE],null,n),e.addSeparator(n),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("endFill",!0)},n,null,!0),e.addSeparator(n),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_ENDSIZE,n)}))),this.put("linestart",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_CLASSIC],null,n),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OPEN],null,n),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OVAL],null,n),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND],null,n),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND_THIN],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_STARTARROW],[mxConstants.NONE],null,n),e.addSeparator(n),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("startFill",!0)},n,null,!0),e.addSeparator(n),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_STARTSIZE,n)}))),this.put("spacing",new Menu(mxUtils.bind(this,function(e,n){var t=this.editorUi.actions.get("shadow").enabled,a=this.get("line").enabled;(t||e.showDisabled)&&(this.promptChange(e,mxResources.get("top"),"(px)","0",mxConstants.STYLE_SPACING_TOP,n,t),this.promptChange(e,mxResources.get("right"),"(px)","0",mxConstants.STYLE_SPACING_RIGHT,n,t),this.promptChange(e,mxResources.get("bottom"),"(px)","0",mxConstants.STYLE_SPACING_BOTTOM,n,t),this.promptChange(e,mxResources.get("left"),"(px)","0",mxConstants.STYLE_SPACING_LEFT,n,t),e.addSeparator(n),this.promptChange(e,mxResources.get("global"),"(px)","0",mxConstants.STYLE_SPACING,n,t),this.promptChange(e,mxResources.get("perimeter"),"(px)","0",mxConstants.STYLE_PERIMETER_SPACING,n,t)),(a||e.showDisabled)&&(e.addSeparator(n),this.promptChange(e,mxResources.get("sourceSpacing"),"(px)","0",mxConstants.STYLE_SOURCE_PERIMETER_SPACING,n,a),this.promptChange(e,mxResources.get("targetSpacing"),"(px)","0",mxConstants.STYLE_TARGET_PERIMETER_SPACING,n,a))}))),this.put("format",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItem(e,"style",n)}))),this.put("text",new Menu(mxUtils.bind(this,function(e,n){var t=this.get("text").enabled;e.addSeparator(n),this.addSubmenu("fontFamily",e,n),this.addSubmenu("fontSize",e,n),this.addMenuItems(e,["-","bold","italic","underline","-"],n),this.addSubmenu("alignment",e,n),this.addMenuItem(e,"wordWrap",n),e.addSeparator(n),this.promptChange(e,mxResources.get("textOpacity"),"(%)","100",mxConstants.STYLE_TEXT_OPACITY,n,t),e.addItem(mxResources.get("hide"),null,function(){i.toggleCellStyles(mxConstants.STYLE_NOLABEL,!1)},n,null,t)}))),this.put("alignment",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("leftAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT],null,n),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER],null,n),this.styleChange(e,mxResources.get("rightAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("topAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP],null,n),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE],null,n),this.styleChange(e,mxResources.get("bottomAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM],null,n),e.addSeparator(n),this.addSubmenu("position",e,n),this.addSubmenu("spacing",e,n),e.addSeparator(n);var t=this.get("text").enabled;e.addItem(mxResources.get("vertical"),null,function(){i.toggleCellStyles(mxConstants.STYLE_HORIZONTAL,!0)},n,null,t)}))),this.put("position",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("left"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_RIGHT],null,n),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_CENTER],null,n),this.styleChange(e,mxResources.get("right"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_LEFT],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("top"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP,mxConstants.ALIGN_BOTTOM],null,n),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_MIDDLE],null,n),this.styleChange(e,mxResources.get("bottom"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_TOP],null,n)}))),this.put("direction",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("flipH"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},n),e.addItem(mxResources.get("flipV"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},n),this.addMenuItems(e,["-","tilt","rotation"],n)}))),this.put("align",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("leftAlign"),null,function(){i.alignCells(mxConstants.ALIGN_LEFT)},n),e.addItem(mxResources.get("center"),null,function(){i.alignCells(mxConstants.ALIGN_CENTER)},n),e.addItem(mxResources.get("rightAlign"),null,function(){i.alignCells(mxConstants.ALIGN_RIGHT)},n),e.addSeparator(n),e.addItem(mxResources.get("topAlign"),null,function(){i.alignCells(mxConstants.ALIGN_TOP)},n),e.addItem(mxResources.get("middle"),null,function(){i.alignCells(mxConstants.ALIGN_MIDDLE)},n),e.addItem(mxResources.get("bottomAlign"),null,function(){i.alignCells(mxConstants.ALIGN_BOTTOM)},n)}))),this.put("layout",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(e,!0,!0)}),n),e.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(e,!0,!0)}),n)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["home","-","exitGroup","enterGroup","-","expand","collapse"],n)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["toFront","toBack","-"],n),this.addSubmenu("layout",e,n),e.addSeparator(n),this.addMenuItems(e,["-","group","ungroup","removeFromGroup"],n)}))),this.put("view",new Menu(mxUtils.bind(this,function(n,t){this.addMenuItems(n,["actualSize"],t),n.addSeparator();for(var e=[.25,.5,.75,1,2,4],a=0;a<e.length;a++)!function(e){n.addItem(100*e+"%",null,function(){i.zoomTo(e)},t)}(e[a]);this.addMenuItems(n,["-","zoomIn","zoomOut","-","fitWindow","customZoom","-","fitPage","fitPageWidth"],t)}))),this.put("file",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["new","open","-","save","saveAs","publish","-","variable","-","import","export","-","editFile","description","-","print"],n)}))),this.put("edit",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","selectVertices","selectEdges","selectAll"])}))),this.put("help",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["help","-","about"])})))},Menus.prototype.put=function(e,n){this.menus[e]=n},Menus.prototype.get=function(e){return this.menus[e]},Menus.prototype.addSubmenu=function(e,n,t){var a=this.get(e).enabled;if(n.showDisabled||a){var i=n.addItem(mxResources.get(e),null,null,t,null,a);this.addMenu(e,n,i)}},Menus.prototype.addMenu=function(e,n,t){var a=this.get(e);null!=a&&(n.showDisabled||a.enabled)&&this.get(e).execute(n,t)},Menus.prototype.styleChange=function(e,n,t,a,i,s){return e.addItem(n,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{for(var n=0;n<t.length;n++)e.setCellStyles(t[n],a[n])}finally{e.getModel().endUpdate()}}),s,i)},Menus.prototype.promptChange=function(e,n,a,i,s,t,o){return e.addItem(n,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,n=i,t=e.getView().getState(e.getSelectionCell());null!=t&&(n=t.style[s]||n),null!=(n=mxUtils.prompt(mxResources.get("enterValue")+(0<a.length?" "+a:""),n))&&0<n.length&&e.setCellStyles(s,n)}),t,null,o)},Menus.prototype.addMenuItem=function(e,n,t){var a=this.editorUi.actions.get(n);if(null==a||!e.showDisabled&&!a.enabled)return null;var i=e.addItem(a.label,null,a.funct,t,null,a.enabled);return a.toggleAction&&a.isSelected()&&this.addCheckmark(i),this.addShortcut(i,a),i},Menus.prototype.addShortcut=function(e,n){if(null!=n.shortcut){var t=e.firstChild.nextSibling.nextSibling,a=document.createElement("span");a.style.color="gray",mxUtils.write(a,n.shortcut),t.appendChild(a)}},Menus.prototype.addCheckmark=function(e){var n=e.firstChild.nextSibling;n.style.backgroundImage="url("+IMAGE_PATH+"/checkmark.gif)",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="2px 50%"},Menus.prototype.addMenuItems=function(e,n,t){for(var a=0;a<n.length;a++)"-"==n[a]?e.addSeparator(t):this.addMenuItem(e,n[a],t)},Menus.prototype.createPopupMenu=function(e,n,t){var a=this.editorUi.editor.graph;if(e.smartSeparators=!0,a.isSelectionEmpty()?this.addMenuItems(e,["undo","redo","-","paste","-"]):(this.addMenuItems(e,["delete","-","cut","copy","-","duplicate"]),1==a.getSelectionCount()&&a.getModel().isEdge(a.getSelectionCell())&&this.addMenuItems(e,["setAsDefaultEdge"]),e.addSeparator()),0<a.getSelectionCount()){if(this.addMenuItems(e,["toFront","toBack","-"]),a.getModel().isEdge(a.getSelectionCell())){var i=!1;if(null!=(n=a.getSelectionCell())&&a.getModel().isEdge(n)){var s=a.selectionCellsHandler.getHandler(n);if(s instanceof mxEdgeHandler&&null!=s.bends&&2<s.bends.length){var o=s.getHandleForEvent(new mxMouseEvent(t)),r=this.editorUi.actions.get("removeWaypoint");r.handler=s,i=0<(r.index=o)&&o<s.bends.length}}this.addMenuItems(e,["-",i?"removeWaypoint":"addWaypoint"])}else 1<a.getSelectionCount()&&(e.addSeparator(),this.addMenuItems(e,["group"]));if(e.addSeparator(),1==a.getSelectionCount())null!=a.getLinkForCell(a.getSelectionCell())&&this.addMenuItems(e,["openLink"])}else this.addMenuItems(e,["-","selectVertices","selectEdges","-","selectAll"])},Menus.prototype.createMenubar=function(e){var n=new Menubar(this.editorUi,e),t=[];t=CRUD_PERMISSIONS.canEdit?["file","edit","view","format","text","arrange","help"]:["file","view","help"];for(var a=0;a<t.length;a++)n.addMenu(mxResources.get(t[a]),this.get(t[a]).funct);return n},Menubar.prototype.hideMenu=function(){null!=this.currentMenu&&this.currentMenu.hideMenu()},Menubar.prototype.addMenu=function(e,n){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.className="geItem",mxUtils.write(t,e),this.addMenuHandler(t,n),this.container.appendChild(t),t},Menubar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Menubar.prototype.addMenuHandler=function(i,s){if(null!=s){var o=!0,n=mxUtils.bind(this,function(e){if(o&&null==i.enabled||i.enabled){this.editorUi.editor.graph.panningHandler.hideMenu();var n=new mxPopupMenu(s);n.div.className+=" geMenubarMenu",n.smartSeparators=!0,n.showDisabled=!0,n.autoExpand=!0,n.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(n,arguments),n.destroy(),this.currentMenu=null,this.currentElt=null});var t=this.getOffset(i).left,a=this.getOffset(i).top+i.offsetHeight;n.popup(t,a,null,e),this.currentMenu=n,this.currentElt=i}o=!0,mxEvent.consume(e)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(e){null!=this.currentMenu&&this.currentElt!=i&&(this.hideMenu(),n(e))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){o=this.currentElt!=i})),mxEvent.addListener(i,"click",n)}},mxUtils.extend(Menu,mxEventSource),Menu.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(e,n){this.funct(e,n)},Toolbar.prototype.init=function(){CRUD_PERMISSIONS.canEdit?this.addItems(["save","publish","-","print","undo","redo","-","copy","cut","paste","delete","-","duplicate","-","actualSize","zoomIn","zoomOut","-"]):this.addItems(["print","actualSize","zoomIn","zoomOut","-"])},Toolbar.prototype.hideMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.currentMenu.destroy(),this.currentMenu=null)},Toolbar.prototype.addMenu=function(e,n,t,a){var i=this.editorUi.menus.get(a),s=this.addMenuFunction(e,n,t,i.funct);return i.addListener("stateChanged",function(){s.setEnabled(i.enabled)}),s},Toolbar.prototype.addMenuFunction=function(e,n,t,a){var i=t?this.createLabel(e):this.createButton(e);return this.initElement(i,n),this.addMenuHandler(i,t,a),this.container.appendChild(i),i},Toolbar.prototype.addSeparator=function(){var e=document.createElement("div");return e.className="geSeparator",this.container.appendChild(e),e},Toolbar.prototype.addItems=function(e){for(var n=0;n<e.length;n++){var t=e[n];"-"==t?this.addSeparator():this.addItem("geSprite-"+t.toLowerCase(),t)}},Toolbar.prototype.addItem=function(e,n){var t=this.editorUi.actions.get(n),a=null;return null!=t&&((a=this.addButton(e,t.label,t.funct)).setEnabled(t.enabled),t.addListener("stateChanged",function(){a.setEnabled(t.enabled)})),a},Toolbar.prototype.addButton=function(e,n,t){var a=this.createButton(e);return this.initElement(a,n),this.addClickHandler(a,t),this.container.appendChild(a),a},Toolbar.prototype.addSelectionHandler=function(t){var a=this.editorUi.editor.graph,e=function(){for(var e=!a.isSelectionEmpty(),n=0;n<t.length;n++)t[n].setEnabled(e)};a.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.addEdgeSelectionHandler=function(a){var i=this.editorUi.editor.graph,e=function(){var e=!1;if(!i.isSelectionEmpty())for(var n=i.getSelectionCells(),t=0;t<n.length;t++)if(i.getModel().isEdge(n[t])){e=!0;break}for(t=0;t<a.length;t++)a[t].setEnabled(e)};i.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.initElement=function(e,n){e.setAttribute("tabindex","0"),null!=n&&e.setAttribute("title",n),this.addEnabledState(e)},Toolbar.prototype.addEnabledState=function(n){var t=n.className;n.setEnabled=function(e){n.enabled=e,n.className=e?t:t+" geDisabled"},n.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(n,t){null!=t&&mxEvent.addListener(n,"click",function(e){n.enabled&&t(e),mxEvent.consume(e)})},Toolbar.prototype.createButton=function(e){var n=document.createElement("a");n.setAttribute("href","javascript:void(0);"),n.className="geButton";var t=document.createElement("div");return t.className="geSprite "+e,n.appendChild(t),n},Toolbar.prototype.createLabel=function(e,n){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.className="geLabel",mxUtils.write(t,e),t},Toolbar.prototype.addMenuHandler=function(n,t,a,i){if(null!=a){var s=this.editorUi.editor.graph,o=null;mxEvent.addListener(n,"click",mxUtils.bind(this,function(e){(null==n.enabled||n.enabled)&&(s.panningHandler.hideMenu(),(o=new mxPopupMenu(a)).div.className+=" geToolbarMenu",o.showDisabled=i,o.labels=t,o.autoExpand=!0,o.popup(n.offsetLeft,n.offsetTop+n.offsetHeight+34,null,e),this.currentMenu=o),mxEvent.consume(e)}))}},Dialog.prototype.close=function(){null!=this.onDialogClose&&(this.onDialogClose(),this.onDialogClose=null),this.container.parentNode.removeChild(this.container),this.bg.parentNode.removeChild(this.bg)},angular.module("motion").run(["$templateCache",function(e){"use strict";e.put("app/auth/services/hotdesk/dialog.html",'<md-dialog aria-label="Telephone">\n  <form ng-cloak>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="LOGIN.TELEPHONES">Telephones</span>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <md-select ng-model="vm.name" placeholder="Select a telephone">\n        <md-option value="{{telephone.name}}" ng-repeat="telephone in vm.telephones.rows">{{telephone.fullname}}</md-option>\n      </md-select>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row">\n      <md-button ng-click="vm.closeDialog(vm.name)" class="send-button md-accent md-raised" aria-label="call" ng-disabled="!vm.name">\n        <span translate="LOGIN.SELECT">SELECT</span>\n      </md-button>\n      \x3c!-- <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n                <span translate="LOGIN.CANCEL">Cancel</span>\n            </md-button> --\x3e\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/core/dialogs/advanced-search/dialog.html",'<md-dialog class="advanced-search-dialog" aria-label="Advanced search" flex="70" ng-init="vm.onInit()">\n  <form ng-cloak>\n    <md-toolbar class="advanced-search-dialog-header" ng-class="{{ \'vm.toolbarColor\' }} + \'-bg\'">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="DASHBOARDS.ADVANCED_SEARCH"></span>\n        </div>\n        <div layout="row" layout-align="end center">\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.minimize()">\n            <md-icon class="no-margin" md-font-icon="icon-window-minimize" aria-label="Minimize dialog"></md-icon>\n          </md-button>\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.close()">\n            <md-icon class="no-margin" md-font-icon="icon-window-close" aria-label="Close dialog"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <ms-advanced-search options="vm.searchOptions" clear-filter="vm.clearConditions()"></ms-advanced-search>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row">\n      <md-button class="md-primary md-raised" aria-label="Clear" ng-disabled="vm.searchOptions.conditions.length === 0" translate="DASHBOARDS.CLEAR" translate-attr-aria-label="DASHBOARDS.CLEAR" ng-click="vm.clearConditions()"></md-button>\n      <md-button class="md-primary md-accent md-raised" aria-label="Apply" ng-disabled="vm.searchOptions.conditions.length === 0" translate="DASHBOARDS.APPLY" translate-attr-aria-label="DASHBOARDS.APPLY" ng-click="vm.applyFilter()"></md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/core/directives/ms-advanced-search/ms-advanced-search.html",'<div layout="column" class="advanced-search-container" flex>\n  <div layout-margin>\n    <md-radio-group ng-model="vm.options.matchType" class="md-primary" layout="row">\n      <md-radio-button value="$and" class="md-primary">{{ \'DASHBOARDS.MEET_ALL_CONDITIONS\' | translate }}\n      </md-radio-button>\n      <md-radio-button value="$or">{{ \'DASHBOARDS.MEET_ANY_CONDITIONS\' | translate }}</md-radio-button>\n    </md-radio-group>\n  </div>\n\n  \x3c!-- ACTIVE CONDITIONS --\x3e\n  <div layout="row" ng-if="vm.options.conditions.length > 0" class="advanced-search-conditions">\n    <md-list>\n      <md-list-item>\n        <md-chips ng-model="vm.options.conditions" class="advanced-search-chips" readonly="true" md-removable="true" md-on-remove="vm.removeCondition()">\n          <md-chip-template ms-chip-color="{{ $chip.style }}">\n            <md-menu md-offset="50 0" ng-class="{\'no-click\': vm.pendingCondition}">\n              <span>\n                <p class="filter-text">{{ $chip.name }}</p>\n                <em ng-show="$chip.operator" class="text-lowercase">{{ $chip.operator }}</em>\n                <strong>{{ $chip.displayValue }}</strong>\n                <em ng-show="$chip.displayEndValue" class="text-lowercase">{{ \'DASHBOARDS.AND\' | translate }}</em>\n                <strong>{{ $chip.displayEndValue }}</strong>\n              </span>\n              <md-menu-content width=2 class="md-dense">\n                <md-menu-item ng-hide="$chip.disabled">\n                  <md-button ng-click="vm.editCondition($chip)">Edit\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.setConditionStatus($chip)">\n                    {{ $chip.disabled ? \'Enable\' : \'Disable\' }}\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </md-chip-template>\n          <button type="button" md-chip-remove class="md-primary remove-filter">\n            <md-icon md-font-icon="icon-cancel" aria-label="Remove Filter"></md-icon>\n          </button>\n        </md-chips>\n      </md-list-item>\n    </md-list>\n  </div>\n\n  \x3c!-- FILTERS --\x3e\n  <div layout="row">\n    <div layout="row" class="advanced-search-bar" layout-margin flex>\n      \x3c!-- FIELD --\x3e\n      <md-input-container flex="35">\n        <md-icon md-font-icon="icon-filter-variant"></md-icon>\n        <md-select class="font-size-12" ng-model="vm.selectedField" ng-change="vm.onFieldChange()" placeholder="{{ \'DASHBOARDS.SELECT_FIELD\' | translate }}" aria-label="Field">\n          <md-option ng-value="field" ng-repeat="field in vm.options.fields">{{ field.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- OPERATOR --\x3e\n      <md-input-container flex="30">\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <md-select class="font-size-12" ng-model="vm.selectedOperator" ng-change="vm.onOperatorChange(oldValue)" ng-focus="oldValue=vm.selectedOperator" md-selected-text="vm.selectedOperator ? (\'DASHBOARDS.\' + vm.selectedOperator.translate | translate) : (\'DASHBOARDS.SELECT_OPERATOR\' | translate)" ng-disabled="!vm.selectedField" aria-label="Operator">\n          <md-option ng-value="operator" ng-repeat="operator in vm.availableOperators" ng-selected="vm.autoSelectOperator">\n            <div layout="row" class="operators-list">\n              <span class="operator-symbol">\n                {{ operator.symbol }}\n              </span>\n              <span>\n                {{ \'DASHBOARDS.\' + operator.translate | translate }}\n              </span>\n            </div>\n          </md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TEXT INPUT --\x3e\n      <md-input-container ng-if="!vm.selectedField.type || vm.selectedField.type === \'text\'" class="no-errors" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <input type="text" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}">\n      </md-input-container>\n      \x3c!-- NUMERIC INPUT --\x3e\n      <div ng-if="vm.selectedField.type === \'number\'" flex layout="row" layout-margin class="no-margin">\n        <md-input-container class="no-errors" flex>\n          <md-icon md-font-icon="icon-numeric"></md-icon>\n          <input type="number" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" min="0" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ vm.selectedOperator.type === \'$between\' ? \'DASHBOARDS.STARTING_VALUE\' : \'DASHBOARDS.VALUE\' | translate }}">\n        </md-input-container>\n        <md-input-container class="no-errors" ng-if="vm.selectedOperator.type === \'$between\'" ng-class="{\'md-input-invalid\': !vm.isValidRange}" flex>\n          <md-icon md-font-icon=" icon-numeric">\n          </md-icon>\n          <input class="md-input" type="number" aria-label="Value" ng-model="vm.endRangeValue" ng-change="vm.checkRange()" ng-disabled="!vm.value" min="vm.value" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.ENDING_VALUE\' | translate }}">\n          <div ng-if="!vm.isValidRange" class="md-input-message-animation md-input-messages-animation">\n            {{ (\'DASHBOARDS.VALUE_RANGE_CHECK\' | translate) + \' \' + vm.value }}\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- SELECT --\x3e\n      <md-input-container ng-if="vm.selectedField.type === \'select\'" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <md-select class="font-size-12" ng-model="vm.value" md-on-open="vm.getValues()" ng-change="vm.onValueChange()" ng-model-options="{trackBy: \'$value.id\'}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}" aria-label="Value">\n          <md-option ng-value="item" ng-repeat="item in vm.selectedField.values">{{item.name}}\n          </md-option>\n        </md-select>\n      </md-input-container>\n      \x3c!-- MULTISELECT --\x3e\n      <md-input-container ng-if="vm.selectedField.type === \'multiselect\'" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <md-select class="font-size-12" multiple ng-model="vm.value" md-on-open="vm.getValues()" ng-change="vm.onValueChange()" ng-model-options="{trackBy: \'$value.id\'}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}" aria-label="Value">\n          <md-option ng-value="item" ng-repeat="item in vm.selectedField.values">{{item.name}}\n          </md-option>\n        </md-select>\n      </md-input-container>\n      \x3c!-- DATE INPUT --\x3e\n      <div ng-if="vm.selectedField.type === \'date\'" flex layout="row">\n        <mdp-date-picker mdp-open-on-click ng-model="vm.value" ng-change="vm.onValueChange()" mdp-max-date="vm.maxDateRange" mdp-placeholder="{{ vm.selectedOperator.type === \'$between\' ? \'DASHBOARDS.STARTING_DATE\' : \'DASHBOARDS.VALUE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n        </mdp-date-picker>\n        <mdp-date-picker mdp-open-on-click ng-if="vm.selectedOperator.type === \'$between\'" ng-change="vm.checkRange()" ng-model="vm.endRangeValue" mdp-min-date="vm.minDateRange" mdp-disabled="!vm.value" mdp-placeholder="{{ \'DASHBOARDS.ENDING_DATE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n        </mdp-date-picker>\n      </div>\n      \x3c!-- AUTOCOMPLETE --\x3e\n      <div layout="row" layout-align="start start" ng-if="vm.selectedField.type === \'autocomplete\' && vm.selectedOperator.type != \'$substring\'" class=" autocomplete-input" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <md-autocomplete md-selected-item="vm.value" md-selected-item-change="vm.onValueChange()" md-items="item in vm.getValues()" md-search-text="vm.searchText" md-item-text="item.displayValue" md-min-length="4" md-no-cache="true" md-floating-label="{{ \'DASHBOARDS.VALUE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n          <md-item-template>\n            <span md-highlight-text="vm.searchText" md-highlight-flags="i">{{item.displayValue}}</span>\n          </md-item-template>\n        </md-autocomplete>\n      </div>\n      <md-input-container ng-if="vm.selectedField.type === \'autocomplete\' && vm.selectedOperator.type === \'$substring\'" class="no-errors" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <input type="text" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}">\n      </md-input-container>\n    </div>\n    <md-button class="md-fab md-mini md-primary mt-20" ng-if="!vm.pendingCondition" ng-disabled="!vm.isValidCondition" aria-label="Add filter" ng-click="vm.addCondition()" translate-attr-aria-label="DASHBOARDS.ADD">\n      <md-icon md-font-icon="icon-plus"></md-icon>\n    </md-button>\n    <md-button class="md-fab md-mini mt-20" ng-if="vm.pendingCondition" ng-disabled="!vm.isValidCondition" aria-label="Update filter" ng-click="vm.updateCondition()" translate-attr-aria-label="DASHBOARDS.UPDATE">\n      <md-icon md-font-icon="icon-check"></md-icon>\n    </md-button>\n    <md-button class="md-fab md-mini md-primary mt-20" ng-if="vm.pendingCondition" aria-label="Cancel filter update" ng-click="vm.cancelUpdateCondition()" translate-attr-aria-label="DASHBOARDS.CANCEL">\n      <md-icon md-font-icon="icon-close"></md-icon>\n    </md-button>\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-1/template-1.html",'<div class="template-1">\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n\n  <div class="content pv-24 ph-16">\n    <div class="title h1" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="subtitle secondary-text" ng-if="card.subtitle">\n      {{card.subtitle}}\n    </div>\n\n    <div class="text pt-16" ng-if="card.text">\n      {{card.text}}\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-10/template-10.html",'<div class="template-10 p-16">\n  <div class="pb-16" layout="row" layout-align="space-between center">\n    <div class="info">\n      <div class="title secondary-text" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle h2" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n    </div>\n\n    <div class="media ml-16">\n      <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n    </div>\n  </div>\n\n  <div class="text">\n    {{card.text}}\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-2/template-2.html",'<div class="template-2">\n  <div class="header p-16" layout="row" layout-align="start center">\n    <div ng-if="card.avatar">\n      <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n    </div>\n\n    <div class="info">\n      <div class="title" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle secondary-text" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n    </div>\n  </div>\n\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n\n  <div class="text p-16" ng-if="card.text">\n    {{card.text}}\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-3/template-3.html",'<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between">\n  <div layout="column" layout-align="space-between">\n    <div class="info">\n      <div class="title h1" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle h3 secondary-text" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n    </div>\n\n    <div class="cta">\n      <md-button class="m-0">{{card.cta}}</md-button>\n    </div>\n  </div>\n\n  <div class="media pl-16">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-4/template-4.html",'<div class="template-4">\n  <div class="info white-fg ph-16 pv-24">\n    <div class="title h1" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="text" ng-if="card.text">\n      {{card.text}}\n    </div>\n  </div>\n\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-5/template-5.html",'<div class="template-5 p-16" layout="row" layout-align="space-between start">\n  <div class="info">\n    <div class="title secondary-text" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="event h2" ng-if="card.event">\n      {{card.event}}\n    </div>\n  </div>\n\n  <div class="media ml-16">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-6/template-6.html",'<div class="template-6">\n  <div class="content pv-24 ph-16">\n    <div class="subtitle secondary-text" ng-if="card.subtitle">\n      {{card.subtitle}}\n    </div>\n\n    <div class="title h2" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="text pt-8" ng-if="card.text">\n      {{card.text}}\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-7/template-7.html",'<div class="template-7" layout="row" layout-align="space-between">\n  <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n    <div class="p-16">\n      <div class="title h1" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle h4 secondary-text" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n\n      <div class="text h4 pt-8" ng-if="card.text">\n        {{card.text}}\n      </div>\n    </div>\n\n    <div>\n      <md-divider></md-divider>\n      <div class="p-8" layout="row">\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n      </div>\n    </div>\n  </div>\n\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-8/template-8.html",'<div class="template-8">\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n\n  <div class="content pv-24 ph-16">\n    <div class="title h1" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="subtitle secondary-text" ng-if="card.subtitle">\n      {{card.subtitle}}\n    </div>\n\n    <div class="buttons pt-16">\n      <md-button class="m-0">{{card.button1}}</md-button>\n      <md-button class="m-0 md-accent">{{card.button2}}</md-button>\n    </div>\n\n    <div class="text pt-16" ng-if="card.text">\n      {{card.text}}\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-9/template-9.html",'<div class="template-9">\n  <div class="header p-16" layout="row" layout-align="start center">\n    <div ng-if="card.avatar">\n      <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n    </div>\n\n    <div class="info">\n      <div class="title" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle secondary-text" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n\n    </div>\n  </div>\n\n  <div class="text ph-16 pb-16" ng-if="card.text">\n    {{card.text}}\n  </div>\n\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n\n  <div class="buttons m-8">\n    <md-button class="md-icon-button mr-16" aria-label="Favorite">\n      <md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon>\n    </md-button>\n    <md-button class="md-icon-button" aria-label="Share">\n      <md-icon md-font-icon="icon-share" class="s24"></md-icon>\n    </md-button>\n  </div>\n\n</div>'),e.put("app/core/directives/ms-click-to-call/ms-click-to-call.html",'<section ng-if="type !== \'button\'">\n  <span ng-if="!showMenu()" privacy="{{ privacy }}" ng-cloak>{{target}}</span>\n  <md-menu ng-if="showMenu()">\n    <a aria-label="Target" ng-click="$mdOpenMenu($event)">\n      <span ng-if="prefix" privacy="{{ privacy }}" ng-cloak>{{prefix}}-</span>\n      <span privacy="{{ privacy }}" ng-cloak>{{target}}</span>\n    </a>\n    <md-menu-content width="2">\n      <md-menu-item>\n        <md-button ng-click="call(prefix ? prefix + target : target)">\n          {{\'DASHBOARDS.CALL_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n        </md-button>\n      </md-menu-item>\n      <md-menu-item>\n        <md-button ng-click="transfer(prefix ? prefix + target : target)">\n          {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n        </md-button>\n      </md-menu-item>\n    </md-menu-content>\n  </md-menu>\n</section>\n<section ng-if="type === \'button\'">\n  <md-button ng-if="!showMenu()" ng-disabled="true" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" aria-label="NEW CALL">\n    <md-icon md-font-icon="icon-phone"></md-icon>\n  </md-button>\n  <md-menu ng-if="showMenu()">\n    <md-button class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" ng-click="$mdOpenMenu($event)" aria-label="NEW CALL">\n      <md-icon md-font-icon="icon-phone"></md-icon>\n    </md-button>\n    <md-menu-content width="2">\n      <md-menu-item>\n        <md-button ng-click="call(prefix ? prefix + target : target)">\n          {{\'DASHBOARDS.CALL_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n        </md-button>\n      </md-menu-item>\n      <md-menu-item>\n        <md-button ng-click="transfer(target)">\n          {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n        </md-button>\n      </md-menu-item>\n    </md-menu-content>\n  </md-menu>\n</section>'),e.put("app/core/directives/ms-client-side-logging/ms-client-side-logging-icon.html",'<md-icon ng-style="vm.styleColor" md-font-icon="{{ vm.styleIcon }}">\n  <md-tooltip class="client-side-logging-tooltip">\n    <span ng-bind-html="vm.tooltipHTML"></span>\n  </md-tooltip>\n</md-icon>'),e.put("app/core/directives/ms-client-side-logging/ms-client-side-logging.html",'<md-content layout="column">\n  <form name="clientSideLoggingSettingsForm">\n    <div flex layout="column" layout-align="stretch center">\n      <div ng-if="vm.user.userSetting.clientSideLoggingEnabled" class="md-amber-500-bg p-10" layout="row" layout-align="start center">\n        <span class="no-margin font-size-14 line-height-30" translate="STAFF.CLIENT_LOGS_ALL_ENABLED_WARNING" flex></span>\n      </div>\n      <md-input-container>\n        <md-switch ng-model="vm.user.userSetting.clientSideLoggingEnabled" aria-label="Manage client side logging" ng-change="vm.onEnabledSwitchChange()">\n          {{ vm.user.userSetting.clientSideLoggingEnabled ? \'STAFF.CLIENT_LOGS_ENABLED\' : \'STAFF.CLIENT_LOGS_DISABLED\' | translate }}\n        </md-switch>\n      </md-input-container>\n      <h2 ng-if="vm.user.userSetting.clientSideLoggingEnabled" class="md-subhead mt-0">{{ vm.clientSideLoggingEnabledSince }}</h2>\n    </div>\n    <div layout="column" layout-align="stretch center">\n      <md-input-container ng-if="vm.user.userSetting.clientSideLoggingEnabled">\n        <label>{{ \'STAFF.CLIENT_LOGS_LOGLEVEL_SELECT\' | translate }}</label>\n        <md-select ng-if="vm.user.userSetting.clientSideLoggingEnabled" ng-model="vm.user.userSetting.clientSideLoggingLevel" placeholder="Debugging level" ng-change="vm.onLogLevelSelectionChange()" flex="30">\n          <md-option ng-value="loggingLevel" ng-repeat="loggingLevel in vm.availableClientSideLoggingLevels">\n            <md-icon ng-style="vm.computeStyleForLoggingLevel(loggingLevel)" md-font-icon="{{ loggingLevel === \'info\' ? \'icon-checkbox-blank-circle-outline\' : \'icon-checkbox-blank-circle\' }}"></md-icon>\n            {{ loggingLevel }}\n          </md-option>\n        </md-select>\n      </md-input-container>\n    </div>\n  </form>\n</md-content>'),e.put("app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html",'<div ng-cloak layout-gt-sm="row" layout="column">\n  <div flex-gt-sm="50" flex="45">\n    <md-input-container class="md-icon-float md-block margin-0">\n      <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n      <input ng-model="query" type="text" placeholder="{{ \'STAFF.PERMISSIONS_PLACEHOLDER_SEARCH\' | translate }}">\n    </md-input-container>\n    <md-content class="border h-300">\n      <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n        <md-list-item class="md-3-line" ng-class="{\'read-only-mode\': vm.readOnly || vm.addDisabled}" ng-disabled="vm.readOnly || vm.addDisabled" ng-repeat="item in availableItems = (vm.options.items | filter: query) | orderBy: vm.options.orderBy" ng-click="vm.canTransfer(item, vm.options, false)">\n          <div class="md-list-item-text" layout="column">\n            <h3 ng-if="vm.options.line1">{{vm.getLine(item, vm.options.line1)}}</h3>\n            <h4 ng-if="vm.options.line2">{{vm.getLine(item, vm.options.line2)}}</h4>\n            <p ng-if="vm.options.line3">{{vm.getLine(item, vm.options.line3)}}</p>\n            <p class="ms-dual-multiselect-line-xs" ng-if="vm.options.line4">{{vm.getLine(item, vm.options.line4)}}\n            </p>\n          </div>\n          <md-icon ng-hide="vm.readOnly && !vm.addDisabled" ng-class="{\'add-disabled\': vm.addDisabled}" md-font-icon="icon-arrow-right-bold" aria-label="swap">\n          </md-icon>\n          <md-divider></md-divider>\n        </md-list-item>\n      </md-list>\n    </md-content>\n    <div class="margin-10" layout="row">\n      <span class="h4" flex>{{vm.options.labelAll || \'All Items\'}} ({{availableItems.length}})</span>\n      <md-icon ng-hide="vm.options.showSelectAndDeselectAll === false || vm.readOnly" ng-class="{\'add-disabled\': vm.addDisabled}" ng-disabled="vm.addDisabled" md-font-icon="icon-chevron-double-right" aria-label="swap" ng-click="vm.transfer(vm.options.items, vm.options.selectedItems, -1, false)"></md-icon>\n    </div>\n  </div>\n\n  <div flex="10" layout="row" layout-align="center center">\n    <md-icon md-font-icon="icon-swap-horizontal" aria-label="swap"></md-icon>\n  </div>\n\n  <div flex-gt-sm="50" flex="45">\n    <md-input-container class="md-icon-float md-block margin-0">\n      <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n      <input ng-model="selectedQuery" type="text" placeholder="{{ \'STAFF.PERMISSIONS_PLACEHOLDER_SEARCH\' | translate }}">\n    </md-input-container>\n    <md-content class="border h-300">\n      <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n        <md-list-item class="md-3-line" ng-class="{\'read-only-mode\': vm.readOnly || !item.isValid}" ng-disabled="vm.readOnly" ng-repeat="item in associatedItems = (vm.options.selectedItems | filter: selectedQuery) | orderBy: vm.options.orderBy" ng-click="vm.canTransfer(item, vm.options, true)">\n          <md-icon ng-class="{\'hidden\': vm.readOnly || !item.isValid}" md-font-icon="icon-arrow-left-bold" aria-label="swap"></md-icon>\n          <div class="md-list-item-text" layout="column">\n            <h3 ng-if="vm.options.line1">{{vm.getLine(item, vm.options.line1)}}</h3>\n            <h4 ng-if="vm.options.line2">{{vm.getLine(item, vm.options.line2)}}</h4>\n            <p ng-if="vm.options.line3">{{vm.getLine(item, vm.options.line3)}}</p>\n            <p class="ms-dual-multiselect-line-xs" ng-if="vm.options.line4">{{vm.getLine(item, vm.options.line4)}}\n            </p>\n          </div>\n          <md-divider></md-divider>\n        </md-list-item>\n      </md-list>\n    </md-content>\n    <div class="margin-10" layout="row">\n      <md-icon ng-hide="vm.options.showSelectAndDeselectAll === false || vm.readOnly" md-font-icon="icon-chevron-double-left" aria-label="swap" ng-click="vm.transfer(vm.options.selectedItems, vm.options.items, -1, true)"></md-icon>\n      <span class="h4 text-right" flex>{{vm.options.labelSelected || \'Selected Items\'}}\n        ({{associatedItems.length}})</span>\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-font-family/ms-font-family.html",'<md-select ng-model="ngModel" class="no-margin">\n  <md-option ng-repeat="font in fonts" ng-value="font.value"><span ng-style="{\'font-family\': font.value}">{{font.option}}</span>\n  </md-option>\n</md-select>'),e.put("app/core/directives/ms-info-bar/ms-info-bar.html",'<div id="ms-info-bar" layout="row" layout-align="start center" flex>\n  <div id="ms-info-bar-message" ng-transclude flex></div>\n  <md-button id="ms-info-bar-close" class="md-icon-button" aria-label="Close" ng-click="removeInfoBar()">\n    <md-icon md-font-icon="icon-close s20"></md-icon>\n  </md-button>\n</div>'),e.put("app/core/directives/ms-material-color-picker/ms-material-color-picker.html",'<md-menu md-position-mode="target-right target">\n\n  <div ng-click="$mdOpenMenu($event)">\n    <ms-color-picker-button>\n      <md-button aria-label="Row Color" md-menu-origin ng-click="$mdOpenMenu($event)" ng-class="vm.selectedColor.class">\n\n        <span ng-show="vm.selectedColor.palette">\n          {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n        </span>\n        <span ng-show="!vm.selectedColor.palette">\n          Select Color\n        </span>\n      </md-button>\n    </ms-color-picker-button>\n  </div>\n\n  <md-menu-content class="ms-material-color-picker-menu-content" layout-column>\n\n    <header ng-class="vm.selectedColor.class || \'md-accent-bg\'" class="md-whiteframe-4dp" layout="row" layout-align="space-between center">\n      <md-button md-prevent-menu-close ng-click="vm.activateHueSelection(false,false)" class="md-icon-button" ng-class="{\'hidden\':!vm.selectedPalette}" aria-label="Palette">\n        <md-icon md-font-icon="icon-arrow-left" class="s20"></md-icon>\n      </md-button>\n\n      <span ng-if="vm.selectedColor.palette">\n        {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n      </span>\n\n      <span ng-if="!vm.selectedColor.palette">\n        Select Color\n      </span>\n\n      <md-button class="remove-color-button md-icon-button" ng-click="vm.removeColor()" aria-label="Remove Color">\n        <md-icon md-font-icon="icon-delete" class="s20"></md-icon>\n      </md-button>\n    </header>\n\n    <div class="colors">\n      <div ng-show="!vm.selectedPalette" layout="row" layout-wrap>\n        <div class="color" ng-class="\'md-\'+palette+\'-500-bg\'" ng-repeat="(palette, hues) in vm.palettes" ng-click="vm.activateHueSelection(palette,hues)" layout="row" layout-align="start end" md-prevent-menu-close md-ink-ripple>\n          <span class="label">\n            {{palette}}\n          </span>\n        </div>\n      </div>\n\n      <div ng-show="vm.selectedPalette" layout="row" layout-wrap>\n        <div class="color" ng-class="\'md-\'+vm.selectedPalette+\'-\'+hue+\'-bg\'" ng-repeat="(hue, values) in vm.selectedHues" ng-click="vm.selectColor(vm.selectedPalette,hue)" layout="row" layout-align="start end" md-ink-ripple>\n          <span class="label">\n            {{hue}}\n          </span>\n          <i ng-if="vm.selectedPalette == vm.selectedColor.palette && hue == vm.selectedColor.hue" class="s16 icon-check">\n          </i>\n        </div>\n      </div>\n\n    </div>\n\n  </md-menu-content>\n</md-menu>'),e.put("app/core/directives/ms-navigation/templates/horizontal.html",'<div class="navigation-toggle" hide-gt-sm>\n  <md-button class="md-icon-button" ng-click="vm.toggleHorizontalMobileMenu()" aria-label="Toggle Mobile Navigation">\n    <md-icon md-font-icon="icon-menu"></md-icon>\n  </md-button>\n</div>\n\n<ul class="horizontal">\n  <li ng-repeat="node in vm.navigation" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested horizontal navigation template --\x3e\n<script type="text/ng-template" id="navigation-horizontal-nested.html">\n\n  <div ms-navigation-horizontal-item layout="row" ng-if="!vm.isHidden()">\n\n        <div class="ms-navigation-horizontal-button" ng-if="!node.uisref && node.title"\n             ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}">\n            <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n            <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n            <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n            <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n        </div>\n\n        <a class="ms-navigation-horizontal-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg"\n           ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}"\n           ng-if="node.uisref && node.title">\n            <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n            <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n            <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n            <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n        </a>\n\n    </div>\n\n    <ul ng-if="vm.hasChildren && !vm.isHidden()">\n        <li ng-repeat="node in node.children" ms-navigation-horizontal-node="node"\n            ng-class="{\'has-children\': vm.hasChildren}"\n            ng-include="\'navigation-horizontal-nested.html\'"></li>\n    </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("app/core/directives/ms-navigation/templates/vertical.html",'<ul>\n  <li ng-repeat="node in vm.navigation" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested navigation template --\x3e\n<script type="text/ng-template" id="navigation-nested.html">\n\n  <div id="{{ node.id }}" ms-navigation-item layout="row" ng-if="!vm.isHidden()">\n\n        <div class="ms-navigation-button" ng-if="!node.uisref && node.title">\n            <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n            <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n            <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n            <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n        </div>\n\n        <a class="ms-navigation-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-if="node.uisref && node.title">\n            <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n            <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n            <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n            <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n        </a>\n\n    </div>\n\n    <ul ng-if="vm.hasChildren && !vm.isHidden()">\n        <li ng-repeat="node in node.children" ms-navigation-node="node"\n            ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}"\n            ng-include="\'navigation-nested.html\'"></li>\n    </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-dialpad.html",'\x3c!-- Dialpad --\x3e\n<md-content ng-if="vm_pb.showDialpad" class="num-pad" layout="column">\n  <section layout="row" layout-align="start center">\n    <span><img class="num-pad-logo" layout-padding src="/api/settings/1/logo" alt="logo" /></span>\n    <span class="md-subhead">Dialpad</span>\n    <div layout="row" layout-align="end center" flex>\n      <md-button class="md-icon-button" ng-click="vm_pb.closeDialpad()">\n        <md-icon md-font-icon="icon-close"></md-icon>\n      </md-button>\n    </div>\n  </section>\n  <md-divider></md-divider>\n  <section layout="row">\n    <div class="span4" ng-repeat="item in ::[{n: 1, l: []}, {n: 2, l: [\'a\', \'b\', \'c\']}, {n: 3, l: [\'d\', \'e\', \'f\']}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num">\n        <div class="txt">\n          {{item.n}} <span class="small">\n            <p>\n              <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n            </p>\n          </span>\n        </div>\n      </div>\n    </div>\n  </section>\n  <section layout="row">\n    <div class="span4" ng-repeat="item in ::[{n: 4, l: [\'g\', \'h\', \'i\']}, {n: 5, l: [\'j\', \'k\', \'l\']}, {n: 6, l: [\'m\', \'n\', \'o\']}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num">\n        <div class="txt">\n          {{item.n}} <span class="small">\n            <p>\n              <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n            </p>\n          </span>\n        </div>\n      </div>\n    </div>\n  </section>\n  <section layout="row">\n    <div class="span4" ng-repeat="item in ::[{n: 7, l: [\'p\', \'q\', \'r\', \'s\']}, {n: 8, l: [\'t\', \'u\', \'v\']}, {n: 9, l: [\'w\', \'x\', \'y\', \'z\']}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num">\n        <div class="txt">\n          {{item.n}} <span class="small">\n            <p>\n              <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n            </p>\n          </span>\n        </div>\n      </div>\n    </div>\n  </section>\n  <section layout="row">\n    <div class="span4" ng-repeat="item in ::[{n: \'*\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num" layout="column" layout-align="center center">\n        <div class="txt" layout="column" layout-align="center center">\n          {{item.n}}\n        </div>\n      </div>\n    </div>\n    <div class="span4" ng-repeat="item in ::[{n: 0, l: [\'+\']}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num">\n        <div class="txt">\n          {{item.n}} <span class="small">\n            <p>\n              <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n            </p>\n          </span>\n        </div>\n      </div>\n    </div>\n    <div class="span4" ng-repeat="item in ::[{n: \'#\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num" layout="column" layout-align="center center">\n        <div class="txt" layout="column" layout-align="center center">\n          {{item.n}}\n        </div>\n      </div>\n    </div>\n  </section>\n</md-content>\n\x3c!-- Dialpad --\x3e\n\n\x3c!-- Input&Media Area --\x3e\n<div layout="row" layout-align="start center">\n  <div layout="row" layout-align="center center">\n    \x3c!-- START Ringing Tone--\x3e\n    <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Ringing" ng-click="vm_pb.conf.ringingMute = !vm_pb.conf.ringingMute; vm_pb.initDevice(\'ringing\', true)" ng-disabled="!vm_pb.registered">\n      <md-icon md-font-icon="{{vm_pb.conf.ringingMute ? \'icon-bell-off\' : \'icon-bell-ring\'}}" class="icon s14" ng-class="vm_pb.conf.ringingMute ? \'red-fg\' : \'grey-fg\'">\n        <md-tooltip><span translate="TOOLBAR.RINGING">Ringing</span></md-tooltip>\n      </md-icon>\n    </md-button>\n    \x3c!-- END Ringing Tone --\x3e\n\n    \x3c!-- START Speaker --\x3e\n    <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Speaker" ng-click="vm_pb.conf.speakerMute = !vm_pb.conf.speakerMute; vm_pb.initDevice(\'speaker\', true)" ng-disabled="!vm_pb.registered">\n      <md-icon md-font-icon="{{vm_pb.conf.speakerMute ? \'icon-volume-off\' : \'icon-volume\'}}" class="icon s14" ng-class="vm_pb.conf.speakerMute ? \'red-fg\' : \'grey-fg\'">\n        <md-tooltip><span translate="TOOLBAR.SPEAKER">Speaker</span></md-tooltip>\n      </md-icon>\n    </md-button>\n    \x3c!-- END Speaker --\x3e\n\n    \x3c!-- START Microphone --\x3e\n    <md-button ng-disabled="(!vm_pb.registered || vm_pb.sessions.length==0)?true:false" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Microphone" ng-click="vm_pb.conf.microphoneMute = !vm_pb.conf.microphoneMute; vm_pb.initDevice(\'microphone\', true)">\n      <md-icon md-font-icon="{{vm_pb.conf.microphoneMute ? \'icon-microphone-off\' : \'icon-microphone\'}}" class="icon s14" ng-class="vm_pb.conf.microphoneMute ? \'red-fg\' : \'grey-fg\'">\n        <md-tooltip><span translate="TOOLBAR.MICROPHONE">Microphone</span></md-tooltip>\n      </md-icon>\n    </md-button>\n    \x3c!-- END Microphone --\x3e\n\n    \x3c!-- START Registered --\x3e\n    <span>\n      <span class="quantity-indicator md-red-500-bg" ng-class="vm_pb.registered ? \'md-green-500-bg\' : \'md-red-500-bg\'"></span>\n      <md-tooltip><span>{{vm_pb.conf.license ? (vm_pb.registered ? \'TOOLBAR.REGISTERED\' : \'TOOLBAR.NOT_REGISTERED\') : \'TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD\' | translate}}\n          <timer ng-if="vm_pb.registered"></timer>\n        </span>\n      </md-tooltip>\n    </span>\n    \x3c!-- END Registered --\x3e\n  </div>\n  <div layout="column" layout-align="center start">\n    <div layout="row" layout-align="start center">\n      \x3c!-- START Target --\x3e\n      <angucomplete-alt id="ms-target-wrap" pause="10" local-data="vm_pb.calls" search-fields="target" title-field="target" minlength="0" input-class="input-number" disable-input="!vm_pb.registered" match-class="highlight" template-url="assets/ms-phonebar/ms-phonebar-input.html" input-changed="vm_pb.targetChanged" selected-object="vm_pb.targetSelected" clear-selected="true" ng-keypress="vm_pb.typeWrapper($event)" focus-first="true" disable-autocomplete="vm_pb.currentUser.privacyEnabled"></angucomplete-alt>\n      \x3c!-- END Target --\x3e\n\n      \x3c!-- Auto Answer --\x3e\n      <div ng-if="vm_pb.conf.autoAnswer" class="red-fg" style="padding-left: 10px;">\n        <span class="font-size-20">A<span class="font-size-16">A</span></span>\n      </div>\n      \x3c!-- Auto Answer --\x3e\n\n      <md-button class="md-fab md-mini white-bg width-30 height-30" aria-label="Dialpad" ng-click="vm_pb.toggleDialpad()" ng-disabled="!vm_pb.registered">\n        <md-icon md-font-icon="icon-apps" class="icon grey-fg s16"></md-icon>\n      </md-button>\n      <md-button ng-if="vm_pb.target" class="md-fab md-mini white-bg width-25 height-25" aria-label="Call" style="margin-left: 0px;" ng-click="vm_pb.call()">\n        <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n      </md-button>\n    </div>\n  </div>\n</div>\n\x3c!-- Input&Media Area --\x3e\n\n\x3c!-- START 3WC --\x3e\n<md-button ng-if="vm_pb.canGoInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="3Way" ng-click="vm_pb.start3WayConf();  $event.stopPropagation();">\n  <md-icon md-font-icon="icon-account-multiple-plus" class="icon orange-fg s14"></md-icon>\n  <md-tooltip><span translate="TOOLBAR.CONFERENCE">Conference</span></md-tooltip>\n</md-button>\n\x3c!-- END 3Way --\x3e\n\n\n<div class="toolbar-separator"></div>\n\n\x3c!-- Sessions Area --\x3e\n<div class="sessions" layout="row" layout-align="start center" flex>\n  <div layout="row" layout-align="center center" ng-if="!vm_pb.conf.license">\n    <md-icon md-font-icon="icon-account-alert" class="icon s36 red-fg"></md-icon>\n    <span layout-margin translate="TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"></span>\n  </div>\n\n  <div id="{{\'div_session_\'+session.id.substr(0,32)}}" ng-repeat="session in vm_pb.sessions" class="session" layout="row" ng-click="(vm_pb.sessions.length > 1) && vm_pb.selectSession(session)">\n    <md-button ng-if="vm_pb.conf.recording && session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Record" ng-click="vm_pb.record(session); $event.stopPropagation();">\n      <md-icon md-font-icon="icon-radiobox-marked" class="icon s14" ng-class="session.monitor ? \'red-fg\' : \'grey-fg\'"></md-icon>\n    </md-button>\n    <div layout="column" layout-align="center start">\n      <span class="session-info">\n        <span ng-if="session.user == session.name" privacy ng-cloak>{{session.user}}</span>\n        <span ng-if="session.user != session.name" privacy ng-cloak>{{session.name}}</span> <span ng-if="session.user != session.name" privacy ng-cloak>{{session.user}}</span>\n      </span>\n      <span class="session-info" layout="row" layout="start center">\n        <timer></timer>\n      </span>\n    </div>\n\n    \x3c!-- START Answer --\x3e\n    <md-button ng-if="session.incoming && !session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Anser" ng-click="vm_pb.answer(session); $event.stopPropagation();">\n      <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END Answer --\x3e\n\n    \x3c!-- START Hangup --\x3e\n    <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Terminate" ng-click="vm_pb.terminate(session); $event.stopPropagation();">\n      <md-icon md-font-icon="icon-phone-hangup" class="icon red-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END Hangup --\x3e\n\n    \x3c!-- START Hold/Unhold --\x3e\n    <md-button ng-if="session.confirmed && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="(session.localHold ? vm_pb.unhold(session) : vm_pb.hold(session)); $event.stopPropagation();">\n      <md-icon md-font-icon="{{session.localHold ? \'icon-play\' : \'icon-pause\'}}" class="icon grey-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END Hold/Unhold --\x3e\n\n    \x3c!-- START Transfer --\x3e\n    <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length == 1 && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer" ng-click="vm_pb.refer(session);  $event.stopPropagation();">\n      <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END transfer --\x3e\n\n    \x3c!-- START Attended Transfer --\x3e\n    <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length>1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer Attended" ng-click="vm_pb.referAttended(session);  $event.stopPropagation();">\n      <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END Attended Transfer --\x3e\n  </div>\n</div>\n\x3c!-- Sessions Area --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-input.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">\n  <input id="ms-target" ng-model="searchStr" ng-disabled="disableInput" type="text" placeholder="{{placeholder}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)" />\n  <div class="angucomplete-dropdown" ng-show="showDropdown && !(!searching && (!results || results.length == 0))">\n    <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">\n      <div layout="row" layout-align="start center">\n        <md-icon md-font-icon="{{result.originalObject.inbound ? \'icon-arrow-bottom-left\' : \'icon-arrow-top-right\'}}" class="icon no-margin s22"></md-icon>\n        <span style="margin-left: 8px;">({{result.originalObject.time}}) - <span class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title" privacy ng-cloak></span></span>\n      </div>\n    </div>\n  </div>\n</div>'),e.put("assets/ms-phonebar/ms-phonebar.html",'<div layout="row" layout-align="start center" flex>\n  \x3c!-- Audio stream --\x3e\n  <audio id="local-audio" autoplay hidden=true></audio>\n  <audio id="remote-audio" autoplay hidden=true></audio>\n  \x3c!-- Audio stream --\x3e\n\n  \x3c!-- WebRtc PhoneBar --\x3e\n  <div class="phonebar-container" ng-include="\'assets/ms-phonebar/ms-phonebar-dialpad.html\'" layout="row" layout-align="start center" flex></div>\n  \x3c!-- WebRtc PhoneBar --\x3e\n</div>'),e.put("assets/ms-phonebar/prefix/dialog.html",'<md-dialog aria-label="Prefix">\n  <form ng-cloak ng-keypress="vm.keyPress($event)">\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="TOOLBAR.PREFIXES">Prefixes</span>\n        </div>\n        <div layout="row" layout-align="end center">\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog(-1)">\n            <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <md-radio-group ng-model="vm.prefix">\n        <md-radio-button ng-repeat="prefix in vm.prefixes.rows" value="{{prefix.prefix}}" class="md-primary">{{prefix.name}}</md-radio-button>\n        <md-radio-button ng-if="!vm.required" ng-value="null" class="md-primary">no prefix</md-radio-button>\n      </md-radio-group>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row">\n      <md-button ng-click="vm.call()" class="send-button md-accent md-raised" aria-label="call" md-autofocus ng-disabled="!vm.prefix && vm.required">\n        <span translate="TOOLBAR.CALL">CALL</span>\n      </md-button>\n      <md-button ng-click="vm.closeDialog(-1)" class="send-button md-accent md-raised" aria-label="cancel">\n        <span translate="TOOLBAR.CANCEL">Cancel</span>\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("assets/ms-phonebar/record/dialog.html",'<md-dialog aria-label="Recording" ng-init="vm.onInit()">\n  <form ng-cloak>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="TOOLBAR.RECORDING">Recording</span>\n        </div>\n        <div layout="row" layout-align="end center">\n          <md-button class="md-icon-button no-margin no-padding">\n            <md-icon class="no-margin" md-font-icon="icon-plus" aria-label="Add" ng-click="vm.addRecording()"></md-icon>\n          </md-button>\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n            <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-table-container>\n      <table md-table layout-padding>\n        <thead md-head>\n          <tr md-row>\n            <th md-column><span translate="TOOLBAR.FILENAME">File name</span></th>\n            <th md-column><span translate="TOOLBAR.STATUS">Status</span></th>\n            <th md-column><span translate="TOOLBAR.ACTIONS">Actions</span></th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm.session.monitors.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="TOOLBAR.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="monitor in vm.session.monitors">\n            <td md-cell>{{monitor.filename}}</td>\n            <td md-cell class="no-padding">\n              <md-icon md-font-icon="icon-radiobox-marked" class="icon s16" ng-class="(monitor.status == \'rec\') ? \'red-fg ms-blink\' : \'grey-fg\'"></md-icon>\n            </td>\n            <td md-cell class="no-padding">\n              <md-button class="md-fab md-mini white-bg width-35 height-35 margin-5" aria-label="Record" ng-click="(monitor.status == \'rec\') ? vm.stop(monitor) : vm.start(monitor)">\n'+"                <md-icon md-font-icon=\"{{monitor.status == 'rec' ? 'icon-stop' : 'icon-play'}}\" class=\"icon s16\" ng-class=\"monitor.status == 'rec' ? 'grey-fg' : 'red-fg'\"></md-icon>\n              </md-button>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n  </form>\n</md-dialog>"),e.put("assets/ms-phonebar/referAttended/dialog.html",'<md-dialog aria-label="Transfer">\n  <form ng-cloak>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="TOOLBAR.ATTENDED_TRANSFER">Transfer</span>\n        </div>\n        <div layout="row" layout-align="end center">\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n            <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <label translate="TOOLBAR.TARGET">Target</label>\n      <md-input-container class="md-block">\n        <md-select ng-model="vm.target">\n          <md-option ng-repeat="session in vm.sessions" ng-value="session.user">\n            {{ session.name }}\n          </md-option>\n        </md-select>\n      </md-input-container>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row">\n      <md-button ng-click="vm.transfer()" class="send-button md-accent md-raised" aria-label="transfer" ng-disabled="!vm.target && !vm.sessionId">\n        <span translate="TOOLBAR.TRANSFER">TRANSFER</span>\n      </md-button>\n      <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n        <span translate="TOOLBAR.CANCEL">Cancel</span>\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("assets/ms-phonebar/settings/settings.html",'<md-dialog class="md-phonebar-dialog" aria-label="{{vm.name}}">\n  <form name="settingsForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="TOOLBAR.SETTINGS">Settings</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content class="no-padding">\n      <md-tabs md-no-pagination md-stretch-tabs="always">\n        <md-tab label="{{ \'TOOLBAR.PROFILE\' | translate}}">\n          <md-content layout-padding layout="column">\n            <span><span translate="TOOLBAR.FULLNAME">Fullname</span>: {{vm.conf.fullname}}</span>\n            <span><span translate="TOOLBAR.NAME">Name</span>: {{vm.conf.name}}</span>\n            <span><span translate="TOOLBAR.INTERNAL">Internal</span>: {{vm.conf.internal}}</span>\n            <span><span translate="TOOLBAR.BROWSER">Browser</span>: {{vm.conf.browserName}} {{vm.conf.browserVersion}}</span>\n            <span><span translate="TOOLBAR.OS">OS</span>: {{vm.conf.osName}} {{vm.conf.osVersion}}</span>\n          </md-content>\n        </md-tab>\n        <md-tab label="{{ \'TOOLBAR.SERVICES\' | translate}}">\n          <md-content layout-padding>\n            <md-input-container class="md-block">\n              <md-switch ng-model="vm.conf.autoAnswer" aria-label="Auto Answer">\n                <span translate="TOOLBAR.AUTOANSWER">Auto Answer</span>\n                <span>{{ vm.conf.autoAnswerDelay }} [s]</span>\n              </md-switch>\n            </md-input-container>\n          </md-content>\n        </md-tab>\n        <md-tab label="{{ \'TOOLBAR.AUDIO\' | translate}}">\n          <md-content layout-padding>\n            <div class="border brad-5" layout-margin>\n              <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n                <label translate="TOOLBAR.RINGINGDEVICE">Ringing Device</label>\n                <md-select name="ringingDevice" ng-model="vm.conf.ringingId" required>\n                  <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n                </md-select>\n                <div ng-messages="settingsForm[\'ringingDevice\'].$error" ng-show="settingsForm[\'ringingDevice\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <div layout="row" layout-align="space-between center">\n                <md-switch ng-model="vm.conf.ringingMute" aria-label="Mute">\n                  Mute\n                </md-switch>\n\n                <md-slider-container flex="80">\n                  <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.ringingVolume" aria-label="volume"></md-slider>\n                </md-slider-container>\n              </div>\n            </div>\n\n            <div class="border brad-5" layout-margin>\n              <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n                <label translate="TOOLBAR.SPEAKERDEVICE">Speaker Device</label>\n                <md-select name="speakerDevice" ng-model="vm.conf.speakerId" required>\n                  <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n                </md-select>\n                <div ng-messages="settingsForm[\'speakerDevice\'].$error" ng-show="settingsForm[\'speakerDevice\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <div layout="row" layout-align="space-between cetner">\n                <md-switch ng-model="vm.conf.speakerMute" aria-label="Mute">\n                  Mute\n                </md-switch>\n\n                <md-slider-container flex="80">\n                  <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.speakerVolume" aria-label="volume"></md-slider>\n                </md-slider-container>\n              </div>\n            </div>\n\n            <div class="border brad-5" layout-margin>\n              <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audioinput\' }).length">\n                <label translate="TOOLBAR.MICROPHONEDEVICE">Microphone Device</label>\n                <md-select name="microphoneDevice" ng-model="vm.conf.microphoneId" required>\n                  <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audioinput\' }">{{ device.label || (\'Microphone \' + ($index + 1))}}</md-option>\n                </md-select>\n                <div ng-messages="settingsForm[\'microphoneDevice\'].$error" ng-show="settingsForm[\'microphoneDevice\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n\n              <div layout="row" layout-align="space-between center">\n                <md-switch ng-disabled="vm.activeSessions.length==0" ng-model="vm.conf.microphoneMute" aria-label="Mute">\n                  Mute\n                </md-switch>\n              </div>\n            </div>\n          </md-content>\n        </md-tab>\n        <md-tab label="{{ \'TOOLBAR.REQUIREMENTS\' | translate}}">\n          <md-content layout-padding>\n            <md-list>\n              <md-list-item>\n                <h3 translate="TOOLBAR.LICENSE">License</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.license ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.license ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.BROWSER_COMPATIBILITY">Browser Compatibility</h3>\n                <md-icon class="md-secondary" ng-class="vm.isCompatibleBrowser() ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.isCompatibleBrowser() ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.HTTPS">HTTPS</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.protocol === \'https\' ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.protocol === \'https\' ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.WEBRTCSUPPORT">WebRTC Support</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.isWebRTCSupported ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.isWebRTCSupported ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.MICROPHONE">Microphone</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.hasMicrophone ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasMicrophone ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.SPEAKER">Speaker</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.hasSpeakers ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasSpeakers ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n            </md-list>\n          </md-content>\n        </md-tab>\n      </md-tabs>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveSettings()" class="send-button md-accent md-raised" ng-disabled="settingsForm.$invalid || settingsForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/core/directives/ms-quick-filter/ms-quick-filter.html",'<div ng-cloak layout="row" class="quick-filter-container" flex>\n  <div ng-repeat="filter in vm.filters" ng-if="filter.ngIf ? $eval(\'vm.query.\' + filter.ngIf) : true" layout="column" class="padding-horizontal-16">\n    <span class="font-size-10" translate="{{ filter.label }}" />\n    <md-select ng-if="filter.type === \'select\'" class="font-size-12 no-margin" ng-model="vm.query[filter.key]" ng-change="vm.search()" aria-label="Filter {{ filter.name }}">\n      <md-option ng-repeat="option in filter.options" ng-value="filter.ngValue ? option[filter.ngValue] : option.id">\n        {{ option.name }}</md-option>\n      <md-option ng-repeat="option in filter.customOptions" ng-value="option.value" translate="{{ option.translate }}">\n      </md-option>\n    </md-select>\n\n    <md-select ng-if="filter.type === \'multiselect\'" multiple class="font-size-12 no-margin" ng-init="vm.onMultiselectInit(filter)" ng-model="vm.query[filter.key]" ng-disabled="filter.options.length === 0" ng-change="vm.onMultiselectSelection(filter, isOpened)" md-selected-text="vm.placeholders[filter.key]" aria-label="Filter {{ filter.name }}" md-on-open="isOpened = true" md-on-close="isOpened = false">\n      <md-option ng-repeat="option in filter.options" ng-value="filter.ngValue ? option[filter.ngValue] : option.id" ng-disabled="filter.clearAll === false && vm.query[filter.key].length === 1 && vm.query[filter.key][0] === (filter.ngValue ? option[filter.ngValue] : option.id)">\n        {{ option.name }}</md-option>\n      <md-button ng-if="vm.query[filter.key].length &lt; filter.options.length" ng-click="vm.selectAll(filter)" md-no-ink class="md-primary" layout-fill>\n        {{\'DASHBOARDS.SELECT_ALL\' | translate}}</md-button>\n      <md-button ng-if="vm.query[filter.key].length === filter.options.length" ng-click="vm.clearSelection(filter)" md-no-ink class="md-primary" layout-fill>\n        {{\'DASHBOARDS.CLEAR\' | translate}}</md-button>\n    </md-select>\n\n    <div ng-if="filter.type === \'date\'" layout="row" layout-align="center center">\n      <md-date-range ng-init="vm.onDateRangeInit(filter)" localization-map="vm.localizationMap" ng-model="vm.pickerModels[filter.key]" auto-confirm="true" show-template="true" md-on-select="vm.onDateRangeSelection(filter)" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}">\n      </md-date-range>\n      <md-button ng-if="vm.pickerModels[filter.key].dateStart" ng-click="vm.clearDate(filter)" class="md-icon-button no-margin no-padding width-20 height-20" aria-label="Clear date filter">\n        <md-icon md-font-icon="icon-close" class="quick-filter-date-clear-button s16"></md-icon>\n      </md-button>\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-search-bar/ms-search-bar.html",'<div flex layout="row" layout-align="start center">\n  <label>\n    <md-button class="ms-search-bar-expander md-icon-button" aria-label="Expand Search Bar" ng-click="vm.expandBar()" ng-if="!vm.resultsLoading || !vm.expanded" ng-class="{\'ms-search-button-expanded\': vm.expanded }">\n      <md-icon id="ms-search-bar-icon" md-font-icon="icon-magnify" class="s24" ng-class="{\'{{ vm.iconColor }}\': vm.iconColor && !vm.expanded }"></md-icon>\n    </md-button>\n    <div class="ms-search-bar-loader" layout="row" layout-align="center center" ng-if="vm.resultsLoading && vm.expanded">\n      <md-progress-circular class="md-accent" md-diameter="32" md-mode="indeterminate"></md-progress-circular>\n    </div>\n  </label>\n  <input ng-if="vm.expanded" focus-on="vm.expanded" type="text" placeholder="{{ \'TOOLBAR.SEARCH\' | translate }}" flex ng-model="vm.query.filter" ng-model-options="vm.queryOptions" ng-blur="vm.blurCollapse()" ng-keydown="vm.onKeyDown($event)" />\n  <md-button class="ms-search-bar-collapser md-icon-button" ng-click="vm.collapseBar()" aria-label="Collapse Search Bar">\n    <md-icon md-font-icon="icon-close" class="icon s24"></md-icon>\n  </md-button>\n  <div class="ms-search-bar-results" ng-if="vm.results">\n    <div class="no-results" ng-if="vm.results.length === 0">{{ \'DASHBOARDS.NO_RESULTS_AVAILABLE\' | translate }}</div>\n    <div class="result" ng-repeat="result in vm.results" ng-click="vm.handleResultClick(result)" ng-mouseenter="vm.handleMouseEnter($index)" ng-mousedown="vm.absorbEvent($event)" ng-class="{\'selected\': $index == vm.selectedResultIndex}" md-ink-ripple>\n      <div layout="row" layout-align="start center">\n        <div class="icon-container" layout="row" layout-align="center center">\n          <i ng-if="result.icon" class="icon {{ result.icon }}"></i>\n          <div ng-if="!result.icon" class="square md-accent-bg"></div>\n        </div>\n        <div>\n          <div class="title">{{ result.title }}</div>\n          <div class="description" ng-if="result.description">{{ result.description }}</div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-shortcuts/ms-shortcuts.html",'<div class="shortcuts-container" layout="row" layout-align="space-between center" flex ng-class="{\'mobile-bar-active\': MsShortcuts.mobileBarActive}">\n\n  <div class="flex-noshrink" layout="row" layout-align="start center" flex>\n    <div class="shortcuts hide show-gt-xs" layout="row" layout-align="start center" ng-if="MsShortcuts.shortcuts.length > 0" ng-sortable="MsShortcuts.sortableOptions">\n      <div ng-repeat="shortcut in MsShortcuts.shortcuts" layout="row" layout-align="center center">\n        <md-button class="md-icon-button shortcut" aria-label="{{shortcut.title}}" ui-sref="{{shortcut.uisref}}">\n          <md-icon ng-if="shortcut.icon" md-font-icon="{{shortcut.icon}}" class="icon s24"></md-icon>\n          <div ng-if="!shortcut.icon" class="first-letter">{{shortcut.title.charAt(0)}}</div>\n          <md-tooltip md-direction="bottom">{{shortcut.title}}</md-tooltip>\n        </md-button>\n      </div>\n    </div>\n\n    \x3c!-- <md-menu md-offset="8 56" class="shortcut-menu hide show-gt-xs">\n            <md-button class="md-icon-button add-shortcut-button" aria-label="Add shortcut"\n                       ng-click="$mdOpenMenu($event)">\n                <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24"></md-icon>\n                <md-tooltip md-direction="bottom">Click to add/remove shortcut</md-tooltip>\n            </md-button>\n\n            <md-menu-content>\n                <div id="ms-shortcut-add-menu">\n                    <div class="shortcut-search" layout="row" layout-align="start center">\n                        <div class="search-icon" layout="row" layout-align="center center"\n                             ng-if="!MsShortcuts.resultsLoading">\n                            <md-icon md-menu-align-target md-font-icon="icon-magnify" class="icon s24"></md-icon>\n                        </div>\n                        <div class="shortcut-loader" layout="row" layout-align="center center"\n                             ng-if="MsShortcuts.resultsLoading">\n                            <md-progress-circular class="md-accent" md-diameter="20" md-mode="indeterminate">\n                            </md-progress-circular>\n                        </div>\n\n                        <input type="text" placeholder="Search" flex\n                               ng-model="MsShortcuts.query"\n                               ng-model-options="MsShortcuts.queryOptions"\n                               ng-keydown="MsShortcuts.handleKeydown($event)">\n                    </div>\n\n                    <div class="results" ng-if="MsShortcuts.results" >\n                        <div class="no-results" ng-if="MsShortcuts.results.length === 0">No Results!</div>\n\n                        <div class="result" ng-repeat="result in MsShortcuts.results"\n                             ng-click="MsShortcuts.handleResultClick(result)"\n                             ng-mouseenter="MsShortcuts.handleMouseenter($index)"\n                             ng-mousedown="MsShortcuts.absorbEvent($event)"\n                             ng-class="{\'selected\': $index == MsShortcuts.selectedResultIndex}"\n                             md-prevent-menu-close="md-prevent-menu-close"\n                             md-ink-ripple>\n                            <div layout="row" layout-align="start space-between">\n                                <div layout="row" layout-align="start center" flex>\n                                    <div class="icon icon-container" layout="row" layout-align="center center">\n                                        <i ng-if="result.icon" class="{{result.icon}}"></i>\n                                        <div ng-if="!result.icon" class="square md-accent-bg"></div>\n                                    </div>\n                                    <div>\n                                        <div class="title">{{result.title}}</div>\n                                    </div>\n                                </div>\n                                <md-icon md-font-icon="icon-pin" class="icon s18"\n                                         ng-class="{\'fade-text\': !result.hasShortcut}"></md-icon>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </md-menu-content>\n        </md-menu> --\x3e\n  </div>\n\n  <md-button class="md-icon-button toggle-mobile-menu hide-gt-xs" aria-label="Add shortcut" ng-click="MsShortcuts.toggleMobileBar()">\n    <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24" ng-hide="MsShortcuts.mobileBarActive"></md-icon>\n    <md-icon md-menu-origin md-font-icon="icon-close" class="icon s24" ng-hide="!MsShortcuts.mobileBarActive"></md-icon>\n  </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/horizontal/horizontal.html",'<div class="ms-stepper-horizontal">\n  <div class="ms-stepper-navigation-wrapper">\n    <div class="ms-stepper-navigation" layout="row" layout-align="center center">\n      <md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(step.stepNumber), \'valid\': MsStepper.isStepValid(step.stepNumber), \'disabled\': MsStepper.isStepDisabled(step.stepNumber), \'optional\': MsStepper.isStepOptional(step.stepNumber)}" ng-click="MsStepper.gotoStep(step.stepNumber)" ng-disabled="MsStepper.isStepDisabled(step.stepNumber)" ng-repeat="step in MsStepper.steps | filter:MsStepper.filterHiddenStep" layout="row" layout-align="start center">\n\n        <div class="step md-accent-bg" layout="row" layout-align="center center">\n          <span ng-if="!MsStepper.isStepValid(step.stepNumber) || MsStepper.isStepOptional(step.stepNumber)">\n            {{$index + 1}}\n          </span>\n          <span ng-if="MsStepper.isStepValid(step.stepNumber) && !MsStepper.isStepOptional(step.stepNumber)">\n            <i class="icon icon-check s18"></i>\n          </span>\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="title" translate="{{step.stepTitleTranslate}}">{{step.stepTitle}}</div>\n          <div class="subtitle" ng-if="MsStepper.isStepOptional(step.stepNumber)">Optional</div>\n        </div>\n      </md-button>\n    </div>\n  </div>\n\n  <div class="ms-stepper-steps" ng-transclude></div>\n\n  <div class="ms-stepper-controls" layout="row" layout-align="center center">\n    <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n      Back\n    </md-button>\n\n    <div class="ms-stepper-dots">\n      <span ng-repeat="step in MsStepper.steps" ng-hide="MsStepper.isStepHidden(step.stepNumber)" ng-class="{\'selected md-accent-bg\':MsStepper.currentStepNumber === $index + 1}">\n      </span>\n    </div>\n\n    <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n      Next\n    </md-button>\n\n    <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n      Submit\n    </md-button>\n  </div>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",'<md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(stepInfo.stepNumber), \'valid\': MsStepper.isStepValid(stepInfo.stepNumber), \'disabled\': MsStepper.isStepDisabled(stepInfo.stepNumber), \'optional\': MsStepper.isStepOptional(stepInfo.stepNumber)}" ng-click="MsStepper.gotoStep(stepInfo.stepNumber)" ng-disabled="MsStepper.isStepDisabled(stepInfo.stepNumber)" ng-hide="MsStepper.isStepHidden(stepInfo.stepNumber)" aria-label="Stepper navigation button" layout="row" layout-align="start center">\n\n  <div class="step" layout="row" layout-align="center center">\n    <span ng-if="!MsStepper.isStepValid(stepInfo.stepNumber) || MsStepper.isStepOptional(stepInfo.stepNumber)">\n      <i class="icon icon-checkbox-blank-circle-outline s18 md-accent-fg"></i>\n    </span>\n    <span ng-if="MsStepper.isStepValid(stepInfo.stepNumber) && !MsStepper.isStepOptional(stepInfo.stepNumber)">\n      <i class="icon icon-check-circle s18 md-accent-fg"></i>\n    </span>\n  </div>\n\n  <div layout="column" layout-align="start start">\n    <div class="title" ng-if="stepInfo.stepTitleTranslate">{{stepInfo.stepTitleTranslate | translate }}</div>\n    <div class="title" ng-if="!stepInfo.stepTitleTranslate">{{stepInfo.stepTitle}}</div>\n    <div class="subtitle" ng-if="MsStepper.isStepOptional(stepInfo.stepNumber)">Optional</div>\n  </div>\n</md-button>\n\n<div class="ms-stepper-step-content" ng-transclude></div>\n\n<div class="ms-stepper-controls" layout="row" layout-align="start center" ng-show="MsStepper.isStepCurrent(stepInfo.stepNumber)">\n  <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n    Back\n  </md-button>\n\n  <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n    Next\n  </md-button>\n\n  <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n    Submit\n  </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/vertical.html",'<div class="ms-stepper-vertical">\n  <div class="ms-stepper-vertical-line"></div>\n  <div class="ms-stepper-steps" ng-transclude></div>\n</div>'),e.put("app/core/directives/ms-tab-scroll/ms-tab-scroll.html",'<div layout="row">\n  <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'left\')" ng-if="vm.canScroll(\'left\') == true">\n    <md-icon md-font-icon="icon-chevron-left" class="icon s26"></md-icon>\n  </md-button>\n  <div id="bar-container" layout="row" class="bar-container">\n    <div ng-transclude id="tab-container" layout="row" layout-align="start center" class="scroll-container">\n    </div>\n  </div>\n  <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'right\')" ng-if="vm.canScroll(\'right\') == true">\n    <md-icon md-font-icon="icon-chevron-right" class="icon s26"></md-icon>\n  </md-button>\n</div>'),e.put("app/core/directives/ms-timezone/ms-timezone.html",'<md-select ng-model="ngModel" class="no-margin" ng-change="ngChange()">\n  <md-option ng-value="null">NONE</md-option>\n  <md-option ng-repeat="t in timezone | orderBy:\'utcOffset\'" value="{{t.name}}">{{t.name}} ({{t.offsetStr}})</md-option>\n</md-select>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-counter/ms-widget-engine.counter.html",'<div class="pt-8 pb-32" layout="column" layout-align="center center" layout-fill ng-controller="MsWidgetEngineCounterController as vm">\n  <div ng-class="\'font-size-\' + (vm.fontSize * 3)" ng-style="{\'color\': widget.foreground}">\n    {{ vm.getCount(widget) }}\n  </div>\n  <div ng-class="\'font-size-\' + vm.fontSize" ng-style="{\'color\': widget.foreground}">{{ \'TOOLS.\' +  vm.label | uppercase | translate }}<span ng-if="vm.filtered">*</span></div>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-multibar-chart/ms-widget-engine.multibar-chart.html",'<div ng-controller="MsWidgetEngineMultibarChartController as vm" ng-init="vm.getMultiBarChart(widget)" layout="column" layout-fill>\n\n  <span ng-show="false">{{ vm.getMultiBarChart(widget)}}</span>\n\n  <canvas style="overflow:scroll" id="bar" class="chart-horizontal-bar" chart-data="vm.multiBarChart.data" chart-options="vm.multiBarChart.options" chart-series="vm.multiBarChart.series" chart-labels="vm.multiBarChart.labels">\n  </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-pie-chart/ms-widget-engine.pie-chart.html",'<div ng-controller="MsWidgetEnginePieChartController as vm" ng-init="vm.getPieChart(widget)" layout="column" layout-fill>\n\n  <span ng-show="false">{{ vm.getPieChart(widget)}}</span>\n\n  <canvas style="overflow:scroll" id="pie" class="chart-pie" chart-data="vm.pieChart.data" chart-labels="vm.pieChart.labels" chart-options="vm.pieChart.options">\n  </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-web-report/ms-widget-engine.web-report.html",'<div ng-controller="MsWidgetEngineWebReportController as vm" ng-init="vm.onInit(widget)">\n  <dl ng-if="vm.error">\n    <dt class="text-bold">Query Error</dt>\n    <dd>{{vm.error.sql}}</dd>\n    <dt>Message</dt>\n    <dd>{{vm.error.msg}}</dd>\n  </dl>\n  <md-toolbar class="md-table-toolbar md-default">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead">{{vm.title}}</span>\n      <div flex></div>\n      <md-button class="md-icon-button" ng-click="vm.onInit(widget)" aria-label="refresh">\n        <md-icon md-font-icon="icon-refresh"></md-icon>\n      </md-button>\n      <span ng-if="vm.refresh && vm.countDown" class="md-subhead blue-fg">{{vm.countDown}}</span>\n    </div>\n  </md-toolbar>\n  <md-table-container ng-if="!vm.error">\n    <table md-table md-progress="vm.promise">\n      <thead md-head>\n        <tr md-row>\n          <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-repeat="row in vm.results.rows">\n          <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n        </tr>\n        <tr md-row ng-if="!vm.results.rows.length">\n          <td md-cell colspan="{{vm.columns.length}}">\n            <div layout="row" layout-align="center center">\n              <span>No Data</span>\n            </div>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine.html",'<div gridster="vm.config">\n  <ul>\n    <li gridster-item="widget" ng-repeat="widget in vm.config.widgets">\n      <md-card layout-fill>\n        <md-toolbar class="height-40" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground }">\n          <div class="md-toolbar-tools height-40 no-margin" layout="row" layout-align="start center">\n            <a ng-href="{{widget.link ? widget.link : \'javascript:void(0)\'}}" ng-style="{\'color\': widget.foreground, \'font-size\': (widget.titleFontSize || 12) }" class="text-truncate" flex>\n              {{ widget.title || \'No Title\' }}\n            </a>\n            <md-button ng-if="!vm.config.preview" class="draggable md-icon-button width-30 no-margin no-padding" aria-label="Move">\n              <md-tooltip><span translate="TOOLS.MOVE_WIDGET">Move</span></md-tooltip>\n              <md-icon md-font-icon="icon-cursor-move" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n            </md-button>\n            <md-menu ng-if="!vm.config.preview">\n              <md-button ng-click="$mdOpenMenu($event)" class="md-icon-button width-30 no-margin no-padding" aria-label="More">\n                <md-icon md-font-icon="icon-dots-vertical" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n              </md-button>\n              <md-menu-content>\n                <md-menu-item>\n                  <md-button ng-click="vm.onEdit({widget: widget})" translate="TOOLS.EDIT_WIDGET">Edit\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.onDelete({widget: widget})" translate="TOOLS.DELETE_WIDGET">\n                    Delete</md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n\n          </div>\n        </md-toolbar>\n        <md-card-content class="resizable" layout="column" layout-align="center center" flex ng-style="{\'background-color\': widget.background, \'color\': widget.foreground}">\n          <div ng-switch="widget.type" layout-fill>\n            <iframe ng-switch-when="iframe|custom" ng-switch-when-separator="|" ng-src="{{vm.getTrustedURL(widget.attrs[0].value)}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n            <ds-widget-clock ng-class="\'font-size-\' + (widget.attrs[2].value || 12)" ng-switch-when="clock" digital-format="widget.attrs[0].value" gmt-offset="widget.attrs[1].value" data-show-digital show-gmt-info></ds-widget-clock>\n            <div ng-switch-default layout-fill>\n              <div ng-include="widget.templateUrl" layout-fill></div>\n            </div>\n          </div>\n        </md-card-content>\n      </md-card>\n    </li>\n  </ul>\n</div>'),e.put("app/core/layouts/content-only.html",'<div id="layout-content-only" class="template-layout" layout="column" flex>\n  <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n</div>'),e.put("app/core/layouts/content-with-toolbar.html",'<div id="layout-content-with-toolbar" class="template-layout" layout="column" flex>\n  <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n  <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n\n  <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n</div>'),e.put("app/core/layouts/horizontal-navigation.html",'<div id="layout-horizontal-navigation" class="template-layout" layout="column" flex>\n\n  <div id="toolbar-navigation-container" class="md-whiteframe-1dp" layout="column" layout-align="space-between start">\n    <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n    <div id="horizontal-navigation" ui-view="navigation" layout="row" layout-align="start end" flex></div>\n  </div>\n\n  <div id="content-container" flex layout="column">\n    <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n  </div>\n\n  <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",'<div id="layout-vertical-navigation-fullwidth-toolbar-2" class="template-layout" layout="column" flex>\n\n  <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n  <div id="main-container" layout="row" flex>\n    <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation"></md-sidenav>\n\n    <div id="content-container" flex layout="column">\n      <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n    </div>\n\n    <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n  </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar.html",'<div id="layout-vertical-navigation-fullwidth-toolbar" class="template-layout" layout="column" flex>\n\n  <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n  <div id="main-container" layout="row" flex>\n    <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation"></md-sidenav>\n\n    <div id="content-container" flex layout="column">\n      <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n    </div>\n\n    <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n  </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation.html",'<div id="header" ui-view="header"></div>\n\n<div id="layout-vertical-navigation" class="template-layout" layout="row" flex>\n\n  <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation" ng-if="!vm.isAgent()"></md-sidenav>\n\n  <div id="content-container" flex layout="column">\n    <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n\n    <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n  </div>\n\n  <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n\n</div>\n\n<div id="footer" ui-view="footer"></div>'),e.put("app/core/theme-options/theme-options.html",'<div class="ms-theme-options-button md-primary-bg" ng-click="toggleOptionsSidenav()">\n  <md-icon md-font-icon="icon-cog" class="white-text"></md-icon>\n</div>\n\n<md-sidenav md-component-id="motion-theme-options" class="md-sidenav-right">\n\n  <div class="ms-theme-options-list" layout="column">\n    <div class="theme-option layout-options">\n      <div class="option-title">Layout Style:</div>\n      <md-radio-group layout="row" layout-align="start start" layout-wrap ng-model="vm.layoutStyle" ng-change="vm.updateLayoutStyle()">\n        <md-radio-button ng-repeat="layoutStyle in vm.layoutStyles" ng-value="layoutStyle.value">\n          <div layout="column" layout-align="center center">\n            <img ng-src="{{layoutStyle.figure}}">\n            <span class="text-center font-size-12 mt-8">{{layoutStyle.label}}</span>\n          </div>\n        </md-radio-button>\n      </md-radio-group>\n    </div>\n\n    <md-divider></md-divider>\n\n    <div class="theme-option">\n      <div class="option-title">Layout Mode:</div>\n      <md-radio-group layout="row" layout-align="start center" ng-model="vm.layoutMode" ng-change="vm.updateLayoutMode()">\n        <md-radio-button ng-repeat="layoutMode in vm.layoutModes" ng-value="layoutMode.value">\n          {{layoutMode.label}}\n        </md-radio-button>\n      </md-radio-group>\n    </div>\n\n    <md-divider></md-divider>\n\n    <div class="theme-option color-palettes">\n      <div class="option-title">Color Palette:</div>\n      <div layout="row" layout-align="start start" layout-wrap>\n        <md-button ng-repeat="(themeName, theme) in vm.themes.list" class="md-raised theme-button" layout="row" layout-align="center center" aria-label="{{themeName}}" ng-click="vm.setActiveTheme(themeName)" ng-style="{\'background-color\': theme.primary.color,\'border-color\': theme.accent.color,\'color\': theme.primary.contrast1}" ng-class="{active: vm.getActiveTheme().name === themeName}">\n          <md-icon ng-style="{\'color\': theme.primary.contrast1}" md-font-icon="icon-palette" class="icon s32"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n</md-sidenav>'),e.put("app/errors/404/error-404.html",'<div id="error-404" layout="column" layout-align="center center">\n  <div class="content" layout="column" layout-align="center center">\n    <div class="error-code" translate="ERROR404.CODE">404</div>\n\n    <div class="message" translate="ERROR404.MESSAGE">Sorry but we couldn’t find the page you are looking for</div>\n    <ms-search-bar on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300">Search for anything</ms-search-bar>\n\n    \x3c!-- <div class="search md-whiteframe-1dp" layout="row" layout-align="start center">\n            <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n            <input ng-model="vm.search" type="text" placeholder="Search for anything" translate translate-attr-placeholder="ERROR404.SEARCH" flex>\n        </div> --\x3e\n\n    <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR404.GO_BACK">Go back to dashboard</a>\n  </div>\n</div>'),e.put("app/errors/500/error-500.html",'<div id="error-500" layout="column" layout-align="center center">\n  <div ng-if="!vm.send" class="content" layout="column" layout-align="center center">\n    <div class="error-code" translate="ERROR500.CODE">500</div>\n    <div class="message" translate="ERROR500.MESSAGE">Well, you broke the internet!</div>\n    <div class="sub-message" translate="ERROR500.SUBMESSAGE">Just kidding, looks like we have an internal issue, please try again in couple minutes\n    </div>\n    <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n    <md-button class="md-raised md-warn" ng-click="vm.sendReport()" translate="ERROR500.REPORT">Report this problem</md-button>\n  </div>\n  <pre ng-if="!vm.send">\n  {{vm.error}}\n  </pre>\n  <div ng-if="vm.send" class="content" layout="column" layout-align="center center">\n    <div class="error-code">#{{vm.code}}</div>\n    <div class="message" translate="ERROR500.JIRA_MESSAGE">Your request has been received and will be processed shortly.</div>\n    <div class="sub-message" translate="ERROR500.JIRA_SUBMESSAGE">Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.</div>\n    <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n  </div>\n</div>'),e.put("app/footer/layouts/vertical-navigation/footer.html",'<div layout="row" layout-align="start center">\n  <ms-info-bar ng-if="!vm.cookieAlertHide" on-close="vm.cookieAlertOnClose()" class="grey-100-bg">\n    <div layout="row" layout-align="start center">\n      <span translate="FOOTER.COOKIE_LAW" flex class="text-center grey-600-fg"></span>\n    </div>\n  </ms-info-bar>\n</div>'),e.put("app/forgot/forgot.html",'<div id="forgot-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()">\n  <div id="forgot-password-form-wrapper" layout="column" layout-align="center center">\n    <div id="forgot-password-form" class="md-whiteframe-8dp">\n\n      <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n      <div class="title" translate="FORGOTPASSWORD.TITLE">Recover your password</div>\n\n      <form name="forgotPasswordForm" novalidate>\n        <md-input-container class="md-block" md-no-float>\n          <input type="email" name="email" ng-model="vm.form.email" placeholder="Email address" translate translate-attr-placeholder="FORGOTPASSWORD.EMAIL_ADRESS" ng-pattern="/^.+@.+\\..+$/" required>\n          <div ng-messages="forgotPasswordForm.email.$error" role="alert" multiple>\n            <div ng-message="required">\n              <span translate="FORGOTPASSWORD.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n            </div>\n            <div ng-message="pattern">\n              <span translate="FORGOTPASSWORD.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-button type="button" ng-click="vm.forgotPassword()" class="md-raised md-accent submit-button" aria-label="RESET MY PASSWORD" ng-disabled="forgotPasswordForm.$invalid || forgotPasswordForm.$pristine" translate="FORGOTPASSWORD.SEND_RESET_LINK" translate-attr-aria-label="FORGOTPASSWORD.SEND_RESET_LINK">\n          SEND RESET LINK\n        </md-button>\n      </form>\n\n      <div class="login" layout="row" layout-align="center center">\n        <a class="link" ui-sref="app.login" translate="FORGOTPASSWORD.GO_BACK">Go back to login</a>\n      </div>\n    </div>\n  </div>\n</div>'),e.put("app/header/layouts/vertical-navigation/header.html",'\x3c!-- <div layout="row" layout-align="start center">\n    <ms-info-bar ng-if="vm.currentUser.role == \'admin\' && !vm.newsAlertHide" on-close="vm.newsAlertOnClose()" class="green-600-bg white-fg">\n        <div layout="row" layout-align="start center">\n            <md-icon md-font-icon="icon-message-text-outline" class="icon margin-right-10 s20"></md-icon>\n            <div flex hide-xs translate="HEADER.NEWS"></div>\n        </div>\n    </ms-info-bar>\n</div> --\x3e'),e.put("app/login/login.html",'<div id="login" class="flex-scrollable" layout="column">\n  <div id="login-form-wrapper" layout="column" layout-align="center center">\n    <div id="login-form" class="md-whiteframe-8dp">\n\n      <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n      \x3c!-- <img src="assets/images/logos/login.png" alt="motion_logo_login" /> --\x3e\n\n      <div class="md-subhead padding-top-45" translate="LOGIN.TITLE">Log in to your account</div>\n\n      <form name="loginForm" novalidate ng-if="!vm.progressLogin">\n        <md-input-container class="md-block" md-no-float>\n          <input type="input" name="name" ng-model="vm.form.name" autofocus aria-label="username" translate translate-attr-placeholder="LOGIN.USERNAME" required>\n          <div ng-messages="loginForm.name.$error" role="alert" multiple>\n            <div ng-message="required">\n              <span translate="LOGIN.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block" md-no-float>\n          <input type="password" name="password" ng-model="vm.form.password" aria-label="password" translate translate-attr-placeholder="LOGIN.PASSWORD" required>\n          <div ng-messages="loginForm.password.$error" role="alert" multiple>\n            <div ng-message="required">\n              <span translate="LOGIN.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <div class="remember-forgot-password" layout="row" layout-xs="column" layout-align="end center">\n          \x3c!-- <md-checkbox class="remember-me" ng-model="data.cb1" aria-label="Remember Me">\n                        <span translate="LOGIN.REMEMBER_ME">Remember Me</span>\n                    </md-checkbox> --\x3e\n          <a ui-sref="app.forgot" class="forgot-password md-accent-color" style="cursor:pointer;" translate="LOGIN.FORGOT_PASSWORD">Forgot Password?</a>\n        </div>\n\n        <b layout="row" layout-align="center center" class="md-padding" ng-if="vm.message">\n          <font color="red">{{vm.message}}</font>\n        </b>\n        <md-button type="submit" ng-click="vm.login()" class="md-raised md-accent submit-button" aria-label="LOGIN" translate="LOGIN.LOG_IN" translate-attr-aria-label="LOGIN.LOG_IN">\n          LOG IN\n        </md-button>\n      </form>\n\n      <md-progress-circular ng-if="vm.progressLogin" md-diameter="96"></md-progress-circular>\n\n      <div ng-if="vm.googleSsoEnabled || vm.adSsoEnabled" class="separator">\n        <span class="text" translate="LOGIN.OR">OR</span>\n      </div>\n\n      <md-button ng-if="vm.googleSsoEnabled" ng-click="vm.loginOauth(\'google\')" class="md-raised google">\n        <div layout="row" layout-align="center center">\n          <span>\n            <md-icon md-font-icon="fab fa-google" class="s16"></md-icon>\n            <span translate="LOGIN.WITH_GOOGLE">Log in with Google</span>\n          </span>\n        </div>\n      </md-button>\n\n      <md-button ng-if="vm.adSsoEnabled" ng-click="vm.loginAD()" class="md-raised ad">\n        <div layout="row" layout-align="center center">\n          <span>\n            <md-icon md-font-icon="fas fa-ad" class="s16"></md-icon>\n            <span style="text-transform: none" translate="LOGIN.WITH_AD">Log in with Active Directory</span>\n          </span>\n        </div>\n      </md-button>\n    </div>\n  </div>\n</div>'),e.put("app/main/apps/analytics/views/extractedReports/create/dialog.html",'<md-dialog class="extractedReport-dialog" aria-label="New ExtractedReport">\n  <form name="extractedReportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.REPORTNAME">ReportName</label>\n        <input type="" name="name" ng-model="vm.extractedReport.name" ng-required="true" autofocus>\n\n        <div ng-messages="extractedReportForm[\'name\'].$error" ng-show="extractedReportForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.REPORTNAME_REQUIRED">ReportName field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input type="" name="basename" ng-model="vm.extractedReport.basename" ng-required="true">\n\n        <div ng-messages="extractedReportForm[\'basename\'].$error" ng-show="extractedReportForm[\'basename\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newExtractedReport" ng-click="vm.saveExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid || extractedReportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newExtractedReport" ng-click="vm.addNewExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_EXTRACTEDREPORT" translate-attr-aria-label="ANALYTICS.ADD_EXTRACTEDREPORT">\n          ADD EXTRACTEDREPORT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newExtractedReport" ng-click="vm.deleteExtractedReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/extractedReports/extractedReports.html",'<div id="extractedReports" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="ANALYTICS.EXTRACTEDREPORTS">ExtractedReports</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedExtractedReports.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedExtractedReports =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="ANALYTICS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-extractedReports-count">\n          <span>{{vm.selectedExtractedReports.length}}</span>\n          <span translate="ANALYTICS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllExtractedReports()" translate="ANALYTICS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectExtractedReports()" translate="ANALYTICS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedExtractedReports" csv-label="true" filename="extractedReports.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedExtractedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- EXTRACTEDREPORT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedExtractedReports" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getExtractedReports">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'ANALYTICS.REPORTNAME\' | translate }}</th>\n                <th md-column md-order-by="basename">{{ \'ANALYTICS.NAME\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'ANALYTICS.TYPE\' | translate }}</th>\n                <th md-column md-order-by="startDate">{{ \'ANALYTICS.DATE_RANGE_FROM\' | translate }}</th>\n                <th md-column md-order-by="endDate">{{ \'ANALYTICS.DATE_RANGE_TO\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'ANALYTICS.GENERATED_AT\' | translate }}</th>\n                <th md-column md-order-by="status">{{ \'ANALYTICS.STATUS\' | translate }}</th>\n                <th md-column md-order-by="output">{{ \'ANALYTICS.OUTPUT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.extractedReports.rows.length">\n                <td md-cell colspan="10">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="extractedReport" md-select-id="id" ng-repeat="extractedReport in vm.extractedReports.rows">\n                <td md-cell ng-if="extractedReport.userpic"><img class="avatar" alt="{{extractedReport.name}}" ng-src="api/users/{{extractedReport.id}}/avatar" /></td>\n                <td md-cell ng-if="!extractedReport.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{extractedReport.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="id ">{{extractedReport.id}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="name ">{{extractedReport.name}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="basename ">{{extractedReport.basename}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="type ">{{extractedReport.type}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="startDate ">{{extractedReport.startDate | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="endDate ">{{extractedReport.endDate | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="createdAt ">{{extractedReport.createdAt | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="status ">{{extractedReport.status}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="output ">{{extractedReport.output}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(extractedReport, $event    )" translate="ANALYTICS.EDIT_EXTRACTEDREPORT">\n                          Edit ExtractedReport\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="extractedReport.status == \'Completed\'">\n\n                        <md-button ng-click="vm.downloadfile2(extractedReport, $event  , \'analytics/extracted_reports\'   )" translate="ANALYTICS.DOWNLOAD_EXTRACTEDREPORT">\n                          Download ExtractedReport\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(extractedReport, $event    )" translate="ANALYTICS.DELETE_EXTRACTEDREPORT">\n                          Delete ExtractedReport\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.extractedReports.count}}" md-on-paginate="vm.getExtractedReports" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / EXTRACTEDREPORT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/metrics/create/dialog.html",'<md-dialog class="metric-dialog" aria-label="New Metric">\n  <form name="metricForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.metric.name" ng-required="true" autofocus>\n\n        <div ng-messages="metricForm[\'name\'].$error" ng-show="metricForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.TABLE">Table</label>\n        <md-select name="table" ng-model="vm.metric.table" required>\n          <md-option ng-value="\'report_agent\'">Agent Report</md-option>\n          <md-option ng-value="\'report_call\'">Call Report</md-option>\n          <md-option ng-value="\'cdr\'">CDR</md-option>\n          <md-option ng-value="\'chat_websites\'">Chat Website</md-option>\n          <md-option ng-value="\'chat_interactions\'">Chat Interaction</md-option>\n          <md-option ng-value="\'chat_messages\'">Chat Messages</md-option>\n          <md-option ng-value="\'chat_offline_messages\'">Chat Offline Messages</md-option>\n          <md-option ng-value="\'chat_queues\'">Chat Queues</md-option>\n          <md-option ng-value="\'report_chat_queue\'">Chat Report Queue</md-option>\n          <md-option ng-value="\'report_chat_transfer\'">Chat Report Transfer</md-option>\n          <md-option ng-value="\'cm_companies\'">Companies</md-option>\n          <md-option ng-value="\'report_call_transfer\'">Call transfer report</md-option>\n          <md-option ng-value="\'cm_contacts\'">Contacts</md-option>\n          <md-option ng-value="\'report_square\'">CSquare Report</md-option>\n          <md-option ng-value="\'report_square_details\'">CSquare Details Report</md-option>\n          <md-option ng-value="\'report_dial\'">Dial Report</md-option>\n          <md-option ng-value="\'cm_hopper\'">Dialer Hopper Processing</md-option>\n          <md-option ng-value="\'cm_hopper_history\'">Dialer Hopper Logs</md-option>\n          <md-option ng-value="\'cm_hopper_final\'">Dialer Hopper Final</md-option>\n          <md-option ng-value="\'mail_accounts\'">Email Account</md-option>\n          <md-option ng-value="\'mail_interactions\'">Email Interaction</md-option>\n          <md-option ng-value="\'mail_messages\'">Email Messages</md-option>\n          <md-option ng-value="\'mail_queues\'">Email Queues</md-option>\n          <md-option ng-value="\'report_mail_queue\'">Email Report Queue</md-option>\n          <md-option ng-value="\'report_mail_transfer\'">Email Report Transfer</md-option>\n          <md-option ng-value="\'fax_accounts\'">Fax Account</md-option>\n          <md-option ng-value="\'fax_interactions\'">Fax Interaction</md-option>\n          <md-option ng-value="\'fax_messages\'">Fax Messages</md-option>\n          <md-option ng-value="\'fax_queues\'">Fax Queues</md-option>\n          <md-option ng-value="\'report_fax_queue\'">Fax Report Queue</md-option>\n          <md-option ng-value="\'report_fax_transfer\'">Fax Report Transfer</md-option>\n          <md-option ng-value="\'report_jscripty_sessions\'">Jscripty Sessions</md-option>\n          <md-option ng-value="\'report_jscripty_questions\'">Jscripty Questions</md-option>\n          <md-option ng-value="\'report_jscripty_answers\'">Jscripty Answers</md-option>\n          <md-option ng-value="\'cm_lists\'">Lists</md-option>\n          <md-option ng-value="\'report_member\'">Member Report</md-option>\n          <md-option ng-value="\'openchannel_accounts\'">Openchannel Account</md-option>\n          <md-option ng-value="\'openchannel_interactions\'">Openchannel Interaction</md-option>\n          <md-option ng-value="\'openchannel_messages\'">Openchannel Messages</md-option>\n          <md-option ng-value="\'openchannel_queues\'">Openchannel Queues</md-option>\n          <md-option ng-value="\'report_openchannel_queue\'">Openchannel Report Queue</md-option>\n          <md-option ng-value="\'report_openchannel_transfer\'">Openchannel Report Transfer</md-option>\n          <md-option ng-value="\'report_queue\'">Queue Report</md-option>\n          <md-option ng-value="\'sms_accounts\'">SMS Account</md-option>\n          <md-option ng-value="\'sms_interactions\'">SMS Interaction</md-option>\n          <md-option ng-value="\'sms_messages\'">SMS Messages</md-option>\n          <md-option ng-value="\'sms_queues\'">SMS Queues</md-option>\n          <md-option ng-value="\'report_sms_queue\'">SMS Report Queue</md-option>\n          <md-option ng-value="\'report_sms_transfer\'">SMS Report Transfer</md-option>\n          <md-option ng-value="\'users\'">Users</md-option>\n          <md-option ng-value="\'voice_recordings\'">Voice Recordings</md-option>\n          <md-option ng-value="\'whatsapp_accounts\'">Whatsapp Account</md-option>\n          <md-option ng-value="\'whatsapp_interactions\'">Whatsapp Interaction</md-option>\n          <md-option ng-value="\'whatsapp_messages\'">Whatsapp Messages</md-option>\n          <md-option ng-value="\'whatsapp_queues\'">Whatsapp Queues</md-option>\n          <md-option ng-value="\'report_whatsapp_queue\'">Whatsapp Report Queue</md-option>\n          <md-option ng-value="\'report_whatsapp_transfer\'">Whatsapp Report Transfer</md-option>\n        </md-select>\n        <div ng-messages="metricForm[\'table\'].$error" ng-show="metricForm[\'table\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.METRIC">Metric</label>\n        <input type="text" name="metric" ng-model="vm.metric.metric" ng-required="true">\n\n        <div ng-messages="metricForm[\'metric\'].$error" ng-show="metricForm[\'metric\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.metric.description">\n\n        <div ng-messages="metricForm[\'description\'].$error" ng-show="metricForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMetric" ng-click="vm.saveMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid || metricForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMetric" ng-click="vm.addNewMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_METRIC" translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n          ADD METRIC\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMetric" ng-click="vm.deleteMetric($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/metrics/metrics.html",'<div id="metrics" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="ANALYTICS.METRICS">Metrics</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedMetrics.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMetrics =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="ANALYTICS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-metrics-count">\n          <span>{{vm.selectedMetrics.length}}</span>\n          <span translate="ANALYTICS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMetrics()" translate="ANALYTICS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMetrics()" translate="ANALYTICS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMetrics" csv-label="true" filename="metrics.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMetrics($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- METRIC TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMetrics" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMetrics">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n                <th md-column md-order-by="table">{{ \'ANALYTICS.TABLE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.metrics.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="metric" md-select-id="id" ng-repeat="metric in vm.metrics.rows">\n                <td md-cell ng-if="metric.userpic"><img class="avatar" alt="{{metric.name}}" ng-src="api/users/{{metric.id}}/avatar" /></td>\n                <td md-cell ng-if="!metric.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{metric.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="id ">{{metric.id}}</td>\n                <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="name ">{{metric.name}}</td>\n                <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="table ">{{ vm.arraytable[metric.table].option }}</td>\n                <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="description ">{{metric.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(metric, $event    )" translate="ANALYTICS.EDIT_METRIC">\n                          Edit Metric\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(metric, $event    )" translate="ANALYTICS.DELETE_METRIC">\n                          Delete Metric\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.metrics.count}}" md-on-paginate="vm.getMetrics" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / METRIC TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD METRIC BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-metric-button" ng-click="vm.createOrEditMetric($event)" aria-label="add metric" translate translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD METRIC BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/copy/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="ANALYTICS.COPY_REPORT">Copy Report</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input name="name" ng-model="vm.report.name" required md-autofocus>\n        <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="md-block">\n        <label translate="ANALYTICS.SELECT_NODE">Select Node</label>\n        <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.copyReport()" class="send-button md-accent md-raised" ng-disabled="!vm.currentNode" aria-label="COPY" translate="ANALYTICS.COPY_REPORT" translate-attr-aria-label="ANALYTICS.COPY_REPORT">\n          COPY REPORT\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/create/dialog.html",'<md-dialog class="report-dialog" aria-label="New Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.report.name" required md-autofocus>\n        <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newReport">\n        <label translate="ANALYTICS.TABLE">Table</label>\n        <md-select ng-model="vm.report.table" required>\n          <md-option ng-repeat="table in vm.tables | orderBy:\'name\'" ng-value="table.name">{{table.name}}</md-option>\n        </md-select>\n        <div ng-messages="reportForm.table.$error" ng-show="reportForm.table.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.report.description">\n        <div ng-messages="reportForm.description.$error" ng-show="reportForm.description.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-autocomplete ng-if="vm.newReport" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="table in vm.tables | filter:vm.searchText" md-item-text="table.name" md-min-length="0" md-selected-item-change="vm.selectedTableChange(table)" placeholder="Select the table to Join">\n        <md-item-template>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{table.name}}</span>\n        </md-item-template>\n        <md-not-found>\n          No states matching "{{vm.searchText}}" were found.\n        </md-not-found>\n      </md-autocomplete>\n\n      <md-card ng-if="vm.newReport" md-theme="default" md-theme-watch ng-repeat="table in vm.joinTables">\n        <md-card-title>\n          <md-card-title-text layout="row">\n            <div layout="row" flex="50">\n              <span class="md-subhead">{{table.name}}</span>\n            </div>\n            <div layout="row" layout-align="end center" flex>\n              <md-button class="md-icon-button" ng-click="vm.removeJoin($index)">\n                <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n              </md-button>\n            </div>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-content>\n          <md-select ng-model="table.parentKey" placeholder="Select the parent key" ng-init="table.parentFields = []; vm.getFields(table, \'parentFields\', vm.report.table)" required>\n            <md-option ng-repeat="field in table.parentFields" ng-value="field">{{field}}</md-option>\n          </md-select>\n          <md-select ng-model="table.foreignKey" placeholder="Select the foreign key" ng-init="table.foreignFields = []; vm.getFields(table, \'foreignFields\', table.name)" required>\n            <md-option ng-repeat="field in table.foreignFields" ng-value="field">{{field}}</md-option>\n          </md-select>\n          <md-select ng-model="table.type" placeholder="Select join type" required>\n            <md-option ng-repeat="join in vm.joinTypes" ng-value="join.key">{{join.value}}</md-option>\n          </md-select>\n        </md-card-content>\n      </md-card>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newReport" ng-click="vm.saveReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newReport" ng-click="vm.addNewReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORT" translate-attr-aria-label="ANALYTICS.ADD_REPORT">\n          ADD REPORT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReport" ng-click="vm.deleteReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/condition/group.html",'<md-card class="padding-horizontal-15 padding-top-15">\n  <div layout="row" ng-if="vm_rc.crudPermissions.canEdit">\n    <md-input-container class="md-block" flex>\n      <label translate="ANALYTICS.OPERATOR">Operator</label>\n      <md-select ng-model="group.operator" required>\n        <md-option value="AND">AND</md-option>\n        <md-option value="OR">OR</md-option>\n      </md-select>\n      <div ng-messages="conditionsForm.operator.$error" ng-show="conditionsForm.operator.$touched" role="alert">\n        <div ng-message="required">\n          <span translate="ANALYTICS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n        </div>\n      </div>\n    </md-input-container>\n    <md-input-container class="md-block">\n      <md-button class="md-raised md-accent" ng-click="vm_rc.addCondition(group.rules)">\n        <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.CONDITION\' | translate}}\n      </md-button>\n    </md-input-container>\n    <md-input-container class="md-block">\n      <md-button class="md-raised md-accent" ng-click="vm_rc.addGroup(group.rules)">\n        <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n      </md-button>\n    </md-input-container>\n    <div flex></div>\n    <md-input-container class="md-block" ng-if="parent">\n      <md-button class="md-raised md-warn" ng-click="vm_rc.deleteConfirm(parent, index, $event)">\n        <md-icon md-font-icon="icon-delete"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n      </md-button>\n    </md-input-container>\n  </div>\n  <div layout="column" ng-repeat="rule in group.rules track by $index">\n    <div layout="row" ng-if="!rule.group">\n      <md-input-container class="md-block" flex>\n        <label translate="ANALYTICS.COLUMN">COLUMN</label>\n        <md-select name="field" ng-model="rule.field" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n          <md-optgroup label="{{vm_rc.report.table}}">\n            <md-option ng-repeat="column in vm_rc.columns" value="{{vm_rc.report.table}}.{{column}}">{{column}}</md-option>\n          </md-optgroup>\n          <md-optgroup ng-if="vm_rc.report.joins" ng-repeat="join in vm_rc.report.joins" label="{{join.foreignTable}}">\n            <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n          </md-optgroup>\n        </md-select>\n        <div ng-messages="conditionsForm.field.$error" ng-show="conditionsForm.field.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" flex>\n        <label translate="ANALYTICS.CONDITION">CONDITION</label>\n        <md-select name="condition" ng-model="rule.condition" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n          <md-option ng-repeat="condition in vm_rc.conditions" ng-value="condition">{{condition}}</md-option>\n        </md-select>\n        <div ng-messages="conditionsForm.condition.$error" ng-show="conditionsForm.condition.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm_rc.isValueByCondition(rule.condition)" class="md-block" flex>\n        <label translate="ANALYTICS.VALUE">VALUE</label>\n        <input type="text" name="value" ng-model="rule.value" ng-disabled="!vm_rc.crudPermissions.canEdit" required md-autofocus>\n        <div ng-messages="conditionsForm.value.$error" ng-show="conditionsForm.value.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm_rc.crudPermissions.canEdit" flex>\n        <md-button class="md-fab md-mini md-warn" aria-label="Delete row" ng-click="vm_rc.deleteConfirm(group.rules, $index, $event)">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </md-input-container>\n    </div>\n    <div ng-if="rule.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="parent=group.rules;index=$index;group=rule.group"></div>\n  </div>\n</md-card>'),e.put("app/main/apps/analytics/views/reports/edit/field/dialog.html",'<md-dialog class="reportField-dialog" aria-label="New Report Field">\n  <form name="reportFieldForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{vm.title}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <pre></pre>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.reportField.type" ng-change="vm.reportField.field = undefined" required>\n          <md-option value="column">Select a column</md-option>\n          <md-option value="metric">Select an existing metric</md-option>\n          <md-option value="custom">Write a custom metric</md-option>\n        </md-select>\n        <div ng-messages="reportForm.type.$error" ng-show="reportForm.type.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-switch on="vm.reportField.type">\n        <md-input-container class="md-block" ng-switch-when="column">\n          <label translate="ANALYTICS.COLUMN">Column Name</label>\n          <md-select name="column" ng-model="vm.reportField.field" required>\n            <md-optgroup label="{{vm.report.table}}">\n              <md-option ng-repeat="column in vm.columns" value="{{vm.report.table}}.{{column}}">{{column}}</md-option>\n              \x3c!-- <md-option ng-repeat="column in vm.columns" ng-value="">{{column}}</md-option> --\x3e\n            </md-optgroup>\n            <md-optgroup ng-if="vm.report.joins" ng-repeat="join in vm.report.joins" label="{{join.foreignTable}}">\n              <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n            </md-optgroup>\n          </md-select>\n          <div ng-messages="reportForm.column.$error" ng-show="reportForm.column.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block" ng-switch-when="metric">\n          <label translate="ANALYTICS.METRIC_NAME">Metric Name</label>\n          <md-select name="metric" ng-model="vm.reportField.MetricId" required>\n            <md-option ng-repeat="metric in vm.metrics" ng-value="metric.id">{{metric.name}}</md-option>\n          </md-select>\n          <div ng-messages="reportForm.metric.$error" ng-show="reportForm.metric.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block" ng-switch-when="custom">\n          <label translate="ANALYTICS.CUSTOM_METRIC">Custom Metric</label>\n          <input type="text" name="field" ng-model="vm.reportField.field" required md-autofocus>\n          <div ng-messages="reportFieldForm.field.$error" ng-show="reportFieldForm.field.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="ANALYTICS.ERRORS.CUSTOM_METRIC_REQUIRED">Custom Metric field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.reportField.alias" ng-required="vm.reportField.type === \'custom\' || vm.reportField.type === \'metric\'">\n        <div ng-messages="reportFieldForm.alias.$error" ng-show="reportFieldForm.alias.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n        <label translate="ANALYTICS.FUNCTION">Function</label>\n        <md-select name="function" ng-model="vm.reportField.function">\n          <md-option ng-value="null">No Function</md-option>\n          <md-option ng-repeat="function in vm.sqlUtil.getFunctions" ng-value="function.value">{{function.value}}</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n        <label translate="ANALYTICS.FORMAT">Format</label>\n        <md-select name="format" ng-model="vm.reportField.format">\n          <md-option ng-value="null">No Format</md-option>\n          <md-option ng-repeat="format in vm.sqlUtil.getFormats" ng-value="format.value">{{format.value}}</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.GROUP_BY">Group By</label>\n        <md-select name="groupBy" ng-model="vm.reportField.groupBy">\n          <md-option ng-repeat="gb in vm.sqlUtil.getGroupBy" ng-value="gb.value">{{gb.value ? \'Yes\' : \'No\'}}</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.ORDER_BY">Order By</label>\n        <md-select name="orderBy" ng-model="vm.reportField.orderBy">\n          <md-option ng-value="null">No Order</md-option>\n          <md-option ng-repeat="ob in vm.sqlUtil.getOrderBy" ng-value="ob.value">{{ob.value}}</md-option>\n        </md-select>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newReportField" ng-click="vm.saveReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newReportField" ng-click="vm.addNewReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORTFIELD" translate-attr-aria-label="ANALYTICS.ADD_REPORTFIELD">\n          ADD REPORT FIELD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReportField" ng-click="vm.deleteReportField($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/view.html",'<div id="analytics-report" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-reports-button md-icon-button" aria-label="Go to reports" ng-click="vm.gotoReports()" translate translate-attr-aria-label="ANALYTICS.GO_TO_ANALYTICSQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="report-image" hide-xs>\n          <img ng-src="assets/images/business/reports.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.report.id}} {{vm.report.name}}\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="ANALYTICS.CREATED_AT"></span> <span>{{vm.report.createdAt | date:\'medium\'}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span>{{vm.report.description}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div>\n      <md-button type="submit" ng-click="vm.saveReport()" ng-disabled="generalForm.$pristine && conditionsForm.$pristine" class="send-button md-accent md-raised" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="ANALYTICS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="ANALYTICS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="ANALYTICS.NAME">Name</label>\n                <input type="text" name="name" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.name" required md-autofocus>\n                <div ng-messages="generalForm.name.$error" ng-show="generalForm.name.$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="ANALYTICS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.description">\n                <div ng-messages="generalForm.description.$error" ng-show="generalForm.description.$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="ANALYTICS.FIELDS">FIELDS</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container fields md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ReportFieldsController as vm_rf" ng-init="vm_rf.init(vm.report, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_rf.selectedReportFields.length">\n                <div class="md-toolbar-tools">\n                  <div layout="row" layout-align="start center">\n                    <div layout="column" layout-align="start start">\n                      <div class="md-subhead" translate="ANALYTICS.FIELDS">\n                        <span translate="ANALYTICS.FIELDS">FIELDS</span>\n                      </div>\n                      <div class="h4">\n                        <span translate="ANALYTICS.TABLE">TABLE</span> <span class="text-bold">{{vm.report.table}}</span>\n                      </div>\n                      <div class="h4" ng-if="vm.report.joins && vm.report.joins.length && vm.isArray(vm.report.joins)">\n                        <span>Join</span> <span class="text-bold">{{ vm.mapArray(vm.report.joins, \'foreignTable\') }}</span>\n                      </div>\n                    </div>\n                  </div>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm_rf.query.filter = query" on-collapse="vm_rf.query.filter = undefined" debounce="300"></ms-search-bar>\n                  <md-button class="md-icon-button" ng-if="vm_rf.crudPermissions.canEdit" ng-click="vm_rf.createOrEditReportField($event)" aria-label="add field" translate translate-attr-label="ANALYTICS.ADD_FIELD">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_rf.selectedReportFields.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_rf.selectedReportFields.length}} {{vm_rf.selectedReportFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_rf.deleteSelectedReportFields($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container>\n                <table md-table md-row-select="vm_rf.crudPermissions.canDelete" multiple ng-model="vm_rf.selectedReportFields" md-progress="vm_rf.promise">\n                  <thead md-head md-order="vm_rf.query.sort" md-on-reorder="vm_rf.getReportFields">\n                    <tr md-row>\n                      <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit">\n                        <md-icon md-font-icon="icon-drag-vertical"></md-icon>\n                      </th>\n                      <th md-column>Type</th>\n                      <th md-column>Column or Metric</th>\n                      <th md-column>Alias</th>\n                      <th md-column>Function</th>\n                      <th md-column>Format</th>\n                      <th md-column>Group By</th>\n                      <th md-column>Order By</th>\n                      <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body ng-sortable="vm_rf.sortableTable">\n                    <tr md-row md-select="reportField" md-select-id="id" ng-repeat="reportField in vm_rf.reportFields.rows">\n                      <td md-cell class="handle" ng-if="vm_rf.crudPermissions.canEdit">\n                        <md-icon md-font-icon="icon-drag-vertical" class="s16"></md-icon>\n                      </td>\n                      <td md-cell>\n                        <div ng-if="reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-shape-plus s16"></div>\n                        <div ng-if="!reportField.MetricId && reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-pencil-box-outline s16"></div>\n                        <div ng-if="!reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-view-column s16"></div>\n                      </td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.MetricId ? vm_rf.getMetricName(reportField.MetricId) : reportField.field}}</td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.alias}}</td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.function">{{reportField.function}}</span><span ng-if="!reportField.function">--</span></td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.format">{{reportField.format}}</span><span ng-if="!reportField.format">--</span></td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.groupBy">YES</span><span ng-if="!reportField.groupBy">--</span></td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.orderBy">{{reportField.orderBy}}</span><span ng-if="!reportField.orderBy">--</span></td>\n                      <td md-cell class="actions" ng-if="vm_rf.crudPermissions.canEdit">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_rf.createOrEditReportField($event, reportField)" translate="ANALYTICS.EDIT_REPORTFIELD">\n                                Edit Field\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item>\n                              <md-button ng-click="vm_rf.deleteConfirm(reportField, $event)" translate="ANALYTICS.DELETE_REPORTFIELD">\n                                Delete Field\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="ANALYTICS.CONDITIONS">CONDITIONS</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container conditions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ReportConditionsController as vm_rc" ng-init="vm_rc.init(vm.report, vm.crudPermissions)">\n              <div class="pb-16" layout="row" layout-align="start center">\n                <div class="h2 secondary-text" translate="ANALYTICS.CONDITION">CONDITION</div>\n              </div>\n              <form name="conditionsForm" novalidate>\n                <div ng-if="vm_rc.report.condition.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="group=vm_rc.report.condition.group"></div>\n              </form>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab md-on-select="vm.previewReport()">\n        <md-tab-label>\n          <span translate="ANALYTICS.PREVIEW">PREVIEW</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n              <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n            </div>\n            <dl ng-if="vm.error">\n              <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n              <dd>{{vm.error.sql}}</dd>\n              <dt translate="ANALYTICS.MESSAGE">Message</dt>\n              <dd>{{vm.error.msg}}</dd>\n            </dl>\n            <md-table-container ng-if="!vm.error">\n              <table md-table>\n                <thead md-head>\n                  <tr md-row>\n                    <th ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n                  </tr>\n                </thead>\n                <tbody md-body>\n                  <tr md-row ng-repeat="row in vm.rows">\n                    <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n                  </tr>\n                  <tr md-row ng-if="!vm.rows.length">\n                    <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n                  </tr>\n                </tbody>\n              </table>\n            </md-table-container>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab md-on-select="vm.queryReport()">\n        <md-tab-label>\n          <span>Query</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n              <div ng-if="!vm.error" class="h2 secondary-text">SQL</div>\n            </div>\n            <dl ng-if="vm.error">\n              <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n              <dd>{{vm.error.sql}}</dd>\n              <dt translate="ANALYTICS.MESSAGE">Message</dt>\n              <dd>{{vm.error.msg}}</dd>\n            </dl>\n            <div ng-if="!vm.error">\n              {{vm.queryResult}}\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/analytics/views/reports/preview/dialog.html",'<md-dialog aria-label="Run Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Preview Report</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n          <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n        </div>\n        <dl ng-if="vm.error">\n          <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n          <dd>{{vm.error.sql}}</dd>\n          <dt translate="ANALYTICS.MESSAGE">Message</dt>\n          <dd>{{vm.error.msg}}</dd>\n        </dl>\n        <md-table-container ng-if="!vm.error">\n          <table md-table md-progress="vm.promise">\n            <thead md-head>\n              <tr md-row>\n                <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-repeat="row in vm.rows">\n                <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n              </tr>\n              <tr md-row ng-if="!vm.rows.length">\n                <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div flex></div>\n      <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n        CLOSE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/reports.html",'<div id="reports" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="ANALYTICS.REPORTS">Reports</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedReports.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedReports =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="ANALYTICS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-reports-count">\n          <span>{{vm.selectedReports.length}}</span>\n          <span translate="ANALYTICS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllReports()" translate="ANALYTICS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectReports()" translate="ANALYTICS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedReports" csv-label="true" filename="reports.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom" class="md-icon-button" ng-click="vm.deleteSelectedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div layout="column" flex="30">\n      <md-card class="padding-top-5 padding-horizontal-10 padding-bottom-0">\n        \x3c!-- SEARCH --\x3e\n        <div layout="row" layout-align="start center">\n          <label for="searchFolder" class="m-0">\n            <md-icon md-font-icon="icon-magnify"></md-icon>\n          </label>\n          <md-input-container md-no-float class="margin-horizontal-0 margin-bottom-0 margin-top-10" flex>\n            <input id="searchFolder" placeholder="Search folder" type="text" ng-model="vm.search" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_FOLDER">\n          </md-input-container>\n        </div>\n        \x3c!-- / SEARCH --\x3e\n      </md-card>\n      <md-card class="padding-10 scrollable">\n        <div js-tree="vm.treeDefaultConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n      </md-card>\n      <md-card class="padding-10 scrollable">\n        <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n      </md-card>\n    </div>\n    <md-card flex="70">\n      <md-toolbar class="md-table-toolbar md-default">\n        <div class="md-toolbar-tools">\n          <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n          <p ng-if="vm.currentPath">\n            <span class="text-boxed">{{vm.currentPath}}</span>\n          </p>\n          <div flex></div>\n          <ms-search-bar on-search="vm.getReports()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n          <div flow-init flow-file-added="vm.importReport($file, $event, $flow)">\n            <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" aria-label="import report" translate translate-attr-label="ANALYTICS.IMPORT_REPORT" flow-btn>\n              <md-icon md-font-icon="icon-upload"></md-icon>\n            </md-button>\n          </div>\n          <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" ng-click="vm.createOrEditReport($event)" aria-label="add report" translate translate-attr-label="ANALYTICS.ADD_REPORT">\n            <md-icon md-font-icon="icon-plus"></md-icon>\n          </md-button>\n        </div>\n      </md-toolbar>\n      <md-table-container>\n        <table md-table md-row-select multiple ng-model="vm.selectedReports" md-progress="vm.promise">\n          <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n            <tr md-row>\n              <th md-column md-order-by="id" width="10px">{{ \'ANALYTICS.ID\' | translate }}</th>\n              <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n              <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n              <th md-column md-order-by="createdAt">{{ \'ANALYTICS.CREATED_AT\' | translate }}</th>\n              <th md-column width="10px"></th>\n            </tr>\n          </thead>\n          <tbody md-body>\n            <tr md-row ng-hide="vm.reports.rows.length">\n              <td md-cell colspan="5">\n                <div layout="row" layout-align="center center">\n                  <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                </div>\n              </td>\n            </tr>\n            <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n              <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="id">{{report.id}}</td>\n              <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="name">{{report.name}}</td>\n              <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="description">{{report.description}}</td>\n              <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="createdAt">{{report.createdAt | date:\'medium\'}}</td>\n              <td md-cell class="actions">\n                <md-menu>\n                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                  </md-button>\n\n                  <md-menu-content width="3">\n                    <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                      <md-button ng-click="vm.copydialog(report, $event)" translate="ANALYTICS.COPY_REPORT">\n                        Copy Report\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item>\n                      <md-button ng-click="vm.previewdialog(report, $event)" translate="ANALYTICS.PREVIEW_REPORT">\n                        Preview Report\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item>\n                      <md-button ng-click="vm.rundialog(report, $event)" translate="ANALYTICS.RUN_REPORT">\n                        Run Report\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item>\n                      <md-button ng-click="vm.downloadfile(report, $event)" translate="ANALYTICS.DOWNLOAD_JSON_REPORT">\n                        Download Json Report\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete && vm.currentNode.custom">\n                    </md-menu-divider>\n                    <md-menu-item ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom">\n                      <md-button ng-click="vm.editstate(report, $event)" translate="ANALYTICS.EDIT_REPORT">\n                        Edit Report\n                      </md-button>\n                    </md-menu-item>\n\n                    <md-menu-item ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom">\n                      <md-button ng-click="vm.deleteconfirm(report, $event)" translate="ANALYTICS.DELETE_REPORT">\n                        Delete Report\n                      </md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </td>\n            </tr>\n          </tbody>\n        </table>\n      </md-table-container>\n\n      <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.reports.count}}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n    </md-card>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/run/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="ANALYTICS.RUN_REPORT">Run Report</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input name="name" ng-model="vm.export.name" required md-autofocus>\n        <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.FORMAT">FORMAT</label>\n        <md-select name="format" ng-model="vm.export.output" required>\n          <md-option value="csv">CSV</md-option>\n          <md-option value="xlsx">Excel (XLSX)</md-option>\n          <md-option value="pdf">PDF</md-option>\n          <md-option value="web">Web</md-option>\n        </md-select>\n        <div ng-messages="reportForm.format.$error" ng-show="reportForm.format.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div layout="row">\n        <div class="md-block" flex>\n          <mdp-date-picker mdp-open-on-click required name="dateRangeFrom" mdp-placeholder="Date Range From" mdp-format="YYYY-MM-DD" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n            <div ng-messages="reportForm.dateRangeFrom.$error" ng-show="reportForm.dateRangeFrom.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_REQUIRED">Date Range From field is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n              </div>\n              <div ng-message="maxDate">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MAX_INVALID">Date Range From Max field is invalid</span>\n              </div>\n            </div>\n          </mdp-date-picker>\n        </div>\n        <div class="md-block" flex>\n          <mdp-date-picker mdp-open-on-click required name="dateRangeTo" mdp-placeholder="Date Range To" mdp-format="YYYY-MM-DD" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n            <div ng-messages="reportForm.dateRangeTo.$error" ng-show="reportForm.dateRangeTo.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_REQUIRED">Date Range From field is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_INVALID">Date Range From field is invalid</span>\n              </div>\n              <div ng-message="minDate">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MIN_INVALID">Date Range From Min field is invalid</span>\n              </div>\n            </div>\n          </mdp-date-picker>\n        </div>\n      </div>\n      <div layout="row">\n        <div class="md-block" flex>\n          <mdp-time-picker required name="timeRangeFrom" mdp-placeholder="Time Range From" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n            <div ng-messages="reportForm.timeRangeFrom.$error" ng-show="reportForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_REQUIRED">Time Range From field is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex>\n          <mdp-time-picker required name="timeRangeTo" mdp-placeholder="Time Range To" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n            <div ng-messages="reportForm.timeRangeTo.$error" ng-show="reportForm.timeRangeTo.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range From field is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.runReport($event)" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid" aria-label="RUN" translate="ANALYTICS.RUN_REPORT" translate-attr-aria-label="ANALYTICS.RUN_REPORT">\n          RUN REPORT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-click="vm.refreshDate()" aria-label="REFRESH" translate translate-attr-aria-label="ANALYTICS.REFRESH">\n          <md-icon md-font-icon="icon-refresh"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.REFRESH">REFRESH</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/run/web/dialog.html",'<md-dialog class="web-dialog" aria-label="Show Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="ANALYTICS.WEB_REPORT">Web Report</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n        </div>\n        <dl ng-if="vm.error">\n          <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n          <dd>{{vm.error.sql}}</dd>\n          <dt translate="ANALYTICS.MESSAGE">Message</dt>\n          <dd>{{vm.error.msg}}</dd>\n        </dl>\n        <md-table-container ng-if="!vm.error">\n          <table md-table md-progress="vm.promise">\n            <thead md-head>\n              <tr md-row>\n                <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-repeat="row in vm.results.rows">\n                <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n              </tr>\n              <tr md-row ng-if="!vm.results.rows.length">\n                <td md-cell colspan="{{vm.columns.length}}">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_DATA">NO DATA</span>\n                  </div>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div flex></div>\n      <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n        CLOSE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/create/dialog.html",'<md-dialog class="odbc-dialog" aria-label="New Odbc">\n  <form name="odbcForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.odbc.name" ng-required="true" autofocus>\n\n        <div ng-messages="odbcForm[\'name\'].$error" ng-show="odbcForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.DSN">DSN</label>\n        <input type="text" name="dsn" ng-model="vm.odbc.dsn" ng-required="true">\n\n        <div class="hint"><span translate="CALLYSQUARE.HELP.DSN"></span></div>\n        <div ng-messages="odbcForm[\'dsn\'].$error" ng-show="odbcForm[\'dsn\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.DSN_REQUIRED">DSN field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.odbc.description">\n\n        <div ng-messages="odbcForm[\'description\'].$error" ng-show="odbcForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOdbc" ng-click="vm.saveOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid || odbcForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOdbc" ng-click="vm.addNewOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_ODBC" translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n          ADD ODBC\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOdbc" ng-click="vm.deleteOdbc($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/odbcs.html",'<div id="odbcs" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CALLYSQUARE.ODBC">ODBC</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedODBC.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedODBC =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CALLYSQUARE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-odbcs-count">\n          <span>{{vm.selectedODBC.length}}</span>\n          <span translate="CALLYSQUARE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllODBC()" translate="CALLYSQUARE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectODBC()" translate="CALLYSQUARE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedODBC" csv-label="true" filename="odbcs.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedODBC($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- ODBC TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedODBC" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getODBC">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n                <th md-column md-order-by="dsn">{{ \'CALLYSQUARE.DSN\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.odbcs.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="odbc" md-select-id="id" ng-repeat="odbc in vm.odbcs.rows">\n                <td md-cell ng-if="odbc.userpic"><img class="avatar" alt="{{odbc.name}}" ng-src="api/users/{{odbc.id}}/avatar" /></td>\n                <td md-cell ng-if="!odbc.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{odbc.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="id ">{{odbc.id}}</td>\n                <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="name ">{{odbc.name}}</td>\n                <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="dsn ">{{odbc.dsn}}</td>\n                <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="description ">{{odbc.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(odbc, $event    )" translate="CALLYSQUARE.EDIT_ODBC">\n                          Edit Odbc\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestOdbc(odbc, $event    )" translate="CALLYSQUARE.TEST_ODBC">\n                          Test Odbc\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(odbc, $event    )" translate="CALLYSQUARE.DELETE_ODBC">\n                          Delete Odbc\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.odbcs.count}}" md-on-paginate="vm.getODBC" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / ODBC TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD ODBC BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-odbc-button" ng-click="vm.createOrEditOdbc($event)" aria-label="add odbc" translate translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD ODBC BUTTON --\x3e\n</div>'),e.put("app/main/apps/callysquare/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n  <form name="projectForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{vm.title | translate}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.NAME">Name</label>\n        <input name="name" ng-model="vm.project.name" required md-autofocus ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-disabled="!vm.newProject">\n        <div ng-messages="projectForm.name.$error" ng-show="projectForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n        <input name="description" ng-model="vm.project.description">\n        <div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.openFromEditor" class="md-block">\n        \x3c!-- Added to check if I\'m opening the dialog directly from the square editor --\x3e\n        <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="ADD" translate="CALLYSQUARE.ADD_PROJECT" translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n          ADD PROJECT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",'<md-dialog class="project-dialog" aria-label="New dialog" ng-init="vm.onInit()">\n  <form name="dialogForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.EDIT"></span> <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block" ng-repeat="attribute in vm.attributes" ng-switch="attribute.name">\n        <label translate="CALLYSQUARE.{{attribute.name | uppercase}}">{{attribute.name | ucfirst }}</label>\n\n        \x3c!--  START SELECT INPUT --\x3e\n        <div ng-if="attribute.name==\'dialTimezone\'">\n          <ms-timezone ng-model="attribute.value"  callysquare="1"></ms-timezone>\n        </div>        \n        <div ng-if="attribute.name!=\'dialTimezone\'">\n          <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_cloud_tts_text_type|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|aws_lex_region|sms_account_id|findBy|pause_id|aws_text_type|dialogflow_language|ndagenerate_audio|ndaactivity_type|languageCode|ssmlGender|method|dialogflowV2_language" ng-required="attribute.required">\n            <md-option ng-if="attribute.defaultValue" ng-value="\'\'"> - None - </md-option>\n            <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n            <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n          </md-select>\n        </div>\n        \x3c!--  END SELECT INPUT --\x3e\n\n        \x3c!--  START SELECT INPUT --\x3e\n        <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="sip_id" ng-required="attribute.required">\n          <md-optgroup label="{{\'CALLYSQUARE.AGENTS\' | translate}}">\n            <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'agent\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{\'CALLYSQUARE.TELEPHONES\' | translate}}">\n            <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'telephone\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{\'CALLYSQUARE.USERS\' | translate}}">\n            <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'admin\' || v.group === \'user\'">{{v.option}}</md-option>\n          </md-optgroup>\n          <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n        </md-select>\n        \x3c!--  END SELECT INPUT --\x3e\n\n        \x3c!--  START NUMBER INPUT --\x3e\n        <div ng-switch-when="timeout">\n          <div ng-switch="vm.cellName">\n            <input ng-switch-when-separator="|" ng-switch-when="answer|ext_dial|dial|queue" type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n            <input ng-switch-when-separator="|" ng-switch-when="record|ispeechasr|googleasr" type="number" step="any" name="{{attribute.name}}" min="-1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n            <input ng-switch-when-separator="|" ng-switch-when="restapi" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n            <input ng-switch-default type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n          </div>\n        </div>\n        <input ng-switch-when-separator="|" ng-switch-when="speed" type="number" step="any" name="{{attribute.name}}" min="-10" max="-10" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n        <input ng-switch-when-separator="|" ng-switch-when="maxdigit|mindigit|digit" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n        <input ng-switch-when-separator="|" ng-switch-when="retry|response|hiddendigitsnum|priority" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n        \x3c!--  END NUMBER INPUT --\x3e\n\n        \x3c!--  START TEXTAREA INPUT --\x3e\n        <textarea name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="query|sms_text|condition|text|custom_action_data|headers|body|rawHeaders|rawBody|private_key" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n        \x3c!--  END TEXTAREA INPUT --\x3e\n\n        \x3c!-- START URL INPUT --\x3e\n        <input ng-switch-when-separator="|" ng-switch-when="ndauth_url|ndassistant_url|url" type="url" name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required">\n        \x3c!-- END URL INPUT --\x3e\n\n        \x3c!--  START TEXT INPUT --\x3e\n        <div ng-if="attribute.name!=\'dialTimezone\'">\n          <input ng-switch-default name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit">\n        </div>\n        <div class=\'hint\' ng-if="attribute.name === \'text\' && vm.cellName === \'tts\' ">\n          <span translate="CALLYSQUARE.HELP.MAX_TEXT_TTS" class="ng-scope">Max 250 chars are supported</span>\n        </div>\n        \x3c!--  END TEXT INPUT--\x3e\n\n        <div class="hint" ng-if="attribute.help">\n          <span translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"></span>\n        </div>\n        <div ng-messages="dialogForm[attribute.name].$error" ng-show="dialogForm[attribute.name].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED">The field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="vm.crudPermissions.canEdit">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="dialogForm.$invalid || dialogForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/edit/edit.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="editForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.EDIT_XML"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label>XML</label>\n        <textarea name="preproduction" ng-model="vm.project.preproduction"></textarea>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="editForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/import/import.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="importForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.IMPORT_XML"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div id="xml-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-file-added="vm.fileAdded($file)" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n        <div class="drop-text hint-text" layout="row" layout-align="center center">\n          <span translate="CALLYSQUARE.DROP_TO_UPLOAD">Drop to upload</span>\n        </div>\n\n        <div class="upload-button" layout="column" layout-align="center center">\n          <md-button class="md-accent md-raised" flow-btn>\n            Upload\n          </md-button>\n          <span class="secondary-text mt-8" translate="CALLYSQUARE.DROP_TO_UPLOAD_MESSAGE">You can also drop files here to upload. Only XML - Max. 5MB</span>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" ng-disabled="importForm.$invalid" aria-label="CLOSE" translate="CALLYSQUARE.CLOSE" translate-attr-aria-label="CALLYSQUARE.CLOSE">\n          CLOSE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/info/info.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="descriptionFrom" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.UPDATE_INFO"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n        <input name="description" ng-model="vm.project.description" md-autofocus>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.NOTES">Description</label>\n        <textarea name="notes" ng-model="vm.project.notes"></textarea>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="descriptionFrom.$invalid" aria-label="SAVE" translate="CALLYSQUARE.UPDATE_INFO" translate-attr-aria-label="CALLYSQUARE.UPDATE">\n          UPDATE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/open/open.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="openForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.OPEN_PROJECT"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.PROJECT">Project</label>\n        <md-select name="id" ng-model="vm.id" required>\n          <md-option value="{{p.id}}" ng-repeat="p in vm.projects">{{p.name}}</md-option>\n        </md-select>\n        <div ng-messages="openForm.id.$error" ng-show="openForm.id.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.PROJECT_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="openForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.OPEN_PROJECT" translate-attr-aria-label="CALLYSQUARE.OPEN">\n          OPEN\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/permissionadd/permissionadd.html",'<md-dialog class="projects-dialog" aria-label="projects">\n  <form name="projectsForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CALLYSQUARE.PERMISSIONADD_PROJECTS">Add User Permissions</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="newForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.COPY_PROJECT"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.NAME">Name</label>\n        <input name="name" ng-model="vm.project.name" required md-autofocus>\n        <div ng-messages="newForm.name.$error" ng-show="newForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="newForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.COPY_PROJECT" translate-attr-aria-label="CALLYSQUARE.COPY">\n          COPY\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/view.html",'<div id="callysquare-project" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="CALLYSQUARE.GO_TO_PROJECTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="project-image" hide-xs>\n          <img ng-src="assets/images/business/cprojects.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.project.id}} {{vm.project.name}}\n          </div>\n          <div class="subtitle secondary-text text-truncate">\n            <span ng-if="vm.project.description">{{vm.project.description}} - </span><span translate="CALLYSQUARE.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-if="vm.crudPermissions.canEdit" ng-click="vm.updateInfo($event)" class="md-fab md-yellow-700-bg md-icon-button" aria-label="edit">\n        <md-icon md-font-icon="icon-tooltip-edit"></md-icon>\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <md-content class="callysquare-content">\n\n    <div id="geEditor" class="geEditor"></div>\n\n  </md-content>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-vector-square" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CALLYSQUARE.PROJECTS">Projects</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    \x3c!-- SEARCH --\x3e\n    <div class="search-input-wrapper" layout="row" layout-align="start center">\n      <label for="search">\n        <md-icon md-font-icon="icon-magnify"></md-icon>\n      </label>\n      <md-input-container md-no-float class="m-0">\n        <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n      </md-input-container>\n    </div>\n    \x3c!-- / SEARCH --\x3e\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CALLYSQUARE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-projects-count">\n          <span>{{vm.selectedProjects.length}}</span>\n          <span translate="CALLYSQUARE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllProjects()" translate="CALLYSQUARE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectProjects()" translate="CALLYSQUARE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      \x3c!-- PROJECT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="notes">{{ \'CALLYSQUARE.NOTES\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.projects.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="notes ">{{project.notes}}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editstate(project, ev)" translate="CALLYSQUARE.EDIT_PROJECT">\n                          Edit Project\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteconfirm(project, ev)" translate="CALLYSQUARE.DELETE_PROJECT">\n                          Delete Project\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / PROJECT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD PROJECT BUTTON --\x3e\n  <md-button class="md-fab md-accent md-icon-button" id="add-project-button" ng-if="vm.crudPermissions.canEdit" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD PROJECT BUTTON --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/squareRecordings/create/dialog.html",'<md-dialog class="squareRecording-dialog" aria-label="New SquareRecording">\n  <form name="squareRecordingForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.FILENAME">Filename</label>\n        <input type="" name="filename" ng-model="vm.squareRecording.filename" ng-required="true" autofocus>\n\n        <div ng-messages="squareRecordingForm[\'filename\'].$error" ng-show="squareRecordingForm[\'filename\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.FILENAME_REQUIRED">Filename field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSquareRecording" ng-click="vm.saveSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid || squareRecordingForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSquareRecording" ng-click="vm.addNewSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_SQUARERECORDING" translate-attr-aria-label="CALLYSQUARE.ADD_SQUARERECORDING">\n          ADD SQUARERECORDING\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSquareRecording" ng-click="vm.deleteSquareRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",'<div id="squareRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CALLYSQUARE.SQUARERECORDINGS">SquareRecordings</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSquareRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSquareRecordings =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CALLYSQUARE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-squareRecordings-count">\n          <span>{{vm.selectedSquareRecordings.length}}</span>\n          <span translate="CALLYSQUARE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSquareRecordings()" translate="CALLYSQUARE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSquareRecordings()" translate="CALLYSQUARE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSquareRecordings" csv-label="true" filename="squareRecordings.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSquareRecordings($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SQUARERECORDING TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSquareRecordings" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSquareRecordings">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="filename">{{ \'CALLYSQUARE.FILENAME\' | translate }}</th>\n                <th md-column md-order-by="projectName">{{ \'CALLYSQUARE.PROJECT\' | translate }}</th>\n                <th md-column md-order-by="uniqueid">{{ \'CALLYSQUARE.UNIQUEID\' | translate }}</th>\n                <th md-column md-order-by="callerid">{{ \'CALLYSQUARE.PHONE\' | translate }}</th>\n                <th md-column md-order-by="extension">{{ \'CALLYSQUARE.EXTEN\' | translate }}</th>\n                <th md-column>{{ \'CALLYSQUARE.AUDIO\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'CALLYSQUARE.CREATED_AT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.squareRecordings.rows.length">\n                <td md-cell colspan="8">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="squareRecording" md-select-id="id" ng-repeat="squareRecording in vm.squareRecordings.rows">\n                <td md-cell ng-if="squareRecording.userpic"><img class="avatar" alt="{{squareRecording.name}}" ng-src="api/users/{{squareRecording.id}}/avatar" /></td>\n                <td md-cell ng-if="!squareRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{squareRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="filename ">{{squareRecording.filename}}</td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="projectName ">{{squareRecording.projectName}}</td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="uniqueid ">{{squareRecording.uniqueid}}</td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="callerid ">{{squareRecording.callerid}}</td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="extension ">{{squareRecording.extension}}</td>\n                <td md-cell class="audio " ng-switch="squareRecording.format">\n                  \x3c!-- audio recording directive --\x3e\n                  <ms-recording ng-switch-when=".wav" id="squareRecording.id" model="\'squareRecording\'"></ms-recording>\n                  \x3c!-- / audio recording directive --\x3e\n                  <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n                    <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n                  </span>\n                </td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="createdAt ">{{squareRecording.createdAt | date:\'medium\' }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadCallySquareRecordings">\n\n                        <md-button ng-click="vm.downloadfile2(squareRecording, $event  , \'square/recordings\'   )" translate="CALLYSQUARE.DOWNLOAD_SQUARERECORDING">\n                          Download SquareRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(squareRecording, $event    )" translate="CALLYSQUARE.DELETE_SQUARERECORDING">\n                          Delete SquareRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.squareRecordings.count}}" md-on-paginate="vm.getSquareRecordings" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SQUARERECORDING TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/chatQueues.html",'<div id="chatQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CHAT.CHATQUEUES">ChatQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedChatQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedChatQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CHAT.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-chatQueues-count">\n          <span>{{vm.selectedChatQueues.length}}</span>\n          <span translate="CHAT.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHAT.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllChatQueues()" translate="CHAT.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectChatQueues()" translate="CHAT.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedChatQueues" csv-label="true" filename="chatQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatQueues($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CHATQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedChatQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'CHAT.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.chatQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="chatQueue" md-select-id="id" ng-repeat="chatQueue in vm.chatQueues.rows">\n                <td md-cell ng-if="chatQueue.userpic"><img class="avatar" alt="{{chatQueue.name}}" ng-src="api/users/{{chatQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!chatQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="id ">{{chatQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="name ">{{chatQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="strategy ">{{ vm.arraystrategy[chatQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(chatQueue, $event    )" translate="CHAT.EDIT_CHATQUEUE">\n                          Edit ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(chatQueue, $event    )" translate="CHAT.TEAMADD_CHATQUEUE">\n                          teamadd ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(chatQueue, $event    )" translate="CHAT.AGENTADD_CHATQUEUE">\n                          agentadd ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(chatQueue, $event    )" translate="CHAT.DELETE_CHATQUEUE">\n                          Delete ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(chatQueue, $event    )" translate="CHAT.GOTOREALTIME_CHATQUEUE">\n                          goToRealtime ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatQueues.count}}" md-on-paginate="vm.getChatQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CHATQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CHATQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatQueue-button" ng-click="vm.createOrEditChatQueue($event)" aria-label="add chatQueue" translate translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CHATQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/create/dialog.html",'<md-dialog class="chatQueue-dialog" aria-label="New ChatQueue">\n  <form name="chatQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newChatQueue">\n\n        <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n        <div ng-messages="chatQueueForm[\'name\'].$error" ng-show="chatQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="chatQueueForm[\'strategy\'].$error" ng-show="chatQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="chatQueueForm[\'timeout\'].$error" ng-show="chatQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.chatQueue.description">\n\n        <div ng-messages="chatQueueForm[\'description\'].$error" ng-show="chatQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatQueue" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid || chatQueueForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatQueue" ng-click="vm.addNewChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATQUEUE" translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n          ADD CHATQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatQueue" ng-click="vm.deleteChatQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n  <form name="chatQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CHAT.AGENTADD_CHATQUEUE">Add Agent to chatQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n  <form name="chatQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CHAT.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/view.html",'<div id="chat-chatQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-chatQueues-button md-icon-button" aria-label="Go to chatQueues" ng-click="vm.gotoChatQueues()" translate translate-attr-aria-label="CHAT.GO_TO_CHATQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="chatQueue-image" hide-xs>\n          <img ng-src="assets/images/business/chatQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.chatQueue.id}}\n            <span ng-if="vm.chatQueue.name">{{vm.chatQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.chatQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="CHAT.TEAMADD_CHATQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.chatQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="CHAT.AGENTADD_CHATQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveChatQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.chatQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.chatQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/chatWebsites.html",'<div id="chatWebsites" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CHAT.CHATWEBSITES">ChatWebsites</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedChatWebsites.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedChatWebsites =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CHAT.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-chatWebsites-count">\n          <span>{{vm.selectedChatWebsites.length}}</span>\n          <span translate="CHAT.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHAT.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllChatWebsites()" translate="CHAT.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectChatWebsites()" translate="CHAT.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedChatWebsites" csv-label="true" filename="chatWebsites.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatWebsites($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CHATWEBSITE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedChatWebsites" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatWebsites">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n                <th md-column md-order-by="address">{{ \'CHAT.MOTIONADDRESS\' | translate }}</th>\n                <th md-column md-order-by="remote">{{ \'CHAT.MOTIONPROXY\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.chatWebsites.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="chatWebsite" md-select-id="id" ng-repeat="chatWebsite in vm.chatWebsites.rows">\n                <td md-cell ng-if="chatWebsite.userpic"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="api/users/{{chatWebsite.id}}/avatar" /></td>\n                <td md-cell ng-if="!chatWebsite.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="id ">{{chatWebsite.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="name ">{{chatWebsite.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="key ">{{chatWebsite.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="address ">{{chatWebsite.address}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="remote ">{{chatWebsite.remote}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="description ">{{chatWebsite.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(chatWebsite, $event    )" translate="CHAT.EDIT_CHATWEBSITE">\n                          Edit ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(chatWebsite, $event    )" translate="CHAT.INTERACTIONS_CHATWEBSITE">\n                          Interactions ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.offlinemessagesgoto(chatWebsite, $event    )" translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE">\n                          OfflineMessages ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(chatWebsite, $event    )" translate="CHAT.AGENTADD_CHATWEBSITE">\n                          AgentAdd ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(chatWebsite, $event    )" translate="CHAT.DELETE_CHATWEBSITE">\n                          Delete ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatWebsites.count}}" md-on-paginate="vm.getChatWebsites" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CHATWEBSITE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CHATWEBSITE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatWebsite-button" ng-click="vm.createOrEditChatWebsite($event)" aria-label="add chatWebsite" translate translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CHATWEBSITE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/create/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="!vm.newChatWebsite">\n\n        <div ng-messages="chatWebsiteForm[\'name\'].$error" ng-show="chatWebsiteForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="chatWebsiteForm[\'key\'].$error" ng-show="chatWebsiteForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n        <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n\n        <div ng-messages="chatWebsiteForm[\'address\'].$error" ng-show="chatWebsiteForm[\'address\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n        <input type="url" name="remote" ng-model="vm.chatWebsite.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n        <div ng-messages="chatWebsiteForm[\'remote\'].$error" ng-show="chatWebsiteForm[\'remote\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n        <div ng-messages="chatWebsiteForm[\'ListId\'].$error" ng-show="chatWebsiteForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.INTERVAL">Interval</label>\n        <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId">\n          <md-option ng-value="null">Always</md-option>\n          <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteForm[\'IntervalId\'].$error" ng-show="chatWebsiteForm[\'IntervalId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.chatWebsite.description">\n\n        <div ng-messages="chatWebsiteForm[\'description\'].$error" ng-show="chatWebsiteForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatWebsite" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid || chatWebsiteForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatWebsite" ng-click="vm.addNewChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATWEBSITE" translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n          ADD CHATWEBSITE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatWebsite" ng-click="vm.deleteChatWebsite($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",'<md-dialog class="chatWebsite-dialog" aria-label="chatWebsite" ng-init="vm.onInit()">\n  <form name="chatWebsiteForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CHAT.AGENTADD_CHATWEBSITE">Add Agent to chatWebsite</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/agent/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'agent\'].$error" ng-show="chatWebsiteFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/amazonlex/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.ACCESSKEYID">accesskeyid</label>\n        <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'accesskeyid\'].$error" ng-show="chatWebsiteFormApp[\'accesskeyid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.SECRETACCESSKEY">secretaccesskey</label>\n        <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'secretaccesskey\'].$error" ng-show="chatWebsiteFormApp[\'secretaccesskey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.LEXREGION">lexregion</label>\n        <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n          <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n          <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n          <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'lexregion\'].$error" ng-show="chatWebsiteFormApp[\'lexregion\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.BOTNAME">botname</label>\n        <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'botname\'].$error" ng-show="chatWebsiteFormApp[\'botname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/autoreply/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'times\'].$error" ng-show="chatWebsiteFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TEXT">Text</label>\n        <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n        <div ng-messages="chatWebsiteFormApp[\'text\'].$error" ng-show="chatWebsiteFormApp[\'text\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TEXT_REQUIRED">Text field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/close/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'disposition\'].$error" ng-show="chatWebsiteFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflow/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'key\'].$error" ng-show="chatWebsiteFormApp[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n          <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'sv\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.PROJECTID">ProjectID</label>\n        <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'projectId\'].$error" ng-show="chatWebsiteFormApp[\'projectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.CLIENTEMAIL">ClientEmail</label>\n        <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'clientEmail\'].$error" ng-show="chatWebsiteFormApp[\'clientEmail\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.PRIVATEKEY">PrivateKey</label>\n        <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n        <div ng-messages="chatWebsiteFormApp[\'privateKey\'].$error" ng-show="chatWebsiteFormApp[\'privateKey\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n          <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n          <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n          <md-option ng-value="\'en-IN\'">English (India)</md-option>\n          <md-option ng-value="\'en-US\'">English (US)</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n          <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'hi\'">Hindi</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pl\'">Polish</md-option>\n          <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n          <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n          <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n          <md-option ng-value="\'sw\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'tr\'">Turkish</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotoif/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'condition\'].$error" ng-show="chatWebsiteFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'truepriority\'].$error" ng-show="chatWebsiteFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'falsepriority\'].$error" ng-show="chatWebsiteFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'priority\'].$error" ng-show="chatWebsiteFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/noop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'value\'].$error" ng-show="chatWebsiteFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/queue/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'queue\'].$error" ng-show="chatWebsiteFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/system/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'command\'].$error" ng-show="chatWebsiteFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'variable\'].$error" ng-show="chatWebsiteFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tag/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'tag\'].$error" ng-show="chatWebsiteFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tvox/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.SERVICEID">serviceid</label>\n        <input type="text" name="serviceid" ng-model="vm.tvox.serviceid" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'serviceid\'].$error" ng-show="chatWebsiteFormApp[\'serviceid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.SERVICEID_REQUIRED">serviceid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.CHANNELID">channelid</label>\n        <input type="text" name="channelid" ng-model="vm.tvox.channelid" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'channelid\'].$error" ng-show="chatWebsiteFormApp[\'channelid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.CHANNELID_REQUIRED">channelid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXURL">tvoxurl</label>\n        <input type="text" name="tvoxurl" ng-model="vm.tvox.tvoxurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'tvoxurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxurl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TVOXURL_REQUIRED">tvoxurl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXLOGINURL">tvoxloginurl</label>\n        <input type="text" name="tvoxloginurl" ng-model="vm.tvox.tvoxloginurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'tvoxloginurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxloginurl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TVOXLOGINURL_REQUIRED">tvoxloginurl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXSESSIONURL">tvoxsessionurl</label>\n        <input type="text" name="tvoxsessionurl" ng-model="vm.tvox.tvoxsessionurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'tvoxsessionurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxsessionurl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TVOXSESSIONURL_REQUIRED">tvoxsessionurl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXUSERNAME">tvoxusername</label>\n        <input type="text" name="tvoxusername" ng-model="vm.tvox.tvoxusername" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'tvoxusername\'].$error" ng-show="chatWebsiteFormApp[\'tvoxusername\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TVOXUSERNAME_REQUIRED">tvoxusername field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXPASSWD">tvoxpasswd</label>\n        <input type="password" name="tvoxpasswd" ng-model="vm.tvox.tvoxpasswd" placeholder="Password" translate translate-attr-placeholder="CHAT.PASSWORD">\n        <div ng-messages="chatWebsiteFormApp[\'tvoxpasswd\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="CHAT.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONURLONRING">motionurlonring</label>\n        <input type="text" name="motionurlonring" ng-model="vm.tvox.motionurlonring" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'motionurlonring\'].$error" ng-show="chatWebsiteFormApp[\'motionurlonring\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONURLONRING_REQUIRED">motionurlonring field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONURLONANSWER">motionurlonanswer</label>\n        <input type="text" name="motionurlonanswer" ng-model="vm.tvox.motionurlonanswer" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'motionurlonanswer\'].$error" ng-show="chatWebsiteFormApp[\'motionurlonanswer\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONURLONANSWER_REQUIRED">motionurlonanswer field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONTITLE">motiontitle</label>\n        <input type="text" name="motiontitle" ng-model="vm.tvox.motiontitle" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'motiontitle\'].$error" ng-show="chatWebsiteFormApp[\'motiontitle\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONTITLE_REQUIRED">motiontitle field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONURL">motionurl</label>\n        <input type="text" name="motionurl" ng-model="vm.tvox.motionurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'motionurl\'].$error" ng-show="chatWebsiteFormApp[\'motionurl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONURL_REQUIRED">motionurl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",'<md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">\n  <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.chatCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="chatCannedAnswerForm[\'key\'].$error" ng-show="chatCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.chatCannedAnswer.value" required></textarea>\n\n        <div ng-messages="chatCannedAnswerForm[\'value\'].$error" ng-show="chatCannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.chatCannedAnswer.description">\n\n        <div ng-messages="chatCannedAnswerForm[\'description\'].$error" ng-show="chatCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatCannedAnswer" ng-click="vm.saveChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatCannedAnswer" ng-click="vm.addNewChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATCANNEDANSWER" translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER">\n          ADD CHATCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatCannedAnswer" ng-click="vm.deleteChatCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",'<md-dialog class="offlineMessage-dialog" aria-label="New OfflineMessage">\n  <md-toolbar class="md-accent md-hue-2">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n      <span class="title">{{ vm.title | translate }}</span>\n      <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-content flex layout-padding>\n    <pre ng-if="vm.isHtml">{{vm.message.body}}</pre>\n    <div ng-if="!vm.isHtml" ng-bind-html-unsafe="vm.message.body"></div>\n\n    <span ng-repeat="attachment in vm.attachments">\n      <md-button class="md-icon-button no-margin no-padding" ng-click="vm.download(attachment)">\n        <md-icon class="no-margin material-icons" aria-label="Attachment">attach_file</md-icon>\n      </md-button>\n      <span>{{attachment.name}}</span><br />\n    </span>\n  </md-content>\n\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",'<md-dialog class="chatProactiveAction-dialog" aria-label="New ChatProactiveAction">\n  <form name="chatProactiveActionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.chatProactiveAction.name" ng-required="true" autofocus>\n\n        <div ng-messages="chatProactiveActionForm[\'name\'].$error" ng-show="chatProactiveActionForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.chatProactiveAction.type">\n\n          <md-option ng-value="\'mouseOver\'"> {{ \'CHAT.MOUSEOVER\' | translate }} </md-option>\n\n          <md-option ng-value="\'timeout\'"> {{ \'CHAT.TIMEOUT\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="chatProactiveActionForm[\'type\'].$error" ng-show="chatProactiveActionForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.chatProactiveAction.type === \'mouseOver\'" class="md-block">\n        <label translate="CHAT.SELECTOR">Selector</label>\n        <input type="" name="selector" ng-model="vm.chatProactiveAction.selector" ng-required="true">\n\n        <div ng-messages="chatProactiveActionForm[\'selector\'].$error" ng-show="chatProactiveActionForm[\'selector\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.SELECTOR_REQUIRED">Selector field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.chatProactiveAction.type === \'timeout\'" class="md-block">\n        <label translate="CHAT.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.chatProactiveAction.timeout" min="1" ng-required="true">\n\n        <div ng-messages="chatProactiveActionForm[\'timeout\'].$error" ng-show="chatProactiveActionForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatProactiveAction" ng-click="vm.saveChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid || chatProactiveActionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatProactiveAction" ng-click="vm.addNewChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATPROACTIVEACTION" translate-attr-aria-label="CHAT.ADD_CHATPROACTIVEACTION">\n          ADD CHATPROACTIVEACTION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatProactiveAction" ng-click="vm.deleteChatProactiveAction($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/view.html",'<div id="chat-chatWebsite" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-chatWebsites-button md-icon-button" aria-label="Go to chatWebsites" ng-click="vm.gotoChatWebsites()" translate translate-attr-aria-label="CHAT.GO_TO_CHATWEBSITES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="chatWebsite-image" hide-xs>\n          <img ng-src="assets/images/business/chatWebsites.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.chatWebsite.id}}\n            <span ng-if="vm.chatWebsite.name">{{vm.chatWebsite.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatWebsite.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.chatWebsite, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="CHAT.AGENTADD_CHATWEBSITE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveChatWebsite()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (scriptForm.$invalid) || (intervalForm.$invalid) || (dispositionForm.$invalid) || (appearanceForm.$invalid) || (onlinestatusForm.$invalid) || (offlinestatusForm.$invalid) || (closingformForm.$invalid) || (unmanagedstatusForm.$invalid) || (interactionForm.$invalid) || (whitelabelForm.$invalid) || (logoForm.$invalid) || (agentAvatarForm.$invalid) || (customerAvatarForm.$invalid) || (systemAvatarForm.$invalid) || (chatFormOnlineForm.$invalid) || (chatFormOfflineForm.$invalid) || (proactiveForm.$invalid) || (chatDispositionsForm.$invalid) || (chatCannedAnswersForm.$invalid) || (vidaooForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid) || (offlineMessagesForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n                <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'address\'].$error" ng-show="generalForm[\'address\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.fidelity" class="md-block">\n                <label translate="CHAT.TIMEOUT">Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.chatWebsite.timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.chatWebsite.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.chatWebsite.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="CHAT.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.chatWebsite.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.queueTransfer == true" class="md-block">\n                <label translate="CHAT.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.chatWebsite.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.agentTransfer == true" class="md-block">\n                <label translate="CHAT.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.chatWebsite.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container script md-background-bg md-whiteframe-1dp">\n            <form name="scriptForm" flex="100" novalidate>\n              <div ng-controller="ChatWebsiteScriptController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg>\n                <div class="pb-16" layout="row" layout-align="start center">\n                  <div class="h2 secondary-text" translate="CHAT.SCRIPT">SCRIPT</div>\n                </div>\n\n\n                <md-input-container class="md-block">\n                  <label translate="CHAT.TOKEN">Token</label>\n                  <input type="text" name="token" ng-model="vm_ac.chatWebsite.token" autofocus ng-disabled="true">\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n                  <input type="url" name="remote" ng-model="vm_ac.chatWebsite.remote" required>\n                  <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n                  <div ng-messages="scriptForm[\'remote\'].$error" ng-show="scriptForm[\'remote\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">Motion Proxy field is required</span>\n                    </div>\n                    <div ng-message="url">\n                      <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">Motion Proxy must be a valid url e.g.: http://www.xcally.com</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="CHAT.WEBSITESCRIPT">WebsiteScript</label>\n                  <div>\n                    <pre style="font-size: 13px;">\n                    {{vm_ac.start}} {{vm_ac.script}} {{vm_ac.end}}\n                    </pre>\n                  </div>\n                  <div class="hint"><span translate="CHAT.HELP.COPYSCRIPTTOCLIPBOARD"></span></div>\n                </md-input-container>\n\n              </div>\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container interval md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.INTERVAL">INTERVAL</div>\n            </div>\n            <form name="intervalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.INTERVAL">Interval</label>\n                <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Always</md-option>\n                  <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n                </md-select>\n                <div ng-messages="intervalForm[\'IntervalId\'].$error" ng-show="intervalForm[\'IntervalId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.TIMEZONE">Timezone</label>\n                <ms-timezone name="timezone" ng-model="vm.chatWebsite.timezone" ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n                <div class="hint"><span translate="CHAT.HELP.TIMEZONE"></span></div>\n                <div ng-messages="intervalForm[\'timezone\'].$error" ng-show="intervalForm[timezone].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.mandatoryDisposition" class="md-block">\n                <label translate="CHAT.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.chatWebsite.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="CHAT.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.SNIPPET">SNIPPET</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container appearance md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.APPEARANCE">APPEARANCE</div>\n            </div>\n            <form name="appearanceForm" novalidate>\n              <div flex md-color-picker ng-model="vm.chatWebsite.color" label="{{\'CHAT.MAINCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n              <div flex md-color-picker ng-model="vm.chatWebsite.color_button" label="{{\'CHAT.BUTTONCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n              <div flex md-color-picker ng-model="vm.chatWebsite.textColor" label="{{\'CHAT.TEXTCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n              <div flex md-color-picker ng-model="vm.chatWebsite.backgroundColor" label="{{\'CHAT.BACKGROUNDCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n              <md-input-container class="md-block">\n                <label translate="CHAT.FONTSIZE">fontSize</label>\n                <input type="number" name="fontSize" ng-model="vm.chatWebsite.fontSize" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="appearanceForm[\'fontSize\'].$error" ng-show="appearanceForm[\'fontSize\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FONTSIZE_REQUIRED">fontSize field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">fontSize must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.HEADERSHAPE">headershape</label>\n                <md-select name="header_shape" ng-model="vm.chatWebsite.header_shape" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'rounded\'"> {{ \'CHAT.ROUNDED\' | translate }} </md-option>\n\n                  <md-option ng-value="\'squared\'"> {{ \'CHAT.SQUARED\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="appearanceForm[\'header_shape\'].$error" ng-show="appearanceForm[\'header_shape\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.HEADERSHAPE_REQUIRED">headershape field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.showAgentAvatar" aria-label="ShowAgentAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWAGENTAVATAR">ShowAgentAvatar</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.showCustomerAvatar" aria-label="showCustomerAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWCUSTOMERAVATAR">showCustomerAvatar</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.SNIPPETSWIPEOUT">snippetSwipeOut</label>\n                <md-select name="alignment" ng-model="vm.chatWebsite.alignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'bottom_right\'"> {{ \'CHAT.BOTTOM_RIGHT\' | translate }} </md-option>\n\n                  <md-option ng-value="\'right\'"> {{ \'CHAT.RIGHT\' | translate }} </md-option>\n\n                  <md-option ng-value="\'left\'"> {{ \'CHAT.LEFT\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="appearanceForm[\'alignment\'].$error" ng-show="appearanceForm[\'alignment\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SNIPPETSWIPEOUT_REQUIRED">snippetSwipeOut field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.alignment !== \'bottom_right\'" class="md-block">\n                <label translate="CHAT.VERTICALPOSITION">verticalPosition</label>\n                <input type="number" name="verticalAlignment" ng-model="vm.chatWebsite.verticalAlignment" min="0" max="100" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="CHAT.HELP.VERTICALPOSITION"></span></div>\n                <div ng-messages="appearanceForm[\'verticalAlignment\'].$error" ng-show="appearanceForm[\'verticalAlignment\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.VERTICALPOSITION_REQUIRED">verticalPosition field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>100</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.MESSAGESALIGNMENT">messagesAlignment</label>\n                <md-select name="messagesAlignment" ng-model="vm.chatWebsite.messagesAlignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'alternate\'"> {{ \'CHAT.ALTERNATE\' | translate }} </md-option>\n\n                  <md-option ng-value="\'centered\'"> {{ \'CHAT.CENTERED\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="appearanceForm[\'messagesAlignment\'].$error" ng-show="appearanceForm[\'messagesAlignment\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.DEFAULTTITLE">defaultTitle</label>\n                <input type="text" name="defaultTitle" ng-model="vm.chatWebsite.defaultTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="appearanceForm[\'defaultTitle\'].$error" ng-show="appearanceForm[\'defaultTitle\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.DEFAULTTITLE_REQUIRED">defaultTitle field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.DEFAULTTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>defaultTitle must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.LABELTEXT">labelText</label>\n                <input type="text" name="labelText" ng-model="vm.chatWebsite.labelText" md-maxlength="6" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="appearanceForm[\'labelText\'].$error" ng-show="appearanceForm[\'labelText\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.LABELTEXT_REQUIRED">labelText field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.LABELTEXT_MAX_LENGTH" translate-values=\'{max: 6}\'>labelText\n                      must have a maximum length equal to 6</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container onlinestatus md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.ONLINESTATUS">ONLINESTATUS</div>\n            </div>\n            <form name="onlinestatusForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.HEADER_ONLINE">header_online</label>\n                <input type="text" name="header_online" ng-model="vm.chatWebsite.header_online" md-maxlength="255" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="onlinestatusForm[\'header_online\'].$error" ng-show="onlinestatusForm[\'header_online\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.HEADER_ONLINE_REQUIRED">header_online field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.HEADER_ONLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_online must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.START_CHAT_BUTTON">start_chat_button</label>\n                <input type="text" name="start_chat_button" ng-model="vm.chatWebsite.start_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="onlinestatusForm[\'start_chat_button\'].$error" ng-show="onlinestatusForm[\'start_chat_button\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.START_CHAT_BUTTON_REQUIRED">start_chat_button field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.START_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>start_chat_button must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container offlinestatus md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.OFFLINESTATUS">OFFLINESTATUS</div>\n            </div>\n            <form name="offlinestatusForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.hideWhenOffline" aria-label="hideWhenOffline" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.HIDEWHENOFFLINE">hideWhenOffline</span></md-switch>\n                <div class="hint"><span translate="CHAT.HELP.HIDEWHENOFFLINE"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.HEADER_OFFLINE">header_offline</label>\n                <input type="text" name="header_offline" ng-model="vm.chatWebsite.header_offline" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="offlinestatusForm[\'header_offline\'].$error" ng-show="offlinestatusForm[\'header_offline\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.HEADER_OFFLINE_REQUIRED">header_offline field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.HEADER_OFFLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_offline must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.OFFLINE_CHAT_BUTTON">offline_chat_button</label>\n                <input type="text" name="offline_chat_button" ng-model="vm.chatWebsite.offline_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="offlinestatusForm[\'offline_chat_button\'].$error" ng-show="offlinestatusForm[\'offline_chat_button\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_REQUIRED">offline_chat_button field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>offline_chat_button must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.OFFLINEMESSAGESUBJECT">offlineMessageSubject</label>\n                <input type="text" name="offlineMessageSubject" ng-model="vm.chatWebsite.offlineMessageSubject" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="offlinestatusForm[\'offlineMessageSubject\'].$error" ng-show="offlinestatusForm[\'offlineMessageSubject\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_REQUIRED">offlineMessageSubject field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageSubject must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.OFFLINEMESSAGEBODY">offlineMessageBody</label>\n                <input type="text" name="offlineMessageBody" ng-model="vm.chatWebsite.offlineMessageBody" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="offlinestatusForm[\'offlineMessageBody\'].$error" ng-show="offlinestatusForm[\'offlineMessageBody\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_REQUIRED">offlineMessageBody field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageBody must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container closingform md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.CLOSINGFORM">CLOSINGFORM</div>\n            </div>\n            <form name="closingformForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.CLOSINGMESSAGE">closingMessage</label>\n                <textarea name="closingMessage" ng-model="vm.chatWebsite.closingMessage" md-maxlength="255" required autofocus></textarea>\n\n                <div ng-messages="closingformForm[\'closingMessage\'].$error" ng-show="closingformForm[\'closingMessage\'].$touched" role="alert">\n\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.CLOSINGMESSAGE_REQUIRED">closingMessage field is required</span>\n                  </div>\n\n\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.CLOSINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessage must have a maximum length equal to 255</span>\n                  </div>\n\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.SKIPMESSAGEBUTTON">skipMessageButton</label>\n                <input type="text" name="skipMessageButton" ng-model="vm.chatWebsite.skipMessageButton" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'skipMessageButton\'].$error" ng-show="closingformForm[\'skipMessageButton\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_REQUIRED">skipMessageButton field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>skipMessageButton must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableRating" aria-label="enableRating" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLERATING">enableRating</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableRating" class="md-block">\n                <label translate="CHAT.RATINGTYPE">ratingType</label>\n                <md-select name="ratingType" ng-model="vm.chatWebsite.ratingType" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'star\'">Star</md-option>\n                  <md-option ng-value="\'thumb\'">Thumb</md-option>\n                </md-select>\n                <div ng-messages="closingformForm[\'ratingType\'].$error" ng-show="closingformForm[\'ratingType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.RATINGTYPE_REQUIRED">ratingType field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableRating && vm.chatWebsite.ratingType === \'star\'" class="md-block">\n                <label translate="CHAT.RATINGSTARSNUMBER">ratingStarsNumber</label>\n                <input type="number" name="ratingStarsNumber" ng-model="vm.chatWebsite.ratingStarsNumber" min="2" max="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'ratingStarsNumber\'].$error" ng-show="closingformForm[\'ratingStarsNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_REQUIRED">ratingStarsNumber field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>2</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableFeedback" aria-label="enableFeedback" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEFEEDBACK">enableFeedback</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableFeedback" class="md-block">\n                <label translate="CHAT.FEEDBACKTITLE">feedbackTitle</label>\n                <input type="text" name="feedbackTitle" ng-model="vm.chatWebsite.feedbackTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'feedbackTitle\'].$error" ng-show="closingformForm[\'feedbackTitle\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FEEDBACKTITLE_REQUIRED">feedbackTitle field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.FEEDBACKTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>feedbackTitle must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.forwardTranscript" aria-label="forwardTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.FORWARDTRANSCRIPT">forwardTranscript</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.forwardTranscript" class="md-block">\n                <label translate="CHAT.FORWARDTRANSCRIPTMESSAGE">forwardTranscriptMessage</label>\n                <input type="text" name="forwardTranscriptMessage" ng-model="vm.chatWebsite.forwardTranscriptMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'forwardTranscriptMessage\'].$error" ng-show="closingformForm[\'forwardTranscriptMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_REQUIRED">forwardTranscriptMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>forwardTranscriptMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.CLOSINGMESSAGEBUTTON">closingMessageButton</label>\n                <input type="text" name="closingMessageButton" ng-model="vm.chatWebsite.closingMessageButton" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'closingMessageButton\'].$error" ng-show="closingformForm[\'closingMessageButton\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_REQUIRED">closingMessageButton field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessageButton must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container unmanagedstatus md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.UNMANAGEDSTATUS">UNMANAGEDSTATUS</div>\n            </div>\n            <form name="unmanagedstatusForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.autoclose" aria-label="autoclose" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AUTOCLOSE">autoclose</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableUnmanagedNote" aria-label="enableUnmanagedNote" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEUNMANAGEDNOTE">enableUnmanagedNote</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.UNMANAGEDMESSAGE">unmanagedMessage</label>\n                <input type="text" name="unmanagedMessage" ng-model="vm.chatWebsite.unmanagedMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="unmanagedstatusForm[\'unmanagedMessage\'].$error" ng-show="unmanagedstatusForm[\'unmanagedMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_REQUIRED">unmanagedMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>unmanagedMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.SKIPUNMANAGED">skipUnmanaged</label>\n                <input type="text" name="skipUnmanaged" ng-model="vm.chatWebsite.skipUnmanaged" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="unmanagedstatusForm[\'skipUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'skipUnmanaged\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SKIPUNMANAGED_REQUIRED">skipUnmanaged field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.SKIPUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>skipUnmanaged must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n                <label translate="CHAT.SENDUNMANAGED">sendUnmanaged</label>\n                <input type="text" name="sendUnmanaged" ng-model="vm.chatWebsite.sendUnmanaged" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="unmanagedstatusForm[\'sendUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'sendUnmanaged\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SENDUNMANAGED_REQUIRED">sendUnmanaged field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.SENDUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>sendUnmanaged must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n                <label translate="CHAT.NOTETITLE">noteTitle</label>\n                <input type="text" name="noteTitle" ng-model="vm.chatWebsite.noteTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="unmanagedstatusForm[\'noteTitle\'].$error" ng-show="unmanagedstatusForm[\'noteTitle\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.NOTETITLE_REQUIRED">noteTitle field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.NOTETITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>noteTitle must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container interaction md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.INTERACTION">INTERACTION</div>\n            </div>\n            <form name="interactionForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.AGENTIDENTIFIER">agentIdentifier</label>\n                <md-select name="agentIdentifier" ng-model="vm.chatWebsite.agentIdentifier" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'website_alias\'"> {{ \'CHAT.WEBSITEALIAS\' | translate }} </md-option>\n\n                  <md-option ng-value="\'agent_alias\'"> {{ \'CHAT.AGENTALIAS\' | translate }} </md-option>\n\n                  <md-option ng-value="\'agent_fullname\'"> {{ \'CHAT.AGENTFULLNAME\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="CHAT.HELP.AGENTIDENTIFIER"></span></div>\n                <div ng-messages="interactionForm[\'agentIdentifier\'].$error" ng-show="interactionForm[\'agentIdentifier\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.AGENTIDENTIFIER_REQUIRED">agentIdentifier field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.CUSTOMERALIAS">customerAlias</label>\n                <input type="text" name="customerAlias" ng-model="vm.chatWebsite.customerAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'customerAlias\'].$error" ng-show="interactionForm[\'customerAlias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.CUSTOMERALIAS_REQUIRED">customerAlias field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.CUSTOMERALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>customerAlias must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.MESSAGEFONTSIZE">messageFontSize</label>\n                <input type="number" name="messageFontSize" ng-model="vm.chatWebsite.messageFontSize" min="0" max="20" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'messageFontSize\'].$error" ng-show="interactionForm[\'messageFontSize\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_REQUIRED">messageFontSize field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>20</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.agentIdentifier === \'website_alias\'" class="md-block">\n                <label translate="CHAT.WEBSITEALIAS">WebsiteAlias</label>\n                <input type="text" name="agentAlias" ng-model="vm.chatWebsite.agentAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="CHAT.HELP.WEBSITEALIAS"></span></div>\n                <div ng-messages="interactionForm[\'agentAlias\'].$error" ng-show="interactionForm[\'agentAlias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WEBSITEALIAS_REQUIRED">WebsiteAlias field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.WEBSITEALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>WebsiteAlias must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.CLOSINGQUESTION">closingQuestion</label>\n                <input type="text" name="closingQuestion" ng-model="vm.chatWebsite.closingQuestion" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'closingQuestion\'].$error" ng-show="interactionForm[\'closingQuestion\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.CLOSINGQUESTION_REQUIRED">closingQuestion field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.CLOSINGQUESTION_MAX_LENGTH" translate-values=\'{max: 255}\'>closingQuestion must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.FORMSUBMITSUCCESSMESSAGE">formSubmitSuccessMessage</label>\n                <input type="text" name="formSubmitSuccessMessage" ng-model="vm.chatWebsite.formSubmitSuccessMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'formSubmitSuccessMessage\'].$error" ng-show="interactionForm[\'formSubmitSuccessMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_REQUIRED">formSubmitSuccessMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitSuccessMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.FORMSUBMITFAILUREMESSAGE">formSubmitFailureMessage</label>\n                <input type="text" name="formSubmitFailureMessage" ng-model="vm.chatWebsite.formSubmitFailureMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'formSubmitFailureMessage\'].$error" ng-show="interactionForm[\'formSubmitFailureMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_REQUIRED">formSubmitFailureMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitFailureMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableCustomerWriting" aria-label="enableCustomerWriting" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERWRITING">enableCustomerWriting</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n                <label translate="CHAT.WAITINGTITLE">waitingTitle</label>\n                <input type="text" name="waitingTitle" ng-model="vm.chatWebsite.waitingTitle" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'waitingTitle\'].$error" ng-show="interactionForm[\'waitingTitle\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WAITINGTITLE_REQUIRED">waitingTitle field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.WAITINGTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingTitle must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n                <label translate="CHAT.WAITINGMESSAGE">waitingMessage</label>\n                <textarea name="waitingMessage" ng-model="vm.chatWebsite.waitingMessage" md-maxlength="255" required></textarea>\n\n                <div ng-messages="interactionForm[\'waitingMessage\'].$error" ng-show="interactionForm[\'waitingMessage\'].$touched" role="alert">\n\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WAITINGMESSAGE_REQUIRED">waitingMessage field is required</span>\n                  </div>\n\n\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.WAITINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingMessage must have a maximum length equal to 255</span>\n                  </div>\n\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.PLACEHOLDERMESSAGE">placeholderMessage</label>\n                <input type="text" name="placeholderMessage" ng-model="vm.chatWebsite.placeholderMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'placeholderMessage\'].$error" ng-show="interactionForm[\'placeholderMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_REQUIRED">placeholderMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>placeholderMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.download_transcript" aria-label="downloadTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DOWNLOADTRANSCRIPT">downloadTranscript</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableCustomerAttachment" aria-label="enableCustomerAttachment" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERATTACHMENT">enableCustomerAttachment</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableSendButton" aria-label="enableSendButton" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLESENDBUTTON">enableSendButton</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableCustomerCheckmarks" aria-label="enableCustomerCheckmarks" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERCHECKMARKS">enableCustomerCheckmarks</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.SYSTEMALIAS">systemAlias</label>\n                <input type="text" name="systemAlias" ng-model="vm.chatWebsite.systemAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'systemAlias\'].$error" ng-show="interactionForm[\'systemAlias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SYSTEMALIAS_REQUIRED">systemAlias field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.SYSTEMALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>systemAlias must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container whitelabel md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.WHITELABEL">WHITELABEL</div>\n            </div>\n            <form name="whitelabelForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.defaultWhiteLabel" aria-label="default" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DEFAULT">default</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="!vm.chatWebsite.defaultWhiteLabel" class="md-block">\n                <label translate="CHAT.WHITELABEL">whiteLabel</label>\n                <textarea name="whiteLabel" ng-model="vm.chatWebsite.whiteLabel" md-maxlength="255" required></textarea>\n\n                <div ng-messages="whitelabelForm[\'whiteLabel\'].$error" ng-show="whitelabelForm[\'whiteLabel\'].$touched" role="alert">\n\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WHITELABEL_REQUIRED">whiteLabel field is required</span>\n                  </div>\n\n\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.WHITELABEL_MAX_LENGTH" translate-values=\'{max: 255}\'>whiteLabel must have a maximum length equal to 255</span>\n                  </div>\n\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container logo md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.LOGO">LOGO</div>\n            </div>\n            <div ng-controller="ChatWebsitelogoController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n              <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="logoimage in vm_ca.chatWebsite.images" ng-switch="logoimage.type">\n                    <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="logoimage.file">\n                    </div>\n\n                    <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{logoimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n          </div>\n          <div class="chatWebsite-detail-form-container agentavatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.AGENTAVATAR">AGENTAVATAR</div>\n            </div>\n            <div ng-controller="ChatWebsiteagentAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n              <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="agentAvatarimage in vm_ca.chatWebsite.images" ng-switch="agentAvatarimage.type">\n                    <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{agentAvatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="agentAvatarimage.file">\n                    </div>\n\n                    <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{agentAvatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n          </div>\n          <div class="chatWebsite-detail-form-container customeravatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.CUSTOMERAVATAR">CUSTOMERAVATAR</div>\n            </div>\n            <div ng-controller="ChatWebsitecustomerAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n              <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="customerAvatarimage in vm_ca.chatWebsite.images" ng-switch="customerAvatarimage.type">\n                    <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{customerAvatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="customerAvatarimage.file">\n                    </div>\n\n                    <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{customerAvatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n          </div>\n          <div class="chatWebsite-detail-form-container systemavatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.SYSTEMAVATAR">SYSTEMAVATAR</div>\n            </div>\n            <div ng-controller="ChatWebsitesystemAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n              <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="systemAvatarimage in vm_ca.chatWebsite.images" ng-switch="systemAvatarimage.type">\n                    <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{systemAvatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="systemAvatarimage.file">\n                    </div>\n\n                    <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{systemAvatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.ONLINE">ONLINE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container chatformonline md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteonlineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n              <div flex>\n                \x3c!-- START Buttons --\x3e\n                <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n                  <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n                  <md-icon md-font-icon="{{button.icon}}"></md-icon>\n                </md-button>\n                \x3c!-- END Buttons --\x3e\n              </div>\n\n              <div layout="row" flex>\n                <div flex="50">\n                  <md-card>\n                    <md-card-title>\n                      <md-card-title-text>\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n                        </div>\n                      </md-card-title-text>\n                    </md-card-title>\n                    <md-card-content>\n\n                      <form name="onlineForm" novalidate>\n\n                        \x3c!-- START MapKey --\x3e\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n                          <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.mapKey">\n                            <md-option ng-value="null">None</md-option>\n\n                            <md-optgroup label="standard">\n                              <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n                            </md-optgroup>\n\n                            <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n                              <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n                            </md-optgroup>\n                          </md-select>\n                        </md-input-container>\n                        \x3c!-- END MapKey --\x3e\n\n                        \x3c!-- START FromKey --\x3e\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n                          <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.onlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.onlineForm.fromKey != null ? vm_fonc.chatWebsite.onlineForm.items[vm_fonc.chatWebsite.onlineForm.fromKey].props.title : \'None\'">\n                            <md-option ng-value="null">None</md-option>\n                            <md-option ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                        \x3c!-- END FromKey --\x3e\n\n                        \x3c!-- START EXPANSION PANELS --\x3e\n                        <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items track by $index" md-component-id="{{\'onlinePanel\' + $index}}">\n                          <md-expansion-panel-collapsed md-no-sticky="true">\n                            <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n                              <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n                            </md-button>\n                            <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n                              <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n                            </md-button>\n\n                            <div class="md-title">{{item.props.title || item.type}}</div>\n\n                            <div flex></div>\n                            <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n                              <md-icon md-font-icon="icon-chevron-down"></md-icon>\n                            </md-button>\n                          </md-expansion-panel-collapsed>\n\n                          <md-expansion-panel-expanded>\n                            <md-expansion-panel-header>\n                              <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n                                <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n                              </md-button>\n                              <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n                                <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n                              </md-button>\n\n                              <div class="md-title">{{item.props.title || item.type}}</div>\n\n                              <div flex></div>\n\n                              <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n                                <md-icon md-font-icon="icon-delete"></md-icon>\n                              </md-button>\n                              <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n                                <md-icon md-font-icon="icon-chevron-up"></md-icon>\n                              </md-button>\n                            </md-expansion-panel-header>\n\n                            <md-expansion-panel-content>\n                              <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n                              <md-input-container class="md-block">\n                                <label translate="CHAT.VARIABLE">Variable</label>\n                                <md-select ng-model="item.variable">\n                                  <md-option ng-value="null">None</md-option>\n                                  <md-option ng-repeat="variable in vm_fonc.variables" ng-value="variable.name">{{ variable.name }}</md-option>\n                                </md-select>\n                              </md-input-container>\n\n                              <md-input-container class="md-block">\n                                <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n                                <md-select ng-model="item.cmField">\n                                  <md-option ng-value="null">None</md-option>\n\n                                  <md-optgroup label="standard">\n                                    <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n                                  </md-optgroup>\n\n                                  <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n                                    <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n                                  </md-optgroup>\n                                </md-select>\n                              </md-input-container>\n                            </md-expansion-panel-content>\n\n                          </md-expansion-panel-expanded>\n                        </md-expansion-panel>\n                        \x3c!-- END EXPANSION PANELS --\x3e\n                      </form>\n                    </md-card-content>\n                  </md-card>\n                </div>\n                <div flex="50">\n                  <md-card>\n                    <md-card-title>\n                      <md-card-title-text>\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n                        </div>\n                      </md-card-title-text>\n                    </md-card-title>\n                    <md-card-content flex>\n                      <form-view form="vm_fonc.chatWebsite.onlineForm" flex="100"></form-view>\n                    </md-card-content>\n                  </md-card>\n                </div>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.OFFLINE">OFFLINE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container chatformoffline md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteofflineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n              <div flex>\n                \x3c!-- START Buttons --\x3e\n                <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n                  <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n                  <md-icon md-font-icon="{{button.icon}}"></md-icon>\n                </md-button>\n                \x3c!-- END Buttons --\x3e\n              </div>\n\n              <div layout="row" flex>\n                <div flex="50">\n                  <md-card>\n                    <md-card-title>\n                      <md-card-title-text>\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n                        </div>\n                      </md-card-title-text>\n                    </md-card-title>\n                    <md-card-content>\n\n                      <form name="offlineForm" novalidate>\n                        <md-input-container class="md-block">\n                          <md-switch ng-model="vm_fonc.chatWebsite.forwardOffline" aria-label="forwardOffline"><span translate="CHAT.FORWARD_OFFLINE">forwardOffline</span></md-switch>\n                        </md-input-container>\n\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.forwardOffline">\n                          <label translate="CHAT.FORWARD_OFFLINE_ADDRESS">FORWARD OFFLINE ADDRESS</label>\n                          <input type="text" name="forwardOfflineAddress" ng-model="vm_fonc.chatWebsite.forwardOfflineAddress">\n                          <div class="hint"><span translate="CHAT.HELP.FORWARD_OFFLINE"></span></div>\n                          <div ng-messages="offlineForm[\'forwardOfflineAddress\'].$error" ng-show="offlineForm[\'forwardOfflineAddress\'].$touched" role="alert">\n                            <div ng-message="email">\n                              <span translate="CHAT.ERRORS.EMAIL_MUST_BE_VALID">forwardOffline must be a valid e-mail address</span>\n                            </div>\n                          </div>\n                        </md-input-container>\n\n                        <md-input-container class="md-block">\n                          <md-switch ng-model="vm_fonc.chatWebsite.openNewInteraction" aria-label="openNewInteraction">\n                            <span translate="CHAT.OPEN_NEW_INTERACTION">openNewInteraction</span>\n                          </md-switch>\n                        </md-input-container>\n\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.openNewInteraction">\n                          <label translate="CHAT.EMAIL_ACCOUNT">Email account</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.MailAccountId" required>\n                            <md-option ng-repeat="account in vm_fonc.email_accounts" ng-value="account.id">{{ account.name }}</md-option>\n                          </md-select>\n                          <div ng-messages="offlineForm[\'MailAccountId\'].$error" ng-show="offlineForm[\'MailAccountId\'].$touched" role="alert">\n                            <div ng-message="required">\n                              <span translate="CHAT.ERRORS.EMAIL_ACCOUNT_REQUIRED">Email account field is required</span>\n                            </div>\n                          </div>\n                        </md-input-container>\n\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.openNewInteraction && vm_fonc.chatWebsite.offlineForm.items.length">\n                          <label translate="CHAT.SUBJECT">Subject</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.subjectOffline" md-selected-text="vm_fonc.chatWebsite.subjectOffline != null ? vm_fonc.chatWebsite.subjectOffline : \'None\'">\n                            <md-option ng-value="null">None</md-option>\n                            <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="item.props.title">{{ item.props.title }}</md-option>\n                          </md-select>\n                        </md-input-container>\n\n                        \x3c!-- START MapKey --\x3e\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n                          <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.mapKeyOffline">\n                            <md-option ng-value="null">None</md-option>\n\n                            <md-optgroup label="standard">\n                              <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n                            </md-optgroup>\n\n                            <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n                              <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n                            </md-optgroup>\n                          </md-select>\n                        </md-input-container>\n                        \x3c!-- END MapKey --\x3e\n\n                        \x3c!-- START FromKey --\x3e\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n                          <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.offlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.offlineForm.fromKey != null ? vm_fonc.chatWebsite.offlineForm.items[vm_fonc.chatWebsite.offlineForm.fromKey].props.title : \'None\'">\n                            <md-option ng-value="null">None</md-option>\n                            <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                        \x3c!-- END FromKey --\x3e\n\n                        \x3c!-- START EXPANSION PANELS --\x3e\n                        <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items track by $index" md-component-id="{{\'offlinePanel\' + $index}}">\n                          <md-expansion-panel-collapsed md-no-sticky="true">\n                            <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n                              <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n                            </md-button>\n                            <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n                              <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n                            </md-button>\n\n                            <div class="md-title">{{item.props.title || item.type}}</div>\n\n                            <div flex></div>\n                            <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n                              <md-icon md-font-icon="icon-chevron-down"></md-icon>\n                            </md-button>\n                          </md-expansion-panel-collapsed>\n\n                          <md-expansion-panel-expanded>\n                            <md-expansion-panel-header>\n                              <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n                                <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n                              </md-button>\n                              <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n                                <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n                              </md-button>\n\n                              <div class="md-title">{{item.props.title || item.type}}</div>\n\n                              <div flex></div>\n\n                              <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n                                <md-icon md-font-icon="icon-delete"></md-icon>\n                              </md-button>\n                              <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n                                <md-icon md-font-icon="icon-chevron-up"></md-icon>\n                              </md-button>\n                            </md-expansion-panel-header>\n\n                            <md-expansion-panel-content>\n                              <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n\n                              <md-input-container class="md-block" ng-if="item.type != \'upload\'">\n                                <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n                                <md-select ng-model="item.cmField">\n                                  <md-option ng-value="null">None</md-option>\n\n                                  <md-optgroup label="standard">\n                                    <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n                                  </md-optgroup>\n\n                                  <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n                                    <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n                                  </md-optgroup>\n                                </md-select>\n                              </md-input-container>\n                            </md-expansion-panel-content>\n\n                          </md-expansion-panel-expanded>\n                        </md-expansion-panel>\n                        \x3c!-- END EXPANSION PANELS --\x3e\n                      </form>\n                    </md-card-content>\n                  </md-card>\n                </div>\n                <div flex="50">\n                  <md-card>\n                    <md-card-title>\n                      <md-card-title-text>\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n                        </div>\n                      </md-card-title-text>\n                    </md-card-title>\n                    <md-card-content flex>\n                      <form-view form="vm_fonc.chatWebsite.offlineForm" flex="100"></form-view>\n                    </md-card-content>\n                  </md-card>\n                </div>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.PROACTIVEACTIONS">PROACTIVEACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container proactive md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteProactiveActionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteProactiveActions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CHAT.PROACTIVEACTIONS">ProactiveActions</span>\n                  <ms-search-bar on-search="vm_dc.getChatWebsiteProactiveActions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event)" aria-label="add chatProactiveAction" translate translate-attr-label="CHAT.ADD_CHATPROACTIVEACTION">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteProactiveActions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedChatWebsiteProactiveActions.length}} {{vm_dc.selectedChatWebsiteProactiveActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteProactiveActions" csv-label="true" filename="chatWebsites.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteProactiveActions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteProactiveActions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteProactiveActions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CHAT.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="name">\n                        {{ \'CHAT.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="type">\n                        {{ \'CHAT.TYPE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="selector">\n                        {{ \'CHAT.SELECTOR\' | translate }}\n                      </th>\n                      <th md-column md-order-by="timeout">\n                        {{ \'CHAT.TIMEOUT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'CHAT.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="chatProactiveAction" md-select-id="id" ng-repeat="chatProactiveAction in vm_dc.chatWebsiteProactiveActions.rows">\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{chatProactiveAction.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{chatProactiveAction.name}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{ \'CHAT.\' + vm_dc.arraytype[chatProactiveAction.type].option | uppercase | translate }}\n                      </td>\n\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{chatProactiveAction.selector}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{chatProactiveAction.timeout}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{ chatProactiveAction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" translate="CHAT.EDIT_CHATPROACTIVEACTION">\n                                Edit ChatProactiveAction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(chatProactiveAction, $event)" translate="CHAT.DELETE_CHATPROACTIVEACTION">\n                                Delete ChatProactiveAction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.chatWebsiteProactiveActions.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CHAT.NO_CHATPROACTIVEACTION_AVAILABLE">No chatproactiveaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteProactiveActions.count}}" md-on-paginate="vm_dc.getChatWebsiteProactiveActions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="ChatWebsiteDispositionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="chatWebsite-detail-form-container chatdispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="CHAT.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add chat dispositions" translate translate-attr-label="CHAT.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="chatWebsites.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container chatcannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteChatCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CHAT.CHATCANNEDANSWERS">ChatCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getChatWebsiteChatCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event)" aria-label="add chatCannedAnswer" translate translate-attr-label="CHAT.ADD_CHATCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatCannedAnswers.length}} {{vm_dc.selectedChatWebsiteChatCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatCannedAnswers" csv-label="true" filename="chatWebsites.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CHAT.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'CHAT.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'CHAT.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'CHAT.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'CHAT.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="chatCannedAnswer" md-select-id="id" ng-repeat="chatCannedAnswer in vm_dc.chatWebsiteChatCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{chatCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{chatCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{chatCannedAnswer.value}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{chatCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{ chatCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" translate="CHAT.EDIT_CHATCANNEDANSWER">\n                                Edit ChatCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(chatCannedAnswer, $event)" translate="CHAT.DELETE_CHATCANNEDANSWER">\n                                Delete ChatCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.chatWebsiteChatCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CHAT.NO_CHATCANNEDANSWER_AVAILABLE">No chatcannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteChatCannedAnswers.count}}" md-on-paginate="vm_dc.getChatWebsiteChatCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.VIDEO">VIDEO</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container vidaoo md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.VIDAOO">VIDAOO</div>\n            </div>\n            <form name="vidaooForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.vidaooEscalation" aria-label="vidaooEscalation" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.VIDAOOESCALATION">vidaooEscalation</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n                <label translate="CHAT.VIDAOOAPIKEY">vidaooApiKey</label>\n                <input type="text" name="vidaooApiKey" ng-model="vm.chatWebsite.vidaooApiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="vidaooForm[\'vidaooApiKey\'].$error" ng-show="vidaooForm[\'vidaooApiKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.VIDAOOAPIKEY_REQUIRED">vidaooApiKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n                <label translate="CHAT.VIDAOOTOPIC">vidaooTopic</label>\n                <input type="text" name="vidaooTopic" ng-model="vm.chatWebsite.vidaooTopic" value="Generated by XCALLY Motion" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="vidaooForm[\'vidaooTopic\'].$error" ng-show="vidaooForm[\'vidaooTopic\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.VIDAOOTOPIC_REQUIRED">vidaooTopic field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n                <label translate="CHAT.VIDAOONOTE">vidaooNote</label>\n                <input type="text" name="vidaooNote" ng-model="vm.chatWebsite.vidaooNote" value="Meeting generated for interaction #{{interaction.id}} by {{agent.name}}" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="vidaooForm[\'vidaooNote\'].$error" ng-show="vidaooForm[\'vidaooNote\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.VIDAOONOTE_REQUIRED">vidaooNote field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n                <label translate="CHAT.VIDAOOMETADATA">vidaooMetadata</label>\n                <textarea name="vidaooMetadata" ng-model="vm.chatWebsite.vidaooMetadata"></textarea>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteActionsController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="CHAT.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedChatWebsiteApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedChatWebsiteApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedChatWebsiteApps.length}} {{vm_ac.selectedChatWebsiteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedChatWebsiteApps($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedChatWebsiteApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.chatWebsiteApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editChatWebsiteApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.chatWebsiteApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteInteractionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CHAT.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getChatWebsiteInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getChatWebsiteInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getChatWebsiteInteractions()" aria-label="refresh Interactions" translate translate-attr-label="CHAT.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedChatWebsiteInteractions.length}} {{vm_dc.selectedChatWebsiteInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteInteractions" csv-label="true" filename="chatWebsites.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteInteractions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CHAT.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'CHAT.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'CHAT.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'CHAT.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'CHAT.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'CHAT.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'CHAT.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.chatWebsiteInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'CHAT.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'CHAT.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spychatInteraction($event, interaction)" translate="CHAT.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n                              <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event, true)" translate="CHAT.DOWNLOAD_WITH_ATTACHMENTS">\n                                Download with attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event)" translate="CHAT.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                                Download without attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="CHAT.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.chatWebsiteInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CHAT.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteInteractions.count}}" md-on-paginate="vm_dc.getChatWebsiteInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.OFFLINEMESSAGES">OFFLINEMESSAGES</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container offlinemessages md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteOfflineMessagesController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteOfflineMessages.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CHAT.OFFLINEMESSAGES">OfflineMessages</span>\n                  <ms-search-bar on-search="vm_dc.getChatWebsiteOfflineMessages()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteOfflineMessages.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedChatWebsiteOfflineMessages.length}} {{vm_dc.selectedChatWebsiteOfflineMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteOfflineMessages" csv-label="true" filename="chatWebsites.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteOfflineMessages($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteOfflineMessages" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteOfflineMessages">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CHAT.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column>\n                        {{ \'CHAT.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'CHAT.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="offlineMessage" md-select-id="id" ng-repeat="offlineMessage in vm_dc.chatWebsiteOfflineMessages.rows">\n                      <td md-cell>\n                        {{offlineMessage.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="offlineMessage.Attachments.length > 0">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{offlineMessage.Contact.firstName}}\n                      </td>\n                      <td md-cell>\n                        {{ offlineMessage.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.showOfflineMessageChatWebsiteOfflineMessage($event, offlineMessage)" translate="CHAT.SHOW_OFFLINEMESSAGE">\n                                SHOW OfflineMessage\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(offlineMessage, $event)" translate="CHAT.DELETE_OFFLINEMESSAGE">\n                                Delete OfflineMessage\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.chatWebsiteOfflineMessages.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CHAT.NO_OFFLINEMESSAGE_AVAILABLE">No offlinemessage available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteOfflineMessages.count}}" md-on-paginate="vm_dc.getChatWebsiteOfflineMessages" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="CHAT.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n        <th md-column>{{ \'CHAT.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'CHAT.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'CHAT.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="CHAT.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="CHAT.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/chat/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/companies.html",'<div id="companies" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CONTACTMANAGER.COMPANIES">Companies</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedCompanies.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedCompanies =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CONTACTMANAGER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-companies-count">\n          <span>{{vm.selectedCompanies.length}}</span>\n          <span translate="CONTACTMANAGER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllCompanies()" translate="CONTACTMANAGER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectCompanies()" translate="CONTACTMANAGER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedCompanies" csv-label="true" filename="companies.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCompanies($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- COMPANY TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedCompanies" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCompanies">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.companies.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="company" md-select-id="id" ng-repeat="company in vm.companies.rows">\n                <td md-cell ng-if="company.userpic"><img class="avatar" alt="{{company.name}}" ng-src="api/users/{{company.id}}/avatar" /></td>\n                <td md-cell ng-if="!company.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{company.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="id ">{{company.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="name ">{{company.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="description ">{{company.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(company, $event    )" translate="CONTACTMANAGER.EDIT_COMPANY">\n                          Edit Company\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotocontactsgoto(company, $event    )" translate="CONTACTMANAGER.GOTOCONTACTS_COMPANY">\n                          goToContacts Company\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(company, $event    )" translate="CONTACTMANAGER.DELETE_COMPANY">\n                          Delete Company\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.companies.count}}" md-on-paginate="vm.getCompanies" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / COMPANY TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD COMPANY BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-company-button" ng-click="vm.createOrEditCompany($event)" aria-label="add company" translate translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD COMPANY BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/create/dialog.html",'<md-dialog class="company-dialog" aria-label="New Company">\n  <form name="companyForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n\n        <div ng-messages="companyForm[\'name\'].$error" ng-show="companyForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.PHONE">Phone</label>\n        <input type="text" name="phone" ng-model="vm.company.phone">\n\n        <div ng-messages="companyForm[\'phone\'].$error" ng-show="companyForm[\'phone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.VAT">Vat</label>\n        <input type="text" name="vat" ng-model="vm.company.vat">\n\n        <div ng-messages="companyForm[\'vat\'].$error" ng-show="companyForm[\'vat\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.FAX">Fax</label>\n        <input type="text" name="fax" ng-model="vm.company.fax">\n\n        <div ng-messages="companyForm[\'fax\'].$error" ng-show="companyForm[\'fax\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n        <input type="text" name="companyId" ng-model="vm.company.companyId">\n\n        <div ng-messages="companyForm[\'companyId\'].$error" ng-show="companyForm[\'companyId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.TYPE">Type</label>\n        <input type="text" name="type" ng-model="vm.company.type">\n\n        <div ng-messages="companyForm[\'type\'].$error" ng-show="companyForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n        <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n\n        <div ng-messages="companyForm[\'website\'].$error" ng-show="companyForm[\'website\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n        <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n\n        <div ng-messages="companyForm[\'emailDomain\'].$error" ng-show="companyForm[\'emailDomain\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.company.email">\n\n        <div ng-messages="companyForm[\'email\'].$error" ng-show="companyForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.company.description">\n\n        <div ng-messages="companyForm[\'description\'].$error" ng-show="companyForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCompany" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid || companyForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCompany" ng-click="vm.addNewCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_COMPANY" translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n          ADD COMPANY\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCompany" ng-click="vm.deleteCompany($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/companies/edit/view.html",'<div id="contactmanager-company" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-companies-button md-icon-button" aria-label="Go to companies" ng-click="vm.gotoCompanies()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_COMPANIES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="company-image" hide-xs>\n          <img ng-src="assets/images/business/companies.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.company.id}}\n            <span ng-if="vm.company.name">{{vm.company.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.company.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.company, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="CONTACTMANAGER.GOTO_COMPANY"></span></md-tooltip>\n        <md-icon md-font-icon="icon-forward"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveCompany()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (addressForm.$invalid) || (shipmentAddressForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.GENERAL">GENERAL</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="company-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.company.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.VAT">Vat</label>\n                <input type="text" name="vat" ng-model="vm.company.vat" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'vat\'].$error" ng-show="generalForm[\'vat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.FAX">Fax</label>\n                <input type="text" name="fax" ng-model="vm.company.fax" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'fax\'].$error" ng-show="generalForm[\'fax\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n                <input type="text" name="companyId" ng-model="vm.company.companyId" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'companyId\'].$error" ng-show="generalForm[\'companyId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.TYPE">Type</label>\n                <input type="text" name="type" ng-model="vm.company.type" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n                <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'website\'].$error" ng-show="generalForm[\'website\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n                <input type="text" name="emailDomain" ng-model="vm.company.emailDomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'emailDomain\'].$error" ng-show="generalForm[\'emailDomain\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.company.email" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.company.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.ADDRESS">ADDRESS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="company-detail-form-container address md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CONTACTMANAGER.ADDRESS">ADDRESS</div>\n            </div>\n            <form name="addressForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.STREET">Street</label>\n                <input type="text" name="street" ng-model="vm.company.street" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="addressForm[\'street\'].$error" ng-show="addressForm[\'street\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n                <input type="text" name="postalCode" ng-model="vm.company.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="addressForm[\'postalCode\'].$error" ng-show="addressForm[\'postalCode\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.CITY">City</label>\n                <input type="text" name="city" ng-model="vm.company.city" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="addressForm[\'city\'].$error" ng-show="addressForm[\'city\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n                <input type="text" name="country" ng-model="vm.company.country" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="addressForm[\'country\'].$error" ng-show="addressForm[\'country\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="company-detail-form-container shipmentaddress md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</div>\n            </div>\n            <form name="shipmentAddressForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.STREET">Street</label>\n                <input type="text" name="sStreet" ng-model="vm.company.sStreet" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="shipmentAddressForm[\'sStreet\'].$error" ng-show="shipmentAddressForm[\'sStreet\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n                <input type="text" name="sPostalCode" ng-model="vm.company.sPostalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="shipmentAddressForm[\'sPostalCode\'].$error" ng-show="shipmentAddressForm[\'sPostalCode\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.CITY">City</label>\n                <input type="text" name="sCity" ng-model="vm.company.sCity" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="shipmentAddressForm[\'sCity\'].$error" ng-show="shipmentAddressForm[\'sCity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n                <input type="text" name="sCountry" ng-model="vm.company.sCountry" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="shipmentAddressForm[\'sCountry\'].$error" ng-show="shipmentAddressForm[\'sCountry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/contacts.html",'<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CONTACTMANAGER.CONTACTS">Contacts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    \x3c!-- SEARCH --\x3e\n    <div class="search-input-wrapper" layout="row" layout-align="start center">\n      <label for="search">\n        <md-icon md-font-icon="icon-magnify"></md-icon>\n      </label>\n      <md-input-container md-no-float class="m-0">\n        <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n      </md-input-container>\n    </div>\n    \x3c!-- / SEARCH --\x3e\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedContacts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedContacts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CONTACTMANAGER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-contacts-count">\n          <span>{{vm.selectedContacts.length}}</span>\n          <span translate="CONTACTMANAGER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllContacts()" translate="CONTACTMANAGER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectContacts()" translate="CONTACTMANAGER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedContacts" csv-label="true" filename="contacts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedContacts($event)" aria-label="delete selected" translate translate-attr-label="CONTACTS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n      <div layout="row">\n        <div class="column" flex="20">\n          <md-card>\n            <md-card-content>\n              <button layout-align="center center" md-mini-fab ng-click="vm.selectedList = null; vm.selectedCompany = null; vm.selectedTags = []">\n                <md-icon md-font-icon="icon-refresh"></md-icon>{{ \'CONTACTMANAGER.ALL_CONTACTS\' | translate }}\n              </button>\n            </md-card-content>\n          </md-card>\n          <md-card>\n            <md-card-content>\n              <md-input-container class="md-block" flex-gt-sm="">\n                <label translate="CONTACTMANAGER.SELECT_LIST">Select a list</label>\n                <md-select placeholder="Select a list" ng-model="vm.selectedList" ng-disabled="vm.lists.count === 0">\n                  <md-option ng-value="null"><em translate="CONTACTMANAGER.ALL">All</em></md-option>\n                  <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n                </md-select>\n              </md-input-container>\n            </md-card-content>\n          </md-card>\n          <md-card>\n            <md-card-content>\n              <md-input-container class="md-block" flex-gt-sm="">\n                <label translate="CONTACTMANAGER.SELECT_COMPANY">Select a company</label>\n                <md-select placeholder="Select a company" flex="100" ng-model="vm.selectedCompany" ng-disabled="vm.companies.count === 0">\n                  <md-option ng-value="null"><em translate="CONTACTMANAGER.ALL">All</em></md-option>\n                  <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n                </md-select>\n              </md-input-container>\n            </md-card-content>\n          </md-card>\n          <md-card>\n            <md-card-content>\n              <md-input-container class="md-block" flex-gt-sm="">\n                <label translate="CONTACTMANAGER.SELECT_TAGS">Select one or more tags</label>\n                <md-select multiple placeholder="Select one or more tags" flex="100" ng-model="vm.query.tag" ng-change="vm.getContacts()">\n                  <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n                </md-select>\n              </md-input-container>\n            </md-card-content>\n          </md-card>\n        </div>\n\n        \x3c!-- USER TABLE --\x3e\n        <md-card flex="80">\n          <md-table-container ng-init="vm.getAssignedCompanies()">\n            <table md-table md-row-select multiple ng-model="vm.selectedContacts" md-progress="vm.promise">\n              <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n                <tr md-row>\n                  <th md-column md-order-by="id">ID</th>\n                  <th md-column md-order-by="firstName">{{\'CONTACTMANAGER.FULLNAME\' | translate}}</th>\n                  <th md-column md-order-by="phone">{{\'CONTACTMANAGER.PHONE\' | translate}}</th>\n                  <th md-column md-order-by="email">{{\'CONTACTMANAGER.EMAIL\' | translate}}</th>\n                  <th md-column md-order-by="createdAt">{{\'CONTACTMANAGER.CREATED_AT\' | translate}}</th>\n                  <th md-column md-order-by="ListId">{{\'CONTACTMANAGER.LIST\' | translate}}</th>\n                  <th md-column md-order-by="CompanyId">{{\'CONTACTMANAGER.COMPANY\' | translate}}</th>\n                  <th md-column md-order-by="tags">{{\'CONTACTMANAGER.TAGS\' | translate}}</th>\n                  <th md-column width="10px"></th>\n                </tr>\n              </thead>\n              <tbody md-body>\n                <tr md-row ng-hide="vm.contacts.rows.length">\n                  <td md-cell colspan="8">\n                    <div layout="row" layout-align="center center">\n                      <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                    </div>\n                  </td>\n                </tr>\n                <tr md-row md-select="contact" md-select-id="id" ng-repeat="contact in vm.contacts.rows">\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="firstName" privacy ng-cloak>{{contact.firstName}} {{contact.lastName}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="phone" privacy ng-cloak>{{contact.phone}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="email" privacy ng-cloak>{{contact.email}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="createdAt">{{contact.createdAt | date:\'medium\'}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId]}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="company">{{vm.companiesMap[contact.CompanyId]}}</td>\n                  <td md-cell class="tag">\n                    <div ng-if="contact.Tags.length">\n                      <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n                        <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n                        <span class="text-truncate">{{contact.Tags[0].name}}</span>\n                      </div>\n                      <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n                        <md-tooltip md-direction="left" layout="row">\n                          <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                        </md-tooltip>\n                        <md-icon md-font-icon="icon-tag"></md-icon>\n                      </div>\n                    </div>\n                  </td>\n                  <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                    <md-menu>\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                          <md-button ng-click="vm.editdialog(contact, ev)" translate="CONTACTMANAGER.EDIT_CONTACT">\n                            Edit Contact\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                          <md-button ng-click="vm.mergeContact(ev, contact)" translate="CONTACTMANAGER.MERGE_CONTACT">\n                            Merge Contact\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                          <md-button ng-click="vm.duplicateContact(ev, contact)" translate="CONTACTMANAGER.DUPLICATE_CONTACT">\n                            Duplicate Contact\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete">\n                        </md-menu-divider>\n                        <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                          <md-button ng-click="vm.deleteconfirm(contact, ev)" translate="CONTACTMANAGER.DELETE_CONTACT">\n                            Delete Contact\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </td>\n                </tr>\n              </tbody>\n            </table>\n          </md-table-container>\n\n          <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n        </md-card>\n        \x3c!-- / USER TABLE --\x3e\n      </div>\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD USER BUTTON --\x3e\n  <md-fab-speed-dial id="add-contact-button" ng-if="vm.crudPermissions.canEdit" ng-hide="vm.options.hidden" md-direction="up" md-open="vm.options.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm.options.hover }" ng-mouseenter="vm.options.isOpen=true" ng-mouseleave="vm.options.isOpen=false">\n    <md-fab-trigger>\n      <md-button aria-label="menu" class="md-fab md-accent">\n        <md-icon md-font-icon="icon-plus"></md-icon>\n      </md-button>\n    </md-fab-trigger>\n    <md-fab-actions>\n      <md-button class="md-fab md-mini md-warn" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContacts($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.IMPORT_CONTACTS">\n        <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n          {{\'CONTACTMANAGER.IMPORT_CONTACTS\' | translate}}\n        </md-tooltip>\n        <md-icon md-font-icon="icon-upload"></md-icon>\n      </md-button>\n      <md-button class="md-fab md-mini md-accent" ng-click="vm.createOrEditContact($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n        <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n          {{\'CONTACTMANAGER.ADD_CONTACT\' | translate}}\n        </md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </md-fab-actions>\n  </md-fab-speed-dial>\n  \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/create/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="New Contact">\n  <form name="contactForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.FIRSTNAME">First name</label>\n        <input name="firstName" ng-model="vm.contact.firstName" required md-autofocus privacy="!vm.crudPermissions.canEdit" ng-cloak>\n\n        <div ng-messages="contactForm.firstName.$error" ng-show="contactForm.firstName.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.LASTNAME">Last name</label>\n        <input name="lastName" ng-model="vm.contact.lastName" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.PHONE">Phone</label>\n        <input name="phone" ng-model="vm.contact.phone" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.EMAIL">Email</label>\n        <input name="email" type="email" ng-model="vm.contact.email" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n        <input name="mobile" ng-model="vm.contact.mobile" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.FAX">Fax</label>\n        <input name="fax" ng-model="vm.contact.fax" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.LIST">List</label>\n        <md-select name="list" ng-model="vm.contact.ListId" ng-disabled="vm.contact.id && vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n          <md-optgroup label="Lists">\n            <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n            <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n          </md-optgroup>\n        </md-select>\n        <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container>\n        <label translate="CONTACTMANAGER.TIMEZONE">Timezone</label>\n        <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone"></ms-timezone>\n      </md-input-container>\n      <div ng-repeat="customField in vm.customFields.rows" class="md-block" ng-switch="customField.type">\n        <div ng-switch-when="datetime">\n          <label>{{customField.alias}}</label>\n          <div>\n            \x3c!-- ng-model="customField.value" --\x3e\n            <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n            <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n            </mdp-time-picker>\n          </div>\n\n        </div>\n\n        <div ng-switch-when="select">\n          <label>{{customField.alias}}</label>\n\n          <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n            <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n            <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n          </md-select>\n        </div>\n\n        <div ng-switch-when="switch">\n          <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n            {{customField.alias}}\n          </md-switch>\n        </div>\n\n        <md-input-container ng-switch-default>\n          <label>{{customField.alias}}</label>\n\n          <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n        </md-input-container>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.COMPANY">Company</label>\n        <md-select name="company" ng-model="vm.contact.CompanyId">\n          <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-hide="!vm.contact.CompanyId && company.canSelect === false" ng-disabled="company.canSelect === false">\n            {{company.name}}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n        <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All\n          Fields</md-button>\n      </div>\n\n      <md-input-container class="md-block" ng-if="vm.allFields" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n        <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n        <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth">\n        </mdp-date-picker>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n        <input type="text" name="country" ng-model="vm.contact.country">\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.CITY">City</label>\n        <input type="text" name="city" ng-model="vm.contact.city">\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.STREET">Street</label>\n        <input type="text" name="street" ng-model="vm.contact.street">\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.POSTAL_CODE">Postal Code</label>\n        <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.NOTES">Notes</label>\n        <input type="text" name="description" ng-model="vm.contact.description">\n      </md-input-container>\n\n      <div ng-if="vm.allFields" layout="row" layout-align="center center">\n        <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer\n          Fields</md-button>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newContact" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newContact" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n          ADD CONTACT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContact" ng-click="vm.deleteContact($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="{{ \'CONTACTMANAGER.DUPLICATE_CONTACT\' | translate }}">\n  <form name="contactForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.LIST">List</label>\n        <md-select name="list" ng-model="vm.contact.ListId">\n          <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n        </md-select>\n\n        <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n          ADD CONTACT\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n  <form name="hopperForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div flex class="md-block">\n        <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n          <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="CONTACTMANAGER.ERRORS.DATE_REQUIRED">Date is required</span>\n            </div>\n            <div ng-message="format">\n              <span translate="CONTACTMANAGER.ERRORS.DATE_INVALID">Date is invalid</span>\n            </div>\n          </div>\n        </mdp-date-picker>\n      </div>\n\n      <div flex class="md-block">\n        <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n          <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="CONTACTMANAGER.ERRORS.TIME_REQUIRED">Time is required</span>\n            </div>\n            <div ng-message="format">\n              <span translate="CONTACTMANAGER.ERRORS.TIME_INVALID">Time is invalid</span>\n            </div>\n          </div>\n        </mdp-time-picker>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_HOPPER" translate-attr-aria-label="CONTACTMANAGER.ADD_HOPPER">\n          ADD HOPPER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/view.html",'<div id="cm-contact" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-contacts-button md-icon-button" aria-label="Go to contacts" ng-click="vm.gotoContacts()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_CONTACTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="contact-image" hide-xs>\n          <img ng-src="assets/images/business/contacts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.contact.id}} {{vm.contact.firstName}} {{vm.contact.lastName}}\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-if="vm.contact.role && vm.contact.role !== \'admin\'" ng-controller="ContactQueueAddButtonController as vm_contact_qa" ng-cloak>\n      <md-fab-speed-dial ng-hide="vm_contact_qa.hidden" md-direction="left" md-open="vm_contact_qa.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm_contact_qa.hover }" ng-mouseenter="vm_contact_qa.isOpen=true" ng-mouseleave="vm_contact_qa.isOpen=false">\n        <md-fab-trigger>\n          <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n            <md-tooltip md-direction="top" md-visible="tooltipVisible">Channels</md-tooltip>\n            <md-icon md-font-icon="icon-eye" aria-label="channels"></md-icon>\n          </md-button>\n        </md-fab-trigger>\n        <md-fab-actions>\n          <div ng-repeat="channel in vm_contact_qa.channels">\n            <md-button aria-label="{{channel.name}}" class="md-fab md-raised md-icon-button md-mini" ng-click="vm_contact_qa.openDialog($event, vm.contact, channel)">\n              <md-tooltip md-direction="{{channel.direction}}" md-visible="tooltipVisible" md-autohide="false">\n                {{channel.name}}\n              </md-tooltip>\n              <md-icon md-font-icon="{{channel.icon}}" aria-label="{{channel.name}}"></md-icon>\n            </md-button>\n          </div>\n        </md-fab-actions>\n      </md-fab-speed-dial>\n    </div>\n\n    <div ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.duplicateContact($event)" class="md-fab md-warn md-icon-button" aria-label="DUPLICATE">\n        <md-icon md-font-icon="icon-file-multiple"></md-icon>\n      </md-button>\n      <md-button type="submit" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="detailForm.$pristine && customFieldsForm.$pristine && socialForm.$pristine" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.DETAIL">DETAIL</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div layout="row">\n            <div layout="column" flex="70">\n              <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n                <div class="pb-16" layout="row" layout-align="start center">\n                  <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.PERSONAL_INFO">PERSONAL_INFO\n                  </div>\n                </div>\n                <form name="detailForm" novalidate>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    \x3c!-- fistName --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.FIRSTNAME">First Name</label>\n                      <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n                      <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                      <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n                        <div ng-message="required">\n                          <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n                        </div>\n                      </div>\n                    </md-input-container>\n                    <div flex="5"></div>\n                    \x3c!-- lastName --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.LASTNAME">Last Name</label>\n                      <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                    </md-input-container>\n\n                  </div>\n\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    \x3c!-- phone --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.PHONE">Phone</label>\n                      <md-icon md-font-icon="icon-phone"></md-icon>\n                      <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                    </md-input-container>\n                    <div flex="5"></div>\n                    \x3c!-- mobile --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n                      <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n                      <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                    </md-input-container>\n                  </div>\n\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    \x3c!-- email --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.EMAIL">Email</label>\n                      <md-icon md-font-icon="icon-email" class="email"></md-icon>\n                      <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                      <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n                        <div ng-message="email">\n                          <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail\n                            address</span>\n                        </div>\n                      </div>\n                    </md-input-container>\n                    <div flex="5"></div>\n                    \x3c!-- fax --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.FAX">Fax</label>\n                      <md-icon md-font-icon="icon-deskphone"></md-icon>\n                      <input type="text" name="fax" ng-model="vm.contact.fax" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.TIMEZONE">Timezone</label>\n                      <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n                      <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n                      <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth" mdp-disabled="!vm.crudPermissions.canEdit"></mdp-date-picker>\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container ng-if="vm.companies.rows.length" class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.COMPANY">Company</label>\n                      <md-icon md-font-icon="icon-domain"></md-icon>\n                      <md-select name="company" ng-model="vm.contact.CompanyId" ng-disabled="!vm.crudPermissions.canEdit">\n                        <md-optgroup label="Companies">\n                          <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-disabled="company.canSelect === false">{{company.name}}</md-option>\n                          <md-option ng-value=" null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                        </md-optgroup>\n                      </md-select>\n                      <md-icon class="pointer" ng-show="vm.contact.CompanyId" md-font-icon="icon-information-outline" ng-click="vm.editCompany($event, vm.contact.CompanyId)"></md-icon>\n                    </md-input-container>\n                    <section ng-if="!vm.companies.rows.length" flex-gt-sm="">\n                      <md-icon md-font-icon="icon-briefcase"></md-icon>\n                      <label translate="CONTACTMANAGER.NO_COMPANIES">No Companies</label>\n                    </section>\n                  </div>\n\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container ng-if="vm.tags.rows.length" class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.TAGS">Tags</label>\n                      <md-icon md-font-icon="icon-tag"></md-icon>\n                      <md-select ng-model="vm.Tags" multiple ng-disabled="!vm.crudPermissions.canEdit">\n                        <md-optgroup label="Tags">\n                          <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{tag.name}}</md-option>\n                        </md-optgroup>\n                      </md-select>\n                    </md-input-container>\n                    <section ng-if="!vm.tags.rows.length" flex-gt-sm="">\n                      <md-icon md-font-icon="icon-tag"></md-icon>\n                      <label translate="CONTACTMANAGER.NO_TAG">No Tags</label>\n                      <md-button class="md-accent" translate="CONTACTMANAGER.ADD_TAG">Add Tag</md-button>\n                    </section>\n                  </div>\n\n                  <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n                    <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n                  </div>\n\n                  <div ng-if="vm.allFields">\n                    <div layout-gt-sm="row" class="layout-gt-sm-row">\n                      \x3c!-- country --\x3e\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n                        <md-icon md-font-icon="icon-home" class="country"></md-icon>\n                        <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n                      </md-input-container>\n                      <div flex="5"></div>\n                      \x3c!-- city --\x3e\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate="CONTACTMANAGER.CITY">City</label>\n                        <input type="text" name="city" ng-model="vm.contact.city" ng-disabled="!vm.crudPermissions.canEdit">\n                      </md-input-container>\n                    </div>\n\n                    <div layout-gt-sm="row" class="layout-gt-sm-row">\n                      <div flex="5"></div>\n                      \x3c!-- street --\x3e\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate="CONTACTMANAGER.STREET">Street</label>\n                        <input type="text" name="street" ng-model="vm.contact.street" ng-disabled="!vm.crudPermissions.canEdit">\n                      </md-input-container>\n                      <div flex="5"></div>\n                      \x3c!-- postalCode --\x3e\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate="CONTACTMANAGER.POSTALCODE">Postal Code</label>\n                        <input type="text" name="postalCode" ng-model="vm.contact.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n                      </md-input-container>\n                    </div>\n\n                    <div layout-gt-sm="row" class="layout-gt-sm-row">\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate translate-attr-placeholder="CONTACTMANAGER.NOTES">Notes</label>\n                        <md-icon md-font-icon="icon-note"></md-icon>\n                        <textarea ng-model="vm.contact.description" type="text" max-rows="4" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n                      </md-input-container>\n                    </div>\n\n                    <div layout="row" layout-align="center center">\n                      <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields\n                      </md-button>\n                    </div>\n\n                  </div>\n                </form>\n              </md-card>\n              <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n                <div class="pb-16" layout="row" layout-align="start center">\n                  <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.SOCIAL">Social</div>\n                </div>\n                <form name="socialForm" novalidate>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Facebook</label>\n                      <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n                      <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n                    </md-input-container>\n                    <div flex="5"></div>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Twitter</label>\n                      <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n                      <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Line</label>\n                      <md-icon md-font-icon="fab fa-line"></md-icon>\n                      <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n                    </md-input-container>\n                    <div flex="5"></div>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Viber</label>\n                      <md-icon md-font-icon="fab fa-viber"></md-icon>\n                      <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>WeChat</label>\n                      <md-icon md-font-icon="fab fa-weixin"></md-icon>\n                      <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n                    </md-input-container>\n                    <div flex="5"></div>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Telegram</label>\n                      <md-icon md-font-icon="icon-telegram"></md-icon>\n                      <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n                    </md-input-container>\n                  </div>\n                </form>\n              </md-card>\n            </div>\n\n            <div flex></div>\n\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n              <div class="pb-16" layout="row" layout-align="start center">\n                <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.CUSTOM_FIELDS">CUSTOM FIELDS\n                </div>\n              </div>\n              <form name="customFieldsForm" novalidate>\n                <md-input-container class="md-block">\n                  <label translate translate-attr-placeholder="CONTACTMANAGER.LIST">List</label>\n                  <md-select name="list" ng-model="vm.contact.ListId" md-on-close="vm.onSelectList($event)" ng-disabled="vm.contact.ListId">\n                    <md-optgroup label="Lists">\n                      <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}\n                      </md-option>\n                      <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                    </md-optgroup>\n                  </md-select>\n                </md-input-container>\n                <div ng-repeat="customField in vm.customFields.rows" ng-switch="customField.type">\n                  <md-input-container class="md-block" ng-switch-when="datetime">\n                    <label>{{customField.alias}}</label>\n                    <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n                      <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n                      <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n                      </mdp-time-picker>\n                    </div>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-when="select">\n                    <label>{{customField.alias}}</label>\n                    <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n                      <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}\n                      </md-option>\n                      <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                    </md-select>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-when="switch">\n                    <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n                      {{customField.alias}}\n                    </md-switch>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-default>\n                    <label>{{customField.alias}}</label>\n                    <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n                  </md-input-container>\n                </div>\n              </form>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n\n      <md-tab ng-if="vm.license.dialer">\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.MOTION_BULL">MOTION BULL</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div layout="row">\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.HOPPER">Hopper</span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.queryHopper.filter = query;" on-collapse="vm.queryHopper.filter = undefined;" debounce="300"></ms-search-bar>\n                  <md-button class="md-icon-button" ng-click="vm.getHoppers()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n                    <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n                    <md-icon md-font-icon="icon-reload"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- HOPPER TABLE --\x3e\n              <md-table-container>\n                <table md-table multiple md-progress="vm.promise">\n                  <thead md-head md-order="vm.queryHopper.sort" md-on-reorder="vm.getHoppers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                      <th md-column md-order-by="phone">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n                      <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n                      <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n                      <th md-column md-order-by="recallme">{{ \'CONTACTMANAGER.RECALLME\' | translate }}</th>\n                      <th md-column md-order-by="VoiceQueueId">{{ \'CONTACTMANAGER.VOICEQUEUEID\' | translate }}</th>\n                      <th md-column md-order-by="CampaignId">{{ \'CONTACTMANAGER.CAMPAIGNID\' | translate }}</th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-hide="vm.hoppers.count">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                        </div>\n                      </td>\n                    </tr>\n                    <tr md-row ng-repeat="(id, hopper) in vm.hoppers.rows">\n                      <td md-cell>{{hopper.id}}</td>\n                      <td md-cell privacy ng-cloak>{{hopper.phone}}</td>\n                      <td md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n                      <td md-cell>{{ vm.arraypriority[hopper.priority].option }}</td>\n                      <td md-cell class="recallme ">\n                        <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                      </td>\n                      <td md-cell>{{hopper.VoiceQueueId}}</td>\n                      <td md-cell>{{hopper.CampaignId}}</td>\n                      <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="2">\n                            <md-menu-item>\n                              <md-button ng-if="vm.crudPermissions.canEdit && hopper.VoiceQueueId" ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n                                Edit Hopper\n                              </md-button>\n                              <md-button ng-if="vm.crudPermissions.canEdit && hopper.CampaignId" ng-click="vm.createOrEditIvrCampaignHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n                                Edit Hopper\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item>\n                              <md-button ng-click="vm.crudPermissions.canDelete && vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n                                Delete Hopper\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n              \x3c!-- / HOPPER TABLE --\x3e\n            </div>\n          </div>\n\n          <div layout="row">\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.FINAL">Final</span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.queryFinal.filter = query;" on-collapse="vm.queryFinal.filter = undefined;" debounce="300"></ms-search-bar>\n                  <md-button class="md-icon-button" ng-click="vm.getFinals()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n                    <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n                    <md-icon md-font-icon="icon-reload"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- HOPPER TABLE --\x3e\n              <md-table-container>\n                <table md-table multiple md-progress="vm.promise">\n                  <thead md-head md-order="vm.queryFinal.sort" md-on-reorder="vm.getFinals">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n                      <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n                      <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n                      <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n                      <th md-column md-order-by="disposition">{{ \'CONTACTMANAGER.DISPOSITION\' | translate }}</th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-hide="vm.finals.count">\n                      <td md-cell colspan="5">\n                        <div layout="row" layout-align="center center">\n                          <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                        </div>\n                      </td>\n                    </tr>\n                    <tr md-row ng-repeat="(id, final) in vm.finals.rows">\n                      <td md-cell>{{final.uniqueid}}</td>\n                      <td md-cell privacy ng-cloak>{{final.calleridnum}}</td>\n                      <td md-cell>{{final.statedesc}}</td>\n                      <td md-cell>{{final.starttime | date:\'medium\'}}</td>\n                      <td md-cell>{{final.disposition}}</td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryFinal.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryFinal.page" md-total="{{vm.finals.count}}" md-on-paginate="vm.getFinals" md-page-select></md-table-pagination>\n              \x3c!-- / HOPPER TABLE --\x3e\n            </div>\n          </div>\n\n          <div layout="row">\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.HISTORY">History</span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.queryHistory.filter = query;" on-collapse="vm.queryHistory.filter = undefined;" debounce="300"></ms-search-bar>\n                  <md-button class="md-icon-button" ng-click="vm.getHistories()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n                    <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n                    <md-icon md-font-icon="icon-reload"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- HOPPER TABLE --\x3e\n              <md-table-container>\n                <table md-table multiple md-progress="vm.promise">\n                  <thead md-head md-order="vm.queryHistory.sort" md-on-reorder="vm.getHistories">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n                      <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n                      <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n                      <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n                      <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n                      <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-hide="vm.histories.count">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                        </div>\n                      </td>\n                    </tr>\n                    <tr md-row ng-repeat="(id, history) in vm.histories.rows">\n                      <td md-cell>{{history.uniqueid}}</td>\n                      <td md-cell privacy ng-cloak>{{history.calleridnum}}</td>\n                      <td md-cell>{{history.statedesc}}</td>\n                      <td md-cell>{{history.scheduledat | date:\'medium\'}}</td>\n                      <td md-cell>{{history.starttime | date:\'medium\'}}</td>\n                      <td md-cell>{{history.endtime | date:\'medium\'}}</td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHistory.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHistory.page" md-total="{{vm.histories.count}}" md-on-paginate="vm.getHistories" md-page-select></md-table-pagination>\n              \x3c!-- / HOPPER TABLE --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n\n      <md-tab ng-if="vm.license.jscripty">\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.JSCRIPTY">JSCRIPTY</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div layout="row">\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.SESSIONS">Sessions</span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.queryJscriptySession.filter = query;" on-collapse="vm.queryJscriptySession.filter = undefined;" debounce="300"></ms-search-bar>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- SESSION TABLE --\x3e\n              <md-table-container>\n                <table md-table multiple md-progress="vm.promise">\n                  <thead md-head md-order="vm.queryJscriptySession.sort" md-on-reorder="vm.getJscriptySessions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                      <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n                      <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n                      <th md-column md-order-by="agent">{{ \'CONTACTMANAGER.AGENT\' | translate }}</th>\n                      <th md-column md-order-by="project">{{ \'CONTACTMANAGER.PROJECT\' | translate }}</th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-hide="vm.jscriptySessions.count">\n                      <td md-cell colspan="6">\n                        <div layout="row" layout-align="center center">\n                          <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                        </div>\n                      </td>\n                    </tr>\n                    <tr md-row ng-repeat="(id, session) in vm.jscriptySessions.rows">\n                      <td md-cell>{{session.id}}</td>\n                      <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n                      <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n                      <td md-cell>{{session.membername}}</td>\n                      <td md-cell>{{session.projectname}}</td>\n                      <td md-cell class="actions"></td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n              \x3c!-- / SESSION TABLE --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.CUSTOMER_JOURNEY">CUSTOMER JOURNEY</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <md-content class="md-padding" id="journey-content">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n            </div>\n          </md-content>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/import/import.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n  <form name="importForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS">Import Contacts</span>\n        <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <div md-background-bg layout="row" layout-align="start start">\n      <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n    </div>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div>\n        <md-content ng-show="!vm.processing">\n          <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n          <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n            <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n            <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n              <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n              <md-option ng-value="null" ng-hide="contactField.required">\n                <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n              </md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class="md-icon-float md-block">\n            <label translate="CONTACTMANAGER.LIST">List</label>\n            <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n              <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n            <label>{{customField.alias}}</label>\n            <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n              <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n              <md-option ng-value="null" ng-hide="customField.required">\n                <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n              </md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class="md-icon-float md-block">\n            <label translate="CONTACTMANAGER.COMPANY">Company</label>\n            <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n              <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n              <md-option ng-value="null">\n                <em translate="CONTACTMANAGER.NONE">None</em>\n              </md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class="md-icon-float md-block">\n            <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n              <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n            </md-select>\n          </md-input-container>\n\n          <div ng-if="vm.license.dialer">\n            <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n            <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n              <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n              <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n                <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n                <md-option ng-value="null" ng-hide="contactField.required">\n                  <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n\n        </md-content>\n\n        <div class="error-list" ng-if="vm.result.finish">\n          <div class="info" layout="row" layout-align="space-between center">\n            <div>\n              <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n            </div>\n            <md-button class="md-icon-button">\n              <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n            </md-button>\n          </div>\n        </div>\n\n        <div layout="row" ng-if="vm.processing">\n          \x3c!-- WIDGET PROCESSING --\x3e\n          <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n            \x3c!-- Front --\x3e\n            <ms-widget-front class="p-16 white-bg">\n              <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                <div class="md-display-1 pb-8 orange-fg">\n                  <span ng-bind="vm.result.rows"></span>\n                </div>\n                <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n              </div>\n            </ms-widget-front>\n            \x3c!-- / Front --\x3e\n          </ms-widget>\n          \x3c!-- / WIDGET PROCESSING --\x3e\n          \x3c!-- WIDGET SUCCESS --\x3e\n          <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n            \x3c!-- Front --\x3e\n            <ms-widget-front class="p-16 white-bg">\n              <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                <div class="md-display-1 pb-8 green-fg">\n                  <span ng-bind="vm.result.affectedRows"></span>\n                </div>\n                <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n              </div>\n            </ms-widget-front>\n            \x3c!-- / Front --\x3e\n          </ms-widget>\n          \x3c!-- / WIDGET SUCCESS --\x3e\n\n          \x3c!-- WIDGET FAILURE --\x3e\n          <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n            \x3c!-- Front --\x3e\n            <ms-widget-front class="p-16 white-bg">\n              <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                <div class="md-display-1 pb-8 red-fg">\n                  <span ng-bind="vm.result.failedRows"></span>\n                </div>\n                <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n              </div>\n            </ms-widget-front>\n            \x3c!-- / Front --\x3e\n          </ms-widget>\n          \x3c!-- / WIDGET FAILURE --\x3e\n\n          \x3c!-- WIDGET DUPLICATES --\x3e\n          <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n            \x3c!-- Front --\x3e\n            <ms-widget-front class="p-16 white-bg">\n              <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                <div class="md-display-1 pb-8 orange-fg">\n                  <span ng-bind="vm.result.duplicatedRows"></span>\n                </div>\n                <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n              </div>\n            </ms-widget-front>\n            \x3c!-- / Front --\x3e\n          </ms-widget>\n          \x3c!-- / WIDGET DUPLICATES --\x3e\n        </div>\n\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row">\n        <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n          IMPORT\n        </md-button>\n        <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n          STOP\n        </md-button>\n        <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/merge/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Merge Contact">\n  <form name="contactForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-input-container class="md-block" flex-gt-sm>\n        <label>Filter</label>\n        <input ng-model="vm.searchTerm" name="searchTerm" ng-model-options="{ debounce: 300 }" ng-change="vm.change()">\n      </md-input-container>\n\n      <md-list flex>\n        <md-subheader class="md-no-sticky" ng-hide="vm.contacts.length"><em>Filter doesn\'t match any contact</em></md-subheader>\n        <md-list-item class="md-3-line" ng-repeat="contact in vm.contacts | filter:{ id: \'!\' + vm.contact.id}" ng-click="vm.showConfirm($event, vm.contact, contact)">\n          <img ng-src="assets/images/avatars/profile.png" class="md-avatar" alt="{{contact.who}}" />\n          <div class="md-list-item-text" layout="column">\n            <h3>#{{ contact.id }} - {{ contact.firstName }} {{ contact.lastName }}</h3>\n            <h4>{{ contact.email }}</h4>\n            <p>{{ contact.phone }}</p>\n          </div>\n        </md-list-item>\n      </md-list>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",'<md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">\n  <form name="globalCustomFieldForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n        <input type="" name="alias" ng-model="vm.globalCustomField.alias" ng-required="true" autofocus>\n\n        <div ng-messages="globalCustomFieldForm[\'alias\'].$error" ng-show="globalCustomFieldForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.globalCustomField.type" required ng-disabled="!vm.newGlobalCustomField">\n          <md-option ng-value="\'text\'">Text</md-option>\n          <md-option ng-value="\'select\'">Select</md-option>\n          <md-option ng-value="\'number\'">Number</md-option>\n          <md-option ng-value="\'switch\'">Switch</md-option>\n          <md-option ng-value="\'datetime\'">Datetime</md-option>\n        </md-select>\n        <div ng-messages="globalCustomFieldForm[\'type\'].$error" ng-show="globalCustomFieldForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.globalCustomField.type == \'select\'" class="md-block">\n        <md-list>\n          <md-list-item layout-margin>\n            <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.globalCustomField.values);">\n              <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n              <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n            </md-button>\n            <md-button ng-if="vm.globalCustomField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.globalCustomField.values);">\n              <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n              <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n            </md-button>\n          </md-list-item>\n        </md-list>\n        <md-list ng-sortable="vm.sortable">\n          <md-list-item ng-repeat="item in vm.globalCustomField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n            <div>\n              <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n              <input type="text" ng-model="item.value" flex>\n            </div>\n            <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.globalCustomField.values, $index);">\n              <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n              <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n            </md-button>\n          </md-list-item>\n        </md-list>\n        <md-list>\n          <md-list-item ng-if="!vm.globalCustomField.values.length" layout="row" layout-align="center center">\n            <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n          </md-list-item>\n        </md-list>\n      </div>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.globalCustomField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.globalCustomField.type == \'text\'" class="md-block">\n        <md-switch ng-model="vm.globalCustomField.clickToAction" aria-label="ClickToAction"><span translate="CONTACTMANAGER.CLICKTOACTION">ClickToAction</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.globalCustomField.clickToAction" class="md-block">\n        <label translate="CONTACTMANAGER.ACTIONTYPE">ActionType</label>\n        <md-select name="actionType" ng-model="vm.globalCustomField.actionType">\n          <md-option ng-value="\'voice\'">Voice</md-option>\n        </md-select>\n        <div ng-messages="globalCustomFieldForm[\'actionType\'].$error" ng-show="globalCustomFieldForm[\'actionType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED">ActionType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGlobalCustomField" ng-click="vm.saveGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGlobalCustomField" ng-click="vm.addNewGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n          ADD GLOBALCUSTOMFIELD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGlobalCustomField" ng-click="vm.deleteGlobalCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",'<div id="globalCustomFields" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS">GlobalCustomFields</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedGlobalCustomFields.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedGlobalCustomFields =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CONTACTMANAGER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-globalCustomFields-count">\n          <span>{{vm.selectedGlobalCustomFields.length}}</span>\n          <span translate="CONTACTMANAGER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedGlobalCustomFields" csv-label="true" filename="globalCustomFields.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedGlobalCustomFields($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- GLOBALCUSTOMFIELD TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedGlobalCustomFields" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getGlobalCustomFields">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n                <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.globalCustomFields.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="globalCustomField" md-select-id="id" ng-repeat="globalCustomField in vm.globalCustomFields.rows">\n                <td md-cell ng-if="globalCustomField.userpic"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="api/users/{{globalCustomField.id}}/avatar" /></td>\n                <td md-cell ng-if="!globalCustomField.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="id ">{{globalCustomField.id}}</td>\n                <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="alias ">{{globalCustomField.alias}}</td>\n                <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="type ">{{ vm.arraytype[globalCustomField.type].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(globalCustomField, ev) : vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="required ">\n                  <md-icon md-colors="{color: {{globalCustomField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{globalCustomField.required ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(globalCustomField, $event    )" translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD">\n                          Edit GlobalCustomField\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(globalCustomField, $event    )" translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD">\n                          Delete GlobalCustomField\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.globalCustomFields.count}}" md-on-paginate="vm.getGlobalCustomFields" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / GLOBALCUSTOMFIELD TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-globalCustomField-button" ng-click="vm.createOrEditGlobalCustomField($event)" aria-label="add globalCustomField" translate translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/lists/create/dialog.html",'<md-dialog class="list-dialog" aria-label="New List">\n  <form name="listForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n\n        <div ng-messages="listForm[\'name\'].$error" ng-show="listForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.list.description">\n\n        <div ng-messages="listForm[\'description\'].$error" ng-show="listForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newList" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid || listForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newList" ng-click="vm.addNewList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_LIST" translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n          ADD LIST\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newList" ng-click="vm.deleteList($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",'<md-dialog class="list-dialog" aria-label="list" ng-init="vm.onInit()">\n  <form name="listForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CONTACTMANAGER.AGENTADD_LIST">Add Agent to list</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",'<md-dialog class="customField-dialog" aria-label="New CustomField">\n  <form name="customFieldForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n        <input type="" name="alias" ng-model="vm.customField.alias" ng-required="true" autofocus>\n\n        <div ng-messages="customFieldForm[\'alias\'].$error" ng-show="customFieldForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.customField.type" required ng-disabled="!vm.newCustomField">\n          <md-option ng-value="\'text\'">Text</md-option>\n          <md-option ng-value="\'select\'">Select</md-option>\n          <md-option ng-value="\'number\'">Number</md-option>\n          <md-option ng-value="\'switch\'">Switch</md-option>\n          <md-option ng-value="\'datetime\'">Datetime</md-option>\n        </md-select>\n        <div ng-messages="customFieldForm[\'type\'].$error" ng-show="customFieldForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.customField.type == \'select\'" class="md-block">\n        <md-list>\n          <md-list-item layout-margin>\n            <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.customField.values);">\n              <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n              <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n            </md-button>\n            <md-button ng-if="vm.customField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.customField.values);">\n              <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n              <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n            </md-button>\n          </md-list-item>\n        </md-list>\n        <md-list ng-sortable="vm.sortable">\n          <md-list-item ng-repeat="item in vm.customField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n            <div>\n              <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n              <input type="text" ng-model="item.value" flex>\n            </div>\n            <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.customField.values, $index);">\n              <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n              <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n            </md-button>\n          </md-list-item>\n        </md-list>\n        <md-list>\n          <md-list-item ng-if="!vm.customField.values.length" layout="row" layout-align="center center">\n            <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n          </md-list-item>\n        </md-list>\n      </div>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.customField.type == \'text\'" class="md-block">\n        <md-switch ng-model="vm.customField.clickToAction" aria-label="clickToAction"><span translate="CONTACTMANAGER.CLICKTOACTION">clickToAction</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.customField.clickToAction" class="md-block">\n        <label translate="CONTACTMANAGER.ACTIONTYPE">actionType</label>\n        <md-select name="actionType" ng-model="vm.customField.actionType">\n          <md-option ng-value="\'voice\'">Voice</md-option>\n        </md-select>\n        <div ng-messages="customFieldForm[\'actionType\'].$error" ng-show="customFieldForm[\'actionType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED">actionType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomField" ng-click="vm.saveCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid || customFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomField" ng-click="vm.addNewCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n          ADD CUSTOMFIELD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomField" ng-click="vm.deleteCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/view.html",'<div id="contactmanager-list" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-lists-button md-icon-button" aria-label="Go to lists" ng-click="vm.gotoLists()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_LISTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="list-image" hide-xs>\n          <img ng-src="assets/images/business/lists.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.list.id}}\n            <span ng-if="vm.list.name">{{vm.list.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.list.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="CONTACTMANAGER.GOTO_LIST"></span></md-tooltip>\n        <md-icon md-font-icon="icon-forward"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="CONTACTMANAGER.AGENTADD_LIST"></span></md-tooltip>\n        <md-icon md-font-icon="icon-eye"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveList()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (customFieldsForm.$invalid) || (voiceDispositionsForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="list-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.list.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.PREFIX">Prefix</label>\n                <input type="text" name="dialPrefix" ng-model="vm.list.dialPrefix" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'dialPrefix\'].$error" ng-show="generalForm[\'dialPrefix\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.CUSTOMFIELDS">CUSTOMFIELDS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="list-detail-form-container customfields md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ListCustomFieldsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListCustomFields.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.CUSTOMFIELDS">CustomFields</span>\n                  <ms-search-bar on-search="vm_dc.getListCustomFields()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditListCustomField($event)" aria-label="add customField" translate translate-attr-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListCustomFields.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedListCustomFields.length}} {{vm_dc.selectedListCustomFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListCustomFields" csv-label="true" filename="lists.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedListCustomFields($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedListCustomFields" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListCustomFields">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CONTACTMANAGER.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="alias">\n                        {{ \'CONTACTMANAGER.ALIAS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="type">\n                        {{ \'CONTACTMANAGER.TYPE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="required">\n                        {{ \'CONTACTMANAGER.REQUIRED\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="customField" md-select-id="id" ng-repeat="customField in vm_dc.listCustomFields.rows">\n                      <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n                        {{customField.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n                        {{customField.alias}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n                        {{ vm_dc.arraytype[customField.type].option }} </td>\n\n                      <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell class="required ">\n                        <md-icon md-colors="{color: {{customField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{customField.required? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditListCustomField($event, customField)" translate="CONTACTMANAGER.EDIT_CUSTOMFIELD">\n                                Edit CustomField\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(customField, $event)" translate="CONTACTMANAGER.DELETE_CUSTOMFIELD">\n                                Delete CustomField\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.listCustomFields.rows.length">\n                      <td md-cell colspan="9">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CONTACTMANAGER.NO_CUSTOMFIELD_AVAILABLE">No customfield available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.listCustomFields.count}}" md-on-paginate="vm_dc.getListCustomFields" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="ListDispositionsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="list-detail-form-container voicedispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="CONTACTMANAGER.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add contactmanager dispositions" translate translate-attr-label="CONTACTMANAGER.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="lists.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/lists/lists.html",'<div id="lists" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CONTACTMANAGER.LISTS">Lists</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedLists.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedLists =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CONTACTMANAGER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-lists-count">\n          <span>{{vm.selectedLists.length}}</span>\n          <span translate="CONTACTMANAGER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllLists()" translate="CONTACTMANAGER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectLists()" translate="CONTACTMANAGER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedLists" csv-label="true" filename="lists.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedLists($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- LIST TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedLists" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getLists">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.lists.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="list" md-select-id="id" ng-repeat="list in vm.lists.rows">\n                <td md-cell ng-if="list.userpic"><img class="avatar" alt="{{list.name}}" ng-src="api/users/{{list.id}}/avatar" /></td>\n                <td md-cell ng-if="!list.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{list.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="id ">{{list.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="name ">{{list.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="description ">{{list.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(list, $event    )" translate="CONTACTMANAGER.EDIT_LIST">\n                          Edit List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotocontactsgoto(list, $event    )" translate="CONTACTMANAGER.GOTOCONTACTS_LIST">\n                          goToContacts List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadContactManagerLists">\n\n                        <md-button ng-click="vm.exportcsvcontactsexport(list, $event    )" translate="CONTACTMANAGER.EXPORTCSVCONTACTS_LIST">\n                          exportCsvContacts List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(list, $event    )" translate="CONTACTMANAGER.AGENTADD_LIST">\n                          AgentAdd List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(list, $event    )" translate="CONTACTMANAGER.DELETE_LIST">\n                          Delete List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.lists.count}}" md-on-paginate="vm.getLists" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / LIST TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD LIST BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-list-button" ng-click="vm.createOrEditList($event)" aria-label="add list" translate translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD LIST BUTTON --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/custom/custom.html",'<div ng-if="!vm.customDashboard">\n  <p>Custom Dashboard not available...</p>\n</div>\n<div id="dashboard-custom" ng-if="vm.customDashboard" ng-cloak layout-fill>\n  <md-content>\n    <md-toolbar class="md-default md-accent filter-header">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead">{{vm.customDashboard.name}}</span>\n        <div flex></div>\n        <md-button ng-click="vm.setFilter($event)">\n          <md-tooltip md-direction="top"><span translate="DASHBOARDS.FILTERS"></span></md-tooltip>\n          <md-icon md-font-icon="icon-filter" ng-class=""></md-icon>\n        </md-button>\n        <md-button ng-if="vm.crudPermissions.canEdit" class="md-icon-button" ng-click="vm.goToEdit()" aria-label="goToEdit">\n          <md-tooltip md-direction="top"><span translate="DASHBOARDS.EDIT"></span></md-tooltip>\n          <md-icon md-font-icon="icon-table-edit"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <ms-widget-engine config="vm.customDashboard"></ms-widget-engine>\n  </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/custom/filter/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Set Filter">\n  <form name="FilterForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content style="padding:30px;">\n      <div layout="row" flex layout-align="space-between" layout-fill>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-phone"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_VOICE_QUEUES">Filter Voice Queues</span>\n          </div>\n          <md-select placeholder="Select one or more queues" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'voice\')" ng-model="vm.parent.voiceQueuesSelected" multiple aria-label="voiceQueues">\n            <md-option ng-value="voiceQueue.id" ng-repeat="voiceQueue in vm.parent.voiceQueues.rows">{{\n                            voiceQueue.name }}\n            </md-option>\n          </md-select>\n        </div>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-hangouts"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_CHAT_WEBSITES">Filter Chat\n              Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'chat\')" ng-model="vm.parent.chatWebsitesSelected" multiple aria-label="chatWebsite">\n            <md-option ng-value="chatWebsite.id" ng-repeat="chatWebsite in vm.parent.chatWebsites.rows">{{\n                            chatWebsite.name }}</md-option>\n          </md-select>\n        </div>\n      </div>\n      <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-message-text"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_SMS_ACCOUNTS">Filter Sms Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'sms\')" ng-model="vm.parent.smsAccountsSelected" multiple aria-label="smsAccount">\n            <md-option ng-value="smsAccount.id" ng-repeat="smsAccount in vm.parent.smsAccounts.rows">{{\n                            smsAccount.name }}</md-option>\n          </md-select>\n        </div>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-deskphone"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_FAX_ACCOUNTS">Filter Fax Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'fax\')" ng-model="vm.parent.faxAccountsSelected" multiple aria-label="faxAccount">\n            <md-option ng-value="faxAccount.id" ng-repeat="faxAccount in vm.parent.faxAccounts.rows">{{\n                            faxAccount.name }}</md-option>\n          </md-select>\n        </div>\n      </div>\n      <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-email"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_MAIL_ACCOUNTS">Filter Mail\n              Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'mail\')" ng-model="vm.parent.mailAccountsSelected" multiple aria-label="mailAccount">\n            <md-option ng-value="mailAccount.id" ng-repeat="mailAccount in vm.parent.mailAccounts.rows">{{\n                            mailAccount.name }}</md-option>\n          </md-select>\n        </div>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-google-earth"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_OPENCHANNEL_ACCOUNTS">Filter Openchannel\n              Websites</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'openchannel\')" ng-model="vm.parent.openchannelAccountsSelected" multiple aria-label="openchannelAccount">\n            <md-option ng-value="openchannelAccount.id" ng-repeat="openchannelAccount in vm.parent.openchannelAccounts.rows">{{\n                            openchannelAccount.name }}</md-option>\n          </md-select>\n        </div>\n      </div>\n      <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-whatsapp"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_WHATSAPP_ACCOUNTS">Filter Whatsapp\n              Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'whatsapp\')" ng-model="vm.parent.whatsappAccountsSelected" multiple aria-label="whatsappAccount">\n            <md-option ng-value="whatsappAccount.id" ng-repeat="whatsappAccount in vm.parent.whatsappAccounts.rows">\n              {{whatsappAccount.name }}</md-option>\n          </md-select>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.confirm()" class="send-button md-accent md-raised" aria-label="CONFIRM" translate="DASHBOARDS.CONFIRM" translate-attr-aria-label="DASHBOARDS.CONFIRM">\n          CONFIRM\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.html",'<div id="agent-general" layout="column">\n  <div layout="row" layout-align="start center" class="md-primary-bg">\n    <md-button class="md-raised no-margin width-50" style="border-radius: 0px" ng-class="{\'md-primary\': !vm.isActiveTab(0)}" ng-click="vm.onClickTab(0)" aria-label="home">\n      <md-tooltip md-direction="bottom" md-delay="500">Home</md-tooltip>\n      <md-icon md-font-icon="icon-home" class="icon"></md-icon>\n    </md-button>\n\n    <ms-tab-scroll style="overflow: hidden;">\n      <div layout="column" ng-repeat="(key, tab) in vm.tabs | orderByDate " ng-click="vm.onClickTab(tab.id)" ng-class="{\'grey-50-bg\': vm.isActiveTab(tab.id)}">\n        <div style="height: 34px" layout="row" layout-align="space-between center">\n          <md-icon md-font-icon="{{tab.icon}}" class="icon s16 margin-horizontal-5" ng-class="tab.color + \'-fg\'">\n          </md-icon>\n          <span class="text-truncate font-size-12" ng-class="vm.isActiveTab(tab.id) ? \'black-fg\' : \'grey-300-fg\'">\n            {{tab.title}}\n            <span ng-if="tab.badges" class="badge md-white-fg md-red-bg">{{tab.badges}}</span></span>\n          <md-button class="md-icon-button md-mini no-margin" ng-class="vm.isActiveTab(tab.id) ? \'md-primary\' : \'grey-300-fg\'" aria-label="close" ng-click="vm.closeTab(tab); $event.stopPropagation()">\n            <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n          </md-button>\n        </div>\n        <div style="height: 2px" ng-class="vm.isActiveTab(tab.id) ? tab.color + \'-bg\' : \'\'"></div>\n      </div>\n    </ms-tab-scroll>\n  </div>\n  \x3c!-- home --\x3e\n  <div layout="row" class="agent-content overflow-hidden" ng-if="vm.isActiveTab(0)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.html\'" ng-controller="AgentGeneralHomeController as vm_home" ng-init="vm_home.init(vm.license, vm.setting)"></div>\n  \x3c!-- other tabs --\x3e\n  <div ng-if="tab.id !== 0 && vm.isActiveTab(tab.id)" ng-repeat="(key, tab) in vm.tabs | orderByDate " ng-switch="tab.type" flex layout="column">\n    <div ng-switch-when="contact" ng-class="{{tab.type}}" flex layout="column">\n      <div class="agent-content" flex layout="column" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html\'" ng-controller="AgentGeneralContactController as vm" ng-init="vm.init(tab,$parent.vm.license)"></div>\n    </div>\n    <div ng-switch-when="popup" ng-class="{{tab.type}}" flex layout="column">\n      <div flex layout="column" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html\'" ng-controller="AgentGeneralPopupController as vm" ng-init="vm.init(tab)"></div>\n    </div>\n    <div ng-switch-when="jscripty" ng-class="{{tab.type}}" flex layout="column">\n      <div class="agent-content" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html\'" ng-controller="AgentGeneralJscriptyController as vm" ng-init="vm.init(tab)"></div>\n    </div>\n    <div ng-switch-when="bot" ng-class="{{tab.type}}" flex layout="column">\n      <div id="interaction-app" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html\'" ng-controller="AgentGeneralBotController as vm" ng-init="vm.init(tab, $parent.vm.setting)"></div>\n    </div>\n    <div ng-switch-when="interaction" ng-class="{{tab.type}}" flex layout="column">\n      <div id="interaction-app" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'" ng-controller="AgentGeneralInteractionController as vm" ng-init="vm.init(tab, $parent.vm.setting)">\n      </div>\n    </div>\n    <div ng-switch-when="iframe" ng-class="{{tab.type}}" flex layout="column">\n      <div id="iframe" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/iframe/agent.general.iframe.html\'" ng-controller="AgentGeneralIframeController as vm" ng-init="vm.init(tab, $parent.vm.setting)">\n      </div>\n    </div>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n  <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center">\n    <div class="big-circle md-whiteframe-4dp">\n      <md-icon class="s128 md-accent pink-fg" md-font-icon="fas fa-robot"></md-icon>\n    </div>\n    <span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n    <span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n      interaction...</span>\n  </div>\n\n  <div ng-if="vm.showInteraction" flex layout="row">\n    <md-card flex="100" class="interaction">\n      \x3c!-- TOOLBAR --\x3e\n      <md-toolbar class="interaction-toolbar">\n        <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n          <md-icon md-font-icon="fas fa-robot" class="s20 pink-fg"></md-icon>\n          <div class="padding-left-10" layout="column" layout-align="center start" flex>\n            <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n              <span>#{{vm.tab.data.uniqueid}} - {{vm.tab.title}}</span>\n            </div>\n          </div>\n          <div layout="row" layout-align="end center">\n\n          </div>\n        </div>\n      </md-toolbar>\n      \x3c!-- / TOOLBAR --\x3e\n\n      \x3c!-- CONTENT --\x3e\n      <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex layout-wrap>\n        <div class="interaction-messages">\n          \x3c!-- MESSAGES --\x3e\n          <div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n            <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n            <img ng-if="message.direction ===\'out\'" class="avatar" src="assets/images/avatars/robot.png">\n\n            <div class="bubble" ng-switch="message.direction">\n              <div>\n                <div ng-switch-when="in" class="time secondary-text">\n                  {{vm.tab.title}} - {{message.createdAt | date: \'medium\'}}\n                </div>\n                <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n                  <div layout-padding>\n                    System - {{message.createdAt | date: \'medium\'}}\n                  </div>\n                  <div>\n                    <md-icon class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n                  </div>\n                </div>\n              </div>\n              <div ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n            </div>\n          </div>\n          \x3c!-- / MESSAGES --\x3e\n        </div>\n      </md-content>\n      \x3c!-- / CONTENT --\x3e\n    </md-card>\n  </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html",'<md-tabs md-selected="vm.currentTab" md-dynamic-height>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.DETAIL">Detail</span>\n    </md-tab-label>\n    <md-tab-body>\n      <md-content>\n        <div layout="row" class="pr-10">\n          <div layout="row" flex="75" class="flex-scrollable only-x">\n            <md-card ng-repeat="call in vm.tab.calls track by call.uniqueid" class="call-info-card">\n              <md-progress-linear md-mode="indeterminate" ng-if="vm.checkingCallStatus"></md-progress-linear>\n              <md-card-header layout="row" layout-align="space-between">\n                <span ng-if="call.answertime" class="text-boxed indigo-100-bg ml-0">\n                  <timer start-time="call.answertime"></timer>\n                  <md-tooltip md-direction="bottom">\n                    {{ \'DASHBOARDS.ELAPSED_ANSWERED\' | translate }}\n                  </md-tooltip>\n                </span>\n                <span ng-if="call.disposedAt" class="text-boxed amber-200-bg">\n                  <timer start-time="call.disposedAt"></timer>\n                  <md-tooltip md-direction="bottom">\n                    {{ \'DASHBOARDS.ELAPSED_DISPOSED\' | translate }}\n                  </md-tooltip>\n                </span>\n                <md-button class="md-icon-button no-margin reload-button" ng-click="vm.checkCallStatus(call)" ng-disabled="vm.checkingCallStatus">\n                  <md-icon md-font-icon="icon-reload" class="s22"></md-icon>\n                  <md-tooltip md-direction="bottom">\n                    {{ \'DASHBOARDS.RELOAD\' | translate }}\n                  </md-tooltip>\n                </md-button>\n              </md-card-header>\n              <md-divider></md-divider>\n              <md-card-content>\n                <div layout="column" layout-align="space-between start" class="word-break-all mr-16">\n                  <div layout="row" layout-align="start center">\n                    <md-icon md-font-icon="{{ call.routeId ? \'icon-phone-outgoing\' : \'icon-phone-incoming\'}}" class="s20 mr-5">\n                    </md-icon>\n                    <span class="h2" privacy ng-cloak>{{ call.routeId ? call.destcalleridnum : call.calleridnum }}</span>\n                  </div>\n\n                  <div class="subtitle h4 secondary-text" ng-if="call.calleridname && call.calleridname != \'<unknown>\' && !call.routeId">\n                    <md-icon md-font-icon="icon-account" class="s20"></md-icon>\n                    Name: <span privacy ng-cloak>{{ call.calleridname }}</span>\n                  </div>\n\n                  <div class="text h4 pt-8" ng-if="call.queue">\n                    <md-icon md-font-icon="icon-stackoverflow" class="s20"></md-icon>\n                    Queue: {{call.queue}}\n                  </div>\n                  <div class="text h4 pt-8" ng-if="call.variables.extravar">\n                    <md-icon md-font-icon="icon-minus" class="s20"></md-icon>\n                    Extra: {{call.variables.extravar}}\n                  </div>\n                </div>\n                <div layout="row" layout-align="center end" class="mt-8">\n                  <md-button ng-if="call.disposedAt" type="submit" ng-click="vm.disposeCall($event, call)" class="send-button md-accent md-raised mr-0 mv-0">\n                    {{ \'DASHBOARDS.DISPOSE\' | translate}}\n                  </md-button>\n                </div>\n              </md-card-content>\n            </md-card>\n          </div>\n          <div flex="25" layout="row" layout-md="column" layout-sm="column" layout-align="end center" layout-align-md="center center">\n            <md-button type="submit" ng-click="vm.mergeContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="merge">\n              <md-tooltip md-direction="top"><span translate="DASHBOARDS.MERGE"></span></md-tooltip>\n              <md-icon md-font-icon="icon-source-fork"></md-icon>\n            </md-button>\n            <md-button type="submit" ng-click="vm.duplicateContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="duplicate">\n              <md-tooltip md-direction="top"><span translate="DASHBOARDS.DUPLICATE"></span></md-tooltip>\n              <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n            </md-button>\n            <md-button type="submit" ng-click="vm.addNewContact($event)" class="send-button md-accent md-raised" ng-if="vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="add">\n              {{ \'DASHBOARDS.ADD\'| translate }}\n            </md-button>\n            <md-button type="submit" ng-click="vm.saveContact($event)" class="send-button md-accent md-raised" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="save">\n              {{ \'DASHBOARDS.SAVE\' | translate }}\n            </md-button>\n          </div>\n        </div>\n        <div layout="row">\n          <div layout="column" flex="75">\n            <md-card layout-padding>\n              <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.PERSONAL_INFO">\n                PERSONAL_INFO</div>\n              <div class="subtitle secondary-text">\n                <span translate="CONTACTMANAGER.CREATED_AT"></span>\n                <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n              </div>\n\n              <form name="vm.detailForm" novalidate>\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.FIRSTNAME">First Name</label>\n                      <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n                      <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required privacy ng-cloak>\n                      <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n                        <div ng-message="required">\n                          <span translate="DASHBOARDS.ERRORS.FIRSTNAME_REQUIRED">First name\n                            field is required</span>\n                        </div>\n                      </div>\n                    </md-input-container>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.jscripty" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="JSCRIPTY PROJECTS" ng-click="$mdOpenMenu($event); vm.getJscriptyProjects();" aria-label="jscripty">\n                          <md-icon md-font-icon="icon-script"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingJscriptyProjects">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingJscriptyProjects && vm.jscriptyProjects.count > 0" ng-repeat="project in vm.jscriptyProjects.rows">\n                            <md-button ng-click="vm.addJscriptyTab(project, $event)">\n                              <md-icon md-font-icon="icon-script"></md-icon>\n                              {{project.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingJscriptyProjects && (!vm.jscriptyProjects || vm.jscriptyProjects.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_JSCRIPTY_PROJECTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-script"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                  </div>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.LASTNAME">Last Name</label>\n                    <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" privacy ng-cloak>\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.PHONE">Phone</label>\n                      <md-icon md-font-icon="icon-phone"></md-icon>\n                      <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" privacy ng-cloak>\n                      <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.phone" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n                    </md-input-container>\n                    <div>\n                      \x3c!-- click to call directive --\x3e\n                      <ms-click-to-call target="vm.contact.phone" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n                      \x3c!--  / click to call directive --\x3e\n                    </div>\n                  </div>\n                  <div flex="5"></div>\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.MOBILE">Mobile</label>\n                      <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n                      <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" privacy ng-cloak>\n                      <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.mobile" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n                    </md-input-container>\n                    <div>\n                      \x3c!-- click to call directive --\x3e\n                      <ms-click-to-call target="vm.contact.mobile" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n                      \x3c!--  / click to call directive --\x3e\n                    </div>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.messaging || !vm.hasPermission(107) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW SMS" ng-click="$mdOpenMenu($event); vm.getAccounts(\'sms\')" aria-label="sms">\n                          <md-icon md-font-icon="icon-message-text"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingAccounts">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && vm.smsAccounts.count > 0" ng-repeat="account in vm.smsAccounts.rows">\n                            <md-button ng-click="vm.composeInteraction($event, \'Sms\', account, vm.contact.mobile)">\n                              <md-icon md-font-icon="icon-message-text"></md-icon>\n                              {{account.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && (!vm.smsAccounts || vm.smsAccounts.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_SMS_ACCOUNTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-message-text"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.whatsapp || !vm.hasPermission(114) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW WHATSAPP" ng-click="$mdOpenMenu($event); vm.getAccounts(\'whatsapp\')" aria-label="whatsapp">\n                          <md-icon md-font-icon="icon-whatsapp"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingAccounts">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && vm.whatsappAccounts.count > 0" ng-repeat="account in vm.whatsappAccounts.rows">\n                            <md-button ng-click="vm.composeInteraction($event, \'Whatsapp\', account, vm.contact.mobile)">\n                              <md-icon md-font-icon="icon-whatsapp"></md-icon>\n                              {{account.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && (!vm.whatsappAccounts || vm.whatsappAccounts.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_WHATSAPP_ACCOUNTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-whatsapp"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                  </div>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.EMAIL">Email</label>\n                      <md-icon md-font-icon="icon-email" class="email"></md-icon>\n                      <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" privacy ng-cloak>\n                      <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n                        <div ng-message="email">\n                          <span translate="DASHBOARDS.ERRORS.EMAIL_MUST_VALID">Email must be a\n                            valid e-mail address</span>\n                        </div>\n                      </div>\n                    </md-input-container>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.mail || !vm.hasPermission(106) || !vm.contact.email" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW EMAIL" ng-click="$mdOpenMenu($event); vm.getAccounts(\'mail\')" aria-label="email">\n                          <md-icon md-font-icon="icon-email"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingAccounts">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && vm.mailAccounts.count > 0" ng-repeat="account in vm.mailAccounts.rows">\n                            <md-button ng-click="vm.composeInteraction($event, \'Mail\', account, vm.contact.email)">\n                              <md-icon md-font-icon="icon-email"></md-icon>\n                              {{account.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && (!vm.mailAccounts || vm.mailAccounts.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_MAIL_ACCOUNTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-email"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                  </div>\n                  <div flex="5"></div>\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.FAX">Fax</label>\n                      <md-icon md-font-icon="icon-deskphone"></md-icon>\n                      <input type="text" name="fax" ng-model="vm.contact.fax" privacy ng-cloak>\n                    </md-input-container>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.fax || !vm.hasPermission(109) || !vm.contact.fax" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW FAX" ng-click="$mdOpenMenu($event); vm.getAccounts(\'fax\')" aria-label="fax">\n                          <md-icon md-font-icon="icon-deskphone"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingAccounts">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && vm.faxAccounts.count > 0" ng-repeat="account in vm.faxAccounts.rows">\n                            <md-button ng-click="vm.composeInteraction($event, \'Fax\', account, vm.contact.fax)">\n                              <md-icon md-font-icon="icon-deskphone"></md-icon>\n                              {{account.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && (!vm.faxAccounts || vm.faxAccounts.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_FAX_ACCOUNTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-deskphone"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                  </div>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.DATE_OF_BIRTH">Date of Birth</label>\n                    <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n                  </md-input-container>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n                    <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.COMPANY">Company</label>\n                    <md-icon md-font-icon="icon-domain" class="email"></md-icon>\n                    <md-select name="company" ng-model="vm.contact.CompanyId">\n                      <md-option ng-value="company.id" ng-repeat="company in vm.tab.companies.rows">{{company.name}}\n                      </md-option>\n                      <md-option ng-value="null"><em translate="DASHBOARDS.NONE">None</em>\n                      </md-option>\n                    </md-select>\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.TAG">TAG</label>\n                    <md-icon md-font-icon="icon-tag"></md-icon>\n                    <md-select ng-model="vm.tab.Tags" multiple>\n                      <md-option ng-value="tag.id" ng-repeat="tag in vm.tab.tags.rows">\n                        {{tag.name}}</md-option>\n                    </md-select>\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.COUNTRY">Country</label>\n                    <md-icon md-font-icon="icon-home" class="country"></md-icon>\n                    <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.CITY">City</label>\n                    <input type="text" name="city" ng-model="vm.contact.city">\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.STREET">Street</label>\n                    <input type="text" name="street" ng-model="vm.contact.street">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.POSTALCODE">Postal Code</label>\n                    <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate translate-attr-placeholder="DASHBOARDS.NOTES">Notes</label>\n                    <md-icon md-font-icon="icon-note"></md-icon>\n                    <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n                  </md-input-container>\n                </div>\n              </form>\n            </md-card>\n            <md-card layout-padding>\n              <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.SOCIAL">Social</div>\n              <form name="vm.socialForm" novalidate>\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Facebook</label>\n                    <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n                    <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Twitter</label>\n                    <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n                    <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n                  </md-input-container>\n                </div>\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Line</label>\n                    <md-icon md-font-icon="fab fa-line"></md-icon>\n                    <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Viber</label>\n                    <md-icon md-font-icon="fab fa-viber"></md-icon>\n                    <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n                  </md-input-container>\n                </div>\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>WeChat</label>\n                    <md-icon md-font-icon="fab fa-weixin"></md-icon>\n                    <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Telegram</label>\n                    <md-icon md-font-icon="icon-telegram"></md-icon>\n                    <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n                  </md-input-container>\n                </div>\n              </form>\n            </md-card>\n          </div>\n          <div flex="25" layout="column" layout-padding>\n            <md-card flex="100" layout-padding>\n              <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.CUSTOM_FIELDS">CUSTOM\n                FIELDS</div>\n              <form name="vm.customFieldsForm" novalidate>\n\n                \x3c!-- START INPUT LIST --\x3e\n                <md-input-container class="md-block">\n                  <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n                  <md-select name="list" ng-disabled="!vm.newContact" ng-model="vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n                    <md-optgroup label="Lists">\n                      <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}\n                      </md-option>\n                    </md-optgroup>\n                  </md-select>\n                </md-input-container>\n                \x3c!-- END INPUT LIST --\x3e\n\n                <div ng-repeat="customField in vm.tab.customFields.rows" ng-switch="customField.type">\n                  <md-input-container class="md-block" ng-switch-when="datetime">\n                    <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n                    <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n                      <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]">\n                      </mdp-date-picker>\n                      <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n                      </mdp-time-picker>\n                    </div>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-when="select">\n                    <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n                    <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n                      <md-option ng-repeat="value in customField.values" ng-value="value.value">\n                        {{value.value}}</md-option>\n                      <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em>\n                      </md-option>\n                    </md-select>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-when="switch">\n                    <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n                      {{customField.alias}}<span ng-if="customField.required">*</span>\n                    </md-switch>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-default>\n                    <div layout-gt-sm="row" class="layout-gt-sm-row"></div>\n                    <div layout="row" flex>\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n                        <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n                      </md-input-container>\n                      <ms-click-to-call ng-if="customField.clickToAction && customField.actionType === \'voice\'" target="vm.contact[\'cf_\' + customField.id]" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n                    </div>\n                  </md-input-container>\n                </div>\n              </form>\n            </md-card>\n          </div>\n        </div>\n      </md-content>\n    </md-tab-body>\n  </md-tab>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Customer Journey</span>\n    </md-tab-label>\n    <md-tab-body>\n      <md-content class="md-padding" id="journey-content">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n        </div>\n      </md-content>\n    </md-tab-body>\n  </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n  <form name="disposition" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" ng-if="!vm.call.mandatoryDisposition">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div ng-if="!vm.isReschedule">\n        <md-input-container class="md-block">\n          <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n          <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n              {{ disposition.name }}</md-option>\n          </md-select>\n          <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n            <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n              <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n                {{ disposition.name }}</md-option>\n            </md-select>\n          </md-input-container>\n          <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n            <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n            </md-icon>\n          </md-button>\n        </div>\n        <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n            <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition" ng-change="vm.onDispositionChange(\'third\')">\n              <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true">\n                {{ disposition.name }}</md-option>\n            </md-select>\n          </md-input-container>\n          <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n            <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n            </md-icon>\n          </md-button>\n        </div>\n        <md-input-container class="md-block">\n          <label translate="DASHBOARDS.NOTE">Note</label>\n          <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n        </md-input-container>\n        <md-input-container class="md-block" ng-if="vm.availableCalls === 1">\n          <md-switch ng-model="vm.autoClose" aria-label="Auto Close">\n            <span translate="DASHBOARDS.AUTOCLOSE">Automatically close contact tab after disposal</span>\n          </md-switch>\n        </md-input-container>\n      </div>\n      <div ng-if="vm.isReschedule">\n        <div layout="row">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-change="vm.recalcTZTime()" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n              <div ng-messages="disposition.date.$error" ng-show="disposition.date.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" ng-change="vm.recalcTZTime()" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n              <div ng-messages="disposition.time.$error" ng-show="disposition.time.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </div>\n        <div layout="row">\n          <div flex class="md-block">\n            <md-input-container class="md-block" flex-gt-sm="">\n              <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n              <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n            </md-input-container>\n          </div>\n          <div flex class="md-block">\n            <md-input-container class="md-block">\n              <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n              <input type="text" readonly value="{{vm.hopper.scheduledAt}}">\n            </md-input-container>\n          </div>\n        </div>\n        <div ng-if="(!vm.dialer || (vm.dialer && vm.recallme && vm.user.selectRecallMeCampaign)) && vm.queueCampaigns.rows.length > 0" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.CAMPAIGN">Campaign</label>\n            <md-select name="queueCampaign" ng-model="vm.queueCampaign" required>\n              <md-option ng-value="queueCampaign" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n                <md-icon md-font-icon="icon-checkbox-blank-circle" ng-class="{\'green-fg\': queueCampaign.dialActive}" aria-label="Status">\n                </md-icon>\n                {{ queueCampaign.name }}\n              </md-option>\n            </md-select>\n            <div ng-messages="disposition.queueCampaign.$error" ng-show="disposition.queueCampaign.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="DASHBOARDS.ERRORS.CAMPAIGN_REQUIRED">Campaign field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions ng-if="!vm.isReschedule" layout="row">\n      <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()" ms-dialog-spinner>\n        {{(vm.selectedDisposition.name ? \'DASHBOARDS.DISPOSE\' : \'DASHBOARDS.SAVE\') | translate}}\n      </md-button>\n      <md-button class="send-button md-raised md-primary" translate="DASHBOARDS.RESCHEDULE" ng-click="vm.saveDisposition(\'reschedule\')">\n        Reschedule\n      </md-button>\n      <md-button class="send-button md-accent md-raised" translate="DASHBOARDS.RECALLME" ng-click="vm.saveDisposition(\'recallme\')">\n        Recall Me\n      </md-button>\n      <span flex></span>\n      <md-button ng-if="vm.hasBlackLists" class="md-raised md-warn" translate="DASHBOARDS.BLACKLIST" ng-click="vm.saveDisposition(\'blacklist\')">\n        Blacklist\n      </md-button>\n    </md-dialog-actions>\n    <md-dialog-actions ng-if="vm.isReschedule" layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveReschedule()" class="send-button md-accent md-raised" ng-disabled="disposition.$invalid || disposition.$pristine || vm.disable" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/reschedule/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n  <form name="dateTime" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div layout="row">\n        <div flex class="md-block">\n          <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n            <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n              </div>\n            </div>\n          </mdp-date-picker>\n        </div>\n\n        <div flex class="md-block">\n          <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n            <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveDialog()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/selection/dialog.html",'<md-dialog ng-init="vm.onInit()" class="contact-trigger-dialog" aria-label="Select contact" ng-cloak>\n  <md-toolbar class="red-bg">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n      <span class="title">{{ \'DASHBOARDS.SELECT_CONTACT\' | translate }}</span>\n    </div>\n  </md-toolbar>\n  <md-dialog-content class="h-400 pv-16">\n    <div layout="row" class="p-10">\n      <span class="font-size-16">{{ \'DASHBOARDS.MULTIPLE_CONTACTS_FOUND\' | translate }}<strong>&nbsp;{{ vm.callNumber }}</strong>.</span>\n      <span class="font-size-16">&nbsp;{{ \'DASHBOARDS.WHICH_ONE_TO_USE\' | translate }}</span>\n    </div>\n    <md-grid-list md-cols-xs="1" md-cols="2" md-row-height="fit" ng-class="vm.paginatedContacts[vm.page - 1].length > 2 ? \'two-rows-layout\' : \'one-row-layout\'" flex>\n      <md-grid-tile ng-repeat="contact in vm.paginatedContacts[vm.page - 1]" md-rowspan="1">\n        <md-card layout="column" class="contact-info" no-padding no-margin ng-click="vm.selectedContact = contact;" ng-class="{ \'light-blue-50-bg\' : vm.selectedContact && vm.selectedContact.id === contact.id }" flex>\n          <md-card-title class="pt-16">\n            <md-card-title-text layout-align="center start">\n              <span class="font-size-16 text-bold">#{{ contact.id }} -\n                <span privacy ng-cloak>{{ contact.firstName }} {{ contact.lastName }}</span>\n              </span>\n              <em class="font-size-12">{{ \'DASHBOARDS.LAST_UPDATED\' | translate }}: {{ contact.updatedAt }}</em>\n              <span class="font-size-12">{{ \'DASHBOARDS.LIST\' | translate }}: {{ vm.lists[contact.ListId] }}</span>\n            </md-card-title-text>\n            <md-button class="md-icon-button no-margin" aria-label="Selected">\n              <md-icon md-font-icon="{{ vm.selectedContact && vm.selectedContact.id === contact.id ? \'icon-checkbox-marked-circle\' : \'icon-checkbox-blank-circle-outline\' }}" ng-class="{ \'green-fg\': vm.selectedContact && vm.selectedContact.id === contact.id }"></md-icon>\n            </md-button>\n          </md-card-title>\n          <md-divider></md-divider>\n          <md-card-content layout="row" layout-align="center start" class="p-10">\n            <span class="font-size-16">{{ \'DASHBOARDS.MATCHING_FIELD\' | translate }}:\n              <strong privacy ng-cloak>{{ contact.matchingField }}</strong>\n            </span>\n          </md-card-content>\n        </md-card>\n      </md-grid-tile>\n    </md-grid-list>\n  </md-dialog-content>\n  <md-dialog-actions layout="row">\n    <div ng-if="vm.paginatedContacts.length > 1" layout="row" layout-align="center center" flex>\n      <md-button ng-click="vm.page = vm.page - 1;" class="md-icon-button no-margin" ng-class="{ \'hidden\': vm.page <= 1 }" aria-label="Previous page">\n        <md-icon md-font-icon="icon-chevron-double-left"></md-icon>\n      </md-button>\n      <span>{{ \'DASHBOARDS.PAGE\' | translate }} {{ vm.page }} {{ \'DASHBOARDS.OF\' | translate }}\n        {{ vm.paginatedContacts.length }}</span>\n      <md-button ng-click="vm.page = vm.page + 1;" class="md-icon-button no-margin" ng-class="{ \'hidden\': !vm.paginatedContacts[vm.page] }" aria-label="Next page">\n        <md-icon md-font-icon="icon-chevron-double-right"></md-icon>\n      </md-button>\n    </div>\n    <md-button ng-click="vm.selectContact()" class="select-button md-accent md-raised" ng-disabled="!vm.selectedContact" aria-label="Select" translate="DASHBOARDS.SELECT" translate-attr-aria-label="DASHBOARDS.SELECT">\n      SELECT\n    </md-button>\n  </md-dialog-actions>\n</md-dialog>vc'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html",'<div ng-cloak>\n  <md-content>\n    <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n      <md-tab ng-if="vm_home.hasPermission(110)" label="{{\'DASHBOARDS.VOICE\' | translate}}">\n        <md-content ng-if="vm.selectedTab === 0" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html\'" ng-controller="AgentHomeAbandonedVoiceController as vm_voice">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="{{\'DASHBOARDS.MOTION_BULL\' | translate}}">\n        <md-content ng-if="vm.selectedTab === 1" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html\'" ng-controller="AgentHomeAbandonedBullController as vm_bull">\n        </md-content>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header blue-bg" ng-class="{\'h-128\' : vm_bull.isSearchBarVisible === true}">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n      <ms-search-bar on-search="vm_bull.getAbandonedCalls()" query="vm_bull.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm_bull.isSearchBarVisible"></ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm_bull.quickFilters" query="vm_bull.query" search="vm_bull.getAbandonedCalls()"></ms-quick-filter>\n      <md-button class="md-icon-button reload-list" ng-click="vm_bull.refresh && vm_bull.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n        <md-icon md-font-icon="icon-reload"></md-icon>\n        <md-tooltip ng-if="vm_bull.showTooltip" md-visible="vm_bull.showTooltip">\n          {{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm_bull.promise">\n      <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getAbandonedCalls">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n          <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n          <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n          <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n          <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}\n          </th>\n          <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n          <th md-column md-order-by="secondDisposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n          <th md-column md-order-by="thirdDisposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n          <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm_bull.abandonedCalls.rows.length">\n          <td md-cell colspan="12">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="abandonedCall in vm_bull.abandonedCalls.rows">\n          <td md-cell class="id">{{abandonedCall.id}}</td>\n          <td md-cell class="firstName" privacy ng-cloak>{{abandonedCall.calleridname}}</td>\n          <td md-cell class="phone">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_bull.currentUser.name">\n            </ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="list">{{vm_bull.queuesMap[abandonedCall.queue]}}</td>\n          <td md-cell class="list">\n            {{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : (abandonedCall.queuecallerexitAt | formatdate) }}\n          </td>\n          <td md-cell class="list">\n            {{abandonedCall.queuecallerexitAt ? (abandonedCall.queuecallerexitAt | formatdate) : undefined }}\n          </td>\n          <td md-cell class="list">{{abandonedCall.queuecallerexitreason}}</td>\n          <td md-cell class="list">{{ abandonedCall.disposition }}</td>\n          <td md-cell class="list">{{ abandonedCall.secondDisposition }}</td>\n          <td md-cell class="list">{{ abandonedCall.thirdDisposition }}</td>\n          <td md-cell class="actions">\n            <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_bull.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_bull.reserved(abandonedCall)">\n            </md-switch>\n          </td>\n          <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n          <td md-cell class="actions">\n            <md-menu ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name">\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="1">\n                <md-menu-item>\n                  <md-button ng-click="vm_bull.dispose(abandonedCall)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.abandonedCalls.count}}" md-on-paginate="vm_bull.getAbandonedCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n  <form name="disposition" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div>\n        <md-input-container class="md-block">\n          <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n          <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n              {{ disposition.name }}</md-option>\n          </md-select>\n          <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n            <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n              <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n                {{ disposition.name }}</md-option>\n            </md-select>\n          </md-input-container>\n          <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n            <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n            </md-icon>\n          </md-button>\n        </div>\n        <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n            <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition" ng-change="vm.onDispositionChange(\'third\')">\n              <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true">\n                {{ disposition.name }}</md-option>\n            </md-select>\n          </md-input-container>\n          <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n            <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n            </md-icon>\n          </md-button>\n        </div>\n        <md-input-container class="md-block">\n          <label translate="DASHBOARDS.NOTE">Note</label>\n          <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n        </md-input-container>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()">\n'+"          {{(vm.selectedDisposition.name ? 'DASHBOARDS.DISPOSE' : 'DASHBOARDS.SAVE') | translate}}\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>"),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header blue-bg" ng-class="{\'h-128\' : vm_voice.isSearchBarVisible === true}">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n      <ms-search-bar on-search="vm_voice.getAbandonedCalls()" query="vm_voice.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm_voice.isSearchBarVisible"></ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm_voice.quickFilters" query="vm_voice.query" search="vm_voice.getAbandonedCalls()"></ms-quick-filter>\n      <md-button class="md-icon-button reload-list" ng-click="vm_voice.refresh && vm_voice.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n        <md-icon md-font-icon="icon-reload"></md-icon>\n        <md-tooltip ng-if="vm_voice.showTooltip" md-visible="vm_voice.showTooltip">\n          {{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm_voice.promise">\n      <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getAbandonedCalls">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n          <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n          <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n          <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n          <th md-column md-order-by="secondDisposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n          <th md-column md-order-by="thirdDisposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n          <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm_voice.abandonedCalls.rows.length">\n          <td md-cell colspan="12">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="abandonedCall in vm_voice.abandonedCalls.rows">\n          <td md-cell class="id">{{abandonedCall.id}}</td>\n          <td md-cell class="firstName" privacy ng-cloak>{{abandonedCall.calleridname}}</td>\n          <td md-cell class="phone">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_voice.currentUser.name">\n            </ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="list">{{vm_voice.queuesMap[abandonedCall.queue]}}</td>\n          <td md-cell class="list">\n            {{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : (abandonedCall.queuecallerexitAt | formatdate) }}\n          </td>\n          <td md-cell class="list">{{ abandonedCall.disposition }}</td>\n          <td md-cell class="list">{{ abandonedCall.secondDisposition }}</td>\n          <td md-cell class="list">{{ abandonedCall.thirdDisposition }}</td>\n          <td md-cell class="actions">\n            <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_voice.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_voice.reserved(abandonedCall)">\n            </md-switch>\n          </td>\n          <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n          <td md-cell class="actions">\n            <md-menu ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name">\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="1">\n                <md-menu-item>\n                  <md-button ng-click="vm_voice.dispose(abandonedCall)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.abandonedCalls.count}}" md-on-paginate="vm_voice.getAbandonedCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.html",'<div layout="column" layout-align="start center" class="agent-general-home-navbar md-primary-bg width-50">\n  <div ng-repeat="node in vm_home.navigation">\n    <div ng-repeat="home in node.children">\n      <md-button ng-repeat="button in home.children  | orderBy:\'weight\'" ng-if="!button.hidden()" class="md-raised width-50 height-50 no-margin" style="border-radius: 0px" aria-label="{{button.state}}" ng-click="vm_home.changeSidebarTab(button)" ng-class="{\'md-primary\': vm_home.sidebar != button.state}">\n        <md-tooltip md-direction="right" md-delay="500"><span translate="{{button.translate}}"></span>\n        </md-tooltip>\n        <md-icon md-font-icon="{{button.icon}}" ng-class="button.iconClass"></md-icon>\n      </md-button>\n    </div>\n  </div>\n</div>\n<div class="agent-general-home-sections" layout="column" flex>\n  <div layout="column" flex>\n    <div ng-switch="vm_home.sidebar" style="overflow-y: auto; overflow-x: hidden" flex>\n      <div ng-switch-when="agentPresence" class="home-agent-presence">\n        <div ng-if="vm_home.hasPermission(115)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/agent.general.presence.html\'" ng-controller="AgentHomePresenceController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(115)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="contacts" class="home-contacts">\n        <div ng-if="vm_home.hasPermission(102) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html\'" ng-controller="AgentHomeContactsController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(102) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="mycontacts" class="home-mycontacts">\n        <div ng-if="vm_home.hasPermission(103) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html\'" ng-controller="AgentHomeMyContactsController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(103) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="scheduled" class="home-scheduled">\n        <div ng-if="vm_home.hasPermission(113) && vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html\'" ng-controller="AgentHomeScheduledCallsController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(113) || !vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="voice" class="home-voice">\n        <div ng-if="vm_home.hasPermission(110) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html\'" ng-controller="AgentHomeVoiceController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(110) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="abandoned" class="home-abandoned">\n        <div ng-if="vm_home.hasPermission(111) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html\'" ng-controller="AgentHomeAbandonedController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(111) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="recordings" class="home-recordings">\n        <div ng-if="vm_home.hasPermission(104) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html\'" ng-controller="AgentHomeRecordingsController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(104) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="chat" class="home-chat">\n        <div ng-if="vm_home.hasPermission(105) && vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html\'" ng-controller="AgentHomeChatController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(105) || !vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="mail" class="home-mail">\n        <div ng-if="vm_home.hasPermission(106) && vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html\'" ng-controller="AgentHomeMailController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(106) || !vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="sms" class="home-sms">\n        <div ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html\'" ng-controller="AgentHomeSmsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(107) || !vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="openchannel" class="home-openchannel">\n        <div ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html\'" ng-controller="AgentHomeOpenchannelController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(108) || !vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="fax" class="home-fax">\n        <div ng-if="vm_home.hasPermission(109) && vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html\'" ng-controller="AgentHomeFaxController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(109) || !vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="whatsapp" class="home-whatsapp">\n        <div ng-if="vm_home.hasPermission(114) && vm_home.license.whatsapp" ng-include="\'app/main/apps/dashboards/views/general/agent/home/whatsapp/agent.general.whatsapp.html\'" ng-controller="AgentHomeWhatsappController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(114) || !vm_home.license.whatsapp" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="plugin" class="home-plugin" layout-fill>\n        <div ng-if="vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html\'" ng-controller="AgentHomePluginsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting, vm_home.plugin)" layout-fill></div>\n        <div ng-if="!vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-default class="home-default">\n        <div ng-if="vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html\'" ng-controller=" AgentHomeDashboardController  as vm"></div>\n        <div ng-if="!vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n    </div>\n  </div>\n  <div ng-if="(vm_home.draftManager.drafts | json) != \'{}\'" layout="column" class="draft-manager-bar">\n    <ms-tab-scroll>\n      <div layout="column" ng-repeat="(key, draft) in vm_home.draftManager.drafts" class="grey-50-bg" ng-click="vm_home.draftManager.open(draft.id)">\n        <div class="draft-manager-tab" layout="row" layout-align="space-between center">\n          <md-icon md-font-icon="icon-pencil" class="icon s16 margin-horizontal-5 black-fg"></md-icon>\n          <span class="text-truncate font-size-12 black-fg">{{draft.title}}</span>\n          <md-button class="md-icon-button md-mini no-margin md-primary" aria-label="close" ng-click="vm_home.draftManager.remove(draft.id)">\n            <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </ms-tab-scroll>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html",'<md-content layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n  <div layout="column" layout-align="space-around center" flex="50">\n    <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n    <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n  </div>\n\n  <div layout="column" flex="50">\n    <img src="assets/images/avatars/permissions.png" alt="permissions">\n  </div>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.CHAT_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getChatInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getChatInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getChatInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.WEBSITE\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.chatInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.chatInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="chatAccount">\n            {{ vm.getChatWebsiteLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showChatInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Chat\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n                  <md-button ng-click="vm.downloadChatInteraction($event, interaction, true)" translate="CHAT.DOWNLOAD_WITH_ATTACHMENTS">\n                    Download with attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadChatInteraction($event, interaction)" translate="CHAT.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                    Download without attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatInteractions.count}}" md-on-paginate="vm.getChatInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.CONTACTS">Contacts</span>\n      <ms-search-bar on-search="vm.getContacts()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getContacts()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button ng-if="vm.lists.rows && vm.lists.rows.length" class="md-icon-button create-new" ng-click="vm.openContact()" aria-label="Add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n          <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n          <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n          <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.CREATEDAT\' | translate}}</th>\n          <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.contacts.rows.length">\n          <td md-cell colspan="10">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="contact in vm.contacts.rows">\n          <td ng-click="vm.openContact(contact.id)" md-cell class="id">{{contact.id}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="firstName" privacy ng-cloak>{{contact.firstName}}\n            {{contact.lastName}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="phone">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="mobile">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="fax" privacy ng-cloak>{{contact.fax}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="email" privacy ng-cloak>{{contact.email}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="createdAt">{{contact.createdAt | formatdate}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}\n          <td md-cell class="tag">\n            <div ng-if="contact.Tags.length">\n              <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n                <span class="text-truncate">{{contact.Tags[0].name}}</span>\n              </div>\n              <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag"></md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.openContact(contact.id)" translate="DASHBOARDS.EDIT">\n                    Edit Contact\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n                    Merge Contact\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n                    Duplicate Contact\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html",'<div ng-cloak>\n  <md-content>\n    <md-tabs md-dynamic-height md-border-bottom>\n      <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html\'" ng-controller="AgentHomeDashboardVoiceController as vm_voice" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="{{\'DASHBOARDS.MOTION_BULL\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html\'" ng-controller="AgentHomeDashboardBullController as vm_bull" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(105) && vm_home.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html\'" ng-controller="AgentHomeDashboardMultiChannelChatController as vm_chat" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(106) && vm_home.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html\'" ng-controller="AgentHomeDashboardMultiChannelMailController as vm_mail" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html\'" ng-controller="AgentHomeDashboardMultiChannelSmsController as vm_sms" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html\'" ng-controller="AgentHomeDashboardMultiChannelOpenchannelController as vm_openchannel" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(109) && vm_home.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html\'" ng-controller="AgentHomeDashboardMultiChannelFaxController as vm_fax" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(114) && vm_home.license.whatsapp" label="{{\'DASHBOARDS.WHATSAPP\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/whatsapp/agent.general.dashboard.whatsapp.html\'" ng-controller="AgentHomeDashboardMultiChannelWhatsappController as vm_whatsapp" class="md-padding">\n        </md-content>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_bull.promise">\n        <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getVoiceQueues">\n          <tr md-row>\n            <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n            <th md-column>{{ \'VOICE.TYPE\' | translate }}</th>\n            <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n            <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n            \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_bull.getSize(vm_bull.voiceQueues)">\n            <td md-cell colspan="4">\n              <div layout="row" layout-align="center center">\n                <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, voiceQueue) in vm_bull.voiceQueues">\n            <td md-cell class="name">{{voiceQueue.name}}</td>\n            <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n            <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n            <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n              <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.voiceQueuesTotal}}" md-on-paginate="vm_bull.getVoiceQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n            <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n            <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, channel) in vm_bull.rpcVoiceQueuesChannels | limitObjectFromTo: vm_bull.queryChannels.limit:(vm_bull.queryChannels.page - 1) * vm_bull.queryChannels.limit">\n            <td md-cell>{{channel.exten}}</td>\n            <td md-cell>{{channel.queue}}</td>\n            <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_bull.queryChannels.limit" md-page="vm_bull.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)}}" md-page-select>\n    </md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_chat.promise">\n        <thead md-head md-order="vm_chat.query.sort" md-on-reorder="vm_chat.getChatQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_chat.getSize(vm_chat.chatQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_chat.chatQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_chat.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_chat.query.page" md-total="{{vm_chat.chatQueuesTotal}}" md-on-paginate="vm_chat.getChatQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_chat.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_chat.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_chat.queryChannels.limit" md-page="vm_chat.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_chat.paginatedInteractions.length}}" md-on-paginate="vm_chat.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_fax.promise">\n        <thead md-head md-order="vm_fax.query.sort" md-on-reorder="vm_fax.getFaxQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_fax.getSize(vm_fax.faxQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_fax.faxQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_fax.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_fax.query.page" md-total="{{vm_fax.faxQueuesTotal}}" md-on-paginate="vm_fax.getFaxQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_fax.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_fax.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_fax.queryChannels.limit" md-page="vm_fax.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_fax.paginatedInteractions.length}}" md-on-paginate="vm_fax.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_mail.promise">\n        <thead md-head md-order="vm_mail.query.sort" md-on-reorder="vm_mail.getMailQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_mail.getSize(vm_mail.mailQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_mail.mailQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_mail.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_mail.query.page" md-total="{{vm_mail.mailQueuesTotal}}" md-on-paginate="vm_mail.getMailQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_mail.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_mail.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_mail.queryChannels.limit" md-page="vm_mail.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_mail.paginatedInteractions.length}}" md-on-paginate="vm_mail.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_openchannel.promise">\n        <thead md-head md-order="vm_openchannel.query.sort" md-on-reorder="vm_openchannel.getOpenchannelQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_openchannel.getSize(vm_openchannel.openchannelQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_openchannel.openchannelQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_openchannel.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_openchannel.query.page" md-total="{{vm_openchannel.openchannelQueuesTotal}}" md-on-paginate="vm_openchannel.getOpenchannelQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_openchannel.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_openchannel.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_openchannel.queryChannels.limit" md-page="vm_openchannel.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_openchannel.paginatedInteractions.length}}" md-on-paginate="vm_openchannel.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_sms.promise">\n        <thead md-head md-order="vm_sms.query.sort" md-on-reorder="vm_sms.getSmsQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_sms.getSize(vm_sms.smsQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_sms.smsQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_sms.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_sms.query.page" md-total="{{vm_sms.smsQueuesTotal}}" md-on-paginate="vm_sms.getSmsQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_sms.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_sms.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_sms.queryChannels.limit" md-page="vm_sms.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_sms.paginatedInteractions.length}}" md-on-paginate="vm_sms.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_voice.promise">\n        <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getVoiceQueues">\n          <tr md-row>\n            <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n            <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n            <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n            \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_voice.getSize(vm_voice.voiceQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, voiceQueue) in vm_voice.voiceQueues">\n            <td md-cell class="name">{{voiceQueue.name}}</td>\n            <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n            <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n            <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n              <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.voiceQueuesTotal}}" md-on-paginate="vm_voice.getVoiceQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n            <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n            <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, channel) in vm_voice.rpcVoiceQueuesChannels | limitObjectFromTo: vm_voice.queryChannels.limit:(vm_voice.queryChannels.page - 1) * vm_voice.queryChannels.limit">\n            <td md-cell>{{channel.exten}}</td>\n            <td md-cell>{{channel.queue}}</td>\n            <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_voice.queryChannels.limit" md-page="vm_voice.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)}}" md-page-select>\n    </md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/whatsapp/agent.general.dashboard.whatsapp.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_whatsapp.getColorByChannel(\'whatsapp\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_whatsapp.promise">\n        <thead md-head md-order="vm_whatsapp.query.sort" md-on-reorder="vm_whatsapp.getWhatsappQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_whatsapp.getSize(vm_whatsapp.whatsappQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_whatsapp.whatsappQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_whatsapp.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_whatsapp.query.page" md-total="{{vm_whatsapp.whatsappQueuesTotal}}" md-on-paginate="vm_whatsapp.getWhatsappQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_whatsapp.getColorByChannel(\'whatsapp\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_whatsapp.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_whatsapp.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_whatsapp.queryChannels.limit" md-page="vm_whatsapp.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_whatsapp.paginatedInteractions.length}}" md-on-paginate="vm_whatsapp.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.FAX_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getFaxInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getFaxInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getFaxInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.faxAccounts.rows && vm.faxAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="faxAccount in vm.faxAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeFaxInteraction($event, faxAccount)">\n              {{ faxAccount.name }} ({{ faxAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.faxInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.faxInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="faxAccount">\n            {{ vm.getFaxAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showFaxInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Fax\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadFaxInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n                    Download Fax\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxInteractions.count}}" md-on-paginate="vm.getFaxInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.MAIL_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getMailInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getMailInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getMailInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.mailAccounts.rows && vm.mailAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="mailAccount in vm.mailAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeMailInteraction($event, mailAccount)">\n              {{ mailAccount.name }} ({{ mailAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="subject">{{\'DASHBOARDS.SUBJECT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.mailInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.mailInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <div ng-if="vm.setting.enableEmailPreview && interaction.lastMsgText" class="tooltip-preview" ng-mouseleave="vm.resetTooltipPosition($event)" ng-mouseenter="vm.adjustTooltipPosition($event)">\n              <span class="text-truncate font-size-12 subject-text">{{ interaction.subject }}</span>\n              <md-card class="tooltip-preview-text">\n                <md-card-content><span class="email-preview-message">{{ interaction.lastMsgText }}</span>\n                </md-card-content>\n              </md-card>\n            </div>\n            <span ng-if="!interaction.lastMsgText || !vm.setting.enableEmailPreview"><span class="text-truncate font-size-12 subject-text">{{ interaction.subject }}</span></span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="mailAccount">\n            {{ vm.getMailAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showMailInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Mail\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n                  <md-button ng-click="vm.downloadMailInteraction($event, interaction, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n                    Download with attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadMailInteraction($event, interaction)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                    Download without attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailInteractions.count}}" md-on-paginate="vm.getMailInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.MYCONTACTS">My Contacts</span>\n      <ms-search-bar on-search="vm.getContacts()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getContacts()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button ng-if="vm.lists.rows && vm.lists.rows.length" class="md-icon-button create-new" ng-click="vm.openContact($event)" aria-label="Add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n          <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n          <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n          <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.CREATEDAT\' | translate}}</th>\n          <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.contacts.rows.length">\n          <td md-cell colspan="10">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="contact in vm.contacts.rows">\n          <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="firstName" privacy ng-cloak>\n            {{contact.firstName}} {{contact.lastName}}</td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="fax" privacy ng-cloak>\n            {{contact.fax}}</td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="email" privacy ng-cloak>{{contact.email}}\n          </td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="createdAt">{{contact.createdAt |\n            formatdate}}</td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="list">\n            {{vm.listsMap[contact.ListId].name}}</td>\n          <td md-cell class="tag">\n            <div ng-if="contact.Tags.length">\n              <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n                <span class="text-truncate">{{contact.Tags[0].name}}</span>\n              </div>\n              <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag"></md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n                    Edit Contact\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n                    Merge Contact\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n                    Duplicate Contact\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.OPENCHANNEL_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getOpenchannelInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getOpenchannelInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getOpenchannelInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.openchannelAccounts.rows && vm.openchannelAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeOpenchannelInteraction($event, openchannelAccount)" ng-disabled="!openchannelAccount.replyUri">\n              {{ openchannelAccount.name }} ({{ openchannelAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.openchannelInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.openchannelInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="openchannelAccount">\n            {{ vm.getOpenchannelAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showOpenchannelInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Openchannel\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n                  <md-button ng-click="vm.downloadOpenchannelInteraction($event, interaction, true)" translate="OPENCHANNEL.DOWNLOAD_WITH_ATTACHMENTS">\n                    Download with attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadOpenchannelInteraction($event, interaction)" translate="OPENCHANNEL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                    Download without attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelInteractions.count}}" md-on-paginate="vm.getOpenchannelInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html",'<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n  <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/agent.general.presence.html",'<div ng-cloak>\n  <md-content>\n    <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n      <md-tab label="{{\'DASHBOARDS.AGENTS\' | translate}}" md-on-select="vm.onAgentsTabSelection()">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.agents.html\'">\n        </md-content>\n      </md-tab>\n      <md-tab label="{{\'DASHBOARDS.QUEUES\' | translate}}" md-on-select="vm.onQueuesTabSelection()">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.queues.html\'">\n        </md-content>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.agents.html",'<md-card ngCloak>\n  <md-toolbar class="md-table-toolbar md-default table-header xenialab-violet-light-bg" ng-class="{\'h-128\' : vm.isSearchBarVisible === true}">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.AGENTS"></span>\n      <ms-search-bar on-search="vm.getAgents()" query="vm.agentsQuery" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible"></ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.agentsQuery" search="vm.getAgents()"></ms-quick-filter>\n      <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getAgents()">\n        <md-icon md-font-icon="icon-reload"></md-icon>\n        <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.agentsQuery.sort" md-on-reorder="vm.getAgents">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="name">{{\'DASHBOARDS.NAME\' | translate}}</th>\n          <th md-column md-order-by="internal">{{\'VOICE.INTERNAL\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column class="no-padding width-70"></th>\n          <th md-column class="width-70"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.agents.rows.length">\n          <td md-cell colspan="12">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="agent in vm.agents.rows">\n          <td md-cell>{{agent.id}}</td>\n          <td md-cell>{{agent.name}}</td>\n          <td md-cell>{{agent.internal}}</td>\n          <td md-cell>\n            <div layout="row">\n              <div layout="column" layout-align="center center">\n                <span class="text-boxed width-70 text-center md-background-bg bl bt padding-5" ng-class="{\'online\':\'lime-300-bg\',\'offline\':\'red-A200-bg\',\'pause\':\'amber-200-bg\',\'busy\':\'indigo-100-bg\'}[agent.status]">{{\n                  agent.status | uppercase }}</span>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="no-padding width-70">\n            <md-button ng-if="agent.status !== \'offline\'" ng-click="vm.originateCall(agent.name)" class="md-fab md-mini md-raised" aria-label="Dial">\n              <md-icon md-font-icon="icon-phone" class="icon green-fg s20">\n                <md-tooltip><span translate="VOICE.DIAL"></span></md-tooltip>\n              </md-icon>\n            </md-button>\n          </td>\n          <td md-cell class="width-70">\n            <md-button ng-if="agent.status !== \'offline\'" ng-click="vm.transferCall(agent.name)" class="md-fab md-mini md-raised" aria-label="Transfer">\n              <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s20">\n                <md-tooltip><span translate="DASHBOARDS.TRANSFER"></span></md-tooltip>\n              </md-icon>\n            </md-button>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm.agentsQuery.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.agentsQuery.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select>\n  </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.queues.html",'<md-card ngCloak>\n  <md-toolbar class="md-table-toolbar md-default table-header xenialab-violet-light-bg" ng-class="{\'h-128\' : vm.isSearchBarVisible === true}">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.QUEUES"></span>\n      <ms-search-bar on-search="vm.getVoiceQueues()" query="vm.queuesQuery" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible"></ms-search-bar>\n      <div flex></div>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.queuesQuery.sort" md-on-reorder="vm.getVoiceQueues">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="name">{{\'DASHBOARDS.NAME\' | translate}}</th>\n          <th md-column md-order-by="name">{{\'VOICE.CALLS\' | translate}}</th>\n          <th md-column class="no-padding width-70"></th>\n          <th md-column class="width-70"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.voiceQueues.rows.length">\n          <td md-cell colspan="12">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="queue in vm.voiceQueues.rows">\n          <td md-cell>{{queue.id}}</td>\n          <td md-cell>{{queue.name}}</td>\n          <td md-cell>{{queue.calls.length || 0}}</td>\n          <td md-cell class="no-padding width-70">\n            <md-button ng-click="vm.originateCall(queue.name)" class="md-fab md-mini md-raised" aria-label="Dial">\n              <md-icon md-font-icon="icon-phone" class="icon green-fg s20">\n                <md-tooltip><span translate="VOICE.DIAL"></span></md-tooltip>\n              </md-icon>\n            </md-button>\n          </td>\n          <td md-cell class="width-70">\n            <md-button ng-click="vm.transferCall(queue.name)" class="md-fab md-mini md-raised" aria-label="Transfer">\n              <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s20">\n                <md-tooltip><span translate="DASHBOARDS.TRANSFER"></span></md-tooltip>\n              </md-icon>\n            </md-button>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm.queuesQuery.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queuesQuery.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select>\n  </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header indigo-A100-bg" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="VOICE.RECORDINGS">Recordings</span>\n      <ms-search-bar on-search="vm.getVoiceRecordings()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceRecordings()">\n      </ms-quick-filter>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n        <tr md-row>\n          <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n          <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n          <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n          <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n          <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n          <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n          <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n          <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n          <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n          <th md-column width="10px" ng-if="vm.currentUser.downloadVoiceRecordings"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n          <td md-cell colspan="{{ vm.currentUser.downloadVoiceRecordings ? 10 : 9}}">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n          <td md-cell class="type">{{voiceRecording.type}}</td>\n          <td md-cell class="uniqueid">{{voiceRecording.uniqueid}}</td>\n          <td md-cell class="calleridnum">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceRecording.calleridnum" license="vm_home.license">\n            </ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="exten">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceRecording.exten" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="connectedlinenum">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceRecording.connectedlinenum" license="vm_home.license">\n            </ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="queue">{{voiceRecording.queue}}</td>\n          <td md-cell class="rating">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n          </td>\n          <td md-cell class="audio" ng-switch="voiceRecording.format">\n            \x3c!-- audio recording directive --\x3e\n            <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n            \x3c!-- / audio recording directive --\x3e\n            <span ng-switch-when=".gsm">\n              <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n            </span>\n          </td>\n          <td md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n          <td md-cell class="actions" ng-if="vm.currentUser.downloadVoiceRecordings">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.downloadfile(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n                    Download VoiceRecording\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\'">\n                  <md-button ng-click="vm.downloadtranscribe(voiceRecording, $event)" translate="VOICE.DOWNLOADTRANSCRIBE_VOICERECORDING">\n                    Download Transcribe\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select>\n  </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header blue-grey-bg" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getScheduledCalls()">\n      </ms-quick-filter>\n      <md-button class="md-icon-button reload-list" ng-click="vm.getScheduledCalls()" aria-label="Refresh scheduled calls" translate translate-attr-label="MOTIONDIALER.REFRESH_SCHEDULED_CALLS">\n        <md-icon md-font-icon="icon-reload"></md-icon>\n        <md-tooltip>{{\'MOTIONDIALER.REFRESH_SCHEDULED_CALLS\' | translate}}</md-tooltip>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduledCalls">\n        <tr md-row>\n          <th md-column>{{\'MOTIONDIALER.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n          <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n          <th md-column>{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n          <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLME\' | translate }}</th>\n          <th md-column>{{ \'MOTIONDIALER.CAMPAIGN\' | translate }}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.scheduledCalls.rows.length">\n          <td md-cell colspan="10">\n            <div layout="row" layout-align="center center">\n              <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="scheduledCall in vm.scheduledCalls.rows">\n          <td md-cell privacy ng-cloak>{{scheduledCall.Contact.firstName}} {{scheduledCall.Contact.lastName}}</td>\n          <td md-cell>\n            <ms-click-to-call target="scheduledCall.phone" license="vm_home.license"></ms-click-to-call>\n          </td>\n          <td md-colors="{color: {{ vm.isDateBeforeToday(scheduledCall.scheduledat) ? \'\\\'red\\\'\' : \'\\\'green\\\'\' }}}" md-cell>{{ scheduledCall.scheduledat | date:\'medium\' }}</td>\n          <td md-cell>{{ vm.priorities[scheduledCall.priority] }}</td>\n          <td md-cell>\n            <md-icon md-colors="{color: {{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ scheduledCall.recallme  && scheduledCall.UserId == vm.currentUser.id ? \'icon-check\' : \'icon-close\' }}">\n            </md-icon>\n          </td>\n          <td md-cell>\n            <md-icon md-colors="{color: {{ scheduledCall.Queue.dialActive? \'\\\'green\\\'\' : \'\\\'red\\\'\' }}}" md-font-icon="icon-checkbox-blank-circle"></md-icon> {{scheduledCall.Queue.name}}\n          </td>\n          <td md-cell class="actions">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.createOrEditQueueCampaignHopper($event, scheduledCall)" translate="MOTIONDIALER.EDIT_HOPPER">\n                    Edit Hopper\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.deleteConfirm(scheduledCall, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n                    Delete Hopper\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.scheduledCalls.count}}" md-on-paginate="vm.getScheduledCalls" md-page-select>\n  </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.SMS_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getSmsInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getSmsInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getSmsInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.smsAccounts.rows && vm.smsAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="smsAccount in vm.smsAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeSmsInteraction($event, smsAccount)">\n              {{ smsAccount.name }} ({{ smsAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.smsInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.smsInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="smsAccount">\n            {{ vm.getSmsAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showSmsInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Sms\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadSmsInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n                    Download Sms\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsInteractions.count}}" md-on-paginate="vm.getSmsInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="VOICE.CALLS">Calls</span>\n      <ms-search-bar on-search="vm.getVoiceCalls()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceCalls()">\n      </ms-quick-filter>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceCalls">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'VOICE.ID\' | translate}}</th>\n          <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n          <th md-column md-order-by="source">{{ \'VOICE.SOURCE\' | translate }}</th>\n          <th md-column md-order-by="destination">{{ \'VOICE.DESTINATION\' | translate }}</th>\n          <th md-column md-order-by="starttime">{{ \'VOICE.STARTEDAT\' | translate }}</th>\n          <th md-column md-order-by="endtime">{{ \'VOICE.ENDEDAT\' | translate }}</th>\n          <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n          <th md-column md-order-by="userSecondDisposition">{{ \'VOICE.SECOND_LEVEL_DISPOSITION\' | translate }}</th>\n          <th md-column md-order-by="userThirdDisposition">{{ \'VOICE.THIRD_LEVEL_DISPOSITION\' | translate }}</th>\n          <th md-column>{{ \'VOICE.NOTE\' | translate }}</th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.voiceCalls.rows.length">\n          <td md-cell colspan="10">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="voiceCall in vm.voiceCalls.rows" ng-click="vm.showDetails(voiceCall, $event)">\n          <td md-cell class="type">{{voiceCall.id}}</td>\n          <td md-cell class="type">{{ \'VOICE.\' + voiceCall.type.toUpperCase() | translate}}</td>\n          <td md-cell class="source">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceCall.source" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="destination">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceCall.destination" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="starttime">{{voiceCall.starttime | date:\'medium\' }}</td>\n          <td md-cell class="endtime">{{voiceCall.endtime | date:\'medium\' }}</td>\n          <td md-cell class="disposition">{{ voiceCall.userDisposition}}</td>\n          <td md-cell class="disposition">{{ voiceCall.userSecondDisposition}}</td>\n          <td md-cell class="disposition">{{ voiceCall.userThirdDisposition}}</td>\n          <td md-cell class="note">\n            <md-icon ng-if="voiceCall.note" md-font-icon="icon-clipboard-outline"></md-icon>\n          </td>\n          <td md-cell class="actions">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.showDetails(voiceCall, $event)" translate="VOICE.DETAILS">\n                    Show Details\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceCalls.count}}" md-on-paginate="vm.getVoiceCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",'<md-dialog class="details-dialog" aria-label="details">\n  <md-toolbar class="md-background-bg">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n      <span ng-if="!vm.interaction.closed" class="title" translate="VOICE.DETAILS"></span>\n      <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-dialog-content>\n    <md-list flex>\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.UNIQUEID">Uniqueid</p>\n          <h4>{{vm.call.uniqueid}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.TYPE">Type</p>\n          <h4>{{vm.call.type ? vm.call.type : \'no type\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.SOURCE">Source</p>\n          <h4 privacy ng-cloak>{{vm.call.source ? vm.call.source : \'unknown\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.DESTINATION">Destination</p>\n          <h4 privacy ng-cloak>{{vm.call.destination ? vm.call.destination : \'unknown\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.STARTEDAT">Started At</p>\n          <h4>{{vm.call.starttime | date:\'medium\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.ANSWEREDAT">Answered At</p>\n          <h4>{{vm.call.answertime ? (vm.call.answertime | date:\'medium\') : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.ENDEDAT">Ended At</p>\n          <h4>{{vm.call.endtime ? (vm.call.endtime | date:\'medium\') : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.DURATION">Duration</p>\n          <h4>{{vm.call.duration ? vm.call.duration : \'--\'}}s</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.BILLABLESECONDS">Billable Seconds</p>\n          <h4>{{vm.call.billableseconds ? vm.call.billableseconds : \'--\'}}s</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.DISPOSITION">Disposition</p>\n          <h4>{{vm.call.userDisposition ? vm.call.userDisposition : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n          <h4>{{vm.call.userSecondDisposition ? vm.call.userSecondDisposition : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n          <h4>{{vm.call.userThirdDisposition ? vm.call.userThirdDisposition : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.NOTE">Note</p>\n          <h4>{{vm.call.note ? vm.call.note : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n    </md-list>\n  </md-dialog-content>\n\n  <md-dialog-actions layout="row" layout-align="space-between center">\n    <md-button type="button" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="DISPOSE" translate="VOICE.CLOSE" translate-attr-aria-label="VOICE.DISPOSE">\n      CLOSE\n    </md-button>\n  </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/home/whatsapp/agent.general.whatsapp.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.WHATSAPP_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getWhatsappInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getWhatsappInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getWhatsappInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.whatsappAccounts.rows && vm.whatsappAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeWhatsappInteraction($event, whatsappAccount)">\n              {{ whatsappAccount.name }} ({{ whatsappAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.whatsappInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.whatsappInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="whatsappAccount">\n            {{ vm.getWhatsappAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showWhatsappInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Whatsapp\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadWhatsappInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n                    Download Whatsapp\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappInteractions.count}}" md-on-paginate="vm.getWhatsappInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/iframe/agent.general.iframe.html",'<md-content layout="row" layout-fill>\n\n  <div flex layout="row">\n\n    <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="width: 100%; height: 100%; border:0px;"></iframe>\n\n  </div>\n\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",'<md-dialog id="agent-general-dialog" aria-label="Spy Dialog">\n  <div id="interaction-app" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"></div>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n  <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html\'"></div>\n\n  <div ng-if="vm.showInteraction" flex layout="row">\n\n    <md-card flex="75" class="interaction">\n\n      <md-content class="interaction-agents" layout="row" layout-align="start center" ng-if="!vm.interaction.closed && vm.interaction.Users.length">\n        <strong layout-margin translate="DASHBOARDS.CURRENTLY_IN_USE_BY">Currently in use by </strong>\n\n        <div ng-repeat="u in vm.interaction.Users">\n          <img class="avatar-small" ng-src="api/users/{{u.id}}/avatar">\n          <md-tooltip> {{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersMap[u.id] | translate }}\n          </md-tooltip>\n        </div>\n      </md-content>\n\n      \x3c!-- TOOLBAR --\x3e\n      <md-toolbar class="interaction-toolbar" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html\'">\n      </md-toolbar>\n      \x3c!-- / TOOLBAR --\x3e\n\n      \x3c!-- CONTENT --\x3e\n      <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex layout-wrap>\n        <div class="interaction-messages" ng-switch="vm.tab.channel">\n          <div ng-switch-when="mail">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html\'">\n            </div>\n          </div>\n          <div ng-switch-default>\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html\'">\n            </div>\n          </div>\n        </div>\n      </md-content>\n      \x3c!-- / CONTENT --\x3e\n\n      \x3c!-- FOOTER --\x3e\n      <div ng-if="\n            !vm.interaction.closed && ( vm.tab.channel == \'chat\' \n            || (vm.tab.channel == \'openchannel\' && vm.account.replyUri) \n            || (vm.tab.channel == \'sms\' && !vm.tab.spy) \n            || (vm.tab.channel == \'whatsapp\' && !vm.tab.spy) )\n             && (vm.user.role !== \'admin\' && vm.user.role !== \'user\')" class="interaction-footer flex-noshrink" layout="row" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html\'">\n      </div>\n      \x3c!-- / FOOTER--\x3e\n    </md-card>\n\n    <md-card layout="column" flex class="info" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html\'">\n    </md-card>\n  </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/chat/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="CHAT.SEND">SEND</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n            <span translate="CHAT.ADD_NOTE">Add note</span>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="CHAT.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to">\n        <label translate="CHAT.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'CHAT.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n      <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'CHAT.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n        <md-item-template>\n          <md-icon ng-if="!item.ChatAccountId" md-font-icon="icon-earth" aria-label="alert chat" class="s16"></md-icon>\n          <md-icon ng-if="item.ChatAccountId" md-font-icon="icon-message-text" aria-label="alert chat" class="s16 orange-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n        </md-item-template>\n\n        <md-not-found>\n          <span translate="CHAT.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="FAX.SEND">SEND</span>\n          </md-button>\n          <md-button ng-disabled="vm.message.attachments.length === 1" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n            <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n          </md-button>\n        </div>\n        <span class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="FAX.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block to">\n        <label translate="FAX.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete ng-hide="vm.message.to.length === 1" md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.fax" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" ng-if="composeForm.$dirty">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n          <div ng-message="md-max-chips">You reached the maximum amount of chips</div>\n        </div>\n      </md-input-container>\n      <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n        <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n          <div>\n            <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            <span class="filename">{{attachment.name}}</span>\n            <span class="size">({{attachment.size | byteFmt: 0}})</span>\n          </div>\n          <md-button class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="FAX.DELETE_ATTACHMENT">\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message" ng-class="{\'mail-no-secret\': !vm.secret}" ng-cloak>\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar ng-class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <div ng-if="!vm.secret" class="md-button md-raised blue-bg no-padding">\n            <button class="white-fg margin-horizontal-10" aria-label="Send message" ng-disabled="!vm.verifySmtp" ng-click="vm.send($event, false, null)">\n              <span>{{ \'MAIL.SEND\' | translate | uppercase }}</span>\n            </button>\n            <span class="white-fg secondary-text vertical-divider"></span>\n            <md-menu>\n              <button ng-disabled="!vm.verifySmtp" class="white-fg margin-left-0" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-menu-down" class="icon s24"></md-icon>\n              </button>\n              <md-menu-content width="2">\n                <md-menu-item ng-if="vm.subStatuses.rows.length">\n                  <md-menu>\n                    <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.SEND_AS">\n                      Send as\n                    </md-button>\n                    <md-menu-content>\n                      <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n                        <md-button ng-click="vm.send($event, false, subStatus.name)">\n                          {{subStatus.name}}\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.send($event, true, null)" translate="MAIL.SEND_AND_CLOSE">\n                    Send and Close\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </div>\n          <md-button ng-if="!vm.secret" class=" md-button md-raised blue-bg white-fg margin-horizontal-10" aria-label="Save draft" ng-click="vm.saveDraft()">\n            <span>{{ (vm.isDraft ? \'DASHBOARDS.UPDATE_DRAFT\' : \'DASHBOARDS.SAVE_AS_DRAFT\') | translate | uppercase }}</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="MAIL.ADD_NOTE">Add note</span>\n          </md-button>\n          <md-button ng-disabled="!vm.verifySmtp" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload($files)" flow-init="vm.ngFlowOptions" flow-file-success="vm.fileSuccess($file, $message)" flow-file-added="vm.fileAdded($file)">\n            <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="MAIL.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to" ng-class="{\'hidden-cc\': vm.hiddenCC, \'hidden-bcc\': vm.hiddenBCC}">\n        <label translate="MAIL.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.to)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.email" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n        <div class="cc-bcc" layout="row" layout-align="start center">\n          <div class="show-cc" ng-show="vm.hiddenCC" ng-click="vm.hiddenCC = false">CC</div>\n          <div class="show-bcc" ng-show="vm.hiddenBCC" ng-click="vm.hiddenBCC = false">BCC</div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenCC">\n        <label translate="MAIL.CC">Cc</label>\n        <md-chips name="cc" ng-model="vm.message.cc" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.cc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n          <md-autocomplete md-search-text="vm.searchCc" md-items="contact in vm.contactSearch(vm.searchCc)" md-item-text="contact.email" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n      </md-input-container>\n      <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenBCC">\n        <label translate="MAIL.BCC">Bcc</label>\n        <md-chips name="bcc" ng-model="vm.message.bcc" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.bcc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n          <md-autocomplete md-search-text="vm.searchBcc" md-items="contact in vm.contactSearch(vm.searchBcc)" md-item-text="contact.email" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n      </md-input-container>\n      <md-input-container ng-if="!vm.secret" class="md-block no-margin">\n        <label translate="MAIL.SUBJECT">Subject</label>\n        <input ng-model="vm.message.subject" type="text" ng-keypress="vm.keyPress($event)">\n      </md-input-container>\n      <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n        <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n          <div>\n            <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            <span class="filename">{{attachment.name}}</span>\n            <span class="size" ng-if="attachment.size">({{attachment.size | byteFmt: 0}})</span>\n          </div>\n          <md-button ng-click="vm.removeAttachment(attachment)" class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="MAIL.DELETE_ATTACHMENT">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="padding-top-5">\n        <textarea ckeditor="vm.ckeditor" id="html-area" ng-model="vm.message.body" md-select-on-focus="" ready="vm.onReadyEditor()"></textarea>\n      </div>\n      <md-switch ng-if="!vm.message.showLastMessage && !vm.secret" ng-model="vm.message.showLastMessage" ng-change="vm.loadLastMessage()" aria-label="load last message"><span translate="MAIL.SHOW_ORIGINAL_MESSAGE">Show original message</span></md-switch>\n      <md-autocomplete ng-if="!vm.secret" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'MAIL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin" ng-keypress="vm.keyPress($event)">\n        <md-item-template>\n          <md-icon ng-if="!item.MailAccountId" md-font-icon="icon-earth" aria-label="alert email" class="s16">\n          </md-icon>\n          <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email" aria-label="alert email" class="s16 teal-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{ item.key }} -\n            {{ item.value | htmlToPlaintext }}</span>\n        </md-item-template>\n        <md-not-found>\n          <span translate="MAIL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="OPENCHANNEL.SEND">SEND</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n            <span translate="OPENCHANNEL.ADD_NOTE">Add note</span>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="OPENCHANNEL.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to">\n        <label translate="OPENCHANNEL.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mapkey" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'OPENCHANNEL.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n      <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'OPENCHANNEL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n        <md-item-template>\n          <md-icon ng-if="!item.OpenchannelAccountId" md-font-icon="icon-earth" aria-label="alert openchannel" class="s16"></md-icon>\n          <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-message-text" aria-label="alert openchannel" class="s16 orange-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n        </md-item-template>\n        <md-not-found>\n          <span translate="OPENCHANNEL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="SMS.SEND">SEND</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n            <span translate="SMS.ADD_NOTE">Add note</span>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="SMS.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to">\n        <label translate="SMS.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'SMS.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n      <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'SMS.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n        <md-item-template>\n          <md-icon ng-if="!item.SmsAccountId" md-font-icon="icon-earth" aria-label="alert sms" class="s16"></md-icon>\n          <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text" aria-label="alert sms" class="s16 orange-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n        </md-item-template>\n        <md-not-found>\n          <span translate="SMS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="WHATSAPP.SEND">SEND</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n            <span translate="WHATSAPP.ADD_NOTE">Add note</span>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="WHATSAPP.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to">\n        <label translate="WHATSAPP.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'WHATSAPP.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n      <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'WHATSAPP.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n        <md-item-template>\n          <md-icon ng-if="!item.WhatsappAccountId" md-font-icon="icon-earth" aria-label="alert whatsapp" class="s16">\n          </md-icon>\n          <md-icon ng-if="item.WhatsappAccountId" md-font-icon="icon-message-text" aria-label="alert whatsapp" class="s16 orange-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n        </md-item-template>\n        <md-not-found>\n          <span translate="WHATSAPP.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition" ng-init="vm.onInit()">\n  <form name="dispositionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span ng-if="!vm.interaction.closed" class="title" translate="DASHBOARDS.DISPOSE"></span>\n        <span ng-if="vm.interaction.closed" class="title" translate="DASHBOARDS.INFO"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" ng-if="!vm.mandatoryDisposition">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n        <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n          <md-option ng-value="null" ng-if="!vm.mandatoryDisposition">NONE</md-option>\n          <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n            {{ disposition.name }}</md-option>\n        </md-select>\n        <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n        <md-input-container class="md-block" flex>\n          <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n          <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n              {{ disposition.name }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n          <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n          </md-icon>\n        </md-button>\n      </div>\n      <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n        <md-input-container class="md-block" flex>\n          <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n          <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition">\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n          <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n          </md-icon>\n        </md-button>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="DASHBOARDS.NOTE">Note</label>\n        <textarea ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveDisposition()" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && (vm.firstLevelDisposition || vm.secondLevelDisposition || vm.thirdLevelDisposition)" aria-label="CLOSE_AND_DISPOSE" translate="DASHBOARDS.CLOSE_AND_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_AND_DISPOSE">\n          CLOSE AND DISPOSE\n        </md-button>\n        <md-button type="submit" ng-click="vm.saveDisposition(false)" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && !vm.firstLevelDisposition" ng-disabled="vm.mandatoryDisposition" aria-label="CLOSE_WITHOUT_DISPOSE" translate="DASHBOARDS.CLOSE_WITHOUT_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_WITHOUT_DISPOSE">\n          CLOSE WITHOUT DISPOSE\n        </md-button>\n        <md-button type="submit" ng-click="vm.saveDisposition()" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="vm.interaction.closed" ng-disabled="vm.mandatoryDisposition && !vm.firstLevelDisposition" aria-label="DISPOSE" translate="DASHBOARDS.DISPOSE" translate-attr-aria-label="DASHBOARDS.DISPOSE">\n          DISPOSE\n        </md-button>\n        <div ng-if="vm.mandatoryDisposition">\n          <md-icon md-font-icon="icon-information-outline" aria-label="Mandatory Disposition"></md-icon>\n          <span class="no-margin font-size-12 line-height-30" translate="DASHBOARDS.HELP.MANDATORY_DISPOSITION_ENABLED"></span>\n        </div>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",'<md-dialog class="tag-dialog" aria-label="tag">\n  <form name="tagForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="DASHBOARDS.TAGS"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <md-chips ng-model="vm.interaction.Tags" md-autocomplete-snap md-require-match="vm.autocompleteRequireMatch">\n          <md-autocomplete ng-blur="vm.searchText = \'\'" md-min-length="0" md-selected-item-change="vm.selectedItemChange" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="item in vm.tags.rows | filter:{ name: vm.searchText }" md-item-text="item.name" placeholder="Search for a tag">\n            <span md-highlight-text="vm.searchText">{{item.name}}</span>\n          </md-autocomplete>\n          <md-chip-template>\n            <span>\n              <strong>{{$chip.name}}</strong>\n            </span>\n          </md-chip-template>\n        </md-chips>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveTag(false)" ng-disabled="tagForm.$pristine" class="send-button md-accent md-raised" aria-label="TAG" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n  <form name="transferForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="DASHBOARDS.TRANSFER"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog(false)">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="DASHBOARDS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.transfer.type">\n          <md-option ng-value="\'queue\'" ng-if="vm.account.queueTransfer">Queue</md-option>\n          <md-option ng-value="\'agent\'" ng-if="vm.account.agentTransfer">Agent</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.transfer.type === \'queue\'">\n        <label translate="DASHBOARDS.QUEUES">Queues</label>\n        <md-select name="queue" ng-model="vm.transfer.id" required>\n          <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="transferForm.queue.$error" ng-show="transferForm.queue.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="DASHBOARDS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.transfer.type === \'agent\'">\n        <label translate="DASHBOARDS.AGENTS">Agents</label>\n        <md-select name="agent" ng-model="vm.transfer.id" required>\n          <md-option ng-value="agent.id" ng-repeat="agent in vm.agents.rows">{{\n            agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="transferForm.agent.$error" ng-show="transferForm.agent.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="DASHBOARDS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.onTransfer(true)" ng-disabled="transferForm.$pristine" class="send-button md-accent md-raised" aria-label="DASHBOARDS.TRANSFER" translate="DASHBOARDS.TRANSFER" translate-attr-aria-label="DASHBOARDS.TRANSFER">\n          TRANSFER\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html",'\x3c!-- REPLY FORM --\x3e\n<div ng-show="vm.showFooter" layout="column" layout-align="center center" flex>\n  <div layout="row" layout-align="center center" style="flex-grow: 1; align-self: stretch" flex>\n    \x3c!-- msEmojyArea directive --\x3e\n    <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.tab.areaText" placeholder="vm.tab.channel.toUpperCase() + \'.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n    \x3c!-- / msEmojyArea directive --\x3e\n\n    <div layout="row" layout-align="end center">\n      <md-button ng-if="vm.tab.channel != \'fax\'" style="margin:1px;" class="md-icon-button md-mini" ng-click="vm.changeDisplayCannedAnswerInputValue()" aria-label="Search canned answer" translate translate-attr-aria-label="DASHBOARDS.SEND_MESSAGE">\n        <md-icon md-font-icon="icon-auto-fix" class="green-fg"></md-icon>\n      </md-button>\n\n      <md-button ng-if="vm.tab.channel == \'openchannel\' || vm.tab.channel == \'chat\' || vm.tab.channel == \'fax\'" style="margin:1px;" class="md-icon-button md-warn md-mini" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n        <md-icon md-font-icon="icon-paperclip"></md-icon>\n      </md-button>\n    </div>\n  </div>\n\n  <md-autocomplete ng-hide="!vm.displayCannedAnswerInput" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" placeholder="{{ \'DASHBOARDS.CANNED_ANSWER_SEARCH\' | translate}}" class="cannedarea input-show-hide">\n    <md-item-template>\n      <md-icon ng-if="!item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="icon-earth" aria-label="alert channel" class="s16"></md-icon>\n      <md-icon ng-if="item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" aria-label="alert channel" class="s16" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n      <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n    </md-item-template>\n\n    <md-not-found>\n      <span translate="DASHBOARDS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n    </md-not-found>\n  </md-autocomplete>\n</div>\n\x3c!-- / REPLY FORM --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html",'<div ng-init="item = item || vm.interaction">\n  <md-list-item class="md-2-line" ng-if="item.browserName">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.BROWSER_NAME">Browser Name</p>\n      <h4>{{ item.browserName }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.osName">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.OS_NAME">OS Name</p>\n      <h4>{{ item.osName }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.deviceModel">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.DEVICE_MODEL">Device Model</p>\n      <h4>{{ item.deviceModel }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.referer">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.REFERER">Referer</p>\n      <h4>{{ item.referer }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.customerIp">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CUSTOMER_IP">Originating IP Address</p>\n      <h4>{{ item.customerIp }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.customerPort">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CUSTOMER_PORT">Originating TCP Port</p>\n      <h4>{{ item.customerPort }}</h4>\n    </div>\n  </md-list-item>\n  <md-divider ng-if="item.closed && item.ratingValue != null || item.ratingMessage"></md-divider>\n  <md-list-item class="md-2-line" ng-if="item.closed && item.ratingValue != null">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.RATING">Rating</p>\n      <md-icon md-font-icon="icon-star" style="color:red" ng-show="!item.ratingType || item.ratingType == \'star\'" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:item.ratingValue"></md-icon>\n      <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 1"></md-icon>\n      <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 0"></md-icon>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.ratingMessage">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.FEEDBACK">Feedback</p>\n      <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.ratingMessage }}</h4>\n    </div>\n  </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html",'<md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.CONTACT">Contact</span>\n    </md-tab-label>\n    <md-tab-body>\n      <md-content class="md-padding">\n        <form name="contactForm" class="md-inline-form" novalidate>\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-account"></md-icon>\n            <label translate="DASHBOARDS.NAME">Name</label>\n            <input type="text" name="firstName" ng-model="vm.contact.firstName" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-email"></md-icon>\n            <label translate="DASHBOARDS.EMAIL">Email</label>\n            <input type="email" name="email" ng-model="vm.contact.email" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n            <label translate="DASHBOARDS.PHONE">Phone</label>\n            <input type="text" name="phone" ng-model="vm.contact.phone" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n            <label translate="DASHBOARDS.MOBILE">Mobile</label>\n            <input type="text" name="mobile" ng-model="vm.contact.mobile" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-deskphone"></md-icon>\n            <label translate="DASHBOARDS.FAX">Fax</label>\n            <input type="text" name="fax" ng-model="vm.contact.fax" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <div ng-if="!vm.tab.spy" layout="row" layout-align="center center">\n            <md-button class="md-raised md-accent" ng-click="vm.openContact(ev)" translate="DASHBOARDS.MORE">\n              More\n            </md-button>\n          </div>\n        </form>\n      </md-content>\n    </md-tab-body>\n  </md-tab>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.INTERACTION">Interaction</span>\n    </md-tab-label>\n    <md-tab-body>\n      <div layout="column" layout-align="space-between center" class="md-padding">\n        <md-icon class="s42" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n        <span ng-if="vm.interaction.closed" class="md-background-bg red-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.CLOSED"></span></span>\n        <span ng-if="!vm.interaction.closed" class="md-background-bg green-fg font-size-14">#{{vm.interaction.id}} -\n          <span translate="DASHBOARDS.OPENED"></span></span>\n        <span ng-if="!vm.interaction.closed && vm.interaction.substatus" class="md-background-bg green-fg font-size-14">{{vm.interaction.substatus}}</span>\n      </div>\n      <md-divider></md-divider>\n      <md-list flex>\n        <md-list-item class="md-2-line">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.WEBSITE" ng-if="vm.tab.channel == \'chat\'">Website</p>\n            <p translate="DASHBOARDS.ACCOUNT" ng-if="vm.tab.channel != \'chat\'">Account</p>\n            <h4>{{vm.account.name}}</h4>\n          </div>\n        </md-list-item>\n\n        <md-list-item class="md-2-line">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.AGENT">Agent</p>\n            <h4>{{vm.agent.fullname || vm.usersMap[vm.interaction.UserId]}}</h4>\n          </div>\n        </md-list-item>\n\n        <md-list-item class="md-2-line" ng-if="vm.interaction.externalUrl">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n            <a href="{{vm.interaction.externalUrl}}" target="_blank">\n              <h4>{{vm.interaction.externalUrl}}</h4>\n            </a>\n          </div>\n        </md-list-item>\n\n        <md-list-item class="md-2-line">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n            <h4>{{vm.interaction.createdAt | date: \'medium\'}}</h4>\n          </div>\n        </md-list-item>\n\n        <div ng-switch="vm.tab.channel">\n          <div ng-switch-when="chat">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'">\n            </div>\n          </div>\n          <div ng-switch-when="mail">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'">\n            </div>\n          </div>\n          <div ng-switch-when="openchannel">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html\'">\n            </div>\n          </div>\n        </div>\n\n        <md-list-item class="md-2-line" ng-if="vm.interaction.Tags.length">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.TAGS">Tags</p>\n            <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n              <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n                <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n                <div class="tag-label">{{tag.name}}</div>\n              </div>\n            </div>\n          </div>\n        </md-list-item>\n\n        <md-divider ng-if="vm.interaction.closed"></md-divider>\n\n        <md-list-item class="md-2-line" ng-if="vm.interaction.closed">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n            <h4>{{vm.interaction.closedAt | date: \'medium\'}}</h4>\n          </div>\n        </md-list-item>\n        <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.disposition">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n            <h4>{{ vm.interaction.disposition }}</h4>\n          </div>\n        </md-list-item>\n        <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.secondDisposition">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n            <h4>{{ vm.interaction.secondDisposition }}</h4>\n          </div>\n        </md-list-item>\n        <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.thirdDisposition">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n            <h4>{{ vm.interaction.thirdDisposition }}</h4>\n          </div>\n        </md-list-item>\n        <md-list-item class="md-3-line md-long-text" ng-if="vm.interaction.closed && vm.interaction.note">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.NOTE">NOTE</p>\n            <h4 style="overflow-wrap: break-word; white-space: normal">{{ vm.interaction.note }}</h4>\n          </div>\n        </md-list-item>\n      </md-list>\n    </md-tab-body>\n  </md-tab>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Journey</span>\n    </md-tab-label>\n    <md-tab-body>\n      <md-content class="md-padding">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n        </div>\n      </md-content>\n    </md-tab-body>\n  </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html",'<md-divider></md-divider>\n<md-list flex>\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.AGENT">Agent</p>\n      <h4>{{ vm.agent.fullname || vm.usersMap[item.UserId] || \'DASHBOARDS.NOT_ASSIGNED\' | translate }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.externalUrl">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n      <a href="{{ item.externalUrl }}" target="_blank">\n        <h4>{{ item.externalUrl }}</h4>\n      </a>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n      <h4>{{ item.createdAt | date: \'medium\' }}</h4>\n    </div>\n  </md-list-item>\n  <div ng-if="item.channel === \'chat\'">\n    <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'">\n    </div>\n  </div>\n  <div ng-if="item.channel === \'mail\'">\n    <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'">\n    </div>\n  </div>\n  <md-divider ng-if="item.closed"></md-divider>\n  <md-list-item class="md-2-line" ng-if="item.closed">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n      <h4>{{ item.closedAt | date: \'medium\' }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.closed && item.disposition">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n      <h4>{{ item.disposition }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.closed && item.secondDisposition">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n      <h4>{{ item.secondDisposition }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.closed && item.thirdDisposition">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n      <h4>{{ item.thirdDisposition }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-3-line md-long-text" ng-if="item.closed && item.note">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.NOTE">NOTE</p>\n      <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.note }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item ng-if="item.Tags.length">\n    <p class="padding-horizontal-15 grey-fg">Tags</p>\n    <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n      <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in item.Tags">\n        <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n        <div class="tag-label">{{ tag.name }}</div>\n      </div>\n    </div>\n  </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html",'<div layout-margin layout="row" layout-align="center center">\n  <ms-quick-filter filters="vm.quickFilters" query="vm.journeyOptions" search="vm.getCustomerJourney()">\n  </ms-quick-filter>\n</div>\n\n<md-content id="journey-content" flex layout-wrap>\n  <div ng-if="vm.journeyIsLoading" layout="row" layout-align="center center">\n    <md-progress-circular class="md-accent" md-diameter="48" md-mode="indeterminate"></md-progress-circular>\n  </div>\n  <div id="timeline" layout="column" ng-if="vm.journey && vm.journey.length && !vm.journeyIsLoading" ms-timeline="vm.journeyTimelineOptions" ms-timeline-load-more="vm.loadMoreJourney()">\n    \x3c!-- TIMELINE ITEM --\x3e\n    <div class="ms-timeline-item" layout-align="center center" ng-repeat="item in vm.journey">\n      <div class="timeline-card">\n        <md-card class="channel" ng-class="{\'md-grey-200-bg\': item.id == vm.interaction.id}">\n          <div layout="row" layout-align="space-between center">\n            <div class="header p-6" layout="row" layout-align="start center" ng-cloak>\n              <md-button class="md-fab md-mini no-click" aria-label="icon-channel" ng-class="{{ \'item.style.color\' }} + \'-bg\'">\n                <md-icon md-font-icon="{{ item.style.icon }}"></md-icon>\n              </md-button>\n              <div class="info" layout="column" ng-init="item.showMore = false">\n                <span class="font-size-12 text-truncate" ng-if="item.destination">\n                  #{{item.id}} - <span privacy ng-cloak>{{ item.destination }}</span>\n                </span>\n                <span class="font-size-12 text-truncate" ng-if="!item.destination">\n                  #{{item.id}} - {{ item.Account.key }}\n                </span>\n                <span class="font-size-10">{{item.createdAt | date: \'medium\'}}</span>\n                <span>\n                  <a class="toggle-details md-accent-color" ng-click="item.showMore = !item.showMore" translate="{{ item.showMore ? \'DASHBOARDS.HIDE_DETAILS\' : \'DASHBOARDS.SHOW_DETAILS\' }}">\n                  </a>\n                </span>\n              </div>\n            </div>\n            <span>\n              <img ng-if="item.UserId" class="avatar" ng-src="api/users/{{item.UserId}}/avatar">\n              <md-tooltip md-direction="left">{{item.Owner.fullname || item.User.fullname}}</md-tooltip>\n            </span>\n          </div>\n          <div ng-if="item.showMore">\n            <div ng-if="item.channel !== \'voice\'" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html\'">\n            </div>\n            <div ng-if="item.channel === \'voice\'" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html\'">\n            </div>\n          </div>\n          <md-divider></md-divider>\n          <div ng-if="item.id != vm.interaction.id" layout="row" layout-align="space-around center">\n            <div ng-if="item.closed && item.channel !== \'voice\'" class="text-truncate text-boxed-light">\n              <span class="red-fg" title="{{ \'DASHBOARDS.STATUS\' | translate}} : {{ \'DASHBOARDS.CLOSED\' | translate }} {{ item.dispositionsValues }}">\n                {{ \'DASHBOARDS.STATUS\' | translate}} : {{ \'DASHBOARDS.CLOSED\' | translate}} {{ item.dispositionsValues\n                }}\n              </span>\n            </div>\n            <span class="text-boxed md-background-bg green-fg" ng-if="!item.closed && item.channel !== \'voice\'" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}">\n              {{ \'DASHBOARDS.STATUS\' | translate}}:\n              {{ \'DASHBOARDS.OPENED\' | translate}}\n              <span ng-if="item.substatus"> - {{ item.substatus }}</span>\n            </span>\n            <span ng-if="item.channel === \'voice\'" class="text-boxed md-background-bg red-fg" title="{{ item.userDisposition ? (\'DASHBOARDS.DISPOSITION\' | translate) + \':\' : \'\'}} {{ item.userDisposition ?\n                item.userDisposition : (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }}">\n              {{ item.userDisposition ? (\'DASHBOARDS.DISPOSITION\' | translate) + \':\' : \'\'}} {{ item.userDisposition ?\n              item.userDisposition : (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }}\n            </span>\n            <span ng-if="item.channel === \'voice\' && item.userSecondDisposition" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}: {{ item.userSecondDisposition }}">\n              {{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:\n              {{ item.userSecondDisposition }}\n            </span>\n            <span ng-if="item.channel === \'voice\' && item.userThirdDisposition" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}: {{ item.userThirdDisposition }}">\n              {{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:\n              {{ item.userThirdDisposition }}\n            </span>\n            <div flex></div>\n            <md-button ng-if="!vm.tab.spy && vm.user.role === \'agent\' && item.canOpen && item.channel !== \'voice\'" class="md-icon-button" aria-label="go" ng-click="vm.openInteraction(item)">\n              <md-icon md-font-icon="icon-open-in-new" class="s20"></md-icon>\n            </md-button>\n          </div>\n        </md-card>\n      </div>\n    </div>\n\n    <div ng-if="vm.canLoadMoreJourney" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row keep-on-top">\n      <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-click="vm.loadMoreJourney()" translate="DASHBOARDS.MORE">\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / TIMELINE ITEM --\x3e\n</md-content>\n\n<div ng-if="!vm.journey || vm.journey.length === 0" layout="row" layout-align="center center">\n  <em translate="DASHBOARDS.NO_DATA_AVAILABLE">No data available</em>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html",'<md-divider></md-divider>\n\n<md-list flex>\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.TYPE">Type</p>\n      <h4>{{ item.type ? item.type : \'no type\' }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.SOURCE">Source</p>\n      <h4 privacy ng-cloak>{{ item.source ? item.source : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.DESTINATION">Destination</p>\n      <h4 privacy ng-cloak>{{ item.destination ? item.destination : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.UNIQUEID">Uniqueid</p>\n      <h4>{{ item.uniqueid ? item.uniqueid : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CALLERID">Caller Id</p>\n      <h4 privacy ng-cloak>{{ item.callerid ? item.callerid : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.STARTEDAT">Started At</p>\n      <h4>{{ item.starttime | date:\'medium\' }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.END_AT">End At</p>\n      <h4>{{ item.endtime | date:\'medium\' }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.DURATION">Duration</p>\n      <h4>{{ item.duration ? item.duration : \'--\' }}s</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.NOTE">Note</p>\n      <h4>{{ item.note ? item.note : \'--\' }}</h4>\n    </div>\n  </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html",'<div ng-init="item = item || vm.interaction">\n  <md-list-item class="md-2-line" ng-if="item.subject">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.SUBJECT">Subject</p>\n      <h4>{{ item.subject }}</h4>\n    </div>\n  </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html",'<div ng-init="item = item || vm.interaction">\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.VISIBILITY">Visibility</p>\n      <h4 translate="{{ item.threadId ? \'DASHBOARDS.PUBLIC\' : \'DASHBOARDS.PRIVATE\'}}"></h4>\n    </div>\n  </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html",'\x3c!-- MESSAGES --\x3e\n<div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n  <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n  <img ng-if="message.direction ===\'out\' && message.UserId && !message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n  <img ng-if="message.direction ===\'out\' && message.UserId && message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n  <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n  <md-button ng-if="vm.tab.channel === \'fax\'" class="md-fab md-mini no-margin" aria-label="Download" ng-click="vm.downloadMessage(message)">\n    <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n  </md-button>\n\n  <div class="bubble" ng-class="{\'md-yellow-200-bg\': message.secret}" ng-switch="message.direction">\n    <div ng-if="message.secret">\n      <div class="time secondary-text" layout="row" layout-align="end center">\n        <div layout-padding>\n          <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n          <span> - {{message.createdAt | date: \'medium\'}}</span>\n        </div>\n        <div ng-if="message.id">\n          <md-icon class="s18" md-font-icon="icon-lock"></md-icon>\n        </div>\n      </div>\n    </div>\n    <div ng-if="!message.secret">\n      <div ng-switch-when="in" class="time secondary-text" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n        <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n        <span> - {{message.createdAt | date: \'medium\'}}</span>\n      </div>\n      <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n        <div layout-padding>\n          <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n          <span> - {{message.createdAt | date: \'medium\'}}</span>\n        </div>\n        <div ng-if="message.id && vm.tab.channel !== \'fax\'">\n          <md-icon ng-if="!message.read" class="s18" md-font-icon="icon-check"></md-icon>\n          <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n        </div>\n        <div ng-if="message.id && vm.tab.channel === \'fax\'">\n          <md-icon ng-if="!message.read && !(message.failMessage )" class="s18" md-font-icon="icon-check"></md-icon>\n          <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n          <span ng-if="!message.read && message.failMessage" class="s18 red-900-fg"> {{ message.failMessage }}</span>\n          <md-icon ng-if="!message.read && message.failMessage" class="s18 red-900-fg" md-font-icon="icon-close md-accent"></md-icon>\n        </div>\n      </div>\n    </div>\n    <div ng-if="message.AttachmentId" layout="row" layout-align="end center">\n      <md-button ng-if="vm.downloadPermissions.attachments" class="md-raised md-accent" ng-click="vm.getAttachment({id: message.AttachmentId, name: vm.htmlToPlaintext(message.body)})">\n        <span>{{vm.htmlToPlaintext(message.body)}}</span>\n        <md-icon md-font-icon="icon-download"></md-icon>\n      </md-button>\n      <div ng-if="!vm.downloadPermissions.attachments" class="disabled-button">\n        <span>{{vm.htmlToPlaintext(message.body)}}</span>\n        <md-icon md-font-icon="icon-download"></md-icon>\n      </div>\n    </div>\n    <div ng-if="!message.AttachmentId" class="message" layout="row" layout-align="end center">\n      <span ng-bind-html="message.body | embed: vm.embedOptions"></span>\n    </div>\n  </div>\n</div>\n\x3c!-- / MESSAGES --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html",'<div ms-timeline="vm.interactionTimelineOptions" ms-timeline-load-more="vm.loadNextPage()">\n  <div ng-repeat="message in vm.messages.rows track by message.id" ng-init="vm.selectedMailShowSystemMessage[message.id] = false">\n    <md-card ng-if="message.secret" class="md-padding md-yellow-100-bg" layout="column">\n      <div layout="row" layout-align="start center">\n        <img class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n        <div layout="column">\n          <span class="grey-fg">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n          <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n        </div>\n      </div>\n      <div layout="row" layout-align="center center" layout-fill ng-if="message.attach && vm.downloadPermissions.attachments">\n        <div flex>\n          <md-divider></md-divider>\n        </div>\n        <md-menu>\n          <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n            <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span>\n            </md-tooltip>\n            <div layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon>\n              <span>{{message.attach}}</span>\n            </div>\n          </md-button>\n          <md-menu-content width="4">\n            <div layout="column" layout-align="center center" ng-if="!message.attachments">\n              <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n              <span translate="MAIL.ATTACHMENTS">Attachments</span>\n            </div>\n            <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n              <md-button ng-click="vm.getAttachment(attachment)">\n                {{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n        <div flex>\n          <md-divider></md-divider>\n        </div>\n      </div>\n      <div class="padding-top-5" ng-bind-html-unsafe="message.body"></div>\n    </md-card>\n    <div ng-if="!message.secret">\n      <div layout="row" layout-align="center center" ng-if="message.direction == \'out\' && !message.UserId && !vm.selectedMailShowSystemMessage[message.id]">\n        <md-button class="md-raised blue-grey-300-bg white-fg" ng-click="vm.selectedMailShowSystemMessage[message.id] = !vm.selectedMailShowSystemMessage[message.id]">\n          [{{message.createdAt | date: \'medium\'}}] {{ \'MAIL.SHOW_AUTOREPLY\' | translate }}</md-button>\n      </div>\n      <md-card layout="column" class="md-padding message-row" ng-if="message.direction == \'in\' || (message.direction == \'out\' && (message.UserId || vm.selectedMailShowSystemMessage[message.id]))">\n        <md-content class="mail-content">\n          <div class="info" layout="row" layout-align="space-between start">\n            <div layout="column" layout-align="start start">\n              <div layout="row" layout-align="start start">\n                <div layout="column" layout-align="start start">\n                  <div class="name" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n                    <strong privacy ng-cloak>{{message.from}}</strong>\n                    <md-icon ng-if="message.attach" md-font-icon="icon-paperclip" class="s16">\n                    </md-icon>\n                  </div>\n                  <div class="name">\n                    <div>{{message.subject}}</div>\n                  </div>\n                  <div class="name" layout="row" layout-align="start center"><span translate="MAIL.TO">To</span>: <span class="padding-left-5 subject text-truncate" privacy ng-cloak>{{ message.originTo || message.to\n                      }}</span>\n                  </div>\n                  <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.originCc && message.originCc.indexOf(vm.account.email) >= 0">\n                    <em><span class="blue-grey" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are\n                        registered as a</span> <span class="blue-grey">CC</span></em>\n                  </div>\n                  <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.bcc && message.bcc.indexOf(vm.account.email) >= 0">\n                    <em><span class="red-fg" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are\n                        registered as a</span> <span class="red-fg">BCC</span></em>\n                  </div>\n                </div>\n              </div>\n\n              <a class="toggle-details md-accent-color" ng-hide="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.SHOW_DETAILS">\n                Show Details\n              </a>\n              <a class="toggle-details md-accent-color" ng-show="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.HIDE_DETAILS">\n                Hide Details\n              </a>\n              <div ng-show="vm.selectedMailShowDetails[message.id]" class="details" layout="row" layout-align="start start">\n                <div layout="column">\n                  <span class="title" translate="MAIL.DATE">Date:</span>\n                  <span class="title" translate="MAIL.FROM">From:</span>\n                  <span class="title" translate="MAIL.TO">To:</span>\n                  \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n                  <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && message.originCc">Cc:</span>\n                  <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc">Cc:</span>\n                  <span class="title" translate="MAIL.CC" ng-if="message.direction === \'out\' && message.cc">Cc:</span>\n                  \x3c!-- End retrocompatibility --\x3e\n                  <span class="title" translate="MAIL.BCC" ng-if="message.bcc">Bcc:</span>\n                  <span class="title" translate="MAIL.ACCEPTED" ng-if="message.UserId && message.direction ===\'in\'">Accepted:</span>\n                </div>\n\n                <div layout="column">\n                  <span class="detail">{{message.createdAt | date:\'medium\'}}</span>\n                  <span class="detail" privacy ng-cloak>{{message.from}}</span>\n                  <span class="detail" privacy ng-cloak>{{message.originTo || message.to}}</span>\n                  \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n                  <span class="detail" ng-if="message.direction === \'in\' && message.originCc" privacy ng-cloak>{{\n                    message.originCc }}</span>\n                  <span class="detail" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc" privacy ng-cloak>{{ message.cc }}</span>\n                  <span class="detail" ng-if="message.direction === \'out\' && message.cc" privacy ng-cloak>{{ message.cc\n                    }}</span>\n                  \x3c!-- End retrocompatibility --\x3e\n                  <span class="detail" ng-if="message.bcc" privacy ng-cloak>{{message.bcc}}</span>\n                  <span class="detail" ng-if="message.UserId && message.direction ===\'in\'">{{vm.usersMap[message.UserId]}}</span>\n                </div>\n              </div>\n            </div>\n\n            <div layout="row" layout-align="center center">\n              <div layout="column" layout-align="center end" class="md-padding">\n                <span class="grey-fg" ng-if="message.direction ===\'in\'" privacy>{{message.from.indexOf(vm.contact.email)\n                  >= 0 ? vm.contact.firstName + \' \' + vm.contact.lastName : \'*\' + message.from}}</span>\n                <span class="grey-fg" ng-if="message.direction ===\'out\' && message.UserId">{{vm.agent.fullname ||\n                  vm.usersMap[message.UserId]}}</span>\n                <span class="grey-fg" ng-if="message.direction ===\'out\' && !message.UserId">System</span>\n                <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n              </div>\n              <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n              <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n              <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n            </div>\n          </div>\n\n          <div layout="row" layout-align="center center" layout-fill>\n            <div flex>\n              <md-divider></md-divider>\n            </div>\n            <div>\n              <div class="interaction-reply-button-container">\n                <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DRAFT">Draft</span>\n                </md-tooltip>\n                <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="draft" ng-disabled="!vm.draft" ng-click="vm.openDraft(message.id)">\n                  <md-icon md-font-icon="icon-pencil-box" class="icon s24"></md-icon>\n                </md-button>\n              </div>\n              <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', message)">\n                <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n                <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n              </md-button>\n              <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', message)">\n                <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n              </md-button>\n              <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', message)">\n                <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n              </md-button>\n              <md-button ng-if="!message.attach && vm.downloadPermissions.interactions" class="md-icon-button" aria-label="forward" ng-click="vm.downloadMessage(message)">\n                <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n              </md-button>\n              <md-menu ng-if="message.attach && vm.downloadPermissions.interactions" class="no-margin" md-position-mode="target-right target">\n                <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n                  <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span>\n                  </md-tooltip>\n                  <md-icon md-font-icon="icon-download"></md-icon>\n                </md-button>\n                <md-menu-content width="2">\n                  <md-menu-item ng-if="vm.downloadPermissions.attachments">\n                    <md-button ng-click="vm.downloadMessage(message, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n                      Download with attachments\n                    </md-button>\n                  </md-menu-item>\n                  <md-menu-item>\n                    <md-button ng-click="vm.downloadMessage(message)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                      Download without attachments\n                    </md-button>\n                  </md-menu-item>\n                </md-menu-content>\n              </md-menu>\n              <md-menu ng-if="message.attach && vm.downloadPermissions.attachments">\n                <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n                  <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n                  <div layout="row" layout-align="start center">\n                    <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon>\n                    <span>{{message.attach}}</span>\n                  </div>\n                </md-button>\n                <md-menu-content width="4">\n                  <div layout="column" layout-align="center center" ng-if="!message.attachments">\n                    <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n                    <span translate="MAIL.ATTACHMENTS">Attachments</span>\n                  </div>\n                  <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n                    <md-button ng-click="vm.getAttachment(attachment)">\n                      {{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n                  </md-menu-item>\n                </md-menu-content>\n              </md-menu>\n            </div>\n            <div flex>\n              <md-divider></md-divider>\n            </div>\n          </div>\n\n          <md-content ng-bind-html-unsafe="message.body"></md-content>\n        </md-content>\n      </md-card>\n    </div>\n    <div ng-hide="!(vm.BTNLoadMore > 0)" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row">\n      <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-disabled="!(vm.BTNLoadMore > 0)" ng-click="vm.loadNextPage()" translate="DASHBOARDS.MORE">\n      </md-button>\n    </div>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html",'<div class="big-circle md-whiteframe-4dp">\n  <md-icon class="s128 md-accent" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n</div>\n<span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n<span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n  interaction...</span>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.chat.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeChatInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="CHAT.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeFaxInteraction(\'new\')">\n  <md-tooltip md-direction="bottom"><span translate="FAX.REPLY">Reply</span></md-tooltip>\n  <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n  <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n  <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html",'<div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n  <md-icon md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" class="s20" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n  <div class="padding-left-10" layout="column" layout-align="center start" flex>\n    <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n      <span>#{{vm.interaction.id}} - {{vm.account.key}}</span>\n      <div layout="row" layout-align="center center" class="p-8">\n        <md-icon ng-if="vm.tab.channel === \'openchannel\' && vm.interaction.threadId" md-font-icon="fas fa-users" class="s16">\n          <md-tooltip><span translate="DASHBOARDS.PUBLIC_INTERACTION">The interaction is public</span></md-tooltip>\n        </md-icon>\n        <md-icon ng-if="vm.interaction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n      </div>\n      <span class="red-fg padding-left-25" ng-if="vm.interaction.closed" translate="DASHBOARDS.CLOSED">CLOSED</span>\n      <span class="green-fg padding-left-25" ng-if="!vm.interaction.closed"><span translate="DASHBOARDS.OPENED">OPENED</span><span ng-if="vm.interaction.substatus"> -\n          {{vm.interaction.substatus}}</span></span>\n      <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40" ng-if="!vm.interaction.closed">\n        <timer start-time="vm.interaction.createdAt"></timer>\n        <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n      </div>\n    </div>\n    <div class="tags" layout="row" layout-align="start center" ng-if="vm.interaction.Tags.length" ng-class="{\'padding-top-5\': vm.interaction.Tags.length}">\n      <div class="tag margin-right-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n        <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n        <div class="tag-label">{{tag.name}}</div>\n      </div>\n    </div>\n  </div>\n  <div layout="row" layout-align="end center">\n    <div ng-switch="vm.tab.channel">\n      <div ng-switch-when="mail">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="fax">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="sms">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="whatsapp">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.whatsapp.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="chat">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.chat.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="openchannel">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.openchannel.html\'">\n        </div>\n      </div>\n    </div>\n    <md-menu ng-if="[\'fax\', \'sms\', \'whatsapp\'].indexOf(vm.tab.channel) < 0 && vm.downloadPermissions.interactions" class="no-margin" md-position-mode="target-right target">\n      <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n        <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n        <md-icon md-font-icon="icon-download"></md-icon>\n      </md-button>\n      <md-menu-content width="2">\n        <md-menu-item ng-if="vm.downloadPermissions.attachments">\n          <md-button ng-click="vm.downloadInteraction(vm.interaction, true)" translate="DASHBOARDS.DOWNLOAD_WITH_ATTACHMENTS">\n            Download with attachments\n          </md-button>\n        </md-menu-item>\n        <md-menu-item>\n          <md-button ng-click="vm.downloadInteraction(vm.interaction)" translate="DASHBOARDS.DOWNLOAD_WITHOUT_ATTACHMENTS">\n            Download without attachments\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n    <md-menu class="no-margin" ng-if="!vm.interaction.disposition" md-position-mode="target-right target">\n      <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="more">\n        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n      </md-button>\n\n      <md-menu-content width="2">\n\n        <md-menu-item ng-if="vm.tab.channel === \'chat\' && !vm.interaction.closed && !vm.tab.spy && vm.account.vidaooEscalation && vm.account.vidaooApiKey">\n          <md-button ng-click="vm.createVidaooSession(vm.interaction)" translate="DASHBOARDS.VIDAOOSESSION">\n            Start Video Call\n          </md-button>\n        </md-menu-item>\n\n        <md-menu-item>\n          <md-button ng-click="vm.tagInteraction()" translate="DASHBOARDS.TAG">\n            Tag\n          </md-button>\n        </md-menu-item>\n        <md-menu-item ng-if="vm.account.queueTransfer || vm.account.agentTransfer">\n          <md-button ng-click="vm.transferLastMessage()" translate="DASHBOARDS.TRANSFER">\n            Transfer\n          </md-button>\n        </md-menu-item>\n        <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && (vm.subStatuses.rows.length || vm.interaction.substatus != null)">\n          <md-menu>\n            <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.SET_AS">\n              Set as\n            </md-button>\n            <md-menu-content>\n              <md-menu-item ng-if="vm.interaction.substatus != null">\n                <md-button ng-click="vm.setAs(null)" translate="DASHBOARDS.NONE">\n                  None\n                </md-button>\n              </md-menu-item>\n              <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n                <md-button ng-click="vm.setAs(subStatus.name)">\n                  {{subStatus.name}}\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </md-menu-item>\n        <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && vm.account.markAsUnread">\n          <md-button ng-click="vm.markAsUnread()" translate="DASHBOARDS.MARK_AS_UNREAD">\n            Unread\n          </md-button>\n        </md-menu-item>\n        <md-menu-item ng-if="!vm.tab.spy && !vm.interaction.closed">\n          <md-button ng-click="vm.disposeInteraction()" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n            Close and Dispose\n          </md-button>\n        </md-menu-item>\n        <md-menu-item ng-if="!vm.tab.spy && vm.interaction.closed && !vm.interaction.disposition">\n          <md-button ng-click="vm.disposeInteraction(ev)" translate="DASHBOARDS.DISPOSE">\n            Dispose\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html",'<div class="interaction-reply-button-container">\n  <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DRAFT">Draft</span></md-tooltip>\n  <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="draft" ng-disabled="!vm.draft" ng-click="vm.openDraft()">\n    <md-icon ng-cloak md-font-icon="icon-pencil-box" class="icon s24" ng-class="vm.draft ? \'red-500-fg\' : \'grey-fg\'"></md-icon>\n  </md-button>\n</div>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n  <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n  <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n  <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeMailInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="MAIL.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.openchannel.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeOpenchannelInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="OPENCHANNEL.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeSmsInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="SMS.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n  <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n  <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.whatsapp.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeWhatsappInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="WHATSAPP.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n  <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n  <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html",'<md-content class="md-padding" layout="column" layout-align="center center">\n  <div layout="row" layout-align="center center">\n    <span ng-if="!vm.tab.saved" class="text-boxed md-green-bg">\n      <timer start-time="vm.starttime"></timer>\n    </span>\n    <span ng-if="vm.contact" class="text-boxed md-gray-bg font-weight-900">{{vm.contact.firstName}} {{vm.contact.lastName}} {{vm.contact.phone}}</span>\n    <md-button ng-if="vm.showResetButton" ng-click="vm.resetViewer()" md-no-ink class="md-raised md-accent orange-bg">\n      <md-icon md-font-icon="icon-rotate-left" class="icon s16"></md-icon> {{\'JSCRIPTY.RESET_SESSION\' | translate}}\n    </md-button>\n    <md-button ng-if="vm.contact" ng-click="vm.openContact($event, vm.contact)" md-no-ink class="md-raised md-accent" translate="JSCRIPTY.OPEN_CONTACT"></md-button>\n    <md-button ng-if="vm.showIncompleteSubmitButton" ng-click="vm.onSubmit($event, true)" md-no-ink class="md-raised md-accent green-bg" translate="JSCRIPTY.SUBMIT"></md-button>\n  </div>\n  <h1 ng-if="!vm.project.formData"><span translate="JSCRIPTY.PROJECT_NOT_AVAILABLE">Project is not available. Please contact the administrator</span></h1>\n  <mw-form-viewer ng-if="vm.project.formData" form-data="vm.project.formData" response-data="vm.project.responseData" on-submit="vm.onSubmit($event)" template-data="call" api="vm.formViewer"></mw-form-viewer>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/notification/dialog.html",'\x3c!-- <md-toast> --\x3e\n<div class="md-padding" layout="column" layout-align="center center">\n  <span class="md-title">#{{vm.notification.id}} {{vm.notification.title}}</span>\n  <span class="md-subhead" ng-if="vm.notification.queue">{{vm.notification.queue}}</span>\n  <div class="padding-top-5" layout="row">\n    <md-button class="md-raised md-accent" ng-click="vm.accept($event)" translate="DASHBOARDS.ACCEPT">\n      ACCEPT\n    </md-button>\n    <md-button class="md-raised md-warn" ng-click="vm.reject($event)" translate="DASHBOARDS.REJECT">\n      REJECT\n    </md-button>\n  </div>\n</div>\n\x3c!-- </md-toast> --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html",'<md-content class="md-padding" flex>\n  <div ng-if="vm.html" ng-bind-html="vm.html"></div>\n  <h1 ng-if="!vm.html">Template is empty. Please contact the administrator</h1>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-hangouts" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-52 line-height-72">\n            {{vm.inbound.abandoned || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_MANAGED_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_MANAGED_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_MANAGED_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ABANDONED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_MOTION_BULL_STATS">Today Motion Bull STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-timelapse"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{(vm.inbound.talking || 0) + (vm.inbound.pTalking || 0)}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-missed"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-52 line-height-72">\n            {{vm.inbound.outboundDropCallsDayCallersExit || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.outboundDropCallsDayTimeout || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROPPED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.DROPPED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.DROPPED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-dots"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.originated || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.ORIGINATED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ORIGINATED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.outboundanswerRate || 0 |number : 1}}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.outboundAbandonRate || 0}}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ABANDON_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.outboundDropRate }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROP_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.DROP_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.DROP_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e\n\n\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_IVR_CAMPAIGNS_STATS">Today IVR campaigns stats</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-dots"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.ivr.originated || 0}}/{{vm.ivr.limitCalls || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}/{{\'DASHBOARDS.LIMITED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.LIMITED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ORIGINATEDLIMITED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET IVR --\x3e'),e.put("app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-deskphone" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-email" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-google-earth" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-message-text" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/user.general.html",'<div id="dashboard-general" ng-init="vm.onInit()" class="page-layout simple right-sidenav" layout="row">\n  \x3c!-- CENTER --\x3e\n  <div class="center" flex>\n    \x3c!-- CONTENT --\x3e\n    <div class="content">\n      <md-tabs ng-if="vm.hasDashboardPermissions" md-selected="vm.selectedTab" md-dynamic-height>\n        <md-tab ng-if="vm.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}" ui-sref="app.dashboards.general.voice">\n          <div ui-view="voice"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.dialer" label="{{\'DASHBOARDS.MOTIONDIALER\' | translate}}" ui-sref="app.dashboards.general.dialer">\n          <div ui-view="dialer"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}" ui-sref="app.dashboards.general.chat">\n          <div ui-view="chat"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}" ui-sref="app.dashboards.general.mail">\n          <div ui-view="mail"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}" ui-sref="app.dashboards.general.sms">\n          <div ui-view="sms"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}" ui-sref="app.dashboards.general.openchannel">\n          <div ui-view="openchannel"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}" ui-sref="app.dashboards.general.fax">\n          <div ui-view="fax"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.whatsapp" label="{{\'DASHBOARDS.WHATSAPP\' | translate}}" ui-sref="app.dashboards.general.whatsapp">\n          <div ui-view="whatsapp"></div>\n        </md-tab>\n      </md-tabs>\n    </div>\n    \x3c!-- END CONTENT --\x3e\n\n    <md-content ng-if="!vm.hasDashboardPermissions" layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n      <div layout="column" layout-align="space-around center" flex="50">\n        <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n        <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to\n          navigate through available sections.</span>\n      </div>\n\n      <div layout="column" flex="50">\n        <img src="assets/images/avatars/permissions.png" alt="permissions">\n      </div>\n    </md-content>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-phone-incoming" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INBOUND_STATS">Today Inbound STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-timelapse"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-missed"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-52 line-height-72">\n            {{vm.inbound.abandoned || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ABANDONED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-incoming"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-timer-sand"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-dots"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e\n\n\x3c!-- WIDGET OUTBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_OUTBOUND_STATS">Today Outbound STATS</div>\n  </div>\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.outbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.outbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OUTBOUND_ANSWERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-clock"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-42 line-height-72">\n            {{vm.outbound.sumDuration || 0 | secToTime | date:\'HH:mm:ss\'}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOT_DURATION\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TOT_DURATION_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOT_DURATION\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-division"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{vm.outbound.total ? ((vm.outbound.sumDuration / vm.outbound.total) | number: 0) : 0 | secToTime | date:\'HH:mm:ss\'}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_DURATION\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_DURATION_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_DURATION\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-42 line-height-72">\n            {{vm.outbound.total ? (vm.outbound.answered / vm.outbound.total * 100) : 0 | number: 1}}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OUTBOUND_ANSWER_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/whatsapp/user.general.whatsapp.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-whatsapp" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/fax/views/faxAccounts/create/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="faxAccountForm[\'name\'].$error" ng-show="faxAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="faxAccountForm[\'key\'].$error" ng-show="faxAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.TRUNK">trunk</label>\n        <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n          <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountForm[\'TrunkId\'].$error" ng-show="faxAccountForm[\'TrunkId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.LOCALSTATIONID">localstationid</label>\n        <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n\n        <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n        <div ng-messages="faxAccountForm[\'localstationid\'].$error" ng-show="faxAccountForm[\'localstationid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountForm[\'ListId\'].$error" ng-show="faxAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.faxAccount.description">\n\n        <div ng-messages="faxAccountForm[\'description\'].$error" ng-show="faxAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxAccount" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid || faxAccountForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxAccount" ng-click="vm.addNewFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXACCOUNT" translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n          ADD FAXACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxAccount" ng-click="vm.deleteFaxAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",'<md-dialog class="faxAccount-dialog" aria-label="faxAccount" ng-init="vm.onInit()">\n  <form name="faxAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="FAX.AGENTADD_FAXACCOUNT">Add Agent to faxAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/agent/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountFormApp[\'agent\'].$error" ng-show="faxAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/close/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'disposition\'].$error" ng-show="faxAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'condition\'].$error" ng-show="faxAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'truepriority\'].$error" ng-show="faxAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'falsepriority\'].$error" ng-show="faxAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'priority\'].$error" ng-show="faxAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/noop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'value\'].$error" ng-show="faxAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/queue/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountFormApp[\'queue\'].$error" ng-show="faxAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/system/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'command\'].$error" ng-show="faxAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountFormApp[\'variable\'].$error" ng-show="faxAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/tag/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountFormApp[\'tag\'].$error" ng-show="faxAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/view.html",'<div id="fax-faxAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-faxAccounts-button md-icon-button" aria-label="Go to faxAccounts" ng-click="vm.gotoFaxAccounts()" translate translate-attr-aria-label="FAX.GO_TO_FAXACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="faxAccount-image" hide-xs>\n          <img ng-src="assets/images/business/faxAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.faxAccount.id}}\n            <span ng-if="vm.faxAccount.name">{{vm.faxAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="FAX.GOTO_FAXACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="FAX.AGENTADD_FAXACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveFaxAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (advancedForm.$invalid) || (dispositionForm.$invalid) || (faxDispositionsForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="FAX.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.HEADERINFO">headerinfo</label>\n                <input type="text" name="headerinfo" ng-model="vm.faxAccount.headerinfo" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.HEADERINFO"></span></div>\n                <div ng-messages="generalForm[\'headerinfo\'].$error" ng-show="generalForm[\'headerinfo\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.HEADERINFO_REQUIRED">headerinfo field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.TRUNK">trunk</label>\n                <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.LOCALSTATIONID">localstationid</label>\n                <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n                <div ng-messages="generalForm[\'localstationid\'].$error" ng-show="generalForm[\'localstationid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.faxAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.faxAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.faxAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="faxAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="FAX.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.faxAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="faxAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.faxAccount.queueTransfer == true" class="md-block">\n                <label translate="FAX.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.faxAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.faxAccount.agentTransfer == true" class="md-block">\n                <label translate="FAX.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.faxAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxAccount-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="FAX.ECM">ECM</label>\n                <md-select name="ecm" ng-model="vm.faxAccount.ecm" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                </md-select>\n                <div class="hint"><span translate="FAX.HELP.ECM"></span></div>\n                <div ng-messages="advancedForm[\'ecm\'].$error" ng-show="advancedForm[\'ecm\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.ECM_REQUIRED">ECM field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.MINRATE">minrate</label>\n                <md-select name="minrate" ng-model="vm.faxAccount.minrate" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'2400\'">2400</md-option>\n                  <md-option ng-value="\'4800\'">4800</md-option>\n                  <md-option ng-value="\'7200\'">7200</md-option>\n                  <md-option ng-value="\'9600\'">9600</md-option>\n                  <md-option ng-value="\'12000\'">12000</md-option>\n                  <md-option ng-value="\'14400\'">14400</md-option>\n                </md-select>\n                <div class="hint"><span translate="FAX.HELP.MINRATE"></span></div>\n                <div ng-messages="advancedForm[\'minrate\'].$error" ng-show="advancedForm[\'minrate\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.MINRATE_REQUIRED">minrate field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.MAXRATE">maxrate</label>\n                <md-select name="maxrate" ng-model="vm.faxAccount.maxrate" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'2400\'">2400</md-option>\n                  <md-option ng-value="\'4800\'">4800</md-option>\n                  <md-option ng-value="\'7200\'">7200</md-option>\n                  <md-option ng-value="\'9600\'">9600</md-option>\n                  <md-option ng-value="\'12000\'">12000</md-option>\n                  <md-option ng-value="\'14400\'">14400</md-option>\n                </md-select>\n                <div class="hint"><span translate="FAX.HELP.MAXRATE"></span></div>\n                <div ng-messages="advancedForm[\'maxrate\'].$error" ng-show="advancedForm[\'maxrate\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.MAXRATE_REQUIRED">maxrate field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.MODEM">modem</label>\n                <input type="text" name="modem" ng-model="vm.faxAccount.modem" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.MODEM"></span></div>\n                <div ng-messages="advancedForm[\'modem\'].$error" ng-show="advancedForm[\'modem\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.MODEM_REQUIRED">modem field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.GATEWAY">gateway</label>\n                <input type="text" name="gateway" ng-model="vm.faxAccount.gateway" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.GATEWAY"></span></div>\n                <div ng-messages="advancedForm[\'gateway\'].$error" ng-show="advancedForm[\'gateway\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.GATEWAY_REQUIRED">gateway field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.FAXDETECT">faxdetect</label>\n                <input type="text" name="faxdetect" ng-model="vm.faxAccount.faxdetect" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.FAXDETECT"></span></div>\n                <div ng-messages="advancedForm[\'faxdetect\'].$error" ng-show="advancedForm[\'faxdetect\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.FAXDETECT_REQUIRED">faxdetect field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.T38TIMEOUT">t38timeout</label>\n                <input type="number" name="t38timeout" ng-model="vm.faxAccount.t38timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.T38TIMEOUT"></span></div>\n                <div ng-messages="advancedForm[\'t38timeout\'].$error" ng-show="advancedForm[\'t38timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.T38TIMEOUT_REQUIRED">t38timeout field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.SIP">SIP</label>\n                <md-select name="tech" ng-model="vm.faxAccount.tech" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'SIP\'">SIP</md-option>\n                  <md-option ng-value="\'IAX\'">IAX</md-option>\n                  <md-option ng-value="\'DADHI\'">DADHI</md-option>\n                  <md-option ng-value="\'KHOMP\'">KHOMP</md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'tech\'].$error" ng-show="advancedForm[\'tech\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.SIP_REQUIRED">SIP field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="faxAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.faxAccount.mandatoryDisposition" class="md-block">\n                <label translate="FAX.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.faxAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="FAX.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="FaxAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="faxAccount-detail-form-container faxdispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="FAX.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add fax dispositions" translate translate-attr-label="FAX.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="faxAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="FaxAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.faxAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="FAX.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedFaxAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedFaxAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedFaxAccountApps.length}} {{vm_ac.selectedFaxAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedFaxAccountApps($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedFaxAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.faxAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editFaxAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.faxAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="FaxAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="FAX.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getFaxAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getFaxAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getFaxAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="FAX.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedFaxAccountInteractions.length}} {{vm_dc.selectedFaxAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountInteractions" csv-label="true" filename="faxAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'FAX.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'FAX.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'FAX.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'FAX.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'FAX.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'FAX.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'FAX.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.faxAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'FAX.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'FAX.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spyfaxInteraction($event, interaction)" translate="FAX.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.faxInteractionDownload(interaction, $event)" translate="FAX.DOWNLOAD_INTERACTION">\n                                Download\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="FAX.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.faxAccountInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="FAX.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.faxAccountInteractions.count}}" md-on-paginate="vm_dc.getFaxAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxAccounts/faxAccounts.html",'<div id="faxAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="FAX.FAXACCOUNTS">FaxAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedFaxAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedFaxAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="FAX.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-faxAccounts-count">\n          <span>{{vm.selectedFaxAccounts.length}}</span>\n          <span translate="FAX.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAX.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllFaxAccounts()" translate="FAX.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectFaxAccounts()" translate="FAX.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedFaxAccounts" csv-label="true" filename="faxAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxAccounts($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- FAXACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedFaxAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'FAX.KEY\' | translate }}</th>\n                <th md-column md-order-by="TrunkId">{{ \'FAX.TRUNK\' | translate }}</th>\n                <th md-column md-order-by="localstationid">{{ \'FAX.LOCALSTATIONID\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.faxAccounts.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="faxAccount" md-select-id="id" ng-repeat="faxAccount in vm.faxAccounts.rows">\n                <td md-cell ng-if="faxAccount.userpic"><img class="avatar" alt="{{faxAccount.name}}" ng-src="api/users/{{faxAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!faxAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="id ">{{faxAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="name ">{{faxAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="key ">{{faxAccount.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':faxAccount.TrunkId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="localstationid ">{{faxAccount.localstationid}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="description ">{{faxAccount.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(faxAccount, $event    )" translate="FAX.EDIT_FAXACCOUNT">\n                          Edit FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(faxAccount, $event    )" translate="FAX.INTERACTIONS_FAXACCOUNT">\n                          Interactions FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(faxAccount, $event    )" translate="FAX.GOTOREALTIME_FAXACCOUNT">\n                          goToRealtime FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(faxAccount, $event    )" translate="FAX.AGENTADD_FAXACCOUNT">\n                          AgentAdd FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(faxAccount, $event    )" translate="FAX.DELETE_FAXACCOUNT">\n                          Delete FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / FAXACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD FAXACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxAccount-button" ng-click="vm.createOrEditFaxAccount($event)" aria-label="add faxAccount" translate translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD FAXACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/faxQueues/create/dialog.html",'<md-dialog class="faxQueue-dialog" aria-label="New FaxQueue">\n  <form name="faxQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newFaxQueue">\n\n        <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n        <div ng-messages="faxQueueForm[\'name\'].$error" ng-show="faxQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="faxQueueForm[\'strategy\'].$error" ng-show="faxQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="faxQueueForm[\'timeout\'].$error" ng-show="faxQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.faxQueue.description">\n\n        <div ng-messages="faxQueueForm[\'description\'].$error" ng-show="faxQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxQueue" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid || faxQueueForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxQueue" ng-click="vm.addNewFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXQUEUE" translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n          ADD FAXQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxQueue" ng-click="vm.deleteFaxQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n  <form name="faxQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="FAX.AGENTADD_FAXQUEUE">Add Agent to faxQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n  <form name="faxQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="FAX.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/view.html",'<div id="fax-faxQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-faxQueues-button md-icon-button" aria-label="Go to faxQueues" ng-click="vm.gotoFaxQueues()" translate translate-attr-aria-label="FAX.GO_TO_FAXQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="faxQueue-image" hide-xs>\n          <img ng-src="assets/images/business/faxQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.faxQueue.id}}\n            <span ng-if="vm.faxQueue.name">{{vm.faxQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.faxQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="FAX.TEAMADD_FAXQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.faxQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="FAX.AGENTADD_FAXQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveFaxQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="FAX.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.faxQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.faxQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxQueues/faxQueues.html",'<div id="faxQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="FAX.FAXQUEUES">FaxQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedFaxQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedFaxQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="FAX.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-faxQueues-count">\n          <span>{{vm.selectedFaxQueues.length}}</span>\n          <span translate="FAX.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAX.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllFaxQueues()" translate="FAX.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectFaxQueues()" translate="FAX.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedFaxQueues" csv-label="true" filename="faxQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxQueues($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- FAXQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedFaxQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'FAX.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.faxQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="faxQueue" md-select-id="id" ng-repeat="faxQueue in vm.faxQueues.rows">\n                <td md-cell ng-if="faxQueue.userpic"><img class="avatar" alt="{{faxQueue.name}}" ng-src="api/users/{{faxQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!faxQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="id ">{{faxQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="name ">{{faxQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="strategy ">{{ vm.arraystrategy[faxQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(faxQueue, $event    )" translate="FAX.EDIT_FAXQUEUE">\n                          Edit FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(faxQueue, $event    )" translate="FAX.TEAMADD_FAXQUEUE">\n                          teamadd FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(faxQueue, $event    )" translate="FAX.AGENTADD_FAXQUEUE">\n                          agentadd FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(faxQueue, $event    )" translate="FAX.DELETE_FAXQUEUE">\n                          Delete FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(faxQueue, $event    )" translate="FAX.GOTOREALTIME_FAXQUEUE">\n                          goToRealtime FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxQueues.count}}" md-on-paginate="vm.getFaxQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / FAXQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD FAXQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxQueue-button" ng-click="vm.createOrEditFaxQueue($event)" aria-label="add faxQueue" translate translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD FAXQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="FAX.ACCOUNTS">Accounts</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.vm.getFaxAccounts()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate}}</th>\n        <th md-column>{{\'FAX.KEY\' | translate}}</th>\n        <th md-column>{{\'FAX.TOTAL\' | translate}}</th>\n        <th md-column>{{\'FAX.IN\' | translate}}</th>\n        <th md-column>{{\'FAX.OUT\' | translate}}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.faxAccounts">\n        <td md-cell colspan="4">\n          <div layout="row" layout-align="center center">\n            <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="vm.faxAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n        <td md-cell>{{vm.faxAccounts[value].name}}</td>\n        <td md-cell>{{vm.faxAccounts[value].key}}</td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{(vm.faxAccounts[value].in || 0) + (vm.faxAccounts[value].out || 0)}}</span>\n        </td>\n        <td md-cell>\n          <div layout="row">\n            <span>\n              <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n            </span>\n            <span class="md-capture blue-fg">{{vm.faxAccounts[value].in || 0}}</span>\n            <span class="text-boxed" ng-if="mailAccount.in">{{vm.faxAccounts[value].lastIn ?  (vm.faxAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n          </div>\n        </td>\n        <td md-cell>\n          <div layout="row">\n            <span>\n              <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n            </span>\n            <span class="md-capture green-fg">{{vm.faxAccounts[value].out || 0}}</span>\n            <span class="text-boxed" ng-if="mailAccount.out">{{vm.faxAccounts[value].lastOut ?  (vm.faxAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n          </div>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n\n            <md-menu-content width="4">\n              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                <md-button ng-click="vm.goToFaxAccount($event, vm.faxAccounts[value])" translate="FAX.EDIT_ACCOUNT">\n                  Edit Account\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="FAX.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n        <th md-column>{{ \'FAX.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'FAX.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'FAX.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="FAX.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="FAX.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/fax/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.TRUNKS">Trunks</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.ACCOUNTS">Accounts</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="FAX.TRUNKS">Telephones</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getTrunks()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head>\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n        <tr md-row>\n          <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n          <th md-column>{{ \'FAX.TRUNK_STATUS\' | translate }}</th>\n          <th md-column>{{ \'FAX.REGISTRY\' | translate }}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.trunks">\n        <td md-cell colspan="3">\n          <div layout="row" layout-align="center center">\n            <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n        <td md-cell>{{trunk.name}}</td>\n        <td md-cell>\n          <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n            <md-tooltip>{{\'FAX.\' + trunk.status | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n        </td>\n        <td md-cell>\n          <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n            <md-tooltip>{{\'FAX.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n          <span ng-if="!trunk.registry" translate="FAX.NO_REGISTRY">\n            No Registry\n          </span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n\n            <md-menu-content width="4">\n              <md-menu-item>\n                <md-button ng-click="vm.goToTrunk($event, trunk)" translate="FAX.EDIT_TRUNK">\n                  Edit Trunk\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/help/views/about/about.html",'<div id="maintenance" class="flex-scrollable" layout="column">\n  <div id="maintenance-form-wrapper" layout="column" layout-align="center center">\n    <div id="maintenance-form" class="md-whiteframe-8dp">\n      <div>\n        <img src="/api/settings/1/logo_login" alt="logo_login" />\n      </div>\n\n      <br>\n\n      <div>\n        <div class="info-line">\n          <div class="title">Useful pages</div>\n        </div>\n        <section layout="row" flex layout-sm="column" layout-align="center center" layout-wrap>\n          <div layout="column" flex="25" layout-align="center center">\n            <a class="md-fab md-mini md-button grey-bg" href="https://wiki.xcallymotion.com/display/XMV" target="_blank">\n              <md-icon md-font-icon="icon-wikipedia"></md-icon>\n            </a>\n            <div class="info"><a href="https://wiki.xcallymotion.com/display/XMV" target="_blank">Wiki</a></div>\n          </div>\n\n          <div layout="column" flex="25" layout-align="center center">\n            <a class="md-fab md-mini md-button md-accent" href="/apidoc" target="_blank">\n              <md-icon md-font-icon="icon-apple-mobileme"></md-icon>\n            </a>\n            <div class="info"><a href="/apidoc" target="_blank">Motion API</a></div>\n          </div>\n\n          <div layout="column" flex="25" layout-align="center center">\n            <a class="md-fab md-mini md-button orange-bg" href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">\n              <md-icon md-font-icon="icon-headphones"></md-icon>\n            </a>\n            <div class="info"><a href="https://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">Phonebar Download</a></div>\n          </div>\n\n          <div layout="column" flex="25" layout-align="center center">\n            <a class="md-fab md-mini md-button green-bg" href="/demo" target="_blank">\n              <md-icon md-font-icon="icon-console"></md-icon>\n            </a>\n            <div class="info"><a href="/demo" target="_blank">Playground</a></div>\n          </div>\n\n        </section>\n\n        <br>\n\n        <div class="info-line" ng-if="!vm.license.custom">\n          <div class="title">Follow us on</div>\n        </div>\n        <section ng-if="!vm.license.custom" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n          <a class="md-fab md-mini md-button blue-900-bg" href="https://www.facebook.com/xcallymotion" target="_blank">\n            <md-icon md-font-icon="icon-facebook"></md-icon>\n          </a>\n\n          <a class="md-fab md-mini md-button" href="https://twitter.com/xcallymotion" target="_blank">\n            <md-icon md-font-icon="icon-twitter"></md-icon>\n          </a>\n          <a class="md-fab md-mini md-button md-warn" href="https://plus.google.com/+Xcally" target="_blank">\n            <md-icon md-font-icon="icon-google-plus"></md-icon>\n          </a>\n          <a class="md-fab md-mini md-button light-blue-800-bg" href="https://www.linkedin.com/company/xcally" target="_blank">\n            <md-icon md-font-icon="icon-linkedin"></md-icon>\n          </a>\n        </section>\n\n        <br ng-if="!vm.license.custom">\n\n        <div class="info-line" ng-if="!vm.license.custom">\n          <div class="title" translate="HELP.CONTACT_US">Contact Us</div>\n        </div>\n        <div class="info-line" ng-if="!vm.license.custom">\n          <div class="info"><a href="mailto:support@xcally.com" target="_top">support@xcally.com</a></div>\n        </div>\n\n        <br ng-if="!vm.license.custom">\n\n        <div class="info">xCALLY Motion <u>{{vm.info.current}}</u> | <a href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.info.current}}" target="_blank">Changelog</a></div>\n\n        <br>\n\n        <div class="info" ng-if="!vm.license.custom">xCALLY© 2016 - 2018 | Powered by Xenialab | <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></div>\n\n        <br ng-if="!vm.license.custom">\n\n        <div class="info" ng-if="!vm.license.custom"><a href="https://www.xenialab.com/" target="_blank">www.xenialab.com</a> | <a href="https://www.xcallymotion.com/" target="_blank">www.xcallymotion.com</a></div>\n      </div>\n    </div>\n  </div>\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/create/dialog.html",'<md-dialog class="deskAccount-dialog" aria-label="New DeskAccount">\n  <form name="deskAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="deskAccountForm[\'name\'].$error" ng-show="deskAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n          <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n          <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="deskAccountForm[\'type\'].$error" ng-show="deskAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="deskAccountForm[\'remoteUri\'].$error" ng-show="deskAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n        <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n          <md-option ng-value="\'basic\'">Basic</md-option>\n        </md-select>\n        <div ng-messages="deskAccountForm[\'authType\'].$error" ng-show="deskAccountForm[\'authType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n\n        <div ng-messages="deskAccountForm[\'username\'].$error" ng-show="deskAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="deskAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="deskAccountForm[\'serverUrl\'].$error" ng-show="deskAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.deskAccount.description">\n\n        <div ng-messages="deskAccountForm[\'description\'].$error" ng-show="deskAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskAccount" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid || deskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskAccount" ng-click="vm.addNewDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n          ADD DESKACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskAccount" ng-click="vm.deleteDeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/deskAccounts.html",'<div id="deskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.DESKACCOUNTS">DeskAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedDeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedDeskAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-deskAccounts-count">\n          <span>{{vm.selectedDeskAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllDeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectDeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedDeskAccounts" csv-label="true" filename="deskAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- DESKACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedDeskAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDeskAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.deskAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="deskAccount" md-select-id="id" ng-repeat="deskAccount in vm.deskAccounts.rows">\n                <td md-cell ng-if="deskAccount.userpic"><img class="avatar" alt="{{deskAccount.name}}" ng-src="api/users/{{deskAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!deskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{deskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="id ">{{deskAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="name ">{{deskAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="remoteUri ">{{deskAccount.remoteUri}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="username ">{{deskAccount.username}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(deskAccount, $event    )" translate="INTEGRATIONS.EDIT_DESKACCOUNT">\n                          Edit DeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(deskAccount, $event    )" translate="INTEGRATIONS.TEST_DESKACCOUNT">\n                          Test DeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(deskAccount, $event    )" translate="INTEGRATIONS.DELETE_DESKACCOUNT">\n                          Delete DeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.deskAccounts.count}}" md-on-paginate="vm.getDeskAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / DESKACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD DESKACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-deskAccount-button" ng-click="vm.createOrEditDeskAccount($event)" aria-label="add deskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD DESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",'<md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">\n  <form name="deskConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.deskConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="deskConfigurationForm[\'name\'].$error" ng-show="deskConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.deskConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="deskConfigurationForm[\'channel\'].$error" ng-show="deskConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.deskConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="deskConfigurationForm[\'type\'].$error" ng-show="deskConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskConfiguration" ng-click="vm.saveDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskConfiguration" ng-click="vm.addNewDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION">\n          ADD DESKCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskConfiguration" ng-click="vm.deleteDeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",'<md-dialog class="deskAccount-item-dialog" aria-label="New Item">\n  <form name="deskAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="deskAccountItemForm.key.$error" ng-show="deskAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="deskAccountItemForm.keyType.$error" ng-show="deskAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="deskAccountItemForm.keyContent.$error" ng-show="deskAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="deskAccountItemForm.customField.$error" ng-show="deskAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="deskAccountItemForm.content.$error"\n          ng-show="deskAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="deskAccountItemForm.variableName.$error"\n          ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/view.html",'<div id="integrations-deskAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-deskAccounts-button md-icon-button" aria-label="Go to deskAccounts" ng-click="vm.gotoDeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="deskAccount-image" hide-xs>\n          <img ng-src="assets/images/business/deskAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.deskAccount.id}}\n            <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.deskAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveDeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.deskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n                  <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n                <md-select name="authType" ng-model="vm.deskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'basic\'">Basic</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.deskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="DeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.deskAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" class="md-icon-button" aria-label="create deskConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="deskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDeskConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ deskConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)" translate="INTEGRATIONS.DELETE_DESKCONFIGURATION">\n                            Delete DeskConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.TAGS">TAGS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-table-container class="md-whiteframe-1dp padding-20">\n                        <md-input-container class="md-block">\n                          <label translate="INTEGRATIONS.TAGS">Tags</label>\n                          <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n                            <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",'<md-dialog class="dynamics365Account-dialog" aria-label="New Dynamics365Account">\n  <form name="dynamics365AccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus>\n\n        <div ng-messages="dynamics365AccountForm[\'name\'].$error" ng-show="dynamics365AccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.dynamics365Account.modernAuthentication" ng-disabled=" vm.isModernAuthenticationEnabled == true">\n          <span translate="INTEGRATIONS.MODERN_AUTHENTICATION">Modern Authentication</span>\n        </md-switch>\n        \x3c!-- <div class="hint"><span translate="INTEGRATIONS.HELP.MODERN_AUTHENTICATION"></span></div> --\x3e\n      </md-input-container>\n\n      <div ng-if="vm.dynamics365Account.modernAuthentication == false">\n\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.USERNAME">Username</label>\n          <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'username\'].$error" ng-show="dynamics365AccountForm[\'username\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.PASSWORD">Password</label>\n          <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n          <div ng-messages="dynamics365AccountForm[\'password\'].$error" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n            </div>\n            <div ng-message="pattern">\n              <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.URI">Uri</label>\n          <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'remoteUri\'].$error" ng-show="dynamics365AccountForm[\'remoteUri\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n            </div>\n            <div ng-message="url">\n              <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n          <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'tenantId\'].$error" ng-show="dynamics365AccountForm[\'tenantId\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n          <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'clientId\'].$error" ng-show="dynamics365AccountForm[\'clientId\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n          <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'clientSecret\'].$error" ng-show="dynamics365AccountForm[\'clientSecret\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n          <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" value="LOCALIP" ng-required="true">\n\n          <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n          <div ng-messages="dynamics365AccountForm[\'serverUrl\'].$error" ng-show="dynamics365AccountForm[\'serverUrl\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n            </div>\n            <div ng-message="url">\n              <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n            </div>\n          </div>\n        </md-input-container>\n\n      </div>\n\n      <div ng-if="vm.dynamics365Account.modernAuthentication == true">\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.CLOUD_PROVIDER">Cloud Provider</label>\n          <md-select ng-model="vm.dynamics365Account.CloudProviderId" placeholder="Cloud Provider connection" ng-required="true">\n            <md-option value="{{provider.id}}" ng-repeat="provider in vm.cloudProviders">{{provider.name}}</md-option>\n          </md-select>\n        </md-input-container>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.dynamics365Account.description">\n\n        <div ng-messages="dynamics365AccountForm[\'description\'].$error" ng-show="dynamics365AccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Account" ng-click="vm.saveDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid || dynamics365AccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Account" ng-click="vm.addNewDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n          ADD DYNAMICS365ACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Account" ng-click="vm.deleteDynamics365Account($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",'<div id="dynamics365Accounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.DYNAMICS365ACCOUNTS">Dynamics365Accounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedDynamics365Accounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedDynamics365Accounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-dynamics365Accounts-count">\n          <span>{{vm.selectedDynamics365Accounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllDynamics365Accounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectDynamics365Accounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedDynamics365Accounts" csv-label="true" filename="dynamics365Accounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDynamics365Accounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- DYNAMICS365ACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedDynamics365Accounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDynamics365Accounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="modernAuthentication">{{ \'INTEGRATIONS.MODERN_AUTHENTICATION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.dynamics365Accounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="dynamics365Account" md-select-id="id" ng-repeat="dynamics365Account in vm.dynamics365Accounts.rows">\n                <td md-cell ng-if="dynamics365Account.userpic"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="api/users/{{dynamics365Account.id}}/avatar" /></td>\n                <td md-cell ng-if="!dynamics365Account.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="id ">{{dynamics365Account.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="name ">{{dynamics365Account.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="modernAuthentication ">\n                  <md-icon md-colors="{color: {{dynamics365Account.modernAuthentication ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{dynamics365Account.modernAuthentication ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(dynamics365Account, $event    )" translate="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT">\n                          Edit Dynamics365Account\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(dynamics365Account, $event    )" translate="INTEGRATIONS.TEST_DYNAMICS365ACCOUNT">\n                          Test Dynamics365Account\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n\n                        <md-button ng-click="vm.deleteconfirm(dynamics365Account, $event    )" translate="INTEGRATIONS.DELETE_DYNAMICS365ACCOUNT">\n                          Delete Dynamics365Account\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dynamics365Accounts.count}}" md-on-paginate="vm.getDynamics365Accounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / DYNAMICS365ACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-dynamics365Account-button" ng-click="vm.createOrEditDynamics365Account($event)" aria-label="add dynamics365Account" translate translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",'<md-dialog class="dynamics365Configuration-dialog" aria-label="New Dynamics365Configuration">\n  <form name="dynamics365ConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.dynamics365Configuration.name" ng-required="true" autofocus>\n\n        <div ng-messages="dynamics365ConfigurationForm[\'name\'].$error" ng-show="dynamics365ConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.dynamics365Configuration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dynamics365ConfigurationForm[\'channel\'].$error" ng-show="dynamics365ConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.dynamics365Configuration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dynamics365ConfigurationForm[\'type\'].$error" ng-show="dynamics365ConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n        <md-select name="ticketType" ng-model="vm.dynamics365Configuration.ticketType" required>\n\n          <md-option ng-value="\'incident\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n\n          <md-option ng-value="\'phonecall\'"> {{ \'INTEGRATIONS.PHONECALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dynamics365ConfigurationForm[\'ticketType\'].$error" ng-show="dynamics365ConfigurationForm[\'ticketType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Configuration" ng-click="vm.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid || dynamics365ConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Configuration" ng-click="vm.addNewDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION">\n          ADD DYNAMICS365CONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Configuration" ng-click="vm.deleteDynamics365Configuration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",'<md-dialog class="dynamics365Account-item-dialog" aria-label="New Item">\n  <form name="dynamics365AccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="dynamics365AccountItemForm.key.$error" ng-show="dynamics365AccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="dynamics365AccountItemForm.keyType.$error" ng-show="dynamics365AccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="dynamics365AccountItemForm.keyContent.$error" ng-show="dynamics365AccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="dynamics365AccountItemForm.customField.$error" ng-show="dynamics365AccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="dynamics365AccountItemForm.option.$error" ng-show="dynamics365AccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="dynamics365AccountItemForm.content.$error"\n          ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="dynamics365AccountItemForm.variableName.$error"\n          ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",'<div id="integrations-dynamics365Account" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-dynamics365Accounts-button md-icon-button" aria-label="Go to dynamics365Accounts" ng-click="vm.gotoDynamics365Accounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DYNAMICS365ACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="dynamics365Account-image" hide-xs>\n          <img ng-src="assets/images/business/dynamics365Accounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.dynamics365Account.id}}\n            <span ng-if="vm.dynamics365Account.name">{{vm.dynamics365Account.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.dynamics365Account.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveDynamics365Account()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="dynamics365Account-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.dynamics365Account.modernAuthentication" ng-disabled="vm.isModernAuthenticationEnabled == true">\n                  <span translate="INTEGRATIONS.MODERN_AUTHENTICATION">Modern Authentication</span>\n                </md-switch>\n                \x3c!-- <div class="hint"><span translate="INTEGRATIONS.HELP.MODERN_AUTHENTICATION"></span></div> --\x3e\n              </md-input-container>\n\n              <div ng-if="vm.dynamics365Account.modernAuthentication == true">\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.CLOUD_PROVIDER">Cloud Provider</label>\n                  <md-select ng-model="vm.dynamics365Account.CloudProviderId" placeholder="Cloud Provider connection" ng-required="true">\n                    <md-option value="{{provider.id}}" ng-repeat="provider in vm.cloudProviders.rows">{{provider.name}}</md-option>\n                  </md-select>\n                </md-input-container>\n              </div>\n\n              <div ng-if="vm.dynamics365Account.modernAuthentication == false">\n\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.USERNAME">Username</label>\n                  \x3c!-- <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit"> --\x3e\n                  <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n                  <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                    </div>\n                  </div>\n                </md-input-container>\n\n\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                  <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" ng-required="vm.dynamics365Account.modernAuthentication == false">\n                  <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                    </div>\n                    <div ng-message="pattern">\n                      <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                    </div>\n                  </div>\n                </md-input-container>\n\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.URI">Uri</label>\n                  <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                    </div>\n                    <div ng-message="url">\n                      <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n                  <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div ng-messages="generalForm[\'tenantId\'].$error" ng-show="generalForm[\'tenantId\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n                  <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n                  <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                  <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" value="LOCALIP" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                  <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                    </div>\n                    <div ng-message="url">\n                      <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                    </div>\n                  </div>\n                </md-input-container>\n\n              </div>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.dynamics365Account.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="dynamics365Account-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="Dynamics365AccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.dynamics365Account, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" class="md-icon-button" aria-label="create dynamics365Configuration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="dynamics365Configuration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDynamics365Configuration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDynamics365Configuration($index)">\n                    <span class="text-truncate" flex="80">{{ dynamics365Configuration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteDynamics365Configuration($event, dynamics365Configuration)" translate="INTEGRATIONS.DELETE_DYNAMICS365CONFIGURATION">\n                            Delete Dynamics365Configuration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.ADVANCED">ADVANCED</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <div class="dynamics365Account-detail-form-container general md-background-bg">\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="INTEGRATIONS.ADVANCED">ADVANCED</div>\n                        </div>\n                        <form name="vm_cc.advancedForm" novalidate>\n                          <md-input-container class="md-block">\n                            <label translate="INTEGRATIONS.MODULECREATE">Module Create</label>\n                            <md-select name="type" ng-model="vm_cc.dynamics365Configuration.moduleCreate" required>\n                              <md-option ng-value="\'contact\'">{{\'INTEGRATIONS.DYNAMIC365CONTACT\' | translate}}</md-option>\n                              <md-option ng-value="\'nothing\'">{{\'INTEGRATIONS.DYNAMIC365NOTHING\' | translate}}</md-option>\n                            </md-select>\n                            <div ng-messages="vm_cc.advancedForm[\'moduleCreate\'].$error" ng-show="vm_cc.advancedForm[\'moduleCreate\'].$touched" role="alert">\n                              <div ng-message="required">\n                                <span translate="INTEGRATIONS.ERRORS.MODULECREATE_REQUIRED">Type field is required</span>\n                              </div>\n                            </div>\n                          </md-input-container>\n                          <div layout="row" layout-align="end center">\n                            <md-button type="submit" ng-click="vm_cc.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="vm_cc.advancedForm.$invalid || vm_cc.advancedForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n                              SAVE\n                            </md-button>\n                          </div>\n                        </form>\n                      </div>\n                    </md-tab-body>\n                  </md-tab>\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n          </div>\n\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",'<md-dialog class="freshdeskAccount-dialog" aria-label="New FreshdeskAccount">\n  <form name="freshdeskAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="freshdeskAccountForm[\'name\'].$error" ng-show="freshdeskAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n\n        <div ng-messages="freshdeskAccountForm[\'username\'].$error" ng-show="freshdeskAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="freshdeskAccountForm[\'remoteUri\'].$error" ng-show="freshdeskAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n        <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n\n        <div ng-messages="freshdeskAccountForm[\'apiKey\'].$error" ng-show="freshdeskAccountForm[\'apiKey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="freshdeskAccountForm[\'serverUrl\'].$error" ng-show="freshdeskAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n\n        <div ng-messages="freshdeskAccountForm[\'description\'].$error" ng-show="freshdeskAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskAccount" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid || freshdeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskAccount" ng-click="vm.addNewFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n          ADD FRESHDESKACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskAccount" ng-click="vm.deleteFreshdeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",'<md-dialog class="freshdeskConfiguration-dialog" aria-label="New FreshdeskConfiguration">\n  <form name="freshdeskConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.freshdeskConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="freshdeskConfigurationForm[\'name\'].$error" ng-show="freshdeskConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.freshdeskConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="freshdeskConfigurationForm[\'channel\'].$error" ng-show="freshdeskConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.freshdeskConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="freshdeskConfigurationForm[\'type\'].$error" ng-show="freshdeskConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskConfiguration" ng-click="vm.saveFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid || freshdeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskConfiguration" ng-click="vm.addNewFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION">\n          ADD FRESHDESKCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskConfiguration" ng-click="vm.deleteFreshdeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",'<md-dialog class="freshdeskAccount-item-dialog" aria-label="New Item">\n  <form name="freshdeskAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="freshdeskAccountItemForm.key.$error" ng-show="freshdeskAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="freshdeskAccountItemForm.keyType.$error" ng-show="freshdeskAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="freshdeskAccountItemForm.keyContent.$error" ng-show="freshdeskAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="freshdeskAccountItemForm.customField.$error" ng-show="freshdeskAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="freshdeskAccountItemForm.content.$error"\n          ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="freshdeskAccountItemForm.variableName.$error"\n          ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",'<div id="integrations-freshdeskAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-freshdeskAccounts-button md-icon-button" aria-label="Go to freshdeskAccounts" ng-click="vm.gotoFreshdeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHDESKACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="freshdeskAccount-image" hide-xs>\n          <img ng-src="assets/images/business/freshdeskAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.freshdeskAccount.id}}\n            <span ng-if="vm.freshdeskAccount.name">{{vm.freshdeskAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshdeskAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveFreshdeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="freshdeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n                <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.freshdeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="freshdeskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="FreshdeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshdeskAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" class="md-icon-button" aria-label="create freshdeskConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="freshdeskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshdeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshdeskConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ freshdeskConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteFreshdeskConfiguration($event, freshdeskConfiguration)" translate="INTEGRATIONS.DELETE_FRESHDESKCONFIGURATION">\n                            Delete FreshdeskConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.TAGS">TAGS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-table-container class="md-whiteframe-1dp padding-20">\n                        <md-input-container class="md-block">\n                          <label translate="INTEGRATIONS.TAGS">Tags</label>\n                          <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n                            <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",'<div id="freshdeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.FRESHDESKACCOUNTS">FreshdeskAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedFreshdeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedFreshdeskAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-freshdeskAccounts-count">\n          <span>{{vm.selectedFreshdeskAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedFreshdeskAccounts" csv-label="true" filename="freshdeskAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshdeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- FRESHDESKACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedFreshdeskAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshdeskAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.freshdeskAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="freshdeskAccount" md-select-id="id" ng-repeat="freshdeskAccount in vm.freshdeskAccounts.rows">\n                <td md-cell ng-if="freshdeskAccount.userpic"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="api/users/{{freshdeskAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!freshdeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="id ">{{freshdeskAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="name ">{{freshdeskAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="username ">{{freshdeskAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="remoteUri ">{{freshdeskAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(freshdeskAccount, $event    )" translate="INTEGRATIONS.EDIT_FRESHDESKACCOUNT">\n                          Edit FreshdeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(freshdeskAccount, $event    )" translate="INTEGRATIONS.TEST_FRESHDESKACCOUNT">\n                          Test FreshdeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(freshdeskAccount, $event    )" translate="INTEGRATIONS.DELETE_FRESHDESKACCOUNT">\n                          Delete FreshdeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshdeskAccounts.count}}" md-on-paginate="vm.getFreshdeskAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / FRESHDESKACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD FRESHDESKACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshdeskAccount-button" ng-click="vm.createOrEditFreshdeskAccount($event)" aria-label="add freshdeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD FRESHDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/create/dialog.html",'<md-dialog class="freshsalesAccount-dialog" aria-label="New FreshsalesAccount">\n  <form name="freshsalesAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.freshsalesAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="freshsalesAccountForm[\'name\'].$error" ng-show="freshsalesAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.freshsalesAccount.username" ng-required="true">\n\n        <div ng-messages="freshsalesAccountForm[\'username\'].$error" ng-show="freshsalesAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.freshsalesAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="freshsalesAccountForm[\'remoteUri\'].$error" ng-show="freshsalesAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n        <input type="text" name="apiKey" ng-model="vm.freshsalesAccount.apiKey" ng-required="true">\n\n        <div ng-messages="freshsalesAccountForm[\'apiKey\'].$error" ng-show="freshsalesAccountForm[\'apiKey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.freshsalesAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="freshsalesAccountForm[\'serverUrl\'].$error" ng-show="freshsalesAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.freshsalesAccount.description">\n\n        <div ng-messages="freshsalesAccountForm[\'description\'].$error" ng-show="freshsalesAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesAccount" ng-click="vm.saveFreshsalesAccount()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountForm.$invalid || freshsalesAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesAccount" ng-click="vm.addNewFreshsalesAccount()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHSALESACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT">\n          ADD FRESHSALESACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesAccount" ng-click="vm.deleteFreshsalesAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/configurations/dialog.html",'<md-dialog class="freshsalesConfiguration-dialog" aria-label="New FreshsalesConfiguration">\n  <form name="freshsalesConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.freshsalesConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="freshsalesConfigurationForm[\'name\'].$error" ng-show="freshsalesConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.freshsalesConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="freshsalesConfigurationForm[\'channel\'].$error" ng-show="freshsalesConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.freshsalesConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="freshsalesConfigurationForm[\'type\'].$error" ng-show="freshsalesConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesConfiguration" ng-click="vm.saveFreshsalesConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshsalesConfigurationForm.$invalid || freshsalesConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesConfiguration" ng-click="vm.addNewFreshsalesConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshsalesConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHSALESCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESCONFIGURATION">\n          ADD FRESHSALESCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesConfiguration" ng-click="vm.deleteFreshsalesConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",'<md-dialog class="freshsalesAccount-item-dialog" aria-label="New Item">\n  <form name="freshsalesAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="freshsalesAccountItemForm.content.$error" ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="freshsalesAccountItemForm.key.$error" ng-show="freshsalesAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="freshsalesAccountItemForm.keyType.$error" ng-show="freshsalesAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="freshsalesAccountItemForm.keyContent.$error" ng-show="freshsalesAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="freshsalesAccountItemForm.variableName.$error" ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="freshsalesAccountItemForm.customField.$error" ng-show="freshsalesAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountItemForm.$invalid || freshsalesAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountItemForm.$invalid || freshsalesAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="freshsalesAccountItemForm.option.$error" ng-show="freshsalesAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="freshsalesAccountItemForm.content.$error" ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="freshsalesAccountItemForm.variableName.$error" ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="freshsalesAccountItemForm.content.$error"\n          ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="freshsalesAccountItemForm.variableName.$error"\n          ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/view.html",'<div id="integrations-freshsalesAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-freshsalesAccounts-button md-icon-button" aria-label="Go to freshsalesAccounts" ng-click="vm.gotoFreshsalesAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHSALESACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="freshsalesAccount-image" hide-xs>\n          <img ng-src="assets/images/business/freshsalesAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.freshsalesAccount.id}}\n            <span ng-if="vm.freshsalesAccount.name">{{vm.freshsalesAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshsalesAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveFreshsalesAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="freshsalesAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.freshsalesAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.freshsalesAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.freshsalesAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n                <input type="text" name="apiKey" ng-model="vm.freshsalesAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.freshsalesAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.freshsalesAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="freshsalesAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="FreshsalesAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshsalesAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)" class="md-icon-button" aria-label="create freshsalesConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="freshsalesConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshsalesConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshsalesConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ freshsalesConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteFreshsalesConfiguration($event, freshsalesConfiguration)" translate="INTEGRATIONS.DELETE_FRESHSALESCONFIGURATION">\n                            Delete FreshsalesConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/freshsalesAccounts.html",'<div id="freshsalesAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.FRESHSALESACCOUNTS">FreshsalesAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedFreshsalesAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedFreshsalesAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-freshsalesAccounts-count">\n          <span>{{vm.selectedFreshsalesAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllFreshsalesAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectFreshsalesAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedFreshsalesAccounts" csv-label="true" filename="freshsalesAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshsalesAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- FRESHSALESACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedFreshsalesAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshsalesAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.freshsalesAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="freshsalesAccount" md-select-id="id" ng-repeat="freshsalesAccount in vm.freshsalesAccounts.rows">\n                <td md-cell ng-if="freshsalesAccount.userpic"><img class="avatar" alt="{{freshsalesAccount.name}}" ng-src="api/users/{{freshsalesAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!freshsalesAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshsalesAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="id ">{{freshsalesAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="name ">{{freshsalesAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="username ">{{freshsalesAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="remoteUri ">{{freshsalesAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(freshsalesAccount, $event    )" translate="INTEGRATIONS.EDIT_FRESHSALESACCOUNT">\n                          Edit FreshsalesAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(freshsalesAccount, $event    )" translate="INTEGRATIONS.TEST_FRESHSALESACCOUNT">\n                          Test FreshsalesAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(freshsalesAccount, $event    )" translate="INTEGRATIONS.DELETE_FRESHSALESACCOUNT">\n                          Delete FreshsalesAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshsalesAccounts.count}}" md-on-paginate="vm.getFreshsalesAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / FRESHSALESACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD FRESHSALESACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshsalesAccount-button" ng-click="vm.createOrEditFreshsalesAccount($event)" aria-label="add freshsalesAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD FRESHSALESACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",'<md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">\n  <form name="salesforceAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="salesforceAccountForm[\'name\'].$error" ng-show="salesforceAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n          <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n          <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="salesforceAccountForm[\'type\'].$error" ng-show="salesforceAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'username\'].$error" ng-show="salesforceAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'remoteUri\'].$error" ng-show="salesforceAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="salesforceAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n        <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'clientId\'].$error" ng-show="salesforceAccountForm[\'clientId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n        <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'clientSecret\'].$error" ng-show="salesforceAccountForm[\'clientSecret\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n        <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'securityToken\'].$error" ng-show="salesforceAccountForm[\'securityToken\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="salesforceAccountForm[\'serverUrl\'].$error" ng-show="salesforceAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n\n        <div ng-messages="salesforceAccountForm[\'description\'].$error" ng-show="salesforceAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceAccount" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceAccount" ng-click="vm.addNewSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n          ADD SALESFORCEACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceAccount" ng-click="vm.deleteSalesforceAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",'<md-dialog class="salesforceConfiguration-dialog" aria-label="New SalesforceConfiguration">\n  <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.salesforceConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="salesforceConfigurationForm[\'name\'].$error" ng-show="salesforceConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.salesforceConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="salesforceConfigurationForm[\'channel\'].$error" ng-show="salesforceConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.salesforceConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="salesforceConfigurationForm[\'type\'].$error" ng-show="salesforceConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n        <md-select name="ticketType" ng-model="vm.salesforceConfiguration.ticketType" required>\n\n          <md-option ng-value="\'Task\'"> {{ \'INTEGRATIONS.TASK\' | translate }} </md-option>\n\n          <md-option ng-value="\'Case\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="salesforceConfigurationForm[\'ticketType\'].$error" ng-show="salesforceConfigurationForm[\'ticketType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceConfiguration" ng-click="vm.saveSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceConfiguration" ng-click="vm.addNewSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION">\n          ADD SALESFORCECONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceConfiguration" ng-click="vm.deleteSalesforceConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",'<md-dialog class="salesforceAccount-item-dialog" aria-label="New Item">\n  <form name="salesforceAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="salesforceAccountItemForm.key.$error" ng-show="salesforceAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="salesforceAccountItemForm.keyType.$error" ng-show="salesforceAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="salesforceAccountItemForm.keyContent.$error" ng-show="salesforceAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="salesforceAccountItemForm.customField.$error" ng-show="salesforceAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="salesforceAccountItemForm.content.$error"\n          ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="salesforceAccountItemForm.variableName.$error"\n          ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/view.html",'<div id="integrations-salesforceAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-salesforceAccounts-button md-icon-button" aria-label="Go to salesforceAccounts" ng-click="vm.gotoSalesforceAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SALESFORCEACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="salesforceAccount-image" hide-xs>\n          <img ng-src="assets/images/business/salesforceAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.salesforceAccount.id}}\n            <span ng-if="vm.salesforceAccount.name">{{vm.salesforceAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.salesforceAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveSalesforceAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="salesforceAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.salesforceAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n                  <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n                <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n                <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n                <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'securityToken\'].$error" ng-show="generalForm[\'securityToken\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.salesforceAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="salesforceAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="SalesforceAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.salesforceAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" class="md-icon-button" aria-label="create salesforceConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="salesforceConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSalesforceConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSalesforceConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ salesforceConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteSalesforceConfiguration($event, salesforceConfiguration)" translate="INTEGRATIONS.DELETE_SALESFORCECONFIGURATION">\n                            Delete SalesforceConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.ADVANCED">\n                        ADVANCED\n                      </span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <div layout-margin>\n                        <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n                        <md-select ng-model="vm_cc.salesforceConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n                          <md-option ng-value="option.key" ng-repeat="option in [{key: \'account_contact_lead\', value: \'Account & Contact & Lead\'}, {key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}, {key: \'account\', value: \'Account\'}]">\n                            {{ option.value }}</md-option>\n                        </md-select>\n                      </div>\n                      <div layout-margin>\n                        <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n                        <md-select ng-model="vm_cc.salesforceConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n                          <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}, {key: \'account\', value: \'Account\'}]">\n                            {{ option.value }}</md-option>\n                        </md-select>\n                      </div>\n\n                      <div layout-margin ng-if="vm_cc.salesforceConfiguration.isLead">\n                        <label translate="INTEGRATIONS.LEADID"></label>\n                        <md-input-container class="md-block">\n                          <input ng-model="vm_cc.salesforceConfiguration.leadId" type="text">\n                        </md-input-container>\n                        <div class="hint"><span translate="INTEGRATIONS.HELP.LEADID"></span></div>\n                      </div>\n\n                      <div layout-margin ng-if="vm_cc.salesforceConfiguration.isAccountSearch">\n                        <label translate="INTEGRATIONS.ADDITIONALSEARCHACCOUNT"></label>\n                        <md-input-container class="md-block">\n                          <input ng-model="vm_cc.salesforceConfiguration.additionalSearchAccount" type="text">\n                        </md-input-container>\n                        <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHACCOUNT"></span></div>\n                      </div>\n\n                      <div layout-margin ng-if="vm_cc.salesforceConfiguration.isContactSearch">\n                        <label translate="INTEGRATIONS.ADDITIONALSEARCHCONTACT"></label>\n                        <md-input-container class="md-block">\n                          <input ng-model="vm_cc.salesforceConfiguration.additionalSearchContact" type="text">\n                        </md-input-container>\n                        <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHCONTACT"></span></div>\n                      </div>\n\n                      <div layout-margin ng-if="vm_cc.salesforceConfiguration.isLeadSearch">\n                        <label translate="INTEGRATIONS.ADDITIONALSEARCHLEAD"></label>\n                        <md-input-container class="md-block">\n                          <input ng-model="vm_cc.salesforceConfiguration.additionalSearchLead" type="text">\n                        </md-input-container>\n                        <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHLEAD"></span></div>\n                      </div>\n\n                      <md-button type="submit" ng-click="vm_cc.saveSalesforceConfiguration()" ng-disabled="!vm_cc.crudPermissions.canEdit" class="send-button md-accent md-raised" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n                        SAVE\n                      </md-button>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",'<div id="salesforceAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.SALESFORCEACCOUNTS">SalesforceAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSalesforceAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSalesforceAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-salesforceAccounts-count">\n          <span>{{vm.selectedSalesforceAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSalesforceAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSalesforceAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSalesforceAccounts" csv-label="true" filename="salesforceAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSalesforceAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SALESFORCEACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSalesforceAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSalesforceAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.salesforceAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="salesforceAccount" md-select-id="id" ng-repeat="salesforceAccount in vm.salesforceAccounts.rows">\n                <td md-cell ng-if="salesforceAccount.userpic"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="api/users/{{salesforceAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!salesforceAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="id ">{{salesforceAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="name ">{{salesforceAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="username ">{{salesforceAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="remoteUri ">{{salesforceAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(salesforceAccount, $event    )" translate="INTEGRATIONS.EDIT_SALESFORCEACCOUNT">\n                          Edit SalesforceAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(salesforceAccount, $event    )" translate="INTEGRATIONS.TEST_SALESFORCEACCOUNT">\n                          Test SalesforceAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(salesforceAccount, $event    )" translate="INTEGRATIONS.DELETE_SALESFORCEACCOUNT">\n                          Delete SalesforceAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.salesforceAccounts.count}}" md-on-paginate="vm.getSalesforceAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SALESFORCEACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SALESFORCEACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-salesforceAccount-button" ng-click="vm.createOrEditSalesforceAccount($event)" aria-label="add salesforceAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SALESFORCEACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",'<md-dialog class="servicenowAccount-dialog" aria-label="New ServicenowAccount">\n  <form name="servicenowAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="servicenowAccountForm[\'name\'].$error" ng-show="servicenowAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true">\n\n        <div ng-messages="servicenowAccountForm[\'username\'].$error" ng-show="servicenowAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="servicenowAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true">\n\n        <div ng-messages="servicenowAccountForm[\'email\'].$error" ng-show="servicenowAccountForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.HOST">Host</label>\n        <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="servicenowAccountForm[\'remoteUri\'].$error" ng-show="servicenowAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="servicenowAccountForm[\'serverUrl\'].$error" ng-show="servicenowAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.servicenowAccount.description">\n\n        <div ng-messages="servicenowAccountForm[\'description\'].$error" ng-show="servicenowAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowAccount" ng-click="vm.saveServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid || servicenowAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowAccount" ng-click="vm.addNewServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n          ADD SERVICENOWACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowAccount" ng-click="vm.deleteServicenowAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",'<md-dialog class="servicenowConfiguration-dialog" aria-label="New ServicenowConfiguration">\n  <form name="servicenowConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.servicenowConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="servicenowConfigurationForm[\'name\'].$error" ng-show="servicenowConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.servicenowConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="servicenowConfigurationForm[\'channel\'].$error" ng-show="servicenowConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.servicenowConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="servicenowConfigurationForm[\'type\'].$error" ng-show="servicenowConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowConfiguration" ng-click="vm.saveServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid || servicenowConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowConfiguration" ng-click="vm.addNewServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION">\n          ADD SERVICENOWCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowConfiguration" ng-click="vm.deleteServicenowConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",'<md-dialog class="servicenowAccount-item-dialog" aria-label="New Item">\n  <form name="servicenowAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="servicenowAccountItemForm.key.$error" ng-show="servicenowAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="servicenowAccountItemForm.keyType.$error" ng-show="servicenowAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="servicenowAccountItemForm.keyContent.$error" ng-show="servicenowAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="servicenowAccountItemForm.customField.$error" ng-show="servicenowAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="servicenowAccountItemForm.option.$error" ng-show="servicenowAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="servicenowAccountItemForm.content.$error"\n          ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="servicenowAccountItemForm.variableName.$error"\n          ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/view.html",'<div id="integrations-servicenowAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-servicenowAccounts-button md-icon-button" aria-label="Go to servicenowAccounts" ng-click="vm.gotoServicenowAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SERVICENOWACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="servicenowAccount-image" hide-xs>\n          <img ng-src="assets/images/business/servicenowAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.servicenowAccount.id}}\n            <span ng-if="vm.servicenowAccount.name">{{vm.servicenowAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.servicenowAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveServicenowAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="servicenowAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.HOST">Host</label>\n                <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.servicenowAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="servicenowAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="ServicenowAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.servicenowAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" class="md-icon-button" aria-label="create servicenowConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="servicenowConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedServicenowConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getServicenowConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ servicenowConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteServicenowConfiguration($event, servicenowConfiguration)" translate="INTEGRATIONS.DELETE_SERVICENOWCONFIGURATION">\n                            Delete ServicenowConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",'<div id="servicenowAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.SERVICENOWACCOUNTS">ServicenowAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedServicenowAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedServicenowAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-servicenowAccounts-count">\n          <span>{{vm.selectedServicenowAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllServicenowAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectServicenowAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedServicenowAccounts" csv-label="true" filename="servicenowAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedServicenowAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SERVICENOWACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedServicenowAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getServicenowAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'INTEGRATIONS.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.servicenowAccounts.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="servicenowAccount" md-select-id="id" ng-repeat="servicenowAccount in vm.servicenowAccounts.rows">\n                <td md-cell ng-if="servicenowAccount.userpic"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="api/users/{{servicenowAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!servicenowAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="id ">{{servicenowAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="name ">{{servicenowAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="username ">{{servicenowAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="email ">{{servicenowAccount.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="remoteUri ">{{servicenowAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(servicenowAccount, $event    )" translate="INTEGRATIONS.EDIT_SERVICENOWACCOUNT">\n                          Edit ServicenowAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(servicenowAccount, $event    )" translate="INTEGRATIONS.TEST_SERVICENOWACCOUNT">\n                          Test ServicenowAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n\n                        <md-button ng-click="vm.deleteconfirm(servicenowAccount, $event    )" translate="INTEGRATIONS.DELETE_SERVICENOWACCOUNT">\n                          Delete ServicenowAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.servicenowAccounts.count}}" md-on-paginate="vm.getServicenowAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SERVICENOWACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SERVICENOWACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-servicenowAccount-button" ng-click="vm.createOrEditServicenowAccount($event)" aria-label="add servicenowAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SERVICENOWACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",'<md-dialog class="sugarcrmAccount-dialog" aria-label="New SugarcrmAccount">\n  <form name="sugarcrmAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="sugarcrmAccountForm[\'name\'].$error" ng-show="sugarcrmAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n\n        <div ng-messages="sugarcrmAccountForm[\'username\'].$error" ng-show="sugarcrmAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="sugarcrmAccountForm[\'remoteUri\'].$error" ng-show="sugarcrmAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="sugarcrmAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="sugarcrmAccountForm[\'serverUrl\'].$error" ng-show="sugarcrmAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n\n        <div ng-messages="sugarcrmAccountForm[\'description\'].$error" ng-show="sugarcrmAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmAccount" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid || sugarcrmAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmAccount" ng-click="vm.addNewSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n          ADD SUGARCRMACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmAccount" ng-click="vm.deleteSugarcrmAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",'<md-dialog class="sugarcrmConfiguration-dialog" aria-label="New SugarcrmConfiguration">\n  <form name="sugarcrmConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.sugarcrmConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="sugarcrmConfigurationForm[\'name\'].$error" ng-show="sugarcrmConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.sugarcrmConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="sugarcrmConfigurationForm[\'channel\'].$error" ng-show="sugarcrmConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.sugarcrmConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="sugarcrmConfigurationForm[\'type\'].$error" ng-show="sugarcrmConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmConfiguration" ng-click="vm.saveSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid || sugarcrmConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmConfiguration" ng-click="vm.addNewSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION">\n          ADD SUGARCRMCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmConfiguration" ng-click="vm.deleteSugarcrmConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",'<md-dialog class="sugarcrmAccount-item-dialog" aria-label="New Item">\n  <form name="sugarcrmAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="sugarcrmAccountItemForm.key.$error" ng-show="sugarcrmAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="sugarcrmAccountItemForm.keyType.$error" ng-show="sugarcrmAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="sugarcrmAccountItemForm.keyContent.$error" ng-show="sugarcrmAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="sugarcrmAccountItemForm.customField.$error" ng-show="sugarcrmAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="sugarcrmAccountItemForm.content.$error"\n          ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="sugarcrmAccountItemForm.variableName.$error"\n          ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",'<div id="integrations-sugarcrmAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-sugarcrmAccounts-button md-icon-button" aria-label="Go to sugarcrmAccounts" ng-click="vm.gotoSugarcrmAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SUGARCRMACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="sugarcrmAccount-image" hide-xs>\n          <img ng-src="assets/images/business/sugarcrmAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.sugarcrmAccount.id}}\n            <span ng-if="vm.sugarcrmAccount.name">{{vm.sugarcrmAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.sugarcrmAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveSugarcrmAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="sugarcrmAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.sugarcrmAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="sugarcrmAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="SugarcrmAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.sugarcrmAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" class="md-icon-button" aria-label="create sugarcrmConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="sugarcrmConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSugarcrmConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSugarcrmConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ sugarcrmConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteSugarcrmConfiguration($event, sugarcrmConfiguration)" translate="INTEGRATIONS.DELETE_SUGARCRMCONFIGURATION">\n                            Delete SugarcrmConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",'<div id="sugarcrmAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.SUGARCRMACCOUNTS">SugarcrmAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSugarcrmAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSugarcrmAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-sugarcrmAccounts-count">\n          <span>{{vm.selectedSugarcrmAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSugarcrmAccounts" csv-label="true" filename="sugarcrmAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSugarcrmAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SUGARCRMACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSugarcrmAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSugarcrmAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.sugarcrmAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="sugarcrmAccount" md-select-id="id" ng-repeat="sugarcrmAccount in vm.sugarcrmAccounts.rows">\n                <td md-cell ng-if="sugarcrmAccount.userpic"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="api/users/{{sugarcrmAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!sugarcrmAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="id ">{{sugarcrmAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="name ">{{sugarcrmAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="username ">{{sugarcrmAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="remoteUri ">{{sugarcrmAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(sugarcrmAccount, $event    )" translate="INTEGRATIONS.EDIT_SUGARCRMACCOUNT">\n                          Edit SugarcrmAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(sugarcrmAccount, $event    )" translate="INTEGRATIONS.TEST_SUGARCRMACCOUNT">\n                          Test SugarcrmAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.deleteconfirm(sugarcrmAccount, $event    )" translate="INTEGRATIONS.DELETE_SUGARCRMACCOUNT">\n                          Delete SugarcrmAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sugarcrmAccounts.count}}" md-on-paginate="vm.getSugarcrmAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SUGARCRMACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SUGARCRMACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-sugarcrmAccount-button" ng-click="vm.createOrEditSugarcrmAccount($event)" aria-label="add sugarcrmAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SUGARCRMACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",'<md-dialog class="vtigerAccount-dialog" aria-label="New VtigerAccount">\n  <form name="vtigerAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="vtigerAccountForm[\'name\'].$error" ng-show="vtigerAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.vtigerAccount.description">\n\n        <div ng-messages="vtigerAccountForm[\'description\'].$error" ng-show="vtigerAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n        <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true">\n\n        <div ng-messages="vtigerAccountForm[\'username\'].$error" ng-show="vtigerAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n        <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true">\n\n        <div ng-messages="vtigerAccountForm[\'accessKey\'].$error" ng-show="vtigerAccountForm[\'accessKey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.HOST">Host</label>\n        <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="vtigerAccountForm[\'remoteUri\'].$error" ng-show="vtigerAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="vtigerAccountForm[\'serverUrl\'].$error" ng-show="vtigerAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerAccount" ng-click="vm.saveVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid || vtigerAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerAccount" ng-click="vm.addNewVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n          ADD VTIGERACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerAccount" ng-click="vm.deleteVtigerAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",'<md-dialog class="vtigerConfiguration-dialog" aria-label="New VtigerConfiguration">\n  <form name="vtigerConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.vtigerConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="vtigerConfigurationForm[\'name\'].$error" ng-show="vtigerConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.vtigerConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="vtigerConfigurationForm[\'channel\'].$error" ng-show="vtigerConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.vtigerConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="vtigerConfigurationForm[\'type\'].$error" ng-show="vtigerConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerConfiguration" ng-click="vm.saveVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid || vtigerConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerConfiguration" ng-click="vm.addNewVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERCONFIGURATION">\n          ADD VTIGERCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerConfiguration" ng-click="vm.deleteVtigerConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",'<md-dialog class="vtigerAccount-item-dialog" aria-label="New Item">\n  <form name="vtigerAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="vtigerAccountItemForm.key.$error" ng-show="vtigerAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="vtigerAccountItemForm.keyType.$error" ng-show="vtigerAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="vtigerAccountItemForm.keyContent.$error" ng-show="vtigerAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="vtigerAccountItemForm.customField.$error" ng-show="vtigerAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="vtigerAccountItemForm.option.$error" ng-show="vtigerAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="vtigerAccountItemForm.content.$error"\n          ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="vtigerAccountItemForm.variableName.$error"\n          ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/view.html",'<div id="integrations-vtigerAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-vtigerAccounts-button md-icon-button" aria-label="Go to vtigerAccounts" ng-click="vm.gotoVtigerAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_VTIGERACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="vtigerAccount-image" hide-xs>\n          <img ng-src="assets/images/business/vtigerAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.vtigerAccount.id}}\n            <span ng-if="vm.vtigerAccount.name">{{vm.vtigerAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.vtigerAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveVtigerAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="vtigerAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.vtigerAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n                <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n                <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'accessKey\'].$error" ng-show="generalForm[\'accessKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.HOST">Host</label>\n                <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="vtigerAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="VtigerAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.vtigerAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" class="md-icon-button" aria-label="create vtigerConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="vtigerConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedVtigerConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getVtigerConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ vtigerConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteVtigerConfiguration($event, vtigerConfiguration)" translate="INTEGRATIONS.DELETE_VTIGERCONFIGURATION">\n                            Delete VtigerConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",'<div id="vtigerAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.VTIGERACCOUNTS">VtigerAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVtigerAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVtigerAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-vtigerAccounts-count">\n          <span>{{vm.selectedVtigerAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVtigerAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVtigerAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVtigerAccounts" csv-label="true" filename="vtigerAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVtigerAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VTIGERACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVtigerAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVtigerAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.VTIGER_USER_NAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.vtigerAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="vtigerAccount" md-select-id="id" ng-repeat="vtigerAccount in vm.vtigerAccounts.rows">\n                <td md-cell ng-if="vtigerAccount.userpic"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="api/users/{{vtigerAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!vtigerAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="id ">{{vtigerAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="name ">{{vtigerAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="username ">{{vtigerAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="remoteUri ">{{vtigerAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(vtigerAccount, $event    )" translate="INTEGRATIONS.EDIT_VTIGERACCOUNT">\n                          Edit VtigerAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(vtigerAccount, $event    )" translate="INTEGRATIONS.TEST_VTIGERACCOUNT">\n                          Test VtigerAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(vtigerAccount, $event    )" translate="INTEGRATIONS.DELETE_VTIGERACCOUNT">\n                          Delete VtigerAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.vtigerAccounts.count}}" md-on-paginate="vm.getVtigerAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VTIGERACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VTIGERACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-vtigerAccount-button" ng-click="vm.createOrEditVtigerAccount($event)" aria-label="add vtigerAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VTIGERACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",'<md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">\n  <form name="zendeskAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="zendeskAccountForm[\'name\'].$error" ng-show="zendeskAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n          <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n          <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zendeskAccountForm[\'type\'].$error" ng-show="zendeskAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n\n        <div ng-messages="zendeskAccountForm[\'username\'].$error" ng-show="zendeskAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="zendeskAccountForm[\'remoteUri\'].$error" ng-show="zendeskAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n        <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n          <md-option ng-value="\'password\'">Password</md-option>\n          <md-option ng-value="\'token\'">Token</md-option>\n        </md-select>\n        <div ng-messages="zendeskAccountForm[\'authType\'].$error" ng-show="zendeskAccountForm[\'authType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="zendeskAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n        <label translate="INTEGRATIONS.TOKEN">Token</label>\n        <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n\n        <div ng-messages="zendeskAccountForm[\'token\'].$error" ng-show="zendeskAccountForm[\'token\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="zendeskAccountForm[\'serverUrl\'].$error" ng-show="zendeskAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n\n        <div ng-messages="zendeskAccountForm[\'description\'].$error" ng-show="zendeskAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskAccount" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskAccount" ng-click="vm.addNewZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n          ADD ZENDESKACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskAccount" ng-click="vm.deleteZendeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",'<md-dialog class="zendeskAccount-item-dialog" aria-label="New Item">\n  <form name="zendeskAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="zendeskAccountItemForm.key.$error" ng-show="zendeskAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="zendeskAccountItemForm.keyType.$error" ng-show="zendeskAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="zendeskAccountItemForm.keyContent.$error" ng-show="zendeskAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="zendeskAccountItemForm.customField.$error" ng-show="zendeskAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="zendeskAccountItemForm.content.$error"\n          ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="zendeskAccountItemForm.variableName.$error"\n          ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/view.html",'<div id="integrations-zendeskAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-zendeskAccounts-button md-icon-button" aria-label="Go to zendeskAccounts" ng-click="vm.gotoZendeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZENDESKACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="zendeskAccount-image" hide-xs>\n          <img ng-src="assets/images/business/zendeskAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.zendeskAccount.id}}\n            <span ng-if="vm.zendeskAccount.name">{{vm.zendeskAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zendeskAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveZendeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (zendeskConfigurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="zendeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.zendeskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n                  <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n                <md-select name="authType" ng-model="vm.zendeskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'password\'">Password</md-option>\n                  <md-option ng-value="\'token\'">Token</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n                <label translate="INTEGRATIONS.TOKEN">Token</label>\n                <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'token\'].$error" ng-show="generalForm[\'token\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.zendeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="zendeskAccount-detail-form-container zendeskconfigurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.ZENDESKCONFIGURATIONS">ZENDESKCONFIGURATIONS</div>\n            </div>\n            <div ng-controller="ZendeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zendeskAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" class="md-icon-button" aria-label="create zendeskConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="zendeskConfiguration in vm_cc.zendeskConfigurations" class="border-top" md-colors="{background: (vm_cc.selectedZendeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZendeskConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ zendeskConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteZendeskConfiguration($event, zendeskConfiguration)" translate="INTEGRATIONS.DELETE_ZENDESKCONFIGURATION">\n                            Delete ZendeskConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.zendeskConfigurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.TAGS">TAGS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-table-container class="md-whiteframe-1dp padding-20">\n                        <md-input-container class="md-block">\n                          <label translate="INTEGRATIONS.TAGS">Tags</label>\n                          <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n                            <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.zendeskConfigurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",'<md-dialog class="zendeskConfiguration-dialog" aria-label="New ZendeskConfiguration">\n  <form name="zendeskConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.zendeskConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="zendeskConfigurationForm[\'name\'].$error" ng-show="zendeskConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.zendeskConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zendeskConfigurationForm[\'channel\'].$error" ng-show="zendeskConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.zendeskConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zendeskConfigurationForm[\'type\'].$error" ng-show="zendeskConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskConfiguration" ng-click="vm.saveZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid || zendeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskConfiguration" ng-click="vm.addNewZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKCONFIGURATION">\n          ADD ZENDESKCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskConfiguration" ng-click="vm.deleteZendeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",'<div id="zendeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.ZENDESKACCOUNTS">ZendeskAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedZendeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-zendeskAccounts-count">\n          <span>{{vm.selectedZendeskAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllZendeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectZendeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedZendeskAccounts" csv-label="true" filename="zendeskAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZendeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- ZENDESKACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedZendeskAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZendeskAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.zendeskAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="zendeskAccount" md-select-id="id" ng-repeat="zendeskAccount in vm.zendeskAccounts.rows">\n                <td md-cell ng-if="zendeskAccount.userpic"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="api/users/{{zendeskAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!zendeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="id ">{{zendeskAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="name ">{{zendeskAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="username ">{{zendeskAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="remoteUri ">{{zendeskAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(zendeskAccount, $event    )" translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT">\n                          Edit ZendeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(zendeskAccount, $event    )" translate="INTEGRATIONS.TEST_ZENDESKACCOUNT">\n                          Test ZendeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(zendeskAccount, $event    )" translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT">\n                          Delete ZendeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zendeskAccounts.count}}" md-on-paginate="vm.getZendeskAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / ZENDESKACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD ZENDESKACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zendeskAccount-button" ng-click="vm.createOrEditZendeskAccount($event)" aria-label="add zendeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD ZENDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/create/dialog.html",'<md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">\n  <form name="zohoAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="zohoAccountForm[\'name\'].$error" ng-show="zohoAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.HOST">Host</label>\n        <md-select name="host" ng-model="vm.zohoAccount.host" required>\n          <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n          <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n        </md-select>\n        <div ng-messages="zohoAccountForm[\'host\'].$error" ng-show="zohoAccountForm[\'host\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.ZONE">Zone</label>\n        <md-select name="zone" ng-model="vm.zohoAccount.zone" required>\n          <md-option ng-value="\'US\'">US</md-option>\n          <md-option ng-value="\'AU\'">AU</md-option>\n          <md-option ng-value="\'EU\'">EU</md-option>\n          <md-option ng-value="\'IN\'">IN</md-option>\n          <md-option ng-value="\'CN\'">CN</md-option>\n        </md-select>\n        <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>\n        <div ng-messages="zohoAccountForm[\'zone\'].$error" ng-show="zohoAccountForm[\'zone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED">Zone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n        <input type="text" name="clientId" ng-model="vm.zohoAccount.clientId" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTID"></span></div>\n        <div ng-messages="zohoAccountForm[\'clientId\'].$error" ng-show="zohoAccountForm[\'clientId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n        <input type="text" name="clientSecret" ng-model="vm.zohoAccount.clientSecret" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span></div>\n        <div ng-messages="zohoAccountForm[\'clientSecret\'].$error" ng-show="zohoAccountForm[\'clientSecret\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CODE">Code</label>\n        <input type="text" name="code" ng-model="vm.zohoAccount.code" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>\n        <div ng-messages="zohoAccountForm[\'code\'].$error" ng-show="zohoAccountForm[\'code\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED">Code field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="zohoAccountForm[\'serverUrl\'].$error" ng-show="zohoAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.zohoAccount.description">\n\n        <div ng-messages="zohoAccountForm[\'description\'].$error" ng-show="zohoAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoAccount" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoAccount" ng-click="vm.addNewZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n          ADD ZOHOACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoAccount" ng-click="vm.deleteZohoAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",'<md-dialog class="zohoConfiguration-dialog" aria-label="New ZohoConfiguration">\n  <form name="zohoConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.zohoConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="zohoConfigurationForm[\'name\'].$error" ng-show="zohoConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.zohoConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zohoConfigurationForm[\'channel\'].$error" ng-show="zohoConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.zohoConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zohoConfigurationForm[\'type\'].$error" ng-show="zohoConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoConfiguration" ng-click="vm.saveZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid || zohoConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoConfiguration" ng-click="vm.addNewZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOCONFIGURATION">\n          ADD ZOHOCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoConfiguration" ng-click="vm.deleteZohoConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",'<md-dialog class="zohoAccount-item-dialog" aria-label="New Item">\n  <form name="zohoAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="zohoAccountItemForm.key.$error" ng-show="zohoAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="zohoAccountItemForm.keyType.$error" ng-show="zohoAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="zohoAccountItemForm.keyContent.$error" ng-show="zohoAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="zohoAccountItemForm.customField.$error" ng-show="zohoAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="zohoAccountItemForm.content.$error"\n          ng-show="zohoAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="zohoAccountItemForm.variableName.$error"\n          ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/view.html",'<div id="integrations-zohoAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-zohoAccounts-button md-icon-button" aria-label="Go to zohoAccounts" ng-click="vm.gotoZohoAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZOHOACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="zohoAccount-image" hide-xs>\n          <img ng-src="assets/images/business/zohoAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.zohoAccount.id}}\n            <span ng-if="vm.zohoAccount.name">{{vm.zohoAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zohoAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveZohoAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="zohoAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.HOST">Host</label>\n                <md-select name="host" ng-model="vm.zohoAccount.host" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n                  <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.ZONE">Zone</label>\n                <md-select name="zone" ng-model="vm.zohoAccount.zone" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'US\'">US</md-option>\n                  <md-option ng-value="\'AU\'">AU</md-option>\n                  <md-option ng-value="\'EU\'">EU</md-option>\n                  <md-option ng-value="\'IN\'">IN</md-option>\n                  <md-option ng-value="\'CN\'">CN</md-option>\n                </md-select>\n                <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>\n                <div ng-messages="generalForm[\'zone\'].$error" ng-show="generalForm[\'zone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED">Zone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n                <input type="text" name="clientId" ng-model="vm.zohoAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTID"></span></div>\n                <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n                <input type="text" name="clientSecret" ng-model="vm.zohoAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span></div>\n                <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CODE">Code</label>\n                <input type="text" name="code" ng-model="vm.zohoAccount.code" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>\n                <div ng-messages="generalForm[\'code\'].$error" ng-show="generalForm[\'code\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED">Code field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.REFRESHTOKEN">RefreshToken</label>\n                <input type="text" name="refreshToken" ng-model="vm.zohoAccount.refreshToken" disabled>\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.REFRESHTOKEN"></span></div>\n                <div ng-messages="generalForm[\'refreshToken\'].$error" ng-show="generalForm[\'refreshToken\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.REFRESHTOKEN_REQUIRED">RefreshToken field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.zohoAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="zohoAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="ZohoAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zohoAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" class="md-icon-button" aria-label="create zohoConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="zohoConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedZohoConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZohoConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ zohoConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteZohoConfiguration($event, zohoConfiguration)" translate="INTEGRATIONS.DELETE_ZOHOCONFIGURATION">\n                            Delete ZohoConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.ADVANCED">\n                        ADVANCED\n                      </span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <div layout-margin>\n                        <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n                        <md-select ng-model="vm_cc.zohoConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n                          <md-option ng-value="option.key" ng-repeat="option in [{key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">\n                            {{ option.value }}</md-option>\n                        </md-select>\n                      </div>\n                      <div layout-margin>\n                        <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n                        <md-select ng-model="vm_cc.zohoConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n                          <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">\n                            {{ option.value }}</md-option>\n                        </md-select>\n                      </div>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",'<div id="zohoAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.ZOHOACCOUNTS">ZohoAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedZohoAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedZohoAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-zohoAccounts-count">\n          <span>{{vm.selectedZohoAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllZohoAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectZohoAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedZohoAccounts" csv-label="true" filename="zohoAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZohoAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- ZOHOACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedZohoAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZohoAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="host">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n                <th md-column md-order-by="zone">{{ \'INTEGRATIONS.ZONE\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.zohoAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="zohoAccount" md-select-id="id" ng-repeat="zohoAccount in vm.zohoAccounts.rows">\n                <td md-cell ng-if="zohoAccount.userpic"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="api/users/{{zohoAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!zohoAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="id ">{{zohoAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="name ">{{zohoAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="host ">{{ vm.arrayhost[zohoAccount.host].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="zone ">{{ vm.arrayzone[zohoAccount.zone].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(zohoAccount, $event    )" translate="INTEGRATIONS.EDIT_ZOHOACCOUNT">\n                          Edit ZohoAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(zohoAccount, $event    )" translate="INTEGRATIONS.TEST_ZOHOACCOUNT">\n                          Test ZohoAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(zohoAccount, $event    )" translate="INTEGRATIONS.DELETE_ZOHOACCOUNT">\n                          Delete ZohoAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zohoAccounts.count}}" md-on-paginate="vm.getZohoAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / ZOHOACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD ZOHOACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zohoAccount-button" ng-click="vm.createOrEditZohoAccount($event)" aria-label="add zohoAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD ZOHOACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/jscripty/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n  <form name="projectForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="JSCRIPTY.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n        <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n        <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.project.description">\n\n        <div ng-messages="projectForm[\'description\'].$error" ng-show="projectForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="ADD" translate="JSCRIPTY.ADD_PROJECT" translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n          ADD PROJECT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="JSCRIPTY.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="JSCRIPTY.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/clone/clone.html",'<md-dialog class="project-dialog" aria-label="Clone Project">\n  <form name="projectForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="JSCRIPTY.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n        <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n        <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="CLONE" translate="JSCRIPTY.CLONE_PROJECT" translate-attr-aria-label="JSCRIPTY.CLONE_PROJECT">\n        CLONE PROJECT\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",'<md-dialog class="session-dialog" aria-label="New Session">\n  <form name="sessionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <md-list>\n        <md-subheader class="md-no-sticky">\n          <div class="margin-bottom-5"><span translate="JSCRIPTY.ANSWERS">Answers</span></div>\n          <div class="subtitle secondary-text">\n            <span translate="JSCRIPTY.STARTTIME" class="ng-scope font-weight-700">Start Time</span>: <span class="ng-binding">{{vm.session.starttime | date:\'medium\'}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="JSCRIPTY.MEMBERNAME" class="ng-scope font-weight-700">Member Name</span>: <span class="ng-binding">{{vm.session.membername}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="JSCRIPTY.PROJECT" class="ng-scope font-weight-700">Project</span>: <span class="ng-binding">{{vm.project.name}}</span>\n          </div>\n        </md-subheader>\n        <md-list-item ng-if="vm.questions.rows.length" class="md-2-line contact-item" ng-repeat="question in vm.questions.rows">\n          <div class="md-list-item-text compact">\n            <h3>{{$index+1}}. {{question.question}}</h3>\n            <p>{{question.answer}}</p>\n          </div>\n          <md-divider ng-if="!$last"></md-divider>\n        </md-list-item>\n        <md-list-item ng-if="!vm.questions.rows.length" class="md-2-line contact-item">\n          <div class="md-list-item-text compact">\n            <h3><span class="text-boxed-light" translate="JSCRIPTY.NO_RESULTS_AVAILABLE">No results available</span></h3>\n          </div>\n        </md-list-item>\n      </md-list>\n\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/view.html",'<div id="jscripty-project" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="JSCRIPTY.GO_TO_PROJECTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="project-image" hide-xs>\n          <img ng-src="assets/images/business/projects.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.project.id}}\n            <span ng-if="vm.project.name">{{vm.project.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="JSCRIPTY.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.project, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="JSCRIPTY.CLONE_PROJECT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveProject()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (builderForm.$invalid) || (previewForm.$invalid) || (sessionsForm.$invalid) || (answersForm.$invalid)" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="JSCRIPTY.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="JSCRIPTY.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.project.enableUncompleteSave" aria-label="EnableUncompleteSave" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.ENABLEUNCOMPLETESAVE">EnableUncompleteSave</span></md-switch>\n                <div class="hint"><span translate="JSCRIPTY.HELP.ENABLEUNCOMPLETESAVE"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.project.sendUnpauseOnSubmit" aria-label="SendUnpauseOnSubmit" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.SENDUNPAUSEONSUBMIT">SendUnpauseOnSubmit</span></md-switch>\n                <div class="hint"><span translate="JSCRIPTY.HELP.SENDUNPAUSEONSUBMIT"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.project.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.BUILDER">BUILDER</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container builder md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ProjectBuilderController as vm_bc" ng-init="vm_bc.init(vm.project)">\n              <mw-form-builder ng-if="vm_bc.project.formData" form-data="vm_bc.project.formData" options="vm_bc.optionsBuilder" read-only="false"></mw-form-builder>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.PREVIEW">PREVIEW</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container preview md-background-bg md-whiteframe-1dp">\n            <div layout="column" layout-align="center" ng-controller="ProjectViewerController as vm_vc" ng-init="vm_vc.init(vm.project)">\n              <div layout="row" layout-align="center">\n                <md-button class="md-raised md-accent" aria-label="Reset" ng-click="vm_vc.resetViewer()">\n                  Reset\n                </md-button>\n              </div>\n              <mw-form-viewer ng-if="vm_vc.project.formData" form-data="vm_vc.project.formData" response-data="vm_vc.responseData" on-submit="vm_vc.onSubmit($event)" api="vm_vc.formViewer"></mw-form-viewer>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.SESSIONS">SESSIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container sessions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ProjectSessionsController as vm_dc" ng-init="vm_dc.init(vm.project, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedProjectSessions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="JSCRIPTY.SESSIONS">Sessions</span>\n                  <ms-search-bar on-search="vm_dc.getProjectSessions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedProjectSessions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedProjectSessions.length}} {{vm_dc.selectedProjectSessions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedProjectSessions" csv-label="true" filename="projects.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedProjectSessions($event)" aria-label="delete selected" translate translate-attr-label="JSCRIPTY.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedProjectSessions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getProjectSessions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'JSCRIPTY.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'JSCRIPTY.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'JSCRIPTY.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="membername">\n                        {{ \'JSCRIPTY.MEMBERNAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'JSCRIPTY.CALLERIDNUM\' | translate }}\n                      </th>\n                      <th md-column md-order-by="completed">\n                        {{ \'JSCRIPTY.COMPLETE\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="session" md-select-id="id" ng-repeat="session in vm_dc.projectSessions.rows">\n                      <td md-cell>\n                        {{session.id}}\n                      </td>\n                      <td md-cell>\n                        {{ session.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ session.endtime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{session.membername}}\n                      </td>\n                      <td md-cell>\n                        {{session.calleridnum}}\n                      </td>\n                      <td md-cell class="completed ">\n                        <md-icon md-colors="{color: {{session.completed ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{session.completed? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.showQuestionsProjectSession($event, session)" translate="JSCRIPTY.SHOW_QUESTIONS_SESSION">\n                                Results Session\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(session, $event)" translate="JSCRIPTY.DELETE_SESSION">\n                                Delete Session\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.projectSessions.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="JSCRIPTY.NO_SESSION_AVAILABLE">No session available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.projectSessions.count}}" md-on-paginate="vm_dc.getProjectSessions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.ANSWERS">ANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container answers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ProjectAnswersController as vm_an" ng-init="vm_an.init(vm.project, vm.userProfile)">\n              <div class="pb-16" layout="row">\n                <div class="h2 secondary-text" translate="JSCRIPTY.ANSWERS" flex>Answers</div>\n                <div layout="row" layout-align="space-between center" flex>\n                  <md-date-range localization-map="vm_an.localizationMap" ng-model="vm_an.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_an.getAnswers()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n                  <md-button type="button" ng-if="vm_an.currentUser.role === \'admin\' || vm_an.userProfile.downloadJscriptySessions" ng-disabled="!vm_an.answers" ng-click="vm_an.getSummary($event)" class="md-accent md-raised md-button ng-scope md-default-theme md-ink-ripple md-green-500-bg md-icon-button" title="{{\'JSCRIPTY.EXPORT_TO_CSV\' | translate}}">\n                    <md-icon md-font-icon="icon-file-excel" class="md-default-theme md-font material-icons icon-file-excel"></md-icon>\n                  </md-button>\n                </div>\n              </div>\n              <div layout="row">\n                <md-card class="md-whiteframe-1dp" ng-if="vm_an.answers && vm_an.hasIdAnswers" flex>\n                  <md-list>\n                    <md-list-item class="md-2-line contact-item" ng-repeat="(key, question) in vm_an.answers">\n                      <div class="md-list-item-text compact" layout-padding>\n                        <h3>{{question.question}}</h3>\n                        <md-table-container>\n                          <table md-table>\n                            <thead md-head>\n                              <tr md-row>\n                                <th md-column></th>\n                                <th md-column>#</th>\n                                <th md-column>%</th>\n                              </tr>\n                            </thead>\n                            <tbody md-body>\n                              <tr md-row ng-repeat="(key, value) in question.answers">\n                                <td md-cell>{{key}}</td>\n                                <td md-cell width="20px">{{value}}</td>\n                                <td md-cell width="20px">{{value*100/question.sum | number:1}}</td>\n                              </tr>\n                              <tr md-row>\n                                <td md-cell><b>{{\'JSCRIPTY.TOTAL\' | translate}}</b></td>\n                                <td md-cell width="20px"><b>{{question.sum}}</b></td>\n                                <td md-cell width="20px"><b>100</b></td>\n                              </tr>\n                            </tbody>\n                          </table>\n                        </md-table-container>\n                      </div>\n                      <md-divider ng-if="!$last"></md-divider>\n                    </md-list-item>\n                  </md-list>\n                </md-card>\n                <span ng-if="!vm_an.answers || !vm_an.hasIdAnswers" class="text-boxed-light" translate="JSCRIPTY.NO_ANSWERS_AVAILABLE">No answers available</span>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/jscripty/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-script" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="JSCRIPTY.PROJECTS">Projects</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="JSCRIPTY.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="JSCRIPTY.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-projects-count">\n          <span>{{vm.selectedProjects.length}}</span>\n          <span translate="JSCRIPTY.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="JSCRIPTY.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllProjects()" translate="JSCRIPTY.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectProjects()" translate="JSCRIPTY.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="JSCRIPTY.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- PROJECT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'JSCRIPTY.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'JSCRIPTY.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'JSCRIPTY.CREATED_AT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.projects.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="JSCRIPTY.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n                <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n                <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="createdAt ">{{project.createdAt | date:\'medium\' }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(project, $event    )" translate="JSCRIPTY.EDIT_PROJECT">\n                          Edit Project\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(project, $event    )" translate="JSCRIPTY.CLONE_PROJECT">\n                          clone Project\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.sessionsgoto(project, $event    )" translate="JSCRIPTY.SESSIONS_PROJECT">\n                          Sessions Project\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.deleteconfirm(project, $event    )" translate="JSCRIPTY.DELETE_PROJECT">\n                          Delete Project\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / PROJECT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD PROJECT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD PROJECT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/create/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newMailAccount ? \'MAIL.NEW_MAILACCOUNT\' : \'MAIL.EDIT_MAILACCOUNT\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="mailAccountForm[\'name\'].$error" ng-show="mailAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="mailAccountForm[\'key\'].$error" ng-show="mailAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.EMAIL_ADDRESS">Email Address</label>\n        <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n\n        <div ng-messages="mailAccountForm[\'email\'].$error" ng-show="mailAccountForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email Address field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email Address must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountForm[\'ListId\'].$error" ng-show="mailAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.newMailAccount" class="md-block">\n        <label translate="MAIL.SERVICE">Service</label>\n        <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" required>\n          <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountForm[\'provider\'].$error" ng-show="mailAccountForm[\'provider\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'">\n        <div layout="row">\n          <md-input-container class="md-block mr-20 mb-0" flex>\n            <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n            <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n            <div ng-messages="mailAccountForm[\'Imap.host\'].$error" ng-show="mailAccountForm[\'Imap.host\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block mb-0">\n            <label translate="MAIL.IMAP_PORT">IMAP Port</label>\n            <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" value="465" ng-required="true">\n            <div ng-messages="mailAccountForm[\'Imap.port\'].$error" ng-show="mailAccountForm[\'Imap.port\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP Port field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n        </div>\n      </div>\n\n      <div ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'">\n        <div layout="row">\n          <md-input-container class="md-block mr-20 mb-0" flex>\n            <label translate="MAIL.SMTP_HOST">SMTP Host</label>\n            <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n            <div ng-messages="mailAccountForm[\'Smtp.host\'].$error" ng-show="mailAccountForm[\'Smtp.host\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP Host field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block mb-0">\n            <label translate="MAIL.SMTP_PORT">SMTP Port</label>\n            <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true">\n            <div ng-messages="mailAccountForm[\'Smtp.port\'].$error" ng-show="mailAccountForm[\'Smtp.port\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP Port field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n        </div>\n      </div>\n\n      <md-input-container ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'" class="md-block pt-0">\n        <md-switch ng-model="vm.mailAccount.authentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.newMailAccount && vm.mailAccount.provider === \'outlook365\'" class="md-block">\n        <md-switch ng-model="vm.mailAccount.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n      </md-input-container>\n\n      <div ng-if="vm.newMailAccount && vm.mailAccount.authentication && vm.mailAccount.provider">\n        <md-input-container class="md-block">\n          <label translate="MAIL.USERNAME">Username</label>\n          <input type="text" name="username" ng-model="vm.mailAccount.username" ng-required="true">\n          <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n          <div ng-messages="mailAccountForm[\'username\'].$error" ng-show="mailAccountForm[\'username\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.mailAccount.modernAuthentication" class="md-block">\n          <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n          <md-select name="cloudProvider" ng-model="vm.mailAccount.CloudProviderId" required>\n            <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n          </md-select>\n          <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n          <div ng-messages="mailAccountForm[\'cloudProvider\'].$error" ng-show="mailAccountForm[\'cloudProvider\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="!vm.mailAccount.modernAuthentication" class="md-block">\n          <label translate="MAIL.PASSWORD">Password</label>\n          <input type="password" name="password" ng-model="vm.mailAccount.password" translate-attr-placeholder="MAIL.PASSWORD" required>\n          <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n          <div ng-messages="mailAccountForm[\'password\'].$error" role="alert">\n            <div ng-message="required">\n              <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n            </div>\n            <div ng-message="pattern">\n              <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="MAIL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.mailAccount.description">\n        <div ng-messages="mailAccountForm[\'description\'].$error" ng-show="mailAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailAccount" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid || mailAccountForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailAccount" ng-click="vm.addNewMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILACCOUNT" translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n          ADD MAIL ACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailAccount" ng-click="vm.deleteMailAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",'<md-dialog class="mailAccount-dialog" aria-label="mailAccount" ng-init="vm.onInit()">\n  <form name="mailAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MAIL.AGENTADD_MAILACCOUNT">Add Agent to mailAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/agent/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'agent\'].$error" ng-show="mailAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'times\'].$error" ng-show="mailAccountFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.REPLY_TYPE">Reply_Type</label>\n        <md-select name="replyType" ng-model="vm.autoreply.replyType" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="0">Reply</md-option>\n          <md-option ng-value="1">Reply All</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'replyType\'].$error" ng-show="mailAccountFormApp[\'replyType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.REPLY_TYPE_REQUIRED">Reply_Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="md-block">\n        <label class="md-caption grey-fg" translate="MAIL.TEXT">Text</label>\n        <textarea aria-label="Text text" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.autoreply.text"></textarea>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/close/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'disposition\'].$error" ng-show="mailAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'condition\'].$error" ng-show="mailAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'truepriority\'].$error" ng-show="mailAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'falsepriority\'].$error" ng-show="mailAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'priority\'].$error" ng-show="mailAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/noop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'value\'].$error" ng-show="mailAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/queue/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'queue\'].$error" ng-show="mailAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/system/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'command\'].$error" ng-show="mailAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'variable\'].$error" ng-show="mailAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/tag/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'tag\'].$error" ng-show="mailAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",'<md-dialog class="mailCannedAnswer-dialog" aria-label="New MailCannedAnswer">\n  <form name="mailCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.mailCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="mailCannedAnswerForm[\'key\'].$error" ng-show="mailCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="md-block">\n        <label class="md-caption grey-fg" translate="MAIL.VALUE">Value</label>\n        <textarea aria-label="Value value" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.mailCannedAnswer.value"></textarea>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.mailCannedAnswer.description">\n\n        <div ng-messages="mailCannedAnswerForm[\'description\'].$error" ng-show="mailCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailCannedAnswer" ng-click="vm.saveMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid || mailCannedAnswerForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailCannedAnswer" ng-click="vm.addNewMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILCANNEDANSWER" translate-attr-aria-label="MAIL.ADD_MAILCANNEDANSWER">\n          ADD MAILCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailCannedAnswer" ng-click="vm.deleteMailCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/view.html",'<div id="mail-mailAccount" class="page-layout simple tabbed" layout="column">\n\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-mailAccounts-button md-icon-button" aria-label="Go to mailAccounts" ng-click="vm.goToMailAccounts()" translate translate-attr-aria-label="MAIL.GO_TO_MAILACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="mailAccount-image" hide-xs>\n          <img ng-src="assets/images/business/mailAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.mailAccount.id}}\n            <span ng-if="vm.mailAccount.name">{{vm.mailAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.goToRealtime()" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="MAIL.GOTO_MAILACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.addAgent(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="MAIL.AGENTADD_MAILACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveMailAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (credentialsForm.$invalid) || (templateForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (imapForm.$invalid) || (smtpForm.$invalid) || (dispositionForm.$invalid) || (mailDispositionsForm.$invalid) || (mailCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.SERVICE">Service</label>\n                <md-select name="provider" ng-model="vm.mailAccount.provider" class="mb-20" required>\n                  <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'provider\'].$error" ng-show="generalForm[\'provider\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n                <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.mailAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.markAsUnread" aria-label="mark_as_unread" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MARK_AS_UNREAD">mark_as_unread</span></md-switch>\n                <div class="hint"><span translate="MAIL.HELP.MARK_AS_UNREAD"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.mailAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.mailAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.mailAccount.provider !== \'custom\'">\n        <md-tab-label>\n          <span translate="MAIL.AUTHENTICATION">Authentication</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.CREDENTIALS">Credentials</div>\n            </div>\n            <form name="credentialsForm" novalidate>\n              <md-input-container ng-if="vm.mailAccount.provider === \'outlook365\'" class="md-block">\n                <md-switch ng-model="vm.mailAccount.Imap.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n                <div ng-messages="credentialsForm[\'username\'].$error" ng-show="credentialsForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.Imap.modernAuthentication" class="md-block">\n                <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n                <md-select name="cloudProvider" ng-model="vm.mailAccount.Imap.CloudProviderId" required>\n                  <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n                <div ng-messages="credentialsForm[\'cloudProvider\'].$error" ng-show="credentialsForm[\'cloudProvider\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="!vm.mailAccount.Imap.modernAuthentication" class="md-block">\n                <label translate="MAIL.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n                <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n                <div ng-messages="credentialsForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n\n          <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n            </div>\n            <form name="imapForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.MAILBOX">Mailbox</label>\n                <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.CONNTIMEOUT">Connection Timeout</label>\n                <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">Connection Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Connection Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.AUTHTIMEOUT">Authorization Timeout</label>\n                <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" value="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">Authorizazion Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Authorizazion Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.mailAccount.provider === \'custom\'">\n        <md-tab-label>\n          <span translate="MAIL.IMAP">IMAP</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n            </div>\n            <form name="imapForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n                <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.host\'].$error" ng-show="imapForm[\'Imap.host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n                <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" value="465" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.port\'].$error" ng-show="imapForm[\'Imap.port\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Imap.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.Imap.authentication" class="md-block">\n                <label translate="MAIL.USERNAME">Username</label>\n                <input type="text" name="Imap.user" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n                <div ng-messages="imapForm[\'Imap.user\'].$error" ng-show="imapForm[\'Imap.user\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.mailAccount.Imap.authentication">\n                <label translate="MAIL.PASSWORD">Password</label>\n                <input type="password" name="Imap.password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n                <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n                <div ng-messages="imapForm[\'Imap.password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.MAILBOX">Mailbox</label>\n                <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.CONNTIMEOUT">Connection Timeout</label>\n                <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">Connection Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Connection Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.AUTHTIMEOUT">Authorization Timeout</label>\n                <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" value="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">Authorization Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Authorization Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.mailAccount.provider === \'custom\'">\n        <md-tab-label>\n          <span translate="MAIL.SMTP">SMTP</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container smtp md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.SMTP">SMTP</div>\n            </div>\n            <form name="smtpForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n                <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n                <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="Secure" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SECURE">Secure</span></md-switch>\n                <div class="hint"><span translate="MAIL.HELP.SECURE"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.Smtp.authentication" class="md-block">\n                <label translate="MAIL.USERNAME">Username</label>\n                <input type="text" name="Smtp.user" ng-model="vm.mailAccount.Smtp.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n                <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.mailAccount.Smtp.authentication">\n                <label translate="MAIL.PASSWORD">Password</label>\n                <input type="password" name="Smtp.pass" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n                <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n                <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container template md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.TEMPLATE">TEMPLATE</div>\n            </div>\n            <form name="templateForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.FONT_FAMILY">Font_Family</label>\n                <ms-font-family name="fontFamily" ng-model="vm.mailAccount.fontFamily" required></ms-font-family>\n                <div class="hint"><span translate="MAIL.HELP.FONT_FAMILY"></span></div>\n                <div ng-messages="templateForm[\'fontFamily\'].$error" ng-show="templateForm[fontFamily].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.FONT_FAMILY_REQUIRED">Font_Family field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.FONT_SIZE">Font_Size</label>\n                <input type="number" name="fontSize" ng-model="vm.mailAccount.fontSize" min="8" max="72" value="13" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MAIL.HELP.FONT_SIZE"></span></div>\n                <div ng-messages="templateForm[\'fontSize\'].$error" ng-show="templateForm[\'fontSize\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.FONT_SIZE_REQUIRED">Font_Size field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>8</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>72</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="MAIL.TEMPLATE">Template</label>\n                <textarea aria-label="Template template" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.mailAccount.template"></textarea>\n              </div>\n            </form>\n          </div>\n\n          <div class="mailAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="MAIL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.mailAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n\n          <div class="mailAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.queueTransfer == true" class="md-block">\n                <label translate="MAIL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.mailAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.agentTransfer == true" class="md-block">\n                <label translate="MAIL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.mailAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n\n          <div class="mailAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.mandatoryDisposition" class="md-block">\n                <label translate="MAIL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.mailAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MAIL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="MailAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="mailAccount-detail-form-container maildispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="MAIL.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add mail dispositions" translate translate-attr-label="MAIL.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="mailAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container mailcannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="MailAccountMailCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MAIL.MAILCANNEDANSWERS">MailCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getMailAccountMailCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event)" aria-label="add mailCannedAnswer" translate translate-attr-label="MAIL.ADD_MAILCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedMailAccountMailCannedAnswers.length}} {{vm_dc.selectedMailAccountMailCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailCannedAnswers" csv-label="true" filename="mailAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'MAIL.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'MAIL.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'MAIL.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'MAIL.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'MAIL.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="mailCannedAnswer" md-select-id="id" ng-repeat="mailCannedAnswer in vm_dc.mailAccountMailCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n                        {{mailCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n                        {{mailCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.value | htmlToPlaintext }}</td>\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n                        {{mailCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n                        {{ mailCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" translate="MAIL.EDIT_MAILCANNEDANSWER">\n                                Edit MailCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(mailCannedAnswer, $event)" translate="MAIL.DELETE_MAILCANNEDANSWER">\n                                Delete MailCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.mailAccountMailCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MAIL.NO_MAILCANNEDANSWER_AVAILABLE">No mailcannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountMailCannedAnswers.count}}" md-on-paginate="vm_dc.getMailAccountMailCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="MailAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.mailAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="MAIL.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedMailAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedMailAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedMailAccountApps.length}} {{vm_ac.selectedMailAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedMailAccountApps($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedMailAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.mailAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editMailAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.mailAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="MailAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MAIL.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getMailAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getMailAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getMailAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="MAIL.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedMailAccountInteractions.length}} {{vm_dc.selectedMailAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountInteractions" csv-label="true" filename="mailAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'MAIL.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'MAIL.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="subject">\n                        {{ \'MAIL.SUBJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'MAIL.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'MAIL.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'MAIL.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'MAIL.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'MAIL.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.mailAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <div class="width-300">\n                          <span class="text-truncate font-size-12">\n                            {{interaction.subject}}\n                          </span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'MAIL.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'MAIL.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spymailInteraction($event, interaction)" translate="MAIL.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n                              <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n                                Download with attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                                Download without attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="MAIL.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.mailAccountInteractions.rows.length">\n                      <td md-cell colspan="13">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MAIL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountInteractions.count}}" md-on-paginate="vm_dc.getMailAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/mailAccounts.html",'<div id="mailAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MAIL.MAILACCOUNTS">MailAccounts</span>\n      </div>\n    </div>\n    <div layout="row">\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n    </div>\n  </div>\n\n  <div ng-show="vm.selectedMailAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMailAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MAIL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-mailAccounts-count">\n          <span>{{vm.selectedMailAccounts.length}}</span>\n          <span translate="MAIL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMailAccounts()" translate="MAIL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMailAccounts()" translate="MAIL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMailAccounts" csv-label="true" filename="mailAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailAccounts($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    <div class="main scrollable">\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMailAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n                <th md-column md-order-by="provider">{{ \'MAIL.SERVICE\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'MAIL.EMAIL_ADDRESS\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'MAIL.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.mailAccounts.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="mailAccount" md-select-id="id" ng-repeat="mailAccount in vm.mailAccounts.rows" ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)">\n                <td md-cell class="id">{{mailAccount.id}}</td>\n                <td md-cell class="name">{{mailAccount.name}}</td>\n                <td md-cell class="provider">{{ mailAccount.provider ? (mailAccount.provider | startcase) : (\'MAIL.CUSTOM\' | translate) }}</td>\n                <td md-cell class="key">{{mailAccount.key}}</td>\n                <td md-cell class="email">{{mailAccount.email}}</td>\n                <td md-cell class="active">\n                  <md-icon md-colors="{color: {{mailAccount.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{mailAccount.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td md-cell class="description ">{{mailAccount.description}}</td>\n                <td md-cell class="actions">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editstate(mailAccount, $event)" translate="MAIL.EDIT_MAILACCOUNT">\n                          Edit Email Account\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item>\n                        <md-button ng-click="vm.verifySMTP(mailAccount, $event)" translate="MAIL.VERIFYSMTP_MAILACCOUNT">\n                          Verify SMTP\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item>\n                        <md-button ng-click="vm.goToInteractions(mailAccount, $event)" translate="MAIL.INTERACTIONS_MAILACCOUNT">\n                          Go To Interactions\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item>\n                        <md-button ng-click="vm.goToRealtime()" translate="MAIL.GOTOREALTIME_MAILACCOUNT">\n                          Go To Realtime\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item>\n                        <md-button ng-click="vm.addAgent(mailAccount, $event)" translate="MAIL.AGENTADD_MAILACCOUNT">\n                          Add Agent To Email Account\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteconfirm(mailAccount, $event)" translate="MAIL.DELETE_MAILACCOUNT">\n                          Delete Email Account\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n      </md-card>\n    </div>\n  </div>\n\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailAccount-button" ng-click="vm.createOrEditMailAccount($event)" aria-label="add mailAccount" translate translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/create/dialog.html",'<md-dialog class="mailQueue-dialog" aria-label="New MailQueue">\n  <form name="mailQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newMailQueue">\n\n        <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n        <div ng-messages="mailQueueForm[\'name\'].$error" ng-show="mailQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="mailQueueForm[\'strategy\'].$error" ng-show="mailQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="mailQueueForm[\'timeout\'].$error" ng-show="mailQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.mailQueue.description">\n\n        <div ng-messages="mailQueueForm[\'description\'].$error" ng-show="mailQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailQueue" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid || mailQueueForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailQueue" ng-click="vm.addNewMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILQUEUE" translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n          ADD MAILQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailQueue" ng-click="vm.deleteMailQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n  <form name="mailQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MAIL.AGENTADD_MAILQUEUE">Add Agent to mailQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n  <form name="mailQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MAIL.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/view.html",'<div id="mail-mailQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-mailQueues-button md-icon-button" aria-label="Go to mailQueues" ng-click="vm.gotoMailQueues()" translate translate-attr-aria-label="MAIL.GO_TO_MAILQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="mailQueue-image" hide-xs>\n          <img ng-src="assets/images/business/mailQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.mailQueue.id}}\n            <span ng-if="vm.mailQueue.name">{{vm.mailQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.mailQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="MAIL.TEAMADD_MAILQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.mailQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="MAIL.AGENTADD_MAILQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveMailQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.mailQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.mailQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/mailQueues.html",'<div id="mailQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MAIL.MAILQUEUES">MailQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedMailQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMailQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MAIL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-mailQueues-count">\n          <span>{{vm.selectedMailQueues.length}}</span>\n          <span translate="MAIL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMailQueues()" translate="MAIL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMailQueues()" translate="MAIL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMailQueues" csv-label="true" filename="mailQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailQueues($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- MAILQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMailQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'MAIL.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.mailQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="mailQueue" md-select-id="id" ng-repeat="mailQueue in vm.mailQueues.rows">\n                <td md-cell ng-if="mailQueue.userpic"><img class="avatar" alt="{{mailQueue.name}}" ng-src="api/users/{{mailQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!mailQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="id ">{{mailQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="name ">{{mailQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="strategy ">{{ vm.arraystrategy[mailQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(mailQueue, $event    )" translate="MAIL.EDIT_MAILQUEUE">\n                          Edit MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(mailQueue, $event    )" translate="MAIL.TEAMADD_MAILQUEUE">\n                          teamadd MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(mailQueue, $event    )" translate="MAIL.AGENTADD_MAILQUEUE">\n                          agentadd MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(mailQueue, $event    )" translate="MAIL.DELETE_MAILQUEUE">\n                          Delete MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(mailQueue, $event    )" translate="MAIL.GOTOREALTIME_MAILQUEUE">\n                          goToRealtime MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailQueues.count}}" md-on-paginate="vm.getMailQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / MAILQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD MAILQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailQueue-button" ng-click="vm.createOrEditMailQueue($event)" aria-label="add mailQueue" translate translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD MAILQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailSubtatuses/create/dialog.html",'<md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">\n  <form name="mailSubstatusForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.mailSubstatus.name" ng-required="true" autofocus>\n\n        <div ng-messages="mailSubstatusForm[\'name\'].$error" ng-show="mailSubstatusForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.mailSubstatus.description">\n\n        <div ng-messages="mailSubstatusForm[\'description\'].$error" ng-show="mailSubstatusForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailSubstatus" ng-click="vm.saveMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailSubstatus" ng-click="vm.addNewMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILSUBSTATUS" translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n          ADD MAILSUBSTATUS\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailSubstatus" ng-click="vm.deleteMailSubstatus($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",'<div id="mailSubtatuses" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MAIL.MAILSUBSTATUSES">MailSubstatuses</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedMailSubstatuses.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMailSubstatuses =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MAIL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-mailSubtatuses-count">\n          <span>{{vm.selectedMailSubstatuses.length}}</span>\n          <span translate="MAIL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMailSubstatuses()" translate="MAIL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMailSubstatuses()" translate="MAIL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMailSubstatuses" csv-label="true" filename="mailSubtatuses.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailSubstatuses($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- MAILSUBSTATUS TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMailSubstatuses" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailSubstatuses">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.mailSubtatuses.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="mailSubstatus" md-select-id="id" ng-repeat="mailSubstatus in vm.mailSubtatuses.rows">\n                <td md-cell ng-if="mailSubstatus.userpic"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="api/users/{{mailSubstatus.id}}/avatar" /></td>\n                <td md-cell ng-if="!mailSubstatus.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="id ">{{mailSubstatus.id}}</td>\n                <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="name ">{{mailSubstatus.name}}</td>\n                <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="description ">{{mailSubstatus.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(mailSubstatus, $event    )" translate="MAIL.EDIT_MAILSUBSTATUS">\n                          Edit MailSubstatus\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(mailSubstatus, $event    )" translate="MAIL.DELETE_MAILSUBSTATUS">\n                          Delete MailSubstatus\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailSubtatuses.count}}" md-on-paginate="vm.getMailSubstatuses" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / MAILSUBSTATUS TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD MAILSUBSTATUS BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailSubstatus-button" ng-click="vm.createOrEditMailSubstatus($event)" aria-label="add mailSubstatus" translate translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD MAILSUBSTATUS BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MAIL.ACCOUNTS">Accounts</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.vm.getMailAccounts()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate}}</th>\n        <th md-column>{{\'MAIL.KEY\' | translate}}</th>\n        <th md-column>{{\'MAIL.TOTAL\' | translate}}</th>\n        <th md-column>{{\'MAIL.IN\' | translate}}</th>\n        <th md-column>{{\'MAIL.OUT\' | translate}}</th>\n        <th md-column>{{\'MAIL.IMAP_STATUS\' | translate}}</th>\n        <th md-column>{{\'MAIL.SMTP_STATUS\' | translate}}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.mailAccounts">\n        <td md-cell colspan="4">\n          <div layout="row" layout-align="center center">\n            <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="vm.mailAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n        <td md-cell>{{vm.mailAccounts[value].name}}</td>\n        <td md-cell>{{vm.mailAccounts[value].key}}</td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{(vm.mailAccounts[value].in || 0) + (vm.mailAccounts[value].out || 0)}}</span>\n        </td>\n        <td md-cell>\n          <div layout="row">\n            <span>\n              <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n            </span>\n            <span class="md-capture blue-fg">{{vm.mailAccounts[value].in || 0}}</span>\n            <span class="text-boxed" ng-if="mailAccount.in">{{vm.mailAccounts[value].lastIn ?  (vm.mailAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n          </div>\n        </td>\n        <td md-cell>\n          <div layout="row">\n            <span>\n              <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n            </span>\n            <span class="md-capture green-fg">{{vm.mailAccounts[value].out || 0}}</span>\n            <span class="text-boxed" ng-if="mailAccount.out">{{vm.mailAccounts[value].lastOut ?  (vm.mailAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n          </div>\n        </td>\n        <td md-cell>\n          <div layout="row" layout-align="start center">\n            <div layout="column" layout-align="center center">\n              <md-button class="md-icon-button" aria-label="Status">\n                <md-tooltip>{{vm.mailAccounts[value].Imap.messageStatus}}</md-tooltip>\n                <div ng-switch="vm.mailAccounts[value].Imap.status">\n                  <md-icon ng-switch-when="error" md-font-icon="icon-alert yellow-fg"></md-icon>\n                  <md-icon ng-switch-when="disabled" md-font-icon="icon-close grey-fg"></md-icon>\n                  <md-icon ng-switch-default md-font-icon="icon-checkbox-marked-circle-outline green-fg"></md-icon>\n                </div>\n              </md-button>\n              <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Imap.status.toUpperCase()) | translate}}</span>\n            </div>\n            <span class="text-boxed" ng-if="vm.mailAccounts[value].active && (vm.mailAccounts[value].Imap.lastSync && vm.mailAccounts[value].Imap.lastSync != \'\')">{{vm.mailAccounts[value].Imap.lastSync | date: \'shortTime\'}}</span>\n          </div>\n        </td>\n        <td md-cell>\n          <div layout="row" layout-align="start center" ng-if="vm.mailAccounts[value].Smtp.status">\n            <div layout="column" layout-align="center center">\n              <md-button class="md-icon-button" aria-label="Status">\n                <md-tooltip>{{vm.mailAccounts[value].Smtp.messageStatus}}</md-tooltip>\n                <md-icon md-font-icon="{{ vm.mailAccounts[value].Smtp.status == \'error\' ? \'icon-alert yellow-fg\' : \'icon-checkbox-marked-circle-outline green-fg\'}}"></md-icon>\n              </md-button>\n              <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Smtp.status.toUpperCase()) | translate}}</span>\n            </div>\n            <span class="text-boxed">{{vm.mailAccounts[value].Smtp.lastSync | date: \'shortTime\'}}</span>\n          </div>\n          <span class="md-caption grey-fg" ng-if="!vm.mailAccounts[value].Smtp.status">{{ \'MAIL.NEVER_VERIFIED\' | translate }}</span>\n        </td>\n        <td md-cell class="actions">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n\n            <md-menu-content width="4">\n              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                <md-button ng-click="vm.goToMailAccount($event, vm.mailAccounts[value])" translate="MAIL.EDIT_ACCOUNT">\n                  Edit Account\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.verifySmtp($event, vm.mailAccounts[value])" translate="MAIL.VERIFY_SMTP">\n                  Verify Smtp\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MAIL.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n        <th md-column>{{ \'MAIL.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'MAIL.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'MAIL.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="MAIL.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="MAIL.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/mail/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.ACCOUNTS">Accounts</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/create/dialog.html",'<md-dialog class="plugin-dialog" aria-label="New Plugin">\n  <form name="pluginForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus>\n\n        <div ng-messages="pluginForm[\'name\'].$error" ng-show="pluginForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.TYPE">Type</label>\n        <input type="text" name="type" ng-model="vm.plugin.type" ng-disabled="!vm.newPlugin">\n\n        <div ng-messages="pluginForm[\'type\'].$error" ng-show="pluginForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="!vm.newPlugin"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.plugin.description">\n\n        <div ng-messages="pluginForm[\'description\'].$error" ng-show="pluginForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.ICON">Icon</label>\n        <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true">\n\n        <div ng-messages="pluginForm[\'icon\'].$error" ng-show="pluginForm[\'icon\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n        <md-select name="sidebar" ng-model="vm.plugin.sidebar" required>\n          <md-option ng-value="\'always\'">Always</md-option>\n          <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n          <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n          <md-option ng-value="\'never\'">Never</md-option>\n        </md-select>\n        <div ng-messages="pluginForm[\'sidebar\'].$error" ng-show="pluginForm[\'sidebar\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n        <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n        <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl">\n\n        <div ng-messages="pluginForm[\'adminUrl\'].$error" ng-show="pluginForm[\'adminUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n        <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n        <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl">\n\n        <div ng-messages="pluginForm[\'agentUrl\'].$error" ng-show="pluginForm[\'agentUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n        <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n        <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" ng-disabled="!vm.newPlugin">\n\n        <div ng-messages="pluginForm[\'scriptName\'].$error" ng-show="pluginForm[\'scriptName\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n        <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n        <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true">\n\n        <div ng-messages="pluginForm[\'scriptPath\'].$error" ng-show="pluginForm[\'scriptPath\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.VERSION">Version</label>\n        <input type="text" name="version" ng-model="vm.plugin.version" ng-disabled="!vm.newPlugin">\n\n        <div ng-messages="pluginForm[\'version\'].$error" ng-show="pluginForm[\'version\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPlugin" ng-click="vm.savePlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid || pluginForm.$pristine" aria-label="SAVE" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPlugin" ng-click="vm.addNewPlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid" aria-label="ADD" translate="MARKETPLACE.ADD_PLUGIN" translate-attr-aria-label="MARKETPLACE.ADD_PLUGIN">\n          ADD PLUGIN\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPlugin" ng-click="vm.deletePlugin($event)" aria-label="DELETE" translate translate-attr-aria-label="MARKETPLACE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MARKETPLACE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/marketplace/views/plugins/edit/view.html",'<div id="marketplace-plugin" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-plugins-button md-icon-button" aria-label="Go to plugins" ng-click="vm.gotoPlugins()" translate translate-attr-aria-label="MARKETPLACE.GO_TO_PLUGINS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="plugin-image" hide-xs>\n          <img ng-src="assets/images/business/plugins.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.plugin.id}}\n            <span ng-if="vm.plugin.name">{{vm.plugin.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MARKETPLACE.CREATED_AT"></span> <span>{{vm.plugin.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.savePlugin()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MARKETPLACE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="plugin-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MARKETPLACE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.TYPE">Type</label>\n                <input type="text" name="type" ng-model="vm.plugin.type" disabled>\n\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="true"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.plugin.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.ICON">Icon</label>\n                <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'icon\'].$error" ng-show="generalForm[\'icon\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n                <md-select name="sidebar" ng-model="vm.plugin.sidebar" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'always\'">Always</md-option>\n                  <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n                  <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n                  <md-option ng-value="\'never\'">Never</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'sidebar\'].$error" ng-show="generalForm[\'sidebar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n                <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n                <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'adminUrl\'].$error" ng-show="generalForm[\'adminUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n                <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n                <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'agentUrl\'].$error" ng-show="generalForm[\'agentUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n                <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n                <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" disabled>\n\n                <div ng-messages="generalForm[\'scriptName\'].$error" ng-show="generalForm[\'scriptName\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n                <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n                <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'scriptPath\'].$error" ng-show="generalForm[\'scriptPath\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.VERSION">Version</label>\n                <input type="text" name="version" ng-model="vm.plugin.version" disabled>\n\n                <div ng-messages="generalForm[\'version\'].$error" ng-show="generalForm[\'version\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/marketplace/views/plugins/plugins.html",'<div id="plugins" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MARKETPLACE.PLUGINS">Plugins</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MARKETPLACE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedPlugins.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedPlugins =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MARKETPLACE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-plugins-count">\n          <span>{{vm.selectedPlugins.length}}</span>\n          <span translate="MARKETPLACE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MARKETPLACE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllPlugins()" translate="MARKETPLACE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectPlugins()" translate="MARKETPLACE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedPlugins" csv-label="true" filename="plugins.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPlugins($event)" aria-label="delete selected" translate translate-attr-label="MARKETPLACE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      <div ng-if="vm.installing">\n        <md-card class="md-whiteframe-1dp padding-20" flex>\n          <div layout="column" layout-align="center center">\n            <span class="md-title md-accent-fg padding-20 text-bold" translate="MARKETPLACE.INSTALLING">Installing</span>\n            <md-progress-linear md-mode="indeterminate" class="md-accent padding-20"></md-progress-linear>\n          </div>\n        </md-card>\n      </div>\n\n      \x3c!-- PLUGIN TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedPlugins" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPlugins">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="name">{{ \'MARKETPLACE.NAME\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'MARKETPLACE.TYPE\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'MARKETPLACE.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'MARKETPLACE.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="version">{{ \'MARKETPLACE.VERSION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.plugins.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MARKETPLACE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="plugin" md-select-id="id" ng-repeat="plugin in vm.plugins.rows">\n                <td md-cell ng-if="plugin.userpic"><img class="avatar" alt="{{plugin.name}}" ng-src="api/users/{{plugin.id}}/avatar" /></td>\n                <td md-cell ng-if="!plugin.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{plugin.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="name ">{{plugin.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="type ">{{plugin.type}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="active ">\n                  <md-icon md-colors="{color: {{plugin.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{plugin.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="description ">{{plugin.description}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="version ">{{plugin.version}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MARKETPLACE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit && !plugin.active">\n\n                        <md-button ng-click="vm.installplugin(plugin, $event    )" translate="MARKETPLACE.INSTALL_PLUGIN">\n                          Install Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(plugin, $event    )" translate="MARKETPLACE.EDIT_PLUGIN">\n                          Edit Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n\n                        <md-button ng-click="vm.stopplugin(plugin, $event    )" translate="MARKETPLACE.STOP_PLUGIN">\n                          Stop Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n\n                        <md-button ng-click="vm.restartplugin(plugin, $event    )" translate="MARKETPLACE.RESTART_PLUGIN">\n                          Restart Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.downloadfile2(plugin, $event  , \'plugins\'   )" translate="MARKETPLACE.DOWNLOAD_PLUGIN">\n                          Download Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active">\n\n                        <md-button ng-click="vm.uninstallplugin(plugin, $event    )" translate="MARKETPLACE.UNINSTALL_PLUGIN">\n                          Uninstall Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(plugin, $event    )" translate="MARKETPLACE.DELETE_PLUGIN">\n                          Delete Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MARKETPLACE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MARKETPLACE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MARKETPLACE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.plugins.count}}" md-on-paginate="vm.getPlugins" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / PLUGIN TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- UPLOAD PLUGIN BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-plugin-button" ng-click="vm.uploadPlugin($event)" aria-label="upload plugin" translate translate-attr-aria-label="MARKETPLACE.UPLOAD_PLUGIN">\n    <md-icon md-font-icon="icon-upload"></md-icon>\n  </md-button>\n  \x3c!-- / UPLOAD PLUGIN BUTTON --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n  <form name="uploadForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div id="plugin-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n        <div class="drop-text hint-text" layout="row" layout-align="center center">\n          <span translate="MARKETPLACE.DROP_TO_UPLOAD">Drop to upload</span>\n        </div>\n\n        <div class="upload-button" layout="column" layout-align="center center">\n          <md-button class="md-accent md-raised" flow-btn>\n            Upload\n          </md-button>\n          <span class="secondary-text mt-8" translate="MARKETPLACE.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n        </div>\n      </div>\n\n      <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n        <div>\n          <span translate="MARKETPLACE.UPLOADING">Uploading</span>\n          <span>{{vm.plugin.file.name}}</span>\n        </div>\n        <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n      </div>\n\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center"></div>\n      <div layout="row">\n        <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="MARKETPLACE.FINISH" translate-attr-aria-label="MARKETPLACE.FINISH">\n          FINISH\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/hopperdate/hopperdate.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n  <form name="hopperForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content ms-scroll>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" ng-change="vm.recalcTZTime()" mdp-format="YYYY-MM-DD" ng-model="vm.dateTime">\n              <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" ng-change="vm.recalcTZTime()" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.dateTime">\n              <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n\n        </md-content>\n      </div>\n      <md-input-container class="md-block">\n        <div layout="row">\n          <div flex class="md-block">\n            <md-input-container class="md-block" flex-gt-sm="">\n              <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n              <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" ng-change="vm.recalcTZTime()" autofocus>\n            </md-input-container>\n          </div>\n          <div flex class="md-block">\n            <md-input-container class="md-block">\n              <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n              <input type="text" readonly value="{{vm.hopper.scheduledat}}">\n            </md-input-container>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n        <md-select name="priority" ng-model="vm.hopper.priority">\n          <md-option ng-value="\'4\'">Highest</md-option>\n          <md-option ng-value="\'3\'">High</md-option>\n          <md-option ng-value="\'2\'">Medium</md-option>\n          <md-option ng-value="\'1\'">Low</md-option>\n          <md-option ng-value="\'0\'">Lowest</md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n        <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n\n      </md-input-container>\n      <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n        <label translate="MOTIONDIALER.AGENT">Agent</label>\n        <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n          <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n        </md-select>\n        <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n          ADD HOPPER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",'<md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">\n  <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n        <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n        <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n          <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n        </md-select>\n        <div ng-messages="ivrCampaignForm[\'TrunkId\'].$error" ng-show="ivrCampaignForm[\'TrunkId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n        <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n          <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n        </md-select>\n        <div ng-messages="ivrCampaignForm[\'IntervalId\'].$error" ng-show="ivrCampaignForm[\'IntervalId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n        <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n          <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n          <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n          <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="ivrCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="ivrCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n        <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required>\n          <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n        </md-select>\n        <div ng-messages="ivrCampaignForm[\'SquareProjectId\'].$error" ng-show="ivrCampaignForm[\'SquareProjectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n        <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" value="30" ng-required="true">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n        <div ng-messages="ivrCampaignForm[\'limitCalls\'].$error" ng-show="ivrCampaignForm[\'limitCalls\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n\n        <div ng-messages="ivrCampaignForm[\'description\'].$error" ng-show="ivrCampaignForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newIvrCampaign" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newIvrCampaign" ng-click="vm.addNewIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n          ADD IVRCAMPAIGN\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newIvrCampaign" ng-click="vm.deleteIvrCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n  <form name="ivrCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n      <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n        <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",'<md-dialog class="ivrCampaign-dialog" aria-label="Clone IvrCampaign">\n  <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n        <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n        CLONE IVRCAMPAIGN\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n  <form name="hopperForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n              <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n              <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </md-content>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n        <md-select name="priority" ng-model="vm.hopper.priority">\n          <md-option ng-value="\'4\'">Highest</md-option>\n          <md-option ng-value="\'3\'">High</md-option>\n          <md-option ng-value="\'2\'">Medium</md-option>\n          <md-option ng-value="\'1\'">Low</md-option>\n          <md-option ng-value="\'0\'">Lowest</md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n        <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n          ADD HOPPER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n  <form name="ivrCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n      <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n        <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content ng-hide="vm.loading">\n      <div layout="row" layout-wrap flex>\n        <div flex-xs flex="50">\n          <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n            <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n            <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n          </md-checkbox>\n        </div>\n        <div flex-xs flex="50">\n        </div>\n        <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n          <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n            {{ item.name | limitTo:40 }}\n          </md-checkbox>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n      <div>\n      </div>\n      <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n    <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n      <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n    </div>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",'<div id="motiondialer-ivrCampaign" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-ivrCampaigns-button md-icon-button" aria-label="Go to ivrCampaigns" ng-click="vm.gotoIvrCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_IVRCAMPAIGNS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="ivrCampaign-image" hide-xs>\n          <img ng-src="assets/images/business/ivrCampaigns.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.ivrCampaign.id}}\n            <span ng-if="vm.ivrCampaign.name">{{vm.ivrCampaign.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.ivrCampaign.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="MOTIONDIALER.CLONE_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.listadddialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n        <md-tooltip><span translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.blacklistadddialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n        <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-block-helper"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.resetlistdialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n        <md-tooltip><span translate="MOTIONDIALER.RESETLIST_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-restore"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="MOTIONDIALER.GOTO_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveIvrCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (nosuchnumberForm.$invalid) || (dropForm.$invalid) || (abandonedForm.$invalid) || (machineForm.$invalid) || (agentrejectForm.$invalid) || (advancedForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n                <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n                <md-select name="TrunkBackupId" ng-model="vm.ivrCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n                <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n                <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n                  <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n                  <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n                <input type="number" name="dialCutDigit" ng-model="vm.ivrCampaign.dialCutDigit" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.ivrCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n            </div>\n            <form name="campaignForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n                <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n                </md-select>\n                <div ng-messages="campaignForm[\'SquareProjectId\'].$error" ng-show="campaignForm[\'SquareProjectId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n                <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n                <div ng-messages="campaignForm[\'limitCalls\'].$error" ng-show="campaignForm[\'limitCalls\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n            </div>\n            <form name="originateForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n                <input type="text" name="dialOriginateCallerIdName" ng-model="vm.ivrCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n                <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.ivrCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n                <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.ivrCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n                <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n                <input type="number" name="dialOriginateTimeout" ng-model="vm.ivrCampaign.dialOriginateTimeout" min="1" max="999" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n                <input type="text" name="dialPrefix" ng-model="vm.ivrCampaign.dialPrefix" ng-pattern="/^\\d+$/" value="" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n                <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n            </div>\n            <form name="globalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n                <input type="number" name="dialGlobalMaxRetry" ng-model="vm.ivrCampaign.dialGlobalMaxRetry" min="1" max="999" value="4" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n                <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n            </div>\n            <form name="congestionForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n                <input type="number" name="dialCongestionMaxRetry" ng-model="vm.ivrCampaign.dialCongestionMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n                <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n                <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.ivrCampaign.dialCongestionRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n                <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n            </div>\n            <form name="busyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n                <input type="number" name="dialBusyMaxRetry" ng-model="vm.ivrCampaign.dialBusyMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n                <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n                <input type="number" name="dialBusyRetryFrequency" ng-model="vm.ivrCampaign.dialBusyRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n                <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n            </div>\n            <form name="noanswerForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n                <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.ivrCampaign.dialNoAnswerMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n                <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n                <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.ivrCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n                <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container nosuchnumber md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.NOSUCHNUMBER">NOSUCHNUMBER</div>\n            </div>\n            <form name="nosuchnumberForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOSUCHNUMBERMAXRETRY">NoSuchNumberMaxRetry</label>\n                <input type="number" name="dialNoSuchNumberMaxRetry" ng-model="vm.ivrCampaign.dialNoSuchNumberMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERMAXRETRY"></span></div>\n                <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_REQUIRED">NoSuchNumberMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOSUCHNUMBERRETRYTIME">NoSuchNumberRetryTime</label>\n                <input type="number" name="dialNoSuchNumberRetryFrequency" ng-model="vm.ivrCampaign.dialNoSuchNumberRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERRETRYTIME"></span></div>\n                <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_REQUIRED">NoSuchNumberRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container drop md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.DROP">DROP</div>\n            </div>\n            <form name="dropForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DROPMAXRETRY">DropMaxRetry</label>\n                <input type="number" name="dialDropMaxRetry" ng-model="vm.ivrCampaign.dialDropMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DROPMAXRETRY"></span></div>\n                <div ng-messages="dropForm[\'dialDropMaxRetry\'].$error" ng-show="dropForm[\'dialDropMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_REQUIRED">DropMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DROPRETRYTIME">DropRetryTime</label>\n                <input type="number" name="dialDropRetryFrequency" ng-model="vm.ivrCampaign.dialDropRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DROPRETRYTIME"></span></div>\n                <div ng-messages="dropForm[\'dialDropRetryFrequency\'].$error" ng-show="dropForm[\'dialDropRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_REQUIRED">DropRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container abandoned md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ABANDONED">ABANDONED</div>\n            </div>\n            <form name="abandonedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ABANDONEDMAXRETRY">AbandonedMaxRetry</label>\n                <input type="number" name="dialAbandonedMaxRetry" ng-model="vm.ivrCampaign.dialAbandonedMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDMAXRETRY"></span></div>\n                <div ng-messages="abandonedForm[\'dialAbandonedMaxRetry\'].$error" ng-show="abandonedForm[\'dialAbandonedMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_REQUIRED">AbandonedMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ABANDONEDRETRYTIME">AbandonedRetryTime</label>\n                <input type="number" name="dialAbandonedRetryFrequency" ng-model="vm.ivrCampaign.dialAbandonedRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDRETRYTIME"></span></div>\n                <div ng-messages="abandonedForm[\'dialAbandonedRetryFrequency\'].$error" ng-show="abandonedForm[\'dialAbandonedRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_REQUIRED">AbandonedRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container machine md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.MACHINE">MACHINE</div>\n            </div>\n            <form name="machineForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MACHINEMAXRETRY">MachineMaxRetry</label>\n                <input type="number" name="dialMachineMaxRetry" ng-model="vm.ivrCampaign.dialMachineMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINEMAXRETRY"></span></div>\n                <div ng-messages="machineForm[\'dialMachineMaxRetry\'].$error" ng-show="machineForm[\'dialMachineMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_REQUIRED">MachineMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MACHINERETRYTIME">MachineRetryTime</label>\n                <input type="number" name="dialMachineRetryFrequency" ng-model="vm.ivrCampaign.dialMachineRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINERETRYTIME"></span></div>\n                <div ng-messages="machineForm[\'dialMachineRetryFrequency\'].$error" ng-show="machineForm[\'dialMachineRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_REQUIRED">MachineRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container agentreject md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.AGENTREJECT">AGENTREJECT</div>\n            </div>\n            <form name="agentrejectForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTREJECTMAXRETRY">AgentRejectMaxRetry</label>\n                <input type="number" name="dialAgentRejectMaxRetry" ng-model="vm.ivrCampaign.dialAgentRejectMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTMAXRETRY"></span></div>\n                <div ng-messages="agentrejectForm[\'dialAgentRejectMaxRetry\'].$error" ng-show="agentrejectForm[\'dialAgentRejectMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_REQUIRED">AgentRejectMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTREJECTRETRYTIME">AgentRejectRetryTime</label>\n                <input type="number" name="dialAgentRejectRetryFrequency" ng-model="vm.ivrCampaign.dialAgentRejectRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTRETRYTIME"></span></div>\n                <div ng-messages="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$error" ng-show="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_REQUIRED">AgentRejectRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n                <md-select name="dialOrderByScheduledAt" ng-model="vm.ivrCampaign.dialOrderByScheduledAt" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n                  <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n                <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n            </div>\n            <form name="globalintervalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n                <input type="text" name="dialGlobalInterval" ng-model="vm.ivrCampaign.dialGlobalInterval" value="07:00-22:00,*,*,*" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n                <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n            </div>\n            <form name="timezoneForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n                <ms-timezone name="dialTimezone" ng-model="vm.ivrCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n                <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n            </div>\n            <form name="amdForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.ivrCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n                <input type="number" name="dialAMDInitialSilence" ng-model="vm.ivrCampaign.dialAMDInitialSilence" min="0" value="2500" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n                <input type="number" name="dialAMDGreeting" ng-model="vm.ivrCampaign.dialAMDGreeting" min="0" value="1500" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n                <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n                <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.ivrCampaign.dialAMDAfterGreetingSilence" min="0" value="800" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n                <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.ivrCampaign.dialAMDTotalAnalysisTime" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n                <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n                <input type="number" name="dialAMDMinWordLength" ng-model="vm.ivrCampaign.dialAMDMinWordLength" min="0" value="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n                <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.ivrCampaign.dialAMDBetweenWordsSilence" min="0" value="50" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n                <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.ivrCampaign.dialAMDMaximumNumberOfWords" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n                <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.ivrCampaign.dialAMDSilenceThreshold" min="0" max="32767" value="256" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n                <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n                <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.ivrCampaign.dialAMDMaximumWordLength" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.ivrCampaign)">\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_hs.init(vm.ivrCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              \x3c!-- WIDGET GROUP --\x3e\n              <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n                \x3c!-- WIDGET 1 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 1 --\x3e\n\n                \x3c!-- WIDGET 2 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 2 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n              </div>\n              \x3c!-- / WIDGET GROUP --\x3e\n            </div>\n\n          </div>\n          <div class="ivrCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHoppers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n                  <ms-search-bar on-search="vm_dc.getIvrCampaignHoppers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHoppers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIvrCampaignHoppers.length}} {{vm_dc.selectedIvrCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHoppers" csv-label="true" filename="ivrCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIvrCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHoppers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHoppers">\n                    <tr md-row>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="phone">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countcongestionretry">\n                        {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countbusyretry">\n                        {{ \'MOTIONDIALER.BUSY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnoanswerretry">\n                        {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnosuchnumberretry">\n                        {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countdropretry">\n                        {{ \'MOTIONDIALER.DROP\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countabandonedretry">\n                        {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countmachineretry">\n                        {{ \'MOTIONDIALER.MACHINE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countagentrejectretry">\n                        {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="scheduledat">\n                        {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="priority">\n                        {{ \'MOTIONDIALER.PRIORITY\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.ivrCampaignHoppers.rows">\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.ContactId}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell privacy ng-cloak>\n                        {{hopper.phone}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countcongestionretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countbusyretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countnoanswerretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countnosuchnumberretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countdropretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countabandonedretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countmachineretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countagentrejectretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{ hopper.scheduledat | formatdate }}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{ vm_dc.arraypriority[hopper.priority].option }} </td>\n\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n                                Edit Hopper\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n                                Delete Hopper\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.ivrCampaignHoppers.rows.length">\n                      <td md-cell colspan="15">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHoppers.count}}" md-on-paginate="vm_dc.getIvrCampaignHoppers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperHistories.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n                  <ms-search-bar on-search="vm_dc.getIvrCampaignHopperHistories()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperHistories.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperHistories.length}} {{vm_dc.selectedIvrCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperHistories" csv-label="true" filename="ivrCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperHistories" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperHistories">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">\n                        {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridname">\n                        {{ \'MOTIONDIALER.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="statedesc">\n                        {{ \'MOTIONDIALER.STATUS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="scheduledat">\n                        {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.ivrCampaignHopperHistories.rows">\n                      <td md-cell>\n                        {{hopperHistory.uniqueid}}\n                      </td>\n                      <td md-cell>\n                        {{hopperHistory.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperHistory.calleridnum}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperHistory.calleridname}}\n                      </td>\n                      <td md-cell>\n                        {{hopperHistory.statedesc}}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.scheduledat | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.endtime | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.ivrCampaignHopperHistories.rows.length">\n                      <td md-cell colspan="11">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperHistories" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.FINAL">FINAL</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperFinals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n                  <ms-search-bar on-search="vm_dc.getIvrCampaignHopperFinals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                  <td md-cell class="actions">\n                    <md-menu>\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsIvrCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n                        <md-icon md-font-icon="icon-backup-restore"></md-icon>\n                        <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(3)">\n                            <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n                            <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(5)">\n                            <span translate="MOTIONDIALER.BUSY ">Busy</span>\n                            <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(8)">\n                            <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n                            <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(10)">\n                            <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n                            <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(11)">\n                            <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n                            <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(22)">\n                            <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n                            <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(0)">\n                            <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n                            <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item>\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(19)">\n                            <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n                            <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </td>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperFinals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperFinals.length}} {{vm_dc.selectedIvrCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperFinals" csv-label="true" filename="ivrCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedIvrCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="MOTIONDIALER.MOVE_SELECTED">\n                    <md-icon md-font-icon="icon-restore"></md-icon>\n                    <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperFinals" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperFinals">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">\n                        {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridname">\n                        {{ \'MOTIONDIALER.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="statedesc">\n                        {{ \'MOTIONDIALER.STATUS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countcongestionretry">\n                        {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countbusyretry">\n                        {{ \'MOTIONDIALER.BUSY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnoanswerretry">\n                        {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnosuchnumberretry">\n                        {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countdropretry">\n                        {{ \'MOTIONDIALER.DROP\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countabandonedretry">\n                        {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countmachineretry">\n                        {{ \'MOTIONDIALER.MACHINE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countagentrejectretry">\n                        {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="disposition">\n                        {{ \'MOTIONDIALER.DISPOSITION\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.ivrCampaignHopperFinals.rows">\n                      <td md-cell>\n                        {{hopperFinal.uniqueid}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperFinal.calleridnum}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperFinal.calleridname}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.statedesc}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countcongestionretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countbusyretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countnoanswerretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countnosuchnumberretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countdropretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countabandonedretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countmachineretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countagentrejectretry}}\n                      </td>\n                      <td md-cell>\n                        {{ hopperFinal.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperFinal.endtime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.disposition}}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n                                Move HopperFinal\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.ivrCampaignHopperFinals.rows.length">\n                      <td md-cell colspan="28">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperFinals" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperBlacks.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n                  <ms-search-bar on-search="vm_dc.getIvrCampaignHopperBlacks()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperBlacks.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperBlacks.length}} {{vm_dc.selectedIvrCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperBlacks" csv-label="true" filename="ivrCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperBlacks" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperBlacks">\n                    <tr md-row>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="phone">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.ivrCampaignHopperBlacks.rows">\n                      <td md-cell>\n                        {{hopperBlack.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperBlack.phone}}\n                      </td>\n                      <td md-cell class="actions">\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.ivrCampaignHopperBlacks.rows.length">\n                      <td md-cell colspan="4">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperBlacks" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",'<div id="ivrCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MOTIONDIALER.IVRCAMPAIGNS">IvrCampaigns</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedIvrCampaigns.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedIvrCampaigns =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MOTIONDIALER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-ivrCampaigns-count">\n          <span>{{vm.selectedIvrCampaigns.length}}</span>\n          <span translate="MOTIONDIALER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MOTIONDIALER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllIvrCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectIvrCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedIvrCampaigns" csv-label="true" filename="ivrCampaigns.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIvrCampaigns($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- IVRCAMPAIGN TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedIvrCampaigns" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIvrCampaigns">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n                <th md-column md-order-by="SquareProjectId">{{ \'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.ivrCampaigns.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="ivrCampaign" md-select-id="id" ng-repeat="ivrCampaign in vm.ivrCampaigns.rows">\n                <td md-cell ng-if="ivrCampaign.userpic"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="api/users/{{ivrCampaign.id}}/avatar" /></td>\n                <td md-cell ng-if="!ivrCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="id ">{{ivrCampaign.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="name ">{{ivrCampaign.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="active ">\n                  <md-icon md-colors="{color: {{ivrCampaign.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{ivrCampaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':ivrCampaign.TrunkId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="SquareProjectId ">{{ (vm.projects | filter : {\'id\':ivrCampaign.SquareProjectId} : true)[0].name }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(ivrCampaign, $event    )" translate="MOTIONDIALER.EDIT_IVRCAMPAIGN">\n                          Edit IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(ivrCampaign, $event    )" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n                          clone IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.listadddialog(ivrCampaign, $event    )" translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">\n                          listadd IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.blacklistadddialog(ivrCampaign, $event    )" translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">\n                          blacklistadd IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(ivrCampaign, $event    )" translate="MOTIONDIALER.DELETE_IVRCAMPAIGN">\n                          Delete IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(ivrCampaign, $event    )" translate="MOTIONDIALER.GOTOREALTIME_IVRCAMPAIGN">\n                          goToRealtime IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.ivrCampaigns.count}}" md-on-paginate="vm.getIvrCampaigns" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / IVRCAMPAIGN TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD IVRCAMPAIGN BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-ivrCampaign-button" ng-click="vm.createOrEditIvrCampaign($event)" aria-label="add ivrCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD IVRCAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",'<md-dialog class="queueCampaign-dialog" aria-label="New QueueCampaign">\n  <form name="queueCampaignForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n        <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n        <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n          <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n        </md-select>\n        <div ng-messages="queueCampaignForm[\'TrunkId\'].$error" ng-show="queueCampaignForm[\'TrunkId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n        <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n        <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n          <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n        </md-select>\n        <div ng-messages="queueCampaignForm[\'IntervalId\'].$error" ng-show="queueCampaignForm[\'IntervalId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n        <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n          <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n          <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n          <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="queueCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="queueCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.METHOD">Method</label>\n        <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required>\n          <md-option ng-value="\'progressive\'">Progressive</md-option>\n          <md-option ng-value="\'power\'">PowerDialing</md-option>\n          <md-option ng-value="\'predictive\'">Predictive</md-option>\n          <md-option ng-value="\'preview\'">Preview</md-option>\n          <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n        <div ng-messages="queueCampaignForm[\'dialMethod\'].$error" ng-show="queueCampaignForm[\'dialMethod\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n        <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n        <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent"></md-slider>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n        <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n        <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n          <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n          <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n        <div ng-messages="queueCampaignForm[\'dialPredictiveOptimization\'].$error" ng-show="queueCampaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n        <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n        <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent"></md-slider>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n        <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n        <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent"></md-slider>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n        <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n        <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" value="0" ng-required="true">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n        <div ng-messages="queueCampaignForm[\'dialLimitQueue\'].$error" ng-show="queueCampaignForm[\'dialLimitQueue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n        <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n        <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" value="3" ng-required="true">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n        <div ng-messages="queueCampaignForm[\'dialQueueTimeout\'].$error" ng-show="queueCampaignForm[\'dialQueueTimeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n        <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" value="3" ng-required="true">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n        <div ng-messages="queueCampaignForm[\'timeout\'].$error" ng-show="queueCampaignForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.queueCampaign.description">\n\n        <div ng-messages="queueCampaignForm[\'description\'].$error" ng-show="queueCampaignForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newQueueCampaign" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid || queueCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newQueueCampaign" ng-click="vm.addNewQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n          ADD QUEUECAMPAIGN\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newQueueCampaign" ng-click="vm.deleteQueueCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">Add Agent to queueCampaign</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin">\n        <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n      <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n        <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",'<md-dialog class="queueCampaign-dialog" aria-label="Clone QueueCampaign">\n  <form name="queueCampaignForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n        <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n        CLONE QUEUECAMPAIGN\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n  <form name="hopperForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.dateTime" ng-change="vm.recalcTZTime()">\n              <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.dateTime" ng-change="vm.recalcTZTime()">\n              <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </md-content>\n      </div>\n      <div layout="row">\n        <div flex class="md-block">\n          <md-input-container class="md-block" flex-gt-sm="">\n            <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n            <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n          </md-input-container>\n        </div>\n        <div flex class="md-block">\n          <md-input-container class="md-block">\n            <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n            <input type="text" readonly value="{{vm.hopper.scheduledat}}">\n          </md-input-container>\n        </div>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n        <md-select name="priority" ng-model="vm.hopper.priority">\n          <md-option ng-value="\'4\'">Highest</md-option>\n          <md-option ng-value="\'3\'">High</md-option>\n          <md-option ng-value="\'2\'">Medium</md-option>\n          <md-option ng-value="\'1\'">Low</md-option>\n          <md-option ng-value="\'0\'">Lowest</md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n        <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n        <label translate="MOTIONDIALER.AGENT">Agent</label>\n        <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n          <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n        </md-select>\n        <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n          ADD HOPPER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n      <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n        <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content ng-hide="vm.loading">\n      <div layout="row" layout-wrap flex>\n        <div flex-xs flex="50">\n          <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n            <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n            <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n          </md-checkbox>\n        </div>\n        <div flex-xs flex="50">\n        </div>\n        <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n          <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n            {{ item.name | limitTo:40 }}\n          </md-checkbox>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n      <div>\n      </div>\n      <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n    <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n      <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n    </div>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin">\n        <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",'<div id="motiondialer-queueCampaign" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-queueCampaigns-button md-icon-button" aria-label="Go to queueCampaigns" ng-click="vm.gotoQueueCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_QUEUECAMPAIGNS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="queueCampaign-image" hide-xs>\n          <img ng-src="assets/images/business/queueCampaigns.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.queueCampaign.id}}\n            <span ng-if="vm.queueCampaign.name">{{vm.queueCampaign.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.queueCampaign.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.listadddialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n        <md-tooltip><span translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.blacklistadddialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n        <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-block-helper"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.queueCampaign, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.queueCampaign, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.resetlistdialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n        <md-tooltip><span translate="MOTIONDIALER.RESETLIST_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-restore"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="MOTIONDIALER.GOTO_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveQueueCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (queueForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (nosuchnumberForm.$invalid) || (dropForm.$invalid) || (abandonedForm.$invalid) || (machineForm.$invalid) || (agentrejectForm.$invalid) || (advancedForm.$invalid) || (advancedpreviewForm.$invalid) || (thresholdsForm.$invalid) || (recallmeForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n                <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n                <md-select name="TrunkBackupId" ng-model="vm.queueCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n                <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n                <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n                <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n                  <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n                  <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n                <input type="number" name="dialCutDigit" ng-model="vm.queueCampaign.dialCutDigit" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.queueCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n            </div>\n            <form name="campaignForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.METHOD">Method</label>\n                <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'progressive\'">Progressive</md-option>\n                  <md-option ng-value="\'power\'">PowerDialing</md-option>\n                  <md-option ng-value="\'predictive\'">Predictive</md-option>\n                  <md-option ng-value="\'preview\'">Preview</md-option>\n                  <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n                <div ng-messages="campaignForm[\'dialMethod\'].$error" ng-show="campaignForm[\'dialMethod\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n                <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent"></md-slider>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n                <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n                  <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n                <div ng-messages="campaignForm[\'dialPredictiveOptimization\'].$error" ng-show="campaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent"></md-slider>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent"></md-slider>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n                <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n                <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n                <div ng-messages="campaignForm[\'dialLimitQueue\'].$error" ng-show="campaignForm[\'dialLimitQueue\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n                <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" value="3" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n                <div ng-messages="campaignForm[\'timeout\'].$error" ng-show="campaignForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container queue md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.QUEUE">QUEUE</div>\n            </div>\n            <form name="queueForm" novalidate>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.QUEUEOPTIONS">QueueOptions</label>\n                <input type="text" name="dialQueueOptions" ng-model="vm.queueCampaign.dialQueueOptions" value="tTxX" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="queueForm[\'dialQueueOptions\'].$error" ng-show="queueForm[\'dialQueueOptions\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.QUEUEOPTIONS_REQUIRED">QueueOptions field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n                <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" value="3" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n                <div ng-messages="queueForm[\'dialQueueTimeout\'].$error" ng-show="queueForm[\'dialQueueTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'booked\' || vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.queueCampaign.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n                  <md-option ng-value="\'roundrobin\'" ng-if="vm.queueCampaign.dialMethod === \'booked\'">Round Robin</md-option>\n                  <md-option ng-value="\'leastrecent\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Least Recent</md-option>\n                  <md-option ng-value="\'fewestcalls\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Fewest Calls</md-option>\n                  <md-option ng-value="\'random\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Random</md-option>\n                  <md-option ng-value="\'linear\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Linear</md-option>\n                  <md-option ng-value="\'wrandom\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Weight Random</md-option>\n                </md-select>\n                <div ng-messages="queueForm[\'strategy\'].$error" ng-show="queueForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.RETRY">Retry</label>\n                <input type="number" name="retry" ng-model="vm.queueCampaign.retry" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RETRY"></span></div>\n                <div ng-messages="queueForm[\'retry\'].$error" ng-show="queueForm[\'retry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.WRAPUPTIME">WrapupTime</label>\n                <input type="number" name="wrapuptime" ng-model="vm.queueCampaign.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.WRAPUPTIME"></span></div>\n                <div ng-messages="queueForm[\'wrapuptime\'].$error" ng-show="queueForm[\'wrapuptime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.WEIGHT">Weight</label>\n                <input type="number" name="weight" ng-model="vm.queueCampaign.weight" min="0" value="1" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.WEIGHT"></span></div>\n                <div ng-messages="queueForm[\'weight\'].$error" ng-show="queueForm[\'weight\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.MUSICONHOLD">MusicOnHold</label>\n                <md-select name="musiconhold" ng-model="vm.queueCampaign.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MUSICONHOLD"></span></div>\n                <div ng-messages="queueForm[\'musiconhold\'].$error" ng-show="queueForm[\'musiconhold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n                <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT"></span></div>\n                <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECT2">CallySquareProject2</label>\n                <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT2"></span></div>\n                <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT2_REQUIRED">CallySquareProject2 field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW">CallySquareProjectPreview</label>\n                <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW"></span></div>\n                <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW_REQUIRED">CallySquareProjectPreview field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW2">CallySquareProjectPreview2</label>\n                <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW2"></span></div>\n                <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW2_REQUIRED">CallySquareProjectPreview2 field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialQueueProject2 && (vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\')" class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialAgiAfterHangupAgent" aria-label="RunIfHangupAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.RUNIFHANGUPAGENT">RunIfHangupAgent</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RUNIFHANGUPAGENT"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n            </div>\n            <form name="originateForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n                <input type="text" name="dialOriginateCallerIdName" ng-model="vm.queueCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n                <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.queueCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n                <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.queueCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n                <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n                <input type="number" name="dialOriginateTimeout" ng-model="vm.queueCampaign.dialOriginateTimeout" min="1" max="999" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n                <input type="text" name="dialPrefix" ng-model="vm.queueCampaign.dialPrefix" ng-pattern="/^\\d+$/" value="" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n                <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n            </div>\n            <form name="globalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n                <input type="number" name="dialGlobalMaxRetry" ng-model="vm.queueCampaign.dialGlobalMaxRetry" min="1" max="999" value="4" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n                <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n            </div>\n            <form name="congestionForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n                <input type="number" name="dialCongestionMaxRetry" ng-model="vm.queueCampaign.dialCongestionMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n                <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n                <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.queueCampaign.dialCongestionRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n                <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n            </div>\n            <form name="busyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n                <input type="number" name="dialBusyMaxRetry" ng-model="vm.queueCampaign.dialBusyMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n                <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n                <input type="number" name="dialBusyRetryFrequency" ng-model="vm.queueCampaign.dialBusyRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n                <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n            </div>\n            <form name="noanswerForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n                <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.queueCampaign.dialNoAnswerMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n                <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n                <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.queueCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n                <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container nosuchnumber md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.NOSUCHNUMBER">NOSUCHNUMBER</div>\n            </div>\n            <form name="nosuchnumberForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOSUCHNUMBERMAXRETRY">NoSuchNumberMaxRetry</label>\n                <input type="number" name="dialNoSuchNumberMaxRetry" ng-model="vm.queueCampaign.dialNoSuchNumberMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERMAXRETRY"></span></div>\n                <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_REQUIRED">NoSuchNumberMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOSUCHNUMBERRETRYTIME">NoSuchNumberRetryTime</label>\n                <input type="number" name="dialNoSuchNumberRetryFrequency" ng-model="vm.queueCampaign.dialNoSuchNumberRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERRETRYTIME"></span></div>\n                <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_REQUIRED">NoSuchNumberRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container drop md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.DROP">DROP</div>\n            </div>\n            <form name="dropForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DROPMAXRETRY">DropMaxRetry</label>\n                <input type="number" name="dialDropMaxRetry" ng-model="vm.queueCampaign.dialDropMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DROPMAXRETRY"></span></div>\n                <div ng-messages="dropForm[\'dialDropMaxRetry\'].$error" ng-show="dropForm[\'dialDropMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_REQUIRED">DropMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DROPRETRYTIME">DropRetryTime</label>\n                <input type="number" name="dialDropRetryFrequency" ng-model="vm.queueCampaign.dialDropRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DROPRETRYTIME"></span></div>\n                <div ng-messages="dropForm[\'dialDropRetryFrequency\'].$error" ng-show="dropForm[\'dialDropRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_REQUIRED">DropRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container abandoned md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ABANDONED">ABANDONED</div>\n            </div>\n            <form name="abandonedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ABANDONEDMAXRETRY">AbandonedMaxRetry</label>\n                <input type="number" name="dialAbandonedMaxRetry" ng-model="vm.queueCampaign.dialAbandonedMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDMAXRETRY"></span></div>\n                <div ng-messages="abandonedForm[\'dialAbandonedMaxRetry\'].$error" ng-show="abandonedForm[\'dialAbandonedMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_REQUIRED">AbandonedMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ABANDONEDRETRYTIME">AbandonedRetryTime</label>\n                <input type="number" name="dialAbandonedRetryFrequency" ng-model="vm.queueCampaign.dialAbandonedRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDRETRYTIME"></span></div>\n                <div ng-messages="abandonedForm[\'dialAbandonedRetryFrequency\'].$error" ng-show="abandonedForm[\'dialAbandonedRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_REQUIRED">AbandonedRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container machine md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.MACHINE">MACHINE</div>\n            </div>\n            <form name="machineForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MACHINEMAXRETRY">MachineMaxRetry</label>\n                <input type="number" name="dialMachineMaxRetry" ng-model="vm.queueCampaign.dialMachineMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINEMAXRETRY"></span></div>\n                <div ng-messages="machineForm[\'dialMachineMaxRetry\'].$error" ng-show="machineForm[\'dialMachineMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_REQUIRED">MachineMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MACHINERETRYTIME">MachineRetryTime</label>\n                <input type="number" name="dialMachineRetryFrequency" ng-model="vm.queueCampaign.dialMachineRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINERETRYTIME"></span></div>\n                <div ng-messages="machineForm[\'dialMachineRetryFrequency\'].$error" ng-show="machineForm[\'dialMachineRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_REQUIRED">MachineRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container agentreject md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.AGENTREJECT">AGENTREJECT</div>\n            </div>\n            <form name="agentrejectForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTREJECTMAXRETRY">AgentRejectMaxRetry</label>\n                <input type="number" name="dialAgentRejectMaxRetry" ng-model="vm.queueCampaign.dialAgentRejectMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTMAXRETRY"></span></div>\n                <div ng-messages="agentrejectForm[\'dialAgentRejectMaxRetry\'].$error" ng-show="agentrejectForm[\'dialAgentRejectMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_REQUIRED">AgentRejectMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTREJECTRETRYTIME">AgentRejectRetryTime</label>\n                <input type="number" name="dialAgentRejectRetryFrequency" ng-model="vm.queueCampaign.dialAgentRejectRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTRETRYTIME"></span></div>\n                <div ng-messages="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$error" ng-show="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_REQUIRED">AgentRejectRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n                <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n                <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n                <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AUTOPAUSE">AutoPause</label>\n                <md-select name="autopause" ng-model="vm.queueCampaign.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'all\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AUTOPAUSE"></span></div>\n                <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.RINGINUSE">RingInUse</label>\n                <md-select name="ringinuse" ng-model="vm.queueCampaign.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RINGINUSE"></span></div>\n                <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MEMBERDELAY">MemberDelay</label>\n                <input type="number" name="memberdelay" ng-model="vm.queueCampaign.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MEMBERDELAY"></span></div>\n                <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TIMEOUTRESTART">TimeoutRestart</label>\n                <md-select name="timeoutrestart" ng-model="vm.queueCampaign.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEOUTRESTART"></span></div>\n                <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n                <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Inactive</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'wav49\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n                <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONTEXT">Context</label>\n                <input type="text" name="context" ng-model="vm.queueCampaign.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONTEXT"></span></div>\n                <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n                <md-select name="setinterfacevar" ng-model="vm.queueCampaign.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.SETINTERFACEVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.SETQUEUEVARIABLES">SetQueueVariables</label>\n                <md-select name="setqueuevar" ng-model="vm.queueCampaign.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n                <md-select name="setqueueentryvar" ng-model="vm.queueCampaign.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n                <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n                  <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n                <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n                <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="queueCampaign-detail-form-container advancedpreview md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCEDPREVIEW">ADVANCEDPREVIEW</div>\n            </div>\n            <form name="advancedpreviewForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n                <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n                <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n                <div ng-messages="advancedpreviewForm[\'acwTimeout\'].$error" ng-show="advancedpreviewForm[\'acwTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n                <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Inactive</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'wav49\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n                <div ng-messages="advancedpreviewForm[\'monitor_format\'].$error" ng-show="advancedpreviewForm[\'monitor_format\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n                <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n                  <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n                <div ng-messages="advancedpreviewForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedpreviewForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n                <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod === \'predictive\'" class="queueCampaign-detail-form-container thresholds md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.THRESHOLDS">THRESHOLDS</div>\n            </div>\n            <form name="thresholdsForm" novalidate>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <span translate="MOTIONDIALER.PREDICTIVEMAXTHRESHOLD">PredictiveMaxThreshold</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEMAXTHRESHOLD"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveIntervalMaxThreshold" min="1" max="100" step="1" class="md-accent"></md-slider>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <span translate="MOTIONDIALER.PREDICTIVEMINTHRESHOLD">PredictiveMinThreshold</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEMINTHRESHOLD"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveIntervalMinThreshold" min="1" max="100" step="1" class="md-accent"></md-slider>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container recallme md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.RECALLME">RECALLME</div>\n            </div>\n            <form name="recallmeForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DIALRECALLMETIMEOUT">DialRecallMeTimeout</label>\n                <input type="number" name="dialRecallMeTimeout" ng-model="vm.queueCampaign.dialRecallMeTimeout" min="1" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLMETIMEOUT"></span></div>\n                <div ng-messages="recallmeForm[\'dialRecallMeTimeout\'].$error" ng-show="recallmeForm[\'dialRecallMeTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_REQUIRED">DialRecallMeTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DialRecallMeTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialRecallInQueue" aria-label="DialRecallInQueue" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.DIALRECALLINQUEUE">DialRecallInQueue</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLINQUEUE"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'preview\'" class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialPreviewAutoRecallMe" aria-label="Preview_Auto_Recall_Me" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.PREVIEW_AUTO_RECALL_ME">Preview_Auto_Recall_Me</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREVIEW_AUTO_RECALL_ME"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'preview\'" class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialPreviewRecallmeReminder" aria-label="Preview_Recall_Me_Reminder" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.PREVIEW_RECALL_ME_REMINDER">Preview_Recall_Me_Reminder</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREVIEW_RECALL_ME_REMINDER"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n            </div>\n            <form name="globalintervalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n                <input type="text" name="dialGlobalInterval" ng-model="vm.queueCampaign.dialGlobalInterval" value="07:00-22:00,*,*,*" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n                <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n            </div>\n            <form name="timezoneForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n                <ms-timezone name="dialTimezone" ng-model="vm.queueCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n                <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n            </div>\n            <form name="amdForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n                <input type="number" name="dialAMDInitialSilence" ng-model="vm.queueCampaign.dialAMDInitialSilence" min="0" value="2500" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n                <input type="number" name="dialAMDGreeting" ng-model="vm.queueCampaign.dialAMDGreeting" min="0" value="1500" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n                <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n                <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.queueCampaign.dialAMDAfterGreetingSilence" min="0" value="800" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n                <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.queueCampaign.dialAMDTotalAnalysisTime" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n                <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n                <input type="number" name="dialAMDMinWordLength" ng-model="vm.queueCampaign.dialAMDMinWordLength" min="0" value="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n                <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.queueCampaign.dialAMDBetweenWordsSilence" min="0" value="50" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n                <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.queueCampaign.dialAMDMaximumNumberOfWords" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n                <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.queueCampaign.dialAMDSilenceThreshold" min="0" max="32767" value="256" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n                <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n                <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.queueCampaign.dialAMDMaximumWordLength" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.queueCampaign)">\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_hs.init(vm.queueCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              \x3c!-- WIDGET GROUP --\x3e\n              <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n                \x3c!-- WIDGET 1 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 1 --\x3e\n\n                \x3c!-- WIDGET 2 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 2 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n              </div>\n              \x3c!-- / WIDGET GROUP --\x3e\n            </div>\n\n          </div>\n          <div class="queueCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHoppers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n                  <ms-search-bar on-search="vm_dc.getQueueCampaignHoppers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHoppers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedQueueCampaignHoppers.length}} {{vm_dc.selectedQueueCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHoppers" csv-label="true" filename="queueCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedQueueCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHoppers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHoppers">\n                    <tr md-row>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="phone">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countcongestionretry">\n                        {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countbusyretry">\n                        {{ \'MOTIONDIALER.BUSY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnoanswerretry">\n                        {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnosuchnumberretry">\n                        {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countdropretry">\n                        {{ \'MOTIONDIALER.DROP\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countabandonedretry">\n                        {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countmachineretry">\n                        {{ \'MOTIONDIALER.MACHINE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countagentrejectretry">\n                        {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="scheduledat">\n                        {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="priority">\n                        {{ \'MOTIONDIALER.PRIORITY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="recallme">\n                        {{ \'MOTIONDIALER.RECALLAGENT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.queueCampaignHoppers.rows">\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.ContactId}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell privacy ng-cloak>\n                        {{hopper.phone}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countcongestionretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countbusyretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countnoanswerretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countnosuchnumberretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countdropretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countabandonedretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countmachineretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countagentrejectretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{ hopper.scheduledat | formatdate }}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{ vm_dc.arraypriority[hopper.priority].option }} </td>\n\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell class="recallme ">\n                        <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n                                Edit Hopper\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n                                Delete Hopper\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.queueCampaignHoppers.rows.length">\n                      <td md-cell colspan="17">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHoppers.count}}" md-on-paginate="vm_dc.getQueueCampaignHoppers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperHistories.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n                  <ms-search-bar on-search="vm_dc.getQueueCampaignHopperHistories()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperHistories.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperHistories.length}} {{vm_dc.selectedQueueCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperHistories" csv-label="true" filename="queueCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperHistories" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperHistories">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">\n                        {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridname">\n                        {{ \'MOTIONDIALER.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="statedesc">\n                        {{ \'MOTIONDIALER.STATUS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="scheduledat">\n                        {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.queueCampaignHopperHistories.rows">\n                      <td md-cell>\n                        {{hopperHistory.uniqueid}}\n                      </td>\n                      <td md-cell>\n                        {{hopperHistory.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperHistory.calleridnum}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperHistory.calleridname}}\n                      </td>\n                      <td md-cell>\n                        {{hopperHistory.statedesc}}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.scheduledat | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.endtime | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.queueCampaignHopperHistories.rows.length">\n                      <td md-cell colspan="11">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperHistories" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.FINAL">FINAL</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperFinals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n                  <ms-search-bar on-search="vm_dc.getQueueCampaignHopperFinals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                  <td md-cell class="actions">\n                    <md-menu>\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsQueueCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n                        <md-icon md-font-icon="icon-backup-restore"></md-icon>\n                        <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(3)">\n                            <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n                            <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(5)">\n                            <span translate="MOTIONDIALER.BUSY ">Busy</span>\n                            <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(8)">\n                            <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n                            <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(10)">\n                            <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n                            <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(11)">\n                            <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n                            <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(22)">\n                            <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n                            <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(0)">\n                            <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n                            <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item>\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(19)">\n                            <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n                            <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </td>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperFinals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperFinals.length}} {{vm_dc.selectedQueueCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperFinals" csv-label="true" filename="queueCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedQueueCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="MOTIONDIALER.MOVE_SELECTED">\n                    <md-icon md-font-icon="icon-restore"></md-icon>\n                    <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperFinals" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperFinals">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">\n                        {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridname">\n                        {{ \'MOTIONDIALER.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="statedesc">\n                        {{ \'MOTIONDIALER.STATUS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countcongestionretry">\n                        {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countbusyretry">\n                        {{ \'MOTIONDIALER.BUSY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnoanswerretry">\n                        {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnosuchnumberretry">\n                        {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countdropretry">\n                        {{ \'MOTIONDIALER.DROP\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countabandonedretry">\n                        {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countmachineretry">\n                        {{ \'MOTIONDIALER.MACHINE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countagentrejectretry">\n                        {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="disposition">\n                        {{ \'MOTIONDIALER.DISPOSITION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="secondDisposition">\n                        {{ \'MOTIONDIALER.SECOND_LEVEL_DISPOSITION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="thirdDisposition">\n                        {{ \'MOTIONDIALER.THIRD_LEVEL_DISPOSITION\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.queueCampaignHopperFinals.rows">\n                      <td md-cell>\n                        {{hopperFinal.uniqueid}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperFinal.calleridnum}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperFinal.calleridname}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.statedesc}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countcongestionretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countbusyretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countnoanswerretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countnosuchnumberretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countdropretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countabandonedretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countmachineretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countagentrejectretry}}\n                      </td>\n                      <td md-cell>\n                        {{ hopperFinal.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperFinal.endtime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.disposition}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.secondDisposition}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.thirdDisposition}}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n                                Move HopperFinal\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.queueCampaignHopperFinals.rows.length">\n                      <td md-cell colspan="30">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperFinals" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperBlacks.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n                  <ms-search-bar on-search="vm_dc.getQueueCampaignHopperBlacks()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperBlacks.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperBlacks.length}} {{vm_dc.selectedQueueCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperBlacks" csv-label="true" filename="queueCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperBlacks" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperBlacks">\n                    <tr md-row>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="phone">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.queueCampaignHopperBlacks.rows">\n                      <td md-cell>\n                        {{hopperBlack.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperBlack.phone}}\n                      </td>\n                      <td md-cell class="actions">\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.queueCampaignHopperBlacks.rows.length">\n                      <td md-cell colspan="4">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperBlacks" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",'<div id="queueCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MOTIONDIALER.QUEUECAMPAIGNS">QueueCampaigns</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedQueueCampaigns.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedQueueCampaigns =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MOTIONDIALER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-queueCampaigns-count">\n          <span>{{vm.selectedQueueCampaigns.length}}</span>\n          <span translate="MOTIONDIALER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MOTIONDIALER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllQueueCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectQueueCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedQueueCampaigns" csv-label="true" filename="queueCampaigns.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedQueueCampaigns($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- QUEUECAMPAIGN TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedQueueCampaigns" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueueCampaigns">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n                <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n                <th md-column md-order-by="dialMethod">{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'MOTIONDIALER.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.queueCampaigns.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="queueCampaign" md-select-id="id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n                <td md-cell ng-if="queueCampaign.userpic"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="api/users/{{queueCampaign.id}}/avatar" /></td>\n                <td md-cell ng-if="!queueCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="id ">{{queueCampaign.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="name ">{{queueCampaign.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialActive ">\n                  <md-icon md-colors="{color: {{queueCampaign.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queueCampaign.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':queueCampaign.TrunkId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialMethod ">{{ vm.arraydialMethod[queueCampaign.dialMethod].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="strategy ">{{ vm.arraystrategy[queueCampaign.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(queueCampaign, $event    )" translate="MOTIONDIALER.EDIT_QUEUECAMPAIGN">\n                          Edit QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(queueCampaign, $event    )" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n                          clone QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.listadddialog(queueCampaign, $event    )" translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">\n                          listadd QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.blacklistadddialog(queueCampaign, $event    )" translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">\n                          blacklistadd QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(queueCampaign, $event    )" translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">\n                          teamadd QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(queueCampaign, $event    )" translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">\n                          agentadd QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(queueCampaign, $event    )" translate="MOTIONDIALER.DELETE_QUEUECAMPAIGN">\n                          Delete QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(queueCampaign, $event    )" translate="MOTIONDIALER.GOTOREALTIME_QUEUECAMPAIGN">\n                          goToRealtime QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queueCampaigns.count}}" md-on-paginate="vm.getQueueCampaigns" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / QUEUECAMPAIGN TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD QUEUECAMPAIGN BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-queueCampaign-button" ng-click="vm.createOrEditQueueCampaign($event)" aria-label="add queueCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD QUEUECAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n  <div class="md-toolbar-tools" layout="row" layout-align="center center">\n    <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n    <ms-search-bar on-search="vm.getAbandonedCalls()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300">\n    </ms-search-bar>\n    <div flex></div>\n\n    <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getAbandonedCalls()"></ms-quick-filter>\n\n    <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n      <md-icon md-font-icon="icon-reload"></md-icon>\n      <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}\n      </md-tooltip>\n    </md-button>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAbandonedCalls">\n      <tr md-row>\n        <th md-column md-order-by="id">ID</th>\n        <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n        <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n        <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n        <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n        <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n        <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n        <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.abandonedCalls.rows.length">\n        <td md-cell colspan="12">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="call in vm.abandonedCalls.rows">\n        <td md-cell class="id">{{call.id}}</td>\n        <td md-cell class="firstName" privacy ng-cloak>{{call.calleridname}}</td>\n        <td md-cell class="list" privacy ng-cloak>{{call.calleridnum}}</td>\n        <td md-cell class="list">{{vm.queuesMap[call.queue]}}</td>\n        <td md-cell class="list">\n          {{call.queuecallerabandonAt ? (call.queuecallerabandonAt | formatdate) : (call.queuecallerexitAt | formatdate) }}\n        </td>\n        <td md-cell class="list">{{call.queuecallerexitAt ? (call.queuecallerexitAt | formatdate) : undefined }}\n        </td>\n        <td md-cell class="list">{{call.queuecallerexitreason}}</td>\n        <td md-cell class="list">{{call.lastAssignedTo}}</td>\n        <td md-cell class="list">{{ call.disposition }}</td>\n        <td md-cell class="list">{{ call.secondDisposition }}</td>\n        <td md-cell class="list">{{ call.thirdDisposition }}</td>\n        <td md-cell class="actions">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="2">\n              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                <md-menu>\n                  <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">\n                    Assigned\n                    to</md-button>\n                  <md-menu-content>\n                    <md-menu-item ng-if="call.lastAssignedTo">\n                      <md-button ng-click="vm.assignTo(call)"><em translate="DASHBOARDS.NONE">Not Assigned</em>\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n                      <md-button ng-click="vm.assignTo(call,agent)">{{agent.name}}</md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.dispose(call)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">\n                  Dispose\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.abandonedCalls.count}}" md-on-paginate="vm.getAbandonedCalls" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getCampaigns()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCampaigns">\n      <tr md-row>\n        <th md-column>{{\'MOTIONDIALER.NAME\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.TOTAL_MANAGED\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.LIMITED\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.ORIGINATED\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.MESSAGE\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.TRUNK\' | translate }}</th>\n        <th md-column>{{\'MOTIONDIALER.ACTIVE\' | translate }}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.campaigns">\n        <td md-cell colspan="8">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, campaign) in vm.campaigns">\n        <td md-cell>\n          <span>{{campaign.name}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.ivrTotalCallsDays || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.ivrAnswerCallsDay || 0}} ({{(campaign.ivrTotalCallsDays) ? (campaign.ivrAnswerCallsDay || 0) * 100/(campaign.ivrTotalCallsDays ) : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.limitCalls || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.originated || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.message ? (\'MOTIONDIALER.\'+campaign.message | translate) : \'--\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.dialQueueProject || \'--\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{campaign.Trunk ? campaign.Trunk.name : \'--\'}}</span>\n        </td>\n        <td md-cell>\n          <md-icon md-colors="{color: {{campaign.active ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{campaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.createOrEditIvrCampaign($event, campaign)" translate="MOTIONDIALER.EDIT_CAMPAIGN">\n                  Edit Campaign\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getCampaigns" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n  </div>\n</md-toolbar>\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n  <table md-table>\n    <thead md-head>\n      <tr md-row>\n        <th md-column width="30px"></th>\n        <th md-column>{{ \'MOTIONDIALER.DID\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.QUEUE\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.CALLER\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.DURATION\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n        <td md-cell>\n          <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n          <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n        </td>\n        <td md-cell>{{channel.exten}}</td>\n        <td md-cell>{{channel.queue}}</td>\n        <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n        <td md-cell>\n          <span ng-if="channel.queuecallerleaveAt">\n            {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n            <span class="text-boxed">\n              <timer start-time="channel.queuecallerleaveAt"></timer>\n            </span>\n          </span>\n          <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n            {{ \'MOTIONDIALER.WAITING_FOR_AGENT\' | translate }}\n            <timer start-time="channel.queuecallerjoinAt"></timer>\n          </span>\n        </td>\n        <td md-cell>\n          <span class="text-boxed">\n            <timer start-time="channel.queuecallerjoinAt"></timer>\n          </span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="2">\n              <md-menu-item>\n                <md-button ng-click="vm.hangup(channel.uniqueid)" translate="MOTIONDIALER.HANGUP">\n                  Hangup\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="MOTIONDIALER.REDIRECT_TO_NUMBER">\n                  Number\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-menu class="no-margin">\n                  <md-button ng-mouseenter="vm.getAvailableAgents()" translate="MOTIONDIALER.REDIRECT_TO_AGENT">\n                    Redirect to Agent</md-button>\n                  <md-menu-content>\n                    <md-menu-item ng-if="!vm.availableAgents">\n                      <md-progress-circular class="md-accent auto-margin" md-diameter="32" md-mode="indeterminate">\n                      </md-progress-circular>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.availableAgents.length > 0" ng-repeat="agent in vm.availableAgents">\n                      <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">\n                        {{agent.name}}</md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.availableAgents.length === 0">\n                      <span>No agents available</span>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column>{{\'\n                                MOTIONDIALER.NAME\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.TOTAL\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.TOTAL_OFFERED\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.MANAGED\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.ABANDONED\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.DROPPED\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.AVG_HOLD_TIME\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.AVG_DURATION\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.AVG_BILLABLE\' | translate}}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues">\n        <td md-cell colspan="8">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, queue) in vm.queues">\n        <td md-cell>\n          <span>{{queue.name}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{(queue.answered + queue.outboundNoAnswerCallsDay + queue.outboundBusyCallsDay + queue.outboundCongestionCallsDay + queue.outboundNoSuchCallsDay + queue.outboundUnknownCallsDay + queue.outboundDropCallsDayTimeout + queue.outboundDropCallsDayCallersExit + queue.outboundBlacklistCallsDay + queue.outboundOriginateFailureCallsDay + queue.outboundAnswerAgiCallsDay + queue.outboundReCallsDay + queue.outboundRejectCallsDay )|| 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.answered) ? (100 - (((queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total)) | number:1 ) - (((queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total )) | number:1 )  ) : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayCallersExit || 0}} ({{(queue.outboundDropCallsDayCallersExit) ? (queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total ) : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayTimeout || 0}} ({{(queue.outboundDropCallsDayTimeout) ? (queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total) : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queues/predictive/dialog.html",'<md-dialog class="predictive-dialog" aria-label="New predictive">\n  <md-toolbar class="md-accent md-hue-2">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n      <span class="title">{{ vm.queueCampaign.name }} Info</span>\n      <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-dialog-content class="text-center">\n    <ds-widget-clock data-show-digital></ds-widget-clock>\n    <div ng-if="!vm.queueCampaign.startProgressive && !vm.queueCampaign.startPredictive">\n      <div class="md-title"><span translate="MOTIONDIALER.PREDICTIVE_IS_NOT_RUNNING">Predictive is not running</span></div>\n    </div>\n\n    <div ng-if="vm.queueCampaign.startProgressive && !vm.queueCampaign.startPredictive" class="m-10">\n      <div layout="row">\n        <div flex="" class="column">\n          <div class="md-headline"><span translate="MOTIONDIALER.DATA_COLLECTION_IN_PROGRESSIVE">Data collection in progressive</span></div>\n          <div class="md-subhead">({{vm.queueCampaign.dialPredictiveInterval}} minutes)</div>\n        </div>\n      </div>\n\n      <div layout="row">\n        <div flex="" class="column">\n          <div class="md-subhead"><span translate="MOTIONDIALER.STARTTIME">Start Time</span></div>\n          <div class="md-headline">{{ vm.setFormatTime(vm.queueCampaign.startProgressive) }}</div>\n        </div>\n        <div flex="" class="column">\n          <div class="md-subhead"><span translate="MOTIONDIALER.ENDTIME">End Time</span></div>\n          <div class="md-headline">\n            {{ vm.addMinutes(vm.queueCampaign.startProgressive, vm.queueCampaign.dialPredictiveInterval) }}\n          </div>\n        </div>\n      </div>\n      <div>\n        <span class="text-boxed blue-bg white-fg">\n          {{vm.queueCampaign.message ? (\'MOTIONDIALER.\' + vm.queueCampaign.message | translate) : \'--\'}}\n        </span>\n      </div>\n    </div>\n    <div ng-if="vm.queueCampaign.startPredictive" class="m-10">\n      <div layout="row">\n        <div flex="" class="column">\n          <div class="md-headline"><span translate="MOTIONDIALER.PREDICTIVE_IS_RUNNING">Predictive is runnning</span></div>\n          <div class="md-subhead">({{vm.queueCampaign.dialPredictiveInterval}} minutes)</div>\n        </div>\n      </div>\n\n      <div layout="row">\n        <div flex="" class="column">\n          <div class="md-subhead"><span translate="MOTIONDIALER.STARTTIME">Start Time</span></div>\n          <div class="md-headline">{{ vm.setFormatTime(vm.queueCampaign.startPredictive) }}</div>\n        </div>\n        <div flex="" class="column">\n          <div class="md-subhead"><span translate="MOTIONDIALER.ENDTIME">End Time</span></div>\n          <div class="md-headline">\n            {{ vm.addMinutes(vm.queueCampaign.startPredictive, vm.queueCampaign.dialPredictiveInterval) }}\n          </div>\n        </div>\n      </div>\n      <div>\n        <span class="text-boxed blue-bg white-fg">\n          {{vm.queueCampaign.message ? (\'MOTIONDIALER.\' + vm.queueCampaign.message | translate) : \'--\'}}\n        </span>\n      </div>\n      <div class="row">\n        <md-card>\n          <md-toolbar class="md-table-toolbar md-default">\n            <div class="md-toolbar-tools">\n              <span class="md-subhead">Predictive - {{ \'MOTIONDIALER.PREVIOUS_INTERVAL\' | translate }}</span>\n            </div>\n          </md-toolbar>\n          <md-table-container>\n            <table md-table>\n              <tbody md-body>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.TOTAL_CALLS">Total Calls</span></td>\n                  <td md-cell>{{ vm.queueCampaign.predictiveIntervalTotalCalls }}</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.ANSWERED_CALLS">Total Calls</span></td>\n                  <td md-cell>{{ vm.queueCampaign.predictiveIntervalAnsweredCalls }}</td>\n                </tr>\n                \x3c!-- Temporaneamente non mostrate perchè contengono anche i dati dell\'intervallo corrente --\x3e\n                \x3c!-- <tr md-row>\n                                    <td md-cell>Dropped Calls Timeout</td>\n                                    <td md-cell>{{ vm.queueCampaign.predictiveIntervalDroppedCallsTimeout }}</td>\n                                </tr>\n                                <tr md-row>\n                                    <td md-cell>Dropped Calls Caller Exit</td>\n                                    <td md-cell>{{ vm.queueCampaign.predictiveIntervalDroppedCallsCallersExit }}\n                                    </td>\n                                </tr> --\x3e\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.AVG_HOLD_TIME">AVG Hold Time</span></td>\n                  <td md-cell>~ {{ vm.queueCampaign.predictiveIntervalAvgHoldtime | number:0 }}s</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.AVG_TALK_TIME">AVG Talk Time</span></td>\n                  <td md-cell>~ {{ vm.queueCampaign.predictiveIntervalAvgTalktime | number:0 }}s</td>\n                </tr>\n              </tbody>\n            </table>\n          </md-table-container>\n        </md-card>\n        <md-card>\n          <md-toolbar class="md-table-toolbar md-default">\n            <div class="md-toolbar-tools">\n              <span class="md-subhead">ErlangB - {{ \'MOTIONDIALER.CURRENT_INTERVAL\' | translate }}</span>\n            </div>\n          </md-toolbar>\n          <md-table-container>\n            <table md-table>\n              <tbody md-body>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span></td>\n                  <td md-cell>{{ vm.queueCampaign.erlangCalls }}</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.ONE_CALL_EVERY">One call every</span></td>\n                  <td md-cell>~ {{ vm.queueCampaign.erlangCallToSecond | number:0 }}s</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.DROPRATE">Drop Rate</span></td>\n                  <td md-cell>{{ vm.queueCampaign.erlangAbandonmentRate * 100 | number:2 }}%</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.AGENTBUSYFACTOR">Agent Busy Factor</span></td>\n                  <td md-cell>{{ vm.queueCampaign.erlangBusyFactor * 100 | number:2 }}%</td>\n                </tr>\n              </tbody>\n            </table>\n          </md-table-container>\n        </md-card>\n      </div>\n    </div>\n\n\n  </md-dialog-content>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.TALKING\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.WAITING\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.ORIGINATED_TEXT\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.MESSAGE\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n        <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="12">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedInDb }} ({{ queue.loggedIn }})</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.talking  + queue.pTalking}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedInDb - queue.available - queue.paused - queue.talking - queue.waiting\n               }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.originated }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{ queue.message ? (\'MOTIONDIALER.\'+queue.message | translate) : \'--\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.dialMethod || 0 }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{ queue.Trunk ? queue.Trunk.name : \'--\' }}</span>\n        </td>\n        <td md-cell>\n          <md-icon md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="MOTIONDIALER.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item ng-if="queue.dialMethod == \'predictive\'">\n                <md-button ng-click="vm.showPredictiveQueueCampaignInfo($event, queue)" translate="MOTIONDIALER.SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO">\n                  Show Predictive Info\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="MOTIONDIALER.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.ABANDONEDCALLS">Abandoned Queue Calls</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.QUEUE_PARAMS">Queue Parameters</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelAccount">\n\n        <div ng-messages="openchannelAccountForm[\'name\'].$error" ng-show="openchannelAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="openchannelAccountForm[\'key\'].$error" ng-show="openchannelAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n        <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n\n        <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n        <div ng-messages="openchannelAccountForm[\'replyUri\'].$error" ng-show="openchannelAccountForm[\'replyUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n        <div ng-messages="openchannelAccountForm[\'ListId\'].$error" ng-show="openchannelAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n\n        <div ng-messages="openchannelAccountForm[\'description\'].$error" ng-show="openchannelAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelAccount" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid || openchannelAccountForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelAccount" ng-click="vm.addNewOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELACCOUNT" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n          ADD OPENCHANNELACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelAccount" ng-click="vm.deleteOpenchannelAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",'<md-dialog class="openchannelAccount-dialog" aria-label="openchannelAccount" ng-init="vm.onInit()">\n  <form name="openchannelAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">Add Agent to openchannelAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/agent/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'agent\'].$error" ng-show="openchannelAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.ACCESSKEYID">accesskeyid</label>\n        <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'accesskeyid\'].$error" ng-show="openchannelAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.SECRETACCESSKEY">secretaccesskey</label>\n        <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'secretaccesskey\'].$error" ng-show="openchannelAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.LEXREGION">lexregion</label>\n        <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n          <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n          <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n          <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'lexregion\'].$error" ng-show="openchannelAccountFormApp[\'lexregion\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.BOTNAME">botname</label>\n        <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'botname\'].$error" ng-show="openchannelAccountFormApp[\'botname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'times\'].$error" ng-show="openchannelAccountFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TEXT">Text</label>\n        <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n        <div ng-messages="openchannelAccountFormApp[\'text\'].$error" ng-show="openchannelAccountFormApp[\'text\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TEXT_REQUIRED">Text field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/close/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'disposition\'].$error" ng-show="openchannelAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'key\'].$error" ng-show="openchannelAccountFormApp[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n          <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'sv\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'language\'].$error" ng-show="openchannelAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.PROJECTID">ProjectID</label>\n        <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'projectId\'].$error" ng-show="openchannelAccountFormApp[\'projectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.CLIENTEMAIL">ClientEmail</label>\n        <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'clientEmail\'].$error" ng-show="openchannelAccountFormApp[\'clientEmail\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.PRIVATEKEY">PrivateKey</label>\n        <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n        <div ng-messages="openchannelAccountFormApp[\'privateKey\'].$error" ng-show="openchannelAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n          <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n          <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n          <md-option ng-value="\'en-IN\'">English (India)</md-option>\n          <md-option ng-value="\'en-US\'">English (US)</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n          <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'hi\'">Hindi</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pl\'">Polish</md-option>\n          <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n          <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n          <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n          <md-option ng-value="\'sw\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'tr\'">Turkish</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'language\'].$error" ng-show="openchannelAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'condition\'].$error" ng-show="openchannelAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'truepriority\'].$error" ng-show="openchannelAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'falsepriority\'].$error" ng-show="openchannelAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'priority\'].$error" ng-show="openchannelAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/noop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'value\'].$error" ng-show="openchannelAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/queue/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'queue\'].$error" ng-show="openchannelAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/system/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'command\'].$error" ng-show="openchannelAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'variable\'].$error" ng-show="openchannelAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/tag/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'tag\'].$error" ng-show="openchannelAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",'<md-dialog class="openchannelCannedAnswer-dialog" aria-label="New OpenchannelCannedAnswer">\n  <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.openchannelCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="openchannelCannedAnswerForm[\'key\'].$error" ng-show="openchannelCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.openchannelCannedAnswer.value" required></textarea>\n\n        <div ng-messages="openchannelCannedAnswerForm[\'value\'].$error" ng-show="openchannelCannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.openchannelCannedAnswer.description">\n\n        <div ng-messages="openchannelCannedAnswerForm[\'description\'].$error" ng-show="openchannelCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelCannedAnswer" ng-click="vm.saveOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelCannedAnswer" ng-click="vm.addNewOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n          ADD OPENCHANNELCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelCannedAnswer" ng-click="vm.deleteOpenchannelCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",'<div id="openchannel-openchannelAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-openchannelAccounts-button md-icon-button" aria-label="Go to openchannelAccounts" ng-click="vm.gotoOpenchannelAccounts()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="openchannelAccount-image" hide-xs>\n          <img ng-src="assets/images/business/openchannelAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.openchannelAccount.id}}\n            <span ng-if="vm.openchannelAccount.name">{{vm.openchannelAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.openchannelAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveOpenchannelAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (openchannelDispositionsForm.$invalid) || (openchannelCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n                <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n                <div ng-messages="generalForm[\'replyUri\'].$error" ng-show="generalForm[\'replyUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.openchannelAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.MAPKEY">MapKey</label>\n                <md-select name="mapKey" ng-model="vm.openchannelAccount.mapKey" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">None</md-option>\n                  <md-optgroup label="standard">\n                    <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="!mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n                  </md-optgroup>\n                  <md-optgroup label="custom">\n                    <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n                  </md-optgroup>\n                </md-select>\n                <div ng-messages="generalForm[\'mapKey\'].$error" ng-show="generalForm[\'mapKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.MAPKEY_REQUIRED">MapKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.openchannelAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.RECEIVEURI">receiveUri</label>\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUri" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-receiveUri" name="receiveUri" ng-value="vm.location + \'/api/openchannel/accounts/\' + vm.openchannelAccount.id + \'/notify\'" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="OPENCHANNEL.HELP.RECEIVEURI"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="openchannelAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="OPENCHANNEL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.openchannelAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="openchannelAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.openchannelAccount.queueTransfer == true" class="md-block">\n                <label translate="OPENCHANNEL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.openchannelAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.openchannelAccount.agentTransfer == true" class="md-block">\n                <label translate="OPENCHANNEL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.openchannelAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.PROXY">PROXY</div>\n            </div>\n            <form name="proxyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.TOKEN">token</label>\n                <input type="text" name="token" ng-model="vm.openchannelAccount.token" autofocus disabled>\n\n                <div class="hint"><span translate="OPENCHANNEL.HELP.TOKEN"></span></div>\n                <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.TOKEN_REQUIRED">token field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="openchannelAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.openchannelAccount.mandatoryDisposition" class="md-block">\n                <label translate="OPENCHANNEL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.openchannelAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="OPENCHANNEL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="OpenchannelAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="openchannelAccount-detail-form-container openchanneldispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="OPENCHANNEL.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add openchannel dispositions" translate translate-attr-label="OPENCHANNEL.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="openchannelAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container openchannelcannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="OpenchannelAccountOpenchannelCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELCANNEDANSWERS">OpenchannelCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event)" aria-label="add openchannelCannedAnswer" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelCannedAnswers" csv-label="true" filename="openchannelAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'OPENCHANNEL.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'OPENCHANNEL.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'OPENCHANNEL.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'OPENCHANNEL.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'OPENCHANNEL.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="openchannelCannedAnswer" md-select-id="id" ng-repeat="openchannelCannedAnswer in vm_dc.openchannelAccountOpenchannelCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{openchannelCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{openchannelCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{openchannelCannedAnswer.value}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{openchannelCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{ openchannelCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" translate="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER">\n                                Edit OpenchannelCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(openchannelCannedAnswer, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELCANNEDANSWER">\n                                Delete OpenchannelCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="OPENCHANNEL.NO_OPENCHANNELCANNEDANSWER_AVAILABLE">No openchannelcannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelCannedAnswers.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="OpenchannelAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.openchannelAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="OPENCHANNEL.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOpenchannelAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOpenchannelAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedOpenchannelAccountApps.length}} {{vm_ac.selectedOpenchannelAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedOpenchannelAccountApps($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedOpenchannelAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.openchannelAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editOpenchannelAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.openchannelAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="OpenchannelAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="OPENCHANNEL.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getOpenchannelAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getOpenchannelAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getOpenchannelAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="OPENCHANNEL.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountInteractions.length}} {{vm_dc.selectedOpenchannelAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountInteractions" csv-label="true" filename="openchannelAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'OPENCHANNEL.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'OPENCHANNEL.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'OPENCHANNEL.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'OPENCHANNEL.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'OPENCHANNEL.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'OPENCHANNEL.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'OPENCHANNEL.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.openchannelAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'OPENCHANNEL.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'OPENCHANNEL.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spyopenchannelInteraction($event, interaction)" translate="OPENCHANNEL.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n                              <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event, true)" translate="OPENCHANNEL.DOWNLOAD_WITH_ATTACHMENTS">\n                                Download with attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event)" translate="OPENCHANNEL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                                Download without attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="OPENCHANNEL.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.openchannelAccountInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="OPENCHANNEL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountInteractions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",'<div id="openchannelAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELACCOUNTS">OpenchannelAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedOpenchannelAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="OPENCHANNEL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-openchannelAccounts-count">\n          <span>{{vm.selectedOpenchannelAccounts.length}}</span>\n          <span translate="OPENCHANNEL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNEL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelAccounts" csv-label="true" filename="openchannelAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelAccounts($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- OPENCHANNELACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n                <th md-column md-order-by="replyUri">{{ \'OPENCHANNEL.REPLYURI\' | translate }}</th>\n                <th md-column md-order-by="ListId">{{ \'OPENCHANNEL.LIST\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.openchannelAccounts.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="openchannelAccount" md-select-id="id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n                <td md-cell ng-if="openchannelAccount.userpic"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="api/users/{{openchannelAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!openchannelAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="id ">{{openchannelAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="name ">{{openchannelAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="key ">{{openchannelAccount.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="replyUri ">{{openchannelAccount.replyUri}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':openchannelAccount.ListId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="description ">{{openchannelAccount.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(openchannelAccount, $event    )" translate="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT">\n                          Edit OpenchannelAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(openchannelAccount, $event    )" translate="OPENCHANNEL.INTERACTIONS_OPENCHANNELACCOUNT">\n                          Interactions OpenchannelAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(openchannelAccount, $event    )" translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">\n                          AgentAdd OpenchannelAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(openchannelAccount, $event    )" translate="OPENCHANNEL.DELETE_OPENCHANNELACCOUNT">\n                          Delete OpenchannelAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelAccounts.count}}" md-on-paginate="vm.getOpenchannelAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / OPENCHANNELACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD OPENCHANNELACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelAccount-button" ng-click="vm.createOrEditOpenchannelAccount($event)" aria-label="add openchannelAccount" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD OPENCHANNELACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",'<md-dialog class="openchannelQueue-dialog" aria-label="New OpenchannelQueue">\n  <form name="openchannelQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelQueue">\n\n        <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n        <div ng-messages="openchannelQueueForm[\'name\'].$error" ng-show="openchannelQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="openchannelQueueForm[\'strategy\'].$error" ng-show="openchannelQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="openchannelQueueForm[\'timeout\'].$error" ng-show="openchannelQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n\n        <div ng-messages="openchannelQueueForm[\'description\'].$error" ng-show="openchannelQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelQueue" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid || openchannelQueueForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelQueue" ng-click="vm.addNewOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELQUEUE" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n          ADD OPENCHANNELQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelQueue" ng-click="vm.deleteOpenchannelQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n  <form name="openchannelQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">Add Agent to openchannelQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n  <form name="openchannelQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="OPENCHANNEL.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/view.html",'<div id="openchannel-openchannelQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-openchannelQueues-button md-icon-button" aria-label="Go to openchannelQueues" ng-click="vm.gotoOpenchannelQueues()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="openchannelQueue-image" hide-xs>\n          <img ng-src="assets/images/business/openchannelQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.openchannelQueue.id}}\n            <span ng-if="vm.openchannelQueue.name">{{vm.openchannelQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.openchannelQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.openchannelQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveOpenchannelQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.openchannelQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",'<div id="openchannelQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELQUEUES">OpenchannelQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedOpenchannelQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="OPENCHANNEL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-openchannelQueues-count">\n          <span>{{vm.selectedOpenchannelQueues.length}}</span>\n          <span translate="OPENCHANNEL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNEL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllOpenchannelQueues()" translate="OPENCHANNEL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectOpenchannelQueues()" translate="OPENCHANNEL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelQueues" csv-label="true" filename="openchannelQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelQueues($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- OPENCHANNELQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'OPENCHANNEL.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.openchannelQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="openchannelQueue" md-select-id="id" ng-repeat="openchannelQueue in vm.openchannelQueues.rows">\n                <td md-cell ng-if="openchannelQueue.userpic"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="api/users/{{openchannelQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!openchannelQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="id ">{{openchannelQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="name ">{{openchannelQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="strategy ">{{ vm.arraystrategy[openchannelQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(openchannelQueue, $event    )" translate="OPENCHANNEL.EDIT_OPENCHANNELQUEUE">\n                          Edit OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(openchannelQueue, $event    )" translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">\n                          teamadd OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(openchannelQueue, $event    )" translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">\n                          agentadd OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(openchannelQueue, $event    )" translate="OPENCHANNEL.DELETE_OPENCHANNELQUEUE">\n                          Delete OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(openchannelQueue, $event    )" translate="OPENCHANNEL.GOTOREALTIME_OPENCHANNELQUEUE">\n                          goToRealtime OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelQueues.count}}" md-on-paginate="vm.getOpenchannelQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / OPENCHANNELQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD OPENCHANNELQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelQueue-button" ng-click="vm.createOrEditOpenchannelQueue($event)" aria-label="add openchannelQueue" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD OPENCHANNELQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="OPENCHANNEL.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n        <th md-column>{{ \'OPENCHANNEL.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'OPENCHANNEL.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'OPENCHANNEL.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="OPENCHANNEL.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="OPENCHANNEL.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/openchannel/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/plugins/views/plugin/plugin.html",'<div ng-if="!vm.plugin">\n  <p>Plugin not available...</p>\n</div>\n<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n  <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/realtime/views/agents/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.AGENTS">Agents</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getAgents()" query="vm.query" debounce="300"></ms-search-bar>\n    <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.getAgents()">\n      <md-option ng-value="\'\'">{{ \'VOICE.ALL\' | translate }}</md-option>\n      <md-option value="pause">{{ \'VOICE.PAUSE\' | translate }}</md-option>\n      <md-option value="*pause">{{ \'VOICE.PARTIALPAUSE\' | translate }}</md-option>\n      <md-option value="busy">{{ \'VOICE.BUSY\' | translate }}</md-option>\n      <md-option value="idle">{{ \'VOICE.IDLE\' | translate }}</md-option>\n    </md-select>\n    <md-select ng-if="vm.query.globalStatusFilter === \'pause\' || vm.query.globalStatusFilter === \'*pause\'" ng-model="vm.query.pauseTypeFilter" class="md-caption ml-16" ng-change="vm.getAgents()">\n      <md-option ng-value="\'\'">All</md-option>\n      <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n      <md-option value="ACW">ACW</md-option>\n      <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n      <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n      <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n    </md-select>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n      <tr md-row>\n        <th class="bv text-center" colspan="5">{{ \'VOICE.AGENT\' | translate }}</th>\n        <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n        <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n        <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n        <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n        <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">\n          {{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n        <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n        <th ng-if="vm.license.whatsapp" class="bv bl text-center" colspan="2">\n          {{ \'WHATSAPP.WHATSAPP\' | translate }}</th>\n        <th width="10px" class="bt bl" rowspan="2"></th>\n      </tr>\n      <tr md-row>\n        <th class="bl" colspan="2" md-column md-order-by="fullname">\n          {{ \'VOICE.NAME\' | translate }}</th>\n        <th class="bl custom-column" md-column md-order-by="globalStatus">\n          {{ \'VOICE.STATUS\' | translate }}</th>\n        <th class="bl custom-column" md-column md-order-by="lastLoginAt">\n          {{ \'VOICE.LOGIN_TIME\' | translate }}</th>\n        <th class="bl custom-column" md-column md-order-by="lastPauseAt">\n          {{ \'VOICE.PAUSE_TIME\' | translate }}</th>\n        <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n        <th class="bl custom-column">Info</th>\n        <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.chat" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.mail" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.messaging" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.openchannel" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.fax" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.whatsapp" class="bl text-center">{{ \'WHATSAPP.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.whatsapp" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'WHATSAPP.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.agents.count > 0">\n        <td md-cell colspan="19">\n          <div layout="row" layout-align="center center">\n            <span>{{ \'VOICE.NO_AGENT_ONLINE\' | translate }}</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n        <td class="bt padding-5">\n          <div layout="row" layout-align="start center">\n            <img class="avatar" ng-src="{{agent.userpic && \'api/users/\'+ agent.id +\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n            <div layout="column">\n              <span>{{agent.fullname}}</span>\n              <span>{{agent.internal}}</span>\n            </div>\n          </div>\n        </td>\n        <td class="bt padding-5">\n          <div layout="row" layout-align="start center" ng-if="vm.license.screenrecording && (agent.phoneBarEnableScreenRecordingByAgent || agent.phoneBarEnableAutomaticScreenRecording)">\n            <div class="column">\n              <span>\n                <md-icon md-font-icon="icon-camcorder-box" ng-class="agent.screenrecording ? \'green-fg\' : \'grey-fg\'" aria-hidden="true">\n                  <md-tooltip>\n                    {{ agent.screenrecording ? \'VOICE.TOOLTIP_SCREENRECORDING_ON\' : \'VOICE.TOOLTIP_SCREENRECORDING_OFF\'\n                    | translate }}\n                  </md-tooltip>\n                </md-icon>\n              </span>\n            </div>\n          </div>\n        </td>\n        <td class="bt text-center">\n'+"          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[agent.globalStatus]\">\n            {{ agent.globalStatus === 'pause' || agent.globalStatus === '*pause' ? \n              ((agent.globalStatusDisplayValue === 'DEFAULT PAUSE' ? ('VOICE.DEFAULT_PAUSE' | translate) : agent.globalStatusDisplayValue) | uppercase) : \n              ('VOICE.' + (agent.globalStatusDisplayValue | uppercase) | translate | uppercase)\n            }}\n          </span>\n        </td>\n        <td class=\"bt custom-column\">\n          <timer start-time=\"agent.lastLoginAt\"></timer>\n        </td>\n        <td class=\"bt custom-column\">\n          <timer ng-if=\"agent.globalStatus === 'pause' || agent.globalStatus === '*pause'\" start-time=\"agent.lastPauseAt\"></timer>\n        </td>\n        <td class=\"bt bl text-center\">\n          <span ng-if=\"!agent.onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[agent.voiceStatus]\">\n            {{ 'VOICE.' + (agent.voiceStatus | uppercase) | translate | uppercase }}</span>\n          <span ng-if=\"agent.onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">\n            {{ 'VOICE.ONHOLD' | translate | uppercase }}</span>\n        </td>\n        <td class=\"bt bl\">\n          <div layout=\"column\" ng-if=\"agent.voiceStatus === 'talking' || agent.voiceStatus === 'ringing'\">\n            <span ng-if=\"agent.queue\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">{{\n              agent.queue }}</span>\n            <span ng-if=\"agent.destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\" privacy ng-cloak>{{\n              agent.destconnectedlinenum }}</span>\n            <span ng-if=\"agent.routealias\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">{{\n              agent.routealias }}</span>\n            <span class=\"padding-5\" ng-if=\"agent.queue || agent.destconnectedlinenum\">\n              <timer start-time=\"agent.voiceStatusTime\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">\n              </timer>\n            </span>\n          </div>\n        </td>\n        <td class=\"bt bl text-center\" ng-if=\"vm.license.chat\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.chatStatus]\">\n            {{ 'VOICE.' + (agent.chatStatus | uppercase) | translate | uppercase }}</span>\n        </td>\n        <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.chatStatus]\">\n          {{ agent.chatCurrentCapacity }}</td>\n        <td class=\"bl bt text-center\" ng-if=\"vm.license.mail\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.mailStatus]\">\n            {{ 'VOICE.' + (agent.mailStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.mailStatus]\">\n          {{ agent.mailCurrentCapacity }}</td>\n        <td class=\"bl bt text-center\" ng-if=\"vm.license.messaging\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.smsStatus]\">\n            {{ 'VOICE.' + (agent.smsStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.smsStatus]\">\n          {{ agent.smsCurrentCapacity }}</td>\n        <td class=\"bt bl text-center\" ng-if=\"vm.license.openchannel\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.openchannelStatus]\">\n            {{ 'VOICE.' + (agent.openchannelStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.openchannelStatus]\">\n          {{ agent.openchannelCurrentCapacity }}</td>\n        <td class=\"bt bl text-center\" ng-if=\"vm.license.fax\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.faxStatus]\">\n            {{ 'VOICE.' + (agent.faxStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.faxStatus]\">\n          {{ agent.faxCurrentCapacity }}</td>\n        <td class=\"bl bt text-center\" ng-if=\"vm.license.whatsapp\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.whatsappStatus]\">\n            {{ 'VOICE.' + (agent.whatsappStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.whatsapp\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.whatsappStatus]\">\n          {{ agent.whatsappCurrentCapacity }}</td>\n        <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n          <md-menu>\n            <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n              <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n            </md-button>\n            <md-menu-content width=\"4\">\n              <md-menu-item>\n                <md-button ng-click=\"vm.logout(agent, $event)\" translate=\"VOICE.LOGOUT\">\n                  Logout\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click=\"vm.addQueue(agent, $event)\" translate=\"{{ vm.channel.toUpperCase() + '.AGENTADD_QUEUE' }}\">\n                  Add Agent In Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item ng-if=\"vm.license.screenrecording && agent.phoneBarEnableScreenRecordingByAgent\">\n                <md-menu>\n                  <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.SCREENRECORDING\">Manage Screen Recording\n                  </md-button>\n                  <md-menu-content>\n                    <md-menu-item>\n                      <md-button ng-click=\"vm.manageScreenRecording(agent, !agent.screenrecording)\" translate=\"{{ agent.screenrecording ? 'VOICE.STOP_SCREENRECORDING' : 'VOICE.START_SCREENRECORDING' }}\">\n                      </md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item>\n                <md-menu>\n                  <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.PAUSE\">Pause</md-button>\n                  <md-menu-content>\n                    <md-menu-item>\n                      <md-button ng-disabled=\"agent.voicePause && 'DEFAULT PAUSE' === agent.pauseType\" ng-click=\"vm.pause(agent)\">\n                        <em translate=\"VOICE.DEFAULT_PAUSE\">Default Pause</em>\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n                      <md-button ng-disabled=\"agent.voicePause && pause.name === agent.pauseType\" ng-click=\"vm.pause(agent, pause.name)\">{{pause.name}}\n                      </md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item ng-if=\"agent.globalStatus === 'pause' || agent.globalStatus === '*pause'\">\n                <md-button ng-click=\"vm.unpause(agent)\" translate=\"VOICE.UNPAUSE\">\n                  Unpause\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n<md-table-pagination md-label=\"{page: '{{'VOICE.PAGE' | translate}}:', rowsPerPage: '{{'VOICE.ROWSPERPAGE' | translate}}:', of: '{{'VOICE.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.agents.count}}\" md-on-paginate=\"vm.getAgents\" md-page-select></md-table-pagination>"),e.put("app/main/apps/settings/views/cloudProviders/cloudProviders.html",'<div id="cloudProviders" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.CLOUD_PROVIDERS">Cloud Providers</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedAiTools.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedAiTools =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="SETTINGS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-cloudProviders-count">\n          <span>{{vm.selectedAiTools.length}}</span>\n          <span translate="SETTINGS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SETTINGS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllAiTools()" translate="SETTINGS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectAiTools()" translate="SETTINGS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedAiTools" csv-label="true" filename="cloudProviders.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-click="vm.deleteSelectedAiTools($event)" aria-label="delete selected" translate translate-attr-label="SETTINGS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CLOUDPROVIDER TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedAiTools" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAiTools">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'SETTINGS.NAME\' | translate }}</th>\n                <th md-column md-order-by="service">{{ \'SETTINGS.SERVICE\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.cloudProviders.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="cloudProvider" md-select-id="id" ng-repeat="cloudProvider in vm.cloudProviders.rows">\n                <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="id">{{cloudProvider.id}}</td>\n                <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="name">{{cloudProvider.name}}</td>\n                <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="service">{{ vm.services[cloudProvider.service] }}</td>\n\n                <td md-cell class="actions">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="cloudProvider.service === \'MicrosoftAzure\'">\n                        <md-button ng-click="vm.authenticateToMicrosoftIdentityPlatform(cloudProvider)" translate="SETTINGS.AUTHENTICATE">\n                          Authenticate\n                        </md-button>\n                      </md-menu-item>\n\n                      <md-menu-item ng-if="cloudProvider.service === \'MicrosoftAzure\'">\n                        <md-button ng-click="vm.updateClientSecret(cloudProvider, $event)" translate="SETTINGS.UPDATE_CLIENT_SECRET">\n                          Update Client Secret\n                        </md-button>\n                      </md-menu-item>\n\n                      <md-menu-item>\n                        <md-button ng-click="vm.editdialog(cloudProvider, $event)" translate="SETTINGS.EDIT_CLOUDPROVIDER">\n                          Edit CloudProvider\n                        </md-button>\n                      </md-menu-item>\n\n                      <md-menu-item>\n                        <md-button ng-click="vm.deleteconfirm(cloudProvider, $event)" translate="SETTINGS.DELETE_CLOUDPROVIDER">\n                          Delete CloudProvider\n                        </md-button>\n                      </md-menu-item>\n\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cloudProviders.count}}" md-on-paginate="vm.getAiTools" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CLOUDPROVIDER TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CLOUDPROVIDER BUTTON --\x3e\n  <md-button class="md-fab md-accent" id="add-cloudProvider-button" ng-click="vm.createOrEditCloudProvider($event)" aria-label="add cloudProvider" translate translate-attr-aria-label="SETTINGS.ADD_CLOUDPROVIDER">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CLOUDPROVIDER BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/cloudProviders/create/dialog.html",'<md-dialog class="cloudProvider-dialog" aria-label="New CloudProvider">\n  <form name="cloudProviderForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ (vm.newCloudProvider ? \'SETTINGS.NEW_CLOUDPROVIDER\' : \'SETTINGS.EDIT_CLOUDPROVIDER\') | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.cloudProvider.name" ng-required="true" autofocus>\n\n        <div ng-messages="cloudProviderForm[\'name\'].$error" ng-show="cloudProviderForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.SERVICE">Service</label>\n        <md-select name="service" ng-model="vm.cloudProvider.service" required ng-disabled="!vm.newCloudProvider">\n          <md-option ng-if="vm.license.ai" ng-value="\'AmazonAWS\'">AmazonAWS</md-option>\n          <md-option ng-value="\'MicrosoftAzure\'">Microsoft Azure</md-option>\n        </md-select>\n        <div ng-messages="cloudProviderForm[\'service\'].$error" ng-show="cloudProviderForm[\'service\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.cloudProvider.service == \'MicrosoftAzure\'" class="md-block">\n        <label translate="SETTINGS.TYPE">Type</label>\n        <md-select name="service" ng-model="vm.cloudProvider.type" required ng-disabled="!vm.newCloudProvider">\n          <md-option ng-value="\'Outlook365\'">Outlook365</md-option>\n          <md-option ng-value="\'Dynamics365\'">Dynamics365</md-option>\n        </md-select>\n        <div ng-messages="cloudProviderForm[\'type\'].$error" ng-show="cloudProviderForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.cloudProvider.service == \'AmazonAWS\'" class="md-block">\n        <label translate="SETTINGS.ACCESSKEY">AccessKey</label>\n        <input type="text" name="data2" ng-model="vm.cloudProvider.data2" ng-required="true">\n\n        <div ng-messages="cloudProviderForm[\'data2\'].$error" ng-show="cloudProviderForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.ACCESSKEY_REQUIRED">AccessKey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.cloudProvider.service == \'AmazonAWS\'" class="md-block">\n        <label translate="SETTINGS.SECRETACCESSKEY">SecretAccesskey</label>\n        <input type="text" name="data1" ng-model="vm.cloudProvider.data1" ng-required="true">\n\n        <div ng-messages="cloudProviderForm[\'data1\'].$error" ng-show="cloudProviderForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.SECRETACCESSKEY_REQUIRED">SecretAccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div ng-if="vm.cloudProvider.service == \'MicrosoftAzure\'">\n        <md-input-container class="md-block">\n          <label translate="SETTINGS.APPLICATION_ID">Application Id</label>\n          <input type="text" name="data1" ng-model="vm.cloudProvider.data1" ng-required="true">\n\n          <div ng-messages="cloudProviderForm[\'data1\'].$error" ng-show="cloudProviderForm[\'data1\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block">\n          <label translate="SETTINGS.TENANT_ID">Tenant Id</label>\n          <input type="text" name="data2" ng-model="vm.cloudProvider.data2" ng-required="true">\n\n          <div ng-messages="cloudProviderForm[\'data2\'].$error" ng-show="cloudProviderForm[\'data2\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container ng-if="vm.newCloudProvider" class="md-block">\n          <label translate="SETTINGS.CLIENT_SECRET">Client Secret</label>\n          <input type="password" name="data3" ng-model="vm.cloudProvider.data3" ng-required="true">\n          <div class="hint"><span translate="SETTINGS.HELP.CLIENT_SECRET"></span></div>\n\n          <div ng-messages="cloudProviderForm[\'data3\'].$error" ng-show="cloudProviderForm[\'data3\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block">\n          <label translate="SETTINGS.REDIRECT_URI">Redirect Uri</label>\n          <input type="url" name="data4" ng-model="vm.cloudProvider.data4" ng-required="true">\n\n          <div ng-messages="cloudProviderForm[\'data4\'].$error" ng-show="cloudProviderForm[\'data4\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n            <div ng-message="url">\n              <span translate="SETTINGS.ERRORS.WRONG_FORMAT"></span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container ng-if="vm.cloudProvider.type == \'Dynamics365\'" class="md-block">\n          <label translate="SETTINGS.REMOTE_URI">Remote Uri</label>\n          <input type="url" name="data7" ng-model="vm.cloudProvider.data7" ng-required="true">\n\n          <div ng-messages="cloudProviderForm[\'data7\'].$error" ng-show="cloudProviderForm[\'data7\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n            <div ng-message="url">\n              <span translate="SETTINGS.ERRORS.WRONG_FORMAT"></span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newCloudProvider" ng-click="vm.saveCloudProvider()" class="send-button md-accent md-raised" ng-disabled="cloudProviderForm.$invalid || cloudProviderForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newCloudProvider" ng-click="vm.addNewCloudProvider()" class="send-button md-accent md-raised" ng-disabled="cloudProviderForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CLOUDPROVIDER" translate-attr-aria-label="SETTINGS.ADD_CLOUDPROVIDER">\n          ADD CLOUDPROVIDER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-click="vm.deleteCloudProvider($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/cloudProviders/updateSecret/updateSecret.html",'<md-dialog class="cloudProvider-dialog" aria-label="update client secret">\n  <form name="updateSecretForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'SETTINGS.UPDATE_CLIENT_SECRET\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n        <label translate="SETTINGS.CLIENT_SECRET">Current Client Secret</label>\n        <input type="text" name="currentSecret" ng-model="vm.cloudProvider.data3" disabled>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.NEW_CLIENT_SECRET">New Client Secret</label>\n        <input type="password" name="secret" ng-model="vm.newSecret" required>\n        <div ng-messages="updateSecretForm.secret.$error" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">New Client Secret field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveSecret()" class="send-button md-accent md-raised" ng-disabled="updateSecretForm.$invalid || updateSecretForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/create/dialog.html",'<md-dialog class="customization-dialog" aria-label="New Customization">\n  <form name="customizationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultFavicon" aria-label="Default_Favicon"><span translate="SETTINGS.DEFAULT_FAVICON">Default_Favicon</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n        <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n        <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n        <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n        <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n        <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n        <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.license.preferred" class="md-block">\n        <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomization" ng-click="vm.saveCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid || customizationForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomization" ng-click="vm.addNewCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CUSTOMIZATION" translate-attr-aria-label="SETTINGS.ADD_CUSTOMIZATION">\n          ADD CUSTOMIZATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomization" ng-click="vm.deleteCustomization($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/customizations.html",'<div id="customizations" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.CUSTOMIZATIONS">Customizations</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div>\n      <md-button type="submit" ng-click="vm.saveCustomization()" ng-disabled="(customizationsForm.$pristine && logoForm.$pristine && logologinForm.$pristine && preferredForm.$pristine && faviconForm.$pristine) || (customizationsForm.$invalid || logoForm.$invalid || logologinForm.$invalid || preferredForm.$invalid || faviconForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      <div class="customization-detail-form-container customizations md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.CUSTOMIZATIONS">CUSTOMIZATIONS</div>\n        </div>\n        <form name="customizationsForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultFavicon" aria-label="Default_Favicon"><span translate="SETTINGS.DEFAULT_FAVICON">Default_Favicon</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n            <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n            <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n            <div ng-messages="customizationsForm[\'headerWhiteLabel\'].$error" ng-show="customizationsForm[\'headerWhiteLabel\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n            <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n            <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n            <div ng-messages="customizationsForm[\'pageTitle\'].$error" ng-show="customizationsForm[\'pageTitle\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if="vm.license.preferred" class="md-block">\n            <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div ng-if="!vm.customization.defaultLogo" class="customization-detail-form-container logo md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.LOGO">LOGO</div>\n        </div>\n        <div ng-controller="CustomizationlogoController as vm_cl" ng-init="vm_cl.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n          <div id="customization-image-uploader" flow-init="vm_cl.ngFlowOptions" flow-name="vm_cl.ngFlow.flow" flow-files-submitted="vm_cl.upload()" flow-file-added="vm_cl.fileAdded($file)" flow-file-success="vm_cl.fileSuccess($file, $message)" flow-complete="vm_cl.uploadComplete()" flow-drop flow-drag-enter="vm_cl.dropping=true" flow-drag-leave="vm_cl.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n            <div class="drop-text hint-text" layout="row" layout-align="center center">\n              <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n            </div>\n\n            <div class="upload-button" layout="column" layout-align="center center">\n              <md-button class="md-accent md-raised" flow-btn>\n                Upload\n              </md-button>\n              <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n            </div>\n\n            <div layout="row" layout-align="start start" layout-wrap>\n              <div ng-repeat="logoimage in vm_cl.customization.images" ng-switch="logoimage.type">\n                <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                  <div class="overlay" layout="column" layout-align="center center">\n                    <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n                    </md-progress-linear>\n                  </div>\n                  <img class="media" flow-img="logoimage.file">\n                </div>\n\n                <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n                  <img class="media" ng-src="{{logoimage.url}}">\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n      </div>\n\n      <div ng-if="!vm.customization.defaultLoginLogo" class="customization-detail-form-container logologin md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.LOGOLOGIN">LOGOLOGIN</div>\n        </div>\n        <div ng-controller="CustomizationlogologinController as vm_cll" ng-init="vm_cll.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n          <div id="customization-image-uploader" flow-init="vm_cll.ngFlowOptions" flow-name="vm_cll.ngFlow.flow" flow-files-submitted="vm_cll.upload()" flow-file-added="vm_cll.fileAdded($file)" flow-file-success="vm_cll.fileSuccess($file, $message)" flow-complete="vm_cll.uploadComplete()" flow-drop flow-drag-enter="vm_cll.dropping=true" flow-drag-leave="vm_cll.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n            <div class="drop-text hint-text" layout="row" layout-align="center center">\n              <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n            </div>\n\n            <div class="upload-button" layout="column" layout-align="center center">\n              <md-button class="md-accent md-raised" flow-btn>\n                Upload\n              </md-button>\n              <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n            </div>\n\n            <div layout="row" layout-align="start start" layout-wrap>\n              <div ng-repeat="logologinimage in vm_cll.customization.images" ng-switch="logologinimage.type">\n                <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                  <div class="overlay" layout="column" layout-align="center center">\n                    <md-progress-linear md-mode="determinate" value="{{logologinimage.file.progress() * 100}}">\n                    </md-progress-linear>\n                  </div>\n                  <img class="media" flow-img="logologinimage.file">\n                </div>\n\n                <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n                  <img class="media" ng-src="{{logologinimage.url}}">\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n      </div>\n\n      <div ng-if="!vm.customization.defaultPreferred && vm.license.preferred" class="customization-detail-form-container preferred md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.PREFERRED">PREFERRED</div>\n        </div>\n        <div ng-controller="CustomizationpreferredController as vm_cp" ng-init="vm_cp.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n          <div id="customization-image-uploader" flow-init="vm_cp.ngFlowOptions" flow-name="vm_cp.ngFlow.flow" flow-files-submitted="vm_cp.upload()" flow-file-added="vm_cp.fileAdded($file)" flow-file-success="vm_cp.fileSuccess($file, $message)" flow-complete="vm_cp.uploadComplete()" flow-drop flow-drag-enter="vm_cp.dropping=true" flow-drag-leave="vm_cp.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n            <div class="drop-text hint-text" layout="row" layout-align="center center">\n              <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n            </div>\n\n            <div class="upload-button" layout="column" layout-align="center center">\n              <md-button class="md-accent md-raised" flow-btn>\n                Upload\n              </md-button>\n              <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n            </div>\n\n            <div layout="row" layout-align="start start" layout-wrap>\n              <div ng-repeat="preferredimage in vm_cp.customization.images" ng-switch="preferredimage.type">\n                <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                  <div class="overlay" layout="column" layout-align="center center">\n                    <md-progress-linear md-mode="determinate" value="{{preferredimage.file.progress() * 100}}">\n                    </md-progress-linear>\n                  </div>\n                  <img class="media" flow-img="preferredimage.file">\n                </div>\n\n                <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n                  <img class="media" ng-src="{{preferredimage.url}}">\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n      </div>\n\n      <div ng-if="!vm.customization.defaultFavicon" class="customization-detail-form-container favicon md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.FAVICON">FAVICON</div>\n        </div>\n        <div ng-controller="CustomizationfaviconController as vm_cf" ng-init="vm_cf.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n          <div id="customization-image-uploader" flow-init="vm_cf.ngFlowOptions" flow-name="vm_cf.ngFlow.flow" flow-files-submitted="vm_cf.upload()" flow-file-added="vm_cf.fileAdded($file)" flow-file-success="vm_cf.fileSuccess($file, $message)" flow-complete="vm_cf.uploadComplete()" flow-drop flow-drag-enter="vm_cf.dropping=true" flow-drag-leave="vm_cf.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n            <div class="drop-text hint-text" layout="row" layout-align="center center">\n              <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n            </div>\n\n            <div class="upload-button" layout="column" layout-align="center center">\n              <md-button class="md-accent md-raised" flow-btn>\n                Upload\n              </md-button>\n              <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG, ICO - Max. 8MB</span>\n            </div>\n\n            <div layout="row" layout-align="start start" layout-wrap>\n              <div ng-repeat="faviconimage in vm_cf.customization.images" ng-switch="faviconimage.type">\n                <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                  <div class="overlay" layout="column" layout-align="center center">\n                    <md-progress-linear md-mode="determinate" value="{{faviconimage.file.progress() * 100}}">\n                    </md-progress-linear>\n                  </div>\n                  <img class="media" flow-img="faviconimage.file">\n                </div>\n\n                <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n                  <img class="media" ng-src="{{faviconimage.url}}">\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n      </div>\n\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/generals/create/dialog.html",'<md-dialog class="general-dialog" aria-label="New General">\n  <form name="generalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGeneral" ng-click="vm.saveGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid || generalForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGeneral" ng-click="vm.addNewGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_GENERAL" translate-attr-aria-label="SETTINGS.ADD_GENERAL">\n          ADD GENERAL\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGeneral" ng-click="vm.deleteGeneral($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/generals/generals.html",'<div id="generals" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.GENERAL">General</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div>\n      <md-button type="submit" ng-click="vm.saveGeneral()" ng-disabled="(globalForm.$pristine && motionbarForm.$pristine && reportForm.$pristine && agentOmniDesktopInterfaceForm.$pristine && screenRecordingForm.$pristine && securityForm.$pristine && imapGeneralSettingsForm.$pristine && SSOForm.$pristine && aiToolsForm.$pristine) || (globalForm.$invalid || motionbarForm.$invalid || reportForm.$invalid || agentOmniDesktopInterfaceForm.$invalid || screenRecordingForm.$invalid || securityForm.$invalid || imapGeneralSettingsForm.$invalid || SSOForm.$invalid || aiToolsForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      <div class="general-detail-form-container global md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.GLOBAL">GLOBAL</div>\n        </div>\n        <form name="globalForm" novalidate>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n            <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" value="1000" ng-required="true" autofocus>\n\n            <div ng-messages="globalForm[\'min_internal\'].$error" ng-show="globalForm[\'min_internal\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.CHATTIMEOUT">chatTimeout</label>\n            <input type="number" name="chatTimeout" ng-model="vm.general.chatTimeout" min="0" value="30" ng-required="true">\n\n            <div ng-messages="globalForm[\'chatTimeout\'].$error" ng-show="globalForm[\'chatTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.CHATTIMEOUT_REQUIRED">chatTimeout field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">chatTimeout must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.rtlSupport" aria-label="RtlSupport"><span translate="SETTINGS.RTLSUPPORT">RtlSupport</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.RTLSUPPORT"></span></div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.stopRecordingOnTransfer" aria-label="Stop_Recording_On_Voice_Call_Transfer"><span translate="SETTINGS.STOP_RECORDING_ON_VOICE_CALL_TRANSFER">Stop_Recording_On_Voice_Call_Transfer</span></md-switch>\n          </md-input-container>\n        </form>\n      </div>\n\n      <div class="general-detail-form-container motionbar md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.MOTIONBAR">MOTIONBAR</div>\n        </div>\n        <form name="motionbarForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.phoneBarAutoUpdater" aria-label="MotionbarAutoUpdater"><span translate="SETTINGS.MOTIONBARAUTOUPDATER">MotionbarAutoUpdater</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.phoneBarAutoUpdater" class="md-block">\n            <label translate="SETTINGS.MOTIONBARAUTOUPDATERURL">MotionbarAutoUpdaterUrl</label>\n            <input type="url" name="phoneBarAutoUpdaterUrl" ng-model="vm.general.phoneBarAutoUpdaterUrl" value="https://www.xcally.com/bar/phonebar/autoupdater.xml" ng-required="vm.general.phoneBarAutoUpdater">\n\n            <div ng-messages="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$error" ng-show="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_REQUIRED">MotionbarAutoUpdaterUrl field is required</span>\n              </div>\n              <div ng-message="url">\n                <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_MUST_VALID_URL">MotionbarAutoUpdaterUrl must be a valid url http://www.xcally.com</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.phoneBarRememberMeEnabled" aria-label="MotionbarRememberMe"><span translate="SETTINGS.MOTIONBARREMEMBERME">MotionbarRememberMe</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.MOTIONBARREMEMBERME"></span></div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div class="general-detail-form-container report md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.REPORT">REPORT</div>\n        </div>\n        <form name="reportForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.split" aria-label="Split"><span translate="SETTINGS.SPLIT">Split</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.split" class="md-block">\n            <label translate="SETTINGS.SPLITSIZECSV">SplitSizeCsv</label>\n            <input type="number" name="splitSizeCsv" ng-model="vm.general.splitSizeCsv" value="5000">\n\n            <div ng-messages="reportForm[\'splitSizeCsv\'].$error" ng-show="reportForm[\'splitSizeCsv\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.SPLITSIZECSV_REQUIRED">SplitSizeCsv field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.split" class="md-block">\n            <label translate="SETTINGS.SPLITSIZEPDF">SplitSizePdf</label>\n            <input type="number" name="splitSizePdf" ng-model="vm.general.splitSizePdf" value="1000">\n\n            <div ng-messages="reportForm[\'splitSizePdf\'].$error" ng-show="reportForm[\'splitSizePdf\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.SPLITSIZEPDF_REQUIRED">SplitSizePdf field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.split" class="md-block">\n            <label translate="SETTINGS.SPLITSIZEXLSX">SplitSizeXlsx</label>\n            <input type="number" name="splitSizeXlsx" ng-model="vm.general.splitSizeXlsx" value="5000">\n\n            <div ng-messages="reportForm[\'splitSizeXlsx\'].$error" ng-show="reportForm[\'splitSizeXlsx\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.SPLITSIZEXLSX_REQUIRED">SplitSizeXlsx field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div class="general-detail-form-container agentomnidesktopinterface md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.AGENTOMNIDESKTOPINTERFACE">AGENTOMNIDESKTOPINTERFACE</div>\n        </div>\n        <form name="agentOmniDesktopInterfaceForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.enableEmailPreview" aria-label="EnableEmailPreview"><span translate="SETTINGS.ENABLEEMAILPREVIEW">EnableEmailPreview</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.searchOnEnterKey" aria-label="Search_On_Enter_Key"><span translate="SETTINGS.SEARCH_ON_ENTER_KEY">Search_On_Enter_Key</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.SEARCH_ON_ENTER_KEY"></span></div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.MESSAGESALIGNMENT">messagesAlignment</label>\n            <md-select name="messagesAlignment" ng-model="vm.general.messagesAlignment">\n              <md-option ng-value="\'alternate\'">Alternate</md-option>\n              <md-option ng-value="\'left\'">Left</md-option>\n              <md-option ng-value="\'right\'">Right</md-option>\n            </md-select>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.CHAT_INTERACTIONS_RELOAD_TIMEOUT">Chat_Interactions_Reload_Timeout</label>\n            <input type="number" name="chatInteractionsReloadTimeout" ng-model="vm.general.chatInteractionsReloadTimeout">\n\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'chatInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'chatInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.CHAT_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Chat_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.MAIL_INTERACTIONS_RELOAD_TIMEOUT">Mail_Interactions_Reload_Timeout</label>\n            <input type="number" name="mailInteractionsReloadTimeout" ng-model="vm.general.mailInteractionsReloadTimeout">\n\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'mailInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'mailInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.MAIL_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Mail_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT">Openchannel_Interactions_Reload_Timeout</label>\n            <input type="number" name="openchannelInteractionsReloadTimeout" ng-model="vm.general.openchannelInteractionsReloadTimeout">\n\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'openchannelInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'openchannelInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Openchannel_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.SMS_INTERACTIONS_RELOAD_TIMEOUT">Sms_Interactions_Reload_Timeout</label>\n            <input type="number" name="smsInteractionsReloadTimeout" ng-model="vm.general.smsInteractionsReloadTimeout">\n\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'smsInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'smsInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.SMS_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Sms_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT">Whatsapp_Interactions_Reload_Timeout</label>\n            <input type="number" name="whatsappInteractionsReloadTimeout" ng-model="vm.general.whatsappInteractionsReloadTimeout">\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'whatsappInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'whatsappInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Whatsapp_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.PREVIEW_RECALLME_REMINDER_INTERVAL">Preview_Recallme_Reminder_Interval</label>\n            <input type="number" name="previewRecallmeReminderInterval" ng-model="vm.general.previewRecallmeReminderInterval">\n            <div class="hint"><span translate="SETTINGS.HELP.PREVIEW_RECALLME_REMINDER_INTERVAL"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'previewRecallmeReminderInterval\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'previewRecallmeReminderInterval\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED">Preview_Recallme_Reminder_Interval field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.LIMIT_TABS">limitTabs</label>\n            <input type="number" name="limitTabs" ng-model="vm.general.limitTabs" min="0" value="20">\n            <div class="hint"><span translate="SETTINGS.HELP.LIMIT_TABS"></span></div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div ng-if="vm.license.screenrecording" class="general-detail-form-container screenrecording md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.SCREENRECORDING">SCREENRECORDING</div>\n        </div>\n        <form name="screenRecordingForm" novalidate>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.DEFAULTSCREENRECORDINGPATH">defaultScreenRecordingPath</label>\n            <input type="text" name="defaultScreenRecordingPath" ng-model="vm.general.defaultScreenRecordingPath" autofocus>\n\n            <div class="hint"><span translate="SETTINGS.HELP.DEFAULTSCREENRECORDINGPATH"></span></div>\n            <div ng-messages="screenRecordingForm[\'defaultScreenRecordingPath\'].$error" ng-show="screenRecordingForm[\'defaultScreenRecordingPath\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.DEFAULTSCREENRECORDINGPATH_REQUIRED">defaultScreenRecordingPath field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div class="general-detail-form-container security md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.SECURITY">SECURITY</div>\n        </div>\n        <form name="securityForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.ALLOWEDLOGINATTEMPTS">allowedLoginAttempts</label>\n            <input type="number" name="allowedLoginAttempts" ng-model="vm.general.allowedLoginAttempts" value="5" ng-required="true">\n\n            <div ng-messages="securityForm[\'allowedLoginAttempts\'].$error" ng-show="securityForm[\'allowedLoginAttempts\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.ALLOWEDLOGINATTEMPTS_REQUIRED">allowedLoginAttempts field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.BLOCKDURATION">blockDuration</label>\n            <input type="number" name="blockDuration" ng-model="vm.general.blockDuration" value="10" ng-required="true">\n\n            <div ng-messages="securityForm[\'blockDuration\'].$error" ng-show="securityForm[\'blockDuration\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.BLOCKDURATION_REQUIRED">blockDuration field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.enforcePasswordHistory" aria-label="Enforce_Password_History"><span translate="SETTINGS.ENFORCE_PASSWORD_HISTORY">Enforce_Password_History</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.ENFORCE_PASSWORD_HISTORY"></span></div>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.enforcePasswordHistory" class="md-block">\n            <label translate="SETTINGS.PASSWORD_HISTORY_LIMIT">Password_History_Limit</label>\n            <input type="number" name="passwordHistoryLimit" ng-model="vm.general.passwordHistoryLimit" min="2" max="5" value="3">\n\n            <div class="hint"><span translate="SETTINGS.HELP.PASSWORD_HISTORY_LIMIT"></span></div>\n            <div ng-messages="securityForm[\'passwordHistoryLimit\'].$error" ng-show="securityForm[\'passwordHistoryLimit\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_REQUIRED">Password_History_Limit field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Password_History_Limit must be a valid greater or equal than</span> <span>2</span>\n              </div>\n              <div ng-message="max">\n                <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Password_History_Limit must be a valid greater or equal than</span> <span>5</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block no-margin-bottom">\n            <md-switch ng-change="vm.onPrivacyPolicyChange(\'email\')" ng-model="vm.general.enablePrivacyPolicyEmail" aria-label="Privacy_Policy_Email"><span translate="SETTINGS.PRIVACY_POLICY_EMAIL">Privacy_Policy_Email</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.enablePrivacyPolicyEmail" class="md-block no-margin-top">\n\n            <input type="number" name="privacyPolicyEmail" ng-model="vm.general.privacyPolicyEmail" min="0" value="0" ng-required="true">\n\n            <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n            <div ng-messages="securityForm[\'privacyPolicyEmail\'].$error" ng-show="securityForm[\'privacyPolicyEmail\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_EMAIL_REQUIRED">Privacy_Policy_Email field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_EMAIL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Email must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block no-margin-bottom">\n            <md-switch ng-change="vm.onPrivacyPolicyChange(\'name\')" ng-model="vm.general.enablePrivacyPolicyName" aria-label="Privacy_Policy_Name"><span translate="SETTINGS.PRIVACY_POLICY_NAME">Privacy_Policy_Name</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.enablePrivacyPolicyName" class="md-block no-margin-top">\n\n            <input type="number" name="privacyPolicyName" ng-model="vm.general.privacyPolicyName" min="0" value="0" ng-required="true">\n\n            <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n            <div ng-messages="securityForm[\'privacyPolicyName\'].$error" ng-show="securityForm[\'privacyPolicyName\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NAME_REQUIRED">Privacy_Policy_Name field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NAME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Name must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block no-margin-bottom">\n            <md-switch ng-change="vm.onPrivacyPolicyChange(\'number\')" ng-model="vm.general.enablePrivacyPolicyNumber" aria-label="Privacy_Policy_Number"><span translate="SETTINGS.PRIVACY_POLICY_NUMBER">Privacy_Policy_Number</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.enablePrivacyPolicyNumber" class="md-block no-margin-top">\n\n            <input type="number" name="privacyPolicyNumber" ng-model="vm.general.privacyPolicyNumber" min="0" value="0" ng-required="true">\n\n            <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n            <div ng-messages="securityForm[\'privacyPolicyNumber\'].$error" ng-show="securityForm[\'privacyPolicyNumber\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NUMBER_REQUIRED">Privacy_Policy_Number field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Number must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.disabledCookie" aria-label="Disabled_Cookie"><span translate="SETTINGS.DISABLED_COOKIE">Disabled_Cookie</span></md-switch>\n          </md-input-container>\n        </form>\n      </div>\n\n      <div class="general-detail-form-container imapgeneralsettings md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.IMAPGENERALSETTINGS">IMAPGENERALSETTINGS</div>\n        </div>\n        <form name="imapGeneralSettingsForm" novalidate>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.LOGINMAILFREQUENCY">loginMailFrequency</label>\n            <input type="number" name="loginMailFrequency" ng-model="vm.general.loginMailFrequency" min="10" value="10" ng-required="true" autofocus>\n\n            <div class="hint"><span translate="SETTINGS.HELP.LOGINMAILFREQUENCY"></span></div>\n            <div ng-messages="imapGeneralSettingsForm[\'loginMailFrequency\'].$error" ng-show="imapGeneralSettingsForm[\'loginMailFrequency\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.LOGINMAILFREQUENCY_REQUIRED">loginMailFrequency field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">loginMailFrequency must be a valid greater or equal than</span> <span>10</span>\n              </div>\n            </div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div class="general-detail-form-container sso md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.SSO">SSO</div>\n        </div>\n        <form name="SSOForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.googleSsoEnabled" aria-label="Google_SSO_enabled"><span translate="SETTINGS.GOOGLE_SSO_ENABLED">Google_SSO_enabled</span></md-switch>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.adSsoEnabled" aria-label="AD_SSO_enabled"><span translate="SETTINGS.AD_SSO_ENABLED">AD_SSO_enabled</span></md-switch>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div ng-if="vm.license.ai" class="general-detail-form-container aitools md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.AITOOLS">AITOOLS</div>\n        </div>\n        <form name="aiToolsForm" novalidate>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.LANGUAGE">Language</label>\n            <md-select name="language" ng-model="vm.general.language" autofocus required>\n              <md-option ng-value="\'en-US\'">US English</md-option>\n              <md-option ng-value="\'en-AU\'">Australian English</md-option>\n              <md-option ng-value="\'en-GB\'">British English</md-option>\n              <md-option ng-value="\'en-AB\'">Scottish English</md-option>\n              <md-option ng-value="\'en-WL\'">Welsh English</md-option>\n              <md-option ng-value="\'en-IE\'">English (Ireland)</md-option>\n              <md-option ng-value="\'en-IN\'">Indian English</md-option>\n              <md-option ng-value="\'hi-IN\'">Hindi (India)</md-option>\n              <md-option ng-value="\'fr-CA\'">Canadian French</md-option>\n              <md-option ng-value="\'fr-FR\'">French</md-option>\n              <md-option ng-value="\'de-DE\'">German</md-option>\n              <md-option ng-value="\'de-CH\'">German (Switzerland)</md-option>\n              <md-option ng-value="\'it-IT\'">Italian</md-option>\n              <md-option ng-value="\'es-ES\'">Spanish</md-option>\n              <md-option ng-value="\'es-Us\'">US Spanish</md-option>\n              <md-option ng-value="\'pt-BR\'">Brazilian Portuguese</md-option>\n              <md-option ng-value="\'pt-PT\'">Portuguese(Portugal)</md-option>\n              <md-option ng-value="\'ar-SA\'">Modern Standard Arabic</md-option>\n              <md-option ng-value="\'ar-AE\'">Arabic</md-option>\n              <md-option ng-value="\'zh-CN\'">Chinese Mandarin - Mainland</md-option>\n              <md-option ng-value="\'ja-JP\'">Japanese (Japan)</md-option>\n              <md-option ng-value="\'ko-KR\'">Korean (Korea)</md-option>\n              <md-option ng-value="\'he-IL\'">Hebrew (Israel) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'ms-MY\'">Malay (Malaysia) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'fa-IR\'">Farsi (Iran) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'ru-RU\'">Russian (Russia) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'te-IN\'">Telugu(India) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'ta-IN\'">Tamil - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'nl-NL\'">Dutch - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'tr-TR\'">Turkish (Turkey) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'id-ID\'">Indonesian(Indonesia) - This language is not available for the Sentiment Analysis</md-option>\n            </md-select>\n            <div ng-messages="aiToolsForm[\'language\'].$error" ng-show="aiToolsForm[\'language\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.LANGUAGE_REQUIRED">Language field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.BUCKET">Bucket</label>\n            <input type="text" name="bucket" ng-model="vm.general.bucket" ng-required="true">\n\n            <div ng-messages="aiToolsForm[\'bucket\'].$error" ng-show="aiToolsForm[\'bucket\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.BUCKET_REQUIRED">Bucket field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.transcribe" aria-label="Transcribe"><span translate="SETTINGS.TRANSCRIBE">Transcribe</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.transcribe == true" class="md-block">\n            <label translate="SETTINGS.TRANSCRIBEREGION">TranscribeRegion</label>\n            <md-select name="transcribeRegion" ng-model="vm.general.transcribeRegion" required>\n              <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n              <md-option ng-value="\'us-east-2\'">US East (Ohio)</md-option>\n              <md-option ng-value="\'us-east-2\'">US West (N. California)</md-option>\n              <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n              <md-option ng-value="\'ap-south-1\'">Asia Pacific (Mumbai)</md-option>\n              <md-option ng-value="\'ap-east-1\'">Asia Pacific (Hong Kong)</md-option>\n              <md-option ng-value="\'ap-northeast-2\'">Asia Pacific (Seoul)</md-option>\n              <md-option ng-value="\'ap-southeast-1\'">Asia Pacific (Singapore)</md-option>\n              <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n              <md-option ng-value="\'ap-northeast-1\'">Asia Pacific (Tokyo)</md-option>\n              <md-option ng-value="\'ca-central-1\'">Canada (Central)</md-option>\n              <md-option ng-value="\'eu-central-1\'">Europe (Frankfurt)</md-option>\n              <md-option ng-value="\'eu-west-1\'">Europe (Ireland)</md-option>\n              <md-option ng-value="\'eu-west-2\'">Europe (London)</md-option>\n              <md-option ng-value="\'eu-west-3\'">Europe (Paris)</md-option>\n              <md-option ng-value="\'me-south-1\'">Middle East (Bahrain)</md-option>\n              <md-option ng-value="\'sa-east-1\'">South America (São Paulo)</md-option>\n            </md-select>\n            <div ng-messages="aiToolsForm[\'transcribeRegion\'].$error" ng-show="aiToolsForm[\'transcribeRegion\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.TRANSCRIBEREGION_REQUIRED">TranscribeRegion field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.transcribe == true" class="md-block">\n            <label translate="SETTINGS.TRANSCRIBEACCOUNT">TranscribeAccount</label>\n            <md-select name="transcribeAccountId" ng-model="vm.general.transcribeAccountId" required>\n              <md-option ng-value="transcribeAccountId.id" ng-repeat="transcribeAccountId in vm.cloudProviders" ng-disabled="transcribeAccountId.canSelect === false">{{ transcribeAccountId.name }}</md-option>\n            </md-select>\n            <div ng-messages="aiToolsForm[\'transcribeAccountId\'].$error" ng-show="aiToolsForm[\'transcribeAccountId\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.TRANSCRIBEACCOUNT_REQUIRED">TranscribeAccount field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n'+"          <md-input-container ng-if=\"vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n            <md-switch ng-model=\"vm.general.sentiment\" aria-label=\"SentimentAnalysis\"><span translate=\"SETTINGS.SENTIMENTANALYSIS\">SentimentAnalysis</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if=\"vm.general.sentiment == true && vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n            <label translate=\"SETTINGS.SENTIMENTREGION\">SentimentRegion</label>\n            <md-select name=\"sentimentRegion\" ng-model=\"vm.general.sentimentRegion\" required>\n              <md-option ng-value=\"'us-east-1'\">US East (N. Virginia)</md-option>\n              <md-option ng-value=\"'us-east-2'\">US East (Ohio)</md-option>\n              <md-option ng-value=\"'us-west-2'\">US West (Oregon)</md-option>\n              <md-option ng-value=\"'ap-south-1'\">Asia Pacific (Mumbai)</md-option>\n              <md-option ng-value=\"'ap-northeast-2'\">Asia Pacific (Seoul)</md-option>\n              <md-option ng-value=\"'ap-southeast-1'\">Asia Pacific (Singapore)</md-option>\n              <md-option ng-value=\"'ap-southeast-2'\">Asia Pacific (Sydney)</md-option>\n              <md-option ng-value=\"'ap-northeast-1'\">Asia Pacific (Tokyo)</md-option>\n              <md-option ng-value=\"'ca-central-1'\">Canada (Central)</md-option>\n              <md-option ng-value=\"'eu-central-1'\">Europe (Frankfurt)</md-option>\n              <md-option ng-value=\"'eu-west-1'\">Europe (Ireland)</md-option>\n              <md-option ng-value=\"'eu-west-2'\">Europe (London)</md-option>\n            </md-select>\n            <div ng-messages=\"aiToolsForm['sentimentRegion'].$error\" ng-show=\"aiToolsForm['sentimentRegion'].$touched\" role=\"alert\">\n              <div ng-message=\"required\">\n                <span translate=\"SETTINGS.ERRORS.SENTIMENTREGION_REQUIRED\">SentimentRegion field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if=\"vm.general.sentiment == true && vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n            <label translate=\"SETTINGS.SENTIMENTACCOUNT\">SentimentAccount</label>\n            <md-select name=\"sentimentAccountId\" ng-model=\"vm.general.sentimentAccountId\" required>\n              <md-option ng-value=\"sentimentAccountId.id\" ng-repeat=\"sentimentAccountId in vm.cloudProviders\" ng-disabled=\"sentimentAccountId.canSelect === false\">{{ sentimentAccountId.name }}</md-option>\n            </md-select>\n            <div ng-messages=\"aiToolsForm['sentimentAccountId'].$error\" ng-show=\"aiToolsForm['sentimentAccountId'].$touched\" role=\"alert\">\n              <div ng-message=\"required\">\n                <span translate=\"SETTINGS.ERRORS.SENTIMENTACCOUNT_REQUIRED\">SentimentAccount field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/license.html",'<div id="license" class="page-layout simple fullwidth doc-page">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.LICENSE">LICENSE</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    \x3c!-- <div>\n                <md-button type="submit" ng-click="vm.requestLicense()" class="send-button md-raised" translate="SETTINGS.REQUEST_LICENSE" translate-attr-aria-label="SETTINGS.REQUEST_LICENSE">\n                    REQUEST LICENSE\n                </md-button>\n            </div> --\x3e\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n      \x3c!-- LICENSE CARD --\x3e\n      <div layout="row" flex>\n        <md-card class="md-whiteframe-1dp padding-20" flex>\n          <div layout="row" layout-align="center">\n            <div flex layout="row" layout-align="start center">\n              <div ng-if="!vm.license.custom">\n                <a href="https://www.xcally.com/plans.html" target="_blank" class="md-button md-fab green-A700-bg" aria-label="Eat cake">\n                  <md-tooltip><span translate="SETTINGS.PRICES">Prices</span></md-tooltip>\n                  <md-icon md-font-icon="icon-coin"></md-icon>\n                </a>\n              </div>\n            </div>\n            <div flex>\n              <div ng-switch="vm.license.months" class="text-center">\n                <span ng-switch-when="1" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></span>\n                <span ng-switch-when="12" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.ANNUALLY">ANNUALLY</span></span>\n                <span ng-switch-when="36" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.PERPETUAL">PERPETUAL</span></span>\n              </div>\n            </div>\n            <div flex layout="row" layout-align="end center">\n              <div>\n                <md-button type="submit" ng-click="vm.updateLicense()" class="md-button md-fab md-accent">\n                  <md-tooltip><span translate="SETTINGS.UPDATE_LICENSE">License</span></md-tooltip>\n                  <md-icon md-font-icon="icon-pencil"></md-icon>\n                </md-button>\n                <md-button type="submit" ng-if="vm.isAdmin" ng-click="vm.downloadLogFile()" class="md-button md-fab md-accent">\n                  <md-tooltip><span translate="SETTINGS.DOWNLOAD_LICENSE_LOG_FILE">Download license log file</span></md-tooltip>\n                  <md-icon md-font-icon="icon-download"></md-icon>\n                </md-button>\n              </div>\n            </div>\n          </div>\n\n          <span ng-if="!vm.license.demo && !vm.license.gray && vm.license.months != 36" class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_DATE\' | translate }}: {{vm.license.expiration | date: \'longDate\'}}</span>\n          <span class="text-center padding-bottom-10"> {{ vm.license.machineUuid !== vm.license.uuid ? \'SETTINGS.OLD_TOKEN\' : \'SETTINGS.TOKEN\' | translate }}: <span ngclipboard data-clipboard-target="#licenseUuid" ngclipboard-success="vm.alert({title: \'clipboard\',  msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});" id="licenseUuid" class="hover-token text-italic text-bold">{{vm.license.uuid}}</span>\n            \x3c!--<md-button class="md-button md-fab md-accent" ngclipboard data-clipboard-target="#licenseUuid" ngclipboard-success="vm.alert({title: \'clipboard\',  msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n            <md-tooltip><span translate="SETTINGS.COPY_LICENSE">Copy</span></md-tooltip>\n            <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n          </md-button>--\x3e\n          </span>\n\n          <div layout="column">\n            <span ng-if="vm.license.grayReason == \'changed\'" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.NEW_TOKEN_DETECTED\' | translate }}</span>\n            <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.NEW_TOKEN\' | translate }}: <span id="licenseMachineUuid" ngclipboard data-clipboard-target="#licenseMachineUuid" ngclipboard-success="vm.alert({title: \'clipboard\',  msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});" class="hover-token text-italic text-bold">{{vm.license.machineUuid}}</span>\n              \x3c!--<md-button class="md-button md-fab md-accent" ngclipboard data-clipboard-target="#licenseMachineUuid" ngclipboard-success="vm.alert({title: \'clipboard\',  msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                <md-tooltip><span translate="SETTINGS.COPY_LICENSE">Copy</span></md-tooltip>                \n                <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n              </md-button>--\x3e\n            </span>\n            <span ng-if="vm.license.gray" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_GRAY_PERIOD\' | translate }}: {{vm.license.deadline | date: \'longDate\'}}</span>\n            <span ng-if="vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold"> {{\'SETTINGS.EXPIRATION_REASON\' | translate }} </span>\n            <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_DISABLED\' | translate }}</span>\n            <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_CHANGED\' | translate }}</span>\n            <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_CHANGED_ADVISE\' | translate }}</span>\n            <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=New%20token%20detected&body=Hi xCALLY, New Token: {{vm.license.machineUuid}}, Old token: {{vm.license.uuid}}">license@xcally.com</a>.</span>\n            <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=License%20disabled&body=Hi xCALLY, My Token: {{vm.license.machineUuid}}">license@xcally.com</a>.</span>\n          </div>\n\n          <div ng-if="vm.license.demo" layout="column">\n            <span class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.TRIAL_VERSION\' | translate }}</span>\n            <span class="md-subhead md-warn-fg text-center"><a href="https://www.xcally.com/en/index.html#pricing-table2-h" target="_blank">{{ \'SETTINGS.PRICES\' | translate}}</a></span>\n          </div>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" flex="33">\n              <md-icon md-font-icon="icon-account" class="md-avatar-icon"></md-icon>\n              <div class="md-list-item-text">\n                <h3>{{ vm.license.users || 0 }} <span ng-class="{\'red-fg\': vm.license.users <= vm.users && vm.license.users > 0}">({{vm.license.users >= vm.users ? vm.users : vm.license.users}})</span></h3>\n                <p translate="SETTINGS.USERS">Users</p>\n              </div>\n            </md-list-item>\n            <md-list-item class="md-2-line" flex="33">\n              <md-icon md-font-icon="icon-headphones" class="md-avatar-icon"></md-icon>\n              <div class="md-list-item-text">\n                <h3>{{ vm.license.agents || 0 }} <span ng-class="{\'red-fg\': (vm.license.agents <= vm.agents && vm.license.agents > 0) }">({{vm.license.agents >= vm.agents ? vm.agents : vm.license.agents}})</span></h3>\n                <p translate="SETTINGS.AGENTS">Agents</p>\n              </div>\n            </md-list-item>\n            <md-list-item class="md-2-line" flex="33">\n              <md-icon md-font-icon="icon-phone" class="md-avatar-icon"></md-icon>\n              <div class="md-list-item-text">\n                <h3>{{ vm.license.telephones || 0 }} <span ng-class="{\'red-fg\': vm.license.telephones <= vm.telephones && vm.license.telephones > 0}">({{vm.license.telephones >= vm.telephones ? vm.telephones : vm.license.telephones}})</span></h3>\n                <p translate="SETTINGS.TELEPHONES">Telephones</p>\n              </div>\n            </md-list-item>\n          </md-list>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3">\n              <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n                <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n          <md-list layout="row">\n            <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:3">\n              <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n                <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n          <md-list layout="row">\n            <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:6">\n              <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n                <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="module in vm.modules" flex="33">\n              <md-icon md-font-icon="{{module.icon}}" class="md-avatar-icon" ng-class="vm.license[module.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{module.name | uppercase}}"></h3>\n                <p ng-class="vm.license[module.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[module.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <div ng-repeat="session in vm.sessions" flex="33">\n              <md-list-item class="md-2-line">\n                <md-icon md-font-icon="{{session.icon}}" class="md-avatar-icon" ng-class="vm.license[session.enabled] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n                <div class="md-list-item-text">\n                  <div layout="row" layout="start center">\n                    <h3 translate="SETTINGS.{{session.name | uppercase}}"></h3>\n                    <button ng-if="session.restart" ng-click="vm.gotoProcess($event)" class="md-mini" aria-label="restart">\n                      <md-tooltip>Restart</md-tooltip>\n                      <md-icon md-font-icon="icon-reload"></md-icon>\n                    </button>\n                  </div>\n                  <p ng-if="vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">{{vm.license[session.name]}} {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n                  <p ng-if="!vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">UNLIMITED {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n                  <p ng-if="!vm.license[session.enabled]" class="red-A700-fg">{{ \'SETTINGS.DISABLED\' | translate }}</p>\n                </div>\n              </md-list-item>\n\n            </div>\n          </md-list>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="addon in vm.addons | limitTo:3" flex="33">\n              <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n                <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="addon in vm.addons | limitTo:3:3" flex="33">\n              <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n                <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="other in vm.others | limitTo:3" flex="33">\n              <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n                <p ng-class="vm.license[other.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[other.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="other in vm.others | limitTo:3:3" flex="33">\n              <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n'+"                <p ng-class=\"vm.license[other.name] ? 'green-A700-fg' : 'red-A700-fg'\">{{ 'SETTINGS.' + (vm.license[other.name] ? 'ENABLED' : 'DISABLED') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n        </md-card>\n      </div>\n      \x3c!-- / LICENSE CARD --\x3e\n\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/request/dialog.html",'<md-dialog class="request-dialog" aria-label="Send Request">\n  <form name="requestForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="SETTINGS.REQUEST_LICENSE">Request License</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.license.name" required>\n        <div ng-messages="requestForm.name.$error" ng-show="requestForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Address field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.license.email" required>\n        <div ng-messages="requestForm.email.$error" ng-show="requestForm.email.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="SETTINGS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.PLAN">Plan</label>\n        <md-select name="plan" ng-model="vm.license.months" required>\n          <md-option ng-value="1"><span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></md-option>\n          <md-option ng-value="12"><span translate="SETTINGS.ANNUALLY">ANNUALLY</span></md-option>\n          <md-option ng-value="36"><span translate="SETTINGS.PERPETUAL">PERPETUAL</span></md-option>\n        </md-select>\n        <div ng-messages="requestForm.plan.$error" ng-show="requestForm.plan.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.PLAN_REQUIRED">Plan field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-input-container class="md-block" flex>\n          <label translate="SETTINGS.USERS">Users</label>\n          <input type="number" name="users" ng-model="vm.license.users" required>\n          <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block" flex>\n          <label translate="SETTINGS.AGENTS">Agents</label>\n          <input type="number" name="agents" ng-model="vm.license.agents" required>\n          <div ng-messages="requestForm.agents.$error" ng-show="requestForm.agents.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.AGENTS_REQUIRED">Agents field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block" flex>\n          <label translate="SETTINGS.TELEPHONES">Telephones</label>\n          <input type="number" name="telephones" ng-model="vm.license.telephones" required>\n          <div ng-messages="requestForm.telephones.$error" ng-show="requestForm.telephones.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.TELEPHONES_REQUIRED">Telephones field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n        <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-switch ng-model="vm.license[module.name]" aria-label="{{module.name}}" ng-repeat="module in vm.modules"><span translate="SETTINGS.{{module.name | uppercase}}"></span></md-switch>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n      <div layout="row">\n        <md-input-container ng-repeat="session in vm.sessions" class="md-block" flex="50">\n          <label>{{ \'SETTINGS.\' + session.name | uppercase | translate }} ({{ \'SETTINGS.\' + session.label | uppercase | translate }})</label>\n          <input type="number" name="{{session.name}}" ng-model="vm.license[session.name]" required>\n          <div class="hint"><span>0={{ \'SETTINGS.UNLIMITED_CHANNELS\' | translate }}</span></div>\n          <div ng-messages="requestForm[session.name].$error" ng-show="requestForm[session.name].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.CHANNEL_REQUIRED">Mandatory field</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-switch ng-model="vm.license[addon.name]" aria-label="{{module.name}}" ng-repeat="addon in vm.addons"><span translate="SETTINGS.{{addon.name | uppercase}}"></span></md-switch>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-switch ng-model="vm.license[other.name]" aria-label="{{other.name}}" ng-repeat="other in vm.others"><span translate="SETTINGS.{{other.name | uppercase}}"></span></md-switch>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.DESCRIPTION">Description</label>\n        <textarea name="description" ng-model="vm.license.description"></textarea>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.sendRequest()" class="send-button md-accent md-raised" ng-disabled="requestForm.$invalid || requestForm.$pristine" aria-label="SEND" translate="SETTINGS.SEND" translate-attr-aria-label="SETTINGS.SEND">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/license/update/dialog.html",'<md-dialog class="update-dialog" aria-label="Update License">\n  <form name="updateForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="SETTINGS.UPDATE_LICENSE">Update License</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-content layout="row">\n        <span class="md-title" translate="SETTINGS.UPDATE_LICENSE_MANUALLY">Do you want to update your license manually?</span>\n      </md-content>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.ENTER_LICENSE">Enter your license</label>\n        <textarea name="key" ng-model="vm.licenseKey" required></textarea>\n        <div ng-messages="updateForm.name.$error" ng-show="updateForm.key.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.LICENSE_REQUIRED">License key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.updateLicense()" class="send-button md-accent md-raised" ng-disabled="updateForm.$invalid || updateForm.$pristine" aria-label="UPDATE" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">\n          UPDATE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/create/dialog.html",'<md-dialog class="network-dialog" aria-label="New Network">\n  <form name="networkForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.network.type" autofocus required>\n          <md-option ng-value="\'localnet\'">LocalNET</md-option>\n          <md-option ng-value="\'externip\'">ExternIP</md-option>\n          <md-option ng-value="\'turn\'">Turn</md-option>\n          <md-option ng-value="\'stun\'">Stun</md-option>\n        </md-select>\n        <div ng-messages="networkForm[\'type\'].$error" ng-show="networkForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'localnet\'" class="md-block">\n        <label translate="SETTINGS.LOCALNETADDRESS">localNetAddress</label>\n        <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n        <div class="hint"><span translate="SETTINGS.HELP.LOCALNETADDRESS"></span></div>\n        <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_REQUIRED">localNetAddress field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">localNetAddress must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'externip\'" class="md-block">\n        <label translate="SETTINGS.ADDRESS">Address</label>\n        <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n        <div class="hint"><span translate="SETTINGS.HELP.ADDRESS"></span></div>\n        <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="SETTINGS.ERRORS.ADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">Address must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'turn\' || vm.network.type == \'stun\'" class="md-block">\n        <label translate="SETTINGS.ADDRESS">Address</label>\n        <input type="text" name="value" ng-model="vm.network.value" ng-required="true">\n\n        <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'turn\'" class="md-block">\n        <label translate="SETTINGS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.network.username" ng-required="vm.network.type == \'turn\'">\n\n        <div class="hint"><span translate="SETTINGS.HELP.USERNAME"></span></div>\n        <div ng-messages="networkForm[\'username\'].$error" ng-show="networkForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'turn\'" class="md-block">\n        <label translate="SETTINGS.PASSWORD">Password</label>\n        <input type="text" name="password" ng-model="vm.network.password" ng-required="vm.network.type == \'turn\'">\n\n        <div class="hint"><span translate="SETTINGS.HELP.PASSWORD"></span></div>\n        <div ng-messages="networkForm[\'password\'].$error" ng-show="networkForm[\'password\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newNetwork" ng-click="vm.saveNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid || networkForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newNetwork" ng-click="vm.addNewNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_NETWORK" translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n          ADD NETWORK\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-click="vm.deleteNetwork($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/networks.html",'<div id="networks" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.NETWORKS">Networks</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedNetworks.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedNetworks =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="SETTINGS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-networks-count">\n          <span>{{vm.selectedNetworks.length}}</span>\n          <span translate="SETTINGS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SETTINGS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllNetworks()" translate="SETTINGS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectNetworks()" translate="SETTINGS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedNetworks" csv-label="true" filename="networks.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-click="vm.deleteSelectedNetworks($event)" aria-label="delete selected" translate translate-attr-label="SETTINGS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- NETWORK TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedNetworks" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getNetworks">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'SETTINGS.TYPE\' | translate }}</th>\n                <th md-column md-order-by="value">{{ \'SETTINGS.ADDRESS\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'SETTINGS.CREATED_AT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.networks.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="network" md-select-id="id" ng-repeat="network in vm.networks.rows">\n                <td md-cell ng-if="network.userpic"><img class="avatar" alt="{{network.name}}" ng-src="api/users/{{network.id}}/avatar" /></td>\n                <td md-cell ng-if="!network.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{network.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="id ">{{network.id}}</td>\n                <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="type ">{{ vm.arraytype[network.type].option }}</td>\n                <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="value ">{{network.value}}</td>\n                <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="createdAt ">{{network.createdAt | date:\'medium\' }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.editdialog(network, $event    )" translate="SETTINGS.EDIT_NETWORK">\n                          Edit Network\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.deleteconfirm(network, $event    )" translate="SETTINGS.DELETE_NETWORK">\n                          Delete Network\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.networks.count}}" md-on-paginate="vm.getNetworks" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / NETWORK TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD NETWORK BUTTON --\x3e\n  <md-button class="md-fab md-accent" id="add-network-button" ng-click="vm.createOrEditNetwork($event)" aria-label="add network" translate translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD NETWORK BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/smtps/smtps.html",'<div id="smtps" class="page-layout simple left-sidenav inner-sidenav">\n\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.SMTP">Smtp</span>\n      </div>\n    </div>\n\n    <div>\n      <md-button type="submit" ng-click="vm.verifySmtp()" ng-disabled="!vm.mailAccount.id" class="send-button md-accent md-raised" translate="SETTINGS.VERIFY" translate-attr-aria-label="SETTINGS.VERIFY">\n        VERIFY\n      </md-button>\n      <md-button type="submit" ng-click="vm.saveSmtp()" ng-disabled="(generalForm.$pristine) || (generalForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    <div class="main scrollable">\n      <div class="smtp-detail-form-container general md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.GENERAL">GENERAL</div>\n        </div>\n        <form name="generalForm" novalidate>\n\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.ACCOUNTNAME">Name</label>\n            <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n            <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Name field required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.DESCRIPTION">Description</label>\n            <input type="" name="description" ng-model="vm.mailAccount.description">\n          </md-input-container>\n\n          <md-input-container class="md-block mt-0">\n            <label translate="SETTINGS.EMAILADDRESS">Email Address</label>\n            <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n            <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n            <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Email Address field required</span>\n              </div>\n              <div ng-message="email">\n                <span translate="SETTINGS.ERRORS.WRONG_FORMAT">Email Address must be a valid e-mail address</span>\n              </div>\n            </div>\n          </md-input-container>\n\n          <md-input-container class="md-block mt-30">\n            <label translate="SETTINGS.SMTP_SERVICE">Service</label>\n            <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" required>\n              <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n            </md-select>\n            <div ng-messages="generalForm[\'provider\'].$error" ng-show="generalForm[\'provider\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Service field required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n          <div ng-if="vm.mailAccount.provider === \'custom\'">\n            <md-input-container class="md-block mt-30">\n              <label translate="SETTINGS.SMTP_HOST">Host</label>\n              <input type="text" name="host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n              <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Host field required</span>\n                </div>\n              </div>\n            </md-input-container>\n            <md-input-container class="md-block">\n              <label translate="SETTINGS.SMTP_PORT">Port</label>\n              <input type="number" name="port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true">\n              <div ng-messages="generalForm[\'port\'].$error" ng-show="generalForm[\'port\'].$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Port field required</span>\n                </div>\n              </div>\n            </md-input-container>\n            <md-input-container class="md-block">\n              <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="SMTP Secure"><span translate="SETTINGS.SMTP_SECURE">Secure</span></md-switch>\n              <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n            </md-input-container>\n            <md-input-container class="md-block">\n              <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="SMTP Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">Authentication</span></md-switch>\n            </md-input-container>\n          </div>\n\n          <div ng-if="vm.mailAccount.Smtp.authentication || (vm.mailAccount.provider && vm.mailAccount.provider !== \'custom\')">\n            <md-input-container ng-if="vm.mailAccount.provider === \'outlook365\'" class="md-block">\n              <md-switch ng-model="vm.mailAccount.Smtp.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="SETTINGS.SMTP_USERNAME">Username</label>\n              <input type="text" name="username" ng-model="vm.mailAccount.Smtp.user" ng-required="true">\n              <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n              <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Username field required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container ng-if="vm.mailAccount.Smtp.modernAuthentication" class="md-block">\n              <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n              <md-select name="cloudProvider" ng-model="vm.mailAccount.Smtp.CloudProviderId" required>\n                <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n              </md-select>\n              <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n              <div ng-messages="generalForm[\'cloudProvider\'].$error" ng-show="generalForm[\'cloudProvider\'].$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container ng-if="!vm.mailAccount.Smtp.modernAuthentication" class="md-block">\n              <label translate="SETTINGS.SMTP_PASSWORD">Password</label>\n              <input type="password" name="password" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n              <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n              <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                <div ng-message="required">\n                  <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Password field required</span>\n                </div>\n              </div>\n            </md-input-container>\n          </div>\n        </form>\n      </div>\n    </div>\n\n  </div>\n</div>'),e.put("app/main/apps/settings/views/system/system.html",'<div id="system" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.SYSTEM">SYSTEM</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" md-border-bottom flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SETTINGS.GENERAL">GENERAL</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="system-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n            <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n              <ms-widget flex="50" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg">\n                    <div class="h3">OS</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="h4">{{vm.system.system.manufacturer}} {{vm.system.system.model}}</div>\n                        <div class="h4">{{vm.system.cpu.manufacturer}} {{vm.system.cpu.brand}} - {{vm.system.cpu.speed}} GHz - {{vm.system.cpu.cores}} Cores</div>\n                        <div class="h4">{{vm.system.os.distro}} - {{vm.system.os.release}} - Kernel: {{vm.system.os.kernel}}</div>\n                        <div class="h4">Node.js: {{vm.system.node}}</div>\n                        <div class="h4">Host: {{vm.system.os.hostname}} - Uptime: {{vm.system.time.uptime / 60 | number:0}} m</div>\n                        <div class="h4">TimeZone: {{vm.system.time.timezone}} ({{vm.system.time.timezoneName}})</div>\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n              <ms-widget flex="25" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-1">\n                    <div class="h3">CPU</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="pb-8" layout="row" layout-align="space-between start">\n                          <span class="h3" translate="SETTINGS.AVG_LOAD">AVG Load</span>\n                          <span class="h3 secondary-text font-weight-500">{{vm.system.currentLoad.avgload * 100 | number:0}}%</span>\n                        </div>\n                        <md-progress-linear class="red" md-mode="determinate" value="{{vm.system.currentLoad.avgload * 100 | number:0}}"></md-progress-linear>\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n              <ms-widget flex="25" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n                    <div class="h3">MEM</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{vm.system.mem.total / 1024 / 1024 / 1024 | number:0}} GB</div>\n                        <div class="h4">{{\'SETTINGS.FREE\' | translate}}: {{vm.system.mem.available / 1024 / 1024 / 1024 | number:0}} GB</div>\n                        <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{vm.system.mem.active / 1024 / 1024 / 1024 | number:0}} GB</div>\n                      </div>\n                      <div class="p-16 pb-32">\n                        <div class="pb-8" layout="row" layout-align="space-between start">\n                          <span class="h3" translate="SETTINGS.USED">Used</span>\n                          <span class="h3 secondary-text font-weight-500">{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0}}%</span>\n                        </div>\n                        <md-progress-linear class="md-warn" md-mode="determinate" value="{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0 }}"></md-progress-linear>\n\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n            </md-card>\n\n            <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n              <ms-widget ng-repeat="disk in vm.system.fsSize" flex="25" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n                    <div class="h3">DISK {{$index + 1}}</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="h4">{{\'SETTINGS.FILE_SYSTEM\' | translate}}: {{disk.fs}}</div>\n                        <div class="h4">{{\'SETTINGS.MOUNT_POINT\' | translate}}: "{{disk.mount}}"</div>\n                        <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{disk.size / 1024 / 1024 / 1024 | number:0}} GB</div>\n                        <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{disk.used / 1024 / 1024 / 1024 | number:0}} GB</div>\n                      </div>\n                      <div class="p-16 pb-32">\n                        <div class="pb-8" layout="row" layout-align="space-between start">\n                          <span class="h3" translate="SETTINGS.USED">Used</span>\n                          <span class="h4 secondary-text font-weight-500">{{disk.use | number:0}}%</span>\n                        </div>\n                        <md-progress-linear class="red" md-mode="determinate" value="{{disk.use | number:0}}"></md-progress-linear>\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n            </md-card>\n\n            <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n              <ms-widget ng-repeat="net in vm.system.net" flex="25" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n                    <div class="h3">NET {{$index + 1}}</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="h4">{{\'SETTINGS.INTERFACE\' | translate}}: {{net.iface}}</div>\n                        <div class="h4">IPv4: {{net.ip4}}</div>\n                        <div class="h4">IPv6: {{net.ip6}}</div>\n                        <div class="h4">MAC: {{net.mac}}</div>\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n            </md-card>\n\n            <md-card class="md-whiteframe-1dp padding-20" layout="row">\n              <div flex>\n                <md-toolbar class="md-table-toolbar md-default">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="SETTINGS.TOP_N_PROCESSES" translate-values="{value: vm.processLimit}"></span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm.searchTerm1 = query" on-collapse="vm.searchTerm1 = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table>\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column>pid</th>\n                        <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n                        <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n                        <th md-column>pmem</th>\n                        <th md-column>pcpu</th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-repeat="process in vm.system.processes.list | limitTo: vm.processLimit | filter: vm.searchTerm1 | orderBy:\'-pcpu\'">\n                        <td md-cell>{{process.pid}}</td>\n                        <td md-cell>{{process.command}}</td>\n                        <td md-cell>\n                          <span class="text-boxed white-fg" ng-class="{\n                          \'green-600-bg\': process.state == \'running\',\n                          \'yellow-600-bg\': process.state == \'sleeping\',\n                          \'red-600-bg\': process.state == \'blocked\'}">{{process.state | uppercase}}</span>\n                        </td>\n                        <td md-cell>{{process.pmem}}%</td>\n                        <td md-cell>{{process.pcpu}}%</td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n              </div>\n            </md-card>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SETTINGS.PROCESSES">PROCESSES</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="system-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <md-card class="md-whiteframe-1dp padding-20" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="SETTINGS.MOTION_PROCESS_MANAGEMENT"></span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.searchTerm2 = query" on-collapse="vm.searchTerm2 = undefined" debounce="300"></ms-search-bar>\n                  <md-button ng-click="vm.getProcesses()" class="md-icon-button" aria-label="Reload">\n                    <md-icon md-font-icon="icon-reload" class="s24"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container>\n                <table md-table>\n                  <thead md-head>\n                    <tr md-row>\n                      <th md-column>id</th>\n                      <th md-column>pid</th>\n                      <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n                      <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n                      <th md-column>MEM</th>\n                      <th md-column>CPU</th>\n                      <th md-column width="20px">Actions</th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-repeat="process in vm.processes | filter: vm.searchTerm2 | orderBy:\'-monit.cpu\'">\n                      <td md-cell>{{process.pm_id}}</td>\n                      <td md-cell>{{process.pid}}</td>\n                      <td md-cell>{{process.name == \'agi\' ? \'agi (Cally Square IVR)\' : process.name}}</td>\n                      <td md-cell>\n                        <span class="text-boxed white-fg" ng-class="{\'green-600-bg\': process.pm2_env.status == \'online\', \'red-600-bg\': process.pm2_env.status == \'stopped\'}">{{process.pm2_env.status | uppercase}}</span>\n                      </td>\n                      <td md-cell>{{process.monit.memory / 1024 / 1024 | number:0}} MB</td>\n                      <td md-cell>{{process.monit.cpu}}%</td>\n                      <td md-cell>\n                        <md-button ng-if="process.pm2_env.status !== \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'online\')" class="md-icon-button" aria-label="Play">\n                          <md-icon md-font-icon="icon-play" class="s24"></md-icon>\n                        </md-button>\n                        <md-button ng-if="process.pm2_env.status === \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'stopped\')" class="md-icon-button" aria-label="Stop">\n                          <md-icon md-font-icon="icon-stop" class="s24"></md-icon>\n                        </md-button>\n                      </td>\n                    </tr>\n                  </tbody>\n                  <tfoot md-foot>\n                    <tr md-row>\n                      <td md-cell></td>\n                      <td md-cell></td>\n                      <td md-cell></td>\n                      <td md-cell></td>\n                      <td md-cell>{{ (vm.processes | map: \'monit.memory\' | sum) / 1024 / 1024 | number:0 }} MB</td>\n                      <td md-cell></td>\n                      <td md-cell></td>\n                    </tr>\n                  </tfoot>\n                </table>\n              </md-table-container>\n            </md-card>\n            <md-card class="md-whiteframe-1dp padding-20" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="SETTINGS.USEFUL_COMMANDS"></span>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-table-container>\n                <table md-table>\n                  <thead md-head>\n                    <tr md-row>\n                      <th md-column width="30%">{{\'SETTINGS.COMMAND\' | translate}}</th>\n                      <th md-column>{{\'SETTINGS.DESCRIPTION\' | translate}}</th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr>\n                      <td md-cell class="no-border">pm2 list</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_LIST\' | translate}}</td>\n                    </tr>\n                    <tr>\n                      <td md-cell class="no-border">pm2 start &lt;id | name&gt;</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_START\' | translate}}</td>\n                    </tr>\n                    <tr>\n                      <td md-cell class="no-border">pm2 stop &lt;id | name | all&gt;</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_STOP\' | translate}}</td>\n                    </tr>\n                    <tr>\n                      <td md-cell class="no-border">pm2 restart &lt;id | name&gt;</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_RESTART\' | translate}}</td>\n                    </tr>\n                    <tr>\n                      <td md-cell class="no-border">pm2 logs [id | name]</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_LOGS\' | translate}}</td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n            </md-card>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/settings/views/updates/update/dialog.html",'<md-dialog aria-label="Update">\n  <form name="updateForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n      </div>\n    </md-toolbar>\n\n    <div md-background-bg layout="row" layout-align="start start">\n      <md-progress-linear md-mode="determinate" value="{{vm.progress}}" class="md-warn"></md-progress-linear>\n    </div>\n\n    <md-dialog-content>\n      <div layout="row" layout-align="center center">\n        <div ng-if="vm.updating" layout="column" layout-align="center center">\n          <span class="text-center md-title">Grab a quick coffee and</span>\n          <span class="text-center md-title">get back here as soon as completed!</span>\n          <span class="text-center md-title">{{vm.output}}</span>\n        </div>\n        <div ng-if="!vm.updating">\n          <div ng-if="vm.success" layout="column" layout-align="center center">\n            <span class="text-center md-title">Update Completed! Thank you for your time.</span>\n            <span class="text-center md-title">In order to complete the update,</span>\n            <span class="text-center md-title">please click on reload button</span>\n          </div>\n          <div ng-if="!vm.success" layout="column" layout-align="center center">\n            <span class="text-center md-title">Update Error!</span>\n            <span class="text-center md-title">Please contact your administrator!</span>\n            <span class="text-center md-title">{{vm.output}}</span>\n          </div>\n        </div>\n        <img src="assets/images/business/users.jpg" alt="" width="128" height="128" />\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions ng-if="!vm.updating" layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.reload()" class="send-button md-warm md-raised" aria-label="RELOAD" translate="SETTINGS.RELOAD" translate-attr-aria-label="SETTINGS.RELOAD">\n          RELOAD\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/updates/updates.html",'<div id="updates" class="page-layout simple fullwidth doc-page">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.UPDATES">UPDATES</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      \x3c!-- UPDATE CARD --\x3e\n      <div layout="row" ng-if="!vm.updating">\n        <md-card class="md-whiteframe-1dp padding-20" flex>\n          <div layout="column" layout-align="center center">\n\n            <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.CURRENT_VERSION">CURRENT VERSION</span>\n\n            <span class="md-display-3 padding-20">{{vm.version.current}}</span>\n\n            <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.current}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n              CHANGELOG\n            </md-button>\n          </div>\n        </md-card>\n        <md-card class="md-whiteframe-20dp padding-20" flex ng-if="vm.version.current != vm.version.latest">\n          <div layout="column" layout-align="center center">\n\n            <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.NEW_VERSION">NEW VERSION</span>\n\n            <span class="md-display-3 padding-20">{{vm.version.latest}}</span>\n\n            <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.latest}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n              CHANGELOG\n            </md-button>\n            <md-button ng-click="vm.updateConfirm($event)" class="md-raised md-warn" aria-label="CHANGELOG" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">UPDATE</md-button>\n          </div>\n        </md-card>\n        <md-card class="md-whiteframe-1dp padding-20" flex ng-if="vm.version.current == vm.version.latest">\n          <div layout="column" layout-align="center center">\n\n            <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.REMOTE_VERSION">REMOTE VERSION</span>\n\n            <span class="md-subhead padding-20" translate="SETTINGS.NO_NEW_VERSION_AVAILABLE">NO NEW VERSION AVAILABLE</span>\n          </div>\n        </md-card>\n      </div>\n      \x3c!-- / UPDATE CARD --\x3e\n\n      <div ng-if="vm.updating">\n        <md-card class="md-whiteframe-1dp padding-20" flex>\n          <div layout="column" layout-align="center center">\n            <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.UPDATING">...</span>\n            <md-progress-linear md-mode="determinate" class="md-accent padding-20" value="{{vm.progress}}"></md-progress-linear>\n            <span class="md-display-1 padding-5 text-center">Grab a quick coffee and</span>\n            <span class="md-display-1 padding-5 text-center">get back here as soon as completed</span>\n            <img src="assets/images/business/users.jpg" alt="" width="40%" height="40%" />\n          </div>\n        </md-card>\n      </div>\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="SMS.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n        <th md-column>{{ \'SMS.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'SMS.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'SMS.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="SMS.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="SMS.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/sms/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/create/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="!vm.newSmsAccount">\n\n        <div ng-messages="smsAccountForm[\'name\'].$error" ng-show="smsAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'key\'].$error" ng-show="smsAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n        <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n        <div ng-messages="smsAccountForm[\'remote\'].$error" ng-show="smsAccountForm[\'remote\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n        <div ng-messages="smsAccountForm[\'ListId\'].$error" ng-show="smsAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.smsAccount.type" required>\n          <md-option ng-value="\'twilio\'">Twilio</md-option>\n          <md-option ng-value="\'skebby\'">Skebby</md-option>\n          <md-option ng-value="\'connectel\'">Connectel</md-option>\n          <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n          <md-option ng-value="\'plivo\'">Plivo</md-option>\n          <md-option ng-value="\'infobip\'">Infobip</md-option>\n          <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n          <md-option ng-value="\'bandwidth\'">Bandwidth</md-option>\n          <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n          <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n        </md-select>\n        <div ng-messages="smsAccountForm[\'type\'].$error" ng-show="smsAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.PHONE">Phone</label>\n        <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'phone\'].$error" ng-show="smsAccountForm[\'phone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n        <label translate="SMS.ACCOUNTSID">AccountSID</label>\n        <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'accountSid\'].$error" ng-show="smsAccountForm[\'accountSid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n        <label translate="SMS.AUTHID">AuthID</label>\n        <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'authId\'].$error" ng-show="smsAccountForm[\'authId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n        <label translate="SMS.AUTHTOKEN">AuthToken</label>\n        <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'authToken\'].$error" ng-show="smsAccountForm[\'authToken\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n        <label translate="SMS.METHOD">Method</label>\n        <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n          <md-option ng-value="\'SI\'">Basic</md-option>\n          <md-option ng-value="\'TI\'">Classic</md-option>\n          <md-option ng-value="\'GP\'">Classic+</md-option>\n        </md-select>\n        <div ng-messages="smsAccountForm[\'smsMethod\'].$error" ng-show="smsAccountForm[\'smsMethod\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n        <label translate="SMS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'username\'].$error" ng-show="smsAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'">\n        <label translate="SMS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n        <div ng-messages="smsAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'csc\'" class="md-block">\n        <label translate="SMS.BASEURL">BaseURL</label>\n        <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'baseUrl\'].$error" ng-show="smsAccountForm[\'baseUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n        <label translate="SMS.APIKEY">ApiKey</label>\n        <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'apiKey\'].$error" ng-show="smsAccountForm[\'apiKey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n        <label translate="SMS.ACCOUNTID">AccountId</label>\n        <input type="text" name="accountId" ng-model="vm.smsAccount.accountId" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'accountId\'].$error" ng-show="smsAccountForm[\'accountId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.ACCOUNTID_REQUIRED">AccountId field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n        <label translate="SMS.APPLICATIONID">ApplicationID</label>\n        <input type="text" name="applicationId" ng-model="vm.smsAccount.applicationId" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'applicationId\'].$error" ng-show="smsAccountForm[\'applicationId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.APPLICATIONID_REQUIRED">ApplicationID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.smsAccount.description">\n\n        <div ng-messages="smsAccountForm[\'description\'].$error" ng-show="smsAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsAccount" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid || smsAccountForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsAccount" ng-click="vm.addNewSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSACCOUNT" translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n          ADD SMSACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsAccount" ng-click="vm.deleteSmsAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",'<md-dialog class="smsAccount-dialog" aria-label="smsAccount" ng-init="vm.onInit()">\n  <form name="smsAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="SMS.AGENTADD_SMSACCOUNT">Add Agent to smsAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/agent/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'agent\'].$error" ng-show="smsAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.ACCESSKEYID">accesskeyid</label>\n        <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'accesskeyid\'].$error" ng-show="smsAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.SECRETACCESSKEY">secretaccesskey</label>\n        <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'secretaccesskey\'].$error" ng-show="smsAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.LEXREGION">lexregion</label>\n        <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n          <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n          <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n          <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'lexregion\'].$error" ng-show="smsAccountFormApp[\'lexregion\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.BOTNAME">botname</label>\n        <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'botname\'].$error" ng-show="smsAccountFormApp[\'botname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'times\'].$error" ng-show="smsAccountFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TEXT">Text</label>\n        <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n        <div ng-messages="smsAccountFormApp[\'text\'].$error" ng-show="smsAccountFormApp[\'text\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TEXT_REQUIRED">Text field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/close/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'disposition\'].$error" ng-show="smsAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'key\'].$error" ng-show="smsAccountFormApp[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n          <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'sv\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'language\'].$error" ng-show="smsAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.PROJECTID">ProjectID</label>\n        <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'projectId\'].$error" ng-show="smsAccountFormApp[\'projectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.CLIENTEMAIL">ClientEmail</label>\n        <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'clientEmail\'].$error" ng-show="smsAccountFormApp[\'clientEmail\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.PRIVATEKEY">PrivateKey</label>\n        <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n        <div ng-messages="smsAccountFormApp[\'privateKey\'].$error" ng-show="smsAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n          <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n          <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n          <md-option ng-value="\'en-IN\'">English (India)</md-option>\n          <md-option ng-value="\'en-US\'">English (US)</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n          <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'hi\'">Hindi</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pl\'">Polish</md-option>\n          <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n          <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n          <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n          <md-option ng-value="\'sw\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'tr\'">Turkish</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'language\'].$error" ng-show="smsAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'condition\'].$error" ng-show="smsAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'truepriority\'].$error" ng-show="smsAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'falsepriority\'].$error" ng-show="smsAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'priority\'].$error" ng-show="smsAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/noop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'value\'].$error" ng-show="smsAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/queue/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'queue\'].$error" ng-show="smsAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/system/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'command\'].$error" ng-show="smsAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'variable\'].$error" ng-show="smsAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/tag/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'tag\'].$error" ng-show="smsAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",'<md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">\n  <form name="smsCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.smsCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="smsCannedAnswerForm[\'key\'].$error" ng-show="smsCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.smsCannedAnswer.value" required></textarea>\n\n        <div ng-messages="smsCannedAnswerForm[\'value\'].$error" ng-show="smsCannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.smsCannedAnswer.description">\n\n        <div ng-messages="smsCannedAnswerForm[\'description\'].$error" ng-show="smsCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsCannedAnswer" ng-click="vm.saveSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsCannedAnswer" ng-click="vm.addNewSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSCANNEDANSWER" translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER">\n          ADD SMSCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsCannedAnswer" ng-click="vm.deleteSmsCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/view.html",'<div id="sms-smsAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-smsAccounts-button md-icon-button" aria-label="Go to smsAccounts" ng-click="vm.gotoSmsAccounts()" translate translate-attr-aria-label="SMS.GO_TO_SMSACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="smsAccount-image" hide-xs>\n          <img ng-src="assets/images/business/smsAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.smsAccount.id}}\n            <span ng-if="vm.smsAccount.name">{{vm.smsAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.smsAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="SMS.AGENTADD_SMSACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveSmsAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (smsDispositionsForm.$invalid) || (smsCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="SMS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.smsAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.smsAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'twilio\'">Twilio</md-option>\n                  <md-option ng-value="\'skebby\'">Skebby</md-option>\n                  <md-option ng-value="\'connectel\'">Connectel</md-option>\n                  <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n                  <md-option ng-value="\'plivo\'">Plivo</md-option>\n                  <md-option ng-value="\'infobip\'">Infobip</md-option>\n                  <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n                  <md-option ng-value="\'bandwidth\'">Bandwidth</md-option>\n                  <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n                  <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n                <label translate="SMS.ACCOUNTSID">AccountSID</label>\n                <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n                <label translate="SMS.AUTHID">AuthID</label>\n                <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'authId\'].$error" ng-show="generalForm[\'authId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n                <label translate="SMS.AUTHTOKEN">AuthToken</label>\n                <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n                <label translate="SMS.METHOD">Method</label>\n                <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'SI\'">Basic</md-option>\n                  <md-option ng-value="\'TI\'">Classic</md-option>\n                  <md-option ng-value="\'GP\'">Classic+</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'smsMethod\'].$error" ng-show="generalForm[\'smsMethod\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n                <label translate="SMS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'">\n                <label translate="SMS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container ng-if="vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'csc\'" class="md-block">\n                <label translate="SMS.BASEURL">BaseURL</label>\n                <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n                <label translate="SMS.APIKEY">ApiKey</label>\n                <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n                <label translate="SMS.ACCOUNTID">AccountId</label>\n                <input type="text" name="accountId" ng-model="vm.smsAccount.accountId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'accountId\'].$error" ng-show="generalForm[\'accountId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.ACCOUNTID_REQUIRED">AccountId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n                <label translate="SMS.APPLICATIONID">ApplicationID</label>\n                <input type="text" name="applicationId" ng-model="vm.smsAccount.applicationId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'applicationId\'].$error" ng-show="generalForm[\'applicationId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.APPLICATIONID_REQUIRED">ApplicationID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'plivo\'|| vm.smsAccount.type == \'csc\'|| vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n                <label translate="SMS.SENDERSTRING">SenderString</label>\n                <input type="text" name="senderString" ng-model="vm.smsAccount.senderString" md-maxlength="11" ng-pattern="/^[A-Za-z0-9\\.\\s]*$/i" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'senderString\'].$error" ng-show="generalForm[\'senderString\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.SENDERSTRING_REQUIRED">SenderString field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="SMS.ERRORS.SENDERSTRING_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\s]*$/i\' }">SenderString must be valid pattern </span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="SMS.ERRORS.SENDERSTRING_MAX_LENGTH" translate-values=\'{max: 11}\'>SenderString must have a maximum length equal to 11</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\'" class="md-block">\n                <md-switch ng-model="vm.smsAccount.deliveryReport" aria-label="deliveryReport" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.DELIVERYREPORT">deliveryReport</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.smsAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.smsAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.RECEIVEURL">receiveUrl</label>\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/notify?token=\' + vm.smsAccount.token" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="SMS.HELP.RECEIVEURL"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="( ((vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\') && vm.smsAccount.deliveryReport) || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n                <label translate="SMS.DELIVERYREPORTURL">deliveryReportUrl</label>\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-deliveryReportUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-deliveryReportUrl" name="deliveryReportUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/status?token=\' + vm.smsAccount.token + (vm.smsAccount.type == \'csc\' ? \'&message-id={message-id}&state={state}\' : \'\')" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="SMS.HELP.DELIVERYREPORTURL"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="smsAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="SMS.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.smsAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="smsAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.queueTransfer == true" class="md-block">\n                <label translate="SMS.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.smsAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.agentTransfer == true" class="md-block">\n                <label translate="SMS.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.smsAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.PROXY">PROXY</div>\n            </div>\n            <form name="proxyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="SMS.TOKEN">token</label>\n                <input type="text" name="token" ng-model="vm.smsAccount.token" autofocus disabled>\n\n                <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.TOKEN_REQUIRED">token field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n                <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n                <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="smsAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.mandatoryDisposition" class="md-block">\n                <label translate="SMS.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.smsAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="SMS.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="SmsAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="smsAccount-detail-form-container smsdispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="SMS.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add sms dispositions" translate translate-attr-label="SMS.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="smsAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container smscannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="SmsAccountSmsCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="SMS.SMSCANNEDANSWERS">SmsCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getSmsAccountSmsCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event)" aria-label="add smsCannedAnswer" translate translate-attr-label="SMS.ADD_SMSCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsCannedAnswers.length}} {{vm_dc.selectedSmsAccountSmsCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsCannedAnswers" csv-label="true" filename="smsAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'SMS.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'SMS.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'SMS.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'SMS.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'SMS.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="smsCannedAnswer" md-select-id="id" ng-repeat="smsCannedAnswer in vm_dc.smsAccountSmsCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{smsCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{smsCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{smsCannedAnswer.value}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{smsCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{ smsCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" translate="SMS.EDIT_SMSCANNEDANSWER">\n                                Edit SmsCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(smsCannedAnswer, $event)" translate="SMS.DELETE_SMSCANNEDANSWER">\n                                Delete SmsCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.smsAccountSmsCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="SMS.NO_SMSCANNEDANSWER_AVAILABLE">No smscannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountSmsCannedAnswers.count}}" md-on-paginate="vm_dc.getSmsAccountSmsCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="SmsAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.smsAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="SMS.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedSmsAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedSmsAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedSmsAccountApps.length}} {{vm_ac.selectedSmsAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedSmsAccountApps($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedSmsAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.smsAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editSmsAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.smsAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="SmsAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="SMS.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getSmsAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getSmsAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getSmsAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="SMS.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedSmsAccountInteractions.length}} {{vm_dc.selectedSmsAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountInteractions" csv-label="true" filename="smsAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'SMS.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'SMS.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'SMS.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'SMS.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'SMS.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'SMS.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'SMS.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.smsAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'SMS.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'SMS.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spysmsInteraction($event, interaction)" translate="SMS.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.smsInteractionDownload(interaction, $event)" translate="SMS.DOWNLOAD_INTERACTION">\n                                Download\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="SMS.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.smsAccountInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="SMS.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountInteractions.count}}" md-on-paginate="vm_dc.getSmsAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/smsAccounts.html",'<div id="smsAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SMS.SMSACCOUNTS">SmsAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSmsAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSmsAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="SMS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-smsAccounts-count">\n          <span>{{vm.selectedSmsAccounts.length}}</span>\n          <span translate="SMS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSmsAccounts()" translate="SMS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSmsAccounts()" translate="SMS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSmsAccounts" csv-label="true" filename="smsAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsAccounts($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SMSACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSmsAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n                <th md-column md-order-by="ListId">{{ \'SMS.LIST\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'SMS.TYPE\' | translate }}</th>\n                <th md-column md-order-by="phone">{{ \'SMS.PHONE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.smsAccounts.rows.length">\n                <td md-cell colspan="8">\n                  <div layout="row" layout-align="center center">\n                    <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="smsAccount" md-select-id="id" ng-repeat="smsAccount in vm.smsAccounts.rows">\n                <td md-cell ng-if="smsAccount.userpic"><img class="avatar" alt="{{smsAccount.name}}" ng-src="api/users/{{smsAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!smsAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="id ">{{smsAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="name ">{{smsAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="key ">{{smsAccount.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':smsAccount.ListId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="type ">{{ vm.arraytype[smsAccount.type].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="phone ">{{smsAccount.phone}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="description ">{{smsAccount.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(smsAccount, $event    )" translate="SMS.EDIT_SMSACCOUNT">\n                          Edit SmsAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(smsAccount, $event    )" translate="SMS.INTERACTIONS_SMSACCOUNT">\n                          Interactions SmsAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(smsAccount, $event    )" translate="SMS.AGENTADD_SMSACCOUNT">\n                          AgentAdd SmsAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(smsAccount, $event    )" translate="SMS.DELETE_SMSACCOUNT">\n                          Delete SmsAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsAccounts.count}}" md-on-paginate="vm.getSmsAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SMSACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SMSACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsAccount-button" ng-click="vm.createOrEditSmsAccount($event)" aria-label="add smsAccount" translate translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SMSACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsQueues/create/dialog.html",'<md-dialog class="smsQueue-dialog" aria-label="New SmsQueue">\n  <form name="smsQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newSmsQueue">\n\n        <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n        <div ng-messages="smsQueueForm[\'name\'].$error" ng-show="smsQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="smsQueueForm[\'strategy\'].$error" ng-show="smsQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="smsQueueForm[\'timeout\'].$error" ng-show="smsQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.smsQueue.description">\n\n        <div ng-messages="smsQueueForm[\'description\'].$error" ng-show="smsQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsQueue" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid || smsQueueForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsQueue" ng-click="vm.addNewSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSQUEUE" translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n          ADD SMSQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsQueue" ng-click="vm.deleteSmsQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n  <form name="smsQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="SMS.AGENTADD_SMSQUEUE">Add Agent to smsQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n  <form name="smsQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="SMS.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/view.html",'<div id="sms-smsQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-smsQueues-button md-icon-button" aria-label="Go to smsQueues" ng-click="vm.gotoSmsQueues()" translate translate-attr-aria-label="SMS.GO_TO_SMSQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="smsQueue-image" hide-xs>\n          <img ng-src="assets/images/business/smsQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.smsQueue.id}}\n            <span ng-if="vm.smsQueue.name">{{vm.smsQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.smsQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="SMS.TEAMADD_SMSQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.smsQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="SMS.AGENTADD_SMSQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveSmsQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="SMS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.smsQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.smsQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsQueues/smsQueues.html",'<div id="smsQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SMS.SMSQUEUES">SmsQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSmsQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSmsQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="SMS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-smsQueues-count">\n          <span>{{vm.selectedSmsQueues.length}}</span>\n          <span translate="SMS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSmsQueues()" translate="SMS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSmsQueues()" translate="SMS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSmsQueues" csv-label="true" filename="smsQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsQueues($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SMSQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSmsQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'SMS.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.smsQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="smsQueue" md-select-id="id" ng-repeat="smsQueue in vm.smsQueues.rows">\n                <td md-cell ng-if="smsQueue.userpic"><img class="avatar" alt="{{smsQueue.name}}" ng-src="api/users/{{smsQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!smsQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="id ">{{smsQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="name ">{{smsQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="strategy ">{{ vm.arraystrategy[smsQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(smsQueue, $event    )" translate="SMS.EDIT_SMSQUEUE">\n                          Edit SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(smsQueue, $event    )" translate="SMS.TEAMADD_SMSQUEUE">\n                          teamadd SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(smsQueue, $event    )" translate="SMS.AGENTADD_SMSQUEUE">\n                          agentadd SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(smsQueue, $event    )" translate="SMS.DELETE_SMSQUEUE">\n                          Delete SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(smsQueue, $event    )" translate="SMS.GOTOREALTIME_SMSQUEUE">\n                          goToRealtime SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsQueues.count}}" md-on-paginate="vm.getSmsQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SMSQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SMSQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsQueue-button" ng-click="vm.createOrEditSmsQueue($event)" aria-label="add smsQueue" translate translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SMSQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/agents.html",'<div id="agents" class="page-layout simple left-sidenav inner-sidenav">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.AGENTS">Agents</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedAgents.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedAgents =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-agents-count">\n          <span>{{vm.selectedAgents.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllAgents()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectAgents()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedAgents" csv-label="true" filename="agents.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedAgents($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- AGENT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedAgents" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n              <tr md-row>\n                <th md-column width="20px"></th>\n                <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="showWebBar">{{ \'STAFF.SHOWWEBCONTROL\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n                <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n                <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n                <th md-column md-order-by="disabled">{{ \'STAFF.DISABLED\' | translate }}</th>\n                <th md-column md-order-by="blocked">{{ \'STAFF.BLOCKED\' | translate }}</th>\n                <th md-column>{{ \'STAFF.CLIENT_LOGS\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.agents.rows.length">\n                <td md-cell colspan="10">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n                <td md-cell ng-if="agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="api/users/{{agent.id}}/avatar" /></td>\n                <td md-cell ng-if="!agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="fullname font-weight-600">{{agent.fullname}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="name">{{agent.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="showWebBar">{{ agent.showWebBar | getOptionByValue: vm.showWebBarOptions }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="email">{{agent.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="phone">{{agent.phone}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="mobile">{{agent.mobile}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="internal">{{agent.internal}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="disabled">\n                  <md-icon md-colors="{color: {{agent.disabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{agent.disabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="blocked">\n                  <md-icon md-colors="{color: {{agent.blocked ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{agent.blocked ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="client-side-logging">\n                  <ms-client-side-logging-icon user="agent"></ms-client-side-logging-icon>\n                </td>\n                <td md-cell class="actions">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editstate(agent, $event    )" translate="STAFF.EDIT_AGENT">\n                          Edit Agent\n                        </md-button>\n                      </md-menu-item>\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item>\n                        <md-button ng-click="vm.teamadddialog(agent, $event    )" translate="STAFF.TEAMADD_AGENT">\n                          teamadd Agent\n                        </md-button>\n                      </md-menu-item>\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteconfirm(agent, $event    )" translate="STAFF.DELETE_AGENT">\n                          Delete Agent\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / AGENT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD AGENT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-agent-button" ng-click="vm.createOrEditAgent($event)" aria-label="add agent" translate translate-attr-aria-label="STAFF.ADD_AGENT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD AGENT BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/create/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n  <form name="agentForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.FULLNAME">Fullname</label>\n        <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n\n        <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.USERNAME">Username</label>\n        <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newAgent">\n\n        <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n        <div ng-messages="agentForm[\'name\'].$error" ng-show="agentForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.agent.alias">\n\n        <div ng-messages="agentForm[\'alias\'].$error" ng-show="agentForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n        <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n          <md-option ng-value="0">Phonebar</md-option>\n          <md-option ng-value="1">External</md-option>\n          <md-option ng-value="2">WebRTC</md-option>\n        </md-select>\n        <div ng-messages="agentForm[\'showWebBar\'].$error" ng-show="agentForm[\'showWebBar\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n\n        <div ng-messages="agentForm[\'email\'].$error" ng-show="agentForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newAgent">\n        <label translate="STAFF.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.agent.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n        <div ng-messages="agentForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newAgent  && (vm.newAgent)">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n        <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newAgent" class="md-block">\n        <md-switch ng-model="vm.agent.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n        <label translate="STAFF.INTERNAL">Internal</label>\n        <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" ng-disabled="!vm.newAgent">\n\n        <div ng-messages="agentForm[\'internal\'].$error" ng-show="agentForm[\'internal\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.agent.description">\n\n        <div ng-messages="agentForm[\'description\'].$error" ng-show="agentForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newAgent" class="md-block">\n        <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.agent.userSetting">\n        <ms-client-side-logging user="vm.agent"></ms-client-side-logging>\n      </md-input-container>\n      <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n        <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n        <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n        <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" value="9888" ng-required="true">\n\n        <div ng-messages="agentForm[\'phoneBarRemoteControlPort\'].$error" ng-show="agentForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newUser" class="md-block">\n        <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAgent" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAgent" ng-click="vm.addNewAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid" aria-label="ADD" translate="STAFF.ADD_AGENT" translate-attr-aria-label="STAFF.ADD_AGENT">\n          ADD AGENT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAgent" ng-click="vm.deleteAgent($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",'<md-dialog class="agent-dialog" aria-label="{{vm.name}}">\n  <form name="agentForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'\n                    STAFF.CHANGE_PASSWORD\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.agent.id">\n        <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n        <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n        <div ng-messages="agentForm.oldPassword.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NEW_PASSWORD">New Password</label>\n        <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n        <div ng-messages="agentForm.password.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n              required</span>\n          </div>\n\n\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n              at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n              character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n          <div ng-message="oldPasswordMatch">\n            <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n          </div>\n\n\n\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n        <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n              required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n              not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n  <form name="agentForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2>{{vm.title}}</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin" ng-if="vm.agent.role === \'agent\' && vm.channel === \'voice\'">\n        <label translate="STAFF.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="agentForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" add-disabled="vm.channel === \'voice\' && vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveQueues()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n  <form name="agentForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="STAFF.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/view.html",'<div id="staff-agent" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-agents-button md-icon-button" aria-label="Go to agents" ng-click="vm.gotoAgents()" translate translate-attr-aria-label="STAFF.GO_TO_AGENTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="agent-image" hide-xs>\n          <img ng-src="assets/images/business/agents.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.agent.id}}\n            <span ng-if="vm.agent.name">{{vm.agent.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="STAFF.CREATED_AT"></span> <span>{{vm.agent.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div ng-cloak>\n      <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n        <md-fab-trigger>\n          <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n            <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n            <md-icon md-font-icon="icon-stackoverflow" aria-label="queueadd"></md-icon>\n          </md-button>\n        </md-fab-trigger>\n        <md-fab-actions>\n          <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'inbound\')">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n            <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'outbound\')">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n            <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'chat\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n            <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'mail\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n            <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'sms\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n            <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'openchannel\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n            <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'fax\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n            <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.whatsapp" aria-label="whatsapp" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'whatsapp\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="WHATSAPP.WHATSAPP">whatsapp</span></md-tooltip>\n            <md-icon md-font-icon="icon-whatsapp" aria-label="whatsapp"></md-icon>\n          </md-button>\n        </md-fab-actions>\n      </md-fab-speed-dial>\n    </div>\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.agent, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="STAFF.TEAMADD_AGENT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.changepassworddialog(vm.agent, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n        <md-tooltip><span translate="STAFF.CHANGEPASSWORD_AGENT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-key-variant"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveAgent()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (capacityForm.$invalid) || (settingsForm.$invalid) || (remote_controlForm.$invalid) || (sipForm.$invalid) || (callforwardingForm.$invalid) || (settings_webrtcForm.$invalid) || (sip_webrtcForm.$invalid) || (general_permissionsForm.$invalid) || (download_permissionsForm.$invalid) || (permissionsForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n            </div>\n            <form name="personal_infoForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.FULLNAME">Fullname</label>\n                <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.USERNAME">Username</label>\n                <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n                <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n                <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ALIAS">Alias</label>\n                <input type="text" name="alias" ng-model="vm.agent.alias" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'alias\'].$error" ng-show="personal_infoForm[\'alias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n                <md-select name="showWebBar" ng-model="vm.agent.showWebBar" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="0">Phonebar</md-option>\n                  <md-option ng-value="1">External</md-option>\n                  <md-option ng-value="2">WebRTC</md-option>\n                </md-select>\n                <div ng-messages="personal_infoForm[\'showWebBar\'].$error" ng-show="personal_infoForm[\'showWebBar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.agent.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.agent.phone" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.MOBILE">Mobile</label>\n                <input type="text" name="mobile" ng-model="vm.agent.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar == 1" class="md-block">\n                <md-switch ng-model="vm.agent.hotdesk" aria-label="Hotdesk" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.HOTDESK">Hotdesk</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.loginInPause" aria-label="LoginInPause" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.LOGININPAUSE">LoginInPause</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.agent.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n            </div>\n            <form name="security_suiteForm" novalidate>\n              <md-input-container ng-if="vm.agent.passwordResetAt != null" class="md-block">\n                <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n                <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" autofocus disabled>\n                <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n                <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.passwordResetAt == null" class="md-block">\n                <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n                <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" disabled>\n                <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.disabled" aria-label="Disabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DISABLED">Disabled</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.DISABLED"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.disabled == 0" class="md-block">\n                <md-switch ng-model="vm.agent.blocked" aria-label="Blocked" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.BLOCKED">Blocked</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.BLOCKED"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.privacyEnabled" aria-label="Mask_Sensitive_Data" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.AUTHENTICATION">AUTHENTICATION</div>\n            </div>\n            <form name="authenticationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.adSsoEnabled" aria-label="AD_SSO_Enabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AD_SSO_ENABLED">AD_SSO_Enabled</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.AD_SSO_ENABLED"></span></div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n            </div>\n            <div ng-controller="Agentchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container md-background-bg md-whiteframe-1dp">\n              <div id="agent-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="change_avatarimage in vm_ca.agent.images" ng-switch="change_avatarimage.type">\n                    <div class="agent-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="change_avatarimage.file">\n                    </div>\n                    <div class="agent-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{change_avatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.VOICE">VOICE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n                <label translate="STAFF.INTERNAL">Internal</label>\n                <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" autofocus disabled>\n                <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar != 2" class="md-block">\n                <label translate="STAFF.TRANSPORT">Transport</label>\n                <md-select name="transport" ng-model="vm.agent.transport" multiple ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'udp\'">udp</md-option>\n                  <md-option ng-value="\'tcp\'">tcp</md-option>\n                  <md-option ng-value="\'ws\'" ng-if="vm.agent.showWebBar == 1">ws</md-option>\n                  <md-option ng-value="\'wss\'" ng-if="vm.agent.showWebBar == 1">wss</md-option>\n                  <md-option ng-value="\'tls\'" ng-if="vm.agent.showWebBar == 1">tls</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n                <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.HOST">Host</label>\n                <input type="text" name="host" ng-model="vm.agent.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.HOST"></span></div>\n                <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.HOST_REQUIRED">Host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.NAT">NAT</label>\n                <md-select name="nat" ng-model="vm.agent.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'force_rport\'">force_rport</md-option>\n                  <md-option ng-value="\'comedia\'">comedia</md-option>\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'never\'">never</md-option>\n                  <md-option ng-value="\'route\'">route</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n                <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.agent.type" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'friend\'">Friend</md-option>\n                  <md-option ng-value="\'user\'">User</md-option>\n                  <md-option ng-value="\'peer\'">Peer</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.TYPE"></span></div>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n                <md-select name="allow" ng-model="vm.agent.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ulaw\'">ulaw</md-option>\n                  <md-option ng-value="\'alaw\'">alaw</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                  <md-option ng-value="\'g722\'">g722</md-option>\n                  <md-option ng-value="\'g729\'">g729</md-option>\n                  <md-option ng-value="\'opus\'">opus</md-option>\n                  <md-option ng-value="\'h264\'">h264</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n                <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLERID">CallerId</label>\n                <input type="text" name="callerid" ng-model="vm.agent.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.agent.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLGROUP">Callgroup</label>\n                <input type="text" name="callgroup" ng-model="vm.agent.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n                <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n                <input type="text" name="pickupgroup" ng-model="vm.agent.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n                <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.chanspy" aria-label="chanSpy" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CHANSPY">chanSpy</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n                <md-select name="videosupport" ng-model="vm.agent.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'always\'">Always</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.MONITOREXTENSION">MonitorExtension</label>\n                <md-select name="extensionMonitor" ng-model="vm.agent.extensionMonitor" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Inactive</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'WAV\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'extensionMonitor\'].$error" ng-show="generalForm[\'extensionMonitor\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MONITOREXTENSION_REQUIRED">MonitorExtension field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.OTHER_CHANNELS">OTHER_CHANNELS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container capacity md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CAPACITY">CAPACITY</div>\n            </div>\n            <form name="capacityForm" novalidate>\n              <md-input-container ng-if="vm.license.chat" class="md-block">\n                <label translate="STAFF.CHATCAPACITY">ChatCapacity</label>\n                <input type="number" name="chatCapacity" ng-model="vm.agent.chatCapacity" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.CHATCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'chatCapacity\'].$error" ng-show="capacityForm[\'chatCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CHATCAPACITY_REQUIRED">ChatCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ChatCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.mail" class="md-block">\n                <label translate="STAFF.MAILCAPACITY">MailCapacity</label>\n                <input type="number" name="mailCapacity" ng-model="vm.agent.mailCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.MAILCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'mailCapacity\'].$error" ng-show="capacityForm[\'mailCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MAILCAPACITY_REQUIRED">MailCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MailCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.messaging" class="md-block">\n                <label translate="STAFF.SMSCAPACITY">SMSCapacity</label>\n                <input type="number" name="smsCapacity" ng-model="vm.agent.smsCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.SMSCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'smsCapacity\'].$error" ng-show="capacityForm[\'smsCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SMSCAPACITY_REQUIRED">SMSCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.SMSCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">SMSCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.openchannel" class="md-block">\n                <label translate="STAFF.OPENCHANNELCAPACITY">OpenchannelCapacity</label>\n                <input type="number" name="openchannelCapacity" ng-model="vm.agent.openchannelCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.OPENCHANNELCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'openchannelCapacity\'].$error" ng-show="capacityForm[\'openchannelCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_REQUIRED">OpenchannelCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OpenchannelCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.fax" class="md-block">\n                <label translate="STAFF.FAXCAPACITY">FaxCapacity</label>\n                <input type="number" name="faxCapacity" ng-model="vm.agent.faxCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.FAXCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'faxCapacity\'].$error" ng-show="capacityForm[\'faxCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.FAXCAPACITY_REQUIRED">FaxCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FaxCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.whatsapp" class="md-block">\n                <label translate="STAFF.WHATSAPPCAPACITY">WhatsappCapacity</label>\n                <input type="number" name="whatsappCapacity" ng-model="vm.agent.whatsappCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.WHATSAPPCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'whatsappCapacity\'].$error" ng-show="capacityForm[\'whatsappCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.WHATSAPPCAPACITY_REQUIRED">WhatsappCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.WHATSAPPCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WhatsappCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.agent.showWebBar == 0">\n        <md-tab-label>\n          <span translate="STAFF.MOTIONBAR">MOTIONBAR</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container settings md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SETTINGS">SETTINGS</div>\n            </div>\n            <form name="settingsForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n                <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n                <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="settingsForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settingsForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarRingInUse" aria-label="RingInUse" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.RINGINUSE">RingInUse</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarUnansweredCallBadge" aria-label="UnansweredCallBadge" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNANSWEREDCALLBADGE">UnansweredCallBadge</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableJaws" aria-label="EnableJawsIntegration" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEJAWSINTEGRATION">EnableJawsIntegration</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar == 0 && vm.license.screenrecording" class="md-block">\n                <md-switch ng-change="vm.onEnableScreenRecordingByAgentSelection()" ng-model="vm.agent.phoneBarEnableScreenRecordingByAgent" aria-label="EnableScreenRecordingByAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESCREENRECORDINGBYAGENT">EnableScreenRecordingByAgent</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar == 0 && vm.license.screenrecording" class="md-block">\n                <md-switch ng-change="vm.onEnableAutomaticScreenRecordingSelection()" ng-model="vm.agent.phoneBarEnableAutomaticScreenRecording" aria-label="EnableAutomaticScreenRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEAUTOMATICSCREENRECORDING">EnableAutomaticScreenRecording</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.ENABLEAUTOMATICSCREENRECORDING"></span></div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container remote_control md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.REMOTE_CONTROL">REMOTE_CONTROL</div>\n            </div>\n            <form name="remote_controlForm" novalidate>\n              <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n                <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n                <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" value="9888" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="remote_controlForm[\'phoneBarRemoteControlPort\'].$error" ng-show="remote_controlForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container sip md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SIP">SIP</div>\n            </div>\n            <form name="sipForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n                <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n                <div ng-messages="sipForm[\'phoneBarExpires\'].$error" ng-show="sipForm[\'phoneBarExpires\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.SIPPORT">SipPort</label>\n                <input type="number" name="phoneBarListenPort" ng-model="vm.agent.phoneBarListenPort" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.SIPPORT"></span></div>\n                <div ng-messages="sipForm[\'phoneBarListenPort\'].$error" ng-show="sipForm[\'phoneBarListenPort\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SIPPORT_REQUIRED">SipPort field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container callforwarding md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CALLFORWARDING">CALLFORWARDING</div>\n            </div>\n            <form name="callforwardingForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarUnconditional" aria-label="Unconditional" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNCONDITIONAL">Unconditional</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.phoneBarUnconditional" class="md-block">\n                <label translate="STAFF.UNCONDITIONALNUMBER">UnconditionalNumber</label>\n                <input type="text" name="phoneBarUnconditionalNumber" ng-model="vm.agent.phoneBarUnconditionalNumber" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="callforwardingForm[\'phoneBarUnconditionalNumber\'].$error" ng-show="callforwardingForm[\'phoneBarUnconditionalNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.UNCONDITIONALNUMBER_REQUIRED">UnconditionalNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.agent.showWebBar == 2">\n        <md-tab-label>\n          <span translate="STAFF.WEBRTC">WEBRTC</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container settings_webrtc md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SETTINGS_WEBRTC">SETTINGS_WEBRTC</div>\n            </div>\n            <form name="settings_webrtcForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DTLSCERTFILE">dtlscertfile</label>\n                <input type="text" name="dtlscertfile" ng-model="vm.agent.dtlscertfile" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.DTLSCERTFILE"></span></div>\n                <div ng-messages="settings_webrtcForm[\'dtlscertfile\'].$error" ng-show="settings_webrtcForm[\'dtlscertfile\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DTLSCERTFILE_REQUIRED">dtlscertfile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DTLSPRIVATEKEY">dtlsprivatekey</label>\n                <input type="text" name="dtlsprivatekey" ng-model="vm.agent.dtlsprivatekey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.DTLSPRIVATEKEY"></span></div>\n                <div ng-messages="settings_webrtcForm[\'dtlsprivatekey\'].$error" ng-show="settings_webrtcForm[\'dtlsprivatekey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DTLSPRIVATEKEY_REQUIRED">dtlsprivatekey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.WSS_PORT">WSS_Port</label>\n                <input type="number" name="wssPort" ng-model="vm.agent.wssPort" min="0" value="8089" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.WSS_PORT"></span></div>\n                <div ng-messages="settings_webrtcForm[\'wssPort\'].$error" ng-show="settings_webrtcForm[\'wssPort\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.WSS_PORT_REQUIRED">WSS_Port field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.WSS_PORT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WSS_Port must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n                <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n                <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.ignorePauseForPreviewCalls" aria-label="Ignore agent break status for preview calls" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS">Ignore agent break status for preview calls</span></md-switch>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container sip_webrtc md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SIP_WEBRTC">SIP_WEBRTC</div>\n            </div>\n            <form name="sip_webrtcForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n                <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n                <div ng-messages="sip_webrtcForm[\'phoneBarExpires\'].$error" ng-show="sip_webrtcForm[\'phoneBarExpires\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n            </div>\n            <form name="general_permissionsForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.allowmessenger" aria-label="EnableMessenger" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEMESSENGER">EnableMessenger</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarPrefixRequired" aria-label="PrefixRequired" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.PREFIXREQUIRED">PrefixRequired</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.selectRecallMeCampaign" aria-label="Select_RecallMe_Campaign" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.SELECT_RECALLME_CAMPAIGN">Select_RecallMe_Campaign</span></md-switch>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container download_permissions md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.DOWNLOAD_PERMISSIONS">DOWNLOAD_PERMISSIONS</div>\n            </div>\n            <form name="download_permissionsForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.downloadAttachments" aria-label="Attachments" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ATTACHMENTS">Attachments</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.downloadOmnichannelInteractions" aria-label="Omnichannel_Interactions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.OMNICHANNEL_INTERACTIONS">Omnichannel_Interactions</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.downloadVoiceRecordings" aria-label="Voice_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.VOICE_RECORDINGS">Voice_Recordings</span></md-switch>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n            </div>\n            <div ng-controller="AgentPermissionsController as vm_pc" ng-init="vm_pc.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container">\n              <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.agent.role !== \'admin\' && !father.hidden()"></md-list>\n              \x3c!-- Nested navigation template --\x3e\n              <script type="text/ng-template" id="permission-nested.html">\n                <md-list-item>\n        <md-icon md-font-icon="{{father.icon}}"></md-icon>\n        <p translate="{{father.translate}}">{{ father.title }}</p>\n        <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.agent.permissions.includes(father.id)" \n                  ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n      </md-list-item>\n      <md-divider></md-divider>\n      <md-list>\n        <md-list-item ng-repeat="child in father.children" ng-if="child.id !== 201">\n          <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n          <p translate="{{child.translate}}">{{ child.title }}</p>\n          <md-switch ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.agent.permissions.includes(child.id)"\n                    ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n          </md-list-item>\n      </md-list>\n  <\/script>\n              \x3c!-- / Nested navigation template --\x3e\n              <span ng-if="vm_pc.agent.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.CLIENT_LOGS">CLIENT-SIDE LOGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container client_logs md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CLIENT_LOGS">\n                CLIENT-SIDE LOGS\n              </div>\n            </div>\n            <ms-client-side-logging user="vm.agent" on-user-update="vm.refreshAgent()"></ms-client-side-logging>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/staff/views/teams/create/dialog.html",'<md-dialog class="team-dialog" aria-label="New Team">\n  <form name="teamForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.team.name" ng-required="true" autofocus>\n\n        <div ng-messages="teamForm[\'name\'].$error" ng-show="teamForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.team.description">\n\n        <div ng-messages="teamForm[\'description\'].$error" ng-show="teamForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTeam" ng-click="vm.saveTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid || teamForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTeam" ng-click="vm.addNewTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TEAM" translate-attr-aria-label="STAFF.ADD_TEAM">\n          ADD TEAM\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTeam" ng-click="vm.deleteTeam($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",'<md-dialog class="team-dialog" aria-label="team" ng-init="vm.onInit()">\n  <form name="teamForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="STAFF.AGENTADD_TEAM">Add Agent to team</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/teams.html",'<div id="teams" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.TEAMS">Teams</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTeams.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTeams =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-teams-count">\n          <span>{{vm.selectedTeams.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTeams()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTeams()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTeams" csv-label="true" filename="teams.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTeams($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TEAM TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTeams" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTeams">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.teams.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="team" md-select-id="id" ng-repeat="team in vm.teams.rows">\n                <td md-cell ng-if="team.userpic"><img class="avatar" alt="{{team.name}}" ng-src="api/users/{{team.id}}/avatar" /></td>\n                <td md-cell ng-if="!team.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{team.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="id ">{{team.id}}</td>\n                <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="name ">{{team.name}}</td>\n                <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="description ">{{team.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(team, $event    )" translate="STAFF.EDIT_TEAM">\n                          Edit Team\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(team, $event    )" translate="STAFF.AGENTADD_TEAM">\n                          AgentAdd Team\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(team, $event    )" translate="STAFF.DELETE_TEAM">\n                          Delete Team\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.teams.count}}" md-on-paginate="vm.getTeams" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TEAM TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TEAM BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-team-button" ng-click="vm.createOrEditTeam($event)" aria-label="add team" translate translate-attr-aria-label="STAFF.ADD_TEAM">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TEAM BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/telephones/create/dialog.html",'<md-dialog class="telephone-dialog" aria-label="New Telephone">\n  <form name="telephoneForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n        <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n\n        <div ng-messages="telephoneForm[\'fullname\'].$error" ng-show="telephoneForm[\'fullname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.USERNAME">Username</label>\n        <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newTelephone">\n\n        <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n        <div ng-messages="telephoneForm[\'name\'].$error" ng-show="telephoneForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n\n        <div ng-messages="telephoneForm[\'email\'].$error" ng-show="telephoneForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newTelephone">\n        <label translate="STAFF.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.telephone.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n        <div ng-messages="telephoneForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.newTelephone  && (vm.newTelephone)">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n        <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.telephone.description">\n\n        <div ng-messages="telephoneForm[\'description\'].$error" ng-show="telephoneForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newTelephone" class="md-block">\n        <md-switch ng-model="vm.telephone.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n        <label translate="STAFF.INTERNAL">Internal</label>\n        <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" ng-disabled="!vm.newTelephone">\n\n        <div ng-messages="telephoneForm[\'internal\'].$error" ng-show="telephoneForm[\'internal\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newTelephone" class="md-block">\n        <md-switch ng-model="vm.telephone.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTelephone" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTelephone" ng-click="vm.addNewTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TELEPHONE" translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n          ADD TELEPHONE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTelephone" ng-click="vm.deleteTelephone($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",'<md-dialog class="telephone-dialog" aria-label="{{vm.name}}">\n  <form name="telephoneForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'\n                    STAFF.CHANGE_PASSWORD\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.telephone.id">\n        <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n        <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n        <div ng-messages="telephoneForm.oldPassword.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NEW_PASSWORD">New Password</label>\n        <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n        <div ng-messages="telephoneForm.password.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n              required</span>\n          </div>\n\n\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n              at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n              character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n          <div ng-message="oldPasswordMatch">\n            <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n          </div>\n\n\n\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n        <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n              required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n              not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/view.html",'<div id="staff-telephone" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-telephones-button md-icon-button" aria-label="Go to telephones" ng-click="vm.gotoTelephones()" translate translate-attr-aria-label="STAFF.GO_TO_TELEPHONES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="telephone-image" hide-xs>\n          <img ng-src="assets/images/business/telephones.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.telephone.id}}\n            <span ng-if="vm.telephone.name">{{vm.telephone.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="STAFF.CREATED_AT"></span> <span>{{vm.telephone.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.changepassworddialog(vm.telephone, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n        <md-tooltip><span translate="STAFF.CHANGEPASSWORD_TELEPHONE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-key-variant"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveTelephone()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(accountForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="telephone-detail-form-container account md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.ACCOUNT">ACCOUNT</div>\n            </div>\n            <form name="accountForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n                <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'fullname\'].$error" ng-show="accountForm[\'fullname\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.USERNAME">Username</label>\n                <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n                <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n                <div ng-messages="accountForm[\'name\'].$error" ng-show="accountForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'email\'].$error" ng-show="accountForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.telephone.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'description\'].$error" ng-show="accountForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.telephone.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'phone\'].$error" ng-show="accountForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.MOBILE">Mobile</label>\n                <input type="text" name="mobile" ng-model="vm.telephone.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'mobile\'].$error" ng-show="accountForm[\'mobile\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.VOICE">VOICE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="telephone-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n                <label translate="STAFF.INTERNAL">Internal</label>\n                <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.TRANSPORT">Transport</label>\n                <md-select name="transport" ng-model="vm.telephone.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'udp\'">udp</md-option>\n                  <md-option ng-value="\'tcp\'">tcp</md-option>\n                  <md-option ng-value="\'ws\'">ws</md-option>\n                  <md-option ng-value="\'wss\'">wss</md-option>\n                  <md-option ng-value="\'tls\'">tls</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n                <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.NAT">NAT</label>\n                <md-select name="nat" ng-model="vm.telephone.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'force_rport\'">force_rport</md-option>\n                  <md-option ng-value="\'comedia\'">comedia</md-option>\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'never\'">never</md-option>\n                  <md-option ng-value="\'route\'">route</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n                <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n                <md-select name="allow" ng-model="vm.telephone.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ulaw\'">ulaw</md-option>\n                  <md-option ng-value="\'alaw\'">alaw</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                  <md-option ng-value="\'g722\'">g722</md-option>\n                  <md-option ng-value="\'g729\'">g729</md-option>\n                  <md-option ng-value="\'opus\'">opus</md-option>\n                  <md-option ng-value="\'h264\'">h264</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n                <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLERID">CallerId</label>\n                <input type="text" name="callerid" ng-model="vm.telephone.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.telephone.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLGROUP">Callgroup</label>\n                <input type="text" name="callgroup" ng-model="vm.telephone.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n                <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n                <input type="text" name="pickupgroup" ng-model="vm.telephone.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n                <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n                <md-select name="videosupport" ng-model="vm.telephone.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'always\'">Always</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ENCRYPTION">Encryption</label>\n                <md-select name="encryption" ng-model="vm.telephone.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.ENCRYPTION"></span></div>\n                <div ng-messages="generalForm[\'encryption\'].$error" ng-show="generalForm[\'encryption\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ENCRYPTION_REQUIRED">Encryption field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/telephones/telephones.html",'<div id="telephones" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.TELEPHONES">Telephones</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTelephones.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTelephones =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-telephones-count">\n          <span>{{vm.selectedTelephones.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTelephones()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTelephones()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTelephones" csv-label="true" filename="telephones.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTelephones($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TELEPHONE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTelephones" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="fullname">{{ \'STAFF.ACCOUNTNAME\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.telephones.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="telephone" md-select-id="id" ng-repeat="telephone in vm.telephones.rows">\n                <td md-cell ng-if="telephone.userpic"><img class="avatar" alt="{{telephone.name}}" ng-src="api/users/{{telephone.id}}/avatar" /></td>\n                <td md-cell ng-if="!telephone.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{telephone.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="fullname font-weight-600">{{telephone.fullname}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="name ">{{telephone.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="email ">{{telephone.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="internal ">{{telephone.internal}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(telephone, $event    )" translate="STAFF.EDIT_TELEPHONE">\n                          Edit Telephone\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(telephone, $event    )" translate="STAFF.DELETE_TELEPHONE">\n                          Delete Telephone\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.telephones.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TELEPHONE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TELEPHONE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-telephone-button" ng-click="vm.createOrEditTelephone($event)" aria-label="add telephone" translate translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TELEPHONE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/userProfiles/create/dialog.html",'<md-dialog class="userProfile-dialog" aria-label="New UserProfile">\n  <form name="userProfileForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n        <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.userProfile.description">\n\n        <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n        <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n          <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n          <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n          <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n        <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUserProfile" ng-click="vm.saveUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid || userProfileForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUserProfile" ng-click="vm.addNewUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USERPROFILE" translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n          ADD USERPROFILE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUserProfile" ng-click="vm.deleteUserProfile($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/clone/clone.html",'<md-dialog class="userProfile-dialog" aria-label="Clone UserProfile">\n  <form name="userProfileForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n        <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.userProfile.description">\n\n        <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n        <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n          <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n          <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n          <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n        <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="CLONE" translate="STAFF.CLONE_USERPROFILE" translate-attr-aria-label="STAFF.CLONE_USERPROFILE">\n        CLONE USERPROFILE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",'<md-dialog class="userProfile-dialog" aria-label="userProfile">\n  <form name="userProfileForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2>{{vm.title}}</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog($event)">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div layout="column" class="padding-bottom-10">\n        <div layout="row" class="padding-bottom-10">\n          <md-input-container flex class="no-margin">\n            <label translate="STAFF.SECTIONS">Sections</label>\n            <md-select name="sections" ng-model="vm.selectedSection" placeholder="{{\'STAFF.PERMISSIONS_SELECT_SECTION\' | translate}}" ng-change="vm.onChangeSection()" required>\n              <md-option ng-value="subsection" ng-repeat="subsection in vm.subsections" ng-selected="{{vm.subsections.length === 1 ? \'true\' : \'false\'}}">{{subsection.translate | translate}}</md-option>\n            </md-select>\n          </md-input-container>\n          <div layout="row" ng-show="vm.selectedSection" class="margin-left-10">\n            <md-button ng-switch="vm.selectedSection.enabled" class="md-icon-button md-fab md-mini size-8 padding-10" ng-class="vm.selectedSection.enabled ? \'blue-500-bg\' : \'grey-A400-bg\'" ng-click="vm.onChangeVisibility()" aria-label="Visibility">\n              <md-icon ng-switch-when="true" md-font-icon="icon-eye" aria-label="Visible section">\n                <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_HIDE\' | translate}}</md-tooltip>\n              </md-icon>\n              <md-icon ng-switch-when="false" md-font-icon="icon-eye-off" aria-label="Hidden section">\n                <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_SHOW\' | translate}}</md-tooltip>\n              </md-icon>\n            </md-button>\n            <div>\n              <md-button class="md-icon-button md-fab md-mini size-8 green-A700-bg no-margin" ng-disabled="true">\n                <md-icon md-font-icon="icon-monitor" class="md-background-fg" aria-label="Read permission">\n                  <md-tooltip>{{\'STAFF.READ_PERMISSION\' | translate}}</md-tooltip>\n                </md-icon>\n              </md-button>\n              <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowEdit ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'edit\')">\n                <md-icon md-font-icon="icon-pencil" aria-label="Edit permission">\n                  <md-tooltip>{{\'STAFF.EDIT_PERMISSION\' | translate}}</md-tooltip>\n                </md-icon>\n              </md-button>\n              <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowDelete ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'delete\')">\n                <md-icon md-font-icon="icon-delete" aria-label="Delete permission">\n                  <md-tooltip>{{\'STAFF.DELETE_PERMISSION\' | translate}}</md-tooltip>\n                </md-icon>\n              </md-button>\n            </div>\n          </div>\n        </div>\n        <div layout="row" ng-show="vm.selectedSection" class="margin-left-10" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n          <md-switch ng-model="vm.selectedSection.autoAssociation" class="no-margin padding-right-10" aria-label="Auto association" ng-change="vm.onChangeAutoAssociation()">\n          </md-switch>\n          <p class="no-margin font-size-12 line-height-30">{{\'STAFF.PERMISSIONS_AUTO_ASSOCIATION_INFO\' | translate}}</p>\n        </div>\n        <div layout="row" ng-show="vm.selectedSection && vm.selectedSection.title === \'Reports\' && !vm.selectedSection.autoAssociation" class="margin-bottom-10 margin-top-30" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n          <md-input-container flex class="no-margin">\n            <label translate="STAFF.REPORT_TYPE">Report Type</label>\n            <md-select name="type" ng-model="vm.selectedSection.reportType" placeholder="{{\'STAFF.PERMISSIONS_SELECT_REPORT_TYPE\' | translate}}" ng-change="vm.onChangeReportType()" required>\n              <md-option ng-value="\'default\'">Default</md-option>\n              <md-option ng-value="\'custom\'">Custom</md-option>\n            </md-select>\n          </md-input-container>\n        </div>\n        <div ng-show="vm.selectedSection && vm.selectedSection.title === \'Dashboards\'" class="user-profile-section-help margin-bottom-10 margin-top-20">\n          <md-icon md-font-icon="icon-help" aria-label="Dashboards help"></md-icon>\n          <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.CUSTOM_DASHBOARDS_PERMISSIONS"></span>\n        </div>\n      </div>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association" ng-hide="vm.selectedSection.autoAssociation"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center">\n      <div>\n        <md-icon md-font-icon="icon-information-outline" aria-label="Delete permission"></md-icon>\n        <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.SAVE_PERMISSIONS"></span>\n      </div>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveSection()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/view.html",'<div id="staff-userProfile" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-userProfiles-button md-icon-button" aria-label="Go to userProfiles" ng-click="vm.gotoUserProfiles()" translate translate-attr-aria-label="STAFF.GO_TO_USERPROFILES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="userProfile-image" hide-xs>\n          <img ng-src="assets/images/business/userProfiles.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.userProfile.id}}\n            <span ng-if="vm.userProfile.name">{{vm.userProfile.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="STAFF.CREATED_AT"></span> <span>{{vm.userProfile.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.userProfile, $event)" class="md-fab md-amber-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="STAFF.CLONE_USERPROFILE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveUserProfile()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (modulesForm.$invalid) || (download_permissionsForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="userProfile-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.userProfile.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n                <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n                  <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n                  <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'crudPermissions\'].$error" ng-show="generalForm[\'crudPermissions\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="userProfile-detail-form-container modules md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.MODULES">MODULES</div>\n            </div>\n            <div ng-controller="UserProfilePermissionsController as vm_pc" ng-init="vm_pc.init(vm.userProfile, vm.license)" class="userProfile-detail-form-container">\n              <md-grid-list flex md-cols-gt-xs="2" md-cols-gt-sm="2" md-cols-gt-md="4" md-cols-gt-lg="6" md-row-height-gt-xs="2:1" md-row-height-gt-sm="3:1" md-row-height-gt-md="3:1" gt-xs-gutter="4px" gt-sm-gutter="4px" gt-md-gutter="16px" gt-lg-gutter="16px">\n                <md-grid-tile ng-repeat="father in vm_pc.modules" ng-if="vm_pc.userProfile.role !== \'admin\' && !father.permissions.hidden" md-colspan="2">\n                  <md-card flex-xs flex-gt-xs="90" layout="column" no-padding no-margin>\n                    <md-card-header>\n                      <md-card-avatar>\n                        <md-icon class="md-avatar-icon auto-size" md-font-icon="{{father.icon}}" ng-class="{ true: father.status.color }[true]">\n                          <md-tooltip>{{ father.status.info }}</md-tooltip>\n                        </md-icon>\n                      </md-card-avatar>\n                      <md-card-header-text layout-align="center start">\n                        <span class="md-title" translate="{{father.translate}}">{{ father.title }}</span>\n                      </md-card-header-text>\n                      <md-card-actions class="no-margin" layout="row" ng-init="vm_pc.checkSectionResources(father)" ng-if="father.status.tag != \'unlicensed\'">\n                        <md-switch class="auto-height no-margin" ng-model="father.allResourcesEnabled" ng-change="vm_pc.onChangeEnableAllResources(father)" aria-label="Enable all"></md-switch>\n                        <md-button class="md-mini auto-width" aria-label="Manage" ng-click="vm_pc.manageResources(father)" ng-hide="father.permissions && !father.permissions.association">\n                          <md-tooltip>{{\'STAFF.PERMISSIONS_MANAGE\' | translate}}\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-cog"></md-icon>\n                        </md-button>\n                      </md-card-actions>\n                      <md-card-header-text ng-if="father.status.tag === \'unlicensed\'" layout-align="center end">\n                        <span class="md-subhead red-A700-fg">{{ father.status.name }}</span>\n                      </md-card-header-text>\n                    </md-card-header>\n                  </md-card>\n                </md-grid-tile>\n              </md-grid-list>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.DOWNLOADS">DOWNLOADS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="userProfile-detail-form-container download_permissions md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.DOWNLOAD_PERMISSIONS">DOWNLOAD_PERMISSIONS</div>\n            </div>\n            <form name="download_permissionsForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadAttachments" aria-label="Attachments" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ATTACHMENTS">Attachments</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadCallySquareRecordings" aria-label="CallySquare_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CALLYSQUARE_RECORDINGS">CallySquare_Recordings</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadContactManagerLists" aria-label="Contact_Manager_Lists" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CONTACT_MANAGER_LISTS">Contact_Manager_Lists</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadJscriptySessions" aria-label="Jscripty_Sessions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.JSCRIPTY_SESSIONS">Jscripty_Sessions</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadOmnichannelInteractions" aria-label="Omnichannel_Interactions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.OMNICHANNEL_INTERACTIONS">Omnichannel_Interactions</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadScreenRecordings" aria-label="Screen_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.SCREEN_RECORDINGS">Screen_Recordings</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadVoiceRecordings" aria-label="Voice_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.VOICE_RECORDINGS">Voice_Recordings</span></md-switch>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/userProfiles/userProfiles.html",'<div id="userProfiles" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.USERPROFILES">UserProfiles</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedUserProfiles.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedUserProfiles =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-userProfiles-count">\n          <span>{{vm.selectedUserProfiles.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllUserProfiles()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectUserProfiles()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedUserProfiles" csv-label="true" filename="userProfiles.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedUserProfiles($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- USERPROFILE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedUserProfiles" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUserProfiles">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="crudPermissions">{{ \'STAFF.CRUDPERMISSIONS\' | translate }}</th>\n                <th md-column md-order-by="privacyEnabled">{{ \'STAFF.MASK_SENSITIVE_DATA\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.userProfiles.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="userProfile" md-select-id="id" ng-repeat="userProfile in vm.userProfiles.rows">\n                <td md-cell ng-if="userProfile.userpic"><img class="avatar" alt="{{userProfile.name}}" ng-src="api/users/{{userProfile.id}}/avatar" /></td>\n                <td md-cell ng-if="!userProfile.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{userProfile.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="id ">{{userProfile.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="name ">{{userProfile.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="description ">{{userProfile.description}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="crudPermissions ">{{userProfile.selectedcrudPermissions}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="privacyEnabled ">\n                  <md-icon md-colors="{color: {{userProfile.privacyEnabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{userProfile.privacyEnabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(userProfile, $event    )" translate="STAFF.EDIT_USERPROFILE">\n                          Edit UserProfile\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(userProfile, $event    )" translate="STAFF.CLONE_USERPROFILE">\n                          clone UserProfile\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n\n                        <md-button ng-click="vm.deleteconfirm(userProfile, $event    )" translate="STAFF.DELETE_USERPROFILE">\n                          Delete UserProfile\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.userProfiles.count}}" md-on-paginate="vm.getUserProfiles" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / USERPROFILE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD USERPROFILE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-userProfile-button" ng-click="vm.createOrEditUserProfile($event)" aria-label="add userProfile" translate translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD USERPROFILE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/create/dialog.html",'<md-dialog class="user-dialog" aria-label="New User">\n  <form name="userForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.ROLE">Role</label>\n        <md-select name="role" ng-model="vm.user.role" autofocus required ng-disabled="!vm.newUser">\n          <md-option ng-value="\'admin\'">Admin</md-option>\n          <md-option ng-value="\'user\'">User</md-option>\n        </md-select>\n        <div ng-messages="userForm[\'role\'].$error" ng-show="userForm[\'role\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n        <label translate="STAFF.USERPROFILE">UserProfile</label>\n        <md-select name="userProfileId" ng-model="vm.user.userProfileId" required>\n          <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n        </md-select>\n        <div ng-messages="userForm[\'userProfileId\'].$error" ng-show="userForm[\'userProfileId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.FULLNAME">Fullname</label>\n        <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n\n        <div ng-messages="userForm[\'fullname\'].$error" ng-show="userForm[\'fullname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.USERNAME">Username</label>\n        <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newUser">\n\n        <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n        <div ng-messages="userForm[\'name\'].$error" ng-show="userForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n\n        <div ng-messages="userForm[\'email\'].$error" ng-show="userForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newUser">\n        <label translate="STAFF.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.user.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n        <div ng-messages="userForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newUser  && (vm.newUser)">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n        <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.user.description">\n\n        <div ng-messages="userForm[\'description\'].$error" ng-show="userForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newUser" class="md-block">\n        <md-switch ng-model="vm.user.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n        <label translate="STAFF.INTERNAL">Internal</label>\n        <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" ng-disabled="!vm.newUser">\n\n        <div ng-messages="userForm[\'internal\'].$error" ng-show="userForm[\'internal\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.user.userSetting">\n        <ms-client-side-logging user="vm.user"></ms-client-side-logging>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUser" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUser" ng-click="vm.addNewUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USER" translate-attr-aria-label="STAFF.ADD_USER">\n          ADD USER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUser" ng-click="vm.deleteUser($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n  <form name="userForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'\n                    STAFF.MANAGE_API_KEY\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-card layout-fill layout-padding>\n      <textarea class="api-key-area" ng-model="vm.user.apiKey" rows="6" disabled></textarea>\n    </md-card>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.generateApiKey()" class="send-button md-accent md-raised" aria-label="Generate" translate="{{ vm.user.apiKey === \'N/A\' ? \'STAFF.GENERATE\' : \'STAFF.REGENERATE\' }}" translate-attr-aria-label="STAFF.GENERATE">\n          Generate\n        </md-button>\n        <md-button type="submit" ng-click="vm.removeApiKey()" class="send-button md-accent md-raised" aria-label="Remove" translate="STAFF.REMOVE" translate-attr-aria-label="STAFF.DELETE">\n          Delete\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n  <form name="userForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'\n                    STAFF.CHANGE_PASSWORD\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n        <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n        <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n        <div ng-messages="userForm.oldPassword.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NEW_PASSWORD">New Password</label>\n        <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n        <div ng-messages="userForm.password.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n              required</span>\n          </div>\n\n\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n              at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n              character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n          <div ng-message="oldPasswordMatch">\n            <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n          </div>\n\n\n\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n        <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n              required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n              not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/view.html",'<div id="staff-user" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-users-button md-icon-button" aria-label="Go to users" ng-click="vm.gotoUsers()" translate translate-attr-aria-label="STAFF.GO_TO_USERS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="user-image" hide-xs>\n          <img ng-src="assets/images/business/users.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.user.id}}\n            <span ng-if="vm.user.name">{{vm.user.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="STAFF.CREATED_AT"></span> <span>{{vm.user.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.apikeymanagerdialog(vm.user, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="apikeymanager">\n        <md-tooltip><span translate="STAFF.APIKEYMANAGER_USER"></span></md-tooltip>\n        <md-icon md-font-icon="fab fa-hubspot"></md-icon>\n      </md-button>\n    </div>\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.changepassworddialog(vm.user, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n        <md-tooltip><span translate="STAFF.CHANGEPASSWORD_USER"></span></md-tooltip>\n        <md-icon md-font-icon="icon-key-variant"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveUser()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="user-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n            </div>\n            <form name="personal_infoForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ROLE">Role</label>\n                <md-select name="role" ng-model="vm.user.role" autofocus required disabled>\n                  <md-option ng-value="\'admin\'">Admin</md-option>\n                  <md-option ng-value="\'user\'">User</md-option>\n                </md-select>\n                <div ng-messages="personal_infoForm[\'role\'].$error" ng-show="personal_infoForm[\'role\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n                <label translate="STAFF.USERPROFILE">UserProfile</label>\n                <md-select name="userProfileId" ng-model="vm.user.userProfileId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n                </md-select>\n                <div ng-messages="personal_infoForm[\'userProfileId\'].$error" ng-show="personal_infoForm[\'userProfileId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.FULLNAME">Fullname</label>\n                <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.USERNAME">Username</label>\n                <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n                <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n                <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.user.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.user.phone" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.MOBILE">Mobile</label>\n                <input type="text" name="mobile" ng-model="vm.user.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.user.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="user-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n            </div>\n            <form name="security_suiteForm" novalidate>\n              <md-input-container ng-if="vm.user.passwordResetAt != null" class="md-block">\n                <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n                <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" autofocus disabled>\n                <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n                <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.user.passwordResetAt == null" class="md-block">\n                <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n                <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" disabled>\n                <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.APIKEY">ApiKey</label>\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-apiKey" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: \'API Key copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-apiKey" name="apiKey" ng-model="vm.user.apiKey" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="STAFF.HELP.APIKEY"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.user.id != vm.currentUser.id && vm.currentUser.role == \'admin\'" class="md-block">\n                <md-switch ng-model="vm.user.disabled" aria-label="Disabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DISABLED">Disabled</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.DISABLED"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.user.id != vm.currentUser.id && vm.currentUser.role == \'admin\' && vm.user.disabled == 0" class="md-block">\n                <md-switch ng-model="vm.user.blocked" aria-label="Blocked" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.BLOCKED">Blocked</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.BLOCKED"></span></div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="user-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.AUTHENTICATION">AUTHENTICATION</div>\n            </div>\n            <form name="authenticationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.user.adSsoEnabled" aria-label="AD_SSO_Enabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AD_SSO_ENABLED">AD_SSO_Enabled</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.AD_SSO_ENABLED"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="user-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n            </div>\n            <div ng-controller="Userchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.user, vm.crudPermissions)" class="user-detail-form-container md-background-bg md-whiteframe-1dp">\n              <div id="user-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="change_avatarimage in vm_ca.user.images" ng-switch="change_avatarimage.type">\n                    <div class="user-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="change_avatarimage.file">\n                    </div>\n                    <div class="user-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{change_avatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.VOICE">VOICE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="user-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n                <label translate="STAFF.INTERNAL">Internal</label>\n                <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" autofocus disabled>\n                <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.TRANSPORT">Transport</label>\n                <md-select name="transport" ng-model="vm.user.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'udp\'">udp</md-option>\n                  <md-option ng-value="\'tcp\'">tcp</md-option>\n                  <md-option ng-value="\'ws\'">ws</md-option>\n                  <md-option ng-value="\'wss\'">wss</md-option>\n                  <md-option ng-value="\'tls\'">tls</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.NAT">NAT</label>\n                <md-select name="nat" ng-model="vm.user.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'force_rport\'">force_rport</md-option>\n                  <md-option ng-value="\'comedia\'">comedia</md-option>\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'never\'">never</md-option>\n                  <md-option ng-value="\'route\'">route</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n                <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n                <md-select name="allow" ng-model="vm.user.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ulaw\'">ulaw</md-option>\n                  <md-option ng-value="\'alaw\'">alaw</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                  <md-option ng-value="\'g722\'">g722</md-option>\n                  <md-option ng-value="\'g729\'">g729</md-option>\n                  <md-option ng-value="\'opus\'">opus</md-option>\n                  <md-option ng-value="\'h264\'">h264</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n                <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.user.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLGROUP">Callgroup</label>\n                <input type="text" name="callgroup" ng-model="vm.user.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n                <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n                <input type="text" name="pickupgroup" ng-model="vm.user.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n                <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n                <md-select name="videosupport" ng-model="vm.user.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'always\'">Always</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.CLIENT_LOGS">CLIENT-SIDE LOGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="user-detail-form-container client_logs md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CLIENT_LOGS">\n                CLIENT-SIDE LOGS\n              </div>\n            </div>\n            <ms-client-side-logging user="vm.user" on-user-update="vm.refreshUser()"></ms-client-side-logging>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/users.html",'<div id="users" class="page-layout simple left-sidenav inner-sidenav">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.USERS">Users</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedUsers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedUsers =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-users-count">\n          <span>{{vm.selectedUsers.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllUsers()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectUsers()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedUsers" csv-label="true" filename="users.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- USER TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedUsers" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUsers">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="role">{{ \'STAFF.ROLE\' | translate }}</th>\n                <th md-column md-order-by="userProfileId">{{ \'STAFF.USERPROFILE\' | translate }}</th>\n                <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n                <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n                <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n                <th md-column md-order-by="disabled">{{ \'STAFF.DISABLED\' | translate }}</th>\n                <th md-column md-order-by="blocked">{{ \'STAFF.BLOCKED\' | translate }}</th>\n                <th md-column>{{ \'STAFF.CLIENT_LOGS\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.users.rows.length">\n                <td md-cell colspan="11">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="user" md-select-id="id" ng-repeat="user in vm.users.rows">\n                <td md-cell ng-if="user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="api/users/{{user.id}}/avatar" /></td>\n                <td md-cell ng-if="!user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="role ">{{ vm.arrayrole[user.role].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="userProfileId font-weight-600">{{ (vm.userProfiles | filter : {\'id\':user.userProfileId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="fullname font-weight-600">{{user.fullname}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="name ">{{user.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="email ">{{user.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="phone ">{{user.phone}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="mobile ">{{user.mobile}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="internal ">{{user.internal}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="disabled ">\n                  <md-icon md-colors="{color: {{user.disabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{user.disabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="blocked ">\n                  <md-icon md-colors="{color: {{user.blocked ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{user.blocked ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditAgent($event, user)" md-cell class="client-side-logging">\n                  <ms-client-side-logging-icon user="user"></ms-client-side-logging-icon>\n                </td>\n                <td md-cell class="actions">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editstate(user, $event    )" translate="STAFF.EDIT_USER">\n                          Edit User\n                        </md-button>\n                      </md-menu-item>\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n                        <md-button ng-click="vm.deleteconfirm(user, $event    )" translate="STAFF.DELETE_USER">\n                          Delete User\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.users.count}}" md-on-paginate="vm.getUsers" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / USER TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD USER BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-user-button" ng-click="vm.createOrEditUser($event)" aria-label="add user" translate translate-attr-aria-label="STAFF.ADD_USER">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",'<div id="cannedAnswers" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.CANNEDANSWERS">CannedAnswers</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedCannedAnswers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedCannedAnswers =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-cannedAnswers-count">\n          <span>{{vm.selectedCannedAnswers.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllCannedAnswers()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectCannedAnswers()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedCannedAnswers" csv-label="true" filename="cannedAnswers.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CANNEDANSWER TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedCannedAnswers" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCannedAnswers">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'TOOLS.KEY\' | translate }}</th>\n                <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.cannedAnswers.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="cannedAnswer" md-select-id="id" ng-repeat="cannedAnswer in vm.cannedAnswers.rows">\n                <td md-cell ng-if="cannedAnswer.userpic"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="api/users/{{cannedAnswer.id}}/avatar" /></td>\n                <td md-cell ng-if="!cannedAnswer.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="id ">{{cannedAnswer.id}}</td>\n                <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="key ">{{cannedAnswer.key}}</td>\n                <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="value ">{{cannedAnswer.value}}</td>\n                <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="description ">{{cannedAnswer.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(cannedAnswer, $event    )" translate="TOOLS.EDIT_CANNEDANSWER">\n                          Edit CannedAnswer\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(cannedAnswer, $event    )" translate="TOOLS.DELETE_CANNEDANSWER">\n                          Delete CannedAnswer\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cannedAnswers.count}}" md-on-paginate="vm.getCannedAnswers" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CANNEDANSWER TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CANNEDANSWER BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-cannedAnswer-button" ng-click="vm.createOrEditCannedAnswer($event)" aria-label="add cannedAnswer" translate translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CANNEDANSWER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/create/dialog.html",'<md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">\n  <form name="cannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.cannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="cannedAnswerForm[\'key\'].$error" ng-show="cannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="TOOLS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 255}\'>Key must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.cannedAnswer.value" required></textarea>\n\n        <div ng-messages="cannedAnswerForm[\'value\'].$error" ng-show="cannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.cannedAnswer.description">\n\n        <div ng-messages="cannedAnswerForm[\'description\'].$error" ng-show="cannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCannedAnswer" ng-click="vm.saveCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCannedAnswer" ng-click="vm.addNewCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CANNEDANSWER" translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n          ADD CANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCannedAnswer" ng-click="vm.deleteCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/create/dialog.html",'<md-dialog class="customDashboard-dialog" aria-label="New CustomDashboard">\n  <form name="customDashboardForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n        <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.customDashboard.description">\n\n        <div ng-messages="customDashboardForm[\'description\'].$error" ng-show="customDashboardForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomDashboard" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid || customDashboardForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomDashboard" ng-click="vm.addNewCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n          ADD CUSTOMDASHBOARD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomDashboard" ng-click="vm.deleteCustomDashboard($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/customDashboards.html",'<div id="customDashboards" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.CUSTOMDASHBOARDS">CustomDashboards</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedCustomDashboards.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedCustomDashboards =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-customDashboards-count">\n          <span>{{vm.selectedCustomDashboards.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllCustomDashboards()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectCustomDashboards()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedCustomDashboards" csv-label="true" filename="customDashboards.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCustomDashboards($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CUSTOMDASHBOARD TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedCustomDashboards" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCustomDashboards">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.customDashboards.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="customDashboard" md-select-id="id" ng-repeat="customDashboard in vm.customDashboards.rows">\n                <td md-cell ng-if="customDashboard.userpic"><img class="avatar" alt="{{customDashboard.name}}" ng-src="api/users/{{customDashboard.id}}/avatar" /></td>\n                <td md-cell ng-if="!customDashboard.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{customDashboard.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="id ">{{customDashboard.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="name ">{{customDashboard.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="description ">{{customDashboard.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(customDashboard, $event    )" translate="TOOLS.EDIT_CUSTOMDASHBOARD">\n                          Edit CustomDashboard\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(customDashboard, $event    )" translate="TOOLS.CLONE_CUSTOMDASHBOARD">\n                          clone CustomDashboard\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotodashboardgoto(customDashboard, $event    )" translate="TOOLS.GOTODASHBOARD_CUSTOMDASHBOARD">\n                          goToDashboard CustomDashboard\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(customDashboard, $event    )" translate="TOOLS.DELETE_CUSTOMDASHBOARD">\n                          Delete CustomDashboard\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.customDashboards.count}}" md-on-paginate="vm.getCustomDashboards" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CUSTOMDASHBOARD TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CUSTOMDASHBOARD BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-customDashboard-button" ng-click="vm.createOrEditCustomDashboard($event)" aria-label="add customDashboard" translate translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CUSTOMDASHBOARD BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/customDashboards/edit/clone/clone.html",'<md-dialog class="customDashboard-dialog" aria-label="Clone CustomDashboard">\n  <form name="customDashboardForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n        <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.CLONE_CUSTOMDASHBOARD">\n        CLONE CUSTOMDASHBOARD\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",'<md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">\n  <form name="dashboarditemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.dashboarditem.type" ng-change="vm.onTypeChange()" autofocus ng-disabled="!vm.newDashboardItem">\n\n          <md-option ng-value="\'counter\'"> {{ \'TOOLS.COUNTER\' | translate }} </md-option>\n\n          <md-option ng-value="\'multibar-chart\'"> {{ \'TOOLS.MULTIBARCHART\' | translate }} </md-option>\n\n          <md-option ng-value="\'pie-chart\'"> {{ \'TOOLS.PIECHART\' | translate }} </md-option>\n\n          <md-option ng-value="\'web-report\'"> {{ \'TOOLS.WEBREPORT\' | translate }} </md-option>\n\n          <md-option ng-value="\'iframe\'"> {{ \'TOOLS.IFRAME\' | translate }} </md-option>\n\n          <md-option ng-value="\'clock\'"> {{ \'TOOLS.CLOCK\' | translate }} </md-option>\n\n          <md-option ng-value="\'custom\'"> {{ \'TOOLS.CUSTOMTYPE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'type\'].$error" ng-show="dashboarditemForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\',\'counter\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.CHANNEL">Channel</label>\n        <md-select name="attrChannel" ng-model="vm.dashboarditem.attrChannel" required>\n\n          <md-option ng-value="\'chat\'"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n\n          <md-option ng-value="\'mail\'"> {{ \'TOOLS.EMAIL\' | translate }} </md-option>\n\n          <md-option ng-value="\'sms\'"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n\n          <md-option ng-value="\'openchannel\'"> {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n\n          <md-option ng-value="\'fax\'"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n\n          <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n\n          <md-option ng-value="\'whatsapp\'"> {{ \'TOOLS.WHATSAPP\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrChannel\'].$error" ng-show="dashboarditemForm[\'attrChannel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="![\'web-report\', \'iframe\',\'clock\', \'custom\'].includes(vm.dashboarditem.type)">\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'mail\'" class="md-block">\n          <label translate="TOOLS.FILTEREMAILACCOUNTS">FilterEmailAccounts</label>\n          <md-select name="attrEmailAccounts" ng-model="vm.dashboarditem.attrEmailAccounts" multiple>\n            <md-option ng-value="attrEmailAccounts.id" ng-repeat="attrEmailAccounts in vm.mailAccount" ng-disabled="attrEmailAccounts.canSelect === false">{{ attrEmailAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrEmailAccounts\'].$error" ng-show="dashboarditemForm[\'attrEmailAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTEREMAILACCOUNTS_REQUIRED">FilterEmailAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'fax\'" class="md-block">\n          <label translate="TOOLS.FILTERFAXACCOUNTS">FilterFaxAccounts</label>\n          <md-select name="attrFaxAccounts" ng-model="vm.dashboarditem.attrFaxAccounts" multiple>\n            <md-option ng-value="attrFaxAccounts.id" ng-repeat="attrFaxAccounts in vm.faxAccount" ng-disabled="attrFaxAccounts.canSelect === false">{{ attrFaxAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrFaxAccounts\'].$error" ng-show="dashboarditemForm[\'attrFaxAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTERFAXACCOUNTS_REQUIRED">FilterFaxAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'sms\'" class="md-block">\n          <label translate="TOOLS.FILTERSMSACCOUNTS">FilterSmsAccounts</label>\n          <md-select name="attrSmsAccounts" ng-model="vm.dashboarditem.attrSmsAccounts" multiple>\n            <md-option ng-value="attrSmsAccounts.id" ng-repeat="attrSmsAccounts in vm.smsAccount" ng-disabled="attrSmsAccounts.canSelect === false">{{ attrSmsAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrSmsAccounts\'].$error" ng-show="dashboarditemForm[\'attrSmsAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTERSMSACCOUNTS_REQUIRED">FilterSmsAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'openchannel\'" class="md-block">\n          <label translate="TOOLS.FILTEROPENCHANNELACCOUNTS">FilterOpenchannelAccounts</label>\n          <md-select name="attrOpenchannelAccounts" ng-model="vm.dashboarditem.attrOpenchannelAccounts" multiple>\n            <md-option ng-value="attrOpenchannelAccounts.id" ng-repeat="attrOpenchannelAccounts in vm.openchannelAccount" ng-disabled="attrOpenchannelAccounts.canSelect === false">{{ attrOpenchannelAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrOpenchannelAccounts\'].$error" ng-show="dashboarditemForm[\'attrOpenchannelAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTEROPENCHANNELACCOUNTS_REQUIRED">FilterOpenchannelAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'whatsapp\'" class="md-block">\n          <label translate="TOOLS.FILTERWHATSAPPACCOUNTS">FilterWhatsappAccounts</label>\n          <md-select name="attrWhatsappAccounts" ng-model="vm.dashboarditem.attrWhatsappAccounts" multiple>\n            <md-option ng-value="attrWhatsappAccounts.id" ng-repeat="attrWhatsappAccounts in vm.whatsappAccount" ng-disabled="attrWhatsappAccounts.canSelect === false">{{ attrWhatsappAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrWhatsappAccounts\'].$error" ng-show="dashboarditemForm[\'attrWhatsappAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTERWHATSAPPACCOUNTS_REQUIRED">FilterWhatsappAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'chat\'" class="md-block">\n          <label translate="TOOLS.FILTERCHATWEBSITES">FilterChatWebsites</label>\n          <md-select name="attrChatWebsites" ng-model="vm.dashboarditem.attrChatWebsites" multiple>\n            <md-option ng-value="attrChatWebsites.id" ng-repeat="attrChatWebsites in vm.chatWebsite" ng-disabled="attrChatWebsites.canSelect === false">{{ attrChatWebsites.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrChatWebsites\'].$error" ng-show="dashboarditemForm[\'attrChatWebsites\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTERCHATWEBSITES_REQUIRED">FilterChatWebsites field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TITLE">Title</label>\n        <input type="text" name="title" ng-model="vm.dashboarditem.title" md-maxlength="255" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'title\'].$error" ng-show="dashboarditemForm[\'title\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TITLE_REQUIRED">Title field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="TOOLS.ERRORS.TITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>Title must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TITLEFONTSIZE">TitleFontSize</label>\n        <input type="number" name="titleFontSize" ng-model="vm.dashboarditem.titleFontSize" value="12">\n\n        <div ng-messages="dashboarditemForm[\'titleFontSize\'].$error" ng-show="dashboarditemForm[\'titleFontSize\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TITLEFONTSIZE_REQUIRED">TitleFontSize field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'iframe\'" class="md-block">\n        <label translate="TOOLS.URL">Url</label>\n        <input type="url" name="attrUrl" ng-model="vm.dashboarditem.attrUrl" value="https://" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrUrl\'].$error" ng-show="dashboarditemForm[\'attrUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'custom\'" class="md-block">\n        <label translate="TOOLS.PATH">Path</label>\n        <input type="text" name="attrPath" ng-model="vm.dashboarditem.attrPath" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrPath\'].$error" ng-show="dashboarditemForm[\'attrPath\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.PATH_REQUIRED">Path field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n        <label translate="TOOLS.FORMAT">Format</label>\n        <input type="text" name="attrHourFormat" ng-model="vm.dashboarditem.attrHourFormat" value="HH:mm:ss" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrHourFormat\'].$error" ng-show="dashboarditemForm[\'attrHourFormat\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n        <label translate="TOOLS.TIMEZONE">Timezone</label>\n        <md-select name="attrTimezone" ng-model="vm.dashboarditem.attrTimezone" required>\n          <md-option ng-value="\'-12.00\'">GMT-12.00</md-option>\n          <md-option ng-value="\'-11.00\'">GMT-11.00</md-option>\n          <md-option ng-value="\'-10.00\'">GMT-10.00</md-option>\n          <md-option ng-value="\'-9.00\'">GMT-9.00</md-option>\n          <md-option ng-value="\'-8.00\'">GMT-8.00</md-option>\n          <md-option ng-value="\'-7.00\'">GMT-7.00</md-option>\n          <md-option ng-value="\'-6.00\'">GMT-6.00</md-option>\n          <md-option ng-value="\'-5.00\'">GMT-5.00</md-option>\n          <md-option ng-value="\'-4.00\'">GMT-4.00</md-option>\n          <md-option ng-value="\'-3.30\'">GMT-3.30</md-option>\n          <md-option ng-value="\'-3.00\'">GMT-3.00</md-option>\n          <md-option ng-value="\'-2.00\'">GMT-2.00</md-option>\n          <md-option ng-value="\'-1.00\'">GMT-1.00</md-option>\n          <md-option ng-value="\'0.00\'">GMT 0.00</md-option>\n          <md-option ng-value="\'1.00\'">GMT+1.00</md-option>\n          <md-option ng-value="\'2.00\'">GMT+2.00</md-option>\n          <md-option ng-value="\'3.00\'">GMT+3.00</md-option>\n          <md-option ng-value="\'3.30\'">GMT+3.30</md-option>\n          <md-option ng-value="\'4.00\'">GMT+4.00</md-option>\n          <md-option ng-value="\'4.30\'">GMT+4.30</md-option>\n          <md-option ng-value="\'5.00\'">GMT+5.00</md-option>\n          <md-option ng-value="\'5.30\'">GMT+5.30</md-option>\n          <md-option ng-value="\'5.45\'">GMT+5.45</md-option>\n          <md-option ng-value="\'6.00\'">GMT+6.00</md-option>\n          <md-option ng-value="\'6.30\'">GMT+6.30</md-option>\n          <md-option ng-value="\'7.00\'">GMT+7.00</md-option>\n          <md-option ng-value="\'8.00\'">GMT+8.00</md-option>\n          <md-option ng-value="\'9.00\'">GMT+9.00</md-option>\n          <md-option ng-value="\'9.30\'">GMT+9.30</md-option>\n          <md-option ng-value="\'10.00\'">GMT+10.00</md-option>\n          <md-option ng-value="\'11.00\'">GMT+11.00</md-option>\n          <md-option ng-value="\'12.00\'">GMT+12.00</md-option>\n          <md-option ng-value="\'13.00\'">GMT+13.00</md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrTimezone\'].$error" ng-show="dashboarditemForm[\'attrTimezone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type === \'counter\'" class="md-block">\n        <label translate="TOOLS.METRIC">Metric</label>\n        <md-select name="attrMetric" ng-model="vm.dashboarditem.attrMetric" required>\n\n          <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n          <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n          <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n          <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrMetric\'].$error" ng-show="dashboarditemForm[\'attrMetric\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.SERIE1">Serie1</label>\n        <md-select name="attrSerie1" ng-model="vm.dashboarditem.attrSerie1" required>\n\n          <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n          <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n          <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n          <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrSerie1\'].$error" ng-show="dashboarditemForm[\'attrSerie1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SERIE1_REQUIRED">Serie1 field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.SERIE2">Serie2</label>\n        <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">\n\n          <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n          <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n          <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n          <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n          <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrSerie2\'].$error" ng-show="dashboarditemForm[\'attrSerie2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SERIE2_REQUIRED">Serie2 field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.SERIE3">Serie3</label>\n        <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">\n\n          <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n          <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n          <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n          <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n          <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrSerie3\'].$error" ng-show="dashboarditemForm[\'attrSerie3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SERIE3_REQUIRED">Serie3 field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n        <label translate="TOOLS.REPORT">Report</label>\n        <input type="search" name="report" ng-model="vm.dashboarditem.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n        <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n        <div ng-messages="dashboarditemForm[\'report\'].$error" ng-show="dashboarditemForm[\'report\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n        <label translate="TOOLS.REFRESH">Refresh</label>\n        <input type="number" name="attrRefresh" ng-model="vm.dashboarditem.attrRefresh" min="5" value="10" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrRefresh\'].$error" ng-show="dashboarditemForm[\'attrRefresh\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.REFRESH_REQUIRED">Refresh field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Refresh must be a valid greater or equal than</span> <span>5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\', \'counter\'].includes(vm.dashboarditem.type) && vm.dashboarditem.attrChannel === \'voice\'" class="md-block">\n        <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>\n        <md-select name="attrVoiceQueues" ng-model="vm.dashboarditem.attrVoiceQueues" multiple>\n          <md-option ng-value="attrVoiceQueues.id" ng-repeat="attrVoiceQueues in vm.voiceQueues" ng-disabled="attrVoiceQueues.canSelect === false">{{ attrVoiceQueues.name }}</md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrVoiceQueues\'].$error" ng-show="dashboarditemForm[\'attrVoiceQueues\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED">FilterVoiceQueues field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'counter\', \'clock\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.FONTSIZE">FontSize</label>\n        <input type="number" name="attrFontSize" ng-model="vm.dashboarditem.attrFontSize" min="12" max="40" value="20" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrFontSize\'].$error" ng-show="dashboarditemForm[\'attrFontSize\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED">FontSize field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>12</span>\n          </div>\n          <div ng-message="max">\n            <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>40</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div flex md-color-picker ng-model="vm.dashboarditem.foreground" label="{{\'TOOLS.FOREGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n      <div flex md-color-picker ng-model="vm.dashboarditem.background" label="{{\'TOOLS.BACKGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.LINK">link</label>\n        <input type="url" name="link" ng-model="vm.dashboarditem.link">\n\n        <div ng-messages="dashboarditemForm[\'link\'].$error" ng-show="dashboarditemForm[\'link\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LINK_REQUIRED">link field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL">link must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDashboardItem" ng-click="vm.saveDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDashboardItem" ng-click="vm.addNewDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DASHBOARDITEM" translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM">\n          ADD DASHBOARDITEM\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDashboardItem" ng-click="vm.deleteDashboardItem($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/view.html",'<div id="tools-customDashboard" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-customDashboards-button md-icon-button" aria-label="Go to customDashboards" ng-click="vm.gotoCustomDashboards()" translate translate-attr-aria-label="TOOLS.GO_TO_CUSTOMDASHBOARDS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="customDashboard-image" hide-xs>\n          <img ng-src="assets/images/business/customDashboards.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.customDashboard.id}}\n            <span ng-if="vm.customDashboard.name">{{vm.customDashboard.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.customDashboard.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.customDashboard, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="TOOLS.CLONE_CUSTOMDASHBOARD"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.customDashboard, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="TOOLS.GOTO_CUSTOMDASHBOARD"></span></md-tooltip>\n        <md-icon md-font-icon="icon-forward"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveCustomDashboard()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (dashboardForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="customDashboard-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.customDashboard.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.DASHBOARD">DASHBOARD</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="customDashboard-detail-form-container dashboard md-background-bg md-whiteframe-1dp">\n            <div ng-controller="CustomDashboardItemsController as vm_cd" ng-init="vm_cd.init(vm.customDashboard, vm.crudPermissions)" class="customDashboard-detail-form-container no-padding no-margin" layout="column">\n              <div ng-if="vm_cd.customDashboard.widgets.length">\n                <md-button class="md-fab md-mini md-accent" ng-click="vm_cd.createOrEditWidget()" ng-if="vm_cd.crudPermissions.canEdit" aria-label="add item">\n                  <md-tooltip>{{ \'TOOLS.ADD_WIDGET\' | translate }}</md-tooltip>\n                  <md-icon md-font-icon="icon-plus"></md-icon>\n                </md-button>\n                <md-content flex>\n                  <ms-widget-engine config="vm_cd.customDashboard" on-edit="vm_cd.createOrEditWidget(widget)" on-delete="vm_cd.deleteWidget(widget)"></ms-widget-engine>\n                </md-content>\n              </div>\n              <div ng-if="!vm_cd.customDashboard.widgets.length" layout="row" layout-align="center center" flex>\n                <md-button class="width-130 height-130 md-accent md-raised" ng-click="vm_cd.createOrEditWidget()" aria-label="add item" layout="column">\n                  <md-icon md-font-icon="icon-plus-circle" class="s50"></md-icon>\n                  <span layout-wrap translate="TOOLS.ADD_WIDGET"></span>\n                </md-button>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n  <md-toolbar>\n    <div class="md-toolbar-tools">\n      <h2>Select Report</h2>\n      <span flex></span>\n      <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-dialog-content>\n    <div class="content" md-background-bg layout="row" layout-align="start start">\n      <div layout="column" flex="30">\n        <md-card class="padding-10 scrollable">\n          <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n        </md-card>\n        <md-card class="padding-10 scrollable">\n          <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n        </md-card>\n      </div>\n      <md-card flex="70">\n        <md-toolbar class="md-table-toolbar md-default">\n          <div class="md-toolbar-tools">\n            <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n            <p ng-if="vm.currentPath">\n              <span class="text-boxed">{{vm.currentPath}}</span>\n            </p>\n          </div>\n        </md-toolbar>\n        <md-table-container>\n          <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n              <tr md-row>\n                <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n                <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n                <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.reports.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n                <td md-cell class="id">{{ report.id }}</td>\n                <td md-cell class="name">{{ report.name }}</td>\n                <td md-cell class="description">{{ report.description }}</td>\n                <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n      </md-card>\n    </div>\n  </md-dialog-content>\n  <md-dialog-actions layout="row">\n    <span flex></span>\n    <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n    <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n  </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/create/dialog.html",'<md-dialog ng-init="vm.onInit()" class="disposition-dialog" aria-label="New Disposition">\n  <form name="dispositionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newDisposition ? \'TOOLS.NEW_DISPOSITION\' : \'TOOLS.EDIT_DISPOSITION\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.disposition.name" md-maxlength="255" required md-autofocus>\n        <div ng-messages="dispositionForm[\'name\'].$error" ng-show="dispositionForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="TOOLS.ERRORS.NAME_MAX_LENGTH" translate-values=\'{max: 255}\'>Name must have a maximum length\n              equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.disposition.description" md-maxlength="255">\n        <div ng-messages="dispositionForm[\'description\'].$error" ng-show="dispositionForm[\'description\'].$touched" role="alert">\n          <div ng-message="md-maxlength">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_MAX_LENGTH" translate-values=\'{max: 255}\'>Description must have a\n              maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.newDisposition && vm.dispositions.length > 0 || vm.disposition.ParentId" layout="row" layout-align="start center">\n        <md-input-container class="md-block" flex>\n          <label translate="TOOLS.FIRST_LEVEL_DISPOSITION">First Level Disposition</label>\n          <md-select name="firstLevelDisposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onFirstLevelSelection()">\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' }" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-button ng-if="vm.firstLevelDisposition" ng-click="vm.clearSelection(\'first\'); dispositionForm.$setDirty();" class="md-icon-button">\n          <md-icon md-font-icon="icon-cancel" aria-label="Clear first level disposition selection">\n          </md-icon>\n        </md-button>\n      </div>\n      <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n        <md-input-container class="md-block" flex>\n          <label translate="TOOLS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n          <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition">\n            <md-option ng-value="disposition" ng-if="disposition.id != vm.disposition.id" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id }" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearSelection(\'second\'); dispositionForm.$setDirty();" class="md-icon-button">\n          <md-icon md-font-icon="icon-cancel" aria-label="Clear first level disposition selection">\n          </md-icon>\n        </md-button>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDisposition" ng-click="vm.saveDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid || dispositionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDisposition" ng-click="vm.addNewDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DISPOSITION" translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n          ADD DISPOSITION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDisposition" ng-click="vm.deleteDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/dispositions.html",'<div id="dispositions" class="page-layout simple left-sidenav inner-sidenav">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.DISPOSITIONS">Dispositions</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedDispositions.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedDispositions = []">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-dispositions-count">\n          <span>{{vm.selectedDispositions.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllDispositions()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectDispositions()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedDispositions" csv-label="true" filename="dispositions.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n      <div layout="row">\n        <div class="column" flex="20">\n          <md-card>\n            <md-card-content>\n              <button layout-align="center center" md-mini-fab ng-click="vm.query.level = null; vm.getDispositions()">\n                <div layout="row" layout-align="start center">\n                  <md-icon md-font-icon="icon-refresh"></md-icon>\n                  <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                </div>\n              </button>\n            </md-card-content>\n          </md-card>\n          <md-card>\n            <md-card-content>\n              <md-input-container class="md-block" flex-gt-sm="">\n                <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm.query.level" ng-change="vm.getDispositions()">\n                  <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                  <md-option ng-value="key" ng-repeat="(key, value) in vm.levels">{{ value }}</md-option>\n                </md-select>\n              </md-input-container>\n            </md-card-content>\n          </md-card>\n        </div>\n        \x3c!-- DISPOSITION TABLE --\x3e\n        <md-card flex="80">\n          <md-table-container>\n            <table md-table md-row-select multiple ng-model="vm.selectedDispositions" md-progress="vm.promise">\n              <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDispositions">\n                <tr md-row>\n                  <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                  <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                  <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                  <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                  <th md-column width="10px"></th>\n                </tr>\n              </thead>\n              <tbody md-body>\n                <tr md-row ng-hide="vm.dispositions.rows.length">\n                  <td md-cell colspan="5">\n                    <div layout="row" layout-align="center center">\n                      <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                    </div>\n                  </td>\n                </tr>\n                <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm.dispositions.rows">\n                  <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                  </td>\n                  <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                    {{ vm.levels[disposition.level] }}</td>\n                  <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                    {{disposition.name}}</td>\n                  <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                    {{disposition.description}}</td>\n                  <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                    <md-menu>\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        \x3c!-- SUBACTIONS --\x3e\n                        \x3c!-- ACTIONS --\x3e\n                        <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                          <md-button ng-click="vm.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                            Edit Disposition\n                          </md-button>\n                        </md-menu-item>\n                        \x3c!-- SUBACTIONS --\x3e\n                        \x3c!-- ACTIONS --\x3e\n                        <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                          <md-button ng-click="vm.deleteconfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                            Delete Disposition\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </td>\n                </tr>\n              </tbody>\n            </table>\n          </md-table-container>\n          <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dispositions.count}}" md-on-paginate="vm.getDispositions" md-page-select>\n          </md-table-pagination>\n        </md-card>\n        \x3c!-- / DISPOSITION TABLE --\x3e\n      </div>\n      \x3c!-- NO RESULTS --\x3e\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n  \x3c!-- ADD DISPOSITION BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-disposition-button" ng-click="vm.createOrEditDisposition($event)" aria-label="add disposition" translate translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD DISPOSITION BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/intervals/create/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n        <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.interval.description">\n\n        <div ng-messages="intervalForm[\'description\'].$error" ng-show="intervalForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input ng-model="vm.interval.name" type="text" name="name" placeholder="{{\'TOOLS.NAME\' | translate}}" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" md-autofocus required>\n        <div ng-messages="intervalForm.name.$error" ng-show="intervalForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/intervals/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n        <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/view.html",'<div id="tools-interval" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-intervals-button md-icon-button" aria-label="Go to intervals" ng-click="vm.gotoIntervals()" translate translate-attr-aria-label="TOOLS.GO_TO_INTERVALS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="interval-image" hide-xs>\n          <img ng-src="assets/images/business/intervals.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.interval.id}}\n            <span ng-if="vm.interval.name">{{vm.interval.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.interval.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveInterval()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (intervalsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="interval-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.interval.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.INTERVALS">INTERVALS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="interval-detail-form-container intervals md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IntervalIntervalsController as vm_dc" ng-init="vm_dc.init(vm.interval, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIntervalIntervals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="TOOLS.INTERVALS">Intervals</span>\n                  <ms-search-bar on-search="vm_dc.getIntervalIntervals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditIntervalInterval($event)" aria-label="add interval" translate translate-attr-label="TOOLS.ADD_INTERVAL">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIntervalIntervals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIntervalIntervals.length}} {{vm_dc.selectedIntervalIntervals.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIntervalIntervals" csv-label="true" filename="intervals.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIntervalIntervals($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIntervalIntervals" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIntervalIntervals">\n                    <tr md-row>\n                      <th md-column width="10px"></th>\n                      <th md-column md-order-by="id">\n                        {{ \'TOOLS.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="name">\n                        {{ \'TOOLS.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="interval">\n                        {{ \'TOOLS.INTERVAL\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'TOOLS.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body ng-sortable="vm_dc.sortableTable">\n                    <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm_dc.intervalIntervals.rows">\n                      <td md-cell>\n                        <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n                        {{interval.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n                        {{interval.name}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n                        {{interval.interval}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n                        {{ interval.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" translate="TOOLS.EDIT_INTERVAL">\n                                Edit Interval\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n                                Delete Interval\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.intervalIntervals.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="TOOLS.NO_INTERVALS_AVAILABLE">No intervals available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/intervals.html",'<div id="intervals" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.INTERVALS">Intervals</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedIntervals.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedIntervals =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-intervals-count">\n          <span>{{vm.selectedIntervals.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllIntervals()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectIntervals()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedIntervals" csv-label="true" filename="intervals.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIntervals($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- INTERVAL TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedIntervals" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIntervals">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.intervals.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm.intervals.rows">\n                <td md-cell ng-if="interval.userpic"><img class="avatar" alt="{{interval.name}}" ng-src="api/users/{{interval.id}}/avatar" /></td>\n                <td md-cell ng-if="!interval.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{interval.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="id ">{{interval.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="name ">{{interval.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="description ">{{interval.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(interval, $event    )" translate="TOOLS.EDIT_INTERVAL">\n                          Edit Interval\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(interval, $event    )" translate="TOOLS.DELETE_INTERVAL">\n                          Delete Interval\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.intervals.count}}" md-on-paginate="vm.getIntervals" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / INTERVAL TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD INTERVAL BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-interval-button" ng-click="vm.createOrEditInterval($event)" aria-label="add interval" translate translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD INTERVAL BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/pauses/create/dialog.html",'<md-dialog class="pause-dialog" aria-label="New Pause">\n  <form name="pauseForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.pause.name" ng-required="true" autofocus>\n\n        <div ng-messages="pauseForm[\'name\'].$error" ng-show="pauseForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.pause.description">\n\n        <div ng-messages="pauseForm[\'description\'].$error" ng-show="pauseForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPause" ng-click="vm.savePause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid || pauseForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPause" ng-click="vm.addNewPause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_PAUSE" translate-attr-aria-label="TOOLS.ADD_PAUSE">\n          ADD PAUSE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPause" ng-click="vm.deletePause($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/pauses/pauses.html",'<div id="pauses" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.PAUSES">Pauses</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedPauses.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedPauses =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-pauses-count">\n          <span>{{vm.selectedPauses.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllPauses()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectPauses()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedPauses" csv-label="true" filename="pauses.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPauses($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- PAUSE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedPauses" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPauses">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.pauses.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="pause" md-select-id="id" ng-repeat="pause in vm.pauses.rows">\n                <td md-cell ng-if="pause.userpic"><img class="avatar" alt="{{pause.name}}" ng-src="api/users/{{pause.id}}/avatar" /></td>\n                <td md-cell ng-if="!pause.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{pause.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="id ">{{pause.id}}</td>\n                <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="name ">{{pause.name}}</td>\n                <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="description ">{{pause.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(pause, $event    )" translate="TOOLS.EDIT_PAUSE">\n                          Edit Pause\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(pause, $event    )" translate="TOOLS.DELETE_PAUSE">\n                          Delete Pause\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.pauses.count}}" md-on-paginate="vm.getPauses" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / PAUSE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD PAUSE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-pause-button" ng-click="vm.createOrEditPause($event)" aria-label="add pause" translate translate-attr-aria-label="TOOLS.ADD_PAUSE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD PAUSE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/schedules/create/dialog.html",'<md-dialog class="schedule-dialog" aria-label="New Schedule">\n  <form name="scheduleForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.schedule.name" ng-required="true" autofocus>\n\n        <div ng-messages="scheduleForm[\'name\'].$error" ng-show="scheduleForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.REPORT">Report</label>\n        <input type="search" name="report" ng-model="vm.schedule.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n        <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n        <div ng-messages="scheduleForm[\'report\'].$error" ng-show="scheduleForm[\'report\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.OUTPUT">Output</label>\n        <md-select name="output" ng-model="vm.schedule.output" required>\n          <md-option ng-value="\'csv\'">CSV</md-option>\n          <md-option ng-value="\'pdf\'">PDF</md-option>\n          <md-option ng-value="\'xlsx\'">Excel</md-option>\n        </md-select>\n        <div ng-messages="scheduleForm[\'output\'].$error" ng-show="scheduleForm[\'output\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <div class="md-block">\n        <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click required name="startAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n              <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click required name="startAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n              <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </md-content>\n      </div>\n      <div class="md-block">\n        <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click required name="endAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n              <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click required name="endAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n              <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </md-content>\n      </div>\n      <div flex class="md-block">\n        <label> {{ \'TOOLS.CRON\' | translate }} ({{vm.schedule.cron}})</label>\n        <cron-selection name="cron" ng-model="vm.schedule.cron" template="assets/angular-cron-jobs/template.html" required></cron-selection>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.LAST">Last</label>\n        <input type="number" name="subtractNumber" ng-model="vm.schedule.subtractNumber" value="1" ng-required="true">\n\n        <div ng-messages="scheduleForm[\'subtractNumber\'].$error" ng-show="scheduleForm[\'subtractNumber\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LAST_REQUIRED">Last field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.LASTUNIT">LastUnit</label>\n        <md-select name="subtractUnit" ng-model="vm.schedule.subtractUnit" required>\n          <md-option ng-value="\'minutes\'">Minutes</md-option>\n          <md-option ng-value="\'hours\'">Hours</md-option>\n          <md-option ng-value="\'days\'">Days</md-option>\n          <md-option ng-value="\'weeks\'">Weeks</md-option>\n          <md-option ng-value="\'months\'">Months</md-option>\n          <md-option ng-value="\'quarters\'">Quarters</md-option>\n          <md-option ng-value="\'years\'">Years</md-option>\n        </md-select>\n        <div ng-messages="scheduleForm[\'subtractUnit\'].$error" ng-show="scheduleForm[\'subtractUnit\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LASTUNIT_REQUIRED">LastUnit field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <label translate="TOOLS.MAILACCOUNT">MailAccount</label>\n        <md-select name="MailAccountId" ng-model="vm.schedule.MailAccountId" required>\n          <md-option ng-value="MailAccountId.id" ng-repeat="MailAccountId in vm.mailAccounts" ng-disabled="MailAccountId.canSelect === false">{{ MailAccountId.name }}</md-option>\n        </md-select>\n        <div ng-messages="scheduleForm[\'MailAccountId\'].$error" ng-show="scheduleForm[\'MailAccountId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.MAILACCOUNT_REQUIRED">MailAccount field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>\n        <input type="text" name="email" ng-model="vm.schedule.email" ng-required="true">\n\n        <div class="hint"><span translate="TOOLS.HELP.EMAILADDRESS"></span></div>\n        <div ng-messages="scheduleForm[\'email\'].$error" ng-show="scheduleForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <label translate="TOOLS.EMAILCCADDRESS">EmailCcAddress</label>\n        <input type="text" name="cc" ng-model="vm.schedule.cc">\n\n        <div class="hint"><span translate="TOOLS.HELP.EMAILCCADDRESS"></span></div>\n        <div ng-messages="scheduleForm[\'cc\'].$error" ng-show="scheduleForm[\'cc\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.EMAILCCADDRESS_REQUIRED">EmailCcAddress field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <label translate="TOOLS.EMAILBCCADDRESS">EmailBccAddress</label>\n        <input type="text" name="bcc" ng-model="vm.schedule.bcc">\n\n        <div class="hint"><span translate="TOOLS.HELP.EMAILBCCADDRESS"></span></div>\n        <div ng-messages="scheduleForm[\'bcc\'].$error" ng-show="scheduleForm[\'bcc\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.EMAILBCCADDRESS_REQUIRED">EmailBccAddress field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <md-switch ng-model="vm.schedule.sendIfEmpty" aria-label="SendIfEmpty"><span translate="TOOLS.SENDIFEMPTY">SendIfEmpty</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="" name="description" ng-model="vm.schedule.description">\n\n        <div ng-messages="scheduleForm[\'description\'].$error" ng-show="scheduleForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n          ADD SCHEDULE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n  <md-toolbar>\n    <div class="md-toolbar-tools">\n      <h2>Select Report</h2>\n      <span flex></span>\n      <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-dialog-content>\n    <div class="content" md-background-bg layout="row" layout-align="start start">\n      <div layout="column" flex="30">\n        <md-card class="padding-10 scrollable">\n          <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n        </md-card>\n        <md-card class="padding-10 scrollable">\n          <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n        </md-card>\n      </div>\n      <md-card flex="70">\n        <md-toolbar class="md-table-toolbar md-default">\n          <div class="md-toolbar-tools">\n            <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n            <p ng-if="vm.currentPath">\n              <span class="text-boxed">{{vm.currentPath}}</span>\n            </p>\n          </div>\n        </md-toolbar>\n        <md-table-container>\n          <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n              <tr md-row>\n                <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n                <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n                <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.reports.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n                <td md-cell class="id">{{ report.id }}</td>\n                <td md-cell class="name">{{ report.name }}</td>\n                <td md-cell class="description">{{ report.description }}</td>\n                <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n      </md-card>\n    </div>\n  </md-dialog-content>\n  <md-dialog-actions layout="row">\n    <span flex></span>\n    <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n    <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n  </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/schedules.html",'<div id="schedules" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.SCHEDULER">Scheduler</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedScheduler.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedScheduler =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-schedules-count">\n          <span>{{vm.selectedScheduler.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllScheduler()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectScheduler()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedScheduler" csv-label="true" filename="schedules.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScheduler($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SCHEDULE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedScheduler" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduler">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="startAt">{{ \'TOOLS.VALIDITYSTART\' | translate }}</th>\n                <th md-column md-order-by="endAt">{{ \'TOOLS.VALIDITYEND\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.schedules.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="schedule" md-select-id="id" ng-repeat="schedule in vm.schedules.rows">\n                <td md-cell ng-if="schedule.userpic"><img class="avatar" alt="{{schedule.name}}" ng-src="api/users/{{schedule.id}}/avatar" /></td>\n                <td md-cell ng-if="!schedule.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{schedule.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="id ">{{schedule.id}}</td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="name ">{{schedule.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(schedule, ev) : vm.createOrEditSchedule($event, schedule)" md-cell class="active ">\n                  <md-icon md-colors="{color: {{schedule.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{schedule.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="startAt ">{{schedule.startAt | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="endAt ">{{schedule.endAt | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="description ">{{schedule.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(schedule, $event    )" translate="TOOLS.EDIT_SCHEDULE">\n                          Edit Schedule\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.runconfirm(schedule, $event    )" translate="TOOLS.RUN_SCHEDULE">\n                          Run Schedule\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(schedule, $event    )" translate="TOOLS.DELETE_SCHEDULE">\n                          Delete Schedule\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.schedules.count}}" md-on-paginate="vm.getScheduler" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SCHEDULE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SCHEDULE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-schedule-button" ng-click="vm.createOrEditSchedule($event)" aria-label="add schedule" translate translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SCHEDULE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/create/dialog.html",'<md-dialog class="sound-dialog" aria-label="New Sound">\n  <form name="soundForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.sound.name" ng-required="true" autofocus>\n\n        <div ng-messages="soundForm[\'name\'].$error" ng-show="soundForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.sound.description">\n\n        <div ng-messages="soundForm[\'description\'].$error" ng-show="soundForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSound" ng-click="vm.saveSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid || soundForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSound" ng-click="vm.addNewSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SOUND" translate-attr-aria-label="TOOLS.ADD_SOUND">\n          ADD SOUND\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSound" ng-click="vm.deleteSound($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/sounds/sounds.html",'<div id="sounds" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.SOUNDS">Sounds</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSounds.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSounds =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-sounds-count">\n          <span>{{vm.selectedSounds.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSounds()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSounds()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSounds" csv-label="true" filename="sounds.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSounds($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SOUND TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSounds" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSounds">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="audio">{{ \'TOOLS.AUDIO\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.sounds.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="sound" md-select-id="id" ng-repeat="sound in vm.sounds.rows">\n                <td md-cell ng-if="sound.userpic"><img class="avatar" alt="{{sound.name}}" ng-src="api/users/{{sound.id}}/avatar" /></td>\n                <td md-cell ng-if="!sound.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sound.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="id ">{{sound.id}}</td>\n                <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="name ">{{sound.name}}</td>\n                <td md-cell class="audio ">\n                  \x3c!-- audio recording directive --\x3e\n                  <ms-recording id="sound.id" model="\'sound\'"></ms-recording>\n                  \x3c!-- / audio recording directive --\x3e\n                </td>\n                <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="description ">{{sound.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(sound, $event    )" translate="TOOLS.EDIT_SOUND">\n                          Edit Sound\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.downloadfile2(sound, $event  , \'sounds\'   )" translate="TOOLS.DOWNLOAD_SOUND">\n                          Download Sound\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(sound, $event    )" translate="TOOLS.DELETE_SOUND">\n                          Delete Sound\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sounds.count}}" md-on-paginate="vm.getSounds" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SOUND TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- UPLOAD SOUND BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-sound-button" ng-click="vm.uploadSound($event)" aria-label="upload sound" translate translate-attr-aria-label="TOOLS.UPLOAD_SOUND">\n    <md-icon md-font-icon="icon-upload"></md-icon>\n  </md-button>\n  \x3c!-- / UPLOAD SOUND BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n  <form name="uploadForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div id="sound-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n        <div class="drop-text hint-text" layout="row" layout-align="center center">\n          <span translate="TOOLS.DROP_TO_UPLOAD">Drop to upload</span>\n        </div>\n\n        <div class="upload-button" layout="column" layout-align="center center">\n          <md-button class="md-accent md-raised" flow-btn>\n            Upload\n          </md-button>\n          <span class="secondary-text mt-8" translate="TOOLS.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n        </div>\n      </div>\n\n      <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n        <div>\n          <span translate="TOOLS.UPLOADING">Uploading</span>\n          <span>{{vm.sound.file.name}}</span>\n        </div>\n        <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n      </div>\n\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center"></div>\n      <div layout="row">\n        <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="TOOLS.FINISH" translate-attr-aria-label="TOOLS.FINISH">\n          FINISH\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/create/dialog.html",'<md-dialog class="tag-dialog" aria-label="New Tag">\n  <form name="tagForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.tag.name" ng-required="true" autofocus>\n\n        <div ng-messages="tagForm[\'name\'].$error" ng-show="tagForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.tag.description">\n\n        <div ng-messages="tagForm[\'description\'].$error" ng-show="tagForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div flex md-color-picker ng-model="vm.tag.color" label="{{\'TOOLS.COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTag" ng-click="vm.saveTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid || tagForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTag" ng-click="vm.addNewTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TAG" translate-attr-aria-label="TOOLS.ADD_TAG">\n          ADD TAG\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTag" ng-click="vm.deleteTag($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/tags.html",'<div id="tags" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.TAGS">Tags</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTags.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTags =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-tags-count">\n          <span>{{vm.selectedTags.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTags()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTags()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTags" csv-label="true" filename="tags.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTags($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TAG TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTags" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTags">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="color">{{ \'TOOLS.COLOR\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.tags.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="tag" md-select-id="id" ng-repeat="tag in vm.tags.rows">\n                <td md-cell ng-if="tag.userpic"><img class="avatar" alt="{{tag.name}}" ng-src="api/users/{{tag.id}}/avatar" /></td>\n                <td md-cell ng-if="!tag.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{tag.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="id ">{{tag.id}}</td>\n                <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="name ">{{tag.name}}</td>\n                <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="description ">{{tag.description}}</td>\n                <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="color ">{{tag.color}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(tag, $event    )" translate="TOOLS.EDIT_TAG">\n                          Edit Tag\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(tag, $event    )" translate="TOOLS.DELETE_TAG">\n                          Delete Tag\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.tags.count}}" md-on-paginate="vm.getTags" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TAG TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TAG BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-tag-button" ng-click="vm.createOrEditTag($event)" aria-label="add tag" translate translate-attr-aria-label="TOOLS.ADD_TAG">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TAG BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/templates/create/dialog.html",'<md-dialog class="template-dialog" aria-label="New Template">\n  <form name="templateForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.template.name" ng-required="true" autofocus>\n\n        <div ng-messages="templateForm[\'name\'].$error" ng-show="templateForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="md-block">\n        <label class="md-caption grey-fg" translate="TOOLS.CONTENT">Content</label>\n        <textarea aria-label="Content html" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.template.html"></textarea>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.template.description">\n\n        <div ng-messages="templateForm[\'description\'].$error" ng-show="templateForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTemplate" ng-click="vm.saveTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid || templateForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTemplate" ng-click="vm.addNewTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TEMPLATE" translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n          ADD TEMPLATE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTemplate" ng-click="vm.deleteTemplate($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/templates/templates.html",'<div id="templates" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.TEMPLATES">Templates</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTemplates.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTemplates =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-templates-count">\n          <span>{{vm.selectedTemplates.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTemplates()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTemplates()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTemplates" csv-label="true" filename="templates.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTemplates($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TEMPLATE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTemplates" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTemplates">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.templates.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="template" md-select-id="id" ng-repeat="template in vm.templates.rows">\n                <td md-cell ng-if="template.userpic"><img class="avatar" alt="{{template.name}}" ng-src="api/users/{{template.id}}/avatar" /></td>\n                <td md-cell ng-if="!template.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{template.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="id ">{{template.id}}</td>\n                <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="name ">{{template.name}}</td>\n                <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="description ">{{template.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(template, $event    )" translate="TOOLS.EDIT_TEMPLATE">\n                          Edit Template\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(template, $event    )" translate="TOOLS.DELETE_TEMPLATE">\n                          Delete Template\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.templates.count}}" md-on-paginate="vm.getTemplates" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TEMPLATE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TEMPLATE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-template-button" ng-click="vm.createOrEditTemplate($event)" aria-label="add template" translate translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TEMPLATE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/create/dialog.html",'<md-dialog class="trigger-dialog" aria-label="New Trigger">\n  <form name="triggerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newTrigger ? \'TOOLS.NEW_TRIGGER\' : \'TOOLS.EDIT_TRIGGER\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.trigger.name" required md-autofocus>\n        <div ng-messages="triggerForm[\'name\'].$error" ng-show="triggerForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="!vm.newTrigger">\n          <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n          <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }}\n          </md-option>\n          <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n          <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n          <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n          <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n          <md-option ng-value="\'whatsapp\'" ng-if="vm.license.whatsapp"> {{ \'TOOLS.WHATSAPP\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="triggerForm[\'channel\'].$error" ng-show="triggerForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span>\n        </md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.trigger.description">\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{ error.message }}</span>\n            <span class="type">({{ error.type }})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrigger" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid || triggerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrigger" ng-click="vm.addNewTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRIGGER" translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n          ADD TRIGGER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrigger" ng-click="vm.deleteTrigger($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/actions/actions.html",'<div ng-controller="TriggerActionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\r\n  <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerActions.length">\r\n    <div class="md-toolbar-tools">\r\n      <span class="md-subhead" translate="TOOLS.ACTIONS">Actions</span>\r\n      <ms-search-bar on-search="vm_dc.getTriggerActions()" query="vm_dc.query" debounce="300" direction="down">\r\n      </ms-search-bar>\r\n      <div flex></div>\r\n      <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAction($event)" aria-label="add action" translate translate-attr-label="TOOLS.ADD_ACTION">\r\n        <md-icon md-font-icon="icon-plus"></md-icon>\r\n      </md-button>\r\n    </div>\r\n  </md-toolbar>\r\n  <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerActions.length">\r\n    <div class="md-toolbar-tools">\r\n      <span class="md-subhead">{{ vm_dc.selectedTriggerActions.length }}\r\n        {{ vm_dc.selectedTriggerActions.length > 1 ? \'items\' : \'item\' }} selected</span>\r\n      <div flex></div>\r\n      <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerActions" csv-label="true" filename="triggers.csv">\r\n        <md-icon md-font-icon="icon-file-excel"></md-icon>\r\n      </button>\r\n      <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerActions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\r\n        <md-icon md-font-icon="icon-delete"></md-icon>\r\n      </md-button>\r\n    </div>\r\n  </md-toolbar>\r\n  <md-table-container class="font-size-12">\r\n    <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerActions" md-progress="vm_dc.promise">\r\n      <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerActions">\r\n        <tr md-row>\r\n          <th md-column md-order-by="id">\r\n            {{ \'TOOLS.ID\' | translate }}\r\n          </th>\r\n          <th md-column md-order-by="action">\r\n            {{ \'TOOLS.ACTION\' | translate }}\r\n          </th>\r\n          <th md-column md-order-by="data1">\r\n            {{ \'TOOLS.TYPE\' | translate }}\r\n          </th>\r\n          <th md-column md-order-by="data2">\r\n            {{ \'TOOLS.INFO\' | translate }}\r\n          </th>\r\n          <th md-column md-order-by="createdAt">\r\n            {{ \'TOOLS.CREATED_AT\' | translate }}\r\n          </th>\r\n          <th md-column width="10px"></th>\r\n        </tr>\r\n      </thead>\r\n      <tbody md-body>\r\n        <tr md-row md-select="action" md-select-id="id" ng-repeat="action in vm_dc.triggerActions.rows">\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n            {{ action.id }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n            {{ \'TOOLS.\' + (action.action | snakecase | uppercase) | translate }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\'" md-cell>\r\n            {{ action.data1 === \'1\' ? \'CTI URL\' : \'Popup\' }} </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>\r\n            {{ (vm_dc.lists | filter : {\'id\':(action.data1 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>\r\n            {{ action.data2 === \'1\' ? \'TOOLS.YES\' : \'TOOLS.NO\' | uppercase | translate }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>\r\n            {{ action.data1 }} </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data1" md-cell>\r\n            {{ action.data1 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data2" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'script\' && action.data2" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'script\' && action.data1" md-cell>\r\n            {{ action.data1 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'jscripty\'" md-cell>\r\n            {{ (vm_dc.projects | filter : {\'id\':(action.data1 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\'" md-cell>\r\n            {{ vm_dc.integrationTypes[action.data1] }} </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zendesk\'" md-cell>\r\n            {{ (vm_dc.zendeskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'desk\'" md-cell>\r\n            {{ (vm_dc.deskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zoho\'" md-cell>\r\n            {{ (vm_dc.zohoAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'salesforce\'" md-cell>\r\n            {{ (vm_dc.salesforceAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'sugarcrm\'" md-cell>\r\n            {{ (vm_dc.sugarcrmAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshdesk\'" md-cell>\r\n            {{ (vm_dc.freshdeskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'vtiger\'" md-cell>\r\n            {{ (vm_dc.vtigerAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'dynamics365\'" md-cell>\r\n            {{ (vm_dc.dynamics365Accounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'servicenow\'" md-cell>\r\n            {{ (vm_dc.servicenowAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshsales\'" md-cell>\r\n            {{ (vm_dc.freshsalesAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\'" md-cell>\r\n            {{ vm_dc.motionBarOptions[action.data1] }} </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'1\'" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'2\'" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'0\'" md-cell>\r\n            {{ (vm_dc.templates | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 === \'0\'" md-cell>\r\n            {{ (vm_dc.templates | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 === \'1\'" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n            {{ action.createdAt | formatdate }}\r\n          </td>\r\n          <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\r\n            <md-menu>\r\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\r\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\r\n              </md-button>\r\n              <md-menu-content width="3">\r\n                <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\r\n                  <md-button ng-click="vm_dc.createOrEditTriggerAction($event, action)" translate="TOOLS.EDIT_ACTION">\r\n                    Edit Action\r\n                  </md-button>\r\n                </md-menu-item>\r\n                <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\r\n                  <md-button ng-click="vm_dc.deleteConfirm(action, $event)" translate="TOOLS.DELETE_ACTION">\r\n                    Delete Action\r\n                  </md-button>\r\n                </md-menu-item>\r\n              </md-menu-content>\r\n            </md-menu>\r\n          </td>\r\n        </tr>\r\n        <tr md-row ng-if="!vm_dc.triggerActions.rows.length">\r\n          <td md-cell colspan="5">\r\n            <div layout="row" layout-align="center center">\r\n              <span class="text-boxed-light" translate="TOOLS.NO_ACTION_AVAILABLE">No action\r\n                available</span>\r\n            </div>\r\n          </td>\r\n        </tr>\r\n      </tbody>\r\n    </table>\r\n  </md-table-container>\r\n  <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.triggerActions.count }}" md-on-paginate="vm_dc.getTriggerActions" md-page-select>\r\n  </md-table-pagination>\r\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/actions/create/dialog.html",'<md-dialog class="action-dialog" aria-label="New Action">\n  <form name="actionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newAction ? \'TOOLS.NEW_ACTION\' : \'TOOLS.EDIT_ACTION\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.ACTION">Action</label>\n        <md-select name="action" ng-model="vm.action.action" ng-init="vm.onActionInit()" ng-change="vm.onActionSelection()" md-autofocus required ng-disabled="!vm.newAction">\n          <md-option ng-value="\'contactManager\'" ng-if="vm.trigger.channel == \'voice\'">\n            {{ \'TOOLS.CONTACT_MANAGER\' | translate }} </md-option>\n          <md-option ng-value="\'integration\'" ng-if="vm.trigger.channel == \'voice\' && ((vm.newAction && vm.hasIntegrationsPermissions) || !vm.newAction)">\n            {{ \'TOOLS.INTEGRATIONS\' | translate }} </md-option>\n          <md-option ng-value="\'motionbar\'"> {{ \'TOOLS.MOTIONBAR\' | translate }} </md-option>\n          <md-option ng-value="\'jscripty\'"> {{ \'TOOLS.JSCRIPTY\' | translate }} </md-option>\n          <md-option ng-value="\'urlForward\'"> {{ \'TOOLS.URL_FORWARD\' | translate }} </md-option>\n          <md-option ng-value="\'browser\'"> {{ \'TOOLS.BROWSER\' | translate }} </md-option>\n          <md-option ng-value="\'bot\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.BOT\' | translate }} </md-option>\n          <md-option ng-value="\'script\'"> {{ \'TOOLS.SCRIPT\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'action\'].$error" ng-show="actionForm[\'action\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ACTION_REQUIRED">Action field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'jscripty\'" class="md-block">\n        <label translate="TOOLS.PROJECT">Project</label>\n        <md-select name="data1" ng-model="vm.action.data1" required>\n          <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.projects" ng-disabled="data1.canSelect === false">\n            {{ data1.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\'" class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onTypeSelection()" required>\n          <md-option ng-value="\'0\'">Popup</md-option>\n          <md-option ng-value="\'1\'">CTI URL</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n        <label translate="TOOLS.LIST">List</label>\n        <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onListSelection()" required>\n          <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.lists" ng-disabled="data1.canSelect === false">\n            {{ data1.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n        <label translate="TOOLS.SEARCH_FIELDS">Search fields</label>\n        <md-select name="fields" ng-model="vm.action.data3" ng-init="vm.onSearchFieldsInit()" multiple required>\n          <md-optgroup label="{{ \'TOOLS.STANDARD\' | translate }}">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.contactFields">\n              {{ field.displayName }}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{ \'TOOLS.LIST\' | translate }}" ng-if="vm.listFields.length > 0">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.listFields">\n              {{ field.name }}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{ \'TOOLS.GLOBALS\' | translate }}" ng-if="vm.customFields.length > 0">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.customFields">\n              {{ field.displayName }}</md-option>\n          </md-optgroup>\n        </md-select>\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SEARCH_FIELDS_REQUIRED">Search fields field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n        <label translate="TOOLS.AUTOCREATECONTACT">Create contact automatically</label>\n        <md-select name="data2" ng-model="vm.action.data2" ng-change="vm.onAutocreateSelection()" required>\n          <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n          <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED">AutoCreateContact field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\' && vm.action.data2 === \'1\'" class="md-block">\n        <label translate="TOOLS.AUTOCREATE_FIELD">Autocreate field</label>\n        <md-select name="autocreateField" ng-model="vm.action.data4" ng-required="vm.action.data2 === \'1\'">\n          <md-optgroup label="{{ \'TOOLS.STANDARD\' | translate }}">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.contactFields">\n              {{ field.displayName }}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{ \'TOOLS.LIST\' | translate }}" ng-if="vm.listFields.length > 0">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.listFields">\n              {{ field.name }}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{ \'TOOLS.GLOBALS\' | translate }}" ng-if="vm.customFields.length > 0">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.customFields">\n              {{ field.displayName }}</md-option>\n          </md-optgroup>\n        </md-select>\n        <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.AUTOCREATE_FIELD_REQUIRED">Autocreate field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n        <label translate="TOOLS.IGNOREDIALERCONTACTID">Ignore dialer contact Id</label>\n        <md-select name="data5" ng-model="vm.action.data5" required>\n          <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n          <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.IGNOREDIALERCONTACTID_REQUIRED">Ignore dialer contact Id field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select name="data1" ng-model="vm.action.data1" required>\n          <md-option ng-value="\'GET\'">GET</md-option>\n          <md-option ng-value="\'POST\'">POST</md-option>\n          <md-option ng-value="\'PUT\'">PUT</md-option>\n          <md-option ng-value="\'DELETE\'">DELETE</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n        <label translate="TOOLS.URL">Url</label>\n        <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n        <label translate="TOOLS.TIMEOUT">Timeout</label>\n        <input type="number" name="data5" ng-model="vm.action.data5" min="1" max="10" ng-required="true">\n        <div class="hint"><span translate="TOOLS.HELP.TIMEOUT"></span></div>\n        <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n              equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n              equal than</span> <span>10</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n        <label translate="TOOLS.HEADERS">Headers</label>\n        <textarea name="data6" ng-model="vm.action.data6"></textarea>\n        <div class="hint"><span translate="TOOLS.HELP.HEADERS"></span></div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\' && (vm.action.data1 == \'POST\' || vm.action.data1 == \'PUT\')" class="md-block">\n        <label translate="TOOLS.BODY">Body</label>\n        <textarea name="data7" ng-model="vm.action.data7"></textarea>\n        <div class="hint"><span translate="TOOLS.HELP.BODY"></span></div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n        <label translate="TOOLS.SCRIPT_TYPE">Script_Type</label>\n        <input type="input" name="data2" ng-model="vm.action.data2">\n        <div class="hint"><span translate="TOOLS.HELP.SCRIPT_TYPE"></span></div>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SCRIPT_TYPE_REQUIRED">Script_Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n        <label translate="TOOLS.SCRIPT_INFO">Script_Info</label>\n        <input type="input" name="data1" ng-model="vm.action.data1">\n        <div class="hint"><span translate="TOOLS.HELP.SCRIPT_INFO"></span></div>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SCRIPT_INFO_REQUIRED">Script_Info field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n        <label translate="TOOLS.SCRIPT">Script</label>\n        <textarea name="data3" ng-model="vm.action.data3" required></textarea>\n        <div class="hint"><span translate="TOOLS.HELP.SCRIPT"></span></div>\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SCRIPT_REQUIRED">Script field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'integration\'" class="md-block">\n        <label translate="TOOLS.INTEGRATION">Integration</label>\n        <md-select name="data1" ng-model="vm.action.data1" ng-init="vm.onIntegrationInit()" ng-change="vm.onIntegrationSelection()" required>\n          <md-option ng-value="\'desk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1306])">Desk</md-option>\n          <md-option ng-value="\'dynamics365\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1309])">Dynamics365</md-option>\n          <md-option ng-value="\'freshdesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1303])">Freshdesk</md-option>\n          <md-option ng-value="\'freshsales\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1304]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1304])">Freshsales</md-option>\n          <md-option ng-value="\'salesforce\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1302])">Salesforce</md-option>\n          <md-option ng-value="\'servicenow\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1310])">ServiceNow</md-option>\n          <md-option ng-value="\'sugarcrm\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1305])">SugarCRM</md-option>\n          <md-option ng-value="\'vtiger\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1308])">vTiger</md-option>\n          <md-option ng-value="\'zendesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1301])">Zendesk</md-option>\n          <md-option ng-value="\'zoho\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1307])">Zoho</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED">Integration field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1" class="md-block">\n        <label translate="TOOLS.ACCOUNT">Account</label>\n        <md-select name="data2" ng-model="vm.action.data2" ng-change="vm.onIntegrationAccountSelection()" ng-disabled="vm.action.isIntegrationDisabled" required>\n          <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.accounts">{{ data2.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'integration\'  && vm.action.data1 && vm.action.data2" class="md-block">\n        <label translate="TOOLS.CONFIGURATION">Configuration</label>\n        <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="vm.action.isIntegrationDisabled">\n          <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.configurations | filter : { AccountId: (vm.action.data2 | toInteger) } : true">{{\n            data3.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\'" class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onTypeSelection()" required>\n          <md-option ng-value="\'0\'">Popup</md-option>\n          <md-option ng-value="\'1\'">CTI URL</md-option>\n          <md-option ng-value="\'2\'">Windows App</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'1\'" class="md-block">\n        <label translate="TOOLS.URL">Url</label>\n        <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n        <label translate="TOOLS.APPLICATION">Application</label>\n        <input type="text" name="data2" ng-model="vm.action.data2" ng-required="true">\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n        <label translate="TOOLS.ARGUMENTS">Arguments</label>\n        <input type="text" name="data3" ng-model="vm.action.data3">\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'0\'" class="md-block">\n        <label translate="TOOLS.TEMPLATE">Template</label>\n        <md-select name="data2" ng-model="vm.action.data2" required>\n          <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">\n            {{ data2.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'0\'" class="md-block">\n        <label translate="TOOLS.TEMPLATE">Template</label>\n        <md-select name="data2" ng-model="vm.action.data2" required>\n          <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">\n            {{ data2.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n        <label translate="TOOLS.URL">Url</label>\n        <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="(vm.action.action == \'motionbar\' || vm.action.action == \'browser\') && vm.action.data1 == \'1\'" class="md-block">\n        <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>\n        <md-select name="data3" ng-model="vm.action.data3" required>\n          <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n          <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n        </md-select>\n        <div class="hint"><span translate="TOOLS.HELP.EVENTVARIABLES"></span></div>\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED">EventVariables field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n        <label translate="TOOLS.LOCATION">Location</label>\n        <md-select name="data4" ng-model="vm.action.data4" required ng-change="vm.onActionLocationChange()">\n          <md-option ng-value="0"> {{ \'TOOLS.NEW_TAB\' | translate }} </md-option>\n          <md-option ng-value="1"> {{ \'TOOLS.NEW_WINDOW\' | translate }} </md-option>\n          <md-option ng-value="2"> {{ \'TOOLS.MOTION_TAB\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LOCATION_REQUIRED">Location field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n        <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>\n        <input type="text" name="data5" ng-model="vm.action.data5">\n        <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED">WindowWidth field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n        <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>\n        <input type="text" name="data6" ng-model="vm.action.data6">\n        <div ng-messages="actionForm[\'data6\'].$error" ng-show="actionForm[\'data6\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED">WindowHeight field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAction" ng-click="vm.saveAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid || actionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAction" ng-click="vm.addNewAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ACTION" translate-attr-aria-label="TOOLS.ADD_ACTION">\n          ADD ACTION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAction" ng-click="vm.deleteAction($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/allconditions.html",'<div ng-controller="TriggerAllConditionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\n  <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedAllConditions.length">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="TOOLS.ALLCONDITIONS">All Conditions</span>\n      <ms-search-bar on-search="vm_dc.getAllConditions()" query="vm_dc.query" debounce="300" direction="down">\n      </ms-search-bar>\n      <div flex></div>\n      <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditAllCondition($event)" aria-label="add allCondition" translate translate-attr-label="TOOLS.ADD_ALLCONDITION">\n        <md-icon md-font-icon="icon-plus"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedAllConditions.length">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead">{{ vm_dc.selectedAllConditions.length }}\n        {{ vm_dc.selectedAllConditions.length > 1 ? \'items\' : \'item\' }} selected</span>\n      <div flex></div>\n      <button class="md-icon-button" ng-csv="vm_dc.exportSelectedAllConditions" csv-label="true" filename="triggers.csv">\n        <md-icon md-font-icon="icon-file-excel"></md-icon>\n      </button>\n      <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedAllConditions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n        <md-icon md-font-icon="icon-delete"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container class="font-size-12">\n    <table md-table md-row-select multiple ng-model="vm_dc.selectedAllConditions" md-progress="vm_dc.promise">\n      <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getAllConditions">\n        <tr md-row>\n          <th md-column md-order-by="id">\n            {{ \'TOOLS.ID\' | translate }}\n          </th>\n          <th md-column md-order-by="field">\n            {{ \'TOOLS.FIELD\' | translate }}\n          </th>\n          <th md-column md-order-by="operator">\n            {{ \'TOOLS.OPERATOR\' | translate }}\n          </th>\n          <th md-column md-order-by="value">\n            {{ \'TOOLS.VALUE\' | translate }}\n          </th>\n          <th md-column md-order-by="createdAt">\n            {{ \'TOOLS.CREATED_AT\' | translate }}\n          </th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row md-select="allCondition" md-select-id="id" ng-repeat="allCondition in vm_dc.allConditions.rows">\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n            {{ allCondition.id }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n            {{ \'TOOLS.\' + vm_dc.fields[allCondition.field] | uppercase | translate }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n            {{ \'TOOLS.\' + allCondition.operator | uppercase | translate }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="!allCondition.value" md-cell>\n            {{ allCondition.value }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.chatWebsites | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.mailAccounts | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'sms\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.smsAccounts | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'whatsapp\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.whatsappAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'fax\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.faxAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'openchannel\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.openchannelAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'queue\'" md-cell>\n            {{ (vm_dc.queues | filter : {\'name\':allCondition.value} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'routeId\'" md-cell>\n            {{ (vm_dc.outboundRoutes | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].exten }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'agent\'" md-cell>\n            {{ (vm_dc.agents | filter : {\'name\':allCondition.value} : true)[0].fullname }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'lastevent\'" md-cell>\n            {{ vm_dc.callStatuses[allCondition.value] }} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'interaction\'" md-cell>\n            {{ allCondition.value | capitalize }} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'message\'" md-cell>\n            {{ vm_dc.messageStatuses[allCondition.value] }} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'mailSubstatus\'" md-cell>\n            {{ allCondition.value === \'null\' ? (\'TOOLS.NONE\' | translate) : (vm_dc.mailSubstatuses | filter : {\'name\': allCondition.value } : true)[0].name }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'offlineMessage\'" md-cell>\n            {{allCondition.value}} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n            {{ allCondition.createdAt | formatdate }}\n          </td>\n          <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="3">\n                <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                  <md-button ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" translate="TOOLS.EDIT_ALLCONDITION">\n                    Edit AllCondition\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                  <md-button ng-click="vm_dc.deleteConfirm(allCondition, $event)" translate="TOOLS.DELETE_ALLCONDITION">\n                    Delete AllCondition\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n        <tr md-row ng-if="!vm_dc.allConditions.rows.length">\n          <td md-cell colspan="5">\n            <div layout="row" layout-align="center center">\n              <span class="text-boxed-light" translate="TOOLS.NO_ALLCONDITION_AVAILABLE">No condition\n                available</span>\n            </div>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.allConditions.count }}" md-on-paginate="vm_dc.getAllConditions" md-page-select>\n  </md-table-pagination>\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/create/dialog.html",'<md-dialog class="allCondition-dialog" aria-label="New AllCondition">\n  <form name="allConditionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newAllCondition ? \'TOOLS.NEW_ALLCONDITION\' : \'TOOLS.EDIT_ALLCONDITION\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.FIELD">Field</label>\n        <md-select name="field" ng-model="vm.allCondition.field" ng-change="vm.onFieldSelection()" md-autofocus required>\n          <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}\n          </md-option>\n          <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'agent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.AGENT\' | translate }}\n          </md-option>\n          <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}\n          </md-option>\n          <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'">\n            {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n          <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'mailSubstatus\'" ng-if="vm.trigger.channel == \'mail\'"> {{ \'TOOLS.MAIL_SUBSTATUS\' | translate }}\n          </md-option>\n          <md-option ng-value="\'offlineMessage\'" ng-if="vm.trigger.channel == \'chat\'"> {{ \'TOOLS.OFFLINE_MESSAGE\' | translate }}\n          </md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'field\'].$error" ng-show="allConditionForm[\'field\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.OPERATOR">Operator</label>\n        <md-select name="operator" ng-model="vm.allCondition.operator" required>\n          <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n          <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'operator\'].$error" ng-show="allConditionForm[\'operator\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'account\'" class="md-block">\n        <label translate="TOOLS.ACCOUNT">Account</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="value.id.toString()" ng-repeat="value in vm.accounts" ng-disabled="value.canSelect === false">\n            {{ value.name }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.QUEUE">Queue</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">\n            {{ value.name }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="value.id.toString()" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">\n            {{ value.exten }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'agent\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.AGENT">Agent</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="value.name" ng-repeat="value in vm.agents" ng-disabled="value.canSelect === false">\n            {{ value.fullname }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'lastevent\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="status.value" ng-repeat="status in vm.callStatuses">\n            {{ status.name }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'mailSubstatus\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="mailSubstatus.name" ng-repeat="mailSubstatus in vm.mailSubstatuses">\n            {{ mailSubstatus.name }}</md-option>\n          <md-option ng-value="\'null\'">{{\'TOOLS.NONE\' | translate}}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="\'opened\'">Opened</md-option>\n          <md-option ng-value="\'closed\'">Closed</md-option>\n          <md-option ng-if="vm.trigger.channel==\'mail\'" ng-value="\'substatus\'">SubStatus</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="\'in\'">Incoming</md-option>\n          <md-option ng-value="\'out\'">Outgoing</md-option>\n          <md-option ng-value="\'accept\'">Accepted</md-option>\n          <md-option ng-value="\'reject\'">Rejected</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'offlineMessage\' && vm.trigger.channel == \'chat\'" class="md-block">\n        <label translate="TOOLS.CHAT">Chat</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="\'created\'">Created</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAllCondition" ng-click="vm.saveAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAllCondition" ng-click="vm.addNewAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ALLCONDITION" translate-attr-aria-label="TOOLS.ADD_ALLCONDITION">\n          ADD ALLCONDITION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAllCondition" ng-click="vm.deleteAllCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/anyconditions.html",'<div ng-controller="TriggerAnyConditionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\n  <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedAnyConditions.length">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="TOOLS.ANYCONDITIONS">AnyConditions</span>\n      <ms-search-bar on-search="vm_dc.getAnyConditions()" query="vm_dc.query" debounce="300" direction="down"></ms-search-bar>\n      <div flex></div>\n      <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditAnyCondition($event)" aria-label="add anyCondition" translate translate-attr-label="TOOLS.ADD_ANYCONDITION">\n        <md-icon md-font-icon="icon-plus"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedAnyConditions.length">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead">{{ vm_dc.selectedAnyConditions.length }}\n        {{ vm_dc.selectedAnyConditions.length > 1 ? \'items\' : \'item\' }} selected</span>\n      <div flex></div>\n      <button class="md-icon-button" ng-csv="vm_dc.exportSelectedAnyConditions" csv-label="true" filename="triggers.csv">\n        <md-icon md-font-icon="icon-file-excel"></md-icon>\n      </button>\n      <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedAnyConditions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n        <md-icon md-font-icon="icon-delete"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container class="font-size-12">\n    <table md-table md-row-select multiple ng-model="vm_dc.selectedAnyConditions" md-progress="vm_dc.promise">\n      <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getAnyConditions">\n        <tr md-row>\n          <th md-column md-order-by="id">\n            {{ \'TOOLS.ID\' | translate }}\n          </th>\n          <th md-column md-order-by="field">\n            {{ \'TOOLS.FIELD\' | translate }}\n          </th>\n          <th md-column md-order-by="operator">\n            {{ \'TOOLS.OPERATOR\' | translate }}\n          </th>\n          <th md-column md-order-by="value">\n            {{ \'TOOLS.VALUE\' | translate }}\n          </th>\n          <th md-column md-order-by="createdAt">\n            {{ \'TOOLS.CREATED_AT\' | translate }}\n          </th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row md-select="anyCondition" md-select-id="id" ng-repeat="anyCondition in vm_dc.anyConditions.rows">\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n            {{ anyCondition.id}}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n            {{ \'TOOLS.\' + vm_dc.fields[anyCondition.field] | uppercase | translate }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n            {{ \'TOOLS.\' + anyCondition.operator | uppercase | translate }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="!anyCondition.value" md-cell>\n            {{ anyCondition.value }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.chatWebsites | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.mailAccounts | filter : {\'id\':(anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'sms\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.smsAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, allCondition)" ng-if="vm.trigger.channel == \'whatsapp\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.whatsappAccounts | filter : {\'id\':(anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'fax\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.faxAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'openchannel\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.openchannelAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'queue\'" md-cell>\n            {{ (vm_dc.queues | filter : {\'name\':anyCondition.value} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'routeId\'" md-cell>\n            {{ (vm_dc.outboundRoutes | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].exten }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'agent\'" md-cell>\n            {{ (vm_dc.agents | filter : {\'name\':anyCondition.value} : true)[0].fullname }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'lastevent\'" md-cell>\n            {{ vm_dc.callStatuses[anyCondition.value] }} </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'interaction\'" md-cell>\n            {{ anyCondition.value | capitalize }} </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'message\'" md-cell>\n            {{ vm_dc.messageStatuses[anyCondition.value] }} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'mailSubstatus\'" md-cell>\n            {{ anyCondition.value === \'null\' ? (\'TOOLS.NONE\' | translate) : (vm_dc.mailSubstatuses | filter : {\'name\': anyCondition.value } : true)[0].name }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'offlineMessage\'" md-cell>\n            {{anyCondition.value}} </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n            {{ anyCondition.createdAt | formatdate }}\n          </td>\n          <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="3">\n                <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                  <md-button ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" translate="TOOLS.EDIT_ANYCONDITION">\n                    Edit AnyCondition\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                  <md-button ng-click="vm_dc.deleteConfirm(anyCondition, $event)" translate="TOOLS.DELETE_ANYCONDITION">\n                    Delete AnyCondition\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n        <tr md-row ng-if="!vm_dc.anyConditions.rows.length">\n          <td md-cell colspan="5">\n            <div layout="row" layout-align="center center">\n              <span class="text-boxed-light" translate="TOOLS.NO_ANYCONDITION_AVAILABLE">No anycondition\n                available</span>\n            </div>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.anyConditions.count }}" md-on-paginate="vm_dc.getAnyConditions" md-page-select>\n  </md-table-pagination>\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/create/dialog.html",'<md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">\n  <form name="anyConditionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newAnyCondition ? \'TOOLS.NEW_ANYCONDITION\' : \'TOOLS.EDIT_ANYCONDITION\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.FIELD">Field</label>\n        <md-select name="field" ng-model="vm.anyCondition.field" ng-change="vm.onFieldSelection()" md-autofocus required>\n          <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}\n          </md-option>\n          <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'agent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.AGENT\' | translate }}\n          </md-option>\n          <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}\n          </md-option>\n          <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'">\n            {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n          <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'mailSubstatus\'" ng-if="vm.trigger.channel == \'mail\'"> {{ \'TOOLS.MAIL_SUBSTATUS\' | translate }}\n          </md-option>\n          <md-option ng-value="\'offlineMessage\'" ng-if="vm.trigger.channel == \'chat\'"> {{ \'TOOLS.OFFLINE_MESSAGE\' | translate }}\n          </md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'field\'].$error" ng-show="anyConditionForm[\'field\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.OPERATOR">Operator</label>\n        <md-select name="operator" ng-model="vm.anyCondition.operator" required>\n          <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n          <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'operator\'].$error" ng-show="anyConditionForm[\'operator\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'account\'" class="md-block">\n        <label translate="TOOLS.ACCOUNT">Account</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="value.id.toString()" ng-repeat="value in vm.accounts" ng-disabled="value.canSelect === false">\n            {{ value.name }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.QUEUE">Queue</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">\n            {{ value.name }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="value.id.toString()" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">\n            {{ value.exten }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'agent\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.AGENT">Agent</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="value.name" ng-repeat="value in vm.agents" ng-disabled="value.canSelect === false">\n            {{ value.fullname }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'lastevent\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="status.value" ng-repeat="status in vm.callStatuses">\n            {{ status.name }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'mailSubstatus\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="mailSubstatus.name" ng-repeat="mailSubstatus in vm.mailSubstatuses">\n            {{ mailSubstatus.name }}</md-option>\n          <md-option ng-value="\'null\'">{{\'TOOLS.NONE\' | translate}}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="\'opened\'">Opened</md-option>\n          <md-option ng-value="\'closed\'">Closed</md-option>\n          <md-option ng-if="vm.trigger.channel==\'mail\'" ng-value="\'substatus\'">SubStatus</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="\'in\'">Incoming</md-option>\n          <md-option ng-value="\'out\'">Outgoing</md-option>\n          <md-option ng-value="\'accept\'">Accepted</md-option>\n          <md-option ng-value="\'reject\'">Rejected</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'offlineMessage\' && vm.trigger.channel == \'chat\'" class="md-block">\n        <label translate="TOOLS.CHAT">Chat</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="\'created\'">Created</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAnyCondition" ng-click="vm.saveAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAnyCondition" ng-click="vm.addNewAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ANYCONDITION" translate-attr-aria-label="TOOLS.ADD_ANYCONDITION">\n          ADD ANYCONDITION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAnyCondition" ng-click="vm.deleteAnyCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/view.html",'<div id="tools-trigger" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-triggers-button md-icon-button" aria-label="Go to triggers" ng-click="vm.gotoTriggers()" translate translate-attr-aria-label="TOOLS.GO_TO_TRIGGERS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="trigger-image" hide-xs>\n          <img ng-src="assets/images/business/triggers.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">#{{ vm.trigger.id }}\n            <span ng-if="vm.trigger.name">{{ vm.trigger.name }}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="TOOLS.CREATED_AT"></span> <span>{{ vm.trigger.createdAt | date:\'medium\' }}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveTrigger()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (allconditionsForm.$invalid) || (anyconditionsForm.$invalid) || (actionsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trigger-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.trigger.name" required autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CHANNEL">Channel</label>\n                <md-select name="channel" ng-model="vm.trigger.channel" required disabled>\n                  <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n                  <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel">\n                    {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n                  <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n                  <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n                  <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n                  <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n                  <md-option ng-value="\'whatsapp\'" ng-if="vm.license.whatsapp"> {{ \'TOOLS.WHATSAPP\' | translate }}\n                  </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'channel\'].$error" ng-show="generalForm[\'channel\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.trigger.status" aria-label="Status" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="TOOLS.STATUS">Status</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.trigger.description" ng-disabled="!vm.crudPermissions.canEdit">\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.CONDITIONS&ACTIONS">CONDITIONS&ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trigger-detail-form-container allconditions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/allconditions/allconditions.html\'">\n          </div>\n          <div class="trigger-detail-form-container anyconditions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/anyconditions/anyconditions.html\'">\n          </div>\n          <div class="trigger-detail-form-container actions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/actions/actions.html\'">\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/triggers.html",'<div id="triggers" class="page-layout simple left-sidenav inner-sidenav">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.TRIGGERS">Triggers</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTriggers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedTriggers =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-triggers-count">\n          <span>{{ vm.selectedTriggers.length }}</span>\n          <span translate="TOOLS.SELECTED">Selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTriggers()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTriggers()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTriggers" csv-label="true" filename="triggers.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTriggers($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n      \x3c!-- TRIGGER TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTriggers" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTriggers">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="channel">{{ \'TOOLS.CHANNEL\' | translate }}</th>\n                <th md-column md-order-by="status">{{ \'TOOLS.STATUS\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.triggers.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="trigger" md-select-id="id" ng-repeat="trigger in vm.triggers.rows">\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="id ">{{ trigger.id }}</td>\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="name ">{{ trigger.name }}</td>\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="channel ">\n                  {{ \'TOOLS.\' + trigger.channel | uppercase | translate }}</td>\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="status ">\n                  <md-icon md-colors="{color: {{ trigger.status ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ trigger.status ? \'icon-check\' : \'icon-close\' }}"></md-icon>\n                </td>\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="description ">\n                  {{ trigger.description }}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.goToEditState(trigger)" translate="TOOLS.EDIT_TRIGGER">\n                          Edit Trigger\n                        </md-button>\n                      </md-menu-item>\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteconfirm(trigger, $event)" translate="TOOLS.DELETE_TRIGGER">\n                          Delete Trigger\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.triggers.count }}" md-on-paginate="vm.getTriggers" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TRIGGER TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n  \x3c!-- ADD TRIGGER BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trigger-button" ng-click="vm.createOrEditTrigger($event)" aria-label="add trigger" translate translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TRIGGER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/trunks/create/dialog.html",'<md-dialog class="trunk-dialog" aria-label="New Trunk">\n  <form name="trunkForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n        <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n        <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.HOST">host</label>\n        <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n\n        <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n        <div ng-messages="trunkForm[\'host\'].$error" ng-show="trunkForm[\'host\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.SECRET">secret</label>\n        <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n        <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n        <div ng-messages="trunkForm[\'secret\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n        <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n\n        <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n        <div ng-messages="trunkForm[\'defaultuser\'].$error" ng-show="trunkForm[\'defaultuser\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.REGISTRY">registry</label>\n        <input type="text" name="registry" ng-model="vm.trunk.registry">\n\n        <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n        <div ng-messages="trunkForm[\'registry\'].$error" ng-show="trunkForm[\'registry\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.trunk.description">\n\n        <div ng-messages="trunkForm[\'description\'].$error" ng-show="trunkForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrunk" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid || trunkForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrunk" ng-click="vm.addNewTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRUNK" translate-attr-aria-label="TOOLS.ADD_TRUNK">\n          ADD TRUNK\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrunk" ng-click="vm.deleteTrunk($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/clone/clone.html",'<md-dialog class="trunk-dialog" aria-label="Clone Trunk">\n  <form name="trunkForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n        <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n        <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_TRUNK" translate-attr-aria-label="TOOLS.CLONE_TRUNK">\n        CLONE TRUNK\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/view.html",'<div id="tools-trunk" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-trunks-button md-icon-button" aria-label="Go to trunks" ng-click="vm.gotoTrunks()" translate translate-attr-aria-label="TOOLS.GO_TO_TRUNKS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="trunk-image" hide-xs>\n          <img ng-src="assets/images/business/trunks.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.trunk.id}}\n            <span ng-if="vm.trunk.name">{{vm.trunk.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trunk.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.trunk, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="TOOLS.GOTO_TRUNK"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.trunk, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="TOOLS.CLONE_TRUNK"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveTrunk()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (otherFieldsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trunk-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.trunk.active" aria-label="active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.HOST">host</label>\n                <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n                <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.SECRET">secret</label>\n                <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n                <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n                <div ng-messages="generalForm[\'secret\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n                <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n                <div ng-messages="generalForm[\'defaultuser\'].$error" ng-show="generalForm[\'defaultuser\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CONTEXT">context</label>\n                <md-select name="context" ng-model="vm.trunk.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.CONTEXT"></span></div>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CONTEXT_REQUIRED">context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CALLERID">callerid</label>\n                <input type="text" name="callerid" ng-model="vm.trunk.callerid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.CALLERID"></span></div>\n                <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CALLERID_REQUIRED">callerid field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.trunk.type" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'friend\'">Friend</md-option>\n                  <md-option ng-value="\'user\'">User</md-option>\n                  <md-option ng-value="\'peer\'">Peer</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.TYPE"></span></div>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DTMFMODE">dtmfmode</label>\n                <md-select name="dtmfmode" ng-model="vm.trunk.dtmfmode" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'rfc2833\'">rfc2833</md-option>\n                  <md-option ng-value="\'info\'">info</md-option>\n                  <md-option ng-value="\'shortinfo\'">shortinfo</md-option>\n                  <md-option ng-value="\'inband\'">inband</md-option>\n                  <md-option ng-value="\'auto\'">auto</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.DTMFMODE"></span></div>\n                <div ng-messages="generalForm[\'dtmfmode\'].$error" ng-show="generalForm[\'dtmfmode\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DTMFMODE_REQUIRED">dtmfmode field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAT">nat</label>\n                <md-select name="nat" ng-model="vm.trunk.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'force_rport\'">force_rport</md-option>\n                  <md-option ng-value="\'comedia\'">comedia</md-option>\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'never\'">never</md-option>\n                  <md-option ng-value="\'route\'">route</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.NAT"></span></div>\n                <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAT_REQUIRED">nat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.QUALIFY">qualify</label>\n                <md-select name="qualify" ng-model="vm.trunk.qualify" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.QUALIFY"></span></div>\n                <div ng-messages="generalForm[\'qualify\'].$error" ng-show="generalForm[\'qualify\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.QUALIFY_REQUIRED">qualify field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.ALLOWCODECS">AllowCodecs</label>\n                <md-select name="allow" ng-model="vm.trunk.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ulaw\'">ulaw</md-option>\n                  <md-option ng-value="\'alaw\'">alaw</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                  <md-option ng-value="\'g723\'">g723</md-option>\n                  <md-option ng-value="\'g726\'">g726</md-option>\n                  <md-option ng-value="\'g722\'">g722</md-option>\n                  <md-option ng-value="\'g729\'">g729</md-option>\n                  <md-option ng-value="\'ilbc\'">ilbc</md-option>\n                  <md-option ng-value="\'opus\'">opus</md-option>\n                  <md-option ng-value="\'h264\'">h264</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.ALLOWCODECS"></span></div>\n                <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.INSECURE">insecure</label>\n                <md-select name="insecure" ng-model="vm.trunk.insecure" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'port\'">port</md-option>\n                  <md-option ng-value="\'invite\'">invite</md-option>\n                  <md-option ng-value="\'very\'">very</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.INSECURE"></span></div>\n                <div ng-messages="generalForm[\'insecure\'].$error" ng-show="generalForm[\'insecure\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.INSECURE_REQUIRED">insecure field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CALL_LIMIT">call_limit</label>\n                <input type="number" name="call_limit" ng-model="vm.trunk.call_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.CALL_LIMIT"></span></div>\n                <div ng-messages="generalForm[\'call_limit\'].$error" ng-show="generalForm[\'call_limit\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CALL_LIMIT_REQUIRED">call_limit field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.trunk.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trunk-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.REGISTRY">registry</label>\n                <input type="text" name="registry" ng-model="vm.trunk.registry" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n                <div ng-messages="advancedForm[\'registry\'].$error" ng-show="advancedForm[\'registry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DIRECTMEDIA">directmedia</label>\n                <md-select name="directmedia" ng-model="vm.trunk.directmedia" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'nonat\'">nonat</md-option>\n                  <md-option ng-value="\'update\'">update</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.DIRECTMEDIA"></span></div>\n                <div ng-messages="advancedForm[\'directmedia\'].$error" ng-show="advancedForm[\'directmedia\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DIRECTMEDIA_REQUIRED">directmedia field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CALLCOUNTER">callcounter</label>\n                <md-select name="callcounter" ng-model="vm.trunk.callcounter" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.CALLCOUNTER"></span></div>\n                <div ng-messages="advancedForm[\'callcounter\'].$error" ng-show="advancedForm[\'callcounter\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CALLCOUNTER_REQUIRED">callcounter field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.FROMDOMAIN">fromdomain</label>\n                <input type="text" name="fromdomain" ng-model="vm.trunk.fromdomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.FROMDOMAIN"></span></div>\n                <div ng-messages="advancedForm[\'fromdomain\'].$error" ng-show="advancedForm[\'fromdomain\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.FROMDOMAIN_REQUIRED">fromdomain field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.FROMUSER">fromuser</label>\n                <input type="text" name="fromuser" ng-model="vm.trunk.fromuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.FROMUSER"></span></div>\n                <div ng-messages="advancedForm[\'fromuser\'].$error" ng-show="advancedForm[\'fromuser\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.FROMUSER_REQUIRED">fromuser field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.OUTBOUNDPROXY">outboundproxy</label>\n                <input type="text" name="outboundproxy" ng-model="vm.trunk.outboundproxy" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.OUTBOUNDPROXY"></span></div>\n                <div ng-messages="advancedForm[\'outboundproxy\'].$error" ng-show="advancedForm[\'outboundproxy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.OUTBOUNDPROXY_REQUIRED">outboundproxy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.ADD_PHONE_TO_URI">Add_phone_to_URI</label>\n                <md-select name="usereqphone" ng-model="vm.trunk.usereqphone" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.ADD_PHONE_TO_URI"></span></div>\n                <div ng-messages="advancedForm[\'usereqphone\'].$error" ng-show="advancedForm[\'usereqphone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.ADD_PHONE_TO_URI_REQUIRED">Add_phone_to_URI field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.TRUST_REMOTE_PARTY_ID">Trust_Remote_Party_ID</label>\n                <md-select name="trustrpid" ng-model="vm.trunk.trustrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.TRUST_REMOTE_PARTY_ID"></span></div>\n                <div ng-messages="advancedForm[\'trustrpid\'].$error" ng-show="advancedForm[\'trustrpid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.TRUST_REMOTE_PARTY_ID_REQUIRED">Trust_Remote_Party_ID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.SEND_REMOTE_PARTY_ID_HEADER">Send_Remote_Party_ID_header</label>\n                <md-select name="sendrpid" ng-model="vm.trunk.sendrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n\n                  <md-option ng-value="\'pai\'"> {{ \'TOOLS.PAI\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.SEND_REMOTE_PARTY_ID_HEADER"></span></div>\n                <div ng-messages="advancedForm[\'sendrpid\'].$error" ng-show="advancedForm[\'sendrpid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.SEND_REMOTE_PARTY_ID_HEADER_REQUIRED">Send_Remote_Party_ID_header field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.ENCRYPTION">encryption</label>\n                <md-select name="encryption" ng-model="vm.trunk.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.ENCRYPTION"></span></div>\n                <div ng-messages="advancedForm[\'encryption\'].$error" ng-show="advancedForm[\'encryption\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.ENCRYPTION_REQUIRED">encryption field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.PORT">port</label>\n                <input type="number" name="port" ng-model="vm.trunk.port" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.PORT"></span></div>\n                <div ng-messages="advancedForm[\'port\'].$error" ng-show="advancedForm[\'port\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.PORT_REQUIRED">port field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.TRANSPORT">Transport</label>\n                <md-select name="transport" ng-model="vm.trunk.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'udp\'">udp</md-option>\n                  <md-option ng-value="\'tcp\'">tcp</md-option>\n                  <md-option ng-value="\'ws\'">ws</md-option>\n                  <md-option ng-value="\'wss\'">wss</md-option>\n                  <md-option ng-value="\'tls\'">tls</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.TRANSPORT"></span></div>\n                <div ng-messages="advancedForm[\'transport\'].$error" ng-show="advancedForm[\'transport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.T38PT_UDPTL">t38pt_udptl</label>\n                <input type="string" name="t38pt_udptl" ng-model="vm.trunk.t38pt_udptl" value="no" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.T38PT_UDPTL"></span></div>\n                <div ng-messages="advancedForm[\'t38pt_udptl\'].$error" ng-show="advancedForm[\'t38pt_udptl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.T38PT_UDPTL_REQUIRED">t38pt_udptl field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.VIDEOSUPPORT">Videosupport</label>\n                <md-select name="videosupport" ng-model="vm.trunk.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'always\'">Always</md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'videosupport\'].$error" ng-show="advancedForm[\'videosupport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.OTHERFIELDS">OTHERFIELDS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trunk-detail-form-container otherfields md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.OTHERFIELDS">OTHERFIELDS</div>\n            </div>\n            <form name="otherFieldsForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.OTHERFIELDS">otherFields</label>\n                <textarea name="otherFields" ng-model="vm.trunk.otherFields" autofocus></textarea>\n                <div class="hint"><span translate="TOOLS.HELP.OTHERFIELDS"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/trunks/trunks.html",'<div id="trunks" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.TRUNKS">Trunks</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTrunks.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTrunks =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-trunks-count">\n          <span>{{vm.selectedTrunks.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTrunks()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTrunks()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTrunks" csv-label="true" filename="trunks.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTrunks($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TRUNK TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTrunks" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="host">{{ \'TOOLS.HOST\' | translate }}</th>\n                <th md-column md-order-by="registry">{{ \'TOOLS.REGISTRY\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.trunks.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="trunk" md-select-id="id" ng-repeat="trunk in vm.trunks.rows">\n                <td md-cell ng-if="trunk.userpic"><img class="avatar" alt="{{trunk.name}}" ng-src="api/users/{{trunk.id}}/avatar" /></td>\n                <td md-cell ng-if="!trunk.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trunk.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="id ">{{trunk.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="name ">{{trunk.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="active ">\n                  <md-icon md-colors="{color: {{trunk.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trunk.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="host ">{{trunk.host}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="registry ">{{trunk.registry}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="description ">{{trunk.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(trunk, $event    )" translate="TOOLS.EDIT_TRUNK">\n                          Edit Trunk\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(trunk, $event    )" translate="TOOLS.CLONE_TRUNK">\n                          clone Trunk\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(trunk, $event    )" translate="TOOLS.GOTOREALTIME_TRUNK">\n                          goToRealtime Trunk\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(trunk, $event    )" translate="TOOLS.DELETE_TRUNK">\n                          Delete Trunk\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.trunks.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TRUNK TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TRUNK BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trunk-button" ng-click="vm.createOrEditTrunk($event)" aria-label="add trunk" translate translate-attr-aria-label="TOOLS.ADD_TRUNK">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TRUNK BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/variables/create/dialog.html",'<md-dialog class="variable-dialog" aria-label="New Variable">\n  <form name="variableForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.variable.name" ng-required="true" autofocus>\n\n        <div ng-messages="variableForm[\'name\'].$error" ng-show="variableForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.variable.description">\n\n        <div ng-messages="variableForm[\'description\'].$error" ng-show="variableForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVariable" ng-click="vm.saveVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid || variableForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVariable" ng-click="vm.addNewVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_VARIABLE" translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n          ADD VARIABLE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVariable" ng-click="vm.deleteVariable($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/variables/variables.html",'<div id="variables" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.VARIABLES">Variables</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVariables.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVariables =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-variables-count">\n          <span>{{vm.selectedVariables.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVariables()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVariables()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVariables" csv-label="true" filename="variables.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVariables($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VARIABLE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVariables" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVariables">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.variables.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="variable" md-select-id="id" ng-repeat="variable in vm.variables.rows">\n                <td md-cell ng-if="variable.userpic"><img class="avatar" alt="{{variable.name}}" ng-src="api/users/{{variable.id}}/avatar" /></td>\n                <td md-cell ng-if="!variable.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{variable.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="id ">{{variable.id}}</td>\n                <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="name ">{{variable.name}}</td>\n                <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="description ">{{variable.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(variable, $event    )" translate="TOOLS.EDIT_VARIABLE">\n                          Edit Variable\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(variable, $event    )" translate="TOOLS.DELETE_VARIABLE">\n                          Delete Variable\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.variables.count}}" md-on-paginate="vm.getVariables" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VARIABLE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VARIABLE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-variable-button" ng-click="vm.createOrEditVariable($event)" aria-label="add variable" translate translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VARIABLE BUTTON --\x3e\n</div>'),e.put("app/main/apps/video/views/screenRecordings/create/dialog.html",'<md-dialog class="screenRecording-dialog" aria-label="New screenRecording">\n  <form name="screenRecordingForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VIDEO.RATING">Rating</label>\n        <md-select name="rating" ng-model="vm.screenRecording.rating" autofocus ng-disabled="!vm.newscreenRecording && !vm.crudPermissions.canEdit">\n          <md-option ng-value="null">{{\'VIDEO.NO_RATING\' | translate}}</md-option>\n          <md-option value="1">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n          </md-option>\n          <md-option value="2">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n          </md-option>\n          <md-option value="3">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n          </md-option>\n          <md-option value="4">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n          </md-option>\n          <md-option value="5">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n          </md-option>\n        </md-select>\n        <div ng-messages="screenRecordingForm[\'rating\'].$error" ng-show="screenRecordingForm[rating].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VIDEO.ERRORS.RATING_REQUIRED">Rating field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newscreenRecording" ng-click="vm.savescreenRecording()" class="send-button md-accent md-raised" ng-disabled="screenRecordingForm.$invalid || screenRecordingForm.$pristine" aria-label="SAVE" translate="VIDEO.SAVE" translate-attr-aria-label="VIDEO.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newscreenRecording" ng-click="vm.addNewscreenRecording()" class="send-button md-accent md-raised" ng-disabled="screenRecordingForm.$invalid" aria-label="ADD" translate="VIDEO.ADD_SCREENRECORDING" translate-attr-aria-label="VIDEO.ADD_SCREENRECORDING">\n          ADD SCREENRECORDING\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newscreenRecording" ng-click="vm.deletescreenRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VIDEO.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VIDEO.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/video/views/screenRecordings/partialViews/play.html",'<md-dialog class="play-dialog" aria-label="play">\n  <form name="playForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="{{ vm.app.toUpperCase() }}.{{  vm.label.toUpperCase() }}">Play Recording</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content ng-hide="vm.loading">\n      <div layout="row" layout-sm flex>\n        \x3c!-- VIRTUAL field --\x3e\n        <md-card>\n\n          <md-card-title ng-if="vm.actionOptions.upperTitle">\n            <md-card-title-text>\n              <span class="md-headline">{{ vm.filename }}</span>\n              <span class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.UPDATEDAT"></span>: {{ vm.recording.updatedAt}}</span>\n            </md-card-title-text>\n          </md-card-title>\n\n          \x3c!-- video recording directive --\x3e\n          <ms-dialog-recording ng-if="vm.format" id="vm.recording.id" title="vm.filename" element="vm.element" model="vm.route" path="vm.path" class="md-card-image"></ms-dialog-recording>\n          \x3c!-- / video recording directive --\x3e\n\n          <span ng-if="!vm.format">\n            <em ng-if="vm.found">{{ vm.app.toUpperCase() + \'.CANT_PLAY_THIS_FILE\' | translate }}</em>\n            <em ng-if="!vm.found">{{ vm.app.toUpperCase() + \'.FILE_NOT_FOUND\' | translate }}</em>\n          </span>\n\n          <md-card-title ng-if="vm.actionOptions.lowerTitle">\n            <md-card-title-text>\n              <span class="md-headline">{{ vm.filename }}</span>\n              <span class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.UPDATEDAT"></span>:{{ vm.recording.updatedAt}}</span>\n              <span ng-if="vm.actionOptions.properties" class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.PROPERTIES"></span>:</span>\n            </md-card-title-text>\n          </md-card-title>\n\n          <md-card-content ng-if="vm.actionOptions.properties">\n            <md-list>\n              <md-list-item class="md-2-line" ng-repeat="(key,value) in vm.properties" ng-click="null" ng-if="key != \'value\' && key != \'updatedAt\' && key != \'queue\'">\n\n                <md-icon ng-if="vm.icon" class="md-avatar-icon" md-font-icon="vm.actionOptions.propertiesIcon" class="s24"></md-icon>\n\n                <div class="md-list-item-text" layout="column">\n                  <p><b><span translate="{{ vm.app.toUpperCase() }}.{{ key.toUpperCase() }}"></span></b></p>\n                  <p>{{ value }}\n                    <p>\n                </div>\n              </md-list-item>\n            </md-list>\n          </md-card-content>\n\n\n        </md-card>\n      </div>\n    </md-dialog-content>\n    <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n      <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n    </div>\n  </form>\n</md-dialog>'),e.put("app/main/apps/video/views/screenRecordings/screenRecordings.html",'<div id="screenRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-video" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VIDEO.SCREENRECORDINGS">ScreenRecordings</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VIDEO.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getScreenRecordings()"></ms-quick-filter>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedScreenRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedScreenRecordings =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VIDEO.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-screenRecordings-count">\n          <span>{{vm.selectedScreenRecordings.length}}</span>\n          <span translate="VIDEO.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VIDEO.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllScreenRecordings()" translate="VIDEO.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectScreenRecordings()" translate="VIDEO.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedScreenRecordings" csv-label="true" filename="screenRecordings.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScreenRecordings($event)" aria-label="delete selected" translate translate-attr-label="VIDEO.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SCREENRECORDING TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedScreenRecordings" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScreenRecordings">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VIDEO.ID\' | translate }}</th>\n                <th md-column md-order-by="rating">{{ \'VIDEO.RATING\' | translate }}</th>\n                <th md-column md-order-by="UserId">{{ \'VIDEO.AGENT\' | translate }}</th>\n                <th md-column md-order-by="duration">{{ \'VIDEO.DURATION\' | translate }}</th>\n                <th md-column md-order-by="startedAt">{{ \'VIDEO.RECORDSTARTTIME\' | translate }}</th>\n                <th md-column md-order-by="closedAt">{{ \'VIDEO.RECORDENDTIME\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.screenRecordings.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VIDEO.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="screenRecording" md-select-id="id" ng-repeat="screenRecording in vm.screenRecordings.rows">\n                <td md-cell ng-if="screenRecording.userpic"><img class="avatar" alt="{{screenRecording.name}}" ng-src="api/users/{{screenRecording.id}}/avatar" /></td>\n                <td md-cell ng-if="!screenRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{screenRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="id ">{{screenRecording.id}}</td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="rating ">\n                  <md-icon md-font-icon="icon-star" style="color:red" ng-show="screenRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:screenRecording.rating"></md-icon><span ng-hide="screenRecording.rating" translate="VIDEO.NO_RATING">No rating</span>\n                </td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="UserId ">{{ (vm.users | filter : {\'id\':screenRecording.UserId} : true)[0].fullname }}</td>\n                <td md-cell><span ng-bind="vm.convertDuration(screenRecording.duration)"></span></td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="startedAt ">{{screenRecording.startedAt | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="closedAt ">{{screenRecording.closedAt | date:\'medium\' }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VIDEO.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.playrecording(screenRecording, $event  , \'value\'  , \'play_screenrecording\'  , \'video\' )" translate="VIDEO.PLAY_SCREENRECORDING">\n                          play screenRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadScreenRecordings">\n\n                        <md-button ng-click="vm.downloadfile2(screenRecording, $event  , \'screen/recordings\'   )" translate="VIDEO.DOWNLOAD_SCREENRECORDING">\n                          Download screenRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(screenRecording, $event    )" translate="VIDEO.DELETE_SCREENRECORDING">\n                          Delete screenRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VIDEO.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VIDEO.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VIDEO.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.screenRecordings.count}}" md-on-paginate="vm.getScreenRecordings" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SCREENRECORDING TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/routing/dialog.html",'<md-dialog ng-init="vm.init()" class="voice-routing-dialog" aria-label="New routing application">\n  <form name="routingAppForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'VOICE.EDIT_\' + vm.application.appType | uppercase | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content ng-switch="vm.application.appType">\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div ng-switch-when="agi">\n        <div ng-include="\'app/main/apps/voice/routing/views/agi.html\'"></div>\n      </div>\n      <div ng-switch-when="custom">\n        <div ng-include="\'app/main/apps/voice/routing/views/custom.html\'"></div>\n      </div>\n      <div ng-switch-when="dial">\n        <div ng-include="\'app/main/apps/voice/routing/views/dial.html\'"></div>\n      </div>\n      <div ng-switch-when="externalDial">\n        <div ng-include="\'app/main/apps/voice/routing/views/externalDial.html\'"></div>\n      </div>\n      <div ng-switch-when="goTo">\n        <div ng-include="\'app/main/apps/voice/routing/views/goTo.html\'"></div>\n      </div>\n      <div ng-switch-when="hangup">\n        <div ng-include="\'app/main/apps/voice/routing/views/hangup.html\'"></div>\n      </div>\n      <div ng-switch-when="internalDial">\n        <div ng-include="\'app/main/apps/voice/routing/views/internalDial.html\'"></div>\n      </div>\n      <div ng-switch-when="outboundDial">\n        <div ng-include="\'app/main/apps/voice/routing/views/outboundDial.html\'"></div>\n      </div>\n      <div ng-switch-when="playback">\n        <div ng-include="\'app/main/apps/voice/routing/views/playback.html\'"></div>\n      </div>\n      <div ng-switch-when="queue">\n        <div ng-include="\'app/main/apps/voice/routing/views/queue.html\'"></div>\n      </div>\n      <div ng-switch-when="ringGroup">\n        <div ng-include="\'app/main/apps/voice/routing/views/ringGroup.html\'"></div>\n      </div>\n      <div ng-switch-when="set">\n        <div ng-include="\'app/main/apps/voice/routing/views/set.html\'"></div>\n      </div>\n      <div ng-switch-when="voicemail">\n        <div ng-include="\'app/main/apps/voice/routing/views/voicemail.html\'"></div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveRoutingApp()" class="send-button md-accent md-raised" ng-disabled="routingAppForm.$invalid || routingAppForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/routing/interval/dialog.html",'<md-dialog ng-init="vm.initialize()" class="interval-dialog" aria-label="Edit Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'TOOLS.EDIT_INTERVAL\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.crudPermissions.canEdit" ng-change="vm.onTypeChange()">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | startcase }}</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.crudPermissions.canEdit" required>\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows" ng-disabled="interval.canSelect === false">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | startcase }}</span></md-option>\n          </md-select>\n        </md-input-container>\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | startcase }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | startcase }}</span></md-option>\n          </md-select>\n        </md-input-container>\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | startcase }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="start center">\n      <md-button type="submit" ng-if="vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/routing/views/agi.html",'<md-input-container class="md-block">\n  <label translate="VOICE.PROJECT">Project</label>\n  <md-select name="project" ng-model="vm.application.project" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects.rows" ng-disabled="project.canSelect === false">{{ project.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'project\'].$error" ng-show="routingAppForm[\'project\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/custom.html",'<md-input-container class="md-block">\n  <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n  <input type="text" name="app" ng-model="vm.application.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'app\'].$error" ng-show="routingAppForm[\'app\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.ARGUMENTS">Arguments</label>\n  <input type="text" name="appdata" ng-model="vm.application.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'appdata\'].$error" ng-show="routingAppForm[\'appdata\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/dial.html",'<md-input-container class="md-block">\n  <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n  <input type="text" name="tech" ng-model="vm.application.tech" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'tech\'].$error" ng-show="routingAppForm[\'tech\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/externalDial.html",'<md-input-container class="md-block">\n  <label translate="VOICE.TRUNK">Trunk</label>\n  <md-select name="trunk" ng-model="vm.application.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks.rows" ng-disabled="trunk.canSelect === false">{{\n      trunk.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'trunk\'].$error" ng-show="routingAppForm[\'trunk\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.PHONE">Phone</label>\n  <input type="text" name="phone" ng-model="vm.application.phone" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'phone\'].$error" ng-show="routingAppForm[\'phone\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/goTo.html",'<md-input-container class="md-block">\n  <label translate="VOICE.CONTEXT">Context</label>\n  <md-select name="context" ng-model="vm.application.context" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{\n      context.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'context\'].$error" ng-show="routingAppForm[\'context\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.EXTENSION">Extension</label>\n  <input type="text" name="extension" ng-model="vm.application.extension" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'extension\'].$error" ng-show="routingAppForm[\'extension\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.PRIORITY">Priority</label>\n  <input type="text" name="priority" ng-model="vm.application.priority" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'priority\'].$error" ng-show="routingAppForm[\'priority\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/hangup.html","<md-input-container class=\"md-block\">\n  <label translate=\"VOICE.HANGUP_CAUSE\">Hangup_Cause</label>\n  <md-select name=\"appdata\" ng-model=\"vm.application.appdata\" autofocus required ng-disabled=\"!vm.crudPermissions.canEdit\">\n    <md-option ng-value=\"'1'\"> {{ 'VOICE.HANGUPCAUSE_1' | translate }} </md-option>\n    <md-option ng-value=\"'16'\"> {{ 'VOICE.HANGUPCAUSE_16' | translate }} </md-option>\n    <md-option ng-value=\"'17'\"> {{ 'VOICE.HANGUPCAUSE_17' | translate }} </md-option>\n    <md-option ng-value=\"'18'\"> {{ 'VOICE.HANGUPCAUSE_18' | translate }} </md-option>\n    <md-option ng-value=\"'21'\"> {{ 'VOICE.HANGUPCAUSE_21' | translate }} </md-option>\n    <md-option ng-value=\"'22'\"> {{ 'VOICE.HANGUPCAUSE_22' | translate }} </md-option>\n    <md-option ng-value=\"'27'\"> {{ 'VOICE.HANGUPCAUSE_27' | translate }} </md-option>\n    <md-option ng-value=\"'38'\"> {{ 'VOICE.HANGUPCAUSE_38' | translate }} </md-option>\n    <md-option ng-value=\"'41'\"> {{ 'VOICE.HANGUPCAUSE_41' | translate }} </md-option>\n  </md-select>\n  <div ng-messages=\"routingAppForm['appdata'].$error\" ng-show=\"routingAppForm['appdata'].$touched\" role=\"alert\">\n    <div ng-message=\"required\">\n      <span translate=\"VOICE.ERRORS.HANGUP_CAUSE_REQUIRED\">Hangup_Cause field is required</span>\n    </div>\n  </div>\n</md-input-container>"),e.put("app/main/apps/voice/routing/views/internalDial.html",'<md-input-container class="md-block">\n  <label translate="VOICE.USER">User</label>\n  <md-select name="user" ng-model="vm.application.user" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users.rows" ng-disabled="user.canSelect === false">\n      {{ user.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'user\'].$error" ng-show="routingAppForm[\'user\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/outboundDial.html",'<md-input-container class="md-block">\n  <label translate="VOICE.TRUNK">Trunk</label>\n  <md-select name="trunk" ng-model="vm.application.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks.rows" ng-disabled="trunk.canSelect === false">{{\n      trunk.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'trunk\'].$error" ng-show="routingAppForm[\'trunk\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.CALLER_ID">Caller_ID</label>\n  <input type="text" name="callerID" ng-model="vm.application.callerID" ng-disabled="!vm.crudPermissions.canEdit">\n  <div class="hint"><span translate="VOICE.HELP.CALLER_ID"></span></div>\n  <div ng-messages="routingAppForm[\'callerID\'].$error" ng-show="routingAppForm[\'callerID\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED">Caller_ID field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.PREFIX">Prefix</label>\n  <input type="text" name="prefix" ng-model="vm.application.prefix" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'prefix\'].$error" ng-show="routingAppForm[\'prefix\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TAGS">Tags</label>\n  <md-select name="tag" ng-model="vm.application.tag" ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'--\'">None</md-option>\n    <md-option ng-value="tag.name" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{ tag.name }}\n    </md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'tag\'].$error" ng-show="routingAppForm[\'tag\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TAGS_REQUIRED">Tags field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/playback.html",'<md-input-container class="md-block">\n  <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n  <md-select name="sound" ng-model="vm.application.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds.rows" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'sound\'].$error" ng-show="routingAppForm[\'sound\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <md-switch ng-model="vm.application.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/queue.html",'<md-input-container class="md-block">\n  <label translate="VOICE.QUEUE">Queue</label>\n  <md-select name="queue" ng-model="vm.application.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows" ng-disabled="queue.canSelect === false">{{\n      queue.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'queue\'].$error" ng-show="routingAppForm[\'queue\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="URL" ng-model="vm.application.URL" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'URL\'].$error" ng-show="routingAppForm[\'URL\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n  <md-select name="sound" ng-model="vm.application.sound" ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'\'">None</md-option>\n    <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds.rows" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'sound\'].$error" ng-show="routingAppForm[\'sound\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.AGI">Agi</label>\n  <input type="text" name="agi" ng-model="vm.application.agi" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'agi\'].$error" ng-show="routingAppForm[\'agi\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.MACRO">Macro</label>\n  <input type="text" name="macro" ng-model="vm.application.macro" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'macro\'].$error" ng-show="routingAppForm[\'macro\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.GOSUB">GoSub</label>\n  <input type="text" name="gosub" ng-model="vm.application.gosub" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'gosub\'].$error" ng-show="routingAppForm[\'gosub\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.RULE">Rule</label>\n  <input type="text" name="rule" ng-model="vm.application.rule" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'rule\'].$error" ng-show="routingAppForm[\'rule\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.POSITION">Position</label>\n  <input type="number" name="position" ng-model="vm.application.position" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'position\'].$error" ng-show="routingAppForm[\'position\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <md-switch ng-model="vm.application.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/ringGroup.html",'<md-input-container class="md-block">\n  <label translate="VOICE.USER">User</label>\n  <md-select name="user" ng-model="vm.application.users" autofocus multiple required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users.rows" ng-disabled="user.canSelect === false">\n      {{ user.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'user\'].$error" ng-show="routingAppForm[\'user\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/set.html",'<md-input-container class="md-block">\n  <label translate="VOICE.VARIABLE">Variable</label>\n  <md-select name="variable" ng-model="vm.application.name" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="variable.name" ng-repeat="variable in vm.variables.rows" ng-disabled="variable.canSelect === false">{{\n      variable.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'variable\'].$error" ng-show="routingAppForm[\'variable\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.VALUE">Value</label>\n  <input type="text" name="value" ng-model="vm.application.value" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'value\'].$error" ng-show="routingAppForm[\'value\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/voicemail.html",'<md-input-container class="md-block">\n  <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n  <md-select name="voiceMail" ng-model="vm.application.voiceMail" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails.rows" ng-disabled="voiceMail.canSelect === false">{{ voiceMail.mailbox }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'voiceMail\'].$error" ng-show="routingAppForm[\'voiceMail\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/views/chanSpies/chanSpies.html",'<div id="chanSpies" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.CHANSPIES">ChanSpies</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedChanSpies.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedChanSpies =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-chanSpies-count">\n          <span>{{vm.selectedChanSpies.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllChanSpies()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectChanSpies()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedChanSpies" csv-label="true" filename="chanSpies.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChanSpies($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CHANSPY TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedChanSpies" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChanSpies">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="prefix">{{ \'VOICE.PREFIX\' | translate }}</th>\n                <th md-column md-order-by="auth">{{ \'VOICE.AUTH\' | translate }}</th>\n                <th md-column md-order-by="record">{{ \'VOICE.RECORD\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.chanSpies.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="chanSpy" md-select-id="id" ng-repeat="chanSpy in vm.chanSpies.rows">\n                <td md-cell ng-if="chanSpy.userpic"><img class="avatar" alt="{{chanSpy.name}}" ng-src="api/users/{{chanSpy.id}}/avatar" /></td>\n                <td md-cell ng-if="!chanSpy.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chanSpy.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="id ">{{chanSpy.id}}</td>\n                <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="name ">{{chanSpy.name}}</td>\n                <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="prefix ">{{chanSpy.prefix}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="auth ">\n                  <md-icon md-colors="{color: {{chanSpy.auth ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.auth ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="record ">\n                  <md-icon md-colors="{color: {{chanSpy.record ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.record ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="description ">{{chanSpy.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(chanSpy, $event    )" translate="VOICE.EDIT_CHANSPY">\n                          Edit chanSpy\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(chanSpy, $event    )" translate="VOICE.DELETE_CHANSPY">\n                          Delete chanSpy\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chanSpies.count}}" md-on-paginate="vm.getChanSpies" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CHANSPY TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CHANSPY BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chanSpy-button" ng-click="vm.createOrEditchanSpy($event)" aria-label="add chanSpy" translate translate-attr-aria-label="VOICE.ADD_CHANSPY">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CHANSPY BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/create/dialog.html",'<md-dialog class="chanSpy-dialog" aria-label="New chanSpy">\n  <form name="chanSpyForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.chanSpy.name" ng-required="true" autofocus>\n\n        <div ng-messages="chanSpyForm[\'name\'].$error" ng-show="chanSpyForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PREFIX">Prefix</label>\n        <input type="text" name="prefix" ng-model="vm.chanSpy.prefix" ng-required="true">\n\n        <div ng-messages="chanSpyForm[\'prefix\'].$error" ng-show="chanSpyForm[\'prefix\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.OPTIONS">Options</label>\n        <md-select name="options" ng-model="vm.chanSpy.options" multiple required>\n          <md-option ng-value="\'b\'">b: Only spy on channels involved in a bridged call.</md-option>\n          <md-option ng-value="\'B\'">B: Instead of whispering on a single channel barge in on both channels involved in the call.</md-option>\n          <md-option ng-value="\'E\'">E: Exit when the spied-on channel hangs up.</md-option>\n          <md-option ng-value="\'o\'">o: Only listen to audio coming from this channel.</md-option>\n          <md-option ng-value="\'q\'">q: Don\'t play a beep when beginning to spy on a channel, or speak the selected channel name.</md-option>\n          <md-option ng-value="\'s\'">s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.</md-option>\n          <md-option ng-value="\'S\'">S: Stop when no more channels are left to spy on.</md-option>\n          <md-option ng-value="\'w\'">w: Enable whisper mode, so the spying channel can talk to the spied-on channel.</md-option>\n          <md-option ng-value="\'W\'">W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.</md-option>\n        </md-select>\n        <div ng-messages="chanSpyForm[\'options\'].$error" ng-show="chanSpyForm[\'options\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.chanSpy.auth" aria-label="Auth"><span translate="VOICE.AUTH">Auth</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.chanSpy.auth">\n        <label translate="VOICE.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.chanSpy.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n        <div ng-messages="chanSpyForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.chanSpy.record" aria-label="Record"><span translate="VOICE.RECORD">Record</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.chanSpy.record" class="md-block">\n        <label translate="VOICE.RECORDINGFORMAT">recordingFormat</label>\n        <md-select name="recordingFormat" ng-model="vm.chanSpy.recordingFormat" required>\n          <md-option ng-value="\'wav\'">wav</md-option>\n          <md-option ng-value="\'gsm\'">gsm</md-option>\n          <md-option ng-value="\'WAV\'">wav49</md-option>\n        </md-select>\n        <div ng-messages="chanSpyForm[\'recordingFormat\'].$error" ng-show="chanSpyForm[\'recordingFormat\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.RECORDINGFORMAT_REQUIRED">recordingFormat field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.chanSpy.description">\n\n        <div ng-messages="chanSpyForm[\'description\'].$error" ng-show="chanSpyForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newchanSpy" ng-click="vm.savechanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid || chanSpyForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newchanSpy" ng-click="vm.addNewchanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CHANSPY" translate-attr-aria-label="VOICE.ADD_CHANSPY">\n          ADD CHANSPY\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newchanSpy" ng-click="vm.deletechanSpy($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/contexts/contexts.html",'<div id="contexts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.CONTEXTS">Contexts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedContexts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedContexts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-contexts-count">\n          <span>{{vm.selectedContexts.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllContexts()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectContexts()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedContexts" csv-label="true" filename="contexts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedContexts($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CONTEXT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedContexts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContexts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.contexts.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="context" md-select-id="id" ng-repeat="context in vm.contexts.rows">\n                <td md-cell ng-if="context.userpic"><img class="avatar" alt="{{context.name}}" ng-src="api/users/{{context.id}}/avatar" /></td>\n                <td md-cell ng-if="!context.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{context.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditContext($event, context)" md-cell class="id ">{{context.id}}</td>\n                <td ng-click="vm.createOrEditContext($event, context)" md-cell class="name ">{{context.name}}</td>\n                <td ng-click="vm.createOrEditContext($event, context)" md-cell class="description ">{{context.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(context, $event    )" translate="VOICE.EDIT_CONTEXT">\n                          Edit Context\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(context, $event    )" translate="VOICE.DELETE_CONTEXT">\n                          Delete Context\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contexts.count}}" md-on-paginate="vm.getContexts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CONTEXT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CONTEXT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-context-button" ng-click="vm.createOrEditContext($event)" aria-label="add context" translate translate-attr-aria-label="VOICE.ADD_CONTEXT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CONTEXT BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/contexts/create/dialog.html",'<md-dialog class="context-dialog" aria-label="New Context">\n  <form name="contextForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.context.name" ng-required="true" autofocus>\n\n        <div ng-messages="contextForm[\'name\'].$error" ng-show="contextForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.context.description">\n\n        <div ng-messages="contextForm[\'description\'].$error" ng-show="contextForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newContext" ng-click="vm.saveContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid || contextForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newContext" ng-click="vm.addNewContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CONTEXT" translate-attr-aria-label="VOICE.ADD_CONTEXT">\n          ADD CONTEXT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContext" ng-click="vm.deleteContext($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="inbound-route-dialog" aria-label="New InboundRoute">\n  <form name="inboundrouteForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newInboundRoute ? \'VOICE.NEW_INBOUNDROUTE\' : \'VOICE.EDIT_INBOUNDROUTE\' | translate\n          }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n        <input type="text" name="exten" ng-model="vm.inboundRoute.exten" ng-required="true" autofocus>\n        <div ng-messages="inboundrouteForm[\'exten\'].$error" ng-show="inboundrouteForm[\'exten\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CONTEXT">Context</label>\n        <md-select name="context" ng-model="vm.inboundRoute.context" required>\n          <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n        </md-select>\n        <div ng-messages="inboundrouteForm[\'context\'].$error" ng-show="inboundrouteForm[\'context\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.inboundRoute.alias" ng-change="vm.getRouting()">\n        <div ng-messages="inboundrouteForm[\'alias\'].$error" ng-show="inboundrouteForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.inboundRoute.description">\n        <div ng-messages="inboundrouteForm[\'description\'].$error" ng-show="inboundrouteForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInboundRoute" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid || inboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInboundRoute" ng-click="vm.addNewInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n          ADD INBOUNDROUTE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInboundRoute" ng-click="vm.deleteInboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-inbound-route" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-inbound-routes-button md-icon-button" aria-label="Go to inbound routes" ng-click="vm.gotoInboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INBOUNDROUTES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="inbound-route-image" hide-xs>\n          <img ng-src="assets/images/business/inboundroutes.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.inboundRoute.id}}\n            <span ng-if="vm.inboundRoute.exten">{{vm.inboundRoute.exten}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.inboundRoute.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveInboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- /HEADER --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      \x3c!-- SETTINGS TAB --\x3e\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="inbound-route-detail-form-container md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n                <input type="text" name="exten" ng-model="vm.inboundRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.inboundRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ALIAS">Alias</label>\n                <input type="text" name="alias" ng-model="vm.inboundRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.inboundRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /SETTINGS TAB --\x3e\n      \x3c!-- ACTIONS TAB --\x3e\n      <md-tab md-on-select="vm.onActionsTabSelection()">\n        <md-tab-label>\n          <span translate="VOICE.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="inbound-route-detail-form-container no-padding no-margin">\n            <div class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- APPLICATIONS LIST --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider class="no-margin"></md-divider>\n                <md-list ng-sortable="vm.sortableAppsOptions">\n                  <md-list-item class="handle" ng-repeat="a in vm.apps">\n                    <div layout="row">\n                      <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n                      <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n                        a.appType}}</p>\n                    </div>\n                  </md-list-item>\n                </md-list>\n              </div>\n              \x3c!-- /APPLICATIONS LIST --\x3e\n              <div flex></div>\n              \x3c!-- ROUTING --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n                <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n                  <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n                  <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n                </div>\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm.selectedApplications.length}}\n                      {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n                      <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n                          \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n                        <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n                          a.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell ng-if="!vm.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                                <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n                        <td md-cell colspan="6">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n                            available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                    <tfoot md-foot>\n                      <tr md-row>\n                        <td md-cell colspan="7">\n                          <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n                        </td>\n                      </tr>\n                    </tfoot>\n                  </table>\n                </md-table-container>\n              </div>\n              \x3c!-- /ROUTING --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /ACTIONS TAB --\x3e\n    </md-tabs>\n  </div>\n  \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/inboundRoutes/inboundRoutes.html",'<div id="inbound-routes" class="page-layout simple left-sidenav inner-sidenav">\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.INBOUNDROUTES">InboundRoutes</span>\n      </div>\n    </div>\n    <div layout="row">\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n    </div>\n  </div>\n  <div ng-show="vm.selectedInboundRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedInboundRoutes = []">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-inbound-routes-count">\n          <span>{{ vm.selectedInboundRoutes.length }}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectedInboundRoutes = vm.inboundRoutes.rows" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.selectedInboundRoutes = []" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedInboundRoutes" csv-label="true" filename="inbound_routes.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    <div class="main scrollable">\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedInboundRoutes" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInboundRoutes">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.inboundRoutes.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.inboundRoutes.rows">\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_INBOUNDROUTE">\n                          Edit InboundRoute\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_INBOUNDROUTE">\n                          Delete InboundRoute\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.inboundRoutes.count }}" md-on-paginate="vm.getInboundRoutes" md-page-select>\n        </md-table-pagination>\n      </md-card>\n    </div>\n  </div>\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-inbound-route-button" ng-click="vm.createOrEditInboundRoute($event)" aria-label="add inbound route" translate translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n</div>'),e.put("app/main/apps/voice/views/internalRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="internal-route-dialog" aria-label="New InternalRoute">\n  <form name="internalrouteForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newInternalRoute ? \'VOICE.NEW_INTERNALROUTE\' : \'VOICE.EDIT_INTERNALROUTE\' | translate\n          }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n        <input type="text" name="exten" ng-model="vm.internalRoute.exten" ng-required="true" autofocus>\n        <div ng-messages="internalrouteForm[\'exten\'].$error" ng-show="internalrouteForm[\'exten\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CONTEXT">Context</label>\n        <md-select name="context" ng-model="vm.internalRoute.context" required>\n          <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n        </md-select>\n        <div ng-messages="internalrouteForm[\'context\'].$error" ng-show="internalrouteForm[\'context\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.internalRoute.alias" ng-change="vm.getRouting()">\n        <div ng-messages="internalrouteForm[\'alias\'].$error" ng-show="internalrouteForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.internalRoute.description">\n        <div ng-messages="internalrouteForm[\'description\'].$error" ng-show="internalrouteForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInternalRoute" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInternalRoute" ng-click="vm.addNewInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INTERNALROUTE" translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n          ADD INTERNALROUTE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInternalRoute" ng-click="vm.deleteInternalRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-internal-route" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-internal-routes-button md-icon-button" aria-label="Go to internal routes" ng-click="vm.gotoInternalRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INTERNALROUTES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="internal-route-image" hide-xs>\n          <img ng-src="assets/images/business/internalroutes.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.internalRoute.id}}\n            <span ng-if="vm.internalRoute.exten">{{vm.internalRoute.exten}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.internalRoute.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveInternalRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- /HEADER --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      \x3c!-- SETTINGS TAB --\x3e\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="internal-route-detail-form-container md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n                <input type="text" name="exten" ng-model="vm.internalRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.internalRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ALIAS">Alias</label>\n                <input type="text" name="alias" ng-model="vm.internalRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.internalRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /SETTINGS TAB --\x3e\n      \x3c!-- ACTIONS TAB --\x3e\n      <md-tab md-on-select="vm.onActionsTabSelection()">\n        <md-tab-label>\n          <span translate="VOICE.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="internal-route-detail-form-container no-padding no-margin">\n            <div class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- APPLICATIONS LIST --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider class="no-margin"></md-divider>\n                <md-list ng-sortable="vm.sortableAppsOptions">\n                  <md-list-item class="handle" ng-repeat="a in vm.apps">\n                    <div layout="row">\n                      <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n                      <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n                        a.appType}}</p>\n                    </div>\n                  </md-list-item>\n                </md-list>\n              </div>\n              \x3c!-- /APPLICATIONS LIST --\x3e\n              <div flex></div>\n              \x3c!-- ROUTING --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n                <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n                  <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n                  <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n                </div>\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm.selectedApplications.length}}\n                      {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n                      <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n                          \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n                        <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n                          a.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell ng-if="!vm.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                                <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n                        <td md-cell colspan="6">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n                            available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                    <tfoot md-foot>\n                      <tr md-row>\n                        <td md-cell colspan="7">\n                          <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n                        </td>\n                      </tr>\n                    </tfoot>\n                  </table>\n                </md-table-container>\n              </div>\n              \x3c!-- /ROUTING --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /ACTIONS TAB --\x3e\n    </md-tabs>\n  </div>\n  \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/internalRoutes/internalRoutes.html",'<div id="internal-routes" class="page-layout simple left-sidenav inner-sidenav">\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.INTERNALROUTES">InternalRoutes</span>\n      </div>\n    </div>\n    <div layout="row">\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n    </div>\n  </div>\n  <div ng-show="vm.selectedInternalRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedInternalRoutes = []">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-internal-routes-count">\n          <span>{{ vm.selectedInternalRoutes.length }}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectedInternalRoutes = vm.internalRoutes.rows" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.selectedInternalRoutes = []" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedInternalRoutes" csv-label="true" filename="internal_routes.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInternalRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    <div class="main scrollable">\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedInternalRoutes" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInternalRoutes">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.internalRoutes.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.internalRoutes.rows">\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_INTERNALROUTE">\n                          Edit InternalRoute\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_INTERNALROUTE">\n                          Delete InternalRoute\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.internalRoutes.count }}" md-on-paginate="vm.getInternalRoutes" md-page-select>\n        </md-table-pagination>\n      </md-card>\n    </div>\n  </div>\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-internal-route-button" ng-click="vm.createOrEditInternalRoute($event)" aria-label="add internal route" translate translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n</div>'),e.put("app/main/apps/voice/views/musiconholds/create/dialog.html",'<md-dialog class="musiconhold-dialog" aria-label="New MusicOnHold">\n  <form name="musiconholdForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="!vm.newMusicOnHold">\n\n        <div ng-messages="musiconholdForm[\'name\'].$error" ng-show="musiconholdForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.MODE">Mode</label>\n        <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="!vm.newMusicOnHold">\n\n          <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n          <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="musiconholdForm[\'mode\'].$error" ng-show="musiconholdForm[\'mode\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n        <label translate="VOICE.DIRECTORY">Directory</label>\n        <input type="" name="directory" ng-model="vm.musiconhold.directory">\n\n        <div ng-messages="musiconholdForm[\'directory\'].$error" ng-show="musiconholdForm[\'directory\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n        <label translate="VOICE.APPLICATION">Application</label>\n        <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n\n        <div ng-messages="musiconholdForm[\'application\'].$error" ng-show="musiconholdForm[\'application\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n        <label translate="VOICE.SORT">Sort</label>\n        <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n          <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n          <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="musiconholdForm[\'sort\'].$error" ng-show="musiconholdForm[\'sort\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMusicOnHold" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid || musiconholdForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMusicOnHold" ng-click="vm.addNewMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MUSICONHOLD" translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n          ADD MUSICONHOLD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMusicOnHold" ng-click="vm.deleteMusicOnHold($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",'<md-dialog class="mohSound-dialog" aria-label="New MohSound">\n  <form name="mohSoundForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.FILE">File</label>\n        <md-select name="id" ng-model="vm.mohSound.id" autofocus>\n          <md-option ng-value="id.id" ng-repeat="id in vm.sounds" ng-disabled="id.canSelect === false">{{ id.name }}</md-option>\n        </md-select>\n        <div ng-messages="mohSoundForm[\'id\'].$error" ng-show="mohSoundForm[\'id\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.FILE_REQUIRED">File field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMohSound" ng-click="vm.saveMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid || mohSoundForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMohSound" ng-click="vm.addNewMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MOHSOUND" translate-attr-aria-label="VOICE.ADD_MOHSOUND">\n          ADD MOHSOUND\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMohSound" ng-click="vm.deleteMohSound($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/view.html",'<div id="voice-musiconhold" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-musiconholds-button md-icon-button" aria-label="Go to musiconholds" ng-click="vm.gotoMusicOnHolds()" translate translate-attr-aria-label="VOICE.GO_TO_MUSICONHOLDS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="musiconhold-image" hide-xs>\n          <img ng-src="assets/images/business/musiconholds.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.musiconhold.id}}\n            <span ng-if="vm.musiconhold.name">{{vm.musiconhold.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.musiconhold.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveMusicOnHold()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (mohSoundsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="musiconhold-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MODE">Mode</label>\n                <md-select name="mode" ng-model="vm.musiconhold.mode" required disabled>\n\n                  <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'mode\'].$error" ng-show="generalForm[\'mode\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n                <label translate="VOICE.DIRECTORY">Directory</label>\n                <input type="" name="directory" ng-model="vm.musiconhold.directory" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'directory\'].$error" ng-show="generalForm[\'directory\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n                <label translate="VOICE.APPLICATION">Application</label>\n                <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'application\'].$error" ng-show="generalForm[\'application\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n                <label translate="VOICE.SORT">Sort</label>\n                <md-select name="sort" ng-model="vm.musiconhold.sort" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n                  <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'sort\'].$error" ng-show="generalForm[\'sort\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.AUDIOFILES">AUDIOFILES</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="musiconhold-detail-form-container mohsounds md-background-bg md-whiteframe-1dp">\n            <div ng-controller="MusicOnHoldMohSoundsController as vm_dc" ng-init="vm_dc.init(vm.musiconhold, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMusicOnHoldMohSounds.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="VOICE.MOHSOUNDS">MohSounds</span>\n                  <ms-search-bar on-search="vm_dc.getMusicOnHoldMohSounds()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMusicOnHoldMohSound($event)" aria-label="add mohSound" translate translate-attr-label="VOICE.ADD_MOHSOUND">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMusicOnHoldMohSounds.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedMusicOnHoldMohSounds.length}} {{vm_dc.selectedMusicOnHoldMohSounds.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMusicOnHoldMohSounds" csv-label="true" filename="musiconholds.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMusicOnHoldMohSounds($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedMusicOnHoldMohSounds" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMusicOnHoldMohSounds">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'VOICE.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="audio">\n                        {{ \'VOICE.AUDIO\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'VOICE.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="mohSound" md-select-id="id" ng-repeat="mohSound in vm_dc.musiconholdMohSounds.rows">\n                      <td md-cell>\n                        {{mohSound.id}}\n                      </td>\n                      <td md-cell>\n                        \x3c!-- audio recording directive --\x3e\n                        <ms-recording id="mohSound.id" model="\'sound\'"></ms-recording>\n                        \x3c!-- / audio recording directive --\x3e\n                      </td>\n                      <td md-cell>\n                        {{ mohSound.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(mohSound, $event)" translate="VOICE.DELETE_MOHSOUND">\n                                Delete MohSound\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.musiconholdMohSounds.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="VOICE.NO_MOHSOUND_AVAILABLE">No mohsound available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.musiconholdMohSounds.count}}" md-on-paginate="vm_dc.getMusicOnHoldMohSounds" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/musiconholds/musiconholds.html",'<div id="musiconholds" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.MUSICONHOLDS">MusicOnHolds</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedMusicOnHolds.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMusicOnHolds =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-musiconholds-count">\n          <span>{{vm.selectedMusicOnHolds.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMusicOnHolds()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMusicOnHolds()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMusicOnHolds" csv-label="true" filename="musiconholds.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMusicOnHolds($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- MUSICONHOLD TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMusicOnHolds" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMusicOnHolds">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="mode">{{ \'VOICE.MODE\' | translate }}</th>\n                <th md-column md-order-by="sort">{{ \'VOICE.SORT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.musiconholds.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="musiconhold" md-select-id="id" ng-repeat="musiconhold in vm.musiconholds.rows">\n                <td md-cell ng-if="musiconhold.userpic"><img class="avatar" alt="{{musiconhold.name}}" ng-src="api/users/{{musiconhold.id}}/avatar" /></td>\n                <td md-cell ng-if="!musiconhold.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{musiconhold.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="id ">{{musiconhold.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="name ">{{musiconhold.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="mode ">{{ \'VOICE.\' + vm.arraymode[musiconhold.mode].option | uppercase | translate }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="sort ">{{ \'VOICE.\' + vm.arraysort[musiconhold.sort].option | uppercase | translate }}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(musiconhold, $event    )" translate="VOICE.EDIT_MUSICONHOLD">\n                          Edit MusicOnHold\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(musiconhold, $event    )" translate="VOICE.DELETE_MUSICONHOLD">\n                          Delete MusicOnHold\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.musiconholds.count}}" md-on-paginate="vm.getMusicOnHolds" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / MUSICONHOLD TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD MUSICONHOLD BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-musiconhold-button" ng-click="vm.createOrEditMusicOnHold($event)" aria-label="add musiconhold" translate translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD MUSICONHOLD BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="outbound-route-dialog" aria-label="New OutboundRoute">\n  <form name="outboundrouteForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newOutboundRoute ? \'VOICE.NEW_OUTBOUNDROUTE\' : \'VOICE.EDIT_OUTBOUNDROUTE\' | translate\n          }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n        <input type="text" name="exten" ng-model="vm.outboundRoute.exten" ng-required="true" autofocus>\n        <div ng-messages="outboundrouteForm[\'exten\'].$error" ng-show="outboundrouteForm[\'exten\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CONTEXT">Context</label>\n        <md-select name="context" ng-model="vm.outboundRoute.context" required>\n          <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n        </md-select>\n        <div ng-messages="outboundrouteForm[\'context\'].$error" ng-show="outboundrouteForm[\'context\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.RECORDING">Recording</label>\n        <md-select name="recordingFormat" ng-model="vm.outboundRoute.recordingFormat" ng-change="vm.getRouting()" required>\n          <md-option ng-value="\'none\'">none</md-option>\n          <md-option ng-value="\'wav\'">wav</md-option>\n          <md-option ng-value="\'WAV\'">wav49</md-option>\n          <md-option ng-value="\'gsm\'">gsm</md-option>\n        </md-select>\n        <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n        <div ng-messages="outboundrouteForm[\'recordingFormat\'].$error" ng-show="outboundrouteForm[\'recordingFormat\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CUTDIGITS">CutDigits</label>\n        <input type="number" name="cutdigits" ng-model="vm.outboundRoute.cutdigits" min="0">\n        <div ng-messages="outboundrouteForm[\'cutdigits\'].$error" ng-show="outboundrouteForm[\'cutdigits\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater\n              or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.outboundRoute.alias" ng-change="vm.getRouting()">\n        <div ng-messages="outboundrouteForm[\'alias\'].$error" ng-show="outboundrouteForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.outboundRoute.description">\n        <div ng-messages="outboundrouteForm[\'description\'].$error" ng-show="outboundrouteForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOutboundRoute" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOutboundRoute" ng-click="vm.addNewOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_OUTBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n          ADD OUTBOUNDROUTE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOutboundRoute" ng-click="vm.deleteOutboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-outbound-route" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-outbound-routes-button md-icon-button" aria-label="Go to outbound routes" ng-click="vm.gotoOutboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_OUTBOUNDROUTES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="outbound-route-image" hide-xs>\n          <img ng-src="assets/images/business/outboundroutes.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.outboundRoute.id}}\n            <span ng-if="vm.outboundRoute.exten">{{vm.outboundRoute.exten}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.outboundRoute.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveOutboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- /HEADER --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      \x3c!-- SETTINGS TAB --\x3e\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="outbound-route-detail-form-container md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n                <input type="text" name="exten" ng-model="vm.outboundRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.outboundRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RECORDING">Recording</label>\n                <md-select name="recordingFormat" ng-model="vm.outboundRoute.recordingFormat" ng-change="vm.onActionsTabSelection()" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'none\'">none</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'WAV\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n                <div ng-messages="generalForm[\'recordingFormat\'].$error" ng-show="generalForm[\'recordingFormat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CUTDIGITS">CutDigits</label>\n                <input type="number" name="cutdigits" ng-model="vm.outboundRoute.cutdigits" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'cutdigits\'].$error" ng-show="generalForm[\'cutdigits\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid\n                      greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ALIAS">Alias</label>\n                <input type="text" name="alias" ng-model="vm.outboundRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.outboundRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /SETTINGS TAB --\x3e\n      \x3c!-- ACTIONS TAB --\x3e\n      <md-tab md-on-select="vm.onActionsTabSelection()">\n        <md-tab-label>\n          <span translate="VOICE.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="outbound-route-detail-form-container no-padding no-margin">\n            <div class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- APPLICATIONS LIST --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider class="no-margin"></md-divider>\n                <md-list ng-sortable="vm.sortableAppsOptions">\n                  <md-list-item class="handle" ng-repeat="a in vm.apps">\n                    <div layout="row">\n                      <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n                      <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n                        a.appType}}</p>\n                    </div>\n                  </md-list-item>\n                </md-list>\n              </div>\n              \x3c!-- /APPLICATIONS LIST --\x3e\n              <div flex></div>\n              \x3c!-- ROUTING --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n                <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n                  <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n                  <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n                </div>\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm.selectedApplications.length}}\n                      {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n                      <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n                          \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n                        <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n                          a.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell ng-if="!vm.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                                <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n                        <td md-cell colspan="6">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n                            available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                    <tfoot md-foot>\n                      <tr md-row>\n                        <td md-cell colspan="7">\n                          <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n                        </td>\n                      </tr>\n                    </tfoot>\n                  </table>\n                </md-table-container>\n              </div>\n              \x3c!-- /ROUTING --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /ACTIONS TAB --\x3e\n    </md-tabs>\n  </div>\n  \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundRoutes/outboundRoutes.html",'<div id="outbound-routes" class="page-layout simple left-sidenav inner-sidenav">\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.OUTBOUNDROUTES">OutboundRoutes</span>\n      </div>\n    </div>\n    <div layout="row">\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n    </div>\n  </div>\n  <div ng-show="vm.selectedOutboundRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedOutboundRoutes = []">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-outbound-routes-count">\n          <span>{{ vm.selectedOutboundRoutes.length }}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectedOutboundRoutes = vm.outboundRoutes.rows" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.selectedOutboundRoutes = []" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedOutboundRoutes" csv-label="true" filename="outbound_routes.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOutboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    <div class="main scrollable">\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedOutboundRoutes" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOutboundRoutes">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.outboundRoutes.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.outboundRoutes.rows">\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_OUTBOUNDROUTE">\n                          Edit OutboundRoute\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_OUTBOUNDROUTE">\n                          Delete OutboundRoute\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.outboundRoutes.count }}" md-on-paginate="vm.getOutboundRoutes" md-page-select>\n        </md-table-pagination>\n      </md-card>\n    </div>\n  </div>\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-outbound-route-button" ng-click="vm.createOrEditOutboundRoute($event)" aria-label="add outbound route" translate translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n</div>'),e.put("app/main/apps/voice/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n  <div class="md-toolbar-tools" layout="row" layout-align="center center">\n    <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n    <ms-search-bar on-search="vm.getAbandonedCalls()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300">\n    </ms-search-bar>\n    <div flex></div>\n\n    <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getAbandonedCalls()"></ms-quick-filter>\n\n    <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n      <md-icon md-font-icon="icon-reload"></md-icon>\n      <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}\n      </md-tooltip>\n    </md-button>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAbandonedCalls">\n      <tr md-row>\n        <th md-column md-order-by="id">ID</th>\n        <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n        <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n        <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n        <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n        <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.abandonedCalls.rows.length">\n        <td md-cell colspan="12">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="call in vm.abandonedCalls.rows">\n        <td md-cell class="id">{{call.id}}</td>\n        <td md-cell class="firstName" privacy ng-cloak>{{call.calleridname}}</td>\n        <td md-cell class="list" privacy ng-cloak>{{call.calleridnum}}</td>\n        <td md-cell class="list">{{vm.queuesMap[call.queue]}}</td>\n        <td md-cell class="list">\n          {{call.queuecallerabandonAt ? (call.queuecallerabandonAt | formatdate) : (call.queuecallerexitAt | formatdate) }}\n        </td>\n        <td md-cell class="list">{{call.lastAssignedTo}}</td>\n        <td md-cell class="list">{{ call.disposition }}</td>\n        <td md-cell class="list">{{ call.secondDisposition }}</td>\n        <td md-cell class="list">{{ call.thirdDisposition }}</td>\n        <td md-cell class="actions">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="2">\n              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                <md-menu>\n                  <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">\n                    Assigned\n                    to</md-button>\n                  <md-menu-content>\n                    <md-menu-item ng-if="call.lastAssignedTo">\n                      <md-button ng-click="vm.assignTo(call)"><em translate="DASHBOARDS.NONE">Not Assigned</em>\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n                      <md-button ng-click="vm.assignTo(call,agent)">{{agent.name}}</md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.dispose(call)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">\n                  Dispose\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.abandonedCalls.count}}" md-on-paginate="vm.getAbandonedCalls" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/outbound_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.OUTBOUND_CALLS">Ooutbound Calls</span>\n  </div>\n</md-toolbar>\n\n\x3c!-- OUTBOUNDS TABLE --\x3e\n<md-table-container>\n  <table md-table>\n    <thead md-head>\n      <tr md-row>\n        <th md-column width="30px"></th>\n        <th md-column>{{ \'VOICE.SOURCE\' | translate }}</th>\n        <th md-column>{{ \'VOICE.DESTINATION\' | translate }}</th>\n        <th md-column>{{ \'VOICE.ALIAS\' | translate }}</th>\n        <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.calls.rows.length">\n        <td md-cell colspan="5">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n        <td md-cell>\n          <i ng-class="vm.channelStatus[call.channelstatedesc.toLowerCase()]"></i>\n        </td>\n        <td md-cell privacy ng-cloak>\n          {{call.calleridname}}, {{call.calleridnum}}\n          <span class="text-boxed" ng-if="call.answered">\n            <timer ng-if="call.answertime" start-time="call.answertime"></timer>\n          </span>\n        </td>\n        <td md-cell privacy ng-cloak>{{call.exten}}</td>\n        <td md-cell>{{call.routealias}}</td>\n        <td md-cell>\n          <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() !== \'hangup\'">\n            <timer ng-if="call.starttime" start-time="call.starttime"></timer>\n          </span>\n          <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() === \'hangup\'" translate="VOICE.CLOSING">Closing</span>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.calls.count}}"></md-table-pagination>\n\x3c!-- / OUTBOUNDS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n  </div>\n</md-toolbar>\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n  <table md-table>\n    <thead md-head>\n      <tr md-row>\n        <th md-column width="30px"></th>\n        <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n        <th md-column>{{ \'VOICE.ALIAS\' | translate }}</th>\n        <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n        <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n        <th md-column>{{ \'VOICE.AGENT\' | translate }}</th>\n        <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n        <td md-cell colspan="8">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n        <td md-cell>\n          <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n          <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n        </td>\n        <td md-cell>{{channel.exten}}</td>\n        <td md-cell>{{channel.routealias}}</td>\n        <td md-cell>{{channel.queue}}</td>\n        <td md-cell privacy ng-cloak>\n          <span>{{channel.calleridname}}, {{channel.calleridnum}}</span>\n        </td>\n        <td md-cell>\n          <span ng-if="channel.queuecallerleaveAt">\n            {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n            <span class="text-boxed">\n              <timer start-time="channel.queuecallerleaveAt"></timer>\n            </span>\n          </span>\n          <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n            {{ \'VOICE.WAITING_FOR_AGENT\' | translate }}\n            <timer start-time="channel.queuecallerjoinAt"></timer>\n          </span>\n        </td>\n        <td md-cell>\n          <span class="text-boxed">\n            <timer start-time="channel.queuecallerjoinAt"></timer>\n          </span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="2">\n              <md-menu-item>\n                <md-button ng-click="vm.hangup(channel.uniqueid)" translate="VOICE.HANGUP">\n                  Hangup\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n                  Number\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-menu class="no-margin">\n                  <md-button ng-mouseenter="vm.getAvailableAgents()" translate="VOICE.REDIRECT_TO_AGENT">\n                    Redirect to Agent</md-button>\n                  <md-menu-content>\n                    <md-menu-item ng-if="!vm.availableAgents">\n                      <md-progress-circular class="md-accent auto-margin" md-diameter="32" md-mode="indeterminate">\n                      </md-progress-circular>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.availableAgents.length > 0" ng-repeat="agent in vm.availableAgents">\n                      <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">\n                        {{agent.name}}</md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.availableAgents.length === 0">\n                      <span>No agents available</span>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column>{{\'\n                        VOICE.NAME\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.TOTAL_OFFERED\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.ANSWERED\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.ABANDONED\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.UNMANAGED\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.AVG_HOLD_TIME\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.AVG_DURATION\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.AVG_BILLABLE\' | translate}}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues">\n        <td md-cell colspan="8">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, queue) in vm.queues">\n        <td md-cell>\n          <span>{{queue.name}}</span>\n        </td>\n        <td md-cell>\n          \x3c!-- <span class="font-size-20 grey-fg">{{queue.total || 0}}</span> --\x3e\n          <span class="font-size-20 grey-fg">{{ (queue.answered || 0) + (queue.abandoned || 0) + (queue.unmanaged || 0) }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.total) ? (queue.answered || 0) * 100/queue.total : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.abandoned || 0}} ({{(queue.total) ? (queue.abandoned || 0) * 100/queue.total : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.unmanaged || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.total ? ((queue.sumHoldTime || 0) / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{(queue.total ? ((queue.sumDuration || 0) / queue.total) : 0) | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n        <th md-column>{{ \'VOICE.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'VOICE.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'VOICE.TALKING\' | translate }}</th>\n        <th md-column>{{ \'VOICE.BUSY\' | translate }}</th>\n        <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedInDb }} ({{ queue.loggedIn }})</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.talking }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.busy }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="VOICE.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="VOICE.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.TELEPHONES">Telephones</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.TRUNKS">Trunks</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.ABANDONEDCALLS">Abandoned Queue Calls</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.QUEUE_PARAMS">Queue Parameters</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.OUTBOUND_CALLS">Outbound Calls</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/telephones/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.TELEPHONES">Telephones</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getTelephones()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n      <tr md-row>\n        <th md-column md-order-by="fullname">{{ \'VOICE.ACCOUNTNAME\' | translate }}</th>\n        <th md-column md-order-by="internal">{{ \'VOICE.INTERNAL\' | translate }}</th>\n        <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n        <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.telephones">\n        <td md-cell colspan="4">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="telephone" md-select-id="id" ng-repeat="(id, telephone) in vm.telephones">\n        <td md-cell>{{telephone.fullname}}</td>\n        <td md-cell>{{telephone.internal}}</td>\n        <td md-cell>\n          <i ng-class="vm.stateClass[telephone.state]">\n            <md-tooltip>{{\'VOICE.\' + telephone.state | uppercase | translate}}</md-tooltip>\n          </i>\n        </td>\n        <td md-cell>\n          <i ng-class="vm.statusClass[telephone.status]">\n            <md-tooltip>{{\'VOICE.\' + telephone.status | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="telephone.status === \'registered\'" class="text-boxed">{{telephone.address}}</span>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.TRUNKS">Telephones</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getTrunks()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head>\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n        <tr md-row>\n          <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n          <th md-column>{{ \'VOICE.TRUNK_STATUS\' | translate }}</th>\n          <th md-column>{{ \'VOICE.REGISTRY\' | translate }}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.trunks">\n        <td md-cell colspan="3">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n        <td md-cell>{{trunk.name}}</td>\n        <td md-cell>\n          <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n            <md-tooltip>{{\'VOICE.\' + trunk.status | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n        </td>\n        <td md-cell>\n          <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n            <md-tooltip>{{\'VOICE.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n          <span ng-if="!trunk.registry" translate="VOICE.NO_REGISTRY">\n            No Registry\n          </span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n\n            <md-menu-content width="4">\n              <md-menu-item>\n                <md-button ng-click="vm.goToTrunk($event, trunk)" translate="VOICE.EDIT_TRUNK">\n                  Edit Trunk\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/voicemails/create/dialog.html",'<md-dialog class="voicemail-dialog" aria-label="New Voicemail">\n  <form name="voicemailForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.FULLNAME">FullName</label>\n        <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n\n        <div ng-messages="voicemailForm[\'fullname\'].$error" ng-show="voicemailForm[\'fullname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n\n        <div ng-messages="voicemailForm[\'email\'].$error" ng-show="voicemailForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n        <div ng-messages="voicemailForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n        <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n        <div ng-messages="voicemailForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="VOICE.MAILBOX">MailBox</label>\n        <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="!vm.newVoicemail">\n\n        <div ng-messages="voicemailForm[\'mailbox\'].$error" ng-show="voicemailForm[\'mailbox\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.ATTACH">Attach</label>\n        <md-select name="attach" ng-model="vm.voicemail.attach">\n\n          <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n          <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="voicemailForm[\'attach\'].$error" ng-show="voicemailForm[\'attach\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoicemail" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid || voicemailForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoicemail" ng-click="vm.addNewVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEMAIL" translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n          ADD VOICEMAIL\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoicemail" ng-click="vm.deleteVoicemail($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicemails/edit/view.html",'<div id="voice-voicemail" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-voicemails-button md-icon-button" aria-label="Go to voicemails" ng-click="vm.gotoVoicemails()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEMAILS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="voicemail-image" hide-xs>\n          <img ng-src="assets/images/business/voicemails.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.voicemail.id}}\n            <span ng-if="vm.voicemail.name">{{vm.voicemail.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voicemail.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveVoicemail()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (messagesForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voicemail-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.FULLNAME">FullName</label>\n                <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'fullname\'].$error" ng-show="generalForm[\'fullname\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n                <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n                <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n                <div ng-messages="generalForm.confirmPassword.$error" role="alert" multiple>\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n                  </div>\n                  <div ng-message="passwordMatch">\n                    <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="VOICE.MAILBOX">MailBox</label>\n                <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" disabled>\n\n                <div ng-messages="generalForm[\'mailbox\'].$error" ng-show="generalForm[\'mailbox\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.VOICEMAIL_CONTEXT">Voicemail_Context</label>\n                <md-select name="context" ng-model="vm.voicemail.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.VOICEMAIL_CONTEXT"></span></div>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.VOICEMAIL_CONTEXT_REQUIRED">Voicemail_Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voicemail-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.TIMEZONE">TimeZone</label>\n                <input type="text" name="tz" ng-model="vm.voicemail.tz" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'tz\'].$error" ng-show="advancedForm[\'tz\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.TIMEZONE_REQUIRED">TimeZone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ATTACH">Attach</label>\n                <md-select name="attach" ng-model="vm.voicemail.attach" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'attach\'].$error" ng-show="advancedForm[\'attach\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ENVELOPE">Envelope</label>\n                <md-select name="envelope" ng-model="vm.voicemail.envelope" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'envelope\'].$error" ng-show="advancedForm[\'envelope\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ENVELOPE_REQUIRED">Envelope field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DELETE">Delete</label>\n                <md-select name="delete" ng-model="vm.voicemail.delete" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'delete\'].$error" ng-show="advancedForm[\'delete\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DELETE_REQUIRED">Delete field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.EMAILBODY">EmailBody</label>\n                <input type="text" name="emailbody" ng-model="vm.voicemail.emailbody" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'emailbody\'].$error" ng-show="advancedForm[\'emailbody\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.EMAILBODY_REQUIRED">EmailBody field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.EMAILSUBJECT">EmailSubject</label>\n                <input type="text" name="emailsubject" ng-model="vm.voicemail.emailsubject" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'emailsubject\'].$error" ng-show="advancedForm[\'emailsubject\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.EMAILSUBJECT_REQUIRED">EmailSubject field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MAXSECONDS">MaxSeconds</label>\n                <input type="number" name="maxsecs" ng-model="vm.voicemail.maxsecs" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'maxsecs\'].$error" ng-show="advancedForm[\'maxsecs\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MAXSECONDS_REQUIRED">MaxSeconds field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxSeconds must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MAXMESSAGES">MaxMessages</label>\n                <input type="number" name="maxmsg" ng-model="vm.voicemail.maxmsg" min="0" max="9999" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'maxmsg\'].$error" ng-show="advancedForm[\'maxmsg\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MAXMESSAGES_REQUIRED">MaxMessages field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>9999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.MESSAGES">MESSAGES</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voicemail-detail-form-container messages md-background-bg md-whiteframe-1dp">\n            <div ng-controller="VoicemailMessagesController as vm_dc" ng-init="vm_dc.init(vm.voicemail, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedVoicemailMessages.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="VOICE.MESSAGES">Messages</span>\n                  <ms-search-bar on-search="vm_dc.getVoicemailMessages()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedVoicemailMessages.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedVoicemailMessages.length}} {{vm_dc.selectedVoicemailMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedVoicemailMessages" csv-label="true" filename="voicemails.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedVoicemailMessages($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedVoicemailMessages" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getVoicemailMessages">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'VOICE.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="callerid">\n                        {{ \'VOICE.CALLER_ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="duration">\n                        {{ \'VOICE.DURATION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="audio">\n                        {{ \'VOICE.AUDIO\' | translate }}\n                      </th>\n                      <th md-column md-order-by="stamp">\n                        {{ \'VOICE.RECEIVED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="message" md-select-id="id" ng-repeat="message in vm_dc.voicemailMessages.rows">\n                      <td md-cell>\n                        {{message.id}}\n                      </td>\n                      <td md-cell>\n                        {{message.callerid}}\n                      </td>\n                      <td md-cell>\n                        {{message.duration}}\n                      </td>\n                      <td md-cell>\n                        \x3c!-- audio recording directive --\x3e\n                        <ms-recording id="message.id" model="\'voiceMailMessage\'"></ms-recording>\n                        \x3c!-- / audio recording directive --\x3e\n                      </td>\n                      <td md-cell>\n                        {{ message.stamp | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(message, $event)" translate="VOICE.DELETE_MESSAGE">\n                                Delete Message\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.voicemailMessages.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="VOICE.NO_MESSAGE_AVAILABLE">No message available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.voicemailMessages.count}}" md-on-paginate="vm_dc.getVoicemailMessages" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voicemails/voicemails.html",'<div id="voicemails" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.VOICEMAILS">Voicemails</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVoicemails.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVoicemails =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-voicemails-count">\n          <span>{{vm.selectedVoicemails.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVoicemails()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVoicemails()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVoicemails" csv-label="true" filename="voicemails.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicemails($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VOICEMAIL TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVoicemails" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicemails">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="fullname">{{ \'VOICE.FULLNAME\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'VOICE.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="mailbox">{{ \'VOICE.MAILBOX\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.voicemails.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="voicemail" md-select-id="id" ng-repeat="voicemail in vm.voicemails.rows">\n                <td md-cell ng-if="voicemail.userpic"><img class="avatar" alt="{{voicemail.name}}" ng-src="api/users/{{voicemail.id}}/avatar" /></td>\n                <td md-cell ng-if="!voicemail.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicemail.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="id ">{{voicemail.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="fullname ">{{voicemail.fullname}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="email ">{{voicemail.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="mailbox ">{{voicemail.mailbox}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(voicemail, $event    )" translate="VOICE.EDIT_VOICEMAIL">\n                          Edit Voicemail\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(voicemail, $event    )" translate="VOICE.DELETE_VOICEMAIL">\n                          Delete Voicemail\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicemails.count}}" md-on-paginate="vm.getVoicemails" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VOICEMAIL TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VOICEMAIL BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicemail-button" ng-click="vm.createOrEditVoicemail($event)" aria-label="add voicemail" translate translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VOICEMAIL BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voicePrefixes/create/dialog.html",'<md-dialog class="voicePrefix-dialog" aria-label="New voicePrefix">\n  <form name="voicePrefixForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.voicePrefix.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus>\n\n        <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n        <div ng-messages="voicePrefixForm[\'name\'].$error" ng-show="voicePrefixForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.OUTBOUNDROUTE">OutboundRoute</label>\n        <md-select name="VoiceExtensionId" ng-model="vm.voicePrefix.VoiceExtensionId" required>\n          <md-option ng-value="VoiceExtensionId.id" ng-repeat="VoiceExtensionId in vm.outboundRoutes" ng-disabled="VoiceExtensionId.canSelect === false">{{ VoiceExtensionId.exten }}</md-option>\n        </md-select>\n        <div ng-messages="voicePrefixForm[\'VoiceExtensionId\'].$error" ng-show="voicePrefixForm[\'VoiceExtensionId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CALLERIDALL">CallerIdAll</label>\n        <input type="text" name="callerIdAll" ng-model="vm.voicePrefix.callerIdAll" ng-pattern="/&quot;(.*)&quot;\\s&lt;(.*?)&gt;$/">\n\n        <div class="hint"><span translate="VOICE.HELP.CALLERIDALL"></span></div>\n        <div ng-messages="voicePrefixForm[\'callerIdAll\'].$error" ng-show="voicePrefixForm[\'callerIdAll\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CALLERIDALL_REQUIRED">CallerIdAll field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.CALLERIDALL_MUST_VALID_PATTERN" translate-values="{ regex: \'/&quot;(.*)&quot;\\s&lt;(.*?)&gt;$/\' }">CallerIdAll must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.voicePrefix.description">\n\n        <div ng-messages="voicePrefixForm[\'description\'].$error" ng-show="voicePrefixForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newvoicePrefix" ng-click="vm.savevoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid || voicePrefixForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newvoicePrefix" ng-click="vm.addNewvoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEPREFIX" translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n          ADD VOICEPREFIX\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newvoicePrefix" ng-click="vm.deletevoicePrefix($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n  <form name="voicePrefixForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="VOICE.AGENTADD_VOICEPREFIX">Add Agent to voicePrefix</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/teamadd/teamadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n  <form name="voicePrefixForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",'<div id="voicePrefixes" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.VOICEPREFIXES">VoicePrefixes</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVoicePrefixes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVoicePrefixes =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-voicePrefixes-count">\n          <span>{{vm.selectedVoicePrefixes.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVoicePrefixes()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVoicePrefixes()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVoicePrefixes" csv-label="true" filename="voicePrefixes.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicePrefixes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VOICEPREFIX TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVoicePrefixes" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicePrefixes">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="VoiceExtensionId">{{ \'VOICE.OUTBOUNDROUTE\' | translate }}</th>\n                <th md-column md-order-by="callerIdAll">{{ \'VOICE.CALLERIDALL\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.voicePrefixes.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="voicePrefix" md-select-id="id" ng-repeat="voicePrefix in vm.voicePrefixes.rows">\n                <td md-cell ng-if="voicePrefix.userpic"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="api/users/{{voicePrefix.id}}/avatar" /></td>\n                <td md-cell ng-if="!voicePrefix.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="id ">{{voicePrefix.id}}</td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="name ">{{voicePrefix.name}}</td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="VoiceExtensionId ">{{ (vm.outboundRoutes | filter : {\'id\':voicePrefix.VoiceExtensionId} : true)[0].exten }}</td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="callerIdAll ">{{voicePrefix.callerIdAll}}</td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="description ">{{voicePrefix.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(voicePrefix, $event    )" translate="VOICE.EDIT_VOICEPREFIX">\n                          Edit voicePrefix\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(voicePrefix, $event    )" translate="VOICE.AGENTADD_VOICEPREFIX">\n                          AgentAdd voicePrefix\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(voicePrefix, $event    )" translate="VOICE.TEAMADD_VOICEPREFIX">\n                          teamadd voicePrefix\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(voicePrefix, $event    )" translate="VOICE.DELETE_VOICEPREFIX">\n                          Delete voicePrefix\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicePrefixes.count}}" md-on-paginate="vm.getVoicePrefixes" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VOICEPREFIX TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VOICEPREFIX BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicePrefix-button" ng-click="vm.createOrEditvoicePrefix($event)" aria-label="add voicePrefix" translate translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VOICEPREFIX BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/create/dialog.html",'<md-dialog class="voiceQueue-dialog" aria-label="New VoiceQueue">\n  <form name="voiceQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newVoiceQueue">\n\n        <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n        <div ng-messages="voiceQueueForm[\'name\'].$error" ng-show="voiceQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n          <md-option ng-value="\'ringall\'">Ringall</md-option>\n          <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n          <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n          <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n          <md-option ng-value="\'random\'">Random</md-option>\n          <md-option ng-value="\'linear\'">Linear</md-option>\n          <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n        </md-select>\n        <div ng-messages="voiceQueueForm[\'strategy\'].$error" ng-show="voiceQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.voiceQueue.description">\n\n        <div ng-messages="voiceQueueForm[\'description\'].$error" ng-show="voiceQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceQueue" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid || voiceQueueForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceQueue" ng-click="vm.addNewVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEQUEUE" translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n          ADD VOICEQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceQueue" ng-click="vm.deleteVoiceQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n  <form name="voiceQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="VOICE.AGENTADD_VOICEQUEUE">Add Agent to voiceQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin">\n        <label translate="VOICE.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n  <form name="voiceQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin">\n        <label translate="VOICE.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/view.html",'<div id="voice-voiceQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-voiceQueues-button md-icon-button" aria-label="Go to voiceQueues" ng-click="vm.gotoVoiceQueues()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="voiceQueue-image" hide-xs>\n          <img ng-src="assets/images/business/voiceQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.voiceQueue.id}}\n            <span ng-if="vm.voiceQueue.name">{{vm.voiceQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.voiceQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="VOICE.TEAMADD_VOICEQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.voiceQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="VOICE.AGENTADD_VOICEQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.voiceQueue, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="VOICE.GOTO_VOICEQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveVoiceQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (settingsForm.$invalid) || (announcementsForm.$invalid) || (advancedForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ringall\'">Ringall</md-option>\n                  <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n                  <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n                  <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n                  <md-option ng-value="\'random\'">Random</md-option>\n                  <md-option ng-value="\'linear\'">Linear</md-option>\n                  <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.TIMEOUT">Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.voiceQueue.timeout" min="0" value="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.TIMEOUT"></span></div>\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MAXLENGTH">MaxLength</label>\n                <input type="number" name="maxlen" ng-model="vm.voiceQueue.maxlen" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.MAXLENGTH"></span></div>\n                <div ng-messages="generalForm[\'maxlen\'].$error" ng-show="generalForm[\'maxlen\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MAXLENGTH_REQUIRED">MaxLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RETRY">Retry</label>\n                <input type="number" name="retry" ng-model="vm.voiceQueue.retry" min="0" value="2" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.RETRY"></span></div>\n                <div ng-messages="generalForm[\'retry\'].$error" ng-show="generalForm[\'retry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.WRAPUPTIME">WrapupTime</label>\n                <input type="number" name="wrapuptime" ng-model="vm.voiceQueue.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.WRAPUPTIME"></span></div>\n                <div ng-messages="generalForm[\'wrapuptime\'].$error" ng-show="generalForm[\'wrapuptime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.WEIGHT">Weight</label>\n                <input type="number" name="weight" ng-model="vm.voiceQueue.weight" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.WEIGHT"></span></div>\n                <div ng-messages="generalForm[\'weight\'].$error" ng-show="generalForm[\'weight\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.JOINWHENEMPTY">JoinWhenEmpty</label>\n                <md-select name="joinempty" ng-model="vm.voiceQueue.joinempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'no\'" ng-disabled="vm.voiceQueue.joinempty.length === 1  && vm.voiceQueue.joinempty[0] === \'no\'">no</md-option>\n                  <md-option ng-value="\'yes\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'yes\'">yes</md-option>\n                  <md-option ng-value="\'strict\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'strict\'">strict</md-option>\n                  <md-option ng-value="\'loose\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'loose\'">loose</md-option>\n                  <md-option ng-value="\'paused\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'paused\'">paused</md-option>\n                  <md-option ng-value="\'penalty\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'penalty\'">penalty</md-option>\n                  <md-option ng-value="\'inuse\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'inuse\'">inuse</md-option>\n                  <md-option ng-value="\'ringing\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'ringing\'">ringing</md-option>\n                  <md-option ng-value="\'unavailable\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'unavailable\'">unavailable</md-option>\n                  <md-option ng-value="\'invalid\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'invalid\'">invalid</md-option>\n                  <md-option ng-value="\'unknown\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'unknown\'">unknown</md-option>\n                  <md-option ng-value="\'wrapup\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'wrapup\'">wrapup</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.JOINWHENEMPTY"></span></div>\n                <div ng-messages="generalForm[\'joinempty\'].$error" ng-show="generalForm[\'joinempty\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.JOINWHENEMPTY_REQUIRED">JoinWhenEmpty field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.LEAVEWHENEMPTY">LeaveWhenEmpty</label>\n                <md-select name="leavewhenempty" ng-model="vm.voiceQueue.leavewhenempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'no\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'no\'">no</md-option>\n                  <md-option ng-value="\'yes\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'yes\'">yes</md-option>\n                  <md-option ng-value="\'strict\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'strict\'">strict</md-option>\n                  <md-option ng-value="\'loose\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'loose\'">loose</md-option>\n                  <md-option ng-value="\'paused\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'paused\'">paused</md-option>\n                  <md-option ng-value="\'penalty\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'penalty\'">penalty</md-option>\n                  <md-option ng-value="\'inuse\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'inuse\'">inuse</md-option>\n                  <md-option ng-value="\'ringing\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'ringing\'">ringing</md-option>\n                  <md-option ng-value="\'unavailable\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'unavailable\'">unavailable</md-option>\n                  <md-option ng-value="\'invalid\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'invalid\'">invalid</md-option>\n                  <md-option ng-value="\'unknown\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'unknown\'">unknown</md-option>\n                  <md-option ng-value="\'wrapup\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'wrapup\'">wrapup</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.LEAVEWHENEMPTY"></span></div>\n                <div ng-messages="generalForm[\'leavewhenempty\'].$error" ng-show="generalForm[\'leavewhenempty\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.LEAVEWHENEMPTY_REQUIRED">LeaveWhenEmpty field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MUSICONHOLD">MusicOnHold</label>\n                <md-select name="musiconhold" ng-model="vm.voiceQueue.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MUSICONHOLD"></span></div>\n                <div ng-messages="generalForm[\'musiconhold\'].$error" ng-show="generalForm[\'musiconhold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCETOAGENT">AnnounceToAgent</label>\n                <md-select name="announce" ng-model="vm.voiceQueue.announce" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'FALSE\'">None</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + announce.save_name" ng-repeat="announce in vm.sounds" ng-disabled="announce.canSelect === false">{{ announce.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCETOAGENT"></span></div>\n                <div ng-messages="generalForm[\'announce\'].$error" ng-show="generalForm[\'announce\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCETOAGENT_REQUIRED">AnnounceToAgent field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.voiceQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceQueue-detail-form-container settings md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.SETTINGS">SETTINGS</div>\n            </div>\n            <form name="settingsForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCEFREQUENCY">AnnounceFrequency</label>\n                <input type="number" name="announce_frequency" ng-model="vm.voiceQueue.announce_frequency" min="0" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCEFREQUENCY"></span></div>\n                <div ng-messages="settingsForm[\'announce_frequency\'].$error" ng-show="settingsForm[\'announce_frequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_REQUIRED">AnnounceFrequency field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MINANNOUNCEFREQUENCY">MinAnnounceFrequency</label>\n                <input type="number" name="min_announce_frequency" ng-model="vm.voiceQueue.min_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.MINANNOUNCEFREQUENCY"></span></div>\n                <div ng-messages="settingsForm[\'min_announce_frequency\'].$error" ng-show="settingsForm[\'min_announce_frequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_REQUIRED">MinAnnounceFrequency field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MinAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PERIODICANNOUNCEFREQUENCY">PeriodicAnnounceFrequency</label>\n                <input type="number" name="periodic_announce_frequency" ng-model="vm.voiceQueue.periodic_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCEFREQUENCY"></span></div>\n                <div ng-messages="settingsForm[\'periodic_announce_frequency\'].$error" ng-show="settingsForm[\'periodic_announce_frequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_REQUIRED">PeriodicAnnounceFrequency field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">PeriodicAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RANDOMPERIODICANNOUNCE">RandomPeriodicAnnounce</label>\n                <md-select name="random_periodic_announce" ng-model="vm.voiceQueue.random_periodic_announce" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.RANDOMPERIODICANNOUNCE"></span></div>\n                <div ng-messages="settingsForm[\'random_periodic_announce\'].$error" ng-show="settingsForm[\'random_periodic_announce\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RANDOMPERIODICANNOUNCE_REQUIRED">RandomPeriodicAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCEHOLDTIME">AnnounceHoldtime</label>\n                <md-select name="announce_holdtime" ng-model="vm.voiceQueue.announce_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'once\'">Once</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCEHOLDTIME"></span></div>\n                <div ng-messages="settingsForm[\'announce_holdtime\'].$error" ng-show="settingsForm[\'announce_holdtime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCEHOLDTIME_REQUIRED">AnnounceHoldtime field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCECALLERPOSITION">AnnounceCallerPosition</label>\n                <md-select name="announce_position" ng-model="vm.voiceQueue.announce_position" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'limit\'">Limit</md-option>\n                  <md-option ng-value="\'more\'">More</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCECALLERPOSITION"></span></div>\n                <div ng-messages="settingsForm[\'announce_position\'].$error" ng-show="settingsForm[\'announce_position\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCECALLERPOSITION_REQUIRED">AnnounceCallerPosition field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCEPOSITIONLIMIT">AnnouncePositionLimit</label>\n                <input type="number" name="announce_position_limit" ng-model="vm.voiceQueue.announce_position_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCEPOSITIONLIMIT"></span></div>\n                <div ng-messages="settingsForm[\'announce_position_limit\'].$error" ng-show="settingsForm[\'announce_position_limit\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCEPOSITIONLIMIT_REQUIRED">AnnouncePositionLimit field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.REPORTHOLDTIMEAGENT">ReportHoldtimeAgent</label>\n                <md-select name="reportholdtime" ng-model="vm.voiceQueue.reportholdtime" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.REPORTHOLDTIMEAGENT"></span></div>\n                <div ng-messages="settingsForm[\'reportholdtime\'].$error" ng-show="settingsForm[\'reportholdtime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.REPORTHOLDTIMEAGENT_REQUIRED">ReportHoldtimeAgent field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="voiceQueue-detail-form-container announcements md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</div>\n            </div>\n            <form name="announcementsForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PERIODICANNOUNCE">PeriodicAnnounce</label>\n                <md-select name="periodic_announce" ng-model="vm.voiceQueue.periodic_announce" autofocus multiple ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Default</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + periodic_announce.save_name" ng-repeat="periodic_announce in vm.sounds" ng-disabled="periodic_announce.canSelect === false">{{ periodic_announce.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'periodic_announce\'].$error" ng-show="announcementsForm[\'periodic_announce\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PERIODICANNOUNCE_REQUIRED">PeriodicAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.HOLDTIMEANNOUNCE">HoldTimeAnnounce</label>\n                <md-select name="queue_reporthold" ng-model="vm.voiceQueue.queue_reporthold" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_reporthold.save_name" ng-repeat="queue_reporthold in vm.sounds" ng-disabled="queue_reporthold.canSelect === false">{{ queue_reporthold.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.HOLDTIMEANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_reporthold\'].$error" ng-show="announcementsForm[\'queue_reporthold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.HOLDTIMEANNOUNCE_REQUIRED">HoldTimeAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.YOUARENEXTANNOUNCE">YouareNextAnnounce</label>\n                <md-select name="queue_youarenext" ng-model="vm.voiceQueue.queue_youarenext" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_youarenext.save_name" ng-repeat="queue_youarenext in vm.sounds" ng-disabled="queue_youarenext.canSelect === false">{{ queue_youarenext.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.YOUARENEXTANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_youarenext\'].$error" ng-show="announcementsForm[\'queue_youarenext\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.YOUARENEXTANNOUNCE_REQUIRED">YouareNextAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.THEREAREANNOUNCE">ThereareAnnounce</label>\n                <md-select name="queue_thereare" ng-model="vm.voiceQueue.queue_thereare" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thereare.save_name" ng-repeat="queue_thereare in vm.sounds" ng-disabled="queue_thereare.canSelect === false">{{ queue_thereare.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.THEREAREANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_thereare\'].$error" ng-show="announcementsForm[\'queue_thereare\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.THEREAREANNOUNCE_REQUIRED">ThereareAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.WAITINGCALLSANNOUNCE">WaitingCallsAnnounce</label>\n                <md-select name="queue_callswaiting" ng-model="vm.voiceQueue.queue_callswaiting" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_callswaiting.save_name" ng-repeat="queue_callswaiting in vm.sounds" ng-disabled="queue_callswaiting.canSelect === false">{{ queue_callswaiting.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.WAITINGCALLSANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_callswaiting\'].$error" ng-show="announcementsForm[\'queue_callswaiting\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.WAITINGCALLSANNOUNCE_REQUIRED">WaitingCallsAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ESTIMATEDHOLDTIMEANNOUNCE">EstimatedHoldTimeAnnounce</label>\n                <md-select name="queue_holdtime" ng-model="vm.voiceQueue.queue_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_holdtime.save_name" ng-repeat="queue_holdtime in vm.sounds" ng-disabled="queue_holdtime.canSelect === false">{{ queue_holdtime.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.ESTIMATEDHOLDTIMEANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_holdtime\'].$error" ng-show="announcementsForm[\'queue_holdtime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ESTIMATEDHOLDTIMEANNOUNCE_REQUIRED">EstimatedHoldTimeAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MINUTESANNOUNCE">MinutesAnnounce</label>\n                <md-select name="queue_minutes" ng-model="vm.voiceQueue.queue_minutes" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minutes.save_name" ng-repeat="queue_minutes in vm.sounds" ng-disabled="queue_minutes.canSelect === false">{{ queue_minutes.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MINUTESANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_minutes\'].$error" ng-show="announcementsForm[\'queue_minutes\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MINUTESANNOUNCE_REQUIRED">MinutesAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MINUTEANNOUNCE">MinuteAnnounce</label>\n                <md-select name="queue_minute" ng-model="vm.voiceQueue.queue_minute" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minute.save_name" ng-repeat="queue_minute in vm.sounds" ng-disabled="queue_minute.canSelect === false">{{ queue_minute.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MINUTEANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_minute\'].$error" ng-show="announcementsForm[\'queue_minute\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MINUTEANNOUNCE_REQUIRED">MinuteAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SECONDSANNOUNCE">SecondsAnnounce</label>\n                <md-select name="queue_seconds" ng-model="vm.voiceQueue.queue_seconds" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_seconds.save_name" ng-repeat="queue_seconds in vm.sounds" ng-disabled="queue_seconds.canSelect === false">{{ queue_seconds.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.SECONDSANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_seconds\'].$error" ng-show="announcementsForm[\'queue_seconds\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SECONDSANNOUNCE_REQUIRED">SecondsAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.THANKYOUANNOUNCE">ThankYouAnnounce</label>\n                <md-select name="queue_thankyou" ng-model="vm.voiceQueue.queue_thankyou" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thankyou.save_name" ng-repeat="queue_thankyou in vm.sounds" ng-disabled="queue_thankyou.canSelect === false">{{ queue_thankyou.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.THANKYOUANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_thankyou\'].$error" ng-show="announcementsForm[\'queue_thankyou\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.THANKYOUANNOUNCE_REQUIRED">ThankYouAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceQueue-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.voiceQueue.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.AFTERCALLWORK">AfterCallWork</span></md-switch>\n                <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORK"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.voiceQueue.acw" class="md-block">\n                <label translate="VOICE.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n                <input type="number" name="acwTimeout" ng-model="vm.voiceQueue.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORKDURATION"></span></div>\n                <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.AUTOPAUSE">AutoPause</label>\n                <md-select name="autopause" ng-model="vm.voiceQueue.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'all\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.AUTOPAUSE"></span></div>\n                <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RINGINUSE">RingInUse</label>\n                <md-select name="ringinuse" ng-model="vm.voiceQueue.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.RINGINUSE"></span></div>\n                <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MEMBERDELAY">MemberDelay</label>\n                <input type="number" name="memberdelay" ng-model="vm.voiceQueue.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.MEMBERDELAY"></span></div>\n                <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.TIMEOUTRESTART">TimeoutRestart</label>\n                <md-select name="timeoutrestart" ng-model="vm.voiceQueue.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.TIMEOUTRESTART"></span></div>\n                <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MONITORFORMAT">MonitorFormat</label>\n                <md-select name="monitor_format" ng-model="vm.voiceQueue.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Inactive</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'wav49\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MONITORFORMAT"></span></div>\n                <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONTEXT">Context</label>\n                <input type="text" name="context" ng-model="vm.voiceQueue.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.CONTEXT"></span></div>\n                <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n                <md-select name="setinterfacevar" ng-model="vm.voiceQueue.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.SETINTERFACEVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SETQUEUEVARIABLES">SetQueueVariables</label>\n                <md-select name="setqueuevar" ng-model="vm.voiceQueue.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.SETQUEUEVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n                <md-select name="setqueueentryvar" ng-model="vm.voiceQueue.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SERVICELEVEL">ServiceLevel</label>\n                <input type="number" name="servicelevel" ng-model="vm.voiceQueue.servicelevel" min="0" max="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.SERVICELEVEL"></span></div>\n                <div ng-messages="advancedForm[\'servicelevel\'].$error" ng-show="advancedForm[\'servicelevel\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SERVICELEVEL_REQUIRED">ServiceLevel field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.SERVICELEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ServiceLevel must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="VOICE.ERRORS.SERVICELEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO">ServiceLevel must be a valid greater or equal than</span> <span>100</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.voiceQueue.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.voiceQueue.mandatoryDisposition" class="md-block">\n                <label translate="VOICE.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.voiceQueue.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/voiceQueues.html",'<div id="voiceQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.VOICEQUEUES">VoiceQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVoiceQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVoiceQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-voiceQueues-count">\n          <span>{{vm.selectedVoiceQueues.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVoiceQueues()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVoiceQueues()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceQueues" csv-label="true" filename="voiceQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceQueues($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VOICEQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVoiceQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'VOICE.STRATEGY\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.voiceQueues.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="voiceQueue" md-select-id="id" ng-repeat="voiceQueue in vm.voiceQueues.rows">\n                <td md-cell ng-if="voiceQueue.userpic"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="api/users/{{voiceQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!voiceQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="id ">{{voiceQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="name ">{{voiceQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="strategy ">{{ vm.arraystrategy[voiceQueue.strategy].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="description ">{{voiceQueue.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(voiceQueue, $event    )" translate="VOICE.EDIT_VOICEQUEUE">\n                          Edit VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(voiceQueue, $event    )" translate="VOICE.TEAMADD_VOICEQUEUE">\n                          teamadd VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(voiceQueue, $event    )" translate="VOICE.AGENTADD_VOICEQUEUE">\n                          agentadd VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(voiceQueue, $event    )" translate="VOICE.DELETE_VOICEQUEUE">\n                          Delete VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(voiceQueue, $event    )" translate="VOICE.GOTOREALTIME_VOICEQUEUE">\n                          goToRealtime VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VOICEQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VOICEQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voiceQueue-button" ng-click="vm.createOrEditVoiceQueue($event)" aria-label="add voiceQueue" translate translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VOICEQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/create/dialog.html",'<md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">\n  <form name="voiceRecordingForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.RATING">Rating</label>\n        <md-select name="rating" ng-model="vm.voiceRecording.rating" autofocus ng-disabled="!vm.newVoiceRecording && !vm.crudPermissions.canEdit">\n          <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n          <md-option value="1">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n          </md-option>\n          <md-option value="2">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n          </md-option>\n          <md-option value="3">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n          </md-option>\n          <md-option value="4">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n          </md-option>\n          <md-option value="5">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n          </md-option>\n        </md-select>\n        <div ng-messages="voiceRecordingForm[\'rating\'].$error" ng-show="voiceRecordingForm[rating].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceRecording" ng-click="vm.saveVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceRecording" ng-click="vm.addNewVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICERECORDING" translate-attr-aria-label="VOICE.ADD_VOICERECORDING">\n          ADD VOICERECORDING\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceRecording" ng-click="vm.deleteVoiceRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceRecordings/edit/view.html",'<div id="voice-voiceRecording" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-voiceRecordings-button md-icon-button" aria-label="Go to voiceRecordings" ng-click="vm.gotoVoiceRecordings()" translate translate-attr-aria-label="VOICE.GO_TO_VOICERECORDINGS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="voiceRecording-image" hide-xs>\n          <img ng-src="assets/images/business/voiceRecordings.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.voiceRecording.id}}\n            <span ng-if="vm.voiceRecording.name">{{vm.voiceRecording.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceRecording.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveVoiceRecording()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(voiceRecordingsForm.$invalid) || (transcriptForm.$invalid) || (sentimentAnalysisForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.GENERAL">GENERAL</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceRecording-detail-form-container voicerecordings md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.VOICERECORDINGS">VOICERECORDINGS</div>\n            </div>\n            <form name="voiceRecordingsForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.TYPE">Type</label>\n                <input type="" name="type" ng-model="vm.voiceRecording.type" autofocus disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'type\'].$error" ng-show="voiceRecordingsForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.UNIQUEID">UniqueId</label>\n                <input type="" name="uniqueid" ng-model="vm.voiceRecording.uniqueid" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'uniqueid\'].$error" ng-show="voiceRecordingsForm[\'uniqueid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.UNIQUEID_REQUIRED">UniqueId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CALLER">Caller</label>\n                <input type="" name="calleridnum" ng-model="vm.voiceRecording.calleridnum" privacy="vm.userProfile.privacyEnabled" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'calleridnum\'].$error" ng-show="voiceRecordingsForm[\'calleridnum\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CALLER_REQUIRED">Caller field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CALLED">Called</label>\n                <input type="" name="exten" ng-model="vm.voiceRecording.exten" privacy="vm.userProfile.privacyEnabled" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'exten\'].$error" ng-show="voiceRecordingsForm[\'exten\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CALLED_REQUIRED">Called field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONNECTED">Connected</label>\n                <input type="" name="connectedlinenum" ng-model="vm.voiceRecording.connectedlinenum" privacy="vm.userProfile.privacyEnabled" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'connectedlinenum\'].$error" ng-show="voiceRecordingsForm[\'connectedlinenum\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONNECTED_REQUIRED">Connected field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.QUEUE">Queue</label>\n                <input type="" name="queue" ng-model="vm.voiceRecording.queue" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'queue\'].$error" ng-show="voiceRecordingsForm[\'queue\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.AGENT">Agent</label>\n                <input type="text" name="membername" ng-model="vm.voiceRecording.membername" privacy="vm.userProfile.privacyEnabled" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'membername\'].$error" ng-show="voiceRecordingsForm[\'membername\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RATING">Rating</label>\n                <md-select name="rating" ng-model="vm.voiceRecording.rating" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n                  <md-option value="1">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n                  </md-option>\n                  <md-option value="2">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n                  </md-option>\n                  <md-option value="3">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n                  </md-option>\n                  <md-option value="4">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n                  </md-option>\n                  <md-option value="5">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n                  </md-option>\n                </md-select>\n                <div ng-messages="voiceRecordingsForm[\'rating\'].$error" ng-show="voiceRecordingsForm[rating].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DISPOSITION">Disposition</label>\n                <input type="text" name="userDisposition" ng-model="vm.voiceRecording.userDisposition" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'userDisposition\'].$error" ng-show="voiceRecordingsForm[\'userDisposition\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SECOND_LEVEL_DISPOSITION">Second_Level_Disposition</label>\n                <input type="text" name="userSecondDisposition" ng-model="vm.voiceRecording.userSecondDisposition" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'userSecondDisposition\'].$error" ng-show="voiceRecordingsForm[\'userSecondDisposition\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SECOND_LEVEL_DISPOSITION_REQUIRED">Second_Level_Disposition field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.THIRD_LEVEL_DISPOSITION">Third_Level_Disposition</label>\n                <input type="text" name="userThirdDisposition" ng-model="vm.voiceRecording.userThirdDisposition" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'userThirdDisposition\'].$error" ng-show="voiceRecordingsForm[\'userThirdDisposition\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.THIRD_LEVEL_DISPOSITION_REQUIRED">Third_Level_Disposition field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.license.ai">\n        <md-tab-label>\n          <span translate="VOICE.TRANSCRIPTANALYSIS">TRANSCRIPTANALYSIS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceRecording-detail-form-container transcript md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.TRANSCRIPT">TRANSCRIPT</div>\n            </div>\n            <form name="transcriptForm" novalidate>\n              <md-input-container ng-if="vm.voiceRecording.transcribeStatus == \'COMPLETED\'" class="md-block">\n                <label translate="VOICE.TEXT">Text</label>\n                <textarea name="fileText" ng-model="vm.voiceRecording.fileText" autofocus ng-disabled="true"></textarea>\n              </md-input-container>\n              <md-input-container ng-if="vm.voiceRecording.transcribeStatus == \'FAILED\'" class="md-block">\n                <label translate="VOICE.FAILUREREASON">FailureReason</label>\n                <textarea name="failureReason" ng-model="vm.voiceRecording.failureReason" ng-disabled="true"></textarea>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="voiceRecording-detail-form-container sentimentanalysis md-background-bg md-whiteframe-1dp">\n            <div ng-controller="VoiceRecordingSentimentStatisticsController as vm_ss" ng-init="vm_ss.init(vm.voiceRecording)">\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="VOICE.SENTIMENTANALYSIS" style="width: 50px;">Sentiment Analysis</span>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- WIDGET GROUP --\x3e\n              <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n                \x3c!-- WIDGET 1 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8 sentiment" ng-class="vm_ss.voiceRecording.sentiment">\n                        {{vm_ss.voiceRecording.sentiment}}\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 1 --\x3e\n\n                \x3c!-- WIDGET 2 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">\n                        ({{ (vm_ss.voiceRecording.sPositive || 0) * 100 | number: 2  }}%)\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT_POSITIVE\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 2 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">\n                        ({{ (vm_ss.voiceRecording.sNegative || 0) * 100 | number: 2  }}%)\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT_NEGATIVE\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n                \x3c!-- WIDGET 4 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">\n                        ({{ (vm_ss.voiceRecording.sNeutral || 0) * 100 | number: 2  }}%)\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT_NEUTRAL\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 4 --\x3e\n\n                \x3c!-- WIDGET 5 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">\n                        ({{ (vm_ss.voiceRecording.sMixed || 0) * 100 | number: 2  }}%)\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT_MIXED\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 5 --\x3e\n\n              </div>\n              \x3c!-- / WIDGET GROUP --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",'<div id="voiceRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.VOICERECORDINGS">VoiceRecordings</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceRecordings()"></ms-quick-filter>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVoiceRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVoiceRecordings =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-voiceRecordings-count">\n          <span>{{vm.selectedVoiceRecordings.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVoiceRecordings()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVoiceRecordings()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceRecordings" csv-label="true" filename="voiceRecordings.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runtranscribesentimentSelectedVoiceRecordings($event)" aria-label="transcribesentiment selected" translate translate-attr-label="VOICERECORDINGS.TRANSCRIBESENTIMENT_SELECTED">\n          <md-icon md-font-icon="icon-text-to-speech"></md-icon>\n          <md-tooltip>{{\'VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runtranscribeSelectedVoiceRecordings($event)" aria-label="transcribe selected" translate translate-attr-label="VOICERECORDINGS.TRANSCRIBE_SELECTED">\n          <md-icon md-font-icon="icon-format-size"></md-icon>\n          <md-tooltip>{{\'VOICE.RUNTRANSCRIBE_VOICERECORDING\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runsentimentSelectedVoiceRecordings($event)" aria-label="transcribe selected" translate translate-attr-label="VOICERECORDINGS.SENTIMENT_SELECTED">\n          <md-icon md-font-icon="icon-heart-outline"></md-icon>\n          <md-tooltip>{{\'VOICE.RUNSENTIMENT_VOICERECORDING\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceRecordings($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VOICERECORDING TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVoiceRecordings" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n                <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n                <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n                <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n                <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n                <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n                <th md-column md-order-by="membername">{{ \'VOICE.AGENT\' | translate }}</th>\n                <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n                <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n                <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n                <th md-column md-order-by="userSecondDisposition">{{ \'VOICE.SECOND_LEVEL_DISPOSITION\' | translate }}</th>\n                <th md-column md-order-by="userThirdDisposition">{{ \'VOICE.THIRD_LEVEL_DISPOSITION\' | translate }}</th>\n                <th md-column md-order-by="transcribeStatus" ng-if="vm.license.ai">{{ \'VOICE.TRANSCRIBE\' | translate }}</th>\n                <th md-column md-order-by="sentiment" ng-if="vm.license.ai">{{ \'VOICE.SENTIMENTANALYSIS\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n                <td md-cell colspan="16">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="voiceRecording" md-select-id="id" ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n                <td md-cell ng-if="voiceRecording.userpic"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="api/users/{{voiceRecording.id}}/avatar" /></td>\n                <td md-cell ng-if="!voiceRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="type ">{{voiceRecording.type}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="uniqueid ">{{voiceRecording.uniqueid}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="calleridnum " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.calleridnum}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="exten " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.exten}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="connectedlinenum " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.connectedlinenum}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="queue ">{{voiceRecording.queue}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="membername " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.membername}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="rating ">\n                  <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n                </td>\n                <td md-cell class="audio " ng-switch="voiceRecording.format">\n                  \x3c!-- audio recording directive --\x3e\n                  <ms-recording ng-switch-when=".wav" id="voiceRecording.id" model="\'voiceRecording\'"></ms-recording>\n                  \x3c!-- / audio recording directive --\x3e\n                  <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n                    <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n                  </span>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userDisposition ">{{voiceRecording.userDisposition}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userSecondDisposition ">{{voiceRecording.userSecondDisposition}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userThirdDisposition ">{{voiceRecording.userThirdDisposition}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="transcribeStatus " ng-if="vm.license.ai">{{ \'VOICE.TRANSCRIBESTATUS_\' + voiceRecording.transcribeStatus | translate}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="sentiment " ng-if="vm.license.ai">{{voiceRecording.sentiment}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(voiceRecording, $event    )" translate="VOICE.EDIT_VOICERECORDING">\n                          Edit VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="voiceRecording.transcribeStatus == \'NEW\' && vm.license.ai">\n\n                        <md-button ng-click="vm.runtranscriberuntranscribesentiment(voiceRecording, $event    )" translate="VOICE.RUNTRANSCRIBE_VOICERECORDING">\n                          RunTranscribe VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="voiceRecording.transcribeStatus == \'NEW\' && vm.license.ai">\n\n                        <md-button ng-click="vm.runtranscribesentimentruntranscribesentiment(voiceRecording, $event    )" translate="VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING">\n                          RunTranscribeSentiment VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\' && voiceRecording.sentiment == null && vm.license.ai">\n\n                        <md-button ng-click="vm.runsentimentruntranscribesentiment(voiceRecording, $event    )" translate="VOICE.RUNSENTIMENT_VOICERECORDING">\n                          RunSentiment VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\' && vm.license.ai">\n\n                        <md-button ng-click="vm.downloadtranscribefile2(voiceRecording, $event    )" translate="VOICE.DOWNLOADTRANSCRIBE_VOICERECORDING">\n                          DownloadTranscribe VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadVoiceRecordings">\n\n                        <md-button ng-click="vm.downloadfile2(voiceRecording, $event  , \'voice/recordings\'   )" translate="VOICE.DOWNLOAD_VOICERECORDING">\n                          Download VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(voiceRecording, $event    )" translate="VOICE.DELETE_VOICERECORDING">\n                          Delete VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VOICERECORDING TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="WHATSAPP.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n        <th md-column>{{ \'WHATSAPP.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'WHATSAPP.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'WHATSAPP.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="WHATSAPP.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="WHATSAPP.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/whatsapp/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/create/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.whatsappAccount.name" ng-required="true" autofocus ng-disabled="!vm.newWhatsappAccount">\n\n        <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n        <div ng-messages="whatsappAccountForm[\'name\'].$error" ng-show="whatsappAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.whatsappAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="whatsappAccountForm[\'key\'].$error" ng-show="whatsappAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>\n        <div ng-messages="whatsappAccountForm[\'ListId\'].$error" ng-show="whatsappAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>\n        <input type="url" name="remote" ng-model="vm.whatsappAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="WHATSAPP.HELP.MOTIONPROXY"></span></div>\n        <div ng-messages="whatsappAccountForm[\'remote\'].$error" ng-show="whatsappAccountForm[\'remote\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.whatsappAccount.type">\n          <md-option ng-value="\'twilio\'">Twilio</md-option>\n          <md-option ng-value="\'sinch\'">Sinch</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountForm[\'type\'].$error" ng-show="whatsappAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n        <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>\n        <input type="text" name="accountSid" ng-model="vm.whatsappAccount.accountSid" ng-required="true">\n\n        <div ng-messages="whatsappAccountForm[\'accountSid\'].$error" ng-show="whatsappAccountForm[\'accountSid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n        <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>\n        <input type="text" name="authToken" ng-model="vm.whatsappAccount.authToken" ng-required="true">\n\n        <div ng-messages="whatsappAccountForm[\'authToken\'].$error" ng-show="whatsappAccountForm[\'authToken\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.whatsappAccount.type == \'sinch\'" class="md-block">\n        <label translate="WHATSAPP.BASEURL">Base URL</label>\n\n        \x3c!--    <input type="text" name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" ng-required="true"> --\x3e\n\n        <md-select name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" required>\n          <md-option ng-value="\'https://us1.whatsapp.api.sinch.com\'">US Production</md-option>\n          <md-option ng-value="\'https://eu1.whatsapp.api.sinch.com\'">EU Production</md-option>\n        </md-select>\n\n        <div ng-messages="whatsappAccountForm[\'authToken\'].$error" ng-show="whatsappAccountForm[\'authToken\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.PHONE">phone</label>\n        <input type="text" name="phone" ng-model="vm.whatsappAccount.phone" ng-required="true">\n        <div ng-messages="whatsappAccountForm[\'phone\'].$error" ng-show="whatsappAccountForm[\'phone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED">phone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.whatsappAccount.description">\n\n        <div ng-messages="whatsappAccountForm[\'description\'].$error" ng-show="whatsappAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappAccount" ng-click="vm.saveWhatsappAccount()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountForm.$invalid || whatsappAccountForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappAccount" ng-click="vm.addNewWhatsappAccount()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPACCOUNT" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">\n          ADD WHATSAPPACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappAccount" ng-click="vm.deleteWhatsappAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",'<md-dialog class="whatsappAccount-dialog" aria-label="whatsappAccount" ng-init="vm.onInit()">\n  <form name="whatsappAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">Add Agent to whatsappAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/agent/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'agent\'].$error" ng-show="whatsappAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'timeout\'].$error" ng-show="whatsappAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.ACCESSKEYID">accesskeyid</label>\n        <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'accesskeyid\'].$error" ng-show="whatsappAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.SECRETACCESSKEY">secretaccesskey</label>\n        <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'secretaccesskey\'].$error" ng-show="whatsappAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.LEXREGION">lexregion</label>\n        <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n          <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n          <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n          <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'lexregion\'].$error" ng-show="whatsappAccountFormApp[\'lexregion\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.BOTNAME">botname</label>\n        <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'botname\'].$error" ng-show="whatsappAccountFormApp[\'botname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'times\'].$error" ng-show="whatsappAccountFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TEXT">Text</label>\n        <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n        <div ng-messages="whatsappAccountFormApp[\'text\'].$error" ng-show="whatsappAccountFormApp[\'text\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TEXT_REQUIRED">Text field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/close/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'disposition\'].$error" ng-show="whatsappAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'key\'].$error" ng-show="whatsappAccountFormApp[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n          <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'sv\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'language\'].$error" ng-show="whatsappAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.PROJECTID">ProjectID</label>\n        <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'projectId\'].$error" ng-show="whatsappAccountFormApp[\'projectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.CLIENTEMAIL">ClientEmail</label>\n        <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'clientEmail\'].$error" ng-show="whatsappAccountFormApp[\'clientEmail\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.PRIVATEKEY">PrivateKey</label>\n        <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n        <div ng-messages="whatsappAccountFormApp[\'privateKey\'].$error" ng-show="whatsappAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n          <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n          <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n          <md-option ng-value="\'en-IN\'">English (India)</md-option>\n          <md-option ng-value="\'en-US\'">English (US)</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n          <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'hi\'">Hindi</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pl\'">Polish</md-option>\n          <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n          <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n          <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n          <md-option ng-value="\'sw\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'tr\'">Turkish</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'language\'].$error" ng-show="whatsappAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'condition\'].$error" ng-show="whatsappAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'truepriority\'].$error" ng-show="whatsappAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'falsepriority\'].$error" ng-show="whatsappAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'priority\'].$error" ng-show="whatsappAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/noop/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'value\'].$error" ng-show="whatsappAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/queue/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'queue\'].$error" ng-show="whatsappAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'timeout\'].$error" ng-show="whatsappAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/system/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'command\'].$error" ng-show="whatsappAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'variable\'].$error" ng-show="whatsappAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/tag/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'tag\'].$error" ng-show="whatsappAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/view.html",'<div id="whatsapp-whatsappAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-whatsappAccounts-button md-icon-button" aria-label="Go to whatsappAccounts" ng-click="vm.gotoWhatsappAccounts()" translate translate-attr-aria-label="WHATSAPP.GO_TO_WHATSAPPACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="whatsappAccount-image" hide-xs>\n          <img ng-src="assets/images/business/whatsappAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.whatsappAccount.id}}\n            <span ng-if="vm.whatsappAccount.name">{{vm.whatsappAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="WHATSAPP.CREATED_AT"></span> <span>{{vm.whatsappAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.whatsappAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveWhatsappAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (whatsappDispositionsForm.$invalid) || (whatsappCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.whatsappAccount.name" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.whatsappAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\'  || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n                <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>\n                <input type="text" name="accountSid" ng-model="vm.whatsappAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\'  || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n                <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>\n                <input type="text" name="authToken" ng-model="vm.whatsappAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n\n\n              <md-input-container ng-if="vm.whatsappAccount.type == \'sinch\'" class="md-block">\n                <label translate="WHATSAPP.BASEURL">BaseURL</label>\n\n                <md-select name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryBaseUrl.url" ng-repeat="mandatoryBaseUrl in vm.baseUrl" ng-disabled="mandatoryBaseUrl.canSelect === false">{{ mandatoryBaseUrl.name }}</md-option>\n                </md-select>\n\n                <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.BASEURL_REQUIRED">Base URL field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n\n\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.PHONE">phone</label>\n                <input type="text" name="phone" ng-model="vm.whatsappAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED">phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.RECEIVEURL">receiveUrl</label>\n\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.whatsappAccount.remote + \'/api/whatsapp/accounts/\' + vm.whatsappAccount.id + \'/notify?token=\' + vm.whatsappAccount.token" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="WHATSAPP.HELP.RECEIVEURL"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.whatsappAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.whatsappAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="whatsappAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="WHATSAPP.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.whatsappAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="whatsappAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.whatsappAccount.queueTransfer == true" class="md-block">\n                <label translate="WHATSAPP.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.whatsappAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.whatsappAccount.agentTransfer == true" class="md-block">\n                <label translate="WHATSAPP.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.whatsappAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.PROXY">PROXY</div>\n            </div>\n            <form name="proxyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>\n                <input type="url" name="remote" ng-model="vm.whatsappAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="WHATSAPP.HELP.MOTIONPROXY"></span></div>\n                <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.TOKEN">token</label>\n                <input type="text" name="token" ng-model="vm.whatsappAccount.token" disabled>\n\n                <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.TOKEN_REQUIRED">token field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="whatsappAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.whatsappAccount.mandatoryDisposition" class="md-block">\n                <label translate="WHATSAPP.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.whatsappAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="WHATSAPP.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="WhatsappAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="whatsappAccount-detail-form-container whatsappdispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="WHATSAPP.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add whatsapp dispositions" translate translate-attr-label="WHATSAPP.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="whatsappAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'WHATSAPP.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container whatsappcannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="WhatsappAccountWhatsappCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="WHATSAPP.WHATSAPPCANNEDANSWERS">WhatsappCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getWhatsappAccountWhatsappCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event)" aria-label="add whatsappCannedAnswer" translate translate-attr-label="WHATSAPP.ADD_WHATSAPPCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length}} {{vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedWhatsappAccountWhatsappCannedAnswers" csv-label="true" filename="whatsappAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedWhatsappAccountWhatsappCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getWhatsappAccountWhatsappCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'WHATSAPP.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'WHATSAPP.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'WHATSAPP.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'WHATSAPP.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'WHATSAPP.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="whatsappCannedAnswer" md-select-id="id" ng-repeat="whatsappCannedAnswer in vm_dc.whatsappAccountWhatsappCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{whatsappCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{whatsappCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{whatsappCannedAnswer.value}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{whatsappCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{ whatsappCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" translate="WHATSAPP.EDIT_WHATSAPPCANNEDANSWER">\n                                Edit WhatsappCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(whatsappCannedAnswer, $event)" translate="WHATSAPP.DELETE_WHATSAPPCANNEDANSWER">\n                                Delete WhatsappCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.whatsappAccountWhatsappCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="WHATSAPP.NO_WHATSAPPCANNEDANSWER_AVAILABLE">No whatsappcannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.whatsappAccountWhatsappCannedAnswers.count}}" md-on-paginate="vm_dc.getWhatsappAccountWhatsappCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="WhatsappAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.whatsappAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="WHATSAPP.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedWhatsappAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedWhatsappAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedWhatsappAccountApps.length}} {{vm_ac.selectedWhatsappAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedWhatsappAccountApps($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedWhatsappAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.whatsappAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editWhatsappAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.whatsappAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="WhatsappAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="WHATSAPP.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getWhatsappAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getWhatsappAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getWhatsappAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="WHATSAPP.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedWhatsappAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedWhatsappAccountInteractions.length}} {{vm_dc.selectedWhatsappAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedWhatsappAccountInteractions" csv-label="true" filename="whatsappAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedWhatsappAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedWhatsappAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getWhatsappAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'WHATSAPP.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'WHATSAPP.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'WHATSAPP.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'WHATSAPP.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'WHATSAPP.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'WHATSAPP.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'WHATSAPP.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.whatsappAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'WHATSAPP.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'WHATSAPP.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spywhatsappInteraction($event, interaction)" translate="WHATSAPP.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.whatsappInteractionDownload(interaction, $event)" translate="WHATSAPP.DOWNLOAD_INTERACTION">\n                                Download\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="WHATSAPP.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.whatsappAccountInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="WHATSAPP.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.whatsappAccountInteractions.count}}" md-on-paginate="vm_dc.getWhatsappAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/whatsappCannedAnswers/dialog.html",'<md-dialog class="whatsappCannedAnswer-dialog" aria-label="New WhatsappCannedAnswer">\n  <form name="whatsappCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.whatsappCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="whatsappCannedAnswerForm[\'key\'].$error" ng-show="whatsappCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.whatsappCannedAnswer.value" required></textarea>\n\n        <div ng-messages="whatsappCannedAnswerForm[\'value\'].$error" ng-show="whatsappCannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.whatsappCannedAnswer.description">\n\n        <div ng-messages="whatsappCannedAnswerForm[\'description\'].$error" ng-show="whatsappCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappCannedAnswer" ng-click="vm.saveWhatsappCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="whatsappCannedAnswerForm.$invalid || whatsappCannedAnswerForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappCannedAnswer" ng-click="vm.addNewWhatsappCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="whatsappCannedAnswerForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPCANNEDANSWER" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPCANNEDANSWER">\n          ADD WHATSAPPCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappCannedAnswer" ng-click="vm.deleteWhatsappCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/whatsappAccounts.html",'<div id="whatsappAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="WHATSAPP.WHATSAPPACCOUNTS">WhatsappAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="WHATSAPP.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedWhatsappAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedWhatsappAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="WHATSAPP.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-whatsappAccounts-count">\n          <span>{{vm.selectedWhatsappAccounts.length}}</span>\n          <span translate="WHATSAPP.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllWhatsappAccounts()" translate="WHATSAPP.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectWhatsappAccounts()" translate="WHATSAPP.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappAccounts" csv-label="true" filename="whatsappAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedWhatsappAccounts($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- WHATSAPPACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedWhatsappAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'WHATSAPP.KEY\' | translate }}</th>\n                <th md-column md-order-by="ListId">{{ \'WHATSAPP.LIST\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'WHATSAPP.TYPE\' | translate }}</th>\n                <th md-column md-order-by="phone">{{ \'WHATSAPP.PHONE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'WHATSAPP.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.whatsappAccounts.rows.length">\n                <td md-cell colspan="8">\n                  <div layout="row" layout-align="center center">\n                    <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="whatsappAccount" md-select-id="id" ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">\n                <td md-cell ng-if="whatsappAccount.userpic"><img class="avatar" alt="{{whatsappAccount.name}}" ng-src="api/users/{{whatsappAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!whatsappAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{whatsappAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="id ">{{whatsappAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="name ">{{whatsappAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="key ">{{whatsappAccount.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':whatsappAccount.ListId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="type ">{{ vm.arraytype[whatsappAccount.type].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="phone ">{{whatsappAccount.phone}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="description ">{{whatsappAccount.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(whatsappAccount, $event    )" translate="WHATSAPP.EDIT_WHATSAPPACCOUNT">\n                          Edit WhatsappAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(whatsappAccount, $event    )" translate="WHATSAPP.INTERACTIONS_WHATSAPPACCOUNT">\n                          Interactions WhatsappAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(whatsappAccount, $event    )" translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">\n                          AgentAdd WhatsappAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(whatsappAccount, $event    )" translate="WHATSAPP.DELETE_WHATSAPPACCOUNT">\n                          Delete WhatsappAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappAccounts.count}}" md-on-paginate="vm.getWhatsappAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / WHATSAPPACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD WHATSAPPACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-whatsappAccount-button" ng-click="vm.createOrEditWhatsappAccount($event)" aria-label="add whatsappAccount" translate translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD WHATSAPPACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",'<md-dialog class="whatsappQueue-dialog" aria-label="New WhatsappQueue">\n  <form name="whatsappQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.whatsappQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newWhatsappQueue">\n\n        <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n        <div ng-messages="whatsappQueueForm[\'name\'].$error" ng-show="whatsappQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.whatsappQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="whatsappQueueForm[\'strategy\'].$error" ng-show="whatsappQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.whatsappQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="whatsappQueueForm[\'timeout\'].$error" ng-show="whatsappQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.whatsappQueue.description">\n\n        <div ng-messages="whatsappQueueForm[\'description\'].$error" ng-show="whatsappQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappQueue" ng-click="vm.saveWhatsappQueue()" class="send-button md-accent md-raised" ng-disabled="whatsappQueueForm.$invalid || whatsappQueueForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappQueue" ng-click="vm.addNewWhatsappQueue()" class="send-button md-accent md-raised" ng-disabled="whatsappQueueForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPQUEUE" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">\n          ADD WHATSAPPQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappQueue" ng-click="vm.deleteWhatsappQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",'<md-dialog class="whatsappQueue-dialog" aria-label="whatsappQueue" ng-init="vm.onInit()">\n  <form name="whatsappQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">Add Agent to whatsappQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",'<md-dialog class="whatsappQueue-dialog" aria-label="whatsappQueue" ng-init="vm.onInit()">\n  <form name="whatsappQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="WHATSAPP.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/view.html",'<div id="whatsapp-whatsappQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-whatsappQueues-button md-icon-button" aria-label="Go to whatsappQueues" ng-click="vm.gotoWhatsappQueues()" translate translate-attr-aria-label="WHATSAPP.GO_TO_WHATSAPPQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="whatsappQueue-image" hide-xs>\n          <img ng-src="assets/images/business/whatsappQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.whatsappQueue.id}}\n            <span ng-if="vm.whatsappQueue.name">{{vm.whatsappQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="WHATSAPP.CREATED_AT"></span> <span>{{vm.whatsappQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.whatsappQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.whatsappQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveWhatsappQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.whatsappQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.whatsappQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.whatsappQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.whatsappQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/whatsappQueues.html",'<div id="whatsappQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="WHATSAPP.WHATSAPPQUEUES">WhatsappQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="WHATSAPP.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedWhatsappQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedWhatsappQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="WHATSAPP.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-whatsappQueues-count">\n          <span>{{vm.selectedWhatsappQueues.length}}</span>\n          <span translate="WHATSAPP.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllWhatsappQueues()" translate="WHATSAPP.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectWhatsappQueues()" translate="WHATSAPP.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappQueues" csv-label="true" filename="whatsappQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedWhatsappQueues($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- WHATSAPPQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedWhatsappQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'WHATSAPP.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.whatsappQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="whatsappQueue" md-select-id="id" ng-repeat="whatsappQueue in vm.whatsappQueues.rows">\n                <td md-cell ng-if="whatsappQueue.userpic"><img class="avatar" alt="{{whatsappQueue.name}}" ng-src="api/users/{{whatsappQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!whatsappQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{whatsappQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="id ">{{whatsappQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="name ">{{whatsappQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="strategy ">{{ vm.arraystrategy[whatsappQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(whatsappQueue, $event    )" translate="WHATSAPP.EDIT_WHATSAPPQUEUE">\n                          Edit WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(whatsappQueue, $event    )" translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE">\n                          teamadd WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(whatsappQueue, $event    )" translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">\n                          agentadd WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(whatsappQueue, $event    )" translate="WHATSAPP.DELETE_WHATSAPPQUEUE">\n                          Delete WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(whatsappQueue, $event    )" translate="WHATSAPP.GOTOREALTIME_WHATSAPPQUEUE">\n                          goToRealtime WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappQueues.count}}" md-on-paginate="vm.getWhatsappQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / WHATSAPPQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD WHATSAPPQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-whatsappQueue-button" ng-click="vm.createOrEditWhatsappQueue($event)" aria-label="add whatsappQueue" translate translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD WHATSAPPQUEUE BUTTON --\x3e\n</div>'),e.put("app/navigation/layouts/horizontal-navigation/navigation.html",'<div layout="row" layout-align="start center">\n  <ms-navigation-horizontal></ms-navigation-horizontal>\n</div>'),e.put("app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html",'<ms-navigation class="scrollable" folded="vm.folded"></ms-navigation>'),e.put("app/navigation/layouts/vertical-navigation/navigation.html",'<md-toolbar class="navigation-header md-whiteframe-1dp" layout="row" layout-align="space-between center">\n  <div class="logo" layout="row" layout-align="start center">\n    <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n    \x3c!-- <span class="logo-image"><img src="assets/images/logos/whisker_32x32.png" alt="motion_whisker_32x32" /></span> --\x3e\n    <span class="logo-text text-truncate">{{vm.getLogo() | uppercase}}</span>\n  </div>\n  <md-icon class="fold-toggle s18" md-font-icon="icon-backburger" hide show-gt-sm ng-click="vm.toggleMsNavigationFolded()"></md-icon>\n</md-toolbar>\n\n<ms-navigation class="scrollable" folded="vm.folded"></ms-navigation>'),e.put("app/quick-panel/quick-panel.html",'<md-content>\n  <md-tabs md-no-pagination md-swipe-content md-stretch-tabs="always">\n    <md-tab>\n      <md-tab-label>\n        <span translate="QUICKPANEL.TODAY">TODAY</span>\n      </md-tab-label>\n      <md-tab-body>\n        <md-content class="today-tab scrollable" ng-include="\'app/quick-panel/tabs/today/today-tab.html\'"></md-content>\n      </md-tab-body>\n    </md-tab>\n    <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'" ng-controller="ChatInternalController as vm_ct" ng-init="vm_ct.init(vm.license)" md-on-deselect="vm_ct.user = undefined">\n      <md-tab-label>\n        <div ng-if="vm.unreadTotalMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalMessages}}</div>\n        <span>MESSENGER</span>\n      </md-tab-label>\n      <md-tab-body>\n        <md-content class="chat-tab scrollable" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'"></md-content>\n      </md-tab-body>\n    </md-tab>\n    <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'" ng-controller="ChatGroupController as vm_cg" ng-init="vm_cg.init(vm.license)" md-on-deselect="vm_cg.group = undefined">\n      <md-tab-label>\n        <div ng-if="vm.unreadTotalGroupMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalGroupMessages}}</div>\n        <span translate="QUICKPANEL.GROUPS">GROUPS</span>\n      </md-tab-label>\n      <md-tab-body>\n        <md-content class="group-tab scrollable" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'"></md-content>\n      </md-tab-body>\n    </md-tab>\n  </md-tabs>\n</md-content>'),e.put("app/quick-panel/tabs/activity/activity-tab.html",'<md-list class="friends">\n  <md-subheader class="md-no-sticky">\n    <span translate="QUICKPANEL.FRIENDS">Friends</span>\n  </md-subheader>\n\n  <md-list-item class="friend md-3-line" ng-repeat="friend in vm.activities.friends">\n    <img ng-src="{{friend.avatar}}" class="md-avatar" alt="{{friend.name}}" />\n\n    <div class="status {{friend.status}}"></div>\n\n    <div ng-if="contact.unread" class="md-accent-bg unread-message-count">{{contact.unread}}</div>\n\n    <div class="md-list-item-text">\n      <h3 class="message">{{friend.message}}</h3>\n      <p class="time">{{friend.time}}</p>\n    </div>\n  </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="servers">\n  <md-subheader class="md-no-sticky">\n    <span translate="QUICKPANEL.APP_SERVERS">Application Servers</span>\n  </md-subheader>\n\n  <md-list-item class="server md-3-line" ng-repeat="server in vm.activities.servers">\n    <md-icon md-font-icon="icon-checkbox-blank-circle" class="s16 status" ng-class="server.status"></md-icon>\n\n    <div class="md-list-item-text">\n      <h3>{{server.location}}</h3>\n      <p>{{server.detail}}</p>\n    </div>\n  </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="stats">\n  <md-subheader class="md-no-sticky">\n    <span translate="QUICKPANEL.USER_STATS">User Stats</span>\n  </md-subheader>\n\n  <md-list-item class="stat md-2-line" ng-repeat="stat in vm.activities.stats">\n    <div class="md-list-item-text">\n      <span>{{stat.title}} ({{stat.current}} / {{stat.total}})</span>\n      <md-progress-linear ng-class="stat.status" md-mode="determinate" value="{{stat.percent}}"></md-progress-linear>\n    </div>\n  </md-list-item>\n</md-list>'),e.put("app/quick-panel/tabs/chat/chat-tab.html",'<div class="main" ng-hide="vm_ct.user">\n  <md-subheader class="md-no-sticky">\n    <div class="search" layout="row" layout-align="space-between center">\n      <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n      <input class="search-input" ng-model="vm_ct.search.$" type="text" placeholder="Search by fullname.." translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n      <md-select ng-model="vm_ct.search.online" class="height-50 no-padding no-margin" aria-label="Chat Tab Search">\n        <md-option ng-value="undefined">All</md-option>\n        <md-option ng-value="true">\n          <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online\n        </md-option>\n        <md-option ng-value="false">\n          <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline\n        </md-option>\n      </md-select>\n    </div>\n  </md-subheader>\n  \x3c!-- <select ng-model="vm_ct.filterOnline" class="height-50 no-padding no-margin">\n            <option ng-value="undefined">All</option>\n            <option ng-value="true"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online</option>\n            <option ng-value="false"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline</option>\n        </select> --\x3e\n  <md-divider></md-divider>\n  <md-list class="recent">\n    <md-list-item class="contact md-3-line" ng-if="user.id != vm_ct.currentUser.id" ng-repeat="user in vm_ct.users.rows | orderBy: \'-lastMessageAt\' | filter:vm_ct.search" ng-click="vm_ct.toggleChat(user)">\n      <md-divider></md-divider>\n      <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="md-avatar" alt="{{user.fullname}}" />\n      <div class="status" ng-class="{true: \'online\', false: \'offline\'}[user.online]"></div>\n      <div ng-if="vm_ct.unreadMessage[user.id]" class="md-accent-bg unread-message-count">\n        {{vm_ct.unreadMessage[user.id]}}</div>\n      <div class="md-list-item-text">\n        <div layout="row">\n          <h3>{{user.fullname}}</h3>\n          <md-icon ng-if="!user.allowmessenger && user.role === \'agent\'" class="s16 margin-left-5" ng-style="{\'color\': \'red\' }" md-font-icon="icon-block-helper"></md-icon>\n        </div>\n        <p>{{user.name}} &#60;{{user.internal}}&#62;</p>\n        <div layout="row" layout-align="start center">\n          <md-icon ng-if="!user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check"></md-icon>\n          <md-icon ng-if="user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check-all md-accent"></md-icon>\n          <p>{{user.lastMessage.body | limitTo:20 }}{{user.lastMessage.body.length > 20 ? \'...\' : \'\' }}</p>\n          <span flex></span>\n          <p class="last-message" ng-if="user.lastMessageAt != vm_ct.standardDate">\n            {{user.lastMessageAt | formatdate}}</p>\n        </div>\n      </div>\n    </md-list-item>\n  </md-list>\n</div>\n\n<div class="chat" ng-show="vm_ct.user" layout="column">\n  <md-toolbar class="md-accent">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n      <div layout="row" layout-align="start center">\n        <md-button class="md-icon-button" ng-click="vm_ct.toggleChat()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n          <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n        </md-button>\n        <h4>\n          <span>{{vm_ct.user.fullname}}</span>\n        </h4>\n      </div>\n\n      <div layout="row" layout-align="end center">\n        <md-button ng-if="vm_ct.license.webrtc && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 2 && vm_ct.user.role === \'agent\'" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_ct.webcall(vm_ct.user.name)">\n          <md-icon md-font-icon="icon-phone"></md-icon>\n        </md-button>\n        <md-menu ng-if="vm_ct.currentUser.phoneBarRemoteControl && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 0 && vm_ct.user.role === \'agent\'">\n          <md-button class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="$mdOpenMenu($event)">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n          </md-button>\n\n          <md-menu-content width="3">\n            <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n              <md-button ng-click="vm_ct.call(vm_ct.user.name)">\n                {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{vm_ct.user.name}})\n              </md-button>\n            </md-menu-item>\n            <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n              <md-button ng-click="vm_ct.transfer(vm_ct.user.name)">\n                {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{vm_ct.user.name}})\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n    </div>\n\n  </md-toolbar>\n  <md-content flex layout-paddings id="chat-dialog">\n    <div layout="row" ng-repeat="message in vm_ct.user.messages.rows" class="md-padding message-row" ng-class="message.FromId === vm_ct.currentUser.id ? \'user\' : \'contact\'">\n      <img ng-if="message.FromId === vm_ct.user.id" ng-src="{{vm_ct.user.userpic ? \'api/users/\' + vm_ct.user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{vm_ct.user.fullname}}" />\n      <img ng-if="message.FromId === vm_ct.currentUser.id" class="avatar" ng-src="{{vm_ct.currentUser.userpic ? \'api/users/\' + vm_ct.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n      <div class="bubble" flex>\n        <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n        <div layout="row" layout-align="end center">\n          <span class="time secondary-text">{{message.createdAt | formatdate }}</span>\n          <md-icon ng-if="!message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check"></md-icon>\n          <md-icon ng-if="message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check-all md-accent"></md-icon>\n        </div>\n      </div>\n    </div>\n  </md-content>\n\n  <form ng-submit="vm_ct.reply()" layout="row" class="reply" layout-align="start center">\n    <textarea ng-keyup="$event.keyCode == 13 && !vm_ct.disabled? vm_ct.reply() : null" flex ng-model="vm_ct.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n    <md-button ng-disable="vm_ct.disabled" class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n      <md-icon md-font-icon="icon-send"></md-icon>\n    </md-button>\n  </form>\n</div>'),e.put("app/quick-panel/tabs/groups/create/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n  <form name="groupForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      \x3c!--START Error--\x3e\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      \x3c!--END Error--\x3e\n\n      \x3c!--START NAME--\x3e\n      <md-input-container class="md-block">\n        <label translate="QUICKPANEL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.group.name" required autofocus>\n        <div ng-messages="groupForm[\'name\'].$error" ng-show="groupForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="QUICKPANEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="QUICKPANEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      \x3c!--END NAME--\x3e\n\n      \x3c!--START Members--\x3e\n      <md-input-container class="md-block">\n        <label translate="QUICKPANEL.MEMBERS">Members</label>\n        <md-contact-chips ng-model="vm.group.members" md-contacts="vm.querySearch($query)" md-contact-name="name" md-contact-image="image" md-require-match="true" md-highlight-flags="i" placeholder="{{\'QUICKPANEL.MEMBERS\' | translate}}">\n        </md-contact-chips>\n        <div ng-messages="groupForm[\'strategy\'].$error" ng-show="groupForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="QUICKPANEL.ERRORS.MEMBERS_REQUIRED">Members field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      \x3c!--END Members--\x3e\n\n      \x3c!--START Writing--\x3e\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.group.write" aria-label="Write">\n          {{\'QUICKPANEL.ENABLE_WRITING\' | translate}}\n        </md-switch>\n      </md-input-container>\n      \x3c!--END Writing--\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.newChatGroup" ng-click="vm.saveChatGroup()" class="send-button md-accent md-raised" ng-disabled="groupForm.$invalid || groupForm.$pristine || (vm.group.members.length < 1)" aria-label="SAVE" translate="QUICKPANEL.SAVE" translate-attr-aria-label="QUICKPANEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/groups/group-tab.html",'<div class="main" ng-if="!vm_cg.group">\n  <md-subheader>\n    <div layout="row">\n      \x3c!-- START Search --\x3e\n      <div class="search" layout="row" layout-align="start center" flex>\n        <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n        <input ng-model="vm_cg.search" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n      </div>\n      \x3c!-- END Search --\x3e\n\n      \x3c!-- START New Group --\x3e\n      <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-icon-button" aria-label="New" ng-click="vm_cg.addGroup(null, $event)">\n        <md-icon md-font-icon="icon-account-multiple-plus" class="icon"></md-icon>\n      </md-button>\n      \x3c!-- END New Group --\x3e\n    </div>\n  </md-subheader>\n\n  <md-divider></md-divider>\n\n  \x3c!-- START Groups --\x3e\n  <md-list class="recent no-padding">\n    \x3c!-- START Group --\x3e\n    <md-list-item class="contact" ng-repeat="group in vm_cg.groupsToArray() | filter:vm_cg.search" ng-click="vm_cg.toggleChat(group)">\n      <img src="assets/images/avatars/group.png" class="md-avatar" alt="{{group.name}}" />\n      <div ng-if="group.unreadGroupMessages" class="md-accent-bg unread-message-count">{{group.unreadGroupMessages}}</div>\n      <div class="md-list-item-text">\n        <div layout="row">\n          <h3>{{group.name}}</h3>\n        </div>\n      </div>\n\n      <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-secondary md-icon-button" aria-label="Remove" ng-click="vm_cg.deleteGroup(group, $event)">\n        <md-icon md-font-icon="icon-delete" class="icon s18"></md-icon>\n      </md-button>\n\n      <md-divider ng-if="!$last"></md-divider>\n    </md-list-item>\n    <md-list-item>\n      <div ng-if="!vm_cg.groupsToArray().length" layout="row" layout-align="center center" flex>\n        <span>{{\'QUICKPANEL.NO_AVAILABLE_GROUPS\' | translate}}</span>\n      </div>\n    </md-list-item>\n    \x3c!-- END Group --\x3e\n  </md-list>\n  \x3c!-- END Groups --\x3e\n</div>\n\n<div class="chat" ng-if="vm_cg.group" layout="column">\n  <md-toolbar class="md-accent">\n    <div class="md-toolbar-tools " layout="row" layout-align="space-between center">\n      <md-button class="md-icon-button" ng-click="vm_cg.back()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK" flex="15">\n        <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n      </md-button>\n      <h4 flex layout-align="start center" style="max-height: 100%; overflow-y:auto;">\n        <span translate="QUICKPANEL.YOU" translate-values=\'{participants: vm_cg.participants}\'></span>\n      </h4>\n\n      <div layout="row" layout-align="end center">\n        <md-button ng-if="vm_cg.license.webrtc && vm_cg.currentUser.role === \'agent\' && vm_cg.currentUser.showWebBar === 2 && vm_cg.user.role === \'agent\' && vm_cg.user.showWebBar === 2" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_cg.webcall(vm_cg.user.name)">\n          <md-icon md-font-icon="icon-phone"></md-icon>\n        </md-button>\n      </div>\n    </div>\n\n  </md-toolbar>\n  <md-content flex layout-paddings id="chat-group-dialog">\n    <div layout="row" ng-repeat="message in vm_cg.group.messages" class="message-row" ng-class="message.FromId === vm_cg.currentUser.id ? \'user\' : \'contact\'">\n      <img ng-if="message.FromId !== vm_cg.currentUser.id" ng-src="{{\'api/users/\' + message.FromId + \'/avatar\'}}" class="avatar" alt="{{vm_cg.user.fullname}}" />\n      <img ng-if="message.FromId === vm_cg.currentUser.id" class="avatar" ng-src="{{vm_cg.currentUser.userpic ? \'api/users/\' + vm_cg.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n      <div class="bubble" flex>\n        <div ng-if="message.FromId !== vm_cg.currentUser.id">\n          <span style="font-size: 12px;">{{vm_cg.group.membersByKeys[message.FromId].fullname}}</span>\n        </div>\n        <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n        <div layout="row" layout-align="end center">\n          <span class="time secondary-text" style="margin-top: 0px;">{{message.createdAt | formatdate }}</span>\n          <md-icon ng-if="message.FromId === vm_cg.currentUser.id" class="s16 margin-5" style="cursor: pointer;" md-font-icon="icon-information-outline" ng-click="vm_cg.showMessageInfo($event, message)"></md-icon>\n        </div>\n      </div>\n    </div>\n  </md-content>\n\n  <form ng-if="(vm_cg.currentUser.role !== \'agent\') || vm_cg.group.write" ng-submit="vm_cg.reply()" layout="row" class="reply" layout-align="start center">\n    <textarea ng-keyup="$event.keyCode == 13 ? vm_cg.reply() : null" flex ng-model="vm_cg.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n    <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n      <md-icon md-font-icon="icon-send"></md-icon>\n    </md-button>\n  </form>\n</div>'),e.put("app/quick-panel/tabs/groups/info/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n  <form name="groupForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div ng-if="vm.data.messages[$index].FromId !== vm.data.messages[$index].ToId" ng-repeat="user in vm.data.users" layout-margin>\n        <div layout="row">\n          <div layout="row" layout-align="start center">\n            <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{user.fullname}}" />\n            <span>{{user.fullname}}</span>\n          </div>\n          <div layout="row" layout-align="end center" flex>\n            <md-icon class="s16 margin-5" md-font-icon="{{vm.data.messages[$index].read ? \'icon-check-all md-accent\' : \'icon-check\'}}"></md-icon>\n            <span class="time secondary-text">{{vm.data.messages[$index].updatedAt | formatdate }}</span>\n          </div>\n        </div>\n        <div>\n          <md-divider ng-if="!$last"></md-divider>\n        </div>\n      </div>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/today/today-tab.html",'<md-list class="date">\n  <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.TODAY">Today</span></md-subheader>\n  <md-list-item class="md-display-1 md-2-line">\n    <div class="secondary-text">\n      <div translate="QUICKPANEL.{{ (vm.date | date:\'EEEE\').toUpperCase() }}"></div>\n      <div layout="row" layout-align="start start">\n        <span> {{vm.date | date:\'d\'}}</span>\n        <span class="md-subhead">th</span>\n        <span translate="QUICKPANEL.{{ (vm.date | date:\'MMMM\').toUpperCase() }}"></span>\n      </div>\n    </div>\n  </md-list-item>\n</md-list>\n\n\x3c!-- <md-divider></md-divider>\n\n<md-list>\n    <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.EVENTS">Events</span></md-subheader>\n\n    <md-list-item class="md-2-line" ng-repeat="event in vm.events" ng-click="dummyFunction()">\n        <div class="md-list-item-text">\n            <h3>{{event.title}}</h3>\n\n            <p>{{event.detail}}</p>\n        </div>\n    </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n    <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.NOTES">Notes</span></md-subheader>\n    <md-list-item class="md-2-line" ng-repeat="note in vm.notes" ng-click="dummyFunction()">\n        <div class="md-list-item-text">\n            <h3>{{note.title}}</h3>\n\n            <p>{{note.detail}}</p>\n        </div>\n    </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n    <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.QUICK_SETTINGS">Quick Settings</span></md-subheader>\n\n    <md-list-item>\n        <h3 translate="QUICKPANEL.NOTIFICATIONS">Notifications</h3>\n        <md-switch class="md-secondary" ng-model="vm.settings.notify" aria-label="Notifications" translate\n                   translate-attr-aria-label="QUICKPANEL.NOTIFICATIONS"></md-switch>\n    </md-list-item>\n\n    <md-list-item>\n        <h3 translate="QUICKPANEL.CLOUD_SYNC">Cloud Sync</h3>\n        <md-switch class="md-secondary" ng-model="vm.settings.cloud" aria-label="Cloud Sync" translate\n                   translate-attr-aria-label="QUICKPANEL.CLOUD_SYNC"></md-switch>\n    </md-list-item>\n\n    <md-list-item>\n        <h3 translate="QUICKPANEL.RETRO_THRUSTERS">Retro Thrusters</h3>\n        <md-switch class="md-secondary md-warn" ng-model="vm.settings.retro" aria-label="Retro Thrusters" translate\n                   translate-attr-aria-label="QUICKPANEL.RETRO_THRUSTERS"></md-switch>\n    </md-list-item>\n</md-list> --\x3e'),e.put("app/reset/reset.html",'<div id="reset-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()">\n  <div id="reset-password-form-wrapper" layout="column" layout-align="center center">\n    <div id="reset-password-form" class="md-whiteframe-8dp">\n\n      <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n      <div class="title" translate="RESETPASSWORD.TITLE">Reset your password</div>\n\n      <form name="resetPasswordForm" novalidate>\n\n        <md-input-container class="md-block" md-no-float>\n          <input type="password" name="password" ng-model="vm.form.password" ng-pattern="vm.passwordPattern" placeholder="Password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD" required>\n          <div ng-messages="resetPasswordForm.password.$error" role="alert">\n            <div ng-message="required">\n              <span translate="RESETPASSWORD.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n            </div>\n            <div ng-message="pattern">\n              <span translate="RESETPASSWORD.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block" md-no-float>\n          <input type="password" name="passwordConfirm" ng-model="vm.form.passwordConfirm" placeholder="Password (Confirm)" match-password="password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD_CONFIRM">\n          <div ng-messages="resetPasswordForm.passwordConfirm.$error" role="alert">\n            <div ng-message="passwordMatch">\n              <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-button type="button" ng-click="vm.resetPassword()" class="md-raised md-accent submit-button" aria-label="UPDATE MY PASSWORD" ng-disabled="resetPasswordForm.$invalid || resetPasswordForm.$pristine" translate="RESETPASSWORD.UPDATE_PASSWORD" translate-attr-aria-label="RESETPASSWORD.UPDATE_PASSWORD">\n          RESET MY PASSWORD\n        </md-button>\n      </form>\n    </div>\n  </div>\n</div>'),e.put("app/toolbar/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n  <form name="changePasswordForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span ng-if="vm.reset" class="title" translate="TOOLBAR.RESETPASSWORD">Reset Password</span>\n        <span ng-if="!vm.reset" class="title" translate="TOOLBAR.CHANGEPASSWORD">Change Password</span>\n        <md-button ng-if="!vm.reset" class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLBAR.OLD_PASSWORD">Old Password</label>\n        <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="TOOLBAR.OLD_PASSWORD" required>\n        <div ng-messages="changePasswordForm.oldPassword.$error" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLBAR.NEW_PASSWORD">New Password</label>\n        <input type="password" name="password" ng-model="vm.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="TOOLBAR.NEW_PASSWORD" required>\n        <div ng-messages="changePasswordForm.password.$error" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="TOOLBAR.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n          <div ng-message="oldPasswordMatch">\n            <span translate="TOOLBAR.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLBAR.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n        <div ng-messages="changePasswordForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="TOOLBAR.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="changePasswordForm.$invalid || changePasswordForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/toolbar/layouts/vertical-navigation/toolbar.html",'<div layout="row" layout-align="start center">\n  <div layout="row" layout-align="start center" flex>\n    <md-button id="navigation-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'navigation\')" hide-gt-sm aria-label="Toggle navigation" translate translate-attr-aria-label="TOOLBAR.TOGGLE_NAVIGATION">\n      <md-icon md-font-icon="icon-menu" class="icon"></md-icon>\n    </md-button>\n\n    <ms-shortcuts ng-if="!vm.isAgent()"></ms-shortcuts>\n\n    <div class="toolbar-separator"></div>\n\n    <div ng-if="vm.license.demo" class="blink md-padding">\n      <span class="md-warn-fg" translate="TOOLBAR.TRIAL_VERSION">Trial Version</span>\n    </div>\n\n    <div ng-if="vm.isAgent()" class="logo" layout-padding-left-8 layout="row" layout-align="start center">\n      <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n      <span ng-show="vm.isAgent() && (vm.user.showWebBar != 2)" class="logo-text text-truncate">{{ vm.getLogo() |\n        uppercase }}</span>\n    </div>\n\n    \x3c!-- phonebar directive WebRtc type--\x3e\n    <ms-phonebar class="ms-phonebar" ng-if="vm.isAgent() && (vm.user.showWebBar == 2)" conf="vm.conf" sessions="vm.webRTCSessions" flex></ms-phonebar>\n    \x3c!-- phonebar directive --\x3e\n  </div>\n\n  <div layout="row" layout-align="start center">\n\n    <md-progress-circular id="toolbar-progress" ng-if="$root.loadingProgress" class="md-accent" md-diameter="32">\n    </md-progress-circular>\n\n    \x3c!-- Pause Management --\x3e\n    <div ng-if="vm.isAgent() && (vm.user.showWebBar != 0)" layout="row" layout-align="end center">\n      <div class="toolbar-separator"></div>\n\n      <div class="border brad-5" layout="row" layout-align="center center" layout-margin>\n        <md-button ng-if="vm.user.voicePause" class="md-icon-button no-margin" ng-click="vm.unpause()">\n          <md-icon md-font-icon="icon-play-circle-outline" class="icon s24"></md-icon>\n          <md-tooltip md-direction="bottom">{{\'TOOLBAR.RESUME\' | translate}}</md-tooltip>\n        </md-button>\n\n        <md-button ng-disabled="vm.user.voicePause && \'DEFAULT PAUSE\' === vm.user.pauseType" class="md-icon-button no-margin" ng-click="vm.pause()">\n          <md-icon md-font-icon="icon-pause-circle-outline" class="icon s24"></md-icon>\n          <md-tooltip md-direction="bottom">{{\'TOOLBAR.PAUSE\' | translate}}</md-tooltip>\n        </md-button>\n\n        <md-menu>\n          <md-button aria-label="Pauses" class="md-icon-button no-margin" ng-click="$mdOpenMenu($event)">\n            <md-icon md-menu-origin md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-menu-content width="4">\n            <md-menu-item ng-if="!vm.pauses.length">\n              <md-button disabled="disabled">\n                <md-icon md-font-icon="icon-pause-octagon" md-menu-align-target></md-icon>\n                {{\'TOOLBAR.NO_PAUSES_AVAILABLE\' | translate}}\n              </md-button>\n            </md-menu-item>\n            <md-menu-item ng-repeat="pause in vm.pauses">\n              <md-button ng-disabled="vm.user.voicePause && pause.name === vm.user.pauseType" ng-click="vm.pause(pause.name)">\n                <md-icon md-font-icon="icon-pause-circle" md-menu-align-target></md-icon>\n                {{pause.name}}\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n    </div>\n    \x3c!-- Pause Management --\x3e\n\n    <div class="h5 padding-10" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)">\n      <div layout="row" layout-align="space-between center">\n        <timer ng-if="vm.user.lastLoginAt" start-time="vm.user.lastLoginAt"></timer>\n        <md-tooltip>{{\'TOOLBAR.LOGIN_TIME\' | translate}}</md-tooltip>\n        <md-icon md-font-icon="icon-timelapse" class="icon s16"></md-icon>\n      </div>\n      <div layout="row" layout-align="center center" ng-if="vm.user.voicePause">\n        <timer start-time="vm.user.lastPauseAt"></timer>\n        <md-tooltip>{{\'TOOLBAR.PAUSE_TIME\' | translate}}</md-tooltip>\n        <md-icon md-font-icon="icon-coffee" class="icon s16"></md-icon>\n      </div>\n      <div ng-if="vm.user.voicePause">\n        <span class="blink red-fg">{{vm.user.pauseType || \'default\' | uppercase}}</span>\n      </div>\n    </div>\n\n    <div class="toolbar-separator" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)"></div>\n\n    <md-menu-bar id="user-menu">\n      <md-menu md-position-mode="left bottom">\n        <md-button class="user-button" ng-click="$mdOpenMenu()" aria-label="User settings" translate translate-attr-aria-label="TOOLBAR.USER_SETTINGS">\n          <div layout="row" layout-align="space-between center">\n            <div class="avatar-wrapper">\n              <img md-menu-align-target class="avatar" src="assets/images/avatars/profile.png" ng-if="!vm.user.userpic">\n              <img md-menu-align-target class="avatar" ng-src="api/users/{{vm.user.id}}/avatar" ng-if="vm.user.userpic">\n              <md-icon md-font-icon ng-class="vm.userStatus.icon" ng-style="{\'color\': vm.userStatus.color }" class="icon status s16"></md-icon>\n            </div>\n            <div layout="column" layout-align="center center" class="padding-horizontal-5">\n              <span class="font-size-14 md-subhead">{{vm.user.fullname}}</span>\n              <span class="font-size-12 md-subhead">{{vm.user.name}} &#60;{{vm.user.internal}}&#62;</span>\n            </div>\n\n            <md-icon md-font-icon="icon-chevron-down" class="icon s16" hide-xs></md-icon>\n          </div>\n        </md-button>\n\n        <md-menu-content width="3">\n          <md-menu-item ng-if="vm.user.showWebBar == 2 && vm.user.phoneBarEnableSettings" class="md-indent">\n            <md-icon md-font-icon="icon-cog" class="icon"></md-icon>\n            <md-button ng-click="vm.openSettings($event)" ng-disabled="!vm.license.webrtc"><span translate="TOOLBAR.SETTINGS">SETTINGS</span></md-button>\n          </md-menu-item>\n\n          <md-menu-item class="md-indent">\n            <md-icon md-font-icon="icon-key-variant" class="icon"></md-icon>\n            <md-button ng-click="vm.changePassword($event)"><span translate="TOOLBAR.CHANGEPASSWORD">Change\n                Password</span></md-button>\n          </md-menu-item>\n\n          <md-menu-divider></md-menu-divider>\n\n          <md-menu-item class="md-indent">\n            <md-icon md-font-icon="icon-logout" class="icon"></md-icon>\n            <md-button ng-click="vm.logout()">Logout</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </md-menu-bar>\n\n    <div class="toolbar-separator"></div>\n\n    <md-button ng-if="vm.user.role === \'agent\' && vm.license.dialer" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.preview($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n      <div ng-if="vm.contacts" class="md-accent-bg open-contact-count">{{vm.contacts > 99 ? \'99+\' : vm.contacts}}</div>\n      <md-icon md-font-icon="icon-fire" class="icon red-900-fg"></md-icon>\n      <md-tooltip><span translate="TOOLBAR.PREVIEW">Preview</span></md-tooltip>\n    </md-button>\n\n    <ms-search-bar ng-if="vm.user.role !== \'agent\'" on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300" collapse-on-blur="true"></ms-search-bar>\n\n    <md-menu id="language-menu" md-offset="0 72" md-position-mode="target-right target" layout="column" layout-align="center center">\n      <md-button class="md-icon-button no-margin" ng-click="$mdOpenMenu()" aria-label="Language" md-menu-origin md-menu-align-target>\n        <div layout="row" layout-align="center center">\n          <img class="flag" ng-src="assets/images/flags/{{vm.selectedLanguage.flag}}.png">\n        </div>\n      </md-button>\n\n      <md-menu-content width="3" id="language-menu-content">\n        <md-menu-item ng-repeat="(iso, lang) in vm.languages">\n          <md-button ng-click="vm.changeLanguage(lang)" aria-label="{{lang.title}}" translate translate-attr-aria-label="{{lang.title}}">\n            <span layout="row" layout-align="start center">\n              <img class="flag flag-24" ng-src="assets/images/flags/{{lang.flag}}.png">\n              <span>{{ lang.translation | translate | startcase }}</span>\n            </span>\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n\n    <div class="toolbar-separator"></div>\n\n    <md-button ng-if="vm.license.gray && vm.user.role !== \'agent\'" class="md-icon-button" ui-sref="app.settings.license" aria-label="Toggle quick panel">\n      <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n    </md-button>\n    <md-button ng-if="vm.license.gray && vm.user.role === \'agent\'" class="md-icon-button" aria-label="Toggle quick panel">\n      <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n    </md-button>\n\n    <div ng-if="vm.license.gray" class="toolbar-separator"></div>\n\n    <md-button id="quick-panel-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'quick-panel\')" aria-label="Toggle quick panel" translate translate-attr-aria-label="TOOLBAR.TOGGLE_QUICK_PANEL">\n      <div ng-if="(vm.unreadTotalMessages + vm.unreadTotalGroupMessages)" class="md-accent-bg unread-message-count">\n        {{vm.unreadTotalMessages + vm.unreadTotalGroupMessages}}</div>\n      <md-icon md-font-icon="icon-format-list-bulleted" class="icon"></md-icon>\n    </md-button>\n  </div>\n</div>'),e.put("app/toolbar/preview/dialog.html",'<md-dialog class="preview-dialog" aria-label="preview">\n  <form name="previewForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ (\'TOOLBAR.PREVIEW\' | translate) + (vm.preview.recallme ? \' - \' +\n          (\'CONTACTMANAGER.RECALLME\' | translate | uppercase) : \'\') }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div ng-if="vm.preview">\n        <div ng-if="vm.preview.recallme" layout="row" class="recall-me-info">\n          <md-icon md-font-icon="icon-information-outline" aria-label="Recall Me"></md-icon>\n          <p class="ml-5" translate="TOOLBAR.HELP.PREVIEW_RECALLME" translate-values="{ date: (vm.preview.scheduledat | date:\'short\') }" flex></p>\n        </div>\n        <div layout="row">\n          <div class="md-padding md-margin" layout="column" flex="30">\n            <md-input-container ng-if="vm.preview.Contact.id" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.ID">ID</label>\n              <input type="text" ng-model="vm.preview.Contact.id" disabled="true">\n            </md-input-container>\n            <md-input-container ng-if="vm.preview.Queue.name" class="md-block no-margin">\n              <label translate="VOICE.QUEUE">Queue</label>\n              <input type="text" ng-model="vm.preview.Queue.name" disabled="true">\n            </md-input-container>\n            <md-input-container ng-if="vm.preview.List.name" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.LIST">List</label>\n              <input type="text" ng-model="vm.preview.List.name" disabled="true">\n            </md-input-container>\n            <md-input-container ng-if="vm.preview.Contact.tags && vm.preview.Contact.tags.length" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.TAGS">Tags</label>\n              <input type="text" ng-model="vm.preview.Contact.tags" disabled="true">\n            </md-input-container>\n            <md-input-container ng-if="vm.preview.Contact.Company && vm.preview.Contact.Company.name" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.COMPANY">Company</label>\n              <input type="text" ng-model="vm.preview.Contact.Company.name" disabled="true">\n            </md-input-container>\n          </div>\n          <md-divider></md-divider>\n          <div class="md-padding md-margin" layout="column" flex="35">\n            <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && !vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n              <label>{{ \'CONTACTMANAGER.\' + key.toUpperCase() | translate}}</label>\n              <input type="text" ng-model="value" disabled="true">\n            </md-input-container>\n          </div>\n          <div class="md-padding md-margin" layout="column" flex="35">\n            <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n              <label>{{ vm.customFieldsMap[key] || key }}</label>\n              <input type="text" ng-model="value" disabled="true">\n            </md-input-container>\n          </div>\n        </div>\n      </div>\n      <div layout="row" ng-if="!vm.preview">\n        <span>no contacts available</span>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n      <md-button class="md-icon-button md-primary" ng-hide="vm.hopperIds.length <= 1" ng-disabled="vm.disableGetContact" ng-click="vm.previousContact()" aria-label="PREVIOUSCONTACT" translate-attr-aria-label="TOOLS.PREVIOUSCONTACT">\n        <md-icon md-font-icon="icon-chevron-left"></md-icon>\n      </md-button>\n      <md-button class="md-fab green-bg" aria-label="CALL" translate-attr-aria-label="TOOLS.CALL" ng-disabled="vm.disable" ng-click="vm.originatePreview($event)">\n        <md-icon md-font-icon="icon-phone"></md-icon>\n      </md-button>\n      <md-button class="md-icon-button md-primary" ng-disabled="vm.disableGetContact" ng-click="vm.nextContact()" aria-label="NEXTCONTACT" translate-attr-aria-label="TOOLS.NEXTCONTACT">\n        <md-icon md-font-icon="icon-chevron-right"></md-icon>\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>')}]);
\ No newline at end of file
+!function(){"use strict";angular.module("app.auth",[])}(),function(){"use strict";angular.module("app.client-side-logging",[])}(),function(){"use strict";angular.module("app.core",["ngAnimate","ngAria","ngCookies","ngMessages","ngResource","ngSanitize","ngMaterial","pascalprecht.translate","ui.router","ui.router.state.events","gridster","ds.clock","angucomplete-alt"])}(),function(){"use strict";function e(e,n){e.state("app.errors_error-404",{url:"/errors/error-404",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-404":{templateUrl:"app/errors/404/error-404.html",controller:"Error404Controller as vm"}},params:{status:404,statusText:"",data:{},config:{}},bodyClass:"error-404"}),n.addPart("app/errors/404")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-404",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.errors_error-500",{url:"/errors/error-500",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-500":{templateUrl:"app/errors/500/error-500.html",controller:"Error500Controller as vm"}},params:{status:500,statusText:"",data:{},config:{}},bodyClass:"error-500"}),n.addPart("app/errors/500")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-500",[]).config(e)}(),function(){"use strict";angular.module("app.errors",["app.errors.error-404","app.errors.error-500"])}(),function(){"use strict";function e(e){e.addPart("app/footer")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.footer",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.forgot",{url:"/forgot",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.forgot":{templateUrl:"app/forgot/forgot.html",controller:"ForgotPasswordController as vm"}},bodyClass:"forgot"}),n.addPart("app/forgot")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.forgot",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/header")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.header",[]).config(e)}(),function(){"use strict";angular.module("motion",["angular-toasty","app.core","app.auth","app.navigation","app.toolbar","app.quick-panel","app.header","app.footer","app.realtime","app.dashboards","app.staff","app.contactmanager","app.voice","app.chat","app.mail","app.sms","app.openchannel","app.fax","app.tools","app.callysquare","app.analytics","app.integrations","app.settings","app.motiondialer","app.help","app.jscripty","app.marketplace","app.plugins","app.video","app.whatsapp","app.login","app.forgot","app.reset","app.errors","app.user-setting","app.client-side-logging"])}(),function(){"use strict";function e(e,n){e.state("app.login",{url:"/login?token&userId",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.login":{templateUrl:"app/login/login.html",controller:"LoginController as vm"}},bodyClass:"login"}),n.addPart("app/login")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.login",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.analytics",{abstract:!0,url:"/analytics"}).state("app.analytics.metrics",{url:"/metrics",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/metrics/metrics.html",controller:"MetricsController as vm"}},resolve:{metrics:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("analyticMetric@get",{fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Metrics",fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1201})}]},authenticate:!0,permissionId:1201,bodyClass:"analytics"}).state("app.analytics.extractedReports",{url:"/extractedReports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/extractedReports/extractedReports.html",controller:"ExtractedReportsController as vm"}},resolve:{extractedReports:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("analyticExtractedReport@get",{fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ExtractedReports",fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1202})}]},authenticate:!0,permissionId:1202,bodyClass:"analytics"}),n.addPart("app/main/apps/analytics")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.analytics",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.analytics.reports"]).config(e)}(),function(){"use strict";function e(e){e.state("app.analytics.reports",{url:"/reports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/reports.html",controller:"ReportsController as vm"}},resolve:{treeReports:["apiResolver",function(e){return e.resolve("analyticTreeReport@get",{fields:"id,tree",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"}).state("app.analytics.reports.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/edit/view.html",controller:"ReportController as vm"}},resolve:{report:["apiResolver","$stateParams","$q","describeTable",function(e,n,a,i){var s;return e.resolve("analyticCustomReport@get",{fields:"createdAt,updatedAt,id,name,description,table,conditions,joins",id:n.id}).then(function(e){var n=[];if((s=e).joins)try{s.joins=JSON.parse(s.joins);for(var t=0;t<s.joins.length;t+=1)n.push(i.getColumns(s.joins[t].foreignTable))}catch(e){console.log(e)}return a.all(n)}).then(function(e){for(var n=0;n<e.length;n+=1)s.joins[n].foreignTableFields=_.difference(_.keys(e[n]),["$promise","$resolved"]);return s})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"})}e.$inject=["$stateProvider"],angular.module("app.analytics.reports",["ngJsTree"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.callysquare",{abstract:!0,url:"/callysquare"}).state("app.callysquare.odbcs",{url:"/odbcs",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/odbcs/odbcs.html",controller:"OdbcsController as vm"}},resolve:{odbcs:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ODBC",fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1101})}]},authenticate:!0,permissionId:1101,bodyClass:"callysquare"}).state("app.callysquare.squareRecordings",{url:"/squareRecordings",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",controller:"SquareRecordingsController as vm"}},resolve:{squareRecordings:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareRecording@get",{fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareRecordings",fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadCallySquareRecordings",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1102})}]},authenticate:!0,permissionId:1102,bodyClass:"callysquare"}),n.addPart("app/main/apps/callysquare")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.callysquare",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.callysquare.projects"]).config(e)}(),function(){"use strict";function e(e){e.state("app.callysquare.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/projects.html",controller:"ProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"}).state("app.callysquare.projects.edit",{url:"/:id",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/edit/view.html",controller:"ProjectController as vm"}},params:{crudPermissions:void 0},resolve:{project:["apiResolver","$stateParams",function(e,n){return e.resolve("squareProject@get",{id:n.id})}],users:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Users",mergeResources:!0,fields:"id,fullname,role",sort:"name",nolimit:!0})}],trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",sort:"name",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",type:"inbound",fields:"id,name",sort:"name",nolimit:!0})}],sounds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("sound@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Sounds",fields:"id,name",sort:"name",nolimit:!0})}],variables:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("variable@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Variables",fields:"id,name",sort:"name",nolimit:!0})}],databases:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ODBC",fields:"id,name",sort:"name",nolimit:!0})}],projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name",sort:"name",nolimit:!0})}],contexts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceContext@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Contexts",fields:"id,name",sort:"name",nolimit:!0})}],intervals:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("interval@get",{fields:"id,name,IntervalId",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Intervals",fields:"id,name,IntervalId",sort:"name",nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"id,name",sort:"name",nolimit:!0})}],templates:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("template@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Templates",fields:"id,name",sort:"name",nolimit:!0})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"name",nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"id,name",sort:"name",nolimit:!0})}],pauses:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("pause@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Pauses",fields:"id,name",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"})}e.$inject=["$stateProvider"],angular.module("app.callysquare.projects",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.chat",{abstract:!0,url:"/chat"}).state("app.chat.chatQueues",{url:"/chatQueues",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/chatQueues.html",controller:"ChatQueuesController as vm"}},resolve:{chatQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatQueues.edit",{url:"/:id?tab",params:{chatQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/edit/view.html",controller:"ChatQueueController as vm"}},resolve:{chatQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatWebsites",{url:"/chatWebsites",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/chatWebsites.html",controller:"ChatWebsitesController as vm"}},resolve:{chatWebsites:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}).state("app.chat.chatWebsites.edit",{url:"/:id?tab",params:{chatWebsite:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/edit/view.html",controller:"ChatWebsiteController as vm"}},resolve:{chatWebsite:["apiResolver","$stateParams",function(e,n){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}),n.addPart("app/main/apps/chat")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.chat",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.chat.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.chat.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/chat/views/realtime/realtime.html",controller:"ChatRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:510})}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.agents",{url:"/agents",params:{channel:"chat"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.queues",{url:"/queues",controller:"QueuesChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"ChatQueues":void 0,channel:"chat",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:510})}e.$inject=["$stateProvider"],angular.module("app.chat.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.contactmanager",{abstract:!0,url:"/contactmanager"}).state("app.contactmanager.lists",{url:"/lists",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/lists.html",controller:"ListsController as vm"}},resolve:{lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadContactManagerLists",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.lists.edit",{url:"/:id?tab",params:{list:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/edit/view.html",controller:"ListController as vm"}},resolve:{list:["apiResolver","$stateParams",function(e,n){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.companies",{url:"/companies",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/companies.html",controller:"CompaniesController as vm"}},resolve:{companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies",fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.companies.edit",{url:"/:id?tab",params:{company:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/edit/view.html",controller:"CompanyController as vm"}},resolve:{company:["apiResolver","$stateParams",function(e,n){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.globalCustomFields",{url:"/globalCustomFields",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",controller:"GlobalCustomFieldsController as vm"}},resolve:{globalCustomFields:["apiResolver","Auth",function(e,n){return e.resolve("cmCustomField@get",{fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",sort:"-updatedAt",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:304})}]},authenticate:!0,permissionId:304,bodyClass:"contactmanager"}),n.addPart("app/main/apps/contactmanager")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.contactmanager",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.contactmanager.contacts"]).config(e)}(),function(){"use strict";function e(e){e.state("app.contactmanager.contacts",{url:"/contacts?ListId&CompanyId",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/contacts.html",controller:"ContactsController as vm"}},resolve:{contacts:["apiResolver","Auth","$stateParams",function(e,n,t){return n.hasRole("admin")?e.resolve("cmContact@get",_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0},t)):e.resolve("userProfile@getResources",_.merge({id:n.getCurrentUser().userProfileId,section:"Contacts",includeAll:!0,sort:"-updatedAt",limit:10,offset:0},t))}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],listsMap:["lists",function(e){for(var n={},t=0;t<e.rows.length;t++)n[e.rows[t].id]=e.rows[t].name;return n}],companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies",fields:"id,name",sort:"name",nolimit:!0})}],companiesMap:["companies",function(e){for(var n={},t=0;t<e.rows.length;t++)n[e.rows[t].id]=e.rows[t].name;return n}],tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags",fields:"id,name",sort:"name",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"}).state("app.contactmanager.contacts.edit",{url:"/:id?tab",params:{crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/edit/view.html",controller:"ContactController as vm"}},resolve:{contact:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@get",{id:n.id}).then(function(e){return e.dateOfBirth&&(e.dateOfBirth=new Date(e.dateOfBirth)),e}).catch(function(e){console.error(e)})}],hoppers:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHoppers",{id:n.id,fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,offset:0})}],finals:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHopperFinals",{id:n.id,fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,offset:0})}],histories:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHopperHistories",{id:n.id,fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,offset:0})}],jscriptySessions:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getJscriptySessions",{id:n.id,fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,offset:0})}],companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get"):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies"})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],customFields:["apiResolver","contact",function(e,n){return n.ListId?e.resolve("cmList@getCustomFields",{id:n.ListId}):null}],tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{sort:"name"}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"})}e.$inject=["$stateProvider"],angular.module("app.contactmanager.contacts",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.dashboards",{abstract:!0,url:"/dashboards"}),n.addPart("app/main/apps/dashboards")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.dashboards",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.dashboards.general","app.dashboards.custom"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.custom",{url:"/custom/:id",views:{"content@app":{templateUrl:"app/main/apps/dashboards/views/custom/custom.html",controller:"DashboardCustomController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("voiceQueue@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"VoiceQueues",mergeResources:!0,fields:"id,name",channel:"voice",nolimit:!0})).then(function(e){return t=e,n.resolve("rpc@getVoiceQueues",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)t&&t.id===e.rows[n].id?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged,a.abandoned+=e.rows[n].abandoned):(a=_.find(t.rows,{id:e.rows[n].id}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged","abandoned"]));return t})}],faxAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("faxAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"FaxAccounts",mergeResources:!0,fields:"id,name",channel:"fax",nolimit:!0})).then(function(e){return t=e,n.resolve("faxInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].FaxAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].FaxAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],chatWebsites:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("chatWebsite@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"ChatWebsites",mergeResources:!0,fields:"id,name",channel:"chat",nolimit:!0})).then(function(e){return t=e,n.resolve("chatInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].ChatWebsiteId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.abandoned+=e.rows[n].abandoned,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].ChatWebsiteId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","abandoned","unmanaged"]));return t})}],smsAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("smsAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"SmsAccounts",mergeResources:!0,fields:"id,name",channel:"sms",nolimit:!0})).then(function(e){return t=e,n.resolve("smsInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].SmsAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].SmsAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],openchannelAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("openchannelAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"OpenchannelAccounts",mergeResources:!0,fields:"id,name",channel:"openchannel",nolimit:!0})).then(function(e){return t=e,n.resolve("openchannelInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].OpenchannelAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].OpenchannelAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],mailAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("mailAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"MailAccounts",mergeResources:!0,fields:"id,name",channel:"mail",nolimit:!0})).then(function(e){return t=e,n.resolve("mailInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].MailAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].MailAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],whatsappAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("whatsappAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"WhatsappAccounts",mergeResources:!0,fields:"id,name",channel:"whatsapp",nolimit:!0})).then(function(e){return t=e,n.resolve("whatsappInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].WhatsappAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].WhatsappAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:100})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.custom",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general",{url:"/general",views:{"content@app":{templateProvider:["$stateParams","$templateFactory","Auth","$window",function(e,n,t,a){var i=t.getCurrentUser();return null===a.localStorage.getItem("motion2.user:"+i.id)&&a.localStorage.setItem("motion2.user:"+i.id,JSON.stringify({authenticationType:"google"})),t.isAgent()?n.fromUrl("app/main/apps/dashboards/views/general/agent/agent.general.html",e):n.fromUrl("app/main/apps/dashboards/views/general/user/user.general.html",e)}],controllerProvider:["Auth",function(e){return e.isAgent()?"AgentDashboardGeneralController as vm":"UserDashboardGeneralController as vm"}]}},resolve:{globalUserLists:["apiResolver","Auth",function(e,n){return e.resolve("user@getLists",{id:n.getCurrentUser().id,sort:"name",nolimit:!0})}],globalLists:["apiResolver",function(e){return e.resolve("cmList@get",{sort:"name",nolimit:!0})}],globalTags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0})}],globalCompanies:["apiResolver",function(e){return e.resolve("cmCompany@get",{sort:"name",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general",["ngMaterialDateRangePicker","app.dashboards.general.user"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general.voice",{url:"/voice",data:{selectedTab:0},views:{voice:{templateUrl:"app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",controller:"UserVoiceDashboardGeneralController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],inboundQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"id,name",type:"inbound",channel:"voice",nolimit:!0})}],outbound:["apiResolver",function(e){return e.resolve("rpc@getOutbound")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.dialer",{url:"/dialer",data:{selectedTab:1},views:{dialer:{templateUrl:"app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",controller:"UserVoiceDashboardDialerController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],outboundQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"id,name",type:"outbound",channel:"voice",nolimit:!0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.chat",{url:"/chat",data:{selectedTab:2},views:{chat:{templateUrl:"app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",controller:"UserChatDashboardGeneralController as vm"}},resolve:{chatInteractions:["apiResolver",function(e){return e.resolve("chatInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],chatWebsites:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.mail",{url:"/mail",data:{selectedTab:3},views:{mail:{templateUrl:"app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",controller:"UserMailDashboardGeneralController as vm"}},resolve:{mailInteractions:["apiResolver",function(e){return e.resolve("mailInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.sms",{url:"/sms",data:{selectedTab:4},views:{sms:{templateUrl:"app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",controller:"UserSmsDashboardGeneralController as vm"}},resolve:{smsInteractions:["apiResolver",function(e){return e.resolve("smsInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,applicationId,accountId,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,applicationId,accountId,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.openchannel",{url:"/openchannel",data:{selectedTab:5},views:{openchannel:{templateUrl:"app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",controller:"UserOpenchannelDashboardGeneralController as vm"}},resolve:{openchannelInteractions:["apiResolver",function(e){return e.resolve("openchannelInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],openchannelAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.fax",{url:"/fax",data:{selectedTab:6},views:{fax:{templateUrl:"app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",controller:"UserFaxDashboardGeneralController as vm"}},resolve:{faxInteractions:["apiResolver",function(e){return e.resolve("faxInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.whatsapp",{url:"/whatsapp",data:{selectedTab:7},views:{whatsapp:{templateUrl:"app/main/apps/dashboards/views/general/user/whatsapp/user.general.whatsapp.html",controller:"UserWhatsappDashboardGeneralController as vm"}},resolve:{whatsappInteractions:["apiResolver",function(e){return e.resolve("whatsappInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],whatsappAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,whatsappMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,whatsappMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general.user",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.fax",{abstract:!0,url:"/fax"}).state("app.fax.faxQueues",{url:"/faxQueues",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/faxQueues.html",controller:"FaxQueuesController as vm"}},resolve:{faxQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxQueues.edit",{url:"/:id?tab",params:{faxQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/edit/view.html",controller:"FaxQueueController as vm"}},resolve:{faxQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxAccounts",{url:"/faxAccounts",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/faxAccounts.html",controller:"FaxAccountsController as vm"}},resolve:{faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}).state("app.fax.faxAccounts.edit",{url:"/:id?tab",params:{faxAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/edit/view.html",controller:"FaxAccountController as vm"}},resolve:{faxAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}),n.addPart("app/main/apps/fax")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.fax",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.fax.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.fax.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/fax/views/realtime/realtime.html",controller:"FaxRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:910})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.agents",{url:"/agents",params:{channel:"fax"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.trunks",{url:"/trunks",controller:"TrunksFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.queues",{url:"/queues",controller:"QueuesFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"FaxQueues":void 0,channel:"fax",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.accounts",{url:"/accounts",controller:"FaxAccountsRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/accounts/view.html",resolve:{faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}],rpcFaxAccounts:["apiResolver",function(e){return e.resolve("rpc@getFaxAccounts")}]},authenticate:!0,permissionId:910})}e.$inject=["$stateProvider"],angular.module("app.fax.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.help",{abstract:!0,url:"/help"}),n.addPart("app/main/apps/help")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.help",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.help.about"]).config(e)}(),function(){"use strict";function e(e){e.state("app.help.about",{url:"/about",views:{"content@app":{templateUrl:"app/main/apps/help/views/about/about.html",controller:"AboutController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1600,bodyClass:"help"})}e.$inject=["$stateProvider"],angular.module("app.help.about",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.integrations",{abstract:!0,url:"/integrations"}).state("app.integrations.zendeskAccounts",{url:"/zendeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",controller:"ZendeskAccountsController as vm"}},resolve:{zendeskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ZendeskAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.zendeskAccounts.edit",{url:"/:id?tab",params:{zendeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/view.html",controller:"ZendeskAccountController as vm"}},resolve:{zendeskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts",{url:"/salesforceAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",controller:"SalesforceAccountsController as vm"}},resolve:{salesforceAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SalesforceAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts.edit",{url:"/:id?tab",params:{salesforceAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/view.html",controller:"SalesforceAccountController as vm"}},resolve:{salesforceAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts",{url:"/freshdeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",controller:"FreshdeskAccountsController as vm"}},resolve:{freshdeskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FreshdeskAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts.edit",{url:"/:id?tab",params:{freshdeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",controller:"FreshdeskAccountController as vm"}},resolve:{freshdeskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts",{url:"/sugarcrmAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",controller:"SugarcrmAccountsController as vm"}},resolve:{sugarcrmAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SugarcrmAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts.edit",{url:"/:id?tab",params:{sugarcrmAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",controller:"SugarcrmAccountController as vm"}},resolve:{sugarcrmAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.deskAccounts",{url:"/deskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/deskAccounts.html",controller:"DeskAccountsController as vm"}},resolve:{deskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"DeskAccounts",fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.deskAccounts.edit",{url:"/:id?tab",params:{deskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/view.html",controller:"DeskAccountController as vm"}},resolve:{deskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.zohoAccounts",{url:"/zohoAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",controller:"ZohoAccountsController as vm"}},resolve:{zohoAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ZohoAccounts",fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.zohoAccounts.edit",{url:"/:id?tab",params:{zohoAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/view.html",controller:"ZohoAccountController as vm"}},resolve:{zohoAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts",{url:"/vtigerAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",controller:"VtigerAccountsController as vm"}},resolve:{vtigerAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VtigerAccounts",fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts.edit",{url:"/:id?tab",params:{vtigerAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/view.html",controller:"VtigerAccountController as vm"}},resolve:{vtigerAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts",{url:"/dynamics365Accounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",controller:"Dynamics365AccountsController as vm"}},resolve:{dynamics365Accounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication,CloudProviderId",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dynamics365Accounts",fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",type:"Dynamics365",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts.edit",{url:"/:id?tab",params:{dynamics365Account:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",controller:"Dynamics365AccountController as vm"}},resolve:{dynamics365Account:["apiResolver","$stateParams",function(e,n){return e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication,CloudProviderId",id:n.id})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",type:"Dynamics365",limit:10,offset:0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts",{url:"/servicenowAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",controller:"ServicenowAccountsController as vm"}},resolve:{servicenowAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ServicenowAccounts",fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts.edit",{url:"/:id?tab",params:{servicenowAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/view.html",controller:"ServicenowAccountController as vm"}},resolve:{servicenowAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.freshsalesAccounts",{url:"/freshsalesAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/freshsalesAccounts.html",controller:"FreshsalesAccountsController as vm"}},resolve:{freshsalesAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intFreshsalesAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FreshsalesAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1304})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}).state("app.integrations.freshsalesAccounts.edit",{url:"/:id?tab",params:{freshsalesAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/view.html",controller:"FreshsalesAccountController as vm"}},resolve:{freshsalesAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intFreshsalesAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1304})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}),n.addPart("app/main/apps/integrations")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.integrations",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.jscripty",{abstract:!0,url:"/jscripty"}).state("app.jscripty.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/projects.html",controller:"JscriptyProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Projects",fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadJscriptySessions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}).state("app.jscripty.projects.edit",{url:"/:id?tab",params:{project:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/edit/view.html",controller:"JscriptyProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,n){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadJscriptySessions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}),n.addPart("app/main/apps/jscripty")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.jscripty",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.mail",{abstract:!0,url:"/mail"}).state("app.mail.mailQueues",{url:"/mailQueues",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/mailQueues.html",controller:"MailQueuesController as vm"}},resolve:{mailQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailQueues.edit",{url:"/:id?tab",params:{mailQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/edit/view.html",controller:"MailQueueController as vm"}},resolve:{mailQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailAccounts",{url:"/mailAccounts",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/mailAccounts.html",controller:"MailAccountsController as vm"}},resolve:{mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailAccounts.edit",{url:"/:id?tab",params:{mailAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/edit/view.html",controller:"MailAccountController as vm"}},resolve:{mailAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailSubtatuses",{url:"/mailSubtatuses",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",controller:"MailSubstatusesController as vm"}},resolve:{mailSubtatuses:["apiResolver",function(e){return e.resolve("mailSubstatus@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:603})}]},authenticate:!0,permissionId:603,bodyClass:"mail"}),n.addPart("app/main/apps/mail")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.mail",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.mail.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.mail.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/mail/views/realtime/realtime.html",controller:"MailRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:610})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.agents",{url:"/agents",params:{channel:"mail"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.queues",{url:"/queues",controller:"QueuesMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"MailQueues":void 0,channel:"mail",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.accounts",{url:"/accounts",controller:"MailAccountsRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/accounts/view.html",resolve:{mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}],rpcMailAccounts:["apiResolver",function(e){return e.resolve("rpc@getMailAccounts")}]},authenticate:!0,permissionId:610})}e.$inject=["$stateProvider"],angular.module("app.mail.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.marketplace",{abstract:!0,url:"/marketplace"}).state("app.marketplace.plugins",{url:"/plugins",views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/plugins.html",controller:"MarketplacePluginsController as vm"}},resolve:{plugins:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Plugins",fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}).state("app.marketplace.plugins.edit",{url:"/:id?tab",params:{plugin:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/edit/view.html",controller:"MarketplacePluginController as vm"}},resolve:{plugin:["apiResolver","$stateParams",function(e,n){return e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}),n.addPart("app/main/apps/marketplace")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.marketplace",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.motiondialer",{abstract:!0,url:"/motiondialer"}).state("app.motiondialer.queueCampaigns",{url:"/queueCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",controller:"QueueCampaignsController as vm"}},resolve:{queueCampaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe,dialPreviewRecallmeReminder",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.queueCampaigns.edit",{url:"/:id?tab",params:{queueCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",controller:"QueueCampaignController as vm"}},resolve:{queueCampaign:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe,dialPreviewRecallmeReminder",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns",{url:"/ivrCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",controller:"IvrCampaignsController as vm"}},resolve:{ivrCampaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"IvrCampaigns",fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns.edit",{url:"/:id?tab",params:{ivrCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",controller:"IvrCampaignController as vm"}},resolve:{ivrCampaign:["apiResolver","$stateParams",function(e,n){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}),n.addPart("app/main/apps/motiondialer")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.motiondialer",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.motiondialer.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.hopperdate",{url:"/hopperdate",views:{"hopperdate@app":{templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",controller:"HopperdateController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1500,bodyClass:"motiondialer"})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.hopperdate",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/realtime/realtime.html",controller:"MotionDialerRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1510})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.agents",{url:"/agents",params:{channel:"voice",direction:"outbound"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queues",{url:"/queues",controller:"QueuesMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"QueueCampaigns":void 0,channel:"voice",type:"outbound",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.ivr_campaigns",{url:"/ivr_campaigns",controller:"IvrCampaignsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",resolve:{campaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("campaign@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"IvrCampaigns",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,permissionId:1510})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.openchannel",{abstract:!0,url:"/openchannel"}).state("app.openchannel.openchannelQueues",{url:"/openchannelQueues",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",controller:"OpenchannelQueuesController as vm"}},resolve:{openchannelQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelQueues.edit",{url:"/:id?tab",params:{openchannelQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/view.html",controller:"OpenchannelQueueController as vm"}},resolve:{openchannelQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts",{url:"/openchannelAccounts",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",controller:"OpenchannelAccountsController as vm"}},resolve:{openchannelAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts.edit",{url:"/:id?tab",params:{openchannelAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",controller:"OpenchannelAccountController as vm"}},resolve:{openchannelAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}),n.addPart("app/main/apps/openchannel")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.openchannel",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.openchannel.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.openchannel.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/realtime/realtime.html",controller:"OpenchannelRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:810})}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.agents",{url:"/agents",params:{channel:"openchannel"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.queues",{url:"/queues",controller:"QueuesOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"OpenchannelQueues":void 0,channel:"openchannel",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:810})}e.$inject=["$stateProvider"],angular.module("app.openchannel.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.plugins",{abstract:!0,url:"/plugins"}),n.addPart("app/main/apps/plugins")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.plugins",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.plugins.plugin"]).config(e)}(),function(){"use strict";function e(e){e.state("app.plugins.plugin",{url:"/plugin/:id",views:{"content@app":{templateUrl:"app/main/apps/plugins/views/plugin/plugin.html",controller:"PluginController as vm"}},resolve:{},authenticate:!0,bodyClass:"plugins"})}e.$inject=["$stateProvider"],angular.module("app.plugins.plugin",[]).config(e)}(),function(){"use strict";angular.module("app.realtime",[])}(),function(){"use strict";function e(e,n){e.state("app.settings",{abstract:!0,url:"/settings"}).state("app.settings.generals",{url:"/generals",views:{"content@app":{templateUrl:"app/main/apps/settings/views/generals/generals.html",controller:"GeneralsController as vm"}},resolve:{generals:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,min_internal,securePassword,callRecordingEncryption,chatTimeout,phoneBarAutoUpdater,defaultScreenRecordingPath,phoneBarAutoUpdaterUrl,enableEmailPreview,split,splitSizeCsv,splitSizePdf,splitSizeXlsx,searchOnEnterKey,messagesAlignment,phoneBarRememberMeEnabled,rtlSupport,allowedLoginAttempts,blockDuration,loginMailFrequency,language,bucket,transcribe,transcribeRegion,transcribeAccountId,sentiment,sentimentRegion,sentimentAccountId,googleSsoEnabled,enforcePasswordHistory,passwordHistoryLimit,enablePrivacyPolicyEmail,privacyPolicyEmail,enablePrivacyPolicyName,privacyPolicyName,enablePrivacyPolicyNumber,privacyPolicyNumber,chatInteractionsReloadTimeout,mailInteractionsReloadTimeout,openchannelInteractionsReloadTimeout,smsInteractionsReloadTimeout,whatsappInteractionsReloadTimeout,stopRecordingOnTransfer,adSsoEnabled,disabledCookie,previewRecallmeReminderInterval,limitTabs",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.smtps",{url:"/smtps",views:{"content@app":{templateUrl:"app/main/apps/settings/views/smtps/smtps.html",controller:"SmtpController as vm"}},resolve:{mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,service,provider,name,email,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,description",service:"1",limit:10,offset:0})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.networks",{url:"/networks",views:{"content@app":{templateUrl:"app/main/apps/settings/views/networks/networks.html",controller:"NetworksController as vm"}},resolve:{networks:["apiResolver",function(e){return e.resolve("network@get",{fields:"createdAt,updatedAt,id,type,value,username,password",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.customizations",{url:"/customizations",views:{"content@app":{templateUrl:"app/main/apps/settings/views/customizations/customizations.html",controller:"CustomizationsController as vm"}},resolve:{customizations:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,defaultLogo,defaultLoginLogo,defaultFavicon,defaultHeaderWhiteLabel,headerWhiteLabel,defaultPageTitle,pageTitle,defaultPreferred",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.cloudProviders",{url:"/cloudProviders",views:{"content@app":{templateUrl:"app/main/apps/settings/views/cloudProviders/cloudProviders.html",controller:"CloudProvidersController as vm"}},resolve:{cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}),n.addPart("app/main/apps/settings")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.settings",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.settings.updates","app.settings.license","app.settings.system"]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.license",{url:"/license",views:{"content@app":{templateUrl:"app/main/apps/settings/views/license/license.html",controller:"LicenseController as vm"}},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.license",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.system",{url:"/system?tab",views:{"content@app":{templateUrl:"app/main/apps/settings/views/system/system.html",controller:"SystemController as vm"}},resolve:{system:["apiResolver",function(e){return e.resolve("system@get")}],processes:["apiResolver",function(e){return e.resolve("pm2@get")}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.system",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.updates",{url:"/updates",views:{"content@app":{templateUrl:"app/main/apps/settings/views/updates/updates.html",controller:"UpdatesController as vm"}},resolve:{version:["apiResolver",function(e){return e.resolve("version@get",{latest:!0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1400})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.updates",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.sms",{abstract:!0,url:"/sms"}).state("app.sms.smsQueues",{url:"/smsQueues",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/smsQueues.html",controller:"SmsQueuesController as vm"}},resolve:{smsQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsQueues.edit",{url:"/:id?tab",params:{smsQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/edit/view.html",controller:"SmsQueueController as vm"}},resolve:{smsQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsAccounts",{url:"/smsAccounts",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/smsAccounts.html",controller:"SmsAccountsController as vm"}},resolve:{smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}).state("app.sms.smsAccounts.edit",{url:"/:id?tab",params:{smsAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/edit/view.html",controller:"SmsAccountController as vm"}},resolve:{smsAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}),n.addPart("app/main/apps/sms")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.sms",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.sms.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.sms.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/sms/views/realtime/realtime.html",controller:"SmsRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:710})}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.agents",{url:"/agents",params:{channel:"sms"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.queues",{url:"/queues",controller:"QueuesSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"SmsQueues":void 0,channel:"sms",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:710})}e.$inject=["$stateProvider"],angular.module("app.sms.realtime",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.staff",{abstract:!0,url:"/staff"}).state("app.staff.users",{url:"/users",views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/users.html",controller:"UsersController as vm"}},resolve:{users:["apiResolver",function(e){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled",role:"admin,user",sort:"-updatedAt",userSetting:!0,limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.users.edit",{url:"/:id?tab",params:{user:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/edit/view.html",controller:"UserController as vm"}},resolve:{user:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled",id:n.id,userSetting:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.agents",{url:"/agents",views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/agents.html",controller:"AgentsController as vm"}},resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled",role:"agent",sort:"-updatedAt",userSetting:!0,limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled",role:"agent",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.agents.edit",{url:"/:id?tab",params:{agent:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/edit/view.html",controller:"AgentController as vm"}},resolve:{agent:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled",id:n.id,userSetting:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.telephones",{url:"/telephones",views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/telephones.html",controller:"TelephonesController as vm"}},resolve:{telephones:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Telephones",fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.telephones.edit",{url:"/:id?tab",params:{telephone:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/edit/view.html",controller:"TelephoneController as vm"}},resolve:{telephone:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.teams",{url:"/teams",views:{"content@app":{templateUrl:"app/main/apps/staff/views/teams/teams.html",controller:"TeamsController as vm"}},resolve:{teams:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("team@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Teams",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:204})}]},authenticate:!0,permissionId:204,bodyClass:"staff"}).state("app.staff.userProfiles",{url:"/userProfiles",views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/userProfiles.html",controller:"UserProfilesController as vm"}},resolve:{userProfiles:["apiResolver",function(e){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}).state("app.staff.userProfiles.edit",{url:"/:id?tab",params:{userProfile:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/edit/view.html",controller:"UserProfileController as vm"}},resolve:{userProfile:["apiResolver","$stateParams",function(e,n){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}),n.addPart("app/main/apps/staff")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.staff",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.tools",{abstract:!0,url:"/tools"}).state("app.tools.cannedAnswers",{url:"/cannedAnswers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",controller:"CannedAnswersController as vm"}},resolve:{cannedAnswers:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cannedAnswer@get",{fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"CannedAnswers",fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1001})}]},authenticate:!0,permissionId:1001,bodyClass:"tools"}).state("app.tools.customDashboards",{url:"/customDashboards",views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/customDashboards.html",controller:"CustomDashboardsController as vm"}},resolve:{customDashboards:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"CustomDashboards",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.customDashboards.edit",{url:"/:id?tab",params:{customDashboard:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/edit/view.html",controller:"CustomDashboardController as vm"}},resolve:{customDashboard:["apiResolver","$stateParams",function(e,n){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.intervals",{url:"/intervals",views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/intervals.html",controller:"IntervalsController as vm"}},resolve:{intervals:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Intervals",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.intervals.edit",{url:"/:id?tab",params:{interval:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/edit/view.html",controller:"IntervalController as vm"}},resolve:{interval:["apiResolver","$stateParams",function(e,n){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.pauses",{url:"/pauses",views:{"content@app":{templateUrl:"app/main/apps/tools/views/pauses/pauses.html",controller:"PausesController as vm"}},resolve:{pauses:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("pause@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Pauses",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1005})}]},authenticate:!0,permissionId:1005,bodyClass:"tools"}).state("app.tools.schedules",{url:"/schedules",views:{"content@app":{templateUrl:"app/main/apps/tools/views/schedules/schedules.html",controller:"SchedulesController as vm"}},resolve:{schedules:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("schedule@get",{fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Scheduler",fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1006})}]},authenticate:!0,permissionId:1006,bodyClass:"tools"}).state("app.tools.sounds",{url:"/sounds",views:{"content@app":{templateUrl:"app/main/apps/tools/views/sounds/sounds.html",controller:"SoundsController as vm"}},resolve:{sounds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("sound@get",{fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Sounds",fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1007})}]},authenticate:!0,permissionId:1007,bodyClass:"tools"}).state("app.tools.tags",{url:"/tags",views:{"content@app":{templateUrl:"app/main/apps/tools/views/tags/tags.html",controller:"TagsController as vm"}},resolve:{tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags",fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1008})}]},authenticate:!0,permissionId:1008,bodyClass:"tools"}).state("app.tools.templates",{url:"/templates",views:{"content@app":{templateUrl:"app/main/apps/tools/views/templates/templates.html",controller:"TemplatesController as vm"}},resolve:{templates:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("template@get",{fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Templates",fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1009})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.trunks",{url:"/trunks",views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/trunks.html",controller:"TrunksController as vm"}},resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.trunks.edit",{url:"/:id?tab",params:{trunk:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/edit/view.html",controller:"TrunkController as vm"}},resolve:{trunk:["apiResolver","$stateParams",function(e,n){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.variables",{url:"/variables",views:{"content@app":{templateUrl:"app/main/apps/tools/views/variables/variables.html",controller:"VariablesController as vm"}},resolve:{variables:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("variable@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Variables",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1012})}]},authenticate:!0,permissionId:1012,bodyClass:"tools"}),n.addPart("app/main/apps/tools")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.tools",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.tools.dispositions","app.tools.triggers"]).config(e)}(),function(){"use strict";function e(e){e.state("app.tools.dispositions",{url:"/dispositions",views:{"content@app":{templateUrl:"app/main/apps/tools/views/dispositions/dispositions.html",controller:"DispositionsController as vm"}},resolve:{dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1002})}]},authenticate:!0,permissionId:1002,bodyClass:"tools"})}e.$inject=["$stateProvider"],angular.module("app.tools.dispositions",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.tools.triggers",{url:"/triggers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/triggers.html",controller:"TriggersController as vm"}},resolve:{triggers:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Triggers",fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.triggers.edit",{url:"/:id?tab",params:{trigger:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/edit/view.html",controller:"TriggerController as vm"}},resolve:{trigger:["apiResolver","$stateParams",function(e,n){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"})}e.$inject=["$stateProvider"],angular.module("app.tools.triggers",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.video",{abstract:!0,url:"/video"}).state("app.video.screenRecordings",{url:"/screenRecordings",views:{"content@app":{templateUrl:"app/main/apps/video/views/screenRecordings/screenRecordings.html",controller:"ScreenRecordingsController as vm"}},resolve:{screenRecordings:["apiResolver","Auth","msUtils",function(e,n,t){return n.hasRole("admin")?e.resolve("screenRecording@get",{fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:t.firstLastDayMonth(),includeAll:"true",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ScreenRecordings",fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:t.firstLastDayMonth(),includeAll:"true",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadScreenRecordings",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2001})}]},authenticate:!0,permissionId:2001,bodyClass:"video"}),n.addPart("app/main/apps/video")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.video",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.inboundRoutes",{url:"/inboundRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundRoutes/inboundRoutes.html",controller:"InboundRoutesController as vm"}},resolve:{inboundRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"InboundRoutes",fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.inboundRoutes.edit",{url:"/:id?tab",params:{inboundRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundRoutes/edit/view.html",controller:"InboundRouteController as vm"}},resolve:{inboundRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.inboundRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.internalRoutes",{url:"/internalRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalRoutes/internalRoutes.html",controller:"InternalRoutesController as vm"}},resolve:{internalRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"InternalRoutes",fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.internalRoutes.edit",{url:"/:id?tab",params:{internalRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalRoutes/edit/view.html",controller:"InternalRouteController as vm"}},resolve:{internalRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.internalRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.outboundRoutes",{url:"/outboundRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundRoutes/outboundRoutes.html",controller:"OutboundRoutesController as vm"}},resolve:{outboundRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OutboundRoutes",fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.outboundRoutes.edit",{url:"/:id?tab",params:{outboundRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundRoutes/edit/view.html",controller:"OutboundRouteController as vm"}},resolve:{outboundRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.outboundRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/voice/views/realtime/realtime.html",controller:"VoiceRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:411})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.agents",{url:"/agents",params:{channel:"voice",direction:"inbound"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.telephones",{url:"/telephones",controller:"TelephonesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/telephones/view.html",resolve:{telephones:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Telephones",fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}],rpcTelephones:["apiResolver",function(e){return e.resolve("rpc@getTelephones")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.trunks",{url:"/trunks",controller:"TrunksVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queues",{url:"/queues",controller:"QueuesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"VoiceQueues":void 0,channel:"voice",type:"inbound",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.outbound_calls",{url:"/outbound_calls",controller:"OutboundCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/outbound_calls/view.html",resolve:{rpcCalls:["apiResolver",function(e){return e.resolve("rpc@getOutboundChannels")}]},authenticate:!0,permissionId:411})}e.$inject=["$stateProvider"],angular.module("app.voice.realtime",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.voice",{abstract:!0,url:"/voice"}).state("app.voice.voiceQueues",{url:"/voiceQueues",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/voiceQueues.html",controller:"VoiceQueuesController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.voiceQueues.edit",{url:"/:id?tab",params:{voiceQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/edit/view.html",controller:"VoiceQueueController as vm"}},resolve:{voiceQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.contexts",{url:"/contexts",views:{"content@app":{templateUrl:"app/main/apps/voice/views/contexts/contexts.html",controller:"ContextsController as vm"}},resolve:{contexts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceContext@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Contexts",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:405})}]},authenticate:!0,permissionId:405,bodyClass:"voice"}).state("app.voice.voicemails",{url:"/voicemails",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/voicemails.html",controller:"VoicemailsController as vm"}},resolve:{voicemails:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Voicemails",fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.voicemails.edit",{url:"/:id?tab",params:{voicemail:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/edit/view.html",controller:"VoicemailController as vm"}},resolve:{voicemail:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.musiconholds",{url:"/musiconholds",views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/musiconholds.html",controller:"MusicOnHoldsController as vm"}},resolve:{musiconholds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MusicOnHolds",fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.musiconholds.edit",{url:"/:id?tab",params:{musiconhold:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/edit/view.html",controller:"MusicOnHoldController as vm"}},resolve:{musiconhold:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.voiceRecordings",{url:"/voiceRecordings",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",controller:"VoiceRecordingsController as vm"}},resolve:{voiceRecordings:["apiResolver","Auth","msUtils",function(e,n,t){return n.hasRole("admin")?e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:t.firstLastDayMonth(),limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceRecordings",fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:t.firstLastDayMonth(),limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadVoiceRecordings,privacyEnabled",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.voiceRecordings.edit",{url:"/:id?tab",params:{voiceRecording:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/edit/view.html",controller:"VoiceRecordingController as vm"}},resolve:{voiceRecording:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadVoiceRecordings,privacyEnabled",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.chanSpies",{url:"/chanSpies",views:{"content@app":{templateUrl:"app/main/apps/voice/views/chanSpies/chanSpies.html",controller:"ChanSpiesController as vm"}},resolve:{chanSpies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceChanSpy@get",{fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChanSpies",fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:409})}]},authenticate:!0,permissionId:409,bodyClass:"voice"}).state("app.voice.voicePrefixes",{url:"/voicePrefixes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",controller:"VoicePrefixesController as vm"}},resolve:{voicePrefixes:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voicePrefix@get",{fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoicePrefixes",fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:410})}]},authenticate:!0,permissionId:410,bodyClass:"voice"}),n.addPart("app/main/apps/voice")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.voice",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.voice.inboundRoutes","app.voice.outboundRoutes","app.voice.internalRoutes","app.voice.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.whatsapp.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/realtime/realtime.html",controller:"WhatsappRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2110})}]},authenticate:!0,permissionId:2110}).state("app.whatsapp.realtime.agents",{url:"/agents",params:{channel:"whatsapp"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getAgents",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,whatsappPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity,whatsappCapacity,screenrecording,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:2110}).state("app.whatsapp.realtime.queues",{url:"/queues",controller:"QueuesWhatsappRealtimeController as vm",templateUrl:"app/main/apps/whatsapp/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"WhatsappQueues":void 0,channel:"whatsapp",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2110})}e.$inject=["$stateProvider"],angular.module("app.whatsapp.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.whatsapp",{abstract:!0,url:"/whatsapp"}).state("app.whatsapp.whatsappQueues",{url:"/whatsappQueues",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/whatsappQueues.html",controller:"WhatsappQueuesController as vm"}},resolve:{whatsappQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2101,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappQueues.edit",{url:"/:id?tab",params:{whatsappQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/view.html",controller:"WhatsappQueueController as vm"}},resolve:{whatsappQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("whatsappQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2101,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappAccounts",{url:"/whatsappAccounts",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/whatsappAccounts.html",controller:"WhatsappAccountsController as vm"}},resolve:{whatsappAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappAccounts",fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2102})}]},authenticate:!0,permissionId:2102,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappAccounts.edit",{url:"/:id?tab",params:{whatsappAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/view.html",controller:"WhatsappAccountController as vm"}},resolve:{whatsappAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2102})}]},authenticate:!0,permissionId:2102,bodyClass:"whatsapp"}),n.addPart("app/main/apps/whatsapp")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.whatsapp",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.whatsapp.realtime"]).config(e)}(),function(){"use strict";angular.module("app.navigation",[]).config(function(){})}(),function(){"use strict";function e(e,n){e.addPart("app/quick-panel")}e.$inject=["$translatePartialLoaderProvider","msApiProvider"],angular.module("app.quick-panel",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.reset",{url:"/reset/:token",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.reset":{templateUrl:"app/reset/reset.html",controller:"ResetPasswordController as vm"}},bodyClass:"reset"}),n.addPart("app/reset")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.reset",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/toolbar")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.toolbar",[]).config(e)}(),function(){"use strict";angular.module("app.user-setting",[])}(),function(){"use strict";function e(e){e.interceptors.push("authInterceptor")}e.$inject=["$httpProvider"],angular.module("app.auth").config(e)}(),function(){"use strict";function e(e){e.onBefore({to:function(e){return!0===e.authenticate}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService;return n.isLoggedIn()?n.retrieveUser().catch(function(){return t.target("app.login",void 0,{reload:!0})}):t.target("app.login",void 0,{reload:!0})}),e.onStart({to:function(e){return"app.login"!==e.name}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService,a=e.$to();if(n.hasRole("agent")&&"app.dashboards.general"!=a.name)return t.target("app.dashboards.general",{redirect:!1},{reload:!0})}),e.onFinish({to:function(e){return"app.help"===e.parent.name}},function(e){var n=e.router.stateService;if("app.help"===e.$to().parent.name){var t=e.injector().get("settingsManager"),a=t?t.get():null;if(!a||!a.viewHelpSection)return n.target("app.dashboards.general",{redirect:!1},{reload:!0})}}),e.onFinish({to:function(e){return e.permissionId}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService,a=e.$to();if(n.hasRole("user")){if(!n.hasPermission(a.permissionId))return t.target("app.dashboards.general",{redirect:!1},{reload:!0});var i=e.params().id?Number(e.params().id):void 0;if(i)return n.hasResourcePermission(a.permissionId,i).catch(function(){return t.target(a.parent.name,{redirect:!1},{reload:!0})})}}),e.onFinish({to:function(e){return"app.dashboards.general"===e.parent.name}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService;e.$to();if(n.hasRole("user")&&!n.hasPermission(100))return t.target("app.dashboards.general",{redirect:!1},{reload:!0})})}e.$inject=["$transitions"],angular.module("app.auth").run(e)}(),function(){"use strict";function e(a,e,o,i,s,r,l,d,c){var m;return{getToken:n,getCurrentUser:u,getPermissions:A,hasChildrenPermissions:function(e){return!!e&&_.some(e,function(e){return t(e)})},hasModulePermissions:function(i){return o(function(a,n){f()?a(!0):r.userProfileSection.get({userProfileId:m.userProfileId}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(_.isEmpty(n))a(!1);else{var t=_.filter(n,function(e){return e.enabled});a(_.some(t,["category",i]))}}).catch(function(e){n(e)})})},hasModulesPermissions:function(s){return o(function(a,n){var i={};f()?(s.forEach(function(e){i[e]=!0}),a(i)):r.userProfileSection.get({userProfileId:m.userProfileId}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(_.isEmpty(n))a({});else{var t=_(n).filter(function(e){return e.enabled&&_.includes(s,e.category)}).uniqBy(function(e){return e.category}).map(function(e){return e.category}).value();t.forEach(function(e){i[e]=!0}),a(i)}}).catch(function(e){n(e)})})},hasRole:function(e){return!!m&&m.role===e},hasPermission:t,hasResourcePermission:function(e,s){return o(function(a,i){return r.userProfileSection.get({userProfileId:m.userProfileId,sectionId:e}).$promise.then(function(e){var n=e.rows[0];if(n.autoAssociation)return a();var t=l.getActiveItem().node;return t.permissions&&!1===t.permissions.association?a():r.userProfileResource.get({sectionId:n.id,nolimit:!0}).$promise.then(function(e){var n=e.rows;_.some(n,["resourceId",s])?a():i()})}).catch(function(e){i("Error retrieving user profile permissions",e)})})},hasSectionPermissions:function(a){return o(function(e,n){var t={};return E().then(function(){_.includes(m.permissions,a)&&(t[a]=!0),e(t)}).catch(function(e){n(e)})})},hasSectionsPermissions:function(a){return o(function(e,n){var t={};if(!f())return E().then(function(){a.forEach(function(e){_.includes(m.permissions,e)&&(t[e]=!0)}),e(t)}).catch(function(e){n(e)});a.forEach(function(e){t[e]=!0}),e(t)})},isAgent:h,isAdmin:f,isLoggedIn:function(){return!!n()},isTelephone:function(){return"telephone"===m.role},isUser:b,login:function(e){return o(function(n,t){r.auth.local(e).$promise.then(function(e){return d.get().secureCookieEnabled?c.set("motion.token",e.token,{secure:!0,sameSite:"none"}):c.set("motion.token",e.token),r.user.get({id:e.id}).$promise}).then(function(e){(m=e).lastLoginAt=moment().format("YYYY-MM-DD HH:mm:ss"),y("LOCAL_LOGIN")}).then(function(){if(h()&&1===m.showWebBar&&m.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return h()&&0!==m.showWebBar?p(e):f()||b()?g(!0):void 0}).then(function(e){m=_.assign(m,e),n()}).catch(function(e){t(e)})})},logout:function(t){return o(function(e,n){t?(v(),e()):o.resolve().then(function(){return h()&&0!==m.showWebBar?o(function(e,n){r.user.logout({id:m.id,device:"web"}).$promise.then(function(){e()}).catch(function(e){n(e)})}):f()||b()?g(!1):void 0}).then(function(){v(),e()}).catch(function(e){n(e)})})},parseCrudPermissions:function(e){return f()?{readOnly:!1,canEdit:!0,canDelete:!0}:e?{readOnly:!(!_.includes(e,"r")||1!==e.length),canEdit:!!_.includes(e,"e"),canDelete:!!_.includes(e,"d")}:{readOnly:!0,canEdit:!1,canDelete:!1}},queueLogin:p,reloadPermissions:E,removeCookies:v,retrieveUser:function(){return o(function(n,t){r.user.whoami({userSetting:!0}).$promise.then(function(n){return"user"===n.role?A(n.userProfileId).then(function(e){return n.permissions=e,n}):n}).then(function(e){n(m=e)}).catch(function(e){t(e)})})},setCurrentUser:function(e){m=_.merge(m,e)},getAuthenticationType:function(){var e=u(),n=i.localStorage.getItem("motion2.user:"+e.id);if(n)return JSON.parse(n).authenticationType;return"NONE"},loginSSO:function(e){"google"!==e&&y("SSO_LOGIN");return"/api/auth/"+e},loginAD:function(e){return o(function(n,t){r.auth.activedirectory(e).$promise.then(function(e){return d.get().secureCookieEnabled?c.set("motion.token",e.token,{secure:!0,sameSite:"none"}):c.set("motion.token",e.token),r.user.get({id:e.id}).$promise}).then(function(e){(m=e).lastLoginAt=moment().format("YYYY-MM-DD HH:mm:ss"),y("SSO_LOGIN")}).then(function(){if(h()&&1===m.showWebBar&&m.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return h()&&0!==m.showWebBar?p(e):f()||b()?g(!0):void 0}).then(function(e){m=_.assign(m,e),n()}).catch(function(e){t(e)})})}};function n(){return e.get("motion.token")}function u(){return m}function p(e){return o(function(n,t){r.user.login({id:m.id,device:"web",intrf:e}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}function g(a){return o(function(n,t){var e={online:a,lastLoginAt:a?moment().format("YYYY-MM-DD HH:mm:ss"):void 0};r.user.update({id:m.id},e).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}function v(){e.remove("motion.token"),m&&(i.localStorage.removeItem("motion.user:"+m.id),m=null)}function h(){return"agent"===m.role}function f(){return"admin"===m.role}function b(){return"user"===m.role}function t(e){return!!m&&_.includes(m.permissions,e)}function A(e){var a=[];return o(function(n,t){return e||n(a),r.userProfile.getSections({id:e}).$promise.then(function(e){for(var n=0;n<e.length;n++){var t=e[n];a.push(t.sectionId),t.subsections&&(a=_.concat(a,t.subsections))}return a}).then(function(e){n(e)}).catch(function(e){t("Error retrieving user profile permissions",e)})})}function E(){return o(function(n,t){A(m.userProfileId).then(function(e){m.permissions=e,n()}).catch(function(e){t(e)})})}function y(e){var n=u(),t={authenticationType:e};i.localStorage.setItem("motion2.user:"+n.id,JSON.stringify(t))}}e.$inject=["$mdDialog","$cookies","$q","$window","$document","api","msNavigationService","settingsManager","jscookie"],angular.module("app.auth").factory("Auth",e)}(),function(){"use strict";function e(n,e){this.telephones=e,this.closeDialog=function(e){n.hide(e)},e.count&&(this.name=e.rows[0].name)}e.$inject=["$mdDialog","telephones"],angular.module("app.auth").controller("HotDeskDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s;return{request:function(e){var n=t.get("motion.token");return e.headers=e.headers||{},i.isSameOrigin(e.url)&&n&&(e.headers.Authorization="Bearer "+n),e},responseError:function(e){switch(e.status){case 401:t.remove("motion.token"),(s||(s=a.get("$state"))).go("app.login")}return n.reject(e)}}}e.$inject=["$rootScope","$q","$cookies","$injector","Util"],angular.module("app.auth").factory("authInterceptor",e)}(),function(){"use strict";function e(n){var t={safeCb:function(e){return angular.isFunction(e)?e:angular.noop},urlParse:function(e){var n=document.createElement("a");return n.href=e,""===n.host&&(n.href=n.href),n},isSameOrigin:function(i,e){return i=t.urlParse(i),(e=(e=e&&[].concat(e)||[]).map(t.urlParse)).push(n.location),1<=(e=e.filter(function(e){var n=i.hostname===e.hostname,t=i.protocol===e.protocol,a=i.port===e.port||""===e.port&&("80"===i.port||"443"===i.port);return n&&t&&a})).length}};return t}e.$inject=["$window"],angular.module("app.auth").factory("Util",e)}(),function(){"use strict";function e(e,n,t){var a={initLogger:function(){return i.init({uri:t.baseUrl+"logs/client-logs",initial_state_name:"client-logs",flushInterval:6e4,debounceInterval:10,sizeLimit:300,silent:!1,autoLog:["error"],heartbeat:!1,logUnload:!1,logPerformance:!1}),i.addHeaderBuilder(function(){return(e=n.get("motion.token"))?{Authorization:"Bearer "+e}:{};var e}),i}},i=e.$logger;if(!i)throw new Error("Beaver Logger not found");return a}function n(d,e,t){var n={getLogger:function(l){var e=function(r){return function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];var a=n[0],i=n.slice(1),s="string"!=typeof a||"string"==typeof a&&0===i.length?l:a,o=1<n.length&&"string"==typeof a?i:n;(function(e,n,t){if(!d.isLoggedIn())return;var a=d.getCurrentUser();if(!a||!a.userSetting.clientSideLoggingEnabled)return;if(i=e,!(c.indexOf(i)>=c.indexOf(m)))return;var i;var s=n,o=t;"string"==typeof n&&void 0===t&&(s=e,o=n);u[e].call(u,s,{data:p(o)})}).call(this,r,s,o)}};return{error:e("error"),warn:e("warn"),info:e("info"),debug:e("debug")}},getLoggingColors:function(){return{disabled:{color:"#616161"},debug:{color:"#283593"},info:{color:"#000000"},warning:{color:"#FBC02D"},error:{color:"#FF5252"}}},flush:a},c=["debug","info","warn","error"],m="debug",u=e.initLogger();function p(t){return Array.isArray(t)?t.map(p):null===t||"object"!=typeof t?t:_.isPlainObject(t)?t:t&&"function"==typeof t.toJSON?t.toJSON():t instanceof Error?Object.getOwnPropertyNames(t).reduce(function(e,n){return e[n]=p(t[n]),e},{}):JSON.parse(JSON.stringifyOnce(t))}function a(){return u.flush()}return t.$on("local:user-setting-updated",function(e,n){n.clientSideLoggingEnabled?t.$broadcast("client-side-logging:enabled"):(a(),t.$broadcast("client-side-logging:disabled")),m=n.clientSideLoggingLevel}),t.$on("local:user-logout",function(){m="debug"}),JSON.stringifyOnce=function(i,s,e){var o=[],r=[];return e||(e=2),JSON.stringify(i,function(e,t){if(2e3<o.length)return"object too long";var a=!1;if(o.forEach(function(e,n){e===t&&(a=n)}),""==e)return o.push(i),r.push("root"),t;if(a+""!="false"&&"object"==typeof t)return"root"==r[a]?"(pointer to root)":"(see "+(t&&t.constructor?t.constructor.name.toLowerCase():typeof t)+" with key "+r[a]+")";var n=e||"(empty key)";return o.push(t),r.push(n),s?s(e,t):t},e)},n}e.$inject=["$window","$cookies","api"],n.$inject=["Auth","clientSideLogger","$rootScope"],angular.module("app.client-side-logging").factory("clientSideLogger",e).service("ClientSideLoggingService",n)}(),function(){"use strict";angular.module("app.core").provider("motionConfig",function(){var t={disableCustomScrollbars:!1,disableMdInkRippleOnMobile:!0,disableCustomScrollbarsOnMobile:!0};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){var e={getConfig:function(e){if(angular.isUndefined(t[e]))return!1;return t[e]},setConfig:function(e,n){t[e]=n}};return e}})}(),function(){"use strict";function e(e,n,t){n.debugEnabled(!0),e.config({tabindex:!1}),t.config({disableCustomScrollbars:!1,disableCustomScrollbarsOnMobile:!0,disableMdInkRippleOnMobile:!0})}e.$inject=["$ariaProvider","$logProvider","motionConfigProvider"],angular.module("app.core").config(e)}(),function(){"use strict";function e(e,n,t){(n.generate(),t.getConfig("disableMdInkRippleOnMobile")&&e.isMobile())&&angular.element("body").attr("md-no-ink",!0);e.isMobile()&&angular.element("html").addClass("is-mobile");var a=e.detectBrowser();if(a){var i=a.browser+" "+a.version+" "+a.os;angular.element("html").addClass(i)}}e.$inject=["msUtils","motionGenerator","motionConfig"],angular.module("app.core").run(e)}(),function(){"use strict";function e(n,e,t,a,i,s){var l=this;function o(){var e=_.filter(l.searchOptions.conditions,["disabled",!1]),o=[],r="";if(_(e).groupBy("name").forEach(function(e){var n=e[0],t=1<e.length,a=n.query.column;if(t){var i=_(e).groupBy(function(e){return e.query.operator}).mapValues(function(e){return _.chain(e).map(function(e){return e.query.value}).flattenDeep().value()}).value(),s=[];_.keys(i).forEach(function(e){var n=i[e],t=e;_.includes(["$between","$in","$notIn"],e)?t+="["+n+"]":n.forEach(function(e){t+="["+e+"]"}),s.push(t)}),r+=a+":="+s.join(":=")}else r=a+":="+n.query.operator+"["+n.query.value+"]";o.push(r)}),0!==o.length){var n="["+l.searchOptions.matchType+"]";return n+=o.join("||")}}function r(){var e=n.localStorage.getItem("motion2."+s+":"+l.currentUser.id);return e?JSON.parse(e):{}}function d(e){n.localStorage.setItem("motion2."+s+":"+l.currentUser.id,JSON.stringify(e))}function c(){if(s){var e=r();e.advancedSearch=_.omit(l.searchOptions,"fields"),d(e)}}function m(){return!!r().advancedSearch}l.currentUser=t.getCurrentUser(),l.searchOptions={matchType:"$and",conditions:[],fields:i},l.toolbarColor=a,l.onInit=function(){if(s){var e=r();e.hasOwnProperty("advancedSearch")&&(l.searchOptions=_.merge(l.searchOptions,e.advancedSearch))}},l.applyFilter=function(){c(),e.hide({apply:!0,value:o()})},l.clearConditions=function(){l.searchOptions.conditions=[],function(){if(s){var e=r();delete e.advancedSearch,e.query&&delete e.query.search,d(e)}}()},l.minimize=function(){c(),e.hide({apply:!m(),value:o()||m()?!_.isEmpty(l.searchOptions.conditions):void 0})},l.close=function(){e.hide({apply:!m(),value:o()||m()?!_.isEmpty(l.searchOptions.conditions):void 0})}}e.$inject=["$window","$mdDialog","Auth","color","fields","storagePath"],angular.module("app.core").controller("AdvancedSearchController",e)}(),function(){"use strict";function e(a){return{restrict:"A",link:function(e,n,t){e.$watch(t.focusOn,function(e){a(function(){e?n[0].focus():n[0].blur()})})}}}e.$inject=["$timeout"],angular.module("app.core").directive("focusOn",e)}(),function(){"use strict";function e(o,l,d){return{restrict:"E",compile:function(e,n){var s;return n.code||(s=e.html(),e.empty()),function(t,a,r){r.code&&(s=t.$eval(r.code));var i=t.$eval(r.shouldInterpolate);l.when(s).then(function(e){if(e){i&&(e=d(e)(t));var n=angular.element('<pre><code class="highlight" ng-non-bindable></code></pre>');a.append(n),o(function(){!function(e,n){var t=n.find("code"),a=e.split("\n"),i=(a=a.filter(function(e){return e.trim().length}))[0].match(/^\s*/)[0],s=new RegExp("^"+i);a=a.map(function(e){return e.replace(s,"").replace(/\s+$/,"")});var o=hljs.highlight(r.language||r.lang,a.join("\n"),!0);o.value=o.value.replace(/=<span class="hljs-value">""<\/span>/gi,"").replace("<head>","").replace("<head/>",""),t.append(o.value).addClass("highlight")}(e,n)},34,!1)}})}}}}e.$inject=["$timeout","$q","$interpolate"],angular.module("app.core").directive("hljs",e)}(),function(){"use strict";function e(s,o,e,t){var r=this;function n(){var a=r.selectedField.options&&!_.isEmpty(r.selectedField.options.extraOperators),i=r.selectedField.options&&!_.isEmpty(r.selectedField.options.excludedOperators);r.availableOperators=_.filter(r.operators,function(n){var e=!n.applyTo||_.includes(n.applyTo,r.selectedField.type);n.isExtra=a&&_.some(r.selectedField.options.extraOperators,function(e){return e===n.type});var t=_.includes(n.excludeFrom,r.selectedField.type)||i&&_.includes(r.selectedField.options.excludedOperators,n.type);if((e||n.isExtra)&&!t)return n})}function l(n){return e[n.model][n.action](n.params).$promise.then(function(e){if("autocomplete"!==r.selectedField.type)return e.rows;var n=r.searchText?_.filter(e.rows,function(e){e.displayValue="";for(var n=0;n<r.selectedField.options.searchFields.length;n++){var t=e[r.selectedField.options.searchFields[n]]||"";e.displayValue+=t+" "}return _.trimEnd(e.displayValue),_.includes(e.displayValue.toLowerCase(),r.searchText.toLowerCase())}):[];return o.when(n)}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:n.model.toUpperCase()+"."+n.action.toUpperCase(),msg:e.data?JSON.stringify(e.data.message):e.toString()})})}function a(){!r.value||_.isArray(r.value)&&_.isEmpty(r.value)?r.isValidCondition=!1:r.selectedOperator?r.selectedOperator&&"$between"===r.selectedOperator.type?r.isValidCondition=!(!r.endRangeValue||!r.isValidRange):r.isValidCondition=!0:r.isValidCondition=!1}function i(){"number"===r.selectedField.type?_.isNumber(r.endRangeValue)?r.isValidRange=Number(r.endRangeValue)>Number(r.value):r.isValidRange=!0:"date"===r.selectedField.type&&(r.maxDateRange=moment(r.endRangeValue).subtract(1,"day"),r.isValidRange=!0),a()}function d(){var e=m();r.options.conditions.push(e),p()}function c(){var e=m(),n=_.findIndex(r.options.conditions,"style");r.options.conditions.splice(n,1,e),p(),r.pendingCondition.style=null,r.pendingCondition=void 0}function m(){return{name:r.selectedField.name,operator:s.instant("DASHBOARDS."+r.selectedOperator.translate),value:r.value,endValue:r.endRangeValue,displayValue:u(r.value),displayEndValue:u(r.endRangeValue),query:{column:r.selectedField.column,operator:r.selectedOperator.type,value:function(){var e,n=r.value,t=r.endRangeValue;switch(r.selectedField.type){case"date":var a=moment(n).utcOffset(0,!0).format("YYYY-MM-DD");if("$between"===r.selectedOperator.type){var i=moment(t).utcOffset(0,!0).format("YYYY-MM-DD");e=[a,i]}else e=a;break;case"number":e="$between"===r.selectedOperator.type?[n,t]:n;break;case"multiselect":var s=r.selectedField.options.field||"name";e=_.map(n,s);break;case"select":e=n.id;break;case"autocomplete":e=r.selectedOperator.isExtra?n:n.id;break;default:e=n}return e}()},disabled:!1}}function u(e){var n;if(e){switch(r.selectedField.type){case"date":n=moment(e).format("YYYY-MM-DD");break;case"multiselect":var t=_.map(e,function(e){return e.name});n="$eq"===r.selectedOperator.type?t.join(" or "):t.join(" and ");break;case"select":n=e.name;break;case"autocomplete":n=r.selectedOperator.isExtra?e:e.displayValue;break;default:n=e}return n}}function p(){r.value=null,r.endRangeValue=null,r.minDateRange=null,r.maxDateRange=null,r.isValidCondition=!1}r.operators=r.availableOperators=[{type:"$eq",symbol:"=",translate:"EQUALS",excludeFrom:["multiselect"]},{type:"$ne",symbol:"≠",translate:"IS_NOT_EQUAL",excludeFrom:["multiselect"]},{type:"$in",symbol:"∈",translate:"IS_AMONG",applyTo:["multiselect"]},{type:"$notIn",symbol:"∉",translate:"IS_NOT_AMONG",applyTo:["multiselect"]},{type:"$substring",symbol:"⊃",translate:"CONTAINS",applyTo:["text"]},{type:"$startsWith",symbol:"a..",translate:"STARTS_WITH",applyTo:["text"]},{type:"$endsWith",symbol:"..a",translate:"ENDS_WITH",applyTo:["text"]},{type:"$lt",symbol:"<",translate:"IS_LESS_THAN",applyTo:["date","number"]},{type:"$gt",symbol:">",translate:"IS_GREATER_THAN",applyTo:["date","number"]},{type:"$lte",symbol:"≤",translate:"IS_LESS_THAN_OR_EQUAL_TO",applyTo:["date","number"]},{type:"$gte",symbol:"≥",translate:"IS_GREATER_THAN_OR_EQUAL_TO",applyTo:["date","number"]},{type:"$between",symbol:"≬",translate:"IS_BETWEEN",applyTo:["date","number"]}],r.addCondition=d,r.editCondition=function(e){r.pendingCondition=e,r.pendingCondition.style="md-amber-200-bg",r.selectedField=_.find(r.options.fields,["name",r.pendingCondition.name]),n(),r.selectedOperator=_.find(r.availableOperators,["type",r.pendingCondition.query.operator]),"date"===r.selectedField.type&&"string"==typeof r.pendingCondition.value?(r.value=new Date(r.pendingCondition.value),r.minDateRange=moment(r.value).add(1,"day"),r.endRangeValue=r.pendingCondition.endValue?new Date(r.pendingCondition.endValue):void 0):(r.value=r.pendingCondition.value,r.endRangeValue=r.pendingCondition.endValue);r.isValidRange=!0,r.isValidCondition=!0},r.updateCondition=c,r.cancelUpdateCondition=function(){r.pendingCondition.style=null,r.pendingCondition=void 0},r.setConditionStatus=function(e){e.style=e.disabled?void 0:"chip-disabled",e.disabled=!e.disabled},r.removeCondition=function(){_.isEmpty(r.options.conditions)&&r.clearFilter()},r.getValues=function(){{if(r.selectedField.options.routes&&Array.isArray(r.selectedField.options.routes)){var e=angular.copy(r.selectedField.options.routes),n=_.map(e,function(e){return l(e)});return o.all(n).then(function(e){r.selectedField.values=_.flatten(e)})}var t=angular.copy(r.selectedField.options.route);if("autocomplete"===r.selectedField.type)for(var a=0;a<Object.keys(t.params).length;a++){var i=Object.keys(t.params)[a];"@autocomplete"===t.params[i]&&(t.params[i]=r.searchText)}if(!r.selectedField.values)return l(t).then(function(e){r.selectedField.values=_.flatten(e)});r.selectedField.values.forEach(function(e){e.translate&&(e.name=s.instant(e.translate))})}},r.onFieldChange=function(){r.value=void 0,r.endRangeValue=void 0,r.searchText=void 0,r.isValidCondition=!1,n(),r.autoSelectOperator=1===r.availableOperators.length,r.autoSelectOperator||(r.selectedOperator=void 0)},r.onOperatorChange=function(e){r.isValidRange=!0,r.selectedOperator&&(e?e.applyTo?0<_.difference(r.selectedOperator.applyTo,e.applyTo).length&&(r.value=null):r.selectedOperator.applyTo&&(r.value=null):r.value||(r.value=null),"between"!=r.selectedOperator.type&&(r.endRangeValue=null),r.selectedField.options&&!_.isEmpty(r.selectedField.options.extraOperators)&&(r.selectedOperator.isExtra=_.some(r.selectedField.options.extraOperators,function(e){return e===r.selectedOperator.type})));a()},r.onValueChange=function(){r.selectedOperator&&"$between"===r.selectedOperator.type?"number"===r.selectedField.type?i():"date"===r.selectedField.type&&(r.minDateRange=moment(r.value).add(1,"day"),a()):a()},r.checkRange=i,r.handleKeyboardAction=function(){r.pendingCondition?c():d()}}e.$inject=["$translate","$q","api","toasty"],angular.module("app.core").directive("msAdvancedSearch",function(){return{restrict:"E",scope:{options:"=",clearFilter:"&"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-advanced-search/ms-advanced-search.html"}})}(),function(){"use strict";angular.module("app.core").directive("msCard",function(){return{restrict:"E",scope:{templatePath:"=template",card:"=ngModel",vm:"=viewModel"},template:'<div class="ms-card-content-wrapper" ng-include="templatePath" onload="cardTemplateLoaded()"></div>',compile:function(e){return e.addClass("ms-card"),function(e,n){e.cardTemplateLoaded=function(){e.$emit("msCard::cardTemplateLoaded",n)}}}}})}(),function(){"use strict";angular.module("app.core").directive("msChipColor",function(){return{restrict:"A",link:function(e,i,n){n.$observe("msChipColor",function(e){var n=i.parent().parent();if(n.hasClass("md-background-bg md-hue-3")||n.addClass("md-background-bg md-hue-3"),_.isEmpty(e)){var t=n[0].className.split(" "),a=t.indexOf("md-hue-3");t.length=a+1,n[0].className=t.join(" ")}else n.addClass(e)})}}})}(),function(){"use strict";angular.module("app.core").directive("msClickToCall",function(){return{restrict:"E",scope:{type:"=",disabled:"=",target:"=",prefix:"=",license:"="},controller:["$scope","$rootScope","$http","$translate","$document","$mdDialog","Auth","toasty","api",function(t,n,a,i,s,o,e,r,l){function d(e){switch(t.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/originate/"+c(e));case 2:return n.$broadcast("webrtc::call",{target:c(e)})}}function c(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function m(e){return a.get(e).success(function(){r.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){r.error({title:"PhoneBar API Error",msg:i.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}t.currentUser=e.getCurrentUser(),t.privacy=t.currentUser.privacyEnabled,t.showMenu=function(){return t.target&&t.target.indexOf("@")<0&&t.target!=t.currentUser.internal&&t.target!=t.currentUser.name&&(0==t.currentUser.showWebBar&&t.currentUser.phoneBarRemoteControl||2==t.currentUser.showWebBar&&t.license.webrtc)&&!t.disabled},t.call=function(e){return 2!==t.currentUser.showWebBar?(n=e,l.user.getVoicePrefixes({id:t.currentUser.id}).$promise.then(function(e){if(e.count)return o.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{prefixes:e,required:t.currentUser.phoneBarPrefixRequired}})}).then(function(e){t.currentUser.phoneBarPrefixRequired?e&&-1!==e&&d(e+n):e&&-1!==e?d(e+n):e||d(n)})):d(e);var n},t.transfer=function(e){switch(t.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+c(e));case 2:n.$broadcast("webrtc::transfer",{target:c(e)})}}}],templateUrl:"app/core/directives/ms-click-to-call/ms-click-to-call.html"}})}(),function(){"use strict";n.$inject=["ClientSideLoggingService","$rootScope","$translate"];var e={bindings:{user:"<"},controller:n,controllerAs:"vm",templateUrl:"app/core/directives/ms-client-side-logging/ms-client-side-logging-icon.html"};function n(e,n,t){var a=this,i=e.getLoggingColors();function s(){a.tooltipHTML=a.user.userSetting.clientSideLoggingEnabled?[t.instant("STAFF.CLIENT_LOGS_ENABLED"),t.instant("STAFF.CLIENT_LOGS_LOGLEVEL",{logLevel:a.user.userSetting.clientSideLoggingLevel}),t.instant("STAFF.CLIENT_LOGS_ENABLED_SINCE",{enabledSince:moment(a.user.userSetting.clientSideLoggingEnabledSince).format("LLLL")})].join("<br>"):t.instant("STAFF.CLIENT_LOGS_DISABLED")}a.tooltipHTML=t.instant("STAFF.CLIENT_LOGS_DISABLED"),a.styleColor=i.disabled,a.styleIcon=a.user.userSetting&&a.user.userSetting.clientSideLoggingEnabled?"icon-checkbox-marked-circle":"icon-close",a.$onInit=function(){if(!a.user.userSetting)return;var e=a.user.userSetting.clientSideLoggingEnabled?a.user.userSetting.clientSideLoggingLevel:"disabled";a.styleColor=i[e],"info"===e&&(a.styleIcon="icon-checkbox-marked-circle-outline");return s()},a.$onDestroy=function(){o()};var o=n.$on("$translateChangeSuccess",s)}angular.module("app.core").component("msClientSideLoggingIcon",e)}(),function(){"use strict";n.$inject=["ClientSideLoggingService","UserSettingService","$q","$translate","$rootScope","$interval"];var e={bindings:{user:"<",onUserUpdate:"&"},controller:n,controllerAs:"vm",templateUrl:"app/core/directives/ms-client-side-logging/ms-client-side-logging.html"};function n(e,t,n,a,i,s){var o=this,r=e.getLoggingColors(),l=null;function d(){l&&s.cancel(l)}o.styleProperties=r.disabled,o.clientSideLoggingEnabledSince="",o.$onInit=function(){m().then(function(){d(),l=s(u,6e4)})},o.$onChanges=function(e){e&&n.resolve().then(m)},o.$onDestroy=function(){d(),c()},o.onEnabledSwitchChange=function(){var e=o.user.userSetting.clientSideLoggingEnabled,n=o.user.userSetting.clientSideLoggingLevel;return p(e,n)},o.onLogLevelSelectionChange=function(){var e=o.user.userSetting.clientSideLoggingEnabled,n=o.user.userSetting.clientSideLoggingLevel;p(e,n)},o.computeStyleForLoggingLevel=function(e){return r[e]};var c=i.$on("$translateChangeSuccess",u);function m(){o.availableClientSideLoggingLevels=Object.keys(r).filter(function(e){return"disabled"!==e});var e=o.user.userSetting&&o.user.userSetting.clientSideLoggingEnabled?o.user.userSetting.clientSideLoggingLevel:"disabled";return o.styleProperties=r[e],u()}function u(){if(o.user.userSetting)return o.user.userSetting.clientSideLoggingEnabled?void(o.clientSideLoggingEnabledSince=a.instant("STAFF.CLIENT_LOGS_ENABLED_SINCE",{enabledSince:moment(moment(o.user.userSetting.clientSideLoggingEnabledSince).format()).fromNow()})):o.clientSideLoggingEnabledSince=""}function p(e,n){return t.updateUserSettingById(o.user.userSetting.id,{clientSideLoggingEnabled:e,clientSideLoggingLevel:n}).then(function(){"function"==typeof o.onUserUpdate&&o.onUserUpdate()})}}angular.module("app.core").component("msClientSideLogging",e)}(),function(){"use strict";function e(i){return{require:"ngModel",priority:1,link:function(e,n,t,a){a.$formatters.push(i.formatter),a.$parsers.push(i.parser)}}}e.$inject=["msDatepickerFixConfig"],angular.module("app.core").provider("msDatepickerFixConfig",function(){var n={formatter:function(e){return e?""===e?e:new Date(e):""},parser:function(e){return e?moment(e).add(moment(e).utcOffset(),"m").toDate():""}};this.config=function(e){n=angular.extend({},n,e)},this.$get=function(){return n}}).directive("msDatepickerFix",e)}(),function(){"use strict";function e(s){return{restrict:"E",scope:{id:"=",model:"=",element:"=",title:"=",path:"="},replace:!0,link:function(n,e){var t=!1,a={};a.id=n.id,_.isNil(n.path)||(a.path=n.path);var i=document.createElement(n.element);i.setAttribute("preload","none"),i.setAttribute("controls","true"),"audio"===n.element&&i.setAttribute("style","width: 265px;"),"video"===n.element&&i.setAttribute("style","max-width: 500px;"),i.setAttribute("title",n.title),i.setAttribute("src"," "),i.onplay=function(e){t||(t=!0,e.preventDefault(),s[n.model].download(a).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type});i.setAttribute("type",e.type),i.setAttribute("src",URL.createObjectURL(t)),i.play()}).catch(function(e){console.error(e)}))},e.append(i)}}}e.$inject=["api"],angular.module("app.core").directive("msDialogRecording",e)}(),function(){"use strict";function e(i){return{restrict:"A",link:function(t,a){a.bind("click",function(e){var n=i('<div layout="row" class="spinner-overlay" layout-sm="column" layout-align="center center" aria-label="wait"><md-progress-circular md-mode="indeterminate"></md-progress-circular></div>')(t);a.closest("md-dialog").prepend(n)})}}}e.$inject=["$compile"],angular.module("app.core").directive("msDialogSpinner",e)}(),function(){"use strict";function e(){var o=this;function a(e,n,t,a){var i=[];if(0<=t)i.push(e[t]),n.push(e[t]),e.splice(t,1);else{for(var s=0;s<e.length;s++)void 0!==e[s].isValid&&e[s].isValid&&n.push(e[s]);for(s=e.length-1;0<=s;s--)e[s].isValid&&e.splice(s,1);i=n}o.options.transferCallback&&o.options.transferCallback(i,a)}o.canTransfer=function(e,n,t){if(void 0!==e.isValid&&e.isValid)return t?a(n.selectedItems,n.items,n.selectedItems.indexOf(e),t):a(n.items,n.selectedItems,n.items.indexOf(e),t)},o.transfer=a,o.getLine=function(e,n){var t="";if(_.isNil(n))return t;{if(_.isArray(n)){for(var a=0;a<n.length;a++)t+=" "+(e[n[a]]?e[n[a]]:"");return t}return e[n]?e[n]:""}}}angular.module("app.core").directive("msDualMultiselect",function(){return{restrict:"E",scope:{options:"=",readOnly:"=",addDisabled:"<"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html"}})}(),function(){"use strict";function e(a){return{restrict:"E",replace:!0,scope:{onReply:"&",ngModel:"=",ctrlMethods:"=",pickerPosition:"=",search:"=",recentEmojis:"=",placeholder:"="},template:'<textarea class="emojionearea"></textarea>',link:function(t,e){var n=e.emojioneArea({pickerPosition:t.pickerPosition,search:t.search,recentEmojis:t.recentEmojis,placeholder:a.instant(t.placeholder||"Type a message"),attributes:{spellcheck:!0},events:{keyup:function(e,n){t.ngModel=this.getText(),t.onReply({event:n,body:this.getText()})},emojibtn_click:function(){t.ngModel=this.getText()}}});t.ngModel&&n[0].emojioneArea.setText(t.ngModel),t.internalControl=t.ctrlMethods||{},t.internalControl.setText=function(e){n[0].emojioneArea.setText(e)},t.internalControl.getText=function(){return n[0].emojioneArea.getText()},t.$watch("ngModel",function(e){e||n[0].emojioneArea.setText("")})}}}e.$inject=["$translate"],angular.module("app.core").directive("msEmojiArea",e)}(),function(){"use strict";angular.module("app.core").directive("msFontFamily",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.fonts=[{option:"Arial",value:"Arial,Helvetica,sans-serif"},{option:"Century Gothic",value:"Century Gothic,Futura,Didact Gothic,san-serif"},{option:"Calibri",value:"Calibri, Verdana, Geneva, sans-serif"},{option:"Comic Sans MS",value:"Comic Sans MS,cursive"},{option:"Courier New",value:"Courier New,Courier,monospace"},{option:"Georgia",value:"Georgia,serif"},{option:"Lucida Sans Unicode",value:"Lucida Sans Unicode,Lucida Grande,sans-serif"},{option:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{option:"Times New Roman",value:"Times New Roman,Times,serif"},{option:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{option:"Verdana",value:"Verdana,Geneva,sans-serif"}]}],templateUrl:"app/core/directives/ms-font-family/ms-font-family.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsFormWizardController",function(){var n=this;function e(){return n.forms.length}function t(){return 0===n.selectedIndex}function a(){return n.selectedIndex===e()-1}n.forms=[],n.selectedIndex=0,n.registerForm=function(e){n.forms.push(e)},n.previousStep=function(){if(t())return;n.selectedIndex--},n.nextStep=function(){if(a())return;n.selectedIndex++},n.firstStep=function(){n.selectedIndex=0},n.lastStep=function(){n.selectedIndex=e()-1},n.totalSteps=e,n.isFirstStep=t,n.isLastStep=a,n.currentStepInvalid=function(){return angular.isDefined(n.forms[n.selectedIndex])&&n.forms[n.selectedIndex].$invalid},n.previousStepInvalid=function(){return 0<n.selectedIndex&&angular.isDefined(n.forms[n.selectedIndex-1])&&n.forms[n.selectedIndex-1].$invalid},n.formsIncomplete=function(){for(var e=0;e<n.forms.length;e++)if(n.forms[e].$invalid)return!0;return!1},n.resetForm=function(){for(var e=n.selectedIndex=0;e<n.forms.length;e++)n.forms[e].$setPristine(),n.forms[e].$setUntouched()}}).directive("msFormWizard",function(){return{restrict:"E",scope:!0,controller:"MsFormWizardController as msWizard",compile:function(e){return e.addClass("ms-form-wizard"),function(){}}}}).directive("msFormWizardForm",function(){return{restrict:"A",require:["form","^msFormWizard"],compile:function(e){return e.addClass("ms-form-wizard-form"),function(e,n,t,a){var i=a[0],s=a[1];s.registerForm(i)}}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{onClose:"&"},transclude:!0,templateUrl:"app/core/directives/ms-info-bar/ms-info-bar.html",link:function(e,n){var t=i.find("ms-info-bar-active"),a="ms-info-bar-active";t.addClass(a),e.removeInfoBar=function(){t.removeClass(a),n.remove(),e.onClose&&e.onClose(),e.$destroy()}}}}e.$inject=["$document"],angular.module("app.core").directive("msInfoBar",e)}(),function(){"use strict";function e(r,a,l,e){var d=this,n={columnCount:5,respectItemOrder:!1,reLayoutDebounce:400,responsive:{md:3,sm:2,xs:1}},t=!0;function i(){t&&e.cancel(t),t=e(function(){!function(){d.containerPos=d.container[0].getBoundingClientRect(),function(){d.columnCount=d.options.columnCount,l("gt-md")?d.columnCount=d.options.columnCount:l("md")?d.columnCount=d.columnCount>d.options.responsive.md?d.options.responsive.md:d.columnCount:l("sm")?d.columnCount=d.columnCount>d.options.responsive.sm?d.options.responsive.sm:d.columnCount:d.columnCount=d.options.responsive.xs;d.columnWidth=d.containerPos.width/d.columnCount}(),r.$broadcast("msMasonry:relayoutStarted"),d.items=d.container.find("ms-masonry-item");for(var e=Array.apply(null,new Array(d.columnCount)).map(function(){return 0}),n=0;n<d.items.length;n++){var t,a,i,s,o=d.items[n];(o=angular.element(o)).scope()&&o.scope().$broadcast("msMasonryItem:startReLayout"),o.css({width:d.columnWidth}),d.options.respectItemOrder?(i=n%d.columnCount,s=e[i]):(s=Math.min.apply(Math,e),i=e.indexOf(s)),e[i]=s+o[0].getBoundingClientRect().height,t=Math.round(i*d.columnWidth),a=s,o.css({transform:"translate3d("+t+"px,"+a+"px,0px)"}),o.addClass("placed"),o.scope()&&o.scope().$broadcast("msMasonryItem:finishReLayout")}}(),r.$broadcast("msMasonry:relayoutFinished")},d.options.reLayoutDebounce)}d.options=null,d.container=[],d.containerPos="",d.columnWidth="",d.items=[],d.reLayout=i,d.initialize=function(){d.options=d.options?angular.extend(n,d.options):n,r.$watch(function(){return d.container.width()},function(e,n){e!==n&&i()})},d.waitImagesLoaded=function(e,n){if("undefined"!=typeof imagesLoaded){var t=a.imagesLoaded(e);t.on("done",function(){n()})}else n()},r.$on("msMasonry:relayout",function(){i()})}function n(o){return{restrict:"AEC",controller:"msMasonryController",compile:function(i,s){return{pre:function(e,n,t,a){a.options=angular.fromJson(s.options||"{}"),a.container=i},post:function(e,n,t,a){o(function(){a.initialize()})}}}}}e.$inject=["$scope","$window","$mdMedia","$timeout"],n.$inject=["$timeout"],angular.module("app.core").controller("msMasonryController",e).directive("msMasonry",n).directive("msMasonryItem",function(){return{restrict:"AEC",require:"^msMasonry",priority:1,link:function(e,n,t,a){a.waitImagesLoaded(n,function(){a.reLayout()}),e.$on("msMasonryItem:finishReLayout",function(){e.$watch(function(){return n.height()},function(e,n){e!==n&&a.reLayout()})}),n.on("$destroy",function(){a.reLayout()})}}})}(),function(){"use strict";function e(t,e,a,i){var s=this;function o(e,n){s.selectedPalette=e,s.selectedHues=n}function r(){o(!(s.selectedColor={palette:"",hue:"",class:""}),!1),d()}function l(e,n){s.selectedColor={palette:e,hue:n,class:"md-"+e+"-"+n+"-bg",bgColorValue:i.rgba(s.palettes[e][n].value),fgColorValue:i.rgba(s.palettes[e][n].contrast)},"obj"!==s.msModelType||angular.equals(s.selectedColor,s.modelCtrl.$viewValue)||d(),o(e,s.palettes[e]),t.$selectedColor=s.selectedColor}function d(){"class"===s.msModelType?s.modelCtrl.$setViewValue(s.selectedColor.class):"obj"===s.msModelType&&s.modelCtrl.$setViewValue(s.selectedColor)}s.palettes=e,s.selectedPalette=!1,s.selectedHues=!1,t.$selectedColor={},s.activateHueSelection=o,s.selectColor=function(e,n){l(e,n),d(),a.hide()},s.removeColor=r,t.$watch("ngModel",function(){if(!s.modelCtrl.$viewValue||""===s.modelCtrl.$viewValue)return void r();var e,n;if("class"===s.msModelType){var t=s.modelCtrl.$viewValue.split("-");n=5<=t.length?(e=t[1]+"-"+t[2],t[3]):(e=t[1],t[2])}else"obj"===s.msModelType&&(e=s.modelCtrl.$viewValue.palette,n=s.modelCtrl.$viewValue.hue||500);l(e,n)})}e.$inject=["$scope","$mdColorPalette","$mdMenu","motionGenerator"],angular.module("app.core").controller("msMaterialColorPickerController",e).directive("msMaterialColorPicker",function(){return{require:["msMaterialColorPicker","ngModel"],restrict:"E",scope:{ngModel:"=",msModelType:"@?"},controller:"msMaterialColorPickerController as vm",transclude:!0,templateUrl:"app/core/directives/ms-material-color-picker/ms-material-color-picker.html",link:function(e,n,t,a,i){var s=a[0];s.modelCtrl=a[1],s.msModelType=e.msModelType||"class",i(e,function(e){(e=e.filter(function(e,n){return 1===n.nodeType})).length&&n.find("ms-color-picker-button").replaceWith(e)})}}})}(),function(){"use strict";function e(p,g,v){return{restrict:"A",link:function(e,n,t){var a="true"===t.msNavIsFolded,i=!1,s=angular.element(p[0].body),o=angular.element('<div id="ms-nav-fold-open-overlay"></div>'),r=angular.element('<div id="ms-nav-fold-close-overlay"></div>'),l=n.parent();function d(){s.addClass("ms-nav-folded"),g.$broadcast("msNav::forceCollapse"),n.scrollTop(0),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function c(e){angular.isDefined(e)&&e.preventDefault(),s.addClass("ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),l.find(o).remove(),l.parent().append(r),r.on("mouseenter touchstart",function(e){m(e),i=!1})}function m(e){angular.isDefined(e)&&e.preventDefault(),g.$broadcast("msNav::forceCollapse"),n.scrollTop(0),s.removeClass("ms-nav-folded-open"),l.parent().find(r).remove(),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function u(){s.removeClass("ms-nav-folded ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),n.off("mouseenter mouseleave")}v.setFoldable(e,n,a),a?d():u(),e.toggleFold=function(){(a=!a)?d():u()},e.openFolded=c,e.closeFolded=m,e.isNavFoldedOpen=function(){return i},e.$on("$destroy",function(){o.off("mouseenter touchstart"),r.off("mouseenter touchstart"),n.off("mouseenter mouseleave")})}}}function n(t,a,i){return{restrict:"E",scope:{},controller:"MsNavController",compile:function(e){return e.addClass("ms-nav"),function(e){t.$broadcast("msNav::expandMatchingToggles");var n=t.$on("$stateChangeSuccess",function(){t.$broadcast("msNav::expandMatchingToggles"),a.when("navigation").then(function(e){e.close(),i.isNavFoldedOpen()&&i.closeFolded()})});e.$on("$destroy",function(){n()})}}}}function t(m,u,p,g){return{restrict:"A",require:"^msNav",scope:!0,compile:function(e,n){return e.addClass("ms-nav-toggle"),angular.isUndefined(n.collapsed)&&(n.collapsed=!0),e.attr("collapsed",n.collapsed),function(a,i,e,t){var s={expanded:"expanded",expandAnimation:"expand-animation",collapseAnimation:"collapse-animation"},n=i.find("a"),o=[],r=/\(.*\)/g;function l(){return"true"===i.attr("collapsed")}function d(){var e=u.defer();if(!l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!1);var n=angular.element(i.find("ms-nav-toggle-items")[0]);n.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var t=n[0].offsetHeight;return n.css({position:"",visibility:"",display:"",height:""}),a.$evalAsync(function(){p.animate(n,{display:"block",height:"0px"},{height:t+"px"},s.expandAnimation).then(function(){n.addClass(s.expanded),n.css({height:""}),e.resolve({success:!0})})}),e.promise}function c(){var e=u.defer();if(l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!0);var n=angular.element(i.find("ms-nav-toggle-items")[0]),t=n[0].offsetHeight;return a.$evalAsync(function(){p.animate(n,{height:t+"px"},{height:"0px"},s.collapseAnimation).then(function(){n.removeClass(s.expanded),n.css({display:"",height:""}),e.resolve({success:!0})})}),e.promise}angular.forEach(n,function(e){var n=angular.element(e).attr("ui-sref");angular.isUndefined(n)||(n=n.replace(r,""),o.push(n))}),t.setToggleItem(i,a),i.children(".ms-nav-button").on("click",function(){if(t.isDisabled())return;t.disable(),l()?(t.clearLockedItems(),a.$emit("msNav::pushToLockedList"),m.$broadcast("msNav::collapse"),d().then(function(){t.enable()})):a.$broadcast("msNav::forceCollapse")}),a.$on("$destroy",function(){i.children(".ms-nav-button").off("click")}),a.$on("msNav::collapse",function(){var e=t.getLockedItems(),n=!1;angular.forEach(e,function(e){angular.equals(e.scope,a)&&(n=!0)}),n||c().then(function(){t.enable()})}),a.$on("msNav::forceCollapse",function(){c().then(function(){t.enable()})}),a.$on("msNav::expandMatchingToggles",function(){var n=g.current.name,t=!1;angular.forEach(o,function(e){n===e&&(t=!0)}),t?d():c()}),a.$on("msNav::pushToLockedList",function(){t.setLockedItem(i,a)})}}}}e.$inject=["$document","$rootScope","msNavFoldService"],n.$inject=["$rootScope","$mdComponentRegistry","msNavFoldService"],t.$inject=["$rootScope","$q","$animate","$state"],angular.module("app.core").factory("msNavFoldService",function(){var t={};return{setFoldable:function(e,n){t={scope:e,element:n}},isNavFoldedOpen:function(){return t.scope.isNavFoldedOpen()},toggleFold:function(){t.scope.toggleFold()},openFolded:function(){t.scope.openFolded()},closeFolded:function(){t.scope.closeFolded()}}}).directive("msNavIsFolded",e).controller("MsNavController",function(){var e=this,n=!1,t=[],a=[];e.isDisabled=function(){return n},e.enable=function(){n=!1},e.disable=function(){n=!0},e.setToggleItem=function(e,n){t.push({element:e,scope:n})},e.getLockedItems=function(){return a},e.setLockedItem=function(e,n){a.push({element:e,scope:n})},e.clearLockedItems=function(){a=[]}}).directive("msNav",n).directive("msNavTitle",function(){return{restrict:"A",compile:function(e){return e.addClass("ms-nav-title"),function(){}}}}).directive("msNavButton",function(){return{restrict:"AE",compile:function(e){return e.addClass("ms-nav-button"),function(){}}}}).directive("msNavToggle",t)}(),function(){"use strict";function e(e,n){e.root?this.navigation=n.getNavigation(e.root):this.navigation=n.getNavigation(),this.toggleHorizontalMobileMenu=function(){angular.element("body").toggleClass("ms-navigation-horizontal-mobile-menu-active")},n.sort()}function n(c,m,u,p){return{restrict:"E",scope:{folded:"=",root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/vertical.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation"),function(e,n){var t=angular.element("body"),a=angular.element('<div id="ms-navigation-fold-expander"></div>'),i=angular.element('<div id="ms-navigation-fold-collapser"></div>'),s=u("navigation");function o(e){if(p.setFolded(e),e)c.$broadcast("msNavigation::collapse"),t.addClass("ms-navigation-folded"),r();else{var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched"),t.removeClass("ms-navigation-folded ms-navigation-folded-open"),i.remove()}}function r(){n.parent().append(a),m(function(){a.on("mouseenter touchstart",l)})}function l(e){e&&e.preventDefault(),p.setFoldedOpen(!0);var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched"),t.addClass("ms-navigation-folded-open"),a.remove(),t.find("#main").append(i),i.on("mouseenter touchstart",d)}function d(e){e&&e.preventDefault(),p.setFoldedOpen(!1),c.$broadcast("msNavigation::collapse"),t.removeClass("ms-navigation-folded-open"),i.remove(),r()}p.setNavigationScope(e),function(){null===p.getFolded()&&p.setFolded(e.folded);p.getFolded()&&(m(function(){c.$broadcast("msNavigation::collapse")}),t.addClass("ms-navigation-folded"),r())}(),e.$watch(function(){return s.isLockedOpen()},function(e,n){if(!angular.isUndefined(e)&&!angular.equals(e,n)&&p.getFolded())if(e)c.$broadcast("msNavigation::collapse");else{var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched")}}),e.$watch("folded",function(e,n){angular.isUndefined(e)||angular.equals(e,n)||o(e)}),e.toggleFolded=function(){o(!p.getFolded())},e.$on("$stateChangeStart",function(){s.close()}),e.$on("$destroy",function(){i.off("mouseenter touchstart"),a.off("mouseenter touchstart")})}}}}function t(t,e,a,i,n,s){var o=this;o.element=e,o.node=t.node,o.hasChildren=void 0,o.collapsed=void 0,o.collapsable=void 0,o.group=void 0,o.animateHeightClass="animate-height",o.toggleCollapsed=function(){o.collapsed?o.expand():o.collapse()},o.collapse=function(){var e=o.element.children("ul"),n=e[0].offsetHeight;t.$evalAsync(function(){o.collapsed=!0,o.element.addClass("collapsing"),i.animate(e,{display:"block",height:n+"px"},{height:"0px"},o.animateHeightClass).then(function(){e.css({display:"",height:""}),o.element.removeClass("collapsing")}),t.$broadcast("msNavigation::collapse")})},o.expand=function(){var e=o.element.children("ul");e.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var n=e[0].offsetHeight;e.css({position:"",visibility:"",display:"",height:""}),t.$evalAsync(function(){o.collapsed=!1,o.element.addClass("expanding"),i.animate(e,{display:"block",height:"0px"},{height:n+"px"},o.animateHeightClass).then(function(){e.css({height:""}),o.element.removeClass("expanding")}),a.$broadcast("msNavigation::collapse",o.node._path)})},o.getClass=function(){return o.node.class},o.isHidden=function(){if(angular.isDefined(o.node.hidden)&&angular.isFunction(o.node.hidden))return o.node.hidden();return!1},function(){o.hasChildren=0<o.node.children.length,o.group=!(!angular.isDefined(o.node.group)||!0!==o.node.group),!o.hasChildren||o.group?o.collapsable=!1:o.collapsable=!(!angular.isUndefined(o.node.collapsable)&&"boolean"==typeof o.node.collapsable&&!0!==o.node.collapsable);o.collapsable?o.collapsed=!(!angular.isUndefined(o.node.collapsed)&&"boolean"==typeof o.node.collapsed&&!0!==o.node.collapsed):o.collapsed=!1;if(o.node.state===n.current.name||n.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;t.$emit("msNavigation::stateMatched"),s.setActiveItem(o.node,t)}t.$on("msNavigation::stateMatched",function(){o.collapsable&&o.collapsed&&t.$evalAsync(function(){o.collapsed=!1})}),t.$on("msNavigation::collapse",function(e,n){if(!o.collapsed&&o.collapsable)if(angular.isUndefined(n))o.collapse();else{var t=n.split("."),a=[],i=s.getActiveItem();if(i&&(a=i.node._path.split(".")),-1<t.indexOf(o.node._id))return;if(-1<a.indexOf(o.node._id))return;o.collapse()}}),t.$on("$stateChangeSuccess",function(){if(o.node.state===n.current.name){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;s.setActiveItem(o.node,t),a.$broadcast("msNavigation::collapse",o.node._path)}if(n.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;t.$emit("msNavigation::stateMatched")}})}()}function a(n){return{restrict:"E",scope:{root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/horizontal.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation-horizontal"),function(e){n.setNavigationScope(e)}}}}function i(t,e,n,a,i){var s=this;s.element=e,s.node=t.node,s.hasChildren=void 0,s.group=void 0,s.getClass=function(){return s.node.class},function(){if(s.isActive=!1,s.hasChildren=0<s.node.children.length,s.group=!(!angular.isDefined(s.node.group)||!0!==s.node.group),s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;t.$emit("msNavigation::stateMatched"),i.setActiveItem(s.node,t)}t.$on("msNavigation::stateMatched",function(){s.hasChildren&&t.$evalAsync(function(){s.isActive=!0})}),t.$on("msNavigation::clearActive",function(){if(s.hasChildren){var e=[],n=i.getActiveItem();n&&(e=n.node._path.split(".")),-1<e.indexOf(s.node._id)?t.$evalAsync(function(){s.isActive=!0}):t.$evalAsync(function(){s.isActive=!1})}}),t.$on("$stateChangeSuccess",function(){if(s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;i.setActiveItem(s.node,t),n.$broadcast("msNavigation::clearActive")}})}()}function s(i){return{restrict:"A",require:"^msNavigationHorizontalNode",compile:function(e){return e.addClass("ms-navigation-horizontal-item"),function(e,n,t,a){n.on("click",function(){if(!a.hasChildren||i("gt-md"))return;n.toggleClass("expanded")}),e.$on("$destroy",function(){n.off("click")})}}}}e.$inject=["$scope","msNavigationService"],n.$inject=["$rootScope","$timeout","$mdSidenav","msNavigationService"],t.$inject=["$scope","$element","$rootScope","$animate","$state","msNavigationService"],a.$inject=["msNavigationService"],i.$inject=["$scope","$element","$rootScope","$state","msNavigationService"],s.$inject=["$mdMedia"],angular.module("app.core").provider("msNavigationService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function d(e,n){if(angular.isString(e)){for(var t=e.split("."),a=t[t.length-1],i=function(e){var n=l;if(1===e.length)return n;e.pop();for(var t=0;t<e.length;t++){for(var a=e[t],i=!0,s=0;s<n.length;s++)if(n[s]._id===a){n=n[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};n.push(o),n=o.children}}return n}(t),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,n),s.uisref=u(s)):(n.children=[],!angular.isUndefined(n.weight)&&angular.isNumber(n.weight)||(n.weight=1),n._id=a,n._path=e,n.uisref=u(n),i.push(n))}else r.error("path must be a string (eg. `dashboard.project`)")}function c(e){if(angular.isString(e)){for(var n=l,t=e.split("."),a=0;a<t.length;a++)for(var i=t[a],s=0;s<n.length;s++)if(n[s]._id===i){if(n[s]._path===e)return n.splice(s,1),!0;n=n[s].children;break}return!1}r.error("path must be a string (eg. `dashboard.project`)")}function m(e){e||(e=l).sort(a);for(var n=0;n<e.length;n++){var t=e[n].children;1<t.length&&t.sort(a),0<t.length&&m(t)}}function a(e,n){return parseInt(e.weight)-parseInt(n.weight)}function u(e){var n="";return angular.isDefined(e.state)&&(n=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(n=n+"("+angular.toJson(e.stateParams)+")")),n}this.saveItem=d,this.deleteItem=c,this.sortByWeight=m,this.$get=function(){var t=null,n=null,a=null,i=null,e={saveItem:d,deleteItem:c,sort:m,clearNavigation:function(){l=[],n&&(n.vm.navigation=l)},setActiveItem:function(e,n){t={node:e,scope:n}},getActiveItem:function(){return t},getNavigation:s,getFlatNavigation:o,setNavigationScope:function(e){n=e},setFolded:function(e){a=e},getFolded:function(){return a},setFoldedOpen:function(e){i=e},getFoldedOpen:function(){return i},toggleFolded:function(){n.toggleFolded()},getSectionId:function(n,t){var e=o(),a=_.find(e,function(e){return t?e.route===n&&e.title.toLowerCase()===t.toLowerCase():e.route===n});return a?a.id:0}};return e;function s(e){if(e){for(var n=0;n<l.length;n++)if(l[n]._id===e)return[l[n]];return null}return l}function o(e){var n=s(e);return function e(n){var t=[];for(var a=0;a<n.length;a++){var i=angular.copy(n[a]);i.children=[],t.push(i),0<n[a].children.length&&(t=t.concat(e(n[a].children)))}return t}(n)}}}).controller("MsNavigationController",e).directive("msNavigation",n).controller("MsNavigationNodeController",t).directive("msNavigationNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationNode"},controller:"MsNavigationNodeController as vm",compile:function(e){return e.addClass("ms-navigation-node"),function(e,n,t,a){n.addClass(a.getClass()),a.group&&n.addClass("group")}}}}).directive("msNavigationItem",function(){return{restrict:"A",require:"^msNavigationNode",compile:function(e){return e.addClass("ms-navigation-item"),function(e,n,t,a){a.collapsable&&n.on("click",a.toggleCollapsed),e.$on("$destroy",function(){n.off("click")})}}}}).directive("msNavigationHorizontal",a).controller("MsNavigationHorizontalNodeController",i).directive("msNavigationHorizontalNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationHorizontalNode"},controller:"MsNavigationHorizontalNodeController as vm",compile:function(e){return e.addClass("ms-navigation-horizontal-node"),function(e,n,t,a){n.addClass(a.getClass()),a.group&&n.addClass("group")}}}}).directive("msNavigationHorizontalItem",s)}(),function(){"use strict";function e(p,t,g,e,a,i,n,u,s,o,v,h,f,b,r,A,l){var E=this,d=["ringingId","speakerId","microphoneId","ringingVolume","speakerVolume","microphoneVolume","ringingMute","speakerMute","microphoneMute"],c=JSON.parse(n.localStorage.getItem("motion2.user:"+E.conf.id))||{webrtc:{ringingVolume:.5,speakerVolume:.5,microphoneVolume:1,ringingMute:!1,speakerMute:!1,microphoneMute:!1}};e(function(){},999);var y=l.getLogger("jssip","ms-phonebar");function m(l){var d,c,m;return E.initDeviceInProgress=!0,navigator.mediaDevices.getUserMedia({audio:!0}).then(function(e){return E.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/silence.ogg"),E.soundPlayer.play().catch(function(e){y.error(e.message)}),e.getTracks().forEach(function(e){e.stop()}),navigator.mediaDevices.enumerateDevices()}).then(function(e){var n=_.filter(e,function(e){return"audioinput"===e.kind&&"default"!==e.deviceId&&"communications"!==e.deviceId});if(0<n.length){var t=_.find(e,function(e){return"default"===e.deviceId&&"audioinput"===e.kind});if(m=_.find(n,function(e){return e.groupId===t.groupId}),E.conf.microphoneId&&!l){var a=_.find(n,function(e){return e.deviceId===E.conf.microphoneId});a&&(m=a)}E.conf.microphoneId=m.deviceId}else v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_MICROPHONE_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"});E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0,x("microphone",!1);var i=_.filter(e,function(e){return"audiooutput"===e.kind&&"default"!==e.deviceId&&"communications"!==e.deviceId});if(0<i.length){var s=_.find(e,function(e){return"default"===e.deviceId&&"audiooutput"===e.kind});if(c=d=_.find(i,function(e){return e.groupId===s.groupId}),E.conf.speakerId&&!l){var o=_.find(i,function(e){return e.deviceId===E.conf.speakerId});o&&(c=o)}if(E.conf.speakerId=c.deviceId,E.conf.ringingId&&!l){var r=_.find(i,function(e){return e.deviceId===E.conf.ringingId});r&&(d=r)}E.conf.ringingId=d.deviceId}else v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_SPEAKER_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"});return x("speaker",!1)}).then(function(){return x("ringing",!1)}).then(function(){if(jabra)return jabra.init().then(function(){return E.isJabraInitialized=!0,jabra.getInstallInfo()}).then(function(){return jabra.getUserDeviceMediaExt()}).then(function(e){m&&c&&d&&e&&_.includes([m.groupId,c.groupId,d.groupId],e.deviceInfo.browserGroupId)&&(y.info("Jabra library correctly initialized and device correctly installed"),E.isJabraEnabled=!0,jabra.onHook(),jabra.addEventListener("acceptcall",function(e){var n=_.last(E.sessions);n?"incoming"===n.direction&&n.isInProgress()?E.answer(n):y.error("Unable to find a valid call to answer",e):y.error("Unable to answer the call",e)}.bind(this)),jabra.addEventListener("mute",function(){x("microphone",E.conf.microphoneMute=!0)}.bind(this)),jabra.addEventListener("unmute",function(){E.conf.microphoneMute=!1,x("microphone",!0)}.bind(this)),jabra.addEventListener("flash",function(){E.jabraSession.localHold?E.unhold(E.jabraSession):E.hold(E.jabraSession)}.bind(this)),jabra.addEventListener("endcall",function(){o(function(e){for(var n=null,t=0;t<E.sessions.length;t++)_.has(E.sessions[t],"localHold")&&E.sessions[t].localHold||(n=E.sessions[t]);e(n)}).then(function(e){null!==e&&E.terminate(e)})}.bind(this)))}).catch(function(e){y.warn("Error initializing Jabra integration",e)})}).catch(function(e){y.error("Unable to init media devices",e),"NotFoundError"===e.name&&v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}).finally(function(){E.initDeviceInProgress=!1,S(),DetectRTC.load(function(){E.conf.hasMicrophone=DetectRTC.hasMicrophone,E.conf.hasSpeakers="Chrome"!==DetectRTC.browser.name&&"Edge"!==DetectRTC.browser.name&&"Opera"!==DetectRTC.browser.name||DetectRTC.hasSpeakers,E.conf.isWebRTCSupported=DetectRTC.isWebRTCSupported,E.conf.osName=DetectRTC.osName,E.conf.osVersion=DetectRTC.osVersion,E.conf.browserName=DetectRTC.browser.name,E.conf.browserVersion=DetectRTC.browser.version,E.conf.license&&E.conf.isWebRTCSupported&&E.conf.hasMicrophone&&E.conf.hasSpeakers&&"https"===E.conf.protocol&&("chrome"===E.conf.browserName.toLowerCase()||"opera"===E.conf.browserName.toLowerCase()||"safari"===E.conf.browserName.toLowerCase())?E.register||E.ua.start():E.conf.license||v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}.bind(this))})}function S(){c.webrtc=_.pick(E.conf,d),n.localStorage.setItem("motion2.user:"+E.conf.id,JSON.stringify(c))}function T(e,n,t){y.debug("addCall -> target, inbound, fullname",e,n,t),E.calls.unshift({target:e,fullname:t||e,inbound:n,time:moment().format("HH:mm")}),50<E.calls.length&&E.calls.pop()}function I(e){y.debug("answer -> session",e._request),e.notification&&(e.notification.close(),e.notification=null),E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0,e.answer(E.sessionConf),E.isJabraEnabled&&(jabra.offHook(),E.jabraSession=e)}function O(e,n){y.debug("terminate -> session",e._request),e.notification&&(e.notification.close(),e.notification=null);var t={};if(n?t.status_code=n:e.isEstablished()||(t.status_code=603),e.terminate(t),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var a=_.last(E.sessions);a.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=a):jabra.offHook()}}function C(t){return y.debug("getVoiceChannels -> session",t._request),h.rpc.getVoiceChannels().$promise.then(function(e){var n=_.find(e.rows,function(e){return e.sipcalllinkedid===t.call_id?e:e.sipcalluniqueid===t.call_id?e:null});n&&(t.monitor=n.monitor,t.uniqueid=n.uniqueid,t.monitors=n.monitors)})}function w(e){y.debug("onAddstream -> data",e),this.remotePlayer.srcObject=e.stream,this.remotePlayer.play()}function R(){E.canGoInConference=!1,E.isInConference=!1,E.currentconferenceSessions=[]}function x(e,n){switch(e){case"ringing":E.soundPlayer.muted=E.conf.ringingMute,E.conf.ringingId&&E.soundPlayer.setSinkId(E.conf.ringingId).then(function(){E.soundPlayer.volume=E.conf.ringingVolume}).then(function(){n&&S()}).catch(function(e){y.info(e.message,E.conf.ringingId)});break;case"speaker":E.remotePlayer.muted=E.conf.speakerMute,E.conf.speakerId&&E.remotePlayer.setSinkId(E.conf.speakerId).then(function(){E.remotePlayer.volume=E.conf.speakerVolume}).then(function(){n&&S()}).catch(function(e){y.info(e.message,E.conf.speakerId)});break;case"microphone":for(var t=0;t<E.sessions.length;t+=1)E.conf.microphoneMute?E.sessions[t].mute():E.sessions[t].unmute();jabra&&E.isJabraEnabled&&(E.conf.microphoneMute?jabra.mute():jabra.unmute()),n&&S();break;default:y.info("unknown device")}}function N(){E.target="",document.getElementById("ms-target").blur(),document.getElementById("ms-target").value="",p.$broadcast("angucomplete-alt:clearInput","ms-target-wrap")}function D(n){return h.user.getVoicePrefixes({id:E.conf.id}).$promise.then(function(e){if(e.count)return a.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{prefixes:e,required:E.conf.phoneBarPrefixRequired}})}).then(function(e){if(E.conf.phoneBarPrefixRequired){if(e&&-1!==e)return e+n}else{if(e&&-1!==e)return e+n;if(!e)return n}})}function P(){if(E.isInConference){var e=E.sessions[0].connection.getReceivers()[0],n=E.sessions[1].connection.getReceivers()[0],t=new MediaStream;t.addTrack(e.track),t.addTrack(n.track);var a=document.getElementById("remote-audio");a.srcObject=t;var i=a.play();void 0!==i&&i.then(function(){}).catch(function(e){y.error(e)})}}function L(e,n,t,a){return y.debug("onReferCallback -> session, textContent, position, delay",e._request,n,t,a),function(){i.show(i.simple().textContent(n).position(t).hideDelay(a)),O(e)}}function k(n){return y.debug("findSessionBySessionId -> sessionId, vm_pb.sessions",n,E.sessions),_.find(E.sessions,function(e){return e.call_id==n})}function M(e,n){return y.debug("callCallback -> url, params",e,n),s({url:e,method:"GET",params:n})}E.currentUser=b.getCurrentUser(),E.direction="right",E.selectedMode="md-scale",E.target="",E.showDialpad=!1,E.soundPlayer=document.getElementById(E.conf.soundPlayerId),E.remotePlayer=document.getElementById(E.conf.remotePlayerId),E.soundPlayer.volume=1,E.sessionConf={mediaConstraints:{audio:!0,video:!1},pcConfig:{iceServers:[]}},E.sessions=[],E.calls=[],E.callbackQueue=[],E.canGoInConference=!1,E.isInConference=!1,E.currentConferenceSessions=[],E.ua=new JsSIP.UA({sockets:[new JsSIP.WebSocketInterface("wss://"+E.conf.host+":"+E.conf.wssPort+"/ws")],uri:new JsSIP.URI("sip",E.conf.name,E.conf.host,5060,null,null).toString(),authorization_user:E.conf.name,ha1:E.conf.ha1,realm:E.conf.realm,user_agent:E.conf.ua,session_timers_refresh_method:"invite",register_expires:E.conf.phoneBarExpires||60,register:!0}),E.conf=_.merge(c.webrtc,E.conf),E.initDeviceInProgress=!1,E.isJabraEnabled=!1,E.isJabraInitialized=!1,E.jabraSession=null,E.jabraClicked=!1,E.buttonClicked=!1,E.originateInProgress=!1,t.bind("keyup",function(e){switch(e.keyCode){case 27:g(function(){E.showDialpad=!1})}}),E.$onInit=function(){m(!1),navigator.mediaDevices.ondevicechange=function(){E.initDeviceInProgress||(E.initDeviceInProgress=!0,jabra&&E.isJabraInitialized?jabra.shutdown().then(function(){E.isJabraInitialized=!1,m(!(E.isJabraEnabled=!1))}).catch(function(e){y.error("Unable to shutdown Jabra library",e)}):m(!0))};var e=[h.network.get({type:"turn",nolimit:!0}).$promise,h.network.get({type:"stun",nolimit:!0}).$promise];o.all(e).then(function(e){var n=e[0].rows,t=e[1].rows,a=[],i=[];t.forEach(function(e){i.push("stun:"+e.value)}),a.push({urls:i}),n.forEach(function(e){var n={urls:"turn:"+e.value};e.username&&(n.username=e.username),e.password&&(n.credential=e.password),a.push(n)}),E.sessionConf.pcConfig={iceServers:a}}),this.ua.on("registered",function(){this.registered=!0}.bind(this)),this.ua.on("unregistered",function(){this.registered=!1}.bind(this)),this.ua.on("newRTCSession",function(e){y.debug("onNewRTCSession -> data",e);var n,t,a,i,s,o=e.session,r=!0,l="",d=0;switch(e.originator){case"local":o.outgoing=!0,o.name=e.request.ruri.user,o.user=e.request.ruri.user,T(o.user,!1),t=e.request.extraHeaders,a="X-callback-url",s=_.find(t,function(e){return _.startsWith(e,a)}),n=!!s&&_.trim(s.replace(a,"").replace(i||":","")),E.isJabraEnabled&&(E.jabraSession&&jabra.resume(),E.jabraSession=o,jabra.offHook());break;case"remote":var c=b.getCurrentUser();c.voicePause&&c.phoneBarDnd&&(r=!1);var m=e.request.getHeader("Call-Type")||"";if(c.ignorePauseForPreviewCalls&&"PREVIEW"===m&&(r=!0),E.originateInProgress&&(r=!1),r&&(o.incoming=!0,o.name=e.request.from.display_name,o.user=e.request.from.uri.user,l=e.request.getHeader("X-Answer-Mode")||"",d=e.request.getHeader("X-Answer-After")||0,function(n){y.debug("getNotification -> session",n._request);var e=n.name?n.name+" <"+n.user+">":n.user;E.currentUser.privacyEnabled&&(e=A.mask(e)),f.create("Incoming call from: ",e,null,function(){I(n)},function(){O(n)},E.conf.autoAnswer).then(function(e){n.notification=e}).catch(function(e){y.error("Error creating notification for incoming call",e)})}(e.session),T(e.session.user,!0),E.isJabraEnabled&&jabra.ring(),E.conf.autoAnswer&&g(function(){o.isInProgress()&&(o.autoAnswer=!0,I(o))},E.conf.autoAnswerDelay?1e3*E.conf.autoAnswerDelay:0),y.debug("xAnswerMode",l),y.debug("xAnswerAfterSec",d),"auto"==l.toLowerCase())){var u=0==d?500:1e3*d;y.debug("auto answer enabled after:"+u+" ms"),g(function(){o.isInProgress()&&(o.autoAnswer=!0,I(o))},u)}}r?(o.call_id=e.request.call_id,n&&M(E.callbackQueue[o.call_id]=n,{call_id:o.call_id}).then(function(){y.info('callbackurl:"'+n+'" called successfully')}).catch(function(e){y.error('fail callbackurl:"'+n+'" err:',e)}),o.connection&&(o.connection.onaddstream=w.bind(this)),o.iceCandidateTimeout=null,o.on("progress",function(e,n){y.debug("onProgress -> session, data",e._request,n),y.error("onProgress -> session, data",e._request,n);var t=!1;switch(n.originator){case"local":this.conf.ringingMute||(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/incoming-call.ogg"),t=!0);break;case"remote":this.putOtherCallsOnHold(e),this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/outgoing-call.ogg"),t=!0}E.originateInProgress&&(E.originateInProgress=!1),t&&(this.soundPlayer.loop="loop",this.soundPlayer.play().catch(function(e){y.error(e.message)})),C(e).then(function(){var n=E.callbackQueue[e.call_id];n&&M(n,{uniqueid:e.uniqueid,call_id:e.call_id,number_called:e.user}).then(function(){y.info('callbackurl:"'+n+'" called successfully')}).catch(function(e){y.error('fail callbackurl:"'+n+'" err:',e)}).finally(function(){delete E.callbackQueue[e.call_id]})}).catch(function(e){y.error("Unable to retrieve voice channels",e)})}.bind(this,o)),o.on("confirmed",function(e,n){y.debug("onConfirmed -> session, data",e._request,n);var t=document.getElementById("div_session_"+e.id.substr(0,32));t&&$(t).scope().$broadcast("timer-start"),e.confirmed=!0,"remote"===n.originator&&e.connection&&(e.connection.onaddstream=w.bind(this),_.head(e.connection.getRemoteStreams())&&(this.remotePlayer.srcObject=_.head(e.connection.getRemoteStreams()),this.remotePlayer.play())),this.soundPlayer.pause(),this.soundPlayer.loop=null,this.putOtherCallsOnHold(e),e.autoAnswer&&(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/beep.ogg"),this.soundPlayer.play().catch(function(e){y.error("Unable to play autoAnswer notification",e)})),E.canGoInConference=2==E.sessions.length,C(e).catch(function(e){y.error("Unable to retrieve voice channels",e)})}.bind(this,o)),o.on("hold",function(e,n){y.debug("onHold -> session, data",e._request,n),"local"===n.originator&&(e.localHold=!0)}.bind(this,o)),o.on("unhold",function(e,n){y.debug("onUnhold -> session, data",e._request,n),"local"===n.originator&&(e.localHold=!1)}.bind(this,o)),o.on("ended",function(e,n){if(y.debug("onEnded -> session, data",e._request,n),E.isInConference&&_.includes(E.currentConferenceSessions,e.id)&&(R(),E.buttonClicked=!0),_.remove(this.sessions,{id:e.id}),2!==E.sessions.length&&(E.canGoInConference=!1),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var t=_.last(E.sessions);t.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=t):jabra.offHook()}0===E.sessions.length&&E.currentUser.voicePause&&h.user.pause({id:E.currentUser.id,type:_.startsWith(E.currentUser.pauseType,"#")?E.currentUser.pauseType.substring(1):E.currentUser.pauseType}).$promise.catch(function(e){v.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})}),E.conf.microphoneMute=!1,E.initDevice("microphone",!0)}.bind(this,o)),o.on("failed",function(e,n){if(y.debug("onFailed -> session, data",e._request,n),this.soundPlayer.pause(),this.soundPlayer.loop=null,e.notification&&e.notification.close(),E.isInConference&&_.includes(E.currentConferenceSessions,e.id)&&R(),E.originateInProgress&&(E.originateInProgress=!1),_.remove(this.sessions,{id:e.id}),2!==E.sessions.length&&(E.canGoInConference=!1),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var t=_.last(E.sessions);t.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=t):jabra.offHook()}}.bind(this,o)),o.on("icecandidate",function(e,n){y.debug("onIcecandidate -> session, data",e._request,n),null!==e.iceCandidateTimeout&&clearTimeout(e.iceCandidateTimeout),e.iceCandidateTimeout=setTimeout(n.ready,1e3)}.bind(this,o)),E.sessions.push(o),g(function(){p.$apply(),y.debug("onNewRTCSession -> vm_pb.sessions",E.sessions)})):O(o,486)}.bind(this)),r.on("webbar:originate",function(e){y.debug("originateHook -> payload",e);var n=e.callNumber,t=e.callerId,a=e.callbackUrl;E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0;var i=n.replace(/ /g,"");if(i=(i=i.replace(/\(/g,"")).replace(/\)/g,"")){var s=angular.copy(E.sessionConf);s.extraHeaders=[],t&&s.extraHeaders.push("X-CID: "+t),a&&s.extraHeaders.push("X-callback-url: "+a),E.originateInProgress=!0,E.ua.call(i,s)}}.bind(this)),r.on("webbar:hangup",function(e){y.debug("hangupHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];y.info("hangupHook -> sessionToHangup",a),E.terminate(a)}}.bind(this)),r.on("webbar:answer",function(e){var n;y.debug("answerHook -> payload",e),n=e.sessionId?k(e.sessionId):_.find(E.sessions,function(e){return e.incoming&&!e.confirmed}),e.sessionId&&!n&&y.warn("call with session Id "+e.sessionId+" not found"),n&&E.answer(n)}.bind(this)),r.on("webbar:hold",function(e){y.debug("holdHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];E.hold(a)}}.bind(this)),r.on("webbar:unhold",function(e){y.debug("unholdHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];E.unhold(a)}}.bind(this)),r.on("webbar:transfer",function(e){if(y.debug("transferHook -> payload",e),e.sessionId)if(e.transferNumber){var n=k(e.sessionId);n?n.refer(e.transferNumber,{eventHandlers:{requestSucceeded:L(n,"requestSucceeded","top right",3e3),requestFailed:L(n,"requestFailed","top right",3e3)}}):y.warn("call with session Id "+e.sessionId+" not found")}else y.error("transferNumber required");else y.error("sessionId required")}.bind(this)),r.on("webbar:stopmonitors",function(e){if(e.agentId===E.currentUser.id){var n=_.find(E.sessions,["uniqueid",e.uniqueid]);if(!n)return;n.monitors.forEach(function(e){e.status="pause"}),n.monitor=!1}}.bind(this))}.bind(this),E.type=function(e,n){var t=e;switch(E.target||(E.target=""),n&&(E.target+=e,p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target)),e){case"*":t="asterisk";break;case"#":t="pound"}E.conf.enableDtmfTone&&(E.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/dialpad/"+t+".ogg"),E.soundPlayer.play().catch(function(e){y.error(e.message)}));for(var a=0;a<E.sessions.length;a+=1)E.sessions[a].isEstablished()&&!E.sessions[a].isOnHold().local&&E.sessions[a].sendDTMF(e)},E.call=function(){if(E.target&&E.target!==E.conf.name&&E.target!==E.conf.internal){E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0;var e=E.target.replace(/ /g,"");return D(e=(e=e.replace(/\(/g,"")).replace(/\)/g,"")).then(function(e){e&&E.ua.call(e,E.sessionConf)}).then(function(){N()})}},E.hold=function(e){y.debug("hold -> session",e._request),e.hold({useUpdate:!1}),E.isJabraEnabled&&(jabra.hold(),jabra.onHook())},E.refer=function(n){y.debug("refer -> session",n._request);var e=a.prompt().title("Transfer").textContent("Type the target").placeholder("Target").ariaLabel("Target").ok("Transfer").cancel("Cancel");a.show(e).then(function(e){return D(e.replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,""))}).then(function(e){n.refer(e,{eventHandlers:{requestSucceeded:L(n,"requestSucceeded","top right",3e3),requestFailed:L(n,"requestFailed","top right",3e3)}})})},E.record=function(e){y.debug("record -> session",e._request),a.show({controller:"RecordDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/record/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:E.sessions}})},E.unhold=function(e){y.debug("unhold -> session",e._request),e.unhold({useUpdate:!1}),E.putOtherCallsOnHold(e),E.isJabraEnabled&&(jabra.offHook(),jabra.resume())},E.answer=I,E.terminate=O,E.selectSession=function(e){y.debug("selectSession -> session",e._request),E.unhold(e)},E.typeWrapper=function(e){switch(e.key.toLowerCase()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"*":case"#":E.type(e.key);break;case"enter":E.call()}},E.toggleDialpad=function(){E.showDialpad=!E.showDialpad},E.referAttended=function(e){y.debug("referAttended -> session",e._request),a.show({controller:"ReferAttendedDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/referAttended/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:_.reject(E.sessions,{id:e.id}),isJabraEnabled:E.isJabraEnabled}})},E.closeDialpad=function(){E.showDialpad=!1},E.initDevice=x,E.putOtherCallsOnHold=function(e){if(y.debug("putOtherCallsOnHold -> session",e._request),1<E.sessions.length)for(var n=0;n<E.sessions.length;n+=1)E.sessions[n].id===e.id||E.sessions[n].isOnHold().remote||E.sessions[n].hold({useUpdate:!1})},E.targetChanged=function(e){e?/^(\w|\.|\+|#|\*|\(|\)|\s|-)*$/.test(e)?(E.target=e,p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target)):E.target?p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target):N():N()},E.targetSelected=function(e){e&&(E.target=e.originalObject.target,E.call(),N())},E.start3WayConf=function(){E.isInConference=!0,E.canGoInConference=!1,E.currentConferenceSessions.push(E.sessions[0].id),E.currentConferenceSessions.push(E.sessions[1].id);var e=new AudioContext,n=E.sessions[0].connection.getSenders()[0],t=E.sessions[0].connection.getReceivers()[0];t.track.addEventListener("unmute",function(){setTimeout(function(){P()},1e3)},!1);var a=E.sessions[1].connection.getSenders()[0],i=E.sessions[1].connection.getReceivers()[0];i.track.addEventListener("unmute",function(){setTimeout(function(){P()},1e3)},!1),E.sessions[0].unhold({useUpdate:!1}),E.sessions[1].unhold({useUpdate:!1}),t.track.enabled=!0,i.track.enabled=!0;var s=new MediaStream,o=e.createMediaStreamDestination();o=(e=new AudioContext).createMediaStreamDestination();var r=e.createMediaStreamSource(new MediaStream([i.track]));r.connect(o),(r=e.createMediaStreamSource(new MediaStream([n.track]))).connect(o),n.replaceTrack(o.stream.getTracks()[0]).then(function(){}),o=e.createMediaStreamDestination(),(r=e.createMediaStreamSource(new MediaStream([t.track]))).connect(o),(r=e.createMediaStreamSource(new MediaStream([a.track]))).connect(o),a.replaceTrack(o.stream.getTracks()[0]).then(function(){s.addTrack(t.track),s.addTrack(i.track);var e=document.getElementById("remote-audio");e.srcObject=s;var n=e.play();void 0!==n&&n.then(function(){}).catch(function(e){y.error(e)})})},E.patchConference=P,p.$on("webrtc::settings",function(e){a.show({controller:"SettingsController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/settings/settings.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{devices:function(){return navigator.mediaDevices.enumerateDevices()}},locals:{conf:E.conf,activeSessions:E.sessions}}).then(function(e){e&&(E.conf=e,E.initDeviceInProgress||(E.initDeviceInProgress=!0,jabra&&E.isJabraInitialized?jabra.shutdown().then(function(){E.isJabraInitialized=!1,m(E.isJabraEnabled=!1)}).catch(function(e){y.error("Unable to shutdown Jabra library",e)}):m(!1)))})}),p.$on("webrtc::logout",function(){E.ua.stop(),jabra&&E.isJabraInitialized&&jabra.shutdown(),navigator.mediaDevices.ondevicechange=function(){}}),p.$on("webrtc::call",function(e,n){y.debug("onRemoteCall -> evt, data",e,n),n.target&&(E.target=n.target,E.call())}),p.$on("webrtc::transfer",function(e,n){if(y.debug("onRemoteTransfer -> evt, data",e,n),n.target)for(var t=0;t<E.sessions.length;t+=1)if(E.sessions[t].isEstablished()&&!E.sessions[t].isOnHold().local)return D(n.target).then(function(e){e&&E.sessions[t].refer(e,{eventHandlers:{requestSucceeded:L(E.sessions[t],"requestSucceeded","top right",3e3),requestFailed:L(E.sessions[t],"requestFailed","top right",3e3)}})})}),p.$on("$destroy",function(){y.debug("$destroy event fired"),r.removeAllListeners("webbar:originate"),r.removeAllListeners("webbar:hangup"),r.removeAllListeners("webbar:answer"),r.removeAllListeners("webbar:hold"),r.removeAllListeners("webbar:unhold"),r.removeAllListeners("webbar:transfer"),r.removeAllListeners("webbar:stopmonitors")})}e.$inject=["$scope","$document","$timeout","$interval","$mdDialog","$mdToast","$window","$translate","$http","$q","toasty","api","motNotification","Auth","socket","privacyManager","ClientSideLoggingService"],angular.module("app.core").controller("MsPhonebarController",e).directive("msPhonebar",function(){return{restrict:"E",scope:{conf:"=",sessions:"="},require:"msPhonebar",controller:"MsPhonebarController",controllerAs:"vm_pb",bindToController:!0,templateUrl:"assets/ms-phonebar/ms-phonebar.html"}})}(),function(){"use strict";function e(n,e,t){var a=this;a.prefixes=e,a.required=t,a.closeDialog=function(e){n.hide(e)},a.keyPress=function(e){13===e.keyCode&&this.call()},a.call=function(){n.hide(a.prefix)}}e.$inject=["$mdDialog","prefixes","required"],angular.module("app.core").controller("PrefixDialogController",e)}(),function(){"use strict";function e(i){return{restrict:"C",controller:["$scope","$element",function(e,n){function t(){n.css("display","inline"),i(a,1e3)}function a(){n.css("display","none"),i(t,1e3)}t()}],replace:!0}}function n(n,i,s,e,t){var o=this;function a(n,e){console.log("startMonitor");var t=i.defer(),a=(e||n.filename.replace(/^.*[\\\/]/,"")).split(".")[0];return s.rpc.startMonitor({uniqueid:o.session.uniqueid,filename:a,format:"wav"}).$promise.then(function(e){n.filename=a+".wav",n.mixmonitorid=e.mixmonitorid,n.status="rec",o.session.monitor=!0,t.resolve(n)}).catch(function(e){t.reject(e)}),t.promise}o.title="Record",o.sessions=e,o.session=t,o.closeDialog=function(){n.hide()},o.addRecording=function(){var e=n.prompt({skipHide:!0}).title("Start new recording").textContent("Type the file name.").placeholder("File name").ariaLabel("File name").initialValue(function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}()).ok("Start").cancel("Cancel");n.show(e).then(function(e){return a({},e)}).then(function(e){o.session.monitors.push(e)})},o.stop=function(n){return console.log("stopMonitor"),s.rpc.stopMonitor({uniqueid:o.session.uniqueid,mixmonitorid:n.mixmonitorid}).$promise.then(function(e){n.status="pause",o.session.monitor=_.includes(o.session.monitors,{status:"rec"})}).catch(function(e){console.error(e)})},o.start=a}e.$inject=["$timeout"],n.$inject=["$mdDialog","$q","api","sessions","session"],angular.module("app.core").directive("msBlink",e).controller("RecordDialogController",n)}(),function(){"use strict";function e(n,s,a,i,e){var o=this;function r(e,n,t,a,i){return console.debug("onTransferCallback -> session, textContent, position, delay",e,n,t,a),function(){s.show(s.simple().textContent(n).position(t).hideDelay(a)),e.terminate(),jabra&&i&&jabra.onHook(),l()}}function l(e){n.hide(e)}o.title="Refer Attended",o.sessions=a,o.session=i,o.isJabraEnabled=e,o.sessionTarget=null,a.length&&(o.target=a[0].user),o.closeDialog=l,o.transfer=function(){var e,n,t=_.find(a,function(e){if(e.user===o.target)return e});n=t.outgoing?(e=t,o.session):(e=o.session,t);n.refer(e.user,{replaces:e,eventHandlers:{requestSucceeded:r(i,"requestSucceeded","top right",3e3,o.isJabraEnabled),requestFailed:r(i,"requestFailed","top right",3e3,o.isJabraEnabled)}})}}e.$inject=["$mdDialog","$mdToast","sessions","session","isJabraEnabled"],angular.module("app.core").controller("ReferAttendedDialogController",e)}(),function(){"use strict";function e(e,s,n,t){var a=this;function i(e,n,t){var a;if(s[t]){if(a=_.find(e,function(e){return e.deviceId===s[t]}))return a.deviceId;var i=_.findIndex(e,function(e){return e.kind===n});if(0<=i)return e[i].deviceId}else(a=_.find(e,function(e){return e.kind===n}))&&(s[t]=a.deviceId);return s[t]||null}_.remove(n,function(e){return"audioinput"===e.kind&&("default"===e.deviceId||"communications"===e.deviceId)||"audiooutput"===e.kind&&("default"===e.deviceId||"communications"===e.deviceId)}),s.ringingId=i(n,"audiooutput","ringingId"),s.speakerId=i(n,"audiooutput","speakerId"),s.microphoneId=i(n,"audioinput","microphoneId"),s.ringingVolume=s.ringingVolume||.5,s.speakerVolume=s.speakerVolume||.5,s.microphoneVolume=s.microphoneVolume||1,s.ringingMute=s.ringingMute||!1,s.speakerMute=s.speakerMute||!1,s.microphoneMute=s.microphoneMute||!1,a.conf=angular.copy(s),a.devices=n,a.activeSessions=t,a.saveSettings=function(){e.hide(a.conf)},a.closeDialog=function(){e.hide()},a.isCompatibleBrowser=function(){return"chrome"===a.conf.browserName.toLowerCase()||"opera"===a.conf.browserName.toLowerCase()||"safari"===a.conf.browserName.toLowerCase()}}e.$inject=["$mdDialog","conf","devices","activeSessions"],angular.module("app.toolbar").controller("SettingsController",e)}(),function(){"use strict";function e(t,a){var i=this;function s(e){var n=e.key,t={param:i.query[n],resources:e.options,placeholder:e.placeholder,ngValue:e.ngValue};a.setPlaceholder(t).then(function(e){i.placeholders[n]=e})}i.pickerModels={},i.placeholders={},i.localizationMap=t.localizationMap,i.onMultiselectInit=function(e){s(e)},i.onDateRangeInit=function(e){var n=e.key;i.query[n]?i.pickerModels[n]=t.setSelectedDate(i.query[n]):i.pickerModels[n]={dateStart:null}},i.onMultiselectSelection=function(e,n){n&&(s(e),i.search())},i.onDateRangeSelection=function(e){var n=e.key;i.pickerModels[n].dateStart?!0===e.useFromToKeys?i.query[n]={from:moment(i.pickerModels[n].dateStart).utcOffset(0,!0).format(),to:moment(i.pickerModels[n].dateEnd).utcOffset(0,!0).add(23,"hours").add(59,"minutes").add(59,"seconds").format()}:i.query[n]={$gte:moment(i.pickerModels[n].dateStart).utcOffset(0,!0).format(),$lte:moment(i.pickerModels[n].dateEnd).utcOffset(0,!0).add(23,"hours").add(59,"minutes").add(59,"seconds").format()}:i.query[n]=void 0;i.search()},i.clearDate=function(e){var n=e.key;i.pickerModels[n]={dateStart:null},delete i.query[n],i.search()},i.clearSelection=function(e){var n=e.key,t=e.ngValue||"id";i.query[n]=!1===e.clearAll?[_.head(e.options)[t]]:[],s(e),i.search()},i.selectAll=function(e){var n=e.key,t=e.ngValue||"id";i.query[n]=_.map(e.options,t),s(e),i.search()}}function n(p,e){var g={localizationMap:e,setSelectedDate:function(e){var n=e.$gte?new Date(moment.utc(e.$gte).format("YYYY-MM-DD")):new Date(moment.utc(e.from).format("YYYY-MM-DD")),t=e.$lte?new Date(moment.utc(e.$lte).format("YYYY-MM-DD")):new Date(moment.utc(e.to).format("YYYY-MM-DD")),a={dateStart:new Date(n.getFullYear(),n.getMonth(),n.getDate()),dateEnd:new Date(t.getFullYear(),t.getMonth(),t.getDate())};return a.selectedTemplateName=(i=a,moment(i.dateStart).isSame(i.dateEnd)?(u=i,moment().startOf("day").isSame(u.dateStart)?g.localizationMap.Today:(m=i,moment().subtract(1,"days").startOf("day").isSame(m.dateStart)?g.localizationMap.Yesterday:p("date")(i.dateStart,"dd MMM yyyy"))):(c=i,moment().startOf("isoWeek").isSame(c.dateStart,"day")&&moment().endOf("isoWeek").isSame(c.dateEnd,"day")?g.localizationMap["This Week"]:(d=i,moment().subtract(1,"weeks").startOf("isoWeek").isSame(d.dateStart,"day")&&moment().subtract(1,"weeks").endOf("isoWeek").isSame(d.dateEnd,"day")?g.localizationMap["Last Week"]:(l=i,moment().startOf("month").isSame(l.dateStart,"day")&&moment().endOf("month").isSame(l.dateEnd,"day")?g.localizationMap["This Month"]:(r=i,moment().subtract(1,"months").startOf("month").isSame(r.dateStart,"day")&&moment().subtract(1,"months").endOf("month").isSame(r.dateEnd,"day")?g.localizationMap["Last Month"]:(o=i,moment().startOf("year").isSame(o.dateStart,"day")&&moment().endOf("year").isSame(o.dateEnd,"day")?g.localizationMap["This Year"]:(s=i,moment().subtract(1,"years").startOf("year").isSame(s.dateStart,"day")&&moment().subtract(1,"years").endOf("year").isSame(s.dateEnd,"day")?g.localizationMap["Last Year"]:p("date")(i.dateStart,"dd"+(i.dateStart.getMonth()!==i.dateEnd.getMonth()||i.dateStart.getFullYear()!==i.dateEnd.getFullYear()?" MMM":"")+(i.dateStart.getFullYear()!==i.dateEnd.getFullYear()?" yyyy":""))+" - "+p("date")(i.dateEnd,"dd MMM yyyy")))))))),a;var i,s,o,r,l,d,c,m,u}};return g}n.$inject=["$filter","dateFilterLocalizationFactory"],e.$inject=["dateRangeManager","quickFilterManager"],angular.module("app.core").directive("msQuickFilter",function(){return{restrict:"E",scope:{query:"=",filters:"=",search:"&"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-quick-filter/ms-quick-filter.html"}}).factory("dateRangeManager",n)}(),function(){"use strict";angular.module("app.core").directive("msRandomClass",function(){return{restrict:"A",scope:{msRandomClass:"="},link:function(e,n){var t=e.msRandomClass[Math.floor(Math.random()*e.msRandomClass.length)];n.addClass(t)}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{id:"=",model:"=",download:"="},replace:!0,link:function(n,e){var t=!1,a=document.createElement("audio");n.download||a.setAttribute("controlsList","nodownload"),a.setAttribute("preload","none"),a.setAttribute("controls",""),a.setAttribute("style","width: 265px;"),a.setAttribute("src"," "),a.onplay=function(e){t||(t=!0,e.preventDefault(),i[n.model||"voiceRecording"].download({id:n.id}).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type});a.setAttribute("type",e.type),a.setAttribute("src",URL.createObjectURL(t)),a.play()}).catch(function(e){console.error(e)}))},e.append(a)}}}e.$inject=["api"],angular.module("app.core").directive("msRecording",e)}(),function(){"use strict";angular.module("app.core").directive("msResponsiveTable",function(){return{restrict:"A",link:function(e,n){var t=angular.element('<div class="ms-responsive-table-wrapper"></div>');n.after(t),t.append(n)}}})}(),function(){"use strict";function e(n,i,s,e){var o=this;function t(){angular.isArray(o.onSearch)?a(o.onSearch):o.onResultClick?(o.resultsLoading=!0,n.$parent.$eval("vm.search(query)",{query:o.query.filter}).then(function(e){a(e)}).catch(function(){a([])}).finally(function(){o.resultsLoading=!1})):o.onSearch()}function a(e){o.expanded&&(void 0===e||angular.isArray(e)||null===e)&&(o.selectedResultIndex=0,o.results=e)}function r(){o.expanded=!0,o.displayOn=!0,n.expand()}function l(e){!1!==e&&(o.query.filter=void 0,o.onResultClick?a(null):t()),o.expanded=!1,n.collapse()}function d(e){o.onResultClick&&o.onResultClick({item:e}),l()}function c(){var e=i.find(".ms-search-bar-results"),n=angular.element(e.find(".result")[o.selectedResultIndex]);if(e&&n){var t=n.position().top-8,a=n.position().top+n.outerHeight()+8;o.ignoreMouseEvents=!0,s.cancel(o.mouseEventIgnoreTimeout),o.mouseEventIgnoreTimeout=s(function(){o.ignoreMouseEvents=!1},250),e.scrollTop()>t&&e.scrollTop(t),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}}o.queryOptions={debounce:o.debounce||0},o.searchOnEnterKey=e.get().searchOnEnterKey||!1,o.resultsLoading=!1,o.results=null,o.selectedResultIndex=0,o.ignoreMouseEvents=!1,o.expandBar=r,o.collapseBar=l,o.blurCollapse=function(){if(!o.collapseOnBlur)return;l()},o.onKeyDown=function(e){var n=e.keyCode;-1<[27,38,40].indexOf(n)&&e.preventDefault();switch(n){case 13:if(!o.onResultClick)return t();if(!o.results)return;d(o.results[o.selectedResultIndex]);break;case 27:l();break;case 38:0<=o.selectedResultIndex-1&&(o.selectedResultIndex--,c());break;case 40:if(!o.results)return;o.selectedResultIndex+1<o.results.length&&(o.selectedResultIndex++,c())}},o.absorbEvent=function(e){e.preventDefault()},o.handleMouseenter=function(e){if(o.ignoreMouseEvents)return;o.selectedResultIndex=e},o.handleResultClick=d,n.$watch("vm.displayOn",function(e){angular.isUndefined(e)||(!0!==e||o.expanded?e||!1===o.expanded||l(!1):r())}),n.$watch("vm.query.filter",function(e,n){if(!angular.isUndefined(e)&&0!==e.length&&!angular.equals(e,n)&&!1!==o.displayOn){if(o.expanded){if(!0===o.searchOnEnterKey&&!o.onResultClick)return;if(o.minChars&&o.minChars>e.length)return}else r();t()}})}function n(a){return{restrict:"E",scope:{query:"=?",debounce:"=?",direction:"@",iconColor:"@",onSearch:"&",onResultClick:"&?",onExpand:"&?",onCollapse:"&?",collapseOnBlur:"<?",minChars:"<?",displayOn:"=?"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-search-bar/ms-search-bar.html",compile:function(e){return e.addClass("ms-search-bar"),{post:function(n,t){n.collapse=function(){if(t.removeClass("expanded"),"down"===n.vm.direction){t.removeClass("down");var e=t.closest("md-toolbar");e&&e.removeClass("h-128")}a.find("body").removeClass("ms-search-bar-expanded")},n.expand=function(){if(t.addClass("expanded"),"down"===n.vm.direction){t.addClass("down");var e=t.closest("md-toolbar");e&&e.addClass("h-128")}a.find("body").addClass("ms-search-bar-expanded")}}}}}}e.$inject=["$scope","$element","$timeout","settingsManager"],n.$inject=["$document"],angular.module("app.core").controller("MsSearchBarController",e).directive("msSearchBar",n)}(),function(){"use strict";function e(e,t,i,o,r,l){var d=this;d.query="",d.queryOptions={debounce:300},d.resultsLoading=!1,d.selectedResultIndex=0,d.ignoreMouseEvents=!1,d.mobileBarActive=!1,d.results=null,d.shortcuts=[],d.sortableOptions={ghostClass:"ghost",forceFallback:!0,fallbackClass:"dragging",onSort:function(){d.saveShortcuts()}},d.populateResults=function(){for(var e=[],n=l.getFlatNavigation(),t=r.defer(),a=0;a<n.length;a++)n[a].uisref&&e.push(n[a]);if(d.query){e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(d.query)))return!0});for(var i=0;i<e.length;i++){e[i].hasShortcut=!1;for(var s=0;s<d.shortcuts.length;s++)if(d.shortcuts[s]._id===e[i]._id){e[i].hasShortcut=!0;break}}}else 0<d.shortcuts.length&&(e=d.shortcuts);return d.selectedResultIndex=0,o(function(){t.resolve(e)},250),t.promise},d.loadShortcuts=function(){var e=r.defer(),n=angular.fromJson(t.get("motion.shortcuts"));angular.isUndefined(n)&&(n=[{title:"Agents",icon:"icon-account-multiple",state:"app.staff.agents",weight:5,children:[],uisref:"app.staff.agents",hasShortcut:!0},{title:"License",icon:"icon-cog",state:"app.settings.license",weight:10,children:[],uisref:"app.settings.license",hasShortcut:!0}],t.put("motion.shortcuts",angular.toJson(n)));return e.resolve(n),e.promise},d.saveShortcuts=function(){var e=r.defer();return t.put("motion.shortcuts",angular.toJson(d.shortcuts)),o(function(){e.resolve({success:!0})},250),e.promise},d.addShortcut=function(e){e.hasShortcut=!0,d.shortcuts.push(e),d.saveShortcuts()},d.removeShortcut=function(e){e.hasShortcut=!1;for(var n=0;n<d.shortcuts.length;n++)d.shortcuts[n]._id===e._id&&(d.shortcuts.splice(n,1),d.query||(0===d.shortcuts.length?d.results=null:n>=d.shortcuts.length&&(d.selectedResultIndex=d.shortcuts.length-1)));d.saveShortcuts()},d.handleResultClick=function(e){e.hasShortcut?d.removeShortcut(e):d.addShortcut(e)},d.absorbEvent=function(e){e.preventDefault()},d.handleKeydown=function(e){var n=e.keyCode;-1<[38,40].indexOf(n)&&e.preventDefault();switch(n){case 13:d.handleResultClick(d.results[d.selectedResultIndex]);break;case 38:0<=d.selectedResultIndex-1&&(d.selectedResultIndex--,d.ensureSelectedResultIsVisible());break;case 40:d.selectedResultIndex+1<d.results.length&&(d.selectedResultIndex++,d.ensureSelectedResultIsVisible())}},d.handleMouseenter=function(e){if(d.ignoreMouseEvents)return;d.selectedResultIndex=e},d.temporarilyIgnoreMouseEvents=function(){d.ignoreMouseEvents=!0,o.cancel(d.mouseEventIgnoreTimeout),d.mouseEventIgnoreTimeout=o(function(){d.ignoreMouseEvents=!1},250)},d.ensureSelectedResultIsVisible=function(){var e=i.find("#ms-shortcut-add-menu").find(".results"),n=angular.element(e.find(".result")[d.selectedResultIndex]);if(e&&n){var t=n.position().top-8,a=n.position().top+n.outerHeight()+8;d.temporarilyIgnoreMouseEvents(),e.scrollTop()>t&&e.scrollTop(t),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},d.toggleMobileBar=function(){d.mobileBarActive=!d.mobileBarActive},d.loadShortcuts().then(function(e){d.shortcuts=e,0<d.shortcuts.length&&(d.results=e)}),e.$watch("MsShortcuts.query",function(e,n){angular.isUndefined(e)||angular.equals(e,n)||(d.resultsLoading=!0,d.populateResults().then(function(e){d.results=e},function(){d.results=[]}).finally(function(){d.resultsLoading=!1}))})}e.$inject=["$scope","$cookies","$document","$timeout","$q","msNavigationService"],angular.module("app.core").controller("MsShortcutsController",e).directive("msShortcuts",function(){return{restrict:"E",scope:{},require:"msShortcuts",controller:"MsShortcutsController as MsShortcuts",bindToController:{},templateUrl:"app/core/directives/ms-shortcuts/ms-shortcuts.html",compile:function(e){return e.addClass("ms-shortcuts"),function(e,n){}}}})}(),function(){"use strict";angular.module("app.core").directive("msSidenavHelper",function(){return{restrict:"A",require:"^mdSidenav",link:function(e,n,t,a){e.$watch(function(){return a.isOpen()&&!a.isLockedOpen()},function(e){angular.isUndefined(e)||(n.parent().toggleClass("full-height",e),angular.element("html").toggleClass("sidenav-open",e))})}}})}(),function(){"use strict";function e(a){return{restrict:"E",link:function(e,n){var t=e.$on("msSplashScreen::remove",function(){a.leave(n).then(function(){t(),e=n=null})})}}}e.$inject=["$animate"],angular.module("app.core").directive("msSplashScreen",e)}(),function(){"use strict";function e(e){var i=this;function n(){i.setCurrentStep(1)}function t(e){return o(e)?i.steps[e-1].scope.optionalStep:null}function a(e){return o(e)?!!i.steps[e-1].scope.hideStep:null}function s(e){return o(e)?!!t(e)||i.steps[e-1].form.$valid:null}function o(e){return!(angular.isUndefined(e)||e<1||e>i.steps.length)}i.mainForm=void 0,i.orientation="horizontal",i.steps=[],i.currentStep=void 0,i.currentStepNumber=1,i.setOrientation=function(e){i.orientation=e||"horizontal"},i.registerMainForm=function(e){i.mainForm=e},i.registerStep=function(e,n,t){var a={element:e,scope:n,form:t,stepNumber:n.step||i.steps.length+1,stepTitle:n.stepTitle,stepTitleTranslate:n.stepTitleTranslate};return i.steps.push(a),i.steps.sort(function(e,n){return e.stepNumber-n.stepNumber}),a},i.setupSteps=function(){i.setCurrentStep(i.currentStepNumber)},i.resetForm=function(){e(function(){for(var e=0;e<i.steps.length;e++)i.steps[e].form.$setPristine(),i.steps[e].form.$setUntouched();i.mainForm.$setPristine(),i.mainForm.$setUntouched(),n()})},i.setCurrentStep=function(e){if(!o(e))return;if(i.currentStepNumber=e,"horizontal"===i.orientation){for(var n=0;n<i.steps.length;n++)i.steps[n].element.hide();i.steps[i.currentStepNumber-1].element.show()}else if("vertical"===i.orientation){for(var t=0;t<i.steps.length;t++)i.steps[t].element.find(".ms-stepper-step-content").hide();i.steps[i.currentStepNumber-1].element.find(".ms-stepper-step-content").show()}},i.gotoStep=function(e){if(a(e))return;i.setCurrentStep(e)},i.gotoPreviousStep=function(){for(var e=i.currentStepNumber-1,n=e;1<=n;n--)if(!a(n)){e=n;break}i.setCurrentStep(e)},i.gotoNextStep=function(){for(var e=i.currentStepNumber+1,n=e;n<=i.steps.length;n++)if(!a(n)){e=n;break}i.setCurrentStep(e)},i.gotoFirstStep=n,i.gotoLastStep=function(){i.setCurrentStep(i.steps.length)},i.isFirstStep=function(){return 1===i.currentStepNumber},i.isLastStep=function(){return i.currentStepNumber===i.steps.length},i.isStepCurrent=function(e){return o(e)?i.currentStepNumber===e:null},i.isStepDisabled=function(e){if(!o(e))return null;for(var n=!1,t=1;t<e;t++)if(!s(t)){n=!0;break}return n},i.isStepOptional=t,i.isStepHidden=a,i.filterHiddenStep=function(e){return!a(e.stepNumber)},i.isStepValid=s,i.isStepNumberValid=o,i.isFormValid=function(){return i.mainForm.$valid}}function n(o){return{restrict:"A",scope:{},require:["form","msVerticalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/vertical.html",compile:function(e){return e.addClass("ms-stepper"),function(e,n,t,a){var i=a[0],s=a[1];o(function(){s.setOrientation("vertical"),s.registerMainForm(i),s.setupSteps()})}}}}e.$inject=["$timeout"],n.$inject=["$timeout"],angular.module("app.core").controller("MsStepperController",e).directive("msHorizontalStepper",function(){return{restrict:"A",scope:{},require:["form","msHorizontalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/horizontal/horizontal.html",compile:function(e){return e.addClass("ms-stepper"),function(e,n,t,a){var i=a[0],s=a[1];s.setOrientation("horizontal"),s.registerMainForm(i),s.setupSteps()}}}}).directive("msHorizontalStepperStep",function(){return{restrict:"E",require:["form","^msHorizontalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},compile:function(e){return e.addClass("ms-stepper-step"),function(e,n,t,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(t.optionalStep),s.registerStep(n,e,i),n.hide()}}}}).directive("msVerticalStepper",n).directive("msVerticalStepperStep",function(){return{restrict:"E",require:["form","^msVerticalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",compile:function(e){return e.addClass("ms-stepper-step"),function(e,n,t,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(t.optionalStep),e.stepInfo=s.registerStep(n,e,i),e.MsStepper=s,n.find(".ms-stepper-step-content").hide()}}}})}(),function(){"use strict";function e(e){return{restrict:"E",scope:{},transclude:!0,controller:"MsTabScrollController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-tab-scroll/ms-tab-scroll.html",compile:function(e){return e.addClass("ms-tab-scroll"),function(e,n){}}}}e.$inject=["$document"],angular.module("app.core").controller("MsTabScrollController",function(){function n(){var e=document.getElementById("bar-container"),n=document.getElementById("tab-container");return n.scrollWidth>e.scrollWidth&&0==e.scrollLeft&&0==n.scrollLeft?"right":n.scrollWidth>e.scrollWidth&&n.scrollLeft>e.scrollLeft&&e.scrollWidth+n.scrollLeft>=n.scrollWidth?"left":n.scrollWidth>e.scrollWidth&&n.scrollLeft>e.scrollLeft&&e.scrollWidth+n.scrollLeft<n.scrollWidth?"both":"none"}this.onTabScroll=function(e){"left"==e?$("#tab-container").stop().animate({scrollLeft:"-=400"},1e3):$("#tab-container").stop().animate({scrollLeft:"+=400"},1e3)},this.canScroll=function(e){switch(n()){case"both":return!0;case"left":return"left"==e;case"right":return"right"==e;case"none":default:return!1}}}).directive("msTabScroll",e)}(),function(){"use strict";function e(m,u){return{scope:!0,require:"^msTimeline",compile:function(e){return e.addClass("ms-timeline-item").addClass("hidden"),function(e,t,n,a){var i=72,s=!1,o=!1,r=a.getScrollEl();!function(){t.find("ms-card")?e.$on("msCard::cardTemplateLoaded",function(e,n){var t=angular.element(n[0]);d(t).then(function(){m(function(){s=!0})})}):d(t).then(function(){m(function(){s=!0})});r.on("scroll",c),c()}();var l=e.$watch(function(){return s&&o},function(e,n){angular.equals(e,n)||e&&(t.removeClass("hidden").addClass("animate"),l())},!0);function d(e){var n=u.defer(),t=e.find("img");return 0<t.length?t.on("load",function(){n.resolve("Image is loaded")}):n.resolve("No images"),n.promise}function c(){r.scrollTop()+r.height()>t.position().top+i&&(m(function(){o=!0}),r.off("scroll",c))}}}}}e.$inject=["$timeout","$q"],angular.module("app.core").controller("MsTimelineController",function(){var n=this;n.scrollEl=void 0,n.setScrollEl=function(e){n.scrollEl=e},n.getScrollEl=function(){return n.scrollEl}}).directive("msTimeline",function(){return{scope:{msTimeline:"=?",loadMore:"&?msTimelineLoadMore"},controller:"MsTimelineController",compile:function(e){return e.addClass("ms-timeline"),function(e,n,t,a){var i=angular.element('<div class="ms-timeline-loader md-accent-bg md-whiteframe-4dp"><span class="spinner"></span></div>');n.append(i);var s={scrollEl:"#content"};s=angular.extend(s,e.msTimeline,{});var o=angular.element(s.scrollEl);a.setScrollEl(o);var r=144;function l(){o.scrollTop()+o.height()+r>i.position().top&&(i.addClass("show"),c(),e.loadMore&&e.loadMore().then(function(){i.removeClass("show"),d()},function(){i.remove()}))}function d(){o.on("scroll",l)}function c(){o.off("scroll",l)}d(),e.$on("$destroy",function(){c()})}}}}).directive("msTimelineItem",e)}(),function(){"use strict";function e(a,e,n,i,t){var r=this;function s(){!function(){r.millis=l().diff(moment(r.startingTime));var e=moment.duration(r.millis),n=e.seconds(),t=e.minutes(),a=e.hours(),i=e.days(),s=e.months(),o=e.years();r.seconds=n<10?"0"+n:n,r.minutes=t<10?"0"+t:t,r.hours=a<10?"0"+a:a,r.days=i<10?"0"+i:i,r.months=s<10?"0"+s:s,r.years=o<10?"0"+o:o,r.timer=0<r.days?r.days+"d ":r.hours+":"+r.minutes+":"+r.seconds}(),r.timeoutId=setTimeout(function(){s(),a.$digest()},r.interval)}function l(e){var n=(e||moment()).utcOffset(a.serverDateOffset).format("YYYY-MM-DD HH:mm:ss");return moment(n)}function o(){n(function(n,t){try{if(a.serverDateOffset)return void n(l());i.setting.getDate().$promise.then(function(e){a.serverDateOffset=e.offset,n(moment(e.now))})}catch(e){t(e)}}).then(function(e){var n=r.startTime?moment(r.startTime):void 0;r.startTime?n.isAfter(e,"hour")||n.isBefore(e,"hour")?r.startingTime=l(n):r.startingTime=n:r.startingTime=e,s()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.getDate",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}o(),a.$watch("vm.startTime",function(e,n){angular.isUndefined(e)||0!==e.length&&(angular.equals(e,n)||o())}),a.$on("timer-start",function(){r.startTime=void 0,o()}),e.bind("$destroy",function(){r.timeoutId&&clearTimeout(r.timeoutId)})}e.$inject=["$scope","$element","$q","api","toasty"],angular.module("app.core").directive("timer",function(){return{restrict:"EA",replace:!1,scope:{startTime:"=?",interval:"=?"},template:"<span ng-cloak>{{ vm.timer }}</span>",compile:function(){return{pre:function(e,n,t){e.interval=t.interval||1e3}}},controller:e,controllerAs:"vm",bindToController:!0}})}(),function(){"use strict";angular.module("app.core").directive("msTimezone",function(){return{restrict:"E",scope:{ngModel:"=",ngChange:"&"},controller:["$scope",function(e){e.timezone=[{name:"Europe/Andorra",utcOffset:60,offsetStr:"+01:00",countries:["AD"]},{name:"Asia/Dubai",utcOffset:240,offsetStr:"+04:00",countries:["AE","OM"]},{name:"Asia/Kabul",utcOffset:270,offsetStr:"+04:30",countries:["AF"]},{name:"Europe/Tirane",utcOffset:60,offsetStr:"+01:00",countries:["AL"]},{name:"Asia/Yerevan",utcOffset:240,offsetStr:"+04:00",countries:["AM"]},{name:"Antarctica/Rothera",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Palmer",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Mawson",utcOffset:300,offsetStr:"+05:00",countries:["AQ"]},{name:"Antarctica/Davis",utcOffset:420,offsetStr:"+07:00",countries:["AQ"]},{name:"Antarctica/Casey",utcOffset:480,offsetStr:"+08:00",countries:["AQ"]},{name:"Antarctica/Vostok",utcOffset:360,offsetStr:"+06:00",countries:["AQ"]},{name:"Antarctica/DumontDUrville",utcOffset:600,offsetStr:"+10:00",countries:["AQ"]},{name:"Antarctica/Syowa",utcOffset:180,offsetStr:"+03:00",countries:["AQ"]},{name:"Antarctica/Troll",utcOffset:0,offsetStr:"+00:00",countries:["AQ"]},{name:"America/Argentina/Buenos_Aires",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Cordoba",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Salta",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Jujuy",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Tucuman",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Catamarca",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/La_Rioja",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Juan",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Mendoza",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Luis",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Rio_Gallegos",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Ushuaia",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"Pacific/Pago_Pago",utcOffset:-660,offsetStr:"-11:00",countries:["AS","UM"]},{name:"Europe/Vienna",utcOffset:60,offsetStr:"+01:00",countries:["AT"]},{name:"Australia/Lord_Howe",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Antarctica/Macquarie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Hobart",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Currie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Melbourne",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Sydney",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Broken_Hill",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Brisbane",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Lindeman",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Adelaide",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Darwin",utcOffset:570,offsetStr:"+09:30",countries:["AU"]},{name:"Australia/Perth",utcOffset:480,offsetStr:"+08:00",countries:["AU"]},{name:"Australia/Eucla",utcOffset:525,offsetStr:"+08:45",countries:["AU"]},{name:"Asia/Baku",utcOffset:240,offsetStr:"+04:00",countries:["AZ"]},{name:"America/Barbados",utcOffset:-240,offsetStr:"-04:00",countries:["BB"]},{name:"Asia/Dhaka",utcOffset:360,offsetStr:"+06:00",countries:["BD"]},{name:"Europe/Brussels",utcOffset:60,offsetStr:"+01:00",countries:["BE"]},{name:"Europe/Sofia",utcOffset:120,offsetStr:"+02:00",countries:["BG"]},{name:"Atlantic/Bermuda",utcOffset:-240,offsetStr:"-04:00",countries:["BM"]},{name:"Asia/Brunei",utcOffset:480,offsetStr:"+08:00",countries:["BN"]},{name:"America/La_Paz",utcOffset:-240,offsetStr:"-04:00",countries:["BO"]},{name:"America/Noronha",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Belem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Fortaleza",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Recife",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Araguaina",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Maceio",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Bahia",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Sao_Paulo",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Campo_Grande",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Cuiaba",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Santarem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Porto_Velho",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Boa_Vista",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Manaus",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Eirunepe",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Rio_Branco",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Nassau",utcOffset:-300,offsetStr:"-05:00",countries:["BS"]},{name:"Asia/Thimphu",utcOffset:360,offsetStr:"+06:00",countries:["BT"]},{name:"Europe/Minsk",utcOffset:180,offsetStr:"+03:00",countries:["BY"]},{name:"America/Belize",utcOffset:-360,offsetStr:"-06:00",countries:["BZ"]},{name:"America/St_Johns",utcOffset:-210,offsetStr:"-03:30",countries:["CA"]},{name:"America/Halifax",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Glace_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Moncton",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Goose_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Blanc-Sablon",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Toronto",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Nipigon",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Thunder_Bay",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Iqaluit",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Pangnirtung",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Resolute",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Atikokan",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Rankin_Inlet",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Winnipeg",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Rainy_River",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Regina",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Swift_Current",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Edmonton",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Cambridge_Bay",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Yellowknife",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Inuvik",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Creston",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Dawson_Creek",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Fort_Nelson",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Vancouver",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Whitehorse",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Dawson",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"Indian/Cocos",utcOffset:390,offsetStr:"+06:30",countries:["CC"]},{name:"Europe/Zurich",utcOffset:60,offsetStr:"+01:00",countries:["CH","DE","LI"]},{name:"Africa/Abidjan",utcOffset:0,offsetStr:"+00:00",countries:["CI","BF","GM","GN","ML","MR","SH","SL","SN","ST","TG"]},{name:"Pacific/Rarotonga",utcOffset:-600,offsetStr:"-10:00",countries:["CK"]},{name:"America/Santiago",utcOffset:-180,offsetStr:"-03:00",countries:["CL"]},{name:"Pacific/Easter",utcOffset:-300,offsetStr:"-05:00",countries:["CL"]},{name:"Asia/Shanghai",utcOffset:480,offsetStr:"+08:00",countries:["CN"]},{name:"Asia/Urumqi",utcOffset:360,offsetStr:"+06:00",countries:["CN"]},{name:"America/Bogota",utcOffset:-300,offsetStr:"-05:00",countries:["CO"]},{name:"America/Costa_Rica",utcOffset:-360,offsetStr:"-06:00",countries:["CR"]},{name:"America/Havana",utcOffset:-300,offsetStr:"-05:00",countries:["CU"]},{name:"Atlantic/Cape_Verde",utcOffset:-60,offsetStr:"-01:00",countries:["CV"]},{name:"America/Curacao",utcOffset:-240,offsetStr:"-04:00",countries:["CW","AW","BQ","SX"]},{name:"Indian/Christmas",utcOffset:420,offsetStr:"+07:00",countries:["CX"]},{name:"Asia/Nicosia",utcOffset:120,offsetStr:"+02:00",countries:["CY"]},{name:"Europe/Prague",utcOffset:60,offsetStr:"+01:00",countries:["CZ","SK"]},{name:"Europe/Berlin",utcOffset:60,offsetStr:"+01:00",countries:["DE"]},{name:"Europe/Copenhagen",utcOffset:60,offsetStr:"+01:00",countries:["DK"]},{name:"America/Santo_Domingo",utcOffset:-240,offsetStr:"-04:00",countries:["DO"]},{name:"Africa/Algiers",utcOffset:60,offsetStr:"+01:00",countries:["DZ"]},{name:"America/Guayaquil",utcOffset:-300,offsetStr:"-05:00",countries:["EC"]},{name:"Pacific/Galapagos",utcOffset:-360,offsetStr:"-06:00",countries:["EC"]},{name:"Europe/Tallinn",utcOffset:120,offsetStr:"+02:00",countries:["EE"]},{name:"Africa/Cairo",utcOffset:120,offsetStr:"+02:00",countries:["EG"]},{name:"Africa/El_Aaiun",utcOffset:0,offsetStr:"+00:00",countries:["EH"]},{name:"Europe/Madrid",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Africa/Ceuta",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Atlantic/Canary",utcOffset:0,offsetStr:"+00:00",countries:["ES"]},{name:"Europe/Helsinki",utcOffset:120,offsetStr:"+02:00",countries:["FI","AX"]},{name:"Pacific/Fiji",utcOffset:720,offsetStr:"+12:00",countries:["FJ"]},{name:"Atlantic/Stanley",utcOffset:-180,offsetStr:"-03:00",countries:["FK"]},{name:"Pacific/Chuuk",utcOffset:600,offsetStr:"+10:00",countries:["FM"]},{name:"Pacific/Pohnpei",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Pacific/Kosrae",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Atlantic/Faroe",utcOffset:0,offsetStr:"+00:00",countries:["FO"]},{name:"Europe/Paris",utcOffset:60,offsetStr:"+01:00",countries:["FR"]},{name:"Europe/London",utcOffset:0,offsetStr:"+00:00",countries:["GB","GG","IM","JE"]},{name:"Asia/Tbilisi",utcOffset:240,offsetStr:"+04:00",countries:["GE"]},{name:"America/Cayenne",utcOffset:-180,offsetStr:"-03:00",countries:["GF"]},{name:"Africa/Accra",utcOffset:0,offsetStr:"+00:00",countries:["GH"]},{name:"Europe/Gibraltar",utcOffset:60,offsetStr:"+01:00",countries:["GI"]},{name:"America/Godthab",utcOffset:-180,offsetStr:"-03:00",countries:["GL"]},{name:"America/Danmarkshavn",utcOffset:0,offsetStr:"+00:00",countries:["GL"]},{name:"America/Scoresbysund",utcOffset:-60,offsetStr:"-01:00",countries:["GL"]},{name:"America/Thule",utcOffset:-240,offsetStr:"-04:00",countries:["GL"]},{name:"Europe/Athens",utcOffset:120,offsetStr:"+02:00",countries:["GR"]},{name:"Atlantic/South_Georgia",utcOffset:-120,offsetStr:"-02:00",countries:["GS"]},{name:"America/Guatemala",utcOffset:-360,offsetStr:"-06:00",countries:["GT"]},{name:"Pacific/Guam",utcOffset:600,offsetStr:"+10:00",countries:["GU","MP"]},{name:"Africa/Bissau",utcOffset:0,offsetStr:"+00:00",countries:["GW"]},{name:"America/Guyana",utcOffset:-240,offsetStr:"-04:00",countries:["GY"]},{name:"Asia/Hong_Kong",utcOffset:480,offsetStr:"+08:00",countries:["HK"]},{name:"America/Tegucigalpa",utcOffset:-360,offsetStr:"-06:00",countries:["HN"]},{name:"America/Port-au-Prince",utcOffset:-300,offsetStr:"-05:00",countries:["HT"]},{name:"Europe/Budapest",utcOffset:60,offsetStr:"+01:00",countries:["HU"]},{name:"Asia/Jakarta",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Pontianak",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Makassar",utcOffset:480,offsetStr:"+08:00",countries:["ID"]},{name:"Asia/Jayapura",utcOffset:540,offsetStr:"+09:00",countries:["ID"]},{name:"Europe/Dublin",utcOffset:0,offsetStr:"+00:00",countries:["IE"]},{name:"Asia/Jerusalem",utcOffset:120,offsetStr:"+02:00",countries:["IL"]},{name:"Asia/Kolkata",utcOffset:330,offsetStr:"+05:30",countries:["IN"]},{name:"Indian/Chagos",utcOffset:360,offsetStr:"+06:00",countries:["IO"]},{name:"Asia/Baghdad",utcOffset:180,offsetStr:"+03:00",countries:["IQ"]},{name:"Asia/Tehran",utcOffset:210,offsetStr:"+03:30",countries:["IR"]},{name:"Atlantic/Reykjavik",utcOffset:0,offsetStr:"+00:00",countries:["IS"]},{name:"Europe/Rome",utcOffset:60,offsetStr:"+01:00",countries:["IT","SM","VA"]},{name:"America/Jamaica",utcOffset:-300,offsetStr:"-05:00",countries:["JM"]},{name:"Asia/Amman",utcOffset:120,offsetStr:"+02:00",countries:["JO"]},{name:"Asia/Tokyo",utcOffset:540,offsetStr:"+09:00",countries:["JP"]},{name:"Africa/Nairobi",utcOffset:180,offsetStr:"+03:00",countries:["KE","DJ","ER","ET","KM","MG","SO","TZ","UG","YT"]},{name:"Asia/Bishkek",utcOffset:360,offsetStr:"+06:00",countries:["KG"]},{name:"Pacific/Tarawa",utcOffset:720,offsetStr:"+12:00",countries:["KI"]},{name:"Pacific/Enderbury",utcOffset:780,offsetStr:"+13:00",countries:["KI"]},{name:"Pacific/Kiritimati",utcOffset:840,offsetStr:"+14:00",countries:["KI"]},{name:"Asia/Pyongyang",utcOffset:510,offsetStr:"+08:30",countries:["KP"]},{name:"Asia/Seoul",utcOffset:540,offsetStr:"+09:00",countries:["KR"]},{name:"America/Cayman",utcOffset:-300,offsetStr:"-05:00",countries:["KY"]},{name:"Asia/Almaty",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Qyzylorda",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Aqtobe",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Aqtau",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Oral",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Beirut",utcOffset:120,offsetStr:"+02:00",countries:["LB"]},{name:"Asia/Colombo",utcOffset:330,offsetStr:"+05:30",countries:["LK"]},{name:"Africa/Monrovia",utcOffset:0,offsetStr:"+00:00",countries:["LR"]},{name:"Europe/Vilnius",utcOffset:120,offsetStr:"+02:00",countries:["LT"]},{name:"Europe/Luxembourg",utcOffset:60,offsetStr:"+01:00",countries:["LU"]},{name:"Europe/Riga",utcOffset:120,offsetStr:"+02:00",countries:["LV"]},{name:"Africa/Tripoli",utcOffset:120,offsetStr:"+02:00",countries:["LY"]},{name:"Africa/Casablanca",utcOffset:0,offsetStr:"+00:00",countries:["MA"]},{name:"Europe/Monaco",utcOffset:60,offsetStr:"+01:00",countries:["MC"]},{name:"Europe/Chisinau",utcOffset:120,offsetStr:"+02:00",countries:["MD"]},{name:"Pacific/Majuro",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Pacific/Kwajalein",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Asia/Rangoon",utcOffset:390,offsetStr:"+06:30",countries:["MM"]},{name:"Asia/Ulaanbaatar",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Hovd",utcOffset:420,offsetStr:"+07:00",countries:["MN"]},{name:"Asia/Choibalsan",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Macau",utcOffset:480,offsetStr:"+08:00",countries:["MO"]},{name:"America/Martinique",utcOffset:-240,offsetStr:"-04:00",countries:["MQ"]},{name:"Europe/Malta",utcOffset:60,offsetStr:"+01:00",countries:["MT"]},{name:"Indian/Mauritius",utcOffset:240,offsetStr:"+04:00",countries:["MU"]},{name:"Indian/Maldives",utcOffset:300,offsetStr:"+05:00",countries:["MV"]},{name:"America/Mexico_City",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Cancun",utcOffset:-300,offsetStr:"-05:00",countries:["MX"]},{name:"America/Merida",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Monterrey",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Matamoros",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Mazatlan",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Chihuahua",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Ojinaga",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Hermosillo",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Tijuana",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Santa_Isabel",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Bahia_Banderas",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"Asia/Kuala_Lumpur",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Asia/Kuching",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Africa/Maputo",utcOffset:120,offsetStr:"+02:00",countries:["MZ","BI","BW","CD","MW","RW","ZM","ZW"]},{name:"Africa/Windhoek",utcOffset:120,offsetStr:"+02:00",countries:["NA"]},{name:"Pacific/Noumea",utcOffset:660,offsetStr:"+11:00",countries:["NC"]},{name:"Pacific/Norfolk",utcOffset:660,offsetStr:"+11:00",countries:["NF"]},{name:"Africa/Lagos",utcOffset:60,offsetStr:"+01:00",countries:["NG","AO","BJ","CD","CF","CG","CM","GA","GQ","NE"]},{name:"America/Managua",utcOffset:-360,offsetStr:"-06:00",countries:["NI"]},{name:"Europe/Amsterdam",utcOffset:60,offsetStr:"+01:00",countries:["NL"]},{name:"Europe/Oslo",utcOffset:60,offsetStr:"+01:00",countries:["NO","SJ"]},{name:"Asia/Kathmandu",utcOffset:345,offsetStr:"+05:45",countries:["NP"]},{name:"Pacific/Nauru",utcOffset:720,offsetStr:"+12:00",countries:["NR"]},{name:"Pacific/Niue",utcOffset:-660,offsetStr:"-11:00",countries:["NU"]},{name:"Pacific/Auckland",utcOffset:780,offsetStr:"+13:00",countries:["NZ","AQ"]},{name:"Pacific/Chatham",utcOffset:825,offsetStr:"+13:45",countries:["NZ"]},{name:"America/Panama",utcOffset:-300,offsetStr:"-05:00",countries:["PA"]},{name:"America/Lima",utcOffset:-300,offsetStr:"-05:00",countries:["PE"]},{name:"Pacific/Tahiti",utcOffset:-600,offsetStr:"-10:00",countries:["PF"]},{name:"Pacific/Marquesas",utcOffset:-570,offsetStr:"-09:30",countries:["PF"]},{name:"Pacific/Gambier",utcOffset:-540,offsetStr:"-09:00",countries:["PF"]},{name:"Pacific/Port_Moresby",utcOffset:600,offsetStr:"+10:00",countries:["PG"]},{name:"Pacific/Bougainville",utcOffset:660,offsetStr:"+11:00",countries:["PG"]},{name:"Asia/Manila",utcOffset:480,offsetStr:"+08:00",countries:["PH"]},{name:"Asia/Karachi",utcOffset:300,offsetStr:"+05:00",countries:["PK"]},{name:"Europe/Warsaw",utcOffset:60,offsetStr:"+01:00",countries:["PL"]},{name:"America/Miquelon",utcOffset:-180,offsetStr:"-03:00",countries:["PM"]},{name:"Pacific/Pitcairn",utcOffset:-480,offsetStr:"-08:00",countries:["PN"]},{name:"America/Puerto_Rico",utcOffset:-240,offsetStr:"-04:00",countries:["PR"]},{name:"Asia/Gaza",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Asia/Hebron",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Europe/Lisbon",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Madeira",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Azores",utcOffset:-60,offsetStr:"-01:00",countries:["PT"]},{name:"Pacific/Palau",utcOffset:540,offsetStr:"+09:00",countries:["PW"]},{name:"America/Asuncion",utcOffset:-180,offsetStr:"-03:00",countries:["PY"]},{name:"Asia/Qatar",utcOffset:180,offsetStr:"+03:00",countries:["QA","BH"]},{name:"Indian/Reunion",utcOffset:240,offsetStr:"+04:00",countries:["RE","TF"]},{name:"Europe/Bucharest",utcOffset:120,offsetStr:"+02:00",countries:["RO"]},{name:"Europe/Belgrade",utcOffset:60,offsetStr:"+01:00",countries:["RS","BA","HR","ME","MK","SI"]},{name:"Europe/Kaliningrad",utcOffset:120,offsetStr:"+02:00",countries:["RU"]},{name:"Europe/Moscow",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Simferopol",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Volgograd",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Samara",utcOffset:240,offsetStr:"+04:00",countries:["RU"]},{name:"Asia/Yekaterinburg",utcOffset:300,offsetStr:"+05:00",countries:["RU"]},{name:"Asia/Omsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novosibirsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novokuznetsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Krasnoyarsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Irkutsk",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Chita",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Yakutsk",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Khandyga",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Vladivostok",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Sakhalin",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Ust-Nera",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Magadan",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Srednekolymsk",utcOffset:660,offsetStr:"+11:00",countries:["RU"]},{name:"Asia/Kamchatka",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Anadyr",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Riyadh",utcOffset:180,offsetStr:"+03:00",countries:["SA","KW","YE"]},{name:"Pacific/Guadalcanal",utcOffset:660,offsetStr:"+11:00",countries:["SB"]},{name:"Indian/Mahe",utcOffset:240,offsetStr:"+04:00",countries:["SC"]},{name:"Africa/Khartoum",utcOffset:180,offsetStr:"+03:00",countries:["SD","SS"]},{name:"Europe/Stockholm",utcOffset:60,offsetStr:"+01:00",countries:["SE"]},{name:"Asia/Singapore",utcOffset:480,offsetStr:"+08:00",countries:["SG"]},{name:"America/Paramaribo",utcOffset:-180,offsetStr:"-03:00",countries:["SR"]},{name:"America/El_Salvador",utcOffset:-360,offsetStr:"-06:00",countries:["SV"]},{name:"Asia/Damascus",utcOffset:120,offsetStr:"+02:00",countries:["SY"]},{name:"America/Grand_Turk",utcOffset:-240,offsetStr:"-04:00",countries:["TC"]},{name:"Africa/Ndjamena",utcOffset:60,offsetStr:"+01:00",countries:["TD"]},{name:"Indian/Kerguelen",utcOffset:300,offsetStr:"+05:00",countries:["TF"]},{name:"Asia/Bangkok",utcOffset:420,offsetStr:"+07:00",countries:["TH","KH","LA","VN"]},{name:"Asia/Dushanbe",utcOffset:300,offsetStr:"+05:00",countries:["TJ"]},{name:"Pacific/Fakaofo",utcOffset:780,offsetStr:"+13:00",countries:["TK"]},{name:"Asia/Dili",utcOffset:540,offsetStr:"+09:00",countries:["TL"]},{name:"Asia/Ashgabat",utcOffset:300,offsetStr:"+05:00",countries:["TM"]},{name:"Africa/Tunis",utcOffset:60,offsetStr:"+01:00",countries:["TN"]},{name:"Pacific/Tongatapu",utcOffset:780,offsetStr:"+13:00",countries:["TO"]},{name:"Europe/Istanbul",utcOffset:120,offsetStr:"+02:00",countries:["TR"]},{name:"America/Port_of_Spain",utcOffset:-240,offsetStr:"-04:00",countries:["TT","AG","AI","BL","DM","GD","GP","KN","LC","MF","MS","VC","VG","VI"]},{name:"Pacific/Funafuti",utcOffset:720,offsetStr:"+12:00",countries:["TV"]},{name:"Asia/Taipei",utcOffset:480,offsetStr:"+08:00",countries:["TW"]},{name:"Europe/Kiev",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Uzhgorod",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Zaporozhye",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Pacific/Wake",utcOffset:720,offsetStr:"+12:00",countries:["UM"]},{name:"America/New_York",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Detroit",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Louisville",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Monticello",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Indianapolis",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vincennes",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Winamac",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Marengo",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Petersburg",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vevay",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Chicago",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Tell_City",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Knox",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Menominee",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Center",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/New_Salem",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Beulah",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Denver",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Boise",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Phoenix",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Los_Angeles",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Metlakatla",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Anchorage",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Juneau",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Sitka",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Yakutat",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Nome",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Adak",utcOffset:-600,offsetStr:"-10:00",countries:["US"]},{name:"Pacific/Honolulu",utcOffset:-600,offsetStr:"-10:00",countries:["US","UM"]},{name:"America/Montevideo",utcOffset:-180,offsetStr:"-03:00",countries:["UY"]},{name:"Asia/Samarkand",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"Asia/Tashkent",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"America/Caracas",utcOffset:-270,offsetStr:"-04:30",countries:["VE"]},{name:"Asia/Ho_Chi_Minh",utcOffset:420,offsetStr:"+07:00",countries:["VN"]},{name:"Pacific/Efate",utcOffset:660,offsetStr:"+11:00",countries:["VU"]},{name:"Pacific/Wallis",utcOffset:720,offsetStr:"+12:00",countries:["WF"]},{name:"Pacific/Apia",utcOffset:840,offsetStr:"+14:00",countries:["WS"]},{name:"Africa/Johannesburg",utcOffset:120,offsetStr:"+02:00",countries:["ZA","LS","SZ"]}]}],link:function(e,n,t,a){e.updateModel=function(e){a.$setViewValue(e)}},templateUrl:"app/core/directives/ms-timezone/ms-timezone.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsWidgetEngineCounterController",function(){var s=this;s.filter=[],s.filtered=!1,s.fontSize=20,s.label="",s.getCount=function(a){var i=0;if(a){s.fontSize=a.attrs[2]&&a.attrs[2].value?parseInt(a.attrs[2].value)-parseInt(a.attrs[2].value)%2:20;var e=a.attrs.find(function(e){return"attrChannel"===e.name});e||a.attrs.push({name:"attrChannel",value:"voice"}),a.attrs.forEach(function(e,n){if("voice"!==a.attrs[3].value?"talking"===a.attrs[0].value?s.label="Opened":"answered"===a.attrs[0].value?s.label="Managed":s.label=a.attrs[0].value:s.label=a.attrs[0].value,!_.isEmpty(e.value))if(e.name.toLowerCase().includes("voice")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.voiceQueuesSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.voiceQueuesSelected);for(var t=0;t<a.voiceQueues.rows.length;t+=1)_.includes(s.filter,a.voiceQueues.rows[t].id)&&(i+=a.voiceQueues.rows[t][a.attrs[0].value]?parseInt(a.voiceQueues.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("chat")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.chatWebsitesSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.chatWebsitesSelected);for(var t=0;t<a.chatWebsites.rows.length;t+=1)_.includes(s.filter,a.chatWebsites.rows[t].id)&&(i+=a.chatWebsites.rows[t][a.attrs[0].value]?parseInt(a.chatWebsites.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("fax")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.faxAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.faxAccountsSelected);for(var t=0;t<a.faxAccounts.rows.length;t+=1)_.includes(s.filter,a.faxAccounts.rows[t].id)&&(i+=a.faxAccounts.rows[t][a.attrs[0].value]?parseInt(a.faxAccounts.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("mail")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.mailAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.mailAccountsSelected);for(var t=0;t<a.mailAccounts.rows.length;t+=1)_.includes(s.filter,a.mailAccounts.rows[t].id)&&(i+=a.mailAccounts.rows[t][a.attrs[0].value]?parseInt(a.mailAccounts.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("openchannel")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.openchannelAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.openchannelAccountsSelected);for(var t=0;t<a.openchannelAccounts.rows.length;t+=1)_.includes(s.filter,a.openchannelAccounts.rows[t].id)&&(i+=a.openchannelAccounts.rows[t][a.attrs[0].value]?parseInt(a.openchannelAccounts.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("whatsapp")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.whatsappAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.whatsappAccountsSelected);for(var t=0;t<a.whatsappAccounts.rows.length;t+=1)_.includes(s.filter,a.whatsappAccounts.rows[t].id)&&(i+=a.whatsappAccounts.rows[t][a.attrs[0].value]?parseInt(a.whatsappAccounts.rows[t][a.attrs[0].value]):0)}else if(e.name.toLowerCase().includes("sms")){a.attrs[n].value&&a.attrs[n].value.length?(s.filtered=!0,s.filter=_.intersection(a.smsAccountsSelected,a.attrs[n].value)):(s.filtered=!1,s.filter=a.smsAccountsSelected);for(var t=0;t<a.smsAccounts.rows.length;t+=1)_.includes(s.filter,a.smsAccounts.rows[t].id)&&(i+=a.smsAccounts.rows[t][a.attrs[0].value]?parseInt(a.smsAccounts.rows[t][a.attrs[0].value]):0)}})}return i}})}(),function(){"use strict";function e(r,e){var l=this;l.filter=[],l.filtered=!1,l.properties=[],l.multiBarChart={labels:["QUEUE_NAME"],series:["TOTAL"],data:[[50]],options:{responsive:!0,legend:{display:!0,fontColor:"#2196f3"},scales:{xAxes:[{gridLines:{display:!0},ticks:{fontColor:"#2196f3",stepSize:1,beginAtZero:!0}}],yAxes:[{gridLines:{display:!1},ticks:{fontColor:"#2196f3"}}]}}},l.getMultiBarChart=function(e){e&&(e.attrs&&function(e){switch(l.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[4].value){case"voice":e.attrs[3].value&&e.attrs[3].value.length?(l.filtered=!0,l.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(l.filtered=!1,l.filter=e.voiceQueuesSelected);break;case"sms":e.attrs[7].value&&e.attrs[7].value.length?(l.filtered=!0,l.filter=_.intersection(e.smsAccountsSelected,e.attrs[7].value)):(l.filtered=!1,l.filter=e.smsAccountsSelected);break;case"mail":e.attrs[5].value&&e.attrs[5].value.length?(l.filtered=!0,l.filter=_.intersection(e.mailAccountsSelected,e.attrs[5].value)):(l.filtered=!1,l.filter=e.mailAccountsSelected);break;case"chat":e.attrs[10].value&&e.attrs[10].value.length?(l.filtered=!0,l.filter=_.intersection(e.chatWebsitesSelected,e.attrs[10].value)):(l.filtered=!1,l.filter=e.chatWebsitesSelected);break;case"fax":e.attrs[6].value&&e.attrs[6].value.length?(l.filtered=!0,l.filter=_.intersection(e.faxAccountsSelected,e.attrs[6].value)):(l.filtered=!1,l.filter=e.faxAccountsSelected);break;case"openchannel":e.attrs[8].value&&e.attrs[8].value.length?(l.filtered=!0,l.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[8].value)):(l.filtered=!1,l.filter=e.openchannelAccountsSelected);break;case"whatsapp":e.attrs[9].value&&e.attrs[9].value.length?(l.filtered=!0,l.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[9].value)):(l.filtered=!1,l.filter=e.whatsappAccountsSelected);break;default:e.attrs[3].value&&e.attrs[3].value.length?(l.filtered=!0,l.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(l.filtered=!1,l.filter=e.voiceQueuesSelected)}if(l.multiBarChart.series.length>l.properties.length){var n=l.multiBarChart.series.length-l.properties.length;l.multiBarChart.series.splice(0,n),l.multiBarChart.data.splice(0,n)}for(var t=0;t<l.properties.length;t+=1){var a="";if(a="voice"!==e.attrs[4].value?"talking"===l.properties[t]?"Opened":"answered"===l.properties[t]?"Managed":l.properties[t]:l.properties[t],l.multiBarChart.series[t]=r.instant("TOOLS."+a.toUpperCase()),_.isNil(l.multiBarChart.data[t])&&(l.multiBarChart.data[t]=[]),l.multiBarChart.labels.length>l.filter.length){var i=l.multiBarChart.labels.length-l.filter.length;l.multiBarChart.labels.splice(0,i),l.multiBarChart.data[t].splice(0,i)}switch(e.attrs[4].value){case"voice":for(var s=0,o=0;s<e.voiceQueues.rows.length;s+=1)_.includes(l.filter,e.voiceQueues.rows[s].id)&&(l.multiBarChart.labels[o]=e.voiceQueues.rows[s].name,l.multiBarChart.data[t][o]=e.voiceQueues.rows[s][l.properties[t]]?parseInt(e.voiceQueues.rows[s][l.properties[t]]):0,o+=1);break;case"sms":for(var s=0,o=0;s<e.smsAccounts.rows.length;s+=1)_.includes(l.filter,e.smsAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.smsAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.smsAccounts.rows[s][l.properties[t]]?parseInt(e.smsAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"chat":for(var s=0,o=0;s<e.chatWebsites.rows.length;s+=1)_.includes(l.filter,e.chatWebsites.rows[s].id)&&(l.multiBarChart.labels[o]=e.chatWebsites.rows[s].name,l.multiBarChart.data[t][o]=e.chatWebsites.rows[s][l.properties[t]]?parseInt(e.chatWebsites.rows[s][l.properties[t]]):0,o+=1);break;case"fax":for(var s=0,o=0;s<e.faxAccounts.rows.length;s+=1)_.includes(l.filter,e.faxAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.faxAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.faxAccounts.rows[s][l.properties[t]]?parseInt(e.faxAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"mail":for(var s=0,o=0;s<e.mailAccounts.rows.length;s+=1)_.includes(l.filter,e.mailAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.mailAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.mailAccounts.rows[s][l.properties[t]]?parseInt(e.mailAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"openchannel":for(var s=0,o=0;s<e.openchannelAccounts.rows.length;s+=1)_.includes(l.filter,e.openchannelAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.openchannelAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.openchannelAccounts.rows[s][l.properties[t]]?parseInt(e.openchannelAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"whatsapp":for(var s=0,o=0;s<e.whatsappAccounts.rows.length;s+=1)_.includes(l.filter,e.whatsappAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.whatsappAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.whatsappAccounts.rows[s][l.properties[t]]?parseInt(e.whatsappAccounts.rows[s][l.properties[t]]):0,o+=1);break;default:for(var s=0,o=0;s<e.voiceQueues.rows.length;s+=1)_.includes(l.filter,e.voiceQueues.rows[s].id)&&(l.multiBarChart.labels[o]=e.voiceQueues.rows[s].name,l.multiBarChart.data[t][o]=e.voiceQueues.rows[s][l.properties[t]]?parseInt(e.voiceQueues.rows[s][l.properties[t]]):0,o+=1)}}}(e),e.foreground&&function(e){l.multiBarChart.options.legend.fontColor=e.foreground;for(var n=0;n<l.multiBarChart.options.scales.xAxes.length;n+=1)l.multiBarChart.options.scales.xAxes[n].ticks.fontColor=e.foreground;for(var t=0;t<l.multiBarChart.options.scales.yAxes.length;t+=1)l.multiBarChart.options.scales.yAxes[t].ticks.fontColor=e.foreground}(e))}}e.$inject=["$translate","socket"],angular.module("app.core").controller("MsWidgetEngineMultibarChartController",e)}(),function(){"use strict";function e(s){var o=this;o.filter=[],o.filtered=!1,o.properties=[],o.pieChart={labels:["ANSWERED"],data:[30],options:{responsive:!0,legend:{display:!0}}},o.getPieChart=function(e){e&&(e.attrs&&function(e){switch(o.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[4].value){case"voice":e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected);break;case"sms":e.attrs[7].value&&e.attrs[7].value.length?(o.filtered=!0,o.filter=_.intersection(e.smsAccountsSelected,e.attrs[7].value)):(o.filtered=!1,o.filter=e.smsAccountsSelected);break;case"mail":e.attrs[5].value&&e.attrs[5].value.length?(o.filtered=!0,o.filter=_.intersection(e.mailAccountsSelected,e.attrs[5].value)):(o.filtered=!1,o.filter=e.mailAccountsSelected);break;case"chat":e.attrs[10].value&&e.attrs[10].value.length?(o.filtered=!0,o.filter=_.intersection(e.chatWebsitesSelected,e.attrs[10].value)):(o.filtered=!1,o.filter=e.chatWebsitesSelected);break;case"fax":e.attrs[6].value&&e.attrs[6].value.length?(o.filtered=!0,o.filter=_.intersection(e.faxAccountsSelected,e.attrs[6].value)):(o.filtered=!1,o.filter=e.faxAccountsSelected);break;case"openchannel":e.attrs[8].value&&e.attrs[8].value.length?(o.filtered=!0,o.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[8].value)):(o.filtered=!1,o.filter=e.openchannelAccountsSelected);break;case"whatsapp":e.attrs[9].value&&e.attrs[9].value.length?(o.filtered=!0,o.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[9].value)):(o.filtered=!1,o.filter=e.whatsappAccountsSelected);break;default:e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected)}if(o.pieChart.labels.length>o.properties.length){var n=o.pieChart.labels.length-o.properties.length;o.pieChart.labels.splice(0,n),o.pieChart.data.splice(0,n)}for(var t=0,a=0;t<o.properties.length;t+=1){switch("voice"!==e.attrs[4].value?"talking"===o.properties[t]?o.pieChart.labels[t]=s.instant("TOOLS.OPENED"):"answered"===o.properties[t]?o.pieChart.labels[t]=s.instant("TOOLS.MANAGED"):o.pieChart.labels[t]=s.instant("TOOLS."+o.properties[t].toUpperCase()):o.pieChart.labels[t]=s.instant("TOOLS."+o.properties[t].toUpperCase()),e.attrs[4].value){case"voice":for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[t]]?parseInt(e.voiceQueues.rows[i][o.properties[t]]):0);break;case"sms":for(var i=0;i<e.smsAccounts.rows.length;i+=1)_.includes(o.filter,e.smsAccounts.rows[i].id)&&(a+=e.smsAccounts.rows[i][o.properties[t]]?parseInt(e.smsAccounts.rows[i][o.properties[t]]):0);break;case"chat":for(var i=0;i<e.chatWebsites.rows.length;i+=1)_.includes(o.filter,e.chatWebsites.rows[i].id)&&(a+=e.chatWebsites.rows[i][o.properties[t]]?parseInt(e.chatWebsites.rows[i][o.properties[t]]):0);break;case"fax":for(var i=0;i<e.faxAccounts.rows.length;i+=1)_.includes(o.filter,e.faxAccounts.rows[i].id)&&(a+=e.faxAccounts.rows[i][o.properties[t]]?parseInt(e.faxAccounts.rows[i][o.properties[t]]):0);break;case"mail":for(var i=0;i<e.mailAccounts.rows.length;i+=1)_.includes(o.filter,e.mailAccounts.rows[i].id)&&(a+=e.mailAccounts.rows[i][o.properties[t]]?parseInt(e.mailAccounts.rows[i][o.properties[t]]):0);break;case"openchannel":for(var i=0;i<e.openchannelAccounts.rows.length;i+=1)_.includes(o.filter,e.openchannelAccounts.rows[i].id)&&(a+=e.openchannelAccounts.rows[i][o.properties[t]]?parseInt(e.openchannelAccounts.rows[i][o.properties[t]]):0);break;case"whatsapp":for(var i=0;i<e.whatsappAccounts.rows.length;i+=1)_.includes(o.filter,e.whatsappAccounts.rows[i].id)&&(a+=e.whatsappAccounts.rows[i][o.properties[t]]?parseInt(e.whatsappAccounts.rows[i][o.properties[t]]):0);break;default:for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[t]]?parseInt(e.voiceQueues.rows[i][o.properties[t]]):0)}o.pieChart.data[t]=a,a=0}}(e),e.foreground&&(n=e,o.pieChart.options.legend.fontColor=n.foreground));var n}}e.$inject=["$translate"],angular.module("app.core").controller("MsWidgetEnginePieChartController",e)}(),function(){"use strict";function e(e,t,a,i){var s=this;function n(e){s.results=e||{count:0,rows:[]}}function o(){s.query.offset=(s.query.page-1)*s.query.limit,s.promise=i[s.reportRoute].run(s.query,n).$promise}s.countDown=0,s.refresh=0,s.title="",s.columns=[],s.results={rows:[],count:0},s.query={limit:10,page:1,startDate:moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),endDate:moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),output:"web"},s.onInit=function e(n){n&&n.attrs&&(n.attrs[0]&&n.attrs[0].value&&(s.query.id=n.attrs[0].value,i.analyticFieldReport.get({fields:"field,alias",nolimit:!0,DefaultReportId:"default"===n.attrs[0].type?n.attrs[0].value:void 0,CustomReportId:"custom"===n.attrs[0].type?n.attrs[0].value:void 0}).$promise.then(function(e){switch(e&&e.rows&&(s.columns=e.rows),n.attrs[0].type){case"default":s.reportRoute="analyticDefaultReport";break;case"custom":s.reportRoute="analyticCustomReport"}return i[s.reportRoute].get({id:n.attrs[0].value,fields:"id,name"}).$promise}).then(function(e){e&&e.name&&(s.title=e.name),o()}).catch(function(e){console.log(e)})),n.attrs[1]&&n.attrs[1].value&&(s.refresh=parseInt(n.attrs[1].value),!_.isNaN(s.refresh)&&0<s.refresh?(s.countDown=parseInt(n.attrs[1].value),s.interval=a(function(){s.countDown-=1},1e3,0),s.timeout=t(function(){s.interval&&a.cancel(s.interval),e(n)},1e3*s.refresh)):(s.interval&&a.cancel(s.interval),s.timeout&&t.cancel(s.timeout))))},s.getResults=o,s.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n},e.$on("$destroy",function(){s.interval&&a.cancel(s.interval),s.timeout&&t.cancel(s.timeout)})}e.$inject=["$scope","$timeout","$interval","api"],angular.module("app.core").controller("MsWidgetEngineWebReportController",e)}(),function(){"use strict";function e(e,n){this.getTrustedURL=function(e){return n.trustAsResourceUrl(e)}}function n(e){return{restrict:"E",scope:{config:"=?",onEdit:"&?",onDelete:"&?"},require:"msWidgetEngine",controller:"MsWidgetEngineController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-widget-engine/ms-widget-engine.html"}}e.$inject=["$mdDialog","$sce"],n.$inject=["$document"],angular.module("app.core").controller("MsWidgetEngineController",e).directive("msWidgetEngine",n)}(),function(){"use strict";function e(e,n){var t=this;t.flipped=!1,t.flip=function(){if(!angular.isDefined(e.flippable)||!0!==e.flippable)return;t.flipped=!t.flipped,n.toggleClass("flipped",t.flipped)}}e.$inject=["$scope","$element"],angular.module("app.core").controller("MsWidgetController",e).directive("msWidget",function(){return{restrict:"E",scope:{flippable:"=?"},controller:"MsWidgetController",transclude:!0,compile:function(e){return e.addClass("ms-widget"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)})}}}}).directive("msWidgetFront",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-front"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)}),e.flipWidget=a.flip}}}}).directive("msWidgetBack",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-back"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)}),e.flipWidget=a.flip}}}})}(),function(){"use strict";function e(s,n,o,r){return{restrict:"A",require:"?ngModel",link:function(t,a,e,i){o.isAdmin()||o.isTelephone()||(""!==e.privacy||o.getCurrentUser().privacyEnabled)&&!1!==t.$eval(e.privacy)&&(i?(i.$formatters.push(function(e){if(!e)return e;var n=r.mask(e);return i.$setViewValue(n),i.$render(),i.$viewValue}),i.$parsers.push(function(){return i.$modelValue}),a[0].disabled=!0):n(function(){s(a.contents())(t);var e=a.text();if(e){var n=r.mask(e);a.text(n)}}))}}}e.$inject=["$compile","$timeout","Auth","privacyManager"],angular.module("app.core").directive("privacy",e)}(),function(){"use strict";function e(o,r,i,l,d){var e={get:function(s,a){return o(function(n,t){0===a.offset&&(s=void 0);var e=_.merge({},a);i.cmContact.getJourney(e).$promise.then(function(e){var a,n=_(e.rows).uniqBy(function(e){return e.channel}).map("channel").value();return(a=n,o(function(e,n){var t=a.map(function(n){if("voice"!==n){var e="get"+_.startCase(n)+("chat"===n?"Websites":"Accounts");return i.user[e]({id:l.getCurrentUser().id,attributes:["id","name"],nolimit:!0}).$promise.then(function(e){c[n]=e.rows})}});return o.all(t).then(function(){e()}).catch(function(e){n(e)})})).then(function(){return e.rows.forEach(function(e){var n;e.canOpen=function(e){switch(e.channel){case"chat":return!!c.chat&&_.some(c.chat,["id",e.ChatWebsiteId]);case"fax":return!!c.fax&&_.some(c.fax,["id",e.FaxAccountId]);case"mail":return!!c.mail&&_.some(c.mail,["id",e.MailAccountId]);case"openchannel":return!!c.openchannel&&_.some(c.openchannel,["id",e.OpenchannelAccountId]);case"sms":return!!c.sms&&_.some(c.sms,["id",e.SmsAccountId]);case"voice":return!0;case"whatsapp":return!!c.whatsapp&&_.some(c.whatsapp,["id",e.WhatsappAccountId]);default:return!1}}(e),e.dispositionsValues=(n=e).disposition?"("+_.compact([n.disposition,n.secondDisposition,n.thirdDisposition]).join(" - ")+")":"("+r.instant("DASHBOARDS.NO_DISPOSITION_SET")+")",e.style=function(e){switch(e.channel){case"chat":return{color:"green-A700",icon:"icon-hangouts"};case"fax":return{color:"blue-grey-A200",icon:"icon-deskphone"};case"mail":return{color:"teal",icon:"icon-email"};case"openchannel":return{color:"amber-A200",icon:"icon-google-earth"};case"sms":return{color:"orange",icon:"icon-message-text"};case"voice":return{color:"blue-A700",icon:"icon-phone"};case"whatsapp":return{color:"lime-A700",icon:"icon-whatsapp"}}}(e)}),a=s,i=e,o(function(e,n){try{var t={journey:a?_.union(a,i.rows):i.rows};t.loadMore=0<i.count-t.journey.length,e(t)}catch(e){n(e)}});var a,i})}).then(function(e){n(e)}).catch(function(e){d.error({title:r.instant("CONTACTMANAGER.CUSTOMER_JOURNEY"),msg:r.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),t(e)})})},getQuery:function(){return{range:{from:moment().subtract(3,"M").startOf("month").format("YYYY-MM-DD HH:mm:ss"),to:moment().endOf("month").format("YYYY-MM-DD HH:mm:ss")},limit:10,offset:0}},getQuickFilters:function(){return[{name:"Channel",key:"channel",type:"select",label:"INTEGRATIONS.CHANNEL",customOptions:[{value:void 0,translate:"DASHBOARDS.ALL"},{value:"voice",translate:"DASHBOARDS.VOICE"},{value:"chat",translate:"DASHBOARDS.CHAT"},{value:"mail",translate:"DASHBOARDS.MAIL"},{value:"sms",translate:"DASHBOARDS.SMS"},{value:"fax",translate:"DASHBOARDS.FAX"},{value:"openchannel",translate:"DASHBOARDS.OPENCHANNEL"},{value:"whatsapp",translate:"DASHBOARDS.WHATSAPP"}]},{name:"Start Date",key:"range",type:"date",label:"DASHBOARDS.SELECT_DATE",useFromToKeys:!0}]}},c={};return e}e.$inject=["$q","$translate","api","Auth","toasty"],angular.module("app.core").factory("customerJourneyManager",e)}(),function(){"use strict";function e(t,a,n,i,s){var o={},r={},l={},d={};function c(){r=i.getCurrentUser();var e=n.localStorage.getItem("motion2.home:"+r.id);if(l=e?JSON.parse(e).currentSidebarTab:"dashboard",d=n.localStorage.getItem("motion2.home."+l+":"+r.id)){var a=JSON.parse(d);a.drafts?r.privacyEnabled&&Object.keys(a.drafts).forEach(function(e){var n=a.drafts[e].title,t=n.split(/-(.+)/)[1].trim();a.drafts[e].title=n.replace(t,s.mask(t))}):a.drafts={},d=a}else d={drafts:{}};return d.drafts}function m(){_.isEmpty(o.drafts)?delete d.drafts:d.drafts=o.drafts,n.localStorage.setItem("motion2.home."+l+":"+r.id,JSON.stringify(d))}return o.init=function(){o.drafts=c()},o.getByInteraction=function(n){return o.drafts=c(),_.find(_.values(o.drafts),function(e){return e.interaction&&e.interaction.id===n})},o.removeByInteraction=function(n){o.drafts=c();var e=_.find(_.values(o.drafts),function(e){return e.interaction&&e.interaction.id===n});e&&(delete o.drafts[e.id],m())},o.add=function(e){o.drafts=c();var n=a.instant("DASHBOARDS.UNTITLED");e.contact?n=e.contact.firstName||e.contact.email:_.isEmpty(e.message.subject)||(n=e.message.subject);var t={type:"draft",title:e.account.key+" - "+n,channel:e.channel,content:e.message,account:e.account,interaction:e.interaction,id:_.random(1e10),openedAt:new Date,saved:!1};o.drafts[t.id]=t,m()},o.update=function(e){o.drafts=c();var n=o.drafts[e.id];n&&(n.content=e.message,o.drafts[e.id]=n,m())},o.open=function(e){o.drafts=c();var n=o.drafts[e];n&&t.$broadcast("open"+_.startCase(l)+"Draft",n)},o.remove=function(e){o.drafts=c(),o.drafts[e]&&(delete o.drafts[e],m())},o}e.$inject=["$rootScope","$translate","$window","Auth","privacyManager"],angular.module("app.core").factory("draftManager",e)}(),function(){"use strict";function e(s){var o=[];return function(n,e){e||(e="global-exception");var t,a=s.get("ClientSideLoggingService").getLogger("global-exception"),i=o.findIndex(function(e){return e===n});-1<i?(t=i,o.splice(t,1)):(!function(e){if(100<=o.length){var n=o.length-100+1;o.splice(0,n)}o.push(e)}(n),a.error(e,n))}}e.$inject=["$injector"],angular.module("app.core").factory("$exceptionHandler",e)}(),function(){"use strict";function e(i){function s(e,n){var t=i.localStorage.getItem(e),a=t?JSON.parse(t):{};return n?a[n]:a}function o(e,n){return i.localStorage.setItem(e,JSON.stringify(n))}return{get:s,set:o,update:function(e,n,t){var a=s(e);t?a[t]=n:a=n;return o(e,a)}}}e.$inject=["$window"],angular.module("app.core").factory("localStorageManager",e)}(),function(){"use strict";function e(i){function s(e,n){var t=i.get(),a=0;if(t)switch(n){case"email":a=t.privacyPolicyEmail;break;case"number":a=t.privacyPolicyNumber;break;default:a=t.privacyPolicyName}return _.isNil(a)?e:0===a||a>e.length?e.replace(/./g,"*"):e.substring(0,e.length-a).padEnd(e.length,"*")}function o(e){return _.startsWith(e,"<")&&_.endsWith(e,">")&&(e=e.substring(1,e.length-1)),/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function r(e){if(_.startsWith(e,"<")&&_.endsWith(e,">")){var n=!0;e=e.substring(1,e.length-1)}var t=e.split("@")[0],a=e.split("@")[1],i="";return n&&(i+="<"),i+=s(t,"email"),i+="@",i+=s(a,"email"),n&&(i+=">"),i}return{mask:function n(e){t=e,e=t.replace(/\s\s+/g," ").trim();var t;{if(o(e))return r(e);if(/^[+]?[0-9|.|\-|\s]*$/.test(e))return s(e,"number");var a=[],i=e.split(" ");return 1===i.length?s(e):(i.forEach(function(e){a.push(n(e))}),a.join(" "))}}}}e.$inject=["settingsManager"],angular.module("app.core").factory("privacyManager",e)}(),function(){"use strict";function e(e,s){return{setPlaceholder:function(a){var i;return e(function(n,e){try{if(_.isEmpty(a.resources))i=s.instant("DASHBOARDS.NONE");else if(_.isEmpty(a.param))i=a.placeholder?s.instant(a.placeholder):s.instant("DASHBOARDS.CHOOSE");else if(a.param.length===a.resources.length)i=s.instant("DASHBOARDS.ALL");else{var t=a.ngValue||"id";i=_(a.resources).filter(function(e){return _.includes(a.param,e[t])}).map("name").value().join(", ")}n(i)}catch(e){console.log("QuickFilterManager::setPlaceholder",e),n(null)}})}}}e.$inject=["$q","$translate"],angular.module("app.core").factory("quickFilterManager",e)}(),function(){"use strict";function e(t){var e={getAgentStatus:function(e){var n="unknown";n=o(e)?"pause":o(e,!0)?"*pause":function(e){if("idle"!==e.voiceStatus&&e.voicePause)return!(e.voiceStatus="pause");return _.every([e.chatStatus,e.faxStatus,e.mailStatus,e.openchannelStatus,e.smsStatus,e.voiceStatus,e.whatsappStatus],r)}(e)?"idle":"busy";return n},setAgentStatusDisplayValue:function(e){var n=e.globalStatus;"pause"===e.globalStatus?n=e.pauseType||t.instant("VOICE.DEFAULT_PAUSE"):"*pause"===e.globalStatus&&(n="*"+(e.pauseType||t.instant("VOICE.DEFAULT_PAUSE")));e.globalStatusDisplayValue=n},updateBusyCounter:s,updateQueue:function(e,n,t,a){var i=t.paused;!1===e.online?(t.online=!1,n.loggedInDb-=1,t.paused?(t.paused=!1,n.paused-=1):n.available-=1):t.online?!e[a+"Pause"]||t.paused||o(e,!0)?!e[a+"Pause"]&&t.paused?(t.paused=!1,t.talking||t.busy||(n.paused-=1,n.available+=1)):e[a+"Pause"]&&t.paused&&(t.talking||t.busy||(n.busy-=1,i||(n.paused+=1))):(t.paused=!0,t.talking||t.busy||(i||(n.paused+=1),0<n.available&&(n.available-=1))):(t.online=!0,n.loggedInDb+=1,n.available+=1);s(n)},updateVoiceQueue:function(e,n){e.loggedIn===e.available&&0<e.waiting&&(e.available-=e.waiting);var t=e.loggedIn-e.available-e.talking-e.waiting-n.paused;t<0?(n.paused-=Math.abs(t),n.waitingOrTalking=!0):0<t&&n.waitingOrTalking&&(n.paused+=1,delete n.waitingOrTalking);_.merge(n,_.pick(e,"inbound"===n.type?a:i)),"outbound"===n.type&&_.isNil(e.startPredictive)&&(n.startPredictive=void 0);s(n)}},a=["loggedIn","available","waiting","talking","paused"],i=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused","startPredictive","startProgressive","erlangCalls","erlangCallToSecond","erlangAbandonmentRate","erlangBusyFactor","dialPredictiveInterval","dialPredictiveIntervalMaxThreshold","dialPredictiveIntervalMinThreshold","predictiveIntervalAvailable","predictiveIntervalTotalCalls","predictiveIntervalAnsweredCalls","predictiveIntervalDroppedCallsTimeout","predictiveIntervalDroppedCallsCallersExit","predictiveIntervalAvgHoldtime","predictiveIntervalAvgTalktime"];function s(e){var n=_.filter(e.agents,["busy",!0]).length,t=e.loggedInDb-e.available-e.paused-e.talking-e.waiting;t<0&&(t=0),e.busy=t<n?n:t}function o(e,n){var t=[e.chatPause,e.faxPause,e.mailPause,e.openchannelPause,e.smsPause,e.voicePause,e.whatsappPause];if(!n)return _.every(t);var a=_.filter(t);return 0<a.length&&a.length<t.length}function r(e){if(_.isNil(e))return!0;return _.includes(["idle","unknown","unavailable","ringing"],e)}return e}e.$inject=["$translate"],angular.module("app.core").factory("realtimeManager",e)}(),function(){"use strict";angular.module("app.core").factory("settingsManager",function(){var n={};return{get:function(){return n},set:function(e){e&&(n=e.toJSON())}}})}(),function(){"use strict";function e(c,m){function u(e,n,t){if(_.isEmpty(n))return t;for(var a=0;a<n.length;a++){var i=n[a].key,s=_.find(e,function(e){return e[i]===n[a].value});s&&(_.some(t,["id",s.id])||(s.canSelect=!1,t.push(s)))}return t}return{getResources:function(a,i,s,o,r,l,d){return c(function(t,n){o||(o={}),d||(d="get"),a[s][d](o).$promise.then(function(e){var t=e.rows;if("admin"===i.role)return t;var n=m.getSectionId(s,l);return a.userProfileSection.get({userProfileId:i.userProfileId,sectionId:n}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?t:a.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(t,{id:e.resourceId})});return u(t,r,n)}):c.resolve().then(function(){return e=s,_.includes(["voiceContext"],e)?(o.defaultEntry=1,a[s][d](o).$promise.then(function(e){return e.rows})):[];var e}).then(function(e){return u(t,r,e)})})}).then(function(e){var n={rows:_.orderBy(e,[o.sort]),count:e.length};t(n)}).catch(function(e){n(e)})})}}}e.$inject=["$q","msNavigationService"],angular.module("app.core").factory("userProfileManager",e)}(),function(){"use strict";angular.module("app.core").filter("altDate",function(){return function(e){var n=Date.now()-new Date(e);return n<36e5?moment(e).fromNow():n<864e5?moment(e).format("HH:mm"):n<6048e5?moment(e).format("dddd"):moment(e).calendar()}})}(),function(){"use strict";function e(n){return function(e){return n.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("app.core").filter("toTrusted",e).filter("htmlToPlaintext",function(){return function(e){return String(e).replace(/<[^>]+>/gm,"")}}).filter("nospace",function(){return function(e){return e?e.replace(/ /g,""):""}}).filter("humanizeDoc",function(){return function(e){if(e)return"directive"===e.type?e.name.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):e.label||e.name}})}(),function(){"use strict";angular.module("app.core").filter("capitalize",function(){return function(e){return e?_.capitalize(e):""}})}(),function(){"use strict";angular.module("app.core").filter("filterByIds",function(){return function(e,n){if(0===e.length||!n)return e;if(0===n.length)return[];for(var t=[],a=0;a<e.length;a++){for(var i=e[a],s=!1,o=0;o<n.length;o++){var r=n[o];if(i.id===r){s=!0;break}}s&&t.push(i)}return t}})}(),function(){"use strict";angular.module("app.core").filter("filterByPropIds",function(){return function(e,n,t){if(0===e.length||!t||0===t.length)return e;for(var a=[],i=0;i<e.length;i++){for(var s=e[i],o=!1,r=0;r<t.length;r++){var l=t[r];if(-1<s[n].indexOf(l)){o=!0;break}}o&&a.push(s)}return a}})}(),function(){"use strict";angular.module("app.core").filter("getOptionByValue",function(){return function(n,e,t){if(void 0===n)return"";if(!e)return"";t||(t="option");var a=_.find(e,function(e){return e.value==n});return a?a[t]:""}})}(),function(){"use strict";angular.module("app.core").filter("orderByDate",function(){return function(e){var n=[];return angular.forEach(e,function(e){n.push(e)}),n.sort(function(e,n){return e.hasOwnProperty("openedAt")&&n.hasOwnProperty("openedAt")?e.openedAt>n.openedAt?1:-1:1}),n}})}(),function(){"use strict";angular.module("app.core").filter("secToTime",function(){return function(e){e&&(e=e.toString().replace(",",""));var n=Math.floor(e/86400),t=e%86400,a=new Date(1e3*t).toISOString().substring(11,19);return a.replace(/^(\d+)/,function(e){return(""+(Number(e)+24*n)).padStart(2,"0")})}})}(),function(){"use strict";angular.module("app.core").filter("snakecase",function(){return function(e){return e?_.snakeCase(e):""}})}(),function(){"use strict";angular.module("app.core").filter("startcase",function(){return function(e){return e?_.startCase(e):""}})}(),function(){"use strict";angular.module("app.core").filter("filterByTags",function(){return function(e,t){if(0===e.length||0===t.length)return e;var a=[];return e.forEach(function(e){var n=t.every(function(n){var t=!1;return e.tags.forEach(function(e){e.name!==n.name||(t=!0)}),t});n&&a.push(e)}),a}}).filter("filterSingleByTags",function(){return function(e,n){if(0!==e.length&&0!==n.length){if(e.length<n.length)return[];var t=[],a=n.every(function(n){var t=!1;return e.forEach(function(e){e.name!==n.name||(t=!0)}),t});return a&&t.push(e),t}}})}(),function(){"use strict";angular.module("app.core").filter("toInteger",function(){return function(e){if(e&&"string"==typeof e)return parseInt(e)}})}(),function(){"use strict";function m(e,n,t,a){this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.title=e,this.body=n,this.accept=t,this.reject=a,this.close=i}function u(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function i(){var t=this;navigator.serviceWorker.ready.then(function(e){e.getNotifications().then(function(e){var n=_.find(e,function(e){return e.data.id===t.id});n&&n.close()})})}angular.module("app.dashboards").provider("motNotification",function(){return{$get:[function(){var d,t,c=[];"serviceWorker"in navigator&&u()?navigator.serviceWorker.register("notification.js").then(function(e){(d=e).update(),d.installing?t=d.installing:d.waiting?t=d.waiting:d.active&&(t=d.active)}).catch(function(e){console.error("Service worker registration failed",e)}):console.error("Service Worker is not supported");return navigator.serviceWorker.addEventListener("message",function(e){if(e.source===t){var n=_.find(c,{id:e.data.id});if(n)switch(e.data.action){case"accept":n.accept&&n.accept();break;case"reject":n.reject&&n.reject()}}}),{create:function(e,i,s,o,r,l){return new Promise(function(t,n){var a;u()&&(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)?(a=new m(e||"MyTitle",i||"MyBody",o,r),c.push(a),a?window.Notification.requestPermission().then(function(e){if("granted"===e)return d.showNotification(a.title,{body:a.body,requireInteraction:!0,icon:s||"assets/images/business/queueCampaigns.jpg",data:{id:a.id},actions:[{action:"accept",title:"Accept"},{action:"reject",title:"Reject"}]})}).then(function(e){if(l){for(var n=0;n<c.length;n++)c[n].close();t()}else t(a)}).catch(function(e){n(e)}):n(new Error("Notification creating error"))):t()})}}}]}})}(),function(){"use strict";function e(l,d,c){return{resolve:function(e,n){var t=e.split("@"),a=t[0],i=t[1],s=n||{};if(!a||!i)return d.error("apiResolver.resolve requires correct action parameter (ResourceName@methodName)"),!1;var o=l.defer(),r=function(e){for(var n=e.split("."),t=c,a=0;a<n.length;a++){if(angular.isUndefined(t[n[a]])){d.error('Resource part "'+n[a]+'" is not defined!'),t=!1;break}t=t[n[a]]}return t||!1}(a);r?r[i](s,function(e){o.resolve(e)},function(e){o.reject(e)}):(d.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!'));return o.promise}}}e.$inject=["$q","$log","api"],angular.module("app.core").factory("apiResolver",e)}(),function(){"use strict";function e(e){return{showLoadingIndicator:function(){e.loadingProgress=!0},hideLoadingIndicator:function(){e.loadingProgress=!1}}}e.$inject=["$rootScope"],angular.module("app.core").factory("LoadingIndicatorService",e)}(),function(){"use strict";angular.module("app.core").provider("msApi",function(){var t=angular.injector(["ng"]).get("$log"),a="",v=[];function n(e){a=e}function i(){return a}function s(e,n){angular.isString(e)?angular.isArray(n)?v[e]={url:a+(n[0]||""),paramDefaults:n[1]||[],actions:n[2]||[],options:n[3]||{}}:t.error('"resource" must be an array and it must follow $resource definition'):t.error('"path" must be a string (eg. `dashboard.project`)')}this.setBaseUrl=n,this.getBaseUrl=i,this.getApiObject=function(){return v},this.register=s,this.$get=["$log","$q","$resource","$rootScope",function(m,u,p,g){var e={setBaseUrl:n,getBaseUrl:i,register:s,resolve:function(e,n){g.$broadcast("msApi::resolveStart");var t=e.split("@"),a=t[0],i=t[1],s=n||{};if(!a||!i)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var o=u.defer(),r=v[a];if(r){var l=p(r.url,r.paramDefaults,r.actions,r.options);l[i](s,function(e){o.resolve(e),g.$broadcast("msApi::resolveSuccess")},function(e){o.reject(e),g.$broadcast("msApi::resolveError")})}else m.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!');return o.promise},request:function(e,n,t,a){g.$broadcast("msApi::requestStart");var i=e.split("@"),s=i[0],o=i[1],r=n||{};if(!s||!o)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var l=u.defer(),d=v[s];if(d){var c=p(d.url,d.paramDefaults,d.actions,d.options);c[o](r,function(e){g.$broadcast("msApi::requestSuccess"),l.resolve(e),angular.isDefined(t)&&angular.isFunction(t)&&t(e)},function(e){g.$broadcast("msApi::requestError"),l.reject(e),angular.isDefined(a)&&angular.isFunction(a)&&a(e)})}else m.error('Resource "'+s+'" is not defined in the api service!'),l.reject('Resource "'+s+'" is not defined in the api service!');return l.promise}};return e}]})}(),function(){"use strict";function e(l){var e=new MobileDetect(l.navigator.userAgent),d=null;return{exists:function(e,n){return-1<n.indexOf(e)},detectBrowser:function(){if(d)return d;var e=[{string:l.navigator.userAgent,subString:"Edge",versionSearch:"Edge",identity:"Edge"},{string:l.navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:l.navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:l.navigator.vendor,subString:"Apple",versionSearch:"Version",identity:"Safari"},{prop:l.opera,identity:"Opera"},{string:l.navigator.vendor,subString:"iCab",identity:"iCab"},{string:l.navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:l.navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:l.navigator.vendor,subString:"Camino",identity:"Camino"},{string:l.navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:l.navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:l.navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],n=[{string:l.navigator.platform,subString:"Win",identity:"Windows"},{string:l.navigator.platform,subString:"Mac",identity:"Mac"},{string:l.navigator.platform,subString:"Linux",identity:"Linux"},{string:l.navigator.platform,subString:"iPhone",identity:"iPhone"},{string:l.navigator.platform,subString:"iPod",identity:"iPod"},{string:l.navigator.platform,subString:"iPad",identity:"iPad"},{string:l.navigator.platform,subString:"Android",identity:"Android"}],i="";function t(e){for(var n=0;n<e.length;n++){var t=e[n].string,a=e[n].prop;if(i=e[n].versionSearch||e[n].identity,t){if(-1!==t.indexOf(e[n].subString))return e[n].identity}else if(a)return e[n].identity}}function a(e){var n=e.indexOf(i);if(-1!==n)return parseInt(e.substring(n+i.length+1))}var s=t(e)||"unknown-browser",o=a(l.navigator.userAgent)||a(l.navigator.appVersion)||"unknown-version",r=t(n)||"unknown-os";return s=s.toLowerCase(),o=s+"-"+o,r=r.toLowerCase(),d={browser:s,version:o,os:r}},guidGenerator:function(){var e=function(){return(65536*(1+Math.random())||0).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()},isMobile:function(){return e.mobile()},toggleInArray:function(e,n){-1===n.indexOf(e)?n.push(e):n.splice(n.indexOf(e),1)},firstLastDayMonth:function(){return{$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()}},getEmailProviders:function(){return[{name:"Custom",value:"custom"},{name:"Gmail",value:"gmail"},{name:"Hotmail",value:"hotmail"},{name:"Yahoo",value:"yahoo"},{name:"Outlook365",value:"outlook365"}]}}}e.$inject=["$window"],angular.module("app.core").factory("msUtils",e)}(),function(){"use strict";function e(e,n){var t=this;t.themes=n.themes,t.layoutModes=[{label:"Boxed",value:"boxed"},{label:"Wide",value:"wide"}],t.layoutStyles=[{label:"Vertical Navigation",value:"verticalNavigation",figure:"/assets/images/theme-options/vertical-nav.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar",value:"verticalNavigationFullwidthToolbar",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar 2",value:"verticalNavigationFullwidthToolbar2",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar-2.jpg"},{label:"Horizontal Navigation",value:"horizontalNavigation",figure:"/assets/images/theme-options/horizontal-nav.jpg"},{label:"Content with Toolbar",value:"contentWithToolbar",figure:"/assets/images/theme-options/content-with-toolbar.jpg"},{label:"Content Only",value:"contentOnly",figure:"/assets/images/theme-options/content-only.jpg"}],t.layoutMode="wide",t.layoutStyle=e.get("motion.layoutStyle")||"verticalNavigation",t.setActiveTheme=function(e){n.setActiveTheme(e)},t.getActiveTheme=function(){return n.themes.active},t.updateLayoutMode=function(){angular.element("body").toggleClass("boxed","boxed"===t.layoutMode)},t.updateLayoutStyle=function(){e.put("motion.layoutStyle",t.layoutStyle),location.reload()}}function n(n){return{restrict:"E",scope:{},controller:"MsThemeOptionsController as vm",templateUrl:"app/core/theme-options/theme-options.html",compile:function(e){return e.addClass("ms-theme-options"),function(e){e.toggleOptionsSidenav=function(){n("motion-theme-options").toggle()}}}}}e.$inject=["$cookies","motionTheming"],n.$inject=["$mdSidenav"],angular.module("app.core").controller("MsThemeOptionsController",e).directive("msThemeOptions",n)}(),function(){"use strict";function e(i,a,s){var o={};return{generate:function(){var e=angular.copy(s.getRegisteredThemes()),a=angular.copy(s.getRegisteredPalettes());angular.forEach(e,function(t){o[t.name]={},angular.forEach(t.colors,function(e,n){o[t.name][n]={name:e.name,levels:{default:{color:l(a[e.name][e.hues.default].value),contrast1:l(a[e.name][e.hues.default].contrast,1),contrast2:l(a[e.name][e.hues.default].contrast,2),contrast3:l(a[e.name][e.hues.default].contrast,3),contrast4:l(a[e.name][e.hues.default].contrast,4)},hue1:{color:l(a[e.name][e.hues["hue-1"]].value),contrast1:l(a[e.name][e.hues["hue-1"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-1"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-1"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-1"]].contrast,4)},hue2:{color:l(a[e.name][e.hues["hue-2"]].value),contrast1:l(a[e.name][e.hues["hue-2"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-2"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-2"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-2"]].contrast,4)},hue3:{color:l(a[e.name][e.hues["hue-3"]].value),contrast1:l(a[e.name][e.hues["hue-3"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-3"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-3"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-3"]].contrast,4)}}}})}),function(e){var n=angular.copy(e);angular.forEach(n,function(t){angular.forEach(t,function(e,n){t[n]=e.levels,t[n].color=e.levels.default.color,t[n].contrast1=e.levels.default.contrast1,t[n].contrast2=e.levels.default.contrast2,t[n].contrast3=e.levels.default.contrast3,t[n].contrast4=e.levels.default.contrast4,delete t[n].default})}),s.setThemesList(n);var t=i.get("motion.selectedTheme");t?s.setActiveTheme(t):s.setActiveTheme("default")}(o);var r={};angular.forEach(o,function(e,n){var t,a,i,s,o;(r={})["@themeName"]=n,angular.forEach(e,function(e,a){angular.forEach(e.levels,function(e,t){angular.forEach(e,function(e,n){r["@"+a+d(t)+d(n)]=e})})}),t=r,a=new RegExp(Object.keys(t).join("|"),"gi"),i='/* Content hack because they wont fix */\n/* https://github.com/angular/material/pull/8067 */\n[md-theme="@themeName"] md-content.md-hue-1,\nmd-content.md-@themeName-theme.md-hue-1 {\n    color: @backgroundHue1Contrast1;\n    background-color: @backgroundHue1Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-2,\nmd-content.md-@themeName-theme.md-hue-2 {\n    color: @backgroundHue2Contrast1;\n    background-color: @backgroundHue2Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-3,\n md-content.md-@themeName-theme.md-hue-3 {\n    color: @backgroundHue3Contrast1;\n    background-color: @backgroundHue3Color;\n}\n\n/* Text Colors */\n[md-theme="@themeName"] a {\n    color: @accentDefaultColor;\n}\n\n[md-theme="@themeName"] .secondary-text,\n[md-theme="@themeName"] .icon {\n    color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .hint-text,\n[md-theme="@themeName"] .disabled-text {\n    color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .fade-text,\n[md-theme="@themeName"] .divider {\n    color: @backgroundDefaultContrast4;\n}\n\n/* Primary */\n[md-theme="@themeName"] .md-primary-bg {\n    background-color: @primaryDefaultColor;\n    color: @primaryDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg .secondary-text,\n[md-theme="@themeName"] .md-primary-bg .icon {\n    color: @primaryDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg .hint-text,\n[md-theme="@themeName"] .md-primary-bg .disabled-text {\n    color: @primaryDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg .fade-text,\n[md-theme="@themeName"] .md-primary-bg .divider {\n    color: @primaryDefaultContrast4;\n}\n\n/* Primary, Hue-1 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 {\n    background-color: @primaryHue1Color;\n    color: @primaryHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .icon {\n    color: @primaryHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .disabled-text {\n    color: @primaryHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .divider {\n    color: @primaryHue1Contrast4;\n}\n\n/* Primary, Hue-2 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 {\n    background-color: @primaryHue2Color;\n    color: @primaryHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .icon {\n    color: @primaryHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .disabled-text {\n    color: @primaryHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .divider {\n    color: @primaryHue2Contrast4;\n}\n\n/* Primary, Hue-3 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 {\n    background-color: @primaryHue3Color;\n    color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .icon {\n    color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .disabled-text {\n    color: @primaryHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .divider {\n    color: @primaryHue3Contrast4;\n}\n\n/* Primary foreground */\n[md-theme="@themeName"] .md-primary-fg {\n    color: @primaryDefaultColor !important;\n}\n\n/* Primary foreground, Hue-1 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-1 {\n    color: @primaryHue1Color !important;\n}\n\n/* Primary foreground, Hue-2 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-2 {\n    color: @primaryHue2Color !important;\n}\n\n/* Primary foreground, Hue-3 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-3 {\n    color: @primaryHue3Color !important;\n}\n\n/* Accent */\n[md-theme="@themeName"] .md-accent-bg {\n    background-color: @accentDefaultColor;\n    color: @accentDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg .secondary-text,\n[md-theme="@themeName"] .md-accent-bg .icon {\n    color: @accentDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg .hint-text,\n[md-theme="@themeName"] .md-accent-bg .disabled-text {\n    color: @accentDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg .fade-text,\n[md-theme="@themeName"] .md-accent-bg .divider {\n    color: @accentDefaultContrast4;\n}\n\n/* Accent, Hue-1 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 {\n    background-color: @accentHue1Color;\n    color: @accentHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .icon {\n    color: @accentHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .disabled-text {\n    color: @accentHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .divider {\n    color: @accentHue1Contrast4;\n}\n\n/* Accent, Hue-2 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 {\n    background-color: @accentHue2Color;\n    color: @accentHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .icon {\n    color: @accentHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .disabled-text {\n    color: @accentHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .divider {\n    color: @accentHue2Contrast4;\n}\n\n/* Accent, Hue-3 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 {\n    background-color: @accentHue3Color;\n    color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .icon {\n    color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .disabled-text {\n    color: @accentHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .divider {\n    color: @accentHue3Contrast4;\n}\n\n/* Accent foreground */\n[md-theme="@themeName"] .md-accent-fg {\n    color: @accentDefaultColor !important;\n}\n\n/* Accent foreground, Hue-1 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-1 {\n    color: @accentHue1Color !important;\n}\n\n/* Accent foreground, Hue-2 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-2 {\n    color: @accentHue2Color !important;\n}\n\n/* Accent foreground, Hue-3 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-3 {\n    color: @accentHue3Color !important;\n}\n\n/* Warn */\n[md-theme="@themeName"] .md-warn-bg {\n    background-color: @warnDefaultColor;\n    color: @warnDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg .secondary-text,\n[md-theme="@themeName"] .md-warn-bg .icon {\n    color: @warnDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg .hint-text,\n[md-theme="@themeName"] .md-warn-bg .disabled-text {\n    color: @warnDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg .fade-text,\n[md-theme="@themeName"] .md-warn-bg .divider {\n    color: @warnDefaultContrast4;\n}\n\n/* Warn, Hue-1 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 {\n    background-color: @warnHue1Color;\n    color: @warnHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .icon {\n    color: @warnHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .disabled-text {\n    color: @warnHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .divider {\n    color: @warnHue1Contrast4;\n}\n\n/* Warn, Hue-2 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 {\n    background-color: @warnHue2Color;\n    color: @warnHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .icon {\n    color: @warnHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .disabled-text {\n    color: @warnHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .divider {\n    color: @warnHue2Contrast4;\n}\n\n/* Warn, Hue-3 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 {\n    background-color: @warnHue3Color;\n    color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .icon {\n    color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .disabled-text {\n    color: @warnHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .divider {\n    color: @warnHue3Contrast4;\n}\n\n/* Warn foreground */\n[md-theme="@themeName"] .md-warn-fg {\n    color: @warnDefaultColor !important;\n}\n\n/* Warn foreground, Hue-1 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-1 {\n    color: @warnHue1Color !important;\n}\n\n/* Warn foreground, Hue-2 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-2 {\n    color: @warnHue2Color !important;\n}\n\n/* Warn foreground, Hue-3 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-3 {\n    color: @warnHue3Color !important;\n}\n\n/* Background */\n[md-theme="@themeName"] .md-background-bg {\n    background-color: @backgroundDefaultColor;\n    color: @backgroundDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg .secondary-text,\n[md-theme="@themeName"] .md-background-bg .icon {\n    color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg .hint-text,\n[md-theme="@themeName"] .md-background-bg .disabled-text {\n    color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg .fade-text,\n[md-theme="@themeName"] .md-background-bg .divider {\n    color: @backgroundDefaultContrast4;\n}\n\n/* Background, Hue-1 */\n[md-theme="@themeName"] .md-background-bg.md-hue-1 {\n    background-color: @backgroundHue1Color;\n    color: @backgroundHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .icon {\n    color: @backgroundHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .disabled-text {\n    color: @backgroundHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .divider {\n    color: @backgroundHue1Contrast4;\n}\n\n/* Background, Hue-2 */\n[md-theme="@themeName"] .md-background-bg.md-hue-2 {\n    background-color: @backgroundHue2Color;\n    color: @backgroundHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .icon {\n    color: @backgroundHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .disabled-text {\n    color: @backgroundHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .divider {\n    color: @backgroundHue2Contrast4;\n}\n\n/* Background, Hue-3 */\n[md-theme="@themeName"] .md-background-bg.md-hue-3 {\n    background-color: @backgroundHue3Color;\n    color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .icon {\n    color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .disabled-text {\n    color: @backgroundHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .divider {\n    color: @backgroundHue3Contrast4;\n}\n\n/* Background foreground */\n[md-theme="@themeName"] .md-background-fg {\n    color: @backgroundDefaultColor !important;\n}\n\n/* Background foreground, Hue-1 */\n[md-theme="@themeName"] .md-background-fg.md-hue-1 {\n    color: @backgroundHue1Color !important;\n}\n\n/* Background foreground, Hue-2 */\n[md-theme="@themeName"] .md-background-fg.md-hue-2 {\n    color: @backgroundHue2Color !important;\n}\n\n/* Background foreground, Hue-3 */\n[md-theme="@themeName"] .md-background-fg.md-hue-3 {\n    color: @backgroundHue3Color !important;\n}'.replace(a,function(e){return t[e]}),s=angular.element("head"),(o=angular.element('<style type="text/css"></style>')).html(i),s.append(o)})},rgba:l};function l(e,n){var t=n||!1;return 4===e.length&&255===e[0]&&255===e[1]&&255===e[2]&&e.splice(3,4),t&&(e=function(e,n){var t={white:{1:"1",2:"0.7",3:"0.3",4:"0.12"},black:{1:"0.87",2:"0.54",3:"0.26",4:"0.12"}};255===e[0]&&255===e[1]&&255===e[2]?e[3]=t.white[n]:0===e[0]&&0===e[1]&&0===e[2]&&(e[3]=t.black[n]);return e}(e,t)),3===e.length?"rgb("+e.join(",")+")":4===e.length?"rgba("+e.join(",")+")":void a.error("Invalid number of arguments supplied in the color array: "+e.length+"\nThe array must have 3 or 4 colors.")}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}}e.$inject=["$cookies","$log","motionTheming"],angular.module("app.core").factory("motionGenerator",e)}(),function(){"use strict";angular.module("app.core").constant("motionPalettes",[{name:"motion-blue",options:{50:"#ebf1fa",100:"#c2d4ef",200:"#9ab8e5",300:"#78a0dc",400:"#5688d3",500:"#3470ca",600:"#2e62b1",700:"#275498",800:"#21467e",900:"#1a3865",A100:"#c2d4ef",A200:"#9ab8e5",A400:"#5688d3",A700:"#275498",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}},{name:"motion-paleblue",options:{50:"#ececee",100:"#c5c6cb",200:"#9ea1a9",300:"#7d818c",400:"#5c616f",500:"#3c4252",600:"#353a48",700:"#2d323e",800:"#262933",900:"#1e2129",A100:"#c5c6cb",A200:"#9ea1a9",A400:"#5c616f",A700:"#2d323e",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}}])}(),function(){"use strict";angular.module("app.core").constant("motionThemes",{default:{primary:{name:"motion-paleblue",hues:{default:"700","hue-1":"500","hue-2":"600","hue-3":"400"}},accent:{name:"light-blue",hues:{default:"600","hue-1":"400","hue-2":"700","hue-3":"A100"}},warn:{name:"red"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},pinkTheme:{primary:{name:"blue-grey",hues:{default:"800","hue-1":"600","hue-2":"400","hue-3":"A100"}},accent:{name:"pink",hues:{default:"400","hue-1":"300","hue-2":"600","hue-3":"A100"}},warn:{name:"blue"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},tealTheme:{primary:{name:"motion-blue",hues:{default:"900","hue-1":"600","hue-2":"500","hue-3":"A100"}},accent:{name:"teal",hues:{default:"500","hue-1":"400","hue-2":"600","hue-3":"A100"}},warn:{name:"deep-orange"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}}})}(),function(){"use strict";function e(t,e,n){var a;angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.getObject("motion.customTheme");i&&(n.custom=i),t.alwaysWatchTheme(!0),angular.forEach(e,function(e){t.definePalette(e.name,e.options)}),angular.forEach(n,function(e,n){t.theme(n).primaryPalette(e.primary.name,e.primary.hues).accentPalette(e.accent.name,e.accent.hues).warnPalette(e.warn.name,e.warn.hues).backgroundPalette(e.background.name,e.background.hues)})}e.$inject=["$mdThemingProvider","motionPalettes","motionThemes"],angular.module("app.core").config(e)}(),function(){"use strict";function e(n,t,e){var a={getRegisteredPalettes:function(){return e.PALETTES},getRegisteredThemes:function(){return e.THEMES},setActiveTheme:function(e){if(angular.isUndefined(a.themes.list[e]))return angular.isUndefined(a.themes.list.default)?void t.error('You must have at least one theme named "default"'):(t.warn('The theme "'+e+'" does not exist! Falling back to the "default" theme.'),a.themes.active.name="default",a.themes.active.theme=a.themes.list.default,void n.put("motion.selectedTheme",a.themes.active.name));a.themes.active.name=e,a.themes.active.theme=a.themes.list[e],n.put("motion.selectedTheme",e)},setThemesList:function(e){a.themes.list=e},themes:{list:{},active:{name:"",theme:{}}}};return a}e.$inject=["$cookies","$log","$mdTheming"],angular.module("app.core").service("motionTheming",e)}(),function(){"use strict";function e(n,s,o,r){this.search=function(n){for(var e=[],t=r.getFlatNavigation(),a=o.defer(),i=0;i<t.length;i+=1)t[i].uisref&&e.push(t[i]);n&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(n)))return!0}));return s(function(){a.resolve(e)},1e3),a.promise},this.searchResultClick=function(e){e.uisref&&(e.stateParams?n.go(e.state,e.stateParams):n.go(e.state))}}e.$inject=["$state","$timeout","$q","msNavigationService"],angular.module("app.errors.error-404").controller("Error404Controller",e)}(),function(){"use strict";function e(e,n){var t=this;t.code="",t.send=!1,t.error=e.params,t.sendReport=function(){n.post("/api/jira",t.error).then(function(e){t.send=!0,e.data&&(t.code=e.data.id)},function(e){t.send=!1})}}e.$inject=["$state","$http"],angular.module("app.errors.error-500").controller("Error500Controller",e)}(),function(){"use strict";function e(e,n,t){var a=this;a.currentUser=e.getCurrentUser(),a.cookieAlertHide=n.get("motion.cookieAlertHide:"+a.currentUser.id)||!1,a.cookieAlertOnClose=function(){n.put("motion.cookieAlertHide:"+a.currentUser.id,!0)},a.onInit=function(){t.setting.get({id:1}).$promise.then(function(e){e&&(a.cookieAlertHide=!e.disabledCookie)})},a.onInit()}e.$inject=["Auth","$cookies","api"],angular.module("app.footer").controller("FooterController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.form={},s.forgotPassword=function(){return i.auth.forgot(s.form).$promise.then(function(){n.success({title:t.instant("FORGOTPASSWORD.LINK_SENT"),msg:t.instant("FORGOTPASSWORD.LINNK_SENT_MESSAGE")})}).catch(function(e){e&&n.error({title:t.instant("FORGOTPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},s.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general")}}e.$inject=["Auth","toasty","$translate","$state","api"],angular.module("app.forgot").controller("ForgotPasswordController",e)}(),function(){"use strict";function e(e,n){var t=this;t.currentUser=e.getCurrentUser(),t.newsAlertHide=n.get("motion.newsAlertHide:"+t.currentUser.id)||!1,t.newsAlertOnClose=function(){n.put("motion.newsAlertHide:"+t.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.header").controller("HeaderController",e)}(),function(){"use strict";function e(e,o){var r={getResourcesByRole:function(e,n,t,a,i,s){return o.getResources(r,e,n,t,a,i,s)}};return r.baseUrl="api/",r.auth=e(r.baseUrl+"auth/local",{},{local:{method:"post",url:r.baseUrl+"auth/local"},forgot:{method:"post",url:r.baseUrl+"auth/local/forgot"},reset:{method:"post",url:r.baseUrl+"auth/local/reset/:token",params:{token:"@token"}},user:{method:"get",url:r.baseUrl+"auth/local/user/:token",params:{token:"@token"}},google:{method:"post",url:r.baseUrl+"auth/google"},activedirectory:{method:"post",url:r.baseUrl+"auth/activedirectory"}}),r.jira=e(r.baseUrl+"jira"),r.rpc=e(r.baseUrl+"rpc",{},{startMonitor:{method:"get",url:r.baseUrl+"rpc/voice/channels/:uniqueid/mixmonitor",params:{uniqueid:"@uniqueid"}},stopMonitor:{method:"get",url:r.baseUrl+"rpc/voice/channels/:uniqueid/stopmixmonitor",params:{uniqueid:"@uniqueid"}},getVoiceChannels:{method:"get",url:r.baseUrl+"rpc/voice/channels"},getVoiceQueues:{method:"get",url:r.baseUrl+"rpc/voice/queues"},getChatQueues:{method:"get",url:r.baseUrl+"rpc/chat/queues"},getMailQueues:{method:"get",url:r.baseUrl+"rpc/mail/queues"},getSmsQueues:{method:"get",url:r.baseUrl+"rpc/sms/queues"},getWhatsappQueues:{method:"get",url:r.baseUrl+"rpc/whatsapp/queues"},getOpenchannelQueues:{method:"get",url:r.baseUrl+"rpc/openchannel/queues"},getFaxQueues:{method:"get",url:r.baseUrl+"rpc/fax/queues"},getVoiceQueuesPreview:{method:"get",url:r.baseUrl+"rpc/voice/queues/preview/:id"},getVoiceQueuesChannels:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels"},getVoiceQueuesChannel:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid"},getVoiceQueuesChannelHangup:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid/hangup"},getVoiceQueuesChannelRedirect:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid/redirect/:exten"},getOutbound:{method:"get",url:r.baseUrl+"rpc/outbound"},getOutboundChannels:{method:"get",url:r.baseUrl+"rpc/outbound/channels"},getAgents:{method:"get",url:r.baseUrl+"rpc/agents"},setAgentCapacity:{method:"put",url:r.baseUrl+"rpc/agents/:id/capacity",params:{id:"@id"}},getTelephones:{method:"get",url:r.baseUrl+"rpc/telephones"},getTrunks:{method:"get",url:r.baseUrl+"rpc/trunks"},getCampaigns:{method:"get",url:r.baseUrl+"rpc/campaigns"},getMailAccounts:{method:"get",url:r.baseUrl+"rpc/mail/accounts"},getFaxAccounts:{method:"get",url:r.baseUrl+"rpc/fax/accounts"},getChatQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/chat/queues/waitinginteractions"},getMailQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/mail/queues/waitinginteractions"},getOpenchannelQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/openchannel/queues/waitinginteractions"},getOpenchannelQueuesIdWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/openchannel/queues/:id/waitinginteractions"},getSmsQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/sms/queues/waitinginteractions"},getFaxQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/fax/queues/waitinginteractions"},getWhatsappQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/whatsapp/queues/waitinginteractions"},mailQueueNotify:{method:"post",url:r.baseUrl+"rpc/mail/queues/:id/notify",params:{id:"@id"}},chatQueueNotify:{method:"post",url:r.baseUrl+"rpc/chat/queues/:id/notify",params:{id:"@id"}},faxQueueNotify:{method:"post",url:r.baseUrl+"rpc/fax/queues/:id/notify",params:{id:"@id"}},smsQueueNotify:{method:"post",url:r.baseUrl+"rpc/sms/queues/:id/notify",params:{id:"@id"}},openchannelQueueNotify:{method:"post",url:r.baseUrl+"rpc/openchannel/queues/:id/notify",params:{id:"@id"}},agentNotify:{method:"post",url:r.baseUrl+"rpc/agents/:id/notify",params:{id:"@id"}}}),r.version=e(r.baseUrl+"version",{},{fetch:{method:"get",url:r.baseUrl+"version/fetch"},reset:{method:"get",url:r.baseUrl+"version/reset"},pull:{method:"get",url:r.baseUrl+"version/pull"},restart:{method:"get",url:r.baseUrl+"version/restart"},migrations:{method:"get",url:r.baseUrl+"version/migrations"}}),r.system=e(r.baseUrl+"system",{},{killProcess:{method:"get",url:r.baseUrl+"system/process/:pid/kill",params:{pid:"@pid"}}}),r.pm2=e(r.baseUrl+"pm2/:id",{id:"@id"},{update:{method:"put",isArray:!0}}),r.user=e(r.baseUrl+"users/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"users/describe"},clone:{method:"post",url:r.baseUrl+"users/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/contacts"},bulkCreate:{isArray:!1,method:"post",url:r.baseUrl+"users/create_many"},changePassword:{isArray:!1,method:"put",url:r.baseUrl+"users/:id/password"},addQueues:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/queues"},addAvatar:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/avatar"},getAvatar:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/avatar"},getOpenTabs:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/open_tabs"},getContacts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/contacts"},getQueues:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/queues"},getVoiceQueuesRt:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/queues_rt"},getGroups:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/groups"},getRecordings:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/recordings"},getScreenRecordings:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/screen_recordings"},getChatInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/chat/interactions"},getOpenchannelInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/openchannel/interactions"},getMailInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/mail/interactions"},getSmsInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/sms/interactions"},getFaxInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/fax/interactions"},getWhatsappInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/whatsapp/interactions"},login:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/login"},logout:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/logout"},pause:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/pause"},unpause:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/unpause"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/teams"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/lists"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/agents"},addChatInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/chat_interactions"},removeChatInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/chat_interactions"},addMailInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/mail_interactions"},removeMailInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/mail_interactions"},addFaxInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/fax_interactions"},removeFaxInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/fax_interactions"},addSmsInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/sms_interactions"},removeSmsInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/sms_interactions"},addOpenchannelInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/openchannel_interactions"},removeOpenchannelInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/openchannel_interactions"},addWhatsappInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/whatsapp_interactions"},removeWhatsappInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/whatsapp_interactions"},getVoicePrefixes:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/prefixes"},getFaxAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/fax_accounts"},addFaxAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/fax_accounts"},removeFaxAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/fax_accounts"},getMailAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/mail_accounts"},addMailAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/mail_accounts"},removeMailAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/mail_accounts"},getOpenchannelAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/openchannel_accounts"},addOpenchannelAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/openchannel_accounts"},removeOpenchannelAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/openchannel_accounts"},getSmsAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/sms_accounts"},addSmsAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/sms_accounts"},removeSmsAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/sms_accounts"},getChatWebsites:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/chat_websites"},addChatWebsites:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/chat_websites"},removeChatWebsites:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/chat_websites"},getWhatsappAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/whatsapp_accounts"},addWhatsappAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/whatsapp_accounts"},removeWhatsappAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/whatsapp_accounts"},getSquareProjects:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/square_projects"},addSquareProjects:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/square_projects"},removeSquareProjects:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/square_projects"},getScheduledCalls:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/scheduled_calls"},getApiKey:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/api_key"},createApiKey:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/api_key"},removeApiKey:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/api_key"},whoami:{isArray:!1,method:"get",url:r.baseUrl+"users/whoami"},getPresence:{isArray:!1,method:"get",url:r.baseUrl+"users/presence"}}),r.voiceChanSpy=e(r.baseUrl+"voice/chanspy/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/chanspy/describe"},clone:{method:"post",url:r.baseUrl+"voice/chanspy/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceContext=e(r.baseUrl+"voice/contexts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/contexts/describe"},clone:{method:"post",url:r.baseUrl+"voice/contexts/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceExtension=e(r.baseUrl+"voice/extensions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/extensions/describe"},clone:{method:"post",url:r.baseUrl+"voice/extensions/:id/clone",params:{includeAll:"@includeAll"}},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"voice/extensions/:id/applications"}}),r.voiceMusicOnHold=e(r.baseUrl+"voice/mohs/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mohs/describe"},clone:{method:"post",url:r.baseUrl+"voice/mohs/:id/clone",params:{includeAll:"@includeAll"}},addSound:{isArray:!1,method:"post",url:r.baseUrl+"voice/mohs/:id/sounds"},removeSound:{isArray:!1,method:"delete",url:r.baseUrl+"voice/mohs/:id/sounds/:id2"},getSounds:{isArray:!1,method:"get",url:r.baseUrl+"voice/mohs/:id/sounds"}}),r.voiceQueue=e(r.baseUrl+"voice/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/queues/describe"},clone:{method:"post",url:r.baseUrl+"voice/queues/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_black"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"voice/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"voice/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/users"},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/members"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/lists"},addLists:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/lists"},removeLists:{isArray:!0,method:"delete",url:r.baseUrl+"voice/queues/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:r.baseUrl+"voice/queues/:id/blacklists"}}),r.voiceRecording=e(r.baseUrl+"voice/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/recordings/describe"},clone:{method:"post",url:r.baseUrl+"voice/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},downloads:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/downloads"},runTranscribe:{isArray:!1,method:"post",url:r.baseUrl+"voice/recordings/:id/transcribe"},downloadTranscribe:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/transcribe",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.screenRecording=e(r.baseUrl+"screen/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"screen/recordings/describe"},clone:{method:"post",url:r.baseUrl+"screen/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"screen/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.voiceMail=e(r.baseUrl+"voice/mails/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mails/describe"},clone:{method:"post",url:r.baseUrl+"voice/mails/:id/clone",params:{includeAll:"@includeAll"}},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"voice/mails/:id/messages"}}),r.voiceMailMessage=e(r.baseUrl+"voice/mails/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mails/messages/describe"},clone:{method:"post",url:r.baseUrl+"voice/mails/messages/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"voice/mails/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.voiceCallReport=e(r.baseUrl+"voice/calls/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/calls/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/calls/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceDialReport=e(r.baseUrl+"voice/dials/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/dials/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/dials/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceAgentReport=e(r.baseUrl+"voice/agents/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/agents/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/agents/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceQueueReport=e(r.baseUrl+"voice/queues/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/queues/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/queues/reports/:id/clone",params:{includeAll:"@includeAll"}},getVoiceQueuesReport:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/reports/index"}}),r.memberReport=e(r.baseUrl+"members/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"members/reports/describe"},clone:{method:"post",url:r.baseUrl+"members/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.trunk=e(r.baseUrl+"trunks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"trunks/describe"},clone:{method:"post",url:r.baseUrl+"trunks/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceTransferReport=e(r.baseUrl+"voice/transfers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/transfers/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/transfers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailServerOut=e(r.baseUrl+"mail/out_servers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/out_servers/describe"},clone:{method:"post",url:r.baseUrl+"mail/out_servers/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailAccount=e(r.baseUrl+"mail/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/accounts/describe"},clone:{method:"post",url:r.baseUrl+"mail/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/canned_answers"},getImap:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/in_servers"},addImap:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/in_servers"},removeImap:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/in_servers"},getSmtp:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/out_servers"},addSmtp:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/out_servers"},removeSmtp:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/out_servers"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/applications"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/messages"},send:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/send"},verifySmtp:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/verify"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"mail/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/users"}}),r.mailQueue=e(r.baseUrl+"mail/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/queues/describe"},clone:{method:"post",url:r.baseUrl+"mail/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"mail/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"mail/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"mail/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"mail/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/users"}}),r.mailSubstatus=e(r.baseUrl+"mail/substatuses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/substatuses/describe"},clone:{method:"post",url:r.baseUrl+"mail/substatuses/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailInteraction=e(r.baseUrl+"mail/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/interactions/describe"},clone:{method:"post",url:r.baseUrl+"mail/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"mail/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"mail/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"mail/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"mail/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"mail/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.mailMessage=e(r.baseUrl+"mail/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/messages/describe"},clone:{method:"post",url:r.baseUrl+"mail/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"mail/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"mail/messages/:id/reject"},download:{isArray:!1,method:"get",url:r.baseUrl+"mail/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.mailApplication=e(r.baseUrl+"mail/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/applications/describe"},clone:{method:"post",url:r.baseUrl+"mail/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailQueueReport=e(r.baseUrl+"mail/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"mail/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.dashboard=e(r.baseUrl+"dashboards/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dashboards/describe"},clone:{method:"post",url:r.baseUrl+"dashboards/:id/clone",params:{includeAll:"@includeAll"}},addItem:{isArray:!1,method:"post",url:r.baseUrl+"dashboards/:id/items"},getItems:{isArray:!1,method:"get",url:r.baseUrl+"dashboards/:id/items"}}),r.dashboardItem=e(r.baseUrl+"dashboards/items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dashboards/items/describe"},clone:{method:"post",url:r.baseUrl+"dashboards/items/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxAccount=e(r.baseUrl+"fax/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/accounts/describe"},clone:{method:"post",url:r.baseUrl+"fax/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/canned_answers"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/applications"},addAccountApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/addaccountapplications"},updateAccountApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/updateaccountapplications"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/messages"},send:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/send"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"fax/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/users"}}),r.faxApplication=e(r.baseUrl+"fax/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/applications/describe"},clone:{method:"post",url:r.baseUrl+"fax/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxInteraction=e(r.baseUrl+"fax/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/interactions/describe"},clone:{method:"post",url:r.baseUrl+"fax/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"fax/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"fax/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"fax/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"fax/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"fax/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.faxMessage=e(r.baseUrl+"fax/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/messages/describe"},clone:{method:"post",url:r.baseUrl+"fax/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"fax/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"fax/messages/:id/reject"},download:{isArray:!1,method:"get",url:r.baseUrl+"fax/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.faxQueue=e(r.baseUrl+"fax/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/queues/describe"},clone:{method:"post",url:r.baseUrl+"fax/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"fax/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"fax/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"fax/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"fax/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/users"}}),r.faxQueueReport=e(r.baseUrl+"fax/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"fax/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsAccount=e(r.baseUrl+"sms/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/accounts/describe"},clone:{method:"post",url:r.baseUrl+"sms/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/interactions"},send:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/send"},status:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/status"},statusGet:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/status"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"sms/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/users"}}),r.smsApplication=e(r.baseUrl+"sms/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/applications/describe"},clone:{method:"post",url:r.baseUrl+"sms/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsInteraction=e(r.baseUrl+"sms/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/interactions/describe"},clone:{method:"post",url:r.baseUrl+"sms/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"sms/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"sms/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"sms/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"sms/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"sms/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.smsMessage=e(r.baseUrl+"sms/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/messages/describe"},clone:{method:"post",url:r.baseUrl+"sms/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"sms/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"sms/messages/:id/reject"},status:{isArray:!1,method:"post",url:r.baseUrl+"sms/messages/:id/status"}}),r.smsQueue=e(r.baseUrl+"sms/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/queues/describe"},clone:{method:"post",url:r.baseUrl+"sms/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"sms/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"sms/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"sms/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"sms/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/users"}}),r.openchannelAccount=e(r.baseUrl+"openchannel/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/accounts/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/interactions"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/users"},send:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/send"}}),r.openchannelApplication=e(r.baseUrl+"openchannel/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/applications/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.openchannelInteraction=e(r.baseUrl+"openchannel/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/interactions/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.openchannelMessage=e(r.baseUrl+"openchannel/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/messages/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"openchannel/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"openchannel/messages/:id/reject"}}),r.openchannelQueue=e(r.baseUrl+"openchannel/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/queues/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/users"}}),r.chatWebsite=e(r.baseUrl+"chat/websites/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/websites/describe"},clone:{method:"post",url:r.baseUrl+"chat/websites/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/canned_answers"},addLogo:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/logo"},addAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/avatar"},addCustomerAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/customer_avatar"},addSystemAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/system_avatar"},getLogo:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/logo"},getAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/avatar"},getCustomerAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/customer_avatar"},getSystemAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/system_avatar"},notify:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/notify"},offline:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/offline"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/interactions"},getSnippet:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/snippet"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/applications"},addProactiveActions:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/proactive_actions"},getProactiveActions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/proactive_actions"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/fields"},getOfflineMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/offline_messages"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"chat/websites/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/users"}}),r.openchannelQueueReport=e(r.baseUrl+"openchannel/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatApplication=e(r.baseUrl+"chat/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/applications/describe"},clone:{method:"post",url:r.baseUrl+"chat/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatInteraction=e(r.baseUrl+"chat/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/interactions/describe"},clone:{method:"post",url:r.baseUrl+"chat/interactions/:id/clone",params:{includeAll:"@includeAll"}},createVidaooSession:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/vidaoo"},customUpdate:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/custom_update"},abandon:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/abandon"},attachmentUpload:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/attachment_upload"},attachmentDownload:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/attachment_download"},close:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/close"},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/messages"},getMyMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/my_messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"chat/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.chatMessage=e(r.baseUrl+"chat/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"chat/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"chat/messages/:id/reject"}}),r.chatOfflineMessage=e(r.baseUrl+"chat/offline_messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/offline_messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/offline_messages/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatQueue=e(r.baseUrl+"chat/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/queues/describe"},clone:{method:"post",url:r.baseUrl+"chat/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"chat/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"chat/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"chat/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"chat/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/users"}}),r.chatGroup=e(r.baseUrl+"chat/groups/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/groups/describe"},clone:{method:"post",url:r.baseUrl+"chat/groups/:id/clone",params:{includeAll:"@includeAll"}},getUnread:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/unread"},addMembers:{isArray:!0,method:"post",url:r.baseUrl+"chat/groups/:id/members"},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/members"},removeMembers:{isArray:!1,method:"delete",url:r.baseUrl+"chat/groups/:id/members"},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"chat/groups/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/messages"}}),r.chatProactiveAction=e(r.baseUrl+"chat/proactive_actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/proactive_actions/describe"},clone:{method:"post",url:r.baseUrl+"chat/proactive_actions/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmCompany=e(r.baseUrl+"cm/companies/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/companies/describe"},clone:{method:"post",url:r.baseUrl+"cm/companies/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!1,method:"post",url:r.baseUrl+"cm/companies/:id/contacts"},getContacts:{isArray:!1,method:"get",url:r.baseUrl+"cm/companies/:id/contacts"}}),r.cmContact=e(r.baseUrl+"cm/contacts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/contacts/describe"},clone:{method:"post",url:r.baseUrl+"cm/contacts/:id/clone",params:{includeAll:"@includeAll"}},merge:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/merge"},bulkCreate:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/create_many"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/tags"},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hopper_finals"},getJscriptySessions:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/jscripty_sessions"},uploadCsv:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/csv"},upload:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/upload"},import:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/upload/:id"},getJourney:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/journey"}}),r.cmHopper=e(r.baseUrl+"cm/hopper/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper/:id/clone",params:{includeAll:"@includeAll"}},getPreview:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/preview"},getPreviewRecall:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/previewrecall"},getOpenContacts:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/opencontacts"},getTimezones:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/timezones"},getTimezone:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/timezone"}}),r.cmHopperBlack=e(r.baseUrl+"cm/hopper_black/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_black/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_black/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmHopperFinal=e(r.baseUrl+"cm/hopper_final/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_final/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_final/:id/clone",params:{includeAll:"@includeAll"}},countContactsQueueCampaignHopperFinal:{isArray:!0,method:"get",url:r.baseUrl+"cm/hopper_final/voice/queue/countAttributes/:id"},countContactsIvrCampaignHopperFinal:{isArray:!0,method:"get",url:r.baseUrl+"cm/hopper_final/campaign/countAttributes/:id"},moveContactsQueueCampaignHopperFinal:{isArray:!0,method:"post",url:r.baseUrl+"cm/hopper_final/voice/queue/moveContacts/:id"},moveContactsIvrCampaignHopperFinal:{isArray:!0,method:"post",url:r.baseUrl+"cm/hopper_final/voice/campaign/moveContacts/:id"},checkContactHopper:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper_final/checkContactHopper"}}),r.cmHopperHistory=e(r.baseUrl+"cm/hopper_history/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_history/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_history/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmCustomField=e(r.baseUrl+"cm/custom_fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/custom_fields/describe"},clone:{method:"post",url:r.baseUrl+"cm/custom_fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.action=e(r.baseUrl+"actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"actions/describe"},clone:{method:"post",url:r.baseUrl+"actions/:id/clone",params:{includeAll:"@includeAll"}}}),r.automation=e(r.baseUrl+"automations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"automations/describe"},clone:{method:"post",url:r.baseUrl+"automations/:id/clone",params:{includeAll:"@includeAll"}},addConditions:{isArray:!1,method:"post",url:r.baseUrl+"automations/:id/conditions"},getConditions:{isArray:!1,method:"get",url:r.baseUrl+"automations/:id/conditions"},addActions:{isArray:!1,method:"post",url:r.baseUrl+"automations/:id/actions"},getActions:{isArray:!1,method:"get",url:r.baseUrl+"automations/:id/actions"}}),r.cannedAnswer=e(r.baseUrl+"canned_answers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"canned_answers/describe"},clone:{method:"post",url:r.baseUrl+"canned_answers/:id/clone",params:{includeAll:"@includeAll"}}}),r.disposition=e(r.baseUrl+"dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dispositions/describe"},clone:{method:"post",url:r.baseUrl+"dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),r.condition=e(r.baseUrl+"conditions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"conditions/describe"},clone:{method:"post",url:r.baseUrl+"conditions/:id/clone",params:{includeAll:"@includeAll"}}}),r.interval=e(r.baseUrl+"intervals/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"intervals/describe"},clone:{method:"post",url:r.baseUrl+"intervals/:id/clone",params:{includeAll:"@includeAll"}},addInterval:{isArray:!1,method:"post",url:r.baseUrl+"intervals/:id/sub_intervals"},getIntervals:{isArray:!1,method:"get",url:r.baseUrl+"intervals/:id/sub_intervals"},addIntervals:{isArray:!0,method:"post",url:r.baseUrl+"intervals/:id/sub_intervals/create_many"}}),r.pause=e(r.baseUrl+"pauses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"pauses/describe"},clone:{method:"post",url:r.baseUrl+"pauses/:id/clone",params:{includeAll:"@includeAll"}}}),r.cdr=e(r.baseUrl+"cdr/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cdr/describe"},clone:{method:"post",url:r.baseUrl+"cdr/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceQueuesLog=e(r.baseUrl+"voiceQueuesLog/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voiceQueuesLog/describe"},clone:{method:"post",url:r.baseUrl+"voiceQueuesLog/:id/clone",params:{includeAll:"@includeAll"}}}),r.schedule=e(r.baseUrl+"schedules/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"schedules/describe"},clone:{method:"post",url:r.baseUrl+"schedules/:id/clone",params:{includeAll:"@includeAll"}},run:{isArray:!1,method:"get",url:r.baseUrl+"schedules/:id/run"}}),r.sound=e(r.baseUrl+"sounds/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sounds/describe"},clone:{method:"post",url:r.baseUrl+"sounds/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"sounds/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},delete:{isArray:!1,method:"delete",url:r.baseUrl+"sounds/:id"}}),r.tag=e(r.baseUrl+"tags/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"tags/describe"},clone:{method:"post",url:r.baseUrl+"tags/:id/clone",params:{includeAll:"@includeAll"}}}),r.template=e(r.baseUrl+"templates/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"templates/describe"},clone:{method:"post",url:r.baseUrl+"templates/:id/clone",params:{includeAll:"@includeAll"}}}),r.trigger=e(r.baseUrl+"triggers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"triggers/describe"},clone:{method:"post",url:r.baseUrl+"triggers/:id/clone",params:{includeAll:"@includeAll"}},addAllCondition:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/all_conditions"},addAnyCondition:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/any_conditions"},getAllConditions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/all_conditions"},getAnyConditions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/any_conditions"},addAction:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/actions"},getActions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/actions"}}),r.variable=e(r.baseUrl+"variables/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"variables/describe"},clone:{method:"post",url:r.baseUrl+"variables/:id/clone",params:{includeAll:"@includeAll"}}}),r.integration=e(r.baseUrl+"integrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/:id/clone",params:{includeAll:"@includeAll"}}}),r.integrationReport=e(r.baseUrl+"integrations/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/reports/describe"},clone:{method:"post",url:r.baseUrl+"integrations/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.analyticCustomReport=e(r.baseUrl+"analytics/custom_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/custom_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/custom_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/preview"},run:{isArray:!1,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/run"},query:{isArray:!1,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/query"}}),r.analyticDefaultReport=e(r.baseUrl+"analytics/default_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/default_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/default_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:r.baseUrl+"analytics/default_reports/:id/preview"},run:{isArray:!1,method:"get",url:r.baseUrl+"analytics/default_reports/:id/run"},query:{isArray:!1,method:"get",url:r.baseUrl+"analytics/default_reports/:id/query"}}),r.analyticExtractedReport=e(r.baseUrl+"analytics/extracted_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/extracted_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/extracted_reports/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"analytics/extracted_reports/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.analyticMetric=e(r.baseUrl+"analytics/metrics/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/metrics/describe"},clone:{method:"post",url:r.baseUrl+"analytics/metrics/:id/clone",params:{includeAll:"@includeAll"}}}),r.analyticFieldReport=e(r.baseUrl+"analytics/field_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/field_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/field_reports/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:r.baseUrl+"analytics/field_reports/create_many",isArray:!0},bulkDestroy:{method:"delete",url:r.baseUrl+"analytics/field_reports/destroy_many",isArray:!0},addFields:{isArray:!0,method:"post",url:r.baseUrl+"analytics/field_reports/:id/create_many"}}),r.analyticTreeReport=e(r.baseUrl+"analytics/tree_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/tree_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/tree_reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.intSalesforceAccount=e(r.baseUrl+"integrations/salesforce/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/salesforce/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/accounts/:id/fields"}}),r.intSalesforceConfiguration=e(r.baseUrl+"integrations/salesforce/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/descriptions"}}),r.intSalesforceField=e(r.baseUrl+"integrations/salesforce/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intSugarcrmAccount=e(r.baseUrl+"integrations/sugarcrm/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/fields"}}),r.intSugarcrmConfiguration=e(r.baseUrl+"integrations/sugarcrm/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/descriptions"}}),r.intSugarcrmField=e(r.baseUrl+"integrations/sugarcrm/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intDeskAccount=e(r.baseUrl+"integrations/desk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/desk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/accounts/:id/fields"}}),r.intDeskConfiguration=e(r.baseUrl+"integrations/desk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/desk/configurations/:id/tags"}}),r.intDeskField=e(r.baseUrl+"integrations/desk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intZohoAccount=e(r.baseUrl+"integrations/zoho/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/zoho/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/accounts/:id/fields"}}),r.intZohoConfiguration=e(r.baseUrl+"integrations/zoho/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/descriptions"}}),r.intZohoField=e(r.baseUrl+"integrations/zoho/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intZendeskAccount=e(r.baseUrl+"integrations/zendesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/zendesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/accounts/:id/fields"}}),r.intZendeskConfiguration=e(r.baseUrl+"integrations/zendesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/zendesk/configurations/:id/tags"}}),r.intZendeskField=e(r.baseUrl+"integrations/zendesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intFreshdeskAccount=e(r.baseUrl+"integrations/freshdesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/:id/fields"}}),r.intFreshdeskConfiguration=e(r.baseUrl+"integrations/freshdesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/freshdesk/configurations/:id/tags"}}),r.intFreshdeskField=e(r.baseUrl+"integrations/freshdesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intVtigerAccount=e(r.baseUrl+"integrations/vtiger/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/vtiger/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/accounts/:id/fields"}}),r.intVtigerConfiguration=e(r.baseUrl+"integrations/vtiger/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/descriptions"}}),r.intVtigerField=e(r.baseUrl+"integrations/vtiger/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intServicenowAccount=e(r.baseUrl+"integrations/servicenow/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/servicenow/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/accounts/:id/fields"}}),r.intServicenowConfiguration=e(r.baseUrl+"integrations/servicenow/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/descriptions"}}),r.intServicenowField=e(r.baseUrl+"integrations/servicenow/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intDynamics365Account=e(r.baseUrl+"integrations/dynamics365/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/:id/fields"}}),r.intDynamics365Configuration=e(r.baseUrl+"integrations/dynamics365/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/descriptions"}}),r.intDynamics365Field=e(r.baseUrl+"integrations/dynamics365/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intFreshsalesAccount=e(r.baseUrl+"integrations/freshsales/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/freshsales/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/accounts/:id/fields"}}),r.intFreshsalesConfiguration=e(r.baseUrl+"integrations/freshsales/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/configurations/:id/clone",params:{includeAll:"@includeAll"}},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/descriptions"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/fields"}}),r.intFreshsalesField=e(r.baseUrl+"integrations/freshsales/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.network=e(r.baseUrl+"networks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"networks/describe"},clone:{method:"post",url:r.baseUrl+"networks/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatQueueReport=e(r.baseUrl+"chat/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"chat/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatInternalMessage=e(r.baseUrl+"chat/internal/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/internal/messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/internal/messages/:id/clone",params:{includeAll:"@includeAll"}},getUsers:{isArray:!1,method:"get",url:r.baseUrl+"chat/internal/messages/users"}}),r.jscriptyAnswerReport=e(r.baseUrl+"jscripty/answers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/answers/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/answers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptyQuestionReport=e(r.baseUrl+"jscripty/questions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/questions/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/questions/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptySessionReport=e(r.baseUrl+"jscripty/sessions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/sessions/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/sessions/reports/:id/clone",params:{includeAll:"@includeAll"}},getQuestions:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/sessions/reports/:id/questions"}}),r.smsQueueReport=e(r.baseUrl+"sms/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"sms/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareReport=e(r.baseUrl+"square/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/reports/describe"},clone:{method:"post",url:r.baseUrl+"square/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareReportDetail=e(r.baseUrl+"square/details/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/details/reports/describe"},clone:{method:"post",url:r.baseUrl+"square/details/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptyProject=e(r.baseUrl+"jscripty/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/projects/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/projects/:id/clone",params:{includeAll:"@includeAll"}},getSessions:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/sessions"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/answers"},getSummary:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/summary",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.setting=e(r.baseUrl+"settings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"settings/describe"},clone:{method:"post",url:r.baseUrl+"settings/:id/clone",params:{includeAll:"@includeAll"}},addLogo:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/logo"},addLogoLogin:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/logo_login"},getLogo:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/logo"},getLogoLogin:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/logo_login"},gdpr:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/gdpr"},addPreferred:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/preferred"},getPreferred:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/preferred"},addFavicon:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/favicon"},getFavicon:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/favicon"},getDate:{isArray:!1,method:"get",url:r.baseUrl+"settings/now"}}),r.squareOdbc=e(r.baseUrl+"square/odbc/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/odbc/describe"},clone:{method:"post",url:r.baseUrl+"square/odbc/:id/clone",params:{includeAll:"@includeAll"}},test:{isArray:!1,method:"get",url:r.baseUrl+"square/odbc/:id/test"}}),r.squareProject=e(r.baseUrl+"square/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/projects/describe"},clone:{method:"post",url:r.baseUrl+"square/projects/:id/clone",params:{includeAll:"@includeAll"}},addUsers:{isArray:!0,method:"post",url:r.baseUrl+"square/projects/:id/users"},removeUsers:{isArray:!1,method:"delete",url:r.baseUrl+"square/projects/:id/users"},getUsers:{isArray:!1,method:"get",url:r.baseUrl+"square/projects/:id/users"}}),r.squareRecording=e(r.baseUrl+"square/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/recordings/describe"},clone:{method:"post",url:r.baseUrl+"square/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"square/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.squareMessage=e(r.baseUrl+"square/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/messages/describe"},clone:{method:"post",url:r.baseUrl+"square/messages/:id/clone",params:{includeAll:"@includeAll"}}}),r.team=e(r.baseUrl+"teams/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"teams/describe"},clone:{method:"post",url:r.baseUrl+"teams/:id/clone",params:{includeAll:"@includeAll"}},getQueues:{isArray:!0,method:"get",url:r.baseUrl+"teams/:id/queues"},addQueues:{isArray:!0,method:"post",url:r.baseUrl+"teams/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:r.baseUrl+"teams/:id/queues"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"teams/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"teams/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"teams/:id/users"}}),r.license=e(r.baseUrl+"license/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"license/describe"},clone:{method:"post",url:r.baseUrl+"license/:id/clone",params:{includeAll:"@includeAll"}},downloadLogFile:{isArray:!1,method:"get",url:r.baseUrl+"license/download_log_file",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.campaign=e(r.baseUrl+"campaigns/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"campaigns/describe"},clone:{method:"post",url:r.baseUrl+"campaigns/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_black"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/lists"},addLists:{isArray:!0,method:"post",url:r.baseUrl+"campaigns/:id/lists"},removeLists:{isArray:!0,method:"delete",url:r.baseUrl+"campaigns/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:r.baseUrl+"campaigns/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:r.baseUrl+"campaigns/:id/blacklists"}}),r.migration=e(r.baseUrl+"migrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"migrations/describe"},clone:{method:"post",url:r.baseUrl+"migrations/:id/clone",params:{includeAll:"@includeAll"}}}),r.attachment=e(r.baseUrl+"attachments/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"attachments/describe"},clone:{method:"post",url:r.baseUrl+"attachments/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"attachments/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.plugin=e(r.baseUrl+"plugins/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"plugins/describe"},clone:{method:"post",url:r.baseUrl+"plugins/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"plugins/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},upload:{isArray:!1,method:"post",url:r.baseUrl+"plugins/"},delete:{isArray:!1,method:"delete",url:r.baseUrl+"plugins/:id"},webhookGet:{isArray:!1,method:"get",url:r.baseUrl+"plugins/webhook"},webhookPost:{isArray:!1,method:"post",url:r.baseUrl+"plugins/webhook"}}),r.mailTransferReport=e(r.baseUrl+"mail/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"mail/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatTransferReport=e(r.baseUrl+"chat/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"chat/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxTransferReport=e(r.baseUrl+"fax/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"fax/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.openchannelTransferReport=e(r.baseUrl+"openchannel/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsTransferReport=e(r.baseUrl+"sms/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"sms/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmList=e(r.baseUrl+"cm/lists/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/lists/describe"},clone:{method:"post",url:r.baseUrl+"cm/lists/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"cm/lists/:id/dispositions"},addContacts:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/contacts"},getContacts:{isArray:!0,method:"get",url:r.baseUrl+"cm/lists/:id/contacts"},getContactsCsv:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/contacts/csv",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},addCustomField:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/fields"},getCustomFields:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/fields"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"cm/lists/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"cm/lists/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/users"}}),r.voicePrefix=e(r.baseUrl+"voice/prefixes/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/prefixes/describe"},clone:{method:"post",url:r.baseUrl+"voice/prefixes/:id/clone",params:{includeAll:"@includeAll"}},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"voice/prefixes/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"voice/prefixes/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"voice/prefixes/:id/users"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"voice/prefixes/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"voice/prefixes/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"voice/prefixes/:id/teams"}}),r.userProfile=e(r.baseUrl+"userProfiles/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfiles/describe"},clone:{method:"post",url:r.baseUrl+"userProfiles/:id/clone",params:{includeAll:"@includeAll"}},addSections:{isArray:!0,method:"post",url:r.baseUrl+"userProfiles/:id/sections"},removeSections:{isArray:!1,method:"delete",url:r.baseUrl+"userProfiles/:id/sections"},getSections:{isArray:!0,method:"get",url:r.baseUrl+"userProfiles/:id/sections"},addResources:{isArray:!0,method:"post",url:r.baseUrl+"userProfiles/:id/resources"},removeResources:{isArray:!1,method:"delete",url:r.baseUrl+"userProfiles/:id/resources"},getResources:{isArray:!1,method:"get",url:r.baseUrl+"userProfiles/:id/resources"}}),r.userProfileSection=e(r.baseUrl+"userProfile/sections/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfile/sections/describe"},clone:{method:"post",url:r.baseUrl+"userProfile/sections/:id/clone",params:{includeAll:"@includeAll"}}}),r.userProfileResource=e(r.baseUrl+"userProfile/resources/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfile/resources/describe"},clone:{method:"post",url:r.baseUrl+"userProfile/resources/:id/clone",params:{includeAll:"@includeAll"}}}),r.userNotification=e(r.baseUrl+"userNotifications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userNotifications/describe"},clone:{method:"post",url:r.baseUrl+"userNotifications/:id/clone",params:{includeAll:"@includeAll"}},sendUserNotification:{isArray:!1,method:"post",url:r.baseUrl+"userNotifications/"}}),r.whatsappAccount=e(r.baseUrl+"whatsapp/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/accounts/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/users"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/applications"},notify:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/notify"},send:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/send"}}),r.whatsappApplication=e(r.baseUrl+"whatsapp/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/applications/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappInteraction=e(r.baseUrl+"whatsapp/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/interactions/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.whatsappMessage=e(r.baseUrl+"whatsapp/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/messages/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"whatsapp/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"whatsapp/messages/:id/reject"},status:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/messages/:id/status"}}),r.whatsappQueueReport=e(r.baseUrl+"whatsapp/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappTransferReport=e(r.baseUrl+"whatsapp/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappQueue=e(r.baseUrl+"whatsapp/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/queues/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/users"}}),r.cloudProvider=e(r.baseUrl+"cloudProviders/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cloudProviders/describe"},clone:{method:"post",url:r.baseUrl+"cloudProviders/:id/clone",params:{includeAll:"@includeAll"}},oauth2MicrosoftAuthorize:{method:"get",url:r.baseUrl+"cloudProviders/:id/oauth2/microsoft/authorize"}}),r.realtime=e(r.baseUrl+"realtime",{},{getAgents:{isArray:!1,method:"get",url:r.baseUrl+"realtime/agents"},getQueues:{isArray:!1,method:"get",url:r.baseUrl+"realtime/queues"}}),r.userSetting=e(r.baseUrl+"user-settings/:id",{id:"@id"},{update:{method:"put",isArray:!1}}),r}e.$inject=["$resource","userProfileManager"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(e,n){n.setConfig({position:"top-right",sound:!1,html:!0,theme:"material"}),e.useLoader("$translatePartialLoader",{urlTemplate:"{part}/i18n/{lang}.json"}),e.preferredLanguage("en"),e.fallbackLanguage("en"),e.useSanitizeValueStrategy(null)}e.$inject=["$translateProvider","toastyConfigProvider"],angular.module("motion").config(e)}(),function(){"use strict";angular.module("motion")}(),function(){"use strict";function e(e,n,t,a){var i=this;i.themes=e.themes,i.direction="ltr";var s=t.get("motion.language");s&&(n.use(s),0<=["ar","fa","he"].indexOf(s)&&a.setting.get({id:1}).$promise.then(function(e){e&&e.rtlSupport&&(i.direction="rtl")}).catch(function(e){e&&toasty.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})}))}e.$inject=["motionTheming","$translate","$cookies","api"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(a,i){return function(e){var n=new Date,t=new Date(e);return t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()?a("date")(t.getTime(),"shortTime"):t.getDate()===n.getDate()-1&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()?i.instant("DASHBOARDS.YESTERDAY")+" "+a("date")(t.getTime(),"shortTime"):a("date")(t.getTime(),"MMM d, y h:mm a")}}function n(e){return{Today:e.instant("DASHBOARDS.TODAY"),Yesterday:e.instant("DASHBOARDS.YESTERDAY"),"This Week":e.instant("DASHBOARDS.THIS_WEEK"),"Last Week":e.instant("DASHBOARDS.LAST_WEEK"),"This Month":e.instant("DASHBOARDS.THIS_MONTH"),"Last Month":e.instant("DASHBOARDS.LAST_MONTH"),"This Year":e.instant("DASHBOARDS.THIS_YEAR"),"Last Year":e.instant("DASHBOARDS.LAST_YEAR"),January:e.instant("DASHBOARDS.JANUARY"),February:e.instant("DASHBOARDS.FEBRUARY"),March:e.instant("DASHBOARDS.MARCH"),April:e.instant("DASHBOARDS.APRIL"),May:e.instant("DASHBOARDS.MAY"),June:e.instant("DASHBOARDS.JUNE"),July:e.instant("DASHBOARDS.JULY"),August:e.instant("DASHBOARDS.AUGUST"),September:e.instant("DASHBOARDS.SEPTEMBER"),October:e.instant("DASHBOARDS.OCTOBER"),November:e.instant("DASHBOARDS.NOVEMBER"),December:e.instant("DASHBOARDS.DECEMBER"),Mon:e.instant("DASHBOARDS.MON"),Tue:e.instant("DASHBOARDS.TUE"),Wed:e.instant("DASHBOARDS.WED"),Thu:e.instant("DASHBOARDS.THU"),Fri:e.instant("DASHBOARDS.FRI"),Sat:e.instant("DASHBOARDS.SAT"),Sun:e.instant("DASHBOARDS.SUN")}}e.$inject=["$filter","$translate"],n.$inject=["$translate"],angular.module("motion").filter("limitObjectFromTo",function(){return function(e,n,t){var a,i={},s=0;for(a in e)if(t<=s&&(i[a]=e[a]),++s===t+n)break;return i}}).filter("formatdate",e).factory("IndexFactory",function(){var e=[{value:"jan"},{value:"feb"},{value:"mar"},{value:"apr"},{value:"may"},{value:"jun"},{value:"jul"},{value:"aug"},{value:"sep"},{value:"oct"},{value:"nov"},{value:"dec"}],n=[{value:"1"},{value:"2"},{value:"3"},{value:"4"},{value:"5"},{value:"6"},{value:"7"},{value:"8"},{value:"9"},{value:"10"},{value:"11"},{value:"12"}],t=[{value:"mon"},{value:"tue"},{value:"wed"},{value:"thu"},{value:"fri"},{value:"sat"},{value:"sun"}],a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];return{getMonthName:function(){return e},getMonthNumber:function(){return n},getDaysOfWeek:function(){return t},getDaysOfMonth:function(){return a}}}).factory("dateFilterLocalizationFactory",n).factory("jscookie",function(){return Cookies}).factory("Sequence",function(){return{enqueue:function(e){this.tail=this.tail?this.tail.finally(e):e()}}})}(),function(){"use strict";function e(e,n,t){var a;t.html5Mode(!0),n.otherwise("/dashboards/general"),angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.get("motion.layoutStyle")||"verticalNavigation",s={verticalNavigation:{main:"app/core/layouts/vertical-navigation.html",toolbar:"app/toolbar/layouts/vertical-navigation/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html",header:"app/header/layouts/vertical-navigation/header.html",footer:"app/footer/layouts/vertical-navigation/footer.html"},verticalNavigationFullwidthToolbar:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html"},verticalNavigationFullwidthToolbar2:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar-2/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html"},horizontalNavigation:{main:"app/core/layouts/horizontal-navigation.html",toolbar:"app/toolbar/layouts/horizontal-navigation/toolbar.html",navigation:"app/navigation/layouts/horizontal-navigation/navigation.html"},contentOnly:{main:"app/core/layouts/content-only.html",toolbar:"",navigation:""},contentWithToolbar:{main:"app/core/layouts/content-with-toolbar.html",toolbar:"app/toolbar/layouts/content-with-toolbar/toolbar.html",navigation:""}};e.state("app",{abstract:!0,views:{"main@":{templateUrl:s[i].main,controller:"MainController as vm"},"toolbar@app":{templateUrl:s[i].toolbar,controller:"ToolbarController as vm"},"navigation@app":{templateUrl:s[i].navigation,controller:"NavigationController as vm"},"quickPanel@app":{templateUrl:"app/quick-panel/quick-panel.html",controller:"QuickPanelController as vm"},"header@app":{templateUrl:s[i].header,controller:"HeaderController as vm"},"footer@app":{templateUrl:s[i].footer,controller:"FooterController as vm"}},resolve:{license:["apiResolver",function(e){return e.resolve("license@get")}],setting:["apiResolver","settingsManager",function(e,n){return e.resolve("setting@get",{id:1}).then(function(e){return n.set(e),e})}]}})}e.$inject=["$stateProvider","$urlRouterProvider","$locationProvider"],angular.module("motion").config(e)}(),function(){"use strict";function e(e,n){e.onStart({},n.showLoadingIndicator),e.onFinish({},n.hideLoadingIndicator)}e.$inject=["$transitions","LoadingIndicatorService"],angular.module("motion").run(e)}(),function(){"use strict";function e(a,e){var i,o={};function s(){a.$broadcast("socket:connect"),i&&i.connected||(i=io({query:e.getCurrentUser()?"id="+e.getCurrentUser().id:void 0,transports:["websocket","polling"]})).once("disconnect",n)}function n(e){i.once("connect",s),"logout"===e?i.removeAllListeners():a.$broadcast("socket:disconnect"),i&&i.connected&&i.disconnect()}function r(e,n,t){o[e]||(o[e]=[]),o[e].push({wrapper:n,fn:t})}return{connect:s,disconnect:n,getListeners:function(e){return e?o[e]:o},on:function(e,n){n=n||angular.noop,i||s();var t=function(){var e=arguments;a.$applyAsync(function(){n.apply(i,e)})};r(e,t,n),i.on(e,t)},onWithoutApply:function(e,n){n=n||angular.noop,i||s();var t=function(){n.apply(i,arguments)};r(e,t,n),i.on(e,t)},emit:function(e,n,t){t=t||angular.noop,i||s(),i.emit(e,n,function(){var e=arguments;a.$applyAsync(function(){t.apply(i,e)})})},removeAllListeners:function(e){var n;i||s(),i.removeAllListeners(e),n=e,_.isEmpty(o[n])||delete o[n]},removeListener:function(e,n){i||s();var t=function(e,n){var t=o[e];if(!_.isEmpty(t))for(var a=0;a<t.length;a++){var i=t[a];if(i.fn===n){var s=i.wrapper;return t.splice(a,1),s}}}(e,n);i.removeListener(e,t)}}}e.$inject=["$rootScope","Auth"],angular.module("motion").factory("socket",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o,r){var l=this;l.progresslogin=!1,l.googleSsoEnabled=!1,l.adSsoEnabled=!1,l.login=function(){return l.progresslogin=!0,l.message="",s.login(l.form).then(function(){return n.go("app.dashboards.general")}).catch(function(e){l.message=e.data?e.data.message:e.message}).finally(function(){l.progresslogin=!1})},l.loginOauth=function(e){l.message="",t.location.href=s.loginSSO(e)},l.loginAD=function(){return l.progresslogin=!0,l.message="",s.loginAD(l.form).then(function(){return n.go("app.dashboards.general")}).catch(function(e){l.message=e.data?e.data.message:e.message}).finally(function(){l.progresslogin=!1})},l.onInit=function(){{if(n.params.token&&n.params.userId)return s.removeCookies(),l.progresslogin=!0,o.secureCookieEnabled?r.set("motion.token",n.params.token,{secure:!0,sameSite:"none"}):r.set("motion.token",n.params.token),i.user.get({id:n.params.userId}).$promise.then(function(e){e&&(s.setCurrentUser(e),n.go("app.dashboards.general"))}).finally(function(){l.progresslogin=!1});s.isLoggedIn()&&n.go("app.dashboards.general")}l.googleSsoEnabled=o.googleSsoEnabled,l.adSsoEnabled=o.adSsoEnabled},l.onInit()}e.$inject=["$state","$window","$cookies","$timeout","api","Auth","setting","jscookie"],angular.module("app.login").controller("LoginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_EXTRACTEDREPORT",g.extractedReport=angular.copy(l),g.extractedReports=r,g.newExtractedReport=!1,g.extractedReport||(g.extractedReport={},g.title="ANALYTICS.NEW_EXTRACTEDREPORT",g.newExtractedReport=!0),g.addNewExtractedReport=function(){g.errors=[],d.analyticExtractedReport.save(g.extractedReport).$promise.then(function(e){g.extractedReports.unshift(e.toJSON()),o.success({title:"ExtractedReport properly created",msg:g.extractedReport.name?g.extractedReport.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveExtractedReport=function(){g.errors=[],d.analyticExtractedReport.update({id:g.extractedReport.id},g.extractedReport).$promise.then(function(e){var n=_.find(g.extractedReports,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ExtractedReport properly saved!",msg:g.extractedReport.name?g.extractedReport.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteExtractedReport=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The extractedReport will be deleted.").ariaLabel("Delete ExtractedReport").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.analyticExtractedReport.delete({id:g.extractedReport.id}).$promise.then(function(){_.remove(g.extractedReports,{id:g.extractedReport.id}),o.success({title:"ExtractedReport properly deleted!",msg:(g.extractedReport.name||"extractedReport")+" has been deleted!"}),v(g.extractedReport)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","extractedReports","extractedReport","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditExtractedReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.extractedReports=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="extractedReports",f.listOrder="",f.listOrderAsc=null,f.selectedExtractedReports=[],f.query={fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{extractedReport:e,extractedReports:f.extractedReports.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.downloadfile2=function(s,e){return m.analyticExtractedReport.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.savename;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("extractedReport")+"?").htmlContent("<b>"+(e.name||"extractedReport")+"</b> will be deleted.").ariaLabel("delete extractedReport").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getExtractedReports=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.analyticExtractedReport.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ExtractedReports",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditExtractedReport=function(e,n){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{extractedReport:n,extractedReports:f.extractedReports.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteExtractedReport=y,f.exportSelectedExtractedReports=function(){var e=angular.copy(f.selectedExtractedReports);return f.selectedExtractedReports=[],e},f.deleteSelectedExtractedReports=function(e){var n=i.confirm().title("Are you sure want to delete the selected extractedReports?").htmlContent("<b>"+f.selectedExtractedReports.length+" selected</b> will be deleted.").ariaLabel("delete ExtractedReports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedExtractedReports.forEach(function(e){y(e)}),f.selectedExtractedReports=[]})},f.deselectExtractedReports=function(){f.selectedExtractedReports=[]},f.selectAllExtractedReports=function(){f.selectedExtractedReports=f.extractedReports.rows};var b=!0,A=1;function E(e){f.extractedReports=e||{count:0,rows:[]}}function y(e){m.analyticExtractedReport.delete({id:e.id}).$promise.then(function(){_.remove(f.extractedReports.rows,{id:e.id}),f.extractedReports.count-=1,f.extractedReports.rows.length||f.getExtractedReports(),p.success({title:_.startCase("ExtractedReport")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticExtractedReport"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticExtractedReport",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getExtractedReports())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","extractedReports","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.analytics").controller("ExtractedReportsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_METRIC",g.metric=angular.copy(l),g.metrics=r,g.newMetric=!1,g.metric||(g.metric={table:"report_agent"},g.title="ANALYTICS.NEW_METRIC",g.newMetric=!0),g.addNewMetric=function(){g.errors=[],d.analyticMetric.save(g.metric).$promise.then(function(e){g.metrics.unshift(e.toJSON()),o.success({title:"Metric properly created",msg:g.metric.name?g.metric.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMetric=function(){g.errors=[],d.analyticMetric.update({id:g.metric.id},g.metric).$promise.then(function(e){var n=_.find(g.metrics,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Metric properly saved!",msg:g.metric.name?g.metric.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMetric=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The metric will be deleted.").ariaLabel("Delete Metric").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.analyticMetric.delete({id:g.metric.id}).$promise.then(function(){_.remove(g.metrics,{id:g.metric.id}),o.success({title:"Metric properly deleted!",msg:(g.metric.name||"metric")+" has been deleted!"}),v(g.metric)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","metrics","metric","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditMetricDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.metrics=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="metrics",f.listOrder="",f.listOrderAsc=null,f.selectedMetrics=[],f.query={fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,page:1},f.arraytable=_.keyBy([{option:"Agent Report",value:"'report_agent'"},{option:"Call Report",value:"'report_call'"},{option:"CDR",value:"'cdr'"},{option:"Chat Website",value:"'chat_websites'"},{option:"Chat Interaction",value:"'chat_interactions'"},{option:"Chat Messages",value:"'chat_messages'"},{option:"Chat Offline Messages",value:"'chat_offline_messages'"},{option:"Chat Queues",value:"'chat_queues'"},{option:"Chat Report Queue",value:"'report_chat_queue'"},{option:"Chat Report Transfer",value:"'report_chat_transfer'"},{option:"Companies",value:"'cm_companies'"},{option:"Call transfer report",value:"'report_call_transfer'"},{option:"Contacts",value:"'cm_contacts'"},{option:"CSquare Report",value:"'report_square'"},{option:"CSquare Details Report",value:"'report_square_details'"},{option:"Dial Report",value:"'report_dial'"},{option:"Dialer Hopper Processing",value:"'cm_hopper'"},{option:"Dialer Hopper Logs",value:"'cm_hopper_history'"},{option:"Dialer Hopper Final",value:"'cm_hopper_final'"},{option:"Email Account",value:"'mail_accounts'"},{option:"Email Interaction",value:"'mail_interactions'"},{option:"Email Messages",value:"'mail_messages'"},{option:"Email Queues",value:"'mail_queues'"},{option:"Email Report Queue",value:"'report_mail_queue'"},{option:"Email Report Transfer",value:"'report_mail_transfer'"},{option:"Fax Account",value:"'fax_accounts'"},{option:"Fax Interaction",value:"'fax_interactions'"},{option:"Fax Messages",value:"'fax_messages'"},{option:"Fax Queues",value:"'fax_queues'"},{option:"Fax Report Queue",value:"'report_fax_queue'"},{option:"Fax Report Transfer",value:"'report_fax_transfer'"},{option:"Jscripty Sessions",value:"'report_jscripty_sessions'"},{option:"Jscripty Questions",value:"'report_jscripty_questions'"},{option:"Jscripty Answers",value:"'report_jscripty_answers'"},{option:"Lists",value:"'cm_lists'"},{option:"Member Report",value:"'report_member'"},{option:"Openchannel Account",value:"'openchannel_accounts'"},{option:"Openchannel Interaction",value:"'openchannel_interactions'"},{option:"Openchannel Messages",value:"'openchannel_messages'"},{option:"Openchannel Queues",value:"'openchannel_queues'"},{option:"Openchannel Report Queue",value:"'report_openchannel_queue'"},{option:"Openchannel Report Transfer",value:"'report_openchannel_transfer'"},{option:"Queue Report",value:"'report_queue'"},{option:"SMS Account",value:"'sms_accounts'"},{option:"SMS Interaction",value:"'sms_interactions'"},{option:"SMS Messages",value:"'sms_messages'"},{option:"SMS Queues",value:"'sms_queues'"},{option:"SMS Report Queue",value:"'report_sms_queue'"},{option:"SMS Report Transfer",value:"'report_sms_transfer'"},{option:"Users",value:"'users'"},{option:"Voice Recordings",value:"'voice_recordings'"},{option:"Whatsapp Account",value:"'whatsapp_accounts'"},{option:"Whatsapp Interaction",value:"'whatsapp_interactions'"},{option:"Whatsapp Messages",value:"'whatsapp_messages'"},{option:"Whatsapp Queues",value:"'whatsapp_queues'"},{option:"Whatsapp Report Queue",value:"'report_whatsapp_queue'"},{option:"Whatsapp Report Transfer",value:"'report_whatsapp_transfer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{metric:e,metrics:f.metrics.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("metric")+"?").htmlContent("<b>"+(e.name||"metric")+"</b> will be deleted.").ariaLabel("delete metric").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMetrics=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.analyticMetric.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Metrics",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMetric=function(e,n){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{metric:n,metrics:f.metrics.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMetric=y,f.exportSelectedMetrics=function(){var e=angular.copy(f.selectedMetrics);return f.selectedMetrics=[],e},f.deleteSelectedMetrics=function(e){var n=i.confirm().title("Are you sure want to delete the selected metrics?").htmlContent("<b>"+f.selectedMetrics.length+" selected</b> will be deleted.").ariaLabel("delete Metrics").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMetrics.forEach(function(e){y(e)}),f.selectedMetrics=[]})},f.deselectMetrics=function(){f.selectedMetrics=[]},f.selectAllMetrics=function(){f.selectedMetrics=f.metrics.rows};var b=!0,A=1;function E(e){f.metrics=e||{count:0,rows:[]}}function y(e){m.analyticMetric.delete({id:e.id}).$promise.then(function(){_.remove(f.metrics.rows,{id:e.id}),f.metrics.count-=1,f.metrics.rows.length||f.getMetrics(),p.success({title:_.startCase("Metric")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticMetric"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticMetric",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMetrics())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","metrics","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.analytics").controller("MetricsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o){var r=this;function l(){n.hide()}r.errors=[],r.report=angular.copy(t),r.report.name+="-copy",r.treeCustomData=o,r.treeCustomConfig={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},r.treeCustomEvents={select_node:function(e,n){r.currentNode=n.node}},r.copyReport=function(){var t;r.errors=[],i.analyticCustomReport.save({name:r.report.name,description:r.report.description,table:r.report.table,conditions:r.report.conditions,joins:r.report.joins,parent:r.currentNode.id}).$promise.then(function(e){t=e,a.success({title:"Report properly copied!",msg:r.report.name?r.report.name+" has been copied!":""});var n={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return n["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=r.report.id,i.analyticFieldReport.get(n).$promise}).then(function(e){var e=_.map(e.rows,function(e){return _.extend({},e,{CustomReportId:t.id})});return i.analyticFieldReport.bulkCreate(e).$promise}).then(function(){a.success({title:"Fields copied!",msg:"Fields has been copied!"}),l()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:COPYREPORT",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","treeCustomData"],angular.module("app.analytics").controller("CopyReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){n.hide()}c.errors=[],c.joinTables=[],c.title="ANALYTICS.EDIT_REPORT",c.crudPermissions=d,c.report=angular.copy(i),c.reports=a,c.newReport=!1,c.tables=l.getMap(),c.joinTypes=[{key:"join",value:"Join"},{key:"left_join",value:"Left Join"},{key:"right_join",value:"Right Join"},{key:"cross_join",value:"Cross Join"}],c.report||(c.report={name:"",table:"report_agent",description:"",parent:r.id},c.title="ANALYTICS.NEW_REPORT",c.newReport=!0),c.addNewReport=function(){c.errors=[],c.report.joins=_.map(c.joinTables||[],function(e){return{parentKey:e.parentKey,foreignTable:e.name,foreignKey:e.foreignKey,type:e.type.toLowerCase()}}),c.report.joins=JSON.stringify(c.report.joins),s[o].save(c.report).$promise.then(function(e){c.reports.unshift(e),t.success({title:"Report properly created",msg:c.report.name?c.report.name+" has been created!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.save"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveReport=function(){c.errors=[],s[o].update({id:c.report.id},c.report).$promise.then(function(e){var n=_.find(c.reports,{id:e.id});n&&_.merge(n,e),t.success({title:"Report properly saved!",msg:c.report.name?c.report.name+" has been saved!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.update"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteReport=function(){c.errors=[];var e=n.confirm().title("Are you sure?").content("The report will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(event);n.show(e).then(function(){s[o].delete({id:c.report.id}).$promise.then(function(){_.remove(c.reports,{id:c.report.id}),t.success({title:"Report properly deleted!",msg:c.report.name?c.report.name+" has been deleted!":""}),m()}).catch(function(e){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.delete"}]})},function(){})},c.closeDialog=m,c.selectedTableChange=function(e){e&&(delete c.selectedItem,c.joinTables.push(e))},c.removeJoin=function(e){c.joinTables.splice(e,1)},c.getFields=function(n,t,e){var a=_.find(c.tables,{name:e});a&&a.api&&s[a.api].describe().$promise.then(function(e){n[t]=_.difference(_.keys(e),["$promise","$resolved"])}).catch(function(e){console.error(e)})}}e.$inject=["$location","$mdDialog","toasty","reports","report","api","apiName","currentNode","describeTable","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportDialogController",e)}(),function(){"use strict";function e(i,s,o,e){var r=this;r.report={},r.conditions=e.getConditions,r.init=function(e,n){r.report=e,r.report.condition=angular.fromJson(e.conditions)||{group:{operator:"AND",rules:[]}},r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1};for(var t=0;t<r.report.condition.group.rules.length;t++)if(r.report.condition.group.rules[t].field){var a=r.report.condition.group.rules[t].field.split(".");1===a.length&&(r.report.condition.group.rules[t].field=r.report.table+"."+r.report.condition.group.rules[t].field)}s.getColumns(r.report.table).then(function(e){r.columns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt"])}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.addCondition=function(e){e.unshift({condition:"=",field:"",value:""})},r.addGroup=function(e){e.push({group:{operator:"AND",rules:[]}})},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the item?").htmlContent("The item will be deleted.").ariaLabel("delete item").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){e.splice(n,1)},function(){console.log("CANCEL")})},r.isValueByCondition=function(e){return!_.includes(["IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],e)}}e.$inject=["$mdDialog","describeTable","toasty","sqlUtil"],angular.module("app.analytics").controller("ReportConditionsController",e)}(),function(){"use strict";function e(a){var i={report_call_transfer:"voiceTransferReport",cm_companies:"cmCompany",cm_contacts:"cmContact",cm_hopper:"cmHopper",cm_hopper_final:"cmHopperFinal",cm_hopper_history:"cmHopperHistory",cm_lists:"cmList",chat_websites:"chatWebsite",chat_queues:"chatQueue",chat_interactions:"chatInteraction",chat_messages:"chatMessage",chat_offline_messages:"chatOfflineMessage",report_chat_queue:"chatQueueReport",report_chat_transfer:"chatTransferReport",mail_accounts:"mailAccount",mail_queues:"mailQueue",mail_interactions:"mailInteraction",mail_messages:"mailMessage",report_mail_queue:"mailQueueReport",report_mail_transfer:"mailTransferReport",openchannel_accounts:"openchannelAccount",openchannel_queues:"openchannelQueue",openchannel_interactions:"openchannelInteraction",openchannel_messages:"openchannelMessage",report_openchannel_queue:"openchannelQueueReport",report_openchannel_transfer:"openchannelTransferReport",sms_accounts:"smsAccount",sms_queues:"smsQueue",sms_interactions:"smsInteraction",sms_messages:"smsMessage",report_sms_queue:"smsQueueReport",report_sms_transfer:"smsTransferReport",fax_accounts:"faxAccount",fax_queues:"faxQueue",fax_interactions:"faxInteraction",fax_messages:"faxMessage",report_fax_transfer:"faxTransferReport",report_fax_queue:"faxQueueReport",report_call:"voiceCallReport",report_agent:"voiceAgentReport",report_square:"squareReport",report_member:"memberReport",report_queue:"voiceQueueReport",report_square_details:"squareReportDetail",report_dial:"voiceDialReport",report_jscripty_sessions:"jscriptySessionReport",report_jscripty_questions:"jscriptyQuestionReport",report_jscripty_answers:"jscriptyAnswerReport",users:"user",voice_recordings:"voiceRecording",cdr:"cdr",whatsapp_accounts:"whatsappAccount",whatsapp_queues:"whatsappQueue",whatsapp_interactions:"whatsappInteraction",whatsapp_messages:"whatsappMessage",report_whatsapp_queue:"whatsappQueueReport",report_whatsapp_transfer:"whatsappTransferReport"};return{getMap:function(){var t=[];return _.forIn(i,function(e,n){t.push({name:n,api:e})}),t},getColumns:function(e){var n=i[e],t={};return"cm_contacts"===e&&(t.analytics=!0),a[n].describe(t).$promise}}}e.$inject=["api"],angular.module("app.analytics").factory("describeTable",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;(u.errors=[],u.title="Edit Report Field",u.report=i,u.reportField=angular.copy(o),u.reportFields=s,u.metrics=r,u.columns=l,u.sqlUtil=d,u.newReportField=!1,u.crudPermissions=m,u.reportField)?(u.reportField.type=u.reportField.custom?"custom":u.reportField.MetricId?"metric":"column",u.reportField.field&&!u.reportField.custom&&_.isNil(u.reportField.MetricId)&&1===u.reportField.field.split(".").length&&(u.reportField.field=u.report.table+"."+u.reportField.field)):(u.reportField={type:"column",function:null,format:null,groupBy:!1,orderBy:null},u.title="New Report Field",u.newReportField=!0);function p(){t.hide()}u.addNewReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,u.reportField.CustomReportId=u.report.id,c.analyticFieldReport.save(u.reportField).$promise.then(function(e){u.reportFields.push(e),a.success({title:"Report field properly created",msg:u.reportField.field?u.reportField.field+" has been created!":u.reportField.type+" has been created!"}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.save"}]})},u.saveReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,c.analyticFieldReport.update({id:u.reportField.id},u.reportField).$promise.then(function(e){var n=_.find(u.reportFields,{id:e.id});n&&_.merge(n,e),a.success({title:"Report Field properly saved!",msg:u.reportField.field?u.reportField.field+" has been saved!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.update"}]})},u.deleteReportField=function(e){u.errors=[];var n=t.confirm().title("Are you sure?").content("The field will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){c.analyticFieldReport.delete({id:u.reportField.id}).$promise.then(function(){_.remove(u.reportFields,{id:u.reportField.id}),a.success({title:"Report Field properly deleted!",msg:u.reportField.field?u.reportField.field+" has been deleted!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReportField.delete"}]})},function(){})},u.closeDialog=p}e.$inject=["$scope","$location","$mdDialog","toasty","report","reportFields","reportField","metrics","columns","sqlUtil","api","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportFieldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;c.report={},c.reportFields={count:0,rows:[]},c.functions=_.keyBy(l.getFunctions,"value"),c.formats=_.keyBy(l.getFormats,"value"),c.groupBy=_.keyBy(l.getGroupBy,"value"),c.orderBy=_.keyBy(l.getOrderBy,"value"),c.selectedReportFields=[],c.query={fields:"createdAt,updatedAt,id,field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0},c.sortableTable={animation:100,onSort:function(e){o.analyticFieldReport.addFields({id:c.report.id},e.models).$promise.then(function(e){c.reportFields.rows=e}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDFIELDS"})})}},c.init=function(e,n){c.report=e,c.query.CustomReportId=c.report.id,c.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},c.sortableTable.disabled=!c.crudPermissions.canEdit,r.getColumns(c.report.table).then(function(e){return c.columns=_.difference(_.keys(e),["$promise","$resolved"]),o.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise}).then(function(e){c.metrics=e.rows}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.getReportFields()},c.deleteConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>"+e.field+"</b> will be deleted.").ariaLabel("delete field").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){p(e)},function(){console.log("CANCEL")})},c.success=u,c.getReportFields=function(){c.promise=o.analyticFieldReport.get(c.query,u).$promise},c.createOrEditReportField=function(e,n){a.show({controller:"CreateOrEditReportFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/edit/field/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:c.report,reportField:n,reportFields:c.reportFields.rows,metrics:c.metrics,columns:c.columns,setting:null,crudPermissions:c.crudPermissions}})},c.deleteReportField=p,c.deleteSelectedReportFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+c.selectedReportFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){c.selectedReportFields.forEach(function(e){p(e)}),c.selectedReportFields=[]})},c.getMetricName=function(e){var n=_.find(c.metrics,{id:e});return n?n.name:d.instant("ANALYTICS.NO_METRIC_FOUND")},c.getMetricValue=function(e){var n=_.find(c.metrics,{id:e});return n?n.metric:d.instant("ANALYTICS.NO_METRIC_FOUND")};var m=!0;function u(e){c.reportFields=e||{count:0,rows:[]}}function p(e){o.analyticFieldReport.delete({id:e.id}).$promise.then(function(){c.selectedReportFields=[],_.remove(c.reportFields.rows,{id:e.id}),c.reportFields.count-=1,c.reportFields.rows.length||c.getReportFields(),s.success({title:"Field deleted!",msg:e.field?e.field+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}n.$watch("vm_rf.query.filter",function(e,n){m?t(function(){m=!1}):c.getReportFields()})}e.$inject=["$cookies","$scope","$timeout","$mdDialog","$document","toasty","api","describeTable","sqlUtil","$translate"],angular.module("app.analytics").controller("ReportFieldsController",e)}(),function(){"use strict";angular.module("app.analytics").factory("sqlUtil",function(){return{getFunctions:[{value:"SUM",option:function(e){return"SUM ("+e+")"}},{value:"COUNT",option:function(e){return"COUNT ("+e+")"}},{value:"COUNT DISTINCT",option:function(e){return"COUNT (DISTINCT "+e+")"}},{value:"MAX",option:function(e){return"MAX ("+e+")"}},{value:"MIN",option:function(e){return"MIN ("+e+")"}},{value:"AVG",option:function(e){return"AVG ("+e+")"}},{value:"GROUP_CONCAT",option:function(e){return"GROUP_CONCAT ("+e+")"}},{value:"GROUP_CONCAT ASC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" ASC)"}},{value:"GROUP_CONCAT DESC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" DESC)"}}],getFormats:[{value:"SEC_TO_TIME",option:function(e){return"SEC_TO_TIME ("+e+")"}},{value:"DATE",option:function(e){return"DATE ("+e+")"}},{value:"HOUR",option:function(e){return"HOUR ("+e+")"}},{value:"ROUND",option:function(e){return"ROUND ("+e+")"}},{value:"UNIX_TIMESTAMP",option:function(e){return"UNIX_TIMESTAMP ("+e+")"}}],getGroupBy:[{value:!1,option:function(){return"No"}},{value:!0,option:function(e){return"GROUP BY "+e}}],getOrderBy:[{value:"ASC",option:function(e){return"ORDER BY "+e+" ASC"}},{value:"DESC",option:function(e){return"ORDER BY "+e+" DESC"}}],getConditions:["=","!=","<","<=",">",">=","LIKE","NOT LIKE","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"]}})}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(e){return _.isArray(e)}o.report=a||{},o.userProfileSection=s&&1==s.count?s.rows[0]:null,o.crudPermissions=i.parseCrudPermissions(o.userProfileSection?o.userProfileSection.crudPermissions:null),o.selectedTab=e.params.tab||0,o.gotoReports=function(){e.go("app.analytics.reports",{},{reload:"app.analytics.reports"})},o.saveReport=function(){o.report.conditions=angular.toJson(o.report.condition),t.analyticCustomReport.update({id:o.report.id},_.omit(o.report,"joins")).$promise.then(function(){n.success({title:"Report updated!",msg:o.report.name?o.report.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETreport",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.previewReport=function(){o.columns=[],o.rows=[],o.error=!1,t.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:o.report.id}).$promise.then(function(e){return o.columns=e?e.rows:[],t.analyticCustomReport.preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})},o.queryReport=function(){return o.queryResult="Loading...",t.analyticCustomReport.query({id:o.report.id}).$promise.then(function(e){o.queryResult=e.sql}).catch(function(e){o.queryResult="",console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})},o.mapArray=function(e,n){if(r(e))return _.map(e,n).join(",");return""},o.isArray=r,o.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n}}e.$inject=["$state","toasty","api","report","Auth","userProfileSection"],angular.module("app.analytics").controller("ReportController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.errors=[],o.report=angular.copy(a),o.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n},o.closeDialog=function(){n.hide()},function(){o.columns=[],o.rows=[],o.error=!1;var e={fields:"field,alias",nolimit:!0};e["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=o.report.id,o.promise=i.analyticFieldReport.get(e).$promise.then(function(e){return o.columns=e?e.rows:[],i[s].preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(o.error)})}()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName"],angular.module("app.analytics").controller("PreviewReportDialogController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,n,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.reports={count:0,rows:[]},p.userProfile=r,p.userProfileSection=l&&1==l.count?l.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.selectedReports=[],p.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},p.apiName=null,p.currentPath="",p.customTree=!0,p.editstate=function(e,n){s.go("app.analytics.reports.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.copydialog=function(e,n){i.show({controller:"CopyReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/copy/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,treeCustomData:p.treeCustomInstance.jstree(!0).get_json("#")}}).finally(function(){})},p.previewdialog=function(e,n){i.show({controller:"PreviewReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/preview/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName}})},p.rundialog=function(e,n){i.show({controller:"RunReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,currentPath:p.currentPath}})},p.downloadfile=function(a,e){var i;d.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise.then(function(e){i=_.keyBy(e.rows,"id");var n={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return n["analyticCustomReport"===p.apiName?"CustomReportId":"DefaultReportId"]=a.id,d.analyticFieldReport.get(n).$promise}).then(function(e){for(var n=0;n<e.rows.length;n+=1)e.rows[n].MetricId&&(e.rows[n].field=i[e.rows[n].MetricId].metric,e.rows[n].custom=!0),delete e.rows[n].MetricId;var t=o.document.createElement("a");t.href="data:text/json;charset=utf-8,"+o.encodeURIComponent(angular.toJson({name:a.name,description:a.description,table:a.table,conditions:a.conditions,joins:a.joins,fields:e.rows})),t.download=a.name+".json",t.target="_self",t.click(),m.success({title:"Report downloaded!",msg:a.name?a.name+" has been downloaded!":""})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the report?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete report").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){b(e)},function(){console.log("CANCEL")})},p.success=h,p.getReports=f,p.createOrEditReport=function(e,n){i.show({controller:"CreateOrEditReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:n,reports:p.reports.rows,apiName:p.apiName,currentNode:p.currentNode,setting:null,crudPermissions:p.crudPermissions}})},p.importReport=function(e,n,t){if("application/json"===e.file.type){var a=new FileReader;a.onload=function(e){console.log(e.target.result);try{var t=atob(e.target.result.split(",")[1]);t=angular.fromJson(t),d.analyticCustomReport.save({name:t.name,description:t.description,table:t.table,conditions:t.conditions,joins:t.joins,parent:p.currentNode.id}).$promise.then(function(n){p.reports.rows.unshift(n),m.success({title:"Report saved!",msg:n.name?n.name+" has been saved!":""});var e=_.map(t.fields,function(e){return _.extend({},e,{CustomReportId:n.id})});return d.analyticFieldReport.bulkCreate(e).$promise}).then(function(e){m.success({title:"Fields saved!",msg:"Fields has been saved!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETanalyticReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}catch(e){console.error(e),m.error({title:"Decode File Error",msg:e.toString()})}},a.readAsDataURL(e.file)}else m.error({title:"Format Error",msg:"Please use only json files"})},p.deleteReport=b,p.exportSelectedReports=function(){var e=angular.copy(p.selectedReports);return p.selectedReports=[],e},p.deleteSelectedReports=function(e){var n=i.confirm().title("Are you sure want to delete the selected reports?").htmlContent("<b>"+p.selectedReports.length+" selected</b> will be deleted.").ariaLabel("delete Reports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){p.selectedReports.forEach(function(e){b(e)}),p.selectedReports=[]})},p.deselectReports=function(){p.selectedReports=[]},p.selectAllReports=function(){p.selectedReports=p.reports.rows},p.treeDefaultData=c.rows[0]?angular.fromJson(c.rows[0].tree):[],p.treeCustomData=c.rows[1]?angular.fromJson(c.rows[1].tree):[],p.treeDefaultConfig=S(!1),p.treeCustomConfig=S(!0),p.treeDefaultEvents=T(!1),p.treeCustomEvents=T(!0);var g=!0,v=1;function h(e){p.reports=e||{count:0,rows:[]}}function f(){if(p.query.offset=(p.query.page-1)*p.query.limit,p.apiName)if("admin"===p.currentUser.role||p.userProfileSection.autoAssociation)p.promise=d[p.apiName].get(p.query,h).$promise;else{var a=[];p.promise=d[p.apiName].get(p.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:p.userProfileSection.id,type:"analyticDefaultReport"===p.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),h({count:t.length,rows:t})}return h(null)}):h(null)})}}function b(e){p.apiName&&d[p.apiName].delete({id:e.id}).$promise.then(function(){_.remove(p.reports.rows,{id:e.id}),p.reports.count-=1,p.reports.rows.length||p.getReports(),m.success({title:"Report deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.analyticreport.delete"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticreport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function A(e,n){p.treeDefaultInstance.jstree(!0).deselect_all(),p.treeDefaultInstance.jstree(!0).close_all(),p.currentNode=n.node,p.currentNode.custom=!0,p.currentPath=p.treeCustomInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticCustomReport",p.query.parent=n.node.id,f()}function E(e,n){p.treeCustomInstance.jstree(!0).deselect_all(),p.treeCustomInstance.jstree(!0).close_all(),p.currentNode=n.node,p.currentNode.custom=!1,p.currentPath=p.treeDefaultInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticDefaultReport",p.query.parent=n.node.id,f()}function y(e,n){var t,a,i;"rename_node"===e.type&&(a=(t=n).node.id,i="","custom"===t.node.parent?t.node.id.includes("custom_report_")||(i="custom_report_"+t.text):i=t.node.parent+"_"+t.text,p.treeCustomInstance.jstree(!0).set_id(t.node,"custom_report_"+i.toLowerCase()),t.node.a_attr.id=t.node.a_attr.id.replace(a,t.node.id),t.node.li_attr.id=t.node.id);var s=angular.toJson(p.treeCustomInstance.jstree(!0).get_json("#"));d.analyticTreeReport.update({id:2,tree:s}).$promise.then(function(){c.rows[1]&&(c.rows[1].tree=s),m.success({title:"Node Updated",msg:n.node.text?n.node.text+" has been updated!":"Node has been updated!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEanalyticTreeReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}function S(e){return{core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:e?["contextmenu","dnd","search","state","wholerow"]:["search","state","wholerow"],contextmenu:{items:function(t){var e={};return p.crudPermissions.canEdit&&_.assign(e,{create:{label:n.instant("ANALYTICS.CREATE"),action:function(){t=p.treeCustomInstance.jstree(!0).create_node(t),p.treeCustomInstance.jstree(!0).edit(t)}},rename:{_disabled:"#"===t.parent,label:n.instant("ANALYTICS.RENAME"),action:function(){p.treeCustomInstance.jstree(!0).edit(t)}}}),p.crudPermissions.canDelete&&_.assign(e,{remove:{_disabled:"#"===t.parent,label:n.instant("ANALYTICS.REMOVE"),action:function(){var e=i.confirm().title("Are you sure want to delete the node?").htmlContent("<b>"+(t.text?t.text:"Node")+"</b> and its subnode will be deleted.").ariaLabel("delete node").ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n=p.treeCustomInstance.jstree(!0).get_parent(t);n=p.treeCustomInstance.jstree(!0).get_node(n),p.treeCustomInstance.jstree(!0).delete_node(t),e=[t.id].concat(t.children_d||[]),d.analyticCustomReport.get({parent:e.join(","),fields:"id,name"}).$promise.then(function(e){e&&e.rows&&e.rows.forEach(function(e){b(e)})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEreportsByParents",msg:e.data?JSON.stringify(e.data):e.toString()})}),p.treeCustomInstance.jstree(!0).select_node(n)})}}}),e}}}}function T(e){return e?{create_node:y,rename_node:y,move_node:y,delete_node:y,select_node:A}:{select_node:E}}e.$watch("vm.query.filter",function(e,n){g?t(function(){g=!1}):(n||(v=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=v),p.getReports())}),e.$watch("vm.search",function(e,n){p.treeDefaultInstance&&p.treeDefaultInstance.jstree(!0).search(e),p.treeCustomInstance&&p.treeCustomInstance.jstree(!0).search(e)})}e.$inject=["$scope","$timeout","$document","$mdDialog","$state","$window","$translate","userProfile","userProfileSection","api","treeReports","toasty","Auth"],angular.module("app.analytics").controller("ReportsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r){var l=this;function d(){l.export={id:l.report.id,name:l.report.name,startDate:new Date(moment().startOf("day")),endDate:new Date(moment().endOf("day")),output:"xlsx",fullPath:r?r+"/"+l.report.name:l.report.name}}function c(){t.hide()}l.errors=[],l.report=angular.copy(n),l.export={},l.runReport=function(n){l.errors=[],l.exportDate=_.assign({},l.export,{startDate:moment(l.export.startDate).format("YYYY-MM-DD HH:mm:ss"),endDate:moment(l.export.endDate).format("YYYY-MM-DD HH:mm:ss")}),i[s].run(l.exportDate).$promise.then(function(e){"web"===l.export.output?t.show({controller:"WebReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/web/dialog.html",parent:angular.element(o.body),targetEvent:n,skipHide:!0,locals:{apiName:s,exportDate:l.exportDate,results:e},resolve:{columns:["apiResolver",function(e){var n={fields:"field,alias",nolimit:!0};return n["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=l.report.id,e.resolve("analyticFieldReport@get",n)}]}}):(a.success({title:"Report properly run!",msg:l.report.name?l.report.name+" has been run!":""}),c())}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.closeDialog=c,(l.refreshDate=d)()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","$document","currentPath"],angular.module("app.analytics").controller("RunReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o){var r=this;function l(e){r.results=e||{count:0,rows:[]}}r.errors=[],r.columns=a?a.rows:[],r.results=i||{rows:[],count:0},r.query={limit:10,page:1},r.closeDialog=function(){e.hide()},r.getResults=function(){o.offset=(r.query.page-1)*r.query.limit,o.limit=r.query.limit,r.promise=t[s].run(o,l).$promise},r.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n}}e.$inject=["$mdDialog","toasty","api","columns","results","apiName","exportDate"],angular.module("app.analytics").controller("WebReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_ODBC",g.odbc=angular.copy(l),g.odbcs=r,g.newOdbc=!1,g.odbc||(g.odbc={},g.title="CALLYSQUARE.NEW_ODBC",g.newOdbc=!0),g.addNewOdbc=function(){g.errors=[],d.squareOdbc.save(g.odbc).$promise.then(function(e){g.odbcs.unshift(e.toJSON()),o.success({title:"Odbc properly created",msg:g.odbc.name?g.odbc.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOdbc=function(){g.errors=[],d.squareOdbc.update({id:g.odbc.id},g.odbc).$promise.then(function(e){var n=_.find(g.odbcs,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Odbc properly saved!",msg:g.odbc.name?g.odbc.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOdbc=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The odbc will be deleted.").ariaLabel("Delete Odbc").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.squareOdbc.delete({id:g.odbc.id}).$promise.then(function(){_.remove(g.odbcs,{id:g.odbc.id}),o.success({title:"Odbc properly deleted!",msg:(g.odbc.name||"odbc")+" has been deleted!"}),v(g.odbc)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","odbcs","odbc","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditOdbcDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.odbcs=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="odbcs",f.listOrder="",f.listOrderAsc=null,f.selectedODBC=[],f.query={fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{odbc:e,odbcs:f.odbcs.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.testtestOdbc=function(e,n){return m.squareOdbc.test({id:e.id}).$promise.then(function(){p.success({title:"Square ODBC properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Square ODBC properly tested",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("odbc")+"?").htmlContent("<b>"+(e.name||"odbc")+"</b> will be deleted.").ariaLabel("delete odbc").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getODBC=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.squareOdbc.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ODBC",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOdbc=function(e,n){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{odbc:n,odbcs:f.odbcs.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOdbc=y,f.exportSelectedODBC=function(){var e=angular.copy(f.selectedODBC);return f.selectedODBC=[],e},f.deleteSelectedODBC=function(e){var n=i.confirm().title("Are you sure want to delete the selected odbcs?").htmlContent("<b>"+f.selectedODBC.length+" selected</b> will be deleted.").ariaLabel("delete Odbcs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedODBC.forEach(function(e){y(e)}),f.selectedODBC=[]})},f.deselectODBC=function(){f.selectedODBC=[]},f.selectAllODBC=function(){f.selectedODBC=f.odbcs.rows};var b=!0,A=1;function E(e){f.odbcs=e||{count:0,rows:[]}}function y(e){m.squareOdbc.delete({id:e.id}).$promise.then(function(){_.remove(f.odbcs.rows,{id:e.id}),f.odbcs.count-=1,f.odbcs.rows.length||f.getODBC(),p.success({title:_.startCase("Odbc")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareOdbc"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareOdbc",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getODBC())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","odbcs","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.callysquare").controller("OdbcsController",e)}(),function(){"use strict";function e(n,t,a,i,s,e,o,r,l,d){var c=this;function m(e){n.hide(e)}c.errors=[],c.title="CALLYSQUARE.EDIT_PROJECT",c.crudPermissions=d,c.project=angular.copy(o),c.newWindow=!0,c.projects=e,c.newProject=!1,c.openFromEditor=l,c.project||(c.project={name:"",description:""},c.title="CALLYSQUARE.NEW_PROJECT",c.newProject=!0),c.addNewProject=function(){c.errors=[],r.squareProject.save(c.project).$promise.then(function(e){return r.user.addSquareProjects({id:i.getCurrentUser().id,ids:[e.id]}).$promise,e}).then(function(e){c.projects.unshift(e),s.success({title:"Project properly created",msg:c.project.name?c.project.name+" has been created!":""}),m(e),c.openFromEditor&&(c.newWindow?t.open("/callysquare/projects/"+e.id,"_blank"):a.go("app.callysquare.projects.edit",{id:e.id}))}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveProject=function(){c.errors=[],r.squareProject.update({id:c.project.id},c.project).$promise.then(function(e){var n=_.find(c.projects,{id:e.id});n&&_.merge(n,e),s.success({title:"Project properly saved!",msg:c.project.name?c.project.name+" has been saved!":""}),m(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteProject=function(){c.errors=[];var e=n.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(event);n.show(e).then(function(){r.squareProject.delete({id:c.project.id}).$promise.then(function(){return r.squareProject.getUsers({id:c.project.id}).$promise}).then(function(e){for(var n=[],t=e.rows,a=0;a<t.length;a++)n.push(r.user.removeSquareProjects({id:i.getCurrentUser().id,ids:[c.project.id]}).$promise);return $q.all(n)}).then(function(){_.remove(c.projects,{id:c.project.id}),s.success({title:"Project properly deleted!",msg:c.project.name?c.project.name+" has been deleted!":""}),m(c.project)}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.delete"}]})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$window","$state","Auth","toasty","projects","project","api","openFromEditor","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareProjectDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S,T,I,O,C,w,R,x,N,D){var P=this,L={playback:["file_id"],answer:["timeout"],menu:["file_id","digit","response","retry"],getdigits:["file_id","variable_id","mindigit","maxdigit","retry"],getsecretdigits:["file_id","variable_id","mindigit","maxdigit","hiddendigitsnum","retry"],vswitch:["variable_id"],database:["odbc_id","query"],ext_dial:["trunk_name","phone","timeout"],set:["variable_id"],math:["variable_id"],gotoc:["context","extension","priority"],system:["command"],agi:["command"],gotoif:["condition"],saydigits:["digits"],saynumber:["number"],sayphonetic:["text"],record:["file","timeout"],goal:["goalname"],dial:["sip_id","timeout"],queue:["queue_id","timeout"],callback:["list_id","name","phone","delay"],gotoiftime:["interval_id"],voicemail:["mailbox"],subproject:["project_id"],sendSMS:["sms_account_id","to","sms_text"],sendMail:["account_id","to"],sendFax:["account_id","to","attachment_path"],google_cloud_tts:["apiKey","google_cloud_tts_text_type","text"],tts:["text"],ispeechtts:["text","key","speed"],ispeechasr:["key","timeout"],custom_app:["application"],googleasr:["key","timeout"],awspolly:["aws_access_key_id","aws_secret_access_key","text","aws_text_type"],lumenvoxtts:["text"],sestektts:["text"],lumenvoxasr:["grammar"],sestekasr:["grammar"],tildeasr:["appid","appsecret","uri"],login:["findBy"],pause:["findBy","pause_id"],unpause:["findBy"],logout:["findBy"],dialogflow:["key","text","dialogflow_language"],awslex:["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],sesteknda:["text","ndauth_url","username","password","ndassistant_url"],restapi:["url","method"],mrcpsynth:["text"],mrcprecog:["grammar"],dialogflowV2:["dialogflowV2_project_id","client_email","private_key","dialogflowV2_language","text"]},k={queue:["file_id"],database:["variable_id"],pause:["pause_id"]},M={sendMail:["to","cc","bcc"],voicemail:["mailbox"]};function U(e,n,t,a){return _.map(e,function(e){return{value:e[n],option:e[t],group:a?e[a]:void 0,canSelect:void 0===e.canSelect||e.canSelect}})}function F(){var e=Number(_.find(P.attributes,{name:"sip_id"}).value);if(!_.some(d,{id:e})&&0<e)return t.user.get({id:e,fields:"id,fullname,role"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,d.push(n),P.values.sip_id=U(d,"id","fullname","role")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_USER",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.sip_id=U(d,"id","fullname","role")}function $(){var e=Number(_.find(P.attributes,{name:"list_id"}).value);if(!_.some(E,{id:e})&&0<e)return t.cmList.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,E.push(n),P.values.list_id=U(E,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_LIST",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.list_id=U(E,"id","name")}function q(){var e=Number(_.find(P.attributes,{name:"trunk_id"}).value);if(!_.some(c,{id:e})&&0<e)return t.trunk.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,c.push(n),P.values.trunk_id=U(c,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.trunk_id=U(c,"id","name")}function G(){var e=_.find(P.attributes,{name:"trunk_name"}).value;if(!_.some(c,{name:e})&&e)return t.trunk.get({name:e,fields:"id,name"}).$promise.then(function(e){if(0<e.count&&0<e.rows.length){var n=e.rows[0];n.canSelect=!1,c.push(n),P.values.trunk_name=U(c,"name","name")}}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.trunk_name=U(c,"name","name")}function H(){var e=Number(_.find(P.attributes,{name:"queue_id"}).value);if(!_.some(m,{id:e})&&0<e)return t.voiceQueue.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,m.push(n),P.values.queue_id=U(m,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_QUEUE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.queue_id=U(m,"id","name")}function V(){var e=Number(_.find(P.attributes,{name:"file_id"}).value);if(!_.some(u,{id:e})&&0<e)return t.sound.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,u.push(n),P.values.file_id=U(u,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SOUND",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.file_id=U(u,"id","name")}function B(){var e=Number(_.find(P.attributes,{name:"variable_id"}).value);if(!_.some(p,{id:e})&&0<e)return t.variable.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,p.push(n),P.values.variable_id=U(p,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_VARIABLE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.variable_id=U(p,"id","name")}function Q(){var e=Number(_.find(P.attributes,{name:"odbc_id"}).value);if(!_.some(g,{id:e})&&0<e)return t.squareOdbc.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,g.push(n),P.values.odbc_id=U(g,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_ODBC",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.odbc_id=U(g,"id","name")}function W(){var e=Number(_.find(P.attributes,{name:"project_id"}).value);if(!_.some(v,{id:e})&&0<e)return t.squareProject.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,v.push(n),P.values.project_id=U(v,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PROJECT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.project_id=U(v,"id","name")}function j(){var e=Number(_.find(P.attributes,{name:"context"}).value);if(!_.some(h,{id:e})&&0<e)return t.voiceContext.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,h.push(n),P.values.context=U(h,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_CONTEXT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.context=U(h,"id","name")}function Y(){var e=Number(_.find(P.attributes,{name:"interval_id"}).value);if(!_.some(f,{id:e})&&0<e)return t.interval.get({id:e,fields:"id,name,IntervalId"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,f.push(n),P.values.interval_id=U(f,"id","name","IntervalId")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_INTERVAL",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.interval_id=U(f,"id","name","IntervalId")}function z(){var e=Number(_.find(P.attributes,{name:"account_id"}).value);if(!_.some(b,{id:e})&&0<e)return t.mailAccount.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,b.push(n),P.values.account_id=U(b,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_MAIL_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.account_id=U(b,"id","name")}function J(){var e=Number(_.find(P.attributes,{name:"sms_account_id"}).value);if(!_.some(O,{id:e})&&0<e)return t.smsAccount.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,O.push(n),P.values.sms_account_id=U(O,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SMS_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.sms_account_id=U(O,"id","name")}function K(){var e=Number(_.find(P.attributes,{name:"template_id"}).value);if(!_.some(A,{id:e})&&0<e)return t.template.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,A.push(n),P.values.template_id=U(A,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TEMPLATE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.template_id=U(A,"id","name")}function X(){var e=Number(_.find(P.attributes,{name:"pause_id"}).value);if(!_.some(C,{id:e})&&0<e)return t.pause.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,C.push(n),P.values.pause_id=U(C,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PAUSE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.pause_id=U(C,"id","name")}P.cellName=y.tagName,P.attributes=_.map(y.attributes,function(e){return{name:e.name,value:e.value,defaultValue:k[P.cellName]&&_.includes(k[P.cellName],e.name),required:L[P.cellName]&&_.includes(L[P.cellName],e.name),help:M[P.cellName]&&_.includes(M[P.cellName],e.name)}}),P.values={authMethod:[{value:"noauth",option:"NO AUTH"},{value:"hmac",option:"HMAC"}],answer:[{value:"yes",option:"Yes"},{value:"no",option:"No"}],ndagenerate_audio:[{value:1,option:"Yes"},{value:0,option:"No"}],ndaactivity_type:[{value:"message",option:"Message"},{value:"conversationUpdate",option:"Conversation Update"},{value:"contactRelationUpdate",option:"Contact Relation Update"},{value:"endOfConversation",option:"End of Conversation"}],hiddendigitspos:[{value:"first",option:"First"},{value:"last",option:"Last"}],recordingFormat:[{value:"wav",option:"Wav"},{value:"gsm",option:"Gsm"}],intkey:[{value:"#",option:"#"},{value:"*",option:"*"}],beep:[{value:"BEEP",option:"Yes"},{value:"NOBEEP",option:"No"}],model:e,ispeech_asr_language:i,ispeech_tts_language:o,languageCode:r,ssmlGender:[{value:"FEMALE",option:"Female"},{value:"MALE",option:"Male"}],google_tts_language:l,google_asr_language:s,google_cloud_tts_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],aws_polly_region:I,aws_polly_voice:T,aws_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],callback_priority:[{option:"Highest",value:4},{option:"High",value:3},{option:"Medium",value:2},{option:"Low",value:1},{option:"Lowest",value:0}],findBy:[{value:"internal",option:"Internal"},{value:"phone",option:"Phone"},{value:"mobile",option:"Mobile"}],dialogflow_language:w,dialogflowV2_language:R,aws_lex_region:x,method:[{value:"GET",option:"GET"},{value:"POST",option:"POST"},{value:"PUT",option:"PUT"},{value:"DELETE",option:"DELETE"}]},P.crudPermissions=D,P.onInit=function(){N.hasRole("admin")?(e={sip_id:U(d,"id","fullname","role"),trunk_name:U(c,"name","name"),trunk_id:U(c,"id","name"),queue_id:U(m,"id","name"),file_id:U(u,"id","name"),variable_id:U(p,"id","name"),odbc_id:U(g,"id","name"),project_id:U(v,"id","name"),context:U(h,"id","name"),interval_id:(t=f,a="id",i="name",s="IntervalId",o=_.filter(t,function(e){return null===e[s]}),r=[],_.forEach(o,function(n){r.push({value:n[a],option:n[i]});var e=_.filter(t,function(e){return e[s]===n.id});_.forEach(e,function(e){r.push({value:e[a],option:" - "+e[i]})})}),r),account_id:U(b,"id","name"),template_id:U(A,"id","name"),list_id:U(E,"id","name"),sms_account_id:U(O,"id","name"),pause_id:U(C,"id","name")},n=_.merge(P.values,e),P.values=n):function(){for(var e=["sip_id","trunk_name","trunk_id","queue_id","file_id","variable_id","odbc_id","project_id","context","interval_id","account_id","template_id","list_id","sms_account_id","pause_id"],n=0;n<P.attributes.length;n++)if(_.includes(e,P.attributes[n].name))switch(P.attributes[n].name){case"sip_id":F();break;case"trunk_name":G();break;case"trunk_id":q();break;case"queue_id":H();break;case"file_id":V();break;case"variable_id":B();break;case"odbc_id":Q();break;case"project_id":W();break;case"context":j();break;case"interval_id":Y();break;case"account_id":z();break;case"template_id":K();break;case"list_id":$();break;case"sms_account_id":J();break;case"pause_id":X()}}();var e,n,t,a,i,s,o,r},P.closeDialog=function(e){e&&S(P.attributes),n.hide()},P.getMap=U}e.$inject=["$mdDialog","api","toasty","ispeechAsrModel","ispeechAsrLanguage","googleAsrLanguage","ispeechTtsLanguage","googleCloudTtslanguageCode","googleTtsLanguage","users","trunks","queues","sounds","variables","databases","projects","contexts","intervals","mailAccounts","templates","lists","cell","saveCallback","awsPollyVoice","awsPollyRegion","smsAccounts","pauses","dialogFlowLanguage","dialogFlowV2Language","awsLexRegion","Auth","crudPermissions"],angular.module("app.callysquare").controller("MxGraphDialogController",e)}(),function(){"use strict";angular.module("app.callysquare").directive("stringToNumber",function(){return{require:"ngModel",link:function(e,n,t,a){a.$parsers.push(function(e){return""+e}),a.$formatters.push(function(e){return parseFloat(e)})}}})}(),function(){"use strict";angular.module("app.callysquare").factory("ispeechAsrModel",function(){return[{value:"0",option:"Default"},{value:"date",option:"Date"},{value:"usmoney",option:"US Money"},{value:"numbersto9",option:"Numbers to 9"},{value:"numbersto99",option:"Numbers to 99"},{value:"numbersto999",option:"Numbers to 999"},{value:"time",option:"Time"},{value:"phonenumber",option:"Phone number"},{value:"streets",option:"Streets"},{value:"citystate",option:"US City/States"}]}).factory("ispeechAsrLanguage",function(){return[{value:"en-US",option:"English (US)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (UK)"},{value:"en-AU",option:"English (Australia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"it-IT",option:"Italian (Italy) / Finnish (Finland)"},{value:"fr-FR",option:"German (Germany)"},{value:"fr-CA",option:"French (Canada)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ca-ES",option:"Catalan (Catalan)"},{value:"zh-TW",option:"Chinese (Taiwan)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"ko-KR",option:"Korean (Korea)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"zh-CN",option:"Chinese (China)"},{value:"zh-HK",option:"Chinese (Hong Kong)"}]}).factory("ispeechTtsLanguage",function(){return[{value:"usenglishfemale",option:"US English Female"},{value:"usenglishmale",option:"US English Male"},{value:"ukenglishfemale",option:"UK English Female"},{value:"ukenglishmale",option:"UK English Male"},{value:"auenglishfemale",option:"Australian English"},{value:"usspanishfemale",option:"US Spanish Female"},{value:"usspanishmale",option:"US Spanish Male"},{value:"chchinesefemale",option:"Chinese Female"},{value:"chchinesemale",option:"Chinese Male"},{value:"hkchinesefemale",option:"Hong Kong Cantonese Female"},{value:"twchinesefemale",option:"Taiwan Chinese Female"},{value:"jpjapanesefemale",option:"Japanese Female"},{value:"jpjapanesemale",option:"Japanese Male"},{value:"krkoreanfemale",option:"Korean Female"},{value:"krkoreanmale",option:"Korean Male"},{value:"caenglishfemale",option:"Canadian English Female"},{value:"huhungarianfemale",option:"Hungarian Female"},{value:"brportuguesefemale",option:"Brazilian Portuguese Female"},{value:"eurportuguesefemale",option:"European Portuguese Female"},{value:"eurportuguesemale",option:"European Portuguese Male"},{value:"eurspanishfemale",option:"European Spanish Female"},{value:"eurspanishmale",option:"European Spanish Male"},{value:"eurcatalanfemale",option:"European Catalan Female"},{value:"eurczechfemale",option:"European Czech Female"},{value:"eurdanishfemale",option:"European Danish Female"},{value:"eurfinnishfemale",option:"European Finnish Female"},{value:"eurfrenchfemale",option:"European French Female"},{value:"eurfrenchmale",option:"European French Male"},{value:"eurnorwegianfemale",option:"European Norwegian Female"},{value:"eurdutchfemale",option:"European Dutch Female"},{value:"eurpolishfemale",option:"European Polish Female"},{value:"euritalianfemale",option:"European Italian Female"},{value:"euritalianmale",option:"European Italian Male"},{value:"eurturkishfemale",option:"European Turkish Female"},{value:"eurturkishmale",option:"European Turkish Male"},{value:"eurgermanfemale",option:"European German Female"},{value:"eurgermanmale",option:"European German Male"},{value:"rurussianfemale",option:"Russian Female"},{value:"rurussianmale",option:"Russian Male"},{value:"swswedishfemale",option:"Swedish Female"},{value:"cafrenchfemale",option:"Canadian French Female"},{value:"cafrenchmale",option:"Canadian French Male"}]}).factory("googleCloudTtslanguageCode",function(){return[{value:"af-ZA",option:"Afrikaans (South Africa)"},{value:"ar-XA",option:"Arabic"},{value:"bn-IN",option:"Bengali (India)"},{value:"bg-BG",option:"Bulgarian (Bulgaria)"},{value:"ca-ES",option:"Catalan (Spain)"},{value:"yue-HK",option:"Chinese (Hong Kong)"},{value:"cs-CZ",option:"Czech (Czech Republic)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"nl-BE",option:"Dutch (Belgium)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"en-AU",option:"English (Australian)"},{value:"en-IN",option:"English (India)"},{value:"en-GB",option:"English (UK)"},{value:"en-US",option:"English (US)"},{value:"fi-FI",option:"Finnish (Finland)"},{value:"fil-PH",option:"Filipino (Philippines)"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"French (France)"},{value:"de-DE",option:"German (Germany)"},{value:"el-GR",option:"Greek (Greece)"},{value:"gu-IN",option:"Gujarati (India)"},{value:"hi-IN",option:"Hindi (India)"},{value:"hu-HU",option:"Hungarian (Hungary)"},{value:"is-IS",option:"Icelandic (Iceland)"},{value:"id-ID",option:"Indonesian (Indonesia)"},{value:"it-IT",option:"Italian (Italy)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"kn-IN",option:"Kannada (India)"},{value:"ko-KR",option:"Korean (South Korea)"},{value:"lv-LV",option:"Latvian (Latvia)"},{value:"ms-MY",option:"Malay (Malaysia)"},{value:"ml-IN",option:"Malayalam (India)"},{value:"cmn-CN",option:"Mandarin Chinese"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ro-RO",option:"Romanian (Romania)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sr-RS",option:"Serbian (Cyrillic)"},{value:"sk-SK",option:"Slovak (Slovakia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-US",option:"Spanish (US)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"ta-IN",option:"Tamil (India)"},{value:"te-IN",option:"Telugu (India)\t"},{value:"th-TH",option:"Thai (Thailand)"},{value:"tr-TR",option:"Turkish (Turkey)"},{value:"uk-UA",option:"Ukrainian (Ukraine)"},{value:"vi-VN",option:"Vietnamese (Vietnam)"}]}).factory("googleTtsLanguage",function(){return[{value:"af",option:"Afrikaans"},{value:"sq",option:"Albanian"},{value:"am",option:"Amharic"},{value:"ar",option:"Arabic"},{value:"hy",option:"Armenian"},{value:"az",option:"Azerbaijani"},{value:"eu",option:"Basque"},{value:"be",option:"Belarusian"},{value:"bn",option:"Bengali"},{value:"bh",option:"Bihari"},{value:"bs",option:"Bosnian"},{value:"br",option:"Breton"},{value:"bg",option:"Bulgarian"},{value:"km",option:"Cambodian"},{value:"ca",option:"Catalan"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"co",option:"Corsican"},{value:"hr",option:"Croatian"},{value:"cs",option:"Czech"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"eo",option:"Esperanto"},{value:"et",option:"Estonian"},{value:"fo",option:"Faroese"},{value:"tl",option:"Filipino"},{value:"fi",option:"Finnish"},{value:"fr",option:"French"},{value:"fy",option:"Frisian"},{value:"gl",option:"Galician"},{value:"ka",option:"Georgian"},{value:"de",option:"German"},{value:"el",option:"Greek"},{value:"gn",option:"Guarani"},{value:"gu",option:"Gujarati"},{value:"xx-hacker",option:"Hacker"},{value:"ha",option:"Hausa"},{value:"iw",option:"Hebrew"},{value:"hi",option:"Hindi"},{value:"hu",option:"Hungarian"},{value:"is",option:"Icelandic"},{value:"id",option:"Indonesian"},{value:"ia",option:"Interlingua"},{value:"ga",option:"Irish"},{value:"it",option:"Italian"},{value:"jw",option:"Javanese"},{value:"ja",option:"Japanese"},{value:"kn",option:"Kannada"},{value:"kk",option:"Kazakh"},{value:"rw",option:"Kinyarwanda"},{value:"rn",option:"Kirundi"},{value:"xx-klingon",option:"Klingon"},{value:"ku",option:"Kurdish"},{value:"ko",option:"Korean"},{value:"ky",option:"Kyrgyz"},{value:"lo",option:"Laothian"},{value:"la",option:"Latin"},{value:"lv",option:"Latvian"},{value:"ln",option:"Lingala"},{value:"lt",option:"Lithuanian"},{value:"mk",option:"Macedonian"},{value:"mg",option:"Malagasy"},{value:"ml",option:"Malayalam"},{value:"mt",option:"Maltese"},{value:"mi",option:"Maori"},{value:"mr",option:"Marathi"},{value:"mo",option:"Moldavian"},{value:"mn",option:"Mongolian"},{value:"sr-ME",option:"Montenegrin"},{value:"ne",option:"Nepali"},{value:"no",option:"Norwegian"},{value:"nn",option:"Norwegian (Nynorsk)"},{value:"oc",option:"Occitan"},{value:"or",option:"Oriya"},{value:"om",option:"Oromo"},{value:"ps",option:"Pashto"},{value:"fa",option:"Persian"},{value:"xx-pirate",option:"Pirate"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"pa",option:"Punjabi"},{value:"qu",option:"Quechua"},{value:"ro",option:"Romanian"},{value:"rm",option:"Romansh"},{value:"ru",option:"Russian"},{value:"gd",option:"Scots Gaelic"},{value:"sr",option:"Serbian"},{value:"sh",option:"Serbo-Croatian"},{value:"st",option:"Sesotho"},{value:"sn",option:"Shona"},{value:"sd",option:"Sindhi"},{value:"si",option:"Sinhalese"},{value:"sk",option:"Slovak"},{value:"sl",option:"Slovenian"},{value:"so",option:"Somali"},{value:"es",option:"Spanish"},{value:"su",option:"Sundanese"},{value:"sw",option:"Swahili"},{value:"sv",option:"Swedish"},{value:"tg",option:"Tajik"},{value:"ta",option:"Tamil"},{value:"tt",option:"Tatar"},{value:"te",option:"Telugu"},{value:"th",option:"Thai"},{value:"ti",option:"Tigrinya"},{value:"to",option:"Tonga"},{value:"tr",option:"Turkish"},{value:"tk",option:"Turkmen"},{value:"tw",option:"Twi"},{value:"ug",option:"Uighur"},{value:"uk",option:"Ukrainian"},{value:"ur",option:"Urdu"},{value:"uz",option:"Uzbek"},{value:"vi",option:"Vietnamese"},{value:"cy",option:"Welsh"},{value:"xh",option:"Xhosa"},{value:"yi",option:"Yiddish"},{value:"yo",option:"Yoruba"},{value:"zu",option:"Zulu"}]}).factory("googleAsrLanguage",function(){return[{option:"Afrikaans (South Africa)",value:"af-ZA"},{option:"Albanian (Albania)",value:"sq-AL"},{option:"Amharic (Ethiopia)",value:"am-ET"},{option:"Arabic (Algeria)",value:"ar-DZ"},{option:"Arabic (Bahrain)",value:"ar-BH"},{option:"Arabic (Egypt)",value:"ar-EG"},{option:"Arabic (Iraq)",value:"ar-IQ"},{option:"Arabic (Israel)",value:"ar-IL"},{option:"Arabic (Jordan)",value:"ar-JO"},{option:"Arabic (Kuwait)",value:"ar-KW"},{option:"Arabic (Lebanon)",value:"ar-LB"},{option:"Arabic (Morocco)",value:"ar-MA"},{option:"Arabic (Oman)",value:"ar-OM"},{option:"Arabic (Qatar)",value:"ar-QA"},{option:"Arabic (Saudi Arabia)",value:"ar-SA"},{option:"Arabic (State of Palestine)",value:"ar-PS"},{option:"Arabic (Tunisia)",value:"ar-TN"},{option:"Arabic (United Arab Emirates)",value:"ar-AE"},{option:"Arabic (Yemen)",value:"ar-YE"},{option:"Armenian (Armenia)",value:"hy-AM"},{option:"Azerbaijani (Azerbaijan)",value:"az-AZ"},{option:"Basque (Spain)",value:"eu-ES"},{option:"Bengali (Bangladesh)",value:"bn-BD"},{option:"Bengali (India)",value:"bn-IN"},{option:"Bosnian (Bosnia and Herzegovina)",value:"bs-BA"},{option:"Bulgarian (Bulgaria)",value:"bg-BG"},{option:"Burmese (Myanmar)",value:"my-MM"},{option:"Catalan (Spain)",value:"ca-ES"},{option:"Chinese, Cantonese (Traditional Hong Kong)",value:"yue-Hant-HK"},{option:"Chinese, Mandarin (Simplified, China)",value:"cmn-Hans-CN"},{option:"Croatian (Croatia)",value:"hr-HR"},{option:"Czech (Czech Republic)",value:"cs-CZ"},{option:"Danish (Denmark)",value:"da-DK"},{option:"Dutch (Belgium)",value:"nl-BE"},{option:"Dutch (Netherlands)",value:"nl-NL"},{option:"English (Australia)",value:"en-AU"},{option:"English (Canada)",value:"en-CA"},{option:"English (Ghana)",value:"en-GH"},{option:"English (Hong Kong)",value:"en-HK"},{option:"English (India)",value:"en-IN"},{option:"English (Ireland)",value:"en-IE"},{option:"English (Kenya)",value:"en-KE"},{option:"English (New Zealand)",value:"en-NZ"},{option:"English (Nigeria)",value:"en-NG"},{option:"English (Pakistan)",value:"en-PK"},{option:"English (Philippines)",value:"en-PH"},{option:"English (Singapore)",value:"en-SG"},{option:"English (South Africa)",value:"en-ZA"},{option:"English (Tanzania)",value:"en-TZ"},{option:"English (United Kingdom)",value:"en-GB"},{option:"English (United States)",value:"en-US"},{option:"Estonian (Estonia)",value:"et-EE"},{option:"Filipino (Philippines)",value:"fil-PH"},{option:"Finnish (Finland)",value:"fi-FI"},{option:"French (Belgium)",value:"fr-BE"},{option:"French (Canada)",value:"fr-CA"},{option:"French (France)",value:"fr-FR"},{option:"French (Switzerland)",value:"fr-CH"},{option:"Galician (Spain)",value:"gl-ES"},{option:"Georgian (Georgia)",value:"ka-GE"},{option:"German (Austria)",value:"de-AT"},{option:"German (Germany)",value:"de-DE"},{option:"German (Switzerland)",value:"de-CH"},{option:"Greek (Greece)",value:"el-GR"},{option:"Gujarati (India)",value:"gu-IN"},{option:"Hebrew (Israel)",value:"iw-IL"},{option:"Hindi (India)",value:"hi-IN"},{option:"Hungarian (Hungary)",value:"hu-HU"},{option:"Icelandic (Iceland)",value:"is-IS"},{option:"Indonesian (Indonesia)",value:"id-ID"},{option:"Italian (Italy)",value:"it-IT"},{option:"Italian (Switzerland)",value:"it-CH"},{option:"Japanese (Japan)",value:"ja-JP"},{option:"Javanese (Indonesia)",value:"jv-ID"},{option:"Kannada (India)",value:"kn-IN"},{option:"Kazakh (Kazakhstan)",value:"kk-KZ"},{option:"Khmer (Cambodia)",value:"km-KH"},{option:"Korean (South Korea)",value:"ko-KR"},{option:"Lao (Laos)",value:"lo-LA"},{option:"Latvian (Latvia)",value:"lv-LV"},{option:"Lithuanian (Lithuania)",value:"lt-LT"},{option:"Macedonian (North Macedonia)",value:"mk-MK"},{option:"Malay (Malaysia)",value:"ms-MY"},{option:"Malayalam (India)",value:"ml-IN"},{option:"Marathi (India)",value:"mr-IN"},{option:"Mongolian (Mongolia)",value:"mn-MN"},{option:"Nepali (Nepal)",value:"ne-NP"},{option:"Norwegian BokmÃ¥l (Norway)",value:"no-NO"},{option:"Persian (Iran)",value:"fa-IR"},{option:"Polish (Poland)",value:"pl-PL"},{option:"Portuguese (Brazil)",value:"pt-BR"},{option:"Portuguese (Portugal)",value:"pt-PT"},{option:"Punjabi (Gurmukhi India)",value:"pa-Guru-IN"},{option:"Romanian (Romania)",value:"ro-RO"},{option:"Russian (Russia)",value:"ru-RU"},{option:"Serbian (Serbia)",value:"sr-RS"},{option:"Sinhala (Sri Lanka)",value:"si-LK"},{option:"Slovak (Slovakia)",value:"sk-SK"},{option:"Slovenian (Slovenia)",value:"sl-SI"},{option:"Spanish (Argentina)",value:"es-AR"},{option:"Spanish (Bolivia)",value:"es-BO"},{option:"Spanish (Chile)",value:"es-CL"},{option:"Spanish (Colombia)",value:"es-CO"},{option:"Spanish (Costa Rica)",value:"es-CR"},{option:"Spanish (Dominican Republic)",value:"es-DO"},{option:"Spanish (Ecuador)",value:"es-EC"},{option:"Spanish (El Salvador)",value:"es-SV"},{option:"Spanish (Guatemala)",value:"es-GT"},{option:"Spanish (Honduras)",value:"es-HN"},{option:"Spanish (Mexico)",value:"es-MX"},{option:"Spanish (Nicaragua)",value:"es-NI"},{option:"Spanish (Panama)",value:"es-PA"},{option:"Spanish (Paraguay)",value:"es-PY"},{option:"Spanish (Peru)",value:"es-PE"},{option:"Spanish (Puerto Rico)",value:"es-PR"},{option:"Spanish (Spain)",value:"es-ES"},{option:"Spanish (United States)",value:"es-US"},{option:"Spanish (Uruguay)",value:"es-UY"},{option:"Spanish (Venezuela)",value:"es-VE"},{option:"Sundanese (Indonesia)",value:"su-ID"},{option:"Swahili (Kenya)",value:"sw-KE"},{option:"Swahili (Tanzania)",value:"sw-TZ"},{option:"Swedish (Sweden)",value:"sv-SE"},{option:"Tamil (India)",value:"ta-IN"},{option:"Tamil (Malaysia)",value:"ta-MY"},{option:"Tamil (Singapore)",value:"ta-SG"},{option:"Tamil (Sri Lanka)",value:"ta-LK"},{option:"Telugu (India)",value:"te-IN"},{option:"Thai (Thailand)",value:"th-TH"},{option:"Turkish (Turkey)",value:"tr-TR"},{option:"Ukrainian (Ukraine)",value:"uk-UA"},{option:"Urdu (India)",value:"ur-IN"},{option:"Urdu (Pakistan)",value:"ur-PK"},{option:"Uzbek (Uzbekistan)",value:"uz-UZ"},{option:"Vietnamese (Vietnam)",value:"vi-VN"},{option:"Zulu (South Africa)",value:"zu-ZA"}]}).factory("awsPollyVoice",function(){return[{value:"Zeina",option:"Zeina (Arabic, Female)"},{value:"Zhiyu",option:"Zhiyu (Chinese, Mandarin, Female)"},{value:"Naja",option:"Naja (Danish, Female)"},{value:"Mads",option:"Mads (Danish, Male)"},{value:"Lotte",option:"Lotte (Dutch, Female)"},{value:"Ruben",option:"Ruben (Dutch, Male)"},{value:"Nicole",option:"Nicole (English, Australian, Female)"},{value:"Olivia",option:"Olivia (English, Austrialian, Female)"},{value:"Russell",option:"Russell (English, Austrialian, Male)"},{value:"Amy",option:"Amy (English, British, Female)"},{value:"Emma",option:"Emma (English, British, Female)"},{value:"Brian",option:"Brian (English, British, Male)"},{value:"Aditi",option:"Aditi (English, Indian, Female)"},{value:"Raveena",option:"Raveena (English, Indian, Female)"},{value:"Aria",option:"Aria (English, New Zealand, Female)"},{value:"Ayanda",option:"Ayanda (English, South African, Female)"},{value:"Joanna",option:"Joanna (English, US, Female)"},{value:"Ivy",option:"Ivy (English, US, Female)"},{value:"Joey",option:"Joey (English, US, Male)"},{value:"Justin",option:"Justin (English, US, Male)"},{value:"Kendra",option:"Kendra (English, US, Female)"},{value:"Kimberly",option:"Kimberly (English, US, Female)"},{value:"Salli",option:"Salli (English, US, Female)"},{value:"Kevin",option:"Kevin (English, US, Male)"},{value:"Matthew",option:"Matthew (English, US, Male)"},{value:"Geraint",option:"Geraint (English, Welsh, Male)"},{value:"Celine",option:"Celine (French, Female)"},{value:"Mathieu",option:"Mathieu (French, Male)"},{value:"Léa",option:"Léa (French, Male)"},{value:"Chantal",option:"Chantal (French, Canadian, Female)"},{value:"Gabrielle",option:"Gabrielle (French, Canadian, Female)"},{value:"Vicki",option:"Vicki (German , Female)"},{value:"Hans",option:"Hans (German, Male)"},{value:"Marlene",option:"Marlene (German, Female)"},{value:"Aditi",option:"Aditi (Hindi , Female)"},{value:"Karl",option:"Karl (Icelandic, Male)"},{value:"Dora",option:"Dora (Icelandic, Female)"},{value:"Carla",option:"Carla (Italian, Female)"},{value:"Giorgio",option:"Giorgio (Italian, Male)"},{value:"Bianca",option:"Bianca (Italian, Male)"},{value:"Mizuki",option:"Mizuki (Japanese, Female)"},{value:"Takumi",option:"Takumi (Japanese, Male)"},{value:"Seoyeon",option:"Seoyeon (Korean, Female)"},{value:"Liv",option:"Liv (Norwegian, Female)"},{value:"Ewa",option:"Ewa (Polish, Female)"},{value:"Jacek",option:"Jacek (Polish, Male)"},{value:"Jan",option:"Jan (Polish, Male)"},{value:"Maja",option:"Maja (Polish, Female)"},{value:"Camila",option:"Camila (Portuguese, Brazilian, Female)"},{value:"Ricardo",option:"Ricardo (Portuguese, Brazilian, Male)"},{value:"Vitoria",option:"Vitoria (Portuguese, Brazilian, Female)"},{value:"Cristiano",option:"Cristiano (Portuguese, Male)"},{value:"Ines",option:"Ines (Portuguese, Female)"},{value:"Carmen",option:"Carmen (Romanian, Female)"},{value:"Maxim",option:"Maxim (Russian, Male)"},{value:"Tatyana",option:"Tatyana (Russian, Female)"},{value:"Conchita",option:"Conchita (Spanish, European, Female)"},{value:"Lucia",option:"Lucia (Spanish, European, Female)"},{value:"Enrique",option:"Enrique (Spanish, European, Male)"},{value:"Mia",option:"Mia (Spanish, Mexican, Female)"},{value:"Miguel",option:"Miguel (Spanish, US, Male)"},{value:"Penelope",option:"Penelope (Spanish, US, Female)"},{value:"Lupe",option:"Lupe (Spanish, US, Female)"},{value:"Astrid",option:"Astrid (Swedish, Female)"},{value:"Filiz",option:"Filiz (Turkish, Female)"},{value:"Gwyneth",option:"Gwyneth (Welsh , Female)"}]}).factory("awsPollyRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-east-2",option:"US East (Ohio)"},{value:"us-west-1",option:"US West (N. California)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"ca-central-1",option:"Canada (Central)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"eu-central-1",option:"EU (Frankfurt)"},{value:"eu-west-2",option:"EU (London)"},{value:"eu-west-3",option:"EU (Paris)"},{value:"ap-southeast-1",option:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"},{value:"ap-northeast-2",option:"Asia Pacific (Seoul)"},{value:"ap-northeast-1",option:"Asia Pacific (Tokyo)"},{value:"ap-south-1",option:"Asia Pacific (Mumbai)"},{value:"sa-east-1",option:"South America (São Paulo)"}]}).factory("awsLexRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"}]}).factory("dialogFlowLanguage",function(){return[{value:"da",option:"Danish"},{value:"en",option:"English"},{value:"de",option:"German"},{value:"it",option:"Italian"},{value:"es",option:"Spanish"},{value:"fr",option:"French"},{value:"id",option:"Indonesian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean (South Korea)"},{value:"nl",option:"Dutch"},{value:"no",option:"Norwegian"},{value:"pt",option:"Portuguese (European)"},{value:"pt-br",option:"Portuguese (Nrazilian)"},{value:"ru",option:"Russian"},{value:"sv",option:"Swedish"},{value:"th",option:"Thai"},{value:"uk",option:"Ukrainian"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-HK",option:"Chinese (Hong Kong)"},{value:"zh-TW",option:"Chinese (Traditional)"}]}).factory("dialogFlowV2Language",function(){return[{value:"zh-HK",option:"Chinese (Cantonese)"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"en-AU",option:"English (Australia)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (Great Britain)"},{value:"en-IN",option:"English (India)"},{value:"en-US",option:"English (US)"},{value:"fr",option:"French"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"France (France)"},{value:"de",option:"German"},{value:"hi",option:"Hindi"},{value:"id",option:"Indonesian"},{value:"it",option:"Italian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean"},{value:"no",option:"Norwegian"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ru",option:"Russian"},{value:"es",option:"Spanish"},{value:"es-419",option:"Spanish (Latin America)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"sw",option:"Swedish"},{value:"th",option:"Thai"},{value:"tr",option:"Turkish"},{value:"uk",option:"Ukrainian"}]})}(),function(){"use strict";function e(n,e,t,a){var i=this;i.project={preproduction:t},i.closeDialog=function(e){e?(a(i.project.preproduction),n.hide(i.project.preproduction)):n.hide()}}e.$inject=["$mdDialog","toasty","currentXML","saveCallback"],angular.module("app.callysquare").controller("MxGraphEditXMLController",e)}(),function(){"use strict";function e(n,t){var a=this;function i(e){e?(t(e),n.hide(e)):n.hide()}a.errors=[],a.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:5242880,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},a.ngFlow={flow:{}},a.dropping=!1,a.closeDialog=i,a.fileAdded=function(e){a.errors=[];_.includes(["xml"],e.getExtension())||a.errors.push({message:"The extension "+e.getExtension()+" is not supported!"});5242880<e.size&&a.errors.push({message:"The file is too big. The max allowed size is 5MB"});if(!a.errors.length){var n=new FileReader;n.onload=function(e){i(e.target.result)},n.readAsText(e.file)}}}e.$inject=["$mdDialog","saveCallback"],angular.module("app.callysquare").controller("MxGraphImportXMLController",e)}(),function(){"use strict";function e(n,t,e,a){var i=this;i.project=_.clone(e),i.closeDialog=function(){n.hide()},i.save=function(){i.errors=[],a.squareProject.update({id:i.project.id},{notes:i.project.notes,description:i.project.description}).$promise.then(function(e){t.success({title:"Project updated!",msg:i.project.name?i.project.name+" has been updated!":""}),n.hide(e)}).catch(function(e){console.error(e),i.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}]})}}e.$inject=["$mdDialog","toasty","project","api"],angular.module("app.callysquare").controller("MxGraphUpdateInfoController",e)}(),function(){"use strict";function e(n,e,t,a,i){var s=this;s.projects=t,s.id="",s.newWindow=!0,s.closeDialog=function(e){s.errors=[],e?(n.hide(),s.newWindow?a.open("/callysquare/projects/"+s.id,"_blank"):i.go("app.callysquare.projects.edit",{id:s.id})):n.hide()}}e.$inject=["$mdDialog","toasty","projects","$window","$state"],angular.module("app.callysquare").controller("MxGraphOpenProjectController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o){var r=this;function l(){return a.squareProject.getUsers({id:r.project.id,fields:"id,name,fullname,internal",nolimit:!0,role:"user"}).$promise.then(function(e){return r.selectedItems=e.rows?_.map(e.rows,function(e){return e}):[],r.dualMultiselectOptions.selectedItems=r.selectedItems,a.user.get({fields:"id,fullname,name,internal",role:"user",nolimit:!0}).$promise}).then(function(e){r.items=e.rows?_.map(e.rows,function(e){return e}):[],r.dualMultiselectOptions.items=_.differenceBy(r.items,r.selectedItems,"id")}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}r.project=n,r.penalty=0,r.items=[],r.selectedItems=[],r.closeDialog=function(){e.hide()},r.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("CALLYSQUARE.ALL_USERS"),labelSelected:s.instant("CALLYSQUARE.SELECTED_USERS"),transferCallback:function(e,n){a.squareProject[n?"removeUsers":"addUsers"]({id:r.project.id,ids:_.map(e,"id"),penalty:r.penalty||0}).$promise.then(function(){t.success({title:"Project properly "+(n?"removed":"added"),msg:"Project has been "+(n?"removed":"added")+"!"}),n||l()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:squareProjects.ADDUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},l()}e.$inject=["$mdDialog","toasty","api","project","projects","$translate","Auth"],angular.module("app.callysquare").controller("ProjectspermissionaddController",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o){var r=this;r.project=angular.copy(e),r.project.name+="_new",r.project.preproduction=a,r.newWindow=!0,r.closeDialog=function(){n.hide()},r.save=function(){delete r.project.id,i.squareProject.save(r.project).$promise.then(function(e){t.success({title:"Project properly created",msg:r.project.name?r.project.name+" has been created!":""}),n.hide(e),r.newWindow?s.open("/callysquare/projects/"+e.id,"_blank"):o.go("app.callysquare.projects.edit",{id:e.id})}).catch(function(e){console.error(e),r.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}]})}}e.$inject=["$mdDialog","toasty","project","currentXML","api","$window","$state"],angular.module("app.callysquare").controller("MxGraphSaveProjectAsController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,r,n,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S,T){var I=this;I.currentUser=T.getCurrentUser(),I.project=n||{},I.userProfileSection=S&&1==S.count?S.rows[0]:null,I.crudPermissions=T.parseCrudPermissions(I.userProfileSection?I.userProfileSection.crudPermissions:null),I.onInit=function(){new EditorUi(I,new Editor,document.getElementById("geEditor")).openString(I.project.preproduction,I.project.name,I.project)},I.saveOrPublishProject=function(e,n){var t={preproduction:e};n&&(t.production=e);r.squareProject.update({id:I.project.id},t).$promise.then(function(e){o.success({title:"Project "+(n?"published":"saved")+"!",msg:I.project.name?I.project.name+" has been "+(n?"published":"saved")+"!":""}),I.project.preproduction=e.preproduction}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsquareProject",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.openDialog=function(e,n){a.show({controller:"MxGraphDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{users:l.rows||[],trunks:d.rows||[],queues:c.rows||[],sounds:m.rows||[],variables:u.rows||[],databases:p.rows||[],contexts:g.rows||[],projects:v.rows||[],intervals:h.rows||[],mailAccounts:f.rows||[],smsAccounts:E.rows||[],pauses:y.rows||[],templates:b.rows||[],lists:A.rows||[],cell:e,saveCallback:n,crudPermissions:I.crudPermissions}})},I.newProject=function(e){a.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{project:e,projects:v.rows,openFromEditor:!0,license:null,setting:null,crudPermissions:I.crudPermissions}})},I.openProject=function(){a.show({controller:"MxGraphOpenProjectController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/open/open.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{projects:v.rows||[]}})},I.saveProjectAs=function(e){a.show({controller:"MxGraphSaveProjectAsController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{project:I.project,currentXML:e}}).then(function(e){e&&v.rows.push(e)})},I.newVariable=function(n){return i(function(a,n){return r.userProfileSection.get({userProfileId:I.currentUser.userProfileId,sectionId:1012}).$promise.then(function(e){var n=e.rows?e.rows[0]:null,t=T.parseCrudPermissions(n?n.crudPermissions:null);a(t)}).catch(function(e){n(e)})}).then(function(e){e.canEdit?a.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{variable:n,variables:u.rows,license:null,setting:null,crudPermissions:e}}):o.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE")})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:NEW_VARIABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.updateInfo=function(e){a.show({controller:"MxGraphUpdateInfoController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/info/info.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:I.project}}).then(function(e){e&&_.merge(I.project,e)})},I.editXML=function(e,n){a.show({controller:"MxGraphEditXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/edit/edit.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{currentXML:e,saveCallback:n}}).then(function(e){e&&(I.project.preproduction=e)})},I.importXML=function(e){a.show({controller:"MxGraphImportXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/import/import.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{saveCallback:e}}).then(function(e){e&&(I.project.preproduction=e)})},I.gotoProjects=function(){e.go("app.callysquare.projects",{},{reload:"app.callysquare.projects"})}}e.$inject=["$state","$document","$mdDialog","$q","$translate","toasty","api","project","users","trunks","queues","sounds","variables","databases","contexts","projects","intervals","mailAccounts","templates","lists","smsAccounts","pauses","userProfileSection","Auth"],angular.module("app.callysquare").controller("ProjectController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.projects=a||{count:0,rows:[]},p.userProfile=i,p.userProfileSection=s&&1==s.count?s.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.listOrder="",p.listOrderAsc=null,p.selectedProjects=[],p.query={fields:"id,name,description,notes",sort:"-updatedAt",limit:10,page:1},p.editstate=function(e,n){t.go("app.callysquare.projects.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.deleteconfirm=function(e,n){var t=l.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete project").targetEvent(n).ok("OK").cancel("CANCEL");l.show(t).then(function(){f(e)},function(){console.log("CANCEL")})},p.success=h,p.getProjects=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=o.squareProject.get(p.query,h).$promise:(p.query.id=p.userProfile.id,p.query.section="SquareProjects",p.promise=o.userProfile.getResources(p.query,h).$promise)},p.createOrEditProject=function(e,n){l.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(d.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:n,projects:p.projects.rows,openFromEditor:null,setting:null,crudPermissions:p.crudPermissions}})},p.deleteProject=f,p.exportSelectedProjects=function(){var e=angular.copy(p.selectedProjects);return p.selectedProjects=[],e},p.deleteSelectedProjects=function(e){var n=l.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+p.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");l.show(n).then(function(){p.selectedProjects.forEach(function(e){f(e)}),p.selectedProjects=[]})},p.deselectProjects=function(){p.selectedProjects=[]},p.selectAllProjects=function(){p.selectedProjects=p.projects.rows};var g=!0,v=1;function h(e){p.projects=e||{count:0,rows:[]}}function f(e){o.squareProject.delete({id:e.id}).$promise.then(function(){_.remove(p.projects.rows,{id:e.id}),p.projects.count-=1,p.projects.rows.length||p.getProjects(),m.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.project.delete"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.project.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){g?c(function(){g=!1}):(n||(v=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=v),p.getProjects())})}e.$inject=["$scope","$state","$mdSidenav","projects","userProfile","userProfileSection","api","msUtils","$mdDialog","$document","$timeout","toasty","Auth"],angular.module("app.callysquare").controller("ProjectsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_SQUARERECORDING",g.squareRecording=angular.copy(l),g.squareRecordings=r,g.newSquareRecording=!1,g.squareRecording||(g.squareRecording={},g.title="CALLYSQUARE.NEW_SQUARERECORDING",g.newSquareRecording=!0),g.addNewSquareRecording=function(){g.errors=[],d.squareRecording.save(g.squareRecording).$promise.then(function(e){g.squareRecordings.unshift(e.toJSON()),o.success({title:"SquareRecording properly created",msg:g.squareRecording.name?g.squareRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSquareRecording=function(){g.errors=[],d.squareRecording.update({id:g.squareRecording.id},g.squareRecording).$promise.then(function(e){var n=_.find(g.squareRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SquareRecording properly saved!",msg:g.squareRecording.name?g.squareRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSquareRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The squareRecording will be deleted.").ariaLabel("Delete SquareRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.squareRecording.delete({id:g.squareRecording.id}).$promise.then(function(){_.remove(g.squareRecordings,{id:g.squareRecording.id}),o.success({title:"SquareRecording properly deleted!",msg:(g.squareRecording.name||"squareRecording")+" has been deleted!"}),v(g.squareRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","squareRecordings","squareRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareRecordingDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.squareRecordings=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="squareRecordings",f.listOrder="",f.listOrderAsc=null,f.selectedSquareRecordings=[],f.query={fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,page:1},f.downloadfile2=function(s,e){return m.squareRecording.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid+s.format;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("squareRecording")+"?").htmlContent("<b>"+(e.name||"squareRecording")+"</b> will be deleted.").ariaLabel("delete squareRecording").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSquareRecordings=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.squareRecording.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SquareRecordings",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSquareRecording=function(e,n){i.show({controller:"CreateOrEditSquareRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/squareRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{squareRecording:n,squareRecordings:f.squareRecordings.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSquareRecording=y,f.exportSelectedSquareRecordings=function(){var e=angular.copy(f.selectedSquareRecordings);return f.selectedSquareRecordings=[],e},f.deleteSelectedSquareRecordings=function(e){var n=i.confirm().title("Are you sure want to delete the selected squareRecordings?").htmlContent("<b>"+f.selectedSquareRecordings.length+" selected</b> will be deleted.").ariaLabel("delete SquareRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSquareRecordings.forEach(function(e){y(e)}),f.selectedSquareRecordings=[]})},f.deselectSquareRecordings=function(){f.selectedSquareRecordings=[]},f.selectAllSquareRecordings=function(){f.selectedSquareRecordings=f.squareRecordings.rows};var b=!0,A=1;function E(e){f.squareRecordings=e||{count:0,rows:[]}}function y(e){m.squareRecording.delete({id:e.id}).$promise.then(function(){_.remove(f.squareRecordings.rows,{id:e.id}),f.squareRecordings.count-=1,f.squareRecordings.rows.length||f.getSquareRecordings(),p.success({title:_.startCase("SquareRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSquareRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","squareRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.callysquare").controller("SquareRecordingsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chatQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chatQueues",f.listOrder="",f.listOrderAsc=null,f.selectedChatQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.chat.chatQueues.edit",{id:e.id,chatQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:f.chatQueues?f.chatQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:f.chatQueues?f.chatQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chatQueue")+"?").htmlContent("<b>"+(e.name||"chatQueue")+"</b> will be deleted.").ariaLabel("delete chatQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.chat.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.chat.realtime.queues",{})}},f.success=E,f.getChatQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.chatQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChatQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditChatQueue=function(e,n){i.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:n,chatQueues:f.chatQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteChatQueue=y,f.exportSelectedChatQueues=function(){var e=angular.copy(f.selectedChatQueues);return f.selectedChatQueues=[],e},f.deleteSelectedChatQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected chatQueues?").htmlContent("<b>"+f.selectedChatQueues.length+" selected</b> will be deleted.").ariaLabel("delete ChatQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChatQueues.forEach(function(e){y(e)}),f.selectedChatQueues=[]})},f.deselectChatQueues=function(){f.selectedChatQueues=[]},f.selectAllChatQueues=function(){f.selectedChatQueues=f.chatQueues.rows};var b=!0,A=1;function E(e){f.chatQueues=e||{count:0,rows:[]}}function y(e){m.chatQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.chatQueues.rows,{id:e.id}),f.chatQueues.count-=1,f.chatQueues.rows.length||f.getChatQueues(),p.success({title:_.startCase("ChatQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChatQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.chat").controller("ChatQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATQUEUE",g.chatQueue=angular.copy(l),g.chatQueues=r,g.newChatQueue=!1,g.chatQueue||(g.chatQueue={strategy:"beepall",timeout:10},g.title="CHAT.NEW_CHATQUEUE",g.newChatQueue=!0),g.addNewChatQueue=function(){g.errors=[],d.chatQueue.save(g.chatQueue).$promise.then(function(e){g.chatQueues.unshift(e.toJSON()),o.success({title:"ChatQueue properly created",msg:g.chatQueue.name?g.chatQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatQueue=function(){g.errors=[],d.chatQueue.update({id:g.chatQueue.id},g.chatQueue).$promise.then(function(e){var n=_.find(g.chatQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatQueue properly saved!",msg:g.chatQueue.name?g.chatQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatQueue will be deleted.").ariaLabel("Delete ChatQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatQueue.delete({id:g.chatQueue.id}).$promise.then(function(){_.remove(g.chatQueues,{id:g.chatQueue.id}),o.success({title:"ChatQueue properly deleted!",msg:(g.chatQueue.name||"chatQueue")+" has been deleted!"}),v(g.chatQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatQueues","chatQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatQueue.getAgents({id:c.chatQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.chatQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.removeAgents({id:c.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.addAgents({id:c.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","chatQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatQueue.getTeams({id:l.chatQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.chatQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("CHAT.ALL_TEAMS"),labelSelected:t.instant("CHAT.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.removeTeams({id:l.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.addTeams({id:l.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.chatQueue=c||e.params.chatQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoChatQueues=function(){e.go("app.chat.chatQueues",{},{reload:"app.chat.chatQueues"})},u.saveChatQueue=function(){r.chatQueue.update({id:u.chatQueue.id},u.chatQueue).$promise.then(function(){l.success({title:"ChatQueue updated!",msg:u.chatQueue.name?u.chatQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatQueue","userProfileSection"],angular.module("app.chat").controller("ChatQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chatWebsites=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chatWebsites",f.listOrder="",f.listOrderAsc=null,f.selectedChatWebsites=[],f.query={fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,page:1},f.arrayagentIdentifier=_.keyBy([{option:"WebsiteAlias",value:"'website_alias'"},{option:"AgentAlias",value:"'agent_alias'"},{option:"AgentFullname",value:"'agent_fullname'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayheader_shape=_.keyBy([{option:"Rounded",value:"'rounded'"},{option:"Squared",value:"'squared'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayalignment=_.keyBy([{option:"bottom_right",value:"'bottom_right'"},{option:"right",value:"'right'"},{option:"left",value:"'left'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymessagesAlignment=_.keyBy([{option:"alternate",value:"'alternate'"},{option:"centered",value:"'centered'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayratingType=_.keyBy([{option:"Star",value:"'star'"},{option:"Thumb",value:"'thumb'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,chatWebsite:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,tab:10})},f.offlinemessagesgoto=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,tab:11})},f.agentadddialog=function(e,n){i.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:f.chatWebsites?f.chatWebsites.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chatWebsite")+"?").htmlContent("<b>"+(e.name||"chatWebsite")+"</b> will be deleted.").ariaLabel("delete chatWebsite").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getChatWebsites=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.chatWebsite.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChatWebsites",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditChatWebsite=function(e,n){i.show({controller:"CreateOrEditChatWebsiteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:n,chatWebsites:f.chatWebsites.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteChatWebsite=y,f.exportSelectedChatWebsites=function(){var e=angular.copy(f.selectedChatWebsites);return f.selectedChatWebsites=[],e},f.deleteSelectedChatWebsites=function(e){var n=i.confirm().title("Are you sure want to delete the selected chatWebsites?").htmlContent("<b>"+f.selectedChatWebsites.length+" selected</b> will be deleted.").ariaLabel("delete ChatWebsites").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChatWebsites.forEach(function(e){y(e)}),f.selectedChatWebsites=[]})},f.deselectChatWebsites=function(){f.selectedChatWebsites=[]},f.selectAllChatWebsites=function(){f.selectedChatWebsites=f.chatWebsites.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.chatWebsite&&(t=_.find(f.lists,{id:Number(f.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.chatWebsite&&(a=_.find(f.lists,{id:Number(f.chatWebsite.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.chatWebsite&&(t=_.find(f.interval,{id:Number(f.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.chatWebsite&&(a=_.find(f.interval,{id:Number(f.chatWebsite.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.chatWebsites=e||{count:0,rows:[]}}function y(e){m.chatWebsite.delete({id:e.id}).$promise.then(function(){_.remove(f.chatWebsites.rows,{id:e.id}),f.chatWebsites.count-=1,f.chatWebsites.rows.length||f.getChatWebsites(),p.success({title:_.startCase("ChatWebsite")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChatWebsites())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatWebsites","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.chat").controller("ChatWebsitesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATWEBSITE",g.chatWebsite=angular.copy(l),g.chatWebsites=r,g.newChatWebsite=!1,g.chatWebsite||(g.chatWebsite={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),header_shape:"rounded",alignment:"bottom_right",verticalAlignment:30,labelText:"CHAT",messagesAlignment:"alternate",IntervalId:"null",timezone:"null",waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300,vidaooTopic:"Generated by XCALLY Motion",vidaooNote:"Meeting generated for interaction #{{interaction.id}} by {{agent.name}}"},g.title="CHAT.NEW_CHATWEBSITE",g.newChatWebsite=!0),n.params.id&&(g.chatWebsite.ChatWebsiteId=n.params.id),g.addNewChatWebsite=function(){g.errors=[],d.chatWebsite.save(g.chatWebsite).$promise.then(function(e){g.chatWebsites.unshift(e.toJSON()),o.success({title:"ChatWebsite properly created",msg:g.chatWebsite.name?g.chatWebsite.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatWebsite=function(){g.errors=[],d.chatWebsite.update({id:g.chatWebsite.id},g.chatWebsite).$promise.then(function(e){var n=_.find(g.chatWebsites,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatWebsite properly saved!",msg:g.chatWebsite.name?g.chatWebsite.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatWebsite=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatWebsite will be deleted.").ariaLabel("Delete ChatWebsite").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatWebsite.delete({id:g.chatWebsite.id}).$promise.then(function(){_.remove(g.chatWebsites,{id:g.chatWebsite.id}),o.success({title:"ChatWebsite properly deleted!",msg:(g.chatWebsite.name||"chatWebsite")+" has been deleted!"}),v(g.chatWebsite)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.chatWebsite&&(t=_.find(g.lists,{id:Number(g.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.chatWebsite&&(a=_.find(g.lists,{id:Number(g.chatWebsite.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.chatWebsite&&(t=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.chatWebsite&&(a=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatWebsites","chatWebsite","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatWebsiteDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.chatWebsiteApps.rows.length){var t=r.chatWebsiteApps.rows[n]?r.chatWebsiteApps.rows[n]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsiteApp:t,chatWebsite:r.chatWebsite,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.chatWebsiteApps.rows[n]=e:r.chatWebsiteApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.chatWebsiteApps.rows.length;t++,0){var a=r.chatWebsiteApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.chatWebsite.context,a.exten=r.chatWebsite.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.chatWebsite.addApplications({id:r.chatWebsite.id},_.sortBy(n,"priority")).$promise.then(function(e){r.chatWebsiteApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.chatWebsiteApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.chatWebsite={},r.chatWebsiteApps={count:0,rows:[]},r.selectedChatWebsiteApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"ChatQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"chatQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:501}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",role:"agent",sort:"name",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"tvox",appType:"tvox",type:"tvox",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"serviceid",name:"serviceid",type:"text",param:0},{title:"channelid",name:"channelid",type:"text",param:1},{title:"tvoxurl",name:"tvoxurl",type:"text",param:2},{title:"tvoxloginurl",name:"tvoxloginurl",type:"text",param:3},{title:"tvoxsessionurl",name:"tvoxsessionurl",type:"text",param:4},{title:"tvoxusername",name:"tvoxusername",type:"text",param:5},{title:"tvoxpasswd",name:"tvoxpasswd",type:"password",param:6},{title:"motionurlonring",name:"motionurlonring",type:"text",param:7},{title:"motionurlonanswer",name:"motionurlonanswer",type:"text",param:8},{title:"motiontitle",name:"motiontitle",type:"text",param:9},{title:"motionurl",name:"motionurl",type:"text",param:10}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.chatWebsite=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getChatWebsiteApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.chatWebsiteApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getChatWebsiteApps=function(){r.promise=o.chatWebsite.getApplications(r.query,t).$promise},r.editChatWebsiteApp=n,r.editInterval=function(e,n){if(r.chatWebsiteApps.rows.length){var t=r.chatWebsiteApps.rows[n]?r.chatWebsiteApps.rows[n]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteChatWebsiteApp=function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedChatWebsiteApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedChatWebsiteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedChatWebsiteApps.forEach(function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id})}),r.selectedChatWebsiteApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatWebsite.getAgents({id:c.chatWebsite.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserChatWebsite?"penalty "+e.UserChatWebsite.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.chatWebsite=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatWebsite.removeAgents({id:c.chatWebsite.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatWebsite.addAgents({id:c.chatWebsite.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","chatWebsite","chatWebsites","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatWebsiteagentaddController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsiteagentAvatarController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditChatWebsiteAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("chat")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:501}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptagDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tvox=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tvox.appdata)switch(l.tvox.appType?l.tvox.appType.toLowerCase():l.tvox.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tvox.appdata.split(",");l.tvox.key=d[0],l.tvox.language=d[1],l.tvox.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tvox.appdata.split(",");l.tvox.projectId=d[0],l.tvox.clientEmail=d[1],l.tvox.privateKey=d[2],l.tvox.language=d[3],l.tvox.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tvox.appdata.split(",");l.tvox.accesskeyid=d[0],l.tvox.secretaccesskey=d[1],l.tvox.lexregion=d[2],l.tvox.botname=d[3],l.tvox.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tvox.appdata.split(",");l.tvox.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tvox.text=d.slice(1,d.length).join(",");break;case"message":l.tvox.text=l.tvox.appdata;break;case"set":l.tvox.name=l.tvox.appdata.split("=")[0],l.tvox.value=l.tvox.appdata.split("=")[1];break;case"agi":l.tvox.project=l.tvox.appdata;break;default:var c=l.tvox.appdata.split(",");l.tvox.serviceid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.tvox.channelid=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.tvox.tvoxurl=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.tvox.tvoxloginurl=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.tvox.tvoxsessionurl=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10),l.tvox.tvoxusername=_.isEmpty(c[5])?c[5]:isNaN(c[5])?c[5]:parseInt(c[5],10),l.tvox.tvoxpasswd=_.isEmpty(c[6])?c[6]:isNaN(c[6])?c[6]:parseInt(c[6],10),l.tvox.motionurlonring=_.isEmpty(c[7])?c[7]:isNaN(c[7])?c[7]:parseInt(c[7],10),l.tvox.motionurlonanswer=_.isEmpty(c[8])?c[8]:isNaN(c[8])?c[8]:parseInt(c[8],10),l.tvox.motiontitle=_.isEmpty(c[9])?c[9]:isNaN(c[9])?c[9]:parseInt(c[9],10),l.tvox.motionurl=_.isEmpty(c[10])?c[10]:isNaN(c[10])?c[10]:parseInt(c[10],10)}function m(e){n.hide(e)}l.tvox.type&&"outbound"===l.tvox.type.toLowerCase()&&"outbounddial"===l.tvox.appType.toLowerCase()&&(l.tvox.prefix=l.tvox.phone?l.tvox.phone.split("$")[0]:void 0,l.tvox.callerId=l.tvox.callerID?"CALLERID(all)="+l.tvox.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tvox.type&&"outbound"===l.tvox.type.toLowerCase()&&"outboundDial"===l.tvox.appType&&(l.tvox.phone=i.cutdigits?(l.tvox.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tvox.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tvox.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tvox.options+="U(xcally-mixmonitor-context)"):l.tvox.options=l.tvox.options.replace("U(xcally-mixmonitor-context)",""));if(l.tvox.appType&&"custom"===l.tvox.appType);else switch((l.tvox.app||l.tvox.appType).toLowerCase()){case"set":l.tvox.appdata=l.tvox.name+"="+l.tvox.value;break;case"custom":break;default:e[0]=l.tvox.serviceid,e[1]=l.tvox.channelid,e[2]=l.tvox.tvoxurl,e[3]=l.tvox.tvoxloginurl,e[4]=l.tvox.tvoxsessionurl,e[5]=l.tvox.tvoxusername,e[6]=l.tvox.tvoxpasswd,e[7]=l.tvox.motionurlonring,e[8]=l.tvox.motionurlonanswer,e[9]=l.tvox.motiontitle,e[10]=l.tvox.motionurl,l.tvox.appdata=e.join(",")}m(l.tvox)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptvoxDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteChatCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteChatCannedAnswers.rows,{id:e.id}),m.chatWebsiteChatCannedAnswers.count-=1,m.chatWebsiteChatCannedAnswers.rows.length||p(),l.success({title:"ChatCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteChatCannedAnswers={count:0,rows:[]},m.selectedChatWebsiteChatCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the chatCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("chatCannedAnswer #")+e.id||"chatCannedAnswer")+"</b> will be deleted.").ariaLabel("delete chatCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteChatCannedAnswers=p,m.createOrEditChatWebsiteChatCannedAnswer=function(e,n){o.show({controller:"CreateOrEditChatCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,chatCannedAnswer:n,chatCannedAnswers:m.chatWebsiteChatCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedChatWebsiteChatCannedAnswers=function(){var e=angular.copy(m.selectedChatWebsiteChatCannedAnswers);return m.selectedChatWebsiteChatCannedAnswers=[],e},m.deleteChatWebsiteChatCannedAnswer=g,m.deleteSelectedChatWebsiteChatCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected chatCannedAnswers?").htmlContent("<b>"+m.selectedChatWebsiteChatCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete chatCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteChatCannedAnswers.forEach(function(e){g(e)}),m.selectedChatWebsiteChatCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATCANNEDANSWER",g.chatCannedAnswer=angular.copy(l),g.chatCannedAnswers=r,g.newChatCannedAnswer=!1,g.chatCannedAnswer||(g.chatCannedAnswer={},g.title="CHAT.NEW_CHATCANNEDANSWER",g.newChatCannedAnswer=!0),n.params.id&&(g.chatCannedAnswer.ChatWebsiteId=n.params.id),g.addNewChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.chatCannedAnswer).$promise.then(function(e){g.chatCannedAnswers.unshift(e.toJSON()),o.success({title:"ChatCannedAnswer properly created",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.chatCannedAnswer.id},g.chatCannedAnswer).$promise.then(function(e){var n=_.find(g.chatCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatCannedAnswer properly saved!",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatCannedAnswer will be deleted.").ariaLabel("Delete ChatCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.chatCannedAnswer.id}).$promise.then(function(){_.remove(g.chatCannedAnswers,{id:g.chatCannedAnswer.id}),o.success({title:"ChatCannedAnswer properly deleted!",msg:(g.chatCannedAnswer.name||"chatCannedAnswer")+" has been deleted!"}),v(g.chatCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatCannedAnswers","chatCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.chatWebsite.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.chatWebsite=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.chatWebsite.id,field:"ChatWebsiteId",route:"chatWebsite"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteDispositionsController",e)}(),function(){"use strict";function e(t,e,a){var i=this;i.chatWebsite={},i.offlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"},{type:"upload",name:"Upload",icon:"icon-upload"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.offlineForm)&&(i.chatWebsite.offlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var n=0;n<e.rows.length;n++)i.customFields.push({key:"cf_"+e.rows[n].id,value:e.rows[n].alias});return a.cmContact.describe().$promise}).then(function(e){for(var n=_.keys(e),t=0;t<n.length;t++)_.includes(i.uselessFields,n[t])||_.startsWith(n[t],"cf_")||i.fields.unshift({key:n[t],value:n[t]});return a.variable.get().$promise}).then(function(e){return i.variables=e.rows,a.mailAccount.get({fields:"id,name",raw:!0}).$promise.then(function(e){i.email_accounts=e.rows})}).catch(function(e){console.error(e)})},i.up=function(e,n){if(0!==n){var t=i.chatWebsite.offlineForm.items[n-1];i.chatWebsite.offlineForm.items[n]=t,i.chatWebsite.offlineForm.items[n-1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===n?i.chatWebsite.offlineForm.fromKey--:i.chatWebsite.offlineForm.fromKey===n-1&&i.chatWebsite.offlineForm.fromKey++}},i.down=function(e,n){if(n!==i.chatWebsite.offlineForm.items.length-1){var t=i.chatWebsite.offlineForm.items[n+1];i.chatWebsite.offlineForm.items[n]=t,i.chatWebsite.offlineForm.items[n+1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===n?i.chatWebsite.offlineForm.fromKey++:i.chatWebsite.offlineForm.fromKey===n+1&&i.chatWebsite.offlineForm.fromKey--}},i.add=function(e){i.chatWebsite.offlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var n=t.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");t.show(n).then(function(){i.chatWebsite.offlineForm.items.splice(e,1)})},i.card_type="offline",i.email_accounts=[]}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteofflineFormController",e)}(),function(){"use strict";function e(t,e,a){var i=this;i.chatWebsite={},i.onlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.onlineForm)&&(i.chatWebsite.onlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var n=0;n<e.rows.length;n++)i.customFields.push({key:"cf_"+e.rows[n].id,value:e.rows[n].alias});return a.cmContact.describe().$promise}).then(function(e){for(var n=_.keys(e),t=0;t<n.length;t++)_.includes(i.uselessFields,n[t])||_.startsWith(n[t],"cf_")||i.fields.unshift({key:n[t],value:n[t]});return a.variable.get().$promise}).then(function(e){return i.variables=e.rows,a.mailAccount.get({fields:"id,name",raw:!0}).$promise.then(function(e){i.email_accounts=e.rows})}).catch(function(e){console.error(e)})},i.up=function(e,n){if(0!==n){var t=i.chatWebsite.onlineForm.items[n-1];i.chatWebsite.onlineForm.items[n]=t,i.chatWebsite.onlineForm.items[n-1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===n?i.chatWebsite.onlineForm.fromKey--:i.chatWebsite.onlineForm.fromKey===n-1&&i.chatWebsite.onlineForm.fromKey++}},i.down=function(e,n){if(n!==i.chatWebsite.onlineForm.items.length-1){var t=i.chatWebsite.onlineForm.items[n+1];i.chatWebsite.onlineForm.items[n]=t,i.chatWebsite.onlineForm.items[n+1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===n?i.chatWebsite.onlineForm.fromKey++:i.chatWebsite.onlineForm.fromKey===n+1&&i.chatWebsite.onlineForm.fromKey--}},i.add=function(e){i.chatWebsite.onlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var n=t.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");t.show(n).then(function(){i.chatWebsite.onlineForm.fromKey===e&&(i.chatWebsite.onlineForm.fromKey=null),i.chatWebsite.onlineForm.items.splice(e,1),i.chatWebsite.onlineForm.items.length||(i.chatWebsite.onlineForm.fromKey=null)})},i.card_type="online",i.email_accounts=[]}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteonlineFormController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/customer_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitecustomerAvatarController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"chatWebsite",action:"getDispositions",field:"name",params:{id:m.chatWebsite.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.chatWebsiteInteractions=e||{count:0,rows:[]};for(var n=0;n<m.chatWebsiteInteractions.rows.length;n+=1){var t=m.chatWebsiteInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatInteraction.get(m.query,p).$promise}function v(e){d.chatInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteInteractions.rows,{id:e.id}),m.chatWebsiteInteractions.count-=1,m.chatWebsiteInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteInteractions={count:0,rows:[]},m.selectedChatWebsiteInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Customer Ip",column:"customerIp",type:"text",options:{excludedOperators:["$eq","$ne","$startsWith","$endsWith"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.chatInteractionDownload=function(s,e,n){return d.chatInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="chat-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getChatWebsiteInteractions=g,m.createOrEditChatWebsiteInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,interaction:n,interactions:m.chatWebsiteInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spychatInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"chat",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"chat.chatWebsites"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||ChatWebsiteId:=$eq["+m.chatWebsite.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedChatWebsiteInteractions=function(){var e=angular.copy(m.selectedChatWebsiteInteractions);return m.selectedChatWebsiteInteractions=[],e},m.deleteChatWebsiteInteraction=v,m.deleteSelectedChatWebsiteInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedChatWebsiteInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteInteractions.forEach(function(e){v(e)}),m.selectedChatWebsiteInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteInteractionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/logo".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitelogoController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteOfflineMessages=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getOfflineMessages(m.query,u).$promise}function g(e){d.chatOfflineMessage.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteOfflineMessages.rows,{id:e.id}),m.chatWebsiteOfflineMessages.count-=1,m.chatWebsiteOfflineMessages.rows.length||p(),l.success({title:"OfflineMessage deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteOfflineMessages={count:0,rows:[]},m.selectedChatWebsiteOfflineMessages=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,attachments,Contact.firstName,ContactId,ChatWebsiteId",sort:"-createdAt",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the offlineMessage?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("offlineMessage #")+e.id||"offlineMessage")+"</b> will be deleted.").ariaLabel("delete offlineMessage").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteOfflineMessages=p,m.createOrEditChatWebsiteOfflineMessage=function(e,n){o.show({controller:"CreateOrEditOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,offlineMessage:n,offlineMessages:m.chatWebsiteOfflineMessages.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.showOfflineMessageChatWebsiteOfflineMessage=function(e,t){o.show({controller:"ShowOfflineMessageOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{message:["apiResolver","$stateParams",function(e,n){return e.resolve("chatOfflineMessage@get",{fields:"id,body",id:t.id})}],attachments:["apiResolver","$stateParams",function(e,n){return e.resolve("attachment@get",{fields:"id,name",ChatOfflineMessageId:t.id})}]}})},m.exportSelectedChatWebsiteOfflineMessages=function(){var e=angular.copy(m.selectedChatWebsiteOfflineMessages);return m.selectedChatWebsiteOfflineMessages=[],e},m.deleteChatWebsiteOfflineMessage=g,m.deleteSelectedChatWebsiteOfflineMessages=function(e){var n=o.confirm().title("Are you sure want to delete the selected offlineMessages?").htmlContent("<b>"+m.selectedChatWebsiteOfflineMessages.length+" selected</b> will be deleted.").ariaLabel("delete offlineMessages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteOfflineMessages.forEach(function(e){g(e)}),m.selectedChatWebsiteOfflineMessages=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteOfflineMessagesController",e)}(),function(){"use strict";function e(n,e,t,a,i){var s=this;s.title="CHAT.OFFLINE_MESSAGE",s.message=a,s.attachments=i.rows,s.closeDialog=function(e){n.hide(e)},s.download=function(i){return e.attachment.download({id:i.id}).$promise.then(function(e){if(e){var n=new Blob([e.buffer],{type:e.type}),t=document.createElement("a"),a=window.URL.createObjectURL(n);t.href=a,t.target="_self",t.download=i.name,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.isHtml=_.isNil(s.message.body.match(/\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i))}e.$inject=["$mdDialog","api","toasty","message","attachments"],angular.module("app.chat").controller("ShowOfflineMessageOfflineMessageDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteProactiveActions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getProactiveActions(m.query,u).$promise}function g(e){d.chatProactiveAction.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteProactiveActions.rows,{id:e.id}),m.chatWebsiteProactiveActions.count-=1,m.chatWebsiteProactiveActions.rows.length||p(),l.success({title:"ChatProactiveAction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteProactiveActions={count:0,rows:[]},m.selectedChatWebsiteProactiveActions=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,name,type,selector,timeout",limit:10,page:1},m.arraytype=_.keyBy([{option:"MouseOver",value:"'mouseOver'"},{option:"Timeout",value:"'timeout'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the chatProactiveAction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("chatProactiveAction #")+e.id||"chatProactiveAction")+"</b> will be deleted.").ariaLabel("delete chatProactiveAction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteProactiveActions=p,m.createOrEditChatWebsiteChatProactiveAction=function(e,n){o.show({controller:"CreateOrEditChatProactiveActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,chatProactiveAction:n,proactive:m.chatWebsiteProactiveActions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedChatWebsiteProactiveActions=function(){var e=angular.copy(m.selectedChatWebsiteProactiveActions);return m.selectedChatWebsiteProactiveActions=[],e},m.deleteChatWebsiteChatProactiveAction=g,m.deleteSelectedChatWebsiteProactiveActions=function(e){var n=o.confirm().title("Are you sure want to delete the selected proactive?").htmlContent("<b>"+m.selectedChatWebsiteProactiveActions.length+" selected</b> will be deleted.").ariaLabel("delete proactive").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteProactiveActions.forEach(function(e){g(e)}),m.selectedChatWebsiteProactiveActions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteProactiveActionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATPROACTIVEACTION",g.chatProactiveAction=angular.copy(l),g.proactive=r,g.newChatProactiveAction=!1,g.chatProactiveAction||(g.chatProactiveAction={type:"mouseOver"},g.title="CHAT.NEW_CHATPROACTIVEACTION",g.newChatProactiveAction=!0),n.params.id&&(g.chatProactiveAction.ChatWebsiteId=n.params.id),g.addNewChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.save(g.chatProactiveAction).$promise.then(function(e){g.proactive.unshift(e.toJSON()),o.success({title:"ChatProactiveAction properly created",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.update({id:g.chatProactiveAction.id},g.chatProactiveAction).$promise.then(function(e){var n=_.find(g.proactive,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatProactiveAction properly saved!",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatProactiveAction=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatProactiveAction will be deleted.").ariaLabel("Delete ChatProactiveAction").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatProactiveAction.delete({id:g.chatProactiveAction.id}).$promise.then(function(){_.remove(g.proactive,{id:g.chatProactiveAction.id}),o.success({title:"ChatProactiveAction properly deleted!",msg:(g.chatProactiveAction.name||"chatProactiveAction")+" has been deleted!"}),v(g.chatProactiveAction)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","proactive","chatProactiveAction","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatProactiveActionDialogController",e)}(),function(){"use strict";function e(e){var n=this;n.chatWebsite={},n.init=function(e){n.chatWebsite=e,n.start="\n\x3c!-- START Motion Chat Script --\x3e",n.script='\n    <script src="'+n.chatWebsite.remote+"/api/chat/websites/"+n.chatWebsite.id+"/snippet?token="+n.chatWebsite.token+'"><\/script>',n.end="\n\x3c!-- START Motion Chat Script --\x3e"},n.info={},e.$watch("vm_ac.chatWebsite.remote",function(e){n.script='\n    <script src="'+n.chatWebsite.remote+"/api/chat/websites/"+n.chatWebsite.id+"/snippet?token="+n.chatWebsite.token+'"><\/script>'})}e.$inject=["$scope"],angular.module("app.chat").controller("ChatWebsiteScriptController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/system_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitesystemAvatarController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.chatWebsite=c||e.params.chatWebsite||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:p.chatWebsites?p.chatWebsites.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoChatWebsites=function(){e.go("app.chat.chatWebsites",{},{reload:"app.chat.chatWebsites"})},p.saveChatWebsite=function(){r.chatWebsite.update({id:p.chatWebsite.id},p.chatWebsite).$promise.then(function(){l.success({title:"ChatWebsite updated!",msg:p.chatWebsite.name?p.chatWebsite.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.chatWebsite&&(t=_.find(p.lists,{id:Number(p.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.chatWebsite&&(a=_.find(p.lists,{id:Number(p.chatWebsite.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){p.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){p.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.interval,{id:e.resourceId})}),t=null;if(p.chatWebsite&&(t=_.find(p.interval,{id:Number(p.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.interval,{id:t.id});a.canSelect=!1,n.push(a)}p.interval=n})}else{var t=[],a=null;p.chatWebsite&&(a=_.find(p.interval,{id:Number(p.chatWebsite.IntervalId)}));for(var i=0;i<p.interval.length;i++)a&&p.interval[i].id===a.id&&(p.interval[i].canSelect=!1,t.push(p.interval[i]));p.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatWebsite","userProfile","userProfileSection"],angular.module("app.chat").controller("ChatWebsiteController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"ChatQueues":void 0,channel:"chat",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("CHAT.CHATQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:n,chatQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:n,chatQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("chat_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userChatQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.ChatQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userChatQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.ChatQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"chat")})}),e.$on("$destroy",function(){r.removeAllListeners("chat_queue:save"),r.removeAllListeners("userChatQueue:remove"),r.removeAllListeners("userChatQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.chat").controller("QueuesChatRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.chat.realtime.agents":this.selectedTab=0;break;case"app.chat.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.chat.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.chat.realtime.agents");break;case 1:t.go("app.chat.realtime.queues");break;default:t.go("app.chat.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.chat").controller("ChatRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.companies=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="companies",f.listOrder="",f.listOrderAsc=null,f.selectedCompanies=[],f.query={fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){a.go("app.contactmanager.companies.edit",{id:e.id,company:e,crudPermissions:f.crudPermissions})},f.gotocontactsgoto=function(t,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{CompanyId:t.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:t.id})}},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("company")+"?").htmlContent("<b>"+(e.name||"company")+"</b> will be deleted.").ariaLabel("delete company").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCompanies=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmCompany.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Companies",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCompany=function(e,n){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{company:n,companies:f.companies.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCompany=y,f.exportSelectedCompanies=function(){var e=angular.copy(f.selectedCompanies);return f.selectedCompanies=[],e},f.deleteSelectedCompanies=function(e){var n=i.confirm().title("Are you sure want to delete the selected companies?").htmlContent("<b>"+f.selectedCompanies.length+" selected</b> will be deleted.").ariaLabel("delete Companys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCompanies.forEach(function(e){y(e)}),f.selectedCompanies=[]})},f.deselectCompanies=function(){f.selectedCompanies=[]},f.selectAllCompanies=function(){f.selectedCompanies=f.companies.rows};var b=!0,A=1;function E(e){f.companies=e||{count:0,rows:[]}}function y(e){m.cmCompany.delete({id:e.id}).$promise.then(function(){_.remove(f.companies.rows,{id:e.id}),f.companies.count-=1,f.companies.rows.length||f.getCompanies(),p.success({title:_.startCase("Company")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCompany"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCompany",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCompanies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","companies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("CompaniesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_COMPANY",g.company=angular.copy(l),g.companies=r,g.newCompany=!1,g.company||(g.company={},g.title="CONTACTMANAGER.NEW_COMPANY",g.newCompany=!0),g.addNewCompany=function(){g.errors=[],d.cmCompany.save(g.company).$promise.then(function(e){g.companies.unshift(e.toJSON()),o.success({title:"Company properly created",msg:g.company.name?g.company.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCompany=function(){g.errors=[],d.cmCompany.update({id:g.company.id},g.company).$promise.then(function(e){var n=_.find(g.companies,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Company properly saved!",msg:g.company.name?g.company.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCompany=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The company will be deleted.").ariaLabel("Delete Company").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmCompany.delete({id:g.company.id}).$promise.then(function(){_.remove(g.companies,{id:g.company.id}),o.success({title:"Company properly deleted!",msg:(g.company.name||"company")+" has been deleted!"}),v(g.company)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","companies","company","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCompanyDialogController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.company=c||a.params.company||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(t,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{CompanyId:t.id}):l.info({title:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:t.id})}},u.alert=l.info,u.gotoCompanies=function(){a.go("app.contactmanager.companies",{},{reload:"app.contactmanager.companies"})},u.saveCompany=function(){r.cmCompany.update({id:u.company.id},u.company).$promise.then(function(){l.success({title:"Company updated!",msg:u.company.name?u.company.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmCompany",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","company","userProfileSection"],angular.module("app.contactmanager").controller("CompanyController",e)}(),function(){"use strict";function e(n,i,t,a,e,s,o,r,l,d,c,m,u,p,g,v,h,f,b){var A=this;A.currentUser=f.getCurrentUser(),A.license=b,A.userProfile=r,A.userProfileSection=l&&1==l.count?l.rows[0]:null,A.crudPermissions=f.parseCrudPermissions(A.userProfileSection?A.userProfileSection.crudPermissions:null);var E=60,y=1024*E*1024;A.ngFlowOptions={target:"api/cm/contacts/upload",singleFile:!0,maxChunkRetries:1,chunkSize:y,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},A.contacts=c||{count:0,rows:[]},A.options={hidden:!1,hover:!1,isOpen:!1},A.table="cm_contacts",A.selectedContacts=[],A.lists=m||{rows:[],count:0},A.companies=p||{rows:[],count:0},A.tags=v||{rows:[],count:0},A.listsMap=u,A.companiesMap=g,A.selectedTags=[],A.selectedList=null,A.selectedCompany=null,A.query=_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0,page:1},e),A.editdialog=function(e,n){a.go("app.contactmanager.contacts.edit",{id:e.id,crudPermissions:A.crudPermissions})},A.deleteconfirm=function(e,n){var t=s.confirm().title("Are you sure want to delete the contact?").htmlContent("<b>"+(e.firstName||e.email||e.phone||"Contact")+"</b> will be deleted.").ariaLabel("delete contact").targetEvent(n).ok("OK").cancel("CANCEL");s.show(t).then(function(){O(e)})},A.success=I,A.getContacts=function(){A.query.offset=(A.query.page-1)*A.query.limit,f.hasRole("admin")?A.promise=d.cmContact.get(A.query,I).$promise:(A.query.id=A.userProfile.id,A.query.ListId=A.query.ListId?A.query.ListId:_.map(A.lists.rows,"id"),A.query.CompanyId=A.query.CompanyId?A.query.CompanyId:_(A.companies.rows).filter({canSelect:void 0}).map("id").value(),A.query.section="Contacts",A.promise=d.userProfile.getResources(A.query,I).$promise)},A.getAssignedCompanies=function(){if(!f.hasRole("admin")){var e=_(A.contacts.rows).map(function(e){return{id:e.CompanyId}}).uniqBy("id").filter(function(e){return e.id&&0<e.id}).pullAllBy(A.companies.rows,"id").value();if(!_.isEmpty(e)){var n=[];e.forEach(function(e){n.push(d.cmCompany.get({id:e.id,fields:"id,name"}).$promise)}),o.all(n).then(function(e){e.forEach(function(e){var n=e.toJSON();n.canSelect=!1,A.companies.rows.push(n);var t={};t[n.id]=n.name,A.companiesMap=_.assignIn(A.companiesMap,t)})}).catch(function(e){h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}},A.mergeContact=function(e,n){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:A.contacts.rows}})},A.duplicateContact=function(e,n){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:A.contacts.rows}})},A.createOrEditContact=function(e,n){n&&n.dateOfBirth&&(n.dateOfBirth=new Date(n.dateOfBirth));s.show({controller:"CreateOrEditContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ListId:A.query.ListId||a.params.ListId,CompanyId:A.query.CompanyId||a.params.CompanyId,contact:n,contacts:A.contacts.rows,companies:A.companies,lists:A.lists,setting:null,crudPermissions:A.crudPermissions}})},A.deleteContact=O,A.exportSelectedContacts=function(){var e=angular.copy(A.selectedContacts);return A.selectedContacts=[],e},A.deleteSelectedContacts=function(e){var n=s.confirm().title("Are you sure want to delete the selected contacts?").htmlContent("<b>"+A.selectedContacts.length+" selected</b> will be deleted.").ariaLabel("delete Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(n).then(function(){A.selectedContacts.forEach(function(e){O(e)}),A.selectedContacts=[]})},A.deselectContacts=function(){A.selectedContacts=[]},A.selectAllContacts=function(){A.selectedContacts=A.contacts.rows},A.createTag=function(e){var n=s.prompt().title("What would you name your tag?").placeholder("Tag name").ariaLabel("Tag name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.tag.save({name:e});h.error({title:"Error creating tag!",msg:"Invalid tag name."})}).then(function(e){e&&(A.tags.rows.push(e),h.success({title:"Tag properly created!",msg:e.tag?e.name+" has been created!":""}))})},A.createList=function(e){var n=s.prompt().title("What would you name your list?").placeholder("List name").ariaLabel("List name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.cmList.save({name:e});h.error({title:"Error creating list!",msg:"Invalid list name."})}).then(function(e){e&&(A.lists.rows.push(e),h.success({title:"List properly created!",msg:e.name?e.name+" has been created!":""}))})},A.createCompany=function(e){var n=s.prompt().title("What would you name your company?").placeholder("Company name").ariaLabel("Company name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.cmCompany.save({name:e});h.error({title:"Error creating company!",msg:"Invalid company name."})}).then(function(e){e&&(A.companies.rows.push(e),h.success({title:"Company properly created!",msg:e.name?e.name+" has been created!":""}))})},A.importContacts=function(e,n,t){var a=JSON.parse(n);s.show({controller:"ImportContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/import.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:m,companies:p,file:a.file,fields:a.fields,license:A.license}}).then(function(){A.getContacts()}).catch(function(e){console.error()})},A.hasPermission=function(){return f.hasPermission(303)||f.hasRole("admin")},A.fileAdded=function(e){var n=["csv"];if(!_.includes(n,e.getExtension()))return h.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>y)return h.error({title:"File too big",msg:"The max allowed size is "+E+"MB"}),!1;return!0},a.params.ListId&&(A.selectedList=a.params.ListId),a.params.CompanyId&&(A.selectedCompany=a.params.CompanyId),n.$watch("vm.options.isOpen",function(e){e?t(function(){n.tooltipVisible=A.options.isOpen},600):n.tooltipVisible=A.options.isOpen});var S=!0,T=1;function I(e){A.contacts=e||{count:0,rows:[]}}function O(e){d.cmContact.delete({id:e.id}).$promise.then(function(){_.remove(A.contacts.rows,{id:e.id}),A.contacts.count-=1,A.contacts.rows.length||A.getContacts(),h.success({title:"Contact deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){A.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}];for(var n=0;n<e.data.errors.length;n++)h.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}n.$watch("vm.query.filter",function(e,n){S?t(function(){S=!1}):(n||(T=A.query.page),e!==n&&(A.query.page=1),e||(A.query.page=T),A.getContacts())},!0),n.$watch("vm.selectedList",function(e,n){e!==n&&(A.query.ListId=A.selectedList||void 0,A.getContacts())}),n.$watch("vm.selectedCompany",function(e,n){e!==n&&(A.query.CompanyId=A.selectedCompany||void 0,A.getContacts())}),n.$watch("vm.selectedTags",function(e,n){(e.length||n.length)&&A.getContacts()})}e.$inject=["$scope","$document","$timeout","$state","$stateParams","$mdDialog","$q","userProfile","userProfileSection","api","contacts","lists","listsMap","companies","companiesMap","tags","toasty","Auth","license"],angular.module("app.contactmanager").controller("ContactsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o,r,l,d){var c=this;function m(e){if(e)return l.cmList.getCustomFields({id:e}).$promise.then(function(e){if(e){c.customFields=e;var n=_.map(c.customFields.rows,function(e){return"cf_"+e.id});return l.cmContact.get({id:c.contact.id,attributes:n,raw:!0}).$promise.then(function(e){c.contact=_.merge(c.contact,e)})}}).then(function(){c.customFields.rows.forEach(function(e){"datetime"===e.type&&c.contact["cf_"+e.id]&&(c.contact["cf_"+e.id]=u(c.contact["cf_"+e.id]))}),Object.keys(c.contact).forEach(function(e){if(_.startsWith(e,"cf_")){var n=e.split("_")[1];_.some(c.customFields.rows,["id",Number(n)])||delete c.contact["cf_"+n]}})}).catch(function(e){console.error(e)});c.customFields={rows:[],count:0}}function u(e){return null===e?void 0:new Date(e)}function p(){t.hide()}c.errors=[],c.title="CONTACTMANAGER.EDIT_CONTACT",c.crudPermissions=d,c.contact=angular.copy(s),c.contacts=e||{rows:[],count:0},c.lists=n||{rows:[],count:0},c.companies=i||{rows:[],count:0},c.customFields={rows:[],count:0},c.newContact=!1,c.contact?(delete c.contact.List,m(c.contact.ListId)):(c.contact={ListId:o?parseInt(o,10):void 0,CompanyId:r?parseInt(r,10):void 0},c.title="CONTACTMANAGER.NEW_CONTACT",c.newContact=!0),c.addNewContact=function(){c.errors=[],l.cmContact.save(c.contact).$promise.then(function(e){c.contacts.unshift(e),a.success({title:"Contact properly created",msg:c.contact.name?c.contact.name+" has been created!":""}),p()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contacts.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveContact=function(){c.errors=[],l.cmContact.update({id:c.contact.id},c.contact).$promise.then(function(e){var n=_.find(c.contacts,{id:e.id});n&&_.merge(n,e),a.success({title:"Contact properly saved!",msg:c.contact.name?c.contact.name+" has been saved!":""}),p()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.contact.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteContact=function(e){c.errors=[];var n=t.confirm().title("Are you sure?").content("The contact will be deleted.").ariaLabel("Delete Contact").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){l.cmContact.delete({id:c.contact.id}).$promise.then(function(){_.remove(c.contacts,{id:c.contact.id}),a.success({title:"Contact properly deleted!",msg:c.contact.name?c.contact.name+" has been deleted!":""}),p()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},c.closeDialog=p,c.getCustomFields=m,c.getDateFromString=u}e.$inject=["$mdDialog","toasty","contacts","lists","companies","contact","ListId","CompanyId","api","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.title="CONTACTMANAGER.COPY_CONTACT",o.contact=angular.copy(t),o.lists=i||{rows:[],count:0},o.addNewContact=function(){o.errors=[],delete o.contact.id,o.contact.tags&&!o.contact.tags.length&&delete o.contact.tags;s.cmContact.save(o.contact).$promise.then(function(e){a.unshift(e),n.success({title:"Contact properly created",msg:o.contact.name?o.contact.name+" has been created!":""}),r()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("DuplicateContactDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="CONTACTMANAGER.EDIT_HOPPER",d.hopper=angular.copy(o),d.hoppers=s,d.newHopper=!1,d.crudPermissions=l,d.hopper||(d.hopper={},d.title="CONTACTMANAGER.NEW_HOPPER",d.newHopper=!0),d.saveHopper=function(){d.errors=[],r.cmHopper.update({id:d.hopper.id},d.hopper).$promise.then(function(e){var n=_.find(d.hoppers,{id:e.id});n&&_.merge(n,e),i.success({title:"Hopper properly saved!",msg:d.hopper.name?d.hopper.name+" has been saved!":""}),c(e)}).catch(function(e){console.error(e),d.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}]})},d.getDateFromString=function(e){return null===e?void 0:new Date(e)},d.closeDialog=c}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","crudPermissions"],angular.module("app.contactmanager.contacts").controller("EditHopperDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y){var S=this;function T(n){return function(e){S[n]=e||{count:0,rows:[]}}}function I(){S.queryHopper.offset=(S.queryHopper.page-1)*S.queryHopper.limit,S.queryHopper.id=S.contact.id,S.promise=r.cmContact.getHoppers(S.queryHopper,T("hoppers")).$promise}function O(){S.queryFinal.offset=(S.queryFinal.page-1)*S.queryFinal.limit,S.queryFinal.id=S.contact.id,S.promise=r.cmContact.getHopperFinals(S.queryFinal,T("finals")).$promise}function C(){S.queryHistory.offset=(S.queryHistory.page-1)*S.queryHistory.limit,S.queryHistory.id=S.contact.id,S.promise=r.cmContact.getHopperHistories(S.queryHistory,T("histories")).$promise}function w(e){S.journeyIsLoading=!0;var n=_.merge(S.journeyOptions,{id:S.contact.id,offset:e||0});return y.get(S.journey,n).then(function(e){S.journey=e.journey,S.canLoadMoreJourney=e.loadMore}).finally(function(){S.journeyIsLoading=!1})}S.currentUser=A.getCurrentUser(),S.license=b,S.journey=[],S.contact=l||{},S.hoppers=d||{rows:[],count:0},S.finals=c||{rows:[],count:0},S.histories=m||{rows:[],count:0},S.companies=p||{rows:[],count:0},S.lists=g||{rows:[],count:0},S.customFields=v||{rows:[],count:0},S.tags=h||{rows:[],count:0},S.jscriptySessions=f||{rows:[],count:0},S.journeyOptions=y.getQuery(),S.quickFilters=y.getQuickFilters(),S.journeyTimelineOptions={scrollEl:"#journey-content"},S.userProfileSection=E&&1==E.count?E.rows[0]:null,S.crudPermissions=A.parseCrudPermissions(S.userProfileSection?S.userProfileSection.crudPermissions:null),S.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),S.queryHopper={fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,page:1},S.queryFinal={fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-id",limit:10,page:1},S.queryHistory={fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-id",limit:10,page:1},S.queryJscriptySession={fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,page:1},S.selectedTab=n.params.tab||0,S.onInit=function(){A.hasRole("admin")||(function(){if(!_.some(S.companies.rows,{id:S.contact.CompanyId}))r.cmCompany.get({id:S.contact.CompanyId,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,S.companies.rows.push(n)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}(),function(){var e=_.map(S.contact.Tags,function(e){return{id:e.id,name:e.name}});if(!_.isEmpty(e))for(var n=0;n<e.length;n++)_.some(S.tags.rows,{id:e.id})||(e[n].canSelect=!1,S.tags.rows.push(e[n]))}());return r.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){S.users=e||{count:0,rows:[]},S.usersMap=_.mapValues(_.keyBy(S.users.rows,"id"),"fullname"),S.Tags=_.map(S.contact.Tags,"id")}).finally(function(){S.contact&&w()})},S.gotoContacts=function(){n.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},S.duplicateContact=function(e){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,resolve:{lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name"}):e.resolve("userProfile@getResources",{id:S.currentUser.userProfileId,section:"Lists",fields:"id,name"})}]},locals:{contacts:u.rows,contact:l}})},S.saveContact=function(){r.cmContact.update({id:S.contact.id},S.contact).$promise.then(function(){o.success({title:"Contact updated!",msg:S.contact.name?S.contact.name+" has been updated!":""})}).then(function(){return r.cmContact.setTags({id:S.contact.id,ids:S.Tags}).$promise}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEcontact",msg:e.data?JSON.stringify(e.data):e.toString()})})},S.editCompany=function(e,n){var t=_.find(S.companies.rows,{id:n});i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{companies:[],license:null,setting:null,crudPermissions:!1===t.canSelect?{readOnly:!0,canEdit:!1,canDelete:!1}:r.userProfileSection.get({userProfileId:S.currentUser.userProfileId,sectionId:302}).$promise.then(function(e){var n=e.rows?e.rows[0]:null;return A.parseCrudPermissions(n?n.crudPermissions:null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:GET_COMPANY_SECTION",msg:e.data?JSON.stringify(e.data):e.toString()})})},resolve:{company:["apiResolver",function(e){return e.resolve("cmCompany@get",{id:n})}]}})},S.onSelectList=function(e){if(S.contact.ListId){var n=i.confirm().title("You are selecting the list number: "+S.contact.ListId).textContent("Warning! You won't select a different list for the contact "+S.contact.firstName||S.contact.lastName||S.contact.id).targetEvent(e).ok("Ok").cancel("Cancel");return i.show(n).then(S.onSelectListSuccess).catch(function(){S.contact.ListId=null})}},S.onSelectListSuccess=function(){return r.cmList.getCustomFields({id:S.contact.ListId}).$promise.then(function(e){S.customFields=e||{rows:[],count:0}}).catch(function(e){console.error(e)})},S.getDateFromString=function(e){return null===e?void 0:new Date(e)},S.getHoppers=I,S.getFinals=O,S.getHistories=C,S.getJscriptySessions=function(){S.queryJscriptySession.offset=(S.queryJscriptySession.page-1)*S.queryJscriptySession.limit,S.queryJscriptySession.id=S.contact.id,S.promise=r.cmContact.getJscriptySessions(S.queryJscriptySession,T("jscriptySessions")).$promise},S.deleteconfirm=function(n,e){var t=i.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(n.phone||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){var e;e=n,r.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(S.hoppers.rows,{id:e.id}),S.hoppers.count--,S.hoppers.rows.length||S.getHoppers(),o.success({title:"Hopper deleted!",msg:e.phone?e.phone+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEhopper",msg:e.data?JSON.stringify(e.data):e.toString()})})},function(){console.log("CANCEL")})},S.editHopper=function(e,n){i.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.createOrEditIvrCampaignHopper=function(e,n){i.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.getCustomerJourney=w,S.loadMoreJourney=function(){return s(function(e,n){var t=S.journey.length;return e(w(t))})};var R=!0,x=1;e.$watch("vm.queryHopper.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryHopper.page),e!==n&&(S.queryHopper.page=1),e||(S.queryHopper.page=x),I())}),e.$watch("vm.queryFinal.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryFinal.page),e!==n&&(S.queryFinal.page=1),e||(S.queryFinal.page=x),O())}),e.$watch("vm.queryHistory.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryHistory.page),e!==n&&(S.queryHistory.page=1),e||(S.queryHistory.page=x),C())})}e.$inject=["$scope","$timeout","$state","$document","$mdDialog","$q","toasty","api","contact","hoppers","finals","histories","contacts","companies","lists","customFields","tags","jscriptySessions","license","Auth","userProfileSection","customerJourneyManager"],angular.module("app.contactmanager.contacts").controller("ContactController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1},{key:"dialTimezone",required:!1}],g.binding={},g.duplicate=[],g.lists=s||{rows:[],count:0},g.companies=o||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),n.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.import({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],n=0;n<g.result.errors.length;n+=1){var t=g.result.errors[n].row;t.contact_import_error=g.result.errors[n].message,e.push(t)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(t){i(function(){if(g.result.rows=t.rows,t.errors)for(var e=0;e<t.errors.length;e++)g.result.errors.push(t.errors[e]);if(t.finish){g.result.finish=!0,g.result.affectedRows=t.affectedRows,g.result.failedRows=g.result.errors.length;var n=g.result.rows-g.result.affectedRows-g.result.errors.length;n&&0<n&&(g.duplicates.length?g.result.duplicatedRows=n:g.result.failedRows+=n),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsDialogController",e)}(),function(){"use strict";function e(i,e,s,n,o,t,r){var a=this;a.errors=[],a.title="CONTACTMANAGER.MERGE_CONTACT",a.contact=angular.copy(n),a.lists=t||[],a.change=function(){a.searchTerm?r.cmContact.get({fields:"id,firstName,lastName,phone,email",filter:a.searchTerm,ListId:n.ListId}).$promise.then(function(e){a.contacts=e.rows}).catch(function(e){console.error(e)}):a.contacts=[]},a.showConfirm=function(e,n,t){var a=i.confirm({skipHide:!0}).title("Would you like to merge your contacs?").textContent("All unfilled values of the contact #"+t.id+" will be overwritten by the fields of the contact #"+n.id+".").targetEvent(e).ok("Ok").cancel("Cancel");i.show(a).then(function(){return r.cmContact.merge({to:t.id,from:n.id}).$promise}).then(function(e){i.hide({new:e,to:t,from:n}),_.remove(o,{id:t.id}),_.remove(o,{id:n.id}),o.unshift(e)}).then(function(){s.success({title:"Contact properly merged!"})}).catch(function(e){e&&e.status&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:MERGE_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.closeDialog=function(){i.hide()}}e.$inject=["$mdDialog","$scope","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("MergeContactDialogController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){t.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.globalCustomFieldForm.$pristine=!1}},g.globalCustomField=l,g.globalCustomFields=r,g.newGlobalCustomField=!1,g.globalCustomField||(g.globalCustomField={type:"text",actionType:"voice"},g.title="CONTACTMANAGER.NEW_GLOBALCUSTOMFIELD",g.newGlobalCustomField=!0),a.$watch("vm.globalCustomField.type",function(e,n){if(e!==n)switch(e){case"text":g.globalCustomField.values="";break;case"select":g.globalCustomField.values=[]}}),g.addNewGlobalCustomField=function(){g.errors=[],d.cmCustomField.save(g.globalCustomField).$promise.then(function(e){g.globalCustomFields.unshift(e.toJSON()),o.success({title:"GlobalCustomField properly created",msg:g.globalCustomField.name?g.globalCustomField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGlobalCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.globalCustomField.id},g.globalCustomField).$promise.then(function(e){var n=_.find(g.globalCustomFields,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"GlobalCustomField properly saved!",msg:g.globalCustomField.name?g.globalCustomField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGlobalCustomField=function(e){g.errors=[];var n=t.confirm().title("Are you sure?").content("The globalCustomField will be deleted.").ariaLabel("Delete GlobalCustomField").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmCustomField.delete({id:g.globalCustomField.id}).$promise.then(function(){_.remove(g.globalCustomFields,{id:g.globalCustomField.id}),o.success({title:"GlobalCustomField properly deleted!",msg:(g.globalCustomField.name||"globalCustomField")+" has been deleted!"}),v(g.globalCustomField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.globalCustomFieldForm.$pristine=!1},g.removeItem=function(e,n){e.splice(n,1),a.globalCustomFieldForm.$pristine=!1},g.removeItems=function(e){for(var n=e.length,t=0;t<n;t++)e.splice(0,1);a.globalCustomFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","globalCustomFields","globalCustomField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditGlobalCustomFieldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.globalCustomFields=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="globalCustomFields",f.listOrder="",f.listOrderAsc=null,f.selectedGlobalCustomFields=[],f.query={fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",sort:"-updatedAt",ListId:"null",limit:10,page:1},f.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayactionType=_.keyBy([{option:"Voice",value:"'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{globalCustomField:e,globalCustomFields:f.globalCustomFields.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("globalCustomField")+"?").htmlContent("<b>"+(e.name||"globalCustomField")+"</b> will be deleted.").ariaLabel("delete globalCustomField").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getGlobalCustomFields=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmCustomField.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="GlobalCustomFields",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditGlobalCustomField=function(e,n){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{globalCustomField:n,globalCustomFields:f.globalCustomFields.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteGlobalCustomField=y,f.exportSelectedGlobalCustomFields=function(){var e=angular.copy(f.selectedGlobalCustomFields);return f.selectedGlobalCustomFields=[],e},f.deleteSelectedGlobalCustomFields=function(e){var n=i.confirm().title("Are you sure want to delete the selected globalCustomFields?").htmlContent("<b>"+f.selectedGlobalCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete GlobalCustomFields").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedGlobalCustomFields.forEach(function(e){y(e)}),f.selectedGlobalCustomFields=[]})},f.deselectGlobalCustomFields=function(){f.selectedGlobalCustomFields=[]},f.selectAllGlobalCustomFields=function(){f.selectedGlobalCustomFields=f.globalCustomFields.rows};var b=!0,A=1;function E(e){f.globalCustomFields=e||{count:0,rows:[]}}function y(e){m.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(f.globalCustomFields.rows,{id:e.id}),f.globalCustomFields.count-=1,f.globalCustomFields.rows.length||f.getGlobalCustomFields(),p.success({title:_.startCase("GlobalCustomField")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCustomField"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCustomField",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getGlobalCustomFields())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","globalCustomFields","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("GlobalCustomFieldsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_LIST",g.list=angular.copy(l),g.lists=r,g.newList=!1,g.list||(g.list={},g.title="CONTACTMANAGER.NEW_LIST",g.newList=!0),g.addNewList=function(){g.errors=[],d.cmList.save(g.list).$promise.then(function(e){g.lists.unshift(e.toJSON()),o.success({title:"List properly created",msg:g.list.name?g.list.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveList=function(){g.errors=[],d.cmList.update({id:g.list.id},g.list).$promise.then(function(e){var n=_.find(g.lists,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"List properly saved!",msg:g.list.name?g.list.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteList=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The list will be deleted.").ariaLabel("Delete List").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmList.delete({id:g.list.id}).$promise.then(function(){_.remove(g.lists,{id:g.list.id}),o.success({title:"List properly deleted!",msg:(g.list.name||"list")+" has been deleted!"}),v(g.list)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","lists","list","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditListDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.cmList.getAgents({id:c.list.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserList?"penalty "+e.UserList.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.list=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.cmList.removeAgents({id:c.list.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.cmList.addAgents({id:c.list.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CONTACTMANAGER.ALL_AGENTS"),labelSelected:r.instant("CONTACTMANAGER.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","list","lists","realtime","$translate","Auth","crudPermissions"],angular.module("app.contactmanager").controller("ListagentaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.listCustomFields=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.cmList.getCustomFields(m.query,u).$promise}function g(e){d.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(m.listCustomFields.rows,{id:e.id}),m.listCustomFields.count-=1,m.listCustomFields.rows.length||p(),l.success({title:"CustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.list={},m.listCustomFields={count:0,rows:[]},m.selectedListCustomFields=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",limit:10,page:1},m.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.arrayactionType=_.keyBy([{option:"Voice",value:"'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.list=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ListId=m.list.id,m.query.id=m.list.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the customField?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("customField #")+e.id||"customField")+"</b> will be deleted.").ariaLabel("delete customField").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getListCustomFields=p,m.createOrEditListCustomField=function(e,n){o.show({controller:"CreateOrEditCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:m.list,customField:n,customFields:m.listCustomFields.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedListCustomFields=function(){var e=angular.copy(m.selectedListCustomFields);return m.selectedListCustomFields=[],e},m.deleteListCustomField=g,m.deleteSelectedListCustomFields=function(e){var n=o.confirm().title("Are you sure want to delete the selected customFields?").htmlContent("<b>"+m.selectedListCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete customFields").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedListCustomFields.forEach(function(e){g(e)}),m.selectedListCustomFields=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListCustomFieldsController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){t.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_CUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.customFieldForm.$pristine=!1}},g.customField=l,g.customFields=r,g.newCustomField=!1,g.customField||(g.customField={type:"text",actionType:"voice"},g.title="CONTACTMANAGER.NEW_CUSTOMFIELD",g.newCustomField=!0),e.params.id&&(g.customField.ListId=e.params.id),a.$watch("vm.customField.type",function(e,n){if(e!==n)switch(e){case"text":g.customField.values="";break;case"select":g.customField.values=[]}}),g.addNewCustomField=function(){g.errors=[],d.cmList.addCustomField({id:e.params.id},g.customField).$promise.then(function(e){g.customFields.unshift(e.toJSON()),o.success({title:"CustomField properly created",msg:g.customField.name?g.customField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.customField.id},g.customField).$promise.then(function(e){var n=_.find(g.customFields,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CustomField properly saved!",msg:g.customField.name?g.customField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomField=function(e){g.errors=[];var n=t.confirm().title("Are you sure?").content("The customField will be deleted.").ariaLabel("Delete CustomField").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmCustomField.delete({id:g.customField.id}).$promise.then(function(){_.remove(g.customFields,{id:g.customField.id}),o.success({title:"CustomField properly deleted!",msg:(g.customField.name||"customField")+" has been deleted!"}),v(g.customField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.customFieldForm.$pristine=!1},g.removeItem=function(e,n){e.splice(n,1),a.customFieldForm.$pristine=!1},g.removeItems=function(e){for(var n=e.length,t=0;t<n;t++)e.splice(0,1);a.customFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customFields","customField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCustomFieldDialogController",e)}(),function(){"use strict";function e(a,e,t,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.list=c||a.params.list||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(t,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{ListId:t.id}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:t.id})}},u.agentadddialog=function(e,n){t.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{list:e,lists:u.lists?u.lists.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoLists=function(){a.go("app.contactmanager.lists",{},{reload:"app.contactmanager.lists"})},u.saveList=function(){r.cmList.update({id:u.list.id},u.list).$promise.then(function(){l.success({title:"List updated!",msg:u.list.name?u.list.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","list","userProfileSection"],angular.module("app.contactmanager").controller("ListController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.cmList.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.list=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ListId=m.list.id,m.query.id=m.list.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.list.id,field:"ListId",route:"cmList"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.contactmanager").controller("ListDispositionsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.lists=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="lists",f.listOrder="",f.listOrderAsc=null,f.selectedLists=[],f.query={fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){a.go("app.contactmanager.lists.edit",{id:e.id,list:e,crudPermissions:f.crudPermissions})},f.gotocontactsgoto=function(t,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{ListId:t.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:t.id})}},f.exportcsvcontactsexport=function(i,e){return m.cmList.getContactsCsv({id:i.id,nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","exportContacts_"+i.id+".csv"),a.click()}else p.info({title:"EXPORT",msg:"The list is empty"})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.agentadddialog=function(e,n){i.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{list:e,lists:f.lists?f.lists.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("list")+"?").htmlContent("<b>"+(e.name||"list")+"</b> will be deleted.").ariaLabel("delete list").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getLists=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmList.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Lists",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditList=function(e,n){i.show({controller:"CreateOrEditListDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:n,lists:f.lists.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteList=y,f.exportSelectedLists=function(){var e=angular.copy(f.selectedLists);return f.selectedLists=[],e},f.deleteSelectedLists=function(e){var n=i.confirm().title("Are you sure want to delete the selected lists?").htmlContent("<b>"+f.selectedLists.length+" selected</b> will be deleted.").ariaLabel("delete Lists").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedLists.forEach(function(e){y(e)}),f.selectedLists=[]})},f.deselectLists=function(){f.selectedLists=[]},f.selectAllLists=function(){f.selectedLists=f.lists.rows};var b=!0,A=1;function E(e){f.lists=e||{count:0,rows:[]}}function y(e){m.cmList.delete({id:e.id}).$promise.then(function(){_.remove(f.lists.rows,{id:e.id}),f.lists.count-=1,f.lists.rows.length||f.getLists(),p.success({title:_.startCase("List")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmList"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getLists())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","lists","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("ListsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;function b(){return a.smsAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.smsAccounts=e,a.smsInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].SmsAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.smsAccounts.rows,{id:e.rows[t].SmsAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.smsAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.smsAccounts=n})})}function A(){return a.faxAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.faxAccounts=e,a.faxInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].FaxAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.faxAccounts.rows,{id:e.rows[t].FaxAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.faxAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.faxAccounts=n})})}function E(){return a.openchannelAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.openchannelAccounts=e,a.openchannelInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].OpenchannelAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.openchannelAccounts.rows,{id:e.rows[t].OpenchannelAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.openchannelAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.openchannelAccounts=n})})}function y(){return a.whatsappAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.whatsappAccounts=e,a.whatsappInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].WhatsappAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.whatsappAccounts.rows,{id:e.rows[t].WhatsappAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.whatsappAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.whatsappAccounts=n})})}function S(){return a.chatWebsite.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.chatWebsites=e,a.chatInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].ChatWebsiteId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.abandoned+=e.rows[t].abandoned,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.chatWebsites.rows,{id:e.rows[t].ChatWebsiteId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","abandoned","unmanaged"]));return f.chatWebsites}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.chatWebsites=n})})}function T(){return a.mailAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.mailAccounts=e,a.mailInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].MailAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.mailAccounts.rows,{id:e.rows[t].MailAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.mailAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.mailAccounts=n})})}function I(){for(var e=0;e<f.customDashboard.widgets.length;e+=1)f.customDashboard.widgets[e].voiceQueuesSelected=f.voiceQueuesSelected,f.customDashboard.widgets[e].chatWebsitesSelected=f.chatWebsitesSelected,f.customDashboard.widgets[e].smsAccountsSelected=f.smsAccountsSelected,f.customDashboard.widgets[e].faxAccountsSelected=f.faxAccountsSelected,f.customDashboard.widgets[e].mailAccountsSelected=f.mailAccountsSelected,f.customDashboard.widgets[e].openchannelAccountsSelected=f.openchannelAccountsSelected,f.customDashboard.widgets[e].whatsappAccountsSelected=f.whatsappAccountsSelected}f.currentUser=s.getCurrentUser(),f.userProfile=v,f.userProfileSection=h&&1===h.count?h.rows[0]:null,f.crudPermissions=s.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.customDashboard={},f.voiceQueues=l&&l.count?l:{count:0,rows:[]},f.voiceQueuesSelected=l&&l.count?_.map(l.rows,"id"):[],f.faxAccounts=d&&d.count?d:{count:0,rows:[]},f.faxAccountsSelected=d&&d.count?_.map(d.rows,"id"):[],f.chatWebsites=c&&c.count?c:{count:0,rows:[]},f.chatWebsitesSelected=c&&c.count?_.map(c.rows,"id"):[],f.smsAccounts=m&&m.count?m:{count:0,rows:[]},f.smsAccountsSelected=m&&m.count?_.map(m.rows,"id"):[],f.mailAccounts=u&&u.count?u:{count:0,rows:[]},f.mailAccountsSelected=u&&u.count?_.map(u.rows,"id"):[],f.openchannelAccounts=p&&p.count?p:{count:0,rows:[]},f.openchannelAccountsSelected=p&&p.count?_.map(p.rows,"id"):[],f.whatsappAccounts=g&&g.count?g:{count:0,rows:[]},f.whatsappAccountsSelected=g&&g.count?_.map(g.rows,"id"):[],f.interval=n(function(){},1e3),f.goToEdit=function(){e.go("app.tools.customDashboards.edit",{customDashboard:f.customDashboard,id:f.customDashboard.id,tab:1})},f.setFilter=function(e){o.show({controller:"FilterDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/custom/filter/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{vm_parent:f}}).then(function(e){f=e,I()})},f.updateWidget=I,i.onWithoutApply("voice_queue:save",function(e){var n=_.find(f.voiceQueues.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.onWithoutApply("sms_account:save",function(e){var n=_.find(f.smsAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("smsInteraction:update",b),i.on("smsInteraction:save",b),i.onWithoutApply("fax_account:save",function(e){var n=_.find(f.faxAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("faxInteraction:update",A),i.on("faxInteraction:save",A),i.onWithoutApply("mail_account:save",function(e){var n=_.find(f.mailAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("mailInteraction:update",T),i.on("mailInteraction:save",T),i.onWithoutApply("openchannel_account:save",function(e){var n=_.find(f.openchannelAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("openchannelInteraction:update",E),i.on("openchannelInteraction:save",E),i.onWithoutApply("whatsapp_account:save",function(e){var n=_.find(f.whatsappAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("whatsappInteraction:update",y),i.on("whatsappInteraction:save",y),i.onWithoutApply("chat_website:save",function(e){var n=_.find(f.chatWebsites.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("chatInteraction:update",S),i.on("chatInteraction:save",S),a.dashboard.get({id:e.params.id}).$promise.then(function(e){if(e)return f.customDashboard=e,f.customDashboard.widgets=[],f.customDashboard.preview=!0,f.customDashboard.draggable={enabled:!1},f.customDashboard.resizable={enabled:!1},a.dashboard.getItems({id:f.customDashboard.id}).$promise}).then(function(e){if(e&&e.count&&e.rows)for(var n=0;n<e.rows.length;n+=1)e.rows[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[n].type+"/ms-widget-engine."+e.rows[n].type+".html",e.rows[n].voiceQueues=f.voiceQueues,e.rows[n].voiceQueuesSelected=f.voiceQueuesSelected,e.rows[n].faxAccounts=f.faxAccounts,e.rows[n].faxAccountsSelected=f.faxAccountsSelected,e.rows[n].mailAccounts=f.mailAccounts,e.rows[n].mailAccountsSelected=f.mailAccountsSelected,e.rows[n].smsAccounts=f.smsAccounts,e.rows[n].smsAccountsSelected=f.smsAccountsSelected,e.rows[n].chatWebsites=f.chatWebsites,e.rows[n].chatWebsitesSelected=f.chatWebsitesSelected,e.rows[n].openchannelAccounts=f.openchannelAccounts,e.rows[n].openchannelAccountsSelected=f.openchannelAccountsSelected,e.rows[n].whatsappAccounts=f.whatsappAccounts,e.rows[n].whatsappAccountsSelected=f.whatsappAccountsSelected,f.customDashboard.widgets.push(e.rows[n])}).catch(function(){f.customDashboard=void 0}),t.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),i.removeAllListeners("sms_account:save"),i.removeAllListeners("fax_account:save"),i.removeAllListeners("mail_account:save"),i.removeAllListeners("openchannel_account:save"),i.removeAllListeners("whatsapp_account:save"),i.removeAllListeners("chat_website:save"),i.removeAllListeners("chatInteraction:save"),i.removeAllListeners("chatInteraction:update"),i.removeAllListeners("smsInteraction:save"),i.removeAllListeners("smsInteraction:update"),i.removeAllListeners("openchannelInteraction:save"),i.removeAllListeners("openchannelInteraction:update"),i.removeAllListeners("mailInteraction:save"),i.removeAllListeners("mailInteraction:update"),i.removeAllListeners("faxInteraction:save"),i.removeAllListeners("faxInteraction:update"),i.removeAllListeners("whatsappInteraction:save"),i.removeAllListeners("whatsappInteraction:update"),f.interval&&n.cancel(f.interval)})}e.$inject=["$state","$interval","$scope","api","socket","Auth","$mdDialog","$document","voiceQueues","faxAccounts","chatWebsites","smsAccounts","mailAccounts","openchannelAccounts","whatsappAccounts","userProfile","userProfileSection"],angular.module("app.dashboards.custom").controller("DashboardCustomController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){a.hide(c.parent)}c.title="DASHBOARDS.SETFILTERS",c.currentUser=l.getCurrentUser(),c.parent=d,c.onChangeFilter=function(e){for(var n=0;n<c.parent.customDashboard.widgets.length;n+=1)switch(e){case"voice":c.parent.customDashboard.widgets[n].voiceQueuesSelected=c.parent.voiceQueuesSelected;break;case"sms":c.parent.customDashboard.widgets[n].smsAccountsSelected=c.parent.smsAccountsSelected;break;case"chat":c.parent.customDashboard.widgets[n].chatAccountsSelected=c.parent.chatAccountsSelected;break;case"fax":c.parent.customDashboard.widgets[n].faxAccountsSelected=c.parent.faxAccountsSelected;break;case"mail":c.parent.customDashboard.widgets[n].mailAccountsSelected=c.parent.mailAccountsSelected;break;case"openchannel":c.parent.customDashboard.widgets[n].openchannelAccountsSelected=c.parent.openchannelAccountsSelected;break;case"whatsapp":c.parent.customDashboard.widgets[n].whatsappAccountsSelected=c.parent.whatsappAccountsSelected}},c.confirm=function(){m()},c.closeDialog=m}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","api","Auth","vm_parent"],angular.module("app.tools").controller("FilterDialogController",e)}(),function(){"use strict";function e(e,s,i,o,r,l,a,n,d,t,c,m,u,p,g,v,h,f,b,A,E){var y=this;y.license=v,y.setting=h,y.detectBrowser=b.detectBrowser(),y.user=n.getCurrentUser(),y.currentTab=0,y.notifications={},y.tabs={},y.agentCapacity={},y.autoClose=!1,y.globalUserLists=m||{count:0,rows:[]},y.globalLists=u||{count:0,rows:[]},y.globalCompanies=p||{count:0,rows:[]},y.globalTags=g||{count:0,rows:[]};var S=E.getLogger("dashboard","agent.general.contact");function T(e){var n={};for(var t in y.tabs)y.tabs.hasOwnProperty(t)&&(n[t]=_.pick(y.tabs[t],["type","title","channel","icon","color","autoCreate","id","saved","badges","openedAt"]),_.isNil(y.tabs[t].contact)||(n[t].contact=_.pick(y.tabs[t].contact,["id","ListId"])),_.isNil(y.tabs[t].calls)||(n[t].calls=y.tabs[t].calls),y.tabs[t].interaction&&(n[t].interaction=_.pick(y.tabs[t].interaction,["id","OpenchannelAccountId","MailAccountId","ChatWebsiteId","FaxAccountId","SmsAccountId","WhatsappAccountId","closed","draft"])));var a=JSON.parse(i.localStorage.getItem("motion2.user:"+y.user.id));a?(a.tabs=n,a.currentTab=y.currentTab,a.autoClose=y.autoClose):a={tabs:n,currentTab:y.currentTab,autoClose:y.autoClose},i.localStorage.setItem("motion2.user:"+y.user.id,JSON.stringify(a)),e&&I(e)}function I(e){if(_.isNil(e)||e&&"interaction"===e.type){var n={id:y.user.id,online:!0,capacity:{mail:0,fax:0,sms:0,whatsapp:0,openchannel:0,chat:0},interaction:{mail:[],fax:[],sms:[],whatsapp:[],openchannel:[],chat:[]}};for(var t in y.tabs)y.tabs.hasOwnProperty(t)&&n.capacity.hasOwnProperty(y.tabs[t].channel)&&y.tabs[t].interaction&&!y.tabs[t].interaction.closed&&(n.capacity[y.tabs[t].channel]+=1,n.interaction[y.tabs[t].channel].push(y.tabs[t].interaction.id));if(!_.isEqual(y.agentCapacity,n.capacity))return y.agentCapacity=n.capacity,d.rpc.setAgentCapacity(n)}}function O(e){y.tabs[e.id]&&(!function(e){if(e.channel&&e.interaction)d.user["remove"+_.upperFirst(e.channel)+"Interactions"]({id:y.user.id,ids:[e.interaction.id]}).$promise.catch(function(e){S.error(e)})}(y.tabs[e.id]),delete y.tabs[e.id],y.currentTab=0,T(e))}function C(e){Object.keys(y.tabs).length!==y.setting.limitTabs?(e.id=_.random(1e10),e.openedAt=(new Date).toISOString(),e.saved=!1,e.badges=0,y.tabs[e.id]=e,y.currentTab=e.id,T(e)):c.warning({title:"",msg:o.instant("DASHBOARD.LIMIT_TABS_REACHED")})}function w(n){return _.find(y.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id==n.interactionId&&e.channel==n.channel})}function R(n,t){var e,a,i={type:"contact",title:n?(e=n,a="",e&&(e.firstName||e.lastName?(e.firstName&&(a+=e.firstName+" "),e.lastName&&(a+=e.lastName)):e.phone&&(a=e.phone)),a=y.user.privacyEnabled?A.mask(a):a):o.instant("DASHBOARDS.NEW_CONTACT"),icon:"icon-account-circle",color:"red",contact:n,calls:t?[t]:[],autoCreate:t?t.autoCreate:0};if(t&&(t.answertime||(t.answertime=t.agentconnectAt),(t.agentcompleteAt||t.endtime)&&k(t)),n){var s=_.find(y.tabs,function(e){return e.contact&&e.contact.id?"contact"===e.type&&e.contact&&e.contact.id==n.id:"contact"===e.type&&e.contact&&e.contact.phone==n.phone});if(s){if(t)return d.voiceCallReport.get({uniqueid:t.uniqueid}).$promise.then(function(e){(e&&0<e.rows.length&&(t.disposedAt=_.first(e.rows).endtime),s.calls)?_.find(s.calls,function(e){return e.uniqueid===t.uniqueid})||s.calls.push(t):s.calls=[t];y.currentTab=s.id})}else{if(n.ListId)return d.disposition.get({ListId:n.ListId,nolimit:!0}).$promise.then(function(e){return i.dispositions=e,d.cmList.getCustomFields({id:n.ListId,nolimit:!0}).$promise}).then(function(e){i.customFields=e}).catch(M()).finally(function(){C(i)});C(i)}}else C(i)}function x(n,t){var e=_.find(y.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id===t.id&&e.channel===n});e?(e.isDraft=t.isDraft||!1,y.currentTab=e.id):C(e={type:"interaction",title:n?n.toUpperCase():"openchannel",icon:function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";case"whatsapp":return"icon-whatsapp";default:return"icon-hangouts"}}(n),color:function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";case"whatsapp":return"lime-A700";default:return"grey"}}(n),channel:n,interaction:t,isDraft:t.isDraft||!1})}function N(t){f.isSupported()?f.requestPermission().then(function(){var e,n;n={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"../../../../../../../assets/images/avatars/customer.png",body:(e=t).queue?"Queue: "+e.queue:"",focusOnclick:!0,closeOnClick:!0},f.show(e.title,n)},function(e){S.error("Please enable browser notifications!",e)}):S.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}function D(e){e&&e.uniqueid&&y.notifications[e.uniqueid]&&(c.clear(y.notifications[e.uniqueid]),delete y.notifications[e.uniqueid])}function P(n){var t=n.uniqueid;for(var e in S.debug("onVoiceChannelRemove -> evt",n),y.tabs)if(y.tabs.hasOwnProperty(e)){var a=y.tabs[e];if(a.calls){S.debug("onVoiceChannelRemove ->  key, tab, tab.calls",e,a,a.calls);var i=_.findIndex(a.calls,function(e){return e.uniqueid===t});i<0&&0<=(i=_.findIndex(a.calls,function(e){return e.uniqueid===n.linkedid}))&&(t=n.linkedid),0<=i&&!a.calls[i].disposedAt?(S.debug("Allowing disposition for call %s",a.calls[i].uniqueid),k(a.calls[i])):S.debug("Call %s not found or already completed",a.calls[i].uniqueid),a.contact&&a.contact.id&&l(L(t,a.contact.id,a),1e3)}}T()}function L(n,e,t){return function(){if(_.find(t.calls,function(e){return e.uniqueid===n}))return d.voiceCallReport.update({id:n,ContactId:e}).$promise.catch(function(e){S.error(e)})}}function k(e){e.disposedAt=new Date}function M(){return function(e){if(404===e.status)c.warning({title:o.instant("DASHBOARDS.ATTENTION"),msg:o.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){y.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}y.onClickTab=function(e){y.currentTab=e,T(y.tabs[e])},y.isActiveTab=function(e){return e===y.currentTab},y.alreadyExistsTab=w,y.addContactTab=R,y.addInteractionTab=x,y.addTab=C,y.removeTab=O,y.updateLocalStorage=T,y.closeTab=function(e){var n=!1,t=s.confirm().title("interaction"===e.type?"Do you want to close the interaction?":"Are you sure want to close the "+e.type+"?").textContent("interaction"===e.type?"":"The "+e.type+" has been modified. Closing will lose all changes!").ariaLabel("Close Contact").ok("interaction"===e.type?"YES":"OK").cancel("interaction"===e.type?"NO":"CANCEL");{if(!e.saved){var a=y.user.voicePause||y.user.chatPause||y.user.mailPause||y.user.openchannelPause||y.user.faxPause;return"interaction"===e.type&&(n=e.interaction.Account.mandatoryDisposition),s.show(t).then(function(){"interaction"===e.type&&s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(r.body),onRemoving:function(){y.user&&n&&!a&&d.user.unpause({id:y.user.id}).$promise.catch(function(e){S.error(e)})},clickOutsideToClose:!n,escapeToClose:!n,locals:{user:y.user,channel:e.channel,interaction:e.interaction}}),O(e)}).catch(function(){"interaction"===e.type&&O(e)})}if(_.forEach(e.calls,function(e){e.mandatoryDisposition&&(n=!0)}),"contact"===e.type&&0<e.calls.length){if(!n)return t._options.textContent="There is a call that hasn't been disposed yet.",s.show(t).then(function(){O(e)});var i=s.alert().title("Warning").textContent("There is a call that hasn't been disposed yet.").ok("OK");s.show(i).finally(function(){i=void 0})}else O(e)}},y.dialPreviewRecallReminder=function(e){var n=a("formatdate")(e.hopper.scheduledat),t="<div>"+o.instant("DASHBOARDS.PREVIEW_CALL_FOR")+"<b>"+e.hopper.Contact.firstName+" "+e.hopper.Contact.lastName+"</b> "+o.instant("DASHBOARDS.SCHEDULED_AT")+"<b>"+n+"</b></div>";t+="<div>"+o.instant("DASHBOARDS.LIST_NAME")+": "+e.hopper.List.name+"</div>",t+="<div style='margin-top:20px;margin-bottom:40px'>",t+="<div class='preview_cancel'><a href='#' onclick='dismissToasty("+e.hopper.id+")'>"+o.instant("DASHBOARDS.CANCEL")+"</a></div>",t+="<div class='preview_open'><a href='#' onclick='openContactTab("+e.hopper.id+")'>"+o.instant("DASHBOARDS.OPEN")+"</a></div>",t+="</div>",c.info({title:o.instant("DASHBOARDS.PREVIEW_CALL"),msg:t,showClose:!0,timeout:2e4,html:!0,onAdd:function(){y.notifications[e.hopper.id]=this.id}})},y.openContactTab=function(e){y.openPreviewDialog(e),n=e,y.toasty.clear(y.notifications[n]),delete y.notifications[n];var n},y.openPreviewDialog=function(e){d.cmHopper.getPreviewRecall({hopperId:e}).$promise.then(function(e){s.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!0,locals:{preview:e,currentUser:y.user},resolve:{customFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{nolimit:!0})}]}})})},y.toasty=c,function(){var e=i.localStorage.getItem("motion2.user:"+y.user.id);if(e)try{e=JSON.parse(e),y.tabs=e.tabs?e.tabs:{},y.currentTab=e.currentTab?e.currentTab:0,y.autoClose=!!e.autoClose&&e.autoClose,I(y.tabs[y.currentTab]),S.debug("Tabs initiated correctly")}catch(e){S.error(e)}}(),e.$on("$destroy",function(){for(var e in y.notifications)y.notifications.hasOwnProperty(e)&&D({uniqueid:e});t.removeAllListeners("trigger:contactmanager"),t.removeAllListeners("trigger:jscripty"),t.removeAllListeners("trigger:browser:url"),t.removeAllListeners("trigger:browser:popup"),t.removeAllListeners("notification:save"),t.removeAllListeners("notification:remove"),t.removeAllListeners("voice_queue_channel:remove"),t.removeAllListeners("voice_outbound_channel:remove")}),t.on("trigger:contactmanager",function(n){_.isNil(n.contacts)||1!==n.contacts.length?s.show({controller:"ContactSelectionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/selection/dialog.html",parent:angular.element(r.body),locals:{contacts:n.contacts,callNumber:n.evt.routeId?n.evt.destcalleridnum:n.evt.calleridnum}}).then(function(e){R(e,n.evt)}):R(n.contact,n.evt)}),t.on("trigger:jscripty",function(t){return d.jscriptyProject.get({id:t.ProjectId}).$promise.then(function(n){if(n){if(!_.isUndefined(t["xmd-contactid"]))return d.cmContact.get({id:t["xmd-contactid"]}).$promise.then(function(e){try{n.formData=Mustache.render(n.formData,_.merge(t,{user:y.user,contact:e}))}catch(e){S.error(e)}C({type:"jscripty",title:n.name,icon:"icon-script",color:"grey",project:n,call:t,contact:e})}).catch(M());try{n.formData=Mustache.render(n.formData,_.merge(t,{user:y.user}))}catch(e){S.error(e)}C({type:"jscripty",title:n.name,icon:"icon-script",color:"grey",project:n,call:t})}}).catch(M())}),t.on("trigger:bot",function(n){var t=n.calleridname&&"<unknown>"!==n.calleridname?n.calleridname:n.calleridnum,a=n.calleridnum;return d.squareMessage.get({fields:"id",limit:1,offset:0,uniqueid:n.uniqueid}).$promise.then(function(e){e.count&&C({type:"bot",title:t+" <"+a+">",icon:"fas fa-robot",color:"pink",data:{uniqueid:n.uniqueid}})})}),t.on("trigger:browser:url",function(e){if(e&&e.uri)if(e.uri=_.replace(e.uri,"&lt%3B",""),e.uri=_.replace(e.uri,"=&gt%3B=",""),e.uriLocation)switch(e.uriLocation){case"0":i.open(e.uri);break;case"1":i.open(e.uri,"_blank","width="+(e.windowWidth||"800")+",height="+e.windowHeight||"600");break;case"2":C({type:"iframe",title:e.uri,icon:"icon-google-earth",color:"blue",src:e.uri});break;default:i.open(e.uri)}else i.open(e.uri)}),t.on("trigger:browser:popup",function(e){e&&e.html&&C({type:"popup",title:e.calleridnum||"popup",icon:"icon-tablet",color:"grey",html:e.html})}),t.on("notification:save",function(e){if(e&&e.uniqueid){N(e);var n=w(e);if(n){if(d[e.channel+"Message"])return y.currentTab!==n.id&&(n.badges+=1),d[e.channel+"Message"].accept({id:e.id,UserId:y.user.id}).$promise.catch(M())}else c.wait({title:e.title,msg:e.msg||"",showClose:!1,clickToClose:!1,timeout:!1,sound:e.sound,html:!0,shake:e.shake||!1,onAdd:function(){y.notifications[e.uniqueid]=this.id},onAccept:function(){if(D(e),d[e.channel+"Message"])return d[e.channel+"Message"].accept({id:e.id,UserId:y.user.id,manual:!0}).$promise.then(function(e){x(e.channel,e.interaction),c.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(M())},onReject:function(){if(D(e),d[e.channel+"Message"])return d[e.channel+"Message"].reject({id:e.id,UserId:y.user.id}).$promise.then(function(){c.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(M())}})}}),t.on("notification:remove",D),t.on("voice_queue_channel:remove",P),t.on("voice_outbound_channel:remove",P),t.on("user:dialPreviewRecallReminder",y.dialPreviewRecallReminder)}e.$inject=["$scope","$mdDialog","$window","$translate","$document","$timeout","$filter","Auth","api","socket","toasty","globalUserLists","globalLists","globalCompanies","globalTags","license","setting","desktopNotification","msUtils","privacyManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentDashboardGeneralController",e)}(),function(){"use strict";angular.module("app.dashboards").provider("desktopNotification",function(){var f={autoClose:!0,duration:5,showOnPageHidden:!1};return{config:function(e){for(var n in e)f.hasOwnProperty(n)&&null!=e[n]&&(f[n]=e[n])},$get:["$q","$timeout","$window","PERMISSIONS",function(e,u,n,p){var g=n.Notification||n.mozNotification||n.webkitNotification;return{isSupported:v,currentPermission:h,requestPermission:function(){if(!v())return e.reject("Notification API not supported");var t=e.defer();Promise.resolve(g.requestPermission)==g.requestPermission?g.requestPermission().then(function(e){p.GRANTED===e?t.resolve(e):t.reject(e)}):g.requestPermission(function(e,n){p.GRANTED===e?t.resolve(e):t.reject(e)});return t.promise},show:function(e,n){if(n=n||{},!v()||(t=e,a=n,i=angular.isString(t),s=!a.onClick||angular.isFunction(a.onClick),!i||!s)||function(e){if(e||f.showOnPageHidden)return!(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)}(n.showOnPageHidden)||h()!==p.GRANTED)return;var t,a,i,s;var o=new g(e,n),r=n.duration||f.duration,l=void 0===n.autoClose?f.autoClose:n.autoClose;o.onclick=function(){n.onClick&&n.onClick(),n.focusOnclick&&window.focus(),n.closeOnClick&&o.close()},l&&(d=o,c=r,m=1e3*c,u(d.close.bind(d),m,!1));var d,c,m;return o},permissions:{default:p.DEFAULT,granted:p.GRANTED,denied:p.DENIED}};function v(){return!(void 0===g)}function h(){return(g||{}).permission}}]}}).provider("msNavigationAgentService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function n(e,n){if(angular.isString(e)){for(var t=e.split("."),a=t[t.length-1],i=function(e){var n=l;if(1===e.length)return n;e.pop();for(var t=0;t<e.length;t++){for(var a=e[t],i=!0,s=0;s<n.length;s++)if(n[s]._id===a){n=n[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};n.push(o),n=o.children}}return n}(t),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,n),s.uisref=d(s)):(n.children=[],!angular.isUndefined(n.weight)&&angular.isNumber(n.weight)||(n.weight=1),n._id=a,n._path=e,n.uisref=d(n),i.push(n))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){var n="";return angular.isDefined(e.state)&&(n=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(n=n+"("+angular.toJson(e.stateParams)+")")),n}this.saveItem=n,this.deleteItem=function(e){if(!angular.isString(e))return void r.error("path must be a string (eg. `dashboard.project`)");for(var n=l,t=e.split("."),a=0;a<t.length;a++)for(var i=t[a],s=0;s<n.length;s++)if(n[s]._id===i){if(n[s]._path===e)return n.splice(s,1),!0;n=n[s].children;break}return!1},this.$get=function(){var e={saveItem:n,getNavigation:function(e){if(e){for(var n=0;n<l.length;n++)if(l[n]._id===e)return[l[n]];return null}return l}};return e}}).constant("PERMISSIONS",{DEFAULT:"default",GRANTED:"granted",DENIED:"denied"})}(),function(){"use strict";function e(t){var a=this;a.setting={},a.messages={count:0,rows:[]},a.showInteraction=!1,a.init=function(e,n){{if(a.setting=n,a.tab=e,a.tab.saved=!0,a.tab&&a.tab.data&&a.tab.data.uniqueid)return t.squareMessage.get({uniqueid:a.tab.data.uniqueid}).$promise.then(function(e){a.messages=e}).finally(function(){a.showInteraction=!0});a.showInteraction=!0}},a.getMessagesAlignment=function(e){switch(a.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}}}e.$inject=["api"],angular.module("app.dashboards").controller("AgentGeneralBotController",e)}(),function(){"use strict";function e(a,d,c,t,m,i,u,p,s,o,e,r,l,n){var g=this;g.user=s.getCurrentUser(),g.detectBrowser=e.detectBrowser(),g.journey=[],g.queryHopper={fields:"id,phone,scheduledat",sort:"-updatedAt",limit:10,page:1},g.queryFinal={fields:"uniqueid,calleridnum,statedesc,starttime,disposition,secondDisposition,thirdDisposition",sort:"-updatedAt",limit:10,page:1},g.queryHistory={fields:"uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,page:1},g.hoppers={rows:[],count:0},g.finals={rows:[],count:0},g.histories={rows:[],count:0},g.journeyOptions=r.getQuery(),g.quickFilters=r.getQuickFilters(),g.addNewContact=h,g.saveContact=function(){g.errors=[],u.cmContact.update({id:g.contact.id},g.contact).$promise.then(function(e){var n=e.firstName||e.phone;return g.tab.title=g.user.privacyEnabled?l.mask(n):n,g.tab.contact=g.contact,m.$parent.vm.updateLocalStorage(),u.user.addContacts({id:s.getCurrentUser().id,ids:[e.id]})}).then(function(){return u.cmContact.setTags({id:g.contact.id,ids:g.tab.Tags}).$promise}).then(function(){g.detailForm.$pristine=!0,g.customFieldsForm.$pristine=!0,p.success({title:"Contact properly updated!",msg:g.contact.name?g.contact.name+" has been updated!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.getCustomFields=function(e){return u.cmList.getCustomFields({id:e}).$promise.then(function(e){g.tab.customFields=e}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"LIST:GETCustomFields",msg:e.data?JSON.stringify(e.data):e.toString()})})},g.call=m.$parent.vm.call,g.disposeCall=function(e,i){if(g.newContact)return void p.error({title:"ATTENTION",msg:"Please save the contact before disposing!"});d.show({controller:"DisposeCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",parent:angular.element(c.body),targetEvent:i,clickOutsideToClose:!i.mandatoryDisposition,escapeToClose:!i.mandatoryDisposition,resolve:{globalDispositions:["apiResolver",function(e){return e.resolve("disposition@get",{MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}]},onRemoving:function(){g.user&&i.mandatoryDisposition&&u.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{dispositions:g.tab.dispositions,contact:g.contact,call:i,availableCalls:g.tab.calls.length,autoClose:m.$parent.vm.autoClose}}).then(function(e){var n=e[0];for(var t in m.$parent.vm.autoClose=e[1],n&&("BLACKLIST"===n?p.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_DISPOSED")+" "+n}):"RECALLME"===n||"RESCHEDULE"===n||p.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_SAVED")})),m.$parent.$parent.$parent.vm.tabs)if(m.$parent.$parent.$parent.vm.tabs.hasOwnProperty(t)){var a=m.$parent.$parent.$parent.vm.tabs[t];_.remove(a.calls,function(e){return e.uniqueid===i.uniqueid})}0===g.tab.calls.length&&m.$parent.vm.autoClose&&m.$parent.vm.removeTab(g.tab),m.$parent.vm.updateLocalStorage()})},g.checkCallStatus=function(n){return g.checkingCallStatus=!0,u.voiceCallReport.get({uniqueid:n.uniqueid}).$promise.then(function(e){e&&0<e.rows.length&&(n.disposedAt=_.first(e.rows).endtime)}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"VOICE_CALL_REPORT:GET",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){g.checkingCallStatus=!1})},g.duplicateContact=function(e){d.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(c.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:g.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:s.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},g.mergeContact=function(e){d.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(c.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:g.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:s.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}}).then(function(e){if(e){for(var n in m.$parent.$parent.$parent.vm.tabs)if(m.$parent.$parent.$parent.vm.tabs.hasOwnProperty(n)){var t=m.$parent.$parent.$parent.vm.tabs[n];t&&t.contact&&(e.from&&e.from.id&&e.from.id===t.contact.id&&m.$parent.$parent.$parent.vm.removeTab(t),e.to&&e.to.id&&e.to.id===t.contact.id&&m.$parent.$parent.$parent.vm.removeTab(t))}e.new&&m.$parent.$parent.$parent.vm.addContactTab(e.new)}})},g.getDateFromString=y,g.addJscriptyTab=function(e){try{e.formData=Mustache.render(e.formData,{contact:g.contact,user:g.user})}catch(e){v.error(e)}try{m.$parent.$parent.$parent.vm.addTab({type:"jscripty",title:e.name,icon:"icon-script",color:"grey",project:e,contact:g.contact})}catch(e){p.error({title:"ERROR OPENING JSCRIPTY PROJECT",msg:"The project cannot be started"+JSON.stringify(e)})}},g.getHoppers=b,g.getFinals=A,g.getHistories=E,g.getJscriptyProjects=function(){if(g.jscriptyProjects)return;return g.loadingJscriptyProjects=!0,u.jscriptyProject.get({fields:"createdAt,updatedAt,id,name,description,createdAt,formData,enableUncompleteSave",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.jscriptyProjects=e||{count:0,rows:[]}}).catch(function(){p.error({title:o.instant("JSCRIPTY.JSCRIPTY"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.JSCRIPTY_GET_ERROR")})}).finally(function(){g.loadingJscriptyProjects=!1})},g.getAccounts=function(n){if(g[n+"Accounts"])return;var e="get"+_.startCase(n)+"Accounts";return g.loadingAccounts=!0,u.user[e]({id:g.user.id,attributes:["id","name"],nolimit:!0}).$promise.then(function(e){g[n+"Accounts"]=e||{count:0,rows:[]}}).catch(function(){p.error({title:o.instant(n.toUpperCase()+"."+n.toUpperCase()+"ACCOUNTS"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.ACCOUNTS_GET_ERROR",{channel:o.instant("DASHBOARDS."+n.toUpperCase())})})}).finally(function(){g.loadingAccounts=!1})},g.composeInteraction=function(e,o,r,n){var l=o.toLowerCase();d.show({controller:"Compose"+o+"InteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/"+o.toLowerCase()+"/dialog.html",parent:angular.element(c.body),clickOutsideToClose:!1,locals:{account:r,message:{to:"mail"==l?n:n.split(",")},type:"new",interaction:{Contact:g.contact}},fullscreen:!0}).then(function(s){if(!s||_.isNil(s.message)||!s.message.savedAsDraft)return u[l+"Account"].send({id:r.id},s).$promise.then(function(e){if("Mail"===o){var n=e;if(n&&n.Messages&&n.Messages.length){if(s.attachments&&s.attachments.length)for(var t=0;t<s.attachments.length;t+=1)u.attachment.update({id:s.attachments[t].id},{MailMessageId:_.head(n.Messages).id});if(p.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.closed){n.disposition=null;var a=!r.mandatoryDisposition,i=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause;d.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(c.body),onRemoving:function(){g.user&&r.mandatoryDisposition&&!i&&u.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},clickOutsideToClose:a,escapeToClose:a,locals:{user:g.user,channel:"mail",interaction:n}})}else m.$parent.vm.addInteractionTab("mail",n)}}else p.success({title:"Message properly sent!",msg:"Message has been sent!"}),m.$parent.vm.addInteractionTab(l,e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"fax"===l?p.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:o.toUpperCase()+"ACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});var e={type:"draft",channel:"mail",account:r,contact:g.contact,id:g.tab.id,openedAt:new Date,saved:!1,title:r.key+" - Untitled",content:s.message},n=a.localStorage.getItem("motion2.home.mail:"+g.user.id);if(n){var t=JSON.parse(n);t.drafts||(t.drafts={}),n=t}else n={drafts:{}};n.drafts[g.tab.id]=e,a.localStorage.setItem("motion2.home.mail:"+g.user.id,JSON.stringify(n))})},g.init=function(n,e){return g.tab=n,m.$watchGroup(["vm.detailForm.$pristine","vm.customFieldsForm.$pristine"],function(e){g.tab.saved=e[0]&&e[1]}),g.license=e,g.contact=g.tab.contact,g.newContact=!1,g.currentTab=0,u.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){g.users=e||{count:0,rows:[]},g.usersMap=_.mapValues(_.keyBy(g.users.rows,"id"),"fullname")}).then(function(){for(var e=[],n=0;n<g.tab.calls.length;n++){var t=g.tab.calls[n];e.push(u.voiceCallReport.get({uniqueid:t.uniqueid}).$promise.then(function(e){e&&0<e.rows.length&&(t.disposedAt=_.first(e.rows).endtime)}))}return i.all(e)}).then(function(){return u.user.getLists({id:g.user.id,nolimit:!0}).$promise}).then(function(e){if(g.lists=e||{count:0,rows:[]},g.contact&&g.contact.ListId){if(g.list=_.find(g.lists.rows,{id:g.contact.ListId}),g.list)return;return u.cmList.get({id:g.contact.ListId}).$promise.then(function(e){e&&(g.list=e,g.lists.rows=_.unionBy(g.lists.rows,[g.list]))})}}).then(function(){if(g.contact&&g.contact.id){var e={id:g.contact.id,ListId:g.contact.ListId,limit:1,offset:0,sort:"-updatedAt"};return u.cmContact.get(e).$promise.then(function(e){return g.contact=e,g.tab.contact=e,u.user.addContacts({id:g.user.id,ids:[g.contact.id]})}).then(function(){if(g.contact.ListId)return u.disposition.get({ListId:g.contact.ListId,nolimit:!0}).$promise.then(function(e){return g.tab.dispositions=e,u.cmList.getCustomFields({id:g.contact.ListId,nolimit:!0}).$promise}).then(function(e){g.tab.customFields=e})}).then(function(){try{g.tab.companies=m.$parent.$parent.$parent.vm.globalCompanies,g.tab.tags=m.$parent.$parent.$parent.vm.globalTags,g.tab.autoCreate=0}catch(e){}b(),A(),E()}).then(function(){return u.cmContact.getTags({id:g.contact.id}).$promise.then(function(e){g.tab.Tags=_.map(e.rows,"id")})})}return g.newContact=!0,n.autoCreate?h():void 0}).finally(function(){g.contact&&g.contact.id&&(S(),g.contact.dateOfBirth=y(g.contact.dateOfBirth))})},g.hasPermission=function(e){return s.hasPermission(e)},g.openInteraction=function(e){try{return m.$parent.$parent.$parent.vm.addInteractionTab(e.channel,e)}catch(e){p.error({title:o.instant("CONTACTMANAGER.CUSTOMER_JOURNEY"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.INTERACTION_OPEN_ERROR")})}},g.getCustomerJourney=S,g.loadMoreJourney=function(){return i(function(e){var n=g.journey.length;return e(S(n))})};var v=n.getLogger("agent.general.contact");function h(){g.errors=[],u.cmContact.save(g.contact).$promise.then(function(e){g.contact.id=e.id,g.newContact=!1;var n=e.firstName||e.phone;return g.tab.title=g.user.privacyEnabled?l.mask(n):n,g.tab.contact=g.contact,u.user.addContacts({id:s.getCurrentUser().id,ids:[e.id]})}).then(function(){g.detailForm.$pristine=!0,g.customFieldsForm.$pristine=!0,p.success({title:"Contact properly created",msg:g.contact.firstName?g.contact.firstName+" has been created!":""})}).then(function(){return u.cmContact.setTags({id:g.contact.id,ids:g.tab.Tags}).$promise}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}function f(n){return function(e){g[n]=e||{count:0,rows:[]}}}function b(){g.contact&&g.contact.id&&(g.queryHopper.ContactId=g.contact.id,g.queryHopper.offset=(g.queryHopper.page-1)*g.queryHopper.limit,g.promise=u.cmHopper.get(g.queryHopper,f("hoppers")).$promise)}function A(){g.contact&&g.contact.id&&(g.queryFinal.ContactId=g.contact.id,g.queryFinal.offset=(g.queryFinal.page-1)*g.queryFinal.limit,g.promise=u.cmHopperFinal.get(g.queryFinal,f("finals")).$promise)}function E(){g.contact&&g.contact.id&&(g.queryHistory.ContactId=g.contact.id,g.queryHistory.offset=(g.queryHistory.page-1)*g.queryHistory.limit,g.promise=u.cmHopperHistory.get(g.queryHistory,f("histories")).$promise)}function y(e){return null===e?void 0:new Date(e)}function S(e){g.journeyIsLoading=!0;var n=_.merge(g.journeyOptions,{id:g.contact.id,offset:e||0});return r.get(g.journey,n).then(function(e){g.journey=e.journey,g.canLoadMoreJourney=e.loadMore}).finally(function(){g.journeyIsLoading=!1})}m.$on("$destroy",function(){}),m.$watch("currentTab",function(){1===g.currentTab&&(b(),A(),E())});var T=!0,I=1;m.$watch("queryHopper.filter",function(e,n){T?t(function(){T=!1}):(n||(I=g.queryHopper.page),e!==n&&(g.queryHopper.page=1),e||(g.queryHopper.page=I),b())}),m.$watch("queryFinal.filter",function(e,n){T?t(function(){T=!1}):(n||(I=g.queryFinal.page),e!==n&&(g.queryFinal.page=1),e||(g.queryFinal.page=I),A())}),m.$watch("queryHistory.filter",function(e,n){T?t(function(){T=!1}):(n||(I=g.queryHistory.page),e!==n&&(g.queryHistory.page=1),e||(g.queryHistory.page=I),E())})}e.$inject=["$window","$mdDialog","$document","$timeout","$scope","$q","api","toasty","Auth","$translate","msUtils","customerJourneyManager","privacyManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentGeneralContactController",e)}(),function(){"use strict";function e(n,t,i,s,o,e,a,r,l,d,c,m,u,p,g){var v=this;v.user=d.getCurrentUser(),v.isReschedule=!1,v.recallme=!1,v.queueCampaign=void 0,v.queueCampaigns={count:0,rows:[]},v.dispositions=_.orderBy(_.concat([],e.rows,a.rows),["name"],["asc"]),v.contact=l,v.call=r,v.note=v.call.note||void 0,v.dialerCall=!1,v.hasBlackLists=!1,v.contactTZTime,v.availableCalls=m,v.autoClose=u,v.recalcTZTime=b,v.hopper={minDate:new Date,dateTime:new Date,scheduledAt:new Date},p.$watch("vm.contact.dialTimezone",function(){b()});var h=g.getLogger("dashboard","agent.general.contact.dispose");function f(){return i(function(n){o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name,dialActive,dialMethod",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){v.queueCampaigns=e||{count:0,rows:[]},n()}).catch(function(e){h.error(e),s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})})}function b(){var e=v.dialerCall?Number(v.call["xmd-voicequeueid"]):v.queueCampaign?v.queueCampaign.id:v.call["xmd-campaignid"]?Number(v.call["xmd-campaignid"]):null;if(e)o.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,_.isNil(v.contact.dialTimezone)&&(v.contact.dialTimezone=v.hopper.dialTimezone),n)o.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}});else{o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}}function A(){var e=v.selectedDisposition?v.selectedDisposition.name.toLowerCase():void 0;return{id:v.call.uniqueid,disposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,secondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,thirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null,dispositionat:moment(),amd:"amd"===e,fax:"fax"===e,blacklist:"blacklist"===e,recallme:"recallme"===e,UserId:"recallme"===e?d.getCurrentUser().id:null,OwnerId:d.getCurrentUser().id}}function E(e){t.hide([e,v.autoClose])}v.call&&v.call.variables&&v.call.variables["xmd-voicequeueid"]?(v.dialerCall=!0,o.voiceQueue.getBlackLists({id:v.call.variables["xmd-voicequeueid"]}).$promise.then(function(e){e&&e.rows&&0<e.rows.length&&(v.hasBlackLists=!0)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})):f(),v.onDispositionChange=function(e){switch(e){case"first":v.selectedDisposition=v.firstLevelDisposition,v.anySecondLevelDisposition=_.some(v.dispositions,["ParentId",v.firstLevelDisposition.id]),v.secondLevelDisposition=void 0,v.thirdLevelDisposition=void 0,v.anyThirdLevelDisposition=!1;break;case"second":v.selectedDisposition=v.secondLevelDisposition,v.anyThirdLevelDisposition=_.some(v.dispositions,["ParentId",v.secondLevelDisposition.id]);break;case"third":v.selectedDisposition=v.thirdLevelDisposition}},v.clearDispositionSelection=function(e){"second"===e?(v.secondLevelDisposition=void 0,v.thirdLevelDisposition=void 0,v.selectedDisposition=v.firstLevelDisposition):"third"===e&&(v.thirdLevelDisposition=void 0,v.selectedDisposition=v.secondLevelDisposition)},v.saveDisposition=function(e){v.selectedDisposition=_.isNil(e)?v.selectedDisposition:{name:e},e&&(v.firstLevelDisposition=v.selectedDisposition);v.call.note=v.note,o.voiceCallReport.update({id:v.call.uniqueid,userDisposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,userSecondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,userThirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null,note:v.note,UserId:d.getCurrentUser().id,ContactId:v.contact.id}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICECALLREPORT",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.voiceRecording.get({uniqueid:v.call.uniqueid}).$promise.then(function(e){if(e)for(var n=0;n<e.rows.length;n+=1)o.voiceRecording.update({id:e.rows[n].id,userDisposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,userSecondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,userThirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})}),v.dialerCall&&(o.cmHopperFinal.update(A()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERFINAL",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.cmHopperHistory.update(A()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERHISTORY",msg:e.data?JSON.stringify(e.data):e.toString()})}));if(_.isNil(v.selectedDisposition))E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"");else switch(v.selectedDisposition.name.toLowerCase()){case"blacklist":v.call&&v.call.variables&&v.call.variables["xmd-voicequeueid"]&&function(e){if(e)o.voiceQueue.getBlackLists({id:e,type:"outbound",fields:"id"}).$promise.then(function(e){var n=[];if(e&&0<e.count){for(var t=0;t<e.rows.length;t+=1){var a=angular.copy(v.contact);delete a.id,a.ListId=e.rows[t].id,n.push(o.cmContact.save(a).$promise)}return i.all(n)}s.success({title:c.instant("DASHBOARDS.INFO"),msg:c.instant("DASHBOARDS.NOTAVAILABLE")+" "+v.selectedDisposition}),v.selectedDisposition=void 0}).then(function(e){e&&E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEBLACKLIST",msg:e.data?JSON.stringify(e.data):e.toString()}),E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")})}(v.call.variables["xmd-voicequeueid"]);break;case"reschedule":v.isReschedule=!0,v.recallme=!1;break;case"recallme":v.isReschedule=!0,v.recallme=!0,v.user.selectRecallMeCampaign&&f().then(function(){v.originalCampaign=_.find(v.queueCampaigns.rows,["id",v.call.variables["xmd-voicequeueid"]]);var e=JSON.parse(n.localStorage.getItem("motion2.user:"+v.user.id));v.queueCampaign=e.previewCampaignId?_.find(v.queueCampaigns.rows,["id",Number(e.previewCampaignId)]):v.originalCampaign});break;default:E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}},v.closeDialog=function(){t.cancel()},v.saveReschedule=function(){v.disable=!0;var e=null;v.queueCampaign?e=v.queueCampaign.id:v.dialerCall&&(e=Number(v.call["xmd-voicequeueid"]));return o.cmHopper.save({phone:v.contact.phone,UserId:v.recallme?d.getCurrentUser().id:null,ContactId:v.contact.id,ListId:v.contact.ListId,VoiceQueueId:e,scheduledat:moment(v.hopper.scheduledAt).format("YYYY-MM-DD HH:mm:ss"),dialTimezone:v.contact.dialTimezone,priority:3,recallme:v.recallme,OwnerId:d.getCurrentUser().id}).$promise.then(function(){if(v.dialerCall&&(o.cmHopperFinal.update({id:v.call.uniqueid,rescheduled:!0,rescheduledat:moment(v.hopper.scheduledAt).format("YYYY-MM-DD HH:mm:ss"),recallme:v.recallme}).$promise.catch(function(e){h.error(e)}),v.user.selectRecallMeCampaign)){var e=JSON.parse(n.localStorage.getItem("motion2.user:"+v.user.id));e.previewCampaignId=v.queueCampaign.id,n.localStorage.setItem("motion2.user:"+v.user.id,JSON.stringify(e))}}).then(function(){return o.cmContact.update({id:v.contact.id,dialTimezone:v.contact.dialTimezone})}).then(function(){s.success({title:c.instant("DASHBOARDS.INFO"),msg:c.instant("DASHBOARDS.CALL_DISPOSED")+" "+(v.recallme?c.instant("DASHBOARDS.RECALLME"):c.instant("DASHBOARDS.RESCHEDULE"))})}).catch(function(e){h.error(e),E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}).finally(function(){v.disable=!1,E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")})}}e.$inject=["$window","$mdDialog","$q","toasty","api","dispositions","globalDispositions","call","contact","Auth","$translate","availableCalls","autoClose","$scope","ClientSideLoggingService"],angular.module("app.staff").controller("DisposeCallDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.call=l,u.contact=r,u.hopper={minDate:new Date,dateTime:new Date},u.closeDialog=function(){a.cancel()},u.saveDialog=function(){return u.disable=!0,o.cmHopper.save({phone:u.contact.phone,UserId:c?d.getCurrentUser().id:null,ContactId:u.contact.id,ListId:u.contact.ListId,VoiceQueueId:Number(u.call["xmd-voicequeueid"]),scheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c,OwnerId:d.getCurrentUser().id}).$promise.then(function(){o.cmHopperFinal.update({id:u.call.uniqueid,rescheduled:!0,rescheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c}).$promise}).then(function(){s.success({title:m.instant("DASHBOARDS.INFO"),msg:m.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c?m.instant("DASHBOARDS.RECALLME"):m.instant("DASHBOARDS.RESCHEDULE"))}),a.hide()}).catch(function(e){a.cancel(e)}).finally(function(){u.disable=!1})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","toasty","api","contact","call","Auth","recallme","$translate"],angular.module("app.staff").controller("RescheduleCallDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s){var o=this;o.callNumber=i,o.page=1,o.onInit=function(){n.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){o.lists=_.chain(e.rows).keyBy("id").mapValues("name").value(),n.cmCustomField.get({fields:"id,alias",nolimit:!0}).$promise.then(function(e){o.customFields=e.rows,o.contacts=_.map(t,function(t){return Object.keys(t).forEach(function(e){if(Number(t[e])===Number(o.callNumber))if(e.startsWith("cf_")){var n=_.find(o.customFields,["id",Number(_.trimStart(e,"cf_"))]);t.matchingField=n?n.alias:a.instant("DASHBOARDS.UNKNOWN")}else t.matchingField=e}),t})})}).then(function(){o.paginatedContacts=_.chunk(t,4)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.selectContact=function(){e.hide(o.selectedContact)}}e.$inject=["$mdDialog","$translate","api","contacts","callNumber","toasty"],angular.module("app.dashboards").controller("ContactSelectionController",e)}(),function(){"use strict";function e(e,n){var t=n(function(){},999);e.$on("$destroy",function(){t&&(n.cancel(t),t=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeAbandonedController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d){var c=this;function m(){return o.disposition.get({fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise.then(function(e){return c.dispositions=e?e.rows:[],o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise}).then(function(e){c.queues=e||{count:0,rows:[]},c.queuesMap=_.mapValues(_.keyBy(c.queues.rows,"name"),"name"),c.defaultQueues=c.queues.rows?_.map(c.queues.rows,"name").join(","):void 0}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.currentUser.name,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:c.queues.rows,ngValue:"name",clearAll:!1}]}).catch(function(e){console.log(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.abandoned.bull.calls:"+c.currentUser.id);if(e)(e=JSON.parse(e)).query&&(c.query=_.merge(e.query,c.query));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};c.query.createdAt=n}c.isSearchBarVisible=!!c.query.filter,u()})}function u(){c.query.queue=c.query.queue||c.defaultQueues.split(","),c.query.offset=(c.query.page-1)*c.query.limit;var e={query:c.query};t.localStorage.setItem("motion2.home.abandoned.bull.calls:"+c.currentUser.id,JSON.stringify(e)),c.promise=o.voiceQueueReport.getVoiceQueuesReport(c.query,p).$promise}function p(e){c.abandonedCalls=e||{count:0,rows:[]},c.refresh=!0}c.showTooltip=!1,c.refresh=!0,c.disable=[],c.dispositions={count:0,rows:[]},c.currentUser=r.getCurrentUser(),c.queues={},c.abandonedCalls={count:0,rows:[]},c.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},c.getAbandonedCalls=u,c.refreshAbandonedCalls=function(){c.showTooltip=!1,u()},c.onInit=m,c.reserved=function(e){e&&(c.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?c.currentUser.name:null,assigned:e.assigned}).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[e.id]=!1,e.lastAssignedTo=e.assigned?c.currentUser.name:null}))},c.dispose=function(t){a.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(i.body),targetEvent:t,locals:{dispositions:c.dispositions,call:t}}).then(function(e){if(e){c.disable[t.id]=!0;var n={id:t.id,lastAssignedTo:t.assigned?c.currentUser.name:null,assigned:t.assigned,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[t.id]=!1,t.disposition=e.firstLevel,t.secondDisposition=e.secondLevel,t.thirdDisposition=e.thirdLevel})}})},c.call=e.$parent.$parent.$parent.$parent.vm.call,c.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,c.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,c.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",function(e){c.queuesMap&&"outbound"===e.type&&c.queuesMap[e.queue]&&(c.showTooltip=!0)}),l.onWithoutApply("voiceQueueReport:update",function(e){if(e){var n=_.findIndex(c.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(c.abandonedCalls.rows[n],e)}}),m(),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeAbandonedBullController",e)}(),function(){"use strict";function e(n,e,t){var a=this;a.dispositions=e,a.call=t,a.note=a.call.note||void 0,a.onDispositionChange=function(e){switch(e){case"first":a.selectedDisposition=a.firstLevelDisposition,a.anySecondLevelDisposition=_.some(a.dispositions,["ParentId",a.firstLevelDisposition.id]),a.secondLevelDisposition=void 0,a.thirdLevelDisposition=void 0,a.anyThirdLevelDisposition=!1;break;case"second":a.selectedDisposition=a.secondLevelDisposition,a.anyThirdLevelDisposition=_.some(a.dispositions,["ParentId",a.secondLevelDisposition.id]);break;case"third":a.selectedDisposition=a.thirdLevelDisposition}},a.clearDispositionSelection=function(e){"second"===e?(a.secondLevelDisposition=void 0,a.thirdLevelDisposition=void 0,a.selectedDisposition=a.firstLevelDisposition):"third"===e&&(a.thirdLevelDisposition=void 0,a.selectedDisposition=a.secondLevelDisposition)},a.saveDisposition=function(){a.call.note=a.note;var e={firstLevel:a.firstLevelDisposition?a.firstLevelDisposition.name:void 0,secondLevel:a.secondLevelDisposition?a.secondLevelDisposition.name:void 0,thirdLevel:a.thirdLevelDisposition?a.thirdLevelDisposition.name:void 0};n.hide(e)},a.closeDialog=function(){n.cancel()}}e.$inject=["$mdDialog","dispositions","call"],angular.module("app.dashboards").controller("DisposeAbandonedCallDialogController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d){var c=this;function m(){return o.disposition.get({fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise.then(function(e){return c.dispositions=e?e.rows:[],o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise}).then(function(e){c.queues=e||{count:0,rows:[]},c.queuesMap=_.mapValues(_.keyBy(c.queues.rows,"name"),"name"),c.defaultQueues=c.queues.rows?_.map(c.queues.rows,"name").join(","):void 0}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.currentUser.name,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_QUEUE",options:c.queues.rows,ngValue:"name",clearAll:!1}]}).catch(function(e){console.log(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.abandoned.voice.calls:"+c.currentUser.id);if(e)(e=JSON.parse(e)).query&&(c.query=_.merge(e.query,c.query));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};c.query.createdAt=n}c.isSearchBarVisible=!!c.query.filter,u()})}function u(){c.query.queue=c.query.queue||c.defaultQueues.split(","),c.query.offset=(c.query.page-1)*c.query.limit;var e={query:c.query};t.localStorage.setItem("motion2.home.abandoned.voice.calls:"+c.currentUser.id,JSON.stringify(e)),c.promise=o.voiceQueueReport.getVoiceQueuesReport(c.query,p).$promise}function p(e){c.abandonedCalls=e||{count:0,rows:[]},c.refresh=!0}c.showTooltip=!1,c.refresh=!0,c.disable=[],c.dispositions={count:0,rows:[]},c.currentUser=r.getCurrentUser(),c.queues={},c.abandonedCalls={count:0,rows:[]},c.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},c.getAbandonedCalls=u,c.refreshAbandonedCalls=function(){c.showTooltip=!1,u()},c.onInit=m,c.reserved=function(e){e&&(c.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?c.currentUser.name:null,assigned:e.assigned}).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[e.id]=!1,e.lastAssignedTo=e.assigned?c.currentUser.name:null}))},c.dispose=function(t){a.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(i.body),targetEvent:t,locals:{dispositions:c.dispositions,call:t}}).then(function(e){if(e){c.disable[t.id]=!0;var n={id:t.id,lastAssignedTo:t.assigned?c.currentUser.name:null,assigned:t.assigned,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[t.id]=!1,t.disposition=e.firstLevel,t.secondDisposition=e.secondLevel,t.thirdDisposition=e.thirdLevel})}})},c.call=e.$parent.$parent.$parent.$parent.vm.call,c.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,c.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,c.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",function(e){c.queuesMap&&"inbound"===e.type&&c.queuesMap[e.queue]&&(c.showTooltip=!0)}),l.onWithoutApply("voiceQueueReport:update",function(e){if(e){var n=_.findIndex(c.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(c.abandonedCalls.rows[n],e)}}),m(),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeAbandonedVoiceController",e)}(),function(){"use strict";function e(n,a,t,e,i){var s=this;function o(){var e=angular.element(".agent-general-home-navbar button.current")[0];e&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}s.user=t.getCurrentUser(),s.license={},s.plugin={},s.setting={},s.sidebar="dashboard",s.draftManager=i,s.navigation=e.getNavigation(),s.addContactTab=n.$parent.vm.addContactTab,s.addInteractionTab=n.$parent.vm.addInteractionTab,s.init=function(e,n){s.license=e,s.setting=n;var t=a.localStorage.getItem("motion2.home:"+s.user.id);if(t){try{t=JSON.parse(t),s.sidebar=t.currentSidebarTab?t.currentSidebarTab:"dashboard"}catch(e){console.error(e),s.sidebar="dashboard"}"mail"===s.sidebar&&s.draftManager.init()}},s.changeSidebarTab=function(e){s.sidebar=e.view,"plugin"===s.sidebar&&(s.plugin=e.stateParams,s.pluginId=e.id,n.$broadcast("pluginUpdated",{plugin:s.plugin}));a.localStorage.setItem("motion2.home:"+s.user.id,JSON.stringify({currentSidebarTab:e.view}))},s.hasPermission=function(e){return t.hasPermission(e)},angular.element(a).on("resize",o),n.$on("$destroy",function(){angular.element(a).off("resize",o)}),n.$watch("vm_home.sidebar",function(e,n){"mail"===e?s.draftManager.init():s.draftManager.drafts={}})}e.$inject=["$scope","$window","Auth","msNavigationAgentService","draftManager"],angular.module("app.dashboards").controller("AgentGeneralHomeController",e)}(),function(){"use strict";function e(t,n,i,s,a,o,r,e,l,d){var c=this;function m(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(c.chatAccounts.rows,function(e){return{model:"chatWebsite",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function u(e){!c.reloadingInteractions&&0<c.setting.chatInteractionsReloadTimeout&&E(!0),c.searchInProgress=!1,c.reloadingInteractions=!1,c.chatInteractions=e||{count:0,rows:[]};for(var n=0;n<c.chatInteractions.rows.length;n+=1)g(c.chatInteractions.rows[n])}function p(e,n){c.searchInProgress=!0,e||(c.query.page=1),c.query.offset=(c.query.page-1)*c.query.limit;var t=a.localStorage.getItem("motion2.home.chat:"+c.user.id);(t=t?JSON.parse(t):{}).query=c.query,a.localStorage.setItem("motion2.home.chat:"+c.user.id,JSON.stringify(t)),c.promise=r.chatInteraction.get(c.query,u).$promise}function g(e){"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function v(e){var n=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function h(e){var n=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function f(e){if(e){var n=_.find(c.chatInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),c.query.sort){var t=_.startsWith(c.query.sort,"-")?"desc":"asc";c.chatInteractions.rows=_.orderBy(c.chatInteractions.rows,_.trimStart(c.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===c.setting.chatInteractionsReloadTimeout&&p(c.query.page)}}function b(e){if(e){var n=_.find(c.chatInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function A(e){if(e&&!e.secret){var n=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function E(e){e&&c.interactionsInterval&&n.cancel(c.interactionsInterval),c.interactionsInterval=n(function(){c.reloadingInteractions=!0,c.searchInProgress||p()},1e3*c.setting.chatInteractionsReloadTimeout)}c.user=e.getCurrentUser(),c.license={},c.setting={},c.tags={count:0,rows:[]},c.chatInteractions={count:0,rows:[]},c.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},c.sectionColor="green-A700",c.onInit=function(e,n){return c.license=e,c.setting=n,r.user["get"+_.upperFirst("ChatWebsites")]({id:c.user.id,nolimit:!0}).$promise.then(function(e){return c.chatAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){c.tags=e||{count:0,rows:[]}}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Website",key:"ChatWebsiteId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:c.chatAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:c.tags.rows,placeholder:"DASHBOARDS.TAGS"}],c.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Customer Ip",column:"customerIp",type:"text",options:{excludedOperators:["$eq","$ne","$startsWith","$endsWith"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Website",column:"ChatWebsiteId",type:"multiselect",options:{route:{model:"user",action:"getChatWebsites",params:{id:c.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:m("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:m("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:m("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.chat:"+c.user.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.merge(c.query,e.query),_.isEmpty(c.chatAccounts.rows)?c.query.ChatWebsiteId=[]:_.isEmpty(c.query.ChatWebsiteId)&&(c.query.ChatWebsiteId=_(c.chatAccounts.rows).map("id").take().value()),c.query.sort&&0<=c.query.sort.indexOf("lastMessage")&&(c.query=_.omit(c.query,"sort")),c.query.includeAll=!0,c.isSearchBarVisible=!(c.query.search||!c.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={ChatWebsiteId:_.map(c.chatAccounts.rows,"id"),createdAt:n};c.query=_.merge(c.query,t)}l.on("chatInteraction:save",f),l.on("chatInteraction:update",f),l.on("chatInteractionTags:save",b),l.on("chatMessage:save",A),l.on("chatMessage:update",A),l.on("user_has_chat_interactions:save",v),l.on("user_has_chat_interactions:remove",h),p(c.query.page),0<c.setting.chatInteractionsReloadTimeout&&E()})},c.success=u,c.getChatInteractions=p,c.showChatInteraction=function(e,n){t.$parent.vm.addInteractionTab("chat",n)},c.downloadChatInteraction=function(e,s,n){r.chatInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="chat-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadChatInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.disposeInteraction=function(e,t){var a=c.user.voicePause||c.user.chatPause||c.user.mailPause||c.user.openchannelPause||c.user.faxPause,n=!t.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){c.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:c.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:c.user,channel:"chat",interaction:t}})},c.getContactLabel=g,c.getAgentLabel=function(e){if(e.UserId)return e.UserId===c.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},c.getChatWebsiteLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},c.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:c.sectionColor,fields:c.advancedSearch.fields,storagePath:"home.chat"},fullscreen:!0}).then(function(e){c.isSearchBarVisible=!(e.value||!c.query.filter),e.apply&&(c.query.search=e.value,p())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},t.$on("$destroy",function(){l.removeAllListeners("chatMessage:save"),l.removeAllListeners("chatMessage:update"),l.removeAllListeners("chatInteraction:save"),l.removeAllListeners("chatInteractionTags:save"),l.removeAllListeners("chatInteraction:update"),l.removeAllListeners("user_has_chat_interactions:save"),l.removeAllListeners("user_has_chat_interactions:remove"),c.interactionsInterval&&n.cancel(c.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeChatController",e)}(),function(){"use strict";function e(t,n,e,a,i,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.contacts=e||{count:0,rows:[]}}function c(e,n){l.searchInProgress=!0,o.cmContact.describe({id:l.query.ListId}).$promise.then(function(e){return _(e.toJSON()).omit("UserId").values().map(function(e){return function(e){var n={name:_.startCase(e.displayName),column:e.columnName,options:{}};if(e.custom)switch(e.custom.type){case"text":n.type="text";break;case"select":n.type="multiselect",n.values=_.map(JSON.parse(e.custom.values),function(e,n){return{id:n,name:e.value,value:e.value}}),n.options.field="name";break;case"switch":n.type="select",n.values=[{id:1,translate:"DASHBOARDS.ENABLED"},{id:0,translate:"DASHBOARDS.DISABLED"}],n.options.excludedOperators=["$ne"];break;case"number":n.type="number";break;case"datetime":n.type="date"}else switch(e.columnName){case"dateOfBirth":n.type="date";break;case"CompanyId":n.name="Company",n.type="autocomplete",n.options.route={model:"cmCompany",action:"get",params:{fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;case"ListId":n.name="List",n.type="autocomplete",n.options.route={model:"user",action:"getLists",params:{id:l.currentUser.id,fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;default:_.includes(e.type.toLowerCase(),"int")?n.type="number":_.includes(e.type.toLowerCase(),"date")?n.type="date":n.type="text"}return n}(e)}).value()}).then(function(e){l.advancedSearch.fields=e;var n=_.findIndex(e,function(e){return _.startsWith(e.column,"cf_")})||e.length-1;n<0&&(n=e.length),l.advancedSearch.fields.splice(n,0,{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"DESCRIBE_CM_CONTACTS",msg:e.data?JSON.stringify(e.data.message):e.toString()})}),e||(l.query.page=1),l.query.offset=(l.query.page-1)*l.query.limit;var t=i.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);(t=t?JSON.parse(t):{}).query=l.query,i.localStorage.setItem("motion2.home.contacts:"+l.currentUser.id,JSON.stringify(t)),l.promise=o.cmContact.get(l.query,d).$promise}l.currentUser=s.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1},l.advancedSearch={fields:[]},l.sectionColor="red",l.getContacts=c,l.refreshContacts=function(){c()},l.mergeContact=function(e,n){a.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,n){a.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e){return o.cmContact.get({id:e}).$promise.then(function(e){n.$parent.vm.addContactTab(e)})},l.call=n.$parent.vm.call,l.onInit=function(){o.user.getLists({id:l.currentUser.id,fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),o.tag.get({sort:"name"}).$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"List",key:"ListId",type:"multiselect",label:"CONTACTMANAGER.SELECT_LIST",options:l.lists.rows,clearAll:!1},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:l.tags.rows,placeholder:"DASHBOARDS.TAGS"}]}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query),_.isEmpty(l.lists.rows)?l.query.ListId=[]:_.isEmpty(l.query.ListId)&&(l.query.ListId=_(l.lists.rows).map("id").take().value()))}catch(e){console.log(e)}else l.query.ListId=_.map(l.lists.rows,"id");l.isSearchBarVisible=!(l.query.search||!l.query.filter),c()})},l.openAdvancedSearch=function(){a.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{color:l.sectionColor,fields:l.advancedSearch.fields,storagePath:"home.contacts"},fullscreen:!0}).then(function(e){l.isSearchBarVisible=!(e.value||!l.query.filter),e.apply&&(l.query.search=e.value,c())}).catch(function(e){r.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}e.$inject=["$document","$scope","$timeout","$mdDialog","$window","Auth","api","toasty"],angular.module("app.dashboards").controller("AgentHomeContactsController",e)}(),function(){"use strict";function e(e,n){var t=n(function(){},999);e.$on("$destroy",function(){t&&(n.cancel(t),t=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeDashboardController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,n){c.rpcVoiceQueues[n]&&(c.voiceQueues[n].waiting=c.rpcVoiceQueues[n].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"outbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"outbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"outbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardBullController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcChatQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.chatQueuesTotal=e.count?e.count:0,c.chatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.chatQueues,function(e,n){c.rpcChatQueues[n]&&(c.chatQueues[n].waiting=c.rpcChatQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.chatQueues={},c.chatQueuesTotal=0,c.rpcChatQueues={},c.paginatedInteractions=[],c.deleteChatQueuesWaitingInteractions=[],c.rpcChatQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"chat",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getChatQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.chatQueues[e.id]&&c.rpcChatQueues[e.id]&&(_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onSaveChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]=_.pick(e,m))},c.onUpdateChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]&&_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),c.chatQueues[e.id]&&_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onRemoveChatQueue=function(e){_.isNil(e)||(delete c.rpcChatQueues[e.id],delete c.chatQueues[e.id])},c.onSaveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onRemoveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onSaveChatQueueChannel=function(e){c.chatQueues[e.queue_id]&&(c.rpcChatQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveChatQueueChannel=function(e){delete c.rpcChatQueuesWaitingInteractions[e.id],u&&c.deleteChatQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("chat_queue:save",c.onSaveQueue),l.onWithoutApply("chatQueue:save",c.onSaveChatQueue),l.onWithoutApply("chatQueue:update",c.onUpdateChatQueue),l.onWithoutApply("chatQueue:remove",c.onRemoveChatQueue),l.onWithoutApply("userChatQueue:save",c.onSaveUserChatQueue),l.onWithoutApply("userChatQueue:remove",c.onRemoveUserChatQueue),l.onWithoutApply("chat_queue_waiting_interaction:save",c.onSaveChatQueueChannel),l.onWithoutApply("chat_queue_waiting_interaction:remove",c.onRemoveChatQueueChannel),o.rpc.getChatQueues().$promise.then(function(e){c.rpcChatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"chat"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getChatQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcChatQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteChatQueuesWaitingInteractions.length;e+=1)delete c.rpcChatQueuesWaitingInteractions[c.deleteChatQueuesWaitingInteractions[e]];u=!1,c.deleteChatQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getChatQueues())}),e.$on("$destroy",function(){l.removeAllListeners("chat_queue:save"),l.removeAllListeners("chatQueue:save"),l.removeAllListeners("chatQueue:update"),l.removeAllListeners("chatQueue:remove"),l.removeAllListeners("userChatQueue:save"),l.removeAllListeners("userChatQueue:remove"),l.removeAllListeners("chat_queue_waiting_interaction:save"),l.removeAllListeners("chat_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelChatController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcFaxQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.faxQueuesTotal=e.count?e.count:0,c.faxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.faxQueues,function(e,n){c.rpcFaxQueues[n]&&(c.faxQueues[n].waiting=c.rpcFaxQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.faxQueues={},c.faxQueuesTotal=0,c.rpcFaxQueues={},c.paginatedInteractions=[],c.deleteFaxQueuesWaitingInteractions=[],c.rpcFaxQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"fax",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getFaxQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.faxQueues[e.id]&&c.rpcFaxQueues[e.id]&&(_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onSaveFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]=_.pick(e,m))},c.onUpdateFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]&&_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),c.faxQueues[e.id]&&_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onRemoveFaxQueue=function(e){_.isNil(e)||(delete c.rpcFaxQueues[e.id],delete c.faxQueues[e.id])},c.onSaveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onRemoveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onSaveFaxQueueChannel=function(e){c.faxQueues[e.queue_id]&&(c.rpcFaxQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveFaxQueueChannel=function(e){delete c.rpcFaxQueuesWaitingInteractions[e.id],u&&c.deleteFaxQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("fax_queue:save",c.onSaveQueue),l.onWithoutApply("faxQueue:save",c.onSaveFaxQueue),l.onWithoutApply("faxQueue:update",c.onUpdateFaxQueue),l.onWithoutApply("faxQueue:remove",c.onRemoveFaxQueue),l.onWithoutApply("userFaxQueue:save",c.onSaveUserFaxQueue),l.onWithoutApply("userFaxQueue:remove",c.onRemoveUserFaxQueue),l.onWithoutApply("fax_queue_waiting_interaction:save",c.onSaveFaxQueueChannel),l.onWithoutApply("fax_queue_waiting_interaction:remove",c.onRemoveFaxQueueChannel),o.rpc.getFaxQueues().$promise.then(function(e){c.rpcFaxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"fax"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getFaxQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcFaxQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteFaxQueuesWaitingInteractions.length;e+=1)delete c.rpcFaxQueuesWaitingInteractions[c.deleteFaxQueuesWaitingInteractions[e]];u=!1,c.deleteFaxQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getFaxQueues())}),e.$on("$destroy",function(){l.removeAllListeners("fax_queue:save"),l.removeAllListeners("faxQueue:save"),l.removeAllListeners("faxQueue:update"),l.removeAllListeners("faxQueue:remove"),l.removeAllListeners("userFaxQueue:save"),l.removeAllListeners("userFaxQueue:remove"),l.removeAllListeners("fax_queue_waiting_interaction:save"),l.removeAllListeners("fax_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelFaxController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcMailQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.mailQueuesTotal=e.count?e.count:0,c.mailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.mailQueues,function(e,n){c.rpcMailQueues[n]&&(c.mailQueues[n].waiting=c.rpcMailQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.mailQueues={},c.mailQueuesTotal=0,c.rpcMailQueues={},c.paginatedInteractions=[],c.deleteMailQueuesWaitingInteractions=[],c.rpcMailQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"mail",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getMailQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.mailQueues[e.id]&&c.rpcMailQueues[e.id]&&(_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onSaveMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]=_.pick(e,m))},c.onUpdateMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]&&_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),c.mailQueues[e.id]&&_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onRemoveMailQueue=function(e){_.isNil(e)||(delete c.rpcMailQueues[e.id],delete c.mailQueues[e.id])},c.onSaveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onRemoveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onSaveMailQueueChannel=function(e){c.mailQueues[e.queue_id]&&(c.rpcMailQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveMailQueueChannel=function(e){delete c.rpcMailQueuesWaitingInteractions[e.id],u&&c.deleteMailQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("mail_queue:save",c.onSaveQueue),l.onWithoutApply("mailQueue:save",c.onSaveMailQueue),l.onWithoutApply("mailQueue:update",c.onUpdateMailQueue),l.onWithoutApply("mailQueue:remove",c.onRemoveMailQueue),l.onWithoutApply("userMailQueue:save",c.onSaveUserMailQueue),l.onWithoutApply("userMailQueue:remove",c.onRemoveUserMailQueue),l.onWithoutApply("mail_queue_waiting_interaction:save",c.onSaveMailQueueChannel),l.onWithoutApply("mail_queue_waiting_interaction:remove",c.onRemoveMailQueueChannel),o.rpc.getMailQueues().$promise.then(function(e){c.rpcMailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"mail"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getMailQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcMailQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteMailQueuesWaitingInteractions.length;e+=1)delete c.rpcMailQueuesWaitingInteractions[c.deleteMailQueuesWaitingInteractions[e]];u=!1,c.deleteMailQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getMailQueues())}),e.$on("$destroy",function(){l.removeAllListeners("mail_queue:save"),l.removeAllListeners("mailQueue:save"),l.removeAllListeners("mailQueue:update"),l.removeAllListeners("mailQueue:remove"),l.removeAllListeners("userMailQueue:save"),l.removeAllListeners("userMailQueue:remove"),l.removeAllListeners("mail_queue_waiting_interaction:save"),l.removeAllListeners("mail_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelMailController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcOpenchannelQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.openchannelQueuesTotal=e.count?e.count:0,c.openchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.openchannelQueues,function(e,n){c.rpcOpenchannelQueues[n]&&(c.openchannelQueues[n].waiting=c.rpcOpenchannelQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.openchannelQueues={},c.openchannelQueuesTotal=0,c.rpcOpenchannelQueues={},c.paginatedInteractions=[],c.deleteOpenchannelQueuesWaitingInteractions=[],c.rpcOpenchannelQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"openchannel",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getOpenchannelQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.openchannelQueues[e.id]&&c.rpcOpenchannelQueues[e.id]&&(_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onSaveOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]=_.pick(e,m))},c.onUpdateOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]&&_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),c.openchannelQueues[e.id]&&_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onRemoveOpenchannelQueue=function(e){_.isNil(e)||(delete c.rpcOpenchannelQueues[e.id],delete c.openchannelQueues[e.id])},c.onSaveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onRemoveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onSaveOpenchannelQueueChannel=function(e){c.openchannelQueues[e.queue_id]&&(c.rpcOpenchannelQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveOpenchannelQueueChannel=function(e){delete c.rpcOpenchannelQueuesWaitingInteractions[e.id],u&&c.deleteOpenchannelQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("openchannel_queue:save",c.onSaveQueue),l.onWithoutApply("openchannelQueue:save",c.onSaveOpenchannelQueue),l.onWithoutApply("openchannelQueue:update",c.onUpdateOpenchannelQueue),l.onWithoutApply("openchannelQueue:remove",c.onRemoveOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:save",c.onSaveUserOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:remove",c.onRemoveUserOpenchannelQueue),l.onWithoutApply("openchannel_queue_waiting_interaction:save",c.onSaveOpenchannelQueueChannel),l.onWithoutApply("openchannel_queue_waiting_interaction:remove",c.onRemoveOpenchannelQueueChannel),o.rpc.getOpenchannelQueues().$promise.then(function(e){c.rpcOpenchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"openchannel"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getOpenchannelQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcOpenchannelQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteOpenchannelQueuesWaitingInteractions.length;e+=1)delete c.rpcOpenchannelQueuesWaitingInteractions[c.deleteOpenchannelQueuesWaitingInteractions[e]];u=!1,c.deleteOpenchannelQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getOpenchannelQueues())}),e.$on("$destroy",function(){l.removeAllListeners("openchannel_queue:save"),l.removeAllListeners("openchannelQueue:save"),l.removeAllListeners("openchannelQueue:update"),l.removeAllListeners("openchannelQueue:remove"),l.removeAllListeners("userOpenchannelQueue:save"),l.removeAllListeners("userOpenchannelQueue:remove"),l.removeAllListeners("openchannel_queue_waiting_interaction:save"),l.removeAllListeners("openchannel_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelOpenchannelController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcSmsQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.smsQueuesTotal=e.count?e.count:0,c.smsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.smsQueues,function(e,n){c.rpcSmsQueues[n]&&(c.smsQueues[n].waiting=c.rpcSmsQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.smsQueues={},c.smsQueuesTotal=0,c.rpcSmsQueues={},c.paginatedInteractions=[],c.deleteSmsQueuesWaitingInteractions=[],c.rpcSmsQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"sms",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getSmsQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.smsQueues[e.id]&&c.rpcSmsQueues[e.id]&&(_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onSaveSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]=_.pick(e,m))},c.onUpdateSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]&&_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),c.smsQueues[e.id]&&_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onRemoveSmsQueue=function(e){_.isNil(e)||(delete c.rpcSmsQueues[e.id],delete c.smsQueues[e.id])},c.onSaveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onRemoveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onSaveSmsQueueChannel=function(e){c.smsQueues[e.queue_id]&&(c.rpcSmsQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveSmsQueueChannel=function(e){delete c.rpcSmsQueuesWaitingInteractions[e.id],u&&c.deleteSmsQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("sms_queue:save",c.onSaveQueue),l.onWithoutApply("smsQueue:save",c.onSaveSmsQueue),l.onWithoutApply("smsQueue:update",c.onUpdateSmsQueue),l.onWithoutApply("smsQueue:remove",c.onRemoveSmsQueue),l.onWithoutApply("userSmsQueue:save",c.onSaveUserSmsQueue),l.onWithoutApply("userSmsQueue:remove",c.onRemoveUserSmsQueue),l.onWithoutApply("sms_queue_waiting_interaction:save",c.onSaveSmsQueueChannel),l.onWithoutApply("sms_queue_waiting_interaction:remove",c.onRemoveSmsQueueChannel),o.rpc.getSmsQueues().$promise.then(function(e){c.rpcSmsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"sms"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getSmsQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcSmsQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteSmsQueuesWaitingInteractions.length;e+=1)delete c.rpcSmsQueuesWaitingInteractions[c.deleteSmsQueuesWaitingInteractions[e]];u=!1,c.deleteSmsQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getSmsQueues())}),e.$on("$destroy",function(){l.removeAllListeners("sms_queue:save"),l.removeAllListeners("smsQueue:save"),l.removeAllListeners("smsQueue:update"),l.removeAllListeners("smsQueue:remove"),l.removeAllListeners("userSmsQueue:save"),l.removeAllListeners("userSmsQueue:remove"),l.removeAllListeners("sms_queue_waiting_interaction:save"),l.removeAllListeners("sms_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelSmsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,n){c.rpcVoiceQueues[n]&&(c.voiceQueues[n].waiting=c.rpcVoiceQueues[n].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"inbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"inbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.user.getQueues(c.query).$promise.then(function(e){return c.myQueues=e,o.rpc.getVoiceQueues().$promise}).then(function(e){for(var n=e.rows,t=_.keyBy(n,"id"),a=0;a<c.myQueues.count;a++){var i=c.myQueues.rows[a];c.rpcVoiceQueues[i.id]=t[i.id]}return o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,function(e){return!("inbound"!==e.type||e.queuecallerleaveAt||!_.find(c.myQueues.rows,{name:e.queue}))}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardVoiceController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcWhatsappQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.whatsappQueuesTotal=e.count?e.count:0,c.whatsappQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.whatsappQueues,function(e,n){c.rpcWhatsappQueues[n]&&(c.whatsappQueues[n].waiting=c.rpcWhatsappQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.whatsappQueues={},c.whatsappQueuesTotal=0,c.rpcWhatsappQueues={},c.paginatedInteractions=[],c.deleteWhatsappQueuesWaitingInteractions=[],c.rpcWhatsappQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"whatsapp",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getWhatsappQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.whatsappQueues[e.id]&&c.rpcWhatsappQueues[e.id]&&(_.merge(c.rpcWhatsappQueues[e.id],_.pick(e,m)),_.merge(c.whatsappQueues[e.id],_.pick(e,m)))},c.onSaveWhatsappQueue=function(e){_.isNil(e)||(c.rpcWhatsappQueues[e.id]=_.pick(e,m))},c.onUpdateWhatsappQueue=function(e){_.isNil(e)||(c.rpcWhatsappQueues[e.id]&&_.merge(c.rpcWhatsappQueues[e.id],_.pick(e,m)),c.whatsappQueues[e.id]&&_.merge(c.whatsappQueues[e.id],_.pick(e,m)))},c.onRemoveWhatsappQueue=function(e){_.isNil(e)||(delete c.rpcWhatsappQueues[e.id],delete c.whatsappQueues[e.id])},c.onSaveUserWhatsappQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getWhatsappQueues()},c.onRemoveUserWhatsappQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getWhatsappQueues()},c.onSaveWhatsappQueueChannel=function(e){c.whatsappQueues[e.queue_id]&&(c.rpcWhatsappQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveWhatsappQueueChannel=function(e){delete c.rpcWhatsappQueuesWaitingInteractions[e.id],u&&c.deleteWhatsappQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("whatsapp_queue:save",c.onSaveQueue),l.onWithoutApply("whatsappQueue:save",c.onSaveWhatsappQueue),l.onWithoutApply("whatsappQueue:update",c.onUpdateWhatsappQueue),l.onWithoutApply("whatsappQueue:remove",c.onRemoveWhatsappQueue),l.onWithoutApply("userWhatsappQueue:save",c.onSaveUserWhatsappQueue),l.onWithoutApply("userWhatsappQueue:remove",c.onRemoveUserWhatsappQueue),l.onWithoutApply("whatsapp_queue_waiting_interaction:save",c.onSaveWhatsappQueueChannel),l.onWithoutApply("whatsapp_queue_waiting_interaction:remove",c.onRemoveWhatsappQueueChannel),o.rpc.getWhatsappQueues().$promise.then(function(e){c.rpcWhatsappQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"whatsapp"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getWhatsappQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcWhatsappQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteWhatsappQueuesWaitingInteractions.length;e+=1)delete c.rpcWhatsappQueuesWaitingInteractions[c.deleteWhatsappQueuesWaitingInteractions[e]];u=!1,c.deleteWhatsappQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getWhatsappQueues())}),e.$on("$destroy",function(){l.removeAllListeners("whatsapp_queue:save"),l.removeAllListeners("whatsappQueue:save"),l.removeAllListeners("whatsappQueue:update"),l.removeAllListeners("whatsappQueue:remove"),l.removeAllListeners("userWhatsappQueue:save"),l.removeAllListeners("userWhatsappQueue:remove"),l.removeAllListeners("whatsapp_queue_waiting_interaction:save"),l.removeAllListeners("whatsapp_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelWhatsappController",e)}(),function(){"use strict";function e(i,t,s,o,a,n,r,e,l,d,c){var m=this;function u(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(m.faxAccounts.rows,function(e){return{model:"faxAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function p(e){!m.reloadingInteractions&&0<m.setting.faxInteractionsReloadTimeout&&function(e){e&&m.interactionsInterval&&t.cancel(m.interactionsInterval);m.interactionsInterval=t(function(){m.reloadingInteractions=!0,m.searchInProgress||g()},1e3*m.setting.faxInteractionsReloadTimeout)}(!0),m.searchInProgress=!1,m.reloadingInteractions=!1,m.faxInteractions=e||{count:0,rows:[]};for(var n=0;n<m.faxInteractions.rows.length;n+=1)v(m.faxInteractions.rows[n])}function g(e,n){m.searchInProgress=!0,e||(m.query.page=1),m.query.offset=(m.query.page-1)*m.query.limit;var t=a.localStorage.getItem("motion2.home.fax:"+m.user.id);(t=t?JSON.parse(t):{}).query=m.query,a.localStorage.setItem("motion2.home.fax:"+m.user.id,JSON.stringify(t)),m.promise=r.faxInteraction.get(m.query,p).$promise}function v(e){e.contactInfo=e.Contact?e.Contact.fax:void 0,"Unknown"===e.contactName&&(e.contactName=n.instant("DASHBOARDS.UNKNOWN"))}function h(e){var n=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function f(e){var n=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function b(e){if(e){var n=_.find(m.faxInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),m.query.sort){var t=_.startsWith(m.query.sort,"-")?"desc":"asc";m.faxInteractions.rows=_.orderBy(m.faxInteractions.rows,_.trimStart(m.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else g(m.query.page)}}function A(e){if(e){var n=_.find(m.faxInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function E(e){if(e&&!e.secret){var n=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}m.user=e.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.faxInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},m.sectionColor="blue-grey",m.onInit=function(e,n){return m.license=e,m.setting=n,r.user["get"+_.upperFirst("faxAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.faxAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"FaxAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:m.faxAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:m.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}],m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"FaxAccountId",type:"multiselect",options:{route:{model:"user",action:"getFaxAccounts",params:{id:m.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.fax:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),_.isEmpty(m.faxAccounts.rows)?m.query.FaxAccountId=[]:_.isEmpty(m.query.FaxAccountId)&&(m.query.FaxAccountId=_(m.faxAccounts.rows).map("id").take().value()),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0,m.isSearchBarVisible=!(m.query.search||!m.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={FaxAccountId:_.map(m.faxAccounts.rows,"id"),createdAt:n};m.query=_.merge(m.query,t)}l.on("faxInteraction:save",b),l.on("faxInteraction:update",b),l.on("faxInteractionTags:save",A),l.on("faxMessage:save",E),l.on("faxMessage:update",E),l.on("user_has_fax_interactions:save",h),l.on("user_has_fax_interactions:remove",f),g(m.query.page)})},m.success=p,m.getFaxInteractions=g,m.showFaxInteraction=function(e,n){i.$parent.vm.addInteractionTab("fax",n)},m.downloadFaxInteraction=function(e,s,n){r.faxInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="fax-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadFaxInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.disposeInteraction=function(e,t){var a=m.user.voicePause||m.user.chatPause||m.user.mailPause||m.user.openchannelPause||m.user.faxPause,n=!t.Account.mandatoryDisposition;s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){m.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:m.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:m.user,channel:"fax",interaction:t}})},m.getContactLabel=v,m.getAgentLabel=function(e){if(e.UserId)return e.UserId===m.user.id?n.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return n.instant("DASHBOARDS.NOT_ASSIGNED")},m.getFaxAccountLabel=function(e){if(e.Account)return e.Account.key;return n.instant("DASHBOARDS.UNKNOWN")},m.composeFaxInteraction=function(e,a){s.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:a,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var n=e;return r.faxAccount.send({id:a.id},n).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),i.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})}var t={channel:"fax",account:a,message:e.message,contact:e.contact};c.add(t)}})},m.openAdvancedSearch=function(){s.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{color:m.sectionColor,fields:m.advancedSearch.fields,storagePath:"home.fax"},fullscreen:!0}).then(function(e){m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply&&(m.query.search=e.value,g())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},i.$on("$destroy",function(){l.removeAllListeners("faxMessage:save"),l.removeAllListeners("faxMessage:update"),l.removeAllListeners("faxInteraction:save"),l.removeAllListeners("faxInteractionTags:save"),l.removeAllListeners("faxInteraction:update"),l.removeAllListeners("user_has_fax_interactions:save"),l.removeAllListeners("user_has_fax_interactions:remove"),m.interactionsInterval&&t.cancel(m.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeFaxController",e)}(),function(){"use strict";function e(o,n,r,l,m,t,d,e,a,c,u){var p=this;function i(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(p.mailAccounts.rows,function(e){return{model:"mailAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function s(e){!p.reloadingInteractions&&0<p.setting.mailInteractionsReloadTimeout&&S(!0),p.searchInProgress=!1,p.reloadingInteractions=!1,p.mailInteractions=e||{count:0,rows:[]};for(var n=0;n<p.mailInteractions.rows.length;n+=1)h(p.mailInteractions.rows[n])}function g(e,n){p.searchInProgress=!0,e||(p.query.page=1),(void 0===p.query.closed||null===p.query.closed||p.query.closed)&&delete p.query.substatus,p.query.offset=(p.query.page-1)*p.query.limit;var t=m.localStorage.getItem("motion2.home.mail:"+p.user.id);(t=t?JSON.parse(t):{}).query=p.query,m.localStorage.setItem("motion2.home.mail:"+p.user.id,JSON.stringify(t)),p.promise=d.mailInteraction.get(p.query,s).$promise}function v(e,n){o.$parent.vm.addInteractionTab("mail",n)}function h(e){_.isEmpty(e.to)||!e.Account||_.includes(e.to,e.Account.email)?e.contactInfo=e.Contact?e.Contact.email:void 0:e.contactInfo=e.to.split("<").pop().split(">")[0],"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function f(e){var n=_.find(p.mailInteractions.rows,{id:e.MailInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function b(e){var n=_.find(p.mailInteractions.rows,{id:e.MailInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function A(e){if(e){var n=_.find(p.mailInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),p.query.sort){var t=_.startsWith(p.query.sort,"-")?"desc":"asc";p.mailInteractions.rows=_.orderBy(p.mailInteractions.rows,_.trimStart(p.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===p.setting.mailInteractionsReloadTimeout&&g(p.query.page)}}function E(e){if(e){var n=_.find(p.mailInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function y(e){if(e&&!e.secret){var n=_.find(p.mailInteractions.rows,{id:e.MailInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function S(e){e&&p.interactionsInterval&&n.cancel(p.interactionsInterval),p.interactionsInterval=n(function(){p.reloadingInteractions=!0,p.searchInProgress||g()},1e3*p.setting.mailInteractionsReloadTimeout)}p.user=e.getCurrentUser(),p.license={},p.setting={},p.tags={count:0,rows:[]},p.mailInteractions={count:0,rows:[]},p.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},p.sectionColor="teal",p.onInit=function(e,n){return p.license=e,p.setting=n,d.user["get"+_.upperFirst("mailAccounts")]({id:p.user.id,nolimit:!0}).$promise.then(function(e){return p.mailAccounts=e||{count:0,rows:[]},d.tag.get({sort:"name"}).$promise}).then(function(e){p.tags=e||{count:0,rows:[]}}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){p.subStatuses=e||{count:0,rows:[]}}).then(function(){p.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Substatus",key:"substatus",type:"select",label:"DASHBOARDS.SELECT_SUBSTATUS",options:p.subStatuses.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NONE"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name",ngIf:"closed === 0"},{name:"Account",key:"MailAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:p.mailAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:p.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:p.tags.rows,placeholder:"DASHBOARDS.TAGS"}],p.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"plainBody",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Substatus",column:"substatus",type:"multiselect",options:{field:"name",route:{model:"mailSubstatus",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"MailAccountId",type:"multiselect",options:{route:{model:"user",action:"getMailAccounts",params:{id:p.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:i("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:i("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:i("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=m.localStorage.getItem("motion2.home.mail:"+p.user.id);if(e)try{(e=JSON.parse(e)).query&&(p.query=_.merge(p.query,e.query),_.isEmpty(p.mailAccounts.rows)?p.query.MailAccountId=[]:_.isEmpty(p.query.MailAccountId)&&(p.query.MailAccountId=_(p.mailAccounts.rows).map("id").take().value()),p.query.sort&&0<=p.query.sort.indexOf("lastMessage")&&(p.query=_.omit(p.query,"sort")),p.query.includeAll=!0,p.isSearchBarVisible=!(p.query.search||!p.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={MailAccountId:_.map(p.mailAccounts.rows,"id"),createdAt:n};p.query=_.merge(p.query,t)}a.on("mailInteraction:save",A),a.on("mailInteraction:update",A),a.on("mailInteractionTags:save",E),a.on("mailMessage:save",y),a.on("mailMessage:update",y),a.on("user_has_mail_interactions:save",f),a.on("user_has_mail_interactions:remove",b),g(p.query.page),0<p.setting.mailInteractionsReloadTimeout&&S()})},p.success=s,p.getMailInteractions=g,p.showMailInteraction=v,p.downloadMailInteraction=function(e,s,n){d.mailInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="mail-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadMailInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.disposeInteraction=function(e,t){var a=p.user.voicePause||p.user.chatPause||p.user.mailPause||p.user.openchannelPause||p.user.faxPause,n=!t.Account.mandatoryDisposition;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){p.user&&t.Account.mandatoryDisposition&&!a&&d.user.unpause({id:p.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:p.user,channel:"mail",interaction:t}})},p.getContactLabel=h,p.getAgentLabel=function(e){if(e.UserId)return e.UserId===p.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},p.getMailAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},p.composeMailInteraction=function(e,s){r.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{account:s,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var i=e;return d.mailAccount.send({id:s.id},i).$promise.then(function(e){if(e&&e.Messages&&e.Messages.length){if(i.attachments&&i.attachments.length)for(var n=0;n<i.attachments.length;n+=1)d.attachment.update({id:i.attachments[n].id},{MailMessageId:_.head(e.Messages).id});if(c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed){e.disposition=null;var t=!s.mandatoryDisposition,a=p.user.voicePause||p.user.chatPause||p.user.mailPause||p.user.openchannelPause||p.user.faxPause;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),onRemoving:function(e,n){p.user&&s.mandatoryDisposition&&!a&&d.user.unpause({id:p.user.id}).$promise.catch(function(e){console.error(e)})},clickOutsideToClose:t,escapeToClose:t,locals:{user:p.user,channel:"mail",interaction:e}})}else o.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var n={channel:"mail",account:s,message:e.message,contact:e.contact};u.add(n)}})},p.openAdvancedSearch=function(){r.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{color:p.sectionColor,fields:p.advancedSearch.fields,storagePath:"home.mail"},fullscreen:!0}).then(function(e){p.isSearchBarVisible=!(e.value||!p.query.filter),e.apply&&(p.query.search=e.value,g())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.$on("openMailDraft",function(e,s){s.interaction?(s.interaction.isDraft=!0,v(null,s.interaction)):r.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{account:s.account,message:s.content,type:"draft",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var i=e;return d.mailAccount.send({id:s.account.id},i).$promise.then(function(e){if(u.remove(s.id),e&&e.Messages&&e.Messages.length){if(i.attachments&&i.attachments.length)for(var n=0;n<i.attachments.length;n+=1)d.attachment.update({id:i.attachments[n].id},{MailMessageId:_.head(e.Messages).id});if(c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed){e.disposition=null;var t=!s.account.mandatoryDisposition,a=p.user.voicePause||p.user.chatPause||p.user.mailPause||p.user.openchannelPause||p.user.faxPause;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),onRemoving:function(e,n){p.user&&s.account.mandatoryDisposition&&!a&&d.user.unpause({id:p.user.id}).$promise.catch(function(e){console.error(e)})},clickOutsideToClose:t,escapeToClose:t,locals:{user:p.user,channel:"mail",interaction:e}})}else o.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var n={id:s.id,channel:"mail",account:e.account,message:e.message};u.update(n)}})}),p.resetTooltipPosition=function(e){var n=angular.element(e.currentTarget).children()[1],t=angular.element(n);t.css("top",""),t.css("left",""),t.css("bottom","")},p.adjustTooltipPosition=function(e){var n=angular.element(e.currentTarget).children(),t=n[0],a=n[1],i=angular.element(t),s=angular.element(a),o=m.innerHeight,r=i.offset(),l=r.top,d=r.left,c=o<216+l;s.css("left",d),c?(s.css("top",""),s.css("bottom",o-l)):(s.css("bottom",""),s.css("top",l))},o.$on("$destroy",function(){a.removeAllListeners("mailMessage:save"),a.removeAllListeners("mailMessage:update"),a.removeAllListeners("mailInteraction:save"),a.removeAllListeners("mailInteractionTags:save"),a.removeAllListeners("mailInteraction:update"),a.removeAllListeners("user_has_mail_interactions:save"),a.removeAllListeners("user_has_mail_interactions:remove"),p.interactionsInterval&&n.cancel(p.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeMailController",e)}(),function(){"use strict";function e(t,a,e,i,n,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.contacts=e||{count:0,rows:[]}}function c(e,n){l.searchInProgress=!0,s.cmContact.describe({id:l.query.ListId}).$promise.then(function(e){return _(e.toJSON()).omit("UserId").values().map(function(e){return function(e){var n={name:_.startCase(e.displayName),column:e.columnName,options:{}};if(e.custom)switch(e.custom.type){case"text":n.type="text";break;case"select":n.type="multiselect",n.values=_.map(JSON.parse(e.custom.values),function(e,n){return{id:n,name:e.value,value:e.value}}),n.options.field="name";break;case"switch":n.type="select",n.values=[{id:1,translate:"DASHBOARDS.ENABLED"},{id:0,translate:"DASHBOARDS.DISABLED"}],n.options.excludedOperators=["$ne"];break;case"number":n.type="number";break;case"datetime":n.type="date"}else switch(e.columnName){case"dateOfBirth":n.type="date";break;case"CompanyId":n.name="Company",n.type="autocomplete",n.options.route={model:"cmCompany",action:"get",params:{fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;case"ListId":n.name="List",n.type="autocomplete",n.options.route={model:"user",action:"getLists",params:{id:l.currentUser.id,fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;default:_.includes(e.type.toLowerCase(),"int")?n.type="number":_.includes(e.type.toLowerCase(),"date")?n.type="date":n.type="text"}return n}(e)}).value()}).then(function(e){l.advancedSearch.fields=e;var n=_.findIndex(e,function(e){return _.startsWith(e.column,"cf_")})||e.length-1;n<0&&(n=e.length),l.advancedSearch.fields.splice(n,0,{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"DESCRIBE_CM_CONTACTS",msg:e.data?JSON.stringify(e.data.message):e.toString()})}),e||(l.query.page=1),l.query.offset=(l.query.page-1)*l.query.limit;var t=o.localStorage.getItem("motion2.home.mycontacts:"+l.currentUser.id);(t=t?JSON.parse(t):{}).query=l.query,o.localStorage.setItem("motion2.home.mycontacts:"+l.currentUser.id,JSON.stringify(t)),l.query.search&&(l.advancedQuery=_.omit(l.query,"id")),l.promise=l.query.search?s.cmContact.get(l.advancedQuery,d).$promise:s.user.getContacts(l.query,d).$promise}l.currentUser=n.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,id:l.currentUser.id,sort:"-updatedAt",limit:10,page:1},l.advancedSearch={fields:[]},l.sectionColor="red",l.getContacts=c,l.refreshContacts=function(){c()},l.mergeContact=function(e,n){i.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,n){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e,n){a.$parent.vm.addContactTab(n)},l.call=a.$parent.vm.call,l.onInit=function(){s.cmList.get({fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),s.tag.get({sort:"name"}).$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"List",key:"ListId",type:"multiselect",label:"CONTACTMANAGER.SELECT_LIST",options:l.lists.rows,clearAll:!1},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:l.tags.rows,placeholder:"DASHBOARDS.TAGS"}]}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.mycontacts:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query),_.isEmpty(l.lists.rows)?l.query.ListId=[]:_.isEmpty(l.query.ListId)&&(l.query.ListId=_(l.lists.rows).map("id").take().value()))}catch(e){console.error(e)}else l.query.ListId=_.map(l.lists.rows,"id");l.isSearchBarVisible=!(l.query.search||!l.query.filter),c()})},l.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{color:l.sectionColor,fields:l.advancedSearch.fields,storagePath:"home.mycontacts"},fullscreen:!0}).then(function(e){l.isSearchBarVisible=!(e.value||!l.query.filter),e.apply&&(l.query.search=e.value?e.value+="||User:=$eq["+l.currentUser.id+"]":e.value,c())}).catch(function(e){r.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}e.$inject=["$document","$scope","$timeout","$mdDialog","Auth","api","$window","toasty"],angular.module("app.dashboards").controller("AgentHomeMyContactsController",e)}(),function(){"use strict";function e(i,n,s,o,a,t,r,e,l,d,c){var m=this;function u(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(m.openchannelAccounts.rows,function(e){return{model:"openchannelAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function p(e){!m.reloadingInteractions&&0<m.setting.openchannelInteractionsReloadTimeout&&y(!0),m.searchInProgress=!1,m.reloadingInteractions=!1,m.openchannelInteractions=e||{count:0,rows:[]};for(var n=0;n<m.openchannelInteractions.rows.length;n+=1)v(m.openchannelInteractions.rows[n])}function g(e,n){m.searchInProgress=!0,e||(m.query.page=1),m.query.offset=(m.query.page-1)*m.query.limit;var t=a.localStorage.getItem("motion2.home.openchannel:"+m.user.id);(t=t?JSON.parse(t):{}).query=m.query,a.localStorage.setItem("motion2.home.openchannel:"+m.user.id,JSON.stringify(t)),m.promise=r.openchannelInteraction.get(m.query,p).$promise}function v(e){"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function h(e){var n=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function f(e){var n=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function b(e){if(e){var n=_.find(m.openchannelInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),m.query.sort){var t=_.startsWith(m.query.sort,"-")?"desc":"asc";m.openchannelInteractions.rows=_.orderBy(m.openchannelInteractions.rows,_.trimStart(m.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===m.setting.openchannelInteractionsReloadTimeout&&g(m.query.page)}}function A(e){if(e){var n=_.find(m.openchannelInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function E(e){if(e&&!e.secret){var n=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function y(e){e&&m.interactionsInterval&&n.cancel(m.interactionsInterval),m.interactionsInterval=n(function(){m.reloadingInteractions=!0,m.searchInProgress||g()},1e3*m.setting.openchannelInteractionsReloadTimeout)}m.user=e.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.openchannelInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},m.sectionColor="amber",m.onInit=function(e,n){return m.license=e,m.setting=n,r.user["get"+_.upperFirst("openchannelAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.openchannelAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"OpenchannelAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:m.openchannelAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:m.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}],m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"OpenchannelAccountId",type:"multiselect",options:{route:{model:"user",action:"getOpenchannelAccounts",params:{id:m.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.openchannel:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),_.isEmpty(m.openchannelAccounts.rows)?m.query.OpenchannelAccountId=[]:_.isEmpty(m.query.OpenchannelAccountId)&&(m.query.OpenchannelAccountId=_(m.openchannelAccounts.rows).map("id").take().value()),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0,m.isSearchBarVisible=!(m.query.search||!m.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={OpenchannelAccountId:_.map(m.openchannelAccounts.rows,"id"),createdAt:n};m.query=_.merge(m.query,t)}l.on("openchannelInteraction:save",b),l.on("openchannelInteraction:update",b),l.on("openchannelInteractionTags:save",A),l.on("openchannelMessage:save",E),l.on("openchannelMessage:update",E),l.on("user_has_openchannel_interactions:save",h),l.on("user_has_openchannel_interactions:remove",f),g(m.query.page),0<m.setting.openchannelInteractionsReloadTimeout&&y()})},m.success=p,m.getOpenchannelInteractions=g,m.showOpenchannelInteraction=function(e,n){i.$parent.vm.addInteractionTab("openchannel",n)},m.downloadOpenchannelInteraction=function(e,s,n){r.openchannelInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="openchannel-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadOpenchannelInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.disposeInteraction=function(e,t){var a=m.user.voicePause||m.user.chatPause||m.user.mailPause||m.user.openchannelPause||m.user.faxPause,n=!t.Account.mandatoryDisposition;s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){m.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:m.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:m.user,channel:"openchannel",interaction:t}})},m.getContactLabel=v,m.getAgentLabel=function(e){if(e.UserId)return e.UserId===m.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},m.getOpenchannelAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},m.composeOpenchannelInteraction=function(e,a){s.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:a,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var n=e;return r.openchannelAccount.send({id:a.id},n).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),i.$parent.vm.addInteractionTab("openchannel",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"OPENCHANNELACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var t={channel:"openchannel",account:a,message:e.message,contact:e.contact};c.add(t)}})},m.openAdvancedSearch=function(){s.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{color:m.sectionColor,fields:m.advancedSearch.fields,storagePath:"home.openchannel"},fullscreen:!0}).then(function(e){m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply&&(m.query.search=e.value,g())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},i.$on("$destroy",function(){l.removeAllListeners("openchannelMessage:save"),l.removeAllListeners("openchannelMessage:update"),l.removeAllListeners("openchannelInteraction:save"),l.removeAllListeners("openchannelInteractionTags:save"),l.removeAllListeners("openchannelInteraction:update"),l.removeAllListeners("user_has_openchannel_interactions:save"),l.removeAllListeners("user_has_openchannel_interactions:remove"),m.interactionsInterval&&n.cancel(m.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeOpenchannelController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e,n,t){d.license=e,d.setting=n,d.plugin=t}d.currentUser=o.getCurrentUser(),d.plugin={},d.onInit=c,d.getTrustedURL=function(){return s.trustAsResourceUrl(d.plugin.agentUrl)},c(),n.$on("pluginUpdated",function(e,n){d.plugin=n.plugin})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","$sce","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomePluginsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(){d.agentsQuery.offset=(d.agentsQuery.page-1)*d.agentsQuery.limit,l.update("motion2.home.presence.agents:"+d.currentUser.id,d.agentsQuery,"query"),i.user.getPresence(d.agentsQuery).$promise.then(function(e){d.agents={count:e.count,rows:_.filter(e.rows,function(e){return e.id!==d.currentUser.id})}}).catch(function(){r.error({title:t.instant("DASHBOARDS.AGENT_PRESENCE"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")})})}function m(){d.queuesQuery.offset=(d.queuesQuery.page-1)*d.queuesQuery.limit,l.update("motion2.home.presence.queues:"+d.currentUser.id,d.queuesQuery,"query"),i.voiceQueue.get(d.queuesQuery).$promise.then(function(e){return d.voiceQueues=e||{rows:[],count:0},i.rpc.getVoiceQueuesChannels().$promise.then(function(e){e.rows.forEach(function(e){var n=_.find(d.voiceQueues.rows,["name",e.name]);n&&(n.calls||(n.calls=[]),n.calls.push(e))})})}).catch(function(){r.error({title:t.instant("VOICE.VOICEQUEUES"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")})})}function u(e){return 0===d.selectedTab?e:"xcallyQueueExtension"+e}function p(e,n,t,a){var i=_.find(d.agents.rows,["id",e]);i&&(i.status=!1===n?"offline":a?"pause":"unavailable"===t?t:_.includes(["idle","unknown","ringing",null,void 0],t)?"online":"busy")}function g(e){e.id!==d.currentUser.id&&p(e.id,e.online,e.voiceStatus,e.voicePause)}d.currentUser=s.getCurrentUser(),d.agents={count:0,rows:[]},d.agentsQuery={fields:"id,name,internal,online",role:"agent",sort:"name",limit:10,page:1},d.queuesQuery={fields:"id,name",type:"inbound",sort:"name",limit:10,page:1},d.onAgentsTabSelection=function(){if(d.agentsQuery.filter||d.agentsQuery.teams||d.agentsQuery.queues)return;_.merge(d.agentsQuery,l.get("motion2.home.presence.agents:"+d.currentUser.id,"query")),d.isSearchBarVisible=!!d.agentsQuery.filter,a.all([a(function(n,e){i.team.get({fields:"id,name",sort:"name",nolimit:!0}).$promise.then(function(e){d.teams=e||{rows:[],count:0},n()}).catch(function(){r.error({title:t.instant("STAFF.TEAMS"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),e()})}),a(function(n,e){i.voiceQueue.get({fields:"id,name",type:"inbound",sort:"name",nolimit:!0}).$promise.then(function(e){d.queues=e||{rows:[],count:0},n()}).catch(function(){r.error({title:t.instant("VOICE.VOICEQUEUES"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),e()})})]).then(function(){d.quickFilters=[{name:"Team",key:"teams",type:"multiselect",label:"DASHBOARDS.SELECT_TEAM",options:d.teams.rows},{name:"Queue",key:"queues",type:"multiselect",label:"DASHBOARDS.SELECT_QUEUE",options:d.queues.rows}],c()}).catch(function(){r.error({title:t.instant("DASHBOARDS.AGENT_PRESENCE"),msg:t.instant("DASHBOARDS.ERRORS.FAILED_INITIALIZATION")})})},d.onQueuesTabSelection=function(){if(d.queuesQuery.filter)return;_.merge(d.queuesQuery,l.get("motion2.home.presence.queues:"+d.currentUser.id,"query")),d.isSearchBarVisible=!!d.queuesQuery.filter,m()},d.getAgents=c,d.getVoiceQueues=m,d.originateCall=function(e){n.$broadcast("webrtc::call",{target:u(e)})},d.transferCall=function(e){n.$broadcast("webrtc::transfer",{target:u(e)})},o.on("user:presence",function(e){if(e.id===d.currentUser.id)return;p(e.id,e.online,e.voiceStatus,e.voicePause)}),o.on("user:update",g),o.on("voice_queue_presence:save",function(e){if(!d.voiceQueues&&d.voiceQueues.rows)return;var n=_.find(d.voiceQueues.rows,["name",e.name]);if(!n)return;n.calls||(n.calls=[]);if(_.some(n.calls,["uniqueid",e.uniqueid]))return;n.calls.push(e)}),o.on("voice_queue_presence:remove",function(e){var n=_.find(d.voiceQueues.rows,["name",e.name]);if(!n)return;_.remove(n.calls,["uniqueid",e.uniqueid])}),e.$on("$destroy",function(){o.removeListener("user:update",g),o.removeAllListeners("user:presence"),o.removeAllListeners("voice_queue_presence:save"),o.removeAllListeners("voice_queue_presence:remove")})}e.$inject=["$scope","$rootScope","$translate","$q","api","Auth","socket","toasty","localStorageManager"],angular.module("app.dashboards").controller("AgentHomePresenceController",e)}(),function(){"use strict";function e(e,t,n,a,o,i){var s=this;function r(e){s.searchInProgress=!1,s.voiceRecordings=e||{count:0,rows:[]}}function l(){s.searchInProgress=!0,s.query.offset=(s.query.page-1)*s.query.limit;var e={query:s.query};t.localStorage.setItem("motion2.home.recordings:"+s.currentUser.id,JSON.stringify(e)),s.promise=a.voiceRecording.get(s.query,r).$promise}s.currentUser=i.getCurrentUser(),s.voiceRecordings={},s.table="voiceRecordings",s.query={UserId:s.currentUser.id,fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,transcribeStatus,UserId",sort:"-updatedAt",limit:10,page:1,type:null},s.downloadfile=function(i,e){return a.voiceRecording.download({id:i.id,exists:!0}).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download",i.uniqueid+i.format),a.click()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.downloadtranscribe=function(s,e){return a.voiceRecording.downloadTranscribe({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.success=r,s.getVoiceRecordings=l,s.onInit=function(){s.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Type",key:"type",type:"select",label:"VOICE.SELECT_TYPE",customOptions:[{value:"internal",translate:"VOICE.INTERNAL"},{value:"inbound",translate:"VOICE.INBOUND"},{value:"outbound",translate:"VOICE.OUTBOUND"},{value:"dialer",translate:"VOICE.DIALER"},{value:null,translate:"VOICE.ALL"}]}];var e=t.localStorage.getItem("motion2.home.recordings:"+s.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(s.query=_.merge(s.query,e.query))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};s.query.createdAt=n}s.isSearchBarVisible=!!s.query.filter,l()}}e.$inject=["$scope","$window","$timeout","api","toasty","Auth"],angular.module("app.dashboards").controller("AgentHomeRecordingsController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,r,n){var l=this;function d(e){l.searchInProgress=!1,l.scheduledCalls=e||{count:0,rows:[]}}l.currentUser=n.getCurrentUser(),l.priorities=["Lowest","Low","Medium","High","Highest"],l.crudPermissions={readOnly:!1,canEdit:!0,canDelete:!0},l.scheduledCalls={},l.query={id:l.currentUser.id,fields:"id,phone,scheduledat,recallme,priority,UserId,OwnerId,dialTimezone",sort:"scheduledat",limit:10,page:1},l.queueCampaigns={rows:[],count:0},l.success=d,l.getScheduledCalls=function(){l.searchInProgress=!0,l.query.id=l.currentUser.id,l.query.includeAll=!0,l.query.offset=(l.query.page-1)*l.query.limit,l.query.fields="id,phone,scheduledat,recallme,priority,UserId,OwnerId,dialTimezone";var e={query:l.query};t.localStorage.setItem("motion2.home.scheduled:"+l.currentUser.id,JSON.stringify(e)),l.promise=r.user.getScheduledCalls(l.query,d).$promise},l.onInit=function(){r.user.getQueues({id:n.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){l.queueCampaigns=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"Start Date",key:"scheduledat",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Campaigns",key:"VoiceQueueId",type:"multiselect",label:"MOTIONDIALER.SELECT_CAMPAIGN",options:l.queueCampaigns.rows}]}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.scheduled:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.omit(e.query,["filter"]))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};l.query.scheduledat=n}l.getScheduledCalls()})},l.isDateBeforeToday=function(e){return moment(e).isBefore(moment())},l.createOrEditQueueCampaignHopper=function(e,n){i.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:null,hopper:n,hoppers:l.scheduledCalls.rows,license:null,setting:null,crudPermissions:l.crudPermissions}})},l.deleteConfirm=function(n,e){var t=i.confirm().title("Are you sure want to delete the scheduled call?").htmlContent("<b>Scheduled call</b> will be deleted.").ariaLabel("delete scheduled call").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){var e;e=n,r.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(l.scheduledCalls.rows,{id:e.id}),l.scheduledCalls.count-=1,l.scheduledCalls.rows.length||l.getScheduledCalls(),o.success({title:"Scheduled call deleted!",msg:e.name?"Scheduled call has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE_HOPPER"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETE_HOPPER",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})};var c=!0,m=1;e.$watch("vm.query.filter",function(e,n){c?a(function(){c=!1}):(n||(m=l.query.page),e!==n&&(l.query.page=1),e||(l.query.page=m),l.getScheduledCalls())})}e.$inject=["$scope","$window","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.dashboards").controller("AgentHomeScheduledCallsController",e)}(),function(){"use strict";function e(i,n,s,o,a,t,r,e,l,d,c){var m=this;function u(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(m.smsAccounts.rows,function(e){return{model:"smsAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function p(e){!m.reloadingInteractions&&0<m.setting.smsInteractionsReloadTimeout&&y(!0),m.searchInProgress=!1,m.reloadingInteractions=!1,m.smsInteractions=e||{count:0,rows:[]};for(var n=0;n<m.smsInteractions.rows.length;n+=1)v(m.smsInteractions.rows[n])}function g(e,n){m.searchInProgress=!0,e||(m.query.page=1),m.query.offset=(m.query.page-1)*m.query.limit;var t=a.localStorage.getItem("motion2.home.sms:"+m.user.id);(t=t?JSON.parse(t):{}).query=m.query,a.localStorage.setItem("motion2.home.sms:"+m.user.id,JSON.stringify(t)),m.promise=r.smsInteraction.get(m.query,p).$promise}function v(e){e.contactInfo=e.Contact?e.Contact.mobile:void 0,"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function h(e){var n=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function f(e){var n=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function b(e){if(e){var n=_.find(m.smsInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),m.query.sort){var t=_.startsWith(m.query.sort,"-")?"desc":"asc";m.smsInteractions.rows=_.orderBy(m.smsInteractions.rows,_.trimStart(m.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===m.setting.smsInteractionsReloadTimeout&&g(m.query.page)}}function A(e){if(e){var n=_.find(m.smsInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function E(e){if(e&&!e.secret){var n=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function y(e){e&&m.interactionsInterval&&n.cancel(m.interactionsInterval),m.interactionsInterval=n(function(){m.reloadingInteractions=!0,m.searchInProgress||g()},1e3*m.setting.smsInteractionsReloadTimeout)}m.user=e.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.smsInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},m.sectionColor="orange",m.onInit=function(e,n){return m.license=e,m.setting=n,r.user["get"+_.upperFirst("smsAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.smsAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"SmsAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:m.smsAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:m.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}],m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"SmsAccountId",type:"multiselect",options:{route:{model:"user",action:"getSmsAccounts",params:{id:m.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.sms:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),_.isEmpty(m.smsAccounts.rows)?m.query.SmsAccountId=[]:_.isEmpty(m.query.SmsAccountId)&&(m.query.SmsAccountId=_(m.smsAccounts.rows).map("id").take().value()),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0,m.isSearchBarVisible=!(m.query.search||!m.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={SmsAccountId:_.map(m.smsAccounts.rows,"id"),createdAt:n};m.query=_.merge(m.query,t)}l.on("smsInteraction:save",b),l.on("smsInteraction:update",b),l.on("smsInteractionTags:save",A),l.on("smsMessage:save",E),l.on("smsMessage:update",E),l.on("user_has_sms_interactions:save",h),l.on("user_has_sms_interactions:remove",f),g(m.query.page),0<m.setting.smsInteractionsReloadTimeout&&y()})},m.success=p,m.getSmsInteractions=g,m.showSmsInteraction=function(e,n){i.$parent.vm.addInteractionTab("sms",n)},m.downloadSmsInteraction=function(e,s,n){r.smsInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="sms-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadSmsInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.disposeInteraction=function(e,t){var a=m.user.voicePause||m.user.chatPause||m.user.mailPause||m.user.openchannelPause||m.user.faxPause,n=!t.Account.mandatoryDisposition;s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){m.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:m.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:m.user,channel:"sms",interaction:t}})},m.getContactLabel=v,m.getAgentLabel=function(e){if(e.UserId)return e.UserId===m.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},m.getSmsAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},m.composeSmsInteraction=function(e,a){s.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:a,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var n=e;return r.smsAccount.send({id:a.id},n).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),i.$parent.vm.addInteractionTab("sms",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SMSACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var t={channel:"sms",account:a,message:e.message,contact:e.contact};c.add(t)}})},m.openAdvancedSearch=function(){s.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{color:m.sectionColor,fields:m.advancedSearch.fields,storagePath:"home.sms"},fullscreen:!0}).then(function(e){m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply&&(m.query.search=e.value,g())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},i.$on("$destroy",function(){l.removeAllListeners("smsMessage:save"),l.removeAllListeners("smsMessage:update"),l.removeAllListeners("smsInteraction:save"),l.removeAllListeners("smsInteractionTags:save"),l.removeAllListeners("smsInteraction:update"),l.removeAllListeners("user_has_sms_interactions:save"),l.removeAllListeners("user_has_sms_interactions:remove"),m.interactionsInterval&&n.cancel(m.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeSmsController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.voiceCalls=e||{count:0,rows:[]}}function c(){l.searchInProgress=!0,l.query.offset=(l.query.page-1)*l.query.limit;var e={query:l.query};s.localStorage.setItem("motion2.home.voice:"+l.currentUser.id,JSON.stringify(e)),l.promise=a.voiceCallReport.get(l.query,d).$promise}l.currentUser=e.getCurrentUser(),l.voiceCalls={},l.table="voiceCalls",l.query={UserId:l.currentUser.id,fields:"id,type,uniqueid,tag,starttime,endtime,source,destination,userDisposition,userSecondDisposition,userThirdDisposition,note,duration,billableseconds,answertime",sort:"-updatedAt",limit:10,page:1,type:null},l.success=d,l.getVoiceCalls=c,l.onInit=function(){return a.tag.get({sort:"name"}).$promise.then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Type",key:"type",type:"select",label:"VOICE.SELECT_TYPE",customOptions:[{value:"internal",translate:"VOICE.INTERNAL"},{value:"inbound",translate:"VOICE.INBOUND"},{value:"outbound",translate:"VOICE.OUTBOUND"},{value:"dialer",translate:"VOICE.DIALER"},{value:null,translate:"VOICE.ALL"}]}]}).catch(function(e){i.error({title:"Init error",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}),l.tags={count:0,rows:[]}}).finally(function(){var e=s.localStorage.getItem("motion2.home.voice:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};l.query.createdAt=n}l.isSearchBarVisible=!!l.query.filter,c()})},l.showDetails=function(e){n.show({controller:"AgentHomeVoiceDetailsController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{call:e}})}}e.$inject=["$mdDialog","$document","api","toasty","Auth","$window","$scope","$timeout"],angular.module("app.dashboards").controller("AgentHomeVoiceController",e)}(),function(){"use strict";function e(e,n){this.call=n,this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","call"],angular.module("app.dashboards").controller("AgentHomeVoiceDetailsController",e)}(),function(){"use strict";function e(i,n,s,o,a,t,r,e,l,d,c){var m=this;function u(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(m.whatsappAccounts.rows,function(e){return{model:"whatsappAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function p(e){!m.reloadingInteractions&&0<m.setting.whatsappInteractionsReloadTimeout&&y(!0),m.searchInProgress=!1,m.reloadingInteractions=!1,m.whatsappInteractions=e||{count:0,rows:[]};for(var n=0;n<m.whatsappInteractions.rows.length;n+=1)v(m.whatsappInteractions.rows[n])}function g(e,n){m.searchInProgress=!0,e||(m.query.page=1),m.query.offset=(m.query.page-1)*m.query.limit;var t=a.localStorage.getItem("motion2.home.whatsapp:"+m.user.id);(t=t?JSON.parse(t):{}).query=m.query,a.localStorage.setItem("motion2.home.whatsapp:"+m.user.id,JSON.stringify(t)),m.promise=r.whatsappInteraction.get(m.query,p).$promise}function v(e){e.contactInfo=e.Contact?e.Contact.mobile:void 0,"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function h(e){var n=_.find(m.whatsappInteractions.rows,{id:e.WhatsappInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function f(e){var n=_.find(m.whatsappInteractions.rows,{id:e.WhatsappInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function b(e){if(e){var n=_.find(m.whatsappInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),m.query.sort){var t=_.startsWith(m.query.sort,"-")?"desc":"asc";m.whatsappInteractions.rows=_.orderBy(m.whatsappInteractions.rows,_.trimStart(m.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===m.setting.whatsappInteractionsReloadTimeout&&g(m.query.page)}}function A(e){if(e){var n=_.find(m.whatsappInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function E(e){if(e&&!e.secret){var n=_.find(m.whatsappInteractions.rows,{id:e.WhatsappInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function y(e){e&&m.interactionsInterval&&n.cancel(m.interactionsInterval),m.interactionsInterval=n(function(){m.reloadingInteractions=!0,m.searchInProgress||g()},1e3*m.setting.whatsappInteractionsReloadTimeout)}m.user=e.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.whatsappInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null},m.sectionColor="lime-A700",m.onInit=function(e,n){return m.license=e,m.setting=n,r.user["get"+_.upperFirst("whatsappAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.whatsappAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"WhatsappAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:m.whatsappAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:m.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}],m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"WhatsappAccountId",type:"multiselect",options:{route:{model:"user",action:"getWhatsappAccounts",params:{id:m.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]}}).catch(function(e){console.error(e)}).finally(function(){var e=a.localStorage.getItem("motion2.home.whatsapp:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),_.isEmpty(m.whatsappAccounts.rows)?m.query.WhatsappAccountId=[]:_.isEmpty(m.query.WhatsappAccountId)&&(m.query.WhatsappAccountId=_(m.whatsappAccounts.rows).map("id").take().value()),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0,m.isSearchBarVisible=!(m.query.search||!m.query.filter))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},t={WhatsappAccountId:_.map(m.whatsappAccounts.rows,"id"),createdAt:n};m.query=_.merge(m.query,t)}l.on("whatsappInteraction:save",b),l.on("whatsappInteraction:update",b),l.on("whatsappInteractionTags:save",A),l.on("whatsappMessage:save",E),l.on("whatsappMessage:update",E),l.on("user_has_whatsapp_interactions:save",h),l.on("user_has_whatsapp_interactions:remove",f),g(m.query.page),0<m.setting.whatsappInteractionsReloadTimeout&&y()})},m.success=p,m.getWhatsappInteractions=g,m.showWhatsappInteraction=function(e,n){i.$parent.vm.addInteractionTab("whatsapp",n)},m.downloadWhatsappInteraction=function(e,s,n){r.whatsappInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="whatsapp-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadWhatsappInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.disposeInteraction=function(e,t){var a=m.user.voicePause||m.user.chatPause||m.user.mailPause||m.user.openchannelPause||m.user.faxPause,n=!t.Account.mandatoryDisposition;s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(e,n){m.user&&t.Account.mandatoryDisposition&&!a&&r.user.unpause({id:m.user.id}).$promise.catch(function(e){console.error(e)})},locals:{user:m.user,channel:"whatsapp",interaction:t}})},m.getContactLabel=v,m.getAgentLabel=function(e){if(e.UserId)return e.UserId===m.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},m.getWhatsappAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},m.composeWhatsappInteraction=function(e,a){s.show({controller:"ComposeWhatsappInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:a,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var n=e;return r.whatsappAccount.send({id:a.id},n).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),i.$parent.vm.addInteractionTab("whatsapp",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"WHATSAPPACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var t={channel:"whatsapp",account:a,message:e.message,contact:e.contact};c.add(t)}})},m.openAdvancedSearch=function(){s.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{color:m.sectionColor,fields:m.advancedSearch.fields,storagePath:"home.whatsapp"},fullscreen:!0}).then(function(e){m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply&&(m.query.search=e.value,g())}).catch(function(e){d.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},i.$on("$destroy",function(){l.removeAllListeners("whatsappMessage:save"),l.removeAllListeners("whatsappMessage:update"),l.removeAllListeners("whatsappInteraction:save"),l.removeAllListeners("whatsappInteractionTags:save"),l.removeAllListeners("whatsappInteraction:update"),l.removeAllListeners("user_has_whatsapp_interactions:save"),l.removeAllListeners("user_has_whatsapp_interactions:remove"),m.interactionsInterval&&n.cancel(m.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","draftManager"],angular.module("app.dashboards").controller("AgentHomeWhatsappController",e)}(),function(){"use strict";function e(e,n){var t=this;t.setting={},t.messages={count:0,rows:[]},t.showInteraction=!1,t.init=function(e,n){t.setting=n,t.tab=e,t.tab.saved=!0},t.getTrustedURL=function(){return n.trustAsResourceUrl(t.tab.src)}}e.$inject=["$scope","$sce"],angular.module("app.dashboards").controller("AgentGeneralIframeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this,f=25,b=1024*f*1024;function A(){var e=h.user.voicePause||h.user.chatPause||h.user.mailPause||h.user.openchannelPause||h.user.faxPause,n=!h.tab.interaction.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(t.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(){h.user&&h.interaction.Account.mandatoryDisposition&&!e&&l.user.unpause({id:h.user.id}).$promise.catch(function(e){d.error(e.data?e.data.message:e.toString())})},locals:{user:h.user,channel:h.tab.channel,interaction:h.tab.interaction}}).then(function(e){h.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(h.tab)})}function E(e,n){h.tab.message=n,i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:h.tab.message,type:e,interaction:h.interaction},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){if(e)if(e.message&&e.message.savedAsDraft)h.draft?p.update({id:h.draft.id,channel:"mail",account:h.account,message:e.message,contact:h.contact,interaction:h.interaction}):p.add({channel:"mail",account:h.account,message:e.message,contact:h.contact,interaction:h.interaction}),h.draft=p.getByInteraction(h.tab.interaction.id);else{var n=e;n&&S(n),n.Interaction&&h.interaction&&h.interaction.id&&(n.Interaction.id=h.interaction.id,l.mailInteraction.update(n.Interaction).$promise.then(function(e){e&&e.closed?(h.tab.saved=!0,h.interaction.closed=!0,A()):null!==n.Interaction.substatus&&(h.tab.saved=!0,h.tab.interaction.substatus=n.Interaction.substatus,a.$parent.$parent.$parent.vm.closeTab(h.tab))}).catch(function(e){d.error(e.data?e.data.message:e.toString())}))}}).finally(function(){h.tab.isDraft=!1})}function y(){"mail"!==h.tab.channel&&n(function(){var e=angular.element(t.find("md-content[name*='interaction-content-"+h.tab.id+"']"));e&&e[0]&&(e[0].scrollTop=e[0].scrollHeight)},0)}function S(i){if(i)return i["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"]=h.interaction["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"],i[_.capitalize(h.tab.channel)+"InteractionId"]=h.interaction.id,i.UserId=h.user.id,i.ContactId=h.interaction.ContactId,i.direction="out",i.secret=Boolean(h.tab.spy||i.secret),l[h.tab.channel+"Message"].save(i).$promise.then(function(e){if(e&&e.id&&!_.isEmpty(i.attachments)){for(var n=[],t=0;t<i.attachments.length;t++){var a=i.attachments[t];a.MailMessageId?n.push(l.attachment.clone({id:a.id},{name:a.name,basename:a.basename,type:a.type,MailMessageId:e.id}).$promise):n.push(l.attachment.update({id:a.id},{MailMessageId:e.id}).$promise)}return s.all(n)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SENDMESSAGE",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){"mail"===h.tab.channel&&i.isDraft&&(p.removeByInteraction(h.interaction.id),h.draft=null),h.tab.areaText="",y()})}function T(e){switch(h.tab.channel){case"mail":h.draft.content.originalMessage=e?_.find(h.interaction.Messages,["id",e]):h.interaction.Messages[h.interaction.Messages.length-1],E(h.draft.type,h.draft.content)}}function I(e){h.journeyIsLoading=!0;var n=_.merge(h.journeyOptions,{id:h.contact.id,offset:e||0});return g.get(h.journey,n).then(function(e){h.journey=e.journey,h.canLoadMoreJourney=e.loadMore}).finally(function(){h.journeyIsLoading=!1})}h.showFooter=!1,h.BTNLoadMore=0,h.showInteraction=!1,h.user=c.getCurrentUser(),h.detectBrowser=u.detectBrowser(),h.journey=[],h.acceptedMessages=[],h.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:b,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},h.ngFlow={flow:{}},h.selectedMailShowDetails={},h.selectedMailShowSystemMessage={},h.setting={},h.ctrlMethods={},h.embedOptions={fontSmiley:!0,sanitizeHtml:!0,emoji:!0,link:!0,linkTarget:"_blank"},h.journeyOptions=g.getQuery(),h.quickFilters=g.getQuickFilters(),h.init=function(e,n){h.tab=e,h.tab.saved=!0,h.tab.badges=0,h.setting=n||{},h.tab&&h.tab.channel&&h.tab.interaction&&(h.interaction=h.tab.interaction,l[h.tab.channel+"Interaction"].get({id:h.tab.interaction.id,includeAll:!0}).$promise.then(function(e){return e&&(h.interaction=e,h.tab.interaction=e),h.tab.saved=h.interaction.closed,h.queryMessage={id:h.interaction.id,includeAll:!0},"mail"===h.tab.channel?(h.queryMessage.sort="-id",h.queryMessage.offset=0,h.queryMessage.limit=3,h.queryMessage.inlineCss=!0):(h.queryMessage.sort="id",h.queryMessage.nolimit=!0),l[h.tab.channel+"Interaction"].getMessages(h.queryMessage).$promise}).then(function(e){return e&&(h.BTNLoadMore=e.count-h.queryMessage.limit),h.messages=e||{count:0,rows:[]},l["chat"===h.tab.channel?"chatWebsite":h.tab.channel+"Account"].get({id:h.interaction["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"]}).$promise}).then(function(e){if(h.account=e,h.tab.title=h.account.key||h.account.name,h.interaction.ContactId)return l.cmContact.get({id:h.interaction.ContactId}).$promise}).then(function(e){return e&&(h.contact=e),h.showInteraction=!0,h.contact?h.tab.title+=" - "+(h.user.privacyEnabled?v.mask(h.contact.firstName):h.contact.firstName):h.tab.title+=" - "+r.instant(h.tab.channel.toUpperCase()+".UNKNOWN"),l.user.get({fields:"id,fullname",nolimit:!0}).$promise}).then(function(e){h.users=e||{count:0,rows:[]},h.usersMap=_.mapValues(_.keyBy(h.users.rows,"id"),"fullname")}).then(function(){if(h.tab.channel&&h.interaction)return l.user["add"+_.upperFirst(h.tab.channel)+"Interactions"]({id:h.user.id,ids:[h.interaction.id]})}).then(function(){return l.mailSubstatus.get({sort:"name",nolimit:!0}).$promise}).then(function(e){h.subStatuses=e||{count:0,rows:[]}}).catch(function(){h.showInteraction=!0}).finally(function(){h.contact&&I(),function(){switch(h.user.role){case"admin":return h.downloadPermissions={attachments:!0,interactions:!0};case"agent":return h.downloadPermissions={attachments:h.user.downloadAttachments,interactions:h.user.downloadOmnichannelInteractions};case"user":l.userProfile.get({id:h.user.userProfileId,fields:"downloadAttachments,downloadOmnichannelInteractions"}).$promise.then(function(e){h.downloadPermissions={attachments:e.downloadAttachments,interactions:e.downloadOmnichannelInteractions}}).catch(function(){h.downloadPermissions={attachments:!1,interactions:!1}})}}(),function(){if(!h.tab.spy&&!h.interaction.closed){var t=[];if(h.messages.rows.forEach(function(e){if("in"===e.direction&&!e.read){var n=0===t.length;t.push(l[h.tab.channel+"Message"].accept({id:e.id,UserId:h.user.id,manual:n}).$promise),h.acceptedMessages.push(e.id)}}),"mail"===h.tab.channel){var e=_(h.interaction.Messages).filter({read:!1,direction:"in"}).differenceBy(h.messages.rows,"id").value();e.forEach(function(e){t.push(l.mailMessage.accept({id:e.id,UserId:h.user.id}).$promise),h.acceptedMessages.push(e.id)})}s.all(t)}}(),y(),m.on(h.tab.channel+"Message:save",h.onMessageSave),m.on(h.tab.channel+"Message:update",h.onMessageSave),m.on(h.tab.channel+"Interaction:save",h.onInteractionSave),m.on(h.tab.channel+"Interaction:update",h.onInteractionSave),m.on("user_has_"+h.tab.channel+"_interactions:save",h.onInteractionOpen),m.on("user_has_"+h.tab.channel+"_interactions:remove",h.onInteractionClose),h.tab.areaText=h.tab.areaText?h.tab.areaText:"",h.showFooter=!0,"mail"===h.tab.channel&&(h.draft=p.getByInteraction(h.tab.interaction.id),h.tab.isDraft&&(h.tab.interaction.closed?(p.removeByInteraction(h.tab.interaction.id),h.draft=null):T()))}))},h.getLabelByMessage=function(e){var n="loading...";if(e)return"in"===e.direction?e.Contact?e.Contact.firstName||"Anonymous":n:e.UserId?h.usersMap?h.usersMap[e.UserId]:n:"System"},h.openContact=function(e,n){try{h.tab&&!h.tab.spy&&a.$parent.$parent.$parent.vm.addContactTab(n||h.contact)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Unable to open the contact"})}},h.openInteraction=function(e){try{if(e.MailAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("mail",e);if(e.ChatWebsiteId)return a.$parent.$parent.$parent.vm.addInteractionTab("chat",e);if(e.SmsAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("sms",e);if(e.WhatsappAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("whatsapp",e);if(e.OpenchannelAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("openchannel",e);if(e.FaxAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("fax",e)}catch(e){d.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},h.disposeInteraction=A,h.tagInteraction=function(){i.show({controller:"TagInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,skipHide:Boolean(h.tab.spy),resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0,fields:"id,name,color"})}]},locals:{channel:h.tab.channel,interaction:h.tab.interaction}})},h.composeMailInteraction=function(n,e){if(e.inReplyTo){var t=_.find(h.messages.rows,{messageId:e.inReplyTo});if(!t)return l.mailMessage.get({messageId:e.inReplyTo}).$promise.then(function(e){E(n,e&&e.count?e.rows[0]:void 0)}).catch(function(e){d.error(e.data?e.data.message:e.toString()),E(n,void 0)});E(n,t)}else E(n,e)},h.composeFaxInteraction=function(e){var n={to:[]};n.to.push(h.contact.fax),i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0}).then(function(e){return l.faxAccount.send({id:h.account.id},e).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},h.composeSmsInteraction=function(e,n){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeWhatsappInteraction=function(e,n){i.show({controller:"ComposeWhatsappInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeChatInteraction=function(e,n){i.show({controller:"ComposeChatInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/chat/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeOpenchannelInteraction=function(e,n){i.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.transferLastMessage=function(){if(h.interaction){var e=_.findLast(h.messages.rows,function(e){return"in"===e.direction});e?i.show({controller:"TransferMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,interaction:h.interaction,message:e,channel:h.tab.channel},resolve:{agents:["apiResolver",function(e){var n={fields:"id,name",$id:{ne:h.user.id},role:"agent",online:!0,sort:"name",nolimit:!0};return n[h.tab.channel+"Pause"]=!1,e.resolve("user@get",n)}],queues:["apiResolver",function(e){return e.resolve(h.tab.channel+"Queue@get",{fields:"id,name",sort:"name",nolimit:!0})}]}}).then(function(e){h.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(h.tab)}):d.error({title:"Invalid transfer",msg:"Message not found!"})}},h.downloadMessage=function(s,e){h.tab.channel&&s.id&&l[h.tab.channel+"Message"].download({id:s.id,attachments:e}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=h.tab.channel+"-message"+s.id+".eml";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.downloadMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.downloadInteraction=function(s,e){h.tab.channel&&s.id&&l[h.tab.channel+"Interaction"].download({id:s.id,attachments:e}).$promise.then(function(e){var n=[e.buffer],t=h.tab.channel+"-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.inteactionMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.openDraft=T,h.createVidaooSession=function(e){var n={id:e.id,account:e.Account,contact:e.Contact};return l.chatInteraction.createVidaooSession(n).$promise.then(function(){d.success({title:"Start Video Call",msg:"Session properly created."})}).catch(function(){d.error({title:"Start Video Call",msg:"Unable to create session!"})})},h.reply=function(e,n){if(e&&13===e.keyCode&&e.shiftKey)return;if(e&&13!==e.keyCode)return;if(""===n.trim())return;S(function(e){var n={},t="chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId";n[t]=h.interaction[t].toString(),n[_.capitalize(h.tab.channel)+"InteractionId"]=h.interaction.id,("sms"===h.tab.channel||"whatsapp"===h.tab.channel)&&(n.phone=h.interaction.phone);e&&(n.UserId=h.user.id,n.ContactId=h.interaction.ContactId,n.body=e);return n}(n.trim()))},h.upload=function(){h.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},h.ngFlow.flow.upload()},h.fileAdded=function(e){if(e.size>b)return d.error({title:"File too big",msg:"The max allowed size is "+f+"MB"}),!1;return!0},h.fileSuccess=function(e,n){var t=JSON.parse(n),a=t.name;"chat"===h.tab.channel&&(a='<a href="'+(h.account.remote?h.account.remote:o.protocol()+"://"+o.host())+"/api/chat/interactions/"+h.interaction.id+"/attachment_download?attachId="+t.id+"&token="+h.account.token+'" target="_self">'+t.name+"</a>");S({body:a,AttachmentId:t.id})},h.onMessageSave=function(e){if(e&&h.interaction.id!=e[_.capitalize(h.tab.channel)+"InteractionId"])return;var n=!1;h.messages?n=_.find(h.messages.rows,{id:e.id}):h.messages={rows:[],count:0};n?_.merge(n,e):("mail"===h.tab.channel?h.messages.rows.unshift(e):h.messages.rows.push(e),y())},h.onInteractionSave=function(e){if(e&&h.interaction.id!==e.id)return;e.closed&&(h.tab.saved=!0);_.merge(h.interaction,e)},h.searchTextChange=function(n){var t=s.defer(),a=[],e={},i="chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId";return e.filter=n,e[i]=h.account.id,l.cannedAnswer.get(e).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},h.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:h.user,account:h.account,interaction:h.interaction,contact:h.interaction&&h.interaction.Contact?h.interaction.Contact:{}};""!==h.tab.areaText&&(h.tab.areaText+=" "),h.tab.areaText+=e(t),h.ctrlMethods.setText(h.tab.areaText)}catch(e){""!==h.tab.areaText&&(h.tab.areaText+=" "),h.tab.areaText+=n.value,h.ctrlMethods.setText(h.tab.areaText)}h.selectedItem=null,h.changeDisplayCannedAnswerInputValue()}},h.getMessagesAlignment=function(e){if(e.secret&&h.user.id!=e.UserId)return"in";switch(h.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}},h.displayCannedAnswerInput=!1,h.changeDisplayCannedAnswerInputValue=function(){h.displayCannedAnswerInput=!h.displayCannedAnswerInput},h.setAs=function(e){h.tab.channel&&h.interaction&&h.interaction.id&&l[h.tab.channel+"Interaction"].update({id:h.interaction.id,substatus:e}).$promise.catch(function(e){d.error(e.data?e.data.message:e.toString())})},h.markAsUnread=function(){if(h.tab.channel&&h.interaction&&h.interaction.id)if(h.acceptedMessages.length)for(var e=0;e<h.acceptedMessages.length;e+=1)l[h.tab.channel+"Message"].update({id:h.acceptedMessages[e],read:!1,UserId:null});else for(var n=0;n<h.messages.rows.length;n+=1)if("in"===h.messages.rows[n].direction){h.messages.rows[n].UserId===h.user.id?l[h.tab.channel+"Message"].update({id:h.messages.rows[n].id,read:!1,UserId:null}):d.error({title:"You can't mark as unread",msg:"You are not the owner of the last message!"});break}h.tab.saved=!0,a.$parent.$parent.$parent.vm.closeTab(h.tab)},h.getAttachments=function(n){return l.attachment.get({MailMessageId:n.id}).$promise.then(function(e){e&&e.rows&&(n.attachments=e.rows)}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},h.getAttachment=function(i){return l.attachment.download({id:i.id}).$promise.then(function(e){if(e){var n=new Blob([e.buffer],{type:e.type}),t=document.createElement("a"),a=window.URL.createObjectURL(n);t.href=a,t.target="_self",t.download=i.name,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},h.htmlToPlaintext=function(e){return e?String(e).replace(/<[^>]+>/gm,""):""},h.onInteractionOpen=function(e){var n;h.interaction.id==e[_.upperFirst(h.tab.channel)+"InteractionId"]&&(h.interaction.Users&&(n=_.find(h.interaction.Users,{id:e.UserId})),n||h.interaction.Users.push({id:e.UserId}))},h.onInteractionClose=function(e){h.interaction.id==e[_.upperFirst(h.tab.channel)+"InteractionId"]&&h.interaction.Users&&_.remove(h.interaction.Users,{id:e.UserId})},h.getCustomerJourney=I,h.loadNextPage=function(){var t=s.defer();if(h.queryMessage)return h.queryMessage.offset=h.messages.rows.length,l[h.tab.channel+"Interaction"].getMessages(h.queryMessage).$promise.then(function(e){for(var n=0;n<e.rows.length;n+=1)h.messages.rows.push(e.rows[n]),h.interaction.closed||"in"!==e.rows[n].direction||e.rows[n].read||(l[h.tab.channel+"Message"].accept({id:e.rows[n].id,UserId:h.user.id}),h.acceptedMessages.push(e.rows[n].id));return 0<e.rows.length&&(h.BTNLoadMore=h.BTNLoadMore-e.rows.length),t.resolve(e)}).catch(function(e){return t.reject(e)});return t.reject()},h.interactionTimelineOptions={scrollEl:"#interaction-content"},h.loadMoreJourney=function(){return s(function(e){var n=h.journey.length;return e(I(n))})},h.journeyTimelineOptions={scrollEl:"#journey-content"},a.$on("$destroy",function(){m.removeAllListeners(h.tab.channel+"Message:save"),m.removeAllListeners(h.tab.channel+"Message:update"),m.removeAllListeners(h.tab.channel+"Interaction:save"),m.removeAllListeners(h.tab.channel+"Interaction:update"),m.removeAllListeners("user_has_"+h.tab.channel+"_interactions:save"),m.removeAllListeners("user_has_"+h.tab.channel+"_interactions:remove")})}function n(a){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function(t){t.updateView=function(){var e,n=_.replace(t.ngBindHtmlUnsafe,'<div id="xm-mail-content"','<a style="cursor:pointer" class="toggle-details md-accent-color" onclick="document.getElementById(\''+(e="xm-mail-content-"+Math.floor(9999*Math.random()+1))+"').style.display='block'; this.parentNode.removeChild(this)\">See More</a><div id=\""+e+'" style="display:none"');t.trustedHtml=a.trustAsHtml(n)},t.$watch("ngBindHtmlUnsafe",function(e){t.updateView(e)})}}}e.$inject=["$cookies","$timeout","$document","$scope","$mdDialog","$q","$location","$translate","api","toasty","Auth","socket","msUtils","draftManager","customerJourneyManager","privacyManager"],n.$inject=["$sce"],angular.module("app.dashboards").directive("ngBindHtmlUnsafe",n).controller("AgentGeneralInteractionController",e)}(),function(){"use strict";angular.module("app.dashboards").factory("Emojis",function(){return{watchEmbedData:!1,sanitizeHtml:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank",pdf:{embed:!0},image:{embed:!0},audio:{embed:!0},basicVideo:!1,gdevAuth:"xxxxxxxx",video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,thumbnailQuality:"medium",autoPlay:!0},twitchtvEmbed:!0,dailymotionEmbed:!0,tedEmbed:!0,dotsubEmbed:!0,liveleakEmbed:!0,ustreamEmbed:!0,soundCloudEmbed:!0,soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},spotifyEmbed:!0,tweetEmbed:!0,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},code:{highlight:!0,lineNumbers:!1},codepenEmbed:!0,codepenHeight:300,jsfiddleEmbed:!0,jsfiddleHeight:300,jsbinEmbed:!0,jsbinHeight:300,plunkerEmbed:!0,githubgistEmbed:!0,ideoneEmbed:!0,ideoneHeight:300}})}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,ChatAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeChatInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=25,u=1024*m*1024;c.separatorKeys=[a.KEY_CODE.ENTER,a.KEY_CODE.COMMA,a.KEY_CODE.TAB],c.message={from:i.localstationid,to:_.isNil(s.to)||_.isEmpty(s.to)?[]:s.to,attachments:[]},c.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:u,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},c.ngFlow={flow:{}},c.send=function(e){1===c.message.attachments.length?c.message.to.length?(s.draft=void 0,t.hide({from:c.message.from,to:c.message.to,attach:c.message.attachments.length,attachments:c.message.attachments})):l.error("To is mandatory"):l.error("Attachment is mandatory")},c.upload=function(){c.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},c.ngFlow.flow.upload()},c.fileSuccess=function(e,n){try{(n=JSON.parse(n)).size=e.size,c.message.attachments.push(n)}catch(e){console.error(e)}},c.fileAdded=function(e){var n=["pdf","tif"];if(!_.includes(n,e.getExtension()))return l.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extensions: "+n.join()}),!1;if(e.size>u)return l.error({title:"File too big",msg:"The max allowed size is "+m+"MB"}),!1;return!0},c.getContact=function(e){var n="";e.firstName&&e.firstName!==e.fax&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.fax&&(n+=e.lastName+" ");return n+="<"+e.fax+">"},c.contactSearch=function(e){return i&&i.ListId?r.cmContact.get({ListId:i.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,fax"}).$promise.then(function(e){return e.rows}):[]},c.transformContact=function(e){var n=e;if(_.isObject(e))return e.fax;if(t=n,!/[&\/\\#,()$~%.'":;*?<>{}\s\\|a-zA-Z\pS!òàùè…_§°çéì-]/.test(t))return n;var t;return l.error("Fax "+n+" is not valid"),null},c.closeDialog=function(){s.draft=c.message,t.cancel()}}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q"],angular.module("app.dashboards").controller("ComposeFaxInteractionDialogController",e)}(),function(){"use strict";function e(n,e,i,t,a,s,o,r,l,d,c,m,u,p){var g=this,v=25,h=1024*v*1024;g.currentUser=m.getCurrentUser(),g.secret="note"===r,g.hiddenCC=!0,g.hiddenBCC=!0,g.verifySmtp=!0,g.errors=[],g.separatorKeys=[t.KEY_CODE.ENTER,t.KEY_CODE.COMMA,t.KEY_CODE.TAB],g.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,MailAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},g.selectedItemChange=function(n){if(n&&n.value&&g.ckEditorInstance)try{var e=_.template(n.value),t={user:g.currentUser,account:s,interaction:u,contact:u&&u.Contact?u.Contact:{}};g.ckEditorInstance.insertHtml(e(t))}catch(e){console.error(e),g.ckEditorInstance.insertHtml(n.value)}document.getElementById("html-area").focus(),g.selectedItem=null},g.onReadyEditor=function(e){try{g.ckEditorInstance=CKEDITOR.instances["html-area"]}catch(e){console.error("Unable to get Html Editor instance",e)}},_.templateSettings.interpolate=/{{([\s\S]+?)}}/g,g.fromTemplate=_.template("{{ name }} <{{ email }}>"),g.replyTemplate=_.template("On {{ date }}, at {{ time }}, {{ from }} wrote:"),g.forwardTemplate=_.template("Begin forwarded message:<br><br><strong>From:</strong> {{ from }}<br><strong>Subject:</strong> {{ subject }}<br><strong>Date:</strong> {{ date }}, at {{ time }}<br><strong>To:</strong> {{ to }}"),g.message={from:g.fromTemplate({name:s.name,email:s.email||s.Smtp.user}),to:[],cc:[],bcc:[],body:S(),type:r,attachments:[],showLastMessage:!0},g.draft=null,g.ckeditor={skin:"office2013",startupFocus:!0,language:"en",allowedContent:!0,extraPlugins:"font,colorbutton,autogrow,autoembed,autocorrect,googlethisterm,pastebase64",toolbarGroups:[{name:"styles",groups:["styles"]},{name:"clipboard",groups:["undo"]},{name:"colors",groups:["colors"]},{name:"basicstyles",groups:["basicstyles"]},{name:"paragraph",groups:["list","indent","align"]}],autoGrow_onStartup:!0,autoGrow_minHeight:g.secret?160:300,autoGrow_maxHeight:e.innerHeight-400,autocorrect_enabled:!0,disableNativeSpellChecker:!1,enterMode:CKEDITOR.ENTER_BR,font_defaultLabel:s.fontFamily?s.fontFamily.split(",")[0]:"Arial",fontSize_defaultLabel:s.fontSize||"12",removePlugins:"magicline"};for(var f=[],b=8;b<=72;b++)f.push(b+"/"+b+"pt");g.ckeditor.fontSize_sizes=f.join(";"),g.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:h,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},g.ngFlow={flow:{}},g.reply=function(e){angular.isDefined(o)&&(g.message.type="reply",g.message.to="in"===o.direction?o.from.split(","):o.to.split(","),g.message.subject=_.startsWith(o.subject,"Re:")?o.subject:"Re: "+o.subject,g.message.inReplyTo=o.messageId,g.message.body=S(),g.message.attachments=[],e&&o.cc&&(g.hiddenCC=!1,g.message.cc=o.cc.split(",")),g.message.showLastMessage=!1)},g.newMail=function(){angular.isDefined(o)&&(g.message.type="new",g.message.to=o.to?o.to.split(","):[])},g.forward=function(){if(angular.isDefined(o)){if(g.message.type="forward",g.message.subject=_.startsWith(o.subject,"Fwd:")?o.subject:"Fwd: "+o.subject,g.message.body=S(),o.Attachments&&o.Attachments.length)for(var e=0;e<o.Attachments.length;e++)g.message.attachments.push(o.Attachments[e]);g.message.showLastMessage=!1}},g.editDraft=function(){g.isDraft=!0,angular.isDefined(o)&&(o.savedAsDraft=!1,g.message=angular.copy(o),_.isEmpty(g.message.cc)||(g.hiddenCC=!1),_.isEmpty(g.message.bcc)||(g.hiddenBCC=!1))},g.send=function(e,n,t){if(!A&&g.message.to&&g.message.body)if(g.message.to.length)if(_.isEmpty(g.message.subject)){var a=i.confirm({skipHide:!0}).title("Warning").textContent("This message has no subject. Are you sure you want to send it?").ariaLabel("Warning").targetEvent(e).ok("Send Anyway").cancel("Cancel");i.show(a).then(function(){E(n,t)})}else E(n,t);else d.error("To is mandatory");A=!1},g.note=function(){g.type="note",g.secret=!0,g.message.body='<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'pt"><p></p></div>'},g.addNote=function(){g.message.body&&i.hide({secret:!0,body:g.message.body,attach:g.message.attachments.length,attachments:g.message.attachments})},g.upload=function(e){g.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+n.get("motion.token")},g.ngFlow.flow.upload()},g.fileSuccess=function(e,n){try{(n=JSON.parse(n)).size=e.size,g.message.attachments.push(n)}catch(e){console.error(e)}},g.removeAttachment=function(e){g.message.attachments=_.reject(g.message.attachments,{id:e.id}),e.MailMessageId||l.attachment.delete({id:e.id}).$promise.catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.attachment.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.fileAdded=function(e){if(e.size>h)return d.error({title:"File too big",msg:"The max allowed size is "+v+"MB"}),!1;return!0},g.getContact=function(e){var n="";e.firstName&&e.firstName!==e.email&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.email&&(n+=e.lastName+" ");return n+="<"+e.email+">"},g.contactSearch=function(e){return s&&s.ListId?l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,email"}).$promise.then(function(e){return e.rows}):[]},g.transformContact=function(e,n){if(_.isObject(e))return(g.contact=e).email;if(_.isString(e)){if(y(e))return g.contact={email:e},e;for(var t=e.split(","),a=0;a<t.length;a+=1)y(t[a])?_.isArray(n)&&_.indexOf(n,t[a])<0&&n.push(t[a]):d.error("Email "+t[a]+" is not valid");return g.contact={email:e.split(",")[0]},null}return d.error("Email field is not valid"),null},g.saveDraft=function(){g.message.savedAsDraft=!0,g.draft=p.getByInteraction(u.id);var e={account:s,message:g.message,contact:g.contact,interaction:u};if(g.draft&&!g.isDraft){var n=i.confirm({skipHide:!0}).title(a.instant("DASHBOARDS.DRAFT_SAVE_WARNING_TITLE")).content(a.instant("DASHBOARDS.DRAFT_SAVE_WARNING_MESSAGE")).ariaLabel("Save draft").ok(a.instant("DASHBOARDS.OVERWRITE")).cancel(a.instant("DASHBOARDS.CANCEL"));i.show(n).then(function(){i.hide(e)})}else i.hide(e)},g.closeDialog=function(){i.cancel()},g.loadLastMessage=function(){g.message.body+=T(g.message.type)};var A=!(g.keyPress=function(e){13===e.keyCode&&(A=!0)});switch(r){case"reply":g.reply(!1);break;case"replyAll":g.reply(!0);break;case"forward":g.forward();break;case"draft":g.editDraft();break;case"new":g.newMail();break;case"note":g.note()}function E(e,n){var t={from:g.message.from,to:g.message.to.join(","),cc:g.message.cc.join(","),bcc:g.message.bcc.join(","),subject:g.message.subject,body:g.message.showLastMessage?g.message.body:g.message.body+T(g.message.type),inReplyTo:g.message.inReplyTo,attach:g.message.attachments.length,attachments:g.message.attachments,Interaction:{lastMsgDirection:"out",substatus:n},isDraft:g.isDraft};t.html='<div id="xm-mail-content">'+_.replace(t.body,'<div id="xm-mail-content"',"<div")+"</div>",e&&(t.Interaction.closed=!0),i.hide(t)}function y(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function S(){return'<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'pt">'+function(){if(_.isNil(s.template))return"";try{return _.template(s.template)({user:g.currentUser,account:s,interaction:u,contact:u&&u.Contact?u.Contact:{}})}catch(e){return console.error(e),""}}()+"</div>"}function T(e){var n='<div id="xm-mail-content"><blockquote type="cite">';switch(e){case"reply":case"replyAll":n+=g.replyTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||""});break;case"forward":n+=g.forwardTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||"",to:_.escape(o.to)||"",subject:_.escape(o.subject)||""})}var t,a,i=g.message.showLastMessage&&o.originalMessage?o.originalMessage.body:o.body;return n+="<br><br>",n+=(t=i?_.replace(i,'<div id="xm-mail-content"',"<div"):"",(a=t.match(/\<body[^>]*\>([^]*)\<\/body/m))?a[1]:t),n+="</blockquote></div>",e?n:""}l.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){g.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),g.secret||l.mailAccount.verifySmtp({id:s.id}).$promise.catch(function(e){g.verifySmtp=!1,g.errors.push({message:e.data,type:e.status}),g.errors.push({message:"You can't reply or send an email. Please contact the administrator!",type:"500"})})}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","$translate","account","message","type","api","toasty","$q","Auth","interaction","draftManager"],angular.module("app.dashboards").controller("ComposeMailInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,OpenchannelAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e[s.mapKey]&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e[s.mapKey]&&(n+=e.lastName+" ");return n+="<"+e[s.mapKey]+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId){var n="firstName,lastName,phone,mobile";return s.mapKey&&(n+=","+s.mapKey),l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:n}).$promise.then(function(e){return e.rows})}return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e[s.mapKey];return n},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeOpenchannelInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,SmsAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeSmsInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,WhatsappAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeWhatsappInteractionDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.errors=[],r.dispositions=[],r.interaction=angular.copy(e),r.interaction.disposition||(r.interaction.disposition=null),r.channel=i,r.apiRoute=r.channel+"Interaction",r.apiAccountRoute=r.channel+("chat"===r.channel?"Website":"Account"),r.accountProperty=_.capitalize(r.channel)+("chat"===r.channel?"Website":"Account")+"Id",r.firstLevelDisposition=null,r.mandatoryDisposition=!1,r.mandatoryDispositionPause="",r.wasUserInPause=s.voicePause||s.chatPause||s.mailPause||s.openchannelPause||s.faxPause,r.onInit=function(){var n=[],t={fields:"id,name,level,ParentId",sort:"name",nolimit:!0};t[r.accountProperty]=e[r.accountProperty],a[r.apiAccountRoute].get({id:e[r.accountProperty]}).$promise.then(function(e){return r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name),a.disposition.get(t).$promise}).then(function(e){return e.rows.length&&(n=_.concat(n,e.rows)),a.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise}).then(function(e){e.rows.length&&(n=_.concat(n,e.rows))}).catch(function(e){console.error(e)}).finally(function(){r.dispositions=_.orderBy(n,["name"],["asc"]),r.mandatoryDisposition&&!r.wasUserInPause&&a.user.pause({id:s.id,type:r.mandatoryDispositionPause||"DEFAULT PAUSE"}).$promise.then(function(e){}).catch(function(e){console.error(e)})})},r.onDispositionChange=function(e){"first"===e?(r.anySecondLevelDisposition=!!r.firstLevelDisposition&&_.some(r.dispositions,["ParentId",r.firstLevelDisposition.id]),r.firstLevelDisposition||(r.secondLevelDisposition=void 0)):"second"===e&&(r.anyThirdLevelDisposition=_.some(r.dispositions,["ParentId",r.secondLevelDisposition.id]))},r.clearDispositionSelection=function(e){"second"===e?(r.secondLevelDisposition=void 0,r.thirdLevelDisposition=void 0):"third"===e&&(r.thirdLevelDisposition=void 0)},r.saveDisposition=function(){r.errors=[],r.interaction.UserId=s.id,r.interaction.closed=!0,r.interaction.closeReason="agent",r.interaction.disposition=r.firstLevelDisposition?r.firstLevelDisposition.name:null,r.interaction.secondDisposition=r.secondLevelDisposition?r.secondLevelDisposition.name:void 0,r.interaction.thirdDisposition=r.thirdLevelDisposition?r.thirdLevelDisposition.name:void 0,a[r.apiRoute]?a[r.apiRoute].update(_.pick(r.interaction,["MailAccountId","FaxAccountId","SmsAccountId","WhatsappAccountId","ChatWebsiteId","OpenchannelAccountId","closed","closeReason","disposition","secondDisposition","thirdDisposition","id","note","UserId"])).$promise.then(function(e){r.interaction=e,"mail"===r.channel&&o.removeByInteraction(r.interaction.id),t.success({title:"Interaction properly closed!",msg:"Interaction has been closed!"})}).then(function(){l(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})}):l(!1)},r.closeDialog=l}e.$inject=["$mdDialog","toasty","api","interaction","channel","user","draftManager"],angular.module("app.dashboards").controller("DisposeInteractionDialogController",e)}(),function(){"use strict";function e(n,t,e,a,i,s){var o=this;function r(e){n.hide(e)}o.errors=[],o.tags=s,o.interaction=angular.copy(a),o.interaction.Tags=_.map(o.interaction.Tags,function(e){return{id:e.id,name:e.name,color:e.color}}),o.channel=i,o.autocompleteRequireMatch=!0,o.saveTag=function(){{if(o.errors=[],e[o.apiRoute])return e[o.apiRoute].addTags({id:o.interaction.id,ids:_.map(o.interaction.Tags,"id")}).$promise.then(function(){t.success({title:"Interaction properly tagged!",msg:"Interaction has been tagged!"}),a.Tags=o.interaction.Tags,r(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})});r(!1)}},o.closeDialog=r,o.apiRoute=o.channel+"Interaction"}e.$inject=["$mdDialog","toasty","api","interaction","channel","tags"],angular.module("app.dashboards").controller("TagInteractionDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l,d){var c=this;function m(e){n.hide(e)}c.channel=s.toLowerCase(),c.message=o,c.account=r,c.agents=l,c.queues=d,c.transfer={id:0,type:c.account.queueTransfer?"queue":"agent"},c.onTransfer=function(){m(!0),e(function(){var e="agent"===c.transfer.type?"agentNotify":c.channel+"QueueNotify";return a.rpc[e]({id:c.transfer.id,messageId:c.message.id,channel:c.channel}).$promise.then(function(){i.success({title:t.instant("DASHBOARDS.INFO"),msg:"queue"===c.transfer.type?t.instant("DASHBOARDS.NOTIFICATIONS.TRANSFER_QUEUE_EXECUTED"):t.instant("DASHBOARDS.NOTIFICATIONS.TRANSFER_AGENT_EXECUTED")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.rpc.notify"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.rpc.notify",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},5e3)},c.closeDialog=m}e.$inject=["$mdDialog","$timeout","$translate","api","toasty","channel","message","account","agents","queues"],angular.module("app.dashboards").controller("TransferMessageDialogController",e)}(),function(){"use strict";function e(i,m,s,e,u,o,r,t,n,a,l){var p=this;function d(){try{i.$parent.$parent.$parent.vm.updateLocalStorage()}catch(e){o.error({title:"ERROR UPDATE LOCAL TABS",msg:"Error updating locally stored tabs"})}}function c(t,e){var n,a,l=[],d=[],c=r.getCurrentUser();(n=c,a=m.defer(),p.project.sendUnpauseOnSubmit?u.user.unpause({id:n.id}).$promise.then(function(e){a.resolve()}).catch(function(e){console.log("err"),a.resolve()}):a.resolve(),a.promise).then(function(){return u.jscriptySessionReport.save({starttime:p.starttime,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,VoiceQueueId:p.call&&p.call["xmd-voicequeueid"]?p.call["xmd-voicequeueid"]:void 0,ProjectId:p.project&&p.project.id?p.project.id:void 0,projectname:p.project&&p.project.name?p.project.name:void 0,ContactId:p.contact&&p.contact.id?p.contact.id:void 0,completed:e}).$promise}).then(function(e){if(e)for(var n=p.getResponseSheetHeaders(),t=p.getResponseSheetRow(),a=p.getQuestionWithResponseList(),i=0;i<n.length;i+=1)if(!_.isEmpty(String(t[i]))){try{l.push(u.jscriptyQuestionReport.save({question:n[i],answer:"date"===a[i].type?moment(String(t[i])).format("YYYY-MM-DD"):"time"===a[i].type?moment(String(t[i])).format("HH:mm"):String(t[i]),questionId:a[i].id,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,SessionId:e.id,ProjectId:p.project.id,projectname:p.project.name}))}catch(e){console.error("Unable to convert question",e)}for(var s=String(t[i]).split(";"),o=0;o<s.length;o+=1){var r=s[o].trim();try{d.push(u.jscriptyAnswerReport.save({question:n[i],questionId:a[i].id,answer:"date"===a[i].type?moment(r).format("YYYY-MM-DD"):"time"===a[i].type?moment(r).format("HH:mm"):r,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,SessionId:e.id,ProjectId:p.project.id,projectname:p.project.name}))}catch(e){console.error("Unable to convert answer",e)}}}return m.all(l).then(function(){return m.all(d).then(function(){return e})})}).then(function(e){e?t.resolve(!0):t.reject()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()});t.reject()})}p.formViewer={},p.showResetButton=!0,p.showIncompleteSubmitButton=!1,p.detectBrowser=l.detectBrowser(),p.onSubmit=function(e,n){var t=m.defer();if(n){var a=s.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("YES").cancel("NO");s.show(a).then(function(){c(t,!1)},function(){t.resolve()})}else c(t,!0);return t.promise.then(function(e){e&&(o.success({title:"Session saved",msg:"Your survey session has been properly saved!"}),function(e){try{i.$parent.$parent.$parent.vm.removeTab(e)}catch(e){o.error({title:"ERROR REMOVE TAB",msg:"Error while removing tab"})}}(p.tab))}).catch(function(e){o.error({title:"Session save error",msg:"There has been an error while trying to save your survey session!"})})},p.openContact=function(e,n){try{i.$parent.$parent.$parent.vm.addContactTab(n)}catch(e){o.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},p.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0},p.getResponseSheet=function(){return e.getResponseSheet(p.project.formData,p.project.responseData,!1)},p.getResponseSheetRow=function(){return e.getResponseSheetRow(p.project.formData,p.project.responseData)},p.getResponseSheetHeaders=function(){return e.getResponseSheetHeaders(p.project.formData,!1)},p.getQuestionWithResponseList=function(){return e.getQuestionWithResponseList(p.project.formData,p.project.responseData)},p.init=function(e){p.tab=e,p.tab&&(p.call=p.tab.call,p.starttime=p.tab.openedAt,p.contact=p.tab.contact,p.project=p.tab.project,p.project&&(_.isObjectLike(p.project.formData)?p.project.formData=p.project.formData:p.isJsonString(p.project.formData)?p.project.formData=JSON.parse(p.project.formData):p.project.formData=void 0,p.project.responseData=p.project.responseData||{},void 0!==p.project.currentPage&&a(function(){n.$broadcast("mwForm.pageEvents.changePage",{page:p.project.currentPage})}),i.$on("mwForm.pageEvents.pageCurrentChanged",function(e,n){if(n.currentPage&&(p.project.currentPage=n.currentPage.number-1,d(),p.project.enableUncompleteSave&&(1<=n.currentPage.number&&n.currentPage.number<p.project.formData.pages.length?p.showIncompleteSubmitButton=!0:p.showIncompleteSubmitButton=!1),p.project.formData&&p.project.formData.pages))for(var t=0,a=p.project.formData.pages.length;t<a;t++)if(n.currentPage.number<t+1&&p.project.formData.pages[t].elements)for(var i=0,s=p.project.formData.pages[t].elements.length;i<s;i++)"question"===p.project.formData.pages[t].elements[i].type&&p.project.formData.pages[t].elements[i].question&&delete p.project.responseData[p.project.formData.pages[t].elements[i].question.id]})))},p.resetViewer=function(e){if(p.formViewer.reset){var n=s.confirm().title(t.instant("JSCRIPTY.DO_YOU_WANT_TO_RESET_SESSION")).content(t.instant("JSCRIPTY.ALL_SURVEY_DATA_WILL_BE_LOST")).textContent("").ariaLabel("survey").targetEvent(e).ok(t.instant("JSCRIPTY.YES")).cancel(t.instant("JSCRIPTY.NO"));s.show(n).then(function(){p.showIncompleteSubmitButton=!1,p.project.currentPage=void 0,d(),p.formViewer.reset()})}}}e.$inject=["$scope","$q","$mdDialog","mwFormResponseUtils","api","toasty","Auth","$translate","$rootScope","$timeout","msUtils"],angular.module("app.dashboards").controller("AgentGeneralJscriptyController",e)}(),function(){"use strict";function e(t,a,e,n,i){var s=this;function o(){return function(e){if(404===e.status)a.info({title:t.instant("DASHBOARDS.ATTENTION"),msg:t.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}s.notification=e,s.user=i.getCurrentUser(),s.accept=function(e){{if(n[s.notification.channel+"Message"])return n[s.notification.channel+"Message"].accept({id:s.notification.id,UserId:s.user.id,manual:!0}).$promise.then(function(e){a.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(o());a.error({title:"API:ERROR",msg:"API accept message not found: "+s.notification.channel+"Message"})}},s.reject=function(e){{if(n[s.notification.channel+"Message"])return n[s.notification.channel+"Message"].reject({id:s.notification.id,UserId:s.user.id}).$promise.then(function(e){a.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(o());a.error({title:"API:ERROR",msg:"API reject message not found: "+s.notification.channel+"Message"})}}}e.$inject=["$translate","toasty","notification","api","Auth"],angular.module("app.dashboards").controller("NotificationController",e)}(),function(){"use strict";angular.module("app.dashboards").controller("AgentGeneralPopupController",function(){var n=this;n.init=function(e){n.tab=e,n.tab&&(n.tab.saved=!0,n.html=n.tab.html)}})}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&"abandoned"===e.disposition?(i.inbound.abandoned+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&!e.UserId&&e.disposition?(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.chatWebsites,{id:_.toNumber(e.ChatWebsiteId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.chatWebsites=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("chatInteraction:save",i.onSaveChatInteraction),n.on("chatInteraction:update",i.onUpdateChatInteraction),function(){if(0<Object.keys(i.chatWebsites).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("chatInteraction:save"),n.removeAllListeners("chatInteraction:update")})}e.$inject=["$scope","socket","chatInteractions","chatWebsites"],angular.module("app.dashboards").controller("UserChatDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){var l=this;function d(){s({queues:l.outboundQueues,rpcQueues:l.rpcQueues}).then(function(e){l.inbound=e})}function c(){o({rpcCampaigns:l.rpcCampaigns}).then(function(e){l.ivr=e})}l.outboundQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},l.rpcCampaigns=r?_.keyBy(r.rows?r.rows:[],"id"):{},l.ivr={originated:0,limitCalls:0},l.inbound={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0},l.onSaveQueue=function(e){l.outboundQueues[e.id]&&l.rpcQueues[e.id]&&(l.rpcQueues[e.id]=e)},l.onSaveCampaign=function(e){l.rpcCampaigns[e.id]&&(l.rpcCampaigns[e.id]=e)},t.onWithoutApply("voice_queue:save",l.onSaveQueue),l.interval=n(function(){d(),c()},999),t.onWithoutApply("campaign:save",l.onSaveCampaign),d(),c(),e.$on("$destroy",function(){t.removeListener("voice_queue:save",l.onSaveQueue),t.removeAllListeners("campaign:save"),l.interval&&n.cancel(l.interval)})}e.$inject=["$scope","$interval","socket","outboundQueues","rpcQueues","initializeRealtimeQueue","initializeRealtimeCampaign","rpcCampaigns"],angular.module("app.dashboards").controller("UserVoiceDashboardDialerController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.faxAccounts,{id:_.toNumber(e.FaxAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.faxAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("faxInteraction:save",i.onSaveFaxInteraction),n.on("faxInteraction:update",i.onUpdateFaxInteraction),function(){if(0<Object.keys(i.faxAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("faxInteraction:save"),n.removeAllListeners("faxInteraction:update")})}e.$inject=["$scope","socket","faxInteractions","faxAccounts"],angular.module("app.dashboards").controller("UserFaxDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.mailAccounts,{id:_.toNumber(e.MailAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.mailAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("mailInteraction:save",i.onSaveMailInteraction),n.on("mailInteraction:update",i.onUpdateMailInteraction),function(){if(0<Object.keys(i.mailAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("mailInteraction:save"),n.removeAllListeners("mailInteraction:update")})}e.$inject=["$scope","socket","mailInteractions","mailAccounts"],angular.module("app.dashboards").controller("UserMailDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.openchannelAccounts,{id:_.toNumber(e.OpenchannelAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.openchannelAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("openchannelInteraction:save",i.onSaveOpenchannelInteraction),n.on("openchannelInteraction:update",i.onUpdateOpenchannelInteraction),function(){if(0<Object.keys(i.openchannelAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("openchannelInteraction:save"),n.removeAllListeners("openchannelInteraction:update")})}e.$inject=["$scope","socket","openchannelInteractions","openchannelAccounts"],angular.module("app.dashboards").controller("UserOpenchannelDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.smsAccounts,{id:_.toNumber(e.SmsAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.smsAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("smsInteraction:save",i.onSaveSmsInteraction),n.on("smsInteraction:update",i.onUpdateSmsInteraction),function(){if(0<Object.keys(i.smsAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("smsInteraction:save"),n.removeAllListeners("smsInteraction:update")})}e.$inject=["$scope","socket","smsInteractions","smsAccounts"],angular.module("app.dashboards").controller("UserSmsDashboardGeneralController",e)}(),function(){"use strict";function e(t){var i=[],s=function(){var t=i[0],a={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,originated:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0};_.forIn(t.queues,function(e,n){t.rpcQueues[n]&&(a.waiting+=t.rpcQueues[n].waiting||0,a.talking+=(t.rpcQueues[n].talking||0)+(t.rpcQueues[n].pTalking||0),a.answered+=t.rpcQueues[n].answered||0,a.abandoned+=t.rpcQueues[n].abandoned||0,a.sumHoldTime+=t.rpcQueues[n].sumHoldTime||0,a.sumBillable+=t.rpcQueues[n].sumBillable||0,a.total+=t.rpcQueues[n].total||0,a.originated+=t.rpcQueues[n].originated||0,a.outboundDropCallsDayCallersExit+=t.rpcQueues[n].outboundDropCallsDayCallersExit||0,a.outboundDropCallsDayTimeout+=t.rpcQueues[n].outboundDropCallsDayTimeout||0)});var e=a.total-a.answered-a.abandoned;a.unmanaged=0<e?e:0,a.avgHoldTime=Math.round(0<a.total?a.sumHoldTime/a.total:0),a.avgHoldTime=new Date(1e3*a.avgHoldTime).toISOString().substr(11,8),a.avgTalkTime=Math.round(0<a.answered?a.sumBillable/a.answered:0),a.avgTalkTime=new Date(1e3*a.avgTalkTime).toISOString().substr(11,8),a.answerRate=Math.round((0<a.total?a.answered/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.abandonRate=Math.round((0<a.total?a.abandoned/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundDropRate=Math.round((0<a.total?a.outboundDropCallsDayTimeout/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundAbandonRate=Math.round((0<a.total?a.outboundDropCallsDayCallersExit/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundanswerRate=0<100-a.outboundDropRate-a.outboundAbandonRate&&a.total?100-a.outboundDropRate-a.outboundAbandonRate:0,i.shift(),t.defer.resolve(a),0<i.length&&s()};return function(e){var n=t.defer();return i.push({queues:e.queues,rpcQueues:e.rpcQueues,defer:n}),1===i.length&&s(),n.promise}}function n(t){var i=[],s=function(){var t=i[0],a={originated:0,limitCalls:0};_.forIn(t.rpcCampaigns,function(e,n){t.rpcCampaigns[n]&&(a.originated+=t.rpcCampaigns[n].originated||0,a.limitCalls+=t.rpcCampaigns[n].limitCalls||0)}),i.shift(),t.defer.resolve(a),0<i.length&&s()};return function(e){var n=t.defer();return i.push({rpcCampaigns:e.rpcCampaigns,defer:n}),1===i.length&&s(),n.promise}}function t(t,a,e){var i=this;i.license=e,i.onInit=function(){if(i.hasDashboardPermissions=!a.hasRole("user")||a.hasPermission(101),i.hasDashboardPermissions){var e=t.current.name;switch(e){case"app.dashboards.general":n=[],i.license.voice&&n.push("app.dashboards.general.voice"),i.license.dialer&&n.push("app.dashboards.general.dialer"),i.license.chat&&n.push("app.dashboards.general.chat"),i.license.mail&&n.push("app.dashboards.general.mail"),i.license.messaging&&n.push("app.dashboards.general.sms"),i.license.openchannel&&n.push("app.dashboards.general.openchannel"),i.license.fax&&n.push("app.dashboards.general.fax"),i.license.whatsapp&&n.push("app.dashboards.general.whatsapp"),0<n.length&&t.go(_.first(n));break;case"app.dashboards.general.voice":i.selectedTab=0;break;case"app.dashboards.general.dialer":i.selectedTab=1;break;case"app.dashboards.general.chat":i.selectedTab=2;break;case"app.dashboards.general.mail":i.selectedTab=3;break;case"app.dashboards.general.sms":i.selectedTab=4;break;case"app.dashboards.general.openchannel":i.selectedTab=5;break;case"app.dashboards.general.fax":i.selectedTab=6;break;case"app.dashboards.general.whatsapp":i.selectedTab=7}}var n}}e.$inject=["$q"],n.$inject=["$q"],t.$inject=["$state","Auth","license"],angular.module("app.dashboards").factory("initializeRealtimeQueue",e).factory("initializeRealtimeCampaign",n).controller("UserDashboardGeneralController",t)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(){s({queues:o.inboundQueues,rpcQueues:o.rpcQueues}).then(function(e){o.inbound=e})}o.inboundQueues=t?_.keyBy(t.rows?t.rows:[],"id"):{},o.rpcQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},o.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},o.outbound=i||{answered:0,sumBillable:0,sumDuration:0,sumHoldTime:0,total:0},o.onSaveQueue=function(e){o.inboundQueues[e.id]&&o.rpcQueues[e.id]&&(o.rpcQueues[e.id]=e,r())},o.onSaveOutbound=function(e){o.outbound=e},n.on("voice_queue:save",o.onSaveQueue),n.on("voice_outbound:save",o.onSaveOutbound),r(),e.$on("$destroy",function(){n.removeListener("voice_queue:save",o.onSaveQueue),n.removeAllListeners("voice_outbound:save")})}e.$inject=["$scope","socket","inboundQueues","rpcQueues","outbound","initializeRealtimeQueue"],angular.module("app.dashboards").controller("UserVoiceDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.whatsappAccounts,{id:_.toNumber(e.WhatsappAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.whatsappAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveWhatsappInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateWhatsappInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("whatsappInteraction:save",i.onSaveWhatsappInteraction),n.on("whatsappInteraction:update",i.onUpdateWhatsappInteraction),function(){if(0<Object.keys(i.whatsappAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("whatsappInteraction:save"),n.removeAllListeners("whatsappInteraction:update")})}e.$inject=["$scope","socket","whatsappInteractions","whatsappAccounts"],angular.module("app.dashboards").controller("UserWhatsappDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXACCOUNT",g.faxAccount=angular.copy(l),g.faxAccounts=r,g.newFaxAccount=!1,g.faxAccount||(g.faxAccount={waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="FAX.NEW_FAXACCOUNT",g.newFaxAccount=!0),n.params.id&&(g.faxAccount.FaxAccountId=n.params.id),g.addNewFaxAccount=function(){g.errors=[],d.faxAccount.addAccountApplications(g.faxAccount).$promise.then(function(e){g.faxAccounts.unshift(e.toJSON()),o.success({title:"FaxAccount properly created",msg:g.faxAccount.name?g.faxAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxAccount=function(){g.errors=[],d.faxAccount.updateAccountApplications(g.faxAccount).$promise.then(function(e){var n=_.find(g.faxAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FaxAccount properly saved!",msg:g.faxAccount.name?g.faxAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The faxAccount will be deleted.").ariaLabel("Delete FaxAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.faxAccount.delete({id:g.faxAccount.id}).$promise.then(function(){_.remove(g.faxAccounts,{id:g.faxAccount.id}),o.success({title:"FaxAccount properly deleted!",msg:(g.faxAccount.name||"faxAccount")+" has been deleted!"}),v(g.faxAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),t=null;if(g.faxAccount&&(t=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.trunks,{id:t.id});a.canSelect=!1,n.push(a)}g.trunks=n})}else{var t=[],a=null;g.faxAccount&&(a=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,t.push(g.trunks[i]));g.trunks=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.faxAccount&&(t=_.find(g.lists,{id:Number(g.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.faxAccount&&(a=_.find(g.lists,{id:Number(g.faxAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxAccounts","faxAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.faxAccountApps.rows.length){var t=r.faxAccountApps.rows[n]?r.faxAccountApps.rows[n]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccountApp:t,faxAccount:r.faxAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.faxAccountApps.rows[n]=e:r.faxAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.faxAccountApps.rows.length;t++,0){var a=r.faxAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.faxAccount.context,a.exten=r.faxAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.faxAccount.addApplications({id:r.faxAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.faxAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.faxAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.faxAccount={},r.faxAccountApps={count:0,rows:[]},r.selectedFaxAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"FaxQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"faxQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:901}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.faxAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getFaxAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.faxAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getFaxAccountApps=function(){r.promise=o.faxAccount.getApplications(r.query,t).$promise},r.editFaxAccountApp=n,r.editInterval=function(e,n){if(r.faxAccountApps.rows.length){var t=r.faxAccountApps.rows[n]?r.faxAccountApps.rows[n]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteFaxAccountApp=function(e){_.remove(r.faxAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedFaxAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedFaxAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedFaxAccountApps.forEach(function(e){_.remove(r.faxAccountApps.rows,{id:e.id})}),r.selectedFaxAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.fax").controller("FaxAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxAccount.getAgents({id:c.faxAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserFaxAccount?"penalty "+e.UserFaxAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.faxAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxAccount.removeAgents({id:c.faxAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxAccount.addAgents({id:c.faxAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","faxAccount","faxAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditFaxAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("fax")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:901}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountApptagDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.faxAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.faxAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.FaxAccountId=m.faxAccount.id,m.query.id=m.faxAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.faxAccount.id,field:"FaxAccountId",route:"faxAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.fax").controller("FaxAccountDispositionsController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"faxAccount",action:"getDispositions",field:"name",params:{id:m.faxAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.faxAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.faxAccountInteractions.rows.length;n+=1){var t=m.faxAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.faxInteraction.get(m.query,p).$promise}function v(e){d.faxInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.faxAccountInteractions.rows,{id:e.id}),m.faxAccountInteractions.count-=1,m.faxAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.fax):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.faxAccount={},m.faxAccountInteractions={count:0,rows:[]},m.selectedFaxAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.faxAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.FaxAccountId=m.faxAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.faxInteractionDownload=function(s,e,n){return d.faxInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="fax-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getFaxAccountInteractions=g,m.createOrEditFaxAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:m.faxAccount,interaction:n,interactions:m.faxAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spyfaxInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"fax",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"fax.faxAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||FaxAccountId:=$eq["+m.faxAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedFaxAccountInteractions=function(){var e=angular.copy(m.selectedFaxAccountInteractions);return m.selectedFaxAccountInteractions=[],e},m.deleteFaxAccountInteraction=v,m.deleteSelectedFaxAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedFaxAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedFaxAccountInteractions.forEach(function(e){v(e)}),m.selectedFaxAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountInteractionsController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=n,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=e.protocol()+"://"+e.host(),p.faxAccount=c||t.params.faxAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=t.params.tab||0,p.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.accounts",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.accounts",{})}},p.agentadddialog=function(e,n){a.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:p.faxAccounts?p.faxAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoFaxAccounts=function(){t.go("app.fax.faxAccounts",{},{reload:"app.fax.faxAccounts"})},p.saveFaxAccount=function(){r.faxAccount.updateAccountApplications(p.faxAccount).$promise.then(function(){l.success({title:"FaxAccount updated!",msg:p.faxAccount.name?p.faxAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.trunks,{id:e.resourceId})}),t=null;if(p.faxAccount&&(t=_.find(p.trunks,{id:Number(p.faxAccount.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.trunks,{id:t.id});a.canSelect=!1,n.push(a)}p.trunks=n})}else{var t=[],a=null;p.faxAccount&&(a=_.find(p.trunks,{id:Number(p.faxAccount.TrunkId)}));for(var i=0;i<p.trunks.length;i++)a&&p.trunks[i].id===a.id&&(p.trunks[i].canSelect=!1,t.push(p.trunks[i]));p.trunks=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.faxAccount&&(t=_.find(p.lists,{id:Number(p.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.faxAccount&&(a=_.find(p.lists,{id:Number(p.faxAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxAccount","userProfile","userProfileSection"],angular.module("app.fax").controller("FaxAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.faxAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="faxAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFaxAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.arrayecm=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayminrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymaxrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytech=_.keyBy([{option:"SIP",value:"'SIP'"},{option:"IAX",value:"'IAX'"},{option:"DADHI",value:"'DADHI'"},{option:"KHOMP",value:"'KHOMP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.fax.faxAccounts.edit",{id:e.id,faxAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.fax.faxAccounts.edit",{id:e.id,tab:5})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.accounts",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.accounts",{})}},f.agentadddialog=function(e,n){i.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:f.faxAccounts?f.faxAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("faxAccount")+"?").htmlContent("<b>"+(e.name||"faxAccount")+"</b> will be deleted.").ariaLabel("delete faxAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFaxAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.faxAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FaxAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFaxAccount=function(e,n){i.show({controller:"CreateOrEditFaxAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:n,faxAccounts:f.faxAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFaxAccount=y,f.exportSelectedFaxAccounts=function(){var e=angular.copy(f.selectedFaxAccounts);return f.selectedFaxAccounts=[],e},f.deleteSelectedFaxAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected faxAccounts?").htmlContent("<b>"+f.selectedFaxAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FaxAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFaxAccounts.forEach(function(e){y(e)}),f.selectedFaxAccounts=[]})},f.deselectFaxAccounts=function(){f.selectedFaxAccounts=[]},f.selectAllFaxAccounts=function(){f.selectedFaxAccounts=f.faxAccounts.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})}),a=null;a=[],f.faxAccounts.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.trunks,{id:e.id});n.canSelect=!1,t.push(n)}}),f.trunks=t})}else{var t=[],a=[];f.faxAccounts.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)});for(var i=0;i<f.trunks.length;i++){_.some(a,{id:f.trunks[i].id})&&(f.trunks[i].canSelect=!1,t.push(f.trunks[i]))}f.trunks=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.faxAccount&&(t=_.find(f.lists,{id:Number(f.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.faxAccount&&(a=_.find(f.lists,{id:Number(f.faxAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.faxAccounts=e||{count:0,rows:[]}}function y(e){m.faxAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.faxAccounts.rows,{id:e.id}),f.faxAccounts.count-=1,f.faxAccounts.rows.length||f.getFaxAccounts(),p.success({title:_.startCase("FaxAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFaxAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.fax").controller("FaxAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXQUEUE",g.faxQueue=angular.copy(l),g.faxQueues=r,g.newFaxQueue=!1,g.faxQueue||(g.faxQueue={strategy:"beepall",timeout:10},g.title="FAX.NEW_FAXQUEUE",g.newFaxQueue=!0),g.addNewFaxQueue=function(){g.errors=[],d.faxQueue.save(g.faxQueue).$promise.then(function(e){g.faxQueues.unshift(e.toJSON()),o.success({title:"FaxQueue properly created",msg:g.faxQueue.name?g.faxQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxQueue=function(){g.errors=[],d.faxQueue.update({id:g.faxQueue.id},g.faxQueue).$promise.then(function(e){var n=_.find(g.faxQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FaxQueue properly saved!",msg:g.faxQueue.name?g.faxQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The faxQueue will be deleted.").ariaLabel("Delete FaxQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.faxQueue.delete({id:g.faxQueue.id}).$promise.then(function(){_.remove(g.faxQueues,{id:g.faxQueue.id}),o.success({title:"FaxQueue properly deleted!",msg:(g.faxQueue.name||"faxQueue")+" has been deleted!"}),v(g.faxQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxQueues","faxQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxQueue.getAgents({id:c.faxQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.faxQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.removeAgents({id:c.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.addAgents({id:c.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","faxQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxQueue.getTeams({id:l.faxQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.faxQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("FAX.ALL_TEAMS"),labelSelected:t.instant("FAX.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.removeTeams({id:l.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.addTeams({id:l.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.faxQueue=c||e.params.faxQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoFaxQueues=function(){e.go("app.fax.faxQueues",{},{reload:"app.fax.faxQueues"})},u.saveFaxQueue=function(){r.faxQueue.update({id:u.faxQueue.id},u.faxQueue).$promise.then(function(){l.success({title:"FaxQueue updated!",msg:u.faxQueue.name?u.faxQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxQueue","userProfileSection"],angular.module("app.fax").controller("FaxQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.faxQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="faxQueues",f.listOrder="",f.listOrderAsc=null,f.selectedFaxQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.fax.faxQueues.edit",{id:e.id,faxQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:f.faxQueues?f.faxQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:f.faxQueues?f.faxQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("faxQueue")+"?").htmlContent("<b>"+(e.name||"faxQueue")+"</b> will be deleted.").ariaLabel("delete faxQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.queues",{})}},f.success=E,f.getFaxQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.faxQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FaxQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFaxQueue=function(e,n){i.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:n,faxQueues:f.faxQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFaxQueue=y,f.exportSelectedFaxQueues=function(){var e=angular.copy(f.selectedFaxQueues);return f.selectedFaxQueues=[],e},f.deleteSelectedFaxQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected faxQueues?").htmlContent("<b>"+f.selectedFaxQueues.length+" selected</b> will be deleted.").ariaLabel("delete FaxQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFaxQueues.forEach(function(e){y(e)}),f.selectedFaxQueues=[]})},f.deselectFaxQueues=function(){f.selectedFaxQueues=[]},f.selectAllFaxQueues=function(){f.selectedFaxQueues=f.faxQueues.rows};var b=!0,A=1;function E(e){f.faxQueues=e||{count:0,rows:[]}}function y(e){m.faxQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.faxQueues.rows,{id:e.id}),f.faxQueues.count-=1,f.faxQueues.rows.length||f.getFaxQueues(),p.success({title:_.startCase("FaxQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFaxQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.fax").controller("FaxQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){_.forIn(p.faxAccounts,function(e,n){p.rpcFaxAccounts[n]&&_.merge(e,p.rpcFaxAccounts[n])}),_.forIn(p.faxAccounts,function(n,e){var t={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),fields:"id,createdAt"};s.faxAccount.getMessages(t).$promise.then(function(e){return e&&(n.in=e.count||0,n.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),t.direction="out",s.faxAccount.getMessages(t).$promise}).then(function(e){e&&(n.out=e.count||0,n.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}p.currentUser=u.getCurrentUser(),p.count=l&&l.count?l.count:0,p.faxAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},p.rpcFaxAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.query={sort:"-name",limit:10,page:1},p.success=f,p.$onInit=g,p.getFaxAccounts=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=s.faxAccount.get(p.query,f).$promise:(p.query.id=p.userProfile.id,p.query.section="FaxAccounts",p.promise=s.userProfile.getResources(p.query,f).$promise)},p.onSave=function(e){p.faxAccounts[e.id]&&_.merge(p.faxAccounts[e.id],e)},p.onFaxMessageSave=function(e){p.faxAccounts[e.FaxAccountId]&&("in"==e.direction?(p.faxAccounts[e.FaxAccountId].in+=1,p.faxAccounts[e.FaxAccountId].lastIn=e.createdAt):(p.faxAccounts[e.FaxAccountId].out+=1,p.faxAccounts[e.FaxAccountId].lastOut=e.createdAt))},p.goToFaxAccount=function(e,n){i.go("app.fax.faxAccounts.edit",{id:n.id,faxAccount:n})},p.order=[],_.forIn(p.faxAccounts,function(e,n){p.order.push(e.id)}),o.on("faxAccount:save",p.onSave),o.on("faxAccount:update",p.onSave),o.on("faxMessage:save",p.onFaxMessageSave);var v=!0,h=1;function f(e){if(p.faxAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){p.order=[];for(var n=0;n<e.rows.length;n++)p.order.push(e.rows[n].id)}g()}e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=h),p.getFaxAccounts())}),e.$on("$destroy",function(){o.removeAllListeners("faxAccount:save"),o.removeAllListeners("faxAccount:update"),o.removeAllListeners("faxMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","faxAccounts","rpcFaxAccounts","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("FaxAccountsRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"FaxQueues":void 0,channel:"fax",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("FAX.FAXQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:n,faxQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:n,faxQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("fax_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userFaxQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.FaxQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userFaxQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.FaxQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"fax")})}),e.$on("$destroy",function(){r.removeAllListeners("fax_queue:save"),r.removeAllListeners("userFaxQueue:remove"),r.removeAllListeners("userFaxQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.fax").controller("QueuesFaxRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.fax.realtime.agents":this.selectedTab=0;break;case"app.fax.realtime.trunks":this.selectedTab=1;break;case"app.fax.realtime.queues":this.selectedTab=2;break;case"app.fax.realtime.accounts":this.selectedTab=3;break;default:this.selectedTab=0,t.go("app.fax.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.fax.realtime.agents");break;case 1:t.go("app.fax.realtime.trunks");break;case 2:t.go("app.fax.realtime.queues");break;case 3:t.go("app.fax.realtime.accounts");break;default:t.go("app.fax.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.fax").controller("FaxRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,n=0;n<u.trunks.length;n+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[n].id]))&&_.merge(u.trunks[n],_.pick(u.rpcTrunks[e],p))}function v(e,n,t){0<=n&&_.merge(e[n],_.pick(t,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},u.statusClass=r.status,u.stateClass=r.state,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,n){l.go("app.tools.trunks.edit",{id:n.id})},u.onSave=function(e){var n=_.findIndex(u.trunks,["id",e.id]),t=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,n,e),v(u.rpcTrunks,t,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("TrunksFaxRealtimeController",e)}(),function(){"use strict";function e(e,n){this.info=e,this.license=n}e.$inject=["info","license"],angular.module("app.help.about").controller("AboutController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKACCOUNT",g.deskAccount=angular.copy(l),g.deskAccounts=r,g.newDeskAccount=!1,g.deskAccount||(g.deskAccount={type:"integrationTab",authType:"basic",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_DESKACCOUNT",g.newDeskAccount=!0),g.addNewDeskAccount=function(){g.errors=[],d.intDeskAccount.save(g.deskAccount).$promise.then(function(e){g.deskAccounts.unshift(e.toJSON()),o.success({title:"DeskAccount properly created",msg:g.deskAccount.name?g.deskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskAccount=function(){g.errors=[],d.intDeskAccount.update({id:g.deskAccount.id},g.deskAccount).$promise.then(function(e){var n=_.find(g.deskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"DeskAccount properly saved!",msg:g.deskAccount.name?g.deskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The deskAccount will be deleted.").ariaLabel("Delete DeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDeskAccount.delete({id:g.deskAccount.id}).$promise.then(function(){_.remove(g.deskAccounts,{id:g.deskAccount.id}),o.success({title:"DeskAccount properly deleted!",msg:(g.deskAccount.name||"deskAccount")+" has been deleted!"}),v(g.deskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","deskAccounts","deskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.deskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="deskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedDeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayauthType=_.keyBy([{option:"Basic",value:"'basic'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.deskAccounts.edit",{id:e.id,deskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intDeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"DeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"DeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("deskAccount")+"?").htmlContent("<b>"+(e.name||"deskAccount")+"</b> will be deleted.").ariaLabel("delete deskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getDeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intDeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="DeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditDeskAccount=function(e,n){i.show({controller:"CreateOrEditDeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskAccount:n,deskAccounts:f.deskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteDeskAccount=y,f.exportSelectedDeskAccounts=function(){var e=angular.copy(f.selectedDeskAccounts);return f.selectedDeskAccounts=[],e},f.deleteSelectedDeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected deskAccounts?").htmlContent("<b>"+f.selectedDeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete DeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedDeskAccounts.forEach(function(e){y(e)}),f.selectedDeskAccounts=[]})},f.deselectDeskAccounts=function(){f.selectedDeskAccounts=[]},f.selectAllDeskAccounts=function(){f.selectedDeskAccounts=f.deskAccounts.rows};var b=!0,A=1;function E(e){f.deskAccounts=e||{count:0,rows:[]}}function y(e){m.intDeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.deskAccounts.rows,{id:e.id}),f.deskAccounts.count-=1,f.deskAccounts.rows.length||f.getDeskAccounts(),p.success({title:_.startCase("DeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getDeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","deskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("DeskAccountsController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.deskAccount={},o.deskConfiguration={},o.configurations=[],o.selectedDeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.deskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDeskAccount.getConfigurations({id:o.deskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDeskConfiguration=function(e){o.deskConfiguration=o.configurations[e],o.selectedDeskConfiguration=e,i.intDeskConfiguration.getSubjects({id:o.deskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDeskConfiguration.getDescriptions({id:o.deskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDeskConfiguration.getFields({id:o.deskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intDeskConfiguration.getTags({id:o.deskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDeskConfiguration=function(e,n){a.show({controller:"CreateOrEditDeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDeskConfiguration(0)})},o.deleteDeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the deskConfiguration?").htmlContent("<b>"+(n.name||"deskConfiguration")+"</b> will be deleted.").ariaLabel("delete deskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intDeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"DeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intDeskConfiguration.setTags({id:o.deskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("DeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKCONFIGURATION",g.deskConfiguration=angular.copy(l),g.configurations=r,g.newDeskConfiguration=!1,g.deskConfiguration||(g.deskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_DESKCONFIGURATION",g.newDeskConfiguration=!0),g.addNewDeskConfiguration=function(){g.errors=[],d.intDeskAccount.addConfiguration({id:n.params.id},g.deskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"DeskConfiguration properly created",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskConfiguration=function(){g.errors=[],d.intDeskConfiguration.update({id:g.deskConfiguration.id},g.deskConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"DeskConfiguration properly saved!",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The deskConfiguration will be deleted.").ariaLabel("Delete DeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDeskConfiguration.delete({id:g.deskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.deskConfiguration.id}),o.success({title:"DeskConfiguration properly deleted!",msg:(g.deskConfiguration.name||"deskConfiguration")+" has been deleted!"}),v(g.deskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","deskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.deskAccount=c||e.params.deskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoDeskAccounts=function(){e.go("app.integrations.deskAccounts",{},{reload:"app.integrations.deskAccounts"})},u.saveDeskAccount=function(){r.intDeskAccount.update({id:u.deskAccount.id},u.deskAccount).$promise.then(function(){l.success({title:"DeskAccount updated!",msg:u.deskAccount.name?u.deskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","deskAccount","userProfileSection"],angular.module("app.integrations").controller("DeskAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT",v.dynamics365Account=angular.copy(l),v.dynamics365Accounts=r,v.cloudProviders=d,v.newDynamics365Account=!1,v.dynamics365Account||(v.dynamics365Account={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},v.title="INTEGRATIONS.NEW_DYNAMICS365ACCOUNT",v.newDynamics365Account=!0),v.dynamics365Account.modernAuthentication=!!_.isNil(v.dynamics365Account.modernAuthentication)||v.dynamics365Account.modernAuthentication,v.isModernAuthenticationEnabled=v.dynamics365Account.modernAuthentication,v.addNewDynamics365Account=function(){v.errors=[],c.intDynamics365Account.save(v.dynamics365Account).$promise.then(function(e){v.dynamics365Accounts.unshift(e.toJSON()),o.success({title:"Dynamics365Account properly created",msg:v.dynamics365Account.name?v.dynamics365Account.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveDynamics365Account=function(){v.errors=[],c.intDynamics365Account.update({id:v.dynamics365Account.id},v.dynamics365Account).$promise.then(function(e){var n=_.find(v.dynamics365Accounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Dynamics365Account properly saved!",msg:v.dynamics365Account.name?v.dynamics365Account.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteDynamics365Account=function(e){v.errors=[];var n=a.confirm().title("Are you sure?").content("The dynamics365Account will be deleted.").ariaLabel("Delete Dynamics365Account").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDynamics365Account.delete({id:v.dynamics365Account.id}).$promise.then(function(){_.remove(v.dynamics365Accounts,{id:v.dynamics365Account.id}),o.success({title:"Dynamics365Account properly deleted!",msg:(v.dynamics365Account.name||"dynamics365Account")+" has been deleted!"}),h(v.dynamics365Account)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=h}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dynamics365Accounts","dynamics365Account","cloudProviders","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=h,b.setting=f,b.currentUser=v.getCurrentUser(),b.dynamics365Accounts=l||{count:0,rows:[]},b.cloudProviders=d||{count:0,rows:[]},b.userProfile=c,b.userProfileSection=m&&1==m.count?m.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="dynamics365Accounts",b.listOrder="",b.listOrderAsc=null,b.selectedDynamics365Accounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,n){t.go("app.integrations.dynamics365Accounts.edit",{id:e.id,dynamics365Account:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,n){return u.intDynamics365Account.getFields({id:e.id,test:!0}).$promise.then(function(){g.success({title:"Dynamics365Account properly tested",msg:"Connection succeded!"})}).catch(function(e){g.error({title:"Dynamics365Account properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("dynamics365Account")+"?").htmlContent("<b>"+(e.name||"dynamics365Account")+"</b> will be deleted.").ariaLabel("delete dynamics365Account").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDynamics365Accounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,v.hasRole("admin")?b.promise=u.intDynamics365Account.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Dynamics365Accounts",b.promise=u.userProfile.getResources(b.query,y).$promise)},b.createOrEditDynamics365Account=function(e,n){i.show({controller:"CreateOrEditDynamics365AccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Account:n,dynamics365Accounts:b.dynamics365Accounts.rows,cloudProviders:b.cloudProviders.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDynamics365Account=S,b.exportSelectedDynamics365Accounts=function(){var e=angular.copy(b.selectedDynamics365Accounts);return b.selectedDynamics365Accounts=[],e},b.deleteSelectedDynamics365Accounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected dynamics365Accounts?").htmlContent("<b>"+b.selectedDynamics365Accounts.length+" selected</b> will be deleted.").ariaLabel("delete Dynamics365Accounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){b.selectedDynamics365Accounts.forEach(function(e){S(e)}),b.selectedDynamics365Accounts=[]})},b.deselectDynamics365Accounts=function(){b.selectedDynamics365Accounts=[]},b.selectAllDynamics365Accounts=function(){b.selectedDynamics365Accounts=b.dynamics365Accounts.rows};var A=!0,E=1;function y(e){b.dynamics365Accounts=e||{count:0,rows:[]}}function S(e){u.intDynamics365Account.delete({id:e.id}).$promise.then(function(){_.remove(b.dynamics365Accounts.rows,{id:e.id}),b.dynamics365Accounts.count-=1,b.dynamics365Accounts.rows.length||b.getDynamics365Accounts(),g.success({title:_.startCase("Dynamics365Account")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDynamics365Account"}];for(var n=0;n<e.data.errors.length;n++)g.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else g.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDynamics365Account",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){A?o(function(){A=!1}):(n||(E=b.query.page),e!==n&&(b.query.page=1),e||(b.query.page=E),b.getDynamics365Accounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dynamics365Accounts","cloudProviders","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("Dynamics365AccountsController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.dynamics365Account={},o.dynamics365Configuration={},o.configurations=[],o.selectedDynamics365Configuration=-1,o.crudPermissions,o.init=function(e,n){o.dynamics365Account=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDynamics365Account.getConfigurations({id:o.dynamics365Account.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDynamics365Configuration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDynamics365Configuration=function(e){o.advancedForm&&o.advancedForm.$setPristine();o.dynamics365Configuration=o.configurations[e],o.selectedDynamics365Configuration=e,i.intDynamics365Configuration.getSubjects({id:o.dynamics365Configuration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDynamics365Configuration.getDescriptions({id:o.dynamics365Configuration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDynamics365Configuration.getFields({id:o.dynamics365Configuration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDynamics365Configuration=function(e,n){a.show({controller:"CreateOrEditDynamics365ConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Configuration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDynamics365Configuration(0)})},o.deleteDynamics365Configuration=function(e,n){var t=a.confirm().title("Are you sure want to delete the dynamics365Configuration?").htmlContent("<b>"+(n.name||"dynamics365Configuration")+"</b> will be deleted.").ariaLabel("delete dynamics365Configuration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intDynamics365Configuration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"Dynamics365Configuration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDynamics365Configuration(0)})},function(){console.log("CANCEL")})},o.saveDynamics365Configuration=function(){o.errors=[],i.intDynamics365Configuration.update({id:o.dynamics365Configuration.id},o.dynamics365Configuration).$promise.then(function(e){var n=_.find(o.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.advancedForm.$setPristine(),s.success({title:"Dynamics365Configuration properly saved!",msg:o.dynamics365Configuration.name?o.dynamics365Configuration.name+" has been saved!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("Dynamics365AccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DYNAMICS365CONFIGURATION",g.dynamics365Configuration=angular.copy(l),g.configurations=r,g.newDynamics365Configuration=!1,g.dynamics365Configuration||(g.dynamics365Configuration={channel:"voice",type:"inbound",ticketType:"incident"},g.title="INTEGRATIONS.NEW_DYNAMICS365CONFIGURATION",g.newDynamics365Configuration=!0),g.addNewDynamics365Configuration=function(){g.errors=[],d.intDynamics365Account.addConfiguration({id:n.params.id},g.dynamics365Configuration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"Dynamics365Configuration properly created",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDynamics365Configuration=function(){g.errors=[],d.intDynamics365Configuration.update({id:g.dynamics365Configuration.id},g.dynamics365Configuration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Dynamics365Configuration properly saved!",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDynamics365Configuration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The dynamics365Configuration will be deleted.").ariaLabel("Delete Dynamics365Configuration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDynamics365Configuration.delete({id:g.dynamics365Configuration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.dynamics365Configuration.id}),o.success({title:"Dynamics365Configuration properly deleted!",msg:(g.dynamics365Configuration.name||"dynamics365Configuration")+" has been deleted!"}),v(g.dynamics365Configuration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","dynamics365Configuration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365ConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDynamics365Field.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Account.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.dynamics365Account=c||e.params.dynamics365Account||{},p.cloudProviders=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.isModernAuthenticationEnabled=p.dynamics365Account.modernAuthentication,p.alert=l.info,p.gotoDynamics365Accounts=function(){e.go("app.integrations.dynamics365Accounts",{},{reload:"app.integrations.dynamics365Accounts"})},p.saveDynamics365Account=function(){r.intDynamics365Account.update({id:p.dynamics365Account.id},p.dynamics365Account).$promise.then(function(){l.success({title:"Dynamics365Account updated!",msg:p.dynamics365Account.name?p.dynamics365Account.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDynamics365Account",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","dynamics365Account","cloudProviders","userProfileSection"],angular.module("app.integrations").controller("Dynamics365AccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKACCOUNT",g.freshdeskAccount=angular.copy(l),g.freshdeskAccounts=r,g.newFreshdeskAccount=!1,g.freshdeskAccount||(g.freshdeskAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_FRESHDESKACCOUNT",g.newFreshdeskAccount=!0),g.addNewFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.save(g.freshdeskAccount).$promise.then(function(e){g.freshdeskAccounts.unshift(e.toJSON()),o.success({title:"FreshdeskAccount properly created",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.update({id:g.freshdeskAccount.id},g.freshdeskAccount).$promise.then(function(e){var n=_.find(g.freshdeskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshdeskAccount properly saved!",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshdeskAccount will be deleted.").ariaLabel("Delete FreshdeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshdeskAccount.delete({id:g.freshdeskAccount.id}).$promise.then(function(){_.remove(g.freshdeskAccounts,{id:g.freshdeskAccount.id}),o.success({title:"FreshdeskAccount properly deleted!",msg:(g.freshdeskAccount.name||"freshdeskAccount")+" has been deleted!"}),v(g.freshdeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshdeskAccounts","freshdeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshdeskAccount={},o.freshdeskConfiguration={},o.configurations=[],o.selectedFreshdeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.freshdeskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshdeskAccount.getConfigurations({id:o.freshdeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshdeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshdeskConfiguration=function(e){o.freshdeskConfiguration=o.configurations[e],o.selectedFreshdeskConfiguration=e,i.intFreshdeskConfiguration.getSubjects({id:o.freshdeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshdeskConfiguration.getDescriptions({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshdeskConfiguration.getFields({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intFreshdeskConfiguration.getTags({id:o.freshdeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshdeskConfiguration=function(e,n){a.show({controller:"CreateOrEditFreshdeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshdeskConfiguration(0)})},o.deleteFreshdeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the freshdeskConfiguration?").htmlContent("<b>"+(n.name||"freshdeskConfiguration")+"</b> will be deleted.").ariaLabel("delete freshdeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intFreshdeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"FreshdeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshdeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intFreshdeskConfiguration.setTags({id:o.freshdeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshdeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKCONFIGURATION",g.freshdeskConfiguration=angular.copy(l),g.configurations=r,g.newFreshdeskConfiguration=!1,g.freshdeskConfiguration||(g.freshdeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHDESKCONFIGURATION",g.newFreshdeskConfiguration=!0),g.addNewFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskAccount.addConfiguration({id:n.params.id},g.freshdeskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshdeskConfiguration properly created",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskConfiguration.update({id:g.freshdeskConfiguration.id},g.freshdeskConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshdeskConfiguration properly saved!",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshdeskConfiguration will be deleted.").ariaLabel("Delete FreshdeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshdeskConfiguration.delete({id:g.freshdeskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshdeskConfiguration.id}),o.success({title:"FreshdeskConfiguration properly deleted!",msg:(g.freshdeskConfiguration.name||"freshdeskConfiguration")+" has been deleted!"}),v(g.freshdeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshdeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intFreshdeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.freshdeskAccount=c||e.params.freshdeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshdeskAccounts=function(){e.go("app.integrations.freshdeskAccounts",{},{reload:"app.integrations.freshdeskAccounts"})},u.saveFreshdeskAccount=function(){r.intFreshdeskAccount.update({id:u.freshdeskAccount.id},u.freshdeskAccount).$promise.then(function(){l.success({title:"FreshdeskAccount updated!",msg:u.freshdeskAccount.name?u.freshdeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshdeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshdeskAccount","userProfileSection"],angular.module("app.integrations").controller("FreshdeskAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.freshdeskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="freshdeskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFreshdeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.freshdeskAccounts.edit",{id:e.id,freshdeskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intFreshdeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshdeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshdeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("freshdeskAccount")+"?").htmlContent("<b>"+(e.name||"freshdeskAccount")+"</b> will be deleted.").ariaLabel("delete freshdeskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFreshdeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intFreshdeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FreshdeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFreshdeskAccount=function(e,n){i.show({controller:"CreateOrEditFreshdeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskAccount:n,freshdeskAccounts:f.freshdeskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFreshdeskAccount=y,f.exportSelectedFreshdeskAccounts=function(){var e=angular.copy(f.selectedFreshdeskAccounts);return f.selectedFreshdeskAccounts=[],e},f.deleteSelectedFreshdeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected freshdeskAccounts?").htmlContent("<b>"+f.selectedFreshdeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshdeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFreshdeskAccounts.forEach(function(e){y(e)}),f.selectedFreshdeskAccounts=[]})},f.deselectFreshdeskAccounts=function(){f.selectedFreshdeskAccounts=[]},f.selectAllFreshdeskAccounts=function(){f.selectedFreshdeskAccounts=f.freshdeskAccounts.rows};var b=!0,A=1;function E(e){f.freshdeskAccounts=e||{count:0,rows:[]}}function y(e){m.intFreshdeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.freshdeskAccounts.rows,{id:e.id}),f.freshdeskAccounts.count-=1,f.freshdeskAccounts.rows.length||f.getFreshdeskAccounts(),p.success({title:_.startCase("FreshdeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshdeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshdeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFreshdeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshdeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("FreshdeskAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHSALESACCOUNT",g.freshsalesAccount=angular.copy(l),g.freshsalesAccounts=r,g.newFreshsalesAccount=!1,g.freshsalesAccount||(g.freshsalesAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_FRESHSALESACCOUNT",g.newFreshsalesAccount=!0),g.addNewFreshsalesAccount=function(){g.errors=[],d.intFreshsalesAccount.save(g.freshsalesAccount).$promise.then(function(e){g.freshsalesAccounts.unshift(e.toJSON()),o.success({title:"FreshsalesAccount properly created",msg:g.freshsalesAccount.name?g.freshsalesAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshsalesAccount=function(){g.errors=[],d.intFreshsalesAccount.update({id:g.freshsalesAccount.id},g.freshsalesAccount).$promise.then(function(e){var n=_.find(g.freshsalesAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshsalesAccount properly saved!",msg:g.freshsalesAccount.name?g.freshsalesAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshsalesAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshsalesAccount will be deleted.").ariaLabel("Delete FreshsalesAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshsalesAccount.delete({id:g.freshsalesAccount.id}).$promise.then(function(){_.remove(g.freshsalesAccounts,{id:g.freshsalesAccount.id}),o.success({title:"FreshsalesAccount properly deleted!",msg:(g.freshsalesAccount.name||"freshsalesAccount")+" has been deleted!"}),v(g.freshsalesAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshsalesAccounts","freshsalesAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshsalesAccount={},o.freshsalesConfiguration={},o.configurations=[],o.selectedFreshsalesConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.freshsalesAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshsalesAccount.getConfigurations({id:o.freshsalesAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshsalesConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshsalesConfiguration=function(e){o.freshsalesConfiguration=o.configurations[e],o.selectedFreshsalesConfiguration=e,i.intFreshsalesConfiguration.getSubjects({id:o.freshsalesConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshsalesConfiguration.getDescriptions({id:o.freshsalesConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshsalesConfiguration.getFields({id:o.freshsalesConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshsalesConfiguration=function(e,n){a.show({controller:"CreateOrEditFreshsalesConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshsalesConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshsalesConfiguration(0)})},o.deleteFreshsalesConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the freshsalesConfiguration?").htmlContent("<b>"+(n.name||"freshsalesConfiguration")+"</b> will be deleted.").ariaLabel("delete freshsalesConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intFreshsalesConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"FreshsalesConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshsalesConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshsalesAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHSALESCONFIGURATION",g.freshsalesConfiguration=angular.copy(l),g.configurations=r,g.newFreshsalesConfiguration=!1,g.freshsalesConfiguration||(g.freshsalesConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHSALESCONFIGURATION",g.newFreshsalesConfiguration=!0),g.addNewFreshsalesConfiguration=function(){g.errors=[],d.intFreshsalesAccount.addConfiguration({id:n.params.id},g.freshsalesConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshsalesConfiguration properly created",msg:g.freshsalesConfiguration.name?g.freshsalesConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshsalesConfiguration=function(){g.errors=[],d.intFreshsalesConfiguration.update({id:g.freshsalesConfiguration.id},g.freshsalesConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshsalesConfiguration properly saved!",msg:g.freshsalesConfiguration.name?g.freshsalesConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshsalesConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshsalesConfiguration will be deleted.").ariaLabel("Delete FreshsalesConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshsalesConfiguration.delete({id:g.freshsalesConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshsalesConfiguration.id}),o.success({title:"FreshsalesConfiguration properly deleted!",msg:(g.freshsalesConfiguration.name||"freshsalesConfiguration")+" has been deleted!"}),v(g.freshsalesConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshsalesConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshsalesField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshsalesField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intFreshsalesField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshsalesAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.freshsalesAccount=c||e.params.freshsalesAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshsalesAccounts=function(){e.go("app.integrations.freshsalesAccounts",{},{reload:"app.integrations.freshsalesAccounts"})},u.saveFreshsalesAccount=function(){r.intFreshsalesAccount.update({id:u.freshsalesAccount.id},u.freshsalesAccount).$promise.then(function(){l.success({title:"FreshsalesAccount updated!",msg:u.freshsalesAccount.name?u.freshsalesAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshsalesAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshsalesAccount","userProfileSection"],angular.module("app.integrations").controller("FreshsalesAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.freshsalesAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="freshsalesAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFreshsalesAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.freshsalesAccounts.edit",{id:e.id,freshsalesAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intFreshsalesAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshsalesAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshsalesAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("freshsalesAccount")+"?").htmlContent("<b>"+(e.name||"freshsalesAccount")+"</b> will be deleted.").ariaLabel("delete freshsalesAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFreshsalesAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intFreshsalesAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FreshsalesAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFreshsalesAccount=function(e,n){i.show({controller:"CreateOrEditFreshsalesAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshsalesAccount:n,freshsalesAccounts:f.freshsalesAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFreshsalesAccount=y,f.exportSelectedFreshsalesAccounts=function(){var e=angular.copy(f.selectedFreshsalesAccounts);return f.selectedFreshsalesAccounts=[],e},f.deleteSelectedFreshsalesAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected freshsalesAccounts?").htmlContent("<b>"+f.selectedFreshsalesAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshsalesAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFreshsalesAccounts.forEach(function(e){y(e)}),f.selectedFreshsalesAccounts=[]})},f.deselectFreshsalesAccounts=function(){f.selectedFreshsalesAccounts=[]},f.selectAllFreshsalesAccounts=function(){f.selectedFreshsalesAccounts=f.freshsalesAccounts.rows};var b=!0,A=1;function E(e){f.freshsalesAccounts=e||{count:0,rows:[]}}function y(e){m.intFreshsalesAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.freshsalesAccounts.rows,{id:e.id}),f.freshsalesAccounts.count-=1,f.freshsalesAccounts.rows.length||f.getFreshsalesAccounts(),p.success({title:_.startCase("FreshsalesAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshsalesAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshsalesAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFreshsalesAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshsalesAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("FreshsalesAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCEACCOUNT",g.salesforceAccount=angular.copy(l),g.salesforceAccounts=r,g.newSalesforceAccount=!1,g.salesforceAccount||(g.salesforceAccount={type:"integrationTab",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SALESFORCEACCOUNT",g.newSalesforceAccount=!0),g.addNewSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.save(g.salesforceAccount).$promise.then(function(e){g.salesforceAccounts.unshift(e.toJSON()),o.success({title:"SalesforceAccount properly created",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.update({id:g.salesforceAccount.id},g.salesforceAccount).$promise.then(function(e){var n=_.find(g.salesforceAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SalesforceAccount properly saved!",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The salesforceAccount will be deleted.").ariaLabel("Delete SalesforceAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSalesforceAccount.delete({id:g.salesforceAccount.id}).$promise.then(function(){_.remove(g.salesforceAccounts,{id:g.salesforceAccount.id}),o.success({title:"SalesforceAccount properly deleted!",msg:(g.salesforceAccount.name||"salesforceAccount")+" has been deleted!"}),v(g.salesforceAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","salesforceAccounts","salesforceAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function n(){return"Case"===o.salesforceConfiguration.ticketType&&("lead"===o.salesforceConfiguration.moduleCreate||_.includes(["lead","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch))}function r(){return _.includes(["lead","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function l(){return _.includes(["contact","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function d(){return _.includes(["account","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function c(){return i.intSalesforceConfiguration.update({id:o.salesforceConfiguration.id},o.salesforceConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function m(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function u(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.salesforceAccount={},o.salesforceConfiguration={},o.configurations=[],o.selectedSalesforceConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.salesforceAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSalesforceAccount.getConfigurations({id:o.salesforceAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSalesforceConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSalesforceConfiguration=function(e){o.salesforceConfiguration=o.configurations[e],o.salesforceConfiguration.isLead=n(),o.salesforceConfiguration.isLeadSearch=r(),o.salesforceConfiguration.isContactSearch=l(),o.salesforceConfiguration.isAccountSearch=d(),o.selectedSalesforceConfiguration=e,i.intSalesforceConfiguration.getSubjects({id:o.salesforceConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSalesforceConfiguration.getDescriptions({id:o.salesforceConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSalesforceConfiguration.getFields({id:o.salesforceConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSalesforceConfiguration=function(e,n){a.show({controller:"CreateOrEditSalesforceConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSalesforceConfiguration(0)})},o.deleteSalesforceConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the salesforceConfiguration?").htmlContent("<b>"+(n.name||"salesforceConfiguration")+"</b> will be deleted.").ariaLabel("delete salesforceConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intSalesforceConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"SalesforceConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSalesforceConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){o.salesforceConfiguration.isLead=n(),o.salesforceConfiguration.isLeadSearch=r(),o.salesforceConfiguration.isContactSearch=l(),o.salesforceConfiguration.isAccountSearch=d(),c()},o.salesforceConfiguration.isLead=!1,o.salesforceConfiguration.isLeadSearch=!1,o.salesforceConfiguration.isContactSearch=!1,o.salesforceConfiguration.isAccountSearch=!1,o.checkIsLead=n,o.checkIsLeadSearch=r,o.checkIsContactSearch=l,o.checkIsAccountSearch=d,o.saveSalesforceConfiguration=c,o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){m(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){m(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){u(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){u(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){p(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){p(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SalesforceAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCECONFIGURATION",g.salesforceConfiguration=angular.copy(l),g.configurations=r,g.newSalesforceConfiguration=!1,g.salesforceConfiguration||(g.salesforceConfiguration={channel:"voice",type:"inbound",ticketType:"Task"},g.title="INTEGRATIONS.NEW_SALESFORCECONFIGURATION",g.newSalesforceConfiguration=!0),g.addNewSalesforceConfiguration=function(){g.errors=[],d.intSalesforceAccount.addConfiguration({id:n.params.id},g.salesforceConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SalesforceConfiguration properly created",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceConfiguration=function(){g.errors=[],d.intSalesforceConfiguration.update({id:g.salesforceConfiguration.id},g.salesforceConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SalesforceConfiguration properly saved!",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The salesforceConfiguration will be deleted.").ariaLabel("Delete SalesforceConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSalesforceConfiguration.delete({id:g.salesforceConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.salesforceConfiguration.id}),o.success({title:"SalesforceConfiguration properly deleted!",msg:(g.salesforceConfiguration.name||"salesforceConfiguration")+" has been deleted!"}),v(g.salesforceConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","salesforceConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intSalesforceField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.salesforceAccount=c||e.params.salesforceAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSalesforceAccounts=function(){e.go("app.integrations.salesforceAccounts",{},{reload:"app.integrations.salesforceAccounts"})},u.saveSalesforceAccount=function(){r.intSalesforceAccount.update({id:u.salesforceAccount.id},u.salesforceAccount).$promise.then(function(){l.success({title:"SalesforceAccount updated!",msg:u.salesforceAccount.name?u.salesforceAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSalesforceAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","salesforceAccount","userProfileSection"],angular.module("app.integrations").controller("SalesforceAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.salesforceAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="salesforceAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSalesforceAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.salesforceAccounts.edit",{id:e.id,salesforceAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intSalesforceAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SalesforceAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SalesforceAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("salesforceAccount")+"?").htmlContent("<b>"+(e.name||"salesforceAccount")+"</b> will be deleted.").ariaLabel("delete salesforceAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSalesforceAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intSalesforceAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SalesforceAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSalesforceAccount=function(e,n){i.show({controller:"CreateOrEditSalesforceAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceAccount:n,salesforceAccounts:f.salesforceAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSalesforceAccount=y,f.exportSelectedSalesforceAccounts=function(){var e=angular.copy(f.selectedSalesforceAccounts);return f.selectedSalesforceAccounts=[],e},f.deleteSelectedSalesforceAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected salesforceAccounts?").htmlContent("<b>"+f.selectedSalesforceAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SalesforceAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSalesforceAccounts.forEach(function(e){y(e)}),f.selectedSalesforceAccounts=[]})},f.deselectSalesforceAccounts=function(){f.selectedSalesforceAccounts=[]},f.selectAllSalesforceAccounts=function(){f.selectedSalesforceAccounts=f.salesforceAccounts.rows};var b=!0,A=1;function E(e){f.salesforceAccounts=e||{count:0,rows:[]}}function y(e){m.intSalesforceAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.salesforceAccounts.rows,{id:e.id}),f.salesforceAccounts.count-=1,f.salesforceAccounts.rows.length||f.getSalesforceAccounts(),p.success({title:_.startCase("SalesforceAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSalesforceAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSalesforceAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSalesforceAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","salesforceAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("SalesforceAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWACCOUNT",g.servicenowAccount=angular.copy(l),g.servicenowAccounts=r,g.newServicenowAccount=!1,g.servicenowAccount||(g.servicenowAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SERVICENOWACCOUNT",g.newServicenowAccount=!0),g.addNewServicenowAccount=function(){g.errors=[],d.intServicenowAccount.save(g.servicenowAccount).$promise.then(function(e){g.servicenowAccounts.unshift(e.toJSON()),o.success({title:"ServicenowAccount properly created",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowAccount=function(){g.errors=[],d.intServicenowAccount.update({id:g.servicenowAccount.id},g.servicenowAccount).$promise.then(function(e){var n=_.find(g.servicenowAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ServicenowAccount properly saved!",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The servicenowAccount will be deleted.").ariaLabel("Delete ServicenowAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intServicenowAccount.delete({id:g.servicenowAccount.id}).$promise.then(function(){_.remove(g.servicenowAccounts,{id:g.servicenowAccount.id}),o.success({title:"ServicenowAccount properly deleted!",msg:(g.servicenowAccount.name||"servicenowAccount")+" has been deleted!"}),v(g.servicenowAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","servicenowAccounts","servicenowAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.servicenowAccount={},o.servicenowConfiguration={},o.configurations=[],o.selectedServicenowConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.servicenowAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intServicenowAccount.getConfigurations({id:o.servicenowAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getServicenowConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getServicenowConfiguration=function(e){o.servicenowConfiguration=o.configurations[e],o.selectedServicenowConfiguration=e,i.intServicenowConfiguration.getSubjects({id:o.servicenowConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intServicenowConfiguration.getDescriptions({id:o.servicenowConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intServicenowConfiguration.getFields({id:o.servicenowConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditServicenowConfiguration=function(e,n){a.show({controller:"CreateOrEditServicenowConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getServicenowConfiguration(0)})},o.deleteServicenowConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the servicenowConfiguration?").htmlContent("<b>"+(n.name||"servicenowConfiguration")+"</b> will be deleted.").ariaLabel("delete servicenowConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intServicenowConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"ServicenowConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getServicenowConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ServicenowAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWCONFIGURATION",g.servicenowConfiguration=angular.copy(l),g.configurations=r,g.newServicenowConfiguration=!1,g.servicenowConfiguration||(g.servicenowConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SERVICENOWCONFIGURATION",g.newServicenowConfiguration=!0),g.addNewServicenowConfiguration=function(){g.errors=[],d.intServicenowAccount.addConfiguration({id:n.params.id},g.servicenowConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ServicenowConfiguration properly created",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowConfiguration=function(){g.errors=[],d.intServicenowConfiguration.update({id:g.servicenowConfiguration.id},g.servicenowConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ServicenowConfiguration properly saved!",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The servicenowConfiguration will be deleted.").ariaLabel("Delete ServicenowConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intServicenowConfiguration.delete({id:g.servicenowConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.servicenowConfiguration.id}),o.success({title:"ServicenowConfiguration properly deleted!",msg:(g.servicenowConfiguration.name||"servicenowConfiguration")+" has been deleted!"}),v(g.servicenowConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","servicenowConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intServicenowField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.servicenowAccount=c||e.params.servicenowAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoServicenowAccounts=function(){e.go("app.integrations.servicenowAccounts",{},{reload:"app.integrations.servicenowAccounts"})},u.saveServicenowAccount=function(){r.intServicenowAccount.update({id:u.servicenowAccount.id},u.servicenowAccount).$promise.then(function(){l.success({title:"ServicenowAccount updated!",msg:u.servicenowAccount.name?u.servicenowAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintServicenowAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","servicenowAccount","userProfileSection"],angular.module("app.integrations").controller("ServicenowAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.servicenowAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="servicenowAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedServicenowAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.servicenowAccounts.edit",{id:e.id,servicenowAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intServicenowAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ServicenowAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ServicenowAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("servicenowAccount")+"?").htmlContent("<b>"+(e.name||"servicenowAccount")+"</b> will be deleted.").ariaLabel("delete servicenowAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getServicenowAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intServicenowAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ServicenowAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditServicenowAccount=function(e,n){i.show({controller:"CreateOrEditServicenowAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowAccount:n,servicenowAccounts:f.servicenowAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteServicenowAccount=y,f.exportSelectedServicenowAccounts=function(){var e=angular.copy(f.selectedServicenowAccounts);return f.selectedServicenowAccounts=[],e},f.deleteSelectedServicenowAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected servicenowAccounts?").htmlContent("<b>"+f.selectedServicenowAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ServicenowAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedServicenowAccounts.forEach(function(e){y(e)}),f.selectedServicenowAccounts=[]})},f.deselectServicenowAccounts=function(){f.selectedServicenowAccounts=[]},f.selectAllServicenowAccounts=function(){f.selectedServicenowAccounts=f.servicenowAccounts.rows};var b=!0,A=1;function E(e){f.servicenowAccounts=e||{count:0,rows:[]}}function y(e){m.intServicenowAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.servicenowAccounts.rows,{id:e.id}),f.servicenowAccounts.count-=1,f.servicenowAccounts.rows.length||f.getServicenowAccounts(),p.success({title:_.startCase("ServicenowAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintServicenowAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintServicenowAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getServicenowAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","servicenowAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ServicenowAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMACCOUNT",g.sugarcrmAccount=angular.copy(l),g.sugarcrmAccounts=r,g.newSugarcrmAccount=!1,g.sugarcrmAccount||(g.sugarcrmAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SUGARCRMACCOUNT",g.newSugarcrmAccount=!0),g.addNewSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.save(g.sugarcrmAccount).$promise.then(function(e){g.sugarcrmAccounts.unshift(e.toJSON()),o.success({title:"SugarcrmAccount properly created",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.update({id:g.sugarcrmAccount.id},g.sugarcrmAccount).$promise.then(function(e){var n=_.find(g.sugarcrmAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SugarcrmAccount properly saved!",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sugarcrmAccount will be deleted.").ariaLabel("Delete SugarcrmAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSugarcrmAccount.delete({id:g.sugarcrmAccount.id}).$promise.then(function(){_.remove(g.sugarcrmAccounts,{id:g.sugarcrmAccount.id}),o.success({title:"SugarcrmAccount properly deleted!",msg:(g.sugarcrmAccount.name||"sugarcrmAccount")+" has been deleted!"}),v(g.sugarcrmAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sugarcrmAccounts","sugarcrmAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.sugarcrmAccount={},o.sugarcrmConfiguration={},o.configurations=[],o.selectedSugarcrmConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.sugarcrmAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSugarcrmAccount.getConfigurations({id:o.sugarcrmAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSugarcrmConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSugarcrmConfiguration=function(e){o.sugarcrmConfiguration=o.configurations[e],o.selectedSugarcrmConfiguration=e,i.intSugarcrmConfiguration.getSubjects({id:o.sugarcrmConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSugarcrmConfiguration.getDescriptions({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSugarcrmConfiguration.getFields({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSugarcrmConfiguration=function(e,n){a.show({controller:"CreateOrEditSugarcrmConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSugarcrmConfiguration(0)})},o.deleteSugarcrmConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the sugarcrmConfiguration?").htmlContent("<b>"+(n.name||"sugarcrmConfiguration")+"</b> will be deleted.").ariaLabel("delete sugarcrmConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intSugarcrmConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"SugarcrmConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSugarcrmConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SugarcrmAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMCONFIGURATION",g.sugarcrmConfiguration=angular.copy(l),g.configurations=r,g.newSugarcrmConfiguration=!1,g.sugarcrmConfiguration||(g.sugarcrmConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SUGARCRMCONFIGURATION",g.newSugarcrmConfiguration=!0),g.addNewSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmAccount.addConfiguration({id:n.params.id},g.sugarcrmConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SugarcrmConfiguration properly created",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmConfiguration.update({id:g.sugarcrmConfiguration.id},g.sugarcrmConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SugarcrmConfiguration properly saved!",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sugarcrmConfiguration will be deleted.").ariaLabel("Delete SugarcrmConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSugarcrmConfiguration.delete({id:g.sugarcrmConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.sugarcrmConfiguration.id}),o.success({title:"SugarcrmConfiguration properly deleted!",msg:(g.sugarcrmConfiguration.name||"sugarcrmConfiguration")+" has been deleted!"}),v(g.sugarcrmConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","sugarcrmConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intSugarcrmField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.sugarcrmAccount=c||e.params.sugarcrmAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSugarcrmAccounts=function(){e.go("app.integrations.sugarcrmAccounts",{},{reload:"app.integrations.sugarcrmAccounts"})},u.saveSugarcrmAccount=function(){r.intSugarcrmAccount.update({id:u.sugarcrmAccount.id},u.sugarcrmAccount).$promise.then(function(){l.success({title:"SugarcrmAccount updated!",msg:u.sugarcrmAccount.name?u.sugarcrmAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSugarcrmAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","sugarcrmAccount","userProfileSection"],angular.module("app.integrations").controller("SugarcrmAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.sugarcrmAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="sugarcrmAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSugarcrmAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.sugarcrmAccounts.edit",{id:e.id,sugarcrmAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intSugarcrmAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SugarcrmAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SugarcrmAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("sugarcrmAccount")+"?").htmlContent("<b>"+(e.name||"sugarcrmAccount")+"</b> will be deleted.").ariaLabel("delete sugarcrmAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSugarcrmAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intSugarcrmAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SugarcrmAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSugarcrmAccount=function(e,n){i.show({controller:"CreateOrEditSugarcrmAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmAccount:n,sugarcrmAccounts:f.sugarcrmAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSugarcrmAccount=y,f.exportSelectedSugarcrmAccounts=function(){var e=angular.copy(f.selectedSugarcrmAccounts);return f.selectedSugarcrmAccounts=[],e},f.deleteSelectedSugarcrmAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected sugarcrmAccounts?").htmlContent("<b>"+f.selectedSugarcrmAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SugarcrmAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSugarcrmAccounts.forEach(function(e){y(e)}),f.selectedSugarcrmAccounts=[]})},f.deselectSugarcrmAccounts=function(){f.selectedSugarcrmAccounts=[]},f.selectAllSugarcrmAccounts=function(){f.selectedSugarcrmAccounts=f.sugarcrmAccounts.rows};var b=!0,A=1;function E(e){f.sugarcrmAccounts=e||{count:0,rows:[]}}function y(e){m.intSugarcrmAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.sugarcrmAccounts.rows,{id:e.id}),f.sugarcrmAccounts.count-=1,f.sugarcrmAccounts.rows.length||f.getSugarcrmAccounts(),p.success({title:_.startCase("SugarcrmAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSugarcrmAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSugarcrmAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSugarcrmAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sugarcrmAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("SugarcrmAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERACCOUNT",g.vtigerAccount=angular.copy(l),g.vtigerAccounts=r,g.newVtigerAccount=!1,g.vtigerAccount||(g.vtigerAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_VTIGERACCOUNT",g.newVtigerAccount=!0),g.addNewVtigerAccount=function(){g.errors=[],d.intVtigerAccount.save(g.vtigerAccount).$promise.then(function(e){g.vtigerAccounts.unshift(e.toJSON()),o.success({title:"VtigerAccount properly created",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerAccount=function(){g.errors=[],d.intVtigerAccount.update({id:g.vtigerAccount.id},g.vtigerAccount).$promise.then(function(e){var n=_.find(g.vtigerAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VtigerAccount properly saved!",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The vtigerAccount will be deleted.").ariaLabel("Delete VtigerAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intVtigerAccount.delete({id:g.vtigerAccount.id}).$promise.then(function(){_.remove(g.vtigerAccounts,{id:g.vtigerAccount.id}),o.success({title:"VtigerAccount properly deleted!",msg:(g.vtigerAccount.name||"vtigerAccount")+" has been deleted!"}),v(g.vtigerAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","vtigerAccounts","vtigerAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.vtigerAccount={},o.vtigerConfiguration={},o.configurations=[],o.selectedVtigerConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.vtigerAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intVtigerAccount.getConfigurations({id:o.vtigerAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getVtigerConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getVtigerConfiguration=function(e){o.vtigerConfiguration=o.configurations[e],o.selectedVtigerConfiguration=e,i.intVtigerConfiguration.getSubjects({id:o.vtigerConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intVtigerConfiguration.getDescriptions({id:o.vtigerConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intVtigerConfiguration.getFields({id:o.vtigerConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditVtigerConfiguration=function(e,n){a.show({controller:"CreateOrEditVtigerConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getVtigerConfiguration(0)})},o.deleteVtigerConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the vtigerConfiguration?").htmlContent("<b>"+(n.name||"vtigerConfiguration")+"</b> will be deleted.").ariaLabel("delete vtigerConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intVtigerConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"VtigerConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getVtigerConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("VtigerAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERCONFIGURATION",g.vtigerConfiguration=angular.copy(l),g.configurations=r,g.newVtigerConfiguration=!1,g.vtigerConfiguration||(g.vtigerConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_VTIGERCONFIGURATION",g.newVtigerConfiguration=!0),g.addNewVtigerConfiguration=function(){g.errors=[],d.intVtigerAccount.addConfiguration({id:n.params.id},g.vtigerConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"VtigerConfiguration properly created",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerConfiguration=function(){g.errors=[],d.intVtigerConfiguration.update({id:g.vtigerConfiguration.id},g.vtigerConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VtigerConfiguration properly saved!",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The vtigerConfiguration will be deleted.").ariaLabel("Delete VtigerConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intVtigerConfiguration.delete({id:g.vtigerConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.vtigerConfiguration.id}),o.success({title:"VtigerConfiguration properly deleted!",msg:(g.vtigerConfiguration.name||"vtigerConfiguration")+" has been deleted!"}),v(g.vtigerConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","vtigerConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intVtigerField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.vtigerAccount=c||e.params.vtigerAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVtigerAccounts=function(){e.go("app.integrations.vtigerAccounts",{},{reload:"app.integrations.vtigerAccounts"})},u.saveVtigerAccount=function(){r.intVtigerAccount.update({id:u.vtigerAccount.id},u.vtigerAccount).$promise.then(function(){l.success({title:"VtigerAccount updated!",msg:u.vtigerAccount.name?u.vtigerAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintVtigerAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","vtigerAccount","userProfileSection"],angular.module("app.integrations").controller("VtigerAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.vtigerAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="vtigerAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedVtigerAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.vtigerAccounts.edit",{id:e.id,vtigerAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intVtigerAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"VtigerAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"VtigerAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("vtigerAccount")+"?").htmlContent("<b>"+(e.name||"vtigerAccount")+"</b> will be deleted.").ariaLabel("delete vtigerAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVtigerAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intVtigerAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VtigerAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVtigerAccount=function(e,n){i.show({controller:"CreateOrEditVtigerAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerAccount:n,vtigerAccounts:f.vtigerAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVtigerAccount=y,f.exportSelectedVtigerAccounts=function(){var e=angular.copy(f.selectedVtigerAccounts);return f.selectedVtigerAccounts=[],e},f.deleteSelectedVtigerAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected vtigerAccounts?").htmlContent("<b>"+f.selectedVtigerAccounts.length+" selected</b> will be deleted.").ariaLabel("delete VtigerAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVtigerAccounts.forEach(function(e){y(e)}),f.selectedVtigerAccounts=[]})},f.deselectVtigerAccounts=function(){f.selectedVtigerAccounts=[]},f.selectAllVtigerAccounts=function(){f.selectedVtigerAccounts=f.vtigerAccounts.rows};var b=!0,A=1;function E(e){f.vtigerAccounts=e||{count:0,rows:[]}}function y(e){m.intVtigerAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.vtigerAccounts.rows,{id:e.id}),f.vtigerAccounts.count-=1,f.vtigerAccounts.rows.length||f.getVtigerAccounts(),p.success({title:_.startCase("VtigerAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintVtigerAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintVtigerAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVtigerAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","vtigerAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("VtigerAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKACCOUNT",g.zendeskAccount=angular.copy(l),g.zendeskAccounts=r,g.newZendeskAccount=!1,g.zendeskAccount||(g.zendeskAccount={type:"integrationTab",authType:"password",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_ZENDESKACCOUNT",g.newZendeskAccount=!0),g.addNewZendeskAccount=function(){g.errors=[],d.intZendeskAccount.save(g.zendeskAccount).$promise.then(function(e){g.zendeskAccounts.unshift(e.toJSON()),o.success({title:"ZendeskAccount properly created",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskAccount=function(){g.errors=[],d.intZendeskAccount.update({id:g.zendeskAccount.id},g.zendeskAccount).$promise.then(function(e){var n=_.find(g.zendeskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZendeskAccount properly saved!",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zendeskAccount will be deleted.").ariaLabel("Delete ZendeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZendeskAccount.delete({id:g.zendeskAccount.id}).$promise.then(function(){_.remove(g.zendeskAccounts,{id:g.zendeskAccount.id}),o.success({title:"ZendeskAccount properly deleted!",msg:(g.zendeskAccount.name||"zendeskAccount")+" has been deleted!"}),v(g.zendeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskAccounts","zendeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intZendeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.zendeskAccount=c||e.params.zendeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZendeskAccounts=function(){e.go("app.integrations.zendeskAccounts",{},{reload:"app.integrations.zendeskAccounts"})},u.saveZendeskAccount=function(){r.intZendeskAccount.update({id:u.zendeskAccount.id},u.zendeskAccount).$promise.then(function(){l.success({title:"ZendeskAccount updated!",msg:u.zendeskAccount.name?u.zendeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZendeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zendeskAccount","userProfileSection"],angular.module("app.integrations").controller("ZendeskAccountController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zendeskAccount={},o.zendeskConfiguration={},o.zendeskConfigurations=[],o.selectedZendeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.zendeskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZendeskAccount.getConfigurations({id:o.zendeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.zendeskConfigurations=e.rows?e.rows:[],o.zendeskConfigurations.length&&o.getZendeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZendeskConfiguration=function(e){o.zendeskConfiguration=o.zendeskConfigurations[e],o.selectedZendeskConfiguration=e,i.intZendeskConfiguration.getSubjects({id:o.zendeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZendeskConfiguration.getDescriptions({id:o.zendeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZendeskConfiguration.getFields({id:o.zendeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intZendeskConfiguration.getTags({id:o.zendeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZendeskConfiguration=function(e,n){a.show({controller:"CreateOrEditZendeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskConfiguration:n,zendeskConfigurations:o.zendeskConfigurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZendeskConfiguration(0)})},o.deleteZendeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the zendeskConfiguration?").htmlContent("<b>"+(n.name||"zendeskConfiguration")+"</b> will be deleted.").ariaLabel("delete zendeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intZendeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.zendeskConfigurations,{id:n.id}),s.success({title:"ZendeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZendeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intZendeskConfiguration.setTags({id:o.zendeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZendeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKCONFIGURATION",g.zendeskConfiguration=angular.copy(l),g.zendeskConfigurations=r,g.newZendeskConfiguration=!1,g.zendeskConfiguration||(g.zendeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZENDESKCONFIGURATION",g.newZendeskConfiguration=!0),g.addNewZendeskConfiguration=function(){g.errors=[],d.intZendeskAccount.addConfiguration({id:n.params.id},g.zendeskConfiguration).$promise.then(function(e){g.zendeskConfigurations.unshift(e.toJSON()),o.success({title:"ZendeskConfiguration properly created",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskConfiguration=function(){g.errors=[],d.intZendeskConfiguration.update({id:g.zendeskConfiguration.id},g.zendeskConfiguration).$promise.then(function(e){var n=_.find(g.zendeskConfigurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZendeskConfiguration properly saved!",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zendeskConfiguration will be deleted.").ariaLabel("Delete ZendeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZendeskConfiguration.delete({id:g.zendeskConfiguration.id}).$promise.then(function(){_.remove(g.zendeskConfigurations,{id:g.zendeskConfiguration.id}),o.success({title:"ZendeskConfiguration properly deleted!",msg:(g.zendeskConfiguration.name||"zendeskConfiguration")+" has been deleted!"}),v(g.zendeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskConfigurations","zendeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.zendeskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="zendeskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedZendeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayauthType=_.keyBy([{option:"Password",value:"'password'"},{option:"Token",value:"'token'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.zendeskAccounts.edit",{id:e.id,zendeskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intZendeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZendeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZendeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("zendeskAccount")+"?").htmlContent("<b>"+(e.name||"zendeskAccount")+"</b> will be deleted.").ariaLabel("delete zendeskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getZendeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intZendeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ZendeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditZendeskAccount=function(e,n){i.show({controller:"CreateOrEditZendeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskAccount:n,zendeskAccounts:f.zendeskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteZendeskAccount=y,f.exportSelectedZendeskAccounts=function(){var e=angular.copy(f.selectedZendeskAccounts);return f.selectedZendeskAccounts=[],e},f.deleteSelectedZendeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected zendeskAccounts?").htmlContent("<b>"+f.selectedZendeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZendeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedZendeskAccounts.forEach(function(e){y(e)}),f.selectedZendeskAccounts=[]})},f.deselectZendeskAccounts=function(){f.selectedZendeskAccounts=[]},f.selectAllZendeskAccounts=function(){f.selectedZendeskAccounts=f.zendeskAccounts.rows};var b=!0,A=1;function E(e){f.zendeskAccounts=e||{count:0,rows:[]}}function y(e){m.intZendeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.zendeskAccounts.rows,{id:e.id}),f.zendeskAccounts.count-=1,f.zendeskAccounts.rows.length||f.getZendeskAccounts(),p.success({title:_.startCase("ZendeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZendeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZendeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getZendeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zendeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ZendeskAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOACCOUNT",g.zohoAccount=angular.copy(l),g.zohoAccounts=r,g.newZohoAccount=!1,g.zohoAccount||(g.zohoAccount={host:"zoho.com",zone:"EU",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_ZOHOACCOUNT",g.newZohoAccount=!0),g.addNewZohoAccount=function(){g.errors=[],d.intZohoAccount.save(g.zohoAccount).$promise.then(function(e){g.zohoAccounts.unshift(e.toJSON()),o.success({title:"ZohoAccount properly created",msg:g.zohoAccount.name?g.zohoAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoAccount=function(){g.errors=[],d.intZohoAccount.update({id:g.zohoAccount.id},g.zohoAccount).$promise.then(function(e){var n=_.find(g.zohoAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZohoAccount properly saved!",msg:g.zohoAccount.name?g.zohoAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zohoAccount will be deleted.").ariaLabel("Delete ZohoAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZohoAccount.delete({id:g.zohoAccount.id}).$promise.then(function(){_.remove(g.zohoAccounts,{id:g.zohoAccount.id}),o.success({title:"ZohoAccount properly deleted!",msg:(g.zohoAccount.name||"zohoAccount")+" has been deleted!"}),v(g.zohoAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zohoAccounts","zohoAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zohoAccount={},o.zohoConfiguration={},o.configurations=[],o.selectedZohoConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.zohoAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZohoAccount.getConfigurations({id:o.zohoAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getZohoConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZohoConfiguration=function(e){o.zohoConfiguration=o.configurations[e],o.selectedZohoConfiguration=e,i.intZohoConfiguration.getSubjects({id:o.zohoConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZohoConfiguration.getDescriptions({id:o.zohoConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZohoConfiguration.getFields({id:o.zohoConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZohoConfiguration=function(e,n){a.show({controller:"CreateOrEditZohoConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZohoConfiguration(0)})},o.deleteZohoConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the zohoConfiguration?").htmlContent("<b>"+(n.name||"zohoConfiguration")+"</b> will be deleted.").ariaLabel("delete zohoConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intZohoConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"ZohoConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZohoConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){i.intZohoConfiguration.update({id:o.zohoConfiguration.id},o.zohoConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZohoAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOCONFIGURATION",g.zohoConfiguration=angular.copy(l),g.configurations=r,g.newZohoConfiguration=!1,g.zohoConfiguration||(g.zohoConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZOHOCONFIGURATION",g.newZohoConfiguration=!0),g.addNewZohoConfiguration=function(){g.errors=[],d.intZohoAccount.addConfiguration({id:n.params.id},g.zohoConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ZohoConfiguration properly created",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoConfiguration=function(){g.errors=[],d.intZohoConfiguration.update({id:g.zohoConfiguration.id},g.zohoConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZohoConfiguration properly saved!",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zohoConfiguration will be deleted.").ariaLabel("Delete ZohoConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZohoConfiguration.delete({id:g.zohoConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.zohoConfiguration.id}),o.success({title:"ZohoConfiguration properly deleted!",msg:(g.zohoConfiguration.name||"zohoConfiguration")+" has been deleted!"}),v(g.zohoConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","zohoConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intZohoField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.zohoAccount=c||e.params.zohoAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZohoAccounts=function(){e.go("app.integrations.zohoAccounts",{},{reload:"app.integrations.zohoAccounts"})},u.saveZohoAccount=function(){r.intZohoAccount.update({id:u.zohoAccount.id},u.zohoAccount).$promise.then(function(){l.success({title:"ZohoAccount updated!",msg:u.zohoAccount.name?u.zohoAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZohoAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zohoAccount","userProfileSection"],angular.module("app.integrations").controller("ZohoAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.zohoAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="zohoAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedZohoAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arrayhost=_.keyBy([{option:"zoho.com",value:"'zoho.com'"},{option:"zoho.eu",value:"'zoho.eu'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayzone=_.keyBy([{option:"US",value:"'US'"},{option:"AU",value:"'AU'"},{option:"EU",value:"'EU'"},{option:"IN",value:"'IN'"},{option:"CN",value:"'CN'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.zohoAccounts.edit",{id:e.id,zohoAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intZohoAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZohoAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZohoAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("zohoAccount")+"?").htmlContent("<b>"+(e.name||"zohoAccount")+"</b> will be deleted.").ariaLabel("delete zohoAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getZohoAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intZohoAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ZohoAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditZohoAccount=function(e,n){i.show({controller:"CreateOrEditZohoAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoAccount:n,zohoAccounts:f.zohoAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteZohoAccount=y,f.exportSelectedZohoAccounts=function(){var e=angular.copy(f.selectedZohoAccounts);return f.selectedZohoAccounts=[],e},f.deleteSelectedZohoAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected zohoAccounts?").htmlContent("<b>"+f.selectedZohoAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZohoAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedZohoAccounts.forEach(function(e){y(e)}),f.selectedZohoAccounts=[]})},f.deselectZohoAccounts=function(){f.selectedZohoAccounts=[]},f.selectAllZohoAccounts=function(){f.selectedZohoAccounts=f.zohoAccounts.rows};var b=!0,A=1;function E(e){f.zohoAccounts=e||{count:0,rows:[]}}function y(e){m.intZohoAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.zohoAccounts.rows,{id:e.id}),f.zohoAccounts.count-=1,f.zohoAccounts.rows.length||f.getZohoAccounts(),p.success({title:_.startCase("ZohoAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZohoAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZohoAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getZohoAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zohoAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ZohoAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="JSCRIPTY.EDIT_PROJECT",g.project=angular.copy(l),g.projects=r,g.newProject=!1,g.project||(g.project={enableUncompleteSave:!0,sendUnpauseOnSubmit:!0},g.title="JSCRIPTY.NEW_PROJECT",g.newProject=!0),g.addNewProject=function(){g.errors=[],d.jscriptyProject.save(g.project).$promise.then(function(e){g.projects.unshift(e.toJSON()),o.success({title:"Project properly created",msg:g.project.name?g.project.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveProject=function(){g.errors=[],d.jscriptyProject.update({id:g.project.id},g.project).$promise.then(function(e){var n=_.find(g.projects,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Project properly saved!",msg:g.project.name?g.project.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteProject=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.jscriptyProject.delete({id:g.project.id}).$promise.then(function(){_.remove(g.projects,{id:g.project.id}),o.success({title:"Project properly deleted!",msg:(g.project.name||"project")+" has been deleted!"}),v(g.project)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","projects","project","api","Auth","license","setting","crudPermissions"],angular.module("app.jscripty").controller("CreateOrEditProjectDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o){var r=this;r.currentUser=i.getCurrentUser(),r.project={},r.localizationMap=o;var l=new Date;r.pickerModel={dateStart:new Date(l.getFullYear(),l.getMonth(),1),dateEnd:new Date(l.getFullYear(),l.getMonth()+1,0),selectedTemplate:"TM"},r.init=function(e,n){r.project=e,r.userProfile=n,r.getAnswers()},r.getSummary=function(){return a.jscriptyProject.getSummary({id:r.project.id,startTime:{$gte:r.pickerModel.dateStart,$lte:moment(r.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format()},nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","jscriptyProjectSummary_"+r.project.id+".csv"),a.click()}else s.info({title:"EXPORT",msg:"No answers available"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.getSummary",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.getAnswers=function(){return r.hasIdAnswers=!1,a.jscriptyProject.getAnswers({id:r.project.id,sort:"-createdAt,questionId",createdAt:{$gte:moment(r.pickerModel.dateStart).add(0,"hours").add(0,"minutes").add(0,"seconds").utcOffset(0,!0).format(),$lte:moment(r.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").utcOffset(0,!0).format()},nolimit:!0}).$promise.then(function(e){if(e&&e.rows&&e.hasOwnProperty("count")){r.answers={};for(var n=0,t=e.count;n<t;n++)e.rows[n].questionId&&(r.hasIdAnswers=!0,r.answers.hasOwnProperty(e.rows[n].questionId)||(r.answers[e.rows[n].questionId]={question:e.rows[n].question,answers:{},sum:0}),""===e.rows[n].answer&&(e.rows[n].answer="NO_ANSWER"),r.answers[e.rows[n].questionId].answers[e.rows[n].answer]?r.answers[e.rows[n].questionId].answers[e.rows[n].answer]+=1:r.answers[e.rows[n].questionId].answers[e.rows[n].answer]=1,r.answers[e.rows[n].questionId].sum+=1)}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETANSWERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$mdDialog","$document","$window","api","Auth","toasty","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("ProjectAnswersController",e)}(),function(){"use strict";angular.module("app.jscripty").controller("ProjectBuilderController",function(){var n=this;n.project={},n.optionsBuilder={questionTypes:["text","textarea","radio","checkbox","select","number","date","time","email","range","url"],elementTypes:["question","paragraph"]},n.init=function(e){n.project=e,_.isObjectLike(e.formData)?n.project.formData=e.formData:n.isJsonString(e.formData)?n.project.formData=JSON.parse(e.formData):n.project.formData={}},n.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0}})}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newProject=!0,r.project=angular.copy(i),r.projects=s,r.title=o.instant("JSCRIPTY.CLONE_PROJECT"),i&&i.name&&(r.title+=": "+i.name),r.cloneProject=function(){return e.jscriptyProject.clone({id:i.id},r.project).$promise.then(function(e){r.projects.unshift(e.toJSON()),a.success({title:"Project properly cloned",msg:r.project.name?r.project.name+" has been cloned!":""}),t.go("app.jscripty.projects.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","project","projects","$translate"],angular.module("app.jscripty").controller("ProjectcloneController",e)}(),function(){"use strict";function e(a,i,n){var o=this;o.project={},o.responseData={},o.formViewer={},o.init=function(e){o.project=e,n.$on("mwForm.pageEvents.pageCurrentChanged",function(e,n){if(n.currentPage&&o.project.formData&&o.project.formData.pages)for(var t=0,a=o.project.formData.pages.length;t<a;t++)if(n.currentPage.number<t+1&&o.project.formData.pages[t].elements)for(var i=0,s=o.project.formData.pages[t].elements.length;i<s;i++)"question"===o.project.formData.pages[t].elements[i].type&&o.project.formData.pages[t].elements[i].question&&delete o.responseData[o.project.formData.pages[t].elements[i].question.id]})},o.onSubmit=function(e){var n=a.defer(),t=i.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("SAVE").cancel("CANCEL");return i.show(t).then(function(){n.resolve(!0)},function(){n.reject()}),n.promise},o.resetViewer=function(){o.formViewer.reset&&o.formViewer.reset()}}e.$inject=["$q","$mdDialog","$scope"],angular.module("app.jscripty").controller("ProjectViewerController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.projectSessions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.jscriptyProject.getSessions(m.query,u).$promise}function g(e){d.jscriptySessionReport.delete({id:e.id}).$promise.then(function(){_.remove(m.projectSessions.rows,{id:e.id}),m.projectSessions.count-=1,m.projectSessions.rows.length||p(),l.success({title:"Session deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETjscriptyProject"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.project={},m.projectSessions={count:0,rows:[]},m.selectedProjectSessions=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,starttime,endtime,membername,calleridnum,completed",sort:"-starttime",limit:10,page:1},m.init=function(e,n,t){m.project=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.id=m.project.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the session?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("session #")+e.id||"session")+"</b> will be deleted.").ariaLabel("delete session").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getProjectSessions=p,m.createOrEditProjectSession=function(e,n){o.show({controller:"CreateOrEditSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:m.project,session:n,sessions:m.projectSessions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.showQuestionsProjectSession=function(e,t){o.show({controller:"ShowQuestionsSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{questions:["apiResolver","$stateParams",function(e,n){return e.resolve("jscriptySessionReport@getQuestions",{fields:"question,answer",sort:"id",id:t.id})}]},locals:{project:m.project,session:t}})},m.exportSelectedProjectSessions=function(){var e=angular.copy(m.selectedProjectSessions);return m.selectedProjectSessions=[],e},m.deleteProjectSession=g,m.deleteSelectedProjectSessions=function(e){var n=o.confirm().title("Are you sure want to delete the selected sessions?").htmlContent("<b>"+m.selectedProjectSessions.length+" selected</b> will be deleted.").ariaLabel("delete sessions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedProjectSessions.forEach(function(e){g(e)}),m.selectedProjectSessions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.jscripty").controller("ProjectSessionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){this.title="JSCRIPTY.SESSION_RESULTS",this.session=s,this.questions=o,this.project=r,this.closeDialog=function(e){a.hide(e)}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","session","questions","project","api"],angular.module("app.jscripty").controller("ShowQuestionsSessionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.project=c||e.params.project||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.clonedialog=function(e,n){t.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{project:e,projects:p.projects?p.projects.rows:[],crudPermissions:p.crudPermissions}})},p.alert=l.info,p.gotoProjects=function(){e.go("app.jscripty.projects",{},{reload:"app.jscripty.projects"})},p.saveProject=function(){r.jscriptyProject.update({id:p.project.id},p.project).$promise.then(function(){l.success({title:"Project updated!",msg:p.project.name?p.project.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","project","userProfile","userProfileSection"],angular.module("app.jscripty").controller("JscriptyProjectController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.projects=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="projects",f.listOrder="",f.listOrderAsc=null,f.selectedProjects=[],f.query={fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.jscripty.projects.edit",{id:e.id,project:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{project:e,projects:f.projects?f.projects.rows:[],crudPermissions:f.crudPermissions}})},f.sessionsgoto=function(e,n){t.go("app.jscripty.projects.edit",{id:e.id,tab:3})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("project")+"?").htmlContent("<b>"+(e.name||"project")+"</b> will be deleted.").ariaLabel("delete project").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getProjects=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.jscriptyProject.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Projects",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditProject=function(e,n){i.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:n,projects:f.projects.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteProject=y,f.exportSelectedProjects=function(){var e=angular.copy(f.selectedProjects);return f.selectedProjects=[],e},f.deleteSelectedProjects=function(e){var n=i.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+f.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedProjects.forEach(function(e){y(e)}),f.selectedProjects=[]})},f.deselectProjects=function(){f.selectedProjects=[]},f.selectAllProjects=function(){f.selectedProjects=f.projects.rows};var b=!0,A=1;function E(e){f.projects=e||{count:0,rows:[]}}function y(e){m.jscriptyProject.delete({id:e.id}).$promise.then(function(){_.remove(f.projects.rows,{id:e.id}),f.projects.count-=1,f.projects.rows.length||f.getProjects(),p.success({title:_.startCase("Project")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEjscriptyProject"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getProjects())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","projects","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.jscripty").controller("JscriptyProjectsController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d,c,m,u){var p,g=this;function v(e){t.hide(e)}g.currentUser=l.getCurrentUser(),g.errors=[],g.setting=c,g.license=d,g.crudPermissions=m,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.mailAccount=angular.copy(s),g.mailAccounts=n,g.cloudProviders=o,g.providers=u.getEmailProviders(),g.newMailAccount=!1,g.mailAccount||(g.mailAccount={active:!0,service:"null",authentication:!0,fontSize:13,waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.newMailAccount=!0),e.params.id&&(g.mailAccount.MailAccountId=e.params.id),g.addNewMailAccount=function(){g.errors=[],r.mailAccount.save(g.mailAccount).$promise.then(function(e){g.mailAccounts.unshift(e.toJSON()),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_CREATED_SUCCESS_TITLE")}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailAccount=function(){g.errors=[],r.mailAccount.update({id:g.mailAccount.id},g.mailAccount).$promise.then(function(e){var n=_.find(g.mailAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_SAVED_SUCCESS_TITLE")}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailAccount=function(e){if(g.mailAccount.service)return i.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});g.errors=[];var n=t.confirm().title(a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_TITLE")).content(a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_MESSAGE",{name:g.mailAccount.name})).ariaLabel("Delete Mail Account").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){r.mailAccount.delete({id:g.mailAccount.id}).$promise.then(function(){_.remove(g.mailAccounts,{id:g.mailAccount.id}),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETED_SUCCESS_TITLE")}),v(g.mailAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.onProviderChange=function(){"custom"!==g.mailAccount.provider&&(g.mailAccount.authentication=!0);"outlook365"!==g.mailAccount.provider&&(g.mailAccount.modernAuthentication=!1)},g.closeDialog=v,p=[{key:"id",value:Number(g.mailAccount.ListId)}],r.getResourcesByRole(g.currentUser,"cmList",{fields:"id,name",sort:"name",nolimit:"true"},p).then(function(e){g.lists=e.rows}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$mdDialog","$translate","toasty","mailAccounts","mailAccount","cloudProviders","api","Auth","license","setting","crudPermissions","msUtils"],angular.module("app.mail").controller("CreateOrEditMailAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.mailAccountApps.rows.length){var t=r.mailAccountApps.rows[n]?r.mailAccountApps.rows[n]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccountApp:t,mailAccount:r.mailAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.mailAccountApps.rows[n]=e:r.mailAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.mailAccountApps.rows.length;t++,0){var a=r.mailAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.mailAccount.context,a.exten=r.mailAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.mailAccount.addApplications({id:r.mailAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.mailAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.mailAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.mailAccount={},r.mailAccountApps={count:0,rows:[]},r.selectedMailAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"MailQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"mailQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:601}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Reply_Type",name:"replyType",type:"select",defaultValue:"1",values:[{option:"Reply",value:"0"},{option:"Reply All",value:"1"}],required:!0,param:1},{title:"Text",name:"text",type:"html",required:!0,param:2}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.mailAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getMailAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.mailAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getMailAccountApps=function(){r.promise=o.mailAccount.getApplications(r.query,t).$promise},r.editMailAccountApp=n,r.editInterval=function(e,n){if(r.mailAccountApps.rows.length){var t=r.mailAccountApps.rows[n]?r.mailAccountApps.rows[n]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteMailAccountApp=function(e){_.remove(r.mailAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedMailAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedMailAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedMailAccountApps.forEach(function(e){_.remove(r.mailAccountApps.rows,{id:e.id})}),r.selectedMailAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.mail").controller("MailAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailAccount.getAgents({id:c.mailAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserMailAccount?"penalty "+e.UserMailAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.mailAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailAccount.removeAgents({id:c.mailAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailAccount.addAgents({id:c.mailAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","mailAccount","mailAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.agent.text=d.slice(2,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.autoreply.text=d.slice(2,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.replyType=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.autoreply.text=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.autoreply.times=1,l.autoreply.replyType=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.replyType,e[2]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.close.text=d.slice(2,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.gotoif.text=d.slice(2,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.gotop.text=d.slice(2,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditMailAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.noop.text=d.slice(2,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.queue.text=d.slice(2,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("mail")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:601}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.system.text=d.slice(2,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.tag.text=d.slice(2,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"mailAccount",action:"getDispositions",field:"name",params:{id:m.mailAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.mailAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.mailAccountInteractions.rows.length;n+=1){var t=m.mailAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,(void 0===m.query.closed||null===m.query.closed||m.query.closed)&&delete m.query.substatus,m.promise=d.mailInteraction.get(m.query,p).$promise}function v(e){d.mailInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.mailAccountInteractions.rows,{id:e.id}),m.mailAccountInteractions.count-=1,m.mailAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){_.isEmpty(e.to)||_.includes(e.to,m.mailAccount.email)?e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.email||""):e.contactName=i.instant("MAIL.UNKNOWN"):(e.contactName=e.to.split(" <")[0],e.contactInfo=e.to.split("<").pop().split(">")[0])}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.mailAccount={},m.mailAccountInteractions={count:0,rows:[]},m.selectedMailAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.mailAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.MailAccountId=m.mailAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"plainBody",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Substatus",column:"substatus",type:"multiselect",options:{field:"name",route:{model:"mailSubstatus",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){m.subStatuses=e||{count:0,rows:[]}})}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Substatus",key:"substatus",type:"select",label:"DASHBOARDS.SELECT_SUBSTATUS",options:m.subStatuses.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NONE"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name",ngIf:"closed === 0"},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.mailInteractionDownload=function(s,e,n){return d.mailInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="mail-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getMailAccountInteractions=g,m.createOrEditMailAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:m.mailAccount,interaction:n,interactions:m.mailAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spymailInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"mail",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"mail.mailAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||MailAccountId:=$eq["+m.mailAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedMailAccountInteractions=function(){var e=angular.copy(m.selectedMailAccountInteractions);return m.selectedMailAccountInteractions=[],e},m.deleteMailAccountInteraction=v,m.deleteSelectedMailAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedMailAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMailAccountInteractions.forEach(function(e){v(e)}),m.selectedMailAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.mailAccountMailCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.mailAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.mailAccountMailCannedAnswers.rows,{id:e.id}),m.mailAccountMailCannedAnswers.count-=1,m.mailAccountMailCannedAnswers.rows.length||p(),l.success({title:"MailCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.mailAccount={},m.mailAccountMailCannedAnswers={count:0,rows:[]},m.selectedMailAccountMailCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.mailAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.MailAccountId=m.mailAccount.id,m.query.id=m.mailAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the mailCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("mailCannedAnswer #")+e.id||"mailCannedAnswer")+"</b> will be deleted.").ariaLabel("delete mailCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getMailAccountMailCannedAnswers=p,m.createOrEditMailAccountMailCannedAnswer=function(e,n){o.show({controller:"CreateOrEditMailCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:m.mailAccount,mailCannedAnswer:n,mailCannedAnswers:m.mailAccountMailCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedMailAccountMailCannedAnswers=function(){var e=angular.copy(m.selectedMailAccountMailCannedAnswers);return m.selectedMailAccountMailCannedAnswers=[],e},m.deleteMailAccountMailCannedAnswer=g,m.deleteSelectedMailAccountMailCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected mailCannedAnswers?").htmlContent("<b>"+m.selectedMailAccountMailCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete mailCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMailAccountMailCannedAnswers.forEach(function(e){g(e)}),m.selectedMailAccountMailCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILCANNEDANSWER",g.mailCannedAnswer=angular.copy(l),g.mailCannedAnswers=r,g.newMailCannedAnswer=!1,g.mailCannedAnswer||(g.mailCannedAnswer={},g.title="MAIL.NEW_MAILCANNEDANSWER",g.newMailCannedAnswer=!0),n.params.id&&(g.mailCannedAnswer.MailAccountId=n.params.id),g.addNewMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.mailCannedAnswer).$promise.then(function(e){g.mailCannedAnswers.unshift(e.toJSON()),o.success({title:"MailCannedAnswer properly created",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.mailCannedAnswer.id},g.mailCannedAnswer).$promise.then(function(e){var n=_.find(g.mailCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailCannedAnswer properly saved!",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailCannedAnswer will be deleted.").ariaLabel("Delete MailCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.mailCannedAnswer.id}).$promise.then(function(){_.remove(g.mailCannedAnswers,{id:g.mailCannedAnswer.id}),o.success({title:"MailCannedAnswer properly deleted!",msg:(g.mailCannedAnswer.name||"mailCannedAnswer")+" has been deleted!"}),v(g.mailCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailCannedAnswers","mailCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.mailAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.mailAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.MailAccountId=m.mailAccount.id,m.query.id=m.mailAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.mailAccount.id,field:"MailAccountId",route:"mailAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.mail").controller("MailAccountDispositionsController",e)}(),function(){"use strict";function e(t,a,i,s,e,n,o,r,l,d,c,m,u,p,g){var v,h,f=this;f.currentUser=d.getCurrentUser(),f.license=n,f.setting=o,f.passwordPattern=f.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",f.mailAccount=c||t.params.mailAccount||{},f.cloudProviders=m||{rows:[],count:0},f.userProfile=u,f.userProfileSection=p&&1==p.count?p.rows[0]:null,f.crudPermissions=d.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.hasModulePermissions={},f.selectedTab=t.params.tab||0,f.providers=g.getEmailProviders(),f.originalProvider=f.mailAccount.provider,f.goToRealtime=function(){return d.hasRole("admin")?t.go("app.mail.realtime.accounts",{}):r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n&&n.enabled)return t.go("app.mail.realtime.accounts",{});l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})})},f.addAgent=function(e,n){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:f.mailAccounts?f.mailAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.goToMailAccounts=function(){t.go("app.mail.mailAccounts",{},{reload:"app.mail.mailAccounts"})},f.saveMailAccount=function(){var e=angular.copy(f.mailAccount);"custom"===e.provider?e.provider=null:(f.originalProvider!==e.provider&&(e.Imap.modernAuthentication?e.Imap.password=null:e.Imap.CloudProviderId=null),e.Smtp.user=e.Imap.user,e.Smtp.pass=e.Imap.password,e.Imap.modernAuthentication||(e.Imap.CloudProviderId=null),e.Smtp.modernAuthentication=e.Imap.modernAuthentication,e.Smtp.CloudProviderId=e.Imap.CloudProviderId,e.Imap=_.omit(e.Imap,["host","port","service"]),e.Smtp=_.omit(e.Smtp,["host","port","secure","service"]));r.mailAccount.update({id:f.mailAccount.id},e).$promise.then(function(){f.originalProvider=e.provider,l.success({title:s.instant("MAIL.NOTIFICATIONS.ACCOUNT_SAVED_SUCCESS_TITLE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.onProviderChange=function(){"custom"!==f.mailAccount.provider&&(f.mailAccount.authentication=!0);"outlook365"!==f.mailAccount.provider&&(f.mailAccount.Imap.modernAuthentication=!1)},e.all((h=[{key:"id",value:Number(f.mailAccount.ListId)}],r.getResourcesByRole(f.currentUser,"cmList",{fields:"id,name",sort:"name",nolimit:"true"},h).then(function(e){f.lists=e.rows}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})),(v=[{key:"id",value:Number(f.mailAccount.mandatoryDispositionPauseId)}],r.getResourcesByRole(f.currentUser,"pause",{fields:"id,name",sort:"name",nolimit:"true"},v).then(function(e){f.pauses=e.rows}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))}e.$inject=["$state","$mdDialog","$document","$translate","$q","license","setting","api","toasty","Auth","mailAccount","cloudProviders","userProfile","userProfileSection","msUtils"],angular.module("app.mail").controller("MailAccountController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,n,r,l,d,c,m,u,p){var g=this;function v(e){g.mailAccounts=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.hasRole("admin")?g.promise=d.mailAccount.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="MailAccounts",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){if(e.service)return c.error({msg:o.instant("MAIL.NOTIFICATIONS.ACCOUNT_SERVICE_DELETE")});d.mailAccount.delete({id:e.id}).$promise.then(function(){_.remove(g.mailAccounts.rows,{id:e.id}),g.mailAccounts.count-=1,g.mailAccounts.rows.length||h(),c.success({title:o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailAccount"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.mailAccounts=n||{count:0,rows:[]},g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedMailAccounts=[],g.query={fields:"createdAt,updatedAt,id,name,provider,key,email,ListId,active,service,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},g.editstate=function(e){t.go("app.mail.mailAccounts.edit",{id:e.id,mailAccount:e,crudPermissions:g.crudPermissions})},g.verifySMTP=function(e){return e&&e.id?d.mailAccount.verifySmtp({id:e.id}).$promise.then(function(){c.success({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_SUCCESS_TITLE")})}).catch(function(e){c.error({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:e.data?JSON.stringify(e.data):e.toString()})}):c.error({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:o.instant("MAIL.NOTIFICATIONS.UNKNOWN_SMTP_SERVER")})},g.goToInteractions=function(e){t.go("app.mail.mailAccounts.edit",{id:e.id,tab:"custom"===e.provider?7:6})},g.goToRealtime=function(){return m.hasRole("admin")?t.go("app.mail.realtime.accounts",{}):d.userProfileSection.get({userProfileId:m.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n&&n.enabled)return t.go("app.mail.realtime.accounts",{});c.info({title:o.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:o.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})})},g.addAgent=function(e,n){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:g.mailAccounts?g.mailAccounts.rows:[],crudPermissions:g.crudPermissions,realtime:!1}})},g.deleteconfirm=function(e,n){var t=a.confirm().title(o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_TITLE")).content(o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_MESSAGE",{name:e.name})).ariaLabel("delete mail account").targetEvent(n).ok("OK").cancel(o.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.success=v,g.getMailAccounts=h,g.createOrEditMailAccount=function(e,n){a.show({controller:"CreateOrEditMailAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:n,mailAccounts:g.mailAccounts.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions},resolve:{cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}]}})},g.deleteMailAccount=f,g.exportSelectedMailAccounts=function(){var e=angular.copy(g.selectedMailAccounts);return g.selectedMailAccounts=[],e},g.deleteSelectedMailAccounts=function(e){var n=a.confirm().title(o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETE_TITLE")).content(o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETE_MESSAGE",{total:g.selectedMailAccounts.length})).ariaLabel("delete mail accounts").targetEvent(e).ok("OK").cancel(o.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedMailAccounts.forEach(function(e){f(e)}),g.selectedMailAccounts=[],c.success({title:o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETED_SUCCESS_TITLE")})})},g.deselectMailAccounts=function(){g.selectedMailAccounts=[]},g.selectAllMailAccounts=function(){g.selectedMailAccounts=g.mailAccounts.rows};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?s(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","mailAccounts","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILQUEUE",g.mailQueue=angular.copy(l),g.mailQueues=r,g.newMailQueue=!1,g.mailQueue||(g.mailQueue={strategy:"beepall",timeout:10},g.title="MAIL.NEW_MAILQUEUE",g.newMailQueue=!0),g.addNewMailQueue=function(){g.errors=[],d.mailQueue.save(g.mailQueue).$promise.then(function(e){g.mailQueues.unshift(e.toJSON()),o.success({title:"MailQueue properly created",msg:g.mailQueue.name?g.mailQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailQueue=function(){g.errors=[],d.mailQueue.update({id:g.mailQueue.id},g.mailQueue).$promise.then(function(e){var n=_.find(g.mailQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailQueue properly saved!",msg:g.mailQueue.name?g.mailQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailQueue will be deleted.").ariaLabel("Delete MailQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.mailQueue.delete({id:g.mailQueue.id}).$promise.then(function(){_.remove(g.mailQueues,{id:g.mailQueue.id}),o.success({title:"MailQueue properly deleted!",msg:(g.mailQueue.name||"mailQueue")+" has been deleted!"}),v(g.mailQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailQueues","mailQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailQueue.getAgents({id:c.mailQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.mailQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.removeAgents({id:c.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.addAgents({id:c.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","mailQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailQueue.getTeams({id:l.mailQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.mailQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MAIL.ALL_TEAMS"),labelSelected:t.instant("MAIL.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.removeTeams({id:l.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.addTeams({id:l.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.mailQueue=c||e.params.mailQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoMailQueues=function(){e.go("app.mail.mailQueues",{},{reload:"app.mail.mailQueues"})},u.saveMailQueue=function(){r.mailQueue.update({id:u.mailQueue.id},u.mailQueue).$promise.then(function(){l.success({title:"MailQueue updated!",msg:u.mailQueue.name?u.mailQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","mailQueue","userProfileSection"],angular.module("app.mail").controller("MailQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.mailQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="mailQueues",f.listOrder="",f.listOrderAsc=null,f.selectedMailQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.mail.mailQueues.edit",{id:e.id,mailQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:f.mailQueues?f.mailQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:f.mailQueues?f.mailQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("mailQueue")+"?").htmlContent("<b>"+(e.name||"mailQueue")+"</b> will be deleted.").ariaLabel("delete mailQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.mail.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.mail.realtime.queues",{})}},f.success=E,f.getMailQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.mailQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MailQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMailQueue=function(e,n){i.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:n,mailQueues:f.mailQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMailQueue=y,f.exportSelectedMailQueues=function(){var e=angular.copy(f.selectedMailQueues);return f.selectedMailQueues=[],e},f.deleteSelectedMailQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected mailQueues?").htmlContent("<b>"+f.selectedMailQueues.length+" selected</b> will be deleted.").ariaLabel("delete MailQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMailQueues.forEach(function(e){y(e)}),f.selectedMailQueues=[]})},f.deselectMailQueues=function(){f.selectedMailQueues=[]},f.selectAllMailQueues=function(){f.selectedMailQueues=f.mailQueues.rows};var b=!0,A=1;function E(e){f.mailQueues=e||{count:0,rows:[]}}function y(e){m.mailQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.mailQueues.rows,{id:e.id}),f.mailQueues.count-=1,f.mailQueues.rows.length||f.getMailQueues(),p.success({title:_.startCase("MailQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMailQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILSUBSTATUS",g.mailSubstatus=angular.copy(l),g.mailSubtatuses=r,g.newMailSubstatus=!1,g.mailSubstatus||(g.mailSubstatus={},g.title="MAIL.NEW_MAILSUBSTATUS",g.newMailSubstatus=!0),g.addNewMailSubstatus=function(){g.errors=[],d.mailSubstatus.save(g.mailSubstatus).$promise.then(function(e){g.mailSubtatuses.unshift(e.toJSON()),o.success({title:"MailSubstatus properly created",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailSubstatus=function(){g.errors=[],d.mailSubstatus.update({id:g.mailSubstatus.id},g.mailSubstatus).$promise.then(function(e){var n=_.find(g.mailSubtatuses,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailSubstatus properly saved!",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailSubstatus=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailSubstatus will be deleted.").ariaLabel("Delete MailSubstatus").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.mailSubstatus.delete({id:g.mailSubstatus.id}).$promise.then(function(){_.remove(g.mailSubtatuses,{id:g.mailSubstatus.id}),o.success({title:"MailSubstatus properly deleted!",msg:(g.mailSubstatus.name||"mailSubstatus")+" has been deleted!"}),v(g.mailSubstatus)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailSubtatuses","mailSubstatus","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailSubstatusDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.mailSubtatuses=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="mailSubtatuses",f.listOrder="",f.listOrderAsc=null,f.selectedMailSubstatuses=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailSubstatus:e,mailSubtatuses:f.mailSubtatuses.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("mailSubstatus")+"?").htmlContent("<b>"+(e.name||"mailSubstatus")+"</b> will be deleted.").ariaLabel("delete mailSubstatus").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMailSubstatuses=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.mailSubstatus.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MailSubstatuses",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMailSubstatus=function(e,n){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailSubstatus:n,mailSubtatuses:f.mailSubtatuses.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMailSubstatus=y,f.exportSelectedMailSubstatuses=function(){var e=angular.copy(f.selectedMailSubstatuses);return f.selectedMailSubstatuses=[],e},f.deleteSelectedMailSubstatuses=function(e){var n=i.confirm().title("Are you sure want to delete the selected mailSubtatuses?").htmlContent("<b>"+f.selectedMailSubstatuses.length+" selected</b> will be deleted.").ariaLabel("delete MailSubstatuss").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMailSubstatuses.forEach(function(e){y(e)}),f.selectedMailSubstatuses=[]})},f.deselectMailSubstatuses=function(){f.selectedMailSubstatuses=[]},f.selectAllMailSubstatuses=function(){f.selectedMailSubstatuses=f.mailSubtatuses.rows};var b=!0,A=1;function E(e){f.mailSubtatuses=e||{count:0,rows:[]}}function y(e){m.mailSubstatus.delete({id:e.id}).$promise.then(function(){_.remove(f.mailSubtatuses.rows,{id:e.id}),f.mailSubtatuses.count-=1,f.mailSubtatuses.rows.length||f.getMailSubstatuses(),p.success({title:_.startCase("MailSubstatus")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailSubstatus"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailSubstatus",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMailSubstatuses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailSubtatuses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailSubstatusesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){_.forIn(p.mailAccounts,function(e,n){p.rpcMailAccounts[n]&&_.merge(e,p.rpcMailAccounts[n])}),_.forIn(p.mailAccounts,function(n,e){var t={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),fields:"id,createdAt"};s.mailAccount.getMessages(t).$promise.then(function(e){return e&&(n.in=e.count||0,n.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),t.direction="out",s.mailAccount.getMessages(t).$promise}).then(function(e){e&&(n.out=e.count||0,n.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}p.currentUser=u.getCurrentUser(),p.count=l&&l.count?l.count:0,p.mailAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},p.rpcMailAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.query={sort:"-name",limit:10,page:1},p.success=f,p.$onInit=g,p.getMailAccounts=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=s.mailAccount.get(p.query,f).$promise:(p.query.id=p.userProfile.id,p.query.section="MailAccounts",p.promise=s.userProfile.getResources(p.query,f).$promise)},p.onSave=function(e){p.mailAccounts[e.id]&&_.merge(p.mailAccounts[e.id],e)},p.onMailMessageSave=function(e){p.mailAccounts[e.MailAccountId]&&("in"==e.direction?(p.mailAccounts[e.MailAccountId].in+=1,p.mailAccounts[e.MailAccountId].lastIn=e.createdAt):(p.mailAccounts[e.MailAccountId].out+=1,p.mailAccounts[e.MailAccountId].lastOut=e.createdAt))},p.goToMailAccount=function(e,n){i.go("app.mail.mailAccounts.edit",{id:n.id,mailAccount:n})},p.verifySmtp=function(e,n){{if(n&&n.id)return s.mailAccount.verifySmtp({id:n.id}).$promise.then(function(){r.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){r.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});r.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},p.order=[],_.forIn(p.mailAccounts,function(e,n){p.order.push(e.id)}),o.on("mailAccount:save",p.onSave),o.on("mailAccount:update",p.onSave),o.on("mailMessage:save",p.onMailMessageSave);var v=!0,h=1;function f(e){if(p.mailAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){p.order=[];for(var n=0;n<e.rows.length;n++)p.order.push(e.rows[n].id)}g()}e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=h),p.getMailAccounts())}),e.$on("$destroy",function(){o.removeAllListeners("mailAccount:save"),o.removeAllListeners("mailAccount:update"),o.removeAllListeners("mailMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","mailAccounts","rpcMailAccounts","userProfile","userProfileSection","Auth"],angular.module("app.mail").controller("MailAccountsRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"MailQueues":void 0,channel:"mail",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("MAIL.MAILQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:n,mailQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:n,mailQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("mail_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userMailQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.MailQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userMailQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.MailQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"mail")})}),e.$on("$destroy",function(){r.removeAllListeners("mail_queue:save"),r.removeAllListeners("userMailQueue:remove"),r.removeAllListeners("userMailQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.mail").controller("QueuesMailRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.mail.realtime.agents":this.selectedTab=0;break;case"app.mail.realtime.queues":this.selectedTab=1;break;case"app.mail.realtime.accounts":this.selectedTab=2;break;default:this.selectedTab=0,t.go("app.mail.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.mail.realtime.agents");break;case 1:t.go("app.mail.realtime.queues");break;case 2:t.go("app.mail.realtime.accounts");break;default:t.go("app.mail.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.mail").controller("MailRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MARKETPLACE.EDIT_PLUGIN",g.plugin=angular.copy(l),g.plugins=r,g.newPlugin=!1,g.plugin||(g.plugin={},g.title="MARKETPLACE.NEW_PLUGIN",g.newPlugin=!0),g.addNewPlugin=function(){g.errors=[],d.plugin.save(g.plugin).$promise.then(function(e){g.plugins.unshift(e.toJSON()),o.success({title:"Plugin properly created",msg:g.plugin.name?g.plugin.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePlugin=function(){g.errors=[],d.plugin.update({id:g.plugin.id},g.plugin).$promise.then(function(e){var n=_.find(g.plugins,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Plugin properly saved!",msg:g.plugin.name?g.plugin.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePlugin=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The plugin will be deleted.").ariaLabel("Delete Plugin").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.plugin.delete({id:g.plugin.id}).$promise.then(function(){_.remove(g.plugins,{id:g.plugin.id}),o.success({title:"Plugin properly deleted!",msg:(g.plugin.name||"plugin")+" has been deleted!"}),v(g.plugin)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","plugins","plugin","api","Auth","license","setting","crudPermissions"],angular.module("app.marketplace").controller("CreateOrEditPluginDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.plugin=c||e.params.plugin||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoPlugins=function(){e.go("app.marketplace.plugins",{},{reload:"app.marketplace.plugins"})},u.savePlugin=function(){r.plugin.update({id:u.plugin.id},u.plugin).$promise.then(function(){l.success({title:"Plugin updated!",msg:u.plugin.name?u.plugin.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETplugin",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","plugin","userProfileSection"],angular.module("app.marketplace").controller("MarketplacePluginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.plugins=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="plugins",f.listOrder="",f.listOrderAsc=null,f.selectedPlugins=[],f.query={fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,page:1},f.installing=!1,f.arraysidebar=_.keyBy([{option:"Always",value:"'always'"},{option:"Admin Only",value:"'adminOnly'"},{option:"Agent Only",value:"'agentOnly'"},{option:"Never",value:"'never'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.installplugin=function(e){{if("script"!==e.type)return e.active=!0,m.plugin.update({id:e.id},e).$promise.then(function(){p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});f.installing=!0,m.pm2.save({name:e.scriptName,script:e.path+"/"+e.scriptPath}).$promise.then(function(){return e.active=!0,m.plugin.update({id:e.id},e).$promise}).then(function(){f.installing=!1,p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.save"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.save",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}},f.editstate=function(e,n){t.go("app.marketplace.plugins.edit",{id:e.id,plugin:e,crudPermissions:f.crudPermissions})},f.stopplugin=function(e,n){var t=i.confirm().title("Are you sure want to stop the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be stoppped.").ariaLabel("stop plugin process").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){var t;t=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.update({id:n.pm_id,status:"stopped"}).$promise.then(function(){p.success({title:"Process stopped!",msg:"Attached pm2 process successfully stopped"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},f.restartplugin=function(e,n){var t=i.confirm().title("Are you sure want to restart the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be restarted.").ariaLabel("restart plugin process").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){var t;t=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.update({id:n.pm_id,status:"online"}).$promise.then(function(){p.success({title:"Process restarted!",msg:"Attached pm2 process successfully restarted"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},f.downloadfile2=function(s,e){return m.plugin.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.name.replace(" ","_").toLowerCase()+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.uninstallplugin=function(e,n){var t=i.confirm().title("Are you sure want to uninstall the plugin?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be uninstalled.").ariaLabel("uninstall plugin").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){!function(t){"script"===t.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.delete({id:n.pm_id,name:t.scriptName}).$promise}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});t.active=!1,m.plugin.update({id:t.id},t).$promise.then(function(){p.success({title:"Plugin uninstalled!",msg:t.name?t.name+" has been uninstalled!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}(e)},function(){console.log("CANCEL")})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("plugin")+"?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be deleted.").ariaLabel("delete plugin").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getPlugins=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.plugin.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Plugins",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditPlugin=function(e,n){i.show({controller:"CreateOrEditPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugin:n,plugins:f.plugins.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletePlugin=y,f.exportSelectedPlugins=function(){var e=angular.copy(f.selectedPlugins);return f.selectedPlugins=[],e},f.deleteSelectedPlugins=function(e){var n=i.confirm().title("Are you sure want to delete the selected plugins?").htmlContent("<b>"+f.selectedPlugins.length+" selected</b> will be deleted.").ariaLabel("delete Plugins").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedPlugins.forEach(function(e){y(e)}),f.selectedPlugins=[]})},f.deselectPlugins=function(){f.selectedPlugins=[]},f.selectAllPlugins=function(){f.selectedPlugins=f.plugins.rows},f.uploadPlugin=function(e){i.show({controller:"UploadPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugins:f.plugins.rows}})};var b=!0,A=1;function E(e){f.plugins=e||{count:0,rows:[]}}function y(t){t.active&&"script"==t.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)return p.error({title:"Plugin not deleted!",msg:"Failed to retrieve pm2 processes"});var n=_.find(e.rows,{name:t.scriptName});n?m.pm2.delete({id:n.pm_id,name:t.scriptName}).$promise:console.log("No '%s' process found",t.scriptName)}).catch(function(e){return p.error({title:"PM2 process not found!",msg:"Failed to delete the attached pm2 process"})}),m.plugin.delete({id:t.id}).$promise.then(function(){_.remove(f.plugins.rows,{id:t.id}),f.plugins.count-=1,f.plugins.rows.length||f.getPlugins(),p.success({title:_.startCase("Plugin")+" deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEplugin"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEplugin",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getPlugins())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","plugins","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.marketplace").controller("MarketplacePluginsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this,r=4,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="MARKETPLACE.UPLOAD_PLUGIN",o.plugins=a,o.uploadPlugins=[],o.uploadState="none",o.plugin={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/plugins"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var n=["zip"];if(!_.includes(n,e.getExtension()))return t.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>l)return t.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.plugin={id:e.uniqueIdentifier,file:e},o.uploadPlugins.unshift(o.plugin),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.plugins.unshift(JSON.parse(e)),angular.forEach(o.uploadPlugins,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result}}})},o.uploadError=function(e,n){o.ngFlow.flow.cancel(),t.error({title:"Upload error",msg:"Cannot upload the plugin"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",t.success({title:"Upload completed",msg:o.plugin.file.name+" uploaded successfully"}))},o.closeDialog=function(){n.hide()}}e.$inject=["$cookies","$mdDialog","toasty","plugins","api","Auth"],angular.module("app.marketplace").controller("UploadPluginDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=c.getCurrentUser(),v.errors=[],v.setting=u,v.license=m,v.crudPermissions=p,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="MOTIONDIALER.EDIT_HOPPER",v.hopper=angular.copy(l),v.hoppers=r,v.newHopper=!1,v.contact,v.dateTime,v.hopper||(v.hopper={},v.title="MOTIONDIALER.NEW_HOPPER",v.newHopper=!0),n.params.id&&("IvrCampaign"===g?v.hopper.CampaignId=n.params.id:"QueueCampaign"==g?v.hopper.VoiceQueueId=n.params.id:v.hopper.ContactId=n.params.id),v.addNewHopper=function(){v.errors=[],d.cmHopper.save(v.hopper).$promise.then(function(e){v.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:v.hopper.name?v.hopper.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveHopper=function(){var t,a,i,s;v.errors=[],v.hopper.UserId=v.hopper.recallme?v.hopper.UserId:null,v.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:v.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){v.hopper.dialTimezone=v.contact.dialTimezone,d.cmHopper.update({id:v.hopper.id},_.omit(v.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme}).$promise.then(function(){d.cmContact.update({id:a.ContactId,dialTimezone:v.contact.dialTimezone})})})});var n=_.find(v.hoppers,{id:e.id});n&&_.merge(n,_.pick(e.toJSON(),_.keys(n))),o.success({title:"Hopper properly saved!",msg:v.hopper.name?v.hopper.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},v.deleteHopper=function(e){v.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:v.hopper.id}).$promise.then(function(){_.remove(v.hoppers,{id:v.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(v.hopper.name||"hopper")+" has been deleted!"}),h(v.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=h,v.recalcTZTime=function(){if(_.isNil(v.hopper.VoiceQueueId)){var e=v.hopper.CampaignId;d.campaign.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.hopper.scheduledat=moment(v.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledat=moment(v.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}})}else{var e=v.hopper.VoiceQueueId;e&&d.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.hopper.scheduledat=moment(v.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledat=moment(v.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}})}},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){v.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){v.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(v.agents,{id:e.resourceId})}),t=null;if(v.hopper&&(t=_.find(v.agents,{id:Number(v.hopper.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(v.agents,{id:t.id});a.canSelect=!1,n.push(a)}v.agents=n})}else{var t=[],a=null;v.hopper&&(a=_.find(v.agents,{id:Number(v.hopper.UserId)}));for(var i=0;i<v.agents.length;i++)a&&v.agents[i].id===a.id&&(v.agents[i].canSelect=!1,t.push(v.agents[i]));v.agents=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.cmContact.get({id:v.hopper.ContactId,fields:"dialTimezone"}).$promise.then(function(e){var n;v.contact=e,_.isNil(v.hopper.VoiceQueueId)?(n=v.hopper.CampaignId)&&d.campaign.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;v.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.dateTime=moment(v.hopper.scheduledat).add(n-t,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.dateTime=moment(v.hopper.scheduledat).add(n-0,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):(n=v.hopper.VoiceQueueId)&&d.voiceQueue.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;v.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.dateTime=moment(v.hopper.scheduledat).add(n-t,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.dateTime=moment(v.hopper.scheduledat).add(n-0,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions","from"],angular.module("app.motiondialer").controller("HopperdateController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_IVRCAMPAIGN",g.ivrCampaign=angular.copy(l),g.ivrCampaigns=r,g.newIvrCampaign=!1,g.ivrCampaign||(g.ivrCampaign={active:!0,type:"ivr",dialCheckDuplicateType:"always",dialCutDigit:0,limitCalls:30,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialNoSuchNumberMaxRetry:3,dialNoSuchNumberRetryFrequency:150,dialDropMaxRetry:3,dialDropRetryFrequency:150,dialAbandonedMaxRetry:3,dialAbandonedRetryFrequency:150,dialMachineMaxRetry:3,dialMachineRetryFrequency:150,dialAgentRejectMaxRetry:3,dialAgentRejectRetryFrequency:150,dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3},g.title="MOTIONDIALER.NEW_IVRCAMPAIGN",g.newIvrCampaign=!0),g.addNewIvrCampaign=function(){g.errors=[],d.campaign.save(g.ivrCampaign).$promise.then(function(e){g.ivrCampaigns.unshift(e.toJSON()),o.success({title:"IvrCampaign properly created",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveIvrCampaign=function(){g.errors=[],d.campaign.update({id:g.ivrCampaign.id},g.ivrCampaign).$promise.then(function(e){var n=_.find(g.ivrCampaigns,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"IvrCampaign properly saved!",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteIvrCampaign=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The ivrCampaign will be deleted.").ariaLabel("Delete IvrCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.campaign.delete({id:g.ivrCampaign.id}).$promise.then(function(){_.remove(g.ivrCampaigns,{id:g.ivrCampaign.id}),o.success({title:"IvrCampaign properly deleted!",msg:(g.ivrCampaign.name||"ivrCampaign")+" has been deleted!"}),v(g.ivrCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})});g.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.trunks=n})}else g.trunks=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.projects,{id:e.resourceId})}),t=null;if(g.ivrCampaign&&(t=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.projects,{id:t.id});a.canSelect=!1,n.push(a)}g.projects=n})}else{var t=[],a=null;g.ivrCampaign&&(a=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)}));for(var i=0;i<g.projects.length;i++)a&&g.projects[i].id===a.id&&(g.projects[i].canSelect=!1,t.push(g.projects[i]));g.projects=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.ivrCampaign&&(t=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.ivrCampaign&&(a=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","ivrCampaigns","ivrCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditIvrCampaignDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=n,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignblacklistaddController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newIvrCampaign=!0,r.ivrCampaign=angular.copy(i),r.ivrCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_IVRCAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneIvrCampaign=function(){return e.campaign.clone({id:i.id},r.ivrCampaign).$promise.then(function(e){r.ivrCampaigns.unshift(e.toJSON()),a.success({title:"IvrCampaign properly cloned",msg:r.ivrCampaign.name?r.ivrCampaign.name+" has been cloned!":""}),t.go("app.motiondialer.ivrCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","ivrCampaign","ivrCampaigns","$translate"],angular.module("app.motiondialer").controller("IvrCampaigncloneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperBlacks=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperBlacks(m.query,u).$promise}function g(e){d.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperBlacks.rows,{id:e.id}),m.ivrCampaignHopperBlacks.count-=1,m.ivrCampaignHopperBlacks.rows.length||p(),l.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHopperBlacks={count:0,rows:[]},m.selectedIvrCampaignHopperBlacks=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperBlack #")+e.id||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperBlacks=p,m.createOrEditIvrCampaignHopperBlack=function(e,n){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperBlack:n,hopperBlacks:m.ivrCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperBlacks=function(){var e=angular.copy(m.selectedIvrCampaignHopperBlacks);return m.selectedIvrCampaignHopperBlacks=[],e},m.deleteIvrCampaignHopperBlack=g,m.deleteSelectedIvrCampaignHopperBlacks=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+m.selectedIvrCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperBlacks.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperBlacks=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperFinals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperFinals(m.query,u).$promise}function g(e){d.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperFinals.rows,{id:e.id}),m.ivrCampaignHopperFinals.count-=1,m.ivrCampaignHopperFinals.rows.length||p(),l.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){d.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){l.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var n,t;"Not Found"===e.data?d.cmHopper.save((n=a,t={},t.phone=n.calleridnum,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=0,t.countcongestionretry=0,t.countnoanswerretry=0,t.countglobal=0,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=n.deleted?null:n.UserId,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.priority=n.recallme?3:2,t.recallme=!!n.recallme,t)).$promise.then(function(e){var n,t;l.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&d.cmHopperHistory.save(((t={}).calleridnum=(n=a).calleridnum,t.calleridname=n.calleridname,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=n.countbusyretry,t.countcongestionretry=n.countcongestionretry,t.countnoanswerretry=n.countnoanswerretry,t.countglobal=n.countglobal,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=c.getCurrentUser().id,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),t.edited=!0,t.state=25,t.statedesc="Restored",t.campaign=n.campaign,t.campaigntype=n.VoiceQueueId?"queue":"ivr",t))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):l.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.contacts={},m.ivrCampaign={},m.ivrCampaignHopperFinals={count:0,rows:[]},m.selectedIvrCampaignHopperFinals=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperFinal #")+e.id||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperFinals=p,m.createOrEditIvrCampaignHopperFinal=function(e,n){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperFinal:n,hopperFinals:m.ivrCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperFinals=function(){var e=angular.copy(m.selectedIvrCampaignHopperFinals);return m.selectedIvrCampaignHopperFinals=[],e},m.deleteIvrCampaignHopperFinal=g,m.deleteSelectedIvrCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+m.selectedIvrCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperFinals.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperFinals=[]})},m.moveIvrCampaignHopperFinal=v,m.moveContactsIvrCampaignHopperFinal=function(e){d.cmHopperFinal.moveContactsIvrCampaignHopperFinal({id:m.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?l.info({title:"Restored Contacts",msg:"0"}):l.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.countContactsIvrCampaignHopperFinal=function(e){d.cmHopperFinal.countContactsIvrCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(m.contacts,e[0])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.moveConfirm=function(e,n){var t=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.moveSelectedIvrCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperFinals.forEach(function(e){v(e)}),m.selectedIvrCampaignHopperFinals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperHistories=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperHistories(m.query,u).$promise}function g(e){d.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperHistories.rows,{id:e.id}),m.ivrCampaignHopperHistories.count-=1,m.ivrCampaignHopperHistories.rows.length||p(),l.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHopperHistories={count:0,rows:[]},m.selectedIvrCampaignHopperHistories=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperHistory #")+e.id||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperHistories=p,m.createOrEditIvrCampaignHopperHistory=function(e,n){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperHistory:n,hopperHistories:m.ivrCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperHistories=function(){var e=angular.copy(m.selectedIvrCampaignHopperHistories);return m.selectedIvrCampaignHopperHistories=[],e},m.deleteIvrCampaignHopperHistory=g,m.deleteSelectedIvrCampaignHopperHistories=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+m.selectedIvrCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperHistories.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperHistories=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHoppers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHoppers(m.query,u).$promise}function g(e){d.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHoppers.rows,{id:e.id}),m.ivrCampaignHoppers.count-=1,m.ivrCampaignHoppers.rows.length||p(),l.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHoppers={count:0,rows:[]},m.selectedIvrCampaignHoppers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,scheduledat,priority",sort:"-updatedAt",limit:10,page:1},m.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopper #")+e.id||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHoppers=p,m.createOrEditIvrCampaignHopper=function(e,n){o.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopper:n,hoppers:m.ivrCampaignHoppers.rows,license:null,setting:null,crudPermissions:m.crudPermissions,from:"IvrCampaign"}})},m.exportSelectedIvrCampaignHoppers=function(){var e=angular.copy(m.selectedIvrCampaignHoppers);return m.selectedIvrCampaignHoppers=[],e},m.deleteIvrCampaignHopper=g,m.deleteSelectedIvrCampaignHoppers=function(e){var n=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+m.selectedIvrCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHoppers.forEach(function(e){g(e)}),m.selectedIvrCampaignHoppers=[]})},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.agents,{id:e.resourceId})});m.agents.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),m.agents=n})}else m.agents=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHoppersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),n.params.id&&(g.hopper.CampaignId=n.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var t,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.campaign.get({raw:!1,id:a.CampaignId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var n=_.find(g.hoppers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})});g.agents.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.agents=n})}else g.agents=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperCampaignIdDialogController",e)}(),function(){"use strict";function e(t,a){var i=this;i.ivrCampaign={},i.init=function(n){i.ivrCampaign=n,t.cmHopper.get({limit:0,CampaignId:n.id}).$promise.then(function(e){return i.total=e.count||0,t.cmHopper.get({limit:0,CampaignId:n.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0,countnosuchnumberretry:0,countdropretry:0,countabandonedretry:0,countmachineretry:0,countagentrejectretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,t.cmHopperFinal.get({limit:0,CampaignId:n.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("IvrCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=n,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignlistaddController",e)}(),function(){"use strict";function e(e,n,a,i,s,t,o,r){var l=this;function d(){n.hide()}function c(e,n){var t=n.id;o.enqueue(function(){return i.campaign.removeLists({id:e,ids:t}).$promise.then(function(){return i.campaign.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=t||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,n){return-1<n.indexOf(e)},l.toggle=function(e,n){var t=n.indexOf(e);-1<t?n.splice(t,1):n.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,n){for(var t=0;t<l.selected.length;t+=1)c(s.id,l.selected[t]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","ivrCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("IvrCampaignresetlistController",e)}(),function(){"use strict";function e(t,e,i,s,a,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.ivrCampaign=c||t.params.ivrCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,n){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,n){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.resetlistdialog=function(n,t){r.campaign.getLists({id:n.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(t).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n,t;e=u.ivrCampaign.id,n=a.rows[0],t=n.id,r.campaign.removeLists({id:e,ids:t}).$promise.then(function(){return r.campaign.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"IvrCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!1,locals:{ivrCampaign:n,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.ivr_campaigns",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.ivr_campaigns",{})}},u.alert=l.info,u.gotoIvrCampaigns=function(){t.go("app.motiondialer.ivrCampaigns",{},{reload:"app.motiondialer.ivrCampaigns"})},u.saveIvrCampaign=function(){r.campaign.update({id:u.ivrCampaign.id},u.ivrCampaign).$promise.then(function(){l.success({title:"IvrCampaign updated!",msg:u.ivrCampaign.name?u.ivrCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})});u.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.trunks=n})}else u.trunks=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),t=null;if(u.ivrCampaign&&(t=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.projects,{id:t.id});a.canSelect=!1,n.push(a)}u.projects=n})}else{var t=[],a=null;u.ivrCampaign&&(a=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),t=null;if(u.ivrCampaign&&(t=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.interval,{id:t.id});a.canSelect=!1,n.push(a)}u.interval=n})}else{var t=[],a=null;u.ivrCampaign&&(a=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,t.push(u.interval[i]));u.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","ivrCampaign","userProfileSection"],angular.module("app.motiondialer").controller("IvrCampaignController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.ivrCampaigns=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="ivrCampaigns",f.listOrder="",f.listOrderAsc=null,f.selectedIvrCampaigns=[],f.query={fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,page:1},f.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.motiondialer.ivrCampaigns.edit",{id:e.id,ivrCampaign:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.listadddialog=function(e,n){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.blacklistadddialog=function(e,n){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("ivrCampaign")+"?").htmlContent("<b>"+(e.name||"ivrCampaign")+"</b> will be deleted.").ariaLabel("delete ivrCampaign").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.ivr_campaigns",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.ivr_campaigns",{})}},f.success=E,f.getIvrCampaigns=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.campaign.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="IvrCampaigns",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditIvrCampaign=function(e,n){i.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:n,ivrCampaigns:f.ivrCampaigns.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteIvrCampaign=y,f.exportSelectedIvrCampaigns=function(){var e=angular.copy(f.selectedIvrCampaigns);return f.selectedIvrCampaigns=[],e},f.deleteSelectedIvrCampaigns=function(e){var n=i.confirm().title("Are you sure want to delete the selected ivrCampaigns?").htmlContent("<b>"+f.selectedIvrCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete IvrCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedIvrCampaigns.forEach(function(e){y(e)}),f.selectedIvrCampaigns=[]})},f.deselectIvrCampaigns=function(){f.selectedIvrCampaigns=[]},f.selectAllIvrCampaigns=function(){f.selectedIvrCampaigns=f.ivrCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})});f.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),f.trunks=n})}else f.trunks=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.projects=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.projects=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.projects,{id:e.resourceId})}),a=null;a=[],f.ivrCampaigns.rows.forEach(function(e){var n=_.find(f.projects,{id:Number(e.SquareProjectId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),f.projects=t})}else{var t=[],a=[];f.ivrCampaigns.rows.forEach(function(e){var n=_.find(f.projects,{id:Number(e.SquareProjectId)});a.push(n)});for(var i=0;i<f.projects.length;i++){_.some(a,{id:f.projects[i].id})&&(f.projects[i].canSelect=!1,t.push(f.projects[i]))}f.projects=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.ivrCampaign&&(t=_.find(f.interval,{id:Number(f.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.ivrCampaign&&(a=_.find(f.interval,{id:Number(f.ivrCampaign.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.ivrCampaigns=e||{count:0,rows:[]}}function y(e){m.campaign.delete({id:e.id}).$promise.then(function(){_.remove(f.ivrCampaigns.rows,{id:e.id}),f.ivrCampaigns.count-=1,f.ivrCampaigns.rows.length||f.getIvrCampaigns(),p.success({title:_.startCase("IvrCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcampaign"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getIvrCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","ivrCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.motiondialer").controller("IvrCampaignsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_QUEUECAMPAIGN",g.queueCampaign=angular.copy(l),g.queueCampaigns=r,g.newQueueCampaign=!1,g.queueCampaign||(g.queueCampaign={dialActive:!0,type:"outbound",dialCheckDuplicateType:"always",dialCutDigit:0,autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no",dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3,dialMethod:"progressive",dialPowerLevel:1,dialPredictiveOptimization:"dropRate",dialPredictiveOptimizationPercentage:3,dialPredictiveInterval:10,dialLimitQueue:0,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialQueueOptions:"tTxX",dialQueueTimeout:3,strategy:"rrmemory",timeout:3,retry:3,weight:1,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialNoSuchNumberMaxRetry:3,dialNoSuchNumberRetryFrequency:150,dialDropMaxRetry:3,dialDropRetryFrequency:150,dialAbandonedMaxRetry:3,dialAbandonedRetryFrequency:150,dialMachineMaxRetry:3,dialMachineRetryFrequency:150,dialAgentRejectMaxRetry:3,dialAgentRejectRetryFrequency:150,dialPredictiveIntervalMaxThreshold:20,dialPredictiveIntervalMinThreshold:10},g.title="MOTIONDIALER.NEW_QUEUECAMPAIGN",g.newQueueCampaign=!0),g.addNewQueueCampaign=function(){g.errors=[],d.voiceQueue.save(g.queueCampaign).$promise.then(function(e){g.queueCampaigns.unshift(e.toJSON()),o.success({title:"QueueCampaign properly created",msg:g.queueCampaign.name?g.queueCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveQueueCampaign=function(){g.errors=[],d.voiceQueue.update({id:g.queueCampaign.id},g.queueCampaign).$promise.then(function(e){var n=_.find(g.queueCampaigns,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"QueueCampaign properly saved!",msg:g.queueCampaign.name?g.queueCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteQueueCampaign=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The queueCampaign will be deleted.").ariaLabel("Delete QueueCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceQueue.delete({id:g.queueCampaign.id}).$promise.then(function(){_.remove(g.queueCampaigns,{id:g.queueCampaign.id}),o.success({title:"QueueCampaign properly deleted!",msg:(g.queueCampaign.name||"queueCampaign")+" has been deleted!"}),v(g.queueCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),t=null;if(g.queueCampaign&&(t=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.trunks,{id:t.id});a.canSelect=!1,n.push(a)}g.trunks=n})}else{var t=[],a=null;g.queueCampaign&&(a=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,t.push(g.trunks[i]));g.trunks=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.queueCampaign&&(t=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.queueCampaign&&(a=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","queueCampaigns","queueCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditQueueCampaignDialogController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.voiceQueue.getAgents({id:c.queueCampaign.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.queueCampaign=n,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.voiceQueue.removeAgents({id:c.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else{for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.voiceQueue.addAgents({id:c.queueCampaign.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MOTIONDIALER.ALL_AGENTS"),labelSelected:s.instant("MOTIONDIALER.SELECTED_AGENTS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","queueCampaigns","realtime","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=n,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignblacklistaddController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newQueueCampaign=!0,r.queueCampaign=angular.copy(i),r.queueCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_QUEUECAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneQueueCampaign=function(){return e.voiceQueue.clone({id:i.id},r.queueCampaign).$promise.then(function(e){r.queueCampaigns.unshift(e.toJSON()),a.success({title:"QueueCampaign properly cloned",msg:r.queueCampaign.name?r.queueCampaign.name+" has been cloned!":""}),t.go("app.motiondialer.queueCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","queueCampaign","queueCampaigns","$translate"],angular.module("app.motiondialer").controller("QueueCampaigncloneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperBlacks=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperBlacks(m.query,u).$promise}function g(e){d.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperBlacks.rows,{id:e.id}),m.queueCampaignHopperBlacks.count-=1,m.queueCampaignHopperBlacks.rows.length||p(),l.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHopperBlacks={count:0,rows:[]},m.selectedQueueCampaignHopperBlacks=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperBlack #")+e.id||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperBlacks=p,m.createOrEditQueueCampaignHopperBlack=function(e,n){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperBlack:n,hopperBlacks:m.queueCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperBlacks=function(){var e=angular.copy(m.selectedQueueCampaignHopperBlacks);return m.selectedQueueCampaignHopperBlacks=[],e},m.deleteQueueCampaignHopperBlack=g,m.deleteSelectedQueueCampaignHopperBlacks=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+m.selectedQueueCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperBlacks.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperBlacks=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperFinals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperFinals(m.query,u).$promise}function g(e){d.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperFinals.rows,{id:e.id}),m.queueCampaignHopperFinals.count-=1,m.queueCampaignHopperFinals.rows.length||p(),l.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){d.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){l.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var n,t;"Not Found"===e.data?d.cmHopper.save((n=a,t={},t.phone=n.calleridnum,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=0,t.countcongestionretry=0,t.countnoanswerretry=0,t.countglobal=0,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=n.deleted?null:n.UserId,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.priority=n.recallme?3:2,t.recallme=!!n.recallme,t)).$promise.then(function(e){var n,t;l.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&d.cmHopperHistory.save(((t={}).calleridnum=(n=a).calleridnum,t.calleridname=n.calleridname,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=n.countbusyretry,t.countcongestionretry=n.countcongestionretry,t.countnoanswerretry=n.countnoanswerretry,t.countglobal=n.countglobal,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=c.getCurrentUser().id,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),t.edited=!0,t.state=25,t.statedesc="Restored",t.campaign=n.campaign,t.campaigntype=n.VoiceQueueId?"queue":"ivr",t))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):l.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.contacts={},m.queueCampaign={},m.queueCampaignHopperFinals={count:0,rows:[]},m.selectedQueueCampaignHopperFinals=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,secondDisposition,thirdDisposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperFinal #")+e.id||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperFinals=p,m.createOrEditQueueCampaignHopperFinal=function(e,n){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperFinal:n,hopperFinals:m.queueCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperFinals=function(){var e=angular.copy(m.selectedQueueCampaignHopperFinals);return m.selectedQueueCampaignHopperFinals=[],e},m.deleteQueueCampaignHopperFinal=g,m.deleteSelectedQueueCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+m.selectedQueueCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperFinals.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperFinals=[]})},m.moveQueueCampaignHopperFinal=v,m.moveContactsQueueCampaignHopperFinal=function(e){d.cmHopperFinal.moveContactsQueueCampaignHopperFinal({id:m.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?l.info({title:"Restored Contacts",msg:"0"}):l.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.countContactsQueueCampaignHopperFinal=function(e){d.cmHopperFinal.countContactsQueueCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(m.contacts,e[0])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.moveConfirm=function(e,n){var t=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.moveSelectedQueueCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperFinals.forEach(function(e){v(e)}),m.selectedQueueCampaignHopperFinals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperHistories=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperHistories(m.query,u).$promise}function g(e){d.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperHistories.rows,{id:e.id}),m.queueCampaignHopperHistories.count-=1,m.queueCampaignHopperHistories.rows.length||p(),l.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHopperHistories={count:0,rows:[]},m.selectedQueueCampaignHopperHistories=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperHistory #")+e.id||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperHistories=p,m.createOrEditQueueCampaignHopperHistory=function(e,n){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperHistory:n,hopperHistories:m.queueCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperHistories=function(){var e=angular.copy(m.selectedQueueCampaignHopperHistories);return m.selectedQueueCampaignHopperHistories=[],e},m.deleteQueueCampaignHopperHistory=g,m.deleteSelectedQueueCampaignHopperHistories=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+m.selectedQueueCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperHistories.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperHistories=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHoppers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHoppers(m.query,u).$promise}function g(e){d.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHoppers.rows,{id:e.id}),m.queueCampaignHoppers.count-=1,m.queueCampaignHoppers.rows.length||p(),l.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHoppers={count:0,rows:[]},m.selectedQueueCampaignHoppers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,scheduledat,priority,recallme,UserId",sort:"-updatedAt",limit:10,page:1},m.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopper #")+e.id||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHoppers=p,m.createOrEditQueueCampaignHopper=function(e,n){o.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopper:n,hoppers:m.queueCampaignHoppers.rows,license:null,setting:null,crudPermissions:m.crudPermissions,from:"QueueCampaign"}})},m.exportSelectedQueueCampaignHoppers=function(){var e=angular.copy(m.selectedQueueCampaignHoppers);return m.selectedQueueCampaignHoppers=[],e},m.deleteQueueCampaignHopper=g,m.deleteSelectedQueueCampaignHoppers=function(e){var n=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+m.selectedQueueCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHoppers.forEach(function(e){g(e)}),m.selectedQueueCampaignHoppers=[]})},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.agents,{id:e.resourceId})}),t=null;if(m.queueCampaign&&(t=_.find(m.agents,{id:Number(m.queueCampaign.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(m.agents,{id:t.id});a.canSelect=!1,n.push(a)}m.agents=n})}else{var t=[],a=null;m.queueCampaign&&(a=_.find(m.agents,{id:Number(m.queueCampaign.UserId)}));for(var i=0;i<m.agents.length;i++)a&&m.agents[i].id===a.id&&(m.agents[i].canSelect=!1,t.push(m.agents[i]));m.agents=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHoppersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}function h(){console.log("recalcTZTime hopper",g.hopper);var e=g.hopper.Queue.id;if(e)d.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(g.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),_.isNil(g.dateTime)||(g.hopper.scheduledat=moment(g.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss"))})});else{d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),_.isNil(g.dateTime)||(g.hopper.scheduledat=moment(g.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss"))})}});else{d.cmHopper.getTimezone({id:g.hopper.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.hopper.scheduledat=moment(g.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.recalcTZTime=h,e.$watch("vm.contact.dialTimezone",function(){h()}),g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),n.params.id&&(g.hopper.VoiceQueueId=n.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var t,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,g.hopper.dialTimezone=g.contact.dialTimezone,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme}).$promise.then(function(){d.cmContact.update({id:a.ContactId,dialTimezone:g.contact.dialTimezone})})})});var n=_.find(g.hoppers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.dateTime,g.contact,d.cmContact.get({id:g.hopper.Contact.id,fields:"dialTimezone"}).$promise.then(function(e){var n;g.contact=e,console.log("initTZTime hopper",g.hopper),_.isNil(g.hopper.Queue.id)?(n=g.hopper.Campaign.id)&&d.campaign.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;g.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;g.dateTime=moment(g.hopper.scheduledat).add(n-t,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.dateTime=moment(g.hopper.scheduledat).add(n-0,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):(n=g.hopper.Queue.id)&&d.voiceQueue.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;g.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;g.dateTime=moment(g.hopper.scheduledat).add(n-t,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.dateTime=moment(g.hopper.scheduledat).add(n-0,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})})}),g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})}),t=null;if(g.hopper&&(t=_.find(g.agents,{id:Number(g.hopper.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.agents,{id:t.id});a.canSelect=!1,n.push(a)}g.agents=n})}else{var t=[],a=null;g.hopper&&(a=_.find(g.agents,{id:Number(g.hopper.UserId)}));for(var i=0;i<g.agents.length;i++)a&&g.agents[i].id===a.id&&(g.agents[i].canSelect=!1,t.push(g.agents[i]));g.agents=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperVoiceQueueIdDialogController",e)}(),function(){"use strict";function e(t,a){var i=this;i.queueCampaign={},i.init=function(n){i.queueCampaign=n,t.cmHopper.get({limit:0,VoiceQueueId:n.id}).$promise.then(function(e){return i.total=e.count||0,t.cmHopper.get({limit:0,VoiceQueueId:n.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0,countnosuchnumberretry:0,countdropretry:0,countabandonedretry:0,countmachineretry:0,countagentrejectretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,t.cmHopperFinal.get({limit:0,VoiceQueueId:n.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("QueueCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=n,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignlistaddController",e)}(),function(){"use strict";function e(e,n,a,i,s,t,o,r){var l=this;function d(){n.hide()}function c(e,n){var t=n.id;o.enqueue(function(){return i.voiceQueue.removeLists({id:e,ids:t}).$promise.then(function(){return i.voiceQueue.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=t||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,n){return-1<n.indexOf(e)},l.toggle=function(e,n){var t=n.indexOf(e);-1<t?n.splice(t,1):n.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,n){for(var t=0;t<l.selected.length;t+=1)c(s.id,l.selected[t]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","queueCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("QueueCampaignresetlistController",e)}(),function(){"use strict";function e(e,i,a,s,n,t,o,r){var l=this;function d(){return i(function(t,n){return i(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:i(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),i(function(n,t){return s.voiceQueue.getTeams({id:l.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.queueCampaign=n,l.crudPermissions=r,l.penalty=0,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"penalty",labelAll:t.instant("MOTIONDIALER.ALL_TEAMS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_TEAMS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+l.penalty});var t=_.xorWith(l.startingSelectedItems,l.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):i(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceWith(l.selectedItems,l.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,i(function(e,n){_.isEmpty(t)?e():s.voiceQueue.removeTeams({id:l.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return a=n,i(function(e,n){if(!_.isEmpty(a)){var t=_.map(a,function(e){return{id:e.id,penalty:_.trim(e.penalty,"penalty ")}});return s.voiceQueue.addTeams({id:l.queueCampaign.id,teams:t}).$promise.then(function(){e()}).catch(function(e){n(e)})}e()});var a}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignteamaddController",e)}(),function(){"use strict";function e(t,e,i,s,a,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.queueCampaign=c||t.params.queueCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,n){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,n){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.teamadddialog=function(e,n){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.resetlistdialog=function(n,t){r.voiceQueue.getLists({id:n.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(t).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n,t;e=u.queueCampaign.id,n=a.rows[0],t=n.id,r.voiceQueue.removeLists({id:e,ids:t}).$promise.then(function(){return r.voiceQueue.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"QueueCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!1,locals:{queueCampaign:n,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.queues",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.queues",{})}},u.alert=l.info,u.gotoQueueCampaigns=function(){t.go("app.motiondialer.queueCampaigns",{},{reload:"app.motiondialer.queueCampaigns"})},u.saveQueueCampaign=function(){r.voiceQueue.update({id:u.queueCampaign.id},u.queueCampaign).$promise.then(function(){l.success({title:"QueueCampaign updated!",msg:u.queueCampaign.name?u.queueCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.musiconholds,{name:u.queueCampaign.musiconhold})),t&&!_.some(n,["id",t.id])){var a=_.find(u.musiconholds,{id:t.id});a.canSelect=!1,n.push(a)}u.musiconholds=n}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.trunks,{id:t.id});a.canSelect=!1,n.push(a)}u.trunks=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)}));for(var i=0;i<u.trunks.length;i++)a&&u.trunks[i].id===a.id&&(u.trunks[i].canSelect=!1,t.push(u.trunks[i]));u.trunks=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.projects,{name:u.queueCampaign.dialQueueProject})),t&&!_.some(n,["id",t.id])){var a=_.find(u.projects,{id:t.id});a.canSelect=!1,n.push(a)}u.projects=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.projects,{name:u.queueCampaign.dialQueueProject}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.interval,{id:t.id});a.canSelect=!1,n.push(a)}u.interval=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,t.push(u.interval[i]));u.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.pauses=n})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","queueCampaign","userProfileSection"],angular.module("app.motiondialer").controller("QueueCampaignController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.queueCampaigns=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="queueCampaigns",f.listOrder="",f.listOrderAsc=null,f.selectedQueueCampaigns=[],f.query={fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},f.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialMethod=_.keyBy([{option:"Progressive",value:"'progressive'"},{option:"PowerDialing",value:"'power'"},{option:"Predictive",value:"'predictive'"},{option:"Preview",value:"'preview'"},{option:"BookedProgressive",value:"'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialPredictiveOptimization=_.keyBy([{option:"AgentBusyFactor",value:"'agentBusyFactor'"},{option:"DropRate",value:"'dropRate'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraystrategy=_.keyBy([{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Round Robin",value:"'roundrobin'",ngIf:"vm.queueCampaign.dialMethod === 'booked'"},{option:"Least Recent",value:"'leastrecent'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Fewest Calls",value:"'fewestcalls'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Random",value:"'random'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Linear",value:"'linear'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Weight Random",value:"'wrandom'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.motiondialer.queueCampaigns.edit",{id:e.id,queueCampaign:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.listadddialog=function(e,n){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.blacklistadddialog=function(e,n){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.teamadddialog=function(e,n){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("queueCampaign")+"?").htmlContent("<b>"+(e.name||"queueCampaign")+"</b> will be deleted.").ariaLabel("delete queueCampaign").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.queues",{})}},f.success=E,f.getQueueCampaigns=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="QueueCampaigns",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditQueueCampaign=function(e,n){i.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n,queueCampaigns:f.queueCampaigns.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteQueueCampaign=y,f.exportSelectedQueueCampaigns=function(){var e=angular.copy(f.selectedQueueCampaigns);return f.selectedQueueCampaigns=[],e},f.deleteSelectedQueueCampaigns=function(e){var n=i.confirm().title("Are you sure want to delete the selected queueCampaigns?").htmlContent("<b>"+f.selectedQueueCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete QueueCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedQueueCampaigns.forEach(function(e){y(e)}),f.selectedQueueCampaigns=[]})},f.deselectQueueCampaigns=function(){f.selectedQueueCampaigns=[]},f.selectAllQueueCampaigns=function(){f.selectedQueueCampaigns=f.queueCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})}),a=null;a=[],f.queueCampaigns.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.trunks,{id:e.id});n.canSelect=!1,t.push(n)}}),f.trunks=t})}else{var t=[],a=[];f.queueCampaigns.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)});for(var i=0;i<f.trunks.length;i++){_.some(a,{id:f.trunks[i].id})&&(f.trunks[i].canSelect=!1,t.push(f.trunks[i]))}f.trunks=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.queueCampaign&&(t=_.find(f.interval,{id:Number(f.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.queueCampaign&&(a=_.find(f.interval,{id:Number(f.queueCampaign.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.queueCampaigns=e||{count:0,rows:[]}}function y(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.queueCampaigns.rows,{id:e.id}),f.queueCampaigns.count-=1,f.queueCampaigns.rows.length||f.getQueueCampaigns(),p.success({title:_.startCase("QueueCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getQueueCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","queueCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.motiondialer").controller("QueueCampaignsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){return[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",options:g.agents.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:g.queues.rows,ngValue:"name"}]}function h(){return g.refresh=!1,0===g.queues.count?f(null):(g.query.queue=1===g.queues.count?g.queues.rows[0].name:g.query.queue,void 0===g.query.queue&&(g.query.queue=_.map(g.queues.rows,"name")),_.isEmpty(g.query.queue)?f(null):(g.query.offset=(g.query.page-1)*g.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.bull.abandonedCalls:"+g.currentUser.id,JSON.stringify({query:_.omit(g.query,"queue")})),void(g.promise=o.voiceQueueReport.getVoiceQueuesReport(g.query,f).$promise)))}function f(e){g.abandonedCalls=e||{count:0,rows:[]},!1,g.refresh=!0}g.currentUser=d.getCurrentUser(),g.agents=u||[],g.dispositions=p.rows,g.abandonedCalls={count:0,rows:[]},g.showTooltip=!1,g.refresh=!0,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=d.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},g.getAbandonedCalls=h,g.refreshAbandonedCalls=function(){g.showTooltip=!1,h()},g.assignTo=function(e,n){e&&o.voiceQueueReport.update({id:e.id,lastAssignedTo:n?n.name:null,assigned:!!n}).$promise.catch(function(e){console.log(e)})},g.dispose=function(t){n.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(a.body),targetEvent:t,locals:{dispositions:g.dispositions,call:t}}).then(function(e){if(e){var n={id:t.id,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)})}})},g.onSaveVoiceQueueReport=function(e){e&&g.queuesMap&&"outbound"===queue.type&&g.queuesMap[e.queue]&&(g.showTooltip=!0)},g.onUpdateVoiceQueueReport=function(e){if(e){var n=_.findIndex(g.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(g.abandonedCalls.rows[n],e)}},c.onWithoutApply("voiceQueueReport:save",g.onSaveVoiceQueueReport),c.on("voiceQueueReport:update",g.onUpdateVoiceQueueReport),function(){var e=i.localStorage.getItem("motion2.realtime.abandoned.bull.abandonedCalls:"+g.currentUser.id);if(e)(e=JSON.parse(e))&&e.query&&(g.query=_.merge(e.query,_.omit(g.query,["sort","limit","page"])),g.query=_.omit(g.query,"filter"));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};g.query.createdAt=n}d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()}):o.userProfile.getResources({id:g.currentUser.userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()})}();var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?t(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","agents","dispositions"],angular.module("app.motiondialer").controller("AbandonedCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d,c,m){var u=this,p=["name","active","limitCalls","message","originated","IntervalId","SquareProjectId","Trunk","TrunkId","ivrAnswerCallsDay","dialQueueProject","ivrTotalCallsDays","description"];function g(){_.forIn(u.campaigns,function(e,n){u.rpcCampaigns[n]&&_.merge(e,_.pick(u.rpcCampaigns[n],p))})}u.currentUser=m.getCurrentUser(),u.count=o.count,u.campaigns=o?_.keyBy(o.rows?o.rows:[],"id"):{},u.rpcCampaigns=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={sort:"-updatedAt",limit:10,page:1},u.success=f,u.getCampaigns=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=r.campaign.get(u.query,f).$promise:(u.query.id=u.userProfile.id,u.query.section="IvrCampaigns",u.promise=r.userProfile.getResources(u.query,f).$promise)},u.onSave=function(e){u.campaigns[e.id]&&(_.merge(u.campaigns[e.id],_.pick(e,p)),_.merge(u.rpcCampaigns[e.id],_.pick(e,p)))},u.$onInit=g,u.createOrEditIvrCampaign=function(e,n){a.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:n,ivrCampaigns:_.values(u.campaigns),license:null,setting:null,crudPermissions:u.crudPermissions}})},l.onWithoutApply("campaign:save",u.onSave),u.interval=n(function(){},999);var v=!0,h=1;function f(e){u.count=e.count,u.campaigns=e?_.keyBy(e.rows?e.rows:[],"id"):{},g()}e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=h),u.getCampaigns())}),e.$on("$destroy",function(){l.removeAllListeners("campaign:save"),u.interval&&n.cancel(u.interval)})}e.$inject=["$scope","$timeout","$mdDialog","$document","$interval","rpcCampaigns","campaigns","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("IvrCampaignsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,o,t,i,s,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.queues=t?_.keyBy(t.rows?t.rows:[],"name"):{},p.rpcVoiceQueuesChannelsTmp=i?_.keyBy(i.rows?_.filter(i.rows,{type:"outbound"}):[],"uniqueid"):{},p.rpcVoiceQueuesChannels={},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.queryChannels={limit:10,page:1},p.getAvailableAgents=function(){p.availableAgents=null,s.rpc.getAgents().$promise.then(function(e){for(var n=[],t=e?e.rows:[],a=_.filter(t,{online:!0,voicePause:!1,voiceStatus:"idle"}),i=0;i<a.length;i++){var s=_.find(o.rows,["id",a[i].id]);s&&n.push(s)}p.availableAgents=n}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.getSize=function(e){return _.size(e)},p.$onInit=function(){_.forIn(p.rpcVoiceQueuesChannelsTmp,function(e,n){_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[n]=e)})},p.onSave=function(e){"outbound"===e.type&&_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[e.uniqueid]=e)},p.onRemove=function(e){p.rpcVoiceQueuesChannels[e.uniqueid]&&delete p.rpcVoiceQueuesChannels[e.uniqueid]},p.hangup=function(n){return s.rpc.getVoiceQueuesChannelHangup({uniqueid:n}).$promise.then(function(e){d.success({title:"Channel "+n+" properly hangup!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToAgent=function(n,e,t){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e,context:t}).$promise.then(function(e){d.success({title:"Channel "+n+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToNumber=function(e,n){var t=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(t).then(function(e){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e}).$promise}).then(function(e){d.success({title:"Channel "+n+" properly redirect!",msg:e.message||""})}).catch(function(e){e&&d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},r.on("voice_queue_channel:save",p.onSave),r.on("voice_queue_channel:remove",p.onRemove),e.$on("$destroy",function(){r.removeAllListeners("voice_queue_channel:save"),r.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","queues","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["total","answered","sumHoldTime","sumDuration","sumBillable","outboundNoAnswerCallsDay","outboundBusyCallsDay","outboundCongestionCallsDay","outboundNoSuchCallsDay","outboundUnknownCallsDay","outboundDropCallsDayTimeout","outboundDropCallsDayCallersExit","outboundBlacklistCallsDay","outboundOriginateFailureCallsDay","outboundAnswerAgiCallsDay","outboundReCallsDay","outboundRejectCallsDay"];function u(){_.forIn(c.queues,function(e,n){c.rpcQueues[n]&&_.merge(e,_.pick(c.rpcQueues[n],m))})}c.count=a.count,c.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="QueueCampaigns",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){c.queues[e.id]&&_.merge(c.queues[e.id],_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=n(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&n.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueParamsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"QueueCampaigns":void 0,channel:"voice",type:"outbound",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("VOICE.VOICEQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n,queueCampaigns:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n,queueCampaigns:u.queues.rows,realtime:!0,crudPermissions:u.crudPermissions}})},u.showPredictiveQueueCampaignInfo=function(e,n){t.show({controller:"PredictiveQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queues/predictive/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n}})},r.onWithoutApply("voice_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&m.updateVoiceQueue(e,n)}),r.on("userVoiceQueueRt:save",function(e){var n=_.find(u.queues.rows,["id",e.MotionDialerQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("user:agentconnect",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);if(n){if(!t.agentconnected)return;t.queue?n.talking=!0:n.busy=!0,m.updateBusyCounter(e)}})}),r.on("user:agentcomplete",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&(n.talking?n.talking=!1:n.busy&&(n.busy=!1),m.updateBusyCounter(e))})}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"voice")})}),e.$on("$destroy",function(){r.removeAllListeners("voice_queue:save"),r.removeAllListeners("userVoiceQueueRt:save"),r.removeAllListeners("user:agentconnect"),r.removeAllListeners("user:agentcomplete"),r.removeAllListeners("user:update"),p&&n.cancel(p)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.motiondialer").controller("QueuesMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t){this.queueCampaign=t,this.addMinutes=function(e,n){return moment(e).add("m",n).format("HH:mm:ss")},this.setFormatTime=function(e){return moment(e).format("HH:mm:ss")},this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$interval","queueCampaign"],angular.module("app.motiondialer").controller("PredictiveQueueCampaignDialogController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.motiondialer.realtime.agents":this.selectedTab=0;break;case"app.motiondialer.realtime.queues":this.selectedTab=1;break;case"app.motiondialer.realtime.queue_calls":this.selectedTab=2;break;case"app.motiondialer.realtime.abandonedcalls":this.selectedTab=3;break;case"app.motiondialer.realtime.queue_params":this.selectedTab=4;break;case"app.motiondialer.realtime.ivr_campaigns":this.selectedTab=5;break;default:this.selectedTab=0,t.go("app.motiondialer.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.motiondialer.realtime.agents");break;case 1:t.go("app.motiondialer.realtime.queues");break;case 2:t.go("app.motiondialer.realtime.queue_calls");break;case 3:t.go("app.motiondialer.realtime.abandonedcalls");break;case 4:t.go("app.motiondialer.realtime.queue_params");break;case 5:t.go("app.motiondialer.realtime.ivr_campaigns");break;default:t.go("app.motiondialer.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.motiondialer").controller("MotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT",g.openchannelAccount=angular.copy(l),g.openchannelAccounts=r,g.newOpenchannelAccount=!1,g.openchannelAccount||(g.openchannelAccount={waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="OPENCHANNEL.NEW_OPENCHANNELACCOUNT",g.newOpenchannelAccount=!0),n.params.id&&(g.openchannelAccount.OpenchannelAccountId=n.params.id),g.addNewOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.save(g.openchannelAccount).$promise.then(function(e){g.openchannelAccounts.unshift(e.toJSON()),o.success({title:"OpenchannelAccount properly created",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.update({id:g.openchannelAccount.id},g.openchannelAccount).$promise.then(function(e){var n=_.find(g.openchannelAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelAccount properly saved!",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelAccount will be deleted.").ariaLabel("Delete OpenchannelAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.openchannelAccount.delete({id:g.openchannelAccount.id}).$promise.then(function(){_.remove(g.openchannelAccounts,{id:g.openchannelAccount.id}),o.success({title:"OpenchannelAccount properly deleted!",msg:(g.openchannelAccount.name||"openchannelAccount")+" has been deleted!"}),v(g.openchannelAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.openchannelAccount&&(t=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.openchannelAccount&&(a=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelAccounts","openchannelAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.openchannelAccountApps.rows.length){var t=r.openchannelAccountApps.rows[n]?r.openchannelAccountApps.rows[n]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccountApp:t,openchannelAccount:r.openchannelAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.openchannelAccountApps.rows[n]=e:r.openchannelAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.openchannelAccountApps.rows.length;t++,0){var a=r.openchannelAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.openchannelAccount.context,a.exten=r.openchannelAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.openchannelAccount.addApplications({id:r.openchannelAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.openchannelAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.openchannelAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.openchannelAccount={},r.openchannelAccountApps={count:0,rows:[]},r.selectedOpenchannelAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]},{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"OpenchannelQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"openchannelQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:801}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.openchannelAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getOpenchannelAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.openchannelAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getOpenchannelAccountApps=function(){r.promise=o.openchannelAccount.getApplications(r.query,t).$promise},r.editOpenchannelAccountApp=n,r.editInterval=function(e,n){if(r.openchannelAccountApps.rows.length){var t=r.openchannelAccountApps.rows[n]?r.openchannelAccountApps.rows[n]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteOpenchannelAccountApp=function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedOpenchannelAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedOpenchannelAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedOpenchannelAccountApps.forEach(function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id})}),r.selectedOpenchannelAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelAccount.getAgents({id:c.openchannelAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserOpenchannelAccount?"penalty "+e.UserOpenchannelAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelAccount.removeAgents({id:c.openchannelAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelAccount.addAgents({id:c.openchannelAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelAccount","openchannelAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditOpenchannelAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("openChannel")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:801}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"openchannelAccount",action:"getDispositions",field:"name",params:{id:m.openchannelAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.openchannelAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.openchannelAccountInteractions.rows.length;n+=1){var t=m.openchannelAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.openchannelInteraction.get(m.query,p).$promise}function v(e){d.openchannelInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.openchannelAccountInteractions.rows,{id:e.id}),m.openchannelAccountInteractions.count-=1,m.openchannelAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.from?e.contactName=e.from:e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("OPENCHANNEL.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.openchannelAccount={},m.openchannelAccountInteractions={count:0,rows:[]},m.selectedOpenchannelAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.openchannelAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.OpenchannelAccountId=m.openchannelAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.openchannelInteractionDownload=function(s,e,n){return d.openchannelInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="openchannel-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getOpenchannelAccountInteractions=g,m.createOrEditOpenchannelAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:m.openchannelAccount,interaction:n,interactions:m.openchannelAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spyopenchannelInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"openchannel",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"openchannel.openchannelAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||OpenchannelAccountId:=$eq["+m.openchannelAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedOpenchannelAccountInteractions=function(){var e=angular.copy(m.selectedOpenchannelAccountInteractions);return m.selectedOpenchannelAccountInteractions=[],e},m.deleteOpenchannelAccountInteraction=v,m.deleteSelectedOpenchannelAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedOpenchannelAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedOpenchannelAccountInteractions.forEach(function(e){v(e)}),m.selectedOpenchannelAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.openchannelAccountOpenchannelCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.openchannelAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.openchannelAccountOpenchannelCannedAnswers.rows,{id:e.id}),m.openchannelAccountOpenchannelCannedAnswers.count-=1,m.openchannelAccountOpenchannelCannedAnswers.rows.length||p(),l.success({title:"OpenchannelCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.openchannelAccount={},m.openchannelAccountOpenchannelCannedAnswers={count:0,rows:[]},m.selectedOpenchannelAccountOpenchannelCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.openchannelAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.OpenchannelAccountId=m.openchannelAccount.id,m.query.id=m.openchannelAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the openchannelCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("openchannelCannedAnswer #")+e.id||"openchannelCannedAnswer")+"</b> will be deleted.").ariaLabel("delete openchannelCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getOpenchannelAccountOpenchannelCannedAnswers=p,m.createOrEditOpenchannelAccountOpenchannelCannedAnswer=function(e,n){o.show({controller:"CreateOrEditOpenchannelCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:m.openchannelAccount,openchannelCannedAnswer:n,openchannelCannedAnswers:m.openchannelAccountOpenchannelCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedOpenchannelAccountOpenchannelCannedAnswers=function(){var e=angular.copy(m.selectedOpenchannelAccountOpenchannelCannedAnswers);return m.selectedOpenchannelAccountOpenchannelCannedAnswers=[],e},m.deleteOpenchannelAccountOpenchannelCannedAnswer=g,m.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected openchannelCannedAnswers?").htmlContent("<b>"+m.selectedOpenchannelAccountOpenchannelCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete openchannelCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedOpenchannelAccountOpenchannelCannedAnswers.forEach(function(e){g(e)}),m.selectedOpenchannelAccountOpenchannelCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER",g.openchannelCannedAnswer=angular.copy(l),g.openchannelCannedAnswers=r,g.newOpenchannelCannedAnswer=!1,g.openchannelCannedAnswer||(g.openchannelCannedAnswer={},g.title="OPENCHANNEL.NEW_OPENCHANNELCANNEDANSWER",g.newOpenchannelCannedAnswer=!0),n.params.id&&(g.openchannelCannedAnswer.OpenchannelAccountId=n.params.id),g.addNewOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.openchannelCannedAnswer).$promise.then(function(e){g.openchannelCannedAnswers.unshift(e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly created",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.openchannelCannedAnswer.id},g.openchannelCannedAnswer).$promise.then(function(e){var n=_.find(g.openchannelCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly saved!",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelCannedAnswer will be deleted.").ariaLabel("Delete OpenchannelCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.openchannelCannedAnswer.id}).$promise.then(function(){_.remove(g.openchannelCannedAnswers,{id:g.openchannelCannedAnswer.id}),o.success({title:"OpenchannelCannedAnswer properly deleted!",msg:(g.openchannelCannedAnswer.name||"openchannelCannedAnswer")+" has been deleted!"}),v(g.openchannelCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelCannedAnswers","openchannelCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.openchannelAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.openchannelAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.OpenchannelAccountId=m.openchannelAccount.id,m.query.id=m.openchannelAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.openchannelAccount.id,field:"OpenchannelAccountId",route:"openchannelAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.openchannelAccount=c||e.params.openchannelAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:p.openchannelAccounts?p.openchannelAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoOpenchannelAccounts=function(){e.go("app.openchannel.openchannelAccounts",{},{reload:"app.openchannel.openchannelAccounts"})},p.saveOpenchannelAccount=function(){r.openchannelAccount.update({id:p.openchannelAccount.id},p.openchannelAccount).$promise.then(function(){l.success({title:"OpenchannelAccount updated!",msg:p.openchannelAccount.name?p.openchannelAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.openchannelAccount&&(t=_.find(p.lists,{id:Number(p.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.openchannelAccount&&(a=_.find(p.lists,{id:Number(p.openchannelAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.cmContact.describe({id:p.openchannelAccount.ListId}).$promise.then(function(e){p.fields=[];e=_.values(e.toJSON());for(var n=["id","createdAt","updatedAt","deletedAt","scheduledat","ListId","CompanyId"],t=0;t<e.length;t++)_.includes(n,e[t].columnName)||p.fields.push(e[t])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelAccount","userProfile","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.openchannelAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="openchannelAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedOpenchannelAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.openchannel.openchannelAccounts.edit",{id:e.id,openchannelAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.openchannel.openchannelAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:f.openchannelAccounts?f.openchannelAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelAccount")+"?").htmlContent("<b>"+(e.name||"openchannelAccount")+"</b> will be deleted.").ariaLabel("delete openchannelAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getOpenchannelAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.openchannelAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="OpenchannelAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOpenchannelAccount=function(e,n){i.show({controller:"CreateOrEditOpenchannelAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:n,openchannelAccounts:f.openchannelAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOpenchannelAccount=y,f.exportSelectedOpenchannelAccounts=function(){var e=angular.copy(f.selectedOpenchannelAccounts);return f.selectedOpenchannelAccounts=[],e},f.deleteSelectedOpenchannelAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected openchannelAccounts?").htmlContent("<b>"+f.selectedOpenchannelAccounts.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedOpenchannelAccounts.forEach(function(e){y(e)}),f.selectedOpenchannelAccounts=[]})},f.deselectOpenchannelAccounts=function(){f.selectedOpenchannelAccounts=[]},f.selectAllOpenchannelAccounts=function(){f.selectedOpenchannelAccounts=f.openchannelAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.openchannelAccount&&(t=_.find(f.lists,{id:Number(f.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.openchannelAccount&&(a=_.find(f.lists,{id:Number(f.openchannelAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.openchannelAccounts=e||{count:0,rows:[]}}function y(e){m.openchannelAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.openchannelAccounts.rows,{id:e.id}),f.openchannelAccounts.count-=1,f.openchannelAccounts.rows.length||f.getOpenchannelAccounts(),p.success({title:_.startCase("OpenchannelAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getOpenchannelAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.openchannel").controller("OpenchannelAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELQUEUE",g.openchannelQueue=angular.copy(l),g.openchannelQueues=r,g.newOpenchannelQueue=!1,g.openchannelQueue||(g.openchannelQueue={strategy:"beepall",timeout:10},g.title="OPENCHANNEL.NEW_OPENCHANNELQUEUE",g.newOpenchannelQueue=!0),g.addNewOpenchannelQueue=function(){g.errors=[],d.openchannelQueue.save(g.openchannelQueue).$promise.then(function(e){g.openchannelQueues.unshift(e.toJSON()),o.success({title:"OpenchannelQueue properly created",msg:g.openchannelQueue.name?g.openchannelQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelQueue=function(){g.errors=[],d.openchannelQueue.update({id:g.openchannelQueue.id},g.openchannelQueue).$promise.then(function(e){var n=_.find(g.openchannelQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelQueue properly saved!",msg:g.openchannelQueue.name?g.openchannelQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelQueue will be deleted.").ariaLabel("Delete OpenchannelQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.openchannelQueue.delete({id:g.openchannelQueue.id}).$promise.then(function(){_.remove(g.openchannelQueues,{id:g.openchannelQueue.id}),o.success({title:"OpenchannelQueue properly deleted!",msg:(g.openchannelQueue.name||"openchannelQueue")+" has been deleted!"}),v(g.openchannelQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelQueues","openchannelQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelQueue.getAgents({id:c.openchannelQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.removeAgents({id:c.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.addAgents({id:c.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","openchannelQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelQueue.getTeams({id:l.openchannelQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.openchannelQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("OPENCHANNEL.ALL_TEAMS"),labelSelected:t.instant("OPENCHANNEL.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.removeTeams({id:l.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.addTeams({id:l.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.openchannelQueue=c||e.params.openchannelQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoOpenchannelQueues=function(){e.go("app.openchannel.openchannelQueues",{},{reload:"app.openchannel.openchannelQueues"})},u.saveOpenchannelQueue=function(){r.openchannelQueue.update({id:u.openchannelQueue.id},u.openchannelQueue).$promise.then(function(){l.success({title:"OpenchannelQueue updated!",msg:u.openchannelQueue.name?u.openchannelQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelQueue","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.openchannelQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="openchannelQueues",f.listOrder="",f.listOrderAsc=null,f.selectedOpenchannelQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.openchannel.openchannelQueues.edit",{id:e.id,openchannelQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:f.openchannelQueues?f.openchannelQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:f.openchannelQueues?f.openchannelQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelQueue")+"?").htmlContent("<b>"+(e.name||"openchannelQueue")+"</b> will be deleted.").ariaLabel("delete openchannelQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:810}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.openchannel.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.openchannel.realtime.queues",{})}},f.success=E,f.getOpenchannelQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.openchannelQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="OpenchannelQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOpenchannelQueue=function(e,n){i.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:n,openchannelQueues:f.openchannelQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOpenchannelQueue=y,f.exportSelectedOpenchannelQueues=function(){var e=angular.copy(f.selectedOpenchannelQueues);return f.selectedOpenchannelQueues=[],e},f.deleteSelectedOpenchannelQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected openchannelQueues?").htmlContent("<b>"+f.selectedOpenchannelQueues.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedOpenchannelQueues.forEach(function(e){y(e)}),f.selectedOpenchannelQueues=[]})},f.deselectOpenchannelQueues=function(){f.selectedOpenchannelQueues=[]},f.selectAllOpenchannelQueues=function(){f.selectedOpenchannelQueues=f.openchannelQueues.rows};var b=!0,A=1;function E(e){f.openchannelQueues=e||{count:0,rows:[]}}function y(e){m.openchannelQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.openchannelQueues.rows,{id:e.id}),f.openchannelQueues.count-=1,f.openchannelQueues.rows.length||f.getOpenchannelQueues(),p.success({title:_.startCase("OpenchannelQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getOpenchannelQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.openchannel").controller("OpenchannelQueuesController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"OpenchannelQueues":void 0,channel:"openchannel",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("OPENCHANNEL.OPENCHANNELQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:n,openchannelQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:n,openchannelQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("openchannel_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userOpenchannelQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.OpenchannelQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userOpenchannelQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.OpenchannelQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"openchannel")})}),e.$on("$destroy",function(){r.removeAllListeners("openchannel_queue:save"),r.removeAllListeners("userOpenchannelQueue:remove"),r.removeAllListeners("userOpenchannelQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.openchannel").controller("QueuesOpenchannelRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.openchannel.realtime.agents":this.selectedTab=0;break;case"app.openchannel.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.openchannel.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.openchannel.realtime.agents");break;case 1:t.go("app.openchannel.realtime.queues");break;default:t.go("app.openchannel.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.openchannel").controller("OpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.currentUser=s.getCurrentUser(),o.plugin={},o.getTrustedURL=function(){return t.trustAsResourceUrl(o.plugin.adminUrl)},a.plugin.get({id:e.params.id}).$promise.then(function(e){if(e)return o.plugin=e,a.plugin.get({id:o.plugin.id}).$promise}).catch(function(e){o.plugin=void 0})}e.$inject=["$state","$scope","$sce","api","socket","Auth"],angular.module("app.plugins.plugin").controller("PluginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v,h,f=this,b=t(function(){},999);function A(){f.agents.rows.forEach(function(e){g.setAgentStatusDisplayValue(e)})}function E(){f.query.offset=(f.query.page-1)*f.query.limit,f.promise=l.realtime.getAgents(f.query).$promise.then(function(e){f.agents=e,A()}).catch(function(e){c.error({title:s.instant("VOICE.AGENTS"),msg:e.status?JSON.stringify(e.data):e.toString()})})}function y(e){_.remove(f.agents.rows,["id",e.id])}f.currentUser=u.getCurrentUser(),f.channel=n.params.channel,f.queueType=n.params.direction,f.agents=o,f.pauses=r||{count:0,rows:[]},f.license=p,f.userProfileSection=m&&1==m.count?m.rows[0]:null,f.crudPermissions=u.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:"",globalQueueFilter:[],channel:f.channel},f.getAgents=E,f.logout=function(e){return l.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){y(e),c.success({title:"Agent logout",msg:e.fullname+"  properly logout"})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.LOGOUT"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.addQueue=function(e,n){a.show({controller:"AgentQueueAddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,channel:f.channel,direction:f.queueType,crudPermissions:f.crudPermissions}})},f.pause=function(e,n){return l.user.pause({id:e.id,type:n}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.PAUSE"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.unpause=function(e){return l.user.unpause({id:e.id}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.UNPAUSE"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.manageScreenRecording=function(e,n){return l.user.update({id:e.id},{screenrecording:n}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.SCREENRECORDING"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.clearSelection=function(){f.query.globalQueueFilter=[]},f.selectAll=function(){_.forEach(f.queues.rows,function(e){f.query.globalQueueFilter.push(e.name)})},d.on("user:save",function(e){var n=_.find(f.agents.rows,["id",e.id]);n?(_.merge(n,e),n.globalStatus=g.getAgentStatus(n),g.setAgentStatusDisplayValue(n),(0<f.query.globalQueueFilter.length||!_.isEmpty(f.query.globalStatusFilter))&&E()):e.online&&E()}),d.on("user:update",function(e){var n=_.find(f.agents.rows,["id",e.id]);if(n){if(!1===e.online)return y(n);_.merge(n,e),n.globalStatus=g.getAgentStatus(n),g.setAgentStatusDisplayValue(n),E()}else e.online&&E()}),d.on("user:agentconnect",function(e){var n=_.find(f.agents.rows,["id",e.id]);if(n){if(!e.agentconnected)return;_.merge(n,_.pick(e,["queue","destconnectedlinenum","routealias"]))}(0<f.query.globalQueueFilter.length||!_.isEmpty(f.query.globalStatusFilter))&&E()}),d.on("user:agentcomplete",function(e){if("ATTENDED"===e.transfer)return;var n=_.find(f.agents.rows,["id",e.id]);n&&(delete n.queue,delete n.destconnectedlinenum,delete n.routealias);(0<f.query.globalQueueFilter.length||!_.isEmpty(f.query.globalStatusFilter))&&E()}),v={type:f.queueType||"inbound",fields:"id,name",sort:"name",nolimit:"true"},h=f.channel+"Queue",l.getResourcesByRole(f.currentUser,h,v,null).then(function(e){f.queues=e}),A(),e.$on("$destroy",function(){d.removeAllListeners("user:save"),d.removeAllListeners("user:update"),d.removeAllListeners("user:agentconnect"),d.removeAllListeners("user:agentcomplete"),b&&t.cancel(b)})}e.$inject=["$scope","$state","$interval","$mdDialog","$document","$translate","agents","pauses","api","socket","toasty","userProfileSection","Auth","license","realtimeManager"],angular.module("app.realtime").controller("AgentsRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u){var p=this;function g(e){p.cloudProviders=e||{count:0,rows:[]}}function v(e){r.cloudProvider.delete({id:e.id}).$promise.then(function(){_.remove(p.cloudProviders.rows,{id:e.id}),p.cloudProviders.count-=1,p.cloudProviders.rows.length||p.getAiTools(),d.success({title:s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcloudProvider"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcloudProvider",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}p.license=m,p.setting=u,p.currentUser=c.getCurrentUser(),p.cloudProviders=o||{count:0,rows:[]},p.selectedAiTools=[],p.query={fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data5,data6",sort:"-updatedAt",limit:10,page:1},p.services={AmazonAWS:"AmazonAWS",MicrosoftAzure:"Microsoft Azure"},p.editdialog=function(e,n){a.show({controller:"CreateOrEditCloudProviderDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/create/dialog.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{cloudProvider:e,cloudProviders:p.cloudProviders.rows,license:p.license,setting:null,crudPermissions:p.crudPermissions}})},p.deleteconfirm=function(e,n){var t=a.confirm().title(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_TITLE")).content(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_MESSAGE",{name:e.name})).ariaLabel("delete cloud provider").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){v(e)})},p.success=g,p.getAiTools=function(){p.query.offset=(p.query.page-1)*p.query.limit,c.hasRole("admin")?p.promise=r.cloudProvider.get(p.query,g).$promise:(p.query.id=p.userProfile.id,p.query.section="AiTools",p.promise=r.userProfile.getResources(p.query,g).$promise)},p.createOrEditCloudProvider=function(e,n){a.show({controller:"CreateOrEditCloudProviderDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{cloudProvider:n,cloudProviders:p.cloudProviders.rows,license:p.license,setting:p.setting,crudPermissions:p.crudPermissions}})},p.deleteCloudProvider=v,p.exportSelectedAiTools=function(){var e=angular.copy(p.selectedAiTools);return p.selectedAiTools=[],e},p.deleteSelectedAiTools=function(e){var n=a.confirm().title(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETE_TITLE")).content(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETE_MESSAGE",{total:p.selectedAiTools.length})).ariaLabel("delete CloudProviders").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){p.selectedAiTools.forEach(function(e){v(e)}),p.selectedAiTools=[],d.success({title:s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETED_SUCCESS_TITLE")})})},p.deselectAiTools=function(){p.selectedAiTools=[]},p.selectAllAiTools=function(){p.selectedAiTools=p.cloudProviders.rows},p.authenticateToMicrosoftIdentityPlatform=function(e){return r.cloudProvider.oauth2MicrosoftAuthorize({id:e.id}).$promise.then(function(e){p.loginWindow=n.open(e.url,"_blank","width=800,height=600")})},p.updateClientSecret=function(n,e){return a.show({controller:"UpdateClientSecretController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/updateSecret/updateSecret.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{cloudProvider:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,service,data3",id:n.id})}]}})},l.on("microsoftAuthorization:success",function(e){p.currentUser.id===e.id&&(p.loginWindow.close(),d.success({msg:s.instant("SETTINGS.NOTIFICATIONS.MICROSOFT_AUTHENTICATION_SUCCESS")}))}),l.on("microsoftAuthorization:error",function(e){p.currentUser.id===e.id&&(p.loginWindow.close(),d.error({msg:s.instant("SETTINGS.NOTIFICATIONS.MICROSOFT_AUTHENTICATION_FAIL")}))}),e.$on("$destroy",function(){l.removeAllListeners("microsoftAuthorization:success"),l.removeAllListeners("microsoftAuthorization:error")});var h=!0,f=1;e.$watch("vm.query.filter",function(e,n){h?i(function(){h=!1}):(n||(f=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=f),p.getAiTools())})}e.$inject=["$scope","$window","$mdDialog","$document","$timeout","$translate","cloudProviders","api","socket","toasty","Auth","license","setting"],angular.module("app.settings").controller("CloudProvidersController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r){var l=this;function d(e){t.hide(e)}l.currentUser=o.getCurrentUser(),l.license=r,l.cloudProvider=angular.copy(n),l.cloudProviders=e,l.newCloudProvider=!1,l.errors=[],l.cloudProvider||(l.cloudProvider={},l.newCloudProvider=!0),l.addNewCloudProvider=function(){l.errors=[],s.cloudProvider.save(l.cloudProvider).$promise.then(function(e){l.cloudProviders.unshift(e.toJSON()),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_CREATED_SUCCESS_TITLE")}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.saveCloudProvider=function(){l.errors=[],s.cloudProvider.update({id:l.cloudProvider.id},l.cloudProvider).$promise.then(function(e){var n=_.find(l.cloudProviders,{id:e.id});n&&_.merge(n,e.toJSON()),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_SAVED_SUCCESS_TITLE")}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.deleteCloudProvider=function(e){l.errors=[];var n=t.confirm().title(a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_TITLE")).content(a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_MESSAGE",{name:l.cloudProvider.name})).ariaLabel("Delete Cloud Provider").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){s.cloudProvider.delete({id:l.cloudProvider.id}).$promise.then(function(){_.remove(l.cloudProviders,{id:l.cloudProvider.id}),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETED_SUCCESS_TITLE")}),d(l.cloudProvider)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},l.closeDialog=d}e.$inject=["$mdDialog","$translate","toasty","cloudProviders","cloudProvider","api","Auth","license"],angular.module("app.settings").controller("CreateOrEditCloudProviderDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;function o(){e.hide()}s.cloudProvider=i,s.errors=[],s.saveSecret=function(){return s.errors=[],a.cloudProvider.update({id:i.id},{data3:s.newSecret}).$promise.then(function(){t.success({title:n.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_SECRET_UPDATE_SUCCESS_TITLE")}),o()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.update"}];for(var n=0;n<e.data.errors.length;n+=1)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},s.closeDialog=o}e.$inject=["$mdDialog","$translate","toasty","api","cloudProvider"],angular.module("app.settings").controller("UpdateClientSecretController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_CUSTOMIZATION",g.customization=angular.copy(l),g.customizations=r,g.newCustomization=!1,g.customization||(g.customization={},g.title="SETTINGS.NEW_CUSTOMIZATION",g.newCustomization=!0),g.addNewCustomization=function(){g.errors=[],d.setting.save(g.customization).$promise.then(function(e){g.customizations.unshift(e.toJSON()),o.success({title:"Customization properly created",msg:g.customization.name?g.customization.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomization=function(){g.errors=[],d.setting.update({id:g.customization.id},g.customization).$promise.then(function(e){var n=_.find(g.customizations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Customization properly saved!",msg:g.customization.name?g.customization.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomization=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The customization will be deleted.").ariaLabel("Delete Customization").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.setting.delete({id:g.customization.id}).$promise.then(function(){_.remove(g.customizations,{id:g.customization.id}),o.success({title:"Customization properly deleted!",msg:(g.customization.name||"customization")+" has been deleted!"}),v(g.customization)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customizations","customization","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditCustomizationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.customizations=e,s.customization={},s.customizations&&s.customizations.rows&&s.customizations.rows.length&&(s.customization=s.customizations.rows[0]),s.saveCustomization=function(){s.customization.id?n.setting.update({id:s.customization.id},s.customization).$promise.then(function(){t.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):n.setting.save(s.customization).$promise.then(function(e){_.merge(s.customization,e),t.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["customizations","api","toasty","license","Auth"],angular.module("app.settings").controller("CustomizationsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg","ico"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/favicon".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationfaviconController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogoController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo_login".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogologinController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/preferred".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationpreferredController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_GENERAL",g.general=angular.copy(l),g.generals=r,g.newGeneral=!1,g.general||(g.general={min_internal:1e3,chatTimeout:30,phoneBarAutoUpdater:!0,phoneBarAutoUpdaterUrl:"https://www.xcally.com/bar/phonebar/autoupdater.xml",splitSizeCsv:5e3,splitSizePdf:1e3,splitSizeXlsx:5e3,messagesAlignment:"alternate",phoneBarRememberMeEnabled:!0,allowedLoginAttempts:5,blockDuration:10,loginMailFrequency:10,enforcePasswordHistory:!0,passwordHistoryLimit:3},g.title="SETTINGS.NEW_GENERAL",g.newGeneral=!0),g.addNewGeneral=function(){g.errors=[],d.setting.save(g.general).$promise.then(function(e){g.generals.unshift(e.toJSON()),o.success({title:"General properly created",msg:g.general.name?g.general.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGeneral=function(){g.errors=[],d.setting.update({id:g.general.id},g.general).$promise.then(function(e){var n=_.find(g.generals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"General properly saved!",msg:g.general.name?g.general.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGeneral=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The general will be deleted.").ariaLabel("Delete General").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.setting.delete({id:g.general.id}).$promise.then(function(){_.remove(g.generals,{id:g.general.id}),o.success({title:"General properly deleted!",msg:(g.general.name||"general")+" has been deleted!"}),v(g.general)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.cloudProvider.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.cloudProviders=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CLOUDPROVIDERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","generals","general","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditGeneralDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.generals=e,s.general={},s.generals&&s.generals.rows&&s.generals.rows.length&&(s.general=s.generals.rows[0]),_.isNil(s.general.privacyPolicyEmail)||(s.general.enablePrivacyPolicyEmail=!0),_.isNil(s.general.privacyPolicyName)||(s.general.enablePrivacyPolicyName=!0),_.isNil(s.general.privacyPolicyNumber)||(s.general.enablePrivacyPolicyNumber=!0),n.cloudProvider.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){s.cloudProviders=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CLOUDPROVIDERS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.saveGeneral=function(){s.general.enablePrivacyPolicyEmail||(s.general.privacyPolicyEmail=null),s.general.enablePrivacyPolicyNumber||(s.general.privacyPolicyNumber=null),s.general.enablePrivacyPolicyName||(s.general.privacyPolicyName=null),s.general.id?n.setting.update({id:s.general.id},s.general).$promise.then(function(){t.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):n.setting.save(s.general).$promise.then(function(e){_.merge(s.general,e),t.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.onPrivacyPolicyChange=function(e){switch(e){case"email":s.general.enablePrivacyPolicyEmail&&!s.general.privacyPolicyEmail&&(s.general.privacyPolicyEmail=0);break;case"name":s.general.enablePrivacyPolicyName&&!s.general.privacyPolicyName&&(s.general.privacyPolicyName=0);break;case"number":s.general.enablePrivacyPolicyNumber&&!s.general.privacyPolicyNumber&&(s.general.privacyPolicyNumber=0)}}}e.$inject=["generals","api","toasty","license","Auth"],angular.module("app.settings").controller("GeneralsController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l){var d=this;d.license=i||{},d.agents=0,d.users=0,d.telephones=0,d.channels=[{name:"voice",icon:"icon-phone"},{name:"chat",icon:"icon-hangouts"},{name:"mail",icon:"icon-email"},{name:"messaging",icon:"icon-message-text"},{name:"fax",icon:"icon-deskphone"},{name:"openchannel",icon:"icon-google-earth"},{name:"whatsapp",icon:"icon-whatsapp"}],d.modules=[{name:"cm",icon:"icon-account-circle"},{name:"dialer",icon:"icon-crosshairs"},{name:"jscripty",icon:"icon-console"}],d.addons=[{name:"webrtc",icon:"icon-server-plus"},{name:"jaws",icon:"icon-fish"},{name:"custom",icon:"icon-table-edit"},{name:"screenrecording",icon:"icon-video"},{name:"ai",icon:"icon-text-to-speech"}],d.sessions=[{name:"callysquare",icon:"icon-sitemap",restart:!0,label:"channels",enabled:"voice"},{name:"virtual",icon:"icon-dots-horizontal",restart:!1,label:"sessions",enabled:"chat"}],d.others=[{name:"update",icon:"icon-cloud-download"}],d.requestLicense=function(e){t.show({controller:"RequestLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/request/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i,channels:d.channels,modules:d.modules,addons:d.addons,sessions:d.sessions,others:d.others}})},d.updateLicense=function(e){t.show({controller:"UpdateLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/update/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i}})},d.gotoProcess=function(e){a.go("app.settings.system",{tab:1})},d.alert=s.info,d.downloadLogFile=function(){return o.license.downloadLogFile().$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","license-info.log"),document.body.appendChild(a),a.click(),s.success({title:l.instant("SETTINGS.LICENSE_LOG_FILE"),msg:l.instant("SETTINGS.LICENSE_LOG_FILE_DOWNLOADED")})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.isAdmin=r.isAdmin(),o.user.get({fields:"id",role:"agent",online:!0}).$promise.then(function(e){return d.agents=e&&e.count?e.count:0,o.user.get({fields:"id",role:"user,admin"}).$promise}).then(function(e){return d.users=e&&e.count?e.count:0,o.user.get({fields:"id",role:"telephone"}).$promise}).then(function(e){d.telephones=e&&e.count?e.count:0}).catch(function(e){console.log(e)})}e.$inject=["$document","$window","$mdDialog","$state","license","toasty","api","Auth","$translate"],angular.module("app.settings.license").controller("LicenseController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(){e.hide()}m.errors=[],m.user=d.getCurrentUser(),m.license=angular.copy(t),m.channels=a,m.modules=i,m.addons=s,m.sessions=o,m.others=r,m.license.name=m.user.fullname,m.license.email=m.user.email,m.sendRequest=function(){for(var e in m.errors=[],m.table="||FIELD||OLD||NEW||\n",m.license)m.license.hasOwnProperty(e)&&!_.includes(["$promise","$resolved"],e)&&(t[e]===m.license[e]?m.table+="|"+e+"|"+(void 0!==t[e]?t[e]:"")+"|"+m.license[e]+"|\n":m.table+="|"+e+"|{color:red}"+(void 0!==t[e]?t[e]:"")+"{color}|*"+m.license[e]+"*|\n");l.jira.save({key:"MOTLICENSE",summary:"Motion License Request",description:m.table,issuetype:"License Request"}).$promise.then(function(e){n.success({title:"Request sent!",msg:c.instant("SETTINGS.LICENSE_REQUEST_SENT"),timeout:15e3}),u()}).catch(function(e){console.error(e),m.errors=[{message:c.instant("SETTINGS.JIRA_ERROR_MESSAGE"),type:"api.jira"}]})},m.closeDialog=u}e.$inject=["$mdDialog","toasty","license","channels","modules","addons","sessions","others","api","Auth","$translate"],angular.module("app.settings.license").controller("RequestLicenseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.errors=[],s.license=angular.copy(t),s.licenseKey,s.updateLicense=function(){return a.license.update({id:1,key:s.licenseKey}).$promise.then(function(e){e&&(e.demo?n.error({title:"License update failed!",msg:"Invalid license key"}):n.success({title:"License properly updated!",msg:"The license has been updated!"}))}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATElicense",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","toasty","license","api","$translate"],angular.module("app.settings.license").controller("UpdateLicenseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(e){a.hide(e)}p.currentUser=c.getCurrentUser(),p.errors=[],p.setting=u,p.license=m,p.hasModulePermissions={},p.passwordPattern=p.setting&&p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.title="SETTINGS.EDIT_NETWORK",p.network=angular.copy(l),p.networks=r,p.newNetwork=!1,p.network||(p.network={type:"localnet"},p.title="SETTINGS.NEW_NETWORK",p.newNetwork=!0),p.addNewNetwork=function(){p.errors=[],d.network.save(p.network).$promise.then(function(e){p.networks.unshift(e.toJSON()),o.success({title:"Network properly created",msg:p.network.name?p.network.name+" has been created!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveNetwork=function(){p.errors=[],d.network.update({id:p.network.id},p.network).$promise.then(function(e){var n=_.find(p.networks,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Network properly saved!",msg:p.network.name?p.network.name+" has been saved!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteNetwork=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The network will be deleted.").ariaLabel("Delete Network").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.network.delete({id:p.network.id}).$promise.then(function(){_.remove(p.networks,{id:p.network.id}),o.success({title:"Network properly deleted!",msg:(p.network.name||"network")+" has been deleted!"}),g(p.network)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.getDateFromString=function(e){return null===e?void 0:new Date(e)},p.closeDialog=g}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","networks","network","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditNetworkDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;v.license=p,v.setting=g,v.currentUser=u.getCurrentUser(),v.networks=l||{count:0,rows:[]},v.table="networks",v.listOrder="",v.listOrderAsc=null,v.selectedNetworks=[],v.query={fields:"createdAt,updatedAt,id,type,value,username,password",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"LocalNET",value:"'localnet'"},{option:"ExternIP",value:"'externip'"},{option:"Turn",value:"'turn'"},{option:"Stun",value:"'stun'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,n){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{network:e,networks:v.networks.rows,license:v.license,setting:null,crudPermissions:v.crudPermissions}})},v.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("network")+"?").htmlContent("<b>"+(e.name||"network")+"</b> will be deleted.").ariaLabel("delete network").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=b,v.getNetworks=function(){v.query.offset=(v.query.page-1)*v.query.limit,u.hasRole("admin")?v.promise=d.network.get(v.query,b).$promise:(v.query.id=v.userProfile.id,v.query.section="Networks",v.promise=d.userProfile.getResources(v.query,b).$promise)},v.createOrEditNetwork=function(e,n){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{network:n,networks:v.networks.rows,license:v.license,setting:v.setting,crudPermissions:v.crudPermissions}})},v.deleteNetwork=A,v.exportSelectedNetworks=function(){var e=angular.copy(v.selectedNetworks);return v.selectedNetworks=[],e},v.deleteSelectedNetworks=function(e){var n=i.confirm().title("Are you sure want to delete the selected networks?").htmlContent("<b>"+v.selectedNetworks.length+" selected</b> will be deleted.").ariaLabel("delete Networks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){v.selectedNetworks.forEach(function(e){A(e)}),v.selectedNetworks=[]})},v.deselectNetworks=function(){v.selectedNetworks=[]},v.selectAllNetworks=function(){v.selectedNetworks=v.networks.rows};var h=!0,f=1;function b(e){v.networks=e||{count:0,rows:[]}}function A(e){d.network.delete({id:e.id}).$promise.then(function(){_.remove(v.networks.rows,{id:e.id}),v.networks.count-=1,v.networks.rows.length||v.getNetworks(),m.success({title:_.startCase("Network")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEnetwork"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEnetwork",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){h?o(function(){h=!1}):(n||(f=v.query.page),e!==n&&(v.query.page=1),e||(v.query.page=f),v.getNetworks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","networks","api","msUtils","toasty","Auth","license","setting"],angular.module("app.settings").controller("NetworksController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;l.currentUser=o.getCurrentUser(),l.license=s,l.providers=r.getEmailProviders(),l.mailAccounts=e||{rows:[],count:0},l.cloudProviders=t||{rows:[],count:0},l.mailAccount={service:!0,Smtp:{}},0<l.mailAccounts.count&&(l.mailAccount=l.mailAccounts.rows[0]),l.originalProvider=l.mailAccount.provider,l.saveSmtp=function(){var e=angular.copy(l.mailAccount);"custom"===e.provider?e.provider=null:(l.originalProvider!==e.provider&&(e.Smtp.modernAuthentication?e.Smtp.pass=null:e.Smtp.CloudProviderId=null),e.Smtp.modernAuthentication||(e.Smtp.CloudProviderId=null),e.Smtp=_.omit(e.Smtp,["host","port","secure","service"]));l.mailAccount.id?a.mailAccount.update({id:l.mailAccount.id},e).$promise.then(function(){l.originalProvider=e.provider,i.success({msg:n.instant("SETTINGS.NOTIFICATIONS.SMTP_SAVED_SUCCESS_TITLE")})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}):a.mailAccount.save(e).$promise.then(function(e){_.merge(l.mailAccount,e),i.success({msg:n.instant("SETTINGS.NOTIFICATIONS.SMTP_SAVED_SUCCESS_TITLE")})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},l.verifySmtp=function(){a.mailAccount.verifySmtp({id:l.mailAccount.id}).$promise.then(function(){i.success({msg:n.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_SUCCESS_TITLE")})}).catch(function(e){i.error({title:n.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:e.data?JSON.stringify(e.data):e.toString(),timeout:1e4})})},l.onProviderChange=function(){"custom"!==l.mailAccount.provider&&(l.mailAccount.authentication=!0);"outlook365"!==l.mailAccount.provider&&(l.mailAccount.Smtp.modernAuthentication=!1)}}e.$inject=["$translate","mailAccounts","cloudProviders","api","toasty","license","Auth","msUtils"],angular.module("app.settings").controller("SmtpController",e)}(),function(){"use strict";function e(e,i,s,n,t,a,o,r){var l,d=this;d.system=t||{},d.processes=a?a.rows:[],d.processLimit=7,d.selectedTab=n.params.tab||0,d.getInfo=function(){return r.system.get().$promise.then(function(e){_.merge(d.system,e)}).catch(d.cancelInterval)},d.getProcesses=function(){return r.pm2.get().$promise.then(function(e){_.merge(d.processes,e?e.rows:[])}).catch(d.cancelInterval)},d.cancelInterval=function(e){i.cancel(l)},d.updateProcess=function(e,n,t){var a=s.confirm().title("Would you like to change the status of the process #"+n+"?").textContent("The status will be changed to: "+t.toUpperCase()).ariaLabel("Lucky day").targetEvent(e).ok("Ok").cancel("Cancel");s.show(a).then(function(){return r.pm2.update({id:n,status:t})}).then(function(){i(d.getProcesses,1e3,1)}).then(function(){o.success({title:"Process updated!",msg:"Status properly changed to: "+t})})},l=i(d.getInfo,5e3),e.$on("$destroy",function(){d.cancelInterval()})}e.$inject=["$scope","$interval","$mdDialog","$state","system","processes","toasty","api"],angular.module("app.settings.system").controller("SystemController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.title="SETTINGS.UPDATE",s.progress=0,s.updating=!0,s.output="Waiting...",s.success=!0,s.interval=n(function(){s.progress<90&&(s.progress+=1)},1e3),s.closeDialog=function(){e.hide()},s.reload=function(){t.location.reload()},s.stopInterval=function(){angular.isDefined(s.interval)&&(n.cancel(s.interval),s.interval=void 0);s.progress=100,s.updating=!1},i.version.fetch().$promise.then(function(e){return s.output=e.output+"...",i.version.reset().$promise}).then(function(e){return s.output=e.output+"...",i.version.pull().$promise}).then(function(e){return s.output=e.output+"...",i.version.migrations().$promise}).then(function(e){return s.output=e.output+"...",i.version.restart().$promise}).then(function(e){s.output="Waiting to restart motion...",a(function(){s.stopInterval()},3e4)}).catch(function(e){s.success=!1,s.stopInterval(),s.output=JSON.stringify(e)})}e.$inject=["$mdDialog","$interval","$window","$timeout","api"],angular.module("app.settings").controller("UpdateDialogController",e)}(),function(){"use strict";function e(t,e,a,n,i){this.version=n||{},this.updateConfirm=function(e){var n=t.confirm().title("Would you like to update your system?").htmlContent('The system request time for the update should be below 1 minute.<br><br>Do you agree the terms of this <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">End User License Agreement<a>?').ariaLabel("").targetEvent(e).clickOutsideToClose(!0).parent(angular.element(a.body)).ok("I agree").cancel("Disagree");t.show(n).then(function(){t.show({controller:"UpdateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/updates/update/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!1})})}}e.$inject=["$mdDialog","$interval","$document","version","toasty"],angular.module("app.settings").controller("UpdatesController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"SmsQueues":void 0,channel:"sms",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("SMS.SMSQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:n,smsQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:n,smsQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("sms_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userSmsQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.SmsQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userSmsQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.SmsQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"sms")})}),e.$on("$destroy",function(){r.removeAllListeners("sms_queue:save"),r.removeAllListeners("userSmsQueue:remove"),r.removeAllListeners("userSmsQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.sms").controller("QueuesSmsRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.sms.realtime.agents":this.selectedTab=0;break;case"app.sms.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.sms.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.sms.realtime.agents");break;case 1:t.go("app.sms.realtime.queues");break;default:t.go("app.sms.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.sms").controller("SmsRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSACCOUNT",g.smsAccount=angular.copy(l),g.smsAccounts=r,g.newSmsAccount=!1,g.smsAccount||(g.smsAccount={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),type:"twilio",waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="SMS.NEW_SMSACCOUNT",g.newSmsAccount=!0),n.params.id&&(g.smsAccount.SmsAccountId=n.params.id),g.addNewSmsAccount=function(){g.errors=[],d.smsAccount.save(g.smsAccount).$promise.then(function(e){g.smsAccounts.unshift(e.toJSON()),o.success({title:"SmsAccount properly created",msg:g.smsAccount.name?g.smsAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsAccount=function(){g.errors=[],d.smsAccount.update({id:g.smsAccount.id},g.smsAccount).$promise.then(function(e){var n=_.find(g.smsAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsAccount properly saved!",msg:g.smsAccount.name?g.smsAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsAccount will be deleted.").ariaLabel("Delete SmsAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.smsAccount.delete({id:g.smsAccount.id}).$promise.then(function(){_.remove(g.smsAccounts,{id:g.smsAccount.id}),o.success({title:"SmsAccount properly deleted!",msg:(g.smsAccount.name||"smsAccount")+" has been deleted!"}),v(g.smsAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.smsAccount&&(t=_.find(g.lists,{id:Number(g.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.smsAccount&&(a=_.find(g.lists,{id:Number(g.smsAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsAccounts","smsAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.smsAccountApps.rows.length){var t=r.smsAccountApps.rows[n]?r.smsAccountApps.rows[n]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccountApp:t,smsAccount:r.smsAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.smsAccountApps.rows[n]=e:r.smsAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.smsAccountApps.rows.length;t++,0){var a=r.smsAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.smsAccount.context,a.exten=r.smsAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.smsAccount.addApplications({id:r.smsAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.smsAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.smsAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.smsAccount={},r.smsAccountApps={count:0,rows:[]},r.selectedSmsAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"SmsQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"smsQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:701}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.smsAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getSmsAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.smsAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getSmsAccountApps=function(){r.promise=o.smsAccount.getApplications(r.query,t).$promise},r.editSmsAccountApp=n,r.editInterval=function(e,n){if(r.smsAccountApps.rows.length){var t=r.smsAccountApps.rows[n]?r.smsAccountApps.rows[n]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteSmsAccountApp=function(e){_.remove(r.smsAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedSmsAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedSmsAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedSmsAccountApps.forEach(function(e){_.remove(r.smsAccountApps.rows,{id:e.id})}),r.selectedSmsAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.sms").controller("SmsAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsAccount.getAgents({id:c.smsAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserSmsAccount?"penalty "+e.UserSmsAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.smsAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsAccount.removeAgents({id:c.smsAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsAccount.addAgents({id:c.smsAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","smsAccount","smsAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditSmsAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("sms")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"smsAccount",action:"getDispositions",field:"name",params:{id:m.smsAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.smsAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.smsAccountInteractions.rows.length;n+=1){var t=m.smsAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.smsInteraction.get(m.query,p).$promise}function v(e){d.smsInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.smsAccountInteractions.rows,{id:e.id}),m.smsAccountInteractions.count-=1,m.smsAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.mobile):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.smsAccount={},m.smsAccountInteractions={count:0,rows:[]},m.selectedSmsAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.smsAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.SmsAccountId=m.smsAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.smsInteractionDownload=function(s,e,n){return d.smsInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="sms-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getSmsAccountInteractions=g,m.createOrEditSmsAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:m.smsAccount,interaction:n,interactions:m.smsAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spysmsInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"sms",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"sms.smsAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||SmsAccountId:=$eq["+m.smsAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedSmsAccountInteractions=function(){var e=angular.copy(m.selectedSmsAccountInteractions);return m.selectedSmsAccountInteractions=[],e},m.deleteSmsAccountInteraction=v,m.deleteSelectedSmsAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedSmsAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedSmsAccountInteractions.forEach(function(e){v(e)}),m.selectedSmsAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.smsAccountSmsCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.smsAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.smsAccountSmsCannedAnswers.rows,{id:e.id}),m.smsAccountSmsCannedAnswers.count-=1,m.smsAccountSmsCannedAnswers.rows.length||p(),l.success({title:"SmsCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.smsAccount={},m.smsAccountSmsCannedAnswers={count:0,rows:[]},m.selectedSmsAccountSmsCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.smsAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.SmsAccountId=m.smsAccount.id,m.query.id=m.smsAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the smsCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("smsCannedAnswer #")+e.id||"smsCannedAnswer")+"</b> will be deleted.").ariaLabel("delete smsCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getSmsAccountSmsCannedAnswers=p,m.createOrEditSmsAccountSmsCannedAnswer=function(e,n){o.show({controller:"CreateOrEditSmsCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:m.smsAccount,smsCannedAnswer:n,smsCannedAnswers:m.smsAccountSmsCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedSmsAccountSmsCannedAnswers=function(){var e=angular.copy(m.selectedSmsAccountSmsCannedAnswers);return m.selectedSmsAccountSmsCannedAnswers=[],e},m.deleteSmsAccountSmsCannedAnswer=g,m.deleteSelectedSmsAccountSmsCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected smsCannedAnswers?").htmlContent("<b>"+m.selectedSmsAccountSmsCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete smsCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedSmsAccountSmsCannedAnswers.forEach(function(e){g(e)}),m.selectedSmsAccountSmsCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSCANNEDANSWER",g.smsCannedAnswer=angular.copy(l),g.smsCannedAnswers=r,g.newSmsCannedAnswer=!1,g.smsCannedAnswer||(g.smsCannedAnswer={},g.title="SMS.NEW_SMSCANNEDANSWER",g.newSmsCannedAnswer=!0),n.params.id&&(g.smsCannedAnswer.SmsAccountId=n.params.id),g.addNewSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.smsCannedAnswer).$promise.then(function(e){g.smsCannedAnswers.unshift(e.toJSON()),o.success({title:"SmsCannedAnswer properly created",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.smsCannedAnswer.id},g.smsCannedAnswer).$promise.then(function(e){var n=_.find(g.smsCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsCannedAnswer properly saved!",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsCannedAnswer will be deleted.").ariaLabel("Delete SmsCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.smsCannedAnswer.id}).$promise.then(function(){_.remove(g.smsCannedAnswers,{id:g.smsCannedAnswer.id}),o.success({title:"SmsCannedAnswer properly deleted!",msg:(g.smsCannedAnswer.name||"smsCannedAnswer")+" has been deleted!"}),v(g.smsCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsCannedAnswers","smsCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.smsAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.smsAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.SmsAccountId=m.smsAccount.id,m.query.id=m.smsAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.smsAccount.id,field:"SmsAccountId",route:"smsAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.sms").controller("SmsAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.smsAccount=c||e.params.smsAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:p.smsAccounts?p.smsAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoSmsAccounts=function(){e.go("app.sms.smsAccounts",{},{reload:"app.sms.smsAccounts"})},p.saveSmsAccount=function(){r.smsAccount.update({id:p.smsAccount.id},p.smsAccount).$promise.then(function(){l.success({title:"SmsAccount updated!",msg:p.smsAccount.name?p.smsAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.smsAccount&&(t=_.find(p.lists,{id:Number(p.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.smsAccount&&(a=_.find(p.lists,{id:Number(p.smsAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsAccount","userProfile","userProfileSection"],angular.module("app.sms").controller("SmsAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.smsAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="smsAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSmsAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Skebby",value:"'skebby'"},{option:"Connectel",value:"'connectel'"},{option:"ClickSend",value:"'clicksend'"},{option:"Plivo",value:"'plivo'"},{option:"Infobip",value:"'infobip'"},{option:"Clickatell",value:"'clickatell'"},{option:"Bandwidth",value:"'bandwidth'"},{option:"CSCTelecom",value:"'csc'"},{option:"Intelepeer",value:"'intelepeer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysmsMethod=_.keyBy([{option:"Basic",value:"'SI'"},{option:"Classic",value:"'TI'"},{option:"Classic+",value:"'GP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.sms.smsAccounts.edit",{id:e.id,smsAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.sms.smsAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:f.smsAccounts?f.smsAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("smsAccount")+"?").htmlContent("<b>"+(e.name||"smsAccount")+"</b> will be deleted.").ariaLabel("delete smsAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSmsAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.smsAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SmsAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSmsAccount=function(e,n){i.show({controller:"CreateOrEditSmsAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:n,smsAccounts:f.smsAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSmsAccount=y,f.exportSelectedSmsAccounts=function(){var e=angular.copy(f.selectedSmsAccounts);return f.selectedSmsAccounts=[],e},f.deleteSelectedSmsAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected smsAccounts?").htmlContent("<b>"+f.selectedSmsAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SmsAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSmsAccounts.forEach(function(e){y(e)}),f.selectedSmsAccounts=[]})},f.deselectSmsAccounts=function(){f.selectedSmsAccounts=[]},f.selectAllSmsAccounts=function(){f.selectedSmsAccounts=f.smsAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.smsAccount&&(t=_.find(f.lists,{id:Number(f.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.smsAccount&&(a=_.find(f.lists,{id:Number(f.smsAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.smsAccounts=e||{count:0,rows:[]}}function y(e){m.smsAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.smsAccounts.rows,{id:e.id}),f.smsAccounts.count-=1,f.smsAccounts.rows.length||f.getSmsAccounts(),p.success({title:_.startCase("SmsAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSmsAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.sms").controller("SmsAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSQUEUE",g.smsQueue=angular.copy(l),g.smsQueues=r,g.newSmsQueue=!1,g.smsQueue||(g.smsQueue={strategy:"beepall",timeout:10},g.title="SMS.NEW_SMSQUEUE",g.newSmsQueue=!0),g.addNewSmsQueue=function(){g.errors=[],d.smsQueue.save(g.smsQueue).$promise.then(function(e){g.smsQueues.unshift(e.toJSON()),o.success({title:"SmsQueue properly created",msg:g.smsQueue.name?g.smsQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsQueue=function(){g.errors=[],d.smsQueue.update({id:g.smsQueue.id},g.smsQueue).$promise.then(function(e){var n=_.find(g.smsQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsQueue properly saved!",msg:g.smsQueue.name?g.smsQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsQueue will be deleted.").ariaLabel("Delete SmsQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.smsQueue.delete({id:g.smsQueue.id}).$promise.then(function(){_.remove(g.smsQueues,{id:g.smsQueue.id}),o.success({title:"SmsQueue properly deleted!",msg:(g.smsQueue.name||"smsQueue")+" has been deleted!"}),v(g.smsQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsQueues","smsQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsQueue.getAgents({id:c.smsQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.smsQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.removeAgents({id:c.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.addAgents({id:c.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","smsQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsQueue.getTeams({id:l.smsQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.smsQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("SMS.ALL_TEAMS"),labelSelected:t.instant("SMS.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.removeTeams({id:l.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.addTeams({id:l.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.smsQueue=c||e.params.smsQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoSmsQueues=function(){e.go("app.sms.smsQueues",{},{reload:"app.sms.smsQueues"})},u.saveSmsQueue=function(){r.smsQueue.update({id:u.smsQueue.id},u.smsQueue).$promise.then(function(){l.success({title:"SmsQueue updated!",msg:u.smsQueue.name?u.smsQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsQueue","userProfileSection"],angular.module("app.sms").controller("SmsQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.smsQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="smsQueues",f.listOrder="",f.listOrderAsc=null,f.selectedSmsQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.sms.smsQueues.edit",{id:e.id,smsQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:f.smsQueues?f.smsQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:f.smsQueues?f.smsQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("smsQueue")+"?").htmlContent("<b>"+(e.name||"smsQueue")+"</b> will be deleted.").ariaLabel("delete smsQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:710}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.sms.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.sms.realtime.queues",{})}},f.success=E,f.getSmsQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.smsQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SmsQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSmsQueue=function(e,n){i.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:n,smsQueues:f.smsQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSmsQueue=y,f.exportSelectedSmsQueues=function(){var e=angular.copy(f.selectedSmsQueues);return f.selectedSmsQueues=[],e},f.deleteSelectedSmsQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected smsQueues?").htmlContent("<b>"+f.selectedSmsQueues.length+" selected</b> will be deleted.").ariaLabel("delete SmsQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSmsQueues.forEach(function(e){y(e)}),f.selectedSmsQueues=[]})},f.deselectSmsQueues=function(){f.selectedSmsQueues=[]},f.selectAllSmsQueues=function(){f.selectedSmsQueues=f.smsQueues.rows};var b=!0,A=1;function E(e){f.smsQueues=e||{count:0,rows:[]}}function y(e){m.smsQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.smsQueues.rows,{id:e.id}),f.smsQueues.count-=1,f.smsQueues.rows.length||f.getSmsQueues(),p.success({title:_.startCase("SmsQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSmsQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.sms").controller("SmsQueuesController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.agents=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,c.hasRole("admin")?g.promise=l.user.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="Agents",g.promise=l.userProfile.getResources(g.query,v).$promise)}function f(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(g.agents.rows,{id:e.id}),g.agents.count-=1,g.agents.rows.length||g.getAgents(),d.success({title:_.startCase("Agent")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=m,g.setting=u,g.currentUser=c.getCurrentUser(),g.agents=s||{count:0,rows:[]},g.userProfile=o,g.userProfileSection=r&&1==r.count?r.rows[0]:null,g.crudPermissions=c.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedAgents=[],g.query={fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled",role:"agent",userSetting:!0,sort:"-updatedAt",limit:10,page:1},g.showWebBarOptions=[{option:"Phonebar",value:0},{option:"External",value:1},{option:"WebRTC",value:2}],g.editstate=function(e){n.go("app.staff.agents.edit",{id:e.id,agent:e,crudPermissions:g.crudPermissions})},g.teamadddialog=function(e,n){a.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:g.agents?g.agents.rows:[],crudPermissions:g.crudPermissions}})},g.deleteconfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the "+_.startCase("agent")+"?").htmlContent("<b>"+(e.name||"agent")+"</b> will be deleted.").ariaLabel("delete agent").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){f(e)})},g.success=v,g.getAgents=h,g.createOrEditAgent=function(e,n){a.show({controller:"CreateOrEditAgentDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{agent:n,agents:g.agents.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}})},g.deleteAgent=f,g.exportSelectedAgents=function(){var e=angular.copy(g.selectedAgents);return g.selectedAgents=[],e},g.deleteSelectedAgents=function(e){var n=a.confirm().title("Are you sure want to delete the selected agents?").htmlContent("<b>"+g.selectedAgents.length+" selected</b> will be deleted.").ariaLabel("delete Agents").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){g.selectedAgents.forEach(function(e){f(e)}),g.selectedAgents=[]})},g.deselectAgents=function(){g.selectedAgents=[]},g.selectAllAgents=function(){g.selectedAgents=g.agents.rows};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),g.getAgents())}),p.on("user-setting:update",h),e.$on("$destroy",function(){p.removeListener("user-setting:update",h)})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","agents","userProfile","userProfileSection","api","toasty","Auth","license","setting","socket"],angular.module("app.staff").controller("AgentsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c){var m=this;function u(){return s.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.agent=e})}function p(e){t.hide(e)}m.currentUser=o.getCurrentUser(),m.errors=[],m.setting=l,m.license=r,m.crudPermissions=d,m.hasModulePermissions={},m.passwordPattern=m.setting&&m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.title="STAFF.EDIT_AGENT",m.agent=angular.copy(i),m.agents=n,m.newAgent=!1,m.agent||(m.agent={role:"agent",showWebBar:"0",autointernal:!0,wssPort:8089,type:"friend",context:"from-sip",phoneBarRemoteControl:!0,phoneBarRemoteControlPort:9888,allowmessenger:!0,downloadAttachments:!0,downloadOmnichannelInteractions:!0,downloadVoiceRecordings:!0},m.title="STAFF.NEW_AGENT",m.newAgent=!0),m.addNewAgent=function(){m.errors=[],s.user.save(m.agent).$promise.then(function(e){m.agents.unshift(e.toJSON()),a.success({title:"Agent properly created",msg:m.agent.name?m.agent.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveAgent=function(){m.errors=[],s.user.update({id:m.agent.id},m.agent).$promise.then(function(e){var n=_.find(m.agents,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"Agent properly saved!",msg:m.agent.name?m.agent.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteAgent=function(e){m.errors=[];var n=t.confirm().title("Are you sure?").content("The agent will be deleted.").ariaLabel("Delete Agent").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){s.user.delete({id:m.agent.id}).$promise.then(function(){_.remove(m.agents,{id:m.agent.id}),a.success({title:"Agent properly deleted!",msg:(m.agent.name||"agent")+" has been deleted!"}),p(m.agent)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.closeDialog=p;var g="user-setting:update:user-"+m.agent.id;c.on(g,u),e.$on("$destroy",function(){c.removeListener(g,u)})}e.$inject=["$scope","$mdDialog","toasty","agents","agent","api","Auth","license","setting","crudPermissions","socket"],angular.module("app.staff").controller("CreateOrEditAgentDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.agent={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.agent.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.agent.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.agent=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.agent.id+"/avatar",i.agent.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Agentchange_avatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.agent=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.agent.id,newPassword:r.password};r.currentUser.id==r.agent.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"Agent password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.agent.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.agent.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.agentForm.password.$setValidity("oldPasswordMatch",!1):t.agentForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","agent","setting","Auth"],angular.module("app.staff").controller("AgentchangepasswordController",e)}(),function(){"use strict";function e(e,n,i,t,s){var o=this;o.agent={},o.navigation=t.getNavigation(),o.crudPermissions,o.init=function(e,n){o.agent=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1}},o.onChange=function(n,t){if((t||n).enabled){if(t)t.enabled=!0,o.agent.permissions.push(t.id);else for(var e=0;e<n.children.length;e++)n.children[e].enabled=!0,o.agent.permissions.push(n.children[e].id);n.enabled=!0,o.agent.permissions.push(n.id)}else if(t)t.enabled=!1,_.remove(o.agent.permissions,function(e){return t.id===e}),_.filter(n.children,{enabled:!1}).length===n.children.length&&(n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e}));else{n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e});for(var a=0;a<n.children.length;a++)n.children[a].enabled=!1,_.remove(o.agent.permissions,function(e){return n.children[a].id===e})}return i.user.update({id:o.agent.id,permissions:_.uniq(o.agent.permissions)}).$promise.then(function(){s.success({title:"agent updated!",msg:o.agent.name?o.agent.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["$document","$mdDialog","api","msNavigationAgentService","toasty"],angular.module("app.staff").controller("AgentPermissionsController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d[c.apiName].get({fields:"id,name,strategy,type",channel:c.channel,type:"voice"===c.channel?c.direction:void 0,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.user.getQueues({id:c.agent.id,fields:"id,name,strategy,type,penalty",nolimit:!0,type:"voice"===c.channel?c.direction:void 0,channel:c.channel}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return"voice"===c.channel&&(n.penalty=void 0!==n&&void 0!==e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"penalty 0"),n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.agent=n,c.crudPermissions=r,c.penalty=0,c.channel=t,c.direction=i,c.apiName=c.channel+"Queue",c.title=s.instant("STAFF.ADD_AGENT_TO_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"type",line3:"voice"===c.channel?"penalty":"",labelAll:s.instant("STAFF.ALL_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),labelSelected:s.instant("STAFF.SELECTED_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}},c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){var e;switch(c.channel){case"voice":switch(c.direction){case"inbound":e="VoiceQueues";break;case"outbound":e="QueueCampaigns"}break;case"chat":e="ChatQueues";break;case"mail":e="MailQueues";break;case"sms":e="SmsQueues";break;case"openchannel":e="OpenchannelQueues";break;case"fax":e="FaxQueues"}d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:e}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveQueues=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.user.removeQueues({id:c.agent.id,ids:_.map(t,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else if("voice"===c.channel){for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.user.addQueues({id:c.agent.id,ids:_.map(o,"id"),channel:c.channel,penalty:_.trim(s,"penalty ")}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}else d.user.addQueues({id:c.agent.id,ids:_.map(r,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){n(e)})});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Queues association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:QUEUES_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","channel","direction","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentQueueAddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.user.getTeams({id:l.agent.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.agent=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("STAFF.ALL_TEAMS"),labelSelected:t.instant("STAFF.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.user.removeTeams({id:l.agent.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.user.addTeams({id:l.agent.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentteamaddController",e)}(),function(){"use strict";function e(e,n,i,s,t,a,o,r,l,d,c){var m=this;m.currentUser=l.getCurrentUser(),m.license=t,m.setting=a,m.passwordPattern=m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.location=n.protocol()+"://"+n.host(),m.agent=d||e.params.agent||{},m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=l.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.hasModulePermissions={},m.selectedTab=e.params.tab||0,m.queueaddchannel=function(e,n,t,a){i.show({controller:"AgentQueueAddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:m.agents?m.agents.rows:[],channel:n,direction:a||"inbound",crudPermissions:m.crudPermissions}})},m.teamadddialog=function(e,n){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:m.agents?m.agents.rows:[],crudPermissions:m.crudPermissions}})},m.changepassworddialog=function(e,n){i.show({controller:"AgentchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,setting:a,agents:m.agents?m.agents.rows:[],crudPermissions:m.crudPermissions}})},m.onEnableScreenRecordingByAgentSelection=function(){["phoneBarEnableAutomaticScreenRecording"].forEach(function(e){m.agent.phoneBarEnableScreenRecordingByAgent&&(m.agent[e]=!m.agent.phoneBarEnableScreenRecordingByAgent)})},m.onEnableAutomaticScreenRecordingSelection=function(){["phoneBarEnableScreenRecordingByAgent"].forEach(function(e){m.agent.phoneBarEnableAutomaticScreenRecording&&(m.agent[e]=!m.agent.phoneBarEnableAutomaticScreenRecording)})},m.alert=r.info,m.gotoAgents=function(){e.go("app.staff.agents",{},{reload:"app.staff.agents"})},m.saveAgent=function(){m.agent=_.omit(m.agent,"userpic"),o.user.update({id:m.agent.id},m.agent).$promise.then(function(){r.success({title:"Agent updated!",msg:m.agent.name?m.agent.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.refreshAgent=function(){return o.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.agent=e})},l.hasRole("admin")?o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.contexts,{id:e.resourceId})}),t=null;if(m.agent&&(t=_.find(m.contexts,{name:m.agent.context})),t&&!_.some(n,["id",t.id])){var a=_.find(m.contexts,{id:t.id});a.canSelect=!1,n.push(a)}m.contexts=n}):o.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){m.contexts=e.rows||[]})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","agent","userProfileSection"],angular.module("app.staff").controller("AgentController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TEAM",g.team=angular.copy(l),g.teams=r,g.newTeam=!1,g.team||(g.team={},g.title="STAFF.NEW_TEAM",g.newTeam=!0),g.addNewTeam=function(){g.errors=[],d.team.save(g.team).$promise.then(function(e){g.teams.unshift(e.toJSON()),o.success({title:"Team properly created",msg:g.team.name?g.team.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTeam=function(){g.errors=[],d.team.update({id:g.team.id},g.team).$promise.then(function(e){var n=_.find(g.teams,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Team properly saved!",msg:g.team.name?g.team.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTeam=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The team will be deleted.").ariaLabel("Delete Team").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.team.delete({id:g.team.id}).$promise.then(function(){_.remove(g.teams,{id:g.team.id}),o.success({title:"Team properly deleted!",msg:(g.team.name||"team")+" has been deleted!"}),v(g.team)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","teams","team","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTeamDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.team.getAgents({id:c.team.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.team=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.team.removeAgents({id:c.team.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.team.addAgents({id:c.team.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("STAFF.ALL_AGENTS"),labelSelected:r.instant("STAFF.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","team","teams","realtime","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("TeamagentaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.teams=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="teams",f.listOrder="",f.listOrderAsc=null,f.selectedTeams=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{team:e,teams:f.teams.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"TeamagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{team:e,teams:f.teams?f.teams.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("team")+"?").htmlContent("<b>"+(e.name||"team")+"</b> will be deleted.").ariaLabel("delete team").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTeams=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.team.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Teams",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTeam=function(e,n){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{team:n,teams:f.teams.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTeam=y,f.exportSelectedTeams=function(){var e=angular.copy(f.selectedTeams);return f.selectedTeams=[],e},f.deleteSelectedTeams=function(e){var n=i.confirm().title("Are you sure want to delete the selected teams?").htmlContent("<b>"+f.selectedTeams.length+" selected</b> will be deleted.").ariaLabel("delete Teams").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTeams.forEach(function(e){y(e)}),f.selectedTeams=[]})},f.deselectTeams=function(){f.selectedTeams=[]},f.selectAllTeams=function(){f.selectedTeams=f.teams.rows};var b=!0,A=1;function E(e){f.teams=e||{count:0,rows:[]}}function y(e){m.team.delete({id:e.id}).$promise.then(function(){_.remove(f.teams.rows,{id:e.id}),f.teams.count-=1,f.teams.rows.length||f.getTeams(),p.success({title:_.startCase("Team")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEteam"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEteam",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTeams())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","teams","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("TeamsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TELEPHONE",g.telephone=angular.copy(l),g.telephones=r,g.newTelephone=!1,g.telephone||(g.telephone={role:"telephone",autointernal:!0,context:"from-sip"},g.title="STAFF.NEW_TELEPHONE",g.newTelephone=!0),g.addNewTelephone=function(){g.errors=[],d.user.save(g.telephone).$promise.then(function(e){g.telephones.unshift(e.toJSON()),o.success({title:"Telephone properly created",msg:g.telephone.name?g.telephone.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTelephone=function(){g.errors=[],d.user.update({id:g.telephone.id},g.telephone).$promise.then(function(e){var n=_.find(g.telephones,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Telephone properly saved!",msg:g.telephone.name?g.telephone.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTelephone=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The telephone will be deleted.").ariaLabel("Delete Telephone").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.user.delete({id:g.telephone.id}).$promise.then(function(){_.remove(g.telephones,{id:g.telephone.id}),o.success({title:"Telephone properly deleted!",msg:(g.telephone.name||"telephone")+" has been deleted!"}),v(g.telephone)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","telephones","telephone","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTelephoneDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.telephone=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.telephone.id,newPassword:r.password};r.currentUser.id==r.telephone.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"Telephone password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.telephone.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.telephone.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.telephoneForm.password.$setValidity("oldPasswordMatch",!1):t.telephoneForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","telephone","setting","Auth"],angular.module("app.staff").controller("TelephonechangepasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.telephone=c||e.params.telephone||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.changepassworddialog=function(e,n){t.show({controller:"TelephonechangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{telephone:e,setting:o,telephones:u.telephones?u.telephones.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTelephones=function(){e.go("app.staff.telephones",{},{reload:"app.staff.telephones"})},u.saveTelephone=function(){r.user.update({id:u.telephone.id},u.telephone).$promise.then(function(){l.success({title:"Telephone updated!",msg:u.telephone.name?u.telephone.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.telephone&&(t=_.find(u.contexts,{name:u.telephone.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","telephone","userProfileSection"],angular.module("app.staff").controller("TelephoneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.telephones=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="telephones",f.listOrder="",f.listOrderAsc=null,f.selectedTelephones=[],f.query={fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,page:1},f.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.staff.telephones.edit",{id:e.id,telephone:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("telephone")+"?").htmlContent("<b>"+(e.name||"telephone")+"</b> will be deleted.").ariaLabel("delete telephone").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTelephones=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.user.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Telephones",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTelephone=function(e,n){i.show({controller:"CreateOrEditTelephoneDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{telephone:n,telephones:f.telephones.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTelephone=y,f.exportSelectedTelephones=function(){var e=angular.copy(f.selectedTelephones);return f.selectedTelephones=[],e},f.deleteSelectedTelephones=function(e){var n=i.confirm().title("Are you sure want to delete the selected telephones?").htmlContent("<b>"+f.selectedTelephones.length+" selected</b> will be deleted.").ariaLabel("delete Telephones").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTelephones.forEach(function(e){y(e)}),f.selectedTelephones=[]})},f.deselectTelephones=function(){f.selectedTelephones=[]},f.selectAllTelephones=function(){f.selectedTelephones=f.telephones.rows};var b=!0,A=1;function E(e){f.telephones=e||{count:0,rows:[]}}function y(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(f.telephones.rows,{id:e.id}),f.telephones.count-=1,f.telephones.rows.length||f.getTelephones(),p.success({title:_.startCase("Telephone")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTelephones())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","telephones","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("TelephonesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_USERPROFILE",g.userProfile=angular.copy(l),g.userProfiles=r,g.newUserProfile=!1,g.userProfile||(g.userProfile={crudPermissions:["r"],downloadAttachments:!0,downloadCallySquareRecordings:!0,downloadContactManagerLists:!0,downloadJscriptySessions:!0,downloadOmnichannelInteractions:!0,downloadScreenRecordings:!0,downloadVoiceRecordings:!0},g.title="STAFF.NEW_USERPROFILE",g.newUserProfile=!0),g.addNewUserProfile=function(){g.errors=[],d.userProfile.save(g.userProfile).$promise.then(function(e){var n,t;t=[],(n=e).crudPermissions.forEach(function(e){var n;switch(e){case"r":n="READ_PERMISSION";break;case"e":n="EDIT_PERMISSION";break;case"d":n="DELETE_PERMISSION"}t.push(s.instant("STAFF."+n))}),n.selectedcrudPermissions=t.join(", "),g.userProfiles.unshift(e.toJSON()),o.success({title:"UserProfile properly created",msg:g.userProfile.name?g.userProfile.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveUserProfile=function(){g.errors=[],d.userProfile.update({id:g.userProfile.id},g.userProfile).$promise.then(function(e){var n=_.find(g.userProfiles,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"UserProfile properly saved!",msg:g.userProfile.name?g.userProfile.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteUserProfile=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The userProfile will be deleted.").ariaLabel("Delete UserProfile").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.userProfile.delete({id:g.userProfile.id}).$promise.then(function(){_.remove(g.userProfiles,{id:g.userProfile.id}),o.success({title:"UserProfile properly deleted!",msg:(g.userProfile.name||"userProfile")+" has been deleted!"}),v(g.userProfile)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","userProfiles","userProfile","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditUserProfileDialogController",e)}(),function(){"use strict";function e(n,a,i,e,t,s,o){var r=this;function l(e){n.hide(e)}r.newUserProfile=!0,r.userProfile=angular.copy(t),r.userProfiles=s,r.title=o.instant("STAFF.CLONE_USERPROFILE"),t&&t.name&&(r.title+=": "+t.name),r.cloneUserProfile=function(){return e.userProfile.clone({id:t.id},r.userProfile).$promise.then(function(e){var n,t;t=[],(n=e).crudPermissions.forEach(function(e){var n;switch(e){case"r":n="READ_PERMISSION";break;case"e":n="EDIT_PERMISSION";break;case"d":n="DELETE_PERMISSION"}t.push(o.instant("STAFF."+n))}),n.selectedcrudPermissions=t.join(", "),r.userProfiles.unshift(e.toJSON()),i.success({title:"UserProfile properly cloned",msg:r.userProfile.name?r.userProfile.name+" has been cloned!":""}),a.go("app.staff.userProfiles.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.clone"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","userProfile","userProfiles","$translate"],angular.module("app.staff").controller("UserProfilecloneController",e)}(),function(){"use strict";function e(t,o,r,l,d,e,n,c){var m=this;function u(e,n){switch(e.allResourcesEnabled="full"===n,n){case"full":return _.find(m.statusList,["tag","full"]);case"partial":return _.find(m.statusList,["tag","partial"]);case"disabled":return _.find(m.statusList,["tag","disabled"]);case"unlicensed":return _.find(m.statusList,["tag","unlicensed"]);case"unknown":default:return _.find(m.statusList,["tag","unknown"])}}function p(e){return l(function(n,t){var o,a;void 0!==e.channel&&_.includes(e.route,"Queue")?(a=e,l(function(n,t){var e=void 0!==a.channel&&"bull"===a.channel?"outbound":"inbound";return d[a.route].get({fields:"id,name,strategy,type",channel:"bull"===a.channel?"voice":a.channel,type:e,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})).then(function(e){n(e)}).catch(function(e){t(e)}):(o=e,l(function(a,n){switch(o.route){case"voiceExtension":var e;switch(o.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}break;case"interval":var t=!0;break;case"disposition":var i=!0;break;case"user":var s;switch(o.title){case"Agents":s="agent";break;case"Telephones":s="telephone";break;case"Users":s="user"}}if("Reports"===o.title){if(!o.reportType)return d.analyticDefaultReport.get({nolimit:!0}).$promise.then(function(t){d.analyticCustomReport.get({nolimit:!0}).$promise.then(function(e){var n=_.union(t.rows,e.rows);a({count:n.length,rows:n.rows})})}).catch(function(e){n(e)});switch(o.reportType){case"default":o.route="analyticDefaultReport";break;case"custom":o.route="analyticCustomReport"}}return d[o.route].get({role:s||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:t?"null":void 0,MailAccountId:i?"null":void 0,FaxAccountId:i?"null":void 0,SmsAccountId:i?"null":void 0,OpenchannelAccountId:i?"null":void 0,ChatWebsiteId:i?"null":void 0,WhatsappAccountId:i?"null":void 0,ListId:i?"null":void 0,nolimit:!0}).$promise.then(function(e){a(e)}).catch(function(e){n(e)})})).then(function(e){n(e)}).catch(function(e){t(e)})})}function g(e,n,t){var a=e&&0<e.length?e[0]:null;if(!a)return t;var i,s,o=_.find(n,["sectionId",a.id]);return o?(n=_.remove(n,["sectionId",a.id]),(i=a,s=o.id,l(function(n,t){d.userProfileResource.get({sectionId:s}).$promise.then(function(n){return p(i).then(function(e){return _.differenceBy(n.rows,e.rows,"id")})}).then(function(e){_.isEmpty(e)?n():t()}).catch(function(e){t(e)})})).then(function(){return t="full",g(e.shift(),n,t)}).catch(function(e){return l.reject(e)})):void 0}function a(a){var t="Marketplace"===a.title?"AppZone":a.title;m.license?void 0===a.permissions||a.permissions.association?void 0===a.license||m.license[a.license]?d.userProfileSection.get({userProfileId:m.userProfile.id,category:t}).$promise.then(function(e){var n=e&&e.rows&&0<e.rows.length?e.rows:[];if("Dashboards"===a.title)return _.isEmpty(n)?"disabled":n[0].autoAssociation?"full":d.userProfileResource.get({sectionId:n[0].id,resourceId:101}).$promise.then(function(e){return(e&&e.rows?e.rows[0]:null)?"full":"partial"});var t=_.filter(a.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e});return n.length!==t.length?0===n.length?"disabled":"partial":_.every(n,["autoAssociation",!0])?"full":g(_.filter(t,function(e){return void 0===e.permissions||e.permissions.association?e:void 0}),n,"partial")}).then(function(e){a.status=u(a,e)}).catch(function(e){var n=e?"unknown":"partial";a.status=u(a,n),e&&c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GETRESOURCES("+t.toUpperCase()+")",msg:e.status?JSON.stringify(e.data):e.toString()})}):a.status=u(a,"unlicensed"):d.userProfileSection.get({userProfileId:m.userProfile.id,sectionId:a.id}).$promise.then(function(e){var n=(e&&1===e.rows.length?e.rows[0]:null)?"full":"disabled";a.status=u(a,n)}):a.status=u(a,"unknown")}m.userProfile={},m.license={},m.navigation=e.getNavigation(),m.modules=m.navigation[0].children,m.statusList=[{id:0,name:"Fully Enabled",color:"green-A700-bg",info:"All resources enabled",tag:"full"},{id:1,name:"Partially Enabled",color:"orange-A700-bg",info:"Some resources enabled",tag:"partial"},{id:2,name:"Disabled",color:"grey-A400-bg",info:"No resources enabled",tag:"disabled"},{id:3,name:"Unlicensed",color:"red-A700-bg",info:"Module not included in the license",tag:"unlicensed"},{id:4,name:"Unknown",color:"grey-A700-bg",info:"Unknown status",tag:"unknown"}],m.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],m.init=function(e,n){m.userProfile=e,m.license=n},m.onChangeEnableAllResources=function(n){var e=void 0!==n.permissions&&!n.permissions.association,a="Marketplace"===n.title?"AppZone":n.title;if("Fully Enabled"!==n.status.name){var i=[];if(e)return i.push({category:a,sectionId:n.id,name:a,enabled:!0,crudPermissions:"red"}),d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){n.status=u(n,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})});var t=o.confirm({skipHide:!0}).title("Warning").textContent(r.instant("STAFF.PERMISSIONS_WARNING_ENABLE_ALL",{sectionName:r.instant(n.translate)})).ariaLabel("Warning").ok(r.instant("STAFF.CONFIRM")).cancel(r.instant("STAFF.CANCEL"));o.show(t).then(function(){switch(a){case"Dashboards":_.map(m.dashboardSections,function(e){i.push({category:a,sectionId:e.id,name:e.title,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})});break;default:_.map(n.children,function(e){var n=!(void 0===e.permissions||!e.permissions.hidden);if(!n){var t=e.title;switch(a){case"CallySquare":t="Projects"===t?"SquareProjects":t}i.push({category:a,sectionId:e.id,name:t,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})}})}return d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){n.status=u(n,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})})}).catch(function(e){e?c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()}):n.status=u(n,n.status.tag)})}else if("Fully Enabled"===n.status.name){n.status=u(n,"disabled");var s=[];switch(a){case"Settings":case"Help":s=[n.id];break;case"Dashboards":s=_.map(m.dashboardSections,function(e){return e.id});break;default:s=_.map(n.children,function(e){return e.id})}return d.userProfile.removeSections({id:m.userProfile.id,ids:s}).$promise.then(function(){c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.REMOVESECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},m.manageResources=function(e,n){o.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!1,locals:{userProfile:m.userProfile,userProfiles:[],section:e}}).then(function(){a(e)})},m.checkSectionResources=a}e.$inject=["$document","$mdDialog","$translate","$q","api","msNavigationService","Auth","toasty"],angular.module("app.staff").controller("UserProfilePermissionsController",e)}(),function(){"use strict";function e(n,t,i,o,r,e,a,l,s,d){var c=this;function m(){var a=void 0!==c.selectedSection.pending&&c.selectedSection.pending;return i(function(t,n){r.userProfileSection.get({userProfileId:c.userProfile.id,sectionId:c.selectedSection.id}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;a||(c.selectedSection.enabled=!!n&&!!n.enabled,c.selectedSection.autoAssociation=!!n&&!!n.autoAssociation,c.selectedSection.crudPermissions=v(n?n.crudPermissions:c.userProfile.crudPermissions)),t(n)}).catch(function(e){n(e)})})}function u(){return i(function(n,t){c.loadedSection?r.userProfileResource.get({sectionId:c.loadedSection.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)}):n(null)})}function p(){return i(function(n,t){void 0!==c.selectedSection.channel&&_.includes(c.selectedSection.route,"Queue")?i(function(n,t){var e=void 0!==c.selectedSection.channel&&"bull"===c.selectedSection.channel?"outbound":"inbound";return r[c.selectedSection.route].get({fields:"id,name,strategy,type",channel:"bull"===c.selectedSection.channel?"voice":c.selectedSection.channel,type:e,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){n(e)}).catch(function(e){t(e)}):i(function(n,t){var e,a;if("voiceExtension"===c.selectedSection.route)switch(c.selectedSection.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}if("user"===c.selectedSection.route)switch(c.selectedSection.title){case"Agents":a="agent";break;case"Telephones":a="telephone";break;case"Users":a="user"}if("interval"===c.selectedSection.route)var i=!0;if("disposition"===c.selectedSection.route)var s=!0;if("Reports"===c.selectedSection.title&&(c.selectedSection.route="default"===c.selectedSection.reportType?"analyticDefaultReport":"analyticCustomReport"),"Dashboards"!==c.selectedSection.title)return r[c.selectedSection.route].get({role:a||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:i?"null":void 0,MailAccountId:s?"null":void 0,FaxAccountId:s?"null":void 0,SmsAccountId:s?"null":void 0,OpenchannelAccountId:s?"null":void 0,ChatWebsiteId:s?"null":void 0,WhatsappAccountId:s?"null":void 0,ListId:s?"null":void 0,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)});n({count:1,rows:[{id:101,name:l.instant("DASHBOARDS.GENERAL")}]})}).then(function(e){n(e)}).catch(function(e){t(e)})})}function g(){var i=void 0!==c.selectedSection.pending&&c.selectedSection.pending,s=[];return u().then(function(e){var n;return s=e&&e.rows?e.rows:[],"Reports"===c.selectedSection.title&&(c.associatedReports=c.associatedReports?c.associatedReports:s,n=c.associatedReports,s=_.filter(n,{type:"default"===c.selectedSection.reportType?"DefaultReports":"CustomReports"})),void 0===c.selectedSection.permissions||c.selectedSection.permissions.association?p():{rows:[]}}).then(function(e){c.items=e.rows?_.map(e.rows,function(e){var n,t;return"Reports"===c.selectedSection.title&&(e.fullPath=(n=e.parent,t=c.treeStructure[0].text,t=function e(n,t,a){if(!a||_.isEmpty(a.children))return n;var a=_.find(a.children,function(e){return _.includes(t,e.id)?e:void 0});return n+=a?"/"+a.text:"",e(n,t,a)}(t,n,c.treeStructure[0])).replace(" ","_")),e.isValid=!0,e}):[],i||(c.selectedSection.selectedItems=_.map(s,function(e){return _.find(c.items,{id:e.resourceId})}));var n,t=_.differenceBy(c.selectedSection.selectedItems,c.items,"id");switch(_.isEmpty(t)||(c.selectedSection.selectedItems=_.pullAllBy(c.selectedSection.selectedItems,t,"id")),c.selectedSection.title){case"Contexts":c.selectedSection.selectedItems=_.filter(c.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(s,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"MusicOnHolds":c.selectedSection.selectedItems=_.filter(c.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(s,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"Reports":var a=(n=c.allReportsSelected,_.filter(n,function(e){return _.startsWith(e.parent,"default"===c.selectedSection.reportType?"motion":"custom")}));c.selectedSection.selectedItems=b(c.selectedSection.selectedItems),c.selectedSection.selectedItems=_.unionBy(c.selectedSection.selectedItems,a,"id")}c.dualMultiselectOptions.selectedItems=c.selectedSection.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.items,c.dualMultiselectOptions.selectedItems,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+c.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})}function v(e){return e&&(c.selectedSection.allowEdit=!!_.includes(e,"e"),c.selectedSection.allowDelete=!!_.includes(e,"d")),function(){var e=["r"];if(c.selectedSection.allowEdit)e.push("e");else{var n=_.indexOf(e,["e"]);0<n&&c.selectedSection.crudPermissions.replace("e","")}if(c.selectedSection.allowDelete)e.push("d");else{var n=_.indexOf(e,["d"]);0<n&&c.selectedSection.crudPermissions.replace("d","")}return e}()}function h(e){var n=_.findIndex(c.subsections,function(e){return e.id==c.selectedSection.id});c.subsections[n].pending=e,f()}function f(){return c.pendingChanges=_.some(c.subsections,["pending",!0])}function b(e){return _.remove(e,function(e){return _.startsWith(e.parent,"default"===c.selectedSection.reportType?"motion":"custom")})}function A(){_.isEmpty(c.selectedSection.selectedItems)?c.allReportsSelected=_.remove(c.allReportsSelected,function(e){return e.type===("default"===c.selectedSection.reportType?"CustomReports":"DefaultReports")}):c.selectedSection.selectedItems.forEach(function(e){_.some(c.allReportsSelected,{id:e.id,parent:e.parent})||c.allReportsSelected.push(e)})}c.userProfile=e,c.penalty=0,c.section=angular.copy(d),c.title=l.instant("STAFF.PERMISSIONS_SECTION_TITLE",{sectionName:l.instant(c.section.translate)}),c.items=[],c.selectedItems=[],c.subsections=_.filter(c.section.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e}),c.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],c.dashboardItems=[],"Dashboards"===c.section.title&&(c.dashboardItems=c.subsections,c.subsections=c.dashboardSections),c.selectedSection=null,c.loadedSection=null,c.allReportsSelected=[],c.closeDialog=function(e){if(c.pendingChanges){var n=t.confirm({skipHide:!0}).title("Warning").textContent(l.instant("STAFF.PERMISSIONS_WARNING_CLOSE")).ariaLabel("Warning").targetEvent(e).ok(l.instant("STAFF.CLOSE")).cancel(l.instant("STAFF.CANCEL"));t.show(n).then(function(){t.hide()})}else t.hide()},c.onChangeSection=function(){return m().then(function(e){if(c.loadedSection=e,"Reports"===c.selectedSection.title)return i(function(n,t){r.analyticTreeReport.get({}).$promise.then(function(e){c.treeReports=e.rows||[],n(c.treeReports)}).catch(function(e){t(e)})}).then(function(){if(!c.selectedSection.reportType)return u().then(function(e){c.allReportsSelected=e?_.map(e.rows,function(e){return{id:e.resourceId,name:e.name,type:e.type}}):[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREE_REPORT_STRUCTURE",msg:e.data?JSON.stringify(e.data):e.toString()})});g()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+c.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})},c.onChangeVisibility=function(){c.selectedSection.enabled=!c.selectedSection.enabled,h(!0)},c.onChangeAutoAssociation=function(){if(!c.selectedSection.autoAssociation){for(var e=[],n=0;n<c.dualMultiselectOptions.items.length;n++)e.push(c.dualMultiselectOptions.items[n]),c.dualMultiselectOptions.selectedItems.push(c.dualMultiselectOptions.items[n]);c.dualMultiselectOptions.items=[],c.dualMultiselectOptions.transferCallback(e,!1)}h(!0)},c.onChangeReportType=function(){c.treeStructure="default"===c.selectedSection.reportType?c.treeReports[0]?angular.fromJson(c.treeReports[0].tree):[]:c.treeReports[1]?angular.fromJson(c.treeReports[1].tree):[],c.selectedSection.selectedItems&&(c.allReportsSelected=b(c.allReportsSelected),A());g()},c.setPermission=function(e){"edit"===e?c.selectedSection.allowEdit=!c.selectedSection.allowEdit:"delete"===e&&(c.selectedSection.allowDelete=!c.selectedSection.allowDelete);c.selectedSection.crudPermissions=v(),h(!0)},c.saveSection=function(){var a="Marketplace"===c.section.title?"AppZone":c.section.title,e=_(c.subsections).filter({pending:!0}).map(function(e){var n="CallySquare"===a&&"Projects"===e.title?"SquareProjects":e.title,t="Reports"===n?c.allReportsSelected:e.selectedItems;return"Integrations"===a&&(e.autoAssociation=!0),{category:a,sectionId:e.id,name:n,enabled:e.enabled,autoAssociation:e.autoAssociation,crudPermissions:_.map(e.crudPermissions).join(""),Resources:_.map(t,function(e){return{name:e.name,resourceId:e.id,type:function(e,n){if("Reports"!==e)return e;{if(n.parent){var t=_.startsWith(n.parent,"motion")?"Default":"Custom";return t+e}return n.type}}(n,e)}})}}).value();return r.userProfile.addSections({id:c.userProfile.id},e).$promise.then(function(){c.subsections.forEach(function(e){e.pending=void 0}),c.associatedReports=null,f(),"Reports"!==c.selectedSection.title||c.selectedSection.reportType||n.userProfileForm.$setPristine(),o.success({title:l.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_TITLE",{sectionName:l.instant(a.translate)}),msg:l.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_MESSAGE")})}).then(function(){return m().then(function(e){c.loadedSection=e})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",line4:"fullPath",labelAll:l.instant("STAFF.PERMISSIONS_ALL_RESOURCES"),labelSelected:l.instant("STAFF.PERMISSIONS_SELECTED_RESOURCES"),transferCallback:function(e,n){h(!0),n?(c.selectedSection.selectedItems=_.pullAllBy(c.selectedSection.selectedItems,e,"id"),c.selectedSection.autoAssociation=!1):c.selectedSection.selectedItems=_.unionBy(c.selectedSection.selectedItems,e,"id"),"Reports"===c.selectedSection.title&&A()}}}e.$inject=["$scope","$mdDialog","$q","toasty","api","userProfile","userProfiles","$translate","Auth","section"],angular.module("app.staff").controller("UserProfilepermissionsmanageController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.userProfile=c||e.params.userProfile||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.permissionsmanagedialog=function(e,n){t.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.clonedialog=function(e,n){t.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoUserProfiles=function(){e.go("app.staff.userProfiles",{},{reload:"app.staff.userProfiles"})},u.saveUserProfile=function(){r.userProfile.update({id:u.userProfile.id},u.userProfile).$promise.then(function(){l.success({title:"UserProfile updated!",msg:u.userProfile.name?u.userProfile.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuserProfile",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","userProfile","userProfileSection"],angular.module("app.staff").controller("UserProfileController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.userProfiles=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="userProfiles",f.listOrder="",f.listOrderAsc=null,f.selectedUserProfiles=[],f.query={fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",sort:"-updatedAt",limit:10,page:1},f.arraycrudPermissions=_.keyBy([{option:"Read_permission",value:"'r'",disabled:!0},{option:"Edit_permission",value:"'e'"},{option:"Delete_permission",value:"'d'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.userProfiles&&0<f.userProfiles.count&&f.userProfiles.rows.forEach(function(e){var n=[];e.crudPermissions.forEach(function(e){n.push(f.arraycrudPermissions[e].option)});var t=[];n.forEach(function(e){t.push(r.instant("STAFF."+e.toUpperCase()))}),e.selectedcrudPermissions=t.join(", ")}),f.editstate=function(e,n){t.go("app.staff.userProfiles.edit",{id:e.id,userProfile:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:f.userProfiles?f.userProfiles.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("userProfile")+"?").htmlContent("<b>"+(e.name||"userProfile")+"</b> will be deleted.").ariaLabel("delete userProfile").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getUserProfiles=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.userProfile.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="UserProfiles",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditUserProfile=function(e,n){i.show({controller:"CreateOrEditUserProfileDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{userProfile:n,userProfiles:f.userProfiles.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteUserProfile=y,f.exportSelectedUserProfiles=function(){var e=angular.copy(f.selectedUserProfiles);return f.selectedUserProfiles=[],e},f.deleteSelectedUserProfiles=function(e){var n=i.confirm().title("Are you sure want to delete the selected userProfiles?").htmlContent("<b>"+f.selectedUserProfiles.length+" selected</b> will be deleted.").ariaLabel("delete UserProfiles").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedUserProfiles.forEach(function(e){y(e)}),f.selectedUserProfiles=[]})},f.deselectUserProfiles=function(){f.selectedUserProfiles=[]},f.selectAllUserProfiles=function(){f.selectedUserProfiles=f.userProfiles.rows};var b=!0,A=1;function E(e){f.userProfiles=e||{count:0,rows:[]}}function y(e){m.userProfile.delete({id:e.id}).$promise.then(function(){_.remove(f.userProfiles.rows,{id:e.id}),f.userProfiles.count-=1,f.userProfiles.rows.length||f.getUserProfiles(),p.success({title:_.startCase("UserProfile")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuserProfile"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuserProfile",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getUserProfiles())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","userProfiles","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("UserProfilesController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c){var m=this;function u(){return s.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.user=e})}function p(e){t.hide(e)}m.currentUser=o.getCurrentUser(),m.errors=[],m.setting=l,m.license=r,m.crudPermissions=d,m.hasModulePermissions={},m.passwordPattern=m.setting&&m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.title="STAFF.EDIT_USER",m.user=angular.copy(i),m.users=n,m.newUser=!1,m.user||(m.user={role:"user",autointernal:!0,context:"from-sip"},m.title="STAFF.NEW_USER",m.newUser=!0),m.addNewUser=function(){m.errors=[],s.user.save(m.user).$promise.then(function(e){m.users.unshift(e.toJSON()),a.success({title:"User properly created",msg:m.user.name?m.user.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveUser=function(){m.errors=[],s.user.update({id:m.user.id},m.user).$promise.then(function(e){var n=_.find(m.users,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"User properly saved!",msg:m.user.name?m.user.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteUser=function(e){if(o.getCurrentUser().id===m.user.id)return a.error({title:"User not deleted!",msg:"You can't remove yourself"});m.errors=[];var n=t.confirm().title("Are you sure?").content("The user will be deleted.").ariaLabel("Delete User").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){s.user.delete({id:m.user.id}).$promise.then(function(){_.remove(m.users,{id:m.user.id}),a.success({title:"User properly deleted!",msg:(m.user.name||"user")+" has been deleted!"}),p(m.user)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.closeDialog=p,s.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.userProfiles=e.rows||[]}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var g="user-setting:update:user-"+m.user.id;c.on(g,u),e.$on("$destroy",function(){c.removeListener(g,u)})}e.$inject=["$scope","$mdDialog","toasty","users","user","api","Auth","license","setting","crudPermissions","socket"],angular.module("app.staff").controller("CreateOrEditUserDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;function o(){e.hide()}s.currentUser=i.getCurrentUser(),s.errors=[],s.user=a,s.generateApiKey=function(){s.errors=[],t.user.createApiKey({id:s.user.id}).$promise.then(function(e){s.user.apiKey=e.api_key||"N/A",n.success({title:"User API key updated!"}),o()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.createApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.createApiKey"}]})},s.removeApiKey=function(){s.errors=[],t.user.removeApiKey({id:s.user.id}).$promise.then(function(){s.user.apiKey="N/A",n.success({title:"User API key removed!"}),o()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.removeApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.removeApiKey"}]})},s.closeDialog=o}e.$inject=["$mdDialog","toasty","api","user","Auth"],angular.module("app.staff").controller("UserapikeymanagerController",e)}(),function(){"use strict";function e(e,a){var i=this;i.user={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.user.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.user.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.user=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.user.id+"/avatar",i.user.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Userchange_avatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.user=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.user.id,newPassword:r.password};r.currentUser.id==r.user.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"User password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.user.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.userForm.password.$setValidity("oldPasswordMatch",!1):t.userForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","user","setting","Auth"],angular.module("app.staff").controller("UserchangepasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;m.currentUser=l.getCurrentUser(),m.license=i,m.setting=s,m.passwordPattern=m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.location=n.protocol()+"://"+n.host(),m.user=d||e.params.user||{},m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=l.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.hasModulePermissions={},m.selectedTab=e.params.tab||0,m.apikeymanagerdialog=function(e,n){t.show({controller:"UserapikeymanagerController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,users:m.users?m.users.rows:[],crudPermissions:m.crudPermissions}})},m.changepassworddialog=function(e,n){t.show({controller:"UserchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,setting:s,users:m.users?m.users.rows:[],crudPermissions:m.crudPermissions}})},m.alert=r.info,m.gotoUsers=function(){e.go("app.staff.users",{},{reload:"app.staff.users"})},m.saveUser=function(){m.user=_.omit(m.user,"userpic"),o.user.update({id:m.user.id},m.user).$promise.then(function(){r.success({title:"User updated!",msg:m.user.name?m.user.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.refreshUser=function(){return o.user.get({id:m.user.id,userSetting:!0}).$promise.then(function(e){m.user=e})},o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.userProfiles=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.user.getApiKey({id:m.user.id}).$promise.then(function(e){m.user.apiKey=e.api_key?e.api_key:"N/A"}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_APIKEY",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","user","userProfileSection"],angular.module("app.staff").controller("UserController",e)}(),function(){"use strict";function e(e,t,a,i,s,n,o,r,l,d,c,m,u,p){var g=this;g.license=m,g.setting=u,g.currentUser=c.getCurrentUser(),g.users=n||{count:0,rows:[]},g.userProfile=o,g.userProfileSection=r&&1==r.count?r.rows[0]:null,g.crudPermissions=c.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.table="users",g.listOrder="",g.listOrderAsc=null,g.selectedUsers=[],g.query={fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled",role:"admin,user",userSetting:!0,sort:"-updatedAt",limit:10,page:1},g.arrayrole=_.keyBy([{option:"Admin",value:"'admin'"},{option:"User",value:"'user'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.editstate=function(e,n){t.go("app.staff.users.edit",{id:e.id,user:e,crudPermissions:g.crudPermissions})},g.deleteconfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the "+_.startCase("user")+"?").htmlContent("<b>"+(e.name||"user")+"</b> will be deleted.").ariaLabel("delete user").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){A(e)},function(){console.log("CANCEL")})},g.success=f,g.getUsers=b,g.createOrEditUser=function(e,n){a.show({controller:"CreateOrEditUserDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{user:n,users:g.users.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}})},g.deleteUser=A,g.exportSelectedUsers=function(){var e=angular.copy(g.selectedUsers);return g.selectedUsers=[],e},g.deleteSelectedUsers=function(e){var n=a.confirm().title("Are you sure want to delete the selected users?").htmlContent("<b>"+g.selectedUsers.length+" selected</b> will be deleted.").ariaLabel("delete Users").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){g.selectedUsers.forEach(function(e){A(e)}),g.selectedUsers=[]})},g.deselectUsers=function(){g.selectedUsers=[]},g.selectAllUsers=function(){g.selectedUsers=g.users.rows},l.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.userProfiles=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=!0,h=1;function f(e){g.users=e||{count:0,rows:[]}}function b(){g.query.offset=(g.query.page-1)*g.query.limit,c.hasRole("admin")?g.promise=l.user.get(g.query,f).$promise:(g.query.id=g.userProfile.id,g.query.section="Users",g.promise=l.userProfile.getResources(g.query,f).$promise)}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(g.users.rows,{id:e.id}),g.users.count-=1,g.users.rows.length||g.getUsers(),d.success({title:_.startCase("User")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){v?s(function(){v=!1}):(n||(h=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=h),g.getUsers())}),p.on("user-setting:update",b),e.$on("$destroy",function(){p.removeListener("user-setting:update",b)})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","users","userProfile","userProfileSection","api","toasty","Auth","license","setting","socket"],angular.module("app.staff").controller("UsersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.cannedAnswers=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="cannedAnswers",f.listOrder="",f.listOrderAsc=null,f.selectedCannedAnswers=[],f.query={fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{cannedAnswer:e,cannedAnswers:f.cannedAnswers.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("cannedAnswer")+"?").htmlContent("<b>"+(e.name||"cannedAnswer")+"</b> will be deleted.").ariaLabel("delete cannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCannedAnswers=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cannedAnswer.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="CannedAnswers",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCannedAnswer=function(e,n){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{cannedAnswer:n,cannedAnswers:f.cannedAnswers.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCannedAnswer=y,f.exportSelectedCannedAnswers=function(){var e=angular.copy(f.selectedCannedAnswers);return f.selectedCannedAnswers=[],e},f.deleteSelectedCannedAnswers=function(e){var n=i.confirm().title("Are you sure want to delete the selected cannedAnswers?").htmlContent("<b>"+f.selectedCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete CannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCannedAnswers.forEach(function(e){y(e)}),f.selectedCannedAnswers=[]})},f.deselectCannedAnswers=function(){f.selectedCannedAnswers=[]},f.selectAllCannedAnswers=function(){f.selectedCannedAnswers=f.cannedAnswers.rows};var b=!0,A=1;function E(e){f.cannedAnswers=e||{count:0,rows:[]}}function y(e){m.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(f.cannedAnswers.rows,{id:e.id}),f.cannedAnswers.count-=1,f.cannedAnswers.rows.length||f.getCannedAnswers(),p.success({title:_.startCase("CannedAnswer")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcannedAnswer"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcannedAnswer",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCannedAnswers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","cannedAnswers","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("CannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CANNEDANSWER",g.cannedAnswer=angular.copy(l),g.cannedAnswers=r,g.newCannedAnswer=!1,g.cannedAnswer||(g.cannedAnswer={},g.title="TOOLS.NEW_CANNEDANSWER",g.newCannedAnswer=!0),g.addNewCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.cannedAnswer).$promise.then(function(e){g.cannedAnswers.unshift(e.toJSON()),o.success({title:"CannedAnswer properly created",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.cannedAnswer.id},g.cannedAnswer).$promise.then(function(e){var n=_.find(g.cannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CannedAnswer properly saved!",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The cannedAnswer will be deleted.").ariaLabel("Delete CannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.cannedAnswer.id}).$promise.then(function(){_.remove(g.cannedAnswers,{id:g.cannedAnswer.id}),o.success({title:"CannedAnswer properly deleted!",msg:(g.cannedAnswer.name||"cannedAnswer")+" has been deleted!"}),v(g.cannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","cannedAnswers","cannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CUSTOMDASHBOARD",g.customDashboard=angular.copy(l),g.customDashboards=r,g.newCustomDashboard=!1,g.customDashboard||(g.customDashboard={},g.title="TOOLS.NEW_CUSTOMDASHBOARD",g.newCustomDashboard=!0),g.addNewCustomDashboard=function(){g.errors=[],d.dashboard.save(g.customDashboard).$promise.then(function(e){g.customDashboards.unshift(e.toJSON()),o.success({title:"CustomDashboard properly created",msg:g.customDashboard.name?g.customDashboard.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomDashboard=function(){g.errors=[],d.dashboard.update({id:g.customDashboard.id},g.customDashboard).$promise.then(function(e){var n=_.find(g.customDashboards,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CustomDashboard properly saved!",msg:g.customDashboard.name?g.customDashboard.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomDashboard=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The customDashboard will be deleted.").ariaLabel("Delete CustomDashboard").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.dashboard.delete({id:g.customDashboard.id}).$promise.then(function(){_.remove(g.customDashboards,{id:g.customDashboard.id}),o.success({title:"CustomDashboard properly deleted!",msg:(g.customDashboard.name||"customDashboard")+" has been deleted!"}),v(g.customDashboard)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customDashboards","customDashboard","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCustomDashboardDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.customDashboards=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="customDashboards",f.listOrder="",f.listOrderAsc=null,f.selectedCustomDashboards=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.tools.customDashboards.edit",{id:e.id,customDashboard:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:f.customDashboards?f.customDashboards.rows:[],crudPermissions:f.crudPermissions}})},f.gotodashboardgoto=function(e,n){t.go("app.dashboards.custom",{id:e.id})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("customDashboard")+"?").htmlContent("<b>"+(e.name||"customDashboard")+"</b> will be deleted.").ariaLabel("delete customDashboard").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCustomDashboards=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.dashboard.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="CustomDashboards",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCustomDashboard=function(e,n){i.show({controller:"CreateOrEditCustomDashboardDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{customDashboard:n,customDashboards:f.customDashboards.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCustomDashboard=y,f.exportSelectedCustomDashboards=function(){var e=angular.copy(f.selectedCustomDashboards);return f.selectedCustomDashboards=[],e},f.deleteSelectedCustomDashboards=function(e){var n=i.confirm().title("Are you sure want to delete the selected customDashboards?").htmlContent("<b>"+f.selectedCustomDashboards.length+" selected</b> will be deleted.").ariaLabel("delete CustomDashboards").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCustomDashboards.forEach(function(e){y(e)}),f.selectedCustomDashboards=[]})},f.deselectCustomDashboards=function(){f.selectedCustomDashboards=[]},f.selectAllCustomDashboards=function(){f.selectedCustomDashboards=f.customDashboards.rows};var b=!0,A=1;function E(e){f.customDashboards=e||{count:0,rows:[]}}function y(e){m.dashboard.delete({id:e.id}).$promise.then(function(){_.remove(f.customDashboards.rows,{id:e.id}),f.customDashboards.count-=1,f.customDashboards.rows.length||f.getCustomDashboards(),p.success({title:_.startCase("CustomDashboard")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdashboard"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCustomDashboards())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","customDashboards","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("CustomDashboardsController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newCustomDashboard=!0,r.customDashboard=angular.copy(i),r.customDashboards=s,r.title=o.instant("TOOLS.CLONE_CUSTOMDASHBOARD"),i&&i.name&&(r.title+=": "+i.name),r.cloneCustomDashboard=function(){return e.dashboard.clone({id:i.id,includeAll:!0},r.customDashboard).$promise.then(function(e){r.customDashboards.unshift(e.toJSON()),a.success({title:"CustomDashboard properly cloned",msg:r.customDashboard.name?r.customDashboard.name+" has been cloned!":""}),t.go("app.tools.customDashboards.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","customDashboard","customDashboards","$translate"],angular.module("app.tools").controller("CustomDashboardcloneController",e)}(),function(){"use strict";function e(t,a,e,i,s){var o=this;function r(e,n,t){return s.dashboardItem.update(t).$promise.catch(function(e){console.error(e)})}o.customDashboard={},o.voiceQueues=s.rpc.getVoiceQueues({fields:"id,name"}),s.smsAccount.get({fields:"id,name"}).$promise.then(function(e){o.smsAccounts=e||{count:0,rows:[]}}),s.faxAccount.get({fields:"id,name"}).$promise.then(function(e){o.faxAccounts=e||{count:0,rows:[]}}),s.mailAccount.get({fields:"id,name"}).$promise.then(function(e){o.mailAccounts=e||{count:0,rows:[]}}),s.openchannelAccount.get({fields:"id,name"}).$promise.then(function(e){o.openchannelAccounts=e||{count:0,rows:[]}}),s.whatsappAccount.get({fields:"id,name"}).$promise.then(function(e){o.whatsappAccounts=e||{count:0,rows:[]}}),s.chatWebsite.get({fields:"id,name"}).$promise.then(function(e){o.chatWebsites=e||{count:0,rows:[]}}),o.init=function(e,n){return o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},o.customDashboard=e,o.customDashboard.draggable={enabled:!0,handle:".draggable",stop:r},o.customDashboard.resizable={enabled:!0,handle:".resizable",stop:r},o.customDashboard.widgets=[],s.dashboard.getItems({id:e.id}).$promise.then(function(e){if(e&&e.count&&e.rows)for(var n=0;n<e.rows.length;n+=1)e.rows[n].voiceQueues=o.voiceQueues,e.rows[n].voiceQueuesSelected=_.map(o.voiceQueues.rows,"id"),e.rows[n].smsAccounts=o.smsAccounts,e.rows[n].smsAccountsSelected=_.map(o.smsAccounts.rows,"id"),e.rows[n].faxAccounts=o.faxAccounts,e.rows[n].faxAccountsSelected=_.map(o.faxAccounts.rows,"id"),e.rows[n].mailAccounts=o.mailAccounts,e.rows[n].mailAccountsSelected=_.map(o.mailAccounts.rows,"id"),e.rows[n].openchannelAccounts=o.openchannelAccounts,e.rows[n].openchannelAccountsSelected=_.map(o.openchannelAccounts.rows,"id"),e.rows[n].chatWebsites=o.chatWebsites,e.rows[n].chatWebsitesSelected=_.map(o.chatWebsites.rows,"id"),e.rows[n].whatsappAccounts=o.whatsappAccounts,e.rows[n].whatsappAccountsSelected=_.map(o.whatsappAccounts.rows,"id"),e.rows[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[n].type+"/ms-widget-engine."+e.rows[n].type+".html",o.customDashboard.widgets.push(e.rows[n])}).catch(function(e){console.error(e)})},o.createOrEditWidget=function(e){if(e&&e.attrs)for(var n=0;n<e.attrs.length;n+=1)"attrReport"===e.attrs[n].name&&(e.reportType=e.attrs[n].type),e[e.attrs[n].name]=e.attrs[n].value;t.show({controller:"CreateOrEditDashboardItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",parent:angular.element(a.body),clickOutsideToClose:!0,locals:{dashboarditem:e,dashboard:o.customDashboard.widgets,license:null,setting:null,crudPermissions:o.crudPermissions}}).then(function(e){if(e)for(var n=0;n<o.customDashboard.widgets.length;n+=1)o.customDashboard.widgets[n].id===e.id&&(o.customDashboard.widgets[n].attrs=e.attrs,o.customDashboard.widgets[n].voiceQueues=o.voiceQueues,o.customDashboard.widgets[n].voiceQueuesSelected=_.map(o.voiceQueues.rows,"id"),o.customDashboard.widgets[n].smsAccounts=o.smsAccounts,o.customDashboard.widgets[n].smsAccountsSelected=_.map(o.smsAccounts.rows,"id"),o.customDashboard.widgets[n].faxAccounts=o.faxAccounts,o.customDashboard.widgets[n].faxAccountsSelected=_.map(o.faxAccounts.rows,"id"),o.customDashboard.widgets[n].mailAccounts=o.mailAccounts,o.customDashboard.widgets[n].mailAccountsSelected=_.map(o.mailAccounts.rows,"id"),o.customDashboard.widgets[n].openchannelAccounts=o.openchannelAccounts,o.customDashboard.widgets[n].openchannelAccountsSelected=_.map(o.openchannelAccounts.rows,"id"),o.customDashboard.widgets[n].chatWebsites=o.chatWebsites,o.customDashboard.widgets[n].chatWebsitesSelected=_.map(o.chatWebsites.rows,"id"),o.customDashboard.widgets[n].whatsappAccounts=o.whatsappAccounts,o.customDashboard.widgets[n].whatsappAccountsSelected=_.map(o.whatsappAccounts.rows,"id"),o.customDashboard.widgets[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+o.customDashboard.widgets[n].type+"/ms-widget-engine."+o.customDashboard.widgets[n].type+".html")})},o.deleteWidget=function(n){var e=t.confirm().title("Would you like to delete "+n.title+"?").textContent("").ariaLabel("Delete Widget").ok("YES").cancel("NO");t.show(e).then(function(){return s.dashboardItem.delete({id:n.id}).$promise.then(function(e){_.remove(o.customDashboard.widgets,{id:n.id}),i.success({title:"Widget deleted!",msg:n.name?n.name+" has been deleted!":"Widget has been deleted!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","socket","toasty","api"],angular.module("app.tools").controller("CustomDashboardItemsController",e)}(),function(){"use strict";function e(n,e,t,a,o,i,s,r,l,d,c,m,u,p){var g=this;g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_DASHBOARDITEM",g.dashboarditem=angular.copy(l),g.dashboard=r,g.newDashboardItem=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.dashboarditem?"web-report"==g.dashboarditem.type&&(g.apiName="custom"===g.dashboarditem.reportType?"analyticCustomReport":"analyticDefaultReport",d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:g.dashboarditem.attrReport}),g.dashboarditem.report=g.currentReport.name,g.query.parent=g.currentReport.parent})):(g.dashboarditem={type:"counter",attrChannel:"voice",titleFontSize:12,attrUrl:"https://",attrHourFormat:"HH:mm:ss",attrTimezone:"0.00",attrMetric:"total",attrSerie1:"total",attrSerie2:"null",attrSerie3:"null",attrRefresh:10,attrFontSize:20,foreground:"#2196f3",background:"#ffffff"},g.title="TOOLS.NEW_DASHBOARDITEM",g.newDashboardItem=!0),g.addNewDashboardItem=function(){g.errors=[],d.dashboard.addItem({id:e.params.id},g.dashboarditem).$promise.then(function(e){g.dashboard.unshift(e.toJSON()),s.success({title:"DashboardItem properly created",msg:g.dashboarditem.name?g.dashboarditem.name+" has been created!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.save"}];for(var n=0;n<e.data.errors.length;n+=1)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDashboardItem=function(){g.errors=[],d.dashboardItem.update({id:g.dashboarditem.id},g.dashboarditem).$promise.then(function(e){var n=_.find(g.dashboard,{id:e.id});n&&_.merge(n,e.toJSON()),s.success({title:"DashboardItem properly saved!",msg:g.dashboarditem.name?g.dashboarditem.name+" has been saved!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDashboardItem=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The dashboarditem will be deleted.").ariaLabel("Delete DashboardItem").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.dashboardItem.delete({id:g.dashboarditem.id}).$promise.then(function(){_.remove(g.dashboard,{id:g.dashboarditem.id}),s.success({title:"DashboardItem properly deleted!",msg:(g.dashboarditem.name||"dashboarditem")+" has been deleted!"}),I(g.dashboarditem)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.delete"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.getReports=S,g.selectReport=function(){if(g.dashboarditem.report=g.selectedReport[0].name,g.dashboarditem.attrReport=g.selectedReport[0].id,g.dashboarditem.reportType=g.currentNode.custom?"custom":"default",!g.newDashboardItem){var e={name:"attrReport",type:g.dashboarditem.reportType,value:g.selectedReport[0].id};g.dashboarditem.attrs.splice(_.findIndex(g.dashboarditem.attrs,1,e))}n.dashboarditemForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.onTypeChange=function(){["web-report","iframe","clock","custom"].includes(g.dashboarditem.type)&&(g.dashboarditem.attrEmailAccounts=null,g.dashboarditem.attrFaxAccounts=null,g.dashboarditem.attrSmsAccounts=null,g.dashboarditem.attrOpenchannelAccounts=null,g.dashboarditem.attrWhatsappAccounts=null,g.dashboarditem.attrChatWebsites=null)},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(n={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,n}).catch(function(e){s.error({title:"ERROR",msg:e.message})}):n),g.treeDefaultEvents=f(!1),g.treeCustomEvents=f(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var n},g.closeDialog=I,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],h=null;function f(e){return e?{loaded:E,select_node:b}:{loaded:y,select_node:A}}function b(e,n){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=n.node.id,S()}function A(e,n){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=n.node.id,S()}function E(){if(!g.newDashboardItem&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(!g.newDashboardItem&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);A(0,{node:e,selected:e.id})}}function S(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,T).$promise;else{if(!g.userProfileSection)return T(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,T).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),T({count:t.length,rows:t})}return T(null)}):T(null)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function T(e){g.reports=e||{count:0,rows:[]},g.newDashboardItem||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function I(e){a.hide(e)}c.hasRole("admin")?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){g.voiceQueues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){h=e.rows||[]}).then(function(){for(var e=[],n=0;n<v.length;n++)e.push(d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:v[n].id}).$promise);return o.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<v.length;a++){var i=_.find(n,["sectionId",v[a].id]);if(i)if(i.autoAssociation){var s=[];h.forEach(function(e){e.type===v[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(t)}).then(function(e){var n=[],t=null;g.dashboarditem&&(t=_.find(h,{id:Number(g.dashboarditem.attrVoiceQueues)}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){n.push(e)})}t&&!_.some(n,["resourceId",t.id])&&h.forEach(function(e){e.id===t.id&&(e.canSelect=!1,n.push(e))}),g.voiceQueues=n}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.mailAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.mailAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:MailAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.mailAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.mailAccount,{id:Number(g.dashboarditem.attrEmailAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.mailAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.mailAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.mailAccount,{id:Number(g.dashboarditem.attrEmailAccounts)}));for(var i=0;i<g.mailAccount.length;i++)a&&g.mailAccount[i].id===a.id&&(g.mailAccount[i].canSelect=!1,t.push(g.mailAccount[i]));g.mailAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.faxAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.faxAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.faxAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.faxAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:FaxAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.faxAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.faxAccount,{id:Number(g.dashboarditem.attrFaxAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.faxAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.faxAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.faxAccount,{id:Number(g.dashboarditem.attrFaxAccounts)}));for(var i=0;i<g.faxAccount.length;i++)a&&g.faxAccount[i].id===a.id&&(g.faxAccount[i].canSelect=!1,t.push(g.faxAccount[i]));g.faxAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.smsAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.smsAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.smsAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.smsAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:SmsAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.smsAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.smsAccount,{id:Number(g.dashboarditem.attrSmsAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.smsAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.smsAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.smsAccount,{id:Number(g.dashboarditem.attrSmsAccounts)}));for(var i=0;i<g.smsAccount.length;i++)a&&g.smsAccount[i].id===a.id&&(g.smsAccount[i].canSelect=!1,t.push(g.smsAccount[i]));g.smsAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.openchannelAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.openchannelAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.openchannelAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.openchannelAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:OpenchannelAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.openchannelAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.openchannelAccount,{id:Number(g.dashboarditem.attrOpenchannelAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.openchannelAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.openchannelAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.openchannelAccount,{id:Number(g.dashboarditem.attrOpenchannelAccounts)}));for(var i=0;i<g.openchannelAccount.length;i++)a&&g.openchannelAccount[i].id===a.id&&(g.openchannelAccount[i].canSelect=!1,t.push(g.openchannelAccount[i]));g.openchannelAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.whatsappAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.whatsappAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_WHATSAPPACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.whatsappAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.whatsappAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:WhatsappAccounts}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.whatsappAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.whatsappAccount,{id:Number(g.dashboarditem.attrWhatsappAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.whatsappAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.whatsappAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.whatsappAccount,{id:Number(g.dashboarditem.attrWhatsappAccounts)}));for(var i=0;i<g.whatsappAccount.length;i++)a&&g.whatsappAccount[i].id===a.id&&(g.whatsappAccount[i].canSelect=!1,t.push(g.whatsappAccount[i]));g.whatsappAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.chatWebsite.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.chatWebsite=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATWEBSITE",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.chatWebsite.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.chatWebsite=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:ChatWebsites}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.chatWebsite,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.chatWebsite,{id:Number(g.dashboarditem.attrChatWebsites)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.chatWebsite,{id:t.id});a.canSelect=!1,n.push(a)}g.chatWebsite=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.chatWebsite,{id:Number(g.dashboarditem.attrChatWebsites)}));for(var i=0;i<g.chatWebsite.length;i++)a&&g.chatWebsite[i].id===a.id&&(g.chatWebsite[i].canSelect=!1,t.push(g.chatWebsite[i]));g.chatWebsite=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dashboard","dashboarditem","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditDashboardItemDialogController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.customDashboard=c||t.params.customDashboard||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){a.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:u.customDashboards?u.customDashboards.rows:[],crudPermissions:u.crudPermissions}})},u.gotogoto=function(e,n){t.go("app.dashboards.custom",{id:e.id})},u.alert=l.info,u.gotoCustomDashboards=function(){t.go("app.tools.customDashboards",{},{reload:"app.tools.customDashboards"})},u.saveCustomDashboard=function(){r.dashboard.update({id:u.customDashboard.id},u.customDashboard).$promise.then(function(){l.success({title:"CustomDashboard updated!",msg:u.customDashboard.name?u.customDashboard.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdashboard",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","customDashboard","userProfileSection"],angular.module("app.tools").controller("CustomDashboardController",e)}(),function(){"use strict";function e(a,i,o,r,e,l,d,n,t,s,c){var m=this;if(m.currentUser=n.getCurrentUser(),m.disposition=angular.copy(e),m.setting=c,m.license=s,m.crudPermissions=t,m.newDisposition=!1,m.errors=[],m.disposition||(m.disposition={level:"first"},m.newDisposition=!0),l){var u=l.field;m.disposition[u]=l.id}function p(){return o(function(t,n){d.disposition.get({fields:"id,name,level,ParentId",sort:"id",nolimit:"true"}).$promise.then(function(e){var n=e.rows||[];return t(n)}).catch(function(e){n(e)})})}function g(e){"first"===e.level?m.firstLevelDisposition=e:(m.anySecondLevelDisposition=!0,m.secondLevelDisposition=e,m.firstLevelDisposition=_.find(m.dispositions,["id",m.secondLevelDisposition.ParentId]),m.firstLevelDisposition||p().then(function(){m.firstLevelDisposition=_.find(m.allDispositions,["id",m.secondLevelDisposition.ParentId]),m.firstLevelDisposition.canSelect=!1,m.dispositions.push(m.firstLevelDisposition)}))}function v(e){a.hide(e)}m.onInit=function(){var n="disposition";l?n=l.route:"user"===m.currentUser.role&&(n="userProfile");var t="get";l?t="getDispositions":"user"===m.currentUser.role&&(t="getResources");var e={fields:"id,name,level,ParentId",id:l?l.id:void 0,section:"user"===m.currentUser.role?"Dispositions":void 0,MailAccountId:l?void 0:"null",FaxAccountId:l?void 0:"null",SmsAccountId:l?void 0:"null",OpenchannelAccountId:l?void 0:"null",ChatWebsiteId:l?void 0:"null",WhatsappAccountId:l?void 0:"null",ListId:l?void 0:"null",sort:"id",nolimit:"true"};(a=n,i=t,s=e,o(function(t,n){d[a][i](s).$promise.then(function(e){var n=e.rows||[];return t(n)}).catch(function(e){n(e)})})).then(function(e){m.dispositions=angular.copy(e),m.newDisposition||function(){if("first"===m.disposition.level)return;if(m.parentDisposition=_.find(m.dispositions,["id",m.disposition.ParentId]),!m.parentDisposition)return p().then(function(e){m.allDispositions=e;for(var n=0;n<m.allDispositions.length;n++){var t=m.allDispositions[n];if(t.id===m.disposition.ParentId){g(t),t.canSelect=!1,m.dispositions.push(t);break}}});g(m.parentDisposition)}()}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:["api",n,t].join(":"),msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});var a,i,s},m.onFirstLevelSelection=function(){m.secondLevelDisposition=void 0,m.anySecondLevelDisposition=_.some(m.dispositions,function(e){return e.ParentId===m.firstLevelDisposition.id&&e.id!=m.disposition.id})},m.addNewDisposition=function(){m.errors=[],m.secondLevelDisposition?(m.disposition.ParentId=m.secondLevelDisposition.id,m.disposition.level="third"):m.firstLevelDisposition&&(m.disposition.ParentId=m.firstLevelDisposition.id,m.disposition.level="second");d.disposition.save(m.disposition).$promise.then(function(e){m.dispositions.unshift(e.toJSON()),r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_CREATED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var n=0;n<e.data.errors.length;n+=1)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDisposition=function(){m.errors=[],m.secondLevelDisposition?(m.disposition.ParentId=m.secondLevelDisposition.id,m.disposition.level="third"):m.firstLevelDisposition&&(m.disposition.ParentId=m.firstLevelDisposition.id,m.disposition.level="second");d.disposition.update({id:m.disposition.id},m.disposition).$promise.then(function(e){var n=_.find(m.dispositions,{id:e.id});n&&_.merge(n,e.toJSON()),r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_SAVED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var n=0;n<e.data.errors.length;n++)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDisposition=function(e){m.errors=[];var n=_.some(m.dispositions,["ParentId",m.disposition.id]),t=a.confirm({skipHide:!0}).title(i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(i.instant("TOOLS.NOTIFICATIONS."+(n?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:m.disposition.name})).ariaLabel("Delete disposition").ok(i.instant("TOOLS.DELETE")).cancel(i.instant("TOOLS.CANCEL")).targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:m.disposition.id}).$promise.then(function(){r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var n=0;n<e.data.errors.length;n++)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.clearSelection=function(e){"first"===e?(m.firstLevelDisposition=void 0,m.secondLevelDisposition=void 0,m.anySecondLevelDisposition=!1):m.secondLevelDisposition=void 0},m.closeDialog=v}e.$inject=["$mdDialog","$translate","$q","toasty","disposition","model","api","Auth","crudPermissions","license","setting"],angular.module("app.tools").controller("CreateOrEditDispositionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this;function f(e){h.dispositions=e||{count:0,rows:[]}}function b(){h.query.offset=(h.query.page-1)*h.query.limit,p.isAdmin()?h.promise=m.disposition.get(h.query,f).$promise:(h.query.id=h.userProfile.id,h.query.section="Dispositions",h.promise=m.userProfile.getResources(h.query,f).$promise)}function A(e){m.disposition.delete({id:e.id}).$promise.then(function(){b(),u.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){h.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)u.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else u.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}h.license=g,h.setting=v,h.currentUser=p.getCurrentUser(),h.dispositions=l||{count:0,rows:[]},h.userProfile=d,h.userProfileSection=c&&1==c.count?c.rows[0]:null,h.crudPermissions=p.parseCrudPermissions(h.userProfileSection?h.userProfileSection.crudPermissions:null),h.selectedDispositions=[],h.levels={first:"1st",second:"2nd",third:"3rd"},h.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,page:1},h.deleteconfirm=function(e,n){var t=_.some(h.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){A(e)})},h.success=f,h.getDispositions=b,h.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:null,license:h.license,setting:h.setting,crudPermissions:h.crudPermissions}}).then(function(e){!0===e&&b()})},h.deleteDisposition=A,h.exportSelectedDispositions=function(){var e=angular.copy(h.selectedDispositions);return h.selectedDispositions=[],e},h.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:h.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){h.selectedDispositions.forEach(function(e){A(e)}),h.selectedDispositions=[]})},h.deselectDispositions=function(){h.selectedDispositions=[]},h.selectAllDispositions=function(){h.selectedDispositions=h.dispositions.rows};var E=!0,y=1;e.$watch("vm.query.filter",function(e,n){E?o(function(){E=!1}):(n||(y=h.query.page),e!==n&&(h.query.page=1),e||(h.query.page=y),b())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dispositions","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.tools").controller("DispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var n=_.find(g.intervals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditAppintervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.intervalIntervals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.interval.getIntervals(m.query,u).$promise}function g(e){d.interval.delete({id:e.id}).$promise.then(function(){_.remove(m.intervalIntervals.rows,{id:e.id}),m.intervalIntervals.count-=1,m.intervalIntervals.rows.length||p(),l.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETinterval"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.interval={},m.intervalIntervals={count:0,rows:[]},m.selectedIntervalIntervals=[],m.crudPermissions,m.sortableTable={animation:100,onSort:function(e){d.interval.addIntervals({id:m.interval.id},e.models).$promise.then(function(e){m.intervalIntervals.rows=e}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SORTABLETABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})}},m.query={fields:"createdAt,updatedAt,id,name,interval",nolimit:"true",limit:10,page:1},m.init=function(e,n){m.interval=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.sortableTable.disabled=!m.crudPermissions.canEdit,m.query.id=m.interval.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interval #")+e.id||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIntervalIntervals=p,m.createOrEditIntervalInterval=function(e,n){o.show({controller:"EditAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:m.interval,interval:n,intervals:m.intervalIntervals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIntervalIntervals=function(){var e=angular.copy(m.selectedIntervalIntervals);return m.selectedIntervalIntervals=[],e},m.deleteIntervalInterval=g,m.deleteSelectedIntervalIntervals=function(e){var n=o.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+m.selectedIntervalIntervals.length+" selected</b> will be deleted.").ariaLabel("delete intervals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIntervalIntervals.forEach(function(e){g(e)}),m.selectedIntervalIntervals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("IntervalIntervalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var n=_.find(g.intervals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.interval=c||e.params.interval||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoIntervals=function(){e.go("app.tools.intervals",{},{reload:"app.tools.intervals"})},u.saveInterval=function(){r.interval.update({id:u.interval.id},u.interval).$promise.then(function(){l.success({title:"Interval updated!",msg:u.interval.name?u.interval.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","interval","userProfileSection"],angular.module("app.tools").controller("IntervalController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.intervals=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="intervals",f.listOrder="",f.listOrderAsc=null,f.selectedIntervals=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,page:1},f.editstate=function(e,n){t.go("app.tools.intervals.edit",{id:e.id,interval:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("interval")+"?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getIntervals=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.interval.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Intervals",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditInterval=function(e,n){i.show({controller:"CreateOrEditIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:n,intervals:f.intervals.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteInterval=y,f.exportSelectedIntervals=function(){var e=angular.copy(f.selectedIntervals);return f.selectedIntervals=[],e},f.deleteSelectedIntervals=function(e){var n=i.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+f.selectedIntervals.length+" selected</b> will be deleted.").ariaLabel("delete Intervals").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedIntervals.forEach(function(e){y(e)}),f.selectedIntervals=[]})},f.deselectIntervals=function(){f.selectedIntervals=[]},f.selectAllIntervals=function(){f.selectedIntervals=f.intervals.rows};var b=!0,A=1;function E(e){f.intervals=e||{count:0,rows:[]}}function y(e){m.interval.delete({id:e.id}).$promise.then(function(){_.remove(f.intervals.rows,{id:e.id}),f.intervals.count-=1,f.intervals.rows.length||f.getIntervals(),p.success({title:_.startCase("Interval")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEinterval"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getIntervals())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","intervals","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("IntervalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_PAUSE",g.pause=angular.copy(l),g.pauses=r,g.newPause=!1,g.pause||(g.pause={},g.title="TOOLS.NEW_PAUSE",g.newPause=!0),g.addNewPause=function(){g.errors=[],d.pause.save(g.pause).$promise.then(function(e){g.pauses.unshift(e.toJSON()),o.success({title:"Pause properly created",msg:g.pause.name?g.pause.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePause=function(){g.errors=[],d.pause.update({id:g.pause.id},g.pause).$promise.then(function(e){var n=_.find(g.pauses,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Pause properly saved!",msg:g.pause.name?g.pause.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePause=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The pause will be deleted.").ariaLabel("Delete Pause").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.pause.delete({id:g.pause.id}).$promise.then(function(){_.remove(g.pauses,{id:g.pause.id}),o.success({title:"Pause properly deleted!",msg:(g.pause.name||"pause")+" has been deleted!"}),v(g.pause)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","pauses","pause","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditPauseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.pauses=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="pauses",f.listOrder="",f.listOrderAsc=null,f.selectedPauses=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{pause:e,pauses:f.pauses.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("pause")+"?").htmlContent("<b>"+(e.name||"pause")+"</b> will be deleted.").ariaLabel("delete pause").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getPauses=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.pause.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Pauses",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditPause=function(e,n){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{pause:n,pauses:f.pauses.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletePause=y,f.exportSelectedPauses=function(){var e=angular.copy(f.selectedPauses);return f.selectedPauses=[],e},f.deleteSelectedPauses=function(e){var n=i.confirm().title("Are you sure want to delete the selected pauses?").htmlContent("<b>"+f.selectedPauses.length+" selected</b> will be deleted.").ariaLabel("delete Pauses").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedPauses.forEach(function(e){y(e)}),f.selectedPauses=[]})},f.deselectPauses=function(){f.selectedPauses=[]},f.selectAllPauses=function(){f.selectedPauses=f.pauses.rows};var b=!0,A=1;function E(e){f.pauses=e||{count:0,rows:[]}}function y(e){m.pause.delete({id:e.id}).$promise.then(function(){_.remove(f.pauses.rows,{id:e.id}),f.pauses.count-=1,f.pauses.rows.length||f.getPauses(),p.success({title:_.startCase("Pause")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEpause"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEpause",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getPauses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","pauses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("PausesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;if(g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SCHEDULE",g.schedule=angular.copy(l),g.schedules=r,g.newSchedule=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.schedule){g.apiName=g.schedule.DefaultReportId?"analyticDefaultReport":"analyticCustomReport";var v=g.schedule.DefaultReportId?g.schedule.DefaultReportId:g.schedule.CustomReportId;d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:v}),g.schedule.report=g.currentReport.name,g.query.parent=g.currentReport.parent})}else g.schedule={output:"xlsx",active:!0,startAt:new Date,endAt:new Date(Date.now()+2592e6),cron:"0 0 * * *",subtractNumber:1,subtractUnit:"days",sendMail:!1,sendIfEmpty:!0},g.title="TOOLS.NEW_SCHEDULE",g.newSchedule=!0;function h(e){return e?{loaded:A,select_node:f}:{loaded:E,select_node:b}}function f(e,n){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=n.node.id,y()}function b(e,n){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=n.node.id,y()}function A(){if(!g.newSchedule&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);f(0,{node:e,selected:e.id})}}function E(){if(!g.newSchedule&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,S).$promise;else{if(!g.userProfileSection)return S(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,S).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),S({count:t.length,rows:t})}return S(null)}):S(null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function S(e){g.reports=e||{count:0,rows:[]},g.newSchedule||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function T(e){a.hide(e)}g.addNewSchedule=function(){g.errors=[],d.schedule.save(g.schedule).$promise.then(function(e){g.schedules.unshift(e.toJSON()),o.success({title:"Schedule properly created",msg:g.schedule.name?g.schedule.name+" has been created!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSchedule=function(){g.errors=[],d.schedule.update({id:g.schedule.id},g.schedule).$promise.then(function(e){var n=_.find(g.schedules,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Schedule properly saved!",msg:g.schedule.name?g.schedule.name+" has been saved!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSchedule=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The schedule will be deleted.").ariaLabel("Delete Schedule").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.schedule.delete({id:g.schedule.id}).$promise.then(function(){_.remove(g.schedules,{id:g.schedule.id}),o.success({title:"Schedule properly deleted!",msg:(g.schedule.name||"schedule")+" has been deleted!"}),T(g.schedule)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.getReports=y,g.selectReport=function(){g.schedule.report=g.selectedReport[0].name,g.currentNode.custom?(g.schedule.CustomReportId=g.selectedReport[0].id,delete g.schedule.DefaultReportId):(g.schedule.DefaultReportId=g.selectedReport[0].id,delete g.schedule.CustomReportId);e.scheduleForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(n={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,n}).catch(function(e){o.error({title:"ERROR",msg:e.message})}):n),g.treeDefaultEvents=h(!1),g.treeCustomEvents=h(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var n},g.closeDialog=T,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.mailAccounts,{id:e.resourceId})}),t=null;if(g.schedule&&(t=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.mailAccounts,{id:t.id});a.canSelect=!1,n.push(a)}g.mailAccounts=n})}else{var t=[],a=null;g.schedule&&(a=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)}));for(var i=0;i<g.mailAccounts.length;i++)a&&g.mailAccounts[i].id===a.id&&(g.mailAccounts[i].canSelect=!1,t.push(g.mailAccounts[i]));g.mailAccounts=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","schedules","schedule","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditScheduleDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.schedules=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="schedules",f.listOrder="",f.listOrderAsc=null,f.selectedScheduler=[],f.query={fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,page:1},f.arrayoutput=_.keyBy([{option:"CSV",value:"'csv'"},{option:"PDF",value:"'pdf'"},{option:"Excel",value:"'xlsx'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysubtractUnit=_.keyBy([{option:"Minutes",value:"'minutes'"},{option:"Hours",value:"'hours'"},{option:"Days",value:"'days'"},{option:"Weeks",value:"'weeks'"},{option:"Months",value:"'months'"},{option:"Quarters",value:"'quarters'"},{option:"Years",value:"'years'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{schedule:e,schedules:f.schedules.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.runconfirm=function(e,n){var t=i.confirm().title("Are you sure want to run the schedule?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be run.").ariaLabel("delete schedule").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){return m.schedule.run({id:e.id}).$promise},function(){console.log("CANCEL")})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("schedule")+"?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be deleted.").ariaLabel("delete schedule").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getScheduler=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.schedule.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Scheduler",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSchedule=function(e,n){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{schedule:n,schedules:f.schedules.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSchedule=y,f.exportSelectedScheduler=function(){var e=angular.copy(f.selectedScheduler);return f.selectedScheduler=[],e},f.deleteSelectedScheduler=function(e){var n=i.confirm().title("Are you sure want to delete the selected schedules?").htmlContent("<b>"+f.selectedScheduler.length+" selected</b> will be deleted.").ariaLabel("delete Schedules").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedScheduler.forEach(function(e){y(e)}),f.selectedScheduler=[]})},f.deselectScheduler=function(){f.selectedScheduler=[]},f.selectAllScheduler=function(){f.selectedScheduler=f.schedules.rows},m.analyticTreeReport.get({}).$promise.then(function(e){f.treeReports=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.mailAccounts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.mailAccounts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.mailAccounts,{id:e.resourceId})}),t=null;if(f.schedule&&(t=_.find(f.mailAccounts,{id:Number(f.schedule.MailAccountId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.mailAccounts,{id:t.id});a.canSelect=!1,n.push(a)}f.mailAccounts=n})}else{var t=[],a=null;f.schedule&&(a=_.find(f.mailAccounts,{id:Number(f.schedule.MailAccountId)}));for(var i=0;i<f.mailAccounts.length;i++)a&&f.mailAccounts[i].id===a.id&&(f.mailAccounts[i].canSelect=!1,t.push(f.mailAccounts[i]));f.mailAccounts=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.schedules=e||{count:0,rows:[]}}function y(e){m.schedule.delete({id:e.id}).$promise.then(function(){_.remove(f.schedules.rows,{id:e.id}),f.schedules.count-=1,f.schedules.rows.length||f.getScheduler(),p.success({title:_.startCase("Schedule")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEschedule"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEschedule",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getScheduler())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","schedules","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("SchedulesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SOUND",g.sound=angular.copy(l),g.sounds=r,g.newSound=!1,g.sound||(g.sound={},g.title="TOOLS.NEW_SOUND",g.newSound=!0),g.addNewSound=function(){g.errors=[],d.sound.save(g.sound).$promise.then(function(e){g.sounds.unshift(e.toJSON()),o.success({title:"Sound properly created",msg:g.sound.name?g.sound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSound=function(){g.errors=[],d.sound.update({id:g.sound.id},g.sound).$promise.then(function(e){var n=_.find(g.sounds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Sound properly saved!",msg:g.sound.name?g.sound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSound=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sound will be deleted.").ariaLabel("Delete Sound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.sound.delete({id:g.sound.id}).$promise.then(function(){_.remove(g.sounds,{id:g.sound.id}),o.success({title:"Sound properly deleted!",msg:(g.sound.name||"sound")+" has been deleted!"}),v(g.sound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sounds","sound","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.sounds=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="sounds",f.listOrder="",f.listOrderAsc=null,f.selectedSounds=[],f.query={fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{sound:e,sounds:f.sounds.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.downloadfile2=function(s,e){return m.sound.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("sound")+"?").htmlContent("<b>"+(e.name||"sound")+"</b> will be deleted.").ariaLabel("delete sound").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSounds=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.sound.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Sounds",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSound=function(e,n){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sound:n,sounds:f.sounds.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSound=y,f.exportSelectedSounds=function(){var e=angular.copy(f.selectedSounds);return f.selectedSounds=[],e},f.deleteSelectedSounds=function(e){var n=i.confirm().title("Are you sure want to delete the selected sounds?").htmlContent("<b>"+f.selectedSounds.length+" selected</b> will be deleted.").ariaLabel("delete Sounds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSounds.forEach(function(e){y(e)}),f.selectedSounds=[]})},f.deselectSounds=function(){f.selectedSounds=[]},f.selectAllSounds=function(){f.selectedSounds=f.sounds.rows},f.uploadSound=function(e){i.show({controller:"UploadSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sounds:f.sounds.rows}})};var b=!0,A=1;function E(e){f.sounds=e||{count:0,rows:[]}}function y(e){m.sound.delete({id:e.id}).$promise.then(function(){_.remove(f.sounds.rows,{id:e.id}),f.sounds.count-=1,f.sounds.rows.length||f.getSounds(),p.success({title:_.startCase("Sound")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsound"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsound",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSounds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sounds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("SoundsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this,r=15,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="TOOLS.UPLOAD_SOUND",o.sounds=a,o.uploadSounds=[],o.uploadState="none",o.sound={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/sounds"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var n=["wav","mp3","gsm"];if(!_.includes(n,e.getExtension()))return t.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>l)return t.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.sound={id:e.uniqueIdentifier,file:e},o.uploadSounds.unshift(o.sound),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.sounds.unshift(JSON.parse(e)),angular.forEach(o.uploadSounds,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result}}})},o.uploadError=function(e,n){o.ngFlow.flow.cancel(),t.error({title:"Upload error",msg:"Cannot upload the sound"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",t.success({title:"Upload completed",msg:o.sound.file.name+" uploaded successfully"}))},o.closeDialog=function(){n.hide()}}e.$inject=["$cookies","$mdDialog","toasty","sounds","api","Auth"],angular.module("app.tools").controller("UploadSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TAG",g.tag=angular.copy(l),g.tags=r,g.newTag=!1,g.tag||(g.tag={},g.title="TOOLS.NEW_TAG",g.newTag=!0),g.addNewTag=function(){g.errors=[],d.tag.save(g.tag).$promise.then(function(e){g.tags.unshift(e.toJSON()),o.success({title:"Tag properly created",msg:g.tag.name?g.tag.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTag=function(){g.errors=[],d.tag.update({id:g.tag.id},g.tag).$promise.then(function(e){var n=_.find(g.tags,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Tag properly saved!",msg:g.tag.name?g.tag.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTag=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The tag will be deleted.").ariaLabel("Delete Tag").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.tag.delete({id:g.tag.id}).$promise.then(function(){_.remove(g.tags,{id:g.tag.id}),o.success({title:"Tag properly deleted!",msg:(g.tag.name||"tag")+" has been deleted!"}),v(g.tag)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","tags","tag","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTagDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.tags=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="tags",f.listOrder="",f.listOrderAsc=null,f.selectedTags=[],f.query={fields:"createdAt,updatedAt,id,name,description,color",sort:"name,-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{tag:e,tags:f.tags.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("tag")+"?").htmlContent("<b>"+(e.name||"tag")+"</b> will be deleted.").ariaLabel("delete tag").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTags=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.tag.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Tags",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTag=function(e,n){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{tag:n,tags:f.tags.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTag=y,f.exportSelectedTags=function(){var e=angular.copy(f.selectedTags);return f.selectedTags=[],e},f.deleteSelectedTags=function(e){var n=i.confirm().title("Are you sure want to delete the selected tags?").htmlContent("<b>"+f.selectedTags.length+" selected</b> will be deleted.").ariaLabel("delete Tags").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTags.forEach(function(e){y(e)}),f.selectedTags=[]})},f.deselectTags=function(){f.selectedTags=[]},f.selectAllTags=function(){f.selectedTags=f.tags.rows};var b=!0,A=1;function E(e){f.tags=e||{count:0,rows:[]}}function y(e){m.tag.delete({id:e.id}).$promise.then(function(){_.remove(f.tags.rows,{id:e.id}),f.tags.count-=1,f.tags.rows.length||f.getTags(),p.success({title:_.startCase("Tag")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtag"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtag",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTags())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","tags","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TagsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TEMPLATE",g.template=angular.copy(l),g.templates=r,g.newTemplate=!1,g.template||(g.template={},g.title="TOOLS.NEW_TEMPLATE",g.newTemplate=!0),g.addNewTemplate=function(){g.errors=[],d.template.save(g.template).$promise.then(function(e){g.templates.unshift(e.toJSON()),o.success({title:"Template properly created",msg:g.template.name?g.template.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTemplate=function(){g.errors=[],d.template.update({id:g.template.id},g.template).$promise.then(function(e){var n=_.find(g.templates,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Template properly saved!",msg:g.template.name?g.template.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTemplate=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The template will be deleted.").ariaLabel("Delete Template").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.template.delete({id:g.template.id}).$promise.then(function(){_.remove(g.templates,{id:g.template.id}),o.success({title:"Template properly deleted!",msg:(g.template.name||"template")+" has been deleted!"}),v(g.template)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","templates","template","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTemplateDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.templates=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="templates",f.listOrder="",f.listOrderAsc=null,f.selectedTemplates=[],f.query={fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{template:e,templates:f.templates.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("template")+"?").htmlContent("<b>"+(e.name||"template")+"</b> will be deleted.").ariaLabel("delete template").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTemplates=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.template.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Templates",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTemplate=function(e,n){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{template:n,templates:f.templates.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTemplate=y,f.exportSelectedTemplates=function(){var e=angular.copy(f.selectedTemplates);return f.selectedTemplates=[],e},f.deleteSelectedTemplates=function(e){var n=i.confirm().title("Are you sure want to delete the selected templates?").htmlContent("<b>"+f.selectedTemplates.length+" selected</b> will be deleted.").ariaLabel("delete Templates").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTemplates.forEach(function(e){y(e)}),f.selectedTemplates=[]})},f.deselectTemplates=function(){f.selectedTemplates=[]},f.selectAllTemplates=function(){f.selectedTemplates=f.templates.rows};var b=!0,A=1;function E(e){f.templates=e||{count:0,rows:[]}}function y(e){m.template.delete({id:e.id}).$promise.then(function(){_.remove(f.templates.rows,{id:e.id}),f.templates.count-=1,f.templates.rows.length||f.getTemplates(),p.success({title:_.startCase("Template")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtemplate"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtemplate",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTemplates())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","templates","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TemplatesController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r,l,d){var c=this;function m(e){t.hide(e)}c.currentUser=o.getCurrentUser(),c.trigger=angular.copy(n),c.triggers=angular.copy(e),c.setting=l,c.license=r,c.crudPermissions=d,c.newTrigger=!1,c.errors=[],c.trigger||(c.trigger={channel:"voice"},c.newTrigger=!0),c.addNewTrigger=function(){c.errors=[],s.trigger.save(c.trigger).$promise.then(function(e){c.triggers.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_CREATED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveTrigger=function(){c.errors=[],s.trigger.update({id:c.trigger.id},c.trigger).$promise.then(function(){c.triggers=_.map(c.triggers,function(e){return e.id===c.trigger.id?c.trigger:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_SAVED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteTrigger=function(e){c.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_MESSAGE",{name:c.trigger.name})).ariaLabel("Delete trigger").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){s.trigger.delete({id:c.trigger.id}).$promise.then(function(){c.triggers=_.filter(c.triggers,function(e){return e.id!==c.trigger.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$translate","toasty","triggers","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTriggerDialogController",e)}(),function(){"use strict";function e(e,a,n,i,t,s,o,r){var l=this;function d(){_.some(l.triggerActions.rows,["action","contactManager"])&&(l.lists||(r.isAdmin()?o.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.lists=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.lists=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.lists,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var n=_.find(l.lists,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.lists,{id:e.id});n.canSelect=!1,t.push(n)}}),l.lists=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var n=_.find(l.lists,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<l.lists.length;i++)_.some(a,{id:l.lists[i].id})&&(l.lists[i].canSelect=!1,t.push(l.lists[i]));l.lists=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(l.triggerActions.rows,["action","integration"])&&_(l.triggerActions.rows).map(function(e){return"integration"===e.action?e.data1:void 0}).compact().uniq().value().forEach(function(e){var n=e+"Accounts";if(!l[n]){var t="int"+_.startCase(e)+"Account";o[t.replace(/\s+/g,"")].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l[n]=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+n.toUpperCase()+"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}),_.some(l.triggerActions.rows,function(e){return _.includes(["motionbar","browser"],e.action)})&&(l.templates||(r.isAdmin()?o.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l.templates=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l.templates=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.templates,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(l.templates,{id:Number(e.data2)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.templates,{id:e.id});n.canSelect=!1,t.push(n)}}),l.templates=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(l.templates,{id:Number(e.data2)});a.push(n)}});for(var i=0;i<l.templates.length;i++)_.some(a,{id:l.templates[i].id})&&(l.templates[i].canSelect=!1,t.push(l.templates[i]));l.templates=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(l.triggerActions.rows,["action","jscripty"])&&(l.projects||(r.isAdmin()?o.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.projects=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.projects=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.projects,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var n=_.find(l.projects,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),l.projects=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var n=_.find(l.projects,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<l.projects.length;i++)_.some(a,{id:l.projects[i].id})&&(l.projects[i].canSelect=!1,t.push(l.projects[i]));l.projects=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})))}function c(e){l.triggerActions=e||{count:0,rows:[]},d()}function m(){l.query.offset=(l.query.page-1)*l.query.limit,l.promise=o.trigger.getActions(l.query,c).$promise}function u(e,n){o.action.delete({id:e.id}).$promise.then(function(){m(),n&&s.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}l.currentUser=r.getCurrentUser(),l.trigger={},l.triggerActions={count:0,rows:[]},l.selectedTriggerActions=[],l.query={fields:"id,action,contact,data1,data2,data3,data4,data5,data6,data7,createdAt,updatedAt",limit:10,page:1},l.integrationTypes={zendesk:"Zendesk",salesforce:"Salesforce",sugarcrm:"SugarCRM",freshdesk:"Freshdesk",desk:"Desk",zoho:"Zoho",vtiger:"vTiger",dynamics365:"Dynamics365",servicenow:"ServiceNow",freshsales:"Freshsales"},l.motionBarOptions={0:"Popup",1:"CTI URL",2:"Windows App"},l.onInit=function(e,n){l.trigger=e,l.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},l.query.ActionId=l.trigger.id,l.query.id=l.trigger.id,m()},l.success=c,l.getTriggerActions=m,l.createOrEditTriggerAction=function(e,n){i.show({controller:"CreateOrEditActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/actions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:l.trigger,action:n,actions:l.triggerActions.rows,license:null,setting:null,crudPermissions:l.crudPermissions}}).then(function(e){e&&(l.triggerActions={count:e.length,rows:e},d())})},l.exportSelectedTriggerActions=function(){var e=angular.copy(l.selectedTriggerActions);return l.selectedTriggerActions=[],e},l.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETE_TITLE")).ariaLabel("Delete action").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){u(e,!0)})},l.deleteSelectedTriggerActions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETE_MESSAGE",{total:l.selectedTriggerActions.length})).ariaLabel("Delete actions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){l.selectedTriggerActions.forEach(function(e){u(e)}),l.selectedTriggerActions=[],s.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerActionsController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r,l,d,c,m){var u=this;function p(){return new Promise(function(n,t){l.hasSectionsPermissions([1301,1302,1303,1304,1305,1306,1307,1308,1309,1310]).then(function(e){u.hasSectionPermissions=_.merge(u.hasSectionPermissions,e),n(u.hasSectionPermissions)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SECTIONS_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()}),t()})})}function g(){r.cmList.getCustomFields({id:u.action.data1,ListId:u.action.data1}).$promise.then(function(e){u.listFields=_.filter(e.rows,["type","text"]),u.listFields.forEach(function(e){e.columnName="cf_"+e.id})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LIST_CUSTOM_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function v(){l.isAdmin()?r.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.templates,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(u.templates,{id:Number(e.data2)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.templates,{id:e.id});n.canSelect=!1,t.push(n)}}),u.templates=t})}else{var t=[],a=[];u.actions.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(u.templates,{id:Number(e.data2)});a.push(n)}});for(var i=0;i<u.templates.length;i++){_.some(a,{id:u.templates[i].id})&&(u.templates[i].canSelect=!1,t.push(u.templates[i]))}u.templates=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})})}function h(){switch(u.action.action){case"contactManager":u.lists||(l.isAdmin()?r.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if("contactManager"===e.action){var n=_.find(u.lists,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.lists,{id:e.id});n.canSelect=!1,t.push(n)}}),u.lists=t})}else{var t=[],a=[];u.actions.forEach(function(e){if("contactManager"===e.action){var n=_.find(u.lists,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<u.lists.length;i++)_.some(a,{id:u.lists[i].id})&&(u.lists[i].canSelect=!1,t.push(u.lists[i]));u.lists=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})),u.contactFields||r.cmContact.describe({}).$promise.then(function(e){u.contactFields=[],u.customFields=[];for(var n=_.values(e.toJSON()),t=0;t<n.length;t++)_.includes(u.allowedStandardFields,n[t].columnName)?u.contactFields.push(n[t]):_.startsWith(n[t].columnName,"cf_")&&"text"===n[t].custom.type&&u.customFields.push(n[t])}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE_CM_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})}),u.action.data3=u.action.data3?u.action.data3.split(","):["phone"],"1"!==u.action.data2||u.action.data4||(u.action.data4="phone");break;case"jscripty":u.projects||(l.isAdmin()?r.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if("jscripty"===e.action){var n=_.find(u.projects,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),u.projects=t})}else{var t=[],a=[];u.actions.forEach(function(e){if("jscripty"===e.action){var n=_.find(u.projects,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<u.projects.length;i++)_.some(a,{id:u.projects[i].id})&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"urlForward":u.action.data5||(u.action.data5=5)}}function f(){u.editAccount||(u.action.data2=void 0,u.action.data3=void 0),u.action.isIntegrationDisabled=!u.newAction&&!function(){switch(u.action.data1){case"zendesk":return u.hasSectionPermissions[1301];case"salesforce":return u.hasSectionPermissions[1302];case"sugarcrm":return u.hasSectionPermissions[1305];case"freshdesk":return u.hasSectionPermissions[1303];case"desk":return u.hasSectionPermissions[1306];case"zoho":return u.hasSectionPermissions[1307];case"vtiger":return u.hasSectionPermissions[1308];case"dynamics365":return u.hasSectionPermissions[1309];case"servicenow":return u.hasSectionPermissions[1310];case"freshsales":return u.hasSectionPermissions[1304]}}();var e="int"+_.capitalize(u.action.data1)+"Account";r[e].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.accounts=e.rows||[],u.editAccount=!1}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.action.data1.toUpperCase()+"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function b(){u.action.data3=u.action.data3?u.action.data3:void 0;var e="int"+_.capitalize(u.action.data1)+"Configuration";r[e].get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.configurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.action.data1.toUpperCase()+"CONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function A(){var e=angular.copy(u.action);return _.isArray(e.data3)&&(e.data3=u.action.data3.join(",")),e}function E(e){t.hide(e)}u.currentUser=l.getCurrentUser(),void 0!==s&&"urlForward"===s.action&&s.data5&&(s.data5=parseInt(s.data5)),u.action=angular.copy(s),u.actions=angular.copy(e),u.setting=c,u.license=d,u.crudPermissions=m,u.newAction=!1,u.errors=[],u.trigger=angular.copy(o),u.action?function(){switch(u.editAccount=!0,u.action.action){case"integration":return new Promise(function(e){e(p())}).then(function(){return u.editAccount||(u.action.data2=void 0,u.action.data3=void 0,h()),f()}).then(function(){return b()});case"motionbar":case"browser":v()}u.editAccount=!1}():(u.action={},u.newAction=!0),u.action.ActionId=n.params.id||void 0,u.allowedStandardFields=["phone","mobile","fax"],u.addNewAction=function(){u.errors=[];var e=A();r.trigger.addAction({id:n.params.id},e).$promise.then(function(e){u.actions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_CREATED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAction=function(){u.errors=[];var n=A();r.action.update({id:n.id},n).$promise.then(function(){u.actions=_.map(u.actions,function(e){return e.id===n.id?n:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_SAVED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAction=function(e){u.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETE_TITLE")).ariaLabel("Delete action").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){r.action.delete({id:u.action.id}).$promise.then(function(){u.actions=_.filter(u.actions,function(e){return e.id!==u.action.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.onActionInit=function(){l.hasModulePermissions("Integrations").then(function(e){u.hasIntegrationsPermissions=e}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MODULE_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),u.action.action&&h()},u.onIntegrationInit=p,u.onSearchFieldsInit=function(){u.newAction||g()},u.onActionSelection=function(){u.newAction&&(u.action.data1=void 0,u.action.data2=void 0,u.action.data3=void 0,u.action.data4=void 0,u.action.data5="urlForward"===u.action.action?5:void 0,h())},u.onIntegrationSelection=f,u.onListSelection=function(){g()},u.onTypeSelection=function(){"0"!==u.action.data1||u.templates?(u.action.data2=void 0,u.action.data4="1"===u.action.data1?0:void 0):v()},u.onAutocreateSelection=function(){"0"===u.action.data2&&(u.action.data4=void 0);u.action.data4||"1"!==u.action.data2||(u.action.data4="phone")},u.onIntegrationAccountSelection=b,u.closeDialog=E,u.onActionLocationChange=function(){u.editAccount||(u.action.data5=void 0,u.action.data6=void 0)}}e.$inject=["$state","$mdDialog","$translate","toasty","actions","action","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditActionDialogController",e)}(),function(){"use strict";function e(e,l,a,n,i,t,d,c,m){var u=this;function s(){var o,r;"voice"===u.trigger.channel?(_.some(u.allConditions.rows,["field","queue"])&&(u.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,m.isAdmin()?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(c.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];u.allConditions.rows.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),u.queues=t}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.allConditions.rows,["field","routeId"])&&(u.outboundRoutes||(m.isAdmin()?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.outboundRoutes,{id:e.resourceId})}),a=null;a=[],u.triggerAllConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),u.outboundRoutes=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<u.outboundRoutes.length;i++)_.some(a,{id:u.outboundRoutes[i].id})&&(u.outboundRoutes[i].canSelect=!1,t.push(u.outboundRoutes[i]));u.outboundRoutes=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.allConditions.rows,["field","agent"])&&(u.agents||(m.isAdmin()?c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.agents,{id:e.resourceId})}),a=null;a=[],u.triggerAllConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),u.agents=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}});for(var i=0;i<u.agents.length;i++)_.some(a,{id:u.agents[i].id})&&(u.agents[i].canSelect=!1,t.push(u.agents[i]));u.agents=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))):("mail"===u.trigger.channel&&c.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.mailSubstatuses=e.rows||[]}).catch(function(){d.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})}),function(){var e,s=u.trigger.channel+("chat"===u.trigger.channel?"Websites":"Accounts"),n=u.trigger.channel+("chat"===u.trigger.channel?"Website":"Account");switch(u.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}m.isAdmin()?c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u[s],{id:e.resourceId})}),a=null;a=[],u.allConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u[s],{id:e.id});n.canSelect=!1,t.push(n)}}),u[s]=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}});for(var i=0;i<u[s].length;i++)_.some(a,{id:u[s][i].id})&&(u[s][i].canSelect=!1,t.push(u[s][i]));u[s]=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}())}function o(e){u.allConditions=e||{count:0,rows:[]},s()}function r(){u.query.offset=(u.query.page-1)*u.query.limit,u.promise=c.trigger.getAllConditions(u.query,o).$promise}function p(e,n){c.condition.delete({id:e.id}).$promise.then(function(){r(),n&&d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}u.currentUser=m.getCurrentUser(),u.trigger={},u.allConditions={count:0,rows:[]},u.selectedAllConditions=[],u.query={fields:"id,field,operator,value,createdAt,updatedAt",limit:10,page:1},u.fields={queue:"Queue",lastevent:"Call_Status",routeId:"OutboundRoute",agent:"Agent",account:"Account",interaction:"Interaction",message:"Message",mailSubstatus:"Mail_Substatus",offlineMessage:"Offline_Message"},u.callStatuses={abandoned:"Abandon",timeout:"Timeout",complete:"Hangup",rejected:"Reject",called:"Ring",connect:"Answer",nosuchnumber:"NoSuchNumber",busy:"Busy",noanswer:"NoAnswer",congestion:"Congestion",agentreject:"AgentReject",amd:"AMD"},u.messageStatuses={in:"Incoming",out:"Outgoing",accept:"Accepted",reject:"Rejected"},u.onInit=function(e,n){u.trigger=e,u.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},u.query.TriggerAllId=u.trigger.id,u.query.id=u.trigger.id,r()},u.success=o,u.getAllConditions=r,u.createOrEditAllCondition=function(e,n){i.show({controller:"CreateOrEditAllConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/allconditions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:u.trigger,allCondition:n,allConditions:u.allConditions.rows,license:null,setting:null,crudPermissions:u.crudPermissions}}).then(function(e){e&&(u.allConditions={count:e.length,rows:e},s())})},u.exportSelectedAllConditions=function(){var e=angular.copy(u.selectedAllConditions);return u.selectedAllConditions=[],e},u.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){p(e,!0)})},u.deleteSelectedAllConditions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_MESSAGE",{total:u.selectedAllConditions.length})).ariaLabel("Delete conditions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){u.selectedAllConditions.forEach(function(e){p(e)}),u.selectedAllConditions=[],d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAllConditionsController",e)}(),function(){"use strict";function e(e,t,l,a,i,n,s,o,d,c,r,m,u){var p=this;function g(){switch(p.allCondition.field){case"queue":p.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,c.isAdmin()?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){p.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];p.allConditions.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),p.queues=t}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"routeId":p.outboundRoutes||(c.isAdmin()?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.outboundRoutes,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),p.outboundRoutes=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.outboundRoutes.length;i++)_.some(a,{id:p.outboundRoutes[i].id})&&(p.outboundRoutes[i].canSelect=!1,t.push(p.outboundRoutes[i]));p.outboundRoutes=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"agent":p.agents||(c.isAdmin()?d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.agents,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),p.agents=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}});for(var i=0;i<p.agents.length;i++)_.some(a,{id:p.agents[i].id})&&(p.agents[i].canSelect=!1,t.push(p.agents[i]));p.agents=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"account":!function(){var e,n=p.trigger.channel+("chat"===p.trigger.channel?"Website":"Account");switch(p.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}c.isAdmin()?d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.accounts,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.accounts,{id:e.id});n.canSelect=!1,t.push(n)}}),p.accounts=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.accounts.length;i++)_.some(a,{id:p.accounts[i].id})&&(p.accounts[i].canSelect=!1,t.push(p.accounts[i]));p.accounts=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}();break;case"mailSubstatus":d.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){p.mailSubstatuses=e.rows||[]}).catch(function(){i.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})})}var o,r}function v(e){t.hide(e)}p.currentUser=c.getCurrentUser(),p.allCondition=angular.copy(s),p.allConditions=angular.copy(n),p.setting=m,p.license=r,p.crudPermissions=u,p.hasModulePermissions={},p.newAllCondition=!1,p.errors=[],p.trigger=angular.copy(o),p.allCondition?g():(p.allCondition={operator:"equals"},p.newAllCondition=!0),p.allCondition.TriggerAllId=e.params.id||void 0,p.callStatuses=[{name:"Abandon",value:"abandoned"},{name:"Timeout",value:"timeout"},{name:"Hangup",value:"complete"},{name:"Reject",value:"rejected"},{name:"Ring",value:"called"},{name:"Answer",value:"connect"},{name:"NoSuchNumber",value:"nosuchnumber"},{name:"Busy",value:"busy"},{name:"NoAnswer",value:"noanswer"},{name:"Congestion",value:"congestion"},{name:"AgentReject",value:"agentreject"},{name:"AMD",value:"amd"}],p.onFieldSelection=function(){p.allCondition.value=void 0,g()},p.addNewAllCondition=function(){p.errors=[],d.trigger.addAllCondition({id:e.params.id},p.allCondition).$promise.then(function(e){p.allConditions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_CREATED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveAllCondition=function(){p.errors=[],d.condition.update({id:p.allCondition.id},p.allCondition).$promise.then(function(){p.allConditions=_.map(p.allConditions,function(e){return e.id===p.allCondition.id?p.allCondition:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_SAVED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteAllCondition=function(e){p.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){d.condition.delete({id:p.allCondition.id}).$promise.then(function(){p.allConditions=_.filter(p.allConditions,function(e){return e.id!==p.allCondition.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.closeDialog=v}e.$inject=["$state","$mdDialog","$q","$translate","toasty","allConditions","allCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAllConditionDialogController",e)}(),function(){"use strict";function e(e,l,a,n,i,t,d,c,m){var u=this;function s(){var o,r;"voice"===u.trigger.channel?(_.some(u.anyConditions.rows,["field","queue"])&&(u.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,m.isAdmin()?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(c.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),u.queues=t}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.anyConditions.rows,["field","routeId"])&&(u.outboundRoutes||(m.isAdmin()?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.outboundRoutes,{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),u.outboundRoutes=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<u.outboundRoutes.length;i++)_.some(a,{id:u.outboundRoutes[i].id})&&(u.outboundRoutes[i].canSelect=!1,t.push(u.outboundRoutes[i]));u.outboundRoutes=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.anyConditions.rows,["field","agent"])&&(u.agents||(m.isAdmin()?c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.agents,{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),u.agents=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}});for(var i=0;i<u.agents.length;i++)_.some(a,{id:u.agents[i].id})&&(u.agents[i].canSelect=!1,t.push(u.agents[i]));u.agents=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))):("mail"===u.trigger.channel&&c.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.mailSubstatuses=e.rows||[]}).catch(function(){d.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})}),function(){var e,s=u.trigger.channel+("chat"===u.trigger.channel?"Websites":"Accounts"),n=u.trigger.channel+("chat"===u.trigger.channel?"Website":"Account");switch(u.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}m.isAdmin()?c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u[s],{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u[s],{id:e.id});n.canSelect=!1,t.push(n)}}),u[s]=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}});for(var i=0;i<u[s].length;i++)_.some(a,{id:u[s][i].id})&&(u[s][i].canSelect=!1,t.push(u[s][i]));u[s]=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}())}function o(e){u.anyConditions=e||{count:0,rows:[]},s()}function r(){u.query.offset=(u.query.page-1)*u.query.limit,u.promise=c.trigger.getAnyConditions(u.query,o).$promise}function p(e,n){c.condition.delete({id:e.id}).$promise.then(function(){r(),n&&d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}u.currentUser=m.getCurrentUser(),u.trigger={},u.anyConditions={count:0,rows:[]},u.selectedAnyConditions=[],u.query={fields:"id,field,operator,value,createdAt,updatedAt",limit:10,page:1},u.fields={queue:"Queue",lastevent:"Call_Status",routeId:"OutboundRoute",agent:"Agent",account:"Account",interaction:"Interaction",message:"Message",mailSubstatus:"Mail_Substatus",offlineMessage:"Offline_Message"},u.callStatuses={abandoned:"Abandon",timeout:"Timeout",complete:"Hangup",rejected:"Reject",called:"Ring",connect:"Answer",nosuchnumber:"NoSuchNumber",busy:"Busy",noanswer:"NoAnswer",congestion:"Congestion",agentreject:"AgentReject",amd:"AMD"},u.messageStatuses={in:"Incoming",out:"Outgoing",accept:"Accepted",reject:"Rejected"},u.onInit=function(e,n){u.trigger=e,u.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},u.query.TriggerAnyId=u.trigger.id,u.query.id=u.trigger.id,r()},u.success=o,u.getAnyConditions=r,u.createOrEditAnyCondition=function(e,n){i.show({controller:"CreateOrEditAnyConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/anyconditions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:u.trigger,anyCondition:n,anyConditions:u.anyConditions.rows,license:null,setting:null,crudPermissions:u.crudPermissions}}).then(function(e){e&&(u.anyConditions={count:e.length,rows:e},s())})},u.exportSelectedAnyConditions=function(){var e=angular.copy(u.selectedAnyConditions);return u.selectedAnyConditions=[],e},u.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){p(e,!0)})},u.deleteAnyCondition=p,u.deleteSelectedAnyConditions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_MESSAGE",{total:u.selectedAnyConditions.length})).ariaLabel("Delete conditions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){u.selectedAnyConditions.forEach(function(e){p(e)}),u.selectedAnyConditions=[],d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAnyConditionsController",e)}(),function(){"use strict";function e(e,t,l,a,i,n,s,o,d,c,r,m,u){var p=this;function g(){switch(p.anyCondition.field){case"queue":p.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,c.isAdmin()?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){p.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];p.anyConditions.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),p.queues=t}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"routeId":p.outboundRoutes||(c.isAdmin()?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.outboundRoutes,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),p.outboundRoutes=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.outboundRoutes.length;i++)_.some(a,{id:p.outboundRoutes[i].id})&&(p.outboundRoutes[i].canSelect=!1,t.push(p.outboundRoutes[i]));p.outboundRoutes=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"agent":p.agents||(c.isAdmin()?d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.agents,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),p.agents=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}});for(var i=0;i<p.agents.length;i++)_.some(a,{id:p.agents[i].id})&&(p.agents[i].canSelect=!1,t.push(p.agents[i]));p.agents=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"account":!function(){var e,n=p.trigger.channel+("chat"===p.trigger.channel?"Website":"Account");switch(p.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}c.isAdmin()?d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.accounts,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.accounts,{id:e.id});n.canSelect=!1,t.push(n)}}),p.accounts=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.accounts.length;i++)_.some(a,{id:p.accounts[i].id})&&(p.accounts[i].canSelect=!1,t.push(p.accounts[i]));p.accounts=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}();break;case"mailSubstatus":d.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){p.mailSubstatuses=e.rows||[]}).catch(function(){i.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})})}var o,r}function v(e){t.hide(e)}p.currentUser=c.getCurrentUser(),p.anyCondition=angular.copy(s),p.anyConditions=angular.copy(n),p.setting=m,p.license=r,p.crudPermissions=u,p.hasModulePermissions={},p.newAnyCondition=!1,p.errors=[],p.trigger=angular.copy(o),p.anyCondition?g():(p.anyCondition={operator:"equals"},p.newAnyCondition=!0),p.anyCondition.TriggerAnyId=e.params.id||void 0,p.callStatuses=[{name:"Abandon",value:"abandoned"},{name:"Timeout",value:"timeout"},{name:"Hangup",value:"complete"},{name:"Reject",value:"rejected"},{name:"Ring",value:"called"},{name:"Answer",value:"connect"},{name:"NoSuchNumber",value:"nosuchnumber"},{name:"Busy",value:"busy"},{name:"NoAnswer",value:"noanswer"},{name:"Congestion",value:"congestion"},{name:"AgentReject",value:"agentreject"},{name:"AMD",value:"amd"}],p.onFieldSelection=function(){p.anyCondition.value=void 0,g()},p.addNewAnyCondition=function(){p.errors=[],d.trigger.addAnyCondition({id:e.params.id},p.anyCondition).$promise.then(function(e){p.anyConditions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_CREATED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveAnyCondition=function(){p.errors=[],d.condition.update({id:p.anyCondition.id},p.anyCondition).$promise.then(function(){p.anyConditions=_.map(p.anyConditions,function(e){return e.id===p.anyCondition.id?p.anyCondition:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_SAVED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteAnyCondition=function(e){p.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){d.condition.delete({id:p.anyCondition.id}).$promise.then(function(){p.anyConditions=_.filter(p.anyConditions,function(e){return e.id!==p.allCondition.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.closeDialog=v}e.$inject=["$state","$mdDialog","$q","$translate","toasty","anyConditions","anyCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAnyConditionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;d.currentUser=o.getCurrentUser(),d.license=t,d.setting=a,d.trigger=r||e.params.trigger||{},d.selectedTab=e.params.tab||0,e.params.crudPermissions?d.crudPermissions=e.params.crudPermissions:(d.userProfileSection=l&&1==l.count?l.rows[0]:null,d.crudPermissions=o.parseCrudPermissions(d.userProfileSection?d.userProfileSection.crudPermissions:null)),d.gotoTriggers=function(){e.go("app.tools.triggers",{},{reload:"app.tools.triggers"})},d.saveTrigger=function(){i.trigger.update({id:d.trigger.id},d.trigger).$promise.then(function(){s.success({title:n.instant("TOOLS.NOTIFICATIONS.TRIGGER_SAVED_SUCCESS_TITLE")})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$translate","license","setting","api","toasty","Auth","trigger","userProfileSection"],angular.module("app.tools").controller("TriggerController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){n.go("app.tools.triggers.edit",{id:e.id,trigger:e,crudPermissions:g.crudPermissions})}function h(e){g.triggers=e||{count:0,rows:[]}}function f(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.trigger.get(g.query,h).$promise:(g.query.id=g.userProfile.id,g.query.section="Triggers",g.promise=d.userProfile.getResources(g.query,h).$promise)}function b(e,n){d.trigger.delete({id:e.id}).$promise.then(function(){f(),n&&c.success({title:s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrigger"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.triggers=o||{count:0,rows:[]},g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedTriggers=[],g.query={fields:"id,name,channel,status,description,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},g.goToEditState=v,g.createOrEditTrigger=function(e,n){if(g.crudPermissions.readOnly||g.crudPermissions.canDelete&&!g.crudPermissions.canEdit)return void v(n);a.show({controller:"CreateOrEditTriggerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:n,triggers:g.triggers.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}}).then(function(e){e&&(g.triggers={count:e.length,rows:e})})},g.success=h,g.getTriggers=f,g.deleteconfirm=function(e,n){var t=a.confirm().title(s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_TITLE")).content(s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_MESSAGE",{name:e.name})).ariaLabel("Delete trigger").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){b(e,!0)})},g.exportSelectedTriggers=function(){var e=angular.copy(g.selectedTriggers);return g.selectedTriggers=[],e},g.deleteSelectedTriggers=function(e){var n=a.confirm().title(s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETE_TITLE")).content(s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETE_MESSAGE",{total:g.selectedTriggers.length})).ariaLabel("Delete triggers").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedTriggers.forEach(function(e){b(e)}),g.selectedTriggers=[],c.success({title:s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETED_SUCCESS_TITLE")})})},g.deselectTriggers=function(){g.selectedTriggers=[]},g.selectAllTriggers=function(){g.selectedTriggers=g.triggers.rows};var A=!0,E=1;e.$watch("vm.query.filter",function(e,n){A?i(function(){A=!1}):(n||(E=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=E),f())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","triggers","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.tools").controller("TriggersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TRUNK",g.trunk=angular.copy(l),g.trunks=r,g.newTrunk=!1,g.trunk||(g.trunk={active:!0,type:"friend",dtmfmode:"rfc2833",qualify:"yes",t38pt_udptl:"no"},g.title="TOOLS.NEW_TRUNK",g.newTrunk=!0),g.addNewTrunk=function(){g.errors=[],d.trunk.save(g.trunk).$promise.then(function(e){g.trunks.unshift(e.toJSON()),o.success({title:"Trunk properly created",msg:g.trunk.name?g.trunk.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTrunk=function(){g.errors=[],d.trunk.update({id:g.trunk.id},g.trunk).$promise.then(function(e){var n=_.find(g.trunks,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Trunk properly saved!",msg:g.trunk.name?g.trunk.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTrunk=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The trunk will be deleted.").ariaLabel("Delete Trunk").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.trunk.delete({id:g.trunk.id}).$promise.then(function(){_.remove(g.trunks,{id:g.trunk.id}),o.success({title:"Trunk properly deleted!",msg:(g.trunk.name||"trunk")+" has been deleted!"}),v(g.trunk)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","trunks","trunk","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTrunkDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newTrunk=!0,r.trunk=angular.copy(i),r.trunks=s,r.title=o.instant("TOOLS.CLONE_TRUNK"),i&&i.name&&(r.title+=": "+i.name),r.cloneTrunk=function(){return e.trunk.clone({id:i.id},r.trunk).$promise.then(function(e){r.trunks.unshift(e.toJSON()),a.success({title:"Trunk properly cloned",msg:r.trunk.name?r.trunk.name+" has been cloned!":""}),t.go("app.tools.trunks.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","trunk","trunks","$translate"],angular.module("app.tools").controller("TrunkcloneController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.trunk=c||t.params.trunk||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.trunks",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.trunks",{})}},u.clonedialog=function(e,n){a.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{trunk:e,trunks:u.trunks?u.trunks.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTrunks=function(){t.go("app.tools.trunks",{},{reload:"app.tools.trunks"})},u.saveTrunk=function(){r.trunk.update({id:u.trunk.id},u.trunk).$promise.then(function(){l.success({title:"Trunk updated!",msg:u.trunk.name?u.trunk.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunk",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.trunk&&(t=_.find(u.contexts,{name:u.trunk.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","trunk","userProfileSection"],angular.module("app.tools").controller("TrunkController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.trunks=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="trunks",f.listOrder="",f.listOrderAsc=null,f.selectedTrunks=[],f.query={fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydtmfmode=_.keyBy([{option:"rfc2833",value:"'rfc2833'"},{option:"info",value:"'info'"},{option:"shortinfo",value:"'shortinfo'"},{option:"inband",value:"'inband'"},{option:"auto",value:"'auto'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayqualify=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g723",value:"'g723'"},{option:"g726",value:"'g726'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"ilbc",value:"'ilbc'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayinsecure=_.keyBy([{option:"port",value:"'port'"},{option:"invite",value:"'invite'"},{option:"very",value:"'very'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydirectmedia=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"nonat",value:"'nonat'"},{option:"update",value:"'update'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraycallcounter=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayusereqphone=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytrustrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysendrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"pai",value:"'pai'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.tools.trunks.edit",{id:e.id,trunk:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{trunk:e,trunks:f.trunks?f.trunks.rows:[],crudPermissions:f.crudPermissions}})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.trunks",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.trunks",{})}},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("trunk")+"?").htmlContent("<b>"+(e.name||"trunk")+"</b> will be deleted.").ariaLabel("delete trunk").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTrunks=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.trunk.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Trunks",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTrunk=function(e,n){i.show({controller:"CreateOrEditTrunkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trunk:n,trunks:f.trunks.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTrunk=y,f.exportSelectedTrunks=function(){var e=angular.copy(f.selectedTrunks);return f.selectedTrunks=[],e},f.deleteSelectedTrunks=function(e){var n=i.confirm().title("Are you sure want to delete the selected trunks?").htmlContent("<b>"+f.selectedTrunks.length+" selected</b> will be deleted.").ariaLabel("delete Trunks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTrunks.forEach(function(e){y(e)}),f.selectedTrunks=[]})},f.deselectTrunks=function(){f.selectedTrunks=[]},f.selectAllTrunks=function(){f.selectedTrunks=f.trunks.rows};var b=!0,A=1;function E(e){f.trunks=e||{count:0,rows:[]}}function y(e){m.trunk.delete({id:e.id}).$promise.then(function(){_.remove(f.trunks.rows,{id:e.id}),f.trunks.count-=1,f.trunks.rows.length||f.getTrunks(),p.success({title:_.startCase("Trunk")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrunk"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrunk",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTrunks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","trunks","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TrunksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_VARIABLE",g.variable=angular.copy(l),g.variables=r,g.newVariable=!1,g.variable||(g.variable={},g.title="TOOLS.NEW_VARIABLE",g.newVariable=!0),g.addNewVariable=function(){g.errors=[],d.variable.save(g.variable).$promise.then(function(e){g.variables.unshift(e.toJSON()),o.success({title:"Variable properly created",msg:g.variable.name?g.variable.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVariable=function(){g.errors=[],d.variable.update({id:g.variable.id},g.variable).$promise.then(function(e){var n=_.find(g.variables,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Variable properly saved!",msg:g.variable.name?g.variable.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVariable=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The variable will be deleted.").ariaLabel("Delete Variable").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.variable.delete({id:g.variable.id}).$promise.then(function(){_.remove(g.variables,{id:g.variable.id}),o.success({title:"Variable properly deleted!",msg:(g.variable.name||"variable")+" has been deleted!"}),v(g.variable)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","variables","variable","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditVariableDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.variables=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="variables",f.listOrder="",f.listOrderAsc=null,f.selectedVariables=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{variable:e,variables:f.variables.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("variable")+"?").htmlContent("<b>"+(e.name||"variable")+"</b> will be deleted.").ariaLabel("delete variable").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVariables=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.variable.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Variables",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVariable=function(e,n){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{variable:n,variables:f.variables.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVariable=y,f.exportSelectedVariables=function(){var e=angular.copy(f.selectedVariables);return f.selectedVariables=[],e},f.deleteSelectedVariables=function(e){var n=i.confirm().title("Are you sure want to delete the selected variables?").htmlContent("<b>"+f.selectedVariables.length+" selected</b> will be deleted.").ariaLabel("delete Variables").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVariables.forEach(function(e){y(e)}),f.selectedVariables=[]})},f.deselectVariables=function(){f.selectedVariables=[]},f.selectAllVariables=function(){f.selectedVariables=f.variables.rows};var b=!0,A=1;function E(e){f.variables=e||{count:0,rows:[]}}function y(e){m.variable.delete({id:e.id}).$promise.then(function(){_.remove(f.variables.rows,{id:e.id}),f.variables.count-=1,f.variables.rows.length||f.getVariables(),p.success({title:_.startCase("Variable")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvariable"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvariable",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVariables())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","variables","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("VariablesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VIDEO.EDIT_SCREENRECORDING",g.screenRecording=angular.copy(l),g.screenRecordings=r,g.newscreenRecording=!1,g.screenRecording||(g.screenRecording={},g.title="VIDEO.NEW_SCREENRECORDING",g.newscreenRecording=!0),g.addNewscreenRecording=function(){g.errors=[],d.screenRecording.save(g.screenRecording).$promise.then(function(e){g.screenRecordings.unshift(e.toJSON()),o.success({title:"screenRecording properly created",msg:g.screenRecording.name?g.screenRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savescreenRecording=function(){g.errors=[],d.screenRecording.update({id:g.screenRecording.id},g.screenRecording).$promise.then(function(e){var n=_.find(g.screenRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"screenRecording properly saved!",msg:g.screenRecording.name?g.screenRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletescreenRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The screenRecording will be deleted.").ariaLabel("Delete screenRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.screenRecording.delete({id:g.screenRecording.id}).$promise.then(function(){_.remove(g.screenRecordings,{id:g.screenRecording.id}),o.success({title:"screenRecording properly deleted!",msg:(g.screenRecording.name||"screenRecording")+" has been deleted!"}),v(g.screenRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.user.get({fields:"id,name,fullname",sort:"name",nolimit:"true"}).$promise.then(function(e){g.users=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","screenRecordings","screenRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.video").controller("CreateOrEditscreenRecordingDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c,m=this;if(m.loading=!1,m.recording=Object.assign({},i),m.route="screenRecording",m.element=l,m.actionOptions=Object.assign({},s),m.path=r,m.label=o,m.app="video",m.model="screenRecording",console.log("TCL: vm.path",m.path),console.log("TCL: vm.recording[vm.path]",m.recording[m.path]),m.filename=-1<m.recording[m.path].indexOf("/")?m.recording[m.path].substring(m.recording[m.path].lastIndexOf("/")+1):-1<m.recording[m.path].indexOf("\\")?m.recording[m.path].substring(m.recording[m.path].lastIndexOf("\\")+1):m.recording[m.path],m.format=!1,_.isNil(m.recording.format)&&(m.recording.format=m.filename.slice(m.filename.lastIndexOf("."))),(".wav"===m.recording.format&&"audio"===m.element||".mp4"===m.recording.format&&"video"===m.element)&&(m.format=!0),m.found=!0,m.format&&(c=d.defer(),a.screenRecording.download({id:m.recording.id,path:String(m.path)}).$promise.then(function(e){m.format=!0,m.found=!0,c.resolve()}).catch(function(e){console.log("err"),m.format=!1,m.found=!1,c.resolve()}),c.promise),!_.isNil(s.properties)&&s.properties){if(m.properties=Object.assign({},i),Object.keys(i).forEach(function(e){String(e[0].toUpperCase())===String(e[0])&&delete m.properties[e]}),m.propertiesDefault={},!_.isNil(s.propertiesList)&&0<s.propertiesList.length){m.propertiesDefault=Object.assign({},i);var u=s.propertiesList,p=Object.keys(i),g=!0;p.forEach(function(n){g=!0,u.forEach(function(e){String(n)===String(e)&&(g=!1)}),g&&delete m.propertiesDefault[n]}),m.properties=m.propertiesDefault}if(!_.isNil(s.extraData)&&0<s.extraData.length){m.propertiesExtra={};for(var v=s.extraData,h=0;h<v.length;h++)for(var f=v[h].values,b=v[h].model,A=0;A<f.length;A++)m.propertiesExtra[f[A].text]=i[b][f[A].key];m.properties=Object.assign({},m.propertiesDefault,m.propertiesExtra)}}m.closeDialog=function(){n.hide()}}e.$inject=["$scope","$mdDialog","toasty","api","recording","actionOptions","label","varPath","elementTag","$q"],angular.module("app.video").controller("screenRecordingplayController",e)}(),function(){"use strict";function e(e,n,t,a,r,l,i,o,s,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.screenRecordings=s||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="screenRecordings",f.listOrder="",f.listOrderAsc=null,f.selectedScreenRecordings=[],f.query={fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:"@msUtils.firstLastDayMonth()",includeAll:"true",sort:"-updatedAt",limit:10,page:1},f.query.createdAt=u.firstLastDayMonth(),f.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE_RANGE"}],f.playrecording=function(e,n,t,a,i){var s={route:"screenRecording",name:"screenRecordings",model:"screenRecording",singular:"screenRecording"},a=String(a),o=String(t);console.log("TCL:  path",String(t)),r.show({controller:"screenRecordingplayController",controllerAs:"vm",templateUrl:"app/main/apps/video/views/screenRecordings/partialViews/play.html",parent:angular.element(l.body),targetEvent:n,clickOutsideToClose:!0,locals:{recording:e,recordings:f.screenRecordings.rows,license:f.license,setting:null,item:s,actionOptions:{upperTitle:!1,lowerTitle:!0,properties:!0,propertiesIcon:"icon-video",propertiesList:["format","interactionid","duration","startedAt","closedAt","createdAt"],extraData:[{model:"User",values:[{key:"name",text:"agentname"}]}]},label:a,varPath:o,elementTag:String(i)}})},f.downloadfile2=function(e,n){var t=!1,a=_.isNil(e.format)?e.value.substring(e.value.lastIndexOf(".")):e.format;t=".mp4"===a;var s=-1<e.value.lastIndexOf("/")?e.value.substring(e.value.lastIndexOf("/")+1):-1<e.value.lastIndexOf("\\")?e.value.substring(e.value.lastIndexOf("\\")+1):e.value;return m.screenRecording.download({id:e.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:o.instant("VIDEO.CANT_DOWNLOAD_THIS_FILE"),msg:o.instant("VIDEO.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:o.instant("VIDEO.CANT_DOWNLOAD_THIS_FILE"),msg:o.instant("VIDEO.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=r.confirm().title("Are you sure want to delete the "+_.startCase("screenRecording")+"?").htmlContent("<b>"+(e.name||"screenRecording")+"</b> will be deleted.").ariaLabel("delete screenRecording").targetEvent(n).ok("OK").cancel("CANCEL");r.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getScreenRecordings=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.screenRecording.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ScreenRecordings",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditscreenRecording=function(e,n){r.show({controller:"CreateOrEditscreenRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/video/views/screenRecordings/create/dialog.html",parent:angular.element(l.body),targetEvent:e,clickOutsideToClose:!0,locals:{screenRecording:n,screenRecordings:f.screenRecordings.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletescreenRecording=y,f.exportSelectedScreenRecordings=function(){var e=angular.copy(f.selectedScreenRecordings);return f.selectedScreenRecordings=[],e},f.deleteSelectedScreenRecordings=function(e){var n=r.confirm().title("Are you sure want to delete the selected screenRecordings?").htmlContent("<b>"+f.selectedScreenRecordings.length+" selected</b> will be deleted.").ariaLabel("delete screenRecordings").targetEvent(e).ok("OK").cancel("CANCEL");r.show(n).then(function(){f.selectedScreenRecordings.forEach(function(e){y(e)}),f.selectedScreenRecordings=[]})},f.deselectScreenRecordings=function(){f.selectedScreenRecordings=[]},f.selectAllScreenRecordings=function(){f.selectedScreenRecordings=f.screenRecordings.rows},f.convertDuration=function(e){var n=Math.floor(e/1e3%60),t=Math.floor(e/6e4%60),a=Math.floor(e/36e5%24),i=a<10?"0"+String(a):String(a),s=t<10?"0"+String(t):String(t),o=n<10?"0"+String(n):String(n);return i+":"+s+":"+o},m.user.get({fields:"id,name,fullname",sort:"name",nolimit:"true"}).$promise.then(function(e){f.users=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.screenRecordings=e||{count:0,rows:[]}}function y(e){m.screenRecording.delete({id:e.id}).$promise.then(function(){_.remove(f.screenRecordings.rows,{id:e.id}),f.screenRecordings.count-=1,f.screenRecordings.rows.length||f.getScreenRecordings(),p.success({title:_.startCase("screenRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEscreenRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEscreenRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getScreenRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","screenRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.video").controller("ScreenRecordingsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(e){return _.isEmpty(e)||isNaN(e)?e:parseInt(e,10)}function m(e){switch(e){case"sound":if(!d.application.appdata)return;return[{key:"save_name",value:d.application.appdata.split("/").pop()}];case"squareProject":if(!d.application.project)return;return[{key:"name",value:d.application.project.split(",")[1]}];case"tag":if(!d.application.tag)return;return[{key:"name",value:d.application.tag}];case"trunk":if(!d.application.trunk)return;return[{key:"name",value:d.application.trunk}];case"user":if(!d.application.user&&!d.application.users)return;return d.application.user?[{key:"name",value:d.application.user.split("/")[1]}]:_.map(d.application.users,function(e){return{key:"name",value:e.split("/")[1]}});case"variable":if(!d.application.name)return;return[{key:"name",value:d.application.name}];case"voiceContext":if(!d.application.context)return;return[{key:"name",value:d.application.context}];case"voiceMail":if(!d.application.voiceMail)return;return[{key:"mailbox",value:d.application.voiceMail.split("@")[0]}];case"voiceQueue":if(!d.application.queue)return;return[{key:"name",value:d.application.queue}]}}function u(){o.getResourcesByRole(d.currentUser,"trunk",{fields:"id,name",sort:"name",nolimit:"true"},m("trunk")).then(function(e){d.trunks=e}).catch(function(){s.error({title:i.instant("TOOLS.TRUNKS"),msg:i.instant("VOICE.NOTIFICATIONS.TRUNKS_GET_ERROR")})})}function p(){o.getResourcesByRole(d.currentUser,"sound",{fields:"id,name,save_name",sort:"name",nolimit:"true"},m("sound")).then(function(e){d.sounds=e}).catch(function(){s.error({title:i.instant("TOOLS.SOUNDS"),msg:i.instant("VOICE.NOTIFICATIONS.SOUNDS_GET_ERROR")})})}function g(){var e={fields:"id,name,role",sort:"name",nolimit:"true"},n=m("user"),t=[o.getResourcesByRole(d.currentUser,"user",_.merge(e,{role:"agent"}),n,"Agents"),o.getResourcesByRole(d.currentUser,"user",_.merge(e,{role:"telephone"}),n,"Telephones")];a.all(t).then(function(e){var n=_(e).flatMap(function(e){return e.rows}).orderBy([function(e){return e.name.toLowerCase()}]).value();d.users={rows:n,count:n.length}}).catch(function(){s.error({title:i.instant("STAFF.USERS"),msg:i.instant("VOICE.NOTIFICATIONS.USERS_GET_ERROR")})})}function v(){(d.application.appdata||"custom"===d.application.appType)&&e.hide(d.application),e.hide()}d.currentUser=r.getCurrentUser(),d.application=angular.copy(n),d.crudPermissions=l,d.errors=[],d.init=function(){d.application.appdata&&function(){var e=[];switch(d.application.appType){case"agi":d.application.project=d.application.appdata;break;case"dial":e=d.application.appdata.split(","),d.application.tech=c(e[0]),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"externalDial":e=d.application.appdata.split(","),d.application.trunk=e[0].split("/")[1],d.application.phone=e[0].split("/")[2],d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"goTo":e=d.application.appdata.split(","),d.application.context=c(e[0]),d.application.extension=c(e[1]),d.application.priority=c(e[2]);break;case"internalDial":e=d.application.appdata.split(","),d.application.user=c(e[0]),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"outboundDial":e=d.application.appdata.split(","),d.application.trunk=e[0].split("/")[1],d.application.phone=e[0].split("/")[2],d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]),d.application.prefix=d.application.phone?d.application.phone.split("$")[0]:void 0,d.application.callerId=d.application.callerID?"CALLERID(all)="+d.application.callerID:void 0;break;case"playback":e=d.application.appdata.split(","),d.application.appdata=c(e[0]),d.application.options=c(e[1]);break;case"queue":e=d.application.appdata.split(","),d.application.queue=c(e[0]),d.application.options=c(e[1]),d.application.URL=c(e[2]),d.application.sound=c(e[3]),d.application.timeout=c(e[4]),d.application.agi=c(e[5]),d.application.macro=c(e[6]),d.application.gosub=c(e[7]),d.application.rule=c(e[8]),d.application.position=c(e[9]);break;case"ringGroup":e=d.application.appdata.split(","),d.application.users=e[0].split("&"),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"set":e=d.application.appdata.split("="),d.application.name=e[0],d.application.value=e[1];break;case"voicemail":e=d.application.appdata.split(","),d.application.voiceMail=c(e[0]),d.application.options=c(e[1])}}();switch(d.application.appType){case"agi":o.getResourcesByRole(d.currentUser,"squareProject",{fields:"id,name",sort:"name",nolimit:"true"},m("squareProject")).then(function(e){d.projects=e}).catch(function(){s.error({title:i.instant("CALLYSQUARE.CALLYSQUARE")+" "+i.instant("CALLYSQUARE.PROJECTS"),msg:i.instant("VOICE.NOTIFICATIONS.CALLYSQUARE_PROJECTS_GET_ERROR")})});break;case"externalDial":u();break;case"goTo":o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:"true"},m("voiceContext")).then(function(e){d.contexts=e}).catch(function(){s.error({title:i.instant("VOICE.CONTEXTS"),msg:i.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});break;case"internalDial":g();break;case"outboundDial":o.getResourcesByRole(d.currentUser,"tag",{fields:"id,name",sort:"name",nolimit:"true"},m("tag")).then(function(e){d.tags=e}).catch(function(){s.error({title:i.instant("TOOLS.TAGS"),msg:i.instant("VOICE.NOTIFICATIONS.TAGS_GET_ERROR")})}),u();break;case"playback":p();break;case"queue":p(),o.getResourcesByRole(d.currentUser,"voiceQueue",{type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"},m("voiceQueue")).then(function(e){d.queues=e}).catch(function(){s.error({title:i.instant("VOICE.VOICEQUEUES"),msg:i.instant("VOICE.NOTIFICATIONS.QUEUES_GET_ERROR")})});break;case"ringGroup":g();break;case"set":o.getResourcesByRole(d.currentUser,"variable",{fields:"id,name",sort:"name",nolimit:"true"},m("variable")).then(function(e){d.variables=e}).catch(function(){s.error({title:i.instant("TOOLS.VARIABLES"),msg:i.instant("VOICE.NOTIFICATIONS.VARIABLES_GET_ERROR")})});break;case"voicemail":o.getResourcesByRole(d.currentUser,"voiceMail",{fields:"id,mailbox",sort:"mailbox",nolimit:"true"},m("voiceMail")).then(function(e){d.voiceMails=e}).catch(function(){s.error({title:i.instant("VOICE.VOICEMAILS"),msg:i.instant("VOICE.NOTIFICATIONS.VOICEMAILS_GET_ERROR")})})}},d.saveRoutingApp=function(){d.errors=[],function(){var e=[];switch(d.application.appType){case"agi":d.application.appdata=d.application.project;break;case"dial":e[0]=d.application.tech,e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"externalDial":e[0]=["SIP",d.application.trunk,d.application.phone].join("/"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"goTo":e[0]=d.application.context,e[1]=d.application.extension,e[2]=d.application.priority,d.application.appdata=e.join(",");break;case"internalDial":e[0]=d.application.user,e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"outboundDial":d.application.phone=t.cutdigits?(d.application.prefix||"")+"${EXTEN:"+t.cutdigits+"}":(d.application.prefix||"")+"${EXTEN}","none"===t.recordingFormat?d.application.options=d.application.options.replace("U(xcally-mixmonitor-context)",""):d.application.options.indexOf("U(xcally-mixmonitor-context)")<0&&(d.application.options+="U(xcally-mixmonitor-context)"),e[0]=["SIP",d.application.trunk,d.application.phone].join("/"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"playback":e[0]=d.application.appdata,e[1]=d.application.options,d.application.appdata=e.join(",");break;case"queue":e[0]=d.application.queue,e[1]=d.application.options,e[2]=d.application.URL,e[3]=d.application.sound,e[4]=d.application.timeout,e[5]=d.application.agi,e[6]=d.application.macro,e[7]=d.application.gosub,e[8]=d.application.rule,e[9]=d.application.position,d.application.appdata=e.join(",");break;case"ringGroup":e[0]=d.application.users.join("&"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"set":e[0]=d.application.name,e[1]=d.application.value,d.application.appdata=e.join("=");break;case"voicemail":e[0]=d.application.voiceMail,e[1]=d.application.options,d.application.appdata=e.join(",")}}(),v()},d.closeDialog=v}e.$inject=["$mdDialog","$q","$translate","toasty","application","route","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditRoutingAppDialogController",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o,r,l){var d=this;function c(){var e=[{key:"name",value:d.interval.IntervalId}];s.getResourcesByRole(d.currentUser,"interval",{fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0},e).then(function(e){d.intervals=e}).catch(function(){i.error({title:t.instant("TOOLS.INTERVALS"),msg:t.instant("VOICE.NOTIFICATIONS.INTERVALS_GET_ERROR")})})}function m(e){n.hide(e)}d.currentUser=o.getCurrentUser(),d.interval=angular.copy(e),d.intervals=a||{rows:[],count:0},d.types=["always","custom","list"],d.crudPermissions=r,d.errors=[],d.daysOfWeek=l.getDaysOfWeek(),d.monthNumber=l.getMonthNumber(),d.monthName=l.getMonthName(),d.daysOfMonth=l.getDaysOfMonth(),d.initialize=function(){if("*,*,*,*"===d.interval.interval)return d.type=d.interval.IntervalId&&d.interval.application?"list":"always",void("list"===d.type&&c());d.type="custom";var e=d.interval.interval.split(","),n=e[0],t=e[1],a=e[2],i=e[3];if("*"!==n){var s,o=n.split("-")[0],r=n.split("-")[1];(s=new Date).setHours(Number(o.split(":")[0])),s.setMinutes(Number(o.split(":")[1])),d.timeRangeFrom=s,(s=new Date).setHours(Number(r.split(":")[0])),s.setMinutes(Number(r.split(":")[1])),d.timeRangeTo=s}"*"!==t&&(d.dayOfWeekFrom=t.split("-")[0],d.dayOfWeekTo=t.split("-")[1]);"*"!==a&&(d.monthDayFrom=a.split("-")[0],d.monthDayTo=a.split("-")[1]);"*"!==i&&(d.monthFrom=i.split("-")[0],d.monthTo=i.split("-")[1])},d.onTypeChange=function(){"list"===d.type&&0===d.intervals.count&&c()},d.saveInterval=function(){d.errors=[],d.interval.interval=function(){if(["always","list"].includes(d.type))return"*,*,*,*";var e=[];if("*"!==d.timeRangeFrom&&d.timeRangeFrom&&d.timeRangeTo){var n=(d.timeRangeFrom.getHours()<10?"0":"")+d.timeRangeFrom.getHours()+":"+(d.timeRangeFrom.getMinutes()<10?"0":"")+d.timeRangeFrom.getMinutes(),t=(d.timeRangeTo.getHours()<10?"0":"")+d.timeRangeTo.getHours()+":"+(d.timeRangeTo.getMinutes()<10?"0":"")+d.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return d.dayOfWeekFrom?d.dayOfWeekTo?e.push(d.dayOfWeekFrom+"-"+d.dayOfWeekTo):e.push(d.dayOfWeekFrom):e.push("*"),d.monthDayFrom?d.monthDayTo?e.push(d.monthDayFrom+"-"+d.monthDayTo):e.push(d.monthDayFrom):e.push("*"),d.monthFrom?d.monthTo?e.push(d.monthFrom+"-"+d.monthTo):e.push(d.monthFrom):e.push("*"),e.join()}(),"list"!==d.type&&(d.interval.IntervalId=null);m(d.interval)},d.closeDialog=m}e.$inject=["$mdDialog","$translate","interval","intervals","toasty","api","Auth","crudPermissions","IndexFactory"],angular.module("app.voice").controller("EditRoutingIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chanSpies=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chanSpies",f.listOrder="",f.listOrderAsc=null,f.selectedChanSpies=[],f.query={fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,page:1},f.arrayoptions=_.keyBy([{option:"b: Only spy on channels involved in a bridged call.",value:"'b'"},{option:"B: Instead of whispering on a single channel barge in on both channels involved in the call.",value:"'B'"},{option:"E: Exit when the spied-on channel hangs up.",value:"'E'"},{option:"o: Only listen to audio coming from this channel.",value:"'o'"},{option:"q: Don't play a beep when beginning to spy on a channel, or speak the selected channel name.",value:"'q'"},{option:"s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.",value:"'s'"},{option:"S: Stop when no more channels are left to spy on.",value:"'S'"},{option:"w: Enable whisper mode, so the spying channel can talk to the spied-on channel.",value:"'w'"},{option:"W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.",value:"'W'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayrecordingFormat=_.keyBy([{option:"wav",value:"'wav'"},{option:"gsm",value:"'gsm'"},{option:"wav49",value:"'WAV'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chanSpy:e,chanSpies:f.chanSpies.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chanSpy")+"?").htmlContent("<b>"+(e.name||"chanSpy")+"</b> will be deleted.").ariaLabel("delete chanSpy").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getChanSpies=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceChanSpy.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChanSpies",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditchanSpy=function(e,n){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chanSpy:n,chanSpies:f.chanSpies.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletechanSpy=y,f.exportSelectedChanSpies=function(){var e=angular.copy(f.selectedChanSpies);return f.selectedChanSpies=[],e},f.deleteSelectedChanSpies=function(e){var n=i.confirm().title("Are you sure want to delete the selected chanSpies?").htmlContent("<b>"+f.selectedChanSpies.length+" selected</b> will be deleted.").ariaLabel("delete chanSpys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChanSpies.forEach(function(e){y(e)}),f.selectedChanSpies=[]})},f.deselectChanSpies=function(){f.selectedChanSpies=[]},f.selectAllChanSpies=function(){f.selectedChanSpies=f.chanSpies.rows};var b=!0,A=1;function E(e){f.chanSpies=e||{count:0,rows:[]}}function y(e){m.voiceChanSpy.delete({id:e.id}).$promise.then(function(){_.remove(f.chanSpies.rows,{id:e.id}),f.chanSpies.count-=1,f.chanSpies.rows.length||f.getChanSpies(),p.success({title:_.startCase("chanSpy")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceChanSpy"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceChanSpy",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChanSpies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chanSpies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("ChanSpiesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CHANSPY",g.chanSpy=angular.copy(l),g.chanSpies=r,g.newchanSpy=!1,g.chanSpy||(g.chanSpy={recordingFormat:"wav"},g.title="VOICE.NEW_CHANSPY",g.newchanSpy=!0),g.addNewchanSpy=function(){g.errors=[],d.voiceChanSpy.save(g.chanSpy).$promise.then(function(e){g.chanSpies.unshift(e.toJSON()),o.success({title:"chanSpy properly created",msg:g.chanSpy.name?g.chanSpy.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savechanSpy=function(){g.errors=[],d.voiceChanSpy.update({id:g.chanSpy.id},g.chanSpy).$promise.then(function(e){var n=_.find(g.chanSpies,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"chanSpy properly saved!",msg:g.chanSpy.name?g.chanSpy.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletechanSpy=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chanSpy will be deleted.").ariaLabel("Delete chanSpy").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceChanSpy.delete({id:g.chanSpy.id}).$promise.then(function(){_.remove(g.chanSpies,{id:g.chanSpy.id}),o.success({title:"chanSpy properly deleted!",msg:(g.chanSpy.name||"chanSpy")+" has been deleted!"}),v(g.chanSpy)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chanSpies","chanSpy","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditchanSpyDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.contexts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="contexts",f.listOrder="",f.listOrderAsc=null,f.selectedContexts=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{context:e,contexts:f.contexts.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("context")+"?").htmlContent("<b>"+(e.name||"context")+"</b> will be deleted.").ariaLabel("delete context").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getContexts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceContext.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Contexts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditContext=function(e,n){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{context:n,contexts:f.contexts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteContext=y,f.exportSelectedContexts=function(){var e=angular.copy(f.selectedContexts);return f.selectedContexts=[],e},f.deleteSelectedContexts=function(e){var n=i.confirm().title("Are you sure want to delete the selected contexts?").htmlContent("<b>"+f.selectedContexts.length+" selected</b> will be deleted.").ariaLabel("delete Contexts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedContexts.forEach(function(e){y(e)}),f.selectedContexts=[]})},f.deselectContexts=function(){f.selectedContexts=[]},f.selectAllContexts=function(){f.selectedContexts=f.contexts.rows};var b=!0,A=1;function E(e){f.contexts=e||{count:0,rows:[]}}function y(e){m.voiceContext.delete({id:e.id}).$promise.then(function(){_.remove(f.contexts.rows,{id:e.id}),f.contexts.count-=1,f.contexts.rows.length||f.getContexts(),p.success({title:_.startCase("Context")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceContext"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceContext",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getContexts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contexts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("ContextsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CONTEXT",g.context=angular.copy(l),g.contexts=r,g.newContext=!1,g.context||(g.context={},g.title="VOICE.NEW_CONTEXT",g.newContext=!0),g.addNewContext=function(){g.errors=[],d.voiceContext.save(g.context).$promise.then(function(e){g.contexts.unshift(e.toJSON()),o.success({title:"Context properly created",msg:g.context.name?g.context.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContext=function(){g.errors=[],d.voiceContext.update({id:g.context.id},g.context).$promise.then(function(e){var n=_.find(g.contexts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Context properly saved!",msg:g.context.name?g.context.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContext=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The context will be deleted.").ariaLabel("Delete Context").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceContext.delete({id:g.context.id}).$promise.then(function(){_.remove(g.contexts,{id:g.context.id}),o.success({title:"Context properly deleted!",msg:(g.context.name||"context")+" has been deleted!"}),v(g.context)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","contexts","context","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditContextDialogController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.inboundRoute=angular.copy(s),d.inboundRoutes=n,d.newInboundRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.inboundRoute||(d.inboundRoute={appdata:"Inbound Call",type:"inbound",context:"from-voip-provider"},d.newInboundRoute=!0);e=[{key:"name",value:d.inboundRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newinboundRoute)return;var e={sort:"priority",VoiceExtensionId:d.inboundRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewInboundRoute=function(){d.errors=[],o.voiceExtension.save(d.inboundRoute).$promise.then(function(e){c(e.id).then(function(){d.inboundRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveInboundRoute=function(){d.errors=[],o.voiceExtension.update({id:d.inboundRoute.id},d.inboundRoute).$promise.then(function(e){var n=_.find(d.inboundRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.inboundRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteInboundRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.inboundRoute.exten})).ariaLabel("Delete inbound route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.inboundRoute.id}).$promise.then(function(){_.remove(d.inboundRoutes,{id:d.inboundRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.inboundRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","inboundRoutes","inboundRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInboundRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.inboundRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.inboundRoute=l||e.params.inboundRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.inboundRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"AGI",appAlias:"CallySquare",appType:"agi",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"Dial",appType:"dial",context:"from-sip",type:"Inbound",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Inbound",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Inbound",interval:"*,*,*,*",options:"xX"},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Inbound",interval:"*,*,*,*",options:"xX"},{app:"Playback",appType:"playback",context:"from-sip",type:"Inbound",interval:"*,*,*,*",answer:!0},{app:"Queue",appType:"queue",context:"from-sip",type:"Inbound",options:"xX",appdata:",xX,,,300,,,,,",interval:"*,*,*,*",answer:!0},{app:"Set",appType:"set",context:"from-sip",type:"Inbound",separator:"=",interval:"*,*,*,*"},{app:"Voicemail",appType:"voicemail",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"goto",appType:"goTo",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"hangup",appType:"hangup",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Inbound",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.inboundRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoInboundRoutes=function(){e.go("app.voice.inboundRoutes",{},{reload:"app.voice.inboundRoutes"})},m.saveInboundRoute=function(){o.voiceExtension.update({id:m.inboundRoute.id},m.inboundRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.inboundRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","inboundRoute","contexts","userProfileSection"],angular.module("app.voice").controller("InboundRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.inboundRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="InboundRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.inboundRoutes.rows,{id:e.id}),g.inboundRoutes.count-=1,g.inboundRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.inboundRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedInboundRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.inboundRoutes.edit",{id:e.id,inboundRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditInboundRoute=function(e,n){a.show({controller:"CreateOrEditInboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundRoute:n,inboundRoutes:g.inboundRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getInboundRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedInboundRoutes=function(){var e=angular.copy(g.selectedInboundRoutes);return g.selectedInboundRoutes=[],e},g.deleteSelectedInboundRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedInboundRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedInboundRoutes.forEach(function(e){f(e)}),g.selectedInboundRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","inboundRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("InboundRoutesController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.internalRoute=angular.copy(s),d.internalRoutes=n,d.newInternalRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.internalRoute||(d.internalRoute={appdata:"Internal Call",type:"internal",context:"from-sip"},d.newInternalRoute=!0);e=[{key:"name",value:d.internalRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newInternalRoute)return;var e={sort:"priority",VoiceExtensionId:d.internalRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewInternalRoute=function(){d.errors=[],o.voiceExtension.save(d.internalRoute).$promise.then(function(e){c(e.id).then(function(){d.internalRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveInternalRoute=function(){d.errors=[],o.voiceExtension.update({id:d.internalRoute.id},d.internalRoute).$promise.then(function(e){var n=_.find(d.internalRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.internalRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteInternalRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.internalRoute.exten})).ariaLabel("Delete internal route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.internalRoute.id}).$promise.then(function(){_.remove(d.internalRoutes,{id:d.internalRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.internalRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","internalRoutes","internalRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInternalRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.internalRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.internalRoute=l||e.params.internalRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.internalRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"AGI",appAlias:"CallySquare",appType:"agi",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"Dial",appType:"dial",context:"from-sip",type:"Internal",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Internal",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Internal",interval:"*,*,*,*",options:"xX"},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Internal",interval:"*,*,*,*",options:"xX"},{app:"Playback",appType:"playback",context:"from-sip",type:"Internal",interval:"*,*,*,*",answer:!0},{app:"Queue",appType:"queue",context:"from-sip",type:"Internal",options:"xX",appdata:",xX,,,300,,,,,",interval:"*,*,*,*",answer:!0},{app:"Set",appType:"set",context:"from-sip",type:"Internal",separator:"=",interval:"*,*,*,*"},{app:"Voicemail",appType:"voicemail",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"goto",appType:"goTo",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"hangup",appType:"hangup",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Internal",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.internalRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoInternalRoutes=function(){e.go("app.voice.internalRoutes",{},{reload:"app.voice.internalRoutes"})},m.saveInternalRoute=function(){o.voiceExtension.update({id:m.internalRoute.id},m.internalRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.internalRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","internalRoute","contexts","userProfileSection"],angular.module("app.voice").controller("InternalRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.internalRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="InternalRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.internalRoutes.rows,{id:e.id}),g.internalRoutes.count-=1,g.internalRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.internalRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedInternalRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.internalRoutes.edit",{id:e.id,internalRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditInternalRoute=function(e,n){a.show({controller:"CreateOrEditInternalRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalRoute:n,internalRoutes:g.internalRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getInternalRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedInternalRoutes=function(){var e=angular.copy(g.selectedInternalRoutes);return g.selectedInternalRoutes=[],e},g.deleteSelectedInternalRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedInternalRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedInternalRoutes.forEach(function(e){f(e)}),g.selectedInternalRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","internalRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("InternalRoutesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MUSICONHOLD",g.musiconhold=angular.copy(l),g.musiconholds=r,g.newMusicOnHold=!1,g.musiconhold||(g.musiconhold={mode:"files"},g.title="VOICE.NEW_MUSICONHOLD",g.newMusicOnHold=!0),g.addNewMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.save(g.musiconhold).$promise.then(function(e){g.musiconholds.unshift(e.toJSON()),o.success({title:"MusicOnHold properly created",msg:g.musiconhold.name?g.musiconhold.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.musiconhold.id},g.musiconhold).$promise.then(function(e){var n=_.find(g.musiconholds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MusicOnHold properly saved!",msg:g.musiconhold.name?g.musiconhold.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMusicOnHold=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The musiconhold will be deleted.").ariaLabel("Delete MusicOnHold").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMusicOnHold.delete({id:g.musiconhold.id}).$promise.then(function(){_.remove(g.musiconholds,{id:g.musiconhold.id}),o.success({title:"MusicOnHold properly deleted!",msg:(g.musiconhold.name||"musiconhold")+" has been deleted!"}),v(g.musiconhold)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","musiconholds","musiconhold","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMusicOnHoldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.musiconholdMohSounds=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceMusicOnHold.getSounds(m.query,u).$promise}function g(e){d.voiceMusicOnHold.removeSound({id:t.params.id,id2:e.id}).$promise.then(function(){_.remove(m.musiconholdMohSounds.rows,{id:e.id}),m.musiconholdMohSounds.count-=1,m.musiconholdMohSounds.rows.length||p(),l.success({title:"MohSound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMusicOnHold"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.musiconhold={},m.musiconholdMohSounds={count:0,rows:[]},m.selectedMusicOnHoldMohSounds=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,save_name,converted_format,audio",limit:10,page:1},m.init=function(e,n){m.musiconhold=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceMusicOnHoldId=m.musiconhold.id,m.query.id=m.musiconhold.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the mohSound?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("mohSound #")+e.id||"mohSound")+"</b> will be deleted.").ariaLabel("delete mohSound").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.voiceMusicOnHoldDownload=function(s,e,n){return d.sound.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="mohSound"+s.id,a=new Blob(n,{type:e.type});t=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=u,m.getMusicOnHoldMohSounds=p,m.createOrEditMusicOnHoldMohSound=function(e,n){o.show({controller:"CreateOrEditMohSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:m.musiconhold,mohSound:n,mohSounds:m.musiconholdMohSounds.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedMusicOnHoldMohSounds=function(){var e=angular.copy(m.selectedMusicOnHoldMohSounds);return m.selectedMusicOnHoldMohSounds=[],e},m.deleteMusicOnHoldMohSound=g,m.deleteSelectedMusicOnHoldMohSounds=function(e){var n=o.confirm().title("Are you sure want to delete the selected mohSounds?").htmlContent("<b>"+m.selectedMusicOnHoldMohSounds.length+" selected</b> will be deleted.").ariaLabel("delete mohSounds").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMusicOnHoldMohSounds.forEach(function(e){g(e)}),m.selectedMusicOnHoldMohSounds=[]})},c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.sounds,{id:e.resourceId})}),t=null;if(m.musiconhold&&(t=_.find(m.sounds,{id:Number(m.musiconhold.id)})),t&&!_.some(n,["id",t.id])){var a=_.find(m.sounds,{id:t.id});a.canSelect=!1,n.push(a)}m.sounds=n})}else{var t=[],a=null;m.musiconhold&&(a=_.find(m.sounds,{id:Number(m.musiconhold.id)}));for(var i=0;i<m.sounds.length;i++)a&&m.sounds[i].id===a.id&&(m.sounds[i].canSelect=!1,t.push(m.sounds[i]));m.sounds=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("MusicOnHoldMohSoundsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MOHSOUND",g.mohSound=angular.copy(l),g.mohSounds=r,g.newMohSound=!1,g.mohSound||(g.mohSound={},g.title="VOICE.NEW_MOHSOUND",g.newMohSound=!0),n.params.id&&(g.mohSound.VoiceMusicOnHoldId=n.params.id),g.addNewMohSound=function(){g.errors=[],d.voiceMusicOnHold.addSound({id:n.params.id},g.mohSound).$promise.then(function(e){g.mohSounds.unshift(e.toJSON()),o.success({title:"MohSound properly created",msg:g.mohSound.name?g.mohSound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMohSound=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.mohSound.id},g.mohSound).$promise.then(function(e){var n=_.find(g.mohSounds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MohSound properly saved!",msg:g.mohSound.name?g.mohSound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMohSound=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mohSound will be deleted.").ariaLabel("Delete MohSound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMusicOnHold.delete({id:g.mohSound.id}).$promise.then(function(){_.remove(g.mohSounds,{id:g.mohSound.id}),o.success({title:"MohSound properly deleted!",msg:(g.mohSound.name||"mohSound")+" has been deleted!"}),v(g.mohSound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.sounds=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.sounds,{id:e.resourceId})}),t=null;if(g.mohSound&&(t=_.find(g.sounds,{id:Number(g.mohSound.id)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.sounds,{id:t.id});a.canSelect=!1,n.push(a)}g.sounds=n})}else{var t=[],a=null;g.mohSound&&(a=_.find(g.sounds,{id:Number(g.mohSound.id)}));for(var i=0;i<g.sounds.length;i++)a&&g.sounds[i].id===a.id&&(g.sounds[i].canSelect=!1,t.push(g.sounds[i]));g.sounds=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mohSounds","mohSound","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMohSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.musiconhold=c||e.params.musiconhold||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoMusicOnHolds=function(){e.go("app.voice.musiconholds",{},{reload:"app.voice.musiconholds"})},u.saveMusicOnHold=function(){r.voiceMusicOnHold.update({id:u.musiconhold.id},u.musiconhold).$promise.then(function(){l.success({title:"MusicOnHold updated!",msg:u.musiconhold.name?u.musiconhold.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","musiconhold","userProfileSection"],angular.module("app.voice").controller("MusicOnHoldController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.musiconholds=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="musiconholds",f.listOrder="",f.listOrderAsc=null,f.selectedMusicOnHolds=[],f.query={fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,page:1},f.arraymode=_.keyBy([{option:"Files",value:"'files'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysort=_.keyBy([{option:"Random",value:"'random'"},{option:"Alphabetical",value:"'alpha'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.musiconholds.edit",{id:e.id,musiconhold:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("musiconhold")+"?").htmlContent("<b>"+(e.name||"musiconhold")+"</b> will be deleted.").ariaLabel("delete musiconhold").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMusicOnHolds=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceMusicOnHold.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MusicOnHolds",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMusicOnHold=function(e,n){i.show({controller:"CreateOrEditMusicOnHoldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:n,musiconholds:f.musiconholds.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMusicOnHold=y,f.exportSelectedMusicOnHolds=function(){var e=angular.copy(f.selectedMusicOnHolds);return f.selectedMusicOnHolds=[],e},f.deleteSelectedMusicOnHolds=function(e){var n=i.confirm().title("Are you sure want to delete the selected musiconholds?").htmlContent("<b>"+f.selectedMusicOnHolds.length+" selected</b> will be deleted.").ariaLabel("delete MusicOnHolds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMusicOnHolds.forEach(function(e){y(e)}),f.selectedMusicOnHolds=[]})},f.deselectMusicOnHolds=function(){f.selectedMusicOnHolds=[]},f.selectAllMusicOnHolds=function(){f.selectedMusicOnHolds=f.musiconholds.rows};var b=!0,A=1;function E(e){f.musiconholds=e||{count:0,rows:[]}}function y(e){m.voiceMusicOnHold.delete({id:e.id}).$promise.then(function(){_.remove(f.musiconholds.rows,{id:e.id}),f.musiconholds.count-=1,f.musiconholds.rows.length||f.getMusicOnHolds(),p.success({title:_.startCase("MusicOnHold")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMusicOnHold"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMusicOnHolds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","musiconholds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("MusicOnHoldsController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.outboundRoute=angular.copy(s),d.outboundRoutes=n,d.newOutboundRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.outboundRoute||(d.outboundRoute={appdata:"Outbound Call",type:"outbound",context:"from-sip",recordingFormat:"none"},d.newOutboundRoute=!0);e=[{key:"name",value:d.outboundRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newOutboundRoute)return;var e={sort:"priority",VoiceExtensionId:d.outboundRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewOutboundRoute=function(){d.errors=[],o.voiceExtension.save(d.outboundRoute).$promise.then(function(e){c(e.id).then(function(){d.outboundRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveOutboundRoute=function(){d.errors=[],o.voiceExtension.update({id:d.outboundRoute.id},d.outboundRoute).$promise.then(function(e){var n=_.find(d.outboundRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.outboundRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteOutboundRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.outboundRoute.exten})).ariaLabel("Delete outbound route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.outboundRoute.id}).$promise.then(function(){_.remove(d.outboundRoutes,{id:d.outboundRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.outboundRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","outboundRoutes","outboundRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditOutboundRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.outboundRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.outboundRoute=l||e.params.outboundRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.outboundRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",options:"xX",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Outbound",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.outboundRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoOutboundRoutes=function(){e.go("app.voice.outboundRoutes",{},{reload:"app.voice.outboundRoutes"})},m.saveOutboundRoute=function(){o.voiceExtension.update({id:m.outboundRoute.id},m.outboundRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.outboundRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","outboundRoute","contexts","userProfileSection"],angular.module("app.voice").controller("OutboundRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.outboundRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="OutboundRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.outboundRoutes.rows,{id:e.id}),g.outboundRoutes.count-=1,g.outboundRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.outboundRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedOutboundRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.outboundRoutes.edit",{id:e.id,outboundRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditOutboundRoute=function(e,n){a.show({controller:"CreateOrEditOutboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundRoute:n,outboundRoutes:g.outboundRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getOutboundRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedOutboundRoutes=function(){var e=angular.copy(g.selectedOutboundRoutes);return g.selectedOutboundRoutes=[],e},g.deleteSelectedOutboundRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedOutboundRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedOutboundRoutes.forEach(function(e){f(e)}),g.selectedOutboundRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","outboundRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("OutboundRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){return[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",options:g.agents.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:g.queues.rows,ngValue:"name"}]}function h(){return g.refresh=!1,0===g.queues.count?f(null):(g.query.queue=1===g.queues.count?g.queues.rows[0].name:g.query.queue,void 0===g.query.queue&&(g.query.queue=_.map(g.queues.rows,"name")),_.isEmpty(g.query.queue)?f(null):(g.query.offset=(g.query.page-1)*g.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.voice.abandonedCalls:"+g.currentUser.id,JSON.stringify({query:_.omit(g.query,"queue")})),void(g.promise=o.voiceQueueReport.getVoiceQueuesReport(g.query,f).$promise)))}function f(e){g.abandonedCalls=e||{count:0,rows:[]},!1,g.refresh=!0}g.currentUser=d.getCurrentUser(),g.agents=u||[],g.dispositions=p.rows,g.abandonedCalls={count:0,rows:[]},g.showTooltip=!1,g.refresh=!0,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=d.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},g.getAbandonedCalls=h,g.refreshAbandonedCalls=function(){g.showTooltip=!1,h()},g.assignTo=function(e,n){e&&o.voiceQueueReport.update({id:e.id,lastAssignedTo:n?n.name:null,assigned:!!n}).$promise.catch(function(e){console.log(e)})},g.dispose=function(t){n.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(a.body),targetEvent:t,locals:{dispositions:g.dispositions,call:t}}).then(function(e){if(e){var n={id:t.id,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)})}})},g.onSaveVoiceQueueReport=function(e){e&&g.queuesMap&&"inbound"===queue.type&&g.queuesMap[e.queue]&&(g.showTooltip=!0)},g.onUpdateVoiceQueueReport=function(e){if(e){var n=_.findIndex(g.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(g.abandonedCalls.rows[n],e)}},c.onWithoutApply("voiceQueueReport:save",g.onSaveVoiceQueueReport),c.on("voiceQueueReport:update",g.onUpdateVoiceQueueReport),function(){var e=i.localStorage.getItem("motion2.realtime.abandoned.voice.abandonedCalls:"+g.currentUser.id);if(e)(e=JSON.parse(e))&&e.query&&(g.query=_.merge(e.query,_.omit(g.query,["sort","limit","page"])),g.query=_.omit(g.query,"filter"));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};g.query.createdAt=n}d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()}):o.userProfile.getResources({id:g.currentUser.userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()})}();var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?t(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","agents","dispositions"],angular.module("app.voice").controller("AbandonedCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.calls=i||{rows:[],count:0},o.query={limit:10,page:1},o.channelStatus=s.channelStatusOut,o.onSave=function(e){var n=_.find(o.calls.rows,{channel:e.channel});e.channelstatedesc=e.dialstatus?"up":"ring",n?_.merge(n,e):e.channel&&o.calls.rows.push(e)},o.onRemove=function(e){var n=_.findIndex(o.calls.rows,{channel:e.channel});0<=n&&(o.calls.rows[n].status="hangup");t(function(){o.calls.rows.splice(n,1)},5e3)},a.on("voice_outbound_channel:save",o.onSave),a.on("voice_outbound_channel:remove",o.onRemove),e.$on("$destroy",function(){a.removeAllListeners("voice_outbound_channel:save"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$scope","$timeout","api","socket","rpcCalls","helperClasses"],angular.module("app.voice").controller("OutboundCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,a,o,t,i,s,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.queues=t?_.keyBy(t.rows?t.rows:[],"name"):{},p.rpcVoiceQueuesChannelsTmp=i?_.keyBy(i.rows?_.filter(i.rows,{type:"inbound"}):[],"uniqueid"):{},p.rpcVoiceQueuesChannels={},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.queryChannels={limit:10,page:1},p.getAvailableAgents=function(){p.availableAgents=null,s.rpc.getAgents().$promise.then(function(e){for(var n=[],t=e?e.rows:[],a=_.filter(t,{online:!0,voicePause:!1,voiceStatus:"idle"}),i=0;i<a.length;i++){var s=_.find(o.rows,["id",a[i].id]);s&&n.push(s)}p.availableAgents=n}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.getSize=function(e){return _.size(e)},p.$onInit=function(){_.forIn(p.rpcVoiceQueuesChannelsTmp,function(e,n){_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[n]=e)})},p.onSave=function(e){"inbound"===e.type&&_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[e.uniqueid]=e)},p.onRemove=function(e){p.rpcVoiceQueuesChannels[e.uniqueid]&&delete p.rpcVoiceQueuesChannels[e.uniqueid]},p.hangup=function(n){return s.rpc.getVoiceQueuesChannelHangup({uniqueid:n}).$promise.then(function(e){d.success({title:"Channel "+n+" properly hangup!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToAgent=function(n,e,t){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e,context:t}).$promise.then(function(e){d.success({title:"Channel "+n+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToNumber=function(e,n){var t=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(t).then(function(e){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e}).$promise}).then(function(e){d.success({title:"Channel "+n+" properly redirect!",msg:e.message||""})}).catch(function(e){e&&d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},r.on("voice_queue_channel:save",p.onSave),r.on("voice_queue_channel:remove",p.onRemove),e.$on("$destroy",function(){r.removeAllListeners("voice_queue_channel:save"),r.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","queues","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["total","answered","unmanaged","abandoned","sumHoldTime","sumDuration","sumBillable"];function u(){_.forIn(c.queues,function(e,n){c.rpcQueues[n]&&_.merge(e,_.pick(c.rpcQueues[n],m))})}c.count=a.count,c.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="VoiceQueues",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){c.queues[e.id]&&_.merge(c.queues[e.id],_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=n(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&n.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueParamsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"VoiceQueues":void 0,channel:"voice",type:"inbound",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("VOICE.VOICEQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:n,voiceQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:n,voiceQueues:u.queues.rows,realtime:!0,crudPermissions:u.crudPermissions}})},r.onWithoutApply("voice_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&m.updateVoiceQueue(e,n)}),r.on("userVoiceQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.VoiceQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userVoiceQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.VoiceQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:agentconnect",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);if(n){if(!t.agentconnected)return;t.queue?n.talking=!0:n.busy=!0,m.updateBusyCounter(e)}})}),r.on("user:agentcomplete",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&(n.talking?n.talking=!1:n.busy&&(n.busy=!1),m.updateBusyCounter(e))})}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"voice")})}),e.$on("$destroy",function(){r.removeAllListeners("voice_queue:save"),r.removeAllListeners("userVoiceQueue:remove"),r.removeAllListeners("userVoiceQueue:save"),r.removeAllListeners("user:agentconnect"),r.removeAllListeners("user:agentcomplete"),r.removeAllListeners("user:update"),p&&n.cancel(p)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.voice").controller("QueuesVoiceRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){var a=this;switch(a.selectedTab=0,t.current.name){case"app.voice.realtime.agents":a.selectedTab=0;break;case"app.voice.realtime.telephones":a.selectedTab=1;break;case"app.voice.realtime.trunks":a.selectedTab=2;break;case"app.voice.realtime.queues":a.selectedTab=3;break;case"app.voice.realtime.queue_calls":a.selectedTab=4;break;case"app.voice.realtime.abandonedcalls":a.selectedTab=5;break;case"app.voice.realtime.queue_params":a.selectedTab=6;break;case"app.voice.realtime.outbound_calls":a.selectedTab=7;break;default:a.selectedTab=0,t.go("app.voice.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.voice.realtime.agents");break;case 1:t.go("app.voice.realtime.telephones");break;case 2:t.go("app.voice.realtime.trunks");break;case 3:t.go("app.voice.realtime.queues");break;case 4:t.go("app.voice.realtime.queue_calls");break;case 5:t.go("app.voice.realtime.abandonedcalls");break;case 6:t.go("app.voice.realtime.queue_params");break;case 7:t.go("app.voice.realtime.outbound_calls");break;default:t.go("app.voice.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.voice").controller("VoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c){var m=this,u=["fullname","internal","state","status"];function p(){_.forIn(m.telephones,function(e,n){m.rpcTelephones[n]&&_.merge(e,_.pick(m.rpcTelephones[n],u))})}m.count=a.count,m.attributes=["fullname","internal","state","status","address"],m.telephones=a?_.keyBy(a.rows?a.rows:[],"id"):{},m.rpcTelephones=i?_.keyBy(i.rows?i.rows:[],"id"):{},m.userProfile=l,m.userProfileSection=d&&1==d.count?d.rows[0]:null,m.crudPermissions=c.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={fields:"id,fullname,internal",role:"telephone",sort:"-updatedAt",limit:10,page:1},m.statusClass=r.status,m.stateClass=r.state,m.success=h,m.$onInit=p,m.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},m.getTelephones=function(){m.query.offset=(m.query.page-1)*m.query.limit,c.hasRole("admin")?m.promise=s.user.get(m.query,h).$promise:(m.query.id=m.userProfile.id,m.query.section="Telephones",m.promise=s.userProfile.getResources(m.query,h).$promise)},m.onSave=function(e){m.telephones[e.id]&&_.merge(m.telephones[e.id],_.pick(e,u))},o.on("telephone:save",m.onSave);var g=!0,v=1;function h(e){m.telephones=e?_.keyBy(e.rows?e.rows:[],"id"):{},p()}e.$watch("vm.query.filter",function(e,n){g?t(function(){g=!1}):(n||(v=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=v),m.getTelephones())}),e.$on("$destroy",function(){o.removeAllListeners("telephone:save")})}e.$inject=["$scope","$timeout","$mdDialog","telephones","rpcTelephones","api","socket","helperClasses","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TelephonesVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,n=0;n<u.trunks.length;n+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[n].id]))&&_.merge(u.trunks[n],_.pick(u.rpcTrunks[e],p))}function v(e,n,t){0<=n&&_.merge(e[n],_.pick(t,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},u.statusClass=r.status,u.stateClass=r.state,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,n){l.go("app.tools.trunks.edit",{id:n.id})},u.onSave=function(e){var n=_.findIndex(u.trunks,["id",e.id]),t=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,n,e),v(u.rpcTrunks,t,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TrunksVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEMAIL",g.voicemail=angular.copy(l),g.voicemails=r,g.newVoicemail=!1,g.voicemail||(g.voicemail={attach:"no"},g.title="VOICE.NEW_VOICEMAIL",g.newVoicemail=!0),g.addNewVoicemail=function(){g.errors=[],d.voiceMail.save(g.voicemail).$promise.then(function(e){g.voicemails.unshift(e.toJSON()),o.success({title:"Voicemail properly created",msg:g.voicemail.name?g.voicemail.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoicemail=function(){g.errors=[],d.voiceMail.update({id:g.voicemail.id},g.voicemail).$promise.then(function(e){var n=_.find(g.voicemails,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Voicemail properly saved!",msg:g.voicemail.name?g.voicemail.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoicemail=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voicemail will be deleted.").ariaLabel("Delete Voicemail").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMail.delete({id:g.voicemail.id}).$promise.then(function(){_.remove(g.voicemails,{id:g.voicemail.id}),o.success({title:"Voicemail properly deleted!",msg:(g.voicemail.name||"voicemail")+" has been deleted!"}),v(g.voicemail)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicemails","voicemail","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoicemailDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.voicemailMessages=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceMail.getMessages(m.query,u).$promise}function g(e){d.voiceMailMessage.delete({id:e.id}).$promise.then(function(){_.remove(m.voicemailMessages.rows,{id:e.id}),m.voicemailMessages.count-=1,m.voicemailMessages.rows.length||p(),l.success({title:"Message deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMail"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.voicemail={},m.voicemailMessages={count:0,rows:[]},m.selectedVoicemailMessages=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,callerid,duration,audio,stamp,msg_id",sort:"-stamp",limit:10,page:1},m.init=function(e,n){m.voicemail=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.id=m.voicemail.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the message?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("message #")+e.id||"message")+"</b> will be deleted.").ariaLabel("delete message").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.voiceMailMessageDownload=function(s,e,n){return d.voiceMailMessage.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="message"+s.id,a=new Blob(n,{type:e.type});t=s.msg_id+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=u,m.getVoicemailMessages=p,m.createOrEditVoicemailMessage=function(e,n){o.show({controller:"CreateOrEditMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/edit/messages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:m.voicemail,message:n,messages:m.voicemailMessages.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedVoicemailMessages=function(){var e=angular.copy(m.selectedVoicemailMessages);return m.selectedVoicemailMessages=[],e},m.deleteVoicemailMessage=g,m.deleteSelectedVoicemailMessages=function(e){var n=o.confirm().title("Are you sure want to delete the selected messages?").htmlContent("<b>"+m.selectedVoicemailMessages.length+" selected</b> will be deleted.").ariaLabel("delete messages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedVoicemailMessages.forEach(function(e){g(e)}),m.selectedVoicemailMessages=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("VoicemailMessagesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.voicemail=c||e.params.voicemail||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVoicemails=function(){e.go("app.voice.voicemails",{},{reload:"app.voice.voicemails"})},u.saveVoicemail=function(){r.voiceMail.update({id:u.voicemail.id},u.voicemail).$promise.then(function(){l.success({title:"Voicemail updated!",msg:u.voicemail.name?u.voicemail.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.voicemail&&(t=_.find(u.contexts,{name:u.voicemail.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voicemail","userProfileSection"],angular.module("app.voice").controller("VoicemailController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voicemails=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voicemails",f.listOrder="",f.listOrderAsc=null,f.selectedVoicemails=[],f.query={fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,page:1},f.arrayattach=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayenvelope=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydelete=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.voicemails.edit",{id:e.id,voicemail:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voicemail")+"?").htmlContent("<b>"+(e.name||"voicemail")+"</b> will be deleted.").ariaLabel("delete voicemail").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVoicemails=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceMail.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Voicemails",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVoicemail=function(e,n){i.show({controller:"CreateOrEditVoicemailDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:n,voicemails:f.voicemails.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVoicemail=y,f.exportSelectedVoicemails=function(){var e=angular.copy(f.selectedVoicemails);return f.selectedVoicemails=[],e},f.deleteSelectedVoicemails=function(e){var n=i.confirm().title("Are you sure want to delete the selected voicemails?").htmlContent("<b>"+f.selectedVoicemails.length+" selected</b> will be deleted.").ariaLabel("delete Voicemails").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoicemails.forEach(function(e){y(e)}),f.selectedVoicemails=[]})},f.deselectVoicemails=function(){f.selectedVoicemails=[]},f.selectAllVoicemails=function(){f.selectedVoicemails=f.voicemails.rows};var b=!0,A=1;function E(e){f.voicemails=e||{count:0,rows:[]}}function y(e){m.voiceMail.delete({id:e.id}).$promise.then(function(){_.remove(f.voicemails.rows,{id:e.id}),f.voicemails.count-=1,f.voicemails.rows.length||f.getVoicemails(),p.success({title:_.startCase("Voicemail")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMail"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoicemails())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicemails","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoicemailsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEPREFIX",g.voicePrefix=angular.copy(l),g.voicePrefixes=r,g.newvoicePrefix=!1,g.voicePrefix||(g.voicePrefix={},g.title="VOICE.NEW_VOICEPREFIX",g.newvoicePrefix=!0),g.addNewvoicePrefix=function(){g.errors=[],d.voicePrefix.save(g.voicePrefix).$promise.then(function(e){g.voicePrefixes.unshift(e.toJSON()),o.success({title:"voicePrefix properly created",msg:g.voicePrefix.name?g.voicePrefix.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savevoicePrefix=function(){g.errors=[],d.voicePrefix.update({id:g.voicePrefix.id},g.voicePrefix).$promise.then(function(e){var n=_.find(g.voicePrefixes,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"voicePrefix properly saved!",msg:g.voicePrefix.name?g.voicePrefix.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletevoicePrefix=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voicePrefix will be deleted.").ariaLabel("Delete voicePrefix").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voicePrefix.delete({id:g.voicePrefix.id}).$promise.then(function(){_.remove(g.voicePrefixes,{id:g.voicePrefix.id}),o.success({title:"voicePrefix properly deleted!",msg:(g.voicePrefix.name||"voicePrefix")+" has been deleted!"}),v(g.voicePrefix)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.outboundRoutes,{id:e.resourceId})}),t=null;if(g.voicePrefix&&(t=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.outboundRoutes,{id:t.id});a.canSelect=!1,n.push(a)}g.outboundRoutes=n})}else{var t=[],a=null;g.voicePrefix&&(a=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)}));for(var i=0;i<g.outboundRoutes.length;i++)a&&g.outboundRoutes[i].id===a.id&&(g.outboundRoutes[i].canSelect=!1,t.push(g.outboundRoutes[i]));g.outboundRoutes=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicePrefixes","voicePrefix","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditvoicePrefixDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.voicePrefix.getAgents({id:c.voicePrefix.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UservoicePrefix?"penalty "+e.UservoicePrefix.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.voicePrefix=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.removeAgents({id:c.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.addAgents({id:c.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("VOICE.ALL_AGENTS"),labelSelected:r.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","voicePrefixes","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.voicePrefix.getTeams({id:l.voicePrefix.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.voicePrefix=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("VOICE.ALL_TEAMS"),labelSelected:t.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.removeTeams({id:l.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.addTeams({id:l.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voicePrefixes=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voicePrefixes",f.listOrder="",f.listOrderAsc=null,f.selectedVoicePrefixes=[],f.query={fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"voicePrefixagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes?f.voicePrefixes.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.teamadddialog=function(e,n){i.show({controller:"voicePrefixteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes?f.voicePrefixes.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voicePrefix")+"?").htmlContent("<b>"+(e.name||"voicePrefix")+"</b> will be deleted.").ariaLabel("delete voicePrefix").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVoicePrefixes=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voicePrefix.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VoicePrefixes",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditvoicePrefix=function(e,n){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicePrefix:n,voicePrefixes:f.voicePrefixes.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletevoicePrefix=y,f.exportSelectedVoicePrefixes=function(){var e=angular.copy(f.selectedVoicePrefixes);return f.selectedVoicePrefixes=[],e},f.deleteSelectedVoicePrefixes=function(e){var n=i.confirm().title("Are you sure want to delete the selected voicePrefixes?").htmlContent("<b>"+f.selectedVoicePrefixes.length+" selected</b> will be deleted.").ariaLabel("delete voicePrefixs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoicePrefixes.forEach(function(e){y(e)}),f.selectedVoicePrefixes=[]})},f.deselectVoicePrefixes=function(){f.selectedVoicePrefixes=[]},f.selectAllVoicePrefixes=function(){f.selectedVoicePrefixes=f.voicePrefixes.rows},g.hasRole("admin")?m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){f.outboundRoutes=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){f.outboundRoutes=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.outboundRoutes,{id:e.resourceId})}),t=null;if(f.voicePrefix&&(t=_.find(f.outboundRoutes,{id:Number(f.voicePrefix.VoiceExtensionId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.outboundRoutes,{id:t.id});a.canSelect=!1,n.push(a)}f.outboundRoutes=n})}else{var t=[],a=null;f.voicePrefix&&(a=_.find(f.outboundRoutes,{id:Number(f.voicePrefix.VoiceExtensionId)}));for(var i=0;i<f.outboundRoutes.length;i++)a&&f.outboundRoutes[i].id===a.id&&(f.outboundRoutes[i].canSelect=!1,t.push(f.outboundRoutes[i]));f.outboundRoutes=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.voicePrefixes=e||{count:0,rows:[]}}function y(e){m.voicePrefix.delete({id:e.id}).$promise.then(function(){_.remove(f.voicePrefixes.rows,{id:e.id}),f.voicePrefixes.count-=1,f.voicePrefixes.rows.length||f.getVoicePrefixes(),p.success({title:_.startCase("voicePrefix")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoicePrefix"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoicePrefix",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoicePrefixes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicePrefixes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoicePrefixesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEQUEUE",g.voiceQueue=angular.copy(l),g.voiceQueues=r,g.newVoiceQueue=!1,g.voiceQueue||(g.voiceQueue={type:"inbound",strategy:"ringall",timeout:15,retry:2,random_periodic_announce:"no",announce_holdtime:"no",announce_position:"no",reportholdtime:"no",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no"},g.title="VOICE.NEW_VOICEQUEUE",g.newVoiceQueue=!0),g.addNewVoiceQueue=function(){g.errors=[],d.voiceQueue.save(g.voiceQueue).$promise.then(function(e){g.voiceQueues.unshift(e.toJSON()),o.success({title:"VoiceQueue properly created",msg:g.voiceQueue.name?g.voiceQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceQueue=function(){g.errors=[],d.voiceQueue.update({id:g.voiceQueue.id},g.voiceQueue).$promise.then(function(e){var n=_.find(g.voiceQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VoiceQueue properly saved!",msg:g.voiceQueue.name?g.voiceQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voiceQueue will be deleted.").ariaLabel("Delete VoiceQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceQueue.delete({id:g.voiceQueue.id}).$promise.then(function(){_.remove(g.voiceQueues,{id:g.voiceQueue.id}),o.success({title:"VoiceQueue properly deleted!",msg:(g.voiceQueue.name||"voiceQueue")+" has been deleted!"}),v(g.voiceQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceQueues","voiceQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceQueueDialogController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.voiceQueue.getAgents({id:c.voiceQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.voiceQueue=n,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.voiceQueue.removeAgents({id:c.voiceQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else{for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.voiceQueue.addAgents({id:c.voiceQueue.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("VOICE.ALL_AGENTS"),labelSelected:s.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","voiceQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueagentaddController",e)}(),function(){"use strict";function e(e,i,a,s,n,t,o,r){var l=this;function d(){return i(function(t,n){return i(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:i(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),i(function(n,t){return s.voiceQueue.getTeams({id:l.voiceQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.voiceQueue=n,l.crudPermissions=r,l.penalty=0,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"penalty",labelAll:t.instant("VOICE.ALL_TEAMS"),labelSelected:t.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+l.penalty});var t=_.xorWith(l.startingSelectedItems,l.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):i(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceWith(l.selectedItems,l.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,i(function(e,n){_.isEmpty(t)?e():s.voiceQueue.removeTeams({id:l.voiceQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return a=n,i(function(e,n){if(!_.isEmpty(a)){var t=_.map(a,function(e){return{id:e.id,penalty:_.trim(e.penalty,"penalty ")}});return s.voiceQueue.addTeams({id:l.voiceQueue.id,teams:t}).$promise.then(function(){e()}).catch(function(e){n(e)})}e()});var a}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueteamaddController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.voiceQueue=c||t.params.voiceQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.teamadddialog=function(e,n){a.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.queues",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.queues",{})}},u.alert=l.info,u.gotoVoiceQueues=function(){t.go("app.voice.voiceQueues",{},{reload:"app.voice.voiceQueues"})},u.saveVoiceQueue=function(){r.voiceQueue.update({id:u.voiceQueue.id},u.voiceQueue).$promise.then(function(){l.success({title:"VoiceQueue updated!",msg:u.voiceQueue.name?u.voiceQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),t=null;if(u.voiceQueue&&(t=_.find(u.musiconholds,{name:u.voiceQueue.musiconhold})),t&&!_.some(n,["id",t.id])){var a=_.find(u.musiconholds,{id:t.id});a.canSelect=!1,n.push(a)}u.musiconholds=n}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.sounds,{id:e.resourceId})});u.sounds.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.sounds=n})}else u.sounds=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.pauses=n})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceQueue","userProfileSection"],angular.module("app.voice").controller("VoiceQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voiceQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voiceQueues",f.listOrder="",f.listOrderAsc=null,f.selectedVoiceQueues=[],f.query={fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Ringall",value:"'ringall'"},{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Least Recent",value:"'leastrecent'"},{option:"Fewest Calls",value:"'fewestcalls'"},{option:"Random",value:"'random'"},{option:"Linear",value:"'linear'"},{option:"Weight Random",value:"'wrandom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayjoinempty=_.keyBy([{option:"no",value:"'no'",disabled:"vm.voiceQueue.joinempty.length === 1  && vm.voiceQueue.joinempty[0] === 'no'"},{option:"yes",value:"'yes'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'yes'"},{option:"strict",value:"'strict'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'strict'"},{option:"loose",value:"'loose'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'loose'"},{option:"paused",value:"'paused'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'paused'"},{option:"penalty",value:"'penalty'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'penalty'"},{option:"inuse",value:"'inuse'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'inuse'"},{option:"ringing",value:"'ringing'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'ringing'"},{option:"unavailable",value:"'unavailable'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'unavailable'"},{option:"invalid",value:"'invalid'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'invalid'"},{option:"unknown",value:"'unknown'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'unknown'"},{option:"wrapup",value:"'wrapup'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayleavewhenempty=_.keyBy([{option:"no",value:"'no'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'no'"},{option:"yes",value:"'yes'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'yes'"},{option:"strict",value:"'strict'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'strict'"},{option:"loose",value:"'loose'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'loose'"},{option:"paused",value:"'paused'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'paused'"},{option:"penalty",value:"'penalty'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'penalty'"},{option:"inuse",value:"'inuse'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'inuse'"},{option:"ringing",value:"'ringing'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'ringing'"},{option:"unavailable",value:"'unavailable'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'unavailable'"},{option:"invalid",value:"'invalid'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'invalid'"},{option:"unknown",value:"'unknown'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'unknown'"},{option:"wrapup",value:"'wrapup'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayrandom_periodic_announce=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayannounce_holdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Once",value:"'once'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayannounce_position=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Limit",value:"'limit'"},{option:"More",value:"'more'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayreportholdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.voiceQueues.edit",{id:e.id,voiceQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:f.voiceQueues?f.voiceQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:f.voiceQueues?f.voiceQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceQueue")+"?").htmlContent("<b>"+(e.name||"voiceQueue")+"</b> will be deleted.").ariaLabel("delete voiceQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.queues",{})}},f.success=E,f.getVoiceQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VoiceQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVoiceQueue=function(e,n){i.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:n,voiceQueues:f.voiceQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVoiceQueue=y,f.exportSelectedVoiceQueues=function(){var e=angular.copy(f.selectedVoiceQueues);return f.selectedVoiceQueues=[],e},f.deleteSelectedVoiceQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected voiceQueues?").htmlContent("<b>"+f.selectedVoiceQueues.length+" selected</b> will be deleted.").ariaLabel("delete VoiceQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoiceQueues.forEach(function(e){y(e)}),f.selectedVoiceQueues=[]})},f.deselectVoiceQueues=function(){f.selectedVoiceQueues=[]},f.selectAllVoiceQueues=function(){f.selectedVoiceQueues=f.voiceQueues.rows};var b=!0,A=1;function E(e){f.voiceQueues=e||{count:0,rows:[]}}function y(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.voiceQueues.rows,{id:e.id}),f.voiceQueues.count-=1,f.voiceQueues.rows.length||f.getVoiceQueues(),p.success({title:_.startCase("VoiceQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoiceQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoiceQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICERECORDING",g.voiceRecording=angular.copy(l),g.voiceRecordings=r,g.newVoiceRecording=!1,g.voiceRecording||(g.voiceRecording={},g.title="VOICE.NEW_VOICERECORDING",g.newVoiceRecording=!0),g.addNewVoiceRecording=function(){g.errors=[],d.voiceRecording.save(g.voiceRecording).$promise.then(function(e){g.voiceRecordings.unshift(e.toJSON()),o.success({title:"VoiceRecording properly created",msg:g.voiceRecording.name?g.voiceRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceRecording=function(){g.errors=[],d.voiceRecording.update({id:g.voiceRecording.id},g.voiceRecording).$promise.then(function(e){var n=_.find(g.voiceRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VoiceRecording properly saved!",msg:g.voiceRecording.name?g.voiceRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voiceRecording will be deleted.").ariaLabel("Delete VoiceRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceRecording.delete({id:g.voiceRecording.id}).$promise.then(function(){_.remove(g.voiceRecordings,{id:g.voiceRecording.id}),o.success({title:"VoiceRecording properly deleted!",msg:(g.voiceRecording.name||"voiceRecording")+" has been deleted!"}),v(g.voiceRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceRecordings","voiceRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceRecordingDialogController",e)}(),function(){"use strict";function e(e,n){var t=this;t.voiceRecording={},t.init=function(e){t.voiceRecording=e}}e.$inject=["api","toasty"],angular.module("app.voice").controller("VoiceRecordingSentimentStatisticsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.voiceRecording=c||e.params.voiceRecording||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.alert=l.info,p.gotoVoiceRecordings=function(){e.go("app.voice.voiceRecordings",{},{reload:"app.voice.voiceRecordings"})},p.saveVoiceRecording=function(){r.voiceRecording.update({id:p.voiceRecording.id},p.voiceRecording).$promise.then(function(){l.success({title:"VoiceRecording updated!",msg:p.voiceRecording.name?p.voiceRecording.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceRecording","userProfile","userProfileSection"],angular.module("app.voice").controller("VoiceRecordingController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,l,r,d,c,m,u,p,g,v,h,f){var b=this;function A(n,e){return m.voiceRecording.runTranscribe({id:n.id,runSentiment:!1}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING"),msg:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING")+" succeded!"}),n.transcribeStatus=e.transcribeStatus}).catch(function(e){p.error({title:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}function E(n,e){return m.voiceRecording.runTranscribe({id:n.id,runSentiment:!0}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING"),msg:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING")+" succeded!"}),n.transcribeStatus=e.transcribeStatus}).catch(function(e){p.error({title:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}function y(e,n){return m.voiceRecording.runTranscribe({id:e.id,runSentiment:!0}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING"),msg:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING")+" succeded!"})}).catch(function(e){p.error({title:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voiceRecordings=r||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voiceRecordings",b.listOrder="",b.listOrderAsc=null,b.selectedVoiceRecordings=[],b.query={fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:"@msUtils.firstLastDayMonth()",limit:10,page:1},b.query.createdAt=u.firstLastDayMonth(),b.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE_RANGE"}],b.editstate=function(e,n){t.go("app.voice.voiceRecordings.edit",{id:e.id,voiceRecording:e,crudPermissions:b.crudPermissions})},b.runtranscriberuntranscribesentiment=A,b.runtranscribesentimentruntranscribesentiment=E,b.runsentimentruntranscribesentiment=y,b.downloadtranscribefile2=function(s,e){var t=!1,n=_.isNil(s.format)?s.value.substring(s.value.lastIndexOf(".")):s.format;t=".mp4"===n;-1<s.value.lastIndexOf("/")?s.value.substring(s.value.lastIndexOf("/")+1):-1<s.value.lastIndexOf("\\")?s.value.substring(s.value.lastIndexOf("\\")+1):s.value;return m.voiceRecording.downloadTranscribe({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid+".txt";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.downloadfile2=function(r,e){var t=!1,n=_.isNil(r.format)?r.value.substring(r.value.lastIndexOf(".")):r.format;t=".mp4"===n;-1<r.value.lastIndexOf("/")?r.value.substring(r.value.lastIndexOf("/")+1):-1<r.value.lastIndexOf("\\")?r.value.substring(r.value.lastIndexOf("\\")+1):r.value;return m.voiceRecording.download({id:r.id}).$promise.then(function(e){var n,t,a=[e.buffer],i="download",s=new Blob(a,{type:e.type});n=r.value,t=-1<n.lastIndexOf("/")?n.substring(n.lastIndexOf("/")+1):-1<n.lastIndexOf("\\")?n.substring(n.lastIndexOf("\\")+1):n,i=(t=t.substring(0,t.lastIndexOf(".")))+r.format;var o=window.document.createElement("a");o.setAttribute("href",URL.createObjectURL(s)),o.setAttribute("download",i),document.body.appendChild(o),o.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceRecording")+"?").htmlContent("<b>"+(e.name||"voiceRecording")+"</b> will be deleted.").ariaLabel("delete voiceRecording").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){O(e)},function(){console.log("CANCEL")})},b.success=I,b.getVoiceRecordings=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceRecording.get(b.query,I).$promise:(b.query.id=b.userProfile.id,b.query.section="VoiceRecordings",b.promise=m.userProfile.getResources(b.query,I).$promise)},b.createOrEditVoiceRecording=function(e,n){i.show({controller:"CreateOrEditVoiceRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceRecording:n,voiceRecordings:b.voiceRecordings.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoiceRecording=O,b.exportSelectedVoiceRecordings=function(){var e=angular.copy(b.selectedVoiceRecordings);b.selectedVoiceRecordings=[],b.userProfile.privacyEnabled&&_.forEach(e,function(e){e.calleridnum=f.mask(e.calleridnum),e.exten=f.mask(e.exten),e.connectedlinenum=f.mask(e.connectedlinenum),e.membername=f.mask(e.membername)});return e},b.deleteSelectedVoiceRecordings=function(e){var n=i.confirm().title("Are you sure want to delete the selected voiceRecordings?").htmlContent("<b>"+b.selectedVoiceRecordings.length+" selected</b> will be deleted.").ariaLabel("delete VoiceRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){b.selectedVoiceRecordings.forEach(function(e){O(e)}),b.selectedVoiceRecordings=[]})},b.deselectVoiceRecordings=function(){b.selectedVoiceRecordings=[]},b.selectAllVoiceRecordings=function(){b.selectedVoiceRecordings=b.voiceRecordings.rows},b.runtranscribeSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){A(e,n)}),b.selectedVoiceRecordings=[]},b.runtranscribesentimentSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){E(e,n)}),b.selectedVoiceRecordings=[]},b.runsentimentSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){y(e,n)}),b.selectedVoiceRecordings=[]};var S=!0,T=1;function I(e){b.voiceRecordings=e||{count:0,rows:[]}}function O(e){m.voiceRecording.delete({id:e.id}).$promise.then(function(){_.remove(b.voiceRecordings.rows,{id:e.id}),b.voiceRecordings.count-=1,b.voiceRecordings.rows.length||b.getVoiceRecordings(),p.success({title:_.startCase("VoiceRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){S?o(function(){S=!1}):(n||(T=b.query.page),e!==n&&(b.query.page=1),e||(b.query.page=T),b.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","privacyManager"],angular.module("app.voice").controller("VoiceRecordingsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","paused"],g=n(function(){},999);u.currentUser=c.getCurrentUser(),u.queues=s,u.userProfileSection=d&&1==d.count?d.rows[0]:null,u.crudPermissions=c.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={id:c.isUser()?u.currentUser.id:void 0,section:c.isUser()?"WhatsappQueues":void 0,channel:"whatsapp",sort:"name",limit:10,page:1},u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,o.realtime.getQueues(u.query).$promise.then(function(e){u.queues=e}).catch(function(e){l.error({title:i.instant("WHATSAPP.WHATSAPPQUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},u.editQueue=function(e,n){t.show({controller:"CreateOrEditWhatsappQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappQueue:n,whatsappQueues:u.queues.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},u.addAgent=function(e,n){t.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappQueue:n,whatsappQueues:u.queues.rows,realtime:!1,crudPermissions:u.crudPermissions}})},r.on("whatsapp_queue:save",function(e){var n=_.find(u.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,p))}),r.on("userWhatsappQueue:save",function(e){var n=_.find(u.queues.rows,["id",e.WhatsappQueueId]);n&&(n.loggedInDb++,n.agents.push({id:e.UserId}))}),r.on("userWhatsappQueue:remove",function(e){var n=_.find(u.queues.rows,["id",e.WhatsappQueueId]);n&&(0<n.loggedInDb&&n.loggedInDb--,_.remove(n.agents,["id",e.UserId]))}),r.on("user:update",function(t){u.queues.rows.forEach(function(e){var n=_.find(e.agents,["id",t.id]);n&&m.updateQueue(t,e,n,"whatsapp")})}),e.$on("$destroy",function(){r.removeAllListeners("whatsapp_queue:save"),r.removeAllListeners("userWhatsappQueue:remove"),r.removeAllListeners("userWhatsappQueue:save"),r.removeAllListeners("user:update"),g&&n.cancel(g)})}e.$inject=["$scope","$mdDialog","$document","$interval","$translate","queues","api","socket","toasty","userProfileSection","Auth","realtimeManager"],angular.module("app.whatsapp").controller("QueuesWhatsappRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.whatsapp.realtime.agents":this.selectedTab=0;break;case"app.whatsapp.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.whatsapp.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.whatsapp.realtime.agents");break;case 1:t.go("app.whatsapp.realtime.queues");break;default:t.go("app.whatsapp.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.whatsapp").controller("WhatsappRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){"twilio"===g.whatsappAccount.type&&(g.whatsappAccount.baseUrl=null)}function h(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPACCOUNT",g.whatsappAccount=angular.copy(l),g.whatsappAccounts=r,g.newWhatsappAccount=!1,g.whatsappAccount||(g.whatsappAccount={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),type:"twilio",notificationSound:!0,queueTransferTimeout:300,waitForTheAssignedAgent:10,agentTransferTimeout:300},g.title="WHATSAPP.NEW_WHATSAPPACCOUNT",g.newWhatsappAccount=!0),n.params.id&&(g.whatsappAccount.WhatsappAccountId=n.params.id),g.addNewWhatsappAccount=function(){g.errors=[],v(),d.whatsappAccount.save(g.whatsappAccount).$promise.then(function(e){g.whatsappAccounts.unshift(e.toJSON()),o.success({title:"WhatsappAccount properly created",msg:g.whatsappAccount.name?g.whatsappAccount.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappAccount=function(){g.errors=[],v(),d.whatsappAccount.update({id:g.whatsappAccount.id},g.whatsappAccount).$promise.then(function(e){var n=_.find(g.whatsappAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappAccount properly saved!",msg:g.whatsappAccount.name?g.whatsappAccount.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappAccount will be deleted.").ariaLabel("Delete WhatsappAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.whatsappAccount.delete({id:g.whatsappAccount.id}).$promise.then(function(){_.remove(g.whatsappAccounts,{id:g.whatsappAccount.id}),o.success({title:"WhatsappAccount properly deleted!",msg:(g.whatsappAccount.name||"whatsappAccount")+" has been deleted!"}),h(g.whatsappAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=h,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.whatsappAccount&&(t=_.find(g.lists,{id:Number(g.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.whatsappAccount&&(a=_.find(g.lists,{id:Number(g.whatsappAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){g.pauses=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){g.pauses=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.pauses,{id:e.resourceId})});g.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.pauses=n})}else g.pauses=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappAccounts","whatsappAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.whatsappAccountApps.rows.length){var t=r.whatsappAccountApps.rows[n]?r.whatsappAccountApps.rows[n]:r.whatsappAccountApps.rows[0];i.show({controller:"EditWhatsappAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccountApp:t,whatsappAccount:r.whatsappAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.whatsappAccountApps.rows[n]=e:r.whatsappAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.whatsappAccountApps.rows.length;t++,0){var a=r.whatsappAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.whatsappAccount.context,a.exten=r.whatsappAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.whatsappAccount.addApplications({id:r.whatsappAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.whatsappAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.whatsappAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.whatsappAccount={},r.whatsappAccountApps={count:0,rows:[]},r.selectedWhatsappAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"WhatsappQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"whatsappQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:2102}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.whatsappAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getWhatsappAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.whatsappAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getWhatsappAccountApps=function(){r.promise=o.whatsappAccount.getApplications(r.query,t).$promise},r.editWhatsappAccountApp=n,r.editInterval=function(e,n){if(r.whatsappAccountApps.rows.length){var t=r.whatsappAccountApps.rows[n]?r.whatsappAccountApps.rows[n]:r.whatsappAccountApps.rows[0];i.show({controller:"EditWhatsappAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteWhatsappAccountApp=function(e){_.remove(r.whatsappAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedWhatsappAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedWhatsappAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedWhatsappAccountApps.forEach(function(e){_.remove(r.whatsappAccountApps.rows,{id:e.id})}),r.selectedWhatsappAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappAccount.getAgents({id:c.whatsappAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserWhatsappAccount?"penalty "+e.UserWhatsappAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.whatsappAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappAccount.removeAgents({id:c.whatsappAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappAccount.addAgents({id:c.whatsappAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("WHATSAPP.ALL_AGENTS"),labelSelected:r.instant("WHATSAPP.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","whatsappAccount","whatsappAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditWhatsappAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("whatsapp")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.whatsappQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.whatsappQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:2102}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"whatsappAccount",action:"getDispositions",field:"name",params:{id:m.whatsappAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.whatsappAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.whatsappAccountInteractions.rows.length;n+=1){var t=m.whatsappAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.whatsappInteraction.get(m.query,p).$promise}function v(e){d.whatsappInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.whatsappAccountInteractions.rows,{id:e.id}),m.whatsappAccountInteractions.count-=1,m.whatsappAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.whatsappAccount={},m.whatsappAccountInteractions={count:0,rows:[]},m.selectedWhatsappAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.whatsappAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.WhatsappAccountId=m.whatsappAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.whatsappInteractionDownload=function(s,e,n){return d.whatsappInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="whatsapp-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getWhatsappAccountInteractions=g,m.createOrEditWhatsappAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:m.whatsappAccount,interaction:n,interactions:m.whatsappAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spywhatsappInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"whatsapp",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"whatsapp.whatsappAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||WhatsappAccountId:=$eq["+m.whatsappAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedWhatsappAccountInteractions=function(){var e=angular.copy(m.selectedWhatsappAccountInteractions);return m.selectedWhatsappAccountInteractions=[],e},m.deleteWhatsappAccountInteraction=v,m.deleteSelectedWhatsappAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedWhatsappAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedWhatsappAccountInteractions.forEach(function(e){v(e)}),m.selectedWhatsappAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.whatsappAccount=c||e.params.whatsappAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.baseUrl=[{name:"US Production",url:"https://us1.whatsapp.api.sinch.com"},{name:"EU Production",url:"https://eu1.whatsapp.api.sinch.com"}],p.agentadddialog=function(e,n){t.show({controller:"WhatsappAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappAccount:e,whatsappAccounts:p.whatsappAccounts?p.whatsappAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoWhatsappAccounts=function(){e.go("app.whatsapp.whatsappAccounts",{},{reload:"app.whatsapp.whatsappAccounts"})},p.saveWhatsappAccount=function(){"twilio"===p.whatsappAccount.type&&(p.whatsappAccount.baseUrl=null);r.whatsappAccount.update({id:p.whatsappAccount.id},p.whatsappAccount).$promise.then(function(){l.success({title:"WhatsappAccount updated!",msg:p.whatsappAccount.name?p.whatsappAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.whatsappAccount&&(t=_.find(p.lists,{id:Number(p.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.whatsappAccount&&(a=_.find(p.lists,{id:Number(p.whatsappAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","whatsappAccount","userProfile","userProfileSection"],angular.module("app.whatsapp").controller("WhatsappAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.whatsappAccountWhatsappCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.whatsappAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.whatsappAccountWhatsappCannedAnswers.rows,{id:e.id}),m.whatsappAccountWhatsappCannedAnswers.count-=1,m.whatsappAccountWhatsappCannedAnswers.rows.length||p(),l.success({title:"WhatsappCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.whatsappAccount={},m.whatsappAccountWhatsappCannedAnswers={count:0,rows:[]},m.selectedWhatsappAccountWhatsappCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.whatsappAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.WhatsappAccountId=m.whatsappAccount.id,m.query.id=m.whatsappAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the whatsappCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("whatsappCannedAnswer #")+e.id||"whatsappCannedAnswer")+"</b> will be deleted.").ariaLabel("delete whatsappCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getWhatsappAccountWhatsappCannedAnswers=p,m.createOrEditWhatsappAccountWhatsappCannedAnswer=function(e,n){o.show({controller:"CreateOrEditWhatsappCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/whatsappCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:m.whatsappAccount,whatsappCannedAnswer:n,whatsappCannedAnswers:m.whatsappAccountWhatsappCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedWhatsappAccountWhatsappCannedAnswers=function(){var e=angular.copy(m.selectedWhatsappAccountWhatsappCannedAnswers);return m.selectedWhatsappAccountWhatsappCannedAnswers=[],e},m.deleteWhatsappAccountWhatsappCannedAnswer=g,m.deleteSelectedWhatsappAccountWhatsappCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected whatsappCannedAnswers?").htmlContent("<b>"+m.selectedWhatsappAccountWhatsappCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete whatsappCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedWhatsappAccountWhatsappCannedAnswers.forEach(function(e){g(e)}),m.selectedWhatsappAccountWhatsappCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountWhatsappCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPCANNEDANSWER",g.whatsappCannedAnswer=angular.copy(l),g.whatsappCannedAnswers=r,g.newWhatsappCannedAnswer=!1,g.whatsappCannedAnswer||(g.whatsappCannedAnswer={},g.title="WHATSAPP.NEW_WHATSAPPCANNEDANSWER",g.newWhatsappCannedAnswer=!0),n.params.id&&(g.whatsappCannedAnswer.WhatsappAccountId=n.params.id),g.addNewWhatsappCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.whatsappCannedAnswer).$promise.then(function(e){g.whatsappCannedAnswers.unshift(e.toJSON()),o.success({title:"WhatsappCannedAnswer properly created",msg:g.whatsappCannedAnswer.name?g.whatsappCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.whatsappCannedAnswer.id},g.whatsappCannedAnswer).$promise.then(function(e){var n=_.find(g.whatsappCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappCannedAnswer properly saved!",msg:g.whatsappCannedAnswer.name?g.whatsappCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappCannedAnswer will be deleted.").ariaLabel("Delete WhatsappCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.whatsappCannedAnswer.id}).$promise.then(function(){_.remove(g.whatsappCannedAnswers,{id:g.whatsappCannedAnswer.id}),o.success({title:"WhatsappCannedAnswer properly deleted!",msg:(g.whatsappCannedAnswer.name||"whatsappCannedAnswer")+" has been deleted!"}),v(g.whatsappCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappCannedAnswers","whatsappCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.whatsappAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.whatsappAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.WhatsappAccountId=m.whatsappAccount.id,m.query.id=m.whatsappAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.whatsappAccount.id,field:"WhatsappAccountId",route:"whatsappAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.whatsappAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="whatsappAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedWhatsappAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Sinch",value:"'sinch'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.whatsapp.whatsappAccounts.edit",{id:e.id,whatsappAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.whatsapp.whatsappAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"WhatsappAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappAccount:e,whatsappAccounts:f.whatsappAccounts?f.whatsappAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("whatsappAccount")+"?").htmlContent("<b>"+(e.name||"whatsappAccount")+"</b> will be deleted.").ariaLabel("delete whatsappAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getWhatsappAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.whatsappAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="WhatsappAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditWhatsappAccount=function(e,n){i.show({controller:"CreateOrEditWhatsappAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:n,whatsappAccounts:f.whatsappAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteWhatsappAccount=y,f.exportSelectedWhatsappAccounts=function(){var e=angular.copy(f.selectedWhatsappAccounts);return f.selectedWhatsappAccounts=[],e},f.deleteSelectedWhatsappAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected whatsappAccounts?").htmlContent("<b>"+f.selectedWhatsappAccounts.length+" selected</b> will be deleted.").ariaLabel("delete WhatsappAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedWhatsappAccounts.forEach(function(e){y(e)}),f.selectedWhatsappAccounts=[]})},f.deselectWhatsappAccounts=function(){f.selectedWhatsappAccounts=[]},f.selectAllWhatsappAccounts=function(){f.selectedWhatsappAccounts=f.whatsappAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.whatsappAccount&&(t=_.find(f.lists,{id:Number(f.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.whatsappAccount&&(a=_.find(f.lists,{id:Number(f.whatsappAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){f.pauses=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){f.pauses=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.pauses,{id:e.resourceId})});f.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),f.pauses=n})}else f.pauses=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.whatsappAccounts=e||{count:0,rows:[]}}function y(e){m.whatsappAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.whatsappAccounts.rows,{id:e.id}),f.whatsappAccounts.count-=1,f.whatsappAccounts.rows.length||f.getWhatsappAccounts(),p.success({title:_.startCase("WhatsappAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getWhatsappAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","whatsappAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.whatsapp").controller("WhatsappAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPQUEUE",g.whatsappQueue=angular.copy(l),g.whatsappQueues=r,g.newWhatsappQueue=!1,g.whatsappQueue||(g.whatsappQueue={strategy:"beepall",timeout:10},g.title="WHATSAPP.NEW_WHATSAPPQUEUE",g.newWhatsappQueue=!0),g.addNewWhatsappQueue=function(){g.errors=[],d.whatsappQueue.save(g.whatsappQueue).$promise.then(function(e){g.whatsappQueues.unshift(e.toJSON()),o.success({title:"WhatsappQueue properly created",msg:g.whatsappQueue.name?g.whatsappQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappQueue=function(){g.errors=[],d.whatsappQueue.update({id:g.whatsappQueue.id},g.whatsappQueue).$promise.then(function(e){var n=_.find(g.whatsappQueues,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappQueue properly saved!",msg:g.whatsappQueue.name?g.whatsappQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappQueue=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappQueue will be deleted.").ariaLabel("Delete WhatsappQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.whatsappQueue.delete({id:g.whatsappQueue.id}).$promise.then(function(){_.remove(g.whatsappQueues,{id:g.whatsappQueue.id}),o.success({title:"WhatsappQueue properly deleted!",msg:(g.whatsappQueue.name||"whatsappQueue")+" has been deleted!"}),v(g.whatsappQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappQueues","whatsappQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappQueue.getAgents({id:c.whatsappQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserWhatsappQueue?"penalty "+e.UserWhatsappQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.whatsappQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.removeAgents({id:c.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.addAgents({id:c.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("WHATSAPP.ALL_AGENTS"),labelSelected:r.instant("WHATSAPP.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","whatsappQueue","whatsappQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappQueue.getTeams({id:l.whatsappQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.whatsappQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("WHATSAPP.ALL_TEAMS"),labelSelected:t.instant("WHATSAPP.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.removeTeams({id:l.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.addTeams({id:l.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","whatsappQueue","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.whatsappQueue=c||e.params.whatsappQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"WhatsappQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:u.whatsappQueues?u.whatsappQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:u.whatsappQueues?u.whatsappQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoWhatsappQueues=function(){e.go("app.whatsapp.whatsappQueues",{},{reload:"app.whatsapp.whatsappQueues"})},u.saveWhatsappQueue=function(){r.whatsappQueue.update({id:u.whatsappQueue.id},u.whatsappQueue).$promise.then(function(){l.success({title:"WhatsappQueue updated!",msg:u.whatsappQueue.name?u.whatsappQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","whatsappQueue","userProfileSection"],angular.module("app.whatsapp").controller("WhatsappQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.whatsappQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="whatsappQueues",f.listOrder="",f.listOrderAsc=null,f.selectedWhatsappQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.whatsapp.whatsappQueues.edit",{id:e.id,whatsappQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"WhatsappQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:f.whatsappQueues?f.whatsappQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:f.whatsappQueues?f.whatsappQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("whatsappQueue")+"?").htmlContent("<b>"+(e.name||"whatsappQueue")+"</b> will be deleted.").ariaLabel("delete whatsappQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:2110}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.whatsapp.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.whatsapp.realtime.queues",{})}},f.success=E,f.getWhatsappQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.whatsappQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="WhatsappQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditWhatsappQueue=function(e,n){i.show({controller:"CreateOrEditWhatsappQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappQueue:n,whatsappQueues:f.whatsappQueues.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteWhatsappQueue=y,f.exportSelectedWhatsappQueues=function(){var e=angular.copy(f.selectedWhatsappQueues);return f.selectedWhatsappQueues=[],e},f.deleteSelectedWhatsappQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected whatsappQueues?").htmlContent("<b>"+f.selectedWhatsappQueues.length+" selected</b> will be deleted.").ariaLabel("delete WhatsappQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedWhatsappQueues.forEach(function(e){y(e)}),f.selectedWhatsappQueues=[]})},f.deselectWhatsappQueues=function(){f.selectedWhatsappQueues=[]},f.selectAllWhatsappQueues=function(){f.selectedWhatsappQueues=f.whatsappQueues.rows};var b=!0,A=1;function E(e){f.whatsappQueues=e||{count:0,rows:[]}}function y(e){m.whatsappQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.whatsappQueues.rows,{id:e.id}),f.whatsappQueues.count-=1,f.whatsappQueues.rows.length||f.getWhatsappQueues(),p.success({title:_.startCase("WhatsappQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEwhatsappQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEwhatsappQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getWhatsappQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","whatsappQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.whatsapp").controller("WhatsappQueuesController",e)}(),function(){"use strict";function e(n,t,e,a,o,i,s,r,l,d,c,m,u){var p=this;function g(e,n){return{id:e,title:n.name||"NONAME",state:"app.dashboards.custom",stateParams:n,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(e)&&!r.hasRole("admin")}}}function v(e,n){return{id:e,title:n.name||"NONAME",state:"app.plugins.plugin",stateParams:n,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(e)&&!r.hasRole("admin")}}}function h(e,n){var t={user:_.pick(r.getCurrentUser(),["id","name","fullname","email","role","internal","interface"])};n.agentUrl=Mustache.render(n.agentUrl,t),i.saveItem("apps.home.plugin_"+e,{id:e,title:n.name,translate:n.name,state:"plugin_"+n.id,stateParams:n,view:"plugin",icon:n.icon,weight:12,hidden:function(){return!r.hasPermission(e)}})}function f(e){return _.map(e.children,function(e){return e.id})}s.clear(),p.isAgent=function(){return r.getCurrentUser()&&r.hasRole("agent")},o.saveItem("apps",{title:"APPS",group:!0,weight:1,hidden:function(){return r.hasRole("agent")}}),d.version.get().$promise.then(function(e){p.version=e&&e.current?e.current:"UNKNOWN"}).catch(function(){p.version="UNKNOWN"}).finally(function(){o.saveItem("version",{title:"VERSION "+p.version,group:!0,weight:2,hidden:function(){return r.hasRole("agent")}})}),r.isLoggedIn()&&(null===m.userSettings&&m.getUserSettingForUser(),l.gray&&s.warning({msg:e.instant("DASHBOARDS.LICENSE_EXPIRE_REMAINING_DAYS"),showClose:!0,timeout:!1}),d.dashboard.get().$promise.then(function(e){for(var n=0,t=0;t<e.rows.length;t+=1)n=99999+e.rows[t].id,o.saveItem("apps.dashboards.custom_"+n,g(n,e.rows[t]))}),d.plugin.get({active:!0}).$promise.then(function(e){var n=0;if(e.count){var t=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"agentOnly"!=e.sidebar});if(0<t.length){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",permissions:{hidden:!0},weight:17,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}});for(var a=0;a<t.length;a+=1)n=88888+t[a].id,o.saveItem("apps.plugins.plugin_"+n,v(n,t[a]));o.sort()}var i=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"adminOnly"!=e.sidebar});if(0<i.length)for(var s=0;s<i.length;s+=1)h(n=88888+i[s].id,i[s])}})),l.custom&&!c.defaultPageTitle&&c.pageTitle&&angular.element("#pageTitle").html(c.pageTitle),o.saveItem("apps.dashboards",{id:100,title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",icon:"icon-tile-four",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.dashboards.general",{id:101,title:"General",route:"",translate:"DASHBOARDS.GENERAL",state:"app.dashboards.general",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(101)&&!r.hasRole("admin")}}),o.saveItem("apps.staff",{id:200,title:"Staff",translate:"STAFF.STAFF",icon:"icon-account-multiple",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.staff.users",{id:201,title:"Users",route:"user",translate:"STAFF.USERS",state:"app.staff.users",permissions:{hidden:!0},weight:1,hidden:function(){return r.hasRole("agent")||r.hasRole("user")||!r.hasPermission(201)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.agents",{id:202,title:"Agents",route:"user",translate:"STAFF.AGENTS",state:"app.staff.agents",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(202)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.telephones",{id:203,title:"Telephones",route:"user",translate:"STAFF.TELEPHONES",state:"app.staff.telephones",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(203)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.teams",{id:204,title:"Teams",route:"team",translate:"STAFF.TEAMS",state:"app.staff.teams",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(204)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.userProfiles",{id:205,title:"UserProfiles",route:"userProfile",translate:"STAFF.USERPROFILES",state:"app.staff.userProfiles",permissions:{hidden:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(205)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager",{id:300,title:"ContactManager",translate:"CONTACTMANAGER.CONTACTMANAGER",icon:"icon-account-circle",license:"cm",weight:4,hidden:function(){return!l.cm||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.lists",{id:301,title:"Lists",route:"cmList",translate:"CONTACTMANAGER.LISTS",state:"app.contactmanager.lists",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(301)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.companies",{id:302,title:"Companies",route:"cmCompany",translate:"CONTACTMANAGER.COMPANIES",state:"app.contactmanager.companies",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(302)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.globalCustomFields",{id:304,title:"GlobalCustomFields",route:"cmCustomField",translate:"CONTACTMANAGER.GLOBALCUSTOMFIELDS",state:"app.contactmanager.globalCustomFields",permissions:{association:!1},weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(304)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.contacts",{id:303,title:"Contacts",route:"",translate:"CONTACTMANAGER.CONTACTS",state:"app.contactmanager.contacts",permissions:{association:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(303)&&!r.hasRole("admin")}}),o.saveItem("apps.voice",{id:400,title:"Voice",translate:"VOICE.VOICE",icon:"icon-phone",license:"voice",weight:5,hidden:function(){return!l.voice||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voiceQueues",{id:401,title:"VoiceQueues",route:"voiceQueue",channel:"voice",translate:"VOICE.VOICEQUEUES",state:"app.voice.voiceQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(401)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.contexts",{id:405,title:"Contexts",route:"voiceContext",translate:"VOICE.CONTEXTS",state:"app.voice.contexts",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(405)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voicemails",{id:406,title:"Voicemails",route:"voiceMail",translate:"VOICE.VOICEMAILS",state:"app.voice.voicemails",weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(406)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.musiconholds",{id:407,title:"MusicOnHolds",route:"voiceMusicOnHold",translate:"VOICE.MUSICONHOLDS",state:"app.voice.musiconholds",weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(407)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voiceRecordings",{id:408,title:"VoiceRecordings",route:"voiceRecording",translate:"VOICE.VOICERECORDINGS",state:"app.voice.voiceRecordings",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(408)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.chanSpies",{id:409,title:"ChanSpies",route:"voiceChanSpy",translate:"VOICE.CHANSPIES",state:"app.voice.chanSpies",weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(409)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voicePrefixes",{id:410,title:"VoicePrefixes",route:"voicePrefix",translate:"VOICE.VOICEPREFIXES",state:"app.voice.voicePrefixes",weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(410)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.inboundRoutes",{id:402,title:"InboundRoutes",route:"voiceExtension",translate:"VOICE.INBOUNDROUTES",state:"app.voice.inboundRoutes",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(402)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.outboundRoutes",{id:403,title:"OutboundRoutes",route:"voiceExtension",translate:"VOICE.OUTBOUNDROUTES",state:"app.voice.outboundRoutes",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(403)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.internalRoutes",{id:404,title:"InternalRoutes",route:"voiceExtension",translate:"VOICE.INTERNALROUTES",state:"app.voice.internalRoutes",weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(404)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.realtime",{id:411,title:"Realtime",route:"",translate:"VOICE.REALTIME",state:"app.voice.realtime",permissions:{association:!1,crud:!1},weight:11,hidden:function(){return r.hasRole("agent")||!r.hasPermission(411)&&!r.hasRole("admin")}}),o.saveItem("apps.chat",{id:500,title:"Chat",translate:"CHAT.CHAT",icon:"icon-hangouts",license:"chat",weight:6,hidden:function(){return!l.chat||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.chat.chatQueues",{id:501,title:"ChatQueues",route:"chatQueue",channel:"chat",translate:"CHAT.CHATQUEUES",state:"app.chat.chatQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(501)&&!r.hasRole("admin")}}),o.saveItem("apps.chat.chatWebsites",{id:502,title:"ChatWebsites",route:"chatWebsite",channel:"chat",translate:"CHAT.CHATWEBSITES",state:"app.chat.chatWebsites",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(502)&&!r.hasRole("admin")}}),o.saveItem("apps.chat.realtime",{id:510,title:"Realtime",route:"",translate:"CHAT.REALTIME",state:"app.chat.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(510)&&!r.hasRole("admin")}}),o.saveItem("apps.mail",{id:600,title:"Mail",translate:"MAIL.MAIL",icon:"icon-email",license:"mail",weight:7,hidden:function(){return!l.mail||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailQueues",{id:601,title:"MailQueues",route:"mailQueue",channel:"mail",translate:"MAIL.MAILQUEUES",state:"app.mail.mailQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(601)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailAccounts",{id:602,title:"MailAccounts",route:"mailAccount",channel:"mail",translate:"MAIL.MAILACCOUNTS",state:"app.mail.mailAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(602)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailSubtatuses",{id:603,title:"MailSubstatuses",route:"mailSubstatus",channel:"mail",translate:"MAIL.MAILSUBSTATUSES",state:"app.mail.mailSubtatuses",permissions:{association:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(603)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.realtime",{id:610,title:"Realtime",route:"",translate:"MAIL.REALTIME",state:"app.mail.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(610)&&!r.hasRole("admin")}}),o.saveItem("apps.sms",{id:700,title:"Sms",translate:"SMS.SMS",icon:"icon-message-text",license:"messaging",weight:8,hidden:function(){return!l.messaging||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.sms.smsQueues",{id:701,title:"SmsQueues",route:"smsQueue",channel:"sms",translate:"SMS.SMSQUEUES",state:"app.sms.smsQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(701)&&!r.hasRole("admin")}}),o.saveItem("apps.sms.smsAccounts",{id:702,title:"SmsAccounts",route:"smsAccount",channel:"sms",translate:"SMS.SMSACCOUNTS",state:"app.sms.smsAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(702)&&!r.hasRole("admin")}}),o.saveItem("apps.sms.realtime",{id:710,title:"Realtime",route:"",translate:"SMS.REALTIME",state:"app.sms.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(710)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel",{id:800,title:"Openchannel",translate:"OPENCHANNEL.OPENCHANNEL",icon:"icon-google-earth",license:"openchannel",weight:9,hidden:function(){return!l.openchannel||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.openchannelQueues",{id:801,title:"OpenchannelQueues",route:"openchannelQueue",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELQUEUES",state:"app.openchannel.openchannelQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(801)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.openchannelAccounts",{id:802,title:"OpenchannelAccounts",route:"openchannelAccount",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELACCOUNTS",state:"app.openchannel.openchannelAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(802)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.realtime",{id:810,title:"Realtime",route:"",translate:"OPENCHANNEL.REALTIME",state:"app.openchannel.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(810)&&!r.hasRole("admin")}}),o.saveItem("apps.fax",{id:900,title:"Fax",translate:"FAX.FAX",icon:"icon-deskphone",license:"fax",weight:10,hidden:function(){return!l.fax||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.fax.faxQueues",{id:901,title:"FaxQueues",route:"faxQueue",channel:"fax",translate:"FAX.FAXQUEUES",state:"app.fax.faxQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(901)&&!r.hasRole("admin")}}),o.saveItem("apps.fax.faxAccounts",{id:902,title:"FaxAccounts",route:"faxAccount",channel:"fax",translate:"FAX.FAXACCOUNTS",state:"app.fax.faxAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(902)&&!r.hasRole("admin")}}),o.saveItem("apps.fax.realtime",{id:910,title:"Realtime",route:"",translate:"FAX.REALTIME",state:"app.fax.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(910)&&!r.hasRole("admin")}}),o.saveItem("apps.tools",{id:1e3,title:"Tools",translate:"TOOLS.TOOLS",icon:"icon-auto-fix",weight:15,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.tools.cannedAnswers",{id:1001,title:"CannedAnswers",route:"cannedAnswer",translate:"TOOLS.CANNEDANSWERS",state:"app.tools.cannedAnswers",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1001)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.customDashboards",{id:1003,title:"CustomDashboards",route:"dashboard",translate:"TOOLS.CUSTOMDASHBOARDS",state:"app.tools.customDashboards",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1003)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.intervals",{id:1004,title:"Intervals",route:"interval",translate:"TOOLS.INTERVALS",state:"app.tools.intervals",weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1004)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.pauses",{id:1005,title:"Pauses",route:"pause",translate:"TOOLS.PAUSES",state:"app.tools.pauses",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1005)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.schedules",{id:1006,title:"Scheduler",route:"schedule",translate:"TOOLS.SCHEDULER",state:"app.tools.schedules",weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1006)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.sounds",{id:1007,title:"Sounds",route:"sound",translate:"TOOLS.SOUNDS",state:"app.tools.sounds",weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1007)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.tags",{id:1008,title:"Tags",route:"tag",translate:"TOOLS.TAGS",state:"app.tools.tags",weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1008)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.templates",{id:1009,title:"Templates",route:"template",translate:"TOOLS.TEMPLATES",state:"app.tools.templates",weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1009)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.trunks",{id:1011,title:"Trunks",route:"trunk",translate:"TOOLS.TRUNKS",state:"app.tools.trunks",weight:11,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1011)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.variables",{id:1012,title:"Variables",route:"variable",translate:"TOOLS.VARIABLES",state:"app.tools.variables",weight:12,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1012)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.dispositions",{id:1002,title:"Dispositions",route:"disposition",translate:"TOOLS.DISPOSITIONS",state:"app.tools.dispositions",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1002)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.triggers",{id:1010,title:"Triggers",route:"trigger",translate:"TOOLS.TRIGGERS",state:"app.tools.triggers",weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1010)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare",{id:1100,title:"CallySquare",translate:"CALLYSQUARE.CALLYSQUARE",icon:"icon-sitemap",license:"voice",weight:13,hidden:function(){return!l.voice||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.odbcs",{id:1101,title:"ODBC",route:"squareOdbc",translate:"CALLYSQUARE.ODBC",state:"app.callysquare.odbcs",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1101)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.squareRecordings",{id:1102,title:"SquareRecordings",route:"squareRecording",translate:"CALLYSQUARE.SQUARERECORDINGS",state:"app.callysquare.squareRecordings",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1102)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.projects",{id:1103,title:"Projects",route:"squareProject",translate:"CALLYSQUARE.PROJECTS",state:"app.callysquare.projects",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1103)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics",{id:1200,title:"Analytics",translate:"ANALYTICS.ANALYTICS",icon:"icon-chart-line",weight:16,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.metrics",{id:1201,title:"Metrics",route:"analyticMetric",translate:"ANALYTICS.METRICS",state:"app.analytics.metrics",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1201)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.extractedReports",{id:1202,title:"ExtractedReports",route:"analyticExtractedReport",translate:"ANALYTICS.EXTRACTEDREPORTS",state:"app.analytics.extractedReports",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1202)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.reports",{id:1203,title:"Reports",route:"",translate:"ANALYTICS.REPORTS",state:"app.analytics.reports",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1203)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations",{id:1300,title:"Integrations",translate:"INTEGRATIONS.INTEGRATIONS",icon:"icon-heart",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.zendeskAccounts",{id:1301,title:"ZendeskAccounts",route:"intZendeskAccount",translate:"INTEGRATIONS.ZENDESKACCOUNTS",state:"app.integrations.zendeskAccounts",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1301)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.salesforceAccounts",{id:1302,title:"SalesforceAccounts",route:"intSalesforceAccount",translate:"INTEGRATIONS.SALESFORCEACCOUNTS",state:"app.integrations.salesforceAccounts",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1302)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.freshdeskAccounts",{id:1303,title:"FreshdeskAccounts",route:"intFreshdeskAccount",translate:"INTEGRATIONS.FRESHDESKACCOUNTS",state:"app.integrations.freshdeskAccounts",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1303)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.sugarcrmAccounts",{id:1305,title:"SugarcrmAccounts",route:"intSugarcrmAccount",translate:"INTEGRATIONS.SUGARCRMACCOUNTS",state:"app.integrations.sugarcrmAccounts",permissions:{association:!1,loading:!0},weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1305)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.deskAccounts",{id:1306,title:"DeskAccounts",route:"intDeskAccount",translate:"INTEGRATIONS.DESKACCOUNTS",state:"app.integrations.deskAccounts",permissions:{association:!1,loading:!0},weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1306)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.zohoAccounts",{id:1307,title:"ZohoAccounts",route:"intZohoAccount",translate:"INTEGRATIONS.ZOHOACCOUNTS",state:"app.integrations.zohoAccounts",permissions:{association:!1,loading:!0},weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1307)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.vtigerAccounts",{id:1308,title:"VtigerAccounts",route:"intVtigerAccount",translate:"INTEGRATIONS.VTIGERACCOUNTS",state:"app.integrations.vtigerAccounts",permissions:{association:!1,loading:!0},weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1308)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.dynamics365Accounts",{id:1309,title:"Dynamics365Accounts",route:"intDynamics365Account",translate:"INTEGRATIONS.DYNAMICS365ACCOUNTS",state:"app.integrations.dynamics365Accounts",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1309)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.servicenowAccounts",{id:1310,title:"ServicenowAccounts",route:"intServicenowAccount",translate:"INTEGRATIONS.SERVICENOWACCOUNTS",state:"app.integrations.servicenowAccounts",permissions:{association:!1,loading:!0},weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1310)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.freshsalesAccounts",{id:1304,title:"FreshsalesAccounts",route:"intFreshsalesAccount",translate:"INTEGRATIONS.FRESHSALESACCOUNTS",state:"app.integrations.freshsalesAccounts",permissions:{association:!1,loading:!0},weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1304)&&!r.hasRole("admin")}}),o.saveItem("apps.settings",{id:1400,title:"Settings",translate:"SETTINGS.SETTINGS",icon:"icon-cog",permissions:{hidden:!0},weight:20,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")||r.hasRole("admin")&&!r.getCurrentUser().settingsEnabled}}),o.saveItem("apps.settings.generals",{id:1401,title:"General",route:"setting",translate:"SETTINGS.GENERAL",state:"app.settings.generals",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.smtps",{id:1402,title:"Smtp",route:"mailAccount",translate:"SETTINGS.SMTP",state:"app.settings.smtps",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.networks",{id:1403,title:"Networks",route:"network",translate:"SETTINGS.NETWORKS",state:"app.settings.networks",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.customizations",{id:1407,title:"Customizations",route:"setting",translate:"SETTINGS.CUSTOMIZATIONS",state:"app.settings.customizations",weight:1,hidden:function(){return!l.custom||r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.cloudProviders",{id:1408,title:"AiTools",route:"cloudProvider",translate:"SETTINGS.CLOUD_PROVIDERS",state:"app.settings.cloudProviders",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.updates",{id:1404,title:"Updates",route:"",translate:"SETTINGS.UPDATES",state:"app.settings.updates",weight:1,hidden:function(){return!l.update||r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.license",{id:1405,title:"License",route:"",translate:"SETTINGS.LICENSE",state:"app.settings.license",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.system",{id:1406,title:"System",route:"",translate:"SETTINGS.SYSTEM",state:"app.settings.system",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer",{id:1500,title:"MotionDialer",translate:"MOTIONDIALER.MOTIONDIALER",icon:"icon-fire",license:"dialer",weight:5,hidden:function(){return!l.dialer||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.queueCampaigns",{id:1501,title:"QueueCampaigns",route:"voiceQueue",channel:"bull",translate:"MOTIONDIALER.QUEUECAMPAIGNS",state:"app.motiondialer.queueCampaigns",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1501)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.ivrCampaigns",{id:1502,title:"IvrCampaigns",route:"campaign",translate:"MOTIONDIALER.IVRCAMPAIGNS",state:"app.motiondialer.ivrCampaigns",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1502)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.realtime",{id:1510,title:"Realtime",route:"",translate:"MOTIONDIALER.REALTIME",state:"app.motiondialer.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1510)&&!r.hasRole("admin")}}),o.saveItem("apps.help",{id:1600,title:"Help",translate:"HELP.HELP",icon:"icon-help",permissions:{association:!1},weight:21,hidden:function(){return!c.viewHelpSection||r.hasRole("agent")||!r.hasPermission(1600)&&!r.hasRole("admin")}}),o.saveItem("apps.help.about",{id:1601,title:"About",route:"",translate:"HELP.ABOUT",state:"app.help.about",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1600)&&!r.hasRole("admin")}}),o.saveItem("apps.jscripty",{id:1700,title:"jscripty",translate:"JSCRIPTY.JSCRIPTY",icon:"icon-script",license:"jscripty",weight:14,hidden:function(){return!l.jscripty||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.jscripty.projects",{id:1701,title:"Projects",route:"jscriptyProject",translate:"JSCRIPTY.PROJECTS",state:"app.jscripty.projects",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1701)&&!r.hasRole("admin")}}),o.saveItem("apps.marketplace",{id:1800,title:"Marketplace",translate:"MARKETPLACE.MARKETPLACE",icon:"icon-cart",weight:18,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.marketplace.plugins",{id:1801,title:"Plugins",route:"plugin",translate:"MARKETPLACE.PLUGINS",state:"app.marketplace.plugins",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1801)&&!r.hasRole("admin")}}),o.saveItem("apps.video",{id:2e3,title:"Video",translate:"VIDEO.VIDEO",icon:"icon-video",license:"screenrecording",weight:12,hidden:function(){return!l.screenrecording||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.video.screenRecordings",{id:2001,title:"ScreenRecordings",route:"screenRecording",translate:"VIDEO.SCREENRECORDINGS",state:"app.video.screenRecordings",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2001)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp",{id:2100,title:"Whatsapp",translate:"WHATSAPP.WHATSAPP",icon:"icon-whatsapp",license:"whatsapp",weight:11,hidden:function(){return!l.whatsapp||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.whatsappQueues",{id:2101,title:"WhatsappQueues",route:"whatsappQueue",channel:"whatsapp",translate:"WHATSAPP.WHATSAPPQUEUES",state:"app.whatsapp.whatsappQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2101)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.whatsappAccounts",{id:2102,title:"WhatsappAccounts",route:"whatsappAccount",channel:"whatsapp",translate:"WHATSAPP.WHATSAPPACCOUNTS",state:"app.whatsapp.whatsappAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2102)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.realtime",{id:2110,title:"Realtime",route:"",translate:"WHATSAPP.REALTIME",state:"app.whatsapp.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2110)&&!r.hasRole("admin")}}),o.sort(),i.saveItem("apps",{title:"APPS",group:!0,weight:1}),i.saveItem("apps.home",{id:100,title:"Home",translate:"DASHBOARDS.HOME",icon:"icon-home",weight:1}),i.saveItem("apps.home.dashboard",{id:101,title:"Dashboard",translate:"DASHBOARDS.DASHBOARD",state:"dashboard",view:"dashboard",icon:"icon-tile-four",iconClass:"cyan-500-fg",weight:1,hidden:function(){return!r.hasPermission(101)}}),i.saveItem("apps.home.agentPresence",{id:115,title:"AgentPresence",translate:"DASHBOARDS.AGENT_PRESENCE",state:"agentPresence",view:"agentPresence",icon:"icon-webcam",iconClass:"xenialab-violet-light-fg",weight:2,hidden:function(){return!r.hasPermission(115)}}),i.saveItem("apps.home.contacts",{id:102,title:"Contacts",translate:"DASHBOARDS.CONTACTS",state:"contacts",view:"contacts",icon:"icon-account-circle",iconClass:"red-fg",weight:3,hidden:function(){return!l.cm||!r.hasPermission(102)}}),i.saveItem("apps.home.mycontacts",{id:103,title:"Contacts",translate:"DASHBOARDS.MYCONTACTS",state:"mycontacts",view:"mycontacts",icon:"icon-account-multiple",iconClass:"red-fg",weight:4,hidden:function(){return!l.cm||!r.hasPermission(103)}}),i.saveItem("apps.home.scheduled",{id:113,title:"Scheduled Calls",translate:"DASHBOARDS.SCHEDULED_CALLS",state:"scheduled",view:"scheduled",icon:"icon-calendar-clock",iconClass:"blue-grey-fg",weight:5,hidden:function(){return!l.dialer||!r.hasPermission(113)}}),i.saveItem("apps.home.voice",{id:110,title:"Voice",translate:"DASHBOARDS.VOICE",state:"voice",view:"voice",icon:"icon-phone",iconClass:"blue-A700-fg",weight:6,hidden:function(){return!l.voice||!r.hasPermission(110)}}),i.saveItem("apps.home.abandoned",{id:111,title:"Abandoned",translate:"DASHBOARDS.ABANDONED",state:"abandoned",view:"abandoned",icon:"icon-phone-missed",iconClass:"blue-fg",weight:7,hidden:function(){return!l.voice||!r.hasPermission(111)}}),i.saveItem("apps.home.recordings",{id:104,title:"Recordings",translate:"DASHBOARDS.RECORDINGS",state:"recordings",view:"recordings",icon:"icon-audiobook",iconClass:"indigo-A100-fg",weight:8,hidden:function(){return!l.voice||!r.hasPermission(104)}}),i.saveItem("apps.home.chat",{id:105,title:"Chat",translate:"DASHBOARDS.CHAT",state:"chat",view:"chat",icon:"icon-hangouts",iconClass:"green-A700-fg",weight:9,hidden:function(){return!l.chat||!r.hasPermission(105)}}),i.saveItem("apps.home.mail",{id:106,title:"Mail",translate:"DASHBOARDS.MAIL",state:"mail",view:"mail",icon:"icon-email",iconClass:"teal-fg",weight:10,hidden:function(){return!l.mail||!r.hasPermission(106)}}),i.saveItem("apps.home.sms",{id:107,title:"Sms",translate:"DASHBOARDS.SMS",state:"sms",view:"sms",icon:"icon-message-text",iconClass:"orange-fg",weight:11,hidden:function(){return!l.messaging||!r.hasPermission(107)}}),i.saveItem("apps.home.openchannel",{id:108,title:"Openchannel",translate:"DASHBOARDS.OPENCHANNEL",state:"openchannel",view:"openchannel",icon:"icon-google-earth",iconClass:"amber-fg",weight:12,hidden:function(){return!l.openchannel||!r.hasPermission(108)}}),i.saveItem("apps.home.fax",{id:109,title:"Fax",translate:"DASHBOARDS.FAX",state:"fax",view:"fax",icon:"icon-deskphone",iconClass:"blue-grey-A200-fg",weight:13,hidden:function(){return!l.fax||!r.hasPermission(109)}}),i.saveItem("apps.home.whatsapp",{id:114,title:"Whatsapp",translate:"DASHBOARDS.WHATSAPP",state:"whatsapp",view:"whatsapp",icon:"icon-whatsapp",iconClass:"lime-A700-fg",weight:14,hidden:function(){return!l.whatsapp||!r.hasPermission(114)}}),n.$on("$viewContentAnimationEnded",function(e){e.targetScope.$id===n.$id&&t.$broadcast("msSplashScreen::remove")}),n.$on("socket:connect",function(){t.toastySocketLost&&(s.clear(t.toastySocketLost),t.toastySocketLost=void 0)}),n.$on("socket:disconnect",function(){t.toastySocketLost||s.warning({title:e.instant("TOOLBAR.WARNING"),msg:e.instant("DASHBOARDS.LOST_CONNECTION"),timeout:!1,onAdd:function(){t.toastySocketLost=this.id}})}),n.$on("client-side-logging:enabled",function(){"admin"!==r.getCurrentUser().role&&s.info({title:e.instant("STAFF.CLIENT_LOGS"),msg:e.instant("STAFF.CLIENT_LOGS_ENABLED_MSG")})}),n.$on("client-side-logging:disabled",function(){"admin"!==r.getCurrentUser().role&&s.info({title:e.instant("STAFF.CLIENT_LOGS"),msg:e.instant("STAFF.CLIENT_LOGS_DISABLED_MSG")})}),a.onbeforeunload=function(){r.isTelephone()||u.flush()}}e.$inject=["$scope","$rootScope","$translate","$window","msNavigationService","msNavigationAgentService","toasty","Auth","license","api","setting","UserSettingService","ClientSideLoggingService"],angular.module("motion").controller("MainController",e)}(),function(){"use strict";function e(e,n,t,a,o,r){var i=this;function s(e){if(e&&e.id){var n=99999+e.id;o.saveItem("apps.dashboards.custom_"+n,{id:n,title:e.name||"NONAME",state:"app.dashboards.custom",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(n)&&!r.hasRole("admin")}})}}function l(e){if(e&&e.id&&"never"!=e.sidebar)if(e.active){if("always"==e.sidebar||"adminOnly"==e.sidebar){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1900)&&!r.hasRole("admin")}});var n=88888+e.id;o.saveItem("apps.plugins.plugin_"+n,{id:n,title:e.name||"NONAME",state:"app.plugins.plugin",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(n)&&!r.hasRole("admin")}}),o.sort()}}else{n=88888+e.id;t=1900,a=n,i=o.getNavigation(),(s=_.find(i[0].children,{id:t}))&&_.some(s.children,{id:a})&&("always"==e.sidebar||"adminOnly"==e.sidebar)&&(o.deleteItem("apps.plugins.plugin_"+n),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}var t,a,i,s}function d(e){var n=o.getNavigation(),t=_.find(n[0].children,{id:e});return!!(t&&0<t.children.length)}i.bodyEl=angular.element("body"),i.setting=t,i.$onInit=function(){i.folded="true"===n.get("motion.folded")||!1},i.toggleMsNavigationFolded=function(){i.folded=!i.folded,n.put("motion.folded",i.folded)},i.getLogo=function(){return i.setting.defaultHeaderWhiteLabel?"xCALLY Motion":i.setting.headerWhiteLabel},a.on("dashboard:save",s),a.on("dashboard:update",s),a.on("dashboard:remove",function(e){if(e&&e.id){var n=99999+e.id;o.deleteItem("apps.dashboards.custom_"+n)}}),a.on("plugin:save",l),a.on("plugin:update",l),a.on("plugin:remove",function(e){if(e&&e.id&&"never"!=e.sidebar){var n=88888+e.id;"always"!=e.sidebar&&"adminOnly"!=e.sidebar||(o.deleteItem("apps.plugins.plugin_"+n),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}}),e.$on("$stateChangeSuccess",function(){i.bodyEl.removeClass("ms-navigation-horizontal-mobile-menu-active")})}e.$inject=["$scope","$cookies","setting","socket","msNavigationService","Auth"],angular.module("app.navigation").controller("NavigationController",e)}(),function(){"use strict";function e(e,a,i,n,t,s,o,r){var l=this;function d(t){o.isSupported()?o.requestPermission().then(function(){var e,n;n={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"api/users/"+(e=t).FromId+"/avatar",body:e.body||"",focusOnclick:!0,closeOnClick:!0},o.show(a.instant("QUICKPANEL.NEW_INTERNAL_MESSAGE"),n)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}l.date=moment().format(),l.currentUser=n.getCurrentUser(),l.license=r,l.unreadTotalMessages=0,l.unreadTotalGroupMessages=0,l.userIsNotPhonebar=function(){return"admin"===l.currentUser.role||"user"===l.currentUser.role||"agent"===l.currentUser.role&&0!==l.currentUser.showWebBar},l.onMessageSave=function(e){e.ToId===l.currentUser.id&&e.FromId!==l.currentUser.id&&!e.read&&e.ChatGroupId&&(l.unreadTotalGroupMessages++,d(e));e.ToId!==l.currentUser.id||e.ChatGroupId||(l.unreadTotalMessages+=1,d(e))},l.onMessageUpdate=function(e){e.ToId===l.currentUser.id&&e.read&&0<l.unreadTotalMessages&&!e.ChatGroupId&&(l.unreadTotalMessages-=1);e.ToId==l.currentUser.id&&e.FromId!==l.currentUser.id&&e.ChatGroupId&&e.read&&0<l.unreadTotalGroupMessages&&l.unreadTotalGroupMessages--},t.on("chatInternalMessage:save",l.onMessageSave),t.on("chatInternalMessage:update",l.onMessageUpdate),s.chatInternalMessage.get({fields:"FromId",ToId:l.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){return e&&e.count&&(l.unreadTotalMessages=e.count),s.user.getGroups({id:l.currentUser.id}).$promise}).then(function(e){for(var n=[],t=e.rows,a=0;a<t.length;a++)n.push(s.chatGroup.getUnread({id:t[a].id}).$promise);return i.all(n)}).then(function(e){for(var n=0;n<e.length;n++)l.unreadTotalGroupMessages+=e[n].count}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){t.removeAllListeners("chatInternalMessage:save"),t.removeAllListeners("chatInternalMessage:update")})}e.$inject=["$scope","$translate","$q","Auth","socket","api","desktopNotification","license"],angular.module("app.quick-panel").controller("QuickPanelController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;function p(e){var n=angular.element("#chat-dialog");a(function(){n.animate({scrollTop:n[0].scrollHeight},e)},0)}function g(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function v(e){return m.get(e).success(function(){n.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){n.error({title:"PhoneBar API Error",msg:d.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}u.currentUser=i.getCurrentUser(),u.user=void 0,u.users={count:0,rows:[]},u.standardDate=moment(0).format("YYYY-MM-DD HH:mm:ss"),u.unreadMessage={},u.replyMessage="",u.disabled=!1,u.init=function(e){u.license=e},u.toggleChat=function(e){if(e){if(!e.allowmessenger&&"agent"===e.role)return n.warning({title:d.instant("QUICKPANEL.WARNING"),msg:d.instant("QUICKPANEL.MESSENGER_DISABLED")}),void(u.user=void 0);u.user=e,u.replyMessage="",t.chatInternalMessage.get({sort:"createdAt",FromId:u.currentUser.id+","+e.id,ToId:u.currentUser.id+","+e.id,ChatGroupId:"null"}).$promise.then(function(e){if(e&&e.rows){u.user.messages=e;for(var n=0;n<u.user.messages.rows.length;n+=1)!1===u.user.messages.rows[n].read&&u.user.messages.rows[n].ToId===u.currentUser.id&&t.chatInternalMessage.update({id:u.user.messages.rows[n].id,read:!0})}}).finally(function(){p(0)})}else u.user=void 0},u.reply=function(){u.disabled=!0;Date.now();if(""===u.replyMessage)return void(u.disabled=!1);var e={FromId:u.currentUser.id,ToId:u.user.id,body:u.replyMessage,read:!1};u.replyMessage="",t.chatInternalMessage.save(e).$promise.then(function(e){u.user.messages.rows.push(e),u.user.lastMessageAt=e.createdAt,u.user.lastMessage=e,p(400)}).catch(function(e){}).finally(function(){u.disabled=!1})},u.onMessageSave=function(e){if(e.ToId===u.currentUser.id&&!e.ChatGroupId){u.user&&u.user.id===e.FromId?(u.user.messages.rows.push(e),p(0),t.chatInternalMessage.update({id:e.id,read:!0})):u.unreadMessage[e.FromId]=u.unreadMessage[e.FromId]?u.unreadMessage[e.FromId]+1:1;var n=_.find(u.users.rows,{id:e.FromId});n&&(n.lastMessageAt=e.createdAt,n.lastMessage=e)}},u.onMessageUpdate=function(e){if((e.FromId===u.currentUser.id||e.ToId===u.currentUser.id)&&!e.ChatGroupId){if(u.user){var n=_.find(u.user.messages.rows,{id:e.id});n&&_.merge(n,e)}var t=_.find(u.users.rows,{id:u.currentUser.id===e.FromId?e.ToId:e.FromId});t&&t.lastMessage&&_.merge(t.lastMessage,e),e.ToId===u.currentUser.id&&e.read&&0<u.unreadMessage[e.FromId]&&(u.unreadMessage[e.FromId]-=1)}},u.onUserUpdate=function(e){var n=_.find(u.users.rows,{id:e.id});n&&(_.isNil(e.online)||n.online===e.online||(n.online=e.online),_.isNil(e.allowmessenger)||n.allowmessenger===e.allowmessenger||(n.allowmessenger=e.allowmessenger))},u.webcall=function(e){c.$broadcast("webrtc::call",{target:g(e)})},u.call=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/originate/"+g(e))},u.transfer=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+g(e))},s.on("chatInternalMessage:save",u.onMessageSave),s.on("chatInternalMessage:update",u.onMessageUpdate),s.on("user:update",u.onUserUpdate),o("quick-panel").onClose(function(){u.user=void 0}),t.chatInternalMessage.get({fields:"FromId",ToId:u.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){u.unreadMessage=_.countBy(e.rows,"FromId")}).catch(function(e){}),t.chatInternalMessage.getUsers().$promise.then(function(e){u.users=e}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){s.removeAllListeners("chatInternalMessage:save"),s.removeAllListeners("chatInternalMessage:update"),s.removeAllListeners("user:update")})}e.$inject=["$scope","toasty","api","$timeout","Auth","socket","$mdSidenav","$q","$interval","$translate","$rootScope","$http"],angular.module("app.quick-panel").controller("ChatInternalController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="QUICKPANEL.EDIT_CHATGROUP",d.group=angular.copy(r),d.currentUser=o.getCurrentUser(),d.members=l,d.newChatGroup=!0,d.group||(d.group={write:!0,members:[]},d.title="QUICKPANEL.NEW_CHATGROUP"),d.saveChatGroup=function(){var t;return d.errors=[],s.chatGroup.save({name:d.group.name,write:d.group.write}).$promise.then(function(e){var n=_.map(d.group.members,"id");return n.unshift(d.currentUser.id),t=e,s.chatGroup.addMembers({id:t.id,ids:n}).$promise}).then(function(){i.success({title:"Group properly saved!",msg:t.name+" has been saved!"}),c(t)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.closeDialog=c,d.querySearch=function(e){return e?d.members.rows.filter((n=e,t=angular.lowercase(n),function(e){var n=e.name.toLowerCase();return-1!=n.indexOf(t)})):[];var n,t}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","group","members"],angular.module("app.quick-panel").controller("CreateOrEditChatGroupDialogController",e)}(),function(){"use strict";function e(e,t,a,s,n,o,i,r,l,d){var c=this;function m(){delete c.group}function u(e){var n=angular.element("#chat-group-dialog");a(function(){n.animate({scrollTop:n[0].scrollHeight},e)},0)}c.currentUser=i.getCurrentUser(),c.unreadGroupMessages={},c.groups={},c.participants,c.group,c.init=function(e){return c.license=e,r.user.getGroups({id:c.currentUser.id}).$promise.then(function(e){for(var n=0,t=[];n<e.rows.length;n++)e.rows[n].unreadGroupMessages=0,c.groups[e.rows[n].id]=e.rows[n],t.push(r.chatGroup.getUnread({id:e.rows[n].id}).$promise);return o.all(t)}).then(function(e){for(var n=0;n<e.length;n++)c.groups[e[n].id].unreadGroupMessages+=e[n].count}).catch(function(e){console.error(e)})},c.back=m,c.addGroup=function(e,n){s.show({controller:"CreateOrEditChatGroupDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/create/dialog.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{group:e,me:c.currentUser,license:null,setting:null},resolve:{members:function(){return i.hasRole("admin")?r.user.get({role:"agent"}).$promise:r.userProfile.getResources({id:i.getCurrentUser().userProfileId,section:"Agents",role:"agent"}).$promise}}}).then(function(e){e&&(c.groups[e.id]=e)}).catch(function(e){e&&console.error(e.message)})},c.deleteGroup=function(e,n){var t=s.confirm().title("Are you sure want to delete the selected group?").htmlContent("Group <b>"+e.name+"</b> will be deleted.").ariaLabel("delete Group").targetEvent(n).ok("OK").cancel("CANCEL");s.show(t).then(function(){return r.chatGroup.delete({id:e.id}).$promise}).then(function(){delete c.groups[e.id],d.success({title:"Group properly deleted!",msg:e.name+" has been deleted!"})}).catch(function(e){e&&d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatGroup.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.groupsToArray=function(){return _.values(c.groups)},c.showMessageInfo=function(e,i){s.show({controller:"ShowMessageInfoDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/info/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{message:i},resolve:{data:function(){var a={messages:[]};return r.chatInternalMessage.get({ChatInternalMessageId:i.id}).$promise.then(function(e){var n=[];a.messages=e.rows,a.messages.unshift(i);for(var t=0;t<a.messages.length;t++)n.push(r.user.get({id:a.messages[t].ToId,fields:"id,name,fullname,userpic"}).$promise);return o.all(n)}).then(function(e){return a.users=e,a}).catch(function(e){e&&console.error(e)})}}}).then(function(){}).catch(function(e){e&&console.error(e.message)})},c.toggleChat=function(n){c.group={id:n.id,write:n.write,messages:{}},r.chatGroup.getMembers({id:n.id,fields:"id,name,fullname"}).$promise.then(function(e){return c.group.membersByKeys=_.keyBy(e.rows,"id"),c.group.members=_.differenceBy(e.rows,[{id:c.currentUser.id}],"id"),c.participants=_.map(c.group.members,"fullname").join(", "),r.chatGroup.getMessages({id:n.id,nolimit:!0}).$promise}).then(function(e){for(var n,t=0,a=[];t<e.count;t++)e.rows[t].ToId===c.currentUser.id&&(n=e.rows[t],c.group.messages[n.id]=n,e.rows[t].ToId!=c.currentUser.id||e.rows[t].FromId===c.currentUser.id||n.read||a.push(r.chatInternalMessage.update({id:n.id,read:!0})));return o.all(a)}).then(function(){u(400)}).catch(function(e){console.error(e.message)})},c.reply=function(){if(!c.replyMessage)return;var t={id:c.group.id,FromId:c.currentUser.id,ToId:c.currentUser.id,body:c.replyMessage,read:!0},a=[];c.replyMessage="",r.chatGroup.addMessage(t).$promise.then(function(e){t.read=!1,t.ChatInternalMessageId=e.id;for(var n=0;n<c.group.members.length;n++)c.group.members[n].id!==c.currentUser.id&&(t.ToId=c.group.members[n].id,a.push(r.chatGroup.addMessage(angular.copy(t)).$promise));return o.all(a)}).catch(function(e){console.log(e)})},l.on("chatInternalMessage:save",function(n){if(!c.group&&n.ToId===c.currentUser.id&&n.FromId!==c.currentUser.id&&!n.read&&n.ChatGroupId){var e=c.groups[n.ChatGroupId];if(!e)return r.chatGroup.get({id:n.ChatGroupId}).$promise.then(function(e){e.unreadGroupMessages=1,c.groups[e.id]=e});e.unreadGroupMessages||(e.unreadGroupMessages=0),e.unreadGroupMessages++}c.group&&n.ChatGroupId===c.group.id&&n.ToId===c.currentUser.id&&r.chatInternalMessage.update({id:n.id,read:!0}).$promise.then(function(){var e;e=n,c.group.messages[e.id]=e,u(400)})}),l.on("chatInternalMessage:update",function(e){e.ToId==c.currentUser.id&&e.FromId!==c.currentUser.id&&e.ChatGroupId&&e.read&&(0<c.groups[e.ChatGroupId].unreadGroupMessages&&c.groups[e.ChatGroupId].unreadGroupMessages--,c.group.messages[e.id]&&(c.group.messages[e.id].read=!0))}),l.on("chatGroup:remove",function(e){c.groups[e.id]&&delete c.groups[e.id]}),n("quick-panel").onClose(m),e.$on("$destroy",function(){l.removeAllListeners("chatInternalMessage:save"),l.removeAllListeners("chatInternalMessage:update"),l.removeAllListeners("chatGroup:remove")})}e.$inject=["$scope","$document","$timeout","$mdDialog","$mdSidenav","$q","Auth","api","socket","toasty"],angular.module("app.quick-panel").controller("ChatGroupController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){this.data=r,this.title="QUICKPANEL.INFO",this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","data"],angular.module("app.quick-panel").controller("ShowMessageInfoDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.form={token:s.token},o.setting={},o.resetPassword=function(){return i.auth.reset(o.form).$promise.then(function(){n.success({title:t.instant("RESETPASSWORD.PASSWORD_RESET"),msg:t.instant("RESETPASSWORD.PASSWORD_RESET_MESSAGE")}),a.go("app.login")}).catch(function(e){e&&n.error({title:t.instant("RESETPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},o.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general");return i.setting.gdpr({id:1}).$promise.then(function(e){o.setting=e,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:""}).catch(function(e){e&&n.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})})}}e.$inject=["Auth","toasty","$translate","$state","api","$stateParams"],angular.module("app.reset").controller("ResetPasswordController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.errors=[],r.user=i,r.setting=s,r.reset=o,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.savePassword=function(){r.errors=[],a.user.changePassword({id:r.user.id},{oldPassword:r.oldPassword,newPassword:r.password}).$promise.then(function(){n.show(n.simple().textContent("Your password properly updated").position("top right").hideDelay(5e3)),l()}).catch(function(e){console.error(e),r.errors=e.data.errors&&e.data.errors.length?e.data.errors:[{message:e.data.message||"Authorization error",type:"api.user.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.changePasswordForm.password.$setValidity("oldPasswordMatch",!1):t.changePasswordForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","$mdToast","api","user","setting","reset"],angular.module("app.toolbar").controller("ChangePasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){var l=this;function d(e){_.isNil(e)&&s.cmHopper.update({id:l.preview.id,UserId:null}),a.hide()}l.customFieldsMap=r&&r.rows?_.mapValues(_.keyBy(r.rows,function(e){return"cf_"+e.id}),"name"):{},l.errors=[],l.hopperIds=[],l.preview=o,l.originated=!1,l.disable=!1,l.disableGetContact=!1,l.hopperIds.push(l.preview.id),l.originatePreview=function(){l.originated=!0,l.disable=!0,_.isEmpty(l.preview)?(i.error({title:"Message",msg:"Contact not available"}),l.disable=!1,l.hopperIds=[],d(!0)):s.rpc.getVoiceQueuesPreview({id:l.preview.id}).$promise.then(function(){d(!0)}).catch(function(e){i.error({title:"Message",msg:e.data}),d(!0)}).finally(function(){l.disable=!1,l.hopperIds=[]})},l.closeDialog=d,l.nextContact=function(){return l.disableGetContact=!0,s.cmHopper.getPreview({hopperIds:l.hopperIds,direction:"next"}).$promise.then(function(e){l.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(l.hopperIds=[],a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e,l.hopperIds.push(l.preview.id))}).catch(function(e){if(l.disableGetContact=!1,l.hopperIds=[],404===e.status)l.getFirstAvailableContact();else if(e.data&&e.data.errors&&e.data.errors.length){a.hide();for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.hide(),i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.previousContact=function(){if(l.disableGetContact=!0,1<l.hopperIds.length){var e=_.without(l.hopperIds,l.preview.id);return s.cmHopper.getPreview({hopperIds:e,direction:"prev"}).$promise.then(function(e){l.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(l.hopperIds=[],a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(_.remove(l.hopperIds,function(e){return e==l.preview.id}),l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e)}).catch(function(e){if(404===e.status)l.hopperIds=[l.preview.id],i.info({title:"PREVIEW",msg:"PREVIOUS CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){l.hopperIds=[],a.hide();for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.hopperIds=[],a.hide(),i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}},l.getFirstAvailableContact=function(){return l.disableGetContact=!0,i.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE. REWINDING THE LIST"}),s.cmHopper.getPreview({hopperIds:[l.preview.id],direction:"next"}).$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e,l.hopperIds.push(l.preview.id))}).catch(function(e){if(a.hide(),404===e.status)i.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){l.disableGetContact=!1})},l.isCustomField=function(e){return _.startsWith(e,"cf_")},l.isHiddenField=function(e){return _.includes(["Company","CompanyId","ListId","UserId","createdAt","deletedAt","id","dialTimezone","utcOffset","priority","scheduledat","tags","updatedAt","facebook","twitter","skype","wechat","teams","viber","line","telegram"],e)},l.isNil=function(e){return _.isNil(e)},e.$on("$destroy",function(){l.originated||s.cmHopper.update({id:l.preview.id,UserId:null})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","preview","customFields"],angular.module("app.toolbar").controller("PreviewDialogController",e)}(),function(){"use strict";function e(n,t,s,a,o,e,i,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S){var T,I=this;I.voiceQueues={},I.polling=!0,t.global={search:""},I.pauses=[],I.license=b,I.currentUser=v.getCurrentUser(),I.unreadTotalMessages=0,I.unreadTotalGroupMessages=0,I.contacts=0,"agent"===I.currentUser.role&&(T=E(function(){_.some(I.voiceQueues,{dialMethod:"preview",dialActive:!0})&&I.license.dialer&&I.polling?(I.polling=!1,f.cmHopper.getOpenContacts().$promise.then(function(e){e&&_.isNumber(e.contacts)&&(I.contacts=e.contacts)}).finally(function(){I.polling=!0})):I.contacts=0},14999)),I.setting=A,I.bodyEl=angular.element("body"),I.conf={realm:"asterisk",host:e.host(),protocol:e.protocol(),soundPlayerId:"local-audio",remotePlayerId:"remote-audio",ua:"Motion WebRTC Bar 0.2.0",license:I.license.webrtc,phoneBarExpires:I.currentUser.phoneBarExpires,phoneBarPrefixRequired:I.currentUser.phoneBarPrefixRequired,wssPort:I.currentUser.wssPort},I.webRTCSessions=[],I.query={id:v.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",nolimit:!0},I.userStatusOptions=[{title:"Online",icon:"icon-checkbox-marked-circle",color:"#4CAF50"},{title:"Away",icon:"icon-clock",color:"#FFC107"},{title:"Do not Disturb",icon:"icon-minus-circle",color:"#F44336"},{title:"Invisible",icon:"icon-checkbox-blank-circle-outline",color:"#BDBDBD"},{title:"Offline",icon:"icon-checkbox-blank-circle-outline",color:"#616161"}],I.languages={ar:{title:"Arabic",translation:"TOOLBAR.ARABIC",code:"ar",flag:"ar"},cs:{title:"Czech",translation:"TOOLBAR.CZECH",code:"cs",flag:"cs"},da:{title:"Danish",translation:"TOOLBAR.DANISH",code:"da",flag:"da"},de:{title:"German",translation:"TOOLBAR.GERMAN",code:"de",flag:"de"},en:{title:"English",translation:"TOOLBAR.ENGLISH",code:"en",flag:"us"},es:{title:"Spanish",translation:"TOOLBAR.SPANISH",code:"es",flag:"es"},fa:{title:"Persian",translation:"TOOLBAR.PERSIAN",code:"fa",flag:"fa"},fi:{title:"Finnish",translation:"TOOLBAR.FINNISH",code:"fi",flag:"fi"},fr:{title:"French",translation:"TOOLBAR.FRENCH",code:"fr",flag:"fr"},he:{title:"Hebrew",translation:"TOOLBAR.HEBREW",code:"he",flag:"he"},hi:{title:"Hindi",translation:"TOOLBAR.HINDI",code:"hi",flag:"hi"},hu:{title:"Hungarian",translation:"TOOLBAR.HUNGARIAN",code:"hu",flag:"hu"},id:{title:"Indonesian",translation:"TOOLBAR.INDONESIAN",code:"id",flag:"id"},it:{title:"Italian",translation:"TOOLBAR.ITALIAN",code:"it",flag:"it"},ja:{title:"Japanese",translation:"TOOLBAR.JAPANESE",code:"ja",flag:"ja"},ko:{title:"Korean",translation:"TOOLBAR.KOREAN",code:"ko",flag:"ko"},lv:{title:"Latvian",translation:"TOOLBAR.LATVIAN",code:"lv",flag:"lv"},nl:{title:"Dutch",translation:"TOOLBAR.DUTCH",code:"nl",flag:"nl"},no:{title:"Norwegian",translation:"TOOLBAR.NORWEGIAN",code:"no",flag:"no"},pl:{title:"Polish",translation:"TOOLBAR.POLISH",code:"pl",flag:"pl"},"pt-BR":{title:"Brazilian",translation:"TOOLBAR.BRAZILIAN",code:"pt-BR",flag:"pt-BR"},"pt-PT":{title:"Portuguese",translation:"TOOLBAR.PORTUGUESE",code:"pt-PT",flag:"pt-PT"},ru:{title:"Russian",translation:"TOOLBAR.RUSSIAN",code:"ru",flag:"ru"},sv:{title:"Swedish",translation:"TOOLBAR.SWEDISH",code:"sv",flag:"sv"},tr:{title:"Turkish",translation:"TOOLBAR.TURKISH",code:"tr",flag:"tr"},"zh-CN":{title:"ChineseSimplified",translation:"TOOLBAR.CHINESESIMPLIFIED",code:"zh-CN",flag:"zh-CN"},"zh-TW":{title:"ChineseTraditional",translation:"TOOLBAR.CHINESETRADITIONAL",code:"zh-TW",flag:"zh-TW"}};var O=["ar","fa","he"],C=S.getLogger("toolbar");function w(){h.connect(),h.on("user:update",I.onUserUpdate),h.on("user:called",I.onUserCalled),h.on("chatInternalMessage:save",I.onInternalMessageSave),h.on("chatInternalMessage:update",I.onInternalMessageUpdate),h.on("userVoiceQueue:save",I.onUserVoiceQueue),h.on("voiceQueue:save",I.onVoiceQueue),h.on("userVoiceQueue:remove",I.onUserVoiceQueue),h.on("voiceQueue:remove",I.onVoiceQueue),h.on("voiceQueue:update",I.onVoiceQueue),h.on("user:forcelogout",L),h.on("userNotification:send",k)}function R(){h.disconnect("logout")}function x(e){I.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}function N(){I.promise=f.user.getQueues(I.query,x).$promise}function D(e){return R(),s.resolve().then(function(){if(!v.isTelephone())return S.flush()}).then(function(){return v.logout(e)}).then(function(){return t.$broadcast("webrtc::logout"),a.go("app.login")}).catch(function(e){C.error(e)})}function P(e,n){c.show({controller:"ChangePasswordController",controllerAs:"vm",templateUrl:"app/toolbar/changepassword/changepassword.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!n,escapeToClose:!n,locals:{user:I.user,setting:A,reset:n}})}function L(e){if(C.debug("onForceLogout -> data",e),e.user.id===I.user.id&&0!==I.user.showWebBar)return R(),s.resolve().then(function(){if(!v.isTelephone())return S.flush()}).then(function(){return v.logout(!0)}).then(function(){t.$broadcast("webrtc::logout"),c.show(c.alert().parent(angular.element(m.body)).clickOutsideToClose(!1).escapeToClose(!1).title(r.instant("TOOLBAR.WARNING")).textContent(r.instant("TOOLBAR.USER_FORCE_LOGOUT",{ip:e.ip})).ok("OK")).then(function(){return a.go("app.login")})}).catch(function(e){C.error(e)})}function k(e){var n=e;if(I.currentUser.id===n.recipient){var t=r.instant("TOOLBAR.NOTIFICATION_TITLE",{sender:n.sender}),a=n.description?r.instant("TOOLBAR.NOTIFICATION_TITLE_RECIPIENT",{recipient:n.description}):null;p.wait({title:a?t+" "+a:t,msg:n.content,clickToClose:!1,timeout:!1,sound:n.beep,html:!0})}}I.toggleSidenav=function(e){i(e).toggle()},I.logout=D,I.changeLanguage=function(e){if(!I.languages.hasOwnProperty(e.code)){return void l.show({template:'<md-toast id="language-message" layout="column" layout-align="center start"><div class="md-toast-content">Motion supports multiple translations through angular-translate module, but currently we do not support the selected language. If you want to help us, send us a message.</div></md-toast>',hideDelay:7e3,position:"top right",parent:"#content"})}I.selectedLanguage=e,u.put("motion.language",e.code),r.use(e.code),"app.callysquare.projects.edit"===a.current.name&&d.location.reload();0<=O.indexOf(e.code)?p.info({title:r.instant("TOOLBAR.CHANGE_LANGUAGE_TITLE"),msg:r.instant("TOOLBAR.CHANGE_LANGUAGE_MESSAGE")}):n.$parent.$parent.vm.direction="ltr"},I.setUserStatus=function(e){I.userStatus=e},I.toggleHorizontalMobileMenu=function(){I.bodyEl.toggleClass("ms-navigation-horizontal-mobile-menu-active")},I.toggleMsNavigationFolded=function(){g.toggleFolded()},I.search=function(n){for(var e=[],t=g.getFlatNavigation(),a=s.defer(),i=0;i<t.length;i++)t[i].uisref&&e.push(t[i]);n&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(n)))return!0}));return o(function(){a.resolve(e)},1e3),a.promise},I.searchResultClick=function(e){e.uisref&&(e.stateParams?a.go(e.state,e.stateParams):a.go(e.state))},I.openSettings=function(){t.$broadcast("webrtc::settings")},I.changePassword=P,I.isAgent=function(){return v.getCurrentUser()&&v.hasRole("agent")},I.onUserUpdate=function(e){if(e.id===I.user.id)if("agent"===e.role&&_.isBoolean(e.online)&&!e.online)if(0!==I.user.showWebBar){var n;R();var t=c.confirm({title:r.instant("TOOLBAR.WARNING")+"!",htmlContent:"<span>"+r.instant("TOOLBAR.SOMEONE_LOGGED_YOU_OUT")+"</span><br><span>"+r.instant("TOOLBAR.SESSION_TIMEOUT")+"</span>",ariaLabel:r.instant("TOOLBAR.WARNING")+"!",ok:r.instant("TOOLBAR.STAY_LOGGED"),cancel:r.instant("TOOLBAR.LOGOUT"),onComplete:function(){n=setTimeout(function(){c.cancel()},6e4)}});c.show(t).then(function(){return clearTimeout(n),v.queueLogin().then(function(){w(),_.merge(I.user,e),v.setCurrentUser(I.user)})}).catch(function(){clearTimeout(n),D(!0)})}else D(!0);else _.merge(I.user,e),v.setCurrentUser(I.user)},I.onUserCalled=function(e){if(2===I.currentUser.showWebBar&&"agent"===I.currentUser.role){var n=I.currentUser.privacyEnabled?y.mask(e.calleridnum):e.calleridnum;p.info({title:"WebRTC Popup",msg:"<div>            <span>Call from: "+n+"</span><br>            <span>Queue: "+e.queue+"</span><br>            <span>Extra: "+(e.extravar?e.extravar:"Not defined")+"</span><br>            </div>",showClose:!0,timeout:1e4,html:!0})}},I.pause=function(e){var n=e||"DEFAULT PAUSE";_.some(I.webRTCSessions,["confirmed",!0])&&(n="#"+n);return f.user.pause({id:I.user.id,type:n}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},I.unpause=function(){return f.user.unpause({id:I.user.id}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UNPAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},I.preview=function(n){return I.disable=!0,f.cmHopper.getPreview().$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?p.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):c.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(m.body),targetEvent:n,clickOutsideToClose:!0,locals:{preview:e,currentUser:I.currentUser},resolve:{customFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{nolimit:!0})}]}})}).catch(function(e){if(404===e.status)p.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){I.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){I.disable=!1})},I.getLogo=function(){return I.setting.defaultHeaderWhiteLabel?"xCALLY Motion":I.setting.headerWhiteLabel},I.userIsNotPhonebar=function(){return"admin"===I.currentUser.role||"user"===I.currentUser.role||"agent"===I.currentUser.role&&0!==I.currentUser.showWebBar},I.onInternalMessageSave=function(e){e.ToId!==I.currentUser.id||e.ChatGroupId||(I.unreadTotalMessages+=1);e.ToId===I.currentUser.id&&e.FromId!==I.currentUser.id&&!e.read&&e.ChatGroupId&&I.unreadTotalGroupMessages++},I.onInternalMessageUpdate=function(e){e.ToId===I.currentUser.id&&e.read&&0<I.unreadTotalMessages&&!e.ChatGroupId&&(I.unreadTotalMessages-=1);e.ToId===I.currentUser.id&&e.read&&e.ChatGroupId&&0<I.unreadTotalGroupMessages&&I.unreadTotalGroupMessages--},I.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===v.getCurrentUser().id&&N()},I.onVoiceQueue=function(){N()},function(){I.user=v.getCurrentUser(),I.conf.ha1=I.user.md5secret,I.conf.id=I.user.id,I.conf.name=I.user.name,I.conf.fullname=I.user.fullname,I.conf.internal=I.user.internal,I.conf.recording=I.user.phoneBarEnableRecording,I.conf.autoAnswer=I.user.phoneBarAutoAnswer,I.conf.enableSettings=I.user.phoneBarEnableSettings,I.conf.enableDtmfTone=I.user.phoneBarEnableDtmfTone,I.conf.autoAnswerDelay=I.user.phoneBarAutoAnswerDelay,I.userStatus=I.userStatusOptions[0];var e=u.get("motion.language");e&&I.languages.hasOwnProperty(e)?I.selectedLanguage=I.languages[e]:I.selectedLanguage=I.languages[r.preferredLanguage()];if(f.pause.get({fields:"name",nolimit:!0}).$promise.then(function(e){I.pauses=e.rows?e.rows:[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETPAUSES",msg:e.status?JSON.stringify(e.data):e.toString()})}),"LOCAL_LOGIN"==v.getAuthenticationType()&&I.setting.securePassword)if(I.user.passwordResetAt){var n=moment(I.user.passwordResetAt).add(I.setting.passwordExpiresDays||90,"day");moment().isAfter(n)?P(null,!0):moment().add(15,"day").isAfter(n)&&p.warning({title:r.instant("TOOLBAR.WARNING")+"!",msg:r.instant("TOOLBAR.PASSWORD_EXPIRE_REMAINING_DAYS")+": "+Math.ceil(n.diff(moment(),"days",!0)),timeout:2e4})}else P(null,!0)}(),N(),w(),f.chatInternalMessage.get({fields:"FromId",ToId:I.currentUser.id,read:!1,nolimit:!0}).$promise.then(function(e){I.unreadTotalMessages=e.rows.length}),n.$on("$destroy",function(){h.removeAllListeners("user:called"),h.removeAllListeners("user:update"),h.removeAllListeners("chatInternalMessage:save"),h.removeAllListeners("chatInternalMessage:update"),h.removeAllListeners("userVoiceQueue:save"),h.removeAllListeners("voiceQueue:save"),h.removeAllListeners("userVoiceQueue:remove"),h.removeAllListeners("voiceQueue:remove"),h.removeAllListeners("voiceQueue:update"),h.removeAllListeners("user:forcelogout"),h.removeAllListeners("userNotification:send"),T&&(E.cancel(T),T=null)})}e.$inject=["$scope","$rootScope","$q","$state","$timeout","$location","$mdSidenav","$translate","$mdToast","$window","$mdDialog","$document","$cookies","toasty","msNavigationService","Auth","socket","api","license","setting","$interval","privacyManager","ClientSideLoggingService"],angular.module("app.toolbar").controller("ToolbarController",e)}(),function(){"use strict";function e(a,i,t,s,e){var n={updateUserSettingById:function(e,n){if("number"==typeof e)return i.userSetting.update({id:e},n).$promise;throw new Error("User setting id is missing")}},o=!1,r=a.getCurrentUser(),l=r?r.userSetting:null,d=function(e){var n="user-setting:update:user-"+e;t.$on("local:user-updated",c),s.on(n,c)};function c(){return o?e(function(e){e(l)}):(o=!0,function(e){var n=a.getCurrentUser(),t=null;t="admin"===n.role&&"number"==typeof e?i.user.get({id:e,userSetting:!0}).$promise:i.user.whoami({userSetting:!0}).$promise;return t.then(function(e){return a.setCurrentUser(e),e.userSetting})}().then(function(e){l=e,t.$emit("local:user-setting-updated",l)}).finally(function(){o=!1}))}return r&&d(r.id),t.$on("local:user-login",d),t.$on("local:user-logout",function(e){var n="user-setting:update:user-"+e;s.removeListener(n,c),l=null}),n}e.$inject=["Auth","api","$rootScope","socket","$q"],angular.module("app.user-setting").service("UserSettingService",e)}();var urlParams=function(e){var n=new Object,t=e.lastIndexOf("?");if(0<t)for(var a=e.substring(t+1).split("&"),i=0;i<a.length;i++)0<(t=a[i].indexOf("="))&&(n[a[i].substring(0,t)]=a[i].substring(t+1));return n}(window.location.href),t0=new Date,MAX_REQUEST_SIZE=10485760,MAX_WIDTH=12e3,MAX_HEIGHT=12e3,EXPORT_URL="http://exp.draw.io/ImageExport2/export",SHARE_HOST="http://localhost:3000",SAVE_URL="api/square/projects/",VARIABLE_URL="/api/variables",STENCIL_PATH="/assets/plugins/square/stencils",SHAPES_PATH="/assets/plugins/square/shapes",IMAGE_PATH="/assets/plugins/square/images",STYLE_PATH="/assets/plugins/square/styles",CSS_PATH="/assets/plugins/square/styles",OPEN_FORM="api/square/projects/open",TEMPLATE_PATH="/assets/plugins/square/templates",RESOURCES_PATH="/assets/plugins/square/resources",RESOURCE_BASE=RESOURCES_PATH+"/grapheditor",CRUD_PERMISSIONS={readOnly:!1,canEdit:!1,canDelete:!1},tapAndHoldStartsConnection=!0,showConnectorImg=!0,mxLoadResources=!1,mxLanguages=["it","fr","ko","es","sv","ru","de","ja","zh-CN","zh-TW","nl","fi","da","pt-BR","pt-PT","no","hi","tr","fa"],mxLanguage="en",match=document.cookie.match(new RegExp("(^| )motion.language=([^;]+)"));match&&mxLanguages.includes(match[2])&&(mxLanguage=match[2]);var mxBasePath="assets/plugins/mxgraph",mxClient={VERSION:"2.0.0.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/"),IS_OT:navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0,IS_GC:0<=navigator.userAgent.indexOf("Chrome/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/"),NO_FO:0<=navigator.userAgent.indexOf("Firefox/1.")||0<=navigator.userAgent.indexOf("Iceweasel/1.")||0<=navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/1.")||0<=navigator.userAgent.indexOf("Camino/1.")||0<=navigator.userAgent.indexOf("Epiphany/2.")||0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Mozilla/2."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_MAC:0<navigator.userAgent.toUpperCase().indexOf("MACINTOSH"),IS_TOUCH:0<navigator.userAgent.toUpperCase().indexOf("IPAD")||0<navigator.userAgent.toUpperCase().indexOf("IPOD")||0<navigator.userAgent.toUpperCase().indexOf("IPHONE")||0<navigator.userAgent.toUpperCase().indexOf("ANDROID"),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(e,n,t){if(t=t||document,mxClient.IS_IE6)t.write('<link rel="'+e+'" href="'+n+'" charset="ISO-8859-1" type="text/css"/>');else{var a=t.createElement("link");a.setAttribute("rel",e),a.setAttribute("href",n),a.setAttribute("charset","ISO-8859-1"),a.setAttribute("type","text/css"),t.getElementsByTagName("head")[0].appendChild(a)}},include:function(e){document.write('<script src="'+e+'"><\/script>')},dispose:function(){for(var e=0;e<mxEvent.objects.length;e++)null!=mxEvent.objects[e].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[e])}};if(mxClient.IS_OP&&mxClient.IS_OT?mxClient.CSS_PREFIX="O":mxClient.IS_SF||mxClient.IS_GC?mxClient.CSS_PREFIX="Webkit":mxClient.IS_MT?mxClient.CSS_PREFIX="Moz":mxClient.IS_IE&&9<=document.documentMode&&(mxClient.CSS_PREFIX="ms"),void 0===mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),void 0!==mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",mxClient.language=void 0!==mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),void 0!==mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_IE){if(9<=document.documentMode)mxClient.IS_VML=!1,mxClient.IS_SVG=!0;else{8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"));var ss=document.createStyleSheet();ss.cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}window.attachEvent("onunload",mxClient.dispose)}var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var e=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,n=document.createElement("table");n.setAttribute("width","100%"),n.setAttribute("height","100%");var t=document.createElement("tbody"),a=document.createElement("tr"),i=document.createElement("td");if(i.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",i.appendChild(mxLog.textarea),a.appendChild(i),t.appendChild(a),a=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),a.appendChild(mxLog.td),t.appendChild(a),n.appendChild(t),mxLog.addButton("Info",function(e){mxLog.info()}),mxLog.addButton("DOM",function(e){e=mxUtils.getInnerHtml(document.body),mxLog.debug(e)}),mxLog.addButton("Trace",function(e){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(e){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Show",function(e){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Clear",function(e){mxLog.textarea.value=""}),a=t=0,a="number"==typeof window.innerWidth?(t=window.innerHeight,window.innerWidth):(t=document.documentElement.clientHeight||document.body.clientHeight,document.body.clientWidth),mxLog.window=new mxWindow(e,n,Math.max(0,a-320),Math.max(0,t-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode){var s=mxLog.window.getElement();e=function(e,n){mxLog.textarea.style.height=Math.max(0,s.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,e),mxLog.window.addListener(mxEvent.MAXIMIZE,e),mxLog.window.addListener(mxEvent.NORMALIZE,e),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(e,n){var t=document.createElement("button");mxUtils.write(t,e),mxEvent.addListener(t,"click",n),mxLog.td.appendChild(t)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(e){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(e)},enter:function(e){if(mxLog.TRACE)return mxLog.writeln("Entering "+e),(new Date).getTime()},leave:function(e,n){if(mxLog.TRACE){var t=0!=n?" ("+((new Date).getTime()-n)+" ms)":"";mxLog.writeln("Leaving "+e+t)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var e="",n=0;n<arguments.length;n++)e+=arguments[n],n<arguments.length-1&&(e+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=e,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=e},writeln:function(){for(var e="",n=0;n<arguments.length;n++)e+=arguments[n],n<arguments.length-1&&(e+=" ");mxLog.write(e+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(e){if("object"==typeof e&&null==e[mxObjectIdentity.FIELD_NAME]){var n=mxUtils.getFunctionName(e.constructor);e[mxObjectIdentity.FIELD_NAME]=n+"#"+mxObjectIdentity.counter++}return e[mxObjectIdentity.FIELD_NAME]},clear:function(e){"object"==typeof e&&delete e[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(e){return e=mxObjectIdentity.get(e),this.map[e]},mxDictionary.prototype.put=function(e,n){var t=mxObjectIdentity.get(e),a=this.map[t];return this.map[t]=n,a},mxDictionary.prototype.remove=function(e){e=mxObjectIdentity.get(e);var n=this.map[e];return delete this.map[e],n},mxDictionary.prototype.getKeys=function(){var e,n=[];for(e in this.map)n.push(e);return n},mxDictionary.prototype.getValues=function(){var e,n=[];for(e in this.map)n.push(this.map[e]);return n},mxDictionary.prototype.visit=function(e){for(var n in this.map)e(n,this.map[n])};var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(e){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,e)},getDefaultBundle:function(e,n){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(n)?e+mxResources.extension:null},getSpecialBundle:function(e,n){if(null==mxClient.languages||!this.isLanguageSupported(n)){var t=n.indexOf("-");0<t&&(n=n.substring(0,t))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(n)&&n!=mxClient.defaultLanguage?e+"_"+n+mxResources.extension:null},add:function(e,n){if((n=null!=n?n:mxClient.language)!=mxConstants.NONE){var t=mxResources.getDefaultBundle(e,n);if(null!=t)try{var a=mxUtils.load(t);a.isReady()&&mxResources.parse(a.getText())}catch(e){}if(null!=(t=mxResources.getSpecialBundle(e,n)))try{(a=mxUtils.load(t)).isReady()&&mxResources.parse(a.getText())}catch(e){}}},parse:function(e){if(null!=e){e=e.split("\n");for(var n=0;n<e.length;n++)if("#"!=e[n].charAt(0)){var t=e[n].indexOf("=");if(0<t){var a=e[n].substring(0,t),i=e[n].length;13==e[n].charCodeAt(i-1)&&i--,t=e[n].substring(t+1,i),this.resourcesEncoded?(t=t.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[a]=unescape(t)):mxResources.resources[a]=t}}}},get:function(e,n,t){if(null==(e=mxResources.resources[e])&&(e=t),null!=e&&null!=n){t=[];for(var a=null,i=0;i<e.length;i++){var s=e.charAt(i);"{"==s?a="":null!=a&&"}"==s?(0<=(a=parseInt(a)-1)&&a<n.length&&t.push(n[a]),a=null):null!=a?a+=s:t.push(s)}e=t.join("")}return e}};function mxPoint(e,n){this.x=null!=e?e:0,this.y=null!=n?n:0}function mxRectangle(e,n,t,a){mxPoint.call(this,e,n),this.width=null!=t?t:0,this.height=null!=a?a:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(e){return e.x==this.x&&e.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(e,n,t,a){this.x=e,this.y=n,this.width=t,this.height=a},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(e){if(null!=e){var n=Math.min(this.x,e.x),t=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width);e=Math.max(this.y+this.height,e.y+e.height),this.x=n,this.y=t,this.width=a-n,this.height=e-t}},mxRectangle.prototype.grow=function(e){this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.equals=function(e){return e.x==this.x&&e.y==this.y&&e.width==this.width&&e.height==this.height};var mxEffects={animateChanges:function(l,d,c){var m=0,u=function(){for(var e=!1,n=0;n<d.length;n++){var t=d[n];if(t instanceof mxGeometryChange||t instanceof mxTerminalChange||t instanceof mxValueChange||t instanceof mxChildChange||t instanceof mxStyleChange){var a=l.getView().getState(t.cell||t.child,!1);if(null!=a)if(e=!0,t.constructor!=mxGeometryChange||l.model.isEdge(t.cell))mxUtils.setOpacity(a.shape.node,100*m/10);else{var i=l.getView().scale,s=(t.geometry.x-t.previous.x)*i,o=(t.geometry.y-t.previous.y)*i,r=(t.geometry.width-t.previous.width)*i;i=(t.geometry.height-t.previous.height)*i;0==m?(a.x-=s,a.y-=o,a.width-=r,a.height-=i):(a.x+=s/10,a.y+=o/10,a.width+=r/10,a.height+=i/10),l.cellRenderer.redraw(a),mxEffects.cascadeOpacity(l,t.cell,100*m/10)}}}m<10&&e?(m++,window.setTimeout(u,p)):null!=c&&c()},p=30;u()},cascadeOpacity:function(e,n,t){for(var a=e.model.getChildCount(n),i=0;i<a;i++){var s=e.model.getChildAt(n,i),o=e.getView().getState(s);null!=o&&(mxUtils.setOpacity(o.shape.node,t),mxEffects.cascadeOpacity(e,s,t))}if(null!=(n=e.model.getEdges(n)))for(i=0;i<n.length;i++)null!=(a=e.getView().getState(n[i]))&&mxUtils.setOpacity(a.shape.node,t)},fadeOut:function(e,n,t,a,i,s){a=a||40,i=i||30;var o=n||100;if(mxUtils.setOpacity(e,o),s||null==s){var r=function(){o=Math.max(o-a,0),mxUtils.setOpacity(e,o),0<o?window.setTimeout(r,i):(e.style.visibility="hidden",t&&e.parentNode&&e.parentNode.removeChild(e))};window.setTimeout(r,i)}else e.style.visibility="hidden",t&&e.parentNode&&e.parentNode.removeChild(e)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(e){if(null!=e.style&&(e.style.cursor=""),null!=(e=e.childNodes))for(var n=e.length,t=0;t<n;t+=1)mxUtils.removeCursors(e[t])},getCurrentStyle:mxClient.IS_IE?function(e){return null!=e?e.currentStyle:null}:function(e){return null!=e?window.getComputedStyle(e,""):null},hasScrollbars:function(e){return null!=(e=mxUtils.getCurrentStyle(e))&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(e,n){return function(){return n.apply(e,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+a)}else try{b=eval(a)}catch(e){mxLog.warn(e.message+" while evaluating "+a)}return b},findNode:function(e,n,t){var a=e.getAttribute(n);if(null!=a&&a==t)return e;for(e=e.firstChild;null!=e;){if(null!=(a=mxUtils.findNode(e,n,t)))return a;e=e.nextSibling}return null},findNodeByAttribute:9<=document.documentMode?function(e,n,t){var a=null;if(null!=e)if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.getAttribute(n)==t)a=e;else for(e=e.firstChild;null!=e&&null==a;)a=mxUtils.findNodeByAttribute(e,n,t),e=e.nextSibling;return a}:mxClient.IS_IE?function(e,n,t){return null==e?null:e.ownerDocument.selectSingleNode("//*[@"+n+"='"+t+"']")}:function(e,n,t){return null==e?null:e.ownerDocument.evaluate("//*[@"+n+"='"+t+"']",e.ownerDocument,null,XPathResult.ANY_TYPE,null).iterateNext()},getFunctionName:function(e){var n=null;if(null!=e)if(null!=e.name)n=e.name;else{for(e=e.toString(),n=9;" "==e.charAt(n);)n++;var t=e.indexOf("(",n);n=e.substring(n,t)}return n},indexOf:function(e,n){if(null!=e&&null!=n)for(var t=0;t<e.length;t++)if(e[t]==n)return t;return-1},remove:function(e,n){var t=null;if("object"==typeof n)for(var a=mxUtils.indexOf(n,e);0<=a;)n.splice(a,1),t=e,a=mxUtils.indexOf(n,e);for(var i in n)n[i]==e&&(delete n[i],t=e);return t},isNode:function(e,n,t,a){return!(null==e||isNaN(e.nodeType)||null!=n&&e.nodeName.toLowerCase()!=n.toLowerCase())&&(null==t||e.getAttribute(t)==a)},getChildNodes:function(e,n){n=n||mxConstants.NODETYPE_ELEMENT;for(var t=[],a=e.firstChild;null!=a;)a.nodeType==n&&t.push(a),a=a.nextSibling;return t},createXmlDocument:function(){var e=null;return document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLDOM")),e},parseXml:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){var n=mxUtils.createXmlDocument();return n.async="false",n.loadXML(e),n}:function(e){return(new DOMParser).parseFromString(e,"text/xml")},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:void 0,getPrettyXml:function(e,n,t){var a=[];if(null!=e)if(n=n||"  ",t=t||"",e.nodeType==mxConstants.NODETYPE_TEXT)a.push(e.nodeValue);else{a.push(t+"<"+e.nodeName);var i=e.attributes;if(null!=i)for(var s=0;s<i.length;s++){var o=mxUtils.htmlEntities(i[s].nodeValue);a.push(" "+i[s].nodeName+'="'+o+'"')}if(null!=(i=e.firstChild)){for(a.push(">\n");null!=i;)a.push(mxUtils.getPrettyXml(i,n,t+n)),i=i.nextSibling;a.push(t+"</"+e.nodeName+">\n")}else a.push("/>\n")}return a.join("")},removeWhitespace:function(e,n){for(var t=n?e.previousSibling:e.nextSibling;null!=t&&t.nodeType==mxConstants.NODETYPE_TEXT;){var a=n?t.previousSibling:t.nextSibling,i=mxUtils.getTextContent(t);0==mxUtils.trim(i).length&&t.parentNode.removeChild(t),t=a}},htmlEntities:function(e,n){return e=(e=(e=(e=(e=(e||"").replace(/&/g,"&amp;")).replace(/"/g,"&quot;")).replace(/\'/g,"&#39;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),(null==n||n)&&(e=e.replace(/\n/g,"&#xa;")),e},isVml:function(e){return null!=e&&"urn:schemas-microsoft-com:vml"==e.tagUrn},getXml:function(e,n){var t="";return null!=e&&(t=null==(t=e.xml)?e.innerHTML?e.innerHTML:(new XMLSerializer).serializeToString(e):t.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),t.replace(/\n/g,n||"&#xa;")},getTextContent:function(e){var n="";return null!=e&&(null!=e.firstChild&&(e=e.firstChild),n=e.nodeValue||""),n},getInnerHtml:mxClient.IS_IE?function(e){return null!=e?e.innerHTML:""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},getOuterHtml:mxClient.IS_IE?function(e){if(null==e)return"";if(null!=e.outerHTML)return e.outerHTML;var n=[];n.push("<"+e.nodeName);var t=e.attributes;if(null!=t)for(var a=0;a<t.length;a++){var i=t[a].nodeValue;null!=i&&0<i.length&&(n.push(" "),n.push(t[a].nodeName),n.push('="'),n.push(i),n.push('"'))}return 0==e.innerHTML.length?n.push("/>"):(n.push(">"),n.push(e.innerHTML),n.push("</"+e.nodeName+">")),n.join("")}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},write:function(e,n){var t=e.ownerDocument.createTextNode(n);return null!=e&&e.appendChild(t),t},writeln:function(e,n){var t=e.ownerDocument.createTextNode(n);return null!=e&&(e.appendChild(t),e.appendChild(document.createElement("br"))),t},br:function(e,n){n=n||1;for(var t=null,a=0;a<n;a++)null!=e&&(t=e.ownerDocument.createElement("br"),e.appendChild(t));return t},button:function(e,n,t){return t=(t=null!=t?t:document).createElement("button"),mxUtils.write(t,e),mxEvent.addListener(t,"click",function(e){n(e)}),t},para:function(e,n){var t=document.createElement("p");return mxUtils.write(t,n),null!=e&&e.appendChild(t),t},addTransparentBackgroundFilter:function(e){e.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(e,n,t,a,i){return mxUtils.link(e,n,function(){t.execute(a)},i)},linkInvoke:function(e,n,t,a,i,s){return mxUtils.link(e,n,function(){t[a](i)},s)},link:function(e,n,t,a){var i=document.createElement("span");return i.style.color="blue",i.style.textDecoration="underline",i.style.cursor="pointer",null!=a&&(i.style.paddingLeft=a+"px"),mxEvent.addListener(i,"click",t),mxUtils.write(i,n),null!=e&&e.appendChild(i),i},fit:function(e){var n=parseInt(e.offsetLeft),t=parseInt(e.offsetWidth),a=document.body,i=document.documentElement,s=(a.scrollLeft||i.scrollLeft)+(a.clientWidth||i.clientWidth);s<n+t&&(e.style.left=Math.max(a.scrollLeft||i.scrollLeft,s-t)+"px"),n=parseInt(e.offsetTop),t=parseInt(e.offsetHeight),(s=(a.scrollTop||i.scrollTop)+Math.max(a.clientHeight||0,i.clientHeight))<n+t&&(e.style.top=Math.max(a.scrollTop||i.scrollTop,s-t)+"px")},open:function(e){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return mxUtils.alert("Permission to read file denied."),""}var n=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);return n.initWithPath(e),n.exists()?((e=Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream)).init(n,1,4,null),(n=Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream)).init(e),n.read(n.available())):(mxUtils.alert("File not found."),"")}return e=(n=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(e,1)).readAll(),n.close(),e},save:function(e,n){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return void mxUtils.alert("Permission to write file denied.")}var t=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);t.initWithPath(e),t.exists()||t.create(0,420);var a=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);a.init(t,34,4,null),a.write(n,n.length),a.flush(),a.close()}else(t=new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(e,!0)).Write(n),t.Close()},saveAs:function(e){var n=document.createElement("iframe");n.setAttribute("src",""),n.style.visibility="hidden",document.body.appendChild(n);try{if(mxClient.IS_NS){var t=n.contentDocument;t.open(),t.write(e),t.close();try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),n.focus(),saveDocument(t)}catch(e){mxUtils.alert("Permission to save document denied.")}}else(t=n.contentWindow.document).write(e),t.execCommand("SaveAs",!1,document.location)}finally{document.body.removeChild(n)}},copy:function(e){if(window.clipboardData)window.clipboardData.setData("Text",e);else{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var n=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(n){var t=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(t){t.addDataFlavor("text/unicode");var a=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);a.data=e,t.setTransferData("text/unicode",a,2*e.length),n.setData(t,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}},load:function(e){return(e=new mxXmlRequest(e,null,"GET",!1)).send(),e},get:function(e,n,t){return new mxXmlRequest(e,null,"GET").send(n,t)},post:function(e,n,t,a){return new mxXmlRequest(e,n).send(t,a)},submit:function(e,n,t,a){return new mxXmlRequest(e,n).simulate(t,a)},loadInto:function(e,n,t){mxClient.IS_IE?n.onreadystatechange=function(){4==n.readyState&&t()}:n.addEventListener("load",t,!1),n.load(e)},getValue:function(e,n,t){return null==(e=null!=e?e[n]:null)&&(e=t),e},getNumber:function(e,n,t){return null==(e=null!=e?e[n]:null)&&(e=t||0),Number(e)},getColor:function(e,n,t){return null==(e=null!=e?e[n]:null)?e=t:e==mxConstants.NONE&&(e=null),e},clone:function(e,n,t){t=null!=t&&t;var a=null;if(null!=e&&"function"==typeof e.constructor){var i;a=new e.constructor;for(i in e)i!=mxObjectIdentity.FIELD_NAME&&(null==n||mxUtils.indexOf(n,i)<0)&&(a[i]=t||"object"!=typeof e[i]?e[i]:mxUtils.clone(e[i]))}return a},equalPoints:function(e,n){if(null==e&&null!=n||null!=e&&null==n||null!=e&&null!=n&&e.length!=n.length)return!1;if(null!=e&&null!=n)for(var t=0;t<e.length;t++)if(e[t]==n[t]||null!=e[t]&&!e[t].equals(n[t]))return!1;return!0},equalEntries:function(e,n){if(null==e&&null!=n||null!=e&&null==n||null!=e&&null!=n&&e.length!=n.length)return!1;if(null!=e&&null!=n)for(var t in e)if(e[t]!=n[t])return!1;return!0},extend:function(e,n){var t=function(){};t.prototype=n.prototype,e.prototype=new t,e.prototype.constructor=e},toString:function(e){var n,t="";for(n in e)try{if(null==e[n])t+=n+" = [null]\n";else if("function"==typeof e[n])t+=n+" => [Function]\n";else if("object"==typeof e[n])t=t+(n+" => [")+mxUtils.getFunctionName(e[n].constructor)+"]\n";else t+=n+" = "+e[n]+"\n"}catch(e){t+=n+"="+e.message}return t},toRadians:function(e){return Math.PI*e/180},arcToCurves:function(e,n,t,a,i,s,o,r,l){if(r-=e,l-=n,0===t||0===a)return h;t=Math.abs(t),a=Math.abs(a);var d=-r/2,c=-l/2,m=Math.cos(i*Math.PI/180);i=m*d+(h=Math.sin(i*Math.PI/180))*c;d=-1*h*d+m*c;r=m*(c=(s=1<(v=(c=i*i)/(g=t*t)+(p=d*d)/(A=a*a))?(t*=Math.sqrt(v),a*=Math.sqrt(v),0):(v=1,s===o&&(v=-1),v*Math.sqrt((g*A-g*p-A*c)/(g*p+A*c))))*t*d/a)-h*(p=-1*s*a*i/t)+r/2,l=h*c+m*p+l/2,s=0<=(g=Math.atan2((d-p)/a,(i-c)/t)-Math.atan2(0,1))?g:2*Math.PI+g,i=0<=(g=Math.atan2((-d-p)/a,(-i-c)/t)-Math.atan2((d-p)/a,(i-c)/t))?g:2*Math.PI+g,0==o&&0<i?i-=2*Math.PI:0!=o&&i<0&&(i+=2*Math.PI),o=2*i/Math.PI,i/=o=Math.ceil(o<0?-1*o:o),d=8/3*Math.sin(i/4)*Math.sin(i/4)/Math.sin(i/2),c=m*t,m*=a,t*=h,a*=h;for(var u=Math.cos(s),p=-d*(c*(b=Math.sin(s))+a*u),g=-d*(t*b-m*u),v=A=0,h=[],f=0;f<o;++f){s+=i;var b,A=c*(u=Math.cos(s))-a*(b=Math.sin(s))+r,E=(v=t*u+m*b+l,-d*(c*b+a*u));u=-d*(t*b-m*u);h[b=6*f]=Number(p+e),h[b+1]=Number(g+n),h[b+2]=Number(A-E+e),h[b+3]=Number(v-u+n),h[b+4]=Number(A+e),h[b+5]=Number(v+n),p=A+E,g=v+u}return h},getBoundingBox:function(e,n){var t=null;if(null!=e&&null!=n&&0!=n){var a=mxUtils.toRadians(n),i=(t=Math.cos(a),Math.sin(a)),s=new mxPoint(e.x+e.width/2,e.y+e.height/2),o=new mxPoint(e.x,e.y),r=new mxPoint((a=new mxPoint(e.x+e.width,e.y)).x,e.y+e.height),l=new mxPoint(e.x,r.y);o=mxUtils.getRotatedPoint(o,t,i,s),a=mxUtils.getRotatedPoint(a,t,i,s),r=mxUtils.getRotatedPoint(r,t,i,s),l=mxUtils.getRotatedPoint(l,t,i,s);(t=new mxRectangle(o.x,o.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),t.add(new mxRectangle(r.x,r.y,0,0)),t.add(new mxRectangle(l.x,l.y,0,0))}return t},getRotatedPoint:function(e,n,t,a){a=null!=a?a:new mxPoint;var i=e.x-a.x;return new mxPoint(i*n-(e=e.y-a.y)*t+a.x,e*n+i*t+a.y)},getPortConstraints:function(e,n,t,a){return null==(e=mxUtils.getValue(e.style,mxConstants.STYLE_PORT_CONSTRAINT,null))?a:(a=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,0<=a.indexOf(mxConstants.DIRECTION_NORTH)&&(e|=mxConstants.DIRECTION_MASK_NORTH),0<=a.indexOf(mxConstants.DIRECTION_WEST)&&(e|=mxConstants.DIRECTION_MASK_WEST),0<=a.indexOf(mxConstants.DIRECTION_SOUTH)&&(e|=mxConstants.DIRECTION_MASK_SOUTH),0<=a.indexOf(mxConstants.DIRECTION_EAST)&&(e|=mxConstants.DIRECTION_MASK_EAST),e)},reversePortConstraints:function(e){return(e&mxConstants.DIRECTION_MASK_WEST)<<3|(e&mxConstants.DIRECTION_MASK_NORTH)<<1|(e&mxConstants.DIRECTION_MASK_SOUTH)>>1|(e&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(e,n,t){var a=-1;if(0<e.absolutePoints.length)for(var i=e.absolutePoints[0],s=null,o=1;o<e.absolutePoints.length;o++){var r=e.absolutePoints[o];i=mxUtils.ptSegDistSq(i.x,i.y,r.x,r.y,n,t);(null==s||i<s)&&(s=i,a=o-1),i=r}return a},rectangleIntersectsSegment:function(e,n,t){var a=e.y,i=e.x,s=a+e.height,o=i+e.width;e=n.x;var r=t.x;if(n.x>t.x&&(e=t.x,r=n.x),o<r&&(r=o),e<i&&(e=i),r<e)return!1;i=n.y,o=t.y;var l=t.x-n.x;return 1e-7<Math.abs(l)&&(i=(t=(t.y-n.y)/l)*e+(n=n.y-t*n.x),o=t*r+n),o<i&&(n=o,o=i,i=n),s<o&&(o=s),i<a&&(i=a),!(o<i)},contains:function(e,n,t){return e.x<=n&&e.x+e.width>=n&&e.y<=t&&e.y+e.height>=t},intersects:function(e,n){var t=e.width,a=e.height,i=n.width,s=n.height;if(i<=0||s<=0||t<=0||a<=0)return!1;var o=e.x,r=e.y,l=n.x,d=n.y;s+=d,t+=o,a+=r;return((i=i+l)<l||o<i)&&(s<d||r<s)&&(t<o||l<t)&&(a<r||d<a)},intersectsHotspot:function(e,n,t,a,i,s){if(i=null!=i?i:0,s=null!=s?s:0,0<(a=null!=a?a:1)){var o=e.getCenterX(),r=e.getCenterY(),l=e.width,d=e.height,c=mxUtils.getValue(e.style,mxConstants.STYLE_STARTSIZE)*e.view.scale;return 0<c&&(mxUtils.getValue(e.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=e.y+c/2,d=c):(o=e.x+c/2,l=c)),l=Math.max(i,l*a),d=Math.max(i,d*a),0<s&&(l=Math.min(l,s),d=Math.min(d,s)),a=new mxRectangle(o-l/2,r-d/2,l,d),0!=(o=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(-o),s=Math.sin(-o),o=new mxPoint(e.getCenterX(),e.getCenterY()),n=(e=mxUtils.getRotatedPoint(new mxPoint(n,t),i,s,o)).x,t=e.y),mxUtils.contains(a,n,t)}return!0},getOffset:function(e,n){var t=0,a=0;if(null!=n&&n){var i=document.body,s=document.documentElement;t=t+(i.scrollLeft||s.scrollLeft),a=a+(i.scrollTop||s.scrollTop)}for(;e.offsetParent;)t+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;return new mxPoint(t,a)},getScrollOrigin:function(e){for(var n=document.body,t=document.documentElement,a=new mxPoint(n.scrollLeft||t.scrollLeft,n.scrollTop||t.scrollTop);null!=e&&e!=n&&e!=t;)!isNaN(e.scrollLeft)&&!isNaN(e.scrollTop)&&(a.x+=e.scrollLeft,a.y+=e.scrollTop),e=e.parentNode;return a},convertPoint:function(e,n,t){var a=mxUtils.getScrollOrigin(e);return(e=mxUtils.getOffset(e)).x-=a.x,e.y-=a.y,new mxPoint(n-e.x,t-e.y)},ltrim:function(e,n){return e.replace(RegExp("^["+(n||"\\s")+"]+","g"),"")},rtrim:function(e,n){return e.replace(RegExp("["+(n||"\\s")+"]+$","g"),"")},trim:function(e,n){return mxUtils.ltrim(mxUtils.rtrim(e,n),n)},isNumeric:function(e){return null!=e&&(null==e.length||0<e.length&&e.indexOf("0x")<0&&e.indexOf("0X")<0)&&!isNaN(e)},mod:function(e,n){return(e%n+n)%n},intersection:function(e,n,t,a,i,s,o,r){var l=(r-s)*(t-e)-(o-i)*(a-n);return o=((o-i)*(n-s)-(r-s)*(e-i))/l,i=((t-e)*(n-s)-(a-n)*(e-i))/l,0<=o&&o<=1&&0<=i&&i<=1?new mxPoint(e+o*(t-e),n+o*(a-n)):null},ptSegDistSq:function(e,n,t,a,i,s){return t=(i-=e)*(t-=e)+(s-=n)*(a-=n)<=0?0:(e=(i=t-i)*t+(s=a-s)*a)<=0?0:e*e/(t*t+a*a),(i=i*i+s*s-t)<0&&(i=0),i},relativeCcw:function(e,n,t,a,i,s){return 0==(e=(i-=e)*(a-=n)-(s-=n)*(t-=e))&&(0<(e=i*t+s*a)&&((e=(i-t)*t+(s-a)*a)<0&&(e=0))),e<0?-1:0<e?1:0},animateChanges:function(e,n){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(e,n,t){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(e,n,t,a,i,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(e,n){mxUtils.isVml(e)?e.style.filter=100<=n?null:"alpha(opacity="+n/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?e.style.filter=100<=n?null:"alpha(opacity="+n+")":e.style.opacity=n/100},createImage:function(e){var n=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((n=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",e),n.style.borderStyle="none"):((n=document.createElement("img")).setAttribute("src",e),n.setAttribute("border","0")),n},sortCells:function(e,i){i=null==i||i;var s=new mxDictionary;return e.sort(function(e,n){var t=s.get(e);null==t&&(t=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),s.put(e,t));var a=s.get(n);return null==a&&(a=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),s.put(n,a)),0==(t=mxCellPath.compare(t,a))?0:0<t==i?1:-1}),e},getStylename:function(e){return null!=e&&(e=e.split(";")[0]).indexOf("=")<0?e:""},getStylenames:function(e){var n=[];if(null!=e){e=e.split(";");for(var t=0;t<e.length;t++)e[t].indexOf("=")<0&&n.push(e[t])}return n},indexOfStylename:function(e,n){if(null!=e&&null!=n)for(var t=e.split(";"),a=0,i=0;i<t.length;i++){if(t[i]==n)return a;a+=t[i].length+1}return-1},addStylename:function(e,n){return mxUtils.indexOfStylename(e,n)<0&&(null==e?e="":0<e.length&&";"!=e.charAt(e.length-1)&&(e+=";"),e+=n),e},removeStylename:function(e,n){var t=[];if(null!=e)for(var a=e.split(";"),i=0;i<a.length;i++)a[i]!=n&&t.push(a[i]);return t.join(";")},removeAllStylenames:function(e){var n=[];if(null!=e){e=e.split(";");for(var t=0;t<e.length;t++)0<=e[t].indexOf("=")&&n.push(e[t])}return n.join(";")},setCellStyles:function(e,n,t,a){if(null!=n&&0<n.length){e.beginUpdate();try{for(var i=0;i<n.length;i++)if(null!=n[i]){var s=mxUtils.setStyle(e.getStyle(n[i]),t,a);e.setStyle(n[i],s)}}finally{e.endUpdate()}}},setStyle:function(e,n,t){var a=null!=t&&(void 0===t.length||0<t.length);if(null==e||0==e.length)a&&(e=n+"="+t);else{var i=e.indexOf(n+"=");i<0?a&&(a=";"==e.charAt(e.length-1)?"":";",e=e+a+n+"="+t):(n=a?n+"="+t:"",t=e.indexOf(";",i),a||t++,e=e.substring(0,i)+n+(i<t?e.substring(t):""))}return e},setCellStyleFlags:function(e,n,t,a,i){if(null!=n&&0<n.length){e.beginUpdate();try{for(var s=0;s<n.length;s++)if(null!=n[s]){var o=mxUtils.setStyleFlag(e.getStyle(n[s]),t,a,i);e.setStyle(n[s],o)}}finally{e.endUpdate()}}},setStyleFlag:function(e,n,t,a){if(null==e||0==e.length)e=a||null==a?n+"="+t:n+"=0";else{var i=e.indexOf(n+"=");if(i<0)i=";"==e.charAt(e.length-1)?"":";",e=a||null==a?e+i+n+"="+t:e+i+n+"=0";else{var s=e.indexOf(";",i),o="";o=s<0?e.substring(i+n.length+1):e.substring(i+n.length+1,s),o=null==a?parseInt(o)^t:a?parseInt(o)|t:parseInt(o)&~t;e=e.substring(0,i)+n+"="+o+(0<=s?e.substring(s):"")}}return e},getAlignmentAsPoint:function(e,n){var t=0,a=0;return e==mxConstants.ALIGN_CENTER?t=-.5:e==mxConstants.ALIGN_RIGHT&&(t=-1),n==mxConstants.ALIGN_MIDDLE?a=-.5:n==mxConstants.ALIGN_BOTTOM&&(a=-1),new mxPoint(t,a)},getSizeForString:function(e,n,t){n=null!=n?n:mxConstants.DEFAULT_FONTSIZE,t=null!=t?t:mxConstants.DEFAULT_FONTFAMILY;var a=document.createElement("div");return a.style.fontFamily=t,a.style.fontSize=Math.round(n)+"px",a.style.lineHeight=Math.round(n*mxConstants.LINE_HEIGHT)+"px",a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,document.body.appendChild(a),e=new mxRectangle(0,0,a.offsetWidth,a.offsetHeight),document.body.removeChild(a),e},getViewXml:function(e,n,t,a,i){a=null!=a?a:0,i=null!=i?i:0,n=null!=n?n:1,null==t&&(t=[e.getModel().getRoot()]);var s=e.getView(),o=null,r=s.isEventsEnabled();s.setEventsEnabled(!1);var l=s.drawPane,d=s.overlayPane;e.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1)),s.canvas.appendChild(s.overlayPane);var c=s.getTranslate();s.translate=new mxPoint(a,i),n=new mxTemporaryCellStates(e.getView(),n,t);try{o=(new mxCodec).encode(e.getView())}finally{n.destroy(),s.translate=c,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=l,s.overlayPane=d,s.setEventsEnabled(r)}return o},getScaleForPageCount:function(e,n,t,a){if(e<1)return 1;a=null!=a?a:0;var i=(t=null!=t?t:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*a;t=t.height-2*a,a=n.getGraphBounds().clone(),n=n.getView().getScale(),a.width/=n,a.height/=n,t=(n=a.width)/a.height/(i/t),a=Math.sqrt(e);var s=Math.sqrt(t);if(t=a*s,a/=s,t<1&&e<a){var o=a/e;a=e,t/=o}for(a<1&&e<t&&(o=t/e,t=e,a/=o),o=Math.ceil(t)*Math.ceil(a),s=0;e<o;){o=Math.floor(t)/t;var r=Math.floor(a)/a;if(1==o&&(o=Math.floor(t-1)/t),1==r&&(r=Math.floor(a-1)/a),t*=o=r<o?o:r,a*=o,o=Math.ceil(t)*Math.ceil(a),10<++s)break}return i*t/n*.99999},show:function(e,n,t,a){if(t=null!=t?t:0,a=null!=a?a:0,null==n?n=window.open().document:n.open(),t=-(i=e.getGraphBounds()).x+t,a=-i.y+a,mxClient.IS_IE){for(var i="<html><head>",s=document.getElementsByTagName("base"),o=0;o<s.length;o++)i+=s[o].outerHTML;for(i+="<style>",o=0;o<document.styleSheets.length;o++)try{i+=document.styleSheets(o).cssText}catch(e){}i+="</style></head>",i+="<body>",i+=e.container.innerHTML,i+="</body>",i+="<html>",n.writeln(i),n.close(),null!=(e=n.body.getElementsByTagName("DIV")[0])&&(e.style.position="absolute",e.style.left=t+"px",e.style.top=a+"px")}else{for(n.writeln("<html"),n.writeln("<head>"),s=document.getElementsByTagName("base"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("link"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("style"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(n.writeln("</head>"),n.writeln("</html>"),n.close(),null==n.body&&n.documentElement.appendChild(n.createElement("body")),n.body.style.overflow="auto",e=e.container.firstChild;null!=e;)o=e.cloneNode(!0),n.body.appendChild(o),e=e.nextSibling;null!=(e=n.getElementsByTagName("g")[0])&&(e.setAttribute("transform","translate("+t+","+a+")"),(t=e.ownerSVGElement).setAttribute("width",i.width+Math.max(i.x,0)+3),t.setAttribute("height",i.height+Math.max(i.y,0)+3))}return mxUtils.removeCursors(n.body),n},printScreen:function(e){var n=window.open();mxUtils.show(e,n.document),e=function(){n.focus(),n.print(),n.close()},mxClient.IS_GC?n.setTimeout(e,500):e()},popup:function(e,n){if(n){var t=document.createElement("div");t.style.overflow="scroll",t.style.width="636px",t.style.height="460px";var a=document.createElement("pre");a.innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),t.appendChild(a),(t=new mxWindow("Popup Window",t,document.body.clientWidth/2-320,(document.body.clientHeight||document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),t.setVisible(!0)}else mxClient.IS_NS?((t=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(e)+"</pre"),t.document.close()):((a=(t=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),t.document.body.appendChild(a))},alert:function(e){alert(e)},prompt:function(e,n){return prompt(e,n)},confirm:function(e){return confirm(e)},error:function(e,n,t,a){var i=document.createElement("div");i.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",a||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",i.appendChild(s),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),mxUtils.write(i,e),e=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight;var o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,i,(e-n)/2,a/4,n,null,!1,!0);return t&&(mxUtils.br(i),n=document.createElement("p"),t=document.createElement("button"),mxClient.IS_IE?t.style.cssText="float:right":t.setAttribute("style","float:right"),mxEvent.addListener(t,"click",function(e){o.destroy()}),mxUtils.write(t,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),n.appendChild(t),i.appendChild(n),mxUtils.br(i),o.setClosable(!0)),o.setVisible(!0),o},makeDraggable:function(e,n,t,i,a,s,o,r,l,d){return(e=new mxDragSource(e,t)).dragOffset=new mxPoint(null!=a?a:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),e.autoscroll=o,e.setGuidesEnabled(!1),null!=l&&(e.highlightDropTargets=l),null!=d&&(e.getDropTarget=d),e.getGraphForEvent=function(e){return"function"==typeof n?n(e):n},null!=i&&(e.createDragElement=function(){return i.cloneNode(!0)},r&&(e.createPreviewElement=function(e){var n=i.cloneNode(!0),t=parseInt(n.style.width),a=parseInt(n.style.height);return n.style.width=Math.round(t*e.view.scale)+"px",n.style.height=Math.round(a*e.view.scale)+"px",n})),e}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",HIGHLIGHT_STROKEWIDTH:3,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_BEND_HANDLE:"pointer",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:7,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,LINE_HEIGHT:1.2,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:10,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_OPACITY:"opacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_LOOP:"loopStyle",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_SHADOW:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_BLOCK:"block",ARROW_OPEN:"open",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(e){this.name=e,this.properties=[];for(var n=1;n<arguments.length;n+=2)null!=arguments[n+1]&&(this.properties[arguments[n]]=arguments[n+1])}function mxMouseEvent(e,n){this.evt=e,this.state=n}function mxEventSource(e){this.setEventSource(e)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(e){return this.properties[e]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(e){if(null!=e)for(var n=this.getSource();null!=n;){if(n==e.node)return!0;n=n.parentNode}return!1},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var e=this.getState();return null!=e?e.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(e){(null==e||e)&&this.evt.preventDefault&&this.evt.preventDefault(),this.evt.returnValue=!1,this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(e){this.eventsEnabled=e},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(e){this.eventSource=e},mxEventSource.prototype.addListener=function(e,n){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(e),this.eventListeners.push(n)},mxEventSource.prototype.removeListener=function(e){if(null!=this.eventListeners)for(var n=0;n<this.eventListeners.length;)this.eventListeners[n+1]==e?this.eventListeners.splice(n,2):n+=2},mxEventSource.prototype.fireEvent=function(e,n){if(null!=this.eventListeners&&this.isEventsEnabled()){null==e&&(e=new mxEventObject),null==n&&(n=this.getEventSource()),null==n&&(n=this);for(var t=[n,e],a=0;a<this.eventListeners.length;a+=2){var i=this.eventListeners[a];(null==i||i==e.getName())&&this.eventListeners[a+1].apply(this,t)}}};var mxEvent={objects:[],addListener:function(){var a=function(e,n,t){null==e.mxListenerList&&(e.mxListenerList=[],mxEvent.objects.push(e)),e.mxListenerList.push({name:n,f:t})};return window.addEventListener?function(e,n,t){e.addEventListener(n,t,!1),a(e,n,t)}:function(e,n,t){e.attachEvent("on"+n,t),a(e,n,t)}}(),removeListener:function(){var a=function(e,n,t){if(null!=e.mxListenerList){n=e.mxListenerList.length;for(var a=0;a<n;a++)if(e.mxListenerList[a].f==t){e.mxListenerList.splice(a,1);break}0==e.mxListenerList.length&&(e.mxListenerList=null)}};return window.removeEventListener?function(e,n,t){e.removeEventListener(n,t,!1),a(e,n,t)}:function(e,n,t){e.detachEvent("on"+n,t),a(e,n,t)}}(),removeAllListeners:function(e){var n=e.mxListenerList;if(null!=n)for(;0<n.length;){var t=n[0];mxEvent.removeListener(e,t.name,t.f)}},addGestureListeners:function(e,n,t,a){null!=n&&mxEvent.addListener(e,"mousedown",n),null!=t&&mxEvent.addListener(e,"mousemove",t),null!=a&&mxEvent.addListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=n&&mxEvent.addListener(e,"touchstart",n),null!=t&&mxEvent.addListener(e,"touchmove",t),null!=a&&mxEvent.addListener(e,"touchend",a))},removeGestureListeners:function(e,n,t,a){null!=n&&mxEvent.removeListener(e,"mousedown",n),null!=t&&mxEvent.removeListener(e,"mousemove",t),null!=a&&mxEvent.removeListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=n&&mxEvent.removeListener(e,"touchstart",n),null!=t&&mxEvent.removeListener(e,"touchmove",t),null!=a&&mxEvent.removeListener(e,"touchend",a))},redirectMouseEvents:function(e,t,n,a,i,s,o){var r=function(e){return"function"==typeof n?n(e):n};mxEvent.addGestureListeners(e,function(e){null!=a?a(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,r(e)))},function(e){null!=i?i(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))},function(e){null!=s?s(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e)))}),mxEvent.addListener(e,"dblclick",function(e){if(null!=o)o(e);else if(!mxEvent.isConsumed(e)){var n=r(e);t.dblClick(e,null!=n?n.cell:null)}})},release:function(e){if(null!=e&&(mxEvent.removeAllListeners(e),null!=(e=e.childNodes)))for(var n=e.length,t=0;t<n;t+=1)mxEvent.release(e[t])},addMouseWheelListener:function(t){if(null!=t){var e=function(e){null==e&&(e=window.event);var n=0;0!=(n=!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC?e.wheelDelta/120:-e.detail/2)&&t(e,0<n)};mxClient.IS_NS?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",e):mxEvent.addListener(document,"mousewheel",e)}},disableContextMenu:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){mxEvent.addListener(e,"contextmenu",function(){return!1})}:function(e){e.setAttribute("oncontextmenu","return false;")},getSource:function(e){return null!=e.srcElement?e.srcElement:e.target},isConsumed:function(e){return null!=e.isConsumed&&e.isConsumed},isLeftMouseButton:function(e){return e.button==(mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?1:0)},isRightMouseButton:function(e){return 2==e.button},isPopupTrigger:function(e){return mxEvent.isRightMouseButton(e)||mxEvent.isShiftDown(e)&&!mxEvent.isControlDown(e)},isShiftDown:function(e){return null!=e&&e.shiftKey},isAltDown:function(e){return null!=e&&e.altKey},isControlDown:function(e){return null!=e&&e.ctrlKey},isMetaDown:function(e){return null!=e&&e.metaKey},getMainEvent:function(e){return"touchstart"!=e.type&&"touchmove"!=e.type||null==e.touches||null==e.touches[0]?"touchend"==e.type&&null!=e.changedTouches&&null!=e.changedTouches[0]&&(e=e.changedTouches[0]):e=e.touches[0],e},getClientX:function(e){return mxEvent.getMainEvent(e).clientX},getClientY:function(e){return mxEvent.getMainEvent(e).clientY},consume:function(e,n,t){t=null==t||t,(null==n||n)&&(e.preventDefault?(t&&e.stopPropagation(),e.preventDefault()):t&&(e.cancelBubble=!0)),e.isConsumed=!0,e.returnValue=!1},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",SESSION:"session",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(e,n,t,a,i,s){this.url=e,this.params=n,this.method=t||"POST",this.async=null==a||a,this.username=i,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(e){this.binary=e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var e=this.getXml();return null!=e?e.documentElement:null},mxXmlRequest.prototype.getXml=function(){var e=this.request.responseXML;return(9<=document.documentMode||null==e||null==e.documentElement)&&(e=mxUtils.parseXml(this.request.responseText)),e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var e=new XMLHttpRequest;return this.isBinary()&&e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined"),e}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(e,n){this.request=this.create(),null!=this.request&&(null!=e&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(e(this),this.onreadystatechaange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(e,n){null!=n&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(e,n){var t=null;(e=e||document)==document&&(t=window.onbeforeunload,window.onbeforeunload=null);var a=e.createElement("form");a.setAttribute("method",this.method),a.setAttribute("action",this.url),null!=n&&a.setAttribute("target",n),a.style.display="none",a.style.visibility="hidden";for(var i=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),s=0;s<i.length;s++){if(0<(o=i[s].indexOf("="))){var o,r=i[s].substring(0,o),l=i[s].substring(o+1);(o=e.createElement("textarea")).setAttribute("name",r),l=l.replace(/\n/g,"&#xa;"),r=e.createTextNode(l),o.appendChild(r),a.appendChild(o)}}e.body.appendChild(a),a.submit(),e.body.removeChild(a),null!=t&&(window.onbeforeunload=t)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,isEmpty:function(){return null==mxClipboard.cells},cut:function(e,n){return n=mxClipboard.copy(e,n),mxClipboard.insertCount=0,mxClipboard.removeCells(e,n),n},removeCells:function(e,n){e.removeCells(n)},copy:function(e,n){n=n||e.getSelectionCells();var t=e.getExportableCells(n);return mxClipboard.insertCount=1,mxClipboard.cells=e.cloneCells(t),t},paste:function(e){if(null!=mxClipboard.cells){var n=e.getImportableCells(mxClipboard.cells),t=mxClipboard.insertCount*mxClipboard.STEPSIZE,a=e.getDefaultParent();n=e.importCells(n,t,t,a);mxClipboard.insertCount++,e.setSelectionCells(n)}}};function mxWindow(e,n,t,a,i,s,o,r,l,d){null!=n&&(o=null==o||o,this.content=n,this.init(t,a,i,s,d),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(e),(null==r||r)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}function mxForm(e){this.table=document.createElement("table"),this.table.className=e,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(e,n,t){this.src=e,this.width=n,this.height=t}function mxDivResizer(e,n){if("div"==e.nodeName.toLowerCase()){null==n&&(n=window),this.div=e;var t=mxUtils.getCurrentStyle(e);null!=t&&(this.resizeWidth="auto"==t.width,this.resizeHeight="auto"==t.height),mxEvent.addListener(n,"resize",mxUtils.bind(this,function(e){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(e,n){this.element=e,this.dropHandler=n,mxEvent.addGestureListeners(e,mxUtils.bind(this,this.mouseDown))}function mxToolbar(e){this.container=e}function mxSession(n,e,t,a){this.model=n,this.urlInit=e,this.urlPoll=t,this.urlNotify=a,null!=n&&(this.codec=new mxCodec,this.codec.lookup=function(e){return n.getCell(e)}),n.addListener(mxEvent.NOTIFY,mxUtils.bind(this,function(e,n){var t=n.getProperty("edit");(null!=t&&this.debug||this.connected&&!this.suspended)&&this.notify("<edit>"+this.encodeChanges(t.changes,t.undone)+"</edit>")}))}function mxUndoableEdit(e,n){this.source=e,this.changes=[],this.significant=null==n||n}function mxUndoManager(e){this.size=null!=e?e:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.content=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.title=!1,mxWindow.prototype.content=!1,mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.init=function(e,n,t,a,i){i=null!=i?i:"mxWindow",this.div=document.createElement("div"),this.div.className=i,this.div.style.left=e+"px",this.div.style.top=n+"px",this.table=document.createElement("table"),this.table.className=i,null!=t&&(mxClient.IS_IE||(this.div.style.width=t+"px"),this.table.style.width=t+"px"),null!=a&&(mxClient.IS_IE||(this.div.style.height=a+"px"),this.table.style.height=a+"px"),e=document.createElement("tbody"),n=document.createElement("tr"),this.title=document.createElement("td"),this.title.className=i+"Title",n.appendChild(this.title),e.appendChild(n),n=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=i+"Pane",this.contentWrapper=document.createElement("div"),this.contentWrapper.className=i+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_IE||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),n.appendChild(this.td),e.appendChild(n),this.table.appendChild(e),this.div.appendChild(this.table),i=mxUtils.bind(this,function(e){this.activate()}),mxEvent.addListener(this.title,"mousedown",i),mxEvent.addListener(this.table,"mousedown",i),mxClient.IS_TOUCH&&(mxEvent.addListener(this.title,"touchstart",i),mxEvent.addListener(this.table,"touchstart",i)),this.hide()},mxWindow.prototype.setTitle=function(e){for(var n=this.title.firstChild;null!=n;){var t=n.nextSibling;n.nodeType==mxConstants.NODETYPE_TEXT&&n.parentNode.removeChild(n),n=t}mxUtils.write(this.title,e||"")},mxWindow.prototype.setScrollable=function(e){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=e?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var e=null!=(e=mxUtils.getCurrentStyle(this.getElement()))?e.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}n=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(e){e?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif"),this.resize.style.cursor="nw-resize",mxEvent.addGestureListeners(this.resize,mxUtils.bind(this,function(e){this.activate();var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.div.offsetWidth,o=this.div.offsetHeight,n=mxUtils.bind(this,function(e){var n=mxEvent.getClientX(e)-a,t=mxEvent.getClientY(e)-i;this.setSize(s+n,o+t),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",e)),mxEvent.consume(e)}),t=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",e)),mxEvent.consume(e)}),null,null),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(e,n){e=Math.max(this.minimumSize.width,e),n=Math.max(this.minimumSize.height,n),mxClient.IS_IE||(this.div.style.width=e+"px",this.div.style.height=n+"px"),this.table.style.width=e+"px",this.table.style.height=n+"px",mxClient.IS_IE||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")},mxWindow.prototype.setMinimizable=function(e){this.minimize.style.display=e?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("align","right"),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginRight="1px",this.minimize.style.display="none",this.title.appendChild(this.minimize);var t=!1,a=null,i=null,e=mxUtils.bind(this,function(e){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=a,mxClient.IS_IE||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",a=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var n=this.getMinimumSize();0<n.height&&(mxClient.IS_IE||(this.div.style.height=n.height+"px"),this.table.style.height=n.height+"px"),0<n.width&&(mxClient.IS_IE||(this.div.style.width=n.width+"px"),this.table.style.width=n.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",e))}mxEvent.consume(e)});mxEvent.addListener(this.minimize,"mousedown",e),mxClient.IS_TOUCH&&mxEvent.addListener(this.minimize,"touchstart",e)},mxWindow.prototype.setMaximizable=function(e){this.maximize.style.display=e?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("align","right"),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="1px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.title.appendChild(this.maximize);var t=!1,a=null,i=null,s=null,o=null,e=mxUtils.bind(this,function(e){if(this.activate(),"none"!=this.maximize.style.display){if(t)t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.visibility="",this.div.style.left=a+"px",this.div.style.top=i+"px",mxClient.IS_IE||(this.div.style.height=s,this.div.style.width=o,"auto"!=(n=mxUtils.getCurrentStyle(this.contentWrapper)).overflow&&null==this.resize)||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.table.style.height=s,this.table.style.width=o,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{if(t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",this.minimize.style.visibility="hidden",a=parseInt(this.div.style.left),i=parseInt(this.div.style.top),s=this.table.style.height,o=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",mxClient.IS_IE||(this.div.style.height=document.body.clientHeight-2+"px",this.div.style.width=document.body.clientWidth-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=document.body.clientHeight-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_IE){var n=mxUtils.getCurrentStyle(this.contentWrapper);"auto"!=n.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",e))}mxEvent.consume(e)}});mxEvent.addGestureListeners(this.maximize,e),mxEvent.addListener(this.title,"dblclick",e)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(e){var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.getX(),o=this.getY(),n=mxUtils.bind(this,function(e){var n=mxEvent.getClientX(e)-a,t=mxEvent.getClientY(e)-i;this.setLocation(s+n,o+t),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",e)),mxEvent.consume(e)}),t=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",e)),mxEvent.consume(e)}))},mxWindow.prototype.setLocation=function(e,n){this.div.style.left=e+"px",this.div.style.top=n+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("align","right"),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.title.insertBefore(this.closeImg,this.title.firstChild),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",e)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(e)}))},mxWindow.prototype.setImage=function(e){this.image=document.createElement("img"),this.image.setAttribute("src",e),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(e){this.closeImg.style.display=e?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"hidden"!=this.div.style.visibility},mxWindow.prototype.setVisible=function(e){null!=this.div&&this.isVisible()!=e&&(e?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.visibility="",this.activate();var e=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_IE||"auto"!=e.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.visibility="hidden",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.contentWrapper=this.content=this.title=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(e,n){var t=document.createElement("tr"),a=document.createElement("td");t.appendChild(a);a=document.createElement("td");var i=document.createElement("button");mxUtils.write(i,mxResources.get("ok")||"OK"),a.appendChild(i),mxEvent.addListener(i,"click",function(){e()}),i=document.createElement("button"),mxUtils.write(i,mxResources.get("cancel")||"Cancel"),a.appendChild(i),mxEvent.addListener(i,"click",function(){n()}),t.appendChild(a),this.body.appendChild(t)},mxForm.prototype.addText=function(e,n){var t=document.createElement("input");return t.setAttribute("type","text"),t.value=n,this.addField(e,t)},mxForm.prototype.addCheckbox=function(e,n){var t=document.createElement("input");return t.setAttribute("type","checkbox"),this.addField(e,t),n&&(t.checked=!0),t},mxForm.prototype.addTextarea=function(e,n,t){var a=document.createElement("textarea");return mxClient.IS_NS&&t--,a.setAttribute("rows",t||2),a.value=n,this.addField(e,a)},mxForm.prototype.addCombo=function(e,n,t){var a=document.createElement("select");return null!=t&&a.setAttribute("size",t),n&&a.setAttribute("multiple","true"),this.addField(e,a)},mxForm.prototype.addOption=function(e,n,t,a){var i=document.createElement("option");mxUtils.writeln(i,n),i.setAttribute("value",t),a&&i.setAttribute("selected",a),e.appendChild(i)},mxForm.prototype.addField=function(e,n){var t=document.createElement("tr"),a=document.createElement("td");return mxUtils.write(a,e),t.appendChild(a),(a=document.createElement("td")).appendChild(n),t.appendChild(a),this.body.appendChild(t),n},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var e=this.getDocumentWidth(),n=this.getDocumentHeight(),t=parseInt(this.div.style.left),a=parseInt(this.div.style.right),i=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(t)&&!isNaN(a)&&0<=t&&0<=a&&0<e-a-t&&(this.div.style.width=e-a-t+"px"),this.resizeHeight&&!isNaN(i)&&!isNaN(s)&&0<=i&&0<=s&&0<n-i-s&&(this.div.style.height=n-i-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(e){this.enabled=e},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(e){this.guidesEnabled=e},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxDragSource.prototype.getGraphForEvent=function(e){return null},mxDragSource.prototype.getDropTarget=function(e,n,t){return e.getCellAt(n,t)},mxDragSource.prototype.createDragElement=function(e){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(e){return null},mxDragSource.prototype.mouseDown=function(e){this.enabled&&!mxEvent.isConsumed(e)&&null==this.mouseMoveHandler&&(this.startDrag(e),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxEvent.consume(e,!0,!1))},mxDragSource.prototype.startDrag=function(e){this.dragElement=this.createDragElement(e),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity)},mxDragSource.prototype.stopDrag=function(e){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.graphContainsEvent=function(e,n){var t=mxEvent.getClientX(n),a=mxEvent.getClientY(n),i=mxUtils.getOffset(e.container),s=mxUtils.getScrollOrigin();return t>=i.x-s.x&&a>=i.y-s.y&&t<=i.x-s.x+e.container.offsetWidth&&a<=i.y-s.y+e.container.offsetHeight},mxDragSource.prototype.mouseMove=function(e){if(null!=(n=this.getGraphForEvent(e))&&!this.graphContainsEvent(n,e)&&(n=null),n!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph),this.currentGraph=n,null!=this.currentGraph&&this.dragEnter(this.currentGraph)),null!=this.currentGraph&&this.dragOver(this.currentGraph,e),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(e),t=mxEvent.getClientY(e);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,t+=this.dragOffset.y),n+=document.body.scrollLeft||document.documentElement.scrollLeft,t+=document.body.scrollTop||document.documentElement.scrollTop,this.dragElement.style.left=n+"px",this.dragElement.style.top=t+"px"}mxEvent.consume(e)},mxDragSource.prototype.mouseUp=function(e){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var n=this.currentGraph.view.scale,t=this.currentGraph.view.translate;this.drop(this.currentGraph,e,this.currentDropTarget,this.currentPoint.x/n-t.x,this.currentPoint.y/n-t.y)}this.dragExit(this.currentGraph)}this.stopDrag(e),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.currentGraph=this.mouseUpHandler=this.mouseMoveHandler=null,mxEvent.consume(e)},mxDragSource.prototype.dragEnter=function(e){e.isMouseDown=!0,this.previewElement=this.createPreviewElement(e),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(e,e.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(e,mxConstants.DROP_TARGET_COLOR))},mxDragSource.prototype.dragExit=function(e){this.currentPoint=this.currentDropTarget=null,e.isMouseDown=!1,null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(e,n){var t=mxUtils.getOffset(e.container),a=mxUtils.getScrollOrigin(e.container),i=mxEvent.getClientX(n)-t.x+a.x;t=mxEvent.getClientY(n)-t.y+a.y;if(e.autoScroll&&(null==this.autoscroll||this.autoscroll)&&e.scrollPointToVisible(i,t,e.autoExtend),null!=this.currentHighlight&&e.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(e,i,t),a=e.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(a)),null!=this.previewElement){null==this.previewElement.parentNode&&(e.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");a=this.isGridEnabled()&&e.isGridEnabledEvent(n);var s=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(n))s=new mxRectangle(0,0,s=parseInt(this.previewElement.style.width),o=parseInt(this.previewElement.style.height)),t=new mxPoint(i,t),t=this.currentGuide.move(s,t,a),s=!1,i=t.x,t=t.y;else if(a){a=e.view.scale;var o=e.view.translate,r=e.gridSize/2;i=(e.snap(i/a-o.x-r)+o.x)*a,t=(e.snap(t/a-o.y-r)+o.y)*a}null!=this.currentGuide&&s&&this.currentGuide.hide(),null!=this.previewOffset&&(i+=this.previewOffset.x,t+=this.previewOffset.y),this.previewElement.style.left=Math.round(i)+"px",this.previewElement.style.top=Math.round(t)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(i,t)},mxDragSource.prototype.drop=function(e,n,t,a,i){this.dropHandler(e,n,t,a,i),e.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(e,n,t,a,i,s){var o=document.createElement(null!=n?"img":"button"),r=i||(null!=s?"mxToolbarMode":"mxToolbarItem");return o.className=r,o.setAttribute("src",n),null!=e&&(null!=n?o.setAttribute("title",e):mxUtils.write(o,e)),this.container.appendChild(o),null!=t&&(mxEvent.addListener(o,"click",t),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",t)),e=mxUtils.bind(this,function(e){null!=a?o.setAttribute("src",n):o.style.backgroundColor=""}),mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){if(null!=a?o.setAttribute("src",a):o.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var n=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu(),n!=o&&(this.currentImg=o,this.menu.factoryMethod=s,n=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight),this.menu.popup(n.x,n.y,null,e),this.menu.isMenuShowing()&&(o.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=r,this.currentImg=null}))}}),null,e),mxEvent.addListener(o,"mouseout",e),o},mxToolbar.prototype.addCombo=function(e){var n=document.createElement("div");n.style.display="inline",n.className="mxToolbarComboContainer";var t=document.createElement("select");return t.className=e||"mxToolbarCombo",n.appendChild(t),this.container.appendChild(n),t},mxToolbar.prototype.addActionCombo=function(e,n){var t=document.createElement("select");return t.className=n||"mxToolbarCombo",this.addOption(t,e,null),mxEvent.addListener(t,"change",function(e){var n=t.options[t.selectedIndex];t.selectedIndex=0,null!=n.funct&&n.funct(e)}),this.container.appendChild(t),t},mxToolbar.prototype.addOption=function(e,n,t){var a=document.createElement("option");return mxUtils.writeln(a,n),"function"==typeof t?a.funct=t:a.setAttribute("value",t),e.appendChild(a),a},mxToolbar.prototype.addSwitchMode=function(e,n,t,a,i){var s=document.createElement("img");return s.initialClassName=i||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",n),s.altIcon=a,null!=e&&s.setAttribute("title",e),mxEvent.addListener(s,"click",mxUtils.bind(this,function(e){null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),null!=(e=(this.selectedMode=s).altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),t()})),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),t()),s},mxToolbar.prototype.addMode=function(e,n,t,a,i,s){s=null==s||s;var o=document.createElement(null!=n?"img":"button");return o.initialClassName=i||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",n),o.altIcon=a,null!=e&&o.setAttribute("title",e),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,function(e){this.selectMode(o,t),this.noReset=!1})),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,function(e){this.selectMode(o,t),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=t,this.selectMode(o,t))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(e,n){if(this.selectedMode!=e){if(null!=this.selectedMode){var t=this.selectedMode.altIcon;null!=t?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",t)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=e,null!=(t=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",t)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",n))}},mxToolbar.prototype.resetMode=function(e){(e||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(e){return this.addItem(null,e,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var e=document.createElement("hr");e.style.marginRight="6px",e.setAttribute("size","1"),this.container.appendChild(e)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null,null!=this.menu&&this.menu.destroy()},mxSession.prototype=new mxEventSource,mxSession.prototype.constructor=mxSession,mxSession.prototype.model=null,mxSession.prototype.urlInit=null,mxSession.prototype.urlPoll=null,mxSession.prototype.urlNotify=null,mxSession.prototype.codec=null,mxSession.prototype.linefeed="&#xa;",mxSession.prototype.escapePostData=!0,mxSession.prototype.significantRemoteChanges=!0,mxSession.prototype.sent=0,mxSession.prototype.received=0,mxSession.prototype.debug=!1,mxSession.prototype.connected=!1,mxSession.prototype.suspended=!1,mxSession.prototype.polling=!1,mxSession.prototype.start=function(){this.debug?(this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT))):this.connected||this.get(this.urlInit,mxUtils.bind(this,function(e){this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT)),this.poll()}))},mxSession.prototype.suspend=function(){this.connected&&!this.suspended&&(this.suspended=!0,this.fireEvent(new mxEventObject(mxEvent.SUSPEND)))},mxSession.prototype.resume=function(e,n,t){this.connected&&this.suspended&&(this.suspended=!1,this.fireEvent(new mxEventObject(mxEvent.RESUME)),this.polling||this.poll())},mxSession.prototype.stop=function(e){this.connected&&(this.connected=!1),this.fireEvent(new mxEventObject(mxEvent.DISCONNECT,"reason",e))},mxSession.prototype.poll=function(){this.connected&&!this.suspended&&null!=this.urlPoll?(this.polling=!0,this.get(this.urlPoll,mxUtils.bind(this,function(){this.poll()}))):this.polling=!1},mxSession.prototype.notify=function(e,n,t){null!=e&&0<e.length&&(null!=this.urlNotify&&(this.debug?(mxLog.show(),mxLog.debug("mxSession.notify: "+this.urlNotify+" xml="+e)):(e="<message><delta>"+e+"</delta></message>",this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(this.urlNotify,"xml="+e,n,t))),this.sent+=e.length,this.fireEvent(new mxEventObject(mxEvent.NOTIFY,"url",this.urlNotify,"xml",e)))},mxSession.prototype.get=function(t,a,n){if(void 0!==mxUtils){var i=mxUtils.bind(this,function(e){null!=n?n(e):this.stop(e)});mxUtils.get(t,mxUtils.bind(this,function(e){if(void 0!==mxUtils)if(e.isReady()&&404!=e.getStatus()){if(this.received+=e.getText().length,this.fireEvent(new mxEventObject(mxEvent.GET,"url",t,"request",e)),this.isValidResponse(e)){if(0<e.getText().length){var n=e.getDocumentElement();null==n?i("Invalid response: "+e.getText()):this.receive(n)}null!=a&&a(e)}}else i("Response not ready")}),function(e){i("Transmission error")})}},mxSession.prototype.isValidResponse=function(e){return e.getText().indexOf("<?php")<0},mxSession.prototype.encodeChanges=function(e,n){for(var t="",a=n?-1:1,i=n?e.length-1:0;0<=i&&i<e.length;i+=a){var s=this.codec.encode(e[i]);t=t+mxUtils.getXml(s,this.linefeed)}return t},mxSession.prototype.receive=function(e){if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){var n=e.getAttribute("namespace");for(null!=n&&(this.model.prefix=n+"-"),n=e.firstChild;null!=n;){var t=n.nodeName.toLowerCase();"state"==t?this.processState(n):"delta"==t&&this.processDelta(n),n=n.nextSibling}this.fireEvent(new mxEventObject(mxEvent.RECEIVE,"node",e))}},mxSession.prototype.processState=function(e){new mxCodec(e.ownerDocument).decode(e.firstChild,this.model)},mxSession.prototype.processDelta=function(e){for(e=e.firstChild;null!=e;)"edit"==e.nodeName&&this.processEdit(e),e=e.nextSibling},mxSession.prototype.processEdit=function(e){if(0<(e=this.decodeChanges(e)).length){var n=this.createUndoableEdit(e);this.model.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",n,"changes",e)),this.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.fireEvent(new mxEventObject(mxEvent.FIRED,"edit",n))}},mxSession.prototype.createUndoableEdit=function(e){var n=new mxUndoableEdit(this.model,this.significantRemoteChanges);return n.changes=e,n.notify=function(){n.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",n,"changes",n.changes)),n.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",n,"changes",n.changes))},n},mxSession.prototype.decodeChanges=function(e){this.codec.document=e.ownerDocument;var n=[];for(e=e.firstChild;null!=e;){var t=this.decodeChange(e);null!=t&&n.push(t),e=e.nextSibling}return n},mxSession.prototype.decodeChange=function(e){var n=null;return e.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=(n="mxRootChange"==e.nodeName?new mxCodec(e.ownerDocument).decode(e):this.codec.decode(e))&&(n.model=this.model,n.execute(),"mxChildChange"==e.nodeName&&null==n.parent&&this.cellRemoved(n.child))),n},mxSession.prototype.cellRemoved=function(e,n){this.codec.putObject(e.getId(),e);for(var t=this.model.getChildCount(e),a=0;a<t;a++)this.cellRemoved(this.model.getChildAt(e,a))},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(e){this.changes.push(e)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length-1;0<=e;e--){var n=this.changes[e];null!=n.execute?n.execute():null!=n.undo&&n.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length,n=0;n<e;n++){var t=this.changes[n];null!=t.execute?t.execute():null!=t.redo&&t.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var e=this.history[--this.indexOfNextAdd];if(e.undo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var e=this.history.length;this.indexOfNextAdd<e;){var n=this.history[this.indexOfNextAdd++];if(n.redo(),n.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",n));break}}},mxUndoManager.prototype.undoableEditHappened=function(e){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(e),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",e))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var e=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),n=0;n<e.length;n++)e[n].die()};var mxUrlConverter=function(e){var t=!0,a=null,i=null;return{isEnabled:function(){return t},setEnabled:function(e){t=e},getBaseUrl:function(){return a},setBaseUrl:function(e){a=e},getBaseDomain:function(){return a},setBaseDomain:function(e){a=e},isRelativeUrl:function(e){return"http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8)&&"data:image"!=e.substring(0,10)},convert:function(e){if(t&&this.isRelativeUrl(e)){if(null==a){i=location.protocol+"//"+location.host;var n=(a=i+location.pathname).lastIndexOf("/");0<n&&(a=a.substring(0,n+1))}e="/"==e.charAt(0)?i+e:a+e}return e}}};function mxPanningManager(s){this.thread=null,this.active=!1,this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0,this.scrollbars=!1,this.scrollTop=this.scrollLeft=0,this.mouseListener={mouseDown:function(e,n){},mouseMove:function(e,n){},mouseUp:mxUtils.bind(this,function(e,n){this.active&&this.stop()})},s.addMouseListener(this.mouseListener),mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var o=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(s.container),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-s.container.scrollLeft-Math.ceil(this.dx),n=-s.container.scrollTop-Math.ceil(this.dy);s.panGraph(e,n),s.panDx=this.scrollLeft-s.container.scrollLeft,s.panDy=this.scrollTop-s.container.scrollTop,s.fireEvent(new mxEventObject(mxEvent.PAN))}else s.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=s.view.translate.x,this.t0y=s.view.translate.y,this.active=!0},this.panTo=function(e,n,t,a){this.active||this.start(),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,a=null!=a?a:0;var i=s.container;this.dx=e+(null!=t?t:0)-i.scrollLeft-i.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.dx=this.handleMouseOut?Math.max(this.dx,0):0,0==this.dx&&(this.dx=e-i.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0),this.dy=n+a-i.scrollTop-i.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0,0==this.dy&&(this.dy=n-i.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=o())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)s.panDx=0,s.panDy=0,s.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=s.panDx,n=s.panDy;0==e&&0==n||(s.panGraph(0,0),s.view.setTranslate(this.t0x+e/s.view.scale,this.t0y+n/s.view.scale))}},this.destroy=function(){s.removeMouseListener(this.mouseListener)}}function mxPopupMenu(e){null!=(this.factoryMethod=e)&&this.init()}function mxAutoSaveManager(e){this.changeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.graphModelChanged(n.getProperty("edit").changes)}),this.setGraph(e)}function mxAnimation(e){this.delay=null!=e?e:20}function mxMorphing(e,n,t,a){mxAnimation.call(this,a),this.graph=e,this.steps=null!=n?n:6,this.ease=null!=t?t:1.5}function mxImageBundle(e){this.images=[],this.alt=null!=e&&e}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(e){mxAbstractCanvas2D.call(this),this.root=e,this.writeDefaults()}function mxSvgCanvas2D(e,n){mxAbstractCanvas2D.call(this),this.root=e,this.gradients=[],this.defs=null,this.styleEnabled=null!=n&&n;var t=null;if(e.ownerDocument!=document)for(t=e;null!=t&&"svg"!=t.nodeName;)t=t.parentNode;null!=t&&(0<t.getElementsByTagName("defs").length&&(this.defs=t.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=t.firstChild?t.insertBefore(this.defs,t.firstChild):t.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(e){this.enabled=e},mxPopupMenu.prototype.isPopupTrigger=function(e){return e.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(e.getEvent())},mxPopupMenu.prototype.addItem=function(e,n,t,a,i,s){a=a||this,this.itemCount++,a.willAddSeparator&&(a.containsItems&&this.addSeparator(a,!0),a.willAddSeparator=!1),a.containsItems=!0;var o=document.createElement("tr");o.className="mxPopupMenuItem";var r=document.createElement("td");return r.className="mxPopupMenuIcon",null!=n?((i=document.createElement("img")).src=n,r.appendChild(i)):null!=i&&((n=document.createElement("div")).className=i,r.appendChild(n)),o.appendChild(r),this.labels&&((r=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),mxUtils.write(r,e),r.align="left",o.appendChild(r),(e=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),e.style.paddingRight="6px",e.style.textAlign="right",o.appendChild(e),null==a.div&&this.createSubmenu(a)),a.tbody.appendChild(o),(null==s||s)&&(mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){this.eventReceiver=o,a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),mxEvent.consume(e)}),mxUtils.bind(this,function(e){a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),this.autoExpand&&null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),o.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(e){this.eventReceiver==o&&(a.activeRow!=o&&this.hideMenu(),null!=t&&t(e)),this.eventReceiver=null,mxEvent.consume(e)})),mxEvent.addListener(o,"mouseout",mxUtils.bind(this,function(e){o.className="mxPopupMenuItem"}))),o},mxPopupMenu.prototype.createSubmenu=function(e){e.table=document.createElement("table"),e.table.className="mxPopupMenu",e.tbody=document.createElement("tbody"),e.table.appendChild(e.tbody),e.div=document.createElement("div"),e.div.className="mxPopupMenu",e.div.style.position="absolute",e.div.style.display="inline",e.div.style.zIndex=this.zIndex,e.div.appendChild(e.table);var n=document.createElement("img");n.setAttribute("src",this.submenuImage),td=e.firstChild.nextSibling.nextSibling,td.appendChild(n)},mxPopupMenu.prototype.showSubmenu=function(e,n){if(null!=n.div){n.div.style.left=e.div.offsetLeft+n.offsetLeft+n.offsetWidth-1+"px",n.div.style.top=e.div.offsetTop+n.offsetTop+"px",document.body.appendChild(n.div);var t=parseInt(n.div.offsetLeft),a=parseInt(n.div.offsetWidth),i=document.body,s=document.documentElement;t+a>(i.scrollLeft||s.scrollLeft)+(i.clientWidth||s.clientWidth)&&(n.div.style.left=e.div.offsetLeft-a+(mxClient.IS_IE?6:-6)+"px"),mxUtils.fit(n.div)}},mxPopupMenu.prototype.addSeparator=function(e,n){if(e=e||this,this.smartSeparators&&!n)e.willAddSeparator=!0;else if(null!=e.tbody){e.willAddSeparator=!1;var t=document.createElement("tr"),a=document.createElement("td");a.className="mxPopupMenuIcon",a.style.padding="0 0 0 0px",t.appendChild(a),(a=document.createElement("td")).style.padding="0 0 0 0px",a.setAttribute("colSpan","2");var i=document.createElement("hr");i.setAttribute("size","1"),a.appendChild(i),t.appendChild(a),e.tbody.appendChild(t)}},mxPopupMenu.prototype.popup=function(e,n,t,a){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=e+"px",this.div.style.top=n+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,t,a),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1)},mxPopupMenu.prototype.hideSubmenu=function(e){null!=e.activeRow&&(this.hideSubmenu(e.activeRow),null!=e.activeRow.div.parentNode&&e.activeRow.div.parentNode.removeChild(e.activeRow.div),e.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(e){this.enabled=e},mxAutoSaveManager.prototype.setGraph=function(e){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=e,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(e){(e=((new Date).getTime()-this.lastSnapshot)/1e3)>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){var e=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var n=0;n<this.cells.length;n++)this.animateCell(cells[n],e,!1);else this.animateCell(this.graph.getModel().getRoot(),e,!0);this.show(e),(e.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(e){e.show()},mxMorphing.prototype.animateCell=function(e,n,t){var a=this.graph.getView().getState(e),i=null;if(null!=a&&(i=this.getDelta(a),this.graph.getModel().isVertex(e)&&(0!=i.x||0!=i.y))){var s=this.graph.view.getTranslate(),o=this.graph.view.getScale();i.x+=s.x*o,i.y+=s.y*o,n.moveState(a,-i.x/this.ease,-i.y/this.ease)}if(t&&!this.stopRecursion(a,i))for(a=this.graph.getModel().getChildCount(e),i=0;i<a;i++)this.animateCell(this.graph.getModel().getChildAt(e,i),n,t)},mxMorphing.prototype.stopRecursion=function(e,n){return null!=n&&(0!=n.x||0!=n.y)},mxMorphing.prototype.getDelta=function(e){var n=this.getOriginForCell(e.cell),t=this.graph.getView().getTranslate(),a=this.graph.getView().getScale();return e=new mxPoint(e.x/a-t.x,e.y/a-t.y),new mxPoint((n.x-e.x)*a,(n.y-e.y)*a)},mxMorphing.prototype.getOriginForCell=function(e){var n=null;return null!=e&&(n=this.getOriginForCell(this.graph.getModel().getParent(e)),null!=(e=this.graph.getCellGeometry(e))&&(n.x+=e.x,n.y+=e.y)),null==n&&(n=new mxPoint(-(n=this.graph.view.getTranslate()).x,-n.y)),n},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(e,n,t){this.images[e]={value:n,fallback:t}},mxImageBundle.prototype.getImage=function(e){var n=null;return null!=e&&(null!=(e=this.images[e])&&(n=this.alt?e.fallback:e.value)),n},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(e,n){null!=e&&(this.visitStatesRecursive(e,n,this.drawCellState),this.includeOverlays&&this.visitStatesRecursive(e,n,this.drawOverlays))},mxImageExport.prototype.visitStatesRecursive=function(e,n,t){if(null!=e){t(e,n);for(var a=e.view.graph,i=a.model.getChildCount(e.cell),s=0;s<i;s++){var o=a.view.getState(a.model.getChildAt(e.cell,s));this.visitStatesRecursive(o,n,t)}}},mxImageExport.prototype.drawCellState=function(e,n){e.shape instanceof mxShape&&(n.save(),e.shape.paint(n),n.restore()),null!=e.text&&(n.save(),e.text.paint(n),n.restore())},mxImageExport.prototype.drawOverlays=function(e,t){null!=e.overlays&&e.overlays.visit(function(e,n){n instanceof mxShape&&n.paint(t)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillColor:null,fillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(e){return Math.round(parseFloat(e))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var e=this.state,n=2;n<arguments.length;n+=2)this.lastX=arguments[n-1],this.lastY=arguments[n],this.path.push(this.format((this.lastX+e.dx)*e.scale)),this.path.push(this.format((this.lastY+e.dy)*e.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(e,n,t,a,i){return t*=Math.PI/180,mxUtils.getRotatedPoint(new mxPoint(e,n),Math.cos(t),Math.sin(t),new mxPoint(a,i))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){this.state=this.states.pop()},mxAbstractCanvas2D.prototype.scale=function(e){this.state.scale*=e,this.state.strokeWidth*=e},mxAbstractCanvas2D.prototype.translate=function(e,n){this.state.dx+=e,this.state.dy+=n},mxAbstractCanvas2D.prototype.setAlpha=function(e){this.state.alpha=e},mxAbstractCanvas2D.prototype.setFillColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fillColor=e,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(e,n,t,a,i,s,o,r,l){(t=this.state).fillColor=e,t.fillAlpha=null!=r?r:1,t.gradientColor=n,t.gradientAlpha=null!=l?l:1,t.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(e){e==mxConstants.NONE&&(e=null),this.state.strokeColor=e},mxAbstractCanvas2D.prototype.setStrokeWidth=function(e){this.state.strokeWidth=e},mxAbstractCanvas2D.prototype.setDashed=function(e){this.state.dashed=e},mxAbstractCanvas2D.prototype.setDashPattern=function(e){this.state.dashPattern=e},mxAbstractCanvas2D.prototype.setLineCap=function(e){this.state.lineCap=e},mxAbstractCanvas2D.prototype.setLineJoin=function(e){this.state.lineJoin=e},mxAbstractCanvas2D.prototype.setMiterLimit=function(e){this.state.miterLimit=e},mxAbstractCanvas2D.prototype.setFontColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontColor=e},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBackgroundColor=e},mxAbstractCanvas2D.prototype.setFontBorderColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBorderColor=e},mxAbstractCanvas2D.prototype.setFontSize=function(e){this.state.fontSize=e},mxAbstractCanvas2D.prototype.setFontFamily=function(e){this.state.fontFamily=e},mxAbstractCanvas2D.prototype.setFontStyle=function(e){null==e&&(e=0),this.state.fontStyle=e},mxAbstractCanvas2D.prototype.setShadow=function(e){this.state.shadow=e},mxAbstractCanvas2D.prototype.setShadowColor=function(e){e==mxConstants.NONE&&(e=null),this.state.shadowColor=e},mxAbstractCanvas2D.prototype.setShadowAlpha=function(e){this.state.shadowAlpha=e},mxAbstractCanvas2D.prototype.setShadowOffset=function(e,n){this.state.shadowDx=e,this.state.shadowDy=n},mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(e,n){this.addOp(this.moveOp,e,n)},mxAbstractCanvas2D.prototype.lineTo=function(e,n){this.addOp(this.lineOp,e,n)},mxAbstractCanvas2D.prototype.quadTo=function(e,n,t,a){this.addOp(this.quadOp,e,n,t,a)},mxAbstractCanvas2D.prototype.curveTo=function(e,n,t,a,i,s){this.addOp(this.curveOp,e,n,t,a,i,s)},mxAbstractCanvas2D.prototype.arcTo=function(e,n,t,a,i,s,o){for(e=mxUtils.arcToCurves(this.lastX,this.lastY,e,n,t,a,i,s,o),n=0;n<e.length;n+=6)this.curveTo(e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5])},mxAbstractCanvas2D.prototype.close=function(e,n,t,a,i,s){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var e;(e=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(e),(e=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(e),(e=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(e),(e=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(e),(e=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),e.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(e)},mxXmlCanvas2D.prototype.format=function(e){return parseFloat(parseFloat(e).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(e){return this.root.ownerDocument.createElement(e)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(e){if(this.compressed){if(this.state.scale==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var n=this.createElement("scale");n.setAttribute("scale",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.translate=function(e,n){var t=this.createElement("translate");t.setAttribute("dx",this.format(e)),t.setAttribute("dy",this.format(n)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.rotate=function(e,n,t,a,i){var s=this.createElement("rotate");(0!=e||n||t)&&(s.setAttribute("theta",this.format(e)),s.setAttribute("flipH",n?"1":"0"),s.setAttribute("flipV",t?"1":"0"),s.setAttribute("cx",this.format(a)),s.setAttribute("cy",this.format(i)),this.root.appendChild(s))},mxXmlCanvas2D.prototype.setAlpha=function(e){if(this.compressed){if(this.state.alpha==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var n=this.createElement("alpha");n.setAttribute("alpha",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setFillColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fillColor==e)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var n=this.createElement("fillcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setGradient=function(e,n,t,a,i,s,o,r,l){if(null!=e&&null!=n){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var d=this.createElement("gradient");d.setAttribute("c1",e),d.setAttribute("c2",n),d.setAttribute("x",this.format(t)),d.setAttribute("y",this.format(a)),d.setAttribute("w",this.format(i)),d.setAttribute("h",this.format(s)),null!=o&&d.setAttribute("direction",o),null!=r&&d.setAttribute("alpha1",r),null!=l&&d.setAttribute("alpha2",l),this.root.appendChild(d)}},mxXmlCanvas2D.prototype.setStrokeColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.strokeColor==e)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var n=this.createElement("strokecolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setStrokeWidth=function(e){if(this.compressed){if(this.state.strokeWidth==e)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var n=this.createElement("strokewidth");n.setAttribute("width",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashed=function(e){if(this.compressed){if(this.state.dashed==e)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var n=this.createElement("dashed");n.setAttribute("dashed",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashPattern=function(e){if(this.compressed){if(this.state.dashPattern==e)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var n=this.createElement("dashpattern");n.setAttribute("pattern",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setLineCap=function(e){if(this.compressed){if(this.state.lineCap==e)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var n=this.createElement("linecap");n.setAttribute("cap",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setLineJoin=function(e){if(this.compressed){if(this.state.lineJoin==e)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var n=this.createElement("linejoin");n.setAttribute("join",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setMiterLimit=function(e){if(this.compressed){if(this.state.miterLimit==e)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var n=this.createElement("miterlimit");n.setAttribute("limit",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setFontColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontColor==e)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var n=this.createElement("fontcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBackgroundColor==e)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var n=this.createElement("fontbackgroundcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBorderColor==e)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var n=this.createElement("fontbordercolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontSize=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==e)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var n=this.createElement("fontsize");n.setAttribute("size",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontFamily=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==e)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var n=this.createElement("fontfamily");n.setAttribute("family",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontStyle=function(e){if(this.textEnabled){if(null==e&&(e=0),this.compressed){if(this.state.fontStyle==e)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var n=this.createElement("fontstyle");n.setAttribute("style",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setShadow=function(e){if(this.compressed){if(this.state.shadow==e)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var n=this.createElement("shadow");n.setAttribute("enabled",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowColor=function(e){if(this.compressed){if(e==mxConstants.NONE&&(e=null),this.state.shadowColor==e)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var n=this.createElement("shadowcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowAlpha=function(e){if(this.compressed){if(this.state.shadowAlpha==e)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var n=this.createElement("shadowalpha");n.setAttribute("alpha",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowOffset=function(e,n){if(this.compressed){if(this.state.shadowDx==e&&this.state.shadowDy==n)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var t=this.createElement("shadowoffset");t.setAttribute("dx",e),t.setAttribute("dy",n),this.root.appendChild(t)},mxXmlCanvas2D.prototype.rect=function(e,n,t,a){var i=this.createElement("rect");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(n)),i.setAttribute("w",this.format(t)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){var o=this.createElement("roundrect");o.setAttribute("x",this.format(e)),o.setAttribute("y",this.format(n)),o.setAttribute("w",this.format(t)),o.setAttribute("h",this.format(a)),o.setAttribute("dx",this.format(i)),o.setAttribute("dy",this.format(s)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(e,n,t,a){var i=this.createElement("ellipse");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(n)),i.setAttribute("w",this.format(t)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){i=this.converter.convert(i);var l=this.createElement("image");l.setAttribute("x",this.format(e)),l.setAttribute("y",this.format(n)),l.setAttribute("w",this.format(t)),l.setAttribute("h",this.format(a)),l.setAttribute("src",i),l.setAttribute("aspect",s?"1":"0"),l.setAttribute("flipH",o?"1":"0"),l.setAttribute("flipV",r?"1":"0"),this.root.appendChild(l)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastY=this.lastX=0},mxXmlCanvas2D.prototype.moveTo=function(e,n){var t=this.createElement("move");t.setAttribute("x",this.format(e)),t.setAttribute("y",this.format(n)),this.root.appendChild(t),this.lastX=e,this.lastY=n},mxXmlCanvas2D.prototype.lineTo=function(e,n){var t=this.createElement("line");t.setAttribute("x",this.format(e)),t.setAttribute("y",this.format(n)),this.root.appendChild(t),this.lastX=e,this.lastY=n},mxXmlCanvas2D.prototype.quadTo=function(e,n,t,a){var i=this.createElement("quad");i.setAttribute("x1",this.format(e)),i.setAttribute("y1",this.format(n)),i.setAttribute("x2",this.format(t)),i.setAttribute("y2",this.format(a)),this.root.appendChild(i),this.lastX=t,this.lastY=a},mxXmlCanvas2D.prototype.curveTo=function(e,n,t,a,i,s){var o=this.createElement("curve");o.setAttribute("x1",this.format(e)),o.setAttribute("y1",this.format(n)),o.setAttribute("x2",this.format(t)),o.setAttribute("y2",this.format(a)),o.setAttribute("x3",this.format(i)),o.setAttribute("y3",this.format(s)),this.root.appendChild(o),this.lastX=i,this.lastY=s},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){mxUtils.isNode(i)&&(i=mxUtils.getOuterHtml(i));var u=this.createElement("text");u.setAttribute("x",this.format(e)),u.setAttribute("y",this.format(n)),u.setAttribute("w",this.format(t)),u.setAttribute("h",this.format(a)),u.setAttribute("str",i),null!=s&&u.setAttribute("align",s),null!=o&&u.setAttribute("valign",o),u.setAttribute("wrap",r?"1":"0"),null==l&&(l=""),u.setAttribute("format",l),null!=d&&u.setAttribute("fill",d?"1":"0"),null!=c&&u.setAttribute("clip",c?"1":"0"),null!=m&&u.setAttribute("rotation",m),this.root.appendChild(u)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(e){return(e=this.createElement("style")).setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(e,n){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(n||mxConstants.NS_SVG,e);var t=this.root.ownerDocument.createElement(e);return null!=n&&t.setAttribute("xmlns",n),t},mxSvgCanvas2D.prototype.createGradientId=function(e,n,t,a,i){return"#"==e.charAt(0)&&(e=e.substring(1)),"#"==n.charAt(0)&&(n=n.substring(1)),e=e.toLowerCase()+"-"+t,n=n.toLowerCase()+"-"+a,(t=null)==i||i==mxConstants.DIRECTION_SOUTH?t="s":i==mxConstants.DIRECTION_EAST?t="e":(a=e,e=n,n=a,i==mxConstants.DIRECTION_NORTH?t="s":i==mxConstants.DIRECTION_WEST&&(t="e")),"mx-gradient-"+e+"-"+n+"-"+t},mxSvgCanvas2D.prototype.getSvgGradient=function(e,n,t,a,i){var s=this.createGradientId(e,n,t,a,i),o=this.gradients[s];if(null==o){var r=this.root.ownerSVGElement,l=0,d=s+"-"+l;if(null!=r)for(o=r.ownerDocument.getElementById(d);null!=o&&o.ownerSVGElement!=r;)d=s+"-"+l++,o=r.ownerDocument.getElementById(d);else d="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(e,n,t,a,i)).setAttribute("id",d),null!=this.defs?this.defs.appendChild(o):r.appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(e,n,t,a,i){var s=this.createElement("linearGradient");return s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==i||i==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):i==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):i==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):i==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%"),t=t<1?";stop-opacity:"+t:"",(i=this.createElement("stop")).setAttribute("offset","0%"),i.setAttribute("style","stop-color:"+e+t),s.appendChild(i),t=a<1?";stop-opacity:"+a:"",(i=this.createElement("stop")).setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+n+t),s.appendChild(i),s},mxSvgCanvas2D.prototype.addNode=function(e,n){var t=this.node,a=this.state;if(null!=t){if("path"==t.nodeName){if(!(null!=this.path&&0<this.path.length))return;t.setAttribute("d",this.path.join(" "))}e&&null!=a.fillColor?this.updateFill():this.styleEnabled||("ellipse"!=t.nodeName||!mxClient.IS_NS||mxClient.IS_GC||mxClient.IS_SF?t.setAttribute("fill","none"):t.setAttribute("fill","transparent"),e=!1),n&&null!=a.strokeColor?this.updateStroke():this.styleEnabled||t.setAttribute("stroke","none"),null!=a.transform&&0<a.transform.length&&t.setAttribute("transform",a.transform),a.shadow&&this.root.appendChild(this.createShadow(t)),0<this.strokeTolerance&&!e&&this.root.appendChild(this.createTolerance(t)),this.pointerEvents&&("path"!=t.nodeName||this.path[this.path.length-1]==this.closeOp)&&t.setAttribute("pointer-events","all"),this.root.appendChild(t)}},mxSvgCanvas2D.prototype.updateFill=function(){var e=this.state;e.alpha<1&&this.node.setAttribute("fill-opacity",e.alpha),null!=e.fillColor&&(null!=e.gradientColor?(e=this.getSvgGradient(e.fillColor,e.gradientColor,e.fillAlpha,e.gradientAlpha,e.gradientDirection),this.node.setAttribute("fill","url(#"+e+")")):this.node.setAttribute("fill",e.fillColor.toLowerCase()))},mxSvgCanvas2D.prototype.updateStroke=function(){var e=this.state;this.node.setAttribute("stroke",e.strokeColor.toLowerCase()),e.alpha<1&&this.node.setAttribute("stroke-opacity",e.alpha);var n=Math.max(1,this.format(e.strokeWidth*e.scale));1!=n&&this.node.setAttribute("stroke-width",n),"path"==this.node.nodeName&&this.updateStrokeAttributes(),e.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(n))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var e=this.state;if(null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap){var n=e.lineCap;"flat"==n&&(n="butt"),"butt"!=n&&this.node.setAttribute("stroke-linecap",n)}null!=e.miterLimit&&(!this.styleEnabled||10!=e.miterLimit)&&this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(e){var n=this.state.dashPattern.split(" "),t=[];if(0<n.length)for(var a=0;a<n.length;a++)t[a]=Number(n[a])*e;return t.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(e){e=e.cloneNode(!0);var n=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OP?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(e){e=e.cloneNode(!0);var n=this.state;return"none"!=e.getAttribute("fill")&&e.setAttribute("fill",n.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",n.shadowColor),e.setAttribute("transform","translate("+this.format(n.shadowDx*n.scale)+","+this.format(n.shadowDy*n.scale)+")"+(n.transform||"")),e.setAttribute("opacity",n.shadowAlpha),e},mxSvgCanvas2D.prototype.rotate=function(e,n,t,a,i){if(0!=e||n||t){var s=this.state;if(a+=s.dx,i+=s.dy,a*=s.scale,i*=s.scale,s.transform=s.transform||"",n&&t)e+=180;else if(n^t){var o=n?a:0,r=n?-1:1,l=t?i:0,d=t?-1:1;s.transform+="translate("+this.format(o)+","+this.format(l)+")scale("+this.format(r)+","+this.format(d)+")translate("+this.format(-o)+","+this.format(-l)+")"}(n?!t:t)&&(e*=-1),0!=e&&(s.transform+="rotate("+this.format(e)+","+this.format(a)+","+this.format(i)+")"),s.rotation+=e,s.rotationCx=a,s.rotationCy=i}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(e,n,t,a){var i=this.state,s=this.createElement("rect");s.setAttribute("x",this.format((e+i.dx)*i.scale)),s.setAttribute("y",this.format((n+i.dy)*i.scale)),s.setAttribute("width",this.format(t*i.scale)),s.setAttribute("height",this.format(a*i.scale)),this.node=s},mxSvgCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){this.rect(e,n,t,a),0<i&&this.node.setAttribute("rx",this.format(i*this.state.scale)),0<s&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(e,n,t,a){var i=this.state,s=this.createElement("ellipse");s.setAttribute("cx",Math.round((e+t/2+i.dx)*i.scale)),s.setAttribute("cy",Math.round((n+a/2+i.dy)*i.scale)),s.setAttribute("rx",t/2*i.scale),s.setAttribute("ry",a/2*i.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){i=this.converter.convert(i),s=null==s||s,o=null!=o&&o,r=null!=r&&r;var l=this.state;e+=l.dx,n+=l.dy;var d=this.createElement("image");if(d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(n*l.scale)),d.setAttribute("width",this.format(t*l.scale)),d.setAttribute("height",this.format(a*l.scale)),null==d.setAttributeNS?d.setAttribute("xlink:href",i):d.setAttributeNS(mxConstants.NS_XLINK,"href",i),s||d.setAttribute("preserveAspectRatio","none"),l.alpha<1&&d.setAttribute("opacity",l.alpha),i=this.state.transform||"",o||r){var c=s=1,m=0,u=0;o&&(s=-1,m=-t-2*e),r&&(c=-1,u=-a-2*n),i+="scale("+s+","+c+")translate("+m+","+u+")"}0<i.length&&d.setAttribute("transform",i),this.root.appendChild(d),this.blockImagePointerEvents&&(d.setAttribute("style","pointer-events:none"),(d=this.createElement("rect")).setAttribute("visibility","hidden"),d.setAttribute("pointer-events","fill"),d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(n*l.scale)),d.setAttribute("width",this.format(t*l.scale)),d.setAttribute("height",this.format(a*l.scale)),this.root.appendChild(d))},mxSvgCanvas2D.prototype.createDiv=function(e,n,t,a,i){return t=this.state,a="display:inline-block;font-size:"+Math.round(t.fontSize)+"px;font-family:"+t.fontFamily+";color:"+t.fontColor+";line-height:"+Math.round(t.fontSize*mxConstants.LINE_HEIGHT)+"px;"+a,(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight:bold;"),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style:italic;"),(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a+="font-decoration:underline;"),n==mxConstants.ALIGN_CENTER?a+="text-align:center;":n==mxConstants.ALIGN_RIGHT&&(a+="text-align:right;"),n="",null!=t.fontBackgroundColor&&(n+="background-color:"+t.fontBackgroundColor+";"),null!=t.fontBorderColor&&(n+="border:1px solid "+t.fontBorderColor+";"),mxUtils.isNode(e)||((t=document.createElement("textarea")).innerHTML=e.replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=t.value,i?a+=n:0<n.length&&(e='<div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;'+n+'">'+e+"</div>")),!mxClient.IS_IE&&document.createElementNS?((i=document.createElementNS("http://www.w3.org/1999/xhtml","div")).setAttribute("style",a),mxUtils.isNode(e)?this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e):i.innerHTML=e,i):(mxUtils.isNode(e)&&this.root.ownerDocument!=document&&(e=e.outerHTML),e=e.replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+a+'">'+e+"</div>").documentElement)},mxSvgCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){m=null!=m?m:0;var u=this.state;if(e+=u.dx,n+=u.dy,this.foEnabled&&"html"==l){var p="vertical-align:top;";if(c?(p+="overflow:hidden;",0<a&&(p+="max-height:"+Math.round(a)+"px;"),0<t&&(p+="width:"+Math.round(t)+"px;")):d&&(p+="width:"+Math.round(t)+"px;",0<a&&(p+="max-height:"+Math.round(a)+"px;")),r?(!c&&0<t&&(p+="width:"+Math.round(t)+"px;"),p+="white-space:normal;"):p+="white-space:nowrap;",r=this.createElement("g"),u.alpha<1&&r.setAttribute("opacity",u.alpha),(l=this.createElement("foreignObject")).setAttribute("pointer-events","all"),null!=(p=this.createDiv(i,s,o,p,d))){r.appendChild(l),this.root.appendChild(r);var g=0;if(mxClient.IS_IE&&!mxClient.IS_SVG){var v=document.createElement("div");v.style.cssText=p.getAttribute("style"),v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",v.style.visibility="hidden",v.innerHTML=mxUtils.isNode(i)?i.outerHTML:i,document.body.appendChild(v),g=v.offsetWidth,a=mxClient.IS_QUIRKS&&0<a&&c?Math.min(a,v.offsetHeight+2):v.offsetHeight,v.parentNode.removeChild(v),l.appendChild(p)}else this.root.ownerDocument!=document?(p.style.visibility="hidden",document.body.appendChild(p),g=p.offsetWidth,a=p.offsetHeight,l.appendChild(p),p.style.visibility=""):(l.appendChild(p),g=p.offsetWidth,a=p.offsetHeight);t=d?Math.max(t,g):g,u.alpha<1&&r.setAttribute("opacity",u.alpha),d=i=0,s==mxConstants.ALIGN_CENTER?i-=t/2:s==mxConstants.ALIGN_RIGHT&&(i-=t),e+=i,o==mxConstants.ALIGN_MIDDLE?d-=a/2:o==mxConstants.ALIGN_BOTTOM&&(d-=a),n+=d,s=1!=u.scale?"scale("+u.scale+")":"",0!=u.rotation&&this.rotateHtml?(s+="rotate("+u.rotation+","+t/2+","+a/2+")",e=(n=this.rotatePoint((e+t/2)*u.scale,(n+a/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy)).x-t*u.scale/2,n=n.y-a*u.scale/2):(e*=u.scale,n*=u.scale),0!=m&&(s+="rotate("+m+","+-i+","+-d+")"),r.setAttribute("transform","translate("+Math.round(e)+","+Math.round(n)+")"+s),l.setAttribute("width",Math.round(Math.max(1,t))),l.setAttribute("height",Math.round(Math.max(1,a)))}}else this.plainText(e,n,t,a,i,s,o,r,d,c,m)}},mxSvgCanvas2D.prototype.createClip=function(e,n,t,a){for(var i="mx-clip-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(t=Math.round(t))+"-"+(a=Math.round(a)),s=0,o=i+"-"+s;null!=document.getElementById(o);)o=i+"-"+ ++s;return clip=this.createElement("clipPath"),clip.setAttribute("id",o),(i=this.createElement("rect")).setAttribute("x",e),i.setAttribute("y",n),i.setAttribute("width",t),i.setAttribute("height",a),clip.appendChild(i),clip},mxSvgCanvas2D.prototype.plainText=function(e,n,t,a,i,s,o,r,l,d,c){c=null!=c?c:0,r=this.state;var m=Math.round(r.fontSize),u=this.createElement("g"),p=r.transform||"";if(0!=c&&(p+="rotate("+c+","+this.format(e*r.scale)+","+this.format(n*r.scale)+")"),d&&0<t&&0<a){var g=e;c=n,s==mxConstants.ALIGN_CENTER?g-=t/2:s==mxConstants.ALIGN_RIGHT&&(g-=t),o==mxConstants.ALIGN_MIDDLE?c-=a/2:o==mxConstants.ALIGN_BOTTOM&&(c-=a),c=this.createClip(g*r.scale-2,c*r.scale-2,t*r.scale+4,a*r.scale+4),null!=this.defs?this.defs.appendChild(c):this.root.appendChild(c),u.setAttribute("clip-path","url(#"+c.getAttribute("id")+")")}this.updateFont(u,s),"start"!=(c=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start")&&u.setAttribute("text-anchor",c),(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE)&&u.setAttribute("font-size",Math.round(m*r.scale)+"px"),0<p.length&&u.setAttribute("transform",p),r.alpha<1&&u.setAttribute("opacity",r.alpha);p=i.split("\n"),g=Math.round(m*mxConstants.LINE_HEIGHT);var v=m+(p.length-1)*g;for(c=n+m-1,o==mxConstants.ALIGN_MIDDLE?c-=(a=(this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)/2)+1:o==mxConstants.ALIGN_BOTTOM&&(c-=(a=this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)+2),a=0;a<p.length;a++)0<p[a].length&&0<mxUtils.trim(p[a]).length&&((d=this.createElement("text")).setAttribute("x",this.format(e*r.scale)),d.setAttribute("y",this.format(c*r.scale)),mxUtils.write(d,p[a]),u.appendChild(d)),c+=g;this.root.appendChild(u),this.addTextBackground(u,i,e,n,t,v,s,o,l)},mxSvgCanvas2D.prototype.updateFont=function(e){var n=this.state;e.setAttribute("fill",n.fontColor),(!this.styleEnabled||n.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&e.setAttribute("font-family",n.fontFamily),(n.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&e.setAttribute("font-weight","bold"),(n.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&e.setAttribute("font-style","italic"),(n.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(e,n,t,a,i,s,o,r,l){var d=this.state;if(null!=d.fontBackgroundColor||null!=d.fontBorderColor){var c=null;null!=(c=l?(o==mxConstants.ALIGN_CENTER?t-=i/2:o==mxConstants.ALIGN_RIGHT&&(t-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((t+1)*d.scale,a*d.scale,(i-2)*d.scale,(s+2)*d.scale)):null!=e.getBBox&&this.root.ownerDocument==document?(c=e.getBBox(),n=mxClient.IS_IE&&mxClient.IS_SVG,new mxRectangle(c.x,c.y+(n?0:1),c.width,c.height+(n?1:0))):((c=document.createElement("div")).style.lineHeight=Math.round(d.fontSize*mxConstants.LINE_HEIGHT)+"px",c.style.fontSize=Math.round(d.fontSize)+"px",c.style.fontFamily=d.fontFamily,c.style.whiteSpace="nowrap",c.style.position="absolute",c.style.visibility="hidden",c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",c.style.zoom="1",(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle="italic"),n=mxUtils.htmlEntities(n,!1),c.innerHTML=n.replace(/\n/g,"<br/>"),document.body.appendChild(c),i=c.offsetWidth,s=c.offsetHeight,c.parentNode.removeChild(c),o==mxConstants.ALIGN_CENTER?t-=i/2:o==mxConstants.ALIGN_RIGHT&&(t-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((t+1)*d.scale,(a+2)*d.scale,i*d.scale,(s+1)*d.scale)))&&((n=this.createElement("rect")).setAttribute("fill",d.fontBackgroundColor||"none"),n.setAttribute("stroke",d.fontBorderColor||"none"),n.setAttribute("x",Math.floor(c.x-1)),n.setAttribute("y",Math.floor(c.y-1)),n.setAttribute("width",Math.ceil(c.width+2)),n.setAttribute("height",Math.ceil(c.height)),d=null!=d.fontBorderColor?Math.max(1,this.format(d.scale)):0,n.setAttribute("stroke-width",d),this.root.ownerDocument==document&&1==mxUtils.mod(d,2)&&n.setAttribute("transform","translate(0.5, 0.5)"),e.insertBefore(n,e.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(e){mxAbstractCanvas2D.call(this),this.root=e};function mxGuide(e,n){this.graph=e,this.setStates(n)}function mxStencil(e){this.desc=e,this.parseDescription(),this.parseConstraints()}function mxShape(e){this.stencil=e,this.strokewidth=1,this.rotation=0,this.opacity=100,this.flipV=this.flipH=!1}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.addNode=function(e,n){var t=this.node,a=this.state;if(null!=t){if("shape"==t.nodeName){if(!(null!=this.path&&0<this.path.length))return;t.path=this.path.join(" ")+" e",t.style.width=this.root.style.width,t.style.height=this.root.style.height,t.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height)}t.strokeweight=this.format(Math.max(1,a.strokeWidth*a.scale/this.vmlScale))+"px",a.shadow&&this.root.appendChild(this.createShadow(t,e&&null!=a.fillColor,n&&null!=a.strokeColor)),n&&null!=a.strokeColor?(t.stroked="true",t.strokecolor=a.strokeColor):t.stroked="false",t.appendChild(this.createStroke()),e&&null!=a.fillColor?t.appendChild(this.createFill()):!this.pointerEvents||"shape"==t.nodeName&&this.path[this.path.length-1]!=this.closeOp?t.filled="false":t.appendChild(this.createTransparentFill()),this.root.appendChild(t)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.src=mxClient.imageBasePath+"/transparent.gif",e.type="tile",e},mxVmlCanvas2D.prototype.createFill=function(){var e=this.state,n=document.createElement(mxClient.VML_PREFIX+":fill");if(n.color=e.fillColor,null!=e.gradientColor){n.type="gradient",n.method="none",n.color2=e.gradientColor;var t=180-e.rotation;t=e.gradientDirection==mxConstants.DIRECTION_WEST?t-(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_EAST?t+(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_NORTH?t-(180+("y"==this.root.style.flip?-180:0)):t+("y"==this.root.style.flip?-180:0);"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(t*=-1),n.angle=mxUtils.mod(t,360),n.opacity=100*e.alpha*e.fillAlpha+"%",n.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*e.alpha*e.gradientAlpha+"%")}else e.alpha<1&&(n.opacity=100*e.alpha+"%");return n},mxVmlCanvas2D.prototype.createStroke=function(){var e=this.state,n=document.createElement(mxClient.VML_PREFIX+":stroke");return n.endcap=e.lineCap||"flat",n.joinstyle=e.lineJoin||"miter",n.miterlimit=e.miterLimit||"10",e.alpha<1&&(n.opacity=100*e.alpha+"%"),e.dashed&&(n.dashstyle=this.getVmlDashStyle()),n},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var e="dash";if(null!=this.state.dashPattern){var n=this.state.dashPattern.split(" ");0<n.length&&1==n[0]&&(e="0 2")}return e},mxVmlCanvas2D.prototype.createShadow=function(e,n,t){var a=this.state,i=-a.rotation*(Math.PI/180),s=Math.cos(i),o=(i=Math.sin(i),a.shadowDx*a.scale),r=a.shadowDy*a.scale;"x"==this.root.style.flip?o*=-1:"y"==this.root.style.flip&&(r*=-1);var l=e.cloneNode(!0);return l.style.marginLeft=Math.round(o*s-r*i)+"px",l.style.marginTop=Math.round(o*i+r*s)+"px",8==document.documentMode&&(l.strokeweight=e.strokeweight,"shape"==e.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(e.style.width)+" "+parseInt(e.style.height))),t?(l.strokecolor=a.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",n?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.color=this.state.shadowColor,e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.createShadowStroke=function(){var e=this.createStroke();return e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.rotate=function(e,n,t,a,i){n&&t?e+=180:n?this.root.style.flip="x":t&&(this.root.style.flip="y"),(n?!t:t)&&(e*=-1),this.root.style.rotation=e,this.state.rotation+=e,this.state.rotationCx=a,this.state.rotationCy=i},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=document.createElement(mxClient.VML_PREFIX+":shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(e,n,t,a){var i=this.state,s=(this.lastX+i.dx)*i.scale,o=(this.lastY+i.dy)*i.scale;e=(e+i.dx)*i.scale;o+=2/3*((n=(n+i.dy)*i.scale)-o);var r=(t=(t+i.dx)*i.scale)+2/3*(e-t);n=(a=(a+i.dy)*i.scale)+2/3*(n-a),this.path.push("c "+this.format(s+2/3*(e-s))+" "+this.format(o)+" "+this.format(r)+" "+this.format(n)+" "+this.format(t)+" "+this.format(a)),this.lastX=t/i.scale-i.dx,this.lastY=a/i.scale-i.dy},mxVmlCanvas2D.prototype.createRect=function(e,n,t,a,i){var s=this.state;return(e=document.createElement(e)).style.position="absolute",e.style.left=this.format((n+s.dx)*s.scale)+"px",e.style.top=this.format((t+s.dy)*s.scale)+"px",e.style.width=this.format(a*s.scale)+"px",e.style.height=this.format(i*s.scale)+"px",e},mxVmlCanvas2D.prototype.rect=function(e,n,t,a){this.node=this.createRect(mxClient.VML_PREFIX+":rect",e,n,t,a)},mxVmlCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){this.node=this.createRect(mxClient.VML_PREFIX+":roundrect",e,n,t,a),this.node.setAttribute("arcsize",Math.max(100*i/t,100*s/a)+"%")},mxVmlCanvas2D.prototype.ellipse=function(e,n,t,a){this.node=this.createRect(mxClient.VML_PREFIX+":oval",e,n,t,a)},mxVmlCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){var l=null;s?((l=this.createRect(mxClient.VML_PREFIX+":rect",e,n,t,a)).stroked="false",(e=document.createElement(mxClient.VML_PREFIX+":fill")).aspect=s?"atmost":"ignore",e.rotate="true",e.type="frame",e.src=i,l.appendChild(e)):(l=this.createRect(mxClient.VML_PREFIX+":image",e,n,t,a)).src=i,o&&r?l.style.rotation="180":o?l.style.flip="x":r&&(l.style.flip="y"),this.state.alpha<1&&(l.style.filter+="alpha(opacity="+100*this.state.alpha+")"),this.root.appendChild(l)},mxVmlCanvas2D.prototype.createDiv=function(e,n,t,a){t=document.createElement("div");var i=this.state,s="";return null!=i.fontBackgroundColor&&(s+="background-color:"+i.fontBackgroundColor+";"),null!=i.fontBorderColor&&(s+="border:1px solid "+i.fontBorderColor+";"),mxUtils.isNode(e)?t.appendChild(e):0<s.length&&!a?((a=document.createElement("div")).style.cssText=s,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,t.appendChild(a)):(t.style.cssText=s,t.innerHTML=e),(e=t.style).fontSize=Math.round(i.fontSize/this.vmlScale)+"px",e.fontFamily=i.fontFamily,e.color=i.fontColor,e.verticalAlign="top",e.textAlign=n||"left",e.lineHeight=Math.round(i.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale)+"px",(i.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e.fontWeight="bold"),(i.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e.fontStyle="italic"),(i.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(e.fontDecoration="underline"),t},mxVmlCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){var u=this.state;if("html"==l){null!=u.rotation&&(e=(n=this.rotatePoint(e,n,u.rotation,u.rotationCx,u.rotationCy)).x,n=n.y),8==document.documentMode?(e+=u.dx,n+=u.dy):(e*=u.scale,n*=u.scale),(l=8==document.documentMode?document.createElement(mxClient.VML_PREFIX+":group"):document.createElement("div")).style.position="absolute",l.style.display="inline",l.style.left=this.format(e)+"px",l.style.top=this.format(n)+"px",l.style.zoom=u.scale;var p=document.createElement("div");p.style.position="relative",p.style.display="inline";var g=(v=mxUtils.getAlignmentAsPoint(s,o)).x,v=v.y;if(i=this.createDiv(i,s,o,d),s=document.createElement("div"),r?(!c&&0<t&&(i.style.width=Math.round(t)+"px"),i.style.whiteSpace="normal"):i.style.whiteSpace="nowrap",r=u.rotation+(m||0),this.rotateHtml&&0!=r?(s.style.display="inline",s.style.zoom="1",s.appendChild(i),8==document.documentMode&&"DIV"!=this.root.nodeName?(p.appendChild(s),l.appendChild(p)):l.appendChild(s)):8==document.documentMode?(p.appendChild(i),l.appendChild(p)):(i.style.display="inline",l.appendChild(i)),"DIV"!=this.root.nodeName?((m=document.createElement(mxClient.VML_PREFIX+":rect")).stroked="false",m.filled="false",m.appendChild(l),this.root.appendChild(m)):this.root.appendChild(l),c?(i.style.overflow="hidden",0<t&&(i.style.width=Math.round(t)+"px"),0<a&&8==document.documentMode&&(i.style.maxHeight=Math.round(a)+"px")):d&&(i.style.width=t+"px",0<a&&(i.style.maxHeight=Math.round(a)+"px")),this.rotateHtml&&0!=r){t=r*(Math.PI/180),r=parseFloat(parseFloat(Math.cos(t)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-t)).toFixed(8)),(t%=2*Math.PI)<0&&(t+=2*Math.PI),(t%=Math.PI)>Math.PI/2&&(t=Math.PI-t),o=Math.cos(t);var h=Math.sin(t);8==document.documentMode&&(i.style.display="inline-block",s.style.display="inline-block",p.style.display="inline-block"),i.style.visibility="hidden",document.body.appendChild(i),t=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&(c||d)&&a<p&&(p=a,i.style.height=p+"px"),c=((a=p)-a*o+t*-h)/2-m*t*(g+.5)+r*a*(v+.5),d=(t-t*o+a*-h)/2+r*t*(g+.5)+m*a*(v+.5),"group"==l.nodeName&&"DIV"==this.root.nodeName?((g=document.createElement("div")).style.display="inline-block",g.style.position="absolute",g.style.left=this.format(e+(d-t/2)*u.scale)+"px",g.style.top=this.format(n+(c-a/2)*u.scale)+"px",l.parentNode.appendChild(g),g.appendChild(l)):(u=8==document.documentMode?1:u.scale,l.style.left=this.format(e+(d-t/2)*u)+"px",l.style.top=this.format(n+(c-a/2)*u)+"px"),s.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+m+", M21="+-m+", M22="+r+", sizingMethod='auto expand')",s.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(s.style.filter+="alpha(opacity="+100*this.state.alpha+")"),i.style.visibility="",s.appendChild(i)}else 8!=document.documentMode?(i.style.verticalAlign="top",this.state.alpha<1&&(l.style.filter="alpha(opacity="+100*this.state.alpha+")"),u=i.parentNode,i.style.visibility="hidden",document.body.appendChild(i),t=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&c&&a<p&&(p=a,i.style.height=p+"px"),a=p,i.style.visibility="",u.appendChild(i),l.style.left=this.format(e+t*g*this.state.scale)+"px",l.style.top=this.format(n+a*v*this.state.scale)+"px"):(this.state.alpha<1&&(i.style.filter="alpha(opacity="+100*this.state.alpha+")"),p.style.left=100*g+"%",p.style.top=100*v+"%")}else this.plainText(e,n,t,a,mxUtils.htmlEntities(i,!1),s,o,r,l,d,c,m)}},mxVmlCanvas2D.prototype.plainText=function(e,n,t,a,i,s,o,r,l,d,c,m){e=(e+(a=this.state).dx)*a.scale,n=(n+a.dy)*a.scale,(t=document.createElement(mxClient.VML_PREFIX+":shape")).style.width="1px",t.style.height="1px",t.stroked="false",(d=document.createElement(mxClient.VML_PREFIX+":fill")).color=a.fontColor,d.opacity=100*a.alpha+"%",t.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":path")).textpathok="true",d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),t.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":textpath")).style.cssText="v-text-align:"+s,d.style.align=s,d.style.fontFamily=a.fontFamily,d.string=i,d.on="true",s=Math.round(a.fontSize*a.scale/this.vmlScale),d.style.fontSize=s+"px",(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline"),a=s+((i=i.split("\n")).length-1)*s*mxConstants.LINE_HEIGHT,s=i=0,o==mxConstants.ALIGN_BOTTOM?s=-a/2:o!=mxConstants.ALIGN_MIDDLE&&(s=a/2),null!=m&&(o=(t.style.rotation=m)*(Math.PI/180),i=Math.sin(o)*s,s*=Math.cos(o)),t.appendChild(d),t.style.left=this.format(e-i)+"px",t.style.top=this.format(n+s)+"px",this.root.appendChild(t)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(e){this.states=e},mxGuide.prototype.isEnabledForEvent=function(e){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxGuide.prototype.createGuideShape=function(e){return(e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)).isDashed=!0,e},mxGuide.prototype.move=function(a,e,n){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=e){var t=this.graph.getView().translate,i=this.graph.getView().scale,s=e.x,o=e.y,r=!1,l=!1,d=f=this.getGuideTolerance(),c=f;(f=a.clone()).x+=e.x,f.y+=e.y;var m=f.x,u=f.x+f.width,p=f.getCenterX(),g=f.y,v=f.y+f.height,h=f.getCenterY();e=function(e){e+=this.graph.panDx;var n=!1;if(Math.abs(e-p)<d?(s=e-a.getCenterX(),d=Math.abs(e-p),n=!0):Math.abs(e-m)<d?(s=e-a.x,d=Math.abs(e-m),n=!0):Math.abs(e-u)<d&&(s=e-a.x-a.width,d=Math.abs(e-u),n=!0),n){null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()));var t=this.graph.container;e-=this.graph.panDx,this.guideX.points=[new mxPoint(e,-this.graph.panDy),new mxPoint(e,t.scrollHeight-3-this.graph.panDy)]}r=r||n};for(var f=function(e){e+=this.graph.panDy;var n=!1;if(Math.abs(e-h)<c?(o=e-a.getCenterY(),c=Math.abs(e-h),n=!0):Math.abs(e-g)<c?(o=e-a.y,c=Math.abs(e-g),n=!0):Math.abs(e-v)<c&&(o=e-a.y-a.height,c=Math.abs(e-v),n=!0),n){null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()));var t=this.graph.container;e-=this.graph.panDy,this.guideY.points=[new mxPoint(-this.graph.panDx,e),new mxPoint(t.scrollWidth-3-this.graph.panDx,e)]}l=l||n},b=0;b<this.states.length;b++){var A=this.states[b];null!=A&&(this.horizontal&&(e.call(this,A.getCenterX()),e.call(this,A.x),e.call(this,A.x+A.width)),this.vertical&&(f.call(this,A.getCenterY()),f.call(this,A.y),f.call(this,A.y+A.height)))}r||null==this.guideX?null!=this.guideX&&(this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",l||null==this.guideY?null!=this.guideY&&(this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",n&&(r||(n=a.x-(this.graph.snap(a.x/i-t.x)+t.x)*i,s=this.graph.snap(s/i)*i-n),l||(t=a.y-(this.graph.snap(a.y/i-t.y)+t.y)*i,o=this.graph.snap(o/i)*i-t)),e=new mxPoint(s,o)}return e},mxGuide.prototype.hide=function(){null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),null!=this.guideY&&(this.guideY.node.style.visibility="hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxStencil.defaultLocalized=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var e=this.desc.getAttribute("aspect");this.aspect=null!=e?e:"variable",e=this.desc.getAttribute("strokewidth"),this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var e=this.desc.getElementsByTagName("connections")[0];if(null!=e&&(null!=(e=mxUtils.getChildNodes(e))&&0<e.length)){this.constraints=[];for(var n=0;n<e.length;n++)this.constraints.push(this.parseConstraint(e[n]))}},mxStencil.prototype.parseConstraint=function(e){var n=Number(e.getAttribute("x")),t=Number(e.getAttribute("y"));return e="1"==e.getAttribute("perimeter"),new mxConnectionConstraint(new mxPoint(n,t),e)},mxStencil.prototype.evaluateTextAttribute=function(e,n,t){return n=this.evaluateAttribute(e,n,t),e=e.getAttribute("localized"),(mxStencil.defaultLocalized&&null==e||"1"==e)&&(n=mxResources.get(n)),n},mxStencil.prototype.evaluateAttribute=function(e,n,t){return null==(n=e.getAttribute(n))&&(null!=(e=mxUtils.getTextContent(e))&&("function"==typeof(e=mxUtils.eval(e))&&(n=e(t)))),n},mxStencil.prototype.drawShape=function(e,n,t,a,i,s){this.drawChildren(e,n,t,a,i,s,this.bgNode,!1),this.drawChildren(e,n,t,a,i,s,this.fgNode,!0)},mxStencil.prototype.drawChildren=function(e,n,t,a,i,s,o,r){if(null!=o){var l=mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,null);for(t=this.computeAspect(n.style,t,a,i,s,l),a=Math.min(t.width,t.height),a="inherit"==this.strokewidth?Number(mxUtils.getNumber(n.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a,e.setStrokeWidth(a),o=o.firstChild;null!=o;)o.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,n,o,t,r),o=o.nextSibling}},mxStencil.prototype.computeAspect=function(e,n,t,a,i,s){e=n,n=a/this.w0;var o=i/this.h0;if(s="north"==s||"south"==s){o=a/this.h0,n=i/this.w0;var r=(a-i)/2;e+=r,t-=r}return"fixed"==this.aspect&&(n=o=Math.min(n,o),s?(e+=(i-this.w0*n)/2,t+=(a-this.h0*o)/2):(e+=(a-this.w0*n)/2,t+=(i-this.h0*o)/2)),new mxRectangle(e,t,n,o)},mxStencil.prototype.drawNode=function(e,n,t,a,i){var s=t.nodeName,o=a.x,r=a.y,l=a.width,d=a.height,c=Math.min(l,d);if("save"==s)e.save();else if("restore"==s)e.restore();else if("path"==s)for(e.begin(),t=t.firstChild;null!=t;)t.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,n,t,a,i),t=t.nextSibling;else if("close"==s)e.close();else if("move"==s)e.moveTo(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("line"==s)e.lineTo(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("quad"==s)e.quadTo(o+Number(t.getAttribute("x1"))*l,r+Number(t.getAttribute("y1"))*d,o+Number(t.getAttribute("x2"))*l,r+Number(t.getAttribute("y2"))*d);else if("curve"==s)e.curveTo(o+Number(t.getAttribute("x1"))*l,r+Number(t.getAttribute("y1"))*d,o+Number(t.getAttribute("x2"))*l,r+Number(t.getAttribute("y2"))*d,o+Number(t.getAttribute("x3"))*l,r+Number(t.getAttribute("y3"))*d);else if("arc"==s)e.arcTo(Number(t.getAttribute("rx"))*l,Number(t.getAttribute("ry"))*d,Number(t.getAttribute("x-axis-rotation")),Number(t.getAttribute("large-arc-flag")),Number(t.getAttribute("sweep-flag")),o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("rect"==s)e.rect(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d);else if("roundrect"==s)0==(n=t.getAttribute("arcsize"))&&(n=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),c=Number(t.getAttribute("w"))*l,a=Number(t.getAttribute("h"))*d,n=Number(n)/100,n=Math.min(c*n,a*n),e.roundrect(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,c,a,n,n);else if("ellipse"==s)e.ellipse(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d);else if("image"==s)n=this.evaluateAttribute(t,"src",n),e.image(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d,n,!1,"1"==t.getAttribute("flipH"),"1"==t.getAttribute("flipV"));else if("text"==s){if(c=this.evaluateTextAttribute(t,"str",n),a="1"==t.getAttribute("vertical")?-90:0,"0"==t.getAttribute("align-shape")){var m=n.rotation,u=1==mxUtils.getValue(n.style,mxConstants.STYLE_FLIPH,0);n=1==mxUtils.getValue(n.style,mxConstants.STYLE_FLIPV,0),a=u&&n?a-m:u||n?a+m:a-m}a-=t.getAttribute("rotation"),e.text(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,0,0,c,t.getAttribute("align")||"left",t.getAttribute("valign")||"top",!1,"",!1,!1,a)}else if("include-shape"==s)null!=(m=mxStencilRegistry.getStencil(t.getAttribute("name")))&&(o+=Number(t.getAttribute("x"))*l,r+=Number(t.getAttribute("y"))*d,c=Number(t.getAttribute("w"))*l,a=Number(t.getAttribute("h"))*d,m.drawShape(e,n,o,r,c,a));else if("fillstroke"==s)e.fillAndStroke();else if("fill"==s)e.fill();else if("stroke"==s)e.stroke();else if("strokewidth"==s)e.setStrokeWidth(Number(t.getAttribute("width"))*c);else if("dashed"==s)e.setDashed("1"==t.getAttribute("dashed"));else if("dashpattern"==s){if(null!=(t=t.getAttribute("pattern"))){for(t=t.split(" "),l=[],d=0;d<t.length;d++)0<t[d].length&&l.push(Number(t[d])*c);t=l.join(" "),e.setDashPattern(t)}}else"strokecolor"==s?e.setStrokeColor(t.getAttribute("color")):"linecap"==s?e.setLineCap(t.getAttribute("cap")):"linejoin"==s?e.setLineJoin(t.getAttribute("join")):"miterlimit"==s?e.setMiterLimit(Number(t.getAttribute("limit"))):"fillcolor"==s?e.setFillColor(t.getAttribute("color")):"alpha"==s?e.setAlpha(t.getAttribute("alpha")):"fontcolor"==s?e.setFontColor(t.getAttribute("color")):"fontstyle"==s?e.setFontStyle(t.getAttribute("style")):"fontfamily"==s?e.setFontFamily(t.getAttribute("family")):"fontsize"==s&&e.setFontSize(Number(t.getAttribute("size"))*c);i&&("fillstroke"==s||"fill"==s||"stroke"==s)&&e.setShadow(!1)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.style=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=6,mxShape.prototype.pointerEvents=!0,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.init=function(e){null==this.node&&(this.node=this.create(e),null!=e&&e.appendChild(this.node))},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round(this.strokewidth*this.scale)),2)?.5:0},mxShape.prototype.create=function(e){return null!=e.ownerSVGElement?this.createSvg(e):8==document.documentMode||this.dialect==mxConstants.DIALECT_SVG||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(e):this.createVml(e)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e},mxShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.checkBounds()?(this.node.style.visibility="","DIV"==this.node.nodeName&&this.isHtmlAllowed()?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.updateBoundsFromPoints=function(){var e=this.points;if(null!=e&&0<e.length&&null!=e[0]){this.bounds=new mxRectangle(Number(e[0].x),Number(e[0].y),1,1);for(var n=1;n<this.points.length;n++)null!=e[n]&&this.bounds.add(new mxRectangle(Number(e[n].x),Number(e[n].y),1,1))}},mxShape.prototype.checkBounds=function(){return null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e.style.width=this.node.style.width,e.style.height=this.node.style.height,e},mxShape.prototype.redrawShape=function(){var e=this.createCanvas();for(e.pointerEvents=this.pointerEvents;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);this.paint(e),this.node!=e.root&&this.node.insertAdjacentHTML("beforeend",e.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",(null==this.stencil||!this.stencilPointerEvents)&&mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(e)},mxShape.prototype.createCanvas=function(){var e=null,n=null;if(null!=this.node.ownerSVGElement)(e=new mxSvgCanvas2D(this.node,!1)).strokeTolerance=this.svgStrokeTolerance,e.blockImagePointerEvents=mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC,0!=(n=this.getSvgScreenOffset())?this.node.setAttribute("transform","translate("+n+","+n+")"):this.node.removeAttribute("transform");else{this.updateVmlContainer();var t=Math.max(1,Math.round(this.bounds.width)),a=Math.max(1,Math.round(this.bounds.height));n=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(n,!1);""!=n.tagUrn&&(n.coordsize=t*this.vmlScale+","+a*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale),n=this.scale,e.translate(-Math.round(this.bounds.x/n),-Math.round(this.bounds.y/n))}return e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var e=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));this.node.style.width=e+"px",this.node.style.height=n+"px",this.node.style.overflow="visible"},mxShape.prototype.destroyCanvas=function(e){if(e instanceof mxSvgCanvas2D){for(var n in e.gradients){var t=e.gradients[n];t.mxRefCount=(t.mxRefCount||0)+1}this.releaseSvgGradients(this.oldGradients),this.oldGradients=e.gradients}},mxShape.prototype.paint=function(e){var n=this.scale,t=this.bounds.x/n,a=this.bounds.y/n,i=this.bounds.width/n,s=this.bounds.height/n;if(this.isPaintBoundsInverted()){t=t+(o=(i-s)/2),a=a-o;var o=i;i=s,s=o}if(this.updateTransform(e,t,a,i,s),this.configureCanvas(e,t,a,i,s),null!=this.stencil)this.paintStencilShape(e,t,a,i,s);else if(e.setStrokeWidth(this.strokewidth),null!=this.points){for(t=[],a=0;a<this.points.length;a++)t.push(new mxPoint(this.points[a].x/n,this.points[a].y/n));this.paintEdgeShape(e,t)}else this.paintVertexShape(e,t,a,i,s)},mxShape.prototype.configureCanvas=function(e,n,t,a,i){var s=null;null!=this.style&&(s=this.style.dashPattern),e.setAlpha(this.opacity/100),null!=this.isShadow&&e.setShadow(this.isShadow),null!=this.isDashed&&e.setDashed(this.isDashed),null!=s&&e.setDashPattern(s),null!=this.gradient?(n=this.getGradientBounds(e,n,t,a,i),e.setGradient(this.fill,this.gradient,n.x,n.y,n.width,n.height,this.gradientDirection)):e.setFillColor(this.fill),e.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(e,n,t,a,i){return new mxRectangle(n,t,a,i)},mxShape.prototype.updateTransform=function(e,n,t,a,i){e.scale(this.scale),e.rotate(this.getShapeRotation(),this.flipH,this.flipV,n+a/2,t+i/2)},mxShape.prototype.paintStencilShape=function(e,n,t,a,i){this.stencilPointerEvents&&(this.dialect==mxConstants.DIALECT_SVG?this.addTransparentBackgroundRectangle(this.node,n,t,a,i):8!=document.documentMode&&this.setTransparentBackgroundImage(this.node)),this.stencil.drawShape(e,this,n,t,a,i)},mxShape.prototype.paintVertexShape=function(e,n,t,a,i){this.paintBackground(e,n,t,a,i),e.setShadow(!1),this.paintForeground(e,n,t,a,i)},mxShape.prototype.paintBackground=function(e,n,t,a,i){},mxShape.prototype.paintForeground=function(e,n,t,a,i){},mxShape.prototype.paintEdgeShape=function(e,n){},mxShape.prototype.getArcSize=function(e,n){var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(e*t,n*t)},mxShape.prototype.paintGlassEffect=function(e,n,t,a,i,s){var o=Math.ceil(this.strokewidth/2);e.setGradient("#ffffff","#ffffff",n,t,a,.6*i,"south",.9,.1),e.begin(),s+=2*o,this.isRounded?(e.moveTo(n-o+s,t-o),e.quadTo(n-o,t-o,n-o,t-o+s),e.lineTo(n-o,t+.4*i),e.quadTo(n+.5*a,t+.7*i,n+a+o,t+.4*i),e.lineTo(n+a+o,t-o+s),e.quadTo(n+a+o,t-o,n+a+o-s,t-o)):(e.moveTo(n-o,t-o),e.lineTo(n-o,t+.4*i),e.quadTo(n+.5*a,t+.7*i,n+a+o,t+.4*i),e.lineTo(n+a+o,t-o)),e.close(),e.fill()},mxShape.prototype.apply=function(e){this.state=e,this.style=e.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),"north"!=this.direction&&"south"!=this.direction||(e=this.flipH,this.flipH=this.flipV,this.flipV=e),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),"none"==this.fill&&(this.fill=null),"none"==this.gradient&&(this.gradient=null),"none"==this.stroke&&(this.stroke=null))},mxShape.prototype.setCursor=function(e){null==e&&(e=""),this.cursor=e,null!=this.node&&(this.node.style.cursor=e)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.updateBoundingBox=function(){if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n)),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height)}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var e=this.bounds.clone();if(this.isPaintBoundsInverted()){var n=(e.width-e.height)/2;e.x+=n,e.y-=n,n=e.width,e.width=e.height,e.height=n}return e},mxShape.prototype.augmentBoundingBox=function(e){this.isShadow&&(e.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),e.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));var n=Math.ceil(this.strokewidth*this.scale);e.grow(Math.ceil(n/2))},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&("north"==this.direction||"south"==this.direction)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var e=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxShape.prototype.getShapeRotation=function(){var e=this.getRotation();return null!=this.direction&&("north"==this.direction?e+=270:"west"==this.direction?e+=180:"south"==this.direction&&(e+=90)),e},mxShape.prototype.addTransparentBackgroundRectangle=function(e,n,t,a,i){(e=document.createElementNS(mxConstants.NS_SVG,"rect")).setAttribute("x",n),e.setAttribute("y",t),e.setAttribute("width",a),e.setAttribute("height",i),e.setAttribute("fill","none"),e.setAttribute("stroke","none"),e.setAttribute("pointer-events","all"),this.node.appendChild(e)},mxShape.prototype.setTransparentBackgroundImage=function(e){e.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(e){if(null!=e)for(var n in e){var t=e[n];t.mxRefCount=(t.mxRefCount||0)-1,0==t.mxRefCount&&null!=t.parentNode&&t.parentNode.removeChild(t)}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null};var mxStencilRegistry={stencils:[],addStencil:function(e,n){mxStencilRegistry.stencils[e]=n},getStencil:function(e){return mxStencilRegistry.stencils[e]}},mxMarker={markers:[],addMarker:function(e,n){mxMarker.markers[e]=n},createMarker:function(e,n,t,a,i,s,o,r,l,d){var c=mxMarker.markers[t];return null!=c?c(e,n,t,a,i,s,o,r,l,d):null}};function mxActor(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxCloud(e,n,t,a){mxActor.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxRectangleShape(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxEllipse(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxDoubleEllipse(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxRhombus(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxPolyline(e,n,t){mxShape.call(this),this.points=e,this.stroke=n,this.strokewidth=null!=t?t:1}function mxArrow(e,n,t,a,i,s,o){mxShape.call(this),this.points=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1,this.arrowWidth=null!=i?i:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxText(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A){mxShape.call(this),this.value=e,this.bounds=n,this.color=null!=i?i:"black",this.align=null!=t?t:"",this.valign=null!=a?a:"",this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(l||2),this.spacingTop=this.spacing+parseInt(d||0),this.spacingRight=this.spacing+parseInt(c||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(u||0),this.horizontal=null==p||p,this.background=g,this.border=v,this.wrap=null!=h&&h,this.clipped=null!=f&&f,this.overflow=null!=b?b:"visible",this.labelPadding=null!=A?A:0,this.rotation=0}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(e,n,t){mxShape.call(this),this.bounds=e,this.stroke=n,this.strokewidth=null!=t?t:1}function mxImageShape(e,n,t,a,i){mxShape.call(this),this.bounds=e,this.image=n,this.fill=t,this.stroke=a,this.strokewidth=null!=i?i:1,this.shadow=!1}function mxLabel(e,n,t,a){mxRectangleShape.call(this,e,n,t,a)}function mxCylinder(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxConnector(e,n,t){mxPolyline.call(this,e,n,t)}function mxSwimlane(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxGraphLayout(e){this.graph=e}function mxStackLayout(e,n,t,a,i,s){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.spacing=null!=t?t:0,this.x0=null!=a?a:0,this.y0=null!=i?i:0,this.border=null!=s?s:0}function mxPartitionLayout(e,n,t,a){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.spacing=t||0,this.border=a||0}function mxCompactTreeLayout(e,n,t){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.invert=null!=t&&t}function WeightedCellSorter(e,n){this.cell=e,this.weightedValue=n}function mxFastOrganicLayout(e){mxGraphLayout.call(this,e)}function mxCircleLayout(e,n){mxGraphLayout.call(this,e),this.radius=null!=n?n:100}function mxParallelEdgeLayout(e){mxGraphLayout.call(this,e)}function mxCompositeLayout(e,n,t){mxGraphLayout.call(this,e),this.layouts=n,this.master=t}function mxEdgeLabelLayout(e,n){mxGraphLayout.call(this,e)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=e}function mxGraphHierarchyEdge(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=e}function mxGraphHierarchyModel(e,n,t,a,i){for(e.getGraph(),this.tightenToSource=i,this.roots=t,this.parent=a,this.vertexMapper={},this.edgeMapper={},this.maxRank=0,t=[],null==n&&(n=this.graph.getChildVertices(a)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(e,n,t),a=0;a<n.length;a++){i=t[a].connectsAsSource;for(var s=0;s<i.length;s++){var o=i[s];if(null!=(r=o.edges)&&0<r.length){var r=r[0],l=e.getVisibleTerminal(r,!1);l=mxCellPath.create(l),l=this.vertexMapper[l];t[a]==l&&(l=e.getVisibleTerminal(r,!0),l=mxCellPath.create(l),l=this.vertexMapper[l]),null!=l&&t[a]!=l&&(0==(o.target=l).connectsAsTarget.length&&(l.connectsAsTarget=[]),mxUtils.indexOf(l.connectsAsTarget,o)<0&&l.connectsAsTarget.push(o))}}t[a].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(e){this.layout=e}function MedianCellSorter(){}function mxMinimumCycleRemover(e){this.layout=e}function mxCoordinateAssignment(e,n,t,a,i,s){this.layout=e,this.intraCellSpacing=n,this.interRankCellSpacing=t,this.orientation=a,this.initialX=i,this.parallelEdgeSpacing=s}!function(){function e(e,n,t,a,i,s,o,r,l,d){n=1.118*i*l,r=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=n,c.y-=r,o=t!=mxConstants.ARROW_CLASSIC?1:.75,a.x+=-i*o-n,a.y+=-s*o-r,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i-s/2,c.y-s+i/2),t==mxConstants.ARROW_CLASSIC&&e.lineTo(c.x-3*i/4,c.y-3*s/4),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.close(),d?e.fillAndStroke():e.stroke()}}function n(e,n,t,a,i,s,o,r,l,d){r=t==mxConstants.ARROW_DIAMOND?.7071:.9862,n=i*l*r,r*=s*l,i*=o+l,s*=o+l;var c=a.clone();c.x-=n,c.y-=r,a.x+=-i-n,a.y+=-s-r;var m=t==mxConstants.ARROW_DIAMOND?2:3.4;return function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i/2-s/m,c.y+i/m-s/2),e.lineTo(c.x-i,c.y-s),e.lineTo(c.x-i/2+s/m,c.y-s/2-i/m),e.close(),d?e.fillAndStroke():e.stroke()}}mxMarker.addMarker("classic",e),mxMarker.addMarker("block",e),mxMarker.addMarker("open",function(e,n,t,a,i,s,o,r,l,d){n=1.118*i*l,t=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=n,c.y-=t,a.x+=2*-n,a.y+=2*-t,function(){e.begin(),e.moveTo(c.x-i-s/2,c.y-s+i/2),e.lineTo(c.x,c.y),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.stroke()}}),mxMarker.addMarker("oval",function(e,n,t,a,i,s,o,r,l,d){var c=o/2,m=a.clone();return a.x-=i*c,a.y-=s*c,function(){e.ellipse(m.x-c,m.y-c,o,o),d?e.fillAndStroke():e.stroke()}}),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(e,n,t,a,i){e.translate(n,t),e.begin(),this.redrawPath(e,n,t,a,i),e.fillAndStroke()},mxActor.prototype.redrawPath=function(e,n,t,a,i){n=a/3,e.moveTo(0,i),e.curveTo(0,3*i/5,0,2*i/5,a/2,2*i/5),e.curveTo(a/2-n,2*i/5,a/2-n,0,a/2,0),e.curveTo(a/2+n,0,a/2+n,2*i/5,a/2,2*i/5),e.curveTo(a,2*i/5,a,3*i/5,a,i),e.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(.25*a,.25*i),e.curveTo(.05*a,.25*i,0,.5*i,.16*a,.55*i),e.curveTo(0,.66*i,.18*a,.9*i,.31*a,.8*i),e.curveTo(.4*a,i,.7*a,i,.8*a,.8*i),e.curveTo(a,.8*i,a,.6*i,.875*a,.5*i),e.curveTo(a,.3*i,.8*a,.1*i,.625*a,.2*i),e.curveTo(.5*a,.05*i,.3*a,.05*i,.25*a,.25*i),e.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.isRounded&&!this.glass&&0==this.rotation},mxRectangleShape.prototype.paintBackground=function(e,n,t,a,i){if(this.isRounded){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;s=Math.min(a*s,i*s);e.roundrect(n,t,a,i,s,s)}else e.rect(n,t,a,i);e.fillAndStroke()},mxRectangleShape.prototype.paintForeground=function(e,n,t,a,i){this.glass&&this.paintGlassEffect(e,n,t,a,i,this.getArcSize(a+this.strokewidth,i+this.strokewidth))},mxRectangleShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxRectangleShape.prototype.updateHtmlBounds=function(e){var n=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);e.style.borderWidth=Math.max(1,n)+"px",e.style.overflow="hidden",e.style.left=Math.round(this.bounds.x-n/2)+"px",e.style.top=Math.round(this.bounds.y-n/2)+"px","CSS1Compat"==document.compatMode&&(n=-n),e.style.width=Math.round(Math.max(0,this.bounds.width+n))+"px",e.style.height=Math.round(Math.max(0,this.bounds.height+n))+"px"},mxRectangleShape.prototype.updateHtmlColors=function(e){var n=this.stroke;null!=n&&n!=mxConstants.NONE?(e.style.borderColor=n,this.isDashed?e.style.borderStyle="dashed":0<this.strokewidth&&(e.style.borderStyle="solid"),e.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):e.style.borderWidth="0px",null!=(n=this.fill)&&n!=mxConstants.NONE?(e.style.backgroundColor=n,e.style.backgroundImage="none"):this.pointerEvents?e.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(e):this.setTransparentBackgroundImage(e)},mxRectangleShape.prototype.updateHtmlFilters=function(e){var n="";if(this.opacity<100&&(n+="alpha(opacity="+this.opacity+")"),this.isShadow&&(n+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.SHADOWCOLOR+"')"),this.gradient){var t=this.fill,a=this.gradient,i="0",s={east:0,south:1,west:2,north:3},o=null!=this.direction?s[this.direction]:0;null!=this.gradientDirection&&(o=mxUtils.mod(o+s[this.gradientDirection]-1,4)),1==o?(i="1",s=t,t=a,a=s):2==o?(s=t,t=a,a=s):3==o&&(i="1"),n+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+t+"', endColorStr='"+a+"', gradientType='"+i+"')"}e.style.filter=n},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(e,n,t,a,i){e.ellipse(n,t,a,i),e.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(e,n,t,a,i){e.ellipse(n,t,a,i),e.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(e,n,t,a,i){var s=Math.min(4,Math.min(a/5,i/5));i-=2*s,0<(a-=2*s)&&0<i&&e.ellipse(n+s,t+s,a,i),e.stroke()},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(e,n,t,a,i){var s=a/2,o=i/2;e.begin(),e.moveTo(n+s,t),e.lineTo(n+a,t+o),e.lineTo(n+s,t+i),e.lineTo(n,t+o),e.close(),e.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.paintEdgeShape=function(e,n){this.paintLine(e,n,this.isRounded)},mxPolyline.prototype.paintLine=function(e,n,t){var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,i=n[0],s=n[n.length-1];e.begin(),e.moveTo(i.x,i.y);for(var o=1;o<n.length-1;o++){var r=n[o],l=i.x-r.x;i=i.y-r.y;if(t&&o<n.length-1&&(0!=l||0!=i)){var d=Math.sqrt(l*l+i*i);l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d;e.lineTo(r.x+l,r.y+i),l=(i=n[o+1]).x-r.x,i=i.y-r.y,d=Math.max(1,Math.sqrt(l*l+i*i)),l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d,l=r.x+l,i=r.y+i,e.quadTo(r.x,r.y,l,i),r=new mxPoint(l,i)}else e.lineTo(r.x,r.y);i=r}e.lineTo(s.x,s.y),e.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.paintEdgeShape=function(e,n){var t=mxConstants.ARROW_SPACING,a=mxConstants.ARROW_WIDTH,i=mxConstants.ARROW_SIZE,s=n[0],o=n[n.length-1],r=o.x-s.x,l=o.y-s.y,d=(c=Math.sqrt(r*r+l*l))-2*t-i,c=(r=r/c,a*(l=l/c)/3),m=(a=-a*r/3,(i=s.x-c/2+t*r)+c),u=(s=s.y-a/2+t*l)+a,p=m+d*r,g=p+c,v=(d=u+d*l)+a,h=g-3*c,f=v-3*a;e.begin(),e.moveTo(i,s),e.lineTo(m,u),e.lineTo(p,d),e.lineTo(g,v),e.lineTo(o.x-t*r,o.y-t*l),e.lineTo(h,f),e.lineTo(h+c,f+a),e.close(),e.fillAndStroke()},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!(null==this.bounds||isNaN(this.bounds.x)||isNaN(this.bounds.y)||isNaN(this.bounds.width)||isNaN(this.bounds.height))},mxText.prototype.updateBoundingBox=function(){var e=this.node;8==document.documentMode&&null!=e.firstChild&&(null!=(e=e.firstChild).firstChild&&(e=e.firstChild)),this.boundingBox=this.bounds.clone();var n=this.getTextRotation();if(this.ignoreStringSize||null==e||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize)this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height;else{var t=null,a=null;if(null!=e.ownerSVGElement)if(null!=e.firstChild&&null!=e.firstChild.firstChild&&"foreignObject"==e.firstChild.firstChild.nodeName)e=e.firstChild.firstChild,t=this.wrap?this.bounds.width:parseInt(e.getAttribute("width"))*this.scale,a=parseInt(e.getAttribute("height"))*this.scale;else{if(0==(n=e.getBBox()).width&&0==n.height)return;this.boundingBox=new mxRectangle(n.x,n.y,n.width,n.height),n=0}else a=this.state.view.textDiv,a=null!=this.offsetWidth&&null!=this.offsetHeight?(t=this.wrap?this.bounds.width:this.offsetWidth*this.scale,this.offsetHeight*this.scale):null!=a?(this.updateFont(a),this.updateSize(a),mxUtils.isNode(this.value)?a.innerHTML=this.value.outerHTML:(t=this.replaceLinefeeds?this.value.replace(/\n/g,"<br/>"):this.value,a.innerHTML=t),t=this.wrap?this.bounds.width:a.offsetWidth*this.scale,a.offsetHeight*this.scale):(t=this.wrap?this.bounds.width:e.offsetWidth*this.scale,e.offsetHeight*this.scale);null!=t&&null!=a&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*t,this.bounds.y+this.margin.y*a,t,a))}null!=this.boundingBox&&(0!=n&&(n=mxUtils.getBoundingBox(this.boundingBox,n),this.boundingBox.x=n.x,this.boundingBox.y=n.y,mxClient.IS_QUIRKS||(this.boundingBox.width=n.width,this.boundingBox.height=n.height)),this.boundingBox.x=Math.floor(this.boundingBox.x),this.boundingBox.y=Math.floor(this.boundingBox.y),this.boundingBox.width=Math.ceil(this.boundingBox.width),this.boundingBox.height=Math.ceil(this.boundingBox.height))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(e,n,t,a,i){mxShape.prototype.configureCanvas.apply(this,arguments),e.setFontColor(this.color),e.setFontBackgroundColor(this.background),e.setFontBorderColor(this.border),e.setFontFamily(this.family),e.setFontSize(this.size),e.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.paint=function(e){var n=this.scale,t=this.bounds.x/n,a=this.bounds.y/n,i=this.bounds.width/n;n=this.bounds.height/n;this.updateTransform(e,t,a,i,n),this.configureCanvas(e,t,a,i,n);var s=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=s||e instanceof mxVmlCanvas2D?"html":"",r=this.value;!s&&"html"==o&&(r=mxUtils.htmlEntities(r,!1)),r=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==o?r.replace(/\n/g,"<br/>"):r,e.text(t,a,i,n,r,this.align,this.valign,this.wrap,o,"fill"==this.overflow,this.clipped,this.getTextRotation())},mxText.prototype.redrawHtmlShape=function(){var e=this.node.style;e.opacity=this.opacity<1?this.opacity:"",e.overflow="",e.width="",e.height="",this.updateFont(this.node),this.updateSize(this.node),this.updateValue(),this.offsetHeight=this.offsetWidth=null,null!=mxClient.CSS_PREFIX?this.updateHtmlTransform():this.updateHtmlFilter()},mxText.prototype.updateHtmlTransform=function(){var e=this.getTextRotation(),n=this.node.style,t=this.margin.x,a=this.margin.y;0!=e?(n[mxClient.CSS_PREFIX+"TransformOrigin"]=100*-t+"% "+100*-a+"%",n[mxClient.CSS_PREFIX+"Transform"]="translate("+100*t+"%,"+100*a+"%)scale("+this.scale+") rotate("+e+"deg)"):(n[mxClient.CSS_PREFIX+"TransformOrigin"]="0% 0%",n[mxClient.CSS_PREFIX+"Transform"]="scale("+this.scale+")translate("+100*t+"%,"+100*a+"%)"),n.left=Math.round(this.bounds.x)+"px",n.top=Math.round(this.bounds.y)+"px"},mxText.prototype.updateHtmlFilter=function(){var e=this.node.style,n=this.margin.x,t=this.margin.y,a=this.scale;e.filter="";var i=0,s=0;if(null!=(r=null!=this.state?this.state.view.textDiv:null)){if(r.style.overflow="",r.style.height="",r.style.width="",this.updateFont(r),this.updateSize(r),mxUtils.isNode(this.value))r.innerHTML=this.value.outerHTML;else{var o=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(o=mxUtils.htmlEntities(o,!1)),o=this.replaceLinefeeds?o.replace(/\n/g,"<br/>"):o,r.innerHTML=o}i=r.offsetWidth+2,s=r.offsetHeight+2}else i=this.node.offsetWidth,s=this.node.offsetHeight+1;this.offsetWidth=i,this.offsetHeight=s,r=this.bounds.width/a,o=this.bounds.height/a,mxClient.IS_QUIRKS&&(this.clipped||"fill"==this.overflow)&&0<o?(o=Math.min(o,s),e.height=Math.round(o+1)+"px"):o=s,"fill"!=this.overflow&&(mxClient.IS_QUIRKS&&(this.clipped||this.wrap)&&0<r?(r=Math.min(r,i),e.width=Math.round(r)+"px"):r=i);o*=a;var r=r*a,l=(i=this.getTextRotation()*(Math.PI/180),s=parseFloat(parseFloat(Math.cos(i)).toFixed(8)),parseFloat(parseFloat(Math.sin(-i)).toFixed(8)));(i=i%(2*Math.PI))<0&&(i+=2*Math.PI),(i%=Math.PI)>Math.PI/2&&(i=Math.PI-i);var d=Math.cos(i),c=Math.sin(-i),m=(o-o*d+r*c)/2+l*(n=r*-(n+.5))-s*(t=o*-(t+.5));0!=i&&(e.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+s+", M12="+l+", M21="+-l+", M22="+s+", sizingMethod='auto expand')"),e.zoom=a,e.left=Math.round(this.bounds.x+((r-r*d+o*c)/2-s*n-l*t)-r/2)+"px",e.top=Math.round(this.bounds.y+m-o/2)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1));e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var n=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,t=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if(null!=n||null!=t)if("fill"==this.overflow)null!=n&&(this.node.style.backgroundColor=n),null!=t&&(this.node.style.border="1px solid "+t);else{var a="";null!=n&&(a+="background-color:"+n+";"),null!=t&&(a+="border:1px solid "+t+";"),e='<div style="zoom:1;'+a+"display:inline-block;_display:inline;padding-bottom:1px;padding-right:1px;line-height:"+this.node.style.lineHeight+'">'+e+"</div>",this.node.style.lineHeight=""}this.node.innerHTML=e}},mxText.prototype.updateFont=function(e){(e=e.style).lineHeight=Math.round(this.size*mxConstants.LINE_HEIGHT)+"px",e.fontSize=Math.round(this.size)+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,e.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",e.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",e.fontDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?"underline":"",e.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"},mxText.prototype.updateSize=function(e){var n=Math.round(this.bounds.width/this.scale),t=Math.round(this.bounds.height/this.scale);e=e.style,this.clipped?(e.overflow="hidden",0<t&&(e.maxHeight=t+"px"),0<n&&(e.width=n+"px")):"fill"==this.overflow&&(e.width=n+"px",0<t&&(e.maxHeight=t+"px")),this.wrap?(!this.clipped&&0<n&&(e.width=n+"px"),e.whiteSpace="normal"):e.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(0,0),e.lineTo(a,.5*i),e.lineTo(0,i),e.close()},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(.25*a,0),e.lineTo(.75*a,0),e.lineTo(a,.5*i),e.lineTo(.75*a,i),e.lineTo(.25*a,i),e.lineTo(0,.5*i),e.close()},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(e,n,t,a,i){t+=i/2,e.begin(),e.moveTo(n,t),e.lineTo(n+a,t),e.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return mxClient.IS_IE?0:.5},mxImageShape.prototype.apply=function(e){mxShape.prototype.apply.apply(this,arguments),this.gradient=this.stroke=this.fill=null,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER),this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxImageShape.prototype.paintVertexShape=function(e,n,t,a,i){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null==s&&null==o||(e.setFillColor(s),e.setStrokeColor(o),e.rect(n,t,a,i),e.fillAndStroke()),e.image(n,t,a,i,this.image,this.preserveImageAspect,!1,!1)}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.style.backgroundColor=this.fill||"",this.node.style.borderColor=this.stroke||"",this.node.innerHTML="",null!=this.image){var e=document.createElement(mxClient.IS_IE6||null==mxClient.CSS_PREFIX&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");e.style.position="absolute",e.src=this.image;var n=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=n,this.flipH&&this.flipV?n+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?n+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(n+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),e.style.filter!=n&&(e.style.filter=n),"image"==e.nodeName?e.style.rotation=this.rotation:e.style[mxClient.CSS_PREFIX+"Transform"]="rotate("+this.rotation+"deg)",e.style.width=this.node.style.width,e.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(e)}else this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(e){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorColor&&null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.bounds=this.bounds,this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(e,n,t,a,i){this.paintImage(e,n,t,a,i),this.paintIndicator(e,n,t,a,i),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(e,n,t,a,i){null!=this.image&&(n=this.getImageBounds(n,t,a,i),e.image(n.x,n.y,n.width,n.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(e,n,t,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return new mxRectangle(e=i==mxConstants.ALIGN_CENTER?e+(t-o)/2:i==mxConstants.ALIGN_RIGHT?e+(t-o-l):e+l,n=s==mxConstants.ALIGN_TOP?n+l:s==mxConstants.ALIGN_BOTTOM?n+(a-r-l):n+(a-r)/2,o,r)},mxLabel.prototype.paintIndicator=function(e,n,t,a,i){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(n,t,a,i),this.indicator.paint(e)):null!=this.indicatorImage&&(n=this.getIndicatorBounds(n,t,a,i),e.image(n.x,n.y,n.width,n.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(e,n,t,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;return new mxRectangle(e=i==mxConstants.ALIGN_RIGHT?e+(t-o-l):i==mxConstants.ALIGN_CENTER?e+(t-o)/2:e+l,n=s==mxConstants.ALIGN_BOTTOM?n+(a-r-l):s==mxConstants.ALIGN_TOP?n+l:n+(a-r)/2,o,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var e=document.createElement("img");e.style.position="relative",e.setAttribute("border","0");var n=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);n.x-=this.bounds.x,n.y-=this.bounds.y,e.style.left=Math.round(n.x)+"px",e.style.top=Math.round(n.y)+"px",e.style.width=Math.round(n.width)+"px",e.style.height=Math.round(n.height)+"px",e.src=this.image,this.node.appendChild(e)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(e,n,t,a,i){e.translate(n,t),e.begin(),this.redrawPath(e,n,t,a,i,!1),e.fillAndStroke(),e.setShadow(!1),e.begin(),this.redrawPath(e,n,t,a,i,!0),e.stroke()},mxCylinder.prototype.redrawPath=function(e,n,t,a,i,s){n=Math.min(this.maxHeight,Math.round(i/5)),(s&&null!=this.fill||!s&&null==this.fill)&&(e.moveTo(0,n),e.curveTo(0,2*n,a,2*n,a,n),s||(e.stroke(),e.begin())),s||(e.moveTo(0,n),e.curveTo(0,-n/3,a,-n/3,a,n),e.lineTo(a,i-n),e.curveTo(a,i+n/3,0,i+n/3,0,i-n),e.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.paintEdgeShape=function(e,n){var t=this.createMarker(e,n,!0),a=this.createMarker(e,n,!1);null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(e,n,this.isRounded):this.paintCurvedLine(e,n),e.setFillColor(this.stroke),e.setShadow(!1),e.setDashed(!1),null!=t&&t(),null!=a&&a()},mxConnector.prototype.paintCurvedLine=function(e,n){e.begin();var t=n[0],a=n.length;for(e.moveTo(t.x,t.y),t=1;t<a-2;t++){var i=n[t],s=n[t+1];e.quadTo(i.x,i.y,(i.x+s.x)/2,(i.y+s.y)/2)}i=n[a-2],s=n[a-1],e.quadTo(i.x,i.y,s.x,s.y),e.stroke()},mxConnector.prototype.createMarker=function(e,n,t){var a=n.length,i=t?n[1]:n[a-2],s=(a=(n=t?n[0]:n[a-1]).x-i.x,n.y-i.y),o=(i=a/(o=Math.max(1,Math.sqrt(a*a+s*s))),a=s/o,s=mxUtils.getNumber(this.style,t?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),mxUtils.getValue(this.style,t?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW));return mxMarker.createMarker(e,this,o,n,i,a,s,t,this.strokewidth,0!=this.style[t?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL])},mxConnector.prototype.augmentBoundingBox=function(e){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var n=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(n=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(n=Math.max(n,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),e.grow(Math.ceil(n*this.scale))},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.getGradientBounds=function(e,n,t,a,i){return new mxRectangle(n,t,a,Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)))},mxSwimlane.prototype.getRotation=function(){var e=mxShape.prototype.getRotation.apply(this,arguments);return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxSwimlane.prototype.getTextRotation=function(){return this.getRotation()},mxSwimlane.prototype.isPaintBoundsInverted=function(){return mxShape.prototype.isPaintBoundsInverted.apply(this,arguments)||1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.getArcSize=function(e,n,t){return 3*t*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)},mxSwimlane.prototype.paintVertexShape=function(e,n,t,a,i){var s=Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0;e.translate(n,t),this.isRounded?(l=this.getArcSize(a,i,s),this.paintRoundedSwimlane(e,n,t,a,i,s,l,o,r)):this.paintSwimlane(e,n,t,a,i,s,o,r),o=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE),this.paintSeparator(e,a,s,i,o),null!=this.image&&(i=this.getImageBounds(n,s,a,i),e.image(i.x-n,i.y-t,i.width,i.height,this.image,!1,!1,!1)),this.glass&&(e.setShadow(!1),this.paintGlassEffect(e,0,0,a,s,l))},mxSwimlane.prototype.paintSwimlane=function(e,n,t,a,i,s,o,r){o!=mxConstants.NONE&&(e.save(),e.setFillColor(o),e.rect(0,0,a,i),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(0,s),e.lineTo(0,0),e.lineTo(a,0),e.lineTo(a,s),r&&e.close(),e.fillAndStroke(),s<i&&o==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i),e.lineTo(a,i),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintRoundedSwimlane=function(e,n,t,a,i,s,o,r,l){r!=mxConstants.NONE&&(e.save(),e.setFillColor(r),e.roundrect(0,0,a,i,o,o),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(a,s),e.lineTo(a,o),e.quadTo(a,0,a-Math.min(a/2,o),0),e.lineTo(Math.min(a/2,o),0),e.quadTo(0,0,0,o),e.lineTo(0,s),l&&e.close(),e.fillAndStroke(),s<i&&r==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i-o),e.quadTo(0,i,Math.min(a/2,o),i),e.lineTo(a-Math.min(a/2,o),i),e.quadTo(a,i,a,i-o),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintSeparator=function(e,n,t,a,i){i!=mxConstants.NONE&&(e.setStrokeColor(i),e.setDashed(!0),e.begin(),e.moveTo(n,t),e.lineTo(n,a),e.stroke(),e.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(e,n,t,a){return new mxRectangle(e+t-this.imageSize,n,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(e,n,t){},mxGraphLayout.prototype.execute=function(e){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(e,n,t,a){return null!=(n=null!=(t=this.graph.view.getState(n))?t.style:this.graph.getCellStyle(n))?n[e]:null},mxGraphLayout.traverse=function(e,n,t,a,i){if(null!=t&&null!=e){n=null==n||n,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=t(i[s]=e,a))||a)&&0<(a=this.graph.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.graph.model.getEdgeAt(e,s),r=this.graph.model.getTerminal(o,!0)==e;n&&!r||(r=this.graph.view.getVisibleTerminal(o,!r),this.traverse(r,n,t,o,i))}}},mxGraphLayout.prototype.isVertexMovable=function(e){return this.graph.isCellMovable(e)},mxGraphLayout.prototype.isVertexIgnored=function(e){return!this.graph.getModel().isVertex(e)||!this.graph.isCellVisible(e)},mxGraphLayout.prototype.isEdgeIgnored=function(e){var n=this.graph.getModel();return!n.isEdge(e)||!this.graph.isCellVisible(e)||null==n.getTerminal(e,!0)||null==n.getTerminal(e,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(e,n){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,n?"0":"1",[e])},mxGraphLayout.prototype.setOrthogonalEdge=function(e,n){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,n?"1":"0",[e])},mxGraphLayout.prototype.getParentOffset=function(e){var n=new mxPoint;if(null!=e&&e!=this.parent){var t=this.graph.getModel();if(t.isAncestor(this.parent,e))for(var a=t.getGeometry(e);e!=this.parent;)n.x+=a.x,n.y+=a.y,e=t.getParent(e),a=t.getGeometry(e)}return n},mxGraphLayout.prototype.setEdgePoints=function(e,n){if(null!=e){var t=this.graph.model,a=t.getGeometry(e);if(null==a?(a=new mxGeometry).setRelative(!0):a=a.clone(),null!=this.parent&&null!=n)for(var i=t.getParent(e),s=(i=this.getParentOffset(i),0);s<n.length;s++)n[s].x-=i.x,n[s].y-=i.y;a.points=n,t.setGeometry(e,a)}},mxGraphLayout.prototype.setVertexLocation=function(e,n,t){var a=this.graph.getModel(),i=a.getGeometry(e),s=null;if(null!=i){if(s=new mxRectangle(n,t,i.width,i.height),this.useBoundingBox){var o=this.graph.getView().getState(e);if(null!=o&&null!=o.text&&null!=o.text.boundingBox){var r=this.graph.getView().scale,l=o.text.boundingBox;o.text.boundingBox.x<o.x&&(n+=(o.x-l.x)/r,s.width=l.width),o.text.boundingBox.y<o.y&&(t+=(o.y-l.y)/r,s.height=l.height)}}null!=this.parent&&(null!=(o=a.getParent(e))&&o!=this.parent&&(n-=(o=this.getParentOffset(o)).x,t-=o.y)),i.x==n&&i.y==t||((i=i.clone()).x=n,i.y=t,a.setGeometry(e,i))}return s},mxGraphLayout.prototype.getVertexBounds=function(e){var n=this.graph.getModel().getGeometry(e);if(this.useBoundingBox&&(null!=(r=this.graph.getView().getState(e))&&null!=r.text&&null!=r.text.boundingBox)){var t=this.graph.getView().scale,a=r.text.boundingBox,i=Math.max(r.x-a.x,0)/t,s=Math.max(r.y-a.y,0)/t,o=Math.max(a.x+a.width-(r.x+r.width),0)/t,r=Math.max(a.y+a.height-(r.y+r.height),0)/t;n=new mxRectangle(n.x-i,n.y-s,n.width+i+o,n.height+s+r)}return null!=this.parent&&(e=this.graph.getModel().getParent(e),n=n.clone(),null!=e&&e!=this.parent&&(e=this.getParentOffset(e),n.x+=e.x,n.y+=e.y)),new mxRectangle(n.x,n.y,n.width,n.height)},mxGraphLayout.prototype.arrangeGroups=function(e,n){this.graph.getModel().beginUpdate();try{for(var t=e.length-1;0<=t;t--){var a=e[t],i=this.graph.getChildVertices(a),s=this.graph.getBoundingBoxFromGeometry(i),o=this.graph.getCellGeometry(a),r=0,l=0;if(this.graph.isSwimlane(a)){var d=this.graph.getStartSize(a);r=d.width,l=d.height}null!=s&&null!=o&&((o=o.clone()).x=o.x+s.x-n-r,o.y=o.y+s.y-n-l,o.width=s.width+2*n+r,o.height=s.height+2*n+l,this.graph.getModel().setGeometry(a,o),this.graph.moveCells(i,n+r-s.x,n+l-s.y))}}finally{this.graph.getModel().endUpdate()}},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(e,n,t){var a=this.graph.getModel(),i=a.getParent(e),s=this.isHorizontal();if(null!=e&&null!=i){var o=0,r=0,l=a.getChildCount(i);for(n=s?n:t,null!=(o=this.graph.getView().getState(i))&&(n-=s?o.x:o.y),o=0;o<l;o++)if((t=a.getChildAt(i,o))!=e&&null!=(t=a.getGeometry(t))){if(t=s?t.x+t.width/2:t.y+t.height/2,r<n&&n<t)break;r=t}s=i.getIndex(e),s=Math.max(0,o-(s<o?1:0)),a.add(i,e,s)}},mxStackLayout.prototype.getParentSize=function(e){var n=this.graph.getModel(),t=n.getGeometry(e);return null!=this.graph.container&&(null==t&&n.isLayer(e)||e==this.graph.getView().currentRoot)&&(t=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),t},mxStackLayout.prototype.execute=function(e){if(null!=e){var n=this.isHorizontal(),t=this.graph.getModel(),a=this.getParentSize(e),i=0;null!=a&&(i=n?a.height:a.width);i=i-(2*this.spacing+2*this.border);var s=this.x0+this.border,o=this.y0+this.border;if(this.graph.isSwimlane(e)){var r=this.graph.getCellStyle(e),l=mxUtils.getValue(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);n==(r=mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0))&&(i-=l),n?o+=l:s+=l}t.beginUpdate();try{l=0,r=null;for(var d=t.getChildCount(e),c=0;c<d;c++){var m=t.getChildAt(e,c);if(!this.isVertexIgnored(m)&&this.isVertexMovable(m)){var u=t.getGeometry(m);null!=u&&(u=u.clone(),null!=this.wrap&&null!=r&&(n&&r.x+r.width+u.width+2*this.spacing>this.wrap||!n&&r.y+r.height+u.height+2*this.spacing>this.wrap)&&(r=null,n?o+=l+this.spacing:s+=l+this.spacing,l=0),l=Math.max(l,n?u.height:u.width),null!=r?n?u.x=r.x+r.width+this.spacing:u.y=r.y+r.height+this.spacing:this.keepFirstLocation||(n?u.x=s:u.y=o),n?u.y=o:u.x=s,this.fill&&0<i&&(n?u.height=i:u.width=i),t.setGeometry(m,u),r=u)}}this.resizeParent&&null!=a&&null!=r&&!this.graph.isCellCollapsed(e)?(a=a.clone(),n?a.width=r.x+r.width+this.spacing:a.height=r.y+r.height+this.spacing,t.setGeometry(e,a)):this.resizeLast&&null!=a&&null!=r&&(n?r.width=a.width-r.x-this.spacing:r.height=a.height-r.y-this.spacing)}finally{t.endUpdate()}}},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(e,n,t){var a=(t=this.graph.getModel()).getParent(e);if(null!=e&&null!=a){var i=0,s=0,o=t.getChildCount(a);for(i=0;i<o;i++){var r=t.getChildAt(a,i);if(null!=(r=this.getVertexBounds(r))){if(r=r.x+r.width/2,s<n&&n<r)break;s=r}}n=a.getIndex(e),n=Math.max(0,i-(n<i?1:0)),t.add(a,e,n)}},mxPartitionLayout.prototype.execute=function(e){var n=this.isHorizontal(),t=this.graph.getModel(),a=t.getGeometry(e);if(null!=this.graph.container&&(null==a&&t.isLayer(e)||e==this.graph.getView().currentRoot)&&(a=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=a){for(var i=[],s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}if(0<(s=i.length)){var l=this.border,d=this.border,c=(c=n?a.height:a.width)-2*this.border;if(e=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle,c-=n?e.height:e.width,l+=e.width,d+=e.height,e=this.border+(s-1)*this.spacing,0<(a=n?(a.width-l-e)/s:(a.height-d-e)/s)){t.beginUpdate();try{for(o=0;o<s;o++){r=i[o];var m=t.getGeometry(r);null!=m&&((m=m.clone()).x=l,m.y=d,n?(this.resizeVertices&&(m.width=a,m.height=c),l+=a+this.spacing):(this.resizeVertices&&(m.height=a,m.width=c),d+=a+this.spacing),t.setGeometry(r,m))}}finally{t.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(e,n){this.parent=e;var t=this.graph.getModel();if(null==n)if(0<this.graph.getEdges(e,t.getParent(e),this.invert,!this.invert,!1).length)n=e;else{if(0<(o=this.graph.findTreeRoots(e,!0,this.invert)).length)for(var a=0;a<o.length;a++)if(!this.isVertexIgnored(o[a])&&0<this.graph.getEdges(o[a],null,this.invert,!this.invert,!1).length){n=o[a];break}}if(null!=n){this.parentsChanged=this.resizeParent?{}:null,t.beginUpdate();try{var i=this.dfs(n,e);if(null!=i){this.layout(i);var s=this.graph.gridSize,o=s;if(!this.moveTree){var r=this.getVertexBounds(n);null!=r&&(s=r.x,o=r.y)}if((r=null)!=(r=this.isHorizontal()?this.horizontalLayout(i,s,o):this.verticalLayout(i,null,s,o))){var l=a=0;r.x<0&&(a=Math.abs(s-r.x)),r.y<0&&(l=Math.abs(o-r.y)),(0!=a||0!=l)&&this.moveNode(i,a,l),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(i)}}}finally{t.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(e,n,t){for(e.x+=n,e.y+=t,this.apply(e),e=e.child;null!=e;)this.moveNode(e,n,t),e=e.next},mxCompactTreeLayout.prototype.dfs=function(e,n,t){t=null!=t?t:[];var a=mxCellPath.create(e),i=null;if(null!=e&&null==t[a]&&!this.isVertexIgnored(e)){t[a]=e;i=this.createNode(e),a=this.graph.getModel();var s=null;e=this.graph.getEdges(e,n,this.invert,!this.invert,!1,!0);for(var o=this.graph.getView(),r=0;r<e.length;r++){var l=e[r];if(!this.isEdgeIgnored(l)){this.resetEdges&&this.setEdgePoints(l,null),this.edgeRouting&&(this.setEdgeStyleEnabled(l,!1),this.setEdgePoints(l,null));var d;l=null!=(d=o.getState(l))?d.getVisibleTerminal(this.invert):o.getVisibleTerminal(l,this.invert);null!=(d=this.dfs(l,n,t))&&null!=a.getGeometry(l)&&(null==s?i.child=d:s.next=d,s=d)}}}return i},mxCompactTreeLayout.prototype.layout=function(e){if(null!=e){for(var n=e.child;null!=n;)this.layout(n),n=n.next;null!=e.child?this.attachParent(e,this.join(e)):this.layoutLeaf(e)}},mxCompactTreeLayout.prototype.horizontalLayout=function(e,n,t,a){if(e.x+=n+e.offsetX,e.y+=t+e.offsetY,a=this.apply(e,a),null!=(n=e.child)){a=this.horizontalLayout(n,e.x,e.y,a),t=e.y+n.offsetY;for(var i=n.next;null!=i;)a=this.horizontalLayout(i,e.x+n.offsetX,t,a),t+=i.offsetY,i=i.next}return a},mxCompactTreeLayout.prototype.verticalLayout=function(e,n,t,a,i){if(e.x+=t+e.offsetY,e.y+=a+e.offsetX,i=this.apply(e,i),null!=(n=e.child))for(i=this.verticalLayout(n,e,e.x,e.y,i),t=e.x+n.offsetY,a=n.next;null!=a;)i=this.verticalLayout(a,e,t,e.y+n.offsetX,i),t+=a.offsetY,a=a.next;return i},mxCompactTreeLayout.prototype.attachParent=function(e,n){var t=this.nodeDistance+this.levelDistance,a=(n-e.width)/2-this.nodeDistance,i=a+e.width+2*this.nodeDistance-n;e.child.offsetX=t+e.height,e.child.offsetY=i,e.contour.upperHead=this.createLine(e.height,0,this.createLine(t,i,e.contour.upperHead)),e.contour.lowerHead=this.createLine(e.height,0,this.createLine(t,a,e.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(e){var n=2*this.nodeDistance;e.contour.upperTail=this.createLine(e.height+n,0),e.contour.upperHead=e.contour.upperTail,e.contour.lowerTail=this.createLine(0,-e.width-n),e.contour.lowerHead=this.createLine(e.height+n,0,e.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(e){var n=2*this.nodeDistance,t=e.child;e.contour=t.contour;var a=t.width+n,i=a;for(t=t.next;null!=t;){var s=this.merge(e.contour,t.contour);t.offsetY=s+a,t.offsetX=0,i+=s+(a=t.width+n),t=t.next}return i},mxCompactTreeLayout.prototype.merge=function(e,n){for(var t=0,a=0,i=0,s=e.lowerHead,o=n.upperHead;null!=o&&null!=s;){var r=this.offset(t,a,o.dx,o.dy,s.dx,s.dy);a=a+r,i=i+r;t+o.dx<=s.dx?(t+=o.dx,a+=o.dy,o=o.next):(t-=s.dx,a-=s.dy,s=s.next)}return null!=o?(t=this.bridge(e.upperTail,0,0,o,t,a),e.upperTail=null!=t.next?n.upperTail:t,e.lowerTail=n.lowerTail):null==(t=this.bridge(n.lowerTail,t,a,s,0,0)).next&&(e.lowerTail=t),e.lowerHead=n.lowerHead,i},mxCompactTreeLayout.prototype.offset=function(e,n,t,a,i,s){var o;return i<=e||e+t<=0?0:0<(o=0<i*a-t*s?e<0?e*a/t-n:0<e?e*s/i-n:-n:i<e+t?s-(n+(i-e)*a/t):e+t<i?(t+e)*s/i-(n+a):s-(n+a))?o:0},mxCompactTreeLayout.prototype.bridge=function(e,n,t,a,i,s){return n=i+a.dx-n,i=i=0,0==a.dx?i=a.dy:(i=n*a.dy,i/=a.dx),n=this.createLine(n,i,a.next),e.next=this.createLine(0,s+a.dy-i-t,n),n},mxCompactTreeLayout.prototype.createNode=function(e){var n={};return n.cell=e,n.x=0,n.y=0,n.width=0,n.height=0,null!=(e=this.getVertexBounds(e))&&(this.isHorizontal()?(n.width=e.height,n.height=e.width):(n.width=e.width,n.height=e.height)),n.offsetX=0,n.offsetY=0,n.contour={},n},mxCompactTreeLayout.prototype.apply=function(e,n){var t=this.graph.getModel(),a=e.cell,i=t.getGeometry(a);return null!=a&&null!=i&&(this.isVertexMovable(a)&&(i=this.setVertexLocation(a,e.x,e.y),this.resizeParent&&(t=t.getParent(a),a=mxCellPath.create(t),null==this.parentsChanged[a]&&(this.parentsChanged[a]=t))),n=null==n?new mxRectangle(i.x,i.y,i.width,i.height):new mxRectangle(Math.min(n.x,i.x),Math.min(n.y,i.y),Math.max(n.x+n.width,i.x+i.width),Math.max(n.y+n.height,i.y+i.height))),n},mxCompactTreeLayout.prototype.createLine=function(e,n,t){var a={};return a.dx=e,a.dy=n,a.next=t,a},mxCompactTreeLayout.prototype.adjustParents=function(){var e,n=[];for(e in this.parentsChanged)n.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(n,!0),this.groupPadding)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(e){for(this.processNodeOutgoing(e),e=e.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(e){for(var n=e.child,t=e.cell,a=0,i=[];null!=n;){a++;var s=n.x;this.horizontal&&(s=n.y),i.push(new WeightedCellSorter(n,s)),n=n.next}i.sort(WeightedCellSorter.prototype.compare),(s=e.width)>(o=(a+1)*this.prefHozEdgeSep)+2*this.prefHozEdgeSep&&(s-=2*this.prefHozEdgeSep),n=(e=s/a)/2,s>o+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep);s=this.minEdgeJetty-this.prefVertEdgeOff;for(var o=0,r=this.getVertexBounds(t),l=0;l<i.length;l++){for(var d=i[l].cell.cell,c=this.getVertexBounds(d),m=(d=this.graph.getEdgesBetween(t,d,!1),[]),u=0,p=0,g=0;g<d.length;g++)this.horizontal?(u=r.x+r.width,p=r.y+n,m.push(new mxPoint(u,p)),u=r.x+r.width+s,m.push(new mxPoint(u,p)),p=c.y+c.height/2):(u=r.x+n,p=r.y+r.height,m.push(new mxPoint(u,p)),p=r.y+r.height+s,m.push(new mxPoint(u,p)),u=c.x+c.width/2),m.push(new mxPoint(u,p)),this.setEdgePoints(d[g],m);l<a/2?s+=this.prefVertEdgeOff:a/2<l&&(s-=this.prefVertEdgeOff),n+=e,o=Math.max(o,s)}},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.weightedValue>e.weightedValue?1:n.weightedValue<e.weightedValue?-1:n.nudge?1:-1:0},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxFastOrganicLayout.prototype.execute=function(e){var n=this.graph.getModel();this.vertexArray=[];for(var t=this.graph.getChildVertices(e),a=0;a<t.length;a++)this.isVertexIgnored(t[a])||this.vertexArray.push(t[a]);var i=this.useInputOrigin?this.graph.view.getBounds(this.vertexArray):null,s=this.vertexArray.length;for(this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant,a=0;a<this.vertexArray.length;a++){var o=this.vertexArray[a];this.cellLocation[a]=[];var r=mxCellPath.create(o);this.indices[r]=a;var l=this.getVertexBounds(o),d=l.width,c=l.height,m=l.x,u=l.y;this.cellLocation[a][0]=m+d/2,this.cellLocation[a][1]=u+c/2,this.radius[a]=Math.min(d,c),this.radiusSquared[a]=this.radius[a]*this.radius[a]}n.beginUpdate();try{for(a=0;a<s;a++){this.dispX[a]=0,this.dispY[a]=0,this.isMoveable[a]=this.isVertexMovable(this.vertexArray[a]);var p=this.graph.getConnections(this.vertexArray[a],e);t=this.graph.getOpposites(p,this.vertexArray[a]);for(this.neighbours[a]=[],d=0;d<t.length;d++){this.resetEdges&&this.graph.resetEdge(p[d]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[d],!1);r=mxCellPath.create(t[d]);var g=this.indices[r];this.neighbours[a][d]=null!=g?g:a}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(s)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(e=t=null,a=0;a<this.vertexArray.length;a++)o=this.vertexArray[a],this.isVertexMovable(o)&&(null!=(l=this.getVertexBounds(o))&&(this.cellLocation[a][0]-=l.width/2,this.cellLocation[a][1]-=l.height/2,m=this.graph.snap(this.cellLocation[a][0]),u=this.graph.snap(this.cellLocation[a][1]),this.setVertexLocation(o,m,u),t=null==t?m:Math.min(t,m),e=null==e?u:Math.min(e,u)));a=1-(t||0),o=1-(e||0),null!=i&&(a+=i.x,o+=i.y),this.graph.moveCells(this.vertexArray,a,o)}finally{n.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var e=0;e<this.vertexArray.length;e++)if(this.isMoveable[e]){(t=Math.sqrt(this.dispX[e]*this.dispX[e]+this.dispY[e]*this.dispY[e]))<.001&&(t=.001);var n=this.dispX[e]/t*Math.min(t,this.temperature),t=this.dispY[e]/t*Math.min(t,this.temperature);this.dispX[e]=0,this.dispY[e]=0,this.cellLocation[e][0]+=n,this.cellLocation[e][1]+=t}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var e=0;e<this.vertexArray.length;e++)for(var n=0;n<this.neighbours[e].length;n++){var t=this.neighbours[e][n];if(e!=t&&this.isMoveable[e]&&this.isMoveable[t]){(a=(s=this.cellLocation[e][0]-this.cellLocation[t][0])*s+(o=this.cellLocation[e][1]-this.cellLocation[t][1])*o-this.radiusSquared[e]-this.radiusSquared[t])<this.minDistanceLimitSquared&&(a=this.minDistanceLimitSquared);var a,i=Math.sqrt(a),s=s/i*(a=a/this.forceConstant),o=o/i*a;this.dispX[e]-=s,this.dispY[e]-=o,this.dispX[t]+=s,this.dispY[t]+=o}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var e=this.vertexArray.length,n=0;n<e;n++)for(var t=n;t<e;t++){if(!this.allowedToRun)return;if(t!=n&&this.isMoveable[n]&&this.isMoveable[t]){var a=this.cellLocation[n][0]-this.cellLocation[t][0],i=this.cellLocation[n][1]-this.cellLocation[t][1];0==a&&(a=.01+Math.random()),0==i&&(i=.01+Math.random());var s=Math.sqrt(a*a+i*i),o=s-this.radius[n]-this.radius[t];o>this.maxDistanceLimit||(o<this.minDistanceLimit&&(o=this.minDistanceLimit),a=a/s*(o=this.forceConstantSquared/o),i=i/s*o,this.dispX[n]+=a,this.dispY[n]+=i,this.dispX[t]-=a,this.dispY[t]-=i)}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0,a=null,i=null,s=[],o=n.getChildCount(e),r=0;r<o;r++){var l=n.getChildAt(e,r);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{s.push(l);var d=this.getVertexBounds(l);a=null==a?d.y:Math.min(a,d.y),i=null==i?d.x:Math.min(i,d.x),t=Math.max(t,Math.max(d.width,d.height))}}var c=this.getRadius(s.length,t);this.moveCircle&&(i=this.x0,a=this.y0),this.circle(s,c,i,a)}finally{n.endUpdate()}},mxCircleLayout.prototype.getRadius=function(e,n){return Math.max(e*n/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(e,n,t,a){for(var i=e.length,s=2*Math.PI/i,o=0;o<i;o++)this.isVertexMovable(e[o])&&this.setVertexLocation(e[o],t+n+n*Math.sin(o*s),a+n+n*Math.cos(o*s))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(e){e=this.findParallels(e),this.graph.model.beginUpdate();try{for(var n in e){var t=e[n];1<t.length&&this.layout(t)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(e){for(var n=this.graph.getModel(),t=[],a=n.getChildCount(e),i=0;i<a;i++){var s=n.getChildAt(e,i);if(!this.isEdgeIgnored(s)){var o=this.getEdgeId(s);null!=o&&(null==t[o]&&(t[o]=[]),t[o].push(s))}}return t},mxParallelEdgeLayout.prototype.getEdgeId=function(e){var n=this.graph.getView(),t=n.getState(e),a=null!=t?t.getVisibleTerminal(!0):n.getVisibleTerminal(e,!0);return e=null!=t?t.getVisibleTerminal(!1):n.getVisibleTerminal(e,!1),null!=a&&null!=e?(a=mxCellPath.create(a),(e=mxCellPath.create(e))<a?e+"-"+a:a+"-"+e):null},mxParallelEdgeLayout.prototype.layout=function(e){var n=e[0];if((o=(t=this.graph.getModel()).getGeometry(t.getTerminal(n,!0)))==(s=t.getGeometry(t.getTerminal(n,!1)))){n=o.x+o.width+this.spacing;for(var t=o.y+o.height/2,a=0;a<e.length;a++)this.route(e[a],n,t),n+=this.spacing}else if(null!=o&&null!=s){n=o.x+o.width/2,t=o.y+o.height/2,a=s.x+s.width/2-n;var i=s.y+s.height/2-t,s=Math.sqrt(a*a+i*i),o=i*this.spacing/s;for(s=a*this.spacing/s,n=n+a/2+o*(e.length-1)/2,t=t+i/2-s*(e.length-1)/2,a=0;a<e.length;a++)this.route(e[a],n,t),n-=o,t+=s}},mxParallelEdgeLayout.prototype.route=function(e,n,t){this.graph.isCellMovable(e)&&this.setEdgePoints(e,[new mxPoint(n,t)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(e,n,t){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0;t<this.layouts.length;t++)this.layouts[t].execute.apply(this.layouts[t],arguments)}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(e){for(var n=this.graph.view,t=this.graph.getModel(),a=[],i=[],s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o),l=n.getState(r);null!=l&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||a.push(l):i.push(l))}this.placeLabels(i,a)},mxEdgeLabelLayout.prototype.placeLabels=function(e,n){var t=this.graph.getModel();t.beginUpdate();try{for(var a=0;a<n.length;a++){var i=n[a];if(null!=i&&null!=i.text&&null!=i.text.boundingBox)for(var s=0;s<e.length;s++){var o=e[s];null!=o&&this.avoid(i,o)}}}finally{t.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(e,n){var t=this.graph.getModel(),a=e.text.boundingBox;if(mxUtils.intersects(a,n)){var i=-a.y-a.height+n.y,s=-a.y+n.y+n.height;i=Math.abs(i)<Math.abs(s)?i:s,s=-a.x-a.width+n.x,a=-a.x+n.x+n.width,a=Math.abs(s)<Math.abs(a)?s:a;Math.abs(a)<Math.abs(i)?i=0:a=0,null!=(s=t.getGeometry(e.cell))&&(null!=(s=s.clone()).offset?(s.offset.x+=a,s.offset.y+=i):s.offset=new mxPoint(a,i),t.setGeometry(e.cell,s))}},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(e){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(e,n){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(e,n){this.isVertex()?this.x[0]=n:this.isEdge()&&(this.x[e-this.minRank-1]=n)},mxGraphAbstractHierarchyCell.prototype.getX=function(e){return this.isVertex()?this.x[0]:this.isEdge()?this.x[e-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(e,n){this.isVertex()?this.y[0]=n:this.isEdge()&&(this.y[e-this.minRank-1]=n)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.connectsAsTarget=[],mxGraphHierarchyNode.prototype.connectsAsSource=[],mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(e){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var n=0;n<this.connectsAsTarget.length;n++){var t=this.connectsAsTarget[n];-1==t.maxRank||t.maxRank==e+1?this.nextLayerConnectedCells[0].push(t.source):this.nextLayerConnectedCells[0].push(t)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var n=0;n<this.connectsAsSource.length;n++){var t=this.connectsAsSource[n];-1==t.minRank||t.minRank==e-1?this.previousLayerConnectedCells[0].push(t.target):this.previousLayerConnectedCells[0].push(t)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(e){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(e,n){this.temp[0]=n},mxGraphHierarchyNode.prototype.isAncestor=function(e){if(null!=e&&null!=this.hashCode&&null!=e.hashCode&&this.hashCode.length<e.hashCode.length){if(this.hashCode==e.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var n=0;n<this.hashCode.length;n++)if(this.hashCode[n]!=e.hashCode[n])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(e){e=this.source,this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var n=0;n<this.temp.length;n++)this.nextLayerConnectedCells[n]=[],n==this.temp.length-1?this.nextLayerConnectedCells[n].push(this.source):this.nextLayerConnectedCells[n].push(this)}return this.nextLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var n=0;n<this.temp.length;n++)this.previousLayerConnectedCells[n]=[],0==n?this.previousLayerConnectedCells[n].push(this.target):this.previousLayerConnectedCells[n].push(this)}return this.previousLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(e){return this.temp[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(e,n){this.temp[e-this.minRank-1]=n},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(e,n,t){for(var a=e.getGraph(),i=0;i<n.length;i++){t[i]=new mxGraphHierarchyNode(n[i]);var s=mxCellPath.create(n[i]);this.vertexMapper[s]=t[i],s=e.getEdges(n[i]),t[i].connectsAsSource=[];for(var o=0;o<s.length;o++){if((d=e.getVisibleTerminal(s[o],!1))!=n[i]&&d!=n[i]&&e.graph.model.isVertex(d)&&!e.isVertexIgnored(d)){var r=e.getEdgesBetween(n[i],d,!1),l=e.getEdgesBetween(n[i],d,!0),d=mxCellPath.create(r[0]);if(null!=r&&0<r.length&&null==this.edgeMapper[d]&&2*l.length>=r.length){l=new mxGraphHierarchyEdge(r);for(var c=0;c<r.length;c++){var m=r[c];d=mxCellPath.create(m);this.edgeMapper[d]=l,a.resetEdge(m),e.disableEdgeStyle&&(e.setEdgeStyleEnabled(m,!1),e.setOrthogonalEdge(m,!0))}l.source=t[i],mxUtils.indexOf(t[i].connectsAsSource,l)<0&&t[i].connectsAsSource.push(l)}}}t[i].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var e=[];if(null!=this.roots)for(var n=0;n<this.roots.length;n++){var t=mxCellPath.create(this.roots[n]);null!=(t=this.vertexMapper[t])&&e.push(t)}for(var a in this.vertexMapper)(t=this.vertexMapper[a]).temp[0]=-1;for(var i=e.slice();0<e.length;){var s,o;s=(t=e[0]).connectsAsTarget,o=t.connectsAsSource;var r=!0,l=this.SOURCESCANSTARTRANK;for(n=0;n<s.length;n++){var d=s[n];if(5270620!=d.temp[0]){r=!1;break}d=d.source,l=Math.min(l,d.temp[0]-1)}if(r){if(t.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=o)for(n=0;n<o.length;n++)(d=o[n]).temp[0]=5270620,-1==(d=d.target).temp[0]&&(e.push(d),d.temp[0]=-2);e.shift()}else if(n=e.shift(),e.push(t),n==t&&1==e.length)break}for(a in this.vertexMapper)(t=this.vertexMapper[a]).temp[0]-=this.maxRank;for(n=0;n<i.length;n++)for(e=0,s=(t=i[n]).connectsAsSource,a=0;a<s.length;a++)d=(d=s[a]).target,t.temp[0]=Math.max(e,d.temp[0]+1),e=t.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var s=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++)s[e]=[],this.ranks[e]=s[e];var n=null;if(null!=this.roots){var t=this.roots;for(n=[],e=0;e<t.length;e++){var a=mxCellPath.create(t[e]);n[e]=this.vertexMapper[a]}}this.visit(function(e,n,t,a,i){if(0==i&&n.maxRank<0&&n.minRank<0&&(s[n.temp[0]].push(n),n.maxRank=n.temp[0],n.minRank=n.temp[0],n.temp[0]=s[n.maxRank].length-1),null!=e&&null!=t&&1<e.maxRank-n.maxRank)for(t.maxRank=e.maxRank,t.minRank=n.maxRank,t.temp=[],t.x=[],t.y=[],e=t.minRank+1;e<t.maxRank;e++)s[e].push(t),t.setGeneralPurposeVariable(e,s[e].length-1)},n,!1,null)},mxGraphHierarchyModel.prototype.visit=function(e,n,t,a){if(null!=n){for(var i=0;i<n.length;i++){var s=n[i];null!=s&&(null==a&&(a={}),t?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=i,this.extendedDfs(null,s,null,e,a,s.hashCode,i,0)):this.dfs(null,s,null,e,a,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(e,n,t,a,i,s){if(null!=n){var o=mxCellPath.create(n.cell);if(null==i[o])for(a(e,i[o]=n,t,s,0),e=n.connectsAsSource.slice(),t=0;t<e.length;t++)o=e[t],this.dfs(n,o.target,o,a,i,s+1);else a(e,n,t,s,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(e,n,t,a,i,s,o,r){if(null!=n)if(null==e||null!=n.hashCode&&n.hashCode[0]==e.hashCode[0]||(s=e.hashCode.length+1,n.hashCode=e.hashCode.slice(),n.hashCode[s-1]=o),null==i[o=mxCellPath.create(n.cell)])for(a(e,i[o]=n,t,r,0),e=n.connectsAsSource.slice(),t=0;t<e.length;t++)o=e[t],this.extendedDfs(n,o.target,o,a,i,n.hashCode,t,r+1);else a(e,n,t,r,1)},mxHierarchicalLayoutStage.prototype.execute=function(e){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(e){e=this.layout.getModel(),this.nestedBestRanks=[];for(var n=0;n<e.ranks.length;n++)this.nestedBestRanks[n]=e.ranks[n].slice();var t=0,a=this.calculateCrossings(e);for(n=0;n<this.maxIterations&&t<this.maxNoImprovementIterations;n++){this.weightedMedian(n,e),this.transpose(n,e);var i=this.calculateCrossings(e);if(i<a)for(a=i,i=t=0;i<this.nestedBestRanks.length;i++)for(var s=e.ranks[i],o=0;o<s.length;o++){var r=s[o];this.nestedBestRanks[i][r.getGeneralPurposeVariable(i)]=r}else for(t++,i=0;i<this.nestedBestRanks.length;i++)for(s=e.ranks[i],o=0;o<s.length;o++)(r=s[o]).setGeneralPurposeVariable(i,o);if(0==a)break}for(t=[],a=[],n=0;n<e.maxRank+1;n++)a[n]=[],t[n]=a[n];for(n=0;n<this.nestedBestRanks.length;n++)for(i=0;i<this.nestedBestRanks[n].length;i++)a[n].push(this.nestedBestRanks[n][i]);e.ranks=t},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(e){for(var n=e.ranks.length,t=0,a=1;a<n;a++)t+=this.calculateRankCrossing(a,e);return t},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(e,n){for(var t=0,a=n.ranks[e],i=a.length,s=n.ranks[e-1].length,o=[],r=0;r<i;r++)o[r]=[];for(r=0;r<a.length;r++)for(var l=(c=a[r]).getGeneralPurposeVariable(e),d=c.getPreviousLayerConnectedCells(e),c=0;c<d.length;c++){var m=d[c].getGeneralPurposeVariable(e-1);o[l][m]=201207}for(r=0;r<i;r++)for(c=0;c<s;c++)if(201207==o[r][c]){for(a=r+1;a<i;a++)for(l=0;l<c;l++)201207==o[a][l]&&t++;for(a=0;a<r;a++)for(l=c+1;l<s;l++)201207==o[a][l]&&t++}return t/2},mxMedianHybridCrossingReduction.prototype.transpose=function(e,n){for(var t=!0,a=0;t&&a++<10;)for(var i=1==e%2&&1==a%2,s=(t=!1,0);s<n.ranks.length;s++){for(var o=n.ranks[s],r=[],l=0;l<o.length;l++){(b=(f=o[l]).getGeneralPurposeVariable(s))<0&&(b=l),r[b]=f}var d=b=f=null,c=null,m=null,u=null,p=null,g=null,v=null,h=null;for(l=0;l<o.length-1;l++){if(0==l){for(var f=(v=r[l]).getNextLayerConnectedCells(s),b=v.getPreviousLayerConnectedCells(s),A=(m=[],u=[],0);A<f.length;A++)m[A]=f[A].getGeneralPurposeVariable(s+1);for(A=0;A<b.length;A++)u[A]=b[A].getGeneralPurposeVariable(s-1)}else f=d,b=c,m=p,u=g,v=h;for(d=(h=r[l+1]).getNextLayerConnectedCells(s),c=h.getPreviousLayerConnectedCells(s),p=[],g=[],A=0;A<d.length;A++)p[A]=d[A].getGeneralPurposeVariable(s+1);for(A=0;A<c.length;A++)g[A]=c[A].getGeneralPurposeVariable(s-1);var E=0,y=0;for(A=0;A<m.length;A++)for(var S=0;S<p.length;S++)m[A]>p[S]&&E++,m[A]<p[S]&&y++;for(A=0;A<u.length;A++)for(S=0;S<g.length;S++)u[A]>g[S]&&E++,u[A]<g[S]&&y++;(y<E||y==E&&i)&&(d=v.getGeneralPurposeVariable(s),v.setGeneralPurposeVariable(s,h.getGeneralPurposeVariable(s)),h.setGeneralPurposeVariable(s,d),d=f,c=b,p=m,g=u,h=v,i||(t=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(e,n){var t=0==e%2;if(t)for(var a=n.maxRank-1;0<=a;a--)this.medianRank(a,t);else for(a=1;a<n.maxRank;a++)this.medianRank(a,t)},mxMedianHybridCrossingReduction.prototype.medianRank=function(e,n){for(var t=this.nestedBestRanks[e].length,a=[],i=[],s=0;s<t;s++){var o,r,l=this.nestedBestRanks[e][s],d=new MedianCellSorter;d.cell=l,r=n?e+1:e-1,null!=(o=n?l.getNextLayerConnectedCells(e):l.getPreviousLayerConnectedCells(e))&&0!=o.length?(d.medianValue=this.medianValue(o,r),a.push(d)):i[l.getGeneralPurposeVariable(e)]=!0}for(a.sort(MedianCellSorter.prototype.compare),s=0;s<t;s++)null==i[s]&&(l=a.shift().cell).setGeneralPurposeVariable(e,s)},mxMedianHybridCrossingReduction.prototype.medianValue=function(e,n){for(var t=[],a=0,i=0;i<e.length;i++){var s=e[i];t[a++]=s.getGeneralPurposeVariable(n)}return t.sort(function(e,n){return e-n}),1==a%2?t[Math.floor(a/2)]:2==a?(t[0]+t[1])/2:(s=t[(i=a/2)-1]-t[0],a=t[a-1]-t[i],(t[i-1]*a+t[i]*s)/(s+a))},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.medianValue>e.medianValue?-1:n.medianValue<e.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(e){var n=this.layout.getModel(),s={},o=mxUtils.clone(n.vertexMapper,null,!0),t=null;if(null!=n.roots){var a=n.roots;t=[];for(e=0;e<a.length;e++){var i=mxCellPath.create(a[e]);t[e]=n.vertexMapper[i]}}if(n.visit(function(e,n,t,a,i){n.isAncestor(e)&&(t.invert(),mxUtils.remove(t,e.connectsAsSource),e.connectsAsTarget.push(t),mxUtils.remove(t,n.connectsAsTarget),n.connectsAsSource.push(t)),e=mxCellPath.create(n.cell),s[e]=n,delete o[e]},t,!0,null),t=null,0<o.lenth&&(t=mxUtils.clone(o,null,!0)),e=mxUtils.clone(s,null,!0),n.visit(function(e,n,t,a,i){n.isAncestor(e)&&(t.invert(),mxUtils.remove(t,e.connectsAsSource),n.connectsAsSource.push(t),e.connectsAsTarget.push(t),mxUtils.remove(t,n.connectsAsTarget)),e=mxCellPath.create(n.cell),s[e]=n,delete o[e]},o,!0,e),a=this.layout.getGraph(),null!=t&&0<t.length)for(n=n.roots,e=0;e<t.length;e++)i=t[e].cell,0==a.getIncomingEdges(i).length&&n.push(i)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function WeightedCellSorter(e,n){this.cell=e,this.weightedValue=n}function mxHierarchicalLayout(e,n,t){mxGraphLayout.call(this,e),this.orientation=null!=n?n:mxConstants.DIRECTION_NORTH,this.deterministic=null==t||t}function mxGraphModel(e){this.currentEdit=this.createUndoableEdit(),null!=e?this.setRoot(e):this.clear()}function mxRootChange(e,n){this.model=e,this.previous=this.root=n}function mxChildChange(e,n,t,a){this.model=e,this.previous=this.parent=n,this.child=t,this.previousIndex=this.index=a}function mxTerminalChange(e,n,t,a){this.model=e,this.cell=n,this.previous=this.terminal=t,this.source=a}function mxValueChange(e,n,t){this.model=e,this.cell=n,this.previous=this.value=t}function mxStyleChange(e,n,t){this.model=e,this.cell=n,this.previous=this.style=t}function mxGeometryChange(e,n,t){this.model=e,this.cell=n,this.previous=this.geometry=t}function mxCollapseChange(e,n,t){this.model=e,this.cell=n,this.previous=this.collapsed=t}function mxVisibleChange(e,n,t){this.model=e,this.cell=n,this.previous=this.visible=t}function mxCellAttributeChange(e,n,t){this.cell=e,this.attribute=n,this.previous=this.value=t}function mxCell(e,n,t){this.value=e,this.setGeometry(n),this.setStyle(t),null!=this.onInit&&this.onInit()}function mxGeometry(e,n,t,a){mxRectangle.call(this,e,n,t,a)}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var e=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var n=0;n<e.ranks.length;n++){mxLog.write("Rank ",n," : ");for(var t=e.ranks[n],a=0;a<t.length;a++)mxLog.write(t[a].getGeneralPurposeVariable(n),"  ");mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(e){this.jettyPositions=[],e=this.layout.getModel(),this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var n=1e8;if(this.fineTuning)for(var t=0;t<this.maxIterations;t++){if(0!=t&&(this.medianPos(t,e),this.minNode(e)),this.currentXDelta<n){for(var a=0;a<e.ranks.length;a++)for(var i=e.ranks[a],s=0;s<i.length;s++){var o=i[s];o.setX(a,o.getGeneralPurposeVariable(a))}n=this.currentXDelta}else for(a=0;a<e.ranks.length;a++)for(i=e.ranks[a],s=0;s<i.length;s++)(o=i[s]).setGeneralPurposeVariable(a,o.getX(a));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(e){for(var n=[],t=[],a=[],i=0;i<=e.maxRank;i++){a[i]=e.ranks[i];for(var s=0;s<a[i].length;s++){var o=a[i][s];(r=new WeightedCellSorter(o,i)).rankIndex=s,r.visited=!0,n.push(r),t[o=mxCellPath.create(o.getCoreCell())]=r}}for(e=10*n.length,s=0;0<n.length&&s<=e;){i=(r=n.shift()).cell;var r,l=r.weightedValue,d=parseInt(r.rankIndex),c=(o=i.getNextLayerConnectedCells(l),i.getPreviousLayerConnectedCells(l)),m=o.length,u=c.length,p=this.medianXValue(o,l+1),g=this.medianXValue(c,l-1),v=m+u,h=i.getGeneralPurposeVariable(l),f=h;if(0<v&&(f=(p*m+g*u)/v),m=!1,f<h-1?0==d?(i.setGeneralPurposeVariable(l,f),m=!0):(h=(h=(d=a[l][d-1]).getGeneralPurposeVariable(l))+d.width/2+this.intraCellSpacing+i.width/2)<f?(i.setGeneralPurposeVariable(l,f),m=!0):h<i.getGeneralPurposeVariable(l)-1&&(i.setGeneralPurposeVariable(l,h),m=!0):h+1<f&&(d==a[l].length-1?(i.setGeneralPurposeVariable(l,f),m=!0):f<(h=(h=(d=a[l][d+1]).getGeneralPurposeVariable(l))-d.width/2-this.intraCellSpacing-i.width/2)?(i.setGeneralPurposeVariable(l,f),m=!0):h>i.getGeneralPurposeVariable(l)+1&&(i.setGeneralPurposeVariable(l,h),m=!0)),m){for(i=0;i<o.length;i++)l=o[i],null!=(l=t[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,n.push(l));for(i=0;i<c.length;i++)l=c[i],null!=(l=t[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,n.push(l))}r.visited=!1,s++}},mxCoordinateAssignment.prototype.medianPos=function(e,n){if(0==e%2)for(var t=n.maxRank;0<t;t--)this.rankMedianPosition(t-1,n,t);else for(t=0;t<n.maxRank-1;t++)this.rankMedianPosition(t+1,n,t)},mxCoordinateAssignment.prototype.rankMedianPosition=function(e,n,t){n=n.ranks[e];for(var a=[],i=[],s=0;s<n.length;s++){var o=n[s];a[s]=new WeightedCellSorter,a[s].cell=o,a[s].rankIndex=s;var r=mxCellPath.create(o.getCoreCell());i[r]=a[s];var l=null;l=t<e?o.getPreviousLayerConnectedCells(e):o.getNextLayerConnectedCells(e);a[s].weightedValue=this.calculatedWeightedValue(o,l)}for(a.sort(WeightedCellSorter.prototype.compare),s=0;s<a.length;s++){r=0,o=a[s].cell,r=0,null!=(l=t<e?o.getPreviousLayerConnectedCells(e).slice():o.getNextLayerConnectedCells(e).slice())&&(r=0<(r=l.length)?this.medianXValue(l,t):o.getGeneralPurposeVariable(e));for(var d=0,c=(l=-1e8,a[s].rankIndex-1);0<=c;){var m;if(null!=(m=i[m=mxCellPath.create(n[c].getCoreCell())])){var u=m.cell;m.visited?(l=u.getGeneralPurposeVariable(e)+u.width/2+this.intraCellSpacing+d+o.width/2,c=-1):(d+=u.width+this.intraCellSpacing,c--)}}for(d=0,u=1e8,c=a[s].rankIndex+1;c<a.length;)if(null!=(m=i[m=mxCellPath.create(n[c].getCoreCell())])){var p=m.cell;m.visited?(u=p.getGeneralPurposeVariable(e)-p.width/2-this.intraCellSpacing-d-o.width/2,c=a.length):(d+=p.width+this.intraCellSpacing,c++)}l<=r&&r<=u?o.setGeneralPurposeVariable(e,r):r<l?(o.setGeneralPurposeVariable(e,l),this.currentXDelta+=l-r):u<r&&(o.setGeneralPurposeVariable(e,u),this.currentXDelta+=r-u),a[s].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(e,n){for(var t=0,a=0;a<n.length;a++){var i=n[a];e.isVertex()&&i.isVertex()?t++:t=e.isEdge()&&i.isEdge()?t+8:t+2}return t},mxCoordinateAssignment.prototype.medianXValue=function(e,n){if(0==e.length)return 0;for(var t=[],a=0;a<e.length;a++)t[a]=e[a].getGeneralPurposeVariable(n);return t.sort(function(e,n){return e-n}),1==e.length%2?t[Math.floor(e.length/2)]:(t[(a=e.length/2)-1]+t[a])/2},mxCoordinateAssignment.prototype.initialCoords=function(e,n){this.calculateWidestRank(e,n);for(var t=this.widestRank;0<=t;t--)t<n.maxRank&&this.rankCoordinates(t,e,n);for(t=this.widestRank+1;t<=n.maxRank;t++)0<t&&this.rankCoordinates(t,e,n)},mxCoordinateAssignment.prototype.rankCoordinates=function(e,n,t){n=t.ranks[e],t=0;for(var a=this.initialX+(this.widestRankValue-this.rankWidths[e])/2,i=!1,s=0;s<n.length;s++){var o=n[s];if(o.isVertex()){var r=this.layout.getVertexBounds(o.cell);null!=r?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(o.width=r.width,o.height=r.height):(o.width=r.height,o.height=r.width):i=!0,t=Math.max(t,o.height)}else o.isEdge()&&(r=1,null!=o.edges?r=o.edges.length:mxLog.warn("edge.edges is null"),o.width=(r-1)*this.parallelEdgeSpacing);a+=o.width/2,o.setX(e,a),o.setGeneralPurposeVariable(e,a),a+=o.width/2,a+=this.intraCellSpacing}1==i&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(e,n){var t=-this.interRankCellSpacing,a=0;this.rankWidths=[],this.rankY=[];for(var i=n.maxRank;0<=i;i--){for(var s=0,o=n.ranks[i],r=this.initialX,l=!1,d=0;d<o.length;d++){var c=o[d];if(c.isVertex()){var m=this.layout.getVertexBounds(c.cell);null!=m?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(c.width=m.width,c.height=m.height):(c.width=m.height,c.height=m.width):l=!0,s=Math.max(s,c.height)}else c.isEdge()&&(m=1,null!=c.edges?m=c.edges.length:mxLog.warn("edge.edges is null"),c.width=(m-1)*this.parallelEdgeSpacing);r+=c.width/2,c.setX(i,r),c.setGeneralPurposeVariable(i,r),r+=c.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=i),this.rankWidths[i]=r}for(1==l&&mxLog.warn("At least one cell has no bounds"),this.rankY[i]=t,r=s/2+a/2+this.interRankCellSpacing,a=s,t=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?t+r:t-r,d=0;d<o.length;d++)o[d].setY(i,t)}},mxCoordinateAssignment.prototype.minPath=function(e,n){var t,a=n.edgeMapper;for(t in a){var i=a[t];if(!(i.maxRank-i.minRank-1<1)){for(var s=i.getGeneralPurposeVariable(i.minRank+1),o=!0,r=0,l=i.minRank+2;l<i.maxRank;l++){s!=(d=i.getGeneralPurposeVariable(l))?(o=!1,s=d):r++}if(!o){o=s=0;var d=[],c=[],m=i.getGeneralPurposeVariable(i.minRank+1);for(l=i.minRank+1;l<i.maxRank-1;l++){var u=i.getX(l+1);m==u?(d[l-i.minRank-1]=m,s++):this.repositionValid(n,i,l+1,m)?(d[l-i.minRank-1]=m,s++):m=d[l-i.minRank-1]=u}for(m=i.getX(l),l=i.maxRank-1;l>i.minRank+1;l--)m==(u=i.getX(l-1))?(c[l-i.minRank-2]=m,o++):this.repositionValid(n,i,l-1,m)?(c[l-i.minRank-2]=m,o++):(c[l-i.minRank-2]=i.getX(l-1),m=u);if(r<o||r<s)if(s<=o)for(l=i.maxRank-2;l>i.minRank;l--)i.setX(l,c[l-i.minRank-1]);else if(o<s)for(l=i.minRank+2;l<i.maxRank;l++)i.setX(l,d[l-i.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(e,n,t,a){e=e.ranks[t];for(var i=-1,s=0;s<e.length;s++)if(n==e[s]){i=s;break}if(i<0)return!1;if(a<(s=n.getGeneralPurposeVariable(t))){if(0==i)return!0;if(!((t=(t=(e=e[i-1]).getGeneralPurposeVariable(t))+e.width/2+this.intraCellSpacing+n.width/2)<=a))return!1}else if(s<a){if(i==e.length-1)return!0;if(!(a<=(t=(t=(e=e[i+1]).getGeneralPurposeVariable(t))-e.width/2-this.intraCellSpacing-n.width/2)))return!1}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(e,n){this.rankTopY=[],this.rankBottomY=[];for(var t=0;t<n.ranks.length;t++)this.rankTopY[t]=Number.MAX_VALUE,this.rankBottomY[t]=0;t=null,this.layout.resizeParent&&(t={});var a,i=n.edgeMapper,s=n.vertexMapper;for(a in s){var o=s[a];if(this.setVertexLocation(o),this.layout.resizeParent){o=e.model.getParent(o.cell);var r=mxCellPath.create(o);null==t[r]&&(t[r]=o)}}for(a in this.layout.resizeParent&&null!=t&&this.adjustParents(t),(this.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(n),i)this.setEdgePosition(i[a])},mxCoordinateAssignment.prototype.adjustParents=function(e){var n,t=[];for(n in e)t.push(e[n]);this.layout.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding)},mxCoordinateAssignment.prototype.localEdgeProcessing=function(e){for(var n=0;n<e.ranks.length;n++)for(var t=e.ranks[n],a=0;a<t.length;a++){var i=t[a];if(i.isVertex())for(var s=i.getPreviousLayerConnectedCells(n),o=n-1,r=0;r<2;r++){if(-1<o&&o<e.ranks.length&&null!=s&&0<s.length){for(var l=[],d=0;d<s.length;d++){var c=new WeightedCellSorter(s[d],s[d].getX(o));l.push(c)}l.sort(WeightedCellSorter.prototype.compare);var m=(c=i.x[0]-i.width/2)+i.width,u=s=0;for(o=[],d=0;d<l.length;d++){var p,g=l[d].cell;if(g.isVertex()){p=0==r?i.connectsAsSource:i.connectsAsTarget;for(var v=0;v<p.length;v++)p[v].source!=g&&p[v].target!=g||(s+=p[v].edges.length,u++,o.push(p[v]))}else s+=g.edges.length,u++,o.push(g)}for(i.width>(s+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep,m-=this.prefHozEdgeSep),c+=(l=(m-c)/s)/2,m=this.minEdgeJetty-this.prefVertEdgeOff,d=u=0;d<o.length;d++){for(g=o[d].edges.length,v=mxCellPath.create(o[d].edges[0]),null==(p=this.jettyPositions[v])&&(p=[],this.jettyPositions[v]=p),d<s/2?m+=this.prefVertEdgeOff:s/2<d&&(m-=this.prefVertEdgeOff),v=0;v<g;v++)p[4*v+2*r]=c,c+=l,p[4*v+2*r+1]=m;u=Math.max(u,m)}}s=i.getNextLayerConnectedCells(n),o=n+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(e){var n=0;if(101207!=e.temp[0]){var t=e.maxRank,a=e.minRank;t==a&&(t=e.source.maxRank,a=e.target.minRank);for(var i=0,s=mxCellPath.create(e.edges[0]),o=(s=this.jettyPositions[s],e.isReversed?e.target.cell:e.source.cell),r=this.layout.graph,l=0;l<e.edges.length;l++){var d=e.edges[l],c=this.layout.getVisibleTerminal(d,!0),m=r.model.getTerminal(d,!0),u=[],p=e.isReversed;if(c!=o&&(p=!p),null!=s){var g=p?2:0,v=p?this.rankTopY[a]:this.rankBottomY[t],h=s[4*i+1+g];p&&(h=-h),v+=h,g=s[4*i+g],m=r.model.getTerminal(d,!0),this.layout.isPort(m)&&r.model.getParent(m)==c&&(g=null!=(g=r.view.getState(m))?g.x:c.geometry.x+e.source.width*m.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(g,v)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v+h))):(u.push(new mxPoint(v,g)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v+h,g)))}for(g=e.x.length-1,v=h=-1,c=e.maxRank-1,p&&(g=0,h=e.x.length,v=1,c=e.minRank+1);e.maxRank!=e.minRank&&g!=h;g+=v){m=e.x[g]+n;var f=(this.rankTopY[c]+this.rankBottomY[c+1])/2,b=(this.rankTopY[c-1]+this.rankBottomY[c])/2;if(p){var A=f;f=b,b=A}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(m,f)),u.push(new mxPoint(m,b))):(u.push(new mxPoint(f,m)),u.push(new mxPoint(b,m))),this.limitX=Math.max(this.limitX,m),c+=v}null!=s&&(g=p?2:0,v=p?this.rankBottomY[t]:this.rankTopY[a],h=s[4*i+3-g],p&&(h=-h),v-=h,g=s[4*i+2-g],p=r.model.getTerminal(d,!1),c=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(p)&&r.model.getParent(p)==c&&(g=null!=(g=r.view.getState(p))?g.x:c.geometry.x+e.target.width*p.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v-h)),u.push(new mxPoint(g,v))):(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v-h,g)),u.push(new mxPoint(v,g)))),e.isReversed&&this.processReversedEdge(e,d),this.layout.setEdgePoints(d,u),n=0==n?this.parallelEdgeSpacing:0<n?-n:-n+this.parallelEdgeSpacing,i++}e.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(e){var n=e.cell,t=e.x[0]-e.width/2,a=e.y[0]-e.height/2;this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],a),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],a+e.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(n,t,a):this.layout.setVertexLocation(n,a,t),this.limitX=Math.max(this.limitX,t+e.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(e,n){},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.weightedValue>e.weightedValue?-1:n.weightedValue<e.weightedValue?1:n.nudge?-1:1:0},mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(e,n){this.parent=e;var t=this.graph.model;if(this.edgesCache={},null!=n||null!=e){if(null!=n&&null!=e){for(var a=[],i=0;i<n.length;i++)t.isAncestor(e,n[i])&&a.push(n[i]);this.roots=a}else this.roots=n;t.beginUpdate();try{this.run(e),this.resizeParent&&!this.graph.isCellCollapsed(e)&&this.graph.updateGroupBounds([e],this.parentBorder,this.moveParent)}finally{t.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(e,n){var t=[];if(null!=e&&null!=n){var a,i=this.graph.model,s=null,o=-1e5;for(a in n){var r=n[a];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var l=this.getEdges(r),d=0,c=0,m=0;m<l.length;m++)this.getVisibleTerminal(l[m],!0)==r?d++:c++;0==c&&0<d&&t.push(r),o<(l=d-c)&&(o=l,s=r)}}0==t.length&&null!=s&&t.push(s)}return t},mxHierarchicalLayout.prototype.getEdges=function(e){var n=mxCellPath.create(e);if(null!=this.edgesCache[n])return this.edgesCache[n];for(var t=this.graph.model,a=[],i=this.graph.isCellCollapsed(e),s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o);this.isPort(r)?a=a.concat(t.getEdges(r,!0,!0)):!i&&this.graph.isCellVisible(r)||(a=a.concat(t.getEdges(r,!0,!0)))}for(a=a.concat(t.getEdges(e,!0,!0)),t=[],o=0;o<a.length;o++)((i=this.getVisibleTerminal(a[o],!0))==(s=this.getVisibleTerminal(a[o],!1))||i!=s&&(s==e&&(null==this.parent||this.graph.isValidAncestor(i,this.parent,this.traverseAncestors))||i==e&&(null==this.parent||this.graph.isValidAncestor(s,this.parent,this.traverseAncestors))))&&t.push(a[o]);return this.edgesCache[n]=t},mxHierarchicalLayout.prototype.getVisibleTerminal=function(e,n){var t=null!=(t=this.graph.view.getState(e))?t.getVisibleTerminal(n):this.graph.view.getVisibleTerminal(e,n);return this.isPort(t)&&(t=this.graph.model.getParent(t)),t},mxHierarchicalLayout.prototype.run=function(e){var n=[],t=[];if(null==this.roots&&null!=e){var a={};this.filterDescendants(e,a),this.roots=[];var i,s=!0;for(i in a)if(null!=a[i]){s=!1;break}for(;!s;){var o=this.findRoots(e,a);for(s=0;s<o.length;s++){var r=[];n.push(r),this.traverse(o[s],!0,null,t,r,n,a)}for(s=0;s<o.length;s++)this.roots.push(o[s]);for(i in s=!0,a)if(null!=a[i]){s=!1;break}}}else for(s=0;s<roots.length;s++)r=[],n.push(r),traverse(roots.get(s),!0,null,t,r,n,null);for(s=t=0;s<n.length;s++){for(i in a=[],r=n[s])a.push(r[i]);this.model=new mxGraphHierarchyModel(this,a,this.roots,e,this.tightenToSource),this.cycleStage(e),this.layeringStage(),this.crossingStage(e),t=this.placementStage(t,e)}},mxHierarchicalLayout.prototype.filterDescendants=function(e,n){var t=this.graph.model;if(t.isVertex(e)&&e!=this.parent&&this.graph.isCellVisible(e)&&(n[mxCellPath.create(e)]=e),this.traverseAncestors||e==this.parent&&this.graph.isCellVisible(e))for(var a=t.getChildCount(e),i=0;i<a;i++){var s=t.getChildAt(e,i);this.isPort(s)||this.filterDescendants(s,n)}},mxHierarchicalLayout.prototype.isPort=function(e){return!!e.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=this.getVisibleTerminal(a[s],!0),r=this.getVisibleTerminal(a[s],!1);(o==e&&r==n||!t&&o==n&&r==e)&&i.push(a[s])}return i},mxHierarchicalLayout.prototype.traverse=function(e,n,t,a,i,s,o){if(null!=e&&null!=a){var r=mxCellPath.create(e);if(null!=a[r]||null!=o&&null==o[r]){if(null==i[r])for(t=0;t<s.length;t++)if(null!=(e=s[t])[r]){for(l in i)e[l]=i[l];return s.pop(),e}}else{null==i[r]&&(i[r]=e),null==a[r]&&(a[r]=e),delete o[r];var l=this.getEdges(e);for(t=0;t<l.length;t++)r=this.getVisibleTerminal(l[t],!0)==e,(!n||r)&&(r=this.getVisibleTerminal(l[t],!r),i=this.traverse(r,n,l[t],a,i,s,o))}}return i},mxHierarchicalLayout.prototype.cycleStage=function(e){new mxMinimumCycleRemover(this).execute(e)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(e){new mxMedianHybridCrossingReduction(this).execute(e)},mxHierarchicalLayout.prototype.placementStage=function(e,n){var t=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,e,this.parallelEdgeSpacing);return t.fineTuning=this.fineTuning,t.execute(n),t.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(e){this.createIds=e},mxGraphModel.prototype.createRoot=function(){var e=new mxCell;return e.insert(new mxCell),e},mxGraphModel.prototype.getCell=function(e){return null!=this.cells?this.cells[e]:null},mxGraphModel.prototype.filterCells=function(e,n){var t=null;if(null!=e){t=[];for(var a=0;a<e.length;a++)n(e[a])&&t.push(e[a])}return t},mxGraphModel.prototype.getDescendants=function(e){return this.filterDescendants(null,e)},mxGraphModel.prototype.filterDescendants=function(e,n){var t=[];n=n||this.getRoot(),(null==e||e(n))&&t.push(n);for(var a=this.getChildCount(n),i=0;i<a;i++){var s=this.getChildAt(n,i);t=t.concat(this.filterDescendants(e,s))}return t},mxGraphModel.prototype.getRoot=function(e){var n=e||this.root;if(null!=e)for(;null!=e;)n=e,e=this.getParent(e);return n},mxGraphModel.prototype.setRoot=function(e){return this.execute(new mxRootChange(this,e)),e},mxGraphModel.prototype.rootChanged=function(e){var n=this.root;return this.root=e,this.nextId=0,this.cells=null,this.cellAdded(e),n},mxGraphModel.prototype.isRoot=function(e){return null!=e&&this.root==e},mxGraphModel.prototype.isLayer=function(e){return this.isRoot(this.getParent(e))},mxGraphModel.prototype.isAncestor=function(e,n){for(;null!=n&&n!=e;)n=this.getParent(n);return n==e},mxGraphModel.prototype.contains=function(e){return this.isAncestor(this.root,e)},mxGraphModel.prototype.getParent=function(e){return null!=e?e.getParent():null},mxGraphModel.prototype.add=function(e,n,t){if(n!=e&&null!=e&&null!=n){null==t&&(t=this.getChildCount(e));var a=e!=this.getParent(n);this.execute(new mxChildChange(this,e,n,t)),this.maintainEdgeParent&&a&&this.updateEdgeParents(n)}return n},mxGraphModel.prototype.cellAdded=function(e){if(null!=e){if(null==e.getId()&&this.createIds&&e.setId(this.createId(e)),null!=e.getId())if((n=this.getCell(e.getId()))!=e){for(;null!=n;)e.setId(this.createId(e)),n=this.getCell(e.getId());null==this.cells&&(this.cells={}),this.cells[e.getId()]=e}mxUtils.isNumeric(e.getId())&&(this.nextId=Math.max(this.nextId,e.getId()));for(var n=this.getChildCount(e),t=0;t<n;t++)this.cellAdded(this.getChildAt(e,t))}},mxGraphModel.prototype.createId=function(e){return e=this.nextId,this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(e,n){n=n||this.getRoot(e);for(var t=this.getChildCount(e),a=0;a<t;a++){var i=this.getChildAt(e,a);this.updateEdgeParents(i,n)}for(i=this.getEdgeCount(e),t=[],a=0;a<i;a++)t.push(this.getEdgeAt(e,a));for(a=0;a<t.length;a++)i=t[a],this.isAncestor(n,i)&&this.updateEdgeParent(i,n)},mxGraphModel.prototype.updateEdgeParent=function(e,n){for(var t=this.getTerminal(e,!0),a=this.getTerminal(e,!1),i=null;null!=t&&!this.isEdge(t)&&null!=t.geometry&&t.geometry.relative;)t=this.getParent(t);for(;null!=a&&!this.isEdge(a)&&null!=a.geometry&&a.geometry.relative;)a=this.getParent(a);if(this.isAncestor(n,t)&&this.isAncestor(n,a)&&(null!=(i=t==a?this.getParent(t):this.getNearestCommonAncestor(t,a))&&(this.getParent(i)!=this.root||this.isAncestor(i,e))&&this.getParent(e)!=i)){if(null!=(t=this.getGeometry(e))){var s=this.getOrigin(this.getParent(e)),o=this.getOrigin(i);a=o.x-s.x,s=o.y-s.y;(t=t.clone()).translate(-a,-s),this.setGeometry(e,t)}this.add(i,e,this.getChildCount(i))}},mxGraphModel.prototype.getOrigin=function(e){var n=null;return null!=e?(n=this.getOrigin(this.getParent(e)),this.isEdge(e)||null!=(e=this.getGeometry(e))&&(n.x+=e.x,n.y+=e.y)):n=new mxPoint,n},mxGraphModel.prototype.getNearestCommonAncestor=function(e,n){if(null!=e&&null!=n&&(null!=(s=mxCellPath.create(n))&&0<s.length)){var t=e,a=mxCellPath.create(t);if(s.length<a.length){t=n;var i=a,s=(a=s,i)}for(;null!=t;){if(i=this.getParent(t),0==s.indexOf(a+mxCellPath.PATH_SEPARATOR)&&null!=i)return t;a=mxCellPath.getParentPath(a),t=i}}return null},mxGraphModel.prototype.remove=function(e){return e==this.root?this.setRoot(null):null!=this.getParent(e)&&this.execute(new mxChildChange(this,null,e)),e},mxGraphModel.prototype.cellRemoved=function(e){if(null!=e&&null!=this.cells){for(var n=this.getChildCount(e)-1;0<=n;n--)this.cellRemoved(this.getChildAt(e,n));null!=this.cells&&null!=e.getId()&&delete this.cells[e.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(e,n,t){var a=this.getParent(e);return null!=n?(n!=a||a.getIndex(e)!=t)&&n.insert(e,t):null!=a&&(t=a.getIndex(e),a.remove(t)),this.contains(a)||null==n?null==n&&this.cellRemoved(e):this.cellAdded(e),a},mxGraphModel.prototype.getChildCount=function(e){return null!=e?e.getChildCount():0},mxGraphModel.prototype.getChildAt=function(e,n){return null!=e?e.getChildAt(n):null},mxGraphModel.prototype.getChildren=function(e){return null!=e?e.children:null},mxGraphModel.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraphModel.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraphModel.prototype.getChildCells=function(e,n,t){n=null!=n&&n,t=null!=t&&t;for(var a=this.getChildCount(e),i=[],s=0;s<a;s++){var o=this.getChildAt(e,s);(!t&&!n||t&&this.isEdge(o)||n&&this.isVertex(o))&&i.push(o)}return i},mxGraphModel.prototype.getTerminal=function(e,n){return null!=e?e.getTerminal(n):null},mxGraphModel.prototype.setTerminal=function(e,n,t){var a=n!=this.getTerminal(e,t);return this.execute(new mxTerminalChange(this,e,n,t)),this.maintainEdgeParent&&a&&this.updateEdgeParent(e,this.getRoot()),n},mxGraphModel.prototype.setTerminals=function(e,n,t){this.beginUpdate();try{this.setTerminal(e,n,!0),this.setTerminal(e,t,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(e,n,t){var a=this.getTerminal(e,t);return null!=n?n.insertEdge(e,t):null!=a&&a.removeEdge(e,t),a},mxGraphModel.prototype.getEdgeCount=function(e){return null!=e?e.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(e,n){return null!=e?e.getEdgeAt(n):null},mxGraphModel.prototype.getDirectedEdgeCount=function(e,n,t){for(var a=0,i=this.getEdgeCount(e),s=0;s<i;s++){var o=this.getEdgeAt(e,s);o!=t&&this.getTerminal(o,n)==e&&a++}return a},mxGraphModel.prototype.getConnections=function(e){return this.getEdges(e,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(e){return this.getEdges(e,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(e){return this.getEdges(e,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(e,n,t,a){n=null==n||n,t=null==t||t,a=null==a||a;for(var i=this.getEdgeCount(e),s=[],o=0;o<i;o++){var r=this.getEdgeAt(e,o),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(a&&l==d||l!=d&&(n&&d==e||t&&l==e))&&s.push(r)}return s},mxGraphModel.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;var a=this.getEdgeCount(e),i=this.getEdgeCount(n),s=e,o=a;for(i<a&&(o=i,s=n),a=[],i=0;i<o;i++){var r=this.getEdgeAt(s,i),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(l==e&&d==n||!t&&(d==e&&l==n))&&a.push(r)}return a},mxGraphModel.prototype.getOpposites=function(e,n,t,a){t=null==t||t,a=null==a||a;var i=[];if(null!=e)for(var s=0;s<e.length;s++){var o=this.getTerminal(e[s],!0),r=this.getTerminal(e[s],!1);o==n&&null!=r&&r!=n&&a?i.push(r):r==n&&null!=o&&o!=n&&t&&i.push(o)}return i},mxGraphModel.prototype.getTopmostCells=function(e){for(var n=[],t=0;t<e.length;t++){for(var a=e[t],i=!0,s=this.getParent(a);null!=s;){if(0<=mxUtils.indexOf(e,s)){i=!1;break}s=this.getParent(s)}i&&n.push(a)}return n},mxGraphModel.prototype.isVertex=function(e){return null!=e&&e.isVertex()},mxGraphModel.prototype.isEdge=function(e){return null!=e&&e.isEdge()},mxGraphModel.prototype.isConnectable=function(e){return null!=e&&e.isConnectable()},mxGraphModel.prototype.getValue=function(e){return null!=e?e.getValue():null},mxGraphModel.prototype.setValue=function(e,n){return this.execute(new mxValueChange(this,e,n)),n},mxGraphModel.prototype.valueForCellChanged=function(e,n){return e.valueChanged(n)},mxGraphModel.prototype.getGeometry=function(e,n){return null!=e?e.getGeometry():null},mxGraphModel.prototype.setGeometry=function(e,n){return n!=this.getGeometry(e)&&this.execute(new mxGeometryChange(this,e,n)),n},mxGraphModel.prototype.geometryForCellChanged=function(e,n){var t=this.getGeometry(e);return e.setGeometry(n),t},mxGraphModel.prototype.getStyle=function(e){return null!=e?e.getStyle():null},mxGraphModel.prototype.setStyle=function(e,n){return n!=this.getStyle(e)&&this.execute(new mxStyleChange(this,e,n)),n},mxGraphModel.prototype.styleForCellChanged=function(e,n){var t=this.getStyle(e);return e.setStyle(n),t},mxGraphModel.prototype.isCollapsed=function(e){return null!=e&&e.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(e,n){return n!=this.isCollapsed(e)&&this.execute(new mxCollapseChange(this,e,n)),n},mxGraphModel.prototype.collapsedStateForCellChanged=function(e,n){var t=this.isCollapsed(e);return e.setCollapsed(n),t},mxGraphModel.prototype.isVisible=function(e){return null!=e&&e.isVisible()},mxGraphModel.prototype.setVisible=function(e,n){return n!=this.isVisible(e)&&this.execute(new mxVisibleChange(this,e,n)),n},mxGraphModel.prototype.visibleStateForCellChanged=function(e,n){var t=this.isVisible(e);return e.setVisible(n),t},mxGraphModel.prototype.execute=function(e){e.execute(),this.beginUpdate(),this.currentEdit.add(e),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",e)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var e=this.currentEdit;this.currentEdit=this.createUndoableEdit(),e.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(){var e=new mxUndoableEdit(this,!0);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(e,n,t){t=null==t||t,this.beginUpdate();try{var a={};for(var i in this.mergeChildrenImpl(e,n,t,a),a){var s=a[i],o=this.getTerminal(s,!0);null!=o&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!0)),null!=(o=this.getTerminal(s,!1))&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(e,n,t,a){this.beginUpdate();try{for(var i=e.getChildCount(),s=0;s<i;s++){var o=e.getChildAt(s);if("function"==typeof o.getId){var r=o.getId(),l=null==r||this.isEdge(o)&&t?null:this.getCell(r);if(null==l){var d=o.clone();d.setId(r),d.setTerminal(o.getTerminal(!0),!0),d.setTerminal(o.getTerminal(!1),!1),l=n.insert(d),this.cellAdded(l)}a[mxCellPath.create(o)]=l,this.mergeChildrenImpl(o,l,t,a)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(e){var n=[];if(null!=e)for(var t={},a=0;a<e.length;a++){var i=this.getParent(e[a]);if(null!=i){var s=mxCellPath.create(i);null==t[s]&&(t[s]=i,n.push(i))}}return n},mxGraphModel.prototype.cloneCell=function(e){return null!=e?this.cloneCells([e],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(e,n){for(var t={},a=[],i=0;i<e.length;i++)null!=e[i]?a.push(this.cloneCellImpl(e[i],t,n)):a.push(null);for(i=0;i<a.length;i++)null!=a[i]&&this.restoreClone(a[i],e[i],t);return a},mxGraphModel.prototype.cloneCellImpl=function(e,n,t){var a=this.cellCloned(e);if(n[mxObjectIdentity.get(e)]=a,t){t=this.getChildCount(e);for(var i=0;i<t;i++){var s=this.cloneCellImpl(this.getChildAt(e,i),n,!0);a.insert(s)}}return a},mxGraphModel.prototype.cellCloned=function(e){return e.clone()},mxGraphModel.prototype.restoreClone=function(e,n,t){null!=(a=this.getTerminal(n,!0))&&(null!=(a=t[mxObjectIdentity.get(a)])&&a.insertEdge(e,!0)),null!=(a=this.getTerminal(n,!1))&&(null!=(a=t[mxObjectIdentity.get(a)])&&a.insertEdge(e,!1));for(var a=this.getChildCount(e),i=0;i<a;i++)this.restoreClone(this.getChildAt(e,i),this.getChildAt(n,i),t)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var e=this.model.getParent(this.child),n=null!=e?e.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),e=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=e,this.index=this.previousIndex,this.previousIndex=n},mxChildChange.prototype.connect=function(e,n){n=null==n||n;var t=e.getTerminal(!0),a=e.getTerminal(!1);for(null!=t&&(n?this.model.terminalForCellChanged(e,t,!0):this.model.terminalForCellChanged(e,null,!0)),null!=a&&(n?this.model.terminalForCellChanged(e,a,!1):this.model.terminalForCellChanged(e,null,!1)),e.setTerminal(t,!0),e.setTerminal(a,!1),t=this.model.getChildCount(e),a=0;a<t;a++)this.connect(this.model.getChildAt(e,a),n)},mxTerminalChange.prototype.execute=function(){this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)},mxValueChange.prototype.execute=function(){this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous)},mxStyleChange.prototype.execute=function(){this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous)},mxGeometryChange.prototype.execute=function(){this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous)},mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)},mxVisibleChange.prototype.execute=function(){this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)},mxCellAttributeChange.prototype.execute=function(){var e=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=e},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient="id value parent source target children edges".split(" "),mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(e){this.id=e},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(e){this.value=e},mxCell.prototype.valueChanged=function(e){var n=this.getValue();return this.setValue(e),n},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(e){this.geometry=e},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(e){this.style=e},mxCell.prototype.isVertex=function(){return this.vertex},mxCell.prototype.setVertex=function(e){this.vertex=e},mxCell.prototype.isEdge=function(){return this.edge},mxCell.prototype.setEdge=function(e){this.edge=e},mxCell.prototype.isConnectable=function(){return this.connectable},mxCell.prototype.setConnectable=function(e){this.connectable=e},mxCell.prototype.isVisible=function(){return this.visible},mxCell.prototype.setVisible=function(e){this.visible=e},mxCell.prototype.isCollapsed=function(){return this.collapsed},mxCell.prototype.setCollapsed=function(e){this.collapsed=e},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(e){this.parent=e},mxCell.prototype.getTerminal=function(e){return e?this.source:this.target},mxCell.prototype.setTerminal=function(e,n){return n?this.source=e:this.target=e,e},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(e){return mxUtils.indexOf(this.children,e)},mxCell.prototype.getChildAt=function(e){return null==this.children?null:this.children[e]},mxCell.prototype.insert=function(e,n){return null!=e&&(null==n&&(n=this.getChildCount(),e.getParent()==this&&n--),e.removeFromParent(),e.setParent(this),null==this.children?(this.children=[],this.children.push(e)):this.children.splice(n,0,e)),e},mxCell.prototype.remove=function(e){var n=null;return null!=this.children&&0<=e&&(null!=(n=this.getChildAt(e))&&(this.children.splice(e,1),n.setParent(null))),n},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var e=this.parent.getIndex(this);this.parent.remove(e)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(e){return mxUtils.indexOf(this.edges,e)},mxCell.prototype.getEdgeAt=function(e){return null==this.edges?null:this.edges[e]},mxCell.prototype.insertEdge=function(e,n){return null!=e&&(e.removeFromTerminal(n),e.setTerminal(this,n),null==this.edges||e.getTerminal(!n)!=this||mxUtils.indexOf(this.edges,e)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(e)),e},mxCell.prototype.removeEdge=function(e,n){if(null!=e){if(e.getTerminal(!n)!=this&&null!=this.edges){var t=this.getEdgeIndex(e);0<=t&&this.edges.splice(t,1)}e.setTerminal(null,n)}return e},mxCell.prototype.removeFromTerminal=function(e){var n=this.getTerminal(e);null!=n&&n.removeEdge(this,e)},mxCell.prototype.getAttribute=function(e,n){var t=this.getValue();return(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT?t.getAttribute(e):null)||n},mxCell.prototype.setAttribute=function(e,n){var t=this.getValue();null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT&&t.setAttribute(e,n)},mxCell.prototype.clone=function(){var e=mxUtils.clone(this,this.mxTransient);return e.setValue(this.cloneValue()),e},mxCell.prototype.cloneValue=function(){var e=this.getValue();return null!=e&&("function"==typeof e.clone?e=e.clone():isNaN(e.nodeType)||(e=e.cloneNode(!0))),e},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=e}},mxGeometry.prototype.getTerminalPoint=function(e){return e?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(e,n){return n?this.sourcePoint=e:this.targetPoint=e,e},mxGeometry.prototype.translate=function(e,n){if(this.clone(),this.relative||(this.x+=e,this.y+=n),null!=this.sourcePoint&&(this.sourcePoint.x+=e,this.sourcePoint.y+=n),null!=this.targetPoint&&(this.targetPoint.x+=e,this.targetPoint.y+=n),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var t=this.points.length,a=0;a<t;a++){var i=this.points[a];null!=i&&(i.x+=e,i.y+=n)}};var mxCellPath={PATH_SEPARATOR:".",create:function(e){var n="";if(null!=e)for(var t=e.getParent();null!=t;)n=t.getIndex(e)+mxCellPath.PATH_SEPARATOR+n,t=(e=t).getParent();return 1<(e=n.length)&&(n=n.substring(0,e-1)),n},getParentPath:function(e){if(null!=e){var n=e.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=n)return e.substring(0,n);if(0<e.length)return""}return null},resolve:function(e,n){var t=e;if(null!=n)for(var a=n.split(mxCellPath.PATH_SEPARATOR),i=0;i<a.length;i++)t=t.getChildAt(parseInt(a[i]));return t},compare:function(e,n){for(var t=Math.min(e.length,n.length),a=0,i=0;i<t;i++)if(e[i]!=n[i]){a=0==e[i].length||0==n[i].length?e[i]==n[i]?0:e[i]>n[i]?1:-1:(t=parseInt(e[i]))==(i=parseInt(n[i]))?0:i<t?1:-1;break}return 0==a&&((t=e.length)!=(i=n.length)&&(a=i<t?1:-1)),a}},mxPerimeter={RectanglePerimeter:function(e,n,t,a){n=e.getCenterX();var i=e.getCenterY(),s=Math.atan2(t.y-i,t.x-n),o=new mxPoint(0,0),r=Math.PI,l=Math.PI/2-s,d=Math.atan2(e.height,e.width);return s<-r+d||r-d<s?(o.x=e.x,o.y=i-e.width*Math.tan(s)/2):s<-d?(o.y=e.y,o.x=n-e.height*Math.tan(l)/2):s<d?(o.x=e.x+e.width,o.y=i+e.width*Math.tan(s)/2):(o.y=e.y+e.height,o.x=n+e.height*Math.tan(l)/2),a&&(t.x>=e.x&&t.x<=e.x+e.width?o.x=t.x:t.y>=e.y&&t.y<=e.y+e.height&&(o.y=t.y),t.x<e.x?o.x=e.x:t.x>e.x+e.width&&(o.x=e.x+e.width),t.y<e.y?o.y=e.y:t.y>e.y+e.height&&(o.y=e.y+e.height)),o},EllipsePerimeter:function(e,n,t,a){var i=e.x,s=e.y,o=e.width/2,r=e.height/2,l=i+o,d=s+r;n=t.x,t=t.y;var c=parseInt(n-l),m=parseInt(t-d);if(0==c&&0!=m)return new mxPoint(l,d+r*m/Math.abs(m));if(0==c&&0==m)return new mxPoint(n,t);if(a){if(s<=t&&t<=s+e.height)return e=t-d,e=Math.sqrt(o*o*(1-e*e/(r*r)))||0,n<=i&&(e=-e),new mxPoint(l+e,t);if(i<=n&&n<=i+e.width)return e=n-l,e=Math.sqrt(r*r*(1-e*e/(o*o)))||0,t<=s&&(e=-e),new mxPoint(n,d+e)}return d-=(i=m/c)*l,l=i*(o=(-(e=-2*l*(s=o*o*i*i+r*r))+(r=Math.sqrt(e*e-4*s*(o*o*i*i*l*l+r*r*l*l-o*o*r*r))))/(2*s))+d,d=i*(r=(-e-r)/(2*s))+d,i=Math.sqrt(Math.pow(o-n,2)+Math.pow(l-t,2)),n=Math.sqrt(Math.pow(r-n,2)+Math.pow(d-t,2)),s=t=0,s=i<n?(t=o,l):(t=r,d),new mxPoint(t,s)},RhombusPerimeter:function(e,n,t,a){n=e.x;var i=e.y,s=e.width,o=n+s/2,r=i+(e=e.height)/2,l=t.x;if(t=t.y,o==l)return new mxPoint(o,t<r?i:i+e);if(r==t)return new mxPoint(l<o?n:n+s,r);var d=o,c=r;return a&&(n<=l&&l<=n+s?d=l:i<=t&&t<=i+e&&(c=t)),l<o?t<r?mxUtils.intersection(l,t,d,c,o,i,n,r):mxUtils.intersection(l,t,d,c,o,i+e,n,r):t<r?mxUtils.intersection(l,t,d,c,o,i,n+s,r):mxUtils.intersection(l,t,d,c,o,i+e,n+s,r)},TrianglePerimeter:function(e,n,t,a){var i=(n=null!=n?n.style[mxConstants.STYLE_DIRECTION]:null)==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH,s=e.x,o=e.y,r=e.width,l=s+r/2,d=o+(e=e.height)/2,c=new mxPoint(s,o),m=new mxPoint(s+r,d),u=new mxPoint(s,o+e);n==mxConstants.DIRECTION_NORTH?(c=u,m=new mxPoint(l,o),u=new mxPoint(s+r,o+e)):n==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(l,o+e),u=new mxPoint(s+r,o)):n==mxConstants.DIRECTION_WEST&&(c=new mxPoint(s+r,o),m=new mxPoint(s,d),u=new mxPoint(s+r,o+e));var p=t.x-l,g=t.y-d,v=(p=i?Math.atan2(p,g):Math.atan2(g,p),i?Math.atan2(r,e):Math.atan2(e,r));g=!1,g=n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_WEST?-v<p&&p<v:p<-Math.PI+v||p>Math.PI-v,v=null;return null==(v=g?a&&(i&&t.x>=c.x&&t.x<=u.x||!i&&t.y>=c.y&&t.y<=u.y)?i?new mxPoint(t.x,c.y):new mxPoint(c.x,t.y):n==mxConstants.DIRECTION_NORTH?new mxPoint(s+r/2+e*Math.tan(p)/2,o+e):n==mxConstants.DIRECTION_SOUTH?new mxPoint(s+r/2-e*Math.tan(p)/2,o):n==mxConstants.DIRECTION_WEST?new mxPoint(s+r,o+e/2+r*Math.tan(p)/2):new mxPoint(s,o+e/2-r*Math.tan(p)/2):(a&&(a=new mxPoint(l,d),t.y>=o&&t.y<=o+e?(a.x=i?l:n==mxConstants.DIRECTION_WEST?s+r:s,a.y=t.y):t.x>=s&&t.x<=s+r&&(a.x=t.x,a.y=i?n==mxConstants.DIRECTION_NORTH?o+e:o:d),l=a.x,d=a.y),i&&t.x<=s+r/2||!i&&t.y<=o+e/2?mxUtils.intersection(t.x,t.y,l,d,c.x,c.y,m.x,m.y):mxUtils.intersection(t.x,t.y,l,d,m.x,m.y,u.x,u.y)))&&(v=new mxPoint(l,d)),v}};function mxPrintPreview(e,n,t,a,i,s,o,r,l){this.graph=e,this.scale=null!=n?n:1/e.pageScale,this.border=null!=a?a:0,this.pageFormat=null!=t?t:e.pageFormat,this.title=null!=r?r:"Printer-friendly version",this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==l||l}function mxStylesheet(){this.styles={},this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(e,n,t){this.view=e,this.cell=n,this.style=t,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(e){this.graph=e,this.cells=[]}function mxSelectionChange(e,n,t){this.selectionModel=e,this.added=null!=n?n.slice():null,this.removed=null!=t?t.slice():null}function mxCellEditor(e){this.graph=e}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var e="";return 8==document.documentMode&&(e='<meta http-equiv="X-UA-Compatible" content="IE=8">'),e},mxPrintPreview.prototype.open=function(e){var n=this.graph.cellRenderer.initializeOverlay,t=null;try{if(this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(e,n){n.init(e.view.getDrawPane())}),null==this.wnd){this.wnd=window.open();var a=this.wnd.document,i=this.getDoctype();null!=i&&0<i.length&&a.writeln(i),a.writeln("<html>"),a.writeln("<head>"),this.writeHead(a,e),a.writeln("</head>"),a.writeln('<body class="mxPage">'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a),mxClient.IS_VML&&(a.namespaces.add("v","urn:schemas-microsoft-com:vml"),a.namespaces.add("o","urn:schemas-microsoft-com:office:office"),a.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css",a));var s=this.graph.getGraphBounds().clone(),o=this.graph.getView().getScale(),r=o/this.scale,l=this.graph.getView().getTranslate();this.autoOrigin||(this.x0=-l.x*this.scale,this.y0=-l.y*this.scale,s.width+=s.x,s.height+=s.y,s.x=0,this.border=s.y=0),s.width/=r,s.height/=r;var d=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border,m=Math.max(1,Math.ceil((s.width+this.x0)/d)),u=Math.max(1,Math.ceil((s.height+this.y0)/c));this.pageCount=m*u;var p=mxUtils.bind(this,function(){if(this.pageSelector&&(1<u||1<m)){var e=this.createPageSelector(u,m);if(a.body.appendChild(e),mxClient.IS_IE){e.style.position="absolute";var n=function(){e.style.top=a.body.scrollTop+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(e){n()}),mxEvent.addListener(this.wnd,"resize",function(e){n()})}}});if(e=function(e,n){if(null!=this.borderColor&&(e.style.borderColor=this.borderColor,e.style.borderStyle="solid",e.style.borderWidth="1px"),e.style.background="white",n&&(e.style.pageBreakAfter="always"),mxClient.IS_IE?(a.writeln(e.outerHTML),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),a.body.appendChild(e)),n){var t=a.createElement("hr");t.className="mxPageBreak",a.body.appendChild(t)}},null!=(f=this.getCoverPages(this.pageFormat.width,this.pageFormat.height)))for(var g=0;g<f.length;g++)e(f[g],!0);var v=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(g=0;g<u;g++)for(var h=g*c/this.scale-this.y0/this.scale+(s.y-l.y*o)/o,f=0;f<m;f++){if(null==this.wnd)return null;var b=f*d/this.scale-this.x0/this.scale+(s.x-l.x*o)/o,A=g*m+f+1;(t=this.renderPage(this.pageFormat.width,this.pageFormat.height,mxUtils.bind(this,function(e){this.addGraphFragment(-b,-h,this.scale,A,e)}))).setAttribute("id","mxPage-"+A),e(t,null!=v||g<u-1||f<m-1)}if(null!=v)for(g=0;g<v.length;g++)e(v[g],g<v.length);a.writeln("</body>"),a.writeln("</html>"),a.close(),p(),mxEvent.release(a.body)}this.wnd.focus()}catch(e){null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t)}finally{this.graph.cellRenderer.initializeOverlay=n}return this.wnd},mxPrintPreview.prototype.writeHead=function(e,n){null!=this.title&&e.writeln("<title>"+this.title+"</title>"),e.writeln('<style type="text/css">'),e.writeln("@media print {"),e.writeln("  table.mxPageSelector { display: none; }"),e.writeln("  hr.mxPageBreak { display: none; }"),e.writeln("}"),e.writeln("@media screen {"),e.writeln("  table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),e.writeln("  table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),e.writeln("  body.mxPage { background: gray; }"),e.writeln("}"),null!=n&&e.writeln(n),e.writeln("</style>")},mxPrintPreview.prototype.createPageSelector=function(e,n){var t=this.wnd.document,a=t.createElement("table");a.className="mxPageSelector",a.setAttribute("border","0");for(var i=t.createElement("tbody"),s=0;s<e;s++){for(var o=t.createElement("tr"),r=0;r<n;r++){var l=s*n+r+1,d=t.createElement("td");if(!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC){var c=t.createElement("a");c.setAttribute("href","#mxPage-"+l),mxUtils.write(c,l,t),d.appendChild(c)}else mxUtils.write(d,l,t);o.appendChild(d)}i.appendChild(o)}return a.appendChild(i),a},mxPrintPreview.prototype.renderPage=function(e,n,t){var a=document.createElement("div");try{a.style.width=e+"px",a.style.height=n+"px",a.style.overflow="hidden",a.style.pageBreakInside="avoid",a.style.position="relative";var i=document.createElement("div");i.style.top=this.border+"px",i.style.left=this.border+"px",i.style.width=e-2*this.border+"px",i.style.height=n-2*this.border+"px",i.style.overflow="hidden",this.graph.dialect==mxConstants.DIALECT_VML&&(i.style.position="absolute"),a.appendChild(i),document.body.appendChild(a),t(i)}catch(e){throw a.parentNode.removeChild(a),e}return a},mxPrintPreview.prototype.addGraphFragment=function(e,n,t,a,i){a=this.graph.getView();var s=this.graph.container;this.graph.container=i;var o=a.getCanvas(),r=a.getBackgroundPane(),l=a.getDrawPane(),d=a.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?a.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?a.createVml():a.createHtml();var c=a.isEventsEnabled();a.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var u=a.getTranslate();a.translate=new mxPoint(e,n),e=null;try{var p=[this.graph.getModel().getRoot()];e=new mxTemporaryCellStates(a,t,p)}finally{if(mxClient.IS_IE)a.overlayPane.innerHTML="";else for(t=i.firstChild;null!=t;)p=t.nextSibling,"svg"==(n=t.nodeName.toLowerCase())?(t.setAttribute("width",parseInt(i.style.width)),t.setAttribute("height",parseInt(i.style.height))):"default"!=t.style.cursor&&"table"!=n&&t.parentNode.removeChild(t),t=p;a.overlayPane.parentNode.removeChild(a.overlayPane),this.graph.setEnabled(m),this.graph.container=s,a.canvas=o,a.backgroundPane=r,a.drawPane=l,a.overlayPane=d,a.translate=u,e.destroy(),a.setEventsEnabled(c)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(){var e=this.open();null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.createDefaultVertexStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#774400",e},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,e[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#446299",e},mxStylesheet.prototype.putDefaultVertexStyle=function(e){this.putCellStyle("defaultVertex",e)},mxStylesheet.prototype.putDefaultEdgeStyle=function(e){this.putCellStyle("defaultEdge",e)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(e,n){this.styles[e]=n},mxStylesheet.prototype.getCellStyle=function(e,n){var t=n;if(null!=e&&0<e.length)for(var a=e.split(";"),i=(t=null!=t&&";"!=e.charAt(0)?mxUtils.clone(t):{},0);i<a.length;i++){var s=(o=a[i]).indexOf("=");if(0<=s){var o,r=o.substring(0,s);(o=o.substring(s+1))==mxConstants.NONE?delete t[r]:mxUtils.isNumeric(o)?t[r]=parseFloat(o):t[r]=o}else if(null!=(o=this.styles[o]))for(r in o)t[r]=o[r]}return t},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalid=!0,mxCellState.prototype.invalidOrder=!1,mxCellState.prototype.orderChanged=!1,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.getPerimeterBounds=function(e,n){if(e=e||0,n=null!=n?n:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil){var t=this.shape.stencil.computeAspect(this.style,n.x,n.y,n.width,n.height);n.x=t.x,n.y=t.y,n.width=this.shape.stencil.w0*t.width,n.height=this.shape.stencil.h0*t.height}return 0!=e&&n.grow(e),n},mxCellState.prototype.setAbsoluteTerminalPoint=function(e,n){n?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[0]=e):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(e)):1==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[this.absolutePoints.length-1]=e},mxCellState.prototype.setCursor=function(e){null!=this.shape&&this.shape.setCursor(e),null!=this.text&&this.text.setCursor(e)},mxCellState.prototype.getVisibleTerminal=function(e){return null!=(e=this.getVisibleTerminalState(e))?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(e){return e?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(e,n){n?this.visibleSourceState=e:this.visibleTargetState=e},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxCellState.prototype.clone=function(){var e=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){e.absolutePoints=[];for(var n=0;n<this.absolutePoints.length;n++)e.absolutePoints[n]=this.absolutePoints[n].clone()}return null!=this.origin&&(e.origin=this.origin.clone()),null!=this.absoluteOffset&&(e.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(e.boundingBox=this.boundingBox.clone()),e.terminalDistance=this.terminalDistance,e.segments=this.segments,e.length=this.length,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(e){this.singleSelection=e},mxGraphSelectionModel.prototype.isSelected=function(e){return null!=e&&0<=mxUtils.indexOf(this.cells,e)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(e){null!=e&&this.setCells([e])},mxGraphSelectionModel.prototype.setCells=function(e){if(null!=e){this.singleSelection&&(e=[this.getFirstSelectableCell(e)]);for(var n=[],t=0;t<e.length;t++)this.graph.isCellSelectable(e[t])&&n.push(e[t]);this.changeSelection(n,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(e){if(null!=e)for(var n=0;n<e.length;n++)if(this.graph.isCellSelectable(e[n]))return e[n];return null},mxGraphSelectionModel.prototype.addCell=function(e){null!=e&&this.addCells([e])},mxGraphSelectionModel.prototype.addCells=function(e){if(null!=e){var n=null;this.singleSelection&&(n=this.cells,e=[this.getFirstSelectableCell(e)]);for(var t=[],a=0;a<e.length;a++)!this.isSelected(e[a])&&this.graph.isCellSelectable(e[a])&&t.push(e[a]);this.changeSelection(t,n)}},mxGraphSelectionModel.prototype.removeCell=function(e){null!=e&&this.removeCells([e])},mxGraphSelectionModel.prototype.removeCells=function(e){if(null!=e){for(var n=[],t=0;t<e.length;t++)this.isSelected(e[t])&&n.push(e[t]);this.changeSelection(null,n)}},mxGraphSelectionModel.prototype.changeSelection=function(e,n){if(null!=e&&0<e.length&&null!=e[0]||null!=n&&0<n.length&&null!=n[0]){var t=new mxSelectionChange(this,e,n);t.execute();var a=new mxUndoableEdit(this,!1);a.add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a))}},mxGraphSelectionModel.prototype.cellAdded=function(e){null!=e&&!this.isSelected(e)&&this.cells.push(e)},mxGraphSelectionModel.prototype.cellRemoved=function(e){null!=e&&(0<=(e=mxUtils.indexOf(this.cells,e))&&this.cells.splice(e,1))},mxSelectionChange.prototype.execute=function(){var e=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var n=0;n<this.removed.length;n++)this.selectionModel.cellRemoved(this.removed[n]);if(null!=this.added)for(n=0;n<this.added.length;n++)this.selectionModel.cellAdded(this.added[n]);n=this.added,this.added=this.removed,this.removed=n,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",e),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.emptyLabelText="",mxCellEditor.prototype.textNode="",mxCellEditor.prototype.init=function(){this.textarea=document.createElement("textarea"),this.textarea.className="mxCellEditor",this.textarea.style.position="absolute",this.textarea.style.overflow="visible",this.textarea.setAttribute("cols","20"),this.textarea.setAttribute("rows","4"),mxClient.IS_NS&&(this.textarea.style.resize="none"),mxEvent.addListener(this.textarea,"blur",mxUtils.bind(this,function(e){this.focusLost()})),mxEvent.addListener(this.textarea,"keydown",mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(113==e.keyCode||this.graph.isEnterStopsCellEditing()&&13==e.keyCode&&!mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e)?(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode?(this.graph.stopEditing(!0),mxEvent.consume(e)):(this.clearOnChange&&(this.clearOnChange=!1,this.textarea.value=""),this.setModified(!0)))})),mxEvent.addListener(this.textarea,"keypress",mxUtils.bind(this,function(e){this.autoSize&&!mxEvent.isConsumed(e)&&setTimeout(mxUtils.bind(this,function(){this.resize()}),0)}))},mxCellEditor.prototype.resize=function(){if(null!=this.textDiv){var e=this.graph.getView().getState(this.editingCell),n=this.graph.isLabelClipped(e.cell),t=this.graph.isWrapping(e.cell);if(this.graph.getModel().isEdge(e.cell))this.bounds.x=e.absoluteOffset.x,this.bounds.y=e.absoluteOffset.y,this.bounds.width=0,this.bounds.height=0;else if(null!=this.bounds){this.bounds.x=e.x,this.bounds.y=e.y,this.bounds.width=e.width,this.bounds.height=e.height,(a=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?this.bounds.x-=e.width:a==mxConstants.ALIGN_RIGHT&&(this.bounds.x+=e.width),(a=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?this.bounds.y-=e.height:a==mxConstants.ALIGN_BOTTOM&&(this.bounds.y+=e.height)}"\n"!=(a=this.textarea.value).charAt(a.length-1)&&""!=a||(a+="&nbsp;"),a=mxUtils.htmlEntities(a,!1),t?(this.textDiv.style.whiteSpace="normal",this.textDiv.style.width=this.bounds.width+"px"):a=a.replace(/ /g,"&nbsp;"),a=a.replace(/\n/g,"<br/>"),this.textDiv.innerHTML=a;var a=this.textDiv.offsetWidth+30,i=this.textDiv.offsetHeight+16;a=Math.max(a,40),i=Math.max(i,20);n&&(a=Math.min(this.bounds.width-4,a),i=Math.min(this.bounds.height,i));var s=null!=e.text?e.text.margin:null;null==s&&(s=mxUtils.getValue(e.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getAlignmentAsPoint(s,e)),null!=s&&(!n&&t||(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-s.x*this.bounds.width+s.x*a)-3)+"px"),this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-s.y*this.bounds.height+s.y*i)+4)+"px"),!n&&t||(this.textarea.style.width=a+"px"),this.textarea.style.height=i+"px"}},mxCellEditor.prototype.isModified=function(){return this.modified},mxCellEditor.prototype.setModified=function(e){this.modified=e},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.startEditing=function(e,n){null==this.textarea&&this.init(),this.stopEditing(!0);var t=this.graph.getView().getState(e);if(null!=t){this.editingCell=e,this.trigger=n,(this.textNode=null)!=t.text&&this.isHideLabel(t)&&(this.textNode=t.text.node,this.textNode.style.visibility="hidden");var a=this.graph.getView().scale,i=(a=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)*a,mxUtils.getValue(t.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)),s=mxUtils.getValue(t.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,d=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.lineHeight=Math.round(a*mxConstants.LINE_HEIGHT)+"px",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=o,this.textarea.style.color=s,this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.textDecoration=d?"underline":"",this.textarea.style.overflow="auto",this.textarea.style.outline="none",this.bounds=a=this.getEditorBounds(t),this.textarea.style.left=a.x+"px",this.textarea.style.top=a.y+"px",this.textarea.style.width=a.width+"px",this.textarea.style.height=a.height+"px",this.textarea.style.zIndex=5,null==(t=this.getInitialValue(t,n))||0==t.length?(t=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=!1,this.setModified(!1),this.textarea.value=t,this.graph.container.appendChild(this.textarea),"none"!=this.textarea.style.display&&(this.autoSize&&(this.textDiv=this.createTextDiv(),document.body.appendChild(this.textDiv),this.resize()),this.textarea.focus(),this.textarea.select())}},mxCellEditor.prototype.createTextDiv=function(){var e=document.createElement("div"),n=e.style;return n.position="absolute",n.whiteSpace="nowrap",n.visibility="hidden",n.display=mxClient.IS_QUIRKS?"inline":"inline-block",n.zoom="1",n.verticalAlign="top",n.lineHeight=this.textarea.style.lineHeight,n.fontSize=this.textarea.style.fontSize,n.fontFamily=this.textarea.style.fontFamily,n.fontWeight=this.textarea.style.fontWeight,n.textAlign=this.textarea.style.textAlign,n.fontStyle=this.textarea.style.fontStyle,n.textDecoration=this.textarea.style.textDecoration,e},mxCellEditor.prototype.stopEditing=function(e){null!=this.editingCell&&(null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null),!e&&this.isModified()&&this.graph.labelChanged(this.editingCell,this.getCurrentValue(),this.trigger),null!=this.textDiv&&(document.body.removeChild(this.textDiv),this.textDiv=null),this.bounds=this.trigger=this.editingCell=null,this.textarea.blur(),this.textarea.parentNode.removeChild(this.textarea))},mxCellEditor.prototype.getInitialValue=function(e,n){return this.graph.getEditingValue(e.cell,n)},mxCellEditor.prototype.getCurrentValue=function(){return this.textarea.value.replace(/\r/g,"")},mxCellEditor.prototype.isHideLabel=function(e){return!0},mxCellEditor.prototype.getMinimumSize=function(e){var n=this.graph.getView().scale;return new mxRectangle(0,0,null==e.text?30:e.text.size*n+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(e){var n=this.graph.getModel().isEdge(e.cell),t=this.graph.getView().scale,a=(i=this.getMinimumSize(e)).width,i=i.height,s=parseInt(e.style[mxConstants.STYLE_SPACING]||2)*t,o=parseInt(e.style[mxConstants.STYLE_SPACING_TOP]||0)*t+s,r=parseInt(e.style[mxConstants.STYLE_SPACING_RIGHT]||0)*t+s,l=parseInt(e.style[mxConstants.STYLE_SPACING_BOTTOM]||0)*t+s;t=parseInt(e.style[mxConstants.STYLE_SPACING_LEFT]||0)*t+s,r=new mxRectangle(e.x,e.y,Math.max(a,e.width-t-r),Math.max(i,e.height-o-l));return n?(r.x=e.absoluteOffset.x,r.y=e.absoluteOffset.y,null!=e.text&&null!=e.text.boundingBox&&(0<e.text.boundingBox.x&&(r.x=e.text.boundingBox.x),0<e.text.boundingBox.y&&(r.y=e.text.boundingBox.y))):null!=e.text&&null!=e.text.boundingBox&&(r.x=Math.min(r.x,e.text.boundingBox.x),r.y=Math.min(r.y,e.text.boundingBox.y)),r.x+=t,r.y+=o,null!=e.text&&null!=e.text.boundingBox&&(n?(r.width=Math.max(a,e.text.boundingBox.width),r.height=Math.max(i,e.text.boundingBox.height)):(r.width=Math.max(r.width,e.text.boundingBox.width),r.height=Math.max(r.height,e.text.boundingBox.height))),this.graph.getModel().isVertex(e.cell)&&((n=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?r.x-=e.width:n==mxConstants.ALIGN_RIGHT&&(r.x+=e.width),(n=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?r.y-=e.height:n==mxConstants.ALIGN_BOTTOM&&(r.y+=e.height)),r},mxCellEditor.prototype.getEmptyLabelText=function(e){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null)},mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.defaultShapes={},mxCellRenderer.registerShape=function(e,n){mxCellRenderer.prototype.defaultShapes[e]=n},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initialize=function(e,n){var t=e.view.graph.getModel();null!=e.view.graph.container&&null==e.shape&&e.cell!=e.view.currentRoot&&(t.isVertex(e.cell)||t.isEdge(e.cell))&&(this.createShape(e),null==e.shape||null!=n&&!n||(this.initializeShape(e),e.view.graph.ordered||t.isEdge(e.cell)?e.invalidOrder=!0:e.view.graph.keepEdgesInForeground&&null!=this.firstEdge&&(this.firstEdge.parentNode==e.shape.node.parentNode?this.insertState(e,this.firstEdge):this.firstEdge=null),e.shape.scale=e.view.scale,this.createCellOverlays(e),this.installListeners(e)))},mxCellRenderer.prototype.initializeShape=function(e){e.shape.init(e.view.getDrawPane())},mxCellRenderer.prototype.getPreviousStateInContainer=function(e,n){for(var t=null,a=e.view.graph,i=a.getModel(),s=e.cell,o=i.getParent(s);null!=o&&null==t;)t=this.findPreviousStateInContainer(a,o,s,n),s=o,o=i.getParent(s);return t},mxCellRenderer.prototype.findPreviousStateInContainer=function(e,n,t,a){var i=null,s=e.getModel();for(t=null!=t?n.getIndex(t)-1:s.getChildCount(n)-1;0<=t&&null==i;t--)i=this.findPreviousStateInContainer(e,s.getChildAt(n,t),null,a);return null!=i||(null==(i=e.view.getState(n))||null!=i.shape&&null!=i.shape.node&&i.shape.node.parentNode==a)||(i=null),i},mxCellRenderer.prototype.order=function(e){var n=e.shape.node.parentNode,t=this.getPreviousStateInContainer(e,n),a=n.firstChild;null!=t&&(a=t.shape.node,null!=t.text&&null!=t.text.node&&t.text.node.parentNode==n&&(a=t.text.node),a=a.nextSibling),this.insertState(e,a)},mxCellRenderer.prototype.orderEdge=function(e){var n=(t=e.view).graph.getModel();if(t.graph.keepEdgesInForeground)null!=this.firstEdge&&null!=this.firstEdge.parentNode&&this.firstEdge.parentNode==e.shape.node.parentNode||(this.firstEdge=e.shape.node);else if(t.graph.keepEdgesInBackground){var t,a=e.shape.node,i=a.parentNode;n=n.getParent(e.cell);null!=(i=null!=(t=t.getState(n))&&null!=t.shape&&null!=t.shape.node?t.shape.node.nextSibling:i.firstChild)&&i!=a&&this.insertState(e,i)}},mxCellRenderer.prototype.insertState=function(e,n){e.shape.node.parentNode.insertBefore(e.shape.node,n),null!=e.text&&null!=e.text.node&&e.text.node.parentNode==e.shape.node.parentNode&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling)},mxCellRenderer.prototype.createShape=function(e){if(null!=e.style){var n=mxStencilRegistry.getStencil(e.style[mxConstants.STYLE_SHAPE]);null!=n?e.shape=new mxShape(n):(n=this.getShapeConstructor(e),e.shape=new n),e.shape.points=e.absolutePoints,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.dialect=e.view.graph.dialect,this.configureShape(e)}},mxCellRenderer.prototype.getShape=function(e){return null!=e?mxCellRenderer.prototype.defaultShapes[e]:null},mxCellRenderer.prototype.getShapeConstructor=function(e){var n=this.getShape(e.style[mxConstants.STYLE_SHAPE]);return null==n&&(n=e.view.graph.getModel().isEdge(e.cell)?this.defaultEdgeShape:this.defaultVertexShape),n},mxCellRenderer.prototype.configureShape=function(e){e.shape.apply(e),e.shape.image=e.view.graph.getImage(e),e.shape.indicatorShape=this.getShape(e.view.graph.getIndicatorShape(e)),e.shape.indicatorColor=e.view.graph.getIndicatorColor(e),e.shape.indicatorGradientColor=e.view.graph.getIndicatorGradientColor(e),e.shape.indicatorDirection=e.style[mxConstants.STYLE_INDICATOR_DIRECTION],e.shape.indicatorImage=e.view.graph.getIndicatorImage(e),this.postConfigureShape(e)},mxCellRenderer.prototype.postConfigureShape=function(e){null!=e.shape&&(this.resolveColor(e,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(e,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(e,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.resolveColor=function(e,n,t){var a=e.shape[n],i=e.view.graph,s=null;"inherit"==a?s=i.model.getParent(e.cell):"swimlane"==a?(s=null!=i.model.getTerminal(e.cell,!1)?i.model.getTerminal(e.cell,!1):e.cell,s=i.getSwimlane(s),t=i.swimlaneIndicatorColorAttribute):"indicated"==a&&(e.shape[n]=e.shape.indicatorColor),null!=s&&(a=i.getView().getState(s),(e.shape[n]=null)!=a&&(e.shape[n]=null!=a.shape&&"indicatorColor"!=n?a.shape[n]:a.style[t]))},mxCellRenderer.prototype.getLabelValue=function(e){return e.view.graph.getLabel(e.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var a=t.view.graph;if(a.getModel().isEdge(t.cell),0<t.style[mxConstants.STYLE_FONTSIZE]||null==t.style[mxConstants.STYLE_FONTSIZE]){var n=a.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,a.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],a.isWrapping(t.cell)&&a.isHtmlLabel(t.cell),a.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING]),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.state=t,this.initializeLabel(t);var i=!1,s=function(e){var n=t;return(mxClient.IS_TOUCH||i)&&(n=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,n,e),n=a.view.getState(a.getCellAt(e.x,e.y))),n};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),i=a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)}),mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,s(e)))}),mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,s(e))),i=!1)})),mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.dblClick(e,t.cell),mxEvent.consume(e))}))}},mxCellRenderer.prototype.initializeLabel=function(e){var n=e.view.graph;e.text.dialect!=mxConstants.DIALECT_SVG&&(mxClient.IS_SVG&&mxClient.NO_FO?e.text.init(n.container):mxUtils.isVml(e.view.getDrawPane())&&(null!=e.shape.label?e.text.init(e.shape.label):e.text.init(e.shape.node))),null==e.text.node&&(e.text.init(e.view.getDrawPane()),null!=e.shape&&null!=e.text&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling))},mxCellRenderer.prototype.createCellOverlays=function(e){var n=e.view.graph.getCellOverlays(e.cell),t=null;if(null!=n){t=new mxDictionary;for(var a=0;a<n.length;a++){var i=null!=e.overlays?e.overlays.remove(n[a]):null;null==i&&((i=new mxImageShape(new mxRectangle,n[a].image.src)).dialect=e.view.graph.dialect,i.preserveImageAspect=!1,i.overlay=n[a],this.initializeOverlay(e,i),this.installCellOverlayListeners(e,n[a],i),null!=n[a].cursor&&(i.node.style.cursor=n[a].cursor)),t.put(n[a],i)}}null!=e.overlays&&e.overlays.visit(function(e,n){n.destroy()}),e.overlays=t},mxCellRenderer.prototype.initializeOverlay=function(e,n){n.init(e.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(n,t,e){var a=n.view.graph;mxEvent.addListener(e.node,"click",function(e){a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),t.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",n.cell))}),mxEvent.addGestureListeners(e.node,function(e){mxEvent.consume(e)},function(e){a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n))}),mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchend",function(e){t.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",n.cell))})},mxCellRenderer.prototype.createControl=function(t){var a=t.view.graph,e=a.getFoldingImage(t);if(a.foldingEnabled&&null!=e){if(null==t.control){var n=new mxRectangle(0,0,e.width,e.height);t.control=new mxImageShape(n,e.src),t.control.preserveImageAspect=!1,t.control.dialect=a.dialect,this.initControl(t,t.control,!0,function(e){if(a.isEnabled()){var n=!a.isCellCollapsed(t.cell);a.foldCells(n,!1,[t.cell]),mxEvent.consume(e)}})}}else null!=t.control&&(t.control.destroy(),t.control=null)},mxCellRenderer.prototype.initControl=function(n,e,t,a){var i=n.view.graph;return i.isHtmlLabel(n.cell)&&mxClient.NO_FO&&i.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(i.container),e.node.style.zIndex=1):e.init(n.view.getOverlayPane()),e=e.innerNode||e.node,a&&(i.isEnabled()&&(e.style.cursor="pointer"),mxEvent.addListener(e,"click",a)),t&&mxEvent.addGestureListeners(e,function(e){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,n)),mxEvent.consume(e)},function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n))}),e},mxCellRenderer.prototype.isShapeEvent=function(e,n){return!0},mxCellRenderer.prototype.isLabelEvent=function(e,n){return!0},mxCellRenderer.prototype.installListeners=function(t){var a=t.view.graph,n=function(e){var n=t;return(a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName||mxClient.IS_TOUCH)&&(n=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,n,e),n=a.view.getState(a.getCellAt(e.x,e.y))),n},i=!1;mxEvent.addListener(t.shape.node,"gesturestart",mxUtils.bind(this,function(e){a.lastTouchTime=0,i=!0,mxEvent.consume(e)})),mxEvent.addGestureListeners(t.shape.node,mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:t)):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:n(e))):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:n(e))):i&&mxEvent.consume(e)}));var s=mxClient.IS_TOUCH?"gestureend":"dblclick";mxEvent.addListener(t.shape.node,s,mxUtils.bind(this,function(e){i=!1,"gestureend"==s?(a.lastTouchTime=0,a.gestureEnabled&&(a.handleGesture(t,e),mxEvent.consume(e))):this.isShapeEvent(t,e)&&(a.dblClick(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:t.cell),mxEvent.consume(e))}))},mxCellRenderer.prototype.redrawLabel=function(e,n){var t=this.getLabelValue(e);if(null==e.text&&null!=t&&(mxUtils.isNode(t)||0<t.length)?this.createLabel(e,t):null==e.text||null!=t&&0!=t.length||(e.text.destroy(),e.text=null),null!=e.text){var a=(i=e.view.graph).isWrapping(e.cell),i=i.isLabelClipped(e.cell),s=this.getLabelBounds(e);!n&&e.text.value==t&&e.text.isWrapping==a&&e.text.isClipping==i&&e.text.scale==e.view.scale&&e.text.bounds.equals(s)||(e.text.value=t,e.text.bounds=s,e.text.scale=this.getTextScale(e),e.text.isWrapping=a,e.text.isClipping=i,e.text.redraw())}},mxCellRenderer.prototype.getTextScale=function(e){return e.view.scale},mxCellRenderer.prototype.getLabelBounds=function(e){var n=e.view.graph,t=e.view.scale,a=n.getModel().isEdge(e.cell),i=new mxRectangle(e.absoluteOffset.x,e.absoluteOffset.y);return e.text.updateMargin(),a?(a=e.text.getSpacing(),i.x+=a.x*t,i.y+=a.y*t,null!=(n=n.getCellGeometry(e.cell))&&(i.width=Math.max(0,e.text.margin.x*n.width*t-e.text.spacingLeft*t-e.text.spacingRight*t),i.height=Math.max(0,e.text.margin.y*n.height*t-e.text.spacingTop*t-e.text.spacingBottom*t))):(e.text.isPaintBoundsInverted()&&(a=i.x,i.x=i.y,i.y=a),i.x+=e.x,i.y+=e.y,i.width=Math.max(1,e.width),i.height=Math.max(1,e.height),n.isSwimlane(e.cell)&&(0<(n=n.getStartSize(e.cell)).width?(a=Math.min(i.width,n.width*t),e.shape.flipH&&(i.x+=i.width-a),i.width=a):0<n.height&&(a=Math.min(i.height,n.height*t),e.shape.flipV&&(i.y+=i.height-a),i.height=a)),this.rotateLabelBounds(e,i)),i},mxCellRenderer.prototype.rotateLabelBounds=function(e,n){if(e.text.isPaintBoundsInverted()){var t=(e.width-e.height)/2;n.x+=t,n.y-=t,t=n.width,n.width=n.height,n.height=t}if(n.x-=e.text.margin.x*n.width,n.y-=e.text.margin.y*n.height,"fill"!=e.style[mxConstants.STYLE_OVERFLOW]){t=e.view.scale;var a=e.text.getSpacing();n.x+=a.x*t,n.y+=a.y*t,n.width=Math.max(0,n.width-e.text.spacingLeft*t-e.text.spacingRight*t),n.height=Math.max(0,n.height-e.text.spacingTop*t-e.text.spacingBottom*t)}var i=e.text.getTextRotation();0!=i&&null!=e&&e.view.graph.model.isVertex(e.cell)&&(t=e.getCenterX(),a=e.getCenterY(),n.x!=t||n.y!=a)&&(i*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(n.x,n.y),Math.cos(i),Math.sin(i),new mxPoint(t,a)),n.x=pt.x,n.y=pt.y)},mxCellRenderer.prototype.redrawCellOverlays=function(s,o){if(this.createCellOverlays(s),null!=s.overlays){var r=mxUtils.mod(mxUtils.getValue(s.style,mxConstants.STYLE_ROTATION,0),90),e=mxUtils.toRadians(r),l=Math.cos(e),d=Math.sin(e);s.overlays.visit(function(e,n){var t=n.overlay.getBounds(s);if(!s.view.graph.getModel().isEdge(s.cell)&&null!=s.shape&&0!=r){var a=t.getCenterX(),i=t.getCenterY();a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),l,d,new mxPoint(s.getCenterX(),s.getCenterY()))).x,i=i.y;t.x=Math.round(a-t.width/2),t.y=Math.round(i-t.height/2)}!o&&null!=n.bounds&&n.scale==s.view.scale&&n.bounds.equals(t)||(n.bounds=t,n.scale=s.view.scale,n.redraw())})}},mxCellRenderer.prototype.redrawControl=function(e,n){if(null!=e.control){var t=this.getControlBounds(e),a=this.legacyControlPosition?mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0):e.shape.getTextRotation(),i=e.view.scale;!n&&e.control.scale==i&&e.control.bounds.equals(t)&&e.control.rotation==a||(e.control.rotation=a,e.control.bounds=t,e.control.scale=i,e.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(e){if(null==e.control)return null;var n=e.control.scale,t=e.control.bounds.width/n,a=(n=e.control.bounds.height/n,e.view.scale),i=e.getCenterX(),s=e.getCenterY();if(!e.view.graph.getModel().isEdge(e.cell)&&(i=e.x+t*a,s=e.y+n*a,null!=e.shape)){var o=e.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0);else if(e.shape.isPaintBoundsInverted()){var r=(e.width-e.height)/2;i=i+r,s=s-r}0!=o&&(r=mxUtils.toRadians(o),o=Math.cos(r),r=Math.sin(r),i=(s=mxUtils.getRotatedPoint(new mxPoint(i,s),o,r,new mxPoint(e.getCenterX(),e.getCenterY()))).x,s=s.y)}return e.view.graph.getModel().isEdge(e.cell),new mxRectangle(Math.round(i-t/2*a),Math.round(s-n/2*a),Math.round(t*a),Math.round(n*a))},mxCellRenderer.prototype.redraw=function(e,n,t){if(null!=e.shape){var a=!1;e.view.graph.getModel().isEdge(e.cell),reconfigure=null!=n&&n,this.createControl(e),(e.orderChanged||e.invalidOrder)&&(e.view.graph.ordered?this.order(e):this.orderEdge(e)),!e.orderChanged&&mxUtils.equalEntries(e.shape.style,e.style)||(this.configureShape(e),n=!0),delete e.invalidOrder,delete e.orderChanged,!n&&null!=e.shape.bounds&&e.shape.scale==e.view.scale&&e.shape.bounds.equals(e)&&mxUtils.equalPoints(e.shape.points,e.absolutePoints)||(a=!0,e.shape.points=null!=e.absolutePoints?e.absolutePoints.slice():null,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.scale=e.view.scale,null==t||t?e.shape.redraw():e.shape.updateBoundingBox()),(null==t||t)&&(this.redrawLabel(e,a),this.redrawCellOverlays(e,a),this.redrawControl(e,a))}},mxCellRenderer.prototype.destroy=function(e){null!=e.shape&&(null!=e.text&&(e.text.destroy(),e.text=null),null!=e.overlays&&(e.overlays.visit(function(e,n){n.destroy()}),e.overlays=null),null!=e.control&&(e.control.destroy(),e.control=null),e.shape.destroy(),e.shape=null)};var mxEdgeStyle={EntityRelation:function(e,n,t,a,i){var s=e.view,o=s.graph;a=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale;var r=(d=e.absolutePoints)[0],l=d[d.length-1],d=!1;if(null!=r)(n=new mxCellState).x=r.x,n.y=r.y;else{if(null==n)return;var c=mxUtils.getPortConstraints(n,e,!0,mxConstants.DIRECTION_MASK_NONE);c!=mxConstants.DIRECTION_MASK_NONE?d=c==mxConstants.DIRECTION_MASK_WEST:(r=o.getCellGeometry(n.cell)).relative?d=r.x<=.5:null!=t&&(d=t.x+t.width<n.x)}r=!0,null!=l?((t=new mxCellState).x=l.x,t.y=l.y):null!=t&&((c=mxUtils.getPortConstraints(t,e,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE?r=c==mxConstants.DIRECTION_MASK_WEST:(e=o.getCellGeometry(t.cell)).relative?r=e.x<=.5:null!=n&&(r=n.x+n.width<t.x)),null!=n&&null!=t&&(e=d?n.x:n.x+n.width,n=s.getRoutingCenterY(n),o=r?t.x:t.x+t.width,t=s.getRoutingCenterY(t),s=new mxPoint(e+(d?-a:a),n),l=new mxPoint(o+(r?-a:a),t),d==r?(a=d?Math.min(e,o)-a:Math.max(e,o)+a,i.push(new mxPoint(a,n)),i.push(new mxPoint(a,t))):(s.x<l.x==d?(a=n+(t-n)/2,i.push(s),i.push(new mxPoint(s.x,a)),i.push(new mxPoint(l.x,a))):i.push(s),i.push(l)))},Loop:function(e,n,t,a,i){if(null!=n){var s=(t=e.view).graph;null!=(a=null!=a&&0<a.length?a[0]:null)&&(a=t.transformControlPoint(e,a),mxUtils.contains(n,a.x,a.y)&&(a=null));var o=0,r=0,l=0,d=0;s=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,s.gridSize)*t.scale;(e=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(o=t.getRoutingCenterX(n),r=s):(l=t.getRoutingCenterY(n),d=s),null==a||a.x<n.x||a.x>n.x+n.width?null!=a?(o=a.x,d=Math.max(Math.abs(l-a.y),d)):e==mxConstants.DIRECTION_NORTH?l=n.y-2*r:e==mxConstants.DIRECTION_SOUTH?l=n.y+n.height+2*r:o=e==mxConstants.DIRECTION_EAST?n.x-2*d:n.x+n.width+2*d:null!=a&&(o=t.getRoutingCenterX(n),r=Math.max(Math.abs(o-a.x),d),l=a.y,d=0),i.push(new mxPoint(o-r,l-d)),i.push(new mxPoint(o+r,l+d))}},ElbowConnector:function(e,n,t,a,i){var s=null!=a&&0<a.length?a[0]:null,o=!1,r=!1;if(null!=n&&null!=t)if(null!=s){var l=Math.min(n.x,t.x),d=Math.max(n.x+n.width,t.x+t.width),c=(r=Math.min(n.y,t.y),Math.max(n.y+n.height,t.y+t.height));o=(s=e.view.transformControlPoint(e,s)).y<r||s.y>c,r=s.x<l||s.x>d}else(o=(l=Math.max(n.x,t.x))==(d=Math.min(n.x+n.width,t.x+t.width)))||(r=(r=Math.max(n.y,t.y))==(c=Math.min(n.y+n.height,t.y+t.height)));r||!o&&e.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(e,n,t,a,i):mxEdgeStyle.TopToBottom(e,n,t,a,i)},SideToSide:function(e,n,t,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((n=new mxCellState).x=o.x,n.y=o.y),null!=r&&((t=new mxCellState).x=r.x,t.y=r.y),null!=n&&null!=t&&(e=Math.max(n.x,t.x),o=Math.min(n.x+n.width,t.x+t.width),e=null!=a?a.x:o+(e-o)/2,o=s.getRoutingCenterY(n),s=s.getRoutingCenterY(t),null!=a&&(a.y>=n.y&&a.y<=n.y+n.height&&(o=a.y),a.y>=t.y&&a.y<=t.y+t.height&&(s=a.y)),!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),!mxUtils.contains(t,e,s)&&!mxUtils.contains(n,e,s)&&i.push(new mxPoint(e,s)),1==i.length&&(null!=a?!mxUtils.contains(t,e,a.y)&&!mxUtils.contains(n,e,a.y)&&i.push(new mxPoint(e,a.y)):(s=Math.max(n.y,t.y),n=Math.min(n.y+n.height,t.y+t.height),i.push(new mxPoint(e,s+(n-s)/2)))))},TopToBottom:function(e,n,t,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((n=new mxCellState).x=o.x,n.y=o.y),null!=r&&((t=new mxCellState).x=r.x,t.y=r.y),null!=n&&null!=t&&(o=Math.max(n.y,t.y),r=Math.min(n.y+n.height,t.y+t.height),e=s.getRoutingCenterX(n),null!=a&&a.x>=n.x&&a.x<=n.x+n.width&&(e=a.x),o=null!=a?a.y:r+(o-r)/2,!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),e=null!=a&&a.x>=t.x&&a.x<=t.x+t.width?a.x:s.getRoutingCenterX(t),!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),1==i.length&&(null!=a&&1==i.length?!mxUtils.contains(t,a.x,o)&&!mxUtils.contains(n,a.x,o)&&i.push(new mxPoint(a.x,o)):(s=Math.max(n.x,t.x),n=Math.min(n.x+n.width,t.x+t.width),i.push(new mxPoint(s+(n-s)/2,o)))))},SegmentConnector:function(e,n,t,a,i){var s=e.absolutePoints,o=!0,r=null,l=s[0];null==l&&null!=n?l=new mxPoint(e.view.getRoutingCenterX(n),e.view.getRoutingCenterY(n)):null!=l&&(l=l.clone());var d=s.length-1;if(null!=a&&0<a.length){r=e.view.transformControlPoint(e,a[0]);for(var c=n,m=s[0],u=!1,p=!1,g=(u=r,a.length),v=0;v<2;v++){var h=null!=m&&m.x==u.x,f=null!=m&&m.y==u.y,b=null!=c&&u.y>=c.y&&u.y<=c.y+c.height;c=null!=c&&u.x>=c.x&&u.x<=c.x+c.width,u=f||null==m&&b,p=h||null==m&&c;if(null!=m&&!f&&!h&&(b||c)){o=!b;break}if(p||u){o=u,1==v&&(o=0==a.length%2?u:p);break}c=t,m=s[d],u=e.view.transformControlPoint(e,a[g-1])}for(o&&(null!=s[0]&&s[0].y!=r.y||null==s[0]&&null!=n&&(r.y<n.y||r.y>n.y+n.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[0]&&s[0].x!=r.x||null==s[0]&&null!=n&&(r.x<n.x||r.x>n.x+n.width))&&i.push(new mxPoint(r.x,l.y)),o?l.y=r.y:l.x=r.x,v=0;v<a.length;v++)o=!o,r=e.view.transformControlPoint(e,a[v]),o?l.y=r.y:l.x=r.x,i.push(l.clone())}else r=l,o=!0;if(null==(l=s[d])&&null!=t&&(l=new mxPoint(e.view.getRoutingCenterX(t),e.view.getRoutingCenterY(t))),o&&(null!=s[d]&&s[d].y!=r.y||null==s[d]&&null!=t&&(r.y<t.y||r.y>t.y+t.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[d]&&s[d].x!=r.x||null==s[d]&&null!=t&&(r.x<t.x||r.x>t.x+t.width))&&i.push(new mxPoint(r.x,l.y)),null==s[0]&&null!=n)for(;1<i.length&&mxUtils.contains(n,i[1].x,i[1].y);)i=i.splice(1,1);if(null==s[d]&&null!=t)for(;1<i.length&&mxUtils.contains(t,i[i.length-1].x,i[i.length-1].y);)i=i.splice(i.length-1,1)},orthBuffer:10,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,OrthConnector:function(e,n,t,a,i){var s=e.view.graph,o=null!=n&&s.getModel().isEdge(n.cell);s=null!=t&&s.getModel().isEdge(t.cell);if(null!=a&&0<a.length||o||s)mxEdgeStyle.SegmentConnector(e,n,t,a,i);else{var r=(a=e.absolutePoints)[0],l=a[a.length-1];a=null!=n?n.x:r.x;o=null!=n?n.y:r.y;var d=null!=n?n.width:1,c=null!=n?n.height:1,m=null!=t?t.x:l.x,u=null!=t?t.y:l.y,p=null!=t?t.width:1,g=null!=t?t.height:1,v=(s=e.view.scale*mxEdgeStyle.orthBuffer,[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL]);for(null!=n&&(v[0]=mxUtils.getPortConstraints(n,e,!0,mxConstants.DIRECTION_MASK_ALL)),null!=t&&(v[1]=mxUtils.getPortConstraints(t,e,!1,mxConstants.DIRECTION_MASK_ALL)),e=[0,0],a=[[a,o,d,c],[m,u,p,g]],d=0;d<2;d++)mxEdgeStyle.limits[d][1]=a[d][0]-s,mxEdgeStyle.limits[d][2]=a[d][1]-s,mxEdgeStyle.limits[d][4]=a[d][0]+a[d][2]+s,mxEdgeStyle.limits[d][8]=a[d][1]+a[d][3]+s;for(d=a[0][0]+a[0][2]/2-(a[1][0]+a[1][2]/2),c=a[0][1]+a[0][3]/2-(a[1][1]+a[1][3]/2),d<(o=0)?o=c<0?2:1:c<=0&&(o=3,0==d&&(o=2)),(c=null)!=n&&(c=r),n=[[.5,.5],[.5,.5]],d=0;d<2;d++)null!=c&&(n[d][0]=(c.x-a[d][0])/a[d][2],n[d][0]<.01?e[d]=mxConstants.DIRECTION_MASK_WEST:.99<n[d][0]&&(e[d]=mxConstants.DIRECTION_MASK_EAST),n[d][1]=(c.y-a[d][1])/a[d][3],n[d][1]<.01?e[d]=mxConstants.DIRECTION_MASK_NORTH:.99<n[d][1]&&(e[d]=mxConstants.DIRECTION_MASK_SOUTH)),(c=null)!=t&&(c=l);for(d=a[0][1]-(a[1][1]+a[1][3]),c=a[0][0]-(a[1][0]+a[1][2]),m=a[1][1]-(a[0][1]+a[0][3]),u=a[1][0]-(a[0][0]+a[0][2]),mxEdgeStyle.vertexSeperations[1]=Math.max(c-2*s,0),mxEdgeStyle.vertexSeperations[2]=Math.max(d-2*s,0),mxEdgeStyle.vertexSeperations[4]=Math.max(m-2*s,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-2*s,0),t=[],l=[],(r=[])[0]=u<=c?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,l[0]=m<=d?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,r[1]=mxUtils.reversePortConstraints(r[0]),l[1]=mxUtils.reversePortConstraints(l[0]),c=u<=c?c:u,m=m<=d?d:m,p=!(u=[[0,0],[0,0]]),d=0;d<2;d++)0==e[d]&&(0==(r[d]&v[d])&&(r[d]=mxUtils.reversePortConstraints(r[d])),0==(l[d]&v[d])&&(l[d]=mxUtils.reversePortConstraints(l[d])),u[d][0]=l[d],u[d][1]=r[d]);for(2*s<m&&2*s<c&&(0<(r[0]&v[0])&&0<(l[1]&v[1])?(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=l[1],u[1][1]=r[1],p=!0):0<(l[0]&v[0])&&0<(r[1]&v[1])&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=r[1],u[1][1]=l[1],p=!0)),2*s<m&&!p&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=l[1],u[1][1]=r[1],p=!0),2*s<c&&!p&&(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=r[1],u[1][1]=l[1]),d=0;d<2;d++)0==e[d]&&(0==(u[d][0]&v[d])&&(u[d][0]=u[d][1]),t[d]=u[d][0]&v[d],t[d]|=(u[d][1]&v[d])<<8,t[d]|=(u[1-d][d]&v[d])<<16,t[d]|=(u[1-d][1-d]&v[d])<<24,0==(15&t[d])&&(t[d]<<=8),0==(3840&t[d])&&(t[d]=15&t[d]|t[d]>>8),0==(983040&t[d])&&(t[d]=65535&t[d]|(251658240&t[d])>>8),e[d]=15&t[d],v[d]==mxConstants.DIRECTION_MASK_WEST||v[d]==mxConstants.DIRECTION_MASK_NORTH||v[d]==mxConstants.DIRECTION_MASK_EAST||v[d]==mxConstants.DIRECTION_MASK_SOUTH)&&(e[d]=v[d]);switch(d=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0],v=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(d-=o)<1&&(d+=4),(v-=o)<1&&(v+=4),v=mxEdgeStyle.routePatterns[d-1][v-1],mxEdgeStyle.wayPoints1[0][0]=a[0][0],mxEdgeStyle.wayPoints1[0][1]=a[0][1],e[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=s,mxEdgeStyle.wayPoints1[0][1]+=n[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=n[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]+=a[0][3]+s;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=a[0][2]+s,mxEdgeStyle.wayPoints1[0][1]+=n[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=n[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]-=s}for(r=t=(s=0)<(e[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,d=l=0;d<v.length;d++){g=(l=15&v[d])==mxConstants.DIRECTION_MASK_EAST?3:l,4<(g+=o)&&(g-=4),c=mxEdgeStyle.dirVectors[g-1],(l=0<g%2?0:1)!=t&&(s++,mxEdgeStyle.wayPoints1[s][0]=mxEdgeStyle.wayPoints1[s-1][0],mxEdgeStyle.wayPoints1[s][1]=mxEdgeStyle.wayPoints1[s-1][1]);var h=0<(v[d]&mxEdgeStyle.TARGET_MASK);p=0<(v[d]&mxEdgeStyle.SOURCE_MASK);15<(m=(m=(v[d]&mxEdgeStyle.SIDE_MASK)>>5)<<o)&&(m>>=4),u=0<(v[d]&mxEdgeStyle.CENTER_MASK),(p||h)&&m<9?(g=0,p=p?0:1,g=u&&0==l?a[p][0]+n[p][0]*a[p][2]:u?a[p][1]+n[p][1]*a[p][3]:mxEdgeStyle.limits[p][m],0==l?0<(m=(g-mxEdgeStyle.wayPoints1[s][0])*c[0])&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*m):0<(m=(g-mxEdgeStyle.wayPoints1[s][1])*c[1])&&(mxEdgeStyle.wayPoints1[s][1]+=c[1]*m)):u&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2),mxEdgeStyle.wayPoints1[s][1]+=c[1]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2)),0<s&&mxEdgeStyle.wayPoints1[s][l]==mxEdgeStyle.wayPoints1[s-1][l]?s--:t=l}for(d=0;d<=s&&(d!=s||((0<(e[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==r?0:1)==(s+1)%2);d++)i.push(new mxPoint(mxEdgeStyle.wayPoints1[d][0],mxEdgeStyle.wayPoints1[d][1]))}},getRoutePattern:function(e,n,t,a){var i=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0];return e=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(i-=n)<1&&(i+=4),(e-=n)<1&&(e+=4),n=routePatterns[i-1][e-1],0!=t&&0!=a||null!=inlineRoutePatterns[i-1][e-1]&&(n=inlineRoutePatterns[i-1][e-1]),n}},mxStyleRegistry={values:[],putValue:function(e,n){mxStyleRegistry.values[e]=n},getValue:function(e){return mxStyleRegistry.values[e]},getName:function(e){for(var n in mxStyleRegistry.values)if(mxStyleRegistry.values[n]==e)return n;return null}};function mxGraphView(e){this.graph=e,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(e,n){if(this.view=e,this.previous=this.root=n,this.isUp=null==n,!this.isUp)for(var t=this.view.currentRoot,a=this.view.graph.getModel();null!=t;){if(t==n){this.isUp=!0;break}t=a.getParent(t)}}function mxGraph(e,n,t,a){this.mouseListeners=null,this.renderHint=t,this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:t==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:t==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:t==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML,this.model=null!=n?n:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=a?a:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(e,n){this.graphModelChanged(n.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=e&&this.init(e),this.view.revalidate()}function mxCellOverlay(e,n,t,a,i,s){this.image=e,this.tooltip=n,this.align=null!=t?t:this.align,this.verticalAlign=null!=a?a:this.verticalAlign,this.offset=null!=i?i:new mxPoint,this.cursor=null!=s?s:"help"}function mxOutline(e,n){this.source=e,null!=n&&this.init(n)}function mxMultiplicity(e,n,t,a,i,s,o,r,l,d){this.source=e,this.type=n,this.attr=t,this.value=a,this.min=null!=i?i:0,this.max=null!=s?s:"n",this.validNeighbors=o,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(l)||l,this.validNeighborsAllowed=null==d||d}function mxLayoutManager(e){this.undoHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.beforeUndo(n.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsMoved(n.getProperty("cells"),n.getProperty("event"))}),this.setGraph(e)}function mxSpaceManager(e,n,t,a){this.resizeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.foldHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.shiftRightwards=null==n||n,this.shiftDownwards=null==t||t,this.extendParents=null==a||a,this.setGraph(e)}function mxSwimlaneManager(e,n,t,a){this.horizontal=null==n||n,this.addEnabled=null==t||t,this.resizeEnabled=null==a||a,this.addHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(n.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.setGraph(e)}function mxTemporaryCellStates(e,n,t){if(this.view=e,n=null!=n?n:1,this.oldBounds=e.getGraphBounds(),this.oldStates=e.getStates(),this.oldScale=e.getScale(),e.setStates(new mxDictionary),e.setScale(n),null!=t){n=e.createState(new mxCell);for(var a=0;a<t.length;a++)e.validateBounds(n,t[a]);var i=null;for(a=0;a<t.length;a++){var s=e.validatePoints(n,t[a]);null==i?i=s:i.add(s)}null==i&&(i=new mxRectangle),e.setGraphBounds(i)}}function mxCellStatePreview(e){this.graph=e,this.deltas={}}function mxConnectionConstraint(e,n){this.point=e,this.perimeter=null==n||n}function mxGraphHandler(e){this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape()}),this.graph.addListener(mxEvent.PAN,this.panHandler)}function mxPanningHandler(e,n){null!=e&&(this.graph=e,this.factoryMethod=n,this.graph.addMouseListener(this),this.init())}function mxCellMarker(e,n,t,a){mxEventSource.call(this),null!=e&&(this.graph=e,this.validColor=null!=n?n:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=n?t:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=a?a:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(e))}function mxSelectionCellsHandler(e){mxEventSource.call(this),this.graph=e,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(e,n){mxEventSource.call(this),null!=e&&(this.graph=e,this.factoryMethod=n,this.init())}function mxConstraintHandler(e){this.graph=e}function mxRubberband(e){null!=e&&(this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxVertexHandler(e){null!=e&&(this.state=e,this.init())}function mxEdgeHandler(e){null!=e&&(this.state=e,this.init())}function mxElbowEdgeHandler(e){mxEdgeHandler.call(this,e)}function mxEdgeSegmentHandler(e){mxEdgeHandler.call(this,e)}function mxKeyHandler(e,n){null!=e&&(this.graph=e,this.target=n||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],mxEvent.addListener(this.target,"keydown",mxUtils.bind(this,function(e){this.keyDown(e)})),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(e,n){null!=e&&(this.graph=e,this.delay=n||500,this.graph.addMouseListener(this))}function mxCellTracker(e,n,t){mxCellMarker.call(this,e,n),this.graph.addMouseListener(this),null!=t&&(this.getCell=t),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(e,n,t,a){null!=e&&(this.graph=e,this.highlightColor=null!=n?n:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=t?t:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=a&&a,this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(n){if(null!=n){this.editor=n,this.handler=new mxKeyHandler(n.graph);var t=this.handler.escape;this.handler.escape=function(e){t.apply(this,arguments),n.hideProperties(),n.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",e))}}}function mxDefaultPopupMenu(e){this.config=e}function mxDefaultToolbar(e,n){this.editor=n,null!=e&&null!=n&&this.init(e)}function mxEditor(e){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(e),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,!mxClient.IS_LOCAL&&null!=this.urlInit&&(this.session=this.createSession()),null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(e){this.graphBounds=e},mxGraphView.prototype.getBounds=function(e){var n=null;if(null!=e&&0<e.length)for(var t=this.graph.getModel(),a=0;a<e.length;a++)if(t.isVertex(e[a])||t.isEdge(e[a])){var i=this.getState(e[a]);null!=i&&(null==n?n=new mxRectangle(i.x,i.y,i.width,i.height):n.add(i))}return n},mxGraphView.prototype.setCurrentRoot=function(e){if(this.currentRoot!=e){var n=new mxCurrentRootChange(this,e);n.execute();var t=new mxUndoableEdit(this,!1);t.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)),this.graph.sizeDidChange()}return e},mxGraphView.prototype.scaleAndTranslate=function(e,n,t){var a=this.scale,i=new mxPoint(this.translate.x,this.translate.y);this.scale==e&&this.translate.x==n&&this.translate.y==t||(this.scale=e,this.translate.x=n,this.translate.y=t,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",e,"previousScale",a,"translate",this.translate,"previousTranslate",i))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(e){var n=this.scale;this.scale!=e&&(this.scale=e,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",e,"previousScale",n))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(e,n){var t=new mxPoint(this.translate.x,this.translate.y);this.translate.x==e&&this.translate.y==n||(this.translate.x=e,this.translate.y=n,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",t))},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(e,n,t){var a=this.graph.getModel();if(e=e||a.getRoot(),n=null!=n&&n,t=null==t||t,this.removeState(e),t&&(n||e!=this.currentRoot)){t=a.getChildCount(e);for(var i=0;i<t;i++)this.clear(a.getChildAt(e,i),n)}else this.invalidate(e)},mxGraphView.prototype.invalidate=function(e,n,t,a){var i=this.graph.getModel();if(e=e||i.getRoot(),n=null==n||n,t=null==t||t,a=null!=a&&a,null!=(o=this.getState(e))&&(o.invalid=!0,a&&(o.orderChanged=!0)),n)for(var s=i.getChildCount(e),o=0;o<s;o++){var r=i.getChildAt(e,o);this.invalidate(r,n,t,a)}if(t)for(a=i.getEdgeCount(e),o=0;o<a;o++)this.invalidate(i.getEdgeAt(e,o),n,t)},mxGraphView.prototype.validate=function(e){var n=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;var t=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode||mxClient.IS_QUIRKS)){t=this.canvas.style.display,this.canvas.style.display="none";var a=document.createElement("div");a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",document.body.appendChild(a),this.textDiv=a}e=e||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()),this.validateBounds(null,e),null==(e=this.validatePoints(null,e))&&(e=new mxRectangle),this.setGraphBounds(e),this.validateBackground(),null!=t&&(this.canvas.style.display=t,document.body.removeChild(this.textDiv),this.textDiv=null),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",n)},mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,"white","black")},mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var n=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(n,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);this.graph.pageVisible?(n=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(n),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=n,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.graph.pageFormat,n=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,e.width*n,e.height*n)},mxGraphView.prototype.redrawBackgroundImage=function(e,n){e.scale=this.scale,e.bounds.x=this.scale*this.translate.x,e.bounds.y=this.scale*this.translate.y,e.bounds.width=this.scale*n.width,e.bounds.height=this.scale*n.height,e.redraw()},mxGraphView.prototype.validateBounds=function(e,n){var t=this.graph.getModel(),a=this.getState(n,!0);if(null!=a&&a.invalid){if(this.graph.isCellVisible(n)){if(n!=this.currentRoot&&null!=e)if(a.absoluteOffset.x=0,a.absoluteOffset.y=0,a.origin.x=e.origin.x,a.origin.y=e.origin.y,null!=(s=this.graph.getCellGeometry(n))){if(!t.isEdge(n)){var i=s.offset||this.EMPTY_POINT;s.relative?(a.origin.x+=s.x*e.width/this.scale+i.x,a.origin.y+=s.y*e.height/this.scale+i.y):(a.absoluteOffset.x=this.scale*i.x,a.absoluteOffset.y=this.scale*i.y,a.origin.x+=s.x,a.origin.y+=s.y)}if(a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*s.width,a.height=this.scale*s.height,t.isVertex(n)){if(s.relative&&0!=(i=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"))){var s=Math.cos(i),o=(i=Math.sin(i),new mxPoint(a.getCenterX(),a.getCenterY())),r=new mxPoint(e.getCenterX(),e.getCenterY());s=mxUtils.getRotatedPoint(o,s,i,r);a.x=s.x-a.width/2,a.y=s.y-a.height/2}this.updateVertexLabelOffset(a)}}}else this.removeState(n);null!=(i=this.graph.getChildOffsetForCell(n))&&(a.origin.x+=i.x,a.origin.y+=i.y)}if(null!=a&&(!this.graph.isCellCollapsed(n)||n==this.currentRoot))for(s=t.getChildCount(n),i=0;i<s;i++)o=t.getChildAt(n,i),this.validateBounds(a,o)},mxGraphView.prototype.updateVertexLabelOffset=function(e){var n=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);n==mxConstants.ALIGN_LEFT?e.absoluteOffset.x-=e.width:n==mxConstants.ALIGN_RIGHT&&(e.absoluteOffset.x+=e.width),(n=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?e.absoluteOffset.y-=e.height:n==mxConstants.ALIGN_BOTTOM&&(e.absoluteOffset.y+=e.height)},mxGraphView.prototype.validatePoints=function(e,n){var t=this.graph.getModel(),a=this.getState(n),i=null;if(null!=a){if(a.invalid){var s=this.graph.getCellGeometry(n);if(null!=s&&t.isEdge(n)){var o=this.getState(this.getVisibleTerminal(n,!0));if(a.setVisibleTerminalState(o,!0),null!=o&&t.isEdge(o.cell)&&!t.isAncestor(o.cell,n)){var r=this.getState(t.getParent(o.cell));this.validatePoints(r,o.cell)}var l=this.getState(this.getVisibleTerminal(n,!1));a.setVisibleTerminalState(l,!1),null!=l&&t.isEdge(l.cell)&&!t.isAncestor(l.cell,n)&&(r=this.getState(t.getParent(l.cell)),this.validatePoints(r,l.cell)),this.updateFixedTerminalPoints(a,o,l),this.updatePoints(a,s.points,o,l),this.updateFloatingTerminalPoints(a,o,l),this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)}else null!=s&&s.relative&&null!=e&&t.isEdge(e.cell)&&(null!=(s=this.getPoint(e,s))&&(a.x=s.x,a.y=s.y,s.x=s.x/this.scale-this.translate.x,s.y=s.y/this.scale-this.translate.y,a.origin=s,this.childMoved(e,a)));a.invalid=!1,n!=this.currentRoot&&this.graph.cellRenderer.redraw(a,!1,this.isRendering())}(t.isEdge(n)||t.isVertex(n))&&(null!=a.shape&&null!=a.shape.boundingBox&&(i=a.shape.boundingBox.clone()),null!=a.text&&!this.graph.isLabelClipped(a.cell)&&null!=a.text.boundingBox&&(null!=i?i.add(a.text.boundingBox):i=a.text.boundingBox.clone()))}if(null!=a&&(!this.graph.isCellCollapsed(n)||n==this.currentRoot))for(s=t.getChildCount(n),o=0;o<s;o++)r=t.getChildAt(n,o),null!=(r=this.validatePoints(a,r))&&(null==i?i=r:i.add(r));return i},mxGraphView.prototype.childMoved=function(e,n){var t=n.cell;if(!this.graph.isCellCollapsed(t)||t==this.currentRoot)for(var a=this.graph.getModel(),i=a.getChildCount(t),s=0;s<i;s++)this.validateBounds(n,a.getChildAt(t,s))},mxGraphView.prototype.updateFixedTerminalPoints=function(e,n,t){this.updateFixedTerminalPoint(e,n,!0,this.graph.getConnectionConstraint(e,n,!0)),this.updateFixedTerminalPoint(e,t,!1,this.graph.getConnectionConstraint(e,t,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(e,n,t,a){var i=null;if(null!=a&&(i=this.graph.getConnectionPoint(n,a)),null==i&&null==n){n=this.scale,a=this.translate;var s=e.origin;null!=(i=this.graph.getCellGeometry(e.cell).getTerminalPoint(t))&&(i=new mxPoint(n*(a.x+i.x+s.x),n*(a.y+i.y+s.y)))}e.setAbsoluteTerminalPoint(i,t)},mxGraphView.prototype.updatePoints=function(e,n,t,a){if(null!=e){var i=[];i.push(e.absolutePoints[0]);var s=this.getEdgeStyle(e,n,t,a);if(null!=s)s(e,t=this.getTerminalPort(e,t,!0),a=this.getTerminalPort(e,a,!1),n,i);else if(null!=n)for(s=0;s<n.length;s++)null!=n[s]&&(a=mxUtils.clone(n[s]),i.push(this.transformControlPoint(e,a)));n=e.absolutePoints,i.push(n[n.length-1]),e.absolutePoints=i}},mxGraphView.prototype.transformControlPoint=function(e,n){var t=e.origin;return new mxPoint(this.scale*(n.x+this.translate.x+t.x),this.scale*(n.y+this.translate.y+t.y))},mxGraphView.prototype.getEdgeStyle=function(e,n,t,a){return"string"==typeof(e=null!=t&&t==a?mxUtils.getValue(e.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(e.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:e.style[mxConstants.STYLE_EDGE])&&(null==(n=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n),"function"==typeof e?e:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(e,n,t){var a=e.absolutePoints,i=a[0];null==a[a.length-1]&&null!=t&&this.updateFloatingTerminalPoint(e,t,n,!1),null==i&&null!=n&&this.updateFloatingTerminalPoint(e,n,t,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(e,n,t,a){n=this.getTerminalPort(e,n,a);var i=this.getNextPoint(e,t,a),s=this.graph.isOrthogonal(e);t=mxUtils.toRadians(Number(n.style[mxConstants.STYLE_ROTATION]||"0"));var o=new mxPoint(n.getCenterX(),n.getCenterY());if(0!=t){var r=Math.cos(-t),l=Math.sin(-t);i=mxUtils.getRotatedPoint(i,r,l,o)}r=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0),r+=parseFloat(e.style[a?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),n=this.getPerimeterPoint(n,i,0==t&&s,r),0!=t&&(r=Math.cos(t),l=Math.sin(t),n=mxUtils.getRotatedPoint(n,r,l,o)),e.setAbsoluteTerminalPoint(n,a)},mxGraphView.prototype.getTerminalPort=function(e,n,t){return null!=(e=mxUtils.getValue(e.style,t?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT))&&(null!=(e=this.getState(this.graph.getModel().getCell(e)))&&(n=e)),n},mxGraphView.prototype.getPerimeterPoint=function(e,n,t,a){var i=null;if(null!=e){var s=this.getPerimeterFunction(e);null!=s&&null!=n&&(0<(a=this.getPerimeterBounds(e,a)).width||0<a.height)&&(i=s(a,e,n,t)),null==i&&(i=this.getPoint(e))}return i},mxGraphView.prototype.getRoutingCenterX=function(e){var n=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return e.getCenterX()+n*e.width},mxGraphView.prototype.getRoutingCenterY=function(e){var n=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return e.getCenterY()+n*e.height},mxGraphView.prototype.getPerimeterBounds=function(e,n){return n=null!=n?n:0,null!=e&&(n+=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),e.getPerimeterBounds(n*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(e){if("string"==typeof(e=e.style[mxConstants.STYLE_PERIMETER])){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(e,n,t){var a=null;return null!=(e=e.absolutePoints)&&(t||2<e.length||null==n)&&(a=e.length,a=e[t?Math.min(1,a-1):Math.max(0,a-2)]),null==a&&null!=n&&(a=new mxPoint(n.getCenterX(),n.getCenterY())),a},mxGraphView.prototype.getVisibleTerminal=function(e,n){for(var t=this.graph.getModel(),a=t.getTerminal(e,n),i=a;null!=a&&a!=this.currentRoot;)this.graph.isCellVisible(i)&&!this.graph.isCellCollapsed(a)||(i=a),a=t.getParent(a);return t.getParent(i)==t.getRoot()&&(i=null),i},mxGraphView.prototype.updateEdgeBounds=function(e){var n=e.absolutePoints;if(e.length=0,null!=n&&0<n.length){var t=n[0],a=n[n.length-1];if(null==t||null==a)e.cell!=this.currentRoot&&this.clear(e.cell,!0);else{if(t.x!=a.x||t.y!=a.y){var i=a.x-t.x,s=a.y-t.y;e.terminalDistance=Math.sqrt(i*i+s*s)}else e.terminalDistance=0;a=0;var o=[];if(null!=(s=t)){t=s.x;for(var r=s.y,l=t,d=r,c=1;c<n.length;c++){var m=n[c];null!=m&&(i=s.x-m.x,s=s.y-m.y,i=Math.sqrt(i*i+s*s),o.push(i),a+=i,s=m,t=Math.min(s.x,t),r=Math.min(s.y,r),l=Math.max(s.x,l),d=Math.max(s.y,d))}e.length=a,e.segments=o,e.x=t,e.y=r,e.width=Math.max(1,l-t),e.height=Math.max(1,d-r)}}}},mxGraphView.prototype.getPoint=function(e,n){var t=e.getCenterX(),a=e.getCenterY();if(null==e.segments||null!=n&&!n.relative)null!=n&&(null!=(d=n.offset)&&(t+=d.x,a+=d.y));else{for(var i=e.absolutePoints.length,s=(.5+(null!=n?n.x/2:0))*e.length,o=e.segments[0],r=0,l=1;r+o<s&&l<i-1;)r+=o,o=e.segments[l++];if(i=0==o?0:(s-r)/o,s=e.absolutePoints[l-1],l=e.absolutePoints[l],null!=s&&null!=l){if(r=t=a=0,null!=n){a=n.y;var d=n.offset;null!=d&&(t=d.x,r=d.y)}d=l.x-s.x,l=l.y-s.y,t=s.x+d*i+((0==o?0:l/o)*a+t)*this.scale,a=s.y+l*i-((0==o?0:d/o)*a-r)*this.scale}}return new mxPoint(t,a)},mxGraphView.prototype.getRelativePoint=function(e,n,t){if(null!=(i=this.graph.getModel().getGeometry(e.cell))){var a=e.absolutePoints.length;if(i.relative&&1<a){for(var i=e.length,s=e.segments,o=e.absolutePoints[0],r=e.absolutePoints[1],l=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t),d=0,c=0,m=0,u=2;u<a;u++)c+=s[u-2],r=e.absolutePoints[u],(o=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t))<=l&&(l=o,d=u-1,m=c),o=r;return a=s[d],o=e.absolutePoints[d],l=(r=e.absolutePoints[d+1]).x,s=r.y,s=(l=(e=o.x-l)-(l=n-l))*e+(s=(d=o.y-s)-(s=t-s))*d,a<(e=Math.sqrt(s<=0?0:s*s/(e*e+d*d)))&&(e=a),a=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t)),-1==mxUtils.relativeCcw(o.x,o.y,r.x,r.y,n,t)&&(a=-a),new mxPoint((i/2-m-e)/i*-2,a/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(e){var n=e.absolutePoints;if(e.absoluteOffset.x=e.getCenterX(),e.absoluteOffset.y=e.getCenterY(),null!=n&&0<n.length&&null!=e.segments)if((i=this.graph.getCellGeometry(e.cell)).relative){null!=(t=this.getPoint(e,i))&&(e.absoluteOffset=t)}else{var t=n[0],a=n[n.length-1];if(null!=t&&null!=a){n=a.x-t.x;var i,s=a.y-t.y,o=a=0;null!=(i=i.offset)&&(a=i.x,o=i.y),i=t.y+s/2+o*this.scale,e.absoluteOffset.x=t.x+n/2+a*this.scale,e.absoluteOffset.y=i}}},mxGraphView.prototype.getState=function(e,n){n=n||!1;var t=null;return null!=e&&(t=this.states.get(e),this.graph.isCellVisible(e)&&(null==t&&n&&this.graph.isCellVisible(e)?(t=this.createState(e),this.states.put(e,t)):n&&null!=t&&this.updateStyle&&(t.style=this.graph.getCellStyle(e)))),t},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(e){this.rendering=e},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(e){this.allowEval=e},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(e){this.states=e},mxGraphView.prototype.getCellStates=function(e){if(null==e)return this.states;for(var n=[],t=0;t<e.length;t++){var a=this.getState(e[t]);null!=a&&n.push(a)}return n},mxGraphView.prototype.removeState=function(e){var n=null;return null!=e&&(null!=(n=this.states.remove(e))&&(this.graph.cellRenderer.destroy(n),n.destroy())),n},mxGraphView.prototype.createState=function(e){var n=this.graph.getCellStyle(e);return e=new mxCellState(this,e,n),this.graph.cellRenderer.initialize(e,this.isRendering()),e},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.isContainerEvent=function(e){return(e=mxEvent.getSource(e))==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane},mxGraphView.prototype.isScrollEvent=function(e){var n=mxUtils.getOffset(this.graph.container);e=new mxPoint(e.clientX-n.x,e.clientY-n.y);n=this.graph.container.offsetWidth;var t=this.graph.container.clientWidth;return t<n&&e.x>t+2&&e.x<=n||(n=this.graph.container.offsetHeight,(t=this.graph.container.clientHeight)<n&&e.y>t+2&&e.y<=n)},mxGraphView.prototype.init=function(){this.installListeners();var e=this.graph;e.dialect==mxConstants.DIALECT_SVG?this.createSvg():e.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var a=this.graph,i=a.container;if(null!=i){mxEvent.addGestureListeners(i,mxUtils.bind(this,function(e){mxClient.IS_TOUCH&&a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addListener(i,"dblclick",mxUtils.bind(this,function(e){a.dblClick(e)}));a.addMouseListener({mouseDown:function(e,n){a.panningHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(e){var n,t;null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide(),this.captureDocumentGesture&&a.isMouseDown&&!mxEvent.isConsumed(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,(n=e,t=null,mxClient.IS_TOUCH&&(t=mxEvent.getClientX(n),n=mxEvent.getClientY(n),n=mxUtils.convertPoint(i,t,n),t=a.view.getState(a.getCellAt(n.x,n.y))),t)))}),this.endHandler=mxUtils.bind(this,function(e){this.captureDocumentGesture&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var e=this.graph.container;null!=e&&(this.canvas=this.createHtmlPane("100%","100%"),this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas),mxClient.IS_QUIRKS&&(e=mxUtils.bind(this,function(e){e=this.getGraphBounds(),this.updateHtmlCanvasSize(e.x+e.width+this.graph.border,e.y+e.height+this.graph.border)}),mxEvent.addListener(window,"resize",e)))},mxGraphView.prototype.updateHtmlCanvasSize=function(e,n){if(null!=this.graph.container){var t=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<e?e+"px":"100%",this.canvas.style.height=t<n?n+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(e,n){var t=document.createElement("DIV");return null!=e&&null!=n?(t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width=e,t.style.height=n):t.style.position="relative",t},mxGraphView.prototype.createVml=function(){var e=this.graph.container;if(null!=e){var n=e.offsetWidth,t=e.offsetHeight;this.canvas=this.createVmlPane(n,t),this.backgroundPane=this.createVmlPane(n,t),this.drawPane=this.createVmlPane(n,t),this.overlayPane=this.createVmlPane(n,t),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(e,n){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width=e+"px",t.style.height=n+"px",t.setAttribute("coordsize",e+","+n),t.setAttribute("coordorigin","0,0"),t},mxGraphView.prototype.createSvg=function(){var e=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane);var n=document.createElementNS(mxConstants.NS_SVG,"svg");n.style.width="100%",n.style.height="100%",n.style.display="block",n.appendChild(this.canvas),null!=e&&(e.appendChild(n),"static"==mxUtils.getCurrentStyle(e).position&&(e.style.position="relative"))},mxGraphView.prototype.destroy=function(){var e=null!=this.canvas?this.canvas.ownerSVGElement:null;null==e&&(e=this.canvas),null!=e&&null!=e.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),e.parentNode.removeChild(e),this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)},mxCurrentRootChange.prototype.execute=function(){var e=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=e,null!=(e=this.view.graph.getTranslateForRoot(this.view.currentRoot))&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh(),this.isUp=!this.isUp},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.EMPTY_ARRAY=[],mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=700,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.gestureEnabled=!0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.ordered=!0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!0,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage("/assets/plugins/mxgraph/images/warning.gif",16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(e){this.container=e,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(e,"selectstart",mxUtils.bind(this,function(){return this.isEditing()}))),8==document.documentMode&&e.insertAdjacentHTML("beforeend",'<v:group style="DISPLAY: none;"></v:group>')},mxGraph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(e){this.stylesheet=e},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(e){this.selectionModel=e},mxGraph.prototype.getSelectionCellsForChanges=function(e){for(var n=[],t=0;t<e.length;t++){var a=e[t];if(a.constructor!=mxRootChange){var i=null;a instanceof mxChildChange&&null==a.previous?i=a.child:null!=a.cell&&a.cell instanceof mxCell&&(i=a.cell),null!=i&&mxUtils.indexOf(n,i)<0&&n.push(i)}}return this.getModel().getTopmostCells(n)},mxGraph.prototype.graphModelChanged=function(e){for(var n=0;n<e.length;n++)this.processChange(e[n]);this.removeSelectionCells(this.getRemovedCellsForChanges(e)),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.getRemovedCellsForChanges=function(e){for(var n=[],t=0;t<e.length;t++){var a=e[t];if(a instanceof mxRootChange)break;a instanceof mxChildChange?null!=a.previous&&null==a.parent&&(n=n.concat(this.model.getDescendants(a.child))):a instanceof mxVisibleChange&&(n=n.concat(this.model.getDescendants(a.cell)))}return n},mxGraph.prototype.processChange=function(e){if(e instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(e.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(e instanceof mxChildChange){var n=this.model.getParent(e.child);null!=n?this.view.invalidate(e.child,!0,!1,null!=e.previous):(this.removeStateForCell(e.child),this.view.currentRoot==e.child&&this.home()),n!=e.previous&&(null!=n&&this.view.invalidate(n,!1,!1),null!=e.previous&&this.view.invalidate(e.previous,!1,!1))}else e instanceof mxTerminalChange||e instanceof mxGeometryChange?this.view.invalidate(e.cell):e instanceof mxValueChange?this.view.invalidate(e.cell,!1,!1):e instanceof mxStyleChange?(this.view.invalidate(e.cell,!0,!0,!1),this.view.removeState(e.cell)):null!=e.cell&&e.cell instanceof mxCell&&this.removeStateForCell(e.cell)},mxGraph.prototype.removeStateForCell=function(e){for(var n=this.model.getChildCount(e),t=0;t<n;t++)this.removeStateForCell(this.model.getChildAt(e,t));this.view.removeState(e)},mxGraph.prototype.addCellOverlay=function(e,n){null==e.overlays&&(e.overlays=[]),e.overlays.push(n);var t=this.view.getState(e);return null!=t&&this.cellRenderer.redraw(t),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",e,"overlay",n)),n},mxGraph.prototype.getCellOverlays=function(e){return e.overlays},mxGraph.prototype.removeCellOverlay=function(e,n){if(null==n)this.removeCellOverlays(e);else{var t=mxUtils.indexOf(e.overlays,n);0<=t?(e.overlays.splice(t,1),0==e.overlays.length&&(e.overlays=null),null!=(t=this.view.getState(e))&&this.cellRenderer.redraw(t),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",n))):n=null}return n},mxGraph.prototype.removeCellOverlays=function(e){var n=e.overlays;if(null!=n){e.overlays=null;var t=this.view.getState(e);for(null!=t&&this.cellRenderer.redraw(t),t=0;t<n.length;t++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",n[t]))}return n},mxGraph.prototype.clearCellOverlays=function(e){e=null!=e?e:this.model.getRoot(),this.removeCellOverlays(e);for(var n=this.model.getChildCount(e),t=0;t<n;t++){var a=this.model.getChildAt(e,t);this.clearCellOverlays(a)}},mxGraph.prototype.setCellWarning=function(t,e,n,a){return null!=e&&0<e.length?(e=new mxCellOverlay(n=null!=n?n:this.warningImage,"<font color=red>"+e+"</font>"),a&&e.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,n){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,e)):(this.removeCellOverlays(t),null)},mxGraph.prototype.startEditing=function(e){this.startEditingAtCell(null,e)},mxGraph.prototype.startEditingAtCell=function(e,n){null==e&&(null!=(e=this.getSelectionCell())&&!this.isCellEditable(e)&&(e=null)),null!=e&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",e,"event",n)),this.cellEditor.startEditing(e,n))},mxGraph.prototype.getEditingValue=function(e,n){return this.convertValueToString(e)},mxGraph.prototype.stopEditing=function(e){this.cellEditor.stopEditing(e)},mxGraph.prototype.labelChanged=function(e,n,t){this.model.beginUpdate();try{this.cellLabelChanged(e,n,this.isAutoSizeCell(e)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",e,"value",n,"event",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellLabelChanged=function(e,n,t){this.model.beginUpdate();try{this.model.setValue(e,n),t&&this.cellSizeUpdated(e,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(e){this.stopEditing(!0),this.connectionHandler.reset(),this.graphHandler.reset(),e=this.getSelectionCells();for(var n=0;n<e.length;n++){var t=this.view.getState(e[n]);null!=t&&null!=t.handler&&t.handler.reset()}},mxGraph.prototype.click=function(e){var n=e.getEvent(),t=e.getCell(),a=new mxEventObject(mxEvent.CLICK,"event",n,"cell",t);e.isConsumed()&&a.consume(),this.fireEvent(a),this.isEnabled()&&!mxEvent.isConsumed(n)&&!a.isConsumed()&&(null!=t?this.selectCellForEvent(t,n):(t=null,this.isSwimlaneSelectionEnabled()&&(t=this.getSwimlaneAt(e.getGraphX(),e.getGraphY())),null!=t?this.selectCellForEvent(t,n):this.isToggleEvent(n)||this.clearSelection()))},mxGraph.prototype.dblClick=function(e,n){var t=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",n);this.fireEvent(t),this.isEnabled()&&!mxEvent.isConsumed(e)&&!t.isConsumed()&&null!=n&&this.isCellEditable(n)&&this.startEditingAtCell(n,e)},mxGraph.prototype.scrollPointToVisible=function(e,n,t,a){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.active&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(e+this.panDx,n+this.panDy));else{var i=this.container;if(a=null!=a?a:20,e>=i.scrollLeft&&n>=i.scrollTop&&e<=i.scrollLeft+i.clientWidth&&n<=i.scrollTop+i.clientHeight){var s=i.scrollLeft+i.clientWidth-e;if(s<a){if(e=i.scrollLeft,i.scrollLeft+=a-s,t&&e==i.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){e=this.view.getDrawPane().ownerSVGElement;var o=this.container.scrollWidth+a-s}else o=Math.max(i.clientWidth,i.scrollWidth)+a-s,e=this.view.getCanvas();e.style.width=o+"px",i.scrollLeft+=a-s}}else(s=e-i.scrollLeft)<a&&(i.scrollLeft-=a-s);(s=i.scrollTop+i.clientHeight-n)<a?(e=i.scrollTop,i.scrollTop+=a-s,e==i.scrollTop&&t&&(this.dialect==mxConstants.DIALECT_SVG?(e=this.view.getDrawPane().ownerSVGElement,n=this.container.scrollHeight+a-s):(n=Math.max(i.clientHeight,i.scrollHeight)+a-s,e=this.view.getCanvas()),e.style.height=n+"px",i.scrollTop+=a-s)):(s=n-i.scrollTop)<a&&(i.scrollTop-=a-s)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){function e(e){var n=0;n="thin"==e?2:"medium"==e?4:"thick"==e?6:parseInt(e);return isNaN(n)&&(n=0),n}var n=mxUtils.getCurrentStyle(this.container),t=new mxRectangle;return t.x=e(n.borderLeftWidth)+parseInt(n.paddingLeft||0),t.y=e(n.borderTopWidth)+parseInt(n.paddingTop||0),t.width=e(n.borderRightWidth)+parseInt(n.paddingRight||0),t.height=e(n.borderBottomWidth)+parseInt(n.paddingBottom||0),t},mxGraph.prototype.getPreferredPageSize=function(e,n,t){e=this.view.scale;var a=this.view.translate,i=this.pageFormat,s=e*this.pageScale;i=new mxRectangle(0,0,i.width*s,i.height*s);return n=this.pageBreaksVisible?Math.ceil(n/i.width):1,t=this.pageBreaksVisible?Math.ceil(t/i.height):1,new mxRectangle(0,0,n*i.width+2+a.x/e,t*i.height+2+a.y/e)},mxGraph.prototype.sizeDidChange=function(){var e=this.getGraphBounds();if(null!=this.container){var n=this.getBorder(),t=Math.max(0,e.x+e.width+1+n);n=Math.max(0,e.y+e.height+1+n);if(null!=this.minimumContainerSize&&(t=Math.max(t,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(t,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var a=this.getPreferredPageSize(e,t,n);null!=a&&(t=a.width,n=a.height)}null!=this.minimumGraphSize&&(t=Math.max(t,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),t=Math.ceil(t-1),n=Math.ceil(n-1),this.dialect==mxConstants.DIALECT_SVG?((a=this.view.getDrawPane().ownerSVGElement).style.minWidth=Math.max(1,t)+"px",a.style.minHeight=Math.max(1,n)+"px",a.style.width="100%",a.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,t),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,t)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px"),this.updatePageBreaks(this.pageBreaksVisible,t-1,n-1)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(e,n){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var t=this.getBorderSizes();e+=Math.max(2,t.x+t.width+1),n+=Math.max(2,t.y+t.height+1)}else 9<=document.documentMode?(e+=3,n+=5):(e+=1,n+=1);else n+=1;null!=this.maximumContainerSize&&(e=Math.min(this.maximumContainerSize.width,e),n=Math.min(this.maximumContainerSize.height,n)),this.container.style.width=Math.ceil(e)+"px",this.container.style.height=Math.ceil(n)+"px"},mxGraph.prototype.updatePageBreaks=function(e,n,t){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale;i=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o);if(e=e&&Math.min(i.width,i.height)>this.minPageBreakDist,i.x=mxUtils.mod(i.x,i.width),i.y=mxUtils.mod(i.y,i.height),s=e?Math.ceil((n-i.x)/i.width):0,e=e?Math.ceil((t-i.y)/i.height):0,null==this.horizontalPageBreaks&&0<s&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(o=0;o<=s;o++){var r=[new mxPoint(i.x+o*i.width,1),new mxPoint(i.x+o*i.width,t)];null!=this.horizontalPageBreaks[o]?(this.horizontalPageBreaks[o].scale=1,this.horizontalPageBreaks[o].points=r,this.horizontalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,this.scale)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.horizontalPageBreaks[o]=r)}for(o=s;o<this.horizontalPageBreaks.length;o++)this.horizontalPageBreaks[o].destroy();this.horizontalPageBreaks.splice(s,this.horizontalPageBreaks.length-s)}if(null==this.verticalPageBreaks&&0<e&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(o=0;o<=e;o++)r=[new mxPoint(1,i.y+o*i.height),new mxPoint(n,i.y+o*i.height)],null!=this.verticalPageBreaks[o]?(this.verticalPageBreaks[o].scale=1,this.verticalPageBreaks[o].points=r,this.verticalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,a)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.verticalPageBreaks[o]=r);for(o=e;o<this.verticalPageBreaks.length;o++)this.verticalPageBreaks[o].destroy();this.verticalPageBreaks.splice(e,this.verticalPageBreaks.length-e)}},mxGraph.prototype.getCellStyle=function(e){var n=this.model.getStyle(e),t=null;t=this.model.isEdge(e)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=n&&(t=this.postProcessCellStyle(this.stylesheet.getCellStyle(n,t))),null==t&&(t=mxGraph.prototype.EMPTY_ARRAY),t},mxGraph.prototype.postProcessCellStyle=function(e){if(null!=e){var n=e[mxConstants.STYLE_IMAGE],t=this.getImageFromBundles(n);null!=t?e[mxConstants.STYLE_IMAGE]=t:t=n,null!=t&&"data:image/"==t.substring(0,11)&&(0<(n=t.indexOf(","))&&(t=t.substring(0,n)+";base64,"+t.substring(n+1)),e[mxConstants.STYLE_IMAGE]=t)}return e},mxGraph.prototype.setCellStyle=function(e,n){if(null!=(n=n||this.getSelectionCells())){this.model.beginUpdate();try{for(var t=0;t<n.length;t++)this.model.setStyle(n[t],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(e,n,t){t=t||this.getSelectionCell(),this.toggleCellStyles(e,n,[t])},mxGraph.prototype.toggleCellStyles=function(e,n,t){var a;(n=null!=n&&n,null!=(t=t||this.getSelectionCells())&&0<t.length)&&(null!=(a=null!=(a=this.view.getState(t[0]))?a.style:this.getCellStyle(t[0]))&&(n=mxUtils.getValue(a,e,n)?0:1,this.setCellStyles(e,n,t)))},mxGraph.prototype.setCellStyles=function(e,n,t){t=t||this.getSelectionCells(),mxUtils.setCellStyles(this.model,t,e,n)},mxGraph.prototype.toggleCellStyleFlags=function(e,n,t){this.setCellStyleFlags(e,n,null,t)},mxGraph.prototype.setCellStyleFlags=function(e,n,t,a){if(null!=(a=a||this.getSelectionCells())&&0<a.length){var i;if(null==t)null!=(i=null!=(i=this.view.getState(a[0]))?i.style:this.getCellStyle(a[0]))&&(t=(parseInt(i[e]||0)&n)!=n);mxUtils.setCellStyleFlags(this.model,a,e,n,t)}},mxGraph.prototype.alignCells=function(e,n,t){if(null==n&&(n=this.getSelectionCells()),null!=n&&1<n.length){if(null==t)for(var a=0;a<n.length;a++){var i=this.getCellGeometry(n[a]);if(null!=i&&!this.model.isEdge(n[a]))if(null==t){if(e==mxConstants.ALIGN_CENTER){t=i.x+i.width/2;break}if(e==mxConstants.ALIGN_RIGHT)t=i.x+i.width;else if(e==mxConstants.ALIGN_TOP)t=i.y;else{if(e==mxConstants.ALIGN_MIDDLE){t=i.y+i.height/2;break}t=e==mxConstants.ALIGN_BOTTOM?i.y+i.height:i.x}}else t=e==mxConstants.ALIGN_RIGHT?Math.max(t,i.x+i.width):e==mxConstants.ALIGN_TOP?Math.min(t,i.y):e==mxConstants.ALIGN_BOTTOM?Math.max(t,i.y+i.height):Math.min(t,i.x)}if(null!=t){this.model.beginUpdate();try{for(a=0;a<n.length;a++)null!=(i=this.getCellGeometry(n[a]))&&!this.model.isEdge(n[a])&&(i=i.clone(),e==mxConstants.ALIGN_CENTER?i.x=t-i.width/2:e==mxConstants.ALIGN_RIGHT?i.x=t-i.width:e==mxConstants.ALIGN_TOP?i.y=t:e==mxConstants.ALIGN_MIDDLE?i.y=t-i.height/2:e==mxConstants.ALIGN_BOTTOM?i.y=t-i.height:i.x=t,this.model.setGeometry(n[a],i));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",e,"cells",n))}finally{this.model.endUpdate()}}}return n},mxGraph.prototype.flipEdge=function(e){if(null!=e&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var n=this.model.getStyle(e);null==n||0==n.length?this.model.setStyle(e,this.alternateEdgeStyle):this.model.setStyle(e,null),this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",e))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.addImageBundle=function(e){this.imageBundles.push(e)},mxGraph.prototype.removeImageBundle=function(e){for(var n=[],t=0;t<this.imageBundles.length;t++)this.imageBundles[t]!=e&&n.push(this.imageBundles[t]);this.imageBundles=n},mxGraph.prototype.getImageFromBundles=function(e){if(null!=e)for(var n=0;n<this.imageBundles.length;n++){var t=this.imageBundles[n].getImage(e);if(null!=t)return t}return null},mxGraph.prototype.orderCells=function(e,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(n,e),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",e,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsOrdered=function(e,n){if(null!=e){this.model.beginUpdate();try{for(var t=0;t<e.length;t++){var a=this.model.getParent(e[t]);n?this.model.add(a,e[t],t):this.model.add(a,e[t],this.model.getChildCount(a)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",n,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(e,n,t){null==t&&(t=mxUtils.sortCells(this.getSelectionCells(),!0)),t=this.getCellsForGroup(t),null==e&&(e=this.createGroupCell(t));var a=this.getBoundsForGroup(e,t,n);if(0<t.length&&null!=a){var i=this.model.getParent(e);null==i&&(i=this.model.getParent(t[0])),this.model.beginUpdate();try{null==this.getCellGeometry(e)&&this.model.setGeometry(e,new mxGeometry);var s=this.model.getChildCount(i);this.cellsAdded([e],i,s,null,null,!1),s=this.model.getChildCount(e),this.cellsAdded(t,e,s,null,null,!1,!1),this.cellsMoved(t,-a.x,-a.y,!1,!0),this.cellsResized([e],[a]),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",e,"border",n,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForGroup=function(e){var n=[];if(null!=e&&0<e.length){var t=this.model.getParent(e[0]);n.push(e[0]);for(var a=1;a<e.length;a++)this.model.getParent(e[a])==t&&n.push(e[a])}return n},mxGraph.prototype.getBoundsForGroup=function(e,n,t){return null!=(n=this.getBoundingBoxFromGeometry(n))&&(this.isSwimlane(e)&&(e=this.getStartSize(e),n.x-=e.width,n.y-=e.height,n.width+=e.width,n.height+=e.height),n.x-=t,n.y-=t,n.width+=2*t,n.height+=2*t),n},mxGraph.prototype.createGroupCell=function(e){return(e=new mxCell("")).setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(e){var n=[];if(null==e){e=this.getSelectionCells();for(var t=[],a=0;a<e.length;a++)0<this.model.getChildCount(e[a])&&t.push(e[a]);e=t}if(null!=e&&0<e.length){this.model.beginUpdate();try{for(a=0;a<e.length;a++){if(null!=(i=this.model.getChildren(e[a]))&&0<i.length){var i=i.slice(),s=this.model.getParent(e[a]),o=this.model.getChildCount(s);this.cellsAdded(i,s,o,null,null,!0),n=n.concat(i)}}this.cellsRemoved(this.addAllEdges(e)),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",e))}finally{this.model.endUpdate()}}return n},mxGraph.prototype.removeCellsFromParent=function(e){null==e&&(e=this.getSelectionCells()),this.model.beginUpdate();try{var n=this.getDefaultParent(),t=this.model.getChildCount(n);this.cellsAdded(e,n,t,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.updateGroupBounds=function(e,n,t){null==e&&(e=this.getSelectionCells()),n=null!=n?n:0,t=null!=t&&t,this.model.beginUpdate();try{for(var a=0;a<e.length;a++){if(null!=(r=this.getCellGeometry(e[a]))){var i=this.getChildCells(e[a]);if(null!=i&&0<i.length){var s=this.getBoundingBoxFromGeometry(i);if(0<s.width&&0<s.height){var o=this.isSwimlane(e[a])?this.getStartSize(e[a]):new mxRectangle,r=r.clone();t&&(r.x+=s.x-o.width-n,r.y+=s.y-o.height-n),r.width=s.width+o.width+2*n,r.height=s.height+o.height+2*n,this.model.setGeometry(e[a],r),this.moveCells(i,-s.x+o.width+n,-s.y+o.height+n)}}}}}finally{this.model.endUpdate()}return e},mxGraph.prototype.cloneCells=function(e,n){n=null==n||n;var t=null;if(null!=e){for(var a={},i=(t=[],0);i<e.length;i++){a[s=mxCellPath.create(e[i])]=e[i],t.push(e[i])}if(0<t.length){var s=this.view.scale,o=this.view.translate;for(t=this.model.cloneCells(e,!0),i=0;i<e.length;i++)if(!n&&this.model.isEdge(t[i])&&null!=this.getEdgeValidationError(t[i],this.model.getTerminal(t[i],!0),this.model.getTerminal(t[i],!1)))t[i]=null;else{var r=this.model.getGeometry(t[i]);if(null!=r){var l=this.view.getState(e[i]),d=this.view.getState(this.model.getParent(e[i]));if(null!=l&&null!=d){var c=d.origin.x;d=d.origin.y;if(this.model.isEdge(t[i])){l=l.absolutePoints;for(var m=this.model.getTerminal(e[i],!0),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);for(null==m&&r.setTerminalPoint(new mxPoint(l[0].x/s-o.x,l[0].y/s-o.y),!0),m=this.model.getTerminal(e[i],!1),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);if(null==m&&(m=l.length-1,r.setTerminalPoint(new mxPoint(l[m].x/s-o.x,l[m].y/s-o.y),!1)),null!=(r=r.points))for(l=0;l<r.length;l++)r[l].x+=c,r[l].y+=d}else r.x+=c,r.y+=d}}}}else t=[]}return t},mxGraph.prototype.insertVertex=function(e,n,t,a,i,s,o,r,l){return n=this.createVertex(e,n,t,a,i,s,o,r,l),this.addCell(n,e)},mxGraph.prototype.createVertex=function(e,n,t,a,i,s,o,r,l){return(e=new mxGeometry(a,i,s,o)).relative=null!=l&&l,(t=new mxCell(t,e,r)).setId(n),t.setVertex(!0),t.setConnectable(!0),t},mxGraph.prototype.insertEdge=function(e,n,t,a,i,s){return n=this.createEdge(e,n,t,a,i,s),this.addEdge(n,e,a,i)},mxGraph.prototype.createEdge=function(e,n,t,a,i,s){return(e=new mxCell(t,new mxGeometry,s)).setId(n),e.setEdge(!0),e.geometry.relative=!0,e},mxGraph.prototype.addEdge=function(e,n,t,a,i){return this.addCell(e,n,i,t,a)},mxGraph.prototype.addCell=function(e,n,t,a,i){return this.addCells([e],n,t,a,i)[0]},mxGraph.prototype.addCells=function(e,n,t,a,i){null==n&&(n=this.getDefaultParent()),null==t&&(t=this.model.getChildCount(n)),this.model.beginUpdate();try{this.cellsAdded(e,n,t,a,i,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",e,"parent",n,"index",t,"source",a,"target",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsAdded=function(e,n,t,a,i,s,o){if(null!=e&&null!=n&&null!=t){this.model.beginUpdate();try{for(var r=null!=(d=s?this.view.getState(n):null)?d.origin:null,l=new mxPoint(0,0),d=0;d<e.length;d++)if(null==e[d])t--;else{var c=this.model.getParent(e[d]);if(null!=r&&e[d]!=n&&n!=c){var m=this.view.getState(c),u=null!=m?m.origin:l;if(null!=(p=this.model.getGeometry(e[d]))){var p,g=u.x-r.x,v=u.y-r.y;(p=p.clone()).translate(g,v),!p.relative&&this.model.isVertex(e[d])&&!this.isAllowNegativeCoordinates()&&(p.x=Math.max(0,p.x),p.y=Math.max(0,p.y)),this.model.setGeometry(e[d],p)}}n==c&&t+d>this.model.getChildCount(n)&&t--,this.model.add(n,e[d],t+d),this.isExtendParentsOnAdd()&&this.isExtendParent(e[d])&&this.extendParent(e[d]),(null==o||o)&&this.constrainChild(e[d]),null!=a&&this.cellConnected(e[d],a,!0),null!=i&&this.cellConnected(e[d],i,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",e,"parent",n,"index",t,"source",a,"target",i,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.removeCells=function(e,n){n=null==n||n,null==e&&(e=this.getDeletableCells(this.getSelectionCells())),n&&(e=this.getDeletableCells(this.addAllEdges(e))),this.model.beginUpdate();try{this.cellsRemoved(e),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",e,"includeEdges",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsRemoved=function(e){if(null!=e&&0<e.length){var n=this.view.scale,t=this.view.translate;this.model.beginUpdate();try{for(var a={},i=0;i<e.length;i++){var s=mxCellPath.create(e[i]);a[s]=e[i]}for(i=0;i<e.length;i++){for(var o=this.getConnections(e[i]),r=0;r<o.length;r++)if(null==a[s=mxCellPath.create(o[r])]){if(null!=(d=this.model.getGeometry(o[r]))){var l=this.view.getState(o[r]);if(null!=l){var d=d.clone(),c=l.getVisibleTerminal(!0)==e[i],m=l.absolutePoints,u=c?0:m.length-1;d.setTerminalPoint(new mxPoint(m[u].x/n-t.x,m[u].y/n-t.y),c),this.model.setTerminal(o[r],null,c),this.model.setGeometry(o[r],d)}}}this.model.remove(e[i])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(e,n,t,a,i){a=a||0,i=i||0,null==t&&(t=this.cloneCells([e])[0]);var s=this.model.getParent(e),o=this.model.getTerminal(e,!0);this.model.beginUpdate();try{this.cellsMoved(n,a,i,!1,!1),this.cellsAdded(n,s,this.model.getChildCount(s),null,null,!0),this.cellsAdded([t],s,this.model.getChildCount(s),o,n[0],!1),this.cellConnected(e,n[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",e,"cells",n,"newEdge",t,"dx",a,"dy",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.toggleCells=function(e,n,t){null==n&&(n=this.getSelectionCells()),t&&(n=this.addAllEdges(n)),this.model.beginUpdate();try{this.cellsToggled(n,e),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",e,"cells",n,"includeEdges",t))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsToggled=function(e,n){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var t=0;t<e.length;t++)this.model.setVisible(e[t],n)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(e,n,t,a){n=null!=n&&n,null==t&&(t=this.getFoldableCells(this.getSelectionCells(),e)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(t,e,n,a),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",e,"recurse",n,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsFolded=function(e,n,t,a){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var i=0;i<e.length;i++)if((!a||this.isCellFoldable(e[i],n))&&n!=this.isCellCollapsed(e[i])&&(this.model.setCollapsed(e[i],n),this.swapBounds(e[i],n),this.isExtendParent(e[i])&&this.extendParent(e[i]),t)){var s=this.model.getChildren(e[i]);this.foldCells(s,n,t)}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",e,"collapse",n,"recurse",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(e,n){if(null!=e){var t=this.model.getGeometry(e);null!=t&&(t=t.clone(),this.updateAlternateBounds(e,t,n),t.swap(),this.model.setGeometry(e,t))}},mxGraph.prototype.updateAlternateBounds=function(e,n,t){if(null!=e&&null!=n){if(t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e),null==n.alternateBounds){var a=n;this.collapseToPreferredSize&&(null!=(e=this.getPreferredSizeForCell(e))&&(a=e,0<(e=mxUtils.getValue(t,mxConstants.STYLE_STARTSIZE))&&(a.height=Math.max(a.height,e)))),n.alternateBounds=new mxRectangle(0,0,a.width,a.height)}if(null!=n.alternateBounds){n.alternateBounds.x=n.x,n.alternateBounds.y=n.y;var i=mxUtils.toRadians(t[mxConstants.STYLE_ROTATION]||"0");0!=i&&(e=n.alternateBounds.getCenterX()-n.getCenterX(),t=n.alternateBounds.getCenterY()-n.getCenterY(),a=Math.cos(i),i=Math.sin(i),n.alternateBounds.x+=a*e-i*t-e,n.alternateBounds.y+=i*e+a*t-t)}}},mxGraph.prototype.addAllEdges=function(e){var n=e.slice();return n.concat(this.getAllEdges(e))},mxGraph.prototype.getAllEdges=function(e){var n=[];if(null!=e)for(var t=0;t<e.length;t++){for(var a=this.model.getEdgeCount(e[t]),i=0;i<a;i++)n.push(this.model.getEdgeAt(e[t],i));a=this.model.getChildren(e[t]),n=n.concat(this.getAllEdges(a))}return n},mxGraph.prototype.updateCellSize=function(e,n){n=null!=n&&n,this.model.beginUpdate();try{this.cellSizeUpdated(e,n),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",e,"ignoreChildren",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellSizeUpdated=function(e,n){if(null!=e){this.model.beginUpdate();try{var t=this.getPreferredSizeForCell(e),a=this.model.getGeometry(e);if(null!=t&&null!=a){var i=this.isCellCollapsed(e);a=a.clone();if(this.isSwimlane(e)){var s=this.view.getState(e),o=null!=s?s.style:this.getCellStyle(e),r=this.model.getStyle(e);null==r&&(r=""),mxUtils.getValue(o,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,t.height+8),i&&(a.height=t.height+8),a.width=t.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,t.width+8),i&&(a.width=t.width+8),a.height=t.height),this.model.setStyle(e,r)}else a.width=t.width,a.height=t.height;if(!n&&!i){var l=this.view.getBounds(this.model.getChildren(e));if(null!=l){var d=this.view.translate,c=this.view.scale,m=(l.y+l.height)/c-a.y-d.y;a.width=Math.max(a.width,(l.x+l.width)/c-a.x-d.x),a.height=Math.max(a.height,m)}}this.cellsResized([e],[a])}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(e){var n=null;if(null!=e){var t=this.view.getState(e),a=null!=t?t.style:this.getCellStyle(e);if(null!=a&&!this.model.isEdge(e)){var i=a[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,s=0;n=0;null==this.getImage(t)&&null==a[mxConstants.STYLE_IMAGE]||a[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(a[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(s+=parseFloat(a[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),a[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(n+=parseFloat(a[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),s+=2*(a[mxConstants.STYLE_SPACING]||0),s+=a[mxConstants.STYLE_SPACING_LEFT]||0,s+=a[mxConstants.STYLE_SPACING_RIGHT]||0,n+=2*(a[mxConstants.STYLE_SPACING]||0),n+=a[mxConstants.STYLE_SPACING_TOP]||0,n+=a[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(t=this.getFoldingImage(t))&&(s+=t.width+8),n=null!=(t=this.getLabel(e))&&0<t.length?(this.isHtmlLabel(e)||(t=t.replace(/\n/g,"<br>")),e=(i=mxUtils.getSizeForString(t,i,a[mxConstants.STYLE_FONTFAMILY])).width+s,n=i.height+n,mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)||(a=n,n=e,e=a),this.gridEnabled&&(e=this.snap(e+this.gridSize/2),n=this.snap(n+this.gridSize/2)),new mxRectangle(0,0,e,n)):new mxRectangle(0,0,a=4*this.gridSize,a)}}return n},mxGraph.prototype.handleGesture=function(e,n){if(.2<Math.abs(1-n.scale)){var t=this.view.scale,a=this.view.translate,i=e.width*n.scale,s=e.height*n.scale,o=e.y-(s-e.height)/2;t=new mxRectangle(this.snap((e.x-(i-e.width)/2)/t)-a.x,this.snap(o/t)-a.y,this.snap(i/t),this.snap(s/t));this.resizeCell(e.cell,t)}},mxGraph.prototype.resizeCell=function(e,n){return this.resizeCells([e],[n])[0]},mxGraph.prototype.resizeCells=function(e,n){this.model.beginUpdate();try{this.cellsResized(e,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",e,"bounds",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsResized=function(e,n){if(null!=e&&null!=n&&e.length==n.length){this.model.beginUpdate();try{for(var t=0;t<e.length;t++){var a=n[t],i=this.model.getGeometry(e[t]);if(null!=i&&(i.x!=a.x||i.y!=a.y||i.width!=a.width||i.height!=a.height)){if((i=i.clone()).relative){var s=i.offset;null!=s&&(s.x+=a.x-i.x,s.y+=a.y-i.y)}else i.x=a.x,i.y=a.y;i.width=a.width,i.height=a.height,!i.relative&&this.model.isVertex(e[t])&&!this.isAllowNegativeCoordinates()&&(i.x=Math.max(0,i.x),i.y=Math.max(0,i.y)),this.model.setGeometry(e[t],i),this.isExtendParent(e[t])&&this.extendParent(e[t])}}this.resetEdgesOnResize&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",e,"bounds",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.extendParent=function(e){if(null!=e){var n=this.model.getParent(e),t=this.model.getGeometry(n);null!=n&&null!=t&&!this.isCellCollapsed(n)&&(null!=(e=this.model.getGeometry(e))&&(t.width<e.x+e.width||t.height<e.y+e.height))&&((t=t.clone()).width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height),this.cellsResized([n],[t]))}},mxGraph.prototype.importCells=function(e,n,t,a,i){return this.moveCells(e,n,t,!0,a,i)},mxGraph.prototype.moveCells=function(e,n,t,a,i,s){if(n=null!=n?n:0,t=null!=t?t:0,a=null!=a&&a,null!=e&&(0!=n||0!=t||a||null!=i)){this.model.beginUpdate();try{a&&(e=this.cloneCells(e,this.isCloneInvalidEdges()),null==i&&(i=this.getDefaultParent()));var o=this.isAllowNegativeCoordinates();if(null!=i&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(e,n,t,!a&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==i),this.setAllowNegativeCoordinates(o),null!=i){var r=this.model.getChildCount(i);this.cellsAdded(e,i,r,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",e,"dx",n,"dy",t,"clone",a,"target",i,"event",s))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.cellsMoved=function(e,n,t,a,i){if(null!=e&&(0!=n||0!=t)){this.model.beginUpdate();try{a&&this.disconnectGraph(e);for(var s=0;s<e.length;s++)this.translateCell(e[s],n,t),i&&this.constrainChild(e[s]);this.resetEdgesOnMove&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",e,"dx",t,"dy",t,"disconnect",a))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(e,n,t){var a=this.model.getGeometry(e);null!=a&&((a=a.clone()).translate(n,t),!a.relative&&this.model.isVertex(e)&&!this.isAllowNegativeCoordinates()&&(a.x=Math.max(0,a.x),a.y=Math.max(0,a.y)),a.relative&&!this.model.isEdge(e)&&(null==a.offset?a.offset=new mxPoint(n,t):(a.offset.x+=n,a.offset.y+=t)),this.model.setGeometry(e,a))},mxGraph.prototype.getCellContainmentArea=function(e){if(null!=e&&!this.model.isEdge(e)){var n=this.model.getParent(e);if(n==this.getDefaultParent()||n==this.getCurrentRoot())return this.getMaximumGraphBounds();if(null!=n&&n!=this.getDefaultParent())if(null!=(i=this.model.getGeometry(n))){var t=e=0,a=i.width,i=i.height;return this.isSwimlane(n)&&(e=(n=this.getStartSize(n)).width,a-=n.width,t=n.height,i-=n.height),new mxRectangle(e,t,a,i)}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(e){if(null!=e){var n=this.model.getGeometry(e),t=this.isConstrainChild(e)?this.getCellContainmentArea(e):this.getMaximumGraphBounds();null!=n&&null!=t&&!n.relative&&(n.x<t.x||n.y<t.y||t.width<n.x+n.width||t.height<n.y+n.height)&&(e=this.getOverlap(e),0<t.width&&(n.x=Math.min(n.x,t.x+t.width-(1-e)*n.width)),0<t.height&&(n.y=Math.min(n.y,t.y+t.height-(1-e)*n.height)),n.x=Math.max(n.x,t.x-n.width*e),n.y=Math.max(n.y,t.y-n.height*e))}},mxGraph.prototype.resetEdges=function(e){if(null!=e){for(var n={},t=0;t<e.length;t++){var a=mxCellPath.create(e[t]);n[a]=e[t]}this.model.beginUpdate();try{for(t=0;t<e.length;t++){var i=this.model.getEdges(e[t]);if(null!=i)for(a=0;a<i.length;a++){var s=this.view.getState(i[a]),o=null!=s?s.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[a],!0),r=null!=s?s.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[a],!1),l=mxCellPath.create(o),d=mxCellPath.create(r);(null==n[l]||null==n[d])&&this.resetEdge(i[a])}this.resetEdges(this.model.getChildren(e[t]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(e){var n=this.model.getGeometry(e);return null!=n&&null!=n.points&&0<n.points.length&&((n=n.clone()).points=[],this.model.setGeometry(e,n)),e},mxGraph.prototype.getAllConnectionConstraints=function(e,n){return null!=e&&null!=e.shape&&null!=e.shape.stencil?e.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(e,n,t){n=null;var a=e.style[t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=a){var i=e.style[t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=i&&(n=new mxPoint(parseFloat(a),parseFloat(i)))}return a=!1,null!=n&&(a=mxUtils.getValue(e.style,t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(n,a)},mxGraph.prototype.setConnectionConstraint=function(e,n,t,a){if(null!=a){this.model.beginUpdate();try{null==a||null==a.point?(this.setCellStyles(t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e])):null!=a.point&&(this.setCellStyles(t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,a.point.x,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,a.point.y,[e]),a.perimeter?this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e]):this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[e]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(e,n){var t=null;if(null!=e){var a=this.view.getPerimeterBounds(e),i=new mxPoint(a.getCenterX(),a.getCenterY()),s=e.style[mxConstants.STYLE_DIRECTION],o=0;if(null!=s&&("north"==s?o+=270:"west"==s?o+=180:"south"==s&&(o+=90),"north"==s||"south"==s)){a.x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var r=a.width;a.width=a.height,a.height=r}if(null!=n.point){var l=t=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],u=e.style[mxConstants.STYLE_FLIPV];null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,u=1==mxUtils.getValue(e.style,"stencilFlipV",0)||u),"north"!=s&&"south"!=s||(r=m,m=u,u=r),m&&(t=-1,d=-a.width),u&&(l=-1,c=-a.height)}t=new mxPoint(a.x+n.point.x*a.width*t-d,a.y+n.point.y*a.height*l-c)}s=e.style[mxConstants.STYLE_ROTATION]||0,n.perimeter?(0!=o&&null!=t&&(r=a=0,90==o?r=1:180==o?a=-1:270==s&&(r=-1),t=mxUtils.getRotatedPoint(t,a,r,i)),null!=t&&n.perimeter&&(t=this.view.getPerimeterPoint(e,t,!1))):s+=o,0!=s&&null!=t&&(o=mxUtils.toRadians(s),a=Math.cos(o),r=Math.sin(o),t=mxUtils.getRotatedPoint(t,a,r,i))}return t},mxGraph.prototype.connectCell=function(e,n,t,a){this.model.beginUpdate();try{var i=this.model.getTerminal(e,t);this.cellConnected(e,n,t,a),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",e,"terminal",n,"source",t,"previous",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellConnected=function(e,n,t,a){if(null!=e){this.model.beginUpdate();try{var i=this.model.getTerminal(e,t);this.setConnectionConstraint(e,n,t,a),this.isPortsEnabled()&&(a=null,this.isPort(n)&&(a=n.getId(),n=this.getTerminalForPort(n,t)),this.setCellStyles(t?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,a,[e])),this.model.setTerminal(e,n,t),this.resetEdgesOnConnect&&this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",e,"terminal",n,"source",t,"previous",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(e){if(null!=e){this.model.beginUpdate();try{for(var n=this.view.scale,t=this.view.translate,a={},i=0;i<e.length;i++){a[mxCellPath.create(e[i])]=e[i]}for(i=0;i<e.length;i++)if(this.model.isEdge(e[i])){if(null!=(r=this.model.getGeometry(e[i]))){var s=this.view.getState(e[i]),o=this.view.getState(this.model.getParent(e[i]));if(null!=s&&null!=o){var r=r.clone(),l=-o.origin.x,d=-o.origin.y,c=s.absolutePoints,m=this.model.getTerminal(e[i],!0);if(null!=m&&this.isCellDisconnectable(e[i],m,!0)){for(var u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);null==m&&(r.setTerminalPoint(new mxPoint(c[0].x/n-t.x+l,c[0].y/n-t.y+d),!0),this.model.setTerminal(e[i],null,!0))}var p=this.model.getTerminal(e[i],!1);if(null!=p&&this.isCellDisconnectable(e[i],p,!1)){for(var g=mxCellPath.create(p);null!=p&&null==a[g];)p=this.model.getParent(p),g=mxCellPath.create(p);if(null==p){var v=c.length-1;r.setTerminalPoint(new mxPoint(c[v].x/n-t.x+l,c[v].y/n-t.y+d),!1),this.model.setTerminal(e[i],null,!1)}}this.model.setGeometry(e[i],r)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(e){return null},mxGraph.prototype.isPort=function(e){return!1},mxGraph.prototype.getTerminalForPort=function(e,n){return this.model.getParent(e)},mxGraph.prototype.getChildOffsetForCell=function(e){return null},mxGraph.prototype.enterGroup=function(e){null!=(e=e||this.getSelectionCell())&&this.isValidRoot(e)&&(this.view.setCurrentRoot(e),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var e=this.model.getRoot(),n=this.getCurrentRoot();if(null!=n){for(var t=this.model.getParent(n);t!=e&&!this.isValidRoot(t)&&this.model.getParent(t)!=e;)t=this.model.getParent(t);t==e||this.model.getParent(t)==e?this.view.setCurrentRoot(null):this.view.setCurrentRoot(t),null!=this.view.getState(n)&&this.setSelectionCell(n)}},mxGraph.prototype.home=function(){var e=this.getCurrentRoot();null!=e&&(this.view.setCurrentRoot(null),null!=this.view.getState(e)&&this.setSelectionCell(e))},mxGraph.prototype.isValidRoot=function(e){return null!=e},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(e,n,t){var a=[e];if(n&&(a=a.concat(this.model.getEdges(e))),a=this.view.getBounds(a),t){t=this.model.getChildCount(e);for(var i=0;i<t;i++){var s=this.getCellBounds(this.model.getChildAt(e,i),n,!0);null!=a?a.add(s):a=s}}return a},mxGraph.prototype.getBoundingBoxFromGeometry=function(e,n){n=null!=n&&n;var t=null;if(null!=e)for(var a=0;a<e.length;a++)if(n||this.model.isVertex(e[a])){var i=this.getCellGeometry(e[a]);if(null!=i){var s=i.points;if(null!=s&&0<s.length){for(var o=new mxRectangle(s[0].x,s[0].y,0,0),r=function(e){null!=e&&o.add(new mxRectangle(e.x,e.y,0,0))},l=1;l<s.length;l++)r(s[l]);r(i.getTerminalPoint(!0)),r(i.getTerminalPoint(!1))}null==t?t=new mxRectangle(i.x,i.y,i.width,i.height):t.add(i)}}return t},mxGraph.prototype.refresh=function(e){this.view.clear(e,null==e),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(e){return this.gridEnabled&&(e=Math.round(e/this.gridSize)*this.gridSize),e},mxGraph.prototype.panGraph=function(e,n){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-e,this.container.scrollTop=-n;else{var t=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==e&&0==n){if(mxClient.IS_IE?t.setAttribute("transform","translate("+e+","+n+")"):t.removeAttribute("transform"),null!=this.shiftPreview1){for(var a=this.shiftPreview1.firstChild;null!=a;){var i=a.nextSibling;this.container.appendChild(a),a=i}for(this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(t.parentNode),a=this.shiftPreview2.firstChild;null!=a;)i=a.nextSibling,this.container.appendChild(a),a=i;this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(t.setAttribute("transform","translate("+e+","+n+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;for(a=this.container.firstChild;null!=a;)i=a.nextSibling,a!=t.parentNode?s.appendChild(a):s=this.shiftPreview2,a=i;this.container.insertBefore(this.shiftPreview1,t.parentNode),this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=e+"px",this.shiftPreview1.style.top=n+"px",this.shiftPreview2.style.left=e+"px",this.shiftPreview2.style.top=n+"px"}else t.style.left=e+"px",t.style.top=n+"px";this.panDx=e,this.panDy=n,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(e,n){this.zoom(e/this.view.scale,n)},mxGraph.prototype.zoom=function(e,n){n=null!=n?n:this.centerZoom;var t=this.view.scale*e,a=this.view.getState(this.getSelectionCell());if(this.keepSelectionVisibleOnZoom&&null!=a)a=new mxRectangle(a.x*e,a.y*e,a.width*e,a.height*e),this.view.scale=t,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(t));else if(n&&!mxUtils.hasScrollbars(this.container)){a=this.container.offsetWidth;var i=this.container.offsetHeight;if(1<e){var s=(e-1)/(2*t);a=a*-s,i=i*-s}else a*=s=(1/e-1)/(2*this.view.scale),i*=s;this.view.scaleAndTranslate(t,this.view.translate.x+a,this.view.translate.y+i)}else this.view.setScale(t),mxUtils.hasScrollbars(this.container)&&(i=a=0,n&&(a=this.container.offsetWidth*(e-1)/2,i=this.container.offsetHeight*(e-1)/2),this.container.scrollLeft=Math.round(this.container.scrollLeft*e+a),this.container.scrollTop=Math.round(this.container.scrollTop*e+i))},mxGraph.prototype.zoomToRect=function(e){var n=this.container.clientWidth/e.width/(this.container.clientHeight/e.height);e.x=Math.max(0,e.x),e.y=Math.max(0,e.y);var t=Math.min(this.container.scrollWidth,e.x+e.width),a=Math.min(this.container.scrollHeight,e.y+e.height);e.width=t-e.x,e.height=a-e.y,n<1?(t=((n=e.height/n)-e.height)/2,e.height=n,n=Math.min(e.y,t),e.y-=n,a=Math.min(this.container.scrollHeight,e.y+e.height),e.height=a-e.y):(t=((n*=e.width)-e.width)/2,e.width=n,n=Math.min(e.x,t),e.x-=n,t=Math.min(this.container.scrollWidth,e.x+e.width),e.width=t-e.x),n=this.container.clientWidth/e.width,t=this.view.scale*n,mxUtils.hasScrollbars(this.container)?(this.view.setScale(t),this.container.scrollLeft=Math.round(e.x*n),this.container.scrollTop=Math.round(e.y*n)):this.view.scaleAndTranslate(t,this.view.translate.x-e.x/this.view.scale,this.view.translate.y-e.y/this.view.scale)},mxGraph.prototype.fit=function(e,n){if(null!=this.container){e=null!=e?e:0,n=null!=n&&n;var t=this.container.clientWidth,a=this.container.clientHeight,i=this.view.getGraphBounds();n&&null!=i.x&&null!=i.y&&(i.width+=i.x,i.height+=i.y,i.x=0,i.y=0);var s=this.view.scale,o=i.width/s,r=i.height/s;null!=this.backgroundImage&&(o=Math.max(o,this.backgroundImage.width-i.x/s),r=Math.max(r,this.backgroundImage.height-i.y/s));var l=n?e:2*e;t=Math.floor(100*Math.min(t/(o+l),a/(r+l)))/100;null!=this.minFitScale&&(t=Math.max(t,this.minFitScale)),null!=this.maxFitScale&&(t=Math.min(t,this.maxFitScale)),n?this.view.scale!=t&&this.view.setScale(t):mxUtils.hasScrollbars(this.container)?(this.view.setScale(t),null!=i.x&&(this.container.scrollLeft=Math.round(i.x/s)*t-e-Math.max(0,(this.container.clientWidth-o*t)/2)),null!=i.y&&(this.container.scrollTop=Math.round(i.y/s)*t-e-Math.max(0,(this.container.clientHeight-r*t)/2))):this.view.scaleAndTranslate(t,null!=i.x?Math.floor(this.view.translate.x-i.x/s+e+1):e,null!=i.y?Math.floor(this.view.translate.y-i.y/s+e+1):e)}return this.view.scale},mxGraph.prototype.scrollCellToVisible=function(e,n){var t=-this.view.translate.x,a=-this.view.translate.y,i=this.view.getState(e);null!=i&&(t=new mxRectangle(t+i.x,a+i.y,i.width,i.height),n&&null!=this.container&&(a=this.container.clientWidth,i=this.container.clientHeight,t.x=t.getCenterX()-a/2,t.width=a,t.y=t.getCenterY()-i/2,t.height=i),this.scrollRectToVisible(t)&&this.view.setTranslate(this.view.translate.x,this.view.translate.y))},mxGraph.prototype.scrollRectToVisible=function(e){var n=!1;if(null!=e){var t=this.container.offsetWidth,a=this.container.offsetHeight,i=Math.min(t,e.width),s=Math.min(a,e.height);if(mxUtils.hasScrollbars(this.container)){t=this.container,e.x+=this.view.translate.x,e.y+=this.view.translate.y;var o=t.scrollLeft-e.x;a=Math.max(o-t.scrollLeft,0);0<o?t.scrollLeft-=o+2:0<(o=e.x+i-t.scrollLeft-t.clientWidth)&&(t.scrollLeft+=o+2),i=t.scrollTop-e.y,o=Math.max(0,i-t.scrollTop),0<i?t.scrollTop-=i+2:0<(i=e.y+s-t.scrollTop-t.clientHeight)&&(t.scrollTop+=i+2),!this.useScrollbarsForPanning&&(0!=a||0!=o)&&this.view.setTranslate(a,o)}else{o=-this.view.translate.x;var r=-this.view.translate.y,l=this.view.scale;e.x+i>o+t&&(this.view.translate.x-=(e.x+i-t-o)/l,n=!0),e.y+s>r+a&&(this.view.translate.y-=(e.y+s-a-r)/l,n=!0),e.x<o&&(this.view.translate.x+=(o-e.x)/l,n=!0),e.y<r&&(this.view.translate.y+=(r-e.y)/l,n=!0),n&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return n},mxGraph.prototype.getCellGeometry=function(e){return this.model.getGeometry(e)},mxGraph.prototype.isCellVisible=function(e){return this.model.isVisible(e)},mxGraph.prototype.isCellCollapsed=function(e){return this.model.isCollapsed(e)},mxGraph.prototype.isCellConnectable=function(e){return this.model.isConnectable(e)},mxGraph.prototype.isOrthogonal=function(e){var n=e.style[mxConstants.STYLE_ORTHOGONAL];return null!=n?n:(e=this.view.getEdgeStyle(e))==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom||e==mxEdgeStyle.EntityRelation||e==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(e){var n=e.getVisibleTerminalState(!0);return e=e.getVisibleTerminalState(!1),null!=n&&n==e},mxGraph.prototype.isCloneEvent=function(e){return mxEvent.isControlDown(e)},mxGraph.prototype.isToggleEvent=function(e){return mxClient.IS_MAC?mxEvent.isMetaDown(e):mxEvent.isControlDown(e)},mxGraph.prototype.isGridEnabledEvent=function(e){return null!=e&&!mxEvent.isAltDown(e)},mxGraph.prototype.isConstrainedEvent=function(e){return mxEvent.isShiftDown(e)},mxGraph.prototype.isForceMarqueeEvent=function(e){return mxEvent.isAltDown(e)},mxGraph.prototype.validationAlert=function(e){mxUtils.alert(e)},mxGraph.prototype.isEdgeValid=function(e,n,t){return null==this.getEdgeValidationError(e,n,t)},mxGraph.prototype.getEdgeValidationError=function(e,n,t){if(null!=e&&!this.isAllowDanglingEdges()&&(null==n||null==t))return"";if(null!=e&&null==this.model.getTerminal(e,!0)&&null==this.model.getTerminal(e,!1))return null;if(!this.allowLoops&&n==t&&null!=n||!this.isValidConnection(n,t))return"";if(null==n||null==t)return this.allowDanglingEdges?null:"";var a="";this.multigraph||(1<(i=this.model.getEdgesBetween(n,t,!0)).length||1==i.length&&i[0]!=e)&&(a+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var i=this.model.getDirectedEdgeCount(n,!0,e),s=this.model.getDirectedEdgeCount(t,!1,e);if(null!=this.multiplicities)for(var o=0;o<this.multiplicities.length;o++){var r=this.multiplicities[o].check(this,e,n,t,i,s);null!=r&&(a+=r)}return null!=(r=this.validateEdge(e,n,t))&&(a+=r),0<a.length?a:null},mxGraph.prototype.validateEdge=function(e,n,t){return null},mxGraph.prototype.validateGraph=function(e,n){e=null!=e?e:this.model.getRoot(),n=null!=n?n:{};for(var t=!0,a=this.model.getChildCount(e),i=0;i<a;i++){var s=this.model.getChildAt(e,i),o=n;this.isValidRoot(s)&&(o={}),null!=(o=this.validateGraph(s,o))?this.setCellWarning(s,o.replace(/\n/g,"<br>")):this.setCellWarning(s,null),t=t&&null==o}return a="",this.isCellCollapsed(e)&&!t&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),a=this.model.isEdge(e)?a+(this.getEdgeValidationError(e,this.model.getTerminal(e,!0),this.model.getTerminal(e,!1))||""):a+(this.getCellValidationError(e)||""),null!=(i=this.validateCell(e,n))&&(a+=i),null==this.model.getParent(e)&&this.view.validate(),0<a.length||!t?a:null},mxGraph.prototype.getCellValidationError=function(e){var n=this.model.getDirectedEdgeCount(e,!0),t=this.model.getDirectedEdgeCount(e,!1);e=this.model.getValue(e);var a="";if(null!=this.multiplicities)for(var i=0;i<this.multiplicities.length;i++){var s=this.multiplicities[i];s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<n||1==s.min&&0==n||1==s.max&&1<n)?a+=s.countError+"\n":!s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<t||1==s.min&&0==t||1==s.max&&1<t)&&(a+=s.countError+"\n")}return 0<a.length?a:null},mxGraph.prototype.validateCell=function(e,n){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(e){this.backgroundImage=e},mxGraph.prototype.getFoldingImage=function(e){if(null!=e&&this.foldingEnabled&&!this.getModel().isEdge(e.cell)){var n=this.isCellCollapsed(e.cell);if(this.isCellFoldable(e.cell,!n))return n?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(e){if(null!=(e=this.model.getValue(e))){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(e){var n="";if(this.labelsVisible&&null!=e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);mxUtils.getValue(t,mxConstants.STYLE_NOLABEL,!1)||(n=this.convertValueToString(e))}return n},mxGraph.prototype.isHtmlLabel=function(e){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(e){this.htmlLabels=e},mxGraph.prototype.isWrapping=function(e){var n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&"wrap"==e[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(e){var n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&"hidden"==e[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(e,t,n,a){var i=null;return null!=e&&(null==e.control||t!=e.control.node&&t.parentNode!=e.control.node||(i=this.collapseExpandResource,i=mxResources.get(i)||i),null==i&&null!=e.overlays&&e.overlays.visit(function(e,n){null!=i||t!=n.node&&t.parentNode!=n.node||(i=n.overlay.toString())}),null==i&&(null!=(n=this.selectionCellsHandler.getHandler(e.cell))&&"function"==typeof n.getTooltipForNode&&(i=n.getTooltipForNode(t))),null==i&&(i=this.getTooltipForCell(e.cell))),i},mxGraph.prototype.getTooltipForCell=function(e){return null!=e&&null!=e.getTooltip?e.getTooltip():this.convertValueToString(e)},mxGraph.prototype.getCursorForCell=function(e){return null},mxGraph.prototype.getStartSize=function(e){var n=new mxRectangle,t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&(t=parseInt(mxUtils.getValue(e,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)?n.height=t:n.width=t),n},mxGraph.prototype.getImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(e){this.border=e},mxGraph.prototype.isSwimlane=function(e){var n;if(null!=e&&this.model.getParent(e)!=this.model.getRoot()&&(null!=(n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e))&&!this.model.isEdge(e)))return n[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE;return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(e){this.resizeContainer=e},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(e){this.enabled=e},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(e){this.escapeEnabled=e},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(e){this.invokesStopCellEditing=e},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(e){this.enterStopsCellEditing=e},mxGraph.prototype.isCellLocked=function(e){var n=this.model.getGeometry(e);return this.isCellsLocked()||null!=n&&this.model.isVertex(e)&&n.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(e){this.cellsLocked=e},mxGraph.prototype.getCloneableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(e){this.cellsCloneable=e},mxGraph.prototype.getExportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(e){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(e){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(e){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(e){this.cellsSelectable=e},mxGraph.prototype.getDeletableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(e){this.cellsDeletable=e},mxGraph.prototype.isLabelMovable=function(e){return!this.isCellLocked(e)&&(this.model.isEdge(e)&&this.edgeLabelsMovable||this.model.isVertex(e)&&this.vertexLabelsMovable)},mxGraph.prototype.getMovableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsMovable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(e){this.cellsMovable=e},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(e){this.portsEnabled=e},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(e){this.gridSize=e},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(e){this.tolerance=e},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(e){this.vertexLabelsMovable=e},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(e){this.edgeLabelsMovable=e},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(e){this.swimlaneNesting=e},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(e){this.swimlaneSelectionEnabled=e},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(e){this.multigraph=e},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(e){this.allowDanglingEdges=e},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(e){this.connectableEdges=e},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(e){this.cloneInvalidEdges=e},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(e){this.allowLoops=e},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(e){this.disconnectOnMove=e},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(e){this.dropEnabled=e},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(e){this.splitEnabled=e},mxGraph.prototype.isCellResizable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsResizable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_RESIZABLE]},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(e){this.cellsResizable=e},mxGraph.prototype.isTerminalPointMovable=function(e,n){return!0},mxGraph.prototype.isCellBendable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsBendable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(e){this.cellsBendable=e},mxGraph.prototype.isCellEditable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsEditable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(e){this.cellsEditable=e},mxGraph.prototype.isCellDisconnectable=function(e,n,t){return this.isCellsDisconnectable()&&!this.isCellLocked(e)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(e){this.cellsDisconnectable=e},mxGraph.prototype.isValidSource=function(e){return null==e&&this.allowDanglingEdges||null!=e&&(!this.model.isEdge(e)||this.connectableEdges)&&this.isCellConnectable(e)},mxGraph.prototype.isValidTarget=function(e){return this.isValidSource(e)},mxGraph.prototype.isValidConnection=function(e,n){return this.isValidSource(e)&&this.isValidTarget(n)},mxGraph.prototype.setConnectable=function(e){this.connectionHandler.setEnabled(e)},mxGraph.prototype.isConnectable=function(e){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(e){this.tooltipHandler.setEnabled(e)},mxGraph.prototype.setPanning=function(e){this.panningHandler.panningEnabled=e},mxGraph.prototype.isEditing=function(e){if(null==this.cellEditor)return!1;var n=this.cellEditor.getEditingCell();return null==e?null!=n:e==n},mxGraph.prototype.isAutoSizeCell=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(e){this.autoSizeCells=e},mxGraph.prototype.isExtendParent=function(e){return!this.getModel().isEdge(e)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(e){this.extendParents=e},mxGraph.prototype.isExtendParentsOnAdd=function(){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(e){this.extendParentsOnAdd=e},mxGraph.prototype.isConstrainChild=function(e){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(e))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(e){this.constrainChildren=e},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(e){this.allowNegativeCoordinates=e},mxGraph.prototype.getOverlap=function(e){return this.isAllowOverlapParent(e)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(e){return!1},mxGraph.prototype.getFoldableCells=function(e,n){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellFoldable(e,n)}))},mxGraph.prototype.isCellFoldable=function(e,n){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return 0<this.model.getChildCount(e)&&0!=t[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(e,n,t){return null!=e&&(this.isSplitEnabled()&&this.isSplitTarget(e,n,t)||!this.model.isEdge(e)&&(this.isSwimlane(e)||0<this.model.getChildCount(e)&&!this.isCellCollapsed(e)))},mxGraph.prototype.isSplitTarget=function(e,n,t){return!(!this.model.isEdge(e)||null==n||1!=n.length||!this.isCellConnectable(n[0])||null!=this.getEdgeValidationError(e,this.model.getTerminal(e,!0),n[0]))&&(t=this.model.getTerminal(e,!0),e=this.model.getTerminal(e,!1),!this.model.isAncestor(n[0],t)&&!this.model.isAncestor(n[0],e))},mxGraph.prototype.getDropTarget=function(e,n,t){if(!this.isSwimlaneNesting())for(var a=0;a<e.length;a++)if(this.isSwimlane(e[a]))return null;if((a=mxUtils.convertPoint(this.container,mxEvent.getClientX(n),mxEvent.getClientY(n))).x-=this.panDx,a.y-=this.panDy,a=this.getSwimlaneAt(a.x,a.y),null==t)t=a;else if(null!=a){for(var i=this.model.getParent(a);null!=i&&this.isSwimlane(i)&&i!=t;)i=this.model.getParent(i);i==t&&(t=a)}for(;null!=t&&!this.isValidDropTarget(t,e,n)&&!this.model.isLayer(t);)t=this.model.getParent(t);return!this.model.isLayer(t)&&mxUtils.indexOf(e,t)<0?t:null},mxGraph.prototype.getDefaultParent=function(){var e=this.defaultParent;return null==e&&(null==(e=this.getCurrentRoot())&&(e=this.model.getRoot(),e=this.model.getChildAt(e,0))),e},mxGraph.prototype.setDefaultParent=function(e){this.defaultParent=e},mxGraph.prototype.getSwimlane=function(e){for(;null!=e&&!this.isSwimlane(e);)e=this.model.getParent(e);return e},mxGraph.prototype.getSwimlaneAt=function(e,n,t){if(null!=(t=t||this.getDefaultParent()))for(var a=this.model.getChildCount(t),i=0;i<a;i++){var s=this.model.getChildAt(t,i),o=this.getSwimlaneAt(e,n,s);if(null!=o)return o;if(this.isSwimlane(s)&&(o=this.view.getState(s),this.intersects(o,e,n)))return s}return null},mxGraph.prototype.getCellAt=function(e,n,t,a,i){if(a=null==a||a,i=null==i||i,null!=(t=null!=t?t:this.getDefaultParent()))for(var s=this.model.getChildCount(t)-1;0<=s;s--){var o=this.model.getChildAt(t,s),r=this.getCellAt(e,n,o,a,i);if(null!=r)return r;if(this.isCellVisible(o)&&(i&&this.model.isEdge(o)||a&&this.model.isVertex(o))&&(r=this.view.getState(o),this.intersects(r,e,n)))return o}return null},mxGraph.prototype.intersects=function(e,n,t){if(null!=e){var a=e.absolutePoints;if(null!=a){e=this.tolerance*this.tolerance;for(var i=a[0],s=1;s<a.length;s++){var o=a[s];if(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,n,t)<=e)return!0;i=o}}else if(0!=(i=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(a=Math.cos(-i),i=Math.sin(-i),s=new mxPoint(e.getCenterX(),e.getCenterY()),n=(i=mxUtils.getRotatedPoint(new mxPoint(n,t),a,i,s)).x,t=i.y),mxUtils.contains(e,n,t))return!0}return!1},mxGraph.prototype.hitsSwimlaneContent=function(e,n,t){var a=this.getView().getState(e);if(e=this.getStartSize(e),null!=a){var i=this.getView().getScale();if(n-=a.x,t-=a.y,0<e.width&&0<n&&n>e.width*i||0<e.height&&0<t&&t>e.height*i)return!0}return!1},mxGraph.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraph.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraph.prototype.getChildCells=function(e,n,t){for(e=null!=e?e:this.getDefaultParent(),e=this.model.getChildCells(e,null!=n&&n,null!=t&&t),n=[],t=0;t<e.length;t++)this.isCellVisible(e[t])&&n.push(e[t]);return n},mxGraph.prototype.getConnections=function(e,n){return this.getEdges(e,n,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(e,n){return this.getEdges(e,n,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(e,n){return this.getEdges(e,n,!1,!0,!1)},mxGraph.prototype.getEdges=function(e,n,t,a,i,s){t=null==t||t,a=null==a||a,i=null==i||i,s=null!=s&&s;for(var o=[],r=this.isCellCollapsed(e),l=this.model.getChildCount(e),d=0;d<l;d++){var c=this.model.getChildAt(e,d);!r&&this.isCellVisible(c)||(o=o.concat(this.model.getEdges(c,t,a)))}for(o=o.concat(this.model.getEdges(e,t,a)),r=[],d=0;d<o.length;d++)l=null!=(c=this.view.getState(o[d]))?c.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[d],!0),c=null!=c?c.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[d],!1),(i&&l==c||l!=c&&(t&&c==e&&(null==n||this.isValidAncestor(l,n,s))||a&&l==e&&(null==n||this.isValidAncestor(c,n,s))))&&r.push(o[d]);return r},mxGraph.prototype.isValidAncestor=function(e,n,t){return t?this.model.isAncestor(n,e):this.model.getParent(e)==n},mxGraph.prototype.getOpposites=function(e,n,t,a){t=null==t||t,a=null==a||a;var i=[],s={};if(null!=e)for(var o=0;o<e.length;o++){var r=null!=(l=this.view.getState(e[o]))?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(e[o],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(e[o],!1);if(r==n&&null!=l&&l!=n&&a){var d=mxCellPath.create(l);null==s[d]&&(s[d]=l,i.push(l))}else l==n&&null!=r&&r!=n&&t&&(null==s[d=mxCellPath.create(r)]&&(s[d]=r,i.push(r)))}return i},mxGraph.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=null!=(r=this.view.getState(a[s]))?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[s],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[s],!1);(o==e&&r==n||!t&&o==n&&r==e)&&i.push(a[s])}return i},mxGraph.prototype.getPointForEvent=function(e,n){var t=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a=this.view.scale,i=this.view.translate,s=0!=n?this.gridSize/2:0;return t.x=this.snap(t.x/a-i.x-s),t.y=this.snap(t.y/a-i.y-s),t},mxGraph.prototype.getCells=function(e,n,t,a,i,s){if(s=null!=s?s:[],0<t||0<a){var o=e+t,r=n+a;if(null!=(i=i||this.getDefaultParent()))for(var l=this.model.getChildCount(i),d=0;d<l;d++){var c=this.model.getChildAt(i,d),m=this.view.getState(c);if(this.isCellVisible(c)&&null!=m){var u=m;0!=(m=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION)||0)&&(u=mxUtils.getBoundingBox(u,m)),u.x>=e&&u.y+u.height<=r&&u.y>=n&&u.x+u.width<=o?s.push(c):this.getCells(e,n,t,a,c,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(e,n,t,a,i){var s=[];if((a||i)&&(null==t&&(t=this.getDefaultParent()),null!=t))for(var o=this.model.getChildCount(t),r=0;r<o;r++){var l=this.model.getChildAt(t,r),d=this.view.getState(l);this.isCellVisible(l)&&null!=d&&(!a||d.x>=e)&&(!i||d.y>=n)&&s.push(l)}return s},mxGraph.prototype.findTreeRoots=function(e,n,t){n=null!=n&&n,t=null!=t&&t;var a=[];if(null!=e){for(var i=this.getModel(),s=i.getChildCount(e),o=null,r=0,l=0;l<s;l++){var d=i.getChildAt(e,l);if(this.model.isVertex(d)&&this.isCellVisible(d)){for(var c=this.getConnections(d,n?e:null),m=0,u=0,p=0;p<c.length;p++)this.view.getVisibleTerminal(c[p],!0)==d?m++:u++;(t&&0==m&&0<u||!t&&0==u&&0<m)&&a.push(d),r<(c=t?u-m:m-u)&&(r=c,o=d)}}0==a.length&&null!=o&&a.push(o)}return a},mxGraph.prototype.traverse=function(e,n,t,a,i){if(null!=t&&null!=e){n=null==n||n,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=t(i[s]=e,a))||a)&&0<(a=this.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.model.getEdgeAt(e,s),r=this.model.getTerminal(o,!0)==e;n&&!r||(r=this.model.getTerminal(o,!r),this.traverse(r,n,t,o,i))}}},mxGraph.prototype.isCellSelected=function(e){return this.getSelectionModel().isSelected(e)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(e){this.getSelectionModel().setCell(e)},mxGraph.prototype.setSelectionCells=function(e){this.getSelectionModel().setCells(e)},mxGraph.prototype.addSelectionCell=function(e){this.getSelectionModel().addCell(e)},mxGraph.prototype.addSelectionCells=function(e){this.getSelectionModel().addCells(e)},mxGraph.prototype.removeSelectionCell=function(e){this.getSelectionModel().removeCell(e)},mxGraph.prototype.removeSelectionCells=function(e){this.getSelectionModel().removeCells(e)},mxGraph.prototype.selectRegion=function(e,n){var t=this.getCells(e.x,e.y,e.width,e.height);return this.selectCellsForEvent(t,n),t},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(e,n,t){var a=0<(i=this.selectionModel).cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var i=null!=a?this.model.getParent(a):this.getDefaultParent(),s=this.model.getChildCount(i);null==a&&0<s?(e=this.model.getChildAt(i,0),this.setSelectionCell(e)):null!=a&&!n||null==this.view.getState(i)||null==this.model.getGeometry(i)?null!=a&&t?0<this.model.getChildCount(a)&&(e=this.model.getChildAt(a,0),this.setSelectionCell(e)):0<s&&(n=i.getIndex(a),e=e?(n++,this.model.getChildAt(i,n%s)):(n--,this.model.getChildAt(i,n<0?s-1:n)),this.setSelectionCell(e)):this.getCurrentRoot()!=i&&this.setSelectionCell(i)},mxGraph.prototype.selectAll=function(e){e=e||this.getDefaultParent(),null!=(e=this.model.getChildren(e))&&this.setSelectionCells(e)},mxGraph.prototype.selectVertices=function(e){this.selectCells(!0,!1,e)},mxGraph.prototype.selectEdges=function(e){this.selectCells(!1,!0,e)},mxGraph.prototype.selectCells=function(n,t,e){e=e||this.getDefaultParent();var a=mxUtils.bind(this,function(e){return null!=this.view.getState(e)&&0==this.model.getChildCount(e)&&(this.model.isVertex(e)&&n||this.model.isEdge(e)&&t)});e=this.model.filterDescendants(a,e),this.setSelectionCells(e)},mxGraph.prototype.selectCellForEvent=function(e,n){var t=this.isCellSelected(e);this.isToggleEvent(n)?t?this.removeSelectionCell(e):this.addSelectionCell(e):(!t||1!=this.getSelectionCount())&&this.setSelectionCell(e)},mxGraph.prototype.selectCellsForEvent=function(e,n){this.isToggleEvent(n)?this.addSelectionCells(e):this.setSelectionCells(e)},mxGraph.prototype.createHandler=function(e){var n=null;return null!=e&&(n=this.model.isEdge(e.cell)?(n=this.view.getEdgeStyle(e),this.isLoop(e)||n==mxEdgeStyle.ElbowConnector||n==mxEdgeStyle.SideToSide||n==mxEdgeStyle.TopToBottom?new mxElbowEdgeHandler(e):n==mxEdgeStyle.SegmentConnector||n==mxEdgeStyle.OrthConnector?new mxEdgeSegmentHandler(e):new mxEdgeHandler(e)):new mxVertexHandler(e)),n},mxGraph.prototype.addMouseListener=function(e){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(e)},mxGraph.prototype.removeMouseListener=function(e){if(null!=this.mouseListeners)for(var n=0;n<this.mouseListeners.length;n++)if(this.mouseListeners[n]==e){this.mouseListeners.splice(n,1);break}},mxGraph.prototype.updateMouseEvent=function(e){if(null==e.graphX||null==e.graphY){var n=mxUtils.convertPoint(this.container,e.getX(),e.getY());e.graphX=n.x-this.panDx,e.graphY=n.y-this.panDy}},mxGraph.prototype.fireMouseEvent=function(e,n,t){if(null==t&&(t=this),this.updateMouseEvent(n),e==mxEvent.MOUSE_DOWN&&(this.isMouseDown=!0),mxClient.IS_TOUCH&&this.doubleTapEnabled&&e==mxEvent.MOUSE_DOWN){var a=(new Date).getTime();a-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-n.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-n.getY())<this.doubleTapTolerance?(this.lastTouchTime=0,this.dblClick(n.getEvent(),n.getCell()),n.getEvent().cancelBubble=!0):(this.lastTouchX=n.getX(),this.lastTouchY=n.getY(),this.lastTouchTime=a)}if(a=2!=n.getEvent().detail,mxClient.IS_IE&&"CSS1Compat"==document.compatMode&&((null!=this.lastMouseX&&Math.abs(this.lastMouseX-n.getX())>this.doubleTapTolerance||null!=this.lastMouseY&&Math.abs(this.lastMouseY-n.getY())>this.doubleTapTolerance)&&(a=!0),e==mxEvent.MOUSE_UP&&(this.lastMouseX=n.getX(),this.lastMouseY=n.getY())),(e!=mxEvent.MOUSE_UP||this.isMouseDown)&&a){if(e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1),!this.isEditing()&&(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE&&mxClient.IS_SVG||n.getEvent().target!=this.container)){if(e==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&this.scrollPointToVisible(n.getGraphX(),n.getGraphY(),this.autoExtend),null!=this.mouseListeners)for(t=[t,n],n.getEvent().returnValue=!0,a=0;a<this.mouseListeners.length;a++){var i=this.mouseListeners[a];e==mxEvent.MOUSE_DOWN?i.mouseDown.apply(i,t):e==mxEvent.MOUSE_MOVE?i.mouseMove.apply(i,t):e==mxEvent.MOUSE_UP&&i.mouseUp.apply(i,t)}e==mxEvent.MOUSE_UP&&this.click(n)}}else e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1)},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(e){var n=e.view.graph.getModel().isEdge(e.cell),t=e.view.scale,a=null,i=this.image.width,s=this.image.height;return n?a=1==(n=e.absolutePoints).length%2?n[Math.floor(n.length/2)]:(e=n[(a=n.length/2)-1],n=n[a],new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2)):((a=new mxPoint).x=this.align==mxConstants.ALIGN_LEFT?e.x:this.align==mxConstants.ALIGN_CENTER?e.x+e.width/2:e.x+e.width,a.y=this.verticalAlign==mxConstants.ALIGN_TOP?e.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?e.y+e.height/2:e.y+e.height),new mxRectangle(Math.round(a.x-(i*this.defaultOverlap-this.offset.x)*t),Math.round(a.y-(s*this.defaultOverlap-this.offset.y)*t),i*t,s*t)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.suspended=!1,mxOutline.prototype.init=function(e){this.outline=new mxGraph(e,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet()),this.outline.foldingEnabled=!1,this.outline.autoScroll=!1;var n=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(e){!this.suspended&&null!=this.outline&&n.apply(this.outline,arguments)}),mxClient.IS_SVG&&((e=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),e.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=!1,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(e,n){!this.suspended&&!this.active&&this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this),(e=this.source.getView()).addListener(mxEvent.SCALE,this.updateHandler),e.addListener(mxEvent.TRANSLATE,this.updateHandler),e.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),e.addListener(mxEvent.DOWN,this.updateHandler),e.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(e){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(e){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.init(this.outline.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.outline),this.selectionBorder.node.style.background="",this.sizer=this.createSizer(),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="pointer"),mxEvent.addListener(this.sizer.node,mxClient.IS_TOUCH?"touchstart":"mousedown",mxUtils.bind(this,function(e){this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(e){this.enabled=e},mxOutline.prototype.setZoomEnabled=function(e){this.sizer.node.style.visibility=e?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){var e=null!=this.sizerImage?new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src):new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);return e.dialect=this.outline.dialect,e},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(e){return null},mxOutline.prototype.update=function(e){if(null!=this.source){var n=this.source.view.scale,t=new mxRectangle((t=this.source.getGraphBounds()).x/n+this.source.panDx,t.y/n+this.source.panDy,t.width/n,t.height/n),a=new mxRectangle(0,0,this.source.container.clientWidth/n,this.source.container.clientHeight/n);(s=t.clone()).add(a);var i=this.getSourceContainerSize(),s=(a=Math.max(i.width/n,s.width),n=Math.max(i.height/n,s.height),Math.max(0,this.outline.container.clientWidth-this.border));i=Math.max(0,this.outline.container.clientHeight-this.border);if(0<(s=Math.min(s/a,i/n))){this.outline.getView().scale!=s&&(this.outline.getView().scale=s,e=!0),(a=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&a.setCurrentRoot(this.source.getView().currentRoot);i=(n=this.source.view.translate).x+this.source.panDx;var o=n.y+this.source.panDy;null!=(s=this.getOutlineOffset(s))&&(i+=s.x,o+=s.y),t.x<0&&(i-=t.x),t.y<0&&(o-=t.y),a.translate.x==i&&a.translate.y==o||(a.translate.x=i,a.translate.y=o,e=!0);t=a.translate,i=(s=this.source.getView().scale)/a.scale,o=1/a.scale;var r=this.source.container;this.bounds=new mxRectangle((t.x-n.x-this.source.panDx)/o,(t.y-n.y-this.source.panDy)/o,r.clientWidth/i,r.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*a.scale/s,this.bounds.y+=this.source.container.scrollTop*a.scale/s,(t=this.selectionBorder.bounds).x==this.bounds.x&&t.y==this.bounds.y&&t.width==this.bounds.width&&t.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),t=this.sizer.bounds,a=new mxRectangle(this.bounds.x+this.bounds.width-t.width/2,this.bounds.y+this.bounds.height-t.height/2,t.width,t.height),t.x==a.x&&t.y==a.y&&t.width==a.width&&t.height==a.height||(this.sizer.bounds=a,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),e&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(e,n){this.enabled&&this.showViewport&&(this.zoom=n.isSource(this.sizer),this.startX=n.getX(),this.startY=n.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):this.dy0=this.dx0=0),n.consume()},mxOutline.prototype.mouseMove=function(e,n){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var t=n.getX()-this.startX,a=n.getY()-this.startY,i=null;if(this.zoom)a=t/((i=this.source.container).clientWidth/i.clientHeight),i=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+t),Math.max(1,this.bounds.height+a)),this.selectionBorder.bounds=i,this.selectionBorder.redraw();else{var s=this.outline.getView().scale;i=new mxRectangle(this.bounds.x+t,this.bounds.y+a,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=i,this.selectionBorder.redraw(),t=t/s*this.source.getView().scale,a=a/s*this.source.getView().scale,this.source.panGraph(-t-this.dx0,-a-this.dy0)}t=this.sizer.bounds,this.sizer.bounds=new mxRectangle(i.x+i.width-t.width/2,i.y+i.height-t.height/2,t.width,t.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),n.consume()}},mxOutline.prototype.mouseUp=function(e,n){if(this.active){var t=n.getX()-this.startX,a=n.getY()-this.startY;if(0<Math.abs(t)||0<Math.abs(a)){if(this.zoom){a=this.selectionBorder.bounds.width;var i=this.source.getView().scale;this.source.zoomTo(i-t*i/a,!1)}else this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),t/=this.outline.getView().scale,a/=this.outline.getView().scale,i=this.source.getView().translate,this.source.getView().setTranslate(i.x-t,i.y-a));this.update(),n.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(e,n,t,a,i,s){var o="";return(this.source&&this.checkTerminal(e,t,n)||!this.source&&this.checkTerminal(e,a,n))&&(null!=this.countError&&(this.source&&(0==this.max||i>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(e,n,t,a)||(o+=this.typeError+"\n"))),0<o.length?o:null},mxMultiplicity.prototype.checkNeighbors=function(e,n,t,a){n=e.model.getValue(t),a=e.model.getValue(a),t=!this.validNeighborsAllowed;for(var i=this.validNeighbors,s=0;s<i.length;s++){if(this.source&&this.checkType(e,a,i[s])){t=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(e,n,i[s])){t=this.validNeighborsAllowed;break}}return t},mxMultiplicity.prototype.checkTerminal=function(e,n,t){return n=e.model.getValue(n),this.checkType(e,n,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(e,n,t,a,i){return null!=n&&(isNaN(n.nodeType)?n==t:mxUtils.isNode(n,t,a,i))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(e){this.enabled=e},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(e){this.bubbling=e},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(e){if(null!=this.graph){var n=this.graph.getModel();n.removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler)}this.graph=e,null!=this.graph&&((n=this.graph.getModel()).addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(e){return null},mxLayoutManager.prototype.beforeUndo=function(e){e=this.getCellsForChanges(e.changes);var n=this.getGraph().getModel();if(this.isBubbling())for(var t=n.getParents(e);0<t.length;)e=e.concat(t),t=n.getParents(t);this.layoutCells(mxUtils.sortCells(e,!1))},mxLayoutManager.prototype.cellsMoved=function(e,n){if(null!=e&&null!=n)for(var t=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(n),mxEvent.getClientY(n)),a=this.getGraph().getModel(),i=0;i<e.length;i++){var s=this.getLayout(a.getParent(e[i]));null!=s&&s.moveCell(e[i],t.x,t.y)}},mxLayoutManager.prototype.getCellsForChanges=function(e){for(var n=[],t={},a=0;a<e.length;a++){if((i=e[a])instanceof mxRootChange)return[];for(var i=this.getCellsForChange(i),s=0;s<i.length;s++)if(null!=i[s]){var o=mxCellPath.create(i[s]);null==t[o]&&(t[o]=i[s],n.push(i[s]))}}return n},mxLayoutManager.prototype.getCellsForChange=function(e){var n=this.getGraph().getModel();return e instanceof mxChildChange?[e.child,e.previous,n.getParent(e.child)]:e instanceof mxTerminalChange||e instanceof mxGeometryChange?[e.cell,n.getParent(e.cell)]:[]},mxLayoutManager.prototype.layoutCells=function(e){if(0<e.length){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=null,a=0;a<e.length;a++)e[a]!=n.getRoot()&&e[a]!=t&&(t=e[a],this.executeLayout(this.getLayout(t),t));this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",e))}finally{n.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(e,n){null!=e&&null!=n&&e.execute(n)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSpaceManager.prototype=new mxEventSource,mxSpaceManager.prototype.constructor=mxSpaceManager,mxSpaceManager.prototype.graph=null,mxSpaceManager.prototype.enabled=!0,mxSpaceManager.prototype.shiftRightwards=!0,mxSpaceManager.prototype.shiftDownwards=!0,mxSpaceManager.prototype.extendParents=!0,mxSpaceManager.prototype.resizeHandler=null,mxSpaceManager.prototype.foldHandler=null,mxSpaceManager.prototype.isCellIgnored=function(e){return!this.getGraph().getModel().isVertex(e)},mxSpaceManager.prototype.isCellShiftable=function(e){return this.getGraph().getModel().isVertex(e)&&this.getGraph().isCellMovable(e)},mxSpaceManager.prototype.isEnabled=function(){return this.enabled},mxSpaceManager.prototype.setEnabled=function(e){this.enabled=e},mxSpaceManager.prototype.isShiftRightwards=function(){return this.shiftRightwards},mxSpaceManager.prototype.setShiftRightwards=function(e){this.shiftRightwards=e},mxSpaceManager.prototype.isShiftDownwards=function(){return this.shiftDownwards},mxSpaceManager.prototype.setShiftDownwards=function(e){this.shiftDownwards=e},mxSpaceManager.prototype.isExtendParents=function(){return this.extendParents},mxSpaceManager.prototype.setExtendParents=function(e){this.extendParents=e},mxSpaceManager.prototype.getGraph=function(){return this.graph},mxSpaceManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.resizeHandler),this.graph.removeListener(this.foldHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler),this.graph.addListener(mxEvent.FOLD_CELLS,this.foldHandler))},mxSpaceManager.prototype.cellsResized=function(e){if(null!=e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)if(!this.isCellIgnored(e[t])){this.cellResized(e[t]);break}}finally{n.endUpdate()}}},mxSpaceManager.prototype.cellResized=function(e){var n=this.getGraph(),t=n.getView(),a=n.getModel(),i=t.getState(e),s=t.getState(a.getParent(e));if(null!=i&&null!=s){var o=this.getCellsToShift(i),r=a.getGeometry(e);if(null!=o&&null!=r){var l=t.translate,d=t.scale,c=(t=i.x-s.origin.x-l.x*d,s=i.y-s.origin.y-l.y*d,l=i.x+i.width,i.y+i.height),m=i.width-r.width*d+t-r.x*d,u=i.height-r.height*d+s-r.y*d,p=1-r.width*d/i.width;i=1-r.height*d/i.height;a.beginUpdate();try{for(r=0;r<o.length;r++)o[r]!=e&&this.isCellShiftable(o[r])&&this.shiftCell(o[r],m,u,t,s,l,c,p,i,this.isExtendParents()&&n.isExtendParent(o[r]))}finally{a.endUpdate()}}}},mxSpaceManager.prototype.shiftCell=function(e,n,t,a,i,s,o,r,l,d){var c=(a=this.getGraph()).getView().getState(e);if(null!=c){var m=a.getModel();if(null!=(p=m.getGeometry(e))){m.beginUpdate();try{if(this.isShiftRightwards())if(c.x>=s)(p=p.clone()).translate(-n,0);else{var u=Math.max(0,c.x-x0);(p=p.clone()).translate(-r*u,0)}if(this.isShiftDownwards())if(c.y>=o)(p=p.clone()).translate(0,-t);else{var p,g=Math.max(0,c.y-i);(p=p.clone()).translate(0,-l*g)}p!=m.getGeometry(e)&&(m.setGeometry(e,p),d&&a.extendParent(e))}finally{m.endUpdate()}}}},mxSpaceManager.prototype.getCellsToShift=function(e){var n=this.getGraph(),t=n.getModel().getParent(e.cell),a=this.isShiftDownwards(),i=this.isShiftRightwards();return n.getCellsBeyond(e.x+(a?0:e.width),e.y+(a&&i?0:e.height),t,i,a)},mxSpaceManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(e){this.enabled=e},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(e){this.horizontal=e},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(e){this.addEnabled=e},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(e){this.resizeEnabled=e},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(e){return!this.getGraph().isSwimlane(e)},mxSwimlaneManager.prototype.isCellHorizontal=function(e){if(this.graph.isSwimlane(e)){var n=this.graph.view.getState(e);return e=null!=n?n.style:this.graph.getCellStyle(e),1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(e){if(null!=e){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)this.isSwimlaneIgnored(e[t])||this.swimlaneAdded(e[t])}finally{n.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(e){for(var n=this.getGraph().getModel(),t=n.getParent(e),a=n.getChildCount(t),i=null,s=0;s<a;s++){var o=n.getChildAt(t,s);if(o!=e&&!this.isSwimlaneIgnored(o)&&null!=(i=n.getGeometry(o)))break}null!=i&&this.resizeSwimlane(e,i.width,i.height)},mxSwimlaneManager.prototype.cellsResized=function(e){if(null!=e){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)if(!this.isSwimlaneIgnored(e[t])){var a=n.getGeometry(e[t]);if(null!=a){for(var i=new mxRectangle(0,0,a.width,a.height),s=o=e[t];null!=s;){var o=s,r=(s=n.getParent(s),this.graph.isSwimlane(s)?this.graph.getStartSize(s):new mxRectangle);i.width+=r.width,i.height+=r.height}this.resizeSwimlane(o,i.width,i.height)}}}finally{n.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(e,n,t){var a=this.getGraph().getModel();a.beginUpdate();try{if(!this.isSwimlaneIgnored(e))if(null!=(r=a.getGeometry(e))){var i=this.isCellHorizontal(e);(i&&r.height!=t||!i&&r.width!=n)&&(r=r.clone(),i?r.height=t:r.width=n,a.setGeometry(e,r))}var s=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;n-=s.width,t-=s.height;for(var o=a.getChildCount(e),r=0;r<o;r++){var l=a.getChildAt(e,r);this.resizeSwimlane(l,n,t)}}finally{a.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds)},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(e,n,t,a,i){a=null==a||a,i=null==i||i;var s=mxCellPath.create(e.cell),o=this.deltas[s];return null==o?(o=new mxPoint(n,t),this.deltas[s]=o,this.count++):a?(o.X+=n,o.Y+=t):(o.X=n,o.Y=t),i&&this.addEdges(e),o},mxCellStatePreview.prototype.show=function(e){var n,t=this.graph.getModel(),a=t.getRoot();for(n in this.deltas){var i=mxCellPath.resolve(a,n),s=this.graph.view.getState(i),o=this.deltas[n];i=this.graph.view.getState(t.getParent(i));this.translateState(i,s,o.x,o.y)}for(n in this.deltas)i=mxCellPath.resolve(a,n),s=this.graph.view.getState(i),o=this.deltas[n],i=this.graph.view.getState(t.getParent(i)),this.revalidateState(i,s,o.x,o.y,e)},mxCellStatePreview.prototype.translateState=function(e,n,t,a){if(null!=n){var i=this.graph.getModel();if(i.isVertex(n.cell)){n.invalid=!0,this.graph.view.validateBounds(e,n.cell),e=i.getGeometry(n.cell);var s=mxCellPath.create(n.cell);0==t&&0==a||null==e||e.relative&&null==this.deltas[s]||(n.x+=t,n.y+=a)}for(e=i.getChildCount(n.cell),s=0;s<e;s++)this.translateState(n,this.graph.view.getState(i.getChildAt(n.cell,s)),t,a)}},mxCellStatePreview.prototype.revalidateState=function(e,n,t,a,i){if(null!=n){n.invalid=!0,this.graph.view.validatePoints(e,n.cell);var s=mxCellPath.create(n.cell),o=this.graph.getModel(),r=this.graph.getCellGeometry(n.cell);for(0==t&&0==a||null==r||!r.relative||!o.isVertex(n.cell)||null!=e&&!o.isVertex(e.cell)&&null==this.deltas[s]||(n.x+=t,n.y+=a,this.graph.cellRenderer.redraw(n)),null!=i&&i(n),e=o.getChildCount(n.cell),s=0;s<e;s++)this.revalidateState(n,this.graph.view.getState(o.getChildAt(n.cell,s)),t,a,i)}},mxCellStatePreview.prototype.addEdges=function(e){for(var n=this.graph.getModel(),t=n.getEdgeCount(e.cell),a=0;a<t;a++){var i=this.graph.view.getState(n.getEdgeAt(e.cell,a));null!=i&&this.moveState(i,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(e){this.enabled=e},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(e){this.cloneEnabled=e},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(e){this.moveEnabled=e},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(e){this.selectEnabled=e},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(e){this.removeCellsFromParent=e},mxGraphHandler.prototype.getInitialCellForEvent=function(e){return e.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(e){return this.graph.isCellSelected(e)},mxGraphHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&null!=n.getState()){var t=this.getInitialCellForEvent(n);if(this.cell=null,this.delayedSelection=this.isDelayedSelection(t),this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(t,n.getEvent()),this.isMoveEnabled()){var a=this.graph.model,i=a.getGeometry(t);this.graph.isCellMovable(t)&&(!a.isEdge(t)||1<this.graph.getSelectionCount()||null!=i.points&&0<i.points.length||null==a.getTerminal(t,!0)||null==a.getTerminal(t,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(n.getEvent())&&this.graph.isCellsCloneable())&&this.start(t,n.getX(),n.getY()),this.cellWasClicked=!0,!mxClient.IS_SF&&!mxClient.IS_GC||"SELECT"!=n.getSource().nodeName?n.consume():mxClient.IS_SF&&"SELECT"==n.getSource().nodeName&&(this.cellWasClicked=!1,this.first=null)}}},mxGraphHandler.prototype.getGuideStates=function(){var e=this.graph.getDefaultParent(),n=this.graph.getModel(),t=mxUtils.bind(this,function(e){return null!=this.graph.view.getState(e)&&n.isVertex(e)&&null!=n.getGeometry(e)&&!n.getGeometry(e).relative});return this.graph.view.getCellStates(n.filterDescendants(t,e))},mxGraphHandler.prototype.getCells=function(e){return!this.delayedSelection&&this.graph.isCellMovable(e)?[e]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(e){return null!=(e=this.getBoundingBox(e))&&(e.grow(-1,-1),e.width<this.minimumSize&&(e.x-=(this.minimumSize-e.width)/2,e.width=this.minimumSize),e.height<this.minimumSize&&(e.y-=(this.minimumSize-e.height)/2,e.height=this.minimumSize)),e},mxGraphHandler.prototype.getBoundingBox=function(e){var n=null;if(null!=e&&0<e.length)for(var t=this.graph.getModel(),a=0;a<e.length;a++)if(t.isVertex(e[a])||t.isEdge(e[a])){var i=this.graph.view.getState(e[a]);if(null!=i){var s=i;t.isVertex(e[a])&&null!=i.shape&&null!=i.shape.boundingBox&&(s=i.shape.boundingBox),null==n?n=new mxRectangle(s.x,s.y,s.width,s.height):n.add(s)}}return n},mxGraphHandler.prototype.createPreviewShape=function(e){return(e=new mxRectangleShape(e,null,this.previewColor)).isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1),e},mxGraphHandler.prototype.start=function(e,n,t){this.cell=e,this.first=mxUtils.convertPoint(this.graph.container,n,t),this.cells=this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))},mxGraphHandler.prototype.useGuidesForEvent=function(e){return null==this.guide||this.guide.isEnabledForEvent(e.getEvent())},mxGraphHandler.prototype.snap=function(e){var n=this.scaleGrid?this.graph.view.scale:1;return e.x=this.graph.snap(e.x/n)*n,e.y=this.graph.snap(e.y/n)*n,e},mxGraphHandler.prototype.mouseMove=function(e,n){var t=this.graph;if(!n.isConsumed()&&t.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){var a=(s=mxUtils.convertPoint(t.container,n.getX(),n.getY())).x-this.first.x,i=s.y-this.first.y,s=t.tolerance;if(null!=this.shape||Math.abs(a)>s||Math.abs(i)>s){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var o=t.isGridEnabledEvent(n.getEvent());s=!0;if(null!=this.guide&&this.useGuidesForEvent(n))s=!1,a=(i=this.guide.move(this.bounds,new mxPoint(a,i),o)).x,i=i.y;else if(o){var r=t.getView().translate,l=t.getView().scale;o=this.bounds.x-(t.snap(this.bounds.x/l-r.x)+r.x)*l,r=this.bounds.y-(t.snap(this.bounds.y/l-r.y)+r.y)*l,a=(i=this.snap(new mxPoint(a,i))).x-o,i=i.y-r}for(null!=this.guide&&s&&this.guide.hide(),t.isConstrainedEvent(n.getEvent())&&(Math.abs(a)>Math.abs(i)?i=0:a=0),this.currentDx=a,this.currentDy=i,this.updatePreviewShape(),s=null,i=n.getCell(),t.isDropEnabled()&&this.highlightEnabled&&(s=t.getDropTarget(this.cells,n.getEvent(),i)),o=s,r=t.getModel();null!=o&&o!=this.cells[0];)o=r.getParent(o);l=t.isCloneEvent(n.getEvent())&&t.isCellsCloneable()&&this.isCloneEnabled();var d=!1;null==(a=t.getView().getState(s))||null!=o||r.getParent(this.cell)==s&&!l?(this.target=null,this.connectOnDrop&&null!=i&&1==this.cells.length&&t.getModel().isVertex(i)&&t.isCellConnectable(i)&&(null!=(a=t.getView().getState(i))&&(t=null==t.getEdgeValidationError(null,this.cell,i)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(t),d=!0))):(this.target!=s&&(this.target=s,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0),null!=a&&d?this.highlight.highlight(a):this.highlight.hide()}n.consume(),mxEvent.consume(n.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||n.isConsumed()||null==n.getState()||t.isMouseDown||(null==(a=t.getCursorForCell(n.getCell()))&&t.isEnabled()&&t.isCellMovable(n.getCell())&&(a=t.getModel().isEdge(n.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),n.getState().setCursor(a),n.consume())},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(e){null!=this.highlight&&this.highlight.setHighlightColor(e)},mxGraphHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()){var t=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var a=t.getView().scale,i=t.isCloneEvent(n.getEvent())&&t.isCellsCloneable()&&this.isCloneEnabled(),s=this.currentDx/a,o=(a=this.currentDy/a,n.getCell());this.connectOnDrop&&null==this.target&&null!=o&&t.getModel().isVertex(o)&&t.isCellConnectable(o)&&t.isEdgeValid(null,this.cell,o)?t.connectionHandler.connect(this.cell,o,n.getEvent()):(o=this.target,t.isSplitEnabled()&&t.isSplitTarget(o,this.cells,n.getEvent())?t.splitEdge(o,this.cells,null,s,a):this.moveCells(this.cells,s,a,i,this.target,n.getEvent()))}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(n)}this.cellWasClicked&&n.consume(),this.reset()},mxGraphHandler.prototype.selectDelayed=function(e){this.graph.selectCellForEvent(this.cell,e.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.delayedSelection=this.cellWasClicked=!1,this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,n,t){if(this.graph.getModel().isVertex(e)){if(e=this.graph.getView().getState(e),t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),0!=(a=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))){n=Math.cos(-a);var a=Math.sin(-a),i=new mxPoint(e.getCenterX(),e.getCenterY());t=mxUtils.getRotatedPoint(t,n,a,i)}return null!=e&&!mxUtils.contains(e,t.x,t.y)}return!1},mxGraphHandler.prototype.moveCells=function(e,n,t,a,i,s){a&&(e=this.graph.getCloneableCells(e)),null==i&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),e,s)&&(i=this.graph.getDefaultParent()),e=this.graph.moveCells(e,n-this.graph.panDx/this.graph.view.scale,t-this.graph.panDy/this.graph.view.scale,a,i,s),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(e[0]),a&&this.graph.setSelectionCells(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.destroyShapes()},mxPanningHandler.prototype=new mxPopupMenu,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.triggerX=null,mxPanningHandler.prototype.triggerY=null,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.selectOnPopup=!0,mxPanningHandler.prototype.clearSelectionOnBackground=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(e){this.panningEnabled=e},mxPanningHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addListener(this.div,mxClient.IS_TOUCH?"touchmove":"mousemove",mxUtils.bind(this,function(e){this.graph.tooltipHandler.hide()}))},mxPanningHandler.prototype.isPanningTrigger=function(e){var n=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())&&mxEvent.isLeftMouseButton(n)||mxEvent.isControlDown(n)&&mxEvent.isShiftDown(n)||this.usePopupTrigger&&mxEvent.isPopupTrigger(n)},mxPanningHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()){this.hideMenu(),this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop;var t=mxUtils.convertPoint(this.graph.container,n.getX(),n.getY());this.triggerX=t.x,this.triggerY=t.y,this.popupTrigger=this.isPopupTrigger(n),this.panningTrigger=this.isPanningEnabled()&&this.isPanningTrigger(n),this.startX=n.getX(),this.startY=n.getY(),this.panningTrigger&&this.consumePanningTrigger(n)}},mxPanningHandler.prototype.consumePanningTrigger=function(e){e.consume()},mxPanningHandler.prototype.mouseMove=function(e,n){var t=n.getX()-this.startX,a=n.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(t=this.graph.snap(t),a=this.graph.snap(a)),this.graph.panGraph(t+this.dx0,a+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",n)),n.consume();else if(this.panningTrigger){var i=this.active;this.active=Math.abs(t)>this.graph.tolerance||Math.abs(a)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",n))}},mxPanningHandler.prototype.mouseUp=function(e,n){var t=Math.abs(n.getX()-this.startX),a=Math.abs(n.getY()-this.startY);if(this.active){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){t=n.getX()-this.startX,a=n.getY()-this.startY,this.useGrid&&(t=this.graph.snap(t),a=this.graph.snap(a));var i=this.graph.getView().scale,s=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(s.x+t/i,s.y+a/i)}this.active=!1,this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",n)),n.consume()}else this.popupTrigger&&t<this.graph.tolerance&&a<this.graph.tolerance&&(t=this.getCellForPopupEvent(n),this.graph.isEnabled()&&this.selectOnPopup&&null!=t&&!this.graph.isCellSelected(t)?this.graph.setSelectionCell(t):this.clearSelectionOnBackground&&null==t&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),a=mxUtils.getScrollOrigin(),a=new mxPoint(n.getX()+a.x,n.getY()+a.y),this.popup(a.x+1,a.y+1,t,n.getEvent()),n.consume());this.popupTrigger=this.panningTrigger=!1},mxPanningHandler.prototype.getCellForPopupEvent=function(e){return e.getCell()},mxPanningHandler.prototype.panGraph=function(e,n){this.graph.getView().setTranslate(e,n)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(e){this.enabled=e},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(e){this.hotspot=e},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(e){this.hotspotEnabled=e},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(e){var n=null;if(this.isEnabled()){var t=null!=(n=this.getState(e))&&this.isValidState(n);e=this.getMarkerColor(e.getEvent(),n,t),this.validState=t?n:null,n==this.markedState&&e==this.currentColor||(this.currentColor=e,null!=n&&null!=this.currentColor?(this.markedState=n,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))}return n},mxCellMarker.prototype.markCell=function(e,n){var t=this.graph.getView().getState(e);null!=t&&(this.currentColor=null!=n?n:this.validColor,this.markedState=t,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(e){return!0},mxCellMarker.prototype.getMarkerColor=function(e,n,t){return t?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(e){var n=this.graph.getView();return cell=this.getCell(e),null!=(n=this.getStateToMark(n.getState(cell)))&&this.intersects(n,e)?n:null},mxCellMarker.prototype.getCell=function(e){return e.getCell()},mxCellMarker.prototype.getStateToMark=function(e){return e},mxCellMarker.prototype.intersects=function(e,n){return!this.hotspotEnabled||mxUtils.intersectsHotspot(e,n.getGraphX(),n.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(e){this.enabled=e},mxSelectionCellsHandler.prototype.getHandler=function(e){return this.handlers.get(e)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(e,n){n.reset.apply(n)})},mxSelectionCellsHandler.prototype.refresh=function(){var e=this.handlers;this.handlers=new mxDictionary;for(var n=this.graph.getSelectionCells(),t=0;t<n.length;t++){var a=this.graph.view.getState(n[t]);if(null!=a){var i=e.remove(n[t]);null!=i&&(i.state!=a?(i.destroy(),i=null):i.redraw()),null==i&&(i=this.graph.createHandler(a),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",a))),null!=i&&this.handlers.put(n[t],i)}}e.visit(mxUtils.bind(this,function(e,n){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",n.state)),n.destroy()}))},mxSelectionCellsHandler.prototype.mouseDown=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseDown.apply(n,t)})}},mxSelectionCellsHandler.prototype.mouseMove=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseMove.apply(n,t)})}},mxSelectionCellsHandler.prototype.mouseUp=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseUp.apply(n,t)})}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.tapAndHoldEnabled=!0,mxConnectionHandler.prototype.tapAndHoldDelay=500,mxConnectionHandler.prototype.tapAndHoldInProgress=!1,mxConnectionHandler.prototype.tapAndHoldValid=!1,mxConnectionHandler.prototype.tapAndHoldTolerance=4,mxConnectionHandler.prototype.initialTouchX=0,mxConnectionHandler.prototype.initialTouchY=0,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(e){this.enabled=e},mxConnectionHandler.prototype.isCreateTarget=function(){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(e){this.createTarget=e},mxConnectionHandler.prototype.createShape=function(){var e=new mxPolyline([],mxConstants.INVALID_COLOR);if(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=!0,this.graph.dialect==mxConstants.DIALECT_SVG)e.node.setAttribute("pointer-events","none");else{var n=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(e.node,this.graph,n)}return e},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(e){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?this.redrawIcons(this.icons,this.iconState):(this.destroyIcons(this.icons),this.previous=null),this.constraintHandler.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(e){this.destroyIcons(this.icons)}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(e){return!0},mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);return a.hotspotEnabled=!0,a.getCell=mxUtils.bind(this,function(e,n){return n=mxCellMarker.prototype.getCell.apply(a,arguments),this.error=null,this.isConnectableCell(n)?(null!=n?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,n),null!=this.error&&0==this.error.length&&(n=null,this.isCreateTarget()&&(this.error=null))):this.isValidSource(n)||(n=null):this.isConnecting()&&!this.isCreateTarget()&&!this.graph.allowDanglingEdges&&(this.error=""),n):null}),a.isValidState=mxUtils.bind(this,function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)}),a.getMarkerColor=mxUtils.bind(this,function(e,n,t){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null}),a.intersects=mxUtils.bind(this,function(e,n){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(a,arguments)}),a},mxConnectionHandler.prototype.start=function(e,n,t,a){this.previous=e,this.first=new mxPoint(n,t),this.edgeState=null!=a?a:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=e,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(e){return this.graph.isValidSource(e)},mxConnectionHandler.prototype.isValidTarget=function(e){return!0},mxConnectionHandler.prototype.validateConnection=function(e,n){return this.isValidTarget(n)?this.graph.getEdgeValidationError(null,e,n):""},mxConnectionHandler.prototype.getConnectImage=function(e){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(e){return null!=e.text&&e.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(e){if(null==(i=this.getConnectImage(e))||null==e)return null;this.iconState=e;var n=[],t=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src,null,null,0);t.preserveImageAspect=!1,this.isMoveIconToFrontForState(e)?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(t.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,t.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=t.node.previousSibling&&t.node.parentNode.insertBefore(t.node,t.node.parentNode.firstChild)),t.node.style.cursor=mxConstants.CURSOR_CONNECT;var a=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:e}),i=mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(this.icon=t,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,a())))});return mxEvent.redirectMouseEvents(t.node,this.graph,a,i),n.push(t),this.redrawIcons(n,this.iconState),n},mxConnectionHandler.prototype.redrawIcons=function(e,n){if(null!=e&&null!=e[0]&&null!=n){var t=this.getIconPosition(e[0],n);e[0].bounds.x=t.x,e[0].bounds.y=t.y,e[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(e,n){var t=this.graph.getView().scale,a=n.getCenterX(),i=n.getCenterY();if(this.graph.isSwimlane(n.cell)){a=0!=(s=this.graph.getStartSize(n.cell)).width?n.x+s.width*t/2:a,i=0!=s.height?n.y+s.height*t/2:i;if(0!=(s=mxUtils.toRadians(mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION)||0))){t=Math.cos(s);var s=Math.sin(s),o=new mxPoint(n.getCenterX(),n.getCenterY());a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),t,s,o)).x,i=i.y}}return new mxPoint(a-e.bounds.width/2,i-e.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(e){if(null!=e){this.iconState=null;for(var n=0;n<e.length;n++)e[n].destroy()}},mxConnectionHandler.prototype.isStartEvent=function(e){return!this.graph.isForceMarqueeEvent(e.getEvent())&&(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon))},mxConnectionHandler.prototype.mouseDown=function(e,n){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!n.isConsumed()&&!this.isConnecting()&&this.isStartEvent(n)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(n.getGraphX(),n.getGraphY()),this.edgeState=this.createEdgeState(n),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape()),null==this.previous&&null!=this.edgeState){var t=this.graph.getPointForEvent(n.getEvent());this.edgeState.cell.geometry.setTerminalPoint(t,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),n.consume()}else if(mxClient.IS_TOUCH&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress&&this.isEnabled()&&this.graph.isEnabled()&&!this.isConnecting()){this.tapAndHoldInProgress=!0,this.initialTouchX=n.getX(),this.initialTouchY=n.getY();var a=this.graph.view.getState(this.marker.getCell(n));this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(n,a),this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.tapAndHold=function(e,n){null!=n&&(this.marker.currentColor=this.marker.validColor,this.marker.markedState=n,this.marker.mark(),this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.previous=n,this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)))},mxConnectionHandler.prototype.isImmediateConnectSource=function(e){return!this.graph.isCellMovable(e.cell)},mxConnectionHandler.prototype.createEdgeState=function(e){return null},mxConnectionHandler.prototype.updateCurrentState=function(e){var n=this.marker.process(e);this.constraintHandler.update(e,null==this.first),this.currentState=n},mxConnectionHandler.prototype.convertWaypoint=function(e){var n=this.graph.getView().getScale(),t=this.graph.getView().getTranslate();e.x=e.x/n-t.x,e.y=e.y/n-t.y},mxConnectionHandler.prototype.mouseMove=function(e,n){if(this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-n.getX())<this.tapAndHoldTolerance&&Math.abs(this.initialTouchY-n.getY())<this.tapAndHoldTolerance),n.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{if(!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(this.icons),this.currentState=null),(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(n),null!=this.first){var t=this.graph.getView().scale,a=null,i=t=new mxPoint(this.graph.snap(n.getGraphX()/t)*t,this.graph.snap(n.getGraphY()/t)*t);null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint&&(a=this.constraintHandler.currentConstraint,i=this.constraintHandler.currentPoint.clone());var s=this.first;if(null!=this.selectedIcon){var o=this.selectedIcon.bounds.width,r=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(o=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=o.x,this.selectedIcon.bounds.y=o.y):(o=new mxRectangle(n.getGraphX()+this.connectIconOffset.x,n.getGraphY()+this.connectIconOffset.y,o,r),this.selectedIcon.bounds=o),this.selectedIcon.redraw()}if(null!=this.edgeState){if(this.edgeState.absolutePoints=[null,null!=this.currentState?null:i],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==a&&(a=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,a)),(s=null)!=this.waypoints)for(s=[],i=0;i<this.waypoints.length;i++)a=this.waypoints[i].clone(),this.convertWaypoint(a),s[i]=a;this.graph.view.updatePoints(this.edgeState,s,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState),i=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],s=this.edgeState.absolutePoints[0]}else null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(null!=(o=this.getTargetPerimeterPoint(this.currentState,n))&&(i=o)),null==this.sourceConstraint&&null!=this.previous&&(null!=(o=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:i,n))&&(s=o));if(null==this.currentState&&this.movePreviewAway){if(o=s,null!=this.edgeState&&2<this.edgeState.absolutePoints.length&&(null!=(a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(o=a)),a=i.x-o.x,o=i.y-o.y,0==(r=Math.sqrt(a*a+o*o)))return;i.x-=4*a/r,i.y-=4*o/r}null==this.shape&&(a=Math.abs(t.x-this.first.x),o=Math.abs(t.y-this.first.y),a>this.graph.tolerance||o>this.graph.tolerance)&&(this.shape=this.createShape(),this.updateCurrentState(n)),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(t=[s],null!=this.waypoints&&(t=t.concat(this.waypoints)),t.push(i),this.shape.points=t),this.drawPreview()),mxEvent.consume(n.getEvent()),n.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(this.icons),(this.icons=null)!=this.currentState&&null==this.error&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),n.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&null==this.icons&&!this.graph.isMouseDown&&n.consume():this.constraintHandler.reset();if(null!=this.constraintHandler.currentConstraint&&this.marker.reset(),!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(t=!1,s=n.getSource(),i=0;i<this.icons.length&&!t;i++)t=s==this.icons[i].node||s.parentNode==this.icons[i].node;t||this.updateIcons(this.currentState,this.icons,n)}}},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(e,n){var t=null,a=(i=e.view).getPerimeterFunction(e);if(null!=a){var i,s=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());null!=(i=a(i.getPerimeterBounds(e),this.edgeState,s,!1))&&(t=i)}else t=new mxPoint(e.getCenterX(),e.getCenterY());return t},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(e,n,t){t=null;var a=e.view,i=a.getPerimeterFunction(e),s=new mxPoint(e.getCenterX(),e.getCenterY());if(null!=i){var o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0),r=-o*(Math.PI/180);0!=o&&(n=mxUtils.getRotatedPoint(new mxPoint(n.x,n.y),Math.cos(r),Math.sin(r),s)),null!=(e=i(a.getPerimeterBounds(e),e,n,!1))&&(0!=o&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-r),Math.sin(-r),s)),t=e)}else t=s;return t},mxConnectionHandler.prototype.updateIcons=function(e,n,t){},mxConnectionHandler.prototype.isStopEvent=function(e){return null!=e.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(e){var n=mxUtils.convertPoint(this.graph.container,e.getX(),e.getY()),t=Math.abs(n.x-this.first.x);n=Math.abs(n.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(t>this.graph.tolerance||n>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),t=this.graph.view.scale,n=new mxPoint(this.graph.snap(e.getGraphX()/t)*t,this.graph.snap(e.getGraphY()/t)*t),this.waypoints.push(n))},mxConnectionHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(n))return this.addWaypointForEvent(n),void n.consume();if(null==this.error){var t=null!=this.previous?this.previous.cell:null,a=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),this.connect(t,a,n.getEvent(),n.getCell())}else null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons(this.icons),n.consume()}null!=this.first&&this.reset(),this.tapAndHoldValid=this.tapAndHoldInProgress=!1},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),this.destroyIcons(this.icons),this.icons=null,this.marker.reset(),this.constraintHandler.reset(),this.sourceConstraint=this.error=this.previous=this.edgeState=this.selectedIcon=null,this.mouseDownCounter=0,this.icon=this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){var e=null==this.error;this.shape.strokewidth=this.getEdgeWidth(e),e=this.getEdgeColor(e),this.shape.stroke=e,this.shape.redraw()},mxConnectionHandler.prototype.getEdgeColor=function(e){return e?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(e){return e?3:1},mxConnectionHandler.prototype.connect=function(e,n,t,a){if(null!=n||this.isCreateTarget()||this.graph.allowDanglingEdges){var i=this.graph.getModel(),s=null;i.beginUpdate();try{if(null!=e&&null==n&&this.isCreateTarget()&&null!=(n=this.createTargetVertex(t,e))){if(null!=(a=this.graph.getDropTarget([n],t,a))&&this.graph.getModel().isEdge(a))a=this.graph.getDefaultParent();else{var o=this.graph.getView().getState(a);if(null!=o){var r=i.getGeometry(n);r.x-=o.origin.x,r.y-=o.origin.y}}this.graph.addCell(n,a)}var l=this.graph.getDefaultParent();if(null!=e&&null!=n&&i.getParent(e)==i.getParent(n)&&i.getParent(i.getParent(e))!=i.getRoot()&&(l=i.getParent(e),null!=e.geometry&&e.geometry.relative&&null!=n.geometry&&n.geometry.relative&&(l=i.getParent(l))),r=o=null,null!=this.edgeState&&(o=this.edgeState.cell.value,r=this.edgeState.cell.style),null!=(s=this.insertEdge(l,null,o,e,n,r))){this.graph.setConnectionConstraint(s,e,!0,this.sourceConstraint),this.graph.setConnectionConstraint(s,n,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&i.setGeometry(s,this.edgeState.cell.geometry);var d=i.getGeometry(s);if(null==d&&((d=new mxGeometry).relative=!0,i.setGeometry(s,d)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,m=this.graph.view.translate;for(d.points=[],e=0;e<this.waypoints.length;e++){var u=this.waypoints[e];d.points.push(new mxPoint(u.x/c-m.x,u.y/c-m.y))}}null==n&&((u=this.graph.getPointForEvent(t,!1)).x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,d.setTerminalPoint(u,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",s,"event",t,"target",a))}}catch(e){mxLog.show(),mxLog.debug(e.message)}finally{i.endUpdate()}this.select&&this.selectCells(s,n)}},mxConnectionHandler.prototype.selectCells=function(e,n){this.graph.setSelectionCell(e)},mxConnectionHandler.prototype.insertEdge=function(e,n,t,a,i,s){return null==this.factoryMethod?this.graph.insertEdge(e,n,t,a,i,s):(n=this.createEdge(t,a,i,s),this.graph.addEdge(n,e,a,i))},mxConnectionHandler.prototype.createTargetVertex=function(e,n){for(var t=this.graph.getCellGeometry(n);null!=t&&t.relative;)n=this.graph.getModel().getParent(n),t=this.graph.getCellGeometry(n);var a=this.graph.cloneCells([n])[0];if(null!=(t=this.graph.getModel().getGeometry(a))){var i=this.graph.getPointForEvent(e);if(t.x=this.graph.snap(i.x-t.width/2)-this.graph.panDx/this.graph.view.scale,t.y=this.graph.snap(i.y-t.height/2)-this.graph.panDy/this.graph.view.scale,null!=this.first){var s=this.graph.view.getState(n);if(null!=s){var o=this.getAlignmentTolerance();Math.abs(this.graph.snap(this.first.x)-this.graph.snap(i.x))<=o?t.x=s.x:Math.abs(this.graph.snap(this.first.y)-this.graph.snap(i.y))<=o&&(t.y=s.y)}}}return a},mxConnectionHandler.prototype.getAlignmentTolerance=function(){return this.graph.isGridEnabled()?this.graph.gridSize:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(e,n,t,a){var i=null;return null!=this.factoryMethod&&(i=this.factoryMethod(n,t,a)),null==i&&((i=new mxCell(e||"")).setEdge(!0),i.setStyle(a),(e=new mxGeometry).relative=!0,i.setGeometry(e)),i},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(e){this.enabled=e},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var e=0;e<this.focusIcons.length;e++)this.focusIcons[e].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null},mxConstraintHandler.prototype.getTolerance=function(){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(e,n,t){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(e,n){return!1},mxConstraintHandler.prototype.update=function(e,n){if(this.isEnabled()&&!this.isEventIgnored(e)){var t=this.getTolerance(),a=new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t),i=null!=e.getCell()&&this.graph.isCellConnectable(e.getCell());if((null==this.currentFocusArea||!mxUtils.intersects(this.currentFocusArea,a)||null!=e.getState()&&null!=this.currentFocus&&i)&&(this.currentFocusArea=null,e.getState()!=this.currentFocus))if(this.currentFocus=null,this.constraints=null!=e.getState()&&i?this.graph.getAllConnectionConstraints(e.getState(),n):null,null!=this.constraints){if(this.currentFocus=e.getState(),this.currentFocusArea=new mxRectangle(e.getState().x,e.getState().y,e.getState().width,e.getState().height),null!=this.focusIcons){for(i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}for(this.focusIcons=[],this.focusPoints=[],i=0;i<this.constraints.length;i++){var s,o=this.graph.getConnectionPoint(e.getState(),this.constraints[i]),r=(s=this.getImageForConstraint(e.getState(),this.constraints[i],o)).src;(s=new mxImageShape(s=new mxRectangle(o.x-s.width/2,o.y-s.height/2,s.width,s.height),r)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.preserveImageAspect=!1,s.init(this.graph.getView().getOverlayPane()),null!=s.node.previousSibling&&s.node.parentNode.insertBefore(s.node,s.node.parentNode.firstChild),r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),s.redraw(),mxEvent.redirectMouseEvents(s.node,this.graph,r),this.currentFocusArea.add(s.bounds),this.focusIcons.push(s),this.focusPoints.push(o)}this.currentFocusArea.grow(t)}else if(null!=this.focusIcons){for(null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}if(this.currentPoint=this.currentConstraint=null,null!=this.focusIcons&&null!=this.constraints&&(null==e.getState()||this.currentFocus==e.getState()))for(i=0;i<this.focusIcons.length;i++)if(mxUtils.intersects(this.focusIcons[i].bounds,a)){this.currentConstraint=this.constraints[i],this.currentPoint=this.focusPoints[i],(t=this.focusIcons[i].bounds.clone()).grow(mxClient.IS_IE?3:2),mxClient.IS_IE&&(t.width-=1,t.height-=1),null==this.focusHighlight?((t=new mxRectangleShape(t,null,this.highlightColor,3)).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,t.init(this.graph.getView().getOverlayPane()),this.focusHighlight=t,r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),mxEvent.redirectMouseEvents(t.node,this.graph,r)):(this.focusHighlight.bounds=t,this.focusHighlight.redraw());break}null==this.currentConstraint&&null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)}},mxConstraintHandler.prototype.destroy=function(){this.reset()},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(e){this.enabled=e},mxRubberband.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(this.graph.isForceMarqueeEvent(n.getEvent())||null==n.getState())){var t=mxUtils.getOffset(this.graph.container),a=mxUtils.getScrollOrigin(this.graph.container);if(a.x-=t.x,a.y-=t.y,this.start(n.getX()+a.x,n.getY()+a.y),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var i=this.graph.container,s=function(e){e=new mxMouseEvent(e);var n=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=n.x,e.graphY=n.y,e};this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,s(e))}),this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,s(e))}),mxEvent.addListener(document,"mousemove",this.dragHandler),mxEvent.addListener(document,"mouseup",this.dropHandler)}n.consume(!1)}},mxRubberband.prototype.start=function(e,n){this.first=new mxPoint(e,n)},mxRubberband.prototype.mouseMove=function(e,n){if(!n.isConsumed()&&null!=this.first){var t=mxUtils.getScrollOrigin(this.graph.container),a=mxUtils.getOffset(this.graph.container);t.x-=a.x,t.y-=a.y;a=n.getX()+t.x,t=n.getY()+t.y;var i=this.first.x-a,s=this.first.y-t,o=this.graph.tolerance;(null!=this.div||Math.abs(i)>o||Math.abs(s)>o)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,t),n.consume())}},mxRubberband.prototype.createShape=function(){return null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv),this.sharedDiv},mxRubberband.prototype.mouseUp=function(e,n){var t=null!=this.div;this.reset(),t&&(t=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(t,n.getEvent()),n.consume())},mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div),null!=this.dragHandler&&(mxEvent.removeListener(document,"mousemove",this.dragHandler),this.dragHandler=null),null!=this.dropHandler&&(mxEvent.removeListener(document,"mouseup",this.dropHandler),this.dropHandler=null),this.currentY=this.currentX=0,this.div=this.first=null},mxRubberband.prototype.update=function(e,n){this.currentX=e,this.currentY=n,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var e=this.currentX-this.graph.panDx,n=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,e),this.y=Math.min(this.first.y,n),this.width=Math.max(this.first.x,e)-this.x,this.height=Math.max(this.first.y,n)-this.y,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.init(this.graph.getView().getOverlayPane()),this.graph.isCellMovable(this.state.cell)&&(this.selectionBorder.node.style.cursor=mxConstants.CURSOR_MOVABLE_VERTEX),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var e=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],e||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var n=0;e&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",n++)),this.sizers.push(this.createSizer("n-resize",n++)),this.sizers.push(this.createSizer("ne-resize",n++)),this.sizers.push(this.createSizer("w-resize",n++)),this.sizers.push(this.createSizer("e-resize",n++)),this.sizers.push(this.createSizer("sw-resize",n++)),this.sizers.push(this.createSizer("s-resize",n++))),this.sizers.push(this.createSizer("se-resize",n++))),null!=(e=this.graph.model.getGeometry(this.state.cell))&&!e.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,null,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.rotationEnabled&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(this.rotationShape=this.createSizer("pointer",mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.redraw()},mxVertexHandler.prototype.getSelectionBounds=function(e){return new mxRectangle(Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height))},mxVertexHandler.prototype.createSelectionShape=function(e){return(e=new mxRectangleShape(e,null,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(e,n,t,a){return t=new mxRectangle(0,0,t=t||mxConstants.HANDLE_SIZE,t),(a=this.createSizerShape(t,n,a)).isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(a.bounds.height-=1,a.bounds.width-=1,a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(a.node,this.graph,this.state),this.graph.isEnabled()&&(a.node.style.cursor=e),this.isSizerVisible(n)||(a.node.style.visibility="hidden"),a},mxVertexHandler.prototype.isSizerVisible=function(e){return!0},mxVertexHandler.prototype.createSizerShape=function(e,n,t){return null!=this.handleImage?(e.width=this.handleImage.width,e.height=this.handleImage.height,new mxImageShape(e,this.handleImage.src)):n==mxEvent.ROTATION_HANDLE?new mxEllipse(e,t||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(e,t||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(e,n,t){null!=e&&(e.bounds.x=Math.round(n-e.bounds.width/2),e.bounds.y=Math.round(t-e.bounds.height/2),e.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){if(e.isSource(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e.isSource(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var n=this.tolerance,t=(n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,0);t<this.sizers.length;t++)if(e.isSource(this.sizers[t])||null!=n&&mxUtils.intersects(this.sizers[t].bounds,n))return t;return null},mxVertexHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&(0<this.tolerance||n.getState()==this.state)){var t=this.getHandleForEvent(n);null!=t&&(this.start(n.getX(),n.getY(),t),n.consume())}},mxVertexHandler.prototype.start=function(e,n,t){e=mxUtils.convertPoint(this.graph.container,e,n),this.startX=e.x,this.startY=e.y,this.index=t,this.selectionBorder.node.style.display=t==mxEvent.ROTATION_HANDLE?"inline":"none",this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))},mxVertexHandler.prototype.mouseMove=function(e,n){if(n.isConsumed()||null==this.index)null!=this.getHandleForEvent(n)&&n.consume(!1);else{var t=new mxPoint(n.getGraphX(),n.getGraphY()),a=this.graph.isGridEnabledEvent(n.getEvent()),i=this.graph.getView().scale;if(this.index==mxEvent.LABEL_HANDLE)a&&(t.x=this.graph.snap(t.x/i)*i,t.y=this.graph.snap(t.y/i)*i),this.moveSizerTo(this.sizers[this.sizers.length-1],t.x,t.y);else if(this.index==mxEvent.ROTATION_HANDLE){var s=this.state.x+this.state.width/2-t.x,o=this.state.y+this.state.height/2-t.y;this.currentAlpha=0!=s?180*Math.atan(o/s)/Math.PI+90:o<0?180:0,0<s&&(this.currentAlpha-=180),this.rotationRaster&&(s=t.x-this.state.getCenterX(),o=t.y-this.state.getCenterY(),s=Math.abs(Math.sqrt(s*s+o*o)-this.state.height/2-20),s=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(s))))),this.currentAlpha=Math.round(this.currentAlpha/s)*s),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw()}else{var r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-r),d=Math.sin(-r),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=(s=t.x-this.startX,o=t.y-this.startY,t=this.graph.view.translate,d*s+l*o);s=l*s-d*o;this.bounds=this.union(this.selectionBounds,s,m,this.index,a,i,t),l=Math.cos(r),c=(d=Math.sin(r))*(s=(o=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY())).x-c.x)+l*(o=o.y-c.y)-o,this.bounds.x+=l*s-d*o-s,this.bounds.y+=c,this.drawPreview()}n.consume()}},mxVertexHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()&&null!=this.index&&null!=this.state){var t=new mxPoint(n.getGraphX(),n.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index==mxEvent.ROTATION_HANDLE)null!=this.currentAlpha&&this.rotateCell(this.state.cell,this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0));else{var a=this.graph.isGridEnabledEvent(n.getEvent()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(-i),o=Math.sin(-i),r=(t=o*(r=t.x-this.startX)+s*(l=t.y-this.startY),s*r-o*l),l=t,d=this.graph.view.scale;this.resizeCell(this.state.cell,r/d,l/d,this.index,a)}}finally{this.graph.getModel().endUpdate()}this.reset(),n.consume()}},mxVertexHandler.prototype.rotateCell=function(e,n){var t=this.graph.getModel();if(t.isVertex(e)){if(null!=(s=e==this.state?this.state:this.graph.view.getState(e))&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(s.style[mxConstants.STYLE_ROTATION]||0)+n,[e]),this.state.cell!=e&&(null!=(s=this.graph.getCellGeometry(e))&&!s.relative))if(0!=n){var a=this.graph.getModel().getParent(e),i=this.graph.getCellGeometry(a);if(!s.relative&&null!=i){var s,o=mxUtils.toRadians(n),r=(a=Math.cos(o),o=Math.sin(o),new mxPoint(s.getCenterX(),s.getCenterY()));i=new mxPoint(i.width/2,i.height/2),a=mxUtils.getRotatedPoint(r,a,o,i);(s=s.clone()).x=a.x-s.width/2,s.y=a.y-s.height/2,t.setGeometry(e,s)}}else(s=s.clone()).x+=dx,s.y+=dy,t.setGeometry(e,s);for(s=t.getChildCount(e),a=0;a<s;a++)this.rotateCell(t.getChildAt(e,a),n)}},mxVertexHandler.prototype.reset=function(){this.index=this.currentAlpha=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview())},mxVertexHandler.prototype.resizeCell=function(e,n,t,a,i){var s=this.graph.model.getGeometry(e);if(null!=s)if(a==mxEvent.LABEL_HANDLE)a=this.graph.view.scale,n=(this.labelShape.bounds.getCenterX()-this.startX)/a,t=(this.labelShape.bounds.getCenterY()-this.startY)/a,null==(s=s.clone()).offset?s.offset=new mxPoint(n,t):(s.offset.x+=n,s.offset.y+=t),this.graph.model.setGeometry(e,s);else{if(a=this.union(s,n,t,a,i,1,new mxPoint(0,0)),0!=(r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"))){n=a.getCenterX()-s.getCenterX(),t=a.getCenterY()-s.getCenterY(),i=Math.cos(r);var o=Math.sin(r),r=i*n-o*t-n;n=o*n+i*t-t,t=a.x-s.x;var l=a.y-s.y,d=i*t-o*l;i=o*t+i*l,a.x+=r,a.y+=n,this.graph.isCellCollapsed(e)||0==r&&0==n||(t=s.x-a.x+d,l=s.y-a.y+i,this.moveChildren(e,t,l))}this.graph.resizeCell(e,a)}},mxVertexHandler.prototype.moveChildren=function(e,n,t){for(var a=this.graph.getModel(),i=a.getChildCount(e),s=0;s<i;s++){var o=a.getChildAt(e,s);if(a.isVertex(o)){var r=this.graph.getCellGeometry(o);null!=r&&!r.relative&&((r=r.clone()).x+=n,r.y+=t,a.setGeometry(o,r))}}},mxVertexHandler.prototype.union=function(e,n,t,a,i,s,o){if(this.singleSizer){o=e.x+e.width+n;var r=e.y+e.height+t;return i&&(o=this.graph.snap(o/s)*s,r=this.graph.snap(r/s)*s),(s=new mxRectangle(e.x,e.y,0,0)).add(new mxRectangle(o,r,0,0)),s}var l=(r=e.x-o.x*s)+e.width,d=e.y-o.y*s;return e=d+e.height,4<a?(e+=t,i&&(e=this.graph.snap(e/s)*s)):a<3&&(d+=t,i&&(d=this.graph.snap(d/s)*s)),0==a||3==a||5==a?(r+=n,i&&(r=this.graph.snap(r/s)*s)):2!=a&&4!=a&&7!=a||(l+=n,i&&(l=this.graph.snap(l/s)*s)),e-=d,(i=l-r)<0&&(r+=i,i=Math.abs(i)),e<0&&(d+=e,e=Math.abs(e)),new mxRectangle(r+o.x*s,d+o.y*s,i,e)},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.state.x,this.state.y,this.state.width,this.state.height);var e=this.state;if(null!=this.sizers){var n=e.x+e.width,t=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],n,t);else{var a=e.x+e.width/2,i=e.y+e.height/2;if(1<this.sizers.length){var s=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),r=(s=Math.sin(s),new mxPoint(e.getCenterX(),e.getCenterY())),l=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),o,s,r);this.moveSizerTo(this.sizers[0],l.x,l.y),l.x=a,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[1],l.x,l.y),l.x=n,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[2],l.x,l.y),l.x=e.x,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[3],l.x,l.y),l.x=n,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[4],l.x,l.y),l.x=e.x,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[5],l.x,l.y),l.x=a,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[6],l.x,l.y),l.x=n,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[7],l.x,l.y),this.moveSizerTo(this.sizers[8],a+e.absoluteOffset.x,i+e.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],a+e.absoluteOffset.x,i+e.absoluteOffset.y):this.moveSizerTo(this.sizers[0],e.x,e.y)}}null!=this.rotationShape&&(s=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),s=Math.sin(s),r=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),l=mxUtils.getRotatedPoint(new mxPoint(e.x+e.width/2,e.y-16),o,s,r),this.moveSizerTo(this.rotationShape,l.x,l.y)),this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.drawPreview()},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.preview&&(this.preview.destroy(),this.preview=null),this.selectionBorder.destroy(),this.labelShape=this.selectionBorder=null,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy(),this.sizers[e]=null},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.svgStrokeTolerance=0,this.shape.node.style.cursor=mxConstants.CURSOR_MOVABLE_EDGE,mxEvent.addListener(this.shape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e,this.state.cell)})),mxEvent.addGestureListeners(this.shape.node,mxUtils.bind(this,function(e){this.addEnabled&&this.isAddPointEvent(e)?this.addPoint(this.state,e):this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,this.state))}),mxUtils.bind(this,function(e){var n=this.state.cell;if(null!=this.index){var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));n=this.graph.getCellAt(t.x,t.y);this.graph.isSwimlane(n)&&this.graph.hitsSwimlaneContent(n,t.x,t.y)&&(n=null)}this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,this.graph.getView().getState(n)))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,this.state))})),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var e=this.state.getVisibleTerminalState(!0);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container),this.preferHtml||null!=(e=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends()),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=new mxRectangleShape(new mxRectangle,mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR),this.labelShape.pointerEvents=!1,this.initBend(this.labelShape),this.labelShape.node.style.cursor=mxConstants.CURSOR_LABEL_HANDLE,mxEvent.redirectMouseEvents(this.labelShape.node,this.graph,this.state),this.redraw()},mxEdgeHandler.prototype.isAddPointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.isRemovePointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.getSelectionPoints=function(e){return e.absolutePoints},mxEdgeHandler.prototype.createSelectionShape=function(e){return(e=new mxPolyline(e,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(e){return!0},mxEdgeHandler.prototype.createMarker=function(){var e=new mxCellMarker(this.graph),a=this;return e.getCell=function(e){var n=mxCellMarker.prototype.getCell.apply(this,arguments);if(!a.isConnectableCell(n))return null;var t=a.graph.getModel();return(n==a.state.cell||null!=n&&!a.graph.connectableEdges&&t.isEdge(n))&&(n=null),n},e.isValidState=function(e){var n=a.graph.getModel();n=null!=(n=a.graph.view.getTerminalPort(e,a.graph.view.getState(n.getTerminal(a.state.cell,!a.isSource)),!a.isSource))?n.cell:null;return a.error=a.validateConnection(a.isSource?e.cell:n,a.isSource?n:e.cell),null==a.error},e},mxEdgeHandler.prototype.validateConnection=function(e,n){return this.graph.getEdgeValidationError(this.state.cell,e,n)},mxEdgeHandler.prototype.createBends=function(){for(var e=this.state.cell,n=[],t=0;t<this.abspoints.length;t++)if(this.isHandleVisible(t)){var a=t==this.abspoints.length-1;if((a=0==t||a)||this.graph.isCellBendable(e)){var i=this.createHandleShape(t);if(this.initBend(i),mxClient.IS_TOUCH&&i.node.setAttribute("pointer-events","none"),this.isHandleEnabled(t))if(mxClient.IS_TOUCH){var s=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(i.node,this.graph,s)}else i.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(i.node,this.graph,this.state);n.push(i),a||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}}return n},mxEdgeHandler.prototype.isHandleEnabled=function(e){return!0},mxEdgeHandler.prototype.isHandleVisible=function(e){return!0},mxEdgeHandler.prototype.createHandleShape=function(e){return null!=this.handleImage?new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src):(e=mxConstants.HANDLE_SIZE,this.preferHtml&&(e-=1),new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR))},mxEdgeHandler.prototype.initBend=function(e){this.preferHtml?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()))},mxEdgeHandler.prototype.getHandleForEvent=function(e){if(null!=this.bends)for(var n=this.tolerance,t=(n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,0);t<this.bends.length;t++)if((e.isSource(this.bends[t])||null!=n&&mxUtils.intersects(this.bends[t].bounds,n))&&"hidden"!=this.bends[t].node.style.visibility)return t;return!(e.isSource(this.labelShape)&&"hidden"!=this.labelShape.node.style.visibility||e.isSource(this.state.text))||(mxClient.IS_SF||mxClient.IS_GC)&&"SELECT"==e.getSource().nodeName?null:mxEvent.LABEL_HANDLE},mxEdgeHandler.prototype.mouseDown=function(e,n){var t=null;null!=(t=this.getHandleForEvent(n))&&!n.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&(this.removeEnabled&&this.isRemovePointEvent(n.getEvent())?this.removePoint(this.state,t):(t!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(n.getCell()))&&this.start(n.getX(),n.getY(),t),n.consume())},mxEdgeHandler.prototype.start=function(e,n,t){this.startX=e,this.startY=n,this.isSource=null!=this.bends&&0==t,this.isTarget=null!=this.bends&&t==this.bends.length-1,this.isLabel=t==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(e=this.state.cell,(null==(n=this.graph.model.getTerminal(e,this.isSource))&&this.graph.isTerminalPointMovable(e,this.isSource)||null!=n&&this.graph.isCellDisconnectable(e,n,this.isSource))&&(this.index=t)):this.index=t},mxEdgeHandler.prototype.clonePreviewState=function(e,n){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.getPointForEvent=function(e){var t=new mxPoint(e.getGraphX(),e.getGraphY()),a=this.getSnapToTerminalTolerance(),n=this.graph.getView(),i=!1,s=!1;if(this.snapToTerminals&&0<a){var o=function(e){if(null!=e){var n=e.x;Math.abs(t.x-n)<a&&(t.x=n,i=!0),e=e.y,Math.abs(t.y-e)<a&&(t.y=e,s=!0)}},r=function(e){null!=e&&o.call(this,new mxPoint(n.getRoutingCenterX(e),n.getRoutingCenterY(e)))};if(r.call(this,this.state.getVisibleTerminalState(!0)),r.call(this,this.state.getVisibleTerminalState(!1)),null!=this.abspoints)for(r=0;r<this.abspoints;r++)r!=this.index&&o.call(this,this.abspoints[r])}return this.graph.isGridEnabledEvent(e.getEvent())&&(e=n.scale,r=n.translate,i||(t.x=(this.graph.snap(t.x/e-r.x)+r.x)*e),s||(t.y=(this.graph.snap(t.y/e-r.y)+r.y)*e)),t},mxEdgeHandler.prototype.getPreviewTerminalState=function(e){this.constraintHandler.update(e,this.isSource),this.marker.process(e),e=this.marker.getValidState();var n=null;return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint&&this.marker.reset(),null!=e?n=e:null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(n=this.constraintHandler.currentFocus),n},mxEdgeHandler.prototype.getPreviewPoints=function(e){var n=null!=(n=this.graph.getCellGeometry(this.state.cell)).points?n.points.slice():null;return this.isSource||this.isTarget?this.graph.resetEdgesOnConnect&&(n=null):(this.convertPoint(e,!1),null==n?n=[e]:n[this.index-1]=e),n},mxEdgeHandler.prototype.updatePreviewState=function(e,n,t){var a=this.isSource?t:this.state.getVisibleTerminalState(!0),i=this.isTarget?t:this.state.getVisibleTerminalState(!1),s=this.graph.getConnectionConstraint(e,a,!0),o=this.graph.getConnectionConstraint(e,i,!1),r=this.constraintHandler.currentConstraint;null==r&&(r=new mxConnectionConstraint),this.isSource?s=r:this.isTarget&&(o=r),(!this.isSource||null!=a)&&e.view.updateFixedTerminalPoint(e,a,!0,s),(!this.isTarget||null!=i)&&e.view.updateFixedTerminalPoint(e,i,!1,o),(this.isSource||this.isTarget)&&null==t&&(e.setAbsoluteTerminalPoint(n,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),e.view.updatePoints(e,this.points,a,i),e.view.updateFloatingTerminalPoints(e,a,i)},mxEdgeHandler.prototype.mouseMove=function(e,n){if(null!=this.index&&null!=this.marker){var t=this.getPointForEvent(n);if(this.isLabel)this.label.x=t.x,this.label.y=t.y;else{this.points=this.getPreviewPoints(t);var a=this.isSource||this.isTarget?this.getPreviewTerminalState(n):null,i=this.clonePreviewState(t,null!=a?a.cell:null);this.updatePreviewState(i,t,a),this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor),this.abspoints=i.absolutePoints,this.active=!0}this.drawPreview(),mxEvent.consume(n.getEvent()),n.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(n)&&n.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(e,n){if(null!=this.index&&null!=this.marker){var t=this.state.cell;if(n.getX()!=this.startX||n.getY()!=this.startY)if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var a=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),null!=a)t=this.connect(t,a,this.isSource,this.graph.isCloneEvent(n.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable(),n);else if(this.graph.isAllowDanglingEdges()){(a=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=a.x/this.graph.view.scale-this.graph.view.translate.x,a.y=a.y/this.graph.view.scale-this.graph.view.translate.y;var i=this.graph.getView().getState(this.graph.getModel().getParent(t));null!=i&&(a.x-=i.origin.x,a.y-=i.origin.y),a.x-=this.graph.panDx/this.graph.view.scale,a.y-=this.graph.panDy/this.graph.view.scale,this.changeTerminalPoint(t,a,this.isSource)}}else this.active?this.changePoints(t,this.points):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().revalidate(this.state.cell));null!=this.marker&&(this.reset(),t!=this.state.cell&&this.graph.setSelectionCell(t)),n.consume()}},mxEdgeHandler.prototype.reset=function(){this.points=this.label=this.index=this.error=null,this.isTarget=this.isSource=this.isLabel=this.active=!1,this.marker.reset(),this.constraintHandler.reset(),this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(e){null!=this.shape&&(this.shape.stroke=e)},mxEdgeHandler.prototype.convertPoint=function(e,n){var t=this.graph.getView().getScale(),a=this.graph.getView().getTranslate();return n&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/t-a.x),e.y=Math.round(e.y/t-a.y),null!=(t=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell)))&&(e.x-=t.origin.x,e.y-=t.origin.y),e},mxEdgeHandler.prototype.moveLabel=function(e,n,t){var a=this.graph.getModel();if(null!=(i=a.getGeometry(e.cell))){var i=i.clone(),s=this.graph.getView().getRelativePoint(e,n,t);i.x=s.x,i.y=s.y;var o=this.graph.getView().scale;i.offset=new mxPoint(0,0),s=this.graph.view.getPoint(e,i),i.offset=new mxPoint((n-s.x)/o,(t-s.y)/o),a.setGeometry(e.cell,i)}},mxEdgeHandler.prototype.connect=function(e,n,t,a,i){var s=(i=this.graph.getModel()).getParent(e);i.beginUpdate();try{if(a){var o=e.clone();i.add(s,o,i.getChildCount(s));var r=i.getTerminal(e,!t);this.graph.connectCell(o,r,!t),e=o}var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(e,n,t,l)}finally{i.endUpdate()}return e},mxEdgeHandler.prototype.changeTerminalPoint=function(e,n,t){var a=this.graph.getModel(),i=a.getGeometry(e);if(null!=i){a.beginUpdate();try{(i=i.clone()).setTerminalPoint(n,t),a.setGeometry(e,i),this.graph.connectCell(e,null,t,new mxConnectionConstraint)}finally{a.endUpdate()}}},mxEdgeHandler.prototype.changePoints=function(e,n){var t=this.graph.getModel(),a=t.getGeometry(e);null!=a&&((a=a.clone()).points=n,t.setGeometry(e,a))},mxEdgeHandler.prototype.addPoint=function(e,n){var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),a=this.graph.isGridEnabledEvent(n);this.convertPoint(t,a),this.addPointAt(e,t.x,t.y),mxEvent.consume(n)},mxEdgeHandler.prototype.addPointAt=function(e,n,t){var a=this.graph.getCellGeometry(e.cell);if(n=new mxPoint(n,t),null!=a){a=a.clone(),t=this.graph.view.translate;var i=this.graph.view.scale;t=mxUtils.findNearestSegment(e,(n.x+t.x)*i,(n.y+t.y)*i),null==a.points?a.points=[n]:a.points.splice(t,0,n),this.graph.getModel().setGeometry(e.cell,a),this.destroy(),this.init()}},mxEdgeHandler.prototype.removePoint=function(e,n){if(0<n&&n<this.abspoints.length-1){var t=this.graph.getCellGeometry(this.state.cell);null!=t&&null!=t.points&&((t=t.clone()).points.splice(n-1,1),this.graph.getModel().setGeometry(e.cell,t),this.destroy(),this.init())}},mxEdgeHandler.prototype.getHandleFillColor=function(e){e=0==e;var n=this.state.cell,t=this.graph.getModel().getTerminal(n,e),a=mxConstants.HANDLE_FILLCOLOR;return null!=t&&!this.graph.isCellDisconnectable(n,t,e)||null==t&&!this.graph.isTerminalPointMovable(n,e)?a=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=t&&this.graph.isCellDisconnectable(n,t,e)&&(a=mxConstants.CONNECT_HANDLE_FILLCOLOR),a},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice();var e=this.state.cell,n=mxConstants.LABEL_HANDLE_SIZE;if(this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-n/2),Math.round(this.label.y-n/2),n,n),this.labelShape.redraw(),null!=(n=this.graph.getLabel(e))&&0<n.length&&this.graph.isLabelMovable(e)?this.labelShape.node.style.visibility="visible":this.labelShape.node.style.visibility="hidden",null!=this.bends&&0<this.bends.length){var t=this.abspoints.length-1,a=(e=this.abspoints[0],this.abspoints[0].y);n=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.round(this.abspoints[0].x-n.width/2),Math.round(a-n.height/2),n.width,n.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw();a=this.abspoints[t];var i=this.abspoints[t].x,s=(t=this.abspoints[t].y,this.bends.length-1);n=this.bends[s].bounds;this.bends[s].bounds=new mxRectangle(Math.round(i-n.width/2),Math.round(t-n.height/2),n.width,n.height),this.bends[s].fill=this.getHandleFillColor(s),this.bends[s].redraw(),this.redrawInnerBends(e,a)}this.drawPreview()},mxEdgeHandler.prototype.redrawInnerBends=function(e,n){var t=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=t){null==this.points&&(this.points=[]);for(var a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){var i=this.abspoints[a].x,s=this.abspoints[a].y,o=this.bends[a].bounds;this.bends[a].node.style.visibility="visible",this.bends[a].bounds=new mxRectangle(Math.round(i-o.width/2),Math.round(s-o.height/2),o.width,o.height),this.bends[a].redraw(),this.points[a-1]=t[a-1]}else this.bends[a].destroy(),this.bends[a]=null}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var e=mxConstants.LABEL_HANDLE_SIZE;e=new mxRectangle(Math.round(this.label.x-e/2),Math.round(this.label.y-e/2),e,e);this.labelShape.bounds=e,this.labelShape.redraw()}else this.shape.points=this.abspoints,this.shape.redraw()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.bends)for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null)},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype=new mxEdgeHandler,mxElbowEdgeHandler.prototype.constructor=mxElbowEdgeHandler,mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var e=[],n=this.createHandleShape(0);return this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e.push(this.createVirtualBend()),this.points.push(new mxPoint(0,0)),n=this.createHandleShape(2),this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e},mxElbowEdgeHandler.prototype.createVirtualBend=function(){var e=this.createHandleShape();this.initBend(e);var n=this.getCursorForBend();return e.node.style.cursor=n,n=mxUtils.bind(this,function(e){!mxEvent.isConsumed(e)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,e),mxEvent.consume(e))}),mxEvent.redirectMouseEvents(e.node,this.graph,this.state,null,null,null,n),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(e){var n=null;return null==this.bends||null==this.bends[1]||e!=this.bends[1].node&&e.parentNode!=this.bends[1].node||(n=this.doubleClickOrientationResource,n=mxResources.get(n)||n),n},mxElbowEdgeHandler.prototype.convertPoint=function(e,n){var t=this.graph.getView().getScale(),a=this.graph.getView().getTranslate(),i=this.state.origin;n&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/t-a.x-i.x),e.y=Math.round(e.y/t-a.y-i.y)},mxElbowEdgeHandler.prototype.redrawInnerBends=function(e,n){var t=null==(t=null!=(t=this.graph.getModel().getGeometry(this.state.cell).points)?t[0]:null)?new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2):new mxPoint(this.graph.getView().scale*(t.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(t.y+this.graph.getView().translate.y+this.state.origin.y)),a=(i=this.bends[1].bounds).width,i=i.height;null==this.handleImage&&(i=a=mxConstants.HANDLE_SIZE);var s=new mxRectangle(Math.round(t.x-a/2),Math.round(t.y-i/2),a,i);null==this.handleImage&&"hidden"!=this.labelShape.node.style.visibility&&mxUtils.intersects(s,this.labelShape.bounds)&&(a+=3,i+=3,s=new mxRectangle(Math.round(t.x-a/2),Math.round(t.y-i/2),a,i)),this.bends[1].bounds=s,this.bends[1].redraw()},mxUtils.extend(mxEdgeSegmentHandler,mxEdgeHandler),mxEdgeSegmentHandler.prototype=new mxElbowEdgeHandler,mxEdgeSegmentHandler.prototype.constructor=mxEdgeSegmentHandler,mxEdgeSegmentHandler.prototype.getPreviewPoints=function(e){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);this.convertPoint(e,!1);var n=this.state.absolutePoints,t=n[0].clone();this.convertPoint(t,!1);for(var a=[],i=1;i<n.length;i++){var s=n[i].clone();this.convertPoint(s,!1),i==this.index&&(t.x==s.x?(t.x=e.x,s.x=e.x):(t.y=e.y,s.y=e.y)),i<n.length-1&&a.push(s),t=s}if(1==a.length){if(t=this.state.view,i=this.state.getVisibleTerminalState(!0),null!=(s=this.state.getVisibleTerminalState(!1))&null!=i){var o=this.state.origin.x,r=this.state.origin.y;mxUtils.contains(s,a[0].x+o,a[0].y+r)?n[1].y==n[2].y?a[0].y=t.getRoutingCenterY(i)-r:a[0].x=t.getRoutingCenterX(i)-o:mxUtils.contains(i,a[0].x+o,a[0].y+r)&&(n[1].y==n[0].y?a[0].y=t.getRoutingCenterY(s)-r:a[0].x=t.getRoutingCenterX(s)-o)}}else 0==a.length&&(a=[e]);return a},mxEdgeSegmentHandler.prototype.createBends=function(){var e=[],n=this.createHandleShape(0);this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none");var t=this.state.absolutePoints;if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var a=0;a<t.length-1;a++)n=this.createVirtualBend(),e.push(n),n.node.style.cursor=0==t[a].x-t[a+1].x?"col-resize":"row-resize",this.points.push(new mxPoint(0,0)),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none")}return n=this.createHandleShape(t.length),this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.refresh=function(){if(null!=this.bends){for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null);this.bends=this.createBends()}},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(e,n){if(this.graph.isCellBendable(this.state.cell)){var t=mxConstants.HANDLE_SIZE,a=this.state.absolutePoints;if(null!=a&&1<a.length)for(var i=0;i<this.state.absolutePoints.length-1;i++)if(null!=this.bends[i+1]){e=a[i],n=a[i+1];var s=new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2);this.bends[i+1].bounds=new mxRectangle(Math.round(s.x-t/2),Math.round(s.y-t/2),t,t),this.bends[i+1].redraw()}}},mxEdgeSegmentHandler.prototype.changePoints=function(e,n){n=[];var t=this.abspoints;if(1<t.length)for(var a=t[0],i=t[1],s=2;s<t.length;s++){var o=t[s];Math.round(a.x)==Math.round(i.x)&&Math.round(i.x)==Math.round(o.x)||Math.round(a.y)==Math.round(i.y)&&Math.round(i.y)==Math.round(o.y)||(i=(a=i).clone(),this.convertPoint(i,!1),n.push(i)),i=o}mxElbowEdgeHandler.prototype.changePoints.apply(this,arguments)},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(e){this.enabled=e},mxKeyHandler.prototype.bindKey=function(e,n){this.normalKeys[e]=n},mxKeyHandler.prototype.bindShiftKey=function(e,n){this.shiftKeys[e]=n},mxKeyHandler.prototype.bindControlKey=function(e,n){this.controlKeys[e]=n},mxKeyHandler.prototype.bindControlShiftKey=function(e,n){this.controlShiftKeys[e]=n},mxKeyHandler.prototype.isControlDown=function(e){return mxEvent.isControlDown(e)},mxKeyHandler.prototype.getFunction=function(e){return null!=e?this.isControlDown(e)?mxEvent.isShiftDown(e)?this.controlShiftKeys[e.keyCode]:this.controlKeys[e.keyCode]:mxEvent.isShiftDown(e)?this.shiftKeys[e.keyCode]:this.normalKeys[e.keyCode]:null},mxKeyHandler.prototype.isGraphEvent=function(e){if((e=mxEvent.getSource(e))==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&e==this.graph.cellEditor.textarea)return!0;for(;null!=e;){if(e==this.graph.container)return!0;e=e.parentNode}return!1},mxKeyHandler.prototype.keyDown=function(e){if(this.graph.isEnabled()&&!mxEvent.isConsumed(e)&&this.isGraphEvent(e)&&this.isEnabled())if(27==e.keyCode)this.escape(e);else if(!this.graph.isEditing()){var n=this.getFunction(e);null!=n&&(n(e),mxEvent.consume(e))}},mxKeyHandler.prototype.escape=function(e){this.graph.isEscapeEnabled()&&this.graph.escape(e)},mxKeyHandler.prototype.destroy=function(){this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(e){this.enabled=e},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(e){this.hideOnHover=e},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",this.div.style.zIndex=this.zIndex,document.body.appendChild(this.div),mxEvent.addListener(this.div,"mousedown",mxUtils.bind(this,function(e){this.hideTooltip()})))},mxTooltipHandler.prototype.mouseDown=function(e,n){this.reset(n,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(e,n){n.getX()==this.lastX&&n.getY()==this.lastY||(this.reset(n,!0),(this.isHideOnHover()||n.getState()!=this.state||n.getSource()!=this.node&&(!this.stateSource||null!=n.getState()&&this.stateSource==(n.isSource(n.getState().shape)||!n.isSource(n.getState().text))))&&this.hideTooltip()),this.lastX=n.getX(),this.lastY=n.getY()},mxTooltipHandler.prototype.mouseUp=function(e,n){this.reset(n,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(e,n){if(this.resetTimer(),n&&this.isEnabled()&&null!=e.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var t=e.getState(),a=e.getSource(),i=e.getX(),s=e.getY(),o=e.isSource(t.shape)||e.isSource(t.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.panningHandler.isMenuShowing()){var e=this.graph.getTooltip(t,a,i,s);this.show(e,i,s),this.state=t,this.node=a,this.stateSource=o}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")},mxTooltipHandler.prototype.show=function(e,n,t){if(null!=e&&0<e.length){null==this.div&&this.init();var a=mxUtils.getScrollOrigin();this.div.style.left=n+a.x+"px",this.div.style.top=t+mxConstants.TOOLTIP_VERTICAL_OFFSET+a.y+"px",mxUtils.isNode(e)?(this.div.innerHTML="",this.div.appendChild(e)):this.div.innerHTML=e.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(e,n){},mxCellTracker.prototype.mouseMove=function(e,n){this.isEnabled()&&this.process(n)},mxCellTracker.prototype.mouseUp=function(e,n){this.reset()},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(e){this.highlightColor=e,null!=this.shape&&(this.shape.stroke=e)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var e=null;return(e=this.graph.model.isEdge(this.state.cell)?new mxPolyline(this.state.absolutePoints,this.highlightColor,this.strokeWidth):new mxRectangleShape(new mxRectangle,null,this.highlightColor,this.strokeWidth)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(e.node,this.graph,this.state),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=this.dashed,e},mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){var e=0;this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),e=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),0!=e&&(this.shape.rotation=e),this.shape.redraw()}},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(e){this.state!=e&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=e,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(e,n,t){var a=mxUtils.bind(this,function(){this.editor.execute(n)});t?this.handler.bindControlKey(e,a):this.handler.bindKey(e,a)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(e,n,t,a){if(null!=this.config){var i=this.createConditions(e,t,a);this.addItems(e,n,t,a,i,this.config.firstChild,null)}},mxDefaultPopupMenu.prototype.addItems=function(e,n,t,a,i,s,o){for(var r=!1;null!=s;){if("add"==s.nodeName){if(null==(l=s.getAttribute("if"))||i[l]){var l=s.getAttribute("as"),d=(l=mxResources.get(l)||l,mxUtils.eval(mxUtils.getTextContent(s))),c=s.getAttribute("action"),m=s.getAttribute("icon"),u=s.getAttribute("iconCls");r&&(n.addSeparator(o),r=!1),null!=m&&this.imageBasePath&&(m=this.imageBasePath+m),l=this.addAction(n,e,l,m,d,c,t,o,u),this.addItems(e,n,t,a,i,s.firstChild,l)}}else"separator"==s.nodeName&&(r=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(e,n,t,a,i,s,o,r,l){return e.addItem(t,a,function(e){"function"==typeof i&&i.call(n,n,o,e),null!=s&&n.execute(s,o,e)},r,l)},mxDefaultPopupMenu.prototype.createConditions=function(e,n,t){var a=e.graph.getModel(),i=a.getChildCount(n),s=[];for(s.nocell=null==n,s.ncells=1<e.graph.getSelectionCount(),s.notRoot=a.getRoot()!=a.getParent(e.graph.getDefaultParent()),s.cell=null!=n,a=null!=n&&1==e.graph.getSelectionCount(),s.nonEmpty=a&&0<i,s.expandable=a&&e.graph.isCellFoldable(n,!1),s.collapsable=a&&e.graph.isCellFoldable(n,!0),s.validRoot=a&&e.graph.isValidRoot(n),s.emptyValidRoot=s.validRoot&&0==i,s.swimlane=a&&e.graph.isSwimlane(n),i=this.config.getElementsByTagName("condition"),a=0;a<i.length;a++){var o=mxUtils.eval(mxUtils.getTextContent(i[a])),r=i[a].getAttribute("name");null!=r&&"function"==typeof o&&(s[r]=o(e,n,t))}return s},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(e){null!=e&&(this.toolbar=new mxToolbar(e),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(e,n){var t=n.getProperty("function");this.editor.insertFunction=null!=t?mxUtils.bind(this,function(){t.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(e,n,t,a){var i=mxUtils.bind(this,function(){null!=t&&0<t.length&&this.editor.execute(t)});return this.toolbar.addItem(e,n,i,a)},mxDefaultToolbar.prototype.addSeparator=function(e){e=e||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(e)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(e){return this.toolbar.addActionCombo(e)},mxDefaultToolbar.prototype.addActionOption=function(e,n,t){var a=mxUtils.bind(this,function(){this.editor.execute(t)});this.addOption(e,n,a)},mxDefaultToolbar.prototype.addOption=function(e,n,t){return this.toolbar.addOption(e,n,t)},mxDefaultToolbar.prototype.addMode=function(e,n,t,a,i){var s=mxUtils.bind(this,function(){this.editor.setMode(t),null!=i&&i(this.editor)});return this.toolbar.addSwitchMode(e,n,s,a)},mxDefaultToolbar.prototype.addPrototype=function(e,n,t,a,i,s){var o=function(){return"function"==typeof t?t():null!=t?t.clone():null},r=mxUtils.bind(this,function(e,n){"function"==typeof i?i(this.editor,o(),e,n):this.drop(o(),e,n),this.toolbar.resetMode(),mxEvent.consume(e)});return e=this.toolbar.addMode(e,n,r,a,null,s),this.installDropHandler(e,function(e,n,t){r(n,t)}),e},mxDefaultToolbar.prototype.drop=function(e,n,t){var a=this.editor.graph,i=a.getModel();if(null!=t&&!i.isEdge(t)&&this.connectOnDrop&&a.isCellConnectable(t))this.connect(e,n,t);else{for(;null!=t&&!a.isValidDropTarget(t,[e],n);)t=i.getParent(t);this.insert(e,n,t)}},mxDefaultToolbar.prototype.insert=function(e,n,t){var a=this.editor.graph;if(a.canImportCell(e)){var i=mxEvent.getClientX(n),s=mxEvent.getClientY(n);i=mxUtils.convertPoint(a.container,i,s);return a.isSplitEnabled()&&a.isSplitTarget(t,[e],n)?a.splitEdge(t,[e],null,i.x,i.y):this.editor.addVertex(t,e,i.x,i.y)}return null},mxDefaultToolbar.prototype.connect=function(e,n,t){var a=(n=this.editor.graph).getModel();if(null!=t&&n.isCellConnectable(e)&&n.isEdgeValid(null,t,e)){var i=null;a.beginUpdate();try{var s=a.getGeometry(t),o=a.getGeometry(e).clone();o.x=s.x+(s.width-o.width)/2,o.y=s.y+(s.height-o.height)/2;var r=this.spacing*n.gridSize,l=20*a.getDirectedEdgeCount(t,!0);this.editor.horizontalFlow?o.x+=(o.width+s.width)/2+r+l:o.y+=(o.height+s.height)/2+r+l,e.setGeometry(o);var d=a.getParent(t);if(n.addCell(e,d),n.constrainChild(e),i=this.editor.createEdge(t,e),null==a.getGeometry(i)){var c=new mxGeometry;c.relative=!0,a.setGeometry(i,c)}n.addEdge(i,d,t,e)}finally{a.endUpdate()}n.setSelectionCells([e,i]),n.scrollCellToVisible(e)}},mxDefaultToolbar.prototype.installDropHandler=function(n,t){var a=document.createElement("img");a.setAttribute("src",n.getAttribute("src"));var i=mxUtils.bind(this,function(e){a.style.width=2*n.offsetWidth+"px",a.style.height=2*n.offsetHeight+"px",mxUtils.makeDraggable(n,this.editor.graph,t,a),mxEvent.removeListener(a,"load",i)});mxClient.IS_IE?i():mxEvent.addListener(a,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.session=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="&#xa;",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.urlInit=null,mxEditor.prototype.urlNotify=null,mxEditor.prototype.urlPoll=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(e){this.modified=e},mxEditor.prototype.addActions=function(){this.addAction("save",function(e){e.save()}),this.addAction("print",function(e){new mxPrintPreview(e.graph,1).open()}),this.addAction("show",function(e){mxUtils.show(e.graph,null,10,10)}),this.addAction("exportImage",function(e){var n=e.getUrlImage();if(null==n||mxClient.IS_LOCAL)e.execute("show");else{var t=mxUtils.getViewXml(e.graph,1);t=mxUtils.getXml(t,"\n");mxUtils.submit(n,e.postParameterName+"="+encodeURIComponent(t),document,"_blank")}}),this.addAction("refresh",function(e){e.graph.refresh()}),this.addAction("cut",function(e){e.graph.isEnabled()&&mxClipboard.cut(e.graph)}),this.addAction("copy",function(e){e.graph.isEnabled()&&mxClipboard.copy(e.graph)}),this.addAction("paste",function(e){e.graph.isEnabled()&&mxClipboard.paste(e.graph)}),this.addAction("delete",function(e){e.graph.isEnabled()&&e.graph.removeCells()}),this.addAction("group",function(e){e.graph.isEnabled()&&e.graph.setSelectionCell(e.groupCells())}),this.addAction("ungroup",function(e){e.graph.isEnabled()&&e.graph.setSelectionCells(e.graph.ungroupCells())}),this.addAction("removeFromParent",function(e){e.graph.isEnabled()&&e.graph.removeCellsFromParent()}),this.addAction("undo",function(e){e.graph.isEnabled()&&e.undo()}),this.addAction("redo",function(e){e.graph.isEnabled()&&e.redo()}),this.addAction("zoomIn",function(e){e.graph.zoomIn()}),this.addAction("zoomOut",function(e){e.graph.zoomOut()}),this.addAction("actualSize",function(e){e.graph.zoomActual()}),this.addAction("fit",function(e){e.graph.fit()}),this.addAction("showProperties",function(e,n){e.showProperties(n)}),this.addAction("selectAll",function(e){e.graph.isEnabled()&&e.graph.selectAll()}),this.addAction("selectNone",function(e){e.graph.isEnabled()&&e.graph.clearSelection()}),this.addAction("selectVertices",function(e){e.graph.isEnabled()&&e.graph.selectVertices()}),this.addAction("selectEdges",function(e){e.graph.isEnabled()&&e.graph.selectEdges()}),this.addAction("edit",function(e,n){e.graph.isEnabled()&&e.graph.isCellEditable(n)&&e.graph.startEditingAtCell(n)}),this.addAction("toBack",function(e,n){e.graph.isEnabled()&&e.graph.orderCells(!0)}),this.addAction("toFront",function(e,n){e.graph.isEnabled()&&e.graph.orderCells(!1)}),this.addAction("enterGroup",function(e,n){e.graph.enterGroup(n)}),this.addAction("exitGroup",function(e){e.graph.exitGroup()}),this.addAction("home",function(e){e.graph.home()}),this.addAction("selectPrevious",function(e){e.graph.isEnabled()&&e.graph.selectPreviousCell()}),this.addAction("selectNext",function(e){e.graph.isEnabled()&&e.graph.selectNextCell()}),this.addAction("selectParent",function(e){e.graph.isEnabled()&&e.graph.selectParentCell()}),this.addAction("selectChild",function(e){e.graph.isEnabled()&&e.graph.selectChildCell()}),this.addAction("collapse",function(e){e.graph.isEnabled()&&e.graph.foldCells(!0)}),this.addAction("collapseAll",function(e){if(e.graph.isEnabled()){var n=e.graph.getChildVertices();e.graph.foldCells(!0,!1,n)}}),this.addAction("expand",function(e){e.graph.isEnabled()&&e.graph.foldCells(!1)}),this.addAction("expandAll",function(e){if(e.graph.isEnabled()){var n=e.graph.getChildVertices();e.graph.foldCells(!1,!1,n)}}),this.addAction("bold",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("shadow",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_SHADOW)}),this.addAction("alignCellsLeft",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(e){e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(e){var n=100*e.graph.getView().scale;n=parseFloat(mxUtils.prompt(mxResources.get(e.askZoomResource)||e.askZoomResource,n))/100;isNaN(n)||e.graph.getView().setScale(n)}),this.addAction("toggleTasks",function(e){null!=e.tasks?e.tasks.setVisible(!e.tasks.isVisible()):e.showTasks()}),this.addAction("toggleHelp",function(e){null!=e.help?e.help.setVisible(!e.help.isVisible()):e.showHelp()}),this.addAction("toggleOutline",function(e){null==e.outline?e.showOutline():e.outline.setVisible(!e.outline.isVisible())}),this.addAction("toggleConsole",function(e){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.createSession=function(){var e=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.SESSION,"session",e))});return this.connect(this.urlInit,this.urlPoll,this.urlNotify,e)},mxEditor.prototype.configure=function(e){null!=e&&(new mxCodec(e.ownerDocument).decode(e,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(e,n){this.actions[e]=n},mxEditor.prototype.execute=function(n,e,t){var a=this.actions[n];if(null!=a)try{var i=arguments;i[0]=this,a.apply(this,i)}catch(e){throw mxUtils.error("Cannot execute "+n+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+n,280,!0)},mxEditor.prototype.addTemplate=function(e,n){this.templates[e]=n},mxEditor.prototype.getTemplate=function(e){return this.templates[e]},mxEditor.prototype.createGraph=function(){var e=new mxGraph(null,null,this.graphRenderHint);return e.setTooltips(!0),e.setPanning(!0),this.installDblClickHandler(e),this.installUndoHandler(e),this.installDrillHandler(e),this.installChangeHandler(e),this.installInsertHandler(e),e.panningHandler.factoryMethod=mxUtils.bind(this,function(e,n,t){return this.createPopupMenu(e,n,t)}),e.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,n){return this.createEdge(e,n)}),this.createSwimlaneManager(e),this.createLayoutManager(e),e},mxEditor.prototype.createSwimlaneManager=function(e){return(e=new mxSwimlaneManager(e,!1)).isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(a){var e=new mxLayoutManager(a),i=this;return e.getLayout=function(e){var n=null,t=i.graph.getModel();return null!=t.getParent(e)&&(i.layoutSwimlanes&&a.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),n=i.swimlaneLayout):i.layoutDiagram&&(a.isValidRoot(e)||null==t.getParent(t.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),n=i.diagramLayout)),n},e},mxEditor.prototype.setGraphContainer=function(e){null==this.graph.container&&(this.graph.init(e),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(e),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.installDblClickHandler=function(a){a.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,n){var t=n.getProperty("cell");null!=t&&a.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,t),n.consume())}))},mxEditor.prototype.installUndoHandler=function(a){var e=mxUtils.bind(this,function(e,n){var t=n.getProperty("edit");this.undoManager.undoableEditHappened(t)});a.getModel().addListener(mxEvent.UNDO,e),a.getView().addListener(mxEvent.UNDO,e),e=function(e,n){var t=n.getProperty("edit").changes;a.setSelectionCells(a.getSelectionCellsForChanges(t))},this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(e){var n=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.ROOT))});e.getView().addListener(mxEvent.DOWN,n),e.getView().addListener(mxEvent.UP,n)},mxEditor.prototype.installChangeHandler=function(s){var e=mxUtils.bind(this,function(e,n){this.setModified(!0),1==this.validating&&s.validateGraph();for(var t=n.getProperty("edit").changes,a=0;a<t.length;a++){var i=t[a];if(i instanceof mxRootChange||i instanceof mxValueChange&&i.cell==this.graph.model.root||i instanceof mxCellAttributeChange&&i.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});s.getModel().addListener(mxEvent.CHANGE,e)},mxEditor.prototype.installInsertHandler=function(e){var t=this;e.addMouseListener({mouseDown:function(e,n){null==t.insertFunction||n.isPopupTrigger()||!t.forcedInserting&&null!=n.getState()||(t.graph.clearSelection(),t.insertFunction(n.getEvent(),n.getCell()),this.isActive=!0,n.consume())},mouseMove:function(e,n){this.isActive&&n.consume()},mouseUp:function(e,n){this.isActive&&(this.isActive=!1,n.consume())}})},mxEditor.prototype.createDiagramLayout=function(){var e=this.graph.gridSize,n=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*e,2*e);return n.isVertexIgnored=function(e){return!n.graph.isSwimlane(e)},n},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(e){this.toolbar.init(e),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.setStatusContainer=function(e){null==this.status&&(this.status=e,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var e=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+e)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.setStatus=function(e){null!=this.status&&null!=e&&(this.status.innerHTML=e)},mxEditor.prototype.setTitleContainer=function(n){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(e){n.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(n)},mxEditor.prototype.treeLayout=function(e,n){null!=e&&new mxCompactTreeLayout(this.graph,n).execute(e)},mxEditor.prototype.getTitle=function(){for(var e="",n=this.graph,t=n.getCurrentRoot();null!=t&&null!=n.getModel().getParent(n.getModel().getParent(t));)n.isValidRoot(t)&&(e=" > "+n.convertValueToString(t)+e),t=n.getModel().getParent(t);return this.getRootTitle()+e},mxEditor.prototype.getRootTitle=function(){var e=this.graph.getModel().getRoot();return this.graph.convertValueToString(e)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var e=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),e)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(e){if(null!=e){var n=mxUtils.load(e).getXml();this.readGraphModel(n.documentElement),this.filename=e,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",e))}},mxEditor.prototype.readGraphModel=function(e){new mxCodec(e.ownerDocument).decode(e,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(e,n){if(null!=(e=e||this.getUrlPost())&&0<e.length){var t=this.writeGraphModel(n);this.postDiagram(e,t),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",e))},mxEditor.prototype.postDiagram=function(n,t){this.escapePostData&&(t=encodeURIComponent(t)),mxUtils.post(n,this.postParameterName+"="+t,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.POST,"request",e,"url",n,"data",t))}))},mxEditor.prototype.writeGraphModel=function(e){e=null!=e?e:this.linefeed;var n=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(n,e)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.connect=function(e,n,t,a){var i=null;return mxClient.IS_LOCAL||((i=new mxSession(this.graph.getModel(),e,n,t)).addListener(mxEvent.RECEIVE,mxUtils.bind(this,function(e,n){null!=n.getProperty("node").getAttribute("namespace")&&this.resetHistory()})),i.addListener(mxEvent.DISCONNECT,a),i.addListener(mxEvent.CONNECT,a),i.addListener(mxEvent.NOTIFY,a),i.addListener(mxEvent.GET,a),i.start()),i},mxEditor.prototype.swapStyles=function(e,n){var t=this.graph.getStylesheet().styles[n];this.graph.getView().getStylesheet().putCellStyle(n,this.graph.getStylesheet().styles[e]),this.graph.getStylesheet().putCellStyle(e,t),this.graph.refresh()},mxEditor.prototype.showProperties=function(e){if(null==(e=e||this.graph.getSelectionCell())&&(null==(e=this.graph.getCurrentRoot())&&(e=this.graph.getModel().getRoot())),null!=e){this.graph.stopEditing(!0);var n=(t=mxUtils.getOffset(this.graph.container)).x+10,t=t.y;if(null==this.properties||this.movePropertiesDialog){var a=this.graph.getCellBounds(e);null!=a&&(n+=a.x+Math.min(200,a.width),t+=a.y)}else n=this.properties.getX(),t=this.properties.getY();this.hideProperties(),null!=(e=this.createProperties(e))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,e,n,t,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var a=this.graph.getModel(),e=a.getValue(t);if(mxUtils.isNode(e)){var n=new mxForm("properties");n.addText("ID",t.getId()).setAttribute("readonly","true");var i=null,s=null,o=null,r=null,l=null;a.isVertex(t)&&(null!=(i=a.getGeometry(t))&&(s=n.addText("top",i.y),o=n.addText("left",i.x),r=n.addText("width",i.width),l=n.addText("height",i.height)));var d=a.getStyle(t),c=n.addText("Style",d||""),m=e.attributes,u=[];for(e=0;e<m.length;e++)u[e]=n.addTextarea(m[e].nodeName,m[e].nodeValue,"label"==m[e].nodeName?4:2);return e=mxUtils.bind(this,function(){this.hideProperties(),a.beginUpdate();try{null!=i&&((i=i.clone()).x=parseFloat(o.value),i.y=parseFloat(s.value),i.width=parseFloat(r.value),i.height=parseFloat(l.value),a.setGeometry(t,i)),0<c.value.length?a.setStyle(t,c.value):a.setStyle(t,null);for(var e=0;e<m.length;e++){var n=new mxCellAttributeChange(t,m[e].nodeName,u[e].value);a.execute(n)}this.graph.isAutoSizeCell(t)&&this.graph.updateCellSize(t)}finally{a.endUpdate()}}),d=mxUtils.bind(this,function(){this.hideProperties()}),n.addButtons(e,d),n.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var n=document.createElement("div");n.style.padding="4px",n.style.paddingLeft="20px";var e=document.body.clientWidth;(e=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,n,e-220,this.tasksTop,200)).setClosable(!0),e.destroyOnClose=!1;var t=mxUtils.bind(this,function(e){mxEvent.release(n),n.innerHTML="",this.createTasks(n)});this.graph.getModel().addListener(mxEvent.CHANGE,t),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,t),this.graph.addListener(mxEvent.ROOT,t),null!=this.tasksWindowImage&&e.setImage(this.tasksWindowImage),this.tasks=e,this.createTasks(n)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(e){null!=this.tasks&&(e=this.tasks.content,mxEvent.release(e),e.innerHTML="",this.createTasks(e))},mxEditor.prototype.createTasks=function(e){},mxEditor.prototype.showHelp=function(e){if(null==this.help){var n=document.createElement("iframe");n.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),n.setAttribute("height","100%"),n.setAttribute("width","100%"),n.setAttribute("frameBorder","0"),n.style.backgroundColor="white",e=document.body.clientWidth;var t=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,n,(e-this.helpWidth)/2,(t-this.helpHeight)/3,this.helpWidth,this.helpHeight);a.setMaximizable(!0),a.setClosable(!0),a.destroyOnClose=!1,a.setResizable(!0),null!=this.helpWindowImage&&a.setImage(this.helpWindowImage),mxClient.IS_NS&&(e=function(e){n.setAttribute("height",a.div.offsetHeight-26+"px")},a.addListener(mxEvent.RESIZE_END,e),a.addListener(mxEvent.MAXIMIZE,e),a.addListener(mxEvent.NORMALIZE,e),a.addListener(mxEvent.SHOW,e)),this.help=a}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var e=document.createElement("div");e.style.overflow="hidden",e.style.width="100%",e.style.height="100%",e.style.background="white",e.style.cursor="move";var n=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,!1),t=new mxOutline(this.graph,e);n.setClosable(!0),n.setResizable(!0),n.destroyOnClose=!1,n.addListener(mxEvent.RESIZE_END,function(){t.update()}),this.outline=n,this.outline.outline=t}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(e){"select"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==e&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(e,n,t){this.popupHandler.createMenu(this,e,n,t)},mxEditor.prototype.createEdge=function(e,n){var t=null;if(null!=this.defaultEdge)t=this.graph.getModel().cloneCell(this.defaultEdge);else{(t=new mxCell("")).setEdge(!0);var a=new mxGeometry;a.relative=!0,t.setGeometry(a)}return null!=(a=this.getEdgeStyle())&&t.setStyle(a),t},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(e){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(e)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(e){if(null!=this.cycleAttributeName){var n=this.consumeCycleAttribute(e);null!=n&&e.setStyle(e.getStyle()+";"+this.cycleAttributeName+"="+n)}},mxEditor.prototype.addVertex=function(e,n,t,a){for(var i=this.graph.getModel();null!=e&&!this.graph.isValidDropTarget(e);)e=i.getParent(e);e=null!=e?e:this.graph.getSwimlaneAt(t,a);var s=this.graph.getView().scale,o=i.getGeometry(n),r=i.getGeometry(e);if(this.graph.isSwimlane(n)&&!this.graph.swimlaneNesting)e=null;else{if(null==e&&this.swimlaneRequired)return null;if(null!=e&&null!=r){var l=this.graph.getView().getState(e);if(null!=l){if(t-=l.origin.x*s,a-=l.origin.y*s,this.graph.isConstrainedMoving){r=o.width;var d=o.height,c=l.x+l.width;c<t+r&&(t-=t+r-c),(c=l.y+l.height)<a+d&&(a-=a+d-c)}}else null!=r&&(t-=r.x*s,a-=r.y*s)}}(o=o.clone()).x=this.graph.snap(t/s-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(a/s-this.graph.getView().translate.y-this.graph.gridSize/2),n.setGeometry(o),null==e&&(e=this.graph.getDefaultParent()),this.cycleAttribute(n),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",n,"parent",e)),i.beginUpdate();try{null!=(n=this.graph.addCell(n,e))&&(this.graph.constrainChild(n),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",n)))}finally{i.endUpdate()}return null!=n&&(this.graph.setSelectionCell(n),this.graph.scrollCellToVisible(n),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",n))),n},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(e){if(null!=e){var n=e.getName();mxCodecRegistry.codecs[n]=e;var t=mxUtils.getFunctionName(e.template.constructor);t!=n&&mxCodecRegistry.addAlias(t,n)}return e},addAlias:function(e,n){mxCodecRegistry.aliases[e]=n},getCodec:function(e){var n=null;if(null!=e){n=mxUtils.getFunctionName(e);var t=mxCodecRegistry.aliases[n];if(null!=t&&(n=t),null==(n=mxCodecRegistry.codecs[n]))try{n=new mxObjectCodec(new e),mxCodecRegistry.register(n)}catch(e){}}return n}};function mxCodec(e){this.document=e||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(e,n,t,a){for(var i in this.template=e,this.exclude=null!=n?n:[],this.idrefs=null!=t?t:[],this.mapping=null!=a?a:[],this.reverse={},this.mapping)this.reverse[this.mapping[i]]=i}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(e,n){return this.objects[e]=n},mxCodec.prototype.getObject=function(e){var n=null;return null!=e&&(null==(n=this.objects[e])&&(null==(n=this.lookup(e))&&(null!=(e=this.getElementById(e))&&(n=this.decode(e))))),n},mxCodec.prototype.lookup=function(e){return null},mxCodec.prototype.getElementById=function(e,n){return mxUtils.findNodeByAttribute(this.document.documentElement,null!=n?n:"id",e)},mxCodec.prototype.getId=function(e){var n=null;return null!=e&&(null==(n=this.reference(e))&&e instanceof mxCell&&(null==(n=e.getId())&&(0==(n=mxCellPath.create(e)).length&&(n="root")))),n},mxCodec.prototype.reference=function(e){return null},mxCodec.prototype.encode=function(e){var n=null;if(null!=e&&null!=e.constructor){var t=mxCodecRegistry.getCodec(e.constructor);null!=t?n=t.encode(this,e):mxUtils.isNode(e)?n=mxClient.IS_IE?e.cloneNode(!0):this.document.importNode(e,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(e.constructor))}return n},mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=null;try{d=eval(a.nodeName)}catch(e){}try{var f=mxCodecRegistry.getCodec(d);null!=f?c=f.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}catch(e){mxLog.debug("Cannot decode "+a.nodeName+": "+e.message)}}return c},mxCodec.prototype.encodeCell=function(e,n,t){if(n.appendChild(this.encode(e)),null==t||t){t=e.getChildCount();for(var a=0;a<t;a++)this.encodeCell(e.getChildAt(a),n)}},mxCodec.prototype.isCellCodec=function(e){return null!=e&&"function"==typeof e.isCellCodec&&e.isCellCodec()},mxCodec.prototype.decodeCell=function(e,n){n=null==n||n;var t=null;if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){if(t=mxCodecRegistry.getCodec(e.nodeName),!this.isCellCodec(t))for(var a=e.firstChild;null!=a&&!this.isCellCodec(t);)t=mxCodecRegistry.getCodec(a.nodeName),a=a.nextSibling;this.isCellCodec(t)||(t=mxCodecRegistry.getCodec(mxCell)),t=t.decode(this,e),n&&this.insertIntoGraph(t)}return t},mxCodec.prototype.insertIntoGraph=function(e){var n=e.parent,t=e.getTerminal(!0),a=e.getTerminal(!1);e.setTerminal(null,!1),e.setTerminal(null,!0),(e.parent=null)!=n&&n.insert(e),null!=t&&t.insertEdge(e,!0),null!=a&&a.insertEdge(e,!1)},mxCodec.prototype.setAttribute=function(e,n,t){null!=n&&null!=t&&e.setAttribute(n,t)},mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(e){if(null!=e){var n=this.reverse[e];null!=n&&(e=n)}return e},mxObjectCodec.prototype.getAttributeName=function(e){if(null!=e){var n=this.mapping[e];null!=n&&(e=n)}return e},mxObjectCodec.prototype.isExcluded=function(e,n,t,a){return n==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,n)},mxObjectCodec.prototype.isReference=function(e,n,t,a){return 0<=mxUtils.indexOf(this.idrefs,n)},mxObjectCodec.prototype.encode=function(e,n){var t=e.document.createElement(this.getName());return n=this.beforeEncode(e,n,t),this.encodeObject(e,n,t),this.afterEncode(e,n,t)},mxObjectCodec.prototype.encodeObject=function(e,n,t){for(var a in e.setAttribute(t,"id",e.getId(n)),n){var i=a,s=n[i];null!=s&&!this.isExcluded(n,i,s,!0)&&(mxUtils.isNumeric(i)&&(i=null),this.encodeValue(e,n,i,s,t))}},mxObjectCodec.prototype.encodeValue=function(e,n,t,a,i){if(null!=a){if(this.isReference(n,t,a,!0)){var s=e.getId(a);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+t+"="+a);a=s}s=this.template[t],(null==t||e.encodeDefaults||s!=a)&&(t=this.getAttributeName(t),this.writeAttribute(e,n,t,a,i))}},mxObjectCodec.prototype.writeAttribute=function(e,n,t,a,i){"object"!=typeof a?this.writePrimitiveAttribute(e,n,t,a,i):this.writeComplexAttribute(e,n,t,a,i)},mxObjectCodec.prototype.writePrimitiveAttribute=function(e,n,t,a,i){a=this.convertValueToXml(a),null==t?(n=e.document.createElement("add"),"function"==typeof a?n.appendChild(e.document.createTextNode(a)):e.setAttribute(n,"value",a),i.appendChild(n)):"function"!=typeof a&&e.setAttribute(i,t,a)},mxObjectCodec.prototype.writeComplexAttribute=function(e,n,t,a,i){null!=(e=e.encode(a))?(null!=t&&e.setAttribute("as",t),i.appendChild(e)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+t+": "+a)},mxObjectCodec.prototype.convertValueToXml=function(e){return void 0!==e.length||1!=e&&0!=e||(e=1==e?"1":"0"),e},mxObjectCodec.prototype.convertValueFromXml=function(e){return mxUtils.isNumeric(e)&&(e=parseFloat(e)),e},mxObjectCodec.prototype.beforeEncode=function(e,n,t){return n},mxObjectCodec.prototype.afterEncode=function(e,n,t){return t},mxObjectCodec.prototype.decode=function(e,n,t){var a=n.getAttribute("id"),i=e.objects[a];return null==i&&(i=t||this.cloneTemplate(),null!=a&&e.putObject(a,i)),n=this.beforeDecode(e,n,i),this.decodeNode(e,n,i),this.afterDecode(e,n,i)},mxObjectCodec.prototype.decodeNode=function(e,n,t){null!=n&&(this.decodeAttributes(e,n,t),this.decodeChildren(e,n,t))},mxObjectCodec.prototype.decodeAttributes=function(e,n,t){if(null!=(n=n.attributes))for(var a=0;a<n.length;a++)this.decodeAttribute(e,n[a],t)},mxObjectCodec.prototype.decodeAttribute=function(e,n,t){var a=n.nodeName;if("as"!=a&&"id"!=a){n="value"==a?n.nodeValue:this.convertValueFromXml(n.nodeValue);var i=this.getFieldName(a);if(this.isReference(t,i,n,!1)){if(null==(e=e.getObject(n)))return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+a+"="+n);n=e}this.isExcluded(t,a,n,!1)||(t[a]=n)}},mxObjectCodec.prototype.decodeChildren=function(e,n,t){for(n=n.firstChild;null!=n;){var a=n.nextSibling;n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,n,t)&&this.decodeChild(e,n,t),n=a}},mxObjectCodec.prototype.decodeChild=function(e,n,t){var a=this.getFieldName(n.getAttribute("as"));if(null==a||!this.isExcluded(t,a,n,!1)){var i=this.getFieldTemplate(t,a,n),s=null;"add"==n.nodeName?null==(s=n.getAttribute("value"))&&(s=mxUtils.eval(mxUtils.getTextContent(n))):s=e.decode(n,i),this.addObjectValue(t,a,s,i)}},mxObjectCodec.prototype.getFieldTemplate=function(e,n,t){return(e=e[n])instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(e,n,t,a){null!=t&&t!=a&&(null!=n&&0<n.length?e[n]=t:e.push(t))},mxObjectCodec.prototype.processInclude=function(e,n,t){if("include"!=n.nodeName)return!1;if(null!=(n=n.getAttribute("name")))try{var a=mxUtils.load(n).getDocumentElement();null!=a&&e.decode(a,t)}catch(e){}return!0},mxObjectCodec.prototype.beforeDecode=function(e,n,t){return n},mxObjectCodec.prototype.afterDecode=function(e,n,t){return t},mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return e.isCellCodec=function(){return!0},e.isExcluded=function(e,n,t,a){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||a&&"value"==n&&t.nodeType==mxConstants.NODETYPE_ELEMENT},e.afterEncode=function(e,n,t){if(null!=n.value&&n.value.nodeType==mxConstants.NODETYPE_ELEMENT){var a=t;(t=mxClient.IS_IE?n.value.cloneNode(!0):e.document.importNode(n.value,!0)).appendChild(a),e=a.getAttribute("id"),t.setAttribute("id",e),a.removeAttribute("id")}return t},e.beforeDecode=function(e,n,t){var a=n,i=this.getName();if(n.nodeName!=i?(null!=(a=n.getElementsByTagName(i)[0])&&a.parentNode==n?(mxUtils.removeWhitespace(a,!0),mxUtils.removeWhitespace(a,!1),a.parentNode.removeChild(a)):a=null,t.value=n.cloneNode(!0),null!=(n=t.value.getAttribute("id"))&&(t.setId(n),t.value.removeAttribute("id"))):t.setId(n.getAttribute("id")),null!=a)for(n=0;n<this.idrefs.length;n++){i=this.idrefs[n];var s=a.getAttribute(i);if(null!=s){a.removeAttribute(i);var o=e.objects[s]||e.lookup(s);null==o&&(null!=(s=e.getElementById(s))&&(o=(mxCodecRegistry.codecs[s.nodeName]||this).decode(e,s))),t[i]=o}}return a},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphModel);return e.encodeObject=function(e,n,t){var a=e.document.createElement("root");e.encodeCell(n.getRoot(),a),t.appendChild(a)},e.decodeChild=function(e,n,t){"root"==n.nodeName?this.decodeRoot(e,n,t):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeRoot=function(e,n,t){var a=null;for(n=n.firstChild;null!=n;){var i=e.decodeCell(n);null!=i&&null==i.getParent()&&(a=i),n=n.nextSibling}null!=a&&t.setRoot(a)},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return e.afterEncode=function(e,n,t){return e.encodeCell(n.root,t),t},e.beforeDecode=function(e,n,t){if(null!=n.firstChild&&n.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(n=n.cloneNode(!0)).firstChild;for(t.root=e.decodeCell(a,!1),t=a.nextSibling,a.parentNode.removeChild(a),a=t;null!=a;)t=a.nextSibling,e.decodeCell(a),a.parentNode.removeChild(a),a=t}return n},e.afterDecode=function(e,n,t){return t.previous=t.root,t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return e.isReference=function(e,n,t,a){return!("child"!=n||null==e.previous&&a)||0<=mxUtils.indexOf(this.idrefs,n)},e.afterEncode=function(e,n,t){return this.isReference(n,"child",n.child,!0)?t.setAttribute("child",e.getId(n.child)):e.encodeCell(n.child,t),t},e.beforeDecode=function(e,n,t){if(null!=n.firstChild&&n.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(n=n.cloneNode(!0)).firstChild;for(t.child=e.decodeCell(a,!1),t=a.nextSibling,a.parentNode.removeChild(a),a=t;null!=a;){if(t=a.nextSibling,a.nodeType==mxConstants.NODETYPE_ELEMENT){var i=a.getAttribute("id");null==e.lookup(i)&&e.decodeCell(a)}a.parentNode.removeChild(a),a=t}}else a=n.getAttribute("child"),t.child=e.getObject(a);return n},e.afterDecode=function(e,n,t){return t.child.parent=t.previous,t.previous=t.parent,t.previousIndex=t.index,t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return e.afterDecode=function(e,n,t){return t.previous=t.terminal,t},e}());var mxGenericChangeCodec=function(e,a){var n=new mxObjectCodec(e,["model","previous"],["cell"]);return n.afterDecode=function(e,n,t){return mxUtils.isNode(t.cell)&&(t.cell=e.decodeCell(t.cell,!1)),t.previous=t[a],t},n};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphView);return e.encode=function(e,n){return this.encodeCell(e,n,n.graph.getModel().getRoot())},e.encodeCell=function(e,n,t){var a=n.graph.getModel(),i=n.getState(t),s=a.getParent(t);if(null==s||null!=i){var o=a.getChildCount(t),r=n.graph.getCellGeometry(t),l=null;if(s==a.getRoot()?l="layer":null==s?l="graph":a.isEdge(t)?l="edge":0<o&&null!=r?l="group":a.isVertex(t)&&(l="vertex"),null!=l){var d=e.document.createElement(l);if(null!=n.graph.getLabel(t)&&(d.setAttribute("label",n.graph.getLabel(t)),n.graph.isHtmlLabel(t)&&d.setAttribute("html",!0)),null==s){var c=n.getGraphBounds();null!=c&&(d.setAttribute("x",Math.round(c.x)),d.setAttribute("y",Math.round(c.y)),d.setAttribute("width",Math.round(c.width)),d.setAttribute("height",Math.round(c.height))),d.setAttribute("scale",n.scale)}else if(null!=i&&null!=r){for(c in i.style)"function"==typeof(s=i.style[c])&&"object"==typeof s&&(s=mxStyleRegistry.getName(s)),null!=s&&"function"!=typeof s&&"object"!=typeof s&&d.setAttribute(c,s);if(null!=(s=i.absolutePoints)&&0<s.length){for(r=Math.round(s[0].x)+","+Math.round(s[0].y),c=1;c<s.length;c++)r+=" "+Math.round(s[c].x)+","+Math.round(s[c].y);d.setAttribute("points",r)}else d.setAttribute("x",Math.round(i.x)),d.setAttribute("y",Math.round(i.y)),d.setAttribute("width",Math.round(i.width)),d.setAttribute("height",Math.round(i.height));null!=(c=i.absoluteOffset)&&(0!=c.x&&d.setAttribute("dx",Math.round(c.x)),0!=c.y&&d.setAttribute("dy",Math.round(c.y)))}for(c=0;c<o;c++)null!=(i=this.encodeCell(e,n,a.getChildAt(t,c)))&&d.appendChild(i)}}return d},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxStylesheet);return e.encode=function(e,n){var t,a=e.document.createElement(this.getName());for(t in n.styles){var i=n.styles[t],s=e.document.createElement("add");if(null!=t){for(var o in s.setAttribute("as",t),i){var r=this.getStringValue(o,i[o]);if(null!=r){var l=e.document.createElement("add");l.setAttribute("value",r),l.setAttribute("as",o),s.appendChild(l)}}0<s.childNodes.length&&a.appendChild(s)}}return a},e.getStringValue=function(e,n){var t=typeof n;return"function"==t?n=mxStyleRegistry.getName(style[j]):"object"==t&&(n=null),n},e.decode=function(e,n,t){t=t||new this.template.constructor;var a=n.getAttribute("id");for(null!=a&&(e.objects[a]=t),n=n.firstChild;null!=n;){if(!this.processInclude(e,n,t)&&"add"==n.nodeName&&null!=(a=n.getAttribute("as"))){var i=n.getAttribute("extend"),s=null!=i?mxUtils.clone(t.styles[i]):null;for(null==s&&(null!=i&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+i+" not found to extend"),s={}),i=n.firstChild;null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT){var o=i.getAttribute("as");if("add"==i.nodeName){var r=mxUtils.getTextContent(i),l=null;null!=r&&0<r.length?l=mxUtils.eval(r):(l=i.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l))),null!=l&&(s[o]=l)}else"remove"==i.nodeName&&delete s[o]}i=i.nextSibling}t.putCellStyle(a,s)}n=n.nextSibling}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultKeyHandler);return e.encode=function(e,n){return null},e.decode=function(e,n,t){if(null!=t)for(n=n.firstChild;null!=n;){if(!this.processInclude(e,n,t)&&"add"==n.nodeName){var a=n.getAttribute("as"),i=n.getAttribute("action"),s=n.getAttribute("control");t.bindAction(a,i,s)}n=n.nextSibling}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultToolbar);return e.encode=function(e,n){return null},e.decode=function(e,n,t){if(null!=t){var a=t.editor;for(n=n.firstChild;null!=n;){if(n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,n,t))if("separator"==n.nodeName)t.addSeparator();else if("br"==n.nodeName)t.toolbar.addBreak();else if("hr"==n.nodeName)t.toolbar.addLine();else if("add"==n.nodeName){var i=n.getAttribute("as"),s=(i=mxResources.get(i)||i,n.getAttribute("icon")),o=n.getAttribute("pressedIcon"),r=n.getAttribute("action"),l=n.getAttribute("mode"),d=n.getAttribute("template"),c="0"!=n.getAttribute("toggle"),m=mxUtils.getTextContent(n),u=null;if(null!=r)u=t.addItem(i,s,r,o);else if(null!=l){var p=mxUtils.eval(m);u=t.addMode(i,s,l,o,p)}else if(null!=d||null!=m&&0<m.length)u=a.templates[d],d=n.getAttribute("style"),null!=u&&null!=d&&(u=u.clone()).setStyle(d),(d=null)!=m&&0<m.length&&(d=mxUtils.eval(m)),u=t.addPrototype(i,s,u,o,d,c);else if(0<(o=mxUtils.getChildNodes(n)).length)if(null==s)for(d=t.addActionCombo(i),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?t.addOption(d,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),c=c.getAttribute("action"),t.addActionOption(d,s,c));else{var g=null,v=t.addPrototype(i,s,function(){if(null==(e=a.templates[g.value]))return mxLog.warn("Template "+e+" not found"),null;var e=e.clone(),n=g.options[g.selectedIndex].cellStyle;return null!=n&&e.setStyle(n),e},null,null,c);g=t.addCombo();for(mxEvent.addListener(g,"change",function(){t.toolbar.selectMode(v,function(e){return e=mxUtils.convertPoint(a.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a.addVertex(null,p(),e.x,e.y)}),t.toolbar.noReset=!1}),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?t.addOption(g,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),m=c.getAttribute("template"),t.addOption(g,s,m||d).cellStyle=c.getAttribute("style"))}null!=u&&(null!=(d=n.getAttribute("id"))&&0<d.length&&u.setAttribute("id",d))}n=n.nextSibling}}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultPopupMenu);return e.encode=function(e,n){return null},e.decode=function(e,n,t){var a=n.getElementsByTagName("include")[0];return null!=a?this.processInclude(e,a,t):null!=t&&(t.config=n),t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxEditor,"modified lastSnapshot ignoredChanges undoManager graphContainer toolbarContainer".split(" "));return e.afterDecode=function(e,n,t){return null!=(e=n.getAttribute("defaultEdge"))&&(n.removeAttribute("defaultEdge"),t.defaultEdge=t.templates[e]),null!=(e=n.getAttribute("defaultGroup"))&&(n.removeAttribute("defaultGroup"),t.defaultGroup=t.templates[e]),t},e.decodeChild=function(e,n,t){if("Array"==n.nodeName){if("templates"==n.getAttribute("as"))return void this.decodeTemplates(e,n,t)}else if("ui"==n.nodeName)return void this.decodeUi(e,n,t);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeUi=function(e,n,t){for(e=n.firstChild;null!=e;){if("add"==e.nodeName){n=e.getAttribute("as");var a=e.getAttribute("element"),i=e.getAttribute("style"),s=null;if(null!=a)null!=(s=document.getElementById(a))&&null!=i&&(s.style.cssText+=";"+i);else{a=parseInt(e.getAttribute("x"));var o=parseInt(e.getAttribute("y")),r=e.getAttribute("width"),l=e.getAttribute("height");(s=document.createElement("div")).style.cssText=i,new mxWindow(mxResources.get(n)||n,s,a,o,r,l,!1,!0).setVisible(!0)}"graph"==n?t.setGraphContainer(s):"toolbar"==n?t.setToolbarContainer(s):"title"==n?t.setTitleContainer(s):"status"==n?t.setStatusContainer(s):"map"==n&&t.setMapContainer(s)}else"resource"==e.nodeName?mxResources.add(e.getAttribute("basename")):"stylesheet"==e.nodeName&&mxClient.link("stylesheet",e.getAttribute("name"));e=e.nextSibling}},e.decodeTemplates=function(e,n,t){null==t.templates&&(t.templates=[]),n=mxUtils.getChildNodes(n);for(var a=0;a<n.length;a++){for(var i=n[a].getAttribute("as"),s=n[a].firstChild;null!=s&&1!=s.nodeType;)s=s.nextSibling;null!=s&&(t.templates[i]=e.decodeCell(s))}},e}()),EditorUi=function(e,n,t){this.projectDesignController=e,this.editor=n||new Editor,this.container=t||document.body;var a=n.graph,i=this;CRUD_PERMISSIONS=this.projectDesignController.crudPermissions;var s=mxUtils.bind(this,function(e){return null==e&&(e=window.event),!!this.isEditingEnabled()&&a.isEditing()});this.container.style.overflow="hidden",(new Image).src=mxPopupMenu.prototype.submenuImage,null!=mxConnectionHandler.prototype.connectImage&&((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.actions=new Actions(this),this.menus=new Menus(this),this.createDivs(),this.refresh(),this.createUi(),this.container==document.body&&(this.menubarContainer.onselectstart=s,this.menubarContainer.onmousedown=s,this.toolbarContainer.onselectstart=s,this.toolbarContainer.onmousedown=s,this.diagramContainer.onselectstart=s,this.diagramContainer.onmousedown=s,this.sidebarContainer.onselectstart=s,this.sidebarContainer.onmousedown=s,this.footerContainer.onselectstart=s,this.footerContainer.onmousedown=s),mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?(mxEvent.addListener(this.diagramContainer,"contextmenu",s),mxEvent.addListener(this.sidebarContainer,"contextmenu",s)):(this.diagramContainer.oncontextmenu=s,this.sidebarContainer.oncontextmenu=s),a.init(this.diagramContainer),a.refresh(),a.setEnabled(this.isEditingEnabled()),a.container.setAttribute("tabindex","0"),a.container.style.cursor="default",a.container.style.backgroundImage="url("+n.gridImage+")",a.container.style.backgroundPosition="-1px -1px",a.container.focus();var o=a.fireMouseEvent;a.fireMouseEvent=function(e,n,t){e==mxEvent.MOUSE_DOWN&&this.container.focus(),o.apply(this,arguments)},this.createMultiplicities(a.multiplicities,["start","finally","end"],[[1,1],[1,1],[0,0]],[[0,0],[0,0],[1,"n"]]),this.createMultiplicities(a.multiplicities,["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[[1,1],[0,0],[0,1],[0,1],[0,1],[1,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["login","pause","unpause","logout"],[[1,2],[1,2],[1,2],[1,2]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["set","math"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["background","playback","menu","saydigits","saynumber","sayphonetic","google_cloud_tts","tts","ispeechtts","awspolly","getdigits","getsecretdigits","lumenvoxtts","sestektts","mrcpsynth"],[[1,"n"],[1,1],[1,"n"],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,"n"],[1,"n"],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["record"],[[1,1]],[[1,"n"]]),this.createMultiplicities(a.multiplicities,["database","ispeechasr","sendSMS","sendMail","sendFax","googleasr","lumenvoxasr","tildeasr","dialogflow","dialogflowV2","awslex","sesteknda","sestekasr","restapi","mrcprecog"],[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["gotoc","gotoif","gotoiftime","vswitch"],[[0,0],[1,2],[1,2],[1,"n"]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["queuelog","goal"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["noop","system","agi","subproject","custom_app"],[[1,1],[1,1],[0,1],[0,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),a.dblClick=function(e,t){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",t);this.fireEvent(n),mxEvent.isConsumed(e)||n.isConsumed()||(this.getModel().isEdge(t)?0<=["background","gotoif","gotoiftime","menu","getdigits","getsecretdigits","vswitch","login","pause","unpause","logout"].indexOf(t.source.value.tagName)&&this.startEditingAtCell(t):this.getModel().isVertex(t)&&i.projectDesignController.openDialog(t.getValue(),function(e){for(var n=0;n<e.length;n+=1)t.setAttribute(e[n].name,e[n].value);a.refresh(t)}),n.consume())},a.panningHandler.autoExpand=!0,a.panningHandler.factoryMethod=mxUtils.bind(this,function(e,n,t){this.isEditingEnabled()&&this.menus.createPopupMenu(e,n,t)}),n.outline.init(this.outlineContainer),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){a.panningHandler.hideMenu()})),mxClient.IS_TOUCH&&(mxEvent.addListener(a.container,"gesturechange",mxUtils.bind(this,function(e){a.view.getDrawPane().setAttribute("transform","scale("+e.scale+")"),a.view.getOverlayPane().style.visibility="hidden"})),mxEvent.addListener(a.container,"gestureend",mxUtils.bind(this,function(e){a.view.getDrawPane().removeAttribute("transform"),a.zoomToCenter=!0,a.zoom(e.scale),a.view.getOverlayPane().style.visibility="visible"})));var r=this.isEditingEnabled()?this.createKeyHandler(n):null;this.getKeyHandler=function(){return r},mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.refresh(),a.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.init(),this.open(),this.refresh()},EditorUi.prototype.splitSize=mxClient.IS_TOUCH?16:8,EditorUi.prototype.menubarHeight=33,EditorUi.prototype.toolbarHeight=36,EditorUi.prototype.footerHeight=0,EditorUi.prototype.hsplitPosition=204,EditorUi.prototype.vsplitPosition=190,EditorUi.prototype.init=function(){this.addUndoListener(),this.addSelectionListener();var e=this.actions.get("paste"),n=function(){e.setEnabled(!mxClipboard.isEmpty())},t=mxClipboard.cut;mxClipboard.cut=function(){t.apply(this,arguments),n()};var a=mxClipboard.copy;mxClipboard.copy=function(){a.apply(this,arguments),n()}},EditorUi.prototype.isEditingEnabled=function(){return!!CRUD_PERMISSIONS.canEdit},EditorUi.prototype.exportXML=function(e){var n=window.document.createElement("a");n.href="data:attachment/text;charset=utf-8,"+encodeURIComponent(e),n.download=this.editor.filename+".xml",n.target="_self",n.click()},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(e,n){try{var t=mxUtils.parseXml(e);this.editor.setGraphXml(t.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=n&&(this.editor.filename=n)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(e){}},EditorUi.prototype.openString=function(e,n,t){try{var a=mxUtils.parseXml(e);this.editor.setGraphXml(a.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=n&&(this.editor.filename=n),null!=t&&(this.editor.data=t)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}},EditorUi.prototype.validate=function(e,n){for(var t=this.editor.graph,a=(e=null!=e?e:t.model.getRoot(),n=null!=n?n:{},!0),i=t.model.getChildCount(e),s=0;s<i;s++){var o=t.model.getChildAt(e,s),r=n;t.isValidRoot(o)&&(r={}),null!=(r=this.validate(o,r))?t.setCellWarning(o,r.replace(/\n/g,"<br>")):t.setCellWarning(o,null),a=a&&null==r}if(i="",t.model.isVertex(e))switch(e.value.nodeName){case"start":i=this.validateBlock("start")?"":"Only one Start block is allowed\n";break;case"finally":i=this.validateBlock("finally")?"":"Only one Finally block is allowed\n";break;case"playback":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n";break;case"answer":i=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"menu":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("digit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("response")?"":mxResources.get("invalidTimeout")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getsecretdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("hiddendigitsnum")?"":mxResources.get("wrongHiddenDigitsnum")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"vswitch":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"database":i=0<e.value.getAttribute("odbc_id")?"":mxResources.get("noDatabaseSelected")+"\n",i+=""!==e.value.getAttribute("query")?"":mxResources.get("missingQuery")+"\n";break;case"set":case"math":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"gotoc":i=""!==e.value.getAttribute("context")?"":mxResources.get("noContextSelected")+"\n",i+=""!==e.value.getAttribute("extension")?"":mxResources.get("noExtensionSelected")+"\n",i+=1<=e.value.getAttribute("priority")?"":mxResources.get("invalidPriority")+"\n";break;case"system":case"agi":i=""!==e.value.getAttribute("command")?"":mxResources.get("noCommandSelected")+"\n";break;case"gotoif":i=""!==e.value.getAttribute("condition")?"":mxResources.get("noConditionSelected")+"\n";break;case"saydigits":i=""!==e.value.getAttribute("digits")?"":mxResources.get("noDigitsSelected")+"\n";break;case"saynumber":i=""!==e.value.getAttribute("number")?"":mxResources.get("noNumberSelected")+"\n";break;case"sayphonetic":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"record":i=""!==e.value.getAttribute("file")?"":mxResources.get("noFileSelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"goal":i=""!==e.value.getAttribute("goalname")?"":mxResources.get("noGoalSelected")+"\n";break;case"ext_dial":i="-1"!==e.value.getAttribute("trunk_name")?"":mxResources.get("noTrunkSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"dial":i=0<e.value.getAttribute("sip_id")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"queue":i="-1"!==e.value.getAttribute("queue_id")?"":mxResources.get("noQueueSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"callback":i="-1"!==e.value.getAttribute("list_id")?"":mxResources.get("noListSelected")+"\n",i+=""!==e.value.getAttribute("name")?"":mxResources.get("noFirstNameSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noPhoneSelected")+"\n",i+=""!==e.value.getAttribute("delay")?"":mxResources.get("invalidDelay")+"\n";break;case"gotoiftime":i=0<e.value.getAttribute("interval_id")?"":mxResources.get("noIntervalSelected")+"\n";break;case"voicemail":i=""!==e.value.getAttribute("mailbox")?"":mxResources.get("noBoxNumberSelected")+"\n";break;case"subproject":i=0<e.value.getAttribute("project_id")?"":mxResources.get("noProjectSelected")+"\n";break;case"sendSMS":i=0<e.value.getAttribute("sms_account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("sms_text")?"":mxResources.get("noTextSelected")+"\n";break;case"sendMail":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n";break;case"sendFax":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("attachment_path")?"":mxResources.get("noAttachmentSelected")+"\n";break;case"google_cloud_tts":i=""!==e.value.getAttribute("apiKey")?"":mxResources.get("noApiKeySelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"tts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"awspolly":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i+=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"awslex":i=""!==e.value.getAttribute("aws_bot_name")?"":mxResources.get("noNameSelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i+=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"ispeechtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-10<=e.value.getAttribute("speed")&&e.value.getAttribute("speed")<=10?"":mxResources.get("invalidSpeed")+"\n";break;case"lumenvoxtts":case"sestektts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"lumenvoxasr":case"sestekasr":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"ispeechasr":case"googleasr":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"tildeasr":i=""!==e.value.getAttribute("appid")?"":mxResources.get("noAppIdInserted")+"\n",i+=""!==e.value.getAttribute("appsecret")?"":mxResources.get("noAppSecretInserted")+"\n",i+=""!==e.value.getAttribute("uri")?"":mxResources.get("noUrlInserted")+"\n";break;case"custom_app":i=""!==e.value.getAttribute("application")?"":mxResources.get("noApplicationSelected")+"\n";break;case"login":case"pause":case"unpause":case"logout":i=""!==e.value.getAttribute("findBy")?"":mxResources.get("noFindBySelected")+"\n";break;case"sesteknda":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("ndauth_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("ndassistant_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("username")?"":mxResources.get("noUsernameSelected")+"\n",i+=""!==e.value.getAttribute("password")?"":mxResources.get("noPasswordSelected")+"\n";break;case"restapi":i=""!==e.value.getAttribute("url")?"":mxResources.get("noUrlSelected")+"\n",i+=""!==e.value.getAttribute("method")?"":mxResources.get("noMethodSelected")+"\n";case"mrcpsynth":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"mrcprecog":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"dialogflow":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("dialogflow_language")?"":mxResources.get("noDialogflowLanguageSelected")+"\n";break;case"dialogflowV2":i=""!==e.value.getAttribute("dialogflowV2_project_id")?"":mxResources.get("noDialogflowProjectSelected")+"\n",i+=""!==e.value.getAttribute("client_email")?"":mxResources.get("noClientEmailSelected")+"\n",i+=""!==e.value.getAttribute("private_key")?"":mxResources.get("noPrivateKeySelected")+"\n",i+=""!==e.value.getAttribute("dialogflowV2_language")?"":mxResources.get("noDialogflowLanguageSelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n"}if(t.model.isEdge(e))switch(t.model.getCell(e.source.getId()).value.nodeName){case"background":case"menu":if(void 0!==e.getValue()){var l=/^[0-9]+$|^[-]{1}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/;String(e.getValue()).split(",").forEach(function(e){i+=l.test(e)?"":mxResources.get("numberOrAll")+"\n"})}else i=i+mxResources.get("numberOrAll")+"\n";break;case"getsecretdigits":case"getdigits":if(void 0!==e.getValue())i+=(l=/^(x|i|-)$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrDefault")+"\n";else i=i+mxResources.get("numberOrInvalidOrDefault")+"\n";break;case"gotoif":case"gotoiftime":if(void 0!==e.getValue())i+=(l=/^(true){1}$|^(false){1}$/).test(String(e.getValue()))?"":mxResources.get("trueOrFalse")+"\n";else i=i+mxResources.get("trueOrFalse")+"\n";break;case"login":case"pause":case"unpause":case"logout":if(void 0!==e.getValue())i+=(l=/^(success){1}$|^(failure){1}$/).test(String(e.getValue()))?"":mxResources.get("successOrFailure")+"\n";else i=i+mxResources.get("successOrFailure")+"\n"}return t.isCellCollapsed(e)&&!a&&(i+=(mxResources.get(t.containsValidationErrorsResource)||t.containsValidationErrorsResource)+"\n"),i=t.model.isEdge(e)?i+(t.getEdgeValidationError(e,t.model.getTerminal(e,!0),t.model.getTerminal(e,!1))||""):i+(t.getCellValidationError(e)||""),null!=(s=t.validateCell(e,n))&&(i+=s),null==t.model.getParent(e)&&t.view.validate(),0<i.length||!a?i:null},EditorUi.prototype.validateBlock=function(n){var t=this.editor.graph,e=t.getDefaultParent(),a=0;return e.children.forEach(function(e){t.model.isVertex(e)&&e.value.nodeName==n&&a++}),!(1<a)},EditorUi.prototype.getUrl=function(e){var n=null!=e?e:window.location.pathname,t=0<n.indexOf("?")?1:0;for(var a in urlParams)n+=0==t?"?":"&",n+=a+"="+urlParams[a],t++;return n},EditorUi.prototype.addUndoListener=function(){var e=this.actions.get("undo"),n=this.actions.get("redo"),t=this.editor.undoManager,a=function(){e.setEnabled(t.canUndo()),n.setEnabled(t.canRedo())};t.addListener(mxEvent.ADD,a),t.addListener(mxEvent.UNDO,a),t.addListener(mxEvent.REDO,a),t.addListener(mxEvent.CLEAR,a),a()},EditorUi.prototype.addSelectionListener=function(){var e=mxUtils.bind(this,function(){var e=this.editor.graph,n=!e.isSelectionEmpty(),t=!1,a=!1,i=e.getSelectionCells();if(null!=i)for(var s=0;s<i.length;s++){var o=i[s];if(e.getModel().isEdge(o)&&(a=!0),e.getModel().isVertex(o)&&(t=!0),a&&t)break}var r=["cut","copy","delete","duplicate","bold","italic","style","underline","toFront","toBack","dashed","rounded","shadow","tilt","autosize"];for(s=0;s<r.length;s++)this.actions.get(r[s]).setEnabled(n);this.actions.get("curved").setEnabled(a),this.actions.get("rotation").setEnabled(t),this.actions.get("wordWrap").setEnabled(t),this.actions.get("group").setEnabled(1<e.getSelectionCount()),this.actions.get("ungroup").setEnabled(1==e.getSelectionCount()&&0<e.getModel().getChildCount(e.getSelectionCell()));var l=t&&1==e.getSelectionCount();this.actions.get("removeFromGroup").setEnabled(l&&e.getModel().isVertex(e.getModel().getParent(e.getSelectionCell())));var d=["fontFamily","fontSize","alignment","position","text","format","arrange","linewidth","spacing"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(n);d=["line","lineend","linestart"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(a);this.actions.get("setAsDefaultEdge").setEnabled(a),this.menus.get("align").setEnabled(1<e.getSelectionCount()),this.menus.get("direction").setEnabled(t||a&&e.isLoop(e.view.getState(e.getSelectionCell()))),this.menus.get("navigation").setEnabled(e.foldingEnabled&&(null!=e.view.currentRoot||1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell()))),this.actions.get("home").setEnabled(null!=e.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=e.view.currentRoot);var c=1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell());this.actions.get("enterGroup").setEnabled(c),this.actions.get("expand").setEnabled(c),this.actions.get("collapse").setEnabled(c),this.actions.get("editLink").setEnabled(1==e.getSelectionCount()),this.actions.get("openLink").setEnabled(1==e.getSelectionCount()&&null!=e.getLinkForCell(e.getSelectionCell()))});this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},EditorUi.prototype.refresh=function(){var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),n=this.container.clientWidth+390,t=this.container.clientHeight+190;this.container==document.body&&(n=document.body.clientWidth||document.documentElement.clientWidth,t=e&&document.body.clientHeight||document.documentElement.clientHeight);var a=Math.max(0,Math.min(this.hsplitPosition,n-this.splitSize-20)),i=Math.max(0,Math.min(this.vsplitPosition,t-this.menubarHeight-this.toolbarHeight-this.splitSize-1));this.menubarContainer.style.height=this.menubarHeight+"px",this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px";var s=this.menubarHeight+this.toolbarHeight;if(mxClient.IS_QUIRKS||(s+=1),this.sidebarContainer.style.top=s+"px",this.sidebarContainer.style.width=a+"px",this.outlineContainer.style.width=a+"px",this.outlineContainer.style.height=i+"px",this.diagramContainer.style.left=this.isEditingEnabled()?a+this.splitSize+"px":"0px",this.diagramContainer.style.top=this.sidebarContainer.style.top,this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.outlineContainer.style.bottom,this.hsplit.style.left=a+"px",this.vsplit.style.width=this.sidebarContainer.style.width,this.vsplit.style.bottom=i+this.footerHeight+"px",e){this.menubarContainer.style.width=n+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var o=t-i-this.splitSize-this.menubarHeight-this.toolbarHeight;this.sidebarContainer.style.height=o+"px",this.diagramContainer.style.width=n-a-this.splitSize+"px";var r=t-this.menubarHeight-this.toolbarHeight;this.diagramContainer.style.height=r+"px",this.hsplit.style.height=r+"px"}else this.sidebarContainer.style.bottom=i+this.splitSize+"px",this.diagramContainer.style.bottom=this.outlineContainer.style.bottom},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.outlineContainer=this.createDiv("geOutlineContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.vsplit=this.createDiv("geVsplit"),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.outlineContainer.style.bottom="0px",this.outlineContainer.style.left="0px",this.diagramContainer.style.overflow="scroll",this.diagramContainer.style.right="0px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.vsplit.style.left="0px",this.vsplit.style.height=this.splitSize+"px",this.hsplit.style.width=this.splitSize+"px"},EditorUi.prototype.createUi=function(){this.menubar=this.menus.createMenubar(this.createDiv("geMenubar")),this.menubarContainer.appendChild(this.menubar.container),this.toolbar=this.createToolbar(this.createDiv("geToolbar")),this.toolbarContainer.appendChild(this.toolbar.container),this.sidebar=this.createSidebar(this.sidebarContainer),this.footerContainer.appendChild(this.createFooter()),this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.isEditingEnabled()&&(this.container.appendChild(this.sidebarContainer),this.container.appendChild(this.hsplit),this.container.appendChild(this.vsplit)),this.container.appendChild(this.diagramContainer),this.container.appendChild(this.menubarContainer),this.container.appendChild(this.toolbarContainer),this.container.appendChild(this.outlineContainer),this.container.appendChild(this.footerContainer),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e,this.refresh(),this.editor.graph.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.addSplitHandler(this.vsplit,!1,this.footerHeight,mxUtils.bind(this,function(e){this.vsplitPosition=e,this.refresh(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()}))},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.setStatusText=function(e){this.statusContainer.innerHTML=e},EditorUi.prototype.createToolbar=function(e){return new Toolbar(this,e)},EditorUi.prototype.createSidebar=function(e){return new Sidebar(this,e)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(e){var n=document.createElement("div");return n.className=e,n},EditorUi.prototype.createHeader=function(e){return document.createElement(e)},EditorUi.prototype.createForm=function(e){var n=document.createElement("form");return n.className=e,n},EditorUi.prototype.addSplitHandler=function(n,t,a,i){var s=null,o=null;function r(e){if(null!=s){var n=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));i(Math.max(0,o+(t?n.x-s.x:s.y-n.y)-a)),mxEvent.consume(e)}}function e(e){r(e),o=s=null}mxEvent.addGestureListeners(n,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),o=parseInt(t?n.style.left:n.style.bottom),mxEvent.consume(e)}),mxEvent.addListener(document,"mousemove",r),mxEvent.addListener(document,"touchmove",r),mxEvent.addListener(document,"mouseup",e),mxEvent.addListener(document,"touchend",e)},EditorUi.prototype.executeLayout=function(e,n,t){var a=this.editor.graph,i=a.getSelectionCell();n=null!=this.animate?this.animate:n,a.getModel().beginUpdate();try{e.execute(a.getDefaultParent(),i)}catch(e){throw e}finally{if(n&&navigator.userAgent.indexOf("Camino")<0){var s=new mxMorphing(a);s.addListener(mxEvent.DONE,mxUtils.bind(this,function(){a.getModel().endUpdate()})),s.startAnimation()}else a.getModel().endUpdate()}},EditorUi.prototype.createKeyHandler=function(e){var a=this.editor.graph,o=new mxKeyHandler(a);function n(e){if(!a.isSelectionEmpty()){var n=0,t=0;37==e?n=-1:38==e?t=-1:39==e?n=1:40==e&&(t=1),a.moveCells(a.getSelectionCells(),n,t),a.scrollCellToVisible(a.getSelectionCell())}}o.isControlDown=function(e){return mxEvent.isControlDown(e)||mxClient.IS_MAC&&e.metaKey};var t=mxUtils.bind(this,function(e,n,t,a){var i=this.actions.get(t);if(null!=i){var s=function(){i.enabled&&i.funct()};n?a?o.bindControlShiftKey(e,s):o.bindControlKey(e,s):a?o.bindShiftKey(e,s):o.bindKey(e,s)}});return o.enter=function(){},o.bindKey(8,function(){a.foldCells(!0)}),o.bindKey(13,function(){a.foldCells(!1)}),o.bindKey(33,function(){a.exitGroup()}),o.bindKey(34,function(){a.enterGroup()}),o.bindKey(36,function(){a.home()}),o.bindKey(35,function(){a.refresh()}),o.bindKey(37,function(){n(37)}),o.bindKey(38,function(){n(38)}),o.bindKey(39,function(){n(39)}),o.bindKey(40,function(){n(40)}),o.bindKey(113,function(){a.startEditingAtCell()}),t(46,!1,"delete"),t(82,!0,"tilt"),t(83,!0,"save"),t(83,!0,"saveAs",!0),t(107,!1,"zoomIn"),t(109,!1,"zoomOut"),t(65,!0,"selectAll"),t(86,!0,"selectVertices",!0),t(69,!0,"selectEdges",!0),t(69,!0,"export"),t(66,!0,"toBack"),t(70,!0,"toFront"),t(68,!0,"duplicate"),t(90,!0,"undo"),t(89,!0,"redo"),t(88,!0,"cut"),t(67,!0,"copy"),t(81,!0,"connect"),t(86,!0,"paste"),t(71,!0,"group"),t(71,!0,"grid",!0),t(85,!0,"ungroup"),t(112,!1,"about"),t(80,!0,"publish",!0),o},EditorUi.prototype.createMultiplicities=function(e,n,t,a){for(var i=0;i<n.length;i++)e.push(new mxMultiplicity(!0,n[i],null,null,t[i][0],t[i][1],null,mxResources.get(n[i])+mxResources.get("musthave")+t[i][0]+mxResources.get("outgoingedge"),null)),e.push(new mxMultiplicity(!1,n[i],null,null,a[i][0],a[i][1],null,mxResources.get(n[i])+mxResources.get("musthave")+a[i][0]+mxResources.get("incomingedge"),null))};var useLocalStorage=(mxClient.IS_TOUCH||"local"==urlParams.storage)&&"undefined"!=typeof localStorage,fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList,touchStyle=mxClient.IS_TOUCH||"1"==urlParams.touch,counter=0;try{for(var op=window;null!=op.opener&&!isNaN(op.opener.counter);)op=op.opener;null!=op&&(op.counter++,counter=op.counter)}catch(e){}function Sidebar(e,n){this.editorUi=e,this.container=n,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=new Graph(document.createElement("div"),null,null,this.editorUi.editor.graph.getStylesheet()),this.graph.resetViewOnRootChange=!1,this.graph.foldingEnabled=!1,this.graph.setConnectable(!1),this.graph.autoScroll=!1,this.graph.setTooltips(!1),this.graph.setEnabled(!1),this.graph.container.style.visibility="hidden",this.graph.container.style.position="absolute",this.graph.container.style.overflow="hidden",this.graph.container.style.height="1px",this.graph.container.style.width="1px",mxClient.IS_IE||mxClient.IS_IE11||(this.graph.container.style.display="none"),document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(e){for(var n=mxEvent.getSource(e);null!=n;){if(n==this.currentElt)return;n=n.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(e){null==e.toElement&&null==e.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(n,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0})),this.init(),mxClient.IS_SVG||((new Image).src=IMAGE_PATH+"/tooltip.png")}function Actions(e){this.editorUi=e,this.actions=new Object,this.init()}function Action(e,n,t,a,i){mxEventSource.call(this),this.label=e,this.funct=n,this.enabled=null==t||t,this.iconCls=a,this.shortcut=i}function Menubar(e,n){this.editorUi=e,this.container=n,mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function Menu(e,n){mxEventSource.call(this),this.funct=e,this.enabled=null==n||n}function Toolbar(e,n){this.editorUi=e,this.container=n,this.init(),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function createCheckbox(e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),e&&n.setAttribute("checked",!0),n}function createDropdownFromApi(e,t,a,i,n,s,o,r){var l=new XMLHttpRequest;l.open("GET",e,!1),l.setRequestHeader("Authorization","Bearer "+n.editor.data.token),l.send(null);var d=[];200===l.status&&(d=JSON.parse(l.response));var c=document.createElement("select"),m=document.createElement("option");return m.text="-- None --",m.value="-1",c.appendChild(m),d.rows.forEach(function(n){r&&n[a]==r||((m=document.createElement("option")).text=n[a],s&&o?(m.value=o,s.forEach(function(e){m.value=m.value.replace("%"+e+"%",n[e])}),m.selected=m.value==t):(m.value=n[i],m.selected=n[i]==t),c.appendChild(m))}),c.className="form-control select2",c}function createDropdownWithOptgroupFromApi(e,n,t,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");d.text="-- None --",d.value="-1",l.appendChild(d);var c=_.groupBy(r.rows,s);for(var m in c)if(c.hasOwnProperty(m)){var u=document.createElement("optgroup");u.label=_.capitalize(m),c[m].forEach(function(e){(d=document.createElement("option")).text=e[t],d.value=e[a],d.selected=e[a]==n,u.appendChild(d)}),l.appendChild(u)}return l.className="form-control select2",l}function createGroupedDropdownFromApi(e,n,t,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");return d.text="-- None --",d.value="0",l.appendChild(d),r.rows.forEach(function(e){(d=document.createElement("option")).className="select-group-father",d.text=e[t].toUpperCase(),d.value=e[a],d.selected=e[a]==n,l.appendChild(d),e[s].forEach(function(e){(d=document.createElement("option")).className="select-group-son",d.text="-"+_.capitalize(e[t]),d.value=e[a],d.selected=e[a]==n,l.appendChild(d)})}),l.className="form-control select2",l}function createDropdownFromArray(e,n){var t=document.createElement("select");for(var a in e){var i=document.createElement("option");i.text=e[a],i.value=a,(0<n||""!=n)&&(i.selected=n===a),t.appendChild(i)}return t.className="form-control select2",t}function createDropdownFromTigerDialList(e){var n=document.createElement("select"),t=[],a=new XMLHttpRequest;try{if(a.open("POST","/api/rest/list/list",!1),a.send(JSON.stringify({page:1,size:6e5})),200===a.status){var i=JSON.parse(a.response);if(0<i.status){var s=i.response.RMI.rows;for(var o in s)t[s[o].id]=s[o].name}}}catch(e){console.log(e)}for(var r in t){var l=document.createElement("option");l.text=t[r],l.value=r,(0<e||""!=e)&&(l.selected=e===r),n.appendChild(l)}return n.className="form-control select2",n}function Dialog(e,n,t,a,i,s,o){var r=0;mxClient.IS_IE&&9!=document.documentMode&&(r=60),t+=r,a+=r;Math.max(0,Math.round((document.body.scrollWidth-t)/2)),Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-a)/3));var l=e.createDiv("geDialog");l.className="modal fade in center",l.style.display="block",l.style.paddingRight="12px";var d=e.createDiv("geModalDialog");d.className="modal-dialog",d.appendChild(n),l.appendChild(d),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.className="modal-backdrop fade in",mxClient.IS_QUIRKS&&new mxDivResizer(this.bg)),i&&document.body.appendChild(this.bg),document.body.appendChild(l),this.onDialogClose=o,this.container=l}function ImportDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("import")+" XML");var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-12"),d=document.createElement("textarea");d.style.width="100%",d.style.height="374px";var c=document.createElement("input");c.type="file",c.setAttribute("accept","text/xml"),c.addEventListener("change",function(e){var n=e.target.files[0];if(console.log(n),n)if("text/xml"===n.type){var t=new FileReader;t.onload=function(e){var n=e.target.result;mxUtils.write(d,n)},t.readAsText(n)}else alert("Failed to load format file");else alert("Failed to load file")},!1),l.appendChild(c),l.appendChild(d),r.appendChild(l),a.appendChild(r);var m=mxUtils.button(mxResources.get("import"),mxUtils.bind(this,function(e){var n=mxUtils.parseXml(d.value);t.editor.setGraphXml(n.documentElement),t.hideDialog()}));m.className="btn blue";var u=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});u.className="btn default",i.appendChild(m),i.appendChild(u),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function AboutDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("about")+" Cally Square");var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=document.createElement("img");r.style.border="0px",r.setAttribute("width","176"),r.setAttribute("width","151"),r.setAttribute("src",IMAGE_PATH+"/logo.png"),a.appendChild(r),mxUtils.br(a),mxUtils.write(a,"Powered by Xenialab "+mxClient.VERSION),mxUtils.br(a);var l=document.createElement("a");l.setAttribute("href","http://www.callysquare.com/"),l.setAttribute("target","_blank"),mxUtils.write(l,"www.callysquare.com"),a.appendChild(l),mxUtils.br(a),mxUtils.br(a);var d=mxUtils.button(mxResources.get("close"),function(){e.hideDialog()});d.className="btn default",i.appendChild(d),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function SaveDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("saveAs"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_copy"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("save"),function(){e.saveAs(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function NewDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("new"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_new"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("new"),function(){e.new(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function DescriptionDialog(e){console.log(e.editor.data);var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("description"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="description",d=e.editor.data.description||"",c=e.createDiv("form-group"),m=document.createElement("label");m.className="col-sm-4 control-label",mxUtils.write(m,mxResources.get(l)),c.appendChild(m);var u=document.createElement("input");u.setAttribute("value",d),u.className="form-control",u.setAttribute("id","_description");var p=e.createDiv("col-sm-8");p.appendChild(u),c.appendChild(p),r.appendChild(c),a.appendChild(r);var g=mxUtils.button(mxResources.get("update"),function(){e.description(u.value),e.hideDialog()});g.className="btn blue";var v=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});v.className="btn default",i.appendChild(g),i.appendChild(v),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function VariableDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("variable"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="name",d="_"+l,c="variable name",m=e.createDiv("form-group"),u=document.createElement("label");u.className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var p=document.createElement("input");p.setAttribute("value",c),p.className="form-control",p.setAttribute("id",d);var g=e.createDiv("col-sm-8");g.appendChild(p),m.appendChild(g),r.appendChild(m),d="_"+(l="description"),c="variable description",m=e.createDiv("form-group last"),(u=document.createElement("label")).className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var v=document.createElement("input");v.setAttribute("value",c),v.className="form-control",v.setAttribute("id",d),(g=e.createDiv("col-sm-8")).appendChild(v),m.appendChild(g),r.appendChild(m),a.appendChild(r);var h=mxUtils.button(mxResources.get("new"),function(){e.variable(p.value,v.value),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function OpenDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("open"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("row"),l=e.createDiv("col-md-4"),d=e.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=new XMLHttpRequest;m.open("GET","/api/square/projects",!1),m.setRequestHeader("Authorization","Bearer "+e.editor.data.token),m.send(null);var u=[];200===m.status&&(u=JSON.parse(m.response));for(var p=document.createElement("select"),g=0;g<u.length;g++){var v=document.createElement("option");v.text=u[g].name,v.value=u[g].id,p.appendChild(v)}p.className="form-control",d.appendChild(p),r.appendChild(l),r.appendChild(d),a.appendChild(r);var h=mxUtils.button(mxResources.get("open"),function(){console.log(p),console.log(p.value),window.open("square/project/"+p.value,"_blank"),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function RenameDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("rename"));var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-4"),d=t.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=t.editor.filename,u=document.createElement("input");u.setAttribute("value",m),u.className="form-control",d.appendChild(u),r.appendChild(l),r.appendChild(d),a.appendChild(r);var p=mxUtils.button(mxResources.get("save"),function(){var n=new XMLHttpRequest;n.open("PUT",SAVE_URL+t.editor.data.id,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("Authorization","Bearer "+t.editor.data.token),n.send("name="+u.value),n.onload=function(e){200===n.status?(t.editor.setStatus("Project successfully renamed"),t.editor.filename=u.value):(console.log(n.response),t.editor.setStatus(JSON.parse(n.response).errors[0].message))},n.onerror=function(e){mxUtils.alert(n.statusText)},t.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function EditFileDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("edit"));var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("row"),l=n.createDiv("col-md-12"),d=document.createElement("textarea");if(d.style.width="100%",d.style.height="374px",d.value=mxUtils.getPrettyXml(n.editor.getGraphXml()),fileSupport){d.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault()},!1),d.addEventListener("drop",function(e){if(e.stopPropagation(),e.preventDefault(),0<e.dataTransfer.files.length){var n=e.dataTransfer.files[0],t=new FileReader;t.onload=function(e){d.value=e.target.result},t.readAsText(n)}},!1)}l.appendChild(d),r.appendChild(l),a.appendChild(r);var c=mxUtils.button(mxResources.get("save"),function(){var e=mxUtils.parseXml(d.value);n.editor.setGraphXml(e.documentElement),n.hideDialog()});c.className="btn blue";var m=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});m.className="btn default",i.appendChild(c),i.appendChild(m),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function ExportDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body form"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("export")+" XML");var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("form-horizontal form-row-seperated"),l=n.createDiv("form-group last"),d=document.createElement("label");d.className="col-sm-4 control-label",mxUtils.write(d,mxResources.get("filename"));var c=document.createElement("input");c.setAttribute("value",n.editor.getOrCreateFilename()),c.className="form-control";var m=n.createDiv("col-sm-8");m.appendChild(c),l.appendChild(d),l.appendChild(m),r.appendChild(l),a.appendChild(r);var u=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(e){n.save(!1);encodeURIComponent(mxUtils.getXml(n.editor.getGraphXml()));new mxXmlRequest(SAVE_URL+n.editor.data.id+"/download","filename="+c.value,"GET").simulate(document,"_blank"),n.hideDialog()}));u.className="btn blue";var p=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});p.className="btn default",i.appendChild(u),i.appendChild(p),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function GeneralDialog(i,s){console.log("general");var o=i.editor.graph,e=i.createDiv("md-dialog"),n=i.createDiv("md-toolbar"),t=i.createDiv("md-dialog-content"),a=i.createDiv("md-dialog-actions"),r=i.createHeader("h4");mxUtils.write(r,mxResources.get("edit")+" "+mxResources.get(s.value.nodeName));var l=mxUtils.button("",function(){i.hideDialog()});l.className="close",n.appendChild(l),n.appendChild(r);for(var d=s.value.attributes.length,c=i.createDiv("form-horizontal form-row-seperated"),m=0;m<d;m++){var u,p=s.value.attributes[m].name,g="_"+p,v=s.value.attributes[m].value,h=i.createDiv(m==d-1?"form-group last":"form-group"),f=document.createElement("label");switch(f.className="col-sm-4 control-label",mxUtils.write(f,mxResources.get(p)),h.appendChild(f),p){case"sip_id":u=createDropdownWithOptgroupFromApi("/api/users/all",v,"fullname","id",i,"role");break;case"queue_id":u=createDropdownFromApi("/api/voice/queues",v,"name","name",i);break;case"trunk_name":u=createDropdownFromApi("/api/trunks",v,"name","name",i);break;case"variable_id":u=createDropdownFromApi("/api/variables",v,"name","id",i);break;case"account_id":u="sendMail"==s.value.nodeName?createDropdownFromApi("/api/mail/servers/out",v,"username","id",i):createDropdownFromApi("/api/sms/accounts",v,"name","id",i);break;case"template_id":u=createDropdownFromApi("/api/templates",v,"name","id",i);break;case"context":u=createDropdownFromApi("/api/voice/contexts",v,"name","name",i);break;case"mailbox":u=createDropdownFromApi("/api/voice/voicemails",v,"mailbox","id",i,["mailbox","context"],"%mailbox%@%context%");break;case"model":u=createDropdownFromArray(ISPEECHASRMODEL,v);break;case"ispeech_asr_language":u=createDropdownFromArray(ISPEECHASRLANG,v);break;case"beep":u=createDropdownFromArray(ISPEECHBEEP,v);break;case"hiddendigitspos":u=createDropdownFromArray(SECRETDIGITSPOS,v);break;case"ispeech_tts_language":u=createDropdownFromArray(ISPEECHLANG,v);break;case"google_tts_language":u=createDropdownFromArray(GOOGLETTSLANG,v);break;case"intKey":u=createDropdownFromArray(ASRINTKEYS,v);break;case"recordingFormat":u=createDropdownFromArray(RECORDINGFORMAT,v);break;case"answer":u=createDropdownFromArray(BOOLSELECT,v);break;case"list_id":u=createDropdownFromTigerDialList(v);break;case"interval_id":u=createGroupedDropdownFromApi("/api/intervals",v,"name","id",i,"SubIntervals");break;case"project_id":u=createDropdownFromApi("/api/square/projects",v,"name","id",i,null,null,i.editor.getOrCreateFilename());break;case"odbc_id":u=createDropdownFromApi("/api/square/odbc",v,"name","id",i);break;case"file_id":u=createDropdownFromApi("/api/sounds",v,"display_name","id",i);break;case"timeout":case"digit":case"mindigit":case"maxdigit":case"response":case"retry":case"speed":(u=document.createElement("input")).setAttribute("type","number"),u.setAttribute("min",0),u.setAttribute("max",1e3),u.setAttribute("value",v),u.className="form-control";break;case"text":case"key":case"query":case"condition":case"command":case"body":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control";break;case"sms_text":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control",u.setAttribute("maxlength","160");break;default:(u=document.createElement("input")).setAttribute("value",v),u.className="form-control"}u.setAttribute("id",g);var b=i.createDiv("col-sm-8");if(b.appendChild(u),mxResources.get("help_"+p)){var A=i.createDiv("p");A.className="help-block",mxUtils.write(A,mxResources.get("help_"+p)),b.appendChild(A)}h.appendChild(b),c.appendChild(h)}t.appendChild(c);var E=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(e){for(var n=0;n<s.value.attributes.length;n++){var t="_"+s.value.attributes[n].name,a=s.value.attributes[n].name;s.setAttribute(a,document.getElementById(t).value)}o.refresh(s),i.hideDialog()}));E.className="btn blue";var y=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});y.className="btn default",a.appendChild(E),a.appendChild(y),e.appendChild(n),e.appendChild(t),e.appendChild(a),this.container=e}Editor=function(){mxEventSource.call(this),this.init(),this.initStencilRegistry(),this.graph=new Graph,this.outline=new mxOutline(this.graph),this.outline.updateOnPan=!0,this.undoManager=this.createUndoManager(),this.status="",this.filename=null,this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[counter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(e){this.status=e,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.modified=!1,this.graphChangeListener=function(){this.modified=!0},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),window.onbeforeunload=mxUtils.bind(this,function(){if(this.modified)return mxResources.get("allChangesLost")}),this.graph.resetViewOnRootChange=!1,this.graph.scrollbars=!0,this.graph.background=null},mxUtils.extend(Editor,mxEventSource),Editor.prototype.gridImage=IMAGE_PATH+"/grid.gif",Editor.prototype.transparentImage=IMAGE_PATH+"/transparent.gif",Editor.prototype.setGraphXml=function(e){var n=new mxCodec(e.ownerDocument);if("mxGraphModel"==e.nodeName){this.graph.view.scale=Number(e.getAttribute("scale")||1),this.graph.gridEnabled="0"!=e.getAttribute("grid"),this.graph.graphHandler.guidesEnabled="0"!=e.getAttribute("guides"),this.graph.setTooltips("0"!=e.getAttribute("tooltips")),this.graph.setConnectable("0"!=e.getAttribute("connect")),this.graph.foldingEnabled="0"!=e.getAttribute("fold"),this.graph.scrollbars="0"!=e.getAttribute("scrollbars"),this.graph.scrollbars||(this.graph.container.scrollLeft=0,this.graph.container.scrollTop=0,this.graph.view.translate.x=Number(e.getAttribute("dx")||0),this.graph.view.translate.y=Number(e.getAttribute("dy")||0)),this.graph.pageVisible="1"==e.getAttribute("page"),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var t=e.getAttribute("pageScale");this.graph.pageScale=null!=t?t:1.5;var a=e.getAttribute("pageWidth"),i=e.getAttribute("pageHeight");null!=a&&null!=i&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(a),parseFloat(i)),this.outline.outline.pageFormat=this.graph.pageFormat);var s=e.getAttribute("background");null!=s&&0<s.length&&(this.graph.background=s),n.decode(e,this.graph.getModel()),this.updateGraphComponents()}},Editor.prototype.getGraphXml=function(){var e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel());return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),1!=this.graph.view.scale&&e.setAttribute("scale",Math.round(1e3*this.graph.view.scale)/1e3),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),this.graph.scrollbars||e.setAttribute("scrollbars","0"),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var e=this.graph,n=this.outline;if(null!=e.container&&null!=n.outline.container){null!=e.background?"none"==e.background?e.container.style.backgroundColor="transparent":(null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=e.background,e.view.backgroundPageShape.reconfigure()),e.container.style.backgroundColor=e.background):e.container.style.backgroundColor="",e.pageVisible?(e.container.style.backgroundColor="#ebebeb",e.container.style.borderStyle="solid",e.container.style.borderColor="#e5e5e5",e.container.style.borderTopWidth="1px",e.container.style.borderLeftWidth="1px",e.container.style.borderRightWidth="0px",e.container.style.borderBottomWidth="0px"):e.container.style.border="",n.outline.container.style.backgroundColor=e.container.style.backgroundColor,n.outline.pageVisible==e.pageVisible&&n.outline.pageScale==e.pageScale||(n.outline.pageScale=e.pageScale,n.outline.pageVisible=e.pageVisible,n.outline.view.validate()),e.scrollbars&&"hidden"==e.container.style.overflow&&!touchStyle?e.container.style.overflow="auto":e.scrollbars&&!touchStyle||(e.container.style.overflow="hidden");var t=mxClient.IS_IE&&9<=document.documentMode?"url("+this.transparentImage+")":"none";e.container.style.backgroundImage=!e.pageVisible&&e.isGridEnabled()?"url("+this.gridImage+")":t,null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+this.gridImage+")":"none")}},Editor.prototype.init=function(){mxClient.IS_IE6&&mxClient.link("stylesheet",CSS_PATH+"/grapheditor-ie6.css"),mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE),mxConstants.DEFAULT_HOTSPOT=.3;var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var t=e.apply(this,arguments);return t.intersects=mxUtils.bind(this,function(e,n){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(t,arguments)}),t},mxConstants.SHADOWCOLOR="#d0d0d0",mxConstants.HANDLE_FILLCOLOR="#99ccff",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,mxRubberband.prototype.defaultOpacity=30,mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,this.graph.background||"white","#cacaca")},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.getGraphBounds(),n=0<e.width?e.x/this.scale-this.translate.x:0,t=0<e.height?e.y/this.scale-this.translate.y:0,a=e.width/this.scale,i=e.height/this.scale,s=this.graph.pageFormat,o=this.graph.pageScale,r=s.width*o,l=s.height*o,d=Math.floor(Math.min(0,n)/r),c=Math.floor(Math.min(0,t)/l),m=Math.ceil(Math.max(1,n+a)/r)-d,u=Math.ceil(Math.max(1,t+i)/l)-c;return new mxRectangle(this.scale*(this.translate.x+d*r),this.scale*(this.translate.y+c*l),this.scale*m*r,this.scale*u*l)};var t=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(e,n){t.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=e+"px",this.view.backgroundPageShape.node.style.marginTop=n+"px")};var a=this;mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var n=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(n,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);if(this.graph.pageVisible){n=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(n),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(this.graph.container),this.graph.container.firstChild.style.position="absolute",this.graph.container.insertBefore(this.backgroundPageShape.node,this.graph.container.firstChild),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",this.backgroundPageShape.node.style.backgroundPosition="-1px -1px",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=n,this.backgroundPageShape.redraw()),this.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+a.gridImage+")":"none"}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraph.prototype.updatePageBreaks=function(e,n,t){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale,r=this.view.getBackgroundPageBounds();n=r.width,t=r.height;var l=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o),d=(e=e&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(n/l.width)-1:0,c=e?Math.ceil(t/l.height)-1:0,m=r.x+n,u=r.y+t;if(null==this.horizontalPageBreaks&&0<d&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(var p=0;p<=d;p++){var g=[new mxPoint(r.x+(p+1)*l.width,r.y),new mxPoint(r.x+(p+1)*l.width,u)];if(null!=this.horizontalPageBreaks[p])this.horizontalPageBreaks[p].scale=1,this.horizontalPageBreaks[p].points=g,this.horizontalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,this.scale)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.horizontalPageBreaks[p]=v}for(p=d;p<this.horizontalPageBreaks.length;p++)this.horizontalPageBreaks[p].destroy();this.horizontalPageBreaks.splice(d,this.horizontalPageBreaks.length-d)}if(null==this.verticalPageBreaks&&0<c&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(p=0;p<=c;p++){var v;g=[new mxPoint(r.x,r.y+(p+1)*l.height),new mxPoint(m,r.y+(p+1)*l.height)];if(null!=this.verticalPageBreaks[p])this.verticalPageBreaks[p].scale=1,this.verticalPageBreaks[p].points=g,this.verticalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,a)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.verticalPageBreaks[p]=v}for(p=c;p<this.verticalPageBreaks.length;p++)this.verticalPageBreaks[p].destroy();this.verticalPageBreaks.splice(c,this.verticalPageBreaks.length-c)}},mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0;var s=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,n,t){for(var a=0;a<n.length;a++)if(this.graph.getModel().isVertex(n[a])){var i=this.graph.getCellGeometry(n[a]);if(null!=i&&i.relative)return!1}return s.apply(this,arguments)},mxGuide.prototype.isEnabledForEvent=function(e){return!mxEvent.isAltDown(e)};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,n,t,a,i,s){var o=r.apply(this,arguments);return null==s||s||mxEvent.addListener(o,"mousedown",function(e){mxEvent.consume(e)}),o};var o=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(e){var n=this.graph.getModel(),t=n.getParent(this.graph.getSelectionCell()),a=o.apply(this,arguments),i=n.getParent(a);if(null==t||t!=a&&t!=i)for(;!this.graph.isCellSelected(a)&&!this.graph.isCellSelected(i)&&n.isVertex(i)&&!this.graph.isValidRoot(i);)a=i,i=this.graph.getModel().getParent(a);return a};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(e){var n=l.apply(this,arguments),t=this.graph.getModel(),a=t.getParent(this.graph.getSelectionCell()),i=t.getParent(e);return(null==a||a!=e&&a!=i)&&(this.graph.isCellSelected(e)||!t.isVertex(i)||this.graph.isValidRoot(i)||(n=!0)),n},mxGraphHandler.prototype.selectDelayed=function(e){var n=e.getCell();null==n&&(n=this.cell);for(var t=this.graph.getModel(),a=t.getParent(n);this.graph.isCellSelected(n)&&t.isVertex(a)&&!this.graph.isValidRoot(a);)n=a,a=t.getParent(n);this.graph.selectCellForEvent(n,e.getEvent())},mxPanningHandler.prototype.getCellForPopupEvent=function(e){for(var n=e.getCell(),t=this.graph.getModel(),a=t.getParent(n);t.isVertex(a)&&!this.graph.isValidRoot(a);)this.graph.isCellSelected(a)&&(n=a),a=t.getParent(a);return n}},Editor.prototype.createUndoManager=function(){var s=this.graph,t=new mxUndoManager,e=function(e,n){t.undoableEditHappened(n.getProperty("edit"))};s.getModel().addListener(mxEvent.UNDO,e),s.getView().addListener(mxEvent.UNDO,e);var n=function(e,n){for(var t=s.getSelectionCellsForChanges(n.getProperty("edit").changes),a=[],i=1;i<t.length;i++)null!=s.view.getState(t[i])&&a.push(t[i]);s.setSelectionCells(a)};return t.addListener(mxEvent.UNDO,n),t.addListener(mxEvent.REDO,n),t},Editor.prototype.initStencilRegistry=function(){mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/general.xml")},mxStencilRegistry.libraries={},mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(e){var n=mxStencilRegistry.stencils[e];if(null==n){var t=mxStencilRegistry.getBasenameForStencil(e);if(null!=t){var a=mxStencilRegistry.libraries[t];if(null!=a){if(null==mxStencilRegistry.packages[t]){mxStencilRegistry.packages[t]=1;for(var i=0;i<a.length;i++){var s=a[i];if(".xml"==s.toLowerCase().substring(s.length-4,s.length))mxStencilRegistry.loadStencilSet(s,null);else if(".js"==s.toLowerCase().substring(s.length-3,s.length)){var o=mxUtils.load(s);null!=o&&eval.call(window,o.getText())}}}}else mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+t+".xml",null);n=mxStencilRegistry.stencils[e]}}return n},mxStencilRegistry.getBasenameForStencil=function(e){var n=e.split("."),t=null;if(0<n.length&&"mxgraph"==n[0]){t=n[1];for(var a=2;a<n.length-1;a++)t+="/"+n[a]}return t},mxStencilRegistry.loadStencilSet=function(e,n,t){t=null!=t&&t;var a=mxStencilRegistry.packages[e];if(t||null==a){var i=!1;null==a&&(a=mxUtils.load(e).getXml(),mxStencilRegistry.packages[e]=a,i=!0),mxStencilRegistry.parseStencilSet(a,n,i)}},mxStencilRegistry.parseStencilSet=function(e,n,t){t=null==t||t;var a=e.documentElement,i=a.firstChild,s="",o=a.getAttribute("name");for(null!=o&&(s=o+".");null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(o=i.getAttribute("name"))){s=s.toLowerCase();var r=o.replace(/ /g,"_");if(t&&mxStencilRegistry.addStencil(s+r.toLowerCase(),new mxStencil(i)),null!=n){var l=i.getAttribute("w"),d=i.getAttribute("h");n(s,r,o,l=null==l?80:parseInt(l,10),d=null==d?80:parseInt(d,10))}}i=i.nextSibling}},OpenFile=function(e){this.producer=null,this.consumer=null,this.done=e},OpenFile.prototype.setConsumer=function(e){this.consumer=e,this.execute()},OpenFile.prototype.setData=function(e,n){this.data=e,this.filename=n,this.execute()},OpenFile.prototype.error=function(e){this.cancel(),mxUtils.alert(e)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.data&&(this.consumer(this.data,this.filename),this.cancel())},OpenFile.prototype.cancel=function(){null!=this.done&&this.done()},Sidebar.prototype.init=function(){var e=STENCIL_PATH;this.addSearchPalette(!0),this.addImagePalette("entry",mxResources.get("entry"),e+"/entry/","_128x128.png",["start","finally","end"],[mxResources.get("start"),mxResources.get("finally"),mxResources.get("end")]),this.addImagePalette("call_management",mxResources.get("call_management"),e+"/call_management/","_128x128.png",["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[mxResources.get("answer"),mxResources.get("hangup"),mxResources.get("dial"),mxResources.get("ext_dial"),mxResources.get("queue"),mxResources.get("voicemail"),mxResources.get("callback")]),this.addImagePalette("agent_management",mxResources.get("agent_management"),e+"/agent_management/","_128x128.png",["login","pause","unpause","logout"],[mxResources.get("login"),mxResources.get("pause"),mxResources.get("unpause"),mxResources.get("logout")]),this.addImagePalette("variable",mxResources.get("variable"),e+"/variable/","_128x128.png",["set","math"],[mxResources.get("set"),mxResources.get("math")]),this.addImagePalette("playback",mxResources.get("playback"),e+"/playback/","_128x128.png",["playback","menu","saydigits","saynumber","sayphonetic","getdigits","getsecretdigits"],[mxResources.get("playback"),mxResources.get("menu"),mxResources.get("saydigits"),mxResources.get("saynumber"),mxResources.get("sayphonetic"),mxResources.get("getdigits"),mxResources.get("getsecretdigits")]),this.addImagePalette("recording",mxResources.get("recording"),e+"/recording/","_128x128.png",["record"],[mxResources.get("record")]),this.addImagePalette("tts","TTS",e+"/tts/","_128x128.png",["google_cloud_tts","tts","ispeechtts","awspolly","lumenvoxtts","sestektts","mrcpsynth"],["Google Cloud TTS","GoogleTTS","ISpeechTTS","AWSPolly","LumenvoxTTS","SestekTTS","MRCPSynth"]),this.addImagePalette("asr","ASR",e+"/asr/","_128x128.png",["googleasr","ispeechasr","lumenvoxasr","tildeasr","sestekasr","mrcprecog"],["GoogleASR","ISpeechASR","LumenvoxASR","TildeASR","SestekASR","MRCPRecog"]),this.addImagePalette("integrationServer",mxResources.get("integrationServer"),e+"/integration_server/","_128x128.png",["database","sendMail","sendSMS","dialogflow","dialogflowV2","awslex","sesteknda","restapi"],[mxResources.get("database"),mxResources.get("sendMail"),mxResources.get("sendSMS"),"Dialogflow","DialogflowV2","AWSLex","SestekNDA","RestAPI"]),this.addImagePalette("callflow",mxResources.get("callflow"),e+"/callflow/","_128x128.png",["gotoc","gotoif","gotoiftime","vswitch"],[mxResources.get("gotoc"),mxResources.get("gotoif"),mxResources.get("gotoiftime"),mxResources.get("vswitch")]),this.addImagePalette("stats",mxResources.get("stats"),e+"/stats/","_128x128.png",["goal"],[mxResources.get("goal")]),this.addImagePalette("general",mxResources.get("general"),e+"/general/","_128x128.png",["noop","system","agi","subproject","custom_app"],[mxResources.get("noop"),mxResources.get("system"),mxResources.get("agi"),mxResources.get("subproject"),mxResources.get("custom_app")])},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.thumbWidth=36,Sidebar.prototype.thumbHeight=36,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2,Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Sidebar.prototype.showTooltip=function(c,m,u,p,g,v){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=c){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var e=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px",document.body.appendChild(this.tooltipImage)),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),u>this.maxTooltipWidth||p>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/u,this.maxTooltipHeight/p))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==v||v,this.graph2.addCells(m);var e=this.graph2.getGraphBounds(),n=e.width+2*this.tooltipBorder+4,t=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(t+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=n+"px",this.tooltipTitles&&null!=g&&0<g.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",mxClient.IS_SVG||(this.tooltipTitle.style.position="absolute"),this.tooltipTitle.style.paddingTop="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g);var a=this.tooltipTitle.offsetHeight+10;t+=a,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-a+"px":(t-=6,this.tooltipTitle.style.top=t-a+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=t+"px";var i=-Math.round(e.x-this.tooltipBorder),s=-Math.round(e.y-this.tooltipBorder),o=document.body,r=document.documentElement,l=(o.clientHeight||r.clientHeight,document.getElementById("vertical-navigation").offsetWidth+this.container.clientWidth),d=Math.max(0,this.getOffset(c).top-this.container.scrollTop-t/2+16);mxClient.IS_SVG?0!=i||0!=s?this.graph2.view.canvas.setAttribute("transform","translate("+i+","+s+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=i+"px",this.graph2.view.drawPane.style.top=s+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=l+"px",this.tooltip.style.top=d+"px",this.tooltipImage.style.left=l-13+"px",this.tooltipImage.style.top=d+t/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?e():this.thread=window.setTimeout(e,this.tooltipDelay),this.currentElt=c}},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},Sidebar.prototype.addEntry=function(e,n){if(null!=this.taglist&&null!=e&&0<e.length)for(var t=e.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),a=0;a<t.length;a++)if(t[a]=t[a].replace(/\.*\d*$/,""),1<t[a].length){var i=this.taglist[t[a]];null==i&&(i={entries:[],dict:new mxDictionary},this.taglist[t[a]]=i),null==i.dict.get(n)&&(i.dict.put(n,n),i.entries.push(n))}return n},Sidebar.prototype.searchEntries=function(e,n,t,a,i){if(null!=this.taglist&&null!=e){for(var s=e.toLowerCase().split(" "),o=new mxDictionary,r=(t+1)*n,l=[],d=0,c=0;c<s.length;c++)if(0<s[c].length){var m=this.taglist[s[c]],u=new mxDictionary;if(null!=m){var p=m.entries;l=[];for(var g=0;g<p.length;g++){m=p[g];if(0==d==(null==o.get(m))&&(u.put(m,m),l.push(m),c==s.length-1&&l.length==r))return void a(l.slice(t*n,r),r,!0)}}else l=[];o=u,d++}var v=l.length;a(l.slice(t*n,(t+1)*n),v,!1)}else a([])},Sidebar.prototype.filterTags=function(e){if(null==e)return null;for(var n=e.split(" "),t=[],a={},i=0;i<n.length;i++)null==a[n[i]]&&(a[n[i]]="1",t.push(n[i]));return t.join(" ")},Sidebar.prototype.cloneCell=function(e,n){var t=e.clone();return null!=n&&(t.value=n),t},Sidebar.prototype.addSearchPalette=function(e){var n=document.createElement("div");n.style.visibility="hidden",this.container.appendChild(n);var r=document.createElement("div");r.className="geSidebar",r.style.boxSizing="border-box",r.style.overflow="hidden",r.style.width="100%",r.style.padding="8px",r.style.paddingTop="14px",r.style.paddingBottom="0px",e||(r.style.display="none");var t=document.createElement("div");t.style.whiteSpace="nowrap",t.style.textOverflow="clip",t.style.paddingBottom="8px",t.style.cursor="default";var a=document.createElement("input");a.setAttribute("placeholder",mxResources.get("searchShapes")),a.setAttribute("type","text"),a.style.fontSize="12px",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.border="solid 1px #d5d5d5",a.style.borderRadius="4px",a.style.width="100%",a.style.outline="none",a.style.padding="6px",t.appendChild(a);var i,s=document.createElement("img");s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search")),s.style.position="relative",s.style.left="-18px",mxClient.IS_QUIRKS?(a.style.height="28px",s.style.top="-4px"):s.style.top="2px",s.style.background="url('"+this.editorUi.editor.transparentImage+"')",t.appendChild(s),r.appendChild(t);var l=document.createElement("center"),d=mxUtils.button(mxResources.get("moreResults"),function(){i()});d.style.display="none",d.style.lineHeight="normal",d.style.marginTop="4px",d.style.marginBottom="8px",l.style.paddingTop="4px",l.style.paddingBottom="8px",l.appendChild(d),r.appendChild(l);var c="",m=!1,u=!1,p=0,g=new Object,v=12,h=mxUtils.bind(this,function(){m=!1,this.currentSearch=null;for(var e=r.firstChild;null!=e;){var n=e.nextSibling;e!=t&&e!=l&&e.parentNode.removeChild(e),e=n}});i=mxUtils.bind(this,function(){if(v=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=a.value){if(null!=l.parentNode&&(c!=a.value&&(h(),c=a.value,g=new Object,u=!1,p=0),!m&&!u)){d.setAttribute("disabled","true"),d.style.display="",d.style.cursor="wait",d.innerHTML=mxResources.get("loading")+"...",m=!0;var o=new Object;this.currentSearch=o,this.searchEntries(c,v,p,mxUtils.bind(this,function(e,n,t){if(this.currentSearch==o){e=null!=e?e:[],m=!1,p++,l.parentNode.removeChild(l);for(var a=0;a<e.length;a++){var i=e[a]();null==g[i.innerHTML]&&(g[i.innerHTML]="1",r.appendChild(e[a]()))}if(t?(d.removeAttribute("disabled"),d.innerHTML=mxResources.get("moreResults")):(d.innerHTML=mxResources.get("reset"),d.style.display="none",u=!0),d.style.cursor="",0==e.length&&1==p){var s=document.createElement("div");s.className="geTitle",s.style.backgroundColor="transparent",s.style.borderColor="transparent",s.style.color="gray",s.style.padding="0px",s.style.margin="0px 8px 0px 8px",s.style.paddingTop="6px",s.style.textAlign="center",s.style.cursor="default",mxUtils.write(s,mxResources.get("noResultsFor",[c])),r.appendChild(s)}r.appendChild(l)}}),mxUtils.bind(this,function(){d.style.cursor=""}))}}else h(),a.value="",c="",g=new Object,d.style.display="none",u=!1,a.focus()}),mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){13==e.keyCode&&i()})),mxEvent.addListener(a,"focus",function(){a.style.paddingRight="",s.style.display="none"}),mxEvent.addListener(a,"blur",function(){a.style.paddingRight="20px",s.style.display=""}),a.style.paddingRight="20px",mxEvent.addListener(a,"keyup",mxUtils.bind(this,function(e){""==a.value?(u=!0,d.style.display="none"):a.value!=c?(d.style.display="none",u=!1):m||(d.style.display=u?"none":"")})),mxEvent.addListener(a,"mousedown",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}),mxEvent.addListener(a,"selectstart",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0});var o=document.createElement("div");o.appendChild(r),this.container.appendChild(o),this.palettes.search=[n,o]},Sidebar.prototype.createTitle=function(e){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.setAttribute("title",mxResources.get("sidebarTooltip")),n.className="geTitle",mxUtils.write(n,e),n},Sidebar.prototype.createThumb=function(e,n,t,a,i,s,o,r,l){this.graph.labelsVisible=null==s||s;var d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(e);var c=this.graph.getGraphBounds(),m=Math.floor(100*Math.min((n-2*this.thumbBorder)/c.width,(t-2*this.thumbBorder)/c.height))/100;this.graph.view.scaleAndTranslate(m,Math.floor((n-c.width*m)/2/m-c.x),Math.floor((t-c.height*m)/2/m-c.y));var u=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?(u=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML:u=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=d,mxClient.IS_IE6&&(a.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),u.style.position="relative",u.style.overflow="hidden",u.style.cursor="move",u.style.left=this.thumbBorder+"px",u.style.top=this.thumbBorder+"px",u.style.width=n+"px",u.style.height=t+"px",u.style.visibility="",u.style.minWidth="",u.style.minHeight="",a.appendChild(u),this.sidebarTitles&&null!=i&&0!=o){var p=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;a.style.height=this.thumbHeight+p+this.sidebarTitleSize+8+"px";var g=document.createElement("div");g.style.fontSize=this.sidebarTitleSize+"px",g.style.color="#303030",g.style.textAlign="center",g.style.whiteSpace="nowrap",mxClient.IS_IE&&(g.style.height=this.sidebarTitleSize+12+"px"),g.style.paddingTop="4px",mxUtils.write(g,i),a.appendChild(g)}return c},Sidebar.prototype.createItem=function(n,t,a,e,i,s,o){var r=document.createElement("a");r.setAttribute("href","javascript:void(0);"),r.className="geItem",r.style.overflow="hidden";var l=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+l+"px",r.style.height=this.thumbHeight+l+"px",r.style.padding=this.thumbPadding+"px",mxEvent.addListener(r,"click",function(e){mxEvent.consume(e)}),this.createThumb(n,this.thumbWidth,this.thumbHeight,r,t,a,e,i,s);var d=new mxRectangle(0,0,i,s);if(1<n.length||n[0].vertex){var c=this.createDragSource(r,this.createDropHandler(n,!0,o,d),this.createDragPreview(i,s),n,d);this.addClickHandler(r,c,n),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=n[0]&&n[0].edge){c=this.createDragSource(r,this.createDropHandler(n,!1,o,d),this.createDragPreview(i,s),n,d);this.addClickHandler(r,c,n)}return mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(e){this.showTooltip(r,n,d.width,d.height,t,a)})),r},Sidebar.prototype.createDropHandler=function(g,v,h,f){return h=null==h||h,mxUtils.bind(this,function(e,n,t,a,i){if(e.isEnabled()){if(0<(g=e.getImportableCells(g)).length){e.stopEditing();var s=null!=t&&e.isValidDropTarget(t,g,n),o=null;if(null==t||s||(t=null),!e.isCellLocked(t||e.getDefaultParent())){e.model.beginUpdate();try{if(a=Math.round(a),i=Math.round(i),v&&e.isSplitTarget(t,g,n)){var r=e.cloneCells(g);e.splitEdge(t,r,null,a-f.width/2,i-f.height/2),o=r}else 0<g.length&&(o=e.importCells(g,a,i,t));if(null!=e.layoutManager){var l=e.layoutManager.getLayout(t);if(null!=l)for(var d=e.view.scale,c=e.view.translate,m=(a+c.x)*d,u=(i+c.y)*d,p=0;p<o.length;p++)l.moveCell(o[p],m,u)}h&&e.fireEvent(new mxEventObject("cellsInserted","cells",o))}finally{e.model.endUpdate()}null!=o&&0<o.length&&(e.scrollCellToVisible(o[0]),e.setSelectionCells(o))}}mxEvent.consume(n)}})},Sidebar.prototype.createDragPreview=function(e,n){var t=document.createElement("div");return t.style.border="1px dashed black",t.style.width=e+"px",t.style.height=n+"px",t},Sidebar.prototype.createDragSource=function(e,n,t){var a=mxUtils.makeDraggable(e,this.editorUi.editor.graph,n,t,0,0,this.editorUi.editor.graph.autoscroll,!0,!0);return a.getDropTarget=function(e,n,t){var a=mxDragSource.prototype.getDropTarget.apply(this,arguments);return e.isValidRoot(a)||(a=null),a},a},Sidebar.prototype.addClickHandler=function(e,a){var i=this.editorUi.editor.graph,s=null;mxEvent.addGestureListeners(e,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e))});var o=a.mouseUp;a.mouseUp=function(e){if(!mxEvent.isPopupTrigger(e)&&null==this.currentGraph&&null!=s){var n=i.tolerance;if(Math.abs(s.x-mxEvent.getClientX(e))<=n&&Math.abs(s.y-mxEvent.getClientY(e))<=n){var t=i.getGridSize();a.drop(i,e,null,t,t)}}o.apply(this,arguments),s=null}},Sidebar.prototype.createVertexTemplateEntry=function(e,n,t,a,i,s,o,r){return r=null!=r&&0<r.length?r:i.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(e,n,t,a,i,s,o)}))},Sidebar.prototype.createXmlDocument=function(e,n,t,a){var i=mxUtils.createXmlDocument().createElement(e);return i.setAttribute("label",n),t.forEach(function(e,n){i.setAttribute(e,a[n]?a[n]:"")}),i},Sidebar.prototype.createVertexTemplate=function(e,n,t,a,i,s,o,r){var l=[],d=[];switch(a){case"answer":l=["timeout"],d=["0"];break;case"start":l=["answer"],d=["yes"];break;case"googleasr":l=["key","google_asr_language","timeout","intKey","beep"],d=["","it-IT","10","#","BEEP"];break;case"tildeasr":l=["uri","appid","appsecret","timeout","intKey","beep"],d=["wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE","","","10","#","BEEP"];break;case"ispeechasr":l=["key","model","ispeech_asr_language","timeout","intKey","beep"],d=["","","it-IT","10","#","BEEP"];break;case"playback":l=["file_id","opts"],d=["0"];break;case"background":l=["file_id","response","digit"],d=["0","5","1"];break;case"menu":l=["file_id","response","digit","retry","variable_id"],d=["0","5","1","1","0"];break;case"getdigits":l=["file_id","response","mindigit","maxdigit","retry","variable_id"],d=["0","5","1","10","1","0"];break;case"getsecretdigits":l=["file_id","response","mindigit","maxdigit","retry","hiddendigitsnum","hiddendigitspos","variable_id"],d=["0","5","1","10","1","0","first","0"];break;case"custom_app":l=["application","options"],d=["",""];break;case"set":l=["variable_id","variable_value"],d=["0",""];break;case"database":l=["odbc_id","query","variable_id"],d=["0","",""];break;case"noop":l=["output"],d=[];break;case"gotoc":l=["context","extension","priority"],d=["","","1"];break;case"system":l=["variable_id","command"],d=[];break;case"agi":l=["command","args"],d=[];break;case"gotoif":l=["condition"],d=[];break;case"gotoiftime":l=["interval_id"],d=["0"];break;case"vswitch":l=["variable_id"],d=["0"];break;case"saydigits":l=["digits","escape_digits"],d=["","#"];break;case"saynumber":l=["number","escape_digits"],d=["","#"];break;case"sayphonetic":l=["text","escape_digits"],d=["","#"];break;case"record":l=["file","recordingFormat","timeout","escape_digits"],d=["","wav","-1","#"];break;case"dial":l=["sip_id","timeout","opts","url"],d=["0","60"];break;case"ext_dial":l=["phone","trunk_name","timeout","opts","url"],d=["","-1","60"];break;case"google_cloud_tts":l=["apiKey","google_cloud_tts_text_type","text","languageCode","ssmlGender"],d=["","text","","en-US","FEMALE"];break;case"tts":l=["text","google_tts_language"],d=["","it"];break;case"ispeechtts":l=["text","key","ispeech_tts_language","speed","intKey"],d=["","","euritalianfemale","0","#"];break;case"lumenvoxtts":case"sestektts":l=["text","options"],d=["",""];break;case"lumenvoxasr":l=["grammar","options"],d=["",""];break;case"sestekasr":l=["grammar","options"],d=["/usr/local/unimrcp/data/grammar.xml",""];break;case"awspolly":l=["aws_access_key_id","aws_secret_access_key","aws_polly_region","aws_polly_voice","text","aws_text_type"],d=["","","eu-west-1","Amy","","text"];break;case"awslex":l=["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],d=["","","eu-west-1","",""];break;case"queue":l=["queue_id","opts","url","file_id","timeout","agi","macro","gosub","position"],d=["-1","xX","","","300"];break;case"voicemail":l=["mailbox","options"],d=["",""];break;case"subproject":l=["project_id"],d=["0"];break;case"math":l=["operation","variable_id"],d=["","0"];break;case"queuelog":l=["queuename","agent","queue_event","data1","data2","data3","data4","data5"],d=[];break;case"goal":l=["goalname"],d=[];break;case"callback":l=["name","lastName","phone","dialTimezone","list_id","delay","callback_priority"],d=["{CALLERID(name)}","","{CALLERID(num)}","","-1","5","2"];break;case"sendSMS":l=["sms_account_id","to","sms_text"],d=["0"];break;case"sendMail":l=["account_id","to","cc","bcc","subject","text"],d=["0"];break;case"sendFax":l=["account_id","to","choose_attachment","attachment_name","attachment_type","attachment_path"],d=["0"];break;case"login":case"unpause":case"logout":l=["findBy"],d=["internal"];break;case"pause":l=["findBy","pause_id"],d=["internal",""];break;case"dialogflow":l=["key","text","dialogflow_language"],d=["","","it"];break;case"sesteknda":l=["ndauth_url","username","password","ndassistant_url","text","project","ndagenerate_audio","custom_action","custom_action_data","ndaactivity_type"],d=["","","","","","",1,"","","message"];break;case"restapi":l=["url","method","timeout","computedVariables","rawHeaders","rawBody","variable_id"],d=["","GET","5","","","",""];break;case"mrcpsynth":l=["text","options"],d=["",""];break;case"mrcprecog":l=["grammar","options"],d=["",""];break;case"dialogflowV2":l=["dialogflowV2_project_id","client_email","private_key","dialogflowV2_language","text"],d=["","","","en",""];break;default:l=[],d=[]}var c=[new mxCell(this.createXmlDocument(a,i,l,d),new mxGeometry(0,0,n,t),e)];return c[0].vertex=!0,this.createVertexTemplateFromCells(c,n,t,i,s,o,r)},Sidebar.prototype.createVertexTemplateFromCells=function(e,n,t,a,i,s,o){return this.createItem(e,a,i,s,n,t,o)},Sidebar.prototype.createEdgeTemplate=function(e,n,t,a,i,s,o){var r=new mxCell(null!=a?a:"",new mxGeometry(0,0,n,t),e);return r.geometry.setTerminalPoint(new mxPoint(0,t),!0),r.geometry.setTerminalPoint(new mxPoint(n,0),!1),r.geometry.relative=!0,r.edge=!0,this.createEdgeTemplateFromCells([r],n,t,i,s,o)},Sidebar.prototype.createEdgeTemplateFromCells=function(e,n,t,a,i,s){return this.createItem(e,a,i,!0,n,t,s)},Sidebar.prototype.addPaletteFunctions=function(e,n,t,a){this.addPalette(e,n,t,mxUtils.bind(this,function(e){for(var n=0;n<a.length;n++)e.appendChild(a[n](e))}))},Sidebar.prototype.addPalette=function(e,n,t,a){var i=this.createTitle(n);this.container.appendChild(i);var s=document.createElement("div");s.className="geSidebar",mxClient.IS_POINTER&&(s.style.touchAction="none"),mxEvent.addListener(s,"mousemove",mxUtils.bind(this,function(e){mxEvent.getSource(e)==s?s.setAttribute("title",mxResources.get("sidebarTooltip")):s.removeAttribute("title")})),t?(a(s),a=null):s.style.display="none",this.addFoldingHandler(i,s,a);var o=document.createElement("div");return o.appendChild(s),this.container.appendChild(o),null!=e&&(this.palettes[e]=[i,o]),s},Sidebar.prototype.addFoldingHandler=function(t,a,i){var s=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(t.style.backgroundImage="none"==a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="0% 50%",mxEvent.addListener(t,"click",mxUtils.bind(this,function(e){if("none"==a.style.display){if(s)a.style.display="block";else if(s=!0,null!=i){t.style.cursor="wait";var n=t.innerHTML;t.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,i(a),mxClient.NO_FO=e,a.style.display="block",t.style.cursor="",t.innerHTML=n},0)}else a.style.display="block";t.style.backgroundImage="url('"+this.expandedImage+"')"}else t.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none";mxEvent.consume(e)}))},Sidebar.prototype.addImagePalette=function(e,n,s,o,r,t,a){for(var l=[],d=0;d<r.length;d++)mxUtils.bind(this,function(e,n,t){if(null==t){var a=e.lastIndexOf("/"),i=e.lastIndexOf(".");t=e.substring(0<=a?a+1:0,0<=i?i:e.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;image="+s+e+o,this.defaultImageWidth,this.defaultImageHeight,r[d],n,!1,!0,this.filterTags(t)))})(r[d],null!=t?t[d]:null,null!=a?a[r[d]]:null);this.addPaletteFunctions(e,n,!1,l)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0),mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{if(null!=navigator&&null!=navigator.language){var e=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===e||"en-ca"===e||"es-mx"===e?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.gridColor="#e0e0e0",mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",Graph=function(e,n,t,a){mxGraph.call(this,e,n,t,a),this.setConnectable(!0),this.setDropEnabled(!1),this.setPanning(!0),this.setTooltips(!mxClient.IS_TOUCH),this.setAllowLoops(!1),this.setMultigraph(!1),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.connectionHandler.targetConnectImage=!0,this.setAllowDanglingEdges(!1),this.connectionHandler.setCreateTarget(!1),this.connectionHandler.isValidSource=function(){return mxConnectionHandler.prototype.isValidSource.apply(this,arguments)&&"2"!=urlParams.connect},this.alternateEdgeStyle="vertical",null==a&&this.loadStylesheet();var i=new mxRubberband(this);this.getRubberband=function(){return i},this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.container.style.cursor="pointer"})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.container.style.cursor="default"})),this.isHtmlLabel=function(e){var n=this.view.getState(e),t=null!=n?n.style:this.getCellStyle(e);return"1"==t.html||"wrap"==t.whiteSpace},this.cellRenderer.getLabelValue=function(e){var n=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return"wrap"==e.style.whiteSpace&&1!=e.style.html&&(n=mxUtils.htmlEntities(n,!1)),n},this.isCellLocked=function(e){return!1},this.connectionHandler.tapAndHoldTolerance=16;var s=this.connectionHandler.tapAndHold;this.connectionHandler.tapAndHold=function(e,n){null==n?this.graph.panningHandler.active||(i.start(e.getGraphX(),e.getGraphY()),this.graph.panningHandler.panningTrigger=!1):tapAndHoldStartsConnection?s.apply(this,arguments):this.graph.isCellSelected(n.cell)&&1<this.graph.getSelectionCount()&&this.graph.removeSelectionCell(n.cell)},touchStyle&&this.initTouch()},mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.loadStylesheet=function(){var e=mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();new mxCodec(e.ownerDocument).decode(e,this.getStylesheet())},Graph.prototype.flipEdge=function(e){if(null!=e){var n=this.view.getState(e),t=null!=n?n.style:this.getCellStyle(e);if(null!=t){var a=mxUtils.getValue(t,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,a,[e])}}},Graph.prototype.setDefaultEdge=function(e){if(null!=e&&this.getModel().isEdge(e)){var n=this.getModel().cloneCells([e])[0];null!=n.geometry&&(n.geometry.points=null);var t=n.getStyle();t=mxUtils.setStyle(t,mxConstants.STYLE_ENTRY_X,null),t=mxUtils.setStyle(t,mxConstants.STYLE_ENTRY_Y,null),t=mxUtils.setStyle(t,mxConstants.STYLE_EXIT_X,null),t=mxUtils.setStyle(t,mxConstants.STYLE_EXIT_Y,null),n.setStyle(t),this.connectionHandler.createEdgeState=function(e){return this.graph.view.createState(n)},this.connectionHandler.factoryMethod=function(){return this.graph.cloneCells([n])[0]}}},Graph.prototype.isCellFoldable=function(e){return this.foldingEnabled&&this.isSwimlane(e)},Graph.prototype.isValidRoot=function(e){return this.isSwimlane(e)},Graph.prototype.createGroupCell=function(){var e=mxGraph.prototype.createGroupCell.apply(this,arguments);return e.setStyle("group"),e},Graph.prototype.getTooltipForCell=function(e){var n="";return this.getModel().isVertex(e)?n+=mxResources.get("description_"+e.value.nodeName)||"":this.getModel().isEdge(e)&&(n=mxGraph.prototype.getTooltipForCell.apply(this,arguments)),n},Graph.prototype.convertValueToString=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("label"):mxGraph.prototype.convertValueToString.apply(this,arguments)},Graph.prototype.cellLabelChanged=function(e,n,t){if(null!=e.value&&"object"==typeof e.value){var a=e.value.cloneNode(!0);a.setAttribute("label",n),n=a}mxGraph.prototype.cellLabelChanged.apply(this,arguments)},Graph.prototype.setLinkForCell=function(e,n){var t=null;null!=e.value&&"object"==typeof e.value?t=e.value.cloneNode(!0):(t=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",e.value);null!=n&&0<n.length?t.setAttribute("link",n):t.removeAttribute("link"),this.model.setValue(e,t)},Graph.prototype.getLinkForCell=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("link"):null},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(e,n){this.panningHandler.hideMenu()});var s=!1,o=null;this.updateMouseEvent=function(e){if(mxGraph.prototype.updateMouseEvent.apply(this,arguments),null==e.getState()){var n=this.getCellAt(e.graphX,e.graphY);this.getModel().isEdge(n)&&(e.state=this.view.getState(n),null!=e.state&&null!=e.state.shape&&(this.container.style.cursor=e.state.shape.node.style.cursor))}null==e.getState()&&(this.container.style.cursor="default")},this.fireMouseEvent=function(e,n,t){if(e==mxEvent.MOUSE_DOWN)this.panningHandler.isMenuShowing()?(s=!1,o=null):(o=n.getCell(),s=null!=o?this.isCellSelected(o):this.isSelectionEmpty());else if(e==mxEvent.MOUSE_UP){if(s&&!this.isEditing()){if(!this.panningHandler.isMenuShowing()){var a=mxEvent.getClientX(n.getEvent()),i=mxEvent.getClientY(n.getEvent());this.panningHandler.popup(a+16,i,o,n.getEvent())}return s=!1,o=null,void n.consume()}s=!1,o=null}mxGraph.prototype.fireMouseEvent.apply(this,arguments),e==mxEvent.MOUSE_MOVE&&n.isConsumed()&&(s=!1,o=null)}},function(){if(mxVertexHandler.prototype.rotationEnabled=!0,mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,touchStyle){mxConstants.HANDLE_SIZE=16,mxConstants.LABEL_HANDLE_SIZE=7,mxClient.IS_TOUCH&&(mxVertexHandler.prototype.tolerance=4,mxEdgeHandler.prototype.tolerance=6,Graph.prototype.tolerance=14,Graph.prototype.gridSize=20,mxPanningHandler.prototype.selectOnPopup=!1,mxPanningHandler.prototype.useLeftButtonForPanning=!0,mxPanningHandler.prototype.isPanningTrigger=function(e){var n=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())||mxEvent.isControlDown(n)&&mxEvent.isShiftDown(n)||this.usePopupTrigger&&mxEvent.isPopupTrigger(n)});var t=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(e,n){t.apply(this,arguments),this.graph.isCellSelected(n.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)},Graph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxConnectionHandler.prototype.selectCells=function(e,n){touchStyle&&null!=n?this.graph.setSelectionCell(n):this.graph.setSelectionCell(e)};var a=mxGraph.prototype.dblClick;Graph.prototype.dblClick=function(e,n){if(null==n){var t=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));n=this.getCellAt(t.x,t.y)}a.call(this,e,n)};var e=new mxImage(IMAGE_PATH+"/touch-handle.png",16,16);mxVertexHandler.prototype.handleImage=e,mxEdgeHandler.prototype.handleImage=e,mxOutline.prototype.sizerImage=e,(new Image).src=e.src;var n=IMAGE_PATH+"/touch-connector.png",i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(this.connectorImg=mxUtils.createImage(n),this.connectorImg.style.cursor="pointer",this.connectorImg.style.width="29px",this.connectorImg.style.height="29px",this.connectorImg.style.position="absolute",mxClient.IS_TOUCH||(this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state)),this.connectorImg.style.padding="2px",mxEvent.addGestureListeners(this.connectorImg,mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,n.x,n.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};var s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+4+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};var o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,n){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)},(new Image).src=n}else{var r=new mxImage(IMAGE_PATH+"/connector.png",15,15);if(mxConnectionHandler.prototype.connectImage=r,(new Image).src=r.src,"2"==urlParams.connect){r=new mxImage(IMAGE_PATH+"/connector.png",15,15),i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(mxClient.IS_IE&&!mxClient.IS_SVG?(this.connectorImg=document.createElement("div"),this.connectorImg.style.backgroundImage="url("+r.src+")",this.connectorImg.style.backgroundPosition="center",this.connectorImg.style.backgroundRepeat="no-repeat",this.connectorImg.style.width=r.width+4+"px",this.connectorImg.style.height=r.height+4+"px",this.connectorImg.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):(this.connectorImg=mxUtils.createImage(r.src),this.connectorImg.style.width=r.width+"px",this.connectorImg.style.height=r.height+"px"),this.connectorImg.style.cursor="pointer",this.connectorImg.style.position="absolute",this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state),this.connectorImg.style.padding="2px",mxEvent.addListener(this.connectorImg,"mousedown",mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,n.x,n.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+2+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,n){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)}}}}(),Actions.prototype.init=function(){var n=this.editorUi,l=n.editor,d=l.graph;this.addAction("new",function(){n.projectDesignController.newProject()},CRUD_PERMISSIONS.canEdit),this.addAction("open",function(){n.projectDesignController.openProject()},CRUD_PERMISSIONS.canEdit),this.addAction("save",function(){n.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml())),n.editor.modified=!1},CRUD_PERMISSIONS.canEdit,null,"Ctrl+S"),this.addAction("saveAs",function(){n.projectDesignController.saveProjectAs(mxUtils.getPrettyXml(l.getGraphXml()))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+S"),this.addAction("publish",function(){n.editor.setStatus(""),null===n.validate()?(n.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml()),!0),n.editor.modified=!1):(n.editor.setStatus("...Error publishing! Please check the project and try again!"),setTimeout(function(){n.editor.setStatus("")},3e3))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+P"),this.addAction("variable",function(){n.projectDesignController.newVariable()},CRUD_PERMISSIONS.canEdit),this.addAction("import",function(){n.projectDesignController.importXML(function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("export",function(){n.exportXML(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+E"),this.addAction("editFile",function(){n.projectDesignController.editXML(mxUtils.getPrettyXml(l.getGraphXml()),function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("print",function(){mxUtils.printScreen(d)},null,"sprite-print","Ctrl+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){l.undoManager.undo()},null,"sprite-undo","Ctrl+Z"),this.addAction("redo",function(){l.undoManager.redo()},null,"sprite-redo","Ctrl+Y"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut","Ctrl+X"),this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy","Ctrl+C"),this.addAction("paste",function(){mxClipboard.paste(d)},!1,"sprite-paste","Ctrl+V"),this.addAction("delete",function(){d.removeCells()},null,null,"Delete"),this.addAction("duplicate",function(){var e=d.gridSize;d.setSelectionCells(d.moveCells(d.getSelectionCells(),e,e,!0))},null,null,"Ctrl+D"),this.addAction("selectVertices",function(){d.selectVertices()},null,null,"Ctrl+Shift+V"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,"Ctrl+Shift+E"),this.addAction("selectAll",function(){d.selectAll()},null,null,"Ctrl+A"),this.addAction("home",function(){d.home()},null,null,"Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,"Page Up"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,"Page Down"),this.addAction("expand",function(){d.foldCells(!1)},null,null,"Enter"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,"Backspace"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,"Ctrl+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,"Ctrl+B"),this.addAction("group",function(){d.setSelectionCell(d.groupCells(null,0))},null,null,"Ctrl+G"),this.addAction("ungroup",function(){d.setSelectionCells(d.ungroupCells())},null,null,"Ctrl+U"),this.addAction("removeFromGroup",function(){d.removeCellsFromParent()}),this.addAction("editLink",function(){var e=d.getSelectionCell(),n=d.getLinkForCell(e);null==n&&(n=""),null!=(n=mxUtils.prompt(mxResources.get("enterValue"),n))&&d.setLinkForCell(e,n)}),this.addAction("openLink",function(){var e=d.getSelectionCell(),n=d.getLinkForCell(e);null!=n&&window.open(n)}),this.addAction("autosize",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var n=0;n<e.length;n++){var t=e[n];d.getModel().getChildCount(t)?d.updateGroupBounds([t],20):d.updateCellSize(t)}}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var e=d.getView().getState(d.getSelectionCell()),n="wrap";null!=e&&"wrap"==e.style[mxConstants.STYLE_WHITE_SPACE]&&(n=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,n)}),this.addAction("rotation",function(){var e="0",n=d.getView().getState(d.getSelectionCell());null!=n&&(e=n.style[mxConstants.STYLE_ROTATION]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)",e))&&d.setCellStyles(mxConstants.STYLE_ROTATION,e)}),this.addAction("tilt",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var n=0;n<e.length;n++){var t=e[n];if(d.getModel().isVertex(t)&&0==d.getModel().getChildCount(t)){var a=d.getCellGeometry(t);if(null!=a){(a=a.clone()).x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var i=a.width;a.width=a.height,a.height=i,d.getModel().setGeometry(t,a);var s=d.view.getState(t);if(null!=s){var o=s.style[mxConstants.STYLE_DIRECTION]||"east";"east"==o?o="south":"south"==o?o="west":"west"==o?o="north":"north"==o&&(o="east"),d.setCellStyles(mxConstants.STYLE_DIRECTION,o,[t])}}}}}finally{d.getModel().endUpdate()}}},null,null,"Ctrl+R"),this.addAction("actualSize",function(){d.zoomTo(1)}),this.addAction("zoomIn",function(){d.zoomIn()},null,null,"Add"),this.addAction("zoomOut",function(){d.zoomOut()},null,null,"Subtract"),this.addAction("fitWindow",function(){d.fit()}),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,n=d.pageScale,t=d.container.clientWidth-20,a=d.container.clientHeight-20,i=Math.floor(100*Math.min(t/e.width/n,a/e.height/n))/100;d.zoomTo(i),d.container.scrollLeft=Math.round(d.view.translate.x*i-Math.max(10,(d.container.clientWidth-e.width*n*i)/2)),d.container.scrollTop=Math.round(d.view.translate.y*i-Math.max(10,(d.container.clientHeight-e.height*n*i)/2))})),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,n=d.pageScale,t=d.container.clientWidth-20,a=Math.floor(100*t/e.width/n)/100;d.zoomTo(a),d.container.scrollLeft=Math.round(d.view.translate.x*a-Math.max(10,(d.container.clientWidth-e.width*n*a)/2)),d.container.scrollTop=Math.round(d.view.translate.y*a-Math.max(10,(d.container.clientHeight-e.height*n*a)/2))})),this.put("customZoom",new Action(mxResources.get("custom"),function(){var e=mxUtils.prompt(mxResources.get("enterValue")+" (%)",parseInt(100*d.getView().getScale()));null!=e&&0<e.length&&!isNaN(parseInt(e))&&d.zoomTo(parseInt(e)/100)}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),l.updateGraphComponents()},null,null,"Ctrl+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("navigation",function(){d.foldingEnabled=!d.foldingEnabled,d.view.revalidate()})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),(e=this.addAction("scrollbars",function(){if(d.scrollbars=!d.scrollbars,l.updateGraphComponents(),d.scrollbars){var e=d.view.translate.x,n=d.view.translate.y;d.view.translate.x=0,d.view.translate.y=0,d.sizeDidChange(),d.container.scrollLeft-=Math.round(e*d.view.scale),d.container.scrollTop-=Math.round(n*d.view.scale)}else{var t=d.view.translate;d.view.setTranslate(t.x-d.container.scrollLeft/d.view.scale,t.y-d.container.scrollTop/d.view.scale),d.container.scrollLeft=0,d.container.scrollTop=0,d.sizeDidChange()}},!mxClient.IS_TOUCH)).setToggleAction(!0),e.setSelectedCallback(function(){return"auto"==d.container.style.overflow}),(e=this.addAction("pageView",mxUtils.bind(this,function(){d.pageVisible=!d.pageVisible,d.pageBreaksVisible=d.pageVisible,d.preferPageSize=d.pageBreaksVisible,d.view.validate(),d.sizeDidChange(),l.updateGraphComponents(),l.outline.update(),mxUtils.hasScrollbars(d.container)&&(d.pageVisible?(d.container.scrollLeft-=20,d.container.scrollTop-=20):(d.container.scrollLeft+=20,d.container.scrollTop+=20))}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connect",function(){d.setConnectable(!d.connectionHandler.isEnabled())},null,null,"Ctrl+Q")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),this.addAction("help",function(){window.open("https://wiki.xcallymotion.com/display/XMV/Cally+Square")}),this.put("about",new Action(mxResources.get("about")+" Cally Square",function(){window.open("http://callysquare.com/")},null,null,null));var t=mxUtils.bind(this,function(e,n){this.addAction(e,function(){d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,n)})});t("bold",mxConstants.FONT_BOLD),t("italic",mxConstants.FONT_ITALIC),t("underline",mxConstants.FONT_UNDERLINE),this.addAction("shadow",function(){d.toggleCellStyles(mxConstants.STYLE_SHADOW)}),this.addAction("dashed",function(){d.toggleCellStyles(mxConstants.STYLE_DASHED)}),this.addAction("rounded",function(){d.toggleCellStyles(mxConstants.STYLE_ROUNDED)}),this.addAction("curved",function(){d.toggleCellStyles(mxConstants.STYLE_CURVED)}),this.addAction("style",function(){var e=d.getSelectionCells();if(null!=e&&0<e.length){var n=d.getModel(),t=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("style")+")",n.getStyle(e[0])||"");null!=t&&d.setCellStyle(t,e)}}),this.addAction("setAsDefaultEdge",function(){d.setDefaultEdge(d.getSelectionCell())}),this.addAction("addWaypoint",function(){var e=d.getSelectionCell();if(null!=e&&d.getModel().isEdge(e)){var n=l.graph.selectionCellsHandler.getHandler(e);if(n instanceof mxEdgeHandler){var t=d.view.translate,a=d.view.scale,i=t.x,s=t.y,o=d.getModel().getParent(e),r=d.getCellGeometry(o);d.getModel().isVertex(o)&&null!=r&&(i+=r.x,s+=r.y),n.addPointAt(n.state,d.panningHandler.triggerX/a-i,d.panningHandler.triggerY/a-s)}}}),this.addAction("removeWaypoint",function(){var e=n.actions.get("removeWaypoint");null!=e.handler&&e.handler.removePoint(e.handler.state,e.index)}),this.addAction("image",function(){var e="",n=d.getView().getState(d.getSelectionCell());if(null!=n&&(e=n.style[mxConstants.STYLE_IMAGE]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("url")+")",e))&&0<e.length){var t=new Image;t.onload=function(){!function(e,n,t){var a=null,i=d.getSelectionCells();d.getModel().beginUpdate();try{if(0==i.length){var s=d.getGridSize();a=i=[d.insertVertex(d.getDefaultParent(),null,"",s,s,n,t)]}if(d.setCellStyles(mxConstants.STYLE_IMAGE,e,i),d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i),1==d.getSelectionCount()&&null!=n&&null!=t){var o=i[0],r=d.getModel().getGeometry(o);null!=r&&((r=r.clone()).width=n,r.height=t,d.getModel().setGeometry(o,r))}}finally{d.getModel().endUpdate()}null!=a&&(d.setSelectionCells(a),d.scrollCellToVisible(a[0]))}(e,t.width,t.height)},t.onerror=function(){mxUtils.alert(mxResources.get("fileNotFound"))},t.src=e}})},Actions.prototype.addAction=function(e,n,t,a,i){return this.put(e,new Action(mxResources.get(e),n,t,a,i))},Actions.prototype.put=function(e,n){return this.actions[e]=n},Actions.prototype.get=function(e){return this.actions[e]},mxUtils.extend(Action,mxEventSource),Action.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.setToggleAction=function(e){this.toggleAction=e},Action.prototype.setSelectedCallback=function(e){this.selectedCallback=e},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(e){this.editorUi=e,this.menus=new Object,this.init(),(new Image).src=IMAGE_PATH+"/checkmark.gif"},Menus.prototype.init=function(){var i=this.editorUi.editor.graph;this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,n){for(var t=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],a=0;a<t.length;a++){this.styleChange(e,t[a],[mxConstants.STYLE_FONTFAMILY],[t[a]],null,n).firstChild.nextSibling.style.fontFamily=t[a]}e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,n)}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(e,n){for(var t=[6,8,9,10,11,12,14,18,24,36,48,72],a=0;a<t.length;a++)this.styleChange(e,t[a],[mxConstants.STYLE_FONTSIZE],[t[a]],null,n);e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"(pt)","12",mxConstants.STYLE_FONTSIZE,n)}))),this.put("linewidth",new Menu(mxUtils.bind(this,function(e,n){for(var t=[1,2,3,4,8,12,16,24],a=0;a<t.length;a++)this.styleChange(e,t[a]+"px",[mxConstants.STYLE_STROKEWIDTH],[t[a]],null,n);e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"(px)","1",mxConstants.STYLE_STROKEWIDTH,n)}))),this.put("line",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("straight"),[mxConstants.STYLE_EDGE],[null],null,n),this.styleChange(e,mxResources.get("entityRelation"),[mxConstants.STYLE_EDGE],["entityRelationEdgeStyle"],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("horizontal"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","horizontal"],null,n),this.styleChange(e,mxResources.get("vertical"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","vertical"],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("manual"),[mxConstants.STYLE_EDGE],["segmentEdgeStyle"],null,n),this.styleChange(e,mxResources.get("automatic"),[mxConstants.STYLE_EDGE],["orthogonalEdgeStyle"],null,n)}))),this.put("lineend",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_CLASSIC],null,n),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OPEN],null,n),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OVAL],null,n),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND],null,n),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND_THIN],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_ENDARROW],[mxConstants.NONE],null,n),e.addSeparator(n),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("endFill",!0)},n,null,!0),e.addSeparator(n),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_ENDSIZE,n)}))),this.put("linestart",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_CLASSIC],null,n),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OPEN],null,n),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OVAL],null,n),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND],null,n),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND_THIN],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_STARTARROW],[mxConstants.NONE],null,n),e.addSeparator(n),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("startFill",!0)},n,null,!0),e.addSeparator(n),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_STARTSIZE,n)}))),this.put("spacing",new Menu(mxUtils.bind(this,function(e,n){var t=this.editorUi.actions.get("shadow").enabled,a=this.get("line").enabled;(t||e.showDisabled)&&(this.promptChange(e,mxResources.get("top"),"(px)","0",mxConstants.STYLE_SPACING_TOP,n,t),this.promptChange(e,mxResources.get("right"),"(px)","0",mxConstants.STYLE_SPACING_RIGHT,n,t),this.promptChange(e,mxResources.get("bottom"),"(px)","0",mxConstants.STYLE_SPACING_BOTTOM,n,t),this.promptChange(e,mxResources.get("left"),"(px)","0",mxConstants.STYLE_SPACING_LEFT,n,t),e.addSeparator(n),this.promptChange(e,mxResources.get("global"),"(px)","0",mxConstants.STYLE_SPACING,n,t),this.promptChange(e,mxResources.get("perimeter"),"(px)","0",mxConstants.STYLE_PERIMETER_SPACING,n,t)),(a||e.showDisabled)&&(e.addSeparator(n),this.promptChange(e,mxResources.get("sourceSpacing"),"(px)","0",mxConstants.STYLE_SOURCE_PERIMETER_SPACING,n,a),this.promptChange(e,mxResources.get("targetSpacing"),"(px)","0",mxConstants.STYLE_TARGET_PERIMETER_SPACING,n,a))}))),this.put("format",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItem(e,"style",n)}))),this.put("text",new Menu(mxUtils.bind(this,function(e,n){var t=this.get("text").enabled;e.addSeparator(n),this.addSubmenu("fontFamily",e,n),this.addSubmenu("fontSize",e,n),this.addMenuItems(e,["-","bold","italic","underline","-"],n),this.addSubmenu("alignment",e,n),this.addMenuItem(e,"wordWrap",n),e.addSeparator(n),this.promptChange(e,mxResources.get("textOpacity"),"(%)","100",mxConstants.STYLE_TEXT_OPACITY,n,t),e.addItem(mxResources.get("hide"),null,function(){i.toggleCellStyles(mxConstants.STYLE_NOLABEL,!1)},n,null,t)}))),this.put("alignment",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("leftAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT],null,n),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER],null,n),this.styleChange(e,mxResources.get("rightAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("topAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP],null,n),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE],null,n),this.styleChange(e,mxResources.get("bottomAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM],null,n),e.addSeparator(n),this.addSubmenu("position",e,n),this.addSubmenu("spacing",e,n),e.addSeparator(n);var t=this.get("text").enabled;e.addItem(mxResources.get("vertical"),null,function(){i.toggleCellStyles(mxConstants.STYLE_HORIZONTAL,!0)},n,null,t)}))),this.put("position",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("left"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_RIGHT],null,n),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_CENTER],null,n),this.styleChange(e,mxResources.get("right"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_LEFT],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("top"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP,mxConstants.ALIGN_BOTTOM],null,n),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_MIDDLE],null,n),this.styleChange(e,mxResources.get("bottom"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_TOP],null,n)}))),this.put("direction",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("flipH"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},n),e.addItem(mxResources.get("flipV"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},n),this.addMenuItems(e,["-","tilt","rotation"],n)}))),this.put("align",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("leftAlign"),null,function(){i.alignCells(mxConstants.ALIGN_LEFT)},n),e.addItem(mxResources.get("center"),null,function(){i.alignCells(mxConstants.ALIGN_CENTER)},n),e.addItem(mxResources.get("rightAlign"),null,function(){i.alignCells(mxConstants.ALIGN_RIGHT)},n),e.addSeparator(n),e.addItem(mxResources.get("topAlign"),null,function(){i.alignCells(mxConstants.ALIGN_TOP)},n),e.addItem(mxResources.get("middle"),null,function(){i.alignCells(mxConstants.ALIGN_MIDDLE)},n),e.addItem(mxResources.get("bottomAlign"),null,function(){i.alignCells(mxConstants.ALIGN_BOTTOM)},n)}))),this.put("layout",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(e,!0,!0)}),n),e.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(e,!0,!0)}),n)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["home","-","exitGroup","enterGroup","-","expand","collapse"],n)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["toFront","toBack","-"],n),this.addSubmenu("layout",e,n),e.addSeparator(n),this.addMenuItems(e,["-","group","ungroup","removeFromGroup"],n)}))),this.put("view",new Menu(mxUtils.bind(this,function(n,t){this.addMenuItems(n,["actualSize"],t),n.addSeparator();for(var e=[.25,.5,.75,1,2,4],a=0;a<e.length;a++)!function(e){n.addItem(100*e+"%",null,function(){i.zoomTo(e)},t)}(e[a]);this.addMenuItems(n,["-","zoomIn","zoomOut","-","fitWindow","customZoom","-","fitPage","fitPageWidth"],t)}))),this.put("file",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["new","open","-","save","saveAs","publish","-","variable","-","import","export","-","editFile","description","-","print"],n)}))),this.put("edit",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","selectVertices","selectEdges","selectAll"])}))),this.put("help",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["help","-","about"])})))},Menus.prototype.put=function(e,n){this.menus[e]=n},Menus.prototype.get=function(e){return this.menus[e]},Menus.prototype.addSubmenu=function(e,n,t){var a=this.get(e).enabled;if(n.showDisabled||a){var i=n.addItem(mxResources.get(e),null,null,t,null,a);this.addMenu(e,n,i)}},Menus.prototype.addMenu=function(e,n,t){var a=this.get(e);null!=a&&(n.showDisabled||a.enabled)&&this.get(e).execute(n,t)},Menus.prototype.styleChange=function(e,n,t,a,i,s){return e.addItem(n,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{for(var n=0;n<t.length;n++)e.setCellStyles(t[n],a[n])}finally{e.getModel().endUpdate()}}),s,i)},Menus.prototype.promptChange=function(e,n,a,i,s,t,o){return e.addItem(n,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,n=i,t=e.getView().getState(e.getSelectionCell());null!=t&&(n=t.style[s]||n),null!=(n=mxUtils.prompt(mxResources.get("enterValue")+(0<a.length?" "+a:""),n))&&0<n.length&&e.setCellStyles(s,n)}),t,null,o)},Menus.prototype.addMenuItem=function(e,n,t){var a=this.editorUi.actions.get(n);if(null==a||!e.showDisabled&&!a.enabled)return null;var i=e.addItem(a.label,null,a.funct,t,null,a.enabled);return a.toggleAction&&a.isSelected()&&this.addCheckmark(i),this.addShortcut(i,a),i},Menus.prototype.addShortcut=function(e,n){if(null!=n.shortcut){var t=e.firstChild.nextSibling.nextSibling,a=document.createElement("span");a.style.color="gray",mxUtils.write(a,n.shortcut),t.appendChild(a)}},Menus.prototype.addCheckmark=function(e){var n=e.firstChild.nextSibling;n.style.backgroundImage="url("+IMAGE_PATH+"/checkmark.gif)",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="2px 50%"},Menus.prototype.addMenuItems=function(e,n,t){for(var a=0;a<n.length;a++)"-"==n[a]?e.addSeparator(t):this.addMenuItem(e,n[a],t)},Menus.prototype.createPopupMenu=function(e,n,t){var a=this.editorUi.editor.graph;if(e.smartSeparators=!0,a.isSelectionEmpty()?this.addMenuItems(e,["undo","redo","-","paste","-"]):(this.addMenuItems(e,["delete","-","cut","copy","-","duplicate"]),1==a.getSelectionCount()&&a.getModel().isEdge(a.getSelectionCell())&&this.addMenuItems(e,["setAsDefaultEdge"]),e.addSeparator()),0<a.getSelectionCount()){if(this.addMenuItems(e,["toFront","toBack","-"]),a.getModel().isEdge(a.getSelectionCell())){var i=!1;if(null!=(n=a.getSelectionCell())&&a.getModel().isEdge(n)){var s=a.selectionCellsHandler.getHandler(n);if(s instanceof mxEdgeHandler&&null!=s.bends&&2<s.bends.length){var o=s.getHandleForEvent(new mxMouseEvent(t)),r=this.editorUi.actions.get("removeWaypoint");r.handler=s,i=0<(r.index=o)&&o<s.bends.length}}this.addMenuItems(e,["-",i?"removeWaypoint":"addWaypoint"])}else 1<a.getSelectionCount()&&(e.addSeparator(),this.addMenuItems(e,["group"]));if(e.addSeparator(),1==a.getSelectionCount())null!=a.getLinkForCell(a.getSelectionCell())&&this.addMenuItems(e,["openLink"])}else this.addMenuItems(e,["-","selectVertices","selectEdges","-","selectAll"])},Menus.prototype.createMenubar=function(e){var n=new Menubar(this.editorUi,e),t=[];t=CRUD_PERMISSIONS.canEdit?["file","edit","view","format","text","arrange","help"]:["file","view","help"];for(var a=0;a<t.length;a++)n.addMenu(mxResources.get(t[a]),this.get(t[a]).funct);return n},Menubar.prototype.hideMenu=function(){null!=this.currentMenu&&this.currentMenu.hideMenu()},Menubar.prototype.addMenu=function(e,n){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.className="geItem",mxUtils.write(t,e),this.addMenuHandler(t,n),this.container.appendChild(t),t},Menubar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Menubar.prototype.addMenuHandler=function(i,s){if(null!=s){var o=!0,n=mxUtils.bind(this,function(e){if(o&&null==i.enabled||i.enabled){this.editorUi.editor.graph.panningHandler.hideMenu();var n=new mxPopupMenu(s);n.div.className+=" geMenubarMenu",n.smartSeparators=!0,n.showDisabled=!0,n.autoExpand=!0,n.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(n,arguments),n.destroy(),this.currentMenu=null,this.currentElt=null});var t=this.getOffset(i).left,a=this.getOffset(i).top+i.offsetHeight;n.popup(t,a,null,e),this.currentMenu=n,this.currentElt=i}o=!0,mxEvent.consume(e)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(e){null!=this.currentMenu&&this.currentElt!=i&&(this.hideMenu(),n(e))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){o=this.currentElt!=i})),mxEvent.addListener(i,"click",n)}},mxUtils.extend(Menu,mxEventSource),Menu.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(e,n){this.funct(e,n)},Toolbar.prototype.init=function(){CRUD_PERMISSIONS.canEdit?this.addItems(["save","publish","-","print","undo","redo","-","copy","cut","paste","delete","-","duplicate","-","actualSize","zoomIn","zoomOut","-"]):this.addItems(["print","actualSize","zoomIn","zoomOut","-"])},Toolbar.prototype.hideMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.currentMenu.destroy(),this.currentMenu=null)},Toolbar.prototype.addMenu=function(e,n,t,a){var i=this.editorUi.menus.get(a),s=this.addMenuFunction(e,n,t,i.funct);return i.addListener("stateChanged",function(){s.setEnabled(i.enabled)}),s},Toolbar.prototype.addMenuFunction=function(e,n,t,a){var i=t?this.createLabel(e):this.createButton(e);return this.initElement(i,n),this.addMenuHandler(i,t,a),this.container.appendChild(i),i},Toolbar.prototype.addSeparator=function(){var e=document.createElement("div");return e.className="geSeparator",this.container.appendChild(e),e},Toolbar.prototype.addItems=function(e){for(var n=0;n<e.length;n++){var t=e[n];"-"==t?this.addSeparator():this.addItem("geSprite-"+t.toLowerCase(),t)}},Toolbar.prototype.addItem=function(e,n){var t=this.editorUi.actions.get(n),a=null;return null!=t&&((a=this.addButton(e,t.label,t.funct)).setEnabled(t.enabled),t.addListener("stateChanged",function(){a.setEnabled(t.enabled)})),a},Toolbar.prototype.addButton=function(e,n,t){var a=this.createButton(e);return this.initElement(a,n),this.addClickHandler(a,t),this.container.appendChild(a),a},Toolbar.prototype.addSelectionHandler=function(t){var a=this.editorUi.editor.graph,e=function(){for(var e=!a.isSelectionEmpty(),n=0;n<t.length;n++)t[n].setEnabled(e)};a.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.addEdgeSelectionHandler=function(a){var i=this.editorUi.editor.graph,e=function(){var e=!1;if(!i.isSelectionEmpty())for(var n=i.getSelectionCells(),t=0;t<n.length;t++)if(i.getModel().isEdge(n[t])){e=!0;break}for(t=0;t<a.length;t++)a[t].setEnabled(e)};i.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.initElement=function(e,n){e.setAttribute("tabindex","0"),null!=n&&e.setAttribute("title",n),this.addEnabledState(e)},Toolbar.prototype.addEnabledState=function(n){var t=n.className;n.setEnabled=function(e){n.enabled=e,n.className=e?t:t+" geDisabled"},n.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(n,t){null!=t&&mxEvent.addListener(n,"click",function(e){n.enabled&&t(e),mxEvent.consume(e)})},Toolbar.prototype.createButton=function(e){var n=document.createElement("a");n.setAttribute("href","javascript:void(0);"),n.className="geButton";var t=document.createElement("div");return t.className="geSprite "+e,n.appendChild(t),n},Toolbar.prototype.createLabel=function(e,n){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.className="geLabel",mxUtils.write(t,e),t},Toolbar.prototype.addMenuHandler=function(n,t,a,i){if(null!=a){var s=this.editorUi.editor.graph,o=null;mxEvent.addListener(n,"click",mxUtils.bind(this,function(e){(null==n.enabled||n.enabled)&&(s.panningHandler.hideMenu(),(o=new mxPopupMenu(a)).div.className+=" geToolbarMenu",o.showDisabled=i,o.labels=t,o.autoExpand=!0,o.popup(n.offsetLeft,n.offsetTop+n.offsetHeight+34,null,e),this.currentMenu=o),mxEvent.consume(e)}))}},Dialog.prototype.close=function(){null!=this.onDialogClose&&(this.onDialogClose(),this.onDialogClose=null),this.container.parentNode.removeChild(this.container),this.bg.parentNode.removeChild(this.bg)},angular.module("motion").run(["$templateCache",function(e){"use strict";e.put("app/auth/services/hotdesk/dialog.html",'<md-dialog aria-label="Telephone">\n  <form ng-cloak>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="LOGIN.TELEPHONES">Telephones</span>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <md-select ng-model="vm.name" placeholder="Select a telephone">\n        <md-option value="{{telephone.name}}" ng-repeat="telephone in vm.telephones.rows">{{telephone.fullname}}</md-option>\n      </md-select>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row">\n      <md-button ng-click="vm.closeDialog(vm.name)" class="send-button md-accent md-raised" aria-label="call" ng-disabled="!vm.name">\n        <span translate="LOGIN.SELECT">SELECT</span>\n      </md-button>\n      \x3c!-- <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n                <span translate="LOGIN.CANCEL">Cancel</span>\n            </md-button> --\x3e\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/core/dialogs/advanced-search/dialog.html",'<md-dialog class="advanced-search-dialog" aria-label="Advanced search" flex="70" ng-init="vm.onInit()">\n  <form ng-cloak>\n    <md-toolbar class="advanced-search-dialog-header" ng-class="{{ \'vm.toolbarColor\' }} + \'-bg\'">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="DASHBOARDS.ADVANCED_SEARCH"></span>\n        </div>\n        <div layout="row" layout-align="end center">\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.minimize()">\n            <md-icon class="no-margin" md-font-icon="icon-window-minimize" aria-label="Minimize dialog"></md-icon>\n          </md-button>\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.close()">\n            <md-icon class="no-margin" md-font-icon="icon-window-close" aria-label="Close dialog"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <ms-advanced-search options="vm.searchOptions" clear-filter="vm.clearConditions()"></ms-advanced-search>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row">\n      <md-button class="md-primary md-raised" aria-label="Clear" ng-disabled="vm.searchOptions.conditions.length === 0" translate="DASHBOARDS.CLEAR" translate-attr-aria-label="DASHBOARDS.CLEAR" ng-click="vm.clearConditions()"></md-button>\n      <md-button class="md-primary md-accent md-raised" aria-label="Apply" ng-disabled="vm.searchOptions.conditions.length === 0" translate="DASHBOARDS.APPLY" translate-attr-aria-label="DASHBOARDS.APPLY" ng-click="vm.applyFilter()"></md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/core/directives/ms-advanced-search/ms-advanced-search.html",'<div layout="column" class="advanced-search-container" flex>\n  <div layout-margin>\n    <md-radio-group ng-model="vm.options.matchType" class="md-primary" layout="row">\n      <md-radio-button value="$and" class="md-primary">{{ \'DASHBOARDS.MEET_ALL_CONDITIONS\' | translate }}\n      </md-radio-button>\n      <md-radio-button value="$or">{{ \'DASHBOARDS.MEET_ANY_CONDITIONS\' | translate }}</md-radio-button>\n    </md-radio-group>\n  </div>\n\n  \x3c!-- ACTIVE CONDITIONS --\x3e\n  <div layout="row" ng-if="vm.options.conditions.length > 0" class="advanced-search-conditions">\n    <md-list>\n      <md-list-item>\n        <md-chips ng-model="vm.options.conditions" class="advanced-search-chips" readonly="true" md-removable="true" md-on-remove="vm.removeCondition()">\n          <md-chip-template ms-chip-color="{{ $chip.style }}">\n            <md-menu md-offset="50 0" ng-class="{\'no-click\': vm.pendingCondition}">\n              <span>\n                <p class="filter-text">{{ $chip.name }}</p>\n                <em ng-show="$chip.operator" class="text-lowercase">{{ $chip.operator }}</em>\n                <strong>{{ $chip.displayValue }}</strong>\n                <em ng-show="$chip.displayEndValue" class="text-lowercase">{{ \'DASHBOARDS.AND\' | translate }}</em>\n                <strong>{{ $chip.displayEndValue }}</strong>\n              </span>\n              <md-menu-content width=2 class="md-dense">\n                <md-menu-item ng-hide="$chip.disabled">\n                  <md-button ng-click="vm.editCondition($chip)">Edit\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.setConditionStatus($chip)">\n                    {{ $chip.disabled ? \'Enable\' : \'Disable\' }}\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </md-chip-template>\n          <button type="button" md-chip-remove class="md-primary remove-filter">\n            <md-icon md-font-icon="icon-cancel" aria-label="Remove Filter"></md-icon>\n          </button>\n        </md-chips>\n      </md-list-item>\n    </md-list>\n  </div>\n\n  \x3c!-- FILTERS --\x3e\n  <div layout="row">\n    <div layout="row" class="advanced-search-bar" layout-margin flex>\n      \x3c!-- FIELD --\x3e\n      <md-input-container flex="35">\n        <md-icon md-font-icon="icon-filter-variant"></md-icon>\n        <md-select class="font-size-12" ng-model="vm.selectedField" ng-change="vm.onFieldChange()" placeholder="{{ \'DASHBOARDS.SELECT_FIELD\' | translate }}" aria-label="Field">\n          <md-option ng-value="field" ng-repeat="field in vm.options.fields">{{ field.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- OPERATOR --\x3e\n      <md-input-container flex="30">\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <md-select class="font-size-12" ng-model="vm.selectedOperator" ng-change="vm.onOperatorChange(oldValue)" ng-focus="oldValue=vm.selectedOperator" md-selected-text="vm.selectedOperator ? (\'DASHBOARDS.\' + vm.selectedOperator.translate | translate) : (\'DASHBOARDS.SELECT_OPERATOR\' | translate)" ng-disabled="!vm.selectedField" aria-label="Operator">\n          <md-option ng-value="operator" ng-repeat="operator in vm.availableOperators" ng-selected="vm.autoSelectOperator">\n            <div layout="row" class="operators-list">\n              <span class="operator-symbol">\n                {{ operator.symbol }}\n              </span>\n              <span>\n                {{ \'DASHBOARDS.\' + operator.translate | translate }}\n              </span>\n            </div>\n          </md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TEXT INPUT --\x3e\n      <md-input-container ng-if="!vm.selectedField.type || vm.selectedField.type === \'text\'" class="no-errors" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <input type="text" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}">\n      </md-input-container>\n      \x3c!-- NUMERIC INPUT --\x3e\n      <div ng-if="vm.selectedField.type === \'number\'" flex layout="row" layout-margin class="no-margin">\n        <md-input-container class="no-errors" flex>\n          <md-icon md-font-icon="icon-numeric"></md-icon>\n          <input type="number" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" min="0" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ vm.selectedOperator.type === \'$between\' ? \'DASHBOARDS.STARTING_VALUE\' : \'DASHBOARDS.VALUE\' | translate }}">\n        </md-input-container>\n        <md-input-container class="no-errors" ng-if="vm.selectedOperator.type === \'$between\'" ng-class="{\'md-input-invalid\': !vm.isValidRange}" flex>\n          <md-icon md-font-icon=" icon-numeric">\n          </md-icon>\n          <input class="md-input" type="number" aria-label="Value" ng-model="vm.endRangeValue" ng-change="vm.checkRange()" ng-disabled="!vm.value" min="vm.value" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.ENDING_VALUE\' | translate }}">\n          <div ng-if="!vm.isValidRange" class="md-input-message-animation md-input-messages-animation">\n            {{ (\'DASHBOARDS.VALUE_RANGE_CHECK\' | translate) + \' \' + vm.value }}\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- SELECT --\x3e\n      <md-input-container ng-if="vm.selectedField.type === \'select\'" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <md-select class="font-size-12" ng-model="vm.value" md-on-open="vm.getValues()" ng-change="vm.onValueChange()" ng-model-options="{trackBy: \'$value.id\'}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}" aria-label="Value">\n          <md-option ng-value="item" ng-repeat="item in vm.selectedField.values">{{item.name}}\n          </md-option>\n        </md-select>\n      </md-input-container>\n      \x3c!-- MULTISELECT --\x3e\n      <md-input-container ng-if="vm.selectedField.type === \'multiselect\'" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <md-select class="font-size-12" multiple ng-model="vm.value" md-on-open="vm.getValues()" ng-change="vm.onValueChange()" ng-model-options="{trackBy: \'$value.id\'}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}" aria-label="Value">\n          <md-option ng-value="item" ng-repeat="item in vm.selectedField.values">{{item.name}}\n          </md-option>\n        </md-select>\n      </md-input-container>\n      \x3c!-- DATE INPUT --\x3e\n      <div ng-if="vm.selectedField.type === \'date\'" flex layout="row">\n        <mdp-date-picker mdp-open-on-click ng-model="vm.value" ng-change="vm.onValueChange()" mdp-max-date="vm.maxDateRange" mdp-placeholder="{{ vm.selectedOperator.type === \'$between\' ? \'DASHBOARDS.STARTING_DATE\' : \'DASHBOARDS.VALUE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n        </mdp-date-picker>\n        <mdp-date-picker mdp-open-on-click ng-if="vm.selectedOperator.type === \'$between\'" ng-change="vm.checkRange()" ng-model="vm.endRangeValue" mdp-min-date="vm.minDateRange" mdp-disabled="!vm.value" mdp-placeholder="{{ \'DASHBOARDS.ENDING_DATE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n        </mdp-date-picker>\n      </div>\n      \x3c!-- AUTOCOMPLETE --\x3e\n      <div layout="row" layout-align="start start" ng-if="vm.selectedField.type === \'autocomplete\' && vm.selectedOperator.type != \'$substring\'" class=" autocomplete-input" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <md-autocomplete md-selected-item="vm.value" md-selected-item-change="vm.onValueChange()" md-items="item in vm.getValues()" md-search-text="vm.searchText" md-item-text="item.displayValue" md-min-length="4" md-no-cache="true" md-floating-label="{{ \'DASHBOARDS.VALUE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n          <md-item-template>\n            <span md-highlight-text="vm.searchText" md-highlight-flags="i">{{item.displayValue}}</span>\n          </md-item-template>\n        </md-autocomplete>\n      </div>\n      <md-input-container ng-if="vm.selectedField.type === \'autocomplete\' && vm.selectedOperator.type === \'$substring\'" class="no-errors" flex>\n        <md-icon md-font-icon="icon-format-text"></md-icon>\n        <input type="text" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}">\n      </md-input-container>\n    </div>\n    <md-button class="md-fab md-mini md-primary mt-20" ng-if="!vm.pendingCondition" ng-disabled="!vm.isValidCondition" aria-label="Add filter" ng-click="vm.addCondition()" translate-attr-aria-label="DASHBOARDS.ADD">\n      <md-icon md-font-icon="icon-plus"></md-icon>\n    </md-button>\n    <md-button class="md-fab md-mini mt-20" ng-if="vm.pendingCondition" ng-disabled="!vm.isValidCondition" aria-label="Update filter" ng-click="vm.updateCondition()" translate-attr-aria-label="DASHBOARDS.UPDATE">\n      <md-icon md-font-icon="icon-check"></md-icon>\n    </md-button>\n    <md-button class="md-fab md-mini md-primary mt-20" ng-if="vm.pendingCondition" aria-label="Cancel filter update" ng-click="vm.cancelUpdateCondition()" translate-attr-aria-label="DASHBOARDS.CANCEL">\n      <md-icon md-font-icon="icon-close"></md-icon>\n    </md-button>\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-1/template-1.html",'<div class="template-1">\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n\n  <div class="content pv-24 ph-16">\n    <div class="title h1" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="subtitle secondary-text" ng-if="card.subtitle">\n      {{card.subtitle}}\n    </div>\n\n    <div class="text pt-16" ng-if="card.text">\n      {{card.text}}\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-10/template-10.html",'<div class="template-10 p-16">\n  <div class="pb-16" layout="row" layout-align="space-between center">\n    <div class="info">\n      <div class="title secondary-text" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle h2" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n    </div>\n\n    <div class="media ml-16">\n      <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n    </div>\n  </div>\n\n  <div class="text">\n    {{card.text}}\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-2/template-2.html",'<div class="template-2">\n  <div class="header p-16" layout="row" layout-align="start center">\n    <div ng-if="card.avatar">\n      <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n    </div>\n\n    <div class="info">\n      <div class="title" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle secondary-text" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n    </div>\n  </div>\n\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n\n  <div class="text p-16" ng-if="card.text">\n    {{card.text}}\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-3/template-3.html",'<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between">\n  <div layout="column" layout-align="space-between">\n    <div class="info">\n      <div class="title h1" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle h3 secondary-text" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n    </div>\n\n    <div class="cta">\n      <md-button class="m-0">{{card.cta}}</md-button>\n    </div>\n  </div>\n\n  <div class="media pl-16">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-4/template-4.html",'<div class="template-4">\n  <div class="info white-fg ph-16 pv-24">\n    <div class="title h1" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="text" ng-if="card.text">\n      {{card.text}}\n    </div>\n  </div>\n\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-5/template-5.html",'<div class="template-5 p-16" layout="row" layout-align="space-between start">\n  <div class="info">\n    <div class="title secondary-text" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="event h2" ng-if="card.event">\n      {{card.event}}\n    </div>\n  </div>\n\n  <div class="media ml-16">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-6/template-6.html",'<div class="template-6">\n  <div class="content pv-24 ph-16">\n    <div class="subtitle secondary-text" ng-if="card.subtitle">\n      {{card.subtitle}}\n    </div>\n\n    <div class="title h2" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="text pt-8" ng-if="card.text">\n      {{card.text}}\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-7/template-7.html",'<div class="template-7" layout="row" layout-align="space-between">\n  <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n    <div class="p-16">\n      <div class="title h1" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle h4 secondary-text" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n\n      <div class="text h4 pt-8" ng-if="card.text">\n        {{card.text}}\n      </div>\n    </div>\n\n    <div>\n      <md-divider></md-divider>\n      <div class="p-8" layout="row">\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n        <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n      </div>\n    </div>\n  </div>\n\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-8/template-8.html",'<div class="template-8">\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n\n  <div class="content pv-24 ph-16">\n    <div class="title h1" ng-if="card.title">\n      {{card.title}}\n    </div>\n\n    <div class="subtitle secondary-text" ng-if="card.subtitle">\n      {{card.subtitle}}\n    </div>\n\n    <div class="buttons pt-16">\n      <md-button class="m-0">{{card.button1}}</md-button>\n      <md-button class="m-0 md-accent">{{card.button2}}</md-button>\n    </div>\n\n    <div class="text pt-16" ng-if="card.text">\n      {{card.text}}\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-9/template-9.html",'<div class="template-9">\n  <div class="header p-16" layout="row" layout-align="start center">\n    <div ng-if="card.avatar">\n      <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n    </div>\n\n    <div class="info">\n      <div class="title" ng-if="card.title">\n        {{card.title}}\n      </div>\n\n      <div class="subtitle secondary-text" ng-if="card.subtitle">\n        {{card.subtitle}}\n      </div>\n\n    </div>\n  </div>\n\n  <div class="text ph-16 pb-16" ng-if="card.text">\n    {{card.text}}\n  </div>\n\n  <div class="media">\n    <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n  </div>\n\n  <div class="buttons m-8">\n    <md-button class="md-icon-button mr-16" aria-label="Favorite">\n      <md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon>\n    </md-button>\n    <md-button class="md-icon-button" aria-label="Share">\n      <md-icon md-font-icon="icon-share" class="s24"></md-icon>\n    </md-button>\n  </div>\n\n</div>'),e.put("app/core/directives/ms-click-to-call/ms-click-to-call.html",'<section ng-if="type !== \'button\'">\n  <span ng-if="!showMenu()" privacy="{{ privacy }}" ng-cloak>{{target}}</span>\n  <md-menu ng-if="showMenu()">\n    <a aria-label="Target" ng-click="$mdOpenMenu($event)">\n      <span ng-if="prefix" privacy="{{ privacy }}" ng-cloak>{{prefix}}-</span>\n      <span privacy="{{ privacy }}" ng-cloak>{{target}}</span>\n    </a>\n    <md-menu-content width="2">\n      <md-menu-item>\n        <md-button ng-click="call(prefix ? prefix + target : target)">\n          {{\'DASHBOARDS.CALL_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n        </md-button>\n      </md-menu-item>\n      <md-menu-item>\n        <md-button ng-click="transfer(prefix ? prefix + target : target)">\n          {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n        </md-button>\n      </md-menu-item>\n    </md-menu-content>\n  </md-menu>\n</section>\n<section ng-if="type === \'button\'">\n  <md-button ng-if="!showMenu()" ng-disabled="true" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" aria-label="NEW CALL">\n    <md-icon md-font-icon="icon-phone"></md-icon>\n  </md-button>\n  <md-menu ng-if="showMenu()">\n    <md-button class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" ng-click="$mdOpenMenu($event)" aria-label="NEW CALL">\n      <md-icon md-font-icon="icon-phone"></md-icon>\n    </md-button>\n    <md-menu-content width="2">\n      <md-menu-item>\n        <md-button ng-click="call(prefix ? prefix + target : target)">\n          {{\'DASHBOARDS.CALL_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n        </md-button>\n      </md-menu-item>\n      <md-menu-item>\n        <md-button ng-click="transfer(target)">\n          {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n        </md-button>\n      </md-menu-item>\n    </md-menu-content>\n  </md-menu>\n</section>'),e.put("app/core/directives/ms-client-side-logging/ms-client-side-logging-icon.html",'<md-icon ng-style="vm.styleColor" md-font-icon="{{ vm.styleIcon }}">\n  <md-tooltip class="client-side-logging-tooltip">\n    <span ng-bind-html="vm.tooltipHTML"></span>\n  </md-tooltip>\n</md-icon>'),e.put("app/core/directives/ms-client-side-logging/ms-client-side-logging.html",'<md-content layout="column">\n  <form name="clientSideLoggingSettingsForm">\n    <div flex layout="column" layout-align="stretch center">\n      <div ng-if="vm.user.userSetting.clientSideLoggingEnabled" class="md-amber-500-bg p-10" layout="row" layout-align="start center">\n        <span class="no-margin font-size-14 line-height-30" translate="STAFF.CLIENT_LOGS_ALL_ENABLED_WARNING" flex></span>\n      </div>\n      <md-input-container>\n        <md-switch ng-model="vm.user.userSetting.clientSideLoggingEnabled" aria-label="Manage client side logging" ng-change="vm.onEnabledSwitchChange()">\n          {{ vm.user.userSetting.clientSideLoggingEnabled ? \'STAFF.CLIENT_LOGS_ENABLED\' : \'STAFF.CLIENT_LOGS_DISABLED\' | translate }}\n        </md-switch>\n      </md-input-container>\n      <h2 ng-if="vm.user.userSetting.clientSideLoggingEnabled" class="md-subhead mt-0">{{ vm.clientSideLoggingEnabledSince }}</h2>\n    </div>\n    <div layout="column" layout-align="stretch center">\n      <md-input-container ng-if="vm.user.userSetting.clientSideLoggingEnabled">\n        <label>{{ \'STAFF.CLIENT_LOGS_LOGLEVEL_SELECT\' | translate }}</label>\n        <md-select ng-if="vm.user.userSetting.clientSideLoggingEnabled" ng-model="vm.user.userSetting.clientSideLoggingLevel" placeholder="Debugging level" ng-change="vm.onLogLevelSelectionChange()" flex="30">\n          <md-option ng-value="loggingLevel" ng-repeat="loggingLevel in vm.availableClientSideLoggingLevels">\n            <md-icon ng-style="vm.computeStyleForLoggingLevel(loggingLevel)" md-font-icon="{{ loggingLevel === \'info\' ? \'icon-checkbox-blank-circle-outline\' : \'icon-checkbox-blank-circle\' }}"></md-icon>\n            {{ loggingLevel }}\n          </md-option>\n        </md-select>\n      </md-input-container>\n    </div>\n  </form>\n</md-content>'),e.put("app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html",'<div ng-cloak layout-gt-sm="row" layout="column">\n  <div flex-gt-sm="50" flex="45">\n    <md-input-container class="md-icon-float md-block margin-0">\n      <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n      <input ng-model="query" type="text" placeholder="{{ \'STAFF.PERMISSIONS_PLACEHOLDER_SEARCH\' | translate }}">\n    </md-input-container>\n    <md-content class="border h-300">\n      <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n        <md-list-item class="md-3-line" ng-class="{\'read-only-mode\': vm.readOnly || vm.addDisabled}" ng-disabled="vm.readOnly || vm.addDisabled" ng-repeat="item in availableItems = (vm.options.items | filter: query) | orderBy: vm.options.orderBy" ng-click="vm.canTransfer(item, vm.options, false)">\n          <div class="md-list-item-text" layout="column">\n            <h3 ng-if="vm.options.line1">{{vm.getLine(item, vm.options.line1)}}</h3>\n            <h4 ng-if="vm.options.line2">{{vm.getLine(item, vm.options.line2)}}</h4>\n            <p ng-if="vm.options.line3">{{vm.getLine(item, vm.options.line3)}}</p>\n            <p class="ms-dual-multiselect-line-xs" ng-if="vm.options.line4">{{vm.getLine(item, vm.options.line4)}}\n            </p>\n          </div>\n          <md-icon ng-hide="vm.readOnly && !vm.addDisabled" ng-class="{\'add-disabled\': vm.addDisabled}" md-font-icon="icon-arrow-right-bold" aria-label="swap">\n          </md-icon>\n          <md-divider></md-divider>\n        </md-list-item>\n      </md-list>\n    </md-content>\n    <div class="margin-10" layout="row">\n      <span class="h4" flex>{{vm.options.labelAll || \'All Items\'}} ({{availableItems.length}})</span>\n      <md-icon ng-hide="vm.options.showSelectAndDeselectAll === false || vm.readOnly" ng-class="{\'add-disabled\': vm.addDisabled}" ng-disabled="vm.addDisabled" md-font-icon="icon-chevron-double-right" aria-label="swap" ng-click="vm.transfer(vm.options.items, vm.options.selectedItems, -1, false)"></md-icon>\n    </div>\n  </div>\n\n  <div flex="10" layout="row" layout-align="center center">\n    <md-icon md-font-icon="icon-swap-horizontal" aria-label="swap"></md-icon>\n  </div>\n\n  <div flex-gt-sm="50" flex="45">\n    <md-input-container class="md-icon-float md-block margin-0">\n      <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n      <input ng-model="selectedQuery" type="text" placeholder="{{ \'STAFF.PERMISSIONS_PLACEHOLDER_SEARCH\' | translate }}">\n    </md-input-container>\n    <md-content class="border h-300">\n      <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n        <md-list-item class="md-3-line" ng-class="{\'read-only-mode\': vm.readOnly || !item.isValid}" ng-disabled="vm.readOnly" ng-repeat="item in associatedItems = (vm.options.selectedItems | filter: selectedQuery) | orderBy: vm.options.orderBy" ng-click="vm.canTransfer(item, vm.options, true)">\n          <md-icon ng-class="{\'hidden\': vm.readOnly || !item.isValid}" md-font-icon="icon-arrow-left-bold" aria-label="swap"></md-icon>\n          <div class="md-list-item-text" layout="column">\n            <h3 ng-if="vm.options.line1">{{vm.getLine(item, vm.options.line1)}}</h3>\n            <h4 ng-if="vm.options.line2">{{vm.getLine(item, vm.options.line2)}}</h4>\n            <p ng-if="vm.options.line3">{{vm.getLine(item, vm.options.line3)}}</p>\n            <p class="ms-dual-multiselect-line-xs" ng-if="vm.options.line4">{{vm.getLine(item, vm.options.line4)}}\n            </p>\n          </div>\n          <md-divider></md-divider>\n        </md-list-item>\n      </md-list>\n    </md-content>\n    <div class="margin-10" layout="row">\n      <md-icon ng-hide="vm.options.showSelectAndDeselectAll === false || vm.readOnly" md-font-icon="icon-chevron-double-left" aria-label="swap" ng-click="vm.transfer(vm.options.selectedItems, vm.options.items, -1, true)"></md-icon>\n      <span class="h4 text-right" flex>{{vm.options.labelSelected || \'Selected Items\'}}\n        ({{associatedItems.length}})</span>\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-font-family/ms-font-family.html",'<md-select ng-model="ngModel" class="no-margin">\n  <md-option ng-repeat="font in fonts" ng-value="font.value"><span ng-style="{\'font-family\': font.value}">{{font.option}}</span>\n  </md-option>\n</md-select>'),e.put("app/core/directives/ms-info-bar/ms-info-bar.html",'<div id="ms-info-bar" layout="row" layout-align="start center" flex>\n  <div id="ms-info-bar-message" ng-transclude flex></div>\n  <md-button id="ms-info-bar-close" class="md-icon-button" aria-label="Close" ng-click="removeInfoBar()">\n    <md-icon md-font-icon="icon-close s20"></md-icon>\n  </md-button>\n</div>'),e.put("app/core/directives/ms-material-color-picker/ms-material-color-picker.html",'<md-menu md-position-mode="target-right target">\n\n  <div ng-click="$mdOpenMenu($event)">\n    <ms-color-picker-button>\n      <md-button aria-label="Row Color" md-menu-origin ng-click="$mdOpenMenu($event)" ng-class="vm.selectedColor.class">\n\n        <span ng-show="vm.selectedColor.palette">\n          {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n        </span>\n        <span ng-show="!vm.selectedColor.palette">\n          Select Color\n        </span>\n      </md-button>\n    </ms-color-picker-button>\n  </div>\n\n  <md-menu-content class="ms-material-color-picker-menu-content" layout-column>\n\n    <header ng-class="vm.selectedColor.class || \'md-accent-bg\'" class="md-whiteframe-4dp" layout="row" layout-align="space-between center">\n      <md-button md-prevent-menu-close ng-click="vm.activateHueSelection(false,false)" class="md-icon-button" ng-class="{\'hidden\':!vm.selectedPalette}" aria-label="Palette">\n        <md-icon md-font-icon="icon-arrow-left" class="s20"></md-icon>\n      </md-button>\n\n      <span ng-if="vm.selectedColor.palette">\n        {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n      </span>\n\n      <span ng-if="!vm.selectedColor.palette">\n        Select Color\n      </span>\n\n      <md-button class="remove-color-button md-icon-button" ng-click="vm.removeColor()" aria-label="Remove Color">\n        <md-icon md-font-icon="icon-delete" class="s20"></md-icon>\n      </md-button>\n    </header>\n\n    <div class="colors">\n      <div ng-show="!vm.selectedPalette" layout="row" layout-wrap>\n        <div class="color" ng-class="\'md-\'+palette+\'-500-bg\'" ng-repeat="(palette, hues) in vm.palettes" ng-click="vm.activateHueSelection(palette,hues)" layout="row" layout-align="start end" md-prevent-menu-close md-ink-ripple>\n          <span class="label">\n            {{palette}}\n          </span>\n        </div>\n      </div>\n\n      <div ng-show="vm.selectedPalette" layout="row" layout-wrap>\n        <div class="color" ng-class="\'md-\'+vm.selectedPalette+\'-\'+hue+\'-bg\'" ng-repeat="(hue, values) in vm.selectedHues" ng-click="vm.selectColor(vm.selectedPalette,hue)" layout="row" layout-align="start end" md-ink-ripple>\n          <span class="label">\n            {{hue}}\n          </span>\n          <i ng-if="vm.selectedPalette == vm.selectedColor.palette && hue == vm.selectedColor.hue" class="s16 icon-check">\n          </i>\n        </div>\n      </div>\n\n    </div>\n\n  </md-menu-content>\n</md-menu>'),e.put("app/core/directives/ms-navigation/templates/horizontal.html",'<div class="navigation-toggle" hide-gt-sm>\n  <md-button class="md-icon-button" ng-click="vm.toggleHorizontalMobileMenu()" aria-label="Toggle Mobile Navigation">\n    <md-icon md-font-icon="icon-menu"></md-icon>\n  </md-button>\n</div>\n\n<ul class="horizontal">\n  <li ng-repeat="node in vm.navigation" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested horizontal navigation template --\x3e\n<script type="text/ng-template" id="navigation-horizontal-nested.html">\n\n  <div ms-navigation-horizontal-item layout="row" ng-if="!vm.isHidden()">\n\n        <div class="ms-navigation-horizontal-button" ng-if="!node.uisref && node.title"\n             ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}">\n            <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n            <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n            <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n            <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n        </div>\n\n        <a class="ms-navigation-horizontal-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg"\n           ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}"\n           ng-if="node.uisref && node.title">\n            <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n            <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n            <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n            <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n        </a>\n\n    </div>\n\n    <ul ng-if="vm.hasChildren && !vm.isHidden()">\n        <li ng-repeat="node in node.children" ms-navigation-horizontal-node="node"\n            ng-class="{\'has-children\': vm.hasChildren}"\n            ng-include="\'navigation-horizontal-nested.html\'"></li>\n    </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("app/core/directives/ms-navigation/templates/vertical.html",'<ul>\n  <li ng-repeat="node in vm.navigation" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested navigation template --\x3e\n<script type="text/ng-template" id="navigation-nested.html">\n\n  <div id="{{ node.id }}" ms-navigation-item layout="row" ng-if="!vm.isHidden()">\n\n        <div class="ms-navigation-button" ng-if="!node.uisref && node.title">\n            <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n            <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n            <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n            <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n        </div>\n\n        <a class="ms-navigation-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-if="node.uisref && node.title">\n            <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n            <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n            <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n            <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n        </a>\n\n    </div>\n\n    <ul ng-if="vm.hasChildren && !vm.isHidden()">\n        <li ng-repeat="node in node.children" ms-navigation-node="node"\n            ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}"\n            ng-include="\'navigation-nested.html\'"></li>\n    </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-dialpad.html",'\x3c!-- Dialpad --\x3e\n<md-content ng-if="vm_pb.showDialpad" class="num-pad" layout="column">\n  <section layout="row" layout-align="start center">\n    <span><img class="num-pad-logo" layout-padding src="/api/settings/1/logo" alt="logo" /></span>\n    <span class="md-subhead">Dialpad</span>\n    <div layout="row" layout-align="end center" flex>\n      <md-button class="md-icon-button" ng-click="vm_pb.closeDialpad()">\n        <md-icon md-font-icon="icon-close"></md-icon>\n      </md-button>\n    </div>\n  </section>\n  <md-divider></md-divider>\n  <section layout="row">\n    <div class="span4" ng-repeat="item in ::[{n: 1, l: []}, {n: 2, l: [\'a\', \'b\', \'c\']}, {n: 3, l: [\'d\', \'e\', \'f\']}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num">\n        <div class="txt">\n          {{item.n}} <span class="small">\n            <p>\n              <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n            </p>\n          </span>\n        </div>\n      </div>\n    </div>\n  </section>\n  <section layout="row">\n    <div class="span4" ng-repeat="item in ::[{n: 4, l: [\'g\', \'h\', \'i\']}, {n: 5, l: [\'j\', \'k\', \'l\']}, {n: 6, l: [\'m\', \'n\', \'o\']}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num">\n        <div class="txt">\n          {{item.n}} <span class="small">\n            <p>\n              <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n            </p>\n          </span>\n        </div>\n      </div>\n    </div>\n  </section>\n  <section layout="row">\n    <div class="span4" ng-repeat="item in ::[{n: 7, l: [\'p\', \'q\', \'r\', \'s\']}, {n: 8, l: [\'t\', \'u\', \'v\']}, {n: 9, l: [\'w\', \'x\', \'y\', \'z\']}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num">\n        <div class="txt">\n          {{item.n}} <span class="small">\n            <p>\n              <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n            </p>\n          </span>\n        </div>\n      </div>\n    </div>\n  </section>\n  <section layout="row">\n    <div class="span4" ng-repeat="item in ::[{n: \'*\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num" layout="column" layout-align="center center">\n        <div class="txt" layout="column" layout-align="center center">\n          {{item.n}}\n        </div>\n      </div>\n    </div>\n    <div class="span4" ng-repeat="item in ::[{n: 0, l: [\'+\']}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num">\n        <div class="txt">\n          {{item.n}} <span class="small">\n            <p>\n              <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n            </p>\n          </span>\n        </div>\n      </div>\n    </div>\n    <div class="span4" ng-repeat="item in ::[{n: \'#\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n      <div class="num" layout="column" layout-align="center center">\n        <div class="txt" layout="column" layout-align="center center">\n          {{item.n}}\n        </div>\n      </div>\n    </div>\n  </section>\n</md-content>\n\x3c!-- Dialpad --\x3e\n\n\x3c!-- Input&Media Area --\x3e\n<div layout="row" layout-align="start center">\n  <div layout="row" layout-align="center center">\n    \x3c!-- START Ringing Tone--\x3e\n    <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Ringing" ng-click="vm_pb.conf.ringingMute = !vm_pb.conf.ringingMute; vm_pb.initDevice(\'ringing\', true)" ng-disabled="!vm_pb.registered">\n      <md-icon md-font-icon="{{vm_pb.conf.ringingMute ? \'icon-bell-off\' : \'icon-bell-ring\'}}" class="icon s14" ng-class="vm_pb.conf.ringingMute ? \'red-fg\' : \'grey-fg\'">\n        <md-tooltip><span translate="TOOLBAR.RINGING">Ringing</span></md-tooltip>\n      </md-icon>\n    </md-button>\n    \x3c!-- END Ringing Tone --\x3e\n\n    \x3c!-- START Speaker --\x3e\n    <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Speaker" ng-click="vm_pb.conf.speakerMute = !vm_pb.conf.speakerMute; vm_pb.initDevice(\'speaker\', true)" ng-disabled="!vm_pb.registered">\n      <md-icon md-font-icon="{{vm_pb.conf.speakerMute ? \'icon-volume-off\' : \'icon-volume\'}}" class="icon s14" ng-class="vm_pb.conf.speakerMute ? \'red-fg\' : \'grey-fg\'">\n        <md-tooltip><span translate="TOOLBAR.SPEAKER">Speaker</span></md-tooltip>\n      </md-icon>\n    </md-button>\n    \x3c!-- END Speaker --\x3e\n\n    \x3c!-- START Microphone --\x3e\n    <md-button ng-disabled="(!vm_pb.registered || vm_pb.sessions.length==0)?true:false" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Microphone" ng-click="vm_pb.conf.microphoneMute = !vm_pb.conf.microphoneMute; vm_pb.initDevice(\'microphone\', true)">\n      <md-icon md-font-icon="{{vm_pb.conf.microphoneMute ? \'icon-microphone-off\' : \'icon-microphone\'}}" class="icon s14" ng-class="vm_pb.conf.microphoneMute ? \'red-fg\' : \'grey-fg\'">\n        <md-tooltip><span translate="TOOLBAR.MICROPHONE">Microphone</span></md-tooltip>\n      </md-icon>\n    </md-button>\n    \x3c!-- END Microphone --\x3e\n\n    \x3c!-- START Registered --\x3e\n    <span>\n      <span class="quantity-indicator md-red-500-bg" ng-class="vm_pb.registered ? \'md-green-500-bg\' : \'md-red-500-bg\'"></span>\n      <md-tooltip><span>{{vm_pb.conf.license ? (vm_pb.registered ? \'TOOLBAR.REGISTERED\' : \'TOOLBAR.NOT_REGISTERED\') : \'TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD\' | translate}}\n          <timer ng-if="vm_pb.registered"></timer>\n        </span>\n      </md-tooltip>\n    </span>\n    \x3c!-- END Registered --\x3e\n  </div>\n  <div layout="column" layout-align="center start">\n    <div layout="row" layout-align="start center">\n      \x3c!-- START Target --\x3e\n      <angucomplete-alt id="ms-target-wrap" pause="10" local-data="vm_pb.calls" search-fields="target" title-field="target" minlength="0" input-class="input-number" disable-input="!vm_pb.registered" match-class="highlight" template-url="assets/ms-phonebar/ms-phonebar-input.html" input-changed="vm_pb.targetChanged" selected-object="vm_pb.targetSelected" clear-selected="true" ng-keypress="vm_pb.typeWrapper($event)" focus-first="true" disable-autocomplete="vm_pb.currentUser.privacyEnabled"></angucomplete-alt>\n      \x3c!-- END Target --\x3e\n\n      \x3c!-- Auto Answer --\x3e\n      <div ng-if="vm_pb.conf.autoAnswer" class="red-fg" style="padding-left: 10px;">\n        <span class="font-size-20">A<span class="font-size-16">A</span></span>\n      </div>\n      \x3c!-- Auto Answer --\x3e\n\n      <md-button class="md-fab md-mini white-bg width-30 height-30" aria-label="Dialpad" ng-click="vm_pb.toggleDialpad()" ng-disabled="!vm_pb.registered">\n        <md-icon md-font-icon="icon-apps" class="icon grey-fg s16"></md-icon>\n      </md-button>\n      <md-button ng-if="vm_pb.target" class="md-fab md-mini white-bg width-25 height-25" aria-label="Call" style="margin-left: 0px;" ng-click="vm_pb.call()">\n        <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n      </md-button>\n    </div>\n  </div>\n</div>\n\x3c!-- Input&Media Area --\x3e\n\n\x3c!-- START 3WC --\x3e\n<md-button ng-if="vm_pb.canGoInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="3Way" ng-click="vm_pb.start3WayConf();  $event.stopPropagation();">\n  <md-icon md-font-icon="icon-account-multiple-plus" class="icon orange-fg s14"></md-icon>\n  <md-tooltip><span translate="TOOLBAR.CONFERENCE">Conference</span></md-tooltip>\n</md-button>\n\x3c!-- END 3Way --\x3e\n\n\n<div class="toolbar-separator"></div>\n\n\x3c!-- Sessions Area --\x3e\n<div class="sessions" layout="row" layout-align="start center" flex>\n  <div layout="row" layout-align="center center" ng-if="!vm_pb.conf.license">\n    <md-icon md-font-icon="icon-account-alert" class="icon s36 red-fg"></md-icon>\n    <span layout-margin translate="TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"></span>\n  </div>\n\n  <div id="{{\'div_session_\'+session.id.substr(0,32)}}" ng-repeat="session in vm_pb.sessions" class="session" layout="row" ng-click="(vm_pb.sessions.length > 1) && vm_pb.selectSession(session)">\n    <md-button ng-if="vm_pb.conf.recording && session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Record" ng-click="vm_pb.record(session); $event.stopPropagation();">\n      <md-icon md-font-icon="icon-radiobox-marked" class="icon s14" ng-class="session.monitor ? \'red-fg\' : \'grey-fg\'"></md-icon>\n    </md-button>\n    <div layout="column" layout-align="center start">\n      <span class="session-info">\n        <span ng-if="session.user == session.name" privacy ng-cloak>{{session.user}}</span>\n        <span ng-if="session.user != session.name" privacy ng-cloak>{{session.name}}</span> <span ng-if="session.user != session.name" privacy ng-cloak>{{session.user}}</span>\n      </span>\n      <span class="session-info" layout="row" layout="start center">\n        <timer></timer>\n      </span>\n    </div>\n\n    \x3c!-- START Answer --\x3e\n    <md-button ng-if="session.incoming && !session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Anser" ng-click="vm_pb.answer(session); $event.stopPropagation();">\n      <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END Answer --\x3e\n\n    \x3c!-- START Hangup --\x3e\n    <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Terminate" ng-click="vm_pb.terminate(session); $event.stopPropagation();">\n      <md-icon md-font-icon="icon-phone-hangup" class="icon red-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END Hangup --\x3e\n\n    \x3c!-- START Hold/Unhold --\x3e\n    <md-button ng-if="session.confirmed && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="(session.localHold ? vm_pb.unhold(session) : vm_pb.hold(session)); $event.stopPropagation();">\n      <md-icon md-font-icon="{{session.localHold ? \'icon-play\' : \'icon-pause\'}}" class="icon grey-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END Hold/Unhold --\x3e\n\n    \x3c!-- START Transfer --\x3e\n    <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length == 1 && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer" ng-click="vm_pb.refer(session);  $event.stopPropagation();">\n      <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END transfer --\x3e\n\n    \x3c!-- START Attended Transfer --\x3e\n    <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length>1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer Attended" ng-click="vm_pb.referAttended(session);  $event.stopPropagation();">\n      <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n    </md-button>\n    \x3c!-- END Attended Transfer --\x3e\n  </div>\n</div>\n\x3c!-- Sessions Area --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-input.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">\n  <input id="ms-target" ng-model="searchStr" ng-disabled="disableInput" type="text" placeholder="{{placeholder}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)" />\n  <div class="angucomplete-dropdown" ng-show="showDropdown && !(!searching && (!results || results.length == 0))">\n    <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">\n      <div layout="row" layout-align="start center">\n        <md-icon md-font-icon="{{result.originalObject.inbound ? \'icon-arrow-bottom-left\' : \'icon-arrow-top-right\'}}" class="icon no-margin s22"></md-icon>\n        <span style="margin-left: 8px;">({{result.originalObject.time}}) - <span class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title" privacy ng-cloak></span></span>\n      </div>\n    </div>\n  </div>\n</div>'),e.put("assets/ms-phonebar/ms-phonebar.html",'<div layout="row" layout-align="start center" flex>\n  \x3c!-- Audio stream --\x3e\n  <audio id="local-audio" autoplay hidden=true></audio>\n  <audio id="remote-audio" autoplay hidden=true></audio>\n  \x3c!-- Audio stream --\x3e\n\n  \x3c!-- WebRtc PhoneBar --\x3e\n  <div class="phonebar-container" ng-include="\'assets/ms-phonebar/ms-phonebar-dialpad.html\'" layout="row" layout-align="start center" flex></div>\n  \x3c!-- WebRtc PhoneBar --\x3e\n</div>'),e.put("assets/ms-phonebar/prefix/dialog.html",'<md-dialog aria-label="Prefix">\n  <form ng-cloak ng-keypress="vm.keyPress($event)">\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="TOOLBAR.PREFIXES">Prefixes</span>\n        </div>\n        <div layout="row" layout-align="end center">\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog(-1)">\n            <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <md-radio-group ng-model="vm.prefix">\n        <md-radio-button ng-repeat="prefix in vm.prefixes.rows" value="{{prefix.prefix}}" class="md-primary">{{prefix.name}}</md-radio-button>\n        <md-radio-button ng-if="!vm.required" ng-value="null" class="md-primary">no prefix</md-radio-button>\n      </md-radio-group>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row">\n      <md-button ng-click="vm.call()" class="send-button md-accent md-raised" aria-label="call" md-autofocus ng-disabled="!vm.prefix && vm.required">\n        <span translate="TOOLBAR.CALL">CALL</span>\n      </md-button>\n      <md-button ng-click="vm.closeDialog(-1)" class="send-button md-accent md-raised" aria-label="cancel">\n        <span translate="TOOLBAR.CANCEL">Cancel</span>\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("assets/ms-phonebar/record/dialog.html",'<md-dialog aria-label="Recording" ng-init="vm.onInit()">\n  <form ng-cloak>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="TOOLBAR.RECORDING">Recording</span>\n        </div>\n        <div layout="row" layout-align="end center">\n          <md-button class="md-icon-button no-margin no-padding">\n            <md-icon class="no-margin" md-font-icon="icon-plus" aria-label="Add" ng-click="vm.addRecording()"></md-icon>\n          </md-button>\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n            <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-table-container>\n      <table md-table layout-padding>\n        <thead md-head>\n          <tr md-row>\n            <th md-column><span translate="TOOLBAR.FILENAME">File name</span></th>\n            <th md-column><span translate="TOOLBAR.STATUS">Status</span></th>\n            <th md-column><span translate="TOOLBAR.ACTIONS">Actions</span></th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm.session.monitors.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="TOOLBAR.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="monitor in vm.session.monitors">\n            <td md-cell>{{monitor.filename}}</td>\n            <td md-cell class="no-padding">\n              <md-icon md-font-icon="icon-radiobox-marked" class="icon s16" ng-class="(monitor.status == \'rec\') ? \'red-fg ms-blink\' : \'grey-fg\'"></md-icon>\n            </td>\n            <td md-cell class="no-padding">\n              <md-button class="md-fab md-mini white-bg width-35 height-35 margin-5" aria-label="Record" ng-click="(monitor.status == \'rec\') ? vm.stop(monitor) : vm.start(monitor)">\n'+"                <md-icon md-font-icon=\"{{monitor.status == 'rec' ? 'icon-stop' : 'icon-play'}}\" class=\"icon s16\" ng-class=\"monitor.status == 'rec' ? 'grey-fg' : 'red-fg'\"></md-icon>\n              </md-button>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n  </form>\n</md-dialog>"),e.put("assets/ms-phonebar/referAttended/dialog.html",'<md-dialog aria-label="Transfer">\n  <form ng-cloak>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div flex>\n          <span class="title" translate="TOOLBAR.ATTENDED_TRANSFER">Transfer</span>\n        </div>\n        <div layout="row" layout-align="end center">\n          <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n            <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <label translate="TOOLBAR.TARGET">Target</label>\n      <md-input-container class="md-block">\n        <md-select ng-model="vm.target">\n          <md-option ng-repeat="session in vm.sessions" ng-value="session.user">\n            {{ session.name }}\n          </md-option>\n        </md-select>\n      </md-input-container>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row">\n      <md-button ng-click="vm.transfer()" class="send-button md-accent md-raised" aria-label="transfer" ng-disabled="!vm.target && !vm.sessionId">\n        <span translate="TOOLBAR.TRANSFER">TRANSFER</span>\n      </md-button>\n      <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n        <span translate="TOOLBAR.CANCEL">Cancel</span>\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("assets/ms-phonebar/settings/settings.html",'<md-dialog class="md-phonebar-dialog" aria-label="{{vm.name}}">\n  <form name="settingsForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="TOOLBAR.SETTINGS">Settings</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content class="no-padding">\n      <md-tabs md-no-pagination md-stretch-tabs="always">\n        <md-tab label="{{ \'TOOLBAR.PROFILE\' | translate}}">\n          <md-content layout-padding layout="column">\n            <span><span translate="TOOLBAR.FULLNAME">Fullname</span>: {{vm.conf.fullname}}</span>\n            <span><span translate="TOOLBAR.NAME">Name</span>: {{vm.conf.name}}</span>\n            <span><span translate="TOOLBAR.INTERNAL">Internal</span>: {{vm.conf.internal}}</span>\n            <span><span translate="TOOLBAR.BROWSER">Browser</span>: {{vm.conf.browserName}} {{vm.conf.browserVersion}}</span>\n            <span><span translate="TOOLBAR.OS">OS</span>: {{vm.conf.osName}} {{vm.conf.osVersion}}</span>\n          </md-content>\n        </md-tab>\n        <md-tab label="{{ \'TOOLBAR.SERVICES\' | translate}}">\n          <md-content layout-padding>\n            <md-input-container class="md-block">\n              <md-switch ng-model="vm.conf.autoAnswer" aria-label="Auto Answer">\n                <span translate="TOOLBAR.AUTOANSWER">Auto Answer</span>\n                <span>{{ vm.conf.autoAnswerDelay }} [s]</span>\n              </md-switch>\n            </md-input-container>\n          </md-content>\n        </md-tab>\n        <md-tab label="{{ \'TOOLBAR.AUDIO\' | translate}}">\n          <md-content layout-padding>\n            <div class="border brad-5" layout-margin>\n              <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n                <label translate="TOOLBAR.RINGINGDEVICE">Ringing Device</label>\n                <md-select name="ringingDevice" ng-model="vm.conf.ringingId" required>\n                  <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n                </md-select>\n                <div ng-messages="settingsForm[\'ringingDevice\'].$error" ng-show="settingsForm[\'ringingDevice\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <div layout="row" layout-align="space-between center">\n                <md-switch ng-model="vm.conf.ringingMute" aria-label="Mute">\n                  Mute\n                </md-switch>\n\n                <md-slider-container flex="80">\n                  <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.ringingVolume" aria-label="volume"></md-slider>\n                </md-slider-container>\n              </div>\n            </div>\n\n            <div class="border brad-5" layout-margin>\n              <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n                <label translate="TOOLBAR.SPEAKERDEVICE">Speaker Device</label>\n                <md-select name="speakerDevice" ng-model="vm.conf.speakerId" required>\n                  <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n                </md-select>\n                <div ng-messages="settingsForm[\'speakerDevice\'].$error" ng-show="settingsForm[\'speakerDevice\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <div layout="row" layout-align="space-between cetner">\n                <md-switch ng-model="vm.conf.speakerMute" aria-label="Mute">\n                  Mute\n                </md-switch>\n\n                <md-slider-container flex="80">\n                  <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.speakerVolume" aria-label="volume"></md-slider>\n                </md-slider-container>\n              </div>\n            </div>\n\n            <div class="border brad-5" layout-margin>\n              <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audioinput\' }).length">\n                <label translate="TOOLBAR.MICROPHONEDEVICE">Microphone Device</label>\n                <md-select name="microphoneDevice" ng-model="vm.conf.microphoneId" required>\n                  <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audioinput\' }">{{ device.label || (\'Microphone \' + ($index + 1))}}</md-option>\n                </md-select>\n                <div ng-messages="settingsForm[\'microphoneDevice\'].$error" ng-show="settingsForm[\'microphoneDevice\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n\n              <div layout="row" layout-align="space-between center">\n                <md-switch ng-disabled="vm.activeSessions.length==0" ng-model="vm.conf.microphoneMute" aria-label="Mute">\n                  Mute\n                </md-switch>\n              </div>\n            </div>\n          </md-content>\n        </md-tab>\n        <md-tab label="{{ \'TOOLBAR.REQUIREMENTS\' | translate}}">\n          <md-content layout-padding>\n            <md-list>\n              <md-list-item>\n                <h3 translate="TOOLBAR.LICENSE">License</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.license ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.license ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.BROWSER_COMPATIBILITY">Browser Compatibility</h3>\n                <md-icon class="md-secondary" ng-class="vm.isCompatibleBrowser() ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.isCompatibleBrowser() ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.HTTPS">HTTPS</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.protocol === \'https\' ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.protocol === \'https\' ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.WEBRTCSUPPORT">WebRTC Support</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.isWebRTCSupported ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.isWebRTCSupported ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.MICROPHONE">Microphone</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.hasMicrophone ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasMicrophone ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n              <md-list-item>\n                <h3 translate="TOOLBAR.SPEAKER">Speaker</h3>\n                <md-icon class="md-secondary" ng-class="vm.conf.hasSpeakers ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasSpeakers ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n              </md-list-item>\n            </md-list>\n          </md-content>\n        </md-tab>\n      </md-tabs>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveSettings()" class="send-button md-accent md-raised" ng-disabled="settingsForm.$invalid || settingsForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/core/directives/ms-quick-filter/ms-quick-filter.html",'<div ng-cloak layout="row" class="quick-filter-container" flex>\n  <div ng-repeat="filter in vm.filters" ng-if="filter.ngIf ? $eval(\'vm.query.\' + filter.ngIf) : true" layout="column" class="padding-horizontal-16">\n    <span class="font-size-10" translate="{{ filter.label }}" />\n    <md-select ng-if="filter.type === \'select\'" class="font-size-12 no-margin" ng-model="vm.query[filter.key]" ng-change="vm.search()" aria-label="Filter {{ filter.name }}">\n      <md-option ng-repeat="option in filter.options" ng-value="filter.ngValue ? option[filter.ngValue] : option.id">\n        {{ option.name }}</md-option>\n      <md-option ng-repeat="option in filter.customOptions" ng-value="option.value" translate="{{ option.translate }}">\n      </md-option>\n    </md-select>\n\n    <md-select ng-if="filter.type === \'multiselect\'" multiple class="font-size-12 no-margin" ng-init="vm.onMultiselectInit(filter)" ng-model="vm.query[filter.key]" ng-disabled="filter.options.length === 0" ng-change="vm.onMultiselectSelection(filter, isOpened)" md-selected-text="vm.placeholders[filter.key]" aria-label="Filter {{ filter.name }}" md-on-open="isOpened = true" md-on-close="isOpened = false">\n      <md-option ng-repeat="option in filter.options" ng-value="filter.ngValue ? option[filter.ngValue] : option.id" ng-disabled="filter.clearAll === false && vm.query[filter.key].length === 1 && vm.query[filter.key][0] === (filter.ngValue ? option[filter.ngValue] : option.id)">\n        {{ option.name }}</md-option>\n      <md-button ng-if="vm.query[filter.key].length &lt; filter.options.length" ng-click="vm.selectAll(filter)" md-no-ink class="md-primary" layout-fill>\n        {{\'DASHBOARDS.SELECT_ALL\' | translate}}</md-button>\n      <md-button ng-if="vm.query[filter.key].length === filter.options.length" ng-click="vm.clearSelection(filter)" md-no-ink class="md-primary" layout-fill>\n        {{\'DASHBOARDS.CLEAR\' | translate}}</md-button>\n    </md-select>\n\n    <div ng-if="filter.type === \'date\'" layout="row" layout-align="center center">\n      <md-date-range ng-init="vm.onDateRangeInit(filter)" localization-map="vm.localizationMap" ng-model="vm.pickerModels[filter.key]" auto-confirm="true" show-template="true" md-on-select="vm.onDateRangeSelection(filter)" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}">\n      </md-date-range>\n      <md-button ng-if="vm.pickerModels[filter.key].dateStart" ng-click="vm.clearDate(filter)" class="md-icon-button no-margin no-padding width-20 height-20" aria-label="Clear date filter">\n        <md-icon md-font-icon="icon-close" class="quick-filter-date-clear-button s16"></md-icon>\n      </md-button>\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-search-bar/ms-search-bar.html",'<div flex layout="row" layout-align="start center">\n  <label>\n    <md-button class="ms-search-bar-expander md-icon-button" aria-label="Expand Search Bar" ng-click="vm.expandBar()" ng-if="!vm.resultsLoading || !vm.expanded" ng-class="{\'ms-search-button-expanded\': vm.expanded }">\n      <md-icon id="ms-search-bar-icon" md-font-icon="icon-magnify" class="s24" ng-class="{\'{{ vm.iconColor }}\': vm.iconColor && !vm.expanded }"></md-icon>\n    </md-button>\n    <div class="ms-search-bar-loader" layout="row" layout-align="center center" ng-if="vm.resultsLoading && vm.expanded">\n      <md-progress-circular class="md-accent" md-diameter="32" md-mode="indeterminate"></md-progress-circular>\n    </div>\n  </label>\n  <input ng-if="vm.expanded" focus-on="vm.expanded" type="text" placeholder="{{ \'TOOLBAR.SEARCH\' | translate }}" flex ng-model="vm.query.filter" ng-model-options="vm.queryOptions" ng-blur="vm.blurCollapse()" ng-keydown="vm.onKeyDown($event)" />\n  <md-button class="ms-search-bar-collapser md-icon-button" ng-click="vm.collapseBar()" aria-label="Collapse Search Bar">\n    <md-icon md-font-icon="icon-close" class="icon s24"></md-icon>\n  </md-button>\n  <div class="ms-search-bar-results" ng-if="vm.results">\n    <div class="no-results" ng-if="vm.results.length === 0">{{ \'DASHBOARDS.NO_RESULTS_AVAILABLE\' | translate }}</div>\n    <div class="result" ng-repeat="result in vm.results" ng-click="vm.handleResultClick(result)" ng-mouseenter="vm.handleMouseEnter($index)" ng-mousedown="vm.absorbEvent($event)" ng-class="{\'selected\': $index == vm.selectedResultIndex}" md-ink-ripple>\n      <div layout="row" layout-align="start center">\n        <div class="icon-container" layout="row" layout-align="center center">\n          <i ng-if="result.icon" class="icon {{ result.icon }}"></i>\n          <div ng-if="!result.icon" class="square md-accent-bg"></div>\n        </div>\n        <div>\n          <div class="title">{{ result.title }}</div>\n          <div class="description" ng-if="result.description">{{ result.description }}</div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>'),e.put("app/core/directives/ms-shortcuts/ms-shortcuts.html",'<div class="shortcuts-container" layout="row" layout-align="space-between center" flex ng-class="{\'mobile-bar-active\': MsShortcuts.mobileBarActive}">\n\n  <div class="flex-noshrink" layout="row" layout-align="start center" flex>\n    <div class="shortcuts hide show-gt-xs" layout="row" layout-align="start center" ng-if="MsShortcuts.shortcuts.length > 0" ng-sortable="MsShortcuts.sortableOptions">\n      <div ng-repeat="shortcut in MsShortcuts.shortcuts" layout="row" layout-align="center center">\n        <md-button class="md-icon-button shortcut" aria-label="{{shortcut.title}}" ui-sref="{{shortcut.uisref}}">\n          <md-icon ng-if="shortcut.icon" md-font-icon="{{shortcut.icon}}" class="icon s24"></md-icon>\n          <div ng-if="!shortcut.icon" class="first-letter">{{shortcut.title.charAt(0)}}</div>\n          <md-tooltip md-direction="bottom">{{shortcut.title}}</md-tooltip>\n        </md-button>\n      </div>\n    </div>\n\n    \x3c!-- <md-menu md-offset="8 56" class="shortcut-menu hide show-gt-xs">\n            <md-button class="md-icon-button add-shortcut-button" aria-label="Add shortcut"\n                       ng-click="$mdOpenMenu($event)">\n                <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24"></md-icon>\n                <md-tooltip md-direction="bottom">Click to add/remove shortcut</md-tooltip>\n            </md-button>\n\n            <md-menu-content>\n                <div id="ms-shortcut-add-menu">\n                    <div class="shortcut-search" layout="row" layout-align="start center">\n                        <div class="search-icon" layout="row" layout-align="center center"\n                             ng-if="!MsShortcuts.resultsLoading">\n                            <md-icon md-menu-align-target md-font-icon="icon-magnify" class="icon s24"></md-icon>\n                        </div>\n                        <div class="shortcut-loader" layout="row" layout-align="center center"\n                             ng-if="MsShortcuts.resultsLoading">\n                            <md-progress-circular class="md-accent" md-diameter="20" md-mode="indeterminate">\n                            </md-progress-circular>\n                        </div>\n\n                        <input type="text" placeholder="Search" flex\n                               ng-model="MsShortcuts.query"\n                               ng-model-options="MsShortcuts.queryOptions"\n                               ng-keydown="MsShortcuts.handleKeydown($event)">\n                    </div>\n\n                    <div class="results" ng-if="MsShortcuts.results" >\n                        <div class="no-results" ng-if="MsShortcuts.results.length === 0">No Results!</div>\n\n                        <div class="result" ng-repeat="result in MsShortcuts.results"\n                             ng-click="MsShortcuts.handleResultClick(result)"\n                             ng-mouseenter="MsShortcuts.handleMouseenter($index)"\n                             ng-mousedown="MsShortcuts.absorbEvent($event)"\n                             ng-class="{\'selected\': $index == MsShortcuts.selectedResultIndex}"\n                             md-prevent-menu-close="md-prevent-menu-close"\n                             md-ink-ripple>\n                            <div layout="row" layout-align="start space-between">\n                                <div layout="row" layout-align="start center" flex>\n                                    <div class="icon icon-container" layout="row" layout-align="center center">\n                                        <i ng-if="result.icon" class="{{result.icon}}"></i>\n                                        <div ng-if="!result.icon" class="square md-accent-bg"></div>\n                                    </div>\n                                    <div>\n                                        <div class="title">{{result.title}}</div>\n                                    </div>\n                                </div>\n                                <md-icon md-font-icon="icon-pin" class="icon s18"\n                                         ng-class="{\'fade-text\': !result.hasShortcut}"></md-icon>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </md-menu-content>\n        </md-menu> --\x3e\n  </div>\n\n  <md-button class="md-icon-button toggle-mobile-menu hide-gt-xs" aria-label="Add shortcut" ng-click="MsShortcuts.toggleMobileBar()">\n    <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24" ng-hide="MsShortcuts.mobileBarActive"></md-icon>\n    <md-icon md-menu-origin md-font-icon="icon-close" class="icon s24" ng-hide="!MsShortcuts.mobileBarActive"></md-icon>\n  </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/horizontal/horizontal.html",'<div class="ms-stepper-horizontal">\n  <div class="ms-stepper-navigation-wrapper">\n    <div class="ms-stepper-navigation" layout="row" layout-align="center center">\n      <md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(step.stepNumber), \'valid\': MsStepper.isStepValid(step.stepNumber), \'disabled\': MsStepper.isStepDisabled(step.stepNumber), \'optional\': MsStepper.isStepOptional(step.stepNumber)}" ng-click="MsStepper.gotoStep(step.stepNumber)" ng-disabled="MsStepper.isStepDisabled(step.stepNumber)" ng-repeat="step in MsStepper.steps | filter:MsStepper.filterHiddenStep" layout="row" layout-align="start center">\n\n        <div class="step md-accent-bg" layout="row" layout-align="center center">\n          <span ng-if="!MsStepper.isStepValid(step.stepNumber) || MsStepper.isStepOptional(step.stepNumber)">\n            {{$index + 1}}\n          </span>\n          <span ng-if="MsStepper.isStepValid(step.stepNumber) && !MsStepper.isStepOptional(step.stepNumber)">\n            <i class="icon icon-check s18"></i>\n          </span>\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="title" translate="{{step.stepTitleTranslate}}">{{step.stepTitle}}</div>\n          <div class="subtitle" ng-if="MsStepper.isStepOptional(step.stepNumber)">Optional</div>\n        </div>\n      </md-button>\n    </div>\n  </div>\n\n  <div class="ms-stepper-steps" ng-transclude></div>\n\n  <div class="ms-stepper-controls" layout="row" layout-align="center center">\n    <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n      Back\n    </md-button>\n\n    <div class="ms-stepper-dots">\n      <span ng-repeat="step in MsStepper.steps" ng-hide="MsStepper.isStepHidden(step.stepNumber)" ng-class="{\'selected md-accent-bg\':MsStepper.currentStepNumber === $index + 1}">\n      </span>\n    </div>\n\n    <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n      Next\n    </md-button>\n\n    <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n      Submit\n    </md-button>\n  </div>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",'<md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(stepInfo.stepNumber), \'valid\': MsStepper.isStepValid(stepInfo.stepNumber), \'disabled\': MsStepper.isStepDisabled(stepInfo.stepNumber), \'optional\': MsStepper.isStepOptional(stepInfo.stepNumber)}" ng-click="MsStepper.gotoStep(stepInfo.stepNumber)" ng-disabled="MsStepper.isStepDisabled(stepInfo.stepNumber)" ng-hide="MsStepper.isStepHidden(stepInfo.stepNumber)" aria-label="Stepper navigation button" layout="row" layout-align="start center">\n\n  <div class="step" layout="row" layout-align="center center">\n    <span ng-if="!MsStepper.isStepValid(stepInfo.stepNumber) || MsStepper.isStepOptional(stepInfo.stepNumber)">\n      <i class="icon icon-checkbox-blank-circle-outline s18 md-accent-fg"></i>\n    </span>\n    <span ng-if="MsStepper.isStepValid(stepInfo.stepNumber) && !MsStepper.isStepOptional(stepInfo.stepNumber)">\n      <i class="icon icon-check-circle s18 md-accent-fg"></i>\n    </span>\n  </div>\n\n  <div layout="column" layout-align="start start">\n    <div class="title" ng-if="stepInfo.stepTitleTranslate">{{stepInfo.stepTitleTranslate | translate }}</div>\n    <div class="title" ng-if="!stepInfo.stepTitleTranslate">{{stepInfo.stepTitle}}</div>\n    <div class="subtitle" ng-if="MsStepper.isStepOptional(stepInfo.stepNumber)">Optional</div>\n  </div>\n</md-button>\n\n<div class="ms-stepper-step-content" ng-transclude></div>\n\n<div class="ms-stepper-controls" layout="row" layout-align="start center" ng-show="MsStepper.isStepCurrent(stepInfo.stepNumber)">\n  <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n    Back\n  </md-button>\n\n  <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n    Next\n  </md-button>\n\n  <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n    Submit\n  </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/vertical.html",'<div class="ms-stepper-vertical">\n  <div class="ms-stepper-vertical-line"></div>\n  <div class="ms-stepper-steps" ng-transclude></div>\n</div>'),e.put("app/core/directives/ms-tab-scroll/ms-tab-scroll.html",'<div layout="row">\n  <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'left\')" ng-if="vm.canScroll(\'left\') == true">\n    <md-icon md-font-icon="icon-chevron-left" class="icon s26"></md-icon>\n  </md-button>\n  <div id="bar-container" layout="row" class="bar-container">\n    <div ng-transclude id="tab-container" layout="row" layout-align="start center" class="scroll-container">\n    </div>\n  </div>\n  <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'right\')" ng-if="vm.canScroll(\'right\') == true">\n    <md-icon md-font-icon="icon-chevron-right" class="icon s26"></md-icon>\n  </md-button>\n</div>'),e.put("app/core/directives/ms-timezone/ms-timezone.html",'<md-select ng-model="ngModel" class="no-margin" ng-change="ngChange()">\n  <md-option ng-value="null">NONE</md-option>\n  <md-option ng-repeat="t in timezone | orderBy:\'utcOffset\'" value="{{t.name}}">{{t.name}} ({{t.offsetStr}})</md-option>\n</md-select>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-counter/ms-widget-engine.counter.html",'<div class="pt-8 pb-32" layout="column" layout-align="center center" layout-fill ng-controller="MsWidgetEngineCounterController as vm">\n  <div ng-class="\'font-size-\' + (vm.fontSize * 3)" ng-style="{\'color\': widget.foreground}">\n    {{ vm.getCount(widget) }}\n  </div>\n  <div ng-class="\'font-size-\' + vm.fontSize" ng-style="{\'color\': widget.foreground}">{{ \'TOOLS.\' +  vm.label | uppercase | translate }}<span ng-if="vm.filtered">*</span></div>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-multibar-chart/ms-widget-engine.multibar-chart.html",'<div ng-controller="MsWidgetEngineMultibarChartController as vm" ng-init="vm.getMultiBarChart(widget)" layout="column" layout-fill>\n\n  <span ng-show="false">{{ vm.getMultiBarChart(widget)}}</span>\n\n  <canvas style="overflow:scroll" id="bar" class="chart-horizontal-bar" chart-data="vm.multiBarChart.data" chart-options="vm.multiBarChart.options" chart-series="vm.multiBarChart.series" chart-labels="vm.multiBarChart.labels">\n  </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-pie-chart/ms-widget-engine.pie-chart.html",'<div ng-controller="MsWidgetEnginePieChartController as vm" ng-init="vm.getPieChart(widget)" layout="column" layout-fill>\n\n  <span ng-show="false">{{ vm.getPieChart(widget)}}</span>\n\n  <canvas style="overflow:scroll" id="pie" class="chart-pie" chart-data="vm.pieChart.data" chart-labels="vm.pieChart.labels" chart-options="vm.pieChart.options">\n  </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-web-report/ms-widget-engine.web-report.html",'<div ng-controller="MsWidgetEngineWebReportController as vm" ng-init="vm.onInit(widget)">\n  <dl ng-if="vm.error">\n    <dt class="text-bold">Query Error</dt>\n    <dd>{{vm.error.sql}}</dd>\n    <dt>Message</dt>\n    <dd>{{vm.error.msg}}</dd>\n  </dl>\n  <md-toolbar class="md-table-toolbar md-default">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead">{{vm.title}}</span>\n      <div flex></div>\n      <md-button class="md-icon-button" ng-click="vm.onInit(widget)" aria-label="refresh">\n        <md-icon md-font-icon="icon-refresh"></md-icon>\n      </md-button>\n      <span ng-if="vm.refresh && vm.countDown" class="md-subhead blue-fg">{{vm.countDown}}</span>\n    </div>\n  </md-toolbar>\n  <md-table-container ng-if="!vm.error">\n    <table md-table md-progress="vm.promise">\n      <thead md-head>\n        <tr md-row>\n          <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-repeat="row in vm.results.rows">\n          <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n        </tr>\n        <tr md-row ng-if="!vm.results.rows.length">\n          <td md-cell colspan="{{vm.columns.length}}">\n            <div layout="row" layout-align="center center">\n              <span>No Data</span>\n            </div>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine.html",'<div gridster="vm.config">\n  <ul>\n    <li gridster-item="widget" ng-repeat="widget in vm.config.widgets">\n      <md-card layout-fill>\n        <md-toolbar class="height-40" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground }">\n          <div class="md-toolbar-tools height-40 no-margin" layout="row" layout-align="start center">\n            <a ng-href="{{widget.link ? widget.link : \'javascript:void(0)\'}}" ng-style="{\'color\': widget.foreground, \'font-size\': (widget.titleFontSize || 12) }" class="text-truncate" flex>\n              {{ widget.title || \'No Title\' }}\n            </a>\n            <md-button ng-if="!vm.config.preview" class="draggable md-icon-button width-30 no-margin no-padding" aria-label="Move">\n              <md-tooltip><span translate="TOOLS.MOVE_WIDGET">Move</span></md-tooltip>\n              <md-icon md-font-icon="icon-cursor-move" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n            </md-button>\n            <md-menu ng-if="!vm.config.preview">\n              <md-button ng-click="$mdOpenMenu($event)" class="md-icon-button width-30 no-margin no-padding" aria-label="More">\n                <md-icon md-font-icon="icon-dots-vertical" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n              </md-button>\n              <md-menu-content>\n                <md-menu-item>\n                  <md-button ng-click="vm.onEdit({widget: widget})" translate="TOOLS.EDIT_WIDGET">Edit\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.onDelete({widget: widget})" translate="TOOLS.DELETE_WIDGET">\n                    Delete</md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n\n          </div>\n        </md-toolbar>\n        <md-card-content class="resizable" layout="column" layout-align="center center" flex ng-style="{\'background-color\': widget.background, \'color\': widget.foreground}">\n          <div ng-switch="widget.type" layout-fill>\n            <iframe ng-switch-when="iframe|custom" ng-switch-when-separator="|" ng-src="{{vm.getTrustedURL(widget.attrs[0].value)}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n            <ds-widget-clock ng-class="\'font-size-\' + (widget.attrs[2].value || 12)" ng-switch-when="clock" digital-format="widget.attrs[0].value" gmt-offset="widget.attrs[1].value" data-show-digital show-gmt-info></ds-widget-clock>\n            <div ng-switch-default layout-fill>\n              <div ng-include="widget.templateUrl" layout-fill></div>\n            </div>\n          </div>\n        </md-card-content>\n      </md-card>\n    </li>\n  </ul>\n</div>'),e.put("app/core/layouts/content-only.html",'<div id="layout-content-only" class="template-layout" layout="column" flex>\n  <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n</div>'),e.put("app/core/layouts/content-with-toolbar.html",'<div id="layout-content-with-toolbar" class="template-layout" layout="column" flex>\n  <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n  <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n\n  <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n</div>'),e.put("app/core/layouts/horizontal-navigation.html",'<div id="layout-horizontal-navigation" class="template-layout" layout="column" flex>\n\n  <div id="toolbar-navigation-container" class="md-whiteframe-1dp" layout="column" layout-align="space-between start">\n    <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n    <div id="horizontal-navigation" ui-view="navigation" layout="row" layout-align="start end" flex></div>\n  </div>\n\n  <div id="content-container" flex layout="column">\n    <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n  </div>\n\n  <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",'<div id="layout-vertical-navigation-fullwidth-toolbar-2" class="template-layout" layout="column" flex>\n\n  <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n  <div id="main-container" layout="row" flex>\n    <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation"></md-sidenav>\n\n    <div id="content-container" flex layout="column">\n      <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n    </div>\n\n    <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n  </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar.html",'<div id="layout-vertical-navigation-fullwidth-toolbar" class="template-layout" layout="column" flex>\n\n  <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n  <div id="main-container" layout="row" flex>\n    <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation"></md-sidenav>\n\n    <div id="content-container" flex layout="column">\n      <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n    </div>\n\n    <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n  </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation.html",'<div id="header" ui-view="header"></div>\n\n<div id="layout-vertical-navigation" class="template-layout" layout="row" flex>\n\n  <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation" ng-if="!vm.isAgent()"></md-sidenav>\n\n  <div id="content-container" flex layout="column">\n    <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n\n    <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n  </div>\n\n  <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n\n</div>\n\n<div id="footer" ui-view="footer"></div>'),e.put("app/core/theme-options/theme-options.html",'<div class="ms-theme-options-button md-primary-bg" ng-click="toggleOptionsSidenav()">\n  <md-icon md-font-icon="icon-cog" class="white-text"></md-icon>\n</div>\n\n<md-sidenav md-component-id="motion-theme-options" class="md-sidenav-right">\n\n  <div class="ms-theme-options-list" layout="column">\n    <div class="theme-option layout-options">\n      <div class="option-title">Layout Style:</div>\n      <md-radio-group layout="row" layout-align="start start" layout-wrap ng-model="vm.layoutStyle" ng-change="vm.updateLayoutStyle()">\n        <md-radio-button ng-repeat="layoutStyle in vm.layoutStyles" ng-value="layoutStyle.value">\n          <div layout="column" layout-align="center center">\n            <img ng-src="{{layoutStyle.figure}}">\n            <span class="text-center font-size-12 mt-8">{{layoutStyle.label}}</span>\n          </div>\n        </md-radio-button>\n      </md-radio-group>\n    </div>\n\n    <md-divider></md-divider>\n\n    <div class="theme-option">\n      <div class="option-title">Layout Mode:</div>\n      <md-radio-group layout="row" layout-align="start center" ng-model="vm.layoutMode" ng-change="vm.updateLayoutMode()">\n        <md-radio-button ng-repeat="layoutMode in vm.layoutModes" ng-value="layoutMode.value">\n          {{layoutMode.label}}\n        </md-radio-button>\n      </md-radio-group>\n    </div>\n\n    <md-divider></md-divider>\n\n    <div class="theme-option color-palettes">\n      <div class="option-title">Color Palette:</div>\n      <div layout="row" layout-align="start start" layout-wrap>\n        <md-button ng-repeat="(themeName, theme) in vm.themes.list" class="md-raised theme-button" layout="row" layout-align="center center" aria-label="{{themeName}}" ng-click="vm.setActiveTheme(themeName)" ng-style="{\'background-color\': theme.primary.color,\'border-color\': theme.accent.color,\'color\': theme.primary.contrast1}" ng-class="{active: vm.getActiveTheme().name === themeName}">\n          <md-icon ng-style="{\'color\': theme.primary.contrast1}" md-font-icon="icon-palette" class="icon s32"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n</md-sidenav>'),e.put("app/errors/404/error-404.html",'<div id="error-404" layout="column" layout-align="center center">\n  <div class="content" layout="column" layout-align="center center">\n    <div class="error-code" translate="ERROR404.CODE">404</div>\n\n    <div class="message" translate="ERROR404.MESSAGE">Sorry but we couldn’t find the page you are looking for</div>\n    <ms-search-bar on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300">Search for anything</ms-search-bar>\n\n    \x3c!-- <div class="search md-whiteframe-1dp" layout="row" layout-align="start center">\n            <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n            <input ng-model="vm.search" type="text" placeholder="Search for anything" translate translate-attr-placeholder="ERROR404.SEARCH" flex>\n        </div> --\x3e\n\n    <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR404.GO_BACK">Go back to dashboard</a>\n  </div>\n</div>'),e.put("app/errors/500/error-500.html",'<div id="error-500" layout="column" layout-align="center center">\n  <div ng-if="!vm.send" class="content" layout="column" layout-align="center center">\n    <div class="error-code" translate="ERROR500.CODE">500</div>\n    <div class="message" translate="ERROR500.MESSAGE">Well, you broke the internet!</div>\n    <div class="sub-message" translate="ERROR500.SUBMESSAGE">Just kidding, looks like we have an internal issue, please try again in couple minutes\n    </div>\n    <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n    <md-button class="md-raised md-warn" ng-click="vm.sendReport()" translate="ERROR500.REPORT">Report this problem</md-button>\n  </div>\n  <pre ng-if="!vm.send">\n  {{vm.error}}\n  </pre>\n  <div ng-if="vm.send" class="content" layout="column" layout-align="center center">\n    <div class="error-code">#{{vm.code}}</div>\n    <div class="message" translate="ERROR500.JIRA_MESSAGE">Your request has been received and will be processed shortly.</div>\n    <div class="sub-message" translate="ERROR500.JIRA_SUBMESSAGE">Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.</div>\n    <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n  </div>\n</div>'),e.put("app/footer/layouts/vertical-navigation/footer.html",'<div layout="row" layout-align="start center">\n  <ms-info-bar ng-if="!vm.cookieAlertHide" on-close="vm.cookieAlertOnClose()" class="grey-100-bg">\n    <div layout="row" layout-align="start center">\n      <span translate="FOOTER.COOKIE_LAW" flex class="text-center grey-600-fg"></span>\n    </div>\n  </ms-info-bar>\n</div>'),e.put("app/forgot/forgot.html",'<div id="forgot-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()">\n  <div id="forgot-password-form-wrapper" layout="column" layout-align="center center">\n    <div id="forgot-password-form" class="md-whiteframe-8dp">\n\n      <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n      <div class="title" translate="FORGOTPASSWORD.TITLE">Recover your password</div>\n\n      <form name="forgotPasswordForm" novalidate>\n        <md-input-container class="md-block" md-no-float>\n          <input type="email" name="email" ng-model="vm.form.email" placeholder="Email address" translate translate-attr-placeholder="FORGOTPASSWORD.EMAIL_ADRESS" ng-pattern="/^.+@.+\\..+$/" required>\n          <div ng-messages="forgotPasswordForm.email.$error" role="alert" multiple>\n            <div ng-message="required">\n              <span translate="FORGOTPASSWORD.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n            </div>\n            <div ng-message="pattern">\n              <span translate="FORGOTPASSWORD.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-button type="button" ng-click="vm.forgotPassword()" class="md-raised md-accent submit-button" aria-label="RESET MY PASSWORD" ng-disabled="forgotPasswordForm.$invalid || forgotPasswordForm.$pristine" translate="FORGOTPASSWORD.SEND_RESET_LINK" translate-attr-aria-label="FORGOTPASSWORD.SEND_RESET_LINK">\n          SEND RESET LINK\n        </md-button>\n      </form>\n\n      <div class="login" layout="row" layout-align="center center">\n        <a class="link" ui-sref="app.login" translate="FORGOTPASSWORD.GO_BACK">Go back to login</a>\n      </div>\n    </div>\n  </div>\n</div>'),e.put("app/header/layouts/vertical-navigation/header.html",'\x3c!-- <div layout="row" layout-align="start center">\n    <ms-info-bar ng-if="vm.currentUser.role == \'admin\' && !vm.newsAlertHide" on-close="vm.newsAlertOnClose()" class="green-600-bg white-fg">\n        <div layout="row" layout-align="start center">\n            <md-icon md-font-icon="icon-message-text-outline" class="icon margin-right-10 s20"></md-icon>\n            <div flex hide-xs translate="HEADER.NEWS"></div>\n        </div>\n    </ms-info-bar>\n</div> --\x3e'),e.put("app/login/login.html",'<div id="login" class="flex-scrollable" layout="column">\n  <div id="login-form-wrapper" layout="column" layout-align="center center">\n    <div id="login-form" class="md-whiteframe-8dp">\n\n      <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n      \x3c!-- <img src="assets/images/logos/login.png" alt="motion_logo_login" /> --\x3e\n\n      <div class="md-subhead padding-top-45" translate="LOGIN.TITLE">Log in to your account</div>\n\n      <form name="loginForm" novalidate ng-if="!vm.progressLogin">\n        <md-input-container class="md-block" md-no-float>\n          <input type="input" name="name" ng-model="vm.form.name" autofocus aria-label="username" translate translate-attr-placeholder="LOGIN.USERNAME" required>\n          <div ng-messages="loginForm.name.$error" role="alert" multiple>\n            <div ng-message="required">\n              <span translate="LOGIN.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block" md-no-float>\n          <input type="password" name="password" ng-model="vm.form.password" aria-label="password" translate translate-attr-placeholder="LOGIN.PASSWORD" required>\n          <div ng-messages="loginForm.password.$error" role="alert" multiple>\n            <div ng-message="required">\n              <span translate="LOGIN.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <div class="remember-forgot-password" layout="row" layout-xs="column" layout-align="end center">\n          \x3c!-- <md-checkbox class="remember-me" ng-model="data.cb1" aria-label="Remember Me">\n                        <span translate="LOGIN.REMEMBER_ME">Remember Me</span>\n                    </md-checkbox> --\x3e\n          <a ui-sref="app.forgot" class="forgot-password md-accent-color" style="cursor:pointer;" translate="LOGIN.FORGOT_PASSWORD">Forgot Password?</a>\n        </div>\n\n        <b layout="row" layout-align="center center" class="md-padding" ng-if="vm.message">\n          <font color="red">{{vm.message}}</font>\n        </b>\n        <md-button type="submit" ng-click="vm.login()" class="md-raised md-accent submit-button" aria-label="LOGIN" translate="LOGIN.LOG_IN" translate-attr-aria-label="LOGIN.LOG_IN">\n          LOG IN\n        </md-button>\n      </form>\n\n      <md-progress-circular ng-if="vm.progressLogin" md-diameter="96"></md-progress-circular>\n\n      <div ng-if="vm.googleSsoEnabled || vm.adSsoEnabled" class="separator">\n        <span class="text" translate="LOGIN.OR">OR</span>\n      </div>\n\n      <md-button ng-if="vm.googleSsoEnabled" ng-click="vm.loginOauth(\'google\')" class="md-raised google">\n        <div layout="row" layout-align="center center">\n          <span>\n            <md-icon md-font-icon="fab fa-google" class="s16"></md-icon>\n            <span translate="LOGIN.WITH_GOOGLE">Log in with Google</span>\n          </span>\n        </div>\n      </md-button>\n\n      <md-button ng-if="vm.adSsoEnabled" ng-click="vm.loginAD()" class="md-raised ad">\n        <div layout="row" layout-align="center center">\n          <span>\n            <md-icon md-font-icon="fas fa-ad" class="s16"></md-icon>\n            <span style="text-transform: none" translate="LOGIN.WITH_AD">Log in with Active Directory</span>\n          </span>\n        </div>\n      </md-button>\n    </div>\n  </div>\n</div>'),e.put("app/main/apps/analytics/views/extractedReports/create/dialog.html",'<md-dialog class="extractedReport-dialog" aria-label="New ExtractedReport">\n  <form name="extractedReportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.REPORTNAME">ReportName</label>\n        <input type="" name="name" ng-model="vm.extractedReport.name" ng-required="true" autofocus>\n\n        <div ng-messages="extractedReportForm[\'name\'].$error" ng-show="extractedReportForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.REPORTNAME_REQUIRED">ReportName field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input type="" name="basename" ng-model="vm.extractedReport.basename" ng-required="true">\n\n        <div ng-messages="extractedReportForm[\'basename\'].$error" ng-show="extractedReportForm[\'basename\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newExtractedReport" ng-click="vm.saveExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid || extractedReportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newExtractedReport" ng-click="vm.addNewExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_EXTRACTEDREPORT" translate-attr-aria-label="ANALYTICS.ADD_EXTRACTEDREPORT">\n          ADD EXTRACTEDREPORT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newExtractedReport" ng-click="vm.deleteExtractedReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/extractedReports/extractedReports.html",'<div id="extractedReports" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="ANALYTICS.EXTRACTEDREPORTS">ExtractedReports</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedExtractedReports.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedExtractedReports =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="ANALYTICS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-extractedReports-count">\n          <span>{{vm.selectedExtractedReports.length}}</span>\n          <span translate="ANALYTICS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllExtractedReports()" translate="ANALYTICS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectExtractedReports()" translate="ANALYTICS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedExtractedReports" csv-label="true" filename="extractedReports.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedExtractedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- EXTRACTEDREPORT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedExtractedReports" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getExtractedReports">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'ANALYTICS.REPORTNAME\' | translate }}</th>\n                <th md-column md-order-by="basename">{{ \'ANALYTICS.NAME\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'ANALYTICS.TYPE\' | translate }}</th>\n                <th md-column md-order-by="startDate">{{ \'ANALYTICS.DATE_RANGE_FROM\' | translate }}</th>\n                <th md-column md-order-by="endDate">{{ \'ANALYTICS.DATE_RANGE_TO\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'ANALYTICS.GENERATED_AT\' | translate }}</th>\n                <th md-column md-order-by="status">{{ \'ANALYTICS.STATUS\' | translate }}</th>\n                <th md-column md-order-by="output">{{ \'ANALYTICS.OUTPUT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.extractedReports.rows.length">\n                <td md-cell colspan="10">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="extractedReport" md-select-id="id" ng-repeat="extractedReport in vm.extractedReports.rows">\n                <td md-cell ng-if="extractedReport.userpic"><img class="avatar" alt="{{extractedReport.name}}" ng-src="api/users/{{extractedReport.id}}/avatar" /></td>\n                <td md-cell ng-if="!extractedReport.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{extractedReport.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="id ">{{extractedReport.id}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="name ">{{extractedReport.name}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="basename ">{{extractedReport.basename}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="type ">{{extractedReport.type}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="startDate ">{{extractedReport.startDate | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="endDate ">{{extractedReport.endDate | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="createdAt ">{{extractedReport.createdAt | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="status ">{{extractedReport.status}}</td>\n                <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="output ">{{extractedReport.output}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(extractedReport, $event    )" translate="ANALYTICS.EDIT_EXTRACTEDREPORT">\n                          Edit ExtractedReport\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="extractedReport.status == \'Completed\'">\n\n                        <md-button ng-click="vm.downloadfile2(extractedReport, $event  , \'analytics/extracted_reports\'   )" translate="ANALYTICS.DOWNLOAD_EXTRACTEDREPORT">\n                          Download ExtractedReport\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(extractedReport, $event    )" translate="ANALYTICS.DELETE_EXTRACTEDREPORT">\n                          Delete ExtractedReport\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.extractedReports.count}}" md-on-paginate="vm.getExtractedReports" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / EXTRACTEDREPORT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/metrics/create/dialog.html",'<md-dialog class="metric-dialog" aria-label="New Metric">\n  <form name="metricForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.metric.name" ng-required="true" autofocus>\n\n        <div ng-messages="metricForm[\'name\'].$error" ng-show="metricForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.TABLE">Table</label>\n        <md-select name="table" ng-model="vm.metric.table" required>\n          <md-option ng-value="\'report_agent\'">Agent Report</md-option>\n          <md-option ng-value="\'report_call\'">Call Report</md-option>\n          <md-option ng-value="\'cdr\'">CDR</md-option>\n          <md-option ng-value="\'chat_websites\'">Chat Website</md-option>\n          <md-option ng-value="\'chat_interactions\'">Chat Interaction</md-option>\n          <md-option ng-value="\'chat_messages\'">Chat Messages</md-option>\n          <md-option ng-value="\'chat_offline_messages\'">Chat Offline Messages</md-option>\n          <md-option ng-value="\'chat_queues\'">Chat Queues</md-option>\n          <md-option ng-value="\'report_chat_queue\'">Chat Report Queue</md-option>\n          <md-option ng-value="\'report_chat_transfer\'">Chat Report Transfer</md-option>\n          <md-option ng-value="\'cm_companies\'">Companies</md-option>\n          <md-option ng-value="\'report_call_transfer\'">Call transfer report</md-option>\n          <md-option ng-value="\'cm_contacts\'">Contacts</md-option>\n          <md-option ng-value="\'report_square\'">CSquare Report</md-option>\n          <md-option ng-value="\'report_square_details\'">CSquare Details Report</md-option>\n          <md-option ng-value="\'report_dial\'">Dial Report</md-option>\n          <md-option ng-value="\'cm_hopper\'">Dialer Hopper Processing</md-option>\n          <md-option ng-value="\'cm_hopper_history\'">Dialer Hopper Logs</md-option>\n          <md-option ng-value="\'cm_hopper_final\'">Dialer Hopper Final</md-option>\n          <md-option ng-value="\'mail_accounts\'">Email Account</md-option>\n          <md-option ng-value="\'mail_interactions\'">Email Interaction</md-option>\n          <md-option ng-value="\'mail_messages\'">Email Messages</md-option>\n          <md-option ng-value="\'mail_queues\'">Email Queues</md-option>\n          <md-option ng-value="\'report_mail_queue\'">Email Report Queue</md-option>\n          <md-option ng-value="\'report_mail_transfer\'">Email Report Transfer</md-option>\n          <md-option ng-value="\'fax_accounts\'">Fax Account</md-option>\n          <md-option ng-value="\'fax_interactions\'">Fax Interaction</md-option>\n          <md-option ng-value="\'fax_messages\'">Fax Messages</md-option>\n          <md-option ng-value="\'fax_queues\'">Fax Queues</md-option>\n          <md-option ng-value="\'report_fax_queue\'">Fax Report Queue</md-option>\n          <md-option ng-value="\'report_fax_transfer\'">Fax Report Transfer</md-option>\n          <md-option ng-value="\'report_jscripty_sessions\'">Jscripty Sessions</md-option>\n          <md-option ng-value="\'report_jscripty_questions\'">Jscripty Questions</md-option>\n          <md-option ng-value="\'report_jscripty_answers\'">Jscripty Answers</md-option>\n          <md-option ng-value="\'cm_lists\'">Lists</md-option>\n          <md-option ng-value="\'report_member\'">Member Report</md-option>\n          <md-option ng-value="\'openchannel_accounts\'">Openchannel Account</md-option>\n          <md-option ng-value="\'openchannel_interactions\'">Openchannel Interaction</md-option>\n          <md-option ng-value="\'openchannel_messages\'">Openchannel Messages</md-option>\n          <md-option ng-value="\'openchannel_queues\'">Openchannel Queues</md-option>\n          <md-option ng-value="\'report_openchannel_queue\'">Openchannel Report Queue</md-option>\n          <md-option ng-value="\'report_openchannel_transfer\'">Openchannel Report Transfer</md-option>\n          <md-option ng-value="\'report_queue\'">Queue Report</md-option>\n          <md-option ng-value="\'sms_accounts\'">SMS Account</md-option>\n          <md-option ng-value="\'sms_interactions\'">SMS Interaction</md-option>\n          <md-option ng-value="\'sms_messages\'">SMS Messages</md-option>\n          <md-option ng-value="\'sms_queues\'">SMS Queues</md-option>\n          <md-option ng-value="\'report_sms_queue\'">SMS Report Queue</md-option>\n          <md-option ng-value="\'report_sms_transfer\'">SMS Report Transfer</md-option>\n          <md-option ng-value="\'users\'">Users</md-option>\n          <md-option ng-value="\'voice_recordings\'">Voice Recordings</md-option>\n          <md-option ng-value="\'whatsapp_accounts\'">Whatsapp Account</md-option>\n          <md-option ng-value="\'whatsapp_interactions\'">Whatsapp Interaction</md-option>\n          <md-option ng-value="\'whatsapp_messages\'">Whatsapp Messages</md-option>\n          <md-option ng-value="\'whatsapp_queues\'">Whatsapp Queues</md-option>\n          <md-option ng-value="\'report_whatsapp_queue\'">Whatsapp Report Queue</md-option>\n          <md-option ng-value="\'report_whatsapp_transfer\'">Whatsapp Report Transfer</md-option>\n        </md-select>\n        <div ng-messages="metricForm[\'table\'].$error" ng-show="metricForm[\'table\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.METRIC">Metric</label>\n        <input type="text" name="metric" ng-model="vm.metric.metric" ng-required="true">\n\n        <div ng-messages="metricForm[\'metric\'].$error" ng-show="metricForm[\'metric\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.metric.description">\n\n        <div ng-messages="metricForm[\'description\'].$error" ng-show="metricForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMetric" ng-click="vm.saveMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid || metricForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMetric" ng-click="vm.addNewMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_METRIC" translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n          ADD METRIC\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMetric" ng-click="vm.deleteMetric($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/metrics/metrics.html",'<div id="metrics" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="ANALYTICS.METRICS">Metrics</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedMetrics.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMetrics =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="ANALYTICS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-metrics-count">\n          <span>{{vm.selectedMetrics.length}}</span>\n          <span translate="ANALYTICS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMetrics()" translate="ANALYTICS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMetrics()" translate="ANALYTICS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMetrics" csv-label="true" filename="metrics.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMetrics($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- METRIC TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMetrics" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMetrics">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n                <th md-column md-order-by="table">{{ \'ANALYTICS.TABLE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.metrics.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="metric" md-select-id="id" ng-repeat="metric in vm.metrics.rows">\n                <td md-cell ng-if="metric.userpic"><img class="avatar" alt="{{metric.name}}" ng-src="api/users/{{metric.id}}/avatar" /></td>\n                <td md-cell ng-if="!metric.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{metric.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="id ">{{metric.id}}</td>\n                <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="name ">{{metric.name}}</td>\n                <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="table ">{{ vm.arraytable[metric.table].option }}</td>\n                <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="description ">{{metric.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(metric, $event    )" translate="ANALYTICS.EDIT_METRIC">\n                          Edit Metric\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(metric, $event    )" translate="ANALYTICS.DELETE_METRIC">\n                          Delete Metric\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.metrics.count}}" md-on-paginate="vm.getMetrics" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / METRIC TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD METRIC BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-metric-button" ng-click="vm.createOrEditMetric($event)" aria-label="add metric" translate translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD METRIC BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/copy/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="ANALYTICS.COPY_REPORT">Copy Report</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input name="name" ng-model="vm.report.name" required md-autofocus>\n        <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="md-block">\n        <label translate="ANALYTICS.SELECT_NODE">Select Node</label>\n        <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.copyReport()" class="send-button md-accent md-raised" ng-disabled="!vm.currentNode" aria-label="COPY" translate="ANALYTICS.COPY_REPORT" translate-attr-aria-label="ANALYTICS.COPY_REPORT">\n          COPY REPORT\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/create/dialog.html",'<md-dialog class="report-dialog" aria-label="New Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.report.name" required md-autofocus>\n        <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newReport">\n        <label translate="ANALYTICS.TABLE">Table</label>\n        <md-select ng-model="vm.report.table" required>\n          <md-option ng-repeat="table in vm.tables | orderBy:\'name\'" ng-value="table.name">{{table.name}}</md-option>\n        </md-select>\n        <div ng-messages="reportForm.table.$error" ng-show="reportForm.table.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.report.description">\n        <div ng-messages="reportForm.description.$error" ng-show="reportForm.description.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-autocomplete ng-if="vm.newReport" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="table in vm.tables | filter:vm.searchText" md-item-text="table.name" md-min-length="0" md-selected-item-change="vm.selectedTableChange(table)" placeholder="Select the table to Join">\n        <md-item-template>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{table.name}}</span>\n        </md-item-template>\n        <md-not-found>\n          No states matching "{{vm.searchText}}" were found.\n        </md-not-found>\n      </md-autocomplete>\n\n      <md-card ng-if="vm.newReport" md-theme="default" md-theme-watch ng-repeat="table in vm.joinTables">\n        <md-card-title>\n          <md-card-title-text layout="row">\n            <div layout="row" flex="50">\n              <span class="md-subhead">{{table.name}}</span>\n            </div>\n            <div layout="row" layout-align="end center" flex>\n              <md-button class="md-icon-button" ng-click="vm.removeJoin($index)">\n                <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n              </md-button>\n            </div>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-content>\n          <md-select ng-model="table.parentKey" placeholder="Select the parent key" ng-init="table.parentFields = []; vm.getFields(table, \'parentFields\', vm.report.table)" required>\n            <md-option ng-repeat="field in table.parentFields" ng-value="field">{{field}}</md-option>\n          </md-select>\n          <md-select ng-model="table.foreignKey" placeholder="Select the foreign key" ng-init="table.foreignFields = []; vm.getFields(table, \'foreignFields\', table.name)" required>\n            <md-option ng-repeat="field in table.foreignFields" ng-value="field">{{field}}</md-option>\n          </md-select>\n          <md-select ng-model="table.type" placeholder="Select join type" required>\n            <md-option ng-repeat="join in vm.joinTypes" ng-value="join.key">{{join.value}}</md-option>\n          </md-select>\n        </md-card-content>\n      </md-card>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newReport" ng-click="vm.saveReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newReport" ng-click="vm.addNewReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORT" translate-attr-aria-label="ANALYTICS.ADD_REPORT">\n          ADD REPORT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReport" ng-click="vm.deleteReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/condition/group.html",'<md-card class="padding-horizontal-15 padding-top-15">\n  <div layout="row" ng-if="vm_rc.crudPermissions.canEdit">\n    <md-input-container class="md-block" flex>\n      <label translate="ANALYTICS.OPERATOR">Operator</label>\n      <md-select ng-model="group.operator" required>\n        <md-option value="AND">AND</md-option>\n        <md-option value="OR">OR</md-option>\n      </md-select>\n      <div ng-messages="conditionsForm.operator.$error" ng-show="conditionsForm.operator.$touched" role="alert">\n        <div ng-message="required">\n          <span translate="ANALYTICS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n        </div>\n      </div>\n    </md-input-container>\n    <md-input-container class="md-block">\n      <md-button class="md-raised md-accent" ng-click="vm_rc.addCondition(group.rules)">\n        <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.CONDITION\' | translate}}\n      </md-button>\n    </md-input-container>\n    <md-input-container class="md-block">\n      <md-button class="md-raised md-accent" ng-click="vm_rc.addGroup(group.rules)">\n        <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n      </md-button>\n    </md-input-container>\n    <div flex></div>\n    <md-input-container class="md-block" ng-if="parent">\n      <md-button class="md-raised md-warn" ng-click="vm_rc.deleteConfirm(parent, index, $event)">\n        <md-icon md-font-icon="icon-delete"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n      </md-button>\n    </md-input-container>\n  </div>\n  <div layout="column" ng-repeat="rule in group.rules track by $index">\n    <div layout="row" ng-if="!rule.group">\n      <md-input-container class="md-block" flex>\n        <label translate="ANALYTICS.COLUMN">COLUMN</label>\n        <md-select name="field" ng-model="rule.field" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n          <md-optgroup label="{{vm_rc.report.table}}">\n            <md-option ng-repeat="column in vm_rc.columns" value="{{vm_rc.report.table}}.{{column}}">{{column}}</md-option>\n          </md-optgroup>\n          <md-optgroup ng-if="vm_rc.report.joins" ng-repeat="join in vm_rc.report.joins" label="{{join.foreignTable}}">\n            <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n          </md-optgroup>\n        </md-select>\n        <div ng-messages="conditionsForm.field.$error" ng-show="conditionsForm.field.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" flex>\n        <label translate="ANALYTICS.CONDITION">CONDITION</label>\n        <md-select name="condition" ng-model="rule.condition" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n          <md-option ng-repeat="condition in vm_rc.conditions" ng-value="condition">{{condition}}</md-option>\n        </md-select>\n        <div ng-messages="conditionsForm.condition.$error" ng-show="conditionsForm.condition.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm_rc.isValueByCondition(rule.condition)" class="md-block" flex>\n        <label translate="ANALYTICS.VALUE">VALUE</label>\n        <input type="text" name="value" ng-model="rule.value" ng-disabled="!vm_rc.crudPermissions.canEdit" required md-autofocus>\n        <div ng-messages="conditionsForm.value.$error" ng-show="conditionsForm.value.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm_rc.crudPermissions.canEdit" flex>\n        <md-button class="md-fab md-mini md-warn" aria-label="Delete row" ng-click="vm_rc.deleteConfirm(group.rules, $index, $event)">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </md-input-container>\n    </div>\n    <div ng-if="rule.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="parent=group.rules;index=$index;group=rule.group"></div>\n  </div>\n</md-card>'),e.put("app/main/apps/analytics/views/reports/edit/field/dialog.html",'<md-dialog class="reportField-dialog" aria-label="New Report Field">\n  <form name="reportFieldForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{vm.title}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <pre></pre>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.reportField.type" ng-change="vm.reportField.field = undefined" required>\n          <md-option value="column">Select a column</md-option>\n          <md-option value="metric">Select an existing metric</md-option>\n          <md-option value="custom">Write a custom metric</md-option>\n        </md-select>\n        <div ng-messages="reportForm.type.$error" ng-show="reportForm.type.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-switch on="vm.reportField.type">\n        <md-input-container class="md-block" ng-switch-when="column">\n          <label translate="ANALYTICS.COLUMN">Column Name</label>\n          <md-select name="column" ng-model="vm.reportField.field" required>\n            <md-optgroup label="{{vm.report.table}}">\n              <md-option ng-repeat="column in vm.columns" value="{{vm.report.table}}.{{column}}">{{column}}</md-option>\n              \x3c!-- <md-option ng-repeat="column in vm.columns" ng-value="">{{column}}</md-option> --\x3e\n            </md-optgroup>\n            <md-optgroup ng-if="vm.report.joins" ng-repeat="join in vm.report.joins" label="{{join.foreignTable}}">\n              <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n            </md-optgroup>\n          </md-select>\n          <div ng-messages="reportForm.column.$error" ng-show="reportForm.column.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block" ng-switch-when="metric">\n          <label translate="ANALYTICS.METRIC_NAME">Metric Name</label>\n          <md-select name="metric" ng-model="vm.reportField.MetricId" required>\n            <md-option ng-repeat="metric in vm.metrics" ng-value="metric.id">{{metric.name}}</md-option>\n          </md-select>\n          <div ng-messages="reportForm.metric.$error" ng-show="reportForm.metric.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block" ng-switch-when="custom">\n          <label translate="ANALYTICS.CUSTOM_METRIC">Custom Metric</label>\n          <input type="text" name="field" ng-model="vm.reportField.field" required md-autofocus>\n          <div ng-messages="reportFieldForm.field.$error" ng-show="reportFieldForm.field.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="ANALYTICS.ERRORS.CUSTOM_METRIC_REQUIRED">Custom Metric field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.reportField.alias" ng-required="vm.reportField.type === \'custom\' || vm.reportField.type === \'metric\'">\n        <div ng-messages="reportFieldForm.alias.$error" ng-show="reportFieldForm.alias.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n        <label translate="ANALYTICS.FUNCTION">Function</label>\n        <md-select name="function" ng-model="vm.reportField.function">\n          <md-option ng-value="null">No Function</md-option>\n          <md-option ng-repeat="function in vm.sqlUtil.getFunctions" ng-value="function.value">{{function.value}}</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n        <label translate="ANALYTICS.FORMAT">Format</label>\n        <md-select name="format" ng-model="vm.reportField.format">\n          <md-option ng-value="null">No Format</md-option>\n          <md-option ng-repeat="format in vm.sqlUtil.getFormats" ng-value="format.value">{{format.value}}</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.GROUP_BY">Group By</label>\n        <md-select name="groupBy" ng-model="vm.reportField.groupBy">\n          <md-option ng-repeat="gb in vm.sqlUtil.getGroupBy" ng-value="gb.value">{{gb.value ? \'Yes\' : \'No\'}}</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.ORDER_BY">Order By</label>\n        <md-select name="orderBy" ng-model="vm.reportField.orderBy">\n          <md-option ng-value="null">No Order</md-option>\n          <md-option ng-repeat="ob in vm.sqlUtil.getOrderBy" ng-value="ob.value">{{ob.value}}</md-option>\n        </md-select>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newReportField" ng-click="vm.saveReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newReportField" ng-click="vm.addNewReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORTFIELD" translate-attr-aria-label="ANALYTICS.ADD_REPORTFIELD">\n          ADD REPORT FIELD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReportField" ng-click="vm.deleteReportField($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/view.html",'<div id="analytics-report" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-reports-button md-icon-button" aria-label="Go to reports" ng-click="vm.gotoReports()" translate translate-attr-aria-label="ANALYTICS.GO_TO_ANALYTICSQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="report-image" hide-xs>\n          <img ng-src="assets/images/business/reports.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.report.id}} {{vm.report.name}}\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="ANALYTICS.CREATED_AT"></span> <span>{{vm.report.createdAt | date:\'medium\'}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span>{{vm.report.description}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div>\n      <md-button type="submit" ng-click="vm.saveReport()" ng-disabled="generalForm.$pristine && conditionsForm.$pristine" class="send-button md-accent md-raised" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="ANALYTICS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="ANALYTICS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="ANALYTICS.NAME">Name</label>\n                <input type="text" name="name" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.name" required md-autofocus>\n                <div ng-messages="generalForm.name.$error" ng-show="generalForm.name.$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="ANALYTICS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.description">\n                <div ng-messages="generalForm.description.$error" ng-show="generalForm.description.$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="ANALYTICS.FIELDS">FIELDS</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container fields md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ReportFieldsController as vm_rf" ng-init="vm_rf.init(vm.report, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_rf.selectedReportFields.length">\n                <div class="md-toolbar-tools">\n                  <div layout="row" layout-align="start center">\n                    <div layout="column" layout-align="start start">\n                      <div class="md-subhead" translate="ANALYTICS.FIELDS">\n                        <span translate="ANALYTICS.FIELDS">FIELDS</span>\n                      </div>\n                      <div class="h4">\n                        <span translate="ANALYTICS.TABLE">TABLE</span> <span class="text-bold">{{vm.report.table}}</span>\n                      </div>\n                      <div class="h4" ng-if="vm.report.joins && vm.report.joins.length && vm.isArray(vm.report.joins)">\n                        <span>Join</span> <span class="text-bold">{{ vm.mapArray(vm.report.joins, \'foreignTable\') }}</span>\n                      </div>\n                    </div>\n                  </div>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm_rf.query.filter = query" on-collapse="vm_rf.query.filter = undefined" debounce="300"></ms-search-bar>\n                  <md-button class="md-icon-button" ng-if="vm_rf.crudPermissions.canEdit" ng-click="vm_rf.createOrEditReportField($event)" aria-label="add field" translate translate-attr-label="ANALYTICS.ADD_FIELD">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_rf.selectedReportFields.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_rf.selectedReportFields.length}} {{vm_rf.selectedReportFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_rf.deleteSelectedReportFields($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container>\n                <table md-table md-row-select="vm_rf.crudPermissions.canDelete" multiple ng-model="vm_rf.selectedReportFields" md-progress="vm_rf.promise">\n                  <thead md-head md-order="vm_rf.query.sort" md-on-reorder="vm_rf.getReportFields">\n                    <tr md-row>\n                      <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit">\n                        <md-icon md-font-icon="icon-drag-vertical"></md-icon>\n                      </th>\n                      <th md-column>Type</th>\n                      <th md-column>Column or Metric</th>\n                      <th md-column>Alias</th>\n                      <th md-column>Function</th>\n                      <th md-column>Format</th>\n                      <th md-column>Group By</th>\n                      <th md-column>Order By</th>\n                      <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body ng-sortable="vm_rf.sortableTable">\n                    <tr md-row md-select="reportField" md-select-id="id" ng-repeat="reportField in vm_rf.reportFields.rows">\n                      <td md-cell class="handle" ng-if="vm_rf.crudPermissions.canEdit">\n                        <md-icon md-font-icon="icon-drag-vertical" class="s16"></md-icon>\n                      </td>\n                      <td md-cell>\n                        <div ng-if="reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-shape-plus s16"></div>\n                        <div ng-if="!reportField.MetricId && reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-pencil-box-outline s16"></div>\n                        <div ng-if="!reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-view-column s16"></div>\n                      </td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.MetricId ? vm_rf.getMetricName(reportField.MetricId) : reportField.field}}</td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.alias}}</td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.function">{{reportField.function}}</span><span ng-if="!reportField.function">--</span></td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.format">{{reportField.format}}</span><span ng-if="!reportField.format">--</span></td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.groupBy">YES</span><span ng-if="!reportField.groupBy">--</span></td>\n                      <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.orderBy">{{reportField.orderBy}}</span><span ng-if="!reportField.orderBy">--</span></td>\n                      <td md-cell class="actions" ng-if="vm_rf.crudPermissions.canEdit">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_rf.createOrEditReportField($event, reportField)" translate="ANALYTICS.EDIT_REPORTFIELD">\n                                Edit Field\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item>\n                              <md-button ng-click="vm_rf.deleteConfirm(reportField, $event)" translate="ANALYTICS.DELETE_REPORTFIELD">\n                                Delete Field\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="ANALYTICS.CONDITIONS">CONDITIONS</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container conditions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ReportConditionsController as vm_rc" ng-init="vm_rc.init(vm.report, vm.crudPermissions)">\n              <div class="pb-16" layout="row" layout-align="start center">\n                <div class="h2 secondary-text" translate="ANALYTICS.CONDITION">CONDITION</div>\n              </div>\n              <form name="conditionsForm" novalidate>\n                <div ng-if="vm_rc.report.condition.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="group=vm_rc.report.condition.group"></div>\n              </form>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab md-on-select="vm.previewReport()">\n        <md-tab-label>\n          <span translate="ANALYTICS.PREVIEW">PREVIEW</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n              <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n            </div>\n            <dl ng-if="vm.error">\n              <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n              <dd>{{vm.error.sql}}</dd>\n              <dt translate="ANALYTICS.MESSAGE">Message</dt>\n              <dd>{{vm.error.msg}}</dd>\n            </dl>\n            <md-table-container ng-if="!vm.error">\n              <table md-table>\n                <thead md-head>\n                  <tr md-row>\n                    <th ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n                  </tr>\n                </thead>\n                <tbody md-body>\n                  <tr md-row ng-repeat="row in vm.rows">\n                    <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n                  </tr>\n                  <tr md-row ng-if="!vm.rows.length">\n                    <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n                  </tr>\n                </tbody>\n              </table>\n            </md-table-container>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab md-on-select="vm.queryReport()">\n        <md-tab-label>\n          <span>Query</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n              <div ng-if="!vm.error" class="h2 secondary-text">SQL</div>\n            </div>\n            <dl ng-if="vm.error">\n              <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n              <dd>{{vm.error.sql}}</dd>\n              <dt translate="ANALYTICS.MESSAGE">Message</dt>\n              <dd>{{vm.error.msg}}</dd>\n            </dl>\n            <div ng-if="!vm.error">\n              {{vm.queryResult}}\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/analytics/views/reports/preview/dialog.html",'<md-dialog aria-label="Run Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Preview Report</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n          <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n        </div>\n        <dl ng-if="vm.error">\n          <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n          <dd>{{vm.error.sql}}</dd>\n          <dt translate="ANALYTICS.MESSAGE">Message</dt>\n          <dd>{{vm.error.msg}}</dd>\n        </dl>\n        <md-table-container ng-if="!vm.error">\n          <table md-table md-progress="vm.promise">\n            <thead md-head>\n              <tr md-row>\n                <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-repeat="row in vm.rows">\n                <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n              </tr>\n              <tr md-row ng-if="!vm.rows.length">\n                <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div flex></div>\n      <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n        CLOSE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/reports.html",'<div id="reports" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="ANALYTICS.REPORTS">Reports</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedReports.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedReports =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="ANALYTICS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-reports-count">\n          <span>{{vm.selectedReports.length}}</span>\n          <span translate="ANALYTICS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllReports()" translate="ANALYTICS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectReports()" translate="ANALYTICS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedReports" csv-label="true" filename="reports.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom" class="md-icon-button" ng-click="vm.deleteSelectedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div layout="column" flex="30">\n      <md-card class="padding-top-5 padding-horizontal-10 padding-bottom-0">\n        \x3c!-- SEARCH --\x3e\n        <div layout="row" layout-align="start center">\n          <label for="searchFolder" class="m-0">\n            <md-icon md-font-icon="icon-magnify"></md-icon>\n          </label>\n          <md-input-container md-no-float class="margin-horizontal-0 margin-bottom-0 margin-top-10" flex>\n            <input id="searchFolder" placeholder="Search folder" type="text" ng-model="vm.search" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_FOLDER">\n          </md-input-container>\n        </div>\n        \x3c!-- / SEARCH --\x3e\n      </md-card>\n      <md-card class="padding-10 scrollable">\n        <div js-tree="vm.treeDefaultConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n      </md-card>\n      <md-card class="padding-10 scrollable">\n        <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n      </md-card>\n    </div>\n    <md-card flex="70">\n      <md-toolbar class="md-table-toolbar md-default">\n        <div class="md-toolbar-tools">\n          <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n          <p ng-if="vm.currentPath">\n            <span class="text-boxed">{{vm.currentPath}}</span>\n          </p>\n          <div flex></div>\n          <ms-search-bar on-search="vm.getReports()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n          <div flow-init flow-file-added="vm.importReport($file, $event, $flow)">\n            <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" aria-label="import report" translate translate-attr-label="ANALYTICS.IMPORT_REPORT" flow-btn>\n              <md-icon md-font-icon="icon-upload"></md-icon>\n            </md-button>\n          </div>\n          <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" ng-click="vm.createOrEditReport($event)" aria-label="add report" translate translate-attr-label="ANALYTICS.ADD_REPORT">\n            <md-icon md-font-icon="icon-plus"></md-icon>\n          </md-button>\n        </div>\n      </md-toolbar>\n      <md-table-container>\n        <table md-table md-row-select multiple ng-model="vm.selectedReports" md-progress="vm.promise">\n          <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n            <tr md-row>\n              <th md-column md-order-by="id" width="10px">{{ \'ANALYTICS.ID\' | translate }}</th>\n              <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n              <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n              <th md-column md-order-by="createdAt">{{ \'ANALYTICS.CREATED_AT\' | translate }}</th>\n              <th md-column width="10px"></th>\n            </tr>\n          </thead>\n          <tbody md-body>\n            <tr md-row ng-hide="vm.reports.rows.length">\n              <td md-cell colspan="5">\n                <div layout="row" layout-align="center center">\n                  <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                </div>\n              </td>\n            </tr>\n            <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n              <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="id">{{report.id}}</td>\n              <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="name">{{report.name}}</td>\n              <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="description">{{report.description}}</td>\n              <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="createdAt">{{report.createdAt | date:\'medium\'}}</td>\n              <td md-cell class="actions">\n                <md-menu>\n                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                  </md-button>\n\n                  <md-menu-content width="3">\n                    <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                      <md-button ng-click="vm.copydialog(report, $event)" translate="ANALYTICS.COPY_REPORT">\n                        Copy Report\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item>\n                      <md-button ng-click="vm.previewdialog(report, $event)" translate="ANALYTICS.PREVIEW_REPORT">\n                        Preview Report\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item>\n                      <md-button ng-click="vm.rundialog(report, $event)" translate="ANALYTICS.RUN_REPORT">\n                        Run Report\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item>\n                      <md-button ng-click="vm.downloadfile(report, $event)" translate="ANALYTICS.DOWNLOAD_JSON_REPORT">\n                        Download Json Report\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete && vm.currentNode.custom">\n                    </md-menu-divider>\n                    <md-menu-item ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom">\n                      <md-button ng-click="vm.editstate(report, $event)" translate="ANALYTICS.EDIT_REPORT">\n                        Edit Report\n                      </md-button>\n                    </md-menu-item>\n\n                    <md-menu-item ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom">\n                      <md-button ng-click="vm.deleteconfirm(report, $event)" translate="ANALYTICS.DELETE_REPORT">\n                        Delete Report\n                      </md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </td>\n            </tr>\n          </tbody>\n        </table>\n      </md-table-container>\n\n      <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.reports.count}}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n    </md-card>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/run/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="ANALYTICS.RUN_REPORT">Run Report</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.NAME">Name</label>\n        <input name="name" ng-model="vm.export.name" required md-autofocus>\n        <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="ANALYTICS.FORMAT">FORMAT</label>\n        <md-select name="format" ng-model="vm.export.output" required>\n          <md-option value="csv">CSV</md-option>\n          <md-option value="xlsx">Excel (XLSX)</md-option>\n          <md-option value="pdf">PDF</md-option>\n          <md-option value="web">Web</md-option>\n        </md-select>\n        <div ng-messages="reportForm.format.$error" ng-show="reportForm.format.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="ANALYTICS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div layout="row">\n        <div class="md-block" flex>\n          <mdp-date-picker mdp-open-on-click required name="dateRangeFrom" mdp-placeholder="Date Range From" mdp-format="YYYY-MM-DD" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n            <div ng-messages="reportForm.dateRangeFrom.$error" ng-show="reportForm.dateRangeFrom.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_REQUIRED">Date Range From field is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n              </div>\n              <div ng-message="maxDate">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MAX_INVALID">Date Range From Max field is invalid</span>\n              </div>\n            </div>\n          </mdp-date-picker>\n        </div>\n        <div class="md-block" flex>\n          <mdp-date-picker mdp-open-on-click required name="dateRangeTo" mdp-placeholder="Date Range To" mdp-format="YYYY-MM-DD" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n            <div ng-messages="reportForm.dateRangeTo.$error" ng-show="reportForm.dateRangeTo.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_REQUIRED">Date Range From field is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_INVALID">Date Range From field is invalid</span>\n              </div>\n              <div ng-message="minDate">\n                <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MIN_INVALID">Date Range From Min field is invalid</span>\n              </div>\n            </div>\n          </mdp-date-picker>\n        </div>\n      </div>\n      <div layout="row">\n        <div class="md-block" flex>\n          <mdp-time-picker required name="timeRangeFrom" mdp-placeholder="Time Range From" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n            <div ng-messages="reportForm.timeRangeFrom.$error" ng-show="reportForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_REQUIRED">Time Range From field is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex>\n          <mdp-time-picker required name="timeRangeTo" mdp-placeholder="Time Range To" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n            <div ng-messages="reportForm.timeRangeTo.$error" ng-show="reportForm.timeRangeTo.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range From field is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.runReport($event)" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid" aria-label="RUN" translate="ANALYTICS.RUN_REPORT" translate-attr-aria-label="ANALYTICS.RUN_REPORT">\n          RUN REPORT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-click="vm.refreshDate()" aria-label="REFRESH" translate translate-attr-aria-label="ANALYTICS.REFRESH">\n          <md-icon md-font-icon="icon-refresh"></md-icon>\n          <md-tooltip><span translate="ANALYTICS.REFRESH">REFRESH</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/run/web/dialog.html",'<md-dialog class="web-dialog" aria-label="Show Report">\n  <form name="reportForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="ANALYTICS.WEB_REPORT">Web Report</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n        </div>\n        <dl ng-if="vm.error">\n          <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n          <dd>{{vm.error.sql}}</dd>\n          <dt translate="ANALYTICS.MESSAGE">Message</dt>\n          <dd>{{vm.error.msg}}</dd>\n        </dl>\n        <md-table-container ng-if="!vm.error">\n          <table md-table md-progress="vm.promise">\n            <thead md-head>\n              <tr md-row>\n                <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-repeat="row in vm.results.rows">\n                <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n              </tr>\n              <tr md-row ng-if="!vm.results.rows.length">\n                <td md-cell colspan="{{vm.columns.length}}">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_DATA">NO DATA</span>\n                  </div>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div flex></div>\n      <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n        CLOSE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/create/dialog.html",'<md-dialog class="odbc-dialog" aria-label="New Odbc">\n  <form name="odbcForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.odbc.name" ng-required="true" autofocus>\n\n        <div ng-messages="odbcForm[\'name\'].$error" ng-show="odbcForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.DSN">DSN</label>\n        <input type="text" name="dsn" ng-model="vm.odbc.dsn" ng-required="true">\n\n        <div class="hint"><span translate="CALLYSQUARE.HELP.DSN"></span></div>\n        <div ng-messages="odbcForm[\'dsn\'].$error" ng-show="odbcForm[\'dsn\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.DSN_REQUIRED">DSN field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.odbc.description">\n\n        <div ng-messages="odbcForm[\'description\'].$error" ng-show="odbcForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOdbc" ng-click="vm.saveOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid || odbcForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOdbc" ng-click="vm.addNewOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_ODBC" translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n          ADD ODBC\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOdbc" ng-click="vm.deleteOdbc($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/odbcs.html",'<div id="odbcs" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CALLYSQUARE.ODBC">ODBC</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedODBC.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedODBC =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CALLYSQUARE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-odbcs-count">\n          <span>{{vm.selectedODBC.length}}</span>\n          <span translate="CALLYSQUARE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllODBC()" translate="CALLYSQUARE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectODBC()" translate="CALLYSQUARE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedODBC" csv-label="true" filename="odbcs.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedODBC($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- ODBC TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedODBC" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getODBC">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n                <th md-column md-order-by="dsn">{{ \'CALLYSQUARE.DSN\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.odbcs.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="odbc" md-select-id="id" ng-repeat="odbc in vm.odbcs.rows">\n                <td md-cell ng-if="odbc.userpic"><img class="avatar" alt="{{odbc.name}}" ng-src="api/users/{{odbc.id}}/avatar" /></td>\n                <td md-cell ng-if="!odbc.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{odbc.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="id ">{{odbc.id}}</td>\n                <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="name ">{{odbc.name}}</td>\n                <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="dsn ">{{odbc.dsn}}</td>\n                <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="description ">{{odbc.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(odbc, $event    )" translate="CALLYSQUARE.EDIT_ODBC">\n                          Edit Odbc\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestOdbc(odbc, $event    )" translate="CALLYSQUARE.TEST_ODBC">\n                          Test Odbc\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(odbc, $event    )" translate="CALLYSQUARE.DELETE_ODBC">\n                          Delete Odbc\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.odbcs.count}}" md-on-paginate="vm.getODBC" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / ODBC TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD ODBC BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-odbc-button" ng-click="vm.createOrEditOdbc($event)" aria-label="add odbc" translate translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD ODBC BUTTON --\x3e\n</div>'),e.put("app/main/apps/callysquare/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n  <form name="projectForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{vm.title | translate}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.NAME">Name</label>\n        <input name="name" ng-model="vm.project.name" required md-autofocus ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-disabled="!vm.newProject">\n        <div ng-messages="projectForm.name.$error" ng-show="projectForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n        <input name="description" ng-model="vm.project.description">\n        <div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.openFromEditor" class="md-block">\n        \x3c!-- Added to check if I\'m opening the dialog directly from the square editor --\x3e\n        <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="ADD" translate="CALLYSQUARE.ADD_PROJECT" translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n          ADD PROJECT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",'<md-dialog class="project-dialog" aria-label="New dialog" ng-init="vm.onInit()">\n  <form name="dialogForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.EDIT"></span> <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block" ng-repeat="attribute in vm.attributes" ng-switch="attribute.name">\n        <label translate="CALLYSQUARE.{{attribute.name | uppercase}}">{{attribute.name | ucfirst }}</label>\n\n        \x3c!--  START SELECT INPUT --\x3e\n        <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_cloud_tts_text_type|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|aws_lex_region|sms_account_id|findBy|pause_id|aws_text_type|dialogflow_language|ndagenerate_audio|ndaactivity_type|languageCode|ssmlGender|method|dialogflowV2_language" ng-required="attribute.required">\n          <md-option ng-if="attribute.defaultValue" ng-value="\'\'"> - None - </md-option>\n          <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n          <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n        </md-select>\n        \x3c!--  END SELECT INPUT --\x3e\n\n        \x3c!--  START SELECT INPUT --\x3e\n        <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="sip_id" ng-required="attribute.required">\n          <md-optgroup label="{{\'CALLYSQUARE.AGENTS\' | translate}}">\n            <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'agent\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{\'CALLYSQUARE.TELEPHONES\' | translate}}">\n            <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'telephone\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{\'CALLYSQUARE.USERS\' | translate}}">\n            <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'admin\' || v.group === \'user\'">{{v.option}}</md-option>\n          </md-optgroup>\n          <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n        </md-select>\n        \x3c!--  END SELECT INPUT --\x3e\n\n        \x3c!--  START NUMBER INPUT --\x3e\n        <div ng-switch-when="timeout">\n          <div ng-switch="vm.cellName">\n            <input ng-switch-when-separator="|" ng-switch-when="answer|ext_dial|dial|queue" type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n            <input ng-switch-when-separator="|" ng-switch-when="record|ispeechasr|googleasr" type="number" step="any" name="{{attribute.name}}" min="-1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n            <input ng-switch-when-separator="|" ng-switch-when="restapi" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n            <input ng-switch-default type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n          </div>\n        </div>\n        <input ng-switch-when-separator="|" ng-switch-when="speed" type="number" step="any" name="{{attribute.name}}" min="-10" max="-10" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n        <input ng-switch-when-separator="|" ng-switch-when="maxdigit|mindigit|digit" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n        <input ng-switch-when-separator="|" ng-switch-when="retry|response|hiddendigitsnum|priority" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n        \x3c!--  END NUMBER INPUT --\x3e\n\n        \x3c!--  START TEXTAREA INPUT --\x3e\n        <textarea name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="query|sms_text|condition|text|custom_action_data|headers|body|rawHeaders|rawBody|private_key" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n        \x3c!--  END TEXTAREA INPUT --\x3e\n\n        \x3c!-- START URL INPUT --\x3e\n        <input ng-switch-when-separator="|" ng-switch-when="ndauth_url|ndassistant_url|url" type="url" name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required">\n        \x3c!-- END URL INPUT --\x3e\n\n        \x3c!--  START TEXT INPUT --\x3e\n        <input ng-switch-default name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit">\n        <div class=\'hint\' ng-if="attribute.name === \'text\' && vm.cellName === \'tts\' ">\n          <span translate="CALLYSQUARE.HELP.MAX_TEXT_TTS" class="ng-scope">Max 250 chars are supported</span>\n        </div>\n        \x3c!--  END TEXT INPUT--\x3e\n\n        <div class="hint" ng-if="attribute.help">\n          <span translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"></span>\n        </div>\n        <div ng-messages="dialogForm[attribute.name].$error" ng-show="dialogForm[attribute.name].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED">The field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="vm.crudPermissions.canEdit">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="dialogForm.$invalid || dialogForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/edit/edit.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="editForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.EDIT_XML"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label>XML</label>\n        <textarea name="preproduction" ng-model="vm.project.preproduction"></textarea>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="editForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/import/import.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="importForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.IMPORT_XML"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div id="xml-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-file-added="vm.fileAdded($file)" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n        <div class="drop-text hint-text" layout="row" layout-align="center center">\n          <span translate="CALLYSQUARE.DROP_TO_UPLOAD">Drop to upload</span>\n        </div>\n\n        <div class="upload-button" layout="column" layout-align="center center">\n          <md-button class="md-accent md-raised" flow-btn>\n            Upload\n          </md-button>\n          <span class="secondary-text mt-8" translate="CALLYSQUARE.DROP_TO_UPLOAD_MESSAGE">You can also drop files here to upload. Only XML - Max. 5MB</span>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" ng-disabled="importForm.$invalid" aria-label="CLOSE" translate="CALLYSQUARE.CLOSE" translate-attr-aria-label="CALLYSQUARE.CLOSE">\n          CLOSE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/info/info.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="descriptionFrom" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.UPDATE_INFO"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n        <input name="description" ng-model="vm.project.description" md-autofocus>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.NOTES">Description</label>\n        <textarea name="notes" ng-model="vm.project.notes"></textarea>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="descriptionFrom.$invalid" aria-label="SAVE" translate="CALLYSQUARE.UPDATE_INFO" translate-attr-aria-label="CALLYSQUARE.UPDATE">\n          UPDATE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/open/open.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="openForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.OPEN_PROJECT"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.PROJECT">Project</label>\n        <md-select name="id" ng-model="vm.id" required>\n          <md-option value="{{p.id}}" ng-repeat="p in vm.projects">{{p.name}}</md-option>\n        </md-select>\n        <div ng-messages="openForm.id.$error" ng-show="openForm.id.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.PROJECT_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="openForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.OPEN_PROJECT" translate-attr-aria-label="CALLYSQUARE.OPEN">\n          OPEN\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/permissionadd/permissionadd.html",'<md-dialog class="projects-dialog" aria-label="projects">\n  <form name="projectsForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CALLYSQUARE.PERMISSIONADD_PROJECTS">Add User Permissions</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n  <form name="newForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title"><span translate="CALLYSQUARE.COPY_PROJECT"></span></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.NAME">Name</label>\n        <input name="name" ng-model="vm.project.name" required md-autofocus>\n        <div ng-messages="newForm.name.$error" ng-show="newForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="newForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.COPY_PROJECT" translate-attr-aria-label="CALLYSQUARE.COPY">\n          COPY\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/view.html",'<div id="callysquare-project" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="CALLYSQUARE.GO_TO_PROJECTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="project-image" hide-xs>\n          <img ng-src="assets/images/business/cprojects.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.project.id}} {{vm.project.name}}\n          </div>\n          <div class="subtitle secondary-text text-truncate">\n            <span ng-if="vm.project.description">{{vm.project.description}} - </span><span translate="CALLYSQUARE.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-if="vm.crudPermissions.canEdit" ng-click="vm.updateInfo($event)" class="md-fab md-yellow-700-bg md-icon-button" aria-label="edit">\n        <md-icon md-font-icon="icon-tooltip-edit"></md-icon>\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <md-content class="callysquare-content">\n\n    <div id="geEditor" class="geEditor"></div>\n\n  </md-content>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-vector-square" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CALLYSQUARE.PROJECTS">Projects</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    \x3c!-- SEARCH --\x3e\n    <div class="search-input-wrapper" layout="row" layout-align="start center">\n      <label for="search">\n        <md-icon md-font-icon="icon-magnify"></md-icon>\n      </label>\n      <md-input-container md-no-float class="m-0">\n        <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n      </md-input-container>\n    </div>\n    \x3c!-- / SEARCH --\x3e\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CALLYSQUARE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-projects-count">\n          <span>{{vm.selectedProjects.length}}</span>\n          <span translate="CALLYSQUARE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllProjects()" translate="CALLYSQUARE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectProjects()" translate="CALLYSQUARE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      \x3c!-- PROJECT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="notes">{{ \'CALLYSQUARE.NOTES\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.projects.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="notes ">{{project.notes}}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editstate(project, ev)" translate="CALLYSQUARE.EDIT_PROJECT">\n                          Edit Project\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteconfirm(project, ev)" translate="CALLYSQUARE.DELETE_PROJECT">\n                          Delete Project\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / PROJECT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD PROJECT BUTTON --\x3e\n  <md-button class="md-fab md-accent md-icon-button" id="add-project-button" ng-if="vm.crudPermissions.canEdit" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD PROJECT BUTTON --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/squareRecordings/create/dialog.html",'<md-dialog class="squareRecording-dialog" aria-label="New SquareRecording">\n  <form name="squareRecordingForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CALLYSQUARE.FILENAME">Filename</label>\n        <input type="" name="filename" ng-model="vm.squareRecording.filename" ng-required="true" autofocus>\n\n        <div ng-messages="squareRecordingForm[\'filename\'].$error" ng-show="squareRecordingForm[\'filename\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CALLYSQUARE.ERRORS.FILENAME_REQUIRED">Filename field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSquareRecording" ng-click="vm.saveSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid || squareRecordingForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSquareRecording" ng-click="vm.addNewSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_SQUARERECORDING" translate-attr-aria-label="CALLYSQUARE.ADD_SQUARERECORDING">\n          ADD SQUARERECORDING\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSquareRecording" ng-click="vm.deleteSquareRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",'<div id="squareRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CALLYSQUARE.SQUARERECORDINGS">SquareRecordings</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSquareRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSquareRecordings =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CALLYSQUARE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-squareRecordings-count">\n          <span>{{vm.selectedSquareRecordings.length}}</span>\n          <span translate="CALLYSQUARE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSquareRecordings()" translate="CALLYSQUARE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSquareRecordings()" translate="CALLYSQUARE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSquareRecordings" csv-label="true" filename="squareRecordings.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSquareRecordings($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SQUARERECORDING TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSquareRecordings" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSquareRecordings">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="filename">{{ \'CALLYSQUARE.FILENAME\' | translate }}</th>\n                <th md-column md-order-by="projectName">{{ \'CALLYSQUARE.PROJECT\' | translate }}</th>\n                <th md-column md-order-by="uniqueid">{{ \'CALLYSQUARE.UNIQUEID\' | translate }}</th>\n                <th md-column md-order-by="callerid">{{ \'CALLYSQUARE.PHONE\' | translate }}</th>\n                <th md-column md-order-by="extension">{{ \'CALLYSQUARE.EXTEN\' | translate }}</th>\n                <th md-column>{{ \'CALLYSQUARE.AUDIO\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'CALLYSQUARE.CREATED_AT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.squareRecordings.rows.length">\n                <td md-cell colspan="8">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="squareRecording" md-select-id="id" ng-repeat="squareRecording in vm.squareRecordings.rows">\n                <td md-cell ng-if="squareRecording.userpic"><img class="avatar" alt="{{squareRecording.name}}" ng-src="api/users/{{squareRecording.id}}/avatar" /></td>\n                <td md-cell ng-if="!squareRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{squareRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="filename ">{{squareRecording.filename}}</td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="projectName ">{{squareRecording.projectName}}</td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="uniqueid ">{{squareRecording.uniqueid}}</td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="callerid ">{{squareRecording.callerid}}</td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="extension ">{{squareRecording.extension}}</td>\n                <td md-cell class="audio " ng-switch="squareRecording.format">\n                  \x3c!-- audio recording directive --\x3e\n                  <ms-recording ng-switch-when=".wav" id="squareRecording.id" model="\'squareRecording\'"></ms-recording>\n                  \x3c!-- / audio recording directive --\x3e\n                  <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n                    <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n                  </span>\n                </td>\n                <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="createdAt ">{{squareRecording.createdAt | date:\'medium\' }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadCallySquareRecordings">\n\n                        <md-button ng-click="vm.downloadfile2(squareRecording, $event  , \'square/recordings\'   )" translate="CALLYSQUARE.DOWNLOAD_SQUARERECORDING">\n                          Download SquareRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(squareRecording, $event    )" translate="CALLYSQUARE.DELETE_SQUARERECORDING">\n                          Delete SquareRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.squareRecordings.count}}" md-on-paginate="vm.getSquareRecordings" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SQUARERECORDING TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/chatQueues.html",'<div id="chatQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CHAT.CHATQUEUES">ChatQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedChatQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedChatQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CHAT.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-chatQueues-count">\n          <span>{{vm.selectedChatQueues.length}}</span>\n          <span translate="CHAT.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHAT.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllChatQueues()" translate="CHAT.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectChatQueues()" translate="CHAT.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedChatQueues" csv-label="true" filename="chatQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatQueues($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CHATQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedChatQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'CHAT.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.chatQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="chatQueue" md-select-id="id" ng-repeat="chatQueue in vm.chatQueues.rows">\n                <td md-cell ng-if="chatQueue.userpic"><img class="avatar" alt="{{chatQueue.name}}" ng-src="api/users/{{chatQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!chatQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="id ">{{chatQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="name ">{{chatQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="strategy ">{{ vm.arraystrategy[chatQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(chatQueue, $event    )" translate="CHAT.EDIT_CHATQUEUE">\n                          Edit ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(chatQueue, $event    )" translate="CHAT.TEAMADD_CHATQUEUE">\n                          teamadd ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(chatQueue, $event    )" translate="CHAT.AGENTADD_CHATQUEUE">\n                          agentadd ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(chatQueue, $event    )" translate="CHAT.DELETE_CHATQUEUE">\n                          Delete ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(chatQueue, $event    )" translate="CHAT.GOTOREALTIME_CHATQUEUE">\n                          goToRealtime ChatQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatQueues.count}}" md-on-paginate="vm.getChatQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CHATQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CHATQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatQueue-button" ng-click="vm.createOrEditChatQueue($event)" aria-label="add chatQueue" translate translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CHATQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/create/dialog.html",'<md-dialog class="chatQueue-dialog" aria-label="New ChatQueue">\n  <form name="chatQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newChatQueue">\n\n        <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n        <div ng-messages="chatQueueForm[\'name\'].$error" ng-show="chatQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="chatQueueForm[\'strategy\'].$error" ng-show="chatQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="chatQueueForm[\'timeout\'].$error" ng-show="chatQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.chatQueue.description">\n\n        <div ng-messages="chatQueueForm[\'description\'].$error" ng-show="chatQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatQueue" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid || chatQueueForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatQueue" ng-click="vm.addNewChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATQUEUE" translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n          ADD CHATQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatQueue" ng-click="vm.deleteChatQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n  <form name="chatQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CHAT.AGENTADD_CHATQUEUE">Add Agent to chatQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n  <form name="chatQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CHAT.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/view.html",'<div id="chat-chatQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-chatQueues-button md-icon-button" aria-label="Go to chatQueues" ng-click="vm.gotoChatQueues()" translate translate-attr-aria-label="CHAT.GO_TO_CHATQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="chatQueue-image" hide-xs>\n          <img ng-src="assets/images/business/chatQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.chatQueue.id}}\n            <span ng-if="vm.chatQueue.name">{{vm.chatQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.chatQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="CHAT.TEAMADD_CHATQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.chatQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="CHAT.AGENTADD_CHATQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveChatQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.chatQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.chatQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/chatWebsites.html",'<div id="chatWebsites" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CHAT.CHATWEBSITES">ChatWebsites</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedChatWebsites.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedChatWebsites =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CHAT.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-chatWebsites-count">\n          <span>{{vm.selectedChatWebsites.length}}</span>\n          <span translate="CHAT.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHAT.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllChatWebsites()" translate="CHAT.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectChatWebsites()" translate="CHAT.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedChatWebsites" csv-label="true" filename="chatWebsites.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatWebsites($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CHATWEBSITE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedChatWebsites" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatWebsites">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n                <th md-column md-order-by="address">{{ \'CHAT.MOTIONADDRESS\' | translate }}</th>\n                <th md-column md-order-by="remote">{{ \'CHAT.MOTIONPROXY\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.chatWebsites.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="chatWebsite" md-select-id="id" ng-repeat="chatWebsite in vm.chatWebsites.rows">\n                <td md-cell ng-if="chatWebsite.userpic"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="api/users/{{chatWebsite.id}}/avatar" /></td>\n                <td md-cell ng-if="!chatWebsite.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="id ">{{chatWebsite.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="name ">{{chatWebsite.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="key ">{{chatWebsite.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="address ">{{chatWebsite.address}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="remote ">{{chatWebsite.remote}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="description ">{{chatWebsite.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(chatWebsite, $event    )" translate="CHAT.EDIT_CHATWEBSITE">\n                          Edit ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(chatWebsite, $event    )" translate="CHAT.INTERACTIONS_CHATWEBSITE">\n                          Interactions ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.offlinemessagesgoto(chatWebsite, $event    )" translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE">\n                          OfflineMessages ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(chatWebsite, $event    )" translate="CHAT.AGENTADD_CHATWEBSITE">\n                          AgentAdd ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(chatWebsite, $event    )" translate="CHAT.DELETE_CHATWEBSITE">\n                          Delete ChatWebsite\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatWebsites.count}}" md-on-paginate="vm.getChatWebsites" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CHATWEBSITE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CHATWEBSITE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatWebsite-button" ng-click="vm.createOrEditChatWebsite($event)" aria-label="add chatWebsite" translate translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CHATWEBSITE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/create/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="!vm.newChatWebsite">\n\n        <div ng-messages="chatWebsiteForm[\'name\'].$error" ng-show="chatWebsiteForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="chatWebsiteForm[\'key\'].$error" ng-show="chatWebsiteForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n        <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n\n        <div ng-messages="chatWebsiteForm[\'address\'].$error" ng-show="chatWebsiteForm[\'address\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n        <input type="url" name="remote" ng-model="vm.chatWebsite.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n        <div ng-messages="chatWebsiteForm[\'remote\'].$error" ng-show="chatWebsiteForm[\'remote\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n        <div ng-messages="chatWebsiteForm[\'ListId\'].$error" ng-show="chatWebsiteForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.INTERVAL">Interval</label>\n        <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId">\n          <md-option ng-value="null">Always</md-option>\n          <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteForm[\'IntervalId\'].$error" ng-show="chatWebsiteForm[\'IntervalId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.chatWebsite.description">\n\n        <div ng-messages="chatWebsiteForm[\'description\'].$error" ng-show="chatWebsiteForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatWebsite" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid || chatWebsiteForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatWebsite" ng-click="vm.addNewChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATWEBSITE" translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n          ADD CHATWEBSITE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatWebsite" ng-click="vm.deleteChatWebsite($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",'<md-dialog class="chatWebsite-dialog" aria-label="chatWebsite" ng-init="vm.onInit()">\n  <form name="chatWebsiteForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CHAT.AGENTADD_CHATWEBSITE">Add Agent to chatWebsite</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/agent/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'agent\'].$error" ng-show="chatWebsiteFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/amazonlex/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.ACCESSKEYID">accesskeyid</label>\n        <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'accesskeyid\'].$error" ng-show="chatWebsiteFormApp[\'accesskeyid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.SECRETACCESSKEY">secretaccesskey</label>\n        <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'secretaccesskey\'].$error" ng-show="chatWebsiteFormApp[\'secretaccesskey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.LEXREGION">lexregion</label>\n        <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n          <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n          <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n          <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'lexregion\'].$error" ng-show="chatWebsiteFormApp[\'lexregion\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.BOTNAME">botname</label>\n        <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'botname\'].$error" ng-show="chatWebsiteFormApp[\'botname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/autoreply/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'times\'].$error" ng-show="chatWebsiteFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TEXT">Text</label>\n        <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n        <div ng-messages="chatWebsiteFormApp[\'text\'].$error" ng-show="chatWebsiteFormApp[\'text\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TEXT_REQUIRED">Text field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/close/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'disposition\'].$error" ng-show="chatWebsiteFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflow/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'key\'].$error" ng-show="chatWebsiteFormApp[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n          <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'sv\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.PROJECTID">ProjectID</label>\n        <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'projectId\'].$error" ng-show="chatWebsiteFormApp[\'projectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.CLIENTEMAIL">ClientEmail</label>\n        <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'clientEmail\'].$error" ng-show="chatWebsiteFormApp[\'clientEmail\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.PRIVATEKEY">PrivateKey</label>\n        <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n        <div ng-messages="chatWebsiteFormApp[\'privateKey\'].$error" ng-show="chatWebsiteFormApp[\'privateKey\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n          <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n          <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n          <md-option ng-value="\'en-IN\'">English (India)</md-option>\n          <md-option ng-value="\'en-US\'">English (US)</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n          <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'hi\'">Hindi</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pl\'">Polish</md-option>\n          <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n          <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n          <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n          <md-option ng-value="\'sw\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'tr\'">Turkish</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotoif/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'condition\'].$error" ng-show="chatWebsiteFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'truepriority\'].$error" ng-show="chatWebsiteFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'falsepriority\'].$error" ng-show="chatWebsiteFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'priority\'].$error" ng-show="chatWebsiteFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/noop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'value\'].$error" ng-show="chatWebsiteFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/queue/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'queue\'].$error" ng-show="chatWebsiteFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/system/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'command\'].$error" ng-show="chatWebsiteFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'variable\'].$error" ng-show="chatWebsiteFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tag/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="chatWebsiteFormApp[\'tag\'].$error" ng-show="chatWebsiteFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tvox/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n  <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.SERVICEID">serviceid</label>\n        <input type="text" name="serviceid" ng-model="vm.tvox.serviceid" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'serviceid\'].$error" ng-show="chatWebsiteFormApp[\'serviceid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.SERVICEID_REQUIRED">serviceid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.CHANNELID">channelid</label>\n        <input type="text" name="channelid" ng-model="vm.tvox.channelid" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'channelid\'].$error" ng-show="chatWebsiteFormApp[\'channelid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.CHANNELID_REQUIRED">channelid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXURL">tvoxurl</label>\n        <input type="text" name="tvoxurl" ng-model="vm.tvox.tvoxurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'tvoxurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxurl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TVOXURL_REQUIRED">tvoxurl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXLOGINURL">tvoxloginurl</label>\n        <input type="text" name="tvoxloginurl" ng-model="vm.tvox.tvoxloginurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'tvoxloginurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxloginurl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TVOXLOGINURL_REQUIRED">tvoxloginurl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXSESSIONURL">tvoxsessionurl</label>\n        <input type="text" name="tvoxsessionurl" ng-model="vm.tvox.tvoxsessionurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'tvoxsessionurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxsessionurl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TVOXSESSIONURL_REQUIRED">tvoxsessionurl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXUSERNAME">tvoxusername</label>\n        <input type="text" name="tvoxusername" ng-model="vm.tvox.tvoxusername" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'tvoxusername\'].$error" ng-show="chatWebsiteFormApp[\'tvoxusername\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TVOXUSERNAME_REQUIRED">tvoxusername field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TVOXPASSWD">tvoxpasswd</label>\n        <input type="password" name="tvoxpasswd" ng-model="vm.tvox.tvoxpasswd" placeholder="Password" translate translate-attr-placeholder="CHAT.PASSWORD">\n        <div ng-messages="chatWebsiteFormApp[\'tvoxpasswd\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="CHAT.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONURLONRING">motionurlonring</label>\n        <input type="text" name="motionurlonring" ng-model="vm.tvox.motionurlonring" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'motionurlonring\'].$error" ng-show="chatWebsiteFormApp[\'motionurlonring\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONURLONRING_REQUIRED">motionurlonring field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONURLONANSWER">motionurlonanswer</label>\n        <input type="text" name="motionurlonanswer" ng-model="vm.tvox.motionurlonanswer" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'motionurlonanswer\'].$error" ng-show="chatWebsiteFormApp[\'motionurlonanswer\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONURLONANSWER_REQUIRED">motionurlonanswer field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONTITLE">motiontitle</label>\n        <input type="text" name="motiontitle" ng-model="vm.tvox.motiontitle" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'motiontitle\'].$error" ng-show="chatWebsiteFormApp[\'motiontitle\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONTITLE_REQUIRED">motiontitle field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.MOTIONURL">motionurl</label>\n        <input type="text" name="motionurl" ng-model="vm.tvox.motionurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="chatWebsiteFormApp[\'motionurl\'].$error" ng-show="chatWebsiteFormApp[\'motionurl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.MOTIONURL_REQUIRED">motionurl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",'<md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">\n  <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.chatCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="chatCannedAnswerForm[\'key\'].$error" ng-show="chatCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.chatCannedAnswer.value" required></textarea>\n\n        <div ng-messages="chatCannedAnswerForm[\'value\'].$error" ng-show="chatCannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.chatCannedAnswer.description">\n\n        <div ng-messages="chatCannedAnswerForm[\'description\'].$error" ng-show="chatCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatCannedAnswer" ng-click="vm.saveChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatCannedAnswer" ng-click="vm.addNewChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATCANNEDANSWER" translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER">\n          ADD CHATCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatCannedAnswer" ng-click="vm.deleteChatCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",'<md-dialog class="offlineMessage-dialog" aria-label="New OfflineMessage">\n  <md-toolbar class="md-accent md-hue-2">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n      <span class="title">{{ vm.title | translate }}</span>\n      <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-content flex layout-padding>\n    <pre ng-if="vm.isHtml">{{vm.message.body}}</pre>\n    <div ng-if="!vm.isHtml" ng-bind-html-unsafe="vm.message.body"></div>\n\n    <span ng-repeat="attachment in vm.attachments">\n      <md-button class="md-icon-button no-margin no-padding" ng-click="vm.download(attachment)">\n        <md-icon class="no-margin material-icons" aria-label="Attachment">attach_file</md-icon>\n      </md-button>\n      <span>{{attachment.name}}</span><br />\n    </span>\n  </md-content>\n\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",'<md-dialog class="chatProactiveAction-dialog" aria-label="New ChatProactiveAction">\n  <form name="chatProactiveActionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CHAT.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.chatProactiveAction.name" ng-required="true" autofocus>\n\n        <div ng-messages="chatProactiveActionForm[\'name\'].$error" ng-show="chatProactiveActionForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CHAT.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.chatProactiveAction.type">\n\n          <md-option ng-value="\'mouseOver\'"> {{ \'CHAT.MOUSEOVER\' | translate }} </md-option>\n\n          <md-option ng-value="\'timeout\'"> {{ \'CHAT.TIMEOUT\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="chatProactiveActionForm[\'type\'].$error" ng-show="chatProactiveActionForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.chatProactiveAction.type === \'mouseOver\'" class="md-block">\n        <label translate="CHAT.SELECTOR">Selector</label>\n        <input type="" name="selector" ng-model="vm.chatProactiveAction.selector" ng-required="true">\n\n        <div ng-messages="chatProactiveActionForm[\'selector\'].$error" ng-show="chatProactiveActionForm[\'selector\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.SELECTOR_REQUIRED">Selector field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.chatProactiveAction.type === \'timeout\'" class="md-block">\n        <label translate="CHAT.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.chatProactiveAction.timeout" min="1" ng-required="true">\n\n        <div ng-messages="chatProactiveActionForm[\'timeout\'].$error" ng-show="chatProactiveActionForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatProactiveAction" ng-click="vm.saveChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid || chatProactiveActionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatProactiveAction" ng-click="vm.addNewChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATPROACTIVEACTION" translate-attr-aria-label="CHAT.ADD_CHATPROACTIVEACTION">\n          ADD CHATPROACTIVEACTION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatProactiveAction" ng-click="vm.deleteChatProactiveAction($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/view.html",'<div id="chat-chatWebsite" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-chatWebsites-button md-icon-button" aria-label="Go to chatWebsites" ng-click="vm.gotoChatWebsites()" translate translate-attr-aria-label="CHAT.GO_TO_CHATWEBSITES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="chatWebsite-image" hide-xs>\n          <img ng-src="assets/images/business/chatWebsites.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.chatWebsite.id}}\n            <span ng-if="vm.chatWebsite.name">{{vm.chatWebsite.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatWebsite.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.chatWebsite, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="CHAT.AGENTADD_CHATWEBSITE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveChatWebsite()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (scriptForm.$invalid) || (intervalForm.$invalid) || (dispositionForm.$invalid) || (appearanceForm.$invalid) || (onlinestatusForm.$invalid) || (offlinestatusForm.$invalid) || (closingformForm.$invalid) || (unmanagedstatusForm.$invalid) || (interactionForm.$invalid) || (whitelabelForm.$invalid) || (logoForm.$invalid) || (agentAvatarForm.$invalid) || (customerAvatarForm.$invalid) || (systemAvatarForm.$invalid) || (chatFormOnlineForm.$invalid) || (chatFormOfflineForm.$invalid) || (proactiveForm.$invalid) || (chatDispositionsForm.$invalid) || (chatCannedAnswersForm.$invalid) || (vidaooForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid) || (offlineMessagesForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n                <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'address\'].$error" ng-show="generalForm[\'address\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.fidelity" class="md-block">\n                <label translate="CHAT.TIMEOUT">Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.chatWebsite.timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.chatWebsite.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.chatWebsite.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="CHAT.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.chatWebsite.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.queueTransfer == true" class="md-block">\n                <label translate="CHAT.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.chatWebsite.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.agentTransfer == true" class="md-block">\n                <label translate="CHAT.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.chatWebsite.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container script md-background-bg md-whiteframe-1dp">\n            <form name="scriptForm" flex="100" novalidate>\n              <div ng-controller="ChatWebsiteScriptController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg>\n                <div class="pb-16" layout="row" layout-align="start center">\n                  <div class="h2 secondary-text" translate="CHAT.SCRIPT">SCRIPT</div>\n                </div>\n\n\n                <md-input-container class="md-block">\n                  <label translate="CHAT.TOKEN">Token</label>\n                  <input type="text" name="token" ng-model="vm_ac.chatWebsite.token" autofocus ng-disabled="true">\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n                  <input type="url" name="remote" ng-model="vm_ac.chatWebsite.remote" required>\n                  <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n                  <div ng-messages="scriptForm[\'remote\'].$error" ng-show="scriptForm[\'remote\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">Motion Proxy field is required</span>\n                    </div>\n                    <div ng-message="url">\n                      <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">Motion Proxy must be a valid url e.g.: http://www.xcally.com</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="CHAT.WEBSITESCRIPT">WebsiteScript</label>\n                  <div>\n                    <pre style="font-size: 13px;">\n                    {{vm_ac.start}} {{vm_ac.script}} {{vm_ac.end}}\n                    </pre>\n                  </div>\n                  <div class="hint"><span translate="CHAT.HELP.COPYSCRIPTTOCLIPBOARD"></span></div>\n                </md-input-container>\n\n              </div>\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container interval md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.INTERVAL">INTERVAL</div>\n            </div>\n            <form name="intervalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.INTERVAL">Interval</label>\n                <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Always</md-option>\n                  <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n                </md-select>\n                <div ng-messages="intervalForm[\'IntervalId\'].$error" ng-show="intervalForm[\'IntervalId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.TIMEZONE">Timezone</label>\n                <ms-timezone name="timezone" ng-model="vm.chatWebsite.timezone" ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n                <div class="hint"><span translate="CHAT.HELP.TIMEZONE"></span></div>\n                <div ng-messages="intervalForm[\'timezone\'].$error" ng-show="intervalForm[timezone].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.mandatoryDisposition" class="md-block">\n                <label translate="CHAT.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.chatWebsite.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="CHAT.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.SNIPPET">SNIPPET</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container appearance md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.APPEARANCE">APPEARANCE</div>\n            </div>\n            <form name="appearanceForm" novalidate>\n              <div flex md-color-picker ng-model="vm.chatWebsite.color" label="{{\'CHAT.MAINCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n              <div flex md-color-picker ng-model="vm.chatWebsite.color_button" label="{{\'CHAT.BUTTONCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n              <div flex md-color-picker ng-model="vm.chatWebsite.textColor" label="{{\'CHAT.TEXTCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n              <div flex md-color-picker ng-model="vm.chatWebsite.backgroundColor" label="{{\'CHAT.BACKGROUNDCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n              <md-input-container class="md-block">\n                <label translate="CHAT.FONTSIZE">fontSize</label>\n                <input type="number" name="fontSize" ng-model="vm.chatWebsite.fontSize" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="appearanceForm[\'fontSize\'].$error" ng-show="appearanceForm[\'fontSize\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FONTSIZE_REQUIRED">fontSize field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">fontSize must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.HEADERSHAPE">headershape</label>\n                <md-select name="header_shape" ng-model="vm.chatWebsite.header_shape" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'rounded\'"> {{ \'CHAT.ROUNDED\' | translate }} </md-option>\n\n                  <md-option ng-value="\'squared\'"> {{ \'CHAT.SQUARED\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="appearanceForm[\'header_shape\'].$error" ng-show="appearanceForm[\'header_shape\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.HEADERSHAPE_REQUIRED">headershape field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.showAgentAvatar" aria-label="ShowAgentAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWAGENTAVATAR">ShowAgentAvatar</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.showCustomerAvatar" aria-label="showCustomerAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWCUSTOMERAVATAR">showCustomerAvatar</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.SNIPPETSWIPEOUT">snippetSwipeOut</label>\n                <md-select name="alignment" ng-model="vm.chatWebsite.alignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'bottom_right\'"> {{ \'CHAT.BOTTOM_RIGHT\' | translate }} </md-option>\n\n                  <md-option ng-value="\'right\'"> {{ \'CHAT.RIGHT\' | translate }} </md-option>\n\n                  <md-option ng-value="\'left\'"> {{ \'CHAT.LEFT\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="appearanceForm[\'alignment\'].$error" ng-show="appearanceForm[\'alignment\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SNIPPETSWIPEOUT_REQUIRED">snippetSwipeOut field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.alignment !== \'bottom_right\'" class="md-block">\n                <label translate="CHAT.VERTICALPOSITION">verticalPosition</label>\n                <input type="number" name="verticalAlignment" ng-model="vm.chatWebsite.verticalAlignment" min="0" max="100" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="CHAT.HELP.VERTICALPOSITION"></span></div>\n                <div ng-messages="appearanceForm[\'verticalAlignment\'].$error" ng-show="appearanceForm[\'verticalAlignment\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.VERTICALPOSITION_REQUIRED">verticalPosition field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>100</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.MESSAGESALIGNMENT">messagesAlignment</label>\n                <md-select name="messagesAlignment" ng-model="vm.chatWebsite.messagesAlignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'alternate\'"> {{ \'CHAT.ALTERNATE\' | translate }} </md-option>\n\n                  <md-option ng-value="\'centered\'"> {{ \'CHAT.CENTERED\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="appearanceForm[\'messagesAlignment\'].$error" ng-show="appearanceForm[\'messagesAlignment\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.DEFAULTTITLE">defaultTitle</label>\n                <input type="text" name="defaultTitle" ng-model="vm.chatWebsite.defaultTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="appearanceForm[\'defaultTitle\'].$error" ng-show="appearanceForm[\'defaultTitle\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.DEFAULTTITLE_REQUIRED">defaultTitle field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.DEFAULTTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>defaultTitle must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.LABELTEXT">labelText</label>\n                <input type="text" name="labelText" ng-model="vm.chatWebsite.labelText" md-maxlength="6" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="appearanceForm[\'labelText\'].$error" ng-show="appearanceForm[\'labelText\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.LABELTEXT_REQUIRED">labelText field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.LABELTEXT_MAX_LENGTH" translate-values=\'{max: 6}\'>labelText\n                      must have a maximum length equal to 6</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container onlinestatus md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.ONLINESTATUS">ONLINESTATUS</div>\n            </div>\n            <form name="onlinestatusForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.HEADER_ONLINE">header_online</label>\n                <input type="text" name="header_online" ng-model="vm.chatWebsite.header_online" md-maxlength="255" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="onlinestatusForm[\'header_online\'].$error" ng-show="onlinestatusForm[\'header_online\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.HEADER_ONLINE_REQUIRED">header_online field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.HEADER_ONLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_online must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.START_CHAT_BUTTON">start_chat_button</label>\n                <input type="text" name="start_chat_button" ng-model="vm.chatWebsite.start_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="onlinestatusForm[\'start_chat_button\'].$error" ng-show="onlinestatusForm[\'start_chat_button\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.START_CHAT_BUTTON_REQUIRED">start_chat_button field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.START_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>start_chat_button must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container offlinestatus md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.OFFLINESTATUS">OFFLINESTATUS</div>\n            </div>\n            <form name="offlinestatusForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.hideWhenOffline" aria-label="hideWhenOffline" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.HIDEWHENOFFLINE">hideWhenOffline</span></md-switch>\n                <div class="hint"><span translate="CHAT.HELP.HIDEWHENOFFLINE"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.HEADER_OFFLINE">header_offline</label>\n                <input type="text" name="header_offline" ng-model="vm.chatWebsite.header_offline" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="offlinestatusForm[\'header_offline\'].$error" ng-show="offlinestatusForm[\'header_offline\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.HEADER_OFFLINE_REQUIRED">header_offline field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.HEADER_OFFLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_offline must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.OFFLINE_CHAT_BUTTON">offline_chat_button</label>\n                <input type="text" name="offline_chat_button" ng-model="vm.chatWebsite.offline_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="offlinestatusForm[\'offline_chat_button\'].$error" ng-show="offlinestatusForm[\'offline_chat_button\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_REQUIRED">offline_chat_button field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>offline_chat_button must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.OFFLINEMESSAGESUBJECT">offlineMessageSubject</label>\n                <input type="text" name="offlineMessageSubject" ng-model="vm.chatWebsite.offlineMessageSubject" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="offlinestatusForm[\'offlineMessageSubject\'].$error" ng-show="offlinestatusForm[\'offlineMessageSubject\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_REQUIRED">offlineMessageSubject field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageSubject must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.OFFLINEMESSAGEBODY">offlineMessageBody</label>\n                <input type="text" name="offlineMessageBody" ng-model="vm.chatWebsite.offlineMessageBody" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="offlinestatusForm[\'offlineMessageBody\'].$error" ng-show="offlinestatusForm[\'offlineMessageBody\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_REQUIRED">offlineMessageBody field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageBody must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container closingform md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.CLOSINGFORM">CLOSINGFORM</div>\n            </div>\n            <form name="closingformForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.CLOSINGMESSAGE">closingMessage</label>\n                <textarea name="closingMessage" ng-model="vm.chatWebsite.closingMessage" md-maxlength="255" required autofocus></textarea>\n\n                <div ng-messages="closingformForm[\'closingMessage\'].$error" ng-show="closingformForm[\'closingMessage\'].$touched" role="alert">\n\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.CLOSINGMESSAGE_REQUIRED">closingMessage field is required</span>\n                  </div>\n\n\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.CLOSINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessage must have a maximum length equal to 255</span>\n                  </div>\n\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.SKIPMESSAGEBUTTON">skipMessageButton</label>\n                <input type="text" name="skipMessageButton" ng-model="vm.chatWebsite.skipMessageButton" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'skipMessageButton\'].$error" ng-show="closingformForm[\'skipMessageButton\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_REQUIRED">skipMessageButton field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>skipMessageButton must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableRating" aria-label="enableRating" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLERATING">enableRating</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableRating" class="md-block">\n                <label translate="CHAT.RATINGTYPE">ratingType</label>\n                <md-select name="ratingType" ng-model="vm.chatWebsite.ratingType" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'star\'">Star</md-option>\n                  <md-option ng-value="\'thumb\'">Thumb</md-option>\n                </md-select>\n                <div ng-messages="closingformForm[\'ratingType\'].$error" ng-show="closingformForm[\'ratingType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.RATINGTYPE_REQUIRED">ratingType field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableRating && vm.chatWebsite.ratingType === \'star\'" class="md-block">\n                <label translate="CHAT.RATINGSTARSNUMBER">ratingStarsNumber</label>\n                <input type="number" name="ratingStarsNumber" ng-model="vm.chatWebsite.ratingStarsNumber" min="2" max="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'ratingStarsNumber\'].$error" ng-show="closingformForm[\'ratingStarsNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_REQUIRED">ratingStarsNumber field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>2</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableFeedback" aria-label="enableFeedback" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEFEEDBACK">enableFeedback</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableFeedback" class="md-block">\n                <label translate="CHAT.FEEDBACKTITLE">feedbackTitle</label>\n                <input type="text" name="feedbackTitle" ng-model="vm.chatWebsite.feedbackTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'feedbackTitle\'].$error" ng-show="closingformForm[\'feedbackTitle\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FEEDBACKTITLE_REQUIRED">feedbackTitle field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.FEEDBACKTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>feedbackTitle must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.forwardTranscript" aria-label="forwardTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.FORWARDTRANSCRIPT">forwardTranscript</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.forwardTranscript" class="md-block">\n                <label translate="CHAT.FORWARDTRANSCRIPTMESSAGE">forwardTranscriptMessage</label>\n                <input type="text" name="forwardTranscriptMessage" ng-model="vm.chatWebsite.forwardTranscriptMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'forwardTranscriptMessage\'].$error" ng-show="closingformForm[\'forwardTranscriptMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_REQUIRED">forwardTranscriptMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>forwardTranscriptMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.CLOSINGMESSAGEBUTTON">closingMessageButton</label>\n                <input type="text" name="closingMessageButton" ng-model="vm.chatWebsite.closingMessageButton" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="closingformForm[\'closingMessageButton\'].$error" ng-show="closingformForm[\'closingMessageButton\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_REQUIRED">closingMessageButton field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessageButton must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container unmanagedstatus md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.UNMANAGEDSTATUS">UNMANAGEDSTATUS</div>\n            </div>\n            <form name="unmanagedstatusForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.autoclose" aria-label="autoclose" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AUTOCLOSE">autoclose</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableUnmanagedNote" aria-label="enableUnmanagedNote" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEUNMANAGEDNOTE">enableUnmanagedNote</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.UNMANAGEDMESSAGE">unmanagedMessage</label>\n                <input type="text" name="unmanagedMessage" ng-model="vm.chatWebsite.unmanagedMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="unmanagedstatusForm[\'unmanagedMessage\'].$error" ng-show="unmanagedstatusForm[\'unmanagedMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_REQUIRED">unmanagedMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>unmanagedMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.SKIPUNMANAGED">skipUnmanaged</label>\n                <input type="text" name="skipUnmanaged" ng-model="vm.chatWebsite.skipUnmanaged" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="unmanagedstatusForm[\'skipUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'skipUnmanaged\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SKIPUNMANAGED_REQUIRED">skipUnmanaged field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.SKIPUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>skipUnmanaged must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n                <label translate="CHAT.SENDUNMANAGED">sendUnmanaged</label>\n                <input type="text" name="sendUnmanaged" ng-model="vm.chatWebsite.sendUnmanaged" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="unmanagedstatusForm[\'sendUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'sendUnmanaged\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SENDUNMANAGED_REQUIRED">sendUnmanaged field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.SENDUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>sendUnmanaged must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n                <label translate="CHAT.NOTETITLE">noteTitle</label>\n                <input type="text" name="noteTitle" ng-model="vm.chatWebsite.noteTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="unmanagedstatusForm[\'noteTitle\'].$error" ng-show="unmanagedstatusForm[\'noteTitle\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.NOTETITLE_REQUIRED">noteTitle field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.NOTETITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>noteTitle must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="chatWebsite-detail-form-container interaction md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.INTERACTION">INTERACTION</div>\n            </div>\n            <form name="interactionForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CHAT.AGENTIDENTIFIER">agentIdentifier</label>\n                <md-select name="agentIdentifier" ng-model="vm.chatWebsite.agentIdentifier" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'website_alias\'"> {{ \'CHAT.WEBSITEALIAS\' | translate }} </md-option>\n\n                  <md-option ng-value="\'agent_alias\'"> {{ \'CHAT.AGENTALIAS\' | translate }} </md-option>\n\n                  <md-option ng-value="\'agent_fullname\'"> {{ \'CHAT.AGENTFULLNAME\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="CHAT.HELP.AGENTIDENTIFIER"></span></div>\n                <div ng-messages="interactionForm[\'agentIdentifier\'].$error" ng-show="interactionForm[\'agentIdentifier\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.AGENTIDENTIFIER_REQUIRED">agentIdentifier field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.CUSTOMERALIAS">customerAlias</label>\n                <input type="text" name="customerAlias" ng-model="vm.chatWebsite.customerAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'customerAlias\'].$error" ng-show="interactionForm[\'customerAlias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.CUSTOMERALIAS_REQUIRED">customerAlias field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.CUSTOMERALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>customerAlias must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.MESSAGEFONTSIZE">messageFontSize</label>\n                <input type="number" name="messageFontSize" ng-model="vm.chatWebsite.messageFontSize" min="0" max="20" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'messageFontSize\'].$error" ng-show="interactionForm[\'messageFontSize\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_REQUIRED">messageFontSize field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>20</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.agentIdentifier === \'website_alias\'" class="md-block">\n                <label translate="CHAT.WEBSITEALIAS">WebsiteAlias</label>\n                <input type="text" name="agentAlias" ng-model="vm.chatWebsite.agentAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="CHAT.HELP.WEBSITEALIAS"></span></div>\n                <div ng-messages="interactionForm[\'agentAlias\'].$error" ng-show="interactionForm[\'agentAlias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WEBSITEALIAS_REQUIRED">WebsiteAlias field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.WEBSITEALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>WebsiteAlias must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.CLOSINGQUESTION">closingQuestion</label>\n                <input type="text" name="closingQuestion" ng-model="vm.chatWebsite.closingQuestion" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'closingQuestion\'].$error" ng-show="interactionForm[\'closingQuestion\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.CLOSINGQUESTION_REQUIRED">closingQuestion field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.CLOSINGQUESTION_MAX_LENGTH" translate-values=\'{max: 255}\'>closingQuestion must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.FORMSUBMITSUCCESSMESSAGE">formSubmitSuccessMessage</label>\n                <input type="text" name="formSubmitSuccessMessage" ng-model="vm.chatWebsite.formSubmitSuccessMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'formSubmitSuccessMessage\'].$error" ng-show="interactionForm[\'formSubmitSuccessMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_REQUIRED">formSubmitSuccessMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitSuccessMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.FORMSUBMITFAILUREMESSAGE">formSubmitFailureMessage</label>\n                <input type="text" name="formSubmitFailureMessage" ng-model="vm.chatWebsite.formSubmitFailureMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'formSubmitFailureMessage\'].$error" ng-show="interactionForm[\'formSubmitFailureMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_REQUIRED">formSubmitFailureMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitFailureMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableCustomerWriting" aria-label="enableCustomerWriting" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERWRITING">enableCustomerWriting</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n                <label translate="CHAT.WAITINGTITLE">waitingTitle</label>\n                <input type="text" name="waitingTitle" ng-model="vm.chatWebsite.waitingTitle" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'waitingTitle\'].$error" ng-show="interactionForm[\'waitingTitle\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WAITINGTITLE_REQUIRED">waitingTitle field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.WAITINGTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingTitle must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n                <label translate="CHAT.WAITINGMESSAGE">waitingMessage</label>\n                <textarea name="waitingMessage" ng-model="vm.chatWebsite.waitingMessage" md-maxlength="255" required></textarea>\n\n                <div ng-messages="interactionForm[\'waitingMessage\'].$error" ng-show="interactionForm[\'waitingMessage\'].$touched" role="alert">\n\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WAITINGMESSAGE_REQUIRED">waitingMessage field is required</span>\n                  </div>\n\n\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.WAITINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingMessage must have a maximum length equal to 255</span>\n                  </div>\n\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.PLACEHOLDERMESSAGE">placeholderMessage</label>\n                <input type="text" name="placeholderMessage" ng-model="vm.chatWebsite.placeholderMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'placeholderMessage\'].$error" ng-show="interactionForm[\'placeholderMessage\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_REQUIRED">placeholderMessage field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>placeholderMessage must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.download_transcript" aria-label="downloadTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DOWNLOADTRANSCRIPT">downloadTranscript</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableCustomerAttachment" aria-label="enableCustomerAttachment" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERATTACHMENT">enableCustomerAttachment</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableSendButton" aria-label="enableSendButton" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLESENDBUTTON">enableSendButton</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.enableCustomerCheckmarks" aria-label="enableCustomerCheckmarks" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERCHECKMARKS">enableCustomerCheckmarks</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CHAT.SYSTEMALIAS">systemAlias</label>\n                <input type="text" name="systemAlias" ng-model="vm.chatWebsite.systemAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="interactionForm[\'systemAlias\'].$error" ng-show="interactionForm[\'systemAlias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.SYSTEMALIAS_REQUIRED">systemAlias field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.SYSTEMALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>systemAlias must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container whitelabel md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.WHITELABEL">WHITELABEL</div>\n            </div>\n            <form name="whitelabelForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.defaultWhiteLabel" aria-label="default" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DEFAULT">default</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="!vm.chatWebsite.defaultWhiteLabel" class="md-block">\n                <label translate="CHAT.WHITELABEL">whiteLabel</label>\n                <textarea name="whiteLabel" ng-model="vm.chatWebsite.whiteLabel" md-maxlength="255" required></textarea>\n\n                <div ng-messages="whitelabelForm[\'whiteLabel\'].$error" ng-show="whitelabelForm[\'whiteLabel\'].$touched" role="alert">\n\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.WHITELABEL_REQUIRED">whiteLabel field is required</span>\n                  </div>\n\n\n                  <div ng-message="md-maxlength">\n                    <span translate="CHAT.ERRORS.WHITELABEL_MAX_LENGTH" translate-values=\'{max: 255}\'>whiteLabel must have a maximum length equal to 255</span>\n                  </div>\n\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container logo md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.LOGO">LOGO</div>\n            </div>\n            <div ng-controller="ChatWebsitelogoController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n              <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="logoimage in vm_ca.chatWebsite.images" ng-switch="logoimage.type">\n                    <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="logoimage.file">\n                    </div>\n\n                    <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{logoimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n          </div>\n          <div class="chatWebsite-detail-form-container agentavatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.AGENTAVATAR">AGENTAVATAR</div>\n            </div>\n            <div ng-controller="ChatWebsiteagentAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n              <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="agentAvatarimage in vm_ca.chatWebsite.images" ng-switch="agentAvatarimage.type">\n                    <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{agentAvatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="agentAvatarimage.file">\n                    </div>\n\n                    <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{agentAvatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n          </div>\n          <div class="chatWebsite-detail-form-container customeravatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.CUSTOMERAVATAR">CUSTOMERAVATAR</div>\n            </div>\n            <div ng-controller="ChatWebsitecustomerAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n              <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="customerAvatarimage in vm_ca.chatWebsite.images" ng-switch="customerAvatarimage.type">\n                    <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{customerAvatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="customerAvatarimage.file">\n                    </div>\n\n                    <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{customerAvatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n          </div>\n          <div class="chatWebsite-detail-form-container systemavatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.SYSTEMAVATAR">SYSTEMAVATAR</div>\n            </div>\n            <div ng-controller="ChatWebsitesystemAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n              <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="systemAvatarimage in vm_ca.chatWebsite.images" ng-switch="systemAvatarimage.type">\n                    <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{systemAvatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="systemAvatarimage.file">\n                    </div>\n\n                    <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{systemAvatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.ONLINE">ONLINE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container chatformonline md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteonlineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n              <div flex>\n                \x3c!-- START Buttons --\x3e\n                <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n                  <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n                  <md-icon md-font-icon="{{button.icon}}"></md-icon>\n                </md-button>\n                \x3c!-- END Buttons --\x3e\n              </div>\n\n              <div layout="row" flex>\n                <div flex="50">\n                  <md-card>\n                    <md-card-title>\n                      <md-card-title-text>\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n                        </div>\n                      </md-card-title-text>\n                    </md-card-title>\n                    <md-card-content>\n\n                      <form name="onlineForm" novalidate>\n\n                        \x3c!-- START MapKey --\x3e\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n                          <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.mapKey">\n                            <md-option ng-value="null">None</md-option>\n\n                            <md-optgroup label="standard">\n                              <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n                            </md-optgroup>\n\n                            <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n                              <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n                            </md-optgroup>\n                          </md-select>\n                        </md-input-container>\n                        \x3c!-- END MapKey --\x3e\n\n                        \x3c!-- START FromKey --\x3e\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n                          <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.onlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.onlineForm.fromKey != null ? vm_fonc.chatWebsite.onlineForm.items[vm_fonc.chatWebsite.onlineForm.fromKey].props.title : \'None\'">\n                            <md-option ng-value="null">None</md-option>\n                            <md-option ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                        \x3c!-- END FromKey --\x3e\n\n                        \x3c!-- START EXPANSION PANELS --\x3e\n                        <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items track by $index" md-component-id="{{\'onlinePanel\' + $index}}">\n                          <md-expansion-panel-collapsed md-no-sticky="true">\n                            <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n                              <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n                            </md-button>\n                            <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n                              <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n                            </md-button>\n\n                            <div class="md-title">{{item.props.title || item.type}}</div>\n\n                            <div flex></div>\n                            <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n                              <md-icon md-font-icon="icon-chevron-down"></md-icon>\n                            </md-button>\n                          </md-expansion-panel-collapsed>\n\n                          <md-expansion-panel-expanded>\n                            <md-expansion-panel-header>\n                              <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n                                <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n                              </md-button>\n                              <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n                                <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n                              </md-button>\n\n                              <div class="md-title">{{item.props.title || item.type}}</div>\n\n                              <div flex></div>\n\n                              <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n                                <md-icon md-font-icon="icon-delete"></md-icon>\n                              </md-button>\n                              <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n                                <md-icon md-font-icon="icon-chevron-up"></md-icon>\n                              </md-button>\n                            </md-expansion-panel-header>\n\n                            <md-expansion-panel-content>\n                              <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n                              <md-input-container class="md-block">\n                                <label translate="CHAT.VARIABLE">Variable</label>\n                                <md-select ng-model="item.variable">\n                                  <md-option ng-value="null">None</md-option>\n                                  <md-option ng-repeat="variable in vm_fonc.variables" ng-value="variable.name">{{ variable.name }}</md-option>\n                                </md-select>\n                              </md-input-container>\n\n                              <md-input-container class="md-block">\n                                <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n                                <md-select ng-model="item.cmField">\n                                  <md-option ng-value="null">None</md-option>\n\n                                  <md-optgroup label="standard">\n                                    <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n                                  </md-optgroup>\n\n                                  <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n                                    <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n                                  </md-optgroup>\n                                </md-select>\n                              </md-input-container>\n                            </md-expansion-panel-content>\n\n                          </md-expansion-panel-expanded>\n                        </md-expansion-panel>\n                        \x3c!-- END EXPANSION PANELS --\x3e\n                      </form>\n                    </md-card-content>\n                  </md-card>\n                </div>\n                <div flex="50">\n                  <md-card>\n                    <md-card-title>\n                      <md-card-title-text>\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n                        </div>\n                      </md-card-title-text>\n                    </md-card-title>\n                    <md-card-content flex>\n                      <form-view form="vm_fonc.chatWebsite.onlineForm" flex="100"></form-view>\n                    </md-card-content>\n                  </md-card>\n                </div>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.OFFLINE">OFFLINE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container chatformoffline md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteofflineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n              <div flex>\n                \x3c!-- START Buttons --\x3e\n                <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n                  <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n                  <md-icon md-font-icon="{{button.icon}}"></md-icon>\n                </md-button>\n                \x3c!-- END Buttons --\x3e\n              </div>\n\n              <div layout="row" flex>\n                <div flex="50">\n                  <md-card>\n                    <md-card-title>\n                      <md-card-title-text>\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n                        </div>\n                      </md-card-title-text>\n                    </md-card-title>\n                    <md-card-content>\n\n                      <form name="offlineForm" novalidate>\n                        <md-input-container class="md-block">\n                          <md-switch ng-model="vm_fonc.chatWebsite.forwardOffline" aria-label="forwardOffline"><span translate="CHAT.FORWARD_OFFLINE">forwardOffline</span></md-switch>\n                        </md-input-container>\n\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.forwardOffline">\n                          <label translate="CHAT.FORWARD_OFFLINE_ADDRESS">FORWARD OFFLINE ADDRESS</label>\n                          <input type="text" name="forwardOfflineAddress" ng-model="vm_fonc.chatWebsite.forwardOfflineAddress">\n                          <div class="hint"><span translate="CHAT.HELP.FORWARD_OFFLINE"></span></div>\n                          <div ng-messages="offlineForm[\'forwardOfflineAddress\'].$error" ng-show="offlineForm[\'forwardOfflineAddress\'].$touched" role="alert">\n                            <div ng-message="email">\n                              <span translate="CHAT.ERRORS.EMAIL_MUST_BE_VALID">forwardOffline must be a valid e-mail address</span>\n                            </div>\n                          </div>\n                        </md-input-container>\n\n                        <md-input-container class="md-block">\n                          <md-switch ng-model="vm_fonc.chatWebsite.openNewInteraction" aria-label="openNewInteraction">\n                            <span translate="CHAT.OPEN_NEW_INTERACTION">openNewInteraction</span>\n                          </md-switch>\n                        </md-input-container>\n\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.openNewInteraction">\n                          <label translate="CHAT.EMAIL_ACCOUNT">Email account</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.MailAccountId" required>\n                            <md-option ng-repeat="account in vm_fonc.email_accounts" ng-value="account.id">{{ account.name }}</md-option>\n                          </md-select>\n                          <div ng-messages="offlineForm[\'MailAccountId\'].$error" ng-show="offlineForm[\'MailAccountId\'].$touched" role="alert">\n                            <div ng-message="required">\n                              <span translate="CHAT.ERRORS.EMAIL_ACCOUNT_REQUIRED">Email account field is required</span>\n                            </div>\n                          </div>\n                        </md-input-container>\n\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.openNewInteraction && vm_fonc.chatWebsite.offlineForm.items.length">\n                          <label translate="CHAT.SUBJECT">Subject</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.subjectOffline" md-selected-text="vm_fonc.chatWebsite.subjectOffline != null ? vm_fonc.chatWebsite.subjectOffline : \'None\'">\n                            <md-option ng-value="null">None</md-option>\n                            <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="item.props.title">{{ item.props.title }}</md-option>\n                          </md-select>\n                        </md-input-container>\n\n                        \x3c!-- START MapKey --\x3e\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n                          <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.mapKeyOffline">\n                            <md-option ng-value="null">None</md-option>\n\n                            <md-optgroup label="standard">\n                              <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n                            </md-optgroup>\n\n                            <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n                              <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n                            </md-optgroup>\n                          </md-select>\n                        </md-input-container>\n                        \x3c!-- END MapKey --\x3e\n\n                        \x3c!-- START FromKey --\x3e\n                        <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n                          <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n                          <md-select ng-model="vm_fonc.chatWebsite.offlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.offlineForm.fromKey != null ? vm_fonc.chatWebsite.offlineForm.items[vm_fonc.chatWebsite.offlineForm.fromKey].props.title : \'None\'">\n                            <md-option ng-value="null">None</md-option>\n                            <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                        \x3c!-- END FromKey --\x3e\n\n                        \x3c!-- START EXPANSION PANELS --\x3e\n                        <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items track by $index" md-component-id="{{\'offlinePanel\' + $index}}">\n                          <md-expansion-panel-collapsed md-no-sticky="true">\n                            <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n                              <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n                            </md-button>\n                            <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n                              <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n                            </md-button>\n\n                            <div class="md-title">{{item.props.title || item.type}}</div>\n\n                            <div flex></div>\n                            <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n                              <md-icon md-font-icon="icon-chevron-down"></md-icon>\n                            </md-button>\n                          </md-expansion-panel-collapsed>\n\n                          <md-expansion-panel-expanded>\n                            <md-expansion-panel-header>\n                              <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n                                <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n                              </md-button>\n                              <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n                                <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n                              </md-button>\n\n                              <div class="md-title">{{item.props.title || item.type}}</div>\n\n                              <div flex></div>\n\n                              <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n                                <md-icon md-font-icon="icon-delete"></md-icon>\n                              </md-button>\n                              <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n                                <md-icon md-font-icon="icon-chevron-up"></md-icon>\n                              </md-button>\n                            </md-expansion-panel-header>\n\n                            <md-expansion-panel-content>\n                              <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n\n                              <md-input-container class="md-block" ng-if="item.type != \'upload\'">\n                                <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n                                <md-select ng-model="item.cmField">\n                                  <md-option ng-value="null">None</md-option>\n\n                                  <md-optgroup label="standard">\n                                    <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n                                  </md-optgroup>\n\n                                  <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n                                    <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n                                  </md-optgroup>\n                                </md-select>\n                              </md-input-container>\n                            </md-expansion-panel-content>\n\n                          </md-expansion-panel-expanded>\n                        </md-expansion-panel>\n                        \x3c!-- END EXPANSION PANELS --\x3e\n                      </form>\n                    </md-card-content>\n                  </md-card>\n                </div>\n                <div flex="50">\n                  <md-card>\n                    <md-card-title>\n                      <md-card-title-text>\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n                        </div>\n                      </md-card-title-text>\n                    </md-card-title>\n                    <md-card-content flex>\n                      <form-view form="vm_fonc.chatWebsite.offlineForm" flex="100"></form-view>\n                    </md-card-content>\n                  </md-card>\n                </div>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.PROACTIVEACTIONS">PROACTIVEACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container proactive md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteProactiveActionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteProactiveActions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CHAT.PROACTIVEACTIONS">ProactiveActions</span>\n                  <ms-search-bar on-search="vm_dc.getChatWebsiteProactiveActions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event)" aria-label="add chatProactiveAction" translate translate-attr-label="CHAT.ADD_CHATPROACTIVEACTION">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteProactiveActions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedChatWebsiteProactiveActions.length}} {{vm_dc.selectedChatWebsiteProactiveActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteProactiveActions" csv-label="true" filename="chatWebsites.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteProactiveActions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteProactiveActions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteProactiveActions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CHAT.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="name">\n                        {{ \'CHAT.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="type">\n                        {{ \'CHAT.TYPE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="selector">\n                        {{ \'CHAT.SELECTOR\' | translate }}\n                      </th>\n                      <th md-column md-order-by="timeout">\n                        {{ \'CHAT.TIMEOUT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'CHAT.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="chatProactiveAction" md-select-id="id" ng-repeat="chatProactiveAction in vm_dc.chatWebsiteProactiveActions.rows">\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{chatProactiveAction.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{chatProactiveAction.name}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{ \'CHAT.\' + vm_dc.arraytype[chatProactiveAction.type].option | uppercase | translate }}\n                      </td>\n\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{chatProactiveAction.selector}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{chatProactiveAction.timeout}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n                        {{ chatProactiveAction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" translate="CHAT.EDIT_CHATPROACTIVEACTION">\n                                Edit ChatProactiveAction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(chatProactiveAction, $event)" translate="CHAT.DELETE_CHATPROACTIVEACTION">\n                                Delete ChatProactiveAction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.chatWebsiteProactiveActions.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CHAT.NO_CHATPROACTIVEACTION_AVAILABLE">No chatproactiveaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteProactiveActions.count}}" md-on-paginate="vm_dc.getChatWebsiteProactiveActions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="ChatWebsiteDispositionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="chatWebsite-detail-form-container chatdispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="CHAT.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add chat dispositions" translate translate-attr-label="CHAT.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="chatWebsites.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container chatcannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteChatCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CHAT.CHATCANNEDANSWERS">ChatCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getChatWebsiteChatCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event)" aria-label="add chatCannedAnswer" translate translate-attr-label="CHAT.ADD_CHATCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatCannedAnswers.length}} {{vm_dc.selectedChatWebsiteChatCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatCannedAnswers" csv-label="true" filename="chatWebsites.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CHAT.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'CHAT.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'CHAT.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'CHAT.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'CHAT.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="chatCannedAnswer" md-select-id="id" ng-repeat="chatCannedAnswer in vm_dc.chatWebsiteChatCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{chatCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{chatCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{chatCannedAnswer.value}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{chatCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n                        {{ chatCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" translate="CHAT.EDIT_CHATCANNEDANSWER">\n                                Edit ChatCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(chatCannedAnswer, $event)" translate="CHAT.DELETE_CHATCANNEDANSWER">\n                                Delete ChatCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.chatWebsiteChatCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CHAT.NO_CHATCANNEDANSWER_AVAILABLE">No chatcannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteChatCannedAnswers.count}}" md-on-paginate="vm_dc.getChatWebsiteChatCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.VIDEO">VIDEO</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container vidaoo md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CHAT.VIDAOO">VIDAOO</div>\n            </div>\n            <form name="vidaooForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.chatWebsite.vidaooEscalation" aria-label="vidaooEscalation" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.VIDAOOESCALATION">vidaooEscalation</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n                <label translate="CHAT.VIDAOOAPIKEY">vidaooApiKey</label>\n                <input type="text" name="vidaooApiKey" ng-model="vm.chatWebsite.vidaooApiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="vidaooForm[\'vidaooApiKey\'].$error" ng-show="vidaooForm[\'vidaooApiKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.VIDAOOAPIKEY_REQUIRED">vidaooApiKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n                <label translate="CHAT.VIDAOOTOPIC">vidaooTopic</label>\n                <input type="text" name="vidaooTopic" ng-model="vm.chatWebsite.vidaooTopic" value="Generated by XCALLY Motion" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="vidaooForm[\'vidaooTopic\'].$error" ng-show="vidaooForm[\'vidaooTopic\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.VIDAOOTOPIC_REQUIRED">vidaooTopic field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n                <label translate="CHAT.VIDAOONOTE">vidaooNote</label>\n                <input type="text" name="vidaooNote" ng-model="vm.chatWebsite.vidaooNote" value="Meeting generated for interaction #{{interaction.id}} by {{agent.name}}" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="vidaooForm[\'vidaooNote\'].$error" ng-show="vidaooForm[\'vidaooNote\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CHAT.ERRORS.VIDAOONOTE_REQUIRED">vidaooNote field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n                <label translate="CHAT.VIDAOOMETADATA">vidaooMetadata</label>\n                <textarea name="vidaooMetadata" ng-model="vm.chatWebsite.vidaooMetadata"></textarea>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteActionsController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="CHAT.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedChatWebsiteApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedChatWebsiteApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedChatWebsiteApps.length}} {{vm_ac.selectedChatWebsiteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedChatWebsiteApps($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedChatWebsiteApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.chatWebsiteApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editChatWebsiteApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.chatWebsiteApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteInteractionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CHAT.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getChatWebsiteInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getChatWebsiteInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getChatWebsiteInteractions()" aria-label="refresh Interactions" translate translate-attr-label="CHAT.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedChatWebsiteInteractions.length}} {{vm_dc.selectedChatWebsiteInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteInteractions" csv-label="true" filename="chatWebsites.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteInteractions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CHAT.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'CHAT.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'CHAT.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'CHAT.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'CHAT.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'CHAT.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'CHAT.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.chatWebsiteInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'CHAT.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'CHAT.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spychatInteraction($event, interaction)" translate="CHAT.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n                              <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event, true)" translate="CHAT.DOWNLOAD_WITH_ATTACHMENTS">\n                                Download with attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event)" translate="CHAT.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                                Download without attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="CHAT.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.chatWebsiteInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CHAT.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteInteractions.count}}" md-on-paginate="vm_dc.getChatWebsiteInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.OFFLINEMESSAGES">OFFLINEMESSAGES</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="chatWebsite-detail-form-container offlinemessages md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ChatWebsiteOfflineMessagesController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteOfflineMessages.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CHAT.OFFLINEMESSAGES">OfflineMessages</span>\n                  <ms-search-bar on-search="vm_dc.getChatWebsiteOfflineMessages()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteOfflineMessages.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedChatWebsiteOfflineMessages.length}} {{vm_dc.selectedChatWebsiteOfflineMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteOfflineMessages" csv-label="true" filename="chatWebsites.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteOfflineMessages($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteOfflineMessages" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteOfflineMessages">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CHAT.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column>\n                        {{ \'CHAT.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'CHAT.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="offlineMessage" md-select-id="id" ng-repeat="offlineMessage in vm_dc.chatWebsiteOfflineMessages.rows">\n                      <td md-cell>\n                        {{offlineMessage.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="offlineMessage.Attachments.length > 0">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{offlineMessage.Contact.firstName}}\n                      </td>\n                      <td md-cell>\n                        {{ offlineMessage.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.showOfflineMessageChatWebsiteOfflineMessage($event, offlineMessage)" translate="CHAT.SHOW_OFFLINEMESSAGE">\n                                SHOW OfflineMessage\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(offlineMessage, $event)" translate="CHAT.DELETE_OFFLINEMESSAGE">\n                                Delete OfflineMessage\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.chatWebsiteOfflineMessages.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CHAT.NO_OFFLINEMESSAGE_AVAILABLE">No offlinemessage available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteOfflineMessages.count}}" md-on-paginate="vm_dc.getChatWebsiteOfflineMessages" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="CHAT.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n        <th md-column>{{ \'CHAT.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'CHAT.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'CHAT.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="CHAT.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="CHAT.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/chat/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CHAT.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/companies.html",'<div id="companies" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CONTACTMANAGER.COMPANIES">Companies</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedCompanies.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedCompanies =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CONTACTMANAGER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-companies-count">\n          <span>{{vm.selectedCompanies.length}}</span>\n          <span translate="CONTACTMANAGER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllCompanies()" translate="CONTACTMANAGER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectCompanies()" translate="CONTACTMANAGER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedCompanies" csv-label="true" filename="companies.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCompanies($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- COMPANY TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedCompanies" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCompanies">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.companies.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="company" md-select-id="id" ng-repeat="company in vm.companies.rows">\n                <td md-cell ng-if="company.userpic"><img class="avatar" alt="{{company.name}}" ng-src="api/users/{{company.id}}/avatar" /></td>\n                <td md-cell ng-if="!company.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{company.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="id ">{{company.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="name ">{{company.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="description ">{{company.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(company, $event    )" translate="CONTACTMANAGER.EDIT_COMPANY">\n                          Edit Company\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotocontactsgoto(company, $event    )" translate="CONTACTMANAGER.GOTOCONTACTS_COMPANY">\n                          goToContacts Company\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(company, $event    )" translate="CONTACTMANAGER.DELETE_COMPANY">\n                          Delete Company\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.companies.count}}" md-on-paginate="vm.getCompanies" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / COMPANY TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD COMPANY BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-company-button" ng-click="vm.createOrEditCompany($event)" aria-label="add company" translate translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD COMPANY BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/create/dialog.html",'<md-dialog class="company-dialog" aria-label="New Company">\n  <form name="companyForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n\n        <div ng-messages="companyForm[\'name\'].$error" ng-show="companyForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.PHONE">Phone</label>\n        <input type="text" name="phone" ng-model="vm.company.phone">\n\n        <div ng-messages="companyForm[\'phone\'].$error" ng-show="companyForm[\'phone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.VAT">Vat</label>\n        <input type="text" name="vat" ng-model="vm.company.vat">\n\n        <div ng-messages="companyForm[\'vat\'].$error" ng-show="companyForm[\'vat\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.FAX">Fax</label>\n        <input type="text" name="fax" ng-model="vm.company.fax">\n\n        <div ng-messages="companyForm[\'fax\'].$error" ng-show="companyForm[\'fax\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n        <input type="text" name="companyId" ng-model="vm.company.companyId">\n\n        <div ng-messages="companyForm[\'companyId\'].$error" ng-show="companyForm[\'companyId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.TYPE">Type</label>\n        <input type="text" name="type" ng-model="vm.company.type">\n\n        <div ng-messages="companyForm[\'type\'].$error" ng-show="companyForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n        <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n\n        <div ng-messages="companyForm[\'website\'].$error" ng-show="companyForm[\'website\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n        <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n\n        <div ng-messages="companyForm[\'emailDomain\'].$error" ng-show="companyForm[\'emailDomain\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.company.email">\n\n        <div ng-messages="companyForm[\'email\'].$error" ng-show="companyForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.company.description">\n\n        <div ng-messages="companyForm[\'description\'].$error" ng-show="companyForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCompany" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid || companyForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCompany" ng-click="vm.addNewCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_COMPANY" translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n          ADD COMPANY\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCompany" ng-click="vm.deleteCompany($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/companies/edit/view.html",'<div id="contactmanager-company" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-companies-button md-icon-button" aria-label="Go to companies" ng-click="vm.gotoCompanies()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_COMPANIES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="company-image" hide-xs>\n          <img ng-src="assets/images/business/companies.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.company.id}}\n            <span ng-if="vm.company.name">{{vm.company.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.company.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.company, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="CONTACTMANAGER.GOTO_COMPANY"></span></md-tooltip>\n        <md-icon md-font-icon="icon-forward"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveCompany()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (addressForm.$invalid) || (shipmentAddressForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.GENERAL">GENERAL</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="company-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.company.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.VAT">Vat</label>\n                <input type="text" name="vat" ng-model="vm.company.vat" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'vat\'].$error" ng-show="generalForm[\'vat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.FAX">Fax</label>\n                <input type="text" name="fax" ng-model="vm.company.fax" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'fax\'].$error" ng-show="generalForm[\'fax\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n                <input type="text" name="companyId" ng-model="vm.company.companyId" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'companyId\'].$error" ng-show="generalForm[\'companyId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.TYPE">Type</label>\n                <input type="text" name="type" ng-model="vm.company.type" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n                <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'website\'].$error" ng-show="generalForm[\'website\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n                <input type="text" name="emailDomain" ng-model="vm.company.emailDomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'emailDomain\'].$error" ng-show="generalForm[\'emailDomain\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.company.email" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.company.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.ADDRESS">ADDRESS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="company-detail-form-container address md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CONTACTMANAGER.ADDRESS">ADDRESS</div>\n            </div>\n            <form name="addressForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.STREET">Street</label>\n                <input type="text" name="street" ng-model="vm.company.street" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="addressForm[\'street\'].$error" ng-show="addressForm[\'street\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n                <input type="text" name="postalCode" ng-model="vm.company.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="addressForm[\'postalCode\'].$error" ng-show="addressForm[\'postalCode\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.CITY">City</label>\n                <input type="text" name="city" ng-model="vm.company.city" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="addressForm[\'city\'].$error" ng-show="addressForm[\'city\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n                <input type="text" name="country" ng-model="vm.company.country" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="addressForm[\'country\'].$error" ng-show="addressForm[\'country\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="company-detail-form-container shipmentaddress md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</div>\n            </div>\n            <form name="shipmentAddressForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.STREET">Street</label>\n                <input type="text" name="sStreet" ng-model="vm.company.sStreet" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="shipmentAddressForm[\'sStreet\'].$error" ng-show="shipmentAddressForm[\'sStreet\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n                <input type="text" name="sPostalCode" ng-model="vm.company.sPostalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="shipmentAddressForm[\'sPostalCode\'].$error" ng-show="shipmentAddressForm[\'sPostalCode\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.CITY">City</label>\n                <input type="text" name="sCity" ng-model="vm.company.sCity" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="shipmentAddressForm[\'sCity\'].$error" ng-show="shipmentAddressForm[\'sCity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n                <input type="text" name="sCountry" ng-model="vm.company.sCountry" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="shipmentAddressForm[\'sCountry\'].$error" ng-show="shipmentAddressForm[\'sCountry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/contacts.html",'<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CONTACTMANAGER.CONTACTS">Contacts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    \x3c!-- SEARCH --\x3e\n    <div class="search-input-wrapper" layout="row" layout-align="start center">\n      <label for="search">\n        <md-icon md-font-icon="icon-magnify"></md-icon>\n      </label>\n      <md-input-container md-no-float class="m-0">\n        <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n      </md-input-container>\n    </div>\n    \x3c!-- / SEARCH --\x3e\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedContacts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedContacts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CONTACTMANAGER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-contacts-count">\n          <span>{{vm.selectedContacts.length}}</span>\n          <span translate="CONTACTMANAGER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllContacts()" translate="CONTACTMANAGER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectContacts()" translate="CONTACTMANAGER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedContacts" csv-label="true" filename="contacts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedContacts($event)" aria-label="delete selected" translate translate-attr-label="CONTACTS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n      <div layout="row">\n        <div class="column" flex="20">\n          <md-card>\n            <md-card-content>\n              <button layout-align="center center" md-mini-fab ng-click="vm.selectedList = null; vm.selectedCompany = null; vm.selectedTags = []">\n                <md-icon md-font-icon="icon-refresh"></md-icon>{{ \'CONTACTMANAGER.ALL_CONTACTS\' | translate }}\n              </button>\n            </md-card-content>\n          </md-card>\n          <md-card>\n            <md-card-content>\n              <md-input-container class="md-block" flex-gt-sm="">\n                <label translate="CONTACTMANAGER.SELECT_LIST">Select a list</label>\n                <md-select placeholder="Select a list" ng-model="vm.selectedList" ng-disabled="vm.lists.count === 0">\n                  <md-option ng-value="null"><em translate="CONTACTMANAGER.ALL">All</em></md-option>\n                  <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n                </md-select>\n              </md-input-container>\n            </md-card-content>\n          </md-card>\n          <md-card>\n            <md-card-content>\n              <md-input-container class="md-block" flex-gt-sm="">\n                <label translate="CONTACTMANAGER.SELECT_COMPANY">Select a company</label>\n                <md-select placeholder="Select a company" flex="100" ng-model="vm.selectedCompany" ng-disabled="vm.companies.count === 0">\n                  <md-option ng-value="null"><em translate="CONTACTMANAGER.ALL">All</em></md-option>\n                  <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n                </md-select>\n              </md-input-container>\n            </md-card-content>\n          </md-card>\n          <md-card>\n            <md-card-content>\n              <md-input-container class="md-block" flex-gt-sm="">\n                <label translate="CONTACTMANAGER.SELECT_TAGS">Select one or more tags</label>\n                <md-select multiple placeholder="Select one or more tags" flex="100" ng-model="vm.query.tag" ng-change="vm.getContacts()">\n                  <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n                </md-select>\n              </md-input-container>\n            </md-card-content>\n          </md-card>\n        </div>\n\n        \x3c!-- USER TABLE --\x3e\n        <md-card flex="80">\n          <md-table-container ng-init="vm.getAssignedCompanies()">\n            <table md-table md-row-select multiple ng-model="vm.selectedContacts" md-progress="vm.promise">\n              <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n                <tr md-row>\n                  <th md-column md-order-by="id">ID</th>\n                  <th md-column md-order-by="firstName">{{\'CONTACTMANAGER.FULLNAME\' | translate}}</th>\n                  <th md-column md-order-by="phone">{{\'CONTACTMANAGER.PHONE\' | translate}}</th>\n                  <th md-column md-order-by="email">{{\'CONTACTMANAGER.EMAIL\' | translate}}</th>\n                  <th md-column md-order-by="createdAt">{{\'CONTACTMANAGER.CREATED_AT\' | translate}}</th>\n                  <th md-column md-order-by="ListId">{{\'CONTACTMANAGER.LIST\' | translate}}</th>\n                  <th md-column md-order-by="CompanyId">{{\'CONTACTMANAGER.COMPANY\' | translate}}</th>\n                  <th md-column md-order-by="tags">{{\'CONTACTMANAGER.TAGS\' | translate}}</th>\n                  <th md-column width="10px"></th>\n                </tr>\n              </thead>\n              <tbody md-body>\n                <tr md-row ng-hide="vm.contacts.rows.length">\n                  <td md-cell colspan="8">\n                    <div layout="row" layout-align="center center">\n                      <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                    </div>\n                  </td>\n                </tr>\n                <tr md-row md-select="contact" md-select-id="id" ng-repeat="contact in vm.contacts.rows">\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="firstName" privacy ng-cloak>{{contact.firstName}} {{contact.lastName}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="phone" privacy ng-cloak>{{contact.phone}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="email" privacy ng-cloak>{{contact.email}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="createdAt">{{contact.createdAt | date:\'medium\'}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId]}}</td>\n                  <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="company">{{vm.companiesMap[contact.CompanyId]}}</td>\n                  <td md-cell class="tag">\n                    <div ng-if="contact.Tags.length">\n                      <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n                        <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n                        <span class="text-truncate">{{contact.Tags[0].name}}</span>\n                      </div>\n                      <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n                        <md-tooltip md-direction="left" layout="row">\n                          <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                        </md-tooltip>\n                        <md-icon md-font-icon="icon-tag"></md-icon>\n                      </div>\n                    </div>\n                  </td>\n                  <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                    <md-menu>\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                          <md-button ng-click="vm.editdialog(contact, ev)" translate="CONTACTMANAGER.EDIT_CONTACT">\n                            Edit Contact\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                          <md-button ng-click="vm.mergeContact(ev, contact)" translate="CONTACTMANAGER.MERGE_CONTACT">\n                            Merge Contact\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                          <md-button ng-click="vm.duplicateContact(ev, contact)" translate="CONTACTMANAGER.DUPLICATE_CONTACT">\n                            Duplicate Contact\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete">\n                        </md-menu-divider>\n                        <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                          <md-button ng-click="vm.deleteconfirm(contact, ev)" translate="CONTACTMANAGER.DELETE_CONTACT">\n                            Delete Contact\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </td>\n                </tr>\n              </tbody>\n            </table>\n          </md-table-container>\n\n          <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n        </md-card>\n        \x3c!-- / USER TABLE --\x3e\n      </div>\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD USER BUTTON --\x3e\n  <md-fab-speed-dial id="add-contact-button" ng-if="vm.crudPermissions.canEdit" ng-hide="vm.options.hidden" md-direction="up" md-open="vm.options.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm.options.hover }" ng-mouseenter="vm.options.isOpen=true" ng-mouseleave="vm.options.isOpen=false">\n    <md-fab-trigger>\n      <md-button aria-label="menu" class="md-fab md-accent">\n        <md-icon md-font-icon="icon-plus"></md-icon>\n      </md-button>\n    </md-fab-trigger>\n    <md-fab-actions>\n      <md-button class="md-fab md-mini md-warn" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContacts($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.IMPORT_CONTACTS">\n        <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n          {{\'CONTACTMANAGER.IMPORT_CONTACTS\' | translate}}\n        </md-tooltip>\n        <md-icon md-font-icon="icon-upload"></md-icon>\n      </md-button>\n      <md-button class="md-fab md-mini md-accent" ng-click="vm.createOrEditContact($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n        <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n          {{\'CONTACTMANAGER.ADD_CONTACT\' | translate}}\n        </md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </md-fab-actions>\n  </md-fab-speed-dial>\n  \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/create/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="New Contact">\n  <form name="contactForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.FIRSTNAME">First name</label>\n        <input name="firstName" ng-model="vm.contact.firstName" required md-autofocus privacy="!vm.crudPermissions.canEdit" ng-cloak>\n\n        <div ng-messages="contactForm.firstName.$error" ng-show="contactForm.firstName.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.LASTNAME">Last name</label>\n        <input name="lastName" ng-model="vm.contact.lastName" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.PHONE">Phone</label>\n        <input name="phone" ng-model="vm.contact.phone" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.EMAIL">Email</label>\n        <input name="email" type="email" ng-model="vm.contact.email" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n        <input name="mobile" ng-model="vm.contact.mobile" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.FAX">Fax</label>\n        <input name="fax" ng-model="vm.contact.fax" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.LIST">List</label>\n        <md-select name="list" ng-model="vm.contact.ListId" ng-disabled="vm.contact.id && vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n          <md-optgroup label="Lists">\n            <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n            <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n          </md-optgroup>\n        </md-select>\n        <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container>\n        <label translate="CONTACTMANAGER.TIMEZONE">Timezone</label>\n        <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone"></ms-timezone>\n      </md-input-container>\n      <div ng-repeat="customField in vm.customFields.rows" class="md-block" ng-switch="customField.type">\n        <div ng-switch-when="datetime">\n          <label>{{customField.alias}}</label>\n          <div>\n            \x3c!-- ng-model="customField.value" --\x3e\n            <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n            <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n            </mdp-time-picker>\n          </div>\n\n        </div>\n\n        <div ng-switch-when="select">\n          <label>{{customField.alias}}</label>\n\n          <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n            <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n            <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n          </md-select>\n        </div>\n\n        <div ng-switch-when="switch">\n          <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n            {{customField.alias}}\n          </md-switch>\n        </div>\n\n        <md-input-container ng-switch-default>\n          <label>{{customField.alias}}</label>\n\n          <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n        </md-input-container>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.COMPANY">Company</label>\n        <md-select name="company" ng-model="vm.contact.CompanyId">\n          <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-hide="!vm.contact.CompanyId && company.canSelect === false" ng-disabled="company.canSelect === false">\n            {{company.name}}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n        <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All\n          Fields</md-button>\n      </div>\n\n      <md-input-container class="md-block" ng-if="vm.allFields" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n        <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n        <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth">\n        </mdp-date-picker>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n        <input type="text" name="country" ng-model="vm.contact.country">\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.CITY">City</label>\n        <input type="text" name="city" ng-model="vm.contact.city">\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.STREET">Street</label>\n        <input type="text" name="street" ng-model="vm.contact.street">\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.POSTAL_CODE">Postal Code</label>\n        <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.allFields">\n        <label translate="CONTACTMANAGER.NOTES">Notes</label>\n        <input type="text" name="description" ng-model="vm.contact.description">\n      </md-input-container>\n\n      <div ng-if="vm.allFields" layout="row" layout-align="center center">\n        <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer\n          Fields</md-button>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newContact" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newContact" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n          ADD CONTACT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContact" ng-click="vm.deleteContact($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="{{ \'CONTACTMANAGER.DUPLICATE_CONTACT\' | translate }}">\n  <form name="contactForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.LIST">List</label>\n        <md-select name="list" ng-model="vm.contact.ListId">\n          <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n        </md-select>\n\n        <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n          ADD CONTACT\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n  <form name="hopperForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div flex class="md-block">\n        <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n          <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="CONTACTMANAGER.ERRORS.DATE_REQUIRED">Date is required</span>\n            </div>\n            <div ng-message="format">\n              <span translate="CONTACTMANAGER.ERRORS.DATE_INVALID">Date is invalid</span>\n            </div>\n          </div>\n        </mdp-date-picker>\n      </div>\n\n      <div flex class="md-block">\n        <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n          <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="CONTACTMANAGER.ERRORS.TIME_REQUIRED">Time is required</span>\n            </div>\n            <div ng-message="format">\n              <span translate="CONTACTMANAGER.ERRORS.TIME_INVALID">Time is invalid</span>\n            </div>\n          </div>\n        </mdp-time-picker>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_HOPPER" translate-attr-aria-label="CONTACTMANAGER.ADD_HOPPER">\n          ADD HOPPER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/view.html",'<div id="cm-contact" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-contacts-button md-icon-button" aria-label="Go to contacts" ng-click="vm.gotoContacts()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_CONTACTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="contact-image" hide-xs>\n          <img ng-src="assets/images/business/contacts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.contact.id}} {{vm.contact.firstName}} {{vm.contact.lastName}}\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-if="vm.contact.role && vm.contact.role !== \'admin\'" ng-controller="ContactQueueAddButtonController as vm_contact_qa" ng-cloak>\n      <md-fab-speed-dial ng-hide="vm_contact_qa.hidden" md-direction="left" md-open="vm_contact_qa.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm_contact_qa.hover }" ng-mouseenter="vm_contact_qa.isOpen=true" ng-mouseleave="vm_contact_qa.isOpen=false">\n        <md-fab-trigger>\n          <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n            <md-tooltip md-direction="top" md-visible="tooltipVisible">Channels</md-tooltip>\n            <md-icon md-font-icon="icon-eye" aria-label="channels"></md-icon>\n          </md-button>\n        </md-fab-trigger>\n        <md-fab-actions>\n          <div ng-repeat="channel in vm_contact_qa.channels">\n            <md-button aria-label="{{channel.name}}" class="md-fab md-raised md-icon-button md-mini" ng-click="vm_contact_qa.openDialog($event, vm.contact, channel)">\n              <md-tooltip md-direction="{{channel.direction}}" md-visible="tooltipVisible" md-autohide="false">\n                {{channel.name}}\n              </md-tooltip>\n              <md-icon md-font-icon="{{channel.icon}}" aria-label="{{channel.name}}"></md-icon>\n            </md-button>\n          </div>\n        </md-fab-actions>\n      </md-fab-speed-dial>\n    </div>\n\n    <div ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.duplicateContact($event)" class="md-fab md-warn md-icon-button" aria-label="DUPLICATE">\n        <md-icon md-font-icon="icon-file-multiple"></md-icon>\n      </md-button>\n      <md-button type="submit" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="detailForm.$pristine && customFieldsForm.$pristine && socialForm.$pristine" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.DETAIL">DETAIL</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div layout="row">\n            <div layout="column" flex="70">\n              <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n                <div class="pb-16" layout="row" layout-align="start center">\n                  <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.PERSONAL_INFO">PERSONAL_INFO\n                  </div>\n                </div>\n                <form name="detailForm" novalidate>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    \x3c!-- fistName --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.FIRSTNAME">First Name</label>\n                      <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n                      <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                      <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n                        <div ng-message="required">\n                          <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n                        </div>\n                      </div>\n                    </md-input-container>\n                    <div flex="5"></div>\n                    \x3c!-- lastName --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.LASTNAME">Last Name</label>\n                      <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                    </md-input-container>\n\n                  </div>\n\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    \x3c!-- phone --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.PHONE">Phone</label>\n                      <md-icon md-font-icon="icon-phone"></md-icon>\n                      <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                    </md-input-container>\n                    <div flex="5"></div>\n                    \x3c!-- mobile --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n                      <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n                      <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                    </md-input-container>\n                  </div>\n\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    \x3c!-- email --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.EMAIL">Email</label>\n                      <md-icon md-font-icon="icon-email" class="email"></md-icon>\n                      <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                      <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n                        <div ng-message="email">\n                          <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail\n                            address</span>\n                        </div>\n                      </div>\n                    </md-input-container>\n                    <div flex="5"></div>\n                    \x3c!-- fax --\x3e\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.FAX">Fax</label>\n                      <md-icon md-font-icon="icon-deskphone"></md-icon>\n                      <input type="text" name="fax" ng-model="vm.contact.fax" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.TIMEZONE">Timezone</label>\n                      <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n                      <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n                      <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth" mdp-disabled="!vm.crudPermissions.canEdit"></mdp-date-picker>\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container ng-if="vm.companies.rows.length" class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.COMPANY">Company</label>\n                      <md-icon md-font-icon="icon-domain"></md-icon>\n                      <md-select name="company" ng-model="vm.contact.CompanyId" ng-disabled="!vm.crudPermissions.canEdit">\n                        <md-optgroup label="Companies">\n                          <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-disabled="company.canSelect === false">{{company.name}}</md-option>\n                          <md-option ng-value=" null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                        </md-optgroup>\n                      </md-select>\n                      <md-icon class="pointer" ng-show="vm.contact.CompanyId" md-font-icon="icon-information-outline" ng-click="vm.editCompany($event, vm.contact.CompanyId)"></md-icon>\n                    </md-input-container>\n                    <section ng-if="!vm.companies.rows.length" flex-gt-sm="">\n                      <md-icon md-font-icon="icon-briefcase"></md-icon>\n                      <label translate="CONTACTMANAGER.NO_COMPANIES">No Companies</label>\n                    </section>\n                  </div>\n\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container ng-if="vm.tags.rows.length" class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.TAGS">Tags</label>\n                      <md-icon md-font-icon="icon-tag"></md-icon>\n                      <md-select ng-model="vm.Tags" multiple ng-disabled="!vm.crudPermissions.canEdit">\n                        <md-optgroup label="Tags">\n                          <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{tag.name}}</md-option>\n                        </md-optgroup>\n                      </md-select>\n                    </md-input-container>\n                    <section ng-if="!vm.tags.rows.length" flex-gt-sm="">\n                      <md-icon md-font-icon="icon-tag"></md-icon>\n                      <label translate="CONTACTMANAGER.NO_TAG">No Tags</label>\n                      <md-button class="md-accent" translate="CONTACTMANAGER.ADD_TAG">Add Tag</md-button>\n                    </section>\n                  </div>\n\n                  <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n                    <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n                  </div>\n\n                  <div ng-if="vm.allFields">\n                    <div layout-gt-sm="row" class="layout-gt-sm-row">\n                      \x3c!-- country --\x3e\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n                        <md-icon md-font-icon="icon-home" class="country"></md-icon>\n                        <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n                      </md-input-container>\n                      <div flex="5"></div>\n                      \x3c!-- city --\x3e\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate="CONTACTMANAGER.CITY">City</label>\n                        <input type="text" name="city" ng-model="vm.contact.city" ng-disabled="!vm.crudPermissions.canEdit">\n                      </md-input-container>\n                    </div>\n\n                    <div layout-gt-sm="row" class="layout-gt-sm-row">\n                      <div flex="5"></div>\n                      \x3c!-- street --\x3e\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate="CONTACTMANAGER.STREET">Street</label>\n                        <input type="text" name="street" ng-model="vm.contact.street" ng-disabled="!vm.crudPermissions.canEdit">\n                      </md-input-container>\n                      <div flex="5"></div>\n                      \x3c!-- postalCode --\x3e\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate="CONTACTMANAGER.POSTALCODE">Postal Code</label>\n                        <input type="text" name="postalCode" ng-model="vm.contact.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n                      </md-input-container>\n                    </div>\n\n                    <div layout-gt-sm="row" class="layout-gt-sm-row">\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label translate translate-attr-placeholder="CONTACTMANAGER.NOTES">Notes</label>\n                        <md-icon md-font-icon="icon-note"></md-icon>\n                        <textarea ng-model="vm.contact.description" type="text" max-rows="4" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n                      </md-input-container>\n                    </div>\n\n                    <div layout="row" layout-align="center center">\n                      <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields\n                      </md-button>\n                    </div>\n\n                  </div>\n                </form>\n              </md-card>\n              <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n                <div class="pb-16" layout="row" layout-align="start center">\n                  <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.SOCIAL">Social</div>\n                </div>\n                <form name="socialForm" novalidate>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Facebook</label>\n                      <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n                      <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n                    </md-input-container>\n                    <div flex="5"></div>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Twitter</label>\n                      <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n                      <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Line</label>\n                      <md-icon md-font-icon="fab fa-line"></md-icon>\n                      <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n                    </md-input-container>\n                    <div flex="5"></div>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Viber</label>\n                      <md-icon md-font-icon="fab fa-viber"></md-icon>\n                      <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n                    </md-input-container>\n                  </div>\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>WeChat</label>\n                      <md-icon md-font-icon="fab fa-weixin"></md-icon>\n                      <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n                    </md-input-container>\n                    <div flex="5"></div>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label>Telegram</label>\n                      <md-icon md-font-icon="icon-telegram"></md-icon>\n                      <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n                    </md-input-container>\n                  </div>\n                </form>\n              </md-card>\n            </div>\n\n            <div flex></div>\n\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n              <div class="pb-16" layout="row" layout-align="start center">\n                <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.CUSTOM_FIELDS">CUSTOM FIELDS\n                </div>\n              </div>\n              <form name="customFieldsForm" novalidate>\n                <md-input-container class="md-block">\n                  <label translate translate-attr-placeholder="CONTACTMANAGER.LIST">List</label>\n                  <md-select name="list" ng-model="vm.contact.ListId" md-on-close="vm.onSelectList($event)" ng-disabled="vm.contact.ListId">\n                    <md-optgroup label="Lists">\n                      <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}\n                      </md-option>\n                      <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                    </md-optgroup>\n                  </md-select>\n                </md-input-container>\n                <div ng-repeat="customField in vm.customFields.rows" ng-switch="customField.type">\n                  <md-input-container class="md-block" ng-switch-when="datetime">\n                    <label>{{customField.alias}}</label>\n                    <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n                      <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n                      <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n                      </mdp-time-picker>\n                    </div>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-when="select">\n                    <label>{{customField.alias}}</label>\n                    <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n                      <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}\n                      </md-option>\n                      <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                    </md-select>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-when="switch">\n                    <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n                      {{customField.alias}}\n                    </md-switch>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-default>\n                    <label>{{customField.alias}}</label>\n                    <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n                  </md-input-container>\n                </div>\n              </form>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n\n      <md-tab ng-if="vm.license.dialer">\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.MOTION_BULL">MOTION BULL</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div layout="row">\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.HOPPER">Hopper</span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.queryHopper.filter = query;" on-collapse="vm.queryHopper.filter = undefined;" debounce="300"></ms-search-bar>\n                  <md-button class="md-icon-button" ng-click="vm.getHoppers()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n                    <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n                    <md-icon md-font-icon="icon-reload"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- HOPPER TABLE --\x3e\n              <md-table-container>\n                <table md-table multiple md-progress="vm.promise">\n                  <thead md-head md-order="vm.queryHopper.sort" md-on-reorder="vm.getHoppers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                      <th md-column md-order-by="phone">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n                      <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n                      <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n                      <th md-column md-order-by="recallme">{{ \'CONTACTMANAGER.RECALLME\' | translate }}</th>\n                      <th md-column md-order-by="VoiceQueueId">{{ \'CONTACTMANAGER.VOICEQUEUEID\' | translate }}</th>\n                      <th md-column md-order-by="CampaignId">{{ \'CONTACTMANAGER.CAMPAIGNID\' | translate }}</th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-hide="vm.hoppers.count">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                        </div>\n                      </td>\n                    </tr>\n                    <tr md-row ng-repeat="(id, hopper) in vm.hoppers.rows">\n                      <td md-cell>{{hopper.id}}</td>\n                      <td md-cell privacy ng-cloak>{{hopper.phone}}</td>\n                      <td md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n                      <td md-cell>{{ vm.arraypriority[hopper.priority].option }}</td>\n                      <td md-cell class="recallme ">\n                        <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                      </td>\n                      <td md-cell>{{hopper.VoiceQueueId}}</td>\n                      <td md-cell>{{hopper.CampaignId}}</td>\n                      <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="2">\n                            <md-menu-item>\n                              <md-button ng-if="vm.crudPermissions.canEdit && hopper.VoiceQueueId" ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n                                Edit Hopper\n                              </md-button>\n                              <md-button ng-if="vm.crudPermissions.canEdit && hopper.CampaignId" ng-click="vm.createOrEditIvrCampaignHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n                                Edit Hopper\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item>\n                              <md-button ng-click="vm.crudPermissions.canDelete && vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n                                Delete Hopper\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n              \x3c!-- / HOPPER TABLE --\x3e\n            </div>\n          </div>\n\n          <div layout="row">\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.FINAL">Final</span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.queryFinal.filter = query;" on-collapse="vm.queryFinal.filter = undefined;" debounce="300"></ms-search-bar>\n                  <md-button class="md-icon-button" ng-click="vm.getFinals()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n                    <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n                    <md-icon md-font-icon="icon-reload"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- HOPPER TABLE --\x3e\n              <md-table-container>\n                <table md-table multiple md-progress="vm.promise">\n                  <thead md-head md-order="vm.queryFinal.sort" md-on-reorder="vm.getFinals">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n                      <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n                      <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n                      <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n                      <th md-column md-order-by="disposition">{{ \'CONTACTMANAGER.DISPOSITION\' | translate }}</th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-hide="vm.finals.count">\n                      <td md-cell colspan="5">\n                        <div layout="row" layout-align="center center">\n                          <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                        </div>\n                      </td>\n                    </tr>\n                    <tr md-row ng-repeat="(id, final) in vm.finals.rows">\n                      <td md-cell>{{final.uniqueid}}</td>\n                      <td md-cell privacy ng-cloak>{{final.calleridnum}}</td>\n                      <td md-cell>{{final.statedesc}}</td>\n                      <td md-cell>{{final.starttime | date:\'medium\'}}</td>\n                      <td md-cell>{{final.disposition}}</td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryFinal.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryFinal.page" md-total="{{vm.finals.count}}" md-on-paginate="vm.getFinals" md-page-select></md-table-pagination>\n              \x3c!-- / HOPPER TABLE --\x3e\n            </div>\n          </div>\n\n          <div layout="row">\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.HISTORY">History</span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.queryHistory.filter = query;" on-collapse="vm.queryHistory.filter = undefined;" debounce="300"></ms-search-bar>\n                  <md-button class="md-icon-button" ng-click="vm.getHistories()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n                    <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n                    <md-icon md-font-icon="icon-reload"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- HOPPER TABLE --\x3e\n              <md-table-container>\n                <table md-table multiple md-progress="vm.promise">\n                  <thead md-head md-order="vm.queryHistory.sort" md-on-reorder="vm.getHistories">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n                      <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n                      <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n                      <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n                      <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n                      <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-hide="vm.histories.count">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                        </div>\n                      </td>\n                    </tr>\n                    <tr md-row ng-repeat="(id, history) in vm.histories.rows">\n                      <td md-cell>{{history.uniqueid}}</td>\n                      <td md-cell privacy ng-cloak>{{history.calleridnum}}</td>\n                      <td md-cell>{{history.statedesc}}</td>\n                      <td md-cell>{{history.scheduledat | date:\'medium\'}}</td>\n                      <td md-cell>{{history.starttime | date:\'medium\'}}</td>\n                      <td md-cell>{{history.endtime | date:\'medium\'}}</td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHistory.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHistory.page" md-total="{{vm.histories.count}}" md-on-paginate="vm.getHistories" md-page-select></md-table-pagination>\n              \x3c!-- / HOPPER TABLE --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n\n      <md-tab ng-if="vm.license.jscripty">\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.JSCRIPTY">JSCRIPTY</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div layout="row">\n            <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.SESSIONS">Sessions</span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.queryJscriptySession.filter = query;" on-collapse="vm.queryJscriptySession.filter = undefined;" debounce="300"></ms-search-bar>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- SESSION TABLE --\x3e\n              <md-table-container>\n                <table md-table multiple md-progress="vm.promise">\n                  <thead md-head md-order="vm.queryJscriptySession.sort" md-on-reorder="vm.getJscriptySessions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                      <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n                      <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n                      <th md-column md-order-by="agent">{{ \'CONTACTMANAGER.AGENT\' | translate }}</th>\n                      <th md-column md-order-by="project">{{ \'CONTACTMANAGER.PROJECT\' | translate }}</th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-hide="vm.jscriptySessions.count">\n                      <td md-cell colspan="6">\n                        <div layout="row" layout-align="center center">\n                          <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                        </div>\n                      </td>\n                    </tr>\n                    <tr md-row ng-repeat="(id, session) in vm.jscriptySessions.rows">\n                      <td md-cell>{{session.id}}</td>\n                      <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n                      <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n                      <td md-cell>{{session.membername}}</td>\n                      <td md-cell>{{session.projectname}}</td>\n                      <td md-cell class="actions"></td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n              \x3c!-- / SESSION TABLE --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.CUSTOMER_JOURNEY">CUSTOMER JOURNEY</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <md-content class="md-padding" id="journey-content">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n            </div>\n          </md-content>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/import/import.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n  <form name="importForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS">Import Contacts</span>\n        <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <div md-background-bg layout="row" layout-align="start start">\n      <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n    </div>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div>\n        <md-content ng-show="!vm.processing">\n          <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n          <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n            <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n            <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n              <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n              <md-option ng-value="null" ng-hide="contactField.required">\n                <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n              </md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class="md-icon-float md-block">\n            <label translate="CONTACTMANAGER.LIST">List</label>\n            <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n              <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n            <label>{{customField.alias}}</label>\n            <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n              <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n              <md-option ng-value="null" ng-hide="customField.required">\n                <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n              </md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class="md-icon-float md-block">\n            <label translate="CONTACTMANAGER.COMPANY">Company</label>\n            <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n              <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n              <md-option ng-value="null">\n                <em translate="CONTACTMANAGER.NONE">None</em>\n              </md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class="md-icon-float md-block">\n            <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n              <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n            </md-select>\n          </md-input-container>\n\n          <div ng-if="vm.license.dialer">\n            <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n            <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n              <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n              <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n                <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n                <md-option ng-value="null" ng-hide="contactField.required">\n                  <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n\n        </md-content>\n\n        <div class="error-list" ng-if="vm.result.finish">\n          <div class="info" layout="row" layout-align="space-between center">\n            <div>\n              <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n            </div>\n            <md-button class="md-icon-button">\n              <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n            </md-button>\n          </div>\n        </div>\n\n        <div layout="row" ng-if="vm.processing">\n          \x3c!-- WIDGET PROCESSING --\x3e\n          <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n            \x3c!-- Front --\x3e\n            <ms-widget-front class="p-16 white-bg">\n              <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                <div class="md-display-1 pb-8 orange-fg">\n                  <span ng-bind="vm.result.rows"></span>\n                </div>\n                <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n              </div>\n            </ms-widget-front>\n            \x3c!-- / Front --\x3e\n          </ms-widget>\n          \x3c!-- / WIDGET PROCESSING --\x3e\n          \x3c!-- WIDGET SUCCESS --\x3e\n          <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n            \x3c!-- Front --\x3e\n            <ms-widget-front class="p-16 white-bg">\n              <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                <div class="md-display-1 pb-8 green-fg">\n                  <span ng-bind="vm.result.affectedRows"></span>\n                </div>\n                <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n              </div>\n            </ms-widget-front>\n            \x3c!-- / Front --\x3e\n          </ms-widget>\n          \x3c!-- / WIDGET SUCCESS --\x3e\n\n          \x3c!-- WIDGET FAILURE --\x3e\n          <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n            \x3c!-- Front --\x3e\n            <ms-widget-front class="p-16 white-bg">\n              <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                <div class="md-display-1 pb-8 red-fg">\n                  <span ng-bind="vm.result.failedRows"></span>\n                </div>\n                <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n              </div>\n            </ms-widget-front>\n            \x3c!-- / Front --\x3e\n          </ms-widget>\n          \x3c!-- / WIDGET FAILURE --\x3e\n\n          \x3c!-- WIDGET DUPLICATES --\x3e\n          <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n            \x3c!-- Front --\x3e\n            <ms-widget-front class="p-16 white-bg">\n              <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                <div class="md-display-1 pb-8 orange-fg">\n                  <span ng-bind="vm.result.duplicatedRows"></span>\n                </div>\n                <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n              </div>\n            </ms-widget-front>\n            \x3c!-- / Front --\x3e\n          </ms-widget>\n          \x3c!-- / WIDGET DUPLICATES --\x3e\n        </div>\n\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row">\n        <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n          IMPORT\n        </md-button>\n        <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n          STOP\n        </md-button>\n        <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/merge/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Merge Contact">\n  <form name="contactForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-input-container class="md-block" flex-gt-sm>\n        <label>Filter</label>\n        <input ng-model="vm.searchTerm" name="searchTerm" ng-model-options="{ debounce: 300 }" ng-change="vm.change()">\n      </md-input-container>\n\n      <md-list flex>\n        <md-subheader class="md-no-sticky" ng-hide="vm.contacts.length"><em>Filter doesn\'t match any contact</em></md-subheader>\n        <md-list-item class="md-3-line" ng-repeat="contact in vm.contacts | filter:{ id: \'!\' + vm.contact.id}" ng-click="vm.showConfirm($event, vm.contact, contact)">\n          <img ng-src="assets/images/avatars/profile.png" class="md-avatar" alt="{{contact.who}}" />\n          <div class="md-list-item-text" layout="column">\n            <h3>#{{ contact.id }} - {{ contact.firstName }} {{ contact.lastName }}</h3>\n            <h4>{{ contact.email }}</h4>\n            <p>{{ contact.phone }}</p>\n          </div>\n        </md-list-item>\n      </md-list>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",'<md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">\n  <form name="globalCustomFieldForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n        <input type="" name="alias" ng-model="vm.globalCustomField.alias" ng-required="true" autofocus>\n\n        <div ng-messages="globalCustomFieldForm[\'alias\'].$error" ng-show="globalCustomFieldForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.globalCustomField.type" required ng-disabled="!vm.newGlobalCustomField">\n          <md-option ng-value="\'text\'">Text</md-option>\n          <md-option ng-value="\'select\'">Select</md-option>\n          <md-option ng-value="\'number\'">Number</md-option>\n          <md-option ng-value="\'switch\'">Switch</md-option>\n          <md-option ng-value="\'datetime\'">Datetime</md-option>\n        </md-select>\n        <div ng-messages="globalCustomFieldForm[\'type\'].$error" ng-show="globalCustomFieldForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.globalCustomField.type == \'select\'" class="md-block">\n        <md-list>\n          <md-list-item layout-margin>\n            <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.globalCustomField.values);">\n              <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n              <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n            </md-button>\n            <md-button ng-if="vm.globalCustomField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.globalCustomField.values);">\n              <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n              <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n            </md-button>\n          </md-list-item>\n        </md-list>\n        <md-list ng-sortable="vm.sortable">\n          <md-list-item ng-repeat="item in vm.globalCustomField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n            <div>\n              <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n              <input type="text" ng-model="item.value" flex>\n            </div>\n            <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.globalCustomField.values, $index);">\n              <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n              <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n            </md-button>\n          </md-list-item>\n        </md-list>\n        <md-list>\n          <md-list-item ng-if="!vm.globalCustomField.values.length" layout="row" layout-align="center center">\n            <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n          </md-list-item>\n        </md-list>\n      </div>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.globalCustomField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.globalCustomField.type == \'text\'" class="md-block">\n        <md-switch ng-model="vm.globalCustomField.clickToAction" aria-label="ClickToAction"><span translate="CONTACTMANAGER.CLICKTOACTION">ClickToAction</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.globalCustomField.clickToAction" class="md-block">\n        <label translate="CONTACTMANAGER.ACTIONTYPE">ActionType</label>\n        <md-select name="actionType" ng-model="vm.globalCustomField.actionType">\n          <md-option ng-value="\'voice\'">Voice</md-option>\n        </md-select>\n        <div ng-messages="globalCustomFieldForm[\'actionType\'].$error" ng-show="globalCustomFieldForm[\'actionType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED">ActionType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGlobalCustomField" ng-click="vm.saveGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGlobalCustomField" ng-click="vm.addNewGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n          ADD GLOBALCUSTOMFIELD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGlobalCustomField" ng-click="vm.deleteGlobalCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",'<div id="globalCustomFields" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS">GlobalCustomFields</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedGlobalCustomFields.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedGlobalCustomFields =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CONTACTMANAGER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-globalCustomFields-count">\n          <span>{{vm.selectedGlobalCustomFields.length}}</span>\n          <span translate="CONTACTMANAGER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedGlobalCustomFields" csv-label="true" filename="globalCustomFields.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedGlobalCustomFields($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- GLOBALCUSTOMFIELD TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedGlobalCustomFields" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getGlobalCustomFields">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n                <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.globalCustomFields.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="globalCustomField" md-select-id="id" ng-repeat="globalCustomField in vm.globalCustomFields.rows">\n                <td md-cell ng-if="globalCustomField.userpic"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="api/users/{{globalCustomField.id}}/avatar" /></td>\n                <td md-cell ng-if="!globalCustomField.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="id ">{{globalCustomField.id}}</td>\n                <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="alias ">{{globalCustomField.alias}}</td>\n                <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="type ">{{ vm.arraytype[globalCustomField.type].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(globalCustomField, ev) : vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="required ">\n                  <md-icon md-colors="{color: {{globalCustomField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{globalCustomField.required ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(globalCustomField, $event    )" translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD">\n                          Edit GlobalCustomField\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(globalCustomField, $event    )" translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD">\n                          Delete GlobalCustomField\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.globalCustomFields.count}}" md-on-paginate="vm.getGlobalCustomFields" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / GLOBALCUSTOMFIELD TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-globalCustomField-button" ng-click="vm.createOrEditGlobalCustomField($event)" aria-label="add globalCustomField" translate translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/lists/create/dialog.html",'<md-dialog class="list-dialog" aria-label="New List">\n  <form name="listForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n\n        <div ng-messages="listForm[\'name\'].$error" ng-show="listForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.list.description">\n\n        <div ng-messages="listForm[\'description\'].$error" ng-show="listForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newList" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid || listForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newList" ng-click="vm.addNewList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_LIST" translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n          ADD LIST\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newList" ng-click="vm.deleteList($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",'<md-dialog class="list-dialog" aria-label="list" ng-init="vm.onInit()">\n  <form name="listForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="CONTACTMANAGER.AGENTADD_LIST">Add Agent to list</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",'<md-dialog class="customField-dialog" aria-label="New CustomField">\n  <form name="customFieldForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n        <input type="" name="alias" ng-model="vm.customField.alias" ng-required="true" autofocus>\n\n        <div ng-messages="customFieldForm[\'alias\'].$error" ng-show="customFieldForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="CONTACTMANAGER.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.customField.type" required ng-disabled="!vm.newCustomField">\n          <md-option ng-value="\'text\'">Text</md-option>\n          <md-option ng-value="\'select\'">Select</md-option>\n          <md-option ng-value="\'number\'">Number</md-option>\n          <md-option ng-value="\'switch\'">Switch</md-option>\n          <md-option ng-value="\'datetime\'">Datetime</md-option>\n        </md-select>\n        <div ng-messages="customFieldForm[\'type\'].$error" ng-show="customFieldForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.customField.type == \'select\'" class="md-block">\n        <md-list>\n          <md-list-item layout-margin>\n            <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.customField.values);">\n              <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n              <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n            </md-button>\n            <md-button ng-if="vm.customField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.customField.values);">\n              <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n              <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n            </md-button>\n          </md-list-item>\n        </md-list>\n        <md-list ng-sortable="vm.sortable">\n          <md-list-item ng-repeat="item in vm.customField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n            <div>\n              <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n              <input type="text" ng-model="item.value" flex>\n            </div>\n            <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.customField.values, $index);">\n              <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n              <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n            </md-button>\n          </md-list-item>\n        </md-list>\n        <md-list>\n          <md-list-item ng-if="!vm.customField.values.length" layout="row" layout-align="center center">\n            <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n          </md-list-item>\n        </md-list>\n      </div>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.customField.type == \'text\'" class="md-block">\n        <md-switch ng-model="vm.customField.clickToAction" aria-label="clickToAction"><span translate="CONTACTMANAGER.CLICKTOACTION">clickToAction</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.customField.clickToAction" class="md-block">\n        <label translate="CONTACTMANAGER.ACTIONTYPE">actionType</label>\n        <md-select name="actionType" ng-model="vm.customField.actionType">\n          <md-option ng-value="\'voice\'">Voice</md-option>\n        </md-select>\n        <div ng-messages="customFieldForm[\'actionType\'].$error" ng-show="customFieldForm[\'actionType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED">actionType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomField" ng-click="vm.saveCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid || customFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomField" ng-click="vm.addNewCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n          ADD CUSTOMFIELD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomField" ng-click="vm.deleteCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/view.html",'<div id="contactmanager-list" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-lists-button md-icon-button" aria-label="Go to lists" ng-click="vm.gotoLists()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_LISTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="list-image" hide-xs>\n          <img ng-src="assets/images/business/lists.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.list.id}}\n            <span ng-if="vm.list.name">{{vm.list.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.list.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="CONTACTMANAGER.GOTO_LIST"></span></md-tooltip>\n        <md-icon md-font-icon="icon-forward"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="CONTACTMANAGER.AGENTADD_LIST"></span></md-tooltip>\n        <md-icon md-font-icon="icon-eye"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveList()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (customFieldsForm.$invalid) || (voiceDispositionsForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="list-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.list.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="CONTACTMANAGER.PREFIX">Prefix</label>\n                <input type="text" name="dialPrefix" ng-model="vm.list.dialPrefix" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'dialPrefix\'].$error" ng-show="generalForm[\'dialPrefix\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="CONTACTMANAGER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.CUSTOMFIELDS">CUSTOMFIELDS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="list-detail-form-container customfields md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ListCustomFieldsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListCustomFields.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="CONTACTMANAGER.CUSTOMFIELDS">CustomFields</span>\n                  <ms-search-bar on-search="vm_dc.getListCustomFields()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditListCustomField($event)" aria-label="add customField" translate translate-attr-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListCustomFields.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedListCustomFields.length}} {{vm_dc.selectedListCustomFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListCustomFields" csv-label="true" filename="lists.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedListCustomFields($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedListCustomFields" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListCustomFields">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'CONTACTMANAGER.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="alias">\n                        {{ \'CONTACTMANAGER.ALIAS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="type">\n                        {{ \'CONTACTMANAGER.TYPE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="required">\n                        {{ \'CONTACTMANAGER.REQUIRED\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="customField" md-select-id="id" ng-repeat="customField in vm_dc.listCustomFields.rows">\n                      <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n                        {{customField.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n                        {{customField.alias}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n                        {{ vm_dc.arraytype[customField.type].option }} </td>\n\n                      <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell class="required ">\n                        <md-icon md-colors="{color: {{customField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{customField.required? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditListCustomField($event, customField)" translate="CONTACTMANAGER.EDIT_CUSTOMFIELD">\n                                Edit CustomField\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(customField, $event)" translate="CONTACTMANAGER.DELETE_CUSTOMFIELD">\n                                Delete CustomField\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.listCustomFields.rows.length">\n                      <td md-cell colspan="9">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="CONTACTMANAGER.NO_CUSTOMFIELD_AVAILABLE">No customfield available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.listCustomFields.count}}" md-on-paginate="vm_dc.getListCustomFields" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="CONTACTMANAGER.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="ListDispositionsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="list-detail-form-container voicedispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="CONTACTMANAGER.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add contactmanager dispositions" translate translate-attr-label="CONTACTMANAGER.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="lists.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/lists/lists.html",'<div id="lists" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="CONTACTMANAGER.LISTS">Lists</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedLists.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedLists =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="CONTACTMANAGER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-lists-count">\n          <span>{{vm.selectedLists.length}}</span>\n          <span translate="CONTACTMANAGER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllLists()" translate="CONTACTMANAGER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectLists()" translate="CONTACTMANAGER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedLists" csv-label="true" filename="lists.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedLists($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- LIST TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedLists" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getLists">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.lists.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="list" md-select-id="id" ng-repeat="list in vm.lists.rows">\n                <td md-cell ng-if="list.userpic"><img class="avatar" alt="{{list.name}}" ng-src="api/users/{{list.id}}/avatar" /></td>\n                <td md-cell ng-if="!list.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{list.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="id ">{{list.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="name ">{{list.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="description ">{{list.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(list, $event    )" translate="CONTACTMANAGER.EDIT_LIST">\n                          Edit List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotocontactsgoto(list, $event    )" translate="CONTACTMANAGER.GOTOCONTACTS_LIST">\n                          goToContacts List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadContactManagerLists">\n\n                        <md-button ng-click="vm.exportcsvcontactsexport(list, $event    )" translate="CONTACTMANAGER.EXPORTCSVCONTACTS_LIST">\n                          exportCsvContacts List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(list, $event    )" translate="CONTACTMANAGER.AGENTADD_LIST">\n                          AgentAdd List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(list, $event    )" translate="CONTACTMANAGER.DELETE_LIST">\n                          Delete List\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.lists.count}}" md-on-paginate="vm.getLists" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / LIST TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD LIST BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-list-button" ng-click="vm.createOrEditList($event)" aria-label="add list" translate translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD LIST BUTTON --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/custom/custom.html",'<div ng-if="!vm.customDashboard">\n  <p>Custom Dashboard not available...</p>\n</div>\n<div id="dashboard-custom" ng-if="vm.customDashboard" ng-cloak layout-fill>\n  <md-content>\n    <md-toolbar class="md-default md-accent filter-header">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead">{{vm.customDashboard.name}}</span>\n        <div flex></div>\n        <md-button ng-click="vm.setFilter($event)">\n          <md-tooltip md-direction="top"><span translate="DASHBOARDS.FILTERS"></span></md-tooltip>\n          <md-icon md-font-icon="icon-filter" ng-class=""></md-icon>\n        </md-button>\n        <md-button ng-if="vm.crudPermissions.canEdit" class="md-icon-button" ng-click="vm.goToEdit()" aria-label="goToEdit">\n          <md-tooltip md-direction="top"><span translate="DASHBOARDS.EDIT"></span></md-tooltip>\n          <md-icon md-font-icon="icon-table-edit"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <ms-widget-engine config="vm.customDashboard"></ms-widget-engine>\n  </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/custom/filter/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Set Filter">\n  <form name="FilterForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content style="padding:30px;">\n      <div layout="row" flex layout-align="space-between" layout-fill>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-phone"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_VOICE_QUEUES">Filter Voice Queues</span>\n          </div>\n          <md-select placeholder="Select one or more queues" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'voice\')" ng-model="vm.parent.voiceQueuesSelected" multiple aria-label="voiceQueues">\n            <md-option ng-value="voiceQueue.id" ng-repeat="voiceQueue in vm.parent.voiceQueues.rows">{{\n                            voiceQueue.name }}\n            </md-option>\n          </md-select>\n        </div>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-hangouts"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_CHAT_WEBSITES">Filter Chat\n              Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'chat\')" ng-model="vm.parent.chatWebsitesSelected" multiple aria-label="chatWebsite">\n            <md-option ng-value="chatWebsite.id" ng-repeat="chatWebsite in vm.parent.chatWebsites.rows">{{\n                            chatWebsite.name }}</md-option>\n          </md-select>\n        </div>\n      </div>\n      <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-message-text"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_SMS_ACCOUNTS">Filter Sms Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'sms\')" ng-model="vm.parent.smsAccountsSelected" multiple aria-label="smsAccount">\n            <md-option ng-value="smsAccount.id" ng-repeat="smsAccount in vm.parent.smsAccounts.rows">{{\n                            smsAccount.name }}</md-option>\n          </md-select>\n        </div>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-deskphone"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_FAX_ACCOUNTS">Filter Fax Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'fax\')" ng-model="vm.parent.faxAccountsSelected" multiple aria-label="faxAccount">\n            <md-option ng-value="faxAccount.id" ng-repeat="faxAccount in vm.parent.faxAccounts.rows">{{\n                            faxAccount.name }}</md-option>\n          </md-select>\n        </div>\n      </div>\n      <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-email"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_MAIL_ACCOUNTS">Filter Mail\n              Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'mail\')" ng-model="vm.parent.mailAccountsSelected" multiple aria-label="mailAccount">\n            <md-option ng-value="mailAccount.id" ng-repeat="mailAccount in vm.parent.mailAccounts.rows">{{\n                            mailAccount.name }}</md-option>\n          </md-select>\n        </div>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-google-earth"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_OPENCHANNEL_ACCOUNTS">Filter Openchannel\n              Websites</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'openchannel\')" ng-model="vm.parent.openchannelAccountsSelected" multiple aria-label="openchannelAccount">\n            <md-option ng-value="openchannelAccount.id" ng-repeat="openchannelAccount in vm.parent.openchannelAccounts.rows">{{\n                            openchannelAccount.name }}</md-option>\n          </md-select>\n        </div>\n      </div>\n      <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n        <div layout="column">\n          <div>\n            <i class="icon s16 icon-whatsapp"></i>\n            <span class="font-size-12" translate="DASHBOARDS.FILTER_WHATSAPP_ACCOUNTS">Filter Whatsapp\n              Accounts</span>\n          </div>\n          <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'whatsapp\')" ng-model="vm.parent.whatsappAccountsSelected" multiple aria-label="whatsappAccount">\n            <md-option ng-value="whatsappAccount.id" ng-repeat="whatsappAccount in vm.parent.whatsappAccounts.rows">\n              {{whatsappAccount.name }}</md-option>\n          </md-select>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.confirm()" class="send-button md-accent md-raised" aria-label="CONFIRM" translate="DASHBOARDS.CONFIRM" translate-attr-aria-label="DASHBOARDS.CONFIRM">\n          CONFIRM\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.html",'<div id="agent-general" layout="column">\n  <div layout="row" layout-align="start center" class="md-primary-bg">\n    <md-button class="md-raised no-margin width-50" style="border-radius: 0px" ng-class="{\'md-primary\': !vm.isActiveTab(0)}" ng-click="vm.onClickTab(0)" aria-label="home">\n      <md-tooltip md-direction="bottom" md-delay="500">Home</md-tooltip>\n      <md-icon md-font-icon="icon-home" class="icon"></md-icon>\n    </md-button>\n\n    <ms-tab-scroll style="overflow: hidden;">\n      <div layout="column" ng-repeat="(key, tab) in vm.tabs | orderByDate " ng-click="vm.onClickTab(tab.id)" ng-class="{\'grey-50-bg\': vm.isActiveTab(tab.id)}">\n        <div style="height: 34px" layout="row" layout-align="space-between center">\n          <md-icon md-font-icon="{{tab.icon}}" class="icon s16 margin-horizontal-5" ng-class="tab.color + \'-fg\'">\n          </md-icon>\n          <span class="text-truncate font-size-12" ng-class="vm.isActiveTab(tab.id) ? \'black-fg\' : \'grey-300-fg\'">\n            {{tab.title}}\n            <span ng-if="tab.badges" class="badge md-white-fg md-red-bg">{{tab.badges}}</span></span>\n          <md-button class="md-icon-button md-mini no-margin" ng-class="vm.isActiveTab(tab.id) ? \'md-primary\' : \'grey-300-fg\'" aria-label="close" ng-click="vm.closeTab(tab); $event.stopPropagation()">\n            <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n          </md-button>\n        </div>\n        <div style="height: 2px" ng-class="vm.isActiveTab(tab.id) ? tab.color + \'-bg\' : \'\'"></div>\n      </div>\n    </ms-tab-scroll>\n  </div>\n  \x3c!-- home --\x3e\n  <div layout="row" class="agent-content overflow-hidden" ng-if="vm.isActiveTab(0)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.html\'" ng-controller="AgentGeneralHomeController as vm_home" ng-init="vm_home.init(vm.license, vm.setting)"></div>\n  \x3c!-- other tabs --\x3e\n  <div ng-if="tab.id !== 0 && vm.isActiveTab(tab.id)" ng-repeat="(key, tab) in vm.tabs | orderByDate " ng-switch="tab.type" flex layout="column">\n    <div ng-switch-when="contact" ng-class="{{tab.type}}" flex layout="column">\n      <div class="agent-content" flex layout="column" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html\'" ng-controller="AgentGeneralContactController as vm" ng-init="vm.init(tab,$parent.vm.license)"></div>\n    </div>\n    <div ng-switch-when="popup" ng-class="{{tab.type}}" flex layout="column">\n      <div flex layout="column" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html\'" ng-controller="AgentGeneralPopupController as vm" ng-init="vm.init(tab)"></div>\n    </div>\n    <div ng-switch-when="jscripty" ng-class="{{tab.type}}" flex layout="column">\n      <div class="agent-content" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html\'" ng-controller="AgentGeneralJscriptyController as vm" ng-init="vm.init(tab)"></div>\n    </div>\n    <div ng-switch-when="bot" ng-class="{{tab.type}}" flex layout="column">\n      <div id="interaction-app" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html\'" ng-controller="AgentGeneralBotController as vm" ng-init="vm.init(tab, $parent.vm.setting)"></div>\n    </div>\n    <div ng-switch-when="interaction" ng-class="{{tab.type}}" flex layout="column">\n      <div id="interaction-app" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'" ng-controller="AgentGeneralInteractionController as vm" ng-init="vm.init(tab, $parent.vm.setting)">\n      </div>\n    </div>\n    <div ng-switch-when="iframe" ng-class="{{tab.type}}" flex layout="column">\n      <div id="iframe" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/iframe/agent.general.iframe.html\'" ng-controller="AgentGeneralIframeController as vm" ng-init="vm.init(tab, $parent.vm.setting)">\n      </div>\n    </div>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n  <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center">\n    <div class="big-circle md-whiteframe-4dp">\n      <md-icon class="s128 md-accent pink-fg" md-font-icon="fas fa-robot"></md-icon>\n    </div>\n    <span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n    <span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n      interaction...</span>\n  </div>\n\n  <div ng-if="vm.showInteraction" flex layout="row">\n    <md-card flex="100" class="interaction">\n      \x3c!-- TOOLBAR --\x3e\n      <md-toolbar class="interaction-toolbar">\n        <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n          <md-icon md-font-icon="fas fa-robot" class="s20 pink-fg"></md-icon>\n          <div class="padding-left-10" layout="column" layout-align="center start" flex>\n            <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n              <span>#{{vm.tab.data.uniqueid}} - {{vm.tab.title}}</span>\n            </div>\n          </div>\n          <div layout="row" layout-align="end center">\n\n          </div>\n        </div>\n      </md-toolbar>\n      \x3c!-- / TOOLBAR --\x3e\n\n      \x3c!-- CONTENT --\x3e\n      <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex layout-wrap>\n        <div class="interaction-messages">\n          \x3c!-- MESSAGES --\x3e\n          <div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n            <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n            <img ng-if="message.direction ===\'out\'" class="avatar" src="assets/images/avatars/robot.png">\n\n            <div class="bubble" ng-switch="message.direction">\n              <div>\n                <div ng-switch-when="in" class="time secondary-text">\n                  {{vm.tab.title}} - {{message.createdAt | date: \'medium\'}}\n                </div>\n                <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n                  <div layout-padding>\n                    System - {{message.createdAt | date: \'medium\'}}\n                  </div>\n                  <div>\n                    <md-icon class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n                  </div>\n                </div>\n              </div>\n              <div ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n            </div>\n          </div>\n          \x3c!-- / MESSAGES --\x3e\n        </div>\n      </md-content>\n      \x3c!-- / CONTENT --\x3e\n    </md-card>\n  </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html",'<md-tabs md-selected="vm.currentTab" md-dynamic-height>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.DETAIL">Detail</span>\n    </md-tab-label>\n    <md-tab-body>\n      <md-content>\n        <div layout="row" class="pr-10">\n          <div layout="row" flex="75" class="flex-scrollable only-x">\n            <md-card ng-repeat="call in vm.tab.calls track by call.uniqueid" class="call-info-card">\n              <md-progress-linear md-mode="indeterminate" ng-if="vm.checkingCallStatus"></md-progress-linear>\n              <md-card-header layout="row" layout-align="space-between">\n                <span ng-if="call.answertime" class="text-boxed indigo-100-bg ml-0">\n                  <timer start-time="call.answertime"></timer>\n                  <md-tooltip md-direction="bottom">\n                    {{ \'DASHBOARDS.ELAPSED_ANSWERED\' | translate }}\n                  </md-tooltip>\n                </span>\n                <span ng-if="call.disposedAt" class="text-boxed amber-200-bg">\n                  <timer start-time="call.disposedAt"></timer>\n                  <md-tooltip md-direction="bottom">\n                    {{ \'DASHBOARDS.ELAPSED_DISPOSED\' | translate }}\n                  </md-tooltip>\n                </span>\n                <md-button class="md-icon-button no-margin reload-button" ng-click="vm.checkCallStatus(call)" ng-disabled="vm.checkingCallStatus">\n                  <md-icon md-font-icon="icon-reload" class="s22"></md-icon>\n                  <md-tooltip md-direction="bottom">\n                    {{ \'DASHBOARDS.RELOAD\' | translate }}\n                  </md-tooltip>\n                </md-button>\n              </md-card-header>\n              <md-divider></md-divider>\n              <md-card-content>\n                <div layout="column" layout-align="space-between start" class="word-break-all mr-16">\n                  <div layout="row" layout-align="start center">\n                    <md-icon md-font-icon="{{ call.routeId ? \'icon-phone-outgoing\' : \'icon-phone-incoming\'}}" class="s20 mr-5">\n                    </md-icon>\n                    <span class="h2" privacy ng-cloak>{{ call.routeId ? call.destcalleridnum : call.calleridnum }}</span>\n                  </div>\n\n                  <div class="subtitle h4 secondary-text" ng-if="call.calleridname && call.calleridname != \'<unknown>\' && !call.routeId">\n                    <md-icon md-font-icon="icon-account" class="s20"></md-icon>\n                    Name: <span privacy ng-cloak>{{ call.calleridname }}</span>\n                  </div>\n\n                  <div class="text h4 pt-8" ng-if="call.queue">\n                    <md-icon md-font-icon="icon-stackoverflow" class="s20"></md-icon>\n                    Queue: {{call.queue}}\n                  </div>\n                  <div class="text h4 pt-8" ng-if="call.variables.extravar">\n                    <md-icon md-font-icon="icon-minus" class="s20"></md-icon>\n                    Extra: {{call.variables.extravar}}\n                  </div>\n                </div>\n                <div layout="row" layout-align="center end" class="mt-8">\n                  <md-button ng-if="call.disposedAt" type="submit" ng-click="vm.disposeCall($event, call)" class="send-button md-accent md-raised mr-0 mv-0">\n                    {{ \'DASHBOARDS.DISPOSE\' | translate}}\n                  </md-button>\n                </div>\n              </md-card-content>\n            </md-card>\n          </div>\n          <div flex="25" layout="row" layout-md="column" layout-sm="column" layout-align="end center" layout-align-md="center center">\n            <md-button type="submit" ng-click="vm.mergeContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="merge">\n              <md-tooltip md-direction="top"><span translate="DASHBOARDS.MERGE"></span></md-tooltip>\n              <md-icon md-font-icon="icon-source-fork"></md-icon>\n            </md-button>\n            <md-button type="submit" ng-click="vm.duplicateContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="duplicate">\n              <md-tooltip md-direction="top"><span translate="DASHBOARDS.DUPLICATE"></span></md-tooltip>\n              <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n            </md-button>\n            <md-button type="submit" ng-click="vm.addNewContact($event)" class="send-button md-accent md-raised" ng-if="vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="add">\n              {{ \'DASHBOARDS.ADD\'| translate }}\n            </md-button>\n            <md-button type="submit" ng-click="vm.saveContact($event)" class="send-button md-accent md-raised" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="save">\n              {{ \'DASHBOARDS.SAVE\' | translate }}\n            </md-button>\n          </div>\n        </div>\n        <div layout="row">\n          <div layout="column" flex="75">\n            <md-card layout-padding>\n              <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.PERSONAL_INFO">\n                PERSONAL_INFO</div>\n              <div class="subtitle secondary-text">\n                <span translate="CONTACTMANAGER.CREATED_AT"></span>\n                <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n              </div>\n\n              <form name="vm.detailForm" novalidate>\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.FIRSTNAME">First Name</label>\n                      <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n                      <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required privacy ng-cloak>\n                      <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n                        <div ng-message="required">\n                          <span translate="DASHBOARDS.ERRORS.FIRSTNAME_REQUIRED">First name\n                            field is required</span>\n                        </div>\n                      </div>\n                    </md-input-container>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.jscripty" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="JSCRIPTY PROJECTS" ng-click="$mdOpenMenu($event); vm.getJscriptyProjects();" aria-label="jscripty">\n                          <md-icon md-font-icon="icon-script"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingJscriptyProjects">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingJscriptyProjects && vm.jscriptyProjects.count > 0" ng-repeat="project in vm.jscriptyProjects.rows">\n                            <md-button ng-click="vm.addJscriptyTab(project, $event)">\n                              <md-icon md-font-icon="icon-script"></md-icon>\n                              {{project.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingJscriptyProjects && (!vm.jscriptyProjects || vm.jscriptyProjects.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_JSCRIPTY_PROJECTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-script"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                  </div>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.LASTNAME">Last Name</label>\n                    <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" privacy ng-cloak>\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.PHONE">Phone</label>\n                      <md-icon md-font-icon="icon-phone"></md-icon>\n                      <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" privacy ng-cloak>\n                      <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.phone" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n                    </md-input-container>\n                    <div>\n                      \x3c!-- click to call directive --\x3e\n                      <ms-click-to-call target="vm.contact.phone" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n                      \x3c!--  / click to call directive --\x3e\n                    </div>\n                  </div>\n                  <div flex="5"></div>\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.MOBILE">Mobile</label>\n                      <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n                      <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" privacy ng-cloak>\n                      <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.mobile" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n                    </md-input-container>\n                    <div>\n                      \x3c!-- click to call directive --\x3e\n                      <ms-click-to-call target="vm.contact.mobile" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n                      \x3c!--  / click to call directive --\x3e\n                    </div>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.messaging || !vm.hasPermission(107) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW SMS" ng-click="$mdOpenMenu($event); vm.getAccounts(\'sms\')" aria-label="sms">\n                          <md-icon md-font-icon="icon-message-text"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingAccounts">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && vm.smsAccounts.count > 0" ng-repeat="account in vm.smsAccounts.rows">\n                            <md-button ng-click="vm.composeInteraction($event, \'Sms\', account, vm.contact.mobile)">\n                              <md-icon md-font-icon="icon-message-text"></md-icon>\n                              {{account.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && (!vm.smsAccounts || vm.smsAccounts.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_SMS_ACCOUNTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-message-text"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.whatsapp || !vm.hasPermission(114) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW WHATSAPP" ng-click="$mdOpenMenu($event); vm.getAccounts(\'whatsapp\')" aria-label="whatsapp">\n                          <md-icon md-font-icon="icon-whatsapp"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingAccounts">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && vm.whatsappAccounts.count > 0" ng-repeat="account in vm.whatsappAccounts.rows">\n                            <md-button ng-click="vm.composeInteraction($event, \'Whatsapp\', account, vm.contact.mobile)">\n                              <md-icon md-font-icon="icon-whatsapp"></md-icon>\n                              {{account.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && (!vm.whatsappAccounts || vm.whatsappAccounts.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_WHATSAPP_ACCOUNTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-whatsapp"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                  </div>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.EMAIL">Email</label>\n                      <md-icon md-font-icon="icon-email" class="email"></md-icon>\n                      <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" privacy ng-cloak>\n                      <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n                        <div ng-message="email">\n                          <span translate="DASHBOARDS.ERRORS.EMAIL_MUST_VALID">Email must be a\n                            valid e-mail address</span>\n                        </div>\n                      </div>\n                    </md-input-container>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.mail || !vm.hasPermission(106) || !vm.contact.email" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW EMAIL" ng-click="$mdOpenMenu($event); vm.getAccounts(\'mail\')" aria-label="email">\n                          <md-icon md-font-icon="icon-email"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingAccounts">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && vm.mailAccounts.count > 0" ng-repeat="account in vm.mailAccounts.rows">\n                            <md-button ng-click="vm.composeInteraction($event, \'Mail\', account, vm.contact.email)">\n                              <md-icon md-font-icon="icon-email"></md-icon>\n                              {{account.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && (!vm.mailAccounts || vm.mailAccounts.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_MAIL_ACCOUNTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-email"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                  </div>\n                  <div flex="5"></div>\n                  <div layout="row" flex>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="DASHBOARDS.FAX">Fax</label>\n                      <md-icon md-font-icon="icon-deskphone"></md-icon>\n                      <input type="text" name="fax" ng-model="vm.contact.fax" privacy ng-cloak>\n                    </md-input-container>\n                    <div>\n                      <md-menu ng-if="!vm.newContact">\n                        <md-button ng-disabled="!vm.license.fax || !vm.hasPermission(109) || !vm.contact.fax" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW FAX" ng-click="$mdOpenMenu($event); vm.getAccounts(\'fax\')" aria-label="fax">\n                          <md-icon md-font-icon="icon-deskphone"></md-icon>\n                        </md-button>\n                        <md-menu-content>\n                          <md-menu-item ng-if="vm.loadingAccounts">\n                            <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n                            </md-progress-circular>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && vm.faxAccounts.count > 0" ng-repeat="account in vm.faxAccounts.rows">\n                            <md-button ng-click="vm.composeInteraction($event, \'Fax\', account, vm.contact.fax)">\n                              <md-icon md-font-icon="icon-deskphone"></md-icon>\n                              {{account.name}}\n                            </md-button>\n                          </md-menu-item>\n                          <md-menu-item ng-if="!vm.loadingAccounts && (!vm.faxAccounts || vm.faxAccounts.count === 0)">\n                            <md-button disabled translate="DASHBOARDS.NO_FAX_ACCOUNTS_AVAILABLE">\n                              <md-icon md-font-icon="icon-deskphone"></md-icon>\n                            </md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </div>\n                  </div>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.DATE_OF_BIRTH">Date of Birth</label>\n                    <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n                  </md-input-container>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n                    <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.COMPANY">Company</label>\n                    <md-icon md-font-icon="icon-domain" class="email"></md-icon>\n                    <md-select name="company" ng-model="vm.contact.CompanyId">\n                      <md-option ng-value="company.id" ng-repeat="company in vm.tab.companies.rows">{{company.name}}\n                      </md-option>\n                      <md-option ng-value="null"><em translate="DASHBOARDS.NONE">None</em>\n                      </md-option>\n                    </md-select>\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.TAG">TAG</label>\n                    <md-icon md-font-icon="icon-tag"></md-icon>\n                    <md-select ng-model="vm.tab.Tags" multiple>\n                      <md-option ng-value="tag.id" ng-repeat="tag in vm.tab.tags.rows">\n                        {{tag.name}}</md-option>\n                    </md-select>\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.COUNTRY">Country</label>\n                    <md-icon md-font-icon="icon-home" class="country"></md-icon>\n                    <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.CITY">City</label>\n                    <input type="text" name="city" ng-model="vm.contact.city">\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.STREET">Street</label>\n                    <input type="text" name="street" ng-model="vm.contact.street">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate="DASHBOARDS.POSTALCODE">Postal Code</label>\n                    <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n                  </md-input-container>\n                </div>\n\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label translate translate-attr-placeholder="DASHBOARDS.NOTES">Notes</label>\n                    <md-icon md-font-icon="icon-note"></md-icon>\n                    <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n                  </md-input-container>\n                </div>\n              </form>\n            </md-card>\n            <md-card layout-padding>\n              <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.SOCIAL">Social</div>\n              <form name="vm.socialForm" novalidate>\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Facebook</label>\n                    <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n                    <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Twitter</label>\n                    <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n                    <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n                  </md-input-container>\n                </div>\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Line</label>\n                    <md-icon md-font-icon="fab fa-line"></md-icon>\n                    <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Viber</label>\n                    <md-icon md-font-icon="fab fa-viber"></md-icon>\n                    <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n                  </md-input-container>\n                </div>\n                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>WeChat</label>\n                    <md-icon md-font-icon="fab fa-weixin"></md-icon>\n                    <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n                  </md-input-container>\n                  <div flex="5"></div>\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <label>Telegram</label>\n                    <md-icon md-font-icon="icon-telegram"></md-icon>\n                    <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n                  </md-input-container>\n                </div>\n              </form>\n            </md-card>\n          </div>\n          <div flex="25" layout="column" layout-padding>\n            <md-card flex="100" layout-padding>\n              <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.CUSTOM_FIELDS">CUSTOM\n                FIELDS</div>\n              <form name="vm.customFieldsForm" novalidate>\n\n                \x3c!-- START INPUT LIST --\x3e\n                <md-input-container class="md-block">\n                  <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n                  <md-select name="list" ng-disabled="!vm.newContact" ng-model="vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n                    <md-optgroup label="Lists">\n                      <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}\n                      </md-option>\n                    </md-optgroup>\n                  </md-select>\n                </md-input-container>\n                \x3c!-- END INPUT LIST --\x3e\n\n                <div ng-repeat="customField in vm.tab.customFields.rows" ng-switch="customField.type">\n                  <md-input-container class="md-block" ng-switch-when="datetime">\n                    <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n                    <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n                      <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]">\n                      </mdp-date-picker>\n                      <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n                      </mdp-time-picker>\n                    </div>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-when="select">\n                    <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n                    <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n                      <md-option ng-repeat="value in customField.values" ng-value="value.value">\n                        {{value.value}}</md-option>\n                      <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em>\n                      </md-option>\n                    </md-select>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-when="switch">\n                    <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n                      {{customField.alias}}<span ng-if="customField.required">*</span>\n                    </md-switch>\n                  </md-input-container>\n\n                  <md-input-container class="md-block" ng-switch-default>\n                    <div layout-gt-sm="row" class="layout-gt-sm-row"></div>\n                    <div layout="row" flex>\n                      <md-input-container class="md-block" flex-gt-sm="">\n                        <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n                        <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n                      </md-input-container>\n                      <ms-click-to-call ng-if="customField.clickToAction && customField.actionType === \'voice\'" target="vm.contact[\'cf_\' + customField.id]" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n                    </div>\n                  </md-input-container>\n                </div>\n              </form>\n            </md-card>\n          </div>\n        </div>\n      </md-content>\n    </md-tab-body>\n  </md-tab>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Customer Journey</span>\n    </md-tab-label>\n    <md-tab-body>\n      <md-content class="md-padding" id="journey-content">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n        </div>\n      </md-content>\n    </md-tab-body>\n  </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n  <form name="disposition" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" ng-if="!vm.call.mandatoryDisposition">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div ng-if="!vm.isReschedule">\n        <md-input-container class="md-block">\n          <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n          <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n              {{ disposition.name }}</md-option>\n          </md-select>\n          <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n            <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n              <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n                {{ disposition.name }}</md-option>\n            </md-select>\n          </md-input-container>\n          <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n            <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n            </md-icon>\n          </md-button>\n        </div>\n        <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n            <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition" ng-change="vm.onDispositionChange(\'third\')">\n              <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true">\n                {{ disposition.name }}</md-option>\n            </md-select>\n          </md-input-container>\n          <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n            <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n            </md-icon>\n          </md-button>\n        </div>\n        <md-input-container class="md-block">\n          <label translate="DASHBOARDS.NOTE">Note</label>\n          <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n        </md-input-container>\n        <md-input-container class="md-block" ng-if="vm.availableCalls === 1">\n          <md-switch ng-model="vm.autoClose" aria-label="Auto Close">\n            <span translate="DASHBOARDS.AUTOCLOSE">Automatically close contact tab after disposal</span>\n          </md-switch>\n        </md-input-container>\n      </div>\n      <div ng-if="vm.isReschedule">\n        <div layout="row">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-change="vm.recalcTZTime()" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n              <div ng-messages="disposition.date.$error" ng-show="disposition.date.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" ng-change="vm.recalcTZTime()" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n              <div ng-messages="disposition.time.$error" ng-show="disposition.time.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </div>\n        <div layout="row">\n          <div flex class="md-block">\n            <md-input-container class="md-block" flex-gt-sm="">\n              <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n              <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n            </md-input-container>\n          </div>\n          <div flex class="md-block">\n            <md-input-container class="md-block">\n              <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n              <input type="text" readonly value="{{vm.hopper.scheduledAt}}">\n            </md-input-container>\n          </div>\n        </div>\n        <div ng-if="(!vm.dialer || (vm.dialer && vm.recallme && vm.user.selectRecallMeCampaign)) && vm.queueCampaigns.rows.length > 0" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.CAMPAIGN">Campaign</label>\n            <md-select name="queueCampaign" ng-model="vm.queueCampaign" required>\n              <md-option ng-value="queueCampaign" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n                <md-icon md-font-icon="icon-checkbox-blank-circle" ng-class="{\'green-fg\': queueCampaign.dialActive}" aria-label="Status">\n                </md-icon>\n                {{ queueCampaign.name }}\n              </md-option>\n            </md-select>\n            <div ng-messages="disposition.queueCampaign.$error" ng-show="disposition.queueCampaign.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="DASHBOARDS.ERRORS.CAMPAIGN_REQUIRED">Campaign field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions ng-if="!vm.isReschedule" layout="row">\n      <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()" ms-dialog-spinner>\n        {{(vm.selectedDisposition.name ? \'DASHBOARDS.DISPOSE\' : \'DASHBOARDS.SAVE\') | translate}}\n      </md-button>\n      <md-button class="send-button md-raised md-primary" translate="DASHBOARDS.RESCHEDULE" ng-click="vm.saveDisposition(\'reschedule\')">\n        Reschedule\n      </md-button>\n      <md-button class="send-button md-accent md-raised" translate="DASHBOARDS.RECALLME" ng-click="vm.saveDisposition(\'recallme\')">\n        Recall Me\n      </md-button>\n      <span flex></span>\n      <md-button ng-if="vm.hasBlackLists" class="md-raised md-warn" translate="DASHBOARDS.BLACKLIST" ng-click="vm.saveDisposition(\'blacklist\')">\n        Blacklist\n      </md-button>\n    </md-dialog-actions>\n    <md-dialog-actions ng-if="vm.isReschedule" layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveReschedule()" class="send-button md-accent md-raised" ng-disabled="disposition.$invalid || disposition.$pristine || vm.disable" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/reschedule/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n  <form name="dateTime" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div layout="row">\n        <div flex class="md-block">\n          <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n            <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n              </div>\n            </div>\n          </mdp-date-picker>\n        </div>\n\n        <div flex class="md-block">\n          <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n            <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n              </div>\n              <div ng-message="format">\n                <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveDialog()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/selection/dialog.html",'<md-dialog ng-init="vm.onInit()" class="contact-trigger-dialog" aria-label="Select contact" ng-cloak>\n  <md-toolbar class="red-bg">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n      <span class="title">{{ \'DASHBOARDS.SELECT_CONTACT\' | translate }}</span>\n    </div>\n  </md-toolbar>\n  <md-dialog-content class="h-400 pv-16">\n    <div layout="row" class="p-10">\n      <span class="font-size-16">{{ \'DASHBOARDS.MULTIPLE_CONTACTS_FOUND\' | translate }}<strong>&nbsp;{{ vm.callNumber }}</strong>.</span>\n      <span class="font-size-16">&nbsp;{{ \'DASHBOARDS.WHICH_ONE_TO_USE\' | translate }}</span>\n    </div>\n    <md-grid-list md-cols-xs="1" md-cols="2" md-row-height="fit" ng-class="vm.paginatedContacts[vm.page - 1].length > 2 ? \'two-rows-layout\' : \'one-row-layout\'" flex>\n      <md-grid-tile ng-repeat="contact in vm.paginatedContacts[vm.page - 1]" md-rowspan="1">\n        <md-card layout="column" class="contact-info" no-padding no-margin ng-click="vm.selectedContact = contact;" ng-class="{ \'light-blue-50-bg\' : vm.selectedContact && vm.selectedContact.id === contact.id }" flex>\n          <md-card-title class="pt-16">\n            <md-card-title-text layout-align="center start">\n              <span class="font-size-16 text-bold">#{{ contact.id }} -\n                <span privacy ng-cloak>{{ contact.firstName }} {{ contact.lastName }}</span>\n              </span>\n              <em class="font-size-12">{{ \'DASHBOARDS.LAST_UPDATED\' | translate }}: {{ contact.updatedAt }}</em>\n              <span class="font-size-12">{{ \'DASHBOARDS.LIST\' | translate }}: {{ vm.lists[contact.ListId] }}</span>\n            </md-card-title-text>\n            <md-button class="md-icon-button no-margin" aria-label="Selected">\n              <md-icon md-font-icon="{{ vm.selectedContact && vm.selectedContact.id === contact.id ? \'icon-checkbox-marked-circle\' : \'icon-checkbox-blank-circle-outline\' }}" ng-class="{ \'green-fg\': vm.selectedContact && vm.selectedContact.id === contact.id }"></md-icon>\n            </md-button>\n          </md-card-title>\n          <md-divider></md-divider>\n          <md-card-content layout="row" layout-align="center start" class="p-10">\n            <span class="font-size-16">{{ \'DASHBOARDS.MATCHING_FIELD\' | translate }}:\n              <strong privacy ng-cloak>{{ contact.matchingField }}</strong>\n            </span>\n          </md-card-content>\n        </md-card>\n      </md-grid-tile>\n    </md-grid-list>\n  </md-dialog-content>\n  <md-dialog-actions layout="row">\n    <div ng-if="vm.paginatedContacts.length > 1" layout="row" layout-align="center center" flex>\n      <md-button ng-click="vm.page = vm.page - 1;" class="md-icon-button no-margin" ng-class="{ \'hidden\': vm.page <= 1 }" aria-label="Previous page">\n        <md-icon md-font-icon="icon-chevron-double-left"></md-icon>\n      </md-button>\n      <span>{{ \'DASHBOARDS.PAGE\' | translate }} {{ vm.page }} {{ \'DASHBOARDS.OF\' | translate }}\n        {{ vm.paginatedContacts.length }}</span>\n      <md-button ng-click="vm.page = vm.page + 1;" class="md-icon-button no-margin" ng-class="{ \'hidden\': !vm.paginatedContacts[vm.page] }" aria-label="Next page">\n        <md-icon md-font-icon="icon-chevron-double-right"></md-icon>\n      </md-button>\n    </div>\n    <md-button ng-click="vm.selectContact()" class="select-button md-accent md-raised" ng-disabled="!vm.selectedContact" aria-label="Select" translate="DASHBOARDS.SELECT" translate-attr-aria-label="DASHBOARDS.SELECT">\n      SELECT\n    </md-button>\n  </md-dialog-actions>\n</md-dialog>vc'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html",'<div ng-cloak>\n  <md-content>\n    <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n      <md-tab ng-if="vm_home.hasPermission(110)" label="{{\'DASHBOARDS.VOICE\' | translate}}">\n        <md-content ng-if="vm.selectedTab === 0" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html\'" ng-controller="AgentHomeAbandonedVoiceController as vm_voice">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="{{\'DASHBOARDS.MOTION_BULL\' | translate}}">\n        <md-content ng-if="vm.selectedTab === 1" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html\'" ng-controller="AgentHomeAbandonedBullController as vm_bull">\n        </md-content>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header blue-bg" ng-class="{\'h-128\' : vm_bull.isSearchBarVisible === true}">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n      <ms-search-bar on-search="vm_bull.getAbandonedCalls()" query="vm_bull.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm_bull.isSearchBarVisible"></ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm_bull.quickFilters" query="vm_bull.query" search="vm_bull.getAbandonedCalls()"></ms-quick-filter>\n      <md-button class="md-icon-button reload-list" ng-click="vm_bull.refresh && vm_bull.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n        <md-icon md-font-icon="icon-reload"></md-icon>\n        <md-tooltip ng-if="vm_bull.showTooltip" md-visible="vm_bull.showTooltip">\n          {{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm_bull.promise">\n      <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getAbandonedCalls">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n          <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n          <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n          <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n          <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}\n          </th>\n          <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n          <th md-column md-order-by="secondDisposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n          <th md-column md-order-by="thirdDisposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n          <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm_bull.abandonedCalls.rows.length">\n          <td md-cell colspan="12">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="abandonedCall in vm_bull.abandonedCalls.rows">\n          <td md-cell class="id">{{abandonedCall.id}}</td>\n          <td md-cell class="firstName" privacy ng-cloak>{{abandonedCall.calleridname}}</td>\n          <td md-cell class="phone">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_bull.currentUser.name">\n            </ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="list">{{vm_bull.queuesMap[abandonedCall.queue]}}</td>\n          <td md-cell class="list">\n            {{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : (abandonedCall.queuecallerexitAt | formatdate) }}\n          </td>\n          <td md-cell class="list">\n            {{abandonedCall.queuecallerexitAt ? (abandonedCall.queuecallerexitAt | formatdate) : undefined }}\n          </td>\n          <td md-cell class="list">{{abandonedCall.queuecallerexitreason}}</td>\n          <td md-cell class="list">{{ abandonedCall.disposition }}</td>\n          <td md-cell class="list">{{ abandonedCall.secondDisposition }}</td>\n          <td md-cell class="list">{{ abandonedCall.thirdDisposition }}</td>\n          <td md-cell class="actions">\n            <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_bull.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_bull.reserved(abandonedCall)">\n            </md-switch>\n          </td>\n          <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n          <td md-cell class="actions">\n            <md-menu ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name">\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="1">\n                <md-menu-item>\n                  <md-button ng-click="vm_bull.dispose(abandonedCall)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.abandonedCalls.count}}" md-on-paginate="vm_bull.getAbandonedCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n  <form name="disposition" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div>\n        <md-input-container class="md-block">\n          <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n          <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n              {{ disposition.name }}</md-option>\n          </md-select>\n          <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n            <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n              <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n                {{ disposition.name }}</md-option>\n            </md-select>\n          </md-input-container>\n          <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n            <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n            </md-icon>\n          </md-button>\n        </div>\n        <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n          <md-input-container class="md-block" flex>\n            <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n            <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition" ng-change="vm.onDispositionChange(\'third\')">\n              <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true">\n                {{ disposition.name }}</md-option>\n            </md-select>\n          </md-input-container>\n          <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n            <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n            </md-icon>\n          </md-button>\n        </div>\n        <md-input-container class="md-block">\n          <label translate="DASHBOARDS.NOTE">Note</label>\n          <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n        </md-input-container>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()">\n'+"          {{(vm.selectedDisposition.name ? 'DASHBOARDS.DISPOSE' : 'DASHBOARDS.SAVE') | translate}}\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>"),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header blue-bg" ng-class="{\'h-128\' : vm_voice.isSearchBarVisible === true}">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n      <ms-search-bar on-search="vm_voice.getAbandonedCalls()" query="vm_voice.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm_voice.isSearchBarVisible"></ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm_voice.quickFilters" query="vm_voice.query" search="vm_voice.getAbandonedCalls()"></ms-quick-filter>\n      <md-button class="md-icon-button reload-list" ng-click="vm_voice.refresh && vm_voice.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n        <md-icon md-font-icon="icon-reload"></md-icon>\n        <md-tooltip ng-if="vm_voice.showTooltip" md-visible="vm_voice.showTooltip">\n          {{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm_voice.promise">\n      <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getAbandonedCalls">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n          <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n          <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n          <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n          <th md-column md-order-by="secondDisposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n          <th md-column md-order-by="thirdDisposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n          <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm_voice.abandonedCalls.rows.length">\n          <td md-cell colspan="12">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="abandonedCall in vm_voice.abandonedCalls.rows">\n          <td md-cell class="id">{{abandonedCall.id}}</td>\n          <td md-cell class="firstName" privacy ng-cloak>{{abandonedCall.calleridname}}</td>\n          <td md-cell class="phone">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_voice.currentUser.name">\n            </ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="list">{{vm_voice.queuesMap[abandonedCall.queue]}}</td>\n          <td md-cell class="list">\n            {{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : (abandonedCall.queuecallerexitAt | formatdate) }}\n          </td>\n          <td md-cell class="list">{{ abandonedCall.disposition }}</td>\n          <td md-cell class="list">{{ abandonedCall.secondDisposition }}</td>\n          <td md-cell class="list">{{ abandonedCall.thirdDisposition }}</td>\n          <td md-cell class="actions">\n            <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_voice.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_voice.reserved(abandonedCall)">\n            </md-switch>\n          </td>\n          <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n          <td md-cell class="actions">\n            <md-menu ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name">\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="1">\n                <md-menu-item>\n                  <md-button ng-click="vm_voice.dispose(abandonedCall)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.abandonedCalls.count}}" md-on-paginate="vm_voice.getAbandonedCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.html",'<div layout="column" layout-align="start center" class="agent-general-home-navbar md-primary-bg width-50">\n  <div ng-repeat="node in vm_home.navigation">\n    <div ng-repeat="home in node.children">\n      <md-button ng-repeat="button in home.children  | orderBy:\'weight\'" ng-if="!button.hidden()" class="md-raised width-50 height-50 no-margin" style="border-radius: 0px" aria-label="{{button.state}}" ng-click="vm_home.changeSidebarTab(button)" ng-class="{\'md-primary\': vm_home.sidebar != button.state}">\n        <md-tooltip md-direction="right" md-delay="500"><span translate="{{button.translate}}"></span>\n        </md-tooltip>\n        <md-icon md-font-icon="{{button.icon}}" ng-class="button.iconClass"></md-icon>\n      </md-button>\n    </div>\n  </div>\n</div>\n<div class="agent-general-home-sections" layout="column" flex>\n  <div layout="column" flex>\n    <div ng-switch="vm_home.sidebar" style="overflow-y: auto; overflow-x: hidden" flex>\n      <div ng-switch-when="agentPresence" class="home-agent-presence">\n        <div ng-if="vm_home.hasPermission(115)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/agent.general.presence.html\'" ng-controller="AgentHomePresenceController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(115)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="contacts" class="home-contacts">\n        <div ng-if="vm_home.hasPermission(102) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html\'" ng-controller="AgentHomeContactsController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(102) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="mycontacts" class="home-mycontacts">\n        <div ng-if="vm_home.hasPermission(103) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html\'" ng-controller="AgentHomeMyContactsController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(103) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="scheduled" class="home-scheduled">\n        <div ng-if="vm_home.hasPermission(113) && vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html\'" ng-controller="AgentHomeScheduledCallsController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(113) || !vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="voice" class="home-voice">\n        <div ng-if="vm_home.hasPermission(110) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html\'" ng-controller="AgentHomeVoiceController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(110) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="abandoned" class="home-abandoned">\n        <div ng-if="vm_home.hasPermission(111) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html\'" ng-controller="AgentHomeAbandonedController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(111) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="recordings" class="home-recordings">\n        <div ng-if="vm_home.hasPermission(104) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html\'" ng-controller="AgentHomeRecordingsController as vm"></div>\n        <div ng-if="!vm_home.hasPermission(104) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="chat" class="home-chat">\n        <div ng-if="vm_home.hasPermission(105) && vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html\'" ng-controller="AgentHomeChatController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(105) || !vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="mail" class="home-mail">\n        <div ng-if="vm_home.hasPermission(106) && vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html\'" ng-controller="AgentHomeMailController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(106) || !vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="sms" class="home-sms">\n        <div ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html\'" ng-controller="AgentHomeSmsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(107) || !vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="openchannel" class="home-openchannel">\n        <div ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html\'" ng-controller="AgentHomeOpenchannelController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(108) || !vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="fax" class="home-fax">\n        <div ng-if="vm_home.hasPermission(109) && vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html\'" ng-controller="AgentHomeFaxController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(109) || !vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="whatsapp" class="home-whatsapp">\n        <div ng-if="vm_home.hasPermission(114) && vm_home.license.whatsapp" ng-include="\'app/main/apps/dashboards/views/general/agent/home/whatsapp/agent.general.whatsapp.html\'" ng-controller="AgentHomeWhatsappController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n        </div>\n        <div ng-if="!vm_home.hasPermission(114) || !vm_home.license.whatsapp" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="plugin" class="home-plugin" layout-fill>\n        <div ng-if="vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html\'" ng-controller="AgentHomePluginsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting, vm_home.plugin)" layout-fill></div>\n        <div ng-if="!vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n      <div ng-switch-default class="home-default">\n        <div ng-if="vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html\'" ng-controller=" AgentHomeDashboardController  as vm"></div>\n        <div ng-if="!vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n        </div>\n      </div>\n    </div>\n  </div>\n  <div ng-if="(vm_home.draftManager.drafts | json) != \'{}\'" layout="column" class="draft-manager-bar">\n    <ms-tab-scroll>\n      <div layout="column" ng-repeat="(key, draft) in vm_home.draftManager.drafts" class="grey-50-bg" ng-click="vm_home.draftManager.open(draft.id)">\n        <div class="draft-manager-tab" layout="row" layout-align="space-between center">\n          <md-icon md-font-icon="icon-pencil" class="icon s16 margin-horizontal-5 black-fg"></md-icon>\n          <span class="text-truncate font-size-12 black-fg">{{draft.title}}</span>\n          <md-button class="md-icon-button md-mini no-margin md-primary" aria-label="close" ng-click="vm_home.draftManager.remove(draft.id)">\n            <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </ms-tab-scroll>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html",'<md-content layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n  <div layout="column" layout-align="space-around center" flex="50">\n    <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n    <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n  </div>\n\n  <div layout="column" flex="50">\n    <img src="assets/images/avatars/permissions.png" alt="permissions">\n  </div>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.CHAT_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getChatInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getChatInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getChatInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.WEBSITE\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.chatInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.chatInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="chatAccount">\n            {{ vm.getChatWebsiteLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showChatInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Chat\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n                  <md-button ng-click="vm.downloadChatInteraction($event, interaction, true)" translate="CHAT.DOWNLOAD_WITH_ATTACHMENTS">\n                    Download with attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadChatInteraction($event, interaction)" translate="CHAT.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                    Download without attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatInteractions.count}}" md-on-paginate="vm.getChatInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.CONTACTS">Contacts</span>\n      <ms-search-bar on-search="vm.getContacts()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getContacts()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button ng-if="vm.lists.rows && vm.lists.rows.length" class="md-icon-button create-new" ng-click="vm.openContact()" aria-label="Add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n          <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n          <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n          <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.CREATEDAT\' | translate}}</th>\n          <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.contacts.rows.length">\n          <td md-cell colspan="10">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="contact in vm.contacts.rows">\n          <td ng-click="vm.openContact(contact.id)" md-cell class="id">{{contact.id}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="firstName" privacy ng-cloak>{{contact.firstName}}\n            {{contact.lastName}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="phone">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="mobile">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="fax" privacy ng-cloak>{{contact.fax}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="email" privacy ng-cloak>{{contact.email}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="createdAt">{{contact.createdAt | formatdate}}</td>\n          <td ng-click="vm.openContact(contact.id)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}\n          <td md-cell class="tag">\n            <div ng-if="contact.Tags.length">\n              <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n                <span class="text-truncate">{{contact.Tags[0].name}}</span>\n              </div>\n              <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag"></md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.openContact(contact.id)" translate="DASHBOARDS.EDIT">\n                    Edit Contact\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n                    Merge Contact\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n                    Duplicate Contact\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html",'<div ng-cloak>\n  <md-content>\n    <md-tabs md-dynamic-height md-border-bottom>\n      <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html\'" ng-controller="AgentHomeDashboardVoiceController as vm_voice" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="{{\'DASHBOARDS.MOTION_BULL\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html\'" ng-controller="AgentHomeDashboardBullController as vm_bull" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(105) && vm_home.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html\'" ng-controller="AgentHomeDashboardMultiChannelChatController as vm_chat" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(106) && vm_home.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html\'" ng-controller="AgentHomeDashboardMultiChannelMailController as vm_mail" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html\'" ng-controller="AgentHomeDashboardMultiChannelSmsController as vm_sms" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html\'" ng-controller="AgentHomeDashboardMultiChannelOpenchannelController as vm_openchannel" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(109) && vm_home.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html\'" ng-controller="AgentHomeDashboardMultiChannelFaxController as vm_fax" class="md-padding">\n        </md-content>\n      </md-tab>\n      <md-tab ng-if="vm_home.hasPermission(114) && vm_home.license.whatsapp" label="{{\'DASHBOARDS.WHATSAPP\' | translate}}">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/whatsapp/agent.general.dashboard.whatsapp.html\'" ng-controller="AgentHomeDashboardMultiChannelWhatsappController as vm_whatsapp" class="md-padding">\n        </md-content>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_bull.promise">\n        <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getVoiceQueues">\n          <tr md-row>\n            <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n            <th md-column>{{ \'VOICE.TYPE\' | translate }}</th>\n            <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n            <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n            \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_bull.getSize(vm_bull.voiceQueues)">\n            <td md-cell colspan="4">\n              <div layout="row" layout-align="center center">\n                <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, voiceQueue) in vm_bull.voiceQueues">\n            <td md-cell class="name">{{voiceQueue.name}}</td>\n            <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n            <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n            <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n              <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.voiceQueuesTotal}}" md-on-paginate="vm_bull.getVoiceQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n            <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n            <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, channel) in vm_bull.rpcVoiceQueuesChannels | limitObjectFromTo: vm_bull.queryChannels.limit:(vm_bull.queryChannels.page - 1) * vm_bull.queryChannels.limit">\n            <td md-cell>{{channel.exten}}</td>\n            <td md-cell>{{channel.queue}}</td>\n            <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_bull.queryChannels.limit" md-page="vm_bull.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)}}" md-page-select>\n    </md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_chat.promise">\n        <thead md-head md-order="vm_chat.query.sort" md-on-reorder="vm_chat.getChatQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_chat.getSize(vm_chat.chatQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_chat.chatQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_chat.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_chat.query.page" md-total="{{vm_chat.chatQueuesTotal}}" md-on-paginate="vm_chat.getChatQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_chat.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_chat.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_chat.queryChannels.limit" md-page="vm_chat.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_chat.paginatedInteractions.length}}" md-on-paginate="vm_chat.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_fax.promise">\n        <thead md-head md-order="vm_fax.query.sort" md-on-reorder="vm_fax.getFaxQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_fax.getSize(vm_fax.faxQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_fax.faxQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_fax.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_fax.query.page" md-total="{{vm_fax.faxQueuesTotal}}" md-on-paginate="vm_fax.getFaxQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_fax.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_fax.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_fax.queryChannels.limit" md-page="vm_fax.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_fax.paginatedInteractions.length}}" md-on-paginate="vm_fax.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_mail.promise">\n        <thead md-head md-order="vm_mail.query.sort" md-on-reorder="vm_mail.getMailQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_mail.getSize(vm_mail.mailQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_mail.mailQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_mail.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_mail.query.page" md-total="{{vm_mail.mailQueuesTotal}}" md-on-paginate="vm_mail.getMailQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_mail.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_mail.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_mail.queryChannels.limit" md-page="vm_mail.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_mail.paginatedInteractions.length}}" md-on-paginate="vm_mail.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_openchannel.promise">\n        <thead md-head md-order="vm_openchannel.query.sort" md-on-reorder="vm_openchannel.getOpenchannelQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_openchannel.getSize(vm_openchannel.openchannelQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_openchannel.openchannelQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_openchannel.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_openchannel.query.page" md-total="{{vm_openchannel.openchannelQueuesTotal}}" md-on-paginate="vm_openchannel.getOpenchannelQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_openchannel.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_openchannel.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_openchannel.queryChannels.limit" md-page="vm_openchannel.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_openchannel.paginatedInteractions.length}}" md-on-paginate="vm_openchannel.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_sms.promise">\n        <thead md-head md-order="vm_sms.query.sort" md-on-reorder="vm_sms.getSmsQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_sms.getSize(vm_sms.smsQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_sms.smsQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_sms.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_sms.query.page" md-total="{{vm_sms.smsQueuesTotal}}" md-on-paginate="vm_sms.getSmsQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_sms.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_sms.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_sms.queryChannels.limit" md-page="vm_sms.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_sms.paginatedInteractions.length}}" md-on-paginate="vm_sms.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_voice.promise">\n        <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getVoiceQueues">\n          <tr md-row>\n            <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n            <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n            <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n            \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_voice.getSize(vm_voice.voiceQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, voiceQueue) in vm_voice.voiceQueues">\n            <td md-cell class="name">{{voiceQueue.name}}</td>\n            <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n            <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n            <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n              <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.voiceQueuesTotal}}" md-on-paginate="vm_voice.getVoiceQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n            <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n            <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, channel) in vm_voice.rpcVoiceQueuesChannels | limitObjectFromTo: vm_voice.queryChannels.limit:(vm_voice.queryChannels.page - 1) * vm_voice.queryChannels.limit">\n            <td md-cell>{{channel.exten}}</td>\n            <td md-cell>{{channel.queue}}</td>\n            <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_voice.queryChannels.limit" md-page="vm_voice.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)}}" md-page-select>\n    </md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/whatsapp/agent.general.dashboard.whatsapp.html",'<div layout="row" ng-cloak>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_whatsapp.getColorByChannel(\'whatsapp\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table md-progress="vm_whatsapp.promise">\n        <thead md-head md-order="vm_whatsapp.query.sort" md-on-reorder="vm_whatsapp.getWhatsappQueues">\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_whatsapp.getSize(vm_whatsapp.whatsappQueues)">\n            <td md-cell colspan="2">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, queue) in vm_whatsapp.whatsappQueues">\n            <td md-cell class="name">{{queue.name}}</td>\n            <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_whatsapp.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_whatsapp.query.page" md-total="{{vm_whatsapp.whatsappQueuesTotal}}" md-on-paginate="vm_whatsapp.getWhatsappQueues" md-page-select></md-table-pagination>\n  </md-card>\n  <md-card flex="50">\n    <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_whatsapp.getColorByChannel(\'whatsapp\')">\n      <div class="md-toolbar-tools">\n        <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n        <div flex></div>\n      </div>\n    </md-toolbar>\n    <md-table-container>\n      <table md-table>\n        <thead md-head>\n          <tr md-row>\n            <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n            <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n          </tr>\n        </thead>\n        <tbody md-body>\n          <tr md-row ng-hide="vm_whatsapp.paginatedInteractions.length">\n            <td md-cell colspan="3">\n              <div layout="row" layout-align="center center">\n                <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n              </div>\n            </td>\n          </tr>\n          <tr md-row ng-repeat="(key, interaction) in vm_whatsapp.interactions">\n            <td md-cell>{{interaction.account}}</td>\n            <td md-cell>{{interaction.queue}}</td>\n            <td md-cell>{{interaction.from}}</td>\n          </tr>\n        </tbody>\n      </table>\n    </md-table-container>\n\n    <md-table-pagination md-limit="vm_whatsapp.queryChannels.limit" md-page="vm_whatsapp.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_whatsapp.paginatedInteractions.length}}" md-on-paginate="vm_whatsapp.paginate" md-page-select></md-table-pagination>\n  </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.FAX_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getFaxInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getFaxInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getFaxInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.faxAccounts.rows && vm.faxAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="faxAccount in vm.faxAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeFaxInteraction($event, faxAccount)">\n              {{ faxAccount.name }} ({{ faxAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.faxInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.faxInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="faxAccount">\n            {{ vm.getFaxAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showFaxInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Fax\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadFaxInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n                    Download Fax\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxInteractions.count}}" md-on-paginate="vm.getFaxInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.MAIL_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getMailInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getMailInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getMailInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.mailAccounts.rows && vm.mailAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="mailAccount in vm.mailAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeMailInteraction($event, mailAccount)">\n              {{ mailAccount.name }} ({{ mailAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="subject">{{\'DASHBOARDS.SUBJECT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.mailInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.mailInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <div ng-if="vm.setting.enableEmailPreview && interaction.lastMsgText" class="tooltip-preview" ng-mouseleave="vm.resetTooltipPosition($event)" ng-mouseenter="vm.adjustTooltipPosition($event)">\n              <span class="text-truncate font-size-12 subject-text">{{ interaction.subject }}</span>\n              <md-card class="tooltip-preview-text">\n                <md-card-content><span class="email-preview-message">{{ interaction.lastMsgText }}</span>\n                </md-card-content>\n              </md-card>\n            </div>\n            <span ng-if="!interaction.lastMsgText || !vm.setting.enableEmailPreview"><span class="text-truncate font-size-12 subject-text">{{ interaction.subject }}</span></span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="mailAccount">\n            {{ vm.getMailAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showMailInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Mail\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n                  <md-button ng-click="vm.downloadMailInteraction($event, interaction, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n                    Download with attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadMailInteraction($event, interaction)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                    Download without attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailInteractions.count}}" md-on-paginate="vm.getMailInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.MYCONTACTS">My Contacts</span>\n      <ms-search-bar on-search="vm.getContacts()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getContacts()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button ng-if="vm.lists.rows && vm.lists.rows.length" class="md-icon-button create-new" ng-click="vm.openContact($event)" aria-label="Add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n          <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n          <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n          <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.CREATEDAT\' | translate}}</th>\n          <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.contacts.rows.length">\n          <td md-cell colspan="10">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="contact in vm.contacts.rows">\n          <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="firstName" privacy ng-cloak>\n            {{contact.firstName}} {{contact.lastName}}</td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="fax" privacy ng-cloak>\n            {{contact.fax}}</td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="email" privacy ng-cloak>{{contact.email}}\n          </td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="createdAt">{{contact.createdAt |\n            formatdate}}</td>\n          <td ng-click="vm.openContact($event, contact)" md-cell class="list">\n            {{vm.listsMap[contact.ListId].name}}</td>\n          <td md-cell class="tag">\n            <div ng-if="contact.Tags.length">\n              <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n                <span class="text-truncate">{{contact.Tags[0].name}}</span>\n              </div>\n              <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag"></md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n                    Edit Contact\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n                    Merge Contact\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n                    Duplicate Contact\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.OPENCHANNEL_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getOpenchannelInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getOpenchannelInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getOpenchannelInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.openchannelAccounts.rows && vm.openchannelAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeOpenchannelInteraction($event, openchannelAccount)" ng-disabled="!openchannelAccount.replyUri">\n              {{ openchannelAccount.name }} ({{ openchannelAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.openchannelInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.openchannelInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="openchannelAccount">\n            {{ vm.getOpenchannelAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showOpenchannelInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Openchannel\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n                  <md-button ng-click="vm.downloadOpenchannelInteraction($event, interaction, true)" translate="OPENCHANNEL.DOWNLOAD_WITH_ATTACHMENTS">\n                    Download with attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadOpenchannelInteraction($event, interaction)" translate="OPENCHANNEL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                    Download without attachments\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelInteractions.count}}" md-on-paginate="vm.getOpenchannelInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html",'<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n  <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/agent.general.presence.html",'<div ng-cloak>\n  <md-content>\n    <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n      <md-tab label="{{\'DASHBOARDS.AGENTS\' | translate}}" md-on-select="vm.onAgentsTabSelection()">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.agents.html\'">\n        </md-content>\n      </md-tab>\n      <md-tab label="{{\'DASHBOARDS.QUEUES\' | translate}}" md-on-select="vm.onQueuesTabSelection()">\n        <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.queues.html\'">\n        </md-content>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.agents.html",'<md-card ngCloak>\n  <md-toolbar class="md-table-toolbar md-default table-header xenialab-violet-light-bg" ng-class="{\'h-128\' : vm.isSearchBarVisible === true}">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.AGENTS"></span>\n      <ms-search-bar on-search="vm.getAgents()" query="vm.agentsQuery" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible"></ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.agentsQuery" search="vm.getAgents()"></ms-quick-filter>\n      <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getAgents()">\n        <md-icon md-font-icon="icon-reload"></md-icon>\n        <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.agentsQuery.sort" md-on-reorder="vm.getAgents">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="name">{{\'DASHBOARDS.NAME\' | translate}}</th>\n          <th md-column md-order-by="internal">{{\'VOICE.INTERNAL\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column class="no-padding width-70"></th>\n          <th md-column class="width-70"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.agents.rows.length">\n          <td md-cell colspan="12">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="agent in vm.agents.rows">\n          <td md-cell>{{agent.id}}</td>\n          <td md-cell>{{agent.name}}</td>\n          <td md-cell>{{agent.internal}}</td>\n          <td md-cell>\n            <div layout="row">\n              <div layout="column" layout-align="center center">\n                <span class="text-boxed width-70 text-center md-background-bg bl bt padding-5" ng-class="{\'online\':\'lime-300-bg\',\'offline\':\'red-A200-bg\',\'pause\':\'amber-200-bg\',\'busy\':\'indigo-100-bg\'}[agent.status]">{{\n                  agent.status | uppercase }}</span>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="no-padding width-70">\n            <md-button ng-if="agent.status !== \'offline\'" ng-click="vm.originateCall(agent.name)" class="md-fab md-mini md-raised" aria-label="Dial">\n              <md-icon md-font-icon="icon-phone" class="icon green-fg s20">\n                <md-tooltip><span translate="VOICE.DIAL"></span></md-tooltip>\n              </md-icon>\n            </md-button>\n          </td>\n          <td md-cell class="width-70">\n            <md-button ng-if="agent.status !== \'offline\'" ng-click="vm.transferCall(agent.name)" class="md-fab md-mini md-raised" aria-label="Transfer">\n              <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s20">\n                <md-tooltip><span translate="DASHBOARDS.TRANSFER"></span></md-tooltip>\n              </md-icon>\n            </md-button>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm.agentsQuery.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.agentsQuery.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select>\n  </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.queues.html",'<md-card ngCloak>\n  <md-toolbar class="md-table-toolbar md-default table-header xenialab-violet-light-bg" ng-class="{\'h-128\' : vm.isSearchBarVisible === true}">\n    <div class="md-toolbar-tools" layout="row" layout-align="center center">\n      <span class="md-subhead" translate="DASHBOARDS.QUEUES"></span>\n      <ms-search-bar on-search="vm.getVoiceQueues()" query="vm.queuesQuery" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible"></ms-search-bar>\n      <div flex></div>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.queuesQuery.sort" md-on-reorder="vm.getVoiceQueues">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column md-order-by="name">{{\'DASHBOARDS.NAME\' | translate}}</th>\n          <th md-column md-order-by="name">{{\'VOICE.CALLS\' | translate}}</th>\n          <th md-column class="no-padding width-70"></th>\n          <th md-column class="width-70"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.voiceQueues.rows.length">\n          <td md-cell colspan="12">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="queue in vm.voiceQueues.rows">\n          <td md-cell>{{queue.id}}</td>\n          <td md-cell>{{queue.name}}</td>\n          <td md-cell>{{queue.calls.length || 0}}</td>\n          <td md-cell class="no-padding width-70">\n            <md-button ng-click="vm.originateCall(queue.name)" class="md-fab md-mini md-raised" aria-label="Dial">\n              <md-icon md-font-icon="icon-phone" class="icon green-fg s20">\n                <md-tooltip><span translate="VOICE.DIAL"></span></md-tooltip>\n              </md-icon>\n            </md-button>\n          </td>\n          <td md-cell class="width-70">\n            <md-button ng-click="vm.transferCall(queue.name)" class="md-fab md-mini md-raised" aria-label="Transfer">\n              <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s20">\n                <md-tooltip><span translate="DASHBOARDS.TRANSFER"></span></md-tooltip>\n              </md-icon>\n            </md-button>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm.queuesQuery.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queuesQuery.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select>\n  </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header indigo-A100-bg" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="VOICE.RECORDINGS">Recordings</span>\n      <ms-search-bar on-search="vm.getVoiceRecordings()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceRecordings()">\n      </ms-quick-filter>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n        <tr md-row>\n          <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n          <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n          <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n          <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n          <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n          <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n          <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n          <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n          <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n          <th md-column width="10px" ng-if="vm.currentUser.downloadVoiceRecordings"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n          <td md-cell colspan="{{ vm.currentUser.downloadVoiceRecordings ? 10 : 9}}">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n          <td md-cell class="type">{{voiceRecording.type}}</td>\n          <td md-cell class="uniqueid">{{voiceRecording.uniqueid}}</td>\n          <td md-cell class="calleridnum">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceRecording.calleridnum" license="vm_home.license">\n            </ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="exten">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceRecording.exten" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="connectedlinenum">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceRecording.connectedlinenum" license="vm_home.license">\n            </ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="queue">{{voiceRecording.queue}}</td>\n          <td md-cell class="rating">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n          </td>\n          <td md-cell class="audio" ng-switch="voiceRecording.format">\n            \x3c!-- audio recording directive --\x3e\n            <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n            \x3c!-- / audio recording directive --\x3e\n            <span ng-switch-when=".gsm">\n              <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n            </span>\n          </td>\n          <td md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n          <td md-cell class="actions" ng-if="vm.currentUser.downloadVoiceRecordings">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.downloadfile(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n                    Download VoiceRecording\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\'">\n                  <md-button ng-click="vm.downloadtranscribe(voiceRecording, $event)" translate="VOICE.DOWNLOADTRANSCRIBE_VOICERECORDING">\n                    Download Transcribe\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select>\n  </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header blue-grey-bg" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getScheduledCalls()">\n      </ms-quick-filter>\n      <md-button class="md-icon-button reload-list" ng-click="vm.getScheduledCalls()" aria-label="Refresh scheduled calls" translate translate-attr-label="MOTIONDIALER.REFRESH_SCHEDULED_CALLS">\n        <md-icon md-font-icon="icon-reload"></md-icon>\n        <md-tooltip>{{\'MOTIONDIALER.REFRESH_SCHEDULED_CALLS\' | translate}}</md-tooltip>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduledCalls">\n        <tr md-row>\n          <th md-column>{{\'MOTIONDIALER.FULLNAME\' | translate}}</th>\n          <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n          <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n          <th md-column>{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n          <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLME\' | translate }}</th>\n          <th md-column>{{ \'MOTIONDIALER.CAMPAIGN\' | translate }}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.scheduledCalls.rows.length">\n          <td md-cell colspan="10">\n            <div layout="row" layout-align="center center">\n              <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="scheduledCall in vm.scheduledCalls.rows">\n          <td md-cell privacy ng-cloak>{{scheduledCall.Contact.firstName}} {{scheduledCall.Contact.lastName}}</td>\n          <td md-cell>\n            <ms-click-to-call target="scheduledCall.phone" license="vm_home.license"></ms-click-to-call>\n          </td>\n          <td md-colors="{color: {{ vm.isDateBeforeToday(scheduledCall.scheduledat) ? \'\\\'red\\\'\' : \'\\\'green\\\'\' }}}" md-cell>{{ scheduledCall.scheduledat | date:\'medium\' }}</td>\n          <td md-cell>{{ vm.priorities[scheduledCall.priority] }}</td>\n          <td md-cell>\n            <md-icon md-colors="{color: {{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ scheduledCall.recallme  && scheduledCall.UserId == vm.currentUser.id ? \'icon-check\' : \'icon-close\' }}">\n            </md-icon>\n          </td>\n          <td md-cell>\n            <md-icon md-colors="{color: {{ scheduledCall.Queue.dialActive? \'\\\'green\\\'\' : \'\\\'red\\\'\' }}}" md-font-icon="icon-checkbox-blank-circle"></md-icon> {{scheduledCall.Queue.name}}\n          </td>\n          <td md-cell class="actions">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.createOrEditQueueCampaignHopper($event, scheduledCall)" translate="MOTIONDIALER.EDIT_HOPPER">\n                    Edit Hopper\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.deleteConfirm(scheduledCall, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n                    Delete Hopper\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.scheduledCalls.count}}" md-on-paginate="vm.getScheduledCalls" md-page-select>\n  </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.SMS_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getSmsInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getSmsInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getSmsInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.smsAccounts.rows && vm.smsAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="smsAccount in vm.smsAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeSmsInteraction($event, smsAccount)">\n              {{ smsAccount.name }} ({{ smsAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.smsInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.smsInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="smsAccount">\n            {{ vm.getSmsAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showSmsInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Sms\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadSmsInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n                    Download Sms\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsInteractions.count}}" md-on-paginate="vm.getSmsInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html",'<md-card ng-init="vm.onInit()">\n  <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="VOICE.CALLS">Calls</span>\n      <ms-search-bar on-search="vm.getVoiceCalls()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceCalls()">\n      </ms-quick-filter>\n    </div>\n  </md-toolbar>\n  <md-table-container>\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceCalls">\n        <tr md-row>\n          <th md-column md-order-by="id">{{\'VOICE.ID\' | translate}}</th>\n          <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n          <th md-column md-order-by="source">{{ \'VOICE.SOURCE\' | translate }}</th>\n          <th md-column md-order-by="destination">{{ \'VOICE.DESTINATION\' | translate }}</th>\n          <th md-column md-order-by="starttime">{{ \'VOICE.STARTEDAT\' | translate }}</th>\n          <th md-column md-order-by="endtime">{{ \'VOICE.ENDEDAT\' | translate }}</th>\n          <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n          <th md-column md-order-by="userSecondDisposition">{{ \'VOICE.SECOND_LEVEL_DISPOSITION\' | translate }}</th>\n          <th md-column md-order-by="userThirdDisposition">{{ \'VOICE.THIRD_LEVEL_DISPOSITION\' | translate }}</th>\n          <th md-column>{{ \'VOICE.NOTE\' | translate }}</th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.voiceCalls.rows.length">\n          <td md-cell colspan="10">\n            <div layout="row" layout-align="center center">\n              <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="voiceCall in vm.voiceCalls.rows" ng-click="vm.showDetails(voiceCall, $event)">\n          <td md-cell class="type">{{voiceCall.id}}</td>\n          <td md-cell class="type">{{ \'VOICE.\' + voiceCall.type.toUpperCase() | translate}}</td>\n          <td md-cell class="source">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceCall.source" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="destination">\n            \x3c!-- click to call directive --\x3e\n            <ms-click-to-call target="voiceCall.destination" license="vm_home.license"></ms-click-to-call>\n            \x3c!--  / click to call directive --\x3e\n          </td>\n          <td md-cell class="starttime">{{voiceCall.starttime | date:\'medium\' }}</td>\n          <td md-cell class="endtime">{{voiceCall.endtime | date:\'medium\' }}</td>\n          <td md-cell class="disposition">{{ voiceCall.userDisposition}}</td>\n          <td md-cell class="disposition">{{ voiceCall.userSecondDisposition}}</td>\n          <td md-cell class="disposition">{{ voiceCall.userThirdDisposition}}</td>\n          <td md-cell class="note">\n            <md-icon ng-if="voiceCall.note" md-font-icon="icon-clipboard-outline"></md-icon>\n          </td>\n          <td md-cell class="actions">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n\n              <md-menu-content width="3">\n                <md-menu-item>\n                  <md-button ng-click="vm.showDetails(voiceCall, $event)" translate="VOICE.DETAILS">\n                    Show Details\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceCalls.count}}" md-on-paginate="vm.getVoiceCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",'<md-dialog class="details-dialog" aria-label="details">\n  <md-toolbar class="md-background-bg">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n      <span ng-if="!vm.interaction.closed" class="title" translate="VOICE.DETAILS"></span>\n      <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-dialog-content>\n    <md-list flex>\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.UNIQUEID">Uniqueid</p>\n          <h4>{{vm.call.uniqueid}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.TYPE">Type</p>\n          <h4>{{vm.call.type ? vm.call.type : \'no type\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.SOURCE">Source</p>\n          <h4 privacy ng-cloak>{{vm.call.source ? vm.call.source : \'unknown\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.DESTINATION">Destination</p>\n          <h4 privacy ng-cloak>{{vm.call.destination ? vm.call.destination : \'unknown\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.STARTEDAT">Started At</p>\n          <h4>{{vm.call.starttime | date:\'medium\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.ANSWEREDAT">Answered At</p>\n          <h4>{{vm.call.answertime ? (vm.call.answertime | date:\'medium\') : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.ENDEDAT">Ended At</p>\n          <h4>{{vm.call.endtime ? (vm.call.endtime | date:\'medium\') : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.DURATION">Duration</p>\n          <h4>{{vm.call.duration ? vm.call.duration : \'--\'}}s</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.BILLABLESECONDS">Billable Seconds</p>\n          <h4>{{vm.call.billableseconds ? vm.call.billableseconds : \'--\'}}s</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.DISPOSITION">Disposition</p>\n          <h4>{{vm.call.userDisposition ? vm.call.userDisposition : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n          <h4>{{vm.call.userSecondDisposition ? vm.call.userSecondDisposition : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n          <h4>{{vm.call.userThirdDisposition ? vm.call.userThirdDisposition : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n\n      <md-list-item class="md-2-line">\n        <div class="md-list-item-text">\n          <p translate="VOICE.NOTE">Note</p>\n          <h4>{{vm.call.note ? vm.call.note : \'--\'}}</h4>\n        </div>\n      </md-list-item>\n    </md-list>\n  </md-dialog-content>\n\n  <md-dialog-actions layout="row" layout-align="space-between center">\n    <md-button type="button" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="DISPOSE" translate="VOICE.CLOSE" translate-attr-aria-label="VOICE.DISPOSE">\n      CLOSE\n    </md-button>\n  </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/home/whatsapp/agent.general.whatsapp.html",'<md-card ng-cloak>\n  <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="DASHBOARDS.WHATSAPP_INTERACTIONS">Interactions</span>\n      <ms-search-bar on-search="vm.getWhatsappInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n      </ms-search-bar>\n      <div flex></div>\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getWhatsappInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n      <div layout="row">\n        <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n          <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getWhatsappInteractions()">\n          <md-icon md-font-icon="icon-reload"></md-icon>\n          <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n        </md-button>\n      </div>\n      <md-menu ng-if="vm.whatsappAccounts.rows && vm.whatsappAccounts.rows.length">\n        <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n          <md-icon md-font-icon="icon-plus"></md-icon>\n        </md-button>\n        <md-menu-content width="3">\n          <md-menu-item ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">\n            <md-button aria-label="compose" ng-click="vm.composeWhatsappInteraction($event, whatsappAccount)">\n              {{ whatsappAccount.name }} ({{ whatsappAccount.key }})</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </div>\n  </md-toolbar>\n  <md-table-container class="interactions-list">\n    <table md-table md-progress="vm.promise">\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappInteractions">\n        <tr md-row>\n          <th class="id-header" md-column md-order-by="id">\n            {{\'DASHBOARDS.ID\' | translate}}</th>\n          <th md-column class="no-padding width-5">\n            <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n          </th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column class="no-padding width-5"></th>\n          <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n          <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n          <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n          <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n          <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n          <th md-column>\n            {{\'DASHBOARDS.ACCOUNT\' | translate}}\n          </th>\n          <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n          <th md-column></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row ng-hide="vm.whatsappInteractions.rows.length">\n          <td md-cell colspan="13">\n            <div layout="row" layout-align="center center">\n              <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n                Interaction</span>\n            </div>\n          </td>\n        </tr>\n        <tr md-row ng-repeat="interaction in vm.whatsappInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="id">\n            <div layout="row" layout-align="start center">\n              <span class="font-size-10">{{interaction.id}}</span>\n            </div>\n          </td>\n          <td md-cell>\n            <div ng-if="!interaction.closed && interaction.Users.length">\n              <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n              <md-tooltip>\n                <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n              </md-tooltip>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n              <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n            </div>\n          </td>\n          <td md-cell class="width-5 no-padding">\n            <div ng-if="interaction.attach" layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            </div>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n            <div layout="column" layout-align="start start">\n              <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n              <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n            </div>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n            <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n            <div layout="row" ng-if="interaction.lastMsgAt">\n              <span>\n                <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n                </md-icon>\n              </span>\n              <div layout="column" layout-align="center center">\n                <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n              </div>\n            </div>\n            <span ng-if="!interaction.lastMsgAt">No messages</span>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n            <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n                {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n            <md-tooltip class="multiline" ng-if="interaction.closed">\n              <div layout="column">\n                <div layout="column">\n                  <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                </div>\n                <div ng-if="interaction.disposition" layout="column">\n                  <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.disposition }}</span>\n                </div>\n                <div ng-if="interaction.secondDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                </div>\n                <div ng-if="interaction.thirdDisposition" layout="column">\n                  <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                  <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                </div>\n              </div>\n            </md-tooltip>\n            <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n                {{interaction.substatus}}</span></span>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="user">\n            <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n          </td>\n          <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="whatsappAccount">\n            {{ vm.getWhatsappAccountLabel(interaction) }}\n          </td>\n          <td md-cell>\n            <div ng-if="interaction.Tags.length">\n              <div layout="column" layout-align="center center">\n                <md-tooltip md-direction="left" layout="row">\n                  <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n                    </span></span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                </md-icon>\n              </div>\n            </div>\n          </td>\n          <td md-cell class="actions actions-padding">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="2">\n                <md-menu-item>\n                  <md-button ng-click="vm.showWhatsappInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n                    Show Whatsapp\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n                  <md-button ng-click="vm.downloadWhatsappInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n                    Download Whatsapp\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="!interaction.closed">\n                  <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n                    Close and Dispose\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappInteractions.count}}" md-on-paginate="vm.getWhatsappInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/iframe/agent.general.iframe.html",'<md-content layout="row" layout-fill>\n\n  <div flex layout="row">\n\n    <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="width: 100%; height: 100%; border:0px;"></iframe>\n\n  </div>\n\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",'<md-dialog id="agent-general-dialog" aria-label="Spy Dialog">\n  <div id="interaction-app" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"></div>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n  <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html\'"></div>\n\n  <div ng-if="vm.showInteraction" flex layout="row">\n\n    <md-card flex="75" class="interaction">\n\n      <md-content class="interaction-agents" layout="row" layout-align="start center" ng-if="!vm.interaction.closed && vm.interaction.Users.length">\n        <strong layout-margin translate="DASHBOARDS.CURRENTLY_IN_USE_BY">Currently in use by </strong>\n\n        <div ng-repeat="u in vm.interaction.Users">\n          <img class="avatar-small" ng-src="api/users/{{u.id}}/avatar">\n          <md-tooltip> {{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersMap[u.id] | translate }}\n          </md-tooltip>\n        </div>\n      </md-content>\n\n      \x3c!-- TOOLBAR --\x3e\n      <md-toolbar class="interaction-toolbar" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html\'">\n      </md-toolbar>\n      \x3c!-- / TOOLBAR --\x3e\n\n      \x3c!-- CONTENT --\x3e\n      <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex layout-wrap>\n        <div class="interaction-messages" ng-switch="vm.tab.channel">\n          <div ng-switch-when="mail">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html\'">\n            </div>\n          </div>\n          <div ng-switch-default>\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html\'">\n            </div>\n          </div>\n        </div>\n      </md-content>\n      \x3c!-- / CONTENT --\x3e\n\n      \x3c!-- FOOTER --\x3e\n      <div ng-if="\n            !vm.interaction.closed && ( vm.tab.channel == \'chat\' \n            || (vm.tab.channel == \'openchannel\' && vm.account.replyUri) \n            || (vm.tab.channel == \'sms\' && !vm.tab.spy) \n            || (vm.tab.channel == \'whatsapp\' && !vm.tab.spy) )\n             && (vm.user.role !== \'admin\' && vm.user.role !== \'user\')" class="interaction-footer flex-noshrink" layout="row" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html\'">\n      </div>\n      \x3c!-- / FOOTER--\x3e\n    </md-card>\n\n    <md-card layout="column" flex class="info" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html\'">\n    </md-card>\n  </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/chat/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="CHAT.SEND">SEND</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n            <span translate="CHAT.ADD_NOTE">Add note</span>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="CHAT.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to">\n        <label translate="CHAT.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="CHAT.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'CHAT.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n      <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'CHAT.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n        <md-item-template>\n          <md-icon ng-if="!item.ChatAccountId" md-font-icon="icon-earth" aria-label="alert chat" class="s16"></md-icon>\n          <md-icon ng-if="item.ChatAccountId" md-font-icon="icon-message-text" aria-label="alert chat" class="s16 orange-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n        </md-item-template>\n\n        <md-not-found>\n          <span translate="CHAT.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="FAX.SEND">SEND</span>\n          </md-button>\n          <md-button ng-disabled="vm.message.attachments.length === 1" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n            <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n          </md-button>\n        </div>\n        <span class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="FAX.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block to">\n        <label translate="FAX.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete ng-hide="vm.message.to.length === 1" md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.fax" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" ng-if="composeForm.$dirty">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n          <div ng-message="md-max-chips">You reached the maximum amount of chips</div>\n        </div>\n      </md-input-container>\n      <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n        <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n          <div>\n            <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            <span class="filename">{{attachment.name}}</span>\n            <span class="size">({{attachment.size | byteFmt: 0}})</span>\n          </div>\n          <md-button class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="FAX.DELETE_ATTACHMENT">\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message" ng-class="{\'mail-no-secret\': !vm.secret}" ng-cloak>\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar ng-class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <div ng-if="!vm.secret" class="md-button md-raised blue-bg no-padding">\n            <button class="white-fg margin-horizontal-10" aria-label="Send message" ng-disabled="!vm.verifySmtp" ng-click="vm.send($event, false, null)">\n              <span>{{ \'MAIL.SEND\' | translate | uppercase }}</span>\n            </button>\n            <span class="white-fg secondary-text vertical-divider"></span>\n            <md-menu>\n              <button ng-disabled="!vm.verifySmtp" class="white-fg margin-left-0" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-menu-down" class="icon s24"></md-icon>\n              </button>\n              <md-menu-content width="2">\n                <md-menu-item ng-if="vm.subStatuses.rows.length">\n                  <md-menu>\n                    <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.SEND_AS">\n                      Send as\n                    </md-button>\n                    <md-menu-content>\n                      <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n                        <md-button ng-click="vm.send($event, false, subStatus.name)">\n                          {{subStatus.name}}\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </md-menu-item>\n                <md-menu-item>\n                  <md-button ng-click="vm.send($event, true, null)" translate="MAIL.SEND_AND_CLOSE">\n                    Send and Close\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </div>\n          <md-button ng-if="!vm.secret" class=" md-button md-raised blue-bg white-fg margin-horizontal-10" aria-label="Save draft" ng-click="vm.saveDraft()">\n            <span>{{ (vm.isDraft ? \'DASHBOARDS.UPDATE_DRAFT\' : \'DASHBOARDS.SAVE_AS_DRAFT\') | translate | uppercase }}</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="MAIL.ADD_NOTE">Add note</span>\n          </md-button>\n          <md-button ng-disabled="!vm.verifySmtp" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload($files)" flow-init="vm.ngFlowOptions" flow-file-success="vm.fileSuccess($file, $message)" flow-file-added="vm.fileAdded($file)">\n            <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="MAIL.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to" ng-class="{\'hidden-cc\': vm.hiddenCC, \'hidden-bcc\': vm.hiddenBCC}">\n        <label translate="MAIL.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.to)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.email" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n        <div class="cc-bcc" layout="row" layout-align="start center">\n          <div class="show-cc" ng-show="vm.hiddenCC" ng-click="vm.hiddenCC = false">CC</div>\n          <div class="show-bcc" ng-show="vm.hiddenBCC" ng-click="vm.hiddenBCC = false">BCC</div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenCC">\n        <label translate="MAIL.CC">Cc</label>\n        <md-chips name="cc" ng-model="vm.message.cc" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.cc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n          <md-autocomplete md-search-text="vm.searchCc" md-items="contact in vm.contactSearch(vm.searchCc)" md-item-text="contact.email" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n      </md-input-container>\n      <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenBCC">\n        <label translate="MAIL.BCC">Bcc</label>\n        <md-chips name="bcc" ng-model="vm.message.bcc" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.bcc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n          <md-autocomplete md-search-text="vm.searchBcc" md-items="contact in vm.contactSearch(vm.searchBcc)" md-item-text="contact.email" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n      </md-input-container>\n      <md-input-container ng-if="!vm.secret" class="md-block no-margin">\n        <label translate="MAIL.SUBJECT">Subject</label>\n        <input ng-model="vm.message.subject" type="text" ng-keypress="vm.keyPress($event)">\n      </md-input-container>\n      <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n        <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n          <div>\n            <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n            <span class="filename">{{attachment.name}}</span>\n            <span class="size" ng-if="attachment.size">({{attachment.size | byteFmt: 0}})</span>\n          </div>\n          <md-button ng-click="vm.removeAttachment(attachment)" class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="MAIL.DELETE_ATTACHMENT">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="padding-top-5">\n        <textarea ckeditor="vm.ckeditor" id="html-area" ng-model="vm.message.body" md-select-on-focus="" ready="vm.onReadyEditor()"></textarea>\n      </div>\n      <md-switch ng-if="!vm.message.showLastMessage && !vm.secret" ng-model="vm.message.showLastMessage" ng-change="vm.loadLastMessage()" aria-label="load last message"><span translate="MAIL.SHOW_ORIGINAL_MESSAGE">Show original message</span></md-switch>\n      <md-autocomplete ng-if="!vm.secret" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'MAIL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin" ng-keypress="vm.keyPress($event)">\n        <md-item-template>\n          <md-icon ng-if="!item.MailAccountId" md-font-icon="icon-earth" aria-label="alert email" class="s16">\n          </md-icon>\n          <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email" aria-label="alert email" class="s16 teal-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{ item.key }} -\n            {{ item.value | htmlToPlaintext }}</span>\n        </md-item-template>\n        <md-not-found>\n          <span translate="MAIL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="OPENCHANNEL.SEND">SEND</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n            <span translate="OPENCHANNEL.ADD_NOTE">Add note</span>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="OPENCHANNEL.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to">\n        <label translate="OPENCHANNEL.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mapkey" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'OPENCHANNEL.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n      <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'OPENCHANNEL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n        <md-item-template>\n          <md-icon ng-if="!item.OpenchannelAccountId" md-font-icon="icon-earth" aria-label="alert openchannel" class="s16"></md-icon>\n          <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-message-text" aria-label="alert openchannel" class="s16 orange-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n        </md-item-template>\n        <md-not-found>\n          <span translate="OPENCHANNEL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="SMS.SEND">SEND</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n            <span translate="SMS.ADD_NOTE">Add note</span>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="SMS.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to">\n        <label translate="SMS.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'SMS.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n      <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'SMS.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n        <md-item-template>\n          <md-icon ng-if="!item.SmsAccountId" md-font-icon="icon-earth" aria-label="alert sms" class="s16"></md-icon>\n          <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text" aria-label="alert sms" class="s16 orange-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n        </md-item-template>\n        <md-not-found>\n          <span translate="SMS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n  <form class="md-inline-form" name="composeForm" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <div layout="row">\n          <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n            <span translate="WHATSAPP.SEND">SEND</span>\n          </md-button>\n          <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n            <span translate="WHATSAPP.ADD_NOTE">Add note</span>\n          </md-button>\n        </div>\n        <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="WHATSAPP.CLOSE_DIALOG">\n          <md-icon md-font-icon="icon-close"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container ng-if="!vm.secret" class="md-block to">\n        <label translate="WHATSAPP.TO">To</label>\n        <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n          <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n            <md-item-template>\n              <span>{{ vm.getContact(contact) }}</span>\n            </md-item-template>\n          </md-autocomplete>\n        </md-chips>\n        <div ng-messages="composeForm.to.$error" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TO_REQUIRED">To field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'WHATSAPP.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n      <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'WHATSAPP.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n        <md-item-template>\n          <md-icon ng-if="!item.WhatsappAccountId" md-font-icon="icon-earth" aria-label="alert whatsapp" class="s16">\n          </md-icon>\n          <md-icon ng-if="item.WhatsappAccountId" md-font-icon="icon-message-text" aria-label="alert whatsapp" class="s16 orange-fg"></md-icon>\n          <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n        </md-item-template>\n        <md-not-found>\n          <span translate="WHATSAPP.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n        </md-not-found>\n      </md-autocomplete>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition" ng-init="vm.onInit()">\n  <form name="dispositionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span ng-if="!vm.interaction.closed" class="title" translate="DASHBOARDS.DISPOSE"></span>\n        <span ng-if="vm.interaction.closed" class="title" translate="DASHBOARDS.INFO"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()" ng-if="!vm.mandatoryDisposition">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n        <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n          <md-option ng-value="null" ng-if="!vm.mandatoryDisposition">NONE</md-option>\n          <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n            {{ disposition.name }}</md-option>\n        </md-select>\n        <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n        <md-input-container class="md-block" flex>\n          <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n          <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n              {{ disposition.name }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n          <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n          </md-icon>\n        </md-button>\n      </div>\n      <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n        <md-input-container class="md-block" flex>\n          <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n          <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition">\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n          <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n          </md-icon>\n        </md-button>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="DASHBOARDS.NOTE">Note</label>\n        <textarea ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveDisposition()" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && (vm.firstLevelDisposition || vm.secondLevelDisposition || vm.thirdLevelDisposition)" aria-label="CLOSE_AND_DISPOSE" translate="DASHBOARDS.CLOSE_AND_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_AND_DISPOSE">\n          CLOSE AND DISPOSE\n        </md-button>\n        <md-button type="submit" ng-click="vm.saveDisposition(false)" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && !vm.firstLevelDisposition" ng-disabled="vm.mandatoryDisposition" aria-label="CLOSE_WITHOUT_DISPOSE" translate="DASHBOARDS.CLOSE_WITHOUT_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_WITHOUT_DISPOSE">\n          CLOSE WITHOUT DISPOSE\n        </md-button>\n        <md-button type="submit" ng-click="vm.saveDisposition()" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="vm.interaction.closed" ng-disabled="vm.mandatoryDisposition && !vm.firstLevelDisposition" aria-label="DISPOSE" translate="DASHBOARDS.DISPOSE" translate-attr-aria-label="DASHBOARDS.DISPOSE">\n          DISPOSE\n        </md-button>\n        <div ng-if="vm.mandatoryDisposition">\n          <md-icon md-font-icon="icon-information-outline" aria-label="Mandatory Disposition"></md-icon>\n          <span class="no-margin font-size-12 line-height-30" translate="DASHBOARDS.HELP.MANDATORY_DISPOSITION_ENABLED"></span>\n        </div>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",'<md-dialog class="tag-dialog" aria-label="tag">\n  <form name="tagForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="DASHBOARDS.TAGS"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <md-chips ng-model="vm.interaction.Tags" md-autocomplete-snap md-require-match="vm.autocompleteRequireMatch">\n          <md-autocomplete ng-blur="vm.searchText = \'\'" md-min-length="0" md-selected-item-change="vm.selectedItemChange" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="item in vm.tags.rows | filter:{ name: vm.searchText }" md-item-text="item.name" placeholder="Search for a tag">\n            <span md-highlight-text="vm.searchText">{{item.name}}</span>\n          </md-autocomplete>\n          <md-chip-template>\n            <span>\n              <strong>{{$chip.name}}</strong>\n            </span>\n          </md-chip-template>\n        </md-chips>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveTag(false)" ng-disabled="tagForm.$pristine" class="send-button md-accent md-raised" aria-label="TAG" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n  <form name="transferForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="DASHBOARDS.TRANSFER"></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog(false)">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="DASHBOARDS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.transfer.type">\n          <md-option ng-value="\'queue\'" ng-if="vm.account.queueTransfer">Queue</md-option>\n          <md-option ng-value="\'agent\'" ng-if="vm.account.agentTransfer">Agent</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.transfer.type === \'queue\'">\n        <label translate="DASHBOARDS.QUEUES">Queues</label>\n        <md-select name="queue" ng-model="vm.transfer.id" required>\n          <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="transferForm.queue.$error" ng-show="transferForm.queue.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="DASHBOARDS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.transfer.type === \'agent\'">\n        <label translate="DASHBOARDS.AGENTS">Agents</label>\n        <md-select name="agent" ng-model="vm.transfer.id" required>\n          <md-option ng-value="agent.id" ng-repeat="agent in vm.agents.rows">{{\n            agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="transferForm.agent.$error" ng-show="transferForm.agent.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="DASHBOARDS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.onTransfer(true)" ng-disabled="transferForm.$pristine" class="send-button md-accent md-raised" aria-label="DASHBOARDS.TRANSFER" translate="DASHBOARDS.TRANSFER" translate-attr-aria-label="DASHBOARDS.TRANSFER">\n          TRANSFER\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html",'\x3c!-- REPLY FORM --\x3e\n<div ng-show="vm.showFooter" layout="column" layout-align="center center" flex>\n  <div layout="row" layout-align="center center" style="flex-grow: 1; align-self: stretch" flex>\n    \x3c!-- msEmojyArea directive --\x3e\n    <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.tab.areaText" placeholder="vm.tab.channel.toUpperCase() + \'.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n    \x3c!-- / msEmojyArea directive --\x3e\n\n    <div layout="row" layout-align="end center">\n      <md-button ng-if="vm.tab.channel != \'fax\'" style="margin:1px;" class="md-icon-button md-mini" ng-click="vm.changeDisplayCannedAnswerInputValue()" aria-label="Search canned answer" translate translate-attr-aria-label="DASHBOARDS.SEND_MESSAGE">\n        <md-icon md-font-icon="icon-auto-fix" class="green-fg"></md-icon>\n      </md-button>\n\n      <md-button ng-if="vm.tab.channel == \'openchannel\' || vm.tab.channel == \'chat\' || vm.tab.channel == \'fax\'" style="margin:1px;" class="md-icon-button md-warn md-mini" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n        <md-icon md-font-icon="icon-paperclip"></md-icon>\n      </md-button>\n    </div>\n  </div>\n\n  <md-autocomplete ng-hide="!vm.displayCannedAnswerInput" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" placeholder="{{ \'DASHBOARDS.CANNED_ANSWER_SEARCH\' | translate}}" class="cannedarea input-show-hide">\n    <md-item-template>\n      <md-icon ng-if="!item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="icon-earth" aria-label="alert channel" class="s16"></md-icon>\n      <md-icon ng-if="item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" aria-label="alert channel" class="s16" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n      <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n    </md-item-template>\n\n    <md-not-found>\n      <span translate="DASHBOARDS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n    </md-not-found>\n  </md-autocomplete>\n</div>\n\x3c!-- / REPLY FORM --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html",'<div ng-init="item = item || vm.interaction">\n  <md-list-item class="md-2-line" ng-if="item.browserName">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.BROWSER_NAME">Browser Name</p>\n      <h4>{{ item.browserName }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.osName">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.OS_NAME">OS Name</p>\n      <h4>{{ item.osName }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.deviceModel">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.DEVICE_MODEL">Device Model</p>\n      <h4>{{ item.deviceModel }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.referer">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.REFERER">Referer</p>\n      <h4>{{ item.referer }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.customerIp">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CUSTOMER_IP">Originating IP Address</p>\n      <h4>{{ item.customerIp }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.customerPort">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CUSTOMER_PORT">Originating TCP Port</p>\n      <h4>{{ item.customerPort }}</h4>\n    </div>\n  </md-list-item>\n  <md-divider ng-if="item.closed && item.ratingValue != null || item.ratingMessage"></md-divider>\n  <md-list-item class="md-2-line" ng-if="item.closed && item.ratingValue != null">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.RATING">Rating</p>\n      <md-icon md-font-icon="icon-star" style="color:red" ng-show="!item.ratingType || item.ratingType == \'star\'" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:item.ratingValue"></md-icon>\n      <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 1"></md-icon>\n      <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 0"></md-icon>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.ratingMessage">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.FEEDBACK">Feedback</p>\n      <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.ratingMessage }}</h4>\n    </div>\n  </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html",'<md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.CONTACT">Contact</span>\n    </md-tab-label>\n    <md-tab-body>\n      <md-content class="md-padding">\n        <form name="contactForm" class="md-inline-form" novalidate>\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-account"></md-icon>\n            <label translate="DASHBOARDS.NAME">Name</label>\n            <input type="text" name="firstName" ng-model="vm.contact.firstName" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-email"></md-icon>\n            <label translate="DASHBOARDS.EMAIL">Email</label>\n            <input type="email" name="email" ng-model="vm.contact.email" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n            <label translate="DASHBOARDS.PHONE">Phone</label>\n            <input type="text" name="phone" ng-model="vm.contact.phone" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n            <label translate="DASHBOARDS.MOBILE">Mobile</label>\n            <input type="text" name="mobile" ng-model="vm.contact.mobile" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-icon md-font-icon="icon-deskphone"></md-icon>\n            <label translate="DASHBOARDS.FAX">Fax</label>\n            <input type="text" name="fax" ng-model="vm.contact.fax" disabled privacy ng-cloak>\n          </md-input-container>\n\n          <div ng-if="!vm.tab.spy" layout="row" layout-align="center center">\n            <md-button class="md-raised md-accent" ng-click="vm.openContact(ev)" translate="DASHBOARDS.MORE">\n              More\n            </md-button>\n          </div>\n        </form>\n      </md-content>\n    </md-tab-body>\n  </md-tab>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.INTERACTION">Interaction</span>\n    </md-tab-label>\n    <md-tab-body>\n      <div layout="column" layout-align="space-between center" class="md-padding">\n        <md-icon class="s42" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n        <span ng-if="vm.interaction.closed" class="md-background-bg red-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.CLOSED"></span></span>\n        <span ng-if="!vm.interaction.closed" class="md-background-bg green-fg font-size-14">#{{vm.interaction.id}} -\n          <span translate="DASHBOARDS.OPENED"></span></span>\n        <span ng-if="!vm.interaction.closed && vm.interaction.substatus" class="md-background-bg green-fg font-size-14">{{vm.interaction.substatus}}</span>\n      </div>\n      <md-divider></md-divider>\n      <md-list flex>\n        <md-list-item class="md-2-line">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.WEBSITE" ng-if="vm.tab.channel == \'chat\'">Website</p>\n            <p translate="DASHBOARDS.ACCOUNT" ng-if="vm.tab.channel != \'chat\'">Account</p>\n            <h4>{{vm.account.name}}</h4>\n          </div>\n        </md-list-item>\n\n        <md-list-item class="md-2-line">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.AGENT">Agent</p>\n            <h4>{{vm.agent.fullname || vm.usersMap[vm.interaction.UserId]}}</h4>\n          </div>\n        </md-list-item>\n\n        <md-list-item class="md-2-line" ng-if="vm.interaction.externalUrl">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n            <a href="{{vm.interaction.externalUrl}}" target="_blank">\n              <h4>{{vm.interaction.externalUrl}}</h4>\n            </a>\n          </div>\n        </md-list-item>\n\n        <md-list-item class="md-2-line">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n            <h4>{{vm.interaction.createdAt | date: \'medium\'}}</h4>\n          </div>\n        </md-list-item>\n\n        <div ng-switch="vm.tab.channel">\n          <div ng-switch-when="chat">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'">\n            </div>\n          </div>\n          <div ng-switch-when="mail">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'">\n            </div>\n          </div>\n          <div ng-switch-when="openchannel">\n            <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html\'">\n            </div>\n          </div>\n        </div>\n\n        <md-list-item class="md-2-line" ng-if="vm.interaction.Tags.length">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.TAGS">Tags</p>\n            <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n              <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n                <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n                <div class="tag-label">{{tag.name}}</div>\n              </div>\n            </div>\n          </div>\n        </md-list-item>\n\n        <md-divider ng-if="vm.interaction.closed"></md-divider>\n\n        <md-list-item class="md-2-line" ng-if="vm.interaction.closed">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n            <h4>{{vm.interaction.closedAt | date: \'medium\'}}</h4>\n          </div>\n        </md-list-item>\n        <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.disposition">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n            <h4>{{ vm.interaction.disposition }}</h4>\n          </div>\n        </md-list-item>\n        <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.secondDisposition">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n            <h4>{{ vm.interaction.secondDisposition }}</h4>\n          </div>\n        </md-list-item>\n        <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.thirdDisposition">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n            <h4>{{ vm.interaction.thirdDisposition }}</h4>\n          </div>\n        </md-list-item>\n        <md-list-item class="md-3-line md-long-text" ng-if="vm.interaction.closed && vm.interaction.note">\n          <div class="md-list-item-text">\n            <p translate="DASHBOARDS.NOTE">NOTE</p>\n            <h4 style="overflow-wrap: break-word; white-space: normal">{{ vm.interaction.note }}</h4>\n          </div>\n        </md-list-item>\n      </md-list>\n    </md-tab-body>\n  </md-tab>\n  <md-tab>\n    <md-tab-label>\n      <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Journey</span>\n    </md-tab-label>\n    <md-tab-body>\n      <md-content class="md-padding">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n        </div>\n      </md-content>\n    </md-tab-body>\n  </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html",'<md-divider></md-divider>\n<md-list flex>\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.AGENT">Agent</p>\n      <h4>{{ vm.agent.fullname || vm.usersMap[item.UserId] || \'DASHBOARDS.NOT_ASSIGNED\' | translate }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.externalUrl">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n      <a href="{{ item.externalUrl }}" target="_blank">\n        <h4>{{ item.externalUrl }}</h4>\n      </a>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n      <h4>{{ item.createdAt | date: \'medium\' }}</h4>\n    </div>\n  </md-list-item>\n  <div ng-if="item.channel === \'chat\'">\n    <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'">\n    </div>\n  </div>\n  <div ng-if="item.channel === \'mail\'">\n    <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'">\n    </div>\n  </div>\n  <md-divider ng-if="item.closed"></md-divider>\n  <md-list-item class="md-2-line" ng-if="item.closed">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n      <h4>{{ item.closedAt | date: \'medium\' }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.closed && item.disposition">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n      <h4>{{ item.disposition }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.closed && item.secondDisposition">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n      <h4>{{ item.secondDisposition }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-2-line" ng-if="item.closed && item.thirdDisposition">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n      <h4>{{ item.thirdDisposition }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item class="md-3-line md-long-text" ng-if="item.closed && item.note">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.NOTE">NOTE</p>\n      <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.note }}</h4>\n    </div>\n  </md-list-item>\n  <md-list-item ng-if="item.Tags.length">\n    <p class="padding-horizontal-15 grey-fg">Tags</p>\n    <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n      <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in item.Tags">\n        <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n        <div class="tag-label">{{ tag.name }}</div>\n      </div>\n    </div>\n  </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html",'<div layout-margin layout="row" layout-align="center center">\n  <ms-quick-filter filters="vm.quickFilters" query="vm.journeyOptions" search="vm.getCustomerJourney()">\n  </ms-quick-filter>\n</div>\n\n<md-content id="journey-content" flex layout-wrap>\n  <div ng-if="vm.journeyIsLoading" layout="row" layout-align="center center">\n    <md-progress-circular class="md-accent" md-diameter="48" md-mode="indeterminate"></md-progress-circular>\n  </div>\n  <div id="timeline" layout="column" ng-if="vm.journey && vm.journey.length && !vm.journeyIsLoading" ms-timeline="vm.journeyTimelineOptions" ms-timeline-load-more="vm.loadMoreJourney()">\n    \x3c!-- TIMELINE ITEM --\x3e\n    <div class="ms-timeline-item" layout-align="center center" ng-repeat="item in vm.journey">\n      <div class="timeline-card">\n        <md-card class="channel" ng-class="{\'md-grey-200-bg\': item.id == vm.interaction.id}">\n          <div layout="row" layout-align="space-between center">\n            <div class="header p-6" layout="row" layout-align="start center" ng-cloak>\n              <md-button class="md-fab md-mini no-click" aria-label="icon-channel" ng-class="{{ \'item.style.color\' }} + \'-bg\'">\n                <md-icon md-font-icon="{{ item.style.icon }}"></md-icon>\n              </md-button>\n              <div class="info" layout="column" ng-init="item.showMore = false">\n                <span class="font-size-12 text-truncate" ng-if="item.destination">\n                  #{{item.id}} - <span privacy ng-cloak>{{ item.destination }}</span>\n                </span>\n                <span class="font-size-12 text-truncate" ng-if="!item.destination">\n                  #{{item.id}} - {{ item.Account.key }}\n                </span>\n                <span class="font-size-10">{{item.createdAt | date: \'medium\'}}</span>\n                <span>\n                  <a class="toggle-details md-accent-color" ng-click="item.showMore = !item.showMore" translate="{{ item.showMore ? \'DASHBOARDS.HIDE_DETAILS\' : \'DASHBOARDS.SHOW_DETAILS\' }}">\n                  </a>\n                </span>\n              </div>\n            </div>\n            <span>\n              <img ng-if="item.UserId" class="avatar" ng-src="api/users/{{item.UserId}}/avatar">\n              <md-tooltip md-direction="left">{{item.Owner.fullname || item.User.fullname}}</md-tooltip>\n            </span>\n          </div>\n          <div ng-if="item.showMore">\n            <div ng-if="item.channel !== \'voice\'" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html\'">\n            </div>\n            <div ng-if="item.channel === \'voice\'" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html\'">\n            </div>\n          </div>\n          <md-divider></md-divider>\n          <div ng-if="item.id != vm.interaction.id" layout="row" layout-align="space-around center">\n            <div ng-if="item.closed && item.channel !== \'voice\'" class="text-truncate text-boxed-light">\n              <span class="red-fg" title="{{ \'DASHBOARDS.STATUS\' | translate}} : {{ \'DASHBOARDS.CLOSED\' | translate }} {{ item.dispositionsValues }}">\n                {{ \'DASHBOARDS.STATUS\' | translate}} : {{ \'DASHBOARDS.CLOSED\' | translate}} {{ item.dispositionsValues\n                }}\n              </span>\n            </div>\n            <span class="text-boxed md-background-bg green-fg" ng-if="!item.closed && item.channel !== \'voice\'" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}">\n              {{ \'DASHBOARDS.STATUS\' | translate}}:\n              {{ \'DASHBOARDS.OPENED\' | translate}}\n              <span ng-if="item.substatus"> - {{ item.substatus }}</span>\n            </span>\n            <span ng-if="item.channel === \'voice\'" class="text-boxed md-background-bg red-fg" title="{{ item.userDisposition ? (\'DASHBOARDS.DISPOSITION\' | translate) + \':\' : \'\'}} {{ item.userDisposition ?\n                item.userDisposition : (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }}">\n              {{ item.userDisposition ? (\'DASHBOARDS.DISPOSITION\' | translate) + \':\' : \'\'}} {{ item.userDisposition ?\n              item.userDisposition : (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }}\n            </span>\n            <span ng-if="item.channel === \'voice\' && item.userSecondDisposition" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}: {{ item.userSecondDisposition }}">\n              {{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:\n              {{ item.userSecondDisposition }}\n            </span>\n            <span ng-if="item.channel === \'voice\' && item.userThirdDisposition" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}: {{ item.userThirdDisposition }}">\n              {{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:\n              {{ item.userThirdDisposition }}\n            </span>\n            <div flex></div>\n            <md-button ng-if="!vm.tab.spy && vm.user.role === \'agent\' && item.canOpen && item.channel !== \'voice\'" class="md-icon-button" aria-label="go" ng-click="vm.openInteraction(item)">\n              <md-icon md-font-icon="icon-open-in-new" class="s20"></md-icon>\n            </md-button>\n          </div>\n        </md-card>\n      </div>\n    </div>\n\n    <div ng-if="vm.canLoadMoreJourney" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row keep-on-top">\n      <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-click="vm.loadMoreJourney()" translate="DASHBOARDS.MORE">\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / TIMELINE ITEM --\x3e\n</md-content>\n\n<div ng-if="!vm.journey || vm.journey.length === 0" layout="row" layout-align="center center">\n  <em translate="DASHBOARDS.NO_DATA_AVAILABLE">No data available</em>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html",'<md-divider></md-divider>\n\n<md-list flex>\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.TYPE">Type</p>\n      <h4>{{ item.type ? item.type : \'no type\' }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.SOURCE">Source</p>\n      <h4 privacy ng-cloak>{{ item.source ? item.source : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.DESTINATION">Destination</p>\n      <h4 privacy ng-cloak>{{ item.destination ? item.destination : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.UNIQUEID">Uniqueid</p>\n      <h4>{{ item.uniqueid ? item.uniqueid : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.CALLERID">Caller Id</p>\n      <h4 privacy ng-cloak>{{ item.callerid ? item.callerid : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.STARTEDAT">Started At</p>\n      <h4>{{ item.starttime | date:\'medium\' }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.END_AT">End At</p>\n      <h4>{{ item.endtime | date:\'medium\' }}</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.DURATION">Duration</p>\n      <h4>{{ item.duration ? item.duration : \'--\' }}s</h4>\n    </div>\n  </md-list-item>\n\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.NOTE">Note</p>\n      <h4>{{ item.note ? item.note : \'--\' }}</h4>\n    </div>\n  </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html",'<div ng-init="item = item || vm.interaction">\n  <md-list-item class="md-2-line" ng-if="item.subject">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.SUBJECT">Subject</p>\n      <h4>{{ item.subject }}</h4>\n    </div>\n  </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html",'<div ng-init="item = item || vm.interaction">\n  <md-list-item class="md-2-line">\n    <div class="md-list-item-text">\n      <p translate="DASHBOARDS.VISIBILITY">Visibility</p>\n      <h4 translate="{{ item.threadId ? \'DASHBOARDS.PUBLIC\' : \'DASHBOARDS.PRIVATE\'}}"></h4>\n    </div>\n  </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html",'\x3c!-- MESSAGES --\x3e\n<div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n  <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n  <img ng-if="message.direction ===\'out\' && message.UserId && !message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n  <img ng-if="message.direction ===\'out\' && message.UserId && message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n  <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n  <md-button ng-if="vm.tab.channel === \'fax\'" class="md-fab md-mini no-margin" aria-label="Download" ng-click="vm.downloadMessage(message)">\n    <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n  </md-button>\n\n  <div class="bubble" ng-class="{\'md-yellow-200-bg\': message.secret}" ng-switch="message.direction">\n    <div ng-if="message.secret">\n      <div class="time secondary-text" layout="row" layout-align="end center">\n        <div layout-padding>\n          <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n          <span> - {{message.createdAt | date: \'medium\'}}</span>\n        </div>\n        <div ng-if="message.id">\n          <md-icon class="s18" md-font-icon="icon-lock"></md-icon>\n        </div>\n      </div>\n    </div>\n    <div ng-if="!message.secret">\n      <div ng-switch-when="in" class="time secondary-text" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n        <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n        <span> - {{message.createdAt | date: \'medium\'}}</span>\n      </div>\n      <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n        <div layout-padding>\n          <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n          <span> - {{message.createdAt | date: \'medium\'}}</span>\n        </div>\n        <div ng-if="message.id && vm.tab.channel !== \'fax\'">\n          <md-icon ng-if="!message.read" class="s18" md-font-icon="icon-check"></md-icon>\n          <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n        </div>\n        <div ng-if="message.id && vm.tab.channel === \'fax\'">\n          <md-icon ng-if="!message.read && !(message.failMessage )" class="s18" md-font-icon="icon-check"></md-icon>\n          <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n          <span ng-if="!message.read && message.failMessage" class="s18 red-900-fg"> {{ message.failMessage }}</span>\n          <md-icon ng-if="!message.read && message.failMessage" class="s18 red-900-fg" md-font-icon="icon-close md-accent"></md-icon>\n        </div>\n      </div>\n    </div>\n    <div ng-if="message.AttachmentId" layout="row" layout-align="end center">\n      <md-button ng-if="vm.downloadPermissions.attachments" class="md-raised md-accent" ng-click="vm.getAttachment({id: message.AttachmentId, name: vm.htmlToPlaintext(message.body)})">\n        <span>{{vm.htmlToPlaintext(message.body)}}</span>\n        <md-icon md-font-icon="icon-download"></md-icon>\n      </md-button>\n      <div ng-if="!vm.downloadPermissions.attachments" class="disabled-button">\n        <span>{{vm.htmlToPlaintext(message.body)}}</span>\n        <md-icon md-font-icon="icon-download"></md-icon>\n      </div>\n    </div>\n    <div ng-if="!message.AttachmentId" class="message" layout="row" layout-align="end center">\n      <span ng-bind-html="message.body | embed: vm.embedOptions"></span>\n    </div>\n  </div>\n</div>\n\x3c!-- / MESSAGES --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html",'<div ms-timeline="vm.interactionTimelineOptions" ms-timeline-load-more="vm.loadNextPage()">\n  <div ng-repeat="message in vm.messages.rows track by message.id" ng-init="vm.selectedMailShowSystemMessage[message.id] = false">\n    <md-card ng-if="message.secret" class="md-padding md-yellow-100-bg" layout="column">\n      <div layout="row" layout-align="start center">\n        <img class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n        <div layout="column">\n          <span class="grey-fg">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n          <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n        </div>\n      </div>\n      <div layout="row" layout-align="center center" layout-fill ng-if="message.attach && vm.downloadPermissions.attachments">\n        <div flex>\n          <md-divider></md-divider>\n        </div>\n        <md-menu>\n          <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n            <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span>\n            </md-tooltip>\n            <div layout="row" layout-align="start center">\n              <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon>\n              <span>{{message.attach}}</span>\n            </div>\n          </md-button>\n          <md-menu-content width="4">\n            <div layout="column" layout-align="center center" ng-if="!message.attachments">\n              <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n              <span translate="MAIL.ATTACHMENTS">Attachments</span>\n            </div>\n            <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n              <md-button ng-click="vm.getAttachment(attachment)">\n                {{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n        <div flex>\n          <md-divider></md-divider>\n        </div>\n      </div>\n      <div class="padding-top-5" ng-bind-html-unsafe="message.body"></div>\n    </md-card>\n    <div ng-if="!message.secret">\n      <div layout="row" layout-align="center center" ng-if="message.direction == \'out\' && !message.UserId && !vm.selectedMailShowSystemMessage[message.id]">\n        <md-button class="md-raised blue-grey-300-bg white-fg" ng-click="vm.selectedMailShowSystemMessage[message.id] = !vm.selectedMailShowSystemMessage[message.id]">\n          [{{message.createdAt | date: \'medium\'}}] {{ \'MAIL.SHOW_AUTOREPLY\' | translate }}</md-button>\n      </div>\n      <md-card layout="column" class="md-padding message-row" ng-if="message.direction == \'in\' || (message.direction == \'out\' && (message.UserId || vm.selectedMailShowSystemMessage[message.id]))">\n        <md-content class="mail-content">\n          <div class="info" layout="row" layout-align="space-between start">\n            <div layout="column" layout-align="start start">\n              <div layout="row" layout-align="start start">\n                <div layout="column" layout-align="start start">\n                  <div class="name" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n                    <strong privacy ng-cloak>{{message.from}}</strong>\n                    <md-icon ng-if="message.attach" md-font-icon="icon-paperclip" class="s16">\n                    </md-icon>\n                  </div>\n                  <div class="name">\n                    <div>{{message.subject}}</div>\n                  </div>\n                  <div class="name" layout="row" layout-align="start center"><span translate="MAIL.TO">To</span>: <span class="padding-left-5 subject text-truncate" privacy ng-cloak>{{ message.originTo || message.to\n                      }}</span>\n                  </div>\n                  <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.originCc && message.originCc.indexOf(vm.account.email) >= 0">\n                    <em><span class="blue-grey" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are\n                        registered as a</span> <span class="blue-grey">CC</span></em>\n                  </div>\n                  <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.bcc && message.bcc.indexOf(vm.account.email) >= 0">\n                    <em><span class="red-fg" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are\n                        registered as a</span> <span class="red-fg">BCC</span></em>\n                  </div>\n                </div>\n              </div>\n\n              <a class="toggle-details md-accent-color" ng-hide="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.SHOW_DETAILS">\n                Show Details\n              </a>\n              <a class="toggle-details md-accent-color" ng-show="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.HIDE_DETAILS">\n                Hide Details\n              </a>\n              <div ng-show="vm.selectedMailShowDetails[message.id]" class="details" layout="row" layout-align="start start">\n                <div layout="column">\n                  <span class="title" translate="MAIL.DATE">Date:</span>\n                  <span class="title" translate="MAIL.FROM">From:</span>\n                  <span class="title" translate="MAIL.TO">To:</span>\n                  \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n                  <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && message.originCc">Cc:</span>\n                  <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc">Cc:</span>\n                  <span class="title" translate="MAIL.CC" ng-if="message.direction === \'out\' && message.cc">Cc:</span>\n                  \x3c!-- End retrocompatibility --\x3e\n                  <span class="title" translate="MAIL.BCC" ng-if="message.bcc">Bcc:</span>\n                  <span class="title" translate="MAIL.ACCEPTED" ng-if="message.UserId && message.direction ===\'in\'">Accepted:</span>\n                </div>\n\n                <div layout="column">\n                  <span class="detail">{{message.createdAt | date:\'medium\'}}</span>\n                  <span class="detail" privacy ng-cloak>{{message.from}}</span>\n                  <span class="detail" privacy ng-cloak>{{message.originTo || message.to}}</span>\n                  \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n                  <span class="detail" ng-if="message.direction === \'in\' && message.originCc" privacy ng-cloak>{{\n                    message.originCc }}</span>\n                  <span class="detail" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc" privacy ng-cloak>{{ message.cc }}</span>\n                  <span class="detail" ng-if="message.direction === \'out\' && message.cc" privacy ng-cloak>{{ message.cc\n                    }}</span>\n                  \x3c!-- End retrocompatibility --\x3e\n                  <span class="detail" ng-if="message.bcc" privacy ng-cloak>{{message.bcc}}</span>\n                  <span class="detail" ng-if="message.UserId && message.direction ===\'in\'">{{vm.usersMap[message.UserId]}}</span>\n                </div>\n              </div>\n            </div>\n\n            <div layout="row" layout-align="center center">\n              <div layout="column" layout-align="center end" class="md-padding">\n                <span class="grey-fg" ng-if="message.direction ===\'in\'" privacy>{{message.from.indexOf(vm.contact.email)\n                  >= 0 ? vm.contact.firstName + \' \' + vm.contact.lastName : \'*\' + message.from}}</span>\n                <span class="grey-fg" ng-if="message.direction ===\'out\' && message.UserId">{{vm.agent.fullname ||\n                  vm.usersMap[message.UserId]}}</span>\n                <span class="grey-fg" ng-if="message.direction ===\'out\' && !message.UserId">System</span>\n                <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n              </div>\n              <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n              <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n              <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n            </div>\n          </div>\n\n          <div layout="row" layout-align="center center" layout-fill>\n            <div flex>\n              <md-divider></md-divider>\n            </div>\n            <div>\n              <div class="interaction-reply-button-container">\n                <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DRAFT">Draft</span>\n                </md-tooltip>\n                <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="draft" ng-disabled="!vm.draft" ng-click="vm.openDraft(message.id)">\n                  <md-icon md-font-icon="icon-pencil-box" class="icon s24"></md-icon>\n                </md-button>\n              </div>\n              <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', message)">\n                <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n                <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n              </md-button>\n              <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', message)">\n                <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n              </md-button>\n              <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', message)">\n                <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n              </md-button>\n              <md-button ng-if="!message.attach && vm.downloadPermissions.interactions" class="md-icon-button" aria-label="forward" ng-click="vm.downloadMessage(message)">\n                <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span>\n                </md-tooltip>\n                <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n              </md-button>\n              <md-menu ng-if="message.attach && vm.downloadPermissions.interactions" class="no-margin" md-position-mode="target-right target">\n                <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n                  <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span>\n                  </md-tooltip>\n                  <md-icon md-font-icon="icon-download"></md-icon>\n                </md-button>\n                <md-menu-content width="2">\n                  <md-menu-item ng-if="vm.downloadPermissions.attachments">\n                    <md-button ng-click="vm.downloadMessage(message, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n                      Download with attachments\n                    </md-button>\n                  </md-menu-item>\n                  <md-menu-item>\n                    <md-button ng-click="vm.downloadMessage(message)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                      Download without attachments\n                    </md-button>\n                  </md-menu-item>\n                </md-menu-content>\n              </md-menu>\n              <md-menu ng-if="message.attach && vm.downloadPermissions.attachments">\n                <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n                  <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n                  <div layout="row" layout-align="start center">\n                    <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon>\n                    <span>{{message.attach}}</span>\n                  </div>\n                </md-button>\n                <md-menu-content width="4">\n                  <div layout="column" layout-align="center center" ng-if="!message.attachments">\n                    <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n                    <span translate="MAIL.ATTACHMENTS">Attachments</span>\n                  </div>\n                  <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n                    <md-button ng-click="vm.getAttachment(attachment)">\n                      {{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n                  </md-menu-item>\n                </md-menu-content>\n              </md-menu>\n            </div>\n            <div flex>\n              <md-divider></md-divider>\n            </div>\n          </div>\n\n          <md-content ng-bind-html-unsafe="message.body"></md-content>\n        </md-content>\n      </md-card>\n    </div>\n    <div ng-hide="!(vm.BTNLoadMore > 0)" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row">\n      <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-disabled="!(vm.BTNLoadMore > 0)" ng-click="vm.loadNextPage()" translate="DASHBOARDS.MORE">\n      </md-button>\n    </div>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html",'<div class="big-circle md-whiteframe-4dp">\n  <md-icon class="s128 md-accent" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n</div>\n<span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n<span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n  interaction...</span>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.chat.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeChatInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="CHAT.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeFaxInteraction(\'new\')">\n  <md-tooltip md-direction="bottom"><span translate="FAX.REPLY">Reply</span></md-tooltip>\n  <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n  <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n  <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html",'<div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n  <md-icon md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" class="s20" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n  <div class="padding-left-10" layout="column" layout-align="center start" flex>\n    <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n      <span>#{{vm.interaction.id}} - {{vm.account.key}}</span>\n      <div layout="row" layout-align="center center" class="p-8">\n        <md-icon ng-if="vm.tab.channel === \'openchannel\' && vm.interaction.threadId" md-font-icon="fas fa-users" class="s16">\n          <md-tooltip><span translate="DASHBOARDS.PUBLIC_INTERACTION">The interaction is public</span></md-tooltip>\n        </md-icon>\n        <md-icon ng-if="vm.interaction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n      </div>\n      <span class="red-fg padding-left-25" ng-if="vm.interaction.closed" translate="DASHBOARDS.CLOSED">CLOSED</span>\n      <span class="green-fg padding-left-25" ng-if="!vm.interaction.closed"><span translate="DASHBOARDS.OPENED">OPENED</span><span ng-if="vm.interaction.substatus"> -\n          {{vm.interaction.substatus}}</span></span>\n      <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40" ng-if="!vm.interaction.closed">\n        <timer start-time="vm.interaction.createdAt"></timer>\n        <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n      </div>\n    </div>\n    <div class="tags" layout="row" layout-align="start center" ng-if="vm.interaction.Tags.length" ng-class="{\'padding-top-5\': vm.interaction.Tags.length}">\n      <div class="tag margin-right-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n        <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n        <div class="tag-label">{{tag.name}}</div>\n      </div>\n    </div>\n  </div>\n  <div layout="row" layout-align="end center">\n    <div ng-switch="vm.tab.channel">\n      <div ng-switch-when="mail">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="fax">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="sms">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="whatsapp">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.whatsapp.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="chat">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.chat.html\'">\n        </div>\n      </div>\n      <div ng-switch-when="openchannel">\n        <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.openchannel.html\'">\n        </div>\n      </div>\n    </div>\n    <md-menu ng-if="[\'fax\', \'sms\', \'whatsapp\'].indexOf(vm.tab.channel) < 0 && vm.downloadPermissions.interactions" class="no-margin" md-position-mode="target-right target">\n      <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n        <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n        <md-icon md-font-icon="icon-download"></md-icon>\n      </md-button>\n      <md-menu-content width="2">\n        <md-menu-item ng-if="vm.downloadPermissions.attachments">\n          <md-button ng-click="vm.downloadInteraction(vm.interaction, true)" translate="DASHBOARDS.DOWNLOAD_WITH_ATTACHMENTS">\n            Download with attachments\n          </md-button>\n        </md-menu-item>\n        <md-menu-item>\n          <md-button ng-click="vm.downloadInteraction(vm.interaction)" translate="DASHBOARDS.DOWNLOAD_WITHOUT_ATTACHMENTS">\n            Download without attachments\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n    <md-menu class="no-margin" ng-if="!vm.interaction.disposition" md-position-mode="target-right target">\n      <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="more">\n        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n      </md-button>\n\n      <md-menu-content width="2">\n\n        <md-menu-item ng-if="vm.tab.channel === \'chat\' && !vm.interaction.closed && !vm.tab.spy && vm.account.vidaooEscalation && vm.account.vidaooApiKey">\n          <md-button ng-click="vm.createVidaooSession(vm.interaction)" translate="DASHBOARDS.VIDAOOSESSION">\n            Start Video Call\n          </md-button>\n        </md-menu-item>\n\n        <md-menu-item>\n          <md-button ng-click="vm.tagInteraction()" translate="DASHBOARDS.TAG">\n            Tag\n          </md-button>\n        </md-menu-item>\n        <md-menu-item ng-if="vm.account.queueTransfer || vm.account.agentTransfer">\n          <md-button ng-click="vm.transferLastMessage()" translate="DASHBOARDS.TRANSFER">\n            Transfer\n          </md-button>\n        </md-menu-item>\n        <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && (vm.subStatuses.rows.length || vm.interaction.substatus != null)">\n          <md-menu>\n            <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.SET_AS">\n              Set as\n            </md-button>\n            <md-menu-content>\n              <md-menu-item ng-if="vm.interaction.substatus != null">\n                <md-button ng-click="vm.setAs(null)" translate="DASHBOARDS.NONE">\n                  None\n                </md-button>\n              </md-menu-item>\n              <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n                <md-button ng-click="vm.setAs(subStatus.name)">\n                  {{subStatus.name}}\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </md-menu-item>\n        <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && vm.account.markAsUnread">\n          <md-button ng-click="vm.markAsUnread()" translate="DASHBOARDS.MARK_AS_UNREAD">\n            Unread\n          </md-button>\n        </md-menu-item>\n        <md-menu-item ng-if="!vm.tab.spy && !vm.interaction.closed">\n          <md-button ng-click="vm.disposeInteraction()" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n            Close and Dispose\n          </md-button>\n        </md-menu-item>\n        <md-menu-item ng-if="!vm.tab.spy && vm.interaction.closed && !vm.interaction.disposition">\n          <md-button ng-click="vm.disposeInteraction(ev)" translate="DASHBOARDS.DISPOSE">\n            Dispose\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html",'<div class="interaction-reply-button-container">\n  <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DRAFT">Draft</span></md-tooltip>\n  <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="draft" ng-disabled="!vm.draft" ng-click="vm.openDraft()">\n    <md-icon ng-cloak md-font-icon="icon-pencil-box" class="icon s24" ng-class="vm.draft ? \'red-500-fg\' : \'grey-fg\'"></md-icon>\n  </md-button>\n</div>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n  <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n  <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n  <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeMailInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="MAIL.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.openchannel.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeOpenchannelInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="OPENCHANNEL.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeSmsInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="SMS.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n  <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n  <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.whatsapp.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeWhatsappInteraction(\'note\', vm.interaction)">\n  <md-tooltip md-direction="bottom"><span translate="WHATSAPP.NOTE">Note</span></md-tooltip>\n  <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n  <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n  <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html",'<md-content class="md-padding" layout="column" layout-align="center center">\n  <div layout="row" layout-align="center center">\n    <span ng-if="!vm.tab.saved" class="text-boxed md-green-bg">\n      <timer start-time="vm.starttime"></timer>\n    </span>\n    <span ng-if="vm.contact" class="text-boxed md-gray-bg font-weight-900">{{vm.contact.firstName}} {{vm.contact.lastName}} {{vm.contact.phone}}</span>\n    <md-button ng-if="vm.showResetButton" ng-click="vm.resetViewer()" md-no-ink class="md-raised md-accent orange-bg">\n      <md-icon md-font-icon="icon-rotate-left" class="icon s16"></md-icon> {{\'JSCRIPTY.RESET_SESSION\' | translate}}\n    </md-button>\n    <md-button ng-if="vm.contact" ng-click="vm.openContact($event, vm.contact)" md-no-ink class="md-raised md-accent" translate="JSCRIPTY.OPEN_CONTACT"></md-button>\n    <md-button ng-if="vm.showIncompleteSubmitButton" ng-click="vm.onSubmit($event, true)" md-no-ink class="md-raised md-accent green-bg" translate="JSCRIPTY.SUBMIT"></md-button>\n  </div>\n  <h1 ng-if="!vm.project.formData"><span translate="JSCRIPTY.PROJECT_NOT_AVAILABLE">Project is not available. Please contact the administrator</span></h1>\n  <mw-form-viewer ng-if="vm.project.formData" form-data="vm.project.formData" response-data="vm.project.responseData" on-submit="vm.onSubmit($event)" template-data="call" api="vm.formViewer"></mw-form-viewer>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/notification/dialog.html",'\x3c!-- <md-toast> --\x3e\n<div class="md-padding" layout="column" layout-align="center center">\n  <span class="md-title">#{{vm.notification.id}} {{vm.notification.title}}</span>\n  <span class="md-subhead" ng-if="vm.notification.queue">{{vm.notification.queue}}</span>\n  <div class="padding-top-5" layout="row">\n    <md-button class="md-raised md-accent" ng-click="vm.accept($event)" translate="DASHBOARDS.ACCEPT">\n      ACCEPT\n    </md-button>\n    <md-button class="md-raised md-warn" ng-click="vm.reject($event)" translate="DASHBOARDS.REJECT">\n      REJECT\n    </md-button>\n  </div>\n</div>\n\x3c!-- </md-toast> --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html",'<md-content class="md-padding" flex>\n  <div ng-if="vm.html" ng-bind-html="vm.html"></div>\n  <h1 ng-if="!vm.html">Template is empty. Please contact the administrator</h1>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-hangouts" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-52 line-height-72">\n            {{vm.inbound.abandoned || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_MANAGED_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_MANAGED_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_MANAGED_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ABANDONED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_MOTION_BULL_STATS">Today Motion Bull STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-timelapse"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{(vm.inbound.talking || 0) + (vm.inbound.pTalking || 0)}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-missed"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-52 line-height-72">\n            {{vm.inbound.outboundDropCallsDayCallersExit || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.outboundDropCallsDayTimeout || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROPPED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.DROPPED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.DROPPED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-dots"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.originated || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.ORIGINATED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ORIGINATED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.outboundanswerRate || 0 |number : 1}}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.outboundAbandonRate || 0}}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ABANDON_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.outboundDropRate }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROP_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.DROP_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.DROP_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e\n\n\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_IVR_CAMPAIGNS_STATS">Today IVR campaigns stats</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-dots"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.ivr.originated || 0}}/{{vm.ivr.limitCalls || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}/{{\'DASHBOARDS.LIMITED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.LIMITED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ORIGINATEDLIMITED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET IVR --\x3e'),e.put("app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-deskphone" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-email" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-google-earth" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-message-text" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/user.general.html",'<div id="dashboard-general" ng-init="vm.onInit()" class="page-layout simple right-sidenav" layout="row">\n  \x3c!-- CENTER --\x3e\n  <div class="center" flex>\n    \x3c!-- CONTENT --\x3e\n    <div class="content">\n      <md-tabs ng-if="vm.hasDashboardPermissions" md-selected="vm.selectedTab" md-dynamic-height>\n        <md-tab ng-if="vm.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}" ui-sref="app.dashboards.general.voice">\n          <div ui-view="voice"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.dialer" label="{{\'DASHBOARDS.MOTIONDIALER\' | translate}}" ui-sref="app.dashboards.general.dialer">\n          <div ui-view="dialer"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}" ui-sref="app.dashboards.general.chat">\n          <div ui-view="chat"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}" ui-sref="app.dashboards.general.mail">\n          <div ui-view="mail"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}" ui-sref="app.dashboards.general.sms">\n          <div ui-view="sms"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}" ui-sref="app.dashboards.general.openchannel">\n          <div ui-view="openchannel"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}" ui-sref="app.dashboards.general.fax">\n          <div ui-view="fax"></div>\n        </md-tab>\n        <md-tab ng-if="vm.license.whatsapp" label="{{\'DASHBOARDS.WHATSAPP\' | translate}}" ui-sref="app.dashboards.general.whatsapp">\n          <div ui-view="whatsapp"></div>\n        </md-tab>\n      </md-tabs>\n    </div>\n    \x3c!-- END CONTENT --\x3e\n\n    <md-content ng-if="!vm.hasDashboardPermissions" layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n      <div layout="column" layout-align="space-around center" flex="50">\n        <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n        <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to\n          navigate through available sections.</span>\n      </div>\n\n      <div layout="column" flex="50">\n        <img src="assets/images/avatars/permissions.png" alt="permissions">\n      </div>\n    </md-content>\n  </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-phone-incoming" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INBOUND_STATS">Today Inbound STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-timelapse"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-missed"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-52 line-height-72">\n            {{vm.inbound.abandoned || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ABANDONED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-incoming"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-timer-sand"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-dots"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.VOICE_UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e\n\n\x3c!-- WIDGET OUTBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_OUTBOUND_STATS">Today Outbound STATS</div>\n  </div>\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.outbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.outbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OUTBOUND_ANSWERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-clock"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-42 line-height-72">\n            {{vm.outbound.sumDuration || 0 | secToTime | date:\'HH:mm:ss\'}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOT_DURATION\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TOT_DURATION_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOT_DURATION\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-division"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{vm.outbound.total ? ((vm.outbound.sumDuration / vm.outbound.total) | number: 0) : 0 | secToTime | date:\'HH:mm:ss\'}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_DURATION\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_DURATION_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_DURATION\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n            <md-icon md-font-icon="icon-percent"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-42 line-height-72">\n            {{vm.outbound.total ? (vm.outbound.answered / vm.outbound.total * 100) : 0 | number: 1}}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OUTBOUND_ANSWER_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/whatsapp/user.general.whatsapp.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n  <div class="pb-16" layout="row" layout-align="start center">\n    <md-icon md-font-icon="icon-whatsapp" class="m-0 mr-16"></md-icon>\n    <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n  </div>\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-52 line-height-72">\n            {{vm.inbound.waiting || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n    \x3c!-- WIDGET 3 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="orange-fg font-size-52 line-height-72">\n            {{vm.inbound.talking || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 3 --\x3e\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-52 line-height-72">\n            {{vm.inbound.answered || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.unmanaged || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-green-fg font-size-52 line-height-72">\n            {{vm.inbound.total || 0}}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n\n  \x3c!-- WIDGET GROUP --\x3e\n  <div class="widget-group" layout="row" flex="100" layout-wrap>\n    \x3c!-- WIDGET 1 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="light-blue-fg font-size-42 line-height-72">\n            {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 1 --\x3e\n\n\n    \x3c!-- WIDGET 2 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="red-fg font-size-42 line-height-72">\n            {{ vm.inbound.answerRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 2 --\x3e\n\n    \x3c!-- WIDGET 4 --\x3e\n    <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n      \x3c!-- Front --\x3e\n      <ms-widget-front class="grey-50-bg">\n        <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n        </div>\n\n        <div class="pt-8 pb-32" layout="column" layout-align="center center">\n          <div class="blue-grey-fg font-size-42 line-height-72">\n            {{ vm.inbound.abandonRate || 0 }}%\n          </div>\n          <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n        </div>\n\n        <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n          <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n        </div>\n      </ms-widget-front>\n      \x3c!-- / Front --\x3e\n\n      \x3c!-- Back --\x3e\n      <ms-widget-back class="p-16 grey-50-bg">\n        <div class="flip-to-front">\n          <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n            <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n          </md-button>\n        </div>\n\n        <div>\n          {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n        </div>\n      </ms-widget-back>\n      \x3c!-- / Back --\x3e\n\n    </ms-widget>\n    \x3c!-- / WIDGET 4 --\x3e\n\n\n  </div>\n  \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/fax/views/faxAccounts/create/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="faxAccountForm[\'name\'].$error" ng-show="faxAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="faxAccountForm[\'key\'].$error" ng-show="faxAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.TRUNK">trunk</label>\n        <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n          <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountForm[\'TrunkId\'].$error" ng-show="faxAccountForm[\'TrunkId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.LOCALSTATIONID">localstationid</label>\n        <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n\n        <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n        <div ng-messages="faxAccountForm[\'localstationid\'].$error" ng-show="faxAccountForm[\'localstationid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountForm[\'ListId\'].$error" ng-show="faxAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.faxAccount.description">\n\n        <div ng-messages="faxAccountForm[\'description\'].$error" ng-show="faxAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxAccount" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid || faxAccountForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxAccount" ng-click="vm.addNewFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXACCOUNT" translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n          ADD FAXACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxAccount" ng-click="vm.deleteFaxAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",'<md-dialog class="faxAccount-dialog" aria-label="faxAccount" ng-init="vm.onInit()">\n  <form name="faxAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="FAX.AGENTADD_FAXACCOUNT">Add Agent to faxAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/agent/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountFormApp[\'agent\'].$error" ng-show="faxAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/close/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'disposition\'].$error" ng-show="faxAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'condition\'].$error" ng-show="faxAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'truepriority\'].$error" ng-show="faxAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'falsepriority\'].$error" ng-show="faxAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'priority\'].$error" ng-show="faxAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/noop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'value\'].$error" ng-show="faxAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/queue/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountFormApp[\'queue\'].$error" ng-show="faxAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/system/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="faxAccountFormApp[\'command\'].$error" ng-show="faxAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountFormApp[\'variable\'].$error" ng-show="faxAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/tag/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n  <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="faxAccountFormApp[\'tag\'].$error" ng-show="faxAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/view.html",'<div id="fax-faxAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-faxAccounts-button md-icon-button" aria-label="Go to faxAccounts" ng-click="vm.gotoFaxAccounts()" translate translate-attr-aria-label="FAX.GO_TO_FAXACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="faxAccount-image" hide-xs>\n          <img ng-src="assets/images/business/faxAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.faxAccount.id}}\n            <span ng-if="vm.faxAccount.name">{{vm.faxAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="FAX.GOTO_FAXACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="FAX.AGENTADD_FAXACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveFaxAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (advancedForm.$invalid) || (dispositionForm.$invalid) || (faxDispositionsForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="FAX.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.HEADERINFO">headerinfo</label>\n                <input type="text" name="headerinfo" ng-model="vm.faxAccount.headerinfo" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.HEADERINFO"></span></div>\n                <div ng-messages="generalForm[\'headerinfo\'].$error" ng-show="generalForm[\'headerinfo\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.HEADERINFO_REQUIRED">headerinfo field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.TRUNK">trunk</label>\n                <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.LOCALSTATIONID">localstationid</label>\n                <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n                <div ng-messages="generalForm[\'localstationid\'].$error" ng-show="generalForm[\'localstationid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.faxAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.faxAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.faxAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="faxAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="FAX.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.faxAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="faxAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.faxAccount.queueTransfer == true" class="md-block">\n                <label translate="FAX.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.faxAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.faxAccount.agentTransfer == true" class="md-block">\n                <label translate="FAX.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.faxAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxAccount-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="FAX.ECM">ECM</label>\n                <md-select name="ecm" ng-model="vm.faxAccount.ecm" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                </md-select>\n                <div class="hint"><span translate="FAX.HELP.ECM"></span></div>\n                <div ng-messages="advancedForm[\'ecm\'].$error" ng-show="advancedForm[\'ecm\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.ECM_REQUIRED">ECM field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.MINRATE">minrate</label>\n                <md-select name="minrate" ng-model="vm.faxAccount.minrate" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'2400\'">2400</md-option>\n                  <md-option ng-value="\'4800\'">4800</md-option>\n                  <md-option ng-value="\'7200\'">7200</md-option>\n                  <md-option ng-value="\'9600\'">9600</md-option>\n                  <md-option ng-value="\'12000\'">12000</md-option>\n                  <md-option ng-value="\'14400\'">14400</md-option>\n                </md-select>\n                <div class="hint"><span translate="FAX.HELP.MINRATE"></span></div>\n                <div ng-messages="advancedForm[\'minrate\'].$error" ng-show="advancedForm[\'minrate\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.MINRATE_REQUIRED">minrate field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.MAXRATE">maxrate</label>\n                <md-select name="maxrate" ng-model="vm.faxAccount.maxrate" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'2400\'">2400</md-option>\n                  <md-option ng-value="\'4800\'">4800</md-option>\n                  <md-option ng-value="\'7200\'">7200</md-option>\n                  <md-option ng-value="\'9600\'">9600</md-option>\n                  <md-option ng-value="\'12000\'">12000</md-option>\n                  <md-option ng-value="\'14400\'">14400</md-option>\n                </md-select>\n                <div class="hint"><span translate="FAX.HELP.MAXRATE"></span></div>\n                <div ng-messages="advancedForm[\'maxrate\'].$error" ng-show="advancedForm[\'maxrate\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.MAXRATE_REQUIRED">maxrate field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.MODEM">modem</label>\n                <input type="text" name="modem" ng-model="vm.faxAccount.modem" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.MODEM"></span></div>\n                <div ng-messages="advancedForm[\'modem\'].$error" ng-show="advancedForm[\'modem\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.MODEM_REQUIRED">modem field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.GATEWAY">gateway</label>\n                <input type="text" name="gateway" ng-model="vm.faxAccount.gateway" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.GATEWAY"></span></div>\n                <div ng-messages="advancedForm[\'gateway\'].$error" ng-show="advancedForm[\'gateway\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.GATEWAY_REQUIRED">gateway field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.FAXDETECT">faxdetect</label>\n                <input type="text" name="faxdetect" ng-model="vm.faxAccount.faxdetect" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.FAXDETECT"></span></div>\n                <div ng-messages="advancedForm[\'faxdetect\'].$error" ng-show="advancedForm[\'faxdetect\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.FAXDETECT_REQUIRED">faxdetect field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.T38TIMEOUT">t38timeout</label>\n                <input type="number" name="t38timeout" ng-model="vm.faxAccount.t38timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="FAX.HELP.T38TIMEOUT"></span></div>\n                <div ng-messages="advancedForm[\'t38timeout\'].$error" ng-show="advancedForm[\'t38timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.T38TIMEOUT_REQUIRED">t38timeout field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.SIP">SIP</label>\n                <md-select name="tech" ng-model="vm.faxAccount.tech" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'SIP\'">SIP</md-option>\n                  <md-option ng-value="\'IAX\'">IAX</md-option>\n                  <md-option ng-value="\'DADHI\'">DADHI</md-option>\n                  <md-option ng-value="\'KHOMP\'">KHOMP</md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'tech\'].$error" ng-show="advancedForm[\'tech\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.SIP_REQUIRED">SIP field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="faxAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.faxAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.faxAccount.mandatoryDisposition" class="md-block">\n                <label translate="FAX.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.faxAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="FAX.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="FaxAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="faxAccount-detail-form-container faxdispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="FAX.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add fax dispositions" translate translate-attr-label="FAX.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="faxAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="FaxAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.faxAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="FAX.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedFaxAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedFaxAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedFaxAccountApps.length}} {{vm_ac.selectedFaxAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedFaxAccountApps($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedFaxAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.faxAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editFaxAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.faxAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="FaxAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="FAX.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getFaxAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getFaxAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getFaxAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="FAX.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedFaxAccountInteractions.length}} {{vm_dc.selectedFaxAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountInteractions" csv-label="true" filename="faxAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'FAX.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'FAX.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'FAX.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'FAX.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'FAX.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'FAX.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'FAX.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.faxAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'FAX.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'FAX.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spyfaxInteraction($event, interaction)" translate="FAX.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.faxInteractionDownload(interaction, $event)" translate="FAX.DOWNLOAD_INTERACTION">\n                                Download\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="FAX.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.faxAccountInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="FAX.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.faxAccountInteractions.count}}" md-on-paginate="vm_dc.getFaxAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxAccounts/faxAccounts.html",'<div id="faxAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="FAX.FAXACCOUNTS">FaxAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedFaxAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedFaxAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="FAX.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-faxAccounts-count">\n          <span>{{vm.selectedFaxAccounts.length}}</span>\n          <span translate="FAX.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAX.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllFaxAccounts()" translate="FAX.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectFaxAccounts()" translate="FAX.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedFaxAccounts" csv-label="true" filename="faxAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxAccounts($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- FAXACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedFaxAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'FAX.KEY\' | translate }}</th>\n                <th md-column md-order-by="TrunkId">{{ \'FAX.TRUNK\' | translate }}</th>\n                <th md-column md-order-by="localstationid">{{ \'FAX.LOCALSTATIONID\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.faxAccounts.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="faxAccount" md-select-id="id" ng-repeat="faxAccount in vm.faxAccounts.rows">\n                <td md-cell ng-if="faxAccount.userpic"><img class="avatar" alt="{{faxAccount.name}}" ng-src="api/users/{{faxAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!faxAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="id ">{{faxAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="name ">{{faxAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="key ">{{faxAccount.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':faxAccount.TrunkId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="localstationid ">{{faxAccount.localstationid}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="description ">{{faxAccount.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(faxAccount, $event    )" translate="FAX.EDIT_FAXACCOUNT">\n                          Edit FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(faxAccount, $event    )" translate="FAX.INTERACTIONS_FAXACCOUNT">\n                          Interactions FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(faxAccount, $event    )" translate="FAX.GOTOREALTIME_FAXACCOUNT">\n                          goToRealtime FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(faxAccount, $event    )" translate="FAX.AGENTADD_FAXACCOUNT">\n                          AgentAdd FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(faxAccount, $event    )" translate="FAX.DELETE_FAXACCOUNT">\n                          Delete FaxAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / FAXACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD FAXACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxAccount-button" ng-click="vm.createOrEditFaxAccount($event)" aria-label="add faxAccount" translate translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD FAXACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/faxQueues/create/dialog.html",'<md-dialog class="faxQueue-dialog" aria-label="New FaxQueue">\n  <form name="faxQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="FAX.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newFaxQueue">\n\n        <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n        <div ng-messages="faxQueueForm[\'name\'].$error" ng-show="faxQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="faxQueueForm[\'strategy\'].$error" ng-show="faxQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="faxQueueForm[\'timeout\'].$error" ng-show="faxQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="FAX.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.faxQueue.description">\n\n        <div ng-messages="faxQueueForm[\'description\'].$error" ng-show="faxQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxQueue" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid || faxQueueForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxQueue" ng-click="vm.addNewFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXQUEUE" translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n          ADD FAXQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxQueue" ng-click="vm.deleteFaxQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n  <form name="faxQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="FAX.AGENTADD_FAXQUEUE">Add Agent to faxQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n  <form name="faxQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="FAX.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/view.html",'<div id="fax-faxQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-faxQueues-button md-icon-button" aria-label="Go to faxQueues" ng-click="vm.gotoFaxQueues()" translate translate-attr-aria-label="FAX.GO_TO_FAXQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="faxQueue-image" hide-xs>\n          <img ng-src="assets/images/business/faxQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.faxQueue.id}}\n            <span ng-if="vm.faxQueue.name">{{vm.faxQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.faxQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="FAX.TEAMADD_FAXQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.faxQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="FAX.AGENTADD_FAXQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveFaxQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="faxQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="FAX.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.faxQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="FAX.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.faxQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxQueues/faxQueues.html",'<div id="faxQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="FAX.FAXQUEUES">FaxQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedFaxQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedFaxQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="FAX.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-faxQueues-count">\n          <span>{{vm.selectedFaxQueues.length}}</span>\n          <span translate="FAX.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAX.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllFaxQueues()" translate="FAX.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectFaxQueues()" translate="FAX.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedFaxQueues" csv-label="true" filename="faxQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxQueues($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- FAXQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedFaxQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'FAX.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.faxQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="faxQueue" md-select-id="id" ng-repeat="faxQueue in vm.faxQueues.rows">\n                <td md-cell ng-if="faxQueue.userpic"><img class="avatar" alt="{{faxQueue.name}}" ng-src="api/users/{{faxQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!faxQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="id ">{{faxQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="name ">{{faxQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="strategy ">{{ vm.arraystrategy[faxQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(faxQueue, $event    )" translate="FAX.EDIT_FAXQUEUE">\n                          Edit FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(faxQueue, $event    )" translate="FAX.TEAMADD_FAXQUEUE">\n                          teamadd FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(faxQueue, $event    )" translate="FAX.AGENTADD_FAXQUEUE">\n                          agentadd FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(faxQueue, $event    )" translate="FAX.DELETE_FAXQUEUE">\n                          Delete FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(faxQueue, $event    )" translate="FAX.GOTOREALTIME_FAXQUEUE">\n                          goToRealtime FaxQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxQueues.count}}" md-on-paginate="vm.getFaxQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / FAXQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD FAXQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxQueue-button" ng-click="vm.createOrEditFaxQueue($event)" aria-label="add faxQueue" translate translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD FAXQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="FAX.ACCOUNTS">Accounts</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.vm.getFaxAccounts()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate}}</th>\n        <th md-column>{{\'FAX.KEY\' | translate}}</th>\n        <th md-column>{{\'FAX.TOTAL\' | translate}}</th>\n        <th md-column>{{\'FAX.IN\' | translate}}</th>\n        <th md-column>{{\'FAX.OUT\' | translate}}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.faxAccounts">\n        <td md-cell colspan="4">\n          <div layout="row" layout-align="center center">\n            <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="vm.faxAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n        <td md-cell>{{vm.faxAccounts[value].name}}</td>\n        <td md-cell>{{vm.faxAccounts[value].key}}</td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{(vm.faxAccounts[value].in || 0) + (vm.faxAccounts[value].out || 0)}}</span>\n        </td>\n        <td md-cell>\n          <div layout="row">\n            <span>\n              <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n            </span>\n            <span class="md-capture blue-fg">{{vm.faxAccounts[value].in || 0}}</span>\n            <span class="text-boxed" ng-if="mailAccount.in">{{vm.faxAccounts[value].lastIn ?  (vm.faxAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n          </div>\n        </td>\n        <td md-cell>\n          <div layout="row">\n            <span>\n              <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n            </span>\n            <span class="md-capture green-fg">{{vm.faxAccounts[value].out || 0}}</span>\n            <span class="text-boxed" ng-if="mailAccount.out">{{vm.faxAccounts[value].lastOut ?  (vm.faxAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n          </div>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n\n            <md-menu-content width="4">\n              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                <md-button ng-click="vm.goToFaxAccount($event, vm.faxAccounts[value])" translate="FAX.EDIT_ACCOUNT">\n                  Edit Account\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="FAX.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n        <th md-column>{{ \'FAX.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'FAX.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'FAX.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="FAX.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="FAX.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/fax/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.TRUNKS">Trunks</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="FAX.ACCOUNTS">Accounts</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="FAX.TRUNKS">Telephones</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getTrunks()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head>\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n        <tr md-row>\n          <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n          <th md-column>{{ \'FAX.TRUNK_STATUS\' | translate }}</th>\n          <th md-column>{{ \'FAX.REGISTRY\' | translate }}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.trunks">\n        <td md-cell colspan="3">\n          <div layout="row" layout-align="center center">\n            <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n        <td md-cell>{{trunk.name}}</td>\n        <td md-cell>\n          <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n            <md-tooltip>{{\'FAX.\' + trunk.status | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n        </td>\n        <td md-cell>\n          <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n            <md-tooltip>{{\'FAX.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n          <span ng-if="!trunk.registry" translate="FAX.NO_REGISTRY">\n            No Registry\n          </span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n\n            <md-menu-content width="4">\n              <md-menu-item>\n                <md-button ng-click="vm.goToTrunk($event, trunk)" translate="FAX.EDIT_TRUNK">\n                  Edit Trunk\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/help/views/about/about.html",'<div id="maintenance" class="flex-scrollable" layout="column">\n  <div id="maintenance-form-wrapper" layout="column" layout-align="center center">\n    <div id="maintenance-form" class="md-whiteframe-8dp">\n      <div>\n        <img src="/api/settings/1/logo_login" alt="logo_login" />\n      </div>\n\n      <br>\n\n      <div>\n        <div class="info-line">\n          <div class="title">Useful pages</div>\n        </div>\n        <section layout="row" flex layout-sm="column" layout-align="center center" layout-wrap>\n          <div layout="column" flex="25" layout-align="center center">\n            <a class="md-fab md-mini md-button grey-bg" href="https://wiki.xcallymotion.com/display/XMV" target="_blank">\n              <md-icon md-font-icon="icon-wikipedia"></md-icon>\n            </a>\n            <div class="info"><a href="https://wiki.xcallymotion.com/display/XMV" target="_blank">Wiki</a></div>\n          </div>\n\n          <div layout="column" flex="25" layout-align="center center">\n            <a class="md-fab md-mini md-button md-accent" href="/apidoc" target="_blank">\n              <md-icon md-font-icon="icon-apple-mobileme"></md-icon>\n            </a>\n            <div class="info"><a href="/apidoc" target="_blank">Motion API</a></div>\n          </div>\n\n          <div layout="column" flex="25" layout-align="center center">\n            <a class="md-fab md-mini md-button orange-bg" href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">\n              <md-icon md-font-icon="icon-headphones"></md-icon>\n            </a>\n            <div class="info"><a href="https://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">Phonebar Download</a></div>\n          </div>\n\n          <div layout="column" flex="25" layout-align="center center">\n            <a class="md-fab md-mini md-button green-bg" href="/demo" target="_blank">\n              <md-icon md-font-icon="icon-console"></md-icon>\n            </a>\n            <div class="info"><a href="/demo" target="_blank">Playground</a></div>\n          </div>\n\n        </section>\n\n        <br>\n\n        <div class="info-line" ng-if="!vm.license.custom">\n          <div class="title">Follow us on</div>\n        </div>\n        <section ng-if="!vm.license.custom" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n          <a class="md-fab md-mini md-button blue-900-bg" href="https://www.facebook.com/xcallymotion" target="_blank">\n            <md-icon md-font-icon="icon-facebook"></md-icon>\n          </a>\n\n          <a class="md-fab md-mini md-button" href="https://twitter.com/xcallymotion" target="_blank">\n            <md-icon md-font-icon="icon-twitter"></md-icon>\n          </a>\n          <a class="md-fab md-mini md-button md-warn" href="https://plus.google.com/+Xcally" target="_blank">\n            <md-icon md-font-icon="icon-google-plus"></md-icon>\n          </a>\n          <a class="md-fab md-mini md-button light-blue-800-bg" href="https://www.linkedin.com/company/xcally" target="_blank">\n            <md-icon md-font-icon="icon-linkedin"></md-icon>\n          </a>\n        </section>\n\n        <br ng-if="!vm.license.custom">\n\n        <div class="info-line" ng-if="!vm.license.custom">\n          <div class="title" translate="HELP.CONTACT_US">Contact Us</div>\n        </div>\n        <div class="info-line" ng-if="!vm.license.custom">\n          <div class="info"><a href="mailto:support@xcally.com" target="_top">support@xcally.com</a></div>\n        </div>\n\n        <br ng-if="!vm.license.custom">\n\n        <div class="info">xCALLY Motion <u>{{vm.info.current}}</u> | <a href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.info.current}}" target="_blank">Changelog</a></div>\n\n        <br>\n\n        <div class="info" ng-if="!vm.license.custom">xCALLY© 2016 - 2018 | Powered by Xenialab | <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></div>\n\n        <br ng-if="!vm.license.custom">\n\n        <div class="info" ng-if="!vm.license.custom"><a href="https://www.xenialab.com/" target="_blank">www.xenialab.com</a> | <a href="https://www.xcallymotion.com/" target="_blank">www.xcallymotion.com</a></div>\n      </div>\n    </div>\n  </div>\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/create/dialog.html",'<md-dialog class="deskAccount-dialog" aria-label="New DeskAccount">\n  <form name="deskAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="deskAccountForm[\'name\'].$error" ng-show="deskAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n          <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n          <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="deskAccountForm[\'type\'].$error" ng-show="deskAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="deskAccountForm[\'remoteUri\'].$error" ng-show="deskAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n        <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n          <md-option ng-value="\'basic\'">Basic</md-option>\n        </md-select>\n        <div ng-messages="deskAccountForm[\'authType\'].$error" ng-show="deskAccountForm[\'authType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n\n        <div ng-messages="deskAccountForm[\'username\'].$error" ng-show="deskAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="deskAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="deskAccountForm[\'serverUrl\'].$error" ng-show="deskAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.deskAccount.description">\n\n        <div ng-messages="deskAccountForm[\'description\'].$error" ng-show="deskAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskAccount" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid || deskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskAccount" ng-click="vm.addNewDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n          ADD DESKACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskAccount" ng-click="vm.deleteDeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/deskAccounts.html",'<div id="deskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.DESKACCOUNTS">DeskAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedDeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedDeskAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-deskAccounts-count">\n          <span>{{vm.selectedDeskAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllDeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectDeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedDeskAccounts" csv-label="true" filename="deskAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- DESKACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedDeskAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDeskAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.deskAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="deskAccount" md-select-id="id" ng-repeat="deskAccount in vm.deskAccounts.rows">\n                <td md-cell ng-if="deskAccount.userpic"><img class="avatar" alt="{{deskAccount.name}}" ng-src="api/users/{{deskAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!deskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{deskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="id ">{{deskAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="name ">{{deskAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="remoteUri ">{{deskAccount.remoteUri}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="username ">{{deskAccount.username}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(deskAccount, $event    )" translate="INTEGRATIONS.EDIT_DESKACCOUNT">\n                          Edit DeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(deskAccount, $event    )" translate="INTEGRATIONS.TEST_DESKACCOUNT">\n                          Test DeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(deskAccount, $event    )" translate="INTEGRATIONS.DELETE_DESKACCOUNT">\n                          Delete DeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.deskAccounts.count}}" md-on-paginate="vm.getDeskAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / DESKACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD DESKACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-deskAccount-button" ng-click="vm.createOrEditDeskAccount($event)" aria-label="add deskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD DESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",'<md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">\n  <form name="deskConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.deskConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="deskConfigurationForm[\'name\'].$error" ng-show="deskConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.deskConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="deskConfigurationForm[\'channel\'].$error" ng-show="deskConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.deskConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="deskConfigurationForm[\'type\'].$error" ng-show="deskConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskConfiguration" ng-click="vm.saveDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskConfiguration" ng-click="vm.addNewDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION">\n          ADD DESKCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskConfiguration" ng-click="vm.deleteDeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",'<md-dialog class="deskAccount-item-dialog" aria-label="New Item">\n  <form name="deskAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="deskAccountItemForm.key.$error" ng-show="deskAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="deskAccountItemForm.keyType.$error" ng-show="deskAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="deskAccountItemForm.keyContent.$error" ng-show="deskAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="deskAccountItemForm.customField.$error" ng-show="deskAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="deskAccountItemForm.content.$error"\n          ng-show="deskAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="deskAccountItemForm.variableName.$error"\n          ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/view.html",'<div id="integrations-deskAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-deskAccounts-button md-icon-button" aria-label="Go to deskAccounts" ng-click="vm.gotoDeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="deskAccount-image" hide-xs>\n          <img ng-src="assets/images/business/deskAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.deskAccount.id}}\n            <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.deskAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveDeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.deskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n                  <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n                <md-select name="authType" ng-model="vm.deskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'basic\'">Basic</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.deskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="DeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.deskAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" class="md-icon-button" aria-label="create deskConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="deskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDeskConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ deskConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)" translate="INTEGRATIONS.DELETE_DESKCONFIGURATION">\n                            Delete DeskConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.TAGS">TAGS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-table-container class="md-whiteframe-1dp padding-20">\n                        <md-input-container class="md-block">\n                          <label translate="INTEGRATIONS.TAGS">Tags</label>\n                          <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n                            <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",'<md-dialog class="dynamics365Account-dialog" aria-label="New Dynamics365Account">\n  <form name="dynamics365AccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus>\n\n        <div ng-messages="dynamics365AccountForm[\'name\'].$error" ng-show="dynamics365AccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.dynamics365Account.modernAuthentication" ng-disabled=" vm.isModernAuthenticationEnabled == true">\n          <span translate="INTEGRATIONS.MODERN_AUTHENTICATION">Modern Authentication</span>\n        </md-switch>\n        \x3c!-- <div class="hint"><span translate="INTEGRATIONS.HELP.MODERN_AUTHENTICATION"></span></div> --\x3e\n      </md-input-container>\n\n      <div ng-if="vm.dynamics365Account.modernAuthentication == false">\n\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.USERNAME">Username</label>\n          <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'username\'].$error" ng-show="dynamics365AccountForm[\'username\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.PASSWORD">Password</label>\n          <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n          <div ng-messages="dynamics365AccountForm[\'password\'].$error" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n            </div>\n            <div ng-message="pattern">\n              <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.URI">Uri</label>\n          <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'remoteUri\'].$error" ng-show="dynamics365AccountForm[\'remoteUri\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n            </div>\n            <div ng-message="url">\n              <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n          <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'tenantId\'].$error" ng-show="dynamics365AccountForm[\'tenantId\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n          <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'clientId\'].$error" ng-show="dynamics365AccountForm[\'clientId\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n          <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="true">\n\n          <div ng-messages="dynamics365AccountForm[\'clientSecret\'].$error" ng-show="dynamics365AccountForm[\'clientSecret\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n          <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" value="LOCALIP" ng-required="true">\n\n          <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n          <div ng-messages="dynamics365AccountForm[\'serverUrl\'].$error" ng-show="dynamics365AccountForm[\'serverUrl\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n            </div>\n            <div ng-message="url">\n              <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n            </div>\n          </div>\n        </md-input-container>\n\n      </div>\n\n      <div ng-if="vm.dynamics365Account.modernAuthentication == true">\n        <md-input-container class="md-block">\n          <label translate="INTEGRATIONS.CLOUD_PROVIDER">Cloud Provider</label>\n          <md-select ng-model="vm.dynamics365Account.CloudProviderId" placeholder="Cloud Provider connection" ng-required="true">\n            <md-option value="{{provider.id}}" ng-repeat="provider in vm.cloudProviders">{{provider.name}}</md-option>\n          </md-select>\n        </md-input-container>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.dynamics365Account.description">\n\n        <div ng-messages="dynamics365AccountForm[\'description\'].$error" ng-show="dynamics365AccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Account" ng-click="vm.saveDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid || dynamics365AccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Account" ng-click="vm.addNewDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n          ADD DYNAMICS365ACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Account" ng-click="vm.deleteDynamics365Account($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",'<div id="dynamics365Accounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.DYNAMICS365ACCOUNTS">Dynamics365Accounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedDynamics365Accounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedDynamics365Accounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-dynamics365Accounts-count">\n          <span>{{vm.selectedDynamics365Accounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllDynamics365Accounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectDynamics365Accounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedDynamics365Accounts" csv-label="true" filename="dynamics365Accounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDynamics365Accounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- DYNAMICS365ACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedDynamics365Accounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDynamics365Accounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="modernAuthentication">{{ \'INTEGRATIONS.MODERN_AUTHENTICATION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.dynamics365Accounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="dynamics365Account" md-select-id="id" ng-repeat="dynamics365Account in vm.dynamics365Accounts.rows">\n                <td md-cell ng-if="dynamics365Account.userpic"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="api/users/{{dynamics365Account.id}}/avatar" /></td>\n                <td md-cell ng-if="!dynamics365Account.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="id ">{{dynamics365Account.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="name ">{{dynamics365Account.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="modernAuthentication ">\n                  <md-icon md-colors="{color: {{dynamics365Account.modernAuthentication ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{dynamics365Account.modernAuthentication ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(dynamics365Account, $event    )" translate="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT">\n                          Edit Dynamics365Account\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(dynamics365Account, $event    )" translate="INTEGRATIONS.TEST_DYNAMICS365ACCOUNT">\n                          Test Dynamics365Account\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n\n                        <md-button ng-click="vm.deleteconfirm(dynamics365Account, $event    )" translate="INTEGRATIONS.DELETE_DYNAMICS365ACCOUNT">\n                          Delete Dynamics365Account\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dynamics365Accounts.count}}" md-on-paginate="vm.getDynamics365Accounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / DYNAMICS365ACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-dynamics365Account-button" ng-click="vm.createOrEditDynamics365Account($event)" aria-label="add dynamics365Account" translate translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",'<md-dialog class="dynamics365Configuration-dialog" aria-label="New Dynamics365Configuration">\n  <form name="dynamics365ConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.dynamics365Configuration.name" ng-required="true" autofocus>\n\n        <div ng-messages="dynamics365ConfigurationForm[\'name\'].$error" ng-show="dynamics365ConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.dynamics365Configuration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dynamics365ConfigurationForm[\'channel\'].$error" ng-show="dynamics365ConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.dynamics365Configuration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dynamics365ConfigurationForm[\'type\'].$error" ng-show="dynamics365ConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n        <md-select name="ticketType" ng-model="vm.dynamics365Configuration.ticketType" required>\n\n          <md-option ng-value="\'incident\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n\n          <md-option ng-value="\'phonecall\'"> {{ \'INTEGRATIONS.PHONECALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dynamics365ConfigurationForm[\'ticketType\'].$error" ng-show="dynamics365ConfigurationForm[\'ticketType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Configuration" ng-click="vm.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid || dynamics365ConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Configuration" ng-click="vm.addNewDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION">\n          ADD DYNAMICS365CONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Configuration" ng-click="vm.deleteDynamics365Configuration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",'<md-dialog class="dynamics365Account-item-dialog" aria-label="New Item">\n  <form name="dynamics365AccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="dynamics365AccountItemForm.key.$error" ng-show="dynamics365AccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="dynamics365AccountItemForm.keyType.$error" ng-show="dynamics365AccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="dynamics365AccountItemForm.keyContent.$error" ng-show="dynamics365AccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="dynamics365AccountItemForm.customField.$error" ng-show="dynamics365AccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="dynamics365AccountItemForm.option.$error" ng-show="dynamics365AccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="dynamics365AccountItemForm.content.$error"\n          ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="dynamics365AccountItemForm.variableName.$error"\n          ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",'<div id="integrations-dynamics365Account" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-dynamics365Accounts-button md-icon-button" aria-label="Go to dynamics365Accounts" ng-click="vm.gotoDynamics365Accounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DYNAMICS365ACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="dynamics365Account-image" hide-xs>\n          <img ng-src="assets/images/business/dynamics365Accounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.dynamics365Account.id}}\n            <span ng-if="vm.dynamics365Account.name">{{vm.dynamics365Account.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.dynamics365Account.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveDynamics365Account()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="dynamics365Account-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.dynamics365Account.modernAuthentication" ng-disabled="vm.isModernAuthenticationEnabled == true">\n                  <span translate="INTEGRATIONS.MODERN_AUTHENTICATION">Modern Authentication</span>\n                </md-switch>\n                \x3c!-- <div class="hint"><span translate="INTEGRATIONS.HELP.MODERN_AUTHENTICATION"></span></div> --\x3e\n              </md-input-container>\n\n              <div ng-if="vm.dynamics365Account.modernAuthentication == true">\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.CLOUD_PROVIDER">Cloud Provider</label>\n                  <md-select ng-model="vm.dynamics365Account.CloudProviderId" placeholder="Cloud Provider connection" ng-required="true">\n                    <md-option value="{{provider.id}}" ng-repeat="provider in vm.cloudProviders.rows">{{provider.name}}</md-option>\n                  </md-select>\n                </md-input-container>\n              </div>\n\n              <div ng-if="vm.dynamics365Account.modernAuthentication == false">\n\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.USERNAME">Username</label>\n                  \x3c!-- <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit"> --\x3e\n                  <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n                  <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                    </div>\n                  </div>\n                </md-input-container>\n\n\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                  <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" ng-required="vm.dynamics365Account.modernAuthentication == false">\n                  <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                    </div>\n                    <div ng-message="pattern">\n                      <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                    </div>\n                  </div>\n                </md-input-container>\n\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.URI">Uri</label>\n                  <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                    </div>\n                    <div ng-message="url">\n                      <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n                  <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div ng-messages="generalForm[\'tenantId\'].$error" ng-show="generalForm[\'tenantId\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n                  <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n                  <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n                    </div>\n                  </div>\n                </md-input-container>\n                <md-input-container class="md-block">\n                  <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                  <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" value="LOCALIP" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                  <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                    <div ng-message="required">\n                      <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                    </div>\n                    <div ng-message="url">\n                      <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                    </div>\n                  </div>\n                </md-input-container>\n\n              </div>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.dynamics365Account.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="dynamics365Account-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="Dynamics365AccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.dynamics365Account, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" class="md-icon-button" aria-label="create dynamics365Configuration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="dynamics365Configuration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDynamics365Configuration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDynamics365Configuration($index)">\n                    <span class="text-truncate" flex="80">{{ dynamics365Configuration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteDynamics365Configuration($event, dynamics365Configuration)" translate="INTEGRATIONS.DELETE_DYNAMICS365CONFIGURATION">\n                            Delete Dynamics365Configuration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.ADVANCED">ADVANCED</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <div class="dynamics365Account-detail-form-container general md-background-bg">\n                        <div class="pb-16" layout="row" layout-align="start center">\n                          <div class="h2 secondary-text" translate="INTEGRATIONS.ADVANCED">ADVANCED</div>\n                        </div>\n                        <form name="vm_cc.advancedForm" novalidate>\n                          <md-input-container class="md-block">\n                            <label translate="INTEGRATIONS.MODULECREATE">Module Create</label>\n                            <md-select name="type" ng-model="vm_cc.dynamics365Configuration.moduleCreate" required>\n                              <md-option ng-value="\'contact\'">{{\'INTEGRATIONS.DYNAMIC365CONTACT\' | translate}}</md-option>\n                              <md-option ng-value="\'nothing\'">{{\'INTEGRATIONS.DYNAMIC365NOTHING\' | translate}}</md-option>\n                            </md-select>\n                            <div ng-messages="vm_cc.advancedForm[\'moduleCreate\'].$error" ng-show="vm_cc.advancedForm[\'moduleCreate\'].$touched" role="alert">\n                              <div ng-message="required">\n                                <span translate="INTEGRATIONS.ERRORS.MODULECREATE_REQUIRED">Type field is required</span>\n                              </div>\n                            </div>\n                          </md-input-container>\n                          <div layout="row" layout-align="end center">\n                            <md-button type="submit" ng-click="vm_cc.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="vm_cc.advancedForm.$invalid || vm_cc.advancedForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n                              SAVE\n                            </md-button>\n                          </div>\n                        </form>\n                      </div>\n                    </md-tab-body>\n                  </md-tab>\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n          </div>\n\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",'<md-dialog class="freshdeskAccount-dialog" aria-label="New FreshdeskAccount">\n  <form name="freshdeskAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="freshdeskAccountForm[\'name\'].$error" ng-show="freshdeskAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n\n        <div ng-messages="freshdeskAccountForm[\'username\'].$error" ng-show="freshdeskAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="freshdeskAccountForm[\'remoteUri\'].$error" ng-show="freshdeskAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n        <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n\n        <div ng-messages="freshdeskAccountForm[\'apiKey\'].$error" ng-show="freshdeskAccountForm[\'apiKey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="freshdeskAccountForm[\'serverUrl\'].$error" ng-show="freshdeskAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n\n        <div ng-messages="freshdeskAccountForm[\'description\'].$error" ng-show="freshdeskAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskAccount" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid || freshdeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskAccount" ng-click="vm.addNewFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n          ADD FRESHDESKACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskAccount" ng-click="vm.deleteFreshdeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",'<md-dialog class="freshdeskConfiguration-dialog" aria-label="New FreshdeskConfiguration">\n  <form name="freshdeskConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.freshdeskConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="freshdeskConfigurationForm[\'name\'].$error" ng-show="freshdeskConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.freshdeskConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="freshdeskConfigurationForm[\'channel\'].$error" ng-show="freshdeskConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.freshdeskConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="freshdeskConfigurationForm[\'type\'].$error" ng-show="freshdeskConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskConfiguration" ng-click="vm.saveFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid || freshdeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskConfiguration" ng-click="vm.addNewFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION">\n          ADD FRESHDESKCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskConfiguration" ng-click="vm.deleteFreshdeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",'<md-dialog class="freshdeskAccount-item-dialog" aria-label="New Item">\n  <form name="freshdeskAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="freshdeskAccountItemForm.key.$error" ng-show="freshdeskAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="freshdeskAccountItemForm.keyType.$error" ng-show="freshdeskAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="freshdeskAccountItemForm.keyContent.$error" ng-show="freshdeskAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="freshdeskAccountItemForm.customField.$error" ng-show="freshdeskAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="freshdeskAccountItemForm.content.$error"\n          ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="freshdeskAccountItemForm.variableName.$error"\n          ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",'<div id="integrations-freshdeskAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-freshdeskAccounts-button md-icon-button" aria-label="Go to freshdeskAccounts" ng-click="vm.gotoFreshdeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHDESKACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="freshdeskAccount-image" hide-xs>\n          <img ng-src="assets/images/business/freshdeskAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.freshdeskAccount.id}}\n            <span ng-if="vm.freshdeskAccount.name">{{vm.freshdeskAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshdeskAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveFreshdeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="freshdeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n                <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.freshdeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="freshdeskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="FreshdeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshdeskAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" class="md-icon-button" aria-label="create freshdeskConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="freshdeskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshdeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshdeskConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ freshdeskConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteFreshdeskConfiguration($event, freshdeskConfiguration)" translate="INTEGRATIONS.DELETE_FRESHDESKCONFIGURATION">\n                            Delete FreshdeskConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.TAGS">TAGS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-table-container class="md-whiteframe-1dp padding-20">\n                        <md-input-container class="md-block">\n                          <label translate="INTEGRATIONS.TAGS">Tags</label>\n                          <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n                            <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",'<div id="freshdeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.FRESHDESKACCOUNTS">FreshdeskAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedFreshdeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedFreshdeskAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-freshdeskAccounts-count">\n          <span>{{vm.selectedFreshdeskAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedFreshdeskAccounts" csv-label="true" filename="freshdeskAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshdeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- FRESHDESKACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedFreshdeskAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshdeskAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.freshdeskAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="freshdeskAccount" md-select-id="id" ng-repeat="freshdeskAccount in vm.freshdeskAccounts.rows">\n                <td md-cell ng-if="freshdeskAccount.userpic"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="api/users/{{freshdeskAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!freshdeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="id ">{{freshdeskAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="name ">{{freshdeskAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="username ">{{freshdeskAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="remoteUri ">{{freshdeskAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(freshdeskAccount, $event    )" translate="INTEGRATIONS.EDIT_FRESHDESKACCOUNT">\n                          Edit FreshdeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(freshdeskAccount, $event    )" translate="INTEGRATIONS.TEST_FRESHDESKACCOUNT">\n                          Test FreshdeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(freshdeskAccount, $event    )" translate="INTEGRATIONS.DELETE_FRESHDESKACCOUNT">\n                          Delete FreshdeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshdeskAccounts.count}}" md-on-paginate="vm.getFreshdeskAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / FRESHDESKACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD FRESHDESKACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshdeskAccount-button" ng-click="vm.createOrEditFreshdeskAccount($event)" aria-label="add freshdeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD FRESHDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/create/dialog.html",'<md-dialog class="freshsalesAccount-dialog" aria-label="New FreshsalesAccount">\n  <form name="freshsalesAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.freshsalesAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="freshsalesAccountForm[\'name\'].$error" ng-show="freshsalesAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.freshsalesAccount.username" ng-required="true">\n\n        <div ng-messages="freshsalesAccountForm[\'username\'].$error" ng-show="freshsalesAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.freshsalesAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="freshsalesAccountForm[\'remoteUri\'].$error" ng-show="freshsalesAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n        <input type="text" name="apiKey" ng-model="vm.freshsalesAccount.apiKey" ng-required="true">\n\n        <div ng-messages="freshsalesAccountForm[\'apiKey\'].$error" ng-show="freshsalesAccountForm[\'apiKey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.freshsalesAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="freshsalesAccountForm[\'serverUrl\'].$error" ng-show="freshsalesAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.freshsalesAccount.description">\n\n        <div ng-messages="freshsalesAccountForm[\'description\'].$error" ng-show="freshsalesAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesAccount" ng-click="vm.saveFreshsalesAccount()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountForm.$invalid || freshsalesAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesAccount" ng-click="vm.addNewFreshsalesAccount()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHSALESACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT">\n          ADD FRESHSALESACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesAccount" ng-click="vm.deleteFreshsalesAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/configurations/dialog.html",'<md-dialog class="freshsalesConfiguration-dialog" aria-label="New FreshsalesConfiguration">\n  <form name="freshsalesConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.freshsalesConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="freshsalesConfigurationForm[\'name\'].$error" ng-show="freshsalesConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.freshsalesConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="freshsalesConfigurationForm[\'channel\'].$error" ng-show="freshsalesConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.freshsalesConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="freshsalesConfigurationForm[\'type\'].$error" ng-show="freshsalesConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesConfiguration" ng-click="vm.saveFreshsalesConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshsalesConfigurationForm.$invalid || freshsalesConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesConfiguration" ng-click="vm.addNewFreshsalesConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshsalesConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHSALESCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESCONFIGURATION">\n          ADD FRESHSALESCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesConfiguration" ng-click="vm.deleteFreshsalesConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",'<md-dialog class="freshsalesAccount-item-dialog" aria-label="New Item">\n  <form name="freshsalesAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="freshsalesAccountItemForm.content.$error" ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="freshsalesAccountItemForm.key.$error" ng-show="freshsalesAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="freshsalesAccountItemForm.keyType.$error" ng-show="freshsalesAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="freshsalesAccountItemForm.keyContent.$error" ng-show="freshsalesAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="freshsalesAccountItemForm.variableName.$error" ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="freshsalesAccountItemForm.customField.$error" ng-show="freshsalesAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountItemForm.$invalid || freshsalesAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountItemForm.$invalid || freshsalesAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="freshsalesAccountItemForm.option.$error" ng-show="freshsalesAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="freshsalesAccountItemForm.content.$error" ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="freshsalesAccountItemForm.variableName.$error" ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="freshsalesAccountItemForm.content.$error"\n          ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="freshsalesAccountItemForm.variableName.$error"\n          ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/view.html",'<div id="integrations-freshsalesAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-freshsalesAccounts-button md-icon-button" aria-label="Go to freshsalesAccounts" ng-click="vm.gotoFreshsalesAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHSALESACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="freshsalesAccount-image" hide-xs>\n          <img ng-src="assets/images/business/freshsalesAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.freshsalesAccount.id}}\n            <span ng-if="vm.freshsalesAccount.name">{{vm.freshsalesAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshsalesAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveFreshsalesAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="freshsalesAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.freshsalesAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.freshsalesAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.freshsalesAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n                <input type="text" name="apiKey" ng-model="vm.freshsalesAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.freshsalesAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.freshsalesAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="freshsalesAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="FreshsalesAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshsalesAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)" class="md-icon-button" aria-label="create freshsalesConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="freshsalesConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshsalesConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshsalesConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ freshsalesConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteFreshsalesConfiguration($event, freshsalesConfiguration)" translate="INTEGRATIONS.DELETE_FRESHSALESCONFIGURATION">\n                            Delete FreshsalesConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/freshsalesAccounts.html",'<div id="freshsalesAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.FRESHSALESACCOUNTS">FreshsalesAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedFreshsalesAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedFreshsalesAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-freshsalesAccounts-count">\n          <span>{{vm.selectedFreshsalesAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllFreshsalesAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectFreshsalesAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedFreshsalesAccounts" csv-label="true" filename="freshsalesAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshsalesAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- FRESHSALESACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedFreshsalesAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshsalesAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.freshsalesAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="freshsalesAccount" md-select-id="id" ng-repeat="freshsalesAccount in vm.freshsalesAccounts.rows">\n                <td md-cell ng-if="freshsalesAccount.userpic"><img class="avatar" alt="{{freshsalesAccount.name}}" ng-src="api/users/{{freshsalesAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!freshsalesAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshsalesAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="id ">{{freshsalesAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="name ">{{freshsalesAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="username ">{{freshsalesAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="remoteUri ">{{freshsalesAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(freshsalesAccount, $event    )" translate="INTEGRATIONS.EDIT_FRESHSALESACCOUNT">\n                          Edit FreshsalesAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(freshsalesAccount, $event    )" translate="INTEGRATIONS.TEST_FRESHSALESACCOUNT">\n                          Test FreshsalesAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(freshsalesAccount, $event    )" translate="INTEGRATIONS.DELETE_FRESHSALESACCOUNT">\n                          Delete FreshsalesAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshsalesAccounts.count}}" md-on-paginate="vm.getFreshsalesAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / FRESHSALESACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD FRESHSALESACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshsalesAccount-button" ng-click="vm.createOrEditFreshsalesAccount($event)" aria-label="add freshsalesAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD FRESHSALESACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",'<md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">\n  <form name="salesforceAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="salesforceAccountForm[\'name\'].$error" ng-show="salesforceAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n          <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n          <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="salesforceAccountForm[\'type\'].$error" ng-show="salesforceAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'username\'].$error" ng-show="salesforceAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'remoteUri\'].$error" ng-show="salesforceAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="salesforceAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n        <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'clientId\'].$error" ng-show="salesforceAccountForm[\'clientId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n        <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'clientSecret\'].$error" ng-show="salesforceAccountForm[\'clientSecret\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n        <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n\n        <div ng-messages="salesforceAccountForm[\'securityToken\'].$error" ng-show="salesforceAccountForm[\'securityToken\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="salesforceAccountForm[\'serverUrl\'].$error" ng-show="salesforceAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n\n        <div ng-messages="salesforceAccountForm[\'description\'].$error" ng-show="salesforceAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceAccount" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceAccount" ng-click="vm.addNewSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n          ADD SALESFORCEACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceAccount" ng-click="vm.deleteSalesforceAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",'<md-dialog class="salesforceConfiguration-dialog" aria-label="New SalesforceConfiguration">\n  <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.salesforceConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="salesforceConfigurationForm[\'name\'].$error" ng-show="salesforceConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.salesforceConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="salesforceConfigurationForm[\'channel\'].$error" ng-show="salesforceConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.salesforceConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="salesforceConfigurationForm[\'type\'].$error" ng-show="salesforceConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n        <md-select name="ticketType" ng-model="vm.salesforceConfiguration.ticketType" required>\n\n          <md-option ng-value="\'Task\'"> {{ \'INTEGRATIONS.TASK\' | translate }} </md-option>\n\n          <md-option ng-value="\'Case\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="salesforceConfigurationForm[\'ticketType\'].$error" ng-show="salesforceConfigurationForm[\'ticketType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceConfiguration" ng-click="vm.saveSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceConfiguration" ng-click="vm.addNewSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION">\n          ADD SALESFORCECONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceConfiguration" ng-click="vm.deleteSalesforceConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",'<md-dialog class="salesforceAccount-item-dialog" aria-label="New Item">\n  <form name="salesforceAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="salesforceAccountItemForm.key.$error" ng-show="salesforceAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="salesforceAccountItemForm.keyType.$error" ng-show="salesforceAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="salesforceAccountItemForm.keyContent.$error" ng-show="salesforceAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="salesforceAccountItemForm.customField.$error" ng-show="salesforceAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="salesforceAccountItemForm.content.$error"\n          ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="salesforceAccountItemForm.variableName.$error"\n          ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/view.html",'<div id="integrations-salesforceAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-salesforceAccounts-button md-icon-button" aria-label="Go to salesforceAccounts" ng-click="vm.gotoSalesforceAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SALESFORCEACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="salesforceAccount-image" hide-xs>\n          <img ng-src="assets/images/business/salesforceAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.salesforceAccount.id}}\n            <span ng-if="vm.salesforceAccount.name">{{vm.salesforceAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.salesforceAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveSalesforceAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="salesforceAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.salesforceAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n                  <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n                <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n                <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n                <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'securityToken\'].$error" ng-show="generalForm[\'securityToken\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.salesforceAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="salesforceAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="SalesforceAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.salesforceAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" class="md-icon-button" aria-label="create salesforceConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="salesforceConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSalesforceConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSalesforceConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ salesforceConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteSalesforceConfiguration($event, salesforceConfiguration)" translate="INTEGRATIONS.DELETE_SALESFORCECONFIGURATION">\n                            Delete SalesforceConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.ADVANCED">\n                        ADVANCED\n                      </span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <div layout-margin>\n                        <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n                        <md-select ng-model="vm_cc.salesforceConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n                          <md-option ng-value="option.key" ng-repeat="option in [{key: \'account_contact_lead\', value: \'Account & Contact & Lead\'}, {key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}, {key: \'account\', value: \'Account\'}]">\n                            {{ option.value }}</md-option>\n                        </md-select>\n                      </div>\n                      <div layout-margin>\n                        <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n                        <md-select ng-model="vm_cc.salesforceConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n                          <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}, {key: \'account\', value: \'Account\'}]">\n                            {{ option.value }}</md-option>\n                        </md-select>\n                      </div>\n\n                      <div layout-margin ng-if="vm_cc.salesforceConfiguration.isLead">\n                        <label translate="INTEGRATIONS.LEADID"></label>\n                        <md-input-container class="md-block">\n                          <input ng-model="vm_cc.salesforceConfiguration.leadId" type="text">\n                        </md-input-container>\n                        <div class="hint"><span translate="INTEGRATIONS.HELP.LEADID"></span></div>\n                      </div>\n\n                      <div layout-margin ng-if="vm_cc.salesforceConfiguration.isAccountSearch">\n                        <label translate="INTEGRATIONS.ADDITIONALSEARCHACCOUNT"></label>\n                        <md-input-container class="md-block">\n                          <input ng-model="vm_cc.salesforceConfiguration.additionalSearchAccount" type="text">\n                        </md-input-container>\n                        <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHACCOUNT"></span></div>\n                      </div>\n\n                      <div layout-margin ng-if="vm_cc.salesforceConfiguration.isContactSearch">\n                        <label translate="INTEGRATIONS.ADDITIONALSEARCHCONTACT"></label>\n                        <md-input-container class="md-block">\n                          <input ng-model="vm_cc.salesforceConfiguration.additionalSearchContact" type="text">\n                        </md-input-container>\n                        <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHCONTACT"></span></div>\n                      </div>\n\n                      <div layout-margin ng-if="vm_cc.salesforceConfiguration.isLeadSearch">\n                        <label translate="INTEGRATIONS.ADDITIONALSEARCHLEAD"></label>\n                        <md-input-container class="md-block">\n                          <input ng-model="vm_cc.salesforceConfiguration.additionalSearchLead" type="text">\n                        </md-input-container>\n                        <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHLEAD"></span></div>\n                      </div>\n\n                      <md-button type="submit" ng-click="vm_cc.saveSalesforceConfiguration()" ng-disabled="!vm_cc.crudPermissions.canEdit" class="send-button md-accent md-raised" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n                        SAVE\n                      </md-button>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",'<div id="salesforceAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.SALESFORCEACCOUNTS">SalesforceAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSalesforceAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSalesforceAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-salesforceAccounts-count">\n          <span>{{vm.selectedSalesforceAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSalesforceAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSalesforceAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSalesforceAccounts" csv-label="true" filename="salesforceAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSalesforceAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SALESFORCEACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSalesforceAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSalesforceAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.salesforceAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="salesforceAccount" md-select-id="id" ng-repeat="salesforceAccount in vm.salesforceAccounts.rows">\n                <td md-cell ng-if="salesforceAccount.userpic"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="api/users/{{salesforceAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!salesforceAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="id ">{{salesforceAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="name ">{{salesforceAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="username ">{{salesforceAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="remoteUri ">{{salesforceAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(salesforceAccount, $event    )" translate="INTEGRATIONS.EDIT_SALESFORCEACCOUNT">\n                          Edit SalesforceAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(salesforceAccount, $event    )" translate="INTEGRATIONS.TEST_SALESFORCEACCOUNT">\n                          Test SalesforceAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(salesforceAccount, $event    )" translate="INTEGRATIONS.DELETE_SALESFORCEACCOUNT">\n                          Delete SalesforceAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.salesforceAccounts.count}}" md-on-paginate="vm.getSalesforceAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SALESFORCEACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SALESFORCEACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-salesforceAccount-button" ng-click="vm.createOrEditSalesforceAccount($event)" aria-label="add salesforceAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SALESFORCEACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",'<md-dialog class="servicenowAccount-dialog" aria-label="New ServicenowAccount">\n  <form name="servicenowAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="servicenowAccountForm[\'name\'].$error" ng-show="servicenowAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true">\n\n        <div ng-messages="servicenowAccountForm[\'username\'].$error" ng-show="servicenowAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="servicenowAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true">\n\n        <div ng-messages="servicenowAccountForm[\'email\'].$error" ng-show="servicenowAccountForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.HOST">Host</label>\n        <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="servicenowAccountForm[\'remoteUri\'].$error" ng-show="servicenowAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="servicenowAccountForm[\'serverUrl\'].$error" ng-show="servicenowAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.servicenowAccount.description">\n\n        <div ng-messages="servicenowAccountForm[\'description\'].$error" ng-show="servicenowAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowAccount" ng-click="vm.saveServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid || servicenowAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowAccount" ng-click="vm.addNewServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n          ADD SERVICENOWACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowAccount" ng-click="vm.deleteServicenowAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",'<md-dialog class="servicenowConfiguration-dialog" aria-label="New ServicenowConfiguration">\n  <form name="servicenowConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.servicenowConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="servicenowConfigurationForm[\'name\'].$error" ng-show="servicenowConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.servicenowConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="servicenowConfigurationForm[\'channel\'].$error" ng-show="servicenowConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.servicenowConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="servicenowConfigurationForm[\'type\'].$error" ng-show="servicenowConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowConfiguration" ng-click="vm.saveServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid || servicenowConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowConfiguration" ng-click="vm.addNewServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION">\n          ADD SERVICENOWCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowConfiguration" ng-click="vm.deleteServicenowConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",'<md-dialog class="servicenowAccount-item-dialog" aria-label="New Item">\n  <form name="servicenowAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="servicenowAccountItemForm.key.$error" ng-show="servicenowAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="servicenowAccountItemForm.keyType.$error" ng-show="servicenowAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="servicenowAccountItemForm.keyContent.$error" ng-show="servicenowAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="servicenowAccountItemForm.customField.$error" ng-show="servicenowAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="servicenowAccountItemForm.option.$error" ng-show="servicenowAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="servicenowAccountItemForm.content.$error"\n          ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="servicenowAccountItemForm.variableName.$error"\n          ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/view.html",'<div id="integrations-servicenowAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-servicenowAccounts-button md-icon-button" aria-label="Go to servicenowAccounts" ng-click="vm.gotoServicenowAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SERVICENOWACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="servicenowAccount-image" hide-xs>\n          <img ng-src="assets/images/business/servicenowAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.servicenowAccount.id}}\n            <span ng-if="vm.servicenowAccount.name">{{vm.servicenowAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.servicenowAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveServicenowAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="servicenowAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.HOST">Host</label>\n                <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.servicenowAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="servicenowAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="ServicenowAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.servicenowAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" class="md-icon-button" aria-label="create servicenowConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="servicenowConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedServicenowConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getServicenowConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ servicenowConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteServicenowConfiguration($event, servicenowConfiguration)" translate="INTEGRATIONS.DELETE_SERVICENOWCONFIGURATION">\n                            Delete ServicenowConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",'<div id="servicenowAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.SERVICENOWACCOUNTS">ServicenowAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedServicenowAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedServicenowAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-servicenowAccounts-count">\n          <span>{{vm.selectedServicenowAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllServicenowAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectServicenowAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedServicenowAccounts" csv-label="true" filename="servicenowAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedServicenowAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SERVICENOWACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedServicenowAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getServicenowAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'INTEGRATIONS.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.servicenowAccounts.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="servicenowAccount" md-select-id="id" ng-repeat="servicenowAccount in vm.servicenowAccounts.rows">\n                <td md-cell ng-if="servicenowAccount.userpic"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="api/users/{{servicenowAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!servicenowAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="id ">{{servicenowAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="name ">{{servicenowAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="username ">{{servicenowAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="email ">{{servicenowAccount.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="remoteUri ">{{servicenowAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(servicenowAccount, $event    )" translate="INTEGRATIONS.EDIT_SERVICENOWACCOUNT">\n                          Edit ServicenowAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(servicenowAccount, $event    )" translate="INTEGRATIONS.TEST_SERVICENOWACCOUNT">\n                          Test ServicenowAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n\n                        <md-button ng-click="vm.deleteconfirm(servicenowAccount, $event    )" translate="INTEGRATIONS.DELETE_SERVICENOWACCOUNT">\n                          Delete ServicenowAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.servicenowAccounts.count}}" md-on-paginate="vm.getServicenowAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SERVICENOWACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SERVICENOWACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-servicenowAccount-button" ng-click="vm.createOrEditServicenowAccount($event)" aria-label="add servicenowAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SERVICENOWACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",'<md-dialog class="sugarcrmAccount-dialog" aria-label="New SugarcrmAccount">\n  <form name="sugarcrmAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="sugarcrmAccountForm[\'name\'].$error" ng-show="sugarcrmAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n\n        <div ng-messages="sugarcrmAccountForm[\'username\'].$error" ng-show="sugarcrmAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="sugarcrmAccountForm[\'remoteUri\'].$error" ng-show="sugarcrmAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="sugarcrmAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="sugarcrmAccountForm[\'serverUrl\'].$error" ng-show="sugarcrmAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n\n        <div ng-messages="sugarcrmAccountForm[\'description\'].$error" ng-show="sugarcrmAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmAccount" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid || sugarcrmAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmAccount" ng-click="vm.addNewSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n          ADD SUGARCRMACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmAccount" ng-click="vm.deleteSugarcrmAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",'<md-dialog class="sugarcrmConfiguration-dialog" aria-label="New SugarcrmConfiguration">\n  <form name="sugarcrmConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.sugarcrmConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="sugarcrmConfigurationForm[\'name\'].$error" ng-show="sugarcrmConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.sugarcrmConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="sugarcrmConfigurationForm[\'channel\'].$error" ng-show="sugarcrmConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.sugarcrmConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="sugarcrmConfigurationForm[\'type\'].$error" ng-show="sugarcrmConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmConfiguration" ng-click="vm.saveSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid || sugarcrmConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmConfiguration" ng-click="vm.addNewSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION">\n          ADD SUGARCRMCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmConfiguration" ng-click="vm.deleteSugarcrmConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",'<md-dialog class="sugarcrmAccount-item-dialog" aria-label="New Item">\n  <form name="sugarcrmAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="sugarcrmAccountItemForm.key.$error" ng-show="sugarcrmAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="sugarcrmAccountItemForm.keyType.$error" ng-show="sugarcrmAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="sugarcrmAccountItemForm.keyContent.$error" ng-show="sugarcrmAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="sugarcrmAccountItemForm.customField.$error" ng-show="sugarcrmAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="sugarcrmAccountItemForm.content.$error"\n          ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="sugarcrmAccountItemForm.variableName.$error"\n          ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",'<div id="integrations-sugarcrmAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-sugarcrmAccounts-button md-icon-button" aria-label="Go to sugarcrmAccounts" ng-click="vm.gotoSugarcrmAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SUGARCRMACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="sugarcrmAccount-image" hide-xs>\n          <img ng-src="assets/images/business/sugarcrmAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.sugarcrmAccount.id}}\n            <span ng-if="vm.sugarcrmAccount.name">{{vm.sugarcrmAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.sugarcrmAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveSugarcrmAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="sugarcrmAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.sugarcrmAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="sugarcrmAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="SugarcrmAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.sugarcrmAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" class="md-icon-button" aria-label="create sugarcrmConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="sugarcrmConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSugarcrmConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSugarcrmConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ sugarcrmConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteSugarcrmConfiguration($event, sugarcrmConfiguration)" translate="INTEGRATIONS.DELETE_SUGARCRMCONFIGURATION">\n                            Delete SugarcrmConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",'<div id="sugarcrmAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.SUGARCRMACCOUNTS">SugarcrmAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSugarcrmAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSugarcrmAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-sugarcrmAccounts-count">\n          <span>{{vm.selectedSugarcrmAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSugarcrmAccounts" csv-label="true" filename="sugarcrmAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSugarcrmAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SUGARCRMACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSugarcrmAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSugarcrmAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.sugarcrmAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="sugarcrmAccount" md-select-id="id" ng-repeat="sugarcrmAccount in vm.sugarcrmAccounts.rows">\n                <td md-cell ng-if="sugarcrmAccount.userpic"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="api/users/{{sugarcrmAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!sugarcrmAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="id ">{{sugarcrmAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="name ">{{sugarcrmAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="username ">{{sugarcrmAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="remoteUri ">{{sugarcrmAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(sugarcrmAccount, $event    )" translate="INTEGRATIONS.EDIT_SUGARCRMACCOUNT">\n                          Edit SugarcrmAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(sugarcrmAccount, $event    )" translate="INTEGRATIONS.TEST_SUGARCRMACCOUNT">\n                          Test SugarcrmAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.deleteconfirm(sugarcrmAccount, $event    )" translate="INTEGRATIONS.DELETE_SUGARCRMACCOUNT">\n                          Delete SugarcrmAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sugarcrmAccounts.count}}" md-on-paginate="vm.getSugarcrmAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SUGARCRMACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SUGARCRMACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-sugarcrmAccount-button" ng-click="vm.createOrEditSugarcrmAccount($event)" aria-label="add sugarcrmAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SUGARCRMACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",'<md-dialog class="vtigerAccount-dialog" aria-label="New VtigerAccount">\n  <form name="vtigerAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="vtigerAccountForm[\'name\'].$error" ng-show="vtigerAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.vtigerAccount.description">\n\n        <div ng-messages="vtigerAccountForm[\'description\'].$error" ng-show="vtigerAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n        <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true">\n\n        <div ng-messages="vtigerAccountForm[\'username\'].$error" ng-show="vtigerAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n        <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true">\n\n        <div ng-messages="vtigerAccountForm[\'accessKey\'].$error" ng-show="vtigerAccountForm[\'accessKey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.HOST">Host</label>\n        <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="vtigerAccountForm[\'remoteUri\'].$error" ng-show="vtigerAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="vtigerAccountForm[\'serverUrl\'].$error" ng-show="vtigerAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerAccount" ng-click="vm.saveVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid || vtigerAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerAccount" ng-click="vm.addNewVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n          ADD VTIGERACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerAccount" ng-click="vm.deleteVtigerAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",'<md-dialog class="vtigerConfiguration-dialog" aria-label="New VtigerConfiguration">\n  <form name="vtigerConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.vtigerConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="vtigerConfigurationForm[\'name\'].$error" ng-show="vtigerConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.vtigerConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="vtigerConfigurationForm[\'channel\'].$error" ng-show="vtigerConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.vtigerConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="vtigerConfigurationForm[\'type\'].$error" ng-show="vtigerConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerConfiguration" ng-click="vm.saveVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid || vtigerConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerConfiguration" ng-click="vm.addNewVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERCONFIGURATION">\n          ADD VTIGERCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerConfiguration" ng-click="vm.deleteVtigerConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",'<md-dialog class="vtigerAccount-item-dialog" aria-label="New Item">\n  <form name="vtigerAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="vtigerAccountItemForm.key.$error" ng-show="vtigerAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="vtigerAccountItemForm.keyType.$error" ng-show="vtigerAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="vtigerAccountItemForm.keyContent.$error" ng-show="vtigerAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="vtigerAccountItemForm.customField.$error" ng-show="vtigerAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="vtigerAccountItemForm.option.$error" ng-show="vtigerAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="vtigerAccountItemForm.content.$error"\n          ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="vtigerAccountItemForm.variableName.$error"\n          ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/view.html",'<div id="integrations-vtigerAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-vtigerAccounts-button md-icon-button" aria-label="Go to vtigerAccounts" ng-click="vm.gotoVtigerAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_VTIGERACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="vtigerAccount-image" hide-xs>\n          <img ng-src="assets/images/business/vtigerAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.vtigerAccount.id}}\n            <span ng-if="vm.vtigerAccount.name">{{vm.vtigerAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.vtigerAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveVtigerAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="vtigerAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.vtigerAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n                <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n                <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'accessKey\'].$error" ng-show="generalForm[\'accessKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.HOST">Host</label>\n                <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="vtigerAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="VtigerAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.vtigerAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" class="md-icon-button" aria-label="create vtigerConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="vtigerConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedVtigerConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getVtigerConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ vtigerConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteVtigerConfiguration($event, vtigerConfiguration)" translate="INTEGRATIONS.DELETE_VTIGERCONFIGURATION">\n                            Delete VtigerConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",'<div id="vtigerAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.VTIGERACCOUNTS">VtigerAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVtigerAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVtigerAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-vtigerAccounts-count">\n          <span>{{vm.selectedVtigerAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVtigerAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVtigerAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVtigerAccounts" csv-label="true" filename="vtigerAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVtigerAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VTIGERACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVtigerAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVtigerAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.VTIGER_USER_NAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.vtigerAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="vtigerAccount" md-select-id="id" ng-repeat="vtigerAccount in vm.vtigerAccounts.rows">\n                <td md-cell ng-if="vtigerAccount.userpic"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="api/users/{{vtigerAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!vtigerAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="id ">{{vtigerAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="name ">{{vtigerAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="username ">{{vtigerAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="remoteUri ">{{vtigerAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(vtigerAccount, $event    )" translate="INTEGRATIONS.EDIT_VTIGERACCOUNT">\n                          Edit VtigerAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(vtigerAccount, $event    )" translate="INTEGRATIONS.TEST_VTIGERACCOUNT">\n                          Test VtigerAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(vtigerAccount, $event    )" translate="INTEGRATIONS.DELETE_VTIGERACCOUNT">\n                          Delete VtigerAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.vtigerAccounts.count}}" md-on-paginate="vm.getVtigerAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VTIGERACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VTIGERACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-vtigerAccount-button" ng-click="vm.createOrEditVtigerAccount($event)" aria-label="add vtigerAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VTIGERACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",'<md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">\n  <form name="zendeskAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="zendeskAccountForm[\'name\'].$error" ng-show="zendeskAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n          <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n          <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zendeskAccountForm[\'type\'].$error" ng-show="zendeskAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n\n        <div ng-messages="zendeskAccountForm[\'username\'].$error" ng-show="zendeskAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.URI">Uri</label>\n        <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n\n        <div ng-messages="zendeskAccountForm[\'remoteUri\'].$error" ng-show="zendeskAccountForm[\'remoteUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n        <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n          <md-option ng-value="\'password\'">Password</md-option>\n          <md-option ng-value="\'token\'">Token</md-option>\n        </md-select>\n        <div ng-messages="zendeskAccountForm[\'authType\'].$error" ng-show="zendeskAccountForm[\'authType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n        <label translate="INTEGRATIONS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n        <div ng-messages="zendeskAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n        <label translate="INTEGRATIONS.TOKEN">Token</label>\n        <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n\n        <div ng-messages="zendeskAccountForm[\'token\'].$error" ng-show="zendeskAccountForm[\'token\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="zendeskAccountForm[\'serverUrl\'].$error" ng-show="zendeskAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n\n        <div ng-messages="zendeskAccountForm[\'description\'].$error" ng-show="zendeskAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskAccount" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskAccount" ng-click="vm.addNewZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n          ADD ZENDESKACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskAccount" ng-click="vm.deleteZendeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",'<md-dialog class="zendeskAccount-item-dialog" aria-label="New Item">\n  <form name="zendeskAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="zendeskAccountItemForm.key.$error" ng-show="zendeskAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="zendeskAccountItemForm.keyType.$error" ng-show="zendeskAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="zendeskAccountItemForm.keyContent.$error" ng-show="zendeskAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="zendeskAccountItemForm.customField.$error" ng-show="zendeskAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="zendeskAccountItemForm.content.$error"\n          ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="zendeskAccountItemForm.variableName.$error"\n          ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/view.html",'<div id="integrations-zendeskAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-zendeskAccounts-button md-icon-button" aria-label="Go to zendeskAccounts" ng-click="vm.gotoZendeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZENDESKACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="zendeskAccount-image" hide-xs>\n          <img ng-src="assets/images/business/zendeskAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.zendeskAccount.id}}\n            <span ng-if="vm.zendeskAccount.name">{{vm.zendeskAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zendeskAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveZendeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (zendeskConfigurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="zendeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.zendeskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n                  <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.URI">Uri</label>\n                <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n                <md-select name="authType" ng-model="vm.zendeskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'password\'">Password</md-option>\n                  <md-option ng-value="\'token\'">Token</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n                <label translate="INTEGRATIONS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n                <label translate="INTEGRATIONS.TOKEN">Token</label>\n                <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'token\'].$error" ng-show="generalForm[\'token\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.zendeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="zendeskAccount-detail-form-container zendeskconfigurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.ZENDESKCONFIGURATIONS">ZENDESKCONFIGURATIONS</div>\n            </div>\n            <div ng-controller="ZendeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zendeskAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" class="md-icon-button" aria-label="create zendeskConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="zendeskConfiguration in vm_cc.zendeskConfigurations" class="border-top" md-colors="{background: (vm_cc.selectedZendeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZendeskConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ zendeskConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteZendeskConfiguration($event, zendeskConfiguration)" translate="INTEGRATIONS.DELETE_ZENDESKCONFIGURATION">\n                            Delete ZendeskConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.zendeskConfigurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.TAGS">TAGS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-table-container class="md-whiteframe-1dp padding-20">\n                        <md-input-container class="md-block">\n                          <label translate="INTEGRATIONS.TAGS">Tags</label>\n                          <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n                            <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n                          </md-select>\n                        </md-input-container>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.zendeskConfigurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",'<md-dialog class="zendeskConfiguration-dialog" aria-label="New ZendeskConfiguration">\n  <form name="zendeskConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.zendeskConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="zendeskConfigurationForm[\'name\'].$error" ng-show="zendeskConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.zendeskConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zendeskConfigurationForm[\'channel\'].$error" ng-show="zendeskConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.zendeskConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zendeskConfigurationForm[\'type\'].$error" ng-show="zendeskConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskConfiguration" ng-click="vm.saveZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid || zendeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskConfiguration" ng-click="vm.addNewZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKCONFIGURATION">\n          ADD ZENDESKCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskConfiguration" ng-click="vm.deleteZendeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",'<div id="zendeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.ZENDESKACCOUNTS">ZendeskAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedZendeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-zendeskAccounts-count">\n          <span>{{vm.selectedZendeskAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllZendeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectZendeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedZendeskAccounts" csv-label="true" filename="zendeskAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZendeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- ZENDESKACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedZendeskAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZendeskAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.zendeskAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="zendeskAccount" md-select-id="id" ng-repeat="zendeskAccount in vm.zendeskAccounts.rows">\n                <td md-cell ng-if="zendeskAccount.userpic"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="api/users/{{zendeskAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!zendeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="id ">{{zendeskAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="name ">{{zendeskAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="username ">{{zendeskAccount.username}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="remoteUri ">{{zendeskAccount.remoteUri}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(zendeskAccount, $event    )" translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT">\n                          Edit ZendeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(zendeskAccount, $event    )" translate="INTEGRATIONS.TEST_ZENDESKACCOUNT">\n                          Test ZendeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(zendeskAccount, $event    )" translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT">\n                          Delete ZendeskAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zendeskAccounts.count}}" md-on-paginate="vm.getZendeskAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / ZENDESKACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD ZENDESKACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zendeskAccount-button" ng-click="vm.createOrEditZendeskAccount($event)" aria-label="add zendeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD ZENDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/create/dialog.html",'<md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">\n  <form name="zohoAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="zohoAccountForm[\'name\'].$error" ng-show="zohoAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.HOST">Host</label>\n        <md-select name="host" ng-model="vm.zohoAccount.host" required>\n          <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n          <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n        </md-select>\n        <div ng-messages="zohoAccountForm[\'host\'].$error" ng-show="zohoAccountForm[\'host\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.ZONE">Zone</label>\n        <md-select name="zone" ng-model="vm.zohoAccount.zone" required>\n          <md-option ng-value="\'US\'">US</md-option>\n          <md-option ng-value="\'AU\'">AU</md-option>\n          <md-option ng-value="\'EU\'">EU</md-option>\n          <md-option ng-value="\'IN\'">IN</md-option>\n          <md-option ng-value="\'CN\'">CN</md-option>\n        </md-select>\n        <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>\n        <div ng-messages="zohoAccountForm[\'zone\'].$error" ng-show="zohoAccountForm[\'zone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED">Zone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n        <input type="text" name="clientId" ng-model="vm.zohoAccount.clientId" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTID"></span></div>\n        <div ng-messages="zohoAccountForm[\'clientId\'].$error" ng-show="zohoAccountForm[\'clientId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n        <input type="text" name="clientSecret" ng-model="vm.zohoAccount.clientSecret" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span></div>\n        <div ng-messages="zohoAccountForm[\'clientSecret\'].$error" ng-show="zohoAccountForm[\'clientSecret\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CODE">Code</label>\n        <input type="text" name="code" ng-model="vm.zohoAccount.code" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>\n        <div ng-messages="zohoAccountForm[\'code\'].$error" ng-show="zohoAccountForm[\'code\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED">Code field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n        <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n        <div ng-messages="zohoAccountForm[\'serverUrl\'].$error" ng-show="zohoAccountForm[\'serverUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.zohoAccount.description">\n\n        <div ng-messages="zohoAccountForm[\'description\'].$error" ng-show="zohoAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoAccount" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoAccount" ng-click="vm.addNewZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n          ADD ZOHOACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoAccount" ng-click="vm.deleteZohoAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",'<md-dialog class="zohoConfiguration-dialog" aria-label="New ZohoConfiguration">\n  <form name="zohoConfigurationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.zohoConfiguration.name" ng-required="true" autofocus>\n\n        <div ng-messages="zohoConfigurationForm[\'name\'].$error" ng-show="zohoConfigurationForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.zohoConfiguration.channel" required>\n\n          <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zohoConfigurationForm[\'channel\'].$error" ng-show="zohoConfigurationForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.zohoConfiguration.type" required>\n\n          <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n          <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="zohoConfigurationForm[\'type\'].$error" ng-show="zohoConfigurationForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoConfiguration" ng-click="vm.saveZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid || zohoConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoConfiguration" ng-click="vm.addNewZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOCONFIGURATION">\n          ADD ZOHOCONFIGURATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoConfiguration" ng-click="vm.deleteZohoConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",'<md-dialog class="zohoAccount-item-dialog" aria-label="New Item">\n  <form name="zohoAccountItemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div ng-switch="vm.type">\n        <div ng-switch-when="subject">\n          \x3c!-- SUBJECT SECTION --\x3e\n          <div ng-include="\'/subject.html\'"></div>\n          \x3c!-- / SUBJECT SECTION --\x3e\n        </div>\n        <div ng-switch-when="description">\n          \x3c!-- DESCRIPTION SECTION --\x3e\n          <md-input-container class="md-block">\n            <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n              <md-option value="string">String</md-option>\n              <md-option value="keyValue">Key Value</md-option>\n            </md-select>\n            <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                  required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n            <label translate="INTEGRATIONS.CONTENT">Content</label>\n            <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n            <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n              <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n                  is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <div ng-if="vm.item.type == \'keyValue\'">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.KEY">Key</label>\n              <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n              <div ng-messages="zohoAccountItemForm.key.$error" ng-show="zohoAccountItemForm.key.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.TYPE">Type</label>\n              <md-select name="keyType" ng-model="vm.item.keyType" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n              </md-select>\n              <div ng-messages="zohoAccountItemForm.keyType.$error" ng-show="zohoAccountItemForm.keyType.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n              <label translate="INTEGRATIONS.CONTENT">Content</label>\n              <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n              <div ng-messages="zohoAccountItemForm.keyContent.$error" ng-show="zohoAccountItemForm.keyContent.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n                    field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n                <md-optgroup label="Voice: Queue">\n                  <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n                  </md-option>\n                </md-optgroup>\n                <md-optgroup label="Voice: Outbound">\n                  <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n                </md-optgroup>\n              </md-select>\n              <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n                    name field is required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n              <label translate="INTEGRATIONS.VALUE">Value</label>\n              <md-select ng-model="vm.item.VariableId" required>\n                <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n                </md-option>\n              </md-select>\n            </md-input-container>\n          </div>\n          \x3c!-- / DESCRIPTION SECTION --\x3e\n        </div>\n        <div ng-switch-when="field">\n          \x3c!-- FIELD SECTION --\x3e\n          <div ng-if="vm.accountConnected">\n            <md-input-container class="md-block">\n              <label translate="INTEGRATIONS.FIELD">FIELD</label>\n              \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n              <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n                <md-optgroup label="Standard">\n                  <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n                  </md-option>\n                </md-optgroup>\n\n                <md-optgroup label="Custom">\n                  <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n                  </md-option>\n                </md-optgroup>\n\n              </md-select>\n              <div ng-messages="zohoAccountItemForm.customField.$error" ng-show="zohoAccountItemForm.customField.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n                    required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            \x3c!-- FIELDS --\x3e\n            <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n            \x3c!-- FIELDS --\x3e\n\n          </div>\n          <div ng-if="!vm.accountConnected">\n            <p>Account is not connected. Please check your configurations!</p>\n          </div>\n          \x3c!-- / FIELD SECTION --\x3e\n        </div>\n        <div ng-switch-default>\n          <p>No Item</p>\n        </div>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n          ADD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n  \x3c!-- type --\x3e\n  <md-input-container class="md-block">\n\n    <label translate="INTEGRATIONS.TYPE">Type</label>\n    <md-select name="type" ng-model="vm.item.type" required>\n      <md-option value="string">String</md-option>\n      <md-option value="variable">Variable</md-option>\n      <md-option value="customVariable">Custom Variable</md-option>\n      <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n    </md-select>\n    <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  \x3c!--/ type --\x3e\n\n  \x3c!-- value --\x3e\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n    \x3c!-- options --\x3e\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <md-select name="option" ng-model="vm.item.content" required>\n      <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n    </md-select>\n\n    <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n    <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n    <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n    <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n      <md-optgroup label="Voice: Queue">\n        <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n        </md-option>\n      </md-optgroup>\n      <md-optgroup label="Voice: Outbound">\n        <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n        </md-option>\n      </md-optgroup>\n    </md-select>\n    <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n      <div ng-message="required">\n        <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n          required</span>\n      </div>\n    </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n    <label translate="INTEGRATIONS.VALUE">Value</label>\n    <md-select ng-model="vm.item.VariableId" required>\n      <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n    </md-select>\n  </md-input-container>\n\n  \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n  <md-input-container class="md-block">\n        <label translate="INTEGRATIONS.TYPE">Type</label>\n            <md-select name="type" ng-model="vm.item.type" required>\n                <md-option value="string">String</md-option>\n                <md-option value="variable">Variable</md-option>\n                <md-option value="customVariable">Custom Variable</md-option>\n            </md-select>\n        <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n            <div ng-message="required">\n                <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n             </div>\n        </div>\n  </md-input-container>\n  \n  <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n      <label translate="INTEGRATIONS.CONTENT">Content</label>\n      <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n      <div ng-messages="zohoAccountItemForm.content.$error"\n          ng-show="zohoAccountItemForm.content.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n          required>\n          <md-optgroup label="Voice: Queue">\n              <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n              </md-option>\n          </md-optgroup>\n          <md-optgroup label="Voice: Outbound">\n              <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n              </md-option>\n          </md-optgroup>\n      </md-select>\n      <div ng-messages="zohoAccountItemForm.variableName.$error"\n          ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n          <div ng-message="required">\n              <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n                  required</span>\n          </div>\n      </div>\n  </md-input-container>\n\n  <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n      <label translate="INTEGRATIONS.VALUE">Value</label>\n      <md-select ng-model="vm.item.VariableId" required>\n          <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n      </md-select>\n  </md-input-container>\n  <\/script>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/view.html",'<div id="integrations-zohoAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-zohoAccounts-button md-icon-button" aria-label="Go to zohoAccounts" ng-click="vm.gotoZohoAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZOHOACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="zohoAccount-image" hide-xs>\n          <img ng-src="assets/images/business/zohoAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.zohoAccount.id}}\n            <span ng-if="vm.zohoAccount.name">{{vm.zohoAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zohoAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveZohoAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="zohoAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.HOST">Host</label>\n                <md-select name="host" ng-model="vm.zohoAccount.host" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n                  <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.ZONE">Zone</label>\n                <md-select name="zone" ng-model="vm.zohoAccount.zone" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'US\'">US</md-option>\n                  <md-option ng-value="\'AU\'">AU</md-option>\n                  <md-option ng-value="\'EU\'">EU</md-option>\n                  <md-option ng-value="\'IN\'">IN</md-option>\n                  <md-option ng-value="\'CN\'">CN</md-option>\n                </md-select>\n                <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>\n                <div ng-messages="generalForm[\'zone\'].$error" ng-show="generalForm[\'zone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED">Zone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n                <input type="text" name="clientId" ng-model="vm.zohoAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTID"></span></div>\n                <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n                <input type="text" name="clientSecret" ng-model="vm.zohoAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span></div>\n                <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.CODE">Code</label>\n                <input type="text" name="code" ng-model="vm.zohoAccount.code" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>\n                <div ng-messages="generalForm[\'code\'].$error" ng-show="generalForm[\'code\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED">Code field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.REFRESHTOKEN">RefreshToken</label>\n                <input type="text" name="refreshToken" ng-model="vm.zohoAccount.refreshToken" disabled>\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.REFRESHTOKEN"></span></div>\n                <div ng-messages="generalForm[\'refreshToken\'].$error" ng-show="generalForm[\'refreshToken\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.REFRESHTOKEN_REQUIRED">RefreshToken field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n                <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n                <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.zohoAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="zohoAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n            </div>\n            <div ng-controller="ZohoAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zohoAccount, vm.crudPermissions)" layout="row">\n              <md-card class="md-whiteframe-1dp" flex="30">\n                <div layout="row" layout-align="center center">\n                  <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n                  <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" class="md-icon-button" aria-label="create zohoConfiguration">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n                <md-list>\n                  <md-list-item layout="row" layout-align="center center" ng-repeat="zohoConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedZohoConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZohoConfiguration($index)">\n                    <span class="text-truncate" flex="80">{{ zohoConfiguration.name }}</span>\n                    <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                          <md-button ng-click="vm_cc.deleteZohoConfiguration($event, zohoConfiguration)" translate="INTEGRATIONS.DELETE_ZOHOCONFIGURATION">\n                            Delete ZohoConfiguration\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </md-list-item>\n                </md-list>\n              </md-card>\n              <div flex></div>\n              <md-card class="md-whiteframe-1dp" flex="65">\n                <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n                              <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n                                <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n                                <span ng-if="!subject.FieldId">{{subject.type}}</span>\n                              </td>\n                              <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n                                <span ng-switch-when="string">{{subject.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{subject.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{subject.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{subject.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n                                        Edit Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n                                        Delete Subject\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n                              <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n                                <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n                                <span ng-if="!description.FieldId">{{description.type}}</span>\n                              </td>\n                              <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n                                <span ng-switch-when="string">{{description.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{description.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{description.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{description.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n                                        Edit Description\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n                                        Delete Description\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <div flex></div>\n                          <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n                          <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n                            <md-icon md-font-icon="icon-plus"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n                        <div class="md-toolbar-tools">\n                          <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n                          <div flex></div>\n                          <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n                            <md-icon md-font-icon="icon-delete"></md-icon>\n                          </md-button>\n                        </div>\n                      </md-toolbar>\n                      <md-table-container class="md-whiteframe-1dp padding-horizontal">\n                        <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n                          <thead md-head>\n                            <tr md-row>\n                              <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n                              <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n                              <th md-column width="10px"></th>\n                            </tr>\n                          </thead>\n                          <tbody md-body>\n                            <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n                              <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n                                <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n                                <span ng-if="!field.FieldId">{{field.type}}</span>\n                              </td>\n                              <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n                                <span ng-switch-when="string">{{field.content}}</span>\n                                <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                <span ng-switch-when="keyValue">\n                                  {{field.key}}\n                                  <span ng-switch="description.keyType">\n                                    <span ng-switch-when="string">{{field.keyContent}}</span>\n                                    <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n                                    <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n                                  </span>\n                                </span>\n                                <span ng-switch-default>{{field.content}}</span>\n                              </td>\n                              <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n                                <md-menu>\n                                  <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                                    <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                                  </md-button>\n\n                                  <md-menu-content width="3">\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n                                      <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n                                        Edit Field\n                                      </md-button>\n                                    </md-menu-item>\n                                    <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n                                      <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n                                        Delete Field\n                                      </md-button>\n                                    </md-menu-item>\n                                  </md-menu-content>\n                                </md-menu>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </md-table-container>\n                    </md-tab-body>\n                  </md-tab>\n\n                  <md-tab>\n                    <md-tab-label>\n                      <span translate="INTEGRATIONS.ADVANCED">\n                        ADVANCED\n                      </span>\n                    </md-tab-label>\n                    <md-tab-body>\n                      <div layout-margin>\n                        <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n                        <md-select ng-model="vm_cc.zohoConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n                          <md-option ng-value="option.key" ng-repeat="option in [{key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">\n                            {{ option.value }}</md-option>\n                        </md-select>\n                      </div>\n                      <div layout-margin>\n                        <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n                        <md-select ng-model="vm_cc.zohoConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n                          <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">\n                            {{ option.value }}</md-option>\n                        </md-select>\n                      </div>\n                    </md-tab-body>\n                  </md-tab>\n\n\n                </md-tabs>\n                <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n                  <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n                    <md-button class="md-icon-button">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                    <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n                  </div>\n                </div>\n              </md-card>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",'<div id="zohoAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="INTEGRATIONS.ZOHOACCOUNTS">ZohoAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedZohoAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedZohoAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="INTEGRATIONS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-zohoAccounts-count">\n          <span>{{vm.selectedZohoAccounts.length}}</span>\n          <span translate="INTEGRATIONS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllZohoAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectZohoAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedZohoAccounts" csv-label="true" filename="zohoAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZohoAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- ZOHOACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedZohoAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZohoAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n                <th md-column md-order-by="host">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n                <th md-column md-order-by="zone">{{ \'INTEGRATIONS.ZONE\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.zohoAccounts.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="zohoAccount" md-select-id="id" ng-repeat="zohoAccount in vm.zohoAccounts.rows">\n                <td md-cell ng-if="zohoAccount.userpic"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="api/users/{{zohoAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!zohoAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="id ">{{zohoAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="name ">{{zohoAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="host ">{{ vm.arrayhost[zohoAccount.host].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="zone ">{{ vm.arrayzone[zohoAccount.zone].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(zohoAccount, $event    )" translate="INTEGRATIONS.EDIT_ZOHOACCOUNT">\n                          Edit ZohoAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.testtestintegrationaccount(zohoAccount, $event    )" translate="INTEGRATIONS.TEST_ZOHOACCOUNT">\n                          Test ZohoAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(zohoAccount, $event    )" translate="INTEGRATIONS.DELETE_ZOHOACCOUNT">\n                          Delete ZohoAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zohoAccounts.count}}" md-on-paginate="vm.getZohoAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / ZOHOACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD ZOHOACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zohoAccount-button" ng-click="vm.createOrEditZohoAccount($event)" aria-label="add zohoAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD ZOHOACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/jscripty/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n  <form name="projectForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="JSCRIPTY.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n        <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n        <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.project.description">\n\n        <div ng-messages="projectForm[\'description\'].$error" ng-show="projectForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="ADD" translate="JSCRIPTY.ADD_PROJECT" translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n          ADD PROJECT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="JSCRIPTY.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="JSCRIPTY.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/clone/clone.html",'<md-dialog class="project-dialog" aria-label="Clone Project">\n  <form name="projectForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="JSCRIPTY.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n        <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n        <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="CLONE" translate="JSCRIPTY.CLONE_PROJECT" translate-attr-aria-label="JSCRIPTY.CLONE_PROJECT">\n        CLONE PROJECT\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",'<md-dialog class="session-dialog" aria-label="New Session">\n  <form name="sessionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <md-list>\n        <md-subheader class="md-no-sticky">\n          <div class="margin-bottom-5"><span translate="JSCRIPTY.ANSWERS">Answers</span></div>\n          <div class="subtitle secondary-text">\n            <span translate="JSCRIPTY.STARTTIME" class="ng-scope font-weight-700">Start Time</span>: <span class="ng-binding">{{vm.session.starttime | date:\'medium\'}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="JSCRIPTY.MEMBERNAME" class="ng-scope font-weight-700">Member Name</span>: <span class="ng-binding">{{vm.session.membername}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="JSCRIPTY.PROJECT" class="ng-scope font-weight-700">Project</span>: <span class="ng-binding">{{vm.project.name}}</span>\n          </div>\n        </md-subheader>\n        <md-list-item ng-if="vm.questions.rows.length" class="md-2-line contact-item" ng-repeat="question in vm.questions.rows">\n          <div class="md-list-item-text compact">\n            <h3>{{$index+1}}. {{question.question}}</h3>\n            <p>{{question.answer}}</p>\n          </div>\n          <md-divider ng-if="!$last"></md-divider>\n        </md-list-item>\n        <md-list-item ng-if="!vm.questions.rows.length" class="md-2-line contact-item">\n          <div class="md-list-item-text compact">\n            <h3><span class="text-boxed-light" translate="JSCRIPTY.NO_RESULTS_AVAILABLE">No results available</span></h3>\n          </div>\n        </md-list-item>\n      </md-list>\n\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/view.html",'<div id="jscripty-project" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="JSCRIPTY.GO_TO_PROJECTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="project-image" hide-xs>\n          <img ng-src="assets/images/business/projects.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.project.id}}\n            <span ng-if="vm.project.name">{{vm.project.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="JSCRIPTY.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.project, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="JSCRIPTY.CLONE_PROJECT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveProject()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (builderForm.$invalid) || (previewForm.$invalid) || (sessionsForm.$invalid) || (answersForm.$invalid)" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="JSCRIPTY.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="JSCRIPTY.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.project.enableUncompleteSave" aria-label="EnableUncompleteSave" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.ENABLEUNCOMPLETESAVE">EnableUncompleteSave</span></md-switch>\n                <div class="hint"><span translate="JSCRIPTY.HELP.ENABLEUNCOMPLETESAVE"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.project.sendUnpauseOnSubmit" aria-label="SendUnpauseOnSubmit" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.SENDUNPAUSEONSUBMIT">SendUnpauseOnSubmit</span></md-switch>\n                <div class="hint"><span translate="JSCRIPTY.HELP.SENDUNPAUSEONSUBMIT"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.project.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.BUILDER">BUILDER</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container builder md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ProjectBuilderController as vm_bc" ng-init="vm_bc.init(vm.project)">\n              <mw-form-builder ng-if="vm_bc.project.formData" form-data="vm_bc.project.formData" options="vm_bc.optionsBuilder" read-only="false"></mw-form-builder>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.PREVIEW">PREVIEW</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container preview md-background-bg md-whiteframe-1dp">\n            <div layout="column" layout-align="center" ng-controller="ProjectViewerController as vm_vc" ng-init="vm_vc.init(vm.project)">\n              <div layout="row" layout-align="center">\n                <md-button class="md-raised md-accent" aria-label="Reset" ng-click="vm_vc.resetViewer()">\n                  Reset\n                </md-button>\n              </div>\n              <mw-form-viewer ng-if="vm_vc.project.formData" form-data="vm_vc.project.formData" response-data="vm_vc.responseData" on-submit="vm_vc.onSubmit($event)" api="vm_vc.formViewer"></mw-form-viewer>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.SESSIONS">SESSIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container sessions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ProjectSessionsController as vm_dc" ng-init="vm_dc.init(vm.project, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedProjectSessions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="JSCRIPTY.SESSIONS">Sessions</span>\n                  <ms-search-bar on-search="vm_dc.getProjectSessions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedProjectSessions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedProjectSessions.length}} {{vm_dc.selectedProjectSessions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedProjectSessions" csv-label="true" filename="projects.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedProjectSessions($event)" aria-label="delete selected" translate translate-attr-label="JSCRIPTY.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedProjectSessions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getProjectSessions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'JSCRIPTY.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'JSCRIPTY.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'JSCRIPTY.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="membername">\n                        {{ \'JSCRIPTY.MEMBERNAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'JSCRIPTY.CALLERIDNUM\' | translate }}\n                      </th>\n                      <th md-column md-order-by="completed">\n                        {{ \'JSCRIPTY.COMPLETE\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="session" md-select-id="id" ng-repeat="session in vm_dc.projectSessions.rows">\n                      <td md-cell>\n                        {{session.id}}\n                      </td>\n                      <td md-cell>\n                        {{ session.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ session.endtime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{session.membername}}\n                      </td>\n                      <td md-cell>\n                        {{session.calleridnum}}\n                      </td>\n                      <td md-cell class="completed ">\n                        <md-icon md-colors="{color: {{session.completed ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{session.completed? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.showQuestionsProjectSession($event, session)" translate="JSCRIPTY.SHOW_QUESTIONS_SESSION">\n                                Results Session\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(session, $event)" translate="JSCRIPTY.DELETE_SESSION">\n                                Delete Session\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.projectSessions.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="JSCRIPTY.NO_SESSION_AVAILABLE">No session available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.projectSessions.count}}" md-on-paginate="vm_dc.getProjectSessions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="JSCRIPTY.ANSWERS">ANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="project-detail-form-container answers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="ProjectAnswersController as vm_an" ng-init="vm_an.init(vm.project, vm.userProfile)">\n              <div class="pb-16" layout="row">\n                <div class="h2 secondary-text" translate="JSCRIPTY.ANSWERS" flex>Answers</div>\n                <div layout="row" layout-align="space-between center" flex>\n                  <md-date-range localization-map="vm_an.localizationMap" ng-model="vm_an.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_an.getAnswers()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n                  <md-button type="button" ng-if="vm_an.currentUser.role === \'admin\' || vm_an.userProfile.downloadJscriptySessions" ng-disabled="!vm_an.answers" ng-click="vm_an.getSummary($event)" class="md-accent md-raised md-button ng-scope md-default-theme md-ink-ripple md-green-500-bg md-icon-button" title="{{\'JSCRIPTY.EXPORT_TO_CSV\' | translate}}">\n                    <md-icon md-font-icon="icon-file-excel" class="md-default-theme md-font material-icons icon-file-excel"></md-icon>\n                  </md-button>\n                </div>\n              </div>\n              <div layout="row">\n                <md-card class="md-whiteframe-1dp" ng-if="vm_an.answers && vm_an.hasIdAnswers" flex>\n                  <md-list>\n                    <md-list-item class="md-2-line contact-item" ng-repeat="(key, question) in vm_an.answers">\n                      <div class="md-list-item-text compact" layout-padding>\n                        <h3>{{question.question}}</h3>\n                        <md-table-container>\n                          <table md-table>\n                            <thead md-head>\n                              <tr md-row>\n                                <th md-column></th>\n                                <th md-column>#</th>\n                                <th md-column>%</th>\n                              </tr>\n                            </thead>\n                            <tbody md-body>\n                              <tr md-row ng-repeat="(key, value) in question.answers">\n                                <td md-cell>{{key}}</td>\n                                <td md-cell width="20px">{{value}}</td>\n                                <td md-cell width="20px">{{value*100/question.sum | number:1}}</td>\n                              </tr>\n                              <tr md-row>\n                                <td md-cell><b>{{\'JSCRIPTY.TOTAL\' | translate}}</b></td>\n                                <td md-cell width="20px"><b>{{question.sum}}</b></td>\n                                <td md-cell width="20px"><b>100</b></td>\n                              </tr>\n                            </tbody>\n                          </table>\n                        </md-table-container>\n                      </div>\n                      <md-divider ng-if="!$last"></md-divider>\n                    </md-list-item>\n                  </md-list>\n                </md-card>\n                <span ng-if="!vm_an.answers || !vm_an.hasIdAnswers" class="text-boxed-light" translate="JSCRIPTY.NO_ANSWERS_AVAILABLE">No answers available</span>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/jscripty/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-script" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="JSCRIPTY.PROJECTS">Projects</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="JSCRIPTY.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="JSCRIPTY.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-projects-count">\n          <span>{{vm.selectedProjects.length}}</span>\n          <span translate="JSCRIPTY.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="JSCRIPTY.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllProjects()" translate="JSCRIPTY.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectProjects()" translate="JSCRIPTY.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="JSCRIPTY.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- PROJECT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'JSCRIPTY.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'JSCRIPTY.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'JSCRIPTY.CREATED_AT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.projects.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="JSCRIPTY.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n                <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n                <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="createdAt ">{{project.createdAt | date:\'medium\' }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(project, $event    )" translate="JSCRIPTY.EDIT_PROJECT">\n                          Edit Project\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(project, $event    )" translate="JSCRIPTY.CLONE_PROJECT">\n                          clone Project\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.sessionsgoto(project, $event    )" translate="JSCRIPTY.SESSIONS_PROJECT">\n                          Sessions Project\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.deleteconfirm(project, $event    )" translate="JSCRIPTY.DELETE_PROJECT">\n                          Delete Project\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / PROJECT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD PROJECT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD PROJECT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/create/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newMailAccount ? \'MAIL.NEW_MAILACCOUNT\' : \'MAIL.EDIT_MAILACCOUNT\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n\n        <div ng-messages="mailAccountForm[\'name\'].$error" ng-show="mailAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="mailAccountForm[\'key\'].$error" ng-show="mailAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.EMAIL_ADDRESS">Email Address</label>\n        <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n\n        <div ng-messages="mailAccountForm[\'email\'].$error" ng-show="mailAccountForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email Address field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email Address must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountForm[\'ListId\'].$error" ng-show="mailAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.newMailAccount" class="md-block">\n        <label translate="MAIL.SERVICE">Service</label>\n        <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" required>\n          <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountForm[\'provider\'].$error" ng-show="mailAccountForm[\'provider\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'">\n        <div layout="row">\n          <md-input-container class="md-block mr-20 mb-0" flex>\n            <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n            <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n            <div ng-messages="mailAccountForm[\'Imap.host\'].$error" ng-show="mailAccountForm[\'Imap.host\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block mb-0">\n            <label translate="MAIL.IMAP_PORT">IMAP Port</label>\n            <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" value="465" ng-required="true">\n            <div ng-messages="mailAccountForm[\'Imap.port\'].$error" ng-show="mailAccountForm[\'Imap.port\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP Port field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n        </div>\n      </div>\n\n      <div ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'">\n        <div layout="row">\n          <md-input-container class="md-block mr-20 mb-0" flex>\n            <label translate="MAIL.SMTP_HOST">SMTP Host</label>\n            <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n            <div ng-messages="mailAccountForm[\'Smtp.host\'].$error" ng-show="mailAccountForm[\'Smtp.host\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP Host field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block mb-0">\n            <label translate="MAIL.SMTP_PORT">SMTP Port</label>\n            <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true">\n            <div ng-messages="mailAccountForm[\'Smtp.port\'].$error" ng-show="mailAccountForm[\'Smtp.port\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP Port field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n        </div>\n      </div>\n\n      <md-input-container ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'" class="md-block pt-0">\n        <md-switch ng-model="vm.mailAccount.authentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.newMailAccount && vm.mailAccount.provider === \'outlook365\'" class="md-block">\n        <md-switch ng-model="vm.mailAccount.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n      </md-input-container>\n\n      <div ng-if="vm.newMailAccount && vm.mailAccount.authentication && vm.mailAccount.provider">\n        <md-input-container class="md-block">\n          <label translate="MAIL.USERNAME">Username</label>\n          <input type="text" name="username" ng-model="vm.mailAccount.username" ng-required="true">\n          <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n          <div ng-messages="mailAccountForm[\'username\'].$error" ng-show="mailAccountForm[\'username\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.mailAccount.modernAuthentication" class="md-block">\n          <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n          <md-select name="cloudProvider" ng-model="vm.mailAccount.CloudProviderId" required>\n            <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n          </md-select>\n          <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n          <div ng-messages="mailAccountForm[\'cloudProvider\'].$error" ng-show="mailAccountForm[\'cloudProvider\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="!vm.mailAccount.modernAuthentication" class="md-block">\n          <label translate="MAIL.PASSWORD">Password</label>\n          <input type="password" name="password" ng-model="vm.mailAccount.password" translate-attr-placeholder="MAIL.PASSWORD" required>\n          <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n          <div ng-messages="mailAccountForm[\'password\'].$error" role="alert">\n            <div ng-message="required">\n              <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n            </div>\n            <div ng-message="pattern">\n              <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="MAIL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.mailAccount.description">\n        <div ng-messages="mailAccountForm[\'description\'].$error" ng-show="mailAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailAccount" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid || mailAccountForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailAccount" ng-click="vm.addNewMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILACCOUNT" translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n          ADD MAIL ACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailAccount" ng-click="vm.deleteMailAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",'<md-dialog class="mailAccount-dialog" aria-label="mailAccount" ng-init="vm.onInit()">\n  <form name="mailAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MAIL.AGENTADD_MAILACCOUNT">Add Agent to mailAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/agent/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'agent\'].$error" ng-show="mailAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'times\'].$error" ng-show="mailAccountFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.REPLY_TYPE">Reply_Type</label>\n        <md-select name="replyType" ng-model="vm.autoreply.replyType" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="0">Reply</md-option>\n          <md-option ng-value="1">Reply All</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'replyType\'].$error" ng-show="mailAccountFormApp[\'replyType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.REPLY_TYPE_REQUIRED">Reply_Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="md-block">\n        <label class="md-caption grey-fg" translate="MAIL.TEXT">Text</label>\n        <textarea aria-label="Text text" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.autoreply.text"></textarea>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/close/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'disposition\'].$error" ng-show="mailAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'condition\'].$error" ng-show="mailAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'truepriority\'].$error" ng-show="mailAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'falsepriority\'].$error" ng-show="mailAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'priority\'].$error" ng-show="mailAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/noop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'value\'].$error" ng-show="mailAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/queue/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'queue\'].$error" ng-show="mailAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/system/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="mailAccountFormApp[\'command\'].$error" ng-show="mailAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'variable\'].$error" ng-show="mailAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/tag/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n  <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="mailAccountFormApp[\'tag\'].$error" ng-show="mailAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",'<md-dialog class="mailCannedAnswer-dialog" aria-label="New MailCannedAnswer">\n  <form name="mailCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.mailCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="mailCannedAnswerForm[\'key\'].$error" ng-show="mailCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="md-block">\n        <label class="md-caption grey-fg" translate="MAIL.VALUE">Value</label>\n        <textarea aria-label="Value value" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.mailCannedAnswer.value"></textarea>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.mailCannedAnswer.description">\n\n        <div ng-messages="mailCannedAnswerForm[\'description\'].$error" ng-show="mailCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailCannedAnswer" ng-click="vm.saveMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid || mailCannedAnswerForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailCannedAnswer" ng-click="vm.addNewMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILCANNEDANSWER" translate-attr-aria-label="MAIL.ADD_MAILCANNEDANSWER">\n          ADD MAILCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailCannedAnswer" ng-click="vm.deleteMailCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/view.html",'<div id="mail-mailAccount" class="page-layout simple tabbed" layout="column">\n\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-mailAccounts-button md-icon-button" aria-label="Go to mailAccounts" ng-click="vm.goToMailAccounts()" translate translate-attr-aria-label="MAIL.GO_TO_MAILACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="mailAccount-image" hide-xs>\n          <img ng-src="assets/images/business/mailAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.mailAccount.id}}\n            <span ng-if="vm.mailAccount.name">{{vm.mailAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.goToRealtime()" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="MAIL.GOTO_MAILACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.addAgent(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="MAIL.AGENTADD_MAILACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveMailAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (credentialsForm.$invalid) || (templateForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (imapForm.$invalid) || (smtpForm.$invalid) || (dispositionForm.$invalid) || (mailDispositionsForm.$invalid) || (mailCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.SERVICE">Service</label>\n                <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" class="mb-20" required>\n                  <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'provider\'].$error" ng-show="generalForm[\'provider\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n                <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.mailAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.markAsUnread" aria-label="mark_as_unread" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MARK_AS_UNREAD">mark_as_unread</span></md-switch>\n                <div class="hint"><span translate="MAIL.HELP.MARK_AS_UNREAD"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.mailAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.mailAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.mailAccount.provider !== \'custom\'">\n        <md-tab-label>\n          <span translate="MAIL.AUTHENTICATION">Authentication</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.CREDENTIALS">Credentials</div>\n            </div>\n            <form name="credentialsForm" novalidate>\n              <md-input-container ng-if="vm.mailAccount.provider === \'outlook365\'" class="md-block">\n                <md-switch ng-model="vm.mailAccount.Imap.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n                <div ng-messages="credentialsForm[\'username\'].$error" ng-show="credentialsForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.Imap.modernAuthentication" class="md-block">\n                <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n                <md-select name="cloudProvider" ng-model="vm.mailAccount.Imap.CloudProviderId" required>\n                  <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n                <div ng-messages="credentialsForm[\'cloudProvider\'].$error" ng-show="credentialsForm[\'cloudProvider\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="!vm.mailAccount.Imap.modernAuthentication" class="md-block">\n                <label translate="MAIL.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n                <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n                <div ng-messages="credentialsForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n\n          <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n            </div>\n            <form name="imapForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.MAILBOX">Mailbox</label>\n                <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.CONNTIMEOUT">Connection Timeout</label>\n                <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">Connection Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Connection Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.AUTHTIMEOUT">Authorization Timeout</label>\n                <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" value="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">Authorizazion Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Authorizazion Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.mailAccount.provider === \'custom\'">\n        <md-tab-label>\n          <span translate="MAIL.IMAP">IMAP</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n            </div>\n            <form name="imapForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n                <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.host\'].$error" ng-show="imapForm[\'Imap.host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n                <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" value="465" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.port\'].$error" ng-show="imapForm[\'Imap.port\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Imap.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.Imap.authentication" class="md-block">\n                <label translate="MAIL.USERNAME">Username</label>\n                <input type="text" name="Imap.user" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n                <div ng-messages="imapForm[\'Imap.user\'].$error" ng-show="imapForm[\'Imap.user\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.mailAccount.Imap.authentication">\n                <label translate="MAIL.PASSWORD">Password</label>\n                <input type="password" name="Imap.password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n                <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n                <div ng-messages="imapForm[\'Imap.password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.MAILBOX">Mailbox</label>\n                <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.CONNTIMEOUT">Connection Timeout</label>\n                <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">Connection Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Connection Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.AUTHTIMEOUT">Authorization Timeout</label>\n                <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" value="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">Authorization Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Authorization Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.mailAccount.provider === \'custom\'">\n        <md-tab-label>\n          <span translate="MAIL.SMTP">SMTP</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container smtp md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.SMTP">SMTP</div>\n            </div>\n            <form name="smtpForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n                <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n                <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="Secure" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SECURE">Secure</span></md-switch>\n                <div class="hint"><span translate="MAIL.HELP.SECURE"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.Smtp.authentication" class="md-block">\n                <label translate="MAIL.USERNAME">Username</label>\n                <input type="text" name="Smtp.user" ng-model="vm.mailAccount.Smtp.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n                <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.mailAccount.Smtp.authentication">\n                <label translate="MAIL.PASSWORD">Password</label>\n                <input type="password" name="Smtp.pass" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n                <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n                <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container template md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.TEMPLATE">TEMPLATE</div>\n            </div>\n            <form name="templateForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.FONT_FAMILY">Font_Family</label>\n                <ms-font-family name="fontFamily" ng-model="vm.mailAccount.fontFamily" required></ms-font-family>\n                <div class="hint"><span translate="MAIL.HELP.FONT_FAMILY"></span></div>\n                <div ng-messages="templateForm[\'fontFamily\'].$error" ng-show="templateForm[fontFamily].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.FONT_FAMILY_REQUIRED">Font_Family field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.FONT_SIZE">Font_Size</label>\n                <input type="number" name="fontSize" ng-model="vm.mailAccount.fontSize" min="8" max="72" value="13" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MAIL.HELP.FONT_SIZE"></span></div>\n                <div ng-messages="templateForm[\'fontSize\'].$error" ng-show="templateForm[\'fontSize\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.FONT_SIZE_REQUIRED">Font_Size field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>8</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>72</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="MAIL.TEMPLATE">Template</label>\n                <textarea aria-label="Template template" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.mailAccount.template"></textarea>\n              </div>\n            </form>\n          </div>\n\n          <div class="mailAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="MAIL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.mailAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n\n          <div class="mailAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.queueTransfer == true" class="md-block">\n                <label translate="MAIL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.mailAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.agentTransfer == true" class="md-block">\n                <label translate="MAIL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.mailAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n\n          <div class="mailAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.mailAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.mailAccount.mandatoryDisposition" class="md-block">\n                <label translate="MAIL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.mailAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MAIL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="MailAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="mailAccount-detail-form-container maildispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="MAIL.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add mail dispositions" translate translate-attr-label="MAIL.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="mailAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container mailcannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="MailAccountMailCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MAIL.MAILCANNEDANSWERS">MailCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getMailAccountMailCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event)" aria-label="add mailCannedAnswer" translate translate-attr-label="MAIL.ADD_MAILCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedMailAccountMailCannedAnswers.length}} {{vm_dc.selectedMailAccountMailCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailCannedAnswers" csv-label="true" filename="mailAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'MAIL.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'MAIL.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'MAIL.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'MAIL.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'MAIL.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="mailCannedAnswer" md-select-id="id" ng-repeat="mailCannedAnswer in vm_dc.mailAccountMailCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n                        {{mailCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n                        {{mailCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.value | htmlToPlaintext }}</td>\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n                        {{mailCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n                        {{ mailCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" translate="MAIL.EDIT_MAILCANNEDANSWER">\n                                Edit MailCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(mailCannedAnswer, $event)" translate="MAIL.DELETE_MAILCANNEDANSWER">\n                                Delete MailCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.mailAccountMailCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MAIL.NO_MAILCANNEDANSWER_AVAILABLE">No mailcannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountMailCannedAnswers.count}}" md-on-paginate="vm_dc.getMailAccountMailCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="MailAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.mailAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="MAIL.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedMailAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedMailAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedMailAccountApps.length}} {{vm_ac.selectedMailAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedMailAccountApps($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedMailAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.mailAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editMailAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.mailAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="MailAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MAIL.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getMailAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getMailAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getMailAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="MAIL.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedMailAccountInteractions.length}} {{vm_dc.selectedMailAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountInteractions" csv-label="true" filename="mailAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'MAIL.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'MAIL.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="subject">\n                        {{ \'MAIL.SUBJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'MAIL.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'MAIL.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'MAIL.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'MAIL.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'MAIL.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.mailAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <div class="width-300">\n                          <span class="text-truncate font-size-12">\n                            {{interaction.subject}}\n                          </span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'MAIL.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'MAIL.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spymailInteraction($event, interaction)" translate="MAIL.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n                              <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n                                Download with attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                                Download without attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="MAIL.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.mailAccountInteractions.rows.length">\n                      <td md-cell colspan="13">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MAIL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountInteractions.count}}" md-on-paginate="vm_dc.getMailAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/mailAccounts.html",'<div id="mailAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MAIL.MAILACCOUNTS">MailAccounts</span>\n      </div>\n    </div>\n    <div layout="row">\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n    </div>\n  </div>\n\n  <div ng-show="vm.selectedMailAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMailAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MAIL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-mailAccounts-count">\n          <span>{{vm.selectedMailAccounts.length}}</span>\n          <span translate="MAIL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMailAccounts()" translate="MAIL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMailAccounts()" translate="MAIL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMailAccounts" csv-label="true" filename="mailAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailAccounts($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    <div class="main scrollable">\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMailAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n                <th md-column md-order-by="provider">{{ \'MAIL.SERVICE\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'MAIL.EMAIL_ADDRESS\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'MAIL.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.mailAccounts.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="mailAccount" md-select-id="id" ng-repeat="mailAccount in vm.mailAccounts.rows" ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)">\n                <td md-cell class="id">{{mailAccount.id}}</td>\n                <td md-cell class="name">{{mailAccount.name}}</td>\n                <td md-cell class="provider">{{ mailAccount.provider ? (mailAccount.provider | startcase) : (\'MAIL.CUSTOM\' | translate) }}</td>\n                <td md-cell class="key">{{mailAccount.key}}</td>\n                <td md-cell class="email">{{mailAccount.email}}</td>\n                <td md-cell class="active">\n                  <md-icon md-colors="{color: {{mailAccount.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{mailAccount.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td md-cell class="description ">{{mailAccount.description}}</td>\n                <td md-cell class="actions">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editstate(mailAccount, $event)" translate="MAIL.EDIT_MAILACCOUNT">\n                          Edit Email Account\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item>\n                        <md-button ng-click="vm.verifySMTP(mailAccount, $event)" translate="MAIL.VERIFYSMTP_MAILACCOUNT">\n                          Verify SMTP\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item>\n                        <md-button ng-click="vm.goToInteractions(mailAccount, $event)" translate="MAIL.INTERACTIONS_MAILACCOUNT">\n                          Go To Interactions\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item>\n                        <md-button ng-click="vm.goToRealtime()" translate="MAIL.GOTOREALTIME_MAILACCOUNT">\n                          Go To Realtime\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item>\n                        <md-button ng-click="vm.addAgent(mailAccount, $event)" translate="MAIL.AGENTADD_MAILACCOUNT">\n                          Add Agent To Email Account\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteconfirm(mailAccount, $event)" translate="MAIL.DELETE_MAILACCOUNT">\n                          Delete Email Account\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n      </md-card>\n    </div>\n  </div>\n\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailAccount-button" ng-click="vm.createOrEditMailAccount($event)" aria-label="add mailAccount" translate translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/create/dialog.html",'<md-dialog class="mailQueue-dialog" aria-label="New MailQueue">\n  <form name="mailQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newMailQueue">\n\n        <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n        <div ng-messages="mailQueueForm[\'name\'].$error" ng-show="mailQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="mailQueueForm[\'strategy\'].$error" ng-show="mailQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="mailQueueForm[\'timeout\'].$error" ng-show="mailQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.mailQueue.description">\n\n        <div ng-messages="mailQueueForm[\'description\'].$error" ng-show="mailQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailQueue" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid || mailQueueForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailQueue" ng-click="vm.addNewMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILQUEUE" translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n          ADD MAILQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailQueue" ng-click="vm.deleteMailQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n  <form name="mailQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MAIL.AGENTADD_MAILQUEUE">Add Agent to mailQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n  <form name="mailQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MAIL.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/view.html",'<div id="mail-mailQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-mailQueues-button md-icon-button" aria-label="Go to mailQueues" ng-click="vm.gotoMailQueues()" translate translate-attr-aria-label="MAIL.GO_TO_MAILQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="mailQueue-image" hide-xs>\n          <img ng-src="assets/images/business/mailQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.mailQueue.id}}\n            <span ng-if="vm.mailQueue.name">{{vm.mailQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.mailQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="MAIL.TEAMADD_MAILQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.mailQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="MAIL.AGENTADD_MAILQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveMailQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="mailQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MAIL.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.mailQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MAIL.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.mailQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/mailQueues.html",'<div id="mailQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MAIL.MAILQUEUES">MailQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedMailQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMailQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MAIL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-mailQueues-count">\n          <span>{{vm.selectedMailQueues.length}}</span>\n          <span translate="MAIL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMailQueues()" translate="MAIL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMailQueues()" translate="MAIL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMailQueues" csv-label="true" filename="mailQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailQueues($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- MAILQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMailQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'MAIL.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.mailQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="mailQueue" md-select-id="id" ng-repeat="mailQueue in vm.mailQueues.rows">\n                <td md-cell ng-if="mailQueue.userpic"><img class="avatar" alt="{{mailQueue.name}}" ng-src="api/users/{{mailQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!mailQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="id ">{{mailQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="name ">{{mailQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="strategy ">{{ vm.arraystrategy[mailQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(mailQueue, $event    )" translate="MAIL.EDIT_MAILQUEUE">\n                          Edit MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(mailQueue, $event    )" translate="MAIL.TEAMADD_MAILQUEUE">\n                          teamadd MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(mailQueue, $event    )" translate="MAIL.AGENTADD_MAILQUEUE">\n                          agentadd MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(mailQueue, $event    )" translate="MAIL.DELETE_MAILQUEUE">\n                          Delete MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(mailQueue, $event    )" translate="MAIL.GOTOREALTIME_MAILQUEUE">\n                          goToRealtime MailQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailQueues.count}}" md-on-paginate="vm.getMailQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / MAILQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD MAILQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailQueue-button" ng-click="vm.createOrEditMailQueue($event)" aria-label="add mailQueue" translate translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD MAILQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailSubtatuses/create/dialog.html",'<md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">\n  <form name="mailSubstatusForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MAIL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.mailSubstatus.name" ng-required="true" autofocus>\n\n        <div ng-messages="mailSubstatusForm[\'name\'].$error" ng-show="mailSubstatusForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MAIL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.mailSubstatus.description">\n\n        <div ng-messages="mailSubstatusForm[\'description\'].$error" ng-show="mailSubstatusForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailSubstatus" ng-click="vm.saveMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailSubstatus" ng-click="vm.addNewMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILSUBSTATUS" translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n          ADD MAILSUBSTATUS\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailSubstatus" ng-click="vm.deleteMailSubstatus($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",'<div id="mailSubtatuses" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MAIL.MAILSUBSTATUSES">MailSubstatuses</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedMailSubstatuses.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMailSubstatuses =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MAIL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-mailSubtatuses-count">\n          <span>{{vm.selectedMailSubstatuses.length}}</span>\n          <span translate="MAIL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMailSubstatuses()" translate="MAIL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMailSubstatuses()" translate="MAIL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMailSubstatuses" csv-label="true" filename="mailSubtatuses.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailSubstatuses($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- MAILSUBSTATUS TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMailSubstatuses" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailSubstatuses">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.mailSubtatuses.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="mailSubstatus" md-select-id="id" ng-repeat="mailSubstatus in vm.mailSubtatuses.rows">\n                <td md-cell ng-if="mailSubstatus.userpic"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="api/users/{{mailSubstatus.id}}/avatar" /></td>\n                <td md-cell ng-if="!mailSubstatus.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="id ">{{mailSubstatus.id}}</td>\n                <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="name ">{{mailSubstatus.name}}</td>\n                <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="description ">{{mailSubstatus.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(mailSubstatus, $event    )" translate="MAIL.EDIT_MAILSUBSTATUS">\n                          Edit MailSubstatus\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(mailSubstatus, $event    )" translate="MAIL.DELETE_MAILSUBSTATUS">\n                          Delete MailSubstatus\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailSubtatuses.count}}" md-on-paginate="vm.getMailSubstatuses" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / MAILSUBSTATUS TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD MAILSUBSTATUS BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailSubstatus-button" ng-click="vm.createOrEditMailSubstatus($event)" aria-label="add mailSubstatus" translate translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD MAILSUBSTATUS BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MAIL.ACCOUNTS">Accounts</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.vm.getMailAccounts()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate}}</th>\n        <th md-column>{{\'MAIL.KEY\' | translate}}</th>\n        <th md-column>{{\'MAIL.TOTAL\' | translate}}</th>\n        <th md-column>{{\'MAIL.IN\' | translate}}</th>\n        <th md-column>{{\'MAIL.OUT\' | translate}}</th>\n        <th md-column>{{\'MAIL.IMAP_STATUS\' | translate}}</th>\n        <th md-column>{{\'MAIL.SMTP_STATUS\' | translate}}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.mailAccounts">\n        <td md-cell colspan="4">\n          <div layout="row" layout-align="center center">\n            <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="vm.mailAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n        <td md-cell>{{vm.mailAccounts[value].name}}</td>\n        <td md-cell>{{vm.mailAccounts[value].key}}</td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{(vm.mailAccounts[value].in || 0) + (vm.mailAccounts[value].out || 0)}}</span>\n        </td>\n        <td md-cell>\n          <div layout="row">\n            <span>\n              <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n            </span>\n            <span class="md-capture blue-fg">{{vm.mailAccounts[value].in || 0}}</span>\n            <span class="text-boxed" ng-if="mailAccount.in">{{vm.mailAccounts[value].lastIn ?  (vm.mailAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n          </div>\n        </td>\n        <td md-cell>\n          <div layout="row">\n            <span>\n              <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n            </span>\n            <span class="md-capture green-fg">{{vm.mailAccounts[value].out || 0}}</span>\n            <span class="text-boxed" ng-if="mailAccount.out">{{vm.mailAccounts[value].lastOut ?  (vm.mailAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n          </div>\n        </td>\n        <td md-cell>\n          <div layout="row" layout-align="start center">\n            <div layout="column" layout-align="center center">\n              <md-button class="md-icon-button" aria-label="Status">\n                <md-tooltip>{{vm.mailAccounts[value].Imap.messageStatus}}</md-tooltip>\n                <div ng-switch="vm.mailAccounts[value].Imap.status">\n                  <md-icon ng-switch-when="error" md-font-icon="icon-alert yellow-fg"></md-icon>\n                  <md-icon ng-switch-when="disabled" md-font-icon="icon-close grey-fg"></md-icon>\n                  <md-icon ng-switch-default md-font-icon="icon-checkbox-marked-circle-outline green-fg"></md-icon>\n                </div>\n              </md-button>\n              <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Imap.status.toUpperCase()) | translate}}</span>\n            </div>\n            <span class="text-boxed" ng-if="vm.mailAccounts[value].active && (vm.mailAccounts[value].Imap.lastSync && vm.mailAccounts[value].Imap.lastSync != \'\')">{{vm.mailAccounts[value].Imap.lastSync | date: \'shortTime\'}}</span>\n          </div>\n        </td>\n        <td md-cell>\n          <div layout="row" layout-align="start center" ng-if="vm.mailAccounts[value].Smtp.status">\n            <div layout="column" layout-align="center center">\n              <md-button class="md-icon-button" aria-label="Status">\n                <md-tooltip>{{vm.mailAccounts[value].Smtp.messageStatus}}</md-tooltip>\n                <md-icon md-font-icon="{{ vm.mailAccounts[value].Smtp.status == \'error\' ? \'icon-alert yellow-fg\' : \'icon-checkbox-marked-circle-outline green-fg\'}}"></md-icon>\n              </md-button>\n              <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Smtp.status.toUpperCase()) | translate}}</span>\n            </div>\n            <span class="text-boxed">{{vm.mailAccounts[value].Smtp.lastSync | date: \'shortTime\'}}</span>\n          </div>\n          <span class="md-caption grey-fg" ng-if="!vm.mailAccounts[value].Smtp.status">{{ \'MAIL.NEVER_VERIFIED\' | translate }}</span>\n        </td>\n        <td md-cell class="actions">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n\n            <md-menu-content width="4">\n              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                <md-button ng-click="vm.goToMailAccount($event, vm.mailAccounts[value])" translate="MAIL.EDIT_ACCOUNT">\n                  Edit Account\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.verifySmtp($event, vm.mailAccounts[value])" translate="MAIL.VERIFY_SMTP">\n                  Verify Smtp\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MAIL.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n        <th md-column>{{ \'MAIL.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'MAIL.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'MAIL.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="MAIL.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="MAIL.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/mail/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MAIL.ACCOUNTS">Accounts</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/create/dialog.html",'<md-dialog class="plugin-dialog" aria-label="New Plugin">\n  <form name="pluginForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus>\n\n        <div ng-messages="pluginForm[\'name\'].$error" ng-show="pluginForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.TYPE">Type</label>\n        <input type="text" name="type" ng-model="vm.plugin.type" ng-disabled="!vm.newPlugin">\n\n        <div ng-messages="pluginForm[\'type\'].$error" ng-show="pluginForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="!vm.newPlugin"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.plugin.description">\n\n        <div ng-messages="pluginForm[\'description\'].$error" ng-show="pluginForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.ICON">Icon</label>\n        <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true">\n\n        <div ng-messages="pluginForm[\'icon\'].$error" ng-show="pluginForm[\'icon\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n        <md-select name="sidebar" ng-model="vm.plugin.sidebar" required>\n          <md-option ng-value="\'always\'">Always</md-option>\n          <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n          <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n          <md-option ng-value="\'never\'">Never</md-option>\n        </md-select>\n        <div ng-messages="pluginForm[\'sidebar\'].$error" ng-show="pluginForm[\'sidebar\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n        <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n        <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl">\n\n        <div ng-messages="pluginForm[\'adminUrl\'].$error" ng-show="pluginForm[\'adminUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n        <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n        <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl">\n\n        <div ng-messages="pluginForm[\'agentUrl\'].$error" ng-show="pluginForm[\'agentUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n        <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n        <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" ng-disabled="!vm.newPlugin">\n\n        <div ng-messages="pluginForm[\'scriptName\'].$error" ng-show="pluginForm[\'scriptName\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n        <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n        <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true">\n\n        <div ng-messages="pluginForm[\'scriptPath\'].$error" ng-show="pluginForm[\'scriptPath\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MARKETPLACE.VERSION">Version</label>\n        <input type="text" name="version" ng-model="vm.plugin.version" ng-disabled="!vm.newPlugin">\n\n        <div ng-messages="pluginForm[\'version\'].$error" ng-show="pluginForm[\'version\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPlugin" ng-click="vm.savePlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid || pluginForm.$pristine" aria-label="SAVE" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPlugin" ng-click="vm.addNewPlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid" aria-label="ADD" translate="MARKETPLACE.ADD_PLUGIN" translate-attr-aria-label="MARKETPLACE.ADD_PLUGIN">\n          ADD PLUGIN\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPlugin" ng-click="vm.deletePlugin($event)" aria-label="DELETE" translate translate-attr-aria-label="MARKETPLACE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MARKETPLACE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/marketplace/views/plugins/edit/view.html",'<div id="marketplace-plugin" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-plugins-button md-icon-button" aria-label="Go to plugins" ng-click="vm.gotoPlugins()" translate translate-attr-aria-label="MARKETPLACE.GO_TO_PLUGINS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="plugin-image" hide-xs>\n          <img ng-src="assets/images/business/plugins.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.plugin.id}}\n            <span ng-if="vm.plugin.name">{{vm.plugin.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MARKETPLACE.CREATED_AT"></span> <span>{{vm.plugin.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.savePlugin()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MARKETPLACE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="plugin-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MARKETPLACE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.TYPE">Type</label>\n                <input type="text" name="type" ng-model="vm.plugin.type" disabled>\n\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="true"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.plugin.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.ICON">Icon</label>\n                <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'icon\'].$error" ng-show="generalForm[\'icon\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n                <md-select name="sidebar" ng-model="vm.plugin.sidebar" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'always\'">Always</md-option>\n                  <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n                  <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n                  <md-option ng-value="\'never\'">Never</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'sidebar\'].$error" ng-show="generalForm[\'sidebar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n                <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n                <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'adminUrl\'].$error" ng-show="generalForm[\'adminUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n                <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n                <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'agentUrl\'].$error" ng-show="generalForm[\'agentUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n                <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n                <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" disabled>\n\n                <div ng-messages="generalForm[\'scriptName\'].$error" ng-show="generalForm[\'scriptName\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n                <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n                <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'scriptPath\'].$error" ng-show="generalForm[\'scriptPath\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MARKETPLACE.VERSION">Version</label>\n                <input type="text" name="version" ng-model="vm.plugin.version" disabled>\n\n                <div ng-messages="generalForm[\'version\'].$error" ng-show="generalForm[\'version\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/marketplace/views/plugins/plugins.html",'<div id="plugins" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cart" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MARKETPLACE.PLUGINS">Plugins</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MARKETPLACE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedPlugins.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedPlugins =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MARKETPLACE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-plugins-count">\n          <span>{{vm.selectedPlugins.length}}</span>\n          <span translate="MARKETPLACE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MARKETPLACE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllPlugins()" translate="MARKETPLACE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectPlugins()" translate="MARKETPLACE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedPlugins" csv-label="true" filename="plugins.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPlugins($event)" aria-label="delete selected" translate translate-attr-label="MARKETPLACE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      <div ng-if="vm.installing">\n        <md-card class="md-whiteframe-1dp padding-20" flex>\n          <div layout="column" layout-align="center center">\n            <span class="md-title md-accent-fg padding-20 text-bold" translate="MARKETPLACE.INSTALLING">Installing</span>\n            <md-progress-linear md-mode="indeterminate" class="md-accent padding-20"></md-progress-linear>\n          </div>\n        </md-card>\n      </div>\n\n      \x3c!-- PLUGIN TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedPlugins" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPlugins">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="name">{{ \'MARKETPLACE.NAME\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'MARKETPLACE.TYPE\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'MARKETPLACE.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'MARKETPLACE.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="version">{{ \'MARKETPLACE.VERSION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.plugins.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MARKETPLACE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="plugin" md-select-id="id" ng-repeat="plugin in vm.plugins.rows">\n                <td md-cell ng-if="plugin.userpic"><img class="avatar" alt="{{plugin.name}}" ng-src="api/users/{{plugin.id}}/avatar" /></td>\n                <td md-cell ng-if="!plugin.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{plugin.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="name ">{{plugin.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="type ">{{plugin.type}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="active ">\n                  <md-icon md-colors="{color: {{plugin.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{plugin.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="description ">{{plugin.description}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="version ">{{plugin.version}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MARKETPLACE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit && !plugin.active">\n\n                        <md-button ng-click="vm.installplugin(plugin, $event    )" translate="MARKETPLACE.INSTALL_PLUGIN">\n                          Install Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(plugin, $event    )" translate="MARKETPLACE.EDIT_PLUGIN">\n                          Edit Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n\n                        <md-button ng-click="vm.stopplugin(plugin, $event    )" translate="MARKETPLACE.STOP_PLUGIN">\n                          Stop Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n\n                        <md-button ng-click="vm.restartplugin(plugin, $event    )" translate="MARKETPLACE.RESTART_PLUGIN">\n                          Restart Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.downloadfile2(plugin, $event  , \'plugins\'   )" translate="MARKETPLACE.DOWNLOAD_PLUGIN">\n                          Download Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active">\n\n                        <md-button ng-click="vm.uninstallplugin(plugin, $event    )" translate="MARKETPLACE.UNINSTALL_PLUGIN">\n                          Uninstall Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(plugin, $event    )" translate="MARKETPLACE.DELETE_PLUGIN">\n                          Delete Plugin\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MARKETPLACE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MARKETPLACE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MARKETPLACE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.plugins.count}}" md-on-paginate="vm.getPlugins" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / PLUGIN TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- UPLOAD PLUGIN BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-plugin-button" ng-click="vm.uploadPlugin($event)" aria-label="upload plugin" translate translate-attr-aria-label="MARKETPLACE.UPLOAD_PLUGIN">\n    <md-icon md-font-icon="icon-upload"></md-icon>\n  </md-button>\n  \x3c!-- / UPLOAD PLUGIN BUTTON --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n  <form name="uploadForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div id="plugin-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n        <div class="drop-text hint-text" layout="row" layout-align="center center">\n          <span translate="MARKETPLACE.DROP_TO_UPLOAD">Drop to upload</span>\n        </div>\n\n        <div class="upload-button" layout="column" layout-align="center center">\n          <md-button class="md-accent md-raised" flow-btn>\n            Upload\n          </md-button>\n          <span class="secondary-text mt-8" translate="MARKETPLACE.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n        </div>\n      </div>\n\n      <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n        <div>\n          <span translate="MARKETPLACE.UPLOADING">Uploading</span>\n          <span>{{vm.plugin.file.name}}</span>\n        </div>\n        <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n      </div>\n\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center"></div>\n      <div layout="row">\n        <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="MARKETPLACE.FINISH" translate-attr-aria-label="MARKETPLACE.FINISH">\n          FINISH\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/hopperdate/hopperdate.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n  <form name="hopperForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content ms-scroll>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" ng-change="vm.recalcTZTime()" mdp-format="YYYY-MM-DD" ng-model="vm.dateTime">\n              <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" ng-change="vm.recalcTZTime()" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.dateTime">\n              <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n\n        </md-content>\n      </div>\n      <md-input-container class="md-block">\n        <div layout="row">\n          <div flex class="md-block">\n            <md-input-container class="md-block" flex-gt-sm="">\n              <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n              <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" ng-change="vm.recalcTZTime()" autofocus>\n            </md-input-container>\n          </div>\n          <div flex class="md-block">\n            <md-input-container class="md-block">\n              <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n              <input type="text" readonly value="{{vm.hopper.scheduledat}}">\n            </md-input-container>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n        <md-select name="priority" ng-model="vm.hopper.priority">\n          <md-option ng-value="\'4\'">Highest</md-option>\n          <md-option ng-value="\'3\'">High</md-option>\n          <md-option ng-value="\'2\'">Medium</md-option>\n          <md-option ng-value="\'1\'">Low</md-option>\n          <md-option ng-value="\'0\'">Lowest</md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n        <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n\n      </md-input-container>\n      <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n        <label translate="MOTIONDIALER.AGENT">Agent</label>\n        <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n          <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n        </md-select>\n        <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n          ADD HOPPER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",'<md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">\n  <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n        <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n        <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n          <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n        </md-select>\n        <div ng-messages="ivrCampaignForm[\'TrunkId\'].$error" ng-show="ivrCampaignForm[\'TrunkId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n        <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n          <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n        </md-select>\n        <div ng-messages="ivrCampaignForm[\'IntervalId\'].$error" ng-show="ivrCampaignForm[\'IntervalId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n        <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n          <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n          <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n          <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="ivrCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="ivrCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n        <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required>\n          <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n        </md-select>\n        <div ng-messages="ivrCampaignForm[\'SquareProjectId\'].$error" ng-show="ivrCampaignForm[\'SquareProjectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n        <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" value="30" ng-required="true">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n        <div ng-messages="ivrCampaignForm[\'limitCalls\'].$error" ng-show="ivrCampaignForm[\'limitCalls\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n\n        <div ng-messages="ivrCampaignForm[\'description\'].$error" ng-show="ivrCampaignForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newIvrCampaign" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newIvrCampaign" ng-click="vm.addNewIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n          ADD IVRCAMPAIGN\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newIvrCampaign" ng-click="vm.deleteIvrCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n  <form name="ivrCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n      <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n        <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",'<md-dialog class="ivrCampaign-dialog" aria-label="Clone IvrCampaign">\n  <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n        <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n        CLONE IVRCAMPAIGN\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n  <form name="hopperForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n              <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n              <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </md-content>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n        <md-select name="priority" ng-model="vm.hopper.priority">\n          <md-option ng-value="\'4\'">Highest</md-option>\n          <md-option ng-value="\'3\'">High</md-option>\n          <md-option ng-value="\'2\'">Medium</md-option>\n          <md-option ng-value="\'1\'">Low</md-option>\n          <md-option ng-value="\'0\'">Lowest</md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n        <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n          ADD HOPPER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n  <form name="ivrCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n      <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n        <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content ng-hide="vm.loading">\n      <div layout="row" layout-wrap flex>\n        <div flex-xs flex="50">\n          <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n            <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n            <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n          </md-checkbox>\n        </div>\n        <div flex-xs flex="50">\n        </div>\n        <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n          <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n            {{ item.name | limitTo:40 }}\n          </md-checkbox>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n      <div>\n      </div>\n      <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n    <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n      <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n    </div>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",'<div id="motiondialer-ivrCampaign" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-ivrCampaigns-button md-icon-button" aria-label="Go to ivrCampaigns" ng-click="vm.gotoIvrCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_IVRCAMPAIGNS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="ivrCampaign-image" hide-xs>\n          <img ng-src="assets/images/business/ivrCampaigns.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.ivrCampaign.id}}\n            <span ng-if="vm.ivrCampaign.name">{{vm.ivrCampaign.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.ivrCampaign.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="MOTIONDIALER.CLONE_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.listadddialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n        <md-tooltip><span translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.blacklistadddialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n        <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-block-helper"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.resetlistdialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n        <md-tooltip><span translate="MOTIONDIALER.RESETLIST_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-restore"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="MOTIONDIALER.GOTO_IVRCAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveIvrCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (nosuchnumberForm.$invalid) || (dropForm.$invalid) || (abandonedForm.$invalid) || (machineForm.$invalid) || (agentrejectForm.$invalid) || (advancedForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n                <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n                <md-select name="TrunkBackupId" ng-model="vm.ivrCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n                <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n                <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n                  <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n                  <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n                <input type="number" name="dialCutDigit" ng-model="vm.ivrCampaign.dialCutDigit" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.ivrCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n            </div>\n            <form name="campaignForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n                <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n                </md-select>\n                <div ng-messages="campaignForm[\'SquareProjectId\'].$error" ng-show="campaignForm[\'SquareProjectId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n                <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n                <div ng-messages="campaignForm[\'limitCalls\'].$error" ng-show="campaignForm[\'limitCalls\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n            </div>\n            <form name="originateForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n                <input type="text" name="dialOriginateCallerIdName" ng-model="vm.ivrCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n                <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.ivrCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n                <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.ivrCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n                <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n                <input type="number" name="dialOriginateTimeout" ng-model="vm.ivrCampaign.dialOriginateTimeout" min="1" max="999" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n                <input type="text" name="dialPrefix" ng-model="vm.ivrCampaign.dialPrefix" ng-pattern="/^\\d+$/" value="" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n                <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n            </div>\n            <form name="globalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n                <input type="number" name="dialGlobalMaxRetry" ng-model="vm.ivrCampaign.dialGlobalMaxRetry" min="1" max="999" value="4" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n                <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n            </div>\n            <form name="congestionForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n                <input type="number" name="dialCongestionMaxRetry" ng-model="vm.ivrCampaign.dialCongestionMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n                <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n                <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.ivrCampaign.dialCongestionRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n                <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n            </div>\n            <form name="busyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n                <input type="number" name="dialBusyMaxRetry" ng-model="vm.ivrCampaign.dialBusyMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n                <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n                <input type="number" name="dialBusyRetryFrequency" ng-model="vm.ivrCampaign.dialBusyRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n                <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n            </div>\n            <form name="noanswerForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n                <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.ivrCampaign.dialNoAnswerMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n                <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n                <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.ivrCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n                <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container nosuchnumber md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.NOSUCHNUMBER">NOSUCHNUMBER</div>\n            </div>\n            <form name="nosuchnumberForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOSUCHNUMBERMAXRETRY">NoSuchNumberMaxRetry</label>\n                <input type="number" name="dialNoSuchNumberMaxRetry" ng-model="vm.ivrCampaign.dialNoSuchNumberMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERMAXRETRY"></span></div>\n                <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_REQUIRED">NoSuchNumberMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOSUCHNUMBERRETRYTIME">NoSuchNumberRetryTime</label>\n                <input type="number" name="dialNoSuchNumberRetryFrequency" ng-model="vm.ivrCampaign.dialNoSuchNumberRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERRETRYTIME"></span></div>\n                <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_REQUIRED">NoSuchNumberRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container drop md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.DROP">DROP</div>\n            </div>\n            <form name="dropForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DROPMAXRETRY">DropMaxRetry</label>\n                <input type="number" name="dialDropMaxRetry" ng-model="vm.ivrCampaign.dialDropMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DROPMAXRETRY"></span></div>\n                <div ng-messages="dropForm[\'dialDropMaxRetry\'].$error" ng-show="dropForm[\'dialDropMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_REQUIRED">DropMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DROPRETRYTIME">DropRetryTime</label>\n                <input type="number" name="dialDropRetryFrequency" ng-model="vm.ivrCampaign.dialDropRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DROPRETRYTIME"></span></div>\n                <div ng-messages="dropForm[\'dialDropRetryFrequency\'].$error" ng-show="dropForm[\'dialDropRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_REQUIRED">DropRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container abandoned md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ABANDONED">ABANDONED</div>\n            </div>\n            <form name="abandonedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ABANDONEDMAXRETRY">AbandonedMaxRetry</label>\n                <input type="number" name="dialAbandonedMaxRetry" ng-model="vm.ivrCampaign.dialAbandonedMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDMAXRETRY"></span></div>\n                <div ng-messages="abandonedForm[\'dialAbandonedMaxRetry\'].$error" ng-show="abandonedForm[\'dialAbandonedMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_REQUIRED">AbandonedMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ABANDONEDRETRYTIME">AbandonedRetryTime</label>\n                <input type="number" name="dialAbandonedRetryFrequency" ng-model="vm.ivrCampaign.dialAbandonedRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDRETRYTIME"></span></div>\n                <div ng-messages="abandonedForm[\'dialAbandonedRetryFrequency\'].$error" ng-show="abandonedForm[\'dialAbandonedRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_REQUIRED">AbandonedRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container machine md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.MACHINE">MACHINE</div>\n            </div>\n            <form name="machineForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MACHINEMAXRETRY">MachineMaxRetry</label>\n                <input type="number" name="dialMachineMaxRetry" ng-model="vm.ivrCampaign.dialMachineMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINEMAXRETRY"></span></div>\n                <div ng-messages="machineForm[\'dialMachineMaxRetry\'].$error" ng-show="machineForm[\'dialMachineMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_REQUIRED">MachineMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MACHINERETRYTIME">MachineRetryTime</label>\n                <input type="number" name="dialMachineRetryFrequency" ng-model="vm.ivrCampaign.dialMachineRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINERETRYTIME"></span></div>\n                <div ng-messages="machineForm[\'dialMachineRetryFrequency\'].$error" ng-show="machineForm[\'dialMachineRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_REQUIRED">MachineRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container agentreject md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.AGENTREJECT">AGENTREJECT</div>\n            </div>\n            <form name="agentrejectForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTREJECTMAXRETRY">AgentRejectMaxRetry</label>\n                <input type="number" name="dialAgentRejectMaxRetry" ng-model="vm.ivrCampaign.dialAgentRejectMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTMAXRETRY"></span></div>\n                <div ng-messages="agentrejectForm[\'dialAgentRejectMaxRetry\'].$error" ng-show="agentrejectForm[\'dialAgentRejectMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_REQUIRED">AgentRejectMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTREJECTRETRYTIME">AgentRejectRetryTime</label>\n                <input type="number" name="dialAgentRejectRetryFrequency" ng-model="vm.ivrCampaign.dialAgentRejectRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTRETRYTIME"></span></div>\n                <div ng-messages="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$error" ng-show="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_REQUIRED">AgentRejectRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n                <md-select name="dialOrderByScheduledAt" ng-model="vm.ivrCampaign.dialOrderByScheduledAt" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n                  <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n                <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n            </div>\n            <form name="globalintervalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n                <input type="text" name="dialGlobalInterval" ng-model="vm.ivrCampaign.dialGlobalInterval" value="07:00-22:00,*,*,*" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n                <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n            </div>\n            <form name="timezoneForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n                <ms-timezone name="dialTimezone" ng-model="vm.ivrCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n                <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="ivrCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n            </div>\n            <form name="amdForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.ivrCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n                <input type="number" name="dialAMDInitialSilence" ng-model="vm.ivrCampaign.dialAMDInitialSilence" min="0" value="2500" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n                <input type="number" name="dialAMDGreeting" ng-model="vm.ivrCampaign.dialAMDGreeting" min="0" value="1500" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n                <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n                <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.ivrCampaign.dialAMDAfterGreetingSilence" min="0" value="800" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n                <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.ivrCampaign.dialAMDTotalAnalysisTime" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n                <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n                <input type="number" name="dialAMDMinWordLength" ng-model="vm.ivrCampaign.dialAMDMinWordLength" min="0" value="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n                <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.ivrCampaign.dialAMDBetweenWordsSilence" min="0" value="50" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n                <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.ivrCampaign.dialAMDMaximumNumberOfWords" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n                <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.ivrCampaign.dialAMDSilenceThreshold" min="0" max="32767" value="256" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n                <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n                <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.ivrCampaign.dialAMDMaximumWordLength" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.ivrCampaign)">\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_hs.init(vm.ivrCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              \x3c!-- WIDGET GROUP --\x3e\n              <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n                \x3c!-- WIDGET 1 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 1 --\x3e\n\n                \x3c!-- WIDGET 2 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 2 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n              </div>\n              \x3c!-- / WIDGET GROUP --\x3e\n            </div>\n\n          </div>\n          <div class="ivrCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHoppers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n                  <ms-search-bar on-search="vm_dc.getIvrCampaignHoppers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHoppers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIvrCampaignHoppers.length}} {{vm_dc.selectedIvrCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHoppers" csv-label="true" filename="ivrCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIvrCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHoppers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHoppers">\n                    <tr md-row>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="phone">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countcongestionretry">\n                        {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countbusyretry">\n                        {{ \'MOTIONDIALER.BUSY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnoanswerretry">\n                        {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnosuchnumberretry">\n                        {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countdropretry">\n                        {{ \'MOTIONDIALER.DROP\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countabandonedretry">\n                        {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countmachineretry">\n                        {{ \'MOTIONDIALER.MACHINE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countagentrejectretry">\n                        {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="scheduledat">\n                        {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="priority">\n                        {{ \'MOTIONDIALER.PRIORITY\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.ivrCampaignHoppers.rows">\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.ContactId}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell privacy ng-cloak>\n                        {{hopper.phone}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countcongestionretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countbusyretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countnoanswerretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countnosuchnumberretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countdropretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countabandonedretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countmachineretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countagentrejectretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{ hopper.scheduledat | formatdate }}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n                        {{ vm_dc.arraypriority[hopper.priority].option }} </td>\n\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n                                Edit Hopper\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n                                Delete Hopper\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.ivrCampaignHoppers.rows.length">\n                      <td md-cell colspan="15">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHoppers.count}}" md-on-paginate="vm_dc.getIvrCampaignHoppers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperHistories.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n                  <ms-search-bar on-search="vm_dc.getIvrCampaignHopperHistories()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperHistories.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperHistories.length}} {{vm_dc.selectedIvrCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperHistories" csv-label="true" filename="ivrCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperHistories" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperHistories">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">\n                        {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridname">\n                        {{ \'MOTIONDIALER.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="statedesc">\n                        {{ \'MOTIONDIALER.STATUS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="scheduledat">\n                        {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.ivrCampaignHopperHistories.rows">\n                      <td md-cell>\n                        {{hopperHistory.uniqueid}}\n                      </td>\n                      <td md-cell>\n                        {{hopperHistory.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperHistory.calleridnum}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperHistory.calleridname}}\n                      </td>\n                      <td md-cell>\n                        {{hopperHistory.statedesc}}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.scheduledat | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.endtime | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.ivrCampaignHopperHistories.rows.length">\n                      <td md-cell colspan="11">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperHistories" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.FINAL">FINAL</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperFinals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n                  <ms-search-bar on-search="vm_dc.getIvrCampaignHopperFinals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                  <td md-cell class="actions">\n                    <md-menu>\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsIvrCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n                        <md-icon md-font-icon="icon-backup-restore"></md-icon>\n                        <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(3)">\n                            <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n                            <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(5)">\n                            <span translate="MOTIONDIALER.BUSY ">Busy</span>\n                            <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(8)">\n                            <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n                            <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(10)">\n                            <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n                            <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(11)">\n                            <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n                            <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(22)">\n                            <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n                            <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(0)">\n                            <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n                            <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item>\n                          <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(19)">\n                            <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n                            <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </td>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperFinals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperFinals.length}} {{vm_dc.selectedIvrCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperFinals" csv-label="true" filename="ivrCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedIvrCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="MOTIONDIALER.MOVE_SELECTED">\n                    <md-icon md-font-icon="icon-restore"></md-icon>\n                    <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperFinals" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperFinals">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">\n                        {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridname">\n                        {{ \'MOTIONDIALER.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="statedesc">\n                        {{ \'MOTIONDIALER.STATUS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countcongestionretry">\n                        {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countbusyretry">\n                        {{ \'MOTIONDIALER.BUSY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnoanswerretry">\n                        {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnosuchnumberretry">\n                        {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countdropretry">\n                        {{ \'MOTIONDIALER.DROP\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countabandonedretry">\n                        {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countmachineretry">\n                        {{ \'MOTIONDIALER.MACHINE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countagentrejectretry">\n                        {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="disposition">\n                        {{ \'MOTIONDIALER.DISPOSITION\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.ivrCampaignHopperFinals.rows">\n                      <td md-cell>\n                        {{hopperFinal.uniqueid}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperFinal.calleridnum}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperFinal.calleridname}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.statedesc}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countcongestionretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countbusyretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countnoanswerretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countnosuchnumberretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countdropretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countabandonedretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countmachineretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countagentrejectretry}}\n                      </td>\n                      <td md-cell>\n                        {{ hopperFinal.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperFinal.endtime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.disposition}}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n                                Move HopperFinal\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.ivrCampaignHopperFinals.rows.length">\n                      <td md-cell colspan="28">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperFinals" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="ivrCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IvrCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperBlacks.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n                  <ms-search-bar on-search="vm_dc.getIvrCampaignHopperBlacks()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperBlacks.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperBlacks.length}} {{vm_dc.selectedIvrCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperBlacks" csv-label="true" filename="ivrCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperBlacks" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperBlacks">\n                    <tr md-row>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="phone">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.ivrCampaignHopperBlacks.rows">\n                      <td md-cell>\n                        {{hopperBlack.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperBlack.phone}}\n                      </td>\n                      <td md-cell class="actions">\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.ivrCampaignHopperBlacks.rows.length">\n                      <td md-cell colspan="4">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperBlacks" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",'<div id="ivrCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MOTIONDIALER.IVRCAMPAIGNS">IvrCampaigns</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedIvrCampaigns.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedIvrCampaigns =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MOTIONDIALER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-ivrCampaigns-count">\n          <span>{{vm.selectedIvrCampaigns.length}}</span>\n          <span translate="MOTIONDIALER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MOTIONDIALER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllIvrCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectIvrCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedIvrCampaigns" csv-label="true" filename="ivrCampaigns.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIvrCampaigns($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- IVRCAMPAIGN TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedIvrCampaigns" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIvrCampaigns">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n                <th md-column md-order-by="SquareProjectId">{{ \'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.ivrCampaigns.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="ivrCampaign" md-select-id="id" ng-repeat="ivrCampaign in vm.ivrCampaigns.rows">\n                <td md-cell ng-if="ivrCampaign.userpic"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="api/users/{{ivrCampaign.id}}/avatar" /></td>\n                <td md-cell ng-if="!ivrCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="id ">{{ivrCampaign.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="name ">{{ivrCampaign.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="active ">\n                  <md-icon md-colors="{color: {{ivrCampaign.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{ivrCampaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':ivrCampaign.TrunkId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="SquareProjectId ">{{ (vm.projects | filter : {\'id\':ivrCampaign.SquareProjectId} : true)[0].name }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(ivrCampaign, $event    )" translate="MOTIONDIALER.EDIT_IVRCAMPAIGN">\n                          Edit IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(ivrCampaign, $event    )" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n                          clone IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.listadddialog(ivrCampaign, $event    )" translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">\n                          listadd IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.blacklistadddialog(ivrCampaign, $event    )" translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">\n                          blacklistadd IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(ivrCampaign, $event    )" translate="MOTIONDIALER.DELETE_IVRCAMPAIGN">\n                          Delete IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(ivrCampaign, $event    )" translate="MOTIONDIALER.GOTOREALTIME_IVRCAMPAIGN">\n                          goToRealtime IvrCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.ivrCampaigns.count}}" md-on-paginate="vm.getIvrCampaigns" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / IVRCAMPAIGN TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD IVRCAMPAIGN BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-ivrCampaign-button" ng-click="vm.createOrEditIvrCampaign($event)" aria-label="add ivrCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD IVRCAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",'<md-dialog class="queueCampaign-dialog" aria-label="New QueueCampaign">\n  <form name="queueCampaignForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n        <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n        <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n          <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n        </md-select>\n        <div ng-messages="queueCampaignForm[\'TrunkId\'].$error" ng-show="queueCampaignForm[\'TrunkId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n        <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n        <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n          <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n        </md-select>\n        <div ng-messages="queueCampaignForm[\'IntervalId\'].$error" ng-show="queueCampaignForm[\'IntervalId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n        <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n          <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n          <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n          <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="queueCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="queueCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.METHOD">Method</label>\n        <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required>\n          <md-option ng-value="\'progressive\'">Progressive</md-option>\n          <md-option ng-value="\'power\'">PowerDialing</md-option>\n          <md-option ng-value="\'predictive\'">Predictive</md-option>\n          <md-option ng-value="\'preview\'">Preview</md-option>\n          <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n        <div ng-messages="queueCampaignForm[\'dialMethod\'].$error" ng-show="queueCampaignForm[\'dialMethod\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n        <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n        <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent"></md-slider>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n        <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n        <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n          <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n          <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n        <div ng-messages="queueCampaignForm[\'dialPredictiveOptimization\'].$error" ng-show="queueCampaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n        <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n        <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent"></md-slider>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n        <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n        <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent"></md-slider>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n        <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n        <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" value="0" ng-required="true">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n        <div ng-messages="queueCampaignForm[\'dialLimitQueue\'].$error" ng-show="queueCampaignForm[\'dialLimitQueue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n        <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n        <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" value="3" ng-required="true">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n        <div ng-messages="queueCampaignForm[\'dialQueueTimeout\'].$error" ng-show="queueCampaignForm[\'dialQueueTimeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n        <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" value="3" ng-required="true">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n        <div ng-messages="queueCampaignForm[\'timeout\'].$error" ng-show="queueCampaignForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.queueCampaign.description">\n\n        <div ng-messages="queueCampaignForm[\'description\'].$error" ng-show="queueCampaignForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newQueueCampaign" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid || queueCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newQueueCampaign" ng-click="vm.addNewQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n          ADD QUEUECAMPAIGN\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newQueueCampaign" ng-click="vm.deleteQueueCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">Add Agent to queueCampaign</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin">\n        <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n      <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n        <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",'<md-dialog class="queueCampaign-dialog" aria-label="Clone QueueCampaign">\n  <form name="queueCampaignForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n        <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n        <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n        CLONE QUEUECAMPAIGN\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n  <form name="hopperForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div class="md-block">\n        <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.dateTime" ng-change="vm.recalcTZTime()">\n              <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.dateTime" ng-change="vm.recalcTZTime()">\n              <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </md-content>\n      </div>\n      <div layout="row">\n        <div flex class="md-block">\n          <md-input-container class="md-block" flex-gt-sm="">\n            <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n            <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n          </md-input-container>\n        </div>\n        <div flex class="md-block">\n          <md-input-container class="md-block">\n            <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n            <input type="text" readonly value="{{vm.hopper.scheduledat}}">\n          </md-input-container>\n        </div>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n        <md-select name="priority" ng-model="vm.hopper.priority">\n          <md-option ng-value="\'4\'">Highest</md-option>\n          <md-option ng-value="\'3\'">High</md-option>\n          <md-option ng-value="\'2\'">Medium</md-option>\n          <md-option ng-value="\'1\'">Low</md-option>\n          <md-option ng-value="\'0\'">Lowest</md-option>\n        </md-select>\n        <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n        <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n        <label translate="MOTIONDIALER.AGENT">Agent</label>\n        <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n          <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n        </md-select>\n        <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n          ADD HOPPER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n      <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n        <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content ng-hide="vm.loading">\n      <div layout="row" layout-wrap flex>\n        <div flex-xs flex="50">\n          <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n            <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n            <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n          </md-checkbox>\n        </div>\n        <div flex-xs flex="50">\n        </div>\n        <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n          <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n            {{ item.name | limitTo:40 }}\n          </md-checkbox>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n      <div>\n      </div>\n      <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n    <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n      <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n    </div>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n  <form name="queueCampaignForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="MOTIONDIALER.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin">\n        <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",'<div id="motiondialer-queueCampaign" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-queueCampaigns-button md-icon-button" aria-label="Go to queueCampaigns" ng-click="vm.gotoQueueCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_QUEUECAMPAIGNS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="queueCampaign-image" hide-xs>\n          <img ng-src="assets/images/business/queueCampaigns.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.queueCampaign.id}}\n            <span ng-if="vm.queueCampaign.name">{{vm.queueCampaign.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.queueCampaign.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.listadddialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n        <md-tooltip><span translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.blacklistadddialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n        <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-block-helper"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.queueCampaign, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.queueCampaign, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.resetlistdialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n        <md-tooltip><span translate="MOTIONDIALER.RESETLIST_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-restore"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="MOTIONDIALER.GOTO_QUEUECAMPAIGN"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveQueueCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (queueForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (nosuchnumberForm.$invalid) || (dropForm.$invalid) || (abandonedForm.$invalid) || (machineForm.$invalid) || (agentrejectForm.$invalid) || (advancedForm.$invalid) || (advancedpreviewForm.$invalid) || (thresholdsForm.$invalid) || (recallmeForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n                <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n                <md-select name="TrunkBackupId" ng-model="vm.queueCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n                <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n                <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n                <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n                  <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n                  <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n                <input type="number" name="dialCutDigit" ng-model="vm.queueCampaign.dialCutDigit" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.queueCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n            </div>\n            <form name="campaignForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.METHOD">Method</label>\n                <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'progressive\'">Progressive</md-option>\n                  <md-option ng-value="\'power\'">PowerDialing</md-option>\n                  <md-option ng-value="\'predictive\'">Predictive</md-option>\n                  <md-option ng-value="\'preview\'">Preview</md-option>\n                  <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n                <div ng-messages="campaignForm[\'dialMethod\'].$error" ng-show="campaignForm[\'dialMethod\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n                <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent"></md-slider>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n                <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n                  <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n                <div ng-messages="campaignForm[\'dialPredictiveOptimization\'].$error" ng-show="campaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent"></md-slider>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent"></md-slider>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n                <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n                <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n                <div ng-messages="campaignForm[\'dialLimitQueue\'].$error" ng-show="campaignForm[\'dialLimitQueue\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n                <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" value="3" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n                <div ng-messages="campaignForm[\'timeout\'].$error" ng-show="campaignForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container queue md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.QUEUE">QUEUE</div>\n            </div>\n            <form name="queueForm" novalidate>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.QUEUEOPTIONS">QueueOptions</label>\n                <input type="text" name="dialQueueOptions" ng-model="vm.queueCampaign.dialQueueOptions" value="tTxX" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="queueForm[\'dialQueueOptions\'].$error" ng-show="queueForm[\'dialQueueOptions\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.QUEUEOPTIONS_REQUIRED">QueueOptions field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n                <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" value="3" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n                <div ng-messages="queueForm[\'dialQueueTimeout\'].$error" ng-show="queueForm[\'dialQueueTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'booked\' || vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.queueCampaign.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n                  <md-option ng-value="\'roundrobin\'" ng-if="vm.queueCampaign.dialMethod === \'booked\'">Round Robin</md-option>\n                  <md-option ng-value="\'leastrecent\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Least Recent</md-option>\n                  <md-option ng-value="\'fewestcalls\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Fewest Calls</md-option>\n                  <md-option ng-value="\'random\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Random</md-option>\n                  <md-option ng-value="\'linear\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Linear</md-option>\n                  <md-option ng-value="\'wrandom\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Weight Random</md-option>\n                </md-select>\n                <div ng-messages="queueForm[\'strategy\'].$error" ng-show="queueForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.RETRY">Retry</label>\n                <input type="number" name="retry" ng-model="vm.queueCampaign.retry" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RETRY"></span></div>\n                <div ng-messages="queueForm[\'retry\'].$error" ng-show="queueForm[\'retry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.WRAPUPTIME">WrapupTime</label>\n                <input type="number" name="wrapuptime" ng-model="vm.queueCampaign.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.WRAPUPTIME"></span></div>\n                <div ng-messages="queueForm[\'wrapuptime\'].$error" ng-show="queueForm[\'wrapuptime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.WEIGHT">Weight</label>\n                <input type="number" name="weight" ng-model="vm.queueCampaign.weight" min="0" value="1" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.WEIGHT"></span></div>\n                <div ng-messages="queueForm[\'weight\'].$error" ng-show="queueForm[\'weight\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.MUSICONHOLD">MusicOnHold</label>\n                <md-select name="musiconhold" ng-model="vm.queueCampaign.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MUSICONHOLD"></span></div>\n                <div ng-messages="queueForm[\'musiconhold\'].$error" ng-show="queueForm[\'musiconhold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n                <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT"></span></div>\n                <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECT2">CallySquareProject2</label>\n                <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT2"></span></div>\n                <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT2_REQUIRED">CallySquareProject2 field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW">CallySquareProjectPreview</label>\n                <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW"></span></div>\n                <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW_REQUIRED">CallySquareProjectPreview field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n                <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW2">CallySquareProjectPreview2</label>\n                <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">None</md-option>\n                  <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW2"></span></div>\n                <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW2_REQUIRED">CallySquareProjectPreview2 field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialQueueProject2 && (vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\')" class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialAgiAfterHangupAgent" aria-label="RunIfHangupAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.RUNIFHANGUPAGENT">RunIfHangupAgent</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RUNIFHANGUPAGENT"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n            </div>\n            <form name="originateForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n                <input type="text" name="dialOriginateCallerIdName" ng-model="vm.queueCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n                <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.queueCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n                <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.queueCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n                <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n                <input type="number" name="dialOriginateTimeout" ng-model="vm.queueCampaign.dialOriginateTimeout" min="1" max="999" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n                <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n                <input type="text" name="dialPrefix" ng-model="vm.queueCampaign.dialPrefix" ng-pattern="/^\\d+$/" value="" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n                <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n            </div>\n            <form name="globalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n                <input type="number" name="dialGlobalMaxRetry" ng-model="vm.queueCampaign.dialGlobalMaxRetry" min="1" max="999" value="4" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n                <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n            </div>\n            <form name="congestionForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n                <input type="number" name="dialCongestionMaxRetry" ng-model="vm.queueCampaign.dialCongestionMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n                <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n                <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.queueCampaign.dialCongestionRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n                <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n            </div>\n            <form name="busyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n                <input type="number" name="dialBusyMaxRetry" ng-model="vm.queueCampaign.dialBusyMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n                <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n                <input type="number" name="dialBusyRetryFrequency" ng-model="vm.queueCampaign.dialBusyRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n                <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n            </div>\n            <form name="noanswerForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n                <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.queueCampaign.dialNoAnswerMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n                <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n                <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.queueCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n                <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container nosuchnumber md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.NOSUCHNUMBER">NOSUCHNUMBER</div>\n            </div>\n            <form name="nosuchnumberForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOSUCHNUMBERMAXRETRY">NoSuchNumberMaxRetry</label>\n                <input type="number" name="dialNoSuchNumberMaxRetry" ng-model="vm.queueCampaign.dialNoSuchNumberMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERMAXRETRY"></span></div>\n                <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_REQUIRED">NoSuchNumberMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.NOSUCHNUMBERRETRYTIME">NoSuchNumberRetryTime</label>\n                <input type="number" name="dialNoSuchNumberRetryFrequency" ng-model="vm.queueCampaign.dialNoSuchNumberRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERRETRYTIME"></span></div>\n                <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_REQUIRED">NoSuchNumberRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container drop md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.DROP">DROP</div>\n            </div>\n            <form name="dropForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DROPMAXRETRY">DropMaxRetry</label>\n                <input type="number" name="dialDropMaxRetry" ng-model="vm.queueCampaign.dialDropMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DROPMAXRETRY"></span></div>\n                <div ng-messages="dropForm[\'dialDropMaxRetry\'].$error" ng-show="dropForm[\'dialDropMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_REQUIRED">DropMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DROPRETRYTIME">DropRetryTime</label>\n                <input type="number" name="dialDropRetryFrequency" ng-model="vm.queueCampaign.dialDropRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DROPRETRYTIME"></span></div>\n                <div ng-messages="dropForm[\'dialDropRetryFrequency\'].$error" ng-show="dropForm[\'dialDropRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_REQUIRED">DropRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container abandoned md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ABANDONED">ABANDONED</div>\n            </div>\n            <form name="abandonedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ABANDONEDMAXRETRY">AbandonedMaxRetry</label>\n                <input type="number" name="dialAbandonedMaxRetry" ng-model="vm.queueCampaign.dialAbandonedMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDMAXRETRY"></span></div>\n                <div ng-messages="abandonedForm[\'dialAbandonedMaxRetry\'].$error" ng-show="abandonedForm[\'dialAbandonedMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_REQUIRED">AbandonedMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.ABANDONEDRETRYTIME">AbandonedRetryTime</label>\n                <input type="number" name="dialAbandonedRetryFrequency" ng-model="vm.queueCampaign.dialAbandonedRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDRETRYTIME"></span></div>\n                <div ng-messages="abandonedForm[\'dialAbandonedRetryFrequency\'].$error" ng-show="abandonedForm[\'dialAbandonedRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_REQUIRED">AbandonedRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container machine md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.MACHINE">MACHINE</div>\n            </div>\n            <form name="machineForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MACHINEMAXRETRY">MachineMaxRetry</label>\n                <input type="number" name="dialMachineMaxRetry" ng-model="vm.queueCampaign.dialMachineMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINEMAXRETRY"></span></div>\n                <div ng-messages="machineForm[\'dialMachineMaxRetry\'].$error" ng-show="machineForm[\'dialMachineMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_REQUIRED">MachineMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MACHINERETRYTIME">MachineRetryTime</label>\n                <input type="number" name="dialMachineRetryFrequency" ng-model="vm.queueCampaign.dialMachineRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINERETRYTIME"></span></div>\n                <div ng-messages="machineForm[\'dialMachineRetryFrequency\'].$error" ng-show="machineForm[\'dialMachineRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_REQUIRED">MachineRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container agentreject md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.AGENTREJECT">AGENTREJECT</div>\n            </div>\n            <form name="agentrejectForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTREJECTMAXRETRY">AgentRejectMaxRetry</label>\n                <input type="number" name="dialAgentRejectMaxRetry" ng-model="vm.queueCampaign.dialAgentRejectMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTMAXRETRY"></span></div>\n                <div ng-messages="agentrejectForm[\'dialAgentRejectMaxRetry\'].$error" ng-show="agentrejectForm[\'dialAgentRejectMaxRetry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_REQUIRED">AgentRejectMaxRetry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>999</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AGENTREJECTRETRYTIME">AgentRejectRetryTime</label>\n                <input type="number" name="dialAgentRejectRetryFrequency" ng-model="vm.queueCampaign.dialAgentRejectRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTRETRYTIME"></span></div>\n                <div ng-messages="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$error" ng-show="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_REQUIRED">AgentRejectRetryTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>99999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n                <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n                <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n                <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.AUTOPAUSE">AutoPause</label>\n                <md-select name="autopause" ng-model="vm.queueCampaign.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'all\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AUTOPAUSE"></span></div>\n                <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.RINGINUSE">RingInUse</label>\n                <md-select name="ringinuse" ng-model="vm.queueCampaign.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.RINGINUSE"></span></div>\n                <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MEMBERDELAY">MemberDelay</label>\n                <input type="number" name="memberdelay" ng-model="vm.queueCampaign.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MEMBERDELAY"></span></div>\n                <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TIMEOUTRESTART">TimeoutRestart</label>\n                <md-select name="timeoutrestart" ng-model="vm.queueCampaign.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEOUTRESTART"></span></div>\n                <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n                <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Inactive</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'wav49\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n                <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CONTEXT">Context</label>\n                <input type="text" name="context" ng-model="vm.queueCampaign.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.CONTEXT"></span></div>\n                <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n                <md-select name="setinterfacevar" ng-model="vm.queueCampaign.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.SETINTERFACEVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.SETQUEUEVARIABLES">SetQueueVariables</label>\n                <md-select name="setqueuevar" ng-model="vm.queueCampaign.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n                <md-select name="setqueueentryvar" ng-model="vm.queueCampaign.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n                <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n                  <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n                <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n                <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="queueCampaign-detail-form-container advancedpreview md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCEDPREVIEW">ADVANCEDPREVIEW</div>\n            </div>\n            <form name="advancedpreviewForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n                <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n                <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n                <div ng-messages="advancedpreviewForm[\'acwTimeout\'].$error" ng-show="advancedpreviewForm[\'acwTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n                <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Inactive</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'wav49\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n                <div ng-messages="advancedpreviewForm[\'monitor_format\'].$error" ng-show="advancedpreviewForm[\'monitor_format\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n                <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n                  <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n                <div ng-messages="advancedpreviewForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedpreviewForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n                <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod === \'predictive\'" class="queueCampaign-detail-form-container thresholds md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.THRESHOLDS">THRESHOLDS</div>\n            </div>\n            <form name="thresholdsForm" novalidate>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <span translate="MOTIONDIALER.PREDICTIVEMAXTHRESHOLD">PredictiveMaxThreshold</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEMAXTHRESHOLD"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveIntervalMaxThreshold" min="1" max="100" step="1" class="md-accent"></md-slider>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n                <span translate="MOTIONDIALER.PREDICTIVEMINTHRESHOLD">PredictiveMinThreshold</span>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEMINTHRESHOLD"></span></div>\n                <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveIntervalMinThreshold" min="1" max="100" step="1" class="md-accent"></md-slider>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="queueCampaign-detail-form-container recallme md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.RECALLME">RECALLME</div>\n            </div>\n            <form name="recallmeForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.DIALRECALLMETIMEOUT">DialRecallMeTimeout</label>\n                <input type="number" name="dialRecallMeTimeout" ng-model="vm.queueCampaign.dialRecallMeTimeout" min="1" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLMETIMEOUT"></span></div>\n                <div ng-messages="recallmeForm[\'dialRecallMeTimeout\'].$error" ng-show="recallmeForm[\'dialRecallMeTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_REQUIRED">DialRecallMeTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DialRecallMeTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialRecallInQueue" aria-label="DialRecallInQueue" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.DIALRECALLINQUEUE">DialRecallInQueue</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLINQUEUE"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'preview\'" class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialPreviewAutoRecallMe" aria-label="Preview_Auto_Recall_Me" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.PREVIEW_AUTO_RECALL_ME">Preview_Auto_Recall_Me</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREVIEW_AUTO_RECALL_ME"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialMethod == \'preview\'" class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialPreviewRecallmeReminder" aria-label="Preview_Recall_Me_Reminder" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.PREVIEW_RECALL_ME_REMINDER">Preview_Recall_Me_Reminder</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.PREVIEW_RECALL_ME_REMINDER"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n            </div>\n            <form name="globalintervalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n                <input type="text" name="dialGlobalInterval" ng-model="vm.queueCampaign.dialGlobalInterval" value="07:00-22:00,*,*,*" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n                <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n            </div>\n            <form name="timezoneForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n                <ms-timezone name="dialTimezone" ng-model="vm.queueCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n                <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n            </div>\n            <form name="amdForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.queueCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n                <input type="number" name="dialAMDInitialSilence" ng-model="vm.queueCampaign.dialAMDInitialSilence" min="0" value="2500" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n                <input type="number" name="dialAMDGreeting" ng-model="vm.queueCampaign.dialAMDGreeting" min="0" value="1500" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n                <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n                <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.queueCampaign.dialAMDAfterGreetingSilence" min="0" value="800" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n                <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.queueCampaign.dialAMDTotalAnalysisTime" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n                <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n                <input type="number" name="dialAMDMinWordLength" ng-model="vm.queueCampaign.dialAMDMinWordLength" min="0" value="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n                <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.queueCampaign.dialAMDBetweenWordsSilence" min="0" value="50" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n                <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n                <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.queueCampaign.dialAMDMaximumNumberOfWords" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n                <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.queueCampaign.dialAMDSilenceThreshold" min="0" max="32767" value="256" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n                <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n                <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n                <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.queueCampaign.dialAMDMaximumWordLength" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n                <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.queueCampaign)">\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_hs.init(vm.queueCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              \x3c!-- WIDGET GROUP --\x3e\n              <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n                \x3c!-- WIDGET 1 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 1 --\x3e\n\n                \x3c!-- WIDGET 2 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 2 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n                      <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n              </div>\n              \x3c!-- / WIDGET GROUP --\x3e\n            </div>\n\n          </div>\n          <div class="queueCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHoppers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n                  <ms-search-bar on-search="vm_dc.getQueueCampaignHoppers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHoppers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedQueueCampaignHoppers.length}} {{vm_dc.selectedQueueCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHoppers" csv-label="true" filename="queueCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedQueueCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHoppers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHoppers">\n                    <tr md-row>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="phone">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countcongestionretry">\n                        {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countbusyretry">\n                        {{ \'MOTIONDIALER.BUSY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnoanswerretry">\n                        {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnosuchnumberretry">\n                        {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countdropretry">\n                        {{ \'MOTIONDIALER.DROP\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countabandonedretry">\n                        {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countmachineretry">\n                        {{ \'MOTIONDIALER.MACHINE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countagentrejectretry">\n                        {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="scheduledat">\n                        {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="priority">\n                        {{ \'MOTIONDIALER.PRIORITY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="recallme">\n                        {{ \'MOTIONDIALER.RECALLAGENT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.queueCampaignHoppers.rows">\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.ContactId}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell privacy ng-cloak>\n                        {{hopper.phone}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countcongestionretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countbusyretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countnoanswerretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countnosuchnumberretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countdropretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countabandonedretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countmachineretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{hopper.countagentrejectretry}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{ hopper.scheduledat | formatdate }}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n                        {{ vm_dc.arraypriority[hopper.priority].option }} </td>\n\n                      <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell class="recallme ">\n                        <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n                                Edit Hopper\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n                                Delete Hopper\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.queueCampaignHoppers.rows.length">\n                      <td md-cell colspan="17">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHoppers.count}}" md-on-paginate="vm_dc.getQueueCampaignHoppers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperHistories.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n                  <ms-search-bar on-search="vm_dc.getQueueCampaignHopperHistories()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperHistories.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperHistories.length}} {{vm_dc.selectedQueueCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperHistories" csv-label="true" filename="queueCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperHistories" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperHistories">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">\n                        {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridname">\n                        {{ \'MOTIONDIALER.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="statedesc">\n                        {{ \'MOTIONDIALER.STATUS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="scheduledat">\n                        {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.queueCampaignHopperHistories.rows">\n                      <td md-cell>\n                        {{hopperHistory.uniqueid}}\n                      </td>\n                      <td md-cell>\n                        {{hopperHistory.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperHistory.calleridnum}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperHistory.calleridname}}\n                      </td>\n                      <td md-cell>\n                        {{hopperHistory.statedesc}}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.scheduledat | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperHistory.endtime | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.queueCampaignHopperHistories.rows.length">\n                      <td md-cell colspan="11">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperHistories" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.FINAL">FINAL</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperFinals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n                  <ms-search-bar on-search="vm_dc.getQueueCampaignHopperFinals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                  <td md-cell class="actions">\n                    <md-menu>\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsQueueCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n                        <md-icon md-font-icon="icon-backup-restore"></md-icon>\n                        <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n                      </md-button>\n                      <md-menu-content width="3">\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(3)">\n                            <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n                            <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(5)">\n                            <span translate="MOTIONDIALER.BUSY ">Busy</span>\n                            <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(8)">\n                            <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n                            <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(10)">\n                            <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n                            <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(11)">\n                            <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n                            <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(22)">\n                            <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n                            <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(0)">\n                            <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n                            <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n                          </md-button>\n                        </md-menu-item>\n                        <md-menu-item>\n                          <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(19)">\n                            <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n                            <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </td>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperFinals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperFinals.length}} {{vm_dc.selectedQueueCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperFinals" csv-label="true" filename="queueCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedQueueCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="MOTIONDIALER.MOVE_SELECTED">\n                    <md-icon md-font-icon="icon-restore"></md-icon>\n                    <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperFinals" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperFinals">\n                    <tr md-row>\n                      <th md-column md-order-by="uniqueid">\n                        {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridnum">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="calleridname">\n                        {{ \'MOTIONDIALER.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="statedesc">\n                        {{ \'MOTIONDIALER.STATUS\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countcongestionretry">\n                        {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countbusyretry">\n                        {{ \'MOTIONDIALER.BUSY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnoanswerretry">\n                        {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countnosuchnumberretry">\n                        {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countdropretry">\n                        {{ \'MOTIONDIALER.DROP\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countabandonedretry">\n                        {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countmachineretry">\n                        {{ \'MOTIONDIALER.MACHINE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="countagentrejectretry">\n                        {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="starttime">\n                        {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="endtime">\n                        {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="disposition">\n                        {{ \'MOTIONDIALER.DISPOSITION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="secondDisposition">\n                        {{ \'MOTIONDIALER.SECOND_LEVEL_DISPOSITION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="thirdDisposition">\n                        {{ \'MOTIONDIALER.THIRD_LEVEL_DISPOSITION\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.queueCampaignHopperFinals.rows">\n                      <td md-cell>\n                        {{hopperFinal.uniqueid}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperFinal.calleridnum}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperFinal.calleridname}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.statedesc}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countcongestionretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countbusyretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countnoanswerretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countnosuchnumberretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countdropretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countabandonedretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countmachineretry}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.countagentrejectretry}}\n                      </td>\n                      <td md-cell>\n                        {{ hopperFinal.starttime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{ hopperFinal.endtime | formatdate }}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.disposition}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.secondDisposition}}\n                      </td>\n                      <td md-cell>\n                        {{hopperFinal.thirdDisposition}}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n                                Move HopperFinal\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.queueCampaignHopperFinals.rows.length">\n                      <td md-cell colspan="30">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperFinals" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="queueCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n            <div ng-controller="QueueCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperBlacks.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n                  <ms-search-bar on-search="vm_dc.getQueueCampaignHopperBlacks()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperBlacks.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperBlacks.length}} {{vm_dc.selectedQueueCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperBlacks" csv-label="true" filename="queueCampaigns.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperBlacks" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperBlacks">\n                    <tr md-row>\n                      <th md-column md-order-by="ContactId">\n                        {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="phone">\n                        {{ \'MOTIONDIALER.PHONE\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.queueCampaignHopperBlacks.rows">\n                      <td md-cell>\n                        {{hopperBlack.ContactId}}\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        {{hopperBlack.phone}}\n                      </td>\n                      <td md-cell class="actions">\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.queueCampaignHopperBlacks.rows.length">\n                      <td md-cell colspan="4">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperBlacks" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",'<div id="queueCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="MOTIONDIALER.QUEUECAMPAIGNS">QueueCampaigns</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedQueueCampaigns.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedQueueCampaigns =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="MOTIONDIALER.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-queueCampaigns-count">\n          <span>{{vm.selectedQueueCampaigns.length}}</span>\n          <span translate="MOTIONDIALER.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MOTIONDIALER.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllQueueCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectQueueCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedQueueCampaigns" csv-label="true" filename="queueCampaigns.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedQueueCampaigns($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- QUEUECAMPAIGN TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedQueueCampaigns" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueueCampaigns">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n                <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n                <th md-column md-order-by="dialMethod">{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'MOTIONDIALER.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.queueCampaigns.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="queueCampaign" md-select-id="id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n                <td md-cell ng-if="queueCampaign.userpic"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="api/users/{{queueCampaign.id}}/avatar" /></td>\n                <td md-cell ng-if="!queueCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="id ">{{queueCampaign.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="name ">{{queueCampaign.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialActive ">\n                  <md-icon md-colors="{color: {{queueCampaign.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queueCampaign.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':queueCampaign.TrunkId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialMethod ">{{ vm.arraydialMethod[queueCampaign.dialMethod].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="strategy ">{{ vm.arraystrategy[queueCampaign.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(queueCampaign, $event    )" translate="MOTIONDIALER.EDIT_QUEUECAMPAIGN">\n                          Edit QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(queueCampaign, $event    )" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n                          clone QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.listadddialog(queueCampaign, $event    )" translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">\n                          listadd QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.blacklistadddialog(queueCampaign, $event    )" translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">\n                          blacklistadd QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(queueCampaign, $event    )" translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">\n                          teamadd QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(queueCampaign, $event    )" translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">\n                          agentadd QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(queueCampaign, $event    )" translate="MOTIONDIALER.DELETE_QUEUECAMPAIGN">\n                          Delete QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(queueCampaign, $event    )" translate="MOTIONDIALER.GOTOREALTIME_QUEUECAMPAIGN">\n                          goToRealtime QueueCampaign\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queueCampaigns.count}}" md-on-paginate="vm.getQueueCampaigns" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / QUEUECAMPAIGN TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD QUEUECAMPAIGN BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-queueCampaign-button" ng-click="vm.createOrEditQueueCampaign($event)" aria-label="add queueCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD QUEUECAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n  <div class="md-toolbar-tools" layout="row" layout-align="center center">\n    <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n    <ms-search-bar on-search="vm.getAbandonedCalls()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300">\n    </ms-search-bar>\n    <div flex></div>\n\n    <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getAbandonedCalls()"></ms-quick-filter>\n\n    <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n      <md-icon md-font-icon="icon-reload"></md-icon>\n      <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}\n      </md-tooltip>\n    </md-button>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAbandonedCalls">\n      <tr md-row>\n        <th md-column md-order-by="id">ID</th>\n        <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n        <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n        <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n        <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n        <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n        <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n        <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.abandonedCalls.rows.length">\n        <td md-cell colspan="12">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="call in vm.abandonedCalls.rows">\n        <td md-cell class="id">{{call.id}}</td>\n        <td md-cell class="firstName" privacy ng-cloak>{{call.calleridname}}</td>\n        <td md-cell class="list" privacy ng-cloak>{{call.calleridnum}}</td>\n        <td md-cell class="list">{{vm.queuesMap[call.queue]}}</td>\n        <td md-cell class="list">\n          {{call.queuecallerabandonAt ? (call.queuecallerabandonAt | formatdate) : (call.queuecallerexitAt | formatdate) }}\n        </td>\n        <td md-cell class="list">{{call.queuecallerexitAt ? (call.queuecallerexitAt | formatdate) : undefined }}\n        </td>\n        <td md-cell class="list">{{call.queuecallerexitreason}}</td>\n        <td md-cell class="list">{{call.lastAssignedTo}}</td>\n        <td md-cell class="list">{{ call.disposition }}</td>\n        <td md-cell class="list">{{ call.secondDisposition }}</td>\n        <td md-cell class="list">{{ call.thirdDisposition }}</td>\n        <td md-cell class="actions">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="2">\n              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                <md-menu>\n                  <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">\n                    Assigned\n                    to</md-button>\n                  <md-menu-content>\n                    <md-menu-item ng-if="call.lastAssignedTo">\n                      <md-button ng-click="vm.assignTo(call)"><em translate="DASHBOARDS.NONE">Not Assigned</em>\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n                      <md-button ng-click="vm.assignTo(call,agent)">{{agent.name}}</md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.dispose(call)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">\n                  Dispose\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.abandonedCalls.count}}" md-on-paginate="vm.getAbandonedCalls" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getCampaigns()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCampaigns">\n      <tr md-row>\n        <th md-column>{{\'MOTIONDIALER.NAME\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.TOTAL_MANAGED\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.LIMITED\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.ORIGINATED\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.MESSAGE\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate}}</th>\n        <th md-column>{{\'MOTIONDIALER.TRUNK\' | translate }}</th>\n        <th md-column>{{\'MOTIONDIALER.ACTIVE\' | translate }}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.campaigns">\n        <td md-cell colspan="8">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, campaign) in vm.campaigns">\n        <td md-cell>\n          <span>{{campaign.name}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.ivrTotalCallsDays || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.ivrAnswerCallsDay || 0}} ({{(campaign.ivrTotalCallsDays) ? (campaign.ivrAnswerCallsDay || 0) * 100/(campaign.ivrTotalCallsDays ) : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.limitCalls || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.originated || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.message ? (\'MOTIONDIALER.\'+campaign.message | translate) : \'--\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{campaign.dialQueueProject || \'--\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{campaign.Trunk ? campaign.Trunk.name : \'--\'}}</span>\n        </td>\n        <td md-cell>\n          <md-icon md-colors="{color: {{campaign.active ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{campaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.createOrEditIvrCampaign($event, campaign)" translate="MOTIONDIALER.EDIT_CAMPAIGN">\n                  Edit Campaign\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getCampaigns" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n  </div>\n</md-toolbar>\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n  <table md-table>\n    <thead md-head>\n      <tr md-row>\n        <th md-column width="30px"></th>\n        <th md-column>{{ \'MOTIONDIALER.DID\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.QUEUE\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.CALLER\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.DURATION\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n        <td md-cell>\n          <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n          <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n        </td>\n        <td md-cell>{{channel.exten}}</td>\n        <td md-cell>{{channel.queue}}</td>\n        <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n        <td md-cell>\n          <span ng-if="channel.queuecallerleaveAt">\n            {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n            <span class="text-boxed">\n              <timer start-time="channel.queuecallerleaveAt"></timer>\n            </span>\n          </span>\n          <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n            {{ \'MOTIONDIALER.WAITING_FOR_AGENT\' | translate }}\n            <timer start-time="channel.queuecallerjoinAt"></timer>\n          </span>\n        </td>\n        <td md-cell>\n          <span class="text-boxed">\n            <timer start-time="channel.queuecallerjoinAt"></timer>\n          </span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="2">\n              <md-menu-item>\n                <md-button ng-click="vm.hangup(channel.uniqueid)" translate="MOTIONDIALER.HANGUP">\n                  Hangup\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="MOTIONDIALER.REDIRECT_TO_NUMBER">\n                  Number\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-menu class="no-margin">\n                  <md-button ng-mouseenter="vm.getAvailableAgents()" translate="MOTIONDIALER.REDIRECT_TO_AGENT">\n                    Redirect to Agent</md-button>\n                  <md-menu-content>\n                    <md-menu-item ng-if="!vm.availableAgents">\n                      <md-progress-circular class="md-accent auto-margin" md-diameter="32" md-mode="indeterminate">\n                      </md-progress-circular>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.availableAgents.length > 0" ng-repeat="agent in vm.availableAgents">\n                      <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">\n                        {{agent.name}}</md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.availableAgents.length === 0">\n                      <span>No agents available</span>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column>{{\'\n                                MOTIONDIALER.NAME\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.TOTAL\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.TOTAL_OFFERED\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.MANAGED\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.ABANDONED\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.DROPPED\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.AVG_HOLD_TIME\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.AVG_DURATION\' | translate}}</th>\n        <th md-column>{{\'\n                                MOTIONDIALER.AVG_BILLABLE\' | translate}}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues">\n        <td md-cell colspan="8">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, queue) in vm.queues">\n        <td md-cell>\n          <span>{{queue.name}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{(queue.answered + queue.outboundNoAnswerCallsDay + queue.outboundBusyCallsDay + queue.outboundCongestionCallsDay + queue.outboundNoSuchCallsDay + queue.outboundUnknownCallsDay + queue.outboundDropCallsDayTimeout + queue.outboundDropCallsDayCallersExit + queue.outboundBlacklistCallsDay + queue.outboundOriginateFailureCallsDay + queue.outboundAnswerAgiCallsDay + queue.outboundReCallsDay + queue.outboundRejectCallsDay )|| 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.answered) ? (100 - (((queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total)) | number:1 ) - (((queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total )) | number:1 )  ) : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayCallersExit || 0}} ({{(queue.outboundDropCallsDayCallersExit) ? (queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total ) : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayTimeout || 0}} ({{(queue.outboundDropCallsDayTimeout) ? (queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total) : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queues/predictive/dialog.html",'<md-dialog class="predictive-dialog" aria-label="New predictive">\n  <md-toolbar class="md-accent md-hue-2">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n      <span class="title">{{ vm.queueCampaign.name }} Info</span>\n      <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-dialog-content class="text-center">\n    <ds-widget-clock data-show-digital></ds-widget-clock>\n    <div ng-if="!vm.queueCampaign.startProgressive && !vm.queueCampaign.startPredictive">\n      <div class="md-title"><span translate="MOTIONDIALER.PREDICTIVE_IS_NOT_RUNNING">Predictive is not running</span></div>\n    </div>\n\n    <div ng-if="vm.queueCampaign.startProgressive && !vm.queueCampaign.startPredictive" class="m-10">\n      <div layout="row">\n        <div flex="" class="column">\n          <div class="md-headline"><span translate="MOTIONDIALER.DATA_COLLECTION_IN_PROGRESSIVE">Data collection in progressive</span></div>\n          <div class="md-subhead">({{vm.queueCampaign.dialPredictiveInterval}} minutes)</div>\n        </div>\n      </div>\n\n      <div layout="row">\n        <div flex="" class="column">\n          <div class="md-subhead"><span translate="MOTIONDIALER.STARTTIME">Start Time</span></div>\n          <div class="md-headline">{{ vm.setFormatTime(vm.queueCampaign.startProgressive) }}</div>\n        </div>\n        <div flex="" class="column">\n          <div class="md-subhead"><span translate="MOTIONDIALER.ENDTIME">End Time</span></div>\n          <div class="md-headline">\n            {{ vm.addMinutes(vm.queueCampaign.startProgressive, vm.queueCampaign.dialPredictiveInterval) }}\n          </div>\n        </div>\n      </div>\n      <div>\n        <span class="text-boxed blue-bg white-fg">\n          {{vm.queueCampaign.message ? (\'MOTIONDIALER.\' + vm.queueCampaign.message | translate) : \'--\'}}\n        </span>\n      </div>\n    </div>\n    <div ng-if="vm.queueCampaign.startPredictive" class="m-10">\n      <div layout="row">\n        <div flex="" class="column">\n          <div class="md-headline"><span translate="MOTIONDIALER.PREDICTIVE_IS_RUNNING">Predictive is runnning</span></div>\n          <div class="md-subhead">({{vm.queueCampaign.dialPredictiveInterval}} minutes)</div>\n        </div>\n      </div>\n\n      <div layout="row">\n        <div flex="" class="column">\n          <div class="md-subhead"><span translate="MOTIONDIALER.STARTTIME">Start Time</span></div>\n          <div class="md-headline">{{ vm.setFormatTime(vm.queueCampaign.startPredictive) }}</div>\n        </div>\n        <div flex="" class="column">\n          <div class="md-subhead"><span translate="MOTIONDIALER.ENDTIME">End Time</span></div>\n          <div class="md-headline">\n            {{ vm.addMinutes(vm.queueCampaign.startPredictive, vm.queueCampaign.dialPredictiveInterval) }}\n          </div>\n        </div>\n      </div>\n      <div>\n        <span class="text-boxed blue-bg white-fg">\n          {{vm.queueCampaign.message ? (\'MOTIONDIALER.\' + vm.queueCampaign.message | translate) : \'--\'}}\n        </span>\n      </div>\n      <div class="row">\n        <md-card>\n          <md-toolbar class="md-table-toolbar md-default">\n            <div class="md-toolbar-tools">\n              <span class="md-subhead">Predictive - {{ \'MOTIONDIALER.PREVIOUS_INTERVAL\' | translate }}</span>\n            </div>\n          </md-toolbar>\n          <md-table-container>\n            <table md-table>\n              <tbody md-body>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.TOTAL_CALLS">Total Calls</span></td>\n                  <td md-cell>{{ vm.queueCampaign.predictiveIntervalTotalCalls }}</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.ANSWERED_CALLS">Total Calls</span></td>\n                  <td md-cell>{{ vm.queueCampaign.predictiveIntervalAnsweredCalls }}</td>\n                </tr>\n                \x3c!-- Temporaneamente non mostrate perchè contengono anche i dati dell\'intervallo corrente --\x3e\n                \x3c!-- <tr md-row>\n                                    <td md-cell>Dropped Calls Timeout</td>\n                                    <td md-cell>{{ vm.queueCampaign.predictiveIntervalDroppedCallsTimeout }}</td>\n                                </tr>\n                                <tr md-row>\n                                    <td md-cell>Dropped Calls Caller Exit</td>\n                                    <td md-cell>{{ vm.queueCampaign.predictiveIntervalDroppedCallsCallersExit }}\n                                    </td>\n                                </tr> --\x3e\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.AVG_HOLD_TIME">AVG Hold Time</span></td>\n                  <td md-cell>~ {{ vm.queueCampaign.predictiveIntervalAvgHoldtime | number:0 }}s</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.AVG_TALK_TIME">AVG Talk Time</span></td>\n                  <td md-cell>~ {{ vm.queueCampaign.predictiveIntervalAvgTalktime | number:0 }}s</td>\n                </tr>\n              </tbody>\n            </table>\n          </md-table-container>\n        </md-card>\n        <md-card>\n          <md-toolbar class="md-table-toolbar md-default">\n            <div class="md-toolbar-tools">\n              <span class="md-subhead">ErlangB - {{ \'MOTIONDIALER.CURRENT_INTERVAL\' | translate }}</span>\n            </div>\n          </md-toolbar>\n          <md-table-container>\n            <table md-table>\n              <tbody md-body>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span></td>\n                  <td md-cell>{{ vm.queueCampaign.erlangCalls }}</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.ONE_CALL_EVERY">One call every</span></td>\n                  <td md-cell>~ {{ vm.queueCampaign.erlangCallToSecond | number:0 }}s</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.DROPRATE">Drop Rate</span></td>\n                  <td md-cell>{{ vm.queueCampaign.erlangAbandonmentRate * 100 | number:2 }}%</td>\n                </tr>\n                <tr md-row>\n                  <td md-cell><span translate="MOTIONDIALER.AGENTBUSYFACTOR">Agent Busy Factor</span></td>\n                  <td md-cell>{{ vm.queueCampaign.erlangBusyFactor * 100 | number:2 }}%</td>\n                </tr>\n              </tbody>\n            </table>\n          </md-table-container>\n        </md-card>\n      </div>\n    </div>\n\n\n  </md-dialog-content>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.TALKING\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.WAITING\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.ORIGINATED_TEXT\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.MESSAGE\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n        <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n        <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="12">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedInDb }} ({{ queue.loggedIn }})</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.talking  + queue.pTalking}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedInDb - queue.available - queue.paused - queue.talking - queue.waiting\n               }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.originated }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{ queue.message ? (\'MOTIONDIALER.\'+queue.message | translate) : \'--\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.dialMethod || 0 }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{ queue.Trunk ? queue.Trunk.name : \'--\' }}</span>\n        </td>\n        <td md-cell>\n          <md-icon md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="MOTIONDIALER.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item ng-if="queue.dialMethod == \'predictive\'">\n                <md-button ng-click="vm.showPredictiveQueueCampaignInfo($event, queue)" translate="MOTIONDIALER.SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO">\n                  Show Predictive Info\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="MOTIONDIALER.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.ABANDONEDCALLS">Abandoned Queue Calls</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.QUEUE_PARAMS">Queue Parameters</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelAccount">\n\n        <div ng-messages="openchannelAccountForm[\'name\'].$error" ng-show="openchannelAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="openchannelAccountForm[\'key\'].$error" ng-show="openchannelAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n        <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n\n        <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n        <div ng-messages="openchannelAccountForm[\'replyUri\'].$error" ng-show="openchannelAccountForm[\'replyUri\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n        <div ng-messages="openchannelAccountForm[\'ListId\'].$error" ng-show="openchannelAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n\n        <div ng-messages="openchannelAccountForm[\'description\'].$error" ng-show="openchannelAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelAccount" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid || openchannelAccountForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelAccount" ng-click="vm.addNewOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELACCOUNT" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n          ADD OPENCHANNELACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelAccount" ng-click="vm.deleteOpenchannelAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",'<md-dialog class="openchannelAccount-dialog" aria-label="openchannelAccount" ng-init="vm.onInit()">\n  <form name="openchannelAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">Add Agent to openchannelAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/agent/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'agent\'].$error" ng-show="openchannelAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.ACCESSKEYID">accesskeyid</label>\n        <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'accesskeyid\'].$error" ng-show="openchannelAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.SECRETACCESSKEY">secretaccesskey</label>\n        <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'secretaccesskey\'].$error" ng-show="openchannelAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.LEXREGION">lexregion</label>\n        <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n          <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n          <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n          <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'lexregion\'].$error" ng-show="openchannelAccountFormApp[\'lexregion\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.BOTNAME">botname</label>\n        <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'botname\'].$error" ng-show="openchannelAccountFormApp[\'botname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'times\'].$error" ng-show="openchannelAccountFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TEXT">Text</label>\n        <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n        <div ng-messages="openchannelAccountFormApp[\'text\'].$error" ng-show="openchannelAccountFormApp[\'text\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TEXT_REQUIRED">Text field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/close/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'disposition\'].$error" ng-show="openchannelAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'key\'].$error" ng-show="openchannelAccountFormApp[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n          <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'sv\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'language\'].$error" ng-show="openchannelAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.PROJECTID">ProjectID</label>\n        <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'projectId\'].$error" ng-show="openchannelAccountFormApp[\'projectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.CLIENTEMAIL">ClientEmail</label>\n        <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'clientEmail\'].$error" ng-show="openchannelAccountFormApp[\'clientEmail\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.PRIVATEKEY">PrivateKey</label>\n        <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n        <div ng-messages="openchannelAccountFormApp[\'privateKey\'].$error" ng-show="openchannelAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n          <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n          <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n          <md-option ng-value="\'en-IN\'">English (India)</md-option>\n          <md-option ng-value="\'en-US\'">English (US)</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n          <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'hi\'">Hindi</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pl\'">Polish</md-option>\n          <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n          <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n          <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n          <md-option ng-value="\'sw\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'tr\'">Turkish</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'language\'].$error" ng-show="openchannelAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'condition\'].$error" ng-show="openchannelAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'truepriority\'].$error" ng-show="openchannelAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'falsepriority\'].$error" ng-show="openchannelAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'priority\'].$error" ng-show="openchannelAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/noop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'value\'].$error" ng-show="openchannelAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/queue/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'queue\'].$error" ng-show="openchannelAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/system/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="openchannelAccountFormApp[\'command\'].$error" ng-show="openchannelAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'variable\'].$error" ng-show="openchannelAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/tag/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n  <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="openchannelAccountFormApp[\'tag\'].$error" ng-show="openchannelAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",'<md-dialog class="openchannelCannedAnswer-dialog" aria-label="New OpenchannelCannedAnswer">\n  <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.openchannelCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="openchannelCannedAnswerForm[\'key\'].$error" ng-show="openchannelCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.openchannelCannedAnswer.value" required></textarea>\n\n        <div ng-messages="openchannelCannedAnswerForm[\'value\'].$error" ng-show="openchannelCannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.openchannelCannedAnswer.description">\n\n        <div ng-messages="openchannelCannedAnswerForm[\'description\'].$error" ng-show="openchannelCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelCannedAnswer" ng-click="vm.saveOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelCannedAnswer" ng-click="vm.addNewOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n          ADD OPENCHANNELCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelCannedAnswer" ng-click="vm.deleteOpenchannelCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",'<div id="openchannel-openchannelAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-openchannelAccounts-button md-icon-button" aria-label="Go to openchannelAccounts" ng-click="vm.gotoOpenchannelAccounts()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="openchannelAccount-image" hide-xs>\n          <img ng-src="assets/images/business/openchannelAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.openchannelAccount.id}}\n            <span ng-if="vm.openchannelAccount.name">{{vm.openchannelAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.openchannelAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveOpenchannelAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (openchannelDispositionsForm.$invalid) || (openchannelCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n                <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n                <div ng-messages="generalForm[\'replyUri\'].$error" ng-show="generalForm[\'replyUri\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.openchannelAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.MAPKEY">MapKey</label>\n                <md-select name="mapKey" ng-model="vm.openchannelAccount.mapKey" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">None</md-option>\n                  <md-optgroup label="standard">\n                    <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="!mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n                  </md-optgroup>\n                  <md-optgroup label="custom">\n                    <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n                  </md-optgroup>\n                </md-select>\n                <div ng-messages="generalForm[\'mapKey\'].$error" ng-show="generalForm[\'mapKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.MAPKEY_REQUIRED">MapKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.openchannelAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.RECEIVEURI">receiveUri</label>\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUri" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-receiveUri" name="receiveUri" ng-value="vm.location + \'/api/openchannel/accounts/\' + vm.openchannelAccount.id + \'/notify\'" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="OPENCHANNEL.HELP.RECEIVEURI"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="openchannelAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="OPENCHANNEL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.openchannelAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="openchannelAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.openchannelAccount.queueTransfer == true" class="md-block">\n                <label translate="OPENCHANNEL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.openchannelAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.openchannelAccount.agentTransfer == true" class="md-block">\n                <label translate="OPENCHANNEL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.openchannelAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.PROXY">PROXY</div>\n            </div>\n            <form name="proxyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.TOKEN">token</label>\n                <input type="text" name="token" ng-model="vm.openchannelAccount.token" autofocus disabled>\n\n                <div class="hint"><span translate="OPENCHANNEL.HELP.TOKEN"></span></div>\n                <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.TOKEN_REQUIRED">token field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="openchannelAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.openchannelAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.openchannelAccount.mandatoryDisposition" class="md-block">\n                <label translate="OPENCHANNEL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.openchannelAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="OPENCHANNEL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="OpenchannelAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="openchannelAccount-detail-form-container openchanneldispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="OPENCHANNEL.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add openchannel dispositions" translate translate-attr-label="OPENCHANNEL.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="openchannelAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container openchannelcannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="OpenchannelAccountOpenchannelCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELCANNEDANSWERS">OpenchannelCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event)" aria-label="add openchannelCannedAnswer" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelCannedAnswers" csv-label="true" filename="openchannelAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'OPENCHANNEL.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'OPENCHANNEL.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'OPENCHANNEL.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'OPENCHANNEL.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'OPENCHANNEL.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="openchannelCannedAnswer" md-select-id="id" ng-repeat="openchannelCannedAnswer in vm_dc.openchannelAccountOpenchannelCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{openchannelCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{openchannelCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{openchannelCannedAnswer.value}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{openchannelCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n                        {{ openchannelCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" translate="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER">\n                                Edit OpenchannelCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(openchannelCannedAnswer, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELCANNEDANSWER">\n                                Delete OpenchannelCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="OPENCHANNEL.NO_OPENCHANNELCANNEDANSWER_AVAILABLE">No openchannelcannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelCannedAnswers.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="OpenchannelAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.openchannelAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="OPENCHANNEL.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOpenchannelAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOpenchannelAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedOpenchannelAccountApps.length}} {{vm_ac.selectedOpenchannelAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedOpenchannelAccountApps($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedOpenchannelAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.openchannelAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editOpenchannelAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.openchannelAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="OpenchannelAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="OPENCHANNEL.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getOpenchannelAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getOpenchannelAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getOpenchannelAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="OPENCHANNEL.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountInteractions.length}} {{vm_dc.selectedOpenchannelAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountInteractions" csv-label="true" filename="openchannelAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'OPENCHANNEL.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'OPENCHANNEL.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'OPENCHANNEL.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'OPENCHANNEL.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'OPENCHANNEL.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'OPENCHANNEL.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'OPENCHANNEL.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.openchannelAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'OPENCHANNEL.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'OPENCHANNEL.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spyopenchannelInteraction($event, interaction)" translate="OPENCHANNEL.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n                              <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event, true)" translate="OPENCHANNEL.DOWNLOAD_WITH_ATTACHMENTS">\n                                Download with attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event)" translate="OPENCHANNEL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n                                Download without attachments\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="OPENCHANNEL.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.openchannelAccountInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="OPENCHANNEL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountInteractions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",'<div id="openchannelAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELACCOUNTS">OpenchannelAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedOpenchannelAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="OPENCHANNEL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-openchannelAccounts-count">\n          <span>{{vm.selectedOpenchannelAccounts.length}}</span>\n          <span translate="OPENCHANNEL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNEL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelAccounts" csv-label="true" filename="openchannelAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelAccounts($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- OPENCHANNELACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n                <th md-column md-order-by="replyUri">{{ \'OPENCHANNEL.REPLYURI\' | translate }}</th>\n                <th md-column md-order-by="ListId">{{ \'OPENCHANNEL.LIST\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.openchannelAccounts.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="openchannelAccount" md-select-id="id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n                <td md-cell ng-if="openchannelAccount.userpic"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="api/users/{{openchannelAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!openchannelAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="id ">{{openchannelAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="name ">{{openchannelAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="key ">{{openchannelAccount.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="replyUri ">{{openchannelAccount.replyUri}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':openchannelAccount.ListId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="description ">{{openchannelAccount.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(openchannelAccount, $event    )" translate="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT">\n                          Edit OpenchannelAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(openchannelAccount, $event    )" translate="OPENCHANNEL.INTERACTIONS_OPENCHANNELACCOUNT">\n                          Interactions OpenchannelAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(openchannelAccount, $event    )" translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">\n                          AgentAdd OpenchannelAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(openchannelAccount, $event    )" translate="OPENCHANNEL.DELETE_OPENCHANNELACCOUNT">\n                          Delete OpenchannelAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelAccounts.count}}" md-on-paginate="vm.getOpenchannelAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / OPENCHANNELACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD OPENCHANNELACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelAccount-button" ng-click="vm.createOrEditOpenchannelAccount($event)" aria-label="add openchannelAccount" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD OPENCHANNELACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",'<md-dialog class="openchannelQueue-dialog" aria-label="New OpenchannelQueue">\n  <form name="openchannelQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelQueue">\n\n        <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n        <div ng-messages="openchannelQueueForm[\'name\'].$error" ng-show="openchannelQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="openchannelQueueForm[\'strategy\'].$error" ng-show="openchannelQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="openchannelQueueForm[\'timeout\'].$error" ng-show="openchannelQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n\n        <div ng-messages="openchannelQueueForm[\'description\'].$error" ng-show="openchannelQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelQueue" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid || openchannelQueueForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelQueue" ng-click="vm.addNewOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELQUEUE" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n          ADD OPENCHANNELQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelQueue" ng-click="vm.deleteOpenchannelQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n  <form name="openchannelQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">Add Agent to openchannelQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n  <form name="openchannelQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="OPENCHANNEL.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/view.html",'<div id="openchannel-openchannelQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-openchannelQueues-button md-icon-button" aria-label="Go to openchannelQueues" ng-click="vm.gotoOpenchannelQueues()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="openchannelQueue-image" hide-xs>\n          <img ng-src="assets/images/business/openchannelQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.openchannelQueue.id}}\n            <span ng-if="vm.openchannelQueue.name">{{vm.openchannelQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.openchannelQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.openchannelQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveOpenchannelQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="openchannelQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.openchannelQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",'<div id="openchannelQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELQUEUES">OpenchannelQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedOpenchannelQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="OPENCHANNEL.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-openchannelQueues-count">\n          <span>{{vm.selectedOpenchannelQueues.length}}</span>\n          <span translate="OPENCHANNEL.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNEL.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllOpenchannelQueues()" translate="OPENCHANNEL.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectOpenchannelQueues()" translate="OPENCHANNEL.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelQueues" csv-label="true" filename="openchannelQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelQueues($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- OPENCHANNELQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'OPENCHANNEL.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.openchannelQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="openchannelQueue" md-select-id="id" ng-repeat="openchannelQueue in vm.openchannelQueues.rows">\n                <td md-cell ng-if="openchannelQueue.userpic"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="api/users/{{openchannelQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!openchannelQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="id ">{{openchannelQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="name ">{{openchannelQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="strategy ">{{ vm.arraystrategy[openchannelQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(openchannelQueue, $event    )" translate="OPENCHANNEL.EDIT_OPENCHANNELQUEUE">\n                          Edit OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(openchannelQueue, $event    )" translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">\n                          teamadd OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(openchannelQueue, $event    )" translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">\n                          agentadd OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(openchannelQueue, $event    )" translate="OPENCHANNEL.DELETE_OPENCHANNELQUEUE">\n                          Delete OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(openchannelQueue, $event    )" translate="OPENCHANNEL.GOTOREALTIME_OPENCHANNELQUEUE">\n                          goToRealtime OpenchannelQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelQueues.count}}" md-on-paginate="vm.getOpenchannelQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / OPENCHANNELQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD OPENCHANNELQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelQueue-button" ng-click="vm.createOrEditOpenchannelQueue($event)" aria-label="add openchannelQueue" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD OPENCHANNELQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="OPENCHANNEL.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n        <th md-column>{{ \'OPENCHANNEL.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'OPENCHANNEL.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'OPENCHANNEL.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="OPENCHANNEL.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="OPENCHANNEL.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/openchannel/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="OPENCHANNEL.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/plugins/views/plugin/plugin.html",'<div ng-if="!vm.plugin">\n  <p>Plugin not available...</p>\n</div>\n<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n  <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/realtime/views/agents/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools quick-filter-container-custom">\n    <span class="md-subhead" translate="VOICE.AGENTS">Agents</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getAgents()" query="vm.query" debounce="300"></ms-search-bar>\n    <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.getAgents()">\n      <md-option ng-value="\'\'">{{ \'VOICE.ALL\' | translate }}</md-option>\n      <md-option value="pause">{{ \'VOICE.PAUSE\' | translate }}</md-option>\n      <md-option value="*pause">{{ \'VOICE.PARTIALPAUSE\' | translate }}</md-option>\n      <md-option value="busy">{{ \'VOICE.BUSY\' | translate }}</md-option>\n      <md-option value="idle">{{ \'VOICE.IDLE\' | translate }}</md-option>\n    </md-select>\n    <md-select ng-if="vm.query.globalStatusFilter === \'pause\' || vm.query.globalStatusFilter === \'*pause\'" ng-model="vm.query.pauseTypeFilter" class="md-caption ml-16" ng-change="vm.getAgents()">\n      <md-option ng-value="\'\'">All</md-option>\n      <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n      <md-option value="ACW">ACW</md-option>\n      <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n      <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n      <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n    </md-select>\n    <md-select ng-model="vm.query.globalQueueFilter" multiple class="md-caption margin-left-10" placeholder="{{vm.channel}}Queue" md-on-close="vm.getAgents()">\n      <md-button ng-click="vm.selectAll()" md-no-ink class="md-primary" layout-fill>\n        {{\'DASHBOARDS.SELECT_ALL\' | translate}}</md-button>\n      <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{\n        queue.name }}</md-option>\n      <md-button ng-click="vm.clearSelection()" md-no-ink class="md-primary" layout-fill>\n         {{\'DASHBOARDS.CLEAR\' | translate}}</md-button>\n    </md-select>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n      <tr md-row>\n        <th class="bv text-center" colspan="5">{{ \'VOICE.AGENT\' | translate }}</th>\n        <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n        <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n        <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n        <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n        <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">\n          {{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n        <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n        <th ng-if="vm.license.whatsapp" class="bv bl text-center" colspan="2">\n          {{ \'WHATSAPP.WHATSAPP\' | translate }}</th>\n        <th width="10px" class="bt bl" rowspan="2"></th>\n      </tr>\n      <tr md-row>\n        <th class="bl" colspan="2" md-column md-order-by="fullname">\n          {{ \'VOICE.NAME\' | translate }}</th>\n        <th class="bl custom-column" md-column md-order-by="globalStatus">\n          {{ \'VOICE.STATUS\' | translate }}</th>\n        <th class="bl custom-column" md-column md-order-by="lastLoginAt">\n          {{ \'VOICE.LOGIN_TIME\' | translate }}</th>\n        <th class="bl custom-column" md-column md-order-by="lastPauseAt">\n          {{ \'VOICE.PAUSE_TIME\' | translate }}</th>\n        <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n        <th class="bl custom-column">Info</th>\n        <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.chat" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.mail" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.messaging" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.openchannel" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.fax" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n        <th ng-if="vm.license.whatsapp" class="bl text-center">{{ \'WHATSAPP.STATUS\' | translate }}</th>\n        <th ng-if="vm.license.whatsapp" class="text-center">\n          <md-icon md-font-icon="icon-battery-standard">\n            <md-tooltip>{{ \'WHATSAPP.CAPACITY\' | translate }}</md-tooltip>\n          </md-icon>\n        </th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.agents.count > 0">\n        <td md-cell colspan="19">\n          <div layout="row" layout-align="center center">\n            <span>{{ \'VOICE.NO_AGENT_ONLINE\' | translate }}</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n        <td class="bt padding-5">\n          <div layout="row" layout-align="start center">\n            <img class="avatar" ng-src="{{agent.userpic && \'api/users/\'+ agent.id +\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n            <div layout="column">\n              <span>{{agent.fullname}}</span>\n              <span>{{agent.internal}}</span>\n            </div>\n          </div>\n        </td>\n        <td class="bt padding-5">\n          <div layout="row" layout-align="start center" ng-if="vm.license.screenrecording && (agent.phoneBarEnableScreenRecordingByAgent || agent.phoneBarEnableAutomaticScreenRecording)">\n            <div class="column">\n              <span>\n                <md-icon md-font-icon="icon-camcorder-box" ng-class="agent.screenrecording ? \'green-fg\' : \'grey-fg\'" aria-hidden="true">\n                  <md-tooltip>\n                    {{ agent.screenrecording ? \'VOICE.TOOLTIP_SCREENRECORDING_ON\' : \'VOICE.TOOLTIP_SCREENRECORDING_OFF\'\n                    | translate }}\n                  </md-tooltip>\n                </md-icon>\n              </span>\n            </div>\n          </div>\n        </td>\n        <td class="bt text-center">\n'+"          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[agent.globalStatus]\">\n            <span ng-if=\"agent.globalStatus === 'pause' || agent.globalStatus === '*pause'\">PAUSE (</span>\n            {{ agent.globalStatus === 'pause' || agent.globalStatus === '*pause' ? \n              ((agent.globalStatusDisplayValue === 'DEFAULT PAUSE' ? ('VOICE.DEFAULT_PAUSE' | translate) : agent.globalStatusDisplayValue) | uppercase) : \n              ('VOICE.' + (agent.globalStatusDisplayValue | uppercase) | translate | uppercase)\n            }}\n            <span ng-if=\"agent.globalStatus === 'pause' || agent.globalStatus === '*pause'\">)</span>\n          </span>\n        </td>\n        <td class=\"bt custom-column\">\n          <timer start-time=\"agent.lastLoginAt\"></timer>\n        </td>\n        <td class=\"bt custom-column\">\n          <timer ng-if=\"agent.globalStatus === 'pause' || agent.globalStatus === '*pause'\" start-time=\"agent.lastPauseAt\"></timer>\n        </td>\n        <td class=\"bt bl text-center\">\n          <span ng-if=\"!agent.onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[agent.voiceStatus]\">\n            {{ 'VOICE.' + (agent.voiceStatus | uppercase) | translate | uppercase }}</span>\n          <span ng-if=\"agent.onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">\n            {{ 'VOICE.ONHOLD' | translate | uppercase }}</span>\n        </td>\n        <td class=\"bt bl\">\n          <div layout=\"column\" ng-if=\"agent.voiceStatus === 'talking' || agent.voiceStatus === 'ringing'\">\n            <span ng-if=\"agent.queue\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">{{\n              agent.queue }}</span>\n            <span ng-if=\"agent.destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\" privacy ng-cloak>{{\n              agent.destconnectedlinenum }}</span>\n            <span ng-if=\"agent.routealias\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">{{\n              agent.routealias }}</span>\n            <span class=\"padding-5\" ng-if=\"agent.queue || agent.destconnectedlinenum\">\n              <timer start-time=\"agent.voiceStatusTime\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">\n              </timer>\n            </span>\n          </div>\n        </td>\n        <td class=\"bt bl text-center\" ng-if=\"vm.license.chat\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.chatStatus]\">\n            {{ 'VOICE.' + (agent.chatStatus | uppercase) | translate | uppercase }}</span>\n        </td>\n        <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.chatStatus]\">\n          {{ agent.chatCurrentCapacity }}</td>\n        <td class=\"bl bt text-center\" ng-if=\"vm.license.mail\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.mailStatus]\">\n            {{ 'VOICE.' + (agent.mailStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.mailStatus]\">\n          {{ agent.mailCurrentCapacity }}</td>\n        <td class=\"bl bt text-center\" ng-if=\"vm.license.messaging\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.smsStatus]\">\n            {{ 'VOICE.' + (agent.smsStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.smsStatus]\">\n          {{ agent.smsCurrentCapacity }}</td>\n        <td class=\"bt bl text-center\" ng-if=\"vm.license.openchannel\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.openchannelStatus]\">\n            {{ 'VOICE.' + (agent.openchannelStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.openchannelStatus]\">\n          {{ agent.openchannelCurrentCapacity }}</td>\n        <td class=\"bt bl text-center\" ng-if=\"vm.license.fax\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.faxStatus]\">\n            {{ 'VOICE.' + (agent.faxStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.faxStatus]\">\n          {{ agent.faxCurrentCapacity }}</td>\n        <td class=\"bl bt text-center\" ng-if=\"vm.license.whatsapp\">\n          <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.whatsappStatus]\">\n            {{ 'VOICE.' + (agent.whatsappStatus | uppercase) | translate | uppercase }}\n          </span>\n        </td>\n        <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.whatsapp\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.whatsappStatus]\">\n          {{ agent.whatsappCurrentCapacity }}</td>\n        <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n          <md-menu>\n            <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n              <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n            </md-button>\n            <md-menu-content width=\"4\">\n              <md-menu-item>\n                <md-button ng-click=\"vm.logout(agent, $event)\" translate=\"VOICE.LOGOUT\">\n                  Logout\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click=\"vm.addQueue(agent, $event)\" translate=\"{{ vm.channel.toUpperCase() + '.AGENTADD_QUEUE' }}\">\n                  Add Agent In Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item ng-if=\"vm.license.screenrecording && agent.phoneBarEnableScreenRecordingByAgent\">\n                <md-menu>\n                  <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.SCREENRECORDING\">Manage Screen Recording\n                  </md-button>\n                  <md-menu-content>\n                    <md-menu-item>\n                      <md-button ng-click=\"vm.manageScreenRecording(agent, !agent.screenrecording)\" translate=\"{{ agent.screenrecording ? 'VOICE.STOP_SCREENRECORDING' : 'VOICE.START_SCREENRECORDING' }}\">\n                      </md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item>\n                <md-menu>\n                  <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.PAUSE\">Pause</md-button>\n                  <md-menu-content>\n                    <md-menu-item>\n                      <md-button ng-disabled=\"agent.voicePause && 'DEFAULT PAUSE' === agent.pauseType\" ng-click=\"vm.pause(agent)\">\n                        <em translate=\"VOICE.DEFAULT_PAUSE\">Default Pause</em>\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n                      <md-button ng-disabled=\"agent.voicePause && pause.name === agent.pauseType\" ng-click=\"vm.pause(agent, pause.name)\">{{pause.name}}\n                      </md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item ng-if=\"agent.globalStatus === 'pause' || agent.globalStatus === '*pause'\">\n                <md-button ng-click=\"vm.unpause(agent)\" translate=\"VOICE.UNPAUSE\">\n                  Unpause\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n<md-table-pagination md-label=\"{page: '{{'VOICE.PAGE' | translate}}:', rowsPerPage: '{{'VOICE.ROWSPERPAGE' | translate}}:', of: '{{'VOICE.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.agents.rows.length}}\" md-on-paginate=\"vm.getAgents\" md-page-select></md-table-pagination>"),e.put("app/main/apps/settings/views/cloudProviders/cloudProviders.html",'<div id="cloudProviders" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.CLOUD_PROVIDERS">Cloud Providers</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedAiTools.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedAiTools =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="SETTINGS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-cloudProviders-count">\n          <span>{{vm.selectedAiTools.length}}</span>\n          <span translate="SETTINGS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SETTINGS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllAiTools()" translate="SETTINGS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectAiTools()" translate="SETTINGS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedAiTools" csv-label="true" filename="cloudProviders.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-click="vm.deleteSelectedAiTools($event)" aria-label="delete selected" translate translate-attr-label="SETTINGS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CLOUDPROVIDER TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedAiTools" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAiTools">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'SETTINGS.NAME\' | translate }}</th>\n                <th md-column md-order-by="service">{{ \'SETTINGS.SERVICE\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.cloudProviders.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="cloudProvider" md-select-id="id" ng-repeat="cloudProvider in vm.cloudProviders.rows">\n                <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="id">{{cloudProvider.id}}</td>\n                <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="name">{{cloudProvider.name}}</td>\n                <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="service">{{ vm.services[cloudProvider.service] }}</td>\n\n                <td md-cell class="actions">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="cloudProvider.service === \'MicrosoftAzure\'">\n                        <md-button ng-click="vm.authenticateToMicrosoftIdentityPlatform(cloudProvider)" translate="SETTINGS.AUTHENTICATE">\n                          Authenticate\n                        </md-button>\n                      </md-menu-item>\n\n                      <md-menu-item ng-if="cloudProvider.service === \'MicrosoftAzure\'">\n                        <md-button ng-click="vm.updateClientSecret(cloudProvider, $event)" translate="SETTINGS.UPDATE_CLIENT_SECRET">\n                          Update Client Secret\n                        </md-button>\n                      </md-menu-item>\n\n                      <md-menu-item>\n                        <md-button ng-click="vm.editdialog(cloudProvider, $event)" translate="SETTINGS.EDIT_CLOUDPROVIDER">\n                          Edit CloudProvider\n                        </md-button>\n                      </md-menu-item>\n\n                      <md-menu-item>\n                        <md-button ng-click="vm.deleteconfirm(cloudProvider, $event)" translate="SETTINGS.DELETE_CLOUDPROVIDER">\n                          Delete CloudProvider\n                        </md-button>\n                      </md-menu-item>\n\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cloudProviders.count}}" md-on-paginate="vm.getAiTools" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CLOUDPROVIDER TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CLOUDPROVIDER BUTTON --\x3e\n  <md-button class="md-fab md-accent" id="add-cloudProvider-button" ng-click="vm.createOrEditCloudProvider($event)" aria-label="add cloudProvider" translate translate-attr-aria-label="SETTINGS.ADD_CLOUDPROVIDER">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CLOUDPROVIDER BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/cloudProviders/create/dialog.html",'<md-dialog class="cloudProvider-dialog" aria-label="New CloudProvider">\n  <form name="cloudProviderForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ (vm.newCloudProvider ? \'SETTINGS.NEW_CLOUDPROVIDER\' : \'SETTINGS.EDIT_CLOUDPROVIDER\') | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.cloudProvider.name" ng-required="true" autofocus>\n\n        <div ng-messages="cloudProviderForm[\'name\'].$error" ng-show="cloudProviderForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.SERVICE">Service</label>\n        <md-select name="service" ng-model="vm.cloudProvider.service" required ng-disabled="!vm.newCloudProvider">\n          <md-option ng-if="vm.license.ai" ng-value="\'AmazonAWS\'">AmazonAWS</md-option>\n          <md-option ng-value="\'MicrosoftAzure\'">Microsoft Azure</md-option>\n        </md-select>\n        <div ng-messages="cloudProviderForm[\'service\'].$error" ng-show="cloudProviderForm[\'service\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.cloudProvider.service == \'MicrosoftAzure\'" class="md-block">\n        <label translate="SETTINGS.TYPE">Type</label>\n        <md-select name="service" ng-model="vm.cloudProvider.type" required ng-disabled="!vm.newCloudProvider">\n          <md-option ng-value="\'Outlook365\'">Outlook365</md-option>\n          <md-option ng-value="\'Dynamics365\'">Dynamics365</md-option>\n        </md-select>\n        <div ng-messages="cloudProviderForm[\'type\'].$error" ng-show="cloudProviderForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.cloudProvider.service == \'AmazonAWS\'" class="md-block">\n        <label translate="SETTINGS.ACCESSKEY">AccessKey</label>\n        <input type="text" name="data2" ng-model="vm.cloudProvider.data2" ng-required="true">\n\n        <div ng-messages="cloudProviderForm[\'data2\'].$error" ng-show="cloudProviderForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.ACCESSKEY_REQUIRED">AccessKey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.cloudProvider.service == \'AmazonAWS\'" class="md-block">\n        <label translate="SETTINGS.SECRETACCESSKEY">SecretAccesskey</label>\n        <input type="text" name="data1" ng-model="vm.cloudProvider.data1" ng-required="true">\n\n        <div ng-messages="cloudProviderForm[\'data1\'].$error" ng-show="cloudProviderForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.SECRETACCESSKEY_REQUIRED">SecretAccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div ng-if="vm.cloudProvider.service == \'MicrosoftAzure\'">\n        <md-input-container class="md-block">\n          <label translate="SETTINGS.APPLICATION_ID">Application Id</label>\n          <input type="text" name="data1" ng-model="vm.cloudProvider.data1" ng-required="true">\n\n          <div ng-messages="cloudProviderForm[\'data1\'].$error" ng-show="cloudProviderForm[\'data1\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block">\n          <label translate="SETTINGS.TENANT_ID">Tenant Id</label>\n          <input type="text" name="data2" ng-model="vm.cloudProvider.data2" ng-required="true">\n\n          <div ng-messages="cloudProviderForm[\'data2\'].$error" ng-show="cloudProviderForm[\'data2\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container ng-if="vm.newCloudProvider" class="md-block">\n          <label translate="SETTINGS.CLIENT_SECRET">Client Secret</label>\n          <input type="password" name="data3" ng-model="vm.cloudProvider.data3" ng-required="true">\n          <div class="hint"><span translate="SETTINGS.HELP.CLIENT_SECRET"></span></div>\n\n          <div ng-messages="cloudProviderForm[\'data3\'].$error" ng-show="cloudProviderForm[\'data3\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block">\n          <label translate="SETTINGS.REDIRECT_URI">Redirect Uri</label>\n          <input type="url" name="data4" ng-model="vm.cloudProvider.data4" ng-required="true">\n\n          <div ng-messages="cloudProviderForm[\'data4\'].$error" ng-show="cloudProviderForm[\'data4\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n            <div ng-message="url">\n              <span translate="SETTINGS.ERRORS.WRONG_FORMAT"></span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container ng-if="vm.cloudProvider.type == \'Dynamics365\'" class="md-block">\n          <label translate="SETTINGS.REMOTE_URI">Remote Uri</label>\n          <input type="url" name="data7" ng-model="vm.cloudProvider.data7" ng-required="true">\n\n          <div ng-messages="cloudProviderForm[\'data7\'].$error" ng-show="cloudProviderForm[\'data7\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n            </div>\n            <div ng-message="url">\n              <span translate="SETTINGS.ERRORS.WRONG_FORMAT"></span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newCloudProvider" ng-click="vm.saveCloudProvider()" class="send-button md-accent md-raised" ng-disabled="cloudProviderForm.$invalid || cloudProviderForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newCloudProvider" ng-click="vm.addNewCloudProvider()" class="send-button md-accent md-raised" ng-disabled="cloudProviderForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CLOUDPROVIDER" translate-attr-aria-label="SETTINGS.ADD_CLOUDPROVIDER">\n          ADD CLOUDPROVIDER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-click="vm.deleteCloudProvider($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/cloudProviders/updateSecret/updateSecret.html",'<md-dialog class="cloudProvider-dialog" aria-label="update client secret">\n  <form name="updateSecretForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'SETTINGS.UPDATE_CLIENT_SECRET\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n        <label translate="SETTINGS.CLIENT_SECRET">Current Client Secret</label>\n        <input type="text" name="currentSecret" ng-model="vm.cloudProvider.data3" disabled>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.NEW_CLIENT_SECRET">New Client Secret</label>\n        <input type="password" name="secret" ng-model="vm.newSecret" required>\n        <div ng-messages="updateSecretForm.secret.$error" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">New Client Secret field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.saveSecret()" class="send-button md-accent md-raised" ng-disabled="updateSecretForm.$invalid || updateSecretForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/create/dialog.html",'<md-dialog class="customization-dialog" aria-label="New Customization">\n  <form name="customizationForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultFavicon" aria-label="Default_Favicon"><span translate="SETTINGS.DEFAULT_FAVICON">Default_Favicon</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n        <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n        <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n        <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n        <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n        <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n        <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.license.preferred" class="md-block">\n        <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomization" ng-click="vm.saveCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid || customizationForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomization" ng-click="vm.addNewCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CUSTOMIZATION" translate-attr-aria-label="SETTINGS.ADD_CUSTOMIZATION">\n          ADD CUSTOMIZATION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomization" ng-click="vm.deleteCustomization($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/customizations.html",'<div id="customizations" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.CUSTOMIZATIONS">Customizations</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div>\n      <md-button type="submit" ng-click="vm.saveCustomization()" ng-disabled="(customizationsForm.$pristine && logoForm.$pristine && logologinForm.$pristine && preferredForm.$pristine && faviconForm.$pristine) || (customizationsForm.$invalid || logoForm.$invalid || logologinForm.$invalid || preferredForm.$invalid || faviconForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      <div class="customization-detail-form-container customizations md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.CUSTOMIZATIONS">CUSTOMIZATIONS</div>\n        </div>\n        <form name="customizationsForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultFavicon" aria-label="Default_Favicon"><span translate="SETTINGS.DEFAULT_FAVICON">Default_Favicon</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n            <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n            <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n            <div ng-messages="customizationsForm[\'headerWhiteLabel\'].$error" ng-show="customizationsForm[\'headerWhiteLabel\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n            <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n            <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n            <div ng-messages="customizationsForm[\'pageTitle\'].$error" ng-show="customizationsForm[\'pageTitle\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if="vm.license.preferred" class="md-block">\n            <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div ng-if="!vm.customization.defaultLogo" class="customization-detail-form-container logo md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.LOGO">LOGO</div>\n        </div>\n        <div ng-controller="CustomizationlogoController as vm_cl" ng-init="vm_cl.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n          <div id="customization-image-uploader" flow-init="vm_cl.ngFlowOptions" flow-name="vm_cl.ngFlow.flow" flow-files-submitted="vm_cl.upload()" flow-file-added="vm_cl.fileAdded($file)" flow-file-success="vm_cl.fileSuccess($file, $message)" flow-complete="vm_cl.uploadComplete()" flow-drop flow-drag-enter="vm_cl.dropping=true" flow-drag-leave="vm_cl.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n            <div class="drop-text hint-text" layout="row" layout-align="center center">\n              <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n            </div>\n\n            <div class="upload-button" layout="column" layout-align="center center">\n              <md-button class="md-accent md-raised" flow-btn>\n                Upload\n              </md-button>\n              <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n            </div>\n\n            <div layout="row" layout-align="start start" layout-wrap>\n              <div ng-repeat="logoimage in vm_cl.customization.images" ng-switch="logoimage.type">\n                <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                  <div class="overlay" layout="column" layout-align="center center">\n                    <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n                    </md-progress-linear>\n                  </div>\n                  <img class="media" flow-img="logoimage.file">\n                </div>\n\n                <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n                  <img class="media" ng-src="{{logoimage.url}}">\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n      </div>\n\n      <div ng-if="!vm.customization.defaultLoginLogo" class="customization-detail-form-container logologin md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.LOGOLOGIN">LOGOLOGIN</div>\n        </div>\n        <div ng-controller="CustomizationlogologinController as vm_cll" ng-init="vm_cll.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n          <div id="customization-image-uploader" flow-init="vm_cll.ngFlowOptions" flow-name="vm_cll.ngFlow.flow" flow-files-submitted="vm_cll.upload()" flow-file-added="vm_cll.fileAdded($file)" flow-file-success="vm_cll.fileSuccess($file, $message)" flow-complete="vm_cll.uploadComplete()" flow-drop flow-drag-enter="vm_cll.dropping=true" flow-drag-leave="vm_cll.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n            <div class="drop-text hint-text" layout="row" layout-align="center center">\n              <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n            </div>\n\n            <div class="upload-button" layout="column" layout-align="center center">\n              <md-button class="md-accent md-raised" flow-btn>\n                Upload\n              </md-button>\n              <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n            </div>\n\n            <div layout="row" layout-align="start start" layout-wrap>\n              <div ng-repeat="logologinimage in vm_cll.customization.images" ng-switch="logologinimage.type">\n                <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                  <div class="overlay" layout="column" layout-align="center center">\n                    <md-progress-linear md-mode="determinate" value="{{logologinimage.file.progress() * 100}}">\n                    </md-progress-linear>\n                  </div>\n                  <img class="media" flow-img="logologinimage.file">\n                </div>\n\n                <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n                  <img class="media" ng-src="{{logologinimage.url}}">\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n      </div>\n\n      <div ng-if="!vm.customization.defaultPreferred && vm.license.preferred" class="customization-detail-form-container preferred md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.PREFERRED">PREFERRED</div>\n        </div>\n        <div ng-controller="CustomizationpreferredController as vm_cp" ng-init="vm_cp.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n          <div id="customization-image-uploader" flow-init="vm_cp.ngFlowOptions" flow-name="vm_cp.ngFlow.flow" flow-files-submitted="vm_cp.upload()" flow-file-added="vm_cp.fileAdded($file)" flow-file-success="vm_cp.fileSuccess($file, $message)" flow-complete="vm_cp.uploadComplete()" flow-drop flow-drag-enter="vm_cp.dropping=true" flow-drag-leave="vm_cp.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n            <div class="drop-text hint-text" layout="row" layout-align="center center">\n              <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n            </div>\n\n            <div class="upload-button" layout="column" layout-align="center center">\n              <md-button class="md-accent md-raised" flow-btn>\n                Upload\n              </md-button>\n              <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n            </div>\n\n            <div layout="row" layout-align="start start" layout-wrap>\n              <div ng-repeat="preferredimage in vm_cp.customization.images" ng-switch="preferredimage.type">\n                <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                  <div class="overlay" layout="column" layout-align="center center">\n                    <md-progress-linear md-mode="determinate" value="{{preferredimage.file.progress() * 100}}">\n                    </md-progress-linear>\n                  </div>\n                  <img class="media" flow-img="preferredimage.file">\n                </div>\n\n                <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n                  <img class="media" ng-src="{{preferredimage.url}}">\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n      </div>\n\n      <div ng-if="!vm.customization.defaultFavicon" class="customization-detail-form-container favicon md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.FAVICON">FAVICON</div>\n        </div>\n        <div ng-controller="CustomizationfaviconController as vm_cf" ng-init="vm_cf.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n          <div id="customization-image-uploader" flow-init="vm_cf.ngFlowOptions" flow-name="vm_cf.ngFlow.flow" flow-files-submitted="vm_cf.upload()" flow-file-added="vm_cf.fileAdded($file)" flow-file-success="vm_cf.fileSuccess($file, $message)" flow-complete="vm_cf.uploadComplete()" flow-drop flow-drag-enter="vm_cf.dropping=true" flow-drag-leave="vm_cf.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n            <div class="drop-text hint-text" layout="row" layout-align="center center">\n              <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n            </div>\n\n            <div class="upload-button" layout="column" layout-align="center center">\n              <md-button class="md-accent md-raised" flow-btn>\n                Upload\n              </md-button>\n              <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG, ICO - Max. 8MB</span>\n            </div>\n\n            <div layout="row" layout-align="start start" layout-wrap>\n              <div ng-repeat="faviconimage in vm_cf.customization.images" ng-switch="faviconimage.type">\n                <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                  <div class="overlay" layout="column" layout-align="center center">\n                    <md-progress-linear md-mode="determinate" value="{{faviconimage.file.progress() * 100}}">\n                    </md-progress-linear>\n                  </div>\n                  <img class="media" flow-img="faviconimage.file">\n                </div>\n\n                <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n                  <img class="media" ng-src="{{faviconimage.url}}">\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n      </div>\n\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/generals/create/dialog.html",'<md-dialog class="general-dialog" aria-label="New General">\n  <form name="generalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGeneral" ng-click="vm.saveGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid || generalForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGeneral" ng-click="vm.addNewGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_GENERAL" translate-attr-aria-label="SETTINGS.ADD_GENERAL">\n          ADD GENERAL\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGeneral" ng-click="vm.deleteGeneral($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/generals/generals.html",'<div id="generals" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.GENERAL">General</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div>\n      <md-button type="submit" ng-click="vm.saveGeneral()" ng-disabled="(globalForm.$pristine && motionbarForm.$pristine && reportForm.$pristine && agentOmniDesktopInterfaceForm.$pristine && screenRecordingForm.$pristine && securityForm.$pristine && imapGeneralSettingsForm.$pristine && SSOForm.$pristine && aiToolsForm.$pristine) || (globalForm.$invalid || motionbarForm.$invalid || reportForm.$invalid || agentOmniDesktopInterfaceForm.$invalid || screenRecordingForm.$invalid || securityForm.$invalid || imapGeneralSettingsForm.$invalid || SSOForm.$invalid || aiToolsForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      <div class="general-detail-form-container global md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.GLOBAL">GLOBAL</div>\n        </div>\n        <form name="globalForm" novalidate>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n            <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" value="1000" ng-required="true" autofocus>\n\n            <div ng-messages="globalForm[\'min_internal\'].$error" ng-show="globalForm[\'min_internal\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.CHATTIMEOUT">chatTimeout</label>\n            <input type="number" name="chatTimeout" ng-model="vm.general.chatTimeout" min="0" value="30" ng-required="true">\n\n            <div ng-messages="globalForm[\'chatTimeout\'].$error" ng-show="globalForm[\'chatTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.CHATTIMEOUT_REQUIRED">chatTimeout field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">chatTimeout must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.rtlSupport" aria-label="RtlSupport"><span translate="SETTINGS.RTLSUPPORT">RtlSupport</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.RTLSUPPORT"></span></div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.stopRecordingOnTransfer" aria-label="Stop_Recording_On_Voice_Call_Transfer"><span translate="SETTINGS.STOP_RECORDING_ON_VOICE_CALL_TRANSFER">Stop_Recording_On_Voice_Call_Transfer</span></md-switch>\n          </md-input-container>\n        </form>\n      </div>\n\n      <div class="general-detail-form-container motionbar md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.MOTIONBAR">MOTIONBAR</div>\n        </div>\n        <form name="motionbarForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.phoneBarAutoUpdater" aria-label="MotionbarAutoUpdater"><span translate="SETTINGS.MOTIONBARAUTOUPDATER">MotionbarAutoUpdater</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.phoneBarAutoUpdater" class="md-block">\n            <label translate="SETTINGS.MOTIONBARAUTOUPDATERURL">MotionbarAutoUpdaterUrl</label>\n            <input type="url" name="phoneBarAutoUpdaterUrl" ng-model="vm.general.phoneBarAutoUpdaterUrl" value="https://www.xcally.com/bar/phonebar/autoupdater.xml" ng-required="vm.general.phoneBarAutoUpdater">\n\n            <div ng-messages="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$error" ng-show="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_REQUIRED">MotionbarAutoUpdaterUrl field is required</span>\n              </div>\n              <div ng-message="url">\n                <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_MUST_VALID_URL">MotionbarAutoUpdaterUrl must be a valid url http://www.xcally.com</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.phoneBarRememberMeEnabled" aria-label="MotionbarRememberMe"><span translate="SETTINGS.MOTIONBARREMEMBERME">MotionbarRememberMe</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.MOTIONBARREMEMBERME"></span></div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div class="general-detail-form-container report md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.REPORT">REPORT</div>\n        </div>\n        <form name="reportForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.split" aria-label="Split"><span translate="SETTINGS.SPLIT">Split</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.split" class="md-block">\n            <label translate="SETTINGS.SPLITSIZECSV">SplitSizeCsv</label>\n            <input type="number" name="splitSizeCsv" ng-model="vm.general.splitSizeCsv" value="5000">\n\n            <div ng-messages="reportForm[\'splitSizeCsv\'].$error" ng-show="reportForm[\'splitSizeCsv\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.SPLITSIZECSV_REQUIRED">SplitSizeCsv field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.split" class="md-block">\n            <label translate="SETTINGS.SPLITSIZEPDF">SplitSizePdf</label>\n            <input type="number" name="splitSizePdf" ng-model="vm.general.splitSizePdf" value="1000">\n\n            <div ng-messages="reportForm[\'splitSizePdf\'].$error" ng-show="reportForm[\'splitSizePdf\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.SPLITSIZEPDF_REQUIRED">SplitSizePdf field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.split" class="md-block">\n            <label translate="SETTINGS.SPLITSIZEXLSX">SplitSizeXlsx</label>\n            <input type="number" name="splitSizeXlsx" ng-model="vm.general.splitSizeXlsx" value="5000">\n\n            <div ng-messages="reportForm[\'splitSizeXlsx\'].$error" ng-show="reportForm[\'splitSizeXlsx\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.SPLITSIZEXLSX_REQUIRED">SplitSizeXlsx field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div class="general-detail-form-container agentomnidesktopinterface md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.AGENTOMNIDESKTOPINTERFACE">AGENTOMNIDESKTOPINTERFACE</div>\n        </div>\n        <form name="agentOmniDesktopInterfaceForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.enableEmailPreview" aria-label="EnableEmailPreview"><span translate="SETTINGS.ENABLEEMAILPREVIEW">EnableEmailPreview</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.searchOnEnterKey" aria-label="Search_On_Enter_Key"><span translate="SETTINGS.SEARCH_ON_ENTER_KEY">Search_On_Enter_Key</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.SEARCH_ON_ENTER_KEY"></span></div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.MESSAGESALIGNMENT">messagesAlignment</label>\n            <md-select name="messagesAlignment" ng-model="vm.general.messagesAlignment">\n              <md-option ng-value="\'alternate\'">Alternate</md-option>\n              <md-option ng-value="\'left\'">Left</md-option>\n              <md-option ng-value="\'right\'">Right</md-option>\n            </md-select>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.CHAT_INTERACTIONS_RELOAD_TIMEOUT">Chat_Interactions_Reload_Timeout</label>\n            <input type="number" name="chatInteractionsReloadTimeout" ng-model="vm.general.chatInteractionsReloadTimeout">\n\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'chatInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'chatInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.CHAT_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Chat_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.MAIL_INTERACTIONS_RELOAD_TIMEOUT">Mail_Interactions_Reload_Timeout</label>\n            <input type="number" name="mailInteractionsReloadTimeout" ng-model="vm.general.mailInteractionsReloadTimeout">\n\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'mailInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'mailInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.MAIL_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Mail_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT">Openchannel_Interactions_Reload_Timeout</label>\n            <input type="number" name="openchannelInteractionsReloadTimeout" ng-model="vm.general.openchannelInteractionsReloadTimeout">\n\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'openchannelInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'openchannelInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Openchannel_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.SMS_INTERACTIONS_RELOAD_TIMEOUT">Sms_Interactions_Reload_Timeout</label>\n            <input type="number" name="smsInteractionsReloadTimeout" ng-model="vm.general.smsInteractionsReloadTimeout">\n\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'smsInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'smsInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.SMS_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Sms_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT">Whatsapp_Interactions_Reload_Timeout</label>\n            <input type="number" name="whatsappInteractionsReloadTimeout" ng-model="vm.general.whatsappInteractionsReloadTimeout">\n            <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'whatsappInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'whatsappInteractionsReloadTimeout\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Whatsapp_Interactions_Reload_Timeout field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.PREVIEW_RECALLME_REMINDER_INTERVAL">Preview_Recallme_Reminder_Interval</label>\n            <input type="number" name="previewRecallmeReminderInterval" ng-model="vm.general.previewRecallmeReminderInterval">\n            <div class="hint"><span translate="SETTINGS.HELP.PREVIEW_RECALLME_REMINDER_INTERVAL"></span></div>\n            <div ng-messages="agentOmniDesktopInterfaceForm[\'previewRecallmeReminderInterval\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'previewRecallmeReminderInterval\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED">Preview_Recallme_Reminder_Interval field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.LIMIT_TABS">limitTabs</label>\n            <input type="number" name="limitTabs" ng-model="vm.general.limitTabs" min="0" value="20">\n            <div class="hint"><span translate="SETTINGS.HELP.LIMIT_TABS"></span></div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div ng-if="vm.license.screenrecording" class="general-detail-form-container screenrecording md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.SCREENRECORDING">SCREENRECORDING</div>\n        </div>\n        <form name="screenRecordingForm" novalidate>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.DEFAULTSCREENRECORDINGPATH">defaultScreenRecordingPath</label>\n            <input type="text" name="defaultScreenRecordingPath" ng-model="vm.general.defaultScreenRecordingPath" autofocus>\n\n            <div class="hint"><span translate="SETTINGS.HELP.DEFAULTSCREENRECORDINGPATH"></span></div>\n            <div ng-messages="screenRecordingForm[\'defaultScreenRecordingPath\'].$error" ng-show="screenRecordingForm[\'defaultScreenRecordingPath\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.DEFAULTSCREENRECORDINGPATH_REQUIRED">defaultScreenRecordingPath field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div class="general-detail-form-container security md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.SECURITY">SECURITY</div>\n        </div>\n        <form name="securityForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.ALLOWEDLOGINATTEMPTS">allowedLoginAttempts</label>\n            <input type="number" name="allowedLoginAttempts" ng-model="vm.general.allowedLoginAttempts" value="5" ng-required="true">\n\n            <div ng-messages="securityForm[\'allowedLoginAttempts\'].$error" ng-show="securityForm[\'allowedLoginAttempts\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.ALLOWEDLOGINATTEMPTS_REQUIRED">allowedLoginAttempts field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.BLOCKDURATION">blockDuration</label>\n            <input type="number" name="blockDuration" ng-model="vm.general.blockDuration" value="10" ng-required="true">\n\n            <div ng-messages="securityForm[\'blockDuration\'].$error" ng-show="securityForm[\'blockDuration\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.BLOCKDURATION_REQUIRED">blockDuration field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.enforcePasswordHistory" aria-label="Enforce_Password_History"><span translate="SETTINGS.ENFORCE_PASSWORD_HISTORY">Enforce_Password_History</span></md-switch>\n            <div class="hint"><span translate="SETTINGS.HELP.ENFORCE_PASSWORD_HISTORY"></span></div>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.enforcePasswordHistory" class="md-block">\n            <label translate="SETTINGS.PASSWORD_HISTORY_LIMIT">Password_History_Limit</label>\n            <input type="number" name="passwordHistoryLimit" ng-model="vm.general.passwordHistoryLimit" min="2" max="5" value="3">\n\n            <div class="hint"><span translate="SETTINGS.HELP.PASSWORD_HISTORY_LIMIT"></span></div>\n            <div ng-messages="securityForm[\'passwordHistoryLimit\'].$error" ng-show="securityForm[\'passwordHistoryLimit\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_REQUIRED">Password_History_Limit field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Password_History_Limit must be a valid greater or equal than</span> <span>2</span>\n              </div>\n              <div ng-message="max">\n                <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Password_History_Limit must be a valid greater or equal than</span> <span>5</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block no-margin-bottom">\n            <md-switch ng-change="vm.onPrivacyPolicyChange(\'email\')" ng-model="vm.general.enablePrivacyPolicyEmail" aria-label="Privacy_Policy_Email"><span translate="SETTINGS.PRIVACY_POLICY_EMAIL">Privacy_Policy_Email</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.enablePrivacyPolicyEmail" class="md-block no-margin-top">\n\n            <input type="number" name="privacyPolicyEmail" ng-model="vm.general.privacyPolicyEmail" min="0" value="0" ng-required="true">\n\n            <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n            <div ng-messages="securityForm[\'privacyPolicyEmail\'].$error" ng-show="securityForm[\'privacyPolicyEmail\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_EMAIL_REQUIRED">Privacy_Policy_Email field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_EMAIL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Email must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block no-margin-bottom">\n            <md-switch ng-change="vm.onPrivacyPolicyChange(\'name\')" ng-model="vm.general.enablePrivacyPolicyName" aria-label="Privacy_Policy_Name"><span translate="SETTINGS.PRIVACY_POLICY_NAME">Privacy_Policy_Name</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.enablePrivacyPolicyName" class="md-block no-margin-top">\n\n            <input type="number" name="privacyPolicyName" ng-model="vm.general.privacyPolicyName" min="0" value="0" ng-required="true">\n\n            <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n            <div ng-messages="securityForm[\'privacyPolicyName\'].$error" ng-show="securityForm[\'privacyPolicyName\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NAME_REQUIRED">Privacy_Policy_Name field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NAME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Name must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block no-margin-bottom">\n            <md-switch ng-change="vm.onPrivacyPolicyChange(\'number\')" ng-model="vm.general.enablePrivacyPolicyNumber" aria-label="Privacy_Policy_Number"><span translate="SETTINGS.PRIVACY_POLICY_NUMBER">Privacy_Policy_Number</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.enablePrivacyPolicyNumber" class="md-block no-margin-top">\n\n            <input type="number" name="privacyPolicyNumber" ng-model="vm.general.privacyPolicyNumber" min="0" value="0" ng-required="true">\n\n            <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n            <div ng-messages="securityForm[\'privacyPolicyNumber\'].$error" ng-show="securityForm[\'privacyPolicyNumber\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NUMBER_REQUIRED">Privacy_Policy_Number field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Number must be a valid greater or equal than</span> <span>0</span>\n              </div>\n            </div>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.disabledCookie" aria-label="Disabled_Cookie"><span translate="SETTINGS.DISABLED_COOKIE">Disabled_Cookie</span></md-switch>\n          </md-input-container>\n        </form>\n      </div>\n\n      <div class="general-detail-form-container imapgeneralsettings md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.IMAPGENERALSETTINGS">IMAPGENERALSETTINGS</div>\n        </div>\n        <form name="imapGeneralSettingsForm" novalidate>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.LOGINMAILFREQUENCY">loginMailFrequency</label>\n            <input type="number" name="loginMailFrequency" ng-model="vm.general.loginMailFrequency" min="10" value="10" ng-required="true" autofocus>\n\n            <div class="hint"><span translate="SETTINGS.HELP.LOGINMAILFREQUENCY"></span></div>\n            <div ng-messages="imapGeneralSettingsForm[\'loginMailFrequency\'].$error" ng-show="imapGeneralSettingsForm[\'loginMailFrequency\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.LOGINMAILFREQUENCY_REQUIRED">loginMailFrequency field is required</span>\n              </div>\n              <div ng-message="min">\n                <span translate="SETTINGS.ERRORS.LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">loginMailFrequency must be a valid greater or equal than</span> <span>10</span>\n              </div>\n            </div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div class="general-detail-form-container sso md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.SSO">SSO</div>\n        </div>\n        <form name="SSOForm" novalidate>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.googleSsoEnabled" aria-label="Google_SSO_enabled"><span translate="SETTINGS.GOOGLE_SSO_ENABLED">Google_SSO_enabled</span></md-switch>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.adSsoEnabled" aria-label="AD_SSO_enabled"><span translate="SETTINGS.AD_SSO_ENABLED">AD_SSO_enabled</span></md-switch>\n          </md-input-container>\n\n        </form>\n      </div>\n\n      <div ng-if="vm.license.ai" class="general-detail-form-container aitools md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.AITOOLS">AITOOLS</div>\n        </div>\n        <form name="aiToolsForm" novalidate>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.LANGUAGE">Language</label>\n            <md-select name="language" ng-model="vm.general.language" autofocus required>\n              <md-option ng-value="\'en-US\'">US English</md-option>\n              <md-option ng-value="\'en-AU\'">Australian English</md-option>\n              <md-option ng-value="\'en-GB\'">British English</md-option>\n              <md-option ng-value="\'en-AB\'">Scottish English</md-option>\n              <md-option ng-value="\'en-WL\'">Welsh English</md-option>\n              <md-option ng-value="\'en-IE\'">English (Ireland)</md-option>\n              <md-option ng-value="\'en-IN\'">Indian English</md-option>\n              <md-option ng-value="\'hi-IN\'">Hindi (India)</md-option>\n              <md-option ng-value="\'fr-CA\'">Canadian French</md-option>\n              <md-option ng-value="\'fr-FR\'">French</md-option>\n              <md-option ng-value="\'de-DE\'">German</md-option>\n              <md-option ng-value="\'de-CH\'">German (Switzerland)</md-option>\n              <md-option ng-value="\'it-IT\'">Italian</md-option>\n              <md-option ng-value="\'es-ES\'">Spanish</md-option>\n              <md-option ng-value="\'es-Us\'">US Spanish</md-option>\n              <md-option ng-value="\'pt-BR\'">Brazilian Portuguese</md-option>\n              <md-option ng-value="\'pt-PT\'">Portuguese(Portugal)</md-option>\n              <md-option ng-value="\'ar-SA\'">Modern Standard Arabic</md-option>\n              <md-option ng-value="\'ar-AE\'">Arabic</md-option>\n              <md-option ng-value="\'zh-CN\'">Chinese Mandarin - Mainland</md-option>\n              <md-option ng-value="\'ja-JP\'">Japanese (Japan)</md-option>\n              <md-option ng-value="\'ko-KR\'">Korean (Korea)</md-option>\n              <md-option ng-value="\'he-IL\'">Hebrew (Israel) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'ms-MY\'">Malay (Malaysia) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'fa-IR\'">Farsi (Iran) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'ru-RU\'">Russian (Russia) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'te-IN\'">Telugu(India) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'ta-IN\'">Tamil - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'nl-NL\'">Dutch - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'tr-TR\'">Turkish (Turkey) - This language is not available for the Sentiment Analysis</md-option>\n              <md-option ng-value="\'id-ID\'">Indonesian(Indonesia) - This language is not available for the Sentiment Analysis</md-option>\n            </md-select>\n            <div ng-messages="aiToolsForm[\'language\'].$error" ng-show="aiToolsForm[\'language\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.LANGUAGE_REQUIRED">Language field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.BUCKET">Bucket</label>\n            <input type="text" name="bucket" ng-model="vm.general.bucket" ng-required="true">\n\n            <div ng-messages="aiToolsForm[\'bucket\'].$error" ng-show="aiToolsForm[\'bucket\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.BUCKET_REQUIRED">Bucket field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container class="md-block">\n            <md-switch ng-model="vm.general.transcribe" aria-label="Transcribe"><span translate="SETTINGS.TRANSCRIBE">Transcribe</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.transcribe == true" class="md-block">\n            <label translate="SETTINGS.TRANSCRIBEREGION">TranscribeRegion</label>\n            <md-select name="transcribeRegion" ng-model="vm.general.transcribeRegion" required>\n              <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n              <md-option ng-value="\'us-east-2\'">US East (Ohio)</md-option>\n              <md-option ng-value="\'us-east-2\'">US West (N. California)</md-option>\n              <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n              <md-option ng-value="\'ap-south-1\'">Asia Pacific (Mumbai)</md-option>\n              <md-option ng-value="\'ap-east-1\'">Asia Pacific (Hong Kong)</md-option>\n              <md-option ng-value="\'ap-northeast-2\'">Asia Pacific (Seoul)</md-option>\n              <md-option ng-value="\'ap-southeast-1\'">Asia Pacific (Singapore)</md-option>\n              <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n              <md-option ng-value="\'ap-northeast-1\'">Asia Pacific (Tokyo)</md-option>\n              <md-option ng-value="\'ca-central-1\'">Canada (Central)</md-option>\n              <md-option ng-value="\'eu-central-1\'">Europe (Frankfurt)</md-option>\n              <md-option ng-value="\'eu-west-1\'">Europe (Ireland)</md-option>\n              <md-option ng-value="\'eu-west-2\'">Europe (London)</md-option>\n              <md-option ng-value="\'eu-west-3\'">Europe (Paris)</md-option>\n              <md-option ng-value="\'me-south-1\'">Middle East (Bahrain)</md-option>\n              <md-option ng-value="\'sa-east-1\'">South America (São Paulo)</md-option>\n            </md-select>\n            <div ng-messages="aiToolsForm[\'transcribeRegion\'].$error" ng-show="aiToolsForm[\'transcribeRegion\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.TRANSCRIBEREGION_REQUIRED">TranscribeRegion field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if="vm.general.transcribe == true" class="md-block">\n            <label translate="SETTINGS.TRANSCRIBEACCOUNT">TranscribeAccount</label>\n            <md-select name="transcribeAccountId" ng-model="vm.general.transcribeAccountId" required>\n              <md-option ng-value="transcribeAccountId.id" ng-repeat="transcribeAccountId in vm.cloudProviders" ng-disabled="transcribeAccountId.canSelect === false">{{ transcribeAccountId.name }}</md-option>\n            </md-select>\n            <div ng-messages="aiToolsForm[\'transcribeAccountId\'].$error" ng-show="aiToolsForm[\'transcribeAccountId\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.TRANSCRIBEACCOUNT_REQUIRED">TranscribeAccount field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n'+"          <md-input-container ng-if=\"vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n            <md-switch ng-model=\"vm.general.sentiment\" aria-label=\"SentimentAnalysis\"><span translate=\"SETTINGS.SENTIMENTANALYSIS\">SentimentAnalysis</span></md-switch>\n          </md-input-container>\n          <md-input-container ng-if=\"vm.general.sentiment == true && vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n            <label translate=\"SETTINGS.SENTIMENTREGION\">SentimentRegion</label>\n            <md-select name=\"sentimentRegion\" ng-model=\"vm.general.sentimentRegion\" required>\n              <md-option ng-value=\"'us-east-1'\">US East (N. Virginia)</md-option>\n              <md-option ng-value=\"'us-east-2'\">US East (Ohio)</md-option>\n              <md-option ng-value=\"'us-west-2'\">US West (Oregon)</md-option>\n              <md-option ng-value=\"'ap-south-1'\">Asia Pacific (Mumbai)</md-option>\n              <md-option ng-value=\"'ap-northeast-2'\">Asia Pacific (Seoul)</md-option>\n              <md-option ng-value=\"'ap-southeast-1'\">Asia Pacific (Singapore)</md-option>\n              <md-option ng-value=\"'ap-southeast-2'\">Asia Pacific (Sydney)</md-option>\n              <md-option ng-value=\"'ap-northeast-1'\">Asia Pacific (Tokyo)</md-option>\n              <md-option ng-value=\"'ca-central-1'\">Canada (Central)</md-option>\n              <md-option ng-value=\"'eu-central-1'\">Europe (Frankfurt)</md-option>\n              <md-option ng-value=\"'eu-west-1'\">Europe (Ireland)</md-option>\n              <md-option ng-value=\"'eu-west-2'\">Europe (London)</md-option>\n            </md-select>\n            <div ng-messages=\"aiToolsForm['sentimentRegion'].$error\" ng-show=\"aiToolsForm['sentimentRegion'].$touched\" role=\"alert\">\n              <div ng-message=\"required\">\n                <span translate=\"SETTINGS.ERRORS.SENTIMENTREGION_REQUIRED\">SentimentRegion field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n          <md-input-container ng-if=\"vm.general.sentiment == true && vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n            <label translate=\"SETTINGS.SENTIMENTACCOUNT\">SentimentAccount</label>\n            <md-select name=\"sentimentAccountId\" ng-model=\"vm.general.sentimentAccountId\" required>\n              <md-option ng-value=\"sentimentAccountId.id\" ng-repeat=\"sentimentAccountId in vm.cloudProviders\" ng-disabled=\"sentimentAccountId.canSelect === false\">{{ sentimentAccountId.name }}</md-option>\n            </md-select>\n            <div ng-messages=\"aiToolsForm['sentimentAccountId'].$error\" ng-show=\"aiToolsForm['sentimentAccountId'].$touched\" role=\"alert\">\n              <div ng-message=\"required\">\n                <span translate=\"SETTINGS.ERRORS.SENTIMENTACCOUNT_REQUIRED\">SentimentAccount field is required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n        </form>\n      </div>\n\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/license.html",'<div id="license" class="page-layout simple fullwidth doc-page">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.LICENSE">LICENSE</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    \x3c!-- <div>\n                <md-button type="submit" ng-click="vm.requestLicense()" class="send-button md-raised" translate="SETTINGS.REQUEST_LICENSE" translate-attr-aria-label="SETTINGS.REQUEST_LICENSE">\n                    REQUEST LICENSE\n                </md-button>\n            </div> --\x3e\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n      \x3c!-- LICENSE CARD --\x3e\n      <div layout="row" flex>\n        <md-card class="md-whiteframe-1dp padding-20" flex>\n          <div layout="row" layout-align="center">\n            <div flex layout="row" layout-align="start center">\n              <div ng-if="!vm.license.custom">\n                <a href="https://www.xcally.com/plans.html" target="_blank" class="md-button md-fab green-A700-bg" aria-label="Eat cake">\n                  <md-tooltip><span translate="SETTINGS.PRICES">Prices</span></md-tooltip>\n                  <md-icon md-font-icon="icon-coin"></md-icon>\n                </a>\n              </div>\n            </div>\n            <div flex>\n              <div ng-switch="vm.license.months" class="text-center">\n                <span ng-switch-when="1" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></span>\n                <span ng-switch-when="12" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.ANNUALLY">ANNUALLY</span></span>\n                <span ng-switch-when="36" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.PERPETUAL">PERPETUAL</span></span>\n              </div>\n            </div>\n            <div flex layout="row" layout-align="end center">\n              <div>\n                <md-button type="submit" ng-click="vm.updateLicense()" class="md-button md-fab md-accent">\n                  <md-tooltip><span translate="SETTINGS.UPDATE_LICENSE">License</span></md-tooltip>\n                  <md-icon md-font-icon="icon-pencil"></md-icon>\n                </md-button>\n                <md-button type="submit" ng-if="vm.isAdmin" ng-click="vm.downloadLogFile()" class="md-button md-fab md-accent">\n                  <md-tooltip><span translate="SETTINGS.DOWNLOAD_LICENSE_LOG_FILE">Download license log file</span></md-tooltip>\n                  <md-icon md-font-icon="icon-download"></md-icon>\n                </md-button>\n              </div>\n            </div>\n          </div>\n\n          <span ng-if="!vm.license.demo && !vm.license.gray && vm.license.months != 36" class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_DATE\' | translate }}: {{vm.license.expiration | date: \'longDate\'}}</span>\n          <span class="text-center padding-bottom-10"> {{ vm.license.machineUuid !== vm.license.uuid ? \'SETTINGS.OLD_TOKEN\' : \'SETTINGS.TOKEN\' | translate }}: <span ngclipboard data-clipboard-target="#licenseUuid" ngclipboard-success="vm.alert({title: \'clipboard\',  msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});" id="licenseUuid" class="hover-token text-italic text-bold">{{vm.license.uuid}}</span>\n            \x3c!--<md-button class="md-button md-fab md-accent" ngclipboard data-clipboard-target="#licenseUuid" ngclipboard-success="vm.alert({title: \'clipboard\',  msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n            <md-tooltip><span translate="SETTINGS.COPY_LICENSE">Copy</span></md-tooltip>\n            <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n          </md-button>--\x3e\n          </span>\n\n          <div layout="column">\n            <span ng-if="vm.license.grayReason == \'changed\'" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.NEW_TOKEN_DETECTED\' | translate }}</span>\n            <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.NEW_TOKEN\' | translate }}: <span id="licenseMachineUuid" ngclipboard data-clipboard-target="#licenseMachineUuid" ngclipboard-success="vm.alert({title: \'clipboard\',  msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});" class="hover-token text-italic text-bold">{{vm.license.machineUuid}}</span>\n              \x3c!--<md-button class="md-button md-fab md-accent" ngclipboard data-clipboard-target="#licenseMachineUuid" ngclipboard-success="vm.alert({title: \'clipboard\',  msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                <md-tooltip><span translate="SETTINGS.COPY_LICENSE">Copy</span></md-tooltip>                \n                <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n              </md-button>--\x3e\n            </span>\n            <span ng-if="vm.license.gray" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_GRAY_PERIOD\' | translate }}: {{vm.license.deadline | date: \'longDate\'}}</span>\n            <span ng-if="vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold"> {{\'SETTINGS.EXPIRATION_REASON\' | translate }} </span>\n            <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_DISABLED\' | translate }}</span>\n            <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_CHANGED\' | translate }}</span>\n            <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_CHANGED_ADVISE\' | translate }}</span>\n            <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=New%20token%20detected&body=Hi xCALLY, New Token: {{vm.license.machineUuid}}, Old token: {{vm.license.uuid}}">license@xcally.com</a>.</span>\n            <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=License%20disabled&body=Hi xCALLY, My Token: {{vm.license.machineUuid}}">license@xcally.com</a>.</span>\n          </div>\n\n          <div ng-if="vm.license.demo" layout="column">\n            <span class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.TRIAL_VERSION\' | translate }}</span>\n            <span class="md-subhead md-warn-fg text-center"><a href="https://www.xcally.com/en/index.html#pricing-table2-h" target="_blank">{{ \'SETTINGS.PRICES\' | translate}}</a></span>\n          </div>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" flex="33">\n              <md-icon md-font-icon="icon-account" class="md-avatar-icon"></md-icon>\n              <div class="md-list-item-text">\n                <h3>{{ vm.license.users || 0 }} <span ng-class="{\'red-fg\': vm.license.users <= vm.users && vm.license.users > 0}">({{vm.license.users >= vm.users ? vm.users : vm.license.users}})</span></h3>\n                <p translate="SETTINGS.USERS">Users</p>\n              </div>\n            </md-list-item>\n            <md-list-item class="md-2-line" flex="33">\n              <md-icon md-font-icon="icon-headphones" class="md-avatar-icon"></md-icon>\n              <div class="md-list-item-text">\n                <h3>{{ vm.license.agents || 0 }} <span ng-class="{\'red-fg\': (vm.license.agents <= vm.agents && vm.license.agents > 0) }">({{vm.license.agents >= vm.agents ? vm.agents : vm.license.agents}})</span></h3>\n                <p translate="SETTINGS.AGENTS">Agents</p>\n              </div>\n            </md-list-item>\n            <md-list-item class="md-2-line" flex="33">\n              <md-icon md-font-icon="icon-phone" class="md-avatar-icon"></md-icon>\n              <div class="md-list-item-text">\n                <h3>{{ vm.license.telephones || 0 }} <span ng-class="{\'red-fg\': vm.license.telephones <= vm.telephones && vm.license.telephones > 0}">({{vm.license.telephones >= vm.telephones ? vm.telephones : vm.license.telephones}})</span></h3>\n                <p translate="SETTINGS.TELEPHONES">Telephones</p>\n              </div>\n            </md-list-item>\n          </md-list>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3">\n              <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n                <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n          <md-list layout="row">\n            <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:3">\n              <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n                <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n          <md-list layout="row">\n            <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:6">\n              <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n                <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="module in vm.modules" flex="33">\n              <md-icon md-font-icon="{{module.icon}}" class="md-avatar-icon" ng-class="vm.license[module.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{module.name | uppercase}}"></h3>\n                <p ng-class="vm.license[module.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[module.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <div ng-repeat="session in vm.sessions" flex="33">\n              <md-list-item class="md-2-line">\n                <md-icon md-font-icon="{{session.icon}}" class="md-avatar-icon" ng-class="vm.license[session.enabled] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n                <div class="md-list-item-text">\n                  <div layout="row" layout="start center">\n                    <h3 translate="SETTINGS.{{session.name | uppercase}}"></h3>\n                    <button ng-if="session.restart" ng-click="vm.gotoProcess($event)" class="md-mini" aria-label="restart">\n                      <md-tooltip>Restart</md-tooltip>\n                      <md-icon md-font-icon="icon-reload"></md-icon>\n                    </button>\n                  </div>\n                  <p ng-if="vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">{{vm.license[session.name]}} {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n                  <p ng-if="!vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">UNLIMITED {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n                  <p ng-if="!vm.license[session.enabled]" class="red-A700-fg">{{ \'SETTINGS.DISABLED\' | translate }}</p>\n                </div>\n              </md-list-item>\n\n            </div>\n          </md-list>\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="addon in vm.addons | limitTo:3" flex="33">\n              <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n                <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="addon in vm.addons | limitTo:3:3" flex="33">\n              <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n                <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n\n\n          <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n          <md-divider></md-divider>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="other in vm.others | limitTo:3" flex="33">\n              <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n                <p ng-class="vm.license[other.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[other.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n          <md-list layout="row">\n            <md-list-item class="md-2-line" ng-repeat="other in vm.others | limitTo:3:3" flex="33">\n              <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n              <div class="md-list-item-text">\n                <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n'+"                <p ng-class=\"vm.license[other.name] ? 'green-A700-fg' : 'red-A700-fg'\">{{ 'SETTINGS.' + (vm.license[other.name] ? 'ENABLED' : 'DISABLED') | translate }}</p>\n              </div>\n            </md-list-item>\n          </md-list>\n        </md-card>\n      </div>\n      \x3c!-- / LICENSE CARD --\x3e\n\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/request/dialog.html",'<md-dialog class="request-dialog" aria-label="Send Request">\n  <form name="requestForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="SETTINGS.REQUEST_LICENSE">Request License</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.license.name" required>\n        <div ng-messages="requestForm.name.$error" ng-show="requestForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Address field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.license.email" required>\n        <div ng-messages="requestForm.email.$error" ng-show="requestForm.email.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="SETTINGS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.PLAN">Plan</label>\n        <md-select name="plan" ng-model="vm.license.months" required>\n          <md-option ng-value="1"><span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></md-option>\n          <md-option ng-value="12"><span translate="SETTINGS.ANNUALLY">ANNUALLY</span></md-option>\n          <md-option ng-value="36"><span translate="SETTINGS.PERPETUAL">PERPETUAL</span></md-option>\n        </md-select>\n        <div ng-messages="requestForm.plan.$error" ng-show="requestForm.plan.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.PLAN_REQUIRED">Plan field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-input-container class="md-block" flex>\n          <label translate="SETTINGS.USERS">Users</label>\n          <input type="number" name="users" ng-model="vm.license.users" required>\n          <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block" flex>\n          <label translate="SETTINGS.AGENTS">Agents</label>\n          <input type="number" name="agents" ng-model="vm.license.agents" required>\n          <div ng-messages="requestForm.agents.$error" ng-show="requestForm.agents.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.AGENTS_REQUIRED">Agents field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container class="md-block" flex>\n          <label translate="SETTINGS.TELEPHONES">Telephones</label>\n          <input type="number" name="telephones" ng-model="vm.license.telephones" required>\n          <div ng-messages="requestForm.telephones.$error" ng-show="requestForm.telephones.$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.TELEPHONES_REQUIRED">Telephones field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n        <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-switch ng-model="vm.license[module.name]" aria-label="{{module.name}}" ng-repeat="module in vm.modules"><span translate="SETTINGS.{{module.name | uppercase}}"></span></md-switch>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n      <div layout="row">\n        <md-input-container ng-repeat="session in vm.sessions" class="md-block" flex="50">\n          <label>{{ \'SETTINGS.\' + session.name | uppercase | translate }} ({{ \'SETTINGS.\' + session.label | uppercase | translate }})</label>\n          <input type="number" name="{{session.name}}" ng-model="vm.license[session.name]" required>\n          <div class="hint"><span>0={{ \'SETTINGS.UNLIMITED_CHANNELS\' | translate }}</span></div>\n          <div ng-messages="requestForm[session.name].$error" ng-show="requestForm[session.name].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="SETTINGS.ERRORS.CHANNEL_REQUIRED">Mandatory field</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-switch ng-model="vm.license[addon.name]" aria-label="{{module.name}}" ng-repeat="addon in vm.addons"><span translate="SETTINGS.{{addon.name | uppercase}}"></span></md-switch>\n      </div>\n\n      <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n      <div layout="row" layout-align="space-between center">\n        <md-switch ng-model="vm.license[other.name]" aria-label="{{other.name}}" ng-repeat="other in vm.others"><span translate="SETTINGS.{{other.name | uppercase}}"></span></md-switch>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.DESCRIPTION">Description</label>\n        <textarea name="description" ng-model="vm.license.description"></textarea>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.sendRequest()" class="send-button md-accent md-raised" ng-disabled="requestForm.$invalid || requestForm.$pristine" aria-label="SEND" translate="SETTINGS.SEND" translate-attr-aria-label="SETTINGS.SEND">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/license/update/dialog.html",'<md-dialog class="update-dialog" aria-label="Update License">\n  <form name="updateForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title" translate="SETTINGS.UPDATE_LICENSE">Update License</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-content layout="row">\n        <span class="md-title" translate="SETTINGS.UPDATE_LICENSE_MANUALLY">Do you want to update your license manually?</span>\n      </md-content>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.ENTER_LICENSE">Enter your license</label>\n        <textarea name="key" ng-model="vm.licenseKey" required></textarea>\n        <div ng-messages="updateForm.name.$error" ng-show="updateForm.key.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.LICENSE_REQUIRED">License key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.updateLicense()" class="send-button md-accent md-raised" ng-disabled="updateForm.$invalid || updateForm.$pristine" aria-label="UPDATE" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">\n          UPDATE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/create/dialog.html",'<md-dialog class="network-dialog" aria-label="New Network">\n  <form name="networkForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SETTINGS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.network.type" autofocus required>\n          <md-option ng-value="\'localnet\'">LocalNET</md-option>\n          <md-option ng-value="\'externip\'">ExternIP</md-option>\n          <md-option ng-value="\'turn\'">Turn</md-option>\n          <md-option ng-value="\'stun\'">Stun</md-option>\n        </md-select>\n        <div ng-messages="networkForm[\'type\'].$error" ng-show="networkForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'localnet\'" class="md-block">\n        <label translate="SETTINGS.LOCALNETADDRESS">localNetAddress</label>\n        <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n        <div class="hint"><span translate="SETTINGS.HELP.LOCALNETADDRESS"></span></div>\n        <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_REQUIRED">localNetAddress field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">localNetAddress must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'externip\'" class="md-block">\n        <label translate="SETTINGS.ADDRESS">Address</label>\n        <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n        <div class="hint"><span translate="SETTINGS.HELP.ADDRESS"></span></div>\n        <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="SETTINGS.ERRORS.ADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">Address must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'turn\' || vm.network.type == \'stun\'" class="md-block">\n        <label translate="SETTINGS.ADDRESS">Address</label>\n        <input type="text" name="value" ng-model="vm.network.value" ng-required="true">\n\n        <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'turn\'" class="md-block">\n        <label translate="SETTINGS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.network.username" ng-required="vm.network.type == \'turn\'">\n\n        <div class="hint"><span translate="SETTINGS.HELP.USERNAME"></span></div>\n        <div ng-messages="networkForm[\'username\'].$error" ng-show="networkForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.network.type == \'turn\'" class="md-block">\n        <label translate="SETTINGS.PASSWORD">Password</label>\n        <input type="text" name="password" ng-model="vm.network.password" ng-required="vm.network.type == \'turn\'">\n\n        <div class="hint"><span translate="SETTINGS.HELP.PASSWORD"></span></div>\n        <div ng-messages="networkForm[\'password\'].$error" ng-show="networkForm[\'password\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newNetwork" ng-click="vm.saveNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid || networkForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newNetwork" ng-click="vm.addNewNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_NETWORK" translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n          ADD NETWORK\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-click="vm.deleteNetwork($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/networks.html",'<div id="networks" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.NETWORKS">Networks</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedNetworks.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedNetworks =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="SETTINGS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-networks-count">\n          <span>{{vm.selectedNetworks.length}}</span>\n          <span translate="SETTINGS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SETTINGS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllNetworks()" translate="SETTINGS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectNetworks()" translate="SETTINGS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedNetworks" csv-label="true" filename="networks.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-click="vm.deleteSelectedNetworks($event)" aria-label="delete selected" translate translate-attr-label="SETTINGS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- NETWORK TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedNetworks" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getNetworks">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'SETTINGS.TYPE\' | translate }}</th>\n                <th md-column md-order-by="value">{{ \'SETTINGS.ADDRESS\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'SETTINGS.CREATED_AT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.networks.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="network" md-select-id="id" ng-repeat="network in vm.networks.rows">\n                <td md-cell ng-if="network.userpic"><img class="avatar" alt="{{network.name}}" ng-src="api/users/{{network.id}}/avatar" /></td>\n                <td md-cell ng-if="!network.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{network.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="id ">{{network.id}}</td>\n                <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="type ">{{ vm.arraytype[network.type].option }}</td>\n                <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="value ">{{network.value}}</td>\n                <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="createdAt ">{{network.createdAt | date:\'medium\' }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.editdialog(network, $event    )" translate="SETTINGS.EDIT_NETWORK">\n                          Edit Network\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.deleteconfirm(network, $event    )" translate="SETTINGS.DELETE_NETWORK">\n                          Delete Network\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.networks.count}}" md-on-paginate="vm.getNetworks" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / NETWORK TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD NETWORK BUTTON --\x3e\n  <md-button class="md-fab md-accent" id="add-network-button" ng-click="vm.createOrEditNetwork($event)" aria-label="add network" translate translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD NETWORK BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/smtps/smtps.html",'<div id="smtps" class="page-layout simple left-sidenav inner-sidenav">\n\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.SMTP">Smtp</span>\n      </div>\n    </div>\n\n    <div>\n      <md-button type="submit" ng-click="vm.verifySmtp()" ng-disabled="!vm.mailAccount.id" class="send-button md-accent md-raised" translate="SETTINGS.VERIFY" translate-attr-aria-label="SETTINGS.VERIFY">\n        VERIFY\n      </md-button>\n      <md-button type="submit" ng-click="vm.saveSmtp()" ng-disabled="(generalForm.$pristine) || (generalForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    <div class="main scrollable">\n      <div class="smtp-detail-form-container general md-background-bg md-whiteframe-1dp">\n        <div class="pb-16" layout="row" layout-align="start center">\n          <div class="h2 secondary-text" translate="SETTINGS.GENERAL">GENERAL</div>\n        </div>\n        <form name="generalForm" novalidate>\n\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.ACCOUNTNAME">Name</label>\n            <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n            <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Name field required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n          <md-input-container class="md-block">\n            <label translate="SETTINGS.DESCRIPTION">Description</label>\n            <input type="" name="description" ng-model="vm.mailAccount.description">\n          </md-input-container>\n\n          <md-input-container class="md-block mt-0">\n            <label translate="SETTINGS.EMAILADDRESS">Email Address</label>\n            <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n            <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n            <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Email Address field required</span>\n              </div>\n              <div ng-message="email">\n                <span translate="SETTINGS.ERRORS.WRONG_FORMAT">Email Address must be a valid e-mail address</span>\n              </div>\n            </div>\n          </md-input-container>\n\n          <md-input-container class="md-block mt-30">\n            <label translate="SETTINGS.SMTP_SERVICE">Service</label>\n            <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" required>\n              <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n            </md-select>\n            <div ng-messages="generalForm[\'provider\'].$error" ng-show="generalForm[\'provider\'].$touched" role="alert">\n              <div ng-message="required">\n                <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Service field required</span>\n              </div>\n            </div>\n          </md-input-container>\n\n          <div ng-if="vm.mailAccount.provider === \'custom\'">\n            <md-input-container class="md-block mt-30">\n              <label translate="SETTINGS.SMTP_HOST">Host</label>\n              <input type="text" name="host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n              <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Host field required</span>\n                </div>\n              </div>\n            </md-input-container>\n            <md-input-container class="md-block">\n              <label translate="SETTINGS.SMTP_PORT">Port</label>\n              <input type="number" name="port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true">\n              <div ng-messages="generalForm[\'port\'].$error" ng-show="generalForm[\'port\'].$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Port field required</span>\n                </div>\n              </div>\n            </md-input-container>\n            <md-input-container class="md-block">\n              <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="SMTP Secure"><span translate="SETTINGS.SMTP_SECURE">Secure</span></md-switch>\n              <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n            </md-input-container>\n            <md-input-container class="md-block">\n              <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="SMTP Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">Authentication</span></md-switch>\n            </md-input-container>\n          </div>\n\n          <div ng-if="vm.mailAccount.Smtp.authentication || (vm.mailAccount.provider && vm.mailAccount.provider !== \'custom\')">\n            <md-input-container ng-if="vm.mailAccount.provider === \'outlook365\'" class="md-block">\n              <md-switch ng-model="vm.mailAccount.Smtp.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n            </md-input-container>\n\n            <md-input-container class="md-block">\n              <label translate="SETTINGS.SMTP_USERNAME">Username</label>\n              <input type="text" name="username" ng-model="vm.mailAccount.Smtp.user" ng-required="true">\n              <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n              <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Username field required</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container ng-if="vm.mailAccount.Smtp.modernAuthentication" class="md-block">\n              <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n              <md-select name="cloudProvider" ng-model="vm.mailAccount.Smtp.CloudProviderId" required>\n                <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n              </md-select>\n              <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n              <div ng-messages="generalForm[\'cloudProvider\'].$error" ng-show="generalForm[\'cloudProvider\'].$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n                </div>\n              </div>\n            </md-input-container>\n\n            <md-input-container ng-if="!vm.mailAccount.Smtp.modernAuthentication" class="md-block">\n              <label translate="SETTINGS.SMTP_PASSWORD">Password</label>\n              <input type="password" name="password" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n              <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n              <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                <div ng-message="required">\n                  <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Password field required</span>\n                </div>\n              </div>\n            </md-input-container>\n          </div>\n        </form>\n      </div>\n    </div>\n\n  </div>\n</div>'),e.put("app/main/apps/settings/views/system/system.html",'<div id="system" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.SYSTEM">SYSTEM</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" md-border-bottom flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SETTINGS.GENERAL">GENERAL</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="system-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n            <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n              <ms-widget flex="50" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg">\n                    <div class="h3">OS</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="h4">{{vm.system.system.manufacturer}} {{vm.system.system.model}}</div>\n                        <div class="h4">{{vm.system.cpu.manufacturer}} {{vm.system.cpu.brand}} - {{vm.system.cpu.speed}} GHz - {{vm.system.cpu.cores}} Cores</div>\n                        <div class="h4">{{vm.system.os.distro}} - {{vm.system.os.release}} - Kernel: {{vm.system.os.kernel}}</div>\n                        <div class="h4">Node.js: {{vm.system.node}}</div>\n                        <div class="h4">Host: {{vm.system.os.hostname}} - Uptime: {{vm.system.time.uptime / 60 | number:0}} m</div>\n                        <div class="h4">TimeZone: {{vm.system.time.timezone}} ({{vm.system.time.timezoneName}})</div>\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n              <ms-widget flex="25" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-1">\n                    <div class="h3">CPU</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="pb-8" layout="row" layout-align="space-between start">\n                          <span class="h3" translate="SETTINGS.AVG_LOAD">AVG Load</span>\n                          <span class="h3 secondary-text font-weight-500">{{vm.system.currentLoad.avgload * 100 | number:0}}%</span>\n                        </div>\n                        <md-progress-linear class="red" md-mode="determinate" value="{{vm.system.currentLoad.avgload * 100 | number:0}}"></md-progress-linear>\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n              <ms-widget flex="25" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n                    <div class="h3">MEM</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{vm.system.mem.total / 1024 / 1024 / 1024 | number:0}} GB</div>\n                        <div class="h4">{{\'SETTINGS.FREE\' | translate}}: {{vm.system.mem.available / 1024 / 1024 / 1024 | number:0}} GB</div>\n                        <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{vm.system.mem.active / 1024 / 1024 / 1024 | number:0}} GB</div>\n                      </div>\n                      <div class="p-16 pb-32">\n                        <div class="pb-8" layout="row" layout-align="space-between start">\n                          <span class="h3" translate="SETTINGS.USED">Used</span>\n                          <span class="h3 secondary-text font-weight-500">{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0}}%</span>\n                        </div>\n                        <md-progress-linear class="md-warn" md-mode="determinate" value="{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0 }}"></md-progress-linear>\n\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n            </md-card>\n\n            <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n              <ms-widget ng-repeat="disk in vm.system.fsSize" flex="25" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n                    <div class="h3">DISK {{$index + 1}}</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="h4">{{\'SETTINGS.FILE_SYSTEM\' | translate}}: {{disk.fs}}</div>\n                        <div class="h4">{{\'SETTINGS.MOUNT_POINT\' | translate}}: "{{disk.mount}}"</div>\n                        <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{disk.size / 1024 / 1024 / 1024 | number:0}} GB</div>\n                        <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{disk.used / 1024 / 1024 / 1024 | number:0}} GB</div>\n                      </div>\n                      <div class="p-16 pb-32">\n                        <div class="pb-8" layout="row" layout-align="space-between start">\n                          <span class="h3" translate="SETTINGS.USED">Used</span>\n                          <span class="h4 secondary-text font-weight-500">{{disk.use | number:0}}%</span>\n                        </div>\n                        <md-progress-linear class="red" md-mode="determinate" value="{{disk.use | number:0}}"></md-progress-linear>\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n            </md-card>\n\n            <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n              <ms-widget ng-repeat="net in vm.system.net" flex="25" flex-xs="100">\n                \x3c!-- Front --\x3e\n                <ms-widget-front class="white-bg">\n                  <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n                    <div class="h3">NET {{$index + 1}}</div>\n                  </div>\n\n                  <div layout="row" layout-align="start center" layout-wrap>\n                    <div flex="100" flex-gt-md="100">\n                      <div class="p-16 pb-32">\n                        <div class="h4">{{\'SETTINGS.INTERFACE\' | translate}}: {{net.iface}}</div>\n                        <div class="h4">IPv4: {{net.ip4}}</div>\n                        <div class="h4">IPv6: {{net.ip6}}</div>\n                        <div class="h4">MAC: {{net.mac}}</div>\n                      </div>\n                    </div>\n                  </div>\n                </ms-widget-front>\n                \x3c!-- / Front --\x3e\n              </ms-widget>\n            </md-card>\n\n            <md-card class="md-whiteframe-1dp padding-20" layout="row">\n              <div flex>\n                <md-toolbar class="md-table-toolbar md-default">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="SETTINGS.TOP_N_PROCESSES" translate-values="{value: vm.processLimit}"></span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm.searchTerm1 = query" on-collapse="vm.searchTerm1 = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table>\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column>pid</th>\n                        <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n                        <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n                        <th md-column>pmem</th>\n                        <th md-column>pcpu</th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-repeat="process in vm.system.processes.list | limitTo: vm.processLimit | filter: vm.searchTerm1 | orderBy:\'-pcpu\'">\n                        <td md-cell>{{process.pid}}</td>\n                        <td md-cell>{{process.command}}</td>\n                        <td md-cell>\n                          <span class="text-boxed white-fg" ng-class="{\n                          \'green-600-bg\': process.state == \'running\',\n                          \'yellow-600-bg\': process.state == \'sleeping\',\n                          \'red-600-bg\': process.state == \'blocked\'}">{{process.state | uppercase}}</span>\n                        </td>\n                        <td md-cell>{{process.pmem}}%</td>\n                        <td md-cell>{{process.pcpu}}%</td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n              </div>\n            </md-card>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SETTINGS.PROCESSES">PROCESSES</span>\n        </md-tab-label>\n\n        <md-tab-body>\n          <div class="system-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <md-card class="md-whiteframe-1dp padding-20" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="SETTINGS.MOTION_PROCESS_MANAGEMENT"></span>\n                  <div flex></div>\n                  <ms-search-bar on-search="vm.searchTerm2 = query" on-collapse="vm.searchTerm2 = undefined" debounce="300"></ms-search-bar>\n                  <md-button ng-click="vm.getProcesses()" class="md-icon-button" aria-label="Reload">\n                    <md-icon md-font-icon="icon-reload" class="s24"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container>\n                <table md-table>\n                  <thead md-head>\n                    <tr md-row>\n                      <th md-column>id</th>\n                      <th md-column>pid</th>\n                      <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n                      <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n                      <th md-column>MEM</th>\n                      <th md-column>CPU</th>\n                      <th md-column width="20px">Actions</th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row ng-repeat="process in vm.processes | filter: vm.searchTerm2 | orderBy:\'-monit.cpu\'">\n                      <td md-cell>{{process.pm_id}}</td>\n                      <td md-cell>{{process.pid}}</td>\n                      <td md-cell>{{process.name == \'agi\' ? \'agi (Cally Square IVR)\' : process.name}}</td>\n                      <td md-cell>\n                        <span class="text-boxed white-fg" ng-class="{\'green-600-bg\': process.pm2_env.status == \'online\', \'red-600-bg\': process.pm2_env.status == \'stopped\'}">{{process.pm2_env.status | uppercase}}</span>\n                      </td>\n                      <td md-cell>{{process.monit.memory / 1024 / 1024 | number:0}} MB</td>\n                      <td md-cell>{{process.monit.cpu}}%</td>\n                      <td md-cell>\n                        <md-button ng-if="process.pm2_env.status !== \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'online\')" class="md-icon-button" aria-label="Play">\n                          <md-icon md-font-icon="icon-play" class="s24"></md-icon>\n                        </md-button>\n                        <md-button ng-if="process.pm2_env.status === \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'stopped\')" class="md-icon-button" aria-label="Stop">\n                          <md-icon md-font-icon="icon-stop" class="s24"></md-icon>\n                        </md-button>\n                      </td>\n                    </tr>\n                  </tbody>\n                  <tfoot md-foot>\n                    <tr md-row>\n                      <td md-cell></td>\n                      <td md-cell></td>\n                      <td md-cell></td>\n                      <td md-cell></td>\n                      <td md-cell>{{ (vm.processes | map: \'monit.memory\' | sum) / 1024 / 1024 | number:0 }} MB</td>\n                      <td md-cell></td>\n                      <td md-cell></td>\n                    </tr>\n                  </tfoot>\n                </table>\n              </md-table-container>\n            </md-card>\n            <md-card class="md-whiteframe-1dp padding-20" flex>\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="SETTINGS.USEFUL_COMMANDS"></span>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-table-container>\n                <table md-table>\n                  <thead md-head>\n                    <tr md-row>\n                      <th md-column width="30%">{{\'SETTINGS.COMMAND\' | translate}}</th>\n                      <th md-column>{{\'SETTINGS.DESCRIPTION\' | translate}}</th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr>\n                      <td md-cell class="no-border">pm2 list</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_LIST\' | translate}}</td>\n                    </tr>\n                    <tr>\n                      <td md-cell class="no-border">pm2 start &lt;id | name&gt;</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_START\' | translate}}</td>\n                    </tr>\n                    <tr>\n                      <td md-cell class="no-border">pm2 stop &lt;id | name | all&gt;</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_STOP\' | translate}}</td>\n                    </tr>\n                    <tr>\n                      <td md-cell class="no-border">pm2 restart &lt;id | name&gt;</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_RESTART\' | translate}}</td>\n                    </tr>\n                    <tr>\n                      <td md-cell class="no-border">pm2 logs [id | name]</td>\n                      <td md-cell class="no-border">{{ \'SETTINGS.PM2_LOGS\' | translate}}</td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n            </md-card>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/settings/views/updates/update/dialog.html",'<md-dialog aria-label="Update">\n  <form name="updateForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n      </div>\n    </md-toolbar>\n\n    <div md-background-bg layout="row" layout-align="start start">\n      <md-progress-linear md-mode="determinate" value="{{vm.progress}}" class="md-warn"></md-progress-linear>\n    </div>\n\n    <md-dialog-content>\n      <div layout="row" layout-align="center center">\n        <div ng-if="vm.updating" layout="column" layout-align="center center">\n          <span class="text-center md-title">Grab a quick coffee and</span>\n          <span class="text-center md-title">get back here as soon as completed!</span>\n          <span class="text-center md-title">{{vm.output}}</span>\n        </div>\n        <div ng-if="!vm.updating">\n          <div ng-if="vm.success" layout="column" layout-align="center center">\n            <span class="text-center md-title">Update Completed! Thank you for your time.</span>\n            <span class="text-center md-title">In order to complete the update,</span>\n            <span class="text-center md-title">please click on reload button</span>\n          </div>\n          <div ng-if="!vm.success" layout="column" layout-align="center center">\n            <span class="text-center md-title">Update Error!</span>\n            <span class="text-center md-title">Please contact your administrator!</span>\n            <span class="text-center md-title">{{vm.output}}</span>\n          </div>\n        </div>\n        <img src="assets/images/business/users.jpg" alt="" width="128" height="128" />\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions ng-if="!vm.updating" layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.reload()" class="send-button md-warm md-raised" aria-label="RELOAD" translate="SETTINGS.RELOAD" translate-attr-aria-label="SETTINGS.RELOAD">\n          RELOAD\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/updates/updates.html",'<div id="updates" class="page-layout simple fullwidth doc-page">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SETTINGS.UPDATES">UPDATES</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n      \x3c!-- UPDATE CARD --\x3e\n      <div layout="row" ng-if="!vm.updating">\n        <md-card class="md-whiteframe-1dp padding-20" flex>\n          <div layout="column" layout-align="center center">\n\n            <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.CURRENT_VERSION">CURRENT VERSION</span>\n\n            <span class="md-display-3 padding-20">{{vm.version.current}}</span>\n\n            <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.current}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n              CHANGELOG\n            </md-button>\n          </div>\n        </md-card>\n        <md-card class="md-whiteframe-20dp padding-20" flex ng-if="vm.version.current != vm.version.latest">\n          <div layout="column" layout-align="center center">\n\n            <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.NEW_VERSION">NEW VERSION</span>\n\n            <span class="md-display-3 padding-20">{{vm.version.latest}}</span>\n\n            <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.latest}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n              CHANGELOG\n            </md-button>\n            <md-button ng-click="vm.updateConfirm($event)" class="md-raised md-warn" aria-label="CHANGELOG" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">UPDATE</md-button>\n          </div>\n        </md-card>\n        <md-card class="md-whiteframe-1dp padding-20" flex ng-if="vm.version.current == vm.version.latest">\n          <div layout="column" layout-align="center center">\n\n            <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.REMOTE_VERSION">REMOTE VERSION</span>\n\n            <span class="md-subhead padding-20" translate="SETTINGS.NO_NEW_VERSION_AVAILABLE">NO NEW VERSION AVAILABLE</span>\n          </div>\n        </md-card>\n      </div>\n      \x3c!-- / UPDATE CARD --\x3e\n\n      <div ng-if="vm.updating">\n        <md-card class="md-whiteframe-1dp padding-20" flex>\n          <div layout="column" layout-align="center center">\n            <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.UPDATING">...</span>\n            <md-progress-linear md-mode="determinate" class="md-accent padding-20" value="{{vm.progress}}"></md-progress-linear>\n            <span class="md-display-1 padding-5 text-center">Grab a quick coffee and</span>\n            <span class="md-display-1 padding-5 text-center">get back here as soon as completed</span>\n            <img src="assets/images/business/users.jpg" alt="" width="40%" height="40%" />\n          </div>\n        </md-card>\n      </div>\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="SMS.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n        <th md-column>{{ \'SMS.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'SMS.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'SMS.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="SMS.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="SMS.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/sms/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/create/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="!vm.newSmsAccount">\n\n        <div ng-messages="smsAccountForm[\'name\'].$error" ng-show="smsAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'key\'].$error" ng-show="smsAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n        <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n        <div ng-messages="smsAccountForm[\'remote\'].$error" ng-show="smsAccountForm[\'remote\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n        <div ng-messages="smsAccountForm[\'ListId\'].$error" ng-show="smsAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.smsAccount.type" required>\n          <md-option ng-value="\'twilio\'">Twilio</md-option>\n          <md-option ng-value="\'skebby\'">Skebby</md-option>\n          <md-option ng-value="\'connectel\'">Connectel</md-option>\n          <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n          <md-option ng-value="\'plivo\'">Plivo</md-option>\n          <md-option ng-value="\'infobip\'">Infobip</md-option>\n          <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n          <md-option ng-value="\'bandwidth\'">Bandwidth</md-option>\n          <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n          <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n        </md-select>\n        <div ng-messages="smsAccountForm[\'type\'].$error" ng-show="smsAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.PHONE">Phone</label>\n        <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'phone\'].$error" ng-show="smsAccountForm[\'phone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n        <label translate="SMS.ACCOUNTSID">AccountSID</label>\n        <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'accountSid\'].$error" ng-show="smsAccountForm[\'accountSid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n        <label translate="SMS.AUTHID">AuthID</label>\n        <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'authId\'].$error" ng-show="smsAccountForm[\'authId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n        <label translate="SMS.AUTHTOKEN">AuthToken</label>\n        <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'authToken\'].$error" ng-show="smsAccountForm[\'authToken\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n        <label translate="SMS.METHOD">Method</label>\n        <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n          <md-option ng-value="\'SI\'">Basic</md-option>\n          <md-option ng-value="\'TI\'">Classic</md-option>\n          <md-option ng-value="\'GP\'">Classic+</md-option>\n        </md-select>\n        <div ng-messages="smsAccountForm[\'smsMethod\'].$error" ng-show="smsAccountForm[\'smsMethod\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n        <label translate="SMS.USERNAME">Username</label>\n        <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'username\'].$error" ng-show="smsAccountForm[\'username\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'">\n        <label translate="SMS.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n        <div ng-messages="smsAccountForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'csc\'" class="md-block">\n        <label translate="SMS.BASEURL">BaseURL</label>\n        <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'baseUrl\'].$error" ng-show="smsAccountForm[\'baseUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n        <label translate="SMS.APIKEY">ApiKey</label>\n        <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'apiKey\'].$error" ng-show="smsAccountForm[\'apiKey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n        <label translate="SMS.ACCOUNTID">AccountId</label>\n        <input type="text" name="accountId" ng-model="vm.smsAccount.accountId" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'accountId\'].$error" ng-show="smsAccountForm[\'accountId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.ACCOUNTID_REQUIRED">AccountId field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n        <label translate="SMS.APPLICATIONID">ApplicationID</label>\n        <input type="text" name="applicationId" ng-model="vm.smsAccount.applicationId" ng-required="true">\n\n        <div ng-messages="smsAccountForm[\'applicationId\'].$error" ng-show="smsAccountForm[\'applicationId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.APPLICATIONID_REQUIRED">ApplicationID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.smsAccount.description">\n\n        <div ng-messages="smsAccountForm[\'description\'].$error" ng-show="smsAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsAccount" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid || smsAccountForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsAccount" ng-click="vm.addNewSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSACCOUNT" translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n          ADD SMSACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsAccount" ng-click="vm.deleteSmsAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",'<md-dialog class="smsAccount-dialog" aria-label="smsAccount" ng-init="vm.onInit()">\n  <form name="smsAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="SMS.AGENTADD_SMSACCOUNT">Add Agent to smsAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/agent/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'agent\'].$error" ng-show="smsAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.ACCESSKEYID">accesskeyid</label>\n        <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'accesskeyid\'].$error" ng-show="smsAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.SECRETACCESSKEY">secretaccesskey</label>\n        <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'secretaccesskey\'].$error" ng-show="smsAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.LEXREGION">lexregion</label>\n        <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n          <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n          <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n          <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'lexregion\'].$error" ng-show="smsAccountFormApp[\'lexregion\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.BOTNAME">botname</label>\n        <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'botname\'].$error" ng-show="smsAccountFormApp[\'botname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'times\'].$error" ng-show="smsAccountFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TEXT">Text</label>\n        <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n        <div ng-messages="smsAccountFormApp[\'text\'].$error" ng-show="smsAccountFormApp[\'text\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TEXT_REQUIRED">Text field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/close/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'disposition\'].$error" ng-show="smsAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'key\'].$error" ng-show="smsAccountFormApp[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n          <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'sv\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'language\'].$error" ng-show="smsAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.PROJECTID">ProjectID</label>\n        <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'projectId\'].$error" ng-show="smsAccountFormApp[\'projectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.CLIENTEMAIL">ClientEmail</label>\n        <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'clientEmail\'].$error" ng-show="smsAccountFormApp[\'clientEmail\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.PRIVATEKEY">PrivateKey</label>\n        <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n        <div ng-messages="smsAccountFormApp[\'privateKey\'].$error" ng-show="smsAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n          <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n          <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n          <md-option ng-value="\'en-IN\'">English (India)</md-option>\n          <md-option ng-value="\'en-US\'">English (US)</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n          <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'hi\'">Hindi</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pl\'">Polish</md-option>\n          <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n          <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n          <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n          <md-option ng-value="\'sw\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'tr\'">Turkish</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'language\'].$error" ng-show="smsAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'condition\'].$error" ng-show="smsAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'truepriority\'].$error" ng-show="smsAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'falsepriority\'].$error" ng-show="smsAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'priority\'].$error" ng-show="smsAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/noop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'value\'].$error" ng-show="smsAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/queue/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'queue\'].$error" ng-show="smsAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/system/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="smsAccountFormApp[\'command\'].$error" ng-show="smsAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'variable\'].$error" ng-show="smsAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/tag/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n  <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="smsAccountFormApp[\'tag\'].$error" ng-show="smsAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",'<md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">\n  <form name="smsCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.smsCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="smsCannedAnswerForm[\'key\'].$error" ng-show="smsCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.smsCannedAnswer.value" required></textarea>\n\n        <div ng-messages="smsCannedAnswerForm[\'value\'].$error" ng-show="smsCannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.smsCannedAnswer.description">\n\n        <div ng-messages="smsCannedAnswerForm[\'description\'].$error" ng-show="smsCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsCannedAnswer" ng-click="vm.saveSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsCannedAnswer" ng-click="vm.addNewSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSCANNEDANSWER" translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER">\n          ADD SMSCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsCannedAnswer" ng-click="vm.deleteSmsCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/view.html",'<div id="sms-smsAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-smsAccounts-button md-icon-button" aria-label="Go to smsAccounts" ng-click="vm.gotoSmsAccounts()" translate translate-attr-aria-label="SMS.GO_TO_SMSACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="smsAccount-image" hide-xs>\n          <img ng-src="assets/images/business/smsAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.smsAccount.id}}\n            <span ng-if="vm.smsAccount.name">{{vm.smsAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.smsAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="SMS.AGENTADD_SMSACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveSmsAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (smsDispositionsForm.$invalid) || (smsCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="SMS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.smsAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.smsAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'twilio\'">Twilio</md-option>\n                  <md-option ng-value="\'skebby\'">Skebby</md-option>\n                  <md-option ng-value="\'connectel\'">Connectel</md-option>\n                  <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n                  <md-option ng-value="\'plivo\'">Plivo</md-option>\n                  <md-option ng-value="\'infobip\'">Infobip</md-option>\n                  <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n                  <md-option ng-value="\'bandwidth\'">Bandwidth</md-option>\n                  <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n                  <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n                <label translate="SMS.ACCOUNTSID">AccountSID</label>\n                <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n                <label translate="SMS.AUTHID">AuthID</label>\n                <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'authId\'].$error" ng-show="generalForm[\'authId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n                <label translate="SMS.AUTHTOKEN">AuthToken</label>\n                <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n                <label translate="SMS.METHOD">Method</label>\n                <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'SI\'">Basic</md-option>\n                  <md-option ng-value="\'TI\'">Classic</md-option>\n                  <md-option ng-value="\'GP\'">Classic+</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'smsMethod\'].$error" ng-show="generalForm[\'smsMethod\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n                <label translate="SMS.USERNAME">Username</label>\n                <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'">\n                <label translate="SMS.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container ng-if="vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'csc\'" class="md-block">\n                <label translate="SMS.BASEURL">BaseURL</label>\n                <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n                <label translate="SMS.APIKEY">ApiKey</label>\n                <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n                <label translate="SMS.ACCOUNTID">AccountId</label>\n                <input type="text" name="accountId" ng-model="vm.smsAccount.accountId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'accountId\'].$error" ng-show="generalForm[\'accountId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.ACCOUNTID_REQUIRED">AccountId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n                <label translate="SMS.APPLICATIONID">ApplicationID</label>\n                <input type="text" name="applicationId" ng-model="vm.smsAccount.applicationId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'applicationId\'].$error" ng-show="generalForm[\'applicationId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.APPLICATIONID_REQUIRED">ApplicationID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'plivo\'|| vm.smsAccount.type == \'csc\'|| vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n                <label translate="SMS.SENDERSTRING">SenderString</label>\n                <input type="text" name="senderString" ng-model="vm.smsAccount.senderString" md-maxlength="11" ng-pattern="/^[A-Za-z0-9\\.\\s]*$/i" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'senderString\'].$error" ng-show="generalForm[\'senderString\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.SENDERSTRING_REQUIRED">SenderString field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="SMS.ERRORS.SENDERSTRING_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\s]*$/i\' }">SenderString must be valid pattern </span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="SMS.ERRORS.SENDERSTRING_MAX_LENGTH" translate-values=\'{max: 11}\'>SenderString must have a maximum length equal to 11</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\'" class="md-block">\n                <md-switch ng-model="vm.smsAccount.deliveryReport" aria-label="deliveryReport" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.DELIVERYREPORT">deliveryReport</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.smsAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.smsAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.RECEIVEURL">receiveUrl</label>\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/notify?token=\' + vm.smsAccount.token" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="SMS.HELP.RECEIVEURL"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="( ((vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\') && vm.smsAccount.deliveryReport) || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n                <label translate="SMS.DELIVERYREPORTURL">deliveryReportUrl</label>\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-deliveryReportUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-deliveryReportUrl" name="deliveryReportUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/status?token=\' + vm.smsAccount.token + (vm.smsAccount.type == \'csc\' ? \'&message-id={message-id}&state={state}\' : \'\')" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="SMS.HELP.DELIVERYREPORTURL"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="smsAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="SMS.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.smsAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="smsAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.queueTransfer == true" class="md-block">\n                <label translate="SMS.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.smsAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.agentTransfer == true" class="md-block">\n                <label translate="SMS.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.smsAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.PROXY">PROXY</div>\n            </div>\n            <form name="proxyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="SMS.TOKEN">token</label>\n                <input type="text" name="token" ng-model="vm.smsAccount.token" autofocus disabled>\n\n                <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.TOKEN_REQUIRED">token field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n                <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n                <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="smsAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.smsAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.smsAccount.mandatoryDisposition" class="md-block">\n                <label translate="SMS.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.smsAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="SMS.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="SmsAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="smsAccount-detail-form-container smsdispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="SMS.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add sms dispositions" translate translate-attr-label="SMS.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="smsAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container smscannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="SmsAccountSmsCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="SMS.SMSCANNEDANSWERS">SmsCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getSmsAccountSmsCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event)" aria-label="add smsCannedAnswer" translate translate-attr-label="SMS.ADD_SMSCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsCannedAnswers.length}} {{vm_dc.selectedSmsAccountSmsCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsCannedAnswers" csv-label="true" filename="smsAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'SMS.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'SMS.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'SMS.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'SMS.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'SMS.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="smsCannedAnswer" md-select-id="id" ng-repeat="smsCannedAnswer in vm_dc.smsAccountSmsCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{smsCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{smsCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{smsCannedAnswer.value}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{smsCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n                        {{ smsCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" translate="SMS.EDIT_SMSCANNEDANSWER">\n                                Edit SmsCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(smsCannedAnswer, $event)" translate="SMS.DELETE_SMSCANNEDANSWER">\n                                Delete SmsCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.smsAccountSmsCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="SMS.NO_SMSCANNEDANSWER_AVAILABLE">No smscannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountSmsCannedAnswers.count}}" md-on-paginate="vm_dc.getSmsAccountSmsCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="SmsAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.smsAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="SMS.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedSmsAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedSmsAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedSmsAccountApps.length}} {{vm_ac.selectedSmsAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedSmsAccountApps($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedSmsAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.smsAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editSmsAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.smsAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="SmsAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="SMS.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getSmsAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getSmsAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getSmsAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="SMS.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedSmsAccountInteractions.length}} {{vm_dc.selectedSmsAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountInteractions" csv-label="true" filename="smsAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'SMS.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'SMS.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'SMS.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'SMS.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'SMS.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'SMS.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'SMS.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.smsAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'SMS.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'SMS.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spysmsInteraction($event, interaction)" translate="SMS.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.smsInteractionDownload(interaction, $event)" translate="SMS.DOWNLOAD_INTERACTION">\n                                Download\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="SMS.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.smsAccountInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="SMS.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountInteractions.count}}" md-on-paginate="vm_dc.getSmsAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/smsAccounts.html",'<div id="smsAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SMS.SMSACCOUNTS">SmsAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSmsAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSmsAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="SMS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-smsAccounts-count">\n          <span>{{vm.selectedSmsAccounts.length}}</span>\n          <span translate="SMS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSmsAccounts()" translate="SMS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSmsAccounts()" translate="SMS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSmsAccounts" csv-label="true" filename="smsAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsAccounts($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SMSACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSmsAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n                <th md-column md-order-by="ListId">{{ \'SMS.LIST\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'SMS.TYPE\' | translate }}</th>\n                <th md-column md-order-by="phone">{{ \'SMS.PHONE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.smsAccounts.rows.length">\n                <td md-cell colspan="8">\n                  <div layout="row" layout-align="center center">\n                    <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="smsAccount" md-select-id="id" ng-repeat="smsAccount in vm.smsAccounts.rows">\n                <td md-cell ng-if="smsAccount.userpic"><img class="avatar" alt="{{smsAccount.name}}" ng-src="api/users/{{smsAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!smsAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="id ">{{smsAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="name ">{{smsAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="key ">{{smsAccount.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':smsAccount.ListId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="type ">{{ vm.arraytype[smsAccount.type].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="phone ">{{smsAccount.phone}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="description ">{{smsAccount.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(smsAccount, $event    )" translate="SMS.EDIT_SMSACCOUNT">\n                          Edit SmsAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(smsAccount, $event    )" translate="SMS.INTERACTIONS_SMSACCOUNT">\n                          Interactions SmsAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(smsAccount, $event    )" translate="SMS.AGENTADD_SMSACCOUNT">\n                          AgentAdd SmsAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(smsAccount, $event    )" translate="SMS.DELETE_SMSACCOUNT">\n                          Delete SmsAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsAccounts.count}}" md-on-paginate="vm.getSmsAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SMSACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SMSACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsAccount-button" ng-click="vm.createOrEditSmsAccount($event)" aria-label="add smsAccount" translate translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SMSACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsQueues/create/dialog.html",'<md-dialog class="smsQueue-dialog" aria-label="New SmsQueue">\n  <form name="smsQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="SMS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newSmsQueue">\n\n        <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n        <div ng-messages="smsQueueForm[\'name\'].$error" ng-show="smsQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="smsQueueForm[\'strategy\'].$error" ng-show="smsQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="smsQueueForm[\'timeout\'].$error" ng-show="smsQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="SMS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.smsQueue.description">\n\n        <div ng-messages="smsQueueForm[\'description\'].$error" ng-show="smsQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsQueue" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid || smsQueueForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsQueue" ng-click="vm.addNewSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSQUEUE" translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n          ADD SMSQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsQueue" ng-click="vm.deleteSmsQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n  <form name="smsQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="SMS.AGENTADD_SMSQUEUE">Add Agent to smsQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n  <form name="smsQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="SMS.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/view.html",'<div id="sms-smsQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-smsQueues-button md-icon-button" aria-label="Go to smsQueues" ng-click="vm.gotoSmsQueues()" translate translate-attr-aria-label="SMS.GO_TO_SMSQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="smsQueue-image" hide-xs>\n          <img ng-src="assets/images/business/smsQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.smsQueue.id}}\n            <span ng-if="vm.smsQueue.name">{{vm.smsQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.smsQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="SMS.TEAMADD_SMSQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.smsQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="SMS.AGENTADD_SMSQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveSmsQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="SMS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="smsQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="SMS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.smsQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="SMS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.smsQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsQueues/smsQueues.html",'<div id="smsQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="SMS.SMSQUEUES">SmsQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSmsQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSmsQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="SMS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-smsQueues-count">\n          <span>{{vm.selectedSmsQueues.length}}</span>\n          <span translate="SMS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSmsQueues()" translate="SMS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSmsQueues()" translate="SMS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSmsQueues" csv-label="true" filename="smsQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsQueues($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SMSQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSmsQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'SMS.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.smsQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="smsQueue" md-select-id="id" ng-repeat="smsQueue in vm.smsQueues.rows">\n                <td md-cell ng-if="smsQueue.userpic"><img class="avatar" alt="{{smsQueue.name}}" ng-src="api/users/{{smsQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!smsQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="id ">{{smsQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="name ">{{smsQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="strategy ">{{ vm.arraystrategy[smsQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(smsQueue, $event    )" translate="SMS.EDIT_SMSQUEUE">\n                          Edit SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(smsQueue, $event    )" translate="SMS.TEAMADD_SMSQUEUE">\n                          teamadd SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(smsQueue, $event    )" translate="SMS.AGENTADD_SMSQUEUE">\n                          agentadd SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(smsQueue, $event    )" translate="SMS.DELETE_SMSQUEUE">\n                          Delete SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(smsQueue, $event    )" translate="SMS.GOTOREALTIME_SMSQUEUE">\n                          goToRealtime SmsQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsQueues.count}}" md-on-paginate="vm.getSmsQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SMSQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SMSQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsQueue-button" ng-click="vm.createOrEditSmsQueue($event)" aria-label="add smsQueue" translate translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SMSQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/agents.html",'<div id="agents" class="page-layout simple left-sidenav inner-sidenav">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.AGENTS">Agents</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedAgents.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedAgents =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-agents-count">\n          <span>{{vm.selectedAgents.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllAgents()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectAgents()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedAgents" csv-label="true" filename="agents.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedAgents($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- AGENT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedAgents" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n              <tr md-row>\n                <th md-column width="20px"></th>\n                <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="showWebBar">{{ \'STAFF.SHOWWEBCONTROL\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n                <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n                <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n                <th md-column md-order-by="disabled">{{ \'STAFF.DISABLED\' | translate }}</th>\n                <th md-column md-order-by="blocked">{{ \'STAFF.BLOCKED\' | translate }}</th>\n                <th md-column>{{ \'STAFF.CLIENT_LOGS\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.agents.rows.length">\n                <td md-cell colspan="10">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n                <td md-cell ng-if="agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="api/users/{{agent.id}}/avatar" /></td>\n                <td md-cell ng-if="!agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="fullname font-weight-600">{{agent.fullname}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="name">{{agent.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="showWebBar">{{ agent.showWebBar | getOptionByValue: vm.showWebBarOptions }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="email">{{agent.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="phone">{{agent.phone}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="mobile">{{agent.mobile}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="internal">{{agent.internal}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="disabled">\n                  <md-icon md-colors="{color: {{agent.disabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{agent.disabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="blocked">\n                  <md-icon md-colors="{color: {{agent.blocked ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{agent.blocked ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="client-side-logging">\n                  <ms-client-side-logging-icon user="agent"></ms-client-side-logging-icon>\n                </td>\n                <td md-cell class="actions">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editstate(agent, $event    )" translate="STAFF.EDIT_AGENT">\n                          Edit Agent\n                        </md-button>\n                      </md-menu-item>\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item>\n                        <md-button ng-click="vm.teamadddialog(agent, $event    )" translate="STAFF.TEAMADD_AGENT">\n                          teamadd Agent\n                        </md-button>\n                      </md-menu-item>\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteconfirm(agent, $event    )" translate="STAFF.DELETE_AGENT">\n                          Delete Agent\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / AGENT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD AGENT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-agent-button" ng-click="vm.createOrEditAgent($event)" aria-label="add agent" translate translate-attr-aria-label="STAFF.ADD_AGENT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD AGENT BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/create/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n  <form name="agentForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.FULLNAME">Fullname</label>\n        <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n\n        <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.USERNAME">Username</label>\n        <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newAgent">\n\n        <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n        <div ng-messages="agentForm[\'name\'].$error" ng-show="agentForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.agent.alias">\n\n        <div ng-messages="agentForm[\'alias\'].$error" ng-show="agentForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n        <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n          <md-option ng-value="0">Phonebar</md-option>\n          <md-option ng-value="1">External</md-option>\n          <md-option ng-value="2">WebRTC</md-option>\n        </md-select>\n        <div ng-messages="agentForm[\'showWebBar\'].$error" ng-show="agentForm[\'showWebBar\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n\n        <div ng-messages="agentForm[\'email\'].$error" ng-show="agentForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newAgent">\n        <label translate="STAFF.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.agent.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n        <div ng-messages="agentForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newAgent  && (vm.newAgent)">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n        <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newAgent" class="md-block">\n        <md-switch ng-model="vm.agent.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n        <label translate="STAFF.INTERNAL">Internal</label>\n        <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" ng-disabled="!vm.newAgent">\n\n        <div ng-messages="agentForm[\'internal\'].$error" ng-show="agentForm[\'internal\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.agent.description">\n\n        <div ng-messages="agentForm[\'description\'].$error" ng-show="agentForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newAgent" class="md-block">\n        <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.agent.userSetting">\n        <ms-client-side-logging user="vm.agent"></ms-client-side-logging>\n      </md-input-container>\n      <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n        <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n        <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n        <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" value="9888" ng-required="true">\n\n        <div ng-messages="agentForm[\'phoneBarRemoteControlPort\'].$error" ng-show="agentForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newUser" class="md-block">\n        <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAgent" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAgent" ng-click="vm.addNewAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid" aria-label="ADD" translate="STAFF.ADD_AGENT" translate-attr-aria-label="STAFF.ADD_AGENT">\n          ADD AGENT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAgent" ng-click="vm.deleteAgent($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",'<md-dialog class="agent-dialog" aria-label="{{vm.name}}">\n  <form name="agentForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'\n                    STAFF.CHANGE_PASSWORD\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.agent.id">\n        <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n        <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n        <div ng-messages="agentForm.oldPassword.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NEW_PASSWORD">New Password</label>\n        <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n        <div ng-messages="agentForm.password.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n              required</span>\n          </div>\n\n\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n              at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n              character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n          <div ng-message="oldPasswordMatch">\n            <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n          </div>\n\n\n\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n        <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n              required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n              not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n  <form name="agentForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2>{{vm.title}}</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin" ng-if="vm.agent.role === \'agent\' && vm.channel === \'voice\'">\n        <label translate="STAFF.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="agentForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" add-disabled="vm.channel === \'voice\' && vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveQueues()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n  <form name="agentForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="STAFF.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/view.html",'<div id="staff-agent" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-agents-button md-icon-button" aria-label="Go to agents" ng-click="vm.gotoAgents()" translate translate-attr-aria-label="STAFF.GO_TO_AGENTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="agent-image" hide-xs>\n          <img ng-src="assets/images/business/agents.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.agent.id}}\n            <span ng-if="vm.agent.name">{{vm.agent.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="STAFF.CREATED_AT"></span> <span>{{vm.agent.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div ng-cloak>\n      <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n        <md-fab-trigger>\n          <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n            <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n            <md-icon md-font-icon="icon-stackoverflow" aria-label="queueadd"></md-icon>\n          </md-button>\n        </md-fab-trigger>\n        <md-fab-actions>\n          <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'inbound\')">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n            <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'outbound\')">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n            <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'chat\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n            <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'mail\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n            <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'sms\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n            <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'openchannel\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n            <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'fax\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n            <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n          </md-button>\n          <md-button ng-if="vm.license.whatsapp" aria-label="whatsapp" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'whatsapp\', $event)">\n            <md-tooltip md-direction="bottom" md-visible="false"><span translate="WHATSAPP.WHATSAPP">whatsapp</span></md-tooltip>\n            <md-icon md-font-icon="icon-whatsapp" aria-label="whatsapp"></md-icon>\n          </md-button>\n        </md-fab-actions>\n      </md-fab-speed-dial>\n    </div>\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.agent, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="STAFF.TEAMADD_AGENT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.changepassworddialog(vm.agent, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n        <md-tooltip><span translate="STAFF.CHANGEPASSWORD_AGENT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-key-variant"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveAgent()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (capacityForm.$invalid) || (settingsForm.$invalid) || (remote_controlForm.$invalid) || (sipForm.$invalid) || (callforwardingForm.$invalid) || (settings_webrtcForm.$invalid) || (sip_webrtcForm.$invalid) || (general_permissionsForm.$invalid) || (download_permissionsForm.$invalid) || (permissionsForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n            </div>\n            <form name="personal_infoForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.FULLNAME">Fullname</label>\n                <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.USERNAME">Username</label>\n                <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n                <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n                <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ALIAS">Alias</label>\n                <input type="text" name="alias" ng-model="vm.agent.alias" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'alias\'].$error" ng-show="personal_infoForm[\'alias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n                <md-select name="showWebBar" ng-model="vm.agent.showWebBar" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="0">Phonebar</md-option>\n                  <md-option ng-value="1">External</md-option>\n                  <md-option ng-value="2">WebRTC</md-option>\n                </md-select>\n                <div ng-messages="personal_infoForm[\'showWebBar\'].$error" ng-show="personal_infoForm[\'showWebBar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.agent.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.agent.phone" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.MOBILE">Mobile</label>\n                <input type="text" name="mobile" ng-model="vm.agent.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar == 1" class="md-block">\n                <md-switch ng-model="vm.agent.hotdesk" aria-label="Hotdesk" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.HOTDESK">Hotdesk</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.loginInPause" aria-label="LoginInPause" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.LOGININPAUSE">LoginInPause</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.agent.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n            </div>\n            <form name="security_suiteForm" novalidate>\n              <md-input-container ng-if="vm.agent.passwordResetAt != null" class="md-block">\n                <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n                <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" autofocus disabled>\n                <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n                <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.passwordResetAt == null" class="md-block">\n                <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n                <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" disabled>\n                <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.disabled" aria-label="Disabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DISABLED">Disabled</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.DISABLED"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.disabled == 0" class="md-block">\n                <md-switch ng-model="vm.agent.blocked" aria-label="Blocked" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.BLOCKED">Blocked</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.BLOCKED"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.privacyEnabled" aria-label="Mask_Sensitive_Data" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.AUTHENTICATION">AUTHENTICATION</div>\n            </div>\n            <form name="authenticationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.adSsoEnabled" aria-label="AD_SSO_Enabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AD_SSO_ENABLED">AD_SSO_Enabled</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.AD_SSO_ENABLED"></span></div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n            </div>\n            <div ng-controller="Agentchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container md-background-bg md-whiteframe-1dp">\n              <div id="agent-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="change_avatarimage in vm_ca.agent.images" ng-switch="change_avatarimage.type">\n                    <div class="agent-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="change_avatarimage.file">\n                    </div>\n                    <div class="agent-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{change_avatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.VOICE">VOICE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n                <label translate="STAFF.INTERNAL">Internal</label>\n                <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" autofocus disabled>\n                <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar != 2" class="md-block">\n                <label translate="STAFF.TRANSPORT">Transport</label>\n                <md-select name="transport" ng-model="vm.agent.transport" multiple ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'udp\'">udp</md-option>\n                  <md-option ng-value="\'tcp\'">tcp</md-option>\n                  <md-option ng-value="\'ws\'" ng-if="vm.agent.showWebBar == 1">ws</md-option>\n                  <md-option ng-value="\'wss\'" ng-if="vm.agent.showWebBar == 1">wss</md-option>\n                  <md-option ng-value="\'tls\'" ng-if="vm.agent.showWebBar == 1">tls</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n                <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.HOST">Host</label>\n                <input type="text" name="host" ng-model="vm.agent.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.HOST"></span></div>\n                <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.HOST_REQUIRED">Host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.NAT">NAT</label>\n                <md-select name="nat" ng-model="vm.agent.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'force_rport\'">force_rport</md-option>\n                  <md-option ng-value="\'comedia\'">comedia</md-option>\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'never\'">never</md-option>\n                  <md-option ng-value="\'route\'">route</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n                <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.agent.type" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'friend\'">Friend</md-option>\n                  <md-option ng-value="\'user\'">User</md-option>\n                  <md-option ng-value="\'peer\'">Peer</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.TYPE"></span></div>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n                <md-select name="allow" ng-model="vm.agent.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ulaw\'">ulaw</md-option>\n                  <md-option ng-value="\'alaw\'">alaw</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                  <md-option ng-value="\'g722\'">g722</md-option>\n                  <md-option ng-value="\'g729\'">g729</md-option>\n                  <md-option ng-value="\'opus\'">opus</md-option>\n                  <md-option ng-value="\'h264\'">h264</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n                <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLERID">CallerId</label>\n                <input type="text" name="callerid" ng-model="vm.agent.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.agent.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLGROUP">Callgroup</label>\n                <input type="text" name="callgroup" ng-model="vm.agent.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n                <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n                <input type="text" name="pickupgroup" ng-model="vm.agent.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n                <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.chanspy" aria-label="chanSpy" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CHANSPY">chanSpy</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n                <md-select name="videosupport" ng-model="vm.agent.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'always\'">Always</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.MONITOREXTENSION">MonitorExtension</label>\n                <md-select name="extensionMonitor" ng-model="vm.agent.extensionMonitor" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Inactive</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'WAV\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'extensionMonitor\'].$error" ng-show="generalForm[\'extensionMonitor\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MONITOREXTENSION_REQUIRED">MonitorExtension field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.OTHER_CHANNELS">OTHER_CHANNELS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container capacity md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CAPACITY">CAPACITY</div>\n            </div>\n            <form name="capacityForm" novalidate>\n              <md-input-container ng-if="vm.license.chat" class="md-block">\n                <label translate="STAFF.CHATCAPACITY">ChatCapacity</label>\n                <input type="number" name="chatCapacity" ng-model="vm.agent.chatCapacity" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.CHATCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'chatCapacity\'].$error" ng-show="capacityForm[\'chatCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CHATCAPACITY_REQUIRED">ChatCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ChatCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.mail" class="md-block">\n                <label translate="STAFF.MAILCAPACITY">MailCapacity</label>\n                <input type="number" name="mailCapacity" ng-model="vm.agent.mailCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.MAILCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'mailCapacity\'].$error" ng-show="capacityForm[\'mailCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MAILCAPACITY_REQUIRED">MailCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MailCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.messaging" class="md-block">\n                <label translate="STAFF.SMSCAPACITY">SMSCapacity</label>\n                <input type="number" name="smsCapacity" ng-model="vm.agent.smsCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.SMSCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'smsCapacity\'].$error" ng-show="capacityForm[\'smsCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SMSCAPACITY_REQUIRED">SMSCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.SMSCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">SMSCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.openchannel" class="md-block">\n                <label translate="STAFF.OPENCHANNELCAPACITY">OpenchannelCapacity</label>\n                <input type="number" name="openchannelCapacity" ng-model="vm.agent.openchannelCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.OPENCHANNELCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'openchannelCapacity\'].$error" ng-show="capacityForm[\'openchannelCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_REQUIRED">OpenchannelCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OpenchannelCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.fax" class="md-block">\n                <label translate="STAFF.FAXCAPACITY">FaxCapacity</label>\n                <input type="number" name="faxCapacity" ng-model="vm.agent.faxCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.FAXCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'faxCapacity\'].$error" ng-show="capacityForm[\'faxCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.FAXCAPACITY_REQUIRED">FaxCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FaxCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.whatsapp" class="md-block">\n                <label translate="STAFF.WHATSAPPCAPACITY">WhatsappCapacity</label>\n                <input type="number" name="whatsappCapacity" ng-model="vm.agent.whatsappCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.WHATSAPPCAPACITY"></span></div>\n                <div ng-messages="capacityForm[\'whatsappCapacity\'].$error" ng-show="capacityForm[\'whatsappCapacity\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.WHATSAPPCAPACITY_REQUIRED">WhatsappCapacity field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.WHATSAPPCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WhatsappCapacity must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.agent.showWebBar == 0">\n        <md-tab-label>\n          <span translate="STAFF.MOTIONBAR">MOTIONBAR</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container settings md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SETTINGS">SETTINGS</div>\n            </div>\n            <form name="settingsForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n                <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n                <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="settingsForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settingsForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarRingInUse" aria-label="RingInUse" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.RINGINUSE">RingInUse</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarUnansweredCallBadge" aria-label="UnansweredCallBadge" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNANSWEREDCALLBADGE">UnansweredCallBadge</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableJaws" aria-label="EnableJawsIntegration" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEJAWSINTEGRATION">EnableJawsIntegration</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar == 0 && vm.license.screenrecording" class="md-block">\n                <md-switch ng-change="vm.onEnableScreenRecordingByAgentSelection()" ng-model="vm.agent.phoneBarEnableScreenRecordingByAgent" aria-label="EnableScreenRecordingByAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESCREENRECORDINGBYAGENT">EnableScreenRecordingByAgent</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.showWebBar == 0 && vm.license.screenrecording" class="md-block">\n                <md-switch ng-change="vm.onEnableAutomaticScreenRecordingSelection()" ng-model="vm.agent.phoneBarEnableAutomaticScreenRecording" aria-label="EnableAutomaticScreenRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEAUTOMATICSCREENRECORDING">EnableAutomaticScreenRecording</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.ENABLEAUTOMATICSCREENRECORDING"></span></div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container remote_control md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.REMOTE_CONTROL">REMOTE_CONTROL</div>\n            </div>\n            <form name="remote_controlForm" novalidate>\n              <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n                <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n                <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" value="9888" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="remote_controlForm[\'phoneBarRemoteControlPort\'].$error" ng-show="remote_controlForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container sip md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SIP">SIP</div>\n            </div>\n            <form name="sipForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n                <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n                <div ng-messages="sipForm[\'phoneBarExpires\'].$error" ng-show="sipForm[\'phoneBarExpires\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.SIPPORT">SipPort</label>\n                <input type="number" name="phoneBarListenPort" ng-model="vm.agent.phoneBarListenPort" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.SIPPORT"></span></div>\n                <div ng-messages="sipForm[\'phoneBarListenPort\'].$error" ng-show="sipForm[\'phoneBarListenPort\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SIPPORT_REQUIRED">SipPort field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container callforwarding md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CALLFORWARDING">CALLFORWARDING</div>\n            </div>\n            <form name="callforwardingForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarUnconditional" aria-label="Unconditional" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNCONDITIONAL">Unconditional</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.phoneBarUnconditional" class="md-block">\n                <label translate="STAFF.UNCONDITIONALNUMBER">UnconditionalNumber</label>\n                <input type="text" name="phoneBarUnconditionalNumber" ng-model="vm.agent.phoneBarUnconditionalNumber" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="callforwardingForm[\'phoneBarUnconditionalNumber\'].$error" ng-show="callforwardingForm[\'phoneBarUnconditionalNumber\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.UNCONDITIONALNUMBER_REQUIRED">UnconditionalNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.agent.showWebBar == 2">\n        <md-tab-label>\n          <span translate="STAFF.WEBRTC">WEBRTC</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container settings_webrtc md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SETTINGS_WEBRTC">SETTINGS_WEBRTC</div>\n            </div>\n            <form name="settings_webrtcForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DTLSCERTFILE">dtlscertfile</label>\n                <input type="text" name="dtlscertfile" ng-model="vm.agent.dtlscertfile" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.DTLSCERTFILE"></span></div>\n                <div ng-messages="settings_webrtcForm[\'dtlscertfile\'].$error" ng-show="settings_webrtcForm[\'dtlscertfile\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DTLSCERTFILE_REQUIRED">dtlscertfile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DTLSPRIVATEKEY">dtlsprivatekey</label>\n                <input type="text" name="dtlsprivatekey" ng-model="vm.agent.dtlsprivatekey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.DTLSPRIVATEKEY"></span></div>\n                <div ng-messages="settings_webrtcForm[\'dtlsprivatekey\'].$error" ng-show="settings_webrtcForm[\'dtlsprivatekey\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DTLSPRIVATEKEY_REQUIRED">dtlsprivatekey field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.WSS_PORT">WSS_Port</label>\n                <input type="number" name="wssPort" ng-model="vm.agent.wssPort" min="0" value="8089" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.WSS_PORT"></span></div>\n                <div ng-messages="settings_webrtcForm[\'wssPort\'].$error" ng-show="settings_webrtcForm[\'wssPort\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.WSS_PORT_REQUIRED">WSS_Port field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.WSS_PORT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WSS_Port must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n                <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n                <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.ignorePauseForPreviewCalls" aria-label="Ignore agent break status for preview calls" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS">Ignore agent break status for preview calls</span></md-switch>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container sip_webrtc md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SIP_WEBRTC">SIP_WEBRTC</div>\n            </div>\n            <form name="sip_webrtcForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n                <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n                <div ng-messages="sip_webrtcForm[\'phoneBarExpires\'].$error" ng-show="sip_webrtcForm[\'phoneBarExpires\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n            </div>\n            <form name="general_permissionsForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.allowmessenger" aria-label="EnableMessenger" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEMESSENGER">EnableMessenger</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.phoneBarPrefixRequired" aria-label="PrefixRequired" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.PREFIXREQUIRED">PrefixRequired</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.selectRecallMeCampaign" aria-label="Select_RecallMe_Campaign" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.SELECT_RECALLME_CAMPAIGN">Select_RecallMe_Campaign</span></md-switch>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container download_permissions md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.DOWNLOAD_PERMISSIONS">DOWNLOAD_PERMISSIONS</div>\n            </div>\n            <form name="download_permissionsForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.downloadAttachments" aria-label="Attachments" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ATTACHMENTS">Attachments</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.downloadOmnichannelInteractions" aria-label="Omnichannel_Interactions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.OMNICHANNEL_INTERACTIONS">Omnichannel_Interactions</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.agent.downloadVoiceRecordings" aria-label="Voice_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.VOICE_RECORDINGS">Voice_Recordings</span></md-switch>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="agent-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n            </div>\n            <div ng-controller="AgentPermissionsController as vm_pc" ng-init="vm_pc.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container">\n              <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.agent.role !== \'admin\' && !father.hidden()"></md-list>\n              \x3c!-- Nested navigation template --\x3e\n              <script type="text/ng-template" id="permission-nested.html">\n                <md-list-item>\n        <md-icon md-font-icon="{{father.icon}}"></md-icon>\n        <p translate="{{father.translate}}">{{ father.title }}</p>\n        <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.agent.permissions.includes(father.id)" \n                  ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n      </md-list-item>\n      <md-divider></md-divider>\n      <md-list>\n        <md-list-item ng-repeat="child in father.children" ng-if="child.id !== 201">\n          <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n          <p translate="{{child.translate}}">{{ child.title }}</p>\n          <md-switch ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.agent.permissions.includes(child.id)"\n                    ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n          </md-list-item>\n      </md-list>\n  <\/script>\n              \x3c!-- / Nested navigation template --\x3e\n              <span ng-if="vm_pc.agent.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.CLIENT_LOGS">CLIENT-SIDE LOGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="agent-detail-form-container client_logs md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CLIENT_LOGS">\n                CLIENT-SIDE LOGS\n              </div>\n            </div>\n            <ms-client-side-logging user="vm.agent" on-user-update="vm.refreshAgent()"></ms-client-side-logging>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/staff/views/teams/create/dialog.html",'<md-dialog class="team-dialog" aria-label="New Team">\n  <form name="teamForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.team.name" ng-required="true" autofocus>\n\n        <div ng-messages="teamForm[\'name\'].$error" ng-show="teamForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.team.description">\n\n        <div ng-messages="teamForm[\'description\'].$error" ng-show="teamForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTeam" ng-click="vm.saveTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid || teamForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTeam" ng-click="vm.addNewTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TEAM" translate-attr-aria-label="STAFF.ADD_TEAM">\n          ADD TEAM\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTeam" ng-click="vm.deleteTeam($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",'<md-dialog class="team-dialog" aria-label="team" ng-init="vm.onInit()">\n  <form name="teamForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="STAFF.AGENTADD_TEAM">Add Agent to team</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/teams.html",'<div id="teams" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.TEAMS">Teams</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTeams.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTeams =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-teams-count">\n          <span>{{vm.selectedTeams.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTeams()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTeams()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTeams" csv-label="true" filename="teams.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTeams($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TEAM TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTeams" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTeams">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.teams.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="team" md-select-id="id" ng-repeat="team in vm.teams.rows">\n                <td md-cell ng-if="team.userpic"><img class="avatar" alt="{{team.name}}" ng-src="api/users/{{team.id}}/avatar" /></td>\n                <td md-cell ng-if="!team.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{team.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="id ">{{team.id}}</td>\n                <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="name ">{{team.name}}</td>\n                <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="description ">{{team.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(team, $event    )" translate="STAFF.EDIT_TEAM">\n                          Edit Team\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(team, $event    )" translate="STAFF.AGENTADD_TEAM">\n                          AgentAdd Team\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(team, $event    )" translate="STAFF.DELETE_TEAM">\n                          Delete Team\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.teams.count}}" md-on-paginate="vm.getTeams" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TEAM TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TEAM BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-team-button" ng-click="vm.createOrEditTeam($event)" aria-label="add team" translate translate-attr-aria-label="STAFF.ADD_TEAM">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TEAM BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/telephones/create/dialog.html",'<md-dialog class="telephone-dialog" aria-label="New Telephone">\n  <form name="telephoneForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n        <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n\n        <div ng-messages="telephoneForm[\'fullname\'].$error" ng-show="telephoneForm[\'fullname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.USERNAME">Username</label>\n        <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newTelephone">\n\n        <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n        <div ng-messages="telephoneForm[\'name\'].$error" ng-show="telephoneForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n\n        <div ng-messages="telephoneForm[\'email\'].$error" ng-show="telephoneForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newTelephone">\n        <label translate="STAFF.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.telephone.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n        <div ng-messages="telephoneForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.newTelephone  && (vm.newTelephone)">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n        <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.telephone.description">\n\n        <div ng-messages="telephoneForm[\'description\'].$error" ng-show="telephoneForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newTelephone" class="md-block">\n        <md-switch ng-model="vm.telephone.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n        <label translate="STAFF.INTERNAL">Internal</label>\n        <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" ng-disabled="!vm.newTelephone">\n\n        <div ng-messages="telephoneForm[\'internal\'].$error" ng-show="telephoneForm[\'internal\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newTelephone" class="md-block">\n        <md-switch ng-model="vm.telephone.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTelephone" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTelephone" ng-click="vm.addNewTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TELEPHONE" translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n          ADD TELEPHONE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTelephone" ng-click="vm.deleteTelephone($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",'<md-dialog class="telephone-dialog" aria-label="{{vm.name}}">\n  <form name="telephoneForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'\n                    STAFF.CHANGE_PASSWORD\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.telephone.id">\n        <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n        <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n        <div ng-messages="telephoneForm.oldPassword.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NEW_PASSWORD">New Password</label>\n        <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n        <div ng-messages="telephoneForm.password.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n              required</span>\n          </div>\n\n\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n              at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n              character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n          <div ng-message="oldPasswordMatch">\n            <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n          </div>\n\n\n\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n        <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n              required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n              not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/view.html",'<div id="staff-telephone" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-telephones-button md-icon-button" aria-label="Go to telephones" ng-click="vm.gotoTelephones()" translate translate-attr-aria-label="STAFF.GO_TO_TELEPHONES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="telephone-image" hide-xs>\n          <img ng-src="assets/images/business/telephones.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.telephone.id}}\n            <span ng-if="vm.telephone.name">{{vm.telephone.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="STAFF.CREATED_AT"></span> <span>{{vm.telephone.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.changepassworddialog(vm.telephone, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n        <md-tooltip><span translate="STAFF.CHANGEPASSWORD_TELEPHONE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-key-variant"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveTelephone()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(accountForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="telephone-detail-form-container account md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.ACCOUNT">ACCOUNT</div>\n            </div>\n            <form name="accountForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n                <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'fullname\'].$error" ng-show="accountForm[\'fullname\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.USERNAME">Username</label>\n                <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n                <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n                <div ng-messages="accountForm[\'name\'].$error" ng-show="accountForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'email\'].$error" ng-show="accountForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.telephone.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'description\'].$error" ng-show="accountForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.telephone.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'phone\'].$error" ng-show="accountForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.MOBILE">Mobile</label>\n                <input type="text" name="mobile" ng-model="vm.telephone.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="accountForm[\'mobile\'].$error" ng-show="accountForm[\'mobile\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.VOICE">VOICE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="telephone-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n                <label translate="STAFF.INTERNAL">Internal</label>\n                <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.TRANSPORT">Transport</label>\n                <md-select name="transport" ng-model="vm.telephone.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'udp\'">udp</md-option>\n                  <md-option ng-value="\'tcp\'">tcp</md-option>\n                  <md-option ng-value="\'ws\'">ws</md-option>\n                  <md-option ng-value="\'wss\'">wss</md-option>\n                  <md-option ng-value="\'tls\'">tls</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n                <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.NAT">NAT</label>\n                <md-select name="nat" ng-model="vm.telephone.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'force_rport\'">force_rport</md-option>\n                  <md-option ng-value="\'comedia\'">comedia</md-option>\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'never\'">never</md-option>\n                  <md-option ng-value="\'route\'">route</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n                <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n                <md-select name="allow" ng-model="vm.telephone.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ulaw\'">ulaw</md-option>\n                  <md-option ng-value="\'alaw\'">alaw</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                  <md-option ng-value="\'g722\'">g722</md-option>\n                  <md-option ng-value="\'g729\'">g729</md-option>\n                  <md-option ng-value="\'opus\'">opus</md-option>\n                  <md-option ng-value="\'h264\'">h264</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n                <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLERID">CallerId</label>\n                <input type="text" name="callerid" ng-model="vm.telephone.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.telephone.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLGROUP">Callgroup</label>\n                <input type="text" name="callgroup" ng-model="vm.telephone.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n                <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n                <input type="text" name="pickupgroup" ng-model="vm.telephone.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n                <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n                <md-select name="videosupport" ng-model="vm.telephone.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'always\'">Always</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ENCRYPTION">Encryption</label>\n                <md-select name="encryption" ng-model="vm.telephone.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.ENCRYPTION"></span></div>\n                <div ng-messages="generalForm[\'encryption\'].$error" ng-show="generalForm[\'encryption\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ENCRYPTION_REQUIRED">Encryption field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/telephones/telephones.html",'<div id="telephones" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.TELEPHONES">Telephones</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTelephones.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTelephones =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-telephones-count">\n          <span>{{vm.selectedTelephones.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTelephones()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTelephones()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTelephones" csv-label="true" filename="telephones.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTelephones($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TELEPHONE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTelephones" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="fullname">{{ \'STAFF.ACCOUNTNAME\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.telephones.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="telephone" md-select-id="id" ng-repeat="telephone in vm.telephones.rows">\n                <td md-cell ng-if="telephone.userpic"><img class="avatar" alt="{{telephone.name}}" ng-src="api/users/{{telephone.id}}/avatar" /></td>\n                <td md-cell ng-if="!telephone.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{telephone.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="fullname font-weight-600">{{telephone.fullname}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="name ">{{telephone.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="email ">{{telephone.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="internal ">{{telephone.internal}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(telephone, $event    )" translate="STAFF.EDIT_TELEPHONE">\n                          Edit Telephone\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(telephone, $event    )" translate="STAFF.DELETE_TELEPHONE">\n                          Delete Telephone\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.telephones.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TELEPHONE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TELEPHONE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-telephone-button" ng-click="vm.createOrEditTelephone($event)" aria-label="add telephone" translate translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TELEPHONE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/userProfiles/create/dialog.html",'<md-dialog class="userProfile-dialog" aria-label="New UserProfile">\n  <form name="userProfileForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n        <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.userProfile.description">\n\n        <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n        <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n          <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n          <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n          <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n        <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUserProfile" ng-click="vm.saveUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid || userProfileForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUserProfile" ng-click="vm.addNewUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USERPROFILE" translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n          ADD USERPROFILE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUserProfile" ng-click="vm.deleteUserProfile($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/clone/clone.html",'<md-dialog class="userProfile-dialog" aria-label="Clone UserProfile">\n  <form name="userProfileForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n        <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.userProfile.description">\n\n        <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n        <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n          <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n          <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n          <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n        <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="CLONE" translate="STAFF.CLONE_USERPROFILE" translate-attr-aria-label="STAFF.CLONE_USERPROFILE">\n        CLONE USERPROFILE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",'<md-dialog class="userProfile-dialog" aria-label="userProfile">\n  <form name="userProfileForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2>{{vm.title}}</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog($event)">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div layout="column" class="padding-bottom-10">\n        <div layout="row" class="padding-bottom-10">\n          <md-input-container flex class="no-margin">\n            <label translate="STAFF.SECTIONS">Sections</label>\n            <md-select name="sections" ng-model="vm.selectedSection" placeholder="{{\'STAFF.PERMISSIONS_SELECT_SECTION\' | translate}}" ng-change="vm.onChangeSection()" required>\n              <md-option ng-value="subsection" ng-repeat="subsection in vm.subsections" ng-selected="{{vm.subsections.length === 1 ? \'true\' : \'false\'}}">{{subsection.translate | translate}}</md-option>\n            </md-select>\n          </md-input-container>\n          <div layout="row" ng-show="vm.selectedSection" class="margin-left-10">\n            <md-button ng-switch="vm.selectedSection.enabled" class="md-icon-button md-fab md-mini size-8 padding-10" ng-class="vm.selectedSection.enabled ? \'blue-500-bg\' : \'grey-A400-bg\'" ng-click="vm.onChangeVisibility()" aria-label="Visibility">\n              <md-icon ng-switch-when="true" md-font-icon="icon-eye" aria-label="Visible section">\n                <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_HIDE\' | translate}}</md-tooltip>\n              </md-icon>\n              <md-icon ng-switch-when="false" md-font-icon="icon-eye-off" aria-label="Hidden section">\n                <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_SHOW\' | translate}}</md-tooltip>\n              </md-icon>\n            </md-button>\n            <div>\n              <md-button class="md-icon-button md-fab md-mini size-8 green-A700-bg no-margin" ng-disabled="true">\n                <md-icon md-font-icon="icon-monitor" class="md-background-fg" aria-label="Read permission">\n                  <md-tooltip>{{\'STAFF.READ_PERMISSION\' | translate}}</md-tooltip>\n                </md-icon>\n              </md-button>\n              <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowEdit ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'edit\')">\n                <md-icon md-font-icon="icon-pencil" aria-label="Edit permission">\n                  <md-tooltip>{{\'STAFF.EDIT_PERMISSION\' | translate}}</md-tooltip>\n                </md-icon>\n              </md-button>\n              <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowDelete ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'delete\')">\n                <md-icon md-font-icon="icon-delete" aria-label="Delete permission">\n                  <md-tooltip>{{\'STAFF.DELETE_PERMISSION\' | translate}}</md-tooltip>\n                </md-icon>\n              </md-button>\n            </div>\n          </div>\n        </div>\n        <div layout="row" ng-show="vm.selectedSection" class="margin-left-10" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n          <md-switch ng-model="vm.selectedSection.autoAssociation" class="no-margin padding-right-10" aria-label="Auto association" ng-change="vm.onChangeAutoAssociation()">\n          </md-switch>\n          <p class="no-margin font-size-12 line-height-30">{{\'STAFF.PERMISSIONS_AUTO_ASSOCIATION_INFO\' | translate}}</p>\n        </div>\n        <div layout="row" ng-show="vm.selectedSection && vm.selectedSection.title === \'Reports\' && !vm.selectedSection.autoAssociation" class="margin-bottom-10 margin-top-30" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n          <md-input-container flex class="no-margin">\n            <label translate="STAFF.REPORT_TYPE">Report Type</label>\n            <md-select name="type" ng-model="vm.selectedSection.reportType" placeholder="{{\'STAFF.PERMISSIONS_SELECT_REPORT_TYPE\' | translate}}" ng-change="vm.onChangeReportType()" required>\n              <md-option ng-value="\'default\'">Default</md-option>\n              <md-option ng-value="\'custom\'">Custom</md-option>\n            </md-select>\n          </md-input-container>\n        </div>\n        <div ng-show="vm.selectedSection && vm.selectedSection.title === \'Dashboards\'" class="user-profile-section-help margin-bottom-10 margin-top-20">\n          <md-icon md-font-icon="icon-help" aria-label="Dashboards help"></md-icon>\n          <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.CUSTOM_DASHBOARDS_PERMISSIONS"></span>\n        </div>\n      </div>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association" ng-hide="vm.selectedSection.autoAssociation"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center">\n      <div>\n        <md-icon md-font-icon="icon-information-outline" aria-label="Delete permission"></md-icon>\n        <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.SAVE_PERMISSIONS"></span>\n      </div>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveSection()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/view.html",'<div id="staff-userProfile" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-userProfiles-button md-icon-button" aria-label="Go to userProfiles" ng-click="vm.gotoUserProfiles()" translate translate-attr-aria-label="STAFF.GO_TO_USERPROFILES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="userProfile-image" hide-xs>\n          <img ng-src="assets/images/business/userProfiles.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.userProfile.id}}\n            <span ng-if="vm.userProfile.name">{{vm.userProfile.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="STAFF.CREATED_AT"></span> <span>{{vm.userProfile.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.userProfile, $event)" class="md-fab md-amber-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="STAFF.CLONE_USERPROFILE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveUserProfile()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (modulesForm.$invalid) || (download_permissionsForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="userProfile-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.userProfile.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n                <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n                  <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n                  <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'crudPermissions\'].$error" ng-show="generalForm[\'crudPermissions\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="userProfile-detail-form-container modules md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.MODULES">MODULES</div>\n            </div>\n            <div ng-controller="UserProfilePermissionsController as vm_pc" ng-init="vm_pc.init(vm.userProfile, vm.license)" class="userProfile-detail-form-container">\n              <md-grid-list flex md-cols-gt-xs="2" md-cols-gt-sm="2" md-cols-gt-md="4" md-cols-gt-lg="6" md-row-height-gt-xs="2:1" md-row-height-gt-sm="3:1" md-row-height-gt-md="3:1" gt-xs-gutter="4px" gt-sm-gutter="4px" gt-md-gutter="16px" gt-lg-gutter="16px">\n                <md-grid-tile ng-repeat="father in vm_pc.modules" ng-if="vm_pc.userProfile.role !== \'admin\' && !father.permissions.hidden" md-colspan="2">\n                  <md-card flex-xs flex-gt-xs="90" layout="column" no-padding no-margin>\n                    <md-card-header>\n                      <md-card-avatar>\n                        <md-icon class="md-avatar-icon auto-size" md-font-icon="{{father.icon}}" ng-class="{ true: father.status.color }[true]">\n                          <md-tooltip>{{ father.status.info }}</md-tooltip>\n                        </md-icon>\n                      </md-card-avatar>\n                      <md-card-header-text layout-align="center start">\n                        <span class="md-title" translate="{{father.translate}}">{{ father.title }}</span>\n                      </md-card-header-text>\n                      <md-card-actions class="no-margin" layout="row" ng-init="vm_pc.checkSectionResources(father)" ng-if="father.status.tag != \'unlicensed\'">\n                        <md-switch class="auto-height no-margin" ng-model="father.allResourcesEnabled" ng-change="vm_pc.onChangeEnableAllResources(father)" aria-label="Enable all"></md-switch>\n                        <md-button class="md-mini auto-width" aria-label="Manage" ng-click="vm_pc.manageResources(father)" ng-hide="father.permissions && !father.permissions.association">\n                          <md-tooltip>{{\'STAFF.PERMISSIONS_MANAGE\' | translate}}\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-cog"></md-icon>\n                        </md-button>\n                      </md-card-actions>\n                      <md-card-header-text ng-if="father.status.tag === \'unlicensed\'" layout-align="center end">\n                        <span class="md-subhead red-A700-fg">{{ father.status.name }}</span>\n                      </md-card-header-text>\n                    </md-card-header>\n                  </md-card>\n                </md-grid-tile>\n              </md-grid-list>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.DOWNLOADS">DOWNLOADS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="userProfile-detail-form-container download_permissions md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.DOWNLOAD_PERMISSIONS">DOWNLOAD_PERMISSIONS</div>\n            </div>\n            <form name="download_permissionsForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadAttachments" aria-label="Attachments" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ATTACHMENTS">Attachments</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadCallySquareRecordings" aria-label="CallySquare_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CALLYSQUARE_RECORDINGS">CallySquare_Recordings</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadContactManagerLists" aria-label="Contact_Manager_Lists" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CONTACT_MANAGER_LISTS">Contact_Manager_Lists</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadJscriptySessions" aria-label="Jscripty_Sessions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.JSCRIPTY_SESSIONS">Jscripty_Sessions</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadOmnichannelInteractions" aria-label="Omnichannel_Interactions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.OMNICHANNEL_INTERACTIONS">Omnichannel_Interactions</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadScreenRecordings" aria-label="Screen_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.SCREEN_RECORDINGS">Screen_Recordings</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.userProfile.downloadVoiceRecordings" aria-label="Voice_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.VOICE_RECORDINGS">Voice_Recordings</span></md-switch>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/userProfiles/userProfiles.html",'<div id="userProfiles" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.USERPROFILES">UserProfiles</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedUserProfiles.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedUserProfiles =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-userProfiles-count">\n          <span>{{vm.selectedUserProfiles.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllUserProfiles()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectUserProfiles()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedUserProfiles" csv-label="true" filename="userProfiles.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedUserProfiles($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- USERPROFILE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedUserProfiles" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUserProfiles">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="crudPermissions">{{ \'STAFF.CRUDPERMISSIONS\' | translate }}</th>\n                <th md-column md-order-by="privacyEnabled">{{ \'STAFF.MASK_SENSITIVE_DATA\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.userProfiles.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="userProfile" md-select-id="id" ng-repeat="userProfile in vm.userProfiles.rows">\n                <td md-cell ng-if="userProfile.userpic"><img class="avatar" alt="{{userProfile.name}}" ng-src="api/users/{{userProfile.id}}/avatar" /></td>\n                <td md-cell ng-if="!userProfile.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{userProfile.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="id ">{{userProfile.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="name ">{{userProfile.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="description ">{{userProfile.description}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="crudPermissions ">{{userProfile.selectedcrudPermissions}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="privacyEnabled ">\n                  <md-icon md-colors="{color: {{userProfile.privacyEnabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{userProfile.privacyEnabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(userProfile, $event    )" translate="STAFF.EDIT_USERPROFILE">\n                          Edit UserProfile\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(userProfile, $event    )" translate="STAFF.CLONE_USERPROFILE">\n                          clone UserProfile\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n\n                        <md-button ng-click="vm.deleteconfirm(userProfile, $event    )" translate="STAFF.DELETE_USERPROFILE">\n                          Delete UserProfile\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.userProfiles.count}}" md-on-paginate="vm.getUserProfiles" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / USERPROFILE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD USERPROFILE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-userProfile-button" ng-click="vm.createOrEditUserProfile($event)" aria-label="add userProfile" translate translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD USERPROFILE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/create/dialog.html",'<md-dialog class="user-dialog" aria-label="New User">\n  <form name="userForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="STAFF.ROLE">Role</label>\n        <md-select name="role" ng-model="vm.user.role" autofocus required ng-disabled="!vm.newUser">\n          <md-option ng-value="\'admin\'">Admin</md-option>\n          <md-option ng-value="\'user\'">User</md-option>\n        </md-select>\n        <div ng-messages="userForm[\'role\'].$error" ng-show="userForm[\'role\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n        <label translate="STAFF.USERPROFILE">UserProfile</label>\n        <md-select name="userProfileId" ng-model="vm.user.userProfileId" required>\n          <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n        </md-select>\n        <div ng-messages="userForm[\'userProfileId\'].$error" ng-show="userForm[\'userProfileId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.FULLNAME">Fullname</label>\n        <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n\n        <div ng-messages="userForm[\'fullname\'].$error" ng-show="userForm[\'fullname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.USERNAME">Username</label>\n        <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newUser">\n\n        <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n        <div ng-messages="userForm[\'name\'].$error" ng-show="userForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n\n        <div ng-messages="userForm[\'email\'].$error" ng-show="userForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newUser">\n        <label translate="STAFF.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.user.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n        <div ng-messages="userForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.newUser  && (vm.newUser)">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n        <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.user.description">\n\n        <div ng-messages="userForm[\'description\'].$error" ng-show="userForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.newUser" class="md-block">\n        <md-switch ng-model="vm.user.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n        <label translate="STAFF.INTERNAL">Internal</label>\n        <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" ng-disabled="!vm.newUser">\n\n        <div ng-messages="userForm[\'internal\'].$error" ng-show="userForm[\'internal\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.user.userSetting">\n        <ms-client-side-logging user="vm.user"></ms-client-side-logging>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUser" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUser" ng-click="vm.addNewUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USER" translate-attr-aria-label="STAFF.ADD_USER">\n          ADD USER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUser" ng-click="vm.deleteUser($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n  <form name="userForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'\n                    STAFF.MANAGE_API_KEY\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-card layout-fill layout-padding>\n      <textarea class="api-key-area" ng-model="vm.user.apiKey" rows="6" disabled></textarea>\n    </md-card>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.generateApiKey()" class="send-button md-accent md-raised" aria-label="Generate" translate="{{ vm.user.apiKey === \'N/A\' ? \'STAFF.GENERATE\' : \'STAFF.REGENERATE\' }}" translate-attr-aria-label="STAFF.GENERATE">\n          Generate\n        </md-button>\n        <md-button type="submit" ng-click="vm.removeApiKey()" class="send-button md-accent md-raised" aria-label="Remove" translate="STAFF.REMOVE" translate-attr-aria-label="STAFF.DELETE">\n          Delete\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n  <form name="userForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'\n                    STAFF.CHANGE_PASSWORD\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n        <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n        <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n        <div ng-messages="userForm.oldPassword.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.NEW_PASSWORD">New Password</label>\n        <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n        <div ng-messages="userForm.password.$error" role="alert">\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n              required</span>\n          </div>\n\n\n          <div ng-message="pattern">\n            <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n              at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n              character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n          <div ng-message="oldPasswordMatch">\n            <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n          </div>\n\n\n\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n        <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n              required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n              not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/view.html",'<div id="staff-user" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-users-button md-icon-button" aria-label="Go to users" ng-click="vm.gotoUsers()" translate translate-attr-aria-label="STAFF.GO_TO_USERS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="user-image" hide-xs>\n          <img ng-src="assets/images/business/users.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.user.id}}\n            <span ng-if="vm.user.name">{{vm.user.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="STAFF.CREATED_AT"></span> <span>{{vm.user.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.apikeymanagerdialog(vm.user, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="apikeymanager">\n        <md-tooltip><span translate="STAFF.APIKEYMANAGER_USER"></span></md-tooltip>\n        <md-icon md-font-icon="fab fa-hubspot"></md-icon>\n      </md-button>\n    </div>\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.changepassworddialog(vm.user, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n        <md-tooltip><span translate="STAFF.CHANGEPASSWORD_USER"></span></md-tooltip>\n        <md-icon md-font-icon="icon-key-variant"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveUser()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="user-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n            </div>\n            <form name="personal_infoForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ROLE">Role</label>\n                <md-select name="role" ng-model="vm.user.role" autofocus required disabled>\n                  <md-option ng-value="\'admin\'">Admin</md-option>\n                  <md-option ng-value="\'user\'">User</md-option>\n                </md-select>\n                <div ng-messages="personal_infoForm[\'role\'].$error" ng-show="personal_infoForm[\'role\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n                <label translate="STAFF.USERPROFILE">UserProfile</label>\n                <md-select name="userProfileId" ng-model="vm.user.userProfileId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n                </md-select>\n                <div ng-messages="personal_infoForm[\'userProfileId\'].$error" ng-show="personal_infoForm[\'userProfileId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.FULLNAME">Fullname</label>\n                <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.USERNAME">Username</label>\n                <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n                <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n                <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.user.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PHONE">Phone</label>\n                <input type="text" name="phone" ng-model="vm.user.phone" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.MOBILE">Mobile</label>\n                <input type="text" name="mobile" ng-model="vm.user.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.user.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="user-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n            </div>\n            <form name="security_suiteForm" novalidate>\n              <md-input-container ng-if="vm.user.passwordResetAt != null" class="md-block">\n                <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n                <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" autofocus disabled>\n                <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n                <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.user.passwordResetAt == null" class="md-block">\n                <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n                <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" disabled>\n                <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.APIKEY">ApiKey</label>\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-apiKey" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: \'API Key copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-apiKey" name="apiKey" ng-model="vm.user.apiKey" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="STAFF.HELP.APIKEY"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.user.id != vm.currentUser.id && vm.currentUser.role == \'admin\'" class="md-block">\n                <md-switch ng-model="vm.user.disabled" aria-label="Disabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DISABLED">Disabled</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.DISABLED"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.user.id != vm.currentUser.id && vm.currentUser.role == \'admin\' && vm.user.disabled == 0" class="md-block">\n                <md-switch ng-model="vm.user.blocked" aria-label="Blocked" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.BLOCKED">Blocked</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.BLOCKED"></span></div>\n              </md-input-container>\n            </form>\n          </div>\n          <div class="user-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.AUTHENTICATION">AUTHENTICATION</div>\n            </div>\n            <form name="authenticationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.user.adSsoEnabled" aria-label="AD_SSO_Enabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AD_SSO_ENABLED">AD_SSO_Enabled</span></md-switch>\n                <div class="hint"><span translate="STAFF.HELP.AD_SSO_ENABLED"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="user-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n            </div>\n            <div ng-controller="Userchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.user, vm.crudPermissions)" class="user-detail-form-container md-background-bg md-whiteframe-1dp">\n              <div id="user-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n                <div class="drop-text hint-text" layout="row" layout-align="center center">\n                  <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n                </div>\n                <div class="upload-button" layout="column" layout-align="center center">\n                  <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n                    Upload\n                  </md-button>\n                  <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n                </div>\n                <div layout="row" layout-align="start start" layout-wrap>\n                  <div ng-repeat="change_avatarimage in vm_ca.user.images" ng-switch="change_avatarimage.type">\n                    <div class="user-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n                      <div class="overlay" layout="column" layout-align="center center">\n                        <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n                        </md-progress-linear>\n                      </div>\n                      <img class="media" flow-img="change_avatarimage.file">\n                    </div>\n                    <div class="user-image" ng-switch-when="image" layout="row" layout-align="center center">\n                      <img class="media" ng-src="{{change_avatarimage.url}}">\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.VOICE">VOICE</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="user-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n                <label translate="STAFF.INTERNAL">Internal</label>\n                <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" autofocus disabled>\n                <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.TRANSPORT">Transport</label>\n                <md-select name="transport" ng-model="vm.user.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'udp\'">udp</md-option>\n                  <md-option ng-value="\'tcp\'">tcp</md-option>\n                  <md-option ng-value="\'ws\'">ws</md-option>\n                  <md-option ng-value="\'wss\'">wss</md-option>\n                  <md-option ng-value="\'tls\'">tls</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.NAT">NAT</label>\n                <md-select name="nat" ng-model="vm.user.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'force_rport\'">force_rport</md-option>\n                  <md-option ng-value="\'comedia\'">comedia</md-option>\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'never\'">never</md-option>\n                  <md-option ng-value="\'route\'">route</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n                <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n                <md-select name="allow" ng-model="vm.user.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ulaw\'">ulaw</md-option>\n                  <md-option ng-value="\'alaw\'">alaw</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                  <md-option ng-value="\'g722\'">g722</md-option>\n                  <md-option ng-value="\'g729\'">g729</md-option>\n                  <md-option ng-value="\'opus\'">opus</md-option>\n                  <md-option ng-value="\'h264\'">h264</md-option>\n                </md-select>\n                <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n                <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.user.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.CALLGROUP">Callgroup</label>\n                <input type="text" name="callgroup" ng-model="vm.user.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n                <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n                <input type="text" name="pickupgroup" ng-model="vm.user.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n                <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n                <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n                <md-select name="videosupport" ng-model="vm.user.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'always\'">Always</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="STAFF.CLIENT_LOGS">CLIENT-SIDE LOGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="user-detail-form-container client_logs md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="STAFF.CLIENT_LOGS">\n                CLIENT-SIDE LOGS\n              </div>\n            </div>\n            <ms-client-side-logging user="vm.user" on-user-update="vm.refreshUser()"></ms-client-side-logging>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/users.html",'<div id="users" class="page-layout simple left-sidenav inner-sidenav">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="STAFF.USERS">Users</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedUsers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedUsers =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="STAFF.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-users-count">\n          <span>{{vm.selectedUsers.length}}</span>\n          <span translate="STAFF.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllUsers()" translate="STAFF.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectUsers()" translate="STAFF.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedUsers" csv-label="true" filename="users.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- USER TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedUsers" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUsers">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="role">{{ \'STAFF.ROLE\' | translate }}</th>\n                <th md-column md-order-by="userProfileId">{{ \'STAFF.USERPROFILE\' | translate }}</th>\n                <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n                <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n                <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n                <th md-column md-order-by="disabled">{{ \'STAFF.DISABLED\' | translate }}</th>\n                <th md-column md-order-by="blocked">{{ \'STAFF.BLOCKED\' | translate }}</th>\n                <th md-column>{{ \'STAFF.CLIENT_LOGS\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.users.rows.length">\n                <td md-cell colspan="11">\n                  <div layout="row" layout-align="center center">\n                    <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="user" md-select-id="id" ng-repeat="user in vm.users.rows">\n                <td md-cell ng-if="user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="api/users/{{user.id}}/avatar" /></td>\n                <td md-cell ng-if="!user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="role ">{{ vm.arrayrole[user.role].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="userProfileId font-weight-600">{{ (vm.userProfiles | filter : {\'id\':user.userProfileId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="fullname font-weight-600">{{user.fullname}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="name ">{{user.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="email ">{{user.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="phone ">{{user.phone}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="mobile ">{{user.mobile}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="internal ">{{user.internal}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="disabled ">\n                  <md-icon md-colors="{color: {{user.disabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{user.disabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="blocked ">\n                  <md-icon md-colors="{color: {{user.blocked ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{user.blocked ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditAgent($event, user)" md-cell class="client-side-logging">\n                  <ms-client-side-logging-icon user="user"></ms-client-side-logging-icon>\n                </td>\n                <td md-cell class="actions">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editstate(user, $event    )" translate="STAFF.EDIT_USER">\n                          Edit User\n                        </md-button>\n                      </md-menu-item>\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n                        <md-button ng-click="vm.deleteconfirm(user, $event    )" translate="STAFF.DELETE_USER">\n                          Delete User\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.users.count}}" md-on-paginate="vm.getUsers" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / USER TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD USER BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-user-button" ng-click="vm.createOrEditUser($event)" aria-label="add user" translate translate-attr-aria-label="STAFF.ADD_USER">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",'<div id="cannedAnswers" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.CANNEDANSWERS">CannedAnswers</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedCannedAnswers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedCannedAnswers =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-cannedAnswers-count">\n          <span>{{vm.selectedCannedAnswers.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllCannedAnswers()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectCannedAnswers()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedCannedAnswers" csv-label="true" filename="cannedAnswers.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CANNEDANSWER TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedCannedAnswers" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCannedAnswers">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'TOOLS.KEY\' | translate }}</th>\n                <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.cannedAnswers.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="cannedAnswer" md-select-id="id" ng-repeat="cannedAnswer in vm.cannedAnswers.rows">\n                <td md-cell ng-if="cannedAnswer.userpic"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="api/users/{{cannedAnswer.id}}/avatar" /></td>\n                <td md-cell ng-if="!cannedAnswer.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="id ">{{cannedAnswer.id}}</td>\n                <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="key ">{{cannedAnswer.key}}</td>\n                <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="value ">{{cannedAnswer.value}}</td>\n                <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="description ">{{cannedAnswer.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(cannedAnswer, $event    )" translate="TOOLS.EDIT_CANNEDANSWER">\n                          Edit CannedAnswer\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(cannedAnswer, $event    )" translate="TOOLS.DELETE_CANNEDANSWER">\n                          Delete CannedAnswer\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cannedAnswers.count}}" md-on-paginate="vm.getCannedAnswers" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CANNEDANSWER TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CANNEDANSWER BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-cannedAnswer-button" ng-click="vm.createOrEditCannedAnswer($event)" aria-label="add cannedAnswer" translate translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CANNEDANSWER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/create/dialog.html",'<md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">\n  <form name="cannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.cannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="cannedAnswerForm[\'key\'].$error" ng-show="cannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="TOOLS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 255}\'>Key must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.cannedAnswer.value" required></textarea>\n\n        <div ng-messages="cannedAnswerForm[\'value\'].$error" ng-show="cannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.cannedAnswer.description">\n\n        <div ng-messages="cannedAnswerForm[\'description\'].$error" ng-show="cannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCannedAnswer" ng-click="vm.saveCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCannedAnswer" ng-click="vm.addNewCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CANNEDANSWER" translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n          ADD CANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCannedAnswer" ng-click="vm.deleteCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/create/dialog.html",'<md-dialog class="customDashboard-dialog" aria-label="New CustomDashboard">\n  <form name="customDashboardForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n        <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.customDashboard.description">\n\n        <div ng-messages="customDashboardForm[\'description\'].$error" ng-show="customDashboardForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomDashboard" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid || customDashboardForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomDashboard" ng-click="vm.addNewCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n          ADD CUSTOMDASHBOARD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomDashboard" ng-click="vm.deleteCustomDashboard($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/customDashboards.html",'<div id="customDashboards" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.CUSTOMDASHBOARDS">CustomDashboards</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedCustomDashboards.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedCustomDashboards =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-customDashboards-count">\n          <span>{{vm.selectedCustomDashboards.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllCustomDashboards()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectCustomDashboards()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedCustomDashboards" csv-label="true" filename="customDashboards.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCustomDashboards($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CUSTOMDASHBOARD TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedCustomDashboards" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCustomDashboards">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.customDashboards.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="customDashboard" md-select-id="id" ng-repeat="customDashboard in vm.customDashboards.rows">\n                <td md-cell ng-if="customDashboard.userpic"><img class="avatar" alt="{{customDashboard.name}}" ng-src="api/users/{{customDashboard.id}}/avatar" /></td>\n                <td md-cell ng-if="!customDashboard.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{customDashboard.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="id ">{{customDashboard.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="name ">{{customDashboard.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="description ">{{customDashboard.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(customDashboard, $event    )" translate="TOOLS.EDIT_CUSTOMDASHBOARD">\n                          Edit CustomDashboard\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(customDashboard, $event    )" translate="TOOLS.CLONE_CUSTOMDASHBOARD">\n                          clone CustomDashboard\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotodashboardgoto(customDashboard, $event    )" translate="TOOLS.GOTODASHBOARD_CUSTOMDASHBOARD">\n                          goToDashboard CustomDashboard\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(customDashboard, $event    )" translate="TOOLS.DELETE_CUSTOMDASHBOARD">\n                          Delete CustomDashboard\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.customDashboards.count}}" md-on-paginate="vm.getCustomDashboards" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CUSTOMDASHBOARD TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CUSTOMDASHBOARD BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-customDashboard-button" ng-click="vm.createOrEditCustomDashboard($event)" aria-label="add customDashboard" translate translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CUSTOMDASHBOARD BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/customDashboards/edit/clone/clone.html",'<md-dialog class="customDashboard-dialog" aria-label="Clone CustomDashboard">\n  <form name="customDashboardForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n        <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.CLONE_CUSTOMDASHBOARD">\n        CLONE CUSTOMDASHBOARD\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",'<md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">\n  <form name="dashboarditemForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.dashboarditem.type" ng-change="vm.onTypeChange()" autofocus ng-disabled="!vm.newDashboardItem">\n\n          <md-option ng-value="\'counter\'"> {{ \'TOOLS.COUNTER\' | translate }} </md-option>\n\n          <md-option ng-value="\'multibar-chart\'"> {{ \'TOOLS.MULTIBARCHART\' | translate }} </md-option>\n\n          <md-option ng-value="\'pie-chart\'"> {{ \'TOOLS.PIECHART\' | translate }} </md-option>\n\n          <md-option ng-value="\'web-report\'"> {{ \'TOOLS.WEBREPORT\' | translate }} </md-option>\n\n          <md-option ng-value="\'iframe\'"> {{ \'TOOLS.IFRAME\' | translate }} </md-option>\n\n          <md-option ng-value="\'clock\'"> {{ \'TOOLS.CLOCK\' | translate }} </md-option>\n\n          <md-option ng-value="\'custom\'"> {{ \'TOOLS.CUSTOMTYPE\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'type\'].$error" ng-show="dashboarditemForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\',\'counter\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.CHANNEL">Channel</label>\n        <md-select name="attrChannel" ng-model="vm.dashboarditem.attrChannel" required>\n\n          <md-option ng-value="\'chat\'"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n\n          <md-option ng-value="\'mail\'"> {{ \'TOOLS.EMAIL\' | translate }} </md-option>\n\n          <md-option ng-value="\'sms\'"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n\n          <md-option ng-value="\'openchannel\'"> {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n\n          <md-option ng-value="\'fax\'"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n\n          <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n\n          <md-option ng-value="\'whatsapp\'"> {{ \'TOOLS.WHATSAPP\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrChannel\'].$error" ng-show="dashboarditemForm[\'attrChannel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="![\'web-report\', \'iframe\',\'clock\', \'custom\'].includes(vm.dashboarditem.type)">\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'mail\'" class="md-block">\n          <label translate="TOOLS.FILTEREMAILACCOUNTS">FilterEmailAccounts</label>\n          <md-select name="attrEmailAccounts" ng-model="vm.dashboarditem.attrEmailAccounts" multiple>\n            <md-option ng-value="attrEmailAccounts.id" ng-repeat="attrEmailAccounts in vm.mailAccount" ng-disabled="attrEmailAccounts.canSelect === false">{{ attrEmailAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrEmailAccounts\'].$error" ng-show="dashboarditemForm[\'attrEmailAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTEREMAILACCOUNTS_REQUIRED">FilterEmailAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'fax\'" class="md-block">\n          <label translate="TOOLS.FILTERFAXACCOUNTS">FilterFaxAccounts</label>\n          <md-select name="attrFaxAccounts" ng-model="vm.dashboarditem.attrFaxAccounts" multiple>\n            <md-option ng-value="attrFaxAccounts.id" ng-repeat="attrFaxAccounts in vm.faxAccount" ng-disabled="attrFaxAccounts.canSelect === false">{{ attrFaxAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrFaxAccounts\'].$error" ng-show="dashboarditemForm[\'attrFaxAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTERFAXACCOUNTS_REQUIRED">FilterFaxAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'sms\'" class="md-block">\n          <label translate="TOOLS.FILTERSMSACCOUNTS">FilterSmsAccounts</label>\n          <md-select name="attrSmsAccounts" ng-model="vm.dashboarditem.attrSmsAccounts" multiple>\n            <md-option ng-value="attrSmsAccounts.id" ng-repeat="attrSmsAccounts in vm.smsAccount" ng-disabled="attrSmsAccounts.canSelect === false">{{ attrSmsAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrSmsAccounts\'].$error" ng-show="dashboarditemForm[\'attrSmsAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTERSMSACCOUNTS_REQUIRED">FilterSmsAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'openchannel\'" class="md-block">\n          <label translate="TOOLS.FILTEROPENCHANNELACCOUNTS">FilterOpenchannelAccounts</label>\n          <md-select name="attrOpenchannelAccounts" ng-model="vm.dashboarditem.attrOpenchannelAccounts" multiple>\n            <md-option ng-value="attrOpenchannelAccounts.id" ng-repeat="attrOpenchannelAccounts in vm.openchannelAccount" ng-disabled="attrOpenchannelAccounts.canSelect === false">{{ attrOpenchannelAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrOpenchannelAccounts\'].$error" ng-show="dashboarditemForm[\'attrOpenchannelAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTEROPENCHANNELACCOUNTS_REQUIRED">FilterOpenchannelAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'whatsapp\'" class="md-block">\n          <label translate="TOOLS.FILTERWHATSAPPACCOUNTS">FilterWhatsappAccounts</label>\n          <md-select name="attrWhatsappAccounts" ng-model="vm.dashboarditem.attrWhatsappAccounts" multiple>\n            <md-option ng-value="attrWhatsappAccounts.id" ng-repeat="attrWhatsappAccounts in vm.whatsappAccount" ng-disabled="attrWhatsappAccounts.canSelect === false">{{ attrWhatsappAccounts.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrWhatsappAccounts\'].$error" ng-show="dashboarditemForm[\'attrWhatsappAccounts\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTERWHATSAPPACCOUNTS_REQUIRED">FilterWhatsappAccounts field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n        <md-input-container ng-if="vm.dashboarditem.attrChannel === \'chat\'" class="md-block">\n          <label translate="TOOLS.FILTERCHATWEBSITES">FilterChatWebsites</label>\n          <md-select name="attrChatWebsites" ng-model="vm.dashboarditem.attrChatWebsites" multiple>\n            <md-option ng-value="attrChatWebsites.id" ng-repeat="attrChatWebsites in vm.chatWebsite" ng-disabled="attrChatWebsites.canSelect === false">{{ attrChatWebsites.name }}</md-option>\n          </md-select>\n          <div ng-messages="dashboarditemForm[\'attrChatWebsites\'].$error" ng-show="dashboarditemForm[\'attrChatWebsites\'].$touched" role="alert">\n            <div ng-message="required">\n              <span translate="TOOLS.ERRORS.FILTERCHATWEBSITES_REQUIRED">FilterChatWebsites field is required</span>\n            </div>\n          </div>\n        </md-input-container>\n      </div>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\', \'counter\'].includes(vm.dashboarditem.type) && vm.dashboarditem.attrChannel === \'voice\'" class="md-block">\n        <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>\n        <md-select name="attrVoiceQueues" ng-model="vm.dashboarditem.attrVoiceQueues" multiple>\n          <md-option ng-value="attrVoiceQueues.id" ng-repeat="attrVoiceQueues in vm.voiceQueues" ng-disabled="attrVoiceQueues.canSelect === false">{{ attrVoiceQueues.name }}</md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrVoiceQueues\'].$error" ng-show="dashboarditemForm[\'attrVoiceQueues\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED">FilterVoiceQueues field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TITLE">Title</label>\n        <input type="text" name="title" ng-model="vm.dashboarditem.title" md-maxlength="255" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'title\'].$error" ng-show="dashboarditemForm[\'title\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TITLE_REQUIRED">Title field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="TOOLS.ERRORS.TITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>Title must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TITLEFONTSIZE">TitleFontSize</label>\n        <input type="number" name="titleFontSize" ng-model="vm.dashboarditem.titleFontSize" value="12">\n\n        <div ng-messages="dashboarditemForm[\'titleFontSize\'].$error" ng-show="dashboarditemForm[\'titleFontSize\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TITLEFONTSIZE_REQUIRED">TitleFontSize field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'iframe\'" class="md-block">\n        <label translate="TOOLS.URL">Url</label>\n        <input type="url" name="attrUrl" ng-model="vm.dashboarditem.attrUrl" value="https://" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrUrl\'].$error" ng-show="dashboarditemForm[\'attrUrl\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'custom\'" class="md-block">\n        <label translate="TOOLS.PATH">Path</label>\n        <input type="text" name="attrPath" ng-model="vm.dashboarditem.attrPath" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrPath\'].$error" ng-show="dashboarditemForm[\'attrPath\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.PATH_REQUIRED">Path field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n        <label translate="TOOLS.FORMAT">Format</label>\n        <input type="text" name="attrHourFormat" ng-model="vm.dashboarditem.attrHourFormat" value="HH:mm:ss" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrHourFormat\'].$error" ng-show="dashboarditemForm[\'attrHourFormat\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n        <label translate="TOOLS.TIMEZONE">Timezone</label>\n        <md-select name="attrTimezone" ng-model="vm.dashboarditem.attrTimezone" required>\n          <md-option ng-value="\'-12.00\'">GMT-12.00</md-option>\n          <md-option ng-value="\'-11.00\'">GMT-11.00</md-option>\n          <md-option ng-value="\'-10.00\'">GMT-10.00</md-option>\n          <md-option ng-value="\'-9.00\'">GMT-9.00</md-option>\n          <md-option ng-value="\'-8.00\'">GMT-8.00</md-option>\n          <md-option ng-value="\'-7.00\'">GMT-7.00</md-option>\n          <md-option ng-value="\'-6.00\'">GMT-6.00</md-option>\n          <md-option ng-value="\'-5.00\'">GMT-5.00</md-option>\n          <md-option ng-value="\'-4.00\'">GMT-4.00</md-option>\n          <md-option ng-value="\'-3.30\'">GMT-3.30</md-option>\n          <md-option ng-value="\'-3.00\'">GMT-3.00</md-option>\n          <md-option ng-value="\'-2.00\'">GMT-2.00</md-option>\n          <md-option ng-value="\'-1.00\'">GMT-1.00</md-option>\n          <md-option ng-value="\'0.00\'">GMT 0.00</md-option>\n          <md-option ng-value="\'1.00\'">GMT+1.00</md-option>\n          <md-option ng-value="\'2.00\'">GMT+2.00</md-option>\n          <md-option ng-value="\'3.00\'">GMT+3.00</md-option>\n          <md-option ng-value="\'3.30\'">GMT+3.30</md-option>\n          <md-option ng-value="\'4.00\'">GMT+4.00</md-option>\n          <md-option ng-value="\'4.30\'">GMT+4.30</md-option>\n          <md-option ng-value="\'5.00\'">GMT+5.00</md-option>\n          <md-option ng-value="\'5.30\'">GMT+5.30</md-option>\n          <md-option ng-value="\'5.45\'">GMT+5.45</md-option>\n          <md-option ng-value="\'6.00\'">GMT+6.00</md-option>\n          <md-option ng-value="\'6.30\'">GMT+6.30</md-option>\n          <md-option ng-value="\'7.00\'">GMT+7.00</md-option>\n          <md-option ng-value="\'8.00\'">GMT+8.00</md-option>\n          <md-option ng-value="\'9.00\'">GMT+9.00</md-option>\n          <md-option ng-value="\'9.30\'">GMT+9.30</md-option>\n          <md-option ng-value="\'10.00\'">GMT+10.00</md-option>\n          <md-option ng-value="\'11.00\'">GMT+11.00</md-option>\n          <md-option ng-value="\'12.00\'">GMT+12.00</md-option>\n          <md-option ng-value="\'13.00\'">GMT+13.00</md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrTimezone\'].$error" ng-show="dashboarditemForm[\'attrTimezone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type === \'counter\'" class="md-block">\n        <label translate="TOOLS.METRIC">Metric</label>\n        <md-select name="attrMetric" ng-model="vm.dashboarditem.attrMetric" required>\n\n          <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n          <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n          <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n          <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrMetric\'].$error" ng-show="dashboarditemForm[\'attrMetric\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.SERIE1">Serie1</label>\n        <md-select name="attrSerie1" ng-model="vm.dashboarditem.attrSerie1" required>\n\n          <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n          <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n          <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n          <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrSerie1\'].$error" ng-show="dashboarditemForm[\'attrSerie1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SERIE1_REQUIRED">Serie1 field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.SERIE2">Serie2</label>\n        <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">\n\n          <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n          <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n          <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n          <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n          <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrSerie2\'].$error" ng-show="dashboarditemForm[\'attrSerie2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SERIE2_REQUIRED">Serie2 field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.SERIE3">Serie3</label>\n        <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">\n\n          <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n          <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n          <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n          <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n          <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n          <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n          <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="dashboarditemForm[\'attrSerie3\'].$error" ng-show="dashboarditemForm[\'attrSerie3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SERIE3_REQUIRED">Serie3 field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n        <label translate="TOOLS.REPORT">Report</label>\n        <input type="search" name="report" ng-model="vm.dashboarditem.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n        <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n        <div ng-messages="dashboarditemForm[\'report\'].$error" ng-show="dashboarditemForm[\'report\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n        <label translate="TOOLS.REFRESH">Refresh</label>\n        <input type="number" name="attrRefresh" ng-model="vm.dashboarditem.attrRefresh" min="5" value="10" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrRefresh\'].$error" ng-show="dashboarditemForm[\'attrRefresh\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.REFRESH_REQUIRED">Refresh field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Refresh must be a valid greater or equal than</span> <span>5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="[\'counter\', \'clock\'].includes(vm.dashboarditem.type)" class="md-block">\n        <label translate="TOOLS.FONTSIZE">FontSize</label>\n        <input type="number" name="attrFontSize" ng-model="vm.dashboarditem.attrFontSize" min="12" max="40" value="20" ng-required="true">\n\n        <div ng-messages="dashboarditemForm[\'attrFontSize\'].$error" ng-show="dashboarditemForm[\'attrFontSize\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED">FontSize field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>12</span>\n          </div>\n          <div ng-message="max">\n            <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>40</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div flex md-color-picker ng-model="vm.dashboarditem.foreground" label="{{\'TOOLS.FOREGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n      <div flex md-color-picker ng-model="vm.dashboarditem.background" label="{{\'TOOLS.BACKGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.LINK">link</label>\n        <input type="url" name="link" ng-model="vm.dashboarditem.link">\n\n        <div ng-messages="dashboarditemForm[\'link\'].$error" ng-show="dashboarditemForm[\'link\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LINK_REQUIRED">link field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL">link must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDashboardItem" ng-click="vm.saveDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDashboardItem" ng-click="vm.addNewDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DASHBOARDITEM" translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM">\n          ADD DASHBOARDITEM\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDashboardItem" ng-click="vm.deleteDashboardItem($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/view.html",'<div id="tools-customDashboard" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-customDashboards-button md-icon-button" aria-label="Go to customDashboards" ng-click="vm.gotoCustomDashboards()" translate translate-attr-aria-label="TOOLS.GO_TO_CUSTOMDASHBOARDS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="customDashboard-image" hide-xs>\n          <img ng-src="assets/images/business/customDashboards.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.customDashboard.id}}\n            <span ng-if="vm.customDashboard.name">{{vm.customDashboard.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.customDashboard.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.customDashboard, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="TOOLS.CLONE_CUSTOMDASHBOARD"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.customDashboard, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="TOOLS.GOTO_CUSTOMDASHBOARD"></span></md-tooltip>\n        <md-icon md-font-icon="icon-forward"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveCustomDashboard()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (dashboardForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="customDashboard-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.customDashboard.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.DASHBOARD">DASHBOARD</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="customDashboard-detail-form-container dashboard md-background-bg md-whiteframe-1dp">\n            <div ng-controller="CustomDashboardItemsController as vm_cd" ng-init="vm_cd.init(vm.customDashboard, vm.crudPermissions)" class="customDashboard-detail-form-container no-padding no-margin" layout="column">\n              <div ng-if="vm_cd.customDashboard.widgets.length">\n                <md-button class="md-fab md-mini md-accent" ng-click="vm_cd.createOrEditWidget()" ng-if="vm_cd.crudPermissions.canEdit" aria-label="add item">\n                  <md-tooltip>{{ \'TOOLS.ADD_WIDGET\' | translate }}</md-tooltip>\n                  <md-icon md-font-icon="icon-plus"></md-icon>\n                </md-button>\n                <md-content flex>\n                  <ms-widget-engine config="vm_cd.customDashboard" on-edit="vm_cd.createOrEditWidget(widget)" on-delete="vm_cd.deleteWidget(widget)"></ms-widget-engine>\n                </md-content>\n              </div>\n              <div ng-if="!vm_cd.customDashboard.widgets.length" layout="row" layout-align="center center" flex>\n                <md-button class="width-130 height-130 md-accent md-raised" ng-click="vm_cd.createOrEditWidget()" aria-label="add item" layout="column">\n                  <md-icon md-font-icon="icon-plus-circle" class="s50"></md-icon>\n                  <span layout-wrap translate="TOOLS.ADD_WIDGET"></span>\n                </md-button>\n              </div>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n  <md-toolbar>\n    <div class="md-toolbar-tools">\n      <h2>Select Report</h2>\n      <span flex></span>\n      <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-dialog-content>\n    <div class="content" md-background-bg layout="row" layout-align="start start">\n      <div layout="column" flex="30">\n        <md-card class="padding-10 scrollable">\n          <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n        </md-card>\n        <md-card class="padding-10 scrollable">\n          <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n        </md-card>\n      </div>\n      <md-card flex="70">\n        <md-toolbar class="md-table-toolbar md-default">\n          <div class="md-toolbar-tools">\n            <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n            <p ng-if="vm.currentPath">\n              <span class="text-boxed">{{vm.currentPath}}</span>\n            </p>\n          </div>\n        </md-toolbar>\n        <md-table-container>\n          <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n              <tr md-row>\n                <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n                <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n                <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.reports.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n                <td md-cell class="id">{{ report.id }}</td>\n                <td md-cell class="name">{{ report.name }}</td>\n                <td md-cell class="description">{{ report.description }}</td>\n                <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n      </md-card>\n    </div>\n  </md-dialog-content>\n  <md-dialog-actions layout="row">\n    <span flex></span>\n    <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n    <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n  </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/create/dialog.html",'<md-dialog ng-init="vm.onInit()" class="disposition-dialog" aria-label="New Disposition">\n  <form name="dispositionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newDisposition ? \'TOOLS.NEW_DISPOSITION\' : \'TOOLS.EDIT_DISPOSITION\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.disposition.name" md-maxlength="255" required md-autofocus>\n        <div ng-messages="dispositionForm[\'name\'].$error" ng-show="dispositionForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="TOOLS.ERRORS.NAME_MAX_LENGTH" translate-values=\'{max: 255}\'>Name must have a maximum length\n              equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.disposition.description" md-maxlength="255">\n        <div ng-messages="dispositionForm[\'description\'].$error" ng-show="dispositionForm[\'description\'].$touched" role="alert">\n          <div ng-message="md-maxlength">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_MAX_LENGTH" translate-values=\'{max: 255}\'>Description must have a\n              maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div ng-if="vm.newDisposition && vm.dispositions.length > 0 || vm.disposition.ParentId" layout="row" layout-align="start center">\n        <md-input-container class="md-block" flex>\n          <label translate="TOOLS.FIRST_LEVEL_DISPOSITION">First Level Disposition</label>\n          <md-select name="firstLevelDisposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onFirstLevelSelection()">\n            <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' }" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-button ng-if="vm.firstLevelDisposition" ng-click="vm.clearSelection(\'first\'); dispositionForm.$setDirty();" class="md-icon-button">\n          <md-icon md-font-icon="icon-cancel" aria-label="Clear first level disposition selection">\n          </md-icon>\n        </md-button>\n      </div>\n      <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n        <md-input-container class="md-block" flex>\n          <label translate="TOOLS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n          <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition">\n            <md-option ng-value="disposition" ng-if="disposition.id != vm.disposition.id" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id }" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearSelection(\'second\'); dispositionForm.$setDirty();" class="md-icon-button">\n          <md-icon md-font-icon="icon-cancel" aria-label="Clear first level disposition selection">\n          </md-icon>\n        </md-button>\n      </div>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDisposition" ng-click="vm.saveDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid || dispositionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDisposition" ng-click="vm.addNewDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DISPOSITION" translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n          ADD DISPOSITION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDisposition" ng-click="vm.deleteDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/dispositions.html",'<div id="dispositions" class="page-layout simple left-sidenav inner-sidenav">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.DISPOSITIONS">Dispositions</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedDispositions.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedDispositions = []">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-dispositions-count">\n          <span>{{vm.selectedDispositions.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllDispositions()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectDispositions()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedDispositions" csv-label="true" filename="dispositions.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n      <div layout="row">\n        <div class="column" flex="20">\n          <md-card>\n            <md-card-content>\n              <button layout-align="center center" md-mini-fab ng-click="vm.query.level = null; vm.getDispositions()">\n                <div layout="row" layout-align="start center">\n                  <md-icon md-font-icon="icon-refresh"></md-icon>\n                  <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                </div>\n              </button>\n            </md-card-content>\n          </md-card>\n          <md-card>\n            <md-card-content>\n              <md-input-container class="md-block" flex-gt-sm="">\n                <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm.query.level" ng-change="vm.getDispositions()">\n                  <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                  <md-option ng-value="key" ng-repeat="(key, value) in vm.levels">{{ value }}</md-option>\n                </md-select>\n              </md-input-container>\n            </md-card-content>\n          </md-card>\n        </div>\n        \x3c!-- DISPOSITION TABLE --\x3e\n        <md-card flex="80">\n          <md-table-container>\n            <table md-table md-row-select multiple ng-model="vm.selectedDispositions" md-progress="vm.promise">\n              <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDispositions">\n                <tr md-row>\n                  <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                  <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                  <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                  <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                  <th md-column width="10px"></th>\n                </tr>\n              </thead>\n              <tbody md-body>\n                <tr md-row ng-hide="vm.dispositions.rows.length">\n                  <td md-cell colspan="5">\n                    <div layout="row" layout-align="center center">\n                      <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                    </div>\n                  </td>\n                </tr>\n                <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm.dispositions.rows">\n                  <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                  </td>\n                  <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                    {{ vm.levels[disposition.level] }}</td>\n                  <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                    {{disposition.name}}</td>\n                  <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                    {{disposition.description}}</td>\n                  <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                    <md-menu>\n                      <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                        <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                      </md-button>\n                      <md-menu-content width="3">\n                        \x3c!-- SUBACTIONS --\x3e\n                        \x3c!-- ACTIONS --\x3e\n                        <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                          <md-button ng-click="vm.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                            Edit Disposition\n                          </md-button>\n                        </md-menu-item>\n                        \x3c!-- SUBACTIONS --\x3e\n                        \x3c!-- ACTIONS --\x3e\n                        <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                          <md-button ng-click="vm.deleteconfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                            Delete Disposition\n                          </md-button>\n                        </md-menu-item>\n                      </md-menu-content>\n                    </md-menu>\n                  </td>\n                </tr>\n              </tbody>\n            </table>\n          </md-table-container>\n          <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dispositions.count}}" md-on-paginate="vm.getDispositions" md-page-select>\n          </md-table-pagination>\n        </md-card>\n        \x3c!-- / DISPOSITION TABLE --\x3e\n      </div>\n      \x3c!-- NO RESULTS --\x3e\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n  \x3c!-- ADD DISPOSITION BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-disposition-button" ng-click="vm.createOrEditDisposition($event)" aria-label="add disposition" translate translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD DISPOSITION BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/intervals/create/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n        <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.interval.description">\n\n        <div ng-messages="intervalForm[\'description\'].$error" ng-show="intervalForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input ng-model="vm.interval.name" type="text" name="name" placeholder="{{\'TOOLS.NAME\' | translate}}" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" md-autofocus required>\n        <div ng-messages="intervalForm.name.$error" ng-show="intervalForm.name.$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/intervals/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n        <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/view.html",'<div id="tools-interval" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-intervals-button md-icon-button" aria-label="Go to intervals" ng-click="vm.gotoIntervals()" translate translate-attr-aria-label="TOOLS.GO_TO_INTERVALS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="interval-image" hide-xs>\n          <img ng-src="assets/images/business/intervals.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.interval.id}}\n            <span ng-if="vm.interval.name">{{vm.interval.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.interval.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveInterval()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (intervalsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="interval-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.interval.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.INTERVALS">INTERVALS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="interval-detail-form-container intervals md-background-bg md-whiteframe-1dp">\n            <div ng-controller="IntervalIntervalsController as vm_dc" ng-init="vm_dc.init(vm.interval, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIntervalIntervals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="TOOLS.INTERVALS">Intervals</span>\n                  <ms-search-bar on-search="vm_dc.getIntervalIntervals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditIntervalInterval($event)" aria-label="add interval" translate translate-attr-label="TOOLS.ADD_INTERVAL">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIntervalIntervals.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedIntervalIntervals.length}} {{vm_dc.selectedIntervalIntervals.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIntervalIntervals" csv-label="true" filename="intervals.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIntervalIntervals($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedIntervalIntervals" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIntervalIntervals">\n                    <tr md-row>\n                      <th md-column width="10px"></th>\n                      <th md-column md-order-by="id">\n                        {{ \'TOOLS.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="name">\n                        {{ \'TOOLS.NAME\' | translate }}\n                      </th>\n                      <th md-column md-order-by="interval">\n                        {{ \'TOOLS.INTERVAL\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'TOOLS.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body ng-sortable="vm_dc.sortableTable">\n                    <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm_dc.intervalIntervals.rows">\n                      <td md-cell>\n                        <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n                        {{interval.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n                        {{interval.name}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n                        {{interval.interval}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n                        {{ interval.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" translate="TOOLS.EDIT_INTERVAL">\n                                Edit Interval\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n                                Delete Interval\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.intervalIntervals.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="TOOLS.NO_INTERVALS_AVAILABLE">No intervals available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/intervals.html",'<div id="intervals" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.INTERVALS">Intervals</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedIntervals.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedIntervals =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-intervals-count">\n          <span>{{vm.selectedIntervals.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllIntervals()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectIntervals()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedIntervals" csv-label="true" filename="intervals.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIntervals($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- INTERVAL TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedIntervals" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIntervals">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.intervals.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm.intervals.rows">\n                <td md-cell ng-if="interval.userpic"><img class="avatar" alt="{{interval.name}}" ng-src="api/users/{{interval.id}}/avatar" /></td>\n                <td md-cell ng-if="!interval.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{interval.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="id ">{{interval.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="name ">{{interval.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="description ">{{interval.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(interval, $event    )" translate="TOOLS.EDIT_INTERVAL">\n                          Edit Interval\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(interval, $event    )" translate="TOOLS.DELETE_INTERVAL">\n                          Delete Interval\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.intervals.count}}" md-on-paginate="vm.getIntervals" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / INTERVAL TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD INTERVAL BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-interval-button" ng-click="vm.createOrEditInterval($event)" aria-label="add interval" translate translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD INTERVAL BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/pauses/create/dialog.html",'<md-dialog class="pause-dialog" aria-label="New Pause">\n  <form name="pauseForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.pause.name" ng-required="true" autofocus>\n\n        <div ng-messages="pauseForm[\'name\'].$error" ng-show="pauseForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.pause.description">\n\n        <div ng-messages="pauseForm[\'description\'].$error" ng-show="pauseForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPause" ng-click="vm.savePause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid || pauseForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPause" ng-click="vm.addNewPause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_PAUSE" translate-attr-aria-label="TOOLS.ADD_PAUSE">\n          ADD PAUSE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPause" ng-click="vm.deletePause($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/pauses/pauses.html",'<div id="pauses" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.PAUSES">Pauses</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedPauses.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedPauses =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-pauses-count">\n          <span>{{vm.selectedPauses.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllPauses()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectPauses()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedPauses" csv-label="true" filename="pauses.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPauses($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- PAUSE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedPauses" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPauses">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.pauses.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="pause" md-select-id="id" ng-repeat="pause in vm.pauses.rows">\n                <td md-cell ng-if="pause.userpic"><img class="avatar" alt="{{pause.name}}" ng-src="api/users/{{pause.id}}/avatar" /></td>\n                <td md-cell ng-if="!pause.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{pause.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="id ">{{pause.id}}</td>\n                <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="name ">{{pause.name}}</td>\n                <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="description ">{{pause.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(pause, $event    )" translate="TOOLS.EDIT_PAUSE">\n                          Edit Pause\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(pause, $event    )" translate="TOOLS.DELETE_PAUSE">\n                          Delete Pause\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.pauses.count}}" md-on-paginate="vm.getPauses" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / PAUSE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD PAUSE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-pause-button" ng-click="vm.createOrEditPause($event)" aria-label="add pause" translate translate-attr-aria-label="TOOLS.ADD_PAUSE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD PAUSE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/schedules/create/dialog.html",'<md-dialog class="schedule-dialog" aria-label="New Schedule">\n  <form name="scheduleForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.schedule.name" ng-required="true" autofocus>\n\n        <div ng-messages="scheduleForm[\'name\'].$error" ng-show="scheduleForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.REPORT">Report</label>\n        <input type="search" name="report" ng-model="vm.schedule.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n        <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n        <div ng-messages="scheduleForm[\'report\'].$error" ng-show="scheduleForm[\'report\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.OUTPUT">Output</label>\n        <md-select name="output" ng-model="vm.schedule.output" required>\n          <md-option ng-value="\'csv\'">CSV</md-option>\n          <md-option ng-value="\'pdf\'">PDF</md-option>\n          <md-option ng-value="\'xlsx\'">Excel</md-option>\n        </md-select>\n        <div ng-messages="scheduleForm[\'output\'].$error" ng-show="scheduleForm[\'output\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>\n      </md-input-container>\n      <div class="md-block">\n        <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click required name="startAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n              <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click required name="startAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n              <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </md-content>\n      </div>\n      <div class="md-block">\n        <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>\n        <md-content layout="row" class="md-padding">\n          <div flex class="md-block">\n            <mdp-date-picker mdp-open-on-click required name="endAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n              <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n                </div>\n              </div>\n            </mdp-date-picker>\n          </div>\n          <div flex class="md-block">\n            <mdp-time-picker mdp-open-on-click required name="endAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n              <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n                <div ng-message="required">\n                  <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n                </div>\n                <div ng-message="format">\n                  <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n                </div>\n              </div>\n            </mdp-time-picker>\n          </div>\n        </md-content>\n      </div>\n      <div flex class="md-block">\n        <label> {{ \'TOOLS.CRON\' | translate }} ({{vm.schedule.cron}})</label>\n        <cron-selection name="cron" ng-model="vm.schedule.cron" template="assets/angular-cron-jobs/template.html" required></cron-selection>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.LAST">Last</label>\n        <input type="number" name="subtractNumber" ng-model="vm.schedule.subtractNumber" value="1" ng-required="true">\n\n        <div ng-messages="scheduleForm[\'subtractNumber\'].$error" ng-show="scheduleForm[\'subtractNumber\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LAST_REQUIRED">Last field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.LASTUNIT">LastUnit</label>\n        <md-select name="subtractUnit" ng-model="vm.schedule.subtractUnit" required>\n          <md-option ng-value="\'minutes\'">Minutes</md-option>\n          <md-option ng-value="\'hours\'">Hours</md-option>\n          <md-option ng-value="\'days\'">Days</md-option>\n          <md-option ng-value="\'weeks\'">Weeks</md-option>\n          <md-option ng-value="\'months\'">Months</md-option>\n          <md-option ng-value="\'quarters\'">Quarters</md-option>\n          <md-option ng-value="\'years\'">Years</md-option>\n        </md-select>\n        <div ng-messages="scheduleForm[\'subtractUnit\'].$error" ng-show="scheduleForm[\'subtractUnit\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LASTUNIT_REQUIRED">LastUnit field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <label translate="TOOLS.MAILACCOUNT">MailAccount</label>\n        <md-select name="MailAccountId" ng-model="vm.schedule.MailAccountId" required>\n          <md-option ng-value="MailAccountId.id" ng-repeat="MailAccountId in vm.mailAccounts" ng-disabled="MailAccountId.canSelect === false">{{ MailAccountId.name }}</md-option>\n        </md-select>\n        <div ng-messages="scheduleForm[\'MailAccountId\'].$error" ng-show="scheduleForm[\'MailAccountId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.MAILACCOUNT_REQUIRED">MailAccount field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>\n        <input type="text" name="email" ng-model="vm.schedule.email" ng-required="true">\n\n        <div class="hint"><span translate="TOOLS.HELP.EMAILADDRESS"></span></div>\n        <div ng-messages="scheduleForm[\'email\'].$error" ng-show="scheduleForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <label translate="TOOLS.EMAILCCADDRESS">EmailCcAddress</label>\n        <input type="text" name="cc" ng-model="vm.schedule.cc">\n\n        <div class="hint"><span translate="TOOLS.HELP.EMAILCCADDRESS"></span></div>\n        <div ng-messages="scheduleForm[\'cc\'].$error" ng-show="scheduleForm[\'cc\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.EMAILCCADDRESS_REQUIRED">EmailCcAddress field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <label translate="TOOLS.EMAILBCCADDRESS">EmailBccAddress</label>\n        <input type="text" name="bcc" ng-model="vm.schedule.bcc">\n\n        <div class="hint"><span translate="TOOLS.HELP.EMAILBCCADDRESS"></span></div>\n        <div ng-messages="scheduleForm[\'bcc\'].$error" ng-show="scheduleForm[\'bcc\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.EMAILBCCADDRESS_REQUIRED">EmailBccAddress field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n        <md-switch ng-model="vm.schedule.sendIfEmpty" aria-label="SendIfEmpty"><span translate="TOOLS.SENDIFEMPTY">SendIfEmpty</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="" name="description" ng-model="vm.schedule.description">\n\n        <div ng-messages="scheduleForm[\'description\'].$error" ng-show="scheduleForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n          ADD SCHEDULE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n  <md-toolbar>\n    <div class="md-toolbar-tools">\n      <h2>Select Report</h2>\n      <span flex></span>\n      <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n        <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-dialog-content>\n    <div class="content" md-background-bg layout="row" layout-align="start start">\n      <div layout="column" flex="30">\n        <md-card class="padding-10 scrollable">\n          <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n        </md-card>\n        <md-card class="padding-10 scrollable">\n          <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n        </md-card>\n      </div>\n      <md-card flex="70">\n        <md-toolbar class="md-table-toolbar md-default">\n          <div class="md-toolbar-tools">\n            <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n            <p ng-if="vm.currentPath">\n              <span class="text-boxed">{{vm.currentPath}}</span>\n            </p>\n          </div>\n        </md-toolbar>\n        <md-table-container>\n          <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n              <tr md-row>\n                <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n                <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n                <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.reports.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n                <td md-cell class="id">{{ report.id }}</td>\n                <td md-cell class="name">{{ report.name }}</td>\n                <td md-cell class="description">{{ report.description }}</td>\n                <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n      </md-card>\n    </div>\n  </md-dialog-content>\n  <md-dialog-actions layout="row">\n    <span flex></span>\n    <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n    <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n  </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/schedules.html",'<div id="schedules" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.SCHEDULER">Scheduler</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedScheduler.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedScheduler =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-schedules-count">\n          <span>{{vm.selectedScheduler.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllScheduler()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectScheduler()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedScheduler" csv-label="true" filename="schedules.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScheduler($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SCHEDULE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedScheduler" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduler">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="startAt">{{ \'TOOLS.VALIDITYSTART\' | translate }}</th>\n                <th md-column md-order-by="endAt">{{ \'TOOLS.VALIDITYEND\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.schedules.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="schedule" md-select-id="id" ng-repeat="schedule in vm.schedules.rows">\n                <td md-cell ng-if="schedule.userpic"><img class="avatar" alt="{{schedule.name}}" ng-src="api/users/{{schedule.id}}/avatar" /></td>\n                <td md-cell ng-if="!schedule.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{schedule.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="id ">{{schedule.id}}</td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="name ">{{schedule.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(schedule, ev) : vm.createOrEditSchedule($event, schedule)" md-cell class="active ">\n                  <md-icon md-colors="{color: {{schedule.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{schedule.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="startAt ">{{schedule.startAt | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="endAt ">{{schedule.endAt | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="description ">{{schedule.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(schedule, $event    )" translate="TOOLS.EDIT_SCHEDULE">\n                          Edit Schedule\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.runconfirm(schedule, $event    )" translate="TOOLS.RUN_SCHEDULE">\n                          Run Schedule\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(schedule, $event    )" translate="TOOLS.DELETE_SCHEDULE">\n                          Delete Schedule\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.schedules.count}}" md-on-paginate="vm.getScheduler" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SCHEDULE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD SCHEDULE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-schedule-button" ng-click="vm.createOrEditSchedule($event)" aria-label="add schedule" translate translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD SCHEDULE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/create/dialog.html",'<md-dialog class="sound-dialog" aria-label="New Sound">\n  <form name="soundForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.sound.name" ng-required="true" autofocus>\n\n        <div ng-messages="soundForm[\'name\'].$error" ng-show="soundForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.sound.description">\n\n        <div ng-messages="soundForm[\'description\'].$error" ng-show="soundForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSound" ng-click="vm.saveSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid || soundForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSound" ng-click="vm.addNewSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SOUND" translate-attr-aria-label="TOOLS.ADD_SOUND">\n          ADD SOUND\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSound" ng-click="vm.deleteSound($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/sounds/sounds.html",'<div id="sounds" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.SOUNDS">Sounds</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedSounds.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedSounds =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-sounds-count">\n          <span>{{vm.selectedSounds.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllSounds()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectSounds()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedSounds" csv-label="true" filename="sounds.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSounds($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SOUND TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedSounds" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSounds">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="audio">{{ \'TOOLS.AUDIO\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.sounds.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="sound" md-select-id="id" ng-repeat="sound in vm.sounds.rows">\n                <td md-cell ng-if="sound.userpic"><img class="avatar" alt="{{sound.name}}" ng-src="api/users/{{sound.id}}/avatar" /></td>\n                <td md-cell ng-if="!sound.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sound.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="id ">{{sound.id}}</td>\n                <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="name ">{{sound.name}}</td>\n                <td md-cell class="audio ">\n                  \x3c!-- audio recording directive --\x3e\n                  <ms-recording id="sound.id" model="\'sound\'"></ms-recording>\n                  \x3c!-- / audio recording directive --\x3e\n                </td>\n                <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="description ">{{sound.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(sound, $event    )" translate="TOOLS.EDIT_SOUND">\n                          Edit Sound\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.downloadfile2(sound, $event  , \'sounds\'   )" translate="TOOLS.DOWNLOAD_SOUND">\n                          Download Sound\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(sound, $event    )" translate="TOOLS.DELETE_SOUND">\n                          Delete Sound\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sounds.count}}" md-on-paginate="vm.getSounds" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SOUND TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- UPLOAD SOUND BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-sound-button" ng-click="vm.uploadSound($event)" aria-label="upload sound" translate translate-attr-aria-label="TOOLS.UPLOAD_SOUND">\n    <md-icon md-font-icon="icon-upload"></md-icon>\n  </md-button>\n  \x3c!-- / UPLOAD SOUND BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n  <form name="uploadForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div id="sound-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n        <div class="drop-text hint-text" layout="row" layout-align="center center">\n          <span translate="TOOLS.DROP_TO_UPLOAD">Drop to upload</span>\n        </div>\n\n        <div class="upload-button" layout="column" layout-align="center center">\n          <md-button class="md-accent md-raised" flow-btn>\n            Upload\n          </md-button>\n          <span class="secondary-text mt-8" translate="TOOLS.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n        </div>\n      </div>\n\n      <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n        <div>\n          <span translate="TOOLS.UPLOADING">Uploading</span>\n          <span>{{vm.sound.file.name}}</span>\n        </div>\n        <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n      </div>\n\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center"></div>\n      <div layout="row">\n        <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="TOOLS.FINISH" translate-attr-aria-label="TOOLS.FINISH">\n          FINISH\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/create/dialog.html",'<md-dialog class="tag-dialog" aria-label="New Tag">\n  <form name="tagForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.tag.name" ng-required="true" autofocus>\n\n        <div ng-messages="tagForm[\'name\'].$error" ng-show="tagForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.tag.description">\n\n        <div ng-messages="tagForm[\'description\'].$error" ng-show="tagForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div flex md-color-picker ng-model="vm.tag.color" label="{{\'TOOLS.COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTag" ng-click="vm.saveTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid || tagForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTag" ng-click="vm.addNewTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TAG" translate-attr-aria-label="TOOLS.ADD_TAG">\n          ADD TAG\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTag" ng-click="vm.deleteTag($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/tags.html",'<div id="tags" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.TAGS">Tags</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTags.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTags =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-tags-count">\n          <span>{{vm.selectedTags.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTags()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTags()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTags" csv-label="true" filename="tags.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTags($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TAG TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTags" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTags">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column md-order-by="color">{{ \'TOOLS.COLOR\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.tags.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="tag" md-select-id="id" ng-repeat="tag in vm.tags.rows">\n                <td md-cell ng-if="tag.userpic"><img class="avatar" alt="{{tag.name}}" ng-src="api/users/{{tag.id}}/avatar" /></td>\n                <td md-cell ng-if="!tag.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{tag.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="id ">{{tag.id}}</td>\n                <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="name ">{{tag.name}}</td>\n                <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="description ">{{tag.description}}</td>\n                <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="color ">{{tag.color}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(tag, $event    )" translate="TOOLS.EDIT_TAG">\n                          Edit Tag\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(tag, $event    )" translate="TOOLS.DELETE_TAG">\n                          Delete Tag\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.tags.count}}" md-on-paginate="vm.getTags" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TAG TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TAG BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-tag-button" ng-click="vm.createOrEditTag($event)" aria-label="add tag" translate translate-attr-aria-label="TOOLS.ADD_TAG">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TAG BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/templates/create/dialog.html",'<md-dialog class="template-dialog" aria-label="New Template">\n  <form name="templateForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.template.name" ng-required="true" autofocus>\n\n        <div ng-messages="templateForm[\'name\'].$error" ng-show="templateForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="md-block">\n        <label class="md-caption grey-fg" translate="TOOLS.CONTENT">Content</label>\n        <textarea aria-label="Content html" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.template.html"></textarea>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.template.description">\n\n        <div ng-messages="templateForm[\'description\'].$error" ng-show="templateForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTemplate" ng-click="vm.saveTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid || templateForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTemplate" ng-click="vm.addNewTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TEMPLATE" translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n          ADD TEMPLATE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTemplate" ng-click="vm.deleteTemplate($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/templates/templates.html",'<div id="templates" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.TEMPLATES">Templates</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTemplates.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTemplates =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-templates-count">\n          <span>{{vm.selectedTemplates.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTemplates()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTemplates()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTemplates" csv-label="true" filename="templates.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTemplates($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TEMPLATE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTemplates" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTemplates">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.templates.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="template" md-select-id="id" ng-repeat="template in vm.templates.rows">\n                <td md-cell ng-if="template.userpic"><img class="avatar" alt="{{template.name}}" ng-src="api/users/{{template.id}}/avatar" /></td>\n                <td md-cell ng-if="!template.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{template.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="id ">{{template.id}}</td>\n                <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="name ">{{template.name}}</td>\n                <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="description ">{{template.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(template, $event    )" translate="TOOLS.EDIT_TEMPLATE">\n                          Edit Template\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(template, $event    )" translate="TOOLS.DELETE_TEMPLATE">\n                          Delete Template\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.templates.count}}" md-on-paginate="vm.getTemplates" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TEMPLATE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TEMPLATE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-template-button" ng-click="vm.createOrEditTemplate($event)" aria-label="add template" translate translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TEMPLATE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/create/dialog.html",'<md-dialog class="trigger-dialog" aria-label="New Trigger">\n  <form name="triggerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newTrigger ? \'TOOLS.NEW_TRIGGER\' : \'TOOLS.EDIT_TRIGGER\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.trigger.name" required md-autofocus>\n        <div ng-messages="triggerForm[\'name\'].$error" ng-show="triggerForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.CHANNEL">Channel</label>\n        <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="!vm.newTrigger">\n          <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n          <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }}\n          </md-option>\n          <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n          <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n          <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n          <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n          <md-option ng-value="\'whatsapp\'" ng-if="vm.license.whatsapp"> {{ \'TOOLS.WHATSAPP\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="triggerForm[\'channel\'].$error" ng-show="triggerForm[\'channel\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span>\n        </md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.trigger.description">\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{ error.message }}</span>\n            <span class="type">({{ error.type }})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrigger" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid || triggerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrigger" ng-click="vm.addNewTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRIGGER" translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n          ADD TRIGGER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrigger" ng-click="vm.deleteTrigger($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/actions/actions.html",'<div ng-controller="TriggerActionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\r\n  <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerActions.length">\r\n    <div class="md-toolbar-tools">\r\n      <span class="md-subhead" translate="TOOLS.ACTIONS">Actions</span>\r\n      <ms-search-bar on-search="vm_dc.getTriggerActions()" query="vm_dc.query" debounce="300" direction="down">\r\n      </ms-search-bar>\r\n      <div flex></div>\r\n      <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAction($event)" aria-label="add action" translate translate-attr-label="TOOLS.ADD_ACTION">\r\n        <md-icon md-font-icon="icon-plus"></md-icon>\r\n      </md-button>\r\n    </div>\r\n  </md-toolbar>\r\n  <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerActions.length">\r\n    <div class="md-toolbar-tools">\r\n      <span class="md-subhead">{{ vm_dc.selectedTriggerActions.length }}\r\n        {{ vm_dc.selectedTriggerActions.length > 1 ? \'items\' : \'item\' }} selected</span>\r\n      <div flex></div>\r\n      <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerActions" csv-label="true" filename="triggers.csv">\r\n        <md-icon md-font-icon="icon-file-excel"></md-icon>\r\n      </button>\r\n      <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerActions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\r\n        <md-icon md-font-icon="icon-delete"></md-icon>\r\n      </md-button>\r\n    </div>\r\n  </md-toolbar>\r\n  <md-table-container class="font-size-12">\r\n    <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerActions" md-progress="vm_dc.promise">\r\n      <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerActions">\r\n        <tr md-row>\r\n          <th md-column md-order-by="id">\r\n            {{ \'TOOLS.ID\' | translate }}\r\n          </th>\r\n          <th md-column md-order-by="action">\r\n            {{ \'TOOLS.ACTION\' | translate }}\r\n          </th>\r\n          <th md-column md-order-by="data1">\r\n            {{ \'TOOLS.TYPE\' | translate }}\r\n          </th>\r\n          <th md-column md-order-by="data2">\r\n            {{ \'TOOLS.INFO\' | translate }}\r\n          </th>\r\n          <th md-column md-order-by="createdAt">\r\n            {{ \'TOOLS.CREATED_AT\' | translate }}\r\n          </th>\r\n          <th md-column width="10px"></th>\r\n        </tr>\r\n      </thead>\r\n      <tbody md-body>\r\n        <tr md-row md-select="action" md-select-id="id" ng-repeat="action in vm_dc.triggerActions.rows">\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n            {{ action.id }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n            {{ \'TOOLS.\' + (action.action | snakecase | uppercase) | translate }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\'" md-cell>\r\n            {{ action.data1 === \'1\' ? \'CTI URL\' : \'Popup\' }} </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>\r\n            {{ (vm_dc.lists | filter : {\'id\':(action.data1 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>\r\n            {{ action.data2 === \'1\' ? \'TOOLS.YES\' : \'TOOLS.NO\' | uppercase | translate }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>\r\n            {{ action.data1 }} </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data1" md-cell>\r\n            {{ action.data1 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data2" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'script\' && action.data2" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'script\' && action.data1" md-cell>\r\n            {{ action.data1 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'jscripty\'" md-cell>\r\n            {{ (vm_dc.projects | filter : {\'id\':(action.data1 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\'" md-cell>\r\n            {{ vm_dc.integrationTypes[action.data1] }} </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zendesk\'" md-cell>\r\n            {{ (vm_dc.zendeskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'desk\'" md-cell>\r\n            {{ (vm_dc.deskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zoho\'" md-cell>\r\n            {{ (vm_dc.zohoAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'salesforce\'" md-cell>\r\n            {{ (vm_dc.salesforceAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'sugarcrm\'" md-cell>\r\n            {{ (vm_dc.sugarcrmAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshdesk\'" md-cell>\r\n            {{ (vm_dc.freshdeskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'vtiger\'" md-cell>\r\n            {{ (vm_dc.vtigerAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'dynamics365\'" md-cell>\r\n            {{ (vm_dc.dynamics365Accounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'servicenow\'" md-cell>\r\n            {{ (vm_dc.servicenowAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshsales\'" md-cell>\r\n            {{ (vm_dc.freshsalesAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\'" md-cell>\r\n            {{ vm_dc.motionBarOptions[action.data1] }} </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'1\'" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'2\'" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'0\'" md-cell>\r\n            {{ (vm_dc.templates | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 === \'0\'" md-cell>\r\n            {{ (vm_dc.templates | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 === \'1\'" md-cell>\r\n            {{ action.data2 }}\r\n          </td>\r\n          <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n            {{ action.createdAt | formatdate }}\r\n          </td>\r\n          <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\r\n            <md-menu>\r\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\r\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\r\n              </md-button>\r\n              <md-menu-content width="3">\r\n                <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\r\n                  <md-button ng-click="vm_dc.createOrEditTriggerAction($event, action)" translate="TOOLS.EDIT_ACTION">\r\n                    Edit Action\r\n                  </md-button>\r\n                </md-menu-item>\r\n                <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\r\n                  <md-button ng-click="vm_dc.deleteConfirm(action, $event)" translate="TOOLS.DELETE_ACTION">\r\n                    Delete Action\r\n                  </md-button>\r\n                </md-menu-item>\r\n              </md-menu-content>\r\n            </md-menu>\r\n          </td>\r\n        </tr>\r\n        <tr md-row ng-if="!vm_dc.triggerActions.rows.length">\r\n          <td md-cell colspan="5">\r\n            <div layout="row" layout-align="center center">\r\n              <span class="text-boxed-light" translate="TOOLS.NO_ACTION_AVAILABLE">No action\r\n                available</span>\r\n            </div>\r\n          </td>\r\n        </tr>\r\n      </tbody>\r\n    </table>\r\n  </md-table-container>\r\n  <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.triggerActions.count }}" md-on-paginate="vm_dc.getTriggerActions" md-page-select>\r\n  </md-table-pagination>\r\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/actions/create/dialog.html",'<md-dialog class="action-dialog" aria-label="New Action">\n  <form name="actionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newAction ? \'TOOLS.NEW_ACTION\' : \'TOOLS.EDIT_ACTION\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.ACTION">Action</label>\n        <md-select name="action" ng-model="vm.action.action" ng-init="vm.onActionInit()" ng-change="vm.onActionSelection()" md-autofocus required ng-disabled="!vm.newAction">\n          <md-option ng-value="\'contactManager\'" ng-if="vm.trigger.channel == \'voice\'">\n            {{ \'TOOLS.CONTACT_MANAGER\' | translate }} </md-option>\n          <md-option ng-value="\'integration\'" ng-if="vm.trigger.channel == \'voice\' && ((vm.newAction && vm.hasIntegrationsPermissions) || !vm.newAction)">\n            {{ \'TOOLS.INTEGRATIONS\' | translate }} </md-option>\n          <md-option ng-value="\'motionbar\'"> {{ \'TOOLS.MOTIONBAR\' | translate }} </md-option>\n          <md-option ng-value="\'jscripty\'"> {{ \'TOOLS.JSCRIPTY\' | translate }} </md-option>\n          <md-option ng-value="\'urlForward\'"> {{ \'TOOLS.URL_FORWARD\' | translate }} </md-option>\n          <md-option ng-value="\'browser\'"> {{ \'TOOLS.BROWSER\' | translate }} </md-option>\n          <md-option ng-value="\'bot\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.BOT\' | translate }} </md-option>\n          <md-option ng-value="\'script\'"> {{ \'TOOLS.SCRIPT\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'action\'].$error" ng-show="actionForm[\'action\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ACTION_REQUIRED">Action field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'jscripty\'" class="md-block">\n        <label translate="TOOLS.PROJECT">Project</label>\n        <md-select name="data1" ng-model="vm.action.data1" required>\n          <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.projects" ng-disabled="data1.canSelect === false">\n            {{ data1.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\'" class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onTypeSelection()" required>\n          <md-option ng-value="\'0\'">Popup</md-option>\n          <md-option ng-value="\'1\'">CTI URL</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n        <label translate="TOOLS.LIST">List</label>\n        <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onListSelection()" required>\n          <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.lists" ng-disabled="data1.canSelect === false">\n            {{ data1.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n        <label translate="TOOLS.SEARCH_FIELDS">Search fields</label>\n        <md-select name="fields" ng-model="vm.action.data3" ng-init="vm.onSearchFieldsInit()" multiple required>\n          <md-optgroup label="{{ \'TOOLS.STANDARD\' | translate }}">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.contactFields">\n              {{ field.displayName }}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{ \'TOOLS.LIST\' | translate }}" ng-if="vm.listFields.length > 0">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.listFields">\n              {{ field.name }}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{ \'TOOLS.GLOBALS\' | translate }}" ng-if="vm.customFields.length > 0">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.customFields">\n              {{ field.displayName }}</md-option>\n          </md-optgroup>\n        </md-select>\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SEARCH_FIELDS_REQUIRED">Search fields field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n        <label translate="TOOLS.AUTOCREATECONTACT">Create contact automatically</label>\n        <md-select name="data2" ng-model="vm.action.data2" ng-change="vm.onAutocreateSelection()" required>\n          <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n          <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED">AutoCreateContact field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\' && vm.action.data2 === \'1\'" class="md-block">\n        <label translate="TOOLS.AUTOCREATE_FIELD">Autocreate field</label>\n        <md-select name="autocreateField" ng-model="vm.action.data4" ng-required="vm.action.data2 === \'1\'">\n          <md-optgroup label="{{ \'TOOLS.STANDARD\' | translate }}">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.contactFields">\n              {{ field.displayName }}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{ \'TOOLS.LIST\' | translate }}" ng-if="vm.listFields.length > 0">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.listFields">\n              {{ field.name }}</md-option>\n          </md-optgroup>\n          <md-optgroup label="{{ \'TOOLS.GLOBALS\' | translate }}" ng-if="vm.customFields.length > 0">\n            <md-option ng-value="field.columnName" ng-repeat="field in vm.customFields">\n              {{ field.displayName }}</md-option>\n          </md-optgroup>\n        </md-select>\n        <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.AUTOCREATE_FIELD_REQUIRED">Autocreate field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n        <label translate="TOOLS.IGNOREDIALERCONTACTID">Ignore dialer contact Id</label>\n        <md-select name="data5" ng-model="vm.action.data5" required>\n          <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n          <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.IGNOREDIALERCONTACTID_REQUIRED">Ignore dialer contact Id field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select name="data1" ng-model="vm.action.data1" required>\n          <md-option ng-value="\'GET\'">GET</md-option>\n          <md-option ng-value="\'POST\'">POST</md-option>\n          <md-option ng-value="\'PUT\'">PUT</md-option>\n          <md-option ng-value="\'DELETE\'">DELETE</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n        <label translate="TOOLS.URL">Url</label>\n        <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n        <label translate="TOOLS.TIMEOUT">Timeout</label>\n        <input type="number" name="data5" ng-model="vm.action.data5" min="1" max="10" ng-required="true">\n        <div class="hint"><span translate="TOOLS.HELP.TIMEOUT"></span></div>\n        <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n              equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n              equal than</span> <span>10</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n        <label translate="TOOLS.HEADERS">Headers</label>\n        <textarea name="data6" ng-model="vm.action.data6"></textarea>\n        <div class="hint"><span translate="TOOLS.HELP.HEADERS"></span></div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'urlForward\' && (vm.action.data1 == \'POST\' || vm.action.data1 == \'PUT\')" class="md-block">\n        <label translate="TOOLS.BODY">Body</label>\n        <textarea name="data7" ng-model="vm.action.data7"></textarea>\n        <div class="hint"><span translate="TOOLS.HELP.BODY"></span></div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n        <label translate="TOOLS.SCRIPT_TYPE">Script_Type</label>\n        <input type="input" name="data2" ng-model="vm.action.data2">\n        <div class="hint"><span translate="TOOLS.HELP.SCRIPT_TYPE"></span></div>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SCRIPT_TYPE_REQUIRED">Script_Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n        <label translate="TOOLS.SCRIPT_INFO">Script_Info</label>\n        <input type="input" name="data1" ng-model="vm.action.data1">\n        <div class="hint"><span translate="TOOLS.HELP.SCRIPT_INFO"></span></div>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SCRIPT_INFO_REQUIRED">Script_Info field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n        <label translate="TOOLS.SCRIPT">Script</label>\n        <textarea name="data3" ng-model="vm.action.data3" required></textarea>\n        <div class="hint"><span translate="TOOLS.HELP.SCRIPT"></span></div>\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.SCRIPT_REQUIRED">Script field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'integration\'" class="md-block">\n        <label translate="TOOLS.INTEGRATION">Integration</label>\n        <md-select name="data1" ng-model="vm.action.data1" ng-init="vm.onIntegrationInit()" ng-change="vm.onIntegrationSelection()" required>\n          <md-option ng-value="\'desk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1306])">Desk</md-option>\n          <md-option ng-value="\'dynamics365\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1309])">Dynamics365</md-option>\n          <md-option ng-value="\'freshdesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1303])">Freshdesk</md-option>\n          <md-option ng-value="\'freshsales\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1304]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1304])">Freshsales</md-option>\n          <md-option ng-value="\'salesforce\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1302])">Salesforce</md-option>\n          <md-option ng-value="\'servicenow\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1310])">ServiceNow</md-option>\n          <md-option ng-value="\'sugarcrm\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1305])">SugarCRM</md-option>\n          <md-option ng-value="\'vtiger\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1308])">vTiger</md-option>\n          <md-option ng-value="\'zendesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1301])">Zendesk</md-option>\n          <md-option ng-value="\'zoho\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1307])">Zoho</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED">Integration field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1" class="md-block">\n        <label translate="TOOLS.ACCOUNT">Account</label>\n        <md-select name="data2" ng-model="vm.action.data2" ng-change="vm.onIntegrationAccountSelection()" ng-disabled="vm.action.isIntegrationDisabled" required>\n          <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.accounts">{{ data2.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'integration\'  && vm.action.data1 && vm.action.data2" class="md-block">\n        <label translate="TOOLS.CONFIGURATION">Configuration</label>\n        <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="vm.action.isIntegrationDisabled">\n          <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.configurations | filter : { AccountId: (vm.action.data2 | toInteger) } : true">{{\n            data3.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\'" class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onTypeSelection()" required>\n          <md-option ng-value="\'0\'">Popup</md-option>\n          <md-option ng-value="\'1\'">CTI URL</md-option>\n          <md-option ng-value="\'2\'">Windows App</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'1\'" class="md-block">\n        <label translate="TOOLS.URL">Url</label>\n        <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n        <label translate="TOOLS.APPLICATION">Application</label>\n        <input type="text" name="data2" ng-model="vm.action.data2" ng-required="true">\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n        <label translate="TOOLS.ARGUMENTS">Arguments</label>\n        <input type="text" name="data3" ng-model="vm.action.data3">\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'0\'" class="md-block">\n        <label translate="TOOLS.TEMPLATE">Template</label>\n        <md-select name="data2" ng-model="vm.action.data2" required>\n          <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">\n            {{ data2.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'0\'" class="md-block">\n        <label translate="TOOLS.TEMPLATE">Template</label>\n        <md-select name="data2" ng-model="vm.action.data2" required>\n          <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">\n            {{ data2.name }}</md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n        <label translate="TOOLS.URL">Url</label>\n        <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n        <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="(vm.action.action == \'motionbar\' || vm.action.action == \'browser\') && vm.action.data1 == \'1\'" class="md-block">\n        <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>\n        <md-select name="data3" ng-model="vm.action.data3" required>\n          <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n          <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n        </md-select>\n        <div class="hint"><span translate="TOOLS.HELP.EVENTVARIABLES"></span></div>\n        <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED">EventVariables field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n        <label translate="TOOLS.LOCATION">Location</label>\n        <md-select name="data4" ng-model="vm.action.data4" required ng-change="vm.onActionLocationChange()">\n          <md-option ng-value="0"> {{ \'TOOLS.NEW_TAB\' | translate }} </md-option>\n          <md-option ng-value="1"> {{ \'TOOLS.NEW_WINDOW\' | translate }} </md-option>\n          <md-option ng-value="2"> {{ \'TOOLS.MOTION_TAB\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.LOCATION_REQUIRED">Location field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n        <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>\n        <input type="text" name="data5" ng-model="vm.action.data5">\n        <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED">WindowWidth field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n        <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>\n        <input type="text" name="data6" ng-model="vm.action.data6">\n        <div ng-messages="actionForm[\'data6\'].$error" ng-show="actionForm[\'data6\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED">WindowHeight field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAction" ng-click="vm.saveAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid || actionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAction" ng-click="vm.addNewAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ACTION" translate-attr-aria-label="TOOLS.ADD_ACTION">\n          ADD ACTION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAction" ng-click="vm.deleteAction($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/allconditions.html",'<div ng-controller="TriggerAllConditionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\n  <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedAllConditions.length">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="TOOLS.ALLCONDITIONS">All Conditions</span>\n      <ms-search-bar on-search="vm_dc.getAllConditions()" query="vm_dc.query" debounce="300" direction="down">\n      </ms-search-bar>\n      <div flex></div>\n      <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditAllCondition($event)" aria-label="add allCondition" translate translate-attr-label="TOOLS.ADD_ALLCONDITION">\n        <md-icon md-font-icon="icon-plus"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedAllConditions.length">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead">{{ vm_dc.selectedAllConditions.length }}\n        {{ vm_dc.selectedAllConditions.length > 1 ? \'items\' : \'item\' }} selected</span>\n      <div flex></div>\n      <button class="md-icon-button" ng-csv="vm_dc.exportSelectedAllConditions" csv-label="true" filename="triggers.csv">\n        <md-icon md-font-icon="icon-file-excel"></md-icon>\n      </button>\n      <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedAllConditions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n        <md-icon md-font-icon="icon-delete"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container class="font-size-12">\n    <table md-table md-row-select multiple ng-model="vm_dc.selectedAllConditions" md-progress="vm_dc.promise">\n      <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getAllConditions">\n        <tr md-row>\n          <th md-column md-order-by="id">\n            {{ \'TOOLS.ID\' | translate }}\n          </th>\n          <th md-column md-order-by="field">\n            {{ \'TOOLS.FIELD\' | translate }}\n          </th>\n          <th md-column md-order-by="operator">\n            {{ \'TOOLS.OPERATOR\' | translate }}\n          </th>\n          <th md-column md-order-by="value">\n            {{ \'TOOLS.VALUE\' | translate }}\n          </th>\n          <th md-column md-order-by="createdAt">\n            {{ \'TOOLS.CREATED_AT\' | translate }}\n          </th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row md-select="allCondition" md-select-id="id" ng-repeat="allCondition in vm_dc.allConditions.rows">\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n            {{ allCondition.id }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n            {{ \'TOOLS.\' + vm_dc.fields[allCondition.field] | uppercase | translate }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n            {{ \'TOOLS.\' + allCondition.operator | uppercase | translate }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="!allCondition.value" md-cell>\n            {{ allCondition.value }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.chatWebsites | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.mailAccounts | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'sms\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.smsAccounts | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'whatsapp\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.whatsappAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'fax\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.faxAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'openchannel\' && allCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.openchannelAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'queue\'" md-cell>\n            {{ (vm_dc.queues | filter : {\'name\':allCondition.value} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'routeId\'" md-cell>\n            {{ (vm_dc.outboundRoutes | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].exten }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'agent\'" md-cell>\n            {{ (vm_dc.agents | filter : {\'name\':allCondition.value} : true)[0].fullname }}</td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'lastevent\'" md-cell>\n            {{ vm_dc.callStatuses[allCondition.value] }} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'interaction\'" md-cell>\n            {{ allCondition.value | capitalize }} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'message\'" md-cell>\n            {{ vm_dc.messageStatuses[allCondition.value] }} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'mailSubstatus\'" md-cell>\n            {{ allCondition.value === \'null\' ? (\'TOOLS.NONE\' | translate) : (vm_dc.mailSubstatuses | filter : {\'name\': allCondition.value } : true)[0].name }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'offlineMessage\'" md-cell>\n            {{allCondition.value}} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n            {{ allCondition.createdAt | formatdate }}\n          </td>\n          <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="3">\n                <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                  <md-button ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" translate="TOOLS.EDIT_ALLCONDITION">\n                    Edit AllCondition\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                  <md-button ng-click="vm_dc.deleteConfirm(allCondition, $event)" translate="TOOLS.DELETE_ALLCONDITION">\n                    Delete AllCondition\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n        <tr md-row ng-if="!vm_dc.allConditions.rows.length">\n          <td md-cell colspan="5">\n            <div layout="row" layout-align="center center">\n              <span class="text-boxed-light" translate="TOOLS.NO_ALLCONDITION_AVAILABLE">No condition\n                available</span>\n            </div>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n\n  <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.allConditions.count }}" md-on-paginate="vm_dc.getAllConditions" md-page-select>\n  </md-table-pagination>\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/create/dialog.html",'<md-dialog class="allCondition-dialog" aria-label="New AllCondition">\n  <form name="allConditionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newAllCondition ? \'TOOLS.NEW_ALLCONDITION\' : \'TOOLS.EDIT_ALLCONDITION\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.FIELD">Field</label>\n        <md-select name="field" ng-model="vm.allCondition.field" ng-change="vm.onFieldSelection()" md-autofocus required>\n          <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}\n          </md-option>\n          <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'agent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.AGENT\' | translate }}\n          </md-option>\n          <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}\n          </md-option>\n          <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'">\n            {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n          <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'mailSubstatus\'" ng-if="vm.trigger.channel == \'mail\'"> {{ \'TOOLS.MAIL_SUBSTATUS\' | translate }}\n          </md-option>\n          <md-option ng-value="\'offlineMessage\'" ng-if="vm.trigger.channel == \'chat\'"> {{ \'TOOLS.OFFLINE_MESSAGE\' | translate }}\n          </md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'field\'].$error" ng-show="allConditionForm[\'field\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.OPERATOR">Operator</label>\n        <md-select name="operator" ng-model="vm.allCondition.operator" required>\n          <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n          <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'operator\'].$error" ng-show="allConditionForm[\'operator\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'account\'" class="md-block">\n        <label translate="TOOLS.ACCOUNT">Account</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="value.id.toString()" ng-repeat="value in vm.accounts" ng-disabled="value.canSelect === false">\n            {{ value.name }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.QUEUE">Queue</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">\n            {{ value.name }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="value.id.toString()" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">\n            {{ value.exten }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'agent\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.AGENT">Agent</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="value.name" ng-repeat="value in vm.agents" ng-disabled="value.canSelect === false">\n            {{ value.fullname }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'lastevent\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="status.value" ng-repeat="status in vm.callStatuses">\n            {{ status.name }}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'mailSubstatus\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="mailSubstatus.name" ng-repeat="mailSubstatus in vm.mailSubstatuses">\n            {{ mailSubstatus.name }}</md-option>\n          <md-option ng-value="\'null\'">{{\'TOOLS.NONE\' | translate}}</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="\'opened\'">Opened</md-option>\n          <md-option ng-value="\'closed\'">Closed</md-option>\n          <md-option ng-if="vm.trigger.channel==\'mail\'" ng-value="\'substatus\'">SubStatus</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="\'in\'">Incoming</md-option>\n          <md-option ng-value="\'out\'">Outgoing</md-option>\n          <md-option ng-value="\'accept\'">Accepted</md-option>\n          <md-option ng-value="\'reject\'">Rejected</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.allCondition.field == \'offlineMessage\' && vm.trigger.channel == \'chat\'" class="md-block">\n        <label translate="TOOLS.CHAT">Chat</label>\n        <md-select name="value" ng-model="vm.allCondition.value" required>\n          <md-option ng-value="\'created\'">Created</md-option>\n        </md-select>\n        <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAllCondition" ng-click="vm.saveAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAllCondition" ng-click="vm.addNewAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ALLCONDITION" translate-attr-aria-label="TOOLS.ADD_ALLCONDITION">\n          ADD ALLCONDITION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAllCondition" ng-click="vm.deleteAllCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/anyconditions.html",'<div ng-controller="TriggerAnyConditionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\n  <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedAnyConditions.length">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead" translate="TOOLS.ANYCONDITIONS">AnyConditions</span>\n      <ms-search-bar on-search="vm_dc.getAnyConditions()" query="vm_dc.query" debounce="300" direction="down"></ms-search-bar>\n      <div flex></div>\n      <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditAnyCondition($event)" aria-label="add anyCondition" translate translate-attr-label="TOOLS.ADD_ANYCONDITION">\n        <md-icon md-font-icon="icon-plus"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedAnyConditions.length">\n    <div class="md-toolbar-tools">\n      <span class="md-subhead">{{ vm_dc.selectedAnyConditions.length }}\n        {{ vm_dc.selectedAnyConditions.length > 1 ? \'items\' : \'item\' }} selected</span>\n      <div flex></div>\n      <button class="md-icon-button" ng-csv="vm_dc.exportSelectedAnyConditions" csv-label="true" filename="triggers.csv">\n        <md-icon md-font-icon="icon-file-excel"></md-icon>\n      </button>\n      <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedAnyConditions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n        <md-icon md-font-icon="icon-delete"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n  <md-table-container class="font-size-12">\n    <table md-table md-row-select multiple ng-model="vm_dc.selectedAnyConditions" md-progress="vm_dc.promise">\n      <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getAnyConditions">\n        <tr md-row>\n          <th md-column md-order-by="id">\n            {{ \'TOOLS.ID\' | translate }}\n          </th>\n          <th md-column md-order-by="field">\n            {{ \'TOOLS.FIELD\' | translate }}\n          </th>\n          <th md-column md-order-by="operator">\n            {{ \'TOOLS.OPERATOR\' | translate }}\n          </th>\n          <th md-column md-order-by="value">\n            {{ \'TOOLS.VALUE\' | translate }}\n          </th>\n          <th md-column md-order-by="createdAt">\n            {{ \'TOOLS.CREATED_AT\' | translate }}\n          </th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n      <tbody md-body>\n        <tr md-row md-select="anyCondition" md-select-id="id" ng-repeat="anyCondition in vm_dc.anyConditions.rows">\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n            {{ anyCondition.id}}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n            {{ \'TOOLS.\' + vm_dc.fields[anyCondition.field] | uppercase | translate }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n            {{ \'TOOLS.\' + anyCondition.operator | uppercase | translate }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="!anyCondition.value" md-cell>\n            {{ anyCondition.value }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.chatWebsites | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.mailAccounts | filter : {\'id\':(anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'sms\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.smsAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, allCondition)" ng-if="vm.trigger.channel == \'whatsapp\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.whatsappAccounts | filter : {\'id\':(anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'fax\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.faxAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'openchannel\' && anyCondition.field == \'account\'" md-cell>\n            {{ (vm_dc.openchannelAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'queue\'" md-cell>\n            {{ (vm_dc.queues | filter : {\'name\':anyCondition.value} : true)[0].name }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'routeId\'" md-cell>\n            {{ (vm_dc.outboundRoutes | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].exten }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'agent\'" md-cell>\n            {{ (vm_dc.agents | filter : {\'name\':anyCondition.value} : true)[0].fullname }}</td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'lastevent\'" md-cell>\n            {{ vm_dc.callStatuses[anyCondition.value] }} </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'interaction\'" md-cell>\n            {{ anyCondition.value | capitalize }} </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'message\'" md-cell>\n            {{ vm_dc.messageStatuses[anyCondition.value] }} </td>\n          <td ng-click="vm_dc.createOrEditAllCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'mailSubstatus\'" md-cell>\n            {{ anyCondition.value === \'null\' ? (\'TOOLS.NONE\' | translate) : (vm_dc.mailSubstatuses | filter : {\'name\': anyCondition.value } : true)[0].name }}\n          </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'offlineMessage\'" md-cell>\n            {{anyCondition.value}} </td>\n          <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n            {{ anyCondition.createdAt | formatdate }}\n          </td>\n          <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n            <md-menu>\n              <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n              </md-button>\n              <md-menu-content width="3">\n                <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                  <md-button ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" translate="TOOLS.EDIT_ANYCONDITION">\n                    Edit AnyCondition\n                  </md-button>\n                </md-menu-item>\n                <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                  <md-button ng-click="vm_dc.deleteConfirm(anyCondition, $event)" translate="TOOLS.DELETE_ANYCONDITION">\n                    Delete AnyCondition\n                  </md-button>\n                </md-menu-item>\n              </md-menu-content>\n            </md-menu>\n          </td>\n        </tr>\n        <tr md-row ng-if="!vm_dc.anyConditions.rows.length">\n          <td md-cell colspan="5">\n            <div layout="row" layout-align="center center">\n              <span class="text-boxed-light" translate="TOOLS.NO_ANYCONDITION_AVAILABLE">No anycondition\n                available</span>\n            </div>\n          </td>\n        </tr>\n      </tbody>\n    </table>\n  </md-table-container>\n  <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.anyConditions.count }}" md-on-paginate="vm_dc.getAnyConditions" md-page-select>\n  </md-table-pagination>\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/create/dialog.html",'<md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">\n  <form name="anyConditionForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newAnyCondition ? \'TOOLS.NEW_ANYCONDITION\' : \'TOOLS.EDIT_ANYCONDITION\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.FIELD">Field</label>\n        <md-select name="field" ng-model="vm.anyCondition.field" ng-change="vm.onFieldSelection()" md-autofocus required>\n          <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}\n          </md-option>\n          <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'agent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.AGENT\' | translate }}\n          </md-option>\n          <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}\n          </md-option>\n          <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'">\n            {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n          <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}\n          </md-option>\n          <md-option ng-value="\'mailSubstatus\'" ng-if="vm.trigger.channel == \'mail\'"> {{ \'TOOLS.MAIL_SUBSTATUS\' | translate }}\n          </md-option>\n          <md-option ng-value="\'offlineMessage\'" ng-if="vm.trigger.channel == \'chat\'"> {{ \'TOOLS.OFFLINE_MESSAGE\' | translate }}\n          </md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'field\'].$error" ng-show="anyConditionForm[\'field\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.OPERATOR">Operator</label>\n        <md-select name="operator" ng-model="vm.anyCondition.operator" required>\n          <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n          <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'operator\'].$error" ng-show="anyConditionForm[\'operator\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'account\'" class="md-block">\n        <label translate="TOOLS.ACCOUNT">Account</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="value.id.toString()" ng-repeat="value in vm.accounts" ng-disabled="value.canSelect === false">\n            {{ value.name }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.QUEUE">Queue</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">\n            {{ value.name }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="value.id.toString()" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">\n            {{ value.exten }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'agent\' && vm.trigger.channel == \'voice\'" class="md-block">\n        <label translate="TOOLS.AGENT">Agent</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="value.name" ng-repeat="value in vm.agents" ng-disabled="value.canSelect === false">\n            {{ value.fullname }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'lastevent\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="status.value" ng-repeat="status in vm.callStatuses">\n            {{ status.name }}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'mailSubstatus\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="mailSubstatus.name" ng-repeat="mailSubstatus in vm.mailSubstatuses">\n            {{ mailSubstatus.name }}</md-option>\n          <md-option ng-value="\'null\'">{{\'TOOLS.NONE\' | translate}}</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="\'opened\'">Opened</md-option>\n          <md-option ng-value="\'closed\'">Closed</md-option>\n          <md-option ng-if="vm.trigger.channel==\'mail\'" ng-value="\'substatus\'">SubStatus</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n        <label translate="TOOLS.VALUE">Value</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="\'in\'">Incoming</md-option>\n          <md-option ng-value="\'out\'">Outgoing</md-option>\n          <md-option ng-value="\'accept\'">Accepted</md-option>\n          <md-option ng-value="\'reject\'">Rejected</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.anyCondition.field == \'offlineMessage\' && vm.trigger.channel == \'chat\'" class="md-block">\n        <label translate="TOOLS.CHAT">Chat</label>\n        <md-select name="value" ng-model="vm.anyCondition.value" required>\n          <md-option ng-value="\'created\'">Created</md-option>\n        </md-select>\n        <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAnyCondition" ng-click="vm.saveAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAnyCondition" ng-click="vm.addNewAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ANYCONDITION" translate-attr-aria-label="TOOLS.ADD_ANYCONDITION">\n          ADD ANYCONDITION\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAnyCondition" ng-click="vm.deleteAnyCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/view.html",'<div id="tools-trigger" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-triggers-button md-icon-button" aria-label="Go to triggers" ng-click="vm.gotoTriggers()" translate translate-attr-aria-label="TOOLS.GO_TO_TRIGGERS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="trigger-image" hide-xs>\n          <img ng-src="assets/images/business/triggers.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">#{{ vm.trigger.id }}\n            <span ng-if="vm.trigger.name">{{ vm.trigger.name }}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="TOOLS.CREATED_AT"></span> <span>{{ vm.trigger.createdAt | date:\'medium\' }}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveTrigger()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (allconditionsForm.$invalid) || (anyconditionsForm.$invalid) || (actionsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trigger-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.trigger.name" required autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CHANNEL">Channel</label>\n                <md-select name="channel" ng-model="vm.trigger.channel" required disabled>\n                  <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n                  <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel">\n                    {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n                  <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n                  <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n                  <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n                  <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n                  <md-option ng-value="\'whatsapp\'" ng-if="vm.license.whatsapp"> {{ \'TOOLS.WHATSAPP\' | translate }}\n                  </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'channel\'].$error" ng-show="generalForm[\'channel\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.trigger.status" aria-label="Status" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="TOOLS.STATUS">Status</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.trigger.description" ng-disabled="!vm.crudPermissions.canEdit">\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.CONDITIONS&ACTIONS">CONDITIONS&ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trigger-detail-form-container allconditions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/allconditions/allconditions.html\'">\n          </div>\n          <div class="trigger-detail-form-container anyconditions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/anyconditions/anyconditions.html\'">\n          </div>\n          <div class="trigger-detail-form-container actions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/actions/actions.html\'">\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/triggers.html",'<div id="triggers" class="page-layout simple left-sidenav inner-sidenav">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.TRIGGERS">Triggers</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTriggers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedTriggers =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-triggers-count">\n          <span>{{ vm.selectedTriggers.length }}</span>\n          <span translate="TOOLS.SELECTED">Selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTriggers()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTriggers()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTriggers" csv-label="true" filename="triggers.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTriggers($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n      \x3c!-- TRIGGER TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTriggers" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTriggers">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="channel">{{ \'TOOLS.CHANNEL\' | translate }}</th>\n                <th md-column md-order-by="status">{{ \'TOOLS.STATUS\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.triggers.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="trigger" md-select-id="id" ng-repeat="trigger in vm.triggers.rows">\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="id ">{{ trigger.id }}</td>\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="name ">{{ trigger.name }}</td>\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="channel ">\n                  {{ \'TOOLS.\' + trigger.channel | uppercase | translate }}</td>\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="status ">\n                  <md-icon md-colors="{color: {{ trigger.status ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ trigger.status ? \'icon-check\' : \'icon-close\' }}"></md-icon>\n                </td>\n                <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="description ">\n                  {{ trigger.description }}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.goToEditState(trigger)" translate="TOOLS.EDIT_TRIGGER">\n                          Edit Trigger\n                        </md-button>\n                      </md-menu-item>\n                      \x3c!-- SUBACTIONS --\x3e\n                      \x3c!-- ACTIONS --\x3e\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteconfirm(trigger, $event)" translate="TOOLS.DELETE_TRIGGER">\n                          Delete Trigger\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.triggers.count }}" md-on-paginate="vm.getTriggers" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TRIGGER TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n  </div>\n  \x3c!-- / CONTENT --\x3e\n  \x3c!-- ADD TRIGGER BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trigger-button" ng-click="vm.createOrEditTrigger($event)" aria-label="add trigger" translate translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TRIGGER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/trunks/create/dialog.html",'<md-dialog class="trunk-dialog" aria-label="New Trunk">\n  <form name="trunkForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n        <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n        <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.HOST">host</label>\n        <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n\n        <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n        <div ng-messages="trunkForm[\'host\'].$error" ng-show="trunkForm[\'host\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.SECRET">secret</label>\n        <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n        <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n        <div ng-messages="trunkForm[\'secret\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n        <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n\n        <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n        <div ng-messages="trunkForm[\'defaultuser\'].$error" ng-show="trunkForm[\'defaultuser\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.REGISTRY">registry</label>\n        <input type="text" name="registry" ng-model="vm.trunk.registry">\n\n        <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n        <div ng-messages="trunkForm[\'registry\'].$error" ng-show="trunkForm[\'registry\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.trunk.description">\n\n        <div ng-messages="trunkForm[\'description\'].$error" ng-show="trunkForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrunk" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid || trunkForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrunk" ng-click="vm.addNewTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRUNK" translate-attr-aria-label="TOOLS.ADD_TRUNK">\n          ADD TRUNK\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrunk" ng-click="vm.deleteTrunk($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/clone/clone.html",'<md-dialog class="trunk-dialog" aria-label="Clone Trunk">\n  <form name="trunkForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n        <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n        <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <md-button type="submit" ng-click="vm.cloneTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_TRUNK" translate-attr-aria-label="TOOLS.CLONE_TRUNK">\n        CLONE TRUNK\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/view.html",'<div id="tools-trunk" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-trunks-button md-icon-button" aria-label="Go to trunks" ng-click="vm.gotoTrunks()" translate translate-attr-aria-label="TOOLS.GO_TO_TRUNKS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="trunk-image" hide-xs>\n          <img ng-src="assets/images/business/trunks.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.trunk.id}}\n            <span ng-if="vm.trunk.name">{{vm.trunk.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trunk.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.trunk, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="TOOLS.GOTO_TRUNK"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n      <md-button ng-click="vm.clonedialog(vm.trunk, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n        <md-tooltip><span translate="TOOLS.CLONE_TRUNK"></span></md-tooltip>\n        <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveTrunk()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (otherFieldsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trunk-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.trunk.active" aria-label="active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.HOST">host</label>\n                <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n                <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.SECRET">secret</label>\n                <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n                <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n                <div ng-messages="generalForm[\'secret\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n                <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n                <div ng-messages="generalForm[\'defaultuser\'].$error" ng-show="generalForm[\'defaultuser\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CONTEXT">context</label>\n                <md-select name="context" ng-model="vm.trunk.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.CONTEXT"></span></div>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CONTEXT_REQUIRED">context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CALLERID">callerid</label>\n                <input type="text" name="callerid" ng-model="vm.trunk.callerid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.CALLERID"></span></div>\n                <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CALLERID_REQUIRED">callerid field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.TYPE">Type</label>\n                <md-select name="type" ng-model="vm.trunk.type" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'friend\'">Friend</md-option>\n                  <md-option ng-value="\'user\'">User</md-option>\n                  <md-option ng-value="\'peer\'">Peer</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.TYPE"></span></div>\n                <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DTMFMODE">dtmfmode</label>\n                <md-select name="dtmfmode" ng-model="vm.trunk.dtmfmode" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'rfc2833\'">rfc2833</md-option>\n                  <md-option ng-value="\'info\'">info</md-option>\n                  <md-option ng-value="\'shortinfo\'">shortinfo</md-option>\n                  <md-option ng-value="\'inband\'">inband</md-option>\n                  <md-option ng-value="\'auto\'">auto</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.DTMFMODE"></span></div>\n                <div ng-messages="generalForm[\'dtmfmode\'].$error" ng-show="generalForm[\'dtmfmode\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DTMFMODE_REQUIRED">dtmfmode field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.NAT">nat</label>\n                <md-select name="nat" ng-model="vm.trunk.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'force_rport\'">force_rport</md-option>\n                  <md-option ng-value="\'comedia\'">comedia</md-option>\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'never\'">never</md-option>\n                  <md-option ng-value="\'route\'">route</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.NAT"></span></div>\n                <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.NAT_REQUIRED">nat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.QUALIFY">qualify</label>\n                <md-select name="qualify" ng-model="vm.trunk.qualify" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.QUALIFY"></span></div>\n                <div ng-messages="generalForm[\'qualify\'].$error" ng-show="generalForm[\'qualify\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.QUALIFY_REQUIRED">qualify field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.ALLOWCODECS">AllowCodecs</label>\n                <md-select name="allow" ng-model="vm.trunk.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ulaw\'">ulaw</md-option>\n                  <md-option ng-value="\'alaw\'">alaw</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                  <md-option ng-value="\'g723\'">g723</md-option>\n                  <md-option ng-value="\'g726\'">g726</md-option>\n                  <md-option ng-value="\'g722\'">g722</md-option>\n                  <md-option ng-value="\'g729\'">g729</md-option>\n                  <md-option ng-value="\'ilbc\'">ilbc</md-option>\n                  <md-option ng-value="\'opus\'">opus</md-option>\n                  <md-option ng-value="\'h264\'">h264</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.ALLOWCODECS"></span></div>\n                <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.INSECURE">insecure</label>\n                <md-select name="insecure" ng-model="vm.trunk.insecure" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'port\'">port</md-option>\n                  <md-option ng-value="\'invite\'">invite</md-option>\n                  <md-option ng-value="\'very\'">very</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.INSECURE"></span></div>\n                <div ng-messages="generalForm[\'insecure\'].$error" ng-show="generalForm[\'insecure\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.INSECURE_REQUIRED">insecure field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CALL_LIMIT">call_limit</label>\n                <input type="number" name="call_limit" ng-model="vm.trunk.call_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.CALL_LIMIT"></span></div>\n                <div ng-messages="generalForm[\'call_limit\'].$error" ng-show="generalForm[\'call_limit\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CALL_LIMIT_REQUIRED">call_limit field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.trunk.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trunk-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.REGISTRY">registry</label>\n                <input type="text" name="registry" ng-model="vm.trunk.registry" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n                <div ng-messages="advancedForm[\'registry\'].$error" ng-show="advancedForm[\'registry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.DIRECTMEDIA">directmedia</label>\n                <md-select name="directmedia" ng-model="vm.trunk.directmedia" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">yes</md-option>\n                  <md-option ng-value="\'no\'">no</md-option>\n                  <md-option ng-value="\'nonat\'">nonat</md-option>\n                  <md-option ng-value="\'update\'">update</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.DIRECTMEDIA"></span></div>\n                <div ng-messages="advancedForm[\'directmedia\'].$error" ng-show="advancedForm[\'directmedia\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.DIRECTMEDIA_REQUIRED">directmedia field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.CALLCOUNTER">callcounter</label>\n                <md-select name="callcounter" ng-model="vm.trunk.callcounter" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.CALLCOUNTER"></span></div>\n                <div ng-messages="advancedForm[\'callcounter\'].$error" ng-show="advancedForm[\'callcounter\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.CALLCOUNTER_REQUIRED">callcounter field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.FROMDOMAIN">fromdomain</label>\n                <input type="text" name="fromdomain" ng-model="vm.trunk.fromdomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.FROMDOMAIN"></span></div>\n                <div ng-messages="advancedForm[\'fromdomain\'].$error" ng-show="advancedForm[\'fromdomain\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.FROMDOMAIN_REQUIRED">fromdomain field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.FROMUSER">fromuser</label>\n                <input type="text" name="fromuser" ng-model="vm.trunk.fromuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.FROMUSER"></span></div>\n                <div ng-messages="advancedForm[\'fromuser\'].$error" ng-show="advancedForm[\'fromuser\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.FROMUSER_REQUIRED">fromuser field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.OUTBOUNDPROXY">outboundproxy</label>\n                <input type="text" name="outboundproxy" ng-model="vm.trunk.outboundproxy" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.OUTBOUNDPROXY"></span></div>\n                <div ng-messages="advancedForm[\'outboundproxy\'].$error" ng-show="advancedForm[\'outboundproxy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.OUTBOUNDPROXY_REQUIRED">outboundproxy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.ADD_PHONE_TO_URI">Add_phone_to_URI</label>\n                <md-select name="usereqphone" ng-model="vm.trunk.usereqphone" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.ADD_PHONE_TO_URI"></span></div>\n                <div ng-messages="advancedForm[\'usereqphone\'].$error" ng-show="advancedForm[\'usereqphone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.ADD_PHONE_TO_URI_REQUIRED">Add_phone_to_URI field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.TRUST_REMOTE_PARTY_ID">Trust_Remote_Party_ID</label>\n                <md-select name="trustrpid" ng-model="vm.trunk.trustrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.TRUST_REMOTE_PARTY_ID"></span></div>\n                <div ng-messages="advancedForm[\'trustrpid\'].$error" ng-show="advancedForm[\'trustrpid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.TRUST_REMOTE_PARTY_ID_REQUIRED">Trust_Remote_Party_ID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.SEND_REMOTE_PARTY_ID_HEADER">Send_Remote_Party_ID_header</label>\n                <md-select name="sendrpid" ng-model="vm.trunk.sendrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n\n                  <md-option ng-value="\'pai\'"> {{ \'TOOLS.PAI\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.SEND_REMOTE_PARTY_ID_HEADER"></span></div>\n                <div ng-messages="advancedForm[\'sendrpid\'].$error" ng-show="advancedForm[\'sendrpid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.SEND_REMOTE_PARTY_ID_HEADER_REQUIRED">Send_Remote_Party_ID_header field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.ENCRYPTION">encryption</label>\n                <md-select name="encryption" ng-model="vm.trunk.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.ENCRYPTION"></span></div>\n                <div ng-messages="advancedForm[\'encryption\'].$error" ng-show="advancedForm[\'encryption\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.ENCRYPTION_REQUIRED">encryption field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.PORT">port</label>\n                <input type="number" name="port" ng-model="vm.trunk.port" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.PORT"></span></div>\n                <div ng-messages="advancedForm[\'port\'].$error" ng-show="advancedForm[\'port\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.PORT_REQUIRED">port field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.TRANSPORT">Transport</label>\n                <md-select name="transport" ng-model="vm.trunk.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'udp\'">udp</md-option>\n                  <md-option ng-value="\'tcp\'">tcp</md-option>\n                  <md-option ng-value="\'ws\'">ws</md-option>\n                  <md-option ng-value="\'wss\'">wss</md-option>\n                  <md-option ng-value="\'tls\'">tls</md-option>\n                </md-select>\n                <div class="hint"><span translate="TOOLS.HELP.TRANSPORT"></span></div>\n                <div ng-messages="advancedForm[\'transport\'].$error" ng-show="advancedForm[\'transport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.T38PT_UDPTL">t38pt_udptl</label>\n                <input type="string" name="t38pt_udptl" ng-model="vm.trunk.t38pt_udptl" value="no" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="TOOLS.HELP.T38PT_UDPTL"></span></div>\n                <div ng-messages="advancedForm[\'t38pt_udptl\'].$error" ng-show="advancedForm[\'t38pt_udptl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.T38PT_UDPTL_REQUIRED">t38pt_udptl field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.VIDEOSUPPORT">Videosupport</label>\n                <md-select name="videosupport" ng-model="vm.trunk.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'always\'">Always</md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'videosupport\'].$error" ng-show="advancedForm[\'videosupport\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="TOOLS.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="TOOLS.OTHERFIELDS">OTHERFIELDS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="trunk-detail-form-container otherfields md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="TOOLS.OTHERFIELDS">OTHERFIELDS</div>\n            </div>\n            <form name="otherFieldsForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="TOOLS.OTHERFIELDS">otherFields</label>\n                <textarea name="otherFields" ng-model="vm.trunk.otherFields" autofocus></textarea>\n                <div class="hint"><span translate="TOOLS.HELP.OTHERFIELDS"></span></div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/trunks/trunks.html",'<div id="trunks" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.TRUNKS">Trunks</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedTrunks.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedTrunks =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-trunks-count">\n          <span>{{vm.selectedTrunks.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllTrunks()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectTrunks()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedTrunks" csv-label="true" filename="trunks.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTrunks($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- TRUNK TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedTrunks" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n                <th md-column md-order-by="host">{{ \'TOOLS.HOST\' | translate }}</th>\n                <th md-column md-order-by="registry">{{ \'TOOLS.REGISTRY\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.trunks.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="trunk" md-select-id="id" ng-repeat="trunk in vm.trunks.rows">\n                <td md-cell ng-if="trunk.userpic"><img class="avatar" alt="{{trunk.name}}" ng-src="api/users/{{trunk.id}}/avatar" /></td>\n                <td md-cell ng-if="!trunk.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trunk.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="id ">{{trunk.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="name ">{{trunk.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="active ">\n                  <md-icon md-colors="{color: {{trunk.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trunk.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="host ">{{trunk.host}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="registry ">{{trunk.registry}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="description ">{{trunk.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(trunk, $event    )" translate="TOOLS.EDIT_TRUNK">\n                          Edit Trunk\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.clonedialog(trunk, $event    )" translate="TOOLS.CLONE_TRUNK">\n                          clone Trunk\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(trunk, $event    )" translate="TOOLS.GOTOREALTIME_TRUNK">\n                          goToRealtime Trunk\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(trunk, $event    )" translate="TOOLS.DELETE_TRUNK">\n                          Delete Trunk\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.trunks.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / TRUNK TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD TRUNK BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trunk-button" ng-click="vm.createOrEditTrunk($event)" aria-label="add trunk" translate translate-attr-aria-label="TOOLS.ADD_TRUNK">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD TRUNK BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/variables/create/dialog.html",'<md-dialog class="variable-dialog" aria-label="New Variable">\n  <form name="variableForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.variable.name" ng-required="true" autofocus>\n\n        <div ng-messages="variableForm[\'name\'].$error" ng-show="variableForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.variable.description">\n\n        <div ng-messages="variableForm[\'description\'].$error" ng-show="variableForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVariable" ng-click="vm.saveVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid || variableForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVariable" ng-click="vm.addNewVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_VARIABLE" translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n          ADD VARIABLE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVariable" ng-click="vm.deleteVariable($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/variables/variables.html",'<div id="variables" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="TOOLS.VARIABLES">Variables</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVariables.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVariables =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="TOOLS.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-variables-count">\n          <span>{{vm.selectedVariables.length}}</span>\n          <span translate="TOOLS.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVariables()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVariables()" translate="TOOLS.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVariables" csv-label="true" filename="variables.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVariables($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VARIABLE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVariables" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVariables">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.variables.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="variable" md-select-id="id" ng-repeat="variable in vm.variables.rows">\n                <td md-cell ng-if="variable.userpic"><img class="avatar" alt="{{variable.name}}" ng-src="api/users/{{variable.id}}/avatar" /></td>\n                <td md-cell ng-if="!variable.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{variable.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="id ">{{variable.id}}</td>\n                <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="name ">{{variable.name}}</td>\n                <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="description ">{{variable.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(variable, $event    )" translate="TOOLS.EDIT_VARIABLE">\n                          Edit Variable\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(variable, $event    )" translate="TOOLS.DELETE_VARIABLE">\n                          Delete Variable\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.variables.count}}" md-on-paginate="vm.getVariables" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VARIABLE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VARIABLE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-variable-button" ng-click="vm.createOrEditVariable($event)" aria-label="add variable" translate translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VARIABLE BUTTON --\x3e\n</div>'),e.put("app/main/apps/video/views/screenRecordings/create/dialog.html",'<md-dialog class="screenRecording-dialog" aria-label="New screenRecording">\n  <form name="screenRecordingForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VIDEO.RATING">Rating</label>\n        <md-select name="rating" ng-model="vm.screenRecording.rating" autofocus ng-disabled="!vm.newscreenRecording && !vm.crudPermissions.canEdit">\n          <md-option ng-value="null">{{\'VIDEO.NO_RATING\' | translate}}</md-option>\n          <md-option value="1">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n          </md-option>\n          <md-option value="2">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n          </md-option>\n          <md-option value="3">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n          </md-option>\n          <md-option value="4">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n          </md-option>\n          <md-option value="5">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n          </md-option>\n        </md-select>\n        <div ng-messages="screenRecordingForm[\'rating\'].$error" ng-show="screenRecordingForm[rating].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VIDEO.ERRORS.RATING_REQUIRED">Rating field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newscreenRecording" ng-click="vm.savescreenRecording()" class="send-button md-accent md-raised" ng-disabled="screenRecordingForm.$invalid || screenRecordingForm.$pristine" aria-label="SAVE" translate="VIDEO.SAVE" translate-attr-aria-label="VIDEO.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newscreenRecording" ng-click="vm.addNewscreenRecording()" class="send-button md-accent md-raised" ng-disabled="screenRecordingForm.$invalid" aria-label="ADD" translate="VIDEO.ADD_SCREENRECORDING" translate-attr-aria-label="VIDEO.ADD_SCREENRECORDING">\n          ADD SCREENRECORDING\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newscreenRecording" ng-click="vm.deletescreenRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VIDEO.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VIDEO.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/video/views/screenRecordings/partialViews/play.html",'<md-dialog class="play-dialog" aria-label="play">\n  <form name="playForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="{{ vm.app.toUpperCase() }}.{{  vm.label.toUpperCase() }}">Play Recording</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content ng-hide="vm.loading">\n      <div layout="row" layout-sm flex>\n        \x3c!-- VIRTUAL field --\x3e\n        <md-card>\n\n          <md-card-title ng-if="vm.actionOptions.upperTitle">\n            <md-card-title-text>\n              <span class="md-headline">{{ vm.filename }}</span>\n              <span class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.UPDATEDAT"></span>: {{ vm.recording.updatedAt}}</span>\n            </md-card-title-text>\n          </md-card-title>\n\n          \x3c!-- video recording directive --\x3e\n          <ms-dialog-recording ng-if="vm.format" id="vm.recording.id" title="vm.filename" element="vm.element" model="vm.route" path="vm.path" class="md-card-image"></ms-dialog-recording>\n          \x3c!-- / video recording directive --\x3e\n\n          <span ng-if="!vm.format">\n            <em ng-if="vm.found">{{ vm.app.toUpperCase() + \'.CANT_PLAY_THIS_FILE\' | translate }}</em>\n            <em ng-if="!vm.found">{{ vm.app.toUpperCase() + \'.FILE_NOT_FOUND\' | translate }}</em>\n          </span>\n\n          <md-card-title ng-if="vm.actionOptions.lowerTitle">\n            <md-card-title-text>\n              <span class="md-headline">{{ vm.filename }}</span>\n              <span class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.UPDATEDAT"></span>:{{ vm.recording.updatedAt}}</span>\n              <span ng-if="vm.actionOptions.properties" class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.PROPERTIES"></span>:</span>\n            </md-card-title-text>\n          </md-card-title>\n\n          <md-card-content ng-if="vm.actionOptions.properties">\n            <md-list>\n              <md-list-item class="md-2-line" ng-repeat="(key,value) in vm.properties" ng-click="null" ng-if="key != \'value\' && key != \'updatedAt\' && key != \'queue\'">\n\n                <md-icon ng-if="vm.icon" class="md-avatar-icon" md-font-icon="vm.actionOptions.propertiesIcon" class="s24"></md-icon>\n\n                <div class="md-list-item-text" layout="column">\n                  <p><b><span translate="{{ vm.app.toUpperCase() }}.{{ key.toUpperCase() }}"></span></b></p>\n                  <p>{{ value }}\n                    <p>\n                </div>\n              </md-list-item>\n            </md-list>\n          </md-card-content>\n\n\n        </md-card>\n      </div>\n    </md-dialog-content>\n    <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n      <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n    </div>\n  </form>\n</md-dialog>'),e.put("app/main/apps/video/views/screenRecordings/screenRecordings.html",'<div id="screenRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-video" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VIDEO.SCREENRECORDINGS">ScreenRecordings</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VIDEO.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getScreenRecordings()"></ms-quick-filter>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedScreenRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedScreenRecordings =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VIDEO.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-screenRecordings-count">\n          <span>{{vm.selectedScreenRecordings.length}}</span>\n          <span translate="VIDEO.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VIDEO.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllScreenRecordings()" translate="VIDEO.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectScreenRecordings()" translate="VIDEO.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedScreenRecordings" csv-label="true" filename="screenRecordings.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScreenRecordings($event)" aria-label="delete selected" translate translate-attr-label="VIDEO.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- SCREENRECORDING TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedScreenRecordings" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScreenRecordings">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VIDEO.ID\' | translate }}</th>\n                <th md-column md-order-by="rating">{{ \'VIDEO.RATING\' | translate }}</th>\n                <th md-column md-order-by="UserId">{{ \'VIDEO.AGENT\' | translate }}</th>\n                <th md-column md-order-by="duration">{{ \'VIDEO.DURATION\' | translate }}</th>\n                <th md-column md-order-by="startedAt">{{ \'VIDEO.RECORDSTARTTIME\' | translate }}</th>\n                <th md-column md-order-by="closedAt">{{ \'VIDEO.RECORDENDTIME\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.screenRecordings.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VIDEO.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="screenRecording" md-select-id="id" ng-repeat="screenRecording in vm.screenRecordings.rows">\n                <td md-cell ng-if="screenRecording.userpic"><img class="avatar" alt="{{screenRecording.name}}" ng-src="api/users/{{screenRecording.id}}/avatar" /></td>\n                <td md-cell ng-if="!screenRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{screenRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="id ">{{screenRecording.id}}</td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="rating ">\n                  <md-icon md-font-icon="icon-star" style="color:red" ng-show="screenRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:screenRecording.rating"></md-icon><span ng-hide="screenRecording.rating" translate="VIDEO.NO_RATING">No rating</span>\n                </td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="UserId ">{{ (vm.users | filter : {\'id\':screenRecording.UserId} : true)[0].fullname }}</td>\n                <td md-cell><span ng-bind="vm.convertDuration(screenRecording.duration)"></span></td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="startedAt ">{{screenRecording.startedAt | date:\'medium\' }}</td>\n                <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="closedAt ">{{screenRecording.closedAt | date:\'medium\' }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VIDEO.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.playrecording(screenRecording, $event  , \'value\'  , \'play_screenrecording\'  , \'video\' )" translate="VIDEO.PLAY_SCREENRECORDING">\n                          play screenRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadScreenRecordings">\n\n                        <md-button ng-click="vm.downloadfile2(screenRecording, $event  , \'screen/recordings\'   )" translate="VIDEO.DOWNLOAD_SCREENRECORDING">\n                          Download screenRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(screenRecording, $event    )" translate="VIDEO.DELETE_SCREENRECORDING">\n                          Delete screenRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VIDEO.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VIDEO.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VIDEO.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.screenRecordings.count}}" md-on-paginate="vm.getScreenRecordings" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / SCREENRECORDING TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/routing/dialog.html",'<md-dialog ng-init="vm.init()" class="voice-routing-dialog" aria-label="New routing application">\n  <form name="routingAppForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'VOICE.EDIT_\' + vm.application.appType | uppercase | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content ng-switch="vm.application.appType">\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <div ng-switch-when="agi">\n        <div ng-include="\'app/main/apps/voice/routing/views/agi.html\'"></div>\n      </div>\n      <div ng-switch-when="custom">\n        <div ng-include="\'app/main/apps/voice/routing/views/custom.html\'"></div>\n      </div>\n      <div ng-switch-when="dial">\n        <div ng-include="\'app/main/apps/voice/routing/views/dial.html\'"></div>\n      </div>\n      <div ng-switch-when="externalDial">\n        <div ng-include="\'app/main/apps/voice/routing/views/externalDial.html\'"></div>\n      </div>\n      <div ng-switch-when="goTo">\n        <div ng-include="\'app/main/apps/voice/routing/views/goTo.html\'"></div>\n      </div>\n      <div ng-switch-when="hangup">\n        <div ng-include="\'app/main/apps/voice/routing/views/hangup.html\'"></div>\n      </div>\n      <div ng-switch-when="internalDial">\n        <div ng-include="\'app/main/apps/voice/routing/views/internalDial.html\'"></div>\n      </div>\n      <div ng-switch-when="outboundDial">\n        <div ng-include="\'app/main/apps/voice/routing/views/outboundDial.html\'"></div>\n      </div>\n      <div ng-switch-when="playback">\n        <div ng-include="\'app/main/apps/voice/routing/views/playback.html\'"></div>\n      </div>\n      <div ng-switch-when="queue">\n        <div ng-include="\'app/main/apps/voice/routing/views/queue.html\'"></div>\n      </div>\n      <div ng-switch-when="ringGroup">\n        <div ng-include="\'app/main/apps/voice/routing/views/ringGroup.html\'"></div>\n      </div>\n      <div ng-switch-when="set">\n        <div ng-include="\'app/main/apps/voice/routing/views/set.html\'"></div>\n      </div>\n      <div ng-switch-when="voicemail">\n        <div ng-include="\'app/main/apps/voice/routing/views/voicemail.html\'"></div>\n      </div>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveRoutingApp()" class="send-button md-accent md-raised" ng-disabled="routingAppForm.$invalid || routingAppForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/routing/interval/dialog.html",'<md-dialog ng-init="vm.initialize()" class="interval-dialog" aria-label="Edit Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ \'TOOLS.EDIT_INTERVAL\' | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.crudPermissions.canEdit" ng-change="vm.onTypeChange()">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | startcase }}</md-option>\n        </md-select>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.crudPermissions.canEdit" required>\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows" ng-disabled="interval.canSelect === false">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | startcase }}</span></md-option>\n          </md-select>\n        </md-input-container>\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | startcase }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | startcase }}</span></md-option>\n          </md-select>\n        </md-input-container>\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | startcase }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="start center">\n      <md-button type="submit" ng-if="vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/routing/views/agi.html",'<md-input-container class="md-block">\n  <label translate="VOICE.PROJECT">Project</label>\n  <md-select name="project" ng-model="vm.application.project" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects.rows" ng-disabled="project.canSelect === false">{{ project.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'project\'].$error" ng-show="routingAppForm[\'project\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/custom.html",'<md-input-container class="md-block">\n  <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n  <input type="text" name="app" ng-model="vm.application.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'app\'].$error" ng-show="routingAppForm[\'app\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.ARGUMENTS">Arguments</label>\n  <input type="text" name="appdata" ng-model="vm.application.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'appdata\'].$error" ng-show="routingAppForm[\'appdata\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/dial.html",'<md-input-container class="md-block">\n  <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n  <input type="text" name="tech" ng-model="vm.application.tech" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'tech\'].$error" ng-show="routingAppForm[\'tech\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/externalDial.html",'<md-input-container class="md-block">\n  <label translate="VOICE.TRUNK">Trunk</label>\n  <md-select name="trunk" ng-model="vm.application.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks.rows" ng-disabled="trunk.canSelect === false">{{\n      trunk.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'trunk\'].$error" ng-show="routingAppForm[\'trunk\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.PHONE">Phone</label>\n  <input type="text" name="phone" ng-model="vm.application.phone" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'phone\'].$error" ng-show="routingAppForm[\'phone\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/goTo.html",'<md-input-container class="md-block">\n  <label translate="VOICE.CONTEXT">Context</label>\n  <md-select name="context" ng-model="vm.application.context" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{\n      context.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'context\'].$error" ng-show="routingAppForm[\'context\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.EXTENSION">Extension</label>\n  <input type="text" name="extension" ng-model="vm.application.extension" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'extension\'].$error" ng-show="routingAppForm[\'extension\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.PRIORITY">Priority</label>\n  <input type="text" name="priority" ng-model="vm.application.priority" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'priority\'].$error" ng-show="routingAppForm[\'priority\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/hangup.html","<md-input-container class=\"md-block\">\n  <label translate=\"VOICE.HANGUP_CAUSE\">Hangup_Cause</label>\n  <md-select name=\"appdata\" ng-model=\"vm.application.appdata\" autofocus required ng-disabled=\"!vm.crudPermissions.canEdit\">\n    <md-option ng-value=\"'1'\"> {{ 'VOICE.HANGUPCAUSE_1' | translate }} </md-option>\n    <md-option ng-value=\"'16'\"> {{ 'VOICE.HANGUPCAUSE_16' | translate }} </md-option>\n    <md-option ng-value=\"'17'\"> {{ 'VOICE.HANGUPCAUSE_17' | translate }} </md-option>\n    <md-option ng-value=\"'18'\"> {{ 'VOICE.HANGUPCAUSE_18' | translate }} </md-option>\n    <md-option ng-value=\"'21'\"> {{ 'VOICE.HANGUPCAUSE_21' | translate }} </md-option>\n    <md-option ng-value=\"'22'\"> {{ 'VOICE.HANGUPCAUSE_22' | translate }} </md-option>\n    <md-option ng-value=\"'27'\"> {{ 'VOICE.HANGUPCAUSE_27' | translate }} </md-option>\n    <md-option ng-value=\"'38'\"> {{ 'VOICE.HANGUPCAUSE_38' | translate }} </md-option>\n    <md-option ng-value=\"'41'\"> {{ 'VOICE.HANGUPCAUSE_41' | translate }} </md-option>\n  </md-select>\n  <div ng-messages=\"routingAppForm['appdata'].$error\" ng-show=\"routingAppForm['appdata'].$touched\" role=\"alert\">\n    <div ng-message=\"required\">\n      <span translate=\"VOICE.ERRORS.HANGUP_CAUSE_REQUIRED\">Hangup_Cause field is required</span>\n    </div>\n  </div>\n</md-input-container>"),e.put("app/main/apps/voice/routing/views/internalDial.html",'<md-input-container class="md-block">\n  <label translate="VOICE.USER">User</label>\n  <md-select name="user" ng-model="vm.application.user" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users.rows" ng-disabled="user.canSelect === false">\n      {{ user.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'user\'].$error" ng-show="routingAppForm[\'user\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/outboundDial.html",'<md-input-container class="md-block">\n  <label translate="VOICE.TRUNK">Trunk</label>\n  <md-select name="trunk" ng-model="vm.application.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks.rows" ng-disabled="trunk.canSelect === false">{{\n      trunk.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'trunk\'].$error" ng-show="routingAppForm[\'trunk\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.CALLER_ID">Caller_ID</label>\n  <input type="text" name="callerID" ng-model="vm.application.callerID" ng-disabled="!vm.crudPermissions.canEdit">\n  <div class="hint"><span translate="VOICE.HELP.CALLER_ID"></span></div>\n  <div ng-messages="routingAppForm[\'callerID\'].$error" ng-show="routingAppForm[\'callerID\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED">Caller_ID field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.PREFIX">Prefix</label>\n  <input type="text" name="prefix" ng-model="vm.application.prefix" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'prefix\'].$error" ng-show="routingAppForm[\'prefix\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TAGS">Tags</label>\n  <md-select name="tag" ng-model="vm.application.tag" ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'--\'">None</md-option>\n    <md-option ng-value="tag.name" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{ tag.name }}\n    </md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'tag\'].$error" ng-show="routingAppForm[\'tag\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TAGS_REQUIRED">Tags field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/playback.html",'<md-input-container class="md-block">\n  <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n  <md-select name="sound" ng-model="vm.application.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds.rows" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'sound\'].$error" ng-show="routingAppForm[\'sound\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <md-switch ng-model="vm.application.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/queue.html",'<md-input-container class="md-block">\n  <label translate="VOICE.QUEUE">Queue</label>\n  <md-select name="queue" ng-model="vm.application.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows" ng-disabled="queue.canSelect === false">{{\n      queue.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'queue\'].$error" ng-show="routingAppForm[\'queue\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="URL" ng-model="vm.application.URL" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'URL\'].$error" ng-show="routingAppForm[\'URL\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n  <md-select name="sound" ng-model="vm.application.sound" ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'\'">None</md-option>\n    <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds.rows" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'sound\'].$error" ng-show="routingAppForm[\'sound\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.AGI">Agi</label>\n  <input type="text" name="agi" ng-model="vm.application.agi" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'agi\'].$error" ng-show="routingAppForm[\'agi\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.MACRO">Macro</label>\n  <input type="text" name="macro" ng-model="vm.application.macro" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'macro\'].$error" ng-show="routingAppForm[\'macro\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.GOSUB">GoSub</label>\n  <input type="text" name="gosub" ng-model="vm.application.gosub" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'gosub\'].$error" ng-show="routingAppForm[\'gosub\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.RULE">Rule</label>\n  <input type="text" name="rule" ng-model="vm.application.rule" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'rule\'].$error" ng-show="routingAppForm[\'rule\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.POSITION">Position</label>\n  <input type="number" name="position" ng-model="vm.application.position" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'position\'].$error" ng-show="routingAppForm[\'position\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <md-switch ng-model="vm.application.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/ringGroup.html",'<md-input-container class="md-block">\n  <label translate="VOICE.USER">User</label>\n  <md-select name="user" ng-model="vm.application.users" autofocus multiple required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users.rows" ng-disabled="user.canSelect === false">\n      {{ user.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'user\'].$error" ng-show="routingAppForm[\'user\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.TIMEOUT">Timeout</label>\n  <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n    </div>\n    <div ng-message="min">\n      <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n        equal than</span> <span>0</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.URL">Url</label>\n  <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/set.html",'<md-input-container class="md-block">\n  <label translate="VOICE.VARIABLE">Variable</label>\n  <md-select name="variable" ng-model="vm.application.name" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="variable.name" ng-repeat="variable in vm.variables.rows" ng-disabled="variable.canSelect === false">{{\n      variable.name }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'variable\'].$error" ng-show="routingAppForm[\'variable\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.VALUE">Value</label>\n  <input type="text" name="value" ng-model="vm.application.value" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'value\'].$error" ng-show="routingAppForm[\'value\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/voicemail.html",'<md-input-container class="md-block">\n  <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n  <md-select name="voiceMail" ng-model="vm.application.voiceMail" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n    <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails.rows" ng-disabled="voiceMail.canSelect === false">{{ voiceMail.mailbox }}</md-option>\n  </md-select>\n  <div ng-messages="routingAppForm[\'voiceMail\'].$error" ng-show="routingAppForm[\'voiceMail\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n    </div>\n  </div>\n</md-input-container>\n<md-input-container class="md-block">\n  <label translate="VOICE.OPTIONS">Options</label>\n  <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n  <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n    <div ng-message="required">\n      <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n    </div>\n  </div>\n</md-input-container>'),e.put("app/main/apps/voice/views/chanSpies/chanSpies.html",'<div id="chanSpies" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.CHANSPIES">ChanSpies</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedChanSpies.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedChanSpies =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-chanSpies-count">\n          <span>{{vm.selectedChanSpies.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllChanSpies()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectChanSpies()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedChanSpies" csv-label="true" filename="chanSpies.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChanSpies($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CHANSPY TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedChanSpies" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChanSpies">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="prefix">{{ \'VOICE.PREFIX\' | translate }}</th>\n                <th md-column md-order-by="auth">{{ \'VOICE.AUTH\' | translate }}</th>\n                <th md-column md-order-by="record">{{ \'VOICE.RECORD\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.chanSpies.rows.length">\n                <td md-cell colspan="7">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="chanSpy" md-select-id="id" ng-repeat="chanSpy in vm.chanSpies.rows">\n                <td md-cell ng-if="chanSpy.userpic"><img class="avatar" alt="{{chanSpy.name}}" ng-src="api/users/{{chanSpy.id}}/avatar" /></td>\n                <td md-cell ng-if="!chanSpy.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chanSpy.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="id ">{{chanSpy.id}}</td>\n                <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="name ">{{chanSpy.name}}</td>\n                <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="prefix ">{{chanSpy.prefix}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="auth ">\n                  <md-icon md-colors="{color: {{chanSpy.auth ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.auth ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="record ">\n                  <md-icon md-colors="{color: {{chanSpy.record ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.record ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n                </td>\n                <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="description ">{{chanSpy.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(chanSpy, $event    )" translate="VOICE.EDIT_CHANSPY">\n                          Edit chanSpy\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(chanSpy, $event    )" translate="VOICE.DELETE_CHANSPY">\n                          Delete chanSpy\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chanSpies.count}}" md-on-paginate="vm.getChanSpies" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CHANSPY TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CHANSPY BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chanSpy-button" ng-click="vm.createOrEditchanSpy($event)" aria-label="add chanSpy" translate translate-attr-aria-label="VOICE.ADD_CHANSPY">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CHANSPY BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/create/dialog.html",'<md-dialog class="chanSpy-dialog" aria-label="New chanSpy">\n  <form name="chanSpyForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.chanSpy.name" ng-required="true" autofocus>\n\n        <div ng-messages="chanSpyForm[\'name\'].$error" ng-show="chanSpyForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PREFIX">Prefix</label>\n        <input type="text" name="prefix" ng-model="vm.chanSpy.prefix" ng-required="true">\n\n        <div ng-messages="chanSpyForm[\'prefix\'].$error" ng-show="chanSpyForm[\'prefix\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.OPTIONS">Options</label>\n        <md-select name="options" ng-model="vm.chanSpy.options" multiple required>\n          <md-option ng-value="\'b\'">b: Only spy on channels involved in a bridged call.</md-option>\n          <md-option ng-value="\'B\'">B: Instead of whispering on a single channel barge in on both channels involved in the call.</md-option>\n          <md-option ng-value="\'E\'">E: Exit when the spied-on channel hangs up.</md-option>\n          <md-option ng-value="\'o\'">o: Only listen to audio coming from this channel.</md-option>\n          <md-option ng-value="\'q\'">q: Don\'t play a beep when beginning to spy on a channel, or speak the selected channel name.</md-option>\n          <md-option ng-value="\'s\'">s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.</md-option>\n          <md-option ng-value="\'S\'">S: Stop when no more channels are left to spy on.</md-option>\n          <md-option ng-value="\'w\'">w: Enable whisper mode, so the spying channel can talk to the spied-on channel.</md-option>\n          <md-option ng-value="\'W\'">W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.</md-option>\n        </md-select>\n        <div ng-messages="chanSpyForm[\'options\'].$error" ng-show="chanSpyForm[\'options\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.chanSpy.auth" aria-label="Auth"><span translate="VOICE.AUTH">Auth</span></md-switch>\n      </md-input-container>\n      <md-input-container class="md-block" ng-if="vm.chanSpy.auth">\n        <label translate="VOICE.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.chanSpy.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n        <div ng-messages="chanSpyForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.chanSpy.record" aria-label="Record"><span translate="VOICE.RECORD">Record</span></md-switch>\n      </md-input-container>\n      <md-input-container ng-if="vm.chanSpy.record" class="md-block">\n        <label translate="VOICE.RECORDINGFORMAT">recordingFormat</label>\n        <md-select name="recordingFormat" ng-model="vm.chanSpy.recordingFormat" required>\n          <md-option ng-value="\'wav\'">wav</md-option>\n          <md-option ng-value="\'gsm\'">gsm</md-option>\n          <md-option ng-value="\'WAV\'">wav49</md-option>\n        </md-select>\n        <div ng-messages="chanSpyForm[\'recordingFormat\'].$error" ng-show="chanSpyForm[\'recordingFormat\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.RECORDINGFORMAT_REQUIRED">recordingFormat field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.chanSpy.description">\n\n        <div ng-messages="chanSpyForm[\'description\'].$error" ng-show="chanSpyForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newchanSpy" ng-click="vm.savechanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid || chanSpyForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newchanSpy" ng-click="vm.addNewchanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CHANSPY" translate-attr-aria-label="VOICE.ADD_CHANSPY">\n          ADD CHANSPY\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newchanSpy" ng-click="vm.deletechanSpy($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/contexts/contexts.html",'<div id="contexts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.CONTEXTS">Contexts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedContexts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedContexts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-contexts-count">\n          <span>{{vm.selectedContexts.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllContexts()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectContexts()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedContexts" csv-label="true" filename="contexts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedContexts($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- CONTEXT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedContexts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContexts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.contexts.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="context" md-select-id="id" ng-repeat="context in vm.contexts.rows">\n                <td md-cell ng-if="context.userpic"><img class="avatar" alt="{{context.name}}" ng-src="api/users/{{context.id}}/avatar" /></td>\n                <td md-cell ng-if="!context.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{context.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditContext($event, context)" md-cell class="id ">{{context.id}}</td>\n                <td ng-click="vm.createOrEditContext($event, context)" md-cell class="name ">{{context.name}}</td>\n                <td ng-click="vm.createOrEditContext($event, context)" md-cell class="description ">{{context.description}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(context, $event    )" translate="VOICE.EDIT_CONTEXT">\n                          Edit Context\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(context, $event    )" translate="VOICE.DELETE_CONTEXT">\n                          Delete Context\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contexts.count}}" md-on-paginate="vm.getContexts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CONTEXT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD CONTEXT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-context-button" ng-click="vm.createOrEditContext($event)" aria-label="add context" translate translate-attr-aria-label="VOICE.ADD_CONTEXT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CONTEXT BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/contexts/create/dialog.html",'<md-dialog class="context-dialog" aria-label="New Context">\n  <form name="contextForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.context.name" ng-required="true" autofocus>\n\n        <div ng-messages="contextForm[\'name\'].$error" ng-show="contextForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.context.description">\n\n        <div ng-messages="contextForm[\'description\'].$error" ng-show="contextForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newContext" ng-click="vm.saveContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid || contextForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newContext" ng-click="vm.addNewContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CONTEXT" translate-attr-aria-label="VOICE.ADD_CONTEXT">\n          ADD CONTEXT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContext" ng-click="vm.deleteContext($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="inbound-route-dialog" aria-label="New InboundRoute">\n  <form name="inboundrouteForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newInboundRoute ? \'VOICE.NEW_INBOUNDROUTE\' : \'VOICE.EDIT_INBOUNDROUTE\' | translate\n          }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n        <input type="text" name="exten" ng-model="vm.inboundRoute.exten" ng-required="true" autofocus>\n        <div ng-messages="inboundrouteForm[\'exten\'].$error" ng-show="inboundrouteForm[\'exten\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CONTEXT">Context</label>\n        <md-select name="context" ng-model="vm.inboundRoute.context" required>\n          <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n        </md-select>\n        <div ng-messages="inboundrouteForm[\'context\'].$error" ng-show="inboundrouteForm[\'context\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.inboundRoute.alias" ng-change="vm.getRouting()">\n        <div ng-messages="inboundrouteForm[\'alias\'].$error" ng-show="inboundrouteForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.inboundRoute.description">\n        <div ng-messages="inboundrouteForm[\'description\'].$error" ng-show="inboundrouteForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInboundRoute" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid || inboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInboundRoute" ng-click="vm.addNewInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n          ADD INBOUNDROUTE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInboundRoute" ng-click="vm.deleteInboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-inbound-route" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-inbound-routes-button md-icon-button" aria-label="Go to inbound routes" ng-click="vm.gotoInboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INBOUNDROUTES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="inbound-route-image" hide-xs>\n          <img ng-src="assets/images/business/inboundroutes.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.inboundRoute.id}}\n            <span ng-if="vm.inboundRoute.exten">{{vm.inboundRoute.exten}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.inboundRoute.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveInboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- /HEADER --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      \x3c!-- SETTINGS TAB --\x3e\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="inbound-route-detail-form-container md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n                <input type="text" name="exten" ng-model="vm.inboundRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.inboundRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ALIAS">Alias</label>\n                <input type="text" name="alias" ng-model="vm.inboundRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.inboundRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /SETTINGS TAB --\x3e\n      \x3c!-- ACTIONS TAB --\x3e\n      <md-tab md-on-select="vm.onActionsTabSelection()">\n        <md-tab-label>\n          <span translate="VOICE.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="inbound-route-detail-form-container no-padding no-margin">\n            <div class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- APPLICATIONS LIST --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider class="no-margin"></md-divider>\n                <md-list ng-sortable="vm.sortableAppsOptions">\n                  <md-list-item class="handle" ng-repeat="a in vm.apps">\n                    <div layout="row">\n                      <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n                      <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n                        a.appType}}</p>\n                    </div>\n                  </md-list-item>\n                </md-list>\n              </div>\n              \x3c!-- /APPLICATIONS LIST --\x3e\n              <div flex></div>\n              \x3c!-- ROUTING --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n                <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n                  <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n                  <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n                </div>\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm.selectedApplications.length}}\n                      {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n                      <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n                          \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n                        <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n                          a.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell ng-if="!vm.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                                <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n                        <td md-cell colspan="6">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n                            available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                    <tfoot md-foot>\n                      <tr md-row>\n                        <td md-cell colspan="7">\n                          <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n                        </td>\n                      </tr>\n                    </tfoot>\n                  </table>\n                </md-table-container>\n              </div>\n              \x3c!-- /ROUTING --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /ACTIONS TAB --\x3e\n    </md-tabs>\n  </div>\n  \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/inboundRoutes/inboundRoutes.html",'<div id="inbound-routes" class="page-layout simple left-sidenav inner-sidenav">\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.INBOUNDROUTES">InboundRoutes</span>\n      </div>\n    </div>\n    <div layout="row">\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n    </div>\n  </div>\n  <div ng-show="vm.selectedInboundRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedInboundRoutes = []">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-inbound-routes-count">\n          <span>{{ vm.selectedInboundRoutes.length }}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectedInboundRoutes = vm.inboundRoutes.rows" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.selectedInboundRoutes = []" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedInboundRoutes" csv-label="true" filename="inbound_routes.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    <div class="main scrollable">\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedInboundRoutes" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInboundRoutes">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.inboundRoutes.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.inboundRoutes.rows">\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_INBOUNDROUTE">\n                          Edit InboundRoute\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_INBOUNDROUTE">\n                          Delete InboundRoute\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.inboundRoutes.count }}" md-on-paginate="vm.getInboundRoutes" md-page-select>\n        </md-table-pagination>\n      </md-card>\n    </div>\n  </div>\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-inbound-route-button" ng-click="vm.createOrEditInboundRoute($event)" aria-label="add inbound route" translate translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n</div>'),e.put("app/main/apps/voice/views/internalRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="internal-route-dialog" aria-label="New InternalRoute">\n  <form name="internalrouteForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newInternalRoute ? \'VOICE.NEW_INTERNALROUTE\' : \'VOICE.EDIT_INTERNALROUTE\' | translate\n          }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n        <input type="text" name="exten" ng-model="vm.internalRoute.exten" ng-required="true" autofocus>\n        <div ng-messages="internalrouteForm[\'exten\'].$error" ng-show="internalrouteForm[\'exten\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CONTEXT">Context</label>\n        <md-select name="context" ng-model="vm.internalRoute.context" required>\n          <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n        </md-select>\n        <div ng-messages="internalrouteForm[\'context\'].$error" ng-show="internalrouteForm[\'context\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.internalRoute.alias" ng-change="vm.getRouting()">\n        <div ng-messages="internalrouteForm[\'alias\'].$error" ng-show="internalrouteForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.internalRoute.description">\n        <div ng-messages="internalrouteForm[\'description\'].$error" ng-show="internalrouteForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInternalRoute" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInternalRoute" ng-click="vm.addNewInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INTERNALROUTE" translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n          ADD INTERNALROUTE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInternalRoute" ng-click="vm.deleteInternalRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-internal-route" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-internal-routes-button md-icon-button" aria-label="Go to internal routes" ng-click="vm.gotoInternalRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INTERNALROUTES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="internal-route-image" hide-xs>\n          <img ng-src="assets/images/business/internalroutes.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.internalRoute.id}}\n            <span ng-if="vm.internalRoute.exten">{{vm.internalRoute.exten}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.internalRoute.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveInternalRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- /HEADER --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      \x3c!-- SETTINGS TAB --\x3e\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="internal-route-detail-form-container md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n                <input type="text" name="exten" ng-model="vm.internalRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.internalRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ALIAS">Alias</label>\n                <input type="text" name="alias" ng-model="vm.internalRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.internalRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /SETTINGS TAB --\x3e\n      \x3c!-- ACTIONS TAB --\x3e\n      <md-tab md-on-select="vm.onActionsTabSelection()">\n        <md-tab-label>\n          <span translate="VOICE.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="internal-route-detail-form-container no-padding no-margin">\n            <div class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- APPLICATIONS LIST --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider class="no-margin"></md-divider>\n                <md-list ng-sortable="vm.sortableAppsOptions">\n                  <md-list-item class="handle" ng-repeat="a in vm.apps">\n                    <div layout="row">\n                      <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n                      <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n                        a.appType}}</p>\n                    </div>\n                  </md-list-item>\n                </md-list>\n              </div>\n              \x3c!-- /APPLICATIONS LIST --\x3e\n              <div flex></div>\n              \x3c!-- ROUTING --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n                <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n                  <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n                  <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n                </div>\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm.selectedApplications.length}}\n                      {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n                      <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n                          \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n                        <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n                          a.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell ng-if="!vm.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                                <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n                        <td md-cell colspan="6">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n                            available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                    <tfoot md-foot>\n                      <tr md-row>\n                        <td md-cell colspan="7">\n                          <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n                        </td>\n                      </tr>\n                    </tfoot>\n                  </table>\n                </md-table-container>\n              </div>\n              \x3c!-- /ROUTING --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /ACTIONS TAB --\x3e\n    </md-tabs>\n  </div>\n  \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/internalRoutes/internalRoutes.html",'<div id="internal-routes" class="page-layout simple left-sidenav inner-sidenav">\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.INTERNALROUTES">InternalRoutes</span>\n      </div>\n    </div>\n    <div layout="row">\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n    </div>\n  </div>\n  <div ng-show="vm.selectedInternalRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedInternalRoutes = []">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-internal-routes-count">\n          <span>{{ vm.selectedInternalRoutes.length }}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectedInternalRoutes = vm.internalRoutes.rows" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.selectedInternalRoutes = []" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedInternalRoutes" csv-label="true" filename="internal_routes.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInternalRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    <div class="main scrollable">\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedInternalRoutes" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInternalRoutes">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.internalRoutes.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.internalRoutes.rows">\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_INTERNALROUTE">\n                          Edit InternalRoute\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_INTERNALROUTE">\n                          Delete InternalRoute\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.internalRoutes.count }}" md-on-paginate="vm.getInternalRoutes" md-page-select>\n        </md-table-pagination>\n      </md-card>\n    </div>\n  </div>\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-internal-route-button" ng-click="vm.createOrEditInternalRoute($event)" aria-label="add internal route" translate translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n</div>'),e.put("app/main/apps/voice/views/musiconholds/create/dialog.html",'<md-dialog class="musiconhold-dialog" aria-label="New MusicOnHold">\n  <form name="musiconholdForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="!vm.newMusicOnHold">\n\n        <div ng-messages="musiconholdForm[\'name\'].$error" ng-show="musiconholdForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.MODE">Mode</label>\n        <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="!vm.newMusicOnHold">\n\n          <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n          <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="musiconholdForm[\'mode\'].$error" ng-show="musiconholdForm[\'mode\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n        <label translate="VOICE.DIRECTORY">Directory</label>\n        <input type="" name="directory" ng-model="vm.musiconhold.directory">\n\n        <div ng-messages="musiconholdForm[\'directory\'].$error" ng-show="musiconholdForm[\'directory\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n        <label translate="VOICE.APPLICATION">Application</label>\n        <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n\n        <div ng-messages="musiconholdForm[\'application\'].$error" ng-show="musiconholdForm[\'application\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n        <label translate="VOICE.SORT">Sort</label>\n        <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n          <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n          <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="musiconholdForm[\'sort\'].$error" ng-show="musiconholdForm[\'sort\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMusicOnHold" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid || musiconholdForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMusicOnHold" ng-click="vm.addNewMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MUSICONHOLD" translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n          ADD MUSICONHOLD\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMusicOnHold" ng-click="vm.deleteMusicOnHold($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",'<md-dialog class="mohSound-dialog" aria-label="New MohSound">\n  <form name="mohSoundForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.FILE">File</label>\n        <md-select name="id" ng-model="vm.mohSound.id" autofocus>\n          <md-option ng-value="id.id" ng-repeat="id in vm.sounds" ng-disabled="id.canSelect === false">{{ id.name }}</md-option>\n        </md-select>\n        <div ng-messages="mohSoundForm[\'id\'].$error" ng-show="mohSoundForm[\'id\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.FILE_REQUIRED">File field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMohSound" ng-click="vm.saveMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid || mohSoundForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMohSound" ng-click="vm.addNewMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MOHSOUND" translate-attr-aria-label="VOICE.ADD_MOHSOUND">\n          ADD MOHSOUND\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMohSound" ng-click="vm.deleteMohSound($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/view.html",'<div id="voice-musiconhold" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-musiconholds-button md-icon-button" aria-label="Go to musiconholds" ng-click="vm.gotoMusicOnHolds()" translate translate-attr-aria-label="VOICE.GO_TO_MUSICONHOLDS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="musiconhold-image" hide-xs>\n          <img ng-src="assets/images/business/musiconholds.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.musiconhold.id}}\n            <span ng-if="vm.musiconhold.name">{{vm.musiconhold.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.musiconhold.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveMusicOnHold()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (mohSoundsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="musiconhold-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus disabled>\n\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MODE">Mode</label>\n                <md-select name="mode" ng-model="vm.musiconhold.mode" required disabled>\n\n                  <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'mode\'].$error" ng-show="generalForm[\'mode\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n                <label translate="VOICE.DIRECTORY">Directory</label>\n                <input type="" name="directory" ng-model="vm.musiconhold.directory" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'directory\'].$error" ng-show="generalForm[\'directory\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n                <label translate="VOICE.APPLICATION">Application</label>\n                <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'application\'].$error" ng-show="generalForm[\'application\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n                <label translate="VOICE.SORT">Sort</label>\n                <md-select name="sort" ng-model="vm.musiconhold.sort" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n                  <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'sort\'].$error" ng-show="generalForm[\'sort\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.AUDIOFILES">AUDIOFILES</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="musiconhold-detail-form-container mohsounds md-background-bg md-whiteframe-1dp">\n            <div ng-controller="MusicOnHoldMohSoundsController as vm_dc" ng-init="vm_dc.init(vm.musiconhold, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMusicOnHoldMohSounds.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="VOICE.MOHSOUNDS">MohSounds</span>\n                  <ms-search-bar on-search="vm_dc.getMusicOnHoldMohSounds()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMusicOnHoldMohSound($event)" aria-label="add mohSound" translate translate-attr-label="VOICE.ADD_MOHSOUND">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMusicOnHoldMohSounds.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedMusicOnHoldMohSounds.length}} {{vm_dc.selectedMusicOnHoldMohSounds.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMusicOnHoldMohSounds" csv-label="true" filename="musiconholds.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMusicOnHoldMohSounds($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedMusicOnHoldMohSounds" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMusicOnHoldMohSounds">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'VOICE.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="audio">\n                        {{ \'VOICE.AUDIO\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'VOICE.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="mohSound" md-select-id="id" ng-repeat="mohSound in vm_dc.musiconholdMohSounds.rows">\n                      <td md-cell>\n                        {{mohSound.id}}\n                      </td>\n                      <td md-cell>\n                        \x3c!-- audio recording directive --\x3e\n                        <ms-recording id="mohSound.id" model="\'sound\'"></ms-recording>\n                        \x3c!-- / audio recording directive --\x3e\n                      </td>\n                      <td md-cell>\n                        {{ mohSound.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(mohSound, $event)" translate="VOICE.DELETE_MOHSOUND">\n                                Delete MohSound\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.musiconholdMohSounds.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="VOICE.NO_MOHSOUND_AVAILABLE">No mohsound available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.musiconholdMohSounds.count}}" md-on-paginate="vm_dc.getMusicOnHoldMohSounds" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/musiconholds/musiconholds.html",'<div id="musiconholds" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.MUSICONHOLDS">MusicOnHolds</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedMusicOnHolds.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedMusicOnHolds =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-musiconholds-count">\n          <span>{{vm.selectedMusicOnHolds.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllMusicOnHolds()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectMusicOnHolds()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedMusicOnHolds" csv-label="true" filename="musiconholds.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMusicOnHolds($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- MUSICONHOLD TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedMusicOnHolds" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMusicOnHolds">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="mode">{{ \'VOICE.MODE\' | translate }}</th>\n                <th md-column md-order-by="sort">{{ \'VOICE.SORT\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.musiconholds.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="musiconhold" md-select-id="id" ng-repeat="musiconhold in vm.musiconholds.rows">\n                <td md-cell ng-if="musiconhold.userpic"><img class="avatar" alt="{{musiconhold.name}}" ng-src="api/users/{{musiconhold.id}}/avatar" /></td>\n                <td md-cell ng-if="!musiconhold.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{musiconhold.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="id ">{{musiconhold.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="name ">{{musiconhold.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="mode ">{{ \'VOICE.\' + vm.arraymode[musiconhold.mode].option | uppercase | translate }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="sort ">{{ \'VOICE.\' + vm.arraysort[musiconhold.sort].option | uppercase | translate }}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(musiconhold, $event    )" translate="VOICE.EDIT_MUSICONHOLD">\n                          Edit MusicOnHold\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(musiconhold, $event    )" translate="VOICE.DELETE_MUSICONHOLD">\n                          Delete MusicOnHold\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.musiconholds.count}}" md-on-paginate="vm.getMusicOnHolds" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / MUSICONHOLD TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD MUSICONHOLD BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-musiconhold-button" ng-click="vm.createOrEditMusicOnHold($event)" aria-label="add musiconhold" translate translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD MUSICONHOLD BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="outbound-route-dialog" aria-label="New OutboundRoute">\n  <form name="outboundrouteForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.newOutboundRoute ? \'VOICE.NEW_OUTBOUNDROUTE\' : \'VOICE.EDIT_OUTBOUNDROUTE\' | translate\n          }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span>({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n        <input type="text" name="exten" ng-model="vm.outboundRoute.exten" ng-required="true" autofocus>\n        <div ng-messages="outboundrouteForm[\'exten\'].$error" ng-show="outboundrouteForm[\'exten\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CONTEXT">Context</label>\n        <md-select name="context" ng-model="vm.outboundRoute.context" required>\n          <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n        </md-select>\n        <div ng-messages="outboundrouteForm[\'context\'].$error" ng-show="outboundrouteForm[\'context\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.RECORDING">Recording</label>\n        <md-select name="recordingFormat" ng-model="vm.outboundRoute.recordingFormat" ng-change="vm.getRouting()" required>\n          <md-option ng-value="\'none\'">none</md-option>\n          <md-option ng-value="\'wav\'">wav</md-option>\n          <md-option ng-value="\'WAV\'">wav49</md-option>\n          <md-option ng-value="\'gsm\'">gsm</md-option>\n        </md-select>\n        <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n        <div ng-messages="outboundrouteForm[\'recordingFormat\'].$error" ng-show="outboundrouteForm[\'recordingFormat\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CUTDIGITS">CutDigits</label>\n        <input type="number" name="cutdigits" ng-model="vm.outboundRoute.cutdigits" min="0">\n        <div ng-messages="outboundrouteForm[\'cutdigits\'].$error" ng-show="outboundrouteForm[\'cutdigits\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater\n              or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.ALIAS">Alias</label>\n        <input type="text" name="alias" ng-model="vm.outboundRoute.alias" ng-change="vm.getRouting()">\n        <div ng-messages="outboundrouteForm[\'alias\'].$error" ng-show="outboundrouteForm[\'alias\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.outboundRoute.description">\n        <div ng-messages="outboundrouteForm[\'description\'].$error" ng-show="outboundrouteForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOutboundRoute" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOutboundRoute" ng-click="vm.addNewOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_OUTBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n          ADD OUTBOUNDROUTE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOutboundRoute" ng-click="vm.deleteOutboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-outbound-route" class="page-layout simple tabbed" layout="column">\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-outbound-routes-button md-icon-button" aria-label="Go to outbound routes" ng-click="vm.gotoOutboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_OUTBOUNDROUTES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n      <div layout="row" layout-align="start center">\n        <div class="outbound-route-image" hide-xs>\n          <img ng-src="assets/images/business/outboundroutes.jpg">\n        </div>\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.outboundRoute.id}}\n            <span ng-if="vm.outboundRoute.exten">{{vm.outboundRoute.exten}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.outboundRoute.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveOutboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n  </div>\n  \x3c!-- /HEADER --\x3e\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      \x3c!-- SETTINGS TAB --\x3e\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="outbound-route-detail-form-container md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n                <input type="text" name="exten" ng-model="vm.outboundRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONTEXT">Context</label>\n                <md-select name="context" ng-model="vm.outboundRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RECORDING">Recording</label>\n                <md-select name="recordingFormat" ng-model="vm.outboundRoute.recordingFormat" ng-change="vm.onActionsTabSelection()" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'none\'">none</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'WAV\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n                <div ng-messages="generalForm[\'recordingFormat\'].$error" ng-show="generalForm[\'recordingFormat\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CUTDIGITS">CutDigits</label>\n                <input type="number" name="cutdigits" ng-model="vm.outboundRoute.cutdigits" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'cutdigits\'].$error" ng-show="generalForm[\'cutdigits\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid\n                      greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ALIAS">Alias</label>\n                <input type="text" name="alias" ng-model="vm.outboundRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.outboundRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /SETTINGS TAB --\x3e\n      \x3c!-- ACTIONS TAB --\x3e\n      <md-tab md-on-select="vm.onActionsTabSelection()">\n        <md-tab-label>\n          <span translate="VOICE.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="outbound-route-detail-form-container no-padding no-margin">\n            <div class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- APPLICATIONS LIST --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider class="no-margin"></md-divider>\n                <md-list ng-sortable="vm.sortableAppsOptions">\n                  <md-list-item class="handle" ng-repeat="a in vm.apps">\n                    <div layout="row">\n                      <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n                      <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n                        a.appType}}</p>\n                    </div>\n                  </md-list-item>\n                </md-list>\n              </div>\n              \x3c!-- /APPLICATIONS LIST --\x3e\n              <div flex></div>\n              \x3c!-- ROUTING --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n                <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n                  <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n                  <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n                </div>\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm.selectedApplications.length}}\n                      {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n                      <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n                          \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n                        <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n                          a.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell ng-if="!vm.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                                <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                                <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n                        <td md-cell colspan="6">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n                            available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                    <tfoot md-foot>\n                      <tr md-row>\n                        <td md-cell colspan="7">\n                          <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n                        </td>\n                      </tr>\n                    </tfoot>\n                  </table>\n                </md-table-container>\n              </div>\n              \x3c!-- /ROUTING --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      \x3c!-- /ACTIONS TAB --\x3e\n    </md-tabs>\n  </div>\n  \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundRoutes/outboundRoutes.html",'<div id="outbound-routes" class="page-layout simple left-sidenav inner-sidenav">\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.OUTBOUNDROUTES">OutboundRoutes</span>\n      </div>\n    </div>\n    <div layout="row">\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n    </div>\n  </div>\n  <div ng-show="vm.selectedOutboundRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n    <div class="close-button-wrapper" ng-click="vm.selectedOutboundRoutes = []">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n    <div flex layout="row" layout-align="space-between center">\n      <div>\n        <span class="selected-outbound-routes-count">\n          <span>{{ vm.selectedOutboundRoutes.length }}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectedOutboundRoutes = vm.outboundRoutes.rows" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.selectedOutboundRoutes = []" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedOutboundRoutes" csv-label="true" filename="outbound_routes.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOutboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n    <div class="main scrollable">\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedOutboundRoutes" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOutboundRoutes">\n              <tr md-row>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.outboundRoutes.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.outboundRoutes.rows">\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n                <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n                  <md-menu>\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n                    <md-menu-content width="3">\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                        <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_OUTBOUNDROUTE">\n                          Edit OutboundRoute\n                        </md-button>\n                      </md-menu-item>\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n                        <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_OUTBOUNDROUTE">\n                          Delete OutboundRoute\n                        </md-button>\n                      </md-menu-item>\n                    </md-menu-content>\n                  </md-menu>\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n        <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.outboundRoutes.count }}" md-on-paginate="vm.getOutboundRoutes" md-page-select>\n        </md-table-pagination>\n      </md-card>\n    </div>\n  </div>\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-outbound-route-button" ng-click="vm.createOrEditOutboundRoute($event)" aria-label="add outbound route" translate translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n</div>'),e.put("app/main/apps/voice/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n  <div class="md-toolbar-tools" layout="row" layout-align="center center">\n    <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n    <ms-search-bar on-search="vm.getAbandonedCalls()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300">\n    </ms-search-bar>\n    <div flex></div>\n\n    <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getAbandonedCalls()"></ms-quick-filter>\n\n    <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n      <md-icon md-font-icon="icon-reload"></md-icon>\n      <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}\n      </md-tooltip>\n    </md-button>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAbandonedCalls">\n      <tr md-row>\n        <th md-column md-order-by="id">ID</th>\n        <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n        <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n        <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n        <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n        <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n        <th md-column md-order-by="disposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.abandonedCalls.rows.length">\n        <td md-cell colspan="12">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="call in vm.abandonedCalls.rows">\n        <td md-cell class="id">{{call.id}}</td>\n        <td md-cell class="firstName" privacy ng-cloak>{{call.calleridname}}</td>\n        <td md-cell class="list" privacy ng-cloak>{{call.calleridnum}}</td>\n        <td md-cell class="list">{{vm.queuesMap[call.queue]}}</td>\n        <td md-cell class="list">\n          {{call.queuecallerabandonAt ? (call.queuecallerabandonAt | formatdate) : (call.queuecallerexitAt | formatdate) }}\n        </td>\n        <td md-cell class="list">{{call.lastAssignedTo}}</td>\n        <td md-cell class="list">{{ call.disposition }}</td>\n        <td md-cell class="list">{{ call.secondDisposition }}</td>\n        <td md-cell class="list">{{ call.thirdDisposition }}</td>\n        <td md-cell class="actions">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="2">\n              <md-menu-item ng-if="vm.crudPermissions.canEdit">\n                <md-menu>\n                  <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">\n                    Assigned\n                    to</md-button>\n                  <md-menu-content>\n                    <md-menu-item ng-if="call.lastAssignedTo">\n                      <md-button ng-click="vm.assignTo(call)"><em translate="DASHBOARDS.NONE">Not Assigned</em>\n                      </md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n                      <md-button ng-click="vm.assignTo(call,agent)">{{agent.name}}</md-button>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.dispose(call)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">\n                  Dispose\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.abandonedCalls.count}}" md-on-paginate="vm.getAbandonedCalls" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/outbound_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.OUTBOUND_CALLS">Ooutbound Calls</span>\n  </div>\n</md-toolbar>\n\n\x3c!-- OUTBOUNDS TABLE --\x3e\n<md-table-container>\n  <table md-table>\n    <thead md-head>\n      <tr md-row>\n        <th md-column width="30px"></th>\n        <th md-column>{{ \'VOICE.SOURCE\' | translate }}</th>\n        <th md-column>{{ \'VOICE.DESTINATION\' | translate }}</th>\n        <th md-column>{{ \'VOICE.ALIAS\' | translate }}</th>\n        <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.calls.rows.length">\n        <td md-cell colspan="5">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n        <td md-cell>\n          <i ng-class="vm.channelStatus[call.channelstatedesc.toLowerCase()]"></i>\n        </td>\n        <td md-cell privacy ng-cloak>\n          {{call.calleridname}}, {{call.calleridnum}}\n          <span class="text-boxed" ng-if="call.answered">\n            <timer ng-if="call.answertime" start-time="call.answertime"></timer>\n          </span>\n        </td>\n        <td md-cell privacy ng-cloak>{{call.exten}}</td>\n        <td md-cell>{{call.routealias}}</td>\n        <td md-cell>\n          <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() !== \'hangup\'">\n            <timer ng-if="call.starttime" start-time="call.starttime"></timer>\n          </span>\n          <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() === \'hangup\'" translate="VOICE.CLOSING">Closing</span>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.calls.count}}"></md-table-pagination>\n\x3c!-- / OUTBOUNDS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n  </div>\n</md-toolbar>\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n  <table md-table>\n    <thead md-head>\n      <tr md-row>\n        <th md-column width="30px"></th>\n        <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n        <th md-column>{{ \'VOICE.ALIAS\' | translate }}</th>\n        <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n        <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n        <th md-column>{{ \'VOICE.AGENT\' | translate }}</th>\n        <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n        <td md-cell colspan="8">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n        <td md-cell>\n          <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n          <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n        </td>\n        <td md-cell>{{channel.exten}}</td>\n        <td md-cell>{{channel.routealias}}</td>\n        <td md-cell>{{channel.queue}}</td>\n        <td md-cell privacy ng-cloak>\n          <span>{{channel.calleridname}}, {{channel.calleridnum}}</span>\n        </td>\n        <td md-cell>\n          <span ng-if="channel.queuecallerleaveAt">\n            {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n            <span class="text-boxed">\n              <timer start-time="channel.queuecallerleaveAt"></timer>\n            </span>\n          </span>\n          <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n            {{ \'VOICE.WAITING_FOR_AGENT\' | translate }}\n            <timer start-time="channel.queuecallerjoinAt"></timer>\n          </span>\n        </td>\n        <td md-cell>\n          <span class="text-boxed">\n            <timer start-time="channel.queuecallerjoinAt"></timer>\n          </span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="2">\n              <md-menu-item>\n                <md-button ng-click="vm.hangup(channel.uniqueid)" translate="VOICE.HANGUP">\n                  Hangup\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n                  Number\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-menu class="no-margin">\n                  <md-button ng-mouseenter="vm.getAvailableAgents()" translate="VOICE.REDIRECT_TO_AGENT">\n                    Redirect to Agent</md-button>\n                  <md-menu-content>\n                    <md-menu-item ng-if="!vm.availableAgents">\n                      <md-progress-circular class="md-accent auto-margin" md-diameter="32" md-mode="indeterminate">\n                      </md-progress-circular>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.availableAgents.length > 0" ng-repeat="agent in vm.availableAgents">\n                      <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">\n                        {{agent.name}}</md-button>\n                    </md-menu-item>\n                    <md-menu-item ng-if="vm.availableAgents.length === 0">\n                      <span>No agents available</span>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column>{{\'\n                        VOICE.NAME\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.TOTAL_OFFERED\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.ANSWERED\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.ABANDONED\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.UNMANAGED\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.AVG_HOLD_TIME\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.AVG_DURATION\' | translate}}</th>\n        <th md-column>{{\'\n                        VOICE.AVG_BILLABLE\' | translate}}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues">\n        <td md-cell colspan="8">\n          <div layout="row" layout-align="center center">\n            <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, queue) in vm.queues">\n        <td md-cell>\n          <span>{{queue.name}}</span>\n        </td>\n        <td md-cell>\n          \x3c!-- <span class="font-size-20 grey-fg">{{queue.total || 0}}</span> --\x3e\n          <span class="font-size-20 grey-fg">{{ (queue.answered || 0) + (queue.abandoned || 0) + (queue.unmanaged || 0) }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.total) ? (queue.answered || 0) * 100/queue.total : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.abandoned || 0}} ({{(queue.total) ? (queue.abandoned || 0) * 100/queue.total : 0 | number:1}}%)</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.unmanaged || 0}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.total ? ((queue.sumHoldTime || 0) / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{(queue.total ? ((queue.sumDuration || 0) / queue.total) : 0) | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n        <th md-column>{{ \'VOICE.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'VOICE.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'VOICE.TALKING\' | translate }}</th>\n        <th md-column>{{ \'VOICE.BUSY\' | translate }}</th>\n        <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedInDb }} ({{ queue.loggedIn }})</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.talking }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.busy }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="VOICE.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="VOICE.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.TELEPHONES">Telephones</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.TRUNKS">Trunks</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.ABANDONEDCALLS">Abandoned Queue Calls</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.QUEUE_PARAMS">Queue Parameters</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.OUTBOUND_CALLS">Outbound Calls</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/telephones/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.TELEPHONES">Telephones</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getTelephones()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n      <tr md-row>\n        <th md-column md-order-by="fullname">{{ \'VOICE.ACCOUNTNAME\' | translate }}</th>\n        <th md-column md-order-by="internal">{{ \'VOICE.INTERNAL\' | translate }}</th>\n        <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n        <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.telephones">\n        <td md-cell colspan="4">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="telephone" md-select-id="id" ng-repeat="(id, telephone) in vm.telephones">\n        <td md-cell>{{telephone.fullname}}</td>\n        <td md-cell>{{telephone.internal}}</td>\n        <td md-cell>\n          <i ng-class="vm.stateClass[telephone.state]">\n            <md-tooltip>{{\'VOICE.\' + telephone.state | uppercase | translate}}</md-tooltip>\n          </i>\n        </td>\n        <td md-cell>\n          <i ng-class="vm.statusClass[telephone.status]">\n            <md-tooltip>{{\'VOICE.\' + telephone.status | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="telephone.status === \'registered\'" class="text-boxed">{{telephone.address}}</span>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="VOICE.TRUNKS">Telephones</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getTrunks()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head>\n      <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n        <tr md-row>\n          <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n          <th md-column>{{ \'VOICE.TRUNK_STATUS\' | translate }}</th>\n          <th md-column>{{ \'VOICE.REGISTRY\' | translate }}</th>\n          <th md-column width="10px"></th>\n        </tr>\n      </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.trunks">\n        <td md-cell colspan="3">\n          <div layout="row" layout-align="center center">\n            <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n        <td md-cell>{{trunk.name}}</td>\n        <td md-cell>\n          <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n            <md-tooltip>{{\'VOICE.\' + trunk.status | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n        </td>\n        <td md-cell>\n          <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n            <md-tooltip>{{\'VOICE.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n          </i>\n          <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n          <span ng-if="!trunk.registry" translate="VOICE.NO_REGISTRY">\n            No Registry\n          </span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n\n            <md-menu-content width="4">\n              <md-menu-item>\n                <md-button ng-click="vm.goToTrunk($event, trunk)" translate="VOICE.EDIT_TRUNK">\n                  Edit Trunk\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/voicemails/create/dialog.html",'<md-dialog class="voicemail-dialog" aria-label="New Voicemail">\n  <form name="voicemailForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.FULLNAME">FullName</label>\n        <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n\n        <div ng-messages="voicemailForm[\'fullname\'].$error" ng-show="voicemailForm[\'fullname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.EMAIL">Email</label>\n        <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n\n        <div ng-messages="voicemailForm[\'email\'].$error" ng-show="voicemailForm[\'email\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n          </div>\n          <div ng-message="email">\n            <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.PASSWORD">Password</label>\n        <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n        <div ng-messages="voicemailForm[\'password\'].$error" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n        <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n        <div ng-messages="voicemailForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class="md-block">\n        <label translate="VOICE.MAILBOX">MailBox</label>\n        <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="!vm.newVoicemail">\n\n        <div ng-messages="voicemailForm[\'mailbox\'].$error" ng-show="voicemailForm[\'mailbox\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.ATTACH">Attach</label>\n        <md-select name="attach" ng-model="vm.voicemail.attach">\n\n          <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n          <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n        </md-select>\n        <div ng-messages="voicemailForm[\'attach\'].$error" ng-show="voicemailForm[\'attach\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoicemail" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid || voicemailForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoicemail" ng-click="vm.addNewVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEMAIL" translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n          ADD VOICEMAIL\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoicemail" ng-click="vm.deleteVoicemail($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicemails/edit/view.html",'<div id="voice-voicemail" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-voicemails-button md-icon-button" aria-label="Go to voicemails" ng-click="vm.gotoVoicemails()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEMAILS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="voicemail-image" hide-xs>\n          <img ng-src="assets/images/business/voicemails.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.voicemail.id}}\n            <span ng-if="vm.voicemail.name">{{vm.voicemail.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voicemail.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveVoicemail()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (messagesForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voicemail-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.FULLNAME">FullName</label>\n                <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'fullname\'].$error" ng-show="generalForm[\'fullname\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.EMAIL">Email</label>\n                <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n                  </div>\n                  <div ng-message="email">\n                    <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PASSWORD">Password</label>\n                <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n                <div ng-messages="generalForm[\'password\'].$error" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n                <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n                <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n                <div ng-messages="generalForm.confirmPassword.$error" role="alert" multiple>\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n                  </div>\n                  <div ng-message="passwordMatch">\n                    <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container class="md-block">\n                <label translate="VOICE.MAILBOX">MailBox</label>\n                <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" disabled>\n\n                <div ng-messages="generalForm[\'mailbox\'].$error" ng-show="generalForm[\'mailbox\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.VOICEMAIL_CONTEXT">Voicemail_Context</label>\n                <md-select name="context" ng-model="vm.voicemail.context" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.VOICEMAIL_CONTEXT"></span></div>\n                <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.VOICEMAIL_CONTEXT_REQUIRED">Voicemail_Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voicemail-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.TIMEZONE">TimeZone</label>\n                <input type="text" name="tz" ng-model="vm.voicemail.tz" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'tz\'].$error" ng-show="advancedForm[\'tz\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.TIMEZONE_REQUIRED">TimeZone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ATTACH">Attach</label>\n                <md-select name="attach" ng-model="vm.voicemail.attach" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'attach\'].$error" ng-show="advancedForm[\'attach\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ENVELOPE">Envelope</label>\n                <md-select name="envelope" ng-model="vm.voicemail.envelope" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'envelope\'].$error" ng-show="advancedForm[\'envelope\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ENVELOPE_REQUIRED">Envelope field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DELETE">Delete</label>\n                <md-select name="delete" ng-model="vm.voicemail.delete" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div ng-messages="advancedForm[\'delete\'].$error" ng-show="advancedForm[\'delete\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DELETE_REQUIRED">Delete field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.EMAILBODY">EmailBody</label>\n                <input type="text" name="emailbody" ng-model="vm.voicemail.emailbody" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'emailbody\'].$error" ng-show="advancedForm[\'emailbody\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.EMAILBODY_REQUIRED">EmailBody field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.EMAILSUBJECT">EmailSubject</label>\n                <input type="text" name="emailsubject" ng-model="vm.voicemail.emailsubject" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'emailsubject\'].$error" ng-show="advancedForm[\'emailsubject\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.EMAILSUBJECT_REQUIRED">EmailSubject field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MAXSECONDS">MaxSeconds</label>\n                <input type="number" name="maxsecs" ng-model="vm.voicemail.maxsecs" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'maxsecs\'].$error" ng-show="advancedForm[\'maxsecs\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MAXSECONDS_REQUIRED">MaxSeconds field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxSeconds must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MAXMESSAGES">MaxMessages</label>\n                <input type="number" name="maxmsg" ng-model="vm.voicemail.maxmsg" min="0" max="9999" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="advancedForm[\'maxmsg\'].$error" ng-show="advancedForm[\'maxmsg\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MAXMESSAGES_REQUIRED">MaxMessages field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>9999</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.MESSAGES">MESSAGES</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voicemail-detail-form-container messages md-background-bg md-whiteframe-1dp">\n            <div ng-controller="VoicemailMessagesController as vm_dc" ng-init="vm_dc.init(vm.voicemail, vm.crudPermissions)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedVoicemailMessages.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="VOICE.MESSAGES">Messages</span>\n                  <ms-search-bar on-search="vm_dc.getVoicemailMessages()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedVoicemailMessages.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedVoicemailMessages.length}} {{vm_dc.selectedVoicemailMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedVoicemailMessages" csv-label="true" filename="voicemails.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedVoicemailMessages($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedVoicemailMessages" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getVoicemailMessages">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'VOICE.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="callerid">\n                        {{ \'VOICE.CALLER_ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="duration">\n                        {{ \'VOICE.DURATION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="audio">\n                        {{ \'VOICE.AUDIO\' | translate }}\n                      </th>\n                      <th md-column md-order-by="stamp">\n                        {{ \'VOICE.RECEIVED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="message" md-select-id="id" ng-repeat="message in vm_dc.voicemailMessages.rows">\n                      <td md-cell>\n                        {{message.id}}\n                      </td>\n                      <td md-cell>\n                        {{message.callerid}}\n                      </td>\n                      <td md-cell>\n                        {{message.duration}}\n                      </td>\n                      <td md-cell>\n                        \x3c!-- audio recording directive --\x3e\n                        <ms-recording id="message.id" model="\'voiceMailMessage\'"></ms-recording>\n                        \x3c!-- / audio recording directive --\x3e\n                      </td>\n                      <td md-cell>\n                        {{ message.stamp | formatdate }}\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(message, $event)" translate="VOICE.DELETE_MESSAGE">\n                                Delete Message\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.voicemailMessages.rows.length">\n                      <td md-cell colspan="8">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="VOICE.NO_MESSAGE_AVAILABLE">No message available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.voicemailMessages.count}}" md-on-paginate="vm_dc.getVoicemailMessages" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voicemails/voicemails.html",'<div id="voicemails" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.VOICEMAILS">Voicemails</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVoicemails.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVoicemails =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-voicemails-count">\n          <span>{{vm.selectedVoicemails.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVoicemails()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVoicemails()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVoicemails" csv-label="true" filename="voicemails.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicemails($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VOICEMAIL TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVoicemails" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicemails">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="fullname">{{ \'VOICE.FULLNAME\' | translate }}</th>\n                <th md-column md-order-by="email">{{ \'VOICE.EMAIL\' | translate }}</th>\n                <th md-column md-order-by="mailbox">{{ \'VOICE.MAILBOX\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.voicemails.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="voicemail" md-select-id="id" ng-repeat="voicemail in vm.voicemails.rows">\n                <td md-cell ng-if="voicemail.userpic"><img class="avatar" alt="{{voicemail.name}}" ng-src="api/users/{{voicemail.id}}/avatar" /></td>\n                <td md-cell ng-if="!voicemail.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicemail.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="id ">{{voicemail.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="fullname ">{{voicemail.fullname}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="email ">{{voicemail.email}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="mailbox ">{{voicemail.mailbox}}</td>\n\n\n                <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(voicemail, $event    )" translate="VOICE.EDIT_VOICEMAIL">\n                          Edit Voicemail\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(voicemail, $event    )" translate="VOICE.DELETE_VOICEMAIL">\n                          Delete Voicemail\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicemails.count}}" md-on-paginate="vm.getVoicemails" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VOICEMAIL TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VOICEMAIL BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicemail-button" ng-click="vm.createOrEditVoicemail($event)" aria-label="add voicemail" translate translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VOICEMAIL BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voicePrefixes/create/dialog.html",'<md-dialog class="voicePrefix-dialog" aria-label="New voicePrefix">\n  <form name="voicePrefixForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.voicePrefix.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus>\n\n        <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n        <div ng-messages="voicePrefixForm[\'name\'].$error" ng-show="voicePrefixForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.OUTBOUNDROUTE">OutboundRoute</label>\n        <md-select name="VoiceExtensionId" ng-model="vm.voicePrefix.VoiceExtensionId" required>\n          <md-option ng-value="VoiceExtensionId.id" ng-repeat="VoiceExtensionId in vm.outboundRoutes" ng-disabled="VoiceExtensionId.canSelect === false">{{ VoiceExtensionId.exten }}</md-option>\n        </md-select>\n        <div ng-messages="voicePrefixForm[\'VoiceExtensionId\'].$error" ng-show="voicePrefixForm[\'VoiceExtensionId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.CALLERIDALL">CallerIdAll</label>\n        <input type="text" name="callerIdAll" ng-model="vm.voicePrefix.callerIdAll" ng-pattern="/&quot;(.*)&quot;\\s&lt;(.*?)&gt;$/">\n\n        <div class="hint"><span translate="VOICE.HELP.CALLERIDALL"></span></div>\n        <div ng-messages="voicePrefixForm[\'callerIdAll\'].$error" ng-show="voicePrefixForm[\'callerIdAll\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.CALLERIDALL_REQUIRED">CallerIdAll field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.CALLERIDALL_MUST_VALID_PATTERN" translate-values="{ regex: \'/&quot;(.*)&quot;\\s&lt;(.*?)&gt;$/\' }">CallerIdAll must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.voicePrefix.description">\n\n        <div ng-messages="voicePrefixForm[\'description\'].$error" ng-show="voicePrefixForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newvoicePrefix" ng-click="vm.savevoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid || voicePrefixForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newvoicePrefix" ng-click="vm.addNewvoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEPREFIX" translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n          ADD VOICEPREFIX\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newvoicePrefix" ng-click="vm.deletevoicePrefix($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n  <form name="voicePrefixForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="VOICE.AGENTADD_VOICEPREFIX">Add Agent to voicePrefix</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/teamadd/teamadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n  <form name="voicePrefixForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",'<div id="voicePrefixes" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.VOICEPREFIXES">VoicePrefixes</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVoicePrefixes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVoicePrefixes =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-voicePrefixes-count">\n          <span>{{vm.selectedVoicePrefixes.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVoicePrefixes()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVoicePrefixes()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVoicePrefixes" csv-label="true" filename="voicePrefixes.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicePrefixes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VOICEPREFIX TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVoicePrefixes" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicePrefixes">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="VoiceExtensionId">{{ \'VOICE.OUTBOUNDROUTE\' | translate }}</th>\n                <th md-column md-order-by="callerIdAll">{{ \'VOICE.CALLERIDALL\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.voicePrefixes.rows.length">\n                <td md-cell colspan="6">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="voicePrefix" md-select-id="id" ng-repeat="voicePrefix in vm.voicePrefixes.rows">\n                <td md-cell ng-if="voicePrefix.userpic"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="api/users/{{voicePrefix.id}}/avatar" /></td>\n                <td md-cell ng-if="!voicePrefix.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="id ">{{voicePrefix.id}}</td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="name ">{{voicePrefix.name}}</td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="VoiceExtensionId ">{{ (vm.outboundRoutes | filter : {\'id\':voicePrefix.VoiceExtensionId} : true)[0].exten }}</td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="callerIdAll ">{{voicePrefix.callerIdAll}}</td>\n                <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="description ">{{voicePrefix.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editdialog(voicePrefix, $event    )" translate="VOICE.EDIT_VOICEPREFIX">\n                          Edit voicePrefix\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(voicePrefix, $event    )" translate="VOICE.AGENTADD_VOICEPREFIX">\n                          AgentAdd voicePrefix\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(voicePrefix, $event    )" translate="VOICE.TEAMADD_VOICEPREFIX">\n                          teamadd voicePrefix\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(voicePrefix, $event    )" translate="VOICE.DELETE_VOICEPREFIX">\n                          Delete voicePrefix\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicePrefixes.count}}" md-on-paginate="vm.getVoicePrefixes" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VOICEPREFIX TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VOICEPREFIX BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicePrefix-button" ng-click="vm.createOrEditvoicePrefix($event)" aria-label="add voicePrefix" translate translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VOICEPREFIX BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/create/dialog.html",'<md-dialog class="voiceQueue-dialog" aria-label="New VoiceQueue">\n  <form name="voiceQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newVoiceQueue">\n\n        <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n        <div ng-messages="voiceQueueForm[\'name\'].$error" ng-show="voiceQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n          <md-option ng-value="\'ringall\'">Ringall</md-option>\n          <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n          <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n          <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n          <md-option ng-value="\'random\'">Random</md-option>\n          <md-option ng-value="\'linear\'">Linear</md-option>\n          <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n        </md-select>\n        <div ng-messages="voiceQueueForm[\'strategy\'].$error" ng-show="voiceQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="VOICE.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.voiceQueue.description">\n\n        <div ng-messages="voiceQueueForm[\'description\'].$error" ng-show="voiceQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceQueue" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid || voiceQueueForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceQueue" ng-click="vm.addNewVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEQUEUE" translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n          ADD VOICEQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceQueue" ng-click="vm.deleteVoiceQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n  <form name="voiceQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="VOICE.AGENTADD_VOICEQUEUE">Add Agent to voiceQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin">\n        <label translate="VOICE.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n  <form name="voiceQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <md-input-container flex class="no-margin">\n        <label translate="VOICE.PENALTY">Penalty</label>\n        <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n        <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n          </div>\n        </div>\n      </md-input-container>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/view.html",'<div id="voice-voiceQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-voiceQueues-button md-icon-button" aria-label="Go to voiceQueues" ng-click="vm.gotoVoiceQueues()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="voiceQueue-image" hide-xs>\n          <img ng-src="assets/images/business/voiceQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.voiceQueue.id}}\n            <span ng-if="vm.voiceQueue.name">{{vm.voiceQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.voiceQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="VOICE.TEAMADD_VOICEQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.voiceQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="VOICE.AGENTADD_VOICEQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.gotogoto(vm.voiceQueue, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n        <md-tooltip><span translate="VOICE.GOTO_VOICEQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-cast"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveVoiceQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (settingsForm.$invalid) || (announcementsForm.$invalid) || (advancedForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'ringall\'">Ringall</md-option>\n                  <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n                  <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n                  <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n                  <md-option ng-value="\'random\'">Random</md-option>\n                  <md-option ng-value="\'linear\'">Linear</md-option>\n                  <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.TIMEOUT">Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.voiceQueue.timeout" min="0" value="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.TIMEOUT"></span></div>\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MAXLENGTH">MaxLength</label>\n                <input type="number" name="maxlen" ng-model="vm.voiceQueue.maxlen" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.MAXLENGTH"></span></div>\n                <div ng-messages="generalForm[\'maxlen\'].$error" ng-show="generalForm[\'maxlen\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MAXLENGTH_REQUIRED">MaxLength field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxLength must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RETRY">Retry</label>\n                <input type="number" name="retry" ng-model="vm.voiceQueue.retry" min="0" value="2" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.RETRY"></span></div>\n                <div ng-messages="generalForm[\'retry\'].$error" ng-show="generalForm[\'retry\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.WRAPUPTIME">WrapupTime</label>\n                <input type="number" name="wrapuptime" ng-model="vm.voiceQueue.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.WRAPUPTIME"></span></div>\n                <div ng-messages="generalForm[\'wrapuptime\'].$error" ng-show="generalForm[\'wrapuptime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.WEIGHT">Weight</label>\n                <input type="number" name="weight" ng-model="vm.voiceQueue.weight" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.WEIGHT"></span></div>\n                <div ng-messages="generalForm[\'weight\'].$error" ng-show="generalForm[\'weight\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.JOINWHENEMPTY">JoinWhenEmpty</label>\n                <md-select name="joinempty" ng-model="vm.voiceQueue.joinempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'no\'" ng-disabled="vm.voiceQueue.joinempty.length === 1  && vm.voiceQueue.joinempty[0] === \'no\'">no</md-option>\n                  <md-option ng-value="\'yes\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'yes\'">yes</md-option>\n                  <md-option ng-value="\'strict\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'strict\'">strict</md-option>\n                  <md-option ng-value="\'loose\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'loose\'">loose</md-option>\n                  <md-option ng-value="\'paused\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'paused\'">paused</md-option>\n                  <md-option ng-value="\'penalty\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'penalty\'">penalty</md-option>\n                  <md-option ng-value="\'inuse\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'inuse\'">inuse</md-option>\n                  <md-option ng-value="\'ringing\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'ringing\'">ringing</md-option>\n                  <md-option ng-value="\'unavailable\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'unavailable\'">unavailable</md-option>\n                  <md-option ng-value="\'invalid\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'invalid\'">invalid</md-option>\n                  <md-option ng-value="\'unknown\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'unknown\'">unknown</md-option>\n                  <md-option ng-value="\'wrapup\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'wrapup\'">wrapup</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.JOINWHENEMPTY"></span></div>\n                <div ng-messages="generalForm[\'joinempty\'].$error" ng-show="generalForm[\'joinempty\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.JOINWHENEMPTY_REQUIRED">JoinWhenEmpty field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.LEAVEWHENEMPTY">LeaveWhenEmpty</label>\n                <md-select name="leavewhenempty" ng-model="vm.voiceQueue.leavewhenempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'no\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'no\'">no</md-option>\n                  <md-option ng-value="\'yes\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'yes\'">yes</md-option>\n                  <md-option ng-value="\'strict\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'strict\'">strict</md-option>\n                  <md-option ng-value="\'loose\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'loose\'">loose</md-option>\n                  <md-option ng-value="\'paused\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'paused\'">paused</md-option>\n                  <md-option ng-value="\'penalty\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'penalty\'">penalty</md-option>\n                  <md-option ng-value="\'inuse\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'inuse\'">inuse</md-option>\n                  <md-option ng-value="\'ringing\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'ringing\'">ringing</md-option>\n                  <md-option ng-value="\'unavailable\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'unavailable\'">unavailable</md-option>\n                  <md-option ng-value="\'invalid\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'invalid\'">invalid</md-option>\n                  <md-option ng-value="\'unknown\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'unknown\'">unknown</md-option>\n                  <md-option ng-value="\'wrapup\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'wrapup\'">wrapup</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.LEAVEWHENEMPTY"></span></div>\n                <div ng-messages="generalForm[\'leavewhenempty\'].$error" ng-show="generalForm[\'leavewhenempty\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.LEAVEWHENEMPTY_REQUIRED">LeaveWhenEmpty field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MUSICONHOLD">MusicOnHold</label>\n                <md-select name="musiconhold" ng-model="vm.voiceQueue.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MUSICONHOLD"></span></div>\n                <div ng-messages="generalForm[\'musiconhold\'].$error" ng-show="generalForm[\'musiconhold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCETOAGENT">AnnounceToAgent</label>\n                <md-select name="announce" ng-model="vm.voiceQueue.announce" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'FALSE\'">None</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + announce.save_name" ng-repeat="announce in vm.sounds" ng-disabled="announce.canSelect === false">{{ announce.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCETOAGENT"></span></div>\n                <div ng-messages="generalForm[\'announce\'].$error" ng-show="generalForm[\'announce\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCETOAGENT_REQUIRED">AnnounceToAgent field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.voiceQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceQueue-detail-form-container settings md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.SETTINGS">SETTINGS</div>\n            </div>\n            <form name="settingsForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCEFREQUENCY">AnnounceFrequency</label>\n                <input type="number" name="announce_frequency" ng-model="vm.voiceQueue.announce_frequency" min="0" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCEFREQUENCY"></span></div>\n                <div ng-messages="settingsForm[\'announce_frequency\'].$error" ng-show="settingsForm[\'announce_frequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_REQUIRED">AnnounceFrequency field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MINANNOUNCEFREQUENCY">MinAnnounceFrequency</label>\n                <input type="number" name="min_announce_frequency" ng-model="vm.voiceQueue.min_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.MINANNOUNCEFREQUENCY"></span></div>\n                <div ng-messages="settingsForm[\'min_announce_frequency\'].$error" ng-show="settingsForm[\'min_announce_frequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_REQUIRED">MinAnnounceFrequency field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MinAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PERIODICANNOUNCEFREQUENCY">PeriodicAnnounceFrequency</label>\n                <input type="number" name="periodic_announce_frequency" ng-model="vm.voiceQueue.periodic_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCEFREQUENCY"></span></div>\n                <div ng-messages="settingsForm[\'periodic_announce_frequency\'].$error" ng-show="settingsForm[\'periodic_announce_frequency\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_REQUIRED">PeriodicAnnounceFrequency field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">PeriodicAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RANDOMPERIODICANNOUNCE">RandomPeriodicAnnounce</label>\n                <md-select name="random_periodic_announce" ng-model="vm.voiceQueue.random_periodic_announce" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.RANDOMPERIODICANNOUNCE"></span></div>\n                <div ng-messages="settingsForm[\'random_periodic_announce\'].$error" ng-show="settingsForm[\'random_periodic_announce\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RANDOMPERIODICANNOUNCE_REQUIRED">RandomPeriodicAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCEHOLDTIME">AnnounceHoldtime</label>\n                <md-select name="announce_holdtime" ng-model="vm.voiceQueue.announce_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'once\'">Once</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCEHOLDTIME"></span></div>\n                <div ng-messages="settingsForm[\'announce_holdtime\'].$error" ng-show="settingsForm[\'announce_holdtime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCEHOLDTIME_REQUIRED">AnnounceHoldtime field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCECALLERPOSITION">AnnounceCallerPosition</label>\n                <md-select name="announce_position" ng-model="vm.voiceQueue.announce_position" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'yes\'">Yes</md-option>\n                  <md-option ng-value="\'no\'">No</md-option>\n                  <md-option ng-value="\'limit\'">Limit</md-option>\n                  <md-option ng-value="\'more\'">More</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCECALLERPOSITION"></span></div>\n                <div ng-messages="settingsForm[\'announce_position\'].$error" ng-show="settingsForm[\'announce_position\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCECALLERPOSITION_REQUIRED">AnnounceCallerPosition field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ANNOUNCEPOSITIONLIMIT">AnnouncePositionLimit</label>\n                <input type="number" name="announce_position_limit" ng-model="vm.voiceQueue.announce_position_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.ANNOUNCEPOSITIONLIMIT"></span></div>\n                <div ng-messages="settingsForm[\'announce_position_limit\'].$error" ng-show="settingsForm[\'announce_position_limit\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ANNOUNCEPOSITIONLIMIT_REQUIRED">AnnouncePositionLimit field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.REPORTHOLDTIMEAGENT">ReportHoldtimeAgent</label>\n                <md-select name="reportholdtime" ng-model="vm.voiceQueue.reportholdtime" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.REPORTHOLDTIMEAGENT"></span></div>\n                <div ng-messages="settingsForm[\'reportholdtime\'].$error" ng-show="settingsForm[\'reportholdtime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.REPORTHOLDTIMEAGENT_REQUIRED">ReportHoldtimeAgent field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="voiceQueue-detail-form-container announcements md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</div>\n            </div>\n            <form name="announcementsForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.PERIODICANNOUNCE">PeriodicAnnounce</label>\n                <md-select name="periodic_announce" ng-model="vm.voiceQueue.periodic_announce" autofocus multiple ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Default</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + periodic_announce.save_name" ng-repeat="periodic_announce in vm.sounds" ng-disabled="periodic_announce.canSelect === false">{{ periodic_announce.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'periodic_announce\'].$error" ng-show="announcementsForm[\'periodic_announce\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.PERIODICANNOUNCE_REQUIRED">PeriodicAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.HOLDTIMEANNOUNCE">HoldTimeAnnounce</label>\n                <md-select name="queue_reporthold" ng-model="vm.voiceQueue.queue_reporthold" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_reporthold.save_name" ng-repeat="queue_reporthold in vm.sounds" ng-disabled="queue_reporthold.canSelect === false">{{ queue_reporthold.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.HOLDTIMEANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_reporthold\'].$error" ng-show="announcementsForm[\'queue_reporthold\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.HOLDTIMEANNOUNCE_REQUIRED">HoldTimeAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.YOUARENEXTANNOUNCE">YouareNextAnnounce</label>\n                <md-select name="queue_youarenext" ng-model="vm.voiceQueue.queue_youarenext" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_youarenext.save_name" ng-repeat="queue_youarenext in vm.sounds" ng-disabled="queue_youarenext.canSelect === false">{{ queue_youarenext.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.YOUARENEXTANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_youarenext\'].$error" ng-show="announcementsForm[\'queue_youarenext\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.YOUARENEXTANNOUNCE_REQUIRED">YouareNextAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.THEREAREANNOUNCE">ThereareAnnounce</label>\n                <md-select name="queue_thereare" ng-model="vm.voiceQueue.queue_thereare" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thereare.save_name" ng-repeat="queue_thereare in vm.sounds" ng-disabled="queue_thereare.canSelect === false">{{ queue_thereare.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.THEREAREANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_thereare\'].$error" ng-show="announcementsForm[\'queue_thereare\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.THEREAREANNOUNCE_REQUIRED">ThereareAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.WAITINGCALLSANNOUNCE">WaitingCallsAnnounce</label>\n                <md-select name="queue_callswaiting" ng-model="vm.voiceQueue.queue_callswaiting" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_callswaiting.save_name" ng-repeat="queue_callswaiting in vm.sounds" ng-disabled="queue_callswaiting.canSelect === false">{{ queue_callswaiting.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.WAITINGCALLSANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_callswaiting\'].$error" ng-show="announcementsForm[\'queue_callswaiting\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.WAITINGCALLSANNOUNCE_REQUIRED">WaitingCallsAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.ESTIMATEDHOLDTIMEANNOUNCE">EstimatedHoldTimeAnnounce</label>\n                <md-select name="queue_holdtime" ng-model="vm.voiceQueue.queue_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_holdtime.save_name" ng-repeat="queue_holdtime in vm.sounds" ng-disabled="queue_holdtime.canSelect === false">{{ queue_holdtime.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.ESTIMATEDHOLDTIMEANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_holdtime\'].$error" ng-show="announcementsForm[\'queue_holdtime\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.ESTIMATEDHOLDTIMEANNOUNCE_REQUIRED">EstimatedHoldTimeAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MINUTESANNOUNCE">MinutesAnnounce</label>\n                <md-select name="queue_minutes" ng-model="vm.voiceQueue.queue_minutes" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minutes.save_name" ng-repeat="queue_minutes in vm.sounds" ng-disabled="queue_minutes.canSelect === false">{{ queue_minutes.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MINUTESANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_minutes\'].$error" ng-show="announcementsForm[\'queue_minutes\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MINUTESANNOUNCE_REQUIRED">MinutesAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MINUTEANNOUNCE">MinuteAnnounce</label>\n                <md-select name="queue_minute" ng-model="vm.voiceQueue.queue_minute" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minute.save_name" ng-repeat="queue_minute in vm.sounds" ng-disabled="queue_minute.canSelect === false">{{ queue_minute.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MINUTEANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_minute\'].$error" ng-show="announcementsForm[\'queue_minute\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MINUTEANNOUNCE_REQUIRED">MinuteAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SECONDSANNOUNCE">SecondsAnnounce</label>\n                <md-select name="queue_seconds" ng-model="vm.voiceQueue.queue_seconds" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_seconds.save_name" ng-repeat="queue_seconds in vm.sounds" ng-disabled="queue_seconds.canSelect === false">{{ queue_seconds.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.SECONDSANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_seconds\'].$error" ng-show="announcementsForm[\'queue_seconds\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SECONDSANNOUNCE_REQUIRED">SecondsAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.THANKYOUANNOUNCE">ThankYouAnnounce</label>\n                <md-select name="queue_thankyou" ng-model="vm.voiceQueue.queue_thankyou" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">Default</md-option>\n                  <md-option ng-value="\'\'">Disabled</md-option>\n                  <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thankyou.save_name" ng-repeat="queue_thankyou in vm.sounds" ng-disabled="queue_thankyou.canSelect === false">{{ queue_thankyou.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.THANKYOUANNOUNCE"></span></div>\n                <div ng-messages="announcementsForm[\'queue_thankyou\'].$error" ng-show="announcementsForm[\'queue_thankyou\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.THANKYOUANNOUNCE_REQUIRED">ThankYouAnnounce field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceQueue-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n            </div>\n            <form name="advancedForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.voiceQueue.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.AFTERCALLWORK">AfterCallWork</span></md-switch>\n                <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORK"></span></div>\n              </md-input-container>\n              <md-input-container ng-if="vm.voiceQueue.acw" class="md-block">\n                <label translate="VOICE.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n                <input type="number" name="acwTimeout" ng-model="vm.voiceQueue.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORKDURATION"></span></div>\n                <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.AUTOPAUSE">AutoPause</label>\n                <md-select name="autopause" ng-model="vm.voiceQueue.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'all\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.AUTOPAUSE"></span></div>\n                <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RINGINUSE">RingInUse</label>\n                <md-select name="ringinuse" ng-model="vm.voiceQueue.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.RINGINUSE"></span></div>\n                <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MEMBERDELAY">MemberDelay</label>\n                <input type="number" name="memberdelay" ng-model="vm.voiceQueue.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.MEMBERDELAY"></span></div>\n                <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.TIMEOUTRESTART">TimeoutRestart</label>\n                <md-select name="timeoutrestart" ng-model="vm.voiceQueue.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.TIMEOUTRESTART"></span></div>\n                <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.MONITORFORMAT">MonitorFormat</label>\n                <md-select name="monitor_format" ng-model="vm.voiceQueue.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'\'">Inactive</md-option>\n                  <md-option ng-value="\'wav\'">wav</md-option>\n                  <md-option ng-value="\'wav49\'">wav49</md-option>\n                  <md-option ng-value="\'gsm\'">gsm</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MONITORFORMAT"></span></div>\n                <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONTEXT">Context</label>\n                <input type="text" name="context" ng-model="vm.voiceQueue.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.CONTEXT"></span></div>\n                <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n                <md-select name="setinterfacevar" ng-model="vm.voiceQueue.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.SETINTERFACEVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SETQUEUEVARIABLES">SetQueueVariables</label>\n                <md-select name="setqueuevar" ng-model="vm.voiceQueue.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.SETQUEUEVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n                <md-select name="setqueueentryvar" ng-model="vm.voiceQueue.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n                  <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n                  <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n                <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SERVICELEVEL">ServiceLevel</label>\n                <input type="number" name="servicelevel" ng-model="vm.voiceQueue.servicelevel" min="0" max="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="VOICE.HELP.SERVICELEVEL"></span></div>\n                <div ng-messages="advancedForm[\'servicelevel\'].$error" ng-show="advancedForm[\'servicelevel\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SERVICELEVEL_REQUIRED">ServiceLevel field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="VOICE.ERRORS.SERVICELEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ServiceLevel must be a valid greater or equal than</span> <span>0</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="VOICE.ERRORS.SERVICELEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO">ServiceLevel must be a valid greater or equal than</span> <span>100</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.voiceQueue.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.voiceQueue.mandatoryDisposition" class="md-block">\n                <label translate="VOICE.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.voiceQueue.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="VOICE.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/voiceQueues.html",'<div id="voiceQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.VOICEQUEUES">VoiceQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVoiceQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVoiceQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-voiceQueues-count">\n          <span>{{vm.selectedVoiceQueues.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVoiceQueues()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVoiceQueues()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceQueues" csv-label="true" filename="voiceQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceQueues($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VOICEQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVoiceQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'VOICE.STRATEGY\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.voiceQueues.rows.length">\n                <td md-cell colspan="5">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="voiceQueue" md-select-id="id" ng-repeat="voiceQueue in vm.voiceQueues.rows">\n                <td md-cell ng-if="voiceQueue.userpic"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="api/users/{{voiceQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!voiceQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="id ">{{voiceQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="name ">{{voiceQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="strategy ">{{ vm.arraystrategy[voiceQueue.strategy].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="description ">{{voiceQueue.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(voiceQueue, $event    )" translate="VOICE.EDIT_VOICEQUEUE">\n                          Edit VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(voiceQueue, $event    )" translate="VOICE.TEAMADD_VOICEQUEUE">\n                          teamadd VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(voiceQueue, $event    )" translate="VOICE.AGENTADD_VOICEQUEUE">\n                          agentadd VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(voiceQueue, $event    )" translate="VOICE.DELETE_VOICEQUEUE">\n                          Delete VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(voiceQueue, $event    )" translate="VOICE.GOTOREALTIME_VOICEQUEUE">\n                          goToRealtime VoiceQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VOICEQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD VOICEQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voiceQueue-button" ng-click="vm.createOrEditVoiceQueue($event)" aria-label="add voiceQueue" translate translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD VOICEQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/create/dialog.html",'<md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">\n  <form name="voiceRecordingForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="VOICE.RATING">Rating</label>\n        <md-select name="rating" ng-model="vm.voiceRecording.rating" autofocus ng-disabled="!vm.newVoiceRecording && !vm.crudPermissions.canEdit">\n          <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n          <md-option value="1">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n          </md-option>\n          <md-option value="2">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n          </md-option>\n          <md-option value="3">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n          </md-option>\n          <md-option value="4">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n          </md-option>\n          <md-option value="5">\n            <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n          </md-option>\n        </md-select>\n        <div ng-messages="voiceRecordingForm[\'rating\'].$error" ng-show="voiceRecordingForm[rating].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceRecording" ng-click="vm.saveVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceRecording" ng-click="vm.addNewVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICERECORDING" translate-attr-aria-label="VOICE.ADD_VOICERECORDING">\n          ADD VOICERECORDING\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceRecording" ng-click="vm.deleteVoiceRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceRecordings/edit/view.html",'<div id="voice-voiceRecording" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-voiceRecordings-button md-icon-button" aria-label="Go to voiceRecordings" ng-click="vm.gotoVoiceRecordings()" translate translate-attr-aria-label="VOICE.GO_TO_VOICERECORDINGS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="voiceRecording-image" hide-xs>\n          <img ng-src="assets/images/business/voiceRecordings.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.voiceRecording.id}}\n            <span ng-if="vm.voiceRecording.name">{{vm.voiceRecording.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceRecording.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveVoiceRecording()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(voiceRecordingsForm.$invalid) || (transcriptForm.$invalid) || (sentimentAnalysisForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="VOICE.GENERAL">GENERAL</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceRecording-detail-form-container voicerecordings md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.VOICERECORDINGS">VOICERECORDINGS</div>\n            </div>\n            <form name="voiceRecordingsForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="VOICE.TYPE">Type</label>\n                <input type="" name="type" ng-model="vm.voiceRecording.type" autofocus disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'type\'].$error" ng-show="voiceRecordingsForm[\'type\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.UNIQUEID">UniqueId</label>\n                <input type="" name="uniqueid" ng-model="vm.voiceRecording.uniqueid" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'uniqueid\'].$error" ng-show="voiceRecordingsForm[\'uniqueid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.UNIQUEID_REQUIRED">UniqueId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CALLER">Caller</label>\n                <input type="" name="calleridnum" ng-model="vm.voiceRecording.calleridnum" privacy="vm.userProfile.privacyEnabled" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'calleridnum\'].$error" ng-show="voiceRecordingsForm[\'calleridnum\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CALLER_REQUIRED">Caller field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CALLED">Called</label>\n                <input type="" name="exten" ng-model="vm.voiceRecording.exten" privacy="vm.userProfile.privacyEnabled" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'exten\'].$error" ng-show="voiceRecordingsForm[\'exten\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CALLED_REQUIRED">Called field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.CONNECTED">Connected</label>\n                <input type="" name="connectedlinenum" ng-model="vm.voiceRecording.connectedlinenum" privacy="vm.userProfile.privacyEnabled" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'connectedlinenum\'].$error" ng-show="voiceRecordingsForm[\'connectedlinenum\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.CONNECTED_REQUIRED">Connected field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.QUEUE">Queue</label>\n                <input type="" name="queue" ng-model="vm.voiceRecording.queue" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'queue\'].$error" ng-show="voiceRecordingsForm[\'queue\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.AGENT">Agent</label>\n                <input type="text" name="membername" ng-model="vm.voiceRecording.membername" privacy="vm.userProfile.privacyEnabled" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'membername\'].$error" ng-show="voiceRecordingsForm[\'membername\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.RATING">Rating</label>\n                <md-select name="rating" ng-model="vm.voiceRecording.rating" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n                  <md-option value="1">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n                  </md-option>\n                  <md-option value="2">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n                  </md-option>\n                  <md-option value="3">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n                  </md-option>\n                  <md-option value="4">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n                  </md-option>\n                  <md-option value="5">\n                    <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n                  </md-option>\n                </md-select>\n                <div ng-messages="voiceRecordingsForm[\'rating\'].$error" ng-show="voiceRecordingsForm[rating].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.DISPOSITION">Disposition</label>\n                <input type="text" name="userDisposition" ng-model="vm.voiceRecording.userDisposition" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'userDisposition\'].$error" ng-show="voiceRecordingsForm[\'userDisposition\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.SECOND_LEVEL_DISPOSITION">Second_Level_Disposition</label>\n                <input type="text" name="userSecondDisposition" ng-model="vm.voiceRecording.userSecondDisposition" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'userSecondDisposition\'].$error" ng-show="voiceRecordingsForm[\'userSecondDisposition\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.SECOND_LEVEL_DISPOSITION_REQUIRED">Second_Level_Disposition field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="VOICE.THIRD_LEVEL_DISPOSITION">Third_Level_Disposition</label>\n                <input type="text" name="userThirdDisposition" ng-model="vm.voiceRecording.userThirdDisposition" disabled>\n\n                <div ng-messages="voiceRecordingsForm[\'userThirdDisposition\'].$error" ng-show="voiceRecordingsForm[\'userThirdDisposition\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="VOICE.ERRORS.THIRD_LEVEL_DISPOSITION_REQUIRED">Third_Level_Disposition field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab ng-if="vm.license.ai">\n        <md-tab-label>\n          <span translate="VOICE.TRANSCRIPTANALYSIS">TRANSCRIPTANALYSIS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="voiceRecording-detail-form-container transcript md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="VOICE.TRANSCRIPT">TRANSCRIPT</div>\n            </div>\n            <form name="transcriptForm" novalidate>\n              <md-input-container ng-if="vm.voiceRecording.transcribeStatus == \'COMPLETED\'" class="md-block">\n                <label translate="VOICE.TEXT">Text</label>\n                <textarea name="fileText" ng-model="vm.voiceRecording.fileText" autofocus ng-disabled="true"></textarea>\n              </md-input-container>\n              <md-input-container ng-if="vm.voiceRecording.transcribeStatus == \'FAILED\'" class="md-block">\n                <label translate="VOICE.FAILUREREASON">FailureReason</label>\n                <textarea name="failureReason" ng-model="vm.voiceRecording.failureReason" ng-disabled="true"></textarea>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="voiceRecording-detail-form-container sentimentanalysis md-background-bg md-whiteframe-1dp">\n            <div ng-controller="VoiceRecordingSentimentStatisticsController as vm_ss" ng-init="vm_ss.init(vm.voiceRecording)">\n              <md-toolbar class="md-table-toolbar md-default">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="VOICE.SENTIMENTANALYSIS" style="width: 50px;">Sentiment Analysis</span>\n                  <div flex></div>\n                </div>\n              </md-toolbar>\n\n              \x3c!-- WIDGET GROUP --\x3e\n              <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n                \x3c!-- WIDGET 1 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8 sentiment" ng-class="vm_ss.voiceRecording.sentiment">\n                        {{vm_ss.voiceRecording.sentiment}}\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 1 --\x3e\n\n                \x3c!-- WIDGET 2 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">\n                        ({{ (vm_ss.voiceRecording.sPositive || 0) * 100 | number: 2  }}%)\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT_POSITIVE\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 2 --\x3e\n\n                \x3c!-- WIDGET 3 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">\n                        ({{ (vm_ss.voiceRecording.sNegative || 0) * 100 | number: 2  }}%)\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT_NEGATIVE\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 3 --\x3e\n\n                \x3c!-- WIDGET 4 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">\n                        ({{ (vm_ss.voiceRecording.sNeutral || 0) * 100 | number: 2  }}%)\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT_NEUTRAL\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 4 --\x3e\n\n                \x3c!-- WIDGET 5 --\x3e\n                <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n                  \x3c!-- Front --\x3e\n                  <ms-widget-front class="p-16 white-bg" layout="row" flex>\n                    <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n                      <div class="md-display-1 pb-8">\n                        ({{ (vm_ss.voiceRecording.sMixed || 0) * 100 | number: 2  }}%)\n                      </div>\n                      <div class="font-weight-500 secondary-text">\n                        {{ \'VOICE.SENTIMENT_MIXED\' | translate | uppercase }}\n                      </div>\n                    </div>\n                  </ms-widget-front>\n                  \x3c!-- / Front --\x3e\n                </ms-widget>\n                \x3c!-- / WIDGET 5 --\x3e\n\n              </div>\n              \x3c!-- / WIDGET GROUP --\x3e\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",'<div id="voiceRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="VOICE.VOICERECORDINGS">VoiceRecordings</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n      <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceRecordings()"></ms-quick-filter>\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedVoiceRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedVoiceRecordings =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="VOICE.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-voiceRecordings-count">\n          <span>{{vm.selectedVoiceRecordings.length}}</span>\n          <span translate="VOICE.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllVoiceRecordings()" translate="VOICE.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectVoiceRecordings()" translate="VOICE.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceRecordings" csv-label="true" filename="voiceRecordings.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runtranscribesentimentSelectedVoiceRecordings($event)" aria-label="transcribesentiment selected" translate translate-attr-label="VOICERECORDINGS.TRANSCRIBESENTIMENT_SELECTED">\n          <md-icon md-font-icon="icon-text-to-speech"></md-icon>\n          <md-tooltip>{{\'VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runtranscribeSelectedVoiceRecordings($event)" aria-label="transcribe selected" translate translate-attr-label="VOICERECORDINGS.TRANSCRIBE_SELECTED">\n          <md-icon md-font-icon="icon-format-size"></md-icon>\n          <md-tooltip>{{\'VOICE.RUNTRANSCRIBE_VOICERECORDING\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runsentimentSelectedVoiceRecordings($event)" aria-label="transcribe selected" translate translate-attr-label="VOICERECORDINGS.SENTIMENT_SELECTED">\n          <md-icon md-font-icon="icon-heart-outline"></md-icon>\n          <md-tooltip>{{\'VOICE.RUNSENTIMENT_VOICERECORDING\' | translate}}</md-tooltip>\n        </md-button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceRecordings($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- VOICERECORDING TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedVoiceRecordings" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n                <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n                <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n                <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n                <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n                <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n                <th md-column md-order-by="membername">{{ \'VOICE.AGENT\' | translate }}</th>\n                <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n                <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n                <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n                <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n                <th md-column md-order-by="userSecondDisposition">{{ \'VOICE.SECOND_LEVEL_DISPOSITION\' | translate }}</th>\n                <th md-column md-order-by="userThirdDisposition">{{ \'VOICE.THIRD_LEVEL_DISPOSITION\' | translate }}</th>\n                <th md-column md-order-by="transcribeStatus" ng-if="vm.license.ai">{{ \'VOICE.TRANSCRIBE\' | translate }}</th>\n                <th md-column md-order-by="sentiment" ng-if="vm.license.ai">{{ \'VOICE.SENTIMENTANALYSIS\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n                <td md-cell colspan="16">\n                  <div layout="row" layout-align="center center">\n                    <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="voiceRecording" md-select-id="id" ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n                <td md-cell ng-if="voiceRecording.userpic"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="api/users/{{voiceRecording.id}}/avatar" /></td>\n                <td md-cell ng-if="!voiceRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="type ">{{voiceRecording.type}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="uniqueid ">{{voiceRecording.uniqueid}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="calleridnum " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.calleridnum}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="exten " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.exten}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="connectedlinenum " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.connectedlinenum}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="queue ">{{voiceRecording.queue}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="membername " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.membername}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="rating ">\n                  <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n                </td>\n                <td md-cell class="audio " ng-switch="voiceRecording.format">\n                  \x3c!-- audio recording directive --\x3e\n                  <ms-recording ng-switch-when=".wav" id="voiceRecording.id" model="\'voiceRecording\'"></ms-recording>\n                  \x3c!-- / audio recording directive --\x3e\n                  <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n                    <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n                  </span>\n                </td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userDisposition ">{{voiceRecording.userDisposition}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userSecondDisposition ">{{voiceRecording.userSecondDisposition}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userThirdDisposition ">{{voiceRecording.userThirdDisposition}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="transcribeStatus " ng-if="vm.license.ai">{{ \'VOICE.TRANSCRIBESTATUS_\' + voiceRecording.transcribeStatus | translate}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="sentiment " ng-if="vm.license.ai">{{voiceRecording.sentiment}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(voiceRecording, $event    )" translate="VOICE.EDIT_VOICERECORDING">\n                          Edit VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="voiceRecording.transcribeStatus == \'NEW\' && vm.license.ai">\n\n                        <md-button ng-click="vm.runtranscriberuntranscribesentiment(voiceRecording, $event    )" translate="VOICE.RUNTRANSCRIBE_VOICERECORDING">\n                          RunTranscribe VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="voiceRecording.transcribeStatus == \'NEW\' && vm.license.ai">\n\n                        <md-button ng-click="vm.runtranscribesentimentruntranscribesentiment(voiceRecording, $event    )" translate="VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING">\n                          RunTranscribeSentiment VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\' && voiceRecording.sentiment == null && vm.license.ai">\n\n                        <md-button ng-click="vm.runsentimentruntranscribesentiment(voiceRecording, $event    )" translate="VOICE.RUNSENTIMENT_VOICERECORDING">\n                          RunSentiment VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\' && vm.license.ai">\n\n                        <md-button ng-click="vm.downloadtranscribefile2(voiceRecording, $event    )" translate="VOICE.DOWNLOADTRANSCRIBE_VOICERECORDING">\n                          DownloadTranscribe VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadVoiceRecordings">\n\n                        <md-button ng-click="vm.downloadfile2(voiceRecording, $event  , \'voice/recordings\'   )" translate="VOICE.DOWNLOAD_VOICERECORDING">\n                          Download VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(voiceRecording, $event    )" translate="VOICE.DELETE_VOICERECORDING">\n                          Delete VoiceRecording\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / VOICERECORDING TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/realtime/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n  <div class="md-toolbar-tools">\n    <span class="md-subhead" translate="WHATSAPP.QUEUES">Queues</span>\n    <div flex></div>\n    <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n  </div>\n</md-toolbar>\n<md-table-container>\n  <table md-table multiple md-progress="vm.promise">\n    <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n      <tr md-row>\n        <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n        <th md-column>{{ \'WHATSAPP.LOGGED_IN\' | translate }}</th>\n        <th md-column>{{ \'DASHBOARDS.AVAILABLE\' | translate }}</th>\n        <th md-column>{{ \'WHATSAPP.PAUSED\' | translate }}</th>\n        <th md-column>{{ \'WHATSAPP.WAITING\' | translate }}</th>\n        <th md-column width="10px"></th>\n      </tr>\n    </thead>\n    <tbody md-body>\n      <tr md-row ng-hide="vm.queues.count > 0">\n        <td md-cell colspan="7">\n          <div layout="row" layout-align="center center">\n            <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n          </div>\n        </td>\n      </tr>\n      <tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n        <td md-cell>{{queue.name}}</td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n        </td>\n        <td md-cell>\n          <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n        </td>\n        <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n          <md-menu>\n            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n            </md-button>\n            <md-menu-content width="3">\n              <md-menu-item>\n                <md-button ng-click="vm.editQueue($event, queue)" translate="WHATSAPP.EDIT_QUEUE">\n                  Edit Queue\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click="vm.addAgent($event, queue)" translate="WHATSAPP.AGENTSADD_QUEUE">\n                  Add Agents to queue\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/whatsapp/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.AGENTS">Agents</span>\n        </md-tab-label>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.QUEUES">Queues</span>\n        </md-tab-label>\n      </md-tab>\n    </md-tabs>\n\n    <md-card ui-view></md-card>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/create/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.whatsappAccount.name" ng-required="true" autofocus ng-disabled="!vm.newWhatsappAccount">\n\n        <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n        <div ng-messages="whatsappAccountForm[\'name\'].$error" ng-show="whatsappAccountForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.KEY">key</label>\n        <input type="text" name="key" ng-model="vm.whatsappAccount.key" md-maxlength="5" ng-required="true">\n\n        <div ng-messages="whatsappAccountForm[\'key\'].$error" ng-show="whatsappAccountForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">key field is required</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.LIST">List</label>\n        <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required>\n          <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n        </md-select>\n        <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>\n        <div ng-messages="whatsappAccountForm[\'ListId\'].$error" ng-show="whatsappAccountForm[\'ListId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.LIST_REQUIRED">List field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>\n        <input type="url" name="remote" ng-model="vm.whatsappAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n        <div class="hint"><span translate="WHATSAPP.HELP.MOTIONPROXY"></span></div>\n        <div ng-messages="whatsappAccountForm[\'remote\'].$error" ng-show="whatsappAccountForm[\'remote\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n          </div>\n          <div ng-message="url">\n            <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n          </div>\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TYPE">Type</label>\n        <md-select name="type" ng-model="vm.whatsappAccount.type">\n          <md-option ng-value="\'twilio\'">Twilio</md-option>\n          <md-option ng-value="\'sinch\'">Sinch</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountForm[\'type\'].$error" ng-show="whatsappAccountForm[\'type\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TYPE_REQUIRED">Type field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n        <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>\n        <input type="text" name="accountSid" ng-model="vm.whatsappAccount.accountSid" ng-required="true">\n\n        <div ng-messages="whatsappAccountForm[\'accountSid\'].$error" ng-show="whatsappAccountForm[\'accountSid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n        <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>\n        <input type="text" name="authToken" ng-model="vm.whatsappAccount.authToken" ng-required="true">\n\n        <div ng-messages="whatsappAccountForm[\'authToken\'].$error" ng-show="whatsappAccountForm[\'authToken\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container ng-if="vm.whatsappAccount.type == \'sinch\'" class="md-block">\n        <label translate="WHATSAPP.BASEURL">Base URL</label>\n\n        \x3c!--    <input type="text" name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" ng-required="true"> --\x3e\n\n        <md-select name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" required>\n          <md-option ng-value="\'https://us1.whatsapp.api.sinch.com\'">US Production</md-option>\n          <md-option ng-value="\'https://eu1.whatsapp.api.sinch.com\'">EU Production</md-option>\n        </md-select>\n\n        <div ng-messages="whatsappAccountForm[\'authToken\'].$error" ng-show="whatsappAccountForm[\'authToken\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.PHONE">phone</label>\n        <input type="text" name="phone" ng-model="vm.whatsappAccount.phone" ng-required="true">\n        <div ng-messages="whatsappAccountForm[\'phone\'].$error" ng-show="whatsappAccountForm[\'phone\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED">phone field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.whatsappAccount.description">\n\n        <div ng-messages="whatsappAccountForm[\'description\'].$error" ng-show="whatsappAccountForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappAccount" ng-click="vm.saveWhatsappAccount()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountForm.$invalid || whatsappAccountForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappAccount" ng-click="vm.addNewWhatsappAccount()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPACCOUNT" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">\n          ADD WHATSAPPACCOUNT\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappAccount" ng-click="vm.deleteWhatsappAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",'<md-dialog class="whatsappAccount-dialog" aria-label="whatsappAccount" ng-init="vm.onInit()">\n  <form name="whatsappAccountForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">Add Agent to whatsappAccount</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/agent/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.AGENT">Agent</label>\n        <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'agent\'].$error" ng-show="whatsappAccountFormApp[\'agent\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'timeout\'].$error" ng-show="whatsappAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.ACCESSKEYID">accesskeyid</label>\n        <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'accesskeyid\'].$error" ng-show="whatsappAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.SECRETACCESSKEY">secretaccesskey</label>\n        <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'secretaccesskey\'].$error" ng-show="whatsappAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.LEXREGION">lexregion</label>\n        <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n          <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n          <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n          <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'lexregion\'].$error" ng-show="whatsappAccountFormApp[\'lexregion\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.BOTNAME">botname</label>\n        <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'botname\'].$error" ng-show="whatsappAccountFormApp[\'botname\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TIMES">times</label>\n        <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="2">One Time</md-option>\n          <md-option ng-value="0">Always</md-option>\n          <md-option ng-value="1">First Message</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'times\'].$error" ng-show="whatsappAccountFormApp[\'times\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TIMES_REQUIRED">times field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TEXT">Text</label>\n        <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n        <div ng-messages="whatsappAccountFormApp[\'text\'].$error" ng-show="whatsappAccountFormApp[\'text\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TEXT_REQUIRED">Text field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/close/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.DISPOSITION">Disposition</label>\n        <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'disposition\'].$error" ng-show="whatsappAccountFormApp[\'disposition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.KEY">Key</label>\n        <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'key\'].$error" ng-show="whatsappAccountFormApp[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n          <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'sv\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'language\'].$error" ng-show="whatsappAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n          </div>\n\n\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.PROJECTID">ProjectID</label>\n        <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'projectId\'].$error" ng-show="whatsappAccountFormApp[\'projectId\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.CLIENTEMAIL">ClientEmail</label>\n        <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'clientEmail\'].$error" ng-show="whatsappAccountFormApp[\'clientEmail\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.PRIVATEKEY">PrivateKey</label>\n        <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n        <div ng-messages="whatsappAccountFormApp[\'privateKey\'].$error" ng-show="whatsappAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.LANGUAGE">language</label>\n        <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n          <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n          <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n          <md-option ng-value="\'da\'">Danish</md-option>\n          <md-option ng-value="\'nl\'">Dutch</md-option>\n          <md-option ng-value="\'en\'">English</md-option>\n          <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n          <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n          <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n          <md-option ng-value="\'en-IN\'">English (India)</md-option>\n          <md-option ng-value="\'en-US\'">English (US)</md-option>\n          <md-option ng-value="\'fr\'">French</md-option>\n          <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n          <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n          <md-option ng-value="\'de\'">German</md-option>\n          <md-option ng-value="\'hi\'">Hindi</md-option>\n          <md-option ng-value="\'id\'">Indonesian</md-option>\n          <md-option ng-value="\'it\'">Italian</md-option>\n          <md-option ng-value="\'ja\'">Japanese</md-option>\n          <md-option ng-value="\'ko\'">Korean</md-option>\n          <md-option ng-value="\'no\'">Norwegian</md-option>\n          <md-option ng-value="\'pl\'">Polish</md-option>\n          <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n          <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n          <md-option ng-value="\'ru\'">Russian</md-option>\n          <md-option ng-value="\'es\'">Spanish</md-option>\n          <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n          <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n          <md-option ng-value="\'sw\'">Swedish</md-option>\n          <md-option ng-value="\'th\'">Thai</md-option>\n          <md-option ng-value="\'tr\'">Turkish</md-option>\n          <md-option ng-value="\'uk\'">Ukrainian</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'language\'].$error" ng-show="whatsappAccountFormApp[\'language\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n        <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n        <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n        <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n          <div ng-message="md-maxlength">\n            <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n          </div>\n\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.CONDITION">Condition</label>\n        <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'condition\'].$error" ng-show="whatsappAccountFormApp[\'condition\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TRUEPRIORITY">truepriority</label>\n        <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'truepriority\'].$error" ng-show="whatsappAccountFormApp[\'truepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.FALSEPRIORITY">falsepriority</label>\n        <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'falsepriority\'].$error" ng-show="whatsappAccountFormApp[\'falsepriority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.PRIORITY">Priority</label>\n        <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'priority\'].$error" ng-show="whatsappAccountFormApp[\'priority\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n  <form name="intervalForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n\n      <md-input-container class="md-block">\n        <label translate="TOOLS.TYPE">Type</label>\n        <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n        <label translate="TOOLS.INTERVALS">Intervals</label>\n        <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n          <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      \x3c!-- TIMERANGE START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <div class="md-block" flex>\n          <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n        <div class="md-block" flex ng-if="vm.timeRangeFrom">\n          <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n            <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n              <div ng-message="format">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n              </div>\n              <div ng-message="required">\n                <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n              </div>\n            </div>\n          </mdp-time-picker>\n        </div>\n      </div>\n      \x3c!-- TIMERANGE END --\x3e\n\n      \x3c!-- DAYSOFWEEK START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- DAYSOFWEEK END --\x3e\n\n      \x3c!-- MONTHDAY START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTHDAY END --\x3e\n\n      \x3c!-- MONTH START --\x3e\n      <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n      <div layout=row ng-if="vm.type === \'custom\'">\n        <md-input-container flex layout="column" class="md-block">\n          <label translate="TOOLS.FROM">From</label>\n          <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n\n        </md-input-container>\n\n        <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n          <label translate="TOOLS.TO">To</label>\n          <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n            <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n          </md-select>\n          <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n          </div>\n        </md-input-container>\n      </div>\n      \x3c!-- MONTH END --\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n          ADD INTERVAL\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/noop/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.VALUE">Value</label>\n        <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'value\'].$error" ng-show="whatsappAccountFormApp[\'value\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/queue/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.QUEUE">Queue</label>\n        <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'queue\'].$error" ng-show="whatsappAccountFormApp[\'queue\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TIMEOUT">Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'timeout\'].$error" ng-show="whatsappAccountFormApp[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n          </div>\n          <div ng-message="max">\n            <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/system/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.COMMAND">Command</label>\n        <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n        <div ng-messages="whatsappAccountFormApp[\'command\'].$error" ng-show="whatsappAccountFormApp[\'command\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.VARIABLE">Variable</label>\n        <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="\'\'">None</md-option>\n          <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'variable\'].$error" ng-show="whatsappAccountFormApp[\'variable\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/tag/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n  <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.TAG">Tag</label>\n        <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n          <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n        </md-select>\n        <div ng-messages="whatsappAccountFormApp[\'tag\'].$error" ng-show="whatsappAccountFormApp[\'tag\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.TAG_REQUIRED">Tag field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n        <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/view.html",'<div id="whatsapp-whatsappAccount" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-whatsappAccounts-button md-icon-button" aria-label="Go to whatsappAccounts" ng-click="vm.gotoWhatsappAccounts()" translate translate-attr-aria-label="WHATSAPP.GO_TO_WHATSAPPACCOUNTS">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="whatsappAccount-image" hide-xs>\n          <img ng-src="assets/images/business/whatsappAccounts.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.whatsappAccount.id}}\n            <span ng-if="vm.whatsappAccount.name">{{vm.whatsappAccount.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="WHATSAPP.CREATED_AT"></span> <span>{{vm.whatsappAccount.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.whatsappAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveWhatsappAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (whatsappDispositionsForm.$invalid) || (whatsappCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.whatsappAccount.name" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.KEY">key</label>\n                <input type="text" name="key" ng-model="vm.whatsappAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">key field is required</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.LIST">List</label>\n                <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>\n                <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.LIST_REQUIRED">List field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\'  || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n                <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>\n                <input type="text" name="accountSid" ng-model="vm.whatsappAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n              <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\'  || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n                <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>\n                <input type="text" name="authToken" ng-model="vm.whatsappAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n\n\n              <md-input-container ng-if="vm.whatsappAccount.type == \'sinch\'" class="md-block">\n                <label translate="WHATSAPP.BASEURL">BaseURL</label>\n\n                <md-select name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryBaseUrl.url" ng-repeat="mandatoryBaseUrl in vm.baseUrl" ng-disabled="mandatoryBaseUrl.canSelect === false">{{ mandatoryBaseUrl.name }}</md-option>\n                </md-select>\n\n                <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.BASEURL_REQUIRED">Base URL field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n\n\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.PHONE">phone</label>\n                <input type="text" name="phone" ng-model="vm.whatsappAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED">phone field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.RECEIVEURL">receiveUrl</label>\n\n                <div layout="row" layout-align="center center">\n                  <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\',  msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n                    <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n                  </button>\n                  <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.whatsappAccount.remote + \'/api/whatsapp/accounts/\' + vm.whatsappAccount.id + \'/notify?token=\' + vm.whatsappAccount.token" ng-readonly="true">\n                </div>\n                <div class="hint"><span translate="WHATSAPP.HELP.RECEIVEURL"></span></div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n                <input type="number" name="waitForTheAssignedAgent" ng-model="vm.whatsappAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.whatsappAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="whatsappAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.NOTIFICATION">NOTIFICATION</div>\n            </div>\n            <form name="notificationForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n              </md-input-container>\n              <div class="md-block">\n                <label class="md-caption grey-fg" translate="WHATSAPP.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n                <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\',  removePlugins: \'magicline\' }" ng-model="vm.whatsappAccount.notificationTemplate"></textarea>\n              </div>\n\n            </form>\n          </div>\n          <div class="whatsappAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.TRANSFER">TRANSFER</div>\n            </div>\n            <form name="transferForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.QUEUETRANSFER">queueTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.whatsappAccount.queueTransfer == true" class="md-block">\n                <label translate="WHATSAPP.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n                <input type="number" name="queueTransferTimeout" ng-model="vm.whatsappAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.AGENTTRANSFER">agentTransfer</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.whatsappAccount.agentTransfer == true" class="md-block">\n                <label translate="WHATSAPP.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n                <input type="number" name="agentTransferTimeout" ng-model="vm.whatsappAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.ADVANCED">ADVANCED</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.PROXY">PROXY</div>\n            </div>\n            <form name="proxyForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>\n                <input type="url" name="remote" ng-model="vm.whatsappAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div class="hint"><span translate="WHATSAPP.HELP.MOTIONPROXY"></span></div>\n                <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n                  </div>\n                  <div ng-message="url">\n                    <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n                  </div>\n                  <div ng-message="md-maxlength">\n                    <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.TOKEN">token</label>\n                <input type="text" name="token" ng-model="vm.whatsappAccount.token" disabled>\n\n                <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.TOKEN_REQUIRED">token field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n          <div class="whatsappAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.DISPOSITION">DISPOSITION</div>\n            </div>\n            <form name="dispositionForm" novalidate>\n              <md-input-container class="md-block">\n                <md-switch ng-model="vm.whatsappAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n              </md-input-container>\n              <md-input-container ng-if="vm.whatsappAccount.mandatoryDisposition" class="md-block">\n                <label translate="WHATSAPP.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n                <md-select name="mandatoryDispositionPauseId" ng-model="vm.whatsappAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n                </md-select>\n                <div class="hint"><span translate="WHATSAPP.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n                <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.DISPOSITIONS">DISPOSITIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div ng-controller="WhatsappAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions)">\n            <div layout="row">\n              <div class="column" flex="20">\n                <md-card class="mt-0">\n                  <md-card-content>\n                    <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n                      <div layout="row" layout-align="start center">\n                        <md-icon md-font-icon="icon-refresh"></md-icon>\n                        <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n                      </div>\n                    </button>\n                  </md-card-content>\n                </md-card>\n                <md-card>\n                  <md-card-content>\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n                      <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n                        <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n                        <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n                      </md-select>\n                    </md-input-container>\n                  </md-card-content>\n                </md-card>\n              </div>\n              <div class="whatsappAccount-detail-form-container whatsappdispositions md-background-bg md-whiteframe-1dp" flex="80">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead" translate="WHATSAPP.DISPOSITIONS">Dispositions</span>\n                    <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n                    <div flex></div>\n                    <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add whatsapp dispositions" translate translate-attr-label="WHATSAPP.ADD_DISPOSITION">\n                      <md-icon md-font-icon="icon-plus"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n                      {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="whatsappAccounts.csv">\n                      <md-icon md-font-icon="icon-file-excel"></md-icon>\n                    </button>\n                    <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n                    <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n                      <tr md-row>\n                        <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n                        <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n                        <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n                        <th md-column md-order-by="description">{{ \'WHATSAPP.DESCRIPTION\' | translate }}\n                        </th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body>\n                      <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n                        <td md-cell colspan="5">\n                          <div layout="row" layout-align="center center">\n                            <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n                          </div>\n                        </td>\n                      </tr>\n                      <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n                        </td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n                          {{ vm_dc.levels[disposition.level] }}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n                          {{disposition.name}}</td>\n                        <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n                          {{disposition.description}}</td>\n                        <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n                            <md-menu-content width="3">\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                                <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n                                  Edit Disposition\n                                </md-button>\n                              </md-menu-item>\n                              \x3c!-- SUBACTIONS --\x3e\n                              \x3c!-- ACTIONS --\x3e\n                              <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                                <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n                                  Delete Disposition\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n                </md-table-pagination>\n              </div>\n            </div>\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.CANNEDANSWERS">CANNEDANSWERS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container whatsappcannedanswers md-background-bg md-whiteframe-1dp">\n            <div ng-controller="WhatsappAccountWhatsappCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="WHATSAPP.WHATSAPPCANNEDANSWERS">WhatsappCannedAnswers</span>\n                  <ms-search-bar on-search="vm_dc.getWhatsappAccountWhatsappCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event)" aria-label="add whatsappCannedAnswer" translate translate-attr-label="WHATSAPP.ADD_WHATSAPPCANNEDANSWER">\n                    <md-icon md-font-icon="icon-plus"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length}} {{vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedWhatsappAccountWhatsappCannedAnswers" csv-label="true" filename="whatsappAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedWhatsappAccountWhatsappCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getWhatsappAccountWhatsappCannedAnswers">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'WHATSAPP.ID\' | translate }}\n                      </th>\n                      <th md-column md-order-by="key">\n                        {{ \'WHATSAPP.KEY\' | translate }}\n                      </th>\n                      <th md-column md-order-by="value">\n                        {{ \'WHATSAPP.VALUE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="description">\n                        {{ \'WHATSAPP.DESCRIPTION\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'WHATSAPP.CREATED_AT\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="whatsappCannedAnswer" md-select-id="id" ng-repeat="whatsappCannedAnswer in vm_dc.whatsappAccountWhatsappCannedAnswers.rows">\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{whatsappCannedAnswer.id}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{whatsappCannedAnswer.key}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{whatsappCannedAnswer.value}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{whatsappCannedAnswer.description}}\n                      </td>\n                      <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n                        {{ whatsappCannedAnswer.createdAt | formatdate }}\n                      </td>\n                      <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n                              <md-button ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" translate="WHATSAPP.EDIT_WHATSAPPCANNEDANSWER">\n                                Edit WhatsappCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(whatsappCannedAnswer, $event)" translate="WHATSAPP.DELETE_WHATSAPPCANNEDANSWER">\n                                Delete WhatsappCannedAnswer\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.whatsappAccountWhatsappCannedAnswers.rows.length">\n                      <td md-cell colspan="7">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="WHATSAPP.NO_WHATSAPPCANNEDANSWER_AVAILABLE">No whatsappcannedanswer available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.whatsappAccountWhatsappCannedAnswers.count}}" md-on-paginate="vm_dc.getWhatsappAccountWhatsappCannedAnswers" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.ACTIONS">ACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="WhatsappAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.whatsappAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n              \x3c!-- SIDENAV --\x3e\n              <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n                \x3c!-- SIDENAV CONTENT --\x3e\n                <md-list class="no-padding">\n                  <md-subheader class="md-no-sticky">\n                    <span translate="VOICE.APPLICATIONS_LIST">\n                      Applications List\n                    </span>\n                  </md-subheader>\n                </md-list>\n                <md-divider></md-divider>\n                <md-list ng-sortable="vm_ac.list">\n                  <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n                    <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n                    <p class="text-truncate" translate="WHATSAPP.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n                  </md-list-item>\n                </md-list>\n                \x3c!-- / SIDENAV CONTENT --\x3e\n              </div>\n              \x3c!-- / SIDENAV --\x3e\n              <div flex></div>\n              \x3c!-- MAIN --\x3e\n              <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n                <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedWhatsappAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">Drag & Drop Routing</span>\n                    <div flex></div>\n                    <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n                  </div>\n                </md-toolbar>\n                <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedWhatsappAccountApps.length">\n                  <div class="md-toolbar-tools">\n                    <span class="md-subhead">{{vm_ac.selectedWhatsappAccountApps.length}} {{vm_ac.selectedWhatsappAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n                    <div flex></div>\n                    <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedWhatsappAccountApps($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n                      <md-icon md-font-icon="icon-delete"></md-icon>\n                    </md-button>\n                  </div>\n                </md-toolbar>\n\n                \x3c!-- QUEUES TABLE --\x3e\n                <md-table-container>\n                  <table md-table md-row-select multiple ng-model="vm_ac.selectedWhatsappAccountApps">\n                    <thead md-head>\n                      <tr md-row>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px">\n                          <span translate="VOICE.PRIORITY">Priority</span>\n                        </th>\n                        <th md-column>\n                          <span>Type</span>\n                        </th>\n                        <th md-column>\n                          <span>Appdata</span>\n                        </th>\n                        <th md-column>\n                          <span>Interval</span>\n                        </th>\n                        <th md-column width="10px"></th>\n                        <th md-column width="10px"></th>\n                      </tr>\n                    </thead>\n                    <tbody md-body ng-sortable="vm_ac.applications">\n                      <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.whatsappAccountApps.rows | filter: vm_ac.query.filter">\n                        <td md-cell>\n                          <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n                        </td>\n                        <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n                        <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n                        <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n                        <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n                        <td md-cell>\n                          <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n                            <md-icon md-font-icon="icon-timer"></md-icon>\n                            <md-tooltip>\n                              {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n                            </md-tooltip>\n                          </md-button>\n                        </td>\n                        <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n                          <md-menu>\n                            <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n                              <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                            </md-button>\n\n                            <md-menu-content width="3">\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editWhatsappAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n                                  Edit App\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n                                <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n                                  Edit Interval\n                                </md-button>\n                              </md-menu-item>\n                              <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n                                <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n                                  Delete App\n                                </md-button>\n                              </md-menu-item>\n                            </md-menu-content>\n                          </md-menu>\n                        </td>\n                      </tr>\n                      <tr md-row ng-hide="vm_ac.whatsappAccountApps.rows.length">\n                        <td md-cell colspan="7">\n                          <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n                        </td>\n                      </tr>\n                    </tbody>\n                  </table>\n                </md-table-container>\n                \x3c!-- / QUEUES TABLE --\x3e\n\n                \x3c!-- NO RESULTS --\x3e\n\n                \x3c!-- / NO RESULTS --\x3e\n              </div>\n              \x3c!-- / MAIN --\x3e\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.INTERACTIONS">INTERACTIONS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n            <div ng-controller="WhatsappAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions, vm.userProfile)">\n              <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead" translate="WHATSAPP.INTERACTIONS">Interactions</span>\n                  <ms-search-bar on-search="vm_dc.getWhatsappAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n                  <div flex></div>\n                  <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getWhatsappAccountInteractions()"></ms-quick-filter>\n                  <div layout="column">\n                    <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n                      <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n                    </md-button>\n                  </div>\n                  <md-button class="md-icon-button" ng-click="vm_dc.getWhatsappAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="WHATSAPP.REFRESH_INTERACTIONS">\n                    <md-icon md-font-icon="icon-refresh"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedWhatsappAccountInteractions.length">\n                <div class="md-toolbar-tools">\n                  <span class="md-subhead">{{vm_dc.selectedWhatsappAccountInteractions.length}} {{vm_dc.selectedWhatsappAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n                  <div flex></div>\n                  <button class="md-icon-button" ng-csv="vm_dc.exportSelectedWhatsappAccountInteractions" csv-label="true" filename="whatsappAccounts.csv">\n                    <md-icon md-font-icon="icon-file-excel"></md-icon>\n                  </button>\n                  <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedWhatsappAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n                    <md-icon md-font-icon="icon-delete"></md-icon>\n                  </md-button>\n                </div>\n              </md-toolbar>\n              <md-table-container class="font-size-12">\n                <table md-table md-row-select multiple ng-model="vm_dc.selectedWhatsappAccountInteractions" md-progress="vm_dc.promise">\n                  <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getWhatsappAccountInteractions">\n                    <tr md-row>\n                      <th md-column md-order-by="id">\n                        {{ \'WHATSAPP.ID\' | translate }}\n                      </th>\n                      <th md-column class="no-padding">\n                        <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column class="no-padding">\n                      </th>\n                      <th md-column md-order-by="contactName">\n                        {{ \'WHATSAPP.CONTACT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="createdAt">\n                        {{ \'WHATSAPP.STARTEDAT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="lastMsgAt">\n                        {{ \'WHATSAPP.LASTMESSAGE\' | translate }}\n                      </th>\n                      <th md-column md-order-by="closed">\n                        {{ \'WHATSAPP.STATUS\' | translate }}\n                      </th>\n                      <th md-column>\n                        {{ \'WHATSAPP.AGENT\' | translate }}\n                      </th>\n                      <th md-column md-order-by="tag">\n                        {{ \'WHATSAPP.TAGS\' | translate }}\n                      </th>\n                      <th md-column width="10px"></th>\n                    </tr>\n                  </thead>\n                  <tbody md-body>\n                    <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.whatsappAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n                      <td md-cell>\n                        {{interaction.id}}\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="!interaction.closed && interaction.Users.length">\n                          <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n                          <md-tooltip>\n                            <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n                              <span ng-if="!$last">, </span>\n                            </span>\n                          </md-tooltip>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n                          <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n                        </div>\n                      </td>\n                      <td md-cell class="no-padding">\n                        <div ng-if="interaction.attach">\n                          <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n                        </div>\n                      </td>\n                      <td md-cell privacy ng-cloak>\n                        <div layout="column" layout-align="start start">\n                          <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n                          <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        {{ interaction.createdAt | formatdate }}\n                      </td>\n                      <td md-cell>\n                        <div layout="row">\n                          <span>\n                            <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n                          </span>\n                          <div layout="column" layout-align="center center">\n                            <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n                          </div>\n                        </div>\n                      </td>\n                      <td md-cell>\n                        <span ng-if="interaction.closed === 0" class="green-fg">\n                          {{ \'WHATSAPP.OPENED\' | translate }}\n                          <span ng-if="interaction.substatus">\n                            - {{ interaction.substatus }}\n                          </span>\n                        </span>\n                        <span ng-if="interaction.closed === 1" class="red-fg">\n                          {{ \'WHATSAPP.CLOSED\' | translate }}\n                          <span ng-if="interaction.disposition">\n                            - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n                          </span>\n                          <md-tooltip class="multiline">\n                            <div layout="column">\n                              <div layout="column">\n                                <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n                              </div>\n                              <div ng-if="interaction.disposition" layout="column">\n                                <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.disposition }}</span>\n                              </div>\n                              <div ng-if="interaction.secondDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.secondDisposition }}</span>\n                              </div>\n                              <div ng-if="interaction.thirdDisposition" layout="column">\n                                <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n                                <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n                              </div>\n                            </div>\n                          </md-tooltip>\n                        </span>\n                      </td>\n\n                      <td md-cell>\n                        {{interaction.Owner.name}}\n                      </td>\n                      <td md-cell>\n                        <div ng-if="interaction.Tags.length">\n                          <md-tooltip md-direction="left" layout="row">\n                            <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n                          </md-tooltip>\n                          <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n                          </md-icon>\n                        </div>\n                      </td>\n                      <td md-cell class="actions">\n                        <md-menu>\n                          <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                            <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                          </md-button>\n\n                          <md-menu-content width="3">\n                            <md-menu-item>\n                              <md-button ng-click="vm_dc.spywhatsappInteraction($event, interaction)" translate="WHATSAPP.SPYINTERACTION">\n                                Spy Interaction\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n                              <md-button class="md-primary" ng-click="vm_dc.whatsappInteractionDownload(interaction, $event)" translate="WHATSAPP.DOWNLOAD_INTERACTION">\n                                Download\n                              </md-button>\n                            </md-menu-item>\n                            <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n                              <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="WHATSAPP.DELETE_INTERACTION">\n                                Delete Interaction\n                              </md-button>\n                            </md-menu-item>\n                          </md-menu-content>\n                        </md-menu>\n                      </td>\n                    </tr>\n                    <tr md-row ng-if="!vm_dc.whatsappAccountInteractions.rows.length">\n                      <td md-cell colspan="12">\n                        <div layout="row" layout-align="center center">\n                          <span class="text-boxed-light" translate="WHATSAPP.NO_INTERACTION_AVAILABLE">No interaction available</span>\n                        </div>\n                      </td>\n                    </tr>\n                  </tbody>\n                </table>\n              </md-table-container>\n              <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.whatsappAccountInteractions.count}}" md-on-paginate="vm_dc.getWhatsappAccountInteractions" md-page-select></md-table-pagination>\n            </div>\n\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/whatsappCannedAnswers/dialog.html",'<md-dialog class="whatsappCannedAnswer-dialog" aria-label="New WhatsappCannedAnswer">\n  <form name="whatsappCannedAnswerForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.KEY">Key</label>\n        <input type="" name="key" ng-model="vm.whatsappCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n        <div ng-messages="whatsappCannedAnswerForm[\'key\'].$error" ng-show="whatsappCannedAnswerForm[\'key\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">Key field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.VALUE">Value</label>\n        <textarea name="value" ng-model="vm.whatsappCannedAnswer.value" required></textarea>\n\n        <div ng-messages="whatsappCannedAnswerForm[\'value\'].$error" ng-show="whatsappCannedAnswerForm[\'value\'].$touched" role="alert">\n\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.VALUE_REQUIRED">Value field is required</span>\n          </div>\n\n\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.whatsappCannedAnswer.description">\n\n        <div ng-messages="whatsappCannedAnswerForm[\'description\'].$error" ng-show="whatsappCannedAnswerForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappCannedAnswer" ng-click="vm.saveWhatsappCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="whatsappCannedAnswerForm.$invalid || whatsappCannedAnswerForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappCannedAnswer" ng-click="vm.addNewWhatsappCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="whatsappCannedAnswerForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPCANNEDANSWER" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPCANNEDANSWER">\n          ADD WHATSAPPCANNEDANSWER\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappCannedAnswer" ng-click="vm.deleteWhatsappCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/whatsappAccounts.html",'<div id="whatsappAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="WHATSAPP.WHATSAPPACCOUNTS">WhatsappAccounts</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="WHATSAPP.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedWhatsappAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedWhatsappAccounts =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="WHATSAPP.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-whatsappAccounts-count">\n          <span>{{vm.selectedWhatsappAccounts.length}}</span>\n          <span translate="WHATSAPP.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllWhatsappAccounts()" translate="WHATSAPP.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectWhatsappAccounts()" translate="WHATSAPP.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappAccounts" csv-label="true" filename="whatsappAccounts.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedWhatsappAccounts($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- WHATSAPPACCOUNT TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedWhatsappAccounts" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappAccounts">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n                <th md-column md-order-by="key">{{ \'WHATSAPP.KEY\' | translate }}</th>\n                <th md-column md-order-by="ListId">{{ \'WHATSAPP.LIST\' | translate }}</th>\n                <th md-column md-order-by="type">{{ \'WHATSAPP.TYPE\' | translate }}</th>\n                <th md-column md-order-by="phone">{{ \'WHATSAPP.PHONE\' | translate }}</th>\n                <th md-column md-order-by="description">{{ \'WHATSAPP.DESCRIPTION\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.whatsappAccounts.rows.length">\n                <td md-cell colspan="8">\n                  <div layout="row" layout-align="center center">\n                    <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="whatsappAccount" md-select-id="id" ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">\n                <td md-cell ng-if="whatsappAccount.userpic"><img class="avatar" alt="{{whatsappAccount.name}}" ng-src="api/users/{{whatsappAccount.id}}/avatar" /></td>\n                <td md-cell ng-if="!whatsappAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{whatsappAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="id ">{{whatsappAccount.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="name ">{{whatsappAccount.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="key ">{{whatsappAccount.key}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':whatsappAccount.ListId} : true)[0].name }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="type ">{{ vm.arraytype[whatsappAccount.type].option }}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="phone ">{{whatsappAccount.phone}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="description ">{{whatsappAccount.description}}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(whatsappAccount, $event    )" translate="WHATSAPP.EDIT_WHATSAPPACCOUNT">\n                          Edit WhatsappAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.interactionsgoto(whatsappAccount, $event    )" translate="WHATSAPP.INTERACTIONS_WHATSAPPACCOUNT">\n                          Interactions WhatsappAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(whatsappAccount, $event    )" translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">\n                          AgentAdd WhatsappAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(whatsappAccount, $event    )" translate="WHATSAPP.DELETE_WHATSAPPACCOUNT">\n                          Delete WhatsappAccount\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappAccounts.count}}" md-on-paginate="vm.getWhatsappAccounts" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / WHATSAPPACCOUNT TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD WHATSAPPACCOUNT BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-whatsappAccount-button" ng-click="vm.createOrEditWhatsappAccount($event)" aria-label="add whatsappAccount" translate translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD WHATSAPPACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",'<md-dialog class="whatsappQueue-dialog" aria-label="New WhatsappQueue">\n  <form name="whatsappQueueForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.whatsappQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newWhatsappQueue">\n\n        <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n        <div ng-messages="whatsappQueueForm[\'name\'].$error" ng-show="whatsappQueueForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.STRATEGY">Strategy</label>\n        <md-select name="strategy" ng-model="vm.whatsappQueue.strategy" required>\n          <md-option ng-value="\'beepall\'">Beepall</md-option>\n          <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n        </md-select>\n        <div ng-messages="whatsappQueueForm[\'strategy\'].$error" ng-show="whatsappQueueForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>\n        <input type="number" name="timeout" ng-model="vm.whatsappQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n        <div ng-messages="whatsappQueueForm[\'timeout\'].$error" ng-show="whatsappQueueForm[\'timeout\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n          </div>\n          <div ng-message="min">\n            <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n          </div>\n          <div ng-message="max">\n            <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="WHATSAPP.DESCRIPTION">Description</label>\n        <input type="text" name="description" ng-model="vm.whatsappQueue.description">\n\n        <div ng-messages="whatsappQueueForm[\'description\'].$error" ng-show="whatsappQueueForm[\'description\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappQueue" ng-click="vm.saveWhatsappQueue()" class="send-button md-accent md-raised" ng-disabled="whatsappQueueForm.$invalid || whatsappQueueForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n          SAVE\n        </md-button>\n\n        <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappQueue" ng-click="vm.addNewWhatsappQueue()" class="send-button md-accent md-raised" ng-disabled="whatsappQueueForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPQUEUE" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">\n          ADD WHATSAPPQUEUE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappQueue" ng-click="vm.deleteWhatsappQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n          <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",'<md-dialog class="whatsappQueue-dialog" aria-label="whatsappQueue" ng-init="vm.onInit()">\n  <form name="whatsappQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">Add Agent to whatsappQueue</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",'<md-dialog class="whatsappQueue-dialog" aria-label="whatsappQueue" ng-init="vm.onInit()">\n  <form name="whatsappQueueForm" ng-cloak>\n    <md-toolbar>\n      <div class="md-toolbar-tools">\n        <h2 translate="WHATSAPP.TEAMS_ASSOCIATION">Teams Association</h2>\n        <span flex></span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n    </md-dialog-content>\n    <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n      <span></span>\n      <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n        SAVE\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/view.html",'<div id="whatsapp-whatsappQueue" class="page-layout simple tabbed" layout="column">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="start center">\n    <div class="white-fg" layout="row" layout-align="start center" flex>\n      <md-button class="goto-whatsappQueues-button md-icon-button" aria-label="Go to whatsappQueues" ng-click="vm.gotoWhatsappQueues()" translate translate-attr-aria-label="WHATSAPP.GO_TO_WHATSAPPQUEUES">\n        <md-icon md-font-icon="icon-arrow-left"></md-icon>\n      </md-button>\n\n      <div layout="row" layout-align="start center">\n\n        <div class="whatsappQueue-image" hide-xs>\n          <img ng-src="assets/images/business/whatsappQueues.jpg">\n        </div>\n\n        <div layout="column" layout-align="start start">\n          <div class="h2">\n            #{{vm.whatsappQueue.id}}\n            <span ng-if="vm.whatsappQueue.name">{{vm.whatsappQueue.name}}</span>\n          </div>\n          <div class="subtitle secondary-text">\n            <span translate="WHATSAPP.CREATED_AT"></span> <span>{{vm.whatsappQueue.createdAt | date:\'medium\'}}</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.teamadddialog(vm.whatsappQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n        <md-tooltip><span translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n      </md-button>\n    </div>\n\n    <div ng-cloak>\n      <md-button ng-click="vm.agentadddialog(vm.whatsappQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n        <md-tooltip><span translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE"></span></md-tooltip>\n        <md-icon md-font-icon="icon-account-plus"></md-icon>\n      </md-button>\n    </div>\n    <div>\n      <md-button type="submit" ng-click="vm.saveWhatsappQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n        SAVE\n      </md-button>\n    </div>\n\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content">\n\n    <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n      <md-tab>\n        <md-tab-label>\n          <span translate="WHATSAPP.SETTINGS">SETTINGS</span>\n        </md-tab-label>\n        <md-tab-body>\n          <div class="whatsappQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n            <div class="pb-16" layout="row" layout-align="start center">\n              <div class="h2 secondary-text" translate="WHATSAPP.GENERAL">GENERAL</div>\n            </div>\n            <form name="generalForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.NAME">Name</label>\n                <input type="text" name="name" ng-model="vm.whatsappQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n                <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n                <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n                  </div>\n                  <div ng-message="pattern">\n                    <span translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.STRATEGY">Strategy</label>\n                <md-select name="strategy" ng-model="vm.whatsappQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-value="\'beepall\'">Beepall</md-option>\n                  <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n                </md-select>\n                <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>\n                <input type="number" name="timeout" ng-model="vm.whatsappQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n                  </div>\n                </div>\n              </md-input-container>\n              <md-input-container class="md-block">\n                <label translate="WHATSAPP.DESCRIPTION">Description</label>\n                <input type="text" name="description" ng-model="vm.whatsappQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n                  </div>\n                </div>\n              </md-input-container>\n\n            </form>\n          </div>\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/whatsappQueues.html",'<div id="whatsappQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n  \x3c!-- HEADER --\x3e\n  <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n    \x3c!-- APP TITLE --\x3e\n    <div layout="row" layout-align="start center">\n      <div class="logo" layout="row" layout-align="start center">\n        <span class="logo-icon">\n          <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>\n        </span>\n        <span class="logo-text" translate="WHATSAPP.WHATSAPPQUEUES">WhatsappQueues</span>\n      </div>\n    </div>\n    \x3c!-- / APP TITLE --\x3e\n\n    <div layout="row">\n      \x3c!-- SEARCH --\x3e\n      <div class="search-input-wrapper" layout="row" layout-align="start center">\n        <label for="search">\n          <md-icon md-font-icon="icon-magnify"></md-icon>\n        </label>\n        <md-input-container md-no-float class="m-0">\n          <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="WHATSAPP.SEARCH_FOR_ANYONE">\n        </md-input-container>\n      </div>\n      \x3c!-- / SEARCH --\x3e\n    </div>\n  </div>\n  \x3c!-- / HEADER --\x3e\n\n  \x3c!-- SELECTED BAR --\x3e\n  <div ng-show="vm.selectedWhatsappQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedWhatsappQueues =[]">\n      <md-button layout="row" layout-align="start center">\n        <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n        <span translate="WHATSAPP.BACK">Back</span>\n      </md-button>\n    </div>\n\n    <div flex layout="row" layout-align="space-between center">\n\n      <div>\n        <span class="selected-whatsappQueues-count">\n          <span>{{vm.selectedWhatsappQueues.length}}</span>\n          <span translate="WHATSAPP.SELECTED">selected</span>\n        </span>\n\n        <md-menu class="select-menu" ng-if="!vm.currentThread">\n          <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">\n            <md-icon md-font-icon="icon-menu-down"></md-icon>\n          </md-button>\n          <md-menu-content width="3">\n            <md-menu-item>\n              <md-button ng-click="vm.selectAllWhatsappQueues()" translate="WHATSAPP.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectWhatsappQueues()" translate="WHATSAPP.SELECT_NONE">\n                Select none\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n\n      <div class="multi-select-actions">\n        <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappQueues" csv-label="true" filename="whatsappQueues.csv">\n          <md-icon md-font-icon="icon-file-excel"></md-icon>\n        </button>\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedWhatsappQueues($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n          <md-icon md-font-icon="icon-delete"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </div>\n  \x3c!-- / SELECTED BAR --\x3e\n\n  \x3c!-- CONTENT --\x3e\n  <div class="content" md-background-bg layout="row" layout-align="start start">\n\n    \x3c!-- MAIN --\x3e\n    <div class="main scrollable">\n\n\n      \x3c!-- WHATSAPPQUEUE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedWhatsappQueues" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappQueues">\n              <tr md-row>\n                <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n                <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n                <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n                <th md-column md-order-by="strategy">{{ \'WHATSAPP.STRATEGY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.whatsappQueues.rows.length">\n                <td md-cell colspan="4">\n                  <div layout="row" layout-align="center center">\n                    <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n                  </div>\n                </td>\n              </tr>\n              <tr md-row md-select="whatsappQueue" md-select-id="id" ng-repeat="whatsappQueue in vm.whatsappQueues.rows">\n                <td md-cell ng-if="whatsappQueue.userpic"><img class="avatar" alt="{{whatsappQueue.name}}" ng-src="api/users/{{whatsappQueue.id}}/avatar" /></td>\n                <td md-cell ng-if="!whatsappQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{whatsappQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="id ">{{whatsappQueue.id}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="name ">{{whatsappQueue.name}}</td>\n                <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="strategy ">{{ vm.arraystrategy[whatsappQueue.strategy].option }}</td>\n\n\n                <td md-cell class="actions">\n\n                  <md-menu>\n\n                    <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n                      <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n                    </md-button>\n\n                    <md-menu-content width="3">\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n                        <md-button ng-click="vm.editstate(whatsappQueue, $event    )" translate="WHATSAPP.EDIT_WHATSAPPQUEUE">\n                          Edit WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.teamadddialog(whatsappQueue, $event    )" translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE">\n                          teamadd WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.agentadddialog(whatsappQueue, $event    )" translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">\n                          agentadd WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n                        <md-button ng-click="vm.deleteconfirm(whatsappQueue, $event    )" translate="WHATSAPP.DELETE_WHATSAPPQUEUE">\n                          Delete WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                      \x3c!-- SUBACTIONS --\x3e\n\n\n                      \x3c!-- ACTIONS --\x3e\n\n                      <md-menu-item>\n\n                        <md-button ng-click="vm.gotorealtimegoto(whatsappQueue, $event    )" translate="WHATSAPP.GOTOREALTIME_WHATSAPPQUEUE">\n                          goToRealtime WhatsappQueue\n                        </md-button>\n\n                      </md-menu-item>\n\n\n\n                    </md-menu-content>\n\n                  </md-menu>\n                </td>\n\n\n              </tr>\n            </tbody>\n          </table>\n        </md-table-container>\n\n        <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappQueues.count}}" md-on-paginate="vm.getWhatsappQueues" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / WHATSAPPQUEUE TABLE --\x3e\n      \x3c!-- NO RESULTS --\x3e\n\n      \x3c!-- / NO RESULTS --\x3e\n    </div>\n    \x3c!-- / MAIN --\x3e\n\n  </div>\n  \x3c!-- / CONTENT --\x3e\n\n  \x3c!-- ADD WHATSAPPQUEUE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-whatsappQueue-button" ng-click="vm.createOrEditWhatsappQueue($event)" aria-label="add whatsappQueue" translate translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD WHATSAPPQUEUE BUTTON --\x3e\n</div>'),e.put("app/navigation/layouts/horizontal-navigation/navigation.html",'<div layout="row" layout-align="start center">\n  <ms-navigation-horizontal></ms-navigation-horizontal>\n</div>'),e.put("app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html",'<ms-navigation class="scrollable" folded="vm.folded"></ms-navigation>'),e.put("app/navigation/layouts/vertical-navigation/navigation.html",'<md-toolbar class="navigation-header md-whiteframe-1dp" layout="row" layout-align="space-between center">\n  <div class="logo" layout="row" layout-align="start center">\n    <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n    \x3c!-- <span class="logo-image"><img src="assets/images/logos/whisker_32x32.png" alt="motion_whisker_32x32" /></span> --\x3e\n    <span class="logo-text text-truncate">{{vm.getLogo() | uppercase}}</span>\n  </div>\n  <md-icon class="fold-toggle s18" md-font-icon="icon-backburger" hide show-gt-sm ng-click="vm.toggleMsNavigationFolded()"></md-icon>\n</md-toolbar>\n\n<ms-navigation class="scrollable" folded="vm.folded"></ms-navigation>'),e.put("app/quick-panel/quick-panel.html",'<md-content>\n  <md-tabs md-no-pagination md-swipe-content md-stretch-tabs="always">\n    <md-tab>\n      <md-tab-label>\n        <span translate="QUICKPANEL.TODAY">TODAY</span>\n      </md-tab-label>\n      <md-tab-body>\n        <md-content class="today-tab scrollable" ng-include="\'app/quick-panel/tabs/today/today-tab.html\'"></md-content>\n      </md-tab-body>\n    </md-tab>\n    <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'" ng-controller="ChatInternalController as vm_ct" ng-init="vm_ct.init(vm.license)" md-on-deselect="vm_ct.user = undefined">\n      <md-tab-label>\n        <div ng-if="vm.unreadTotalMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalMessages}}</div>\n        <span>MESSENGER</span>\n      </md-tab-label>\n      <md-tab-body>\n        <md-content class="chat-tab scrollable" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'"></md-content>\n      </md-tab-body>\n    </md-tab>\n    <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'" ng-controller="ChatGroupController as vm_cg" ng-init="vm_cg.init(vm.license)" md-on-deselect="vm_cg.group = undefined">\n      <md-tab-label>\n        <div ng-if="vm.unreadTotalGroupMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalGroupMessages}}</div>\n        <span translate="QUICKPANEL.GROUPS">GROUPS</span>\n      </md-tab-label>\n      <md-tab-body>\n        <md-content class="group-tab scrollable" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'"></md-content>\n      </md-tab-body>\n    </md-tab>\n  </md-tabs>\n</md-content>'),e.put("app/quick-panel/tabs/activity/activity-tab.html",'<md-list class="friends">\n  <md-subheader class="md-no-sticky">\n    <span translate="QUICKPANEL.FRIENDS">Friends</span>\n  </md-subheader>\n\n  <md-list-item class="friend md-3-line" ng-repeat="friend in vm.activities.friends">\n    <img ng-src="{{friend.avatar}}" class="md-avatar" alt="{{friend.name}}" />\n\n    <div class="status {{friend.status}}"></div>\n\n    <div ng-if="contact.unread" class="md-accent-bg unread-message-count">{{contact.unread}}</div>\n\n    <div class="md-list-item-text">\n      <h3 class="message">{{friend.message}}</h3>\n      <p class="time">{{friend.time}}</p>\n    </div>\n  </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="servers">\n  <md-subheader class="md-no-sticky">\n    <span translate="QUICKPANEL.APP_SERVERS">Application Servers</span>\n  </md-subheader>\n\n  <md-list-item class="server md-3-line" ng-repeat="server in vm.activities.servers">\n    <md-icon md-font-icon="icon-checkbox-blank-circle" class="s16 status" ng-class="server.status"></md-icon>\n\n    <div class="md-list-item-text">\n      <h3>{{server.location}}</h3>\n      <p>{{server.detail}}</p>\n    </div>\n  </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="stats">\n  <md-subheader class="md-no-sticky">\n    <span translate="QUICKPANEL.USER_STATS">User Stats</span>\n  </md-subheader>\n\n  <md-list-item class="stat md-2-line" ng-repeat="stat in vm.activities.stats">\n    <div class="md-list-item-text">\n      <span>{{stat.title}} ({{stat.current}} / {{stat.total}})</span>\n      <md-progress-linear ng-class="stat.status" md-mode="determinate" value="{{stat.percent}}"></md-progress-linear>\n    </div>\n  </md-list-item>\n</md-list>'),e.put("app/quick-panel/tabs/chat/chat-tab.html",'<div class="main" ng-hide="vm_ct.user">\n  <md-subheader class="md-no-sticky">\n    <div class="search" layout="row" layout-align="space-between center">\n      <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n      <input class="search-input" ng-model="vm_ct.search.$" type="text" placeholder="Search by fullname.." translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n      <md-select ng-model="vm_ct.search.online" class="height-50 no-padding no-margin" aria-label="Chat Tab Search">\n        <md-option ng-value="undefined">All</md-option>\n        <md-option ng-value="true">\n          <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online\n        </md-option>\n        <md-option ng-value="false">\n          <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline\n        </md-option>\n      </md-select>\n    </div>\n  </md-subheader>\n  \x3c!-- <select ng-model="vm_ct.filterOnline" class="height-50 no-padding no-margin">\n            <option ng-value="undefined">All</option>\n            <option ng-value="true"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online</option>\n            <option ng-value="false"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline</option>\n        </select> --\x3e\n  <md-divider></md-divider>\n  <md-list class="recent">\n    <md-list-item class="contact md-3-line" ng-if="user.id != vm_ct.currentUser.id" ng-repeat="user in vm_ct.users.rows | orderBy: \'-lastMessageAt\' | filter:vm_ct.search" ng-click="vm_ct.toggleChat(user)">\n      <md-divider></md-divider>\n      <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="md-avatar" alt="{{user.fullname}}" />\n      <div class="status" ng-class="{true: \'online\', false: \'offline\'}[user.online]"></div>\n      <div ng-if="vm_ct.unreadMessage[user.id]" class="md-accent-bg unread-message-count">\n        {{vm_ct.unreadMessage[user.id]}}</div>\n      <div class="md-list-item-text">\n        <div layout="row">\n          <h3>{{user.fullname}}</h3>\n          <md-icon ng-if="!user.allowmessenger && user.role === \'agent\'" class="s16 margin-left-5" ng-style="{\'color\': \'red\' }" md-font-icon="icon-block-helper"></md-icon>\n        </div>\n        <p>{{user.name}} &#60;{{user.internal}}&#62;</p>\n        <div layout="row" layout-align="start center">\n          <md-icon ng-if="!user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check"></md-icon>\n          <md-icon ng-if="user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check-all md-accent"></md-icon>\n          <p>{{user.lastMessage.body | limitTo:20 }}{{user.lastMessage.body.length > 20 ? \'...\' : \'\' }}</p>\n          <span flex></span>\n          <p class="last-message" ng-if="user.lastMessageAt != vm_ct.standardDate">\n            {{user.lastMessageAt | formatdate}}</p>\n        </div>\n      </div>\n    </md-list-item>\n  </md-list>\n</div>\n\n<div class="chat" ng-show="vm_ct.user" layout="column">\n  <md-toolbar class="md-accent">\n    <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n      <div layout="row" layout-align="start center">\n        <md-button class="md-icon-button" ng-click="vm_ct.toggleChat()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n          <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n        </md-button>\n        <h4>\n          <span>{{vm_ct.user.fullname}}</span>\n        </h4>\n      </div>\n\n      <div layout="row" layout-align="end center">\n        <md-button ng-if="vm_ct.license.webrtc && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 2 && vm_ct.user.role === \'agent\'" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_ct.webcall(vm_ct.user.name)">\n          <md-icon md-font-icon="icon-phone"></md-icon>\n        </md-button>\n        <md-menu ng-if="vm_ct.currentUser.phoneBarRemoteControl && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 0 && vm_ct.user.role === \'agent\'">\n          <md-button class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="$mdOpenMenu($event)">\n            <md-icon md-font-icon="icon-phone"></md-icon>\n          </md-button>\n\n          <md-menu-content width="3">\n            <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n              <md-button ng-click="vm_ct.call(vm_ct.user.name)">\n                {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{vm_ct.user.name}})\n              </md-button>\n            </md-menu-item>\n            <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n              <md-button ng-click="vm_ct.transfer(vm_ct.user.name)">\n                {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{vm_ct.user.name}})\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n    </div>\n\n  </md-toolbar>\n  <md-content flex layout-paddings id="chat-dialog">\n    <div layout="row" ng-repeat="message in vm_ct.user.messages.rows" class="md-padding message-row" ng-class="message.FromId === vm_ct.currentUser.id ? \'user\' : \'contact\'">\n      <img ng-if="message.FromId === vm_ct.user.id" ng-src="{{vm_ct.user.userpic ? \'api/users/\' + vm_ct.user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{vm_ct.user.fullname}}" />\n      <img ng-if="message.FromId === vm_ct.currentUser.id" class="avatar" ng-src="{{vm_ct.currentUser.userpic ? \'api/users/\' + vm_ct.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n      <div class="bubble" flex>\n        <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n        <div layout="row" layout-align="end center">\n          <span class="time secondary-text">{{message.createdAt | formatdate }}</span>\n          <md-icon ng-if="!message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check"></md-icon>\n          <md-icon ng-if="message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check-all md-accent"></md-icon>\n        </div>\n      </div>\n    </div>\n  </md-content>\n\n  <form ng-submit="vm_ct.reply()" layout="row" class="reply" layout-align="start center">\n    <textarea ng-keyup="$event.keyCode == 13 && !vm_ct.disabled? vm_ct.reply() : null" flex ng-model="vm_ct.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n    <md-button ng-disable="vm_ct.disabled" class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n      <md-icon md-font-icon="icon-send"></md-icon>\n    </md-button>\n  </form>\n</div>'),e.put("app/quick-panel/tabs/groups/create/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n  <form name="groupForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      \x3c!--START Error--\x3e\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      \x3c!--END Error--\x3e\n\n      \x3c!--START NAME--\x3e\n      <md-input-container class="md-block">\n        <label translate="QUICKPANEL.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.group.name" required autofocus>\n        <div ng-messages="groupForm[\'name\'].$error" ng-show="groupForm[\'name\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="QUICKPANEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="QUICKPANEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n          </div>\n        </div>\n      </md-input-container>\n      \x3c!--END NAME--\x3e\n\n      \x3c!--START Members--\x3e\n      <md-input-container class="md-block">\n        <label translate="QUICKPANEL.MEMBERS">Members</label>\n        <md-contact-chips ng-model="vm.group.members" md-contacts="vm.querySearch($query)" md-contact-name="name" md-contact-image="image" md-require-match="true" md-highlight-flags="i" placeholder="{{\'QUICKPANEL.MEMBERS\' | translate}}">\n        </md-contact-chips>\n        <div ng-messages="groupForm[\'strategy\'].$error" ng-show="groupForm[\'strategy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="QUICKPANEL.ERRORS.MEMBERS_REQUIRED">Members field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      \x3c!--END Members--\x3e\n\n      \x3c!--START Writing--\x3e\n      <md-input-container class="md-block">\n        <md-switch ng-model="vm.group.write" aria-label="Write">\n          {{\'QUICKPANEL.ENABLE_WRITING\' | translate}}\n        </md-switch>\n      </md-input-container>\n      \x3c!--END Writing--\x3e\n\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-if="vm.newChatGroup" ng-click="vm.saveChatGroup()" class="send-button md-accent md-raised" ng-disabled="groupForm.$invalid || groupForm.$pristine || (vm.group.members.length < 1)" aria-label="SAVE" translate="QUICKPANEL.SAVE" translate-attr-aria-label="QUICKPANEL.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/groups/group-tab.html",'<div class="main" ng-if="!vm_cg.group">\n  <md-subheader>\n    <div layout="row">\n      \x3c!-- START Search --\x3e\n      <div class="search" layout="row" layout-align="start center" flex>\n        <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n        <input ng-model="vm_cg.search" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n      </div>\n      \x3c!-- END Search --\x3e\n\n      \x3c!-- START New Group --\x3e\n      <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-icon-button" aria-label="New" ng-click="vm_cg.addGroup(null, $event)">\n        <md-icon md-font-icon="icon-account-multiple-plus" class="icon"></md-icon>\n      </md-button>\n      \x3c!-- END New Group --\x3e\n    </div>\n  </md-subheader>\n\n  <md-divider></md-divider>\n\n  \x3c!-- START Groups --\x3e\n  <md-list class="recent no-padding">\n    \x3c!-- START Group --\x3e\n    <md-list-item class="contact" ng-repeat="group in vm_cg.groupsToArray() | filter:vm_cg.search" ng-click="vm_cg.toggleChat(group)">\n      <img src="assets/images/avatars/group.png" class="md-avatar" alt="{{group.name}}" />\n      <div ng-if="group.unreadGroupMessages" class="md-accent-bg unread-message-count">{{group.unreadGroupMessages}}</div>\n      <div class="md-list-item-text">\n        <div layout="row">\n          <h3>{{group.name}}</h3>\n        </div>\n      </div>\n\n      <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-secondary md-icon-button" aria-label="Remove" ng-click="vm_cg.deleteGroup(group, $event)">\n        <md-icon md-font-icon="icon-delete" class="icon s18"></md-icon>\n      </md-button>\n\n      <md-divider ng-if="!$last"></md-divider>\n    </md-list-item>\n    <md-list-item>\n      <div ng-if="!vm_cg.groupsToArray().length" layout="row" layout-align="center center" flex>\n        <span>{{\'QUICKPANEL.NO_AVAILABLE_GROUPS\' | translate}}</span>\n      </div>\n    </md-list-item>\n    \x3c!-- END Group --\x3e\n  </md-list>\n  \x3c!-- END Groups --\x3e\n</div>\n\n<div class="chat" ng-if="vm_cg.group" layout="column">\n  <md-toolbar class="md-accent">\n    <div class="md-toolbar-tools " layout="row" layout-align="space-between center">\n      <md-button class="md-icon-button" ng-click="vm_cg.back()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK" flex="15">\n        <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n      </md-button>\n      <h4 flex layout-align="start center" style="max-height: 100%; overflow-y:auto;">\n        <span translate="QUICKPANEL.YOU" translate-values=\'{participants: vm_cg.participants}\'></span>\n      </h4>\n\n      <div layout="row" layout-align="end center">\n        <md-button ng-if="vm_cg.license.webrtc && vm_cg.currentUser.role === \'agent\' && vm_cg.currentUser.showWebBar === 2 && vm_cg.user.role === \'agent\' && vm_cg.user.showWebBar === 2" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_cg.webcall(vm_cg.user.name)">\n          <md-icon md-font-icon="icon-phone"></md-icon>\n        </md-button>\n      </div>\n    </div>\n\n  </md-toolbar>\n  <md-content flex layout-paddings id="chat-group-dialog">\n    <div layout="row" ng-repeat="message in vm_cg.group.messages" class="message-row" ng-class="message.FromId === vm_cg.currentUser.id ? \'user\' : \'contact\'">\n      <img ng-if="message.FromId !== vm_cg.currentUser.id" ng-src="{{\'api/users/\' + message.FromId + \'/avatar\'}}" class="avatar" alt="{{vm_cg.user.fullname}}" />\n      <img ng-if="message.FromId === vm_cg.currentUser.id" class="avatar" ng-src="{{vm_cg.currentUser.userpic ? \'api/users/\' + vm_cg.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n      <div class="bubble" flex>\n        <div ng-if="message.FromId !== vm_cg.currentUser.id">\n          <span style="font-size: 12px;">{{vm_cg.group.membersByKeys[message.FromId].fullname}}</span>\n        </div>\n        <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n        <div layout="row" layout-align="end center">\n          <span class="time secondary-text" style="margin-top: 0px;">{{message.createdAt | formatdate }}</span>\n          <md-icon ng-if="message.FromId === vm_cg.currentUser.id" class="s16 margin-5" style="cursor: pointer;" md-font-icon="icon-information-outline" ng-click="vm_cg.showMessageInfo($event, message)"></md-icon>\n        </div>\n      </div>\n    </div>\n  </md-content>\n\n  <form ng-if="(vm_cg.currentUser.role !== \'agent\') || vm_cg.group.write" ng-submit="vm_cg.reply()" layout="row" class="reply" layout-align="start center">\n    <textarea ng-keyup="$event.keyCode == 13 ? vm_cg.reply() : null" flex ng-model="vm_cg.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n    <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n      <md-icon md-font-icon="icon-send"></md-icon>\n    </md-button>\n  </form>\n</div>'),e.put("app/quick-panel/tabs/groups/info/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n  <form name="groupForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div ng-if="vm.data.messages[$index].FromId !== vm.data.messages[$index].ToId" ng-repeat="user in vm.data.users" layout-margin>\n        <div layout="row">\n          <div layout="row" layout-align="start center">\n            <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{user.fullname}}" />\n            <span>{{user.fullname}}</span>\n          </div>\n          <div layout="row" layout-align="end center" flex>\n            <md-icon class="s16 margin-5" md-font-icon="{{vm.data.messages[$index].read ? \'icon-check-all md-accent\' : \'icon-check\'}}"></md-icon>\n            <span class="time secondary-text">{{vm.data.messages[$index].updatedAt | formatdate }}</span>\n          </div>\n        </div>\n        <div>\n          <md-divider ng-if="!$last"></md-divider>\n        </div>\n      </div>\n    </md-dialog-content>\n  </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/today/today-tab.html",'<md-list class="date">\n  <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.TODAY">Today</span></md-subheader>\n  <md-list-item class="md-display-1 md-2-line">\n    <div class="secondary-text">\n      <div translate="QUICKPANEL.{{ (vm.date | date:\'EEEE\').toUpperCase() }}"></div>\n      <div layout="row" layout-align="start start">\n        <span> {{vm.date | date:\'d\'}}</span>\n        <span class="md-subhead">th</span>\n        <span translate="QUICKPANEL.{{ (vm.date | date:\'MMMM\').toUpperCase() }}"></span>\n      </div>\n    </div>\n  </md-list-item>\n</md-list>\n\n\x3c!-- <md-divider></md-divider>\n\n<md-list>\n    <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.EVENTS">Events</span></md-subheader>\n\n    <md-list-item class="md-2-line" ng-repeat="event in vm.events" ng-click="dummyFunction()">\n        <div class="md-list-item-text">\n            <h3>{{event.title}}</h3>\n\n            <p>{{event.detail}}</p>\n        </div>\n    </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n    <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.NOTES">Notes</span></md-subheader>\n    <md-list-item class="md-2-line" ng-repeat="note in vm.notes" ng-click="dummyFunction()">\n        <div class="md-list-item-text">\n            <h3>{{note.title}}</h3>\n\n            <p>{{note.detail}}</p>\n        </div>\n    </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n    <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.QUICK_SETTINGS">Quick Settings</span></md-subheader>\n\n    <md-list-item>\n        <h3 translate="QUICKPANEL.NOTIFICATIONS">Notifications</h3>\n        <md-switch class="md-secondary" ng-model="vm.settings.notify" aria-label="Notifications" translate\n                   translate-attr-aria-label="QUICKPANEL.NOTIFICATIONS"></md-switch>\n    </md-list-item>\n\n    <md-list-item>\n        <h3 translate="QUICKPANEL.CLOUD_SYNC">Cloud Sync</h3>\n        <md-switch class="md-secondary" ng-model="vm.settings.cloud" aria-label="Cloud Sync" translate\n                   translate-attr-aria-label="QUICKPANEL.CLOUD_SYNC"></md-switch>\n    </md-list-item>\n\n    <md-list-item>\n        <h3 translate="QUICKPANEL.RETRO_THRUSTERS">Retro Thrusters</h3>\n        <md-switch class="md-secondary md-warn" ng-model="vm.settings.retro" aria-label="Retro Thrusters" translate\n                   translate-attr-aria-label="QUICKPANEL.RETRO_THRUSTERS"></md-switch>\n    </md-list-item>\n</md-list> --\x3e'),e.put("app/reset/reset.html",'<div id="reset-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()">\n  <div id="reset-password-form-wrapper" layout="column" layout-align="center center">\n    <div id="reset-password-form" class="md-whiteframe-8dp">\n\n      <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n      <div class="title" translate="RESETPASSWORD.TITLE">Reset your password</div>\n\n      <form name="resetPasswordForm" novalidate>\n\n        <md-input-container class="md-block" md-no-float>\n          <input type="password" name="password" ng-model="vm.form.password" ng-pattern="vm.passwordPattern" placeholder="Password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD" required>\n          <div ng-messages="resetPasswordForm.password.$error" role="alert">\n            <div ng-message="required">\n              <span translate="RESETPASSWORD.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n            </div>\n            <div ng-message="pattern">\n              <span translate="RESETPASSWORD.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-input-container class="md-block" md-no-float>\n          <input type="password" name="passwordConfirm" ng-model="vm.form.passwordConfirm" placeholder="Password (Confirm)" match-password="password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD_CONFIRM">\n          <div ng-messages="resetPasswordForm.passwordConfirm.$error" role="alert">\n            <div ng-message="passwordMatch">\n              <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n            </div>\n          </div>\n        </md-input-container>\n\n        <md-button type="button" ng-click="vm.resetPassword()" class="md-raised md-accent submit-button" aria-label="UPDATE MY PASSWORD" ng-disabled="resetPasswordForm.$invalid || resetPasswordForm.$pristine" translate="RESETPASSWORD.UPDATE_PASSWORD" translate-attr-aria-label="RESETPASSWORD.UPDATE_PASSWORD">\n          RESET MY PASSWORD\n        </md-button>\n      </form>\n    </div>\n  </div>\n</div>'),e.put("app/toolbar/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n  <form name="changePasswordForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span ng-if="vm.reset" class="title" translate="TOOLBAR.RESETPASSWORD">Reset Password</span>\n        <span ng-if="!vm.reset" class="title" translate="TOOLBAR.CHANGEPASSWORD">Change Password</span>\n        <md-button ng-if="!vm.reset" class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n      <md-input-container class="md-block">\n        <label translate="TOOLBAR.OLD_PASSWORD">Old Password</label>\n        <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="TOOLBAR.OLD_PASSWORD" required>\n        <div ng-messages="changePasswordForm.oldPassword.$error" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLBAR.NEW_PASSWORD">New Password</label>\n        <input type="password" name="password" ng-model="vm.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="TOOLBAR.NEW_PASSWORD" required>\n        <div ng-messages="changePasswordForm.password.$error" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n          </div>\n          <div ng-message="pattern">\n            <span translate="TOOLBAR.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n          </div>\n          <div ng-message="oldPasswordMatch">\n            <span translate="TOOLBAR.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n          </div>\n        </div>\n      </md-input-container>\n      <md-input-container class="md-block">\n        <label translate="TOOLBAR.CONFIRM_PASSWORD">Confirm Password</label>\n        <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n        <div ng-messages="changePasswordForm.confirmPassword.$error" role="alert" multiple>\n          <div ng-message="required">\n            <span translate="TOOLBAR.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n          </div>\n          <div ng-message="passwordMatch">\n            <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div class="error-list">\n        <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n          <div>\n            <span class="message">{{error.message}}</span>\n            <span class="type">({{error.type}})</span>\n          </div>\n          <md-button class="md-icon-button">\n            <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n          </md-button>\n        </div>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout="row" layout-align="space-between center">\n      <div layout="row" layout-align="start center">\n        <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="changePasswordForm.$invalid || changePasswordForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n          SAVE\n        </md-button>\n      </div>\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),e.put("app/toolbar/layouts/vertical-navigation/toolbar.html",'<div layout="row" layout-align="start center">\n  <div layout="row" layout-align="start center" flex>\n    <md-button id="navigation-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'navigation\')" hide-gt-sm aria-label="Toggle navigation" translate translate-attr-aria-label="TOOLBAR.TOGGLE_NAVIGATION">\n      <md-icon md-font-icon="icon-menu" class="icon"></md-icon>\n    </md-button>\n\n    <ms-shortcuts ng-if="!vm.isAgent()"></ms-shortcuts>\n\n    <div class="toolbar-separator"></div>\n\n    <div ng-if="vm.license.demo" class="blink md-padding">\n      <span class="md-warn-fg" translate="TOOLBAR.TRIAL_VERSION">Trial Version</span>\n    </div>\n\n    <div ng-if="vm.isAgent()" class="logo" layout-padding-left-8 layout="row" layout-align="start center">\n      <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n      <span ng-show="vm.isAgent() && (vm.user.showWebBar != 2)" class="logo-text text-truncate">{{ vm.getLogo() |\n        uppercase }}</span>\n    </div>\n\n    \x3c!-- phonebar directive WebRtc type--\x3e\n    <ms-phonebar class="ms-phonebar" ng-if="vm.isAgent() && (vm.user.showWebBar == 2)" conf="vm.conf" sessions="vm.webRTCSessions" flex></ms-phonebar>\n    \x3c!-- phonebar directive --\x3e\n  </div>\n\n  <div layout="row" layout-align="start center">\n\n    <md-progress-circular id="toolbar-progress" ng-if="$root.loadingProgress" class="md-accent" md-diameter="32">\n    </md-progress-circular>\n\n    \x3c!-- Pause Management --\x3e\n    <div ng-if="vm.isAgent() && (vm.user.showWebBar != 0)" layout="row" layout-align="end center">\n      <div class="toolbar-separator"></div>\n\n      <div class="border brad-5" layout="row" layout-align="center center" layout-margin>\n        <md-button ng-if="vm.user.voicePause" class="md-icon-button no-margin" ng-click="vm.unpause()">\n          <md-icon md-font-icon="icon-play-circle-outline" class="icon s24"></md-icon>\n          <md-tooltip md-direction="bottom">{{\'TOOLBAR.RESUME\' | translate}}</md-tooltip>\n        </md-button>\n\n        <md-button ng-disabled="vm.user.voicePause && \'DEFAULT PAUSE\' === vm.user.pauseType" class="md-icon-button no-margin" ng-click="vm.pause()">\n          <md-icon md-font-icon="icon-pause-circle-outline" class="icon s24"></md-icon>\n          <md-tooltip md-direction="bottom">{{\'TOOLBAR.PAUSE\' | translate}}</md-tooltip>\n        </md-button>\n\n        <md-menu>\n          <md-button aria-label="Pauses" class="md-icon-button no-margin" ng-click="$mdOpenMenu($event)">\n            <md-icon md-menu-origin md-font-icon="icon-dots-vertical"></md-icon>\n          </md-button>\n          <md-menu-content width="4">\n            <md-menu-item ng-if="!vm.pauses.length">\n              <md-button disabled="disabled">\n                <md-icon md-font-icon="icon-pause-octagon" md-menu-align-target></md-icon>\n                {{\'TOOLBAR.NO_PAUSES_AVAILABLE\' | translate}}\n              </md-button>\n            </md-menu-item>\n            <md-menu-item ng-repeat="pause in vm.pauses">\n              <md-button ng-disabled="vm.user.voicePause && pause.name === vm.user.pauseType" ng-click="vm.pause(pause.name)">\n                <md-icon md-font-icon="icon-pause-circle" md-menu-align-target></md-icon>\n                {{pause.name}}\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n    </div>\n    \x3c!-- Pause Management --\x3e\n\n    <div class="h5 padding-10" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)">\n      <div layout="row" layout-align="space-between center">\n        <timer ng-if="vm.user.lastLoginAt" start-time="vm.user.lastLoginAt"></timer>\n        <md-tooltip>{{\'TOOLBAR.LOGIN_TIME\' | translate}}</md-tooltip>\n        <md-icon md-font-icon="icon-timelapse" class="icon s16"></md-icon>\n      </div>\n      <div layout="row" layout-align="center center" ng-if="vm.user.voicePause">\n        <timer start-time="vm.user.lastPauseAt"></timer>\n        <md-tooltip>{{\'TOOLBAR.PAUSE_TIME\' | translate}}</md-tooltip>\n        <md-icon md-font-icon="icon-coffee" class="icon s16"></md-icon>\n      </div>\n      <div ng-if="vm.user.voicePause">\n        <span class="blink red-fg">{{vm.user.pauseType || \'default\' | uppercase}}</span>\n      </div>\n    </div>\n\n    <div class="toolbar-separator" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)"></div>\n\n    <md-menu-bar id="user-menu">\n      <md-menu md-position-mode="left bottom">\n        <md-button class="user-button" ng-click="$mdOpenMenu()" aria-label="User settings" translate translate-attr-aria-label="TOOLBAR.USER_SETTINGS">\n          <div layout="row" layout-align="space-between center">\n            <div class="avatar-wrapper">\n              <img md-menu-align-target class="avatar" src="assets/images/avatars/profile.png" ng-if="!vm.user.userpic">\n              <img md-menu-align-target class="avatar" ng-src="api/users/{{vm.user.id}}/avatar" ng-if="vm.user.userpic">\n              <md-icon md-font-icon ng-class="vm.userStatus.icon" ng-style="{\'color\': vm.userStatus.color }" class="icon status s16"></md-icon>\n            </div>\n            <div layout="column" layout-align="center center" class="padding-horizontal-5">\n              <span class="font-size-14 md-subhead">{{vm.user.fullname}}</span>\n              <span class="font-size-12 md-subhead">{{vm.user.name}} &#60;{{vm.user.internal}}&#62;</span>\n            </div>\n\n            <md-icon md-font-icon="icon-chevron-down" class="icon s16" hide-xs></md-icon>\n          </div>\n        </md-button>\n\n        <md-menu-content width="3">\n          <md-menu-item ng-if="vm.user.showWebBar == 2 && vm.user.phoneBarEnableSettings" class="md-indent">\n            <md-icon md-font-icon="icon-cog" class="icon"></md-icon>\n            <md-button ng-click="vm.openSettings($event)" ng-disabled="!vm.license.webrtc"><span translate="TOOLBAR.SETTINGS">SETTINGS</span></md-button>\n          </md-menu-item>\n\n          <md-menu-item class="md-indent">\n            <md-icon md-font-icon="icon-key-variant" class="icon"></md-icon>\n            <md-button ng-click="vm.changePassword($event)"><span translate="TOOLBAR.CHANGEPASSWORD">Change\n                Password</span></md-button>\n          </md-menu-item>\n\n          <md-menu-divider></md-menu-divider>\n\n          <md-menu-item class="md-indent">\n            <md-icon md-font-icon="icon-logout" class="icon"></md-icon>\n            <md-button ng-click="vm.logout()">Logout</md-button>\n          </md-menu-item>\n        </md-menu-content>\n      </md-menu>\n    </md-menu-bar>\n\n    <div class="toolbar-separator"></div>\n\n    <md-button ng-if="vm.user.role === \'agent\' && vm.license.dialer" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.preview($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n      <div ng-if="vm.contacts" class="md-accent-bg open-contact-count">{{vm.contacts > 99 ? \'99+\' : vm.contacts}}</div>\n      <md-icon md-font-icon="icon-fire" class="icon red-900-fg"></md-icon>\n      <md-tooltip><span translate="TOOLBAR.PREVIEW">Preview</span></md-tooltip>\n    </md-button>\n\n    <ms-search-bar ng-if="vm.user.role !== \'agent\'" on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300" collapse-on-blur="true"></ms-search-bar>\n\n    <md-menu id="language-menu" md-offset="0 72" md-position-mode="target-right target" layout="column" layout-align="center center">\n      <md-button class="md-icon-button no-margin" ng-click="$mdOpenMenu()" aria-label="Language" md-menu-origin md-menu-align-target>\n        <div layout="row" layout-align="center center">\n          <img class="flag" ng-src="assets/images/flags/{{vm.selectedLanguage.flag}}.png">\n        </div>\n      </md-button>\n\n      <md-menu-content width="3" id="language-menu-content">\n        <md-menu-item ng-repeat="(iso, lang) in vm.languages">\n          <md-button ng-click="vm.changeLanguage(lang)" aria-label="{{lang.title}}" translate translate-attr-aria-label="{{lang.title}}">\n            <span layout="row" layout-align="start center">\n              <img class="flag flag-24" ng-src="assets/images/flags/{{lang.flag}}.png">\n              <span>{{ lang.translation | translate | startcase }}</span>\n            </span>\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n\n    <div class="toolbar-separator"></div>\n\n    <md-button ng-if="vm.license.gray && vm.user.role !== \'agent\'" class="md-icon-button" ui-sref="app.settings.license" aria-label="Toggle quick panel">\n      <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n    </md-button>\n    <md-button ng-if="vm.license.gray && vm.user.role === \'agent\'" class="md-icon-button" aria-label="Toggle quick panel">\n      <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n    </md-button>\n\n    <div ng-if="vm.license.gray" class="toolbar-separator"></div>\n\n    <md-button id="quick-panel-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'quick-panel\')" aria-label="Toggle quick panel" translate translate-attr-aria-label="TOOLBAR.TOGGLE_QUICK_PANEL">\n      <div ng-if="(vm.unreadTotalMessages + vm.unreadTotalGroupMessages)" class="md-accent-bg unread-message-count">\n        {{vm.unreadTotalMessages + vm.unreadTotalGroupMessages}}</div>\n      <md-icon md-font-icon="icon-format-list-bulleted" class="icon"></md-icon>\n    </md-button>\n  </div>\n</div>'),e.put("app/toolbar/preview/dialog.html",'<md-dialog class="preview-dialog" aria-label="preview">\n  <form name="previewForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-background-bg">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ (\'TOOLBAR.PREVIEW\' | translate) + (vm.preview.recallme ? \' - \' +\n          (\'CONTACTMANAGER.RECALLME\' | translate | uppercase) : \'\') }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div ng-if="vm.preview">\n        <div ng-if="vm.preview.recallme" layout="row" class="recall-me-info">\n          <md-icon md-font-icon="icon-information-outline" aria-label="Recall Me"></md-icon>\n          <p class="ml-5" translate="TOOLBAR.HELP.PREVIEW_RECALLME" translate-values="{ date: (vm.preview.scheduledat | date:\'short\') }" flex></p>\n        </div>\n        <div layout="row">\n          <div class="md-padding md-margin" layout="column" flex="30">\n            <md-input-container ng-if="vm.preview.Contact.id" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.ID">ID</label>\n              <input type="text" ng-model="vm.preview.Contact.id" disabled="true">\n            </md-input-container>\n            <md-input-container ng-if="vm.preview.Queue.name" class="md-block no-margin">\n              <label translate="VOICE.QUEUE">Queue</label>\n              <input type="text" ng-model="vm.preview.Queue.name" disabled="true">\n            </md-input-container>\n            <md-input-container ng-if="vm.preview.List.name" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.LIST">List</label>\n              <input type="text" ng-model="vm.preview.List.name" disabled="true">\n            </md-input-container>\n            <md-input-container ng-if="vm.preview.Contact.tags && vm.preview.Contact.tags.length" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.TAGS">Tags</label>\n              <input type="text" ng-model="vm.preview.Contact.tags" disabled="true">\n            </md-input-container>\n            <md-input-container ng-if="vm.preview.Contact.Company && vm.preview.Contact.Company.name" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.COMPANY">Company</label>\n              <input type="text" ng-model="vm.preview.Contact.Company.name" disabled="true">\n            </md-input-container>\n          </div>\n          <md-divider></md-divider>\n          <div class="md-padding md-margin" layout="column" flex="35">\n            <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && !vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n              <label>{{ \'CONTACTMANAGER.\' + key.toUpperCase() | translate}}</label>\n              <input type="text" ng-model="value" disabled="true">\n            </md-input-container>\n          </div>\n          <div class="md-padding md-margin" layout="column" flex="35">\n            <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n              <label>{{ vm.customFieldsMap[key] || key }}</label>\n              <input type="text" ng-model="value" disabled="true">\n            </md-input-container>\n          </div>\n        </div>\n      </div>\n      <div layout="row" ng-if="!vm.preview">\n        <span>no contacts available</span>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n      <md-button class="md-icon-button md-primary" ng-hide="vm.hopperIds.length <= 1" ng-disabled="vm.disableGetContact" ng-click="vm.previousContact()" aria-label="PREVIOUSCONTACT" translate-attr-aria-label="TOOLS.PREVIOUSCONTACT">\n        <md-icon md-font-icon="icon-chevron-left"></md-icon>\n      </md-button>\n      <md-button class="md-fab green-bg" aria-label="CALL" translate-attr-aria-label="TOOLS.CALL" ng-disabled="vm.disable" ng-click="vm.originatePreview($event)">\n        <md-icon md-font-icon="icon-phone"></md-icon>\n      </md-button>\n      <md-button class="md-icon-button md-primary" ng-disabled="vm.disableGetContact" ng-click="vm.nextContact()" aria-label="NEXTCONTACT" translate-attr-aria-label="TOOLS.NEXTCONTACT">\n        <md-icon md-font-icon="icon-chevron-right"></md-icon>\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>')}]);
\ No newline at end of file
similarity index 83%
rename from public/styles/app.ba338534.css
rename to public/styles/app.712019a1.css
index c12d44e..a1b5925 100644 (file)
@@ -1 +1 @@
-[data-ng-click],[ng-click],[x-ng-click]{cursor:pointer}.ms-container{width:100%!important}.dark-lime-fg{color:#575b2e!important}.dark-red-fg{color:#9e3333!important}.iron-fg{color:#555865!important}.light-brown-fg{color:#645733!important}.ms-container .ms-list{height:380px!important}.ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection{padding:6px 12px!important;height:34px!important}md-input-container:not(.md-input-has-value) input:not(:focus){color:inherit!important}.ms-container .ms-search{height:34px;margin-bottom:5px;border:solid 1px #e5e5e5;background-color:#fff;box-shadow:none;width:100%;padding-left:6px}.ms-container .ms-footer{text-align:center}.no-border{border:none!important}.left .motion-spinner{border-top-color:#00d7cc!important;border-left-color:#00d7cc!important}.right .motion-spinner{border-top-color:#00d7cc!important;border-right-color:#00d7cc!important}.md-option-info-text{font-size:10px}md-pagination-wrapper{width:auto!important}md-autocomplete.no-container-margin md-autocomplete-wrap md-input-container{margin:0!important}md-dialog.report-selection-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}md-dialog.advanced-search-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}.md-dialog-action-center{justify-content:center!important}.flag-24{height:24px}button.auto-width{min-width:auto!important}button.size-8{transform:scale(.8)}md-icon.auto-size{height:auto!important;width:auto!important}md-switch.auto-height{height:auto!important}.hidden{visibility:hidden}.user-profile-section-help{background:#fcf20f0f;border:1px solid rgba(0,0,0,.12);padding:5px}.email-preview-message{display:-webkit-box;margin:0 auto;display:block;height:200px;line-height:1.4;-webkit-line-clamp:10;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-all}button.advanced-search.md-accent-bg.md-button.md-default-theme:not([disabled]).md-icon-button:hover{background-color:#0091ea}.blink{animation:blink 2s ease-in infinite}.no-click{pointer-events:none}.spinner-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;background:rgba(43,43,43,.5)}ms-quick-filter[disabled]{pointer-events:none;opacity:.7}ms-search-bar[disabled]{pointer-events:none;opacity:.7}@keyframes blink{from,to{opacity:1}50%{opacity:0}}textarea.api-key-area{background:0 0;resize:none}.badge{min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transition:opacity .2s ease-in-out .1s}md-tooltip.multiline div.md-content{height:auto!important}.auto-margin{margin:auto}md-menu-item md-menu.no-margin button{display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}md-date-range md-menu span.md-select-value{border-bottom-color:rgba(0,0,0,.12)}.keep-on-top{z-index:9999!important}.margin-auto{margin:auto}.xenialab-violet-light-bg{background-color:#9c4fd3!important}.xenialab-violet-light-fg{color:#9c4fd3!important}.no-margin-top{margin-top:0!important}.no-margin-bottom{margin-bottom:0!important}.disabled-button{display:inline-block;position:relative;cursor:default;min-height:36px;min-width:88px;line-height:36px;vertical-align:middle;align-items:center;text-align:center;border-radius:3px;box-sizing:border-box;user-select:none;outline:0;border:0;padding:0 6px;margin:6px 8px;background:rgba(0,0,0,.12);color:rgba(0,0,0,.38);white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;font-style:inherit;font-variant:inherit;font-family:inherit;text-decoration:none;overflow:hidden}.word-break-all{word-break:break-all}@supports (-ms-ime-align:auto){md-tabs{display:inline!important}}@supports (-ms-accelerator:true){md-tabs{display:inline!important}}@supports (-moz-transform:translate(0,0)){md-tabs{display:inline!important}}body[dir=rtl] table.md-table td.md-cell,body[dir=rtl] table.md-table th.md-column{text-align:right!important}body[dir=rtl] table.md-table td.md-cell md-checkbox,body[dir=rtl] table.md-table th.md-column md-checkbox{margin-right:12px!important}body[dir=rtl] .ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button .icon{margin:0 0 0 16px!important}body[dir=rtl] .ms-navigation .ms-navigation-node .ms-navigation-item>a.ms-navigation-button{padding-right:45px}body[dir=rtl] .md-table-pagination>.buttons{direction:ltr}body[dir=rtl] .md-table-pagination>.buttons>.label{direction:rtl}body[dir=rtl] .header .logo .logo-icon{margin:5px 0 0 15px!important}body[dir=rtl] md-switch .md-container{margin-right:inherit!important}#toasty.toasty-position-top-right{top:64px}.preview_cancel{padding:5px;float:left;background-color:red}.preview_open{padding:5px;float:right;background-color:green}.hover-token{cursor:pointer}body,html{height:100%;position:relative}body{margin:0;padding:0}[tabindex='-1']:focus{outline:0}.inset{padding:10px}a.md-no-style,button.md-no-style{font-weight:400;background-color:inherit;text-align:left;border:none;padding:0;margin:0}button,input,select,textarea{vertical-align:baseline}button,html input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[type=button][disabled],input[type=reset][disabled],input[type=submit][disabled]{cursor:default}textarea{vertical-align:top;overflow:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box;-webkit-box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input:-webkit-autofill{text-shadow:none}.md-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;text-transform:none;width:1px}.md-shadow{position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;pointer-events:none}.md-shadow-bottom-z-1{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-shadow-bottom-z-2{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-shadow-animated.md-shadow{transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.md-ripple-container{pointer-events:none;position:absolute;overflow:hidden;left:0;top:0;width:100%;height:100%;transition:all .55s cubic-bezier(.25,.8,.25,1)}.md-ripple{position:absolute;transform:translate(-50%,-50%) scale(0);transform-origin:50% 50%;opacity:0;border-radius:50%}.md-ripple.md-ripple-placed{transition:margin .9s cubic-bezier(.25,.8,.25,1),border .9s cubic-bezier(.25,.8,.25,1),width .9s cubic-bezier(.25,.8,.25,1),height .9s cubic-bezier(.25,.8,.25,1),opacity .9s cubic-bezier(.25,.8,.25,1),transform .9s cubic-bezier(.25,.8,.25,1)}.md-ripple.md-ripple-scaled{transform:translate(-50%,-50%) scale(1)}.md-ripple.md-ripple-active,.md-ripple.md-ripple-full,.md-ripple.md-ripple-visible{opacity:.2}.md-ripple.md-ripple-remove{animation:md-remove-ripple .9s cubic-bezier(.25,.8,.25,1)}@keyframes md-remove-ripple{0%{opacity:.15}100%{opacity:0}}.md-padding{padding:8px}.md-margin{margin:8px}.md-scroll-mask{position:absolute;background-color:transparent;top:0;right:0;bottom:0;left:0;z-index:50}.md-scroll-mask>.md-scroll-mask-bar{display:block;position:absolute;background-color:#fafafa;right:0;top:0;bottom:0;z-index:65;box-shadow:inset 0 0 1px rgba(0,0,0,.3)}.md-no-momentum{-webkit-overflow-scrolling:auto}.md-no-flicker{-webkit-filter:blur(0)}@media (min-width:960px){.md-padding{padding:16px}}body[dir=ltr],body[dir=rtl],html[dir=ltr],html[dir=rtl]{unicode-bidi:embed}bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}body,html{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.md-display-4{font-size:112px;font-weight:300;letter-spacing:-.010em;line-height:112px}.md-display-3{font-size:56px;font-weight:400;letter-spacing:-.005em;line-height:56px}.md-display-2{font-size:45px;font-weight:400;line-height:64px}.md-display-1{font-size:34px;font-weight:400;line-height:40px}.md-headline{font-size:24px;font-weight:400;line-height:32px}.md-title{font-size:20px;font-weight:500;letter-spacing:.005em}.md-subhead{font-size:16px;font-weight:400;letter-spacing:.010em;line-height:24px}.md-body-1{font-size:14px;font-weight:400;letter-spacing:.010em;line-height:20px}.md-body-2{font-size:14px;font-weight:500;letter-spacing:.010em;line-height:24px}.md-caption{font-size:12px;letter-spacing:.020em}.md-button{letter-spacing:.010em}button,html,input,select,textarea{font-family:Roboto,"Helvetica Neue",sans-serif}button,input,select,textarea{font-size:100%}@keyframes md-autocomplete-list-out{0%{animation-timing-function:linear}50%{opacity:0;height:40px;animation-timing-function:ease-in}100%{height:0;opacity:0}}@keyframes md-autocomplete-list-in{0%{opacity:0;height:0;animation-timing-function:ease-out}50%{opacity:0;height:40px}100%{opacity:1;height:40px}}md-autocomplete{border-radius:2px;display:block;height:40px;position:relative;overflow:visible;min-width:190px}md-autocomplete[disabled] input{cursor:default}md-autocomplete[md-floating-label]{border-radius:0;background:0 0;height:auto}md-autocomplete[md-floating-label] md-input-container{padding-bottom:0}md-autocomplete[md-floating-label] md-autocomplete-wrap{height:auto}md-autocomplete[md-floating-label] button{position:absolute;top:auto;bottom:0;right:0;width:30px;height:30px}md-autocomplete md-autocomplete-wrap{display:flex;flex-direction:row;box-sizing:border-box;position:relative;overflow:visible;height:40px}md-autocomplete md-autocomplete-wrap.md-menu-showing{z-index:51}md-autocomplete md-autocomplete-wrap input,md-autocomplete md-autocomplete-wrap md-input-container{flex:1 1 0%;box-sizing:border-box;min-width:0}md-autocomplete md-autocomplete-wrap md-progress-linear{position:absolute;bottom:-2px;left:0}md-autocomplete md-autocomplete-wrap md-progress-linear.md-inline{bottom:40px;right:2px;left:2px;width:auto}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate{position:absolute;top:0;left:0;width:100%;height:3px;transition:none}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate .md-container{transition:none;height:3px}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter.ng-enter-active{opacity:1}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave.ng-leave-active{opacity:0}md-autocomplete input:not(.md-input){font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:0;background:0 0;width:100%;padding:0 15px;line-height:40px;height:40px}md-autocomplete input:not(.md-input)::-ms-clear{display:none}md-autocomplete button{position:relative;line-height:20px;text-align:center;width:30px;height:30px;cursor:pointer;border:none;border-radius:50%;padding:0;font-size:12px;background:0 0;margin:auto 5px}md-autocomplete button:after{content:'';position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;border-radius:50%;transform:scale(0);opacity:0;transition:all .4s cubic-bezier(.25,.8,.25,1)}md-autocomplete button:focus{outline:0}md-autocomplete button:focus:after{transform:scale(1);opacity:1}md-autocomplete button md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%,-50%,0) scale(.9)}md-autocomplete button md-icon path{stroke-width:0}md-autocomplete button.ng-enter{transform:scale(0);transition:transform .15s ease-out}md-autocomplete button.ng-enter.ng-enter-active{transform:scale(1)}md-autocomplete button.ng-leave{transition:transform .15s ease-out}md-autocomplete button.ng-leave.ng-leave-active{transform:scale(0)}@media screen and (-ms-high-contrast:active){md-autocomplete input{border:1px solid #fff}md-autocomplete li:focus{color:#fff}}.md-virtual-repeat-container.md-autocomplete-suggestions-container{position:absolute;box-shadow:0 2px 5px rgba(0,0,0,.25);height:225.5px;max-height:225.5px;z-index:100}.md-virtual-repeat-container.md-not-found{height:48px}.md-autocomplete-suggestions{margin:0;list-style:none;padding:0}.md-autocomplete-suggestions li{font-size:14px;overflow:hidden;padding:0 15px;line-height:48px;height:48px;transition:background .15s linear;margin:0;white-space:nowrap;text-overflow:ellipsis}.md-autocomplete-suggestions li:focus{outline:0}.md-autocomplete-suggestions li:not(.md-not-found-wrapper){cursor:pointer}@media screen and (-ms-high-contrast:active){.md-autocomplete-suggestions,md-autocomplete{border:1px solid #fff}}md-backdrop{transition:opacity 450ms;position:absolute;top:0;bottom:0;left:0;right:0;z-index:50}md-backdrop.md-menu-backdrop{position:fixed!important;z-index:99}md-backdrop.md-select-backdrop{z-index:81;transition-duration:0}md-backdrop.md-dialog-backdrop{z-index:79}md-backdrop.md-bottom-sheet-backdrop{z-index:69}md-backdrop.md-sidenav-backdrop{z-index:59}md-backdrop.md-click-catcher{position:absolute}md-backdrop.md-opaque{opacity:.48}md-backdrop.md-opaque.ng-enter{opacity:0}md-backdrop.md-opaque.ng-enter.md-opaque.ng-enter-active{opacity:.48}md-backdrop.md-opaque.ng-leave{opacity:.48;transition:opacity .4s}md-backdrop.md-opaque.ng-leave.md-opaque.ng-leave-active{opacity:0}md-bottom-sheet{position:absolute;left:0;right:0;bottom:0;padding:8px 16px 88px 16px;z-index:70;border-top-width:1px;border-top-style:solid;transform:translate3d(0,80px,0);transition:all .4s cubic-bezier(.25,.8,.25,1);transition-property:transform}md-bottom-sheet.md-has-header{padding-top:0}md-bottom-sheet.ng-enter{opacity:0;transform:translate3d(0,100%,0)}md-bottom-sheet.ng-enter-active{opacity:1;display:block;transform:translate3d(0,80px,0)!important}md-bottom-sheet.ng-leave-active{transform:translate3d(0,100%,0)!important;transition:all .3s cubic-bezier(.55,0,.55,.2)}md-bottom-sheet .md-subheader{background-color:transparent;font-family:Roboto,"Helvetica Neue",sans-serif;line-height:56px;padding:0;white-space:nowrap}md-bottom-sheet md-inline-icon{display:inline-block;height:24px;width:24px;fill:#444}md-bottom-sheet md-list-item{display:flex;outline:0}md-bottom-sheet md-list-item:hover{cursor:pointer}md-bottom-sheet.md-list md-list-item{padding:0;align-items:center;height:48px}md-bottom-sheet.md-grid{padding-left:24px;padding-right:24px;padding-top:0}md-bottom-sheet.md-grid md-list{display:flex;flex-direction:row;flex-wrap:wrap;transition:all .5s;align-items:center}md-bottom-sheet.md-grid md-list-item{flex-direction:column;align-items:center;transition:all .5s;height:96px;margin-top:8px;margin-bottom:8px}@media (max-width:960px){md-bottom-sheet.md-grid md-list-item{flex:1 1 33.3333333333%;max-width:33.3333333333%}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n+1){align-items:flex-start}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n){align-items:flex-end}}@media (min-width:960px) and (max-width:1279px){md-bottom-sheet.md-grid md-list-item{flex:1 1 25%;max-width:25%}}@media (min-width:1280px) and (max-width:1919px){md-bottom-sheet.md-grid md-list-item{flex:1 1 16.6666666667%;max-width:16.6666666667%}}@media (min-width:1920px){md-bottom-sheet.md-grid md-list-item{flex:1 1 14.2857142857%;max-width:14.2857142857%}}md-bottom-sheet.md-grid md-list-item::before{display:none}md-bottom-sheet.md-grid md-list-item .md-list-item-content{display:flex;flex-direction:column;align-items:center;width:48px;padding-bottom:16px}md-bottom-sheet.md-grid md-list-item .md-grid-item-content{border:1px solid transparent;display:flex;flex-direction:column;align-items:center;width:80px}md-bottom-sheet.md-grid md-list-item .md-grid-text{font-weight:400;line-height:16px;font-size:13px;margin:0;white-space:nowrap;width:64px;text-align:center;text-transform:none;padding-top:8px}@media screen and (-ms-high-contrast:active){md-bottom-sheet{border:1px solid #fff}}button.md-button::-moz-focus-inner{border:0}.md-button{display:inline-block;position:relative;cursor:pointer;min-height:36px;min-width:88px;line-height:36px;vertical-align:middle;align-items:center;text-align:center;border-radius:3px;box-sizing:border-box;user-select:none;outline:0;border:0;padding:0 6px;margin:6px 8px;background:0 0;color:currentColor;white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;font-style:inherit;font-variant:inherit;font-family:inherit;text-decoration:none;overflow:hidden;transition:box-shadow .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1)}.md-button:focus{outline:0}.md-button:focus,.md-button:hover{text-decoration:none}.md-button.ng-hide,.md-button.ng-leave{transition:none}.md-button.md-cornered{border-radius:0}.md-button.md-icon{padding:0;background:0 0}.md-button.md-raised:not([disabled]){box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button.md-icon-button{margin:0 6px;height:40px;min-width:0;line-height:24px;padding:8px;width:40px;border-radius:50%}.md-button.md-icon-button .md-ripple-container{border-radius:50%;background-clip:padding-box;overflow:hidden;-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.md-button.md-fab{z-index:20;line-height:56px;min-width:0;width:56px;height:56px;vertical-align:middle;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:50%;background-clip:padding-box;overflow:hidden;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-property:background-color,box-shadow,transform}.md-button.md-fab.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}.md-button.md-fab.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}.md-button.md-fab.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}.md-button.md-fab.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}.md-button.md-fab .md-ripple-container{border-radius:50%;background-clip:padding-box;overflow:hidden;-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.md-button.md-fab.md-mini{line-height:40px;width:40px;height:40px}.md-button.md-fab.ng-hide,.md-button.md-fab.ng-leave{transition:none}.md-button:not([disabled]).md-fab.md-focused,.md-button:not([disabled]).md-raised.md-focused{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button:not([disabled]).md-fab:active,.md-button:not([disabled]).md-raised:active{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-button .md-ripple-container{border-radius:3px;background-clip:padding-box;overflow:hidden;-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.md-button.md-icon-button md-icon,button.md-button.md-fab md-icon{display:block}.md-toast-open-top .md-button.md-fab-top-left,.md-toast-open-top .md-button.md-fab-top-right{transition:all .4s cubic-bezier(.25,.8,.25,1);transform:translate3d(0,42px,0)}.md-toast-open-top .md-button.md-fab-top-left:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-left:not([disabled]):hover,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]):hover{transform:translate3d(0,41px,0)}.md-toast-open-bottom .md-button.md-fab-bottom-left,.md-toast-open-bottom .md-button.md-fab-bottom-right{transition:all .4s cubic-bezier(.25,.8,.25,1);transform:translate3d(0,-42px,0)}.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]):hover,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]):hover{transform:translate3d(0,-43px,0)}.md-button-group{display:flex;flex:1;width:100%}.md-button-group>.md-button{flex:1;display:block;overflow:hidden;width:0;border-width:1px 0 1px 1px;border-radius:0;text-align:center;text-overflow:ellipsis;white-space:nowrap}.md-button-group>.md-button:first-child{border-radius:2px 0 0 2px}.md-button-group>.md-button:last-child{border-right-width:1px;border-radius:0 2px 2px 0}@media screen and (-ms-high-contrast:active){.md-button.md-fab,.md-button.md-raised{border:1px solid #fff}}md-card{box-sizing:border-box;display:flex;flex-direction:column;margin:8px;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}md-card md-card-header{padding:16px;display:flex;flex-direction:row}md-card md-card-header:first-child md-card-avatar{margin-right:12px}[dir=rtl] md-card md-card-header:first-child md-card-avatar{margin-right:auto;margin-left:12px}md-card md-card-header:last-child md-card-avatar{margin-left:12px}[dir=rtl] md-card md-card-header:last-child md-card-avatar{margin-left:auto;margin-right:12px}md-card md-card-header md-card-avatar{width:40px;height:40px}md-card md-card-header md-card-avatar .md-user-avatar,md-card md-card-header md-card-avatar md-icon{border-radius:50%}md-card md-card-header md-card-avatar md-icon{padding:8px}md-card md-card-header md-card-avatar+md-card-header-text{max-height:40px}md-card md-card-header md-card-avatar+md-card-header-text .md-title{font-size:14px}md-card md-card-header md-card-header-text{display:flex;flex:1;flex-direction:column}md-card md-card-header md-card-header-text .md-subhead{font-size:14px}md-card md-card-title-media img,md-card>img,md-card>md-card-header img{box-sizing:border-box;display:flex;flex:0 0 auto;width:100%;height:auto}md-card md-card-title{padding:24px 16px 16px;display:flex;flex:1 1 auto;flex-direction:row}md-card md-card-title+md-card-content{padding-top:0}md-card md-card-title md-card-title-text{flex:1;flex-direction:column;display:flex}md-card md-card-title md-card-title-text .md-subhead{padding-top:0;font-size:14px}md-card md-card-title md-card-title-text:only-child .md-subhead{padding-top:12px}md-card md-card-title md-card-title-media{margin-top:-8px}md-card md-card-title md-card-title-media .md-media-sm{height:80px;width:80px}md-card md-card-title md-card-title-media .md-media-md{height:112px;width:112px}md-card md-card-title md-card-title-media .md-media-lg{height:152px;width:152px}md-card md-card-content{display:block;padding:16px}md-card md-card-content>p:first-child{margin-top:0}md-card md-card-content>p:last-child{margin-bottom:0}md-card md-card-content .md-media-xl{height:240px;width:240px}md-card .md-actions,md-card md-card-actions{margin:8px}md-card .md-actions.layout-column .md-button:not(.md-icon-button),md-card md-card-actions.layout-column .md-button:not(.md-icon-button){margin:2px 0}md-card .md-actions.layout-column .md-button:not(.md-icon-button):first-of-type,md-card md-card-actions.layout-column .md-button:not(.md-icon-button):first-of-type{margin-top:0}md-card .md-actions.layout-column .md-button:not(.md-icon-button):last-of-type,md-card md-card-actions.layout-column .md-button:not(.md-icon-button):last-of-type{margin-bottom:0}md-card .md-actions.layout-column .md-button.md-icon-button,md-card md-card-actions.layout-column .md-button.md-icon-button{margin-top:6px;margin-bottom:6px}md-card .md-actions md-card-icon-actions,md-card md-card-actions md-card-icon-actions{flex:1;justify-content:flex-start;display:flex;flex-direction:row}md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button),md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button){margin:0 4px}md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type,md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:0}[dir=rtl] md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type,[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:auto;margin-right:0}md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type,md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:0}[dir=rtl] md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type,[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:auto;margin-left:0}md-card .md-actions:not(.layout-column) .md-button.md-icon-button,md-card md-card-actions:not(.layout-column) .md-button.md-icon-button{margin-left:6px;margin-right:6px}md-card .md-actions:not(.layout-column) .md-button.md-icon-button:first-of-type,md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:12px}[dir=rtl] md-card .md-actions:not(.layout-column) .md-button.md-icon-button:first-of-type,[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:auto;margin-right:12px}md-card .md-actions:not(.layout-column) .md-button.md-icon-button:last-of-type,md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:12px}[dir=rtl] md-card .md-actions:not(.layout-column) .md-button.md-icon-button:last-of-type,[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:auto;margin-left:12px}md-card .md-actions:not(.layout-column) .md-button+md-card-icon-actions,md-card md-card-actions:not(.layout-column) .md-button+md-card-icon-actions{flex:1;justify-content:flex-end;display:flex;flex-direction:row}md-card md-card-footer{margin-top:auto;padding:16px}@media screen and (-ms-high-contrast:active){md-card{border:1px solid #fff}}.md-image-no-fill>img{width:auto;height:auto}.md-contact-chips .md-chips md-chip{padding:0 25px 0 0}[dir=rtl] .md-contact-chips .md-chips md-chip{padding:0 0 0 25px}.md-contact-chips .md-chips md-chip .md-contact-avatar{float:left}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-avatar{float:right}.md-contact-chips .md-chips md-chip .md-contact-avatar img{height:32px;border-radius:16px}.md-contact-chips .md-chips md-chip .md-contact-name{display:inline-block;height:32px;margin-left:8px}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion{height:56px}.md-contact-suggestion img{height:40px;border-radius:20px;margin-top:8px}.md-contact-suggestion .md-contact-name{margin-left:8px;width:120px}[dir=rtl] .md-contact-suggestion .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion .md-contact-email,.md-contact-suggestion .md-contact-name{display:inline-block;overflow:hidden;text-overflow:ellipsis}.md-contact-chips-suggestions li{height:100%}.md-chips{display:block;font-family:Roboto,"Helvetica Neue",sans-serif;font-size:16px;padding:0 0 8px 3px;vertical-align:middle}.md-chips:after{content:'';display:table;clear:both}[dir=rtl] .md-chips{padding:0 3px 8px 0}.md-chips.md-readonly .md-chip-input-container{min-height:32px}.md-chips:not(.md-readonly){cursor:text}.md-chips.md-removable md-chip{padding-right:22px}[dir=rtl] .md-chips.md-removable md-chip{padding-right:0;padding-left:22px}.md-chips.md-removable md-chip .md-chip-content{padding-right:4px}[dir=rtl] .md-chips.md-removable md-chip .md-chip-content{padding-right:0;padding-left:4px}.md-chips md-chip{cursor:default;border-radius:16px;display:block;height:32px;line-height:32px;margin:8px 8px 0 0;padding:0 12px 0 12px;float:left;box-sizing:border-box;max-width:100%;position:relative}[dir=rtl] .md-chips md-chip{margin:8px 0 0 8px}[dir=rtl] .md-chips md-chip{float:right}.md-chips md-chip .md-chip-content{display:block;float:left;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-chips md-chip .md-chip-content{float:right}.md-chips md-chip .md-chip-content:focus{outline:0}.md-chips md-chip._md-chip-content-edit-is-enabled{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.md-chips md-chip .md-chip-remove-container{position:absolute;right:0;line-height:22px}[dir=rtl] .md-chips md-chip .md-chip-remove-container{right:auto;left:0}.md-chips md-chip .md-chip-remove{text-align:center;width:32px;height:32px;min-width:0;padding:0;background:0 0;border:none;box-shadow:none;margin:0;position:relative}.md-chips md-chip .md-chip-remove md-icon{height:18px;width:18px;position:absolute;top:50%;left:50%;transform:translate3d(-50%,-50%,0)}.md-chips .md-chip-input-container{display:block;line-height:32px;margin:8px 8px 0 0;padding:0;float:left}[dir=rtl] .md-chips .md-chip-input-container{margin:8px 0 0 8px}[dir=rtl] .md-chips .md-chip-input-container{float:right}.md-chips .md-chip-input-container input:not([type]),.md-chips .md-chip-input-container input[type=email],.md-chips .md-chip-input-container input[type=number],.md-chips .md-chip-input-container input[type=tel],.md-chips .md-chip-input-container input[type=text],.md-chips .md-chip-input-container input[type=url]{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:not([type]):focus,.md-chips .md-chip-input-container input[type=email]:focus,.md-chips .md-chip-input-container input[type=number]:focus,.md-chips .md-chip-input-container input[type=tel]:focus,.md-chips .md-chip-input-container input[type=text]:focus,.md-chips .md-chip-input-container input[type=url]:focus{outline:0}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{background:0 0;height:32px}.md-chips .md-chip-input-container md-autocomplete md-autocomplete-wrap{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container input{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:focus{outline:0}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{height:32px}.md-chips .md-chip-input-container md-autocomplete{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container:not(:first-child){margin:8px 8px 0 0}[dir=rtl] .md-chips .md-chip-input-container:not(:first-child){margin:8px 0 0 8px}.md-chips .md-chip-input-container input{background:0 0;border-width:0}.md-chips md-autocomplete button{display:none}@media screen and (-ms-high-contrast:active){.md-chip-input-container,md-chip{border:1px solid #fff}.md-chip-input-container md-autocomplete{border:none}}.md-inline-form md-checkbox{margin:19px 0 18px}md-checkbox{box-sizing:border-box;display:inline-block;margin-bottom:16px;white-space:nowrap;cursor:pointer;outline:0;user-select:none;position:relative;min-width:20px;min-height:20px;margin-left:0;margin-right:16px}[dir=rtl] md-checkbox{margin-left:16px}[dir=rtl] md-checkbox{margin-right:0}md-checkbox:last-of-type{margin-left:0;margin-right:0}md-checkbox.md-focused:not([disabled]) .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-checkbox.md-focused:not([disabled]):not(.md-checked) .md-container:before{background-color:rgba(0,0,0,.12)}md-checkbox.md-align-top-left>div.md-container{top:12px}md-checkbox .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;left:0;right:auto}[dir=rtl] md-checkbox .md-container{left:auto}[dir=rtl] md-checkbox .md-container{right:0}md-checkbox .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-checkbox .md-container:after{box-sizing:border-box;content:'';position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-checkbox .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-checkbox .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:20px;height:20px;border-width:2px;border-style:solid;border-radius:2px}md-checkbox.md-checked .md-icon{border-color:transparent}md-checkbox.md-checked .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4.6666666667px;top:.2222222222px;display:table;width:6.6666666667px;height:13.3333333333px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:''}md-checkbox[disabled]{cursor:default}md-checkbox.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:table;width:12px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:''}md-checkbox .md-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;margin-left:30px;margin-right:0}[dir=rtl] md-checkbox .md-label{margin-left:0}[dir=rtl] md-checkbox .md-label{margin-right:30px}md-content{display:block;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}md-content[md-scroll-y]{overflow-y:auto;overflow-x:hidden}md-content[md-scroll-x]{overflow-x:auto;overflow-y:hidden}@media print{md-content{overflow:visible!important}}md-calendar{font-size:13px;user-select:none}.md-calendar-scroll-mask{display:inline-block;overflow:hidden;height:308px}.md-calendar-scroll-mask .md-virtual-repeat-scroller{overflow-y:scroll;-webkit-overflow-scrolling:touch}.md-calendar-scroll-mask .md-virtual-repeat-scroller::-webkit-scrollbar{display:none}.md-calendar-scroll-mask .md-virtual-repeat-offsetter{width:100%}.md-calendar-scroll-container{box-shadow:inset -3px 3px 6px rgba(0,0,0,.2);display:inline-block;height:308px;width:346px}.md-calendar-date{height:44px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box}.md-calendar-date:first-child{padding-left:16px}[dir=rtl] .md-calendar-date:first-child{padding-left:0;padding-right:16px}.md-calendar-date:last-child{padding-right:16px}[dir=rtl] .md-calendar-date:last-child{padding-right:0;padding-left:16px}.md-calendar-date.md-calendar-date-disabled{cursor:default}.md-calendar-date-selection-indicator{transition:background-color,color .4s cubic-bezier(.25,.8,.25,1);border-radius:50%;display:inline-block;width:40px;height:40px;line-height:40px}.md-calendar-date:not(.md-disabled) .md-calendar-date-selection-indicator{cursor:pointer}.md-calendar-month-label{height:44px;font-size:14px;font-weight:500;padding:0 0 0 24px}[dir=rtl] .md-calendar-month-label{padding:0 24px 0 0}md-calendar-month .md-calendar-month-label:not(.md-calendar-month-label-disabled){cursor:pointer}.md-calendar-month-label md-icon{transform:rotate(180deg)}[dir=rtl] .md-calendar-month-label md-icon{transform:none}.md-calendar-month-label span{vertical-align:middle}.md-calendar-day-header{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar-day-header th{height:40px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box;font-weight:400}.md-calendar-day-header th:first-child{padding-left:16px}[dir=rtl] .md-calendar-day-header th:first-child{padding-left:0;padding-right:16px}.md-calendar-day-header th:last-child{padding-right:16px}[dir=rtl] .md-calendar-day-header th:last-child{padding-right:0;padding-left:16px}.md-calendar{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar tr:last-child td{border-bottom-width:1px;border-bottom-style:solid}.md-calendar:first-child{border-top:1px solid transparent}.md-calendar tbody,.md-calendar td,.md-calendar tr{vertical-align:middle;box-sizing:content-box}md-datepicker{white-space:nowrap;overflow:hidden;padding-right:18px;margin-right:-18px;vertical-align:middle}[dir=rtl] md-datepicker{padding-right:0;padding-left:18px}[dir=rtl] md-datepicker{margin-right:auto;margin-left:-18px}.md-inline-form md-datepicker{margin-top:12px}.md-datepicker-button{display:inline-block;box-sizing:border-box;background:0 0;vertical-align:middle;position:relative}.md-datepicker-button:before{top:0;left:0;bottom:0;right:0;position:absolute;content:'';speak:none}.md-datepicker-input{font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:0;background:0 0;min-width:120px;max-width:328px;padding:0 0 5px}.md-datepicker-input::-ms-clear{display:none}._md-datepicker-floating-label>md-datepicker{overflow:visible}._md-datepicker-floating-label>md-datepicker .md-datepicker-input-container{border:none}._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:left;margin-top:-2.5px}[dir=rtl] ._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:right}._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:18px;left:auto;width:calc(100% - 84px)}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:auto}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){left:18px}._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:64px}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:auto;margin-right:64px}.md-datepicker-input-container{position:relative;border-bottom-width:1px;border-bottom-style:solid;display:inline-block;width:auto}.md-icon-button+.md-datepicker-input-container{margin-left:12px}[dir=rtl] .md-icon-button+.md-datepicker-input-container{margin-left:auto;margin-right:12px}.md-datepicker-input-container.md-datepicker-focused{border-bottom-width:2px}.md-datepicker-is-showing .md-scroll-mask{z-index:99}.md-datepicker-calendar-pane{position:absolute;top:0;left:-100%;z-index:100;border-width:1px;border-style:solid;background:0 0;transform:scale(0);transform-origin:0 0;transition:transform .2s cubic-bezier(.25,.8,.25,1)}.md-datepicker-calendar-pane.md-pane-open{transform:scale(1)}.md-datepicker-input-mask{height:40px;width:340px;position:relative;overflow:hidden;background:0 0;pointer-events:none;cursor:text}.md-datepicker-calendar{opacity:0;transition:opacity .2s cubic-bezier(.5,0,.25,1)}.md-pane-open .md-datepicker-calendar{opacity:1}.md-datepicker-calendar md-calendar:focus{outline:0}.md-datepicker-expand-triangle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid}.md-datepicker-triangle-button{position:absolute;right:0;top:5px;transform:translateY(-25%) translateX(45%)}[dir=rtl] .md-datepicker-triangle-button{right:auto;left:0}[dir=rtl] .md-datepicker-triangle-button{transform:translateY(-25%) translateX(-45%)}.md-datepicker-triangle-button.md-button.md-icon-button{height:36px;width:36px;position:absolute;padding:8px}md-datepicker[disabled] .md-datepicker-input-container{border-bottom-color:transparent}md-datepicker[disabled] .md-datepicker-triangle-button{display:none}.md-datepicker-open{overflow:hidden}.md-datepicker-open .md-datepicker-input-container,.md-datepicker-open input.md-input{border-bottom-color:transparent}.md-datepicker-open .md-datepicker-triangle-button,.md-datepicker-open.md-input-has-placeholder>label,.md-datepicker-open.md-input-has-value>label{display:none}.md-datepicker-pos-adjusted .md-datepicker-input-mask{display:none}.md-datepicker-calendar-pane .md-calendar{transform:translateY(-85px);transition:transform .65s cubic-bezier(.25,.8,.25,1);transition-delay:125ms}.md-datepicker-calendar-pane.md-pane-open .md-calendar{transform:translateY(0)}.md-dialog-is-showing{max-height:100%}.md-dialog-container{display:flex;justify-content:center;align-items:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80;overflow:hidden}md-dialog{opacity:0;min-width:240px;max-width:80%;max-height:80%;position:relative;overflow:auto;box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 13px 19px 2px rgba(0,0,0,.14),0 5px 24px 4px rgba(0,0,0,.12);display:flex;flex-direction:column}md-dialog.md-transition-in{opacity:1;transition:all .4s cubic-bezier(.25,.8,.25,1);transform:translate(0,0) scale(1)}md-dialog.md-transition-out{opacity:0;transition:all .4s cubic-bezier(.25,.8,.25,1);transform:translate(0,100%) scale(.2)}md-dialog>form{display:flex;flex-direction:column;overflow:auto}md-dialog .md-dialog-content{padding:24px}md-dialog md-dialog-content{order:1;flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch}md-dialog md-dialog-content:not([layout=row])>:first-child:not(.md-subheader){margin-top:0}md-dialog md-dialog-content:focus{outline:0}md-dialog md-dialog-content .md-subheader{margin:0}md-dialog md-dialog-content .md-dialog-content-body{width:100%}md-dialog md-dialog-content .md-prompt-input-container{width:100%;box-sizing:border-box}md-dialog .md-actions,md-dialog md-dialog-actions{display:flex;order:2;box-sizing:border-box;align-items:center;justify-content:flex-end;margin-bottom:0;padding-right:8px;padding-left:16px;min-height:52px;overflow:hidden}[dir=rtl] md-dialog .md-actions,[dir=rtl] md-dialog md-dialog-actions{padding-right:16px}[dir=rtl] md-dialog .md-actions,[dir=rtl] md-dialog md-dialog-actions{padding-left:8px}md-dialog .md-actions .md-button,md-dialog md-dialog-actions .md-button{margin-bottom:8px;margin-left:8px;margin-right:0;margin-top:8px}[dir=rtl] md-dialog .md-actions .md-button,[dir=rtl] md-dialog md-dialog-actions .md-button{margin-left:0}[dir=rtl] md-dialog .md-actions .md-button,[dir=rtl] md-dialog md-dialog-actions .md-button{margin-right:8px}md-dialog.md-content-overflow .md-actions,md-dialog.md-content-overflow md-dialog-actions{border-top-width:1px;border-top-style:solid}@media screen and (-ms-high-contrast:active){md-dialog{border:1px solid #fff}}@media (max-width:959px){md-dialog.md-dialog-fullscreen{min-height:100%;min-width:100%;border-radius:0}}md-divider{display:block;border-top-width:1px;border-top-style:solid;margin:0}md-divider[md-inset]{margin-left:80px}[dir=rtl] md-divider[md-inset]{margin-left:auto;margin-right:80px}.layout-gt-lg-row>md-divider,.layout-gt-md-row>md-divider,.layout-gt-sm-row>md-divider,.layout-gt-xs-row>md-divider,.layout-lg-row>md-divider,.layout-md-row>md-divider,.layout-row>md-divider,.layout-sm-row>md-divider,.layout-xl-row>md-divider,.layout-xs-row>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}md-fab-speed-dial{position:relative;display:flex;align-items:center;z-index:20}md-fab-speed-dial.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-speed-dial.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-speed-dial.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-speed-dial.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-speed-dial:not(.md-hover-full){pointer-events:none}md-fab-speed-dial:not(.md-hover-full) .md-fab-action-item,md-fab-speed-dial:not(.md-hover-full) md-fab-trigger{pointer-events:auto}md-fab-speed-dial:not(.md-hover-full).md-is-open{pointer-events:auto}md-fab-speed-dial ._md-css-variables{z-index:20}md-fab-speed-dial.md-is-open .md-fab-action-item{align-items:center}md-fab-speed-dial md-fab-actions{display:flex;height:auto}md-fab-speed-dial md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-fab-speed-dial.md-down{flex-direction:column}md-fab-speed-dial.md-down md-fab-trigger{order:1}md-fab-speed-dial.md-down md-fab-actions{flex-direction:column;order:2}md-fab-speed-dial.md-up{flex-direction:column}md-fab-speed-dial.md-up md-fab-trigger{order:2}md-fab-speed-dial.md-up md-fab-actions{flex-direction:column-reverse;order:1}md-fab-speed-dial.md-left{flex-direction:row}md-fab-speed-dial.md-left md-fab-trigger{order:2}md-fab-speed-dial.md-left md-fab-actions{flex-direction:row-reverse;order:1}md-fab-speed-dial.md-left md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-fab-speed-dial.md-right{flex-direction:row}md-fab-speed-dial.md-right md-fab-trigger{order:1}md-fab-speed-dial.md-right md-fab-actions{flex-direction:row;order:2}md-fab-speed-dial.md-right md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-fab-speed-dial.md-fling-remove .md-fab-action-item>*,md-fab-speed-dial.md-scale-remove .md-fab-action-item>*{visibility:hidden}md-fab-speed-dial.md-fling .md-fab-action-item{opacity:1}md-fab-speed-dial.md-fling.md-animations-waiting .md-fab-action-item{opacity:0;transition-duration:0s}md-fab-speed-dial.md-scale .md-fab-action-item{transform:scale(0);transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:.1428571429s}md-fab-toolbar{display:block}md-fab-toolbar.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-toolbar.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-toolbar.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-toolbar.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-toolbar .md-fab-toolbar-wrapper{display:block;position:relative;overflow:hidden;height:68px}md-fab-toolbar md-fab-trigger{position:absolute;z-index:20}md-fab-toolbar md-fab-trigger button{overflow:visible!important}md-fab-toolbar md-fab-trigger .md-fab-toolbar-background{display:block;position:absolute;z-index:21;opacity:1;transition:all .3s cubic-bezier(.55,0,.55,.2)}md-fab-toolbar md-fab-trigger md-icon{position:relative;z-index:22;opacity:1;transition:all .2s ease-in}md-fab-toolbar.md-left md-fab-trigger{right:0}[dir=rtl] md-fab-toolbar.md-left md-fab-trigger{right:auto;left:0}md-fab-toolbar.md-left .md-toolbar-tools{flex-direction:row-reverse}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:.6rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:auto;margin-left:.6rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:-.8rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-.8rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:8px}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:8px}md-fab-toolbar.md-right md-fab-trigger{left:0}[dir=rtl] md-fab-toolbar.md-right md-fab-trigger{left:auto;right:0}md-fab-toolbar.md-right .md-toolbar-tools{flex-direction:row}md-fab-toolbar md-toolbar{background-color:transparent!important;pointer-events:none;z-index:23}md-fab-toolbar md-toolbar .md-toolbar-tools{padding:0 20px;margin-top:3px}md-fab-toolbar md-toolbar .md-fab-action-item{opacity:0;transform:scale(0);transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:.15s}md-fab-toolbar.md-is-open md-fab-trigger>button{box-shadow:none}md-fab-toolbar.md-is-open md-fab-trigger>button md-icon{opacity:0}md-fab-toolbar.md-is-open .md-fab-action-item{opacity:1;transform:scale(1)}md-grid-list{box-sizing:border-box;display:block;position:relative}md-grid-list md-grid-tile,md-grid-list md-grid-tile-footer,md-grid-list md-grid-tile-header,md-grid-list md-grid-tile>figure{box-sizing:border-box}md-grid-list md-grid-tile{display:block;position:absolute}md-grid-list md-grid-tile figure{display:flex;align-items:center;justify-content:center;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;padding:0;margin:0}md-grid-list md-grid-tile md-grid-tile-footer,md-grid-list md-grid-tile md-grid-tile-header{display:flex;flex-direction:row;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.18);overflow:hidden;position:absolute;left:0;right:0}md-grid-list md-grid-tile md-grid-tile-footer h3,md-grid-list md-grid-tile md-grid-tile-footer h4,md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-header h4{font-weight:400;margin:0 0 0 16px}md-grid-list md-grid-tile md-grid-tile-footer h3,md-grid-list md-grid-tile md-grid-tile-header h3{font-size:14px}md-grid-list md-grid-tile md-grid-tile-footer h4,md-grid-list md-grid-tile md-grid-tile-header h4{font-size:12px}md-grid-list md-grid-tile md-grid-tile-header{top:0}md-grid-list md-grid-tile md-grid-tile-footer{bottom:0}@media screen and (-ms-high-contrast:active){md-grid-tile{border:1px solid #fff}md-grid-tile-footer{border-top:1px solid #fff}}md-icon{margin:auto;background-repeat:no-repeat no-repeat;display:inline-block;vertical-align:middle;fill:currentColor;height:24px;width:24px;min-height:24px;min-width:24px}md-icon svg{pointer-events:none;display:block}md-icon[md-font-icon]{line-height:24px;width:auto}md-input-container{display:inline-block;position:relative;padding:2px;margin:18px 0;vertical-align:middle}md-input-container:after{content:'';display:table;clear:both}md-input-container.md-block{display:block}md-input-container .md-errors-spacer{float:right;min-height:24px;min-width:1px}[dir=rtl] md-input-container .md-errors-spacer{float:left}md-input-container>md-icon{position:absolute;top:8px;left:2px;right:auto}[dir=rtl] md-input-container>md-icon{left:auto}[dir=rtl] md-input-container>md-icon{right:2px}md-input-container input[type=color],md-input-container input[type=date],md-input-container input[type=datetime-local],md-input-container input[type=datetime],md-input-container input[type=email],md-input-container input[type=month],md-input-container input[type=number],md-input-container input[type=password],md-input-container input[type=search],md-input-container input[type=tel],md-input-container input[type=text],md-input-container input[type=time],md-input-container input[type=url],md-input-container input[type=week],md-input-container textarea{-moz-appearance:none;-webkit-appearance:none}md-input-container input[type=date],md-input-container input[type=datetime-local],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week]{min-height:26px}md-input-container textarea{resize:none;overflow:hidden}md-input-container textarea.md-input{min-height:26px;-ms-flex-preferred-size:auto}md-input-container textarea[md-no-autogrow]{height:auto;overflow:auto}md-input-container label:not(.md-container-ignore){position:absolute;bottom:100%;left:0;right:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){left:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){right:0}md-input-container label:not(.md-container-ignore).md-required:after{content:' *';font-size:13px;vertical-align:top}md-input-container .md-placeholder,md-input-container label:not(.md-no-float):not(.md-container-ignore){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:3px;padding-right:0;z-index:1;transform:translate3d(0,28px,0) scale(1);transition:transform .4s cubic-bezier(.25,.8,.25,1);max-width:100%;transform-origin:left top}[dir=rtl] md-input-container .md-placeholder,[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore){padding-left:0}[dir=rtl] md-input-container .md-placeholder,[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore){padding-right:3px}[dir=rtl] md-input-container .md-placeholder,[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore){transform-origin:right top}md-input-container .md-placeholder{position:absolute;top:0;opacity:0;transition-property:opacity,transform;transform:translate3d(0,30px,0)}md-input-container.md-input-focused .md-placeholder{opacity:1;transform:translate3d(0,24px,0)}md-input-container.md-input-has-value .md-placeholder{transition:none;opacity:0}md-input-container:not(.md-input-has-value) input:not(:focus),md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-ampm-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-day-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-hour-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-millisecond-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-minute-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-month-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-second-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-text,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-week-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-year-field{color:transparent}md-input-container .md-input{order:2;display:block;margin-top:0;background:0 0;padding-top:2px;padding-bottom:1px;padding-left:2px;padding-right:2px;border-width:0 0 1px 0;line-height:26px;height:30px;-ms-flex-preferred-size:26px;border-radius:0;border-style:solid;width:100%;box-sizing:border-box;float:left}[dir=rtl] md-input-container .md-input{float:right}md-input-container .md-input:focus{outline:0}md-input-container .md-input:invalid{outline:0;box-shadow:none}md-input-container .md-input.md-no-flex{flex:none!important}md-input-container .md-char-counter{text-align:right;padding-right:2px;padding-left:0}[dir=rtl] md-input-container .md-char-counter{text-align:left}[dir=rtl] md-input-container .md-char-counter{padding-right:0}[dir=rtl] md-input-container .md-char-counter{padding-left:2px}md-input-container .md-input-messages-animation{position:relative;order:4;overflow:hidden;clear:left}[dir=rtl] md-input-container .md-input-messages-animation{clear:right}md-input-container .md-input-messages-animation.ng-enter .md-input-message-animation{opacity:0;margin-top:-100px}md-input-container .md-char-counter,md-input-container .md-input-message-animation{font-size:12px;line-height:14px;overflow:hidden;transition:all .3s cubic-bezier(.55,0,.55,.2);opacity:1;margin-top:0;padding-top:5px}md-input-container .md-char-counter:not(.md-char-counter),md-input-container .md-input-message-animation:not(.md-char-counter){padding-right:5px;padding-left:0}[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter),[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter){padding-right:0}[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter),[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter){padding-left:5px}md-input-container:not(.md-input-invalid) .md-auto-hide .md-input-message-animation{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation:not(.ng-animate){opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter{opacity:0;margin-top:-100px}md-input-container.md-input-focused label:not(.md-no-float),md-input-container.md-input-has-placeholder label:not(.md-no-float),md-input-container.md-input-has-value label:not(.md-no-float){transform:translate3d(0,6px,0) scale(.75);transition:transform cubic-bezier(.25,.8,.25,1) .4s,width cubic-bezier(.25,.8,.25,1) .4s}md-input-container.md-input-has-value label{transition:none}md-input-container .md-input.ng-invalid.ng-dirty,md-input-container.md-input-focused .md-input,md-input-container.md-input-resized .md-input{padding-bottom:0;border-width:0 0 2px 0}[disabled] md-input-container .md-input,md-input-container .md-input[disabled]{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x}md-input-container.md-icon-float{transition:margin-top .4s cubic-bezier(.25,.8,.25,1)}md-input-container.md-icon-float>label{pointer-events:none;position:absolute}md-input-container.md-icon-float>md-icon{top:8px;left:2px;right:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{left:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{right:2px}md-input-container.md-icon-left>label .md-placeholder,md-input-container.md-icon-left>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-right>label .md-placeholder,md-input-container.md-icon-right>label:not(.md-no-float):not(.md-container-ignore){width:calc(100% - 36px - 18px)}md-input-container.md-icon-left{padding-left:36px;padding-right:0}[dir=rtl] md-input-container.md-icon-left{padding-left:0}[dir=rtl] md-input-container.md-icon-left{padding-right:36px}md-input-container.md-icon-left>label{left:36px;right:auto}[dir=rtl] md-input-container.md-icon-left>label{left:auto}[dir=rtl] md-input-container.md-icon-left>label{right:36px}md-input-container.md-icon-right{padding-left:0;padding-right:36px}[dir=rtl] md-input-container.md-icon-right{padding-left:36px}[dir=rtl] md-input-container.md-icon-right{padding-right:0}md-input-container.md-icon-right>md-icon:last-of-type{margin:0;right:2px;left:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{right:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{left:2px}md-input-container.md-icon-left.md-icon-right{padding-left:36px;padding-right:36px}md-input-container.md-icon-left.md-icon-right>label .md-placeholder,md-input-container.md-icon-left.md-icon-right>label:not(.md-no-float):not(.md-container-ignore){width:calc(100% - (36px * 2))}.md-resize-wrapper{position:relative}.md-resize-wrapper:after{content:'';display:table;clear:both}.md-resize-handle{position:absolute;bottom:-5px;left:0;height:10px;background:0 0;width:100%;cursor:ns-resize}@media screen and (-ms-high-contrast:active){md-input-container.md-default-theme>md-icon{fill:#fff}}md-list{display:block;padding:8px 0 8px 0}md-list .md-subheader{font-size:14px;font-weight:500;letter-spacing:.010em;line-height:1.2em}md-list.md-dense md-list-item,md-list.md-dense md-list-item .md-list-item-inner{min-height:48px}md-list.md-dense md-list-item .md-list-item-inner::before,md-list.md-dense md-list-item::before{content:'';min-height:48px;visibility:hidden;display:inline-block}md-list.md-dense md-list-item .md-list-item-inner md-icon:first-child,md-list.md-dense md-list-item md-icon:first-child{width:20px;height:20px}md-list.md-dense md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list.md-dense md-list-item>md-icon:first-child:not(.md-avatar-icon){margin-right:36px}[dir=rtl] md-list.md-dense md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list.md-dense md-list-item>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:36px}md-list.md-dense md-list-item .md-avatar,md-list.md-dense md-list-item .md-avatar-icon,md-list.md-dense md-list-item .md-list-item-inner .md-avatar,md-list.md-dense md-list-item .md-list-item-inner .md-avatar-icon{margin-right:20px}[dir=rtl] md-list.md-dense md-list-item .md-avatar,[dir=rtl] md-list.md-dense md-list-item .md-avatar-icon,[dir=rtl] md-list.md-dense md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list.md-dense md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:20px}md-list.md-dense md-list-item .md-avatar,md-list.md-dense md-list-item .md-list-item-inner .md-avatar{flex:none;width:36px;height:36px}md-list.md-dense md-list-item.md-2-line .md-list-item-text.md-offset,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list.md-dense md-list-item.md-3-line .md-list-item-text.md-offset,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list.md-dense md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list.md-dense md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense md-list-item.md-2-line .md-list-item-text h4,md-list.md-dense md-list-item.md-2-line .md-list-item-text p,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list.md-dense md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense md-list-item.md-3-line .md-list-item-text h4,md-list.md-dense md-list-item.md-3-line .md-list-item-text p,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text h3,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text h4,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text p{line-height:1.05;font-size:12px}md-list.md-dense md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:13px}md-list.md-dense md-list-item.md-2-line,md-list.md-dense md-list-item.md-2-line>.md-no-style{min-height:60px}md-list.md-dense md-list-item.md-2-line::before,md-list.md-dense md-list-item.md-2-line>.md-no-style::before{content:'';min-height:60px;visibility:hidden;display:inline-block}md-list.md-dense md-list-item.md-2-line .md-avatar-icon,md-list.md-dense md-list-item.md-2-line>.md-avatar,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-avatar-icon,md-list.md-dense md-list-item.md-2-line>.md-no-style>.md-avatar{margin-top:12px}md-list.md-dense md-list-item.md-3-line,md-list.md-dense md-list-item.md-3-line>.md-no-style{min-height:76px}md-list.md-dense md-list-item.md-3-line::before,md-list.md-dense md-list-item.md-3-line>.md-no-style::before{content:'';min-height:76px;visibility:hidden;display:inline-block}md-list.md-dense md-list-item.md-3-line>.md-avatar,md-list.md-dense md-list-item.md-3-line>.md-no-style>.md-avatar,md-list.md-dense md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list.md-dense md-list-item.md-3-line>md-icon:first-child{margin-top:16px}md-list-item{position:relative}md-list-item.md-proxy-focus.md-focused .md-no-style{transition:background-color .15s linear}md-list-item._md-button-wrap{position:relative}md-list-item._md-button-wrap>div.md-button:first-child{display:flex;align-items:center;justify-content:flex-start;padding:0 16px;margin:0;font-weight:400;text-align:left;border:medium none}[dir=rtl] md-list-item._md-button-wrap>div.md-button:first-child{text-align:right}md-list-item._md-button-wrap>div.md-button:first-child>.md-button:first-child{position:absolute;top:0;left:0;height:100%;margin:0;padding:0}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner{width:100%;min-height:inherit}md-list-item .md-no-style,md-list-item.md-no-proxy{position:relative;padding:0 16px;flex:1 1 auto}md-list-item .md-no-style.md-button,md-list-item.md-no-proxy.md-button{font-size:inherit;height:inherit;text-align:left;text-transform:none;width:100%;white-space:normal;flex-direction:inherit;align-items:inherit;border-radius:0;margin:0}[dir=rtl] md-list-item .md-no-style.md-button,[dir=rtl] md-list-item.md-no-proxy.md-button{text-align:right}md-list-item .md-no-style.md-button>.md-ripple-container,md-list-item.md-no-proxy.md-button>.md-ripple-container{border-radius:0}md-list-item .md-no-style:focus,md-list-item.md-no-proxy:focus{outline:0}md-list-item.md-clickable:hover{cursor:pointer}md-list-item md-divider{position:absolute;bottom:0;left:0;width:100%}[dir=rtl] md-list-item md-divider{left:auto;right:0}md-list-item md-divider[md-inset]{left:72px;width:calc(100% - 72px);margin:0!important}[dir=rtl] md-list-item md-divider[md-inset]{left:auto;right:72px}md-list-item,md-list-item .md-list-item-inner{display:flex;justify-content:flex-start;align-items:center;min-height:48px;height:auto}md-list-item .md-list-item-inner::before,md-list-item::before{content:'';min-height:48px;visibility:hidden;display:inline-block}md-list-item .md-list-item-inner>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon.md-secondary:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list-item>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item>md-icon.md-secondary:not(.md-avatar-icon),md-list-item>md-icon:first-child:not(.md-avatar-icon){width:24px;margin-top:16px;margin-bottom:12px;box-sizing:content-box}md-list-item .md-list-item-inner md-checkbox.md-secondary,md-list-item .md-list-item-inner>div.md-primary>md-checkbox,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox,md-list-item .md-list-item-inner>md-checkbox,md-list-item md-checkbox.md-secondary,md-list-item>div.md-primary>md-checkbox,md-list-item>div.md-secondary>md-checkbox,md-list-item>md-checkbox{align-self:center}md-list-item .md-list-item-inner md-checkbox.md-secondary .md-label,md-list-item .md-list-item-inner>div.md-primary>md-checkbox .md-label,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox .md-label,md-list-item .md-list-item-inner>md-checkbox .md-label,md-list-item md-checkbox.md-secondary .md-label,md-list-item>div.md-primary>md-checkbox .md-label,md-list-item>div.md-secondary>md-checkbox .md-label,md-list-item>md-checkbox .md-label{display:none}md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list-item>md-icon:first-child:not(.md-avatar-icon){margin-right:32px}[dir=rtl] md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list-item>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:32px}md-list-item .md-avatar,md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar,md-list-item .md-list-item-inner .md-avatar-icon{margin-top:8px;margin-bottom:8px;margin-right:16px;border-radius:50%;box-sizing:content-box}[dir=rtl] md-list-item .md-avatar,[dir=rtl] md-list-item .md-avatar-icon,[dir=rtl] md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:16px}md-list-item .md-avatar,md-list-item .md-list-item-inner .md-avatar{flex:none;width:40px;height:40px}md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar-icon{padding:8px}md-list-item .md-avatar-icon svg,md-list-item .md-list-item-inner .md-avatar-icon svg{width:24px;height:24px}md-list-item .md-list-item-inner>md-checkbox,md-list-item>md-checkbox{width:24px;margin-left:3px;margin-right:29px;margin-top:16px}[dir=rtl] md-list-item .md-list-item-inner>md-checkbox,[dir=rtl] md-list-item>md-checkbox{margin-left:29px}[dir=rtl] md-list-item .md-list-item-inner>md-checkbox,[dir=rtl] md-list-item>md-checkbox{margin-right:3px}md-list-item .md-list-item-inner .md-secondary-container,md-list-item .md-secondary-container{display:flex;align-items:center;flex-shrink:0;margin:auto;margin-right:0;margin-left:auto}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container,[dir=rtl] md-list-item .md-secondary-container{margin-right:auto}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container,[dir=rtl] md-list-item .md-secondary-container{margin-left:0}md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type,md-list-item .md-secondary-container .md-button:last-of-type,md-list-item .md-secondary-container .md-icon-button:last-of-type{margin-right:0}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type,[dir=rtl] md-list-item .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-secondary-container .md-icon-button:last-of-type{margin-right:auto;margin-left:0}md-list-item .md-list-item-inner .md-secondary-container md-checkbox,md-list-item .md-secondary-container md-checkbox{margin-top:0;margin-bottom:0}md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child,md-list-item .md-secondary-container md-checkbox:last-child{width:24px;margin-right:0}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child,[dir=rtl] md-list-item .md-secondary-container md-checkbox:last-child{margin-right:auto;margin-left:0}md-list-item .md-list-item-inner .md-secondary-container md-switch,md-list-item .md-secondary-container md-switch{margin-top:0;margin-bottom:0;margin-right:-6px}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-switch,[dir=rtl] md-list-item .md-secondary-container md-switch{margin-right:auto;margin-left:-6px}md-list-item .md-list-item-inner>.md-list-item-inner>p,md-list-item .md-list-item-inner>p,md-list-item>.md-list-item-inner>p,md-list-item>p{flex:1 1 auto;margin:0}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style,md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{align-items:flex-start;justify-content:center}md-list-item.md-2-line.md-long-text,md-list-item.md-2-line>.md-no-style.md-long-text,md-list-item.md-3-line.md-long-text,md-list-item.md-3-line>.md-no-style.md-long-text{margin-top:8px;margin-bottom:8px}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text,md-list-item.md-3-line .md-list-item-text,md-list-item.md-3-line>.md-no-style .md-list-item-text{flex:1 1 auto;margin:auto;text-overflow:ellipsis;overflow:hidden}md-list-item.md-2-line .md-list-item-text.md-offset,md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list-item.md-3-line .md-list-item-text.md-offset,md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list-item.md-2-line .md-list-item-text h3,md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list-item.md-3-line .md-list-item-text h3,md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:16px;font-weight:400;letter-spacing:.010em;margin:0;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text h4,md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list-item.md-3-line .md-list-item-text h4,md-list-item.md-3-line>.md-no-style .md-list-item-text h4{font-size:14px;letter-spacing:.010em;margin:3px 0 1px 0;font-weight:400;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text p,md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list-item.md-3-line .md-list-item-text p,md-list-item.md-3-line>.md-no-style .md-list-item-text p{font-size:14px;font-weight:500;letter-spacing:.010em;margin:0;line-height:1.6em}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style{height:auto;min-height:72px}md-list-item.md-2-line::before,md-list-item.md-2-line>.md-no-style::before{content:'';min-height:72px;visibility:hidden;display:inline-block}md-list-item.md-2-line .md-avatar-icon,md-list-item.md-2-line>.md-avatar,md-list-item.md-2-line>.md-no-style .md-avatar-icon,md-list-item.md-2-line>.md-no-style>.md-avatar{margin-top:12px}md-list-item.md-2-line>.md-no-style>md-icon:first-child,md-list-item.md-2-line>md-icon:first-child{align-self:flex-start}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text{flex:1 1 auto}md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{height:auto;min-height:88px}md-list-item.md-3-line::before,md-list-item.md-3-line>.md-no-style::before{content:'';min-height:88px;visibility:hidden;display:inline-block}md-list-item.md-3-line>.md-avatar,md-list-item.md-3-line>.md-no-style>.md-avatar,md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list-item.md-3-line>md-icon:first-child{margin-top:16px}.md-open-menu-container{position:fixed;left:0;top:0;z-index:100;opacity:0;border-radius:2px}.md-open-menu-container md-menu-divider{margin-top:4px;margin-bottom:4px;height:1px;min-height:1px;max-height:1px;width:100%}.md-open-menu-container md-menu-content>*{opacity:0}.md-open-menu-container:not(.md-clickable){pointer-events:none}.md-open-menu-container.md-active{opacity:1;transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:.2s}.md-open-menu-container.md-active>md-menu-content>*{opacity:1;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:.2s;transition-delay:.1s}.md-open-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:250ms}md-menu-content{display:flex;flex-direction:column;padding:8px 0;max-height:304px;overflow-y:auto}md-menu-content.md-dense{max-height:208px}md-menu-content.md-dense md-menu-item{height:32px;min-height:0}md-menu-item{display:flex;flex-direction:row;min-height:48px;height:48px;align-content:center;justify-content:flex-start}md-menu-item>*{width:100%;margin:auto 0;padding-left:16px;padding-right:16px}md-menu-item>a.md-button{padding-top:5px}md-menu-item>.md-button{text-align:left;display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}md-menu-item>.md-button::-moz-focus-inner{padding:0;border:0}[dir=rtl] md-menu-item>.md-button{text-align:right}md-menu-item>.md-button md-icon{margin:auto 16px auto 0}[dir=rtl] md-menu-item>.md-button md-icon{margin:auto 0 auto 16px}md-menu-item>.md-button p{display:inline-block;margin:auto}md-menu-item>.md-button span{margin-top:auto;margin-bottom:auto}md-menu-item>.md-button .md-ripple-container{border-radius:inherit}md-toolbar .md-menu{height:auto;margin:auto;padding:0}@media (max-width:959px){md-menu-content{min-width:112px}md-menu-content[width="3"]{min-width:168px}md-menu-content[width="4"]{min-width:224px}md-menu-content[width="5"]{min-width:280px}md-menu-content[width="6"]{min-width:336px}md-menu-content[width="7"]{min-width:392px}}@media (min-width:960px){md-menu-content{min-width:96px}md-menu-content[width="3"]{min-width:192px}md-menu-content[width="4"]{min-width:256px}md-menu-content[width="5"]{min-width:320px}md-menu-content[width="6"]{min-width:384px}md-menu-content[width="7"]{min-width:448px}}md-toolbar.md-menu-toolbar h2.md-toolbar-tools{line-height:1rem;height:auto;padding:28px;padding-bottom:12px}md-toolbar.md-has-open-menu{position:relative;z-index:100}md-menu-bar{padding:0 20px;display:block;position:relative;z-index:2}md-menu-bar .md-menu{display:inline-block;padding:0;position:relative}md-menu-bar button{font-size:14px;padding:0 10px;margin:0;border:0;background-color:transparent;height:40px}md-menu-bar md-backdrop.md-menu-backdrop{z-index:-2}md-menu-content.md-menu-bar-menu.md-dense{max-height:none;padding:16px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent{position:relative}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{position:absolute;padding:0;width:24px;top:6px;left:24px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{left:auto;right:24px}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button{padding:0 32px 0 64px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button{padding:0 64px 0 32px}md-menu-content.md-menu-bar-menu.md-dense .md-button{min-height:0;height:32px;display:flex}md-menu-content.md-menu-bar-menu.md-dense .md-button span{flex-grow:1}md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{flex-grow:0;align-self:flex-end;margin:0 8px}md-menu-content.md-menu-bar-menu.md-dense md-menu-divider{margin:8px 0}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button{text-align:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button{text-align:right}md-menu-content.md-menu-bar-menu.md-dense .md-menu{padding:0}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{position:relative;margin:0;width:100%;text-transform:none;font-weight:400;border-radius:0;padding-left:16px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{padding-left:0;padding-right:16px}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{display:block;content:'\25BC';position:absolute;top:0;speak:none;transform:rotate(270deg) scaleY(.45) scaleX(.9);right:28px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{transform:rotate(90deg) scaleY(.45) scaleX(.9)}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{right:auto;left:28px}.md-nav-bar{border-style:solid;border-width:0 0 1px;height:48px;position:relative}._md-nav-bar-list{outline:0;list-style:none;margin:0;padding:0;box-sizing:border-box;display:flex;flex-direction:row}.md-nav-item:first-of-type{margin-left:8px}.md-button._md-nav-button{line-height:24px;margin:0 4px;padding:12px 16px;transition:background-color .35s cubic-bezier(.35,0,.25,1)}.md-button._md-nav-button:focus{outline:0}.md-button._md-nav-button:hover{background-color:inherit}md-nav-ink-bar{bottom:0;height:2px;left:auto;position:absolute;right:auto;background-color:#000}md-nav-ink-bar._md-left{transition:left 125ms cubic-bezier(.35,0,.25,1),right .25s cubic-bezier(.35,0,.25,1)}md-nav-ink-bar._md-right{transition:left .25s cubic-bezier(.35,0,.25,1),right 125ms cubic-bezier(.35,0,.25,1)}md-nav-extra-content{min-height:48px;padding-right:12px}.md-panel-outer-wrapper{height:100%;left:0;position:absolute;top:0;width:100%}._md-panel-hidden{display:none}._md-panel-fullscreen{border-radius:0;left:0;min-height:100%;min-width:100%;position:fixed;top:0}._md-panel-shown .md-panel{opacity:1;transition:none}.md-panel{opacity:0;position:fixed}.md-panel._md-panel-shown{opacity:1;transition:none}.md-panel._md-panel-animate-enter{opacity:1;transition:all .3s cubic-bezier(0,0,.2,1)}.md-panel._md-panel-animate-leave{opacity:1;transition:all .3s cubic-bezier(.4,0,1,1)}.md-panel._md-panel-animate-fade-out,.md-panel._md-panel-animate-scale-out{opacity:0}.md-panel._md-panel-backdrop{height:100%;position:absolute;width:100%}.md-panel._md-opaque-enter{opacity:.48;transition:opacity .3s cubic-bezier(0,0,.2,1)}.md-panel._md-opaque-leave{transition:opacity .3s cubic-bezier(.4,0,1,1)}@keyframes indeterminate-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}md-progress-circular{position:relative;display:block}md-progress-circular._md-progress-circular-disabled{visibility:hidden}md-progress-circular.md-mode-indeterminate svg{animation:indeterminate-rotate 2.9s linear infinite}md-progress-circular svg{position:absolute;overflow:visible;top:0;left:0}md-progress-linear{display:block;position:relative;width:100%;height:5px;padding-top:0!important;margin-bottom:0!important}md-progress-linear._md-progress-linear-disabled{visibility:hidden}md-progress-linear .md-container{display:block;position:relative;overflow:hidden;width:100%;height:5px;transform:translate(0,0) scale(1,1)}md-progress-linear .md-container .md-bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:5px}md-progress-linear .md-container .md-dashed:before{content:"";display:none;position:absolute;margin-top:0;height:5px;width:100%;background-color:transparent;background-size:10px 10px!important;background-position:0 -23px}md-progress-linear .md-container .md-bar1,md-progress-linear .md-container .md-bar2{transition:transform .2s linear}md-progress-linear .md-container.md-mode-query .md-bar1{display:none}md-progress-linear .md-container.md-mode-query .md-bar2{transition:all .2s linear;animation:query .8s infinite cubic-bezier(.39,.575,.565,1)}md-progress-linear .md-container.md-mode-determinate .md-bar1{display:none}md-progress-linear .md-container.md-mode-indeterminate .md-bar1{animation:md-progress-linear-indeterminate-scale-1 4s infinite,md-progress-linear-indeterminate-1 4s infinite}md-progress-linear .md-container.md-mode-indeterminate .md-bar2{animation:md-progress-linear-indeterminate-scale-2 4s infinite,md-progress-linear-indeterminate-2 4s infinite}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container{animation:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar1{animation-name:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar2{animation-name:none}md-progress-linear .md-container.md-mode-buffer{background-color:transparent!important;transition:all .2s linear}md-progress-linear .md-container.md-mode-buffer .md-dashed:before{display:block;animation:buffer 3s infinite linear}@keyframes query{0%{opacity:1;transform:translateX(35%) scale(.3,1)}100%{opacity:0;transform:translateX(-50%) scale(0,1)}}@keyframes buffer{0%{opacity:1;background-position:0 -23px}50%{opacity:0}100%{opacity:1;background-position:-200px -23px}}@keyframes md-progress-linear-indeterminate-scale-1{0%{transform:scaleX(.1);animation-timing-function:linear}36.6%{transform:scaleX(.1);animation-timing-function:cubic-bezier(.334731432,.124819821,.785843996,1)}69.15%{transform:scaleX(.83);animation-timing-function:cubic-bezier(.225732004,0,.233648906,1.3709798)}100%{transform:scaleX(.1)}}@keyframes md-progress-linear-indeterminate-1{0%{left:-105.166666667%;animation-timing-function:linear}20%{left:-105.166666667%;animation-timing-function:cubic-bezier(.5,0,.701732,.495818703)}69.15%{left:21.5%;animation-timing-function:cubic-bezier(.302435,.38135197,.55,.956352125)}100%{left:95.4444444444%}}@keyframes md-progress-linear-indeterminate-scale-2{0%{transform:scaleX(.1);animation-timing-function:cubic-bezier(.205028172,.057050836,.57660995,.453970841)}19.15%{transform:scaleX(.57);animation-timing-function:cubic-bezier(.152312994,.196431957,.648373778,1.00431535)}44.15%{transform:scaleX(.91);animation-timing-function:cubic-bezier(.25775882,-.003163357,.211761916,1.38178961)}100%{transform:scaleX(.1)}}@keyframes md-progress-linear-indeterminate-2{0%{left:-54.8888888889%;animation-timing-function:cubic-bezier(.15,0,.5150584,.409684966)}25%{left:-17.25%;animation-timing-function:cubic-bezier(.3103299,.284057684,.8,.733718979)}48.35%{left:29.5%;animation-timing-function:cubic-bezier(.4,.627034903,.6,.902025796)}100%{left:117.388888889%}}md-radio-button{box-sizing:border-box;display:block;margin-bottom:16px;white-space:nowrap;cursor:pointer;position:relative}md-radio-button[disabled]{cursor:default}md-radio-button[disabled] .md-container{cursor:default}md-radio-button .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;cursor:pointer;left:0;right:auto}[dir=rtl] md-radio-button .md-container{left:auto}[dir=rtl] md-radio-button .md-container{right:0}md-radio-button .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-radio-button .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-radio-button.md-align-top-left>div.md-container{top:12px}md-radio-button .md-off{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-style:solid;border-width:2px;border-radius:50%;transition:border-color ease .28s}md-radio-button .md-on{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-radius:50%;transition:transform ease .28s;transform:scale(0)}md-radio-button.md-checked .md-on{transform:scale(.5)}md-radio-button .md-label{box-sizing:border-box;position:relative;display:inline-block;margin-left:30px;margin-right:0;vertical-align:middle;white-space:normal;pointer-events:none;width:auto}[dir=rtl] md-radio-button .md-label{margin-left:0}[dir=rtl] md-radio-button .md-label{margin-right:30px}md-radio-group.layout-column md-radio-button,md-radio-group.layout-gt-lg-column md-radio-button,md-radio-group.layout-gt-md-column md-radio-button,md-radio-group.layout-gt-sm-column md-radio-button,md-radio-group.layout-gt-xs-column md-radio-button,md-radio-group.layout-lg-column md-radio-button,md-radio-group.layout-md-column md-radio-button,md-radio-group.layout-sm-column md-radio-button,md-radio-group.layout-xl-column md-radio-button,md-radio-group.layout-xs-column md-radio-button{margin-bottom:16px}md-radio-group.layout-gt-lg-row md-radio-button,md-radio-group.layout-gt-md-row md-radio-button,md-radio-group.layout-gt-sm-row md-radio-button,md-radio-group.layout-gt-xs-row md-radio-button,md-radio-group.layout-lg-row md-radio-button,md-radio-group.layout-md-row md-radio-button,md-radio-group.layout-row md-radio-button,md-radio-group.layout-sm-row md-radio-button,md-radio-group.layout-xl-row md-radio-button,md-radio-group.layout-xs-row md-radio-button{margin-top:0;margin-bottom:0;margin-left:0;margin-right:16px}[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button,[dir=rtl] md-radio-group.layout-lg-row md-radio-button,[dir=rtl] md-radio-group.layout-md-row md-radio-button,[dir=rtl] md-radio-group.layout-row md-radio-button,[dir=rtl] md-radio-group.layout-sm-row md-radio-button,[dir=rtl] md-radio-group.layout-xl-row md-radio-button,[dir=rtl] md-radio-group.layout-xs-row md-radio-button{margin-left:16px}[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button,[dir=rtl] md-radio-group.layout-lg-row md-radio-button,[dir=rtl] md-radio-group.layout-md-row md-radio-button,[dir=rtl] md-radio-group.layout-row md-radio-button,[dir=rtl] md-radio-group.layout-sm-row md-radio-button,[dir=rtl] md-radio-group.layout-xl-row md-radio-button,[dir=rtl] md-radio-group.layout-xs-row md-radio-button{margin-right:0}md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,md-radio-group.layout-gt-md-row md-radio-button:last-of-type,md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,md-radio-group.layout-lg-row md-radio-button:last-of-type,md-radio-group.layout-md-row md-radio-button:last-of-type,md-radio-group.layout-row md-radio-button:last-of-type,md-radio-group.layout-sm-row md-radio-button:last-of-type,md-radio-group.layout-xl-row md-radio-button:last-of-type,md-radio-group.layout-xs-row md-radio-button:last-of-type{margin-left:0;margin-right:0}md-radio-group:focus{outline:0}md-radio-group.md-focused .md-checked .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group[disabled] md-radio-button{cursor:default}md-radio-group[disabled] md-radio-button .md-container{cursor:default}.md-inline-form md-radio-group{margin:18px 0 19px}.md-inline-form md-radio-group md-radio-button{display:inline-block;height:30px;padding:2px;box-sizing:border-box;margin-top:0;margin-bottom:0}@media screen and (-ms-high-contrast:active){md-radio-button.md-default-theme .md-on{background-color:#fff}}md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transition:transform .4s cubic-bezier(.25,.8,.25,1);transform-origin:left top}[dir=rtl] md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transform-origin:right top}md-input-container.md-input-focused:not([md-no-float]) .md-select-placeholder span:first-child{transform:translateY(-22px) translateX(-2px) scale(.75)}.md-select-menu-container{position:fixed;left:0;top:0;z-index:90;opacity:0;display:none;transform:translateY(-1px)}.md-select-menu-container:not(.md-clickable){pointer-events:none}.md-select-menu-container md-progress-circular{display:table;margin:24px auto!important}.md-select-menu-container.md-active{display:block;opacity:1}.md-select-menu-container.md-active md-select-menu{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:150ms}.md-select-menu-container.md-active md-select-menu>*{opacity:1;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:150ms;transition-delay:.1s}.md-select-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:250ms}md-input-container>md-select{margin:0;order:2}md-input-container:not(.md-input-has-value) md-select.ng-required:not(.md-no-asterisk) .md-select-value span:first-child:after,md-input-container:not(.md-input-has-value) md-select[required]:not(.md-no-asterisk) .md-select-value span:first-child:after{content:' *';font-size:13px;vertical-align:top}md-input-container.md-input-invalid md-select .md-select-value{border-bottom-style:solid;padding-bottom:1px}md-select{display:flex;margin:20px 0 26px 0}md-select.ng-required.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after,md-select[required].ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after{content:' *';font-size:13px;vertical-align:top}md-select[disabled] .md-select-value{background-position:0 bottom;background-size:4px 1px;background-repeat:repeat-x;margin-bottom:-1px}md-select:focus{outline:0}md-select[disabled]:hover{cursor:default}md-select:not([disabled]):hover{cursor:pointer}md-select:not([disabled]).ng-invalid.ng-touched .md-select-value{border-bottom-style:solid;padding-bottom:1px}md-select:not([disabled]):focus .md-select-value{border-bottom-width:2px;border-bottom-style:solid;padding-bottom:0}md-select:not([disabled]):focus.ng-invalid.ng-touched .md-select-value{padding-bottom:0}md-input-container.md-input-has-value .md-select-value>span:not(.md-select-icon){transform:translate3d(0,1px,0)}.md-select-value{display:flex;align-items:center;padding:2px 2px 1px;border-bottom-width:1px;border-bottom-style:solid;background-color:transparent;position:relative;box-sizing:content-box;min-width:64px;min-height:26px;flex-grow:1}.md-select-value>span:not(.md-select-icon){max-width:100%;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-select-value>span:not(.md-select-icon) .md-text{display:inline}.md-select-value .md-select-icon{display:block;align-items:flex-end;text-align:end;width:24px;margin:0 4px;transform:translate3d(0,-2px,0);font-size:1.2rem}.md-select-value .md-select-icon:after{display:block;content:'\25BC';position:relative;top:2px;speak:none;font-size:13px;transform:scaleY(.5) scaleX(1)}.md-select-value.md-select-placeholder{display:flex;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:2px;z-index:1}md-select-menu{display:flex;flex-direction:column;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:hidden;transform-origin:left top;transform:scale(1)}md-select-menu.md-reverse{flex-direction:column-reverse}md-select-menu:not(.md-overflow) md-content{padding-top:8px;padding-bottom:8px}[dir=rtl] md-select-menu{transform-origin:right top}md-select-menu md-content{min-width:136px;min-height:48px;max-height:256px;overflow-y:auto}md-select-menu>*{opacity:0}md-option{cursor:pointer;position:relative;display:flex;align-items:center;width:auto;transition:background .15s linear;padding:0 16px 0 16px;height:48px}md-option[disabled]{cursor:default}md-option:focus{outline:0}md-option .md-text{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}md-optgroup{display:block}md-optgroup label{display:block;font-size:14px;text-transform:uppercase;padding:16px;font-weight:500}md-optgroup md-option{padding-left:32px;padding-right:32px}@media screen and (-ms-high-contrast:active){.md-select-backdrop{background-color:transparent}md-select-menu{border:1px solid #fff}}md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:40px;padding-right:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-right:40px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;left:0;right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{right:0}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:after{box-sizing:border-box;content:'';position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:20px;height:20px;border-width:2px;border-style:solid;border-radius:2px}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon{border-color:transparent}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4.6666666667px;top:.2222222222px;display:table;width:6.6666666667px;height:13.3333333333px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:''}md-select-menu[multiple] md-option.md-checkbox-enabled[disabled]{cursor:default}md-select-menu[multiple] md-option.md-checkbox-enabled.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:table;width:12px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:''}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:10.6666666667px;margin-right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-right:10.6666666667px}md-sidenav{box-sizing:border-box;position:absolute;flex-direction:column;z-index:60;width:320px;max-width:320px;bottom:0;overflow:auto;-webkit-overflow-scrolling:touch}md-sidenav ul{list-style:none}md-sidenav.md-closed{display:none}md-sidenav.md-closed-add,md-sidenav.md-closed-remove{display:flex;transition:.2s ease-in all}md-sidenav.md-closed-add.md-closed-add-active,md-sidenav.md-closed-remove.md-closed-remove-active{transition:all .4s cubic-bezier(.25,.8,.25,1)}md-sidenav.md-locked-open-add,md-sidenav.md-locked-open-remove{position:static;display:flex;transform:translate3d(0,0,0)}md-sidenav.md-locked-open,md-sidenav.md-locked-open-remove.md-closed,md-sidenav.md-locked-open.md-closed,md-sidenav.md-locked-open.md-closed.md-sidenav-left,md-sidenav.md-locked-open.md-closed.md-sidenav-right{position:static;display:flex;transform:translate3d(0,0,0)}md-sidenav.md-locked-open-remove-active{transition:width .3s cubic-bezier(.55,0,.55,.2),min-width .3s cubic-bezier(.55,0,.55,.2);width:0!important;min-width:0!important}md-sidenav.md-closed.md-locked-open-add{width:0!important;min-width:0!important;transform:translate3d(0,0,0)}md-sidenav.md-closed.md-locked-open-add-active{transition:width .3s cubic-bezier(.55,0,.55,.2),min-width .3s cubic-bezier(.55,0,.55,.2);width:320px;min-width:320px;transform:translate3d(0,0,0)}.md-sidenav-backdrop.md-locked-open{display:none}.md-sidenav-left,md-sidenav{left:0;top:0;transform:translate3d(0,0,0)}.md-sidenav-left.md-closed,md-sidenav.md-closed{transform:translate3d(-100%,0,0)}.md-sidenav-right{left:100%;top:0;transform:translate(-100%,0)}.md-sidenav-right.md-closed{transform:translate(0,0)}@media (min-width:600px){md-sidenav{max-width:400px}}@media (max-width:456px){md-sidenav{width:calc(100% - 56px);min-width:calc(100% - 56px);max-width:calc(100% - 56px)}}@media screen and (-ms-high-contrast:active){.md-sidenav-left,md-sidenav{border-right:1px solid #fff}.md-sidenav-right{border-left:1px solid #fff}}@keyframes sliderFocusThumb{0%{transform:scale(.7)}30%{transform:scale(1)}100%{transform:scale(.7)}}@keyframes sliderDiscreteFocusThumb{0%{transform:scale(.7)}50%{transform:scale(.8)}100%{transform:scale(0)}}@keyframes sliderDiscreteFocusRing{0%{transform:scale(.7);opacity:0}50%{transform:scale(1);opacity:1}100%{transform:scale(0)}}md-slider{height:48px;min-width:128px;position:relative;margin-left:4px;margin-right:4px;padding:0;display:block;flex-direction:row}md-slider *,md-slider :after{box-sizing:border-box}md-slider .md-slider-wrapper{outline:0;width:100%;height:100%}md-slider .md-slider-content{position:relative}md-slider .md-track-container{width:100%;position:absolute;top:23px;height:2px}md-slider .md-track{position:absolute;left:0;right:0;height:100%}md-slider .md-track-fill{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-property:width,height}md-slider .md-track-ticks{position:absolute;left:0;right:0;height:100%}md-slider .md-track-ticks canvas{width:100%;height:100%}md-slider .md-thumb-container{position:absolute;left:0;top:50%;transform:translate3d(-50%,-50%,0);transition:all .4s cubic-bezier(.25,.8,.25,1);transition-property:left,right,bottom}[dir=rtl] md-slider .md-thumb-container{left:auto;right:0}md-slider .md-thumb{z-index:1;position:absolute;left:-10px;top:14px;width:20px;height:20px;border-radius:20px;transform:scale(.7);transition:all .4s cubic-bezier(.25,.8,.25,1)}[dir=rtl] md-slider .md-thumb{left:auto;right:-10px}md-slider .md-thumb:after{content:'';position:absolute;width:20px;height:20px;border-radius:20px;border-width:3px;border-style:solid;transition:inherit}md-slider .md-sign{display:flex;align-items:center;justify-content:center;position:absolute;left:-14px;top:-17px;width:28px;height:28px;border-radius:28px;transform:scale(.4) translate3d(0,67.5px,0);transition:all .3s cubic-bezier(.35,0,.25,1)}md-slider .md-sign:after{position:absolute;content:'';left:0;border-radius:16px;top:19px;border-left:14px solid transparent;border-right:14px solid transparent;border-top-width:16px;border-top-style:solid;opacity:0;transform:translate3d(0,-8px,0);transition:all .2s cubic-bezier(.35,0,.25,1)}[dir=rtl] md-slider .md-sign:after{left:auto;right:0}md-slider .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:700}md-slider .md-focus-ring{position:absolute;left:-17px;top:7px;width:34px;height:34px;border-radius:34px;transform:scale(.7);opacity:0;transition:all .35s cubic-bezier(.35,0,.25,1)}[dir=rtl] md-slider .md-focus-ring{left:auto;right:-17px}md-slider .md-disabled-thumb{position:absolute;left:-14px;top:10px;width:28px;height:28px;border-radius:28px;transform:scale(.5);border-width:4px;border-style:solid;display:none}[dir=rtl] md-slider .md-disabled-thumb{left:auto;right:-14px}md-slider.md-min .md-sign{opacity:0}md-slider:focus{outline:0}md-slider.md-dragging .md-thumb-container,md-slider.md-dragging .md-track-fill{transition:none}md-slider:not([md-discrete]) .md-sign,md-slider:not([md-discrete]) .md-track-ticks{display:none}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper .md-thumb:hover{transform:scale(.8)}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(1);opacity:1}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderFocusThumb .7s cubic-bezier(.35,0,.25,1)}md-slider:not([md-discrete]):not([disabled]).md-active .md-slider-wrapper .md-thumb{transform:scale(1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(0);animation:sliderDiscreteFocusRing .5s cubic-bezier(.35,0,.25,1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderDiscreteFocusThumb .5s cubic-bezier(.35,0,.25,1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb,md-slider[md-discrete]:not([disabled]).md-active .md-thumb{transform:scale(0)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign,md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign:after,md-slider[md-discrete]:not([disabled]).md-active .md-sign,md-slider[md-discrete]:not([disabled]).md-active .md-sign:after{opacity:1;transform:translate3d(0,0,0) scale(1)}md-slider[md-discrete][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-discrete][disabled][readonly] .md-sign,md-slider[md-discrete][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0,0,0) scale(1)}md-slider[disabled] .md-track-fill{display:none}md-slider[disabled] .md-track-ticks{opacity:0}md-slider[disabled]:not([readonly]) .md-sign{opacity:0}md-slider[disabled] .md-thumb{transform:scale(.5)}md-slider[disabled] .md-disabled-thumb{display:block}md-slider[md-vertical]{flex-direction:column;min-height:128px;min-width:0}md-slider[md-vertical] .md-slider-wrapper{flex:1;padding-top:12px;padding-bottom:12px;width:48px;align-self:center;display:flex;justify-content:center}md-slider[md-vertical] .md-track-container{height:100%;width:2px;top:0;left:calc(50% - (2px / 2))}md-slider[md-vertical] .md-thumb-container{top:auto;margin-bottom:23px;left:calc(50% - 1px);bottom:0}md-slider[md-vertical] .md-thumb-container .md-thumb:after{left:1px}md-slider[md-vertical] .md-thumb-container .md-focus-ring{left:-16px}md-slider[md-vertical] .md-track-fill{bottom:0}md-slider[md-vertical][md-discrete] .md-sign{left:-40px;top:9.5px;transform:scale(.4) translate3d(67.5px,0,0)}md-slider[md-vertical][md-discrete] .md-sign:after{top:9.5px;left:19px;border-top:14px solid transparent;border-right:0;border-bottom:14px solid transparent;border-left-width:16px;border-left-style:solid;opacity:0;transform:translate3d(0,-8px,0);transition:all .2s ease-in-out}md-slider[md-vertical][md-discrete] .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:700}md-slider[md-vertical][md-discrete] .md-focused .md-sign:after,md-slider[md-vertical][md-discrete].md-active .md-sign:after,md-slider[md-vertical][md-discrete][disabled][readonly] .md-sign:after{top:0}md-slider[md-vertical][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-vertical][disabled][readonly] .md-sign,md-slider[md-vertical][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0,0,0) scale(1)}md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:auto;right:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{right:auto}md-slider[md-invert][md-vertical] .md-track-fill{bottom:auto;top:0}md-slider-container{display:flex;align-items:center;flex-direction:row}md-slider-container>:first-child:not(md-slider),md-slider-container>:last-child:not(md-slider){min-width:25px;max-width:42px;height:25px;transition:all .4s cubic-bezier(.25,.8,.25,1);transition-property:color,max-width}md-slider-container>:first-child:not(md-slider){margin-right:16px}[dir=rtl] md-slider-container>:first-child:not(md-slider){margin-right:auto;margin-left:16px}md-slider-container>:last-child:not(md-slider){margin-left:16px}[dir=rtl] md-slider-container>:last-child:not(md-slider){margin-left:auto;margin-right:16px}md-slider-container[md-vertical]{flex-direction:column}md-slider-container[md-vertical]>:first-child:not(md-slider),md-slider-container[md-vertical]>:last-child:not(md-slider){margin-right:0;margin-left:0;text-align:center}md-slider-container md-input-container input[type=number]{text-align:center;padding-left:15px;height:50px;margin-top:-25px}[dir=rtl] md-slider-container md-input-container input[type=number]{padding-left:0;padding-right:15px}@media screen and (-ms-high-contrast:active){md-slider.md-default-theme .md-track{border-bottom:1px solid #fff}}.md-sticky-clone{z-index:2;top:0;left:0;right:0;position:absolute!important;transform:translate3d(-9999px,-9999px,0)}.md-sticky-clone[sticky-state=active]{transform:translate3d(0,0,0)}.md-sticky-clone[sticky-state=active]:not(.md-sticky-no-effect) .md-subheader-inner{animation:subheaderStickyHoverIn .3s ease-out both}@keyframes subheaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@keyframes subheaderStickyHoverOut{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}.md-subheader-wrapper:not(.md-sticky-no-effect){transition:.2s ease-out margin}.md-subheader-wrapper:not(.md-sticky-no-effect) .md-subheader{margin:0}.md-subheader-wrapper:not(.md-sticky-no-effect).md-sticky-clone{z-index:2}.md-subheader-wrapper:not(.md-sticky-no-effect)[sticky-state=active]{margin-top:-2px}.md-subheader-wrapper:not(.md-sticky-no-effect):not(.md-sticky-clone)[sticky-prev-state=active] .md-subheader-inner:after{animation:subheaderStickyHoverOut .3s ease-out both}.md-subheader{display:block;font-size:14px;font-weight:500;line-height:1em;margin:0;position:relative}.md-subheader .md-subheader-inner{display:block;padding:16px}.md-subheader .md-subheader-content{display:block;z-index:1;position:relative}.md-inline-form md-switch{margin-top:18px;margin-bottom:19px}md-switch{margin:16px 0;white-space:nowrap;cursor:pointer;outline:0;user-select:none;height:30px;line-height:28px;align-items:center;display:flex;margin-left:inherit;margin-right:16px}[dir=rtl] md-switch{margin-left:16px}[dir=rtl] md-switch{margin-right:inherit}md-switch:last-of-type{margin-left:inherit;margin-right:0}[dir=rtl] md-switch:last-of-type{margin-left:0}[dir=rtl] md-switch:last-of-type{margin-right:inherit}md-switch[disabled]{cursor:default}md-switch[disabled] .md-container{cursor:default}md-switch .md-container{cursor:grab;width:36px;height:24px;position:relative;user-select:none;margin-right:8px;float:left}[dir=rtl] md-switch .md-container{margin-right:auto;margin-left:8px}md-switch:not([disabled]) .md-dragging,md-switch:not([disabled]).md-dragging .md-container{cursor:grabbing}md-switch.md-focused:not([disabled]) .md-thumb:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-switch.md-focused:not([disabled]):not(.md-checked) .md-thumb:before{background-color:rgba(0,0,0,.12)}md-switch .md-label{border-color:transparent;border-width:0;float:left}md-switch .md-bar{left:1px;width:34px;top:5px;height:14px;border-radius:8px;position:absolute}md-switch .md-thumb-container{top:2px;left:0;width:16px;position:absolute;transform:translate3d(0,0,0);z-index:1}md-switch.md-checked .md-thumb-container{transform:translate3d(100%,0,0)}md-switch .md-thumb{position:absolute;margin:0;left:0;top:0;outline:0;height:20px;width:20px;border-radius:50%;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}md-switch .md-thumb:before{background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-switch .md-thumb .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-20px;top:-20px;right:-20px;bottom:-20px}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb,md-switch:not(.md-dragging) .md-thumb-container{transition:all 80ms linear;transition-property:transform,background-color}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb{transition-delay:50ms}@media screen and (-ms-high-contrast:active){md-switch.md-default-theme .md-bar{background-color:#666}md-switch.md-default-theme.md-checked .md-bar{background-color:#9e9e9e}md-switch.md-default-theme .md-thumb{background-color:#fff}}@keyframes md-tab-content-hide{0%{opacity:1}50%{opacity:1}100%{opacity:0}}md-tab-data{position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;opacity:0}md-tabs{display:block;margin:0;border-radius:2px;overflow:hidden;position:relative;flex-shrink:0}md-tabs:not(.md-no-tab-content):not(.md-dynamic-height){min-height:248px}md-tabs[md-align-tabs=bottom]{padding-bottom:48px}md-tabs[md-align-tabs=bottom] md-tabs-wrapper{position:absolute;bottom:0;left:0;right:0;height:48px;z-index:2}md-tabs[md-align-tabs=bottom] md-tabs-content-wrapper{top:0;bottom:48px}md-tabs.md-dynamic-height md-tabs-content-wrapper{min-height:0;position:relative;top:auto;left:auto;right:auto;bottom:auto;overflow:visible}md-tabs.md-dynamic-height md-tab-content.md-active{position:relative}md-tabs[md-border-bottom] md-tabs-wrapper{border-width:0 0 1px;border-style:solid}md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper{top:49px}md-tabs-wrapper{display:block;position:relative;transform:translate3d(0,0,0)}md-tabs-wrapper md-next-button,md-tabs-wrapper md-prev-button{height:100%;width:32px;position:absolute;top:50%;transform:translateY(-50%);line-height:1em;z-index:2;cursor:pointer;font-size:16px;background:transparent no-repeat center center;transition:all .5s cubic-bezier(.35,0,.25,1)}md-tabs-wrapper md-next-button:focus,md-tabs-wrapper md-prev-button:focus{outline:0}md-tabs-wrapper md-next-button.md-disabled,md-tabs-wrapper md-prev-button.md-disabled{opacity:.25;cursor:default}md-tabs-wrapper md-next-button.ng-leave,md-tabs-wrapper md-prev-button.ng-leave{transition:none}md-tabs-wrapper md-next-button md-icon,md-tabs-wrapper md-prev-button md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%,-50%,0)}md-tabs-wrapper md-prev-button{left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg==)}[dir=rtl] md-tabs-wrapper md-prev-button{left:auto;right:0}md-tabs-wrapper md-next-button{right:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K)}[dir=rtl] md-tabs-wrapper md-next-button{right:auto;left:0}md-tabs-wrapper md-next-button md-icon{transform:translate3d(-50%,-50%,0) rotate(180deg)}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper{width:100%;display:flex;flex-direction:row}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item{flex-grow:1}md-tabs-canvas{position:relative;overflow:hidden;display:block;height:48px}md-tabs-canvas:after{content:'';display:table;clear:both}md-tabs-canvas .md-dummy-wrapper{position:absolute;top:0;left:0}[dir=rtl] md-tabs-canvas .md-dummy-wrapper{left:auto;right:0}md-tabs-canvas.md-paginated{margin:0 32px}md-tabs-canvas.md-center-tabs{display:flex;flex-direction:column;text-align:center}md-tabs-canvas.md-center-tabs .md-tab{float:none;display:inline-block}md-pagination-wrapper{height:48px;display:block;transition:transform .5s cubic-bezier(.35,0,.25,1);position:absolute;width:999999px;left:0;transform:translate3d(0,0,0)}md-pagination-wrapper:after{content:'';display:table;clear:both}[dir=rtl] md-pagination-wrapper{left:auto;right:0}md-pagination-wrapper.md-center-tabs{position:relative;width:auto;margin:0 auto}md-tabs-content-wrapper{display:block;position:absolute;top:48px;left:0;right:0;bottom:0;overflow:hidden}md-tab-content{display:block;position:absolute;top:0;left:0;right:0;bottom:0;transition:transform .5s cubic-bezier(.35,0,.25,1);overflow:auto;transform:translate3d(0,0,0)}md-tab-content.md-no-scroll{bottom:auto;overflow:hidden}md-tab-content.md-no-transition,md-tab-content.ng-leave{transition:none}md-tab-content.md-left:not(.md-active){transform:translateX(-100%);animation:1s md-tab-content-hide;opacity:0}[dir=rtl] md-tab-content.md-left:not(.md-active){transform:translateX(100%)}md-tab-content.md-left:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content.md-right:not(.md-active){transform:translateX(100%);animation:1s md-tab-content-hide;opacity:0}[dir=rtl] md-tab-content.md-right:not(.md-active){transform:translateX(-100%)}md-tab-content.md-right:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content>div.ng-leave{animation:1s md-tab-content-hide}md-ink-bar{position:absolute;left:auto;right:auto;bottom:0;height:2px}md-ink-bar.md-left{transition:left 125ms cubic-bezier(.35,0,.25,1),right .25s cubic-bezier(.35,0,.25,1)}md-ink-bar.md-right{transition:left .25s cubic-bezier(.35,0,.25,1),right 125ms cubic-bezier(.35,0,.25,1)}md-tab{position:absolute;z-index:-1;left:-9999px}.md-tab{font-size:14px;text-align:center;line-height:24px;padding:12px 24px;transition:background-color .35s cubic-bezier(.35,0,.25,1);cursor:pointer;white-space:nowrap;position:relative;text-transform:uppercase;float:left;font-weight:500;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-tab{float:right}.md-tab.md-focused{box-shadow:none;outline:0}.md-tab.md-active{cursor:default}.md-tab.md-disabled{pointer-events:none;touch-action:pan-y;user-select:none;-webkit-user-drag:none;opacity:.5;cursor:default}.md-tab.ng-leave{transition:none}md-toolbar+md-tabs{border-top-left-radius:0;border-top-right-radius:0}.md-toast-text{padding:0 6px}md-toast{position:absolute;z-index:105;box-sizing:border-box;cursor:default;overflow:hidden;padding:8px;opacity:1;transition:all .4s cubic-bezier(.25,.8,.25,1)}md-toast .md-toast-content{display:flex;direction:row;align-items:center;max-height:168px;max-width:100%;min-height:48px;padding:0 18px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;font-size:14px;overflow:hidden;transform:translate3d(0,0,0) rotateZ(0);transition:all .4s cubic-bezier(.25,.8,.25,1);justify-content:flex-start}md-toast .md-toast-content::before{content:'';min-height:48px;visibility:hidden;display:inline-block}[dir=rtl] md-toast .md-toast-content{justify-content:flex-end}md-toast .md-toast-content span{flex:1 1 0%;box-sizing:border-box;min-width:0}md-toast.md-capsule{border-radius:24px}md-toast.md-capsule .md-toast-content{border-radius:24px}md-toast.ng-leave-active .md-toast-content{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-toast.md-swipedown .md-toast-content,md-toast.md-swipeleft .md-toast-content,md-toast.md-swiperight .md-toast-content,md-toast.md-swipeup .md-toast-content{transition:all .4s cubic-bezier(.25,.8,.25,1)}md-toast.ng-enter{opacity:0}md-toast.ng-enter .md-toast-content{transform:translate3d(0,100%,0)}md-toast.ng-enter.md-top .md-toast-content{transform:translate3d(0,-100%,0)}md-toast.ng-enter.ng-enter-active{opacity:1}md-toast.ng-enter.ng-enter-active .md-toast-content{transform:translate3d(0,0,0)}md-toast.ng-leave.ng-leave-active .md-toast-content{opacity:0;transform:translate3d(0,100%,0)}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0,-50%,0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0,50%,0)}md-toast.ng-leave.ng-leave-active.md-top .md-toast-content{transform:translate3d(0,-100%,0)}md-toast .md-action{line-height:19px;margin-left:24px;margin-right:0;cursor:pointer;text-transform:uppercase;float:right}md-toast .md-button{min-width:0;margin-right:0;margin-left:12px}[dir=rtl] md-toast .md-button{margin-right:12px}[dir=rtl] md-toast .md-button{margin-left:0}@media (max-width:959px){md-toast{left:0;right:0;width:100%;max-width:100%;min-width:0;border-radius:0;bottom:0;padding:0}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0,-50%,0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0,50%,0)}}@media (min-width:960px){md-toast{min-width:304px}md-toast.md-bottom{bottom:0}md-toast.md-left{left:0}md-toast.md-right{right:0}md-toast.md-top{top:0}md-toast._md-start{left:0}[dir=rtl] md-toast._md-start{left:auto;right:0}md-toast._md-end{right:0}[dir=rtl] md-toast._md-end{right:auto;left:0}md-toast.ng-leave.ng-leave-active.md-swipeleft .md-toast-content{transform:translate3d(-50%,0,0)}md-toast.ng-leave.ng-leave-active.md-swiperight .md-toast-content{transform:translate3d(50%,0,0)}}@media (min-width:1920px){md-toast .md-toast-content{max-width:568px}}@media screen and (-ms-high-contrast:active){md-toast{border:1px solid #fff}}.md-toast-animating{overflow:hidden!important}md-toolbar{box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:2;font-size:20px;min-height:64px;width:100%}md-toolbar._md-toolbar-transitions{transition-duration:.5s;transition-timing-function:cubic-bezier(.35,0,.25,1);transition-property:background-color,fill,color}md-toolbar.md-whiteframe-z1-add,md-toolbar.md-whiteframe-z1-remove{transition:box-shadow .5s linear}md-toolbar md-toolbar-filler{width:72px}md-toolbar *,md-toolbar :after,md-toolbar :before{box-sizing:border-box}md-toolbar.ng-animate{transition:none}md-toolbar.md-tall{height:128px;min-height:128px;max-height:128px}md-toolbar.md-medium-tall{height:88px;min-height:88px;max-height:88px}md-toolbar.md-medium-tall .md-toolbar-tools{height:48px;min-height:48px;max-height:48px}md-toolbar>.md-indent{margin-left:64px}[dir=rtl] md-toolbar>.md-indent{margin-left:auto;margin-right:64px}md-toolbar~md-content>md-list{padding:0}md-toolbar~md-content>md-list md-list-item:last-child md-divider{display:none}.md-toolbar-tools{font-size:20px;letter-spacing:.005em;box-sizing:border-box;font-weight:400;display:flex;align-items:center;flex-direction:row;width:100%;height:64px;max-height:64px;padding:0 16px;margin:0}.md-toolbar-tools h1,.md-toolbar-tools h2,.md-toolbar-tools h3{font-size:inherit;font-weight:inherit;margin:inherit}.md-toolbar-tools a{color:inherit;text-decoration:none}.md-toolbar-tools .fill-height{display:flex;align-items:center}.md-toolbar-tools .md-button{margin-top:0;margin-bottom:0}.md-toolbar-tools .md-button,.md-toolbar-tools .md-button.md-icon-button md-icon{transition-duration:.5s;transition-timing-function:cubic-bezier(.35,0,.25,1);transition-property:background-color,fill,color}.md-toolbar-tools .md-button.md-icon-button md-icon.ng-animate,.md-toolbar-tools .md-button.ng-animate{transition:none}.md-toolbar-tools>.md-button:first-child{margin-left:-8px}[dir=rtl] .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-8px}.md-toolbar-tools>.md-button:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>md-menu:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child>.md-button{margin-right:0}[dir=rtl] .md-toolbar-tools>md-menu:last-child>.md-button{margin-right:auto;margin-left:0}@media screen and (-ms-high-contrast:active){.md-toolbar-tools{border-bottom:1px solid #fff}}@media (min-width:0) and (max-width:959px) and (orientation:portrait){md-toolbar{min-height:56px}.md-toolbar-tools{height:56px;max-height:56px}}@media (min-width:0) and (max-width:959px) and (orientation:landscape){md-toolbar{min-height:48px}.md-toolbar-tools{height:48px;max-height:48px}}md-tooltip{position:absolute;z-index:100;overflow:hidden;pointer-events:none;border-radius:4px;font-weight:500;font-size:14px}@media (min-width:960px){md-tooltip{font-size:10px}}md-tooltip .md-content{position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transform-origin:center top;transform:scale(0);opacity:0;height:32px;line-height:32px;padding-left:16px;padding-right:16px}@media (min-width:960px){md-tooltip .md-content{height:22px;line-height:22px;padding-left:8px;padding-right:8px}}md-tooltip .md-content.md-show-add{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:.2s;transform:scale(0);opacity:0}md-tooltip .md-content.md-show,md-tooltip .md-content.md-show-add-active{transform:scale(1);opacity:.9;transform-origin:center top}md-tooltip .md-content.md-show-remove{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:.2s}md-tooltip .md-content.md-show-remove.md-show-remove-active{transform:scale(0);opacity:0}md-tooltip.md-hide{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-tooltip.md-show{transition:all .4s cubic-bezier(.25,.8,.25,1);pointer-events:auto}.md-virtual-repeat-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;padding:0;position:relative}.md-virtual-repeat-container .md-virtual-repeat-scroller{bottom:0;box-sizing:border-box;left:0;margin:0;overflow-x:hidden;padding:0;position:absolute;right:0;top:0;-webkit-overflow-scrolling:touch}.md-virtual-repeat-container .md-virtual-repeat-sizer{box-sizing:border-box;height:1px;display:block;margin:0;padding:0;width:1px}.md-virtual-repeat-container .md-virtual-repeat-offsetter{box-sizing:border-box;left:0;margin:0;padding:0;position:absolute;right:0;top:0}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller{overflow-x:auto;overflow-y:hidden}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{bottom:16px;right:auto;white-space:nowrap}[dir=rtl] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{right:auto;left:auto}.md-whiteframe-1dp,.md-whiteframe-z1{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.md-whiteframe-2dp{box-shadow:0 1px 5px 0 rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12)}.md-whiteframe-3dp{box-shadow:0 1px 8px 0 rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.12)}.md-whiteframe-4dp,.md-whiteframe-z2{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.md-whiteframe-5dp{box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12)}.md-whiteframe-6dp{box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}.md-whiteframe-7dp,.md-whiteframe-z3{box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.md-whiteframe-8dp{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.md-whiteframe-9dp{box-shadow:0 5px 6px -3px rgba(0,0,0,.2),0 9px 12px 1px rgba(0,0,0,.14),0 3px 16px 2px rgba(0,0,0,.12)}.md-whiteframe-10dp,.md-whiteframe-z4{box-shadow:0 6px 6px -3px rgba(0,0,0,.2),0 10px 14px 1px rgba(0,0,0,.14),0 4px 18px 3px rgba(0,0,0,.12)}.md-whiteframe-11dp{box-shadow:0 6px 7px -4px rgba(0,0,0,.2),0 11px 15px 1px rgba(0,0,0,.14),0 4px 20px 3px rgba(0,0,0,.12)}.md-whiteframe-12dp{box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 12px 17px 2px rgba(0,0,0,.14),0 5px 22px 4px rgba(0,0,0,.12)}.md-whiteframe-13dp,.md-whiteframe-z5{box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 13px 19px 2px rgba(0,0,0,.14),0 5px 24px 4px rgba(0,0,0,.12)}.md-whiteframe-14dp{box-shadow:0 7px 9px -4px rgba(0,0,0,.2),0 14px 21px 2px rgba(0,0,0,.14),0 5px 26px 4px rgba(0,0,0,.12)}.md-whiteframe-15dp{box-shadow:0 8px 9px -5px rgba(0,0,0,.2),0 15px 22px 2px rgba(0,0,0,.14),0 6px 28px 5px rgba(0,0,0,.12)}.md-whiteframe-16dp{box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12)}.md-whiteframe-17dp{box-shadow:0 8px 11px -5px rgba(0,0,0,.2),0 17px 26px 2px rgba(0,0,0,.14),0 6px 32px 5px rgba(0,0,0,.12)}.md-whiteframe-18dp{box-shadow:0 9px 11px -5px rgba(0,0,0,.2),0 18px 28px 2px rgba(0,0,0,.14),0 7px 34px 6px rgba(0,0,0,.12)}.md-whiteframe-19dp{box-shadow:0 9px 12px -6px rgba(0,0,0,.2),0 19px 29px 2px rgba(0,0,0,.14),0 7px 36px 6px rgba(0,0,0,.12)}.md-whiteframe-20dp{box-shadow:0 10px 13px -6px rgba(0,0,0,.2),0 20px 31px 3px rgba(0,0,0,.14),0 8px 38px 7px rgba(0,0,0,.12)}.md-whiteframe-21dp{box-shadow:0 10px 13px -6px rgba(0,0,0,.2),0 21px 33px 3px rgba(0,0,0,.14),0 8px 40px 7px rgba(0,0,0,.12)}.md-whiteframe-22dp{box-shadow:0 10px 14px -6px rgba(0,0,0,.2),0 22px 35px 3px rgba(0,0,0,.14),0 8px 42px 7px rgba(0,0,0,.12)}.md-whiteframe-23dp{box-shadow:0 11px 14px -7px rgba(0,0,0,.2),0 23px 36px 3px rgba(0,0,0,.14),0 9px 44px 8px rgba(0,0,0,.12)}.md-whiteframe-24dp{box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12)}@media screen and (-ms-high-contrast:active){md-whiteframe{border:1px solid #fff}}@media print{[md-whiteframe],md-whiteframe{background-color:#fff}}.ng-cloak,.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}@-moz-document url-prefix(){.layout-fill{margin:0;width:100%;min-height:100%;height:100%}}.flex-order{order:0}.flex-order--20{order:-20}.flex-order--19{order:-19}.flex-order--18{order:-18}.flex-order--17{order:-17}.flex-order--16{order:-16}.flex-order--15{order:-15}.flex-order--14{order:-14}.flex-order--13{order:-13}.flex-order--12{order:-12}.flex-order--11{order:-11}.flex-order--10{order:-10}.flex-order--9{order:-9}.flex-order--8{order:-8}.flex-order--7{order:-7}.flex-order--6{order:-6}.flex-order--5{order:-5}.flex-order--4{order:-4}.flex-order--3{order:-3}.flex-order--2{order:-2}.flex-order--1{order:-1}.flex-order-0{order:0}.flex-order-1{order:1}.flex-order-2{order:2}.flex-order-3{order:3}.flex-order-4{order:4}.flex-order-5{order:5}.flex-order-6{order:6}.flex-order-7{order:7}.flex-order-8{order:8}.flex-order-9{order:9}.flex-order-10{order:10}.flex-order-11{order:11}.flex-order-12{order:12}.flex-order-13{order:13}.flex-order-14{order:14}.flex-order-15{order:15}.flex-order-16{order:16}.flex-order-17{order:17}.flex-order-18{order:18}.flex-order-19{order:19}.flex-order-20{order:20}.flex-offset-0,.offset-0{margin-left:0}[dir=rtl] .flex-offset-0,[dir=rtl] .offset-0{margin-left:auto;margin-right:0}.flex-offset-5,.offset-5{margin-left:5%}[dir=rtl] .flex-offset-5,[dir=rtl] .offset-5{margin-left:auto;margin-right:5%}.flex-offset-10,.offset-10{margin-left:10%}[dir=rtl] .flex-offset-10,[dir=rtl] .offset-10{margin-left:auto;margin-right:10%}.flex-offset-15,.offset-15{margin-left:15%}[dir=rtl] .flex-offset-15,[dir=rtl] .offset-15{margin-left:auto;margin-right:15%}.flex-offset-20,.offset-20{margin-left:20%}[dir=rtl] .flex-offset-20,[dir=rtl] .offset-20{margin-left:auto;margin-right:20%}.flex-offset-25,.offset-25{margin-left:25%}[dir=rtl] .flex-offset-25,[dir=rtl] .offset-25{margin-left:auto;margin-right:25%}.flex-offset-30,.offset-30{margin-left:30%}[dir=rtl] .flex-offset-30,[dir=rtl] .offset-30{margin-left:auto;margin-right:30%}.flex-offset-35,.offset-35{margin-left:35%}[dir=rtl] .flex-offset-35,[dir=rtl] .offset-35{margin-left:auto;margin-right:35%}.flex-offset-40,.offset-40{margin-left:40%}[dir=rtl] .flex-offset-40,[dir=rtl] .offset-40{margin-left:auto;margin-right:40%}.flex-offset-45,.offset-45{margin-left:45%}[dir=rtl] .flex-offset-45,[dir=rtl] .offset-45{margin-left:auto;margin-right:45%}.flex-offset-50,.offset-50{margin-left:50%}[dir=rtl] .flex-offset-50,[dir=rtl] .offset-50{margin-left:auto;margin-right:50%}.flex-offset-55,.offset-55{margin-left:55%}[dir=rtl] .flex-offset-55,[dir=rtl] .offset-55{margin-left:auto;margin-right:55%}.flex-offset-60,.offset-60{margin-left:60%}[dir=rtl] .flex-offset-60,[dir=rtl] .offset-60{margin-left:auto;margin-right:60%}.flex-offset-65,.offset-65{margin-left:65%}[dir=rtl] .flex-offset-65,[dir=rtl] .offset-65{margin-left:auto;margin-right:65%}.flex-offset-70,.offset-70{margin-left:70%}[dir=rtl] .flex-offset-70,[dir=rtl] .offset-70{margin-left:auto;margin-right:70%}.flex-offset-75,.offset-75{margin-left:75%}[dir=rtl] .flex-offset-75,[dir=rtl] .offset-75{margin-left:auto;margin-right:75%}.flex-offset-80,.offset-80{margin-left:80%}[dir=rtl] .flex-offset-80,[dir=rtl] .offset-80{margin-left:auto;margin-right:80%}.flex-offset-85,.offset-85{margin-left:85%}[dir=rtl] .flex-offset-85,[dir=rtl] .offset-85{margin-left:auto;margin-right:85%}.flex-offset-90,.offset-90{margin-left:90%}[dir=rtl] .flex-offset-90,[dir=rtl] .offset-90{margin-left:auto;margin-right:90%}.flex-offset-95,.offset-95{margin-left:95%}[dir=rtl] .flex-offset-95,[dir=rtl] .offset-95{margin-left:auto;margin-right:95%}.flex-offset-33,.offset-33{margin-left:calc(100% / 3)}.flex-offset-66,.offset-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-66,[dir=rtl] .offset-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align,.layout-align-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-start,.layout-align-start-center,.layout-align-start-end,.layout-align-start-start,.layout-align-start-stretch{justify-content:flex-start}.layout-align-center,.layout-align-center-center,.layout-align-center-end,.layout-align-center-start,.layout-align-center-stretch{justify-content:center}.layout-align-end,.layout-align-end-center,.layout-align-end-end,.layout-align-end-start,.layout-align-end-stretch{justify-content:flex-end}.layout-align-space-around,.layout-align-space-around-center,.layout-align-space-around-end,.layout-align-space-around-start,.layout-align-space-around-stretch{justify-content:space-around}.layout-align-space-between,.layout-align-space-between-center,.layout-align-space-between-end,.layout-align-space-between-start,.layout-align-space-between-stretch{justify-content:space-between}.layout-align-center-start,.layout-align-end-start,.layout-align-space-around-start,.layout-align-space-between-start,.layout-align-start-start{align-items:flex-start;align-content:flex-start}.layout-align-center-center,.layout-align-end-center,.layout-align-space-around-center,.layout-align-space-between-center,.layout-align-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-center-center>*,.layout-align-end-center>*,.layout-align-space-around-center>*,.layout-align-space-between-center>*,.layout-align-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-center-end,.layout-align-end-end,.layout-align-space-around-end,.layout-align-space-between-end,.layout-align-start-end{align-items:flex-end;align-content:flex-end}.layout-align-center-stretch,.layout-align-end-stretch,.layout-align-space-around-stretch,.layout-align-space-between-stretch,.layout-align-start-stretch{align-items:stretch;align-content:stretch}.flex{flex:1;box-sizing:border-box}.flex-grow{flex:1 1 100%;box-sizing:border-box}.flex-initial{flex:0 1 auto;box-sizing:border-box}.flex-auto{flex:1 1 auto;box-sizing:border-box}.flex-none{flex:0 0 auto;box-sizing:border-box}.flex-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex{min-width:0}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-column>.flex{min-height:0}.layout,.layout-column,.layout-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-column{flex-direction:column}.layout-row{flex-direction:row}.layout-padding-sm>*,.layout-padding>.flex-sm{padding:4px}.layout-padding,.layout-padding-gt-sm,.layout-padding-gt-sm>*,.layout-padding-md,.layout-padding-md>*,.layout-padding>*,.layout-padding>.flex,.layout-padding>.flex-gt-sm,.layout-padding>.flex-md{padding:8px}.layout-padding-gt-lg>*,.layout-padding-gt-md>*,.layout-padding-lg>*,.layout-padding>.flex-gt-lg,.layout-padding>.flex-gt-md,.layout-padding>.flex-lg{padding:16px}.layout-margin-sm>*,.layout-margin>.flex-sm{margin:4px}.layout-margin,.layout-margin-gt-sm,.layout-margin-gt-sm>*,.layout-margin-md,.layout-margin-md>*,.layout-margin>*,.layout-margin>.flex,.layout-margin>.flex-gt-sm,.layout-margin>.flex-md{margin:8px}.layout-margin-gt-lg>*,.layout-margin-gt-md>*,.layout-margin-lg>*,.layout-margin>.flex-gt-lg,.layout-margin>.flex-gt-md,.layout-margin>.flex-lg{margin:16px}.layout-wrap{flex-wrap:wrap}.layout-nowrap{flex-wrap:nowrap}.layout-fill{margin:0;width:100%;min-height:100%;height:100%}@media (max-width:599px){.hide-xs:not(.show-xs):not(.show),.hide:not(.show-xs):not(.show){display:none}.flex-order-xs--20{order:-20}.flex-order-xs--19{order:-19}.flex-order-xs--18{order:-18}.flex-order-xs--17{order:-17}.flex-order-xs--16{order:-16}.flex-order-xs--15{order:-15}.flex-order-xs--14{order:-14}.flex-order-xs--13{order:-13}.flex-order-xs--12{order:-12}.flex-order-xs--11{order:-11}.flex-order-xs--10{order:-10}.flex-order-xs--9{order:-9}.flex-order-xs--8{order:-8}.flex-order-xs--7{order:-7}.flex-order-xs--6{order:-6}.flex-order-xs--5{order:-5}.flex-order-xs--4{order:-4}.flex-order-xs--3{order:-3}.flex-order-xs--2{order:-2}.flex-order-xs--1{order:-1}.flex-order-xs-0{order:0}.flex-order-xs-1{order:1}.flex-order-xs-2{order:2}.flex-order-xs-3{order:3}.flex-order-xs-4{order:4}.flex-order-xs-5{order:5}.flex-order-xs-6{order:6}.flex-order-xs-7{order:7}.flex-order-xs-8{order:8}.flex-order-xs-9{order:9}.flex-order-xs-10{order:10}.flex-order-xs-11{order:11}.flex-order-xs-12{order:12}.flex-order-xs-13{order:13}.flex-order-xs-14{order:14}.flex-order-xs-15{order:15}.flex-order-xs-16{order:16}.flex-order-xs-17{order:17}.flex-order-xs-18{order:18}.flex-order-xs-19{order:19}.flex-order-xs-20{order:20}.flex-offset-xs-0,.offset-xs-0{margin-left:0}[dir=rtl] .flex-offset-xs-0,[dir=rtl] .offset-xs-0{margin-left:auto;margin-right:0}.flex-offset-xs-5,.offset-xs-5{margin-left:5%}[dir=rtl] .flex-offset-xs-5,[dir=rtl] .offset-xs-5{margin-left:auto;margin-right:5%}.flex-offset-xs-10,.offset-xs-10{margin-left:10%}[dir=rtl] .flex-offset-xs-10,[dir=rtl] .offset-xs-10{margin-left:auto;margin-right:10%}.flex-offset-xs-15,.offset-xs-15{margin-left:15%}[dir=rtl] .flex-offset-xs-15,[dir=rtl] .offset-xs-15{margin-left:auto;margin-right:15%}.flex-offset-xs-20,.offset-xs-20{margin-left:20%}[dir=rtl] .flex-offset-xs-20,[dir=rtl] .offset-xs-20{margin-left:auto;margin-right:20%}.flex-offset-xs-25,.offset-xs-25{margin-left:25%}[dir=rtl] .flex-offset-xs-25,[dir=rtl] .offset-xs-25{margin-left:auto;margin-right:25%}.flex-offset-xs-30,.offset-xs-30{margin-left:30%}[dir=rtl] .flex-offset-xs-30,[dir=rtl] .offset-xs-30{margin-left:auto;margin-right:30%}.flex-offset-xs-35,.offset-xs-35{margin-left:35%}[dir=rtl] .flex-offset-xs-35,[dir=rtl] .offset-xs-35{margin-left:auto;margin-right:35%}.flex-offset-xs-40,.offset-xs-40{margin-left:40%}[dir=rtl] .flex-offset-xs-40,[dir=rtl] .offset-xs-40{margin-left:auto;margin-right:40%}.flex-offset-xs-45,.offset-xs-45{margin-left:45%}[dir=rtl] .flex-offset-xs-45,[dir=rtl] .offset-xs-45{margin-left:auto;margin-right:45%}.flex-offset-xs-50,.offset-xs-50{margin-left:50%}[dir=rtl] .flex-offset-xs-50,[dir=rtl] .offset-xs-50{margin-left:auto;margin-right:50%}.flex-offset-xs-55,.offset-xs-55{margin-left:55%}[dir=rtl] .flex-offset-xs-55,[dir=rtl] .offset-xs-55{margin-left:auto;margin-right:55%}.flex-offset-xs-60,.offset-xs-60{margin-left:60%}[dir=rtl] .flex-offset-xs-60,[dir=rtl] .offset-xs-60{margin-left:auto;margin-right:60%}.flex-offset-xs-65,.offset-xs-65{margin-left:65%}[dir=rtl] .flex-offset-xs-65,[dir=rtl] .offset-xs-65{margin-left:auto;margin-right:65%}.flex-offset-xs-70,.offset-xs-70{margin-left:70%}[dir=rtl] .flex-offset-xs-70,[dir=rtl] .offset-xs-70{margin-left:auto;margin-right:70%}.flex-offset-xs-75,.offset-xs-75{margin-left:75%}[dir=rtl] .flex-offset-xs-75,[dir=rtl] .offset-xs-75{margin-left:auto;margin-right:75%}.flex-offset-xs-80,.offset-xs-80{margin-left:80%}[dir=rtl] .flex-offset-xs-80,[dir=rtl] .offset-xs-80{margin-left:auto;margin-right:80%}.flex-offset-xs-85,.offset-xs-85{margin-left:85%}[dir=rtl] .flex-offset-xs-85,[dir=rtl] .offset-xs-85{margin-left:auto;margin-right:85%}.flex-offset-xs-90,.offset-xs-90{margin-left:90%}[dir=rtl] .flex-offset-xs-90,[dir=rtl] .offset-xs-90{margin-left:auto;margin-right:90%}.flex-offset-xs-95,.offset-xs-95{margin-left:95%}[dir=rtl] .flex-offset-xs-95,[dir=rtl] .offset-xs-95{margin-left:auto;margin-right:95%}.flex-offset-xs-33,.offset-xs-33{margin-left:calc(100% / 3)}.flex-offset-xs-66,.offset-xs-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-xs-66,[dir=rtl] .offset-xs-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-xs,.layout-align-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xs-start,.layout-align-xs-start-center,.layout-align-xs-start-end,.layout-align-xs-start-start,.layout-align-xs-start-stretch{justify-content:flex-start}.layout-align-xs-center,.layout-align-xs-center-center,.layout-align-xs-center-end,.layout-align-xs-center-start,.layout-align-xs-center-stretch{justify-content:center}.layout-align-xs-end,.layout-align-xs-end-center,.layout-align-xs-end-end,.layout-align-xs-end-start,.layout-align-xs-end-stretch{justify-content:flex-end}.layout-align-xs-space-around,.layout-align-xs-space-around-center,.layout-align-xs-space-around-end,.layout-align-xs-space-around-start,.layout-align-xs-space-around-stretch{justify-content:space-around}.layout-align-xs-space-between,.layout-align-xs-space-between-center,.layout-align-xs-space-between-end,.layout-align-xs-space-between-start,.layout-align-xs-space-between-stretch{justify-content:space-between}.layout-align-xs-center-start,.layout-align-xs-end-start,.layout-align-xs-space-around-start,.layout-align-xs-space-between-start,.layout-align-xs-start-start{align-items:flex-start;align-content:flex-start}.layout-align-xs-center-center,.layout-align-xs-end-center,.layout-align-xs-space-around-center,.layout-align-xs-space-between-center,.layout-align-xs-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-xs-center-center>*,.layout-align-xs-end-center>*,.layout-align-xs-space-around-center>*,.layout-align-xs-space-between-center>*,.layout-align-xs-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-xs-center-end,.layout-align-xs-end-end,.layout-align-xs-space-around-end,.layout-align-xs-space-between-end,.layout-align-xs-start-end{align-items:flex-end;align-content:flex-end}.layout-align-xs-center-stretch,.layout-align-xs-end-stretch,.layout-align-xs-space-around-stretch,.layout-align-xs-space-between-stretch,.layout-align-xs-start-stretch{align-items:stretch;align-content:stretch}.flex-xs{flex:1;box-sizing:border-box}.flex-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xs-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xs-column>.flex-xs-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex{min-width:0}.layout-xs-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xs-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-column>.flex{min-height:0}.layout-xs,.layout-xs-column,.layout-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xs-column{flex-direction:column}.layout-xs-row{flex-direction:row}}@media (min-width:600px){.flex-order-gt-xs--20{order:-20}.flex-order-gt-xs--19{order:-19}.flex-order-gt-xs--18{order:-18}.flex-order-gt-xs--17{order:-17}.flex-order-gt-xs--16{order:-16}.flex-order-gt-xs--15{order:-15}.flex-order-gt-xs--14{order:-14}.flex-order-gt-xs--13{order:-13}.flex-order-gt-xs--12{order:-12}.flex-order-gt-xs--11{order:-11}.flex-order-gt-xs--10{order:-10}.flex-order-gt-xs--9{order:-9}.flex-order-gt-xs--8{order:-8}.flex-order-gt-xs--7{order:-7}.flex-order-gt-xs--6{order:-6}.flex-order-gt-xs--5{order:-5}.flex-order-gt-xs--4{order:-4}.flex-order-gt-xs--3{order:-3}.flex-order-gt-xs--2{order:-2}.flex-order-gt-xs--1{order:-1}.flex-order-gt-xs-0{order:0}.flex-order-gt-xs-1{order:1}.flex-order-gt-xs-2{order:2}.flex-order-gt-xs-3{order:3}.flex-order-gt-xs-4{order:4}.flex-order-gt-xs-5{order:5}.flex-order-gt-xs-6{order:6}.flex-order-gt-xs-7{order:7}.flex-order-gt-xs-8{order:8}.flex-order-gt-xs-9{order:9}.flex-order-gt-xs-10{order:10}.flex-order-gt-xs-11{order:11}.flex-order-gt-xs-12{order:12}.flex-order-gt-xs-13{order:13}.flex-order-gt-xs-14{order:14}.flex-order-gt-xs-15{order:15}.flex-order-gt-xs-16{order:16}.flex-order-gt-xs-17{order:17}.flex-order-gt-xs-18{order:18}.flex-order-gt-xs-19{order:19}.flex-order-gt-xs-20{order:20}.flex-offset-gt-xs-0,.offset-gt-xs-0{margin-left:0}[dir=rtl] .flex-offset-gt-xs-0,[dir=rtl] .offset-gt-xs-0{margin-left:auto;margin-right:0}.flex-offset-gt-xs-5,.offset-gt-xs-5{margin-left:5%}[dir=rtl] .flex-offset-gt-xs-5,[dir=rtl] .offset-gt-xs-5{margin-left:auto;margin-right:5%}.flex-offset-gt-xs-10,.offset-gt-xs-10{margin-left:10%}[dir=rtl] .flex-offset-gt-xs-10,[dir=rtl] .offset-gt-xs-10{margin-left:auto;margin-right:10%}.flex-offset-gt-xs-15,.offset-gt-xs-15{margin-left:15%}[dir=rtl] .flex-offset-gt-xs-15,[dir=rtl] .offset-gt-xs-15{margin-left:auto;margin-right:15%}.flex-offset-gt-xs-20,.offset-gt-xs-20{margin-left:20%}[dir=rtl] .flex-offset-gt-xs-20,[dir=rtl] .offset-gt-xs-20{margin-left:auto;margin-right:20%}.flex-offset-gt-xs-25,.offset-gt-xs-25{margin-left:25%}[dir=rtl] .flex-offset-gt-xs-25,[dir=rtl] .offset-gt-xs-25{margin-left:auto;margin-right:25%}.flex-offset-gt-xs-30,.offset-gt-xs-30{margin-left:30%}[dir=rtl] .flex-offset-gt-xs-30,[dir=rtl] .offset-gt-xs-30{margin-left:auto;margin-right:30%}.flex-offset-gt-xs-35,.offset-gt-xs-35{margin-left:35%}[dir=rtl] .flex-offset-gt-xs-35,[dir=rtl] .offset-gt-xs-35{margin-left:auto;margin-right:35%}.flex-offset-gt-xs-40,.offset-gt-xs-40{margin-left:40%}[dir=rtl] .flex-offset-gt-xs-40,[dir=rtl] .offset-gt-xs-40{margin-left:auto;margin-right:40%}.flex-offset-gt-xs-45,.offset-gt-xs-45{margin-left:45%}[dir=rtl] .flex-offset-gt-xs-45,[dir=rtl] .offset-gt-xs-45{margin-left:auto;margin-right:45%}.flex-offset-gt-xs-50,.offset-gt-xs-50{margin-left:50%}[dir=rtl] .flex-offset-gt-xs-50,[dir=rtl] .offset-gt-xs-50{margin-left:auto;margin-right:50%}.flex-offset-gt-xs-55,.offset-gt-xs-55{margin-left:55%}[dir=rtl] .flex-offset-gt-xs-55,[dir=rtl] .offset-gt-xs-55{margin-left:auto;margin-right:55%}.flex-offset-gt-xs-60,.offset-gt-xs-60{margin-left:60%}[dir=rtl] .flex-offset-gt-xs-60,[dir=rtl] .offset-gt-xs-60{margin-left:auto;margin-right:60%}.flex-offset-gt-xs-65,.offset-gt-xs-65{margin-left:65%}[dir=rtl] .flex-offset-gt-xs-65,[dir=rtl] .offset-gt-xs-65{margin-left:auto;margin-right:65%}.flex-offset-gt-xs-70,.offset-gt-xs-70{margin-left:70%}[dir=rtl] .flex-offset-gt-xs-70,[dir=rtl] .offset-gt-xs-70{margin-left:auto;margin-right:70%}.flex-offset-gt-xs-75,.offset-gt-xs-75{margin-left:75%}[dir=rtl] .flex-offset-gt-xs-75,[dir=rtl] .offset-gt-xs-75{margin-left:auto;margin-right:75%}.flex-offset-gt-xs-80,.offset-gt-xs-80{margin-left:80%}[dir=rtl] .flex-offset-gt-xs-80,[dir=rtl] .offset-gt-xs-80{margin-left:auto;margin-right:80%}.flex-offset-gt-xs-85,.offset-gt-xs-85{margin-left:85%}[dir=rtl] .flex-offset-gt-xs-85,[dir=rtl] .offset-gt-xs-85{margin-left:auto;margin-right:85%}.flex-offset-gt-xs-90,.offset-gt-xs-90{margin-left:90%}[dir=rtl] .flex-offset-gt-xs-90,[dir=rtl] .offset-gt-xs-90{margin-left:auto;margin-right:90%}.flex-offset-gt-xs-95,.offset-gt-xs-95{margin-left:95%}[dir=rtl] .flex-offset-gt-xs-95,[dir=rtl] .offset-gt-xs-95{margin-left:auto;margin-right:95%}.flex-offset-gt-xs-33,.offset-gt-xs-33{margin-left:calc(100% / 3)}.flex-offset-gt-xs-66,.offset-gt-xs-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-gt-xs-66,[dir=rtl] .offset-gt-xs-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-gt-xs,.layout-align-gt-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-xs-start,.layout-align-gt-xs-start-center,.layout-align-gt-xs-start-end,.layout-align-gt-xs-start-start,.layout-align-gt-xs-start-stretch{justify-content:flex-start}.layout-align-gt-xs-center,.layout-align-gt-xs-center-center,.layout-align-gt-xs-center-end,.layout-align-gt-xs-center-start,.layout-align-gt-xs-center-stretch{justify-content:center}.layout-align-gt-xs-end,.layout-align-gt-xs-end-center,.layout-align-gt-xs-end-end,.layout-align-gt-xs-end-start,.layout-align-gt-xs-end-stretch{justify-content:flex-end}.layout-align-gt-xs-space-around,.layout-align-gt-xs-space-around-center,.layout-align-gt-xs-space-around-end,.layout-align-gt-xs-space-around-start,.layout-align-gt-xs-space-around-stretch{justify-content:space-around}.layout-align-gt-xs-space-between,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-between-stretch{justify-content:space-between}.layout-align-gt-xs-center-start,.layout-align-gt-xs-end-start,.layout-align-gt-xs-space-around-start,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-start-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-xs-center-center,.layout-align-gt-xs-end-center,.layout-align-gt-xs-space-around-center,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-xs-center-center>*,.layout-align-gt-xs-end-center>*,.layout-align-gt-xs-space-around-center>*,.layout-align-gt-xs-space-between-center>*,.layout-align-gt-xs-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-xs-center-end,.layout-align-gt-xs-end-end,.layout-align-gt-xs-space-around-end,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-start-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-xs-center-stretch,.layout-align-gt-xs-end-stretch,.layout-align-gt-xs-space-around-stretch,.layout-align-gt-xs-space-between-stretch,.layout-align-gt-xs-start-stretch{align-items:stretch;align-content:stretch}.flex-gt-xs{flex:1;box-sizing:border-box}.flex-gt-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-xs-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-xs-column>.flex-gt-xs-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex{min-width:0}.layout-gt-xs-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-column>.flex{min-height:0}.layout-gt-xs,.layout-gt-xs-column,.layout-gt-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-xs-column{flex-direction:column}.layout-gt-xs-row{flex-direction:row}}@media (min-width:600px) and (max-width:959px){.hide-gt-xs:not(.show-gt-xs):not(.show-sm):not(.show),.hide:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.hide-sm:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.flex-order-sm--20{order:-20}.flex-order-sm--19{order:-19}.flex-order-sm--18{order:-18}.flex-order-sm--17{order:-17}.flex-order-sm--16{order:-16}.flex-order-sm--15{order:-15}.flex-order-sm--14{order:-14}.flex-order-sm--13{order:-13}.flex-order-sm--12{order:-12}.flex-order-sm--11{order:-11}.flex-order-sm--10{order:-10}.flex-order-sm--9{order:-9}.flex-order-sm--8{order:-8}.flex-order-sm--7{order:-7}.flex-order-sm--6{order:-6}.flex-order-sm--5{order:-5}.flex-order-sm--4{order:-4}.flex-order-sm--3{order:-3}.flex-order-sm--2{order:-2}.flex-order-sm--1{order:-1}.flex-order-sm-0{order:0}.flex-order-sm-1{order:1}.flex-order-sm-2{order:2}.flex-order-sm-3{order:3}.flex-order-sm-4{order:4}.flex-order-sm-5{order:5}.flex-order-sm-6{order:6}.flex-order-sm-7{order:7}.flex-order-sm-8{order:8}.flex-order-sm-9{order:9}.flex-order-sm-10{order:10}.flex-order-sm-11{order:11}.flex-order-sm-12{order:12}.flex-order-sm-13{order:13}.flex-order-sm-14{order:14}.flex-order-sm-15{order:15}.flex-order-sm-16{order:16}.flex-order-sm-17{order:17}.flex-order-sm-18{order:18}.flex-order-sm-19{order:19}.flex-order-sm-20{order:20}.flex-offset-sm-0,.offset-sm-0{margin-left:0}[dir=rtl] .flex-offset-sm-0,[dir=rtl] .offset-sm-0{margin-left:auto;margin-right:0}.flex-offset-sm-5,.offset-sm-5{margin-left:5%}[dir=rtl] .flex-offset-sm-5,[dir=rtl] .offset-sm-5{margin-left:auto;margin-right:5%}.flex-offset-sm-10,.offset-sm-10{margin-left:10%}[dir=rtl] .flex-offset-sm-10,[dir=rtl] .offset-sm-10{margin-left:auto;margin-right:10%}.flex-offset-sm-15,.offset-sm-15{margin-left:15%}[dir=rtl] .flex-offset-sm-15,[dir=rtl] .offset-sm-15{margin-left:auto;margin-right:15%}.flex-offset-sm-20,.offset-sm-20{margin-left:20%}[dir=rtl] .flex-offset-sm-20,[dir=rtl] .offset-sm-20{margin-left:auto;margin-right:20%}.flex-offset-sm-25,.offset-sm-25{margin-left:25%}[dir=rtl] .flex-offset-sm-25,[dir=rtl] .offset-sm-25{margin-left:auto;margin-right:25%}.flex-offset-sm-30,.offset-sm-30{margin-left:30%}[dir=rtl] .flex-offset-sm-30,[dir=rtl] .offset-sm-30{margin-left:auto;margin-right:30%}.flex-offset-sm-35,.offset-sm-35{margin-left:35%}[dir=rtl] .flex-offset-sm-35,[dir=rtl] .offset-sm-35{margin-left:auto;margin-right:35%}.flex-offset-sm-40,.offset-sm-40{margin-left:40%}[dir=rtl] .flex-offset-sm-40,[dir=rtl] .offset-sm-40{margin-left:auto;margin-right:40%}.flex-offset-sm-45,.offset-sm-45{margin-left:45%}[dir=rtl] .flex-offset-sm-45,[dir=rtl] .offset-sm-45{margin-left:auto;margin-right:45%}.flex-offset-sm-50,.offset-sm-50{margin-left:50%}[dir=rtl] .flex-offset-sm-50,[dir=rtl] .offset-sm-50{margin-left:auto;margin-right:50%}.flex-offset-sm-55,.offset-sm-55{margin-left:55%}[dir=rtl] .flex-offset-sm-55,[dir=rtl] .offset-sm-55{margin-left:auto;margin-right:55%}.flex-offset-sm-60,.offset-sm-60{margin-left:60%}[dir=rtl] .flex-offset-sm-60,[dir=rtl] .offset-sm-60{margin-left:auto;margin-right:60%}.flex-offset-sm-65,.offset-sm-65{margin-left:65%}[dir=rtl] .flex-offset-sm-65,[dir=rtl] .offset-sm-65{margin-left:auto;margin-right:65%}.flex-offset-sm-70,.offset-sm-70{margin-left:70%}[dir=rtl] .flex-offset-sm-70,[dir=rtl] .offset-sm-70{margin-left:auto;margin-right:70%}.flex-offset-sm-75,.offset-sm-75{margin-left:75%}[dir=rtl] .flex-offset-sm-75,[dir=rtl] .offset-sm-75{margin-left:auto;margin-right:75%}.flex-offset-sm-80,.offset-sm-80{margin-left:80%}[dir=rtl] .flex-offset-sm-80,[dir=rtl] .offset-sm-80{margin-left:auto;margin-right:80%}.flex-offset-sm-85,.offset-sm-85{margin-left:85%}[dir=rtl] .flex-offset-sm-85,[dir=rtl] .offset-sm-85{margin-left:auto;margin-right:85%}.flex-offset-sm-90,.offset-sm-90{margin-left:90%}[dir=rtl] .flex-offset-sm-90,[dir=rtl] .offset-sm-90{margin-left:auto;margin-right:90%}.flex-offset-sm-95,.offset-sm-95{margin-left:95%}[dir=rtl] .flex-offset-sm-95,[dir=rtl] .offset-sm-95{margin-left:auto;margin-right:95%}.flex-offset-sm-33,.offset-sm-33{margin-left:calc(100% / 3)}.flex-offset-sm-66,.offset-sm-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-sm-66,[dir=rtl] .offset-sm-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-sm,.layout-align-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-sm-start,.layout-align-sm-start-center,.layout-align-sm-start-end,.layout-align-sm-start-start,.layout-align-sm-start-stretch{justify-content:flex-start}.layout-align-sm-center,.layout-align-sm-center-center,.layout-align-sm-center-end,.layout-align-sm-center-start,.layout-align-sm-center-stretch{justify-content:center}.layout-align-sm-end,.layout-align-sm-end-center,.layout-align-sm-end-end,.layout-align-sm-end-start,.layout-align-sm-end-stretch{justify-content:flex-end}.layout-align-sm-space-around,.layout-align-sm-space-around-center,.layout-align-sm-space-around-end,.layout-align-sm-space-around-start,.layout-align-sm-space-around-stretch{justify-content:space-around}.layout-align-sm-space-between,.layout-align-sm-space-between-center,.layout-align-sm-space-between-end,.layout-align-sm-space-between-start,.layout-align-sm-space-between-stretch{justify-content:space-between}.layout-align-sm-center-start,.layout-align-sm-end-start,.layout-align-sm-space-around-start,.layout-align-sm-space-between-start,.layout-align-sm-start-start{align-items:flex-start;align-content:flex-start}.layout-align-sm-center-center,.layout-align-sm-end-center,.layout-align-sm-space-around-center,.layout-align-sm-space-between-center,.layout-align-sm-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-sm-center-center>*,.layout-align-sm-end-center>*,.layout-align-sm-space-around-center>*,.layout-align-sm-space-between-center>*,.layout-align-sm-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-sm-center-end,.layout-align-sm-end-end,.layout-align-sm-space-around-end,.layout-align-sm-space-between-end,.layout-align-sm-start-end{align-items:flex-end;align-content:flex-end}.layout-align-sm-center-stretch,.layout-align-sm-end-stretch,.layout-align-sm-space-around-stretch,.layout-align-sm-space-between-stretch,.layout-align-sm-start-stretch{align-items:stretch;align-content:stretch}.flex-sm{flex:1;box-sizing:border-box}.flex-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-sm-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-sm-column>.flex-sm-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex{min-width:0}.layout-sm-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-sm-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-column>.flex{min-height:0}.layout-sm,.layout-sm-column,.layout-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-sm-column{flex-direction:column}.layout-sm-row{flex-direction:row}}@media (min-width:960px){.flex-order-gt-sm--20{order:-20}.flex-order-gt-sm--19{order:-19}.flex-order-gt-sm--18{order:-18}.flex-order-gt-sm--17{order:-17}.flex-order-gt-sm--16{order:-16}.flex-order-gt-sm--15{order:-15}.flex-order-gt-sm--14{order:-14}.flex-order-gt-sm--13{order:-13}.flex-order-gt-sm--12{order:-12}.flex-order-gt-sm--11{order:-11}.flex-order-gt-sm--10{order:-10}.flex-order-gt-sm--9{order:-9}.flex-order-gt-sm--8{order:-8}.flex-order-gt-sm--7{order:-7}.flex-order-gt-sm--6{order:-6}.flex-order-gt-sm--5{order:-5}.flex-order-gt-sm--4{order:-4}.flex-order-gt-sm--3{order:-3}.flex-order-gt-sm--2{order:-2}.flex-order-gt-sm--1{order:-1}.flex-order-gt-sm-0{order:0}.flex-order-gt-sm-1{order:1}.flex-order-gt-sm-2{order:2}.flex-order-gt-sm-3{order:3}.flex-order-gt-sm-4{order:4}.flex-order-gt-sm-5{order:5}.flex-order-gt-sm-6{order:6}.flex-order-gt-sm-7{order:7}.flex-order-gt-sm-8{order:8}.flex-order-gt-sm-9{order:9}.flex-order-gt-sm-10{order:10}.flex-order-gt-sm-11{order:11}.flex-order-gt-sm-12{order:12}.flex-order-gt-sm-13{order:13}.flex-order-gt-sm-14{order:14}.flex-order-gt-sm-15{order:15}.flex-order-gt-sm-16{order:16}.flex-order-gt-sm-17{order:17}.flex-order-gt-sm-18{order:18}.flex-order-gt-sm-19{order:19}.flex-order-gt-sm-20{order:20}.flex-offset-gt-sm-0,.offset-gt-sm-0{margin-left:0}[dir=rtl] .flex-offset-gt-sm-0,[dir=rtl] .offset-gt-sm-0{margin-left:auto;margin-right:0}.flex-offset-gt-sm-5,.offset-gt-sm-5{margin-left:5%}[dir=rtl] .flex-offset-gt-sm-5,[dir=rtl] .offset-gt-sm-5{margin-left:auto;margin-right:5%}.flex-offset-gt-sm-10,.offset-gt-sm-10{margin-left:10%}[dir=rtl] .flex-offset-gt-sm-10,[dir=rtl] .offset-gt-sm-10{margin-left:auto;margin-right:10%}.flex-offset-gt-sm-15,.offset-gt-sm-15{margin-left:15%}[dir=rtl] .flex-offset-gt-sm-15,[dir=rtl] .offset-gt-sm-15{margin-left:auto;margin-right:15%}.flex-offset-gt-sm-20,.offset-gt-sm-20{margin-left:20%}[dir=rtl] .flex-offset-gt-sm-20,[dir=rtl] .offset-gt-sm-20{margin-left:auto;margin-right:20%}.flex-offset-gt-sm-25,.offset-gt-sm-25{margin-left:25%}[dir=rtl] .flex-offset-gt-sm-25,[dir=rtl] .offset-gt-sm-25{margin-left:auto;margin-right:25%}.flex-offset-gt-sm-30,.offset-gt-sm-30{margin-left:30%}[dir=rtl] .flex-offset-gt-sm-30,[dir=rtl] .offset-gt-sm-30{margin-left:auto;margin-right:30%}.flex-offset-gt-sm-35,.offset-gt-sm-35{margin-left:35%}[dir=rtl] .flex-offset-gt-sm-35,[dir=rtl] .offset-gt-sm-35{margin-left:auto;margin-right:35%}.flex-offset-gt-sm-40,.offset-gt-sm-40{margin-left:40%}[dir=rtl] .flex-offset-gt-sm-40,[dir=rtl] .offset-gt-sm-40{margin-left:auto;margin-right:40%}.flex-offset-gt-sm-45,.offset-gt-sm-45{margin-left:45%}[dir=rtl] .flex-offset-gt-sm-45,[dir=rtl] .offset-gt-sm-45{margin-left:auto;margin-right:45%}.flex-offset-gt-sm-50,.offset-gt-sm-50{margin-left:50%}[dir=rtl] .flex-offset-gt-sm-50,[dir=rtl] .offset-gt-sm-50{margin-left:auto;margin-right:50%}.flex-offset-gt-sm-55,.offset-gt-sm-55{margin-left:55%}[dir=rtl] .flex-offset-gt-sm-55,[dir=rtl] .offset-gt-sm-55{margin-left:auto;margin-right:55%}.flex-offset-gt-sm-60,.offset-gt-sm-60{margin-left:60%}[dir=rtl] .flex-offset-gt-sm-60,[dir=rtl] .offset-gt-sm-60{margin-left:auto;margin-right:60%}.flex-offset-gt-sm-65,.offset-gt-sm-65{margin-left:65%}[dir=rtl] .flex-offset-gt-sm-65,[dir=rtl] .offset-gt-sm-65{margin-left:auto;margin-right:65%}.flex-offset-gt-sm-70,.offset-gt-sm-70{margin-left:70%}[dir=rtl] .flex-offset-gt-sm-70,[dir=rtl] .offset-gt-sm-70{margin-left:auto;margin-right:70%}.flex-offset-gt-sm-75,.offset-gt-sm-75{margin-left:75%}[dir=rtl] .flex-offset-gt-sm-75,[dir=rtl] .offset-gt-sm-75{margin-left:auto;margin-right:75%}.flex-offset-gt-sm-80,.offset-gt-sm-80{margin-left:80%}[dir=rtl] .flex-offset-gt-sm-80,[dir=rtl] .offset-gt-sm-80{margin-left:auto;margin-right:80%}.flex-offset-gt-sm-85,.offset-gt-sm-85{margin-left:85%}[dir=rtl] .flex-offset-gt-sm-85,[dir=rtl] .offset-gt-sm-85{margin-left:auto;margin-right:85%}.flex-offset-gt-sm-90,.offset-gt-sm-90{margin-left:90%}[dir=rtl] .flex-offset-gt-sm-90,[dir=rtl] .offset-gt-sm-90{margin-left:auto;margin-right:90%}.flex-offset-gt-sm-95,.offset-gt-sm-95{margin-left:95%}[dir=rtl] .flex-offset-gt-sm-95,[dir=rtl] .offset-gt-sm-95{margin-left:auto;margin-right:95%}.flex-offset-gt-sm-33,.offset-gt-sm-33{margin-left:calc(100% / 3)}.flex-offset-gt-sm-66,.offset-gt-sm-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-gt-sm-66,[dir=rtl] .offset-gt-sm-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-gt-sm,.layout-align-gt-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-sm-start,.layout-align-gt-sm-start-center,.layout-align-gt-sm-start-end,.layout-align-gt-sm-start-start,.layout-align-gt-sm-start-stretch{justify-content:flex-start}.layout-align-gt-sm-center,.layout-align-gt-sm-center-center,.layout-align-gt-sm-center-end,.layout-align-gt-sm-center-start,.layout-align-gt-sm-center-stretch{justify-content:center}.layout-align-gt-sm-end,.layout-align-gt-sm-end-center,.layout-align-gt-sm-end-end,.layout-align-gt-sm-end-start,.layout-align-gt-sm-end-stretch{justify-content:flex-end}.layout-align-gt-sm-space-around,.layout-align-gt-sm-space-around-center,.layout-align-gt-sm-space-around-end,.layout-align-gt-sm-space-around-start,.layout-align-gt-sm-space-around-stretch{justify-content:space-around}.layout-align-gt-sm-space-between,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-between-stretch{justify-content:space-between}.layout-align-gt-sm-center-start,.layout-align-gt-sm-end-start,.layout-align-gt-sm-space-around-start,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-start-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-sm-center-center,.layout-align-gt-sm-end-center,.layout-align-gt-sm-space-around-center,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-sm-center-center>*,.layout-align-gt-sm-end-center>*,.layout-align-gt-sm-space-around-center>*,.layout-align-gt-sm-space-between-center>*,.layout-align-gt-sm-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-sm-center-end,.layout-align-gt-sm-end-end,.layout-align-gt-sm-space-around-end,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-start-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-sm-center-stretch,.layout-align-gt-sm-end-stretch,.layout-align-gt-sm-space-around-stretch,.layout-align-gt-sm-space-between-stretch,.layout-align-gt-sm-start-stretch{align-items:stretch;align-content:stretch}.flex-gt-sm{flex:1;box-sizing:border-box}.flex-gt-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-sm-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-sm-column>.flex-gt-sm-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex{min-width:0}.layout-gt-sm-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-column>.flex{min-height:0}.layout-gt-sm,.layout-gt-sm-column,.layout-gt-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-sm-column{flex-direction:column}.layout-gt-sm-row{flex-direction:row}}@media (min-width:960px) and (max-width:1279px){.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show){display:none}.hide-md:not(.show-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-md--20{order:-20}.flex-order-md--19{order:-19}.flex-order-md--18{order:-18}.flex-order-md--17{order:-17}.flex-order-md--16{order:-16}.flex-order-md--15{order:-15}.flex-order-md--14{order:-14}.flex-order-md--13{order:-13}.flex-order-md--12{order:-12}.flex-order-md--11{order:-11}.flex-order-md--10{order:-10}.flex-order-md--9{order:-9}.flex-order-md--8{order:-8}.flex-order-md--7{order:-7}.flex-order-md--6{order:-6}.flex-order-md--5{order:-5}.flex-order-md--4{order:-4}.flex-order-md--3{order:-3}.flex-order-md--2{order:-2}.flex-order-md--1{order:-1}.flex-order-md-0{order:0}.flex-order-md-1{order:1}.flex-order-md-2{order:2}.flex-order-md-3{order:3}.flex-order-md-4{order:4}.flex-order-md-5{order:5}.flex-order-md-6{order:6}.flex-order-md-7{order:7}.flex-order-md-8{order:8}.flex-order-md-9{order:9}.flex-order-md-10{order:10}.flex-order-md-11{order:11}.flex-order-md-12{order:12}.flex-order-md-13{order:13}.flex-order-md-14{order:14}.flex-order-md-15{order:15}.flex-order-md-16{order:16}.flex-order-md-17{order:17}.flex-order-md-18{order:18}.flex-order-md-19{order:19}.flex-order-md-20{order:20}.flex-offset-md-0,.offset-md-0{margin-left:0}[dir=rtl] .flex-offset-md-0,[dir=rtl] .offset-md-0{margin-left:auto;margin-right:0}.flex-offset-md-5,.offset-md-5{margin-left:5%}[dir=rtl] .flex-offset-md-5,[dir=rtl] .offset-md-5{margin-left:auto;margin-right:5%}.flex-offset-md-10,.offset-md-10{margin-left:10%}[dir=rtl] .flex-offset-md-10,[dir=rtl] .offset-md-10{margin-left:auto;margin-right:10%}.flex-offset-md-15,.offset-md-15{margin-left:15%}[dir=rtl] .flex-offset-md-15,[dir=rtl] .offset-md-15{margin-left:auto;margin-right:15%}.flex-offset-md-20,.offset-md-20{margin-left:20%}[dir=rtl] .flex-offset-md-20,[dir=rtl] .offset-md-20{margin-left:auto;margin-right:20%}.flex-offset-md-25,.offset-md-25{margin-left:25%}[dir=rtl] .flex-offset-md-25,[dir=rtl] .offset-md-25{margin-left:auto;margin-right:25%}.flex-offset-md-30,.offset-md-30{margin-left:30%}[dir=rtl] .flex-offset-md-30,[dir=rtl] .offset-md-30{margin-left:auto;margin-right:30%}.flex-offset-md-35,.offset-md-35{margin-left:35%}[dir=rtl] .flex-offset-md-35,[dir=rtl] .offset-md-35{margin-left:auto;margin-right:35%}.flex-offset-md-40,.offset-md-40{margin-left:40%}[dir=rtl] .flex-offset-md-40,[dir=rtl] .offset-md-40{margin-left:auto;margin-right:40%}.flex-offset-md-45,.offset-md-45{margin-left:45%}[dir=rtl] .flex-offset-md-45,[dir=rtl] .offset-md-45{margin-left:auto;margin-right:45%}.flex-offset-md-50,.offset-md-50{margin-left:50%}[dir=rtl] .flex-offset-md-50,[dir=rtl] .offset-md-50{margin-left:auto;margin-right:50%}.flex-offset-md-55,.offset-md-55{margin-left:55%}[dir=rtl] .flex-offset-md-55,[dir=rtl] .offset-md-55{margin-left:auto;margin-right:55%}.flex-offset-md-60,.offset-md-60{margin-left:60%}[dir=rtl] .flex-offset-md-60,[dir=rtl] .offset-md-60{margin-left:auto;margin-right:60%}.flex-offset-md-65,.offset-md-65{margin-left:65%}[dir=rtl] .flex-offset-md-65,[dir=rtl] .offset-md-65{margin-left:auto;margin-right:65%}.flex-offset-md-70,.offset-md-70{margin-left:70%}[dir=rtl] .flex-offset-md-70,[dir=rtl] .offset-md-70{margin-left:auto;margin-right:70%}.flex-offset-md-75,.offset-md-75{margin-left:75%}[dir=rtl] .flex-offset-md-75,[dir=rtl] .offset-md-75{margin-left:auto;margin-right:75%}.flex-offset-md-80,.offset-md-80{margin-left:80%}[dir=rtl] .flex-offset-md-80,[dir=rtl] .offset-md-80{margin-left:auto;margin-right:80%}.flex-offset-md-85,.offset-md-85{margin-left:85%}[dir=rtl] .flex-offset-md-85,[dir=rtl] .offset-md-85{margin-left:auto;margin-right:85%}.flex-offset-md-90,.offset-md-90{margin-left:90%}[dir=rtl] .flex-offset-md-90,[dir=rtl] .offset-md-90{margin-left:auto;margin-right:90%}.flex-offset-md-95,.offset-md-95{margin-left:95%}[dir=rtl] .flex-offset-md-95,[dir=rtl] .offset-md-95{margin-left:auto;margin-right:95%}.flex-offset-md-33,.offset-md-33{margin-left:calc(100% / 3)}.flex-offset-md-66,.offset-md-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-md-66,[dir=rtl] .offset-md-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-md,.layout-align-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-md-start,.layout-align-md-start-center,.layout-align-md-start-end,.layout-align-md-start-start,.layout-align-md-start-stretch{justify-content:flex-start}.layout-align-md-center,.layout-align-md-center-center,.layout-align-md-center-end,.layout-align-md-center-start,.layout-align-md-center-stretch{justify-content:center}.layout-align-md-end,.layout-align-md-end-center,.layout-align-md-end-end,.layout-align-md-end-start,.layout-align-md-end-stretch{justify-content:flex-end}.layout-align-md-space-around,.layout-align-md-space-around-center,.layout-align-md-space-around-end,.layout-align-md-space-around-start,.layout-align-md-space-around-stretch{justify-content:space-around}.layout-align-md-space-between,.layout-align-md-space-between-center,.layout-align-md-space-between-end,.layout-align-md-space-between-start,.layout-align-md-space-between-stretch{justify-content:space-between}.layout-align-md-center-start,.layout-align-md-end-start,.layout-align-md-space-around-start,.layout-align-md-space-between-start,.layout-align-md-start-start{align-items:flex-start;align-content:flex-start}.layout-align-md-center-center,.layout-align-md-end-center,.layout-align-md-space-around-center,.layout-align-md-space-between-center,.layout-align-md-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-md-center-center>*,.layout-align-md-end-center>*,.layout-align-md-space-around-center>*,.layout-align-md-space-between-center>*,.layout-align-md-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-md-center-end,.layout-align-md-end-end,.layout-align-md-space-around-end,.layout-align-md-space-between-end,.layout-align-md-start-end{align-items:flex-end;align-content:flex-end}.layout-align-md-center-stretch,.layout-align-md-end-stretch,.layout-align-md-space-around-stretch,.layout-align-md-space-between-stretch,.layout-align-md-start-stretch{align-items:stretch;align-content:stretch}.flex-md{flex:1;box-sizing:border-box}.flex-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-md-none{flex:0 0 auto;box-sizing:border-box}.flex-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-md-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-md-column>.flex-md-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex{min-width:0}.layout-md-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-md-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-column>.flex{min-height:0}.layout-md,.layout-md-column,.layout-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-md-column{flex-direction:column}.layout-md-row{flex-direction:row}}@media (min-width:1280px){.flex-order-gt-md--20{order:-20}.flex-order-gt-md--19{order:-19}.flex-order-gt-md--18{order:-18}.flex-order-gt-md--17{order:-17}.flex-order-gt-md--16{order:-16}.flex-order-gt-md--15{order:-15}.flex-order-gt-md--14{order:-14}.flex-order-gt-md--13{order:-13}.flex-order-gt-md--12{order:-12}.flex-order-gt-md--11{order:-11}.flex-order-gt-md--10{order:-10}.flex-order-gt-md--9{order:-9}.flex-order-gt-md--8{order:-8}.flex-order-gt-md--7{order:-7}.flex-order-gt-md--6{order:-6}.flex-order-gt-md--5{order:-5}.flex-order-gt-md--4{order:-4}.flex-order-gt-md--3{order:-3}.flex-order-gt-md--2{order:-2}.flex-order-gt-md--1{order:-1}.flex-order-gt-md-0{order:0}.flex-order-gt-md-1{order:1}.flex-order-gt-md-2{order:2}.flex-order-gt-md-3{order:3}.flex-order-gt-md-4{order:4}.flex-order-gt-md-5{order:5}.flex-order-gt-md-6{order:6}.flex-order-gt-md-7{order:7}.flex-order-gt-md-8{order:8}.flex-order-gt-md-9{order:9}.flex-order-gt-md-10{order:10}.flex-order-gt-md-11{order:11}.flex-order-gt-md-12{order:12}.flex-order-gt-md-13{order:13}.flex-order-gt-md-14{order:14}.flex-order-gt-md-15{order:15}.flex-order-gt-md-16{order:16}.flex-order-gt-md-17{order:17}.flex-order-gt-md-18{order:18}.flex-order-gt-md-19{order:19}.flex-order-gt-md-20{order:20}.flex-offset-gt-md-0,.offset-gt-md-0{margin-left:0}[dir=rtl] .flex-offset-gt-md-0,[dir=rtl] .offset-gt-md-0{margin-left:auto;margin-right:0}.flex-offset-gt-md-5,.offset-gt-md-5{margin-left:5%}[dir=rtl] .flex-offset-gt-md-5,[dir=rtl] .offset-gt-md-5{margin-left:auto;margin-right:5%}.flex-offset-gt-md-10,.offset-gt-md-10{margin-left:10%}[dir=rtl] .flex-offset-gt-md-10,[dir=rtl] .offset-gt-md-10{margin-left:auto;margin-right:10%}.flex-offset-gt-md-15,.offset-gt-md-15{margin-left:15%}[dir=rtl] .flex-offset-gt-md-15,[dir=rtl] .offset-gt-md-15{margin-left:auto;margin-right:15%}.flex-offset-gt-md-20,.offset-gt-md-20{margin-left:20%}[dir=rtl] .flex-offset-gt-md-20,[dir=rtl] .offset-gt-md-20{margin-left:auto;margin-right:20%}.flex-offset-gt-md-25,.offset-gt-md-25{margin-left:25%}[dir=rtl] .flex-offset-gt-md-25,[dir=rtl] .offset-gt-md-25{margin-left:auto;margin-right:25%}.flex-offset-gt-md-30,.offset-gt-md-30{margin-left:30%}[dir=rtl] .flex-offset-gt-md-30,[dir=rtl] .offset-gt-md-30{margin-left:auto;margin-right:30%}.flex-offset-gt-md-35,.offset-gt-md-35{margin-left:35%}[dir=rtl] .flex-offset-gt-md-35,[dir=rtl] .offset-gt-md-35{margin-left:auto;margin-right:35%}.flex-offset-gt-md-40,.offset-gt-md-40{margin-left:40%}[dir=rtl] .flex-offset-gt-md-40,[dir=rtl] .offset-gt-md-40{margin-left:auto;margin-right:40%}.flex-offset-gt-md-45,.offset-gt-md-45{margin-left:45%}[dir=rtl] .flex-offset-gt-md-45,[dir=rtl] .offset-gt-md-45{margin-left:auto;margin-right:45%}.flex-offset-gt-md-50,.offset-gt-md-50{margin-left:50%}[dir=rtl] .flex-offset-gt-md-50,[dir=rtl] .offset-gt-md-50{margin-left:auto;margin-right:50%}.flex-offset-gt-md-55,.offset-gt-md-55{margin-left:55%}[dir=rtl] .flex-offset-gt-md-55,[dir=rtl] .offset-gt-md-55{margin-left:auto;margin-right:55%}.flex-offset-gt-md-60,.offset-gt-md-60{margin-left:60%}[dir=rtl] .flex-offset-gt-md-60,[dir=rtl] .offset-gt-md-60{margin-left:auto;margin-right:60%}.flex-offset-gt-md-65,.offset-gt-md-65{margin-left:65%}[dir=rtl] .flex-offset-gt-md-65,[dir=rtl] .offset-gt-md-65{margin-left:auto;margin-right:65%}.flex-offset-gt-md-70,.offset-gt-md-70{margin-left:70%}[dir=rtl] .flex-offset-gt-md-70,[dir=rtl] .offset-gt-md-70{margin-left:auto;margin-right:70%}.flex-offset-gt-md-75,.offset-gt-md-75{margin-left:75%}[dir=rtl] .flex-offset-gt-md-75,[dir=rtl] .offset-gt-md-75{margin-left:auto;margin-right:75%}.flex-offset-gt-md-80,.offset-gt-md-80{margin-left:80%}[dir=rtl] .flex-offset-gt-md-80,[dir=rtl] .offset-gt-md-80{margin-left:auto;margin-right:80%}.flex-offset-gt-md-85,.offset-gt-md-85{margin-left:85%}[dir=rtl] .flex-offset-gt-md-85,[dir=rtl] .offset-gt-md-85{margin-left:auto;margin-right:85%}.flex-offset-gt-md-90,.offset-gt-md-90{margin-left:90%}[dir=rtl] .flex-offset-gt-md-90,[dir=rtl] .offset-gt-md-90{margin-left:auto;margin-right:90%}.flex-offset-gt-md-95,.offset-gt-md-95{margin-left:95%}[dir=rtl] .flex-offset-gt-md-95,[dir=rtl] .offset-gt-md-95{margin-left:auto;margin-right:95%}.flex-offset-gt-md-33,.offset-gt-md-33{margin-left:calc(100% / 3)}.flex-offset-gt-md-66,.offset-gt-md-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-gt-md-66,[dir=rtl] .offset-gt-md-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-gt-md,.layout-align-gt-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-md-start,.layout-align-gt-md-start-center,.layout-align-gt-md-start-end,.layout-align-gt-md-start-start,.layout-align-gt-md-start-stretch{justify-content:flex-start}.layout-align-gt-md-center,.layout-align-gt-md-center-center,.layout-align-gt-md-center-end,.layout-align-gt-md-center-start,.layout-align-gt-md-center-stretch{justify-content:center}.layout-align-gt-md-end,.layout-align-gt-md-end-center,.layout-align-gt-md-end-end,.layout-align-gt-md-end-start,.layout-align-gt-md-end-stretch{justify-content:flex-end}.layout-align-gt-md-space-around,.layout-align-gt-md-space-around-center,.layout-align-gt-md-space-around-end,.layout-align-gt-md-space-around-start,.layout-align-gt-md-space-around-stretch{justify-content:space-around}.layout-align-gt-md-space-between,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-between-stretch{justify-content:space-between}.layout-align-gt-md-center-start,.layout-align-gt-md-end-start,.layout-align-gt-md-space-around-start,.layout-align-gt-md-space-between-start,.layout-align-gt-md-start-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-md-center-center,.layout-align-gt-md-end-center,.layout-align-gt-md-space-around-center,.layout-align-gt-md-space-between-center,.layout-align-gt-md-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-md-center-center>*,.layout-align-gt-md-end-center>*,.layout-align-gt-md-space-around-center>*,.layout-align-gt-md-space-between-center>*,.layout-align-gt-md-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-md-center-end,.layout-align-gt-md-end-end,.layout-align-gt-md-space-around-end,.layout-align-gt-md-space-between-end,.layout-align-gt-md-start-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-md-center-stretch,.layout-align-gt-md-end-stretch,.layout-align-gt-md-space-around-stretch,.layout-align-gt-md-space-between-stretch,.layout-align-gt-md-start-stretch{align-items:stretch;align-content:stretch}.flex-gt-md{flex:1;box-sizing:border-box}.flex-gt-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-md-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-md-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-md-column>.flex-gt-md-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex{min-width:0}.layout-gt-md-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-column>.flex{min-height:0}.layout-gt-md,.layout-gt-md-column,.layout-gt-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-md-column{flex-direction:column}.layout-gt-md-row{flex-direction:row}}@media (min-width:1280px) and (max-width:1919px){.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show){display:none}.hide-lg:not(.show-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-lg--20{order:-20}.flex-order-lg--19{order:-19}.flex-order-lg--18{order:-18}.flex-order-lg--17{order:-17}.flex-order-lg--16{order:-16}.flex-order-lg--15{order:-15}.flex-order-lg--14{order:-14}.flex-order-lg--13{order:-13}.flex-order-lg--12{order:-12}.flex-order-lg--11{order:-11}.flex-order-lg--10{order:-10}.flex-order-lg--9{order:-9}.flex-order-lg--8{order:-8}.flex-order-lg--7{order:-7}.flex-order-lg--6{order:-6}.flex-order-lg--5{order:-5}.flex-order-lg--4{order:-4}.flex-order-lg--3{order:-3}.flex-order-lg--2{order:-2}.flex-order-lg--1{order:-1}.flex-order-lg-0{order:0}.flex-order-lg-1{order:1}.flex-order-lg-2{order:2}.flex-order-lg-3{order:3}.flex-order-lg-4{order:4}.flex-order-lg-5{order:5}.flex-order-lg-6{order:6}.flex-order-lg-7{order:7}.flex-order-lg-8{order:8}.flex-order-lg-9{order:9}.flex-order-lg-10{order:10}.flex-order-lg-11{order:11}.flex-order-lg-12{order:12}.flex-order-lg-13{order:13}.flex-order-lg-14{order:14}.flex-order-lg-15{order:15}.flex-order-lg-16{order:16}.flex-order-lg-17{order:17}.flex-order-lg-18{order:18}.flex-order-lg-19{order:19}.flex-order-lg-20{order:20}.flex-offset-lg-0,.offset-lg-0{margin-left:0}[dir=rtl] .flex-offset-lg-0,[dir=rtl] .offset-lg-0{margin-left:auto;margin-right:0}.flex-offset-lg-5,.offset-lg-5{margin-left:5%}[dir=rtl] .flex-offset-lg-5,[dir=rtl] .offset-lg-5{margin-left:auto;margin-right:5%}.flex-offset-lg-10,.offset-lg-10{margin-left:10%}[dir=rtl] .flex-offset-lg-10,[dir=rtl] .offset-lg-10{margin-left:auto;margin-right:10%}.flex-offset-lg-15,.offset-lg-15{margin-left:15%}[dir=rtl] .flex-offset-lg-15,[dir=rtl] .offset-lg-15{margin-left:auto;margin-right:15%}.flex-offset-lg-20,.offset-lg-20{margin-left:20%}[dir=rtl] .flex-offset-lg-20,[dir=rtl] .offset-lg-20{margin-left:auto;margin-right:20%}.flex-offset-lg-25,.offset-lg-25{margin-left:25%}[dir=rtl] .flex-offset-lg-25,[dir=rtl] .offset-lg-25{margin-left:auto;margin-right:25%}.flex-offset-lg-30,.offset-lg-30{margin-left:30%}[dir=rtl] .flex-offset-lg-30,[dir=rtl] .offset-lg-30{margin-left:auto;margin-right:30%}.flex-offset-lg-35,.offset-lg-35{margin-left:35%}[dir=rtl] .flex-offset-lg-35,[dir=rtl] .offset-lg-35{margin-left:auto;margin-right:35%}.flex-offset-lg-40,.offset-lg-40{margin-left:40%}[dir=rtl] .flex-offset-lg-40,[dir=rtl] .offset-lg-40{margin-left:auto;margin-right:40%}.flex-offset-lg-45,.offset-lg-45{margin-left:45%}[dir=rtl] .flex-offset-lg-45,[dir=rtl] .offset-lg-45{margin-left:auto;margin-right:45%}.flex-offset-lg-50,.offset-lg-50{margin-left:50%}[dir=rtl] .flex-offset-lg-50,[dir=rtl] .offset-lg-50{margin-left:auto;margin-right:50%}.flex-offset-lg-55,.offset-lg-55{margin-left:55%}[dir=rtl] .flex-offset-lg-55,[dir=rtl] .offset-lg-55{margin-left:auto;margin-right:55%}.flex-offset-lg-60,.offset-lg-60{margin-left:60%}[dir=rtl] .flex-offset-lg-60,[dir=rtl] .offset-lg-60{margin-left:auto;margin-right:60%}.flex-offset-lg-65,.offset-lg-65{margin-left:65%}[dir=rtl] .flex-offset-lg-65,[dir=rtl] .offset-lg-65{margin-left:auto;margin-right:65%}.flex-offset-lg-70,.offset-lg-70{margin-left:70%}[dir=rtl] .flex-offset-lg-70,[dir=rtl] .offset-lg-70{margin-left:auto;margin-right:70%}.flex-offset-lg-75,.offset-lg-75{margin-left:75%}[dir=rtl] .flex-offset-lg-75,[dir=rtl] .offset-lg-75{margin-left:auto;margin-right:75%}.flex-offset-lg-80,.offset-lg-80{margin-left:80%}[dir=rtl] .flex-offset-lg-80,[dir=rtl] .offset-lg-80{margin-left:auto;margin-right:80%}.flex-offset-lg-85,.offset-lg-85{margin-left:85%}[dir=rtl] .flex-offset-lg-85,[dir=rtl] .offset-lg-85{margin-left:auto;margin-right:85%}.flex-offset-lg-90,.offset-lg-90{margin-left:90%}[dir=rtl] .flex-offset-lg-90,[dir=rtl] .offset-lg-90{margin-left:auto;margin-right:90%}.flex-offset-lg-95,.offset-lg-95{margin-left:95%}[dir=rtl] .flex-offset-lg-95,[dir=rtl] .offset-lg-95{margin-left:auto;margin-right:95%}.flex-offset-lg-33,.offset-lg-33{margin-left:calc(100% / 3)}.flex-offset-lg-66,.offset-lg-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-lg-66,[dir=rtl] .offset-lg-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-lg,.layout-align-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-lg-start,.layout-align-lg-start-center,.layout-align-lg-start-end,.layout-align-lg-start-start,.layout-align-lg-start-stretch{justify-content:flex-start}.layout-align-lg-center,.layout-align-lg-center-center,.layout-align-lg-center-end,.layout-align-lg-center-start,.layout-align-lg-center-stretch{justify-content:center}.layout-align-lg-end,.layout-align-lg-end-center,.layout-align-lg-end-end,.layout-align-lg-end-start,.layout-align-lg-end-stretch{justify-content:flex-end}.layout-align-lg-space-around,.layout-align-lg-space-around-center,.layout-align-lg-space-around-end,.layout-align-lg-space-around-start,.layout-align-lg-space-around-stretch{justify-content:space-around}.layout-align-lg-space-between,.layout-align-lg-space-between-center,.layout-align-lg-space-between-end,.layout-align-lg-space-between-start,.layout-align-lg-space-between-stretch{justify-content:space-between}.layout-align-lg-center-start,.layout-align-lg-end-start,.layout-align-lg-space-around-start,.layout-align-lg-space-between-start,.layout-align-lg-start-start{align-items:flex-start;align-content:flex-start}.layout-align-lg-center-center,.layout-align-lg-end-center,.layout-align-lg-space-around-center,.layout-align-lg-space-between-center,.layout-align-lg-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-lg-center-center>*,.layout-align-lg-end-center>*,.layout-align-lg-space-around-center>*,.layout-align-lg-space-between-center>*,.layout-align-lg-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-lg-center-end,.layout-align-lg-end-end,.layout-align-lg-space-around-end,.layout-align-lg-space-between-end,.layout-align-lg-start-end{align-items:flex-end;align-content:flex-end}.layout-align-lg-center-stretch,.layout-align-lg-end-stretch,.layout-align-lg-space-around-stretch,.layout-align-lg-space-between-stretch,.layout-align-lg-start-stretch{align-items:stretch;align-content:stretch}.flex-lg{flex:1;box-sizing:border-box}.flex-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-lg-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-lg-column>.flex-lg-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex{min-width:0}.layout-lg-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-lg-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-column>.flex{min-height:0}.layout-lg,.layout-lg-column,.layout-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-lg-column{flex-direction:column}.layout-lg-row{flex-direction:row}}@media (min-width:1920px){.flex-order-gt-lg--20{order:-20}.flex-order-gt-lg--19{order:-19}.flex-order-gt-lg--18{order:-18}.flex-order-gt-lg--17{order:-17}.flex-order-gt-lg--16{order:-16}.flex-order-gt-lg--15{order:-15}.flex-order-gt-lg--14{order:-14}.flex-order-gt-lg--13{order:-13}.flex-order-gt-lg--12{order:-12}.flex-order-gt-lg--11{order:-11}.flex-order-gt-lg--10{order:-10}.flex-order-gt-lg--9{order:-9}.flex-order-gt-lg--8{order:-8}.flex-order-gt-lg--7{order:-7}.flex-order-gt-lg--6{order:-6}.flex-order-gt-lg--5{order:-5}.flex-order-gt-lg--4{order:-4}.flex-order-gt-lg--3{order:-3}.flex-order-gt-lg--2{order:-2}.flex-order-gt-lg--1{order:-1}.flex-order-gt-lg-0{order:0}.flex-order-gt-lg-1{order:1}.flex-order-gt-lg-2{order:2}.flex-order-gt-lg-3{order:3}.flex-order-gt-lg-4{order:4}.flex-order-gt-lg-5{order:5}.flex-order-gt-lg-6{order:6}.flex-order-gt-lg-7{order:7}.flex-order-gt-lg-8{order:8}.flex-order-gt-lg-9{order:9}.flex-order-gt-lg-10{order:10}.flex-order-gt-lg-11{order:11}.flex-order-gt-lg-12{order:12}.flex-order-gt-lg-13{order:13}.flex-order-gt-lg-14{order:14}.flex-order-gt-lg-15{order:15}.flex-order-gt-lg-16{order:16}.flex-order-gt-lg-17{order:17}.flex-order-gt-lg-18{order:18}.flex-order-gt-lg-19{order:19}.flex-order-gt-lg-20{order:20}.flex-offset-gt-lg-0,.offset-gt-lg-0{margin-left:0}[dir=rtl] .flex-offset-gt-lg-0,[dir=rtl] .offset-gt-lg-0{margin-left:auto;margin-right:0}.flex-offset-gt-lg-5,.offset-gt-lg-5{margin-left:5%}[dir=rtl] .flex-offset-gt-lg-5,[dir=rtl] .offset-gt-lg-5{margin-left:auto;margin-right:5%}.flex-offset-gt-lg-10,.offset-gt-lg-10{margin-left:10%}[dir=rtl] .flex-offset-gt-lg-10,[dir=rtl] .offset-gt-lg-10{margin-left:auto;margin-right:10%}.flex-offset-gt-lg-15,.offset-gt-lg-15{margin-left:15%}[dir=rtl] .flex-offset-gt-lg-15,[dir=rtl] .offset-gt-lg-15{margin-left:auto;margin-right:15%}.flex-offset-gt-lg-20,.offset-gt-lg-20{margin-left:20%}[dir=rtl] .flex-offset-gt-lg-20,[dir=rtl] .offset-gt-lg-20{margin-left:auto;margin-right:20%}.flex-offset-gt-lg-25,.offset-gt-lg-25{margin-left:25%}[dir=rtl] .flex-offset-gt-lg-25,[dir=rtl] .offset-gt-lg-25{margin-left:auto;margin-right:25%}.flex-offset-gt-lg-30,.offset-gt-lg-30{margin-left:30%}[dir=rtl] .flex-offset-gt-lg-30,[dir=rtl] .offset-gt-lg-30{margin-left:auto;margin-right:30%}.flex-offset-gt-lg-35,.offset-gt-lg-35{margin-left:35%}[dir=rtl] .flex-offset-gt-lg-35,[dir=rtl] .offset-gt-lg-35{margin-left:auto;margin-right:35%}.flex-offset-gt-lg-40,.offset-gt-lg-40{margin-left:40%}[dir=rtl] .flex-offset-gt-lg-40,[dir=rtl] .offset-gt-lg-40{margin-left:auto;margin-right:40%}.flex-offset-gt-lg-45,.offset-gt-lg-45{margin-left:45%}[dir=rtl] .flex-offset-gt-lg-45,[dir=rtl] .offset-gt-lg-45{margin-left:auto;margin-right:45%}.flex-offset-gt-lg-50,.offset-gt-lg-50{margin-left:50%}[dir=rtl] .flex-offset-gt-lg-50,[dir=rtl] .offset-gt-lg-50{margin-left:auto;margin-right:50%}.flex-offset-gt-lg-55,.offset-gt-lg-55{margin-left:55%}[dir=rtl] .flex-offset-gt-lg-55,[dir=rtl] .offset-gt-lg-55{margin-left:auto;margin-right:55%}.flex-offset-gt-lg-60,.offset-gt-lg-60{margin-left:60%}[dir=rtl] .flex-offset-gt-lg-60,[dir=rtl] .offset-gt-lg-60{margin-left:auto;margin-right:60%}.flex-offset-gt-lg-65,.offset-gt-lg-65{margin-left:65%}[dir=rtl] .flex-offset-gt-lg-65,[dir=rtl] .offset-gt-lg-65{margin-left:auto;margin-right:65%}.flex-offset-gt-lg-70,.offset-gt-lg-70{margin-left:70%}[dir=rtl] .flex-offset-gt-lg-70,[dir=rtl] .offset-gt-lg-70{margin-left:auto;margin-right:70%}.flex-offset-gt-lg-75,.offset-gt-lg-75{margin-left:75%}[dir=rtl] .flex-offset-gt-lg-75,[dir=rtl] .offset-gt-lg-75{margin-left:auto;margin-right:75%}.flex-offset-gt-lg-80,.offset-gt-lg-80{margin-left:80%}[dir=rtl] .flex-offset-gt-lg-80,[dir=rtl] .offset-gt-lg-80{margin-left:auto;margin-right:80%}.flex-offset-gt-lg-85,.offset-gt-lg-85{margin-left:85%}[dir=rtl] .flex-offset-gt-lg-85,[dir=rtl] .offset-gt-lg-85{margin-left:auto;margin-right:85%}.flex-offset-gt-lg-90,.offset-gt-lg-90{margin-left:90%}[dir=rtl] .flex-offset-gt-lg-90,[dir=rtl] .offset-gt-lg-90{margin-left:auto;margin-right:90%}.flex-offset-gt-lg-95,.offset-gt-lg-95{margin-left:95%}[dir=rtl] .flex-offset-gt-lg-95,[dir=rtl] .offset-gt-lg-95{margin-left:auto;margin-right:95%}.flex-offset-gt-lg-33,.offset-gt-lg-33{margin-left:calc(100% / 3)}.flex-offset-gt-lg-66,.offset-gt-lg-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-gt-lg-66,[dir=rtl] .offset-gt-lg-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-gt-lg,.layout-align-gt-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-lg-start,.layout-align-gt-lg-start-center,.layout-align-gt-lg-start-end,.layout-align-gt-lg-start-start,.layout-align-gt-lg-start-stretch{justify-content:flex-start}.layout-align-gt-lg-center,.layout-align-gt-lg-center-center,.layout-align-gt-lg-center-end,.layout-align-gt-lg-center-start,.layout-align-gt-lg-center-stretch{justify-content:center}.layout-align-gt-lg-end,.layout-align-gt-lg-end-center,.layout-align-gt-lg-end-end,.layout-align-gt-lg-end-start,.layout-align-gt-lg-end-stretch{justify-content:flex-end}.layout-align-gt-lg-space-around,.layout-align-gt-lg-space-around-center,.layout-align-gt-lg-space-around-end,.layout-align-gt-lg-space-around-start,.layout-align-gt-lg-space-around-stretch{justify-content:space-around}.layout-align-gt-lg-space-between,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-between-stretch{justify-content:space-between}.layout-align-gt-lg-center-start,.layout-align-gt-lg-end-start,.layout-align-gt-lg-space-around-start,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-start-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-lg-center-center,.layout-align-gt-lg-end-center,.layout-align-gt-lg-space-around-center,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-lg-center-center>*,.layout-align-gt-lg-end-center>*,.layout-align-gt-lg-space-around-center>*,.layout-align-gt-lg-space-between-center>*,.layout-align-gt-lg-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-lg-center-end,.layout-align-gt-lg-end-end,.layout-align-gt-lg-space-around-end,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-start-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-lg-center-stretch,.layout-align-gt-lg-end-stretch,.layout-align-gt-lg-space-around-stretch,.layout-align-gt-lg-space-between-stretch,.layout-align-gt-lg-start-stretch{align-items:stretch;align-content:stretch}.flex-gt-lg{flex:1;box-sizing:border-box}.flex-gt-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-lg-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-lg-column>.flex-gt-lg-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex{min-width:0}.layout-gt-lg-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-column>.flex{min-height:0}.layout-gt-lg,.layout-gt-lg-column,.layout-gt-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-lg-column{flex-direction:column}.layout-gt-lg-row{flex-direction:row}.flex-order-xl--20{order:-20}.flex-order-xl--19{order:-19}.flex-order-xl--18{order:-18}.flex-order-xl--17{order:-17}.flex-order-xl--16{order:-16}.flex-order-xl--15{order:-15}.flex-order-xl--14{order:-14}.flex-order-xl--13{order:-13}.flex-order-xl--12{order:-12}.flex-order-xl--11{order:-11}.flex-order-xl--10{order:-10}.flex-order-xl--9{order:-9}.flex-order-xl--8{order:-8}.flex-order-xl--7{order:-7}.flex-order-xl--6{order:-6}.flex-order-xl--5{order:-5}.flex-order-xl--4{order:-4}.flex-order-xl--3{order:-3}.flex-order-xl--2{order:-2}.flex-order-xl--1{order:-1}.flex-order-xl-0{order:0}.flex-order-xl-1{order:1}.flex-order-xl-2{order:2}.flex-order-xl-3{order:3}.flex-order-xl-4{order:4}.flex-order-xl-5{order:5}.flex-order-xl-6{order:6}.flex-order-xl-7{order:7}.flex-order-xl-8{order:8}.flex-order-xl-9{order:9}.flex-order-xl-10{order:10}.flex-order-xl-11{order:11}.flex-order-xl-12{order:12}.flex-order-xl-13{order:13}.flex-order-xl-14{order:14}.flex-order-xl-15{order:15}.flex-order-xl-16{order:16}.flex-order-xl-17{order:17}.flex-order-xl-18{order:18}.flex-order-xl-19{order:19}.flex-order-xl-20{order:20}.flex-offset-xl-0,.offset-xl-0{margin-left:0}[dir=rtl] .flex-offset-xl-0,[dir=rtl] .offset-xl-0{margin-left:auto;margin-right:0}.flex-offset-xl-5,.offset-xl-5{margin-left:5%}[dir=rtl] .flex-offset-xl-5,[dir=rtl] .offset-xl-5{margin-left:auto;margin-right:5%}.flex-offset-xl-10,.offset-xl-10{margin-left:10%}[dir=rtl] .flex-offset-xl-10,[dir=rtl] .offset-xl-10{margin-left:auto;margin-right:10%}.flex-offset-xl-15,.offset-xl-15{margin-left:15%}[dir=rtl] .flex-offset-xl-15,[dir=rtl] .offset-xl-15{margin-left:auto;margin-right:15%}.flex-offset-xl-20,.offset-xl-20{margin-left:20%}[dir=rtl] .flex-offset-xl-20,[dir=rtl] .offset-xl-20{margin-left:auto;margin-right:20%}.flex-offset-xl-25,.offset-xl-25{margin-left:25%}[dir=rtl] .flex-offset-xl-25,[dir=rtl] .offset-xl-25{margin-left:auto;margin-right:25%}.flex-offset-xl-30,.offset-xl-30{margin-left:30%}[dir=rtl] .flex-offset-xl-30,[dir=rtl] .offset-xl-30{margin-left:auto;margin-right:30%}.flex-offset-xl-35,.offset-xl-35{margin-left:35%}[dir=rtl] .flex-offset-xl-35,[dir=rtl] .offset-xl-35{margin-left:auto;margin-right:35%}.flex-offset-xl-40,.offset-xl-40{margin-left:40%}[dir=rtl] .flex-offset-xl-40,[dir=rtl] .offset-xl-40{margin-left:auto;margin-right:40%}.flex-offset-xl-45,.offset-xl-45{margin-left:45%}[dir=rtl] .flex-offset-xl-45,[dir=rtl] .offset-xl-45{margin-left:auto;margin-right:45%}.flex-offset-xl-50,.offset-xl-50{margin-left:50%}[dir=rtl] .flex-offset-xl-50,[dir=rtl] .offset-xl-50{margin-left:auto;margin-right:50%}.flex-offset-xl-55,.offset-xl-55{margin-left:55%}[dir=rtl] .flex-offset-xl-55,[dir=rtl] .offset-xl-55{margin-left:auto;margin-right:55%}.flex-offset-xl-60,.offset-xl-60{margin-left:60%}[dir=rtl] .flex-offset-xl-60,[dir=rtl] .offset-xl-60{margin-left:auto;margin-right:60%}.flex-offset-xl-65,.offset-xl-65{margin-left:65%}[dir=rtl] .flex-offset-xl-65,[dir=rtl] .offset-xl-65{margin-left:auto;margin-right:65%}.flex-offset-xl-70,.offset-xl-70{margin-left:70%}[dir=rtl] .flex-offset-xl-70,[dir=rtl] .offset-xl-70{margin-left:auto;margin-right:70%}.flex-offset-xl-75,.offset-xl-75{margin-left:75%}[dir=rtl] .flex-offset-xl-75,[dir=rtl] .offset-xl-75{margin-left:auto;margin-right:75%}.flex-offset-xl-80,.offset-xl-80{margin-left:80%}[dir=rtl] .flex-offset-xl-80,[dir=rtl] .offset-xl-80{margin-left:auto;margin-right:80%}.flex-offset-xl-85,.offset-xl-85{margin-left:85%}[dir=rtl] .flex-offset-xl-85,[dir=rtl] .offset-xl-85{margin-left:auto;margin-right:85%}.flex-offset-xl-90,.offset-xl-90{margin-left:90%}[dir=rtl] .flex-offset-xl-90,[dir=rtl] .offset-xl-90{margin-left:auto;margin-right:90%}.flex-offset-xl-95,.offset-xl-95{margin-left:95%}[dir=rtl] .flex-offset-xl-95,[dir=rtl] .offset-xl-95{margin-left:auto;margin-right:95%}.flex-offset-xl-33,.offset-xl-33{margin-left:calc(100% / 3)}.flex-offset-xl-66,.offset-xl-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-xl-66,[dir=rtl] .offset-xl-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-xl,.layout-align-xl-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xl-start,.layout-align-xl-start-center,.layout-align-xl-start-end,.layout-align-xl-start-start,.layout-align-xl-start-stretch{justify-content:flex-start}.layout-align-xl-center,.layout-align-xl-center-center,.layout-align-xl-center-end,.layout-align-xl-center-start,.layout-align-xl-center-stretch{justify-content:center}.layout-align-xl-end,.layout-align-xl-end-center,.layout-align-xl-end-end,.layout-align-xl-end-start,.layout-align-xl-end-stretch{justify-content:flex-end}.layout-align-xl-space-around,.layout-align-xl-space-around-center,.layout-align-xl-space-around-end,.layout-align-xl-space-around-start,.layout-align-xl-space-around-stretch{justify-content:space-around}.layout-align-xl-space-between,.layout-align-xl-space-between-center,.layout-align-xl-space-between-end,.layout-align-xl-space-between-start,.layout-align-xl-space-between-stretch{justify-content:space-between}.layout-align-xl-center-start,.layout-align-xl-end-start,.layout-align-xl-space-around-start,.layout-align-xl-space-between-start,.layout-align-xl-start-start{align-items:flex-start;align-content:flex-start}.layout-align-xl-center-center,.layout-align-xl-end-center,.layout-align-xl-space-around-center,.layout-align-xl-space-between-center,.layout-align-xl-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-xl-center-center>*,.layout-align-xl-end-center>*,.layout-align-xl-space-around-center>*,.layout-align-xl-space-between-center>*,.layout-align-xl-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-xl-center-end,.layout-align-xl-end-end,.layout-align-xl-space-around-end,.layout-align-xl-space-between-end,.layout-align-xl-start-end{align-items:flex-end;align-content:flex-end}.layout-align-xl-center-stretch,.layout-align-xl-end-stretch,.layout-align-xl-space-around-stretch,.layout-align-xl-space-between-stretch,.layout-align-xl-start-stretch{align-items:stretch;align-content:stretch}.flex-xl{flex:1;box-sizing:border-box}.flex-xl-grow{flex:1 1 100%;box-sizing:border-box}.flex-xl-initial{flex:0 1 auto;box-sizing:border-box}.flex-xl-auto{flex:1 1 auto;box-sizing:border-box}.flex-xl-none{flex:0 0 auto;box-sizing:border-box}.flex-xl-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xl-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xl-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xl-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xl-column>.flex-xl-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xl-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xl-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xl-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xl-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xl-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xl-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xl-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xl-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xl-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xl-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xl-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xl-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xl-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xl-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xl-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xl-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xl-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xl-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xl-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex{min-width:0}.layout-xl-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xl-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-column>.flex{min-height:0}.layout-xl,.layout-xl-column,.layout-xl-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xl-column{flex-direction:column}.layout-xl-row{flex-direction:row}.hide-gt-lg:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show){display:none}.hide-xl:not(.show-xl):not(.show-gt-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}}@media print{.hide-print:not(.show-print):not(.show){display:none!important}}md-menu[md-nest-level='1']{margin:0}md-menu[md-nest-level='1'] .md-button{display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}*{text-rendering:optimizeLegibility;-o-text-rendering:optimizeLegibility;-ms-text-rendering:optimizeLegibility;-moz-text-rendering:optimizeLegibility;-webkit-text-rendering:optimizeLegibility;-webkit-tap-highlight-color:transparent;box-sizing:border-box}:after,:before{box-sizing:border-box}:focus{outline:0}:not(md-input-container)>button,:not(md-input-container)>input[type=button],:not(md-input-container)>input[type=email],:not(md-input-container)>input[type=image],:not(md-input-container)>input[type=password],:not(md-input-container)>input[type=search],:not(md-input-container)>input[type=submit],:not(md-input-container)>input[type=tel],:not(md-input-container)>input[type=text],:not(md-input-container)>textarea{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;border:none;padding:0;margin:0}:not(md-input-container)>button,:not(md-input-container)>input[type=button],:not(md-input-container)>input[type=submit]{background:0 0}button{border-radius:0;font-family:inherit;font-size:inherit;padding:0;margin:0;appearance:none;-moz-appearance:none;-webkit-appearance:none}[layout]>*{min-height:auto;min-height:initial}md-card>:not(md-card-content) img,md-card>img{height:inherit;height:initial}.md-datepicker-calendar-pane *{box-sizing:initial}md-autocomplete-wrap>input[type=search]{background:#fff;padding:0 15px!important}md-backdrop.md-opaque{background-color:rgba(33,33,33,.48)!important}md-card md-card-header md-card-avatar md-icon{width:40px;height:40px}md-checkbox.no-label{margin:0}md-chip .md-chip-remove md-icon{margin-left:2px}md-chip .md-chip-remove md-icon svg{width:18px;height:18px;max-width:18px;max-height:18px;margin:4px}md-datepicker .md-datepicker-button{padding:0!important;margin:0!important;vertical-align:middle}md-datepicker .md-datepicker-input-container{margin-left:0}.md-inline-form md-datepicker{margin-top:14px}md-dialog md-dialog-content{padding:32px 24px 24px 24px}md-dialog md-dialog-actions{min-height:64px;padding-top:8px;padding-bottom:8px}md-dialog md-dialog-actions .md-button{margin:0 8px}md-input-container.no-errors-spacer .md-errors-spacer{display:none}md-input-container .input-hint{position:absolute;right:auto;bottom:7px;left:2px;font-size:12px;line-height:14px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-input-container.md-icon-left .input-hint{left:38px}md-list-item .md-list-item-text p{font-size:13px!important}.md-menu,md-menu{padding:0}md-menu-content.md-menu-bar-menu.md-dense{padding:8px 0}md-menu-content.md-menu-bar-menu.md-dense .md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item{height:40px;line-height:40px}md-menu-content.md-menu-bar-menu.md-dense .md-button.md-indent>md-icon,md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{top:8px}.md-open-menu-container md-menu-content md-menu-item.selected{opacity:.4}md-menu-content md-menu-item .md-button{text-align:left}md-select.simplified{margin:0 8px}md-select.simplified .md-select-value{border:none!important;box-sizing:border-box;padding:0}md-select.simplified .md-select-value :first-child{transform:none;height:auto}md-select.simplified .md-select-value .md-select-icon{transform:none;font-size:16px}md-select.simplified .md-select-value .md-select-icon:after{top:1px}md-select[multiple] md-select-value>:first-child{display:flex}md-select[multiple] md-select-value>:first-child>:first-child{flex:0}md-select[multiple] md-select-value>:first-child .md-container{padding-right:6px}md-select[multiple] md-select-value>:first-child .md-container:first-of-type{padding-right:0}md-select-menu md-select-header{position:relative;display:flex;align-items:center;width:auto;height:48px;padding-left:10.667px;box-shadow:0 1px 0 0 rgba(0,0,0,.1),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12);cursor:pointer}md-select-menu md-select-header input[type=search]{border:none;outline:0;height:100%;width:100%;padding:0}md-sidenav{-webkit-overflow-scrolling:touch}md-toolbar.colored-toolbar{color:rgba(255,255,255,.87)}md-toolbar.colored-toolbar md-menu-bar md-menu._md-open>button{background:rgba(0,0,0,.12)}md-toolbar.colored-toolbar md-menu._md-open>button{background:rgba(0,0,0,.12)}md-toolbar.colored-toolbar input{color:rgba(255,255,255,.87)!important}md-progress-circular[disabled]{visibility:hidden}body,html{overflow:hidden!important}#main{position:fixed;top:0;left:0;width:100vw;height:100vh}body.boxed{background:#3f4450}body.boxed #main{overflow:hidden!important;width:100%;max-width:1280px;margin:0 auto;box-shadow:0 0 12px rgba(0,0,0,.45)}#layout-content-only{position:relative;height:100%;max-height:100%}#layout-content-only #content{position:absolute;top:0;right:0;bottom:0;left:0}#layout-content-with-toolbar{position:relative;height:100%;max-height:100%}#layout-content-with-toolbar #content{position:absolute;top:64px;right:0;bottom:0;left:0}#layout-vertical-navigation{width:100%;height:100%;max-height:100%}#layout-vertical-navigation #content-container{position:relative;overflow:hidden;width:100%;height:100%}#layout-vertical-navigation #content-container #content{width:100%;height:100%;overflow:auto}#layout-vertical-navigation-fullwidth-toolbar{height:100%;max-height:100%}#layout-vertical-navigation-fullwidth-toolbar #main-container{position:relative}#layout-vertical-navigation-fullwidth-toolbar #main-container #content-container{position:relative;overflow:hidden}#layout-vertical-navigation-fullwidth-toolbar #main-container #content-container #content{position:absolute;top:0;right:0;bottom:0;left:0}#layout-vertical-navigation-fullwidth-toolbar-2{height:100%;max-height:100%}#layout-vertical-navigation-fullwidth-toolbar-2 #main-container{position:relative}#layout-vertical-navigation-fullwidth-toolbar-2 #main-container #content-container{position:relative;overflow:hidden}#layout-vertical-navigation-fullwidth-toolbar-2 #main-container #content-container #content{position:absolute;top:0;right:0;bottom:0;left:0}#layout-horizontal-navigation{height:100%;max-height:100%}#layout-horizontal-navigation #content-container{position:relative;overflow:hidden}#layout-horizontal-navigation #content-container #content{position:absolute;top:0;right:0;bottom:0;left:0}.page-layout{position:relative;overflow:hidden}.page-layout .top-bg{position:absolute;z-index:1;top:0;right:0;left:0;height:200px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout md-backdrop{z-index:50}.page-layout>.header .breadcrumb{margin-bottom:16px;font-weight:500;color:rgba(0,0,0,.54)}.page-layout>.header .breadcrumb md-icon{margin:0}.page-layout>.header .breadcrumb .separator{margin:0 8px}.page-layout>.header .title{font-size:34px}.page-layout.carded{min-height:100%;height:100%}.page-layout.carded.fullwidth.single-scroll{height:auto}.page-layout.carded.fullwidth.single-scroll>.center .content-card .content{overflow:hidden}.page-layout.carded.fullwidth>.center{position:relative;z-index:2;margin-left:32px;margin-right:32px}.page-layout.carded.fullwidth>.center .header{height:136px;min-height:136px;max-height:136px;padding:24px}.page-layout.carded.fullwidth>.center .content-card{background:#fff;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);overflow:hidden}.page-layout.carded.fullwidth>.center .content-card .toolbar{padding:8px 24px;height:64px;min-height:64px;max-height:64px;border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.fullwidth>.center .content-card .content{padding:24px;background:#fff}.page-layout.carded.left-sidenav.single-scroll{height:auto}.page-layout.carded.left-sidenav.single-scroll>.center .content-card .content{overflow:hidden}.page-layout.carded.left-sidenav>.sidenav{width:240px;min-width:240px;max-width:240px;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);z-index:51}.page-layout.carded.left-sidenav>.sidenav .header{height:200px;min-height:200px;max-height:200px;padding:24px}.page-layout.carded.left-sidenav>.sidenav .content{background:0 0;padding:24px}.page-layout.carded.left-sidenav>.sidenav.md-locked-open{width:220px;min-width:220px;max-width:220px;z-index:2;background:0 0;box-shadow:none}.page-layout.carded.left-sidenav>.sidenav.md-locked-open+.center{margin-left:0}.page-layout.carded.left-sidenav>.sidenav:not(.md-locked-open) .header{border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.left-sidenav>.sidenav:not(.md-locked-open) .content{overflow:hidden}.page-layout.carded.left-sidenav>.center{position:relative;z-index:2;margin-left:32px;margin-right:32px}.page-layout.carded.left-sidenav>.center .header{height:136px;min-height:136px;max-height:136px;padding:24px}.page-layout.carded.left-sidenav>.center .content-card{background:#fff;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);overflow:hidden}.page-layout.carded.left-sidenav>.center .content-card .toolbar{padding:8px 24px;height:64px;min-height:64px;max-height:64px;border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.left-sidenav>.center .content-card .toolbar .sidenav-toggle{margin:0 8px 0 0!important;padding:0!important;border-radius:0}.page-layout.carded.left-sidenav>.center .content-card .content{padding:24px;background:#fff}.page-layout.carded.right-sidenav.single-scroll{height:auto}.page-layout.carded.right-sidenav.single-scroll>.center .content-card .content{overflow:hidden}.page-layout.carded.right-sidenav>.sidenav{width:240px;min-width:240px;max-width:240px;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);z-index:51}.page-layout.carded.right-sidenav>.sidenav .header{height:200px;min-height:200px;max-height:200px;padding:24px 24px 24px 0}.page-layout.carded.right-sidenav>.sidenav .content{background:0 0;padding:24px 24px 24px 0}.page-layout.carded.right-sidenav>.sidenav.md-locked-open{width:196px;min-width:196px;max-width:196px;z-index:2;background:0 0;box-shadow:none}.page-layout.carded.right-sidenav>.sidenav:not(.md-locked-open) .header{padding:24px;border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.right-sidenav>.sidenav:not(.md-locked-open) .content{overflow:hidden;padding:24px}.page-layout.carded.right-sidenav>.center{position:relative;z-index:2;margin-left:32px;margin-right:32px}.page-layout.carded.right-sidenav>.center .header{height:136px;min-height:136px;max-height:136px;padding:24px}.page-layout.carded.right-sidenav>.center .content-card{background:#fff;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);overflow:hidden}.page-layout.carded.right-sidenav>.center .content-card .toolbar{padding:8px 24px;height:64px;min-height:64px;max-height:64px;border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.right-sidenav>.center .content-card .toolbar .sidenav-toggle{margin:0 0 0 8px!important;padding:0!important;border-radius:0}.page-layout.carded.right-sidenav>.center .content-card .content{padding:24px;background:#fff}.page-layout.simple.fullwidth,.page-layout.simple.inner-sidenav{min-height:100%}.page-layout.simple.fullwidth>.header,.page-layout.simple.inner-sidenav>.header{height:200px;min-height:200px;max-height:200px;padding:24px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout.simple.fullwidth>.content,.page-layout.simple.inner-sidenav>.content{padding:24px}.page-layout.simple.left-sidenav{min-height:100%;height:100%}.page-layout.simple.left-sidenav.single-scroll{height:auto}.page-layout.simple.left-sidenav.single-scroll>.center{overflow:hidden}.page-layout.simple.left-sidenav.inner-sidenav>.content>md-sidenav{margin-right:24px}.page-layout.simple.left-sidenav .sidenav{width:240px;min-width:240px;max-width:240px;padding:24px;z-index:51;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.page-layout.simple.left-sidenav .sidenav.md-locked-open{width:220px;min-width:220px;max-width:220px;z-index:2;box-shadow:none;background:0 0}.page-layout.simple.left-sidenav>.center{position:relative;overflow:auto;z-index:3;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.page-layout.simple.left-sidenav>.center .header{height:200px;min-height:200px;max-height:200px;padding:24px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout.simple.left-sidenav>.center .content{padding:24px;background:#fff}.page-layout.simple.right-sidenav{min-height:100%;height:100%}.page-layout.simple.right-sidenav.single-scroll{height:auto}.page-layout.simple.right-sidenav.single-scroll>.center{overflow:hidden}.page-layout.simple.right-sidenav.inner-sidenav>.content>md-sidenav{margin-left:24px}.page-layout.simple.right-sidenav .sidenav{width:240px;min-width:240px;max-width:240px;padding:24px;z-index:51;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.page-layout.simple.right-sidenav .sidenav.md-locked-open{width:220px;min-width:220px;max-width:220px;z-index:2;box-shadow:none;background:0 0}.page-layout.simple.right-sidenav>.center{position:relative;overflow:auto;z-index:3;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.page-layout.simple.right-sidenav>.center .header{height:200px;min-height:200px;max-height:200px;padding:24px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout.simple.right-sidenav>.center .content{padding:24px;background:#fff}.page-layout.simple.inner-sidenav{height:auto}.page-layout.simple.inner-sidenav>.content>md-sidenav.md-locked-open{padding:0}.page-layout.simple.tabbed{width:100%;height:100%;min-height:100%}.page-layout.simple.tabbed>.header{height:200px;min-height:200px;max-height:200px;padding:24px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout.simple.tabbed>.content{width:100%;height:100%;overflow:hidden}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-wrapper{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);padding:0 24px}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-wrapper md-tabs-canvas{height:56px}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-wrapper md-tabs-canvas md-pagination-wrapper{height:56px}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-wrapper md-tabs-canvas .md-tab{padding:16px 24px;text-transform:none}.page-layout.simple.tabbed>.content>md-tabs:not(.md-dynamic-height) md-tabs-content-wrapper{top:56px}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-content-wrapper{width:100%;height:calc(100% - 56px)}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-content-wrapper>md-tab-content.md-active{padding:24px;box-sizing:border-box;overflow:auto;width:100%;height:100%;display:block}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);border:none;height:56px}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar nav{margin:0 12px}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar nav .md-nav-item{height:56px}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar nav .md-nav-item ._md-nav-button{height:56px;line-height:32px}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar nav .md-nav-item ._md-nav-button-text{text-transform:none}.page-layout.blank{min-height:100%;padding:24px}.single-scroll .carded.fullwidth{height:auto}.single-scroll .carded.fullwidth>.center .content-card .content{overflow:hidden}.single-scroll .carded.left-sidenav{height:auto}.single-scroll .carded.left-sidenav>.center .content-card .content{overflow:hidden}.single-scroll .carded.right-sidenav{height:auto}.single-scroll .carded.right-sidenav>.center .content-card .content{overflow:hidden}.single-scroll .simple.left-sidenav{height:auto}.single-scroll .simple.left-sidenav>.center{overflow:hidden}.single-scroll .simple.right-sidenav{height:auto}.single-scroll .simple.right-sidenav>.center{overflow:hidden}@media screen and (max-width:1280px){.page-layout.simple.inner-sidenav.left-sidenav>.content,.page-layout.simple.inner-sidenav.right-sidenav>.content{height:auto!important}.page-layout.simple.inner-sidenav.left-sidenav>.content>md-sidenav,.page-layout.simple.inner-sidenav.right-sidenav>.content>md-sidenav{margin-left:0;margin-right:0}.sidenav-open .page-layout.simple.inner-sidenav{height:100%}}@media screen and (max-width:600px){.page-layout .top-bg{height:160px}.page-layout.carded.fullwidth>.center,.page-layout.carded.left-sidenav>.center,.page-layout.carded.right-sidenav>.center{margin-left:16px;margin-right:16px}.page-layout.carded.fullwidth>.center .header,.page-layout.carded.left-sidenav>.center .header,.page-layout.carded.right-sidenav>.center .header{height:96px;min-height:96px;max-height:96px;padding:16px}.page-layout.carded.fullwidth{height:auto}.page-layout.carded.fullwidth>.center .content-card .content{overflow:hidden}.page-layout.carded.left-sidenav,.page-layout.carded.right-sidenav{height:auto}.page-layout.carded.left-sidenav>.center .content-card .content,.page-layout.carded.right-sidenav>.center .content-card .content{overflow:hidden}.page-layout.simple.fullwidth>.header,.page-layout.simple.inner-sidenav>.header{height:160px;min-height:160px;max-height:160px;padding:16px}.page-layout.simple.left-sidenav>.center .header,.page-layout.simple.right-sidenav>.center .header{height:160px;min-height:160px;max-height:160px;padding:16px}.page-layout.simple.left-sidenav,.page-layout.simple.right-sidenav{height:auto}.page-layout.simple.left-sidenav>.center,.page-layout.simple.right-sidenav>.center{overflow:hidden}}.black-fg,.black-text{color:rgba(0,0,0,.87)!important}.black-fg .icon,.black-fg .secondary-text,.black-fg.icon,.black-fg.secondary-text,.black-text .icon,.black-text .secondary-text,.black-text.icon,.black-text.secondary-text{color:rgba(0,0,0,.54)!important}.black-fg .disabled-text,.black-fg .hint-text,.black-fg.disabled-text,.black-fg.hint-text,.black-text .disabled-text,.black-text .hint-text,.black-text.disabled-text,.black-text.hint-text{color:rgba(0,0,0,.26)!important}.black-fg .divider,.black-fg .faint-text,.black-fg.divider,.black-fg.faint-text,.black-text .divider,.black-text .faint-text,.black-text.divider,.black-text.faint-text{color:rgba(0,0,0,.12)!important}.white-fg,.white-text{color:#fff!important}.white-fg .icon,.white-fg .secondary-text,.white-fg.icon,.white-fg.secondary-text,.white-text .icon,.white-text .secondary-text,.white-text.icon,.white-text.secondary-text{color:rgba(255,255,255,.7)!important}.white-fg .disabled-text,.white-fg .hint-text,.white-fg.disabled-text,.white-fg.hint-text,.white-text .disabled-text,.white-text .hint-text,.white-text.disabled-text,.white-text.hint-text{color:rgba(255,255,255,.3)!important}.white-fg .divider,.white-fg .faint-text,.white-fg.divider,.white-fg.faint-text,.white-text .divider,.white-text .faint-text,.white-text.divider,.white-text.faint-text{color:rgba(255,255,255,.12)!important}.white-fg md-icon,.white-text md-icon{color:#fff}.white-fg md-progress-linear .md-container,.white-text md-progress-linear .md-container{background:rgba(255,255,255,.3)}.white-fg md-progress-linear .md-bar,.white-text md-progress-linear .md-bar{background:rgba(255,255,255,.7)}.red-50-bg{background-color:#ffebee!important}.md-red-50-bg{background-color:#ffebee!important;color:rgba(0,0,0,.87)}.red-50-fg{color:#ffebee!important}.red-50-border{border-color:#ffebee!important}.red-50-border-top{border-top-color:#ffebee!important}.red-50-border-right{border-right-color:#ffebee!important}.red-50-border-bottom{border-bottom-color:#ffebee!important}.red-50-border-left{border-left-color:#ffebee!important}.red-100-bg{background-color:#ffcdd2!important}.md-red-100-bg{background-color:#ffcdd2!important;color:rgba(0,0,0,.87)}.red-100-fg{color:#ffcdd2!important}.red-100-border{border-color:#ffcdd2!important}.red-100-border-top{border-top-color:#ffcdd2!important}.red-100-border-right{border-right-color:#ffcdd2!important}.red-100-border-bottom{border-bottom-color:#ffcdd2!important}.red-100-border-left{border-left-color:#ffcdd2!important}.red-200-bg{background-color:#ef9a9a!important}.md-red-200-bg{background-color:#ef9a9a!important;color:rgba(0,0,0,.87)}.red-200-fg{color:#ef9a9a!important}.red-200-border{border-color:#ef9a9a!important}.red-200-border-top{border-top-color:#ef9a9a!important}.red-200-border-right{border-right-color:#ef9a9a!important}.red-200-border-bottom{border-bottom-color:#ef9a9a!important}.red-200-border-left{border-left-color:#ef9a9a!important}.red-300-bg{background-color:#e57373!important}.md-red-300-bg{background-color:#e57373!important;color:rgba(0,0,0,.87)}.red-300-fg{color:#e57373!important}.red-300-border{border-color:#e57373!important}.red-300-border-top{border-top-color:#e57373!important}.red-300-border-right{border-right-color:#e57373!important}.red-300-border-bottom{border-bottom-color:#e57373!important}.red-300-border-left{border-left-color:#e57373!important}.red-400-bg{background-color:#ef5350!important}.md-red-400-bg{background-color:#ef5350!important;color:#fff}.red-400-fg{color:#ef5350!important}.red-400-border{border-color:#ef5350!important}.red-400-border-top{border-top-color:#ef5350!important}.red-400-border-right{border-right-color:#ef5350!important}.red-400-border-bottom{border-bottom-color:#ef5350!important}.red-400-border-left{border-left-color:#ef5350!important}.red-500-bg{background-color:#f44336!important}.md-red-500-bg{background-color:#f44336!important;color:#fff}.red-500-fg{color:#f44336!important}.red-500-border{border-color:#f44336!important}.red-500-border-top{border-top-color:#f44336!important}.red-500-border-right{border-right-color:#f44336!important}.red-500-border-bottom{border-bottom-color:#f44336!important}.red-500-border-left{border-left-color:#f44336!important}.md-red-bg{background-color:#f44336!important;color:#fff}.red-bg{background-color:#f44336!important}.red-fg{color:#f44336!important}.red-border{border-color:#f44336!important}.red-border-top{border-top-color:#f44336!important}.red-border-right{border-right-color:#f44336!important}.red-border-bottom{border-bottom-color:#f44336!important}.red-border-left{border-left-color:#f44336!important}.red-600-bg{background-color:#e53935!important}.md-red-600-bg{background-color:#e53935!important;color:#fff}.red-600-fg{color:#e53935!important}.red-600-border{border-color:#e53935!important}.red-600-border-top{border-top-color:#e53935!important}.red-600-border-right{border-right-color:#e53935!important}.red-600-border-bottom{border-bottom-color:#e53935!important}.red-600-border-left{border-left-color:#e53935!important}.red-700-bg{background-color:#d32f2f!important}.md-red-700-bg{background-color:#d32f2f!important;color:#fff}.red-700-fg{color:#d32f2f!important}.red-700-border{border-color:#d32f2f!important}.red-700-border-top{border-top-color:#d32f2f!important}.red-700-border-right{border-right-color:#d32f2f!important}.red-700-border-bottom{border-bottom-color:#d32f2f!important}.red-700-border-left{border-left-color:#d32f2f!important}.red-800-bg{background-color:#c62828!important}.md-red-800-bg{background-color:#c62828!important;color:rgba(255,255,255,.87)}.red-800-fg{color:#c62828!important}.red-800-border{border-color:#c62828!important}.red-800-border-top{border-top-color:#c62828!important}.red-800-border-right{border-right-color:#c62828!important}.red-800-border-bottom{border-bottom-color:#c62828!important}.red-800-border-left{border-left-color:#c62828!important}.red-900-bg{background-color:#b71c1c!important}.md-red-900-bg{background-color:#b71c1c!important;color:rgba(255,255,255,.87)}.red-900-fg{color:#b71c1c!important}.red-900-border{border-color:#b71c1c!important}.red-900-border-top{border-top-color:#b71c1c!important}.red-900-border-right{border-right-color:#b71c1c!important}.red-900-border-bottom{border-bottom-color:#b71c1c!important}.red-900-border-left{border-left-color:#b71c1c!important}.red-A100-bg{background-color:#ff8a80!important}.md-red-A100-bg{background-color:#ff8a80!important;color:rgba(0,0,0,.87)}.red-A100-fg{color:#ff8a80!important}.red-A100-border{border-color:#ff8a80!important}.red-A100-border-top{border-top-color:#ff8a80!important}.red-A100-border-right{border-right-color:#ff8a80!important}.red-A100-border-bottom{border-bottom-color:#ff8a80!important}.red-A100-border-left{border-left-color:#ff8a80!important}.red-A200-bg{background-color:#ff5252!important}.md-red-A200-bg{background-color:#ff5252!important;color:#fff}.red-A200-fg{color:#ff5252!important}.red-A200-border{border-color:#ff5252!important}.red-A200-border-top{border-top-color:#ff5252!important}.red-A200-border-right{border-right-color:#ff5252!important}.red-A200-border-bottom{border-bottom-color:#ff5252!important}.red-A200-border-left{border-left-color:#ff5252!important}.red-A400-bg{background-color:#ff1744!important}.md-red-A400-bg{background-color:#ff1744!important;color:#fff}.red-A400-fg{color:#ff1744!important}.red-A400-border{border-color:#ff1744!important}.red-A400-border-top{border-top-color:#ff1744!important}.red-A400-border-right{border-right-color:#ff1744!important}.red-A400-border-bottom{border-bottom-color:#ff1744!important}.red-A400-border-left{border-left-color:#ff1744!important}.red-A700-bg{background-color:#d50000!important}.md-red-A700-bg{background-color:#d50000!important;color:#fff}.red-A700-fg{color:#d50000!important}.red-A700-border{border-color:#d50000!important}.red-A700-border-top{border-top-color:#d50000!important}.red-A700-border-right{border-right-color:#d50000!important}.red-A700-border-bottom{border-bottom-color:#d50000!important}.red-A700-border-left{border-left-color:#d50000!important}.pink-50-bg{background-color:#fce4ec!important}.md-pink-50-bg{background-color:#fce4ec!important;color:rgba(0,0,0,.87)}.pink-50-fg{color:#fce4ec!important}.pink-50-border{border-color:#fce4ec!important}.pink-50-border-top{border-top-color:#fce4ec!important}.pink-50-border-right{border-right-color:#fce4ec!important}.pink-50-border-bottom{border-bottom-color:#fce4ec!important}.pink-50-border-left{border-left-color:#fce4ec!important}.pink-100-bg{background-color:#f8bbd0!important}.md-pink-100-bg{background-color:#f8bbd0!important;color:rgba(0,0,0,.87)}.pink-100-fg{color:#f8bbd0!important}.pink-100-border{border-color:#f8bbd0!important}.pink-100-border-top{border-top-color:#f8bbd0!important}.pink-100-border-right{border-right-color:#f8bbd0!important}.pink-100-border-bottom{border-bottom-color:#f8bbd0!important}.pink-100-border-left{border-left-color:#f8bbd0!important}.pink-200-bg{background-color:#f48fb1!important}.md-pink-200-bg{background-color:#f48fb1!important;color:rgba(0,0,0,.87)}.pink-200-fg{color:#f48fb1!important}.pink-200-border{border-color:#f48fb1!important}.pink-200-border-top{border-top-color:#f48fb1!important}.pink-200-border-right{border-right-color:#f48fb1!important}.pink-200-border-bottom{border-bottom-color:#f48fb1!important}.pink-200-border-left{border-left-color:#f48fb1!important}.pink-300-bg{background-color:#f06292!important}.md-pink-300-bg{background-color:#f06292!important;color:rgba(255,255,255,.87)}.pink-300-fg{color:#f06292!important}.pink-300-border{border-color:#f06292!important}.pink-300-border-top{border-top-color:#f06292!important}.pink-300-border-right{border-right-color:#f06292!important}.pink-300-border-bottom{border-bottom-color:#f06292!important}.pink-300-border-left{border-left-color:#f06292!important}.pink-400-bg{background-color:#ec407a!important}.md-pink-400-bg{background-color:#ec407a!important;color:rgba(255,255,255,.87)}.pink-400-fg{color:#ec407a!important}.pink-400-border{border-color:#ec407a!important}.pink-400-border-top{border-top-color:#ec407a!important}.pink-400-border-right{border-right-color:#ec407a!important}.pink-400-border-bottom{border-bottom-color:#ec407a!important}.pink-400-border-left{border-left-color:#ec407a!important}.pink-500-bg{background-color:#e91e63!important}.md-pink-500-bg{background-color:#e91e63!important;color:#fff}.pink-500-fg{color:#e91e63!important}.pink-500-border{border-color:#e91e63!important}.pink-500-border-top{border-top-color:#e91e63!important}.pink-500-border-right{border-right-color:#e91e63!important}.pink-500-border-bottom{border-bottom-color:#e91e63!important}.pink-500-border-left{border-left-color:#e91e63!important}.md-pink-bg{background-color:#e91e63!important;color:#fff}.pink-bg{background-color:#e91e63!important}.pink-fg{color:#e91e63!important}.pink-border{border-color:#e91e63!important}.pink-border-top{border-top-color:#e91e63!important}.pink-border-right{border-right-color:#e91e63!important}.pink-border-bottom{border-bottom-color:#e91e63!important}.pink-border-left{border-left-color:#e91e63!important}.pink-600-bg{background-color:#d81b60!important}.md-pink-600-bg{background-color:#d81b60!important;color:#fff}.pink-600-fg{color:#d81b60!important}.pink-600-border{border-color:#d81b60!important}.pink-600-border-top{border-top-color:#d81b60!important}.pink-600-border-right{border-right-color:#d81b60!important}.pink-600-border-bottom{border-bottom-color:#d81b60!important}.pink-600-border-left{border-left-color:#d81b60!important}.pink-700-bg{background-color:#c2185b!important}.md-pink-700-bg{background-color:#c2185b!important;color:rgba(255,255,255,.87)}.pink-700-fg{color:#c2185b!important}.pink-700-border{border-color:#c2185b!important}.pink-700-border-top{border-top-color:#c2185b!important}.pink-700-border-right{border-right-color:#c2185b!important}.pink-700-border-bottom{border-bottom-color:#c2185b!important}.pink-700-border-left{border-left-color:#c2185b!important}.pink-800-bg{background-color:#ad1457!important}.md-pink-800-bg{background-color:#ad1457!important;color:rgba(255,255,255,.87)}.pink-800-fg{color:#ad1457!important}.pink-800-border{border-color:#ad1457!important}.pink-800-border-top{border-top-color:#ad1457!important}.pink-800-border-right{border-right-color:#ad1457!important}.pink-800-border-bottom{border-bottom-color:#ad1457!important}.pink-800-border-left{border-left-color:#ad1457!important}.pink-900-bg{background-color:#880e4f!important}.md-pink-900-bg{background-color:#880e4f!important;color:rgba(255,255,255,.87)}.pink-900-fg{color:#880e4f!important}.pink-900-border{border-color:#880e4f!important}.pink-900-border-top{border-top-color:#880e4f!important}.pink-900-border-right{border-right-color:#880e4f!important}.pink-900-border-bottom{border-bottom-color:#880e4f!important}.pink-900-border-left{border-left-color:#880e4f!important}.pink-A100-bg{background-color:#ff80ab!important}.md-pink-A100-bg{background-color:#ff80ab!important;color:rgba(0,0,0,.87)}.pink-A100-fg{color:#ff80ab!important}.pink-A100-border{border-color:#ff80ab!important}.pink-A100-border-top{border-top-color:#ff80ab!important}.pink-A100-border-right{border-right-color:#ff80ab!important}.pink-A100-border-bottom{border-bottom-color:#ff80ab!important}.pink-A100-border-left{border-left-color:#ff80ab!important}.pink-A200-bg{background-color:#ff4081!important}.md-pink-A200-bg{background-color:#ff4081!important;color:#fff}.pink-A200-fg{color:#ff4081!important}.pink-A200-border{border-color:#ff4081!important}.pink-A200-border-top{border-top-color:#ff4081!important}.pink-A200-border-right{border-right-color:#ff4081!important}.pink-A200-border-bottom{border-bottom-color:#ff4081!important}.pink-A200-border-left{border-left-color:#ff4081!important}.pink-A400-bg{background-color:#f50057!important}.md-pink-A400-bg{background-color:#f50057!important;color:#fff}.pink-A400-fg{color:#f50057!important}.pink-A400-border{border-color:#f50057!important}.pink-A400-border-top{border-top-color:#f50057!important}.pink-A400-border-right{border-right-color:#f50057!important}.pink-A400-border-bottom{border-bottom-color:#f50057!important}.pink-A400-border-left{border-left-color:#f50057!important}.pink-A700-bg{background-color:#c51162!important}.md-pink-A700-bg{background-color:#c51162!important;color:#fff}.pink-A700-fg{color:#c51162!important}.pink-A700-border{border-color:#c51162!important}.pink-A700-border-top{border-top-color:#c51162!important}.pink-A700-border-right{border-right-color:#c51162!important}.pink-A700-border-bottom{border-bottom-color:#c51162!important}.pink-A700-border-left{border-left-color:#c51162!important}.purple-50-bg{background-color:#f3e5f5!important}.md-purple-50-bg{background-color:#f3e5f5!important;color:rgba(0,0,0,.87)}.purple-50-fg{color:#f3e5f5!important}.purple-50-border{border-color:#f3e5f5!important}.purple-50-border-top{border-top-color:#f3e5f5!important}.purple-50-border-right{border-right-color:#f3e5f5!important}.purple-50-border-bottom{border-bottom-color:#f3e5f5!important}.purple-50-border-left{border-left-color:#f3e5f5!important}.purple-100-bg{background-color:#e1bee7!important}.md-purple-100-bg{background-color:#e1bee7!important;color:rgba(0,0,0,.87)}.purple-100-fg{color:#e1bee7!important}.purple-100-border{border-color:#e1bee7!important}.purple-100-border-top{border-top-color:#e1bee7!important}.purple-100-border-right{border-right-color:#e1bee7!important}.purple-100-border-bottom{border-bottom-color:#e1bee7!important}.purple-100-border-left{border-left-color:#e1bee7!important}.purple-200-bg{background-color:#ce93d8!important}.md-purple-200-bg{background-color:#ce93d8!important;color:rgba(0,0,0,.87)}.purple-200-fg{color:#ce93d8!important}.purple-200-border{border-color:#ce93d8!important}.purple-200-border-top{border-top-color:#ce93d8!important}.purple-200-border-right{border-right-color:#ce93d8!important}.purple-200-border-bottom{border-bottom-color:#ce93d8!important}.purple-200-border-left{border-left-color:#ce93d8!important}.purple-300-bg{background-color:#ba68c8!important}.md-purple-300-bg{background-color:#ba68c8!important;color:#fff}.purple-300-fg{color:#ba68c8!important}.purple-300-border{border-color:#ba68c8!important}.purple-300-border-top{border-top-color:#ba68c8!important}.purple-300-border-right{border-right-color:#ba68c8!important}.purple-300-border-bottom{border-bottom-color:#ba68c8!important}.purple-300-border-left{border-left-color:#ba68c8!important}.purple-400-bg{background-color:#ab47bc!important}.md-purple-400-bg{background-color:#ab47bc!important;color:#fff}.purple-400-fg{color:#ab47bc!important}.purple-400-border{border-color:#ab47bc!important}.purple-400-border-top{border-top-color:#ab47bc!important}.purple-400-border-right{border-right-color:#ab47bc!important}.purple-400-border-bottom{border-bottom-color:#ab47bc!important}.purple-400-border-left{border-left-color:#ab47bc!important}.purple-500-bg{background-color:#9c27b0!important}.md-purple-500-bg{background-color:#9c27b0!important;color:rgba(255,255,255,.87)}.purple-500-fg{color:#9c27b0!important}.purple-500-border{border-color:#9c27b0!important}.purple-500-border-top{border-top-color:#9c27b0!important}.purple-500-border-right{border-right-color:#9c27b0!important}.purple-500-border-bottom{border-bottom-color:#9c27b0!important}.purple-500-border-left{border-left-color:#9c27b0!important}.md-purple-bg{background-color:#9c27b0!important;color:rgba(255,255,255,.87)}.purple-bg{background-color:#9c27b0!important}.purple-fg{color:#9c27b0!important}.purple-border{border-color:#9c27b0!important}.purple-border-top{border-top-color:#9c27b0!important}.purple-border-right{border-right-color:#9c27b0!important}.purple-border-bottom{border-bottom-color:#9c27b0!important}.purple-border-left{border-left-color:#9c27b0!important}.purple-600-bg{background-color:#8e24aa!important}.md-purple-600-bg{background-color:#8e24aa!important;color:rgba(255,255,255,.87)}.purple-600-fg{color:#8e24aa!important}.purple-600-border{border-color:#8e24aa!important}.purple-600-border-top{border-top-color:#8e24aa!important}.purple-600-border-right{border-right-color:#8e24aa!important}.purple-600-border-bottom{border-bottom-color:#8e24aa!important}.purple-600-border-left{border-left-color:#8e24aa!important}.purple-700-bg{background-color:#7b1fa2!important}.md-purple-700-bg{background-color:#7b1fa2!important;color:rgba(255,255,255,.87)}.purple-700-fg{color:#7b1fa2!important}.purple-700-border{border-color:#7b1fa2!important}.purple-700-border-top{border-top-color:#7b1fa2!important}.purple-700-border-right{border-right-color:#7b1fa2!important}.purple-700-border-bottom{border-bottom-color:#7b1fa2!important}.purple-700-border-left{border-left-color:#7b1fa2!important}.purple-800-bg{background-color:#6a1b9a!important}.md-purple-800-bg{background-color:#6a1b9a!important;color:rgba(255,255,255,.87)}.purple-800-fg{color:#6a1b9a!important}.purple-800-border{border-color:#6a1b9a!important}.purple-800-border-top{border-top-color:#6a1b9a!important}.purple-800-border-right{border-right-color:#6a1b9a!important}.purple-800-border-bottom{border-bottom-color:#6a1b9a!important}.purple-800-border-left{border-left-color:#6a1b9a!important}.purple-900-bg{background-color:#4a148c!important}.md-purple-900-bg{background-color:#4a148c!important;color:rgba(255,255,255,.87)}.purple-900-fg{color:#4a148c!important}.purple-900-border{border-color:#4a148c!important}.purple-900-border-top{border-top-color:#4a148c!important}.purple-900-border-right{border-right-color:#4a148c!important}.purple-900-border-bottom{border-bottom-color:#4a148c!important}.purple-900-border-left{border-left-color:#4a148c!important}.purple-A100-bg{background-color:#ea80fc!important}.md-purple-A100-bg{background-color:#ea80fc!important;color:rgba(0,0,0,.87)}.purple-A100-fg{color:#ea80fc!important}.purple-A100-border{border-color:#ea80fc!important}.purple-A100-border-top{border-top-color:#ea80fc!important}.purple-A100-border-right{border-right-color:#ea80fc!important}.purple-A100-border-bottom{border-bottom-color:#ea80fc!important}.purple-A100-border-left{border-left-color:#ea80fc!important}.purple-A200-bg{background-color:#e040fb!important}.md-purple-A200-bg{background-color:#e040fb!important;color:#fff}.purple-A200-fg{color:#e040fb!important}.purple-A200-border{border-color:#e040fb!important}.purple-A200-border-top{border-top-color:#e040fb!important}.purple-A200-border-right{border-right-color:#e040fb!important}.purple-A200-border-bottom{border-bottom-color:#e040fb!important}.purple-A200-border-left{border-left-color:#e040fb!important}.purple-A400-bg{background-color:#d500f9!important}.md-purple-A400-bg{background-color:#d500f9!important;color:#fff}.purple-A400-fg{color:#d500f9!important}.purple-A400-border{border-color:#d500f9!important}.purple-A400-border-top{border-top-color:#d500f9!important}.purple-A400-border-right{border-right-color:#d500f9!important}.purple-A400-border-bottom{border-bottom-color:#d500f9!important}.purple-A400-border-left{border-left-color:#d500f9!important}.purple-A700-bg{background-color:#a0f!important}.md-purple-A700-bg{background-color:#a0f!important;color:#fff}.purple-A700-fg{color:#a0f!important}.purple-A700-border{border-color:#a0f!important}.purple-A700-border-top{border-top-color:#a0f!important}.purple-A700-border-right{border-right-color:#a0f!important}.purple-A700-border-bottom{border-bottom-color:#a0f!important}.purple-A700-border-left{border-left-color:#a0f!important}.deep-purple-50-bg{background-color:#ede7f6!important}.md-deep-purple-50-bg{background-color:#ede7f6!important;color:rgba(0,0,0,.87)}.deep-purple-50-fg{color:#ede7f6!important}.deep-purple-50-border{border-color:#ede7f6!important}.deep-purple-50-border-top{border-top-color:#ede7f6!important}.deep-purple-50-border-right{border-right-color:#ede7f6!important}.deep-purple-50-border-bottom{border-bottom-color:#ede7f6!important}.deep-purple-50-border-left{border-left-color:#ede7f6!important}.deep-purple-100-bg{background-color:#d1c4e9!important}.md-deep-purple-100-bg{background-color:#d1c4e9!important;color:rgba(0,0,0,.87)}.deep-purple-100-fg{color:#d1c4e9!important}.deep-purple-100-border{border-color:#d1c4e9!important}.deep-purple-100-border-top{border-top-color:#d1c4e9!important}.deep-purple-100-border-right{border-right-color:#d1c4e9!important}.deep-purple-100-border-bottom{border-bottom-color:#d1c4e9!important}.deep-purple-100-border-left{border-left-color:#d1c4e9!important}.deep-purple-200-bg{background-color:#b39ddb!important}.md-deep-purple-200-bg{background-color:#b39ddb!important;color:rgba(0,0,0,.87)}.deep-purple-200-fg{color:#b39ddb!important}.deep-purple-200-border{border-color:#b39ddb!important}.deep-purple-200-border-top{border-top-color:#b39ddb!important}.deep-purple-200-border-right{border-right-color:#b39ddb!important}.deep-purple-200-border-bottom{border-bottom-color:#b39ddb!important}.deep-purple-200-border-left{border-left-color:#b39ddb!important}.deep-purple-300-bg{background-color:#9575cd!important}.md-deep-purple-300-bg{background-color:#9575cd!important;color:#fff}.deep-purple-300-fg{color:#9575cd!important}.deep-purple-300-border{border-color:#9575cd!important}.deep-purple-300-border-top{border-top-color:#9575cd!important}.deep-purple-300-border-right{border-right-color:#9575cd!important}.deep-purple-300-border-bottom{border-bottom-color:#9575cd!important}.deep-purple-300-border-left{border-left-color:#9575cd!important}.deep-purple-400-bg{background-color:#7e57c2!important}.md-deep-purple-400-bg{background-color:#7e57c2!important;color:#fff}.deep-purple-400-fg{color:#7e57c2!important}.deep-purple-400-border{border-color:#7e57c2!important}.deep-purple-400-border-top{border-top-color:#7e57c2!important}.deep-purple-400-border-right{border-right-color:#7e57c2!important}.deep-purple-400-border-bottom{border-bottom-color:#7e57c2!important}.deep-purple-400-border-left{border-left-color:#7e57c2!important}.deep-purple-500-bg{background-color:#673ab7!important}.md-deep-purple-500-bg{background-color:#673ab7!important;color:rgba(255,255,255,.87)}.deep-purple-500-fg{color:#673ab7!important}.deep-purple-500-border{border-color:#673ab7!important}.deep-purple-500-border-top{border-top-color:#673ab7!important}.deep-purple-500-border-right{border-right-color:#673ab7!important}.deep-purple-500-border-bottom{border-bottom-color:#673ab7!important}.deep-purple-500-border-left{border-left-color:#673ab7!important}.md-deep-purple-bg{background-color:#673ab7!important;color:rgba(255,255,255,.87)}.deep-purple-bg{background-color:#673ab7!important}.deep-purple-fg{color:#673ab7!important}.deep-purple-border{border-color:#673ab7!important}.deep-purple-border-top{border-top-color:#673ab7!important}.deep-purple-border-right{border-right-color:#673ab7!important}.deep-purple-border-bottom{border-bottom-color:#673ab7!important}.deep-purple-border-left{border-left-color:#673ab7!important}.deep-purple-600-bg{background-color:#5e35b1!important}.md-deep-purple-600-bg{background-color:#5e35b1!important;color:rgba(255,255,255,.87)}.deep-purple-600-fg{color:#5e35b1!important}.deep-purple-600-border{border-color:#5e35b1!important}.deep-purple-600-border-top{border-top-color:#5e35b1!important}.deep-purple-600-border-right{border-right-color:#5e35b1!important}.deep-purple-600-border-bottom{border-bottom-color:#5e35b1!important}.deep-purple-600-border-left{border-left-color:#5e35b1!important}.deep-purple-700-bg{background-color:#512da8!important}.md-deep-purple-700-bg{background-color:#512da8!important;color:rgba(255,255,255,.87)}.deep-purple-700-fg{color:#512da8!important}.deep-purple-700-border{border-color:#512da8!important}.deep-purple-700-border-top{border-top-color:#512da8!important}.deep-purple-700-border-right{border-right-color:#512da8!important}.deep-purple-700-border-bottom{border-bottom-color:#512da8!important}.deep-purple-700-border-left{border-left-color:#512da8!important}.deep-purple-800-bg{background-color:#4527a0!important}.md-deep-purple-800-bg{background-color:#4527a0!important;color:rgba(255,255,255,.87)}.deep-purple-800-fg{color:#4527a0!important}.deep-purple-800-border{border-color:#4527a0!important}.deep-purple-800-border-top{border-top-color:#4527a0!important}.deep-purple-800-border-right{border-right-color:#4527a0!important}.deep-purple-800-border-bottom{border-bottom-color:#4527a0!important}.deep-purple-800-border-left{border-left-color:#4527a0!important}.deep-purple-900-bg{background-color:#311b92!important}.md-deep-purple-900-bg{background-color:#311b92!important;color:rgba(255,255,255,.87)}.deep-purple-900-fg{color:#311b92!important}.deep-purple-900-border{border-color:#311b92!important}.deep-purple-900-border-top{border-top-color:#311b92!important}.deep-purple-900-border-right{border-right-color:#311b92!important}.deep-purple-900-border-bottom{border-bottom-color:#311b92!important}.deep-purple-900-border-left{border-left-color:#311b92!important}.deep-purple-A100-bg{background-color:#b388ff!important}.md-deep-purple-A100-bg{background-color:#b388ff!important;color:rgba(0,0,0,.87)}.deep-purple-A100-fg{color:#b388ff!important}.deep-purple-A100-border{border-color:#b388ff!important}.deep-purple-A100-border-top{border-top-color:#b388ff!important}.deep-purple-A100-border-right{border-right-color:#b388ff!important}.deep-purple-A100-border-bottom{border-bottom-color:#b388ff!important}.deep-purple-A100-border-left{border-left-color:#b388ff!important}.deep-purple-A200-bg{background-color:#7c4dff!important}.md-deep-purple-A200-bg{background-color:#7c4dff!important;color:#fff}.deep-purple-A200-fg{color:#7c4dff!important}.deep-purple-A200-border{border-color:#7c4dff!important}.deep-purple-A200-border-top{border-top-color:#7c4dff!important}.deep-purple-A200-border-right{border-right-color:#7c4dff!important}.deep-purple-A200-border-bottom{border-bottom-color:#7c4dff!important}.deep-purple-A200-border-left{border-left-color:#7c4dff!important}.deep-purple-A400-bg{background-color:#651fff!important}.md-deep-purple-A400-bg{background-color:#651fff!important;color:rgba(255,255,255,.87)}.deep-purple-A400-fg{color:#651fff!important}.deep-purple-A400-border{border-color:#651fff!important}.deep-purple-A400-border-top{border-top-color:#651fff!important}.deep-purple-A400-border-right{border-right-color:#651fff!important}.deep-purple-A400-border-bottom{border-bottom-color:#651fff!important}.deep-purple-A400-border-left{border-left-color:#651fff!important}.deep-purple-A700-bg{background-color:#6200ea!important}.md-deep-purple-A700-bg{background-color:#6200ea!important;color:rgba(255,255,255,.87)}.deep-purple-A700-fg{color:#6200ea!important}.deep-purple-A700-border{border-color:#6200ea!important}.deep-purple-A700-border-top{border-top-color:#6200ea!important}.deep-purple-A700-border-right{border-right-color:#6200ea!important}.deep-purple-A700-border-bottom{border-bottom-color:#6200ea!important}.deep-purple-A700-border-left{border-left-color:#6200ea!important}.indigo-50-bg{background-color:#e8eaf6!important}.md-indigo-50-bg{background-color:#e8eaf6!important;color:rgba(0,0,0,.87)}.indigo-50-fg{color:#e8eaf6!important}.indigo-50-border{border-color:#e8eaf6!important}.indigo-50-border-top{border-top-color:#e8eaf6!important}.indigo-50-border-right{border-right-color:#e8eaf6!important}.indigo-50-border-bottom{border-bottom-color:#e8eaf6!important}.indigo-50-border-left{border-left-color:#e8eaf6!important}.indigo-100-bg{background-color:#c5cae9!important}.md-indigo-100-bg{background-color:#c5cae9!important;color:rgba(0,0,0,.87)}.indigo-100-fg{color:#c5cae9!important}.indigo-100-border{border-color:#c5cae9!important}.indigo-100-border-top{border-top-color:#c5cae9!important}.indigo-100-border-right{border-right-color:#c5cae9!important}.indigo-100-border-bottom{border-bottom-color:#c5cae9!important}.indigo-100-border-left{border-left-color:#c5cae9!important}.indigo-200-bg{background-color:#9fa8da!important}.md-indigo-200-bg{background-color:#9fa8da!important;color:rgba(0,0,0,.87)}.indigo-200-fg{color:#9fa8da!important}.indigo-200-border{border-color:#9fa8da!important}.indigo-200-border-top{border-top-color:#9fa8da!important}.indigo-200-border-right{border-right-color:#9fa8da!important}.indigo-200-border-bottom{border-bottom-color:#9fa8da!important}.indigo-200-border-left{border-left-color:#9fa8da!important}.indigo-300-bg{background-color:#7986cb!important}.md-indigo-300-bg{background-color:#7986cb!important;color:#fff}.indigo-300-fg{color:#7986cb!important}.indigo-300-border{border-color:#7986cb!important}.indigo-300-border-top{border-top-color:#7986cb!important}.indigo-300-border-right{border-right-color:#7986cb!important}.indigo-300-border-bottom{border-bottom-color:#7986cb!important}.indigo-300-border-left{border-left-color:#7986cb!important}.indigo-400-bg{background-color:#5c6bc0!important}.md-indigo-400-bg{background-color:#5c6bc0!important;color:#fff}.indigo-400-fg{color:#5c6bc0!important}.indigo-400-border{border-color:#5c6bc0!important}.indigo-400-border-top{border-top-color:#5c6bc0!important}.indigo-400-border-right{border-right-color:#5c6bc0!important}.indigo-400-border-bottom{border-bottom-color:#5c6bc0!important}.indigo-400-border-left{border-left-color:#5c6bc0!important}.indigo-500-bg{background-color:#3f51b5!important}.md-indigo-500-bg{background-color:#3f51b5!important;color:rgba(255,255,255,.87)}.indigo-500-fg{color:#3f51b5!important}.indigo-500-border{border-color:#3f51b5!important}.indigo-500-border-top{border-top-color:#3f51b5!important}.indigo-500-border-right{border-right-color:#3f51b5!important}.indigo-500-border-bottom{border-bottom-color:#3f51b5!important}.indigo-500-border-left{border-left-color:#3f51b5!important}.md-indigo-bg{background-color:#3f51b5!important;color:rgba(255,255,255,.87)}.indigo-bg{background-color:#3f51b5!important}.indigo-fg{color:#3f51b5!important}.indigo-border{border-color:#3f51b5!important}.indigo-border-top{border-top-color:#3f51b5!important}.indigo-border-right{border-right-color:#3f51b5!important}.indigo-border-bottom{border-bottom-color:#3f51b5!important}.indigo-border-left{border-left-color:#3f51b5!important}.indigo-600-bg{background-color:#3949ab!important}.md-indigo-600-bg{background-color:#3949ab!important;color:rgba(255,255,255,.87)}.indigo-600-fg{color:#3949ab!important}.indigo-600-border{border-color:#3949ab!important}.indigo-600-border-top{border-top-color:#3949ab!important}.indigo-600-border-right{border-right-color:#3949ab!important}.indigo-600-border-bottom{border-bottom-color:#3949ab!important}.indigo-600-border-left{border-left-color:#3949ab!important}.indigo-700-bg{background-color:#303f9f!important}.md-indigo-700-bg{background-color:#303f9f!important;color:rgba(255,255,255,.87)}.indigo-700-fg{color:#303f9f!important}.indigo-700-border{border-color:#303f9f!important}.indigo-700-border-top{border-top-color:#303f9f!important}.indigo-700-border-right{border-right-color:#303f9f!important}.indigo-700-border-bottom{border-bottom-color:#303f9f!important}.indigo-700-border-left{border-left-color:#303f9f!important}.indigo-800-bg{background-color:#283593!important}.md-indigo-800-bg{background-color:#283593!important;color:rgba(255,255,255,.87)}.indigo-800-fg{color:#283593!important}.indigo-800-border{border-color:#283593!important}.indigo-800-border-top{border-top-color:#283593!important}.indigo-800-border-right{border-right-color:#283593!important}.indigo-800-border-bottom{border-bottom-color:#283593!important}.indigo-800-border-left{border-left-color:#283593!important}.indigo-900-bg{background-color:#1a237e!important}.md-indigo-900-bg{background-color:#1a237e!important;color:rgba(255,255,255,.87)}.indigo-900-fg{color:#1a237e!important}.indigo-900-border{border-color:#1a237e!important}.indigo-900-border-top{border-top-color:#1a237e!important}.indigo-900-border-right{border-right-color:#1a237e!important}.indigo-900-border-bottom{border-bottom-color:#1a237e!important}.indigo-900-border-left{border-left-color:#1a237e!important}.indigo-A100-bg{background-color:#8c9eff!important}.md-indigo-A100-bg{background-color:#8c9eff!important;color:rgba(0,0,0,.87)}.indigo-A100-fg{color:#8c9eff!important}.indigo-A100-border{border-color:#8c9eff!important}.indigo-A100-border-top{border-top-color:#8c9eff!important}.indigo-A100-border-right{border-right-color:#8c9eff!important}.indigo-A100-border-bottom{border-bottom-color:#8c9eff!important}.indigo-A100-border-left{border-left-color:#8c9eff!important}.indigo-A200-bg{background-color:#536dfe!important}.md-indigo-A200-bg{background-color:#536dfe!important;color:#fff}.indigo-A200-fg{color:#536dfe!important}.indigo-A200-border{border-color:#536dfe!important}.indigo-A200-border-top{border-top-color:#536dfe!important}.indigo-A200-border-right{border-right-color:#536dfe!important}.indigo-A200-border-bottom{border-bottom-color:#536dfe!important}.indigo-A200-border-left{border-left-color:#536dfe!important}.indigo-A400-bg{background-color:#3d5afe!important}.md-indigo-A400-bg{background-color:#3d5afe!important;color:#fff}.indigo-A400-fg{color:#3d5afe!important}.indigo-A400-border{border-color:#3d5afe!important}.indigo-A400-border-top{border-top-color:#3d5afe!important}.indigo-A400-border-right{border-right-color:#3d5afe!important}.indigo-A400-border-bottom{border-bottom-color:#3d5afe!important}.indigo-A400-border-left{border-left-color:#3d5afe!important}.indigo-A700-bg{background-color:#304ffe!important}.md-indigo-A700-bg{background-color:#304ffe!important;color:rgba(255,255,255,.87)}.indigo-A700-fg{color:#304ffe!important}.indigo-A700-border{border-color:#304ffe!important}.indigo-A700-border-top{border-top-color:#304ffe!important}.indigo-A700-border-right{border-right-color:#304ffe!important}.indigo-A700-border-bottom{border-bottom-color:#304ffe!important}.indigo-A700-border-left{border-left-color:#304ffe!important}.blue-50-bg{background-color:#e3f2fd!important}.md-blue-50-bg{background-color:#e3f2fd!important;color:rgba(0,0,0,.87)}.blue-50-fg{color:#e3f2fd!important}.blue-50-border{border-color:#e3f2fd!important}.blue-50-border-top{border-top-color:#e3f2fd!important}.blue-50-border-right{border-right-color:#e3f2fd!important}.blue-50-border-bottom{border-bottom-color:#e3f2fd!important}.blue-50-border-left{border-left-color:#e3f2fd!important}.blue-100-bg{background-color:#bbdefb!important}.md-blue-100-bg{background-color:#bbdefb!important;color:rgba(0,0,0,.87)}.blue-100-fg{color:#bbdefb!important}.blue-100-border{border-color:#bbdefb!important}.blue-100-border-top{border-top-color:#bbdefb!important}.blue-100-border-right{border-right-color:#bbdefb!important}.blue-100-border-bottom{border-bottom-color:#bbdefb!important}.blue-100-border-left{border-left-color:#bbdefb!important}.blue-200-bg{background-color:#90caf9!important}.md-blue-200-bg{background-color:#90caf9!important;color:rgba(0,0,0,.87)}.blue-200-fg{color:#90caf9!important}.blue-200-border{border-color:#90caf9!important}.blue-200-border-top{border-top-color:#90caf9!important}.blue-200-border-right{border-right-color:#90caf9!important}.blue-200-border-bottom{border-bottom-color:#90caf9!important}.blue-200-border-left{border-left-color:#90caf9!important}.blue-300-bg{background-color:#64b5f6!important}.md-blue-300-bg{background-color:#64b5f6!important;color:rgba(0,0,0,.87)}.blue-300-fg{color:#64b5f6!important}.blue-300-border{border-color:#64b5f6!important}.blue-300-border-top{border-top-color:#64b5f6!important}.blue-300-border-right{border-right-color:#64b5f6!important}.blue-300-border-bottom{border-bottom-color:#64b5f6!important}.blue-300-border-left{border-left-color:#64b5f6!important}.blue-400-bg{background-color:#42a5f5!important}.md-blue-400-bg{background-color:#42a5f5!important;color:rgba(0,0,0,.87)}.blue-400-fg{color:#42a5f5!important}.blue-400-border{border-color:#42a5f5!important}.blue-400-border-top{border-top-color:#42a5f5!important}.blue-400-border-right{border-right-color:#42a5f5!important}.blue-400-border-bottom{border-bottom-color:#42a5f5!important}.blue-400-border-left{border-left-color:#42a5f5!important}.blue-500-bg{background-color:#2196f3!important}.md-blue-500-bg{background-color:#2196f3!important;color:#fff}.blue-500-fg{color:#2196f3!important}.blue-500-border{border-color:#2196f3!important}.blue-500-border-top{border-top-color:#2196f3!important}.blue-500-border-right{border-right-color:#2196f3!important}.blue-500-border-bottom{border-bottom-color:#2196f3!important}.blue-500-border-left{border-left-color:#2196f3!important}.md-blue-bg{background-color:#2196f3!important;color:#fff}.blue-bg{background-color:#2196f3!important}.blue-fg{color:#2196f3!important}.blue-border{border-color:#2196f3!important}.blue-border-top{border-top-color:#2196f3!important}.blue-border-right{border-right-color:#2196f3!important}.blue-border-bottom{border-bottom-color:#2196f3!important}.blue-border-left{border-left-color:#2196f3!important}.blue-600-bg{background-color:#1e88e5!important}.md-blue-600-bg{background-color:#1e88e5!important;color:#fff}.blue-600-fg{color:#1e88e5!important}.blue-600-border{border-color:#1e88e5!important}.blue-600-border-top{border-top-color:#1e88e5!important}.blue-600-border-right{border-right-color:#1e88e5!important}.blue-600-border-bottom{border-bottom-color:#1e88e5!important}.blue-600-border-left{border-left-color:#1e88e5!important}.blue-700-bg{background-color:#1976d2!important}.md-blue-700-bg{background-color:#1976d2!important;color:#fff}.blue-700-fg{color:#1976d2!important}.blue-700-border{border-color:#1976d2!important}.blue-700-border-top{border-top-color:#1976d2!important}.blue-700-border-right{border-right-color:#1976d2!important}.blue-700-border-bottom{border-bottom-color:#1976d2!important}.blue-700-border-left{border-left-color:#1976d2!important}.blue-800-bg{background-color:#1565c0!important}.md-blue-800-bg{background-color:#1565c0!important;color:rgba(255,255,255,.87)}.blue-800-fg{color:#1565c0!important}.blue-800-border{border-color:#1565c0!important}.blue-800-border-top{border-top-color:#1565c0!important}.blue-800-border-right{border-right-color:#1565c0!important}.blue-800-border-bottom{border-bottom-color:#1565c0!important}.blue-800-border-left{border-left-color:#1565c0!important}.blue-900-bg{background-color:#0d47a1!important}.md-blue-900-bg{background-color:#0d47a1!important;color:rgba(255,255,255,.87)}.blue-900-fg{color:#0d47a1!important}.blue-900-border{border-color:#0d47a1!important}.blue-900-border-top{border-top-color:#0d47a1!important}.blue-900-border-right{border-right-color:#0d47a1!important}.blue-900-border-bottom{border-bottom-color:#0d47a1!important}.blue-900-border-left{border-left-color:#0d47a1!important}.blue-A100-bg{background-color:#82b1ff!important}.md-blue-A100-bg{background-color:#82b1ff!important;color:rgba(0,0,0,.87)}.blue-A100-fg{color:#82b1ff!important}.blue-A100-border{border-color:#82b1ff!important}.blue-A100-border-top{border-top-color:#82b1ff!important}.blue-A100-border-right{border-right-color:#82b1ff!important}.blue-A100-border-bottom{border-bottom-color:#82b1ff!important}.blue-A100-border-left{border-left-color:#82b1ff!important}.blue-A200-bg{background-color:#448aff!important}.md-blue-A200-bg{background-color:#448aff!important;color:#fff}.blue-A200-fg{color:#448aff!important}.blue-A200-border{border-color:#448aff!important}.blue-A200-border-top{border-top-color:#448aff!important}.blue-A200-border-right{border-right-color:#448aff!important}.blue-A200-border-bottom{border-bottom-color:#448aff!important}.blue-A200-border-left{border-left-color:#448aff!important}.blue-A400-bg{background-color:#2979ff!important}.md-blue-A400-bg{background-color:#2979ff!important;color:#fff}.blue-A400-fg{color:#2979ff!important}.blue-A400-border{border-color:#2979ff!important}.blue-A400-border-top{border-top-color:#2979ff!important}.blue-A400-border-right{border-right-color:#2979ff!important}.blue-A400-border-bottom{border-bottom-color:#2979ff!important}.blue-A400-border-left{border-left-color:#2979ff!important}.blue-A700-bg{background-color:#2962ff!important}.md-blue-A700-bg{background-color:#2962ff!important;color:#fff}.blue-A700-fg{color:#2962ff!important}.blue-A700-border{border-color:#2962ff!important}.blue-A700-border-top{border-top-color:#2962ff!important}.blue-A700-border-right{border-right-color:#2962ff!important}.blue-A700-border-bottom{border-bottom-color:#2962ff!important}.blue-A700-border-left{border-left-color:#2962ff!important}.light-blue-50-bg{background-color:#e1f5fe!important}.md-light-blue-50-bg{background-color:#e1f5fe!important;color:rgba(0,0,0,.87)}.light-blue-50-fg{color:#e1f5fe!important}.light-blue-50-border{border-color:#e1f5fe!important}.light-blue-50-border-top{border-top-color:#e1f5fe!important}.light-blue-50-border-right{border-right-color:#e1f5fe!important}.light-blue-50-border-bottom{border-bottom-color:#e1f5fe!important}.light-blue-50-border-left{border-left-color:#e1f5fe!important}.light-blue-100-bg{background-color:#b3e5fc!important}.md-light-blue-100-bg{background-color:#b3e5fc!important;color:rgba(0,0,0,.87)}.light-blue-100-fg{color:#b3e5fc!important}.light-blue-100-border{border-color:#b3e5fc!important}.light-blue-100-border-top{border-top-color:#b3e5fc!important}.light-blue-100-border-right{border-right-color:#b3e5fc!important}.light-blue-100-border-bottom{border-bottom-color:#b3e5fc!important}.light-blue-100-border-left{border-left-color:#b3e5fc!important}.light-blue-200-bg{background-color:#81d4fa!important}.md-light-blue-200-bg{background-color:#81d4fa!important;color:rgba(0,0,0,.87)}.light-blue-200-fg{color:#81d4fa!important}.light-blue-200-border{border-color:#81d4fa!important}.light-blue-200-border-top{border-top-color:#81d4fa!important}.light-blue-200-border-right{border-right-color:#81d4fa!important}.light-blue-200-border-bottom{border-bottom-color:#81d4fa!important}.light-blue-200-border-left{border-left-color:#81d4fa!important}.light-blue-300-bg{background-color:#4fc3f7!important}.md-light-blue-300-bg{background-color:#4fc3f7!important;color:rgba(0,0,0,.87)}.light-blue-300-fg{color:#4fc3f7!important}.light-blue-300-border{border-color:#4fc3f7!important}.light-blue-300-border-top{border-top-color:#4fc3f7!important}.light-blue-300-border-right{border-right-color:#4fc3f7!important}.light-blue-300-border-bottom{border-bottom-color:#4fc3f7!important}.light-blue-300-border-left{border-left-color:#4fc3f7!important}.light-blue-400-bg{background-color:#29b6f6!important}.md-light-blue-400-bg{background-color:#29b6f6!important;color:rgba(0,0,0,.87)}.light-blue-400-fg{color:#29b6f6!important}.light-blue-400-border{border-color:#29b6f6!important}.light-blue-400-border-top{border-top-color:#29b6f6!important}.light-blue-400-border-right{border-right-color:#29b6f6!important}.light-blue-400-border-bottom{border-bottom-color:#29b6f6!important}.light-blue-400-border-left{border-left-color:#29b6f6!important}.light-blue-500-bg{background-color:#03a9f4!important}.md-light-blue-500-bg{background-color:#03a9f4!important;color:rgba(0,0,0,.87)}.light-blue-500-fg{color:#03a9f4!important}.light-blue-500-border{border-color:#03a9f4!important}.light-blue-500-border-top{border-top-color:#03a9f4!important}.light-blue-500-border-right{border-right-color:#03a9f4!important}.light-blue-500-border-bottom{border-bottom-color:#03a9f4!important}.light-blue-500-border-left{border-left-color:#03a9f4!important}.md-light-blue-bg{background-color:#03a9f4!important;color:rgba(0,0,0,.87)}.light-blue-bg{background-color:#03a9f4!important}.light-blue-fg{color:#03a9f4!important}.light-blue-border{border-color:#03a9f4!important}.light-blue-border-top{border-top-color:#03a9f4!important}.light-blue-border-right{border-right-color:#03a9f4!important}.light-blue-border-bottom{border-bottom-color:#03a9f4!important}.light-blue-border-left{border-left-color:#03a9f4!important}.light-blue-600-bg{background-color:#039be5!important}.md-light-blue-600-bg{background-color:#039be5!important;color:#fff}.light-blue-600-fg{color:#039be5!important}.light-blue-600-border{border-color:#039be5!important}.light-blue-600-border-top{border-top-color:#039be5!important}.light-blue-600-border-right{border-right-color:#039be5!important}.light-blue-600-border-bottom{border-bottom-color:#039be5!important}.light-blue-600-border-left{border-left-color:#039be5!important}.light-blue-700-bg{background-color:#0288d1!important}.md-light-blue-700-bg{background-color:#0288d1!important;color:#fff}.light-blue-700-fg{color:#0288d1!important}.light-blue-700-border{border-color:#0288d1!important}.light-blue-700-border-top{border-top-color:#0288d1!important}.light-blue-700-border-right{border-right-color:#0288d1!important}.light-blue-700-border-bottom{border-bottom-color:#0288d1!important}.light-blue-700-border-left{border-left-color:#0288d1!important}.light-blue-800-bg{background-color:#0277bd!important}.md-light-blue-800-bg{background-color:#0277bd!important;color:#fff}.light-blue-800-fg{color:#0277bd!important}.light-blue-800-border{border-color:#0277bd!important}.light-blue-800-border-top{border-top-color:#0277bd!important}.light-blue-800-border-right{border-right-color:#0277bd!important}.light-blue-800-border-bottom{border-bottom-color:#0277bd!important}.light-blue-800-border-left{border-left-color:#0277bd!important}.light-blue-900-bg{background-color:#01579b!important}.md-light-blue-900-bg{background-color:#01579b!important;color:#fff}.light-blue-900-fg{color:#01579b!important}.light-blue-900-border{border-color:#01579b!important}.light-blue-900-border-top{border-top-color:#01579b!important}.light-blue-900-border-right{border-right-color:#01579b!important}.light-blue-900-border-bottom{border-bottom-color:#01579b!important}.light-blue-900-border-left{border-left-color:#01579b!important}.light-blue-A100-bg{background-color:#80d8ff!important}.md-light-blue-A100-bg{background-color:#80d8ff!important;color:rgba(0,0,0,.87)}.light-blue-A100-fg{color:#80d8ff!important}.light-blue-A100-border{border-color:#80d8ff!important}.light-blue-A100-border-top{border-top-color:#80d8ff!important}.light-blue-A100-border-right{border-right-color:#80d8ff!important}.light-blue-A100-border-bottom{border-bottom-color:#80d8ff!important}.light-blue-A100-border-left{border-left-color:#80d8ff!important}.light-blue-A200-bg{background-color:#40c4ff!important}.md-light-blue-A200-bg{background-color:#40c4ff!important;color:rgba(0,0,0,.87)}.light-blue-A200-fg{color:#40c4ff!important}.light-blue-A200-border{border-color:#40c4ff!important}.light-blue-A200-border-top{border-top-color:#40c4ff!important}.light-blue-A200-border-right{border-right-color:#40c4ff!important}.light-blue-A200-border-bottom{border-bottom-color:#40c4ff!important}.light-blue-A200-border-left{border-left-color:#40c4ff!important}.light-blue-A400-bg{background-color:#00b0ff!important}.md-light-blue-A400-bg{background-color:#00b0ff!important;color:rgba(0,0,0,.87)}.light-blue-A400-fg{color:#00b0ff!important}.light-blue-A400-border{border-color:#00b0ff!important}.light-blue-A400-border-top{border-top-color:#00b0ff!important}.light-blue-A400-border-right{border-right-color:#00b0ff!important}.light-blue-A400-border-bottom{border-bottom-color:#00b0ff!important}.light-blue-A400-border-left{border-left-color:#00b0ff!important}.light-blue-A700-bg{background-color:#0091ea!important}.md-light-blue-A700-bg{background-color:#0091ea!important;color:#fff}.light-blue-A700-fg{color:#0091ea!important}.light-blue-A700-border{border-color:#0091ea!important}.light-blue-A700-border-top{border-top-color:#0091ea!important}.light-blue-A700-border-right{border-right-color:#0091ea!important}.light-blue-A700-border-bottom{border-bottom-color:#0091ea!important}.light-blue-A700-border-left{border-left-color:#0091ea!important}.cyan-50-bg{background-color:#e0f7fa!important}.md-cyan-50-bg{background-color:#e0f7fa!important;color:rgba(0,0,0,.87)}.cyan-50-fg{color:#e0f7fa!important}.cyan-50-border{border-color:#e0f7fa!important}.cyan-50-border-top{border-top-color:#e0f7fa!important}.cyan-50-border-right{border-right-color:#e0f7fa!important}.cyan-50-border-bottom{border-bottom-color:#e0f7fa!important}.cyan-50-border-left{border-left-color:#e0f7fa!important}.cyan-100-bg{background-color:#b2ebf2!important}.md-cyan-100-bg{background-color:#b2ebf2!important;color:rgba(0,0,0,.87)}.cyan-100-fg{color:#b2ebf2!important}.cyan-100-border{border-color:#b2ebf2!important}.cyan-100-border-top{border-top-color:#b2ebf2!important}.cyan-100-border-right{border-right-color:#b2ebf2!important}.cyan-100-border-bottom{border-bottom-color:#b2ebf2!important}.cyan-100-border-left{border-left-color:#b2ebf2!important}.cyan-200-bg{background-color:#80deea!important}.md-cyan-200-bg{background-color:#80deea!important;color:rgba(0,0,0,.87)}.cyan-200-fg{color:#80deea!important}.cyan-200-border{border-color:#80deea!important}.cyan-200-border-top{border-top-color:#80deea!important}.cyan-200-border-right{border-right-color:#80deea!important}.cyan-200-border-bottom{border-bottom-color:#80deea!important}.cyan-200-border-left{border-left-color:#80deea!important}.cyan-300-bg{background-color:#4dd0e1!important}.md-cyan-300-bg{background-color:#4dd0e1!important;color:rgba(0,0,0,.87)}.cyan-300-fg{color:#4dd0e1!important}.cyan-300-border{border-color:#4dd0e1!important}.cyan-300-border-top{border-top-color:#4dd0e1!important}.cyan-300-border-right{border-right-color:#4dd0e1!important}.cyan-300-border-bottom{border-bottom-color:#4dd0e1!important}.cyan-300-border-left{border-left-color:#4dd0e1!important}.cyan-400-bg{background-color:#26c6da!important}.md-cyan-400-bg{background-color:#26c6da!important;color:rgba(0,0,0,.87)}.cyan-400-fg{color:#26c6da!important}.cyan-400-border{border-color:#26c6da!important}.cyan-400-border-top{border-top-color:#26c6da!important}.cyan-400-border-right{border-right-color:#26c6da!important}.cyan-400-border-bottom{border-bottom-color:#26c6da!important}.cyan-400-border-left{border-left-color:#26c6da!important}.cyan-500-bg{background-color:#00bcd4!important}.md-cyan-500-bg{background-color:#00bcd4!important;color:rgba(0,0,0,.87)}.cyan-500-fg{color:#00bcd4!important}.cyan-500-border{border-color:#00bcd4!important}.cyan-500-border-top{border-top-color:#00bcd4!important}.cyan-500-border-right{border-right-color:#00bcd4!important}.cyan-500-border-bottom{border-bottom-color:#00bcd4!important}.cyan-500-border-left{border-left-color:#00bcd4!important}.md-cyan-bg{background-color:#00bcd4!important;color:rgba(0,0,0,.87)}.cyan-bg{background-color:#00bcd4!important}.cyan-fg{color:#00bcd4!important}.cyan-border{border-color:#00bcd4!important}.cyan-border-top{border-top-color:#00bcd4!important}.cyan-border-right{border-right-color:#00bcd4!important}.cyan-border-bottom{border-bottom-color:#00bcd4!important}.cyan-border-left{border-left-color:#00bcd4!important}.cyan-600-bg{background-color:#00acc1!important}.md-cyan-600-bg{background-color:#00acc1!important;color:rgba(0,0,0,.87)}.cyan-600-fg{color:#00acc1!important}.cyan-600-border{border-color:#00acc1!important}.cyan-600-border-top{border-top-color:#00acc1!important}.cyan-600-border-right{border-right-color:#00acc1!important}.cyan-600-border-bottom{border-bottom-color:#00acc1!important}.cyan-600-border-left{border-left-color:#00acc1!important}.cyan-700-bg{background-color:#0097a7!important}.md-cyan-700-bg{background-color:#0097a7!important;color:#fff}.cyan-700-fg{color:#0097a7!important}.cyan-700-border{border-color:#0097a7!important}.cyan-700-border-top{border-top-color:#0097a7!important}.cyan-700-border-right{border-right-color:#0097a7!important}.cyan-700-border-bottom{border-bottom-color:#0097a7!important}.cyan-700-border-left{border-left-color:#0097a7!important}.cyan-800-bg{background-color:#00838f!important}.md-cyan-800-bg{background-color:#00838f!important;color:#fff}.cyan-800-fg{color:#00838f!important}.cyan-800-border{border-color:#00838f!important}.cyan-800-border-top{border-top-color:#00838f!important}.cyan-800-border-right{border-right-color:#00838f!important}.cyan-800-border-bottom{border-bottom-color:#00838f!important}.cyan-800-border-left{border-left-color:#00838f!important}.cyan-900-bg{background-color:#006064!important}.md-cyan-900-bg{background-color:#006064!important;color:#fff}.cyan-900-fg{color:#006064!important}.cyan-900-border{border-color:#006064!important}.cyan-900-border-top{border-top-color:#006064!important}.cyan-900-border-right{border-right-color:#006064!important}.cyan-900-border-bottom{border-bottom-color:#006064!important}.cyan-900-border-left{border-left-color:#006064!important}.cyan-A100-bg{background-color:#84ffff!important}.md-cyan-A100-bg{background-color:#84ffff!important;color:rgba(0,0,0,.87)}.cyan-A100-fg{color:#84ffff!important}.cyan-A100-border{border-color:#84ffff!important}.cyan-A100-border-top{border-top-color:#84ffff!important}.cyan-A100-border-right{border-right-color:#84ffff!important}.cyan-A100-border-bottom{border-bottom-color:#84ffff!important}.cyan-A100-border-left{border-left-color:#84ffff!important}.cyan-A200-bg{background-color:#18ffff!important}.md-cyan-A200-bg{background-color:#18ffff!important;color:rgba(0,0,0,.87)}.cyan-A200-fg{color:#18ffff!important}.cyan-A200-border{border-color:#18ffff!important}.cyan-A200-border-top{border-top-color:#18ffff!important}.cyan-A200-border-right{border-right-color:#18ffff!important}.cyan-A200-border-bottom{border-bottom-color:#18ffff!important}.cyan-A200-border-left{border-left-color:#18ffff!important}.cyan-A400-bg{background-color:#00e5ff!important}.md-cyan-A400-bg{background-color:#00e5ff!important;color:rgba(0,0,0,.87)}.cyan-A400-fg{color:#00e5ff!important}.cyan-A400-border{border-color:#00e5ff!important}.cyan-A400-border-top{border-top-color:#00e5ff!important}.cyan-A400-border-right{border-right-color:#00e5ff!important}.cyan-A400-border-bottom{border-bottom-color:#00e5ff!important}.cyan-A400-border-left{border-left-color:#00e5ff!important}.cyan-A700-bg{background-color:#00b8d4!important}.md-cyan-A700-bg{background-color:#00b8d4!important;color:rgba(0,0,0,.87)}.cyan-A700-fg{color:#00b8d4!important}.cyan-A700-border{border-color:#00b8d4!important}.cyan-A700-border-top{border-top-color:#00b8d4!important}.cyan-A700-border-right{border-right-color:#00b8d4!important}.cyan-A700-border-bottom{border-bottom-color:#00b8d4!important}.cyan-A700-border-left{border-left-color:#00b8d4!important}.teal-50-bg{background-color:#e0f2f1!important}.md-teal-50-bg{background-color:#e0f2f1!important;color:rgba(0,0,0,.87)}.teal-50-fg{color:#e0f2f1!important}.teal-50-border{border-color:#e0f2f1!important}.teal-50-border-top{border-top-color:#e0f2f1!important}.teal-50-border-right{border-right-color:#e0f2f1!important}.teal-50-border-bottom{border-bottom-color:#e0f2f1!important}.teal-50-border-left{border-left-color:#e0f2f1!important}.teal-100-bg{background-color:#b2dfdb!important}.md-teal-100-bg{background-color:#b2dfdb!important;color:rgba(0,0,0,.87)}.teal-100-fg{color:#b2dfdb!important}.teal-100-border{border-color:#b2dfdb!important}.teal-100-border-top{border-top-color:#b2dfdb!important}.teal-100-border-right{border-right-color:#b2dfdb!important}.teal-100-border-bottom{border-bottom-color:#b2dfdb!important}.teal-100-border-left{border-left-color:#b2dfdb!important}.teal-200-bg{background-color:#80cbc4!important}.md-teal-200-bg{background-color:#80cbc4!important;color:rgba(0,0,0,.87)}.teal-200-fg{color:#80cbc4!important}.teal-200-border{border-color:#80cbc4!important}.teal-200-border-top{border-top-color:#80cbc4!important}.teal-200-border-right{border-right-color:#80cbc4!important}.teal-200-border-bottom{border-bottom-color:#80cbc4!important}.teal-200-border-left{border-left-color:#80cbc4!important}.teal-300-bg{background-color:#4db6ac!important}.md-teal-300-bg{background-color:#4db6ac!important;color:rgba(0,0,0,.87)}.teal-300-fg{color:#4db6ac!important}.teal-300-border{border-color:#4db6ac!important}.teal-300-border-top{border-top-color:#4db6ac!important}.teal-300-border-right{border-right-color:#4db6ac!important}.teal-300-border-bottom{border-bottom-color:#4db6ac!important}.teal-300-border-left{border-left-color:#4db6ac!important}.teal-400-bg{background-color:#26a69a!important}.md-teal-400-bg{background-color:#26a69a!important;color:rgba(0,0,0,.87)}.teal-400-fg{color:#26a69a!important}.teal-400-border{border-color:#26a69a!important}.teal-400-border-top{border-top-color:#26a69a!important}.teal-400-border-right{border-right-color:#26a69a!important}.teal-400-border-bottom{border-bottom-color:#26a69a!important}.teal-400-border-left{border-left-color:#26a69a!important}.teal-500-bg{background-color:#009688!important}.md-teal-500-bg{background-color:#009688!important;color:#fff}.teal-500-fg{color:#009688!important}.teal-500-border{border-color:#009688!important}.teal-500-border-top{border-top-color:#009688!important}.teal-500-border-right{border-right-color:#009688!important}.teal-500-border-bottom{border-bottom-color:#009688!important}.teal-500-border-left{border-left-color:#009688!important}.md-teal-bg{background-color:#009688!important;color:#fff}.teal-bg{background-color:#009688!important}.teal-fg{color:#009688!important}.teal-border{border-color:#009688!important}.teal-border-top{border-top-color:#009688!important}.teal-border-right{border-right-color:#009688!important}.teal-border-bottom{border-bottom-color:#009688!important}.teal-border-left{border-left-color:#009688!important}.teal-600-bg{background-color:#00897b!important}.md-teal-600-bg{background-color:#00897b!important;color:#fff}.teal-600-fg{color:#00897b!important}.teal-600-border{border-color:#00897b!important}.teal-600-border-top{border-top-color:#00897b!important}.teal-600-border-right{border-right-color:#00897b!important}.teal-600-border-bottom{border-bottom-color:#00897b!important}.teal-600-border-left{border-left-color:#00897b!important}.teal-700-bg{background-color:#00796b!important}.md-teal-700-bg{background-color:#00796b!important;color:#fff}.teal-700-fg{color:#00796b!important}.teal-700-border{border-color:#00796b!important}.teal-700-border-top{border-top-color:#00796b!important}.teal-700-border-right{border-right-color:#00796b!important}.teal-700-border-bottom{border-bottom-color:#00796b!important}.teal-700-border-left{border-left-color:#00796b!important}.teal-800-bg{background-color:#00695c!important}.md-teal-800-bg{background-color:#00695c!important;color:rgba(255,255,255,.87)}.teal-800-fg{color:#00695c!important}.teal-800-border{border-color:#00695c!important}.teal-800-border-top{border-top-color:#00695c!important}.teal-800-border-right{border-right-color:#00695c!important}.teal-800-border-bottom{border-bottom-color:#00695c!important}.teal-800-border-left{border-left-color:#00695c!important}.teal-900-bg{background-color:#004d40!important}.md-teal-900-bg{background-color:#004d40!important;color:rgba(255,255,255,.87)}.teal-900-fg{color:#004d40!important}.teal-900-border{border-color:#004d40!important}.teal-900-border-top{border-top-color:#004d40!important}.teal-900-border-right{border-right-color:#004d40!important}.teal-900-border-bottom{border-bottom-color:#004d40!important}.teal-900-border-left{border-left-color:#004d40!important}.teal-A100-bg{background-color:#a7ffeb!important}.md-teal-A100-bg{background-color:#a7ffeb!important;color:rgba(0,0,0,.87)}.teal-A100-fg{color:#a7ffeb!important}.teal-A100-border{border-color:#a7ffeb!important}.teal-A100-border-top{border-top-color:#a7ffeb!important}.teal-A100-border-right{border-right-color:#a7ffeb!important}.teal-A100-border-bottom{border-bottom-color:#a7ffeb!important}.teal-A100-border-left{border-left-color:#a7ffeb!important}.teal-A200-bg{background-color:#64ffda!important}.md-teal-A200-bg{background-color:#64ffda!important;color:rgba(0,0,0,.87)}.teal-A200-fg{color:#64ffda!important}.teal-A200-border{border-color:#64ffda!important}.teal-A200-border-top{border-top-color:#64ffda!important}.teal-A200-border-right{border-right-color:#64ffda!important}.teal-A200-border-bottom{border-bottom-color:#64ffda!important}.teal-A200-border-left{border-left-color:#64ffda!important}.teal-A400-bg{background-color:#1de9b6!important}.md-teal-A400-bg{background-color:#1de9b6!important;color:rgba(0,0,0,.87)}.teal-A400-fg{color:#1de9b6!important}.teal-A400-border{border-color:#1de9b6!important}.teal-A400-border-top{border-top-color:#1de9b6!important}.teal-A400-border-right{border-right-color:#1de9b6!important}.teal-A400-border-bottom{border-bottom-color:#1de9b6!important}.teal-A400-border-left{border-left-color:#1de9b6!important}.teal-A700-bg{background-color:#00bfa5!important}.md-teal-A700-bg{background-color:#00bfa5!important;color:rgba(0,0,0,.87)}.teal-A700-fg{color:#00bfa5!important}.teal-A700-border{border-color:#00bfa5!important}.teal-A700-border-top{border-top-color:#00bfa5!important}.teal-A700-border-right{border-right-color:#00bfa5!important}.teal-A700-border-bottom{border-bottom-color:#00bfa5!important}.teal-A700-border-left{border-left-color:#00bfa5!important}.green-50-bg{background-color:#e8f5e9!important}.md-green-50-bg{background-color:#e8f5e9!important;color:rgba(0,0,0,.87)}.green-50-fg{color:#e8f5e9!important}.green-50-border{border-color:#e8f5e9!important}.green-50-border-top{border-top-color:#e8f5e9!important}.green-50-border-right{border-right-color:#e8f5e9!important}.green-50-border-bottom{border-bottom-color:#e8f5e9!important}.green-50-border-left{border-left-color:#e8f5e9!important}.green-100-bg{background-color:#c8e6c9!important}.md-green-100-bg{background-color:#c8e6c9!important;color:rgba(0,0,0,.87)}.green-100-fg{color:#c8e6c9!important}.green-100-border{border-color:#c8e6c9!important}.green-100-border-top{border-top-color:#c8e6c9!important}.green-100-border-right{border-right-color:#c8e6c9!important}.green-100-border-bottom{border-bottom-color:#c8e6c9!important}.green-100-border-left{border-left-color:#c8e6c9!important}.green-200-bg{background-color:#a5d6a7!important}.md-green-200-bg{background-color:#a5d6a7!important;color:rgba(0,0,0,.87)}.green-200-fg{color:#a5d6a7!important}.green-200-border{border-color:#a5d6a7!important}.green-200-border-top{border-top-color:#a5d6a7!important}.green-200-border-right{border-right-color:#a5d6a7!important}.green-200-border-bottom{border-bottom-color:#a5d6a7!important}.green-200-border-left{border-left-color:#a5d6a7!important}.green-300-bg{background-color:#81c784!important}.md-green-300-bg{background-color:#81c784!important;color:rgba(0,0,0,.87)}.green-300-fg{color:#81c784!important}.green-300-border{border-color:#81c784!important}.green-300-border-top{border-top-color:#81c784!important}.green-300-border-right{border-right-color:#81c784!important}.green-300-border-bottom{border-bottom-color:#81c784!important}.green-300-border-left{border-left-color:#81c784!important}.green-400-bg{background-color:#66bb6a!important}.md-green-400-bg{background-color:#66bb6a!important;color:rgba(0,0,0,.87)}.green-400-fg{color:#66bb6a!important}.green-400-border{border-color:#66bb6a!important}.green-400-border-top{border-top-color:#66bb6a!important}.green-400-border-right{border-right-color:#66bb6a!important}.green-400-border-bottom{border-bottom-color:#66bb6a!important}.green-400-border-left{border-left-color:#66bb6a!important}.green-500-bg{background-color:#4caf50!important}.md-green-500-bg{background-color:#4caf50!important;color:rgba(0,0,0,.87)}.green-500-fg{color:#4caf50!important}.green-500-border{border-color:#4caf50!important}.green-500-border-top{border-top-color:#4caf50!important}.green-500-border-right{border-right-color:#4caf50!important}.green-500-border-bottom{border-bottom-color:#4caf50!important}.green-500-border-left{border-left-color:#4caf50!important}.md-green-bg{background-color:#4caf50!important;color:rgba(0,0,0,.87)}.green-bg{background-color:#4caf50!important}.green-fg{color:#4caf50!important}.green-border{border-color:#4caf50!important}.green-border-top{border-top-color:#4caf50!important}.green-border-right{border-right-color:#4caf50!important}.green-border-bottom{border-bottom-color:#4caf50!important}.green-border-left{border-left-color:#4caf50!important}.green-600-bg{background-color:#43a047!important}.md-green-600-bg{background-color:#43a047!important;color:#fff}.green-600-fg{color:#43a047!important}.green-600-border{border-color:#43a047!important}.green-600-border-top{border-top-color:#43a047!important}.green-600-border-right{border-right-color:#43a047!important}.green-600-border-bottom{border-bottom-color:#43a047!important}.green-600-border-left{border-left-color:#43a047!important}.green-700-bg{background-color:#388e3c!important}.md-green-700-bg{background-color:#388e3c!important;color:#fff}.green-700-fg{color:#388e3c!important}.green-700-border{border-color:#388e3c!important}.green-700-border-top{border-top-color:#388e3c!important}.green-700-border-right{border-right-color:#388e3c!important}.green-700-border-bottom{border-bottom-color:#388e3c!important}.green-700-border-left{border-left-color:#388e3c!important}.green-800-bg{background-color:#2e7d32!important}.md-green-800-bg{background-color:#2e7d32!important;color:rgba(255,255,255,.87)}.green-800-fg{color:#2e7d32!important}.green-800-border{border-color:#2e7d32!important}.green-800-border-top{border-top-color:#2e7d32!important}.green-800-border-right{border-right-color:#2e7d32!important}.green-800-border-bottom{border-bottom-color:#2e7d32!important}.green-800-border-left{border-left-color:#2e7d32!important}.green-900-bg{background-color:#1b5e20!important}.md-green-900-bg{background-color:#1b5e20!important;color:rgba(255,255,255,.87)}.green-900-fg{color:#1b5e20!important}.green-900-border{border-color:#1b5e20!important}.green-900-border-top{border-top-color:#1b5e20!important}.green-900-border-right{border-right-color:#1b5e20!important}.green-900-border-bottom{border-bottom-color:#1b5e20!important}.green-900-border-left{border-left-color:#1b5e20!important}.green-A100-bg{background-color:#b9f6ca!important}.md-green-A100-bg{background-color:#b9f6ca!important;color:rgba(0,0,0,.87)}.green-A100-fg{color:#b9f6ca!important}.green-A100-border{border-color:#b9f6ca!important}.green-A100-border-top{border-top-color:#b9f6ca!important}.green-A100-border-right{border-right-color:#b9f6ca!important}.green-A100-border-bottom{border-bottom-color:#b9f6ca!important}.green-A100-border-left{border-left-color:#b9f6ca!important}.green-A200-bg{background-color:#69f0ae!important}.md-green-A200-bg{background-color:#69f0ae!important;color:rgba(0,0,0,.87)}.green-A200-fg{color:#69f0ae!important}.green-A200-border{border-color:#69f0ae!important}.green-A200-border-top{border-top-color:#69f0ae!important}.green-A200-border-right{border-right-color:#69f0ae!important}.green-A200-border-bottom{border-bottom-color:#69f0ae!important}.green-A200-border-left{border-left-color:#69f0ae!important}.green-A400-bg{background-color:#00e676!important}.md-green-A400-bg{background-color:#00e676!important;color:rgba(0,0,0,.87)}.green-A400-fg{color:#00e676!important}.green-A400-border{border-color:#00e676!important}.green-A400-border-top{border-top-color:#00e676!important}.green-A400-border-right{border-right-color:#00e676!important}.green-A400-border-bottom{border-bottom-color:#00e676!important}.green-A400-border-left{border-left-color:#00e676!important}.green-A700-bg{background-color:#00c853!important}.md-green-A700-bg{background-color:#00c853!important;color:rgba(0,0,0,.87)}.green-A700-fg{color:#00c853!important}.green-A700-border{border-color:#00c853!important}.green-A700-border-top{border-top-color:#00c853!important}.green-A700-border-right{border-right-color:#00c853!important}.green-A700-border-bottom{border-bottom-color:#00c853!important}.green-A700-border-left{border-left-color:#00c853!important}.light-green-50-bg{background-color:#f1f8e9!important}.md-light-green-50-bg{background-color:#f1f8e9!important;color:rgba(0,0,0,.87)}.light-green-50-fg{color:#f1f8e9!important}.light-green-50-border{border-color:#f1f8e9!important}.light-green-50-border-top{border-top-color:#f1f8e9!important}.light-green-50-border-right{border-right-color:#f1f8e9!important}.light-green-50-border-bottom{border-bottom-color:#f1f8e9!important}.light-green-50-border-left{border-left-color:#f1f8e9!important}.light-green-100-bg{background-color:#dcedc8!important}.md-light-green-100-bg{background-color:#dcedc8!important;color:rgba(0,0,0,.87)}.light-green-100-fg{color:#dcedc8!important}.light-green-100-border{border-color:#dcedc8!important}.light-green-100-border-top{border-top-color:#dcedc8!important}.light-green-100-border-right{border-right-color:#dcedc8!important}.light-green-100-border-bottom{border-bottom-color:#dcedc8!important}.light-green-100-border-left{border-left-color:#dcedc8!important}.light-green-200-bg{background-color:#c5e1a5!important}.md-light-green-200-bg{background-color:#c5e1a5!important;color:rgba(0,0,0,.87)}.light-green-200-fg{color:#c5e1a5!important}.light-green-200-border{border-color:#c5e1a5!important}.light-green-200-border-top{border-top-color:#c5e1a5!important}.light-green-200-border-right{border-right-color:#c5e1a5!important}.light-green-200-border-bottom{border-bottom-color:#c5e1a5!important}.light-green-200-border-left{border-left-color:#c5e1a5!important}.light-green-300-bg{background-color:#aed581!important}.md-light-green-300-bg{background-color:#aed581!important;color:rgba(0,0,0,.87)}.light-green-300-fg{color:#aed581!important}.light-green-300-border{border-color:#aed581!important}.light-green-300-border-top{border-top-color:#aed581!important}.light-green-300-border-right{border-right-color:#aed581!important}.light-green-300-border-bottom{border-bottom-color:#aed581!important}.light-green-300-border-left{border-left-color:#aed581!important}.light-green-400-bg{background-color:#9ccc65!important}.md-light-green-400-bg{background-color:#9ccc65!important;color:rgba(0,0,0,.87)}.light-green-400-fg{color:#9ccc65!important}.light-green-400-border{border-color:#9ccc65!important}.light-green-400-border-top{border-top-color:#9ccc65!important}.light-green-400-border-right{border-right-color:#9ccc65!important}.light-green-400-border-bottom{border-bottom-color:#9ccc65!important}.light-green-400-border-left{border-left-color:#9ccc65!important}.light-green-500-bg{background-color:#8bc34a!important}.md-light-green-500-bg{background-color:#8bc34a!important;color:rgba(0,0,0,.87)}.light-green-500-fg{color:#8bc34a!important}.light-green-500-border{border-color:#8bc34a!important}.light-green-500-border-top{border-top-color:#8bc34a!important}.light-green-500-border-right{border-right-color:#8bc34a!important}.light-green-500-border-bottom{border-bottom-color:#8bc34a!important}.light-green-500-border-left{border-left-color:#8bc34a!important}.md-light-green-bg{background-color:#8bc34a!important;color:rgba(0,0,0,.87)}.light-green-bg{background-color:#8bc34a!important}.light-green-fg{color:#8bc34a!important}.light-green-border{border-color:#8bc34a!important}.light-green-border-top{border-top-color:#8bc34a!important}.light-green-border-right{border-right-color:#8bc34a!important}.light-green-border-bottom{border-bottom-color:#8bc34a!important}.light-green-border-left{border-left-color:#8bc34a!important}.light-green-600-bg{background-color:#7cb342!important}.md-light-green-600-bg{background-color:#7cb342!important;color:rgba(0,0,0,.87)}.light-green-600-fg{color:#7cb342!important}.light-green-600-border{border-color:#7cb342!important}.light-green-600-border-top{border-top-color:#7cb342!important}.light-green-600-border-right{border-right-color:#7cb342!important}.light-green-600-border-bottom{border-bottom-color:#7cb342!important}.light-green-600-border-left{border-left-color:#7cb342!important}.light-green-700-bg{background-color:#689f38!important}.md-light-green-700-bg{background-color:#689f38!important;color:#fff}.light-green-700-fg{color:#689f38!important}.light-green-700-border{border-color:#689f38!important}.light-green-700-border-top{border-top-color:#689f38!important}.light-green-700-border-right{border-right-color:#689f38!important}.light-green-700-border-bottom{border-bottom-color:#689f38!important}.light-green-700-border-left{border-left-color:#689f38!important}.light-green-800-bg{background-color:#558b2f!important}.md-light-green-800-bg{background-color:#558b2f!important;color:#fff}.light-green-800-fg{color:#558b2f!important}.light-green-800-border{border-color:#558b2f!important}.light-green-800-border-top{border-top-color:#558b2f!important}.light-green-800-border-right{border-right-color:#558b2f!important}.light-green-800-border-bottom{border-bottom-color:#558b2f!important}.light-green-800-border-left{border-left-color:#558b2f!important}.light-green-900-bg{background-color:#33691e!important}.md-light-green-900-bg{background-color:#33691e!important;color:#fff}.light-green-900-fg{color:#33691e!important}.light-green-900-border{border-color:#33691e!important}.light-green-900-border-top{border-top-color:#33691e!important}.light-green-900-border-right{border-right-color:#33691e!important}.light-green-900-border-bottom{border-bottom-color:#33691e!important}.light-green-900-border-left{border-left-color:#33691e!important}.light-green-A100-bg{background-color:#ccff90!important}.md-light-green-A100-bg{background-color:#ccff90!important;color:rgba(0,0,0,.87)}.light-green-A100-fg{color:#ccff90!important}.light-green-A100-border{border-color:#ccff90!important}.light-green-A100-border-top{border-top-color:#ccff90!important}.light-green-A100-border-right{border-right-color:#ccff90!important}.light-green-A100-border-bottom{border-bottom-color:#ccff90!important}.light-green-A100-border-left{border-left-color:#ccff90!important}.light-green-A200-bg{background-color:#b2ff59!important}.md-light-green-A200-bg{background-color:#b2ff59!important;color:rgba(0,0,0,.87)}.light-green-A200-fg{color:#b2ff59!important}.light-green-A200-border{border-color:#b2ff59!important}.light-green-A200-border-top{border-top-color:#b2ff59!important}.light-green-A200-border-right{border-right-color:#b2ff59!important}.light-green-A200-border-bottom{border-bottom-color:#b2ff59!important}.light-green-A200-border-left{border-left-color:#b2ff59!important}.light-green-A400-bg{background-color:#76ff03!important}.md-light-green-A400-bg{background-color:#76ff03!important;color:rgba(0,0,0,.87)}.light-green-A400-fg{color:#76ff03!important}.light-green-A400-border{border-color:#76ff03!important}.light-green-A400-border-top{border-top-color:#76ff03!important}.light-green-A400-border-right{border-right-color:#76ff03!important}.light-green-A400-border-bottom{border-bottom-color:#76ff03!important}.light-green-A400-border-left{border-left-color:#76ff03!important}.light-green-A700-bg{background-color:#64dd17!important}.md-light-green-A700-bg{background-color:#64dd17!important;color:rgba(0,0,0,.87)}.light-green-A700-fg{color:#64dd17!important}.light-green-A700-border{border-color:#64dd17!important}.light-green-A700-border-top{border-top-color:#64dd17!important}.light-green-A700-border-right{border-right-color:#64dd17!important}.light-green-A700-border-bottom{border-bottom-color:#64dd17!important}.light-green-A700-border-left{border-left-color:#64dd17!important}.lime-50-bg{background-color:#f9fbe7!important}.md-lime-50-bg{background-color:#f9fbe7!important;color:rgba(0,0,0,.87)}.lime-50-fg{color:#f9fbe7!important}.lime-50-border{border-color:#f9fbe7!important}.lime-50-border-top{border-top-color:#f9fbe7!important}.lime-50-border-right{border-right-color:#f9fbe7!important}.lime-50-border-bottom{border-bottom-color:#f9fbe7!important}.lime-50-border-left{border-left-color:#f9fbe7!important}.lime-100-bg{background-color:#f0f4c3!important}.md-lime-100-bg{background-color:#f0f4c3!important;color:rgba(0,0,0,.87)}.lime-100-fg{color:#f0f4c3!important}.lime-100-border{border-color:#f0f4c3!important}.lime-100-border-top{border-top-color:#f0f4c3!important}.lime-100-border-right{border-right-color:#f0f4c3!important}.lime-100-border-bottom{border-bottom-color:#f0f4c3!important}.lime-100-border-left{border-left-color:#f0f4c3!important}.lime-200-bg{background-color:#e6ee9c!important}.md-lime-200-bg{background-color:#e6ee9c!important;color:rgba(0,0,0,.87)}.lime-200-fg{color:#e6ee9c!important}.lime-200-border{border-color:#e6ee9c!important}.lime-200-border-top{border-top-color:#e6ee9c!important}.lime-200-border-right{border-right-color:#e6ee9c!important}.lime-200-border-bottom{border-bottom-color:#e6ee9c!important}.lime-200-border-left{border-left-color:#e6ee9c!important}.lime-300-bg{background-color:#dce775!important}.md-lime-300-bg{background-color:#dce775!important;color:rgba(0,0,0,.87)}.lime-300-fg{color:#dce775!important}.lime-300-border{border-color:#dce775!important}.lime-300-border-top{border-top-color:#dce775!important}.lime-300-border-right{border-right-color:#dce775!important}.lime-300-border-bottom{border-bottom-color:#dce775!important}.lime-300-border-left{border-left-color:#dce775!important}.lime-400-bg{background-color:#d4e157!important}.md-lime-400-bg{background-color:#d4e157!important;color:rgba(0,0,0,.87)}.lime-400-fg{color:#d4e157!important}.lime-400-border{border-color:#d4e157!important}.lime-400-border-top{border-top-color:#d4e157!important}.lime-400-border-right{border-right-color:#d4e157!important}.lime-400-border-bottom{border-bottom-color:#d4e157!important}.lime-400-border-left{border-left-color:#d4e157!important}.lime-500-bg{background-color:#cddc39!important}.md-lime-500-bg{background-color:#cddc39!important;color:rgba(0,0,0,.87)}.lime-500-fg{color:#cddc39!important}.lime-500-border{border-color:#cddc39!important}.lime-500-border-top{border-top-color:#cddc39!important}.lime-500-border-right{border-right-color:#cddc39!important}.lime-500-border-bottom{border-bottom-color:#cddc39!important}.lime-500-border-left{border-left-color:#cddc39!important}.md-lime-bg{background-color:#cddc39!important;color:rgba(0,0,0,.87)}.lime-bg{background-color:#cddc39!important}.lime-fg{color:#cddc39!important}.lime-border{border-color:#cddc39!important}.lime-border-top{border-top-color:#cddc39!important}.lime-border-right{border-right-color:#cddc39!important}.lime-border-bottom{border-bottom-color:#cddc39!important}.lime-border-left{border-left-color:#cddc39!important}.lime-600-bg{background-color:#c0ca33!important}.md-lime-600-bg{background-color:#c0ca33!important;color:rgba(0,0,0,.87)}.lime-600-fg{color:#c0ca33!important}.lime-600-border{border-color:#c0ca33!important}.lime-600-border-top{border-top-color:#c0ca33!important}.lime-600-border-right{border-right-color:#c0ca33!important}.lime-600-border-bottom{border-bottom-color:#c0ca33!important}.lime-600-border-left{border-left-color:#c0ca33!important}.lime-700-bg{background-color:#afb42b!important}.md-lime-700-bg{background-color:#afb42b!important;color:rgba(0,0,0,.87)}.lime-700-fg{color:#afb42b!important}.lime-700-border{border-color:#afb42b!important}.lime-700-border-top{border-top-color:#afb42b!important}.lime-700-border-right{border-right-color:#afb42b!important}.lime-700-border-bottom{border-bottom-color:#afb42b!important}.lime-700-border-left{border-left-color:#afb42b!important}.lime-800-bg{background-color:#9e9d24!important}.md-lime-800-bg{background-color:#9e9d24!important;color:rgba(0,0,0,.87)}.lime-800-fg{color:#9e9d24!important}.lime-800-border{border-color:#9e9d24!important}.lime-800-border-top{border-top-color:#9e9d24!important}.lime-800-border-right{border-right-color:#9e9d24!important}.lime-800-border-bottom{border-bottom-color:#9e9d24!important}.lime-800-border-left{border-left-color:#9e9d24!important}.lime-900-bg{background-color:#827717!important}.md-lime-900-bg{background-color:#827717!important;color:#fff}.lime-900-fg{color:#827717!important}.lime-900-border{border-color:#827717!important}.lime-900-border-top{border-top-color:#827717!important}.lime-900-border-right{border-right-color:#827717!important}.lime-900-border-bottom{border-bottom-color:#827717!important}.lime-900-border-left{border-left-color:#827717!important}.lime-A100-bg{background-color:#f4ff81!important}.md-lime-A100-bg{background-color:#f4ff81!important;color:rgba(0,0,0,.87)}.lime-A100-fg{color:#f4ff81!important}.lime-A100-border{border-color:#f4ff81!important}.lime-A100-border-top{border-top-color:#f4ff81!important}.lime-A100-border-right{border-right-color:#f4ff81!important}.lime-A100-border-bottom{border-bottom-color:#f4ff81!important}.lime-A100-border-left{border-left-color:#f4ff81!important}.lime-A200-bg{background-color:#eeff41!important}.md-lime-A200-bg{background-color:#eeff41!important;color:rgba(0,0,0,.87)}.lime-A200-fg{color:#eeff41!important}.lime-A200-border{border-color:#eeff41!important}.lime-A200-border-top{border-top-color:#eeff41!important}.lime-A200-border-right{border-right-color:#eeff41!important}.lime-A200-border-bottom{border-bottom-color:#eeff41!important}.lime-A200-border-left{border-left-color:#eeff41!important}.lime-A400-bg{background-color:#c6ff00!important}.md-lime-A400-bg{background-color:#c6ff00!important;color:rgba(0,0,0,.87)}.lime-A400-fg{color:#c6ff00!important}.lime-A400-border{border-color:#c6ff00!important}.lime-A400-border-top{border-top-color:#c6ff00!important}.lime-A400-border-right{border-right-color:#c6ff00!important}.lime-A400-border-bottom{border-bottom-color:#c6ff00!important}.lime-A400-border-left{border-left-color:#c6ff00!important}.lime-A700-bg{background-color:#aeea00!important}.md-lime-A700-bg{background-color:#aeea00!important;color:rgba(0,0,0,.87)}.lime-A700-fg{color:#aeea00!important}.lime-A700-border{border-color:#aeea00!important}.lime-A700-border-top{border-top-color:#aeea00!important}.lime-A700-border-right{border-right-color:#aeea00!important}.lime-A700-border-bottom{border-bottom-color:#aeea00!important}.lime-A700-border-left{border-left-color:#aeea00!important}.yellow-50-bg{background-color:#fffde7!important}.md-yellow-50-bg{background-color:#fffde7!important;color:rgba(0,0,0,.87)}.yellow-50-fg{color:#fffde7!important}.yellow-50-border{border-color:#fffde7!important}.yellow-50-border-top{border-top-color:#fffde7!important}.yellow-50-border-right{border-right-color:#fffde7!important}.yellow-50-border-bottom{border-bottom-color:#fffde7!important}.yellow-50-border-left{border-left-color:#fffde7!important}.yellow-100-bg{background-color:#fff9c4!important}.md-yellow-100-bg{background-color:#fff9c4!important;color:rgba(0,0,0,.87)}.yellow-100-fg{color:#fff9c4!important}.yellow-100-border{border-color:#fff9c4!important}.yellow-100-border-top{border-top-color:#fff9c4!important}.yellow-100-border-right{border-right-color:#fff9c4!important}.yellow-100-border-bottom{border-bottom-color:#fff9c4!important}.yellow-100-border-left{border-left-color:#fff9c4!important}.yellow-200-bg{background-color:#fff59d!important}.md-yellow-200-bg{background-color:#fff59d!important;color:rgba(0,0,0,.87)}.yellow-200-fg{color:#fff59d!important}.yellow-200-border{border-color:#fff59d!important}.yellow-200-border-top{border-top-color:#fff59d!important}.yellow-200-border-right{border-right-color:#fff59d!important}.yellow-200-border-bottom{border-bottom-color:#fff59d!important}.yellow-200-border-left{border-left-color:#fff59d!important}.yellow-300-bg{background-color:#fff176!important}.md-yellow-300-bg{background-color:#fff176!important;color:rgba(0,0,0,.87)}.yellow-300-fg{color:#fff176!important}.yellow-300-border{border-color:#fff176!important}.yellow-300-border-top{border-top-color:#fff176!important}.yellow-300-border-right{border-right-color:#fff176!important}.yellow-300-border-bottom{border-bottom-color:#fff176!important}.yellow-300-border-left{border-left-color:#fff176!important}.yellow-400-bg{background-color:#ffee58!important}.md-yellow-400-bg{background-color:#ffee58!important;color:rgba(0,0,0,.87)}.yellow-400-fg{color:#ffee58!important}.yellow-400-border{border-color:#ffee58!important}.yellow-400-border-top{border-top-color:#ffee58!important}.yellow-400-border-right{border-right-color:#ffee58!important}.yellow-400-border-bottom{border-bottom-color:#ffee58!important}.yellow-400-border-left{border-left-color:#ffee58!important}.yellow-500-bg{background-color:#ffeb3b!important}.md-yellow-500-bg{background-color:#ffeb3b!important;color:rgba(0,0,0,.87)}.yellow-500-fg{color:#ffeb3b!important}.yellow-500-border{border-color:#ffeb3b!important}.yellow-500-border-top{border-top-color:#ffeb3b!important}.yellow-500-border-right{border-right-color:#ffeb3b!important}.yellow-500-border-bottom{border-bottom-color:#ffeb3b!important}.yellow-500-border-left{border-left-color:#ffeb3b!important}.md-yellow-bg{background-color:#ffeb3b!important;color:rgba(0,0,0,.87)}.yellow-bg{background-color:#ffeb3b!important}.yellow-fg{color:#ffeb3b!important}.yellow-border{border-color:#ffeb3b!important}.yellow-border-top{border-top-color:#ffeb3b!important}.yellow-border-right{border-right-color:#ffeb3b!important}.yellow-border-bottom{border-bottom-color:#ffeb3b!important}.yellow-border-left{border-left-color:#ffeb3b!important}.yellow-600-bg{background-color:#fdd835!important}.md-yellow-600-bg{background-color:#fdd835!important;color:rgba(0,0,0,.87)}.yellow-600-fg{color:#fdd835!important}.yellow-600-border{border-color:#fdd835!important}.yellow-600-border-top{border-top-color:#fdd835!important}.yellow-600-border-right{border-right-color:#fdd835!important}.yellow-600-border-bottom{border-bottom-color:#fdd835!important}.yellow-600-border-left{border-left-color:#fdd835!important}.yellow-700-bg{background-color:#fbc02d!important}.md-yellow-700-bg{background-color:#fbc02d!important;color:rgba(0,0,0,.87)}.yellow-700-fg{color:#fbc02d!important}.yellow-700-border{border-color:#fbc02d!important}.yellow-700-border-top{border-top-color:#fbc02d!important}.yellow-700-border-right{border-right-color:#fbc02d!important}.yellow-700-border-bottom{border-bottom-color:#fbc02d!important}.yellow-700-border-left{border-left-color:#fbc02d!important}.yellow-800-bg{background-color:#f9a825!important}.md-yellow-800-bg{background-color:#f9a825!important;color:rgba(0,0,0,.87)}.yellow-800-fg{color:#f9a825!important}.yellow-800-border{border-color:#f9a825!important}.yellow-800-border-top{border-top-color:#f9a825!important}.yellow-800-border-right{border-right-color:#f9a825!important}.yellow-800-border-bottom{border-bottom-color:#f9a825!important}.yellow-800-border-left{border-left-color:#f9a825!important}.yellow-900-bg{background-color:#f57f17!important}.md-yellow-900-bg{background-color:#f57f17!important;color:rgba(0,0,0,.87)}.yellow-900-fg{color:#f57f17!important}.yellow-900-border{border-color:#f57f17!important}.yellow-900-border-top{border-top-color:#f57f17!important}.yellow-900-border-right{border-right-color:#f57f17!important}.yellow-900-border-bottom{border-bottom-color:#f57f17!important}.yellow-900-border-left{border-left-color:#f57f17!important}.yellow-A100-bg{background-color:#ffff8d!important}.md-yellow-A100-bg{background-color:#ffff8d!important;color:rgba(0,0,0,.87)}.yellow-A100-fg{color:#ffff8d!important}.yellow-A100-border{border-color:#ffff8d!important}.yellow-A100-border-top{border-top-color:#ffff8d!important}.yellow-A100-border-right{border-right-color:#ffff8d!important}.yellow-A100-border-bottom{border-bottom-color:#ffff8d!important}.yellow-A100-border-left{border-left-color:#ffff8d!important}.yellow-A200-bg{background-color:#ff0!important}.md-yellow-A200-bg{background-color:#ff0!important;color:rgba(0,0,0,.87)}.yellow-A200-fg{color:#ff0!important}.yellow-A200-border{border-color:#ff0!important}.yellow-A200-border-top{border-top-color:#ff0!important}.yellow-A200-border-right{border-right-color:#ff0!important}.yellow-A200-border-bottom{border-bottom-color:#ff0!important}.yellow-A200-border-left{border-left-color:#ff0!important}.yellow-A400-bg{background-color:#ffea00!important}.md-yellow-A400-bg{background-color:#ffea00!important;color:rgba(0,0,0,.87)}.yellow-A400-fg{color:#ffea00!important}.yellow-A400-border{border-color:#ffea00!important}.yellow-A400-border-top{border-top-color:#ffea00!important}.yellow-A400-border-right{border-right-color:#ffea00!important}.yellow-A400-border-bottom{border-bottom-color:#ffea00!important}.yellow-A400-border-left{border-left-color:#ffea00!important}.yellow-A700-bg{background-color:#ffd600!important}.md-yellow-A700-bg{background-color:#ffd600!important;color:rgba(0,0,0,.87)}.yellow-A700-fg{color:#ffd600!important}.yellow-A700-border{border-color:#ffd600!important}.yellow-A700-border-top{border-top-color:#ffd600!important}.yellow-A700-border-right{border-right-color:#ffd600!important}.yellow-A700-border-bottom{border-bottom-color:#ffd600!important}.yellow-A700-border-left{border-left-color:#ffd600!important}.amber-50-bg{background-color:#fff8e1!important}.md-amber-50-bg{background-color:#fff8e1!important;color:rgba(0,0,0,.87)}.amber-50-fg{color:#fff8e1!important}.amber-50-border{border-color:#fff8e1!important}.amber-50-border-top{border-top-color:#fff8e1!important}.amber-50-border-right{border-right-color:#fff8e1!important}.amber-50-border-bottom{border-bottom-color:#fff8e1!important}.amber-50-border-left{border-left-color:#fff8e1!important}.amber-100-bg{background-color:#ffecb3!important}.md-amber-100-bg{background-color:#ffecb3!important;color:rgba(0,0,0,.87)}.amber-100-fg{color:#ffecb3!important}.amber-100-border{border-color:#ffecb3!important}.amber-100-border-top{border-top-color:#ffecb3!important}.amber-100-border-right{border-right-color:#ffecb3!important}.amber-100-border-bottom{border-bottom-color:#ffecb3!important}.amber-100-border-left{border-left-color:#ffecb3!important}.amber-200-bg{background-color:#ffe082!important}.md-amber-200-bg{background-color:#ffe082!important;color:rgba(0,0,0,.87)}.amber-200-fg{color:#ffe082!important}.amber-200-border{border-color:#ffe082!important}.amber-200-border-top{border-top-color:#ffe082!important}.amber-200-border-right{border-right-color:#ffe082!important}.amber-200-border-bottom{border-bottom-color:#ffe082!important}.amber-200-border-left{border-left-color:#ffe082!important}.amber-300-bg{background-color:#ffd54f!important}.md-amber-300-bg{background-color:#ffd54f!important;color:rgba(0,0,0,.87)}.amber-300-fg{color:#ffd54f!important}.amber-300-border{border-color:#ffd54f!important}.amber-300-border-top{border-top-color:#ffd54f!important}.amber-300-border-right{border-right-color:#ffd54f!important}.amber-300-border-bottom{border-bottom-color:#ffd54f!important}.amber-300-border-left{border-left-color:#ffd54f!important}.amber-400-bg{background-color:#ffca28!important}.md-amber-400-bg{background-color:#ffca28!important;color:rgba(0,0,0,.87)}.amber-400-fg{color:#ffca28!important}.amber-400-border{border-color:#ffca28!important}.amber-400-border-top{border-top-color:#ffca28!important}.amber-400-border-right{border-right-color:#ffca28!important}.amber-400-border-bottom{border-bottom-color:#ffca28!important}.amber-400-border-left{border-left-color:#ffca28!important}.amber-500-bg{background-color:#ffc107!important}.md-amber-500-bg{background-color:#ffc107!important;color:rgba(0,0,0,.87)}.amber-500-fg{color:#ffc107!important}.amber-500-border{border-color:#ffc107!important}.amber-500-border-top{border-top-color:#ffc107!important}.amber-500-border-right{border-right-color:#ffc107!important}.amber-500-border-bottom{border-bottom-color:#ffc107!important}.amber-500-border-left{border-left-color:#ffc107!important}.md-amber-bg{background-color:#ffc107!important;color:rgba(0,0,0,.87)}.amber-bg{background-color:#ffc107!important}.amber-fg{color:#ffc107!important}.amber-border{border-color:#ffc107!important}.amber-border-top{border-top-color:#ffc107!important}.amber-border-right{border-right-color:#ffc107!important}.amber-border-bottom{border-bottom-color:#ffc107!important}.amber-border-left{border-left-color:#ffc107!important}.amber-600-bg{background-color:#ffb300!important}.md-amber-600-bg{background-color:#ffb300!important;color:rgba(0,0,0,.87)}.amber-600-fg{color:#ffb300!important}.amber-600-border{border-color:#ffb300!important}.amber-600-border-top{border-top-color:#ffb300!important}.amber-600-border-right{border-right-color:#ffb300!important}.amber-600-border-bottom{border-bottom-color:#ffb300!important}.amber-600-border-left{border-left-color:#ffb300!important}.amber-700-bg{background-color:#ffa000!important}.md-amber-700-bg{background-color:#ffa000!important;color:rgba(0,0,0,.87)}.amber-700-fg{color:#ffa000!important}.amber-700-border{border-color:#ffa000!important}.amber-700-border-top{border-top-color:#ffa000!important}.amber-700-border-right{border-right-color:#ffa000!important}.amber-700-border-bottom{border-bottom-color:#ffa000!important}.amber-700-border-left{border-left-color:#ffa000!important}.amber-800-bg{background-color:#ff8f00!important}.md-amber-800-bg{background-color:#ff8f00!important;color:rgba(0,0,0,.87)}.amber-800-fg{color:#ff8f00!important}.amber-800-border{border-color:#ff8f00!important}.amber-800-border-top{border-top-color:#ff8f00!important}.amber-800-border-right{border-right-color:#ff8f00!important}.amber-800-border-bottom{border-bottom-color:#ff8f00!important}.amber-800-border-left{border-left-color:#ff8f00!important}.amber-900-bg{background-color:#ff6f00!important}.md-amber-900-bg{background-color:#ff6f00!important;color:rgba(0,0,0,.87)}.amber-900-fg{color:#ff6f00!important}.amber-900-border{border-color:#ff6f00!important}.amber-900-border-top{border-top-color:#ff6f00!important}.amber-900-border-right{border-right-color:#ff6f00!important}.amber-900-border-bottom{border-bottom-color:#ff6f00!important}.amber-900-border-left{border-left-color:#ff6f00!important}.amber-A100-bg{background-color:#ffe57f!important}.md-amber-A100-bg{background-color:#ffe57f!important;color:rgba(0,0,0,.87)}.amber-A100-fg{color:#ffe57f!important}.amber-A100-border{border-color:#ffe57f!important}.amber-A100-border-top{border-top-color:#ffe57f!important}.amber-A100-border-right{border-right-color:#ffe57f!important}.amber-A100-border-bottom{border-bottom-color:#ffe57f!important}.amber-A100-border-left{border-left-color:#ffe57f!important}.amber-A200-bg{background-color:#ffd740!important}.md-amber-A200-bg{background-color:#ffd740!important;color:rgba(0,0,0,.87)}.amber-A200-fg{color:#ffd740!important}.amber-A200-border{border-color:#ffd740!important}.amber-A200-border-top{border-top-color:#ffd740!important}.amber-A200-border-right{border-right-color:#ffd740!important}.amber-A200-border-bottom{border-bottom-color:#ffd740!important}.amber-A200-border-left{border-left-color:#ffd740!important}.amber-A400-bg{background-color:#ffc400!important}.md-amber-A400-bg{background-color:#ffc400!important;color:rgba(0,0,0,.87)}.amber-A400-fg{color:#ffc400!important}.amber-A400-border{border-color:#ffc400!important}.amber-A400-border-top{border-top-color:#ffc400!important}.amber-A400-border-right{border-right-color:#ffc400!important}.amber-A400-border-bottom{border-bottom-color:#ffc400!important}.amber-A400-border-left{border-left-color:#ffc400!important}.amber-A700-bg{background-color:#ffab00!important}.md-amber-A700-bg{background-color:#ffab00!important;color:rgba(0,0,0,.87)}.amber-A700-fg{color:#ffab00!important}.amber-A700-border{border-color:#ffab00!important}.amber-A700-border-top{border-top-color:#ffab00!important}.amber-A700-border-right{border-right-color:#ffab00!important}.amber-A700-border-bottom{border-bottom-color:#ffab00!important}.amber-A700-border-left{border-left-color:#ffab00!important}.orange-50-bg{background-color:#fff3e0!important}.md-orange-50-bg{background-color:#fff3e0!important;color:rgba(0,0,0,.87)}.orange-50-fg{color:#fff3e0!important}.orange-50-border{border-color:#fff3e0!important}.orange-50-border-top{border-top-color:#fff3e0!important}.orange-50-border-right{border-right-color:#fff3e0!important}.orange-50-border-bottom{border-bottom-color:#fff3e0!important}.orange-50-border-left{border-left-color:#fff3e0!important}.orange-100-bg{background-color:#ffe0b2!important}.md-orange-100-bg{background-color:#ffe0b2!important;color:rgba(0,0,0,.87)}.orange-100-fg{color:#ffe0b2!important}.orange-100-border{border-color:#ffe0b2!important}.orange-100-border-top{border-top-color:#ffe0b2!important}.orange-100-border-right{border-right-color:#ffe0b2!important}.orange-100-border-bottom{border-bottom-color:#ffe0b2!important}.orange-100-border-left{border-left-color:#ffe0b2!important}.orange-200-bg{background-color:#ffcc80!important}.md-orange-200-bg{background-color:#ffcc80!important;color:rgba(0,0,0,.87)}.orange-200-fg{color:#ffcc80!important}.orange-200-border{border-color:#ffcc80!important}.orange-200-border-top{border-top-color:#ffcc80!important}.orange-200-border-right{border-right-color:#ffcc80!important}.orange-200-border-bottom{border-bottom-color:#ffcc80!important}.orange-200-border-left{border-left-color:#ffcc80!important}.orange-300-bg{background-color:#ffb74d!important}.md-orange-300-bg{background-color:#ffb74d!important;color:rgba(0,0,0,.87)}.orange-300-fg{color:#ffb74d!important}.orange-300-border{border-color:#ffb74d!important}.orange-300-border-top{border-top-color:#ffb74d!important}.orange-300-border-right{border-right-color:#ffb74d!important}.orange-300-border-bottom{border-bottom-color:#ffb74d!important}.orange-300-border-left{border-left-color:#ffb74d!important}.orange-400-bg{background-color:#ffa726!important}.md-orange-400-bg{background-color:#ffa726!important;color:rgba(0,0,0,.87)}.orange-400-fg{color:#ffa726!important}.orange-400-border{border-color:#ffa726!important}.orange-400-border-top{border-top-color:#ffa726!important}.orange-400-border-right{border-right-color:#ffa726!important}.orange-400-border-bottom{border-bottom-color:#ffa726!important}.orange-400-border-left{border-left-color:#ffa726!important}.orange-500-bg{background-color:#ff9800!important}.md-orange-500-bg{background-color:#ff9800!important;color:rgba(0,0,0,.87)}.orange-500-fg{color:#ff9800!important}.orange-500-border{border-color:#ff9800!important}.orange-500-border-top{border-top-color:#ff9800!important}.orange-500-border-right{border-right-color:#ff9800!important}.orange-500-border-bottom{border-bottom-color:#ff9800!important}.orange-500-border-left{border-left-color:#ff9800!important}.md-orange-bg{background-color:#ff9800!important;color:rgba(0,0,0,.87)}.orange-bg{background-color:#ff9800!important}.orange-fg{color:#ff9800!important}.orange-border{border-color:#ff9800!important}.orange-border-top{border-top-color:#ff9800!important}.orange-border-right{border-right-color:#ff9800!important}.orange-border-bottom{border-bottom-color:#ff9800!important}.orange-border-left{border-left-color:#ff9800!important}.orange-600-bg{background-color:#fb8c00!important}.md-orange-600-bg{background-color:#fb8c00!important;color:rgba(0,0,0,.87)}.orange-600-fg{color:#fb8c00!important}.orange-600-border{border-color:#fb8c00!important}.orange-600-border-top{border-top-color:#fb8c00!important}.orange-600-border-right{border-right-color:#fb8c00!important}.orange-600-border-bottom{border-bottom-color:#fb8c00!important}.orange-600-border-left{border-left-color:#fb8c00!important}.orange-700-bg{background-color:#f57c00!important}.md-orange-700-bg{background-color:#f57c00!important;color:rgba(0,0,0,.87)}.orange-700-fg{color:#f57c00!important}.orange-700-border{border-color:#f57c00!important}.orange-700-border-top{border-top-color:#f57c00!important}.orange-700-border-right{border-right-color:#f57c00!important}.orange-700-border-bottom{border-bottom-color:#f57c00!important}.orange-700-border-left{border-left-color:#f57c00!important}.orange-800-bg{background-color:#ef6c00!important}.md-orange-800-bg{background-color:#ef6c00!important;color:#fff}.orange-800-fg{color:#ef6c00!important}.orange-800-border{border-color:#ef6c00!important}.orange-800-border-top{border-top-color:#ef6c00!important}.orange-800-border-right{border-right-color:#ef6c00!important}.orange-800-border-bottom{border-bottom-color:#ef6c00!important}.orange-800-border-left{border-left-color:#ef6c00!important}.orange-900-bg{background-color:#e65100!important}.md-orange-900-bg{background-color:#e65100!important;color:#fff}.orange-900-fg{color:#e65100!important}.orange-900-border{border-color:#e65100!important}.orange-900-border-top{border-top-color:#e65100!important}.orange-900-border-right{border-right-color:#e65100!important}.orange-900-border-bottom{border-bottom-color:#e65100!important}.orange-900-border-left{border-left-color:#e65100!important}.orange-A100-bg{background-color:#ffd180!important}.md-orange-A100-bg{background-color:#ffd180!important;color:rgba(0,0,0,.87)}.orange-A100-fg{color:#ffd180!important}.orange-A100-border{border-color:#ffd180!important}.orange-A100-border-top{border-top-color:#ffd180!important}.orange-A100-border-right{border-right-color:#ffd180!important}.orange-A100-border-bottom{border-bottom-color:#ffd180!important}.orange-A100-border-left{border-left-color:#ffd180!important}.orange-A200-bg{background-color:#ffab40!important}.md-orange-A200-bg{background-color:#ffab40!important;color:rgba(0,0,0,.87)}.orange-A200-fg{color:#ffab40!important}.orange-A200-border{border-color:#ffab40!important}.orange-A200-border-top{border-top-color:#ffab40!important}.orange-A200-border-right{border-right-color:#ffab40!important}.orange-A200-border-bottom{border-bottom-color:#ffab40!important}.orange-A200-border-left{border-left-color:#ffab40!important}.orange-A400-bg{background-color:#ff9100!important}.md-orange-A400-bg{background-color:#ff9100!important;color:rgba(0,0,0,.87)}.orange-A400-fg{color:#ff9100!important}.orange-A400-border{border-color:#ff9100!important}.orange-A400-border-top{border-top-color:#ff9100!important}.orange-A400-border-right{border-right-color:#ff9100!important}.orange-A400-border-bottom{border-bottom-color:#ff9100!important}.orange-A400-border-left{border-left-color:#ff9100!important}.orange-A700-bg{background-color:#ff6d00!important}.md-orange-A700-bg{background-color:#ff6d00!important;color:rgba(0,0,0,.87)}.orange-A700-fg{color:#ff6d00!important}.orange-A700-border{border-color:#ff6d00!important}.orange-A700-border-top{border-top-color:#ff6d00!important}.orange-A700-border-right{border-right-color:#ff6d00!important}.orange-A700-border-bottom{border-bottom-color:#ff6d00!important}.orange-A700-border-left{border-left-color:#ff6d00!important}.deep-orange-50-bg{background-color:#fbe9e7!important}.md-deep-orange-50-bg{background-color:#fbe9e7!important;color:rgba(0,0,0,.87)}.deep-orange-50-fg{color:#fbe9e7!important}.deep-orange-50-border{border-color:#fbe9e7!important}.deep-orange-50-border-top{border-top-color:#fbe9e7!important}.deep-orange-50-border-right{border-right-color:#fbe9e7!important}.deep-orange-50-border-bottom{border-bottom-color:#fbe9e7!important}.deep-orange-50-border-left{border-left-color:#fbe9e7!important}.deep-orange-100-bg{background-color:#ffccbc!important}.md-deep-orange-100-bg{background-color:#ffccbc!important;color:rgba(0,0,0,.87)}.deep-orange-100-fg{color:#ffccbc!important}.deep-orange-100-border{border-color:#ffccbc!important}.deep-orange-100-border-top{border-top-color:#ffccbc!important}.deep-orange-100-border-right{border-right-color:#ffccbc!important}.deep-orange-100-border-bottom{border-bottom-color:#ffccbc!important}.deep-orange-100-border-left{border-left-color:#ffccbc!important}.deep-orange-200-bg{background-color:#ffab91!important}.md-deep-orange-200-bg{background-color:#ffab91!important;color:rgba(0,0,0,.87)}.deep-orange-200-fg{color:#ffab91!important}.deep-orange-200-border{border-color:#ffab91!important}.deep-orange-200-border-top{border-top-color:#ffab91!important}.deep-orange-200-border-right{border-right-color:#ffab91!important}.deep-orange-200-border-bottom{border-bottom-color:#ffab91!important}.deep-orange-200-border-left{border-left-color:#ffab91!important}.deep-orange-300-bg{background-color:#ff8a65!important}.md-deep-orange-300-bg{background-color:#ff8a65!important;color:rgba(0,0,0,.87)}.deep-orange-300-fg{color:#ff8a65!important}.deep-orange-300-border{border-color:#ff8a65!important}.deep-orange-300-border-top{border-top-color:#ff8a65!important}.deep-orange-300-border-right{border-right-color:#ff8a65!important}.deep-orange-300-border-bottom{border-bottom-color:#ff8a65!important}.deep-orange-300-border-left{border-left-color:#ff8a65!important}.deep-orange-400-bg{background-color:#ff7043!important}.md-deep-orange-400-bg{background-color:#ff7043!important;color:rgba(0,0,0,.87)}.deep-orange-400-fg{color:#ff7043!important}.deep-orange-400-border{border-color:#ff7043!important}.deep-orange-400-border-top{border-top-color:#ff7043!important}.deep-orange-400-border-right{border-right-color:#ff7043!important}.deep-orange-400-border-bottom{border-bottom-color:#ff7043!important}.deep-orange-400-border-left{border-left-color:#ff7043!important}.deep-orange-500-bg{background-color:#ff5722!important}.md-deep-orange-500-bg{background-color:#ff5722!important;color:#fff}.deep-orange-500-fg{color:#ff5722!important}.deep-orange-500-border{border-color:#ff5722!important}.deep-orange-500-border-top{border-top-color:#ff5722!important}.deep-orange-500-border-right{border-right-color:#ff5722!important}.deep-orange-500-border-bottom{border-bottom-color:#ff5722!important}.deep-orange-500-border-left{border-left-color:#ff5722!important}.md-deep-orange-bg{background-color:#ff5722!important;color:#fff}.deep-orange-bg{background-color:#ff5722!important}.deep-orange-fg{color:#ff5722!important}.deep-orange-border{border-color:#ff5722!important}.deep-orange-border-top{border-top-color:#ff5722!important}.deep-orange-border-right{border-right-color:#ff5722!important}.deep-orange-border-bottom{border-bottom-color:#ff5722!important}.deep-orange-border-left{border-left-color:#ff5722!important}.deep-orange-600-bg{background-color:#f4511e!important}.md-deep-orange-600-bg{background-color:#f4511e!important;color:#fff}.deep-orange-600-fg{color:#f4511e!important}.deep-orange-600-border{border-color:#f4511e!important}.deep-orange-600-border-top{border-top-color:#f4511e!important}.deep-orange-600-border-right{border-right-color:#f4511e!important}.deep-orange-600-border-bottom{border-bottom-color:#f4511e!important}.deep-orange-600-border-left{border-left-color:#f4511e!important}.deep-orange-700-bg{background-color:#e64a19!important}.md-deep-orange-700-bg{background-color:#e64a19!important;color:#fff}.deep-orange-700-fg{color:#e64a19!important}.deep-orange-700-border{border-color:#e64a19!important}.deep-orange-700-border-top{border-top-color:#e64a19!important}.deep-orange-700-border-right{border-right-color:#e64a19!important}.deep-orange-700-border-bottom{border-bottom-color:#e64a19!important}.deep-orange-700-border-left{border-left-color:#e64a19!important}.deep-orange-800-bg{background-color:#d84315!important}.md-deep-orange-800-bg{background-color:#d84315!important;color:#fff}.deep-orange-800-fg{color:#d84315!important}.deep-orange-800-border{border-color:#d84315!important}.deep-orange-800-border-top{border-top-color:#d84315!important}.deep-orange-800-border-right{border-right-color:#d84315!important}.deep-orange-800-border-bottom{border-bottom-color:#d84315!important}.deep-orange-800-border-left{border-left-color:#d84315!important}.deep-orange-900-bg{background-color:#bf360c!important}.md-deep-orange-900-bg{background-color:#bf360c!important;color:#fff}.deep-orange-900-fg{color:#bf360c!important}.deep-orange-900-border{border-color:#bf360c!important}.deep-orange-900-border-top{border-top-color:#bf360c!important}.deep-orange-900-border-right{border-right-color:#bf360c!important}.deep-orange-900-border-bottom{border-bottom-color:#bf360c!important}.deep-orange-900-border-left{border-left-color:#bf360c!important}.deep-orange-A100-bg{background-color:#ff9e80!important}.md-deep-orange-A100-bg{background-color:#ff9e80!important;color:rgba(0,0,0,.87)}.deep-orange-A100-fg{color:#ff9e80!important}.deep-orange-A100-border{border-color:#ff9e80!important}.deep-orange-A100-border-top{border-top-color:#ff9e80!important}.deep-orange-A100-border-right{border-right-color:#ff9e80!important}.deep-orange-A100-border-bottom{border-bottom-color:#ff9e80!important}.deep-orange-A100-border-left{border-left-color:#ff9e80!important}.deep-orange-A200-bg{background-color:#ff6e40!important}.md-deep-orange-A200-bg{background-color:#ff6e40!important;color:rgba(0,0,0,.87)}.deep-orange-A200-fg{color:#ff6e40!important}.deep-orange-A200-border{border-color:#ff6e40!important}.deep-orange-A200-border-top{border-top-color:#ff6e40!important}.deep-orange-A200-border-right{border-right-color:#ff6e40!important}.deep-orange-A200-border-bottom{border-bottom-color:#ff6e40!important}.deep-orange-A200-border-left{border-left-color:#ff6e40!important}.deep-orange-A400-bg{background-color:#ff3d00!important}.md-deep-orange-A400-bg{background-color:#ff3d00!important;color:#fff}.deep-orange-A400-fg{color:#ff3d00!important}.deep-orange-A400-border{border-color:#ff3d00!important}.deep-orange-A400-border-top{border-top-color:#ff3d00!important}.deep-orange-A400-border-right{border-right-color:#ff3d00!important}.deep-orange-A400-border-bottom{border-bottom-color:#ff3d00!important}.deep-orange-A400-border-left{border-left-color:#ff3d00!important}.deep-orange-A700-bg{background-color:#dd2c00!important}.md-deep-orange-A700-bg{background-color:#dd2c00!important;color:#fff}.deep-orange-A700-fg{color:#dd2c00!important}.deep-orange-A700-border{border-color:#dd2c00!important}.deep-orange-A700-border-top{border-top-color:#dd2c00!important}.deep-orange-A700-border-right{border-right-color:#dd2c00!important}.deep-orange-A700-border-bottom{border-bottom-color:#dd2c00!important}.deep-orange-A700-border-left{border-left-color:#dd2c00!important}.brown-50-bg{background-color:#efebe9!important}.md-brown-50-bg{background-color:#efebe9!important;color:rgba(0,0,0,.87)}.brown-50-fg{color:#efebe9!important}.brown-50-border{border-color:#efebe9!important}.brown-50-border-top{border-top-color:#efebe9!important}.brown-50-border-right{border-right-color:#efebe9!important}.brown-50-border-bottom{border-bottom-color:#efebe9!important}.brown-50-border-left{border-left-color:#efebe9!important}.brown-100-bg{background-color:#d7ccc8!important}.md-brown-100-bg{background-color:#d7ccc8!important;color:rgba(0,0,0,.87)}.brown-100-fg{color:#d7ccc8!important}.brown-100-border{border-color:#d7ccc8!important}.brown-100-border-top{border-top-color:#d7ccc8!important}.brown-100-border-right{border-right-color:#d7ccc8!important}.brown-100-border-bottom{border-bottom-color:#d7ccc8!important}.brown-100-border-left{border-left-color:#d7ccc8!important}.brown-200-bg{background-color:#bcaaa4!important}.md-brown-200-bg{background-color:#bcaaa4!important;color:rgba(0,0,0,.87)}.brown-200-fg{color:#bcaaa4!important}.brown-200-border{border-color:#bcaaa4!important}.brown-200-border-top{border-top-color:#bcaaa4!important}.brown-200-border-right{border-right-color:#bcaaa4!important}.brown-200-border-bottom{border-bottom-color:#bcaaa4!important}.brown-200-border-left{border-left-color:#bcaaa4!important}.brown-300-bg{background-color:#a1887f!important}.md-brown-300-bg{background-color:#a1887f!important;color:#fff}.brown-300-fg{color:#a1887f!important}.brown-300-border{border-color:#a1887f!important}.brown-300-border-top{border-top-color:#a1887f!important}.brown-300-border-right{border-right-color:#a1887f!important}.brown-300-border-bottom{border-bottom-color:#a1887f!important}.brown-300-border-left{border-left-color:#a1887f!important}.brown-400-bg{background-color:#8d6e63!important}.md-brown-400-bg{background-color:#8d6e63!important;color:#fff}.brown-400-fg{color:#8d6e63!important}.brown-400-border{border-color:#8d6e63!important}.brown-400-border-top{border-top-color:#8d6e63!important}.brown-400-border-right{border-right-color:#8d6e63!important}.brown-400-border-bottom{border-bottom-color:#8d6e63!important}.brown-400-border-left{border-left-color:#8d6e63!important}.brown-500-bg{background-color:#795548!important}.md-brown-500-bg{background-color:#795548!important;color:rgba(255,255,255,.87)}.brown-500-fg{color:#795548!important}.brown-500-border{border-color:#795548!important}.brown-500-border-top{border-top-color:#795548!important}.brown-500-border-right{border-right-color:#795548!important}.brown-500-border-bottom{border-bottom-color:#795548!important}.brown-500-border-left{border-left-color:#795548!important}.md-brown-bg{background-color:#795548!important;color:rgba(255,255,255,.87)}.brown-bg{background-color:#795548!important}.brown-fg{color:#795548!important}.brown-border{border-color:#795548!important}.brown-border-top{border-top-color:#795548!important}.brown-border-right{border-right-color:#795548!important}.brown-border-bottom{border-bottom-color:#795548!important}.brown-border-left{border-left-color:#795548!important}.brown-600-bg{background-color:#6d4c41!important}.md-brown-600-bg{background-color:#6d4c41!important;color:rgba(255,255,255,.87)}.brown-600-fg{color:#6d4c41!important}.brown-600-border{border-color:#6d4c41!important}.brown-600-border-top{border-top-color:#6d4c41!important}.brown-600-border-right{border-right-color:#6d4c41!important}.brown-600-border-bottom{border-bottom-color:#6d4c41!important}.brown-600-border-left{border-left-color:#6d4c41!important}.brown-700-bg{background-color:#5d4037!important}.md-brown-700-bg{background-color:#5d4037!important;color:rgba(255,255,255,.87)}.brown-700-fg{color:#5d4037!important}.brown-700-border{border-color:#5d4037!important}.brown-700-border-top{border-top-color:#5d4037!important}.brown-700-border-right{border-right-color:#5d4037!important}.brown-700-border-bottom{border-bottom-color:#5d4037!important}.brown-700-border-left{border-left-color:#5d4037!important}.brown-800-bg{background-color:#4e342e!important}.md-brown-800-bg{background-color:#4e342e!important;color:rgba(255,255,255,.87)}.brown-800-fg{color:#4e342e!important}.brown-800-border{border-color:#4e342e!important}.brown-800-border-top{border-top-color:#4e342e!important}.brown-800-border-right{border-right-color:#4e342e!important}.brown-800-border-bottom{border-bottom-color:#4e342e!important}.brown-800-border-left{border-left-color:#4e342e!important}.brown-900-bg{background-color:#3e2723!important}.md-brown-900-bg{background-color:#3e2723!important;color:rgba(255,255,255,.87)}.brown-900-fg{color:#3e2723!important}.brown-900-border{border-color:#3e2723!important}.brown-900-border-top{border-top-color:#3e2723!important}.brown-900-border-right{border-right-color:#3e2723!important}.brown-900-border-bottom{border-bottom-color:#3e2723!important}.brown-900-border-left{border-left-color:#3e2723!important}.brown-A100-bg{background-color:#d7ccc8!important}.md-brown-A100-bg{background-color:#d7ccc8!important;color:rgba(255,255,255,.87)}.brown-A100-fg{color:#d7ccc8!important}.brown-A100-border{border-color:#d7ccc8!important}.brown-A100-border-top{border-top-color:#d7ccc8!important}.brown-A100-border-right{border-right-color:#d7ccc8!important}.brown-A100-border-bottom{border-bottom-color:#d7ccc8!important}.brown-A100-border-left{border-left-color:#d7ccc8!important}.brown-A200-bg{background-color:#bcaaa4!important}.md-brown-A200-bg{background-color:#bcaaa4!important;color:rgba(255,255,255,.87)}.brown-A200-fg{color:#bcaaa4!important}.brown-A200-border{border-color:#bcaaa4!important}.brown-A200-border-top{border-top-color:#bcaaa4!important}.brown-A200-border-right{border-right-color:#bcaaa4!important}.brown-A200-border-bottom{border-bottom-color:#bcaaa4!important}.brown-A200-border-left{border-left-color:#bcaaa4!important}.brown-A400-bg{background-color:#8d6e63!important}.md-brown-A400-bg{background-color:#8d6e63!important;color:rgba(255,255,255,.87)}.brown-A400-fg{color:#8d6e63!important}.brown-A400-border{border-color:#8d6e63!important}.brown-A400-border-top{border-top-color:#8d6e63!important}.brown-A400-border-right{border-right-color:#8d6e63!important}.brown-A400-border-bottom{border-bottom-color:#8d6e63!important}.brown-A400-border-left{border-left-color:#8d6e63!important}.brown-A700-bg{background-color:#5d4037!important}.md-brown-A700-bg{background-color:#5d4037!important;color:rgba(255,255,255,.87)}.brown-A700-fg{color:#5d4037!important}.brown-A700-border{border-color:#5d4037!important}.brown-A700-border-top{border-top-color:#5d4037!important}.brown-A700-border-right{border-right-color:#5d4037!important}.brown-A700-border-bottom{border-bottom-color:#5d4037!important}.brown-A700-border-left{border-left-color:#5d4037!important}.grey-50-bg{background-color:#fafafa!important}.md-grey-50-bg{background-color:#fafafa!important;color:rgba(0,0,0,.87)}.grey-50-fg{color:#fafafa!important}.grey-50-border{border-color:#fafafa!important}.grey-50-border-top{border-top-color:#fafafa!important}.grey-50-border-right{border-right-color:#fafafa!important}.grey-50-border-bottom{border-bottom-color:#fafafa!important}.grey-50-border-left{border-left-color:#fafafa!important}.grey-100-bg{background-color:#f5f5f5!important}.md-grey-100-bg{background-color:#f5f5f5!important;color:rgba(0,0,0,.87)}.grey-100-fg{color:#f5f5f5!important}.grey-100-border{border-color:#f5f5f5!important}.grey-100-border-top{border-top-color:#f5f5f5!important}.grey-100-border-right{border-right-color:#f5f5f5!important}.grey-100-border-bottom{border-bottom-color:#f5f5f5!important}.grey-100-border-left{border-left-color:#f5f5f5!important}.grey-200-bg{background-color:#eee!important}.md-grey-200-bg{background-color:#eee!important;color:rgba(0,0,0,.87)}.grey-200-fg{color:#eee!important}.grey-200-border{border-color:#eee!important}.grey-200-border-top{border-top-color:#eee!important}.grey-200-border-right{border-right-color:#eee!important}.grey-200-border-bottom{border-bottom-color:#eee!important}.grey-200-border-left{border-left-color:#eee!important}.grey-300-bg{background-color:#e0e0e0!important}.md-grey-300-bg{background-color:#e0e0e0!important;color:rgba(0,0,0,.87)}.grey-300-fg{color:#e0e0e0!important}.grey-300-border{border-color:#e0e0e0!important}.grey-300-border-top{border-top-color:#e0e0e0!important}.grey-300-border-right{border-right-color:#e0e0e0!important}.grey-300-border-bottom{border-bottom-color:#e0e0e0!important}.grey-300-border-left{border-left-color:#e0e0e0!important}.grey-400-bg{background-color:#bdbdbd!important}.md-grey-400-bg{background-color:#bdbdbd!important;color:rgba(0,0,0,.87)}.grey-400-fg{color:#bdbdbd!important}.grey-400-border{border-color:#bdbdbd!important}.grey-400-border-top{border-top-color:#bdbdbd!important}.grey-400-border-right{border-right-color:#bdbdbd!important}.grey-400-border-bottom{border-bottom-color:#bdbdbd!important}.grey-400-border-left{border-left-color:#bdbdbd!important}.grey-500-bg{background-color:#9e9e9e!important}.md-grey-500-bg{background-color:#9e9e9e!important;color:rgba(0,0,0,.87)}.grey-500-fg{color:#9e9e9e!important}.grey-500-border{border-color:#9e9e9e!important}.grey-500-border-top{border-top-color:#9e9e9e!important}.grey-500-border-right{border-right-color:#9e9e9e!important}.grey-500-border-bottom{border-bottom-color:#9e9e9e!important}.grey-500-border-left{border-left-color:#9e9e9e!important}.md-grey-bg{background-color:#9e9e9e!important;color:rgba(0,0,0,.87)}.grey-bg{background-color:#9e9e9e!important}.grey-fg{color:#9e9e9e!important}.grey-border{border-color:#9e9e9e!important}.grey-border-top{border-top-color:#9e9e9e!important}.grey-border-right{border-right-color:#9e9e9e!important}.grey-border-bottom{border-bottom-color:#9e9e9e!important}.grey-border-left{border-left-color:#9e9e9e!important}.grey-600-bg{background-color:#757575!important}.md-grey-600-bg{background-color:#757575!important;color:rgba(255,255,255,.87)}.grey-600-fg{color:#757575!important}.grey-600-border{border-color:#757575!important}.grey-600-border-top{border-top-color:#757575!important}.grey-600-border-right{border-right-color:#757575!important}.grey-600-border-bottom{border-bottom-color:#757575!important}.grey-600-border-left{border-left-color:#757575!important}.grey-700-bg{background-color:#616161!important}.md-grey-700-bg{background-color:#616161!important;color:rgba(255,255,255,.87)}.grey-700-fg{color:#616161!important}.grey-700-border{border-color:#616161!important}.grey-700-border-top{border-top-color:#616161!important}.grey-700-border-right{border-right-color:#616161!important}.grey-700-border-bottom{border-bottom-color:#616161!important}.grey-700-border-left{border-left-color:#616161!important}.grey-800-bg{background-color:#424242!important}.md-grey-800-bg{background-color:#424242!important;color:rgba(255,255,255,.87)}.grey-800-fg{color:#424242!important}.grey-800-border{border-color:#424242!important}.grey-800-border-top{border-top-color:#424242!important}.grey-800-border-right{border-right-color:#424242!important}.grey-800-border-bottom{border-bottom-color:#424242!important}.grey-800-border-left{border-left-color:#424242!important}.grey-900-bg{background-color:#212121!important}.md-grey-900-bg{background-color:#212121!important;color:rgba(255,255,255,.87)}.grey-900-fg{color:#212121!important}.grey-900-border{border-color:#212121!important}.grey-900-border-top{border-top-color:#212121!important}.grey-900-border-right{border-right-color:#212121!important}.grey-900-border-bottom{border-bottom-color:#212121!important}.grey-900-border-left{border-left-color:#212121!important}.grey-1000-bg{background-color:#000!important}.md-grey-1000-bg{background-color:#000!important}.grey-1000-fg{color:#000!important}.grey-1000-border{border-color:#000!important}.grey-1000-border-top{border-top-color:#000!important}.grey-1000-border-right{border-right-color:#000!important}.grey-1000-border-bottom{border-bottom-color:#000!important}.grey-1000-border-left{border-left-color:#000!important}.grey-A100-bg{background-color:#fff!important}.md-grey-A100-bg{background-color:#fff!important;color:rgba(0,0,0,.87)}.grey-A100-fg{color:#fff!important}.grey-A100-border{border-color:#fff!important}.grey-A100-border-top{border-top-color:#fff!important}.grey-A100-border-right{border-right-color:#fff!important}.grey-A100-border-bottom{border-bottom-color:#fff!important}.grey-A100-border-left{border-left-color:#fff!important}.grey-A200-bg{background-color:#eee!important}.md-grey-A200-bg{background-color:#eee!important;color:rgba(0,0,0,.87)}.grey-A200-fg{color:#eee!important}.grey-A200-border{border-color:#eee!important}.grey-A200-border-top{border-top-color:#eee!important}.grey-A200-border-right{border-right-color:#eee!important}.grey-A200-border-bottom{border-bottom-color:#eee!important}.grey-A200-border-left{border-left-color:#eee!important}.grey-A400-bg{background-color:#bdbdbd!important}.md-grey-A400-bg{background-color:#bdbdbd!important;color:rgba(0,0,0,.87)}.grey-A400-fg{color:#bdbdbd!important}.grey-A400-border{border-color:#bdbdbd!important}.grey-A400-border-top{border-top-color:#bdbdbd!important}.grey-A400-border-right{border-right-color:#bdbdbd!important}.grey-A400-border-bottom{border-bottom-color:#bdbdbd!important}.grey-A400-border-left{border-left-color:#bdbdbd!important}.grey-A700-bg{background-color:#616161!important}.md-grey-A700-bg{background-color:#616161!important;color:rgba(0,0,0,.87)}.grey-A700-fg{color:#616161!important}.grey-A700-border{border-color:#616161!important}.grey-A700-border-top{border-top-color:#616161!important}.grey-A700-border-right{border-right-color:#616161!important}.grey-A700-border-bottom{border-bottom-color:#616161!important}.grey-A700-border-left{border-left-color:#616161!important}.blue-grey-50-bg{background-color:#eceff1!important}.md-blue-grey-50-bg{background-color:#eceff1!important;color:rgba(0,0,0,.87)}.blue-grey-50-fg{color:#eceff1!important}.blue-grey-50-border{border-color:#eceff1!important}.blue-grey-50-border-top{border-top-color:#eceff1!important}.blue-grey-50-border-right{border-right-color:#eceff1!important}.blue-grey-50-border-bottom{border-bottom-color:#eceff1!important}.blue-grey-50-border-left{border-left-color:#eceff1!important}.blue-grey-100-bg{background-color:#cfd8dc!important}.md-blue-grey-100-bg{background-color:#cfd8dc!important;color:rgba(0,0,0,.87)}.blue-grey-100-fg{color:#cfd8dc!important}.blue-grey-100-border{border-color:#cfd8dc!important}.blue-grey-100-border-top{border-top-color:#cfd8dc!important}.blue-grey-100-border-right{border-right-color:#cfd8dc!important}.blue-grey-100-border-bottom{border-bottom-color:#cfd8dc!important}.blue-grey-100-border-left{border-left-color:#cfd8dc!important}.blue-grey-200-bg{background-color:#b0bec5!important}.md-blue-grey-200-bg{background-color:#b0bec5!important;color:rgba(0,0,0,.87)}.blue-grey-200-fg{color:#b0bec5!important}.blue-grey-200-border{border-color:#b0bec5!important}.blue-grey-200-border-top{border-top-color:#b0bec5!important}.blue-grey-200-border-right{border-right-color:#b0bec5!important}.blue-grey-200-border-bottom{border-bottom-color:#b0bec5!important}.blue-grey-200-border-left{border-left-color:#b0bec5!important}.blue-grey-300-bg{background-color:#90a4ae!important}.md-blue-grey-300-bg{background-color:#90a4ae!important;color:rgba(0,0,0,.87)}.blue-grey-300-fg{color:#90a4ae!important}.blue-grey-300-border{border-color:#90a4ae!important}.blue-grey-300-border-top{border-top-color:#90a4ae!important}.blue-grey-300-border-right{border-right-color:#90a4ae!important}.blue-grey-300-border-bottom{border-bottom-color:#90a4ae!important}.blue-grey-300-border-left{border-left-color:#90a4ae!important}.blue-grey-400-bg{background-color:#78909c!important}.md-blue-grey-400-bg{background-color:#78909c!important;color:#fff}.blue-grey-400-fg{color:#78909c!important}.blue-grey-400-border{border-color:#78909c!important}.blue-grey-400-border-top{border-top-color:#78909c!important}.blue-grey-400-border-right{border-right-color:#78909c!important}.blue-grey-400-border-bottom{border-bottom-color:#78909c!important}.blue-grey-400-border-left{border-left-color:#78909c!important}.blue-grey-500-bg{background-color:#607d8b!important}.md-blue-grey-500-bg{background-color:#607d8b!important;color:#fff}.blue-grey-500-fg{color:#607d8b!important}.blue-grey-500-border{border-color:#607d8b!important}.blue-grey-500-border-top{border-top-color:#607d8b!important}.blue-grey-500-border-right{border-right-color:#607d8b!important}.blue-grey-500-border-bottom{border-bottom-color:#607d8b!important}.blue-grey-500-border-left{border-left-color:#607d8b!important}.md-blue-grey-bg{background-color:#607d8b!important;color:#fff}.blue-grey-bg{background-color:#607d8b!important}.blue-grey-fg{color:#607d8b!important}.blue-grey-border{border-color:#607d8b!important}.blue-grey-border-top{border-top-color:#607d8b!important}.blue-grey-border-right{border-right-color:#607d8b!important}.blue-grey-border-bottom{border-bottom-color:#607d8b!important}.blue-grey-border-left{border-left-color:#607d8b!important}.blue-grey-600-bg{background-color:#546e7a!important}.md-blue-grey-600-bg{background-color:#546e7a!important;color:rgba(255,255,255,.87)}.blue-grey-600-fg{color:#546e7a!important}.blue-grey-600-border{border-color:#546e7a!important}.blue-grey-600-border-top{border-top-color:#546e7a!important}.blue-grey-600-border-right{border-right-color:#546e7a!important}.blue-grey-600-border-bottom{border-bottom-color:#546e7a!important}.blue-grey-600-border-left{border-left-color:#546e7a!important}.blue-grey-700-bg{background-color:#455a64!important}.md-blue-grey-700-bg{background-color:#455a64!important;color:rgba(255,255,255,.87)}.blue-grey-700-fg{color:#455a64!important}.blue-grey-700-border{border-color:#455a64!important}.blue-grey-700-border-top{border-top-color:#455a64!important}.blue-grey-700-border-right{border-right-color:#455a64!important}.blue-grey-700-border-bottom{border-bottom-color:#455a64!important}.blue-grey-700-border-left{border-left-color:#455a64!important}.blue-grey-800-bg{background-color:#37474f!important}.md-blue-grey-800-bg{background-color:#37474f!important;color:rgba(255,255,255,.87)}.blue-grey-800-fg{color:#37474f!important}.blue-grey-800-border{border-color:#37474f!important}.blue-grey-800-border-top{border-top-color:#37474f!important}.blue-grey-800-border-right{border-right-color:#37474f!important}.blue-grey-800-border-bottom{border-bottom-color:#37474f!important}.blue-grey-800-border-left{border-left-color:#37474f!important}.blue-grey-900-bg{background-color:#263238!important}.md-blue-grey-900-bg{background-color:#263238!important;color:rgba(255,255,255,.87)}.blue-grey-900-fg{color:#263238!important}.blue-grey-900-border{border-color:#263238!important}.blue-grey-900-border-top{border-top-color:#263238!important}.blue-grey-900-border-right{border-right-color:#263238!important}.blue-grey-900-border-bottom{border-bottom-color:#263238!important}.blue-grey-900-border-left{border-left-color:#263238!important}.blue-grey-A100-bg{background-color:#cfd8dc!important}.md-blue-grey-A100-bg{background-color:#cfd8dc!important;color:rgba(255,255,255,.87)}.blue-grey-A100-fg{color:#cfd8dc!important}.blue-grey-A100-border{border-color:#cfd8dc!important}.blue-grey-A100-border-top{border-top-color:#cfd8dc!important}.blue-grey-A100-border-right{border-right-color:#cfd8dc!important}.blue-grey-A100-border-bottom{border-bottom-color:#cfd8dc!important}.blue-grey-A100-border-left{border-left-color:#cfd8dc!important}.blue-grey-A200-bg{background-color:#b0bec5!important}.md-blue-grey-A200-bg{background-color:#b0bec5!important;color:rgba(255,255,255,.87)}.blue-grey-A200-fg{color:#b0bec5!important}.blue-grey-A200-border{border-color:#b0bec5!important}.blue-grey-A200-border-top{border-top-color:#b0bec5!important}.blue-grey-A200-border-right{border-right-color:#b0bec5!important}.blue-grey-A200-border-bottom{border-bottom-color:#b0bec5!important}.blue-grey-A200-border-left{border-left-color:#b0bec5!important}.blue-grey-A400-bg{background-color:#78909c!important}.md-blue-grey-A400-bg{background-color:#78909c!important;color:rgba(255,255,255,.87)}.blue-grey-A400-fg{color:#78909c!important}.blue-grey-A400-border{border-color:#78909c!important}.blue-grey-A400-border-top{border-top-color:#78909c!important}.blue-grey-A400-border-right{border-right-color:#78909c!important}.blue-grey-A400-border-bottom{border-bottom-color:#78909c!important}.blue-grey-A400-border-left{border-left-color:#78909c!important}.blue-grey-A700-bg{background-color:#455a64!important}.md-blue-grey-A700-bg{background-color:#455a64!important;color:rgba(255,255,255,.87)}.blue-grey-A700-fg{color:#455a64!important}.blue-grey-A700-border{border-color:#455a64!important}.blue-grey-A700-border-top{border-top-color:#455a64!important}.blue-grey-A700-border-right{border-right-color:#455a64!important}.blue-grey-A700-border-bottom{border-bottom-color:#455a64!important}.blue-grey-A700-border-left{border-left-color:#455a64!important}.white-500-bg{background-color:#fff!important}.md-white-500-bg{background-color:#fff!important;color:rgba(0,0,0,.87)}.white-500-fg{color:#fff!important}.white-500-border{border-color:#fff!important}.white-500-border-top{border-top-color:#fff!important}.white-500-border-right{border-right-color:#fff!important}.white-500-border-bottom{border-bottom-color:#fff!important}.white-500-border-left{border-left-color:#fff!important}.md-white-bg{background-color:#fff!important;color:rgba(0,0,0,.87)}.white-bg{background-color:#fff!important}.white-fg{color:#fff!important}.white-border{border-color:#fff!important}.white-border-top{border-top-color:#fff!important}.white-border-right{border-right-color:#fff!important}.white-border-bottom{border-bottom-color:#fff!important}.white-border-left{border-left-color:#fff!important}.black-500-bg{background-color:#000!important}.md-black-500-bg{background-color:#000!important;color:rgba(255,255,255,.87)}.black-500-fg{color:#000!important}.black-500-border{border-color:#000!important}.black-500-border-top{border-top-color:#000!important}.black-500-border-right{border-right-color:#000!important}.black-500-border-bottom{border-bottom-color:#000!important}.black-500-border-left{border-left-color:#000!important}.md-black-bg{background-color:#000!important;color:rgba(255,255,255,.87)}.black-bg{background-color:#000!important}.black-fg{color:#000!important}.black-border{border-color:#000!important}.black-border-top{border-top-color:#000!important}.black-border-right{border-right-color:#000!important}.black-border-bottom{border-bottom-color:#000!important}.black-border-left{border-left-color:#000!important}i,md-icon[md-font-icon]{font-size:24px;width:24px;height:24px;min-width:24px;min-height:24px;line-height:24px}i.s4,md-icon[md-font-icon].s4{font-size:4px!important;width:4px!important;height:4px!important;min-width:4px!important;min-height:4px!important;line-height:4px!important}i.s6,md-icon[md-font-icon].s6{font-size:6px!important;width:6px!important;height:6px!important;min-width:6px!important;min-height:6px!important;line-height:6px!important}i.s8,md-icon[md-font-icon].s8{font-size:8px!important;width:8px!important;height:8px!important;min-width:8px!important;min-height:8px!important;line-height:8px!important}i.s10,md-icon[md-font-icon].s10{font-size:10px!important;width:10px!important;height:10px!important;min-width:10px!important;min-height:10px!important;line-height:10px!important}i.s12,md-icon[md-font-icon].s12{font-size:12px!important;width:12px!important;height:12px!important;min-width:12px!important;min-height:12px!important;line-height:12px!important}i.s14,md-icon[md-font-icon].s14{font-size:14px!important;width:14px!important;height:14px!important;min-width:14px!important;min-height:14px!important;line-height:14px!important}i.s16,md-icon[md-font-icon].s16{font-size:16px!important;width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;line-height:16px!important}i.s18,md-icon[md-font-icon].s18{font-size:18px!important;width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;line-height:18px!important}i.s20,md-icon[md-font-icon].s20{font-size:20px!important;width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;line-height:20px!important}i.s22,md-icon[md-font-icon].s22{font-size:22px!important;width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;line-height:22px!important}i.s24,md-icon[md-font-icon].s24{font-size:24px!important;width:24px!important;height:24px!important;min-width:24px!important;min-height:24px!important;line-height:24px!important}i.s26,md-icon[md-font-icon].s26{font-size:26px!important;width:26px!important;height:26px!important;min-width:26px!important;min-height:26px!important;line-height:26px!important}i.s28,md-icon[md-font-icon].s28{font-size:28px!important;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;line-height:28px!important}i.s30,md-icon[md-font-icon].s30{font-size:30px!important;width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;line-height:30px!important}i.s32,md-icon[md-font-icon].s32{font-size:32px!important;width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;line-height:32px!important}i.s34,md-icon[md-font-icon].s34{font-size:34px!important;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;line-height:34px!important}i.s36,md-icon[md-font-icon].s36{font-size:36px!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;line-height:36px!important}i.s38,md-icon[md-font-icon].s38{font-size:38px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;line-height:38px!important}i.s40,md-icon[md-font-icon].s40{font-size:40px!important;width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;line-height:40px!important}i.s42,md-icon[md-font-icon].s42{font-size:42px!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;line-height:42px!important}i.s44,md-icon[md-font-icon].s44{font-size:44px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;line-height:44px!important}i.s46,md-icon[md-font-icon].s46{font-size:46px!important;width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;line-height:46px!important}i.s48,md-icon[md-font-icon].s48{font-size:48px!important;width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important;line-height:48px!important}i.s50,md-icon[md-font-icon].s50{font-size:50px!important;width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;line-height:50px!important}i.s52,md-icon[md-font-icon].s52{font-size:52px!important;width:52px!important;height:52px!important;min-width:52px!important;min-height:52px!important;line-height:52px!important}i.s54,md-icon[md-font-icon].s54{font-size:54px!important;width:54px!important;height:54px!important;min-width:54px!important;min-height:54px!important;line-height:54px!important}i.s56,md-icon[md-font-icon].s56{font-size:56px!important;width:56px!important;height:56px!important;min-width:56px!important;min-height:56px!important;line-height:56px!important}i.s58,md-icon[md-font-icon].s58{font-size:58px!important;width:58px!important;height:58px!important;min-width:58px!important;min-height:58px!important;line-height:58px!important}i.s60,md-icon[md-font-icon].s60{font-size:60px!important;width:60px!important;height:60px!important;min-width:60px!important;min-height:60px!important;line-height:60px!important}i.s62,md-icon[md-font-icon].s62{font-size:62px!important;width:62px!important;height:62px!important;min-width:62px!important;min-height:62px!important;line-height:62px!important}i.s64,md-icon[md-font-icon].s64{font-size:64px!important;width:64px!important;height:64px!important;min-width:64px!important;min-height:64px!important;line-height:64px!important}i.s66,md-icon[md-font-icon].s66{font-size:66px!important;width:66px!important;height:66px!important;min-width:66px!important;min-height:66px!important;line-height:66px!important}i.s68,md-icon[md-font-icon].s68{font-size:68px!important;width:68px!important;height:68px!important;min-width:68px!important;min-height:68px!important;line-height:68px!important}i.s70,md-icon[md-font-icon].s70{font-size:70px!important;width:70px!important;height:70px!important;min-width:70px!important;min-height:70px!important;line-height:70px!important}i.s72,md-icon[md-font-icon].s72{font-size:72px!important;width:72px!important;height:72px!important;min-width:72px!important;min-height:72px!important;line-height:72px!important}i.s74,md-icon[md-font-icon].s74{font-size:74px!important;width:74px!important;height:74px!important;min-width:74px!important;min-height:74px!important;line-height:74px!important}i.s76,md-icon[md-font-icon].s76{font-size:76px!important;width:76px!important;height:76px!important;min-width:76px!important;min-height:76px!important;line-height:76px!important}i.s78,md-icon[md-font-icon].s78{font-size:78px!important;width:78px!important;height:78px!important;min-width:78px!important;min-height:78px!important;line-height:78px!important}i.s80,md-icon[md-font-icon].s80{font-size:80px!important;width:80px!important;height:80px!important;min-width:80px!important;min-height:80px!important;line-height:80px!important}i.s82,md-icon[md-font-icon].s82{font-size:82px!important;width:82px!important;height:82px!important;min-width:82px!important;min-height:82px!important;line-height:82px!important}i.s84,md-icon[md-font-icon].s84{font-size:84px!important;width:84px!important;height:84px!important;min-width:84px!important;min-height:84px!important;line-height:84px!important}i.s86,md-icon[md-font-icon].s86{font-size:86px!important;width:86px!important;height:86px!important;min-width:86px!important;min-height:86px!important;line-height:86px!important}i.s88,md-icon[md-font-icon].s88{font-size:88px!important;width:88px!important;height:88px!important;min-width:88px!important;min-height:88px!important;line-height:88px!important}i.s90,md-icon[md-font-icon].s90{font-size:90px!important;width:90px!important;height:90px!important;min-width:90px!important;min-height:90px!important;line-height:90px!important}i.s92,md-icon[md-font-icon].s92{font-size:92px!important;width:92px!important;height:92px!important;min-width:92px!important;min-height:92px!important;line-height:92px!important}i.s94,md-icon[md-font-icon].s94{font-size:94px!important;width:94px!important;height:94px!important;min-width:94px!important;min-height:94px!important;line-height:94px!important}i.s96,md-icon[md-font-icon].s96{font-size:96px!important;width:96px!important;height:96px!important;min-width:96px!important;min-height:96px!important;line-height:96px!important}i.s98,md-icon[md-font-icon].s98{font-size:98px!important;width:98px!important;height:98px!important;min-width:98px!important;min-height:98px!important;line-height:98px!important}i.s100,md-icon[md-font-icon].s100{font-size:100px!important;width:100px!important;height:100px!important;min-width:100px!important;min-height:100px!important;line-height:100px!important}i.s102,md-icon[md-font-icon].s102{font-size:102px!important;width:102px!important;height:102px!important;min-width:102px!important;min-height:102px!important;line-height:102px!important}i.s104,md-icon[md-font-icon].s104{font-size:104px!important;width:104px!important;height:104px!important;min-width:104px!important;min-height:104px!important;line-height:104px!important}i.s106,md-icon[md-font-icon].s106{font-size:106px!important;width:106px!important;height:106px!important;min-width:106px!important;min-height:106px!important;line-height:106px!important}i.s108,md-icon[md-font-icon].s108{font-size:108px!important;width:108px!important;height:108px!important;min-width:108px!important;min-height:108px!important;line-height:108px!important}i.s110,md-icon[md-font-icon].s110{font-size:110px!important;width:110px!important;height:110px!important;min-width:110px!important;min-height:110px!important;line-height:110px!important}i.s112,md-icon[md-font-icon].s112{font-size:112px!important;width:112px!important;height:112px!important;min-width:112px!important;min-height:112px!important;line-height:112px!important}i.s114,md-icon[md-font-icon].s114{font-size:114px!important;width:114px!important;height:114px!important;min-width:114px!important;min-height:114px!important;line-height:114px!important}i.s116,md-icon[md-font-icon].s116{font-size:116px!important;width:116px!important;height:116px!important;min-width:116px!important;min-height:116px!important;line-height:116px!important}i.s118,md-icon[md-font-icon].s118{font-size:118px!important;width:118px!important;height:118px!important;min-width:118px!important;min-height:118px!important;line-height:118px!important}i.s120,md-icon[md-font-icon].s120{font-size:120px!important;width:120px!important;height:120px!important;min-width:120px!important;min-height:120px!important;line-height:120px!important}i.s122,md-icon[md-font-icon].s122{font-size:122px!important;width:122px!important;height:122px!important;min-width:122px!important;min-height:122px!important;line-height:122px!important}i.s124,md-icon[md-font-icon].s124{font-size:124px!important;width:124px!important;height:124px!important;min-width:124px!important;min-height:124px!important;line-height:124px!important}i.s126,md-icon[md-font-icon].s126{font-size:126px!important;width:126px!important;height:126px!important;min-width:126px!important;min-height:126px!important;line-height:126px!important}i.s128,md-icon[md-font-icon].s128{font-size:128px!important;width:128px!important;height:128px!important;min-width:128px!important;min-height:128px!important;line-height:128px!important}i.s130,md-icon[md-font-icon].s130{font-size:130px!important;width:130px!important;height:130px!important;min-width:130px!important;min-height:130px!important;line-height:130px!important}i.s132,md-icon[md-font-icon].s132{font-size:132px!important;width:132px!important;height:132px!important;min-width:132px!important;min-height:132px!important;line-height:132px!important}i.s134,md-icon[md-font-icon].s134{font-size:134px!important;width:134px!important;height:134px!important;min-width:134px!important;min-height:134px!important;line-height:134px!important}i.s136,md-icon[md-font-icon].s136{font-size:136px!important;width:136px!important;height:136px!important;min-width:136px!important;min-height:136px!important;line-height:136px!important}i.s138,md-icon[md-font-icon].s138{font-size:138px!important;width:138px!important;height:138px!important;min-width:138px!important;min-height:138px!important;line-height:138px!important}i.s140,md-icon[md-font-icon].s140{font-size:140px!important;width:140px!important;height:140px!important;min-width:140px!important;min-height:140px!important;line-height:140px!important}i.s142,md-icon[md-font-icon].s142{font-size:142px!important;width:142px!important;height:142px!important;min-width:142px!important;min-height:142px!important;line-height:142px!important}i.s144,md-icon[md-font-icon].s144{font-size:144px!important;width:144px!important;height:144px!important;min-width:144px!important;min-height:144px!important;line-height:144px!important}i.s146,md-icon[md-font-icon].s146{font-size:146px!important;width:146px!important;height:146px!important;min-width:146px!important;min-height:146px!important;line-height:146px!important}i.s148,md-icon[md-font-icon].s148{font-size:148px!important;width:148px!important;height:148px!important;min-width:148px!important;min-height:148px!important;line-height:148px!important}i.s150,md-icon[md-font-icon].s150{font-size:150px!important;width:150px!important;height:150px!important;min-width:150px!important;min-height:150px!important;line-height:150px!important}i.s152,md-icon[md-font-icon].s152{font-size:152px!important;width:152px!important;height:152px!important;min-width:152px!important;min-height:152px!important;line-height:152px!important}i.s154,md-icon[md-font-icon].s154{font-size:154px!important;width:154px!important;height:154px!important;min-width:154px!important;min-height:154px!important;line-height:154px!important}i.s156,md-icon[md-font-icon].s156{font-size:156px!important;width:156px!important;height:156px!important;min-width:156px!important;min-height:156px!important;line-height:156px!important}i.s158,md-icon[md-font-icon].s158{font-size:158px!important;width:158px!important;height:158px!important;min-width:158px!important;min-height:158px!important;line-height:158px!important}i.s160,md-icon[md-font-icon].s160{font-size:160px!important;width:160px!important;height:160px!important;min-width:160px!important;min-height:160px!important;line-height:160px!important}i.s162,md-icon[md-font-icon].s162{font-size:162px!important;width:162px!important;height:162px!important;min-width:162px!important;min-height:162px!important;line-height:162px!important}i.s164,md-icon[md-font-icon].s164{font-size:164px!important;width:164px!important;height:164px!important;min-width:164px!important;min-height:164px!important;line-height:164px!important}i.s166,md-icon[md-font-icon].s166{font-size:166px!important;width:166px!important;height:166px!important;min-width:166px!important;min-height:166px!important;line-height:166px!important}i.s168,md-icon[md-font-icon].s168{font-size:168px!important;width:168px!important;height:168px!important;min-width:168px!important;min-height:168px!important;line-height:168px!important}i.s170,md-icon[md-font-icon].s170{font-size:170px!important;width:170px!important;height:170px!important;min-width:170px!important;min-height:170px!important;line-height:170px!important}i.s172,md-icon[md-font-icon].s172{font-size:172px!important;width:172px!important;height:172px!important;min-width:172px!important;min-height:172px!important;line-height:172px!important}i.s174,md-icon[md-font-icon].s174{font-size:174px!important;width:174px!important;height:174px!important;min-width:174px!important;min-height:174px!important;line-height:174px!important}i.s176,md-icon[md-font-icon].s176{font-size:176px!important;width:176px!important;height:176px!important;min-width:176px!important;min-height:176px!important;line-height:176px!important}i.s178,md-icon[md-font-icon].s178{font-size:178px!important;width:178px!important;height:178px!important;min-width:178px!important;min-height:178px!important;line-height:178px!important}i.s180,md-icon[md-font-icon].s180{font-size:180px!important;width:180px!important;height:180px!important;min-width:180px!important;min-height:180px!important;line-height:180px!important}i.s182,md-icon[md-font-icon].s182{font-size:182px!important;width:182px!important;height:182px!important;min-width:182px!important;min-height:182px!important;line-height:182px!important}i.s184,md-icon[md-font-icon].s184{font-size:184px!important;width:184px!important;height:184px!important;min-width:184px!important;min-height:184px!important;line-height:184px!important}i.s186,md-icon[md-font-icon].s186{font-size:186px!important;width:186px!important;height:186px!important;min-width:186px!important;min-height:186px!important;line-height:186px!important}i.s188,md-icon[md-font-icon].s188{font-size:188px!important;width:188px!important;height:188px!important;min-width:188px!important;min-height:188px!important;line-height:188px!important}i.s190,md-icon[md-font-icon].s190{font-size:190px!important;width:190px!important;height:190px!important;min-width:190px!important;min-height:190px!important;line-height:190px!important}i.s192,md-icon[md-font-icon].s192{font-size:192px!important;width:192px!important;height:192px!important;min-width:192px!important;min-height:192px!important;line-height:192px!important}i.s194,md-icon[md-font-icon].s194{font-size:194px!important;width:194px!important;height:194px!important;min-width:194px!important;min-height:194px!important;line-height:194px!important}i.s196,md-icon[md-font-icon].s196{font-size:196px!important;width:196px!important;height:196px!important;min-width:196px!important;min-height:196px!important;line-height:196px!important}i.s198,md-icon[md-font-icon].s198{font-size:198px!important;width:198px!important;height:198px!important;min-width:198px!important;min-height:198px!important;line-height:198px!important}i.s200,md-icon[md-font-icon].s200{font-size:200px!important;width:200px!important;height:200px!important;min-width:200px!important;min-height:200px!important;line-height:200px!important}i.s202,md-icon[md-font-icon].s202{font-size:202px!important;width:202px!important;height:202px!important;min-width:202px!important;min-height:202px!important;line-height:202px!important}i.s204,md-icon[md-font-icon].s204{font-size:204px!important;width:204px!important;height:204px!important;min-width:204px!important;min-height:204px!important;line-height:204px!important}i.s206,md-icon[md-font-icon].s206{font-size:206px!important;width:206px!important;height:206px!important;min-width:206px!important;min-height:206px!important;line-height:206px!important}i.s208,md-icon[md-font-icon].s208{font-size:208px!important;width:208px!important;height:208px!important;min-width:208px!important;min-height:208px!important;line-height:208px!important}i.s210,md-icon[md-font-icon].s210{font-size:210px!important;width:210px!important;height:210px!important;min-width:210px!important;min-height:210px!important;line-height:210px!important}i.s212,md-icon[md-font-icon].s212{font-size:212px!important;width:212px!important;height:212px!important;min-width:212px!important;min-height:212px!important;line-height:212px!important}i.s214,md-icon[md-font-icon].s214{font-size:214px!important;width:214px!important;height:214px!important;min-width:214px!important;min-height:214px!important;line-height:214px!important}i.s216,md-icon[md-font-icon].s216{font-size:216px!important;width:216px!important;height:216px!important;min-width:216px!important;min-height:216px!important;line-height:216px!important}i.s218,md-icon[md-font-icon].s218{font-size:218px!important;width:218px!important;height:218px!important;min-width:218px!important;min-height:218px!important;line-height:218px!important}i.s220,md-icon[md-font-icon].s220{font-size:220px!important;width:220px!important;height:220px!important;min-width:220px!important;min-height:220px!important;line-height:220px!important}i.s222,md-icon[md-font-icon].s222{font-size:222px!important;width:222px!important;height:222px!important;min-width:222px!important;min-height:222px!important;line-height:222px!important}i.s224,md-icon[md-font-icon].s224{font-size:224px!important;width:224px!important;height:224px!important;min-width:224px!important;min-height:224px!important;line-height:224px!important}i.s226,md-icon[md-font-icon].s226{font-size:226px!important;width:226px!important;height:226px!important;min-width:226px!important;min-height:226px!important;line-height:226px!important}i.s228,md-icon[md-font-icon].s228{font-size:228px!important;width:228px!important;height:228px!important;min-width:228px!important;min-height:228px!important;line-height:228px!important}i.s230,md-icon[md-font-icon].s230{font-size:230px!important;width:230px!important;height:230px!important;min-width:230px!important;min-height:230px!important;line-height:230px!important}i.s232,md-icon[md-font-icon].s232{font-size:232px!important;width:232px!important;height:232px!important;min-width:232px!important;min-height:232px!important;line-height:232px!important}i.s234,md-icon[md-font-icon].s234{font-size:234px!important;width:234px!important;height:234px!important;min-width:234px!important;min-height:234px!important;line-height:234px!important}i.s236,md-icon[md-font-icon].s236{font-size:236px!important;width:236px!important;height:236px!important;min-width:236px!important;min-height:236px!important;line-height:236px!important}i.s238,md-icon[md-font-icon].s238{font-size:238px!important;width:238px!important;height:238px!important;min-width:238px!important;min-height:238px!important;line-height:238px!important}i.s240,md-icon[md-font-icon].s240{font-size:240px!important;width:240px!important;height:240px!important;min-width:240px!important;min-height:240px!important;line-height:240px!important}i.s242,md-icon[md-font-icon].s242{font-size:242px!important;width:242px!important;height:242px!important;min-width:242px!important;min-height:242px!important;line-height:242px!important}i.s244,md-icon[md-font-icon].s244{font-size:244px!important;width:244px!important;height:244px!important;min-width:244px!important;min-height:244px!important;line-height:244px!important}i.s246,md-icon[md-font-icon].s246{font-size:246px!important;width:246px!important;height:246px!important;min-width:246px!important;min-height:246px!important;line-height:246px!important}i.s248,md-icon[md-font-icon].s248{font-size:248px!important;width:248px!important;height:248px!important;min-width:248px!important;min-height:248px!important;line-height:248px!important}i.s250,md-icon[md-font-icon].s250{font-size:250px!important;width:250px!important;height:250px!important;min-width:250px!important;min-height:250px!important;line-height:250px!important}i.s252,md-icon[md-font-icon].s252{font-size:252px!important;width:252px!important;height:252px!important;min-width:252px!important;min-height:252px!important;line-height:252px!important}i.s254,md-icon[md-font-icon].s254{font-size:254px!important;width:254px!important;height:254px!important;min-width:254px!important;min-height:254px!important;line-height:254px!important}i.s256,md-icon[md-font-icon].s256{font-size:256px!important;width:256px!important;height:256px!important;min-width:256px!important;min-height:256px!important;line-height:256px!important}@font-face{font-family:icomoon;src:url(../assets/icons/fonts/icomoon.eot?5km1tg);src:url(../assets/icons/fonts/icomoon.eot?#iefix5km1tg) format("embedded-opentype"),url(../assets/icons/fonts/icomoon.ttf?5km1tg) format("truetype"),url(../assets/icons/fonts/icomoon.woff?5km1tg) format("woff"),url(../assets/icons/fonts/icomoon.svg?5km1tg#icomoon) format("svg");font-weight:400;font-style:normal}[class*=' icon-'],[class^=icon-]{font-family:icomoon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-account-alert:before{content:'\e600'}.icon-account-box-outline:before{content:'\e601'}.icon-account-box:before{content:'\e602'}.icon-account-check:before{content:'\e603'}.icon-account-circle:before{content:'\e604'}.icon-account-key:before{content:'\e605'}.icon-account-location:before{content:'\e606'}.icon-account-minus:before{content:'\e607'}.icon-account-multiple-outline:before{content:'\e608'}.icon-account-multiple-plus:before{content:'\e609'}.icon-account-multiple:before{content:'\e60a'}.icon-account-network:before{content:'\e60b'}.icon-account-outline:before{content:'\e60c'}.icon-account-plus:before{content:'\e60d'}.icon-account-remove:before{content:'\e60e'}.icon-account-search:before{content:'\e60f'}.icon-account-switch:before{content:'\e610'}.icon-account:before{content:'\e611'}.icon-airballoon:before{content:'\e612'}.icon-airplane-off:before{content:'\e613'}.icon-airplane:before{content:'\e614'}.icon-alarm-check:before{content:'\e615'}.icon-alarm-multiple:before{content:'\e616'}.icon-alarm-off:before{content:'\e617'}.icon-alarm-plus:before{content:'\e618'}.icon-alarm:before{content:'\e619'}.icon-album:before{content:'\e61a'}.icon-alert-box:before{content:'\e61b'}.icon-alert-circle:before{content:'\e61c'}.icon-alert-octagon:before{content:'\e61d'}.icon-alert:before{content:'\e61e'}.icon-alpha:before{content:'\e61f'}.icon-alphabetical:before{content:'\e620'}.icon-amazon-clouddrive:before{content:'\e621'}.icon-amazon:before{content:'\e622'}.icon-ambulance:before{content:'\e623'}.icon-android-debug-bridge:before{content:'\e624'}.icon-android-studio:before{content:'\e625'}.icon-android:before{content:'\e626'}.icon-apple-finder:before{content:'\e627'}.icon-apple-ios:before{content:'\e628'}.icon-apple-mobileme:before{content:'\e629'}.icon-apple-safari:before{content:'\e62a'}.icon-apple:before{content:'\e62b'}.icon-appnet:before{content:'\e62c'}.icon-apps:before{content:'\e62d'}.icon-archive:before{content:'\e62e'}.icon-arrange-bring-forward:before{content:'\e62f'}.icon-arrange-bring-to-front:before{content:'\e630'}.icon-arrange-send-backward:before{content:'\e631'}.icon-arrange-send-to-back:before{content:'\e632'}.icon-arrow-all:before{content:'\e633'}.icon-arrow-bottom-left:before{content:'\e634'}.icon-arrow-bottom-right:before{content:'\e635'}.icon-arrow-collapse:before{content:'\e636'}.icon-arrow-down-bold-circle-outline:before{content:'\e637'}.icon-arrow-down-bold-circle:before{content:'\e638'}.icon-arrow-down-bold-hexagon-outline:before{content:'\e639'}.icon-arrow-down-bold:before{content:'\e63a'}.icon-arrow-down:before{content:'\e63b'}.icon-arrow-expand:before{content:'\e63c'}.icon-arrow-left-bold-circle-outline:before{content:'\e63d'}.icon-arrow-left-bold-circle:before{content:'\e63e'}.icon-arrow-left-bold-hexagon-outline:before{content:'\e63f'}.icon-arrow-left-bold:before{content:'\e640'}.icon-arrow-left:before{content:'\e641'}.icon-arrow-right-bold-circle-outline:before{content:'\e642'}.icon-arrow-right-bold-circle:before{content:'\e643'}.icon-arrow-right-bold-hexagon-outline:before{content:'\e644'}.icon-arrow-right-bold:before{content:'\e645'}.icon-arrow-right:before{content:'\e646'}.icon-arrow-top-left:before{content:'\e647'}.icon-arrow-top-right:before{content:'\e648'}.icon-arrow-up-bold-circle-outline:before{content:'\e649'}.icon-arrow-up-bold-circle:before{content:'\e64a'}.icon-arrow-up-bold-hexagon-outline:before{content:'\e64b'}.icon-arrow-up-bold:before{content:'\e64c'}.icon-arrow-up:before{content:'\e64d'}.icon-at:before{content:'\e64e'}.icon-attachment:before{content:'\e64f'}.icon-audiobook:before{content:'\e650'}.icon-auto-fix:before{content:'\e651'}.icon-auto-upload:before{content:'\e652'}.icon-baby:before{content:'\e653'}.icon-backburger:before{content:'\e654'}.icon-backup-restore:before{content:'\e655'}.icon-bank:before{content:'\e656'}.icon-barcode:before{content:'\e657'}.icon-barley:before{content:'\e658'}.icon-barrel:before{content:'\e659'}.icon-basecamp:before{content:'\e65a'}.icon-basket-fill:before{content:'\e65b'}.icon-basket-unfill:before{content:'\e65c'}.icon-basket:before{content:'\e65d'}.icon-battery-10:before{content:'\e65e'}.icon-battery-20:before{content:'\e65f'}.icon-battery-30:before{content:'\e660'}.icon-battery-40:before{content:'\e661'}.icon-battery-50:before{content:'\e662'}.icon-battery-60:before{content:'\e663'}.icon-battery-70:before{content:'\e664'}.icon-battery-80:before{content:'\e665'}.icon-battery-90:before{content:'\e666'}.icon-battery-alert:before{content:'\e667'}.icon-battery-charging-20:before{content:'\e668'}.icon-battery-charging-30:before{content:'\e669'}.icon-battery-charging-40:before{content:'\e66a'}.icon-battery-charging-60:before{content:'\e66b'}.icon-battery-charging-80:before{content:'\e66c'}.icon-battery-charging-90:before{content:'\e66d'}.icon-battery-charging-100:before{content:'\e66e'}.icon-battery-minus:before{content:'\e66f'}.icon-battery-negative:before{content:'\e670'}.icon-battery-outline:before{content:'\e671'}.icon-battery-plus:before{content:'\e672'}.icon-battery-positive:before{content:'\e673'}.icon-battery-standard:before{content:'\e674'}.icon-battery-unknown:before{content:'\e675'}.icon-battery:before{content:'\e676'}.icon-beach:before{content:'\e677'}.icon-beaker-empty-outline:before{content:'\e678'}.icon-beaker-empty:before{content:'\e679'}.icon-beaker-outline:before{content:'\e67a'}.icon-beaker:before{content:'\e67b'}.icon-beats:before{content:'\e67c'}.icon-beer:before{content:'\e67d'}.icon-behance:before{content:'\e67e'}.icon-bell-off:before{content:'\e67f'}.icon-bell-outline:before{content:'\e680'}.icon-bell-ring-outline:before{content:'\e681'}.icon-bell-ring:before{content:'\e682'}.icon-bell-sleep:before{content:'\e683'}.icon-bell:before{content:'\e684'}.icon-beta:before{content:'\e685'}.icon-bike:before{content:'\e686'}.icon-bing:before{content:'\e687'}.icon-binoculars:before{content:'\e688'}.icon-bio:before{content:'\e689'}.icon-bitbucket:before{content:'\e68a'}.icon-black-mesa:before{content:'\e68b'}.icon-blackberry:before{content:'\e68c'}.icon-blinds:before{content:'\e68d'}.icon-block-helper:before{content:'\e68e'}.icon-blogger:before{content:'\e68f'}.icon-bluetooth-audio:before{content:'\e690'}.icon-bluetooth-connect:before{content:'\e691'}.icon-bluetooth-settings:before{content:'\e692'}.icon-bluetooth-transfer:before{content:'\e693'}.icon-bluetooth:before{content:'\e694'}.icon-blur-linear:before{content:'\e695'}.icon-blur-off:before{content:'\e696'}.icon-blur-radial:before{content:'\e697'}.icon-blur:before{content:'\e698'}.icon-bone:before{content:'\e699'}.icon-book-multiple-variant:before{content:'\e69a'}.icon-book-multiple:before{content:'\e69b'}.icon-book-open:before{content:'\e69c'}.icon-book-variant:before{content:'\e69d'}.icon-book:before{content:'\e69e'}.icon-bookmark-check:before{content:'\e69f'}.icon-bookmark-music:before{content:'\e6a0'}.icon-bookmark-outline-plus:before{content:'\e6a1'}.icon-bookmark-outline:before{content:'\e6a2'}.icon-bookmark-plus:before{content:'\e6a3'}.icon-bookmark-remove:before{content:'\e6a4'}.icon-bookmark:before{content:'\e6a5'}.icon-border-all:before{content:'\e6a6'}.icon-border-bottom:before{content:'\e6a7'}.icon-border-color:before{content:'\e6a8'}.icon-border-horizontal:before{content:'\e6a9'}.icon-border-inside:before{content:'\e6aa'}.icon-border-left:before{content:'\e6ab'}.icon-border-none:before{content:'\e6ac'}.icon-border-outside:before{content:'\e6ad'}.icon-border-right:before{content:'\e6ae'}.icon-border-top:before{content:'\e6af'}.icon-border-vertical:before{content:'\e6b0'}.icon-bowling:before{content:'\e6b1'}.icon-box-download:before{content:'\e6b2'}.icon-box-upload:before{content:'\e6b3'}.icon-box:before{content:'\e6b4'}.icon-briefcase-checked:before{content:'\e6b5'}.icon-briefcase-download:before{content:'\e6b6'}.icon-briefcase-upload:before{content:'\e6b7'}.icon-briefcase:before{content:'\e6b8'}.icon-brightness-1:before{content:'\e6b9'}.icon-brightness-2:before{content:'\e6ba'}.icon-brightness-3:before{content:'\e6bb'}.icon-brightness-4:before{content:'\e6bc'}.icon-brightness-5:before{content:'\e6bd'}.icon-brightness-6:before{content:'\e6be'}.icon-brightness-7:before{content:'\e6bf'}.icon-brightness-auto:before{content:'\e6c0'}.icon-brightness:before{content:'\e6c1'}.icon-broom:before{content:'\e6c2'}.icon-brush:before{content:'\e6c3'}.icon-bug:before{content:'\e6c4'}.icon-bulletin-board:before{content:'\e6c5'}.icon-bullhorn:before{content:'\e6c6'}.icon-bus:before{content:'\e6c7'}.icon-cake-variant:before{content:'\e6c8'}.icon-cake:before{content:'\e6c9'}.icon-calculator:before{content:'\e6ca'}.icon-calendar-blank:before{content:'\e6cb'}.icon-calendar-check-multiple:before{content:'\e6cc'}.icon-calendar-check:before{content:'\e6cd'}.icon-calendar-clock:before{content:'\e6ce'}.icon-calendar-multiple:before{content:'\e6cf'}.icon-calendar-plus:before{content:'\e6d0'}.icon-calendar-remove:before{content:'\e6d1'}.icon-calendar-select:before{content:'\e6d2'}.icon-calendar-text:before{content:'\e6d3'}.icon-calendar-today:before{content:'\e6d4'}.icon-calendar:before{content:'\e6d5'}.icon-camcorder-box-off:before{content:'\e6d6'}.icon-camcorder-box:before{content:'\e6d7'}.icon-camcorder-off:before{content:'\e6d8'}.icon-camcorder:before{content:'\e6d9'}.icon-camera-front-variant:before{content:'\e6da'}.icon-camera-front:before{content:'\e6db'}.icon-camera-iris:before{content:'\e6dc'}.icon-camera-party-mode:before{content:'\e6dd'}.icon-camera-rear-variant:before{content:'\e6de'}.icon-camera-rear:before{content:'\e6df'}.icon-camera-switch:before{content:'\e6e0'}.icon-camera-timer:before{content:'\e6e1'}.icon-camera:before{content:'\e6e2'}.icon-cancel:before{content:'\e6e3'}.icon-candycane:before{content:'\e6e4'}.icon-car-wash:before{content:'\e6e5'}.icon-car:before{content:'\e6e6'}.icon-carrot:before{content:'\e6e7'}.icon-cart-outline:before{content:'\e6e8'}.icon-cart:before{content:'\e6e9'}.icon-cash-100:before{content:'\e6ea'}.icon-cash-multiple:before{content:'\e6eb'}.icon-cash-usd:before{content:'\e6ec'}.icon-cash:before{content:'\e6ed'}.icon-cast-connected:before{content:'\e6ee'}.icon-cast:before{content:'\e6ef'}.icon-castle:before{content:'\e6f0'}.icon-cat:before{content:'\e6f1'}.icon-cellphone-android:before{content:'\e6f2'}.icon-cellphone-dock:before{content:'\e6f3'}.icon-cellphone-iphone:before{content:'\e6f4'}.icon-cellphone-link-off:before{content:'\e6f5'}.icon-cellphone-link:before{content:'\e6f6'}.icon-cellphone-settings:before{content:'\e6f7'}.icon-cellphone:before{content:'\e6f8'}.icon-chair-school:before{content:'\e6f9'}.icon-chart-arc:before{content:'\e6fa'}.icon-chart-areaspline:before{content:'\e6fb'}.icon-chart-bar:before{content:'\e6fc'}.icon-chart-histogram:before{content:'\e6fd'}.icon-chart-line:before{content:'\e6fe'}.icon-chart-pie:before{content:'\e6ff'}.icon-check-all:before{content:'\e700'}.icon-check-bookmark:before{content:'\e701'}.icon-check-circle:before{content:'\e702'}.icon-check:before{content:'\e703'}.icon-checkbox-blank-circle-outline:before{content:'\e704'}.icon-checkbox-blank-circle:before{content:'\e705'}.icon-checkbox-blank-outline:before{content:'\e706'}.icon-checkbox-blank:before{content:'\e707'}.icon-checkbox-marked-circle-outline:before{content:'\e708'}.icon-checkbox-marked-circle:before{content:'\e709'}.icon-checkbox-marked-outline:before{content:'\e70a'}.icon-checkbox-marked:before{content:'\e70b'}.icon-checkbox-multiple-blank-outline:before{content:'\e70c'}.icon-checkbox-multiple-blank:before{content:'\e70d'}.icon-checkbox-multiple-marked-outline:before{content:'\e70e'}.icon-checkbox-multiple-marked:before{content:'\e70f'}.icon-checkerboard:before{content:'\e710'}.icon-chevron-double-down:before{content:'\e711'}.icon-chevron-double-left:before{content:'\e712'}.icon-chevron-double-right:before{content:'\e713'}.icon-chevron-double-up:before{content:'\e714'}.icon-chevron-down:before{content:'\e715'}.icon-chevron-left:before{content:'\e716'}.icon-chevron-right:before{content:'\e717'}.icon-chevron-up:before{content:'\e718'}.icon-church:before{content:'\e719'}.icon-cisco-webex:before{content:'\e71a'}.icon-city:before{content:'\e71b'}.icon-clapperboard:before{content:'\e71c'}.icon-clipboard-account:before{content:'\e71d'}.icon-clipboard-alert:before{content:'\e71e'}.icon-clipboard-arrow-down:before{content:'\e71f'}.icon-clipboard-arrow-left:before{content:'\e720'}.icon-clipboard-check:before{content:'\e721'}.icon-clipboard-outline:before{content:'\e722'}.icon-clipboard-text:before{content:'\e723'}.icon-clipboard:before{content:'\e724'}.icon-clippy:before{content:'\e725'}.icon-clock-fast:before{content:'\e726'}.icon-clock:before{content:'\e727'}.icon-close-circle-outline:before{content:'\e728'}.icon-close-circle:before{content:'\e729'}.icon-close-network:before{content:'\e72a'}.icon-close:before{content:'\e72b'}.icon-closed-caption:before{content:'\e72c'}.icon-cloud-check:before{content:'\e72d'}.icon-cloud-circle:before{content:'\e72e'}.icon-cloud-download:before{content:'\e72f'}.icon-cloud-outline-off:before{content:'\e730'}.icon-cloud-outline:before{content:'\e731'}.icon-cloud-upload:before{content:'\e732'}.icon-cloud:before{content:'\e733'}.icon-code-array:before{content:'\e734'}.icon-code-braces:before{content:'\e735'}.icon-code-equal:before{content:'\e736'}.icon-code-greater-than-or-equal:before{content:'\e737'}.icon-code-greater-than:before{content:'\e738'}.icon-code-less-than-or-equal:before{content:'\e739'}.icon-code-less-than:before{content:'\e73a'}.icon-code-not-equal-variant:before{content:'\e73b'}.icon-code-not-equal:before{content:'\e73c'}.icon-code-string:before{content:'\e73d'}.icon-code-tags:before{content:'\e73e'}.icon-codepen:before{content:'\e73f'}.icon-coffee-to-go:before{content:'\e740'}.icon-coffee:before{content:'\e741'}.icon-cog-box:before{content:'\e742'}.icon-cog:before{content:'\e743'}.icon-coin:before{content:'\e744'}.icon-color-helper:before{content:'\e745'}.icon-comment-account-outline:before{content:'\e746'}.icon-comment-account:before{content:'\e747'}.icon-comment-alert-outline:before{content:'\e748'}.icon-comment-alert:before{content:'\e749'}.icon-comment-check-outline:before{content:'\e74a'}.icon-comment-check:before{content:'\e74b'}.icon-comment-multipe-outline:before{content:'\e74c'}.icon-comment-outline:before{content:'\e74d'}.icon-comment-plus-outline:before{content:'\e74e'}.icon-comment-processing-outline:before{content:'\e74f'}.icon-comment-processing:before{content:'\e750'}.icon-comment-remove-outline:before{content:'\e751'}.icon-comment-text-outline:before{content:'\e752'}.icon-comment-text:before{content:'\e753'}.icon-comment:before{content:'\e754'}.icon-compare:before{content:'\e755'}.icon-compass-outline:before{content:'\e756'}.icon-compass:before{content:'\e757'}.icon-console:before{content:'\e758'}.icon-content-copy:before{content:'\e759'}.icon-content-cut:before{content:'\e75a'}.icon-content-duplicate:before{content:'\e75b'}.icon-content-paste:before{content:'\e75c'}.icon-content-save-all:before{content:'\e75d'}.icon-content-save:before{content:'\e75e'}.icon-contrast-box:before{content:'\e75f'}.icon-contrast-circle:before{content:'\e760'}.icon-contrast:before{content:'\e761'}.icon-controller-xbox:before{content:'\e762'}.icon-cow:before{content:'\e763'}.icon-credit-card-multiple:before{content:'\e764'}.icon-credit-card:before{content:'\e765'}.icon-crop-free:before{content:'\e766'}.icon-crop-landscape:before{content:'\e767'}.icon-crop-portrait:before{content:'\e768'}.icon-crop-square:before{content:'\e769'}.icon-crop:before{content:'\e76a'}.icon-crosshairs-gps:before{content:'\e76b'}.icon-crosshairs:before{content:'\e76c'}.icon-crown:before{content:'\e76d'}.icon-cube-outline:before{content:'\e76e'}.icon-cube-unfolded:before{content:'\e76f'}.icon-cube:before{content:'\e770'}.icon-cup-water:before{content:'\e771'}.icon-cup:before{content:'\e772'}.icon-currency-btc:before{content:'\e773'}.icon-currency-eur:before{content:'\e774'}.icon-currency-gbp:before{content:'\e775'}.icon-currency-inr:before{content:'\e776'}.icon-currency-rub:before{content:'\e777'}.icon-currency-try:before{content:'\e778'}.icon-currency-usd:before{content:'\e779'}.icon-cursor-default-outline:before{content:'\e77a'}.icon-cursor-default:before{content:'\e77b'}.icon-cursor-move:before{content:'\e77c'}.icon-cursor-pointer:before{content:'\e77d'}.icon-data:before{content:'\e77e'}.icon-debug-step-into:before{content:'\e77f'}.icon-debug-step-out:before{content:'\e780'}.icon-debug-step-over:before{content:'\e781'}.icon-decimal-decrease:before{content:'\e782'}.icon-decimal-increase:before{content:'\e783'}.icon-delete-variant:before{content:'\e784'}.icon-delete:before{content:'\e785'}.icon-deskphone:before{content:'\e786'}.icon-desktop-mac:before{content:'\e787'}.icon-desktop-tower:before{content:'\e788'}.icon-details:before{content:'\e789'}.icon-deviantart:before{content:'\e78a'}.icon-diamond:before{content:'\e78b'}.icon-dice-1:before{content:'\e78c'}.icon-dice-2:before{content:'\e78d'}.icon-dice-3:before{content:'\e78e'}.icon-dice-4:before{content:'\e78f'}.icon-dice-5:before{content:'\e790'}.icon-dice-6:before{content:'\e791'}.icon-dice:before{content:'\e792'}.icon-directions:before{content:'\e793'}.icon-disk-alert:before{content:'\e794'}.icon-disqus-outline:before{content:'\e795'}.icon-disqus:before{content:'\e796'}.icon-division-box:before{content:'\e797'}.icon-division:before{content:'\e798'}.icon-dns:before{content:'\e799'}.icon-document:before{content:'\e79a'}.icon-domain:before{content:'\e79b'}.icon-dots-horizontal:before{content:'\e79c'}.icon-dots-vertical:before{content:'\e79d'}.icon-download:before{content:'\e79e'}.icon-drag-horizontal:before{content:'\e79f'}.icon-drag-vertical:before{content:'\e7a0'}.icon-drag:before{content:'\e7a1'}.icon-drawing-box:before{content:'\e7a2'}.icon-drawing:before{content:'\e7a3'}.icon-dribbble-box:before{content:'\e7a4'}.icon-dribbble:before{content:'\e7a5'}.icon-drone:before{content:'\e7a6'}.icon-dropbox:before{content:'\e7a7'}.icon-drupal:before{content:'\e7a8'}.icon-duck:before{content:'\e7a9'}.icon-dumbbell:before{content:'\e7aa'}.icon-earth-off:before{content:'\e7ab'}.icon-earth:before{content:'\e7ac'}.icon-ebay:before{content:'\e7ad'}.icon-edge:before{content:'\e7ae'}.icon-eject:before{content:'\e7af'}.icon-elevation-decline:before{content:'\e7b0'}.icon-elevation-rise:before{content:'\e7b1'}.icon-elevator:before{content:'\e7b2'}.icon-email-open:before{content:'\e7b3'}.icon-email-secure:before{content:'\e7b4'}.icon-email:before{content:'\e7b5'}.icon-emoticon-cool:before{content:'\e7b6'}.icon-emoticon-devil:before{content:'\e7b7'}.icon-emoticon-happy:before{content:'\e7b8'}.icon-emoticon-neutral:before{content:'\e7b9'}.icon-emoticon-poop:before{content:'\e7ba'}.icon-emoticon-sad:before{content:'\e7bb'}.icon-emoticon-tongue:before{content:'\e7bc'}.icon-emoticon:before{content:'\e7bd'}.icon-engine-outline:before{content:'\e7be'}.icon-engine:before{content:'\e7bf'}.icon-equal-box:before{content:'\e7c0'}.icon-equal:before{content:'\e7c1'}.icon-eraser:before{content:'\e7c2'}.icon-escalator:before{content:'\e7c3'}.icon-etsy:before{content:'\e7c4'}.icon-evernote:before{content:'\e7c5'}.icon-exclamation:before{content:'\e7c6'}.icon-exit-to-app:before{content:'\e7c7'}.icon-export:before{content:'\e7c8'}.icon-eye-off:before{content:'\e7c9'}.icon-eye:before{content:'\e7ca'}.icon-eyedropper-variant:before{content:'\e7cb'}.icon-eyedropper:before{content:'\e7cc'}.icon-facebook-box:before{content:'\e7cd'}.icon-facebook:before{content:'\e7ce'}.icon-factory:before{content:'\e7cf'}.icon-fan:before{content:'\e7d0'}.icon-fast-forward:before{content:'\e7d1'}.icon-ferry:before{content:'\e7d2'}.icon-file-cloud:before{content:'\e7d3'}.icon-file-delimited:before{content:'\e7d4'}.icon-file-document-box:before{content:'\e7d5'}.icon-file-document:before{content:'\e7d6'}.icon-file-excel-box:before{content:'\e7d7'}.icon-file-excel:before{content:'\e7d8'}.icon-file-find:before{content:'\e7d9'}.icon-file-hidden:before{content:'\e7da'}.icon-file-image-box:before{content:'\e7db'}.icon-file-image:before{content:'\e7dc'}.icon-file-multiple:before{content:'\e7dd'}.icon-file-music:before{content:'\e7de'}.icon-file-outline:before{content:'\e7df'}.icon-file-pdf-box:before{content:'\e7e0'}.icon-file-pdf:before{content:'\e7e1'}.icon-file-powerpoint-box:before{content:'\e7e2'}.icon-file-powerpoint:before{content:'\e7e3'}.icon-file-presentation-box:before{content:'\e7e4'}.icon-file-video:before{content:'\e7e5'}.icon-file-word-box:before{content:'\e7e6'}.icon-file-word:before{content:'\e7e7'}.icon-file-xml:before{content:'\e7e8'}.icon-file:before{content:'\e7e9'}.icon-fill:before{content:'\e7ea'}.icon-film:before{content:'\e7eb'}.icon-filmstrip-off:before{content:'\e7ec'}.icon-filmstrip:before{content:'\e7ed'}.icon-filter-outline:before{content:'\e7ee'}.icon-filter-remove-outline:before{content:'\e7ef'}.icon-filter-remove:before{content:'\e7f0'}.icon-filter-variant:before{content:'\e7f1'}.icon-filter:before{content:'\e7f2'}.icon-fire:before{content:'\e7f3'}.icon-fish:before{content:'\e7f4'}.icon-flag-checkered-variant:before{content:'\e7f5'}.icon-flag-checkered:before{content:'\e7f6'}.icon-flag-outline-variant:before{content:'\e7f7'}.icon-flag-outline:before{content:'\e7f8'}.icon-flag-triangle:before{content:'\e7f9'}.icon-flag-variant:before{content:'\e7fa'}.icon-flag:before{content:'\e7fb'}.icon-flash-auto:before{content:'\e7fc'}.icon-flash-off:before{content:'\e7fd'}.icon-flash:before{content:'\e7fe'}.icon-flashlight-off:before{content:'\e7ff'}.icon-flashlight:before{content:'\e800'}.icon-flattr:before{content:'\e801'}.icon-flickr-after:before{content:'\e802'}.icon-flickr-before:before{content:'\e803'}.icon-flip-to-back:before{content:'\e804'}.icon-flip-to-front:before{content:'\e805'}.icon-floppy:before{content:'\e806'}.icon-flower:before{content:'\e807'}.icon-folder-account:before{content:'\e808'}.icon-folder-download:before{content:'\e809'}.icon-folder-google-drive:before{content:'\e80a'}.icon-folder-image:before{content:'\e80b'}.icon-folder-lock-open:before{content:'\e80c'}.icon-folder-lock:before{content:'\e80d'}.icon-folder-move:before{content:'\e80e'}.icon-folder-multiple-image:before{content:'\e80f'}.icon-folder-multiple-outline:before{content:'\e810'}.icon-folder-multiple:before{content:'\e811'}.icon-folder-outline-lock:before{content:'\e812'}.icon-folder-outline:before{content:'\e813'}.icon-folder-plus:before{content:'\e814'}.icon-folder-remove:before{content:'\e815'}.icon-folder-upload:before{content:'\e816'}.icon-folder:before{content:'\e817'}.icon-food-apple:before{content:'\e818'}.icon-food-variant:before{content:'\e819'}.icon-food:before{content:'\e81a'}.icon-football-helmet:before{content:'\e81b'}.icon-football:before{content:'\e81c'}.icon-format-align-center:before{content:'\e81d'}.icon-format-align-justify:before{content:'\e81e'}.icon-format-align-left:before{content:'\e81f'}.icon-format-align-right:before{content:'\e820'}.icon-format-bold:before{content:'\e821'}.icon-format-clear:before{content:'\e822'}.icon-format-color-fill:before{content:'\e823'}.icon-format-color:before{content:'\e824'}.icon-format-float-center:before{content:'\e825'}.icon-format-float-left:before{content:'\e826'}.icon-format-float-none:before{content:'\e827'}.icon-format-float-right:before{content:'\e828'}.icon-format-header-1:before{content:'\e829'}.icon-format-header-2:before{content:'\e82a'}.icon-format-header-3:before{content:'\e82b'}.icon-format-header-4:before{content:'\e82c'}.icon-format-header-5:before{content:'\e82d'}.icon-format-header-6:before{content:'\e82e'}.icon-format-header-decrease:before{content:'\e82f'}.icon-format-header-down:before{content:'\e830'}.icon-format-header-equal:before{content:'\e831'}.icon-format-header-increase:before{content:'\e832'}.icon-format-header-pound:before{content:'\e833'}.icon-format-header-up:before{content:'\e834'}.icon-format-indent-decrease:before{content:'\e835'}.icon-format-indent-increase:before{content:'\e836'}.icon-format-italic:before{content:'\e837'}.icon-format-line-spacing:before{content:'\e838'}.icon-format-list-bulleted:before{content:'\e839'}.icon-format-list-numbers:before{content:'\e83a'}.icon-format-object-inline:before{content:'\e83b'}.icon-format-object-square:before{content:'\e83c'}.icon-format-object-tight:before{content:'\e83d'}.icon-format-object-top-bottom:before{content:'\e83e'}.icon-format-paint:before{content:'\e83f'}.icon-format-paragraph:before{content:'\e840'}.icon-format-quote:before{content:'\e841'}.icon-format-size:before{content:'\e842'}.icon-format-strikethrough:before{content:'\e843'}.icon-format-subscript:before{content:'\e844'}.icon-format-superscript:before{content:'\e845'}.icon-format-text:before{content:'\e846'}.icon-format-textdirection-l-to-r:before{content:'\e847'}.icon-format-textdirection-r-to-l:before{content:'\e848'}.icon-format-underline:before{content:'\e849'}.icon-forum:before{content:'\e84a'}.icon-forward:before{content:'\e84b'}.icon-foursquare:before{content:'\e84c'}.icon-fridge:before{content:'\e84d'}.icon-fullscreen-exit:before{content:'\e84e'}.icon-fullscreen:before{content:'\e84f'}.icon-function:before{content:'\e850'}.icon-gamepad-variant:before{content:'\e851'}.icon-gamepad:before{content:'\e852'}.icon-gas-station:before{content:'\e853'}.icon-gavel:before{content:'\e854'}.icon-gender-female:before{content:'\e855'}.icon-gender-male-female:before{content:'\e856'}.icon-gender-male:before{content:'\e857'}.icon-gender-transgender:before{content:'\e858'}.icon-gift:before{content:'\e859'}.icon-git:before{content:'\e85a'}.icon-github-box:before{content:'\e85b'}.icon-github:before{content:'\e85c'}.icon-glass-flute:before{content:'\e85d'}.icon-glass-mug:before{content:'\e85e'}.icon-glass-stange:before{content:'\e85f'}.icon-glass-tulip:before{content:'\e860'}.icon-glasses:before{content:'\e861'}.icon-gmail:before{content:'\e862'}.icon-google-chrome:before{content:'\e863'}.icon-google-circles-communities:before{content:'\e864'}.icon-google-circles-extended:before{content:'\e865'}.icon-google-circles-invite:before{content:'\e866'}.icon-google-circles:before{content:'\e867'}.icon-google-controller-off:before{content:'\e868'}.icon-google-controller:before{content:'\e869'}.icon-google-drive:before{content:'\e86a'}.icon-google-earth:before{content:'\e86b'}.icon-google-glass:before{content:'\e86c'}.icon-google-maps:before{content:'\e86d'}.icon-google-pages:before{content:'\e86e'}.icon-google-play:before{content:'\e86f'}.icon-google-plus-box:before{content:'\e870'}.icon-google-plus:before{content:'\e871'}.icon-google:before{content:'\e872'}.icon-grid-off:before{content:'\e873'}.icon-grid:before{content:'\e874'}.icon-group:before{content:'\e875'}.icon-hand-pointing-right:before{content:'\e876'}.icon-hanger:before{content:'\e877'}.icon-hangouts:before{content:'\e878'}.icon-harddisk:before{content:'\e879'}.icon-headphones-box:before{content:'\e87a'}.icon-headphones-dots:before{content:'\e87b'}.icon-headphones:before{content:'\e87c'}.icon-headset-dock:before{content:'\e87d'}.icon-headset-off:before{content:'\e87e'}.icon-headset:before{content:'\e87f'}.icon-heart-box-outline:before{content:'\e880'}.icon-heart-box:before{content:'\e881'}.icon-heart-broken:before{content:'\e882'}.icon-heart-outline:before{content:'\e883'}.icon-heart:before{content:'\e884'}.icon-help-circle:before{content:'\e885'}.icon-help:before{content:'\e886'}.icon-hexagon-outline:before{content:'\e887'}.icon-hexagon:before{content:'\e888'}.icon-history:before{content:'\e889'}.icon-hololens:before{content:'\e88a'}.icon-home-modern:before{content:'\e88b'}.icon-home-variant:before{content:'\e88c'}.icon-home:before{content:'\e88d'}.icon-hops:before{content:'\e88e'}.icon-hospital-building:before{content:'\e88f'}.icon-hospital-marker:before{content:'\e890'}.icon-hospital:before{content:'\e891'}.icon-hotel:before{content:'\e892'}.icon-houzz-box:before{content:'\e893'}.icon-human-child:before{content:'\e894'}.icon-human-male-female:before{content:'\e895'}.icon-human:before{content:'\e896'}.icon-image-album:before{content:'\e897'}.icon-image-area-close:before{content:'\e898'}.icon-image-area:before{content:'\e899'}.icon-image-broken:before{content:'\e89a'}.icon-image-filter-black-white:before{content:'\e89b'}.icon-image-filter-center-focus:before{content:'\e89c'}.icon-image-filter-drama:before{content:'\e89d'}.icon-image-filter-frames:before{content:'\e89e'}.icon-image-filter-hdr:before{content:'\e89f'}.icon-image-filter-none:before{content:'\e8a0'}.icon-image-filter-tilt-shift:before{content:'\e8a1'}.icon-image-filter-vintage:before{content:'\e8a2'}.icon-image-filter:before{content:'\e8a3'}.icon-image:before{content:'\e8a4'}.icon-import:before{content:'\e8a5'}.icon-inbox:before{content:'\e8a6'}.icon-indent:before{content:'\e8a7'}.icon-information-outline:before{content:'\e8a8'}.icon-information:before{content:'\e8a9'}.icon-instagram:before{content:'\e8aa'}.icon-instapaper:before{content:'\e8ab'}.icon-internet-explorer:before{content:'\e8ac'}.icon-invert-colors:before{content:'\e8ad'}.icon-jira:before{content:'\e8ae'}.icon-jsfiddle:before{content:'\e8af'}.icon-keg:before{content:'\e8b0'}.icon-key-change:before{content:'\e8b1'}.icon-key-minus:before{content:'\e8b2'}.icon-key-plus:before{content:'\e8b3'}.icon-key-remove:before{content:'\e8b4'}.icon-key-variant:before{content:'\e8b5'}.icon-key:before{content:'\e8b6'}.icon-keyboard-backspace:before{content:'\e8b7'}.icon-keyboard-caps:before{content:'\e8b8'}.icon-keyboard-close:before{content:'\e8b9'}.icon-keyboard-off:before{content:'\e8ba'}.icon-keyboard-return:before{content:'\e8bb'}.icon-keyboard-tab:before{content:'\e8bc'}.icon-keyboard-variant:before{content:'\e8bd'}.icon-keyboard:before{content:'\e8be'}.icon-label-outline:before{content:'\e8bf'}.icon-label:before{content:'\e8c0'}.icon-language-csharp:before{content:'\e8c1'}.icon-language-css3:before{content:'\e8c2'}.icon-language-html5:before{content:'\e8c3'}.icon-language-javascript:before{content:'\e8c4'}.icon-language-python-text:before{content:'\e8c5'}.icon-language-python:before{content:'\e8c6'}.icon-laptop-chromebook:before{content:'\e8c7'}.icon-laptop-mac:before{content:'\e8c8'}.icon-laptop-windows:before{content:'\e8c9'}.icon-laptop:before{content:'\e8ca'}.icon-lastfm:before{content:'\e8cb'}.icon-launch:before{content:'\e8cc'}.icon-layers-off:before{content:'\e8cd'}.icon-layers:before{content:'\e8ce'}.icon-leaf:before{content:'\e8cf'}.icon-library-books:before{content:'\e8d0'}.icon-library-music:before{content:'\e8d1'}.icon-library-plus:before{content:'\e8d2'}.icon-library:before{content:'\e8d3'}.icon-lightbulb-outline:before{content:'\e8d4'}.icon-lightbulb:before{content:'\e8d5'}.icon-link-off:before{content:'\e8d6'}.icon-link-variant-off:before{content:'\e8d7'}.icon-link-variant:before{content:'\e8d8'}.icon-link:before{content:'\e8d9'}.icon-linkedin-box:before{content:'\e8da'}.icon-linkedin:before{content:'\e8db'}.icon-linode:before{content:'\e8dc'}.icon-linux:before{content:'\e8dd'}.icon-lock-outline:before{content:'\e8de'}.icon-lock-unlocked-outline:before{content:'\e8df'}.icon-lock-unlocked:before{content:'\e8e0'}.icon-lock:before{content:'\e8e1'}.icon-login:before{content:'\e8e2'}.icon-logout:before{content:'\e8e3'}.icon-looks:before{content:'\e8e4'}.icon-loupe:before{content:'\e8e5'}.icon-lumx:before{content:'\e8e6'}.icon-magnet-on:before{content:'\e8e7'}.icon-magnet:before{content:'\e8e8'}.icon-magnify-minus:before{content:'\e8e9'}.icon-magnify-plus:before{content:'\e8ea'}.icon-magnify:before{content:'\e8eb'}.icon-mail-ru:before{content:'\e8ec'}.icon-map-marker-circle:before{content:'\e8ed'}.icon-map-marker-multiple:before{content:'\e8ee'}.icon-map-marker-off:before{content:'\e8ef'}.icon-map-marker-radius:before{content:'\e8f0'}.icon-map-marker:before{content:'\e8f1'}.icon-map:before{content:'\e8f2'}.icon-margin:before{content:'\e8f3'}.icon-markdown:before{content:'\e8f4'}.icon-marker-check:before{content:'\e8f5'}.icon-martini:before{content:'\e8f6'}.icon-material-ui:before{content:'\e8f7'}.icon-maxcdn:before{content:'\e8f8'}.icon-medium:before{content:'\e8f9'}.icon-memory:before{content:'\e8fa'}.icon-menu-down:before{content:'\e8fb'}.icon-menu-left:before{content:'\e8fc'}.icon-menu-right:before{content:'\e8fd'}.icon-menu-up:before{content:'\e8fe'}.icon-menu:before{content:'\e8ff'}.icon-message-alert:before{content:'\e900'}.icon-message-draw:before{content:'\e901'}.icon-message-image:before{content:'\e902'}.icon-message-processing:before{content:'\e903'}.icon-message-reply:before{content:'\e904'}.icon-message-text-outline:before{content:'\e905'}.icon-message-text:before{content:'\e906'}.icon-message-video:before{content:'\e907'}.icon-message:before{content:'\e908'}.icon-microphone-dots:before{content:'\e909'}.icon-microphone-off:before{content:'\e90a'}.icon-microphone-outline:before{content:'\e90b'}.icon-microphone-settings:before{content:'\e90c'}.icon-microphone-variant-off:before{content:'\e90d'}.icon-microphone-variant:before{content:'\e90e'}.icon-microphone:before{content:'\e90f'}.icon-minus-box:before{content:'\e910'}.icon-minus-circle-outline:before{content:'\e911'}.icon-minus-circle:before{content:'\e912'}.icon-minus-network:before{content:'\e913'}.icon-minus:before{content:'\e914'}.icon-monitor-multiple:before{content:'\e915'}.icon-monitor:before{content:'\e916'}.icon-more:before{content:'\e917'}.icon-mouse-off:before{content:'\e918'}.icon-mouse-variant-off:before{content:'\e919'}.icon-mouse-variant:before{content:'\e91a'}.icon-mouse:before{content:'\e91b'}.icon-movie:before{content:'\e91c'}.icon-multiplication-box:before{content:'\e91d'}.icon-multiplication:before{content:'\e91e'}.icon-music-box-outline:before{content:'\e91f'}.icon-music-box:before{content:'\e920'}.icon-music-circle:before{content:'\e921'}.icon-music-note-eighth:before{content:'\e922'}.icon-music-note-half:before{content:'\e923'}.icon-music-note-off:before{content:'\e924'}.icon-music-note-quarter:before{content:'\e925'}.icon-music-note-sixteenth:before{content:'\e926'}.icon-music-note-whole:before{content:'\e927'}.icon-music-note:before{content:'\e928'}.icon-nature-people:before{content:'\e929'}.icon-nature:before{content:'\e92a'}.icon-navigation:before{content:'\e92b'}.icon-needle:before{content:'\e92c'}.icon-nest-protect:before{content:'\e92d'}.icon-nest-thermostat:before{content:'\e92e'}.icon-newspaper:before{content:'\e92f'}.icon-nfc-tap:before{content:'\e930'}.icon-nfc-variant:before{content:'\e931'}.icon-nfc:before{content:'\e932'}.icon-no:before{content:'\e933'}.icon-not-equal:before{content:'\e934'}.icon-note-outline:before{content:'\e935'}.icon-note-text:before{content:'\e936'}.icon-note:before{content:'\e937'}.icon-numeric-0-box-multiple-outline:before{content:'\e938'}.icon-numeric-0-box-outline:before{content:'\e939'}.icon-numeric-0-box:before{content:'\e93a'}.icon-numeric-1-box-multiple-outline:before{content:'\e93b'}.icon-numeric-1-box-outline:before{content:'\e93c'}.icon-numeric-1-box:before{content:'\e93d'}.icon-numeric-2-box-multiple-outline:before{content:'\e93e'}.icon-numeric-2-box-outline:before{content:'\e93f'}.icon-numeric-2-box:before{content:'\e940'}.icon-numeric-3-box-multiple-outline:before{content:'\e941'}.icon-numeric-3-box-outline:before{content:'\e942'}.icon-numeric-3-box:before{content:'\e943'}.icon-numeric-4-box-multiple-outline:before{content:'\e944'}.icon-numeric-4-box-outline:before{content:'\e945'}.icon-numeric-4-box:before{content:'\e946'}.icon-numeric-5-box-multiple-outline:before{content:'\e947'}.icon-numeric-5-box-outline:before{content:'\e948'}.icon-numeric-5-box:before{content:'\e949'}.icon-numeric-6-box-multiple-outline:before{content:'\e94a'}.icon-numeric-6-box-outline:before{content:'\e94b'}.icon-numeric-6-box:before{content:'\e94c'}.icon-numeric-7-box-multiple-outline:before{content:'\e94d'}.icon-numeric-7-box-outline:before{content:'\e94e'}.icon-numeric-7-box:before{content:'\e94f'}.icon-numeric-8-box-multiple-outline:before{content:'\e950'}.icon-numeric-8-box-outline:before{content:'\e951'}.icon-numeric-8-box:before{content:'\e952'}.icon-numeric-9-box-multiple-outline:before{content:'\e953'}.icon-numeric-9-box-outline:before{content:'\e954'}.icon-numeric-9-box:before{content:'\e955'}.icon-numeric-9-plus-box-multiple-outline:before{content:'\e956'}.icon-numeric-9-plus-box-outline:before{content:'\e957'}.icon-numeric-9-plus-box:before{content:'\e958'}.icon-numeric:before{content:'\e959'}.icon-nutriton:before{content:'\e95a'}.icon-odnoklassniki:before{content:'\e95b'}.icon-office:before{content:'\e95c'}.icon-oil:before{content:'\e95d'}.icon-omega:before{content:'\e95e'}.icon-onedrive:before{content:'\e95f'}.icon-open-in-app:before{content:'\e960'}.icon-open-in-new:before{content:'\e961'}.icon-ornament-variant:before{content:'\e962'}.icon-ornament:before{content:'\e963'}.icon-outbox:before{content:'\e964'}.icon-outdent:before{content:'\e965'}.icon-owl:before{content:'\e966'}.icon-package-down:before{content:'\e967'}.icon-package-up:before{content:'\e968'}.icon-package-variant-closed:before{content:'\e969'}.icon-package-variant:before{content:'\e96a'}.icon-package:before{content:'\e96b'}.icon-palette-advanced:before{content:'\e96c'}.icon-palette:before{content:'\e96d'}.icon-panda:before{content:'\e96e'}.icon-pandora:before{content:'\e96f'}.icon-panorama-fisheye:before{content:'\e970'}.icon-panorama-horizontal:before{content:'\e971'}.icon-panorama-vertical:before{content:'\e972'}.icon-panorama-wide-angle:before{content:'\e973'}.icon-panorama:before{content:'\e974'}.icon-paper-cut-vertical:before{content:'\e975'}.icon-paperclip:before{content:'\e976'}.icon-parking:before{content:'\e977'}.icon-pause-circle-outline:before{content:'\e978'}.icon-pause-circle:before{content:'\e979'}.icon-pause-octagon-outline:before{content:'\e97a'}.icon-pause-octagon:before{content:'\e97b'}.icon-pause:before{content:'\e97c'}.icon-paw:before{content:'\e97d'}.icon-pen:before{content:'\e97e'}.icon-pencil-box-outline:before{content:'\e97f'}.icon-pencil-box:before{content:'\e980'}.icon-pencil:before{content:'\e981'}.icon-people:before{content:'\e982'}.icon-percent:before{content:'\e983'}.icon-person-box:before{content:'\e984'}.icon-person-minus:before{content:'\e985'}.icon-person-plus:before{content:'\e986'}.icon-pharmacy:before{content:'\e987'}.icon-phone-bluetooth:before{content:'\e988'}.icon-phone-dots:before{content:'\e989'}.icon-phone-forward:before{content:'\e98a'}.icon-phone-hangup:before{content:'\e98b'}.icon-phone-in-talk:before{content:'\e98c'}.icon-phone-incoming:before{content:'\e98d'}.icon-phone-locked:before{content:'\e98e'}.icon-phone-log:before{content:'\e98f'}.icon-phone-missed:before{content:'\e990'}.icon-phone-outgoing:before{content:'\e991'}.icon-phone-paused:before{content:'\e992'}.icon-phone:before{content:'\e993'}.icon-picture:before{content:'\e994'}.icon-pig:before{content:'\e995'}.icon-pill:before{content:'\e996'}.icon-pin-off:before{content:'\e997'}.icon-pin:before{content:'\e998'}.icon-pine-tree-box:before{content:'\e999'}.icon-pine-tree:before{content:'\e99a'}.icon-pinterest-box:before{content:'\e99b'}.icon-pinterest:before{content:'\e99c'}.icon-pizza:before{content:'\e99d'}.icon-plane:before{content:'\e99e'}.icon-play-box-outline:before{content:'\e99f'}.icon-play-circle-outline:before{content:'\e9a0'}.icon-play-circle:before{content:'\e9a1'}.icon-play:before{content:'\e9a2'}.icon-playlist-minus:before{content:'\e9a3'}.icon-playlist-plus:before{content:'\e9a4'}.icon-playstation:before{content:'\e9a5'}.icon-plus-box:before{content:'\e9a6'}.icon-plus-circle-outline:before{content:'\e9a7'}.icon-plus-circle:before{content:'\e9a8'}.icon-plus-network:before{content:'\e9a9'}.icon-plus-one:before{content:'\e9aa'}.icon-plus:before{content:'\e9ab'}.icon-pocket:before{content:'\e9ac'}.icon-poll-box:before{content:'\e9ad'}.icon-poll:before{content:'\e9ae'}.icon-polymer:before{content:'\e9af'}.icon-popcorn:before{content:'\e9b0'}.icon-pound-box:before{content:'\e9b1'}.icon-pound:before{content:'\e9b2'}.icon-power-settings:before{content:'\e9b3'}.icon-power-socket:before{content:'\e9b4'}.icon-power:before{content:'\e9b5'}.icon-presentation-play:before{content:'\e9b6'}.icon-presentation:before{content:'\e9b7'}.icon-printer-3d:before{content:'\e9b8'}.icon-printer:before{content:'\e9b9'}.icon-pulse:before{content:'\e9ba'}.icon-puzzle:before{content:'\e9bb'}.icon-qrcode:before{content:'\e9bc'}.icon-quadcopter:before{content:'\e9bd'}.icon-quality-high:before{content:'\e9be'}.icon-question-mark-circle:before{content:'\e9bf'}.icon-quick-reply:before{content:'\e9c0'}.icon-quicktime:before{content:'\e9c1'}.icon-rabbit:before{content:'\e9c2'}.icon-radiator:before{content:'\e9c3'}.icon-radio-tower:before{content:'\e9c4'}.icon-radio:before{content:'\e9c5'}.icon-radioactive:before{content:'\e9c6'}.icon-radiobox-blank:before{content:'\e9c7'}.icon-radiobox-marked:before{content:'\e9c8'}.icon-raspberrypi:before{content:'\e9c9'}.icon-rdio:before{content:'\e9ca'}.icon-read:before{content:'\e9cb'}.icon-readability:before{content:'\e9cc'}.icon-receipt:before{content:'\e9cd'}.icon-recycle:before{content:'\e9ce'}.icon-reddit:before{content:'\e9cf'}.icon-redo-variant:before{content:'\e9d0'}.icon-redo:before{content:'\e9d1'}.icon-refresh:before{content:'\e9d2'}.icon-relative-scale:before{content:'\e9d3'}.icon-reload:before{content:'\e9d4'}.icon-remote:before{content:'\e9d5'}.icon-rename-box:before{content:'\e9d6'}.icon-repeat-off:before{content:'\e9d7'}.icon-repeat-once:before{content:'\e9d8'}.icon-repeat:before{content:'\e9d9'}.icon-replay:before{content:'\e9da'}.icon-reply-all:before{content:'\e9db'}.icon-reply:before{content:'\e9dc'}.icon-reproduction:before{content:'\e9dd'}.icon-resize-bottom-right:before{content:'\e9de'}.icon-responsive:before{content:'\e9df'}.icon-restore:before{content:'\e9e0'}.icon-rewind:before{content:'\e9e1'}.icon-ribbon:before{content:'\e9e2'}.icon-road:before{content:'\e9e3'}.icon-rocket:before{content:'\e9e4'}.icon-rotate-3d:before{content:'\e9e5'}.icon-rotate-left-variant:before{content:'\e9e6'}.icon-rotate-left:before{content:'\e9e7'}.icon-rotate-right-variant:before{content:'\e9e8'}.icon-rotate-right:before{content:'\e9e9'}.icon-routes:before{content:'\e9ea'}.icon-rss-box:before{content:'\e9eb'}.icon-ruler:before{content:'\e9ec'}.icon-run:before{content:'\e9ed'}.icon-sale:before{content:'\e9ee'}.icon-satellite-variant:before{content:'\e9ef'}.icon-satellite:before{content:'\e9f0'}.icon-scale-bathroom:before{content:'\e9f1'}.icon-scale:before{content:'\e9f2'}.icon-school:before{content:'\e9f3'}.icon-screen-rotation-lock:before{content:'\e9f4'}.icon-screen-rotation:before{content:'\e9f5'}.icon-script:before{content:'\e9f6'}.icon-security-network:before{content:'\e9f7'}.icon-security:before{content:'\e9f8'}.icon-select-all:before{content:'\e9f9'}.icon-select-inverse:before{content:'\e9fa'}.icon-select-off:before{content:'\e9fb'}.icon-select:before{content:'\e9fc'}.icon-send:before{content:'\e9fd'}.icon-server-minus:before{content:'\e9fe'}.icon-server-network-off:before{content:'\e9ff'}.icon-server-network:before{content:'\ea00'}.icon-server-off:before{content:'\ea01'}.icon-server-plus:before{content:'\ea02'}.icon-server-remove:before{content:'\ea03'}.icon-server-security:before{content:'\ea04'}.icon-server:before{content:'\ea05'}.icon-shape-plus:before{content:'\ea06'}.icon-share-variant:before{content:'\ea07'}.icon-share:before{content:'\ea08'}.icon-shield-outline:before{content:'\ea09'}.icon-shield:before{content:'\ea0a'}.icon-shopping-music:before{content:'\ea0b'}.icon-shopping:before{content:'\ea0c'}.icon-shuffle:before{content:'\ea0d'}.icon-sigma:before{content:'\ea0e'}.icon-sign-caution:before{content:'\ea0f'}.icon-signal:before{content:'\ea10'}.icon-silverware-fork:before{content:'\ea11'}.icon-silverware-spoon:before{content:'\ea12'}.icon-silverware-variant:before{content:'\ea13'}.icon-silverware:before{content:'\ea14'}.icon-sim-alert:before{content:'\ea15'}.icon-sim:before{content:'\ea16'}.icon-sitemap:before{content:'\ea17'}.icon-skip-next:before{content:'\ea18'}.icon-skip-previous:before{content:'\ea19'}.icon-skype-business:before{content:'\ea1a'}.icon-skype:before{content:'\ea1b'}.icon-sleep-off:before{content:'\ea1c'}.icon-sleep:before{content:'\ea1d'}.icon-smoking-off:before{content:'\ea1e'}.icon-smoking:before{content:'\ea1f'}.icon-snapchat:before{content:'\ea20'}.icon-snowman:before{content:'\ea21'}.icon-sofa:before{content:'\ea22'}.icon-sort-alphabetical:before{content:'\ea23'}.icon-sort-ascending:before{content:'\ea24'}.icon-sort-descending:before{content:'\ea25'}.icon-sort-numeric:before{content:'\ea26'}.icon-sort-variant:before{content:'\ea27'}.icon-sort:before{content:'\ea28'}.icon-soundcloud:before{content:'\ea29'}.icon-source-fork:before{content:'\ea2a'}.icon-source-pull:before{content:'\ea2b'}.icon-speaker-off:before{content:'\ea2c'}.icon-speaker:before{content:'\ea2d'}.icon-speedometer:before{content:'\ea2e'}.icon-spellcheck:before{content:'\ea2f'}.icon-spotify:before{content:'\ea30'}.icon-spotlight-beam:before{content:'\ea31'}.icon-spotlight:before{content:'\ea32'}.icon-spreadsheet:before{content:'\ea33'}.icon-square-inc-cash:before{content:'\ea34'}.icon-square-inc:before{content:'\ea35'}.icon-stackoverflow:before{content:'\ea36'}.icon-star-circle:before{content:'\ea37'}.icon-star-half:before{content:'\ea38'}.icon-star-of-david:before{content:'\ea39'}.icon-star-outline:before{content:'\ea3a'}.icon-star:before{content:'\ea3b'}.icon-steam:before{content:'\ea3c'}.icon-stethoscope:before{content:'\ea3d'}.icon-stocking:before{content:'\ea3e'}.icon-stop:before{content:'\ea3f'}.icon-store-24-hour:before{content:'\ea40'}.icon-store:before{content:'\ea41'}.icon-stove:before{content:'\ea42'}.icon-subway:before{content:'\ea43'}.icon-sunglasses:before{content:'\ea44'}.icon-swap-horizontal:before{content:'\ea45'}.icon-swap-vertical:before{content:'\ea46'}.icon-swim:before{content:'\ea47'}.icon-sword:before{content:'\ea48'}.icon-sync-alert:before{content:'\ea49'}.icon-sync-off:before{content:'\ea4a'}.icon-sync:before{content:'\ea4b'}.icon-tab-unselected:before{content:'\ea4c'}.icon-tab:before{content:'\ea4d'}.icon-table-column-plus-after:before{content:'\ea4e'}.icon-table-column-plus-before:before{content:'\ea4f'}.icon-table-column-remove:before{content:'\ea50'}.icon-table-column-width:before{content:'\ea51'}.icon-table-edit:before{content:'\ea52'}.icon-table-large:before{content:'\ea53'}.icon-table-row-height:before{content:'\ea54'}.icon-table-row-plus-after:before{content:'\ea55'}.icon-table-row-plus-before:before{content:'\ea56'}.icon-table-row-remove:before{content:'\ea57'}.icon-table:before{content:'\ea58'}.icon-tablet-android:before{content:'\ea59'}.icon-tablet-ipad:before{content:'\ea5a'}.icon-tablet:before{content:'\ea5b'}.icon-tag-faces:before{content:'\ea5c'}.icon-tag-multiple:before{content:'\ea5d'}.icon-tag-outline:before{content:'\ea5e'}.icon-tag-text-outline:before{content:'\ea5f'}.icon-tag:before{content:'\ea60'}.icon-taxi:before{content:'\ea61'}.icon-teamviewer:before{content:'\ea62'}.icon-telegram:before{content:'\ea63'}.icon-television-guide:before{content:'\ea64'}.icon-television:before{content:'\ea65'}.icon-temperature-celsius:before{content:'\ea66'}.icon-temperature-fahrenheit:before{content:'\ea67'}.icon-temperature-kelvin:before{content:'\ea68'}.icon-tennis:before{content:'\ea69'}.icon-tent:before{content:'\ea6a'}.icon-terrain:before{content:'\ea6b'}.icon-text-to-speech-off:before{content:'\ea6c'}.icon-text-to-speech:before{content:'\ea6d'}.icon-texture:before{content:'\ea6e'}.icon-theater:before{content:'\ea6f'}.icon-theme-light-dark:before{content:'\ea70'}.icon-thermometer-lines:before{content:'\ea71'}.icon-thermometer:before{content:'\ea72'}.icon-thumb-down-outline:before{content:'\ea73'}.icon-thumb-down:before{content:'\ea74'}.icon-thumb-up-outline:before{content:'\ea75'}.icon-thumb-up:before{content:'\ea76'}.icon-thumbs-up-down:before{content:'\ea77'}.icon-ticket-account:before{content:'\ea78'}.icon-ticket:before{content:'\ea79'}.icon-tie:before{content:'\ea7a'}.icon-tile-four:before{content:'\ea7b'}.icon-timelapse:before{content:'\ea7c'}.icon-timer-3:before{content:'\ea7d'}.icon-timer-10:before{content:'\ea7e'}.icon-timer-off:before{content:'\ea7f'}.icon-timer-sand:before{content:'\ea80'}.icon-timer:before{content:'\ea81'}.icon-timetable:before{content:'\ea82'}.icon-toggle-switch-off:before{content:'\ea83'}.icon-toggle-switch-on:before{content:'\ea84'}.icon-tooltip-edit:before{content:'\ea85'}.icon-tooltip-image:before{content:'\ea86'}.icon-tooltip-outline-plus:before{content:'\ea87'}.icon-tooltip-outline:before{content:'\ea88'}.icon-tooltip-text:before{content:'\ea89'}.icon-tooltip:before{content:'\ea8a'}.icon-tor:before{content:'\ea8b'}.icon-traffic-light:before{content:'\ea8c'}.icon-train:before{content:'\ea8d'}.icon-tram:before{content:'\ea8e'}.icon-transcribe-close:before{content:'\ea8f'}.icon-transcribe:before{content:'\ea90'}.icon-transfer:before{content:'\ea91'}.icon-trash:before{content:'\ea92'}.icon-tree:before{content:'\ea93'}.icon-trello:before{content:'\ea94'}.icon-trending-down:before{content:'\ea95'}.icon-trending-neutral:before{content:'\ea96'}.icon-trending-up:before{content:'\ea97'}.icon-truck:before{content:'\ea98'}.icon-tshirt-crew:before{content:'\ea99'}.icon-tshirt-v:before{content:'\ea9a'}.icon-tumblr-reblog:before{content:'\ea9b'}.icon-tumblr:before{content:'\ea9c'}.icon-twitch:before{content:'\ea9d'}.icon-twitter-box:before{content:'\ea9e'}.icon-twitter-circle:before{content:'\ea9f'}.icon-twitter-retweet:before{content:'\eaa0'}.icon-twitter:before{content:'\eaa1'}.icon-ubuntu:before{content:'\eaa2'}.icon-umbrella-outline:before{content:'\eaa3'}.icon-umbrella:before{content:'\eaa4'}.icon-undo-variant:before{content:'\eaa5'}.icon-undo:before{content:'\eaa6'}.icon-unfold-less:before{content:'\eaa7'}.icon-unfold-more:before{content:'\eaa8'}.icon-ungroup:before{content:'\eaa9'}.icon-untappd:before{content:'\eaaa'}.icon-upload:before{content:'\eaab'}.icon-usb:before{content:'\eaac'}.icon-vector-curve:before{content:'\eaad'}.icon-vector-point:before{content:'\eaae'}.icon-vector-square:before{content:'\eaaf'}.icon-verified:before{content:'\eab0'}.icon-vibration:before{content:'\eab1'}.icon-video-off:before{content:'\eab2'}.icon-video-switch:before{content:'\eab3'}.icon-video:before{content:'\eab4'}.icon-view-agenda:before{content:'\eab5'}.icon-view-array:before{content:'\eab6'}.icon-view-carousel:before{content:'\eab7'}.icon-view-column:before{content:'\eab8'}.icon-view-dashboard:before{content:'\eab9'}.icon-view-day:before{content:'\eaba'}.icon-view-headline:before{content:'\eabb'}.icon-view-list:before{content:'\eabc'}.icon-view-module:before{content:'\eabd'}.icon-view-quilt:before{content:'\eabe'}.icon-view-stream:before{content:'\eabf'}.icon-view-week:before{content:'\eac0'}.icon-vimeo:before{content:'\eac1'}.icon-vine:before{content:'\eac2'}.icon-vk-box:before{content:'\eac3'}.icon-vk-circle:before{content:'\eac4'}.icon-vk:before{content:'\eac5'}.icon-voicemail:before{content:'\eac6'}.icon-volume-high:before{content:'\eac7'}.icon-volume-low:before{content:'\eac8'}.icon-volume-medium:before{content:'\eac9'}.icon-volume-off:before{content:'\eaca'}.icon-volume:before{content:'\eacb'}.icon-vpn:before{content:'\eacc'}.icon-walk:before{content:'\eacd'}.icon-wallet-giftcard:before{content:'\eace'}.icon-wallet-membership:before{content:'\eacf'}.icon-wallet-travel:before{content:'\ead0'}.icon-wallet:before{content:'\ead1'}.icon-washing-machine:before{content:'\ead2'}.icon-watch-export:before{content:'\ead3'}.icon-watch-import:before{content:'\ead4'}.icon-watch:before{content:'\ead5'}.icon-water-off:before{content:'\ead6'}.icon-water-pump:before{content:'\ead7'}.icon-water:before{content:'\ead8'}.icon-weather-cloudy:before{content:'\ead9'}.icon-weather-fog:before{content:'\eada'}.icon-weather-hail:before{content:'\eadb'}.icon-weather-lightning:before{content:'\eadc'}.icon-weather-night:before{content:'\eadd'}.icon-weather-partlycloudy:before{content:'\eade'}.icon-weather-pouring:before{content:'\eadf'}.icon-weather-rainy:before{content:'\eae0'}.icon-weather-snowy:before{content:'\eae1'}.icon-weather-sunny:before{content:'\eae2'}.icon-weather-sunset-down:before{content:'\eae3'}.icon-weather-sunset-up:before{content:'\eae4'}.icon-weather-sunset:before{content:'\eae5'}.icon-weather-windy-variant:before{content:'\eae6'}.icon-weather-windy:before{content:'\eae7'}.icon-web:before{content:'\eae8'}.icon-webcam:before{content:'\eae9'}.icon-weight-kilogram:before{content:'\eaea'}.icon-weight:before{content:'\eaeb'}.icon-whatsapp:before{content:'\eaec'}.icon-wheelchair-accessibility:before{content:'\eaed'}.icon-white-balance-auto:before{content:'\eaee'}.icon-white-balance-incandescent:before{content:'\eaef'}.icon-white-balance-irradescent:before{content:'\eaf0'}.icon-white-balance-sunny:before{content:'\eaf1'}.icon-wifi:before{content:'\eaf2'}.icon-wii:before{content:'\eaf3'}.icon-wikipedia:before{content:'\eaf4'}.icon-window-close:before{content:'\eaf5'}.icon-window-closed:before{content:'\eaf6'}.icon-window-maximize:before{content:'\eaf7'}.icon-window-minimize:before{content:'\eaf8'}.icon-window-open:before{content:'\eaf9'}.icon-window-restore:before{content:'\eafa'}.icon-windows:before{content:'\eafb'}.icon-wordpress:before{content:'\eafc'}.icon-worker:before{content:'\eafd'}.icon-wunderlist:before{content:'\eafe'}.icon-xbox-controller-off:before{content:'\eaff'}.icon-xbox-controller:before{content:'\eb00'}.icon-xbox:before{content:'\eb01'}.icon-xda:before{content:'\eb02'}.icon-xml:before{content:'\eb03'}.icon-yeast:before{content:'\eb04'}.icon-yelp:before{content:'\eb05'}.icon-youtube-play:before{content:'\eb06'}.icon-youtube:before{content:'\eb07'}.icon-zip-box:before{content:'\eb08'}.avatar{width:40px;min-width:40px;height:40px;line-height:40px;margin:0 8px 0 0;border-radius:50%;font-size:17px;font-weight:500;text-align:center;color:#fff}.avatar.square{border-radius:0}.avatar.small{width:20px;min-width:20px;height:20px;line-height:20px}.avatar.big{width:72px;min-width:72px;height:72px;line-height:72px}.avatar.huge{width:96px;min-width:96px;height:96px;line-height:96px}.form-wrapper{background:#fff;padding:16px}.form-wrapper .form-title{font-size:21px;padding:8px 0}.navigation-simple .item{position:relative;cursor:pointer;text-align:left;margin:0;padding:0 24px;text-transform:none;line-height:48px;max-height:48px;height:48px}.navigation-simple .item md-icon{margin:0 16px 0 0}.navigation-simple .item .title{font-size:13px;font-weight:500;line-height:1}.navigation-simple .item.selected{background-color:rgba(0,0,0,.06)}.navigation-simple .subheader{font-size:13px;border-top:1px solid rgba(0,0,0,.12);font-weight:500;margin-top:8px}.navigation-simple .subheader.light{border-top:1px solid rgba(255,255,255,.12)}.navigation-simple md-divider{margin:8px 0}.simple-pagination{position:relative;display:inline-flex;flex-direction:row;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);background-color:#fff;padding:0 8px}.simple-pagination .pagination-item{min-width:48px;min-height:56px;line-height:56px;border-radius:0;margin:0;font-weight:400;color:rgba(0,0,0,.54)}.simple-pagination .pagination-item:hover{color:rgba(0,0,0,.87)}.simple-pagination .pagination-item.active{cursor:default;color:rgba(0,0,0,.87)}.simple-pagination .pagination-item.disabled{cursor:default;color:rgba(0,0,0,.26)}.price-tables .price-table{position:relative;background-color:#fff;width:280px;border-radius:2px;margin:24px 24px 0 0;overflow:hidden}.price-tables .price-table.style-1 .package-type{font-size:17px;padding:16px 24px}.price-tables .price-table.style-1 .package-type .sale{font-size:13px;font-weight:600}.price-tables .price-table.style-1 .price{padding:32px 32px 16px 32px}.price-tables .price-table.style-1 .price .currency{padding-right:4px;font-size:24px;font-weight:500;color:rgba(0,0,0,.54)}.price-tables .price-table.style-1 .price .value{font-size:72px;font-weight:300;line-height:1}.price-tables .price-table.style-1 .price .period{padding:0 0 5px 4px;font-size:17px;color:rgba(0,0,0,.54)}.price-tables .price-table.style-1 md-divider{margin:16px 32px}.price-tables .price-table.style-1 .terms{padding:16px 32px;font-size:15px}.price-tables .price-table.style-1 .cta-button{margin:16px auto 32px auto;width:128px}.price-tables .price-table.style-2 .badge{position:absolute;top:0;left:50%;transform:translateX(-50%);font-size:11px;font-weight:500;padding:6px 8px}.price-tables .price-table.style-2 .package-type{padding:48px 32px 24px 32px;font-size:20px;font-weight:500;text-align:center}.price-tables .price-table.style-2 .price{padding:0 32px 8px 32px}.price-tables .price-table.style-2 .price .currency{padding-right:4px;font-size:24px;font-weight:500;color:rgba(0,0,0,.54)}.price-tables .price-table.style-2 .price .value{font-size:56px;font-weight:300;line-height:1}.price-tables .price-table.style-2 .period{padding:0 32px;font-size:15px;font-weight:500;color:rgba(0,0,0,.54);text-align:center}.price-tables .price-table.style-2 .terms{padding:32px;font-size:15px}.price-tables .price-table.style-2 .terms .term{padding-bottom:8px}.price-tables .price-table.style-2 .terms .term:last-child{padding-bottom:0}.price-tables .price-table.style-2 .cta-button{margin:8px auto 32px auto;width:128px}.price-tables .price-table.style-3 .package-type{padding:32px;text-align:center}.price-tables .price-table.style-3 .package-type .title{font-size:34px}.price-tables .price-table.style-3 .package-type .subtitle{font-size:17px;color:rgba(0,0,0,.54);font-weight:500}.price-tables .price-table.style-3 .price{padding:16px 32px}.price-tables .price-table.style-3 .price .currency{padding-right:4px;font-size:15px;font-weight:500}.price-tables .price-table.style-3 .price .value{font-size:34px;font-weight:300;line-height:1}.price-tables .price-table.style-3 .price .period{padding-left:4px;text-align:center}.price-tables .price-table.style-3 .terms{margin:32px;font-size:15px;color:rgba(0,0,0,.54)}.price-tables .price-table.style-3 .terms .term{padding-bottom:16px}.price-tables .price-table.style-3 .terms .term:last-child{padding-bottom:0}.price-tables .price-table.style-3 .cta-button{margin:8px 32px}.price-tables .price-table.style-3 .note{padding:8px 32px 16px 32px;text-align:center;color:rgba(0,0,0,.54)}.simple-table-container{background:#fff}.simple-table-container .table-title{font-size:20px;padding:24px}table.simple{width:100%;border:none;border-spacing:0;text-align:left}table.simple thead tr th{padding:16px 8px;font-weight:500;color:rgba(0,0,0,.54);border-bottom:1px solid rgba(0,0,0,.12);white-space:nowrap;min-width:120px}table.simple thead tr th:first-child{padding-left:24px}table.simple thead tr th:last-child{padding-right:24px}table.simple tbody tr td{padding:16px 8px;border-bottom:1px solid rgba(0,0,0,.12)}table.simple tbody tr td:first-child{padding-left:24px}table.simple tbody tr td:last-child{padding-right:24px}table.simple tbody tr:last-child td{border-bottom:none}table.simple.clickable tbody tr{cursor:pointer}table.simple.clickable tbody tr:hover{background:rgba(0,0,0,.03)}html{font-size:62.5%;font-family:Roboto,"Helvetica Neue",Arial,sans-serif;line-height:1.4;letter-spacing:-.1px}body{font-size:1.3rem}body,html{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}form{font-size:1.6rem}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-weight:400}.h1,h1{font-size:2.4rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.6rem}.h4,h4{font-size:1.4rem}.h5,h5{font-size:1.3rem}.h6,h6{font-size:1.2rem}a{text-decoration:none}a:active,a:hover{text-decoration:underline}abbr{cursor:help;border-bottom:1px dotted rgba(0,0,0,.54)}blockquote{border-left:3px solid rgba(0,0,0,.12);font-style:italic;margin:1em 0;padding-left:16px}blockquote footer{font-style:normal}blockquote footer:before{content:'\2014 \00A0'}blockquote.reverse{border-left:none;border-right:3px solid rgba(0,0,0,.12);text-align:right;padding-left:0;padding-right:16px}blockquote.reverse footer:before{content:''}blockquote.reverse footer:after{content:'\2014 \00A0'}code{font-family:Monaco,Menlo,Consolas,"Ubuntu Mono",monospace}code:not(.highlight){background:rgba(0,0,0,.065);color:#106cc8;margin:0 1px;padding:2px 3px;border-radius:2px}dl dt{font-weight:700}dl dd{margin:4px 0 16px 0}mark{background:#f7f49a}pre{line-height:1.6;margin:8px 16px;white-space:pre-wrap}small{font-size:80%}table thead tr th{text-align:left}.text-italic{font-style:italic}.text-semibold{font-weight:600}.text-bold,strong{font-weight:700}.text-strike{text-decoration:line-through}.text-super{vertical-align:super}.text-sub{vertical-align:sub}.text-capitalize{text-transform:capitalize}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-weight-100{font-weight:100}.font-weight-200{font-weight:200}.font-weight-300{font-weight:300}.font-weight-400{font-weight:400}.font-weight-500{font-weight:500}.font-weight-600{font-weight:600}.font-weight-700{font-weight:700}.font-weight-800{font-weight:800}.font-weight-900{font-weight:900}.font-size-2{font-size:2px}.font-size-4{font-size:4px}.font-size-6{font-size:6px}.font-size-8{font-size:8px}.font-size-10{font-size:10px}.font-size-12{font-size:12px}.font-size-14{font-size:14px}.font-size-16{font-size:16px}.font-size-18{font-size:18px}.font-size-20{font-size:20px}.font-size-22{font-size:22px}.font-size-24{font-size:24px}.font-size-26{font-size:26px}.font-size-28{font-size:28px}.font-size-30{font-size:30px}.font-size-32{font-size:32px}.font-size-34{font-size:34px}.font-size-36{font-size:36px}.font-size-38{font-size:38px}.font-size-40{font-size:40px}.font-size-42{font-size:42px}.font-size-44{font-size:44px}.font-size-46{font-size:46px}.font-size-48{font-size:48px}.font-size-50{font-size:50px}.font-size-52{font-size:52px}.font-size-54{font-size:54px}.font-size-56{font-size:56px}.font-size-58{font-size:58px}.font-size-60{font-size:60px}.font-size-62{font-size:62px}.font-size-64{font-size:64px}.font-size-66{font-size:66px}.font-size-68{font-size:68px}.font-size-70{font-size:70px}.font-size-72{font-size:72px}.font-size-74{font-size:74px}.font-size-76{font-size:76px}.font-size-78{font-size:78px}.font-size-80{font-size:80px}.font-size-82{font-size:82px}.font-size-84{font-size:84px}.font-size-86{font-size:86px}.font-size-88{font-size:88px}.font-size-90{font-size:90px}.font-size-92{font-size:92px}.font-size-94{font-size:94px}.font-size-96{font-size:96px}.font-size-98{font-size:98px}.font-size-100{font-size:100px}.font-size-102{font-size:102px}.font-size-104{font-size:104px}.font-size-106{font-size:106px}.font-size-108{font-size:108px}.font-size-110{font-size:110px}.font-size-112{font-size:112px}.font-size-114{font-size:114px}.font-size-116{font-size:116px}.font-size-118{font-size:118px}.font-size-120{font-size:120px}.line-height-2{line-height:2px}.line-height-4{line-height:4px}.line-height-6{line-height:6px}.line-height-8{line-height:8px}.line-height-10{line-height:10px}.line-height-12{line-height:12px}.line-height-14{line-height:14px}.line-height-16{line-height:16px}.line-height-18{line-height:18px}.line-height-20{line-height:20px}.line-height-22{line-height:22px}.line-height-24{line-height:24px}.line-height-26{line-height:26px}.line-height-28{line-height:28px}.line-height-30{line-height:30px}.line-height-32{line-height:32px}.line-height-34{line-height:34px}.line-height-36{line-height:36px}.line-height-38{line-height:38px}.line-height-40{line-height:40px}.line-height-42{line-height:42px}.line-height-44{line-height:44px}.line-height-46{line-height:46px}.line-height-48{line-height:48px}.line-height-50{line-height:50px}.line-height-52{line-height:52px}.line-height-54{line-height:54px}.line-height-56{line-height:56px}.line-height-58{line-height:58px}.line-height-60{line-height:60px}.line-height-62{line-height:62px}.line-height-64{line-height:64px}.line-height-66{line-height:66px}.line-height-68{line-height:68px}.line-height-70{line-height:70px}.line-height-72{line-height:72px}.line-height-74{line-height:74px}.line-height-76{line-height:76px}.line-height-78{line-height:78px}.line-height-80{line-height:80px}.line-height-82{line-height:82px}.line-height-84{line-height:84px}.line-height-86{line-height:86px}.line-height-88{line-height:88px}.line-height-90{line-height:90px}.line-height-92{line-height:92px}.line-height-94{line-height:94px}.line-height-96{line-height:96px}.line-height-98{line-height:98px}.line-height-100{line-height:100px}.line-height-102{line-height:102px}.line-height-104{line-height:104px}.line-height-106{line-height:106px}.line-height-108{line-height:108px}.line-height-110{line-height:110px}.line-height-112{line-height:112px}.line-height-114{line-height:114px}.line-height-116{line-height:116px}.line-height-118{line-height:118px}.line-height-120{line-height:120px}.text-boxed,.text-boxed-light{border-radius:2px;padding:4px 8px;margin:0 8px;font-size:11px;font-weight:500;color:rgba(0,0,0,.54);background-color:rgba(0,0,0,.12);white-space:nowrap}.text-boxed-light{background-color:rgba(255,255,255,.7)}.text-truncate{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-nowrap{white-space:nowrap}html,html *{scrollbar-width:thin;scrollbar-color:rgba(128,128,128,.25) rgba(128,128,128,.25)}::-webkit-scrollbar{width:8px;height:8px;background-color:transparent;box-shadow:none}::-webkit-scrollbar:hover{background-color:transparent}::-webkit-scrollbar-thumb{min-height:8px;min-width:8px;background-color:rgba(128,128,128,.25);box-shadow:none}::-webkit-scrollbar-thumb:hover{background-color:rgba(128,128,128,.125)}::-webkit-scrollbar-thumb:active{background-color:rgba(128,128,128,.15)}.angular-google-map-container{height:400px}.moment-picker .moment-picker-container{width:296px;border:none;border-radius:2px;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);margin-left:0;padding:8px}.moment-picker .moment-picker-container td,.moment-picker .moment-picker-container th{min-width:0;width:40px;height:40px;padding:8px;text-shadow:none;border-radius:35px}.moment-picker .moment-picker-container td:hover,.moment-picker .moment-picker-container th:hover{background:#f5f5f5;background-image:none}.moment-picker .moment-picker-container td.selected{background:#03a9f4;background-image:none}.moment-picker .moment-picker-container .header-view th{border-radius:0;white-space:nowrap;width:auto}.moment-picker .moment-picker-container .header-view th:first-child,.moment-picker .moment-picker-container .header-view th:last-child{width:20%}.c3{transition:all .3s ease}.c3 svg{font:12px RobotoDraft,Roboto,'Helvetica Neue',sans-serif}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{font-family:Roboto,"Helvetica Neue",Arial,sans-serif;user-select:none}.c3 .c3-bars path,.c3 .c3-event-rect,.c3 .c3-legend-item-tile,.c3 .c3-xgrid-focus,.c3 .c3-ygrid{shape-rendering:crispEdges}.c3 .c3-chart-line{transition:all .3s ease}.c3 .c3-line{stroke-width:1px}.c3.stroke-3 .c3-line{stroke-width:3px}.c3.stroke-2 .c3-line{stroke-width:2px}.c3 .c3-circle{transition:all .3s ease;stroke:#fff;stroke-width:2}.c3 .c3-circle._expanded_{stroke-width:3;stroke:#fff}.c3 .c3-chart-arc path{stroke:#fff}.c3 .c3-chart-arc text{fill:#fff;font-size:13px}.c3 .c3-grid line{stroke:rgba(0,0,0,.04);stroke-width:1px;stroke-dasharray:0}.c3 .c3-grid text{fill:#aaa}.c3 .c3-axis .tick{stroke-width:0}.c3 .c3-axis text{fill:rgba(0,0,0,.33)}.c3 .c3-axis line,.c3 .c3-axis path{stroke:rgba(0,0,0,.04)}.c3 .c3-xgrid,.c3 .c3-ygrid{stroke-dasharray:0 0}.c3 .c3-text.c3-empty{fill:grey;font-size:2em}.c3 .c3-bar{stroke-width:0}.c3 .c3-bar._expanded_{fill-opacity:.75}.c3 .c3-target.c3-focused{opacity:1}.c3 .c3-target.c3-focused .c3-target.c3-focused path.c3-step,.c3 .c3-target.c3-focused path.c3-line{stroke-width:3px;transition:all .3s ease}.c3 .c3-target.c3-defocused{opacity:.3!important}.c3 .c3-region{fill:#4682b4;fill-opacity:.1}.c3 .c3-brush .extent{fill-opacity:.1}.c3 .c3-legend-item{font-size:12px}.c3 .c3-legend-item-hidden{opacity:.15}.c3 .c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3 .c3-tooltip-container{z-index:10}.c3 .c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;box-shadow:0 2px 4px -1px rgba(0,0,0,.14),0 4px 5px 0 rgba(0,0,0,.098),0 1px 10px 0 rgba(0,0,0,.084);opacity:1;border-radius:2px;overflow:hidden;padding:4px 0}.c3 .c3-tooltip tr{border:none}.c3 .c3-tooltip th{background-color:transparent;font-size:14px;font-weight:400;padding:8px 12px;text-align:left;color:rgba(0,0,0,.54)}.c3 .c3-tooltip td{font-size:13px;padding:4px 12px!important;background-color:#fff;border-left:none;color:rgba(0,0,0,.84)}.c3 .c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3 .c3-tooltip td.value{font-size:14px!important;text-align:right;color:rgba(0,0,0,.84)}.c3 .c3-area{stroke-width:0;opacity:.2}.c3 .c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3 .c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3 .c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3 .c3-chart-arcs .c3-chart-arcs-gauge-max{fill:#777}.c3 .c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3 .c3-chart-arc .c3-gauge-value{fill:#000}.ct-label{font-size:13px}.ct-chart-donut .ct-label,.ct-chart-pie .ct-label{font-size:13px}.bar-legend,.chart-legend,.doughnut-legend,.line-legend,.pie-legend,.polararea-legend,.radar-legend{margin-top:15px}table.dataTable{width:100%;margin:0 auto;clear:both;border-spacing:0}table.dataTable thead tr{background:#fff}table.dataTable thead th{text-align:left;vertical-align:middle;border-bottom:1px solid rgba(0,0,0,.12);padding:16px 8px}table.dataTable thead th:first-child{padding-left:24px}table.dataTable thead th:last-child{border-right:none;padding-right:24px}table.dataTable thead th:active{outline:0}table.dataTable thead th.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap{white-space:nowrap}table.dataTable thead th .table-header .column-title{display:block;font-weight:600;white-space:nowrap}table.dataTable thead th .table-header .selectize-control{margin-top:15px}table.dataTable thead th .table-header .selectize-control.single .selectize-input{padding:7px 10px}table.dataTable thead th .table-header .selectize-control.single .selectize-input:after{right:10px;border-width:5px 4px 0 4px;border-color:rgba(0,0,0,.12) transparent transparent transparent}table.dataTable thead th .table-header .column-search-input{display:inline-block;margin-top:15px;width:100%;height:33px}table.dataTable thead td{padding:15px;vertical-align:middle}table.dataTable thead td:active{outline:0}table.dataTable thead td.dt-head-left{text-align:left}table.dataTable thead td.dt-head-center{text-align:center}table.dataTable thead td.dt-head-right{text-align:right}table.dataTable thead td.dt-head-justify{text-align:justify}table.dataTable thead td.dt-head-nowrap{white-space:nowrap}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{background:0 0}table.dataTable thead .sorting .table-header .column-title,table.dataTable thead .sorting_asc .table-header .column-title,table.dataTable thead .sorting_desc .table-header .column-title{cursor:pointer}table.dataTable thead .sorting .table-header .column-title:after,table.dataTable thead .sorting_asc .table-header .column-title:after,table.dataTable thead .sorting_desc .table-header .column-title:after{position:relative;font-family:icomoon;font-weight:400;margin-left:10px;top:2px;font-size:16px;color:rgba(0,0,0,.54)}table.dataTable thead .sorting .table-header .column-title:after{content:'\eaa8'}table.dataTable thead .sorting_asc .table-header .column-title:after{content:'\e718'}table.dataTable thead .sorting_desc .table-header .column-title:after{content:'\e715'}table.dataTable tfoot th{font-weight:600;text-align:left;padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable tfoot th.dt-head-left{text-align:left}table.dataTable tfoot th.dt-head-center{text-align:center}table.dataTable tfoot th.dt-head-right{text-align:right}table.dataTable tfoot th.dt-head-justify{text-align:justify}table.dataTable tfoot th.dt-head-nowrap{white-space:nowrap}table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody tr{background-color:#fff}table.dataTable tbody tr.selected{background-color:#b0bed9}table.dataTable tbody tr.details-open td.detail-column i{background:#fff}table.dataTable tbody tr.details-row.odd tr{background:#fff}table.dataTable tbody tr.details-row>td{padding:0}table.dataTable tbody th{padding:14px 15px;vertical-align:middle}table.dataTable tbody th.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap{white-space:nowrap}table.dataTable tbody td{padding:16px 8px;vertical-align:middle}table.dataTable tbody td:first-child{padding-left:24px}table.dataTable tbody td:last-child{padding-right:24px}table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable th.dt-left{text-align:left}table.dataTable th.dt-center{text-align:center}table.dataTable th.dt-right{text-align:right}table.dataTable th.dt-justify{text-align:justify}table.dataTable th.dt-nowrap{white-space:nowrap}table.dataTable td.dt-left{text-align:left}table.dataTable td.dt-center{text-align:center}table.dataTable td.dataTables_empty{height:51px;text-align:center}table.dataTable td.dt-right{text-align:right}table.dataTable td.dt-justify{text-align:justify}table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable.row-border thead{border-bottom:1px solid rgba(0,0,0,.12)}table.dataTable.row-border tbody tr:first-child th{border-top:none}table.dataTable.row-border tbody tr:first-child td{border-top:none}table.dataTable.row-border tbody tr:last-child td{border-bottom:1px solid rgba(0,0,0,.12)}table.dataTable.row-border tbody th{border-top:1px solid rgba(0,0,0,.12)}table.dataTable.row-border tbody td{border-top:1px solid rgba(0,0,0,.12)}table.dataTable.cell-border tbody tr:first-child th{border-top:none}table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th{border-top:1px solid rgba(0,0,0,.12);border-right:1px solid rgba(0,0,0,.12)}table.dataTable.cell-border tbody th:last-child{border-right:none}table.dataTable.cell-border tbody td{border-top:1px solid rgba(0,0,0,.12);border-right:1px solid rgba(0,0,0,.12)}table.dataTable.cell-border tbody td:last-child{border-right:none}table.dataTable.stripe tbody tr.odd{background-color:#fff}table.dataTable.stripe tbody tr.odd.selected{background-color:#abb9d3}table.dataTable.hover tbody tr:hover{background-color:#f5f5f5}table.dataTable.hover tbody tr:hover.selected{background-color:#a9b7d1}table.dataTable.hover tbody tr.odd:hover{background-color:#f5f5f5}table.dataTable.hover tbody tr.odd:hover.selected{background-color:#a9b7d1}table.dataTable.hover tbody tr.even:hover{background-color:#f5f5f5}table.dataTable.hover tbody tr.even:hover.selected{background-color:#a9b7d1}table.dataTable.order-column tbody tr>.sorting_1{background-color:#f9f9f9}table.dataTable.order-column tbody tr>.sorting_2{background-color:#f9f9f9}table.dataTable.order-column tbody tr>.sorting_3{background-color:#f9f9f9}table.dataTable.order-column tbody tr.selected>.sorting_1{background-color:#acbad4}table.dataTable.order-column tbody tr.selected>.sorting_2{background-color:#acbad4}table.dataTable.order-column tbody tr.selected>.sorting_3{background-color:#acbad4}table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:#f5f5f5}table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b3cd}table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a7b5ce}table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b6d0}table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#f9f9f9}table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fbfbfb}table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fdfdfd}table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad4}table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#adbbd6}table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ebebeb}table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#eee}table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a1aec7}table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a2afc8}table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a4b2cb}table.dataTable.order-column.hover tbody tr.odd:hover>.sorting_1{background-color:#eaeaea}table.dataTable.order-column.hover tbody tr.odd:hover>.sorting_2{background-color:#ebebeb}table.dataTable.order-column.hover tbody tr.odd:hover>.sorting_3{background-color:#eee}table.dataTable.order-column.hover tbody tr.odd:hover.selected>.sorting_1{background-color:#a1aec7}table.dataTable.order-column.hover tbody tr.odd:hover.selected>.sorting_2{background-color:#a2afc8}table.dataTable.order-column.hover tbody tr.odd:hover.selected>.sorting_3{background-color:#a4b2cb}table.dataTable.order-column.hover tbody tr.even:hover>.sorting_1{background-color:#eaeaea}table.dataTable.order-column.hover tbody tr.even:hover>.sorting_2{background-color:#ebebeb}table.dataTable.order-column.hover tbody tr.even:hover>.sorting_3{background-color:#eee}table.dataTable.order-column.hover tbody tr.even:hover.selected>.sorting_1{background-color:#a1aec7}table.dataTable.order-column.hover tbody tr.even:hover.selected>.sorting_2{background-color:#a2afc8}table.dataTable.order-column.hover tbody tr.even:hover.selected>.sorting_3{background-color:#a4b2cb}table.dataTable.no-footer{border-bottom:none}table.dataTable.nowrap th{white-space:nowrap}table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th{padding:5px 9px}table.dataTable.compact thead td{padding:5px 9px}table.dataTable.compact tfoot th{padding:5px 9px 3px 9px}table.dataTable.compact tfoot td{padding:5px 9px 3px 9px}table.dataTable.compact tbody th{padding:4px 5px}table.dataTable.compact tbody td{padding:4px 5px}.dataTables_wrapper{display:flex;flex:1 0 auto;flex-direction:column;min-height:0}.dataTables_wrapper .top{padding:16px 24px}.dataTables_wrapper .bottom{display:flex;min-height:64px;justify-content:space-between;padding:16px 8px;border-top:1px solid rgba(0,0,0,.12)}.dataTables_wrapper .bottom .left{display:flex;flex:0 0 50%;max-width:50%;align-self:center;padding:0 8px}.dataTables_wrapper .bottom .left .length{display:block}.dataTables_wrapper .bottom .right{display:flex;flex:0 0 50%;max-width:50%;align-self:center;justify-content:flex-end;padding:0 8px}.dataTables_wrapper .bottom .right .info{display:block;align-self:center}.dataTables_wrapper .bottom .right .info .dataTables_info{padding:0 8px;font-weight:600}.dataTables_wrapper .bottom .right .pagination{display:block;align-self:center;white-space:nowrap}.dataTables_wrapper .bottom .right .pagination .dataTables_paginate{padding:0;margin:0!important}.dataTables_wrapper .dataTables_filter{float:right}.dataTables_wrapper .dataTables_filter input{margin-left:.5em;border:1px solid rgba(0,0,0,.12);height:24px;padding:4px 8px}.dataTables_wrapper .dataTables_paginate .paginate_button{background:#fff;color:rgba(0,0,0,.87);border:1px solid rgba(0,0,0,.12);padding:9px 12px;border-radius:2px;cursor:pointer;user-select:none;margin:0 2px}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{box-shadow:inset 999em 0 0 0 rgba(0,0,0,.05);color:rgba(0,0,0,.87)!important;border:1px solid rgba(0,0,0,.12)!important;background:0 0}.dataTables_wrapper .dataTables_paginate .paginate_button:active{box-shadow:inset 999em 0 0 0 rgba(0,0,0,.08),inset 0 1px 3px 0 rgba(0,0,0,.1),0 1px 0 0 rgba(255,255,255,.35)}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover{color:rgba(0,0,0,.54)!important;border-color:rgba(0,0,0,.12)!important;background:#fff!important;box-shadow:none!important;cursor:default}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:#fff;background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(25%,rgba(255,255,255,.9)),color-stop(75%,rgba(255,255,255,.9)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_scroll{display:flex;flex:1 1 0;flex-direction:column;clear:both;min-height:0}.dataTables_wrapper .dataTables_scroll table.dataTable{box-shadow:none}.dataTables_wrapper .dataTables_scroll table.dataTable.row-border thead{border:none}.dataTables_wrapper .dataTables_scroll .dataTables_scrollHead{display:flex;min-height:56px;box-shadow:0 0 0 1px rgba(0,0,0,.095),0 1px 1px 0 rgba(0,0,0,.1),0 2px 1px 0 rgba(0,0,0,.05);background:#fff;overflow:visible!important}.dataTables_wrapper .dataTables_scroll .dataTables_scrollHead tr th:last-child .table-header .column-title{position:relative;left:7px}.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody{display:flex;overflow-x:hidden!important;overflow-y:scroll!important;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody th>.dataTables_sizing{height:0;overflow:hidden;margin:0!important;padding:0!important}.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody td>.dataTables_sizing{height:0;overflow:hidden;margin:0!important;padding:0!important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:none}.dataTables_wrapper.no-footer .dataTables_scrollBody table,.dataTables_wrapper.no-footer .dataTables_scrollHead table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:'';clear:both;height:0}table.dataTable .show-details{padding:5px 10px;font-weight:700}table.dataTable .action-buttons{display:flex;justify-content:center}table.dataTable .action-buttons .button{padding:8px}.fullpage-datatable .dataTables_wrapper{height:100%;max-height:100%}.explorer-11 .fullpage-datatable .dataTables_scroll{flex:1}table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr>td:first-child,table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr>th:first-child{padding-left:40px}table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr>td:first-child:before,table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr>th:first-child:before{content:'+';width:15px;height:15px;line-height:15px;top:50%;margin-top:-7px;left:8px;color:rgba(0,0,0,.54);background:0 0;border:none;box-shadow:0 0 0 2px rgba(0,0,0,.54);font-weight:700}table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr.parent>td:first-child:before,table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr.parent>th:first-child:before{background:0 0}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul{display:block}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul li{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;border-bottom:1px solid rgba(0,0,0,.12);padding:8px 0}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul li:first-child{padding-top:0}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul li:last-child{border-bottom:none;padding-bottom:0}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul li .dtr-title{margin-right:8px}[hljs],hljs{display:block;overflow-x:auto;color:#333;background:#f8f8f8;-webkit-text-size-adjust:none}.diff .hljs-header,.hljs-comment{color:#998;font-style:italic}.css .rule .hljs-keyword,.hljs-keyword,.hljs-request,.hljs-status,.hljs-subst,.hljs-winutils,.nginx .hljs-title{color:#333;font-weight:700}.hljs-hexcolor,.hljs-number,.ruby .hljs-constant{color:teal}.hljs-doctag,.hljs-string,.hljs-tag .hljs-value,.tex .hljs-formula{color:#d14}.hljs-id,.hljs-title,.scss .hljs-preprocessor{color:#900;font-weight:700}.hljs-list .hljs-keyword,.hljs-subst{font-weight:400}.hljs-class .hljs-title,.hljs-type,.tex .hljs-command,.vhdl .hljs-literal{color:#458;font-weight:700}.django .hljs-tag .hljs-keyword,.hljs-rule .hljs-property,.hljs-tag,.hljs-tag .hljs-title{color:navy;font-weight:400}.hljs-attribute,.hljs-name,.hljs-variable,.lisp .hljs-body{color:teal}.hljs-regexp{color:#009926}.clojure .hljs-keyword,.hljs-prompt,.hljs-symbol,.lisp .hljs-keyword,.ruby .hljs-symbol .hljs-string,.scheme .hljs-keyword,.tex .hljs-special{color:#990073}.hljs-built_in{color:#0086b3}.hljs-cdata,.hljs-doctype,.hljs-pi,.hljs-pragma,.hljs-preprocessor,.hljs-shebang{color:#999;font-weight:700}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.diff .hljs-change{background:#0086b3}.hljs-chunk{color:#aaa}nvd3{display:block;width:100%;height:100%}nvd3.remove-x-lines .nv-x .tick line{display:none}nvd3.remove-y-lines .nv-y .tick line{display:none}nvd3.remove-line-stroke .nv-groups path.nv-line{stroke-width:0!important}nvd3.remove-opacity .nv-groups .nv-group{fill-opacity:1!important}nvd3.show-line-points .nv-line .nv-scatter .nv-groups .nv-point{fill-opacity:1!important;stroke-opacity:1!important}.nvd3 text{font-family:Roboto,"Helvetica Neue",Arial,sans-serif}.nvd3 line.nv-guideline{stroke:rgba(0,0,0,.54)}.nvd3 .nv-groups .nv-point.hover{stroke-width:3px!important;fill-opacity:1!important;stroke-opacity:1!important}.nvtooltip{background:0 0;color:#fff;padding:0;border:none}.nvtooltip.gravity-n:after{display:block;position:absolute;content:'';width:0;height:0;left:50%;bottom:100%;margin-left:-5px;border:5px solid transparent;border-bottom-color:rgba(0,0,0,.87)}.nvtooltip.gravity-s:after{display:block;position:absolute;content:'';width:0;height:0;top:100%;left:50%;margin-left:-5px;border:5px solid transparent;border-top-color:rgba(0,0,0,.87)}.nvtooltip.gravity-e:after{display:block;position:absolute;content:'';width:0;height:0;top:50%;right:0;margin-top:-6px;margin-right:-11px;border:6px solid transparent;border-left-color:rgba(0,0,0,.87)}.nvtooltip.gravity-w:after{display:block;position:absolute;content:'';width:0;height:0;top:50%;margin-top:-6px;margin-left:-11px;border:6px solid transparent;border-right-color:rgba(0,0,0,.87)}.nvtooltip table{background:rgba(0,0,0,.87);padding:8px 12px;margin:0;border-radius:2px}.nvtooltip table tbody tr td.legend-color-guide div{border:none}.nvtooltip table tbody tr td:last-child{padding-right:0}.ta-root{display:block}.ta-root .ta-scroll-window.form-control{border:1px solid rgba(0,0,0,.12)}.ta-root.focussed>.ta-scroll-window.form-control{outline:0 solid transparent;border:1px solid rgba(0,0,0,.12);box-shadow:none}.ta-root textarea.ta-editor.ta-html{resize:vertical;width:100%!important;border:1px solid rgba(0,0,0,.12);padding:16px}.ta-root .ta-toolbar{border:1px solid rgba(0,0,0,.12);border-bottom:none;background:#f5f5f5}.ta-root .ta-toolbar .ta-group{display:flex;align-items:center;align-content:center;flex-wrap:wrap}.ta-root .ta-toolbar .ta-group #toolbarCC,.ta-root .ta-toolbar .ta-group #toolbarWC{display:inline-block!important;line-height:24px}.ta-root .ta-toolbar .ta-group .md-button{width:40px;min-width:40px;line-height:14px;height:36px;min-height:36px;padding:6px;margin:4px 0}.ta-root .ta-toolbar .ta-group .md-button i{font-size:20px;width:20px;height:20px;line-height:20px}.ng-cloak,.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}.no-padding{padding:0!important}.no-margin{margin:0!important}.no-radius{border-radius:0}.divider-vertical{background:rgba(0,0,0,.12);height:24px;width:1px;margin:0 8px}.hidden{visibility:hidden;opacity:0}[fill-width]{min-width:100%}[fill-height]{min-height:100%}.full-height{height:100%!important}a img{display:block;outline:0}img{max-width:100%;height:auto;vertical-align:top;border:none}.scrollable{display:block;position:relative;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.scrollable.only-x{overflow-x:auto;overflow-y:hidden}.scrollable.only-y{overflow-x:hidden;overflow-y:auto}.flex-scrollable{position:relative;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.flex-scrollable.only-x{overflow-x:auto;overflow-y:hidden}.flex-scrollable.only-y{overflow-x:hidden;overflow-y:auto}.background-image-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:-1}.align-vertical:before{display:inline-block;height:100%;content:'';vertical-align:middle}.align-vertical .align-vertical-bottom,.align-vertical .align-vertical-middle,.align-vertical .align-vertical-top{display:inline-block}.align-vertical .align-vertical-top{vertical-align:top}.align-vertical .align-vertical-middle{vertical-align:middle}.align-vertical .align-vertical-bottom{vertical-align:bottom}.p-0,.padding-0{padding:0}.padding-top-0,.pt-0{padding-top:0}.padding-right-0,.pr-0{padding-right:0}.padding-bottom-0,.pb-0{padding-bottom:0}.padding-left-0,.pl-0{padding-left:0}.padding-horizontal-0,.ph-0{padding-left:0;padding-right:0}.padding-vertical-0,.pv-0{padding-top:0;padding-bottom:0}.p-5,.padding-5{padding:5px}.padding-top-5,.pt-5{padding-top:5px}.padding-right-5,.pr-5{padding-right:5px}.padding-bottom-5,.pb-5{padding-bottom:5px}.padding-left-5,.pl-5{padding-left:5px}.padding-horizontal-5,.ph-5{padding-left:5px;padding-right:5px}.padding-vertical-5,.pv-5{padding-top:5px;padding-bottom:5px}.p-10,.padding-10{padding:10px}.padding-top-10,.pt-10{padding-top:10px}.padding-right-10,.pr-10{padding-right:10px}.padding-bottom-10,.pb-10{padding-bottom:10px}.padding-left-10,.pl-10{padding-left:10px}.padding-horizontal-10,.ph-10{padding-left:10px;padding-right:10px}.padding-vertical-10,.pv-10{padding-top:10px;padding-bottom:10px}.p-15,.padding-15{padding:15px}.padding-top-15,.pt-15{padding-top:15px}.padding-right-15,.pr-15{padding-right:15px}.padding-bottom-15,.pb-15{padding-bottom:15px}.padding-left-15,.pl-15{padding-left:15px}.padding-horizontal-15,.ph-15{padding-left:15px;padding-right:15px}.padding-vertical-15,.pv-15{padding-top:15px;padding-bottom:15px}.p-20,.padding-20{padding:20px}.padding-top-20,.pt-20{padding-top:20px}.padding-right-20,.pr-20{padding-right:20px}.padding-bottom-20,.pb-20{padding-bottom:20px}.padding-left-20,.pl-20{padding-left:20px}.padding-horizontal-20,.ph-20{padding-left:20px;padding-right:20px}.padding-vertical-20,.pv-20{padding-top:20px;padding-bottom:20px}.p-25,.padding-25{padding:25px}.padding-top-25,.pt-25{padding-top:25px}.padding-right-25,.pr-25{padding-right:25px}.padding-bottom-25,.pb-25{padding-bottom:25px}.padding-left-25,.pl-25{padding-left:25px}.padding-horizontal-25,.ph-25{padding-left:25px;padding-right:25px}.padding-vertical-25,.pv-25{padding-top:25px;padding-bottom:25px}.p-30,.padding-30{padding:30px}.padding-top-30,.pt-30{padding-top:30px}.padding-right-30,.pr-30{padding-right:30px}.padding-bottom-30,.pb-30{padding-bottom:30px}.padding-left-30,.pl-30{padding-left:30px}.padding-horizontal-30,.ph-30{padding-left:30px;padding-right:30px}.padding-vertical-30,.pv-30{padding-top:30px;padding-bottom:30px}.p-35,.padding-35{padding:35px}.padding-top-35,.pt-35{padding-top:35px}.padding-right-35,.pr-35{padding-right:35px}.padding-bottom-35,.pb-35{padding-bottom:35px}.padding-left-35,.pl-35{padding-left:35px}.padding-horizontal-35,.ph-35{padding-left:35px;padding-right:35px}.padding-vertical-35,.pv-35{padding-top:35px;padding-bottom:35px}.p-40,.padding-40{padding:40px}.padding-top-40,.pt-40{padding-top:40px}.padding-right-40,.pr-40{padding-right:40px}.padding-bottom-40,.pb-40{padding-bottom:40px}.padding-left-40,.pl-40{padding-left:40px}.padding-horizontal-40,.ph-40{padding-left:40px;padding-right:40px}.padding-vertical-40,.pv-40{padding-top:40px;padding-bottom:40px}.p-45,.padding-45{padding:45px}.padding-top-45,.pt-45{padding-top:45px}.padding-right-45,.pr-45{padding-right:45px}.padding-bottom-45,.pb-45{padding-bottom:45px}.padding-left-45,.pl-45{padding-left:45px}.padding-horizontal-45,.ph-45{padding-left:45px;padding-right:45px}.padding-vertical-45,.pv-45{padding-top:45px;padding-bottom:45px}.p-50,.padding-50{padding:50px}.padding-top-50,.pt-50{padding-top:50px}.padding-right-50,.pr-50{padding-right:50px}.padding-bottom-50,.pb-50{padding-bottom:50px}.padding-left-50,.pl-50{padding-left:50px}.padding-horizontal-50,.ph-50{padding-left:50px;padding-right:50px}.padding-vertical-50,.pv-50{padding-top:50px;padding-bottom:50px}.p-55,.padding-55{padding:55px}.padding-top-55,.pt-55{padding-top:55px}.padding-right-55,.pr-55{padding-right:55px}.padding-bottom-55,.pb-55{padding-bottom:55px}.padding-left-55,.pl-55{padding-left:55px}.padding-horizontal-55,.ph-55{padding-left:55px;padding-right:55px}.padding-vertical-55,.pv-55{padding-top:55px;padding-bottom:55px}.p-60,.padding-60{padding:60px}.padding-top-60,.pt-60{padding-top:60px}.padding-right-60,.pr-60{padding-right:60px}.padding-bottom-60,.pb-60{padding-bottom:60px}.padding-left-60,.pl-60{padding-left:60px}.padding-horizontal-60,.ph-60{padding-left:60px;padding-right:60px}.padding-vertical-60,.pv-60{padding-top:60px;padding-bottom:60px}.p-65,.padding-65{padding:65px}.padding-top-65,.pt-65{padding-top:65px}.padding-right-65,.pr-65{padding-right:65px}.padding-bottom-65,.pb-65{padding-bottom:65px}.padding-left-65,.pl-65{padding-left:65px}.padding-horizontal-65,.ph-65{padding-left:65px;padding-right:65px}.padding-vertical-65,.pv-65{padding-top:65px;padding-bottom:65px}.p-70,.padding-70{padding:70px}.padding-top-70,.pt-70{padding-top:70px}.padding-right-70,.pr-70{padding-right:70px}.padding-bottom-70,.pb-70{padding-bottom:70px}.padding-left-70,.pl-70{padding-left:70px}.padding-horizontal-70,.ph-70{padding-left:70px;padding-right:70px}.padding-vertical-70,.pv-70{padding-top:70px;padding-bottom:70px}.p-75,.padding-75{padding:75px}.padding-top-75,.pt-75{padding-top:75px}.padding-right-75,.pr-75{padding-right:75px}.padding-bottom-75,.pb-75{padding-bottom:75px}.padding-left-75,.pl-75{padding-left:75px}.padding-horizontal-75,.ph-75{padding-left:75px;padding-right:75px}.padding-vertical-75,.pv-75{padding-top:75px;padding-bottom:75px}.p-80,.padding-80{padding:80px}.padding-top-80,.pt-80{padding-top:80px}.padding-right-80,.pr-80{padding-right:80px}.padding-bottom-80,.pb-80{padding-bottom:80px}.padding-left-80,.pl-80{padding-left:80px}.padding-horizontal-80,.ph-80{padding-left:80px;padding-right:80px}.padding-vertical-80,.pv-80{padding-top:80px;padding-bottom:80px}.p-85,.padding-85{padding:85px}.padding-top-85,.pt-85{padding-top:85px}.padding-right-85,.pr-85{padding-right:85px}.padding-bottom-85,.pb-85{padding-bottom:85px}.padding-left-85,.pl-85{padding-left:85px}.padding-horizontal-85,.ph-85{padding-left:85px;padding-right:85px}.padding-vertical-85,.pv-85{padding-top:85px;padding-bottom:85px}.p-90,.padding-90{padding:90px}.padding-top-90,.pt-90{padding-top:90px}.padding-right-90,.pr-90{padding-right:90px}.padding-bottom-90,.pb-90{padding-bottom:90px}.padding-left-90,.pl-90{padding-left:90px}.padding-horizontal-90,.ph-90{padding-left:90px;padding-right:90px}.padding-vertical-90,.pv-90{padding-top:90px;padding-bottom:90px}.p-95,.padding-95{padding:95px}.padding-top-95,.pt-95{padding-top:95px}.padding-right-95,.pr-95{padding-right:95px}.padding-bottom-95,.pb-95{padding-bottom:95px}.padding-left-95,.pl-95{padding-left:95px}.padding-horizontal-95,.ph-95{padding-left:95px;padding-right:95px}.padding-vertical-95,.pv-95{padding-top:95px;padding-bottom:95px}.p-100,.padding-100{padding:100px}.padding-top-100,.pt-100{padding-top:100px}.padding-right-100,.pr-100{padding-right:100px}.padding-bottom-100,.pb-100{padding-bottom:100px}.padding-left-100,.pl-100{padding-left:100px}.padding-horizontal-100,.ph-100{padding-left:100px;padding-right:100px}.padding-vertical-100,.pv-100{padding-top:100px;padding-bottom:100px}.p-8,.padding-8{padding:8px}.padding-top-8,.pt-8{padding-top:8px}.padding-right-8,.pr-8{padding-right:8px}.padding-bottom-8,.pb-8{padding-bottom:8px}.padding-left-8,.pl-8{padding-left:8px}.padding-horizontal-8,.ph-8{padding-left:8px;padding-right:8px}.padding-vertical-8,.pv-8{padding-top:8px;padding-bottom:8px}.p-16,.padding-16{padding:16px}.padding-top-16,.pt-16{padding-top:16px}.padding-right-16,.pr-16{padding-right:16px}.padding-bottom-16,.pb-16{padding-bottom:16px}.padding-left-16,.pl-16{padding-left:16px}.padding-horizontal-16,.ph-16{padding-left:16px;padding-right:16px}.padding-vertical-16,.pv-16{padding-top:16px;padding-bottom:16px}.p-24,.padding-24{padding:24px}.padding-top-24,.pt-24{padding-top:24px}.padding-right-24,.pr-24{padding-right:24px}.padding-bottom-24,.pb-24{padding-bottom:24px}.padding-left-24,.pl-24{padding-left:24px}.padding-horizontal-24,.ph-24{padding-left:24px;padding-right:24px}.padding-vertical-24,.pv-24{padding-top:24px;padding-bottom:24px}.p-32,.padding-32{padding:32px}.padding-top-32,.pt-32{padding-top:32px}.padding-right-32,.pr-32{padding-right:32px}.padding-bottom-32,.pb-32{padding-bottom:32px}.padding-left-32,.pl-32{padding-left:32px}.padding-horizontal-32,.ph-32{padding-left:32px;padding-right:32px}.padding-vertical-32,.pv-32{padding-top:32px;padding-bottom:32px}.p-48,.padding-48{padding:48px}.padding-top-48,.pt-48{padding-top:48px}.padding-right-48,.pr-48{padding-right:48px}.padding-bottom-48,.pb-48{padding-bottom:48px}.padding-left-48,.pl-48{padding-left:48px}.padding-horizontal-48,.ph-48{padding-left:48px;padding-right:48px}.padding-vertical-48,.pv-48{padding-top:48px;padding-bottom:48px}.p-56,.padding-56{padding:56px}.padding-top-56,.pt-56{padding-top:56px}.padding-right-56,.pr-56{padding-right:56px}.padding-bottom-56,.pb-56{padding-bottom:56px}.padding-left-56,.pl-56{padding-left:56px}.padding-horizontal-56,.ph-56{padding-left:56px;padding-right:56px}.padding-vertical-56,.pv-56{padding-top:56px;padding-bottom:56px}.p-64,.padding-64{padding:64px}.padding-top-64,.pt-64{padding-top:64px}.padding-right-64,.pr-64{padding-right:64px}.padding-bottom-64,.pb-64{padding-bottom:64px}.padding-left-64,.pl-64{padding-left:64px}.padding-horizontal-64,.ph-64{padding-left:64px;padding-right:64px}.padding-vertical-64,.pv-64{padding-top:64px;padding-bottom:64px}.p-72,.padding-72{padding:72px}.padding-top-72,.pt-72{padding-top:72px}.padding-right-72,.pr-72{padding-right:72px}.padding-bottom-72,.pb-72{padding-bottom:72px}.padding-left-72,.pl-72{padding-left:72px}.padding-horizontal-72,.ph-72{padding-left:72px;padding-right:72px}.padding-vertical-72,.pv-72{padding-top:72px;padding-bottom:72px}.p-88,.padding-88{padding:88px}.padding-top-88,.pt-88{padding-top:88px}.padding-right-88,.pr-88{padding-right:88px}.padding-bottom-88,.pb-88{padding-bottom:88px}.padding-left-88,.pl-88{padding-left:88px}.padding-horizontal-88,.ph-88{padding-left:88px;padding-right:88px}.padding-vertical-88,.pv-88{padding-top:88px;padding-bottom:88px}.p-96,.padding-96{padding:96px}.padding-top-96,.pt-96{padding-top:96px}.padding-right-96,.pr-96{padding-right:96px}.padding-bottom-96,.pb-96{padding-bottom:96px}.padding-left-96,.pl-96{padding-left:96px}.padding-horizontal-96,.ph-96{padding-left:96px;padding-right:96px}.padding-vertical-96,.pv-96{padding-top:96px;padding-bottom:96px}.m-0,.margin-0{margin:0}.margin-top-0,.mt-0{margin-top:0}.margin-right-0,.mr-0{margin-right:0}.margin-bottom-0,.mb-0{margin-bottom:0}.margin-left-0,.ml-0{margin-left:0}.margin-horizontal-0,.mh-0{margin-left:0;margin-right:0}.margin-vertical-0,.mv-0{margin-top:0;margin-bottom:0}.m-5,.margin-5{margin:5px}.margin-top-5,.mt-5{margin-top:5px}.margin-right-5,.mr-5{margin-right:5px}.margin-bottom-5,.mb-5{margin-bottom:5px}.margin-left-5,.ml-5{margin-left:5px}.margin-horizontal-5,.mh-5{margin-left:5px;margin-right:5px}.margin-vertical-5,.mv-5{margin-top:5px;margin-bottom:5px}.m-10,.margin-10{margin:10px}.margin-top-10,.mt-10{margin-top:10px}.margin-right-10,.mr-10{margin-right:10px}.margin-bottom-10,.mb-10{margin-bottom:10px}.margin-left-10,.ml-10{margin-left:10px}.margin-horizontal-10,.mh-10{margin-left:10px;margin-right:10px}.margin-vertical-10,.mv-10{margin-top:10px;margin-bottom:10px}.m-15,.margin-15{margin:15px}.margin-top-15,.mt-15{margin-top:15px}.margin-right-15,.mr-15{margin-right:15px}.margin-bottom-15,.mb-15{margin-bottom:15px}.margin-left-15,.ml-15{margin-left:15px}.margin-horizontal-15,.mh-15{margin-left:15px;margin-right:15px}.margin-vertical-15,.mv-15{margin-top:15px;margin-bottom:15px}.m-20,.margin-20{margin:20px}.margin-top-20,.mt-20{margin-top:20px}.margin-right-20,.mr-20{margin-right:20px}.margin-bottom-20,.mb-20{margin-bottom:20px}.margin-left-20,.ml-20{margin-left:20px}.margin-horizontal-20,.mh-20{margin-left:20px;margin-right:20px}.margin-vertical-20,.mv-20{margin-top:20px;margin-bottom:20px}.m-25,.margin-25{margin:25px}.margin-top-25,.mt-25{margin-top:25px}.margin-right-25,.mr-25{margin-right:25px}.margin-bottom-25,.mb-25{margin-bottom:25px}.margin-left-25,.ml-25{margin-left:25px}.margin-horizontal-25,.mh-25{margin-left:25px;margin-right:25px}.margin-vertical-25,.mv-25{margin-top:25px;margin-bottom:25px}.m-30,.margin-30{margin:30px}.margin-top-30,.mt-30{margin-top:30px}.margin-right-30,.mr-30{margin-right:30px}.margin-bottom-30,.mb-30{margin-bottom:30px}.margin-left-30,.ml-30{margin-left:30px}.margin-horizontal-30,.mh-30{margin-left:30px;margin-right:30px}.margin-vertical-30,.mv-30{margin-top:30px;margin-bottom:30px}.m-35,.margin-35{margin:35px}.margin-top-35,.mt-35{margin-top:35px}.margin-right-35,.mr-35{margin-right:35px}.margin-bottom-35,.mb-35{margin-bottom:35px}.margin-left-35,.ml-35{margin-left:35px}.margin-horizontal-35,.mh-35{margin-left:35px;margin-right:35px}.margin-vertical-35,.mv-35{margin-top:35px;margin-bottom:35px}.m-40,.margin-40{margin:40px}.margin-top-40,.mt-40{margin-top:40px}.margin-right-40,.mr-40{margin-right:40px}.margin-bottom-40,.mb-40{margin-bottom:40px}.margin-left-40,.ml-40{margin-left:40px}.margin-horizontal-40,.mh-40{margin-left:40px;margin-right:40px}.margin-vertical-40,.mv-40{margin-top:40px;margin-bottom:40px}.m-45,.margin-45{margin:45px}.margin-top-45,.mt-45{margin-top:45px}.margin-right-45,.mr-45{margin-right:45px}.margin-bottom-45,.mb-45{margin-bottom:45px}.margin-left-45,.ml-45{margin-left:45px}.margin-horizontal-45,.mh-45{margin-left:45px;margin-right:45px}.margin-vertical-45,.mv-45{margin-top:45px;margin-bottom:45px}.m-50,.margin-50{margin:50px}.margin-top-50,.mt-50{margin-top:50px}.margin-right-50,.mr-50{margin-right:50px}.margin-bottom-50,.mb-50{margin-bottom:50px}.margin-left-50,.ml-50{margin-left:50px}.margin-horizontal-50,.mh-50{margin-left:50px;margin-right:50px}.margin-vertical-50,.mv-50{margin-top:50px;margin-bottom:50px}.m-55,.margin-55{margin:55px}.margin-top-55,.mt-55{margin-top:55px}.margin-right-55,.mr-55{margin-right:55px}.margin-bottom-55,.mb-55{margin-bottom:55px}.margin-left-55,.ml-55{margin-left:55px}.margin-horizontal-55,.mh-55{margin-left:55px;margin-right:55px}.margin-vertical-55,.mv-55{margin-top:55px;margin-bottom:55px}.m-60,.margin-60{margin:60px}.margin-top-60,.mt-60{margin-top:60px}.margin-right-60,.mr-60{margin-right:60px}.margin-bottom-60,.mb-60{margin-bottom:60px}.margin-left-60,.ml-60{margin-left:60px}.margin-horizontal-60,.mh-60{margin-left:60px;margin-right:60px}.margin-vertical-60,.mv-60{margin-top:60px;margin-bottom:60px}.m-65,.margin-65{margin:65px}.margin-top-65,.mt-65{margin-top:65px}.margin-right-65,.mr-65{margin-right:65px}.margin-bottom-65,.mb-65{margin-bottom:65px}.margin-left-65,.ml-65{margin-left:65px}.margin-horizontal-65,.mh-65{margin-left:65px;margin-right:65px}.margin-vertical-65,.mv-65{margin-top:65px;margin-bottom:65px}.m-70,.margin-70{margin:70px}.margin-top-70,.mt-70{margin-top:70px}.margin-right-70,.mr-70{margin-right:70px}.margin-bottom-70,.mb-70{margin-bottom:70px}.margin-left-70,.ml-70{margin-left:70px}.margin-horizontal-70,.mh-70{margin-left:70px;margin-right:70px}.margin-vertical-70,.mv-70{margin-top:70px;margin-bottom:70px}.m-75,.margin-75{margin:75px}.margin-top-75,.mt-75{margin-top:75px}.margin-right-75,.mr-75{margin-right:75px}.margin-bottom-75,.mb-75{margin-bottom:75px}.margin-left-75,.ml-75{margin-left:75px}.margin-horizontal-75,.mh-75{margin-left:75px;margin-right:75px}.margin-vertical-75,.mv-75{margin-top:75px;margin-bottom:75px}.m-80,.margin-80{margin:80px}.margin-top-80,.mt-80{margin-top:80px}.margin-right-80,.mr-80{margin-right:80px}.margin-bottom-80,.mb-80{margin-bottom:80px}.margin-left-80,.ml-80{margin-left:80px}.margin-horizontal-80,.mh-80{margin-left:80px;margin-right:80px}.margin-vertical-80,.mv-80{margin-top:80px;margin-bottom:80px}.m-85,.margin-85{margin:85px}.margin-top-85,.mt-85{margin-top:85px}.margin-right-85,.mr-85{margin-right:85px}.margin-bottom-85,.mb-85{margin-bottom:85px}.margin-left-85,.ml-85{margin-left:85px}.margin-horizontal-85,.mh-85{margin-left:85px;margin-right:85px}.margin-vertical-85,.mv-85{margin-top:85px;margin-bottom:85px}.m-90,.margin-90{margin:90px}.margin-top-90,.mt-90{margin-top:90px}.margin-right-90,.mr-90{margin-right:90px}.margin-bottom-90,.mb-90{margin-bottom:90px}.margin-left-90,.ml-90{margin-left:90px}.margin-horizontal-90,.mh-90{margin-left:90px;margin-right:90px}.margin-vertical-90,.mv-90{margin-top:90px;margin-bottom:90px}.m-95,.margin-95{margin:95px}.margin-top-95,.mt-95{margin-top:95px}.margin-right-95,.mr-95{margin-right:95px}.margin-bottom-95,.mb-95{margin-bottom:95px}.margin-left-95,.ml-95{margin-left:95px}.margin-horizontal-95,.mh-95{margin-left:95px;margin-right:95px}.margin-vertical-95,.mv-95{margin-top:95px;margin-bottom:95px}.m-100,.margin-100{margin:100px}.margin-top-100,.mt-100{margin-top:100px}.margin-right-100,.mr-100{margin-right:100px}.margin-bottom-100,.mb-100{margin-bottom:100px}.margin-left-100,.ml-100{margin-left:100px}.margin-horizontal-100,.mh-100{margin-left:100px;margin-right:100px}.margin-vertical-100,.mv-100{margin-top:100px;margin-bottom:100px}.m-8,.margin-8{margin:8px}.margin-top-8,.mt-8{margin-top:8px}.margin-right-8,.mr-8{margin-right:8px}.margin-bottom-8,.mb-8{margin-bottom:8px}.margin-left-8,.ml-8{margin-left:8px}.margin-horizontal-8,.mh-8{margin-left:8px;margin-right:8px}.margin-vertical-8,.mv-8{margin-top:8px;margin-bottom:8px}.m-16,.margin-16{margin:16px}.margin-top-16,.mt-16{margin-top:16px}.margin-right-16,.mr-16{margin-right:16px}.margin-bottom-16,.mb-16{margin-bottom:16px}.margin-left-16,.ml-16{margin-left:16px}.margin-horizontal-16,.mh-16{margin-left:16px;margin-right:16px}.margin-vertical-16,.mv-16{margin-top:16px;margin-bottom:16px}.m-24,.margin-24{margin:24px}.margin-top-24,.mt-24{margin-top:24px}.margin-right-24,.mr-24{margin-right:24px}.margin-bottom-24,.mb-24{margin-bottom:24px}.margin-left-24,.ml-24{margin-left:24px}.margin-horizontal-24,.mh-24{margin-left:24px;margin-right:24px}.margin-vertical-24,.mv-24{margin-top:24px;margin-bottom:24px}.m-32,.margin-32{margin:32px}.margin-top-32,.mt-32{margin-top:32px}.margin-right-32,.mr-32{margin-right:32px}.margin-bottom-32,.mb-32{margin-bottom:32px}.margin-left-32,.ml-32{margin-left:32px}.margin-horizontal-32,.mh-32{margin-left:32px;margin-right:32px}.margin-vertical-32,.mv-32{margin-top:32px;margin-bottom:32px}.m-48,.margin-48{margin:48px}.margin-top-48,.mt-48{margin-top:48px}.margin-right-48,.mr-48{margin-right:48px}.margin-bottom-48,.mb-48{margin-bottom:48px}.margin-left-48,.ml-48{margin-left:48px}.margin-horizontal-48,.mh-48{margin-left:48px;margin-right:48px}.margin-vertical-48,.mv-48{margin-top:48px;margin-bottom:48px}.m-56,.margin-56{margin:56px}.margin-top-56,.mt-56{margin-top:56px}.margin-right-56,.mr-56{margin-right:56px}.margin-bottom-56,.mb-56{margin-bottom:56px}.margin-left-56,.ml-56{margin-left:56px}.margin-horizontal-56,.mh-56{margin-left:56px;margin-right:56px}.margin-vertical-56,.mv-56{margin-top:56px;margin-bottom:56px}.m-64,.margin-64{margin:64px}.margin-top-64,.mt-64{margin-top:64px}.margin-right-64,.mr-64{margin-right:64px}.margin-bottom-64,.mb-64{margin-bottom:64px}.margin-left-64,.ml-64{margin-left:64px}.margin-horizontal-64,.mh-64{margin-left:64px;margin-right:64px}.margin-vertical-64,.mv-64{margin-top:64px;margin-bottom:64px}.m-72,.margin-72{margin:72px}.margin-top-72,.mt-72{margin-top:72px}.margin-right-72,.mr-72{margin-right:72px}.margin-bottom-72,.mb-72{margin-bottom:72px}.margin-left-72,.ml-72{margin-left:72px}.margin-horizontal-72,.mh-72{margin-left:72px;margin-right:72px}.margin-vertical-72,.mv-72{margin-top:72px;margin-bottom:72px}.m-88,.margin-88{margin:88px}.margin-top-88,.mt-88{margin-top:88px}.margin-right-88,.mr-88{margin-right:88px}.margin-bottom-88,.mb-88{margin-bottom:88px}.margin-left-88,.ml-88{margin-left:88px}.margin-horizontal-88,.mh-88{margin-left:88px;margin-right:88px}.margin-vertical-88,.mv-88{margin-top:88px;margin-bottom:88px}.m-96,.margin-96{margin:96px}.margin-top-96,.mt-96{margin-top:96px}.margin-right-96,.mr-96{margin-right:96px}.margin-bottom-96,.mb-96{margin-bottom:96px}.margin-left-96,.ml-96{margin-left:96px}.margin-horizontal-96,.mh-96{margin-left:96px;margin-right:96px}.margin-vertical-96,.mv-96{margin-top:96px;margin-bottom:96px}.h-0,.height-0{height:0!important;min-height:0!important;max-height:0!important}.w-0,.width-0{width:0!important;min-width:0!important;max-width:0!important}.h-5,.height-5{height:5px!important;min-height:5px!important;max-height:5px!important}.w-5,.width-5{width:5px!important;min-width:5px!important;max-width:5px!important}.h-10,.height-10{height:10px!important;min-height:10px!important;max-height:10px!important}.w-10,.width-10{width:10px!important;min-width:10px!important;max-width:10px!important}.h-15,.height-15{height:15px!important;min-height:15px!important;max-height:15px!important}.w-15,.width-15{width:15px!important;min-width:15px!important;max-width:15px!important}.h-20,.height-20{height:20px!important;min-height:20px!important;max-height:20px!important}.w-20,.width-20{width:20px!important;min-width:20px!important;max-width:20px!important}.h-25,.height-25{height:25px!important;min-height:25px!important;max-height:25px!important}.w-25,.width-25{width:25px!important;min-width:25px!important;max-width:25px!important}.h-30,.height-30{height:30px!important;min-height:30px!important;max-height:30px!important}.w-30,.width-30{width:30px!important;min-width:30px!important;max-width:30px!important}.h-35,.height-35{height:35px!important;min-height:35px!important;max-height:35px!important}.w-35,.width-35{width:35px!important;min-width:35px!important;max-width:35px!important}.h-40,.height-40{height:40px!important;min-height:40px!important;max-height:40px!important}.w-40,.width-40{width:40px!important;min-width:40px!important;max-width:40px!important}.h-45,.height-45{height:45px!important;min-height:45px!important;max-height:45px!important}.w-45,.width-45{width:45px!important;min-width:45px!important;max-width:45px!important}.h-50,.height-50{height:50px!important;min-height:50px!important;max-height:50px!important}.w-50,.width-50{width:50px!important;min-width:50px!important;max-width:50px!important}.h-55,.height-55{height:55px!important;min-height:55px!important;max-height:55px!important}.w-55,.width-55{width:55px!important;min-width:55px!important;max-width:55px!important}.h-60,.height-60{height:60px!important;min-height:60px!important;max-height:60px!important}.w-60,.width-60{width:60px!important;min-width:60px!important;max-width:60px!important}.h-65,.height-65{height:65px!important;min-height:65px!important;max-height:65px!important}.w-65,.width-65{width:65px!important;min-width:65px!important;max-width:65px!important}.h-70,.height-70{height:70px!important;min-height:70px!important;max-height:70px!important}.w-70,.width-70{width:70px!important;min-width:70px!important;max-width:70px!important}.h-75,.height-75{height:75px!important;min-height:75px!important;max-height:75px!important}.w-75,.width-75{width:75px!important;min-width:75px!important;max-width:75px!important}.h-80,.height-80{height:80px!important;min-height:80px!important;max-height:80px!important}.w-80,.width-80{width:80px!important;min-width:80px!important;max-width:80px!important}.h-85,.height-85{height:85px!important;min-height:85px!important;max-height:85px!important}.w-85,.width-85{width:85px!important;min-width:85px!important;max-width:85px!important}.h-90,.height-90{height:90px!important;min-height:90px!important;max-height:90px!important}.w-90,.width-90{width:90px!important;min-width:90px!important;max-width:90px!important}.h-95,.height-95{height:95px!important;min-height:95px!important;max-height:95px!important}.w-95,.width-95{width:95px!important;min-width:95px!important;max-width:95px!important}.h-100,.height-100{height:100px!important;min-height:100px!important;max-height:100px!important}.w-100,.width-100{width:100px!important;min-width:100px!important;max-width:100px!important}.h-105,.height-105{height:105px!important;min-height:105px!important;max-height:105px!important}.w-105,.width-105{width:105px!important;min-width:105px!important;max-width:105px!important}.h-110,.height-110{height:110px!important;min-height:110px!important;max-height:110px!important}.w-110,.width-110{width:110px!important;min-width:110px!important;max-width:110px!important}.h-115,.height-115{height:115px!important;min-height:115px!important;max-height:115px!important}.w-115,.width-115{width:115px!important;min-width:115px!important;max-width:115px!important}.h-120,.height-120{height:120px!important;min-height:120px!important;max-height:120px!important}.w-120,.width-120{width:120px!important;min-width:120px!important;max-width:120px!important}.h-125,.height-125{height:125px!important;min-height:125px!important;max-height:125px!important}.w-125,.width-125{width:125px!important;min-width:125px!important;max-width:125px!important}.h-130,.height-130{height:130px!important;min-height:130px!important;max-height:130px!important}.w-130,.width-130{width:130px!important;min-width:130px!important;max-width:130px!important}.h-135,.height-135{height:135px!important;min-height:135px!important;max-height:135px!important}.w-135,.width-135{width:135px!important;min-width:135px!important;max-width:135px!important}.h-140,.height-140{height:140px!important;min-height:140px!important;max-height:140px!important}.w-140,.width-140{width:140px!important;min-width:140px!important;max-width:140px!important}.h-145,.height-145{height:145px!important;min-height:145px!important;max-height:145px!important}.w-145,.width-145{width:145px!important;min-width:145px!important;max-width:145px!important}.h-150,.height-150{height:150px!important;min-height:150px!important;max-height:150px!important}.w-150,.width-150{width:150px!important;min-width:150px!important;max-width:150px!important}.h-155,.height-155{height:155px!important;min-height:155px!important;max-height:155px!important}.w-155,.width-155{width:155px!important;min-width:155px!important;max-width:155px!important}.h-160,.height-160{height:160px!important;min-height:160px!important;max-height:160px!important}.w-160,.width-160{width:160px!important;min-width:160px!important;max-width:160px!important}.h-165,.height-165{height:165px!important;min-height:165px!important;max-height:165px!important}.w-165,.width-165{width:165px!important;min-width:165px!important;max-width:165px!important}.h-170,.height-170{height:170px!important;min-height:170px!important;max-height:170px!important}.w-170,.width-170{width:170px!important;min-width:170px!important;max-width:170px!important}.h-175,.height-175{height:175px!important;min-height:175px!important;max-height:175px!important}.w-175,.width-175{width:175px!important;min-width:175px!important;max-width:175px!important}.h-180,.height-180{height:180px!important;min-height:180px!important;max-height:180px!important}.w-180,.width-180{width:180px!important;min-width:180px!important;max-width:180px!important}.h-185,.height-185{height:185px!important;min-height:185px!important;max-height:185px!important}.w-185,.width-185{width:185px!important;min-width:185px!important;max-width:185px!important}.h-190,.height-190{height:190px!important;min-height:190px!important;max-height:190px!important}.w-190,.width-190{width:190px!important;min-width:190px!important;max-width:190px!important}.h-195,.height-195{height:195px!important;min-height:195px!important;max-height:195px!important}.w-195,.width-195{width:195px!important;min-width:195px!important;max-width:195px!important}.h-200,.height-200{height:200px!important;min-height:200px!important;max-height:200px!important}.w-200,.width-200{width:200px!important;min-width:200px!important;max-width:200px!important}.h-205,.height-205{height:205px!important;min-height:205px!important;max-height:205px!important}.w-205,.width-205{width:205px!important;min-width:205px!important;max-width:205px!important}.h-210,.height-210{height:210px!important;min-height:210px!important;max-height:210px!important}.w-210,.width-210{width:210px!important;min-width:210px!important;max-width:210px!important}.h-215,.height-215{height:215px!important;min-height:215px!important;max-height:215px!important}.w-215,.width-215{width:215px!important;min-width:215px!important;max-width:215px!important}.h-220,.height-220{height:220px!important;min-height:220px!important;max-height:220px!important}.w-220,.width-220{width:220px!important;min-width:220px!important;max-width:220px!important}.h-225,.height-225{height:225px!important;min-height:225px!important;max-height:225px!important}.w-225,.width-225{width:225px!important;min-width:225px!important;max-width:225px!important}.h-230,.height-230{height:230px!important;min-height:230px!important;max-height:230px!important}.w-230,.width-230{width:230px!important;min-width:230px!important;max-width:230px!important}.h-235,.height-235{height:235px!important;min-height:235px!important;max-height:235px!important}.w-235,.width-235{width:235px!important;min-width:235px!important;max-width:235px!important}.h-240,.height-240{height:240px!important;min-height:240px!important;max-height:240px!important}.w-240,.width-240{width:240px!important;min-width:240px!important;max-width:240px!important}.h-245,.height-245{height:245px!important;min-height:245px!important;max-height:245px!important}.w-245,.width-245{width:245px!important;min-width:245px!important;max-width:245px!important}.h-250,.height-250{height:250px!important;min-height:250px!important;max-height:250px!important}.w-250,.width-250{width:250px!important;min-width:250px!important;max-width:250px!important}.h-255,.height-255{height:255px!important;min-height:255px!important;max-height:255px!important}.w-255,.width-255{width:255px!important;min-width:255px!important;max-width:255px!important}.h-260,.height-260{height:260px!important;min-height:260px!important;max-height:260px!important}.w-260,.width-260{width:260px!important;min-width:260px!important;max-width:260px!important}.h-265,.height-265{height:265px!important;min-height:265px!important;max-height:265px!important}.w-265,.width-265{width:265px!important;min-width:265px!important;max-width:265px!important}.h-270,.height-270{height:270px!important;min-height:270px!important;max-height:270px!important}.w-270,.width-270{width:270px!important;min-width:270px!important;max-width:270px!important}.h-275,.height-275{height:275px!important;min-height:275px!important;max-height:275px!important}.w-275,.width-275{width:275px!important;min-width:275px!important;max-width:275px!important}.h-280,.height-280{height:280px!important;min-height:280px!important;max-height:280px!important}.w-280,.width-280{width:280px!important;min-width:280px!important;max-width:280px!important}.h-285,.height-285{height:285px!important;min-height:285px!important;max-height:285px!important}.w-285,.width-285{width:285px!important;min-width:285px!important;max-width:285px!important}.h-290,.height-290{height:290px!important;min-height:290px!important;max-height:290px!important}.w-290,.width-290{width:290px!important;min-width:290px!important;max-width:290px!important}.h-295,.height-295{height:295px!important;min-height:295px!important;max-height:295px!important}.w-295,.width-295{width:295px!important;min-width:295px!important;max-width:295px!important}.h-300,.height-300{height:300px!important;min-height:300px!important;max-height:300px!important}.w-300,.width-300{width:300px!important;min-width:300px!important;max-width:300px!important}.h-305,.height-305{height:305px!important;min-height:305px!important;max-height:305px!important}.w-305,.width-305{width:305px!important;min-width:305px!important;max-width:305px!important}.h-310,.height-310{height:310px!important;min-height:310px!important;max-height:310px!important}.w-310,.width-310{width:310px!important;min-width:310px!important;max-width:310px!important}.h-315,.height-315{height:315px!important;min-height:315px!important;max-height:315px!important}.w-315,.width-315{width:315px!important;min-width:315px!important;max-width:315px!important}.h-320,.height-320{height:320px!important;min-height:320px!important;max-height:320px!important}.w-320,.width-320{width:320px!important;min-width:320px!important;max-width:320px!important}.h-325,.height-325{height:325px!important;min-height:325px!important;max-height:325px!important}.w-325,.width-325{width:325px!important;min-width:325px!important;max-width:325px!important}.h-330,.height-330{height:330px!important;min-height:330px!important;max-height:330px!important}.w-330,.width-330{width:330px!important;min-width:330px!important;max-width:330px!important}.h-335,.height-335{height:335px!important;min-height:335px!important;max-height:335px!important}.w-335,.width-335{width:335px!important;min-width:335px!important;max-width:335px!important}.h-340,.height-340{height:340px!important;min-height:340px!important;max-height:340px!important}.w-340,.width-340{width:340px!important;min-width:340px!important;max-width:340px!important}.h-345,.height-345{height:345px!important;min-height:345px!important;max-height:345px!important}.w-345,.width-345{width:345px!important;min-width:345px!important;max-width:345px!important}.h-350,.height-350{height:350px!important;min-height:350px!important;max-height:350px!important}.w-350,.width-350{width:350px!important;min-width:350px!important;max-width:350px!important}.h-355,.height-355{height:355px!important;min-height:355px!important;max-height:355px!important}.w-355,.width-355{width:355px!important;min-width:355px!important;max-width:355px!important}.h-360,.height-360{height:360px!important;min-height:360px!important;max-height:360px!important}.w-360,.width-360{width:360px!important;min-width:360px!important;max-width:360px!important}.h-365,.height-365{height:365px!important;min-height:365px!important;max-height:365px!important}.w-365,.width-365{width:365px!important;min-width:365px!important;max-width:365px!important}.h-370,.height-370{height:370px!important;min-height:370px!important;max-height:370px!important}.w-370,.width-370{width:370px!important;min-width:370px!important;max-width:370px!important}.h-375,.height-375{height:375px!important;min-height:375px!important;max-height:375px!important}.w-375,.width-375{width:375px!important;min-width:375px!important;max-width:375px!important}.h-380,.height-380{height:380px!important;min-height:380px!important;max-height:380px!important}.w-380,.width-380{width:380px!important;min-width:380px!important;max-width:380px!important}.h-385,.height-385{height:385px!important;min-height:385px!important;max-height:385px!important}.w-385,.width-385{width:385px!important;min-width:385px!important;max-width:385px!important}.h-390,.height-390{height:390px!important;min-height:390px!important;max-height:390px!important}.w-390,.width-390{width:390px!important;min-width:390px!important;max-width:390px!important}.h-395,.height-395{height:395px!important;min-height:395px!important;max-height:395px!important}.w-395,.width-395{width:395px!important;min-width:395px!important;max-width:395px!important}.h-400,.height-400{height:400px!important;min-height:400px!important;max-height:400px!important}.w-400,.width-400{width:400px!important;min-width:400px!important;max-width:400px!important}.h-405,.height-405{height:405px!important;min-height:405px!important;max-height:405px!important}.w-405,.width-405{width:405px!important;min-width:405px!important;max-width:405px!important}.h-410,.height-410{height:410px!important;min-height:410px!important;max-height:410px!important}.w-410,.width-410{width:410px!important;min-width:410px!important;max-width:410px!important}.h-415,.height-415{height:415px!important;min-height:415px!important;max-height:415px!important}.w-415,.width-415{width:415px!important;min-width:415px!important;max-width:415px!important}.h-420,.height-420{height:420px!important;min-height:420px!important;max-height:420px!important}.w-420,.width-420{width:420px!important;min-width:420px!important;max-width:420px!important}.h-425,.height-425{height:425px!important;min-height:425px!important;max-height:425px!important}.w-425,.width-425{width:425px!important;min-width:425px!important;max-width:425px!important}.h-430,.height-430{height:430px!important;min-height:430px!important;max-height:430px!important}.w-430,.width-430{width:430px!important;min-width:430px!important;max-width:430px!important}.h-435,.height-435{height:435px!important;min-height:435px!important;max-height:435px!important}.w-435,.width-435{width:435px!important;min-width:435px!important;max-width:435px!important}.h-440,.height-440{height:440px!important;min-height:440px!important;max-height:440px!important}.w-440,.width-440{width:440px!important;min-width:440px!important;max-width:440px!important}.h-445,.height-445{height:445px!important;min-height:445px!important;max-height:445px!important}.w-445,.width-445{width:445px!important;min-width:445px!important;max-width:445px!important}.h-450,.height-450{height:450px!important;min-height:450px!important;max-height:450px!important}.w-450,.width-450{width:450px!important;min-width:450px!important;max-width:450px!important}.h-455,.height-455{height:455px!important;min-height:455px!important;max-height:455px!important}.w-455,.width-455{width:455px!important;min-width:455px!important;max-width:455px!important}.h-460,.height-460{height:460px!important;min-height:460px!important;max-height:460px!important}.w-460,.width-460{width:460px!important;min-width:460px!important;max-width:460px!important}.h-465,.height-465{height:465px!important;min-height:465px!important;max-height:465px!important}.w-465,.width-465{width:465px!important;min-width:465px!important;max-width:465px!important}.h-470,.height-470{height:470px!important;min-height:470px!important;max-height:470px!important}.w-470,.width-470{width:470px!important;min-width:470px!important;max-width:470px!important}.h-475,.height-475{height:475px!important;min-height:475px!important;max-height:475px!important}.w-475,.width-475{width:475px!important;min-width:475px!important;max-width:475px!important}.h-480,.height-480{height:480px!important;min-height:480px!important;max-height:480px!important}.w-480,.width-480{width:480px!important;min-width:480px!important;max-width:480px!important}.h-485,.height-485{height:485px!important;min-height:485px!important;max-height:485px!important}.w-485,.width-485{width:485px!important;min-width:485px!important;max-width:485px!important}.h-490,.height-490{height:490px!important;min-height:490px!important;max-height:490px!important}.w-490,.width-490{width:490px!important;min-width:490px!important;max-width:490px!important}.h-495,.height-495{height:495px!important;min-height:495px!important;max-height:495px!important}.w-495,.width-495{width:495px!important;min-width:495px!important;max-width:495px!important}.h-500,.height-500{height:500px!important;min-height:500px!important;max-height:500px!important}.w-500,.width-500{width:500px!important;min-width:500px!important;max-width:500px!important}.h-8,.height-8{height:8px!important;min-height:8px!important;max-height:8px!important}.w-8,.width-8{width:8px!important;min-width:8px!important;max-width:8px!important}.h-16,.height-16{height:16px!important;min-height:16px!important;max-height:16px!important}.w-16,.width-16{width:16px!important;min-width:16px!important;max-width:16px!important}.h-24,.height-24{height:24px!important;min-height:24px!important;max-height:24px!important}.w-24,.width-24{width:24px!important;min-width:24px!important;max-width:24px!important}.h-32,.height-32{height:32px!important;min-height:32px!important;max-height:32px!important}.w-32,.width-32{width:32px!important;min-width:32px!important;max-width:32px!important}.h-48,.height-48{height:48px!important;min-height:48px!important;max-height:48px!important}.w-48,.width-48{width:48px!important;min-width:48px!important;max-width:48px!important}.h-56,.height-56{height:56px!important;min-height:56px!important;max-height:56px!important}.w-56,.width-56{width:56px!important;min-width:56px!important;max-width:56px!important}.h-64,.height-64{height:64px!important;min-height:64px!important;max-height:64px!important}.w-64,.width-64{width:64px!important;min-width:64px!important;max-width:64px!important}.h-72,.height-72{height:72px!important;min-height:72px!important;max-height:72px!important}.w-72,.width-72{width:72px!important;min-width:72px!important;max-width:72px!important}.h-88,.height-88{height:88px!important;min-height:88px!important;max-height:88px!important}.w-88,.width-88{width:88px!important;min-width:88px!important;max-width:88px!important}.h-96,.height-96{height:96px!important;min-height:96px!important;max-height:96px!important}.w-96,.width-96{width:96px!important;min-width:96px!important;max-width:96px!important}.h-104,.height-104{height:104px!important;min-height:104px!important;max-height:104px!important}.w-104,.width-104{width:104px!important;min-width:104px!important;max-width:104px!important}.h-112,.height-112{height:112px!important;min-height:112px!important;max-height:112px!important}.w-112,.width-112{width:112px!important;min-width:112px!important;max-width:112px!important}.h-128,.height-128{height:128px!important;min-height:128px!important;max-height:128px!important}.w-128,.width-128{width:128px!important;min-width:128px!important;max-width:128px!important}.h-136,.height-136{height:136px!important;min-height:136px!important;max-height:136px!important}.w-136,.width-136{width:136px!important;min-width:136px!important;max-width:136px!important}.h-144,.height-144{height:144px!important;min-height:144px!important;max-height:144px!important}.w-144,.width-144{width:144px!important;min-width:144px!important;max-width:144px!important}.h-152,.height-152{height:152px!important;min-height:152px!important;max-height:152px!important}.w-152,.width-152{width:152px!important;min-width:152px!important;max-width:152px!important}.h-168,.height-168{height:168px!important;min-height:168px!important;max-height:168px!important}.w-168,.width-168{width:168px!important;min-width:168px!important;max-width:168px!important}.h-176,.height-176{height:176px!important;min-height:176px!important;max-height:176px!important}.w-176,.width-176{width:176px!important;min-width:176px!important;max-width:176px!important}.h-184,.height-184{height:184px!important;min-height:184px!important;max-height:184px!important}.w-184,.width-184{width:184px!important;min-width:184px!important;max-width:184px!important}.h-192,.height-192{height:192px!important;min-height:192px!important;max-height:192px!important}.w-192,.width-192{width:192px!important;min-width:192px!important;max-width:192px!important}.h-208,.height-208{height:208px!important;min-height:208px!important;max-height:208px!important}.w-208,.width-208{width:208px!important;min-width:208px!important;max-width:208px!important}.h-216,.height-216{height:216px!important;min-height:216px!important;max-height:216px!important}.w-216,.width-216{width:216px!important;min-width:216px!important;max-width:216px!important}.h-224,.height-224{height:224px!important;min-height:224px!important;max-height:224px!important}.w-224,.width-224{width:224px!important;min-width:224px!important;max-width:224px!important}.h-232,.height-232{height:232px!important;min-height:232px!important;max-height:232px!important}.w-232,.width-232{width:232px!important;min-width:232px!important;max-width:232px!important}.h-248,.height-248{height:248px!important;min-height:248px!important;max-height:248px!important}.w-248,.width-248{width:248px!important;min-width:248px!important;max-width:248px!important}.h-256,.height-256{height:256px!important;min-height:256px!important;max-height:256px!important}.w-256,.width-256{width:256px!important;min-width:256px!important;max-width:256px!important}.h-264,.height-264{height:264px!important;min-height:264px!important;max-height:264px!important}.w-264,.width-264{width:264px!important;min-width:264px!important;max-width:264px!important}.h-272,.height-272{height:272px!important;min-height:272px!important;max-height:272px!important}.w-272,.width-272{width:272px!important;min-width:272px!important;max-width:272px!important}.h-288,.height-288{height:288px!important;min-height:288px!important;max-height:288px!important}.w-288,.width-288{width:288px!important;min-width:288px!important;max-width:288px!important}.h-296,.height-296{height:296px!important;min-height:296px!important;max-height:296px!important}.w-296,.width-296{width:296px!important;min-width:296px!important;max-width:296px!important}.h-304,.height-304{height:304px!important;min-height:304px!important;max-height:304px!important}.w-304,.width-304{width:304px!important;min-width:304px!important;max-width:304px!important}.h-312,.height-312{height:312px!important;min-height:312px!important;max-height:312px!important}.w-312,.width-312{width:312px!important;min-width:312px!important;max-width:312px!important}.h-328,.height-328{height:328px!important;min-height:328px!important;max-height:328px!important}.w-328,.width-328{width:328px!important;min-width:328px!important;max-width:328px!important}.h-336,.height-336{height:336px!important;min-height:336px!important;max-height:336px!important}.w-336,.width-336{width:336px!important;min-width:336px!important;max-width:336px!important}.h-344,.height-344{height:344px!important;min-height:344px!important;max-height:344px!important}.w-344,.width-344{width:344px!important;min-width:344px!important;max-width:344px!important}.h-352,.height-352{height:352px!important;min-height:352px!important;max-height:352px!important}.w-352,.width-352{width:352px!important;min-width:352px!important;max-width:352px!important}.h-368,.height-368{height:368px!important;min-height:368px!important;max-height:368px!important}.w-368,.width-368{width:368px!important;min-width:368px!important;max-width:368px!important}.h-376,.height-376{height:376px!important;min-height:376px!important;max-height:376px!important}.w-376,.width-376{width:376px!important;min-width:376px!important;max-width:376px!important}.h-384,.height-384{height:384px!important;min-height:384px!important;max-height:384px!important}.w-384,.width-384{width:384px!important;min-width:384px!important;max-width:384px!important}.h-392,.height-392{height:392px!important;min-height:392px!important;max-height:392px!important}.w-392,.width-392{width:392px!important;min-width:392px!important;max-width:392px!important}.h-408,.height-408{height:408px!important;min-height:408px!important;max-height:408px!important}.w-408,.width-408{width:408px!important;min-width:408px!important;max-width:408px!important}.h-416,.height-416{height:416px!important;min-height:416px!important;max-height:416px!important}.w-416,.width-416{width:416px!important;min-width:416px!important;max-width:416px!important}.h-424,.height-424{height:424px!important;min-height:424px!important;max-height:424px!important}.w-424,.width-424{width:424px!important;min-width:424px!important;max-width:424px!important}.h-432,.height-432{height:432px!important;min-height:432px!important;max-height:432px!important}.w-432,.width-432{width:432px!important;min-width:432px!important;max-width:432px!important}.h-448,.height-448{height:448px!important;min-height:448px!important;max-height:448px!important}.w-448,.width-448{width:448px!important;min-width:448px!important;max-width:448px!important}.h-456,.height-456{height:456px!important;min-height:456px!important;max-height:456px!important}.w-456,.width-456{width:456px!important;min-width:456px!important;max-width:456px!important}.h-464,.height-464{height:464px!important;min-height:464px!important;max-height:464px!important}.w-464,.width-464{width:464px!important;min-width:464px!important;max-width:464px!important}.h-472,.height-472{height:472px!important;min-height:472px!important;max-height:472px!important}.w-472,.width-472{width:472px!important;min-width:472px!important;max-width:472px!important}.h-488,.height-488{height:488px!important;min-height:488px!important;max-height:488px!important}.w-488,.width-488{width:488px!important;min-width:488px!important;max-width:488px!important}.h-496,.height-496{height:496px!important;min-height:496px!important;max-height:496px!important}.w-496,.width-496{width:496px!important;min-width:496px!important;max-width:496px!important}.h-504,.height-504{height:504px!important;min-height:504px!important;max-height:504px!important}.w-504,.width-504{width:504px!important;min-width:504px!important;max-width:504px!important}.h-512,.height-512{height:512px!important;min-height:512px!important;max-height:512px!important}.w-512,.width-512{width:512px!important;min-width:512px!important;max-width:512px!important}.h-528,.height-528{height:528px!important;min-height:528px!important;max-height:528px!important}.w-528,.width-528{width:528px!important;min-width:528px!important;max-width:528px!important}.h-536,.height-536{height:536px!important;min-height:536px!important;max-height:536px!important}.w-536,.width-536{width:536px!important;min-width:536px!important;max-width:536px!important}.h-544,.height-544{height:544px!important;min-height:544px!important;max-height:544px!important}.w-544,.width-544{width:544px!important;min-width:544px!important;max-width:544px!important}.h-552,.height-552{height:552px!important;min-height:552px!important;max-height:552px!important}.w-552,.width-552{width:552px!important;min-width:552px!important;max-width:552px!important}.h-568,.height-568{height:568px!important;min-height:568px!important;max-height:568px!important}.w-568,.width-568{width:568px!important;min-width:568px!important;max-width:568px!important}.h-576,.height-576{height:576px!important;min-height:576px!important;max-height:576px!important}.w-576,.width-576{width:576px!important;min-width:576px!important;max-width:576px!important}.h-584,.height-584{height:584px!important;min-height:584px!important;max-height:584px!important}.w-584,.width-584{width:584px!important;min-width:584px!important;max-width:584px!important}.h-592,.height-592{height:592px!important;min-height:592px!important;max-height:592px!important}.w-592,.width-592{width:592px!important;min-width:592px!important;max-width:592px!important}.h-608,.height-608{height:608px!important;min-height:608px!important;max-height:608px!important}.w-608,.width-608{width:608px!important;min-width:608px!important;max-width:608px!important}.h-616,.height-616{height:616px!important;min-height:616px!important;max-height:616px!important}.w-616,.width-616{width:616px!important;min-width:616px!important;max-width:616px!important}.h-624,.height-624{height:624px!important;min-height:624px!important;max-height:624px!important}.w-624,.width-624{width:624px!important;min-width:624px!important;max-width:624px!important}.h-632,.height-632{height:632px!important;min-height:632px!important;max-height:632px!important}.w-632,.width-632{width:632px!important;min-width:632px!important;max-width:632px!important}.h-648,.height-648{height:648px!important;min-height:648px!important;max-height:648px!important}.w-648,.width-648{width:648px!important;min-width:648px!important;max-width:648px!important}.h-656,.height-656{height:656px!important;min-height:656px!important;max-height:656px!important}.w-656,.width-656{width:656px!important;min-width:656px!important;max-width:656px!important}.h-664,.height-664{height:664px!important;min-height:664px!important;max-height:664px!important}.w-664,.width-664{width:664px!important;min-width:664px!important;max-width:664px!important}.h-672,.height-672{height:672px!important;min-height:672px!important;max-height:672px!important}.w-672,.width-672{width:672px!important;min-width:672px!important;max-width:672px!important}.h-688,.height-688{height:688px!important;min-height:688px!important;max-height:688px!important}.w-688,.width-688{width:688px!important;min-width:688px!important;max-width:688px!important}.h-696,.height-696{height:696px!important;min-height:696px!important;max-height:696px!important}.w-696,.width-696{width:696px!important;min-width:696px!important;max-width:696px!important}.h-704,.height-704{height:704px!important;min-height:704px!important;max-height:704px!important}.w-704,.width-704{width:704px!important;min-width:704px!important;max-width:704px!important}.h-712,.height-712{height:712px!important;min-height:712px!important;max-height:712px!important}.w-712,.width-712{width:712px!important;min-width:712px!important;max-width:712px!important}.h-728,.height-728{height:728px!important;min-height:728px!important;max-height:728px!important}.w-728,.width-728{width:728px!important;min-width:728px!important;max-width:728px!important}.h-736,.height-736{height:736px!important;min-height:736px!important;max-height:736px!important}.w-736,.width-736{width:736px!important;min-width:736px!important;max-width:736px!important}.h-744,.height-744{height:744px!important;min-height:744px!important;max-height:744px!important}.w-744,.width-744{width:744px!important;min-width:744px!important;max-width:744px!important}.h-752,.height-752{height:752px!important;min-height:752px!important;max-height:752px!important}.w-752,.width-752{width:752px!important;min-width:752px!important;max-width:752px!important}.h-768,.height-768{height:768px!important;min-height:768px!important;max-height:768px!important}.w-768,.width-768{width:768px!important;min-width:768px!important;max-width:768px!important}.h-776,.height-776{height:776px!important;min-height:776px!important;max-height:776px!important}.w-776,.width-776{width:776px!important;min-width:776px!important;max-width:776px!important}.h-784,.height-784{height:784px!important;min-height:784px!important;max-height:784px!important}.w-784,.width-784{width:784px!important;min-width:784px!important;max-width:784px!important}.h-792,.height-792{height:792px!important;min-height:792px!important;max-height:792px!important}.w-792,.width-792{width:792px!important;min-width:792px!important;max-width:792px!important}.b,.border{border:1px solid rgba(0,0,0,.12)}.border-top,.bt{border-top:1px solid rgba(0,0,0,.12)}.border-right,.br{border-right:1px solid rgba(0,0,0,.12)}.bb,.border-bottom{border-bottom:1px solid rgba(0,0,0,.12)}.bl,.border-left{border-left:1px solid rgba(0,0,0,.12)}.bh,.border-horizontal{border-left:1px solid rgba(0,0,0,.12);border-right:1px solid rgba(0,0,0,.12)}.border-vertical,.bv{border-top:1px solid rgba(0,0,0,.12);border-bottom:1px solid rgba(0,0,0,.12)}.brad-1{border-radius:1px}.brad-2{border-radius:2px}.brad-3{border-radius:3px}.brad-4{border-radius:4px}.brad-5{border-radius:5px}.brad-6{border-radius:6px}.brad-7{border-radius:7px}.brad-8{border-radius:8px}.brad-9{border-radius:9px}.brad-10{border-radius:10px}.brad-11{border-radius:11px}.brad-12{border-radius:12px}@media all{.page-break{display:none}}@media print{.page-break{display:block;break-after:always;page-break-after:always}#main #vertical-navigation{display:none}#main #toolbar{display:none}#main #quick-panel{display:none}#main #content{position:relative!important;top:0!important;right:0!important;bottom:0!important;left:0!important;background:0 0!important}ms-theme-options{display:none}.ps-scrollbar-x-rail,.ps-scrollbar-y-rail{display:none!important}.printable{overflow:visible!important}.printable .template-layout{display:inline!important}}.advanced-search-container{border-bottom:1px rgba(0,0,0,.12) solid}.advanced-search-conditions{border-bottom:1px rgba(0,0,0,.12) solid;padding:4px 0}.advanced-search-conditions .errors{font-size:12px;color:#dd2c00;margin-top:10px}.advanced-search-conditions .advanced-search-chips md-chips-wrap{box-shadow:none}.advanced-search-conditions .advanced-search-chips md-chip{position:relative}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-content md-chip-template span p.filter-text{display:inline-block;margin:0}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container{position:absolute;right:4px;top:4px;margin-right:0;height:24px}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container button.remove-filter{position:relative;height:24px;width:24px;line-height:30px;text-align:center;border-radius:50%;border:none;box-shadow:none;padding:0;margin:0;transition:background .15s linear;display:block}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container button.remove-filter md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%,-50%,0);color:#616161}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container button.remove-filter md-icon:focus,.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container button.remove-filter md-icon:hover{color:rgba(255,0,0,.8)}.advanced-search-conditions .advanced-search-chips md-chips-wrap.md-removable md-chip md-chip-template{padding-right:5px}.advanced-search-bar{padding:10px 0}.advanced-search-bar md-input-container.no-errors{font-size:12px;transition:0s none;-webkit-transition:0s none;animation:0s none;-webkit-animation:0s none}.advanced-search-bar md-input-container.no-errors input{font-family:Arial Unicode MS,Arial,Helvetica}.advanced-search-bar md-input-container.no-errors .md-errors-spacer{min-height:0}md-option div div.operators-list{display:table}md-option div div.operators-list span{display:table-cell}md-option div div.operators-list span.operator-symbol{display:table-cell;font-size:14px;width:30px}.advanced-search-bar mdp-date-picker button{margin:0!important}.advanced-search-bar mdp-date-picker md-input-container{flex:1;margin:0}.advanced-search-bar mdp-date-picker md-input-container label{font-size:12px}.advanced-search-bar mdp-date-picker md-input-container .md-errors-spacer{min-height:0}.advanced-search-bar div md-date-range{font-size:12px;margin-left:10px}.advanced-search-bar div.autocomplete-input md-icon{margin:8px 8px 8px 0}.advanced-search-bar div.autocomplete-input md-autocomplete{font-size:12px!important}.advanced-search-bar div.autocomplete-input md-autocomplete md-autocomplete-wrap{height:0}.advanced-search-bar div.autocomplete-input md-autocomplete md-autocomplete-wrap md-input-container{margin:0}.advanced-search-bar div.autocomplete-input md-autocomplete md-autocomplete-wrap md-input-container input[type=search]{padding:0!important}.advanced-search-bar div.autocomplete-input md-autocomplete md-autocomplete-wrap md-input-container div.md-errors-spacer{min-height:0}md-toolbar.advanced-search-dialog-header{background-image:url(/assets/images/backgrounds/header-bg.png);background-position:top}.md-autocomplete-suggestions-container li .highlight,.md-autocomplete-suggestions-container.md-default-theme li .highlight{color:#ca1d1d;font-weight:700}.chip-disabled{opacity:.4}.ms-card{display:flex;flex-direction:row;padding:8px}.ms-card .ms-card-content-wrapper{position:relative;overflow:hidden;width:100%;max-width:400px;border-radius:2px;background:#fff;box-shadow:0 3px 1px -2px rgba(0,0,0,.14),0 2px 2px 0 rgba(0,0,0,.098),0 1px 5px 0 rgba(0,0,0,.084)}.ms-card .template-1 .media .image{width:100%;border-radius:2px 2px 0 0}.ms-card .template-10 .media{width:80px;min-width:80px;max-width:80px}.ms-card .template-2 .header .avatar .image{display:block;width:40px;height:40px;border-radius:20px}.ms-card .template-2 .media .image{width:100%}.ms-card .template-4 .info{position:absolute;right:0;bottom:0;left:0;z-index:2;background:rgba(0,0,0,.54)}.ms-card .template-4 .media{z-index:1}.ms-card .template-4 .media .image{width:100%}.ms-card .template-5 .media{width:80px;min-width:80px;max-width:80px}.ms-card .template-5 .info,.ms-card .template-5 .media{-ms-flex:0 1 auto}.ms-card .template-8 .media .image{width:100%;border-radius:2px 2px 0 0}.ms-card .template-9 .header .avatar .image{display:block;width:40px;height:40px;border-radius:20px}.ms-card .template-9 .media .image{width:100%}md-tooltip.client-side-logging-tooltip div.md-content{height:auto;max-width:200px;white-space:normal;text-align:center}md-list-item .md-list-item-text p.ms-dual-multiselect-line-xs{font-size:10px!important;padding-top:5px}md-list-item md-icon.hidden{visibility:hidden}md-icon.add-disabled{cursor:default!important;opacity:.4}md-list-item.read-only-mode{cursor:none!important}.ms-form-wizard{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-form-wizard md-tabs md-tabs-wrapper{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas{height:72px}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper{height:72px}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item{opacity:1!important;padding:24px}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item:before{content:'';display:block;position:absolute;top:50%;left:0;right:50%;border-bottom:1px solid rgba(0,0,0,.12);z-index:8}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item:after{content:'';display:block;position:absolute;top:50%;left:50%;right:0;border-bottom:1px solid rgba(0,0,0,.12);z-index:8}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item:first-of-type:before{display:none}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item:last-of-type:after{display:none}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item.md-disabled .ms-form-wizard-step-label .ms-form-wizard-step-number{background:rgba(0,0,0,.12)!important}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item .md-ripple-container{z-index:11}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-ink-bar{display:none!important}.ms-form-wizard .ms-form-wizard-step-label{display:inline-block;position:relative;background:#fff;z-index:10;padding:0 16px;line-height:24px}.ms-form-wizard .ms-form-wizard-step-label .ms-form-wizard-step-number{display:inline-block;vertical-align:middle;width:24px;height:24px;line-height:24px;font-size:14px;margin-right:12px;border-radius:50%;color:#fff!important}.ms-form-wizard .ms-form-wizard-step-label .ms-form-wizard-step-number i{line-height:24px!important}.ms-form-wizard .ms-form-wizard-step-label .ms-form-wizard-step-text{display:inline-block;vertical-align:middle;position:relative;line-height:24px}.ms-form-wizard .ms-form-wizard-form{padding:24px 16px}.ms-form-wizard .navigation{padding:16px}.ms-form-wizard .navigation .steps{display:flex;align-items:center;justify-content:center;padding:0 16px}.ms-form-wizard .navigation .steps span{width:5px;height:5px;margin:0 4px;border-radius:50%}.ms-form-wizard .navigation .steps span:not(.md-accent-bg){background:rgba(0,0,0,.12)}.ms-form-wizard .navigation .steps span.selected{width:8px;height:8px}ms-info-bar{display:block;position:relative;width:100%;height:44px;background-color:#e91e63;z-index:99998;box-shadow:0 1px 5px 0 rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12)}ms-info-bar #ms-info-bar-message{padding:8px 16px;line-height:28px;font-size:14px}ms-info-bar #ms-info-bar-message a{overflow:hidden;height:48px;color:#fff}ms-masonry{width:100%;display:block}ms-masonry [ms-masonry-item],ms-masonry ms-masonry-item{transition:transform .3s ease;position:absolute;transform:translate3d(50vw,100vh,0)}ms-material-color-picker md-menu .md-button{font-size:12px}md-menu-content.ms-material-color-picker-menu-content{width:208px;max-width:208px;min-width:208px;padding:0;overflow:hidden}md-menu-content.ms-material-color-picker-menu-content header{height:48px;text-transform:uppercase}md-menu-content.ms-material-color-picker-menu-content header .md-button{display:flex;margin:0}md-menu-content.ms-material-color-picker-menu-content header>span{line-height:13px}md-menu-content.ms-material-color-picker-menu-content .colors{position:relative;width:208px;min-height:258px;height:258px;padding:4px}md-menu-content.ms-material-color-picker-menu-content .colors .color{position:relative;width:46px;height:46px;margin:2px;border-radius:0;cursor:pointer}md-menu-content.ms-material-color-picker-menu-content .colors .color .label{padding:2px;font-size:10px}md-menu-content.ms-material-color-picker-menu-content .colors .color .icon-check{position:absolute;top:2px;right:2px;font-size:16px;opacity:.7}ms-nav{display:block;position:relative;color:rgba(255,255,255,.7);user-select:none;z-index:70}ms-nav ms-nav-item{display:block;position:relative;line-height:48px}ms-nav ms-nav-item.ms-nav-title{line-height:32px;font-size:12px;font-weight:500;margin-top:8px;padding:0 24px;width:100%;color:rgba(255,255,255,.3);text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}ms-nav ms-nav-item .ms-nav-button{display:flex;align-self:flex-start;align-items:center;position:relative;cursor:pointer;padding:0 48px 0 24px;color:rgba(255,255,255,.7);text-decoration:none}ms-nav ms-nav-item .ms-nav-button:not(.active):hover{background:rgba(0,0,0,.1);text-decoration:none}ms-nav ms-nav-item .ms-nav-button .ms-nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s ease-in-out .1s}ms-nav ms-nav-item .ms-nav-button .arrow{position:absolute;top:16px;right:24px;margin:0;transition:transform .3s ease-in-out,opacity .2s ease-in-out .1s}ms-nav ms-nav-item .ms-nav-button .ms-nav-badge{position:absolute;top:50%;right:24px;min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transform:translateY(-50%);transition:opacity .2s ease-in-out .1s}ms-nav ms-nav-item .ms-nav-button.active{color:#fff!important}ms-nav ms-nav-item .ms-nav-button.active .ms-nav-badge{background:#fff!important;color:rgba(0,0,0,.87)!important}ms-nav ms-nav-item .ms-nav-button.active i{color:#fff}ms-nav ms-nav-item i{color:rgba(255,255,255,.7);margin:0 16px 0 0}ms-nav .ms-nav-toggle ms-nav-toggle-items{display:none;overflow:hidden}ms-nav .ms-nav-toggle ms-nav-toggle-items.expand-animation{transition:height .35s cubic-bezier(.25,.46,.45,.94)}ms-nav .ms-nav-toggle ms-nav-toggle-items.collapse-animation{transition:height .35s cubic-bezier(.25,.46,.45,.94)}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:58px}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:68px}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:78px}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:88px}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:98px}ms-nav .ms-nav-toggle.active>.ms-nav-button{color:#fff}ms-nav .ms-nav-toggle.active>.ms-nav-button a,ms-nav .ms-nav-toggle.active>.ms-nav-button md-icon{color:#fff}ms-nav .ms-nav-toggle[collapsed=false]>.ms-nav-button>.arrow{transform:rotate(90deg)}ms-nav>.ms-nav-toggle[collapsed=false]{background-color:rgba(0,0,0,.12)}@media only screen and (min-width:1280px){.ms-nav-folded #ms-nav-fold-close-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:0 0;z-index:998}.ms-nav-folded #ms-nav-fold-open-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item.ms-nav-title{height:32px}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item.ms-nav-title:before{content:'';display:block;position:relative;top:12px;width:16px;border-top:1px solid rgba(255,255,255,.12)}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item.ms-nav-title span{display:none}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item .ms-nav-button{height:48px}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item .ms-nav-button>.arrow,.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item .ms-nav-button>.ms-nav-badge,.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item .ms-nav-button>.ms-nav-label{opacity:0;visibility:hidden}}.ms-navigation{display:block;position:relative;color:rgba(255,255,255,.7);user-select:none}.ms-navigation li,.ms-navigation ul{padding:0;margin:0}.ms-navigation ul{display:block;overflow:hidden}.ms-navigation ul li{position:relative}.ms-navigation ul li.collapsed ul{display:none}.ms-navigation .animate-height{transition:height .25s cubic-bezier(.25,.46,.45,.94)}.ms-navigation .ms-navigation-node .ms-navigation-item{display:block;position:relative;cursor:pointer;color:rgba(255,255,255,.7)}.ms-navigation .ms-navigation-node .ms-navigation-item:hover{background:rgba(0,0,0,.1)}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button{display:flex;position:relative;width:100%;height:48px;line-height:48px;flex-direction:row;justify-content:flex-start;align-items:center;padding-right:16px;color:rgba(255,255,255,.7);text-decoration:none;white-space:nowrap;overflow:hidden}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button .icon{color:rgba(255,255,255,.7);margin:0 16px 0 0}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button span{white-space:nowrap;overflow:hidden;opacity:1;transition:opacity .25s ease-in-out .1s}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button a{white-space:nowrap;overflow:hidden;opacity:1;transition:opacity .25s ease-in-out .1s}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button .arrow{margin:0;opacity:1;transition:transform .3s ease-in-out,opacity .25s ease-in-out .1s}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button .badge{position:absolute;top:50%;right:16px;min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transform:translateY(-50%);transition:opacity .2s ease-in-out .1s}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button.active{color:#fff}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button.active .icon{color:#fff}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button.active .badge{background:#fff!important;color:rgba(0,0,0,.87)!important}.ms-navigation .ms-navigation-node:not(.collapsed)>.ms-navigation-item>.ms-navigation-button .arrow{transform:rotate(90deg)}.ms-navigation .ms-navigation-node.group>.ms-navigation-item{font-size:12px;font-weight:500;margin-top:8px;cursor:auto;background:0 0!important;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-navigation .ms-navigation-node.group>.ms-navigation-item>.ms-navigation-button{height:32px;line-height:32px;color:rgba(255,255,255,.3)}.ms-navigation .ms-navigation-node:not(.group).has-children:not(.collapsed){background-color:rgba(0,0,0,.12)}.ms-navigation .ms-navigation-node:not(.group).has-children.collapsing{background-color:rgba(0,0,0,.12)}.ms-navigation .ms-navigation-node:not(.group).has-children .has-children:not(.collapsed){background:0 0}.ms-navigation li .ms-navigation-button{padding-left:24px}.ms-navigation li li .ms-navigation-button{padding-left:56px}.ms-navigation li li li .ms-navigation-button{padding-left:72px}.ms-navigation li li li li .ms-navigation-button{padding-left:88px}.ms-navigation li li li li li .ms-navigation-button{padding-left:104px}.ms-navigation li.group .ms-navigation-button{padding-left:24px}.ms-navigation li.group li .ms-navigation-button{padding-left:24px}.ms-navigation li.group li li .ms-navigation-button{padding-left:56px}.ms-navigation li.group li li li .ms-navigation-button{padding-left:72px}.ms-navigation li.group li li li li .ms-navigation-button{padding-left:88px}#horizontal-navigation{height:64px;min-height:64px;max-height:64px;background:#fff;z-index:54}#horizontal-navigation .ms-navigation-horizontal{display:flex;position:relative;user-select:none}#horizontal-navigation .ms-navigation-horizontal li,#horizontal-navigation .ms-navigation-horizontal ul{padding:0;margin:0;list-style:none}#horizontal-navigation .ms-navigation-horizontal .horizontal{display:flex;flex:1}#horizontal-navigation .ms-navigation-horizontal .horizontal li{position:relative;cursor:pointer}#horizontal-navigation .ms-navigation-horizontal .horizontal li:not(.active):hover{background:rgba(0,0,0,.12)}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button{display:block;float:left;padding:12px 14px}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button .arrow{display:none}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button.active{background:0 0;border-bottom:2px solid}#horizontal-navigation .ms-navigation-horizontal .horizontal>li:last-child{margin-right:0}#horizontal-navigation .ms-navigation-horizontal .horizontal>li li .ms-navigation-horizontal-item .ms-navigation-horizontal-button.active{color:#fff!important}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children ul{display:none;position:absolute;background:#fff;z-index:999;min-width:200px;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);top:0;left:100%}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children:hover>ul{display:block}#horizontal-navigation .ms-navigation-horizontal .horizontal>.has-children>ul{top:100%;left:0}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button{display:flex;align-items:center;width:100%;color:rgba(0,0,0,.87);white-space:nowrap;padding:14px 16px;text-decoration:none}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button .icon{color:rgba(0,0,0,.54);margin-right:8px}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button .badge{min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transition:opacity .2s ease-in-out .1s}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button .arrow{margin-left:8px}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button.active .badge{background:#fff!important;color:rgba(0,0,0,.87)!important}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button.active .icon{color:#fff}@media only screen and (min-width:960px){body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .animate-height{transition:none}body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node .ms-navigation-item .ms-navigation-button .icon{margin:0}body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node .ms-navigation-item .ms-navigation-button .arrow,body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node .ms-navigation-item .ms-navigation-button .badge,body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node .ms-navigation-item .ms-navigation-button .title{opacity:0;visibility:hidden}body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node.group>.ms-navigation-item .ms-navigation-button:before{content:'';display:block;position:relative;width:16px;border-top:1px solid rgba(255,255,255,.12)}body.ms-navigation-folded:not(.ms-navigation-folded-open) #ms-navigation-fold-expander{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999}body.ms-navigation-folded #ms-navigation-fold-collapser{position:absolute;top:0;right:0;bottom:0;left:0;z-index:59}}@media only screen and (max-width:960px){body.ms-navigation-horizontal-mobile-menu-active #horizontal-navigation .navigation-toggle{height:64px;margin-right:16px}body.ms-navigation-horizontal-mobile-menu-active #horizontal-navigation .navigation-toggle .md-button{margin:0;width:64px;height:64px}body.ms-navigation-horizontal-mobile-menu-active #horizontal-navigation .ms-navigation-horizontal{display:block!important;background:#fff}#horizontal-navigation{z-index:60}#horizontal-navigation .ms-navigation-horizontal{position:absolute;display:none;top:0;right:0;bottom:0;left:0;padding:0 0 16px 0;z-index:9998;overflow-x:hidden;overflow-y:scroll}#horizontal-navigation .ms-navigation-horizontal .horizontal{flex-direction:column;min-height:100%;width:100%}#horizontal-navigation .ms-navigation-horizontal .horizontal li:not(.active):hover{background:0 0}#horizontal-navigation .ms-navigation-horizontal .horizontal li:not(.active) .ms-navigation-horizontal-item{margin:4px}#horizontal-navigation .ms-navigation-horizontal .horizontal li:not(.active) .ms-navigation-horizontal-item:hover{background:rgba(0,0,0,.12)}#horizontal-navigation .ms-navigation-horizontal .horizontal>li{padding:0 12px}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button{display:flex;float:none}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button .arrow{display:block}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children ul{position:relative;top:0;left:0;box-shadow:none}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children:hover>ul{display:none}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children .expanded>.ms-navigation-horizontal-button .arrow{transform:rotate(90deg)}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children .expanded+ul{display:block;margin-left:16px}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item{min-height:48px;height:48px}}md-dialog.md-phonebar-dialog{max-width:720px;width:720px}md-dialog.md-phonebar-dialog md-dialog-content{display:block;position:relative;height:500px}md-dialog.md-phonebar-dialog md-toolbar .title{font-size:17px}md-dialog.md-phonebar-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.md-phonebar-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}md-dialog.md-phonebar-dialog md-tabs{position:static}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}.ms-phonebar{height:64px;font-size:13px}.ms-phonebar .phonebar-container{height:64px;padding:0}.ms-phonebar .phonebar-container .quantity-indicator{display:inline-block;vertical-align:middle;width:8px;height:8px;border-radius:4px;margin-right:5px;margin-left:5px}.ms-phonebar .phonebar-container .sessions{overflow-x:auto}.ms-phonebar .phonebar-container .session{border-radius:3px;border:1px solid #dcdcdc;margin-left:3px;cursor:pointer}.ms-phonebar .phonebar-container .session-info{padding-left:3px;padding-right:3px;color:grey}.ms-phonebar .phonebar-container .session-button{border:1px solid grey;margin:3px}.ms-phonebar .phonebar-container .button-bar{border:1px solid grey}.ms-phonebar .phonebar-container .num-pad{position:fixed;border-radius:3px;border:1px solid #9e9e9e;top:80px;left:80px}.ms-phonebar .phonebar-container .num-pad-logo{height:40px;width:42px}.ms-phonebar .phonebar-container p{margin:0;padding:0 0 10px 0;line-height:10px;font-size:10px}.ms-phonebar .phonebar-container .span4{width:50px;float:left;margin:8px}.ms-phonebar .phonebar-container .num{border:1px solid #9e9e9e;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;height:50px;background-color:#fff;color:#333;cursor:pointer}.ms-phonebar .phonebar-container .num:hover{background-color:#9e9e9e;color:#fff;transition-property:background-color .2s linear 0s;-moz-transition:background-color .2s linear 0s;-webkit-transition:background-color .2s linear 0s;-o-transition:background-color .2s linear 0s}.ms-phonebar .phonebar-container .txt{font-size:20px;text-align:center;margin-top:3px;font-family:Lato,sans-serif;color:#333}.ms-phonebar .phonebar-container .small{font-size:15px}.ms-phonebar .phonebar-container .angucomplete-dropdown{top:45px;overflow-y:auto;max-height:200px}.ms-phonebar .phonebar-container .highlight{color:red}.ms-phonebar .phonebar-container .input-number{margin-left:5px;padding:8px;border:1px solid #ccc;border-radius:3px;box-sizing:border-box}.ms-phonebar .phonebar-container .phonebar{position:relative}.ms-phonebar .phonebar-container .phonebar>div{height:64px;min-width:44px}.ms-phonebar .phonebar-container .phonebar>div.dragging{cursor:grabbing}.ms-phonebar .phonebar-container .phonebar>div.dragging .md-ripple-container{display:none}.ms-phonebar .phonebar-container .phonebar>div.ghost .shortcut{opacity:.27}.ms-phonebar .phonebar-container.mobile-bar-active{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;z-index:99;max-width:none!important}.ms-phonebar .phonebar-container.mobile-bar-active .phonebar,.ms-phonebar .phonebar-container.mobile-bar-active .toggle-mobile-menu{display:flex!important}.ms-phonebar .phonebar-container.mobile-bar-active .toggle-mobile-menu{margin-left:14px}.ms-phonebar .phonebar-container.mobile-bar-active>div{border-right:1px solid rgba(0,0,0,.12)}.quick-filter-container md-select .md-select-value.md-select-placeholder{color:inherit}.quick-filter-container md-select[multiple] md-select-value>:first-child{max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.ms-responsive-table-wrapper{overflow-x:auto;overflow-y:hidden}.ms-search-bar{height:64px;font-size:13px}.ms-search-bar .ms-search-bar-collapser,.ms-search-bar .ms-search-bar-expander{cursor:pointer;padding:0 20px;margin:0;width:64px!important;height:64px!important;line-height:64px!important}.ms-search-bar .ms-search-bar-loader{width:64px!important;height:64px!important;line-height:64px!important}.ms-search-bar .ms-search-button-expanded{pointer-events:none}.ms-search-bar .ms-search-bar-collapser{display:none}.ms-search-bar input{background-color:transparent;font-size:16px}.ms-search-bar .ms-search-bar-results{position:absolute;top:64px;left:0;right:0;overflow-x:hidden;overflow-y:scroll;background:#fff;max-height:300px;box-shadow:0 1px 8px 0 rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.12)}.ms-search-bar .ms-search-bar-results .no-results{font-size:18px;padding:16px;color:rgba(0,0,0,.54)}.ms-search-bar .ms-search-bar-results .result{position:relative;height:56px;min-height:56px;max-height:56px;padding:16px;cursor:pointer}.ms-search-bar .ms-search-bar-results .result.selected{background:rgba(0,0,0,.07)}.ms-search-bar .ms-search-bar-results .result .icon-container{min-width:32px;margin-right:8px}.ms-search-bar .ms-search-bar-results .result .icon-container .square{width:6px;height:6px}.ms-search-bar .ms-search-bar-results .result .title{font-size:16px}.ms-search-bar .ms-search-bar-results .result .description{padding-top:6px;font-size:14px}.ms-search-bar.expanded{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;z-index:10}.ms-search-bar.expanded #ms-search-bar-input{display:block}.ms-search-bar.expanded .ms-search-bar-collapser{display:block}.ms-search-bar.down{top:64px;border-bottom:1px rgba(0,0,0,.12) solid}.ms-search-bar[disabled] input{pointer-events:none}body.ms-search-bar-expanded #toolbar{z-index:999!important}@media screen and (max-width:960px){.ms-search-bar-label{padding:0 8px 0 12px}}.ms-shortcuts{height:64px;font-size:13px}.ms-shortcuts .shortcuts-container{height:64px;padding:0 8px;max-width:400px}.ms-shortcuts .shortcuts-container .shortcuts{position:relative;overflow-x:scroll}.ms-shortcuts .shortcuts-container .shortcuts>div{height:64px;min-width:44px}.ms-shortcuts .shortcuts-container .shortcuts>div.dragging{cursor:grabbing}.ms-shortcuts .shortcuts-container .shortcuts>div.dragging .md-ripple-container{display:none}.ms-shortcuts .shortcuts-container .shortcuts>div.ghost .shortcut{opacity:.27}.ms-shortcuts .shortcuts-container .shortcuts>div .shortcut{margin:2px}.ms-shortcuts .shortcuts-container .shortcuts>div .shortcut .first-letter{display:inline-block;vertical-align:middle;font-size:20px;text-transform:uppercase;color:rgba(0,0,0,.54)}.ms-shortcuts .shortcuts-container .shortcut-menu{margin:0}.ms-shortcuts .shortcuts-container.mobile-bar-active{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;z-index:99;max-width:none!important}.ms-shortcuts .shortcuts-container.mobile-bar-active .shortcut-menu,.ms-shortcuts .shortcuts-container.mobile-bar-active .shortcuts,.ms-shortcuts .shortcuts-container.mobile-bar-active .toggle-mobile-menu{display:flex!important}.ms-shortcuts .shortcuts-container.mobile-bar-active .toggle-mobile-menu{margin-left:14px}.ms-shortcuts .shortcuts-container.mobile-bar-active>div{border-right:1px solid rgba(0,0,0,.12)}#ms-shortcut-add-menu{position:relative;width:240px;min-width:240px;max-width:240px}#ms-shortcut-add-menu .add-shortcut-button{width:48px;height:48px;padding:0 12px;margin:0}#ms-shortcut-add-menu .shortcut-search{height:45px;padding:0 8px}#ms-shortcut-add-menu .shortcut-search .search-icon{width:40px;height:40px;line-height:48px}#ms-shortcut-add-menu .shortcut-search .shortcut-loader{padding:10px}#ms-shortcut-add-menu .shortcut-search input{padding:8px}#ms-shortcut-add-menu .results{position:relative;overflow-y:scroll;max-height:233px;margin-top:8px;padding-top:8px;border-top:1px solid rgba(0,0,0,.12)}#ms-shortcut-add-menu .results .no-results{font-size:18px;padding:16px;color:rgba(0,0,0,.54)}#ms-shortcut-add-menu .results .result{position:relative;min-height:56px;padding:16px;cursor:pointer}#ms-shortcut-add-menu .results .result.selected{background:rgba(0,0,0,.07)}#ms-shortcut-add-menu .results .result .icon-container{min-width:32px;margin-right:8px}#ms-shortcut-add-menu .results .result .icon-container .square{width:6px;height:6px}#ms-shortcut-add-menu .results .result .title{font-size:16px}#ms-shortcut-add-menu .results .result .description{padding-top:6px;font-size:14px}#splash-screen{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#3c4252;z-index:99999}#splash-screen.ng-leave{opacity:1;transition:all linear .2s}#splash-screen.ng-leave-active{opacity:0}#splash-screen .center{display:block;width:100%;position:absolute;top:50%;transform:translateY(-50%)}#splash-screen .logo{width:96px;height:96px;line-height:96px;margin:0 auto;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:56px;text-align:center;border-radius:2px;background-color:#039be5;color:#fff;box-shadow:0 2px 14px 0 rgba(0,0,0,.22)}#splash-screen .spinner-wrapper{display:block;position:relative;width:100%;min-height:100px;height:100px}#splash-screen .spinner-wrapper .spinner{position:absolute;overflow:hidden;left:50%;margin-left:-50px;animation:outer-rotate 2.91667s linear infinite}#splash-screen .spinner-wrapper .spinner .inner{width:100px;height:100px;position:relative;animation:sporadic-rotate 5.25s cubic-bezier(.35,0,.25,1) infinite}#splash-screen .spinner-wrapper .spinner .inner .gap{position:absolute;left:49px;right:49px;top:0;bottom:0;border-top:10px solid;box-sizing:border-box}#splash-screen .spinner-wrapper .spinner .inner .left,#splash-screen .spinner-wrapper .spinner .inner .right{position:absolute;top:0;height:100px;width:50px;overflow:hidden}#splash-screen .spinner-wrapper .spinner .inner .left .half-circle,#splash-screen .spinner-wrapper .spinner .inner .right .half-circle{position:absolute;top:0;width:100px;height:100px;box-sizing:border-box;border:10px solid #4285f4;border-bottom-color:transparent;border-radius:50%}#splash-screen .spinner-wrapper .spinner .inner .left{left:0}#splash-screen .spinner-wrapper .spinner .inner .left .half-circle{left:0;border-right-color:transparent;animation:left-wobble 1.3125s cubic-bezier(.35,0,.25,1) infinite;-webkit-animation:left-wobble 1.3125s cubic-bezier(.35,0,.25,1) infinite}#splash-screen .spinner-wrapper .spinner .inner .right{right:0}#splash-screen .spinner-wrapper .spinner .inner .right .half-circle{right:0;border-left-color:transparent;animation:right-wobble 1.3125s cubic-bezier(.35,0,.25,1) infinite;-webkit-animation:right-wobble 1.3125s cubic-bezier(.35,0,.25,1) infinite}@keyframes outer-rotate{0%{transform:rotate(0) scale(.5)}100%{transform:rotate(360deg) scale(.5)}}@keyframes left-wobble{0%,100%{transform:rotate(130deg)}50%{transform:rotate(-5deg)}}@keyframes right-wobble{0%,100%{transform:rotate(-130deg)}50%{transform:rotate(5deg)}}@keyframes sporadic-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}.ms-stepper .ms-stepper-horizontal{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation{height:72px;min-height:72px;max-height:72px;background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item{display:flex;flex-direction:row;align-items:center;position:relative;height:72px;min-height:72px;max-height:72px;line-height:24px;margin:0;padding:24px;border-radius:0;cursor:pointer;font-size:14px;text-transform:none}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:after,.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:before{content:'';display:block;position:absolute;top:50%;width:24px;border-bottom:1px solid rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:before{left:0}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:after{right:0}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:first-child:before{display:none}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:last-child:after{display:none}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.current .title{font-weight:600;color:rgba(0,0,0,.87)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.disabled{cursor:default}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.disabled .step{background:rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.disabled .title{color:rgba(0,0,0,.27)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.disabled .subtitle{color:rgba(0,0,0,.27)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.optional{padding:16px 24px}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item .step{width:24px;min-width:24px;height:24px;border-radius:50%;margin:0 8px 0 16px;color:#fff}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item .step .icon{color:#fff;font-weight:700;line-height:24px!important}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item .title{padding-right:16px;color:rgba(0,0,0,.54)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item .subtitle{font-size:12px;padding-right:16px;color:rgba(0,0,0,.54);line-height:1}.ms-stepper .ms-stepper-horizontal .ms-stepper-steps{padding:24px 16px}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls{padding:0 16px 16px 16px}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots{display:none;align-items:center;justify-content:center;padding:0 16px}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots span{width:5px;height:5px;margin:0 4px;border-radius:50%}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots span:not(.md-accent-bg){background:rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots span.selected{width:8px;height:8px}@media screen and (max-width:600px){.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation{display:none}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots{display:flex}}.ms-stepper .ms-stepper-vertical{position:relative;background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-stepper .ms-stepper-vertical .ms-stepper-vertical-line{display:block;position:absolute;width:1px;top:32px;bottom:32px;left:43px;border-left:1px solid rgba(0,0,0,.12)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps{padding:8px 0}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step{display:block}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item{display:flex;flex-direction:row;align-items:center;position:relative;width:100%;height:72px;min-height:72px;max-height:72px;line-height:24px;margin:0;padding:0 24px;border-radius:0;cursor:pointer;font-size:14px;text-transform:none}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item:first-child:before{display:none}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item:last-child:after{display:none}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item:hover:not(.disabled) .step{background-color:#ececec;border-color:#ececec}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.current .title{font-weight:600;color:rgba(0,0,0,.87)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.disabled{cursor:default}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.disabled .title{color:rgba(0,0,0,.27)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.disabled .subtitle{color:rgba(0,0,0,.27)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.optional{padding:16px 24px}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item .step{width:40px;min-width:40px;height:40px;margin:0 16px 0 0;border-radius:50%;background:#fff;border:8px solid #fff;color:#fff;transition:border-color .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item .step .icon{font-weight:700;line-height:28px!important}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item .title{padding-right:16px;color:rgba(0,0,0,.54)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item .subtitle{font-size:12px;padding-right:16px;color:rgba(0,0,0,.54);line-height:1}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-step-content{padding:0 24px 16px 64px}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-controls{padding:0 16px 16px 56px}.ms-tab-scroll .scroll-arrow{height:inherit;padding:0}.ms-tab-scroll .bar-container{overflow:hidden}.ms-tab-scroll .scroll-container{overflow-x:hidden;overflow-y:hidden;transition:transform .2s ease-in-out}.ms-timeline .ms-timeline-loader{position:relative;display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin:0 auto;background:#fff;font-weight:500;opacity:0;z-index:11;border-radius:50%}.ms-timeline .ms-timeline-loader.show{opacity:1}.ms-timeline .ms-timeline-loader .spinner{width:24px;height:24px;border:3px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%}.ms-widget .ms-widget-front{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-widget .ms-widget-back{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-widget.sidenav-widget .ms-widget-back,.ms-widget.sidenav-widget .ms-widget-front{box-shadow:none}.ms-widget .flip-to-front{position:absolute;top:0;right:0}.ms-widget .c3{height:100%}.ms-widget .chart-fill-8{margin:0 -8px -8px -8px}.ms-widget .chart-fill-16{margin:0 -16px -16px -16px}.ms-widget .chart-fill-24{margin:0 -24px -24px -24px}.ms-widget .chart-fill-32{margin:0 -32px -32px -32px}.ms-widget .chart-fill-40{margin:0 -40px -40px -40px}.ms-widget .chart-fill-48{margin:0 -48px -48px -48px}.ms-widget .chart-fill-56{margin:0 -56px -56px -56px}.ms-widget .chart-fill-64{margin:0 -64px -64px -64px}.ms-widget .chart-fill-72{margin:0 -72px -72px -72px}.ms-widget .chart-fill-80{margin:0 -80px -80px -80px}.ms-widget{position:relative;font-size:1.3rem;perspective:3000px;padding:12px}.ms-widget .ms-widget-front{display:flex;flex-direction:column;flex:1 1 auto;position:relative;overflow:hidden;visibility:visible;width:100%;opacity:1;z-index:10;border-radius:2px;transition:transform .5s ease-out 0s,visibility 0s ease-in .2s,opacity 0s ease-in .2s;transform:rotateY(0);backface-visibility:hidden}.ms-widget .ms-widget-back{display:block;position:absolute;overflow:hidden;visibility:hidden;opacity:0;z-index:10;top:12px;right:12px;bottom:12px;left:12px;border-radius:2px;transition:transform .5s ease-out 0s,visibility 0s ease-in .2s,opacity 0s ease-in .2s;transform:rotateY(180deg);backface-visibility:hidden}.ms-widget .md-button{margin:0}.ms-widget .md-button.md-icon-button{margin:0}.ms-widget.flipped .ms-widget-front{visibility:hidden;opacity:0;transform:rotateY(180deg)}.ms-widget.flipped .ms-widget-back{display:block;visibility:visible;opacity:1;transform:rotateY(360deg)}.ms-widget.sidenav-widget{padding:0}.ms-widget.ar-2-1 .widget{padding:0;position:relative}.ms-widget.ar-2-1 .widget:before{display:block;content:'';width:100%;padding-top:50%}.ms-widget.ar-2-1 .widget>.widget{position:absolute;top:8px;left:8px;right:8px;bottom:8px}.ms-widget.ar-1-1 .widget{padding:0;position:relative}.ms-widget.ar-1-1 .widget:before{display:block;content:'';width:100%;padding-top:100%}.ms-widget.ar-1-1 .widget>.widget{position:absolute;top:8px;left:8px;right:8px;bottom:8px}.ms-theme-options .ms-theme-options-button{position:absolute;top:160px;right:0;z-index:50;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);width:48px;height:48px;line-height:48px;text-align:center;cursor:pointer;border-radius:0;margin:0;pointer-events:auto;opacity:.75}.ms-theme-options .ms-theme-options-button:hover{opacity:1}.ms-theme-options md-sidenav{width:384px;min-width:384px;max-width:384px}.ms-theme-options md-sidenav .ms-theme-options-list{background:#fff;z-index:12;pointer-events:auto}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option{padding:16px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button{width:160px;max-width:160px;margin:8px 8px 16px 8px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button.md-checked ._md-label img,.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button:hover ._md-label img{opacity:1;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button ._md-container{display:none}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button ._md-label{margin-left:0}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button ._md-label img{opacity:.8;margin-bottom:8px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.color-palettes md-menu-item{max-width:192px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.color-palettes .theme-button{border-bottom:16px solid;text-align:left;width:101px;height:88px;box-shadow:none;opacity:.8}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.color-palettes .theme-button.active,.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.color-palettes .theme-button:hover{opacity:1;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option md-radio-button{margin:8px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option .option-title{font-size:14px;font-weight:500;padding:0 8px 12px 8px}#error-404 .content{width:90%;max-width:512px;margin-top:128px}#error-404 .content .error-code{font-size:112px;text-align:center;line-height:1;margin-bottom:16px;font-weight:500}#error-404 .content .message{font-size:24px;text-align:center;color:rgba(0,0,0,.54)}#error-404 .content .search{width:100%;height:56px;line-height:56px;margin:48px auto 16px auto;padding:16px;background:#fff}#error-404 .content .search input{padding:0 0 0 16px}#error-404 .content .back-link{font-size:15px;text-align:center}#error-500 .content{width:90%;max-width:512px;margin-top:128px}#error-500 .content .error-code{font-size:112px;line-height:1;text-align:center;margin-bottom:16px;font-weight:500}#error-500 .content .message{font-size:24px;text-align:center;color:rgba(0,0,0,.54)}#error-500 .content .sub-message{font-size:17px;text-align:center;color:rgba(0,0,0,.54);margin:16px auto 48px auto}#error-500 .content .report-link{text-align:center;font-size:15px}#forgot-password{height:100%;background:url(/assets/images/backgrounds/tech.png) no-repeat;background-size:cover}#forgot-password #forgot-password-form-wrapper{flex:1 0 auto;padding:32px}#forgot-password #forgot-password-form-wrapper #forgot-password-form{width:384px;max-width:384px;padding:32px;text-align:center;background:#fff}#forgot-password #forgot-password-form-wrapper #forgot-password-form .logo{width:128px;height:128px;line-height:128px;font-size:86px;font-weight:500;margin:32px auto;color:#fff;border-radius:2px}#forgot-password #forgot-password-form-wrapper #forgot-password-form .title{font-size:17px;margin:16px 0 32px 0}#forgot-password #forgot-password-form-wrapper #forgot-password-form .logo_login{max-height:200px}#forgot-password #forgot-password-form-wrapper #forgot-password-form form{width:100%;text-align:left}#forgot-password #forgot-password-form-wrapper #forgot-password-form form .submit-button{width:220px;margin:16px auto;display:block}#forgot-password #forgot-password-form-wrapper #forgot-password-form .login{margin:32px auto 24px auto;width:250px;font-weight:500}#forgot-password #forgot-password-form-wrapper #forgot-password-form .login .text{margin-right:8px}@media screen and (max-width:600px){#forgot-password #forgot-password-form-wrapper{padding:16px}#forgot-password #forgot-password-form-wrapper #forgot-password-form{padding:24px;width:100%}#forgot-password #forgot-password-form-wrapper #forgot-password-form form .md-button{width:90%}}#login{height:100%;background:url(/assets/images/backgrounds/tech.png) no-repeat;background-size:cover}#login #login-form-wrapper{flex:1 0 auto;padding:32px}#login #login-form-wrapper #login-form{width:384px;max-width:384px;padding:32px;background:#fff;text-align:center}#login #login-form-wrapper #login-form .logo{width:128px;height:128px;line-height:128px;font-size:86px;font-weight:500;margin:32px auto;color:#fff;border-radius:2px}#login #login-form-wrapper #login-form .title{font-size:17px;margin:16px 0 32px 0}#login #login-form-wrapper #login-form .logo_login{max-height:200px}#login #login-form-wrapper #login-form form{width:100%;text-align:left}#login #login-form-wrapper #login-form form md-checkbox{margin:0}#login #login-form-wrapper #login-form form .remember-forgot-password{font-size:13px;margin-top:8px}#login #login-form-wrapper #login-form form .remember-forgot-password .remember-me{margin-bottom:16px}#login #login-form-wrapper #login-form form .remember-forgot-password .forgot-password{font-size:13px;font-weight:500;margin-bottom:16px}#login #login-form-wrapper #login-form form .submit-button{width:220px;margin:16px auto;display:block}#login #login-form-wrapper #login-form .register{margin:32px auto 24px auto;width:250px;font-weight:500}#login #login-form-wrapper #login-form .register .text{margin-right:8px}#login #login-form-wrapper #login-form .separator{font-size:15px;font-weight:600;margin:24px auto 16px auto;position:relative;overflow:hidden;width:100px;color:rgba(0,0,0,.54)}#login #login-form-wrapper #login-form .separator .text{display:inline-block;vertical-align:baseline;position:relative;padding:0 8px;z-index:9999}#login #login-form-wrapper #login-form .separator .text:after,#login #login-form-wrapper #login-form .separator .text:before{content:'';display:block;width:30px;position:absolute;top:10px;border-top:1px solid rgba(0,0,0,.12)}#login #login-form-wrapper #login-form .separator .text:before{right:100%}#login #login-form-wrapper #login-form .separator .text:after{left:100%}#login #login-form-wrapper #login-form .md-button.facebook,#login #login-form-wrapper #login-form .md-button.google{width:192px;text-transform:none;color:#fff;font-size:13px}#login #login-form-wrapper #login-form .md-button.facebook md-icon,#login #login-form-wrapper #login-form .md-button.google md-icon{color:#fff;margin:0 8px 0 0}#login #login-form-wrapper #login-form .md-button.google{background-color:#d73d32}#login #login-form-wrapper #login-form .md-button.facebook{background-color:#3f5c9a}@media screen and (max-width:600px){#login #login-form-wrapper{padding:16px}#login #login-form-wrapper #login-form{padding:24px;width:100%}#login #login-form-wrapper #login-form form .md-button{width:90%}#login #login-form-wrapper #login-form .md-button.facebook,#login #login-form-wrapper #login-form .md-button.google{width:80%}}md-dialog.extractedReport-dialog{max-width:720px;width:720px}md-dialog.extractedReport-dialog md-dialog-content{display:block;position:relative}md-dialog.extractedReport-dialog md-toolbar .title{font-size:17px}md-dialog.extractedReport-dialog md-input-container textarea{min-height:150px}md-dialog.extractedReport-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.extractedReport-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.extractedReport-dialog .date-container{padding:16px 0 24px 0}md-dialog.extractedReport-dialog .error-list{font-size:13px}md-dialog.extractedReport-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.extractedReport-dialog .error-list .error .message{font-weight:500}md-dialog.extractedReport-dialog .error-list .error .md-button{margin:0}md-dialog.extractedReport-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.extractedReport-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#extractedReports{position:relative}#extractedReports>.header{height:76px;min-height:76px;max-height:76px}#extractedReports>.header .logo .logo-icon{margin:0 16px 0 0}#extractedReports>.header .logo .logo-text{font-size:24px}#extractedReports>.header md-icon{color:#fff}#extractedReports>.header .search-input-wrapper{position:relative}#extractedReports>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#extractedReports>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#extractedReports>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#extractedReports>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#extractedReports>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#extractedReports>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#extractedReports>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#extractedReports>.header.selected-bar .close-button-wrapper{width:244px}#extractedReports>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#extractedReports>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#extractedReports>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#extractedReports #add-extractedReport-button{position:fixed;bottom:8px;right:8px;padding:0}#extractedReports #upload-extractedReport-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.metric-dialog{max-width:720px;width:720px}md-dialog.metric-dialog md-dialog-content{display:block;position:relative}md-dialog.metric-dialog md-toolbar .title{font-size:17px}md-dialog.metric-dialog md-input-container textarea{min-height:150px}md-dialog.metric-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.metric-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.metric-dialog .date-container{padding:16px 0 24px 0}md-dialog.metric-dialog .error-list{font-size:13px}md-dialog.metric-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.metric-dialog .error-list .error .message{font-weight:500}md-dialog.metric-dialog .error-list .error .md-button{margin:0}md-dialog.metric-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.metric-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#metrics{position:relative}#metrics>.header{height:76px;min-height:76px;max-height:76px}#metrics>.header .logo .logo-icon{margin:0 16px 0 0}#metrics>.header .logo .logo-text{font-size:24px}#metrics>.header md-icon{color:#fff}#metrics>.header .search-input-wrapper{position:relative}#metrics>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#metrics>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#metrics>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#metrics>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#metrics>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#metrics>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#metrics>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#metrics>.header.selected-bar .close-button-wrapper{width:244px}#metrics>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#metrics>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#metrics>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#metrics #add-metric-button{position:fixed;bottom:8px;right:8px;padding:0}#metrics #upload-metric-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.report-dialog{max-width:720px;width:720px}md-dialog.report-dialog md-dialog-content{display:block;position:relative}md-dialog.report-dialog md-toolbar .title{font-size:17px}md-dialog.report-dialog md-input-container textarea{min-height:150px}md-dialog.report-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.report-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.report-dialog .date-container{padding:16px 0 24px 0}md-dialog.report-dialog .error-list{font-size:13px}md-dialog.report-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.report-dialog .error-list .error .message{font-weight:500}md-dialog.report-dialog .error-list .error .md-button{margin:0}md-dialog.report-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.report-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.report-dialog{max-width:720px;width:720px}md-dialog.report-dialog md-dialog-content{display:block;position:relative}md-dialog.report-dialog md-toolbar .title{font-size:17px}md-dialog.report-dialog md-input-container textarea{min-height:150px}md-dialog.report-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.report-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.report-dialog .date-container{padding:16px 0 24px 0}md-dialog.report-dialog .error-list{font-size:13px}md-dialog.report-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.report-dialog .error-list .error .message{font-weight:500}md-dialog.report-dialog .error-list .error .md-button{margin:0}md-dialog.report-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.report-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.reportField-dialog{max-width:720px;width:720px}md-dialog.reportField-dialog md-dialog-content{display:block;position:relative}md-dialog.reportField-dialog md-toolbar .title{font-size:17px}md-dialog.reportField-dialog md-input-container textarea{min-height:150px}md-dialog.reportField-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.reportField-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.reportField-dialog .date-container{padding:16px 0 24px 0}md-dialog.reportField-dialog .error-list{font-size:13px}md-dialog.reportField-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.reportField-dialog .error-list .error .message{font-weight:500}md-dialog.reportField-dialog .error-list .error .md-button{margin:0}md-dialog.reportField-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.reportField-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#analytics-report .header{height:76px;min-height:76px;max-height:76px}#analytics-report .header .goto-reports-button{margin-right:16px}#analytics-report .header .report-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#analytics-report .header .report-image img{height:100%;width:auto;max-width:none}#analytics-report .header .subtitle{margin:6px 0 0 0}#analytics-report .report-detail-form-container{padding:24px;margin-bottom:24px}#analytics-report .report-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#analytics-report .report-detail-form-container .handle{cursor:move}#analytics-report .report-detail-form-container md-input-container md-switch{margin:0!important}#analytics-report .report-detail-form-container #report-image-uploader{position:relative}#analytics-report .report-detail-form-container #report-image-uploader.dropping .drop-text{display:flex}#analytics-report .report-detail-form-container #report-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#analytics-report .report-detail-form-container #report-image-uploader .upload-button{margin-bottom:16px}#analytics-report .report-detail-form-container #report-image-uploader .report-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#analytics-report .report-detail-form-container #report-image-uploader .report-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#analytics-report .report-detail-form-container #report-image-uploader .report-image .media{max-height:100%}md-dialog.report-dialog{max-width:720px;width:720px}md-dialog.report-dialog md-dialog-content{display:block;position:relative}md-dialog.report-dialog md-toolbar .title{font-size:17px}md-dialog.report-dialog md-input-container textarea{min-height:150px}md-dialog.report-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.report-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.report-dialog .date-container{padding:16px 0 24px 0}md-dialog.report-dialog .error-list{font-size:13px}md-dialog.report-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.report-dialog .error-list .error .message{font-weight:500}md-dialog.report-dialog .error-list .error .md-button{margin:0}md-dialog.report-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.report-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#reports{position:relative}#reports>.header{height:76px;min-height:76px;max-height:76px}#reports>.header .logo .logo-icon{margin:0 16px 0 0}#reports>.header .logo .logo-text{font-size:24px}#reports>.header md-icon{color:#fff}#reports>.header .search-input-wrapper{position:relative}#reports>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#reports>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#reports>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#reports>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#reports>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#reports>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#reports>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#reports>.header.selected-bar .close-button-wrapper{width:244px}#reports>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#reports>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#reports>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}md-dialog.report-dialog{max-width:720px;width:720px}md-dialog.report-dialog md-dialog-content{display:block;position:relative}md-dialog.report-dialog md-toolbar .title{font-size:17px}md-dialog.report-dialog md-input-container textarea{min-height:150px}md-dialog.report-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.report-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.report-dialog .date-container{padding:16px 0 24px 0}md-dialog.report-dialog .error-list{font-size:13px}md-dialog.report-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.report-dialog .error-list .error .message{font-weight:500}md-dialog.report-dialog .error-list .error .md-button{margin:0}md-dialog.report-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.report-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.web-dialog md-dialog-content{display:block;position:relative}md-dialog.web-dialog md-toolbar .title{font-size:17px}md-dialog.web-dialog md-input-container textarea{min-height:150px}md-dialog.web-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.web-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.web-dialog .date-container{padding:16px 0 24px 0}md-dialog.web-dialog .error-list{font-size:13px}md-dialog.web-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.web-dialog .error-list .error .message{font-weight:500}md-dialog.web-dialog .error-list .error .md-button{margin:0}md-dialog.web-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.web-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.odbc-dialog{max-width:720px;width:720px}md-dialog.odbc-dialog md-dialog-content{display:block;position:relative}md-dialog.odbc-dialog md-toolbar .title{font-size:17px}md-dialog.odbc-dialog md-input-container textarea{min-height:150px}md-dialog.odbc-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.odbc-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.odbc-dialog .date-container{padding:16px 0 24px 0}md-dialog.odbc-dialog .error-list{font-size:13px}md-dialog.odbc-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.odbc-dialog .error-list .error .message{font-weight:500}md-dialog.odbc-dialog .error-list .error .md-button{margin:0}md-dialog.odbc-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.odbc-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#odbcs{position:relative}#odbcs>.header{height:76px;min-height:76px;max-height:76px}#odbcs>.header .logo .logo-icon{margin:0 16px 0 0}#odbcs>.header .logo .logo-text{font-size:24px}#odbcs>.header md-icon{color:#fff}#odbcs>.header .search-input-wrapper{position:relative}#odbcs>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#odbcs>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#odbcs>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#odbcs>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#odbcs>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#odbcs>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#odbcs>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#odbcs>.header.selected-bar .close-button-wrapper{width:244px}#odbcs>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#odbcs>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#odbcs>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#odbcs #add-odbc-button{position:fixed;bottom:8px;right:8px;padding:0}#odbcs #upload-odbc-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.project-dialog{max-width:720px;width:720px}md-dialog.project-dialog md-dialog-content{display:block;position:relative}md-dialog.project-dialog md-toolbar .title{font-size:17px}md-dialog.project-dialog md-input-container textarea{min-height:150px}md-dialog.project-dialog .date-container{padding:16px 0 24px 0}md-dialog.project-dialog .error-list{font-size:13px}md-dialog.project-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.project-dialog .error-list .error .message{font-weight:500}md-dialog.project-dialog .error-list .error .md-button{margin:0}md-dialog.project-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.project-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}md-dialog.project-dialog .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#callysquare-project .header{height:76px;min-height:76px;max-height:76px}#callysquare-project .header .goto-projects-button{margin-right:16px}#callysquare-project .header .project-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#callysquare-project .header .project-image img{height:100%;width:auto;max-width:none}#callysquare-project .header .subtitle{margin:6px 0 0 0}#callysquare-project .project-detail-form-container{padding:24px;margin-bottom:24px}#callysquare-project .project-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#callysquare-project .project-detail-form-container #project-image-uploader{position:relative}#callysquare-project .project-detail-form-container #project-image-uploader.dropping .drop-text{display:flex}#callysquare-project .project-detail-form-container #project-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#callysquare-project .project-detail-form-container #project-image-uploader .upload-button{margin-bottom:16px}#callysquare-project .project-detail-form-container #project-image-uploader .project-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#callysquare-project .project-detail-form-container #project-image-uploader .project-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#callysquare-project .project-detail-form-container #project-image-uploader .project-image .media{max-height:100%}#callysquare-project>.callysquare-content{position:absolute;top:76px;bottom:0;left:0;right:0}#projects{position:relative}#projects>.header{height:76px;min-height:76px;max-height:76px}#projects>.header .logo .logo-icon{margin:0 16px 0 0}#projects>.header .logo .logo-text{font-size:24px}#projects>.header md-icon{color:#fff}#projects>.header .search-input-wrapper{position:relative}#projects>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#projects>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#projects>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#projects>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#projects>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#projects>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#projects>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#projects>.header.selected-bar .close-button-wrapper{width:244px}#projects>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#projects>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#projects>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#projects #add-project-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.squareRecording-dialog{max-width:720px;width:720px}md-dialog.squareRecording-dialog md-dialog-content{display:block;position:relative}md-dialog.squareRecording-dialog md-toolbar .title{font-size:17px}md-dialog.squareRecording-dialog md-input-container textarea{min-height:150px}md-dialog.squareRecording-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.squareRecording-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.squareRecording-dialog .date-container{padding:16px 0 24px 0}md-dialog.squareRecording-dialog .error-list{font-size:13px}md-dialog.squareRecording-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.squareRecording-dialog .error-list .error .message{font-weight:500}md-dialog.squareRecording-dialog .error-list .error .md-button{margin:0}md-dialog.squareRecording-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.squareRecording-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#squareRecordings{position:relative}#squareRecordings>.header{height:76px;min-height:76px;max-height:76px}#squareRecordings>.header .logo .logo-icon{margin:0 16px 0 0}#squareRecordings>.header .logo .logo-text{font-size:24px}#squareRecordings>.header md-icon{color:#fff}#squareRecordings>.header .search-input-wrapper{position:relative}#squareRecordings>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#squareRecordings>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#squareRecordings>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#squareRecordings>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#squareRecordings>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#squareRecordings>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#squareRecordings>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#squareRecordings>.header.selected-bar .close-button-wrapper{width:244px}#squareRecordings>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#squareRecordings>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#squareRecordings>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#squareRecordings #add-squareRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#squareRecordings #upload-squareRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#chatQueues{position:relative}#chatQueues>.header{height:76px;min-height:76px;max-height:76px}#chatQueues>.header .logo .logo-icon{margin:0 16px 0 0}#chatQueues>.header .logo .logo-text{font-size:24px}#chatQueues>.header md-icon{color:#fff}#chatQueues>.header .search-input-wrapper{position:relative}#chatQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#chatQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#chatQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#chatQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#chatQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#chatQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#chatQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#chatQueues>.header.selected-bar .close-button-wrapper{width:244px}#chatQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#chatQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#chatQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#chatQueues #add-chatQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#chatQueues #upload-chatQueue-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.chatQueue-dialog{max-width:720px;width:720px}md-dialog.chatQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.chatQueue-dialog md-toolbar .title{font-size:17px}md-dialog.chatQueue-dialog md-input-container textarea{min-height:150px}md-dialog.chatQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chatQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chatQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatQueue-dialog .error-list{font-size:13px}md-dialog.chatQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatQueue-dialog .error-list .error .message{font-weight:500}md-dialog.chatQueue-dialog .error-list .error .md-button{margin:0}md-dialog.chatQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#chat-chatQueue .header{height:76px;min-height:76px;max-height:76px}#chat-chatQueue .header .goto-chatQueues-button{margin-right:16px}#chat-chatQueue .header .chatQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#chat-chatQueue .header .chatQueue-image img{height:100%;width:auto;max-width:none}#chat-chatQueue .header .subtitle{margin:6px 0 0 0}#chat-chatQueue .chatQueue-detail-form-container{padding:24px;margin-bottom:24px}#chat-chatQueue .chatQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#chat-chatQueue .chatQueue-detail-form-container .handle{cursor:move}#chat-chatQueue .chatQueue-detail-form-container md-input-container md-switch{margin:0!important}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader{position:relative}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader.dropping .drop-text{display:flex}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .upload-button{margin-bottom:16px}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .chatQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .chatQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .chatQueue-image .media{max-height:100%}#chat-chatQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#chat-chatQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#chat-chatQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#chat-chatQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#chatWebsites{position:relative}#chatWebsites>.header{height:76px;min-height:76px;max-height:76px}#chatWebsites>.header .logo .logo-icon{margin:0 16px 0 0}#chatWebsites>.header .logo .logo-text{font-size:24px}#chatWebsites>.header md-icon{color:#fff}#chatWebsites>.header .search-input-wrapper{position:relative}#chatWebsites>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#chatWebsites>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#chatWebsites>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#chatWebsites>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#chatWebsites>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#chatWebsites>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#chatWebsites>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#chatWebsites>.header.selected-bar .close-button-wrapper{width:244px}#chatWebsites>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#chatWebsites>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#chatWebsites>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#chatWebsites #add-chatWebsite-button{position:fixed;bottom:8px;right:8px;padding:0}#chatWebsites #upload-chatWebsite-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chatWebsite-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.chatCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.chatCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.chatCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.chatCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chatCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chatCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatCannedAnswer-dialog .error-list{font-size:13px}md-dialog.chatCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.chatCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.chatCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.offlineMessage-dialog{max-width:720px;width:720px}md-dialog.offlineMessage-dialog md-dialog-content{display:block;position:relative}md-dialog.offlineMessage-dialog md-toolbar .title{font-size:17px}md-dialog.offlineMessage-dialog md-input-container textarea{min-height:150px}md-dialog.offlineMessage-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.offlineMessage-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.offlineMessage-dialog .date-container{padding:16px 0 24px 0}md-dialog.offlineMessage-dialog .error-list{font-size:13px}md-dialog.offlineMessage-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.offlineMessage-dialog .error-list .error .message{font-weight:500}md-dialog.offlineMessage-dialog .error-list .error .md-button{margin:0}md-dialog.offlineMessage-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.offlineMessage-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatProactiveAction-dialog{max-width:720px;width:720px}md-dialog.chatProactiveAction-dialog md-dialog-content{display:block;position:relative}md-dialog.chatProactiveAction-dialog md-toolbar .title{font-size:17px}md-dialog.chatProactiveAction-dialog md-input-container textarea{min-height:150px}md-dialog.chatProactiveAction-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chatProactiveAction-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chatProactiveAction-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatProactiveAction-dialog .error-list{font-size:13px}md-dialog.chatProactiveAction-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatProactiveAction-dialog .error-list .error .message{font-weight:500}md-dialog.chatProactiveAction-dialog .error-list .error .md-button{margin:0}md-dialog.chatProactiveAction-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatProactiveAction-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#chat-chatWebsite .header{height:76px;min-height:76px;max-height:76px}#chat-chatWebsite .header .goto-chatWebsites-button{margin-right:16px}#chat-chatWebsite .header .chatWebsite-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#chat-chatWebsite .header .chatWebsite-image img{height:100%;width:auto;max-width:none}#chat-chatWebsite .header .subtitle{margin:6px 0 0 0}#chat-chatWebsite .chatWebsite-detail-form-container{padding:24px;margin-bottom:24px}#chat-chatWebsite .chatWebsite-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#chat-chatWebsite .chatWebsite-detail-form-container .handle{cursor:move}#chat-chatWebsite .chatWebsite-detail-form-container md-input-container md-switch{margin:0!important}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader{position:relative}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader.dropping .drop-text{display:flex}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .upload-button{margin-bottom:16px}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .chatWebsite-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .chatWebsite-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .chatWebsite-image .media{max-height:100%}#chat-chatWebsite md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#chat-chatWebsite md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#chat-chatWebsite md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#chat-chatWebsite md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#chat-chatWebsite .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#chat-chatWebsite .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#chat-chatWebsite .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#chat-chatWebsite .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#chat-chatWebsite .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#chat-chatWebsite .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#chat-chatWebsite .actionAppData{width:150px!important}}@media screen and (max-width:960px){#chat-chatWebsite .actionAppData{width:80px!important}}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}#companies{position:relative}#companies>.header{height:76px;min-height:76px;max-height:76px}#companies>.header .logo .logo-icon{margin:0 16px 0 0}#companies>.header .logo .logo-text{font-size:24px}#companies>.header md-icon{color:#fff}#companies>.header .search-input-wrapper{position:relative}#companies>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#companies>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#companies>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#companies>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#companies>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#companies>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#companies>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#companies>.header.selected-bar .close-button-wrapper{width:244px}#companies>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#companies>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#companies>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#companies #add-company-button{position:fixed;bottom:8px;right:8px;padding:0}#companies #upload-company-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.company-dialog{max-width:720px;width:720px}md-dialog.company-dialog md-dialog-content{display:block;position:relative}md-dialog.company-dialog md-toolbar .title{font-size:17px}md-dialog.company-dialog md-input-container textarea{min-height:150px}md-dialog.company-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.company-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.company-dialog .date-container{padding:16px 0 24px 0}md-dialog.company-dialog .error-list{font-size:13px}md-dialog.company-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.company-dialog .error-list .error .message{font-weight:500}md-dialog.company-dialog .error-list .error .md-button{margin:0}md-dialog.company-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.company-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#contactmanager-company .header{height:76px;min-height:76px;max-height:76px}#contactmanager-company .header .goto-companies-button{margin-right:16px}#contactmanager-company .header .company-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#contactmanager-company .header .company-image img{height:100%;width:auto;max-width:none}#contactmanager-company .header .subtitle{margin:6px 0 0 0}#contactmanager-company .company-detail-form-container{padding:24px;margin-bottom:24px}#contactmanager-company .company-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#contactmanager-company .company-detail-form-container .handle{cursor:move}#contactmanager-company .company-detail-form-container md-input-container md-switch{margin:0!important}#contactmanager-company .company-detail-form-container #company-image-uploader{position:relative}#contactmanager-company .company-detail-form-container #company-image-uploader.dropping .drop-text{display:flex}#contactmanager-company .company-detail-form-container #company-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#contactmanager-company .company-detail-form-container #company-image-uploader .upload-button{margin-bottom:16px}#contactmanager-company .company-detail-form-container #company-image-uploader .company-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#contactmanager-company .company-detail-form-container #company-image-uploader .company-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#contactmanager-company .company-detail-form-container #company-image-uploader .company-image .media{max-height:100%}#contactmanager-company md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#contactmanager-company md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#contactmanager-company md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#contactmanager-company md-table-container.font-size-12 td.md-cell{font-size:12px!important}#contacts{position:relative}#contacts>.header{height:76px;min-height:76px;max-height:76px}#contacts>.header .logo .logo-icon{margin:0 16px 0 0}#contacts>.header .logo .logo-text{font-size:24px}#contacts>.header md-icon{color:#fff}#contacts>.header .search-input-wrapper{position:relative}#contacts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#contacts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#contacts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#contacts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#contacts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#contacts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#contacts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#contacts>.header.selected-bar .close-button-wrapper{width:244px}#contacts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#contacts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#contacts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#contacts #add-contact-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.cm-contact-dialog{max-width:720px;width:720px}md-dialog.cm-contact-dialog md-dialog-content{display:block;position:relative}md-dialog.cm-contact-dialog md-toolbar .title{font-size:17px}md-dialog.cm-contact-dialog md-input-container textarea{min-height:150px}md-dialog.cm-contact-dialog .date-container{padding:16px 0 24px 0}md-dialog.cm-contact-dialog .error-list{font-size:13px}md-dialog.cm-contact-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cm-contact-dialog .error-list .error .message{font-weight:500}md-dialog.cm-contact-dialog .error-list .error .md-button{margin:0}md-dialog.cm-contact-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cm-contact-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.cm-contact-dialog{max-width:720px;width:720px}md-dialog.cm-contact-dialog md-dialog-content{display:block;position:relative}md-dialog.cm-contact-dialog md-toolbar .title{font-size:17px}md-dialog.cm-contact-dialog md-input-container textarea{min-height:150px}md-dialog.cm-contact-dialog .date-container{padding:16px 0 24px 0}md-dialog.cm-contact-dialog .error-list{font-size:13px}md-dialog.cm-contact-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cm-contact-dialog .error-list .error .message{font-weight:500}md-dialog.cm-contact-dialog .error-list .error .md-button{margin:0}md-dialog.cm-contact-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cm-contact-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.hopper-dialog{max-width:720px;width:720px}md-dialog.hopper-dialog md-dialog-content{display:block;position:relative}md-dialog.hopper-dialog md-toolbar .title{font-size:17px}md-dialog.hopper-dialog md-input-container textarea{min-height:150px}md-dialog.hopper-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.hopper-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.hopper-dialog .date-container{padding:16px 0 24px 0}md-dialog.hopper-dialog .error-list{font-size:13px}md-dialog.hopper-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.hopper-dialog .error-list .error .message{font-weight:500}md-dialog.hopper-dialog .error-list .error .md-button{margin:0}md-dialog.hopper-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.hopper-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#cm-contact .pointer{cursor:pointer}#cm-contact .header{height:76px;min-height:76px;max-height:76px}#cm-contact .header .goto-contacts-button{margin-right:16px}#cm-contact .header .contact-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#cm-contact .header .contact-image img{height:100%;width:auto;max-width:none}#cm-contact .header .subtitle{margin:6px 0 0 0}#cm-contact .contact-detail-form-container{padding:24px;margin-bottom:24px}#cm-contact .contact-detail-form-container md-input-container:not(.md-input-invalid)>md-icon.email{color:green}#cm-contact .contact-detail-form-container md-input-container:not(.md-input-invalid)>md-icon.firstname{color:#1e90ff}#cm-contact .contact-detail-form-container md-input-container.md-input-invalid>md-icon.email,#cm-contact .contact-detail-form-container md-input-container.md-input-invalid>md-icon.firstname{color:red}#cm-contact .contact-detail-form-container .hint{position:absolute;left:2px;right:auto;bottom:7px;font-size:10px;line-height:14px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.import-dialog{max-width:720px;width:720px}md-dialog.import-dialog md-dialog-content{display:block;position:relative}md-dialog.import-dialog md-toolbar .title{font-size:17px}md-dialog.import-dialog md-input-container textarea{min-height:150px}md-dialog.import-dialog .date-container{padding:16px 0 24px 0}md-dialog.import-dialog .error-list{font-size:13px}md-dialog.import-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.import-dialog .error-list .error .message{font-weight:500}md-dialog.import-dialog .error-list .error .md-button{margin:0}md-dialog.import-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.import-dialog .error-list .info{background-color:rgba(24,160,135,.08);border:1px solid rgba(24,160,135,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.import-dialog .error-list .info .message{font-weight:500}md-dialog.import-dialog .error-list .info .md-button{margin:0}md-dialog.import-dialog .error-list .info:last-child{margin-bottom:30px}md-dialog.import-dialog .contact-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}md-dialog.import-dialog .contact-image img{height:100%;width:auto;max-width:none}md-dialog.import-dialog .contact-image .media{max-height:100%}md-dialog.import-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.cm-contact-dialog{max-width:720px;width:720px}md-dialog.cm-contact-dialog md-dialog-content{display:block;position:relative}md-dialog.cm-contact-dialog md-toolbar .title{font-size:17px}md-dialog.cm-contact-dialog md-input-container textarea{min-height:150px}md-dialog.cm-contact-dialog .date-container{padding:16px 0 24px 0}md-dialog.cm-contact-dialog .error-list{font-size:13px}md-dialog.cm-contact-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cm-contact-dialog .error-list .error .message{font-weight:500}md-dialog.cm-contact-dialog .error-list .error .md-button{margin:0}md-dialog.cm-contact-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cm-contact-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.globalCustomField-dialog{max-width:720px;width:720px}md-dialog.globalCustomField-dialog md-dialog-content{display:block;position:relative}md-dialog.globalCustomField-dialog md-toolbar .title{font-size:17px}md-dialog.globalCustomField-dialog md-input-container textarea{min-height:150px}md-dialog.globalCustomField-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.globalCustomField-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.globalCustomField-dialog .date-container{padding:16px 0 24px 0}md-dialog.globalCustomField-dialog .error-list{font-size:13px}md-dialog.globalCustomField-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.globalCustomField-dialog .error-list .error .message{font-weight:500}md-dialog.globalCustomField-dialog .error-list .error .md-button{margin:0}md-dialog.globalCustomField-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.globalCustomField-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#globalCustomFields{position:relative}#globalCustomFields>.header{height:76px;min-height:76px;max-height:76px}#globalCustomFields>.header .logo .logo-icon{margin:0 16px 0 0}#globalCustomFields>.header .logo .logo-text{font-size:24px}#globalCustomFields>.header md-icon{color:#fff}#globalCustomFields>.header .search-input-wrapper{position:relative}#globalCustomFields>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#globalCustomFields>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#globalCustomFields>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#globalCustomFields>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#globalCustomFields>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#globalCustomFields>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#globalCustomFields>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#globalCustomFields>.header.selected-bar .close-button-wrapper{width:244px}#globalCustomFields>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#globalCustomFields>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#globalCustomFields>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#globalCustomFields #add-globalCustomField-button{position:fixed;bottom:8px;right:8px;padding:0}#globalCustomFields #upload-globalCustomField-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.list-dialog{max-width:720px;width:720px}md-dialog.list-dialog md-dialog-content{display:block;position:relative}md-dialog.list-dialog md-toolbar .title{font-size:17px}md-dialog.list-dialog md-input-container textarea{min-height:150px}md-dialog.list-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.list-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.list-dialog .date-container{padding:16px 0 24px 0}md-dialog.list-dialog .error-list{font-size:13px}md-dialog.list-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.list-dialog .error-list .error .message{font-weight:500}md-dialog.list-dialog .error-list .error .md-button{margin:0}md-dialog.list-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.list-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.customField-dialog{max-width:720px;width:720px}md-dialog.customField-dialog md-dialog-content{display:block;position:relative}md-dialog.customField-dialog md-toolbar .title{font-size:17px}md-dialog.customField-dialog md-input-container textarea{min-height:150px}md-dialog.customField-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.customField-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.customField-dialog .date-container{padding:16px 0 24px 0}md-dialog.customField-dialog .error-list{font-size:13px}md-dialog.customField-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.customField-dialog .error-list .error .message{font-weight:500}md-dialog.customField-dialog .error-list .error .md-button{margin:0}md-dialog.customField-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.customField-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#contactmanager-list .header{height:76px;min-height:76px;max-height:76px}#contactmanager-list .header .goto-lists-button{margin-right:16px}#contactmanager-list .header .list-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#contactmanager-list .header .list-image img{height:100%;width:auto;max-width:none}#contactmanager-list .header .subtitle{margin:6px 0 0 0}#contactmanager-list .list-detail-form-container{padding:24px;margin-bottom:24px}#contactmanager-list .list-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#contactmanager-list .list-detail-form-container .handle{cursor:move}#contactmanager-list .list-detail-form-container md-input-container md-switch{margin:0!important}#contactmanager-list .list-detail-form-container #list-image-uploader{position:relative}#contactmanager-list .list-detail-form-container #list-image-uploader.dropping .drop-text{display:flex}#contactmanager-list .list-detail-form-container #list-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#contactmanager-list .list-detail-form-container #list-image-uploader .upload-button{margin-bottom:16px}#contactmanager-list .list-detail-form-container #list-image-uploader .list-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#contactmanager-list .list-detail-form-container #list-image-uploader .list-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#contactmanager-list .list-detail-form-container #list-image-uploader .list-image .media{max-height:100%}#contactmanager-list md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#contactmanager-list md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#contactmanager-list md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#contactmanager-list md-table-container.font-size-12 td.md-cell{font-size:12px!important}#lists{position:relative}#lists>.header{height:76px;min-height:76px;max-height:76px}#lists>.header .logo .logo-icon{margin:0 16px 0 0}#lists>.header .logo .logo-text{font-size:24px}#lists>.header md-icon{color:#fff}#lists>.header .search-input-wrapper{position:relative}#lists>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#lists>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#lists>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#lists>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#lists>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#lists>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#lists>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#lists>.header.selected-bar .close-button-wrapper{width:244px}#lists>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#lists>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#lists>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#lists #add-list-button{position:fixed;bottom:8px;right:8px;padding:0}#lists #upload-list-button{position:fixed;bottom:8px;right:8px;padding:0}#dashboard-custom .filter-header{background-image:url(/assets/images/backgrounds/header-bg.png);color:#fff}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#agent-general{width:100%;height:100%;overflow:hidden}#agent-general .agent-content{width:100%;height:100%;overflow:auto}#agent-general .agent-content.overflow-hidden{overflow:hidden}#agent-general .agent-content md-tabs{width:100%;height:100%}#agent-general .agent-content md-tabs md-tabs-content-wrapper{width:100%;height:calc(100% - 48px)}#agent-general .agent-content md-tabs md-tabs-content-wrapper md-tab-content.md-active{width:100%;height:100%;overflow:auto}#agent-general .agent-general-home-navbar{flex-grow:1;overflow-y:auto;overflow-x:hidden}#agent-general .agent-general-home-navbar::-webkit-scrollbar{width:0;background:0 0}#agent-general .agent-general-home-navbar::-webkit-scrollbar-thumb{background:0 0;border-radius:0}#agent-general .agent-general-home-sections{width:100%;height:100%;overflow:auto}#agent-general .badge{min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transition:opacity .2s ease-in-out .1s}#agent-general .table-header{background-image:url(/assets/images/backgrounds/header-bg.png);color:#fff;overflow-x:auto}#agent-general .table-header::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.2)}#agent-general .table-header .md-toolbar-tools div md-select .md-select-value.md-select-placeholder{color:#fff}#agent-general .table-header .md-toolbar-tools div md-select[disabled] .md-select-value.md-select-placeholder{color:#fff}#agent-general .table-header .md-toolbar-tools div md-select[disabled] .md-select-value.md-select-placeholder .md-select-icon{display:none}#agent-general .table-header ms-quick-filter .quick-filter-date-clear-button{color:#fff}#agent-general .tooltip-preview{position:relative;display:inline-block;text-decoration:underline}#agent-general .tooltip-preview .tooltip-preview-text{display:none;opacity:0;width:500px;height:216px;position:fixed;white-space:pre-line;z-index:99999999;overflow:hidden;transition:opacity cubic-bezier(.075,.82,.165,1)}#agent-general .tooltip-preview .tooltip-preview-text .tooltip-preview-text-container{width:100%;height:100%;overflow:hidden}#agent-general .tooltip-preview .tooltip-preview-text .tooltip-preview-text-container .email-preview-message{display:block;display:-webkit-box;margin:0 auto;width:100%;height:100%;line-height:1.4;-webkit-line-clamp:10;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-all}#agent-general .tooltip-preview:hover .tooltip-preview-text{display:block;opacity:1}#agent-general .reload-list md-icon{color:#fff}#agent-general .advanced-search md-icon{color:#fff}#agent-general .create-new md-icon{color:#fff}#agent-general div.draft-manager-bar{background-color:#f5f5f5;position:sticky;height:34px;bottom:0;border-top:1px solid #e0e0e0}#agent-general div.draft-manager-bar ms-tab-scroll{overflow:hidden}#agent-general div.draft-manager-bar ms-tab-scroll div.draft-manager-tab{height:34px;border-right:1px solid #e0e0e0}#agent-general td.width-5,#agent-general th.width-5{width:5px!important;min-width:auto!important;max-width:none!important}#agent-general td.width-10,#agent-general th.width-10{width:10px!important;min-width:auto!important;max-width:none!important}#agent-general td.width-15,#agent-general th.width-15{width:15px!important;min-width:auto!important;max-width:none!important}#agent-general td.no-padding,#agent-general th.no-padding{padding:0!important}#agent-general span.contact-text{width:100px!important}#agent-general span.subject-text{width:300px!important}#agent-general span.no-margin-bottom{margin-bottom:0!important}#agent-general span.no-margin-top{margin-top:0!important}#agent-general md-table-container.interactions-list thead tr th:not(.no-padding):not(.id-header){padding:0 20px 0 0!important}#agent-general md-table-container.interactions-list tbody tr td:not(.no-padding):not(.actions-padding):not(.id){padding:0 20px 0 0!important}#agent-general td.actions-padding{padding:0 8px 0 0!important}#agent-general md-toolbar.md-table-toolbar[disabled]{pointer-events:none}#agent-general md-toolbar.md-table-toolbar[disabled] ms-search-bar{opacity:.7}#agent-general md-toolbar.md-table-toolbar[disabled] ms-quick-filter{opacity:.7}#agent-general md-toolbar.md-table-toolbar[disabled] button.advanced-search,#agent-general md-toolbar.md-table-toolbar[disabled] button.interaction-reload{opacity:.7}#agent-general md-card.call-info-card{min-width:220px}#agent-general md-card.call-info-card md-card-content,#agent-general md-card.call-info-card md-card-header{padding:10px!important}#agent-general md-card.call-info-card button.reload-button{padding:0;height:22px;width:auto}@media screen and (max-width:1280px){#agent-general span.contact-text{width:100px!important}}@media screen and (max-width:1920px){#agent-general span.contact-text{width:150px!important}}#agent-general-dialog{position:fixed;width:100%;height:100%}#agent-general-dialog .agent-content{position:fixed;top:0;bottom:0;left:0;right:0}body .md-select-menu-container{z-index:110}.md-toolbar-tools{font-size:12px}div.toolbar-quick-filter[disabled]{pointer-events:none;opacity:.7}md-dialog.agent-dialog{max-width:720px;width:720px}md-dialog.agent-dialog md-dialog-content{display:block;position:relative}md-dialog.agent-dialog md-toolbar .title{font-size:17px}md-dialog.agent-dialog md-input-container textarea{min-height:150px}md-dialog.agent-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.agent-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.agent-dialog .date-container{padding:16px 0 24px 0}md-dialog.agent-dialog .error-list{font-size:13px}md-dialog.agent-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.agent-dialog .error-list .error .message{font-weight:500}md-dialog.agent-dialog .error-list .error .md-button{margin:0}md-dialog.agent-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.agent-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.agent-dialog{max-width:720px;width:720px}md-dialog.agent-dialog md-dialog-content{display:block;position:relative}md-dialog.agent-dialog md-toolbar .title{font-size:17px}md-dialog.agent-dialog md-input-container textarea{min-height:150px}md-dialog.agent-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.agent-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.agent-dialog .date-container{padding:16px 0 24px 0}md-dialog.agent-dialog .error-list{font-size:13px}md-dialog.agent-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.agent-dialog .error-list .error .message{font-weight:500}md-dialog.agent-dialog .error-list .error .md-button{margin:0}md-dialog.agent-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.agent-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.contact-trigger-dialog{max-width:720px;width:720px}md-dialog.contact-trigger-dialog md-dialog-content{display:block;position:relative;max-height:400px;height:400px}md-dialog.contact-trigger-dialog md-toolbar{background-image:url(/assets/images/backgrounds/header-bg.png);background-position:top}md-dialog.contact-trigger-dialog md-toolbar .title{font-size:17px}md-dialog.contact-trigger-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}md-dialog.contact-trigger-dialog md-dialog-actions button.select-button{position:absolute;right:0;margin-right:16px}md-dialog md-grid-list.one-row-layout{height:150px;max-height:150px}md-dialog md-grid-list.two-rows-layout{height:300px;max-height:300px}md-dialog md-card.contact-info:hover{background-color:#e9eef1ad}@media screen and (max-width:1280px){md-dialog.contact-trigger-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.contact-trigger-dialog{width:90%}}md-dialog.agent-dialog{max-width:720px;width:720px}md-dialog.agent-dialog md-dialog-content{display:block;position:relative}md-dialog.agent-dialog md-toolbar .title{font-size:17px}md-dialog.agent-dialog md-input-container textarea{min-height:150px}md-dialog.agent-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.agent-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.agent-dialog .date-container{padding:16px 0 24px 0}md-dialog.agent-dialog .error-list{font-size:13px}md-dialog.agent-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.agent-dialog .error-list .error .message{font-weight:500}md-dialog.agent-dialog .error-list .error .md-button{margin:0}md-dialog.agent-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.agent-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.details-dialog{max-width:500px;width:500px}md-dialog.details-dialog md-dialog-content{display:block;position:relative}md-dialog.details-dialog md-toolbar .title{font-size:17px}md-dialog.details-dialog md-input-container textarea{min-height:150px}md-dialog.details-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.details-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.details-dialog .date-container{padding:16px 0 24px 0}md-dialog.details-dialog .error-list{font-size:13px}md-dialog.details-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.details-dialog .error-list .error .message{font-weight:500}md-dialog.details-dialog .error-list .error .md-button{margin:0}md-dialog.details-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.details-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#interaction-app .tags{font-size:12px}#interaction-app .tags .tag{border-radius:2px;padding:3px 8px;background-color:rgba(0,0,0,.08)}#interaction-app .tags .tag .tag-color{width:8px;height:8px;margin-right:8px;border-radius:50%}#interaction-app .content-card{position:relative;height:100%}#interaction-app .content-card .interaction{background:linear-gradient(to bottom,rgba(255,255,255,.8) 0,rgba(255,255,255,.6) 20%,rgba(255,255,255,.8))}#interaction-app .content-card .interaction .avatar-small{width:30px;min-width:30px;height:30px;line-height:30px;margin:0 8px 0 0;border-radius:50%;font-size:17px;font-weight:500;text-align:center;color:#fff}#interaction-app .content-card .interaction .interaction-agents{min-height:40px;background-color:#f3f4f5;color:rgba(0,0,0,.87);border-bottom:1px solid rgba(0,0,0,.08)}#interaction-app .content-card .interaction .interaction-agents .responsive-interactions-button{padding:0}#interaction-app .content-card .interaction .interaction-agents .interaction-contact{cursor:pointer}#interaction-app .content-card .interaction .interaction-agents .interaction-contact .avatar{margin-right:16px}#interaction-app .content-card .interaction .interaction-toolbar{min-height:64px;background-color:#f3f4f5;color:rgba(0,0,0,.87);border-bottom:1px solid rgba(0,0,0,.08)}#interaction-app .content-card .interaction .interaction-toolbar md-icon{color:rgba(0,0,0,.87)}#interaction-app .content-card .interaction .interaction-toolbar .responsive-interactions-button{padding:0}#interaction-app .content-card .interaction .interaction-toolbar .interaction-contact{cursor:pointer}#interaction-app .content-card .interaction .interaction-toolbar .interaction-contact .avatar{margin-right:16px}#interaction-app .content-card .interaction .cannedarea{margin-right:7px;font-size:14px;border:1px solid #ccc;border-radius:3px;align-self:stretch}#interaction-app .content-card .interaction .cannedarea md-autocomplete-wrap{padding:0 1em}#interaction-app .content-card .interaction .emojionearea{margin-right:7px}#interaction-app .content-card .interaction #interaction-content{background:url(/assets/images/patterns/circles-light.png) repeat}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content{padding:24px 0}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .subject{color:rgba(0,0,0,.54)}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .subject .subject-text{margin-right:4px;text-transform:lowercase}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info{padding-bottom:16px}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .avatar{margin-right:16px}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .name{margin-right:8px;font-weight:500}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .toggle-details{padding-top:16px;cursor:pointer;font-weight:500}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .details{padding-top:8px}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .details .title{font-weight:500;margin-right:6px}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .details .detail{color:rgba(0,0,0,.54)}#interaction-app .content-card .interaction #interaction-content .message-row .bubble{position:relative;padding:6px 7px 8px 9px;background-color:#fff;border:1px solid #dcdfe1;border-radius:6px;word-break:break-word}#interaction-app .content-card .interaction #interaction-content .message-row .bubble:after,#interaction-app .content-card .interaction #interaction-content .message-row .bubble:before{content:' ';position:absolute;width:0;height:0}#interaction-app .content-card .interaction #interaction-content .message-row .bubble:after{left:-7px;right:auto;top:0;bottom:auto;border:11px solid;border-color:#fff transparent transparent transparent}#interaction-app .content-card .interaction #interaction-content .message-row .bubble:before{left:-9px;right:auto;top:-1px;bottom:auto;border:8px solid;border-color:#dcdfe1 transparent transparent transparent}#interaction-app .content-card .interaction #interaction-content .message-row .bubble .time{font-size:11px;margin-top:0;text-align:right}#interaction-app .content-card .interaction #interaction-content .message-row .bubble .message{white-space:pre-wrap}#interaction-app .content-card .interaction #interaction-content .message-row .bubble .message span{word-break:break-all}#interaction-app .content-card .interaction #interaction-content .message-row.in{padding:5px}#interaction-app .content-card .interaction #interaction-content .message-row.in .avatar{margin:0 16px 0 0}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned{padding:5px;align-items:flex-end}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned .avatar{order:2;margin:0 0 0 16px}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned .bubble{margin-left:auto;order:1}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned .bubble:after{right:-9px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned .bubble:before{right:-11px;left:auto;-moz-transform:scaleX(-1);-o-transform:scaleX(-1);-webkit-transform:scaleX(-1);transform:scaleX(-1)}#interaction-app .content-card .interaction #interaction-content .message-row.out{padding:5px;align-items:flex-end}#interaction-app .content-card .interaction #interaction-content .message-row.out .avatar{order:2;margin:0 0 0 16px}#interaction-app .content-card .interaction #interaction-content .message-row.out .bubble{margin-left:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#interaction-app .content-card .interaction #interaction-content .message-row.out .bubble:after{right:-7px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#interaction-app .content-card .interaction #interaction-content .message-row.out .bubble:before{right:-9px;left:auto;top:auto;bottom:-1px;border-color:transparent transparent #dfebe0 transparent}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned{padding:5px}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned .avatar{order:1;margin:0 16px 0 0}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned .bubble{background-color:#e8f5e9;border:1px solid #dfebe0;order:2}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned .bubble:after{right:-7px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned .bubble:before{right:-9px;left:auto;top:auto;bottom:-1px;border-color:transparent transparent #dfebe0 transparent}#interaction-app .content-card .interaction .interaction-footer{min-height:64px;max-height:180px;background-color:#f3f4f5;color:rgba(0,0,0,.87);border-top:1px solid rgba(0,0,0,.08);padding:8px 8px 8px 16px}#interaction-app .content-card .interaction .interaction-footer .reply-form md-input-container{margin:0;padding-right:16px}#interaction-app .content-card .interaction .interaction-footer .reply-form md-input-container textarea{overflow:auto;max-height:80px;transition:height .2s ease}#interaction-app .content-card .interaction .interaction-footer .reply-form md-input-container textarea.grow{height:80px}#interaction-app .content-card .interaction .interaction-footer .reply-form md-input-container .md-errors-spacer{display:none}#interaction-app .content-card .interaction .interaction-footer .reply-form .md-button{margin:0}#interaction-app .content-card .info md-list-item{min-height:40px;height:52px}#interaction-app .content-card .start-point{background:linear-gradient(to bottom,rgba(255,255,255,.8) 0,rgba(255,255,255,.6) 20%,rgba(255,255,255,.8))}#interaction-app .content-card .start-point .big-circle{background:linear-gradient(to bottom,rgba(255,255,255,.8) 0,rgba(255,255,255,.6) 20%,rgba(255,255,255,.8));border-radius:50%;width:300px;height:300px;line-height:300px;text-align:center}#interaction-app .content-card .start-point .app-title{font-weight:500;font-size:32px;margin:12px 0}#interaction-app .content-card .start-point .secondary-text{font-size:16px}#interaction-app .content-card .sidenav md-toolbar{border-bottom:1px solid rgba(0,0,0,.08)}#interaction-app .content-card .sidenav md-toolbar .md-toolbar-tools-bottom .search{height:36px;line-height:36px;padding:8px;background:#fff;font-size:13px}#interaction-app .content-card .sidenav md-toolbar .md-toolbar-tools-bottom .search .icon{margin:0;color:rgba(0,0,0,.54)}#interaction-app .content-card .sidenav md-toolbar .md-toolbar-tools-bottom .search input{padding-left:12px;height:36px;color:rgba(0,0,0,.54)}#interaction-app .content-card .sidenav md-list.contact-list,#interaction-app .content-card .sidenav md-list.interaction-list{position:relative;transition:all .2s ease-out}#interaction-app .content-card .sidenav md-list.contact-list .subheader,#interaction-app .content-card .sidenav md-list.contact-list md-list-item,#interaction-app .content-card .sidenav md-list.interaction-list .subheader,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item{position:absolute;right:0;left:0;width:100%;transition:transform .2s ease-out;background:#fff;will-change:transform}#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-leave,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-leave,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-leave,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-leave{transform:translateY(0);display:none}#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-leave.ng-leave-active,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-leave.ng-leave-active,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-leave.ng-leave-active,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-leave.ng-leave-active{transform:translateY(-100%)}#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-hide,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-hide,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-hide,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-hide{display:none}#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-hide-add-active,#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-hide-remove-active,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-hide-add-active,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-hide-remove-active,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-hide-add-active,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-hide-remove-active,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-hide-add-active,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-hide-remove-active{display:block;transition-property:all}#interaction-app .content-card .sidenav md-list.contact-list .subheader,#interaction-app .content-card .sidenav md-list.interaction-list .subheader{padding-left:16px;font-size:20px;font-weight:300;height:88px;line-height:88px}#interaction-app .content-card .sidenav .no-results-message{position:absolute;width:100%;height:88px;padding:16px;background:#fff;font-size:15px;font-weight:400}#interaction-app .avatar-wrapper{position:relative}#interaction-app .avatar-wrapper .avatar{margin-top:0;margin-bottom:0}#interaction-app .status{position:absolute;top:28px;left:28px;border-radius:50%}#interaction-app .status.online{color:#4caf50}#interaction-app .status.online:before{content:'\e709'}#interaction-app .status.do-not-disturb{color:#f44336}#interaction-app .status.do-not-disturb:before{content:'\e912'}#interaction-app .status.away{background-color:#ffc107;color:#fff}#interaction-app .status.away:before{content:'\e727'}#interaction-app .status.offline{color:#4caf50;background-color:#fff}#interaction-app .status.offline:before{content:'\e704'}#interaction-app .editable-wrap{position:relative}#interaction-app .editable-wrap .editable-controls{display:flex;flex-direction:row;align-items:center;width:100%}#interaction-app .editable-wrap .editable-controls .editable-input{width:inherit;background-color:#fff;padding:8px;border:1px solid rgba(0,0,0,.12)}#interaction-app .editable-wrap .editable-controls .editable-buttons{display:inherit}#interaction-app .editable-wrap .editable-controls .editable-buttons .md-button{margin:0}#interaction-app .editable-wrap .editable-controls .editable-buttons .md-button:first-of-type{padding-right:0}#interaction-app .editable-wrap .editable-controls .editable-buttons .md-button .icon-cancel{color:rgba(0,0,0,.32)}#interaction-app .editable-click{cursor:pointer;text-decoration:none;color:inherit;border-bottom:none}#interaction-app .emoji-picker-icon{right:5px;cursor:pointer}#interaction-app .input-show-hide{transition:all linear .5s}#interaction-app .input-show-hide.ng-hide{opacity:0}#interaction-app div.interaction-reply-button-container{display:inline;padding-bottom:14px}#timeline{position:relative;height:auto;padding-bottom:30px}#timeline:before{display:block;position:absolute;z-index:10;content:'';width:2px;background:rgba(0,0,0,.08);top:0;left:50%;bottom:0;margin-left:-1px}#timeline .ms-timeline-item{overflow:hidden;position:relative;z-index:20;width:100%;margin:0 auto;max-width:1200px}#timeline .ms-timeline-item .timeline-card{order:1}#timeline .ms-timeline-item .timeline-card .interaction .header .avatar .image{display:block;width:40px;height:40px;border-radius:20px}#timeline .ms-timeline-item .timeline-card .interaction .media .image{width:100%}#timeline .ms-timeline-item .timeline-point{position:absolute;width:40px;height:40px;line-height:40px;text-align:center;border-radius:50%;left:50%;margin:16px 0 0 -28px;order:2}#timeline .ms-timeline-item .timeline-point md-icon{color:#fff}#timeline .ms-timeline-item .timeline-detail{flex:50% 0 0;padding-top:28px;order:3}#timeline .ms-timeline-item .timeline-detail .time{font-size:15px;padding-left:68px}#timeline .ms-timeline-item .timeline-detail .event{color:rgba(0,0,0,.54);padding-left:68px}#timeline .ms-timeline-item:nth-child(odd) .timeline-card{flex-direction:row-reverse}#timeline .ms-timeline-item:nth-child(even) .timeline-card{order:3;padding-right:0}#timeline .ms-timeline-item:nth-child(even) .timeline-card ms-card{padding-left:84px}#timeline .ms-timeline-item:nth-child(even) .timeline-detail{order:1;padding-left:0;text-align:right}#timeline .ms-timeline-item:nth-child(even) .timeline-detail .event,#timeline .ms-timeline-item:nth-child(even) .timeline-detail .time{padding-right:68px}#timeline .ms-timeline-item:first-child{padding-top:15px}#timeline .ms-timeline-item.animate .timeline-card{animation:slide-in-left .4s}#timeline .ms-timeline-item.animate .timeline-point{animation:slide-in-bottom .4s}#timeline .ms-timeline-item.animate .timeline-detail{animation:slide-in-right .4s}#timeline .ms-timeline-item:nth-child(even).animate .timeline-card{animation:slide-in-right .4s}#timeline .ms-timeline-item:nth-child(even).animate .timeline-detail{animation:slide-in-left .4s}#timeline.timeline-left .ms-timeline-item .timeline-card{order:1}#timeline.timeline-left .ms-timeline-item .timeline-card ms-card{padding-right:68px;padding-left:0;margin-left:auto}#timeline.timeline-left .ms-timeline-item .timeline-detail{order:3;text-align:left}#timeline.timeline-left .ms-timeline-item.animate .timeline-card{animation:slide-in-left .4s}#timeline.timeline-left .ms-timeline-item.animate .timeline-detail{animation:slide-in-right .4s}#timeline.timeline-right .ms-timeline-item .timeline-card{order:3}#timeline.timeline-right .ms-timeline-item .timeline-card ms-card{padding-left:68px;padding-right:0;margin-right:auto}#timeline.timeline-right .ms-timeline-item .timeline-detail{order:1;text-align:right}#timeline.timeline-right .ms-timeline-item .timeline-detail .event,#timeline.timeline-right .ms-timeline-item .timeline-detail .time{padding-right:68px;padding-left:0}#timeline.timeline-right .ms-timeline-item.animate .timeline-card{animation:slide-in-right .4s}#timeline.timeline-right .ms-timeline-item.animate .timeline-detail{animation:slide-in-left .4s}@media screen and (max-width:1280px){#timeline .ms-timeline-item,#timeline.timeline-left .ms-timeline-item,#timeline.timeline-right .ms-timeline-item{display:block}#timeline .ms-timeline-item .timeline-point,#timeline.timeline-left .ms-timeline-item .timeline-point,#timeline.timeline-right .ms-timeline-item .timeline-point{position:relative;left:auto;margin:0 auto 16px auto;padding:0}#timeline .ms-timeline-item .timeline-detail,#timeline.timeline-left .ms-timeline-item .timeline-detail,#timeline.timeline-right .ms-timeline-item .timeline-detail{padding:2px;margin-bottom:16px}#timeline .ms-timeline-item .timeline-detail .event,#timeline .ms-timeline-item .timeline-detail .time,#timeline.timeline-left .ms-timeline-item .timeline-detail .event,#timeline.timeline-left .ms-timeline-item .timeline-detail .time,#timeline.timeline-right .ms-timeline-item .timeline-detail .event,#timeline.timeline-right .ms-timeline-item .timeline-detail .time{padding-right:0;padding-left:0;text-align:center}#timeline .ms-timeline-item .timeline-card ms-card,#timeline.timeline-left .ms-timeline-item .timeline-card ms-card,#timeline.timeline-right .ms-timeline-item .timeline-card ms-card{margin:0 auto;padding:0}#timeline .ms-timeline-item:nth-child(even) .timeline-point,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-point,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-point{position:relative;left:auto;margin:0 auto 16px auto;padding:0}#timeline .ms-timeline-item:nth-child(even) .timeline-detail,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-detail,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-detail{padding:2px;margin-bottom:16px}#timeline .ms-timeline-item:nth-child(even) .timeline-detail .event,#timeline .ms-timeline-item:nth-child(even) .timeline-detail .time,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-detail .event,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-detail .time,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-detail .event,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-detail .time{padding-right:0;padding-left:0;text-align:center}#timeline .ms-timeline-item:nth-child(even) .timeline-card ms-card,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-card ms-card,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-card ms-card{margin:0 auto;padding:0}}md-dialog.compose-dialog{max-width:720px;width:720px}md-dialog.compose-dialog.mail-no-secret{max-height:97%;max-width:90%!important;width:100%!important}md-dialog.compose-dialog md-dialog-content{display:block;position:relative}md-dialog.compose-dialog md-toolbar .title{font-size:17px}md-dialog.compose-dialog md-toolbar .vertical-divider{position:absolute;border-right-width:.5px;border-right-style:solid;height:100%}md-dialog.compose-dialog md-chips md-chip{font-size:12px}md-dialog.compose-dialog md-chips .md-chip-input-container{width:100%}md-dialog.compose-dialog .to{position:relative}md-dialog.compose-dialog .to.hidden-cc input{padding-right:32px}md-dialog.compose-dialog .to.hidden-cc.hidden-bcc input{padding-right:56px}md-dialog.compose-dialog .to.hidden-bcc input{padding-right:32px}md-dialog.compose-dialog .to .cc-bcc{position:absolute;bottom:8px;right:0}md-dialog.compose-dialog .to .cc-bcc .show-bcc,md-dialog.compose-dialog .to .cc-bcc .show-cc{cursor:pointer;font-size:12px}md-dialog.compose-dialog .to .cc-bcc .show-bcc{margin-left:8px}md-dialog.compose-dialog .attachment-list{font-size:13px}md-dialog.compose-dialog .attachment-list .attachment{background-color:rgba(0,0,0,.08);border:1px solid rgba(0,0,0,.16);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.compose-dialog .attachment-list .attachment .filename{font-weight:500}md-dialog.compose-dialog .attachment-list .attachment .md-button{margin:0}md-dialog.compose-dialog .attachment-list .attachment:last-child{margin-bottom:0}md-dialog.compose-dialog .error-list{font-size:13px}md-dialog.compose-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.compose-dialog .error-list .error .message{font-weight:500}md-dialog.compose-dialog .error-list .error .md-button{margin:0}md-dialog.compose-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.compose-dialog .emojionearea{max-width:700px;min-height:300px}md-dialog.compose-dialog md-dialog-actions{position:relative;justify-content:space-between;border-top:1px solid rgba(0,0,0,.12);background-color:rgba(0,0,0,.03)}@media screen and (max-width:960px){md-dialog.compose-dialog{width:80%}}@media screen and (max-width:600px){md-dialog.compose-dialog{width:90%}}md-dialog.disposition-dialog{max-width:720px;width:720px}md-dialog.disposition-dialog md-dialog-content{display:block;position:relative}md-dialog.disposition-dialog md-toolbar .title{font-size:17px}md-dialog.disposition-dialog md-input-container textarea{min-height:150px}md-dialog.disposition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.disposition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.disposition-dialog .date-container{padding:16px 0 24px 0}md-dialog.disposition-dialog .error-list{font-size:13px}md-dialog.disposition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.disposition-dialog .error-list .error .message{font-weight:500}md-dialog.disposition-dialog .error-list .error .md-button{margin:0}md-dialog.disposition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.disposition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.disposition-dialog{max-width:720px;width:720px}md-dialog.disposition-dialog md-dialog-content{display:block;position:relative}md-dialog.disposition-dialog md-toolbar .title{font-size:17px}md-dialog.disposition-dialog md-input-container textarea{min-height:150px}md-dialog.disposition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.disposition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.disposition-dialog .date-container{padding:16px 0 24px 0}md-dialog.disposition-dialog .error-list{font-size:13px}md-dialog.disposition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.disposition-dialog .error-list .error .message{font-weight:500}md-dialog.disposition-dialog .error-list .error .md-button{margin:0}md-dialog.disposition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.disposition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.disposition-dialog{max-width:720px;width:720px}md-dialog.disposition-dialog md-dialog-content{display:block;position:relative}md-dialog.disposition-dialog md-toolbar .title{font-size:17px}md-dialog.disposition-dialog md-input-container textarea{min-height:150px}md-dialog.disposition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.disposition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.disposition-dialog .date-container{padding:16px 0 24px 0}md-dialog.disposition-dialog .error-list{font-size:13px}md-dialog.disposition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.disposition-dialog .error-list .error .message{font-weight:500}md-dialog.disposition-dialog .error-list .error .md-button{margin:0}md-dialog.disposition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.disposition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#dashboard-general>.center>.header{height:160px;min-height:160px;max-height:160px;padding-bottom:0}#dashboard-general>.center>.header .selected-general{background:rgba(0,0,0,.12);color:#fff;padding:8px 16px;height:40px;line-height:24px;font-size:16px}#dashboard-general>.center>.header .general-selector{margin-left:1px;border-radius:0;background:rgba(0,0,0,.12)}#dashboard-general>.center>.header .general-selector md-icon{color:#fff}#dashboard-general>.center>.content{background:0 0;padding:0}#dashboard-general>.center>.content>md-tabs>md-tabs-wrapper{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);padding:0 24px}#dashboard-general>.center>.content>md-tabs>md-tabs-wrapper md-tabs-canvas{height:56px}#dashboard-general>.center>.content>md-tabs>md-tabs-wrapper md-tabs-canvas md-pagination-wrapper{height:56px}#dashboard-general>.center>.content>md-tabs>md-tabs-wrapper md-tabs-canvas .md-tab{padding:16px 24px;text-transform:none}#dashboard-general>.center>.content>md-tabs:not(.md-dynamic-height) md-tabs-content-wrapper{top:56px}#dashboard-general>.center>.content>md-tabs>md-tabs-content-wrapper md-tab-content{padding:12px}#dashboard-general>.sidenav{width:330px;min-width:330px;max-width:330px;padding:0;z-index:51;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}#dashboard-general>.sidenav.md-locked-open{width:250px;min-width:250px;max-width:250px;z-index:2;box-shadow:none;background:#eee}#dashboard-general .dashboard-container{padding:24px;margin-bottom:24px}#dashboard-general .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.faxAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#fax-faxAccount .header{height:76px;min-height:76px;max-height:76px}#fax-faxAccount .header .goto-faxAccounts-button{margin-right:16px}#fax-faxAccount .header .faxAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#fax-faxAccount .header .faxAccount-image img{height:100%;width:auto;max-width:none}#fax-faxAccount .header .subtitle{margin:6px 0 0 0}#fax-faxAccount .faxAccount-detail-form-container{padding:24px;margin-bottom:24px}#fax-faxAccount .faxAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#fax-faxAccount .faxAccount-detail-form-container .handle{cursor:move}#fax-faxAccount .faxAccount-detail-form-container md-input-container md-switch{margin:0!important}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader{position:relative}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader.dropping .drop-text{display:flex}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .upload-button{margin-bottom:16px}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .faxAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .faxAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .faxAccount-image .media{max-height:100%}#fax-faxAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#fax-faxAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#fax-faxAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#fax-faxAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#fax-faxAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#fax-faxAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#fax-faxAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#fax-faxAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#fax-faxAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#fax-faxAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#fax-faxAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#fax-faxAccount .actionAppData{width:80px!important}}#faxAccounts{position:relative}#faxAccounts>.header{height:76px;min-height:76px;max-height:76px}#faxAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#faxAccounts>.header .logo .logo-text{font-size:24px}#faxAccounts>.header md-icon{color:#fff}#faxAccounts>.header .search-input-wrapper{position:relative}#faxAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#faxAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#faxAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#faxAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#faxAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#faxAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#faxAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#faxAccounts>.header.selected-bar .close-button-wrapper{width:244px}#faxAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#faxAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#faxAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#faxAccounts #add-faxAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#faxAccounts #upload-faxAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.faxQueue-dialog{max-width:720px;width:720px}md-dialog.faxQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.faxQueue-dialog md-toolbar .title{font-size:17px}md-dialog.faxQueue-dialog md-input-container textarea{min-height:150px}md-dialog.faxQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.faxQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.faxQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxQueue-dialog .error-list{font-size:13px}md-dialog.faxQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxQueue-dialog .error-list .error .message{font-weight:500}md-dialog.faxQueue-dialog .error-list .error .md-button{margin:0}md-dialog.faxQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#fax-faxQueue .header{height:76px;min-height:76px;max-height:76px}#fax-faxQueue .header .goto-faxQueues-button{margin-right:16px}#fax-faxQueue .header .faxQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#fax-faxQueue .header .faxQueue-image img{height:100%;width:auto;max-width:none}#fax-faxQueue .header .subtitle{margin:6px 0 0 0}#fax-faxQueue .faxQueue-detail-form-container{padding:24px;margin-bottom:24px}#fax-faxQueue .faxQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#fax-faxQueue .faxQueue-detail-form-container .handle{cursor:move}#fax-faxQueue .faxQueue-detail-form-container md-input-container md-switch{margin:0!important}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader{position:relative}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader.dropping .drop-text{display:flex}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .upload-button{margin-bottom:16px}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .faxQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .faxQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .faxQueue-image .media{max-height:100%}#fax-faxQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#fax-faxQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#fax-faxQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#fax-faxQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#faxQueues{position:relative}#faxQueues>.header{height:76px;min-height:76px;max-height:76px}#faxQueues>.header .logo .logo-icon{margin:0 16px 0 0}#faxQueues>.header .logo .logo-text{font-size:24px}#faxQueues>.header md-icon{color:#fff}#faxQueues>.header .search-input-wrapper{position:relative}#faxQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#faxQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#faxQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#faxQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#faxQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#faxQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#faxQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#faxQueues>.header.selected-bar .close-button-wrapper{width:244px}#faxQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#faxQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#faxQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#faxQueues #add-faxQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#faxQueues #upload-faxQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}#profile .about-tab{max-width:1200px}#profile .about-tab .about{padding:8px}#profile .about-tab .about .general .location md-icon{line-height:13px!important}#profile .about-tab .about .work .job .company{padding:0 16px 0 0;font-weight:500}#profile .about-tab .about .work .job .date{color:rgba(0,0,0,.54)}#profile .about-tab .about-sidebar{padding:8px 8px 8px 32px}#profile .about-tab .about-sidebar .friends .content .friend{padding:4px}#profile .about-tab .about-sidebar .groups .content .group{margin-bottom:16px}#profile .about-tab .about-sidebar .groups .content .group:last-child{margin-bottom:0}#profile .about-tab .about-sidebar .groups .content .group .logo{border:1px solid rgba(0,0,0,.12);margin-right:16px}#profile .about-tab .about-sidebar .groups .content .group .name{font-weight:500;font-size:15px}#profile .about-tab .about-sidebar .groups .content .group .category,#profile .about-tab .about-sidebar .groups .content .group .members{color:rgba(0,0,0,.54)}#profile .about-tab .about-sidebar .groups .content .group .members{margin-top:16px}@media screen and (max-width:960px){#profile .about-tab .about-sidebar{padding:8px}}#maintenance{height:100%;background:url(/assets/images/backgrounds/tech.png) no-repeat;background-size:cover}#maintenance #maintenance-form-wrapper{flex:1 0 auto;padding:32px}#maintenance #maintenance-form-wrapper #maintenance-form{max-width:384px;padding:32px;background:#fff;text-align:center}#maintenance #maintenance-form-wrapper #maintenance-form .logo{width:128px;height:128px;line-height:128px;font-size:86px;font-weight:500;margin:32px auto;color:#fff;border-radius:2px}#maintenance #maintenance-form-wrapper #maintenance-form .title{font-size:17px;margin-top:16px}#maintenance #maintenance-form-wrapper #maintenance-form .subtitle{margin:16px 0;max-width:300px;color:rgba(0,0,0,.54);font-size:15px}@media screen and (max-width:600px){#maintenance #maintenance-form-wrapper{padding:16px}#maintenance #maintenance-form-wrapper #maintenance-form{padding:24px;width:100%}}md-dialog.deskAccount-dialog{max-width:720px;width:720px}md-dialog.deskAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.deskAccount-dialog md-toolbar .title{font-size:17px}md-dialog.deskAccount-dialog md-input-container textarea{min-height:150px}md-dialog.deskAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.deskAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.deskAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.deskAccount-dialog .error-list{font-size:13px}md-dialog.deskAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.deskAccount-dialog .error-list .error .message{font-weight:500}md-dialog.deskAccount-dialog .error-list .error .md-button{margin:0}md-dialog.deskAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.deskAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#deskAccounts{position:relative}#deskAccounts>.header{height:76px;min-height:76px;max-height:76px}#deskAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#deskAccounts>.header .logo .logo-text{font-size:24px}#deskAccounts>.header md-icon{color:#fff}#deskAccounts>.header .search-input-wrapper{position:relative}#deskAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#deskAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#deskAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#deskAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#deskAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#deskAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#deskAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#deskAccounts>.header.selected-bar .close-button-wrapper{width:244px}#deskAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#deskAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#deskAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#deskAccounts #add-deskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#deskAccounts #upload-deskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.deskConfiguration-dialog{max-width:720px;width:720px}md-dialog.deskConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.deskConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.deskConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.deskConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.deskConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.deskConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.deskConfiguration-dialog .error-list{font-size:13px}md-dialog.deskConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.deskConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.deskConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.deskConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.deskConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.deskAccount-item-dialog{max-width:720px;width:720px}md-dialog.deskAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.deskAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.deskAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.deskAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.deskAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.deskAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.deskAccount-item-dialog .error-list{font-size:13px}md-dialog.deskAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.deskAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.deskAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.deskAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.deskAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-deskAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-deskAccount .header .goto-deskAccounts-button{margin-right:16px}#integrations-deskAccount .header .deskAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-deskAccount .header .deskAccount-image img{height:100%;width:auto;max-width:none}#integrations-deskAccount .header .subtitle{margin:6px 0 0 0}#integrations-deskAccount .deskAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-deskAccount .deskAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-deskAccount .deskAccount-detail-form-container .handle{cursor:move}#integrations-deskAccount .deskAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader{position:relative}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader.dropping .drop-text{display:flex}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .deskAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .deskAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .deskAccount-image .media{max-height:100%}#integrations-deskAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-deskAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-deskAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-deskAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.dynamics365Account-dialog{max-width:720px;width:720px}md-dialog.dynamics365Account-dialog md-dialog-content{display:block;position:relative}md-dialog.dynamics365Account-dialog md-toolbar .title{font-size:17px}md-dialog.dynamics365Account-dialog md-input-container textarea{min-height:150px}md-dialog.dynamics365Account-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.dynamics365Account-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.dynamics365Account-dialog .date-container{padding:16px 0 24px 0}md-dialog.dynamics365Account-dialog .error-list{font-size:13px}md-dialog.dynamics365Account-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.dynamics365Account-dialog .error-list .error .message{font-weight:500}md-dialog.dynamics365Account-dialog .error-list .error .md-button{margin:0}md-dialog.dynamics365Account-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.dynamics365Account-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#dynamics365Accounts{position:relative}#dynamics365Accounts>.header{height:76px;min-height:76px;max-height:76px}#dynamics365Accounts>.header .logo .logo-icon{margin:0 16px 0 0}#dynamics365Accounts>.header .logo .logo-text{font-size:24px}#dynamics365Accounts>.header md-icon{color:#fff}#dynamics365Accounts>.header .search-input-wrapper{position:relative}#dynamics365Accounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#dynamics365Accounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#dynamics365Accounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#dynamics365Accounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#dynamics365Accounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#dynamics365Accounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#dynamics365Accounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#dynamics365Accounts>.header.selected-bar .close-button-wrapper{width:244px}#dynamics365Accounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#dynamics365Accounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#dynamics365Accounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#dynamics365Accounts #add-dynamics365Account-button{position:fixed;bottom:8px;right:8px;padding:0}#dynamics365Accounts #upload-dynamics365Account-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.dynamics365Configuration-dialog{max-width:720px;width:720px}md-dialog.dynamics365Configuration-dialog md-dialog-content{display:block;position:relative}md-dialog.dynamics365Configuration-dialog md-toolbar .title{font-size:17px}md-dialog.dynamics365Configuration-dialog md-input-container textarea{min-height:150px}md-dialog.dynamics365Configuration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.dynamics365Configuration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.dynamics365Configuration-dialog .date-container{padding:16px 0 24px 0}md-dialog.dynamics365Configuration-dialog .error-list{font-size:13px}md-dialog.dynamics365Configuration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.dynamics365Configuration-dialog .error-list .error .message{font-weight:500}md-dialog.dynamics365Configuration-dialog .error-list .error .md-button{margin:0}md-dialog.dynamics365Configuration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.dynamics365Configuration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.dynamics365Account-item-dialog{max-width:720px;width:720px}md-dialog.dynamics365Account-item-dialog md-dialog-content{display:block;position:relative}md-dialog.dynamics365Account-item-dialog md-toolbar .title{font-size:17px}md-dialog.dynamics365Account-item-dialog md-input-container textarea{min-height:150px}md-dialog.dynamics365Account-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.dynamics365Account-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.dynamics365Account-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.dynamics365Account-item-dialog .error-list{font-size:13px}md-dialog.dynamics365Account-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.dynamics365Account-item-dialog .error-list .error .message{font-weight:500}md-dialog.dynamics365Account-item-dialog .error-list .error .md-button{margin:0}md-dialog.dynamics365Account-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.dynamics365Account-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-dynamics365Account .header{height:76px;min-height:76px;max-height:76px}#integrations-dynamics365Account .header .goto-dynamics365Accounts-button{margin-right:16px}#integrations-dynamics365Account .header .dynamics365Account-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-dynamics365Account .header .dynamics365Account-image img{height:100%;width:auto;max-width:none}#integrations-dynamics365Account .header .subtitle{margin:6px 0 0 0}#integrations-dynamics365Account .dynamics365Account-detail-form-container{padding:24px;margin-bottom:24px}#integrations-dynamics365Account .dynamics365Account-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-dynamics365Account .dynamics365Account-detail-form-container .handle{cursor:move}#integrations-dynamics365Account .dynamics365Account-detail-form-container md-input-container md-switch{margin:0!important}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader{position:relative}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader.dropping .drop-text{display:flex}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .upload-button{margin-bottom:16px}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .dynamics365Account-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .dynamics365Account-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .dynamics365Account-image .media{max-height:100%}#integrations-dynamics365Account md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-dynamics365Account md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-dynamics365Account md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-dynamics365Account md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.freshdeskAccount-dialog{max-width:720px;width:720px}md-dialog.freshdeskAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.freshdeskAccount-dialog md-toolbar .title{font-size:17px}md-dialog.freshdeskAccount-dialog md-input-container textarea{min-height:150px}md-dialog.freshdeskAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshdeskAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshdeskAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshdeskAccount-dialog .error-list{font-size:13px}md-dialog.freshdeskAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshdeskAccount-dialog .error-list .error .message{font-weight:500}md-dialog.freshdeskAccount-dialog .error-list .error .md-button{margin:0}md-dialog.freshdeskAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshdeskAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.freshdeskConfiguration-dialog{max-width:720px;width:720px}md-dialog.freshdeskConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.freshdeskConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.freshdeskConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.freshdeskConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshdeskConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshdeskConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshdeskConfiguration-dialog .error-list{font-size:13px}md-dialog.freshdeskConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshdeskConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.freshdeskConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.freshdeskConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshdeskConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.freshdeskAccount-item-dialog{max-width:720px;width:720px}md-dialog.freshdeskAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.freshdeskAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.freshdeskAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.freshdeskAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshdeskAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshdeskAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshdeskAccount-item-dialog .error-list{font-size:13px}md-dialog.freshdeskAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshdeskAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.freshdeskAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.freshdeskAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshdeskAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-freshdeskAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-freshdeskAccount .header .goto-freshdeskAccounts-button{margin-right:16px}#integrations-freshdeskAccount .header .freshdeskAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-freshdeskAccount .header .freshdeskAccount-image img{height:100%;width:auto;max-width:none}#integrations-freshdeskAccount .header .subtitle{margin:6px 0 0 0}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container .handle{cursor:move}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader{position:relative}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader.dropping .drop-text{display:flex}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .freshdeskAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .freshdeskAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .freshdeskAccount-image .media{max-height:100%}#integrations-freshdeskAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-freshdeskAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-freshdeskAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-freshdeskAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#freshdeskAccounts{position:relative}#freshdeskAccounts>.header{height:76px;min-height:76px;max-height:76px}#freshdeskAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#freshdeskAccounts>.header .logo .logo-text{font-size:24px}#freshdeskAccounts>.header md-icon{color:#fff}#freshdeskAccounts>.header .search-input-wrapper{position:relative}#freshdeskAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#freshdeskAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#freshdeskAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#freshdeskAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#freshdeskAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#freshdeskAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#freshdeskAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#freshdeskAccounts>.header.selected-bar .close-button-wrapper{width:244px}#freshdeskAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#freshdeskAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#freshdeskAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#freshdeskAccounts #add-freshdeskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#freshdeskAccounts #upload-freshdeskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.freshsalesAccount-dialog{max-width:720px;width:720px}md-dialog.freshsalesAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.freshsalesAccount-dialog md-toolbar .title{font-size:17px}md-dialog.freshsalesAccount-dialog md-input-container textarea{min-height:150px}md-dialog.freshsalesAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshsalesAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshsalesAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshsalesAccount-dialog .error-list{font-size:13px}md-dialog.freshsalesAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshsalesAccount-dialog .error-list .error .message{font-weight:500}md-dialog.freshsalesAccount-dialog .error-list .error .md-button{margin:0}md-dialog.freshsalesAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshsalesAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.freshsalesConfiguration-dialog{max-width:720px;width:720px}md-dialog.freshsalesConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.freshsalesConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.freshsalesConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.freshsalesConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshsalesConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshsalesConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshsalesConfiguration-dialog .error-list{font-size:13px}md-dialog.freshsalesConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshsalesConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.freshsalesConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.freshsalesConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshsalesConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.freshsalesAccount-item-dialog{max-width:720px;width:720px}md-dialog.freshsalesAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.freshsalesAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.freshsalesAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.freshsalesAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshsalesAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshsalesAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshsalesAccount-item-dialog .error-list{font-size:13px}md-dialog.freshsalesAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshsalesAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.freshsalesAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.freshsalesAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshsalesAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-freshsalesAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-freshsalesAccount .header .goto-freshsalesAccounts-button{margin-right:16px}#integrations-freshsalesAccount .header .freshsalesAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-freshsalesAccount .header .freshsalesAccount-image img{height:100%;width:auto;max-width:none}#integrations-freshsalesAccount .header .subtitle{margin:6px 0 0 0}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container .handle{cursor:move}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader{position:relative}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader.dropping .drop-text{display:flex}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .freshsalesAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .freshsalesAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .freshsalesAccount-image .media{max-height:100%}#integrations-freshsalesAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-freshsalesAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-freshsalesAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-freshsalesAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#freshsalesAccounts{position:relative}#freshsalesAccounts>.header{height:76px;min-height:76px;max-height:76px}#freshsalesAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#freshsalesAccounts>.header .logo .logo-text{font-size:24px}#freshsalesAccounts>.header md-icon{color:#fff}#freshsalesAccounts>.header .search-input-wrapper{position:relative}#freshsalesAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#freshsalesAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#freshsalesAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#freshsalesAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#freshsalesAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#freshsalesAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#freshsalesAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#freshsalesAccounts>.header.selected-bar .close-button-wrapper{width:244px}#freshsalesAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#freshsalesAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#freshsalesAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#freshsalesAccounts #add-freshsalesAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#freshsalesAccounts #upload-freshsalesAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.salesforceAccount-dialog{max-width:720px;width:720px}md-dialog.salesforceAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.salesforceAccount-dialog md-toolbar .title{font-size:17px}md-dialog.salesforceAccount-dialog md-input-container textarea{min-height:150px}md-dialog.salesforceAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.salesforceAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.salesforceAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.salesforceAccount-dialog .error-list{font-size:13px}md-dialog.salesforceAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.salesforceAccount-dialog .error-list .error .message{font-weight:500}md-dialog.salesforceAccount-dialog .error-list .error .md-button{margin:0}md-dialog.salesforceAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.salesforceAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.salesforceConfiguration-dialog{max-width:720px;width:720px}md-dialog.salesforceConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.salesforceConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.salesforceConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.salesforceConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.salesforceConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.salesforceConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.salesforceConfiguration-dialog .error-list{font-size:13px}md-dialog.salesforceConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.salesforceConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.salesforceConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.salesforceConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.salesforceConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.salesforceAccount-item-dialog{max-width:720px;width:720px}md-dialog.salesforceAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.salesforceAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.salesforceAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.salesforceAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.salesforceAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.salesforceAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.salesforceAccount-item-dialog .error-list{font-size:13px}md-dialog.salesforceAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.salesforceAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.salesforceAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.salesforceAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.salesforceAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-salesforceAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-salesforceAccount .header .goto-salesforceAccounts-button{margin-right:16px}#integrations-salesforceAccount .header .salesforceAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-salesforceAccount .header .salesforceAccount-image img{height:100%;width:auto;max-width:none}#integrations-salesforceAccount .header .subtitle{margin:6px 0 0 0}#integrations-salesforceAccount .salesforceAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-salesforceAccount .salesforceAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-salesforceAccount .salesforceAccount-detail-form-container .handle{cursor:move}#integrations-salesforceAccount .salesforceAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader{position:relative}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader.dropping .drop-text{display:flex}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .salesforceAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .salesforceAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .salesforceAccount-image .media{max-height:100%}#integrations-salesforceAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-salesforceAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-salesforceAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-salesforceAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#salesforceAccounts{position:relative}#salesforceAccounts>.header{height:76px;min-height:76px;max-height:76px}#salesforceAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#salesforceAccounts>.header .logo .logo-text{font-size:24px}#salesforceAccounts>.header md-icon{color:#fff}#salesforceAccounts>.header .search-input-wrapper{position:relative}#salesforceAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#salesforceAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#salesforceAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#salesforceAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#salesforceAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#salesforceAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#salesforceAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#salesforceAccounts>.header.selected-bar .close-button-wrapper{width:244px}#salesforceAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#salesforceAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#salesforceAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#salesforceAccounts #add-salesforceAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#salesforceAccounts #upload-salesforceAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.servicenowAccount-dialog{max-width:720px;width:720px}md-dialog.servicenowAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.servicenowAccount-dialog md-toolbar .title{font-size:17px}md-dialog.servicenowAccount-dialog md-input-container textarea{min-height:150px}md-dialog.servicenowAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.servicenowAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.servicenowAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.servicenowAccount-dialog .error-list{font-size:13px}md-dialog.servicenowAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.servicenowAccount-dialog .error-list .error .message{font-weight:500}md-dialog.servicenowAccount-dialog .error-list .error .md-button{margin:0}md-dialog.servicenowAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.servicenowAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.servicenowConfiguration-dialog{max-width:720px;width:720px}md-dialog.servicenowConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.servicenowConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.servicenowConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.servicenowConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.servicenowConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.servicenowConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.servicenowConfiguration-dialog .error-list{font-size:13px}md-dialog.servicenowConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.servicenowConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.servicenowConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.servicenowConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.servicenowConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.servicenowAccount-item-dialog{max-width:720px;width:720px}md-dialog.servicenowAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.servicenowAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.servicenowAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.servicenowAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.servicenowAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.servicenowAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.servicenowAccount-item-dialog .error-list{font-size:13px}md-dialog.servicenowAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.servicenowAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.servicenowAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.servicenowAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.servicenowAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-servicenowAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-servicenowAccount .header .goto-servicenowAccounts-button{margin-right:16px}#integrations-servicenowAccount .header .servicenowAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-servicenowAccount .header .servicenowAccount-image img{height:100%;width:auto;max-width:none}#integrations-servicenowAccount .header .subtitle{margin:6px 0 0 0}#integrations-servicenowAccount .servicenowAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-servicenowAccount .servicenowAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-servicenowAccount .servicenowAccount-detail-form-container .handle{cursor:move}#integrations-servicenowAccount .servicenowAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader{position:relative}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader.dropping .drop-text{display:flex}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .servicenowAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .servicenowAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .servicenowAccount-image .media{max-height:100%}#integrations-servicenowAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-servicenowAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-servicenowAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-servicenowAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#servicenowAccounts{position:relative}#servicenowAccounts>.header{height:76px;min-height:76px;max-height:76px}#servicenowAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#servicenowAccounts>.header .logo .logo-text{font-size:24px}#servicenowAccounts>.header md-icon{color:#fff}#servicenowAccounts>.header .search-input-wrapper{position:relative}#servicenowAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#servicenowAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#servicenowAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#servicenowAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#servicenowAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#servicenowAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#servicenowAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#servicenowAccounts>.header.selected-bar .close-button-wrapper{width:244px}#servicenowAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#servicenowAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#servicenowAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#servicenowAccounts #add-servicenowAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#servicenowAccounts #upload-servicenowAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.sugarcrmAccount-dialog{max-width:720px;width:720px}md-dialog.sugarcrmAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.sugarcrmAccount-dialog md-toolbar .title{font-size:17px}md-dialog.sugarcrmAccount-dialog md-input-container textarea{min-height:150px}md-dialog.sugarcrmAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.sugarcrmAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.sugarcrmAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.sugarcrmAccount-dialog .error-list{font-size:13px}md-dialog.sugarcrmAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.sugarcrmAccount-dialog .error-list .error .message{font-weight:500}md-dialog.sugarcrmAccount-dialog .error-list .error .md-button{margin:0}md-dialog.sugarcrmAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.sugarcrmAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.sugarcrmConfiguration-dialog{max-width:720px;width:720px}md-dialog.sugarcrmConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.sugarcrmConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.sugarcrmConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.sugarcrmConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.sugarcrmConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.sugarcrmConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.sugarcrmConfiguration-dialog .error-list{font-size:13px}md-dialog.sugarcrmConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.sugarcrmConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.sugarcrmConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.sugarcrmConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.sugarcrmConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.sugarcrmAccount-item-dialog{max-width:720px;width:720px}md-dialog.sugarcrmAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.sugarcrmAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.sugarcrmAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.sugarcrmAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.sugarcrmAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.sugarcrmAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.sugarcrmAccount-item-dialog .error-list{font-size:13px}md-dialog.sugarcrmAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.sugarcrmAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.sugarcrmAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.sugarcrmAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.sugarcrmAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-sugarcrmAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-sugarcrmAccount .header .goto-sugarcrmAccounts-button{margin-right:16px}#integrations-sugarcrmAccount .header .sugarcrmAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-sugarcrmAccount .header .sugarcrmAccount-image img{height:100%;width:auto;max-width:none}#integrations-sugarcrmAccount .header .subtitle{margin:6px 0 0 0}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container .handle{cursor:move}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader{position:relative}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader.dropping .drop-text{display:flex}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .sugarcrmAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .sugarcrmAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .sugarcrmAccount-image .media{max-height:100%}#integrations-sugarcrmAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-sugarcrmAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-sugarcrmAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-sugarcrmAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#sugarcrmAccounts{position:relative}#sugarcrmAccounts>.header{height:76px;min-height:76px;max-height:76px}#sugarcrmAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#sugarcrmAccounts>.header .logo .logo-text{font-size:24px}#sugarcrmAccounts>.header md-icon{color:#fff}#sugarcrmAccounts>.header .search-input-wrapper{position:relative}#sugarcrmAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#sugarcrmAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#sugarcrmAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#sugarcrmAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#sugarcrmAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#sugarcrmAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#sugarcrmAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#sugarcrmAccounts>.header.selected-bar .close-button-wrapper{width:244px}#sugarcrmAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#sugarcrmAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#sugarcrmAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#sugarcrmAccounts #add-sugarcrmAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#sugarcrmAccounts #upload-sugarcrmAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.vtigerAccount-dialog{max-width:720px;width:720px}md-dialog.vtigerAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.vtigerAccount-dialog md-toolbar .title{font-size:17px}md-dialog.vtigerAccount-dialog md-input-container textarea{min-height:150px}md-dialog.vtigerAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.vtigerAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.vtigerAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.vtigerAccount-dialog .error-list{font-size:13px}md-dialog.vtigerAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.vtigerAccount-dialog .error-list .error .message{font-weight:500}md-dialog.vtigerAccount-dialog .error-list .error .md-button{margin:0}md-dialog.vtigerAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.vtigerAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.vtigerConfiguration-dialog{max-width:720px;width:720px}md-dialog.vtigerConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.vtigerConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.vtigerConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.vtigerConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.vtigerConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.vtigerConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.vtigerConfiguration-dialog .error-list{font-size:13px}md-dialog.vtigerConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.vtigerConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.vtigerConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.vtigerConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.vtigerConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.vtigerAccount-item-dialog{max-width:720px;width:720px}md-dialog.vtigerAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.vtigerAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.vtigerAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.vtigerAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.vtigerAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.vtigerAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.vtigerAccount-item-dialog .error-list{font-size:13px}md-dialog.vtigerAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.vtigerAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.vtigerAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.vtigerAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.vtigerAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-vtigerAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-vtigerAccount .header .goto-vtigerAccounts-button{margin-right:16px}#integrations-vtigerAccount .header .vtigerAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-vtigerAccount .header .vtigerAccount-image img{height:100%;width:auto;max-width:none}#integrations-vtigerAccount .header .subtitle{margin:6px 0 0 0}#integrations-vtigerAccount .vtigerAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-vtigerAccount .vtigerAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-vtigerAccount .vtigerAccount-detail-form-container .handle{cursor:move}#integrations-vtigerAccount .vtigerAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader{position:relative}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader.dropping .drop-text{display:flex}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .vtigerAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .vtigerAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .vtigerAccount-image .media{max-height:100%}#integrations-vtigerAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-vtigerAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-vtigerAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-vtigerAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#vtigerAccounts{position:relative}#vtigerAccounts>.header{height:76px;min-height:76px;max-height:76px}#vtigerAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#vtigerAccounts>.header .logo .logo-text{font-size:24px}#vtigerAccounts>.header md-icon{color:#fff}#vtigerAccounts>.header .search-input-wrapper{position:relative}#vtigerAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#vtigerAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#vtigerAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#vtigerAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#vtigerAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#vtigerAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#vtigerAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#vtigerAccounts>.header.selected-bar .close-button-wrapper{width:244px}#vtigerAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#vtigerAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#vtigerAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#vtigerAccounts #add-vtigerAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#vtigerAccounts #upload-vtigerAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.zendeskAccount-dialog{max-width:720px;width:720px}md-dialog.zendeskAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.zendeskAccount-dialog md-toolbar .title{font-size:17px}md-dialog.zendeskAccount-dialog md-input-container textarea{min-height:150px}md-dialog.zendeskAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zendeskAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zendeskAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.zendeskAccount-dialog .error-list{font-size:13px}md-dialog.zendeskAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zendeskAccount-dialog .error-list .error .message{font-weight:500}md-dialog.zendeskAccount-dialog .error-list .error .md-button{margin:0}md-dialog.zendeskAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zendeskAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.zendeskAccount-item-dialog{max-width:720px;width:720px}md-dialog.zendeskAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.zendeskAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.zendeskAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.zendeskAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zendeskAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zendeskAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.zendeskAccount-item-dialog .error-list{font-size:13px}md-dialog.zendeskAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zendeskAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.zendeskAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.zendeskAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zendeskAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-zendeskAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-zendeskAccount .header .goto-zendeskAccounts-button{margin-right:16px}#integrations-zendeskAccount .header .zendeskAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-zendeskAccount .header .zendeskAccount-image img{height:100%;width:auto;max-width:none}#integrations-zendeskAccount .header .subtitle{margin:6px 0 0 0}#integrations-zendeskAccount .zendeskAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-zendeskAccount .zendeskAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-zendeskAccount .zendeskAccount-detail-form-container .handle{cursor:move}#integrations-zendeskAccount .zendeskAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader{position:relative}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader.dropping .drop-text{display:flex}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .zendeskAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .zendeskAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .zendeskAccount-image .media{max-height:100%}#integrations-zendeskAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-zendeskAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-zendeskAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-zendeskAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.zendeskConfiguration-dialog{max-width:720px;width:720px}md-dialog.zendeskConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.zendeskConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.zendeskConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.zendeskConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zendeskConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zendeskConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.zendeskConfiguration-dialog .error-list{font-size:13px}md-dialog.zendeskConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zendeskConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.zendeskConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.zendeskConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zendeskConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#zendeskAccounts{position:relative}#zendeskAccounts>.header{height:76px;min-height:76px;max-height:76px}#zendeskAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#zendeskAccounts>.header .logo .logo-text{font-size:24px}#zendeskAccounts>.header md-icon{color:#fff}#zendeskAccounts>.header .search-input-wrapper{position:relative}#zendeskAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#zendeskAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#zendeskAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#zendeskAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#zendeskAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#zendeskAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#zendeskAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#zendeskAccounts>.header.selected-bar .close-button-wrapper{width:244px}#zendeskAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#zendeskAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#zendeskAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#zendeskAccounts #add-zendeskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#zendeskAccounts #upload-zendeskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.zohoAccount-dialog{max-width:720px;width:720px}md-dialog.zohoAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.zohoAccount-dialog md-toolbar .title{font-size:17px}md-dialog.zohoAccount-dialog md-input-container textarea{min-height:150px}md-dialog.zohoAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zohoAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zohoAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.zohoAccount-dialog .error-list{font-size:13px}md-dialog.zohoAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zohoAccount-dialog .error-list .error .message{font-weight:500}md-dialog.zohoAccount-dialog .error-list .error .md-button{margin:0}md-dialog.zohoAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zohoAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.zohoConfiguration-dialog{max-width:720px;width:720px}md-dialog.zohoConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.zohoConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.zohoConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.zohoConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zohoConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zohoConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.zohoConfiguration-dialog .error-list{font-size:13px}md-dialog.zohoConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zohoConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.zohoConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.zohoConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zohoConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.zohoAccount-item-dialog{max-width:720px;width:720px}md-dialog.zohoAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.zohoAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.zohoAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.zohoAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zohoAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zohoAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.zohoAccount-item-dialog .error-list{font-size:13px}md-dialog.zohoAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zohoAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.zohoAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.zohoAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zohoAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-zohoAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-zohoAccount .header .goto-zohoAccounts-button{margin-right:16px}#integrations-zohoAccount .header .zohoAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-zohoAccount .header .zohoAccount-image img{height:100%;width:auto;max-width:none}#integrations-zohoAccount .header .subtitle{margin:6px 0 0 0}#integrations-zohoAccount .zohoAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-zohoAccount .zohoAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-zohoAccount .zohoAccount-detail-form-container .handle{cursor:move}#integrations-zohoAccount .zohoAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader{position:relative}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader.dropping .drop-text{display:flex}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .zohoAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .zohoAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .zohoAccount-image .media{max-height:100%}#integrations-zohoAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-zohoAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-zohoAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-zohoAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#zohoAccounts{position:relative}#zohoAccounts>.header{height:76px;min-height:76px;max-height:76px}#zohoAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#zohoAccounts>.header .logo .logo-text{font-size:24px}#zohoAccounts>.header md-icon{color:#fff}#zohoAccounts>.header .search-input-wrapper{position:relative}#zohoAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#zohoAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#zohoAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#zohoAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#zohoAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#zohoAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#zohoAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#zohoAccounts>.header.selected-bar .close-button-wrapper{width:244px}#zohoAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#zohoAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#zohoAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#zohoAccounts #add-zohoAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#zohoAccounts #upload-zohoAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.project-dialog{max-width:720px;width:720px}md-dialog.project-dialog md-dialog-content{display:block;position:relative}md-dialog.project-dialog md-toolbar .title{font-size:17px}md-dialog.project-dialog md-input-container textarea{min-height:150px}md-dialog.project-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.project-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.project-dialog .date-container{padding:16px 0 24px 0}md-dialog.project-dialog .error-list{font-size:13px}md-dialog.project-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.project-dialog .error-list .error .message{font-weight:500}md-dialog.project-dialog .error-list .error .md-button{margin:0}md-dialog.project-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.project-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.session-dialog{max-width:720px;width:720px}md-dialog.session-dialog md-dialog-content{display:block;position:relative}md-dialog.session-dialog md-toolbar .title{font-size:17px}md-dialog.session-dialog md-input-container textarea{min-height:150px}md-dialog.session-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.session-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.session-dialog .date-container{padding:16px 0 24px 0}md-dialog.session-dialog .error-list{font-size:13px}md-dialog.session-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.session-dialog .error-list .error .message{font-weight:500}md-dialog.session-dialog .error-list .error .md-button{margin:0}md-dialog.session-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.session-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#jscripty-project .header{height:76px;min-height:76px;max-height:76px}#jscripty-project .header .goto-projects-button{margin-right:16px}#jscripty-project .header .project-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#jscripty-project .header .project-image img{height:100%;width:auto;max-width:none}#jscripty-project .header .subtitle{margin:6px 0 0 0}#jscripty-project .project-detail-form-container{padding:24px;margin-bottom:24px}#jscripty-project .project-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#jscripty-project .project-detail-form-container .handle{cursor:move}#jscripty-project .project-detail-form-container md-input-container md-switch{margin:0!important}#jscripty-project .project-detail-form-container #project-image-uploader{position:relative}#jscripty-project .project-detail-form-container #project-image-uploader.dropping .drop-text{display:flex}#jscripty-project .project-detail-form-container #project-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#jscripty-project .project-detail-form-container #project-image-uploader .upload-button{margin-bottom:16px}#jscripty-project .project-detail-form-container #project-image-uploader .project-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#jscripty-project .project-detail-form-container #project-image-uploader .project-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#jscripty-project .project-detail-form-container #project-image-uploader .project-image .media{max-height:100%}#jscripty-project md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#jscripty-project md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#jscripty-project md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#jscripty-project md-table-container.font-size-12 td.md-cell{font-size:12px!important}#projects{position:relative}#projects>.header{height:76px;min-height:76px;max-height:76px}#projects>.header .logo .logo-icon{margin:0 16px 0 0}#projects>.header .logo .logo-text{font-size:24px}#projects>.header md-icon{color:#fff}#projects>.header .search-input-wrapper{position:relative}#projects>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#projects>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#projects>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#projects>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#projects>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#projects>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#projects>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#projects>.header.selected-bar .close-button-wrapper{width:244px}#projects>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#projects>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#projects>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#projects #add-project-button{position:fixed;bottom:8px;right:8px;padding:0}#projects #upload-project-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mailAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.mailCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.mailCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.mailCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.mailCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mailCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mailCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailCannedAnswer-dialog .error-list{font-size:13px}md-dialog.mailCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.mailCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.mailCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#mail-mailAccount .header{height:76px;min-height:76px;max-height:76px}#mail-mailAccount .header .goto-mailAccounts-button{margin-right:16px}#mail-mailAccount .header .mailAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#mail-mailAccount .header .mailAccount-image img{height:100%;width:auto;max-width:none}#mail-mailAccount .header .subtitle{margin:6px 0 0 0}#mail-mailAccount .mailAccount-detail-form-container{padding:24px;margin-bottom:24px}#mail-mailAccount .mailAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#mail-mailAccount .mailAccount-detail-form-container .handle{cursor:move}#mail-mailAccount .mailAccount-detail-form-container md-input-container md-switch{margin:0!important}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader{position:relative}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader.dropping .drop-text{display:flex}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .upload-button{margin-bottom:16px}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .mailAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .mailAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .mailAccount-image .media{max-height:100%}#mail-mailAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#mail-mailAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#mail-mailAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#mail-mailAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#mail-mailAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#mail-mailAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#mail-mailAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#mail-mailAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#mail-mailAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#mail-mailAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#mail-mailAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#mail-mailAccount .actionAppData{width:80px!important}}#mailAccounts{position:relative}#mailAccounts>.header{height:76px;min-height:76px;max-height:76px}#mailAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#mailAccounts>.header .logo .logo-text{font-size:24px}#mailAccounts>.header md-icon{color:#fff}#mailAccounts>.header .search-input-wrapper{position:relative}#mailAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#mailAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#mailAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#mailAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#mailAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#mailAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#mailAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#mailAccounts>.header.selected-bar .close-button-wrapper{width:244px}#mailAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#mailAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#mailAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#mailAccounts #add-mailAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#mailAccounts #upload-mailAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.mailQueue-dialog{max-width:720px;width:720px}md-dialog.mailQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.mailQueue-dialog md-toolbar .title{font-size:17px}md-dialog.mailQueue-dialog md-input-container textarea{min-height:150px}md-dialog.mailQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mailQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mailQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailQueue-dialog .error-list{font-size:13px}md-dialog.mailQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailQueue-dialog .error-list .error .message{font-weight:500}md-dialog.mailQueue-dialog .error-list .error .md-button{margin:0}md-dialog.mailQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#mail-mailQueue .header{height:76px;min-height:76px;max-height:76px}#mail-mailQueue .header .goto-mailQueues-button{margin-right:16px}#mail-mailQueue .header .mailQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#mail-mailQueue .header .mailQueue-image img{height:100%;width:auto;max-width:none}#mail-mailQueue .header .subtitle{margin:6px 0 0 0}#mail-mailQueue .mailQueue-detail-form-container{padding:24px;margin-bottom:24px}#mail-mailQueue .mailQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#mail-mailQueue .mailQueue-detail-form-container .handle{cursor:move}#mail-mailQueue .mailQueue-detail-form-container md-input-container md-switch{margin:0!important}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader{position:relative}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader.dropping .drop-text{display:flex}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .upload-button{margin-bottom:16px}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .mailQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .mailQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .mailQueue-image .media{max-height:100%}#mail-mailQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#mail-mailQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#mail-mailQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#mail-mailQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#mailQueues{position:relative}#mailQueues>.header{height:76px;min-height:76px;max-height:76px}#mailQueues>.header .logo .logo-icon{margin:0 16px 0 0}#mailQueues>.header .logo .logo-text{font-size:24px}#mailQueues>.header md-icon{color:#fff}#mailQueues>.header .search-input-wrapper{position:relative}#mailQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#mailQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#mailQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#mailQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#mailQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#mailQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#mailQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#mailQueues>.header.selected-bar .close-button-wrapper{width:244px}#mailQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#mailQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#mailQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#mailQueues #add-mailQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#mailQueues #upload-mailQueue-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.mailSubstatus-dialog{max-width:720px;width:720px}md-dialog.mailSubstatus-dialog md-dialog-content{display:block;position:relative}md-dialog.mailSubstatus-dialog md-toolbar .title{font-size:17px}md-dialog.mailSubstatus-dialog md-input-container textarea{min-height:150px}md-dialog.mailSubstatus-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mailSubstatus-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mailSubstatus-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailSubstatus-dialog .error-list{font-size:13px}md-dialog.mailSubstatus-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailSubstatus-dialog .error-list .error .message{font-weight:500}md-dialog.mailSubstatus-dialog .error-list .error .md-button{margin:0}md-dialog.mailSubstatus-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailSubstatus-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#mailSubtatuses{position:relative}#mailSubtatuses>.header{height:76px;min-height:76px;max-height:76px}#mailSubtatuses>.header .logo .logo-icon{margin:0 16px 0 0}#mailSubtatuses>.header .logo .logo-text{font-size:24px}#mailSubtatuses>.header md-icon{color:#fff}#mailSubtatuses>.header .search-input-wrapper{position:relative}#mailSubtatuses>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#mailSubtatuses>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#mailSubtatuses>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#mailSubtatuses>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#mailSubtatuses>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#mailSubtatuses>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#mailSubtatuses>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#mailSubtatuses>.header.selected-bar .close-button-wrapper{width:244px}#mailSubtatuses>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#mailSubtatuses>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#mailSubtatuses>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#mailSubtatuses #add-mailSubstatus-button{position:fixed;bottom:8px;right:8px;padding:0}#mailSubtatuses #upload-mailSubstatus-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}md-dialog.plugin-dialog{max-width:720px;width:720px}md-dialog.plugin-dialog md-dialog-content{display:block;position:relative}md-dialog.plugin-dialog md-toolbar .title{font-size:17px}md-dialog.plugin-dialog md-input-container textarea{min-height:150px}md-dialog.plugin-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.plugin-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.plugin-dialog .date-container{padding:16px 0 24px 0}md-dialog.plugin-dialog .error-list{font-size:13px}md-dialog.plugin-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.plugin-dialog .error-list .error .message{font-weight:500}md-dialog.plugin-dialog .error-list .error .md-button{margin:0}md-dialog.plugin-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.plugin-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#marketplace-plugin .header{height:76px;min-height:76px;max-height:76px}#marketplace-plugin .header .goto-plugins-button{margin-right:16px}#marketplace-plugin .header .plugin-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#marketplace-plugin .header .plugin-image img{height:100%;width:auto;max-width:none}#marketplace-plugin .header .subtitle{margin:6px 0 0 0}#marketplace-plugin .plugin-detail-form-container{padding:24px;margin-bottom:24px}#marketplace-plugin .plugin-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#marketplace-plugin .plugin-detail-form-container .handle{cursor:move}#marketplace-plugin .plugin-detail-form-container md-input-container md-switch{margin:0!important}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader{position:relative}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader.dropping .drop-text{display:flex}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .upload-button{margin-bottom:16px}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .plugin-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .plugin-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .plugin-image .media{max-height:100%}#marketplace-plugin md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#marketplace-plugin md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#marketplace-plugin md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#marketplace-plugin md-table-container.font-size-12 td.md-cell{font-size:12px!important}#plugins{position:relative}#plugins>.header{height:76px;min-height:76px;max-height:76px}#plugins>.header .logo .logo-icon{margin:0 16px 0 0}#plugins>.header .logo .logo-text{font-size:24px}#plugins>.header md-icon{color:#fff}#plugins>.header .search-input-wrapper{position:relative}#plugins>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#plugins>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#plugins>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#plugins>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#plugins>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#plugins>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#plugins>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#plugins>.header.selected-bar .close-button-wrapper{width:244px}#plugins>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#plugins>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#plugins>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#plugins #add-plugin-button{position:fixed;bottom:8px;right:8px;padding:0}#plugins #upload-plugin-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.upload-dialog{max-width:720px;width:720px}md-dialog.upload-dialog md-dialog-content{display:block;position:relative}md-dialog.upload-dialog md-toolbar .title{font-size:17px}md-dialog.upload-dialog md-input-container textarea{min-height:150px}md-dialog.upload-dialog md-progress-linear{padding-top:16px!important}md-dialog.upload-dialog .date-container{padding:16px 0 24px 0}md-dialog.upload-dialog .error-list{font-size:13px}md-dialog.upload-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.upload-dialog .error-list .error .message{font-weight:500}md-dialog.upload-dialog .error-list .error .md-button{margin:0}md-dialog.upload-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.upload-dialog .plugin-image{overflow:hidden;max-width:148px;margin-right:16px;border:3px solid rgba(0,0,0,.12);padding:10px}md-dialog.upload-dialog .plugin-image img{width:auto;max-width:none}md-dialog.upload-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.ivrCampaign-dialog{max-width:720px;width:720px}md-dialog.ivrCampaign-dialog md-dialog-content{display:block;position:relative}md-dialog.ivrCampaign-dialog md-toolbar .title{font-size:17px}md-dialog.ivrCampaign-dialog md-input-container textarea{min-height:150px}md-dialog.ivrCampaign-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.ivrCampaign-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.ivrCampaign-dialog .date-container{padding:16px 0 24px 0}md-dialog.ivrCampaign-dialog .error-list{font-size:13px}md-dialog.ivrCampaign-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.ivrCampaign-dialog .error-list .error .message{font-weight:500}md-dialog.ivrCampaign-dialog .error-list .error .md-button{margin:0}md-dialog.ivrCampaign-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.ivrCampaign-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.hopper-dialog{max-width:720px;width:720px}md-dialog.hopper-dialog md-dialog-content{display:block;position:relative}md-dialog.hopper-dialog md-toolbar .title{font-size:17px}md-dialog.hopper-dialog md-input-container textarea{min-height:150px}md-dialog.hopper-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.hopper-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.hopper-dialog .date-container{padding:16px 0 24px 0}md-dialog.hopper-dialog .error-list{font-size:13px}md-dialog.hopper-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.hopper-dialog .error-list .error .message{font-weight:500}md-dialog.hopper-dialog .error-list .error .md-button{margin:0}md-dialog.hopper-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.hopper-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#motiondialer-ivrCampaign .header{height:76px;min-height:76px;max-height:76px}#motiondialer-ivrCampaign .header .goto-ivrCampaigns-button{margin-right:16px}#motiondialer-ivrCampaign .header .ivrCampaign-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#motiondialer-ivrCampaign .header .ivrCampaign-image img{height:100%;width:auto;max-width:none}#motiondialer-ivrCampaign .header .subtitle{margin:6px 0 0 0}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container{padding:24px;margin-bottom:24px}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container .handle{cursor:move}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container md-input-container md-switch{margin:0!important}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader{position:relative}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader.dropping .drop-text{display:flex}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .upload-button{margin-bottom:16px}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .ivrCampaign-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .ivrCampaign-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .ivrCampaign-image .media{max-height:100%}#motiondialer-ivrCampaign md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#motiondialer-ivrCampaign md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#motiondialer-ivrCampaign md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#motiondialer-ivrCampaign md-table-container.font-size-12 td.md-cell{font-size:12px!important}#ivrCampaigns{position:relative}#ivrCampaigns>.header{height:76px;min-height:76px;max-height:76px}#ivrCampaigns>.header .logo .logo-icon{margin:0 16px 0 0}#ivrCampaigns>.header .logo .logo-text{font-size:24px}#ivrCampaigns>.header md-icon{color:#fff}#ivrCampaigns>.header .search-input-wrapper{position:relative}#ivrCampaigns>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#ivrCampaigns>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#ivrCampaigns>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#ivrCampaigns>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#ivrCampaigns>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#ivrCampaigns>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#ivrCampaigns>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#ivrCampaigns>.header.selected-bar .close-button-wrapper{width:244px}#ivrCampaigns>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#ivrCampaigns>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#ivrCampaigns>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#ivrCampaigns #add-ivrCampaign-button{position:fixed;bottom:8px;right:8px;padding:0}#ivrCampaigns #upload-ivrCampaign-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.queueCampaign-dialog{max-width:720px;width:720px}md-dialog.queueCampaign-dialog md-dialog-content{display:block;position:relative}md-dialog.queueCampaign-dialog md-toolbar .title{font-size:17px}md-dialog.queueCampaign-dialog md-input-container textarea{min-height:150px}md-dialog.queueCampaign-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.queueCampaign-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.queueCampaign-dialog .date-container{padding:16px 0 24px 0}md-dialog.queueCampaign-dialog .error-list{font-size:13px}md-dialog.queueCampaign-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.queueCampaign-dialog .error-list .error .message{font-weight:500}md-dialog.queueCampaign-dialog .error-list .error .md-button{margin:0}md-dialog.queueCampaign-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.queueCampaign-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.hopper-dialog{max-width:720px;width:720px}md-dialog.hopper-dialog md-dialog-content{display:block;position:relative}md-dialog.hopper-dialog md-toolbar .title{font-size:17px}md-dialog.hopper-dialog md-input-container textarea{min-height:150px}md-dialog.hopper-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.hopper-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.hopper-dialog .date-container{padding:16px 0 24px 0}md-dialog.hopper-dialog .error-list{font-size:13px}md-dialog.hopper-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.hopper-dialog .error-list .error .message{font-weight:500}md-dialog.hopper-dialog .error-list .error .md-button{margin:0}md-dialog.hopper-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.hopper-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#motiondialer-queueCampaign .header{height:76px;min-height:76px;max-height:76px}#motiondialer-queueCampaign .header .goto-queueCampaigns-button{margin-right:16px}#motiondialer-queueCampaign .header .queueCampaign-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#motiondialer-queueCampaign .header .queueCampaign-image img{height:100%;width:auto;max-width:none}#motiondialer-queueCampaign .header .subtitle{margin:6px 0 0 0}#motiondialer-queueCampaign .queueCampaign-detail-form-container{padding:24px;margin-bottom:24px}#motiondialer-queueCampaign .queueCampaign-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#motiondialer-queueCampaign .queueCampaign-detail-form-container .handle{cursor:move}#motiondialer-queueCampaign .queueCampaign-detail-form-container md-input-container md-switch{margin:0!important}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader{position:relative}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader.dropping .drop-text{display:flex}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .upload-button{margin-bottom:16px}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .queueCampaign-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .queueCampaign-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .queueCampaign-image .media{max-height:100%}#motiondialer-queueCampaign md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#motiondialer-queueCampaign md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#motiondialer-queueCampaign md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#motiondialer-queueCampaign md-table-container.font-size-12 td.md-cell{font-size:12px!important}#queueCampaigns{position:relative}#queueCampaigns>.header{height:76px;min-height:76px;max-height:76px}#queueCampaigns>.header .logo .logo-icon{margin:0 16px 0 0}#queueCampaigns>.header .logo .logo-text{font-size:24px}#queueCampaigns>.header md-icon{color:#fff}#queueCampaigns>.header .search-input-wrapper{position:relative}#queueCampaigns>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#queueCampaigns>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#queueCampaigns>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#queueCampaigns>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#queueCampaigns>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#queueCampaigns>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#queueCampaigns>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#queueCampaigns>.header.selected-bar .close-button-wrapper{width:244px}#queueCampaigns>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#queueCampaigns>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#queueCampaigns>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#queueCampaigns #add-queueCampaign-button{position:fixed;bottom:8px;right:8px;padding:0}#queueCampaigns #upload-queueCampaign-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.predictive-dialog{max-width:720px;width:720px}md-dialog.predictive-dialog md-dialog-content{display:block;position:relative}md-dialog.predictive-dialog md-toolbar .title{font-size:17px}md-dialog.predictive-dialog md-input-container textarea{min-height:150px}md-dialog.predictive-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.predictive-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.predictive-dialog .date-container{padding:16px 0 24px 0}md-dialog.predictive-dialog .error-list{font-size:13px}md-dialog.predictive-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.predictive-dialog .error-list .error .message{font-weight:500}md-dialog.predictive-dialog .error-list .error .md-button{margin:0}md-dialog.predictive-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.predictive-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.openchannelAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.openchannelCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.openchannelCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.openchannelCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelCannedAnswer-dialog .error-list{font-size:13px}md-dialog.openchannelCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#openchannel-openchannelAccount .header{height:76px;min-height:76px;max-height:76px}#openchannel-openchannelAccount .header .goto-openchannelAccounts-button{margin-right:16px}#openchannel-openchannelAccount .header .openchannelAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#openchannel-openchannelAccount .header .openchannelAccount-image img{height:100%;width:auto;max-width:none}#openchannel-openchannelAccount .header .subtitle{margin:6px 0 0 0}#openchannel-openchannelAccount .openchannelAccount-detail-form-container{padding:24px;margin-bottom:24px}#openchannel-openchannelAccount .openchannelAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#openchannel-openchannelAccount .openchannelAccount-detail-form-container .handle{cursor:move}#openchannel-openchannelAccount .openchannelAccount-detail-form-container md-input-container md-switch{margin:0!important}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader{position:relative}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader.dropping .drop-text{display:flex}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .upload-button{margin-bottom:16px}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .openchannelAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .openchannelAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .openchannelAccount-image .media{max-height:100%}#openchannel-openchannelAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#openchannel-openchannelAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#openchannel-openchannelAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#openchannel-openchannelAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#openchannel-openchannelAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#openchannel-openchannelAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#openchannel-openchannelAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#openchannel-openchannelAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#openchannel-openchannelAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#openchannel-openchannelAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#openchannel-openchannelAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#openchannel-openchannelAccount .actionAppData{width:80px!important}}#openchannelAccounts{position:relative}#openchannelAccounts>.header{height:76px;min-height:76px;max-height:76px}#openchannelAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#openchannelAccounts>.header .logo .logo-text{font-size:24px}#openchannelAccounts>.header md-icon{color:#fff}#openchannelAccounts>.header .search-input-wrapper{position:relative}#openchannelAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#openchannelAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#openchannelAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#openchannelAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#openchannelAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#openchannelAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#openchannelAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#openchannelAccounts>.header.selected-bar .close-button-wrapper{width:244px}#openchannelAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#openchannelAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#openchannelAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#openchannelAccounts #add-openchannelAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#openchannelAccounts #upload-openchannelAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.openchannelQueue-dialog{max-width:720px;width:720px}md-dialog.openchannelQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelQueue-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelQueue-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.openchannelQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.openchannelQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelQueue-dialog .error-list{font-size:13px}md-dialog.openchannelQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelQueue-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelQueue-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#openchannel-openchannelQueue .header{height:76px;min-height:76px;max-height:76px}#openchannel-openchannelQueue .header .goto-openchannelQueues-button{margin-right:16px}#openchannel-openchannelQueue .header .openchannelQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#openchannel-openchannelQueue .header .openchannelQueue-image img{height:100%;width:auto;max-width:none}#openchannel-openchannelQueue .header .subtitle{margin:6px 0 0 0}#openchannel-openchannelQueue .openchannelQueue-detail-form-container{padding:24px;margin-bottom:24px}#openchannel-openchannelQueue .openchannelQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#openchannel-openchannelQueue .openchannelQueue-detail-form-container .handle{cursor:move}#openchannel-openchannelQueue .openchannelQueue-detail-form-container md-input-container md-switch{margin:0!important}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader{position:relative}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader.dropping .drop-text{display:flex}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .upload-button{margin-bottom:16px}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .openchannelQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .openchannelQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .openchannelQueue-image .media{max-height:100%}#openchannel-openchannelQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#openchannel-openchannelQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#openchannel-openchannelQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#openchannel-openchannelQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#openchannelQueues{position:relative}#openchannelQueues>.header{height:76px;min-height:76px;max-height:76px}#openchannelQueues>.header .logo .logo-icon{margin:0 16px 0 0}#openchannelQueues>.header .logo .logo-text{font-size:24px}#openchannelQueues>.header md-icon{color:#fff}#openchannelQueues>.header .search-input-wrapper{position:relative}#openchannelQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#openchannelQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#openchannelQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#openchannelQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#openchannelQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#openchannelQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#openchannelQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#openchannelQueues>.header.selected-bar .close-button-wrapper{width:244px}#openchannelQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#openchannelQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#openchannelQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#openchannelQueues #add-openchannelQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#openchannelQueues #upload-openchannelQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}#plugin .filter-header{background-image:url(/assets/images/backgrounds/header-bg.png);color:#fff}#cloudProviders{position:relative}#cloudProviders>.header{height:76px;min-height:76px;max-height:76px}#cloudProviders>.header .logo .logo-icon{margin:0 16px 0 0}#cloudProviders>.header .logo .logo-text{font-size:24px}#cloudProviders>.header md-icon{color:#fff}#cloudProviders>.header .search-input-wrapper{position:relative}#cloudProviders>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#cloudProviders>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#cloudProviders>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#cloudProviders>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#cloudProviders>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#cloudProviders>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#cloudProviders>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#cloudProviders>.header.selected-bar .close-button-wrapper{width:244px}#cloudProviders>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#cloudProviders>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#cloudProviders>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#cloudProviders #add-cloudProvider-button{position:fixed;bottom:8px;right:8px;padding:0}#cloudProviders #upload-cloudProvider-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.cloudProvider-dialog{max-width:720px;width:720px}md-dialog.cloudProvider-dialog md-dialog-content{display:block;position:relative}md-dialog.cloudProvider-dialog md-toolbar .title{font-size:17px}md-dialog.cloudProvider-dialog md-input-container textarea{min-height:150px}md-dialog.cloudProvider-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.cloudProvider-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.cloudProvider-dialog .date-container{padding:16px 0 24px 0}md-dialog.cloudProvider-dialog .error-list{font-size:13px}md-dialog.cloudProvider-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cloudProvider-dialog .error-list .error .message{font-weight:500}md-dialog.cloudProvider-dialog .error-list .error .md-button{margin:0}md-dialog.cloudProvider-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cloudProvider-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.customization-dialog{max-width:720px;width:720px}md-dialog.customization-dialog md-dialog-content{display:block;position:relative}md-dialog.customization-dialog md-toolbar .title{font-size:17px}md-dialog.customization-dialog md-input-container textarea{min-height:150px}md-dialog.customization-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.customization-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.customization-dialog .date-container{padding:16px 0 24px 0}md-dialog.customization-dialog .error-list{font-size:13px}md-dialog.customization-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.customization-dialog .error-list .error .message{font-weight:500}md-dialog.customization-dialog .error-list .error .md-button{margin:0}md-dialog.customization-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.customization-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#customizations{position:relative}#customizations>.header{height:76px;min-height:76px;max-height:76px}#customizations>.header .logo .logo-icon{margin:0 16px 0 0}#customizations>.header .logo .logo-text{font-size:24px}#customizations>.header md-icon{color:#fff}#customizations>.header .search-input-wrapper{position:relative}#customizations>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#customizations>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#customizations>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#customizations>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#customizations>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#customizations>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#customizations>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#customizations>.header.selected-bar .close-button-wrapper{width:244px}#customizations>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#customizations>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#customizations>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#customizations>.content .customization-detail-form-container{padding:24px;margin-bottom:24px}#customizations>.content .customization-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#customizations>.content .customization-detail-form-container .handle{cursor:move}#customizations>.content .customization-detail-form-container md-input-container md-switch{margin:0!important}#customizations>.content .customization-detail-form-container #customization-image-uploader{position:relative}#customizations>.content .customization-detail-form-container #customization-image-uploader.dropping .drop-text{display:flex}#customizations>.content .customization-detail-form-container #customization-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#customizations>.content .customization-detail-form-container #customization-image-uploader .upload-button{margin-bottom:16px}#customizations>.content .customization-detail-form-container #customization-image-uploader .customization-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#customizations>.content .customization-detail-form-container #customization-image-uploader .customization-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#customizations>.content .customization-detail-form-container #customization-image-uploader .customization-image .media{max-height:100%}#customizations #add-customization-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.general-dialog{max-width:720px;width:720px}md-dialog.general-dialog md-dialog-content{display:block;position:relative}md-dialog.general-dialog md-toolbar .title{font-size:17px}md-dialog.general-dialog md-input-container textarea{min-height:150px}md-dialog.general-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.general-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.general-dialog .date-container{padding:16px 0 24px 0}md-dialog.general-dialog .error-list{font-size:13px}md-dialog.general-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.general-dialog .error-list .error .message{font-weight:500}md-dialog.general-dialog .error-list .error .md-button{margin:0}md-dialog.general-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.general-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#generals{position:relative}#generals>.header{height:76px;min-height:76px;max-height:76px}#generals>.header .logo .logo-icon{margin:0 16px 0 0}#generals>.header .logo .logo-text{font-size:24px}#generals>.header md-icon{color:#fff}#generals>.header .search-input-wrapper{position:relative}#generals>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#generals>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#generals>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#generals>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#generals>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#generals>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#generals>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#generals>.header.selected-bar .close-button-wrapper{width:244px}#generals>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#generals>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#generals>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#generals>.content .general-detail-form-container{padding:24px;margin-bottom:24px}#generals>.content .general-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#generals>.content .general-detail-form-container .handle{cursor:move}#generals>.content .general-detail-form-container md-input-container md-switch{margin:0!important}#generals>.content .general-detail-form-container #general-image-uploader{position:relative}#generals>.content .general-detail-form-container #general-image-uploader.dropping .drop-text{display:flex}#generals>.content .general-detail-form-container #general-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#generals>.content .general-detail-form-container #general-image-uploader .upload-button{margin-bottom:16px}#generals>.content .general-detail-form-container #general-image-uploader .general-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#generals>.content .general-detail-form-container #general-image-uploader .general-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#generals>.content .general-detail-form-container #general-image-uploader .general-image .media{max-height:100%}#generals #add-general-button{position:fixed;bottom:8px;right:8px;padding:0}#license{position:relative}#license .blink{animation:blinker 2s linear infinite}#license>.header{height:76px;min-height:76px;max-height:76px}#license>.header .logo .logo-icon{margin:0 16px 0 0}#license>.header .logo .logo-text{font-size:24px}#license>.header md-icon{color:#fff}#license>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#license>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#license>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#license>.content .badge{position:absolute;top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-size:11px;font-weight:500;padding:6px 8px}md-dialog.request-dialog{max-width:720px;width:720px}md-dialog.request-dialog md-dialog-content{display:block;position:relative}md-dialog.request-dialog md-toolbar .title{font-size:17px}md-dialog.request-dialog md-input-container textarea{min-height:150px}md-dialog.request-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.request-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.request-dialog .date-container{padding:16px 0 24px 0}md-dialog.request-dialog .error-list{font-size:13px}md-dialog.request-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.request-dialog .error-list .error .message{font-weight:500}md-dialog.request-dialog .error-list .error .md-button{margin:0}md-dialog.request-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.request-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.update-dialog{max-width:720px;width:720px}md-dialog.update-dialog md-dialog-content{display:block;position:relative}md-dialog.update-dialog md-toolbar .title{font-size:17px}md-dialog.update-dialog md-input-container textarea{min-height:60px}md-dialog.update-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.update-dialog .error-list{font-size:13px}md-dialog.update-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.update-dialog .error-list .error .message{font-weight:500}md-dialog.update-dialog .error-list .error .md-button{margin:0}md-dialog.update-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.update-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.network-dialog{max-width:720px;width:720px}md-dialog.network-dialog md-dialog-content{display:block;position:relative}md-dialog.network-dialog md-toolbar .title{font-size:17px}md-dialog.network-dialog md-input-container textarea{min-height:150px}md-dialog.network-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.network-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.network-dialog .date-container{padding:16px 0 24px 0}md-dialog.network-dialog .error-list{font-size:13px}md-dialog.network-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.network-dialog .error-list .error .message{font-weight:500}md-dialog.network-dialog .error-list .error .md-button{margin:0}md-dialog.network-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.network-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#networks{position:relative}#networks>.header{height:76px;min-height:76px;max-height:76px}#networks>.header .logo .logo-icon{margin:0 16px 0 0}#networks>.header .logo .logo-text{font-size:24px}#networks>.header md-icon{color:#fff}#networks>.header .search-input-wrapper{position:relative}#networks>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#networks>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#networks>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#networks>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#networks>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#networks>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#networks>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#networks>.header.selected-bar .close-button-wrapper{width:244px}#networks>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#networks>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#networks>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#networks #add-network-button{position:fixed;bottom:8px;right:8px;padding:0}#networks #upload-network-button{position:fixed;bottom:8px;right:8px;padding:0}#smtps{position:relative}#smtps>.header{height:76px;min-height:76px;max-height:76px}#smtps>.header .logo .logo-icon{margin:0 16px 0 0}#smtps>.header .logo .logo-text{font-size:24px}#smtps>.header md-icon{color:#fff}#smtps>.header .search-input-wrapper{position:relative}#smtps>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#smtps>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#smtps>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#smtps>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#smtps>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#smtps>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#smtps>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#smtps>.header.selected-bar .close-button-wrapper{width:244px}#smtps>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#smtps>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#smtps>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#smtps>.content .smtp-detail-form-container{padding:24px;margin-bottom:24px}#smtps>.content .smtp-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#smtps>.content .smtp-detail-form-container .handle{cursor:move}#smtps>.content .smtp-detail-form-container md-input-container md-switch{margin:0!important}#smtps>.content .smtp-detail-form-container #smtp-image-uploader{position:relative}#smtps>.content .smtp-detail-form-container #smtp-image-uploader.dropping .drop-text{display:flex}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .upload-button{margin-bottom:16px}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .smtp-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .smtp-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .smtp-image .media{max-height:100%}#smtps #add-smtp-button{position:fixed;bottom:8px;right:8px;padding:0}#system>.header{height:76px;min-height:76px;max-height:76px}#system>.header .logo .logo-icon{margin:0 16px 0 0}#system>.header .logo .logo-text{font-size:24px}#system>.header md-icon{color:#fff}#system .system-detail-form-container{padding:24px;margin-bottom:24px}#system .system-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#system .system-detail-form-container .handle{cursor:move}#system .system-detail-form-container md-input-container md-switch{margin:0!important}#system .system-detail-form-container #system-image-uploader{position:relative}#system .system-detail-form-container #system-image-uploader.dropping .drop-text{display:flex}#system .system-detail-form-container #system-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#system .system-detail-form-container #system-image-uploader .upload-button{margin-bottom:16px}#system .system-detail-form-container #system-image-uploader .system-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#system .system-detail-form-container #system-image-uploader .system-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#system .system-detail-form-container #system-image-uploader .system-image .media{max-height:100%}#updates{position:relative}#updates>.header{height:76px;min-height:76px;max-height:76px}#updates>.header .logo .logo-icon{margin:0 16px 0 0}#updates>.header .logo .logo-text{font-size:24px}#updates>.header md-icon{color:#fff}#updates>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#updates>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#updates>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.smsAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.smsCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.smsCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.smsCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.smsCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.smsCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.smsCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsCannedAnswer-dialog .error-list{font-size:13px}md-dialog.smsCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.smsCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.smsCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#sms-smsAccount .header{height:76px;min-height:76px;max-height:76px}#sms-smsAccount .header .goto-smsAccounts-button{margin-right:16px}#sms-smsAccount .header .smsAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#sms-smsAccount .header .smsAccount-image img{height:100%;width:auto;max-width:none}#sms-smsAccount .header .subtitle{margin:6px 0 0 0}#sms-smsAccount .smsAccount-detail-form-container{padding:24px;margin-bottom:24px}#sms-smsAccount .smsAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#sms-smsAccount .smsAccount-detail-form-container .handle{cursor:move}#sms-smsAccount .smsAccount-detail-form-container md-input-container md-switch{margin:0!important}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader{position:relative}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader.dropping .drop-text{display:flex}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .upload-button{margin-bottom:16px}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .smsAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .smsAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .smsAccount-image .media{max-height:100%}#sms-smsAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#sms-smsAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#sms-smsAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#sms-smsAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#sms-smsAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#sms-smsAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#sms-smsAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#sms-smsAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#sms-smsAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#sms-smsAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#sms-smsAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#sms-smsAccount .actionAppData{width:80px!important}}#smsAccounts{position:relative}#smsAccounts>.header{height:76px;min-height:76px;max-height:76px}#smsAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#smsAccounts>.header .logo .logo-text{font-size:24px}#smsAccounts>.header md-icon{color:#fff}#smsAccounts>.header .search-input-wrapper{position:relative}#smsAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#smsAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#smsAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#smsAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#smsAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#smsAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#smsAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#smsAccounts>.header.selected-bar .close-button-wrapper{width:244px}#smsAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#smsAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#smsAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#smsAccounts #add-smsAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#smsAccounts #upload-smsAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.smsQueue-dialog{max-width:720px;width:720px}md-dialog.smsQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.smsQueue-dialog md-toolbar .title{font-size:17px}md-dialog.smsQueue-dialog md-input-container textarea{min-height:150px}md-dialog.smsQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.smsQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.smsQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsQueue-dialog .error-list{font-size:13px}md-dialog.smsQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsQueue-dialog .error-list .error .message{font-weight:500}md-dialog.smsQueue-dialog .error-list .error .md-button{margin:0}md-dialog.smsQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#sms-smsQueue .header{height:76px;min-height:76px;max-height:76px}#sms-smsQueue .header .goto-smsQueues-button{margin-right:16px}#sms-smsQueue .header .smsQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#sms-smsQueue .header .smsQueue-image img{height:100%;width:auto;max-width:none}#sms-smsQueue .header .subtitle{margin:6px 0 0 0}#sms-smsQueue .smsQueue-detail-form-container{padding:24px;margin-bottom:24px}#sms-smsQueue .smsQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#sms-smsQueue .smsQueue-detail-form-container .handle{cursor:move}#sms-smsQueue .smsQueue-detail-form-container md-input-container md-switch{margin:0!important}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader{position:relative}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader.dropping .drop-text{display:flex}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .upload-button{margin-bottom:16px}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .smsQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .smsQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .smsQueue-image .media{max-height:100%}#sms-smsQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#sms-smsQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#sms-smsQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#sms-smsQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#smsQueues{position:relative}#smsQueues>.header{height:76px;min-height:76px;max-height:76px}#smsQueues>.header .logo .logo-icon{margin:0 16px 0 0}#smsQueues>.header .logo .logo-text{font-size:24px}#smsQueues>.header md-icon{color:#fff}#smsQueues>.header .search-input-wrapper{position:relative}#smsQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#smsQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#smsQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#smsQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#smsQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#smsQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#smsQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#smsQueues>.header.selected-bar .close-button-wrapper{width:244px}#smsQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#smsQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#smsQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#smsQueues #add-smsQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#smsQueues #upload-smsQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#agents{position:relative}#agents>.header{height:76px;min-height:76px;max-height:76px}#agents>.header .logo .logo-icon{margin:0 16px 0 0}#agents>.header .logo .logo-text{font-size:24px}#agents>.header md-icon{color:#fff}#agents>.header .search-input-wrapper{position:relative}#agents>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#agents>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#agents>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#agents>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#agents>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#agents>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#agents>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#agents>.header.selected-bar .close-button-wrapper{width:244px}#agents>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#agents>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#agents>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#agents #add-agent-button{position:fixed;bottom:8px;right:8px;padding:0}#agents #upload-agent-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.agent-dialog{max-width:720px;width:720px}md-dialog.agent-dialog md-dialog-content{display:block;position:relative}md-dialog.agent-dialog md-toolbar .title{font-size:17px}md-dialog.agent-dialog md-input-container textarea{min-height:150px}md-dialog.agent-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.agent-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.agent-dialog .date-container{padding:16px 0 24px 0}md-dialog.agent-dialog .error-list{font-size:13px}md-dialog.agent-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.agent-dialog .error-list .error .message{font-weight:500}md-dialog.agent-dialog .error-list .error .md-button{margin:0}md-dialog.agent-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.agent-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#staff-agent .header{height:76px;min-height:76px;max-height:76px}#staff-agent .header .goto-agents-button{margin-right:16px}#staff-agent .header .agent-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#staff-agent .header .agent-image img{height:100%;width:auto;max-width:none}#staff-agent .header .subtitle{margin:6px 0 0 0}#staff-agent .agent-detail-form-container{padding:24px;margin-bottom:24px}#staff-agent .agent-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#staff-agent .agent-detail-form-container .handle{cursor:move}#staff-agent .agent-detail-form-container md-input-container md-switch{margin:0!important}#staff-agent .agent-detail-form-container #agent-image-uploader{position:relative}#staff-agent .agent-detail-form-container #agent-image-uploader.dropping .drop-text{display:flex}#staff-agent .agent-detail-form-container #agent-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#staff-agent .agent-detail-form-container #agent-image-uploader .upload-button{margin-bottom:16px}#staff-agent .agent-detail-form-container #agent-image-uploader .agent-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#staff-agent .agent-detail-form-container #agent-image-uploader .agent-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#staff-agent .agent-detail-form-container #agent-image-uploader .agent-image .media{max-height:100%}#staff-agent md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#staff-agent md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#staff-agent md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#staff-agent md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.team-dialog{max-width:720px;width:720px}md-dialog.team-dialog md-dialog-content{display:block;position:relative}md-dialog.team-dialog md-toolbar .title{font-size:17px}md-dialog.team-dialog md-input-container textarea{min-height:150px}md-dialog.team-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.team-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.team-dialog .date-container{padding:16px 0 24px 0}md-dialog.team-dialog .error-list{font-size:13px}md-dialog.team-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.team-dialog .error-list .error .message{font-weight:500}md-dialog.team-dialog .error-list .error .md-button{margin:0}md-dialog.team-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.team-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#teams{position:relative}#teams>.header{height:76px;min-height:76px;max-height:76px}#teams>.header .logo .logo-icon{margin:0 16px 0 0}#teams>.header .logo .logo-text{font-size:24px}#teams>.header md-icon{color:#fff}#teams>.header .search-input-wrapper{position:relative}#teams>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#teams>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#teams>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#teams>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#teams>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#teams>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#teams>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#teams>.header.selected-bar .close-button-wrapper{width:244px}#teams>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#teams>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#teams>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#teams #add-team-button{position:fixed;bottom:8px;right:8px;padding:0}#teams #upload-team-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.telephone-dialog{max-width:720px;width:720px}md-dialog.telephone-dialog md-dialog-content{display:block;position:relative}md-dialog.telephone-dialog md-toolbar .title{font-size:17px}md-dialog.telephone-dialog md-input-container textarea{min-height:150px}md-dialog.telephone-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.telephone-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.telephone-dialog .date-container{padding:16px 0 24px 0}md-dialog.telephone-dialog .error-list{font-size:13px}md-dialog.telephone-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.telephone-dialog .error-list .error .message{font-weight:500}md-dialog.telephone-dialog .error-list .error .md-button{margin:0}md-dialog.telephone-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.telephone-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#staff-telephone .header{height:76px;min-height:76px;max-height:76px}#staff-telephone .header .goto-telephones-button{margin-right:16px}#staff-telephone .header .telephone-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#staff-telephone .header .telephone-image img{height:100%;width:auto;max-width:none}#staff-telephone .header .subtitle{margin:6px 0 0 0}#staff-telephone .telephone-detail-form-container{padding:24px;margin-bottom:24px}#staff-telephone .telephone-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#staff-telephone .telephone-detail-form-container .handle{cursor:move}#staff-telephone .telephone-detail-form-container md-input-container md-switch{margin:0!important}#staff-telephone .telephone-detail-form-container #telephone-image-uploader{position:relative}#staff-telephone .telephone-detail-form-container #telephone-image-uploader.dropping .drop-text{display:flex}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .upload-button{margin-bottom:16px}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .telephone-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .telephone-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .telephone-image .media{max-height:100%}#staff-telephone md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#staff-telephone md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#staff-telephone md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#staff-telephone md-table-container.font-size-12 td.md-cell{font-size:12px!important}#telephones{position:relative}#telephones>.header{height:76px;min-height:76px;max-height:76px}#telephones>.header .logo .logo-icon{margin:0 16px 0 0}#telephones>.header .logo .logo-text{font-size:24px}#telephones>.header md-icon{color:#fff}#telephones>.header .search-input-wrapper{position:relative}#telephones>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#telephones>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#telephones>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#telephones>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#telephones>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#telephones>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#telephones>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#telephones>.header.selected-bar .close-button-wrapper{width:244px}#telephones>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#telephones>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#telephones>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#telephones #add-telephone-button{position:fixed;bottom:8px;right:8px;padding:0}#telephones #upload-telephone-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.userProfile-dialog{max-width:720px;width:720px}md-dialog.userProfile-dialog md-dialog-content{display:block;position:relative}md-dialog.userProfile-dialog md-toolbar .title{font-size:17px}md-dialog.userProfile-dialog md-input-container textarea{min-height:150px}md-dialog.userProfile-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.userProfile-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.userProfile-dialog .date-container{padding:16px 0 24px 0}md-dialog.userProfile-dialog .error-list{font-size:13px}md-dialog.userProfile-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.userProfile-dialog .error-list .error .message{font-weight:500}md-dialog.userProfile-dialog .error-list .error .md-button{margin:0}md-dialog.userProfile-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.userProfile-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#staff-userProfile .header{height:76px;min-height:76px;max-height:76px}#staff-userProfile .header .goto-userProfiles-button{margin-right:16px}#staff-userProfile .header .userProfile-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#staff-userProfile .header .userProfile-image img{height:100%;width:auto;max-width:none}#staff-userProfile .header .subtitle{margin:6px 0 0 0}#staff-userProfile .userProfile-detail-form-container{padding:24px;margin-bottom:24px}#staff-userProfile .userProfile-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#staff-userProfile .userProfile-detail-form-container .handle{cursor:move}#staff-userProfile .userProfile-detail-form-container md-input-container md-switch{margin:0!important}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader{position:relative}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader.dropping .drop-text{display:flex}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .upload-button{margin-bottom:16px}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .userProfile-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .userProfile-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .userProfile-image .media{max-height:100%}#staff-userProfile md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#staff-userProfile md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#staff-userProfile md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#staff-userProfile md-table-container.font-size-12 td.md-cell{font-size:12px!important}#userProfiles{position:relative}#userProfiles>.header{height:76px;min-height:76px;max-height:76px}#userProfiles>.header .logo .logo-icon{margin:0 16px 0 0}#userProfiles>.header .logo .logo-text{font-size:24px}#userProfiles>.header md-icon{color:#fff}#userProfiles>.header .search-input-wrapper{position:relative}#userProfiles>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#userProfiles>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#userProfiles>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#userProfiles>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#userProfiles>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#userProfiles>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#userProfiles>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#userProfiles>.header.selected-bar .close-button-wrapper{width:244px}#userProfiles>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#userProfiles>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#userProfiles>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#userProfiles #add-userProfile-button{position:fixed;bottom:8px;right:8px;padding:0}#userProfiles #upload-userProfile-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.user-dialog{max-width:720px;width:720px}md-dialog.user-dialog md-dialog-content{display:block;position:relative}md-dialog.user-dialog md-toolbar .title{font-size:17px}md-dialog.user-dialog md-input-container textarea{min-height:150px}md-dialog.user-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.user-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.user-dialog .date-container{padding:16px 0 24px 0}md-dialog.user-dialog .error-list{font-size:13px}md-dialog.user-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.user-dialog .error-list .error .message{font-weight:500}md-dialog.user-dialog .error-list .error .md-button{margin:0}md-dialog.user-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.user-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#staff-user .header{height:76px;min-height:76px;max-height:76px}#staff-user .header .goto-users-button{margin-right:16px}#staff-user .header .user-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#staff-user .header .user-image img{height:100%;width:auto;max-width:none}#staff-user .header .subtitle{margin:6px 0 0 0}#staff-user .user-detail-form-container{padding:24px;margin-bottom:24px}#staff-user .user-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#staff-user .user-detail-form-container .handle{cursor:move}#staff-user .user-detail-form-container md-input-container md-switch{margin:0!important}#staff-user .user-detail-form-container #user-image-uploader{position:relative}#staff-user .user-detail-form-container #user-image-uploader.dropping .drop-text{display:flex}#staff-user .user-detail-form-container #user-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#staff-user .user-detail-form-container #user-image-uploader .upload-button{margin-bottom:16px}#staff-user .user-detail-form-container #user-image-uploader .user-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#staff-user .user-detail-form-container #user-image-uploader .user-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#staff-user .user-detail-form-container #user-image-uploader .user-image .media{max-height:100%}#staff-user md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#staff-user md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#staff-user md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#staff-user md-table-container.font-size-12 td.md-cell{font-size:12px!important}#users{position:relative}#users>.header{height:76px;min-height:76px;max-height:76px}#users>.header .logo .logo-icon{margin:0 16px 0 0}#users>.header .logo .logo-text{font-size:24px}#users>.header md-icon{color:#fff}#users>.header .search-input-wrapper{position:relative}#users>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#users>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#users>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#users>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#users>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#users>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#users>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#users>.header.selected-bar .close-button-wrapper{width:244px}#users>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#users>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#users>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#users #add-user-button{position:fixed;bottom:8px;right:8px;padding:0}#users #upload-user-button{position:fixed;bottom:8px;right:8px;padding:0}#cannedAnswers{position:relative}#cannedAnswers>.header{height:76px;min-height:76px;max-height:76px}#cannedAnswers>.header .logo .logo-icon{margin:0 16px 0 0}#cannedAnswers>.header .logo .logo-text{font-size:24px}#cannedAnswers>.header md-icon{color:#fff}#cannedAnswers>.header .search-input-wrapper{position:relative}#cannedAnswers>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#cannedAnswers>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#cannedAnswers>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#cannedAnswers>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#cannedAnswers>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#cannedAnswers>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#cannedAnswers>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#cannedAnswers>.header.selected-bar .close-button-wrapper{width:244px}#cannedAnswers>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#cannedAnswers>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#cannedAnswers>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#cannedAnswers #add-cannedAnswer-button{position:fixed;bottom:8px;right:8px;padding:0}#cannedAnswers #upload-cannedAnswer-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.cannedAnswer-dialog{max-width:720px;width:720px}md-dialog.cannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.cannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.cannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.cannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.cannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.cannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.cannedAnswer-dialog .error-list{font-size:13px}md-dialog.cannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.cannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.cannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.customDashboard-dialog{max-width:720px;width:720px}md-dialog.customDashboard-dialog md-dialog-content{display:block;position:relative}md-dialog.customDashboard-dialog md-toolbar .title{font-size:17px}md-dialog.customDashboard-dialog md-input-container textarea{min-height:150px}md-dialog.customDashboard-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.customDashboard-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.customDashboard-dialog .date-container{padding:16px 0 24px 0}md-dialog.customDashboard-dialog .error-list{font-size:13px}md-dialog.customDashboard-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.customDashboard-dialog .error-list .error .message{font-weight:500}md-dialog.customDashboard-dialog .error-list .error .md-button{margin:0}md-dialog.customDashboard-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.customDashboard-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#customDashboards{position:relative}#customDashboards>.header{height:76px;min-height:76px;max-height:76px}#customDashboards>.header .logo .logo-icon{margin:0 16px 0 0}#customDashboards>.header .logo .logo-text{font-size:24px}#customDashboards>.header md-icon{color:#fff}#customDashboards>.header .search-input-wrapper{position:relative}#customDashboards>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#customDashboards>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#customDashboards>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#customDashboards>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#customDashboards>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#customDashboards>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#customDashboards>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#customDashboards>.header.selected-bar .close-button-wrapper{width:244px}#customDashboards>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#customDashboards>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#customDashboards>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#customDashboards #add-customDashboard-button{position:fixed;bottom:8px;right:8px;padding:0}#customDashboards #upload-customDashboard-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.dashboarditem-dialog{max-width:720px;width:720px}md-dialog.dashboarditem-dialog md-dialog-content{display:block;position:relative}md-dialog.dashboarditem-dialog md-toolbar .title{font-size:17px}md-dialog.dashboarditem-dialog md-input-container textarea{min-height:150px}md-dialog.dashboarditem-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.dashboarditem-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.dashboarditem-dialog .date-container{padding:16px 0 24px 0}md-dialog.dashboarditem-dialog .error-list{font-size:13px}md-dialog.dashboarditem-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.dashboarditem-dialog .error-list .error .message{font-weight:500}md-dialog.dashboarditem-dialog .error-list .error .md-button{margin:0}md-dialog.dashboarditem-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.dashboarditem-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tools-customDashboard .header{height:76px;min-height:76px;max-height:76px}#tools-customDashboard .header .goto-customDashboards-button{margin-right:16px}#tools-customDashboard .header .customDashboard-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#tools-customDashboard .header .customDashboard-image img{height:100%;width:auto;max-width:none}#tools-customDashboard .header .subtitle{margin:6px 0 0 0}#tools-customDashboard .customDashboard-detail-form-container{padding:24px;margin-bottom:24px}#tools-customDashboard .customDashboard-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#tools-customDashboard .customDashboard-detail-form-container .handle{cursor:move}#tools-customDashboard .customDashboard-detail-form-container md-input-container md-switch{margin:0!important}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader{position:relative}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader.dropping .drop-text{display:flex}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .upload-button{margin-bottom:16px}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .customDashboard-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .customDashboard-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .customDashboard-image .media{max-height:100%}#tools-customDashboard md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#tools-customDashboard md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#tools-customDashboard md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#tools-customDashboard md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.disposition-dialog{max-width:720px;width:720px}md-dialog.disposition-dialog md-dialog-content{display:block;position:relative}md-dialog.disposition-dialog md-toolbar .title{font-size:17px}md-dialog.disposition-dialog md-input-container textarea{min-height:150px}md-dialog.disposition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.disposition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.disposition-dialog .date-container{padding:16px 0 24px 0}md-dialog.disposition-dialog .error-list{font-size:13px}md-dialog.disposition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.disposition-dialog .error-list .error .message{font-weight:500}md-dialog.disposition-dialog .error-list .error .md-button{margin:0}md-dialog.disposition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.disposition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#dispositions{position:relative}#dispositions>.header{height:76px;min-height:76px;max-height:76px}#dispositions>.header .logo .logo-icon{margin:0 16px 0 0}#dispositions>.header .logo .logo-text{font-size:24px}#dispositions>.header md-icon{color:#fff}#dispositions>.header .search-input-wrapper{position:relative}#dispositions>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#dispositions>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#dispositions>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#dispositions>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#dispositions>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#dispositions>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#dispositions>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#dispositions>.header.selected-bar .close-button-wrapper{width:244px}#dispositions>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#dispositions>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#dispositions>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#dispositions #add-disposition-button{position:fixed;bottom:8px;right:8px;padding:0}#dispositions #upload-disposition-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.interval-dialog{max-width:720px;width:720px}md-dialog.interval-dialog md-dialog-content{display:block;position:relative}md-dialog.interval-dialog md-toolbar .title{font-size:17px}md-dialog.interval-dialog md-input-container textarea{min-height:150px}md-dialog.interval-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.interval-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.interval-dialog .date-container{padding:16px 0 24px 0}md-dialog.interval-dialog .error-list{font-size:13px}md-dialog.interval-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.interval-dialog .error-list .error .message{font-weight:500}md-dialog.interval-dialog .error-list .error .md-button{margin:0}md-dialog.interval-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.interval-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.interval-dialog{max-width:720px;width:720px}md-dialog.interval-dialog md-dialog-content{display:block;position:relative}md-dialog.interval-dialog md-toolbar .title{font-size:17px}md-dialog.interval-dialog md-input-container textarea{min-height:150px}md-dialog.interval-dialog .date-container{padding:16px 0 24px 0}md-dialog.interval-dialog .error-list{font-size:13px}md-dialog.interval-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.interval-dialog .error-list .error .message{font-weight:500}md-dialog.interval-dialog .error-list .error .md-button{margin:0}md-dialog.interval-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.interval-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.interval-dialog{max-width:720px;width:720px}md-dialog.interval-dialog md-dialog-content{display:block;position:relative}md-dialog.interval-dialog md-toolbar .title{font-size:17px}md-dialog.interval-dialog md-input-container textarea{min-height:150px}md-dialog.interval-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.interval-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.interval-dialog .date-container{padding:16px 0 24px 0}md-dialog.interval-dialog .error-list{font-size:13px}md-dialog.interval-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.interval-dialog .error-list .error .message{font-weight:500}md-dialog.interval-dialog .error-list .error .md-button{margin:0}md-dialog.interval-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.interval-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tools-interval .header{height:76px;min-height:76px;max-height:76px}#tools-interval .header .goto-intervals-button{margin-right:16px}#tools-interval .header .interval-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#tools-interval .header .interval-image img{height:100%;width:auto;max-width:none}#tools-interval .header .subtitle{margin:6px 0 0 0}#tools-interval .interval-detail-form-container{padding:24px;margin-bottom:24px}#tools-interval .interval-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#tools-interval .interval-detail-form-container .handle{cursor:move}#tools-interval .interval-detail-form-container md-input-container md-switch{margin:0!important}#tools-interval .interval-detail-form-container #interval-image-uploader{position:relative}#tools-interval .interval-detail-form-container #interval-image-uploader.dropping .drop-text{display:flex}#tools-interval .interval-detail-form-container #interval-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#tools-interval .interval-detail-form-container #interval-image-uploader .upload-button{margin-bottom:16px}#tools-interval .interval-detail-form-container #interval-image-uploader .interval-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#tools-interval .interval-detail-form-container #interval-image-uploader .interval-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#tools-interval .interval-detail-form-container #interval-image-uploader .interval-image .media{max-height:100%}#tools-interval md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#tools-interval md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#tools-interval md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#tools-interval md-table-container.font-size-12 td.md-cell{font-size:12px!important}#intervals{position:relative}#intervals>.header{height:76px;min-height:76px;max-height:76px}#intervals>.header .logo .logo-icon{margin:0 16px 0 0}#intervals>.header .logo .logo-text{font-size:24px}#intervals>.header md-icon{color:#fff}#intervals>.header .search-input-wrapper{position:relative}#intervals>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#intervals>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#intervals>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#intervals>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#intervals>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#intervals>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#intervals>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#intervals>.header.selected-bar .close-button-wrapper{width:244px}#intervals>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#intervals>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#intervals>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#intervals #add-interval-button{position:fixed;bottom:8px;right:8px;padding:0}#intervals #upload-interval-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.pause-dialog{max-width:720px;width:720px}md-dialog.pause-dialog md-dialog-content{display:block;position:relative}md-dialog.pause-dialog md-toolbar .title{font-size:17px}md-dialog.pause-dialog md-input-container textarea{min-height:150px}md-dialog.pause-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.pause-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.pause-dialog .date-container{padding:16px 0 24px 0}md-dialog.pause-dialog .error-list{font-size:13px}md-dialog.pause-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.pause-dialog .error-list .error .message{font-weight:500}md-dialog.pause-dialog .error-list .error .md-button{margin:0}md-dialog.pause-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.pause-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#pauses{position:relative}#pauses>.header{height:76px;min-height:76px;max-height:76px}#pauses>.header .logo .logo-icon{margin:0 16px 0 0}#pauses>.header .logo .logo-text{font-size:24px}#pauses>.header md-icon{color:#fff}#pauses>.header .search-input-wrapper{position:relative}#pauses>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#pauses>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#pauses>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#pauses>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#pauses>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#pauses>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#pauses>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#pauses>.header.selected-bar .close-button-wrapper{width:244px}#pauses>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#pauses>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#pauses>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#pauses #add-pause-button{position:fixed;bottom:8px;right:8px;padding:0}#pauses #upload-pause-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.schedule-dialog{max-width:720px;width:720px}md-dialog.schedule-dialog md-dialog-content{display:block;position:relative}md-dialog.schedule-dialog md-toolbar .title{font-size:17px}md-dialog.schedule-dialog md-input-container textarea{min-height:150px}md-dialog.schedule-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.schedule-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.schedule-dialog .date-container{padding:16px 0 24px 0}md-dialog.schedule-dialog .error-list{font-size:13px}md-dialog.schedule-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.schedule-dialog .error-list .error .message{font-weight:500}md-dialog.schedule-dialog .error-list .error .md-button{margin:0}md-dialog.schedule-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.schedule-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#schedules{position:relative}#schedules>.header{height:76px;min-height:76px;max-height:76px}#schedules>.header .logo .logo-icon{margin:0 16px 0 0}#schedules>.header .logo .logo-text{font-size:24px}#schedules>.header md-icon{color:#fff}#schedules>.header .search-input-wrapper{position:relative}#schedules>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#schedules>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#schedules>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#schedules>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#schedules>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#schedules>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#schedules>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#schedules>.header.selected-bar .close-button-wrapper{width:244px}#schedules>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#schedules>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#schedules>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#schedules #add-schedule-button{position:fixed;bottom:8px;right:8px;padding:0}#schedules #upload-schedule-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.sound-dialog{max-width:720px;width:720px}md-dialog.sound-dialog md-dialog-content{display:block;position:relative}md-dialog.sound-dialog md-toolbar .title{font-size:17px}md-dialog.sound-dialog md-input-container textarea{min-height:150px}md-dialog.sound-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.sound-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.sound-dialog .date-container{padding:16px 0 24px 0}md-dialog.sound-dialog .error-list{font-size:13px}md-dialog.sound-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.sound-dialog .error-list .error .message{font-weight:500}md-dialog.sound-dialog .error-list .error .md-button{margin:0}md-dialog.sound-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.sound-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#sounds{position:relative}#sounds>.header{height:76px;min-height:76px;max-height:76px}#sounds>.header .logo .logo-icon{margin:0 16px 0 0}#sounds>.header .logo .logo-text{font-size:24px}#sounds>.header md-icon{color:#fff}#sounds>.header .search-input-wrapper{position:relative}#sounds>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#sounds>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#sounds>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#sounds>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#sounds>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#sounds>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#sounds>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#sounds>.header.selected-bar .close-button-wrapper{width:244px}#sounds>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#sounds>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#sounds>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#sounds #add-sound-button{position:fixed;bottom:8px;right:8px;padding:0}#sounds #upload-sound-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.upload-dialog{max-width:720px;width:720px}md-dialog.upload-dialog md-dialog-content{display:block;position:relative}md-dialog.upload-dialog md-toolbar .title{font-size:17px}md-dialog.upload-dialog md-input-container textarea{min-height:150px}md-dialog.upload-dialog md-progress-linear{padding-top:16px!important}md-dialog.upload-dialog .date-container{padding:16px 0 24px 0}md-dialog.upload-dialog .error-list{font-size:13px}md-dialog.upload-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.upload-dialog .error-list .error .message{font-weight:500}md-dialog.upload-dialog .error-list .error .md-button{margin:0}md-dialog.upload-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.upload-dialog .sound-image{overflow:hidden;max-width:148px;margin-right:16px;border:3px solid rgba(0,0,0,.12);padding:10px}md-dialog.upload-dialog .sound-image img{width:auto;max-width:none}md-dialog.upload-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.tag-dialog{max-width:720px;width:720px}md-dialog.tag-dialog md-dialog-content{display:block;position:relative}md-dialog.tag-dialog md-toolbar .title{font-size:17px}md-dialog.tag-dialog md-input-container textarea{min-height:150px}md-dialog.tag-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.tag-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.tag-dialog .date-container{padding:16px 0 24px 0}md-dialog.tag-dialog .error-list{font-size:13px}md-dialog.tag-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.tag-dialog .error-list .error .message{font-weight:500}md-dialog.tag-dialog .error-list .error .md-button{margin:0}md-dialog.tag-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.tag-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tags{position:relative}#tags>.header{height:76px;min-height:76px;max-height:76px}#tags>.header .logo .logo-icon{margin:0 16px 0 0}#tags>.header .logo .logo-text{font-size:24px}#tags>.header md-icon{color:#fff}#tags>.header .search-input-wrapper{position:relative}#tags>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#tags>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#tags>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#tags>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#tags>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#tags>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#tags>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#tags>.header.selected-bar .close-button-wrapper{width:244px}#tags>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#tags>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#tags>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#tags #add-tag-button{position:fixed;bottom:8px;right:8px;padding:0}#tags #upload-tag-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.template-dialog{max-width:720px;width:720px}md-dialog.template-dialog md-dialog-content{display:block;position:relative}md-dialog.template-dialog md-toolbar .title{font-size:17px}md-dialog.template-dialog md-input-container textarea{min-height:150px}md-dialog.template-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.template-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.template-dialog .date-container{padding:16px 0 24px 0}md-dialog.template-dialog .error-list{font-size:13px}md-dialog.template-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.template-dialog .error-list .error .message{font-weight:500}md-dialog.template-dialog .error-list .error .md-button{margin:0}md-dialog.template-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.template-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#templates{position:relative}#templates>.header{height:76px;min-height:76px;max-height:76px}#templates>.header .logo .logo-icon{margin:0 16px 0 0}#templates>.header .logo .logo-text{font-size:24px}#templates>.header md-icon{color:#fff}#templates>.header .search-input-wrapper{position:relative}#templates>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#templates>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#templates>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#templates>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#templates>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#templates>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#templates>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#templates>.header.selected-bar .close-button-wrapper{width:244px}#templates>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#templates>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#templates>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#templates #add-template-button{position:fixed;bottom:8px;right:8px;padding:0}#templates #upload-template-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.trigger-dialog{max-width:720px;width:720px}md-dialog.trigger-dialog md-dialog-content{display:block;position:relative}md-dialog.trigger-dialog md-toolbar .title{font-size:17px}md-dialog.trigger-dialog md-input-container textarea{min-height:150px}md-dialog.trigger-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.trigger-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.trigger-dialog .date-container{padding:16px 0 24px 0}md-dialog.trigger-dialog .error-list{font-size:13px}md-dialog.trigger-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.trigger-dialog .error-list .error .message{font-weight:500}md-dialog.trigger-dialog .error-list .error .md-button{margin:0}md-dialog.trigger-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.trigger-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.action-dialog{max-width:720px;width:720px}md-dialog.action-dialog md-dialog-content{display:block;position:relative}md-dialog.action-dialog md-toolbar .title{font-size:17px}md-dialog.action-dialog md-input-container textarea{min-height:150px}md-dialog.action-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.action-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.action-dialog .date-container{padding:16px 0 24px 0}md-dialog.action-dialog .error-list{font-size:13px}md-dialog.action-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.action-dialog .error-list .error .message{font-weight:500}md-dialog.action-dialog .error-list .error .md-button{margin:0}md-dialog.action-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.action-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.allCondition-dialog{max-width:720px;width:720px}md-dialog.allCondition-dialog md-dialog-content{display:block;position:relative}md-dialog.allCondition-dialog md-toolbar .title{font-size:17px}md-dialog.allCondition-dialog md-input-container textarea{min-height:150px}md-dialog.allCondition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.allCondition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.allCondition-dialog .date-container{padding:16px 0 24px 0}md-dialog.allCondition-dialog .error-list{font-size:13px}md-dialog.allCondition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.allCondition-dialog .error-list .error .message{font-weight:500}md-dialog.allCondition-dialog .error-list .error .md-button{margin:0}md-dialog.allCondition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.allCondition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.anyCondition-dialog{max-width:720px;width:720px}md-dialog.anyCondition-dialog md-dialog-content{display:block;position:relative}md-dialog.anyCondition-dialog md-toolbar .title{font-size:17px}md-dialog.anyCondition-dialog md-input-container textarea{min-height:150px}md-dialog.anyCondition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.anyCondition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.anyCondition-dialog .date-container{padding:16px 0 24px 0}md-dialog.anyCondition-dialog .error-list{font-size:13px}md-dialog.anyCondition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.anyCondition-dialog .error-list .error .message{font-weight:500}md-dialog.anyCondition-dialog .error-list .error .md-button{margin:0}md-dialog.anyCondition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.anyCondition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tools-trigger .header{height:76px;min-height:76px;max-height:76px}#tools-trigger .header .goto-triggers-button{margin-right:16px}#tools-trigger .header .trigger-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#tools-trigger .header .trigger-image img{height:100%;width:auto;max-width:none}#tools-trigger .header .subtitle{margin:6px 0 0 0}#tools-trigger .trigger-detail-form-container{padding:24px;margin-bottom:24px}#tools-trigger .trigger-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#tools-trigger .trigger-detail-form-container .handle{cursor:move}#tools-trigger .trigger-detail-form-container md-input-container md-switch{margin:0!important}#tools-trigger .trigger-detail-form-container #trigger-image-uploader{position:relative}#tools-trigger .trigger-detail-form-container #trigger-image-uploader.dropping .drop-text{display:flex}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .upload-button{margin-bottom:16px}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .trigger-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .trigger-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .trigger-image .media{max-height:100%}#tools-trigger md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#tools-trigger md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#tools-trigger md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#tools-trigger md-table-container.font-size-12 td.md-cell{font-size:12px!important}#triggers{position:relative}#triggers>.header{height:76px;min-height:76px;max-height:76px}#triggers>.header .logo .logo-icon{margin:0 16px 0 0}#triggers>.header .logo .logo-text{font-size:24px}#triggers>.header md-icon{color:#fff}#triggers>.header .search-input-wrapper{position:relative}#triggers>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#triggers>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#triggers>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#triggers>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#triggers>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#triggers>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#triggers>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#triggers>.header.selected-bar .close-button-wrapper{width:244px}#triggers>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#triggers>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#triggers>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#triggers #add-trigger-button{position:fixed;bottom:8px;right:8px;padding:0}#triggers #upload-trigger-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.trunk-dialog{max-width:720px;width:720px}md-dialog.trunk-dialog md-dialog-content{display:block;position:relative}md-dialog.trunk-dialog md-toolbar .title{font-size:17px}md-dialog.trunk-dialog md-input-container textarea{min-height:150px}md-dialog.trunk-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.trunk-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.trunk-dialog .date-container{padding:16px 0 24px 0}md-dialog.trunk-dialog .error-list{font-size:13px}md-dialog.trunk-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.trunk-dialog .error-list .error .message{font-weight:500}md-dialog.trunk-dialog .error-list .error .md-button{margin:0}md-dialog.trunk-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.trunk-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tools-trunk .header{height:76px;min-height:76px;max-height:76px}#tools-trunk .header .goto-trunks-button{margin-right:16px}#tools-trunk .header .trunk-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#tools-trunk .header .trunk-image img{height:100%;width:auto;max-width:none}#tools-trunk .header .subtitle{margin:6px 0 0 0}#tools-trunk .trunk-detail-form-container{padding:24px;margin-bottom:24px}#tools-trunk .trunk-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#tools-trunk .trunk-detail-form-container .handle{cursor:move}#tools-trunk .trunk-detail-form-container md-input-container md-switch{margin:0!important}#tools-trunk .trunk-detail-form-container #trunk-image-uploader{position:relative}#tools-trunk .trunk-detail-form-container #trunk-image-uploader.dropping .drop-text{display:flex}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .upload-button{margin-bottom:16px}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .trunk-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .trunk-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .trunk-image .media{max-height:100%}#tools-trunk md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#tools-trunk md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#tools-trunk md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#tools-trunk md-table-container.font-size-12 td.md-cell{font-size:12px!important}#trunks{position:relative}#trunks>.header{height:76px;min-height:76px;max-height:76px}#trunks>.header .logo .logo-icon{margin:0 16px 0 0}#trunks>.header .logo .logo-text{font-size:24px}#trunks>.header md-icon{color:#fff}#trunks>.header .search-input-wrapper{position:relative}#trunks>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#trunks>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#trunks>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#trunks>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#trunks>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#trunks>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#trunks>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#trunks>.header.selected-bar .close-button-wrapper{width:244px}#trunks>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#trunks>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#trunks>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#trunks #add-trunk-button{position:fixed;bottom:8px;right:8px;padding:0}#trunks #upload-trunk-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.variable-dialog{max-width:720px;width:720px}md-dialog.variable-dialog md-dialog-content{display:block;position:relative}md-dialog.variable-dialog md-toolbar .title{font-size:17px}md-dialog.variable-dialog md-input-container textarea{min-height:150px}md-dialog.variable-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.variable-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.variable-dialog .date-container{padding:16px 0 24px 0}md-dialog.variable-dialog .error-list{font-size:13px}md-dialog.variable-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.variable-dialog .error-list .error .message{font-weight:500}md-dialog.variable-dialog .error-list .error .md-button{margin:0}md-dialog.variable-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.variable-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#variables{position:relative}#variables>.header{height:76px;min-height:76px;max-height:76px}#variables>.header .logo .logo-icon{margin:0 16px 0 0}#variables>.header .logo .logo-text{font-size:24px}#variables>.header md-icon{color:#fff}#variables>.header .search-input-wrapper{position:relative}#variables>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#variables>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#variables>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#variables>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#variables>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#variables>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#variables>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#variables>.header.selected-bar .close-button-wrapper{width:244px}#variables>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#variables>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#variables>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#variables #add-variable-button{position:fixed;bottom:8px;right:8px;padding:0}#variables #upload-variable-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.screenRecording-dialog{max-width:720px;width:720px}md-dialog.screenRecording-dialog md-dialog-content{display:block;position:relative}md-dialog.screenRecording-dialog md-toolbar .title{font-size:17px}md-dialog.screenRecording-dialog md-input-container textarea{min-height:150px}md-dialog.screenRecording-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.screenRecording-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.screenRecording-dialog .date-container{padding:16px 0 24px 0}md-dialog.screenRecording-dialog .error-list{font-size:13px}md-dialog.screenRecording-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.screenRecording-dialog .error-list .error .message{font-weight:500}md-dialog.screenRecording-dialog .error-list .error .md-button{margin:0}md-dialog.screenRecording-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.screenRecording-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#screenRecordings{position:relative}#screenRecordings>.header{height:76px;min-height:76px;max-height:76px}#screenRecordings>.header .logo .logo-icon{margin:0 16px 0 0}#screenRecordings>.header .logo .logo-text{font-size:24px}#screenRecordings>.header md-icon{color:#fff}#screenRecordings>.header .search-input-wrapper{position:relative}#screenRecordings>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#screenRecordings>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#screenRecordings>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#screenRecordings>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#screenRecordings>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#screenRecordings>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#screenRecordings>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#screenRecordings>.header.selected-bar .close-button-wrapper{width:244px}#screenRecordings>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#screenRecordings>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#screenRecordings>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#screenRecordings #add-screenRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#screenRecordings #upload-screenRecording-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.voice-routing-dialog{max-width:720px;width:720px}md-dialog.voice-routing-dialog md-dialog-content{display:block;position:relative}md-dialog.voice-routing-dialog md-toolbar .title{font-size:17px}md-dialog.voice-routing-dialog md-input-container textarea{min-height:150px}md-dialog.voice-routing-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voice-routing-dialog .date-container{padding:16px 0 24px 0}md-dialog.voice-routing-dialog .error-list{font-size:13px}md-dialog.voice-routing-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voice-routing-dialog .error-list .error .message{font-weight:500}md-dialog.voice-routing-dialog .error-list .error .md-button{margin:0}md-dialog.voice-routing-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voice-routing-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.interval-dialog{max-width:720px;width:720px}md-dialog.interval-dialog md-dialog-content{display:block;position:relative}md-dialog.interval-dialog md-toolbar .title{font-size:17px}md-dialog.interval-dialog md-input-container textarea{min-height:150px}md-dialog.interval-dialog .date-container{padding:16px 0 24px 0}md-dialog.interval-dialog .error-list{font-size:13px}md-dialog.interval-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.interval-dialog .error-list .error .message{font-weight:500}md-dialog.interval-dialog .error-list .error .md-button{margin:0}md-dialog.interval-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.interval-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#chanSpies{position:relative}#chanSpies>.header{height:76px;min-height:76px;max-height:76px}#chanSpies>.header .logo .logo-icon{margin:0 16px 0 0}#chanSpies>.header .logo .logo-text{font-size:24px}#chanSpies>.header md-icon{color:#fff}#chanSpies>.header .search-input-wrapper{position:relative}#chanSpies>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#chanSpies>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#chanSpies>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#chanSpies>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#chanSpies>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#chanSpies>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#chanSpies>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#chanSpies>.header.selected-bar .close-button-wrapper{width:244px}#chanSpies>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#chanSpies>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#chanSpies>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#chanSpies #add-chanSpy-button{position:fixed;bottom:8px;right:8px;padding:0}#chanSpies #upload-chanSpy-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.chanSpy-dialog{max-width:720px;width:720px}md-dialog.chanSpy-dialog md-dialog-content{display:block;position:relative}md-dialog.chanSpy-dialog md-toolbar .title{font-size:17px}md-dialog.chanSpy-dialog md-input-container textarea{min-height:150px}md-dialog.chanSpy-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chanSpy-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chanSpy-dialog .date-container{padding:16px 0 24px 0}md-dialog.chanSpy-dialog .error-list{font-size:13px}md-dialog.chanSpy-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chanSpy-dialog .error-list .error .message{font-weight:500}md-dialog.chanSpy-dialog .error-list .error .md-button{margin:0}md-dialog.chanSpy-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chanSpy-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#contexts{position:relative}#contexts>.header{height:76px;min-height:76px;max-height:76px}#contexts>.header .logo .logo-icon{margin:0 16px 0 0}#contexts>.header .logo .logo-text{font-size:24px}#contexts>.header md-icon{color:#fff}#contexts>.header .search-input-wrapper{position:relative}#contexts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#contexts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#contexts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#contexts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#contexts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#contexts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#contexts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#contexts>.header.selected-bar .close-button-wrapper{width:244px}#contexts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#contexts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#contexts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#contexts #add-context-button{position:fixed;bottom:8px;right:8px;padding:0}#contexts #upload-context-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.context-dialog{max-width:720px;width:720px}md-dialog.context-dialog md-dialog-content{display:block;position:relative}md-dialog.context-dialog md-toolbar .title{font-size:17px}md-dialog.context-dialog md-input-container textarea{min-height:150px}md-dialog.context-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.context-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.context-dialog .date-container{padding:16px 0 24px 0}md-dialog.context-dialog .error-list{font-size:13px}md-dialog.context-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.context-dialog .error-list .error .message{font-weight:500}md-dialog.context-dialog .error-list .error .md-button{margin:0}md-dialog.context-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.context-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.inbound-route-dialog{max-width:720px;width:720px}md-dialog.inbound-route-dialog md-dialog-content{display:block;position:relative}md-dialog.inbound-route-dialog md-toolbar .title{font-size:17px}md-dialog.inbound-route-dialog md-input-container textarea{min-height:150px}md-dialog.inbound-route-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.inbound-route-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.inbound-route-dialog .date-container{padding:16px 0 24px 0}md-dialog.inbound-route-dialog .error-list{font-size:13px}md-dialog.inbound-route-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.inbound-route-dialog .error-list .error .message{font-weight:500}md-dialog.inbound-route-dialog .error-list .error .md-button{margin:0}md-dialog.inbound-route-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.inbound-route-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-inbound-route .header{height:76px;min-height:76px;max-height:76px}#voice-inbound-route .header .goto-inbound-routes-button{margin-right:16px}#voice-inbound-route .header .inbound-route-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-inbound-route .header .inbound-route-image img{height:100%;width:auto;max-width:none}#voice-inbound-route .header .subtitle{margin:6px 0 0 0}#voice-inbound-route .inbound-route-detail-form-container{padding:24px;margin-bottom:24px}#voice-inbound-route .inbound-route-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-inbound-route .inbound-route-detail-form-container .handle{cursor:move}#voice-inbound-route .inbound-route-detail-form-container md-input-container md-switch{margin:0!important}#voice-inbound-route md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-inbound-route md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-inbound-route md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-inbound-route md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#voice-inbound-route .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#voice-inbound-route .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#voice-inbound-route .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#voice-inbound-route .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#voice-inbound-route .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#voice-inbound-route .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#voice-inbound-route .actionAppData{width:150px!important}}@media screen and (max-width:960px){#voice-inbound-route .actionAppData{width:80px!important}}#inbound-routes{position:relative}#inbound-routes>.header{height:76px;min-height:76px;max-height:76px}#inbound-routes>.header .logo .logo-icon{margin:0 16px 0 0}#inbound-routes>.header .logo .logo-text{font-size:24px}#inbound-routes>.header md-icon{color:#fff}#inbound-routes>.header .search-input-wrapper{position:relative}#inbound-routes>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#inbound-routes>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#inbound-routes>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#inbound-routes>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#inbound-routes>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#inbound-routes>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#inbound-routes>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#inbound-routes>.header.selected-bar .close-button-wrapper{width:244px}#inbound-routes>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#inbound-routes>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#inbound-routes>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#inbound-routes #add-inbound-route-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.internal-route-dialog{max-width:720px;width:720px}md-dialog.internal-route-dialog md-dialog-content{display:block;position:relative}md-dialog.internal-route-dialog md-toolbar .title{font-size:17px}md-dialog.internal-route-dialog md-input-container textarea{min-height:150px}md-dialog.internal-route-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.internal-route-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.internal-route-dialog .date-container{padding:16px 0 24px 0}md-dialog.internal-route-dialog .error-list{font-size:13px}md-dialog.internal-route-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.internal-route-dialog .error-list .error .message{font-weight:500}md-dialog.internal-route-dialog .error-list .error .md-button{margin:0}md-dialog.internal-route-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.internal-route-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-internal-route .header{height:76px;min-height:76px;max-height:76px}#voice-internal-route .header .goto-internal-routes-button{margin-right:16px}#voice-internal-route .header .internal-route-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-internal-route .header .internal-route-image img{height:100%;width:auto;max-width:none}#voice-internal-route .header .subtitle{margin:6px 0 0 0}#voice-internal-route .internal-route-detail-form-container{padding:24px;margin-bottom:24px}#voice-internal-route .internal-route-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-internal-route .internal-route-detail-form-container .handle{cursor:move}#voice-internal-route .internal-route-detail-form-container md-input-container md-switch{margin:0!important}#voice-internal-route md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-internal-route md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-internal-route md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-internal-route md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#voice-internal-route .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#voice-internal-route .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#voice-internal-route .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#voice-internal-route .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#voice-internal-route .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#voice-internal-route .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#voice-internal-route .actionAppData{width:150px!important}}@media screen and (max-width:960px){#voice-internal-route .actionAppData{width:80px!important}}#internal-routes{position:relative}#internal-routes>.header{height:76px;min-height:76px;max-height:76px}#internal-routes>.header .logo .logo-icon{margin:0 16px 0 0}#internal-routes>.header .logo .logo-text{font-size:24px}#internal-routes>.header md-icon{color:#fff}#internal-routes>.header .search-input-wrapper{position:relative}#internal-routes>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#internal-routes>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#internal-routes>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#internal-routes>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#internal-routes>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#internal-routes>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#internal-routes>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#internal-routes>.header.selected-bar .close-button-wrapper{width:244px}#internal-routes>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#internal-routes>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#internal-routes>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#internal-routes #add-internal-route-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.musiconhold-dialog{max-width:720px;width:720px}md-dialog.musiconhold-dialog md-dialog-content{display:block;position:relative}md-dialog.musiconhold-dialog md-toolbar .title{font-size:17px}md-dialog.musiconhold-dialog md-input-container textarea{min-height:150px}md-dialog.musiconhold-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.musiconhold-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.musiconhold-dialog .date-container{padding:16px 0 24px 0}md-dialog.musiconhold-dialog .error-list{font-size:13px}md-dialog.musiconhold-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.musiconhold-dialog .error-list .error .message{font-weight:500}md-dialog.musiconhold-dialog .error-list .error .md-button{margin:0}md-dialog.musiconhold-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.musiconhold-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mohSound-dialog{max-width:720px;width:720px}md-dialog.mohSound-dialog md-dialog-content{display:block;position:relative}md-dialog.mohSound-dialog md-toolbar .title{font-size:17px}md-dialog.mohSound-dialog md-input-container textarea{min-height:150px}md-dialog.mohSound-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mohSound-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mohSound-dialog .date-container{padding:16px 0 24px 0}md-dialog.mohSound-dialog .error-list{font-size:13px}md-dialog.mohSound-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mohSound-dialog .error-list .error .message{font-weight:500}md-dialog.mohSound-dialog .error-list .error .md-button{margin:0}md-dialog.mohSound-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mohSound-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-musiconhold .header{height:76px;min-height:76px;max-height:76px}#voice-musiconhold .header .goto-musiconholds-button{margin-right:16px}#voice-musiconhold .header .musiconhold-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-musiconhold .header .musiconhold-image img{height:100%;width:auto;max-width:none}#voice-musiconhold .header .subtitle{margin:6px 0 0 0}#voice-musiconhold .musiconhold-detail-form-container{padding:24px;margin-bottom:24px}#voice-musiconhold .musiconhold-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-musiconhold .musiconhold-detail-form-container .handle{cursor:move}#voice-musiconhold .musiconhold-detail-form-container md-input-container md-switch{margin:0!important}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader{position:relative}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader.dropping .drop-text{display:flex}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .upload-button{margin-bottom:16px}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .musiconhold-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .musiconhold-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .musiconhold-image .media{max-height:100%}#voice-musiconhold md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-musiconhold md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-musiconhold md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-musiconhold md-table-container.font-size-12 td.md-cell{font-size:12px!important}#musiconholds{position:relative}#musiconholds>.header{height:76px;min-height:76px;max-height:76px}#musiconholds>.header .logo .logo-icon{margin:0 16px 0 0}#musiconholds>.header .logo .logo-text{font-size:24px}#musiconholds>.header md-icon{color:#fff}#musiconholds>.header .search-input-wrapper{position:relative}#musiconholds>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#musiconholds>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#musiconholds>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#musiconholds>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#musiconholds>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#musiconholds>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#musiconholds>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#musiconholds>.header.selected-bar .close-button-wrapper{width:244px}#musiconholds>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#musiconholds>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#musiconholds>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#musiconholds #add-musiconhold-button{position:fixed;bottom:8px;right:8px;padding:0}#musiconholds #upload-musiconhold-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.outbound-route-dialog{max-width:720px;width:720px}md-dialog.outbound-route-dialog md-dialog-content{display:block;position:relative}md-dialog.outbound-route-dialog md-toolbar .title{font-size:17px}md-dialog.outbound-route-dialog md-input-container textarea{min-height:150px}md-dialog.outbound-route-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.outbound-route-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.outbound-route-dialog .date-container{padding:16px 0 24px 0}md-dialog.outbound-route-dialog .error-list{font-size:13px}md-dialog.outbound-route-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.outbound-route-dialog .error-list .error .message{font-weight:500}md-dialog.outbound-route-dialog .error-list .error .md-button{margin:0}md-dialog.outbound-route-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.outbound-route-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-outbound-route .header{height:76px;min-height:76px;max-height:76px}#voice-outbound-route .header .goto-outbound-routes-button{margin-right:16px}#voice-outbound-route .header .outbound-route-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-outbound-route .header .outbound-route-image img{height:100%;width:auto;max-width:none}#voice-outbound-route .header .subtitle{margin:6px 0 0 0}#voice-outbound-route .outbound-route-detail-form-container{padding:24px;margin-bottom:24px}#voice-outbound-route .outbound-route-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-outbound-route .outbound-route-detail-form-container .handle{cursor:move}#voice-outbound-route .outbound-route-detail-form-container md-input-container md-switch{margin:0!important}#voice-outbound-route md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-outbound-route md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-outbound-route md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-outbound-route md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#voice-outbound-route .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#voice-outbound-route .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#voice-outbound-route .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#voice-outbound-route .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#voice-outbound-route .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#voice-outbound-route .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#voice-outbound-route .actionAppData{width:150px!important}}@media screen and (max-width:960px){#voice-outbound-route .actionAppData{width:80px!important}}#outbound-routes{position:relative}#outbound-routes>.header{height:76px;min-height:76px;max-height:76px}#outbound-routes>.header .logo .logo-icon{margin:0 16px 0 0}#outbound-routes>.header .logo .logo-text{font-size:24px}#outbound-routes>.header md-icon{color:#fff}#outbound-routes>.header .search-input-wrapper{position:relative}#outbound-routes>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#outbound-routes>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#outbound-routes>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#outbound-routes>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#outbound-routes>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#outbound-routes>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#outbound-routes>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#outbound-routes>.header.selected-bar .close-button-wrapper{width:244px}#outbound-routes>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#outbound-routes>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#outbound-routes>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#outbound-routes #add-outbound-route-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}#realtime>.content td.text-center span.text-boxed,#realtime>.content td.text-center span.text-boxed-light{display:block}@keyframes blinker{50%{opacity:0}}md-dialog.voicemail-dialog{max-width:720px;width:720px}md-dialog.voicemail-dialog md-dialog-content{display:block;position:relative}md-dialog.voicemail-dialog md-toolbar .title{font-size:17px}md-dialog.voicemail-dialog md-input-container textarea{min-height:150px}md-dialog.voicemail-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voicemail-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.voicemail-dialog .date-container{padding:16px 0 24px 0}md-dialog.voicemail-dialog .error-list{font-size:13px}md-dialog.voicemail-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voicemail-dialog .error-list .error .message{font-weight:500}md-dialog.voicemail-dialog .error-list .error .md-button{margin:0}md-dialog.voicemail-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voicemail-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-voicemail .header{height:76px;min-height:76px;max-height:76px}#voice-voicemail .header .goto-voicemails-button{margin-right:16px}#voice-voicemail .header .voicemail-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-voicemail .header .voicemail-image img{height:100%;width:auto;max-width:none}#voice-voicemail .header .subtitle{margin:6px 0 0 0}#voice-voicemail .voicemail-detail-form-container{padding:24px;margin-bottom:24px}#voice-voicemail .voicemail-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-voicemail .voicemail-detail-form-container .handle{cursor:move}#voice-voicemail .voicemail-detail-form-container md-input-container md-switch{margin:0!important}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader{position:relative}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader.dropping .drop-text{display:flex}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .upload-button{margin-bottom:16px}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .voicemail-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .voicemail-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .voicemail-image .media{max-height:100%}#voice-voicemail md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-voicemail md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-voicemail md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-voicemail md-table-container.font-size-12 td.md-cell{font-size:12px!important}#voicemails{position:relative}#voicemails>.header{height:76px;min-height:76px;max-height:76px}#voicemails>.header .logo .logo-icon{margin:0 16px 0 0}#voicemails>.header .logo .logo-text{font-size:24px}#voicemails>.header md-icon{color:#fff}#voicemails>.header .search-input-wrapper{position:relative}#voicemails>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#voicemails>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#voicemails>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#voicemails>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#voicemails>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#voicemails>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#voicemails>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#voicemails>.header.selected-bar .close-button-wrapper{width:244px}#voicemails>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#voicemails>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#voicemails>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#voicemails #add-voicemail-button{position:fixed;bottom:8px;right:8px;padding:0}#voicemails #upload-voicemail-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.voicePrefix-dialog{max-width:720px;width:720px}md-dialog.voicePrefix-dialog md-dialog-content{display:block;position:relative}md-dialog.voicePrefix-dialog md-toolbar .title{font-size:17px}md-dialog.voicePrefix-dialog md-input-container textarea{min-height:150px}md-dialog.voicePrefix-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voicePrefix-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.voicePrefix-dialog .date-container{padding:16px 0 24px 0}md-dialog.voicePrefix-dialog .error-list{font-size:13px}md-dialog.voicePrefix-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voicePrefix-dialog .error-list .error .message{font-weight:500}md-dialog.voicePrefix-dialog .error-list .error .md-button{margin:0}md-dialog.voicePrefix-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voicePrefix-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voicePrefixes{position:relative}#voicePrefixes>.header{height:76px;min-height:76px;max-height:76px}#voicePrefixes>.header .logo .logo-icon{margin:0 16px 0 0}#voicePrefixes>.header .logo .logo-text{font-size:24px}#voicePrefixes>.header md-icon{color:#fff}#voicePrefixes>.header .search-input-wrapper{position:relative}#voicePrefixes>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#voicePrefixes>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#voicePrefixes>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#voicePrefixes>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#voicePrefixes>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#voicePrefixes>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#voicePrefixes>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#voicePrefixes>.header.selected-bar .close-button-wrapper{width:244px}#voicePrefixes>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#voicePrefixes>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#voicePrefixes>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#voicePrefixes #add-voicePrefix-button{position:fixed;bottom:8px;right:8px;padding:0}#voicePrefixes #upload-voicePrefix-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.voiceQueue-dialog{max-width:720px;width:720px}md-dialog.voiceQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.voiceQueue-dialog md-toolbar .title{font-size:17px}md-dialog.voiceQueue-dialog md-input-container textarea{min-height:150px}md-dialog.voiceQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voiceQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.voiceQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.voiceQueue-dialog .error-list{font-size:13px}md-dialog.voiceQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voiceQueue-dialog .error-list .error .message{font-weight:500}md-dialog.voiceQueue-dialog .error-list .error .md-button{margin:0}md-dialog.voiceQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voiceQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-voiceQueue .header{height:76px;min-height:76px;max-height:76px}#voice-voiceQueue .header .goto-voiceQueues-button{margin-right:16px}#voice-voiceQueue .header .voiceQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-voiceQueue .header .voiceQueue-image img{height:100%;width:auto;max-width:none}#voice-voiceQueue .header .subtitle{margin:6px 0 0 0}#voice-voiceQueue .voiceQueue-detail-form-container{padding:24px;margin-bottom:24px}#voice-voiceQueue .voiceQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-voiceQueue .voiceQueue-detail-form-container .handle{cursor:move}#voice-voiceQueue .voiceQueue-detail-form-container md-input-container md-switch{margin:0!important}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader{position:relative}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader.dropping .drop-text{display:flex}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .upload-button{margin-bottom:16px}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .voiceQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .voiceQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .voiceQueue-image .media{max-height:100%}#voice-voiceQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-voiceQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-voiceQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-voiceQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#voiceQueues{position:relative}#voiceQueues>.header{height:76px;min-height:76px;max-height:76px}#voiceQueues>.header .logo .logo-icon{margin:0 16px 0 0}#voiceQueues>.header .logo .logo-text{font-size:24px}#voiceQueues>.header md-icon{color:#fff}#voiceQueues>.header .search-input-wrapper{position:relative}#voiceQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#voiceQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#voiceQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#voiceQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#voiceQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#voiceQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#voiceQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#voiceQueues>.header.selected-bar .close-button-wrapper{width:244px}#voiceQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#voiceQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#voiceQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#voiceQueues #add-voiceQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#voiceQueues #upload-voiceQueue-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.voiceRecording-dialog{max-width:720px;width:720px}md-dialog.voiceRecording-dialog md-dialog-content{display:block;position:relative}md-dialog.voiceRecording-dialog md-toolbar .title{font-size:17px}md-dialog.voiceRecording-dialog md-input-container textarea{min-height:150px}md-dialog.voiceRecording-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voiceRecording-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.voiceRecording-dialog .date-container{padding:16px 0 24px 0}md-dialog.voiceRecording-dialog .error-list{font-size:13px}md-dialog.voiceRecording-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voiceRecording-dialog .error-list .error .message{font-weight:500}md-dialog.voiceRecording-dialog .error-list .error .md-button{margin:0}md-dialog.voiceRecording-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voiceRecording-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-voiceRecording .header{height:76px;min-height:76px;max-height:76px}#voice-voiceRecording .header .goto-voiceRecordings-button{margin-right:16px}#voice-voiceRecording .header .voiceRecording-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-voiceRecording .header .voiceRecording-image img{height:100%;width:auto;max-width:none}#voice-voiceRecording .header .subtitle{margin:6px 0 0 0}#voice-voiceRecording .voiceRecording-detail-form-container{padding:24px;margin-bottom:24px}#voice-voiceRecording .voiceRecording-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-voiceRecording .voiceRecording-detail-form-container .handle{cursor:move}#voice-voiceRecording .voiceRecording-detail-form-container md-input-container md-switch{margin:0!important}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader{position:relative}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader.dropping .drop-text{display:flex}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .upload-button{margin-bottom:16px}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .voiceRecording-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .voiceRecording-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .voiceRecording-image .media{max-height:100%}#voice-voiceRecording md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-voiceRecording md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-voiceRecording md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-voiceRecording md-table-container.font-size-12 td.md-cell{font-size:12px!important}#voice-voiceRecording .sentiment.POSITIVE{color:#4caf50;font-size:25px}#voice-voiceRecording .sentiment.NEGATIVE{color:#f40505;font-size:30px}#voice-voiceRecording .sentiment.NEUTRAL{color:#03a9f4;font-size:30px}#voice-voiceRecording .sentiment.MIXED{color:#9c27b0;font-size:30px}#voiceRecordings{position:relative}#voiceRecordings>.header{height:76px;min-height:76px;max-height:76px}#voiceRecordings>.header .logo .logo-icon{margin:0 16px 0 0}#voiceRecordings>.header .logo .logo-text{font-size:24px}#voiceRecordings>.header md-icon{color:#fff}#voiceRecordings>.header .search-input-wrapper{position:relative}#voiceRecordings>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#voiceRecordings>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#voiceRecordings>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#voiceRecordings>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#voiceRecordings>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#voiceRecordings>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#voiceRecordings>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#voiceRecordings>.header.selected-bar .close-button-wrapper{width:244px}#voiceRecordings>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#voiceRecordings>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#voiceRecordings>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#voiceRecordings #add-voiceRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#voiceRecordings #upload-voiceRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.whatsappAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#whatsapp-whatsappAccount .header{height:76px;min-height:76px;max-height:76px}#whatsapp-whatsappAccount .header .goto-whatsappAccounts-button{margin-right:16px}#whatsapp-whatsappAccount .header .whatsappAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#whatsapp-whatsappAccount .header .whatsappAccount-image img{height:100%;width:auto;max-width:none}#whatsapp-whatsappAccount .header .subtitle{margin:6px 0 0 0}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container{padding:24px;margin-bottom:24px}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container .handle{cursor:move}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container md-input-container md-switch{margin:0!important}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader{position:relative}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader.dropping .drop-text{display:flex}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .upload-button{margin-bottom:16px}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .whatsappAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .whatsappAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .whatsappAccount-image .media{max-height:100%}#whatsapp-whatsappAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#whatsapp-whatsappAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#whatsapp-whatsappAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#whatsapp-whatsappAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#whatsapp-whatsappAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#whatsapp-whatsappAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#whatsapp-whatsappAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#whatsapp-whatsappAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#whatsapp-whatsappAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#whatsapp-whatsappAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#whatsapp-whatsappAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#whatsapp-whatsappAccount .actionAppData{width:80px!important}}md-dialog.whatsappCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.whatsappCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.whatsappCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.whatsappCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappCannedAnswer-dialog .error-list{font-size:13px}md-dialog.whatsappCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#whatsappAccounts{position:relative}#whatsappAccounts>.header{height:76px;min-height:76px;max-height:76px}#whatsappAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#whatsappAccounts>.header .logo .logo-text{font-size:24px}#whatsappAccounts>.header md-icon{color:#fff}#whatsappAccounts>.header .search-input-wrapper{position:relative}#whatsappAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#whatsappAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#whatsappAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#whatsappAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#whatsappAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#whatsappAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#whatsappAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#whatsappAccounts>.header.selected-bar .close-button-wrapper{width:244px}#whatsappAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#whatsappAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#whatsappAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#whatsappAccounts #add-whatsappAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#whatsappAccounts #upload-whatsappAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.whatsappQueue-dialog{max-width:720px;width:720px}md-dialog.whatsappQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappQueue-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappQueue-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.whatsappQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.whatsappQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappQueue-dialog .error-list{font-size:13px}md-dialog.whatsappQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappQueue-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappQueue-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#whatsapp-whatsappQueue .header{height:76px;min-height:76px;max-height:76px}#whatsapp-whatsappQueue .header .goto-whatsappQueues-button{margin-right:16px}#whatsapp-whatsappQueue .header .whatsappQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#whatsapp-whatsappQueue .header .whatsappQueue-image img{height:100%;width:auto;max-width:none}#whatsapp-whatsappQueue .header .subtitle{margin:6px 0 0 0}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container{padding:24px;margin-bottom:24px}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container .handle{cursor:move}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container md-input-container md-switch{margin:0!important}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader{position:relative}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader.dropping .drop-text{display:flex}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .upload-button{margin-bottom:16px}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .whatsappQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .whatsappQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .whatsappQueue-image .media{max-height:100%}#whatsapp-whatsappQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#whatsapp-whatsappQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#whatsapp-whatsappQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#whatsapp-whatsappQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#whatsappQueues{position:relative}#whatsappQueues>.header{height:76px;min-height:76px;max-height:76px}#whatsappQueues>.header .logo .logo-icon{margin:0 16px 0 0}#whatsappQueues>.header .logo .logo-text{font-size:24px}#whatsappQueues>.header md-icon{color:#fff}#whatsappQueues>.header .search-input-wrapper{position:relative}#whatsappQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#whatsappQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#whatsappQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#whatsappQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#whatsappQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#whatsappQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#whatsappQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#whatsappQueues>.header.selected-bar .close-button-wrapper{width:244px}#whatsappQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#whatsappQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#whatsappQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#whatsappQueues #add-whatsappQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#whatsappQueues #upload-whatsappQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation{width:240px;min-width:240px;max-width:240px;overflow-x:hidden;transition:all .3s cubic-bezier(.55,0,.55,.2),width .1s linear,min-width .1s linear,max-width .1s linear;box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}#layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation .navigation-header{height:64px;min-height:64px;background-color:rgba(255,255,255,.05);padding:0 16px 0 24px}#layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation:not(._md-locked-open){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}@media only screen and (min-width:960px){.ms-navigation-folded #content-container{margin-left:64px}.ms-navigation-folded #layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation{position:absolute}.ms-navigation-folded:not(.ms-navigation-folded-open) #layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation{position:absolute;width:64px;min-width:64px;max-width:64px}.ms-navigation-folded:not(.ms-navigation-folded-open) #layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation .navigation-header{padding:0 16px}.ms-navigation-folded:not(.ms-navigation-folded-open) #layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation .navigation-header .logo-text{display:none}}#vertical-navigation{width:240px;min-width:240px;max-width:240px;overflow-x:hidden;transition:all .3s cubic-bezier(.55,0,.55,.2),width .1s linear,min-width .1s linear,max-width .1s linear;box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}#vertical-navigation .navigation-header{height:64px;min-height:64px;background-color:rgba(255,255,255,.05);padding:0 16px 0 24px}#vertical-navigation .navigation-header .logo .logo-image{display:block;width:32px;min-width:32px;height:32px;line-height:32px;text-align:center;font-size:16px;font-weight:500;color:#fff;border-radius:2px}#vertical-navigation .navigation-header .logo .logo-text{color:#fff;margin-left:16px;font-size:16px}#vertical-navigation .navigation-header .fold-toggle{transition:transform .3s ease-in-out .1s;transform:rotate(0);margin:0;padding:8px;width:34px!important;height:34px!important;cursor:pointer}#vertical-navigation:not(._md-locked-open){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}@media only screen and (min-width:960px){.ms-navigation-folded #content-container{margin-left:64px}.ms-navigation-folded #vertical-navigation{position:absolute}.ms-navigation-folded #vertical-navigation .navigation-header .fold-toggle{transform:rotate(180deg);opacity:0}.ms-navigation-folded.ms-navigation-folded-open #vertical-navigation .navigation-header .fold-toggle{transition:transform .3s ease-in-out .1s,opacity .3s ease-in-out .2s;opacity:1}.ms-navigation-folded:not(.ms-navigation-folded-open) #vertical-navigation{position:absolute;width:64px;min-width:64px;max-width:64px}.ms-navigation-folded:not(.ms-navigation-folded-open) #vertical-navigation .navigation-header{padding:0 16px}.ms-navigation-folded:not(.ms-navigation-folded-open) #vertical-navigation .navigation-header .logo-text{display:none}}#quick-panel{width:330px;min-width:330px;max-width:330px;z-index:99}#quick-panel md-content{height:100%}#quick-panel md-content md-tabs{position:static;height:100%}#quick-panel md-content md-tabs md-tabs-wrapper{background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.06)}#quick-panel md-content md-tabs md-tabs-wrapper .md-tab{max-width:none!important}#quick-panel md-content md-tabs md-tabs-content-wrapper md-tab-content{height:100%;overflow:hidden}#quick-panel md-content md-tabs md-tabs-content-wrapper md-tab-content>div{overflow:hidden;height:100%}.unread-message-count-chat{position:absolute;top:5px;left:10px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:10px}@media screen and (max-width:600px){#quick-panel{width:80%;min-width:80%;max-width:80%}}#quick-panel .activity-tab .friends .friend{position:relative}#quick-panel .activity-tab .friends .friend .status{position:absolute;top:8px;left:44px;width:18px;height:18px;z-index:10;border-radius:50%;border:3px solid #fff}#quick-panel .activity-tab .friends .friend .status.online{background-color:#00c853}#quick-panel .activity-tab .friends .friend .status.offline{background-color:#d50000}#quick-panel .activity-tab .friends .friend .status.away{background-color:#ff6d00}#quick-panel .activity-tab .friends .friend .unread-message-count{position:absolute;left:16px;bottom:16px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:11px}#quick-panel .activity-tab .servers .server .status{margin:24px 20px 28px 8px}#quick-panel .activity-tab .servers .server .status.normal{color:#00c853}#quick-panel .activity-tab .servers .server .status.warn{color:#d50000}#quick-panel .activity-tab .servers .server .status.error{color:#ff6d00}#quick-panel .activity-tab .stat md-progress-linear.normal .md-bar{background-color:#00c853}#quick-panel .activity-tab .stat md-progress-linear.normal .md-container{background-color:rgba(0,200,83,.3)}#quick-panel .activity-tab .stat md-progress-linear.warn .md-bar{background-color:#ff6d00}#quick-panel .activity-tab .stat md-progress-linear.warn .md-container{background-color:rgba(255,109,0,.3)}#quick-panel .activity-tab .stat md-progress-linear.alert .md-bar{background-color:#d50000}#quick-panel .activity-tab .stat md-progress-linear.alert .md-container{background-color:rgba(213,0,0,.3)}#quick-panel .chat-tab .chat,#quick-panel .chat-tab .main{position:absolute;width:100%;top:0;bottom:0}#quick-panel .chat-tab .main .contact{position:relative}#quick-panel .chat-tab .main .contact .status{position:absolute;top:8px;left:44px;width:18px;height:18px;border:3px solid #fff;border-radius:50%;z-index:10}#quick-panel .chat-tab .main .contact .status.online{background-color:#00c853}#quick-panel .chat-tab .main .contact .status.offline{background-color:#d50000}#quick-panel .chat-tab .main .contact .status.away{background-color:#ff6d00}#quick-panel .chat-tab .main .contact .unread-message-count{position:absolute;left:16px;bottom:16px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:11px}#quick-panel .chat-tab .main .recent .contact .status{top:18px}#quick-panel .chat-tab .chat{max-height:100%;overflow:hidden}#quick-panel .chat-tab .chat .message-row .bubble{position:relative;padding:8px;background-color:#eceff1;border:1px solid #dcdfe1}#quick-panel .chat-tab .chat .message-row .bubble:after,#quick-panel .chat-tab .chat .message-row .bubble:before{content:' ';position:absolute;width:0;height:0}#quick-panel .chat-tab .chat .message-row .bubble:after{left:-7px;right:auto;top:0;bottom:auto;border:11px solid;border-color:#eceff1 transparent transparent transparent}#quick-panel .chat-tab .chat .message-row .bubble:before{left:-9px;right:auto;top:-1px;bottom:auto;border:8px solid;border-color:#dcdfe1 transparent transparent transparent}#quick-panel .chat-tab .chat .message-row .bubble .time{font-size:11px;margin-top:8px}#quick-panel .chat-tab .chat .message-row .bubble .message{word-wrap:break-word}#quick-panel .chat-tab .chat .message-row.contact .avatar{margin:0 16px 0 0}#quick-panel .chat-tab .chat .message-row.user{align-items:flex-end}#quick-panel .chat-tab .chat .message-row.user .avatar{order:2;margin:0 0 0 16px}#quick-panel .chat-tab .chat .message-row.user .bubble{background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#quick-panel .chat-tab .chat .message-row.user .bubble:after{right:-7px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#quick-panel .chat-tab .chat .message-row.user .bubble:before{right:-9px;left:auto;top:auto;bottom:-1px;border-color:transparent transparent #dfebe0 transparent}#quick-panel .chat-tab .chat .reply{border-top:1px solid rgba(0,0,0,.12)}#quick-panel .chat-tab .chat .reply textarea{margin:8px;resize:none;padding:8px 16px 8px 8px}md-dialog.group-dialog{max-width:720px;width:720px}md-dialog.group-dialog md-dialog-content{display:block;position:relative}md-dialog.group-dialog md-toolbar .title{font-size:17px}md-dialog.group-dialog md-input-container textarea{min-height:150px}md-dialog.group-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.group-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.group-dialog .date-container{padding:16px 0 24px 0}md-dialog.group-dialog .error-list{font-size:13px}md-dialog.group-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.group-dialog .error-list .error .message{font-weight:500}md-dialog.group-dialog .error-list .error .md-button{margin:0}md-dialog.group-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.group-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#quick-panel .group-tab .chat,#quick-panel .group-tab .main{position:absolute;width:100%;top:0;bottom:0}#quick-panel .group-tab .main .contact{position:relative}#quick-panel .group-tab .main .contact .status{position:absolute;top:8px;left:44px;width:18px;height:18px;border:3px solid #fff;border-radius:50%;z-index:10}#quick-panel .group-tab .main .contact .status.online{background-color:#00c853}#quick-panel .group-tab .main .contact .status.offline{background-color:#d50000}#quick-panel .group-tab .main .contact .status.away{background-color:#ff6d00}#quick-panel .group-tab .main .contact .unread-message-count{position:absolute;left:16px;bottom:16px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:11px}#quick-panel .group-tab .main .recent .contact .status{top:18px}#quick-panel .group-tab .chat{max-height:100%;overflow:hidden}#quick-panel .group-tab .chat .message-row{padding:8px}#quick-panel .group-tab .chat .message-row .bubble{position:relative;padding:8px;background-color:#eceff1;border:1px solid #dcdfe1}#quick-panel .group-tab .chat .message-row .bubble:after,#quick-panel .group-tab .chat .message-row .bubble:before{content:' ';position:absolute;width:0;height:0}#quick-panel .group-tab .chat .message-row .bubble:after{left:-7px;right:auto;top:0;bottom:auto;border:11px solid;border-color:#eceff1 transparent transparent transparent}#quick-panel .group-tab .chat .message-row .bubble:before{left:-9px;right:auto;top:-1px;bottom:auto;border:8px solid;border-color:#dcdfe1 transparent transparent transparent}#quick-panel .group-tab .chat .message-row .bubble .time{font-size:11px;margin-top:8px}#quick-panel .group-tab .chat .message-row .bubble .message{word-wrap:break-word}#quick-panel .group-tab .chat .message-row.contact .avatar{margin:0 16px 0 0}#quick-panel .group-tab .chat .message-row.user{align-items:flex-end}#quick-panel .group-tab .chat .message-row.user .avatar{order:2;margin:0 0 0 16px}#quick-panel .group-tab .chat .message-row.user .bubble{background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#quick-panel .group-tab .chat .message-row.user .bubble:after{right:-7px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#quick-panel .group-tab .chat .message-row.user .bubble:before{right:-9px;left:auto;top:auto;bottom:-1px;border-color:transparent transparent #dfebe0 transparent}#quick-panel .group-tab .chat .reply{border-top:1px solid rgba(0,0,0,.12)}#quick-panel .group-tab .chat .reply textarea{margin:8px;resize:none;padding:8px 16px 8px 8px}md-dialog.group-dialog{max-width:720px;width:720px}md-dialog.group-dialog md-dialog-content{display:block;position:relative}md-dialog.group-dialog md-toolbar .title{font-size:17px}md-dialog.group-dialog md-input-container textarea{min-height:150px}md-dialog.group-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.group-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.group-dialog .date-container{padding:16px 0 24px 0}md-dialog.group-dialog .error-list{font-size:13px}md-dialog.group-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.group-dialog .error-list .error .message{font-weight:500}md-dialog.group-dialog .error-list .error .md-button{margin:0}md-dialog.group-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.group-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#reset-password{height:100%;background:url(/assets/images/backgrounds/tech.png) no-repeat;background-size:cover}#reset-password #reset-password-form-wrapper{flex:1 0 auto;padding:32px}#reset-password #reset-password-form-wrapper #reset-password-form{width:384px;max-width:384px;padding:32px;text-align:center;background:#fff}#reset-password #reset-password-form-wrapper #reset-password-form .logo{width:128px;height:128px;line-height:128px;font-size:86px;font-weight:500;margin:32px auto;color:#fff;border-radius:2px}#reset-password #reset-password-form-wrapper #reset-password-form .title{font-size:17px;margin:16px 0 32px 0}#reset-password #reset-password-form-wrapper #reset-password-form .logo_login{max-height:200px}#reset-password #reset-password-form-wrapper #reset-password-form form{width:100%;text-align:left}#reset-password #reset-password-form-wrapper #reset-password-form form .submit-button{width:220px;margin:16px auto;display:block}#reset-password #reset-password-form-wrapper #reset-password-form .login{margin:32px auto 24px auto;width:250px;font-weight:500}#reset-password #reset-password-form-wrapper #reset-password-form .login .text{margin-right:8px}@media screen and (max-width:600px){#reset-password #reset-password-form-wrapper{padding:16px}#reset-password #reset-password-form-wrapper #reset-password-form{padding:24px;width:100%}#reset-password #reset-password-form-wrapper #reset-password-form form .md-button{width:90%}}md-dialog.preview-dialog{max-width:1020px;width:1020px}md-dialog.preview-dialog md-dialog-content{display:block;position:relative;padding:0}md-dialog.preview-dialog md-dialog-content .recall-me-info{position:relative;overflow-y:hidden;overflow-x:auto;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.12);min-height:64px;padding:8px 8px 8px 16px}md-dialog.preview-dialog md-toolbar .title{font-size:17px}md-dialog.preview-dialog md-input-container textarea{min-height:150px}md-dialog.preview-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.preview-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.preview-dialog .date-container{padding:16px 0 24px 0}md-dialog.preview-dialog .error-list{font-size:13px}md-dialog.preview-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.preview-dialog .error-list .error .message{font-weight:500}md-dialog.preview-dialog .error-list .error .md-button{margin:0}md-dialog.preview-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.preview-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#toolbar{width:100%;height:64px;min-height:64px;max-height:64px;z-index:55!important}#toolbar .blink{animation:blinker 2s linear infinite}#toolbar #navigation-toggle{width:64px;min-width:64px;height:64px;margin:0;border-right:1px solid rgba(0,0,0,.12);border-radius:0}#toolbar .logo-image{display:block;width:32px;min-width:32px;height:32px;line-height:32px;text-align:center;font-size:16px;font-weight:500;color:#fff;border-radius:2px;margin-left:10px;margin-right:8px}#toolbar #user-menu{height:64px;padding:0}#toolbar #user-menu md-menu-item .md-button{font-size:15px}#toolbar #user-menu md-menu-item .md-button md-icon{margin:auto 16px auto 0}#toolbar #user-menu .user-button{margin:0;padding:0 16px;height:64px;text-transform:none}#toolbar #user-menu .user-button .avatar-wrapper{position:relative}#toolbar #user-menu .user-button .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#toolbar #user-menu .user-button .username{margin:0 12px 0 8px}#toolbar #language-menu{height:64px}#toolbar #language-menu .language-button{min-width:64px;height:64px;margin:0;padding:0 16px;border-radius:0}#toolbar #language-menu .language-button .iso{text-transform:uppercase}#toolbar #language-menu .language-button .flag{margin-right:8px}#toolbar #quick-panel-toggle{width:64px;height:64px;margin:0;border-radius:0}#toolbar #quick-panel-toggle .unread-message-count{position:absolute;top:8px;left:38px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:10px}#toolbar .toolbar-separator{height:64px;width:1px;background:rgba(0,0,0,.12)}#language-menu-content md-menu-item .flag{margin-right:16px}#language-message{min-height:88px;max-width:600px}#language-message .md-toast-content{height:90px}.open-contact-count{position:absolute;top:1px;left:25px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:10px}.md-button.preview-button{min-width:46px;min-height:50px}@media screen and (max-width:600px){#toolbar #user-menu .user-button{min-width:64px;padding:0 2px 0 10px}}.geEditor{font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;font-size:10pt;overflow:hidden;height:100%}.geMenubarContainer .geItem,.geSidebarContainer .geTitle,.geToolbar .geButton,.geToolbar .geLabel{cursor:pointer!important}.geContentEditable div,.geContentEditable table,.geContentEditable table td{border:1px dashed #d3d3d3}.geBackgroundPage{-webkit-box-shadow:0 0 3px 0 #d9d9d9;-moz-box-shadow:0 0 3px 0 #d9d9d9;box-shadow:0 0 3px 0 #d9d9d9}.geMenubarContainer a,.geSidebarContainer a,.geToolbar a{color:#000!important;text-decoration:none}.geDiagramContainer,.geFooterContainer,.geHsplit,.geMenubarContainer,.geOutlineContainer,.geSidebarContainer,.geToolbarContainer,.geVsplit{overflow:hidden;position:absolute;cursor:default}.geDiagramContainer,.geOutlineContainer{background-color:#fff;outline:0}.geMenubar,.geToolbar{white-space:nowrap;display:block;width:100%}.geMenubarContainer .geItem,.geSidebar,.geSidebar .geItem,.geSidebarContainer .geTitle,.geToolbar .geButton,.geToolbar .geLabel,.mxPopupMenuItem{-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;-ms-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.geHint{background-color:#fff;border:1px solid gray;padding:4px 16px 4px 16px;border-radius:3px;-webkit-box-shadow:1px 1px 2px 0 #ddd;-moz-box-shadow:1px 1px 2px 0 #ddd;box-shadow:1px 1px 2px 0 #ddd;opacity:.8}.geStatusAlert{white-space:nowrap;margin-top:-5px;font-size:12px;padding:4px 6px 4px 6px;background-color:#f2dede;border:1px solid #ebccd1;color:#a94442!important;border-radius:3px}.geStatusAlert:hover{background-color:#f1d8d8;border-color:#d6b2b8}.geStatusMessage{white-space:nowrap;margin-top:-5px;padding:4px 6px 4px 6px;font-size:12px;background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;border:1px solid #b2dba1;border-radius:3px;color:#3c763d!important}.geStatusMessage:hover{background:#c8e5bc;border-color:#b2dba1}.geAlert{position:absolute;white-space:nowrap;padding:14px;background-color:#f2dede;border:1px solid #ebccd1;color:#a94442;border-radius:3px;-webkit-box-shadow:2px 2px 3px 0 #ddd;-moz-box-shadow:2px 2px 3px 0 #ddd;box-shadow:2px 2px 3px 0 #ddd}.geBtn{background-color:#f5f5f5;border-radius:2px;border:1px solid #d8d8d8;color:#333;cursor:default;font-size:11px;font-weight:700;height:29px;line-height:27px;margin:0 0 0 8px;min-width:72px;outline:0;padding:0 8px;cursor:pointer}.geBtn:hover{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border:1px solid #c6c6c6;background-color:#f8f8f8;background-image:linear-gradient(#f8f8f8 0,#f1f1f1 100%);color:#111}.geBtn:disabled{opacity:.5}.geBtnUp{background-image:url(data:image/gif;base64,R0lGODlhCgAGAJECAGZmZtXV1f///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0QzM3ODJERjg4NUQxMUU0OTFEQ0E2MzRGQzcwNUY3NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0QzM3ODJFMDg4NUQxMUU0OTFEQ0E2MzRGQzcwNUY3NCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRDMzc4MkREODg1RDExRTQ5MURDQTYzNEZDNzA1Rjc0IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRDMzc4MkRFODg1RDExRTQ5MURDQTYzNEZDNzA1Rjc0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAgAsAAAAAAoABgAAAg6UjwiQBhGYglCKhXFLBQA7);background-position:center center;background-repeat:no-repeat}.geBtnUp:active{background-color:#4d90fe;background-image:linear-gradient(#4d90fe 0,#357ae8 100%)}.geBtnDown{background-image:url(data:image/gif;base64,R0lGODlhCgAGAJECANXV1WZmZv///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0QzM3ODJEQjg4NUQxMUU0OTFEQ0E2MzRGQzcwNUY3NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0QzM3ODJEQzg4NUQxMUU0OTFEQ0E2MzRGQzcwNUY3NCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRDMzc4MkQ5ODg1RDExRTQ5MURDQTYzNEZDNzA1Rjc0IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRDMzc4MkRBODg1RDExRTQ5MURDQTYzNEZDNzA1Rjc0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAgAsAAAAAAoABgAAAg6UjxLLewEiCAnOZBzeBQA7);background-position:center center;background-repeat:no-repeat}.geBtnDown:active{background-color:#4d90fe;background-image:linear-gradient(#4d90fe 0,#357ae8 100%)}.geColorBtn{background-color:#f5f5f5;background-image:linear-gradient(#f5f5f5 0,#e1e1e1 100%);border-radius:4px;border:1px solid rgba(0,0,0,.5);color:#333;cursor:default;margin:0;outline:0;padding:0;cursor:pointer}.geColorBtn:hover{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.7)}.geColorBtn:active{background-color:#4d90fe;background-image:linear-gradient(#4d90fe 0,#357ae8 100%);border:1px solid #2f5bb7;color:#fff}.geColorBtn:disabled{opacity:.5}.gePrimaryBtn{background-color:#4d90fe;background-image:linear-gradient(#4d90fe 0,#4787ed 100%);border:1px solid #3079ed;color:#fff}.gePrimaryBtn:hover{background-color:#357ae8;background-image:linear-gradient(#4d90fe 0,#357ae8 100%);border:1px solid #2f5bb7;color:#fff}.gePrimaryBtn:disabled{opacity:.5}.geAlertLink{color:#843534;font-weight:700;text-decoration:none}.geMenubarContainer{background-color:#fff}.geMenubar{padding:0 2px 0 2px;vertical-align:middle}.geMenubarContainer .geItem,.geToolbar .geItem{padding:6px 8px 6px 8px;cursor:default}.geMenubarContainer .geItem:hover,.geToolbarContainer .geItem:hover{background:#eee}.mxDisabled:hover{background:inherit!important}.geMenubar a.geStatus{color:#b3b3b3;padding-left:6px;display:inline-block;cursor:default!important}.geMenubar a.geStatus:hover{background:0 0}.geMenubarMenu{border:1px solid #d5d5d5!important}.geToolbarContainer{background:#f5f5f5;border-bottom:1px solid #e0e0e0}.geSidebarContainer .geToolbarContainer{background:0 0;border-bottom:none}.geSidebarContainer button{text-overflow:ellipsis;overflow:hidden}.geToolbar{padding:1px 0 0 6px;border-top:1px solid #e0e0e0;-webkit-box-shadow:inset 0 1px 0 0 #fff;-moz-box-shadow:inset 0 1px 0 0 #fff;box-shadow:inset 0 1px 0 0 #fff}.geToolbarContainer .geSeparator{float:left;width:1px;height:34px;background:#e5e5e5;margin-left:6px;margin-right:6px;margin-top:-2px}.geToolbarContainer .geButton{float:left;width:20px;height:20px;padding:0 2px 4px 2px;margin:2px;border:1px solid transparent;cursor:pointer;opacity:.6}.geToolbarContainer .geButton:hover{border:1px solid gray;border-radius:2px;opacity:1;filter:none!important}.geToolbarContainer .geButton:active{border:1px solid #000}div.mxWindow .geButton{margin:-1px 2px 2px 2px;padding:1px 2px 2px 1px}.geToolbarContainer .geLabel{float:left;margin:2px;cursor:pointer;padding:3px 5px 3px 5px;border:1px solid transparent;opacity:.6}.geToolbarContainer .geLabel:hover{border:1px solid gray;border-radius:2px;opacity:.9}.geToolbarContainer .geLabel:active{border:1px solid #000;opacity:1;filter:none!important}.geToolbarContainer .mxDisabled:hover{border:1px solid transparent!important;opacity:.2!important}.geToolbarMenu{border:3px solid #e0e0e0!important;-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;filter:none!important}.geDiagramBackdrop{background-color:#ebebeb;border-style:solid;border-color:#e5e5e5;border-width:1px 0 0 1px}.geSidebarContainer{background:#fff;overflow:hidden;position:absolute;border-top:1px solid #e5e5e5;overflow:auto}.geSidebar{background:#f5f5f5;border-bottom:1px solid #e5e5e5;padding:5px;padding-bottom:12px;overflow:hidden}.geSidebarContainer .geTitle{display:block;font-size:9pt;border-bottom:1px solid #e5e5e5;font-weight:400;padding:6px 0 6px 14px;margin:0;cursor:default;background:#eee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4em}.geSidebarContainer .geTitle:hover{background:#e5e5e5}.geTitle img{opacity:.5}.geTitle img:hover{opacity:1}.geSidebar .geItem{display:inline-block;background-repeat:no-repeat;background-position:50% 50%;border:1px solid transparent;border-radius:2px;cursor:move}.geSidebar .geItem:hover{border:1px solid gray!important}.geItem{vertical-align:top;display:inline-block}.geSidebarTooltip{position:absolute;background:#fff;overflow:hidden;border:1px solid gray;border-radius:8px;-webkit-box-shadow:0 0 2px 2px #d5d5d5;-moz-box-shadow:0 0 2px 2px #d5d5d5;box-shadow:0 0 2px 2px #d5d5d5}.geFooterContainer{background:#e5e5e5;border-top:1px solid silver}.geFooterContainer a{font-size:14px;color:#235695;font-weight:700;text-decoration:none}.geFooterContainer table{border-collapse:collapse;margin:0 auto}.geFooterContainer td{border-left:1px solid silver;border-right:1px solid silver}.geFooterContainer td:hover{background-color:#b3b3b3}.geFooterContainer a{display:block;box-sizing:border-box;width:100%;height:100%;padding:11px 42px 11px 42px;white-space:nowrap}.geHsplit{cursor:col-resize;background-color:#e5e5e5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAHBAMAAADdS/HjAAAAGFBMVEUzMzP///9tbW1QUFCKiopBQUF8fHxfX1/IXlmXAAAAHUlEQVQImWMQEGAQFWUQFmYQF2cQEmIQE2MQEQEACy4BF67hpEwAAAAASUVORK5CYII=);background-repeat:no-repeat;background-position:center center}.geVsplit{font-size:1pt;cursor:row-resize;background-color:#e5e5e5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAEBAMAAACw6DhOAAAAGFBMVEUzMzP///9tbW1QUFCKiopBQUF8fHxfX1/IXlmXAAAAFElEQVQImWNgNVdzYBAUFBRggLMAEzYBy29kEPgAAAAASUVORK5CYII=);background-repeat:no-repeat;background-position:center center}.geHsplit:hover,.geVsplit:hover{background-color:#d5d5d5}.geDialog{position:absolute;background:#fff;overflow:hidden;padding:30px;border:1px solid #acacac;-webkit-box-shadow:0 0 2px 2px #d5d5d5;-moz-box-shadow:0 0 2px 2px #d5d5d5;box-shadow:0 0 2px 2px #d5d5d5;z-index:2}.geDialogClose{position:absolute;width:9px;height:9px;opacity:.5;cursor:pointer}.geDialogClose:hover{opacity:1}.geDialogTitle{box-sizing:border-box;white-space:nowrap;background:#e5e5e5;border-bottom:1px solid silver;font-size:15px;font-weight:700;text-align:center;color:#235695}.geDialogFooter{background:#f5f5f5;white-space:nowrap;text-align:right;box-sizing:border-box;border-top:1px solid #e5e5e5;color:#a9a9a9}.geSprite{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAk/CAYAAACauMYVAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAAWn0lEQVR4Ae2dW4gdxdbHO0aJYjzxTtR4EhSDSNB84kPEQOL9CB/Ex4igg8iAGCSgiIIQH1SOqJAnn4N4wBdvYBRBcYTIp0+OF0SDYoJRgyAmeA1e5lv/PrM6q6urqqu7a2/3ZP4NPVVdtda/Vv2qZ9Nrd++9i2IE2xJoHn/88XOq/ccff5RtepxSuv7HqxPE0GkNtC+lVH/YjiTSKoi+EaqA9T9OG3OW4xNdu3btHPZY9DGbRqRtYhiozaYhunfvXu95aoVCNjqzhqh2uGWbkLVPFrWRWgFfvSFqnW3dOtt2W7c2Zd2evI3OhAbr34g0wb/VZOGIjuRVagG+nrYuKQ1IgARIgARIgARIgARIoEbAm93BwmYb1mP58uXFoUOHgn6wTUok8K4Ddgj+9NNPxamnnhpNhpNENdL169eXVQj32jB93VUAEaJNxKORBtmEmGIAoNCBfGXS9C1TiLRF6huobNOp24g3b97cQBIU8HX4RJVp2+oH2dgI7aAp56m1Z50ESIAESIAESIAESIAESGCREtBMJXX6SclZqpjaUVRJ5CuPEabI623ii3rvXN/SVeFsgioO4SwRquDElNU7E3ZB+kTX9g5QH036kAAJkAAJkAAJkAAJkMDEEqiupBFh36vpsVxF1yJVnqkRjyVCDaoWaWqE6qzlWCKuRaojp0Y8lgg1qFqkqRGqs5ZjibgWqY6cGvFYItSgWJIACZAACZAACZAACZDAJBHwXknbAENX1bGr6IZoSMQO5KvbQUZyi9M36OC2xvRVMRWDnbb6jmT6FFW8+UoyzcdSlUbCVMVZkgAJkAAJkAAJkAAJTCqB1Pypc/yu8Jo1a6KfhE0eAMI7duyYS/04aJIwBCGsUeL507bPmbYKQwCCFsUgYQjaJ2MHC7uCvim1RVxLzSHY5YPUq1atKvbt21fTQBC9sxN8ltcnCNHGKCnR2g8HP/TQQ+U5/Mgjj1RajUjxiXc4hTYrCJtff/213K19pW4bUfdF7Aree++9tf+0p556qtRrRKribsSuoNr1KhEx9pAzonUjDtmynQRIgARIgARIgARIgASOGQLlNbrN6Hy3LNtm6/ovwC+qtVNom66v3/p7Ux4YuLsrZLNst686tiO5grZPHdCmbzCgzdp4I1VHX6kDou/AgQOFFW7Y25HU0ZauA/ps0mb9O0eq4uvWrWv9OrgaE3XsUmaJNDZgdPp29JiI2xcVdY1Tj72iOLE1SpRJJ7pvRBXRPpwuaLOnjfb5Ste/tPE1Rk9sR9n68/XUgcNDEiABEiABEiABEjgmCTTunMkl4Z65ublVbbM97rjj3v3999+3+uyqLFo7Ifjqq6+ulq1YsqQxJr6huXj77beLe+65Z5/6uGVDFAZysVtcdNFFXlGJrpDfPSp13nrrLczouauvvnpj2TD/x3vNjz5flOooUy8uvPDCDV9//fX/yb3ADc8///we7UMZFEXnn3/+WbzwwgvF559/XiBCbCeccEJx/fXXF4899tiyxx9/fNXpp5++VO4K19bAO/3SW/4goquuuqp4+OGHi08//bQ8vuyyy4rbb7+9ePTRR4svvvjioAyy9a+//jqiPt5y6dKl+z777DNZr6Pb+++/P3fHHXfMSd/cGWecMXf55Zcjc3lfBDZ4RdxGnyjkZ2Zm5q655ppSGOIiOuP66nGUKYx++eWX4pVXXilXfGpqqnjppZcKuZNbyDjrzzvvvJk33njjORXTMioqrIoPPvigPDdxmm3cuLG49tpri5tvvrm47bbbVkj/pp9//vlfL7744nYVRBldKBgsW7asEIbFWWedVZx00kkFBvrtt9/QVZ520r/ihx9+gOjOslH+REWx+hC0G04zWcjimWee2X/OOefsWrFiRfHtt98esjZeUTji39H3D4B29EvfPnkP5eErr7zS6pV1r+h7771XfPXVV0HRjz76qCFkGxqvGHIyPycru9Ia+eoS6az8l9UWyGfHNhIgARIgARIgARIgARLoQKBxfer6fvLJJ899/PHHZb506aWXvnvxxRdvdW3c48aV9O7du/eIUZUW3nXXXStvvPHGZbhUf/rpp1dK/z4VQUp5ySWXHJAHhuMJ75133rlKcqfVJ5988mpJJFYfPnx42ZNPPlk88cQTuPu4DG3og83999+/WjKTKgAdrJFHfffdd8Xs7OxWcd4sD//Ofvnll4UIlzvqDz74YCGPkIvJ7Nbvv/++TCpULFgijZTO1TK1nVI/hJTR3edTyNXnn3/+nIjDvrY1mGqvJAm7pP6iHjvlYee4dhgUffPNN9dLzrQG1sjyZJu56aabZlCZ31ZrxS2DoiI0Jcab4IDMT7bNr7/++gwqSMxuuOGGt1D3bY2F8hnNt22S/Goq0l91BSOtLI5W3paId0mEu+abuk8fGR1OeIlOme4Spip4dChPLRjpdddd1ztF7MLUE5O/aSSioek3/p89MZU2YO5uDVFZnAPyb/kf19B3LIL7pf2Ar49tJEACJEACJEACJEAC/Qh4c1O5sfWhXHz9MyK5Rx51/N9Qf+OqD4abNm36hxQrQk5XXHHFvyQz/PDss8++1GfjFf3xxx+RHm595513tp944ollBq3Octfs3YMHD+6US87/iPAeEd6ofVp6Rec7D956662N+6FHjhz5Hxl055lnnrlUbnduEFR75F5qTTgmWj5d/OyzzxYbNtSCXSaDrsSTx7fccstSYd+46o6KIuKVK1cWuIPeZWsVhZjcyC6++eYbPExcyLQLyZ6jYySJ4pamvFlQ3vPDImKXvCAo3CnlQSaCtzgQKcrQ1kkU2TQ+y3vKKafkiRR5KkSBAnxjWzDSBx54YEpuYJfLftpppxUXXHBBsWbNmkLOzZhe2ecVlYh2Crf9El352iBPG+BxhlIY4ueee24lLJxXvPbaaw9UDVLxrr68f7Lz7rvvxim0Wd548Z6k8q9a6sg7GKdKBaL/Lhvkj1dUOyXQ2fvuu08PG6Xc4C5PM7Hr+ZvkDUk2kAAJkAAJkAAJkAAJkAAJLFYC3vdQXBiS+jRvj4mR3AFO8nf1quPt27d3+qho5RirINpQxK6fN410jTZv3lxOH19Rlm3rEiUGbY1UMucySjzNnW3rGmVrpPqh4G3btnUK0nuehVZ58HnZKTQakwAJkAAJkAAJkAAJkAAJZCBQu+YPXeu3jTOWXKBXpGOJzMXTK1JXZCyR94p0LJG5OHpF6oqMJfJekY4lMhcHj0mABEiABEiABEiABEhgnkDXe1Ktd876kKVomJr9ZmFYYcF6f7uwHUaFswmqOISzRKiCE1NWGV/f9090JsdwFph99bOfp1ZQX/6yna8qqCvdVvKlr40Q+0mABEiABEiABEiABBY8gSqP8s2kLbcK5U4juZL2BTi4rTH9timHRrQoBk3fCtnBBomGZjVI1EZn69EPBsMwNMVQlPAZSaQQDm6xaGJ9I4m0lWksouAU2UECJEACJEACJEACJEACJEACWQnITzuVP5mLDEX3Qff4VCRUWnHYtM4GRvpZaDXGJ7j1B391IHusdt5SPwzs7ZRGDKaitgzZF4gm2Gk65JeuGsKmu55F4wemUjb50a+oWeM9lKi1dAKP/Fhawyz0vkDDkA0kQAIkQAIkQAIkQAIkQAILnkAtkUBe1GdGY0kiapG6UaZGPv5IUyNzZzT+SN0IUiMff6SpkbkzGn+kbgSpkY8lUjc4HpMACZAACZAACZAACZAACaQQaOSmqdf5Vty95h/vQ63u6DYyrYdmlSXS6enpOew6WBZRFdOSokoiXxl8Tjp0uqQMPZKFakRqT3p77qVEqDYjiVTFWZIACZAACZAACZAACZDARBKQa/0P5XeLD0lwbT8Z9E/Ywd6dSONKWn5XV38qO/yLyP9VQQa+Yt6+ptsQrfX2PFjkoo08SjHKyk7JzwtfrceeEovkaY5/2nhKnFb7vNAu+3ZfH9qCkaJTfjB9lxSHZcdT2ftl3yc7tk2YCSq+rXX15eTeKQIzUk75BHxtraI+p7a2hqgszgFx+lMd5Ri/Nr1fSvzrJm0NppJFb5Sp7pGFwI+aHZFfud4KJeFrBfEb8mCMH6FGENxIgARIgARIgARIgARIYHERQNJabnL17E+K1KCltPexWkwXWjc+WWw/XTw4foiBN/YswlYwqzCmqoKp025kfKmOMTuKxuj061s4TPvNj14kQAIkQAIkQAIkQAIkQAIBAqEsL9RuZRZOIsFI7bodra9ahdumRbFjx47qXSCta99R63qtegup3vzfI5w+vva2t4uiCwVnGxXqbYK+ILK0eacfmrY74t8WtRsIj0mABEiABEiABEiABEiABBYBAffWMb6lGd/dnTx1+63Xrpi+eWDLJGE4QBi7dcax+63Y+rXarcJWSOvuF4C7InZ2bl95rEJa4ru4vYZOozuLaMLb9l3cqu1+t3ctN0WEaqjl8uXLi0OHDtXstI8lCZAACZAACZAACZAACZAACTQIuFkfjhtGnoZg1uHLVNS/7Y6ZN49SwW3btpU3CiGCHcfYtF8HaS11yjaLW7t2bTVttEM0FUU5IBzcSKwojHw2NtoGUxXEdF0xOO7du3eJtbFiwbovClfcZ2MFGwu1bt26st8ytQ7arna2L1rXSFRAjXWRdPranlyqcKjstPp2VD29VFiFtF2Prc+g+tiFG6vfJfzZ2dklOAsk6i5utCUBEiABEiABEiABEiCBySGgl+DuNX9bhI2MTx0gpHW3nNws2kaqCVqndEf5WSG33mbT+H4pK+AmuuhDFm1tkuptUUCkzaaRR2l27Ca7GpG2q522t5YaiQqogy4S+rWtU6nCobLT6tuRQ/9R2t5b2A5i62MXbqy+jaatziy6jRD7SYAESIAESIAESOBYJtA9ffHQsDkAUsxoHmX9raNt13opNp9gJIvCOZToarKhAySXbZFaoUGX51bI1ilqaeSpk2kejlZlkTMtX6Xsi0Xolcgya6tXL336emgHaHMO9Zev/FYoR6ShwdhOAiRAAiRAAiRAAscYgZFk0dmupO2FXTZRe+WYbTWtaLZIbXQUtTTy1KvsxK5eHmlRySnK1c+2LJXQSJiOJDetIrWvh9U8elYq0Zznac9Y6EYCJEACJEACJEACC43AIsqid+/eXT41m+2qEYIQU+HBa0/BwQgLMiTDHgSynjZ4UdA924uDvmxp2WOSNRdm0TUcPCABEiABEiABEiCBTgQmK4vWa1m9Uhx870UF9VpWr211gE6s1BjOKqhtg0qNcpCI68woXSL9jnVxsq44F6ffYvi8Jo8lItIdEWc5hSAIMRVGOeScHMldcwTIjQRIgARIgARIgAQWAYHJyqJd4DaLru6duEZdj/VytKtf1N6KZovUjkhRSyNPnUzzcLQqi5wpPxdtTwbWSYAESIAESIAESOBYJTCSLLr6vGlXajYXhS+yaG0bdHkOIU3JVbBrcDX7mMigSGujmAOKGhiZqsHzNLa6vcceIsrV74096DgSpiPJoqtI7UvYkNMJTHgvOnhmsIMESIAESIAESIAESIAESCBEoPYW0tCsRDOc0GBsJwESIAESIAESIAESIAESIAESmFQCyAiHfGYyOC8Ij0RchbOLW2FXfLKy6FikwQWJdVjBLGeDCmYRQ+TugsRmwz4SIAESIAESIAESIAESIAESGD2B7GmPhnxsCE9WFj0yttkXa/IFlSVLEiABEiABEiABEiABEiABEuhEIHu6g9FVFGXWu5LZha2g1m3Ek5NFa3S2tJF2WnU1tmKoDxYc+epniVCnz5IESIAESIAESIAESIAESIAEJoMAUh2boA1OfVxBFbfCtYQ3hQNEQnb6Eebat4vFHEJCvvaRRFp9v5RvRF/byy+/7GsuQu1eY1+ju1h2kXz2bCMBEiABEiABEiABEiABEiCBBUYglh12zvgwdyuo+ahl0lnUCqqQK9xJ1CfoE66JxpzUOVZqxDXRmAP6YoOqIOw6iYaErWAvUVfYFUR/7y2GorcoHUmABEiABEiABEiABEiABEjg7yNg70IOvgNpxZA/2d0n3ppGpiZhNvOriaYKhBZAhWuiPuPUgVQQGq33omEcu8+MPivoCyzaZhfMt0BRZ3aSAAmQAAmQAAmQAAmQAAmQwGQTQKI2klQHwiMRV+Hs4iqoA1gstYQXBl1WVXNS9dPjLho121ikNcPUA52yCqf6Be1U0DIMGqd0ZIssZTDakAAJkAAJkAAJkAAJkAAJkEArgexpD0ZU0awpEMSseJZETUVDwr2zaJsx6yC2DQN22lQETqhjH4xARbMJ2uiyRKiMskaooixJgARIgARIgARIgARIgARIYDIIILvTtMeXS7U+fexOA4L6xDFyUew4HpRGIjJ3IBzb9pF8u5hv0GibjcgahtqtTbAOdtPT0zUEOB7EFKNBAJHpPlgwOAV2kAAJkAAJkAAJkAAJkAAJkMDfQmBQMuaLGIKaS/n6O7epIByzCFtBjaZVGE6xPZQutgprBL6yV6Q+IbfNCg+KMCSMAdy+QcfZBQdFQ2cSIAESIAESIAESIAESIAESyEIAqU5bulN7Tjo2qgrpt2Jt2bKlNO/1bDRutELQl+xqGunenK0Fp1NzS5+gOiYJq7GWfSL9e5hqxFoqGj1mSQIkQAIkQAIkQAIkQAIkQAILmIBmdFmmoGLImwYLWrHBgq7YEMEqNx0iAjzevD9npI01cMUbBkMarPgQHa+vins72UgCJEACJEACJEACJEACJEACIyWgGcnQLLAKcnEJji+LrgDnqGRfJA1q4Qlr5CxJgARIgARIgARIgARIgARIIIlA9rTHCmZJzV3BwaI+wb6i48uiEaHuSSsbM/IhiNkn97nCyY5thla4zZb9JEACJEACJEACJEACJEACJLBACNhUBxkfjgeF7gpqGtlHOCnh9T5YHZlCkmjEv+qyA9e++LuycCrWwenyHlbfe66fIXetQu2uXfDYXaw+ixQUZwcJkAAJkAAJkAAJkAAJkAAJTA4B5KZ9o6nSSCtgBbtme9BpiFpBHaircE3UJ9hHuBKNCapwrLSzqUThEBO2TjFx9NVE0eAT7iLoFXWFuwrCP7j5Ig4as4MESIAESIAESIAESIAESIAEFhYBe2dy8F1JK4Zcyu6p4rU0MjUha8sCK9FUwdAi2oEqURinClsB3yDVvWh0wjh27xl9bYK+Qao2u2CpC1Q5s0ICJEACJEACJEACJEACJEACC4OApj5ZolWx1CwwOqgVGyxoxbQeHT3SWSW8GpXmnnoc8a11qV+tUaODmNZrBkMOVBDiXaNtHdeKtxp3NVDxrn60JwESIAESIAESIAESIAESIIHhBDQjyZZHWcEsolYQ8x0s6goOEQ1m0V1FW7NoCGIbPH2IuAiyiLrC2URdYRxzIwESIAESIAESIAESIAESIIFjgIBNzpBD4bjPtKqnjyGgTxcjz8SO477CZTCh7C7UHptB0heBpQjbLDpJ1DrEImz0gd309HRtYXA8iClGgQCmqvtgwUbobCABEiABEiABEiABEiABEiCBiSCQkuV1ChSCmlN1cgwZqyD6swhbQR10kLBP0BWGTWhX20bpEx4UqY5ghbMIusIYQNuylNkFs0RFERIgARIgARIgARIgARIgARLIRgBpT5/Up3pO2kaiQvqtWFu2bCm7e92Uxc1XCCJ9tIOgrimle8PWtasdxwTVUIUViy3VplHGhFUwJdLRM3VD1+m57TwmgTCB/wdigVA7yGo0NAAAAABJRU5ErkJggg==) no-repeat top left;width:21px;height:21px}.geSprite-actualsize{background-position:0 0}.geSprite-bold{background-position:0 -46px}.geSprite-bottom{background-position:0 -92px}.geSprite-center{background-position:0 -138px}.geSprite-delete{background-position:0 -184px}.geSprite-fillcolor{background-position:0 -230px}.geSprite-fit{background-position:0 -276px}.geSprite-fontcolor{background-position:0 -322px}.geSprite-gradientcolor{background-position:0 -368px}.geSprite-image{background-position:0 -414px}.geSprite-italic{background-position:0 -460px}.geSprite-left{background-position:0 -506px}.geSprite-middle{background-position:0 -552px}.geSprite-print{background-position:0 -598px}.geSprite-redo{background-position:0 -644px}.geSprite-right{background-position:0 -690px}.geSprite-shadow{background-position:0 -736px}.geSprite-strokecolor{background-position:0 -782px}.geSprite-top{background-position:0 -828px}.geSprite-underline{background-position:0 -874px}.geSprite-undo{background-position:0 -920px}.geSprite-zoomin{background-position:0 -966px}.geSprite-zoomout{background-position:0 -1012px}.geSprite-helbow{background-position:0 -1058px}.geSprite-velbow{background-position:0 -1104px}.geSprite-straight{background-position:0 -1150px}.geSprite-entity{background-position:0 -1196px}.geSprite-segment{background-position:0 -1242px}.geSprite-orthogonal{background-position:0 -1288px}.geSprite-noarrow{background-position:0 -1334px}.geSprite-endclassic{background-position:0 -1380px}.geSprite-endopen{background-position:0 -1426px}.geSprite-endblock{background-position:0 -1472px}.geSprite-endoval{background-position:0 -1518px}.geSprite-enddiamond{background-position:0 -1564px}.geSprite-endthindiamond{background-position:0 -1610px}.geSprite-endclassictrans{background-position:0 -1656px}.geSprite-endblocktrans{background-position:0 -1702px}.geSprite-endovaltrans{background-position:0 -1748px}.geSprite-enddiamondtrans{background-position:0 -1794px}.geSprite-endthindiamondtrans{background-position:0 -1840px}.geSprite-startclassic{background-position:0 -1886px}.geSprite-startopen{background-position:0 -1932px}.geSprite-startblock{background-position:0 -1978px}.geSprite-startoval{background-position:0 -2024px}.geSprite-startdiamond{background-position:0 -2070px}.geSprite-startthindiamond{background-position:0 -2116px}.geSprite-startclassictrans{background-position:0 -2162px}.geSprite-startblocktrans{background-position:0 -2208px}.geSprite-startovaltrans{background-position:0 -2254px}.geSprite-startdiamondtrans{background-position:0 -2300px}.geSprite-startthindiamondtrans{background-position:0 -2346px}.geSprite-copy{background-position:0 -410px}.geSprite-cut{background-position:0 -320px}.geSprite-paste{background-position:0 -367px}.geSprite-duplicate{background-position:0 -736px}.geSprite-save{background-position:0 -782px}.geSprite-publish{background-position:0 -92px}.geBaseButton{padding:10px;border-radius:6px;border:1px solid silver;cursor:pointer;background-color:#ececec;background-image:linear-gradient(#ececec 0,#fcfcfc 100%)}.geBaseButton:hover{background:#ececec}.geBigButton{color:#fff;border:none;padding:10px;font-size:14pt;white-space:nowrap;border-radius:6px;text-shadow:#295989 0 1px 0;background-color:#428bca;background-image:linear-gradient(#4687ce 0,#3068a2 100%);-webkit-box-shadow:rgba(255,255,255,.0980392) 0 1px 0 0 inset,rgba(0,0,0,.2) 0 1px 1px 0;-moz-box-shadow:rgba(255,255,255,.0980392) 0 1px 0 0 inset,rgba(0,0,0,.2) 0 1px 1px 0;box-shadow:rgba(255,255,255,.0980392) 0 1px 0 0 inset,rgba(0,0,0,.2) 0 1px 1px 0}.geBigButton:hover{background-color:#2d6ca2;background-image:linear-gradient(#5a94d3 0,#3673b5 100%)}.geBigButton:active{background-color:#3673b5;background-image:none}@media print{div.geNoPrint{display:none!important}}html div.mxRubberband{border-color:#00d;background:#9cf}td.mxPopupMenuIcon div{width:16px;height:16px}html div.mxPopupMenu{-webkit-box-shadow:2px 2px 3px #d5d5d5;-moz-box-shadow:2px 2px 3px #d5d5d5;box-shadow:2px 2px 3px #d5d5d5;background:#fff;position:absolute;border:3px solid #e7e7e7;padding:3px}html table.mxPopupMenu{border-collapse:collapse;margin:0}html td.mxPopupMenuItem{padding:7px 30px 7px 30px;font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;font-size:10pt}html td.mxPopupMenuIcon{background-color:#fff;padding:0}td.mxPopupMenuIcon .geIcon{padding:2px;padding-bottom:4px;margin:2px;border:1px solid transparent;opacity:.5}td.mxPopupMenuIcon .geIcon:hover{border:1px solid gray;border-radius:2px;opacity:1}html tr.mxPopupMenuItemHover{background-color:#eee;color:#000}table.mxPopupMenu hr{color:#ccc;background-color:#ccc;border:none;height:1px}table.mxPopupMenu tr{font-size:4pt}html td.mxWindowTitle{font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;text-align:left;font-size:12px;color:#707070;padding:4px}div.mxTooltip{-webkit-box-shadow:3px 3px 12px silver;-moz-box-shadow:3px 3px 12px silver;box-shadow:3px 3px 12px silver;background:#ffc;border-style:solid;border-width:1px;border-color:#000;font-family:Arial;font-size:8pt;position:absolute;cursor:default;padding:4px;color:#000}body{font-family:Arial Unicode MS,Arial,Helvetica;font-size:10pt}
\ No newline at end of file
+[data-ng-click],[ng-click],[x-ng-click]{cursor:pointer}.ms-container{width:100%!important}.dark-lime-fg{color:#575b2e!important}.dark-red-fg{color:#9e3333!important}.iron-fg{color:#555865!important}.light-brown-fg{color:#645733!important}.ms-container .ms-list{height:380px!important}.ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection{padding:6px 12px!important;height:34px!important}md-input-container:not(.md-input-has-value) input:not(:focus){color:inherit!important}.ms-container .ms-search{height:34px;margin-bottom:5px;border:solid 1px #e5e5e5;background-color:#fff;box-shadow:none;width:100%;padding-left:6px}.ms-container .ms-footer{text-align:center}.no-border{border:none!important}.left .motion-spinner{border-top-color:#00d7cc!important;border-left-color:#00d7cc!important}.right .motion-spinner{border-top-color:#00d7cc!important;border-right-color:#00d7cc!important}.md-option-info-text{font-size:10px}md-pagination-wrapper{width:auto!important}md-autocomplete.no-container-margin md-autocomplete-wrap md-input-container{margin:0!important}md-dialog.report-selection-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}md-dialog.advanced-search-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}.md-dialog-action-center{justify-content:center!important}.flag-24{height:24px}button.auto-width{min-width:auto!important}button.size-8{transform:scale(.8)}md-icon.auto-size{height:auto!important;width:auto!important}md-switch.auto-height{height:auto!important}.hidden{visibility:hidden}.user-profile-section-help{background:#fcf20f0f;border:1px solid rgba(0,0,0,.12);padding:5px}.email-preview-message{display:-webkit-box;margin:0 auto;display:block;height:200px;line-height:1.4;-webkit-line-clamp:10;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-all}button.advanced-search.md-accent-bg.md-button.md-default-theme:not([disabled]).md-icon-button:hover{background-color:#0091ea}.blink{animation:blink 2s ease-in infinite}.no-click{pointer-events:none}.spinner-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;background:rgba(43,43,43,.5)}ms-quick-filter[disabled]{pointer-events:none;opacity:.7}ms-search-bar[disabled]{pointer-events:none;opacity:.7}@keyframes blink{from,to{opacity:1}50%{opacity:0}}textarea.api-key-area{background:0 0;resize:none}.badge{min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transition:opacity .2s ease-in-out .1s}md-tooltip.multiline div.md-content{height:auto!important}.auto-margin{margin:auto}md-menu-item md-menu.no-margin button{display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}md-date-range md-menu span.md-select-value{border-bottom-color:rgba(0,0,0,.12)}.keep-on-top{z-index:9999!important}.margin-auto{margin:auto}.xenialab-violet-light-bg{background-color:#9c4fd3!important}.xenialab-violet-light-fg{color:#9c4fd3!important}.no-margin-top{margin-top:0!important}.no-margin-bottom{margin-bottom:0!important}.disabled-button{display:inline-block;position:relative;cursor:default;min-height:36px;min-width:88px;line-height:36px;vertical-align:middle;align-items:center;text-align:center;border-radius:3px;box-sizing:border-box;user-select:none;outline:0;border:0;padding:0 6px;margin:6px 8px;background:rgba(0,0,0,.12);color:rgba(0,0,0,.38);white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;font-style:inherit;font-variant:inherit;font-family:inherit;text-decoration:none;overflow:hidden}.word-break-all{word-break:break-all}@supports (-ms-ime-align:auto){md-tabs{display:inline!important}}@supports (-ms-accelerator:true){md-tabs{display:inline!important}}@supports (-moz-transform:translate(0,0)){md-tabs{display:inline!important}}body[dir=rtl] table.md-table td.md-cell,body[dir=rtl] table.md-table th.md-column{text-align:right!important}body[dir=rtl] table.md-table td.md-cell md-checkbox,body[dir=rtl] table.md-table th.md-column md-checkbox{margin-right:12px!important}body[dir=rtl] .ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button .icon{margin:0 0 0 16px!important}body[dir=rtl] .ms-navigation .ms-navigation-node .ms-navigation-item>a.ms-navigation-button{padding-right:45px}body[dir=rtl] .md-table-pagination>.buttons{direction:ltr}body[dir=rtl] .md-table-pagination>.buttons>.label{direction:rtl}body[dir=rtl] .header .logo .logo-icon{margin:5px 0 0 15px!important}body[dir=rtl] md-switch .md-container{margin-right:inherit!important}#toasty.toasty-position-top-right{top:64px}.preview_cancel{padding:5px;float:left;background-color:red}.preview_open{padding:5px;float:right;background-color:green}.hover-token{cursor:pointer}body,html{height:100%;position:relative}body{margin:0;padding:0}[tabindex='-1']:focus{outline:0}.inset{padding:10px}a.md-no-style,button.md-no-style{font-weight:400;background-color:inherit;text-align:left;border:none;padding:0;margin:0}button,input,select,textarea{vertical-align:baseline}button,html input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[type=button][disabled],input[type=reset][disabled],input[type=submit][disabled]{cursor:default}textarea{vertical-align:top;overflow:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box;-webkit-box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input:-webkit-autofill{text-shadow:none}.md-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;text-transform:none;width:1px}.md-shadow{position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;pointer-events:none}.md-shadow-bottom-z-1{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-shadow-bottom-z-2{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-shadow-animated.md-shadow{transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.md-ripple-container{pointer-events:none;position:absolute;overflow:hidden;left:0;top:0;width:100%;height:100%;transition:all .55s cubic-bezier(.25,.8,.25,1)}.md-ripple{position:absolute;transform:translate(-50%,-50%) scale(0);transform-origin:50% 50%;opacity:0;border-radius:50%}.md-ripple.md-ripple-placed{transition:margin .9s cubic-bezier(.25,.8,.25,1),border .9s cubic-bezier(.25,.8,.25,1),width .9s cubic-bezier(.25,.8,.25,1),height .9s cubic-bezier(.25,.8,.25,1),opacity .9s cubic-bezier(.25,.8,.25,1),transform .9s cubic-bezier(.25,.8,.25,1)}.md-ripple.md-ripple-scaled{transform:translate(-50%,-50%) scale(1)}.md-ripple.md-ripple-active,.md-ripple.md-ripple-full,.md-ripple.md-ripple-visible{opacity:.2}.md-ripple.md-ripple-remove{animation:md-remove-ripple .9s cubic-bezier(.25,.8,.25,1)}@keyframes md-remove-ripple{0%{opacity:.15}100%{opacity:0}}.md-padding{padding:8px}.md-margin{margin:8px}.md-scroll-mask{position:absolute;background-color:transparent;top:0;right:0;bottom:0;left:0;z-index:50}.md-scroll-mask>.md-scroll-mask-bar{display:block;position:absolute;background-color:#fafafa;right:0;top:0;bottom:0;z-index:65;box-shadow:inset 0 0 1px rgba(0,0,0,.3)}.md-no-momentum{-webkit-overflow-scrolling:auto}.md-no-flicker{-webkit-filter:blur(0)}@media (min-width:960px){.md-padding{padding:16px}}body[dir=ltr],body[dir=rtl],html[dir=ltr],html[dir=rtl]{unicode-bidi:embed}bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}body,html{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.md-display-4{font-size:112px;font-weight:300;letter-spacing:-.010em;line-height:112px}.md-display-3{font-size:56px;font-weight:400;letter-spacing:-.005em;line-height:56px}.md-display-2{font-size:45px;font-weight:400;line-height:64px}.md-display-1{font-size:34px;font-weight:400;line-height:40px}.md-headline{font-size:24px;font-weight:400;line-height:32px}.md-title{font-size:20px;font-weight:500;letter-spacing:.005em}.md-subhead{font-size:16px;font-weight:400;letter-spacing:.010em;line-height:24px}.md-body-1{font-size:14px;font-weight:400;letter-spacing:.010em;line-height:20px}.md-body-2{font-size:14px;font-weight:500;letter-spacing:.010em;line-height:24px}.md-caption{font-size:12px;letter-spacing:.020em}.md-button{letter-spacing:.010em}button,html,input,select,textarea{font-family:Roboto,"Helvetica Neue",sans-serif}button,input,select,textarea{font-size:100%}@keyframes md-autocomplete-list-out{0%{animation-timing-function:linear}50%{opacity:0;height:40px;animation-timing-function:ease-in}100%{height:0;opacity:0}}@keyframes md-autocomplete-list-in{0%{opacity:0;height:0;animation-timing-function:ease-out}50%{opacity:0;height:40px}100%{opacity:1;height:40px}}md-autocomplete{border-radius:2px;display:block;height:40px;position:relative;overflow:visible;min-width:190px}md-autocomplete[disabled] input{cursor:default}md-autocomplete[md-floating-label]{border-radius:0;background:0 0;height:auto}md-autocomplete[md-floating-label] md-input-container{padding-bottom:0}md-autocomplete[md-floating-label] md-autocomplete-wrap{height:auto}md-autocomplete[md-floating-label] button{position:absolute;top:auto;bottom:0;right:0;width:30px;height:30px}md-autocomplete md-autocomplete-wrap{display:flex;flex-direction:row;box-sizing:border-box;position:relative;overflow:visible;height:40px}md-autocomplete md-autocomplete-wrap.md-menu-showing{z-index:51}md-autocomplete md-autocomplete-wrap input,md-autocomplete md-autocomplete-wrap md-input-container{flex:1 1 0%;box-sizing:border-box;min-width:0}md-autocomplete md-autocomplete-wrap md-progress-linear{position:absolute;bottom:-2px;left:0}md-autocomplete md-autocomplete-wrap md-progress-linear.md-inline{bottom:40px;right:2px;left:2px;width:auto}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate{position:absolute;top:0;left:0;width:100%;height:3px;transition:none}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate .md-container{transition:none;height:3px}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter.ng-enter-active{opacity:1}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave.ng-leave-active{opacity:0}md-autocomplete input:not(.md-input){font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:0;background:0 0;width:100%;padding:0 15px;line-height:40px;height:40px}md-autocomplete input:not(.md-input)::-ms-clear{display:none}md-autocomplete button{position:relative;line-height:20px;text-align:center;width:30px;height:30px;cursor:pointer;border:none;border-radius:50%;padding:0;font-size:12px;background:0 0;margin:auto 5px}md-autocomplete button:after{content:'';position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;border-radius:50%;transform:scale(0);opacity:0;transition:all .4s cubic-bezier(.25,.8,.25,1)}md-autocomplete button:focus{outline:0}md-autocomplete button:focus:after{transform:scale(1);opacity:1}md-autocomplete button md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%,-50%,0) scale(.9)}md-autocomplete button md-icon path{stroke-width:0}md-autocomplete button.ng-enter{transform:scale(0);transition:transform .15s ease-out}md-autocomplete button.ng-enter.ng-enter-active{transform:scale(1)}md-autocomplete button.ng-leave{transition:transform .15s ease-out}md-autocomplete button.ng-leave.ng-leave-active{transform:scale(0)}@media screen and (-ms-high-contrast:active){md-autocomplete input{border:1px solid #fff}md-autocomplete li:focus{color:#fff}}.md-virtual-repeat-container.md-autocomplete-suggestions-container{position:absolute;box-shadow:0 2px 5px rgba(0,0,0,.25);height:225.5px;max-height:225.5px;z-index:100}.md-virtual-repeat-container.md-not-found{height:48px}.md-autocomplete-suggestions{margin:0;list-style:none;padding:0}.md-autocomplete-suggestions li{font-size:14px;overflow:hidden;padding:0 15px;line-height:48px;height:48px;transition:background .15s linear;margin:0;white-space:nowrap;text-overflow:ellipsis}.md-autocomplete-suggestions li:focus{outline:0}.md-autocomplete-suggestions li:not(.md-not-found-wrapper){cursor:pointer}@media screen and (-ms-high-contrast:active){.md-autocomplete-suggestions,md-autocomplete{border:1px solid #fff}}md-backdrop{transition:opacity 450ms;position:absolute;top:0;bottom:0;left:0;right:0;z-index:50}md-backdrop.md-menu-backdrop{position:fixed!important;z-index:99}md-backdrop.md-select-backdrop{z-index:81;transition-duration:0}md-backdrop.md-dialog-backdrop{z-index:79}md-backdrop.md-bottom-sheet-backdrop{z-index:69}md-backdrop.md-sidenav-backdrop{z-index:59}md-backdrop.md-click-catcher{position:absolute}md-backdrop.md-opaque{opacity:.48}md-backdrop.md-opaque.ng-enter{opacity:0}md-backdrop.md-opaque.ng-enter.md-opaque.ng-enter-active{opacity:.48}md-backdrop.md-opaque.ng-leave{opacity:.48;transition:opacity .4s}md-backdrop.md-opaque.ng-leave.md-opaque.ng-leave-active{opacity:0}md-bottom-sheet{position:absolute;left:0;right:0;bottom:0;padding:8px 16px 88px 16px;z-index:70;border-top-width:1px;border-top-style:solid;transform:translate3d(0,80px,0);transition:all .4s cubic-bezier(.25,.8,.25,1);transition-property:transform}md-bottom-sheet.md-has-header{padding-top:0}md-bottom-sheet.ng-enter{opacity:0;transform:translate3d(0,100%,0)}md-bottom-sheet.ng-enter-active{opacity:1;display:block;transform:translate3d(0,80px,0)!important}md-bottom-sheet.ng-leave-active{transform:translate3d(0,100%,0)!important;transition:all .3s cubic-bezier(.55,0,.55,.2)}md-bottom-sheet .md-subheader{background-color:transparent;font-family:Roboto,"Helvetica Neue",sans-serif;line-height:56px;padding:0;white-space:nowrap}md-bottom-sheet md-inline-icon{display:inline-block;height:24px;width:24px;fill:#444}md-bottom-sheet md-list-item{display:flex;outline:0}md-bottom-sheet md-list-item:hover{cursor:pointer}md-bottom-sheet.md-list md-list-item{padding:0;align-items:center;height:48px}md-bottom-sheet.md-grid{padding-left:24px;padding-right:24px;padding-top:0}md-bottom-sheet.md-grid md-list{display:flex;flex-direction:row;flex-wrap:wrap;transition:all .5s;align-items:center}md-bottom-sheet.md-grid md-list-item{flex-direction:column;align-items:center;transition:all .5s;height:96px;margin-top:8px;margin-bottom:8px}@media (max-width:960px){md-bottom-sheet.md-grid md-list-item{flex:1 1 33.3333333333%;max-width:33.3333333333%}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n+1){align-items:flex-start}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n){align-items:flex-end}}@media (min-width:960px) and (max-width:1279px){md-bottom-sheet.md-grid md-list-item{flex:1 1 25%;max-width:25%}}@media (min-width:1280px) and (max-width:1919px){md-bottom-sheet.md-grid md-list-item{flex:1 1 16.6666666667%;max-width:16.6666666667%}}@media (min-width:1920px){md-bottom-sheet.md-grid md-list-item{flex:1 1 14.2857142857%;max-width:14.2857142857%}}md-bottom-sheet.md-grid md-list-item::before{display:none}md-bottom-sheet.md-grid md-list-item .md-list-item-content{display:flex;flex-direction:column;align-items:center;width:48px;padding-bottom:16px}md-bottom-sheet.md-grid md-list-item .md-grid-item-content{border:1px solid transparent;display:flex;flex-direction:column;align-items:center;width:80px}md-bottom-sheet.md-grid md-list-item .md-grid-text{font-weight:400;line-height:16px;font-size:13px;margin:0;white-space:nowrap;width:64px;text-align:center;text-transform:none;padding-top:8px}@media screen and (-ms-high-contrast:active){md-bottom-sheet{border:1px solid #fff}}button.md-button::-moz-focus-inner{border:0}.md-button{display:inline-block;position:relative;cursor:pointer;min-height:36px;min-width:88px;line-height:36px;vertical-align:middle;align-items:center;text-align:center;border-radius:3px;box-sizing:border-box;user-select:none;outline:0;border:0;padding:0 6px;margin:6px 8px;background:0 0;color:currentColor;white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;font-style:inherit;font-variant:inherit;font-family:inherit;text-decoration:none;overflow:hidden;transition:box-shadow .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1)}.md-button:focus{outline:0}.md-button:focus,.md-button:hover{text-decoration:none}.md-button.ng-hide,.md-button.ng-leave{transition:none}.md-button.md-cornered{border-radius:0}.md-button.md-icon{padding:0;background:0 0}.md-button.md-raised:not([disabled]){box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button.md-icon-button{margin:0 6px;height:40px;min-width:0;line-height:24px;padding:8px;width:40px;border-radius:50%}.md-button.md-icon-button .md-ripple-container{border-radius:50%;background-clip:padding-box;overflow:hidden;-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.md-button.md-fab{z-index:20;line-height:56px;min-width:0;width:56px;height:56px;vertical-align:middle;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:50%;background-clip:padding-box;overflow:hidden;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-property:background-color,box-shadow,transform}.md-button.md-fab.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}.md-button.md-fab.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}.md-button.md-fab.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}.md-button.md-fab.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}.md-button.md-fab .md-ripple-container{border-radius:50%;background-clip:padding-box;overflow:hidden;-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.md-button.md-fab.md-mini{line-height:40px;width:40px;height:40px}.md-button.md-fab.ng-hide,.md-button.md-fab.ng-leave{transition:none}.md-button:not([disabled]).md-fab.md-focused,.md-button:not([disabled]).md-raised.md-focused{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button:not([disabled]).md-fab:active,.md-button:not([disabled]).md-raised:active{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-button .md-ripple-container{border-radius:3px;background-clip:padding-box;overflow:hidden;-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.md-button.md-icon-button md-icon,button.md-button.md-fab md-icon{display:block}.md-toast-open-top .md-button.md-fab-top-left,.md-toast-open-top .md-button.md-fab-top-right{transition:all .4s cubic-bezier(.25,.8,.25,1);transform:translate3d(0,42px,0)}.md-toast-open-top .md-button.md-fab-top-left:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-left:not([disabled]):hover,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]):hover{transform:translate3d(0,41px,0)}.md-toast-open-bottom .md-button.md-fab-bottom-left,.md-toast-open-bottom .md-button.md-fab-bottom-right{transition:all .4s cubic-bezier(.25,.8,.25,1);transform:translate3d(0,-42px,0)}.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]):hover,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]):hover{transform:translate3d(0,-43px,0)}.md-button-group{display:flex;flex:1;width:100%}.md-button-group>.md-button{flex:1;display:block;overflow:hidden;width:0;border-width:1px 0 1px 1px;border-radius:0;text-align:center;text-overflow:ellipsis;white-space:nowrap}.md-button-group>.md-button:first-child{border-radius:2px 0 0 2px}.md-button-group>.md-button:last-child{border-right-width:1px;border-radius:0 2px 2px 0}@media screen and (-ms-high-contrast:active){.md-button.md-fab,.md-button.md-raised{border:1px solid #fff}}md-card{box-sizing:border-box;display:flex;flex-direction:column;margin:8px;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}md-card md-card-header{padding:16px;display:flex;flex-direction:row}md-card md-card-header:first-child md-card-avatar{margin-right:12px}[dir=rtl] md-card md-card-header:first-child md-card-avatar{margin-right:auto;margin-left:12px}md-card md-card-header:last-child md-card-avatar{margin-left:12px}[dir=rtl] md-card md-card-header:last-child md-card-avatar{margin-left:auto;margin-right:12px}md-card md-card-header md-card-avatar{width:40px;height:40px}md-card md-card-header md-card-avatar .md-user-avatar,md-card md-card-header md-card-avatar md-icon{border-radius:50%}md-card md-card-header md-card-avatar md-icon{padding:8px}md-card md-card-header md-card-avatar+md-card-header-text{max-height:40px}md-card md-card-header md-card-avatar+md-card-header-text .md-title{font-size:14px}md-card md-card-header md-card-header-text{display:flex;flex:1;flex-direction:column}md-card md-card-header md-card-header-text .md-subhead{font-size:14px}md-card md-card-title-media img,md-card>img,md-card>md-card-header img{box-sizing:border-box;display:flex;flex:0 0 auto;width:100%;height:auto}md-card md-card-title{padding:24px 16px 16px;display:flex;flex:1 1 auto;flex-direction:row}md-card md-card-title+md-card-content{padding-top:0}md-card md-card-title md-card-title-text{flex:1;flex-direction:column;display:flex}md-card md-card-title md-card-title-text .md-subhead{padding-top:0;font-size:14px}md-card md-card-title md-card-title-text:only-child .md-subhead{padding-top:12px}md-card md-card-title md-card-title-media{margin-top:-8px}md-card md-card-title md-card-title-media .md-media-sm{height:80px;width:80px}md-card md-card-title md-card-title-media .md-media-md{height:112px;width:112px}md-card md-card-title md-card-title-media .md-media-lg{height:152px;width:152px}md-card md-card-content{display:block;padding:16px}md-card md-card-content>p:first-child{margin-top:0}md-card md-card-content>p:last-child{margin-bottom:0}md-card md-card-content .md-media-xl{height:240px;width:240px}md-card .md-actions,md-card md-card-actions{margin:8px}md-card .md-actions.layout-column .md-button:not(.md-icon-button),md-card md-card-actions.layout-column .md-button:not(.md-icon-button){margin:2px 0}md-card .md-actions.layout-column .md-button:not(.md-icon-button):first-of-type,md-card md-card-actions.layout-column .md-button:not(.md-icon-button):first-of-type{margin-top:0}md-card .md-actions.layout-column .md-button:not(.md-icon-button):last-of-type,md-card md-card-actions.layout-column .md-button:not(.md-icon-button):last-of-type{margin-bottom:0}md-card .md-actions.layout-column .md-button.md-icon-button,md-card md-card-actions.layout-column .md-button.md-icon-button{margin-top:6px;margin-bottom:6px}md-card .md-actions md-card-icon-actions,md-card md-card-actions md-card-icon-actions{flex:1;justify-content:flex-start;display:flex;flex-direction:row}md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button),md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button){margin:0 4px}md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type,md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:0}[dir=rtl] md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type,[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:auto;margin-right:0}md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type,md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:0}[dir=rtl] md-card .md-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type,[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:auto;margin-left:0}md-card .md-actions:not(.layout-column) .md-button.md-icon-button,md-card md-card-actions:not(.layout-column) .md-button.md-icon-button{margin-left:6px;margin-right:6px}md-card .md-actions:not(.layout-column) .md-button.md-icon-button:first-of-type,md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:12px}[dir=rtl] md-card .md-actions:not(.layout-column) .md-button.md-icon-button:first-of-type,[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:auto;margin-right:12px}md-card .md-actions:not(.layout-column) .md-button.md-icon-button:last-of-type,md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:12px}[dir=rtl] md-card .md-actions:not(.layout-column) .md-button.md-icon-button:last-of-type,[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:auto;margin-left:12px}md-card .md-actions:not(.layout-column) .md-button+md-card-icon-actions,md-card md-card-actions:not(.layout-column) .md-button+md-card-icon-actions{flex:1;justify-content:flex-end;display:flex;flex-direction:row}md-card md-card-footer{margin-top:auto;padding:16px}@media screen and (-ms-high-contrast:active){md-card{border:1px solid #fff}}.md-image-no-fill>img{width:auto;height:auto}.md-contact-chips .md-chips md-chip{padding:0 25px 0 0}[dir=rtl] .md-contact-chips .md-chips md-chip{padding:0 0 0 25px}.md-contact-chips .md-chips md-chip .md-contact-avatar{float:left}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-avatar{float:right}.md-contact-chips .md-chips md-chip .md-contact-avatar img{height:32px;border-radius:16px}.md-contact-chips .md-chips md-chip .md-contact-name{display:inline-block;height:32px;margin-left:8px}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion{height:56px}.md-contact-suggestion img{height:40px;border-radius:20px;margin-top:8px}.md-contact-suggestion .md-contact-name{margin-left:8px;width:120px}[dir=rtl] .md-contact-suggestion .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion .md-contact-email,.md-contact-suggestion .md-contact-name{display:inline-block;overflow:hidden;text-overflow:ellipsis}.md-contact-chips-suggestions li{height:100%}.md-chips{display:block;font-family:Roboto,"Helvetica Neue",sans-serif;font-size:16px;padding:0 0 8px 3px;vertical-align:middle}.md-chips:after{content:'';display:table;clear:both}[dir=rtl] .md-chips{padding:0 3px 8px 0}.md-chips.md-readonly .md-chip-input-container{min-height:32px}.md-chips:not(.md-readonly){cursor:text}.md-chips.md-removable md-chip{padding-right:22px}[dir=rtl] .md-chips.md-removable md-chip{padding-right:0;padding-left:22px}.md-chips.md-removable md-chip .md-chip-content{padding-right:4px}[dir=rtl] .md-chips.md-removable md-chip .md-chip-content{padding-right:0;padding-left:4px}.md-chips md-chip{cursor:default;border-radius:16px;display:block;height:32px;line-height:32px;margin:8px 8px 0 0;padding:0 12px 0 12px;float:left;box-sizing:border-box;max-width:100%;position:relative}[dir=rtl] .md-chips md-chip{margin:8px 0 0 8px}[dir=rtl] .md-chips md-chip{float:right}.md-chips md-chip .md-chip-content{display:block;float:left;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-chips md-chip .md-chip-content{float:right}.md-chips md-chip .md-chip-content:focus{outline:0}.md-chips md-chip._md-chip-content-edit-is-enabled{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.md-chips md-chip .md-chip-remove-container{position:absolute;right:0;line-height:22px}[dir=rtl] .md-chips md-chip .md-chip-remove-container{right:auto;left:0}.md-chips md-chip .md-chip-remove{text-align:center;width:32px;height:32px;min-width:0;padding:0;background:0 0;border:none;box-shadow:none;margin:0;position:relative}.md-chips md-chip .md-chip-remove md-icon{height:18px;width:18px;position:absolute;top:50%;left:50%;transform:translate3d(-50%,-50%,0)}.md-chips .md-chip-input-container{display:block;line-height:32px;margin:8px 8px 0 0;padding:0;float:left}[dir=rtl] .md-chips .md-chip-input-container{margin:8px 0 0 8px}[dir=rtl] .md-chips .md-chip-input-container{float:right}.md-chips .md-chip-input-container input:not([type]),.md-chips .md-chip-input-container input[type=email],.md-chips .md-chip-input-container input[type=number],.md-chips .md-chip-input-container input[type=tel],.md-chips .md-chip-input-container input[type=text],.md-chips .md-chip-input-container input[type=url]{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:not([type]):focus,.md-chips .md-chip-input-container input[type=email]:focus,.md-chips .md-chip-input-container input[type=number]:focus,.md-chips .md-chip-input-container input[type=tel]:focus,.md-chips .md-chip-input-container input[type=text]:focus,.md-chips .md-chip-input-container input[type=url]:focus{outline:0}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{background:0 0;height:32px}.md-chips .md-chip-input-container md-autocomplete md-autocomplete-wrap{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container input{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:focus{outline:0}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{height:32px}.md-chips .md-chip-input-container md-autocomplete{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container:not(:first-child){margin:8px 8px 0 0}[dir=rtl] .md-chips .md-chip-input-container:not(:first-child){margin:8px 0 0 8px}.md-chips .md-chip-input-container input{background:0 0;border-width:0}.md-chips md-autocomplete button{display:none}@media screen and (-ms-high-contrast:active){.md-chip-input-container,md-chip{border:1px solid #fff}.md-chip-input-container md-autocomplete{border:none}}.md-inline-form md-checkbox{margin:19px 0 18px}md-checkbox{box-sizing:border-box;display:inline-block;margin-bottom:16px;white-space:nowrap;cursor:pointer;outline:0;user-select:none;position:relative;min-width:20px;min-height:20px;margin-left:0;margin-right:16px}[dir=rtl] md-checkbox{margin-left:16px}[dir=rtl] md-checkbox{margin-right:0}md-checkbox:last-of-type{margin-left:0;margin-right:0}md-checkbox.md-focused:not([disabled]) .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-checkbox.md-focused:not([disabled]):not(.md-checked) .md-container:before{background-color:rgba(0,0,0,.12)}md-checkbox.md-align-top-left>div.md-container{top:12px}md-checkbox .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;left:0;right:auto}[dir=rtl] md-checkbox .md-container{left:auto}[dir=rtl] md-checkbox .md-container{right:0}md-checkbox .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-checkbox .md-container:after{box-sizing:border-box;content:'';position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-checkbox .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-checkbox .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:20px;height:20px;border-width:2px;border-style:solid;border-radius:2px}md-checkbox.md-checked .md-icon{border-color:transparent}md-checkbox.md-checked .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4.6666666667px;top:.2222222222px;display:table;width:6.6666666667px;height:13.3333333333px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:''}md-checkbox[disabled]{cursor:default}md-checkbox.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:table;width:12px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:''}md-checkbox .md-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;margin-left:30px;margin-right:0}[dir=rtl] md-checkbox .md-label{margin-left:0}[dir=rtl] md-checkbox .md-label{margin-right:30px}md-content{display:block;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}md-content[md-scroll-y]{overflow-y:auto;overflow-x:hidden}md-content[md-scroll-x]{overflow-x:auto;overflow-y:hidden}@media print{md-content{overflow:visible!important}}md-calendar{font-size:13px;user-select:none}.md-calendar-scroll-mask{display:inline-block;overflow:hidden;height:308px}.md-calendar-scroll-mask .md-virtual-repeat-scroller{overflow-y:scroll;-webkit-overflow-scrolling:touch}.md-calendar-scroll-mask .md-virtual-repeat-scroller::-webkit-scrollbar{display:none}.md-calendar-scroll-mask .md-virtual-repeat-offsetter{width:100%}.md-calendar-scroll-container{box-shadow:inset -3px 3px 6px rgba(0,0,0,.2);display:inline-block;height:308px;width:346px}.md-calendar-date{height:44px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box}.md-calendar-date:first-child{padding-left:16px}[dir=rtl] .md-calendar-date:first-child{padding-left:0;padding-right:16px}.md-calendar-date:last-child{padding-right:16px}[dir=rtl] .md-calendar-date:last-child{padding-right:0;padding-left:16px}.md-calendar-date.md-calendar-date-disabled{cursor:default}.md-calendar-date-selection-indicator{transition:background-color,color .4s cubic-bezier(.25,.8,.25,1);border-radius:50%;display:inline-block;width:40px;height:40px;line-height:40px}.md-calendar-date:not(.md-disabled) .md-calendar-date-selection-indicator{cursor:pointer}.md-calendar-month-label{height:44px;font-size:14px;font-weight:500;padding:0 0 0 24px}[dir=rtl] .md-calendar-month-label{padding:0 24px 0 0}md-calendar-month .md-calendar-month-label:not(.md-calendar-month-label-disabled){cursor:pointer}.md-calendar-month-label md-icon{transform:rotate(180deg)}[dir=rtl] .md-calendar-month-label md-icon{transform:none}.md-calendar-month-label span{vertical-align:middle}.md-calendar-day-header{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar-day-header th{height:40px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box;font-weight:400}.md-calendar-day-header th:first-child{padding-left:16px}[dir=rtl] .md-calendar-day-header th:first-child{padding-left:0;padding-right:16px}.md-calendar-day-header th:last-child{padding-right:16px}[dir=rtl] .md-calendar-day-header th:last-child{padding-right:0;padding-left:16px}.md-calendar{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar tr:last-child td{border-bottom-width:1px;border-bottom-style:solid}.md-calendar:first-child{border-top:1px solid transparent}.md-calendar tbody,.md-calendar td,.md-calendar tr{vertical-align:middle;box-sizing:content-box}md-datepicker{white-space:nowrap;overflow:hidden;padding-right:18px;margin-right:-18px;vertical-align:middle}[dir=rtl] md-datepicker{padding-right:0;padding-left:18px}[dir=rtl] md-datepicker{margin-right:auto;margin-left:-18px}.md-inline-form md-datepicker{margin-top:12px}.md-datepicker-button{display:inline-block;box-sizing:border-box;background:0 0;vertical-align:middle;position:relative}.md-datepicker-button:before{top:0;left:0;bottom:0;right:0;position:absolute;content:'';speak:none}.md-datepicker-input{font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:0;background:0 0;min-width:120px;max-width:328px;padding:0 0 5px}.md-datepicker-input::-ms-clear{display:none}._md-datepicker-floating-label>md-datepicker{overflow:visible}._md-datepicker-floating-label>md-datepicker .md-datepicker-input-container{border:none}._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:left;margin-top:-2.5px}[dir=rtl] ._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:right}._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:18px;left:auto;width:calc(100% - 84px)}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:auto}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){left:18px}._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:64px}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:auto;margin-right:64px}.md-datepicker-input-container{position:relative;border-bottom-width:1px;border-bottom-style:solid;display:inline-block;width:auto}.md-icon-button+.md-datepicker-input-container{margin-left:12px}[dir=rtl] .md-icon-button+.md-datepicker-input-container{margin-left:auto;margin-right:12px}.md-datepicker-input-container.md-datepicker-focused{border-bottom-width:2px}.md-datepicker-is-showing .md-scroll-mask{z-index:99}.md-datepicker-calendar-pane{position:absolute;top:0;left:-100%;z-index:100;border-width:1px;border-style:solid;background:0 0;transform:scale(0);transform-origin:0 0;transition:transform .2s cubic-bezier(.25,.8,.25,1)}.md-datepicker-calendar-pane.md-pane-open{transform:scale(1)}.md-datepicker-input-mask{height:40px;width:340px;position:relative;overflow:hidden;background:0 0;pointer-events:none;cursor:text}.md-datepicker-calendar{opacity:0;transition:opacity .2s cubic-bezier(.5,0,.25,1)}.md-pane-open .md-datepicker-calendar{opacity:1}.md-datepicker-calendar md-calendar:focus{outline:0}.md-datepicker-expand-triangle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid}.md-datepicker-triangle-button{position:absolute;right:0;top:5px;transform:translateY(-25%) translateX(45%)}[dir=rtl] .md-datepicker-triangle-button{right:auto;left:0}[dir=rtl] .md-datepicker-triangle-button{transform:translateY(-25%) translateX(-45%)}.md-datepicker-triangle-button.md-button.md-icon-button{height:36px;width:36px;position:absolute;padding:8px}md-datepicker[disabled] .md-datepicker-input-container{border-bottom-color:transparent}md-datepicker[disabled] .md-datepicker-triangle-button{display:none}.md-datepicker-open{overflow:hidden}.md-datepicker-open .md-datepicker-input-container,.md-datepicker-open input.md-input{border-bottom-color:transparent}.md-datepicker-open .md-datepicker-triangle-button,.md-datepicker-open.md-input-has-placeholder>label,.md-datepicker-open.md-input-has-value>label{display:none}.md-datepicker-pos-adjusted .md-datepicker-input-mask{display:none}.md-datepicker-calendar-pane .md-calendar{transform:translateY(-85px);transition:transform .65s cubic-bezier(.25,.8,.25,1);transition-delay:125ms}.md-datepicker-calendar-pane.md-pane-open .md-calendar{transform:translateY(0)}.md-dialog-is-showing{max-height:100%}.md-dialog-container{display:flex;justify-content:center;align-items:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80;overflow:hidden}md-dialog{opacity:0;min-width:240px;max-width:80%;max-height:80%;position:relative;overflow:auto;box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 13px 19px 2px rgba(0,0,0,.14),0 5px 24px 4px rgba(0,0,0,.12);display:flex;flex-direction:column}md-dialog.md-transition-in{opacity:1;transition:all .4s cubic-bezier(.25,.8,.25,1);transform:translate(0,0) scale(1)}md-dialog.md-transition-out{opacity:0;transition:all .4s cubic-bezier(.25,.8,.25,1);transform:translate(0,100%) scale(.2)}md-dialog>form{display:flex;flex-direction:column;overflow:auto}md-dialog .md-dialog-content{padding:24px}md-dialog md-dialog-content{order:1;flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch}md-dialog md-dialog-content:not([layout=row])>:first-child:not(.md-subheader){margin-top:0}md-dialog md-dialog-content:focus{outline:0}md-dialog md-dialog-content .md-subheader{margin:0}md-dialog md-dialog-content .md-dialog-content-body{width:100%}md-dialog md-dialog-content .md-prompt-input-container{width:100%;box-sizing:border-box}md-dialog .md-actions,md-dialog md-dialog-actions{display:flex;order:2;box-sizing:border-box;align-items:center;justify-content:flex-end;margin-bottom:0;padding-right:8px;padding-left:16px;min-height:52px;overflow:hidden}[dir=rtl] md-dialog .md-actions,[dir=rtl] md-dialog md-dialog-actions{padding-right:16px}[dir=rtl] md-dialog .md-actions,[dir=rtl] md-dialog md-dialog-actions{padding-left:8px}md-dialog .md-actions .md-button,md-dialog md-dialog-actions .md-button{margin-bottom:8px;margin-left:8px;margin-right:0;margin-top:8px}[dir=rtl] md-dialog .md-actions .md-button,[dir=rtl] md-dialog md-dialog-actions .md-button{margin-left:0}[dir=rtl] md-dialog .md-actions .md-button,[dir=rtl] md-dialog md-dialog-actions .md-button{margin-right:8px}md-dialog.md-content-overflow .md-actions,md-dialog.md-content-overflow md-dialog-actions{border-top-width:1px;border-top-style:solid}@media screen and (-ms-high-contrast:active){md-dialog{border:1px solid #fff}}@media (max-width:959px){md-dialog.md-dialog-fullscreen{min-height:100%;min-width:100%;border-radius:0}}md-divider{display:block;border-top-width:1px;border-top-style:solid;margin:0}md-divider[md-inset]{margin-left:80px}[dir=rtl] md-divider[md-inset]{margin-left:auto;margin-right:80px}.layout-gt-lg-row>md-divider,.layout-gt-md-row>md-divider,.layout-gt-sm-row>md-divider,.layout-gt-xs-row>md-divider,.layout-lg-row>md-divider,.layout-md-row>md-divider,.layout-row>md-divider,.layout-sm-row>md-divider,.layout-xl-row>md-divider,.layout-xs-row>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}md-fab-speed-dial{position:relative;display:flex;align-items:center;z-index:20}md-fab-speed-dial.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-speed-dial.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-speed-dial.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-speed-dial.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-speed-dial:not(.md-hover-full){pointer-events:none}md-fab-speed-dial:not(.md-hover-full) .md-fab-action-item,md-fab-speed-dial:not(.md-hover-full) md-fab-trigger{pointer-events:auto}md-fab-speed-dial:not(.md-hover-full).md-is-open{pointer-events:auto}md-fab-speed-dial ._md-css-variables{z-index:20}md-fab-speed-dial.md-is-open .md-fab-action-item{align-items:center}md-fab-speed-dial md-fab-actions{display:flex;height:auto}md-fab-speed-dial md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-fab-speed-dial.md-down{flex-direction:column}md-fab-speed-dial.md-down md-fab-trigger{order:1}md-fab-speed-dial.md-down md-fab-actions{flex-direction:column;order:2}md-fab-speed-dial.md-up{flex-direction:column}md-fab-speed-dial.md-up md-fab-trigger{order:2}md-fab-speed-dial.md-up md-fab-actions{flex-direction:column-reverse;order:1}md-fab-speed-dial.md-left{flex-direction:row}md-fab-speed-dial.md-left md-fab-trigger{order:2}md-fab-speed-dial.md-left md-fab-actions{flex-direction:row-reverse;order:1}md-fab-speed-dial.md-left md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-fab-speed-dial.md-right{flex-direction:row}md-fab-speed-dial.md-right md-fab-trigger{order:1}md-fab-speed-dial.md-right md-fab-actions{flex-direction:row;order:2}md-fab-speed-dial.md-right md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-fab-speed-dial.md-fling-remove .md-fab-action-item>*,md-fab-speed-dial.md-scale-remove .md-fab-action-item>*{visibility:hidden}md-fab-speed-dial.md-fling .md-fab-action-item{opacity:1}md-fab-speed-dial.md-fling.md-animations-waiting .md-fab-action-item{opacity:0;transition-duration:0s}md-fab-speed-dial.md-scale .md-fab-action-item{transform:scale(0);transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:.1428571429s}md-fab-toolbar{display:block}md-fab-toolbar.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-toolbar.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-toolbar.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-toolbar.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-toolbar .md-fab-toolbar-wrapper{display:block;position:relative;overflow:hidden;height:68px}md-fab-toolbar md-fab-trigger{position:absolute;z-index:20}md-fab-toolbar md-fab-trigger button{overflow:visible!important}md-fab-toolbar md-fab-trigger .md-fab-toolbar-background{display:block;position:absolute;z-index:21;opacity:1;transition:all .3s cubic-bezier(.55,0,.55,.2)}md-fab-toolbar md-fab-trigger md-icon{position:relative;z-index:22;opacity:1;transition:all .2s ease-in}md-fab-toolbar.md-left md-fab-trigger{right:0}[dir=rtl] md-fab-toolbar.md-left md-fab-trigger{right:auto;left:0}md-fab-toolbar.md-left .md-toolbar-tools{flex-direction:row-reverse}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:.6rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:auto;margin-left:.6rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:-.8rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-.8rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:8px}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:8px}md-fab-toolbar.md-right md-fab-trigger{left:0}[dir=rtl] md-fab-toolbar.md-right md-fab-trigger{left:auto;right:0}md-fab-toolbar.md-right .md-toolbar-tools{flex-direction:row}md-fab-toolbar md-toolbar{background-color:transparent!important;pointer-events:none;z-index:23}md-fab-toolbar md-toolbar .md-toolbar-tools{padding:0 20px;margin-top:3px}md-fab-toolbar md-toolbar .md-fab-action-item{opacity:0;transform:scale(0);transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:.15s}md-fab-toolbar.md-is-open md-fab-trigger>button{box-shadow:none}md-fab-toolbar.md-is-open md-fab-trigger>button md-icon{opacity:0}md-fab-toolbar.md-is-open .md-fab-action-item{opacity:1;transform:scale(1)}md-grid-list{box-sizing:border-box;display:block;position:relative}md-grid-list md-grid-tile,md-grid-list md-grid-tile-footer,md-grid-list md-grid-tile-header,md-grid-list md-grid-tile>figure{box-sizing:border-box}md-grid-list md-grid-tile{display:block;position:absolute}md-grid-list md-grid-tile figure{display:flex;align-items:center;justify-content:center;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;padding:0;margin:0}md-grid-list md-grid-tile md-grid-tile-footer,md-grid-list md-grid-tile md-grid-tile-header{display:flex;flex-direction:row;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.18);overflow:hidden;position:absolute;left:0;right:0}md-grid-list md-grid-tile md-grid-tile-footer h3,md-grid-list md-grid-tile md-grid-tile-footer h4,md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-header h4{font-weight:400;margin:0 0 0 16px}md-grid-list md-grid-tile md-grid-tile-footer h3,md-grid-list md-grid-tile md-grid-tile-header h3{font-size:14px}md-grid-list md-grid-tile md-grid-tile-footer h4,md-grid-list md-grid-tile md-grid-tile-header h4{font-size:12px}md-grid-list md-grid-tile md-grid-tile-header{top:0}md-grid-list md-grid-tile md-grid-tile-footer{bottom:0}@media screen and (-ms-high-contrast:active){md-grid-tile{border:1px solid #fff}md-grid-tile-footer{border-top:1px solid #fff}}md-icon{margin:auto;background-repeat:no-repeat no-repeat;display:inline-block;vertical-align:middle;fill:currentColor;height:24px;width:24px;min-height:24px;min-width:24px}md-icon svg{pointer-events:none;display:block}md-icon[md-font-icon]{line-height:24px;width:auto}md-input-container{display:inline-block;position:relative;padding:2px;margin:18px 0;vertical-align:middle}md-input-container:after{content:'';display:table;clear:both}md-input-container.md-block{display:block}md-input-container .md-errors-spacer{float:right;min-height:24px;min-width:1px}[dir=rtl] md-input-container .md-errors-spacer{float:left}md-input-container>md-icon{position:absolute;top:8px;left:2px;right:auto}[dir=rtl] md-input-container>md-icon{left:auto}[dir=rtl] md-input-container>md-icon{right:2px}md-input-container input[type=color],md-input-container input[type=date],md-input-container input[type=datetime-local],md-input-container input[type=datetime],md-input-container input[type=email],md-input-container input[type=month],md-input-container input[type=number],md-input-container input[type=password],md-input-container input[type=search],md-input-container input[type=tel],md-input-container input[type=text],md-input-container input[type=time],md-input-container input[type=url],md-input-container input[type=week],md-input-container textarea{-moz-appearance:none;-webkit-appearance:none}md-input-container input[type=date],md-input-container input[type=datetime-local],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week]{min-height:26px}md-input-container textarea{resize:none;overflow:hidden}md-input-container textarea.md-input{min-height:26px;-ms-flex-preferred-size:auto}md-input-container textarea[md-no-autogrow]{height:auto;overflow:auto}md-input-container label:not(.md-container-ignore){position:absolute;bottom:100%;left:0;right:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){left:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){right:0}md-input-container label:not(.md-container-ignore).md-required:after{content:' *';font-size:13px;vertical-align:top}md-input-container .md-placeholder,md-input-container label:not(.md-no-float):not(.md-container-ignore){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:3px;padding-right:0;z-index:1;transform:translate3d(0,28px,0) scale(1);transition:transform .4s cubic-bezier(.25,.8,.25,1);max-width:100%;transform-origin:left top}[dir=rtl] md-input-container .md-placeholder,[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore){padding-left:0}[dir=rtl] md-input-container .md-placeholder,[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore){padding-right:3px}[dir=rtl] md-input-container .md-placeholder,[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore){transform-origin:right top}md-input-container .md-placeholder{position:absolute;top:0;opacity:0;transition-property:opacity,transform;transform:translate3d(0,30px,0)}md-input-container.md-input-focused .md-placeholder{opacity:1;transform:translate3d(0,24px,0)}md-input-container.md-input-has-value .md-placeholder{transition:none;opacity:0}md-input-container:not(.md-input-has-value) input:not(:focus),md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-ampm-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-day-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-hour-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-millisecond-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-minute-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-month-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-second-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-text,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-week-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-year-field{color:transparent}md-input-container .md-input{order:2;display:block;margin-top:0;background:0 0;padding-top:2px;padding-bottom:1px;padding-left:2px;padding-right:2px;border-width:0 0 1px 0;line-height:26px;height:30px;-ms-flex-preferred-size:26px;border-radius:0;border-style:solid;width:100%;box-sizing:border-box;float:left}[dir=rtl] md-input-container .md-input{float:right}md-input-container .md-input:focus{outline:0}md-input-container .md-input:invalid{outline:0;box-shadow:none}md-input-container .md-input.md-no-flex{flex:none!important}md-input-container .md-char-counter{text-align:right;padding-right:2px;padding-left:0}[dir=rtl] md-input-container .md-char-counter{text-align:left}[dir=rtl] md-input-container .md-char-counter{padding-right:0}[dir=rtl] md-input-container .md-char-counter{padding-left:2px}md-input-container .md-input-messages-animation{position:relative;order:4;overflow:hidden;clear:left}[dir=rtl] md-input-container .md-input-messages-animation{clear:right}md-input-container .md-input-messages-animation.ng-enter .md-input-message-animation{opacity:0;margin-top:-100px}md-input-container .md-char-counter,md-input-container .md-input-message-animation{font-size:12px;line-height:14px;overflow:hidden;transition:all .3s cubic-bezier(.55,0,.55,.2);opacity:1;margin-top:0;padding-top:5px}md-input-container .md-char-counter:not(.md-char-counter),md-input-container .md-input-message-animation:not(.md-char-counter){padding-right:5px;padding-left:0}[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter),[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter){padding-right:0}[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter),[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter){padding-left:5px}md-input-container:not(.md-input-invalid) .md-auto-hide .md-input-message-animation{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation:not(.ng-animate){opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter{opacity:0;margin-top:-100px}md-input-container.md-input-focused label:not(.md-no-float),md-input-container.md-input-has-placeholder label:not(.md-no-float),md-input-container.md-input-has-value label:not(.md-no-float){transform:translate3d(0,6px,0) scale(.75);transition:transform cubic-bezier(.25,.8,.25,1) .4s,width cubic-bezier(.25,.8,.25,1) .4s}md-input-container.md-input-has-value label{transition:none}md-input-container .md-input.ng-invalid.ng-dirty,md-input-container.md-input-focused .md-input,md-input-container.md-input-resized .md-input{padding-bottom:0;border-width:0 0 2px 0}[disabled] md-input-container .md-input,md-input-container .md-input[disabled]{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x}md-input-container.md-icon-float{transition:margin-top .4s cubic-bezier(.25,.8,.25,1)}md-input-container.md-icon-float>label{pointer-events:none;position:absolute}md-input-container.md-icon-float>md-icon{top:8px;left:2px;right:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{left:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{right:2px}md-input-container.md-icon-left>label .md-placeholder,md-input-container.md-icon-left>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-right>label .md-placeholder,md-input-container.md-icon-right>label:not(.md-no-float):not(.md-container-ignore){width:calc(100% - 36px - 18px)}md-input-container.md-icon-left{padding-left:36px;padding-right:0}[dir=rtl] md-input-container.md-icon-left{padding-left:0}[dir=rtl] md-input-container.md-icon-left{padding-right:36px}md-input-container.md-icon-left>label{left:36px;right:auto}[dir=rtl] md-input-container.md-icon-left>label{left:auto}[dir=rtl] md-input-container.md-icon-left>label{right:36px}md-input-container.md-icon-right{padding-left:0;padding-right:36px}[dir=rtl] md-input-container.md-icon-right{padding-left:36px}[dir=rtl] md-input-container.md-icon-right{padding-right:0}md-input-container.md-icon-right>md-icon:last-of-type{margin:0;right:2px;left:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{right:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{left:2px}md-input-container.md-icon-left.md-icon-right{padding-left:36px;padding-right:36px}md-input-container.md-icon-left.md-icon-right>label .md-placeholder,md-input-container.md-icon-left.md-icon-right>label:not(.md-no-float):not(.md-container-ignore){width:calc(100% - (36px * 2))}.md-resize-wrapper{position:relative}.md-resize-wrapper:after{content:'';display:table;clear:both}.md-resize-handle{position:absolute;bottom:-5px;left:0;height:10px;background:0 0;width:100%;cursor:ns-resize}@media screen and (-ms-high-contrast:active){md-input-container.md-default-theme>md-icon{fill:#fff}}md-list{display:block;padding:8px 0 8px 0}md-list .md-subheader{font-size:14px;font-weight:500;letter-spacing:.010em;line-height:1.2em}md-list.md-dense md-list-item,md-list.md-dense md-list-item .md-list-item-inner{min-height:48px}md-list.md-dense md-list-item .md-list-item-inner::before,md-list.md-dense md-list-item::before{content:'';min-height:48px;visibility:hidden;display:inline-block}md-list.md-dense md-list-item .md-list-item-inner md-icon:first-child,md-list.md-dense md-list-item md-icon:first-child{width:20px;height:20px}md-list.md-dense md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list.md-dense md-list-item>md-icon:first-child:not(.md-avatar-icon){margin-right:36px}[dir=rtl] md-list.md-dense md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list.md-dense md-list-item>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:36px}md-list.md-dense md-list-item .md-avatar,md-list.md-dense md-list-item .md-avatar-icon,md-list.md-dense md-list-item .md-list-item-inner .md-avatar,md-list.md-dense md-list-item .md-list-item-inner .md-avatar-icon{margin-right:20px}[dir=rtl] md-list.md-dense md-list-item .md-avatar,[dir=rtl] md-list.md-dense md-list-item .md-avatar-icon,[dir=rtl] md-list.md-dense md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list.md-dense md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:20px}md-list.md-dense md-list-item .md-avatar,md-list.md-dense md-list-item .md-list-item-inner .md-avatar{flex:none;width:36px;height:36px}md-list.md-dense md-list-item.md-2-line .md-list-item-text.md-offset,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list.md-dense md-list-item.md-3-line .md-list-item-text.md-offset,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list.md-dense md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list.md-dense md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense md-list-item.md-2-line .md-list-item-text h4,md-list.md-dense md-list-item.md-2-line .md-list-item-text p,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list.md-dense md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense md-list-item.md-3-line .md-list-item-text h4,md-list.md-dense md-list-item.md-3-line .md-list-item-text p,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text h3,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text h4,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text p{line-height:1.05;font-size:12px}md-list.md-dense md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:13px}md-list.md-dense md-list-item.md-2-line,md-list.md-dense md-list-item.md-2-line>.md-no-style{min-height:60px}md-list.md-dense md-list-item.md-2-line::before,md-list.md-dense md-list-item.md-2-line>.md-no-style::before{content:'';min-height:60px;visibility:hidden;display:inline-block}md-list.md-dense md-list-item.md-2-line .md-avatar-icon,md-list.md-dense md-list-item.md-2-line>.md-avatar,md-list.md-dense md-list-item.md-2-line>.md-no-style .md-avatar-icon,md-list.md-dense md-list-item.md-2-line>.md-no-style>.md-avatar{margin-top:12px}md-list.md-dense md-list-item.md-3-line,md-list.md-dense md-list-item.md-3-line>.md-no-style{min-height:76px}md-list.md-dense md-list-item.md-3-line::before,md-list.md-dense md-list-item.md-3-line>.md-no-style::before{content:'';min-height:76px;visibility:hidden;display:inline-block}md-list.md-dense md-list-item.md-3-line>.md-avatar,md-list.md-dense md-list-item.md-3-line>.md-no-style>.md-avatar,md-list.md-dense md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list.md-dense md-list-item.md-3-line>md-icon:first-child{margin-top:16px}md-list-item{position:relative}md-list-item.md-proxy-focus.md-focused .md-no-style{transition:background-color .15s linear}md-list-item._md-button-wrap{position:relative}md-list-item._md-button-wrap>div.md-button:first-child{display:flex;align-items:center;justify-content:flex-start;padding:0 16px;margin:0;font-weight:400;text-align:left;border:medium none}[dir=rtl] md-list-item._md-button-wrap>div.md-button:first-child{text-align:right}md-list-item._md-button-wrap>div.md-button:first-child>.md-button:first-child{position:absolute;top:0;left:0;height:100%;margin:0;padding:0}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner{width:100%;min-height:inherit}md-list-item .md-no-style,md-list-item.md-no-proxy{position:relative;padding:0 16px;flex:1 1 auto}md-list-item .md-no-style.md-button,md-list-item.md-no-proxy.md-button{font-size:inherit;height:inherit;text-align:left;text-transform:none;width:100%;white-space:normal;flex-direction:inherit;align-items:inherit;border-radius:0;margin:0}[dir=rtl] md-list-item .md-no-style.md-button,[dir=rtl] md-list-item.md-no-proxy.md-button{text-align:right}md-list-item .md-no-style.md-button>.md-ripple-container,md-list-item.md-no-proxy.md-button>.md-ripple-container{border-radius:0}md-list-item .md-no-style:focus,md-list-item.md-no-proxy:focus{outline:0}md-list-item.md-clickable:hover{cursor:pointer}md-list-item md-divider{position:absolute;bottom:0;left:0;width:100%}[dir=rtl] md-list-item md-divider{left:auto;right:0}md-list-item md-divider[md-inset]{left:72px;width:calc(100% - 72px);margin:0!important}[dir=rtl] md-list-item md-divider[md-inset]{left:auto;right:72px}md-list-item,md-list-item .md-list-item-inner{display:flex;justify-content:flex-start;align-items:center;min-height:48px;height:auto}md-list-item .md-list-item-inner::before,md-list-item::before{content:'';min-height:48px;visibility:hidden;display:inline-block}md-list-item .md-list-item-inner>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon.md-secondary:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list-item>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item>md-icon.md-secondary:not(.md-avatar-icon),md-list-item>md-icon:first-child:not(.md-avatar-icon){width:24px;margin-top:16px;margin-bottom:12px;box-sizing:content-box}md-list-item .md-list-item-inner md-checkbox.md-secondary,md-list-item .md-list-item-inner>div.md-primary>md-checkbox,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox,md-list-item .md-list-item-inner>md-checkbox,md-list-item md-checkbox.md-secondary,md-list-item>div.md-primary>md-checkbox,md-list-item>div.md-secondary>md-checkbox,md-list-item>md-checkbox{align-self:center}md-list-item .md-list-item-inner md-checkbox.md-secondary .md-label,md-list-item .md-list-item-inner>div.md-primary>md-checkbox .md-label,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox .md-label,md-list-item .md-list-item-inner>md-checkbox .md-label,md-list-item md-checkbox.md-secondary .md-label,md-list-item>div.md-primary>md-checkbox .md-label,md-list-item>div.md-secondary>md-checkbox .md-label,md-list-item>md-checkbox .md-label{display:none}md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list-item>md-icon:first-child:not(.md-avatar-icon){margin-right:32px}[dir=rtl] md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list-item>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:32px}md-list-item .md-avatar,md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar,md-list-item .md-list-item-inner .md-avatar-icon{margin-top:8px;margin-bottom:8px;margin-right:16px;border-radius:50%;box-sizing:content-box}[dir=rtl] md-list-item .md-avatar,[dir=rtl] md-list-item .md-avatar-icon,[dir=rtl] md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:16px}md-list-item .md-avatar,md-list-item .md-list-item-inner .md-avatar{flex:none;width:40px;height:40px}md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar-icon{padding:8px}md-list-item .md-avatar-icon svg,md-list-item .md-list-item-inner .md-avatar-icon svg{width:24px;height:24px}md-list-item .md-list-item-inner>md-checkbox,md-list-item>md-checkbox{width:24px;margin-left:3px;margin-right:29px;margin-top:16px}[dir=rtl] md-list-item .md-list-item-inner>md-checkbox,[dir=rtl] md-list-item>md-checkbox{margin-left:29px}[dir=rtl] md-list-item .md-list-item-inner>md-checkbox,[dir=rtl] md-list-item>md-checkbox{margin-right:3px}md-list-item .md-list-item-inner .md-secondary-container,md-list-item .md-secondary-container{display:flex;align-items:center;flex-shrink:0;margin:auto;margin-right:0;margin-left:auto}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container,[dir=rtl] md-list-item .md-secondary-container{margin-right:auto}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container,[dir=rtl] md-list-item .md-secondary-container{margin-left:0}md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type,md-list-item .md-secondary-container .md-button:last-of-type,md-list-item .md-secondary-container .md-icon-button:last-of-type{margin-right:0}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type,[dir=rtl] md-list-item .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-secondary-container .md-icon-button:last-of-type{margin-right:auto;margin-left:0}md-list-item .md-list-item-inner .md-secondary-container md-checkbox,md-list-item .md-secondary-container md-checkbox{margin-top:0;margin-bottom:0}md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child,md-list-item .md-secondary-container md-checkbox:last-child{width:24px;margin-right:0}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child,[dir=rtl] md-list-item .md-secondary-container md-checkbox:last-child{margin-right:auto;margin-left:0}md-list-item .md-list-item-inner .md-secondary-container md-switch,md-list-item .md-secondary-container md-switch{margin-top:0;margin-bottom:0;margin-right:-6px}[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-switch,[dir=rtl] md-list-item .md-secondary-container md-switch{margin-right:auto;margin-left:-6px}md-list-item .md-list-item-inner>.md-list-item-inner>p,md-list-item .md-list-item-inner>p,md-list-item>.md-list-item-inner>p,md-list-item>p{flex:1 1 auto;margin:0}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style,md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{align-items:flex-start;justify-content:center}md-list-item.md-2-line.md-long-text,md-list-item.md-2-line>.md-no-style.md-long-text,md-list-item.md-3-line.md-long-text,md-list-item.md-3-line>.md-no-style.md-long-text{margin-top:8px;margin-bottom:8px}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text,md-list-item.md-3-line .md-list-item-text,md-list-item.md-3-line>.md-no-style .md-list-item-text{flex:1 1 auto;margin:auto;text-overflow:ellipsis;overflow:hidden}md-list-item.md-2-line .md-list-item-text.md-offset,md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list-item.md-3-line .md-list-item-text.md-offset,md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list-item.md-2-line .md-list-item-text h3,md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list-item.md-3-line .md-list-item-text h3,md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:16px;font-weight:400;letter-spacing:.010em;margin:0;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text h4,md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list-item.md-3-line .md-list-item-text h4,md-list-item.md-3-line>.md-no-style .md-list-item-text h4{font-size:14px;letter-spacing:.010em;margin:3px 0 1px 0;font-weight:400;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text p,md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list-item.md-3-line .md-list-item-text p,md-list-item.md-3-line>.md-no-style .md-list-item-text p{font-size:14px;font-weight:500;letter-spacing:.010em;margin:0;line-height:1.6em}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style{height:auto;min-height:72px}md-list-item.md-2-line::before,md-list-item.md-2-line>.md-no-style::before{content:'';min-height:72px;visibility:hidden;display:inline-block}md-list-item.md-2-line .md-avatar-icon,md-list-item.md-2-line>.md-avatar,md-list-item.md-2-line>.md-no-style .md-avatar-icon,md-list-item.md-2-line>.md-no-style>.md-avatar{margin-top:12px}md-list-item.md-2-line>.md-no-style>md-icon:first-child,md-list-item.md-2-line>md-icon:first-child{align-self:flex-start}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text{flex:1 1 auto}md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{height:auto;min-height:88px}md-list-item.md-3-line::before,md-list-item.md-3-line>.md-no-style::before{content:'';min-height:88px;visibility:hidden;display:inline-block}md-list-item.md-3-line>.md-avatar,md-list-item.md-3-line>.md-no-style>.md-avatar,md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list-item.md-3-line>md-icon:first-child{margin-top:16px}.md-open-menu-container{position:fixed;left:0;top:0;z-index:100;opacity:0;border-radius:2px}.md-open-menu-container md-menu-divider{margin-top:4px;margin-bottom:4px;height:1px;min-height:1px;max-height:1px;width:100%}.md-open-menu-container md-menu-content>*{opacity:0}.md-open-menu-container:not(.md-clickable){pointer-events:none}.md-open-menu-container.md-active{opacity:1;transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:.2s}.md-open-menu-container.md-active>md-menu-content>*{opacity:1;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:.2s;transition-delay:.1s}.md-open-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:250ms}md-menu-content{display:flex;flex-direction:column;padding:8px 0;max-height:304px;overflow-y:auto}md-menu-content.md-dense{max-height:208px}md-menu-content.md-dense md-menu-item{height:32px;min-height:0}md-menu-item{display:flex;flex-direction:row;min-height:48px;height:48px;align-content:center;justify-content:flex-start}md-menu-item>*{width:100%;margin:auto 0;padding-left:16px;padding-right:16px}md-menu-item>a.md-button{padding-top:5px}md-menu-item>.md-button{text-align:left;display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}md-menu-item>.md-button::-moz-focus-inner{padding:0;border:0}[dir=rtl] md-menu-item>.md-button{text-align:right}md-menu-item>.md-button md-icon{margin:auto 16px auto 0}[dir=rtl] md-menu-item>.md-button md-icon{margin:auto 0 auto 16px}md-menu-item>.md-button p{display:inline-block;margin:auto}md-menu-item>.md-button span{margin-top:auto;margin-bottom:auto}md-menu-item>.md-button .md-ripple-container{border-radius:inherit}md-toolbar .md-menu{height:auto;margin:auto;padding:0}@media (max-width:959px){md-menu-content{min-width:112px}md-menu-content[width="3"]{min-width:168px}md-menu-content[width="4"]{min-width:224px}md-menu-content[width="5"]{min-width:280px}md-menu-content[width="6"]{min-width:336px}md-menu-content[width="7"]{min-width:392px}}@media (min-width:960px){md-menu-content{min-width:96px}md-menu-content[width="3"]{min-width:192px}md-menu-content[width="4"]{min-width:256px}md-menu-content[width="5"]{min-width:320px}md-menu-content[width="6"]{min-width:384px}md-menu-content[width="7"]{min-width:448px}}md-toolbar.md-menu-toolbar h2.md-toolbar-tools{line-height:1rem;height:auto;padding:28px;padding-bottom:12px}md-toolbar.md-has-open-menu{position:relative;z-index:100}md-menu-bar{padding:0 20px;display:block;position:relative;z-index:2}md-menu-bar .md-menu{display:inline-block;padding:0;position:relative}md-menu-bar button{font-size:14px;padding:0 10px;margin:0;border:0;background-color:transparent;height:40px}md-menu-bar md-backdrop.md-menu-backdrop{z-index:-2}md-menu-content.md-menu-bar-menu.md-dense{max-height:none;padding:16px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent{position:relative}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{position:absolute;padding:0;width:24px;top:6px;left:24px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{left:auto;right:24px}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button{padding:0 32px 0 64px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button{padding:0 64px 0 32px}md-menu-content.md-menu-bar-menu.md-dense .md-button{min-height:0;height:32px;display:flex}md-menu-content.md-menu-bar-menu.md-dense .md-button span{flex-grow:1}md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{flex-grow:0;align-self:flex-end;margin:0 8px}md-menu-content.md-menu-bar-menu.md-dense md-menu-divider{margin:8px 0}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button{text-align:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button{text-align:right}md-menu-content.md-menu-bar-menu.md-dense .md-menu{padding:0}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{position:relative;margin:0;width:100%;text-transform:none;font-weight:400;border-radius:0;padding-left:16px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{padding-left:0;padding-right:16px}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{display:block;content:'\25BC';position:absolute;top:0;speak:none;transform:rotate(270deg) scaleY(.45) scaleX(.9);right:28px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{transform:rotate(90deg) scaleY(.45) scaleX(.9)}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{right:auto;left:28px}.md-nav-bar{border-style:solid;border-width:0 0 1px;height:48px;position:relative}._md-nav-bar-list{outline:0;list-style:none;margin:0;padding:0;box-sizing:border-box;display:flex;flex-direction:row}.md-nav-item:first-of-type{margin-left:8px}.md-button._md-nav-button{line-height:24px;margin:0 4px;padding:12px 16px;transition:background-color .35s cubic-bezier(.35,0,.25,1)}.md-button._md-nav-button:focus{outline:0}.md-button._md-nav-button:hover{background-color:inherit}md-nav-ink-bar{bottom:0;height:2px;left:auto;position:absolute;right:auto;background-color:#000}md-nav-ink-bar._md-left{transition:left 125ms cubic-bezier(.35,0,.25,1),right .25s cubic-bezier(.35,0,.25,1)}md-nav-ink-bar._md-right{transition:left .25s cubic-bezier(.35,0,.25,1),right 125ms cubic-bezier(.35,0,.25,1)}md-nav-extra-content{min-height:48px;padding-right:12px}.md-panel-outer-wrapper{height:100%;left:0;position:absolute;top:0;width:100%}._md-panel-hidden{display:none}._md-panel-fullscreen{border-radius:0;left:0;min-height:100%;min-width:100%;position:fixed;top:0}._md-panel-shown .md-panel{opacity:1;transition:none}.md-panel{opacity:0;position:fixed}.md-panel._md-panel-shown{opacity:1;transition:none}.md-panel._md-panel-animate-enter{opacity:1;transition:all .3s cubic-bezier(0,0,.2,1)}.md-panel._md-panel-animate-leave{opacity:1;transition:all .3s cubic-bezier(.4,0,1,1)}.md-panel._md-panel-animate-fade-out,.md-panel._md-panel-animate-scale-out{opacity:0}.md-panel._md-panel-backdrop{height:100%;position:absolute;width:100%}.md-panel._md-opaque-enter{opacity:.48;transition:opacity .3s cubic-bezier(0,0,.2,1)}.md-panel._md-opaque-leave{transition:opacity .3s cubic-bezier(.4,0,1,1)}@keyframes indeterminate-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}md-progress-circular{position:relative;display:block}md-progress-circular._md-progress-circular-disabled{visibility:hidden}md-progress-circular.md-mode-indeterminate svg{animation:indeterminate-rotate 2.9s linear infinite}md-progress-circular svg{position:absolute;overflow:visible;top:0;left:0}md-progress-linear{display:block;position:relative;width:100%;height:5px;padding-top:0!important;margin-bottom:0!important}md-progress-linear._md-progress-linear-disabled{visibility:hidden}md-progress-linear .md-container{display:block;position:relative;overflow:hidden;width:100%;height:5px;transform:translate(0,0) scale(1,1)}md-progress-linear .md-container .md-bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:5px}md-progress-linear .md-container .md-dashed:before{content:"";display:none;position:absolute;margin-top:0;height:5px;width:100%;background-color:transparent;background-size:10px 10px!important;background-position:0 -23px}md-progress-linear .md-container .md-bar1,md-progress-linear .md-container .md-bar2{transition:transform .2s linear}md-progress-linear .md-container.md-mode-query .md-bar1{display:none}md-progress-linear .md-container.md-mode-query .md-bar2{transition:all .2s linear;animation:query .8s infinite cubic-bezier(.39,.575,.565,1)}md-progress-linear .md-container.md-mode-determinate .md-bar1{display:none}md-progress-linear .md-container.md-mode-indeterminate .md-bar1{animation:md-progress-linear-indeterminate-scale-1 4s infinite,md-progress-linear-indeterminate-1 4s infinite}md-progress-linear .md-container.md-mode-indeterminate .md-bar2{animation:md-progress-linear-indeterminate-scale-2 4s infinite,md-progress-linear-indeterminate-2 4s infinite}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container{animation:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar1{animation-name:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar2{animation-name:none}md-progress-linear .md-container.md-mode-buffer{background-color:transparent!important;transition:all .2s linear}md-progress-linear .md-container.md-mode-buffer .md-dashed:before{display:block;animation:buffer 3s infinite linear}@keyframes query{0%{opacity:1;transform:translateX(35%) scale(.3,1)}100%{opacity:0;transform:translateX(-50%) scale(0,1)}}@keyframes buffer{0%{opacity:1;background-position:0 -23px}50%{opacity:0}100%{opacity:1;background-position:-200px -23px}}@keyframes md-progress-linear-indeterminate-scale-1{0%{transform:scaleX(.1);animation-timing-function:linear}36.6%{transform:scaleX(.1);animation-timing-function:cubic-bezier(.334731432,.124819821,.785843996,1)}69.15%{transform:scaleX(.83);animation-timing-function:cubic-bezier(.225732004,0,.233648906,1.3709798)}100%{transform:scaleX(.1)}}@keyframes md-progress-linear-indeterminate-1{0%{left:-105.166666667%;animation-timing-function:linear}20%{left:-105.166666667%;animation-timing-function:cubic-bezier(.5,0,.701732,.495818703)}69.15%{left:21.5%;animation-timing-function:cubic-bezier(.302435,.38135197,.55,.956352125)}100%{left:95.4444444444%}}@keyframes md-progress-linear-indeterminate-scale-2{0%{transform:scaleX(.1);animation-timing-function:cubic-bezier(.205028172,.057050836,.57660995,.453970841)}19.15%{transform:scaleX(.57);animation-timing-function:cubic-bezier(.152312994,.196431957,.648373778,1.00431535)}44.15%{transform:scaleX(.91);animation-timing-function:cubic-bezier(.25775882,-.003163357,.211761916,1.38178961)}100%{transform:scaleX(.1)}}@keyframes md-progress-linear-indeterminate-2{0%{left:-54.8888888889%;animation-timing-function:cubic-bezier(.15,0,.5150584,.409684966)}25%{left:-17.25%;animation-timing-function:cubic-bezier(.3103299,.284057684,.8,.733718979)}48.35%{left:29.5%;animation-timing-function:cubic-bezier(.4,.627034903,.6,.902025796)}100%{left:117.388888889%}}md-radio-button{box-sizing:border-box;display:block;margin-bottom:16px;white-space:nowrap;cursor:pointer;position:relative}md-radio-button[disabled]{cursor:default}md-radio-button[disabled] .md-container{cursor:default}md-radio-button .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;cursor:pointer;left:0;right:auto}[dir=rtl] md-radio-button .md-container{left:auto}[dir=rtl] md-radio-button .md-container{right:0}md-radio-button .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-radio-button .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-radio-button.md-align-top-left>div.md-container{top:12px}md-radio-button .md-off{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-style:solid;border-width:2px;border-radius:50%;transition:border-color ease .28s}md-radio-button .md-on{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-radius:50%;transition:transform ease .28s;transform:scale(0)}md-radio-button.md-checked .md-on{transform:scale(.5)}md-radio-button .md-label{box-sizing:border-box;position:relative;display:inline-block;margin-left:30px;margin-right:0;vertical-align:middle;white-space:normal;pointer-events:none;width:auto}[dir=rtl] md-radio-button .md-label{margin-left:0}[dir=rtl] md-radio-button .md-label{margin-right:30px}md-radio-group.layout-column md-radio-button,md-radio-group.layout-gt-lg-column md-radio-button,md-radio-group.layout-gt-md-column md-radio-button,md-radio-group.layout-gt-sm-column md-radio-button,md-radio-group.layout-gt-xs-column md-radio-button,md-radio-group.layout-lg-column md-radio-button,md-radio-group.layout-md-column md-radio-button,md-radio-group.layout-sm-column md-radio-button,md-radio-group.layout-xl-column md-radio-button,md-radio-group.layout-xs-column md-radio-button{margin-bottom:16px}md-radio-group.layout-gt-lg-row md-radio-button,md-radio-group.layout-gt-md-row md-radio-button,md-radio-group.layout-gt-sm-row md-radio-button,md-radio-group.layout-gt-xs-row md-radio-button,md-radio-group.layout-lg-row md-radio-button,md-radio-group.layout-md-row md-radio-button,md-radio-group.layout-row md-radio-button,md-radio-group.layout-sm-row md-radio-button,md-radio-group.layout-xl-row md-radio-button,md-radio-group.layout-xs-row md-radio-button{margin-top:0;margin-bottom:0;margin-left:0;margin-right:16px}[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button,[dir=rtl] md-radio-group.layout-lg-row md-radio-button,[dir=rtl] md-radio-group.layout-md-row md-radio-button,[dir=rtl] md-radio-group.layout-row md-radio-button,[dir=rtl] md-radio-group.layout-sm-row md-radio-button,[dir=rtl] md-radio-group.layout-xl-row md-radio-button,[dir=rtl] md-radio-group.layout-xs-row md-radio-button{margin-left:16px}[dir=rtl] md-radio-group.layout-gt-lg-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-md-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-sm-row md-radio-button,[dir=rtl] md-radio-group.layout-gt-xs-row md-radio-button,[dir=rtl] md-radio-group.layout-lg-row md-radio-button,[dir=rtl] md-radio-group.layout-md-row md-radio-button,[dir=rtl] md-radio-group.layout-row md-radio-button,[dir=rtl] md-radio-group.layout-sm-row md-radio-button,[dir=rtl] md-radio-group.layout-xl-row md-radio-button,[dir=rtl] md-radio-group.layout-xs-row md-radio-button{margin-right:0}md-radio-group.layout-gt-lg-row md-radio-button:last-of-type,md-radio-group.layout-gt-md-row md-radio-button:last-of-type,md-radio-group.layout-gt-sm-row md-radio-button:last-of-type,md-radio-group.layout-gt-xs-row md-radio-button:last-of-type,md-radio-group.layout-lg-row md-radio-button:last-of-type,md-radio-group.layout-md-row md-radio-button:last-of-type,md-radio-group.layout-row md-radio-button:last-of-type,md-radio-group.layout-sm-row md-radio-button:last-of-type,md-radio-group.layout-xl-row md-radio-button:last-of-type,md-radio-group.layout-xs-row md-radio-button:last-of-type{margin-left:0;margin-right:0}md-radio-group:focus{outline:0}md-radio-group.md-focused .md-checked .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group[disabled] md-radio-button{cursor:default}md-radio-group[disabled] md-radio-button .md-container{cursor:default}.md-inline-form md-radio-group{margin:18px 0 19px}.md-inline-form md-radio-group md-radio-button{display:inline-block;height:30px;padding:2px;box-sizing:border-box;margin-top:0;margin-bottom:0}@media screen and (-ms-high-contrast:active){md-radio-button.md-default-theme .md-on{background-color:#fff}}md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transition:transform .4s cubic-bezier(.25,.8,.25,1);transform-origin:left top}[dir=rtl] md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transform-origin:right top}md-input-container.md-input-focused:not([md-no-float]) .md-select-placeholder span:first-child{transform:translateY(-22px) translateX(-2px) scale(.75)}.md-select-menu-container{position:fixed;left:0;top:0;z-index:90;opacity:0;display:none;transform:translateY(-1px)}.md-select-menu-container:not(.md-clickable){pointer-events:none}.md-select-menu-container md-progress-circular{display:table;margin:24px auto!important}.md-select-menu-container.md-active{display:block;opacity:1}.md-select-menu-container.md-active md-select-menu{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:150ms}.md-select-menu-container.md-active md-select-menu>*{opacity:1;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:150ms;transition-delay:.1s}.md-select-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(.55,0,.55,.2);transition-duration:250ms}md-input-container>md-select{margin:0;order:2}md-input-container:not(.md-input-has-value) md-select.ng-required:not(.md-no-asterisk) .md-select-value span:first-child:after,md-input-container:not(.md-input-has-value) md-select[required]:not(.md-no-asterisk) .md-select-value span:first-child:after{content:' *';font-size:13px;vertical-align:top}md-input-container.md-input-invalid md-select .md-select-value{border-bottom-style:solid;padding-bottom:1px}md-select{display:flex;margin:20px 0 26px 0}md-select.ng-required.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after,md-select[required].ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after{content:' *';font-size:13px;vertical-align:top}md-select[disabled] .md-select-value{background-position:0 bottom;background-size:4px 1px;background-repeat:repeat-x;margin-bottom:-1px}md-select:focus{outline:0}md-select[disabled]:hover{cursor:default}md-select:not([disabled]):hover{cursor:pointer}md-select:not([disabled]).ng-invalid.ng-touched .md-select-value{border-bottom-style:solid;padding-bottom:1px}md-select:not([disabled]):focus .md-select-value{border-bottom-width:2px;border-bottom-style:solid;padding-bottom:0}md-select:not([disabled]):focus.ng-invalid.ng-touched .md-select-value{padding-bottom:0}md-input-container.md-input-has-value .md-select-value>span:not(.md-select-icon){transform:translate3d(0,1px,0)}.md-select-value{display:flex;align-items:center;padding:2px 2px 1px;border-bottom-width:1px;border-bottom-style:solid;background-color:transparent;position:relative;box-sizing:content-box;min-width:64px;min-height:26px;flex-grow:1}.md-select-value>span:not(.md-select-icon){max-width:100%;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-select-value>span:not(.md-select-icon) .md-text{display:inline}.md-select-value .md-select-icon{display:block;align-items:flex-end;text-align:end;width:24px;margin:0 4px;transform:translate3d(0,-2px,0);font-size:1.2rem}.md-select-value .md-select-icon:after{display:block;content:'\25BC';position:relative;top:2px;speak:none;font-size:13px;transform:scaleY(.5) scaleX(1)}.md-select-value.md-select-placeholder{display:flex;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:2px;z-index:1}md-select-menu{display:flex;flex-direction:column;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:hidden;transform-origin:left top;transform:scale(1)}md-select-menu.md-reverse{flex-direction:column-reverse}md-select-menu:not(.md-overflow) md-content{padding-top:8px;padding-bottom:8px}[dir=rtl] md-select-menu{transform-origin:right top}md-select-menu md-content{min-width:136px;min-height:48px;max-height:256px;overflow-y:auto}md-select-menu>*{opacity:0}md-option{cursor:pointer;position:relative;display:flex;align-items:center;width:auto;transition:background .15s linear;padding:0 16px 0 16px;height:48px}md-option[disabled]{cursor:default}md-option:focus{outline:0}md-option .md-text{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}md-optgroup{display:block}md-optgroup label{display:block;font-size:14px;text-transform:uppercase;padding:16px;font-weight:500}md-optgroup md-option{padding-left:32px;padding-right:32px}@media screen and (-ms-high-contrast:active){.md-select-backdrop{background-color:transparent}md-select-menu{border:1px solid #fff}}md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:40px;padding-right:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-right:40px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;left:0;right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{right:0}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:after{box-sizing:border-box;content:'';position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:20px;height:20px;border-width:2px;border-style:solid;border-radius:2px}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon{border-color:transparent}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4.6666666667px;top:.2222222222px;display:table;width:6.6666666667px;height:13.3333333333px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:''}md-select-menu[multiple] md-option.md-checkbox-enabled[disabled]{cursor:default}md-select-menu[multiple] md-option.md-checkbox-enabled.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:table;width:12px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:''}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:10.6666666667px;margin-right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-right:10.6666666667px}md-sidenav{box-sizing:border-box;position:absolute;flex-direction:column;z-index:60;width:320px;max-width:320px;bottom:0;overflow:auto;-webkit-overflow-scrolling:touch}md-sidenav ul{list-style:none}md-sidenav.md-closed{display:none}md-sidenav.md-closed-add,md-sidenav.md-closed-remove{display:flex;transition:.2s ease-in all}md-sidenav.md-closed-add.md-closed-add-active,md-sidenav.md-closed-remove.md-closed-remove-active{transition:all .4s cubic-bezier(.25,.8,.25,1)}md-sidenav.md-locked-open-add,md-sidenav.md-locked-open-remove{position:static;display:flex;transform:translate3d(0,0,0)}md-sidenav.md-locked-open,md-sidenav.md-locked-open-remove.md-closed,md-sidenav.md-locked-open.md-closed,md-sidenav.md-locked-open.md-closed.md-sidenav-left,md-sidenav.md-locked-open.md-closed.md-sidenav-right{position:static;display:flex;transform:translate3d(0,0,0)}md-sidenav.md-locked-open-remove-active{transition:width .3s cubic-bezier(.55,0,.55,.2),min-width .3s cubic-bezier(.55,0,.55,.2);width:0!important;min-width:0!important}md-sidenav.md-closed.md-locked-open-add{width:0!important;min-width:0!important;transform:translate3d(0,0,0)}md-sidenav.md-closed.md-locked-open-add-active{transition:width .3s cubic-bezier(.55,0,.55,.2),min-width .3s cubic-bezier(.55,0,.55,.2);width:320px;min-width:320px;transform:translate3d(0,0,0)}.md-sidenav-backdrop.md-locked-open{display:none}.md-sidenav-left,md-sidenav{left:0;top:0;transform:translate3d(0,0,0)}.md-sidenav-left.md-closed,md-sidenav.md-closed{transform:translate3d(-100%,0,0)}.md-sidenav-right{left:100%;top:0;transform:translate(-100%,0)}.md-sidenav-right.md-closed{transform:translate(0,0)}@media (min-width:600px){md-sidenav{max-width:400px}}@media (max-width:456px){md-sidenav{width:calc(100% - 56px);min-width:calc(100% - 56px);max-width:calc(100% - 56px)}}@media screen and (-ms-high-contrast:active){.md-sidenav-left,md-sidenav{border-right:1px solid #fff}.md-sidenav-right{border-left:1px solid #fff}}@keyframes sliderFocusThumb{0%{transform:scale(.7)}30%{transform:scale(1)}100%{transform:scale(.7)}}@keyframes sliderDiscreteFocusThumb{0%{transform:scale(.7)}50%{transform:scale(.8)}100%{transform:scale(0)}}@keyframes sliderDiscreteFocusRing{0%{transform:scale(.7);opacity:0}50%{transform:scale(1);opacity:1}100%{transform:scale(0)}}md-slider{height:48px;min-width:128px;position:relative;margin-left:4px;margin-right:4px;padding:0;display:block;flex-direction:row}md-slider *,md-slider :after{box-sizing:border-box}md-slider .md-slider-wrapper{outline:0;width:100%;height:100%}md-slider .md-slider-content{position:relative}md-slider .md-track-container{width:100%;position:absolute;top:23px;height:2px}md-slider .md-track{position:absolute;left:0;right:0;height:100%}md-slider .md-track-fill{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-property:width,height}md-slider .md-track-ticks{position:absolute;left:0;right:0;height:100%}md-slider .md-track-ticks canvas{width:100%;height:100%}md-slider .md-thumb-container{position:absolute;left:0;top:50%;transform:translate3d(-50%,-50%,0);transition:all .4s cubic-bezier(.25,.8,.25,1);transition-property:left,right,bottom}[dir=rtl] md-slider .md-thumb-container{left:auto;right:0}md-slider .md-thumb{z-index:1;position:absolute;left:-10px;top:14px;width:20px;height:20px;border-radius:20px;transform:scale(.7);transition:all .4s cubic-bezier(.25,.8,.25,1)}[dir=rtl] md-slider .md-thumb{left:auto;right:-10px}md-slider .md-thumb:after{content:'';position:absolute;width:20px;height:20px;border-radius:20px;border-width:3px;border-style:solid;transition:inherit}md-slider .md-sign{display:flex;align-items:center;justify-content:center;position:absolute;left:-14px;top:-17px;width:28px;height:28px;border-radius:28px;transform:scale(.4) translate3d(0,67.5px,0);transition:all .3s cubic-bezier(.35,0,.25,1)}md-slider .md-sign:after{position:absolute;content:'';left:0;border-radius:16px;top:19px;border-left:14px solid transparent;border-right:14px solid transparent;border-top-width:16px;border-top-style:solid;opacity:0;transform:translate3d(0,-8px,0);transition:all .2s cubic-bezier(.35,0,.25,1)}[dir=rtl] md-slider .md-sign:after{left:auto;right:0}md-slider .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:700}md-slider .md-focus-ring{position:absolute;left:-17px;top:7px;width:34px;height:34px;border-radius:34px;transform:scale(.7);opacity:0;transition:all .35s cubic-bezier(.35,0,.25,1)}[dir=rtl] md-slider .md-focus-ring{left:auto;right:-17px}md-slider .md-disabled-thumb{position:absolute;left:-14px;top:10px;width:28px;height:28px;border-radius:28px;transform:scale(.5);border-width:4px;border-style:solid;display:none}[dir=rtl] md-slider .md-disabled-thumb{left:auto;right:-14px}md-slider.md-min .md-sign{opacity:0}md-slider:focus{outline:0}md-slider.md-dragging .md-thumb-container,md-slider.md-dragging .md-track-fill{transition:none}md-slider:not([md-discrete]) .md-sign,md-slider:not([md-discrete]) .md-track-ticks{display:none}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper .md-thumb:hover{transform:scale(.8)}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(1);opacity:1}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderFocusThumb .7s cubic-bezier(.35,0,.25,1)}md-slider:not([md-discrete]):not([disabled]).md-active .md-slider-wrapper .md-thumb{transform:scale(1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(0);animation:sliderDiscreteFocusRing .5s cubic-bezier(.35,0,.25,1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderDiscreteFocusThumb .5s cubic-bezier(.35,0,.25,1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb,md-slider[md-discrete]:not([disabled]).md-active .md-thumb{transform:scale(0)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign,md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign:after,md-slider[md-discrete]:not([disabled]).md-active .md-sign,md-slider[md-discrete]:not([disabled]).md-active .md-sign:after{opacity:1;transform:translate3d(0,0,0) scale(1)}md-slider[md-discrete][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-discrete][disabled][readonly] .md-sign,md-slider[md-discrete][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0,0,0) scale(1)}md-slider[disabled] .md-track-fill{display:none}md-slider[disabled] .md-track-ticks{opacity:0}md-slider[disabled]:not([readonly]) .md-sign{opacity:0}md-slider[disabled] .md-thumb{transform:scale(.5)}md-slider[disabled] .md-disabled-thumb{display:block}md-slider[md-vertical]{flex-direction:column;min-height:128px;min-width:0}md-slider[md-vertical] .md-slider-wrapper{flex:1;padding-top:12px;padding-bottom:12px;width:48px;align-self:center;display:flex;justify-content:center}md-slider[md-vertical] .md-track-container{height:100%;width:2px;top:0;left:calc(50% - (2px / 2))}md-slider[md-vertical] .md-thumb-container{top:auto;margin-bottom:23px;left:calc(50% - 1px);bottom:0}md-slider[md-vertical] .md-thumb-container .md-thumb:after{left:1px}md-slider[md-vertical] .md-thumb-container .md-focus-ring{left:-16px}md-slider[md-vertical] .md-track-fill{bottom:0}md-slider[md-vertical][md-discrete] .md-sign{left:-40px;top:9.5px;transform:scale(.4) translate3d(67.5px,0,0)}md-slider[md-vertical][md-discrete] .md-sign:after{top:9.5px;left:19px;border-top:14px solid transparent;border-right:0;border-bottom:14px solid transparent;border-left-width:16px;border-left-style:solid;opacity:0;transform:translate3d(0,-8px,0);transition:all .2s ease-in-out}md-slider[md-vertical][md-discrete] .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:700}md-slider[md-vertical][md-discrete] .md-focused .md-sign:after,md-slider[md-vertical][md-discrete].md-active .md-sign:after,md-slider[md-vertical][md-discrete][disabled][readonly] .md-sign:after{top:0}md-slider[md-vertical][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-vertical][disabled][readonly] .md-sign,md-slider[md-vertical][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0,0,0) scale(1)}md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:auto;right:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{right:auto}md-slider[md-invert][md-vertical] .md-track-fill{bottom:auto;top:0}md-slider-container{display:flex;align-items:center;flex-direction:row}md-slider-container>:first-child:not(md-slider),md-slider-container>:last-child:not(md-slider){min-width:25px;max-width:42px;height:25px;transition:all .4s cubic-bezier(.25,.8,.25,1);transition-property:color,max-width}md-slider-container>:first-child:not(md-slider){margin-right:16px}[dir=rtl] md-slider-container>:first-child:not(md-slider){margin-right:auto;margin-left:16px}md-slider-container>:last-child:not(md-slider){margin-left:16px}[dir=rtl] md-slider-container>:last-child:not(md-slider){margin-left:auto;margin-right:16px}md-slider-container[md-vertical]{flex-direction:column}md-slider-container[md-vertical]>:first-child:not(md-slider),md-slider-container[md-vertical]>:last-child:not(md-slider){margin-right:0;margin-left:0;text-align:center}md-slider-container md-input-container input[type=number]{text-align:center;padding-left:15px;height:50px;margin-top:-25px}[dir=rtl] md-slider-container md-input-container input[type=number]{padding-left:0;padding-right:15px}@media screen and (-ms-high-contrast:active){md-slider.md-default-theme .md-track{border-bottom:1px solid #fff}}.md-sticky-clone{z-index:2;top:0;left:0;right:0;position:absolute!important;transform:translate3d(-9999px,-9999px,0)}.md-sticky-clone[sticky-state=active]{transform:translate3d(0,0,0)}.md-sticky-clone[sticky-state=active]:not(.md-sticky-no-effect) .md-subheader-inner{animation:subheaderStickyHoverIn .3s ease-out both}@keyframes subheaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@keyframes subheaderStickyHoverOut{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}.md-subheader-wrapper:not(.md-sticky-no-effect){transition:.2s ease-out margin}.md-subheader-wrapper:not(.md-sticky-no-effect) .md-subheader{margin:0}.md-subheader-wrapper:not(.md-sticky-no-effect).md-sticky-clone{z-index:2}.md-subheader-wrapper:not(.md-sticky-no-effect)[sticky-state=active]{margin-top:-2px}.md-subheader-wrapper:not(.md-sticky-no-effect):not(.md-sticky-clone)[sticky-prev-state=active] .md-subheader-inner:after{animation:subheaderStickyHoverOut .3s ease-out both}.md-subheader{display:block;font-size:14px;font-weight:500;line-height:1em;margin:0;position:relative}.md-subheader .md-subheader-inner{display:block;padding:16px}.md-subheader .md-subheader-content{display:block;z-index:1;position:relative}.md-inline-form md-switch{margin-top:18px;margin-bottom:19px}md-switch{margin:16px 0;white-space:nowrap;cursor:pointer;outline:0;user-select:none;height:30px;line-height:28px;align-items:center;display:flex;margin-left:inherit;margin-right:16px}[dir=rtl] md-switch{margin-left:16px}[dir=rtl] md-switch{margin-right:inherit}md-switch:last-of-type{margin-left:inherit;margin-right:0}[dir=rtl] md-switch:last-of-type{margin-left:0}[dir=rtl] md-switch:last-of-type{margin-right:inherit}md-switch[disabled]{cursor:default}md-switch[disabled] .md-container{cursor:default}md-switch .md-container{cursor:grab;width:36px;height:24px;position:relative;user-select:none;margin-right:8px;float:left}[dir=rtl] md-switch .md-container{margin-right:auto;margin-left:8px}md-switch:not([disabled]) .md-dragging,md-switch:not([disabled]).md-dragging .md-container{cursor:grabbing}md-switch.md-focused:not([disabled]) .md-thumb:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-switch.md-focused:not([disabled]):not(.md-checked) .md-thumb:before{background-color:rgba(0,0,0,.12)}md-switch .md-label{border-color:transparent;border-width:0;float:left}md-switch .md-bar{left:1px;width:34px;top:5px;height:14px;border-radius:8px;position:absolute}md-switch .md-thumb-container{top:2px;left:0;width:16px;position:absolute;transform:translate3d(0,0,0);z-index:1}md-switch.md-checked .md-thumb-container{transform:translate3d(100%,0,0)}md-switch .md-thumb{position:absolute;margin:0;left:0;top:0;outline:0;height:20px;width:20px;border-radius:50%;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}md-switch .md-thumb:before{background-color:transparent;border-radius:50%;content:'';position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-switch .md-thumb .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-20px;top:-20px;right:-20px;bottom:-20px}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb,md-switch:not(.md-dragging) .md-thumb-container{transition:all 80ms linear;transition-property:transform,background-color}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb{transition-delay:50ms}@media screen and (-ms-high-contrast:active){md-switch.md-default-theme .md-bar{background-color:#666}md-switch.md-default-theme.md-checked .md-bar{background-color:#9e9e9e}md-switch.md-default-theme .md-thumb{background-color:#fff}}@keyframes md-tab-content-hide{0%{opacity:1}50%{opacity:1}100%{opacity:0}}md-tab-data{position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;opacity:0}md-tabs{display:block;margin:0;border-radius:2px;overflow:hidden;position:relative;flex-shrink:0}md-tabs:not(.md-no-tab-content):not(.md-dynamic-height){min-height:248px}md-tabs[md-align-tabs=bottom]{padding-bottom:48px}md-tabs[md-align-tabs=bottom] md-tabs-wrapper{position:absolute;bottom:0;left:0;right:0;height:48px;z-index:2}md-tabs[md-align-tabs=bottom] md-tabs-content-wrapper{top:0;bottom:48px}md-tabs.md-dynamic-height md-tabs-content-wrapper{min-height:0;position:relative;top:auto;left:auto;right:auto;bottom:auto;overflow:visible}md-tabs.md-dynamic-height md-tab-content.md-active{position:relative}md-tabs[md-border-bottom] md-tabs-wrapper{border-width:0 0 1px;border-style:solid}md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper{top:49px}md-tabs-wrapper{display:block;position:relative;transform:translate3d(0,0,0)}md-tabs-wrapper md-next-button,md-tabs-wrapper md-prev-button{height:100%;width:32px;position:absolute;top:50%;transform:translateY(-50%);line-height:1em;z-index:2;cursor:pointer;font-size:16px;background:transparent no-repeat center center;transition:all .5s cubic-bezier(.35,0,.25,1)}md-tabs-wrapper md-next-button:focus,md-tabs-wrapper md-prev-button:focus{outline:0}md-tabs-wrapper md-next-button.md-disabled,md-tabs-wrapper md-prev-button.md-disabled{opacity:.25;cursor:default}md-tabs-wrapper md-next-button.ng-leave,md-tabs-wrapper md-prev-button.ng-leave{transition:none}md-tabs-wrapper md-next-button md-icon,md-tabs-wrapper md-prev-button md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%,-50%,0)}md-tabs-wrapper md-prev-button{left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg==)}[dir=rtl] md-tabs-wrapper md-prev-button{left:auto;right:0}md-tabs-wrapper md-next-button{right:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K)}[dir=rtl] md-tabs-wrapper md-next-button{right:auto;left:0}md-tabs-wrapper md-next-button md-icon{transform:translate3d(-50%,-50%,0) rotate(180deg)}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper{width:100%;display:flex;flex-direction:row}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item{flex-grow:1}md-tabs-canvas{position:relative;overflow:hidden;display:block;height:48px}md-tabs-canvas:after{content:'';display:table;clear:both}md-tabs-canvas .md-dummy-wrapper{position:absolute;top:0;left:0}[dir=rtl] md-tabs-canvas .md-dummy-wrapper{left:auto;right:0}md-tabs-canvas.md-paginated{margin:0 32px}md-tabs-canvas.md-center-tabs{display:flex;flex-direction:column;text-align:center}md-tabs-canvas.md-center-tabs .md-tab{float:none;display:inline-block}md-pagination-wrapper{height:48px;display:block;transition:transform .5s cubic-bezier(.35,0,.25,1);position:absolute;width:999999px;left:0;transform:translate3d(0,0,0)}md-pagination-wrapper:after{content:'';display:table;clear:both}[dir=rtl] md-pagination-wrapper{left:auto;right:0}md-pagination-wrapper.md-center-tabs{position:relative;width:auto;margin:0 auto}md-tabs-content-wrapper{display:block;position:absolute;top:48px;left:0;right:0;bottom:0;overflow:hidden}md-tab-content{display:block;position:absolute;top:0;left:0;right:0;bottom:0;transition:transform .5s cubic-bezier(.35,0,.25,1);overflow:auto;transform:translate3d(0,0,0)}md-tab-content.md-no-scroll{bottom:auto;overflow:hidden}md-tab-content.md-no-transition,md-tab-content.ng-leave{transition:none}md-tab-content.md-left:not(.md-active){transform:translateX(-100%);animation:1s md-tab-content-hide;opacity:0}[dir=rtl] md-tab-content.md-left:not(.md-active){transform:translateX(100%)}md-tab-content.md-left:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content.md-right:not(.md-active){transform:translateX(100%);animation:1s md-tab-content-hide;opacity:0}[dir=rtl] md-tab-content.md-right:not(.md-active){transform:translateX(-100%)}md-tab-content.md-right:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content>div.ng-leave{animation:1s md-tab-content-hide}md-ink-bar{position:absolute;left:auto;right:auto;bottom:0;height:2px}md-ink-bar.md-left{transition:left 125ms cubic-bezier(.35,0,.25,1),right .25s cubic-bezier(.35,0,.25,1)}md-ink-bar.md-right{transition:left .25s cubic-bezier(.35,0,.25,1),right 125ms cubic-bezier(.35,0,.25,1)}md-tab{position:absolute;z-index:-1;left:-9999px}.md-tab{font-size:14px;text-align:center;line-height:24px;padding:12px 24px;transition:background-color .35s cubic-bezier(.35,0,.25,1);cursor:pointer;white-space:nowrap;position:relative;text-transform:uppercase;float:left;font-weight:500;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-tab{float:right}.md-tab.md-focused{box-shadow:none;outline:0}.md-tab.md-active{cursor:default}.md-tab.md-disabled{pointer-events:none;touch-action:pan-y;user-select:none;-webkit-user-drag:none;opacity:.5;cursor:default}.md-tab.ng-leave{transition:none}md-toolbar+md-tabs{border-top-left-radius:0;border-top-right-radius:0}.md-toast-text{padding:0 6px}md-toast{position:absolute;z-index:105;box-sizing:border-box;cursor:default;overflow:hidden;padding:8px;opacity:1;transition:all .4s cubic-bezier(.25,.8,.25,1)}md-toast .md-toast-content{display:flex;direction:row;align-items:center;max-height:168px;max-width:100%;min-height:48px;padding:0 18px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;font-size:14px;overflow:hidden;transform:translate3d(0,0,0) rotateZ(0);transition:all .4s cubic-bezier(.25,.8,.25,1);justify-content:flex-start}md-toast .md-toast-content::before{content:'';min-height:48px;visibility:hidden;display:inline-block}[dir=rtl] md-toast .md-toast-content{justify-content:flex-end}md-toast .md-toast-content span{flex:1 1 0%;box-sizing:border-box;min-width:0}md-toast.md-capsule{border-radius:24px}md-toast.md-capsule .md-toast-content{border-radius:24px}md-toast.ng-leave-active .md-toast-content{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-toast.md-swipedown .md-toast-content,md-toast.md-swipeleft .md-toast-content,md-toast.md-swiperight .md-toast-content,md-toast.md-swipeup .md-toast-content{transition:all .4s cubic-bezier(.25,.8,.25,1)}md-toast.ng-enter{opacity:0}md-toast.ng-enter .md-toast-content{transform:translate3d(0,100%,0)}md-toast.ng-enter.md-top .md-toast-content{transform:translate3d(0,-100%,0)}md-toast.ng-enter.ng-enter-active{opacity:1}md-toast.ng-enter.ng-enter-active .md-toast-content{transform:translate3d(0,0,0)}md-toast.ng-leave.ng-leave-active .md-toast-content{opacity:0;transform:translate3d(0,100%,0)}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0,-50%,0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0,50%,0)}md-toast.ng-leave.ng-leave-active.md-top .md-toast-content{transform:translate3d(0,-100%,0)}md-toast .md-action{line-height:19px;margin-left:24px;margin-right:0;cursor:pointer;text-transform:uppercase;float:right}md-toast .md-button{min-width:0;margin-right:0;margin-left:12px}[dir=rtl] md-toast .md-button{margin-right:12px}[dir=rtl] md-toast .md-button{margin-left:0}@media (max-width:959px){md-toast{left:0;right:0;width:100%;max-width:100%;min-width:0;border-radius:0;bottom:0;padding:0}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0,-50%,0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0,50%,0)}}@media (min-width:960px){md-toast{min-width:304px}md-toast.md-bottom{bottom:0}md-toast.md-left{left:0}md-toast.md-right{right:0}md-toast.md-top{top:0}md-toast._md-start{left:0}[dir=rtl] md-toast._md-start{left:auto;right:0}md-toast._md-end{right:0}[dir=rtl] md-toast._md-end{right:auto;left:0}md-toast.ng-leave.ng-leave-active.md-swipeleft .md-toast-content{transform:translate3d(-50%,0,0)}md-toast.ng-leave.ng-leave-active.md-swiperight .md-toast-content{transform:translate3d(50%,0,0)}}@media (min-width:1920px){md-toast .md-toast-content{max-width:568px}}@media screen and (-ms-high-contrast:active){md-toast{border:1px solid #fff}}.md-toast-animating{overflow:hidden!important}md-toolbar{box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:2;font-size:20px;min-height:64px;width:100%}md-toolbar._md-toolbar-transitions{transition-duration:.5s;transition-timing-function:cubic-bezier(.35,0,.25,1);transition-property:background-color,fill,color}md-toolbar.md-whiteframe-z1-add,md-toolbar.md-whiteframe-z1-remove{transition:box-shadow .5s linear}md-toolbar md-toolbar-filler{width:72px}md-toolbar *,md-toolbar :after,md-toolbar :before{box-sizing:border-box}md-toolbar.ng-animate{transition:none}md-toolbar.md-tall{height:128px;min-height:128px;max-height:128px}md-toolbar.md-medium-tall{height:88px;min-height:88px;max-height:88px}md-toolbar.md-medium-tall .md-toolbar-tools{height:48px;min-height:48px;max-height:48px}md-toolbar>.md-indent{margin-left:64px}[dir=rtl] md-toolbar>.md-indent{margin-left:auto;margin-right:64px}md-toolbar~md-content>md-list{padding:0}md-toolbar~md-content>md-list md-list-item:last-child md-divider{display:none}.md-toolbar-tools{font-size:20px;letter-spacing:.005em;box-sizing:border-box;font-weight:400;display:flex;align-items:center;flex-direction:row;width:100%;height:64px;max-height:64px;padding:0 16px;margin:0}.md-toolbar-tools h1,.md-toolbar-tools h2,.md-toolbar-tools h3{font-size:inherit;font-weight:inherit;margin:inherit}.md-toolbar-tools a{color:inherit;text-decoration:none}.md-toolbar-tools .fill-height{display:flex;align-items:center}.md-toolbar-tools .md-button{margin-top:0;margin-bottom:0}.md-toolbar-tools .md-button,.md-toolbar-tools .md-button.md-icon-button md-icon{transition-duration:.5s;transition-timing-function:cubic-bezier(.35,0,.25,1);transition-property:background-color,fill,color}.md-toolbar-tools .md-button.md-icon-button md-icon.ng-animate,.md-toolbar-tools .md-button.ng-animate{transition:none}.md-toolbar-tools>.md-button:first-child{margin-left:-8px}[dir=rtl] .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-8px}.md-toolbar-tools>.md-button:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>md-menu:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child>.md-button{margin-right:0}[dir=rtl] .md-toolbar-tools>md-menu:last-child>.md-button{margin-right:auto;margin-left:0}@media screen and (-ms-high-contrast:active){.md-toolbar-tools{border-bottom:1px solid #fff}}@media (min-width:0) and (max-width:959px) and (orientation:portrait){md-toolbar{min-height:56px}.md-toolbar-tools{height:56px;max-height:56px}}@media (min-width:0) and (max-width:959px) and (orientation:landscape){md-toolbar{min-height:48px}.md-toolbar-tools{height:48px;max-height:48px}}md-tooltip{position:absolute;z-index:100;overflow:hidden;pointer-events:none;border-radius:4px;font-weight:500;font-size:14px}@media (min-width:960px){md-tooltip{font-size:10px}}md-tooltip .md-content{position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transform-origin:center top;transform:scale(0);opacity:0;height:32px;line-height:32px;padding-left:16px;padding-right:16px}@media (min-width:960px){md-tooltip .md-content{height:22px;line-height:22px;padding-left:8px;padding-right:8px}}md-tooltip .md-content.md-show-add{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:.2s;transform:scale(0);opacity:0}md-tooltip .md-content.md-show,md-tooltip .md-content.md-show-add-active{transform:scale(1);opacity:.9;transform-origin:center top}md-tooltip .md-content.md-show-remove{transition:all .4s cubic-bezier(.25,.8,.25,1);transition-duration:.2s}md-tooltip .md-content.md-show-remove.md-show-remove-active{transform:scale(0);opacity:0}md-tooltip.md-hide{transition:all .3s cubic-bezier(.55,0,.55,.2)}md-tooltip.md-show{transition:all .4s cubic-bezier(.25,.8,.25,1);pointer-events:auto}.md-virtual-repeat-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;padding:0;position:relative}.md-virtual-repeat-container .md-virtual-repeat-scroller{bottom:0;box-sizing:border-box;left:0;margin:0;overflow-x:hidden;padding:0;position:absolute;right:0;top:0;-webkit-overflow-scrolling:touch}.md-virtual-repeat-container .md-virtual-repeat-sizer{box-sizing:border-box;height:1px;display:block;margin:0;padding:0;width:1px}.md-virtual-repeat-container .md-virtual-repeat-offsetter{box-sizing:border-box;left:0;margin:0;padding:0;position:absolute;right:0;top:0}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller{overflow-x:auto;overflow-y:hidden}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{bottom:16px;right:auto;white-space:nowrap}[dir=rtl] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{right:auto;left:auto}.md-whiteframe-1dp,.md-whiteframe-z1{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.md-whiteframe-2dp{box-shadow:0 1px 5px 0 rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12)}.md-whiteframe-3dp{box-shadow:0 1px 8px 0 rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.12)}.md-whiteframe-4dp,.md-whiteframe-z2{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.md-whiteframe-5dp{box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12)}.md-whiteframe-6dp{box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}.md-whiteframe-7dp,.md-whiteframe-z3{box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.md-whiteframe-8dp{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.md-whiteframe-9dp{box-shadow:0 5px 6px -3px rgba(0,0,0,.2),0 9px 12px 1px rgba(0,0,0,.14),0 3px 16px 2px rgba(0,0,0,.12)}.md-whiteframe-10dp,.md-whiteframe-z4{box-shadow:0 6px 6px -3px rgba(0,0,0,.2),0 10px 14px 1px rgba(0,0,0,.14),0 4px 18px 3px rgba(0,0,0,.12)}.md-whiteframe-11dp{box-shadow:0 6px 7px -4px rgba(0,0,0,.2),0 11px 15px 1px rgba(0,0,0,.14),0 4px 20px 3px rgba(0,0,0,.12)}.md-whiteframe-12dp{box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 12px 17px 2px rgba(0,0,0,.14),0 5px 22px 4px rgba(0,0,0,.12)}.md-whiteframe-13dp,.md-whiteframe-z5{box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 13px 19px 2px rgba(0,0,0,.14),0 5px 24px 4px rgba(0,0,0,.12)}.md-whiteframe-14dp{box-shadow:0 7px 9px -4px rgba(0,0,0,.2),0 14px 21px 2px rgba(0,0,0,.14),0 5px 26px 4px rgba(0,0,0,.12)}.md-whiteframe-15dp{box-shadow:0 8px 9px -5px rgba(0,0,0,.2),0 15px 22px 2px rgba(0,0,0,.14),0 6px 28px 5px rgba(0,0,0,.12)}.md-whiteframe-16dp{box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12)}.md-whiteframe-17dp{box-shadow:0 8px 11px -5px rgba(0,0,0,.2),0 17px 26px 2px rgba(0,0,0,.14),0 6px 32px 5px rgba(0,0,0,.12)}.md-whiteframe-18dp{box-shadow:0 9px 11px -5px rgba(0,0,0,.2),0 18px 28px 2px rgba(0,0,0,.14),0 7px 34px 6px rgba(0,0,0,.12)}.md-whiteframe-19dp{box-shadow:0 9px 12px -6px rgba(0,0,0,.2),0 19px 29px 2px rgba(0,0,0,.14),0 7px 36px 6px rgba(0,0,0,.12)}.md-whiteframe-20dp{box-shadow:0 10px 13px -6px rgba(0,0,0,.2),0 20px 31px 3px rgba(0,0,0,.14),0 8px 38px 7px rgba(0,0,0,.12)}.md-whiteframe-21dp{box-shadow:0 10px 13px -6px rgba(0,0,0,.2),0 21px 33px 3px rgba(0,0,0,.14),0 8px 40px 7px rgba(0,0,0,.12)}.md-whiteframe-22dp{box-shadow:0 10px 14px -6px rgba(0,0,0,.2),0 22px 35px 3px rgba(0,0,0,.14),0 8px 42px 7px rgba(0,0,0,.12)}.md-whiteframe-23dp{box-shadow:0 11px 14px -7px rgba(0,0,0,.2),0 23px 36px 3px rgba(0,0,0,.14),0 9px 44px 8px rgba(0,0,0,.12)}.md-whiteframe-24dp{box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12)}@media screen and (-ms-high-contrast:active){md-whiteframe{border:1px solid #fff}}@media print{[md-whiteframe],md-whiteframe{background-color:#fff}}.ng-cloak,.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}@-moz-document url-prefix(){.layout-fill{margin:0;width:100%;min-height:100%;height:100%}}.flex-order{order:0}.flex-order--20{order:-20}.flex-order--19{order:-19}.flex-order--18{order:-18}.flex-order--17{order:-17}.flex-order--16{order:-16}.flex-order--15{order:-15}.flex-order--14{order:-14}.flex-order--13{order:-13}.flex-order--12{order:-12}.flex-order--11{order:-11}.flex-order--10{order:-10}.flex-order--9{order:-9}.flex-order--8{order:-8}.flex-order--7{order:-7}.flex-order--6{order:-6}.flex-order--5{order:-5}.flex-order--4{order:-4}.flex-order--3{order:-3}.flex-order--2{order:-2}.flex-order--1{order:-1}.flex-order-0{order:0}.flex-order-1{order:1}.flex-order-2{order:2}.flex-order-3{order:3}.flex-order-4{order:4}.flex-order-5{order:5}.flex-order-6{order:6}.flex-order-7{order:7}.flex-order-8{order:8}.flex-order-9{order:9}.flex-order-10{order:10}.flex-order-11{order:11}.flex-order-12{order:12}.flex-order-13{order:13}.flex-order-14{order:14}.flex-order-15{order:15}.flex-order-16{order:16}.flex-order-17{order:17}.flex-order-18{order:18}.flex-order-19{order:19}.flex-order-20{order:20}.flex-offset-0,.offset-0{margin-left:0}[dir=rtl] .flex-offset-0,[dir=rtl] .offset-0{margin-left:auto;margin-right:0}.flex-offset-5,.offset-5{margin-left:5%}[dir=rtl] .flex-offset-5,[dir=rtl] .offset-5{margin-left:auto;margin-right:5%}.flex-offset-10,.offset-10{margin-left:10%}[dir=rtl] .flex-offset-10,[dir=rtl] .offset-10{margin-left:auto;margin-right:10%}.flex-offset-15,.offset-15{margin-left:15%}[dir=rtl] .flex-offset-15,[dir=rtl] .offset-15{margin-left:auto;margin-right:15%}.flex-offset-20,.offset-20{margin-left:20%}[dir=rtl] .flex-offset-20,[dir=rtl] .offset-20{margin-left:auto;margin-right:20%}.flex-offset-25,.offset-25{margin-left:25%}[dir=rtl] .flex-offset-25,[dir=rtl] .offset-25{margin-left:auto;margin-right:25%}.flex-offset-30,.offset-30{margin-left:30%}[dir=rtl] .flex-offset-30,[dir=rtl] .offset-30{margin-left:auto;margin-right:30%}.flex-offset-35,.offset-35{margin-left:35%}[dir=rtl] .flex-offset-35,[dir=rtl] .offset-35{margin-left:auto;margin-right:35%}.flex-offset-40,.offset-40{margin-left:40%}[dir=rtl] .flex-offset-40,[dir=rtl] .offset-40{margin-left:auto;margin-right:40%}.flex-offset-45,.offset-45{margin-left:45%}[dir=rtl] .flex-offset-45,[dir=rtl] .offset-45{margin-left:auto;margin-right:45%}.flex-offset-50,.offset-50{margin-left:50%}[dir=rtl] .flex-offset-50,[dir=rtl] .offset-50{margin-left:auto;margin-right:50%}.flex-offset-55,.offset-55{margin-left:55%}[dir=rtl] .flex-offset-55,[dir=rtl] .offset-55{margin-left:auto;margin-right:55%}.flex-offset-60,.offset-60{margin-left:60%}[dir=rtl] .flex-offset-60,[dir=rtl] .offset-60{margin-left:auto;margin-right:60%}.flex-offset-65,.offset-65{margin-left:65%}[dir=rtl] .flex-offset-65,[dir=rtl] .offset-65{margin-left:auto;margin-right:65%}.flex-offset-70,.offset-70{margin-left:70%}[dir=rtl] .flex-offset-70,[dir=rtl] .offset-70{margin-left:auto;margin-right:70%}.flex-offset-75,.offset-75{margin-left:75%}[dir=rtl] .flex-offset-75,[dir=rtl] .offset-75{margin-left:auto;margin-right:75%}.flex-offset-80,.offset-80{margin-left:80%}[dir=rtl] .flex-offset-80,[dir=rtl] .offset-80{margin-left:auto;margin-right:80%}.flex-offset-85,.offset-85{margin-left:85%}[dir=rtl] .flex-offset-85,[dir=rtl] .offset-85{margin-left:auto;margin-right:85%}.flex-offset-90,.offset-90{margin-left:90%}[dir=rtl] .flex-offset-90,[dir=rtl] .offset-90{margin-left:auto;margin-right:90%}.flex-offset-95,.offset-95{margin-left:95%}[dir=rtl] .flex-offset-95,[dir=rtl] .offset-95{margin-left:auto;margin-right:95%}.flex-offset-33,.offset-33{margin-left:calc(100% / 3)}.flex-offset-66,.offset-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-66,[dir=rtl] .offset-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align,.layout-align-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-start,.layout-align-start-center,.layout-align-start-end,.layout-align-start-start,.layout-align-start-stretch{justify-content:flex-start}.layout-align-center,.layout-align-center-center,.layout-align-center-end,.layout-align-center-start,.layout-align-center-stretch{justify-content:center}.layout-align-end,.layout-align-end-center,.layout-align-end-end,.layout-align-end-start,.layout-align-end-stretch{justify-content:flex-end}.layout-align-space-around,.layout-align-space-around-center,.layout-align-space-around-end,.layout-align-space-around-start,.layout-align-space-around-stretch{justify-content:space-around}.layout-align-space-between,.layout-align-space-between-center,.layout-align-space-between-end,.layout-align-space-between-start,.layout-align-space-between-stretch{justify-content:space-between}.layout-align-center-start,.layout-align-end-start,.layout-align-space-around-start,.layout-align-space-between-start,.layout-align-start-start{align-items:flex-start;align-content:flex-start}.layout-align-center-center,.layout-align-end-center,.layout-align-space-around-center,.layout-align-space-between-center,.layout-align-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-center-center>*,.layout-align-end-center>*,.layout-align-space-around-center>*,.layout-align-space-between-center>*,.layout-align-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-center-end,.layout-align-end-end,.layout-align-space-around-end,.layout-align-space-between-end,.layout-align-start-end{align-items:flex-end;align-content:flex-end}.layout-align-center-stretch,.layout-align-end-stretch,.layout-align-space-around-stretch,.layout-align-space-between-stretch,.layout-align-start-stretch{align-items:stretch;align-content:stretch}.flex{flex:1;box-sizing:border-box}.flex-grow{flex:1 1 100%;box-sizing:border-box}.flex-initial{flex:0 1 auto;box-sizing:border-box}.flex-auto{flex:1 1 auto;box-sizing:border-box}.flex-none{flex:0 0 auto;box-sizing:border-box}.flex-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex{min-width:0}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-column>.flex{min-height:0}.layout,.layout-column,.layout-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-column{flex-direction:column}.layout-row{flex-direction:row}.layout-padding-sm>*,.layout-padding>.flex-sm{padding:4px}.layout-padding,.layout-padding-gt-sm,.layout-padding-gt-sm>*,.layout-padding-md,.layout-padding-md>*,.layout-padding>*,.layout-padding>.flex,.layout-padding>.flex-gt-sm,.layout-padding>.flex-md{padding:8px}.layout-padding-gt-lg>*,.layout-padding-gt-md>*,.layout-padding-lg>*,.layout-padding>.flex-gt-lg,.layout-padding>.flex-gt-md,.layout-padding>.flex-lg{padding:16px}.layout-margin-sm>*,.layout-margin>.flex-sm{margin:4px}.layout-margin,.layout-margin-gt-sm,.layout-margin-gt-sm>*,.layout-margin-md,.layout-margin-md>*,.layout-margin>*,.layout-margin>.flex,.layout-margin>.flex-gt-sm,.layout-margin>.flex-md{margin:8px}.layout-margin-gt-lg>*,.layout-margin-gt-md>*,.layout-margin-lg>*,.layout-margin>.flex-gt-lg,.layout-margin>.flex-gt-md,.layout-margin>.flex-lg{margin:16px}.layout-wrap{flex-wrap:wrap}.layout-nowrap{flex-wrap:nowrap}.layout-fill{margin:0;width:100%;min-height:100%;height:100%}@media (max-width:599px){.hide-xs:not(.show-xs):not(.show),.hide:not(.show-xs):not(.show){display:none}.flex-order-xs--20{order:-20}.flex-order-xs--19{order:-19}.flex-order-xs--18{order:-18}.flex-order-xs--17{order:-17}.flex-order-xs--16{order:-16}.flex-order-xs--15{order:-15}.flex-order-xs--14{order:-14}.flex-order-xs--13{order:-13}.flex-order-xs--12{order:-12}.flex-order-xs--11{order:-11}.flex-order-xs--10{order:-10}.flex-order-xs--9{order:-9}.flex-order-xs--8{order:-8}.flex-order-xs--7{order:-7}.flex-order-xs--6{order:-6}.flex-order-xs--5{order:-5}.flex-order-xs--4{order:-4}.flex-order-xs--3{order:-3}.flex-order-xs--2{order:-2}.flex-order-xs--1{order:-1}.flex-order-xs-0{order:0}.flex-order-xs-1{order:1}.flex-order-xs-2{order:2}.flex-order-xs-3{order:3}.flex-order-xs-4{order:4}.flex-order-xs-5{order:5}.flex-order-xs-6{order:6}.flex-order-xs-7{order:7}.flex-order-xs-8{order:8}.flex-order-xs-9{order:9}.flex-order-xs-10{order:10}.flex-order-xs-11{order:11}.flex-order-xs-12{order:12}.flex-order-xs-13{order:13}.flex-order-xs-14{order:14}.flex-order-xs-15{order:15}.flex-order-xs-16{order:16}.flex-order-xs-17{order:17}.flex-order-xs-18{order:18}.flex-order-xs-19{order:19}.flex-order-xs-20{order:20}.flex-offset-xs-0,.offset-xs-0{margin-left:0}[dir=rtl] .flex-offset-xs-0,[dir=rtl] .offset-xs-0{margin-left:auto;margin-right:0}.flex-offset-xs-5,.offset-xs-5{margin-left:5%}[dir=rtl] .flex-offset-xs-5,[dir=rtl] .offset-xs-5{margin-left:auto;margin-right:5%}.flex-offset-xs-10,.offset-xs-10{margin-left:10%}[dir=rtl] .flex-offset-xs-10,[dir=rtl] .offset-xs-10{margin-left:auto;margin-right:10%}.flex-offset-xs-15,.offset-xs-15{margin-left:15%}[dir=rtl] .flex-offset-xs-15,[dir=rtl] .offset-xs-15{margin-left:auto;margin-right:15%}.flex-offset-xs-20,.offset-xs-20{margin-left:20%}[dir=rtl] .flex-offset-xs-20,[dir=rtl] .offset-xs-20{margin-left:auto;margin-right:20%}.flex-offset-xs-25,.offset-xs-25{margin-left:25%}[dir=rtl] .flex-offset-xs-25,[dir=rtl] .offset-xs-25{margin-left:auto;margin-right:25%}.flex-offset-xs-30,.offset-xs-30{margin-left:30%}[dir=rtl] .flex-offset-xs-30,[dir=rtl] .offset-xs-30{margin-left:auto;margin-right:30%}.flex-offset-xs-35,.offset-xs-35{margin-left:35%}[dir=rtl] .flex-offset-xs-35,[dir=rtl] .offset-xs-35{margin-left:auto;margin-right:35%}.flex-offset-xs-40,.offset-xs-40{margin-left:40%}[dir=rtl] .flex-offset-xs-40,[dir=rtl] .offset-xs-40{margin-left:auto;margin-right:40%}.flex-offset-xs-45,.offset-xs-45{margin-left:45%}[dir=rtl] .flex-offset-xs-45,[dir=rtl] .offset-xs-45{margin-left:auto;margin-right:45%}.flex-offset-xs-50,.offset-xs-50{margin-left:50%}[dir=rtl] .flex-offset-xs-50,[dir=rtl] .offset-xs-50{margin-left:auto;margin-right:50%}.flex-offset-xs-55,.offset-xs-55{margin-left:55%}[dir=rtl] .flex-offset-xs-55,[dir=rtl] .offset-xs-55{margin-left:auto;margin-right:55%}.flex-offset-xs-60,.offset-xs-60{margin-left:60%}[dir=rtl] .flex-offset-xs-60,[dir=rtl] .offset-xs-60{margin-left:auto;margin-right:60%}.flex-offset-xs-65,.offset-xs-65{margin-left:65%}[dir=rtl] .flex-offset-xs-65,[dir=rtl] .offset-xs-65{margin-left:auto;margin-right:65%}.flex-offset-xs-70,.offset-xs-70{margin-left:70%}[dir=rtl] .flex-offset-xs-70,[dir=rtl] .offset-xs-70{margin-left:auto;margin-right:70%}.flex-offset-xs-75,.offset-xs-75{margin-left:75%}[dir=rtl] .flex-offset-xs-75,[dir=rtl] .offset-xs-75{margin-left:auto;margin-right:75%}.flex-offset-xs-80,.offset-xs-80{margin-left:80%}[dir=rtl] .flex-offset-xs-80,[dir=rtl] .offset-xs-80{margin-left:auto;margin-right:80%}.flex-offset-xs-85,.offset-xs-85{margin-left:85%}[dir=rtl] .flex-offset-xs-85,[dir=rtl] .offset-xs-85{margin-left:auto;margin-right:85%}.flex-offset-xs-90,.offset-xs-90{margin-left:90%}[dir=rtl] .flex-offset-xs-90,[dir=rtl] .offset-xs-90{margin-left:auto;margin-right:90%}.flex-offset-xs-95,.offset-xs-95{margin-left:95%}[dir=rtl] .flex-offset-xs-95,[dir=rtl] .offset-xs-95{margin-left:auto;margin-right:95%}.flex-offset-xs-33,.offset-xs-33{margin-left:calc(100% / 3)}.flex-offset-xs-66,.offset-xs-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-xs-66,[dir=rtl] .offset-xs-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-xs,.layout-align-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xs-start,.layout-align-xs-start-center,.layout-align-xs-start-end,.layout-align-xs-start-start,.layout-align-xs-start-stretch{justify-content:flex-start}.layout-align-xs-center,.layout-align-xs-center-center,.layout-align-xs-center-end,.layout-align-xs-center-start,.layout-align-xs-center-stretch{justify-content:center}.layout-align-xs-end,.layout-align-xs-end-center,.layout-align-xs-end-end,.layout-align-xs-end-start,.layout-align-xs-end-stretch{justify-content:flex-end}.layout-align-xs-space-around,.layout-align-xs-space-around-center,.layout-align-xs-space-around-end,.layout-align-xs-space-around-start,.layout-align-xs-space-around-stretch{justify-content:space-around}.layout-align-xs-space-between,.layout-align-xs-space-between-center,.layout-align-xs-space-between-end,.layout-align-xs-space-between-start,.layout-align-xs-space-between-stretch{justify-content:space-between}.layout-align-xs-center-start,.layout-align-xs-end-start,.layout-align-xs-space-around-start,.layout-align-xs-space-between-start,.layout-align-xs-start-start{align-items:flex-start;align-content:flex-start}.layout-align-xs-center-center,.layout-align-xs-end-center,.layout-align-xs-space-around-center,.layout-align-xs-space-between-center,.layout-align-xs-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-xs-center-center>*,.layout-align-xs-end-center>*,.layout-align-xs-space-around-center>*,.layout-align-xs-space-between-center>*,.layout-align-xs-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-xs-center-end,.layout-align-xs-end-end,.layout-align-xs-space-around-end,.layout-align-xs-space-between-end,.layout-align-xs-start-end{align-items:flex-end;align-content:flex-end}.layout-align-xs-center-stretch,.layout-align-xs-end-stretch,.layout-align-xs-space-around-stretch,.layout-align-xs-space-between-stretch,.layout-align-xs-start-stretch{align-items:stretch;align-content:stretch}.flex-xs{flex:1;box-sizing:border-box}.flex-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xs-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xs-column>.flex-xs-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex{min-width:0}.layout-xs-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xs-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-column>.flex{min-height:0}.layout-xs,.layout-xs-column,.layout-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xs-column{flex-direction:column}.layout-xs-row{flex-direction:row}}@media (min-width:600px){.flex-order-gt-xs--20{order:-20}.flex-order-gt-xs--19{order:-19}.flex-order-gt-xs--18{order:-18}.flex-order-gt-xs--17{order:-17}.flex-order-gt-xs--16{order:-16}.flex-order-gt-xs--15{order:-15}.flex-order-gt-xs--14{order:-14}.flex-order-gt-xs--13{order:-13}.flex-order-gt-xs--12{order:-12}.flex-order-gt-xs--11{order:-11}.flex-order-gt-xs--10{order:-10}.flex-order-gt-xs--9{order:-9}.flex-order-gt-xs--8{order:-8}.flex-order-gt-xs--7{order:-7}.flex-order-gt-xs--6{order:-6}.flex-order-gt-xs--5{order:-5}.flex-order-gt-xs--4{order:-4}.flex-order-gt-xs--3{order:-3}.flex-order-gt-xs--2{order:-2}.flex-order-gt-xs--1{order:-1}.flex-order-gt-xs-0{order:0}.flex-order-gt-xs-1{order:1}.flex-order-gt-xs-2{order:2}.flex-order-gt-xs-3{order:3}.flex-order-gt-xs-4{order:4}.flex-order-gt-xs-5{order:5}.flex-order-gt-xs-6{order:6}.flex-order-gt-xs-7{order:7}.flex-order-gt-xs-8{order:8}.flex-order-gt-xs-9{order:9}.flex-order-gt-xs-10{order:10}.flex-order-gt-xs-11{order:11}.flex-order-gt-xs-12{order:12}.flex-order-gt-xs-13{order:13}.flex-order-gt-xs-14{order:14}.flex-order-gt-xs-15{order:15}.flex-order-gt-xs-16{order:16}.flex-order-gt-xs-17{order:17}.flex-order-gt-xs-18{order:18}.flex-order-gt-xs-19{order:19}.flex-order-gt-xs-20{order:20}.flex-offset-gt-xs-0,.offset-gt-xs-0{margin-left:0}[dir=rtl] .flex-offset-gt-xs-0,[dir=rtl] .offset-gt-xs-0{margin-left:auto;margin-right:0}.flex-offset-gt-xs-5,.offset-gt-xs-5{margin-left:5%}[dir=rtl] .flex-offset-gt-xs-5,[dir=rtl] .offset-gt-xs-5{margin-left:auto;margin-right:5%}.flex-offset-gt-xs-10,.offset-gt-xs-10{margin-left:10%}[dir=rtl] .flex-offset-gt-xs-10,[dir=rtl] .offset-gt-xs-10{margin-left:auto;margin-right:10%}.flex-offset-gt-xs-15,.offset-gt-xs-15{margin-left:15%}[dir=rtl] .flex-offset-gt-xs-15,[dir=rtl] .offset-gt-xs-15{margin-left:auto;margin-right:15%}.flex-offset-gt-xs-20,.offset-gt-xs-20{margin-left:20%}[dir=rtl] .flex-offset-gt-xs-20,[dir=rtl] .offset-gt-xs-20{margin-left:auto;margin-right:20%}.flex-offset-gt-xs-25,.offset-gt-xs-25{margin-left:25%}[dir=rtl] .flex-offset-gt-xs-25,[dir=rtl] .offset-gt-xs-25{margin-left:auto;margin-right:25%}.flex-offset-gt-xs-30,.offset-gt-xs-30{margin-left:30%}[dir=rtl] .flex-offset-gt-xs-30,[dir=rtl] .offset-gt-xs-30{margin-left:auto;margin-right:30%}.flex-offset-gt-xs-35,.offset-gt-xs-35{margin-left:35%}[dir=rtl] .flex-offset-gt-xs-35,[dir=rtl] .offset-gt-xs-35{margin-left:auto;margin-right:35%}.flex-offset-gt-xs-40,.offset-gt-xs-40{margin-left:40%}[dir=rtl] .flex-offset-gt-xs-40,[dir=rtl] .offset-gt-xs-40{margin-left:auto;margin-right:40%}.flex-offset-gt-xs-45,.offset-gt-xs-45{margin-left:45%}[dir=rtl] .flex-offset-gt-xs-45,[dir=rtl] .offset-gt-xs-45{margin-left:auto;margin-right:45%}.flex-offset-gt-xs-50,.offset-gt-xs-50{margin-left:50%}[dir=rtl] .flex-offset-gt-xs-50,[dir=rtl] .offset-gt-xs-50{margin-left:auto;margin-right:50%}.flex-offset-gt-xs-55,.offset-gt-xs-55{margin-left:55%}[dir=rtl] .flex-offset-gt-xs-55,[dir=rtl] .offset-gt-xs-55{margin-left:auto;margin-right:55%}.flex-offset-gt-xs-60,.offset-gt-xs-60{margin-left:60%}[dir=rtl] .flex-offset-gt-xs-60,[dir=rtl] .offset-gt-xs-60{margin-left:auto;margin-right:60%}.flex-offset-gt-xs-65,.offset-gt-xs-65{margin-left:65%}[dir=rtl] .flex-offset-gt-xs-65,[dir=rtl] .offset-gt-xs-65{margin-left:auto;margin-right:65%}.flex-offset-gt-xs-70,.offset-gt-xs-70{margin-left:70%}[dir=rtl] .flex-offset-gt-xs-70,[dir=rtl] .offset-gt-xs-70{margin-left:auto;margin-right:70%}.flex-offset-gt-xs-75,.offset-gt-xs-75{margin-left:75%}[dir=rtl] .flex-offset-gt-xs-75,[dir=rtl] .offset-gt-xs-75{margin-left:auto;margin-right:75%}.flex-offset-gt-xs-80,.offset-gt-xs-80{margin-left:80%}[dir=rtl] .flex-offset-gt-xs-80,[dir=rtl] .offset-gt-xs-80{margin-left:auto;margin-right:80%}.flex-offset-gt-xs-85,.offset-gt-xs-85{margin-left:85%}[dir=rtl] .flex-offset-gt-xs-85,[dir=rtl] .offset-gt-xs-85{margin-left:auto;margin-right:85%}.flex-offset-gt-xs-90,.offset-gt-xs-90{margin-left:90%}[dir=rtl] .flex-offset-gt-xs-90,[dir=rtl] .offset-gt-xs-90{margin-left:auto;margin-right:90%}.flex-offset-gt-xs-95,.offset-gt-xs-95{margin-left:95%}[dir=rtl] .flex-offset-gt-xs-95,[dir=rtl] .offset-gt-xs-95{margin-left:auto;margin-right:95%}.flex-offset-gt-xs-33,.offset-gt-xs-33{margin-left:calc(100% / 3)}.flex-offset-gt-xs-66,.offset-gt-xs-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-gt-xs-66,[dir=rtl] .offset-gt-xs-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-gt-xs,.layout-align-gt-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-xs-start,.layout-align-gt-xs-start-center,.layout-align-gt-xs-start-end,.layout-align-gt-xs-start-start,.layout-align-gt-xs-start-stretch{justify-content:flex-start}.layout-align-gt-xs-center,.layout-align-gt-xs-center-center,.layout-align-gt-xs-center-end,.layout-align-gt-xs-center-start,.layout-align-gt-xs-center-stretch{justify-content:center}.layout-align-gt-xs-end,.layout-align-gt-xs-end-center,.layout-align-gt-xs-end-end,.layout-align-gt-xs-end-start,.layout-align-gt-xs-end-stretch{justify-content:flex-end}.layout-align-gt-xs-space-around,.layout-align-gt-xs-space-around-center,.layout-align-gt-xs-space-around-end,.layout-align-gt-xs-space-around-start,.layout-align-gt-xs-space-around-stretch{justify-content:space-around}.layout-align-gt-xs-space-between,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-between-stretch{justify-content:space-between}.layout-align-gt-xs-center-start,.layout-align-gt-xs-end-start,.layout-align-gt-xs-space-around-start,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-start-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-xs-center-center,.layout-align-gt-xs-end-center,.layout-align-gt-xs-space-around-center,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-xs-center-center>*,.layout-align-gt-xs-end-center>*,.layout-align-gt-xs-space-around-center>*,.layout-align-gt-xs-space-between-center>*,.layout-align-gt-xs-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-xs-center-end,.layout-align-gt-xs-end-end,.layout-align-gt-xs-space-around-end,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-start-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-xs-center-stretch,.layout-align-gt-xs-end-stretch,.layout-align-gt-xs-space-around-stretch,.layout-align-gt-xs-space-between-stretch,.layout-align-gt-xs-start-stretch{align-items:stretch;align-content:stretch}.flex-gt-xs{flex:1;box-sizing:border-box}.flex-gt-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-xs-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-xs-column>.flex-gt-xs-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex{min-width:0}.layout-gt-xs-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-column>.flex{min-height:0}.layout-gt-xs,.layout-gt-xs-column,.layout-gt-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-xs-column{flex-direction:column}.layout-gt-xs-row{flex-direction:row}}@media (min-width:600px) and (max-width:959px){.hide-gt-xs:not(.show-gt-xs):not(.show-sm):not(.show),.hide:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.hide-sm:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.flex-order-sm--20{order:-20}.flex-order-sm--19{order:-19}.flex-order-sm--18{order:-18}.flex-order-sm--17{order:-17}.flex-order-sm--16{order:-16}.flex-order-sm--15{order:-15}.flex-order-sm--14{order:-14}.flex-order-sm--13{order:-13}.flex-order-sm--12{order:-12}.flex-order-sm--11{order:-11}.flex-order-sm--10{order:-10}.flex-order-sm--9{order:-9}.flex-order-sm--8{order:-8}.flex-order-sm--7{order:-7}.flex-order-sm--6{order:-6}.flex-order-sm--5{order:-5}.flex-order-sm--4{order:-4}.flex-order-sm--3{order:-3}.flex-order-sm--2{order:-2}.flex-order-sm--1{order:-1}.flex-order-sm-0{order:0}.flex-order-sm-1{order:1}.flex-order-sm-2{order:2}.flex-order-sm-3{order:3}.flex-order-sm-4{order:4}.flex-order-sm-5{order:5}.flex-order-sm-6{order:6}.flex-order-sm-7{order:7}.flex-order-sm-8{order:8}.flex-order-sm-9{order:9}.flex-order-sm-10{order:10}.flex-order-sm-11{order:11}.flex-order-sm-12{order:12}.flex-order-sm-13{order:13}.flex-order-sm-14{order:14}.flex-order-sm-15{order:15}.flex-order-sm-16{order:16}.flex-order-sm-17{order:17}.flex-order-sm-18{order:18}.flex-order-sm-19{order:19}.flex-order-sm-20{order:20}.flex-offset-sm-0,.offset-sm-0{margin-left:0}[dir=rtl] .flex-offset-sm-0,[dir=rtl] .offset-sm-0{margin-left:auto;margin-right:0}.flex-offset-sm-5,.offset-sm-5{margin-left:5%}[dir=rtl] .flex-offset-sm-5,[dir=rtl] .offset-sm-5{margin-left:auto;margin-right:5%}.flex-offset-sm-10,.offset-sm-10{margin-left:10%}[dir=rtl] .flex-offset-sm-10,[dir=rtl] .offset-sm-10{margin-left:auto;margin-right:10%}.flex-offset-sm-15,.offset-sm-15{margin-left:15%}[dir=rtl] .flex-offset-sm-15,[dir=rtl] .offset-sm-15{margin-left:auto;margin-right:15%}.flex-offset-sm-20,.offset-sm-20{margin-left:20%}[dir=rtl] .flex-offset-sm-20,[dir=rtl] .offset-sm-20{margin-left:auto;margin-right:20%}.flex-offset-sm-25,.offset-sm-25{margin-left:25%}[dir=rtl] .flex-offset-sm-25,[dir=rtl] .offset-sm-25{margin-left:auto;margin-right:25%}.flex-offset-sm-30,.offset-sm-30{margin-left:30%}[dir=rtl] .flex-offset-sm-30,[dir=rtl] .offset-sm-30{margin-left:auto;margin-right:30%}.flex-offset-sm-35,.offset-sm-35{margin-left:35%}[dir=rtl] .flex-offset-sm-35,[dir=rtl] .offset-sm-35{margin-left:auto;margin-right:35%}.flex-offset-sm-40,.offset-sm-40{margin-left:40%}[dir=rtl] .flex-offset-sm-40,[dir=rtl] .offset-sm-40{margin-left:auto;margin-right:40%}.flex-offset-sm-45,.offset-sm-45{margin-left:45%}[dir=rtl] .flex-offset-sm-45,[dir=rtl] .offset-sm-45{margin-left:auto;margin-right:45%}.flex-offset-sm-50,.offset-sm-50{margin-left:50%}[dir=rtl] .flex-offset-sm-50,[dir=rtl] .offset-sm-50{margin-left:auto;margin-right:50%}.flex-offset-sm-55,.offset-sm-55{margin-left:55%}[dir=rtl] .flex-offset-sm-55,[dir=rtl] .offset-sm-55{margin-left:auto;margin-right:55%}.flex-offset-sm-60,.offset-sm-60{margin-left:60%}[dir=rtl] .flex-offset-sm-60,[dir=rtl] .offset-sm-60{margin-left:auto;margin-right:60%}.flex-offset-sm-65,.offset-sm-65{margin-left:65%}[dir=rtl] .flex-offset-sm-65,[dir=rtl] .offset-sm-65{margin-left:auto;margin-right:65%}.flex-offset-sm-70,.offset-sm-70{margin-left:70%}[dir=rtl] .flex-offset-sm-70,[dir=rtl] .offset-sm-70{margin-left:auto;margin-right:70%}.flex-offset-sm-75,.offset-sm-75{margin-left:75%}[dir=rtl] .flex-offset-sm-75,[dir=rtl] .offset-sm-75{margin-left:auto;margin-right:75%}.flex-offset-sm-80,.offset-sm-80{margin-left:80%}[dir=rtl] .flex-offset-sm-80,[dir=rtl] .offset-sm-80{margin-left:auto;margin-right:80%}.flex-offset-sm-85,.offset-sm-85{margin-left:85%}[dir=rtl] .flex-offset-sm-85,[dir=rtl] .offset-sm-85{margin-left:auto;margin-right:85%}.flex-offset-sm-90,.offset-sm-90{margin-left:90%}[dir=rtl] .flex-offset-sm-90,[dir=rtl] .offset-sm-90{margin-left:auto;margin-right:90%}.flex-offset-sm-95,.offset-sm-95{margin-left:95%}[dir=rtl] .flex-offset-sm-95,[dir=rtl] .offset-sm-95{margin-left:auto;margin-right:95%}.flex-offset-sm-33,.offset-sm-33{margin-left:calc(100% / 3)}.flex-offset-sm-66,.offset-sm-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-sm-66,[dir=rtl] .offset-sm-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-sm,.layout-align-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-sm-start,.layout-align-sm-start-center,.layout-align-sm-start-end,.layout-align-sm-start-start,.layout-align-sm-start-stretch{justify-content:flex-start}.layout-align-sm-center,.layout-align-sm-center-center,.layout-align-sm-center-end,.layout-align-sm-center-start,.layout-align-sm-center-stretch{justify-content:center}.layout-align-sm-end,.layout-align-sm-end-center,.layout-align-sm-end-end,.layout-align-sm-end-start,.layout-align-sm-end-stretch{justify-content:flex-end}.layout-align-sm-space-around,.layout-align-sm-space-around-center,.layout-align-sm-space-around-end,.layout-align-sm-space-around-start,.layout-align-sm-space-around-stretch{justify-content:space-around}.layout-align-sm-space-between,.layout-align-sm-space-between-center,.layout-align-sm-space-between-end,.layout-align-sm-space-between-start,.layout-align-sm-space-between-stretch{justify-content:space-between}.layout-align-sm-center-start,.layout-align-sm-end-start,.layout-align-sm-space-around-start,.layout-align-sm-space-between-start,.layout-align-sm-start-start{align-items:flex-start;align-content:flex-start}.layout-align-sm-center-center,.layout-align-sm-end-center,.layout-align-sm-space-around-center,.layout-align-sm-space-between-center,.layout-align-sm-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-sm-center-center>*,.layout-align-sm-end-center>*,.layout-align-sm-space-around-center>*,.layout-align-sm-space-between-center>*,.layout-align-sm-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-sm-center-end,.layout-align-sm-end-end,.layout-align-sm-space-around-end,.layout-align-sm-space-between-end,.layout-align-sm-start-end{align-items:flex-end;align-content:flex-end}.layout-align-sm-center-stretch,.layout-align-sm-end-stretch,.layout-align-sm-space-around-stretch,.layout-align-sm-space-between-stretch,.layout-align-sm-start-stretch{align-items:stretch;align-content:stretch}.flex-sm{flex:1;box-sizing:border-box}.flex-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-sm-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-sm-column>.flex-sm-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex{min-width:0}.layout-sm-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-sm-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-column>.flex{min-height:0}.layout-sm,.layout-sm-column,.layout-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-sm-column{flex-direction:column}.layout-sm-row{flex-direction:row}}@media (min-width:960px){.flex-order-gt-sm--20{order:-20}.flex-order-gt-sm--19{order:-19}.flex-order-gt-sm--18{order:-18}.flex-order-gt-sm--17{order:-17}.flex-order-gt-sm--16{order:-16}.flex-order-gt-sm--15{order:-15}.flex-order-gt-sm--14{order:-14}.flex-order-gt-sm--13{order:-13}.flex-order-gt-sm--12{order:-12}.flex-order-gt-sm--11{order:-11}.flex-order-gt-sm--10{order:-10}.flex-order-gt-sm--9{order:-9}.flex-order-gt-sm--8{order:-8}.flex-order-gt-sm--7{order:-7}.flex-order-gt-sm--6{order:-6}.flex-order-gt-sm--5{order:-5}.flex-order-gt-sm--4{order:-4}.flex-order-gt-sm--3{order:-3}.flex-order-gt-sm--2{order:-2}.flex-order-gt-sm--1{order:-1}.flex-order-gt-sm-0{order:0}.flex-order-gt-sm-1{order:1}.flex-order-gt-sm-2{order:2}.flex-order-gt-sm-3{order:3}.flex-order-gt-sm-4{order:4}.flex-order-gt-sm-5{order:5}.flex-order-gt-sm-6{order:6}.flex-order-gt-sm-7{order:7}.flex-order-gt-sm-8{order:8}.flex-order-gt-sm-9{order:9}.flex-order-gt-sm-10{order:10}.flex-order-gt-sm-11{order:11}.flex-order-gt-sm-12{order:12}.flex-order-gt-sm-13{order:13}.flex-order-gt-sm-14{order:14}.flex-order-gt-sm-15{order:15}.flex-order-gt-sm-16{order:16}.flex-order-gt-sm-17{order:17}.flex-order-gt-sm-18{order:18}.flex-order-gt-sm-19{order:19}.flex-order-gt-sm-20{order:20}.flex-offset-gt-sm-0,.offset-gt-sm-0{margin-left:0}[dir=rtl] .flex-offset-gt-sm-0,[dir=rtl] .offset-gt-sm-0{margin-left:auto;margin-right:0}.flex-offset-gt-sm-5,.offset-gt-sm-5{margin-left:5%}[dir=rtl] .flex-offset-gt-sm-5,[dir=rtl] .offset-gt-sm-5{margin-left:auto;margin-right:5%}.flex-offset-gt-sm-10,.offset-gt-sm-10{margin-left:10%}[dir=rtl] .flex-offset-gt-sm-10,[dir=rtl] .offset-gt-sm-10{margin-left:auto;margin-right:10%}.flex-offset-gt-sm-15,.offset-gt-sm-15{margin-left:15%}[dir=rtl] .flex-offset-gt-sm-15,[dir=rtl] .offset-gt-sm-15{margin-left:auto;margin-right:15%}.flex-offset-gt-sm-20,.offset-gt-sm-20{margin-left:20%}[dir=rtl] .flex-offset-gt-sm-20,[dir=rtl] .offset-gt-sm-20{margin-left:auto;margin-right:20%}.flex-offset-gt-sm-25,.offset-gt-sm-25{margin-left:25%}[dir=rtl] .flex-offset-gt-sm-25,[dir=rtl] .offset-gt-sm-25{margin-left:auto;margin-right:25%}.flex-offset-gt-sm-30,.offset-gt-sm-30{margin-left:30%}[dir=rtl] .flex-offset-gt-sm-30,[dir=rtl] .offset-gt-sm-30{margin-left:auto;margin-right:30%}.flex-offset-gt-sm-35,.offset-gt-sm-35{margin-left:35%}[dir=rtl] .flex-offset-gt-sm-35,[dir=rtl] .offset-gt-sm-35{margin-left:auto;margin-right:35%}.flex-offset-gt-sm-40,.offset-gt-sm-40{margin-left:40%}[dir=rtl] .flex-offset-gt-sm-40,[dir=rtl] .offset-gt-sm-40{margin-left:auto;margin-right:40%}.flex-offset-gt-sm-45,.offset-gt-sm-45{margin-left:45%}[dir=rtl] .flex-offset-gt-sm-45,[dir=rtl] .offset-gt-sm-45{margin-left:auto;margin-right:45%}.flex-offset-gt-sm-50,.offset-gt-sm-50{margin-left:50%}[dir=rtl] .flex-offset-gt-sm-50,[dir=rtl] .offset-gt-sm-50{margin-left:auto;margin-right:50%}.flex-offset-gt-sm-55,.offset-gt-sm-55{margin-left:55%}[dir=rtl] .flex-offset-gt-sm-55,[dir=rtl] .offset-gt-sm-55{margin-left:auto;margin-right:55%}.flex-offset-gt-sm-60,.offset-gt-sm-60{margin-left:60%}[dir=rtl] .flex-offset-gt-sm-60,[dir=rtl] .offset-gt-sm-60{margin-left:auto;margin-right:60%}.flex-offset-gt-sm-65,.offset-gt-sm-65{margin-left:65%}[dir=rtl] .flex-offset-gt-sm-65,[dir=rtl] .offset-gt-sm-65{margin-left:auto;margin-right:65%}.flex-offset-gt-sm-70,.offset-gt-sm-70{margin-left:70%}[dir=rtl] .flex-offset-gt-sm-70,[dir=rtl] .offset-gt-sm-70{margin-left:auto;margin-right:70%}.flex-offset-gt-sm-75,.offset-gt-sm-75{margin-left:75%}[dir=rtl] .flex-offset-gt-sm-75,[dir=rtl] .offset-gt-sm-75{margin-left:auto;margin-right:75%}.flex-offset-gt-sm-80,.offset-gt-sm-80{margin-left:80%}[dir=rtl] .flex-offset-gt-sm-80,[dir=rtl] .offset-gt-sm-80{margin-left:auto;margin-right:80%}.flex-offset-gt-sm-85,.offset-gt-sm-85{margin-left:85%}[dir=rtl] .flex-offset-gt-sm-85,[dir=rtl] .offset-gt-sm-85{margin-left:auto;margin-right:85%}.flex-offset-gt-sm-90,.offset-gt-sm-90{margin-left:90%}[dir=rtl] .flex-offset-gt-sm-90,[dir=rtl] .offset-gt-sm-90{margin-left:auto;margin-right:90%}.flex-offset-gt-sm-95,.offset-gt-sm-95{margin-left:95%}[dir=rtl] .flex-offset-gt-sm-95,[dir=rtl] .offset-gt-sm-95{margin-left:auto;margin-right:95%}.flex-offset-gt-sm-33,.offset-gt-sm-33{margin-left:calc(100% / 3)}.flex-offset-gt-sm-66,.offset-gt-sm-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-gt-sm-66,[dir=rtl] .offset-gt-sm-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-gt-sm,.layout-align-gt-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-sm-start,.layout-align-gt-sm-start-center,.layout-align-gt-sm-start-end,.layout-align-gt-sm-start-start,.layout-align-gt-sm-start-stretch{justify-content:flex-start}.layout-align-gt-sm-center,.layout-align-gt-sm-center-center,.layout-align-gt-sm-center-end,.layout-align-gt-sm-center-start,.layout-align-gt-sm-center-stretch{justify-content:center}.layout-align-gt-sm-end,.layout-align-gt-sm-end-center,.layout-align-gt-sm-end-end,.layout-align-gt-sm-end-start,.layout-align-gt-sm-end-stretch{justify-content:flex-end}.layout-align-gt-sm-space-around,.layout-align-gt-sm-space-around-center,.layout-align-gt-sm-space-around-end,.layout-align-gt-sm-space-around-start,.layout-align-gt-sm-space-around-stretch{justify-content:space-around}.layout-align-gt-sm-space-between,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-between-stretch{justify-content:space-between}.layout-align-gt-sm-center-start,.layout-align-gt-sm-end-start,.layout-align-gt-sm-space-around-start,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-start-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-sm-center-center,.layout-align-gt-sm-end-center,.layout-align-gt-sm-space-around-center,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-sm-center-center>*,.layout-align-gt-sm-end-center>*,.layout-align-gt-sm-space-around-center>*,.layout-align-gt-sm-space-between-center>*,.layout-align-gt-sm-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-sm-center-end,.layout-align-gt-sm-end-end,.layout-align-gt-sm-space-around-end,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-start-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-sm-center-stretch,.layout-align-gt-sm-end-stretch,.layout-align-gt-sm-space-around-stretch,.layout-align-gt-sm-space-between-stretch,.layout-align-gt-sm-start-stretch{align-items:stretch;align-content:stretch}.flex-gt-sm{flex:1;box-sizing:border-box}.flex-gt-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-sm-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-sm-column>.flex-gt-sm-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex{min-width:0}.layout-gt-sm-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-column>.flex{min-height:0}.layout-gt-sm,.layout-gt-sm-column,.layout-gt-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-sm-column{flex-direction:column}.layout-gt-sm-row{flex-direction:row}}@media (min-width:960px) and (max-width:1279px){.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show){display:none}.hide-md:not(.show-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-md--20{order:-20}.flex-order-md--19{order:-19}.flex-order-md--18{order:-18}.flex-order-md--17{order:-17}.flex-order-md--16{order:-16}.flex-order-md--15{order:-15}.flex-order-md--14{order:-14}.flex-order-md--13{order:-13}.flex-order-md--12{order:-12}.flex-order-md--11{order:-11}.flex-order-md--10{order:-10}.flex-order-md--9{order:-9}.flex-order-md--8{order:-8}.flex-order-md--7{order:-7}.flex-order-md--6{order:-6}.flex-order-md--5{order:-5}.flex-order-md--4{order:-4}.flex-order-md--3{order:-3}.flex-order-md--2{order:-2}.flex-order-md--1{order:-1}.flex-order-md-0{order:0}.flex-order-md-1{order:1}.flex-order-md-2{order:2}.flex-order-md-3{order:3}.flex-order-md-4{order:4}.flex-order-md-5{order:5}.flex-order-md-6{order:6}.flex-order-md-7{order:7}.flex-order-md-8{order:8}.flex-order-md-9{order:9}.flex-order-md-10{order:10}.flex-order-md-11{order:11}.flex-order-md-12{order:12}.flex-order-md-13{order:13}.flex-order-md-14{order:14}.flex-order-md-15{order:15}.flex-order-md-16{order:16}.flex-order-md-17{order:17}.flex-order-md-18{order:18}.flex-order-md-19{order:19}.flex-order-md-20{order:20}.flex-offset-md-0,.offset-md-0{margin-left:0}[dir=rtl] .flex-offset-md-0,[dir=rtl] .offset-md-0{margin-left:auto;margin-right:0}.flex-offset-md-5,.offset-md-5{margin-left:5%}[dir=rtl] .flex-offset-md-5,[dir=rtl] .offset-md-5{margin-left:auto;margin-right:5%}.flex-offset-md-10,.offset-md-10{margin-left:10%}[dir=rtl] .flex-offset-md-10,[dir=rtl] .offset-md-10{margin-left:auto;margin-right:10%}.flex-offset-md-15,.offset-md-15{margin-left:15%}[dir=rtl] .flex-offset-md-15,[dir=rtl] .offset-md-15{margin-left:auto;margin-right:15%}.flex-offset-md-20,.offset-md-20{margin-left:20%}[dir=rtl] .flex-offset-md-20,[dir=rtl] .offset-md-20{margin-left:auto;margin-right:20%}.flex-offset-md-25,.offset-md-25{margin-left:25%}[dir=rtl] .flex-offset-md-25,[dir=rtl] .offset-md-25{margin-left:auto;margin-right:25%}.flex-offset-md-30,.offset-md-30{margin-left:30%}[dir=rtl] .flex-offset-md-30,[dir=rtl] .offset-md-30{margin-left:auto;margin-right:30%}.flex-offset-md-35,.offset-md-35{margin-left:35%}[dir=rtl] .flex-offset-md-35,[dir=rtl] .offset-md-35{margin-left:auto;margin-right:35%}.flex-offset-md-40,.offset-md-40{margin-left:40%}[dir=rtl] .flex-offset-md-40,[dir=rtl] .offset-md-40{margin-left:auto;margin-right:40%}.flex-offset-md-45,.offset-md-45{margin-left:45%}[dir=rtl] .flex-offset-md-45,[dir=rtl] .offset-md-45{margin-left:auto;margin-right:45%}.flex-offset-md-50,.offset-md-50{margin-left:50%}[dir=rtl] .flex-offset-md-50,[dir=rtl] .offset-md-50{margin-left:auto;margin-right:50%}.flex-offset-md-55,.offset-md-55{margin-left:55%}[dir=rtl] .flex-offset-md-55,[dir=rtl] .offset-md-55{margin-left:auto;margin-right:55%}.flex-offset-md-60,.offset-md-60{margin-left:60%}[dir=rtl] .flex-offset-md-60,[dir=rtl] .offset-md-60{margin-left:auto;margin-right:60%}.flex-offset-md-65,.offset-md-65{margin-left:65%}[dir=rtl] .flex-offset-md-65,[dir=rtl] .offset-md-65{margin-left:auto;margin-right:65%}.flex-offset-md-70,.offset-md-70{margin-left:70%}[dir=rtl] .flex-offset-md-70,[dir=rtl] .offset-md-70{margin-left:auto;margin-right:70%}.flex-offset-md-75,.offset-md-75{margin-left:75%}[dir=rtl] .flex-offset-md-75,[dir=rtl] .offset-md-75{margin-left:auto;margin-right:75%}.flex-offset-md-80,.offset-md-80{margin-left:80%}[dir=rtl] .flex-offset-md-80,[dir=rtl] .offset-md-80{margin-left:auto;margin-right:80%}.flex-offset-md-85,.offset-md-85{margin-left:85%}[dir=rtl] .flex-offset-md-85,[dir=rtl] .offset-md-85{margin-left:auto;margin-right:85%}.flex-offset-md-90,.offset-md-90{margin-left:90%}[dir=rtl] .flex-offset-md-90,[dir=rtl] .offset-md-90{margin-left:auto;margin-right:90%}.flex-offset-md-95,.offset-md-95{margin-left:95%}[dir=rtl] .flex-offset-md-95,[dir=rtl] .offset-md-95{margin-left:auto;margin-right:95%}.flex-offset-md-33,.offset-md-33{margin-left:calc(100% / 3)}.flex-offset-md-66,.offset-md-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-md-66,[dir=rtl] .offset-md-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-md,.layout-align-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-md-start,.layout-align-md-start-center,.layout-align-md-start-end,.layout-align-md-start-start,.layout-align-md-start-stretch{justify-content:flex-start}.layout-align-md-center,.layout-align-md-center-center,.layout-align-md-center-end,.layout-align-md-center-start,.layout-align-md-center-stretch{justify-content:center}.layout-align-md-end,.layout-align-md-end-center,.layout-align-md-end-end,.layout-align-md-end-start,.layout-align-md-end-stretch{justify-content:flex-end}.layout-align-md-space-around,.layout-align-md-space-around-center,.layout-align-md-space-around-end,.layout-align-md-space-around-start,.layout-align-md-space-around-stretch{justify-content:space-around}.layout-align-md-space-between,.layout-align-md-space-between-center,.layout-align-md-space-between-end,.layout-align-md-space-between-start,.layout-align-md-space-between-stretch{justify-content:space-between}.layout-align-md-center-start,.layout-align-md-end-start,.layout-align-md-space-around-start,.layout-align-md-space-between-start,.layout-align-md-start-start{align-items:flex-start;align-content:flex-start}.layout-align-md-center-center,.layout-align-md-end-center,.layout-align-md-space-around-center,.layout-align-md-space-between-center,.layout-align-md-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-md-center-center>*,.layout-align-md-end-center>*,.layout-align-md-space-around-center>*,.layout-align-md-space-between-center>*,.layout-align-md-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-md-center-end,.layout-align-md-end-end,.layout-align-md-space-around-end,.layout-align-md-space-between-end,.layout-align-md-start-end{align-items:flex-end;align-content:flex-end}.layout-align-md-center-stretch,.layout-align-md-end-stretch,.layout-align-md-space-around-stretch,.layout-align-md-space-between-stretch,.layout-align-md-start-stretch{align-items:stretch;align-content:stretch}.flex-md{flex:1;box-sizing:border-box}.flex-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-md-none{flex:0 0 auto;box-sizing:border-box}.flex-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-md-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-md-column>.flex-md-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex{min-width:0}.layout-md-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-md-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-column>.flex{min-height:0}.layout-md,.layout-md-column,.layout-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-md-column{flex-direction:column}.layout-md-row{flex-direction:row}}@media (min-width:1280px){.flex-order-gt-md--20{order:-20}.flex-order-gt-md--19{order:-19}.flex-order-gt-md--18{order:-18}.flex-order-gt-md--17{order:-17}.flex-order-gt-md--16{order:-16}.flex-order-gt-md--15{order:-15}.flex-order-gt-md--14{order:-14}.flex-order-gt-md--13{order:-13}.flex-order-gt-md--12{order:-12}.flex-order-gt-md--11{order:-11}.flex-order-gt-md--10{order:-10}.flex-order-gt-md--9{order:-9}.flex-order-gt-md--8{order:-8}.flex-order-gt-md--7{order:-7}.flex-order-gt-md--6{order:-6}.flex-order-gt-md--5{order:-5}.flex-order-gt-md--4{order:-4}.flex-order-gt-md--3{order:-3}.flex-order-gt-md--2{order:-2}.flex-order-gt-md--1{order:-1}.flex-order-gt-md-0{order:0}.flex-order-gt-md-1{order:1}.flex-order-gt-md-2{order:2}.flex-order-gt-md-3{order:3}.flex-order-gt-md-4{order:4}.flex-order-gt-md-5{order:5}.flex-order-gt-md-6{order:6}.flex-order-gt-md-7{order:7}.flex-order-gt-md-8{order:8}.flex-order-gt-md-9{order:9}.flex-order-gt-md-10{order:10}.flex-order-gt-md-11{order:11}.flex-order-gt-md-12{order:12}.flex-order-gt-md-13{order:13}.flex-order-gt-md-14{order:14}.flex-order-gt-md-15{order:15}.flex-order-gt-md-16{order:16}.flex-order-gt-md-17{order:17}.flex-order-gt-md-18{order:18}.flex-order-gt-md-19{order:19}.flex-order-gt-md-20{order:20}.flex-offset-gt-md-0,.offset-gt-md-0{margin-left:0}[dir=rtl] .flex-offset-gt-md-0,[dir=rtl] .offset-gt-md-0{margin-left:auto;margin-right:0}.flex-offset-gt-md-5,.offset-gt-md-5{margin-left:5%}[dir=rtl] .flex-offset-gt-md-5,[dir=rtl] .offset-gt-md-5{margin-left:auto;margin-right:5%}.flex-offset-gt-md-10,.offset-gt-md-10{margin-left:10%}[dir=rtl] .flex-offset-gt-md-10,[dir=rtl] .offset-gt-md-10{margin-left:auto;margin-right:10%}.flex-offset-gt-md-15,.offset-gt-md-15{margin-left:15%}[dir=rtl] .flex-offset-gt-md-15,[dir=rtl] .offset-gt-md-15{margin-left:auto;margin-right:15%}.flex-offset-gt-md-20,.offset-gt-md-20{margin-left:20%}[dir=rtl] .flex-offset-gt-md-20,[dir=rtl] .offset-gt-md-20{margin-left:auto;margin-right:20%}.flex-offset-gt-md-25,.offset-gt-md-25{margin-left:25%}[dir=rtl] .flex-offset-gt-md-25,[dir=rtl] .offset-gt-md-25{margin-left:auto;margin-right:25%}.flex-offset-gt-md-30,.offset-gt-md-30{margin-left:30%}[dir=rtl] .flex-offset-gt-md-30,[dir=rtl] .offset-gt-md-30{margin-left:auto;margin-right:30%}.flex-offset-gt-md-35,.offset-gt-md-35{margin-left:35%}[dir=rtl] .flex-offset-gt-md-35,[dir=rtl] .offset-gt-md-35{margin-left:auto;margin-right:35%}.flex-offset-gt-md-40,.offset-gt-md-40{margin-left:40%}[dir=rtl] .flex-offset-gt-md-40,[dir=rtl] .offset-gt-md-40{margin-left:auto;margin-right:40%}.flex-offset-gt-md-45,.offset-gt-md-45{margin-left:45%}[dir=rtl] .flex-offset-gt-md-45,[dir=rtl] .offset-gt-md-45{margin-left:auto;margin-right:45%}.flex-offset-gt-md-50,.offset-gt-md-50{margin-left:50%}[dir=rtl] .flex-offset-gt-md-50,[dir=rtl] .offset-gt-md-50{margin-left:auto;margin-right:50%}.flex-offset-gt-md-55,.offset-gt-md-55{margin-left:55%}[dir=rtl] .flex-offset-gt-md-55,[dir=rtl] .offset-gt-md-55{margin-left:auto;margin-right:55%}.flex-offset-gt-md-60,.offset-gt-md-60{margin-left:60%}[dir=rtl] .flex-offset-gt-md-60,[dir=rtl] .offset-gt-md-60{margin-left:auto;margin-right:60%}.flex-offset-gt-md-65,.offset-gt-md-65{margin-left:65%}[dir=rtl] .flex-offset-gt-md-65,[dir=rtl] .offset-gt-md-65{margin-left:auto;margin-right:65%}.flex-offset-gt-md-70,.offset-gt-md-70{margin-left:70%}[dir=rtl] .flex-offset-gt-md-70,[dir=rtl] .offset-gt-md-70{margin-left:auto;margin-right:70%}.flex-offset-gt-md-75,.offset-gt-md-75{margin-left:75%}[dir=rtl] .flex-offset-gt-md-75,[dir=rtl] .offset-gt-md-75{margin-left:auto;margin-right:75%}.flex-offset-gt-md-80,.offset-gt-md-80{margin-left:80%}[dir=rtl] .flex-offset-gt-md-80,[dir=rtl] .offset-gt-md-80{margin-left:auto;margin-right:80%}.flex-offset-gt-md-85,.offset-gt-md-85{margin-left:85%}[dir=rtl] .flex-offset-gt-md-85,[dir=rtl] .offset-gt-md-85{margin-left:auto;margin-right:85%}.flex-offset-gt-md-90,.offset-gt-md-90{margin-left:90%}[dir=rtl] .flex-offset-gt-md-90,[dir=rtl] .offset-gt-md-90{margin-left:auto;margin-right:90%}.flex-offset-gt-md-95,.offset-gt-md-95{margin-left:95%}[dir=rtl] .flex-offset-gt-md-95,[dir=rtl] .offset-gt-md-95{margin-left:auto;margin-right:95%}.flex-offset-gt-md-33,.offset-gt-md-33{margin-left:calc(100% / 3)}.flex-offset-gt-md-66,.offset-gt-md-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-gt-md-66,[dir=rtl] .offset-gt-md-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-gt-md,.layout-align-gt-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-md-start,.layout-align-gt-md-start-center,.layout-align-gt-md-start-end,.layout-align-gt-md-start-start,.layout-align-gt-md-start-stretch{justify-content:flex-start}.layout-align-gt-md-center,.layout-align-gt-md-center-center,.layout-align-gt-md-center-end,.layout-align-gt-md-center-start,.layout-align-gt-md-center-stretch{justify-content:center}.layout-align-gt-md-end,.layout-align-gt-md-end-center,.layout-align-gt-md-end-end,.layout-align-gt-md-end-start,.layout-align-gt-md-end-stretch{justify-content:flex-end}.layout-align-gt-md-space-around,.layout-align-gt-md-space-around-center,.layout-align-gt-md-space-around-end,.layout-align-gt-md-space-around-start,.layout-align-gt-md-space-around-stretch{justify-content:space-around}.layout-align-gt-md-space-between,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-between-stretch{justify-content:space-between}.layout-align-gt-md-center-start,.layout-align-gt-md-end-start,.layout-align-gt-md-space-around-start,.layout-align-gt-md-space-between-start,.layout-align-gt-md-start-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-md-center-center,.layout-align-gt-md-end-center,.layout-align-gt-md-space-around-center,.layout-align-gt-md-space-between-center,.layout-align-gt-md-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-md-center-center>*,.layout-align-gt-md-end-center>*,.layout-align-gt-md-space-around-center>*,.layout-align-gt-md-space-between-center>*,.layout-align-gt-md-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-md-center-end,.layout-align-gt-md-end-end,.layout-align-gt-md-space-around-end,.layout-align-gt-md-space-between-end,.layout-align-gt-md-start-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-md-center-stretch,.layout-align-gt-md-end-stretch,.layout-align-gt-md-space-around-stretch,.layout-align-gt-md-space-between-stretch,.layout-align-gt-md-start-stretch{align-items:stretch;align-content:stretch}.flex-gt-md{flex:1;box-sizing:border-box}.flex-gt-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-md-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-md-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-md-column>.flex-gt-md-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex{min-width:0}.layout-gt-md-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-column>.flex{min-height:0}.layout-gt-md,.layout-gt-md-column,.layout-gt-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-md-column{flex-direction:column}.layout-gt-md-row{flex-direction:row}}@media (min-width:1280px) and (max-width:1919px){.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show){display:none}.hide-lg:not(.show-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-lg--20{order:-20}.flex-order-lg--19{order:-19}.flex-order-lg--18{order:-18}.flex-order-lg--17{order:-17}.flex-order-lg--16{order:-16}.flex-order-lg--15{order:-15}.flex-order-lg--14{order:-14}.flex-order-lg--13{order:-13}.flex-order-lg--12{order:-12}.flex-order-lg--11{order:-11}.flex-order-lg--10{order:-10}.flex-order-lg--9{order:-9}.flex-order-lg--8{order:-8}.flex-order-lg--7{order:-7}.flex-order-lg--6{order:-6}.flex-order-lg--5{order:-5}.flex-order-lg--4{order:-4}.flex-order-lg--3{order:-3}.flex-order-lg--2{order:-2}.flex-order-lg--1{order:-1}.flex-order-lg-0{order:0}.flex-order-lg-1{order:1}.flex-order-lg-2{order:2}.flex-order-lg-3{order:3}.flex-order-lg-4{order:4}.flex-order-lg-5{order:5}.flex-order-lg-6{order:6}.flex-order-lg-7{order:7}.flex-order-lg-8{order:8}.flex-order-lg-9{order:9}.flex-order-lg-10{order:10}.flex-order-lg-11{order:11}.flex-order-lg-12{order:12}.flex-order-lg-13{order:13}.flex-order-lg-14{order:14}.flex-order-lg-15{order:15}.flex-order-lg-16{order:16}.flex-order-lg-17{order:17}.flex-order-lg-18{order:18}.flex-order-lg-19{order:19}.flex-order-lg-20{order:20}.flex-offset-lg-0,.offset-lg-0{margin-left:0}[dir=rtl] .flex-offset-lg-0,[dir=rtl] .offset-lg-0{margin-left:auto;margin-right:0}.flex-offset-lg-5,.offset-lg-5{margin-left:5%}[dir=rtl] .flex-offset-lg-5,[dir=rtl] .offset-lg-5{margin-left:auto;margin-right:5%}.flex-offset-lg-10,.offset-lg-10{margin-left:10%}[dir=rtl] .flex-offset-lg-10,[dir=rtl] .offset-lg-10{margin-left:auto;margin-right:10%}.flex-offset-lg-15,.offset-lg-15{margin-left:15%}[dir=rtl] .flex-offset-lg-15,[dir=rtl] .offset-lg-15{margin-left:auto;margin-right:15%}.flex-offset-lg-20,.offset-lg-20{margin-left:20%}[dir=rtl] .flex-offset-lg-20,[dir=rtl] .offset-lg-20{margin-left:auto;margin-right:20%}.flex-offset-lg-25,.offset-lg-25{margin-left:25%}[dir=rtl] .flex-offset-lg-25,[dir=rtl] .offset-lg-25{margin-left:auto;margin-right:25%}.flex-offset-lg-30,.offset-lg-30{margin-left:30%}[dir=rtl] .flex-offset-lg-30,[dir=rtl] .offset-lg-30{margin-left:auto;margin-right:30%}.flex-offset-lg-35,.offset-lg-35{margin-left:35%}[dir=rtl] .flex-offset-lg-35,[dir=rtl] .offset-lg-35{margin-left:auto;margin-right:35%}.flex-offset-lg-40,.offset-lg-40{margin-left:40%}[dir=rtl] .flex-offset-lg-40,[dir=rtl] .offset-lg-40{margin-left:auto;margin-right:40%}.flex-offset-lg-45,.offset-lg-45{margin-left:45%}[dir=rtl] .flex-offset-lg-45,[dir=rtl] .offset-lg-45{margin-left:auto;margin-right:45%}.flex-offset-lg-50,.offset-lg-50{margin-left:50%}[dir=rtl] .flex-offset-lg-50,[dir=rtl] .offset-lg-50{margin-left:auto;margin-right:50%}.flex-offset-lg-55,.offset-lg-55{margin-left:55%}[dir=rtl] .flex-offset-lg-55,[dir=rtl] .offset-lg-55{margin-left:auto;margin-right:55%}.flex-offset-lg-60,.offset-lg-60{margin-left:60%}[dir=rtl] .flex-offset-lg-60,[dir=rtl] .offset-lg-60{margin-left:auto;margin-right:60%}.flex-offset-lg-65,.offset-lg-65{margin-left:65%}[dir=rtl] .flex-offset-lg-65,[dir=rtl] .offset-lg-65{margin-left:auto;margin-right:65%}.flex-offset-lg-70,.offset-lg-70{margin-left:70%}[dir=rtl] .flex-offset-lg-70,[dir=rtl] .offset-lg-70{margin-left:auto;margin-right:70%}.flex-offset-lg-75,.offset-lg-75{margin-left:75%}[dir=rtl] .flex-offset-lg-75,[dir=rtl] .offset-lg-75{margin-left:auto;margin-right:75%}.flex-offset-lg-80,.offset-lg-80{margin-left:80%}[dir=rtl] .flex-offset-lg-80,[dir=rtl] .offset-lg-80{margin-left:auto;margin-right:80%}.flex-offset-lg-85,.offset-lg-85{margin-left:85%}[dir=rtl] .flex-offset-lg-85,[dir=rtl] .offset-lg-85{margin-left:auto;margin-right:85%}.flex-offset-lg-90,.offset-lg-90{margin-left:90%}[dir=rtl] .flex-offset-lg-90,[dir=rtl] .offset-lg-90{margin-left:auto;margin-right:90%}.flex-offset-lg-95,.offset-lg-95{margin-left:95%}[dir=rtl] .flex-offset-lg-95,[dir=rtl] .offset-lg-95{margin-left:auto;margin-right:95%}.flex-offset-lg-33,.offset-lg-33{margin-left:calc(100% / 3)}.flex-offset-lg-66,.offset-lg-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-lg-66,[dir=rtl] .offset-lg-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-lg,.layout-align-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-lg-start,.layout-align-lg-start-center,.layout-align-lg-start-end,.layout-align-lg-start-start,.layout-align-lg-start-stretch{justify-content:flex-start}.layout-align-lg-center,.layout-align-lg-center-center,.layout-align-lg-center-end,.layout-align-lg-center-start,.layout-align-lg-center-stretch{justify-content:center}.layout-align-lg-end,.layout-align-lg-end-center,.layout-align-lg-end-end,.layout-align-lg-end-start,.layout-align-lg-end-stretch{justify-content:flex-end}.layout-align-lg-space-around,.layout-align-lg-space-around-center,.layout-align-lg-space-around-end,.layout-align-lg-space-around-start,.layout-align-lg-space-around-stretch{justify-content:space-around}.layout-align-lg-space-between,.layout-align-lg-space-between-center,.layout-align-lg-space-between-end,.layout-align-lg-space-between-start,.layout-align-lg-space-between-stretch{justify-content:space-between}.layout-align-lg-center-start,.layout-align-lg-end-start,.layout-align-lg-space-around-start,.layout-align-lg-space-between-start,.layout-align-lg-start-start{align-items:flex-start;align-content:flex-start}.layout-align-lg-center-center,.layout-align-lg-end-center,.layout-align-lg-space-around-center,.layout-align-lg-space-between-center,.layout-align-lg-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-lg-center-center>*,.layout-align-lg-end-center>*,.layout-align-lg-space-around-center>*,.layout-align-lg-space-between-center>*,.layout-align-lg-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-lg-center-end,.layout-align-lg-end-end,.layout-align-lg-space-around-end,.layout-align-lg-space-between-end,.layout-align-lg-start-end{align-items:flex-end;align-content:flex-end}.layout-align-lg-center-stretch,.layout-align-lg-end-stretch,.layout-align-lg-space-around-stretch,.layout-align-lg-space-between-stretch,.layout-align-lg-start-stretch{align-items:stretch;align-content:stretch}.flex-lg{flex:1;box-sizing:border-box}.flex-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-lg-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-lg-column>.flex-lg-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex{min-width:0}.layout-lg-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-lg-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-column>.flex{min-height:0}.layout-lg,.layout-lg-column,.layout-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-lg-column{flex-direction:column}.layout-lg-row{flex-direction:row}}@media (min-width:1920px){.flex-order-gt-lg--20{order:-20}.flex-order-gt-lg--19{order:-19}.flex-order-gt-lg--18{order:-18}.flex-order-gt-lg--17{order:-17}.flex-order-gt-lg--16{order:-16}.flex-order-gt-lg--15{order:-15}.flex-order-gt-lg--14{order:-14}.flex-order-gt-lg--13{order:-13}.flex-order-gt-lg--12{order:-12}.flex-order-gt-lg--11{order:-11}.flex-order-gt-lg--10{order:-10}.flex-order-gt-lg--9{order:-9}.flex-order-gt-lg--8{order:-8}.flex-order-gt-lg--7{order:-7}.flex-order-gt-lg--6{order:-6}.flex-order-gt-lg--5{order:-5}.flex-order-gt-lg--4{order:-4}.flex-order-gt-lg--3{order:-3}.flex-order-gt-lg--2{order:-2}.flex-order-gt-lg--1{order:-1}.flex-order-gt-lg-0{order:0}.flex-order-gt-lg-1{order:1}.flex-order-gt-lg-2{order:2}.flex-order-gt-lg-3{order:3}.flex-order-gt-lg-4{order:4}.flex-order-gt-lg-5{order:5}.flex-order-gt-lg-6{order:6}.flex-order-gt-lg-7{order:7}.flex-order-gt-lg-8{order:8}.flex-order-gt-lg-9{order:9}.flex-order-gt-lg-10{order:10}.flex-order-gt-lg-11{order:11}.flex-order-gt-lg-12{order:12}.flex-order-gt-lg-13{order:13}.flex-order-gt-lg-14{order:14}.flex-order-gt-lg-15{order:15}.flex-order-gt-lg-16{order:16}.flex-order-gt-lg-17{order:17}.flex-order-gt-lg-18{order:18}.flex-order-gt-lg-19{order:19}.flex-order-gt-lg-20{order:20}.flex-offset-gt-lg-0,.offset-gt-lg-0{margin-left:0}[dir=rtl] .flex-offset-gt-lg-0,[dir=rtl] .offset-gt-lg-0{margin-left:auto;margin-right:0}.flex-offset-gt-lg-5,.offset-gt-lg-5{margin-left:5%}[dir=rtl] .flex-offset-gt-lg-5,[dir=rtl] .offset-gt-lg-5{margin-left:auto;margin-right:5%}.flex-offset-gt-lg-10,.offset-gt-lg-10{margin-left:10%}[dir=rtl] .flex-offset-gt-lg-10,[dir=rtl] .offset-gt-lg-10{margin-left:auto;margin-right:10%}.flex-offset-gt-lg-15,.offset-gt-lg-15{margin-left:15%}[dir=rtl] .flex-offset-gt-lg-15,[dir=rtl] .offset-gt-lg-15{margin-left:auto;margin-right:15%}.flex-offset-gt-lg-20,.offset-gt-lg-20{margin-left:20%}[dir=rtl] .flex-offset-gt-lg-20,[dir=rtl] .offset-gt-lg-20{margin-left:auto;margin-right:20%}.flex-offset-gt-lg-25,.offset-gt-lg-25{margin-left:25%}[dir=rtl] .flex-offset-gt-lg-25,[dir=rtl] .offset-gt-lg-25{margin-left:auto;margin-right:25%}.flex-offset-gt-lg-30,.offset-gt-lg-30{margin-left:30%}[dir=rtl] .flex-offset-gt-lg-30,[dir=rtl] .offset-gt-lg-30{margin-left:auto;margin-right:30%}.flex-offset-gt-lg-35,.offset-gt-lg-35{margin-left:35%}[dir=rtl] .flex-offset-gt-lg-35,[dir=rtl] .offset-gt-lg-35{margin-left:auto;margin-right:35%}.flex-offset-gt-lg-40,.offset-gt-lg-40{margin-left:40%}[dir=rtl] .flex-offset-gt-lg-40,[dir=rtl] .offset-gt-lg-40{margin-left:auto;margin-right:40%}.flex-offset-gt-lg-45,.offset-gt-lg-45{margin-left:45%}[dir=rtl] .flex-offset-gt-lg-45,[dir=rtl] .offset-gt-lg-45{margin-left:auto;margin-right:45%}.flex-offset-gt-lg-50,.offset-gt-lg-50{margin-left:50%}[dir=rtl] .flex-offset-gt-lg-50,[dir=rtl] .offset-gt-lg-50{margin-left:auto;margin-right:50%}.flex-offset-gt-lg-55,.offset-gt-lg-55{margin-left:55%}[dir=rtl] .flex-offset-gt-lg-55,[dir=rtl] .offset-gt-lg-55{margin-left:auto;margin-right:55%}.flex-offset-gt-lg-60,.offset-gt-lg-60{margin-left:60%}[dir=rtl] .flex-offset-gt-lg-60,[dir=rtl] .offset-gt-lg-60{margin-left:auto;margin-right:60%}.flex-offset-gt-lg-65,.offset-gt-lg-65{margin-left:65%}[dir=rtl] .flex-offset-gt-lg-65,[dir=rtl] .offset-gt-lg-65{margin-left:auto;margin-right:65%}.flex-offset-gt-lg-70,.offset-gt-lg-70{margin-left:70%}[dir=rtl] .flex-offset-gt-lg-70,[dir=rtl] .offset-gt-lg-70{margin-left:auto;margin-right:70%}.flex-offset-gt-lg-75,.offset-gt-lg-75{margin-left:75%}[dir=rtl] .flex-offset-gt-lg-75,[dir=rtl] .offset-gt-lg-75{margin-left:auto;margin-right:75%}.flex-offset-gt-lg-80,.offset-gt-lg-80{margin-left:80%}[dir=rtl] .flex-offset-gt-lg-80,[dir=rtl] .offset-gt-lg-80{margin-left:auto;margin-right:80%}.flex-offset-gt-lg-85,.offset-gt-lg-85{margin-left:85%}[dir=rtl] .flex-offset-gt-lg-85,[dir=rtl] .offset-gt-lg-85{margin-left:auto;margin-right:85%}.flex-offset-gt-lg-90,.offset-gt-lg-90{margin-left:90%}[dir=rtl] .flex-offset-gt-lg-90,[dir=rtl] .offset-gt-lg-90{margin-left:auto;margin-right:90%}.flex-offset-gt-lg-95,.offset-gt-lg-95{margin-left:95%}[dir=rtl] .flex-offset-gt-lg-95,[dir=rtl] .offset-gt-lg-95{margin-left:auto;margin-right:95%}.flex-offset-gt-lg-33,.offset-gt-lg-33{margin-left:calc(100% / 3)}.flex-offset-gt-lg-66,.offset-gt-lg-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-gt-lg-66,[dir=rtl] .offset-gt-lg-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-gt-lg,.layout-align-gt-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-lg-start,.layout-align-gt-lg-start-center,.layout-align-gt-lg-start-end,.layout-align-gt-lg-start-start,.layout-align-gt-lg-start-stretch{justify-content:flex-start}.layout-align-gt-lg-center,.layout-align-gt-lg-center-center,.layout-align-gt-lg-center-end,.layout-align-gt-lg-center-start,.layout-align-gt-lg-center-stretch{justify-content:center}.layout-align-gt-lg-end,.layout-align-gt-lg-end-center,.layout-align-gt-lg-end-end,.layout-align-gt-lg-end-start,.layout-align-gt-lg-end-stretch{justify-content:flex-end}.layout-align-gt-lg-space-around,.layout-align-gt-lg-space-around-center,.layout-align-gt-lg-space-around-end,.layout-align-gt-lg-space-around-start,.layout-align-gt-lg-space-around-stretch{justify-content:space-around}.layout-align-gt-lg-space-between,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-between-stretch{justify-content:space-between}.layout-align-gt-lg-center-start,.layout-align-gt-lg-end-start,.layout-align-gt-lg-space-around-start,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-start-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-lg-center-center,.layout-align-gt-lg-end-center,.layout-align-gt-lg-space-around-center,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-lg-center-center>*,.layout-align-gt-lg-end-center>*,.layout-align-gt-lg-space-around-center>*,.layout-align-gt-lg-space-between-center>*,.layout-align-gt-lg-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-lg-center-end,.layout-align-gt-lg-end-end,.layout-align-gt-lg-space-around-end,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-start-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-lg-center-stretch,.layout-align-gt-lg-end-stretch,.layout-align-gt-lg-space-around-stretch,.layout-align-gt-lg-space-between-stretch,.layout-align-gt-lg-start-stretch{align-items:stretch;align-content:stretch}.flex-gt-lg{flex:1;box-sizing:border-box}.flex-gt-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-lg-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-lg-column>.flex-gt-lg-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex{min-width:0}.layout-gt-lg-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-column>.flex{min-height:0}.layout-gt-lg,.layout-gt-lg-column,.layout-gt-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-lg-column{flex-direction:column}.layout-gt-lg-row{flex-direction:row}.flex-order-xl--20{order:-20}.flex-order-xl--19{order:-19}.flex-order-xl--18{order:-18}.flex-order-xl--17{order:-17}.flex-order-xl--16{order:-16}.flex-order-xl--15{order:-15}.flex-order-xl--14{order:-14}.flex-order-xl--13{order:-13}.flex-order-xl--12{order:-12}.flex-order-xl--11{order:-11}.flex-order-xl--10{order:-10}.flex-order-xl--9{order:-9}.flex-order-xl--8{order:-8}.flex-order-xl--7{order:-7}.flex-order-xl--6{order:-6}.flex-order-xl--5{order:-5}.flex-order-xl--4{order:-4}.flex-order-xl--3{order:-3}.flex-order-xl--2{order:-2}.flex-order-xl--1{order:-1}.flex-order-xl-0{order:0}.flex-order-xl-1{order:1}.flex-order-xl-2{order:2}.flex-order-xl-3{order:3}.flex-order-xl-4{order:4}.flex-order-xl-5{order:5}.flex-order-xl-6{order:6}.flex-order-xl-7{order:7}.flex-order-xl-8{order:8}.flex-order-xl-9{order:9}.flex-order-xl-10{order:10}.flex-order-xl-11{order:11}.flex-order-xl-12{order:12}.flex-order-xl-13{order:13}.flex-order-xl-14{order:14}.flex-order-xl-15{order:15}.flex-order-xl-16{order:16}.flex-order-xl-17{order:17}.flex-order-xl-18{order:18}.flex-order-xl-19{order:19}.flex-order-xl-20{order:20}.flex-offset-xl-0,.offset-xl-0{margin-left:0}[dir=rtl] .flex-offset-xl-0,[dir=rtl] .offset-xl-0{margin-left:auto;margin-right:0}.flex-offset-xl-5,.offset-xl-5{margin-left:5%}[dir=rtl] .flex-offset-xl-5,[dir=rtl] .offset-xl-5{margin-left:auto;margin-right:5%}.flex-offset-xl-10,.offset-xl-10{margin-left:10%}[dir=rtl] .flex-offset-xl-10,[dir=rtl] .offset-xl-10{margin-left:auto;margin-right:10%}.flex-offset-xl-15,.offset-xl-15{margin-left:15%}[dir=rtl] .flex-offset-xl-15,[dir=rtl] .offset-xl-15{margin-left:auto;margin-right:15%}.flex-offset-xl-20,.offset-xl-20{margin-left:20%}[dir=rtl] .flex-offset-xl-20,[dir=rtl] .offset-xl-20{margin-left:auto;margin-right:20%}.flex-offset-xl-25,.offset-xl-25{margin-left:25%}[dir=rtl] .flex-offset-xl-25,[dir=rtl] .offset-xl-25{margin-left:auto;margin-right:25%}.flex-offset-xl-30,.offset-xl-30{margin-left:30%}[dir=rtl] .flex-offset-xl-30,[dir=rtl] .offset-xl-30{margin-left:auto;margin-right:30%}.flex-offset-xl-35,.offset-xl-35{margin-left:35%}[dir=rtl] .flex-offset-xl-35,[dir=rtl] .offset-xl-35{margin-left:auto;margin-right:35%}.flex-offset-xl-40,.offset-xl-40{margin-left:40%}[dir=rtl] .flex-offset-xl-40,[dir=rtl] .offset-xl-40{margin-left:auto;margin-right:40%}.flex-offset-xl-45,.offset-xl-45{margin-left:45%}[dir=rtl] .flex-offset-xl-45,[dir=rtl] .offset-xl-45{margin-left:auto;margin-right:45%}.flex-offset-xl-50,.offset-xl-50{margin-left:50%}[dir=rtl] .flex-offset-xl-50,[dir=rtl] .offset-xl-50{margin-left:auto;margin-right:50%}.flex-offset-xl-55,.offset-xl-55{margin-left:55%}[dir=rtl] .flex-offset-xl-55,[dir=rtl] .offset-xl-55{margin-left:auto;margin-right:55%}.flex-offset-xl-60,.offset-xl-60{margin-left:60%}[dir=rtl] .flex-offset-xl-60,[dir=rtl] .offset-xl-60{margin-left:auto;margin-right:60%}.flex-offset-xl-65,.offset-xl-65{margin-left:65%}[dir=rtl] .flex-offset-xl-65,[dir=rtl] .offset-xl-65{margin-left:auto;margin-right:65%}.flex-offset-xl-70,.offset-xl-70{margin-left:70%}[dir=rtl] .flex-offset-xl-70,[dir=rtl] .offset-xl-70{margin-left:auto;margin-right:70%}.flex-offset-xl-75,.offset-xl-75{margin-left:75%}[dir=rtl] .flex-offset-xl-75,[dir=rtl] .offset-xl-75{margin-left:auto;margin-right:75%}.flex-offset-xl-80,.offset-xl-80{margin-left:80%}[dir=rtl] .flex-offset-xl-80,[dir=rtl] .offset-xl-80{margin-left:auto;margin-right:80%}.flex-offset-xl-85,.offset-xl-85{margin-left:85%}[dir=rtl] .flex-offset-xl-85,[dir=rtl] .offset-xl-85{margin-left:auto;margin-right:85%}.flex-offset-xl-90,.offset-xl-90{margin-left:90%}[dir=rtl] .flex-offset-xl-90,[dir=rtl] .offset-xl-90{margin-left:auto;margin-right:90%}.flex-offset-xl-95,.offset-xl-95{margin-left:95%}[dir=rtl] .flex-offset-xl-95,[dir=rtl] .offset-xl-95{margin-left:auto;margin-right:95%}.flex-offset-xl-33,.offset-xl-33{margin-left:calc(100% / 3)}.flex-offset-xl-66,.offset-xl-66{margin-left:calc(200% / 3)}[dir=rtl] .flex-offset-xl-66,[dir=rtl] .offset-xl-66{margin-left:auto;margin-right:calc(200% / 3)}.layout-align-xl,.layout-align-xl-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xl-start,.layout-align-xl-start-center,.layout-align-xl-start-end,.layout-align-xl-start-start,.layout-align-xl-start-stretch{justify-content:flex-start}.layout-align-xl-center,.layout-align-xl-center-center,.layout-align-xl-center-end,.layout-align-xl-center-start,.layout-align-xl-center-stretch{justify-content:center}.layout-align-xl-end,.layout-align-xl-end-center,.layout-align-xl-end-end,.layout-align-xl-end-start,.layout-align-xl-end-stretch{justify-content:flex-end}.layout-align-xl-space-around,.layout-align-xl-space-around-center,.layout-align-xl-space-around-end,.layout-align-xl-space-around-start,.layout-align-xl-space-around-stretch{justify-content:space-around}.layout-align-xl-space-between,.layout-align-xl-space-between-center,.layout-align-xl-space-between-end,.layout-align-xl-space-between-start,.layout-align-xl-space-between-stretch{justify-content:space-between}.layout-align-xl-center-start,.layout-align-xl-end-start,.layout-align-xl-space-around-start,.layout-align-xl-space-between-start,.layout-align-xl-start-start{align-items:flex-start;align-content:flex-start}.layout-align-xl-center-center,.layout-align-xl-end-center,.layout-align-xl-space-around-center,.layout-align-xl-space-between-center,.layout-align-xl-start-center{align-items:center;align-content:center;max-width:100%}.layout-align-xl-center-center>*,.layout-align-xl-end-center>*,.layout-align-xl-space-around-center>*,.layout-align-xl-space-between-center>*,.layout-align-xl-start-center>*{max-width:100%;box-sizing:border-box}.layout-align-xl-center-end,.layout-align-xl-end-end,.layout-align-xl-space-around-end,.layout-align-xl-space-between-end,.layout-align-xl-start-end{align-items:flex-end;align-content:flex-end}.layout-align-xl-center-stretch,.layout-align-xl-end-stretch,.layout-align-xl-space-around-stretch,.layout-align-xl-space-between-stretch,.layout-align-xl-start-stretch{align-items:stretch;align-content:stretch}.flex-xl{flex:1;box-sizing:border-box}.flex-xl-grow{flex:1 1 100%;box-sizing:border-box}.flex-xl-initial{flex:0 1 auto;box-sizing:border-box}.flex-xl-auto{flex:1 1 auto;box-sizing:border-box}.flex-xl-none{flex:0 0 auto;box-sizing:border-box}.flex-xl-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xl-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xl-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xl-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-0{flex:1 1 0%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xl-column>.flex-xl-0{flex:1 1 0%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xl-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-5{flex:1 1 5%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-5{flex:1 1 5%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xl-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-10{flex:1 1 10%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-10{flex:1 1 10%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xl-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-15{flex:1 1 15%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-15{flex:1 1 15%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xl-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-20{flex:1 1 20%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-20{flex:1 1 20%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xl-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-25{flex:1 1 25%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-25{flex:1 1 25%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xl-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-30{flex:1 1 30%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-30{flex:1 1 30%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xl-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-35{flex:1 1 35%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-35{flex:1 1 35%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xl-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-40{flex:1 1 40%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-40{flex:1 1 40%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xl-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-45{flex:1 1 45%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-45{flex:1 1 45%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xl-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-50{flex:1 1 50%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-50{flex:1 1 50%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xl-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-55{flex:1 1 55%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-55{flex:1 1 55%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xl-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-60{flex:1 1 60%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-60{flex:1 1 60%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xl-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-65{flex:1 1 65%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-65{flex:1 1 65%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xl-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-70{flex:1 1 70%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-70{flex:1 1 70%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xl-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-75{flex:1 1 75%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-75{flex:1 1 75%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xl-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-80{flex:1 1 80%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-80{flex:1 1 80%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xl-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-85{flex:1 1 85%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-85{flex:1 1 85%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xl-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-90{flex:1 1 90%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-90{flex:1 1 90%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xl-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-95{flex:1 1 95%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-95{flex:1 1 95%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex{min-width:0}.layout-xl-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xl-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-column>.flex{min-height:0}.layout-xl,.layout-xl-column,.layout-xl-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xl-column{flex-direction:column}.layout-xl-row{flex-direction:row}.hide-gt-lg:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show){display:none}.hide-xl:not(.show-xl):not(.show-gt-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}}@media print{.hide-print:not(.show-print):not(.show){display:none!important}}md-menu[md-nest-level='1']{margin:0}md-menu[md-nest-level='1'] .md-button{display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}*{text-rendering:optimizeLegibility;-o-text-rendering:optimizeLegibility;-ms-text-rendering:optimizeLegibility;-moz-text-rendering:optimizeLegibility;-webkit-text-rendering:optimizeLegibility;-webkit-tap-highlight-color:transparent;box-sizing:border-box}:after,:before{box-sizing:border-box}:focus{outline:0}:not(md-input-container)>button,:not(md-input-container)>input[type=button],:not(md-input-container)>input[type=email],:not(md-input-container)>input[type=image],:not(md-input-container)>input[type=password],:not(md-input-container)>input[type=search],:not(md-input-container)>input[type=submit],:not(md-input-container)>input[type=tel],:not(md-input-container)>input[type=text],:not(md-input-container)>textarea{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;border:none;padding:0;margin:0}:not(md-input-container)>button,:not(md-input-container)>input[type=button],:not(md-input-container)>input[type=submit]{background:0 0}button{border-radius:0;font-family:inherit;font-size:inherit;padding:0;margin:0;appearance:none;-moz-appearance:none;-webkit-appearance:none}[layout]>*{min-height:auto;min-height:initial}md-card>:not(md-card-content) img,md-card>img{height:inherit;height:initial}.md-datepicker-calendar-pane *{box-sizing:initial}md-autocomplete-wrap>input[type=search]{background:#fff;padding:0 15px!important}md-backdrop.md-opaque{background-color:rgba(33,33,33,.48)!important}md-card md-card-header md-card-avatar md-icon{width:40px;height:40px}md-checkbox.no-label{margin:0}md-chip .md-chip-remove md-icon{margin-left:2px}md-chip .md-chip-remove md-icon svg{width:18px;height:18px;max-width:18px;max-height:18px;margin:4px}md-datepicker .md-datepicker-button{padding:0!important;margin:0!important;vertical-align:middle}md-datepicker .md-datepicker-input-container{margin-left:0}.md-inline-form md-datepicker{margin-top:14px}md-dialog md-dialog-content{padding:32px 24px 24px 24px}md-dialog md-dialog-actions{min-height:64px;padding-top:8px;padding-bottom:8px}md-dialog md-dialog-actions .md-button{margin:0 8px}md-input-container.no-errors-spacer .md-errors-spacer{display:none}md-input-container .input-hint{position:absolute;right:auto;bottom:7px;left:2px;font-size:12px;line-height:14px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-input-container.md-icon-left .input-hint{left:38px}md-list-item .md-list-item-text p{font-size:13px!important}.md-menu,md-menu{padding:0}md-menu-content.md-menu-bar-menu.md-dense{padding:8px 0}md-menu-content.md-menu-bar-menu.md-dense .md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item{height:40px;line-height:40px}md-menu-content.md-menu-bar-menu.md-dense .md-button.md-indent>md-icon,md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{top:8px}.md-open-menu-container md-menu-content md-menu-item.selected{opacity:.4}md-menu-content md-menu-item .md-button{text-align:left}md-select.simplified{margin:0 8px}md-select.simplified .md-select-value{border:none!important;box-sizing:border-box;padding:0}md-select.simplified .md-select-value :first-child{transform:none;height:auto}md-select.simplified .md-select-value .md-select-icon{transform:none;font-size:16px}md-select.simplified .md-select-value .md-select-icon:after{top:1px}md-select[multiple] md-select-value>:first-child{display:flex}md-select[multiple] md-select-value>:first-child>:first-child{flex:0}md-select[multiple] md-select-value>:first-child .md-container{padding-right:6px}md-select[multiple] md-select-value>:first-child .md-container:first-of-type{padding-right:0}md-select-menu md-select-header{position:relative;display:flex;align-items:center;width:auto;height:48px;padding-left:10.667px;box-shadow:0 1px 0 0 rgba(0,0,0,.1),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12);cursor:pointer}md-select-menu md-select-header input[type=search]{border:none;outline:0;height:100%;width:100%;padding:0}md-sidenav{-webkit-overflow-scrolling:touch}md-toolbar.colored-toolbar{color:rgba(255,255,255,.87)}md-toolbar.colored-toolbar md-menu-bar md-menu._md-open>button{background:rgba(0,0,0,.12)}md-toolbar.colored-toolbar md-menu._md-open>button{background:rgba(0,0,0,.12)}md-toolbar.colored-toolbar input{color:rgba(255,255,255,.87)!important}md-progress-circular[disabled]{visibility:hidden}body,html{overflow:hidden!important}#main{position:fixed;top:0;left:0;width:100vw;height:100vh}body.boxed{background:#3f4450}body.boxed #main{overflow:hidden!important;width:100%;max-width:1280px;margin:0 auto;box-shadow:0 0 12px rgba(0,0,0,.45)}#layout-content-only{position:relative;height:100%;max-height:100%}#layout-content-only #content{position:absolute;top:0;right:0;bottom:0;left:0}#layout-content-with-toolbar{position:relative;height:100%;max-height:100%}#layout-content-with-toolbar #content{position:absolute;top:64px;right:0;bottom:0;left:0}#layout-vertical-navigation{width:100%;height:100%;max-height:100%}#layout-vertical-navigation #content-container{position:relative;overflow:hidden;width:100%;height:100%}#layout-vertical-navigation #content-container #content{width:100%;height:100%;overflow:auto}#layout-vertical-navigation-fullwidth-toolbar{height:100%;max-height:100%}#layout-vertical-navigation-fullwidth-toolbar #main-container{position:relative}#layout-vertical-navigation-fullwidth-toolbar #main-container #content-container{position:relative;overflow:hidden}#layout-vertical-navigation-fullwidth-toolbar #main-container #content-container #content{position:absolute;top:0;right:0;bottom:0;left:0}#layout-vertical-navigation-fullwidth-toolbar-2{height:100%;max-height:100%}#layout-vertical-navigation-fullwidth-toolbar-2 #main-container{position:relative}#layout-vertical-navigation-fullwidth-toolbar-2 #main-container #content-container{position:relative;overflow:hidden}#layout-vertical-navigation-fullwidth-toolbar-2 #main-container #content-container #content{position:absolute;top:0;right:0;bottom:0;left:0}#layout-horizontal-navigation{height:100%;max-height:100%}#layout-horizontal-navigation #content-container{position:relative;overflow:hidden}#layout-horizontal-navigation #content-container #content{position:absolute;top:0;right:0;bottom:0;left:0}.page-layout{position:relative;overflow:hidden}.page-layout .top-bg{position:absolute;z-index:1;top:0;right:0;left:0;height:200px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout md-backdrop{z-index:50}.page-layout>.header .breadcrumb{margin-bottom:16px;font-weight:500;color:rgba(0,0,0,.54)}.page-layout>.header .breadcrumb md-icon{margin:0}.page-layout>.header .breadcrumb .separator{margin:0 8px}.page-layout>.header .title{font-size:34px}.page-layout.carded{min-height:100%;height:100%}.page-layout.carded.fullwidth.single-scroll{height:auto}.page-layout.carded.fullwidth.single-scroll>.center .content-card .content{overflow:hidden}.page-layout.carded.fullwidth>.center{position:relative;z-index:2;margin-left:32px;margin-right:32px}.page-layout.carded.fullwidth>.center .header{height:136px;min-height:136px;max-height:136px;padding:24px}.page-layout.carded.fullwidth>.center .content-card{background:#fff;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);overflow:hidden}.page-layout.carded.fullwidth>.center .content-card .toolbar{padding:8px 24px;height:64px;min-height:64px;max-height:64px;border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.fullwidth>.center .content-card .content{padding:24px;background:#fff}.page-layout.carded.left-sidenav.single-scroll{height:auto}.page-layout.carded.left-sidenav.single-scroll>.center .content-card .content{overflow:hidden}.page-layout.carded.left-sidenav>.sidenav{width:240px;min-width:240px;max-width:240px;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);z-index:51}.page-layout.carded.left-sidenav>.sidenav .header{height:200px;min-height:200px;max-height:200px;padding:24px}.page-layout.carded.left-sidenav>.sidenav .content{background:0 0;padding:24px}.page-layout.carded.left-sidenav>.sidenav.md-locked-open{width:220px;min-width:220px;max-width:220px;z-index:2;background:0 0;box-shadow:none}.page-layout.carded.left-sidenav>.sidenav.md-locked-open+.center{margin-left:0}.page-layout.carded.left-sidenav>.sidenav:not(.md-locked-open) .header{border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.left-sidenav>.sidenav:not(.md-locked-open) .content{overflow:hidden}.page-layout.carded.left-sidenav>.center{position:relative;z-index:2;margin-left:32px;margin-right:32px}.page-layout.carded.left-sidenav>.center .header{height:136px;min-height:136px;max-height:136px;padding:24px}.page-layout.carded.left-sidenav>.center .content-card{background:#fff;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);overflow:hidden}.page-layout.carded.left-sidenav>.center .content-card .toolbar{padding:8px 24px;height:64px;min-height:64px;max-height:64px;border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.left-sidenav>.center .content-card .toolbar .sidenav-toggle{margin:0 8px 0 0!important;padding:0!important;border-radius:0}.page-layout.carded.left-sidenav>.center .content-card .content{padding:24px;background:#fff}.page-layout.carded.right-sidenav.single-scroll{height:auto}.page-layout.carded.right-sidenav.single-scroll>.center .content-card .content{overflow:hidden}.page-layout.carded.right-sidenav>.sidenav{width:240px;min-width:240px;max-width:240px;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);z-index:51}.page-layout.carded.right-sidenav>.sidenav .header{height:200px;min-height:200px;max-height:200px;padding:24px 24px 24px 0}.page-layout.carded.right-sidenav>.sidenav .content{background:0 0;padding:24px 24px 24px 0}.page-layout.carded.right-sidenav>.sidenav.md-locked-open{width:196px;min-width:196px;max-width:196px;z-index:2;background:0 0;box-shadow:none}.page-layout.carded.right-sidenav>.sidenav:not(.md-locked-open) .header{padding:24px;border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.right-sidenav>.sidenav:not(.md-locked-open) .content{overflow:hidden;padding:24px}.page-layout.carded.right-sidenav>.center{position:relative;z-index:2;margin-left:32px;margin-right:32px}.page-layout.carded.right-sidenav>.center .header{height:136px;min-height:136px;max-height:136px;padding:24px}.page-layout.carded.right-sidenav>.center .content-card{background:#fff;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);overflow:hidden}.page-layout.carded.right-sidenav>.center .content-card .toolbar{padding:8px 24px;height:64px;min-height:64px;max-height:64px;border-bottom:1px solid rgba(0,0,0,.12)}.page-layout.carded.right-sidenav>.center .content-card .toolbar .sidenav-toggle{margin:0 0 0 8px!important;padding:0!important;border-radius:0}.page-layout.carded.right-sidenav>.center .content-card .content{padding:24px;background:#fff}.page-layout.simple.fullwidth,.page-layout.simple.inner-sidenav{min-height:100%}.page-layout.simple.fullwidth>.header,.page-layout.simple.inner-sidenav>.header{height:200px;min-height:200px;max-height:200px;padding:24px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout.simple.fullwidth>.content,.page-layout.simple.inner-sidenav>.content{padding:24px}.page-layout.simple.left-sidenav{min-height:100%;height:100%}.page-layout.simple.left-sidenav.single-scroll{height:auto}.page-layout.simple.left-sidenav.single-scroll>.center{overflow:hidden}.page-layout.simple.left-sidenav.inner-sidenav>.content>md-sidenav{margin-right:24px}.page-layout.simple.left-sidenav .sidenav{width:240px;min-width:240px;max-width:240px;padding:24px;z-index:51;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.page-layout.simple.left-sidenav .sidenav.md-locked-open{width:220px;min-width:220px;max-width:220px;z-index:2;box-shadow:none;background:0 0}.page-layout.simple.left-sidenav>.center{position:relative;overflow:auto;z-index:3;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.page-layout.simple.left-sidenav>.center .header{height:200px;min-height:200px;max-height:200px;padding:24px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout.simple.left-sidenav>.center .content{padding:24px;background:#fff}.page-layout.simple.right-sidenav{min-height:100%;height:100%}.page-layout.simple.right-sidenav.single-scroll{height:auto}.page-layout.simple.right-sidenav.single-scroll>.center{overflow:hidden}.page-layout.simple.right-sidenav.inner-sidenav>.content>md-sidenav{margin-left:24px}.page-layout.simple.right-sidenav .sidenav{width:240px;min-width:240px;max-width:240px;padding:24px;z-index:51;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.page-layout.simple.right-sidenav .sidenav.md-locked-open{width:220px;min-width:220px;max-width:220px;z-index:2;box-shadow:none;background:0 0}.page-layout.simple.right-sidenav>.center{position:relative;overflow:auto;z-index:3;box-shadow:0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12)}.page-layout.simple.right-sidenav>.center .header{height:200px;min-height:200px;max-height:200px;padding:24px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout.simple.right-sidenav>.center .content{padding:24px;background:#fff}.page-layout.simple.inner-sidenav{height:auto}.page-layout.simple.inner-sidenav>.content>md-sidenav.md-locked-open{padding:0}.page-layout.simple.tabbed{width:100%;height:100%;min-height:100%}.page-layout.simple.tabbed>.header{height:200px;min-height:200px;max-height:200px;padding:24px;background-image:url(/assets/images/backgrounds/header-bg.png);background-size:cover}.page-layout.simple.tabbed>.content{width:100%;height:100%;overflow:hidden}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-wrapper{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);padding:0 24px}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-wrapper md-tabs-canvas{height:56px}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-wrapper md-tabs-canvas md-pagination-wrapper{height:56px}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-wrapper md-tabs-canvas .md-tab{padding:16px 24px;text-transform:none}.page-layout.simple.tabbed>.content>md-tabs:not(.md-dynamic-height) md-tabs-content-wrapper{top:56px}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-content-wrapper{width:100%;height:calc(100% - 56px)}.page-layout.simple.tabbed>.content>md-tabs>md-tabs-content-wrapper>md-tab-content.md-active{padding:24px;box-sizing:border-box;overflow:auto;width:100%;height:100%;display:block}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);border:none;height:56px}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar nav{margin:0 12px}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar nav .md-nav-item{height:56px}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar nav .md-nav-item ._md-nav-button{height:56px;line-height:32px}.page-layout.simple.tabbed>.content>md-nav-bar .md-nav-bar nav .md-nav-item ._md-nav-button-text{text-transform:none}.page-layout.blank{min-height:100%;padding:24px}.single-scroll .carded.fullwidth{height:auto}.single-scroll .carded.fullwidth>.center .content-card .content{overflow:hidden}.single-scroll .carded.left-sidenav{height:auto}.single-scroll .carded.left-sidenav>.center .content-card .content{overflow:hidden}.single-scroll .carded.right-sidenav{height:auto}.single-scroll .carded.right-sidenav>.center .content-card .content{overflow:hidden}.single-scroll .simple.left-sidenav{height:auto}.single-scroll .simple.left-sidenav>.center{overflow:hidden}.single-scroll .simple.right-sidenav{height:auto}.single-scroll .simple.right-sidenav>.center{overflow:hidden}@media screen and (max-width:1280px){.page-layout.simple.inner-sidenav.left-sidenav>.content,.page-layout.simple.inner-sidenav.right-sidenav>.content{height:auto!important}.page-layout.simple.inner-sidenav.left-sidenav>.content>md-sidenav,.page-layout.simple.inner-sidenav.right-sidenav>.content>md-sidenav{margin-left:0;margin-right:0}.sidenav-open .page-layout.simple.inner-sidenav{height:100%}}@media screen and (max-width:600px){.page-layout .top-bg{height:160px}.page-layout.carded.fullwidth>.center,.page-layout.carded.left-sidenav>.center,.page-layout.carded.right-sidenav>.center{margin-left:16px;margin-right:16px}.page-layout.carded.fullwidth>.center .header,.page-layout.carded.left-sidenav>.center .header,.page-layout.carded.right-sidenav>.center .header{height:96px;min-height:96px;max-height:96px;padding:16px}.page-layout.carded.fullwidth{height:auto}.page-layout.carded.fullwidth>.center .content-card .content{overflow:hidden}.page-layout.carded.left-sidenav,.page-layout.carded.right-sidenav{height:auto}.page-layout.carded.left-sidenav>.center .content-card .content,.page-layout.carded.right-sidenav>.center .content-card .content{overflow:hidden}.page-layout.simple.fullwidth>.header,.page-layout.simple.inner-sidenav>.header{height:160px;min-height:160px;max-height:160px;padding:16px}.page-layout.simple.left-sidenav>.center .header,.page-layout.simple.right-sidenav>.center .header{height:160px;min-height:160px;max-height:160px;padding:16px}.page-layout.simple.left-sidenav,.page-layout.simple.right-sidenav{height:auto}.page-layout.simple.left-sidenav>.center,.page-layout.simple.right-sidenav>.center{overflow:hidden}}.black-fg,.black-text{color:rgba(0,0,0,.87)!important}.black-fg .icon,.black-fg .secondary-text,.black-fg.icon,.black-fg.secondary-text,.black-text .icon,.black-text .secondary-text,.black-text.icon,.black-text.secondary-text{color:rgba(0,0,0,.54)!important}.black-fg .disabled-text,.black-fg .hint-text,.black-fg.disabled-text,.black-fg.hint-text,.black-text .disabled-text,.black-text .hint-text,.black-text.disabled-text,.black-text.hint-text{color:rgba(0,0,0,.26)!important}.black-fg .divider,.black-fg .faint-text,.black-fg.divider,.black-fg.faint-text,.black-text .divider,.black-text .faint-text,.black-text.divider,.black-text.faint-text{color:rgba(0,0,0,.12)!important}.white-fg,.white-text{color:#fff!important}.white-fg .icon,.white-fg .secondary-text,.white-fg.icon,.white-fg.secondary-text,.white-text .icon,.white-text .secondary-text,.white-text.icon,.white-text.secondary-text{color:rgba(255,255,255,.7)!important}.white-fg .disabled-text,.white-fg .hint-text,.white-fg.disabled-text,.white-fg.hint-text,.white-text .disabled-text,.white-text .hint-text,.white-text.disabled-text,.white-text.hint-text{color:rgba(255,255,255,.3)!important}.white-fg .divider,.white-fg .faint-text,.white-fg.divider,.white-fg.faint-text,.white-text .divider,.white-text .faint-text,.white-text.divider,.white-text.faint-text{color:rgba(255,255,255,.12)!important}.white-fg md-icon,.white-text md-icon{color:#fff}.white-fg md-progress-linear .md-container,.white-text md-progress-linear .md-container{background:rgba(255,255,255,.3)}.white-fg md-progress-linear .md-bar,.white-text md-progress-linear .md-bar{background:rgba(255,255,255,.7)}.red-50-bg{background-color:#ffebee!important}.md-red-50-bg{background-color:#ffebee!important;color:rgba(0,0,0,.87)}.red-50-fg{color:#ffebee!important}.red-50-border{border-color:#ffebee!important}.red-50-border-top{border-top-color:#ffebee!important}.red-50-border-right{border-right-color:#ffebee!important}.red-50-border-bottom{border-bottom-color:#ffebee!important}.red-50-border-left{border-left-color:#ffebee!important}.red-100-bg{background-color:#ffcdd2!important}.md-red-100-bg{background-color:#ffcdd2!important;color:rgba(0,0,0,.87)}.red-100-fg{color:#ffcdd2!important}.red-100-border{border-color:#ffcdd2!important}.red-100-border-top{border-top-color:#ffcdd2!important}.red-100-border-right{border-right-color:#ffcdd2!important}.red-100-border-bottom{border-bottom-color:#ffcdd2!important}.red-100-border-left{border-left-color:#ffcdd2!important}.red-200-bg{background-color:#ef9a9a!important}.md-red-200-bg{background-color:#ef9a9a!important;color:rgba(0,0,0,.87)}.red-200-fg{color:#ef9a9a!important}.red-200-border{border-color:#ef9a9a!important}.red-200-border-top{border-top-color:#ef9a9a!important}.red-200-border-right{border-right-color:#ef9a9a!important}.red-200-border-bottom{border-bottom-color:#ef9a9a!important}.red-200-border-left{border-left-color:#ef9a9a!important}.red-300-bg{background-color:#e57373!important}.md-red-300-bg{background-color:#e57373!important;color:rgba(0,0,0,.87)}.red-300-fg{color:#e57373!important}.red-300-border{border-color:#e57373!important}.red-300-border-top{border-top-color:#e57373!important}.red-300-border-right{border-right-color:#e57373!important}.red-300-border-bottom{border-bottom-color:#e57373!important}.red-300-border-left{border-left-color:#e57373!important}.red-400-bg{background-color:#ef5350!important}.md-red-400-bg{background-color:#ef5350!important;color:#fff}.red-400-fg{color:#ef5350!important}.red-400-border{border-color:#ef5350!important}.red-400-border-top{border-top-color:#ef5350!important}.red-400-border-right{border-right-color:#ef5350!important}.red-400-border-bottom{border-bottom-color:#ef5350!important}.red-400-border-left{border-left-color:#ef5350!important}.red-500-bg{background-color:#f44336!important}.md-red-500-bg{background-color:#f44336!important;color:#fff}.red-500-fg{color:#f44336!important}.red-500-border{border-color:#f44336!important}.red-500-border-top{border-top-color:#f44336!important}.red-500-border-right{border-right-color:#f44336!important}.red-500-border-bottom{border-bottom-color:#f44336!important}.red-500-border-left{border-left-color:#f44336!important}.md-red-bg{background-color:#f44336!important;color:#fff}.red-bg{background-color:#f44336!important}.red-fg{color:#f44336!important}.red-border{border-color:#f44336!important}.red-border-top{border-top-color:#f44336!important}.red-border-right{border-right-color:#f44336!important}.red-border-bottom{border-bottom-color:#f44336!important}.red-border-left{border-left-color:#f44336!important}.red-600-bg{background-color:#e53935!important}.md-red-600-bg{background-color:#e53935!important;color:#fff}.red-600-fg{color:#e53935!important}.red-600-border{border-color:#e53935!important}.red-600-border-top{border-top-color:#e53935!important}.red-600-border-right{border-right-color:#e53935!important}.red-600-border-bottom{border-bottom-color:#e53935!important}.red-600-border-left{border-left-color:#e53935!important}.red-700-bg{background-color:#d32f2f!important}.md-red-700-bg{background-color:#d32f2f!important;color:#fff}.red-700-fg{color:#d32f2f!important}.red-700-border{border-color:#d32f2f!important}.red-700-border-top{border-top-color:#d32f2f!important}.red-700-border-right{border-right-color:#d32f2f!important}.red-700-border-bottom{border-bottom-color:#d32f2f!important}.red-700-border-left{border-left-color:#d32f2f!important}.red-800-bg{background-color:#c62828!important}.md-red-800-bg{background-color:#c62828!important;color:rgba(255,255,255,.87)}.red-800-fg{color:#c62828!important}.red-800-border{border-color:#c62828!important}.red-800-border-top{border-top-color:#c62828!important}.red-800-border-right{border-right-color:#c62828!important}.red-800-border-bottom{border-bottom-color:#c62828!important}.red-800-border-left{border-left-color:#c62828!important}.red-900-bg{background-color:#b71c1c!important}.md-red-900-bg{background-color:#b71c1c!important;color:rgba(255,255,255,.87)}.red-900-fg{color:#b71c1c!important}.red-900-border{border-color:#b71c1c!important}.red-900-border-top{border-top-color:#b71c1c!important}.red-900-border-right{border-right-color:#b71c1c!important}.red-900-border-bottom{border-bottom-color:#b71c1c!important}.red-900-border-left{border-left-color:#b71c1c!important}.red-A100-bg{background-color:#ff8a80!important}.md-red-A100-bg{background-color:#ff8a80!important;color:rgba(0,0,0,.87)}.red-A100-fg{color:#ff8a80!important}.red-A100-border{border-color:#ff8a80!important}.red-A100-border-top{border-top-color:#ff8a80!important}.red-A100-border-right{border-right-color:#ff8a80!important}.red-A100-border-bottom{border-bottom-color:#ff8a80!important}.red-A100-border-left{border-left-color:#ff8a80!important}.red-A200-bg{background-color:#ff5252!important}.md-red-A200-bg{background-color:#ff5252!important;color:#fff}.red-A200-fg{color:#ff5252!important}.red-A200-border{border-color:#ff5252!important}.red-A200-border-top{border-top-color:#ff5252!important}.red-A200-border-right{border-right-color:#ff5252!important}.red-A200-border-bottom{border-bottom-color:#ff5252!important}.red-A200-border-left{border-left-color:#ff5252!important}.red-A400-bg{background-color:#ff1744!important}.md-red-A400-bg{background-color:#ff1744!important;color:#fff}.red-A400-fg{color:#ff1744!important}.red-A400-border{border-color:#ff1744!important}.red-A400-border-top{border-top-color:#ff1744!important}.red-A400-border-right{border-right-color:#ff1744!important}.red-A400-border-bottom{border-bottom-color:#ff1744!important}.red-A400-border-left{border-left-color:#ff1744!important}.red-A700-bg{background-color:#d50000!important}.md-red-A700-bg{background-color:#d50000!important;color:#fff}.red-A700-fg{color:#d50000!important}.red-A700-border{border-color:#d50000!important}.red-A700-border-top{border-top-color:#d50000!important}.red-A700-border-right{border-right-color:#d50000!important}.red-A700-border-bottom{border-bottom-color:#d50000!important}.red-A700-border-left{border-left-color:#d50000!important}.pink-50-bg{background-color:#fce4ec!important}.md-pink-50-bg{background-color:#fce4ec!important;color:rgba(0,0,0,.87)}.pink-50-fg{color:#fce4ec!important}.pink-50-border{border-color:#fce4ec!important}.pink-50-border-top{border-top-color:#fce4ec!important}.pink-50-border-right{border-right-color:#fce4ec!important}.pink-50-border-bottom{border-bottom-color:#fce4ec!important}.pink-50-border-left{border-left-color:#fce4ec!important}.pink-100-bg{background-color:#f8bbd0!important}.md-pink-100-bg{background-color:#f8bbd0!important;color:rgba(0,0,0,.87)}.pink-100-fg{color:#f8bbd0!important}.pink-100-border{border-color:#f8bbd0!important}.pink-100-border-top{border-top-color:#f8bbd0!important}.pink-100-border-right{border-right-color:#f8bbd0!important}.pink-100-border-bottom{border-bottom-color:#f8bbd0!important}.pink-100-border-left{border-left-color:#f8bbd0!important}.pink-200-bg{background-color:#f48fb1!important}.md-pink-200-bg{background-color:#f48fb1!important;color:rgba(0,0,0,.87)}.pink-200-fg{color:#f48fb1!important}.pink-200-border{border-color:#f48fb1!important}.pink-200-border-top{border-top-color:#f48fb1!important}.pink-200-border-right{border-right-color:#f48fb1!important}.pink-200-border-bottom{border-bottom-color:#f48fb1!important}.pink-200-border-left{border-left-color:#f48fb1!important}.pink-300-bg{background-color:#f06292!important}.md-pink-300-bg{background-color:#f06292!important;color:rgba(255,255,255,.87)}.pink-300-fg{color:#f06292!important}.pink-300-border{border-color:#f06292!important}.pink-300-border-top{border-top-color:#f06292!important}.pink-300-border-right{border-right-color:#f06292!important}.pink-300-border-bottom{border-bottom-color:#f06292!important}.pink-300-border-left{border-left-color:#f06292!important}.pink-400-bg{background-color:#ec407a!important}.md-pink-400-bg{background-color:#ec407a!important;color:rgba(255,255,255,.87)}.pink-400-fg{color:#ec407a!important}.pink-400-border{border-color:#ec407a!important}.pink-400-border-top{border-top-color:#ec407a!important}.pink-400-border-right{border-right-color:#ec407a!important}.pink-400-border-bottom{border-bottom-color:#ec407a!important}.pink-400-border-left{border-left-color:#ec407a!important}.pink-500-bg{background-color:#e91e63!important}.md-pink-500-bg{background-color:#e91e63!important;color:#fff}.pink-500-fg{color:#e91e63!important}.pink-500-border{border-color:#e91e63!important}.pink-500-border-top{border-top-color:#e91e63!important}.pink-500-border-right{border-right-color:#e91e63!important}.pink-500-border-bottom{border-bottom-color:#e91e63!important}.pink-500-border-left{border-left-color:#e91e63!important}.md-pink-bg{background-color:#e91e63!important;color:#fff}.pink-bg{background-color:#e91e63!important}.pink-fg{color:#e91e63!important}.pink-border{border-color:#e91e63!important}.pink-border-top{border-top-color:#e91e63!important}.pink-border-right{border-right-color:#e91e63!important}.pink-border-bottom{border-bottom-color:#e91e63!important}.pink-border-left{border-left-color:#e91e63!important}.pink-600-bg{background-color:#d81b60!important}.md-pink-600-bg{background-color:#d81b60!important;color:#fff}.pink-600-fg{color:#d81b60!important}.pink-600-border{border-color:#d81b60!important}.pink-600-border-top{border-top-color:#d81b60!important}.pink-600-border-right{border-right-color:#d81b60!important}.pink-600-border-bottom{border-bottom-color:#d81b60!important}.pink-600-border-left{border-left-color:#d81b60!important}.pink-700-bg{background-color:#c2185b!important}.md-pink-700-bg{background-color:#c2185b!important;color:rgba(255,255,255,.87)}.pink-700-fg{color:#c2185b!important}.pink-700-border{border-color:#c2185b!important}.pink-700-border-top{border-top-color:#c2185b!important}.pink-700-border-right{border-right-color:#c2185b!important}.pink-700-border-bottom{border-bottom-color:#c2185b!important}.pink-700-border-left{border-left-color:#c2185b!important}.pink-800-bg{background-color:#ad1457!important}.md-pink-800-bg{background-color:#ad1457!important;color:rgba(255,255,255,.87)}.pink-800-fg{color:#ad1457!important}.pink-800-border{border-color:#ad1457!important}.pink-800-border-top{border-top-color:#ad1457!important}.pink-800-border-right{border-right-color:#ad1457!important}.pink-800-border-bottom{border-bottom-color:#ad1457!important}.pink-800-border-left{border-left-color:#ad1457!important}.pink-900-bg{background-color:#880e4f!important}.md-pink-900-bg{background-color:#880e4f!important;color:rgba(255,255,255,.87)}.pink-900-fg{color:#880e4f!important}.pink-900-border{border-color:#880e4f!important}.pink-900-border-top{border-top-color:#880e4f!important}.pink-900-border-right{border-right-color:#880e4f!important}.pink-900-border-bottom{border-bottom-color:#880e4f!important}.pink-900-border-left{border-left-color:#880e4f!important}.pink-A100-bg{background-color:#ff80ab!important}.md-pink-A100-bg{background-color:#ff80ab!important;color:rgba(0,0,0,.87)}.pink-A100-fg{color:#ff80ab!important}.pink-A100-border{border-color:#ff80ab!important}.pink-A100-border-top{border-top-color:#ff80ab!important}.pink-A100-border-right{border-right-color:#ff80ab!important}.pink-A100-border-bottom{border-bottom-color:#ff80ab!important}.pink-A100-border-left{border-left-color:#ff80ab!important}.pink-A200-bg{background-color:#ff4081!important}.md-pink-A200-bg{background-color:#ff4081!important;color:#fff}.pink-A200-fg{color:#ff4081!important}.pink-A200-border{border-color:#ff4081!important}.pink-A200-border-top{border-top-color:#ff4081!important}.pink-A200-border-right{border-right-color:#ff4081!important}.pink-A200-border-bottom{border-bottom-color:#ff4081!important}.pink-A200-border-left{border-left-color:#ff4081!important}.pink-A400-bg{background-color:#f50057!important}.md-pink-A400-bg{background-color:#f50057!important;color:#fff}.pink-A400-fg{color:#f50057!important}.pink-A400-border{border-color:#f50057!important}.pink-A400-border-top{border-top-color:#f50057!important}.pink-A400-border-right{border-right-color:#f50057!important}.pink-A400-border-bottom{border-bottom-color:#f50057!important}.pink-A400-border-left{border-left-color:#f50057!important}.pink-A700-bg{background-color:#c51162!important}.md-pink-A700-bg{background-color:#c51162!important;color:#fff}.pink-A700-fg{color:#c51162!important}.pink-A700-border{border-color:#c51162!important}.pink-A700-border-top{border-top-color:#c51162!important}.pink-A700-border-right{border-right-color:#c51162!important}.pink-A700-border-bottom{border-bottom-color:#c51162!important}.pink-A700-border-left{border-left-color:#c51162!important}.purple-50-bg{background-color:#f3e5f5!important}.md-purple-50-bg{background-color:#f3e5f5!important;color:rgba(0,0,0,.87)}.purple-50-fg{color:#f3e5f5!important}.purple-50-border{border-color:#f3e5f5!important}.purple-50-border-top{border-top-color:#f3e5f5!important}.purple-50-border-right{border-right-color:#f3e5f5!important}.purple-50-border-bottom{border-bottom-color:#f3e5f5!important}.purple-50-border-left{border-left-color:#f3e5f5!important}.purple-100-bg{background-color:#e1bee7!important}.md-purple-100-bg{background-color:#e1bee7!important;color:rgba(0,0,0,.87)}.purple-100-fg{color:#e1bee7!important}.purple-100-border{border-color:#e1bee7!important}.purple-100-border-top{border-top-color:#e1bee7!important}.purple-100-border-right{border-right-color:#e1bee7!important}.purple-100-border-bottom{border-bottom-color:#e1bee7!important}.purple-100-border-left{border-left-color:#e1bee7!important}.purple-200-bg{background-color:#ce93d8!important}.md-purple-200-bg{background-color:#ce93d8!important;color:rgba(0,0,0,.87)}.purple-200-fg{color:#ce93d8!important}.purple-200-border{border-color:#ce93d8!important}.purple-200-border-top{border-top-color:#ce93d8!important}.purple-200-border-right{border-right-color:#ce93d8!important}.purple-200-border-bottom{border-bottom-color:#ce93d8!important}.purple-200-border-left{border-left-color:#ce93d8!important}.purple-300-bg{background-color:#ba68c8!important}.md-purple-300-bg{background-color:#ba68c8!important;color:#fff}.purple-300-fg{color:#ba68c8!important}.purple-300-border{border-color:#ba68c8!important}.purple-300-border-top{border-top-color:#ba68c8!important}.purple-300-border-right{border-right-color:#ba68c8!important}.purple-300-border-bottom{border-bottom-color:#ba68c8!important}.purple-300-border-left{border-left-color:#ba68c8!important}.purple-400-bg{background-color:#ab47bc!important}.md-purple-400-bg{background-color:#ab47bc!important;color:#fff}.purple-400-fg{color:#ab47bc!important}.purple-400-border{border-color:#ab47bc!important}.purple-400-border-top{border-top-color:#ab47bc!important}.purple-400-border-right{border-right-color:#ab47bc!important}.purple-400-border-bottom{border-bottom-color:#ab47bc!important}.purple-400-border-left{border-left-color:#ab47bc!important}.purple-500-bg{background-color:#9c27b0!important}.md-purple-500-bg{background-color:#9c27b0!important;color:rgba(255,255,255,.87)}.purple-500-fg{color:#9c27b0!important}.purple-500-border{border-color:#9c27b0!important}.purple-500-border-top{border-top-color:#9c27b0!important}.purple-500-border-right{border-right-color:#9c27b0!important}.purple-500-border-bottom{border-bottom-color:#9c27b0!important}.purple-500-border-left{border-left-color:#9c27b0!important}.md-purple-bg{background-color:#9c27b0!important;color:rgba(255,255,255,.87)}.purple-bg{background-color:#9c27b0!important}.purple-fg{color:#9c27b0!important}.purple-border{border-color:#9c27b0!important}.purple-border-top{border-top-color:#9c27b0!important}.purple-border-right{border-right-color:#9c27b0!important}.purple-border-bottom{border-bottom-color:#9c27b0!important}.purple-border-left{border-left-color:#9c27b0!important}.purple-600-bg{background-color:#8e24aa!important}.md-purple-600-bg{background-color:#8e24aa!important;color:rgba(255,255,255,.87)}.purple-600-fg{color:#8e24aa!important}.purple-600-border{border-color:#8e24aa!important}.purple-600-border-top{border-top-color:#8e24aa!important}.purple-600-border-right{border-right-color:#8e24aa!important}.purple-600-border-bottom{border-bottom-color:#8e24aa!important}.purple-600-border-left{border-left-color:#8e24aa!important}.purple-700-bg{background-color:#7b1fa2!important}.md-purple-700-bg{background-color:#7b1fa2!important;color:rgba(255,255,255,.87)}.purple-700-fg{color:#7b1fa2!important}.purple-700-border{border-color:#7b1fa2!important}.purple-700-border-top{border-top-color:#7b1fa2!important}.purple-700-border-right{border-right-color:#7b1fa2!important}.purple-700-border-bottom{border-bottom-color:#7b1fa2!important}.purple-700-border-left{border-left-color:#7b1fa2!important}.purple-800-bg{background-color:#6a1b9a!important}.md-purple-800-bg{background-color:#6a1b9a!important;color:rgba(255,255,255,.87)}.purple-800-fg{color:#6a1b9a!important}.purple-800-border{border-color:#6a1b9a!important}.purple-800-border-top{border-top-color:#6a1b9a!important}.purple-800-border-right{border-right-color:#6a1b9a!important}.purple-800-border-bottom{border-bottom-color:#6a1b9a!important}.purple-800-border-left{border-left-color:#6a1b9a!important}.purple-900-bg{background-color:#4a148c!important}.md-purple-900-bg{background-color:#4a148c!important;color:rgba(255,255,255,.87)}.purple-900-fg{color:#4a148c!important}.purple-900-border{border-color:#4a148c!important}.purple-900-border-top{border-top-color:#4a148c!important}.purple-900-border-right{border-right-color:#4a148c!important}.purple-900-border-bottom{border-bottom-color:#4a148c!important}.purple-900-border-left{border-left-color:#4a148c!important}.purple-A100-bg{background-color:#ea80fc!important}.md-purple-A100-bg{background-color:#ea80fc!important;color:rgba(0,0,0,.87)}.purple-A100-fg{color:#ea80fc!important}.purple-A100-border{border-color:#ea80fc!important}.purple-A100-border-top{border-top-color:#ea80fc!important}.purple-A100-border-right{border-right-color:#ea80fc!important}.purple-A100-border-bottom{border-bottom-color:#ea80fc!important}.purple-A100-border-left{border-left-color:#ea80fc!important}.purple-A200-bg{background-color:#e040fb!important}.md-purple-A200-bg{background-color:#e040fb!important;color:#fff}.purple-A200-fg{color:#e040fb!important}.purple-A200-border{border-color:#e040fb!important}.purple-A200-border-top{border-top-color:#e040fb!important}.purple-A200-border-right{border-right-color:#e040fb!important}.purple-A200-border-bottom{border-bottom-color:#e040fb!important}.purple-A200-border-left{border-left-color:#e040fb!important}.purple-A400-bg{background-color:#d500f9!important}.md-purple-A400-bg{background-color:#d500f9!important;color:#fff}.purple-A400-fg{color:#d500f9!important}.purple-A400-border{border-color:#d500f9!important}.purple-A400-border-top{border-top-color:#d500f9!important}.purple-A400-border-right{border-right-color:#d500f9!important}.purple-A400-border-bottom{border-bottom-color:#d500f9!important}.purple-A400-border-left{border-left-color:#d500f9!important}.purple-A700-bg{background-color:#a0f!important}.md-purple-A700-bg{background-color:#a0f!important;color:#fff}.purple-A700-fg{color:#a0f!important}.purple-A700-border{border-color:#a0f!important}.purple-A700-border-top{border-top-color:#a0f!important}.purple-A700-border-right{border-right-color:#a0f!important}.purple-A700-border-bottom{border-bottom-color:#a0f!important}.purple-A700-border-left{border-left-color:#a0f!important}.deep-purple-50-bg{background-color:#ede7f6!important}.md-deep-purple-50-bg{background-color:#ede7f6!important;color:rgba(0,0,0,.87)}.deep-purple-50-fg{color:#ede7f6!important}.deep-purple-50-border{border-color:#ede7f6!important}.deep-purple-50-border-top{border-top-color:#ede7f6!important}.deep-purple-50-border-right{border-right-color:#ede7f6!important}.deep-purple-50-border-bottom{border-bottom-color:#ede7f6!important}.deep-purple-50-border-left{border-left-color:#ede7f6!important}.deep-purple-100-bg{background-color:#d1c4e9!important}.md-deep-purple-100-bg{background-color:#d1c4e9!important;color:rgba(0,0,0,.87)}.deep-purple-100-fg{color:#d1c4e9!important}.deep-purple-100-border{border-color:#d1c4e9!important}.deep-purple-100-border-top{border-top-color:#d1c4e9!important}.deep-purple-100-border-right{border-right-color:#d1c4e9!important}.deep-purple-100-border-bottom{border-bottom-color:#d1c4e9!important}.deep-purple-100-border-left{border-left-color:#d1c4e9!important}.deep-purple-200-bg{background-color:#b39ddb!important}.md-deep-purple-200-bg{background-color:#b39ddb!important;color:rgba(0,0,0,.87)}.deep-purple-200-fg{color:#b39ddb!important}.deep-purple-200-border{border-color:#b39ddb!important}.deep-purple-200-border-top{border-top-color:#b39ddb!important}.deep-purple-200-border-right{border-right-color:#b39ddb!important}.deep-purple-200-border-bottom{border-bottom-color:#b39ddb!important}.deep-purple-200-border-left{border-left-color:#b39ddb!important}.deep-purple-300-bg{background-color:#9575cd!important}.md-deep-purple-300-bg{background-color:#9575cd!important;color:#fff}.deep-purple-300-fg{color:#9575cd!important}.deep-purple-300-border{border-color:#9575cd!important}.deep-purple-300-border-top{border-top-color:#9575cd!important}.deep-purple-300-border-right{border-right-color:#9575cd!important}.deep-purple-300-border-bottom{border-bottom-color:#9575cd!important}.deep-purple-300-border-left{border-left-color:#9575cd!important}.deep-purple-400-bg{background-color:#7e57c2!important}.md-deep-purple-400-bg{background-color:#7e57c2!important;color:#fff}.deep-purple-400-fg{color:#7e57c2!important}.deep-purple-400-border{border-color:#7e57c2!important}.deep-purple-400-border-top{border-top-color:#7e57c2!important}.deep-purple-400-border-right{border-right-color:#7e57c2!important}.deep-purple-400-border-bottom{border-bottom-color:#7e57c2!important}.deep-purple-400-border-left{border-left-color:#7e57c2!important}.deep-purple-500-bg{background-color:#673ab7!important}.md-deep-purple-500-bg{background-color:#673ab7!important;color:rgba(255,255,255,.87)}.deep-purple-500-fg{color:#673ab7!important}.deep-purple-500-border{border-color:#673ab7!important}.deep-purple-500-border-top{border-top-color:#673ab7!important}.deep-purple-500-border-right{border-right-color:#673ab7!important}.deep-purple-500-border-bottom{border-bottom-color:#673ab7!important}.deep-purple-500-border-left{border-left-color:#673ab7!important}.md-deep-purple-bg{background-color:#673ab7!important;color:rgba(255,255,255,.87)}.deep-purple-bg{background-color:#673ab7!important}.deep-purple-fg{color:#673ab7!important}.deep-purple-border{border-color:#673ab7!important}.deep-purple-border-top{border-top-color:#673ab7!important}.deep-purple-border-right{border-right-color:#673ab7!important}.deep-purple-border-bottom{border-bottom-color:#673ab7!important}.deep-purple-border-left{border-left-color:#673ab7!important}.deep-purple-600-bg{background-color:#5e35b1!important}.md-deep-purple-600-bg{background-color:#5e35b1!important;color:rgba(255,255,255,.87)}.deep-purple-600-fg{color:#5e35b1!important}.deep-purple-600-border{border-color:#5e35b1!important}.deep-purple-600-border-top{border-top-color:#5e35b1!important}.deep-purple-600-border-right{border-right-color:#5e35b1!important}.deep-purple-600-border-bottom{border-bottom-color:#5e35b1!important}.deep-purple-600-border-left{border-left-color:#5e35b1!important}.deep-purple-700-bg{background-color:#512da8!important}.md-deep-purple-700-bg{background-color:#512da8!important;color:rgba(255,255,255,.87)}.deep-purple-700-fg{color:#512da8!important}.deep-purple-700-border{border-color:#512da8!important}.deep-purple-700-border-top{border-top-color:#512da8!important}.deep-purple-700-border-right{border-right-color:#512da8!important}.deep-purple-700-border-bottom{border-bottom-color:#512da8!important}.deep-purple-700-border-left{border-left-color:#512da8!important}.deep-purple-800-bg{background-color:#4527a0!important}.md-deep-purple-800-bg{background-color:#4527a0!important;color:rgba(255,255,255,.87)}.deep-purple-800-fg{color:#4527a0!important}.deep-purple-800-border{border-color:#4527a0!important}.deep-purple-800-border-top{border-top-color:#4527a0!important}.deep-purple-800-border-right{border-right-color:#4527a0!important}.deep-purple-800-border-bottom{border-bottom-color:#4527a0!important}.deep-purple-800-border-left{border-left-color:#4527a0!important}.deep-purple-900-bg{background-color:#311b92!important}.md-deep-purple-900-bg{background-color:#311b92!important;color:rgba(255,255,255,.87)}.deep-purple-900-fg{color:#311b92!important}.deep-purple-900-border{border-color:#311b92!important}.deep-purple-900-border-top{border-top-color:#311b92!important}.deep-purple-900-border-right{border-right-color:#311b92!important}.deep-purple-900-border-bottom{border-bottom-color:#311b92!important}.deep-purple-900-border-left{border-left-color:#311b92!important}.deep-purple-A100-bg{background-color:#b388ff!important}.md-deep-purple-A100-bg{background-color:#b388ff!important;color:rgba(0,0,0,.87)}.deep-purple-A100-fg{color:#b388ff!important}.deep-purple-A100-border{border-color:#b388ff!important}.deep-purple-A100-border-top{border-top-color:#b388ff!important}.deep-purple-A100-border-right{border-right-color:#b388ff!important}.deep-purple-A100-border-bottom{border-bottom-color:#b388ff!important}.deep-purple-A100-border-left{border-left-color:#b388ff!important}.deep-purple-A200-bg{background-color:#7c4dff!important}.md-deep-purple-A200-bg{background-color:#7c4dff!important;color:#fff}.deep-purple-A200-fg{color:#7c4dff!important}.deep-purple-A200-border{border-color:#7c4dff!important}.deep-purple-A200-border-top{border-top-color:#7c4dff!important}.deep-purple-A200-border-right{border-right-color:#7c4dff!important}.deep-purple-A200-border-bottom{border-bottom-color:#7c4dff!important}.deep-purple-A200-border-left{border-left-color:#7c4dff!important}.deep-purple-A400-bg{background-color:#651fff!important}.md-deep-purple-A400-bg{background-color:#651fff!important;color:rgba(255,255,255,.87)}.deep-purple-A400-fg{color:#651fff!important}.deep-purple-A400-border{border-color:#651fff!important}.deep-purple-A400-border-top{border-top-color:#651fff!important}.deep-purple-A400-border-right{border-right-color:#651fff!important}.deep-purple-A400-border-bottom{border-bottom-color:#651fff!important}.deep-purple-A400-border-left{border-left-color:#651fff!important}.deep-purple-A700-bg{background-color:#6200ea!important}.md-deep-purple-A700-bg{background-color:#6200ea!important;color:rgba(255,255,255,.87)}.deep-purple-A700-fg{color:#6200ea!important}.deep-purple-A700-border{border-color:#6200ea!important}.deep-purple-A700-border-top{border-top-color:#6200ea!important}.deep-purple-A700-border-right{border-right-color:#6200ea!important}.deep-purple-A700-border-bottom{border-bottom-color:#6200ea!important}.deep-purple-A700-border-left{border-left-color:#6200ea!important}.indigo-50-bg{background-color:#e8eaf6!important}.md-indigo-50-bg{background-color:#e8eaf6!important;color:rgba(0,0,0,.87)}.indigo-50-fg{color:#e8eaf6!important}.indigo-50-border{border-color:#e8eaf6!important}.indigo-50-border-top{border-top-color:#e8eaf6!important}.indigo-50-border-right{border-right-color:#e8eaf6!important}.indigo-50-border-bottom{border-bottom-color:#e8eaf6!important}.indigo-50-border-left{border-left-color:#e8eaf6!important}.indigo-100-bg{background-color:#c5cae9!important}.md-indigo-100-bg{background-color:#c5cae9!important;color:rgba(0,0,0,.87)}.indigo-100-fg{color:#c5cae9!important}.indigo-100-border{border-color:#c5cae9!important}.indigo-100-border-top{border-top-color:#c5cae9!important}.indigo-100-border-right{border-right-color:#c5cae9!important}.indigo-100-border-bottom{border-bottom-color:#c5cae9!important}.indigo-100-border-left{border-left-color:#c5cae9!important}.indigo-200-bg{background-color:#9fa8da!important}.md-indigo-200-bg{background-color:#9fa8da!important;color:rgba(0,0,0,.87)}.indigo-200-fg{color:#9fa8da!important}.indigo-200-border{border-color:#9fa8da!important}.indigo-200-border-top{border-top-color:#9fa8da!important}.indigo-200-border-right{border-right-color:#9fa8da!important}.indigo-200-border-bottom{border-bottom-color:#9fa8da!important}.indigo-200-border-left{border-left-color:#9fa8da!important}.indigo-300-bg{background-color:#7986cb!important}.md-indigo-300-bg{background-color:#7986cb!important;color:#fff}.indigo-300-fg{color:#7986cb!important}.indigo-300-border{border-color:#7986cb!important}.indigo-300-border-top{border-top-color:#7986cb!important}.indigo-300-border-right{border-right-color:#7986cb!important}.indigo-300-border-bottom{border-bottom-color:#7986cb!important}.indigo-300-border-left{border-left-color:#7986cb!important}.indigo-400-bg{background-color:#5c6bc0!important}.md-indigo-400-bg{background-color:#5c6bc0!important;color:#fff}.indigo-400-fg{color:#5c6bc0!important}.indigo-400-border{border-color:#5c6bc0!important}.indigo-400-border-top{border-top-color:#5c6bc0!important}.indigo-400-border-right{border-right-color:#5c6bc0!important}.indigo-400-border-bottom{border-bottom-color:#5c6bc0!important}.indigo-400-border-left{border-left-color:#5c6bc0!important}.indigo-500-bg{background-color:#3f51b5!important}.md-indigo-500-bg{background-color:#3f51b5!important;color:rgba(255,255,255,.87)}.indigo-500-fg{color:#3f51b5!important}.indigo-500-border{border-color:#3f51b5!important}.indigo-500-border-top{border-top-color:#3f51b5!important}.indigo-500-border-right{border-right-color:#3f51b5!important}.indigo-500-border-bottom{border-bottom-color:#3f51b5!important}.indigo-500-border-left{border-left-color:#3f51b5!important}.md-indigo-bg{background-color:#3f51b5!important;color:rgba(255,255,255,.87)}.indigo-bg{background-color:#3f51b5!important}.indigo-fg{color:#3f51b5!important}.indigo-border{border-color:#3f51b5!important}.indigo-border-top{border-top-color:#3f51b5!important}.indigo-border-right{border-right-color:#3f51b5!important}.indigo-border-bottom{border-bottom-color:#3f51b5!important}.indigo-border-left{border-left-color:#3f51b5!important}.indigo-600-bg{background-color:#3949ab!important}.md-indigo-600-bg{background-color:#3949ab!important;color:rgba(255,255,255,.87)}.indigo-600-fg{color:#3949ab!important}.indigo-600-border{border-color:#3949ab!important}.indigo-600-border-top{border-top-color:#3949ab!important}.indigo-600-border-right{border-right-color:#3949ab!important}.indigo-600-border-bottom{border-bottom-color:#3949ab!important}.indigo-600-border-left{border-left-color:#3949ab!important}.indigo-700-bg{background-color:#303f9f!important}.md-indigo-700-bg{background-color:#303f9f!important;color:rgba(255,255,255,.87)}.indigo-700-fg{color:#303f9f!important}.indigo-700-border{border-color:#303f9f!important}.indigo-700-border-top{border-top-color:#303f9f!important}.indigo-700-border-right{border-right-color:#303f9f!important}.indigo-700-border-bottom{border-bottom-color:#303f9f!important}.indigo-700-border-left{border-left-color:#303f9f!important}.indigo-800-bg{background-color:#283593!important}.md-indigo-800-bg{background-color:#283593!important;color:rgba(255,255,255,.87)}.indigo-800-fg{color:#283593!important}.indigo-800-border{border-color:#283593!important}.indigo-800-border-top{border-top-color:#283593!important}.indigo-800-border-right{border-right-color:#283593!important}.indigo-800-border-bottom{border-bottom-color:#283593!important}.indigo-800-border-left{border-left-color:#283593!important}.indigo-900-bg{background-color:#1a237e!important}.md-indigo-900-bg{background-color:#1a237e!important;color:rgba(255,255,255,.87)}.indigo-900-fg{color:#1a237e!important}.indigo-900-border{border-color:#1a237e!important}.indigo-900-border-top{border-top-color:#1a237e!important}.indigo-900-border-right{border-right-color:#1a237e!important}.indigo-900-border-bottom{border-bottom-color:#1a237e!important}.indigo-900-border-left{border-left-color:#1a237e!important}.indigo-A100-bg{background-color:#8c9eff!important}.md-indigo-A100-bg{background-color:#8c9eff!important;color:rgba(0,0,0,.87)}.indigo-A100-fg{color:#8c9eff!important}.indigo-A100-border{border-color:#8c9eff!important}.indigo-A100-border-top{border-top-color:#8c9eff!important}.indigo-A100-border-right{border-right-color:#8c9eff!important}.indigo-A100-border-bottom{border-bottom-color:#8c9eff!important}.indigo-A100-border-left{border-left-color:#8c9eff!important}.indigo-A200-bg{background-color:#536dfe!important}.md-indigo-A200-bg{background-color:#536dfe!important;color:#fff}.indigo-A200-fg{color:#536dfe!important}.indigo-A200-border{border-color:#536dfe!important}.indigo-A200-border-top{border-top-color:#536dfe!important}.indigo-A200-border-right{border-right-color:#536dfe!important}.indigo-A200-border-bottom{border-bottom-color:#536dfe!important}.indigo-A200-border-left{border-left-color:#536dfe!important}.indigo-A400-bg{background-color:#3d5afe!important}.md-indigo-A400-bg{background-color:#3d5afe!important;color:#fff}.indigo-A400-fg{color:#3d5afe!important}.indigo-A400-border{border-color:#3d5afe!important}.indigo-A400-border-top{border-top-color:#3d5afe!important}.indigo-A400-border-right{border-right-color:#3d5afe!important}.indigo-A400-border-bottom{border-bottom-color:#3d5afe!important}.indigo-A400-border-left{border-left-color:#3d5afe!important}.indigo-A700-bg{background-color:#304ffe!important}.md-indigo-A700-bg{background-color:#304ffe!important;color:rgba(255,255,255,.87)}.indigo-A700-fg{color:#304ffe!important}.indigo-A700-border{border-color:#304ffe!important}.indigo-A700-border-top{border-top-color:#304ffe!important}.indigo-A700-border-right{border-right-color:#304ffe!important}.indigo-A700-border-bottom{border-bottom-color:#304ffe!important}.indigo-A700-border-left{border-left-color:#304ffe!important}.blue-50-bg{background-color:#e3f2fd!important}.md-blue-50-bg{background-color:#e3f2fd!important;color:rgba(0,0,0,.87)}.blue-50-fg{color:#e3f2fd!important}.blue-50-border{border-color:#e3f2fd!important}.blue-50-border-top{border-top-color:#e3f2fd!important}.blue-50-border-right{border-right-color:#e3f2fd!important}.blue-50-border-bottom{border-bottom-color:#e3f2fd!important}.blue-50-border-left{border-left-color:#e3f2fd!important}.blue-100-bg{background-color:#bbdefb!important}.md-blue-100-bg{background-color:#bbdefb!important;color:rgba(0,0,0,.87)}.blue-100-fg{color:#bbdefb!important}.blue-100-border{border-color:#bbdefb!important}.blue-100-border-top{border-top-color:#bbdefb!important}.blue-100-border-right{border-right-color:#bbdefb!important}.blue-100-border-bottom{border-bottom-color:#bbdefb!important}.blue-100-border-left{border-left-color:#bbdefb!important}.blue-200-bg{background-color:#90caf9!important}.md-blue-200-bg{background-color:#90caf9!important;color:rgba(0,0,0,.87)}.blue-200-fg{color:#90caf9!important}.blue-200-border{border-color:#90caf9!important}.blue-200-border-top{border-top-color:#90caf9!important}.blue-200-border-right{border-right-color:#90caf9!important}.blue-200-border-bottom{border-bottom-color:#90caf9!important}.blue-200-border-left{border-left-color:#90caf9!important}.blue-300-bg{background-color:#64b5f6!important}.md-blue-300-bg{background-color:#64b5f6!important;color:rgba(0,0,0,.87)}.blue-300-fg{color:#64b5f6!important}.blue-300-border{border-color:#64b5f6!important}.blue-300-border-top{border-top-color:#64b5f6!important}.blue-300-border-right{border-right-color:#64b5f6!important}.blue-300-border-bottom{border-bottom-color:#64b5f6!important}.blue-300-border-left{border-left-color:#64b5f6!important}.blue-400-bg{background-color:#42a5f5!important}.md-blue-400-bg{background-color:#42a5f5!important;color:rgba(0,0,0,.87)}.blue-400-fg{color:#42a5f5!important}.blue-400-border{border-color:#42a5f5!important}.blue-400-border-top{border-top-color:#42a5f5!important}.blue-400-border-right{border-right-color:#42a5f5!important}.blue-400-border-bottom{border-bottom-color:#42a5f5!important}.blue-400-border-left{border-left-color:#42a5f5!important}.blue-500-bg{background-color:#2196f3!important}.md-blue-500-bg{background-color:#2196f3!important;color:#fff}.blue-500-fg{color:#2196f3!important}.blue-500-border{border-color:#2196f3!important}.blue-500-border-top{border-top-color:#2196f3!important}.blue-500-border-right{border-right-color:#2196f3!important}.blue-500-border-bottom{border-bottom-color:#2196f3!important}.blue-500-border-left{border-left-color:#2196f3!important}.md-blue-bg{background-color:#2196f3!important;color:#fff}.blue-bg{background-color:#2196f3!important}.blue-fg{color:#2196f3!important}.blue-border{border-color:#2196f3!important}.blue-border-top{border-top-color:#2196f3!important}.blue-border-right{border-right-color:#2196f3!important}.blue-border-bottom{border-bottom-color:#2196f3!important}.blue-border-left{border-left-color:#2196f3!important}.blue-600-bg{background-color:#1e88e5!important}.md-blue-600-bg{background-color:#1e88e5!important;color:#fff}.blue-600-fg{color:#1e88e5!important}.blue-600-border{border-color:#1e88e5!important}.blue-600-border-top{border-top-color:#1e88e5!important}.blue-600-border-right{border-right-color:#1e88e5!important}.blue-600-border-bottom{border-bottom-color:#1e88e5!important}.blue-600-border-left{border-left-color:#1e88e5!important}.blue-700-bg{background-color:#1976d2!important}.md-blue-700-bg{background-color:#1976d2!important;color:#fff}.blue-700-fg{color:#1976d2!important}.blue-700-border{border-color:#1976d2!important}.blue-700-border-top{border-top-color:#1976d2!important}.blue-700-border-right{border-right-color:#1976d2!important}.blue-700-border-bottom{border-bottom-color:#1976d2!important}.blue-700-border-left{border-left-color:#1976d2!important}.blue-800-bg{background-color:#1565c0!important}.md-blue-800-bg{background-color:#1565c0!important;color:rgba(255,255,255,.87)}.blue-800-fg{color:#1565c0!important}.blue-800-border{border-color:#1565c0!important}.blue-800-border-top{border-top-color:#1565c0!important}.blue-800-border-right{border-right-color:#1565c0!important}.blue-800-border-bottom{border-bottom-color:#1565c0!important}.blue-800-border-left{border-left-color:#1565c0!important}.blue-900-bg{background-color:#0d47a1!important}.md-blue-900-bg{background-color:#0d47a1!important;color:rgba(255,255,255,.87)}.blue-900-fg{color:#0d47a1!important}.blue-900-border{border-color:#0d47a1!important}.blue-900-border-top{border-top-color:#0d47a1!important}.blue-900-border-right{border-right-color:#0d47a1!important}.blue-900-border-bottom{border-bottom-color:#0d47a1!important}.blue-900-border-left{border-left-color:#0d47a1!important}.blue-A100-bg{background-color:#82b1ff!important}.md-blue-A100-bg{background-color:#82b1ff!important;color:rgba(0,0,0,.87)}.blue-A100-fg{color:#82b1ff!important}.blue-A100-border{border-color:#82b1ff!important}.blue-A100-border-top{border-top-color:#82b1ff!important}.blue-A100-border-right{border-right-color:#82b1ff!important}.blue-A100-border-bottom{border-bottom-color:#82b1ff!important}.blue-A100-border-left{border-left-color:#82b1ff!important}.blue-A200-bg{background-color:#448aff!important}.md-blue-A200-bg{background-color:#448aff!important;color:#fff}.blue-A200-fg{color:#448aff!important}.blue-A200-border{border-color:#448aff!important}.blue-A200-border-top{border-top-color:#448aff!important}.blue-A200-border-right{border-right-color:#448aff!important}.blue-A200-border-bottom{border-bottom-color:#448aff!important}.blue-A200-border-left{border-left-color:#448aff!important}.blue-A400-bg{background-color:#2979ff!important}.md-blue-A400-bg{background-color:#2979ff!important;color:#fff}.blue-A400-fg{color:#2979ff!important}.blue-A400-border{border-color:#2979ff!important}.blue-A400-border-top{border-top-color:#2979ff!important}.blue-A400-border-right{border-right-color:#2979ff!important}.blue-A400-border-bottom{border-bottom-color:#2979ff!important}.blue-A400-border-left{border-left-color:#2979ff!important}.blue-A700-bg{background-color:#2962ff!important}.md-blue-A700-bg{background-color:#2962ff!important;color:#fff}.blue-A700-fg{color:#2962ff!important}.blue-A700-border{border-color:#2962ff!important}.blue-A700-border-top{border-top-color:#2962ff!important}.blue-A700-border-right{border-right-color:#2962ff!important}.blue-A700-border-bottom{border-bottom-color:#2962ff!important}.blue-A700-border-left{border-left-color:#2962ff!important}.light-blue-50-bg{background-color:#e1f5fe!important}.md-light-blue-50-bg{background-color:#e1f5fe!important;color:rgba(0,0,0,.87)}.light-blue-50-fg{color:#e1f5fe!important}.light-blue-50-border{border-color:#e1f5fe!important}.light-blue-50-border-top{border-top-color:#e1f5fe!important}.light-blue-50-border-right{border-right-color:#e1f5fe!important}.light-blue-50-border-bottom{border-bottom-color:#e1f5fe!important}.light-blue-50-border-left{border-left-color:#e1f5fe!important}.light-blue-100-bg{background-color:#b3e5fc!important}.md-light-blue-100-bg{background-color:#b3e5fc!important;color:rgba(0,0,0,.87)}.light-blue-100-fg{color:#b3e5fc!important}.light-blue-100-border{border-color:#b3e5fc!important}.light-blue-100-border-top{border-top-color:#b3e5fc!important}.light-blue-100-border-right{border-right-color:#b3e5fc!important}.light-blue-100-border-bottom{border-bottom-color:#b3e5fc!important}.light-blue-100-border-left{border-left-color:#b3e5fc!important}.light-blue-200-bg{background-color:#81d4fa!important}.md-light-blue-200-bg{background-color:#81d4fa!important;color:rgba(0,0,0,.87)}.light-blue-200-fg{color:#81d4fa!important}.light-blue-200-border{border-color:#81d4fa!important}.light-blue-200-border-top{border-top-color:#81d4fa!important}.light-blue-200-border-right{border-right-color:#81d4fa!important}.light-blue-200-border-bottom{border-bottom-color:#81d4fa!important}.light-blue-200-border-left{border-left-color:#81d4fa!important}.light-blue-300-bg{background-color:#4fc3f7!important}.md-light-blue-300-bg{background-color:#4fc3f7!important;color:rgba(0,0,0,.87)}.light-blue-300-fg{color:#4fc3f7!important}.light-blue-300-border{border-color:#4fc3f7!important}.light-blue-300-border-top{border-top-color:#4fc3f7!important}.light-blue-300-border-right{border-right-color:#4fc3f7!important}.light-blue-300-border-bottom{border-bottom-color:#4fc3f7!important}.light-blue-300-border-left{border-left-color:#4fc3f7!important}.light-blue-400-bg{background-color:#29b6f6!important}.md-light-blue-400-bg{background-color:#29b6f6!important;color:rgba(0,0,0,.87)}.light-blue-400-fg{color:#29b6f6!important}.light-blue-400-border{border-color:#29b6f6!important}.light-blue-400-border-top{border-top-color:#29b6f6!important}.light-blue-400-border-right{border-right-color:#29b6f6!important}.light-blue-400-border-bottom{border-bottom-color:#29b6f6!important}.light-blue-400-border-left{border-left-color:#29b6f6!important}.light-blue-500-bg{background-color:#03a9f4!important}.md-light-blue-500-bg{background-color:#03a9f4!important;color:rgba(0,0,0,.87)}.light-blue-500-fg{color:#03a9f4!important}.light-blue-500-border{border-color:#03a9f4!important}.light-blue-500-border-top{border-top-color:#03a9f4!important}.light-blue-500-border-right{border-right-color:#03a9f4!important}.light-blue-500-border-bottom{border-bottom-color:#03a9f4!important}.light-blue-500-border-left{border-left-color:#03a9f4!important}.md-light-blue-bg{background-color:#03a9f4!important;color:rgba(0,0,0,.87)}.light-blue-bg{background-color:#03a9f4!important}.light-blue-fg{color:#03a9f4!important}.light-blue-border{border-color:#03a9f4!important}.light-blue-border-top{border-top-color:#03a9f4!important}.light-blue-border-right{border-right-color:#03a9f4!important}.light-blue-border-bottom{border-bottom-color:#03a9f4!important}.light-blue-border-left{border-left-color:#03a9f4!important}.light-blue-600-bg{background-color:#039be5!important}.md-light-blue-600-bg{background-color:#039be5!important;color:#fff}.light-blue-600-fg{color:#039be5!important}.light-blue-600-border{border-color:#039be5!important}.light-blue-600-border-top{border-top-color:#039be5!important}.light-blue-600-border-right{border-right-color:#039be5!important}.light-blue-600-border-bottom{border-bottom-color:#039be5!important}.light-blue-600-border-left{border-left-color:#039be5!important}.light-blue-700-bg{background-color:#0288d1!important}.md-light-blue-700-bg{background-color:#0288d1!important;color:#fff}.light-blue-700-fg{color:#0288d1!important}.light-blue-700-border{border-color:#0288d1!important}.light-blue-700-border-top{border-top-color:#0288d1!important}.light-blue-700-border-right{border-right-color:#0288d1!important}.light-blue-700-border-bottom{border-bottom-color:#0288d1!important}.light-blue-700-border-left{border-left-color:#0288d1!important}.light-blue-800-bg{background-color:#0277bd!important}.md-light-blue-800-bg{background-color:#0277bd!important;color:#fff}.light-blue-800-fg{color:#0277bd!important}.light-blue-800-border{border-color:#0277bd!important}.light-blue-800-border-top{border-top-color:#0277bd!important}.light-blue-800-border-right{border-right-color:#0277bd!important}.light-blue-800-border-bottom{border-bottom-color:#0277bd!important}.light-blue-800-border-left{border-left-color:#0277bd!important}.light-blue-900-bg{background-color:#01579b!important}.md-light-blue-900-bg{background-color:#01579b!important;color:#fff}.light-blue-900-fg{color:#01579b!important}.light-blue-900-border{border-color:#01579b!important}.light-blue-900-border-top{border-top-color:#01579b!important}.light-blue-900-border-right{border-right-color:#01579b!important}.light-blue-900-border-bottom{border-bottom-color:#01579b!important}.light-blue-900-border-left{border-left-color:#01579b!important}.light-blue-A100-bg{background-color:#80d8ff!important}.md-light-blue-A100-bg{background-color:#80d8ff!important;color:rgba(0,0,0,.87)}.light-blue-A100-fg{color:#80d8ff!important}.light-blue-A100-border{border-color:#80d8ff!important}.light-blue-A100-border-top{border-top-color:#80d8ff!important}.light-blue-A100-border-right{border-right-color:#80d8ff!important}.light-blue-A100-border-bottom{border-bottom-color:#80d8ff!important}.light-blue-A100-border-left{border-left-color:#80d8ff!important}.light-blue-A200-bg{background-color:#40c4ff!important}.md-light-blue-A200-bg{background-color:#40c4ff!important;color:rgba(0,0,0,.87)}.light-blue-A200-fg{color:#40c4ff!important}.light-blue-A200-border{border-color:#40c4ff!important}.light-blue-A200-border-top{border-top-color:#40c4ff!important}.light-blue-A200-border-right{border-right-color:#40c4ff!important}.light-blue-A200-border-bottom{border-bottom-color:#40c4ff!important}.light-blue-A200-border-left{border-left-color:#40c4ff!important}.light-blue-A400-bg{background-color:#00b0ff!important}.md-light-blue-A400-bg{background-color:#00b0ff!important;color:rgba(0,0,0,.87)}.light-blue-A400-fg{color:#00b0ff!important}.light-blue-A400-border{border-color:#00b0ff!important}.light-blue-A400-border-top{border-top-color:#00b0ff!important}.light-blue-A400-border-right{border-right-color:#00b0ff!important}.light-blue-A400-border-bottom{border-bottom-color:#00b0ff!important}.light-blue-A400-border-left{border-left-color:#00b0ff!important}.light-blue-A700-bg{background-color:#0091ea!important}.md-light-blue-A700-bg{background-color:#0091ea!important;color:#fff}.light-blue-A700-fg{color:#0091ea!important}.light-blue-A700-border{border-color:#0091ea!important}.light-blue-A700-border-top{border-top-color:#0091ea!important}.light-blue-A700-border-right{border-right-color:#0091ea!important}.light-blue-A700-border-bottom{border-bottom-color:#0091ea!important}.light-blue-A700-border-left{border-left-color:#0091ea!important}.cyan-50-bg{background-color:#e0f7fa!important}.md-cyan-50-bg{background-color:#e0f7fa!important;color:rgba(0,0,0,.87)}.cyan-50-fg{color:#e0f7fa!important}.cyan-50-border{border-color:#e0f7fa!important}.cyan-50-border-top{border-top-color:#e0f7fa!important}.cyan-50-border-right{border-right-color:#e0f7fa!important}.cyan-50-border-bottom{border-bottom-color:#e0f7fa!important}.cyan-50-border-left{border-left-color:#e0f7fa!important}.cyan-100-bg{background-color:#b2ebf2!important}.md-cyan-100-bg{background-color:#b2ebf2!important;color:rgba(0,0,0,.87)}.cyan-100-fg{color:#b2ebf2!important}.cyan-100-border{border-color:#b2ebf2!important}.cyan-100-border-top{border-top-color:#b2ebf2!important}.cyan-100-border-right{border-right-color:#b2ebf2!important}.cyan-100-border-bottom{border-bottom-color:#b2ebf2!important}.cyan-100-border-left{border-left-color:#b2ebf2!important}.cyan-200-bg{background-color:#80deea!important}.md-cyan-200-bg{background-color:#80deea!important;color:rgba(0,0,0,.87)}.cyan-200-fg{color:#80deea!important}.cyan-200-border{border-color:#80deea!important}.cyan-200-border-top{border-top-color:#80deea!important}.cyan-200-border-right{border-right-color:#80deea!important}.cyan-200-border-bottom{border-bottom-color:#80deea!important}.cyan-200-border-left{border-left-color:#80deea!important}.cyan-300-bg{background-color:#4dd0e1!important}.md-cyan-300-bg{background-color:#4dd0e1!important;color:rgba(0,0,0,.87)}.cyan-300-fg{color:#4dd0e1!important}.cyan-300-border{border-color:#4dd0e1!important}.cyan-300-border-top{border-top-color:#4dd0e1!important}.cyan-300-border-right{border-right-color:#4dd0e1!important}.cyan-300-border-bottom{border-bottom-color:#4dd0e1!important}.cyan-300-border-left{border-left-color:#4dd0e1!important}.cyan-400-bg{background-color:#26c6da!important}.md-cyan-400-bg{background-color:#26c6da!important;color:rgba(0,0,0,.87)}.cyan-400-fg{color:#26c6da!important}.cyan-400-border{border-color:#26c6da!important}.cyan-400-border-top{border-top-color:#26c6da!important}.cyan-400-border-right{border-right-color:#26c6da!important}.cyan-400-border-bottom{border-bottom-color:#26c6da!important}.cyan-400-border-left{border-left-color:#26c6da!important}.cyan-500-bg{background-color:#00bcd4!important}.md-cyan-500-bg{background-color:#00bcd4!important;color:rgba(0,0,0,.87)}.cyan-500-fg{color:#00bcd4!important}.cyan-500-border{border-color:#00bcd4!important}.cyan-500-border-top{border-top-color:#00bcd4!important}.cyan-500-border-right{border-right-color:#00bcd4!important}.cyan-500-border-bottom{border-bottom-color:#00bcd4!important}.cyan-500-border-left{border-left-color:#00bcd4!important}.md-cyan-bg{background-color:#00bcd4!important;color:rgba(0,0,0,.87)}.cyan-bg{background-color:#00bcd4!important}.cyan-fg{color:#00bcd4!important}.cyan-border{border-color:#00bcd4!important}.cyan-border-top{border-top-color:#00bcd4!important}.cyan-border-right{border-right-color:#00bcd4!important}.cyan-border-bottom{border-bottom-color:#00bcd4!important}.cyan-border-left{border-left-color:#00bcd4!important}.cyan-600-bg{background-color:#00acc1!important}.md-cyan-600-bg{background-color:#00acc1!important;color:rgba(0,0,0,.87)}.cyan-600-fg{color:#00acc1!important}.cyan-600-border{border-color:#00acc1!important}.cyan-600-border-top{border-top-color:#00acc1!important}.cyan-600-border-right{border-right-color:#00acc1!important}.cyan-600-border-bottom{border-bottom-color:#00acc1!important}.cyan-600-border-left{border-left-color:#00acc1!important}.cyan-700-bg{background-color:#0097a7!important}.md-cyan-700-bg{background-color:#0097a7!important;color:#fff}.cyan-700-fg{color:#0097a7!important}.cyan-700-border{border-color:#0097a7!important}.cyan-700-border-top{border-top-color:#0097a7!important}.cyan-700-border-right{border-right-color:#0097a7!important}.cyan-700-border-bottom{border-bottom-color:#0097a7!important}.cyan-700-border-left{border-left-color:#0097a7!important}.cyan-800-bg{background-color:#00838f!important}.md-cyan-800-bg{background-color:#00838f!important;color:#fff}.cyan-800-fg{color:#00838f!important}.cyan-800-border{border-color:#00838f!important}.cyan-800-border-top{border-top-color:#00838f!important}.cyan-800-border-right{border-right-color:#00838f!important}.cyan-800-border-bottom{border-bottom-color:#00838f!important}.cyan-800-border-left{border-left-color:#00838f!important}.cyan-900-bg{background-color:#006064!important}.md-cyan-900-bg{background-color:#006064!important;color:#fff}.cyan-900-fg{color:#006064!important}.cyan-900-border{border-color:#006064!important}.cyan-900-border-top{border-top-color:#006064!important}.cyan-900-border-right{border-right-color:#006064!important}.cyan-900-border-bottom{border-bottom-color:#006064!important}.cyan-900-border-left{border-left-color:#006064!important}.cyan-A100-bg{background-color:#84ffff!important}.md-cyan-A100-bg{background-color:#84ffff!important;color:rgba(0,0,0,.87)}.cyan-A100-fg{color:#84ffff!important}.cyan-A100-border{border-color:#84ffff!important}.cyan-A100-border-top{border-top-color:#84ffff!important}.cyan-A100-border-right{border-right-color:#84ffff!important}.cyan-A100-border-bottom{border-bottom-color:#84ffff!important}.cyan-A100-border-left{border-left-color:#84ffff!important}.cyan-A200-bg{background-color:#18ffff!important}.md-cyan-A200-bg{background-color:#18ffff!important;color:rgba(0,0,0,.87)}.cyan-A200-fg{color:#18ffff!important}.cyan-A200-border{border-color:#18ffff!important}.cyan-A200-border-top{border-top-color:#18ffff!important}.cyan-A200-border-right{border-right-color:#18ffff!important}.cyan-A200-border-bottom{border-bottom-color:#18ffff!important}.cyan-A200-border-left{border-left-color:#18ffff!important}.cyan-A400-bg{background-color:#00e5ff!important}.md-cyan-A400-bg{background-color:#00e5ff!important;color:rgba(0,0,0,.87)}.cyan-A400-fg{color:#00e5ff!important}.cyan-A400-border{border-color:#00e5ff!important}.cyan-A400-border-top{border-top-color:#00e5ff!important}.cyan-A400-border-right{border-right-color:#00e5ff!important}.cyan-A400-border-bottom{border-bottom-color:#00e5ff!important}.cyan-A400-border-left{border-left-color:#00e5ff!important}.cyan-A700-bg{background-color:#00b8d4!important}.md-cyan-A700-bg{background-color:#00b8d4!important;color:rgba(0,0,0,.87)}.cyan-A700-fg{color:#00b8d4!important}.cyan-A700-border{border-color:#00b8d4!important}.cyan-A700-border-top{border-top-color:#00b8d4!important}.cyan-A700-border-right{border-right-color:#00b8d4!important}.cyan-A700-border-bottom{border-bottom-color:#00b8d4!important}.cyan-A700-border-left{border-left-color:#00b8d4!important}.teal-50-bg{background-color:#e0f2f1!important}.md-teal-50-bg{background-color:#e0f2f1!important;color:rgba(0,0,0,.87)}.teal-50-fg{color:#e0f2f1!important}.teal-50-border{border-color:#e0f2f1!important}.teal-50-border-top{border-top-color:#e0f2f1!important}.teal-50-border-right{border-right-color:#e0f2f1!important}.teal-50-border-bottom{border-bottom-color:#e0f2f1!important}.teal-50-border-left{border-left-color:#e0f2f1!important}.teal-100-bg{background-color:#b2dfdb!important}.md-teal-100-bg{background-color:#b2dfdb!important;color:rgba(0,0,0,.87)}.teal-100-fg{color:#b2dfdb!important}.teal-100-border{border-color:#b2dfdb!important}.teal-100-border-top{border-top-color:#b2dfdb!important}.teal-100-border-right{border-right-color:#b2dfdb!important}.teal-100-border-bottom{border-bottom-color:#b2dfdb!important}.teal-100-border-left{border-left-color:#b2dfdb!important}.teal-200-bg{background-color:#80cbc4!important}.md-teal-200-bg{background-color:#80cbc4!important;color:rgba(0,0,0,.87)}.teal-200-fg{color:#80cbc4!important}.teal-200-border{border-color:#80cbc4!important}.teal-200-border-top{border-top-color:#80cbc4!important}.teal-200-border-right{border-right-color:#80cbc4!important}.teal-200-border-bottom{border-bottom-color:#80cbc4!important}.teal-200-border-left{border-left-color:#80cbc4!important}.teal-300-bg{background-color:#4db6ac!important}.md-teal-300-bg{background-color:#4db6ac!important;color:rgba(0,0,0,.87)}.teal-300-fg{color:#4db6ac!important}.teal-300-border{border-color:#4db6ac!important}.teal-300-border-top{border-top-color:#4db6ac!important}.teal-300-border-right{border-right-color:#4db6ac!important}.teal-300-border-bottom{border-bottom-color:#4db6ac!important}.teal-300-border-left{border-left-color:#4db6ac!important}.teal-400-bg{background-color:#26a69a!important}.md-teal-400-bg{background-color:#26a69a!important;color:rgba(0,0,0,.87)}.teal-400-fg{color:#26a69a!important}.teal-400-border{border-color:#26a69a!important}.teal-400-border-top{border-top-color:#26a69a!important}.teal-400-border-right{border-right-color:#26a69a!important}.teal-400-border-bottom{border-bottom-color:#26a69a!important}.teal-400-border-left{border-left-color:#26a69a!important}.teal-500-bg{background-color:#009688!important}.md-teal-500-bg{background-color:#009688!important;color:#fff}.teal-500-fg{color:#009688!important}.teal-500-border{border-color:#009688!important}.teal-500-border-top{border-top-color:#009688!important}.teal-500-border-right{border-right-color:#009688!important}.teal-500-border-bottom{border-bottom-color:#009688!important}.teal-500-border-left{border-left-color:#009688!important}.md-teal-bg{background-color:#009688!important;color:#fff}.teal-bg{background-color:#009688!important}.teal-fg{color:#009688!important}.teal-border{border-color:#009688!important}.teal-border-top{border-top-color:#009688!important}.teal-border-right{border-right-color:#009688!important}.teal-border-bottom{border-bottom-color:#009688!important}.teal-border-left{border-left-color:#009688!important}.teal-600-bg{background-color:#00897b!important}.md-teal-600-bg{background-color:#00897b!important;color:#fff}.teal-600-fg{color:#00897b!important}.teal-600-border{border-color:#00897b!important}.teal-600-border-top{border-top-color:#00897b!important}.teal-600-border-right{border-right-color:#00897b!important}.teal-600-border-bottom{border-bottom-color:#00897b!important}.teal-600-border-left{border-left-color:#00897b!important}.teal-700-bg{background-color:#00796b!important}.md-teal-700-bg{background-color:#00796b!important;color:#fff}.teal-700-fg{color:#00796b!important}.teal-700-border{border-color:#00796b!important}.teal-700-border-top{border-top-color:#00796b!important}.teal-700-border-right{border-right-color:#00796b!important}.teal-700-border-bottom{border-bottom-color:#00796b!important}.teal-700-border-left{border-left-color:#00796b!important}.teal-800-bg{background-color:#00695c!important}.md-teal-800-bg{background-color:#00695c!important;color:rgba(255,255,255,.87)}.teal-800-fg{color:#00695c!important}.teal-800-border{border-color:#00695c!important}.teal-800-border-top{border-top-color:#00695c!important}.teal-800-border-right{border-right-color:#00695c!important}.teal-800-border-bottom{border-bottom-color:#00695c!important}.teal-800-border-left{border-left-color:#00695c!important}.teal-900-bg{background-color:#004d40!important}.md-teal-900-bg{background-color:#004d40!important;color:rgba(255,255,255,.87)}.teal-900-fg{color:#004d40!important}.teal-900-border{border-color:#004d40!important}.teal-900-border-top{border-top-color:#004d40!important}.teal-900-border-right{border-right-color:#004d40!important}.teal-900-border-bottom{border-bottom-color:#004d40!important}.teal-900-border-left{border-left-color:#004d40!important}.teal-A100-bg{background-color:#a7ffeb!important}.md-teal-A100-bg{background-color:#a7ffeb!important;color:rgba(0,0,0,.87)}.teal-A100-fg{color:#a7ffeb!important}.teal-A100-border{border-color:#a7ffeb!important}.teal-A100-border-top{border-top-color:#a7ffeb!important}.teal-A100-border-right{border-right-color:#a7ffeb!important}.teal-A100-border-bottom{border-bottom-color:#a7ffeb!important}.teal-A100-border-left{border-left-color:#a7ffeb!important}.teal-A200-bg{background-color:#64ffda!important}.md-teal-A200-bg{background-color:#64ffda!important;color:rgba(0,0,0,.87)}.teal-A200-fg{color:#64ffda!important}.teal-A200-border{border-color:#64ffda!important}.teal-A200-border-top{border-top-color:#64ffda!important}.teal-A200-border-right{border-right-color:#64ffda!important}.teal-A200-border-bottom{border-bottom-color:#64ffda!important}.teal-A200-border-left{border-left-color:#64ffda!important}.teal-A400-bg{background-color:#1de9b6!important}.md-teal-A400-bg{background-color:#1de9b6!important;color:rgba(0,0,0,.87)}.teal-A400-fg{color:#1de9b6!important}.teal-A400-border{border-color:#1de9b6!important}.teal-A400-border-top{border-top-color:#1de9b6!important}.teal-A400-border-right{border-right-color:#1de9b6!important}.teal-A400-border-bottom{border-bottom-color:#1de9b6!important}.teal-A400-border-left{border-left-color:#1de9b6!important}.teal-A700-bg{background-color:#00bfa5!important}.md-teal-A700-bg{background-color:#00bfa5!important;color:rgba(0,0,0,.87)}.teal-A700-fg{color:#00bfa5!important}.teal-A700-border{border-color:#00bfa5!important}.teal-A700-border-top{border-top-color:#00bfa5!important}.teal-A700-border-right{border-right-color:#00bfa5!important}.teal-A700-border-bottom{border-bottom-color:#00bfa5!important}.teal-A700-border-left{border-left-color:#00bfa5!important}.green-50-bg{background-color:#e8f5e9!important}.md-green-50-bg{background-color:#e8f5e9!important;color:rgba(0,0,0,.87)}.green-50-fg{color:#e8f5e9!important}.green-50-border{border-color:#e8f5e9!important}.green-50-border-top{border-top-color:#e8f5e9!important}.green-50-border-right{border-right-color:#e8f5e9!important}.green-50-border-bottom{border-bottom-color:#e8f5e9!important}.green-50-border-left{border-left-color:#e8f5e9!important}.green-100-bg{background-color:#c8e6c9!important}.md-green-100-bg{background-color:#c8e6c9!important;color:rgba(0,0,0,.87)}.green-100-fg{color:#c8e6c9!important}.green-100-border{border-color:#c8e6c9!important}.green-100-border-top{border-top-color:#c8e6c9!important}.green-100-border-right{border-right-color:#c8e6c9!important}.green-100-border-bottom{border-bottom-color:#c8e6c9!important}.green-100-border-left{border-left-color:#c8e6c9!important}.green-200-bg{background-color:#a5d6a7!important}.md-green-200-bg{background-color:#a5d6a7!important;color:rgba(0,0,0,.87)}.green-200-fg{color:#a5d6a7!important}.green-200-border{border-color:#a5d6a7!important}.green-200-border-top{border-top-color:#a5d6a7!important}.green-200-border-right{border-right-color:#a5d6a7!important}.green-200-border-bottom{border-bottom-color:#a5d6a7!important}.green-200-border-left{border-left-color:#a5d6a7!important}.green-300-bg{background-color:#81c784!important}.md-green-300-bg{background-color:#81c784!important;color:rgba(0,0,0,.87)}.green-300-fg{color:#81c784!important}.green-300-border{border-color:#81c784!important}.green-300-border-top{border-top-color:#81c784!important}.green-300-border-right{border-right-color:#81c784!important}.green-300-border-bottom{border-bottom-color:#81c784!important}.green-300-border-left{border-left-color:#81c784!important}.green-400-bg{background-color:#66bb6a!important}.md-green-400-bg{background-color:#66bb6a!important;color:rgba(0,0,0,.87)}.green-400-fg{color:#66bb6a!important}.green-400-border{border-color:#66bb6a!important}.green-400-border-top{border-top-color:#66bb6a!important}.green-400-border-right{border-right-color:#66bb6a!important}.green-400-border-bottom{border-bottom-color:#66bb6a!important}.green-400-border-left{border-left-color:#66bb6a!important}.green-500-bg{background-color:#4caf50!important}.md-green-500-bg{background-color:#4caf50!important;color:rgba(0,0,0,.87)}.green-500-fg{color:#4caf50!important}.green-500-border{border-color:#4caf50!important}.green-500-border-top{border-top-color:#4caf50!important}.green-500-border-right{border-right-color:#4caf50!important}.green-500-border-bottom{border-bottom-color:#4caf50!important}.green-500-border-left{border-left-color:#4caf50!important}.md-green-bg{background-color:#4caf50!important;color:rgba(0,0,0,.87)}.green-bg{background-color:#4caf50!important}.green-fg{color:#4caf50!important}.green-border{border-color:#4caf50!important}.green-border-top{border-top-color:#4caf50!important}.green-border-right{border-right-color:#4caf50!important}.green-border-bottom{border-bottom-color:#4caf50!important}.green-border-left{border-left-color:#4caf50!important}.green-600-bg{background-color:#43a047!important}.md-green-600-bg{background-color:#43a047!important;color:#fff}.green-600-fg{color:#43a047!important}.green-600-border{border-color:#43a047!important}.green-600-border-top{border-top-color:#43a047!important}.green-600-border-right{border-right-color:#43a047!important}.green-600-border-bottom{border-bottom-color:#43a047!important}.green-600-border-left{border-left-color:#43a047!important}.green-700-bg{background-color:#388e3c!important}.md-green-700-bg{background-color:#388e3c!important;color:#fff}.green-700-fg{color:#388e3c!important}.green-700-border{border-color:#388e3c!important}.green-700-border-top{border-top-color:#388e3c!important}.green-700-border-right{border-right-color:#388e3c!important}.green-700-border-bottom{border-bottom-color:#388e3c!important}.green-700-border-left{border-left-color:#388e3c!important}.green-800-bg{background-color:#2e7d32!important}.md-green-800-bg{background-color:#2e7d32!important;color:rgba(255,255,255,.87)}.green-800-fg{color:#2e7d32!important}.green-800-border{border-color:#2e7d32!important}.green-800-border-top{border-top-color:#2e7d32!important}.green-800-border-right{border-right-color:#2e7d32!important}.green-800-border-bottom{border-bottom-color:#2e7d32!important}.green-800-border-left{border-left-color:#2e7d32!important}.green-900-bg{background-color:#1b5e20!important}.md-green-900-bg{background-color:#1b5e20!important;color:rgba(255,255,255,.87)}.green-900-fg{color:#1b5e20!important}.green-900-border{border-color:#1b5e20!important}.green-900-border-top{border-top-color:#1b5e20!important}.green-900-border-right{border-right-color:#1b5e20!important}.green-900-border-bottom{border-bottom-color:#1b5e20!important}.green-900-border-left{border-left-color:#1b5e20!important}.green-A100-bg{background-color:#b9f6ca!important}.md-green-A100-bg{background-color:#b9f6ca!important;color:rgba(0,0,0,.87)}.green-A100-fg{color:#b9f6ca!important}.green-A100-border{border-color:#b9f6ca!important}.green-A100-border-top{border-top-color:#b9f6ca!important}.green-A100-border-right{border-right-color:#b9f6ca!important}.green-A100-border-bottom{border-bottom-color:#b9f6ca!important}.green-A100-border-left{border-left-color:#b9f6ca!important}.green-A200-bg{background-color:#69f0ae!important}.md-green-A200-bg{background-color:#69f0ae!important;color:rgba(0,0,0,.87)}.green-A200-fg{color:#69f0ae!important}.green-A200-border{border-color:#69f0ae!important}.green-A200-border-top{border-top-color:#69f0ae!important}.green-A200-border-right{border-right-color:#69f0ae!important}.green-A200-border-bottom{border-bottom-color:#69f0ae!important}.green-A200-border-left{border-left-color:#69f0ae!important}.green-A400-bg{background-color:#00e676!important}.md-green-A400-bg{background-color:#00e676!important;color:rgba(0,0,0,.87)}.green-A400-fg{color:#00e676!important}.green-A400-border{border-color:#00e676!important}.green-A400-border-top{border-top-color:#00e676!important}.green-A400-border-right{border-right-color:#00e676!important}.green-A400-border-bottom{border-bottom-color:#00e676!important}.green-A400-border-left{border-left-color:#00e676!important}.green-A700-bg{background-color:#00c853!important}.md-green-A700-bg{background-color:#00c853!important;color:rgba(0,0,0,.87)}.green-A700-fg{color:#00c853!important}.green-A700-border{border-color:#00c853!important}.green-A700-border-top{border-top-color:#00c853!important}.green-A700-border-right{border-right-color:#00c853!important}.green-A700-border-bottom{border-bottom-color:#00c853!important}.green-A700-border-left{border-left-color:#00c853!important}.light-green-50-bg{background-color:#f1f8e9!important}.md-light-green-50-bg{background-color:#f1f8e9!important;color:rgba(0,0,0,.87)}.light-green-50-fg{color:#f1f8e9!important}.light-green-50-border{border-color:#f1f8e9!important}.light-green-50-border-top{border-top-color:#f1f8e9!important}.light-green-50-border-right{border-right-color:#f1f8e9!important}.light-green-50-border-bottom{border-bottom-color:#f1f8e9!important}.light-green-50-border-left{border-left-color:#f1f8e9!important}.light-green-100-bg{background-color:#dcedc8!important}.md-light-green-100-bg{background-color:#dcedc8!important;color:rgba(0,0,0,.87)}.light-green-100-fg{color:#dcedc8!important}.light-green-100-border{border-color:#dcedc8!important}.light-green-100-border-top{border-top-color:#dcedc8!important}.light-green-100-border-right{border-right-color:#dcedc8!important}.light-green-100-border-bottom{border-bottom-color:#dcedc8!important}.light-green-100-border-left{border-left-color:#dcedc8!important}.light-green-200-bg{background-color:#c5e1a5!important}.md-light-green-200-bg{background-color:#c5e1a5!important;color:rgba(0,0,0,.87)}.light-green-200-fg{color:#c5e1a5!important}.light-green-200-border{border-color:#c5e1a5!important}.light-green-200-border-top{border-top-color:#c5e1a5!important}.light-green-200-border-right{border-right-color:#c5e1a5!important}.light-green-200-border-bottom{border-bottom-color:#c5e1a5!important}.light-green-200-border-left{border-left-color:#c5e1a5!important}.light-green-300-bg{background-color:#aed581!important}.md-light-green-300-bg{background-color:#aed581!important;color:rgba(0,0,0,.87)}.light-green-300-fg{color:#aed581!important}.light-green-300-border{border-color:#aed581!important}.light-green-300-border-top{border-top-color:#aed581!important}.light-green-300-border-right{border-right-color:#aed581!important}.light-green-300-border-bottom{border-bottom-color:#aed581!important}.light-green-300-border-left{border-left-color:#aed581!important}.light-green-400-bg{background-color:#9ccc65!important}.md-light-green-400-bg{background-color:#9ccc65!important;color:rgba(0,0,0,.87)}.light-green-400-fg{color:#9ccc65!important}.light-green-400-border{border-color:#9ccc65!important}.light-green-400-border-top{border-top-color:#9ccc65!important}.light-green-400-border-right{border-right-color:#9ccc65!important}.light-green-400-border-bottom{border-bottom-color:#9ccc65!important}.light-green-400-border-left{border-left-color:#9ccc65!important}.light-green-500-bg{background-color:#8bc34a!important}.md-light-green-500-bg{background-color:#8bc34a!important;color:rgba(0,0,0,.87)}.light-green-500-fg{color:#8bc34a!important}.light-green-500-border{border-color:#8bc34a!important}.light-green-500-border-top{border-top-color:#8bc34a!important}.light-green-500-border-right{border-right-color:#8bc34a!important}.light-green-500-border-bottom{border-bottom-color:#8bc34a!important}.light-green-500-border-left{border-left-color:#8bc34a!important}.md-light-green-bg{background-color:#8bc34a!important;color:rgba(0,0,0,.87)}.light-green-bg{background-color:#8bc34a!important}.light-green-fg{color:#8bc34a!important}.light-green-border{border-color:#8bc34a!important}.light-green-border-top{border-top-color:#8bc34a!important}.light-green-border-right{border-right-color:#8bc34a!important}.light-green-border-bottom{border-bottom-color:#8bc34a!important}.light-green-border-left{border-left-color:#8bc34a!important}.light-green-600-bg{background-color:#7cb342!important}.md-light-green-600-bg{background-color:#7cb342!important;color:rgba(0,0,0,.87)}.light-green-600-fg{color:#7cb342!important}.light-green-600-border{border-color:#7cb342!important}.light-green-600-border-top{border-top-color:#7cb342!important}.light-green-600-border-right{border-right-color:#7cb342!important}.light-green-600-border-bottom{border-bottom-color:#7cb342!important}.light-green-600-border-left{border-left-color:#7cb342!important}.light-green-700-bg{background-color:#689f38!important}.md-light-green-700-bg{background-color:#689f38!important;color:#fff}.light-green-700-fg{color:#689f38!important}.light-green-700-border{border-color:#689f38!important}.light-green-700-border-top{border-top-color:#689f38!important}.light-green-700-border-right{border-right-color:#689f38!important}.light-green-700-border-bottom{border-bottom-color:#689f38!important}.light-green-700-border-left{border-left-color:#689f38!important}.light-green-800-bg{background-color:#558b2f!important}.md-light-green-800-bg{background-color:#558b2f!important;color:#fff}.light-green-800-fg{color:#558b2f!important}.light-green-800-border{border-color:#558b2f!important}.light-green-800-border-top{border-top-color:#558b2f!important}.light-green-800-border-right{border-right-color:#558b2f!important}.light-green-800-border-bottom{border-bottom-color:#558b2f!important}.light-green-800-border-left{border-left-color:#558b2f!important}.light-green-900-bg{background-color:#33691e!important}.md-light-green-900-bg{background-color:#33691e!important;color:#fff}.light-green-900-fg{color:#33691e!important}.light-green-900-border{border-color:#33691e!important}.light-green-900-border-top{border-top-color:#33691e!important}.light-green-900-border-right{border-right-color:#33691e!important}.light-green-900-border-bottom{border-bottom-color:#33691e!important}.light-green-900-border-left{border-left-color:#33691e!important}.light-green-A100-bg{background-color:#ccff90!important}.md-light-green-A100-bg{background-color:#ccff90!important;color:rgba(0,0,0,.87)}.light-green-A100-fg{color:#ccff90!important}.light-green-A100-border{border-color:#ccff90!important}.light-green-A100-border-top{border-top-color:#ccff90!important}.light-green-A100-border-right{border-right-color:#ccff90!important}.light-green-A100-border-bottom{border-bottom-color:#ccff90!important}.light-green-A100-border-left{border-left-color:#ccff90!important}.light-green-A200-bg{background-color:#b2ff59!important}.md-light-green-A200-bg{background-color:#b2ff59!important;color:rgba(0,0,0,.87)}.light-green-A200-fg{color:#b2ff59!important}.light-green-A200-border{border-color:#b2ff59!important}.light-green-A200-border-top{border-top-color:#b2ff59!important}.light-green-A200-border-right{border-right-color:#b2ff59!important}.light-green-A200-border-bottom{border-bottom-color:#b2ff59!important}.light-green-A200-border-left{border-left-color:#b2ff59!important}.light-green-A400-bg{background-color:#76ff03!important}.md-light-green-A400-bg{background-color:#76ff03!important;color:rgba(0,0,0,.87)}.light-green-A400-fg{color:#76ff03!important}.light-green-A400-border{border-color:#76ff03!important}.light-green-A400-border-top{border-top-color:#76ff03!important}.light-green-A400-border-right{border-right-color:#76ff03!important}.light-green-A400-border-bottom{border-bottom-color:#76ff03!important}.light-green-A400-border-left{border-left-color:#76ff03!important}.light-green-A700-bg{background-color:#64dd17!important}.md-light-green-A700-bg{background-color:#64dd17!important;color:rgba(0,0,0,.87)}.light-green-A700-fg{color:#64dd17!important}.light-green-A700-border{border-color:#64dd17!important}.light-green-A700-border-top{border-top-color:#64dd17!important}.light-green-A700-border-right{border-right-color:#64dd17!important}.light-green-A700-border-bottom{border-bottom-color:#64dd17!important}.light-green-A700-border-left{border-left-color:#64dd17!important}.lime-50-bg{background-color:#f9fbe7!important}.md-lime-50-bg{background-color:#f9fbe7!important;color:rgba(0,0,0,.87)}.lime-50-fg{color:#f9fbe7!important}.lime-50-border{border-color:#f9fbe7!important}.lime-50-border-top{border-top-color:#f9fbe7!important}.lime-50-border-right{border-right-color:#f9fbe7!important}.lime-50-border-bottom{border-bottom-color:#f9fbe7!important}.lime-50-border-left{border-left-color:#f9fbe7!important}.lime-100-bg{background-color:#f0f4c3!important}.md-lime-100-bg{background-color:#f0f4c3!important;color:rgba(0,0,0,.87)}.lime-100-fg{color:#f0f4c3!important}.lime-100-border{border-color:#f0f4c3!important}.lime-100-border-top{border-top-color:#f0f4c3!important}.lime-100-border-right{border-right-color:#f0f4c3!important}.lime-100-border-bottom{border-bottom-color:#f0f4c3!important}.lime-100-border-left{border-left-color:#f0f4c3!important}.lime-200-bg{background-color:#e6ee9c!important}.md-lime-200-bg{background-color:#e6ee9c!important;color:rgba(0,0,0,.87)}.lime-200-fg{color:#e6ee9c!important}.lime-200-border{border-color:#e6ee9c!important}.lime-200-border-top{border-top-color:#e6ee9c!important}.lime-200-border-right{border-right-color:#e6ee9c!important}.lime-200-border-bottom{border-bottom-color:#e6ee9c!important}.lime-200-border-left{border-left-color:#e6ee9c!important}.lime-300-bg{background-color:#dce775!important}.md-lime-300-bg{background-color:#dce775!important;color:rgba(0,0,0,.87)}.lime-300-fg{color:#dce775!important}.lime-300-border{border-color:#dce775!important}.lime-300-border-top{border-top-color:#dce775!important}.lime-300-border-right{border-right-color:#dce775!important}.lime-300-border-bottom{border-bottom-color:#dce775!important}.lime-300-border-left{border-left-color:#dce775!important}.lime-400-bg{background-color:#d4e157!important}.md-lime-400-bg{background-color:#d4e157!important;color:rgba(0,0,0,.87)}.lime-400-fg{color:#d4e157!important}.lime-400-border{border-color:#d4e157!important}.lime-400-border-top{border-top-color:#d4e157!important}.lime-400-border-right{border-right-color:#d4e157!important}.lime-400-border-bottom{border-bottom-color:#d4e157!important}.lime-400-border-left{border-left-color:#d4e157!important}.lime-500-bg{background-color:#cddc39!important}.md-lime-500-bg{background-color:#cddc39!important;color:rgba(0,0,0,.87)}.lime-500-fg{color:#cddc39!important}.lime-500-border{border-color:#cddc39!important}.lime-500-border-top{border-top-color:#cddc39!important}.lime-500-border-right{border-right-color:#cddc39!important}.lime-500-border-bottom{border-bottom-color:#cddc39!important}.lime-500-border-left{border-left-color:#cddc39!important}.md-lime-bg{background-color:#cddc39!important;color:rgba(0,0,0,.87)}.lime-bg{background-color:#cddc39!important}.lime-fg{color:#cddc39!important}.lime-border{border-color:#cddc39!important}.lime-border-top{border-top-color:#cddc39!important}.lime-border-right{border-right-color:#cddc39!important}.lime-border-bottom{border-bottom-color:#cddc39!important}.lime-border-left{border-left-color:#cddc39!important}.lime-600-bg{background-color:#c0ca33!important}.md-lime-600-bg{background-color:#c0ca33!important;color:rgba(0,0,0,.87)}.lime-600-fg{color:#c0ca33!important}.lime-600-border{border-color:#c0ca33!important}.lime-600-border-top{border-top-color:#c0ca33!important}.lime-600-border-right{border-right-color:#c0ca33!important}.lime-600-border-bottom{border-bottom-color:#c0ca33!important}.lime-600-border-left{border-left-color:#c0ca33!important}.lime-700-bg{background-color:#afb42b!important}.md-lime-700-bg{background-color:#afb42b!important;color:rgba(0,0,0,.87)}.lime-700-fg{color:#afb42b!important}.lime-700-border{border-color:#afb42b!important}.lime-700-border-top{border-top-color:#afb42b!important}.lime-700-border-right{border-right-color:#afb42b!important}.lime-700-border-bottom{border-bottom-color:#afb42b!important}.lime-700-border-left{border-left-color:#afb42b!important}.lime-800-bg{background-color:#9e9d24!important}.md-lime-800-bg{background-color:#9e9d24!important;color:rgba(0,0,0,.87)}.lime-800-fg{color:#9e9d24!important}.lime-800-border{border-color:#9e9d24!important}.lime-800-border-top{border-top-color:#9e9d24!important}.lime-800-border-right{border-right-color:#9e9d24!important}.lime-800-border-bottom{border-bottom-color:#9e9d24!important}.lime-800-border-left{border-left-color:#9e9d24!important}.lime-900-bg{background-color:#827717!important}.md-lime-900-bg{background-color:#827717!important;color:#fff}.lime-900-fg{color:#827717!important}.lime-900-border{border-color:#827717!important}.lime-900-border-top{border-top-color:#827717!important}.lime-900-border-right{border-right-color:#827717!important}.lime-900-border-bottom{border-bottom-color:#827717!important}.lime-900-border-left{border-left-color:#827717!important}.lime-A100-bg{background-color:#f4ff81!important}.md-lime-A100-bg{background-color:#f4ff81!important;color:rgba(0,0,0,.87)}.lime-A100-fg{color:#f4ff81!important}.lime-A100-border{border-color:#f4ff81!important}.lime-A100-border-top{border-top-color:#f4ff81!important}.lime-A100-border-right{border-right-color:#f4ff81!important}.lime-A100-border-bottom{border-bottom-color:#f4ff81!important}.lime-A100-border-left{border-left-color:#f4ff81!important}.lime-A200-bg{background-color:#eeff41!important}.md-lime-A200-bg{background-color:#eeff41!important;color:rgba(0,0,0,.87)}.lime-A200-fg{color:#eeff41!important}.lime-A200-border{border-color:#eeff41!important}.lime-A200-border-top{border-top-color:#eeff41!important}.lime-A200-border-right{border-right-color:#eeff41!important}.lime-A200-border-bottom{border-bottom-color:#eeff41!important}.lime-A200-border-left{border-left-color:#eeff41!important}.lime-A400-bg{background-color:#c6ff00!important}.md-lime-A400-bg{background-color:#c6ff00!important;color:rgba(0,0,0,.87)}.lime-A400-fg{color:#c6ff00!important}.lime-A400-border{border-color:#c6ff00!important}.lime-A400-border-top{border-top-color:#c6ff00!important}.lime-A400-border-right{border-right-color:#c6ff00!important}.lime-A400-border-bottom{border-bottom-color:#c6ff00!important}.lime-A400-border-left{border-left-color:#c6ff00!important}.lime-A700-bg{background-color:#aeea00!important}.md-lime-A700-bg{background-color:#aeea00!important;color:rgba(0,0,0,.87)}.lime-A700-fg{color:#aeea00!important}.lime-A700-border{border-color:#aeea00!important}.lime-A700-border-top{border-top-color:#aeea00!important}.lime-A700-border-right{border-right-color:#aeea00!important}.lime-A700-border-bottom{border-bottom-color:#aeea00!important}.lime-A700-border-left{border-left-color:#aeea00!important}.yellow-50-bg{background-color:#fffde7!important}.md-yellow-50-bg{background-color:#fffde7!important;color:rgba(0,0,0,.87)}.yellow-50-fg{color:#fffde7!important}.yellow-50-border{border-color:#fffde7!important}.yellow-50-border-top{border-top-color:#fffde7!important}.yellow-50-border-right{border-right-color:#fffde7!important}.yellow-50-border-bottom{border-bottom-color:#fffde7!important}.yellow-50-border-left{border-left-color:#fffde7!important}.yellow-100-bg{background-color:#fff9c4!important}.md-yellow-100-bg{background-color:#fff9c4!important;color:rgba(0,0,0,.87)}.yellow-100-fg{color:#fff9c4!important}.yellow-100-border{border-color:#fff9c4!important}.yellow-100-border-top{border-top-color:#fff9c4!important}.yellow-100-border-right{border-right-color:#fff9c4!important}.yellow-100-border-bottom{border-bottom-color:#fff9c4!important}.yellow-100-border-left{border-left-color:#fff9c4!important}.yellow-200-bg{background-color:#fff59d!important}.md-yellow-200-bg{background-color:#fff59d!important;color:rgba(0,0,0,.87)}.yellow-200-fg{color:#fff59d!important}.yellow-200-border{border-color:#fff59d!important}.yellow-200-border-top{border-top-color:#fff59d!important}.yellow-200-border-right{border-right-color:#fff59d!important}.yellow-200-border-bottom{border-bottom-color:#fff59d!important}.yellow-200-border-left{border-left-color:#fff59d!important}.yellow-300-bg{background-color:#fff176!important}.md-yellow-300-bg{background-color:#fff176!important;color:rgba(0,0,0,.87)}.yellow-300-fg{color:#fff176!important}.yellow-300-border{border-color:#fff176!important}.yellow-300-border-top{border-top-color:#fff176!important}.yellow-300-border-right{border-right-color:#fff176!important}.yellow-300-border-bottom{border-bottom-color:#fff176!important}.yellow-300-border-left{border-left-color:#fff176!important}.yellow-400-bg{background-color:#ffee58!important}.md-yellow-400-bg{background-color:#ffee58!important;color:rgba(0,0,0,.87)}.yellow-400-fg{color:#ffee58!important}.yellow-400-border{border-color:#ffee58!important}.yellow-400-border-top{border-top-color:#ffee58!important}.yellow-400-border-right{border-right-color:#ffee58!important}.yellow-400-border-bottom{border-bottom-color:#ffee58!important}.yellow-400-border-left{border-left-color:#ffee58!important}.yellow-500-bg{background-color:#ffeb3b!important}.md-yellow-500-bg{background-color:#ffeb3b!important;color:rgba(0,0,0,.87)}.yellow-500-fg{color:#ffeb3b!important}.yellow-500-border{border-color:#ffeb3b!important}.yellow-500-border-top{border-top-color:#ffeb3b!important}.yellow-500-border-right{border-right-color:#ffeb3b!important}.yellow-500-border-bottom{border-bottom-color:#ffeb3b!important}.yellow-500-border-left{border-left-color:#ffeb3b!important}.md-yellow-bg{background-color:#ffeb3b!important;color:rgba(0,0,0,.87)}.yellow-bg{background-color:#ffeb3b!important}.yellow-fg{color:#ffeb3b!important}.yellow-border{border-color:#ffeb3b!important}.yellow-border-top{border-top-color:#ffeb3b!important}.yellow-border-right{border-right-color:#ffeb3b!important}.yellow-border-bottom{border-bottom-color:#ffeb3b!important}.yellow-border-left{border-left-color:#ffeb3b!important}.yellow-600-bg{background-color:#fdd835!important}.md-yellow-600-bg{background-color:#fdd835!important;color:rgba(0,0,0,.87)}.yellow-600-fg{color:#fdd835!important}.yellow-600-border{border-color:#fdd835!important}.yellow-600-border-top{border-top-color:#fdd835!important}.yellow-600-border-right{border-right-color:#fdd835!important}.yellow-600-border-bottom{border-bottom-color:#fdd835!important}.yellow-600-border-left{border-left-color:#fdd835!important}.yellow-700-bg{background-color:#fbc02d!important}.md-yellow-700-bg{background-color:#fbc02d!important;color:rgba(0,0,0,.87)}.yellow-700-fg{color:#fbc02d!important}.yellow-700-border{border-color:#fbc02d!important}.yellow-700-border-top{border-top-color:#fbc02d!important}.yellow-700-border-right{border-right-color:#fbc02d!important}.yellow-700-border-bottom{border-bottom-color:#fbc02d!important}.yellow-700-border-left{border-left-color:#fbc02d!important}.yellow-800-bg{background-color:#f9a825!important}.md-yellow-800-bg{background-color:#f9a825!important;color:rgba(0,0,0,.87)}.yellow-800-fg{color:#f9a825!important}.yellow-800-border{border-color:#f9a825!important}.yellow-800-border-top{border-top-color:#f9a825!important}.yellow-800-border-right{border-right-color:#f9a825!important}.yellow-800-border-bottom{border-bottom-color:#f9a825!important}.yellow-800-border-left{border-left-color:#f9a825!important}.yellow-900-bg{background-color:#f57f17!important}.md-yellow-900-bg{background-color:#f57f17!important;color:rgba(0,0,0,.87)}.yellow-900-fg{color:#f57f17!important}.yellow-900-border{border-color:#f57f17!important}.yellow-900-border-top{border-top-color:#f57f17!important}.yellow-900-border-right{border-right-color:#f57f17!important}.yellow-900-border-bottom{border-bottom-color:#f57f17!important}.yellow-900-border-left{border-left-color:#f57f17!important}.yellow-A100-bg{background-color:#ffff8d!important}.md-yellow-A100-bg{background-color:#ffff8d!important;color:rgba(0,0,0,.87)}.yellow-A100-fg{color:#ffff8d!important}.yellow-A100-border{border-color:#ffff8d!important}.yellow-A100-border-top{border-top-color:#ffff8d!important}.yellow-A100-border-right{border-right-color:#ffff8d!important}.yellow-A100-border-bottom{border-bottom-color:#ffff8d!important}.yellow-A100-border-left{border-left-color:#ffff8d!important}.yellow-A200-bg{background-color:#ff0!important}.md-yellow-A200-bg{background-color:#ff0!important;color:rgba(0,0,0,.87)}.yellow-A200-fg{color:#ff0!important}.yellow-A200-border{border-color:#ff0!important}.yellow-A200-border-top{border-top-color:#ff0!important}.yellow-A200-border-right{border-right-color:#ff0!important}.yellow-A200-border-bottom{border-bottom-color:#ff0!important}.yellow-A200-border-left{border-left-color:#ff0!important}.yellow-A400-bg{background-color:#ffea00!important}.md-yellow-A400-bg{background-color:#ffea00!important;color:rgba(0,0,0,.87)}.yellow-A400-fg{color:#ffea00!important}.yellow-A400-border{border-color:#ffea00!important}.yellow-A400-border-top{border-top-color:#ffea00!important}.yellow-A400-border-right{border-right-color:#ffea00!important}.yellow-A400-border-bottom{border-bottom-color:#ffea00!important}.yellow-A400-border-left{border-left-color:#ffea00!important}.yellow-A700-bg{background-color:#ffd600!important}.md-yellow-A700-bg{background-color:#ffd600!important;color:rgba(0,0,0,.87)}.yellow-A700-fg{color:#ffd600!important}.yellow-A700-border{border-color:#ffd600!important}.yellow-A700-border-top{border-top-color:#ffd600!important}.yellow-A700-border-right{border-right-color:#ffd600!important}.yellow-A700-border-bottom{border-bottom-color:#ffd600!important}.yellow-A700-border-left{border-left-color:#ffd600!important}.amber-50-bg{background-color:#fff8e1!important}.md-amber-50-bg{background-color:#fff8e1!important;color:rgba(0,0,0,.87)}.amber-50-fg{color:#fff8e1!important}.amber-50-border{border-color:#fff8e1!important}.amber-50-border-top{border-top-color:#fff8e1!important}.amber-50-border-right{border-right-color:#fff8e1!important}.amber-50-border-bottom{border-bottom-color:#fff8e1!important}.amber-50-border-left{border-left-color:#fff8e1!important}.amber-100-bg{background-color:#ffecb3!important}.md-amber-100-bg{background-color:#ffecb3!important;color:rgba(0,0,0,.87)}.amber-100-fg{color:#ffecb3!important}.amber-100-border{border-color:#ffecb3!important}.amber-100-border-top{border-top-color:#ffecb3!important}.amber-100-border-right{border-right-color:#ffecb3!important}.amber-100-border-bottom{border-bottom-color:#ffecb3!important}.amber-100-border-left{border-left-color:#ffecb3!important}.amber-200-bg{background-color:#ffe082!important}.md-amber-200-bg{background-color:#ffe082!important;color:rgba(0,0,0,.87)}.amber-200-fg{color:#ffe082!important}.amber-200-border{border-color:#ffe082!important}.amber-200-border-top{border-top-color:#ffe082!important}.amber-200-border-right{border-right-color:#ffe082!important}.amber-200-border-bottom{border-bottom-color:#ffe082!important}.amber-200-border-left{border-left-color:#ffe082!important}.amber-300-bg{background-color:#ffd54f!important}.md-amber-300-bg{background-color:#ffd54f!important;color:rgba(0,0,0,.87)}.amber-300-fg{color:#ffd54f!important}.amber-300-border{border-color:#ffd54f!important}.amber-300-border-top{border-top-color:#ffd54f!important}.amber-300-border-right{border-right-color:#ffd54f!important}.amber-300-border-bottom{border-bottom-color:#ffd54f!important}.amber-300-border-left{border-left-color:#ffd54f!important}.amber-400-bg{background-color:#ffca28!important}.md-amber-400-bg{background-color:#ffca28!important;color:rgba(0,0,0,.87)}.amber-400-fg{color:#ffca28!important}.amber-400-border{border-color:#ffca28!important}.amber-400-border-top{border-top-color:#ffca28!important}.amber-400-border-right{border-right-color:#ffca28!important}.amber-400-border-bottom{border-bottom-color:#ffca28!important}.amber-400-border-left{border-left-color:#ffca28!important}.amber-500-bg{background-color:#ffc107!important}.md-amber-500-bg{background-color:#ffc107!important;color:rgba(0,0,0,.87)}.amber-500-fg{color:#ffc107!important}.amber-500-border{border-color:#ffc107!important}.amber-500-border-top{border-top-color:#ffc107!important}.amber-500-border-right{border-right-color:#ffc107!important}.amber-500-border-bottom{border-bottom-color:#ffc107!important}.amber-500-border-left{border-left-color:#ffc107!important}.md-amber-bg{background-color:#ffc107!important;color:rgba(0,0,0,.87)}.amber-bg{background-color:#ffc107!important}.amber-fg{color:#ffc107!important}.amber-border{border-color:#ffc107!important}.amber-border-top{border-top-color:#ffc107!important}.amber-border-right{border-right-color:#ffc107!important}.amber-border-bottom{border-bottom-color:#ffc107!important}.amber-border-left{border-left-color:#ffc107!important}.amber-600-bg{background-color:#ffb300!important}.md-amber-600-bg{background-color:#ffb300!important;color:rgba(0,0,0,.87)}.amber-600-fg{color:#ffb300!important}.amber-600-border{border-color:#ffb300!important}.amber-600-border-top{border-top-color:#ffb300!important}.amber-600-border-right{border-right-color:#ffb300!important}.amber-600-border-bottom{border-bottom-color:#ffb300!important}.amber-600-border-left{border-left-color:#ffb300!important}.amber-700-bg{background-color:#ffa000!important}.md-amber-700-bg{background-color:#ffa000!important;color:rgba(0,0,0,.87)}.amber-700-fg{color:#ffa000!important}.amber-700-border{border-color:#ffa000!important}.amber-700-border-top{border-top-color:#ffa000!important}.amber-700-border-right{border-right-color:#ffa000!important}.amber-700-border-bottom{border-bottom-color:#ffa000!important}.amber-700-border-left{border-left-color:#ffa000!important}.amber-800-bg{background-color:#ff8f00!important}.md-amber-800-bg{background-color:#ff8f00!important;color:rgba(0,0,0,.87)}.amber-800-fg{color:#ff8f00!important}.amber-800-border{border-color:#ff8f00!important}.amber-800-border-top{border-top-color:#ff8f00!important}.amber-800-border-right{border-right-color:#ff8f00!important}.amber-800-border-bottom{border-bottom-color:#ff8f00!important}.amber-800-border-left{border-left-color:#ff8f00!important}.amber-900-bg{background-color:#ff6f00!important}.md-amber-900-bg{background-color:#ff6f00!important;color:rgba(0,0,0,.87)}.amber-900-fg{color:#ff6f00!important}.amber-900-border{border-color:#ff6f00!important}.amber-900-border-top{border-top-color:#ff6f00!important}.amber-900-border-right{border-right-color:#ff6f00!important}.amber-900-border-bottom{border-bottom-color:#ff6f00!important}.amber-900-border-left{border-left-color:#ff6f00!important}.amber-A100-bg{background-color:#ffe57f!important}.md-amber-A100-bg{background-color:#ffe57f!important;color:rgba(0,0,0,.87)}.amber-A100-fg{color:#ffe57f!important}.amber-A100-border{border-color:#ffe57f!important}.amber-A100-border-top{border-top-color:#ffe57f!important}.amber-A100-border-right{border-right-color:#ffe57f!important}.amber-A100-border-bottom{border-bottom-color:#ffe57f!important}.amber-A100-border-left{border-left-color:#ffe57f!important}.amber-A200-bg{background-color:#ffd740!important}.md-amber-A200-bg{background-color:#ffd740!important;color:rgba(0,0,0,.87)}.amber-A200-fg{color:#ffd740!important}.amber-A200-border{border-color:#ffd740!important}.amber-A200-border-top{border-top-color:#ffd740!important}.amber-A200-border-right{border-right-color:#ffd740!important}.amber-A200-border-bottom{border-bottom-color:#ffd740!important}.amber-A200-border-left{border-left-color:#ffd740!important}.amber-A400-bg{background-color:#ffc400!important}.md-amber-A400-bg{background-color:#ffc400!important;color:rgba(0,0,0,.87)}.amber-A400-fg{color:#ffc400!important}.amber-A400-border{border-color:#ffc400!important}.amber-A400-border-top{border-top-color:#ffc400!important}.amber-A400-border-right{border-right-color:#ffc400!important}.amber-A400-border-bottom{border-bottom-color:#ffc400!important}.amber-A400-border-left{border-left-color:#ffc400!important}.amber-A700-bg{background-color:#ffab00!important}.md-amber-A700-bg{background-color:#ffab00!important;color:rgba(0,0,0,.87)}.amber-A700-fg{color:#ffab00!important}.amber-A700-border{border-color:#ffab00!important}.amber-A700-border-top{border-top-color:#ffab00!important}.amber-A700-border-right{border-right-color:#ffab00!important}.amber-A700-border-bottom{border-bottom-color:#ffab00!important}.amber-A700-border-left{border-left-color:#ffab00!important}.orange-50-bg{background-color:#fff3e0!important}.md-orange-50-bg{background-color:#fff3e0!important;color:rgba(0,0,0,.87)}.orange-50-fg{color:#fff3e0!important}.orange-50-border{border-color:#fff3e0!important}.orange-50-border-top{border-top-color:#fff3e0!important}.orange-50-border-right{border-right-color:#fff3e0!important}.orange-50-border-bottom{border-bottom-color:#fff3e0!important}.orange-50-border-left{border-left-color:#fff3e0!important}.orange-100-bg{background-color:#ffe0b2!important}.md-orange-100-bg{background-color:#ffe0b2!important;color:rgba(0,0,0,.87)}.orange-100-fg{color:#ffe0b2!important}.orange-100-border{border-color:#ffe0b2!important}.orange-100-border-top{border-top-color:#ffe0b2!important}.orange-100-border-right{border-right-color:#ffe0b2!important}.orange-100-border-bottom{border-bottom-color:#ffe0b2!important}.orange-100-border-left{border-left-color:#ffe0b2!important}.orange-200-bg{background-color:#ffcc80!important}.md-orange-200-bg{background-color:#ffcc80!important;color:rgba(0,0,0,.87)}.orange-200-fg{color:#ffcc80!important}.orange-200-border{border-color:#ffcc80!important}.orange-200-border-top{border-top-color:#ffcc80!important}.orange-200-border-right{border-right-color:#ffcc80!important}.orange-200-border-bottom{border-bottom-color:#ffcc80!important}.orange-200-border-left{border-left-color:#ffcc80!important}.orange-300-bg{background-color:#ffb74d!important}.md-orange-300-bg{background-color:#ffb74d!important;color:rgba(0,0,0,.87)}.orange-300-fg{color:#ffb74d!important}.orange-300-border{border-color:#ffb74d!important}.orange-300-border-top{border-top-color:#ffb74d!important}.orange-300-border-right{border-right-color:#ffb74d!important}.orange-300-border-bottom{border-bottom-color:#ffb74d!important}.orange-300-border-left{border-left-color:#ffb74d!important}.orange-400-bg{background-color:#ffa726!important}.md-orange-400-bg{background-color:#ffa726!important;color:rgba(0,0,0,.87)}.orange-400-fg{color:#ffa726!important}.orange-400-border{border-color:#ffa726!important}.orange-400-border-top{border-top-color:#ffa726!important}.orange-400-border-right{border-right-color:#ffa726!important}.orange-400-border-bottom{border-bottom-color:#ffa726!important}.orange-400-border-left{border-left-color:#ffa726!important}.orange-500-bg{background-color:#ff9800!important}.md-orange-500-bg{background-color:#ff9800!important;color:rgba(0,0,0,.87)}.orange-500-fg{color:#ff9800!important}.orange-500-border{border-color:#ff9800!important}.orange-500-border-top{border-top-color:#ff9800!important}.orange-500-border-right{border-right-color:#ff9800!important}.orange-500-border-bottom{border-bottom-color:#ff9800!important}.orange-500-border-left{border-left-color:#ff9800!important}.md-orange-bg{background-color:#ff9800!important;color:rgba(0,0,0,.87)}.orange-bg{background-color:#ff9800!important}.orange-fg{color:#ff9800!important}.orange-border{border-color:#ff9800!important}.orange-border-top{border-top-color:#ff9800!important}.orange-border-right{border-right-color:#ff9800!important}.orange-border-bottom{border-bottom-color:#ff9800!important}.orange-border-left{border-left-color:#ff9800!important}.orange-600-bg{background-color:#fb8c00!important}.md-orange-600-bg{background-color:#fb8c00!important;color:rgba(0,0,0,.87)}.orange-600-fg{color:#fb8c00!important}.orange-600-border{border-color:#fb8c00!important}.orange-600-border-top{border-top-color:#fb8c00!important}.orange-600-border-right{border-right-color:#fb8c00!important}.orange-600-border-bottom{border-bottom-color:#fb8c00!important}.orange-600-border-left{border-left-color:#fb8c00!important}.orange-700-bg{background-color:#f57c00!important}.md-orange-700-bg{background-color:#f57c00!important;color:rgba(0,0,0,.87)}.orange-700-fg{color:#f57c00!important}.orange-700-border{border-color:#f57c00!important}.orange-700-border-top{border-top-color:#f57c00!important}.orange-700-border-right{border-right-color:#f57c00!important}.orange-700-border-bottom{border-bottom-color:#f57c00!important}.orange-700-border-left{border-left-color:#f57c00!important}.orange-800-bg{background-color:#ef6c00!important}.md-orange-800-bg{background-color:#ef6c00!important;color:#fff}.orange-800-fg{color:#ef6c00!important}.orange-800-border{border-color:#ef6c00!important}.orange-800-border-top{border-top-color:#ef6c00!important}.orange-800-border-right{border-right-color:#ef6c00!important}.orange-800-border-bottom{border-bottom-color:#ef6c00!important}.orange-800-border-left{border-left-color:#ef6c00!important}.orange-900-bg{background-color:#e65100!important}.md-orange-900-bg{background-color:#e65100!important;color:#fff}.orange-900-fg{color:#e65100!important}.orange-900-border{border-color:#e65100!important}.orange-900-border-top{border-top-color:#e65100!important}.orange-900-border-right{border-right-color:#e65100!important}.orange-900-border-bottom{border-bottom-color:#e65100!important}.orange-900-border-left{border-left-color:#e65100!important}.orange-A100-bg{background-color:#ffd180!important}.md-orange-A100-bg{background-color:#ffd180!important;color:rgba(0,0,0,.87)}.orange-A100-fg{color:#ffd180!important}.orange-A100-border{border-color:#ffd180!important}.orange-A100-border-top{border-top-color:#ffd180!important}.orange-A100-border-right{border-right-color:#ffd180!important}.orange-A100-border-bottom{border-bottom-color:#ffd180!important}.orange-A100-border-left{border-left-color:#ffd180!important}.orange-A200-bg{background-color:#ffab40!important}.md-orange-A200-bg{background-color:#ffab40!important;color:rgba(0,0,0,.87)}.orange-A200-fg{color:#ffab40!important}.orange-A200-border{border-color:#ffab40!important}.orange-A200-border-top{border-top-color:#ffab40!important}.orange-A200-border-right{border-right-color:#ffab40!important}.orange-A200-border-bottom{border-bottom-color:#ffab40!important}.orange-A200-border-left{border-left-color:#ffab40!important}.orange-A400-bg{background-color:#ff9100!important}.md-orange-A400-bg{background-color:#ff9100!important;color:rgba(0,0,0,.87)}.orange-A400-fg{color:#ff9100!important}.orange-A400-border{border-color:#ff9100!important}.orange-A400-border-top{border-top-color:#ff9100!important}.orange-A400-border-right{border-right-color:#ff9100!important}.orange-A400-border-bottom{border-bottom-color:#ff9100!important}.orange-A400-border-left{border-left-color:#ff9100!important}.orange-A700-bg{background-color:#ff6d00!important}.md-orange-A700-bg{background-color:#ff6d00!important;color:rgba(0,0,0,.87)}.orange-A700-fg{color:#ff6d00!important}.orange-A700-border{border-color:#ff6d00!important}.orange-A700-border-top{border-top-color:#ff6d00!important}.orange-A700-border-right{border-right-color:#ff6d00!important}.orange-A700-border-bottom{border-bottom-color:#ff6d00!important}.orange-A700-border-left{border-left-color:#ff6d00!important}.deep-orange-50-bg{background-color:#fbe9e7!important}.md-deep-orange-50-bg{background-color:#fbe9e7!important;color:rgba(0,0,0,.87)}.deep-orange-50-fg{color:#fbe9e7!important}.deep-orange-50-border{border-color:#fbe9e7!important}.deep-orange-50-border-top{border-top-color:#fbe9e7!important}.deep-orange-50-border-right{border-right-color:#fbe9e7!important}.deep-orange-50-border-bottom{border-bottom-color:#fbe9e7!important}.deep-orange-50-border-left{border-left-color:#fbe9e7!important}.deep-orange-100-bg{background-color:#ffccbc!important}.md-deep-orange-100-bg{background-color:#ffccbc!important;color:rgba(0,0,0,.87)}.deep-orange-100-fg{color:#ffccbc!important}.deep-orange-100-border{border-color:#ffccbc!important}.deep-orange-100-border-top{border-top-color:#ffccbc!important}.deep-orange-100-border-right{border-right-color:#ffccbc!important}.deep-orange-100-border-bottom{border-bottom-color:#ffccbc!important}.deep-orange-100-border-left{border-left-color:#ffccbc!important}.deep-orange-200-bg{background-color:#ffab91!important}.md-deep-orange-200-bg{background-color:#ffab91!important;color:rgba(0,0,0,.87)}.deep-orange-200-fg{color:#ffab91!important}.deep-orange-200-border{border-color:#ffab91!important}.deep-orange-200-border-top{border-top-color:#ffab91!important}.deep-orange-200-border-right{border-right-color:#ffab91!important}.deep-orange-200-border-bottom{border-bottom-color:#ffab91!important}.deep-orange-200-border-left{border-left-color:#ffab91!important}.deep-orange-300-bg{background-color:#ff8a65!important}.md-deep-orange-300-bg{background-color:#ff8a65!important;color:rgba(0,0,0,.87)}.deep-orange-300-fg{color:#ff8a65!important}.deep-orange-300-border{border-color:#ff8a65!important}.deep-orange-300-border-top{border-top-color:#ff8a65!important}.deep-orange-300-border-right{border-right-color:#ff8a65!important}.deep-orange-300-border-bottom{border-bottom-color:#ff8a65!important}.deep-orange-300-border-left{border-left-color:#ff8a65!important}.deep-orange-400-bg{background-color:#ff7043!important}.md-deep-orange-400-bg{background-color:#ff7043!important;color:rgba(0,0,0,.87)}.deep-orange-400-fg{color:#ff7043!important}.deep-orange-400-border{border-color:#ff7043!important}.deep-orange-400-border-top{border-top-color:#ff7043!important}.deep-orange-400-border-right{border-right-color:#ff7043!important}.deep-orange-400-border-bottom{border-bottom-color:#ff7043!important}.deep-orange-400-border-left{border-left-color:#ff7043!important}.deep-orange-500-bg{background-color:#ff5722!important}.md-deep-orange-500-bg{background-color:#ff5722!important;color:#fff}.deep-orange-500-fg{color:#ff5722!important}.deep-orange-500-border{border-color:#ff5722!important}.deep-orange-500-border-top{border-top-color:#ff5722!important}.deep-orange-500-border-right{border-right-color:#ff5722!important}.deep-orange-500-border-bottom{border-bottom-color:#ff5722!important}.deep-orange-500-border-left{border-left-color:#ff5722!important}.md-deep-orange-bg{background-color:#ff5722!important;color:#fff}.deep-orange-bg{background-color:#ff5722!important}.deep-orange-fg{color:#ff5722!important}.deep-orange-border{border-color:#ff5722!important}.deep-orange-border-top{border-top-color:#ff5722!important}.deep-orange-border-right{border-right-color:#ff5722!important}.deep-orange-border-bottom{border-bottom-color:#ff5722!important}.deep-orange-border-left{border-left-color:#ff5722!important}.deep-orange-600-bg{background-color:#f4511e!important}.md-deep-orange-600-bg{background-color:#f4511e!important;color:#fff}.deep-orange-600-fg{color:#f4511e!important}.deep-orange-600-border{border-color:#f4511e!important}.deep-orange-600-border-top{border-top-color:#f4511e!important}.deep-orange-600-border-right{border-right-color:#f4511e!important}.deep-orange-600-border-bottom{border-bottom-color:#f4511e!important}.deep-orange-600-border-left{border-left-color:#f4511e!important}.deep-orange-700-bg{background-color:#e64a19!important}.md-deep-orange-700-bg{background-color:#e64a19!important;color:#fff}.deep-orange-700-fg{color:#e64a19!important}.deep-orange-700-border{border-color:#e64a19!important}.deep-orange-700-border-top{border-top-color:#e64a19!important}.deep-orange-700-border-right{border-right-color:#e64a19!important}.deep-orange-700-border-bottom{border-bottom-color:#e64a19!important}.deep-orange-700-border-left{border-left-color:#e64a19!important}.deep-orange-800-bg{background-color:#d84315!important}.md-deep-orange-800-bg{background-color:#d84315!important;color:#fff}.deep-orange-800-fg{color:#d84315!important}.deep-orange-800-border{border-color:#d84315!important}.deep-orange-800-border-top{border-top-color:#d84315!important}.deep-orange-800-border-right{border-right-color:#d84315!important}.deep-orange-800-border-bottom{border-bottom-color:#d84315!important}.deep-orange-800-border-left{border-left-color:#d84315!important}.deep-orange-900-bg{background-color:#bf360c!important}.md-deep-orange-900-bg{background-color:#bf360c!important;color:#fff}.deep-orange-900-fg{color:#bf360c!important}.deep-orange-900-border{border-color:#bf360c!important}.deep-orange-900-border-top{border-top-color:#bf360c!important}.deep-orange-900-border-right{border-right-color:#bf360c!important}.deep-orange-900-border-bottom{border-bottom-color:#bf360c!important}.deep-orange-900-border-left{border-left-color:#bf360c!important}.deep-orange-A100-bg{background-color:#ff9e80!important}.md-deep-orange-A100-bg{background-color:#ff9e80!important;color:rgba(0,0,0,.87)}.deep-orange-A100-fg{color:#ff9e80!important}.deep-orange-A100-border{border-color:#ff9e80!important}.deep-orange-A100-border-top{border-top-color:#ff9e80!important}.deep-orange-A100-border-right{border-right-color:#ff9e80!important}.deep-orange-A100-border-bottom{border-bottom-color:#ff9e80!important}.deep-orange-A100-border-left{border-left-color:#ff9e80!important}.deep-orange-A200-bg{background-color:#ff6e40!important}.md-deep-orange-A200-bg{background-color:#ff6e40!important;color:rgba(0,0,0,.87)}.deep-orange-A200-fg{color:#ff6e40!important}.deep-orange-A200-border{border-color:#ff6e40!important}.deep-orange-A200-border-top{border-top-color:#ff6e40!important}.deep-orange-A200-border-right{border-right-color:#ff6e40!important}.deep-orange-A200-border-bottom{border-bottom-color:#ff6e40!important}.deep-orange-A200-border-left{border-left-color:#ff6e40!important}.deep-orange-A400-bg{background-color:#ff3d00!important}.md-deep-orange-A400-bg{background-color:#ff3d00!important;color:#fff}.deep-orange-A400-fg{color:#ff3d00!important}.deep-orange-A400-border{border-color:#ff3d00!important}.deep-orange-A400-border-top{border-top-color:#ff3d00!important}.deep-orange-A400-border-right{border-right-color:#ff3d00!important}.deep-orange-A400-border-bottom{border-bottom-color:#ff3d00!important}.deep-orange-A400-border-left{border-left-color:#ff3d00!important}.deep-orange-A700-bg{background-color:#dd2c00!important}.md-deep-orange-A700-bg{background-color:#dd2c00!important;color:#fff}.deep-orange-A700-fg{color:#dd2c00!important}.deep-orange-A700-border{border-color:#dd2c00!important}.deep-orange-A700-border-top{border-top-color:#dd2c00!important}.deep-orange-A700-border-right{border-right-color:#dd2c00!important}.deep-orange-A700-border-bottom{border-bottom-color:#dd2c00!important}.deep-orange-A700-border-left{border-left-color:#dd2c00!important}.brown-50-bg{background-color:#efebe9!important}.md-brown-50-bg{background-color:#efebe9!important;color:rgba(0,0,0,.87)}.brown-50-fg{color:#efebe9!important}.brown-50-border{border-color:#efebe9!important}.brown-50-border-top{border-top-color:#efebe9!important}.brown-50-border-right{border-right-color:#efebe9!important}.brown-50-border-bottom{border-bottom-color:#efebe9!important}.brown-50-border-left{border-left-color:#efebe9!important}.brown-100-bg{background-color:#d7ccc8!important}.md-brown-100-bg{background-color:#d7ccc8!important;color:rgba(0,0,0,.87)}.brown-100-fg{color:#d7ccc8!important}.brown-100-border{border-color:#d7ccc8!important}.brown-100-border-top{border-top-color:#d7ccc8!important}.brown-100-border-right{border-right-color:#d7ccc8!important}.brown-100-border-bottom{border-bottom-color:#d7ccc8!important}.brown-100-border-left{border-left-color:#d7ccc8!important}.brown-200-bg{background-color:#bcaaa4!important}.md-brown-200-bg{background-color:#bcaaa4!important;color:rgba(0,0,0,.87)}.brown-200-fg{color:#bcaaa4!important}.brown-200-border{border-color:#bcaaa4!important}.brown-200-border-top{border-top-color:#bcaaa4!important}.brown-200-border-right{border-right-color:#bcaaa4!important}.brown-200-border-bottom{border-bottom-color:#bcaaa4!important}.brown-200-border-left{border-left-color:#bcaaa4!important}.brown-300-bg{background-color:#a1887f!important}.md-brown-300-bg{background-color:#a1887f!important;color:#fff}.brown-300-fg{color:#a1887f!important}.brown-300-border{border-color:#a1887f!important}.brown-300-border-top{border-top-color:#a1887f!important}.brown-300-border-right{border-right-color:#a1887f!important}.brown-300-border-bottom{border-bottom-color:#a1887f!important}.brown-300-border-left{border-left-color:#a1887f!important}.brown-400-bg{background-color:#8d6e63!important}.md-brown-400-bg{background-color:#8d6e63!important;color:#fff}.brown-400-fg{color:#8d6e63!important}.brown-400-border{border-color:#8d6e63!important}.brown-400-border-top{border-top-color:#8d6e63!important}.brown-400-border-right{border-right-color:#8d6e63!important}.brown-400-border-bottom{border-bottom-color:#8d6e63!important}.brown-400-border-left{border-left-color:#8d6e63!important}.brown-500-bg{background-color:#795548!important}.md-brown-500-bg{background-color:#795548!important;color:rgba(255,255,255,.87)}.brown-500-fg{color:#795548!important}.brown-500-border{border-color:#795548!important}.brown-500-border-top{border-top-color:#795548!important}.brown-500-border-right{border-right-color:#795548!important}.brown-500-border-bottom{border-bottom-color:#795548!important}.brown-500-border-left{border-left-color:#795548!important}.md-brown-bg{background-color:#795548!important;color:rgba(255,255,255,.87)}.brown-bg{background-color:#795548!important}.brown-fg{color:#795548!important}.brown-border{border-color:#795548!important}.brown-border-top{border-top-color:#795548!important}.brown-border-right{border-right-color:#795548!important}.brown-border-bottom{border-bottom-color:#795548!important}.brown-border-left{border-left-color:#795548!important}.brown-600-bg{background-color:#6d4c41!important}.md-brown-600-bg{background-color:#6d4c41!important;color:rgba(255,255,255,.87)}.brown-600-fg{color:#6d4c41!important}.brown-600-border{border-color:#6d4c41!important}.brown-600-border-top{border-top-color:#6d4c41!important}.brown-600-border-right{border-right-color:#6d4c41!important}.brown-600-border-bottom{border-bottom-color:#6d4c41!important}.brown-600-border-left{border-left-color:#6d4c41!important}.brown-700-bg{background-color:#5d4037!important}.md-brown-700-bg{background-color:#5d4037!important;color:rgba(255,255,255,.87)}.brown-700-fg{color:#5d4037!important}.brown-700-border{border-color:#5d4037!important}.brown-700-border-top{border-top-color:#5d4037!important}.brown-700-border-right{border-right-color:#5d4037!important}.brown-700-border-bottom{border-bottom-color:#5d4037!important}.brown-700-border-left{border-left-color:#5d4037!important}.brown-800-bg{background-color:#4e342e!important}.md-brown-800-bg{background-color:#4e342e!important;color:rgba(255,255,255,.87)}.brown-800-fg{color:#4e342e!important}.brown-800-border{border-color:#4e342e!important}.brown-800-border-top{border-top-color:#4e342e!important}.brown-800-border-right{border-right-color:#4e342e!important}.brown-800-border-bottom{border-bottom-color:#4e342e!important}.brown-800-border-left{border-left-color:#4e342e!important}.brown-900-bg{background-color:#3e2723!important}.md-brown-900-bg{background-color:#3e2723!important;color:rgba(255,255,255,.87)}.brown-900-fg{color:#3e2723!important}.brown-900-border{border-color:#3e2723!important}.brown-900-border-top{border-top-color:#3e2723!important}.brown-900-border-right{border-right-color:#3e2723!important}.brown-900-border-bottom{border-bottom-color:#3e2723!important}.brown-900-border-left{border-left-color:#3e2723!important}.brown-A100-bg{background-color:#d7ccc8!important}.md-brown-A100-bg{background-color:#d7ccc8!important;color:rgba(255,255,255,.87)}.brown-A100-fg{color:#d7ccc8!important}.brown-A100-border{border-color:#d7ccc8!important}.brown-A100-border-top{border-top-color:#d7ccc8!important}.brown-A100-border-right{border-right-color:#d7ccc8!important}.brown-A100-border-bottom{border-bottom-color:#d7ccc8!important}.brown-A100-border-left{border-left-color:#d7ccc8!important}.brown-A200-bg{background-color:#bcaaa4!important}.md-brown-A200-bg{background-color:#bcaaa4!important;color:rgba(255,255,255,.87)}.brown-A200-fg{color:#bcaaa4!important}.brown-A200-border{border-color:#bcaaa4!important}.brown-A200-border-top{border-top-color:#bcaaa4!important}.brown-A200-border-right{border-right-color:#bcaaa4!important}.brown-A200-border-bottom{border-bottom-color:#bcaaa4!important}.brown-A200-border-left{border-left-color:#bcaaa4!important}.brown-A400-bg{background-color:#8d6e63!important}.md-brown-A400-bg{background-color:#8d6e63!important;color:rgba(255,255,255,.87)}.brown-A400-fg{color:#8d6e63!important}.brown-A400-border{border-color:#8d6e63!important}.brown-A400-border-top{border-top-color:#8d6e63!important}.brown-A400-border-right{border-right-color:#8d6e63!important}.brown-A400-border-bottom{border-bottom-color:#8d6e63!important}.brown-A400-border-left{border-left-color:#8d6e63!important}.brown-A700-bg{background-color:#5d4037!important}.md-brown-A700-bg{background-color:#5d4037!important;color:rgba(255,255,255,.87)}.brown-A700-fg{color:#5d4037!important}.brown-A700-border{border-color:#5d4037!important}.brown-A700-border-top{border-top-color:#5d4037!important}.brown-A700-border-right{border-right-color:#5d4037!important}.brown-A700-border-bottom{border-bottom-color:#5d4037!important}.brown-A700-border-left{border-left-color:#5d4037!important}.grey-50-bg{background-color:#fafafa!important}.md-grey-50-bg{background-color:#fafafa!important;color:rgba(0,0,0,.87)}.grey-50-fg{color:#fafafa!important}.grey-50-border{border-color:#fafafa!important}.grey-50-border-top{border-top-color:#fafafa!important}.grey-50-border-right{border-right-color:#fafafa!important}.grey-50-border-bottom{border-bottom-color:#fafafa!important}.grey-50-border-left{border-left-color:#fafafa!important}.grey-100-bg{background-color:#f5f5f5!important}.md-grey-100-bg{background-color:#f5f5f5!important;color:rgba(0,0,0,.87)}.grey-100-fg{color:#f5f5f5!important}.grey-100-border{border-color:#f5f5f5!important}.grey-100-border-top{border-top-color:#f5f5f5!important}.grey-100-border-right{border-right-color:#f5f5f5!important}.grey-100-border-bottom{border-bottom-color:#f5f5f5!important}.grey-100-border-left{border-left-color:#f5f5f5!important}.grey-200-bg{background-color:#eee!important}.md-grey-200-bg{background-color:#eee!important;color:rgba(0,0,0,.87)}.grey-200-fg{color:#eee!important}.grey-200-border{border-color:#eee!important}.grey-200-border-top{border-top-color:#eee!important}.grey-200-border-right{border-right-color:#eee!important}.grey-200-border-bottom{border-bottom-color:#eee!important}.grey-200-border-left{border-left-color:#eee!important}.grey-300-bg{background-color:#e0e0e0!important}.md-grey-300-bg{background-color:#e0e0e0!important;color:rgba(0,0,0,.87)}.grey-300-fg{color:#e0e0e0!important}.grey-300-border{border-color:#e0e0e0!important}.grey-300-border-top{border-top-color:#e0e0e0!important}.grey-300-border-right{border-right-color:#e0e0e0!important}.grey-300-border-bottom{border-bottom-color:#e0e0e0!important}.grey-300-border-left{border-left-color:#e0e0e0!important}.grey-400-bg{background-color:#bdbdbd!important}.md-grey-400-bg{background-color:#bdbdbd!important;color:rgba(0,0,0,.87)}.grey-400-fg{color:#bdbdbd!important}.grey-400-border{border-color:#bdbdbd!important}.grey-400-border-top{border-top-color:#bdbdbd!important}.grey-400-border-right{border-right-color:#bdbdbd!important}.grey-400-border-bottom{border-bottom-color:#bdbdbd!important}.grey-400-border-left{border-left-color:#bdbdbd!important}.grey-500-bg{background-color:#9e9e9e!important}.md-grey-500-bg{background-color:#9e9e9e!important;color:rgba(0,0,0,.87)}.grey-500-fg{color:#9e9e9e!important}.grey-500-border{border-color:#9e9e9e!important}.grey-500-border-top{border-top-color:#9e9e9e!important}.grey-500-border-right{border-right-color:#9e9e9e!important}.grey-500-border-bottom{border-bottom-color:#9e9e9e!important}.grey-500-border-left{border-left-color:#9e9e9e!important}.md-grey-bg{background-color:#9e9e9e!important;color:rgba(0,0,0,.87)}.grey-bg{background-color:#9e9e9e!important}.grey-fg{color:#9e9e9e!important}.grey-border{border-color:#9e9e9e!important}.grey-border-top{border-top-color:#9e9e9e!important}.grey-border-right{border-right-color:#9e9e9e!important}.grey-border-bottom{border-bottom-color:#9e9e9e!important}.grey-border-left{border-left-color:#9e9e9e!important}.grey-600-bg{background-color:#757575!important}.md-grey-600-bg{background-color:#757575!important;color:rgba(255,255,255,.87)}.grey-600-fg{color:#757575!important}.grey-600-border{border-color:#757575!important}.grey-600-border-top{border-top-color:#757575!important}.grey-600-border-right{border-right-color:#757575!important}.grey-600-border-bottom{border-bottom-color:#757575!important}.grey-600-border-left{border-left-color:#757575!important}.grey-700-bg{background-color:#616161!important}.md-grey-700-bg{background-color:#616161!important;color:rgba(255,255,255,.87)}.grey-700-fg{color:#616161!important}.grey-700-border{border-color:#616161!important}.grey-700-border-top{border-top-color:#616161!important}.grey-700-border-right{border-right-color:#616161!important}.grey-700-border-bottom{border-bottom-color:#616161!important}.grey-700-border-left{border-left-color:#616161!important}.grey-800-bg{background-color:#424242!important}.md-grey-800-bg{background-color:#424242!important;color:rgba(255,255,255,.87)}.grey-800-fg{color:#424242!important}.grey-800-border{border-color:#424242!important}.grey-800-border-top{border-top-color:#424242!important}.grey-800-border-right{border-right-color:#424242!important}.grey-800-border-bottom{border-bottom-color:#424242!important}.grey-800-border-left{border-left-color:#424242!important}.grey-900-bg{background-color:#212121!important}.md-grey-900-bg{background-color:#212121!important;color:rgba(255,255,255,.87)}.grey-900-fg{color:#212121!important}.grey-900-border{border-color:#212121!important}.grey-900-border-top{border-top-color:#212121!important}.grey-900-border-right{border-right-color:#212121!important}.grey-900-border-bottom{border-bottom-color:#212121!important}.grey-900-border-left{border-left-color:#212121!important}.grey-1000-bg{background-color:#000!important}.md-grey-1000-bg{background-color:#000!important}.grey-1000-fg{color:#000!important}.grey-1000-border{border-color:#000!important}.grey-1000-border-top{border-top-color:#000!important}.grey-1000-border-right{border-right-color:#000!important}.grey-1000-border-bottom{border-bottom-color:#000!important}.grey-1000-border-left{border-left-color:#000!important}.grey-A100-bg{background-color:#fff!important}.md-grey-A100-bg{background-color:#fff!important;color:rgba(0,0,0,.87)}.grey-A100-fg{color:#fff!important}.grey-A100-border{border-color:#fff!important}.grey-A100-border-top{border-top-color:#fff!important}.grey-A100-border-right{border-right-color:#fff!important}.grey-A100-border-bottom{border-bottom-color:#fff!important}.grey-A100-border-left{border-left-color:#fff!important}.grey-A200-bg{background-color:#eee!important}.md-grey-A200-bg{background-color:#eee!important;color:rgba(0,0,0,.87)}.grey-A200-fg{color:#eee!important}.grey-A200-border{border-color:#eee!important}.grey-A200-border-top{border-top-color:#eee!important}.grey-A200-border-right{border-right-color:#eee!important}.grey-A200-border-bottom{border-bottom-color:#eee!important}.grey-A200-border-left{border-left-color:#eee!important}.grey-A400-bg{background-color:#bdbdbd!important}.md-grey-A400-bg{background-color:#bdbdbd!important;color:rgba(0,0,0,.87)}.grey-A400-fg{color:#bdbdbd!important}.grey-A400-border{border-color:#bdbdbd!important}.grey-A400-border-top{border-top-color:#bdbdbd!important}.grey-A400-border-right{border-right-color:#bdbdbd!important}.grey-A400-border-bottom{border-bottom-color:#bdbdbd!important}.grey-A400-border-left{border-left-color:#bdbdbd!important}.grey-A700-bg{background-color:#616161!important}.md-grey-A700-bg{background-color:#616161!important;color:rgba(0,0,0,.87)}.grey-A700-fg{color:#616161!important}.grey-A700-border{border-color:#616161!important}.grey-A700-border-top{border-top-color:#616161!important}.grey-A700-border-right{border-right-color:#616161!important}.grey-A700-border-bottom{border-bottom-color:#616161!important}.grey-A700-border-left{border-left-color:#616161!important}.blue-grey-50-bg{background-color:#eceff1!important}.md-blue-grey-50-bg{background-color:#eceff1!important;color:rgba(0,0,0,.87)}.blue-grey-50-fg{color:#eceff1!important}.blue-grey-50-border{border-color:#eceff1!important}.blue-grey-50-border-top{border-top-color:#eceff1!important}.blue-grey-50-border-right{border-right-color:#eceff1!important}.blue-grey-50-border-bottom{border-bottom-color:#eceff1!important}.blue-grey-50-border-left{border-left-color:#eceff1!important}.blue-grey-100-bg{background-color:#cfd8dc!important}.md-blue-grey-100-bg{background-color:#cfd8dc!important;color:rgba(0,0,0,.87)}.blue-grey-100-fg{color:#cfd8dc!important}.blue-grey-100-border{border-color:#cfd8dc!important}.blue-grey-100-border-top{border-top-color:#cfd8dc!important}.blue-grey-100-border-right{border-right-color:#cfd8dc!important}.blue-grey-100-border-bottom{border-bottom-color:#cfd8dc!important}.blue-grey-100-border-left{border-left-color:#cfd8dc!important}.blue-grey-200-bg{background-color:#b0bec5!important}.md-blue-grey-200-bg{background-color:#b0bec5!important;color:rgba(0,0,0,.87)}.blue-grey-200-fg{color:#b0bec5!important}.blue-grey-200-border{border-color:#b0bec5!important}.blue-grey-200-border-top{border-top-color:#b0bec5!important}.blue-grey-200-border-right{border-right-color:#b0bec5!important}.blue-grey-200-border-bottom{border-bottom-color:#b0bec5!important}.blue-grey-200-border-left{border-left-color:#b0bec5!important}.blue-grey-300-bg{background-color:#90a4ae!important}.md-blue-grey-300-bg{background-color:#90a4ae!important;color:rgba(0,0,0,.87)}.blue-grey-300-fg{color:#90a4ae!important}.blue-grey-300-border{border-color:#90a4ae!important}.blue-grey-300-border-top{border-top-color:#90a4ae!important}.blue-grey-300-border-right{border-right-color:#90a4ae!important}.blue-grey-300-border-bottom{border-bottom-color:#90a4ae!important}.blue-grey-300-border-left{border-left-color:#90a4ae!important}.blue-grey-400-bg{background-color:#78909c!important}.md-blue-grey-400-bg{background-color:#78909c!important;color:#fff}.blue-grey-400-fg{color:#78909c!important}.blue-grey-400-border{border-color:#78909c!important}.blue-grey-400-border-top{border-top-color:#78909c!important}.blue-grey-400-border-right{border-right-color:#78909c!important}.blue-grey-400-border-bottom{border-bottom-color:#78909c!important}.blue-grey-400-border-left{border-left-color:#78909c!important}.blue-grey-500-bg{background-color:#607d8b!important}.md-blue-grey-500-bg{background-color:#607d8b!important;color:#fff}.blue-grey-500-fg{color:#607d8b!important}.blue-grey-500-border{border-color:#607d8b!important}.blue-grey-500-border-top{border-top-color:#607d8b!important}.blue-grey-500-border-right{border-right-color:#607d8b!important}.blue-grey-500-border-bottom{border-bottom-color:#607d8b!important}.blue-grey-500-border-left{border-left-color:#607d8b!important}.md-blue-grey-bg{background-color:#607d8b!important;color:#fff}.blue-grey-bg{background-color:#607d8b!important}.blue-grey-fg{color:#607d8b!important}.blue-grey-border{border-color:#607d8b!important}.blue-grey-border-top{border-top-color:#607d8b!important}.blue-grey-border-right{border-right-color:#607d8b!important}.blue-grey-border-bottom{border-bottom-color:#607d8b!important}.blue-grey-border-left{border-left-color:#607d8b!important}.blue-grey-600-bg{background-color:#546e7a!important}.md-blue-grey-600-bg{background-color:#546e7a!important;color:rgba(255,255,255,.87)}.blue-grey-600-fg{color:#546e7a!important}.blue-grey-600-border{border-color:#546e7a!important}.blue-grey-600-border-top{border-top-color:#546e7a!important}.blue-grey-600-border-right{border-right-color:#546e7a!important}.blue-grey-600-border-bottom{border-bottom-color:#546e7a!important}.blue-grey-600-border-left{border-left-color:#546e7a!important}.blue-grey-700-bg{background-color:#455a64!important}.md-blue-grey-700-bg{background-color:#455a64!important;color:rgba(255,255,255,.87)}.blue-grey-700-fg{color:#455a64!important}.blue-grey-700-border{border-color:#455a64!important}.blue-grey-700-border-top{border-top-color:#455a64!important}.blue-grey-700-border-right{border-right-color:#455a64!important}.blue-grey-700-border-bottom{border-bottom-color:#455a64!important}.blue-grey-700-border-left{border-left-color:#455a64!important}.blue-grey-800-bg{background-color:#37474f!important}.md-blue-grey-800-bg{background-color:#37474f!important;color:rgba(255,255,255,.87)}.blue-grey-800-fg{color:#37474f!important}.blue-grey-800-border{border-color:#37474f!important}.blue-grey-800-border-top{border-top-color:#37474f!important}.blue-grey-800-border-right{border-right-color:#37474f!important}.blue-grey-800-border-bottom{border-bottom-color:#37474f!important}.blue-grey-800-border-left{border-left-color:#37474f!important}.blue-grey-900-bg{background-color:#263238!important}.md-blue-grey-900-bg{background-color:#263238!important;color:rgba(255,255,255,.87)}.blue-grey-900-fg{color:#263238!important}.blue-grey-900-border{border-color:#263238!important}.blue-grey-900-border-top{border-top-color:#263238!important}.blue-grey-900-border-right{border-right-color:#263238!important}.blue-grey-900-border-bottom{border-bottom-color:#263238!important}.blue-grey-900-border-left{border-left-color:#263238!important}.blue-grey-A100-bg{background-color:#cfd8dc!important}.md-blue-grey-A100-bg{background-color:#cfd8dc!important;color:rgba(255,255,255,.87)}.blue-grey-A100-fg{color:#cfd8dc!important}.blue-grey-A100-border{border-color:#cfd8dc!important}.blue-grey-A100-border-top{border-top-color:#cfd8dc!important}.blue-grey-A100-border-right{border-right-color:#cfd8dc!important}.blue-grey-A100-border-bottom{border-bottom-color:#cfd8dc!important}.blue-grey-A100-border-left{border-left-color:#cfd8dc!important}.blue-grey-A200-bg{background-color:#b0bec5!important}.md-blue-grey-A200-bg{background-color:#b0bec5!important;color:rgba(255,255,255,.87)}.blue-grey-A200-fg{color:#b0bec5!important}.blue-grey-A200-border{border-color:#b0bec5!important}.blue-grey-A200-border-top{border-top-color:#b0bec5!important}.blue-grey-A200-border-right{border-right-color:#b0bec5!important}.blue-grey-A200-border-bottom{border-bottom-color:#b0bec5!important}.blue-grey-A200-border-left{border-left-color:#b0bec5!important}.blue-grey-A400-bg{background-color:#78909c!important}.md-blue-grey-A400-bg{background-color:#78909c!important;color:rgba(255,255,255,.87)}.blue-grey-A400-fg{color:#78909c!important}.blue-grey-A400-border{border-color:#78909c!important}.blue-grey-A400-border-top{border-top-color:#78909c!important}.blue-grey-A400-border-right{border-right-color:#78909c!important}.blue-grey-A400-border-bottom{border-bottom-color:#78909c!important}.blue-grey-A400-border-left{border-left-color:#78909c!important}.blue-grey-A700-bg{background-color:#455a64!important}.md-blue-grey-A700-bg{background-color:#455a64!important;color:rgba(255,255,255,.87)}.blue-grey-A700-fg{color:#455a64!important}.blue-grey-A700-border{border-color:#455a64!important}.blue-grey-A700-border-top{border-top-color:#455a64!important}.blue-grey-A700-border-right{border-right-color:#455a64!important}.blue-grey-A700-border-bottom{border-bottom-color:#455a64!important}.blue-grey-A700-border-left{border-left-color:#455a64!important}.white-500-bg{background-color:#fff!important}.md-white-500-bg{background-color:#fff!important;color:rgba(0,0,0,.87)}.white-500-fg{color:#fff!important}.white-500-border{border-color:#fff!important}.white-500-border-top{border-top-color:#fff!important}.white-500-border-right{border-right-color:#fff!important}.white-500-border-bottom{border-bottom-color:#fff!important}.white-500-border-left{border-left-color:#fff!important}.md-white-bg{background-color:#fff!important;color:rgba(0,0,0,.87)}.white-bg{background-color:#fff!important}.white-fg{color:#fff!important}.white-border{border-color:#fff!important}.white-border-top{border-top-color:#fff!important}.white-border-right{border-right-color:#fff!important}.white-border-bottom{border-bottom-color:#fff!important}.white-border-left{border-left-color:#fff!important}.black-500-bg{background-color:#000!important}.md-black-500-bg{background-color:#000!important;color:rgba(255,255,255,.87)}.black-500-fg{color:#000!important}.black-500-border{border-color:#000!important}.black-500-border-top{border-top-color:#000!important}.black-500-border-right{border-right-color:#000!important}.black-500-border-bottom{border-bottom-color:#000!important}.black-500-border-left{border-left-color:#000!important}.md-black-bg{background-color:#000!important;color:rgba(255,255,255,.87)}.black-bg{background-color:#000!important}.black-fg{color:#000!important}.black-border{border-color:#000!important}.black-border-top{border-top-color:#000!important}.black-border-right{border-right-color:#000!important}.black-border-bottom{border-bottom-color:#000!important}.black-border-left{border-left-color:#000!important}i,md-icon[md-font-icon]{font-size:24px;width:24px;height:24px;min-width:24px;min-height:24px;line-height:24px}i.s4,md-icon[md-font-icon].s4{font-size:4px!important;width:4px!important;height:4px!important;min-width:4px!important;min-height:4px!important;line-height:4px!important}i.s6,md-icon[md-font-icon].s6{font-size:6px!important;width:6px!important;height:6px!important;min-width:6px!important;min-height:6px!important;line-height:6px!important}i.s8,md-icon[md-font-icon].s8{font-size:8px!important;width:8px!important;height:8px!important;min-width:8px!important;min-height:8px!important;line-height:8px!important}i.s10,md-icon[md-font-icon].s10{font-size:10px!important;width:10px!important;height:10px!important;min-width:10px!important;min-height:10px!important;line-height:10px!important}i.s12,md-icon[md-font-icon].s12{font-size:12px!important;width:12px!important;height:12px!important;min-width:12px!important;min-height:12px!important;line-height:12px!important}i.s14,md-icon[md-font-icon].s14{font-size:14px!important;width:14px!important;height:14px!important;min-width:14px!important;min-height:14px!important;line-height:14px!important}i.s16,md-icon[md-font-icon].s16{font-size:16px!important;width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;line-height:16px!important}i.s18,md-icon[md-font-icon].s18{font-size:18px!important;width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;line-height:18px!important}i.s20,md-icon[md-font-icon].s20{font-size:20px!important;width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;line-height:20px!important}i.s22,md-icon[md-font-icon].s22{font-size:22px!important;width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;line-height:22px!important}i.s24,md-icon[md-font-icon].s24{font-size:24px!important;width:24px!important;height:24px!important;min-width:24px!important;min-height:24px!important;line-height:24px!important}i.s26,md-icon[md-font-icon].s26{font-size:26px!important;width:26px!important;height:26px!important;min-width:26px!important;min-height:26px!important;line-height:26px!important}i.s28,md-icon[md-font-icon].s28{font-size:28px!important;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;line-height:28px!important}i.s30,md-icon[md-font-icon].s30{font-size:30px!important;width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;line-height:30px!important}i.s32,md-icon[md-font-icon].s32{font-size:32px!important;width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;line-height:32px!important}i.s34,md-icon[md-font-icon].s34{font-size:34px!important;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;line-height:34px!important}i.s36,md-icon[md-font-icon].s36{font-size:36px!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;line-height:36px!important}i.s38,md-icon[md-font-icon].s38{font-size:38px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;line-height:38px!important}i.s40,md-icon[md-font-icon].s40{font-size:40px!important;width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;line-height:40px!important}i.s42,md-icon[md-font-icon].s42{font-size:42px!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;line-height:42px!important}i.s44,md-icon[md-font-icon].s44{font-size:44px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;line-height:44px!important}i.s46,md-icon[md-font-icon].s46{font-size:46px!important;width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;line-height:46px!important}i.s48,md-icon[md-font-icon].s48{font-size:48px!important;width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important;line-height:48px!important}i.s50,md-icon[md-font-icon].s50{font-size:50px!important;width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;line-height:50px!important}i.s52,md-icon[md-font-icon].s52{font-size:52px!important;width:52px!important;height:52px!important;min-width:52px!important;min-height:52px!important;line-height:52px!important}i.s54,md-icon[md-font-icon].s54{font-size:54px!important;width:54px!important;height:54px!important;min-width:54px!important;min-height:54px!important;line-height:54px!important}i.s56,md-icon[md-font-icon].s56{font-size:56px!important;width:56px!important;height:56px!important;min-width:56px!important;min-height:56px!important;line-height:56px!important}i.s58,md-icon[md-font-icon].s58{font-size:58px!important;width:58px!important;height:58px!important;min-width:58px!important;min-height:58px!important;line-height:58px!important}i.s60,md-icon[md-font-icon].s60{font-size:60px!important;width:60px!important;height:60px!important;min-width:60px!important;min-height:60px!important;line-height:60px!important}i.s62,md-icon[md-font-icon].s62{font-size:62px!important;width:62px!important;height:62px!important;min-width:62px!important;min-height:62px!important;line-height:62px!important}i.s64,md-icon[md-font-icon].s64{font-size:64px!important;width:64px!important;height:64px!important;min-width:64px!important;min-height:64px!important;line-height:64px!important}i.s66,md-icon[md-font-icon].s66{font-size:66px!important;width:66px!important;height:66px!important;min-width:66px!important;min-height:66px!important;line-height:66px!important}i.s68,md-icon[md-font-icon].s68{font-size:68px!important;width:68px!important;height:68px!important;min-width:68px!important;min-height:68px!important;line-height:68px!important}i.s70,md-icon[md-font-icon].s70{font-size:70px!important;width:70px!important;height:70px!important;min-width:70px!important;min-height:70px!important;line-height:70px!important}i.s72,md-icon[md-font-icon].s72{font-size:72px!important;width:72px!important;height:72px!important;min-width:72px!important;min-height:72px!important;line-height:72px!important}i.s74,md-icon[md-font-icon].s74{font-size:74px!important;width:74px!important;height:74px!important;min-width:74px!important;min-height:74px!important;line-height:74px!important}i.s76,md-icon[md-font-icon].s76{font-size:76px!important;width:76px!important;height:76px!important;min-width:76px!important;min-height:76px!important;line-height:76px!important}i.s78,md-icon[md-font-icon].s78{font-size:78px!important;width:78px!important;height:78px!important;min-width:78px!important;min-height:78px!important;line-height:78px!important}i.s80,md-icon[md-font-icon].s80{font-size:80px!important;width:80px!important;height:80px!important;min-width:80px!important;min-height:80px!important;line-height:80px!important}i.s82,md-icon[md-font-icon].s82{font-size:82px!important;width:82px!important;height:82px!important;min-width:82px!important;min-height:82px!important;line-height:82px!important}i.s84,md-icon[md-font-icon].s84{font-size:84px!important;width:84px!important;height:84px!important;min-width:84px!important;min-height:84px!important;line-height:84px!important}i.s86,md-icon[md-font-icon].s86{font-size:86px!important;width:86px!important;height:86px!important;min-width:86px!important;min-height:86px!important;line-height:86px!important}i.s88,md-icon[md-font-icon].s88{font-size:88px!important;width:88px!important;height:88px!important;min-width:88px!important;min-height:88px!important;line-height:88px!important}i.s90,md-icon[md-font-icon].s90{font-size:90px!important;width:90px!important;height:90px!important;min-width:90px!important;min-height:90px!important;line-height:90px!important}i.s92,md-icon[md-font-icon].s92{font-size:92px!important;width:92px!important;height:92px!important;min-width:92px!important;min-height:92px!important;line-height:92px!important}i.s94,md-icon[md-font-icon].s94{font-size:94px!important;width:94px!important;height:94px!important;min-width:94px!important;min-height:94px!important;line-height:94px!important}i.s96,md-icon[md-font-icon].s96{font-size:96px!important;width:96px!important;height:96px!important;min-width:96px!important;min-height:96px!important;line-height:96px!important}i.s98,md-icon[md-font-icon].s98{font-size:98px!important;width:98px!important;height:98px!important;min-width:98px!important;min-height:98px!important;line-height:98px!important}i.s100,md-icon[md-font-icon].s100{font-size:100px!important;width:100px!important;height:100px!important;min-width:100px!important;min-height:100px!important;line-height:100px!important}i.s102,md-icon[md-font-icon].s102{font-size:102px!important;width:102px!important;height:102px!important;min-width:102px!important;min-height:102px!important;line-height:102px!important}i.s104,md-icon[md-font-icon].s104{font-size:104px!important;width:104px!important;height:104px!important;min-width:104px!important;min-height:104px!important;line-height:104px!important}i.s106,md-icon[md-font-icon].s106{font-size:106px!important;width:106px!important;height:106px!important;min-width:106px!important;min-height:106px!important;line-height:106px!important}i.s108,md-icon[md-font-icon].s108{font-size:108px!important;width:108px!important;height:108px!important;min-width:108px!important;min-height:108px!important;line-height:108px!important}i.s110,md-icon[md-font-icon].s110{font-size:110px!important;width:110px!important;height:110px!important;min-width:110px!important;min-height:110px!important;line-height:110px!important}i.s112,md-icon[md-font-icon].s112{font-size:112px!important;width:112px!important;height:112px!important;min-width:112px!important;min-height:112px!important;line-height:112px!important}i.s114,md-icon[md-font-icon].s114{font-size:114px!important;width:114px!important;height:114px!important;min-width:114px!important;min-height:114px!important;line-height:114px!important}i.s116,md-icon[md-font-icon].s116{font-size:116px!important;width:116px!important;height:116px!important;min-width:116px!important;min-height:116px!important;line-height:116px!important}i.s118,md-icon[md-font-icon].s118{font-size:118px!important;width:118px!important;height:118px!important;min-width:118px!important;min-height:118px!important;line-height:118px!important}i.s120,md-icon[md-font-icon].s120{font-size:120px!important;width:120px!important;height:120px!important;min-width:120px!important;min-height:120px!important;line-height:120px!important}i.s122,md-icon[md-font-icon].s122{font-size:122px!important;width:122px!important;height:122px!important;min-width:122px!important;min-height:122px!important;line-height:122px!important}i.s124,md-icon[md-font-icon].s124{font-size:124px!important;width:124px!important;height:124px!important;min-width:124px!important;min-height:124px!important;line-height:124px!important}i.s126,md-icon[md-font-icon].s126{font-size:126px!important;width:126px!important;height:126px!important;min-width:126px!important;min-height:126px!important;line-height:126px!important}i.s128,md-icon[md-font-icon].s128{font-size:128px!important;width:128px!important;height:128px!important;min-width:128px!important;min-height:128px!important;line-height:128px!important}i.s130,md-icon[md-font-icon].s130{font-size:130px!important;width:130px!important;height:130px!important;min-width:130px!important;min-height:130px!important;line-height:130px!important}i.s132,md-icon[md-font-icon].s132{font-size:132px!important;width:132px!important;height:132px!important;min-width:132px!important;min-height:132px!important;line-height:132px!important}i.s134,md-icon[md-font-icon].s134{font-size:134px!important;width:134px!important;height:134px!important;min-width:134px!important;min-height:134px!important;line-height:134px!important}i.s136,md-icon[md-font-icon].s136{font-size:136px!important;width:136px!important;height:136px!important;min-width:136px!important;min-height:136px!important;line-height:136px!important}i.s138,md-icon[md-font-icon].s138{font-size:138px!important;width:138px!important;height:138px!important;min-width:138px!important;min-height:138px!important;line-height:138px!important}i.s140,md-icon[md-font-icon].s140{font-size:140px!important;width:140px!important;height:140px!important;min-width:140px!important;min-height:140px!important;line-height:140px!important}i.s142,md-icon[md-font-icon].s142{font-size:142px!important;width:142px!important;height:142px!important;min-width:142px!important;min-height:142px!important;line-height:142px!important}i.s144,md-icon[md-font-icon].s144{font-size:144px!important;width:144px!important;height:144px!important;min-width:144px!important;min-height:144px!important;line-height:144px!important}i.s146,md-icon[md-font-icon].s146{font-size:146px!important;width:146px!important;height:146px!important;min-width:146px!important;min-height:146px!important;line-height:146px!important}i.s148,md-icon[md-font-icon].s148{font-size:148px!important;width:148px!important;height:148px!important;min-width:148px!important;min-height:148px!important;line-height:148px!important}i.s150,md-icon[md-font-icon].s150{font-size:150px!important;width:150px!important;height:150px!important;min-width:150px!important;min-height:150px!important;line-height:150px!important}i.s152,md-icon[md-font-icon].s152{font-size:152px!important;width:152px!important;height:152px!important;min-width:152px!important;min-height:152px!important;line-height:152px!important}i.s154,md-icon[md-font-icon].s154{font-size:154px!important;width:154px!important;height:154px!important;min-width:154px!important;min-height:154px!important;line-height:154px!important}i.s156,md-icon[md-font-icon].s156{font-size:156px!important;width:156px!important;height:156px!important;min-width:156px!important;min-height:156px!important;line-height:156px!important}i.s158,md-icon[md-font-icon].s158{font-size:158px!important;width:158px!important;height:158px!important;min-width:158px!important;min-height:158px!important;line-height:158px!important}i.s160,md-icon[md-font-icon].s160{font-size:160px!important;width:160px!important;height:160px!important;min-width:160px!important;min-height:160px!important;line-height:160px!important}i.s162,md-icon[md-font-icon].s162{font-size:162px!important;width:162px!important;height:162px!important;min-width:162px!important;min-height:162px!important;line-height:162px!important}i.s164,md-icon[md-font-icon].s164{font-size:164px!important;width:164px!important;height:164px!important;min-width:164px!important;min-height:164px!important;line-height:164px!important}i.s166,md-icon[md-font-icon].s166{font-size:166px!important;width:166px!important;height:166px!important;min-width:166px!important;min-height:166px!important;line-height:166px!important}i.s168,md-icon[md-font-icon].s168{font-size:168px!important;width:168px!important;height:168px!important;min-width:168px!important;min-height:168px!important;line-height:168px!important}i.s170,md-icon[md-font-icon].s170{font-size:170px!important;width:170px!important;height:170px!important;min-width:170px!important;min-height:170px!important;line-height:170px!important}i.s172,md-icon[md-font-icon].s172{font-size:172px!important;width:172px!important;height:172px!important;min-width:172px!important;min-height:172px!important;line-height:172px!important}i.s174,md-icon[md-font-icon].s174{font-size:174px!important;width:174px!important;height:174px!important;min-width:174px!important;min-height:174px!important;line-height:174px!important}i.s176,md-icon[md-font-icon].s176{font-size:176px!important;width:176px!important;height:176px!important;min-width:176px!important;min-height:176px!important;line-height:176px!important}i.s178,md-icon[md-font-icon].s178{font-size:178px!important;width:178px!important;height:178px!important;min-width:178px!important;min-height:178px!important;line-height:178px!important}i.s180,md-icon[md-font-icon].s180{font-size:180px!important;width:180px!important;height:180px!important;min-width:180px!important;min-height:180px!important;line-height:180px!important}i.s182,md-icon[md-font-icon].s182{font-size:182px!important;width:182px!important;height:182px!important;min-width:182px!important;min-height:182px!important;line-height:182px!important}i.s184,md-icon[md-font-icon].s184{font-size:184px!important;width:184px!important;height:184px!important;min-width:184px!important;min-height:184px!important;line-height:184px!important}i.s186,md-icon[md-font-icon].s186{font-size:186px!important;width:186px!important;height:186px!important;min-width:186px!important;min-height:186px!important;line-height:186px!important}i.s188,md-icon[md-font-icon].s188{font-size:188px!important;width:188px!important;height:188px!important;min-width:188px!important;min-height:188px!important;line-height:188px!important}i.s190,md-icon[md-font-icon].s190{font-size:190px!important;width:190px!important;height:190px!important;min-width:190px!important;min-height:190px!important;line-height:190px!important}i.s192,md-icon[md-font-icon].s192{font-size:192px!important;width:192px!important;height:192px!important;min-width:192px!important;min-height:192px!important;line-height:192px!important}i.s194,md-icon[md-font-icon].s194{font-size:194px!important;width:194px!important;height:194px!important;min-width:194px!important;min-height:194px!important;line-height:194px!important}i.s196,md-icon[md-font-icon].s196{font-size:196px!important;width:196px!important;height:196px!important;min-width:196px!important;min-height:196px!important;line-height:196px!important}i.s198,md-icon[md-font-icon].s198{font-size:198px!important;width:198px!important;height:198px!important;min-width:198px!important;min-height:198px!important;line-height:198px!important}i.s200,md-icon[md-font-icon].s200{font-size:200px!important;width:200px!important;height:200px!important;min-width:200px!important;min-height:200px!important;line-height:200px!important}i.s202,md-icon[md-font-icon].s202{font-size:202px!important;width:202px!important;height:202px!important;min-width:202px!important;min-height:202px!important;line-height:202px!important}i.s204,md-icon[md-font-icon].s204{font-size:204px!important;width:204px!important;height:204px!important;min-width:204px!important;min-height:204px!important;line-height:204px!important}i.s206,md-icon[md-font-icon].s206{font-size:206px!important;width:206px!important;height:206px!important;min-width:206px!important;min-height:206px!important;line-height:206px!important}i.s208,md-icon[md-font-icon].s208{font-size:208px!important;width:208px!important;height:208px!important;min-width:208px!important;min-height:208px!important;line-height:208px!important}i.s210,md-icon[md-font-icon].s210{font-size:210px!important;width:210px!important;height:210px!important;min-width:210px!important;min-height:210px!important;line-height:210px!important}i.s212,md-icon[md-font-icon].s212{font-size:212px!important;width:212px!important;height:212px!important;min-width:212px!important;min-height:212px!important;line-height:212px!important}i.s214,md-icon[md-font-icon].s214{font-size:214px!important;width:214px!important;height:214px!important;min-width:214px!important;min-height:214px!important;line-height:214px!important}i.s216,md-icon[md-font-icon].s216{font-size:216px!important;width:216px!important;height:216px!important;min-width:216px!important;min-height:216px!important;line-height:216px!important}i.s218,md-icon[md-font-icon].s218{font-size:218px!important;width:218px!important;height:218px!important;min-width:218px!important;min-height:218px!important;line-height:218px!important}i.s220,md-icon[md-font-icon].s220{font-size:220px!important;width:220px!important;height:220px!important;min-width:220px!important;min-height:220px!important;line-height:220px!important}i.s222,md-icon[md-font-icon].s222{font-size:222px!important;width:222px!important;height:222px!important;min-width:222px!important;min-height:222px!important;line-height:222px!important}i.s224,md-icon[md-font-icon].s224{font-size:224px!important;width:224px!important;height:224px!important;min-width:224px!important;min-height:224px!important;line-height:224px!important}i.s226,md-icon[md-font-icon].s226{font-size:226px!important;width:226px!important;height:226px!important;min-width:226px!important;min-height:226px!important;line-height:226px!important}i.s228,md-icon[md-font-icon].s228{font-size:228px!important;width:228px!important;height:228px!important;min-width:228px!important;min-height:228px!important;line-height:228px!important}i.s230,md-icon[md-font-icon].s230{font-size:230px!important;width:230px!important;height:230px!important;min-width:230px!important;min-height:230px!important;line-height:230px!important}i.s232,md-icon[md-font-icon].s232{font-size:232px!important;width:232px!important;height:232px!important;min-width:232px!important;min-height:232px!important;line-height:232px!important}i.s234,md-icon[md-font-icon].s234{font-size:234px!important;width:234px!important;height:234px!important;min-width:234px!important;min-height:234px!important;line-height:234px!important}i.s236,md-icon[md-font-icon].s236{font-size:236px!important;width:236px!important;height:236px!important;min-width:236px!important;min-height:236px!important;line-height:236px!important}i.s238,md-icon[md-font-icon].s238{font-size:238px!important;width:238px!important;height:238px!important;min-width:238px!important;min-height:238px!important;line-height:238px!important}i.s240,md-icon[md-font-icon].s240{font-size:240px!important;width:240px!important;height:240px!important;min-width:240px!important;min-height:240px!important;line-height:240px!important}i.s242,md-icon[md-font-icon].s242{font-size:242px!important;width:242px!important;height:242px!important;min-width:242px!important;min-height:242px!important;line-height:242px!important}i.s244,md-icon[md-font-icon].s244{font-size:244px!important;width:244px!important;height:244px!important;min-width:244px!important;min-height:244px!important;line-height:244px!important}i.s246,md-icon[md-font-icon].s246{font-size:246px!important;width:246px!important;height:246px!important;min-width:246px!important;min-height:246px!important;line-height:246px!important}i.s248,md-icon[md-font-icon].s248{font-size:248px!important;width:248px!important;height:248px!important;min-width:248px!important;min-height:248px!important;line-height:248px!important}i.s250,md-icon[md-font-icon].s250{font-size:250px!important;width:250px!important;height:250px!important;min-width:250px!important;min-height:250px!important;line-height:250px!important}i.s252,md-icon[md-font-icon].s252{font-size:252px!important;width:252px!important;height:252px!important;min-width:252px!important;min-height:252px!important;line-height:252px!important}i.s254,md-icon[md-font-icon].s254{font-size:254px!important;width:254px!important;height:254px!important;min-width:254px!important;min-height:254px!important;line-height:254px!important}i.s256,md-icon[md-font-icon].s256{font-size:256px!important;width:256px!important;height:256px!important;min-width:256px!important;min-height:256px!important;line-height:256px!important}@font-face{font-family:icomoon;src:url(../assets/icons/fonts/icomoon.eot?5km1tg);src:url(../assets/icons/fonts/icomoon.eot?#iefix5km1tg) format("embedded-opentype"),url(../assets/icons/fonts/icomoon.ttf?5km1tg) format("truetype"),url(../assets/icons/fonts/icomoon.woff?5km1tg) format("woff"),url(../assets/icons/fonts/icomoon.svg?5km1tg#icomoon) format("svg");font-weight:400;font-style:normal}[class*=' icon-'],[class^=icon-]{font-family:icomoon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-account-alert:before{content:'\e600'}.icon-account-box-outline:before{content:'\e601'}.icon-account-box:before{content:'\e602'}.icon-account-check:before{content:'\e603'}.icon-account-circle:before{content:'\e604'}.icon-account-key:before{content:'\e605'}.icon-account-location:before{content:'\e606'}.icon-account-minus:before{content:'\e607'}.icon-account-multiple-outline:before{content:'\e608'}.icon-account-multiple-plus:before{content:'\e609'}.icon-account-multiple:before{content:'\e60a'}.icon-account-network:before{content:'\e60b'}.icon-account-outline:before{content:'\e60c'}.icon-account-plus:before{content:'\e60d'}.icon-account-remove:before{content:'\e60e'}.icon-account-search:before{content:'\e60f'}.icon-account-switch:before{content:'\e610'}.icon-account:before{content:'\e611'}.icon-airballoon:before{content:'\e612'}.icon-airplane-off:before{content:'\e613'}.icon-airplane:before{content:'\e614'}.icon-alarm-check:before{content:'\e615'}.icon-alarm-multiple:before{content:'\e616'}.icon-alarm-off:before{content:'\e617'}.icon-alarm-plus:before{content:'\e618'}.icon-alarm:before{content:'\e619'}.icon-album:before{content:'\e61a'}.icon-alert-box:before{content:'\e61b'}.icon-alert-circle:before{content:'\e61c'}.icon-alert-octagon:before{content:'\e61d'}.icon-alert:before{content:'\e61e'}.icon-alpha:before{content:'\e61f'}.icon-alphabetical:before{content:'\e620'}.icon-amazon-clouddrive:before{content:'\e621'}.icon-amazon:before{content:'\e622'}.icon-ambulance:before{content:'\e623'}.icon-android-debug-bridge:before{content:'\e624'}.icon-android-studio:before{content:'\e625'}.icon-android:before{content:'\e626'}.icon-apple-finder:before{content:'\e627'}.icon-apple-ios:before{content:'\e628'}.icon-apple-mobileme:before{content:'\e629'}.icon-apple-safari:before{content:'\e62a'}.icon-apple:before{content:'\e62b'}.icon-appnet:before{content:'\e62c'}.icon-apps:before{content:'\e62d'}.icon-archive:before{content:'\e62e'}.icon-arrange-bring-forward:before{content:'\e62f'}.icon-arrange-bring-to-front:before{content:'\e630'}.icon-arrange-send-backward:before{content:'\e631'}.icon-arrange-send-to-back:before{content:'\e632'}.icon-arrow-all:before{content:'\e633'}.icon-arrow-bottom-left:before{content:'\e634'}.icon-arrow-bottom-right:before{content:'\e635'}.icon-arrow-collapse:before{content:'\e636'}.icon-arrow-down-bold-circle-outline:before{content:'\e637'}.icon-arrow-down-bold-circle:before{content:'\e638'}.icon-arrow-down-bold-hexagon-outline:before{content:'\e639'}.icon-arrow-down-bold:before{content:'\e63a'}.icon-arrow-down:before{content:'\e63b'}.icon-arrow-expand:before{content:'\e63c'}.icon-arrow-left-bold-circle-outline:before{content:'\e63d'}.icon-arrow-left-bold-circle:before{content:'\e63e'}.icon-arrow-left-bold-hexagon-outline:before{content:'\e63f'}.icon-arrow-left-bold:before{content:'\e640'}.icon-arrow-left:before{content:'\e641'}.icon-arrow-right-bold-circle-outline:before{content:'\e642'}.icon-arrow-right-bold-circle:before{content:'\e643'}.icon-arrow-right-bold-hexagon-outline:before{content:'\e644'}.icon-arrow-right-bold:before{content:'\e645'}.icon-arrow-right:before{content:'\e646'}.icon-arrow-top-left:before{content:'\e647'}.icon-arrow-top-right:before{content:'\e648'}.icon-arrow-up-bold-circle-outline:before{content:'\e649'}.icon-arrow-up-bold-circle:before{content:'\e64a'}.icon-arrow-up-bold-hexagon-outline:before{content:'\e64b'}.icon-arrow-up-bold:before{content:'\e64c'}.icon-arrow-up:before{content:'\e64d'}.icon-at:before{content:'\e64e'}.icon-attachment:before{content:'\e64f'}.icon-audiobook:before{content:'\e650'}.icon-auto-fix:before{content:'\e651'}.icon-auto-upload:before{content:'\e652'}.icon-baby:before{content:'\e653'}.icon-backburger:before{content:'\e654'}.icon-backup-restore:before{content:'\e655'}.icon-bank:before{content:'\e656'}.icon-barcode:before{content:'\e657'}.icon-barley:before{content:'\e658'}.icon-barrel:before{content:'\e659'}.icon-basecamp:before{content:'\e65a'}.icon-basket-fill:before{content:'\e65b'}.icon-basket-unfill:before{content:'\e65c'}.icon-basket:before{content:'\e65d'}.icon-battery-10:before{content:'\e65e'}.icon-battery-20:before{content:'\e65f'}.icon-battery-30:before{content:'\e660'}.icon-battery-40:before{content:'\e661'}.icon-battery-50:before{content:'\e662'}.icon-battery-60:before{content:'\e663'}.icon-battery-70:before{content:'\e664'}.icon-battery-80:before{content:'\e665'}.icon-battery-90:before{content:'\e666'}.icon-battery-alert:before{content:'\e667'}.icon-battery-charging-20:before{content:'\e668'}.icon-battery-charging-30:before{content:'\e669'}.icon-battery-charging-40:before{content:'\e66a'}.icon-battery-charging-60:before{content:'\e66b'}.icon-battery-charging-80:before{content:'\e66c'}.icon-battery-charging-90:before{content:'\e66d'}.icon-battery-charging-100:before{content:'\e66e'}.icon-battery-minus:before{content:'\e66f'}.icon-battery-negative:before{content:'\e670'}.icon-battery-outline:before{content:'\e671'}.icon-battery-plus:before{content:'\e672'}.icon-battery-positive:before{content:'\e673'}.icon-battery-standard:before{content:'\e674'}.icon-battery-unknown:before{content:'\e675'}.icon-battery:before{content:'\e676'}.icon-beach:before{content:'\e677'}.icon-beaker-empty-outline:before{content:'\e678'}.icon-beaker-empty:before{content:'\e679'}.icon-beaker-outline:before{content:'\e67a'}.icon-beaker:before{content:'\e67b'}.icon-beats:before{content:'\e67c'}.icon-beer:before{content:'\e67d'}.icon-behance:before{content:'\e67e'}.icon-bell-off:before{content:'\e67f'}.icon-bell-outline:before{content:'\e680'}.icon-bell-ring-outline:before{content:'\e681'}.icon-bell-ring:before{content:'\e682'}.icon-bell-sleep:before{content:'\e683'}.icon-bell:before{content:'\e684'}.icon-beta:before{content:'\e685'}.icon-bike:before{content:'\e686'}.icon-bing:before{content:'\e687'}.icon-binoculars:before{content:'\e688'}.icon-bio:before{content:'\e689'}.icon-bitbucket:before{content:'\e68a'}.icon-black-mesa:before{content:'\e68b'}.icon-blackberry:before{content:'\e68c'}.icon-blinds:before{content:'\e68d'}.icon-block-helper:before{content:'\e68e'}.icon-blogger:before{content:'\e68f'}.icon-bluetooth-audio:before{content:'\e690'}.icon-bluetooth-connect:before{content:'\e691'}.icon-bluetooth-settings:before{content:'\e692'}.icon-bluetooth-transfer:before{content:'\e693'}.icon-bluetooth:before{content:'\e694'}.icon-blur-linear:before{content:'\e695'}.icon-blur-off:before{content:'\e696'}.icon-blur-radial:before{content:'\e697'}.icon-blur:before{content:'\e698'}.icon-bone:before{content:'\e699'}.icon-book-multiple-variant:before{content:'\e69a'}.icon-book-multiple:before{content:'\e69b'}.icon-book-open:before{content:'\e69c'}.icon-book-variant:before{content:'\e69d'}.icon-book:before{content:'\e69e'}.icon-bookmark-check:before{content:'\e69f'}.icon-bookmark-music:before{content:'\e6a0'}.icon-bookmark-outline-plus:before{content:'\e6a1'}.icon-bookmark-outline:before{content:'\e6a2'}.icon-bookmark-plus:before{content:'\e6a3'}.icon-bookmark-remove:before{content:'\e6a4'}.icon-bookmark:before{content:'\e6a5'}.icon-border-all:before{content:'\e6a6'}.icon-border-bottom:before{content:'\e6a7'}.icon-border-color:before{content:'\e6a8'}.icon-border-horizontal:before{content:'\e6a9'}.icon-border-inside:before{content:'\e6aa'}.icon-border-left:before{content:'\e6ab'}.icon-border-none:before{content:'\e6ac'}.icon-border-outside:before{content:'\e6ad'}.icon-border-right:before{content:'\e6ae'}.icon-border-top:before{content:'\e6af'}.icon-border-vertical:before{content:'\e6b0'}.icon-bowling:before{content:'\e6b1'}.icon-box-download:before{content:'\e6b2'}.icon-box-upload:before{content:'\e6b3'}.icon-box:before{content:'\e6b4'}.icon-briefcase-checked:before{content:'\e6b5'}.icon-briefcase-download:before{content:'\e6b6'}.icon-briefcase-upload:before{content:'\e6b7'}.icon-briefcase:before{content:'\e6b8'}.icon-brightness-1:before{content:'\e6b9'}.icon-brightness-2:before{content:'\e6ba'}.icon-brightness-3:before{content:'\e6bb'}.icon-brightness-4:before{content:'\e6bc'}.icon-brightness-5:before{content:'\e6bd'}.icon-brightness-6:before{content:'\e6be'}.icon-brightness-7:before{content:'\e6bf'}.icon-brightness-auto:before{content:'\e6c0'}.icon-brightness:before{content:'\e6c1'}.icon-broom:before{content:'\e6c2'}.icon-brush:before{content:'\e6c3'}.icon-bug:before{content:'\e6c4'}.icon-bulletin-board:before{content:'\e6c5'}.icon-bullhorn:before{content:'\e6c6'}.icon-bus:before{content:'\e6c7'}.icon-cake-variant:before{content:'\e6c8'}.icon-cake:before{content:'\e6c9'}.icon-calculator:before{content:'\e6ca'}.icon-calendar-blank:before{content:'\e6cb'}.icon-calendar-check-multiple:before{content:'\e6cc'}.icon-calendar-check:before{content:'\e6cd'}.icon-calendar-clock:before{content:'\e6ce'}.icon-calendar-multiple:before{content:'\e6cf'}.icon-calendar-plus:before{content:'\e6d0'}.icon-calendar-remove:before{content:'\e6d1'}.icon-calendar-select:before{content:'\e6d2'}.icon-calendar-text:before{content:'\e6d3'}.icon-calendar-today:before{content:'\e6d4'}.icon-calendar:before{content:'\e6d5'}.icon-camcorder-box-off:before{content:'\e6d6'}.icon-camcorder-box:before{content:'\e6d7'}.icon-camcorder-off:before{content:'\e6d8'}.icon-camcorder:before{content:'\e6d9'}.icon-camera-front-variant:before{content:'\e6da'}.icon-camera-front:before{content:'\e6db'}.icon-camera-iris:before{content:'\e6dc'}.icon-camera-party-mode:before{content:'\e6dd'}.icon-camera-rear-variant:before{content:'\e6de'}.icon-camera-rear:before{content:'\e6df'}.icon-camera-switch:before{content:'\e6e0'}.icon-camera-timer:before{content:'\e6e1'}.icon-camera:before{content:'\e6e2'}.icon-cancel:before{content:'\e6e3'}.icon-candycane:before{content:'\e6e4'}.icon-car-wash:before{content:'\e6e5'}.icon-car:before{content:'\e6e6'}.icon-carrot:before{content:'\e6e7'}.icon-cart-outline:before{content:'\e6e8'}.icon-cart:before{content:'\e6e9'}.icon-cash-100:before{content:'\e6ea'}.icon-cash-multiple:before{content:'\e6eb'}.icon-cash-usd:before{content:'\e6ec'}.icon-cash:before{content:'\e6ed'}.icon-cast-connected:before{content:'\e6ee'}.icon-cast:before{content:'\e6ef'}.icon-castle:before{content:'\e6f0'}.icon-cat:before{content:'\e6f1'}.icon-cellphone-android:before{content:'\e6f2'}.icon-cellphone-dock:before{content:'\e6f3'}.icon-cellphone-iphone:before{content:'\e6f4'}.icon-cellphone-link-off:before{content:'\e6f5'}.icon-cellphone-link:before{content:'\e6f6'}.icon-cellphone-settings:before{content:'\e6f7'}.icon-cellphone:before{content:'\e6f8'}.icon-chair-school:before{content:'\e6f9'}.icon-chart-arc:before{content:'\e6fa'}.icon-chart-areaspline:before{content:'\e6fb'}.icon-chart-bar:before{content:'\e6fc'}.icon-chart-histogram:before{content:'\e6fd'}.icon-chart-line:before{content:'\e6fe'}.icon-chart-pie:before{content:'\e6ff'}.icon-check-all:before{content:'\e700'}.icon-check-bookmark:before{content:'\e701'}.icon-check-circle:before{content:'\e702'}.icon-check:before{content:'\e703'}.icon-checkbox-blank-circle-outline:before{content:'\e704'}.icon-checkbox-blank-circle:before{content:'\e705'}.icon-checkbox-blank-outline:before{content:'\e706'}.icon-checkbox-blank:before{content:'\e707'}.icon-checkbox-marked-circle-outline:before{content:'\e708'}.icon-checkbox-marked-circle:before{content:'\e709'}.icon-checkbox-marked-outline:before{content:'\e70a'}.icon-checkbox-marked:before{content:'\e70b'}.icon-checkbox-multiple-blank-outline:before{content:'\e70c'}.icon-checkbox-multiple-blank:before{content:'\e70d'}.icon-checkbox-multiple-marked-outline:before{content:'\e70e'}.icon-checkbox-multiple-marked:before{content:'\e70f'}.icon-checkerboard:before{content:'\e710'}.icon-chevron-double-down:before{content:'\e711'}.icon-chevron-double-left:before{content:'\e712'}.icon-chevron-double-right:before{content:'\e713'}.icon-chevron-double-up:before{content:'\e714'}.icon-chevron-down:before{content:'\e715'}.icon-chevron-left:before{content:'\e716'}.icon-chevron-right:before{content:'\e717'}.icon-chevron-up:before{content:'\e718'}.icon-church:before{content:'\e719'}.icon-cisco-webex:before{content:'\e71a'}.icon-city:before{content:'\e71b'}.icon-clapperboard:before{content:'\e71c'}.icon-clipboard-account:before{content:'\e71d'}.icon-clipboard-alert:before{content:'\e71e'}.icon-clipboard-arrow-down:before{content:'\e71f'}.icon-clipboard-arrow-left:before{content:'\e720'}.icon-clipboard-check:before{content:'\e721'}.icon-clipboard-outline:before{content:'\e722'}.icon-clipboard-text:before{content:'\e723'}.icon-clipboard:before{content:'\e724'}.icon-clippy:before{content:'\e725'}.icon-clock-fast:before{content:'\e726'}.icon-clock:before{content:'\e727'}.icon-close-circle-outline:before{content:'\e728'}.icon-close-circle:before{content:'\e729'}.icon-close-network:before{content:'\e72a'}.icon-close:before{content:'\e72b'}.icon-closed-caption:before{content:'\e72c'}.icon-cloud-check:before{content:'\e72d'}.icon-cloud-circle:before{content:'\e72e'}.icon-cloud-download:before{content:'\e72f'}.icon-cloud-outline-off:before{content:'\e730'}.icon-cloud-outline:before{content:'\e731'}.icon-cloud-upload:before{content:'\e732'}.icon-cloud:before{content:'\e733'}.icon-code-array:before{content:'\e734'}.icon-code-braces:before{content:'\e735'}.icon-code-equal:before{content:'\e736'}.icon-code-greater-than-or-equal:before{content:'\e737'}.icon-code-greater-than:before{content:'\e738'}.icon-code-less-than-or-equal:before{content:'\e739'}.icon-code-less-than:before{content:'\e73a'}.icon-code-not-equal-variant:before{content:'\e73b'}.icon-code-not-equal:before{content:'\e73c'}.icon-code-string:before{content:'\e73d'}.icon-code-tags:before{content:'\e73e'}.icon-codepen:before{content:'\e73f'}.icon-coffee-to-go:before{content:'\e740'}.icon-coffee:before{content:'\e741'}.icon-cog-box:before{content:'\e742'}.icon-cog:before{content:'\e743'}.icon-coin:before{content:'\e744'}.icon-color-helper:before{content:'\e745'}.icon-comment-account-outline:before{content:'\e746'}.icon-comment-account:before{content:'\e747'}.icon-comment-alert-outline:before{content:'\e748'}.icon-comment-alert:before{content:'\e749'}.icon-comment-check-outline:before{content:'\e74a'}.icon-comment-check:before{content:'\e74b'}.icon-comment-multipe-outline:before{content:'\e74c'}.icon-comment-outline:before{content:'\e74d'}.icon-comment-plus-outline:before{content:'\e74e'}.icon-comment-processing-outline:before{content:'\e74f'}.icon-comment-processing:before{content:'\e750'}.icon-comment-remove-outline:before{content:'\e751'}.icon-comment-text-outline:before{content:'\e752'}.icon-comment-text:before{content:'\e753'}.icon-comment:before{content:'\e754'}.icon-compare:before{content:'\e755'}.icon-compass-outline:before{content:'\e756'}.icon-compass:before{content:'\e757'}.icon-console:before{content:'\e758'}.icon-content-copy:before{content:'\e759'}.icon-content-cut:before{content:'\e75a'}.icon-content-duplicate:before{content:'\e75b'}.icon-content-paste:before{content:'\e75c'}.icon-content-save-all:before{content:'\e75d'}.icon-content-save:before{content:'\e75e'}.icon-contrast-box:before{content:'\e75f'}.icon-contrast-circle:before{content:'\e760'}.icon-contrast:before{content:'\e761'}.icon-controller-xbox:before{content:'\e762'}.icon-cow:before{content:'\e763'}.icon-credit-card-multiple:before{content:'\e764'}.icon-credit-card:before{content:'\e765'}.icon-crop-free:before{content:'\e766'}.icon-crop-landscape:before{content:'\e767'}.icon-crop-portrait:before{content:'\e768'}.icon-crop-square:before{content:'\e769'}.icon-crop:before{content:'\e76a'}.icon-crosshairs-gps:before{content:'\e76b'}.icon-crosshairs:before{content:'\e76c'}.icon-crown:before{content:'\e76d'}.icon-cube-outline:before{content:'\e76e'}.icon-cube-unfolded:before{content:'\e76f'}.icon-cube:before{content:'\e770'}.icon-cup-water:before{content:'\e771'}.icon-cup:before{content:'\e772'}.icon-currency-btc:before{content:'\e773'}.icon-currency-eur:before{content:'\e774'}.icon-currency-gbp:before{content:'\e775'}.icon-currency-inr:before{content:'\e776'}.icon-currency-rub:before{content:'\e777'}.icon-currency-try:before{content:'\e778'}.icon-currency-usd:before{content:'\e779'}.icon-cursor-default-outline:before{content:'\e77a'}.icon-cursor-default:before{content:'\e77b'}.icon-cursor-move:before{content:'\e77c'}.icon-cursor-pointer:before{content:'\e77d'}.icon-data:before{content:'\e77e'}.icon-debug-step-into:before{content:'\e77f'}.icon-debug-step-out:before{content:'\e780'}.icon-debug-step-over:before{content:'\e781'}.icon-decimal-decrease:before{content:'\e782'}.icon-decimal-increase:before{content:'\e783'}.icon-delete-variant:before{content:'\e784'}.icon-delete:before{content:'\e785'}.icon-deskphone:before{content:'\e786'}.icon-desktop-mac:before{content:'\e787'}.icon-desktop-tower:before{content:'\e788'}.icon-details:before{content:'\e789'}.icon-deviantart:before{content:'\e78a'}.icon-diamond:before{content:'\e78b'}.icon-dice-1:before{content:'\e78c'}.icon-dice-2:before{content:'\e78d'}.icon-dice-3:before{content:'\e78e'}.icon-dice-4:before{content:'\e78f'}.icon-dice-5:before{content:'\e790'}.icon-dice-6:before{content:'\e791'}.icon-dice:before{content:'\e792'}.icon-directions:before{content:'\e793'}.icon-disk-alert:before{content:'\e794'}.icon-disqus-outline:before{content:'\e795'}.icon-disqus:before{content:'\e796'}.icon-division-box:before{content:'\e797'}.icon-division:before{content:'\e798'}.icon-dns:before{content:'\e799'}.icon-document:before{content:'\e79a'}.icon-domain:before{content:'\e79b'}.icon-dots-horizontal:before{content:'\e79c'}.icon-dots-vertical:before{content:'\e79d'}.icon-download:before{content:'\e79e'}.icon-drag-horizontal:before{content:'\e79f'}.icon-drag-vertical:before{content:'\e7a0'}.icon-drag:before{content:'\e7a1'}.icon-drawing-box:before{content:'\e7a2'}.icon-drawing:before{content:'\e7a3'}.icon-dribbble-box:before{content:'\e7a4'}.icon-dribbble:before{content:'\e7a5'}.icon-drone:before{content:'\e7a6'}.icon-dropbox:before{content:'\e7a7'}.icon-drupal:before{content:'\e7a8'}.icon-duck:before{content:'\e7a9'}.icon-dumbbell:before{content:'\e7aa'}.icon-earth-off:before{content:'\e7ab'}.icon-earth:before{content:'\e7ac'}.icon-ebay:before{content:'\e7ad'}.icon-edge:before{content:'\e7ae'}.icon-eject:before{content:'\e7af'}.icon-elevation-decline:before{content:'\e7b0'}.icon-elevation-rise:before{content:'\e7b1'}.icon-elevator:before{content:'\e7b2'}.icon-email-open:before{content:'\e7b3'}.icon-email-secure:before{content:'\e7b4'}.icon-email:before{content:'\e7b5'}.icon-emoticon-cool:before{content:'\e7b6'}.icon-emoticon-devil:before{content:'\e7b7'}.icon-emoticon-happy:before{content:'\e7b8'}.icon-emoticon-neutral:before{content:'\e7b9'}.icon-emoticon-poop:before{content:'\e7ba'}.icon-emoticon-sad:before{content:'\e7bb'}.icon-emoticon-tongue:before{content:'\e7bc'}.icon-emoticon:before{content:'\e7bd'}.icon-engine-outline:before{content:'\e7be'}.icon-engine:before{content:'\e7bf'}.icon-equal-box:before{content:'\e7c0'}.icon-equal:before{content:'\e7c1'}.icon-eraser:before{content:'\e7c2'}.icon-escalator:before{content:'\e7c3'}.icon-etsy:before{content:'\e7c4'}.icon-evernote:before{content:'\e7c5'}.icon-exclamation:before{content:'\e7c6'}.icon-exit-to-app:before{content:'\e7c7'}.icon-export:before{content:'\e7c8'}.icon-eye-off:before{content:'\e7c9'}.icon-eye:before{content:'\e7ca'}.icon-eyedropper-variant:before{content:'\e7cb'}.icon-eyedropper:before{content:'\e7cc'}.icon-facebook-box:before{content:'\e7cd'}.icon-facebook:before{content:'\e7ce'}.icon-factory:before{content:'\e7cf'}.icon-fan:before{content:'\e7d0'}.icon-fast-forward:before{content:'\e7d1'}.icon-ferry:before{content:'\e7d2'}.icon-file-cloud:before{content:'\e7d3'}.icon-file-delimited:before{content:'\e7d4'}.icon-file-document-box:before{content:'\e7d5'}.icon-file-document:before{content:'\e7d6'}.icon-file-excel-box:before{content:'\e7d7'}.icon-file-excel:before{content:'\e7d8'}.icon-file-find:before{content:'\e7d9'}.icon-file-hidden:before{content:'\e7da'}.icon-file-image-box:before{content:'\e7db'}.icon-file-image:before{content:'\e7dc'}.icon-file-multiple:before{content:'\e7dd'}.icon-file-music:before{content:'\e7de'}.icon-file-outline:before{content:'\e7df'}.icon-file-pdf-box:before{content:'\e7e0'}.icon-file-pdf:before{content:'\e7e1'}.icon-file-powerpoint-box:before{content:'\e7e2'}.icon-file-powerpoint:before{content:'\e7e3'}.icon-file-presentation-box:before{content:'\e7e4'}.icon-file-video:before{content:'\e7e5'}.icon-file-word-box:before{content:'\e7e6'}.icon-file-word:before{content:'\e7e7'}.icon-file-xml:before{content:'\e7e8'}.icon-file:before{content:'\e7e9'}.icon-fill:before{content:'\e7ea'}.icon-film:before{content:'\e7eb'}.icon-filmstrip-off:before{content:'\e7ec'}.icon-filmstrip:before{content:'\e7ed'}.icon-filter-outline:before{content:'\e7ee'}.icon-filter-remove-outline:before{content:'\e7ef'}.icon-filter-remove:before{content:'\e7f0'}.icon-filter-variant:before{content:'\e7f1'}.icon-filter:before{content:'\e7f2'}.icon-fire:before{content:'\e7f3'}.icon-fish:before{content:'\e7f4'}.icon-flag-checkered-variant:before{content:'\e7f5'}.icon-flag-checkered:before{content:'\e7f6'}.icon-flag-outline-variant:before{content:'\e7f7'}.icon-flag-outline:before{content:'\e7f8'}.icon-flag-triangle:before{content:'\e7f9'}.icon-flag-variant:before{content:'\e7fa'}.icon-flag:before{content:'\e7fb'}.icon-flash-auto:before{content:'\e7fc'}.icon-flash-off:before{content:'\e7fd'}.icon-flash:before{content:'\e7fe'}.icon-flashlight-off:before{content:'\e7ff'}.icon-flashlight:before{content:'\e800'}.icon-flattr:before{content:'\e801'}.icon-flickr-after:before{content:'\e802'}.icon-flickr-before:before{content:'\e803'}.icon-flip-to-back:before{content:'\e804'}.icon-flip-to-front:before{content:'\e805'}.icon-floppy:before{content:'\e806'}.icon-flower:before{content:'\e807'}.icon-folder-account:before{content:'\e808'}.icon-folder-download:before{content:'\e809'}.icon-folder-google-drive:before{content:'\e80a'}.icon-folder-image:before{content:'\e80b'}.icon-folder-lock-open:before{content:'\e80c'}.icon-folder-lock:before{content:'\e80d'}.icon-folder-move:before{content:'\e80e'}.icon-folder-multiple-image:before{content:'\e80f'}.icon-folder-multiple-outline:before{content:'\e810'}.icon-folder-multiple:before{content:'\e811'}.icon-folder-outline-lock:before{content:'\e812'}.icon-folder-outline:before{content:'\e813'}.icon-folder-plus:before{content:'\e814'}.icon-folder-remove:before{content:'\e815'}.icon-folder-upload:before{content:'\e816'}.icon-folder:before{content:'\e817'}.icon-food-apple:before{content:'\e818'}.icon-food-variant:before{content:'\e819'}.icon-food:before{content:'\e81a'}.icon-football-helmet:before{content:'\e81b'}.icon-football:before{content:'\e81c'}.icon-format-align-center:before{content:'\e81d'}.icon-format-align-justify:before{content:'\e81e'}.icon-format-align-left:before{content:'\e81f'}.icon-format-align-right:before{content:'\e820'}.icon-format-bold:before{content:'\e821'}.icon-format-clear:before{content:'\e822'}.icon-format-color-fill:before{content:'\e823'}.icon-format-color:before{content:'\e824'}.icon-format-float-center:before{content:'\e825'}.icon-format-float-left:before{content:'\e826'}.icon-format-float-none:before{content:'\e827'}.icon-format-float-right:before{content:'\e828'}.icon-format-header-1:before{content:'\e829'}.icon-format-header-2:before{content:'\e82a'}.icon-format-header-3:before{content:'\e82b'}.icon-format-header-4:before{content:'\e82c'}.icon-format-header-5:before{content:'\e82d'}.icon-format-header-6:before{content:'\e82e'}.icon-format-header-decrease:before{content:'\e82f'}.icon-format-header-down:before{content:'\e830'}.icon-format-header-equal:before{content:'\e831'}.icon-format-header-increase:before{content:'\e832'}.icon-format-header-pound:before{content:'\e833'}.icon-format-header-up:before{content:'\e834'}.icon-format-indent-decrease:before{content:'\e835'}.icon-format-indent-increase:before{content:'\e836'}.icon-format-italic:before{content:'\e837'}.icon-format-line-spacing:before{content:'\e838'}.icon-format-list-bulleted:before{content:'\e839'}.icon-format-list-numbers:before{content:'\e83a'}.icon-format-object-inline:before{content:'\e83b'}.icon-format-object-square:before{content:'\e83c'}.icon-format-object-tight:before{content:'\e83d'}.icon-format-object-top-bottom:before{content:'\e83e'}.icon-format-paint:before{content:'\e83f'}.icon-format-paragraph:before{content:'\e840'}.icon-format-quote:before{content:'\e841'}.icon-format-size:before{content:'\e842'}.icon-format-strikethrough:before{content:'\e843'}.icon-format-subscript:before{content:'\e844'}.icon-format-superscript:before{content:'\e845'}.icon-format-text:before{content:'\e846'}.icon-format-textdirection-l-to-r:before{content:'\e847'}.icon-format-textdirection-r-to-l:before{content:'\e848'}.icon-format-underline:before{content:'\e849'}.icon-forum:before{content:'\e84a'}.icon-forward:before{content:'\e84b'}.icon-foursquare:before{content:'\e84c'}.icon-fridge:before{content:'\e84d'}.icon-fullscreen-exit:before{content:'\e84e'}.icon-fullscreen:before{content:'\e84f'}.icon-function:before{content:'\e850'}.icon-gamepad-variant:before{content:'\e851'}.icon-gamepad:before{content:'\e852'}.icon-gas-station:before{content:'\e853'}.icon-gavel:before{content:'\e854'}.icon-gender-female:before{content:'\e855'}.icon-gender-male-female:before{content:'\e856'}.icon-gender-male:before{content:'\e857'}.icon-gender-transgender:before{content:'\e858'}.icon-gift:before{content:'\e859'}.icon-git:before{content:'\e85a'}.icon-github-box:before{content:'\e85b'}.icon-github:before{content:'\e85c'}.icon-glass-flute:before{content:'\e85d'}.icon-glass-mug:before{content:'\e85e'}.icon-glass-stange:before{content:'\e85f'}.icon-glass-tulip:before{content:'\e860'}.icon-glasses:before{content:'\e861'}.icon-gmail:before{content:'\e862'}.icon-google-chrome:before{content:'\e863'}.icon-google-circles-communities:before{content:'\e864'}.icon-google-circles-extended:before{content:'\e865'}.icon-google-circles-invite:before{content:'\e866'}.icon-google-circles:before{content:'\e867'}.icon-google-controller-off:before{content:'\e868'}.icon-google-controller:before{content:'\e869'}.icon-google-drive:before{content:'\e86a'}.icon-google-earth:before{content:'\e86b'}.icon-google-glass:before{content:'\e86c'}.icon-google-maps:before{content:'\e86d'}.icon-google-pages:before{content:'\e86e'}.icon-google-play:before{content:'\e86f'}.icon-google-plus-box:before{content:'\e870'}.icon-google-plus:before{content:'\e871'}.icon-google:before{content:'\e872'}.icon-grid-off:before{content:'\e873'}.icon-grid:before{content:'\e874'}.icon-group:before{content:'\e875'}.icon-hand-pointing-right:before{content:'\e876'}.icon-hanger:before{content:'\e877'}.icon-hangouts:before{content:'\e878'}.icon-harddisk:before{content:'\e879'}.icon-headphones-box:before{content:'\e87a'}.icon-headphones-dots:before{content:'\e87b'}.icon-headphones:before{content:'\e87c'}.icon-headset-dock:before{content:'\e87d'}.icon-headset-off:before{content:'\e87e'}.icon-headset:before{content:'\e87f'}.icon-heart-box-outline:before{content:'\e880'}.icon-heart-box:before{content:'\e881'}.icon-heart-broken:before{content:'\e882'}.icon-heart-outline:before{content:'\e883'}.icon-heart:before{content:'\e884'}.icon-help-circle:before{content:'\e885'}.icon-help:before{content:'\e886'}.icon-hexagon-outline:before{content:'\e887'}.icon-hexagon:before{content:'\e888'}.icon-history:before{content:'\e889'}.icon-hololens:before{content:'\e88a'}.icon-home-modern:before{content:'\e88b'}.icon-home-variant:before{content:'\e88c'}.icon-home:before{content:'\e88d'}.icon-hops:before{content:'\e88e'}.icon-hospital-building:before{content:'\e88f'}.icon-hospital-marker:before{content:'\e890'}.icon-hospital:before{content:'\e891'}.icon-hotel:before{content:'\e892'}.icon-houzz-box:before{content:'\e893'}.icon-human-child:before{content:'\e894'}.icon-human-male-female:before{content:'\e895'}.icon-human:before{content:'\e896'}.icon-image-album:before{content:'\e897'}.icon-image-area-close:before{content:'\e898'}.icon-image-area:before{content:'\e899'}.icon-image-broken:before{content:'\e89a'}.icon-image-filter-black-white:before{content:'\e89b'}.icon-image-filter-center-focus:before{content:'\e89c'}.icon-image-filter-drama:before{content:'\e89d'}.icon-image-filter-frames:before{content:'\e89e'}.icon-image-filter-hdr:before{content:'\e89f'}.icon-image-filter-none:before{content:'\e8a0'}.icon-image-filter-tilt-shift:before{content:'\e8a1'}.icon-image-filter-vintage:before{content:'\e8a2'}.icon-image-filter:before{content:'\e8a3'}.icon-image:before{content:'\e8a4'}.icon-import:before{content:'\e8a5'}.icon-inbox:before{content:'\e8a6'}.icon-indent:before{content:'\e8a7'}.icon-information-outline:before{content:'\e8a8'}.icon-information:before{content:'\e8a9'}.icon-instagram:before{content:'\e8aa'}.icon-instapaper:before{content:'\e8ab'}.icon-internet-explorer:before{content:'\e8ac'}.icon-invert-colors:before{content:'\e8ad'}.icon-jira:before{content:'\e8ae'}.icon-jsfiddle:before{content:'\e8af'}.icon-keg:before{content:'\e8b0'}.icon-key-change:before{content:'\e8b1'}.icon-key-minus:before{content:'\e8b2'}.icon-key-plus:before{content:'\e8b3'}.icon-key-remove:before{content:'\e8b4'}.icon-key-variant:before{content:'\e8b5'}.icon-key:before{content:'\e8b6'}.icon-keyboard-backspace:before{content:'\e8b7'}.icon-keyboard-caps:before{content:'\e8b8'}.icon-keyboard-close:before{content:'\e8b9'}.icon-keyboard-off:before{content:'\e8ba'}.icon-keyboard-return:before{content:'\e8bb'}.icon-keyboard-tab:before{content:'\e8bc'}.icon-keyboard-variant:before{content:'\e8bd'}.icon-keyboard:before{content:'\e8be'}.icon-label-outline:before{content:'\e8bf'}.icon-label:before{content:'\e8c0'}.icon-language-csharp:before{content:'\e8c1'}.icon-language-css3:before{content:'\e8c2'}.icon-language-html5:before{content:'\e8c3'}.icon-language-javascript:before{content:'\e8c4'}.icon-language-python-text:before{content:'\e8c5'}.icon-language-python:before{content:'\e8c6'}.icon-laptop-chromebook:before{content:'\e8c7'}.icon-laptop-mac:before{content:'\e8c8'}.icon-laptop-windows:before{content:'\e8c9'}.icon-laptop:before{content:'\e8ca'}.icon-lastfm:before{content:'\e8cb'}.icon-launch:before{content:'\e8cc'}.icon-layers-off:before{content:'\e8cd'}.icon-layers:before{content:'\e8ce'}.icon-leaf:before{content:'\e8cf'}.icon-library-books:before{content:'\e8d0'}.icon-library-music:before{content:'\e8d1'}.icon-library-plus:before{content:'\e8d2'}.icon-library:before{content:'\e8d3'}.icon-lightbulb-outline:before{content:'\e8d4'}.icon-lightbulb:before{content:'\e8d5'}.icon-link-off:before{content:'\e8d6'}.icon-link-variant-off:before{content:'\e8d7'}.icon-link-variant:before{content:'\e8d8'}.icon-link:before{content:'\e8d9'}.icon-linkedin-box:before{content:'\e8da'}.icon-linkedin:before{content:'\e8db'}.icon-linode:before{content:'\e8dc'}.icon-linux:before{content:'\e8dd'}.icon-lock-outline:before{content:'\e8de'}.icon-lock-unlocked-outline:before{content:'\e8df'}.icon-lock-unlocked:before{content:'\e8e0'}.icon-lock:before{content:'\e8e1'}.icon-login:before{content:'\e8e2'}.icon-logout:before{content:'\e8e3'}.icon-looks:before{content:'\e8e4'}.icon-loupe:before{content:'\e8e5'}.icon-lumx:before{content:'\e8e6'}.icon-magnet-on:before{content:'\e8e7'}.icon-magnet:before{content:'\e8e8'}.icon-magnify-minus:before{content:'\e8e9'}.icon-magnify-plus:before{content:'\e8ea'}.icon-magnify:before{content:'\e8eb'}.icon-mail-ru:before{content:'\e8ec'}.icon-map-marker-circle:before{content:'\e8ed'}.icon-map-marker-multiple:before{content:'\e8ee'}.icon-map-marker-off:before{content:'\e8ef'}.icon-map-marker-radius:before{content:'\e8f0'}.icon-map-marker:before{content:'\e8f1'}.icon-map:before{content:'\e8f2'}.icon-margin:before{content:'\e8f3'}.icon-markdown:before{content:'\e8f4'}.icon-marker-check:before{content:'\e8f5'}.icon-martini:before{content:'\e8f6'}.icon-material-ui:before{content:'\e8f7'}.icon-maxcdn:before{content:'\e8f8'}.icon-medium:before{content:'\e8f9'}.icon-memory:before{content:'\e8fa'}.icon-menu-down:before{content:'\e8fb'}.icon-menu-left:before{content:'\e8fc'}.icon-menu-right:before{content:'\e8fd'}.icon-menu-up:before{content:'\e8fe'}.icon-menu:before{content:'\e8ff'}.icon-message-alert:before{content:'\e900'}.icon-message-draw:before{content:'\e901'}.icon-message-image:before{content:'\e902'}.icon-message-processing:before{content:'\e903'}.icon-message-reply:before{content:'\e904'}.icon-message-text-outline:before{content:'\e905'}.icon-message-text:before{content:'\e906'}.icon-message-video:before{content:'\e907'}.icon-message:before{content:'\e908'}.icon-microphone-dots:before{content:'\e909'}.icon-microphone-off:before{content:'\e90a'}.icon-microphone-outline:before{content:'\e90b'}.icon-microphone-settings:before{content:'\e90c'}.icon-microphone-variant-off:before{content:'\e90d'}.icon-microphone-variant:before{content:'\e90e'}.icon-microphone:before{content:'\e90f'}.icon-minus-box:before{content:'\e910'}.icon-minus-circle-outline:before{content:'\e911'}.icon-minus-circle:before{content:'\e912'}.icon-minus-network:before{content:'\e913'}.icon-minus:before{content:'\e914'}.icon-monitor-multiple:before{content:'\e915'}.icon-monitor:before{content:'\e916'}.icon-more:before{content:'\e917'}.icon-mouse-off:before{content:'\e918'}.icon-mouse-variant-off:before{content:'\e919'}.icon-mouse-variant:before{content:'\e91a'}.icon-mouse:before{content:'\e91b'}.icon-movie:before{content:'\e91c'}.icon-multiplication-box:before{content:'\e91d'}.icon-multiplication:before{content:'\e91e'}.icon-music-box-outline:before{content:'\e91f'}.icon-music-box:before{content:'\e920'}.icon-music-circle:before{content:'\e921'}.icon-music-note-eighth:before{content:'\e922'}.icon-music-note-half:before{content:'\e923'}.icon-music-note-off:before{content:'\e924'}.icon-music-note-quarter:before{content:'\e925'}.icon-music-note-sixteenth:before{content:'\e926'}.icon-music-note-whole:before{content:'\e927'}.icon-music-note:before{content:'\e928'}.icon-nature-people:before{content:'\e929'}.icon-nature:before{content:'\e92a'}.icon-navigation:before{content:'\e92b'}.icon-needle:before{content:'\e92c'}.icon-nest-protect:before{content:'\e92d'}.icon-nest-thermostat:before{content:'\e92e'}.icon-newspaper:before{content:'\e92f'}.icon-nfc-tap:before{content:'\e930'}.icon-nfc-variant:before{content:'\e931'}.icon-nfc:before{content:'\e932'}.icon-no:before{content:'\e933'}.icon-not-equal:before{content:'\e934'}.icon-note-outline:before{content:'\e935'}.icon-note-text:before{content:'\e936'}.icon-note:before{content:'\e937'}.icon-numeric-0-box-multiple-outline:before{content:'\e938'}.icon-numeric-0-box-outline:before{content:'\e939'}.icon-numeric-0-box:before{content:'\e93a'}.icon-numeric-1-box-multiple-outline:before{content:'\e93b'}.icon-numeric-1-box-outline:before{content:'\e93c'}.icon-numeric-1-box:before{content:'\e93d'}.icon-numeric-2-box-multiple-outline:before{content:'\e93e'}.icon-numeric-2-box-outline:before{content:'\e93f'}.icon-numeric-2-box:before{content:'\e940'}.icon-numeric-3-box-multiple-outline:before{content:'\e941'}.icon-numeric-3-box-outline:before{content:'\e942'}.icon-numeric-3-box:before{content:'\e943'}.icon-numeric-4-box-multiple-outline:before{content:'\e944'}.icon-numeric-4-box-outline:before{content:'\e945'}.icon-numeric-4-box:before{content:'\e946'}.icon-numeric-5-box-multiple-outline:before{content:'\e947'}.icon-numeric-5-box-outline:before{content:'\e948'}.icon-numeric-5-box:before{content:'\e949'}.icon-numeric-6-box-multiple-outline:before{content:'\e94a'}.icon-numeric-6-box-outline:before{content:'\e94b'}.icon-numeric-6-box:before{content:'\e94c'}.icon-numeric-7-box-multiple-outline:before{content:'\e94d'}.icon-numeric-7-box-outline:before{content:'\e94e'}.icon-numeric-7-box:before{content:'\e94f'}.icon-numeric-8-box-multiple-outline:before{content:'\e950'}.icon-numeric-8-box-outline:before{content:'\e951'}.icon-numeric-8-box:before{content:'\e952'}.icon-numeric-9-box-multiple-outline:before{content:'\e953'}.icon-numeric-9-box-outline:before{content:'\e954'}.icon-numeric-9-box:before{content:'\e955'}.icon-numeric-9-plus-box-multiple-outline:before{content:'\e956'}.icon-numeric-9-plus-box-outline:before{content:'\e957'}.icon-numeric-9-plus-box:before{content:'\e958'}.icon-numeric:before{content:'\e959'}.icon-nutriton:before{content:'\e95a'}.icon-odnoklassniki:before{content:'\e95b'}.icon-office:before{content:'\e95c'}.icon-oil:before{content:'\e95d'}.icon-omega:before{content:'\e95e'}.icon-onedrive:before{content:'\e95f'}.icon-open-in-app:before{content:'\e960'}.icon-open-in-new:before{content:'\e961'}.icon-ornament-variant:before{content:'\e962'}.icon-ornament:before{content:'\e963'}.icon-outbox:before{content:'\e964'}.icon-outdent:before{content:'\e965'}.icon-owl:before{content:'\e966'}.icon-package-down:before{content:'\e967'}.icon-package-up:before{content:'\e968'}.icon-package-variant-closed:before{content:'\e969'}.icon-package-variant:before{content:'\e96a'}.icon-package:before{content:'\e96b'}.icon-palette-advanced:before{content:'\e96c'}.icon-palette:before{content:'\e96d'}.icon-panda:before{content:'\e96e'}.icon-pandora:before{content:'\e96f'}.icon-panorama-fisheye:before{content:'\e970'}.icon-panorama-horizontal:before{content:'\e971'}.icon-panorama-vertical:before{content:'\e972'}.icon-panorama-wide-angle:before{content:'\e973'}.icon-panorama:before{content:'\e974'}.icon-paper-cut-vertical:before{content:'\e975'}.icon-paperclip:before{content:'\e976'}.icon-parking:before{content:'\e977'}.icon-pause-circle-outline:before{content:'\e978'}.icon-pause-circle:before{content:'\e979'}.icon-pause-octagon-outline:before{content:'\e97a'}.icon-pause-octagon:before{content:'\e97b'}.icon-pause:before{content:'\e97c'}.icon-paw:before{content:'\e97d'}.icon-pen:before{content:'\e97e'}.icon-pencil-box-outline:before{content:'\e97f'}.icon-pencil-box:before{content:'\e980'}.icon-pencil:before{content:'\e981'}.icon-people:before{content:'\e982'}.icon-percent:before{content:'\e983'}.icon-person-box:before{content:'\e984'}.icon-person-minus:before{content:'\e985'}.icon-person-plus:before{content:'\e986'}.icon-pharmacy:before{content:'\e987'}.icon-phone-bluetooth:before{content:'\e988'}.icon-phone-dots:before{content:'\e989'}.icon-phone-forward:before{content:'\e98a'}.icon-phone-hangup:before{content:'\e98b'}.icon-phone-in-talk:before{content:'\e98c'}.icon-phone-incoming:before{content:'\e98d'}.icon-phone-locked:before{content:'\e98e'}.icon-phone-log:before{content:'\e98f'}.icon-phone-missed:before{content:'\e990'}.icon-phone-outgoing:before{content:'\e991'}.icon-phone-paused:before{content:'\e992'}.icon-phone:before{content:'\e993'}.icon-picture:before{content:'\e994'}.icon-pig:before{content:'\e995'}.icon-pill:before{content:'\e996'}.icon-pin-off:before{content:'\e997'}.icon-pin:before{content:'\e998'}.icon-pine-tree-box:before{content:'\e999'}.icon-pine-tree:before{content:'\e99a'}.icon-pinterest-box:before{content:'\e99b'}.icon-pinterest:before{content:'\e99c'}.icon-pizza:before{content:'\e99d'}.icon-plane:before{content:'\e99e'}.icon-play-box-outline:before{content:'\e99f'}.icon-play-circle-outline:before{content:'\e9a0'}.icon-play-circle:before{content:'\e9a1'}.icon-play:before{content:'\e9a2'}.icon-playlist-minus:before{content:'\e9a3'}.icon-playlist-plus:before{content:'\e9a4'}.icon-playstation:before{content:'\e9a5'}.icon-plus-box:before{content:'\e9a6'}.icon-plus-circle-outline:before{content:'\e9a7'}.icon-plus-circle:before{content:'\e9a8'}.icon-plus-network:before{content:'\e9a9'}.icon-plus-one:before{content:'\e9aa'}.icon-plus:before{content:'\e9ab'}.icon-pocket:before{content:'\e9ac'}.icon-poll-box:before{content:'\e9ad'}.icon-poll:before{content:'\e9ae'}.icon-polymer:before{content:'\e9af'}.icon-popcorn:before{content:'\e9b0'}.icon-pound-box:before{content:'\e9b1'}.icon-pound:before{content:'\e9b2'}.icon-power-settings:before{content:'\e9b3'}.icon-power-socket:before{content:'\e9b4'}.icon-power:before{content:'\e9b5'}.icon-presentation-play:before{content:'\e9b6'}.icon-presentation:before{content:'\e9b7'}.icon-printer-3d:before{content:'\e9b8'}.icon-printer:before{content:'\e9b9'}.icon-pulse:before{content:'\e9ba'}.icon-puzzle:before{content:'\e9bb'}.icon-qrcode:before{content:'\e9bc'}.icon-quadcopter:before{content:'\e9bd'}.icon-quality-high:before{content:'\e9be'}.icon-question-mark-circle:before{content:'\e9bf'}.icon-quick-reply:before{content:'\e9c0'}.icon-quicktime:before{content:'\e9c1'}.icon-rabbit:before{content:'\e9c2'}.icon-radiator:before{content:'\e9c3'}.icon-radio-tower:before{content:'\e9c4'}.icon-radio:before{content:'\e9c5'}.icon-radioactive:before{content:'\e9c6'}.icon-radiobox-blank:before{content:'\e9c7'}.icon-radiobox-marked:before{content:'\e9c8'}.icon-raspberrypi:before{content:'\e9c9'}.icon-rdio:before{content:'\e9ca'}.icon-read:before{content:'\e9cb'}.icon-readability:before{content:'\e9cc'}.icon-receipt:before{content:'\e9cd'}.icon-recycle:before{content:'\e9ce'}.icon-reddit:before{content:'\e9cf'}.icon-redo-variant:before{content:'\e9d0'}.icon-redo:before{content:'\e9d1'}.icon-refresh:before{content:'\e9d2'}.icon-relative-scale:before{content:'\e9d3'}.icon-reload:before{content:'\e9d4'}.icon-remote:before{content:'\e9d5'}.icon-rename-box:before{content:'\e9d6'}.icon-repeat-off:before{content:'\e9d7'}.icon-repeat-once:before{content:'\e9d8'}.icon-repeat:before{content:'\e9d9'}.icon-replay:before{content:'\e9da'}.icon-reply-all:before{content:'\e9db'}.icon-reply:before{content:'\e9dc'}.icon-reproduction:before{content:'\e9dd'}.icon-resize-bottom-right:before{content:'\e9de'}.icon-responsive:before{content:'\e9df'}.icon-restore:before{content:'\e9e0'}.icon-rewind:before{content:'\e9e1'}.icon-ribbon:before{content:'\e9e2'}.icon-road:before{content:'\e9e3'}.icon-rocket:before{content:'\e9e4'}.icon-rotate-3d:before{content:'\e9e5'}.icon-rotate-left-variant:before{content:'\e9e6'}.icon-rotate-left:before{content:'\e9e7'}.icon-rotate-right-variant:before{content:'\e9e8'}.icon-rotate-right:before{content:'\e9e9'}.icon-routes:before{content:'\e9ea'}.icon-rss-box:before{content:'\e9eb'}.icon-ruler:before{content:'\e9ec'}.icon-run:before{content:'\e9ed'}.icon-sale:before{content:'\e9ee'}.icon-satellite-variant:before{content:'\e9ef'}.icon-satellite:before{content:'\e9f0'}.icon-scale-bathroom:before{content:'\e9f1'}.icon-scale:before{content:'\e9f2'}.icon-school:before{content:'\e9f3'}.icon-screen-rotation-lock:before{content:'\e9f4'}.icon-screen-rotation:before{content:'\e9f5'}.icon-script:before{content:'\e9f6'}.icon-security-network:before{content:'\e9f7'}.icon-security:before{content:'\e9f8'}.icon-select-all:before{content:'\e9f9'}.icon-select-inverse:before{content:'\e9fa'}.icon-select-off:before{content:'\e9fb'}.icon-select:before{content:'\e9fc'}.icon-send:before{content:'\e9fd'}.icon-server-minus:before{content:'\e9fe'}.icon-server-network-off:before{content:'\e9ff'}.icon-server-network:before{content:'\ea00'}.icon-server-off:before{content:'\ea01'}.icon-server-plus:before{content:'\ea02'}.icon-server-remove:before{content:'\ea03'}.icon-server-security:before{content:'\ea04'}.icon-server:before{content:'\ea05'}.icon-shape-plus:before{content:'\ea06'}.icon-share-variant:before{content:'\ea07'}.icon-share:before{content:'\ea08'}.icon-shield-outline:before{content:'\ea09'}.icon-shield:before{content:'\ea0a'}.icon-shopping-music:before{content:'\ea0b'}.icon-shopping:before{content:'\ea0c'}.icon-shuffle:before{content:'\ea0d'}.icon-sigma:before{content:'\ea0e'}.icon-sign-caution:before{content:'\ea0f'}.icon-signal:before{content:'\ea10'}.icon-silverware-fork:before{content:'\ea11'}.icon-silverware-spoon:before{content:'\ea12'}.icon-silverware-variant:before{content:'\ea13'}.icon-silverware:before{content:'\ea14'}.icon-sim-alert:before{content:'\ea15'}.icon-sim:before{content:'\ea16'}.icon-sitemap:before{content:'\ea17'}.icon-skip-next:before{content:'\ea18'}.icon-skip-previous:before{content:'\ea19'}.icon-skype-business:before{content:'\ea1a'}.icon-skype:before{content:'\ea1b'}.icon-sleep-off:before{content:'\ea1c'}.icon-sleep:before{content:'\ea1d'}.icon-smoking-off:before{content:'\ea1e'}.icon-smoking:before{content:'\ea1f'}.icon-snapchat:before{content:'\ea20'}.icon-snowman:before{content:'\ea21'}.icon-sofa:before{content:'\ea22'}.icon-sort-alphabetical:before{content:'\ea23'}.icon-sort-ascending:before{content:'\ea24'}.icon-sort-descending:before{content:'\ea25'}.icon-sort-numeric:before{content:'\ea26'}.icon-sort-variant:before{content:'\ea27'}.icon-sort:before{content:'\ea28'}.icon-soundcloud:before{content:'\ea29'}.icon-source-fork:before{content:'\ea2a'}.icon-source-pull:before{content:'\ea2b'}.icon-speaker-off:before{content:'\ea2c'}.icon-speaker:before{content:'\ea2d'}.icon-speedometer:before{content:'\ea2e'}.icon-spellcheck:before{content:'\ea2f'}.icon-spotify:before{content:'\ea30'}.icon-spotlight-beam:before{content:'\ea31'}.icon-spotlight:before{content:'\ea32'}.icon-spreadsheet:before{content:'\ea33'}.icon-square-inc-cash:before{content:'\ea34'}.icon-square-inc:before{content:'\ea35'}.icon-stackoverflow:before{content:'\ea36'}.icon-star-circle:before{content:'\ea37'}.icon-star-half:before{content:'\ea38'}.icon-star-of-david:before{content:'\ea39'}.icon-star-outline:before{content:'\ea3a'}.icon-star:before{content:'\ea3b'}.icon-steam:before{content:'\ea3c'}.icon-stethoscope:before{content:'\ea3d'}.icon-stocking:before{content:'\ea3e'}.icon-stop:before{content:'\ea3f'}.icon-store-24-hour:before{content:'\ea40'}.icon-store:before{content:'\ea41'}.icon-stove:before{content:'\ea42'}.icon-subway:before{content:'\ea43'}.icon-sunglasses:before{content:'\ea44'}.icon-swap-horizontal:before{content:'\ea45'}.icon-swap-vertical:before{content:'\ea46'}.icon-swim:before{content:'\ea47'}.icon-sword:before{content:'\ea48'}.icon-sync-alert:before{content:'\ea49'}.icon-sync-off:before{content:'\ea4a'}.icon-sync:before{content:'\ea4b'}.icon-tab-unselected:before{content:'\ea4c'}.icon-tab:before{content:'\ea4d'}.icon-table-column-plus-after:before{content:'\ea4e'}.icon-table-column-plus-before:before{content:'\ea4f'}.icon-table-column-remove:before{content:'\ea50'}.icon-table-column-width:before{content:'\ea51'}.icon-table-edit:before{content:'\ea52'}.icon-table-large:before{content:'\ea53'}.icon-table-row-height:before{content:'\ea54'}.icon-table-row-plus-after:before{content:'\ea55'}.icon-table-row-plus-before:before{content:'\ea56'}.icon-table-row-remove:before{content:'\ea57'}.icon-table:before{content:'\ea58'}.icon-tablet-android:before{content:'\ea59'}.icon-tablet-ipad:before{content:'\ea5a'}.icon-tablet:before{content:'\ea5b'}.icon-tag-faces:before{content:'\ea5c'}.icon-tag-multiple:before{content:'\ea5d'}.icon-tag-outline:before{content:'\ea5e'}.icon-tag-text-outline:before{content:'\ea5f'}.icon-tag:before{content:'\ea60'}.icon-taxi:before{content:'\ea61'}.icon-teamviewer:before{content:'\ea62'}.icon-telegram:before{content:'\ea63'}.icon-television-guide:before{content:'\ea64'}.icon-television:before{content:'\ea65'}.icon-temperature-celsius:before{content:'\ea66'}.icon-temperature-fahrenheit:before{content:'\ea67'}.icon-temperature-kelvin:before{content:'\ea68'}.icon-tennis:before{content:'\ea69'}.icon-tent:before{content:'\ea6a'}.icon-terrain:before{content:'\ea6b'}.icon-text-to-speech-off:before{content:'\ea6c'}.icon-text-to-speech:before{content:'\ea6d'}.icon-texture:before{content:'\ea6e'}.icon-theater:before{content:'\ea6f'}.icon-theme-light-dark:before{content:'\ea70'}.icon-thermometer-lines:before{content:'\ea71'}.icon-thermometer:before{content:'\ea72'}.icon-thumb-down-outline:before{content:'\ea73'}.icon-thumb-down:before{content:'\ea74'}.icon-thumb-up-outline:before{content:'\ea75'}.icon-thumb-up:before{content:'\ea76'}.icon-thumbs-up-down:before{content:'\ea77'}.icon-ticket-account:before{content:'\ea78'}.icon-ticket:before{content:'\ea79'}.icon-tie:before{content:'\ea7a'}.icon-tile-four:before{content:'\ea7b'}.icon-timelapse:before{content:'\ea7c'}.icon-timer-3:before{content:'\ea7d'}.icon-timer-10:before{content:'\ea7e'}.icon-timer-off:before{content:'\ea7f'}.icon-timer-sand:before{content:'\ea80'}.icon-timer:before{content:'\ea81'}.icon-timetable:before{content:'\ea82'}.icon-toggle-switch-off:before{content:'\ea83'}.icon-toggle-switch-on:before{content:'\ea84'}.icon-tooltip-edit:before{content:'\ea85'}.icon-tooltip-image:before{content:'\ea86'}.icon-tooltip-outline-plus:before{content:'\ea87'}.icon-tooltip-outline:before{content:'\ea88'}.icon-tooltip-text:before{content:'\ea89'}.icon-tooltip:before{content:'\ea8a'}.icon-tor:before{content:'\ea8b'}.icon-traffic-light:before{content:'\ea8c'}.icon-train:before{content:'\ea8d'}.icon-tram:before{content:'\ea8e'}.icon-transcribe-close:before{content:'\ea8f'}.icon-transcribe:before{content:'\ea90'}.icon-transfer:before{content:'\ea91'}.icon-trash:before{content:'\ea92'}.icon-tree:before{content:'\ea93'}.icon-trello:before{content:'\ea94'}.icon-trending-down:before{content:'\ea95'}.icon-trending-neutral:before{content:'\ea96'}.icon-trending-up:before{content:'\ea97'}.icon-truck:before{content:'\ea98'}.icon-tshirt-crew:before{content:'\ea99'}.icon-tshirt-v:before{content:'\ea9a'}.icon-tumblr-reblog:before{content:'\ea9b'}.icon-tumblr:before{content:'\ea9c'}.icon-twitch:before{content:'\ea9d'}.icon-twitter-box:before{content:'\ea9e'}.icon-twitter-circle:before{content:'\ea9f'}.icon-twitter-retweet:before{content:'\eaa0'}.icon-twitter:before{content:'\eaa1'}.icon-ubuntu:before{content:'\eaa2'}.icon-umbrella-outline:before{content:'\eaa3'}.icon-umbrella:before{content:'\eaa4'}.icon-undo-variant:before{content:'\eaa5'}.icon-undo:before{content:'\eaa6'}.icon-unfold-less:before{content:'\eaa7'}.icon-unfold-more:before{content:'\eaa8'}.icon-ungroup:before{content:'\eaa9'}.icon-untappd:before{content:'\eaaa'}.icon-upload:before{content:'\eaab'}.icon-usb:before{content:'\eaac'}.icon-vector-curve:before{content:'\eaad'}.icon-vector-point:before{content:'\eaae'}.icon-vector-square:before{content:'\eaaf'}.icon-verified:before{content:'\eab0'}.icon-vibration:before{content:'\eab1'}.icon-video-off:before{content:'\eab2'}.icon-video-switch:before{content:'\eab3'}.icon-video:before{content:'\eab4'}.icon-view-agenda:before{content:'\eab5'}.icon-view-array:before{content:'\eab6'}.icon-view-carousel:before{content:'\eab7'}.icon-view-column:before{content:'\eab8'}.icon-view-dashboard:before{content:'\eab9'}.icon-view-day:before{content:'\eaba'}.icon-view-headline:before{content:'\eabb'}.icon-view-list:before{content:'\eabc'}.icon-view-module:before{content:'\eabd'}.icon-view-quilt:before{content:'\eabe'}.icon-view-stream:before{content:'\eabf'}.icon-view-week:before{content:'\eac0'}.icon-vimeo:before{content:'\eac1'}.icon-vine:before{content:'\eac2'}.icon-vk-box:before{content:'\eac3'}.icon-vk-circle:before{content:'\eac4'}.icon-vk:before{content:'\eac5'}.icon-voicemail:before{content:'\eac6'}.icon-volume-high:before{content:'\eac7'}.icon-volume-low:before{content:'\eac8'}.icon-volume-medium:before{content:'\eac9'}.icon-volume-off:before{content:'\eaca'}.icon-volume:before{content:'\eacb'}.icon-vpn:before{content:'\eacc'}.icon-walk:before{content:'\eacd'}.icon-wallet-giftcard:before{content:'\eace'}.icon-wallet-membership:before{content:'\eacf'}.icon-wallet-travel:before{content:'\ead0'}.icon-wallet:before{content:'\ead1'}.icon-washing-machine:before{content:'\ead2'}.icon-watch-export:before{content:'\ead3'}.icon-watch-import:before{content:'\ead4'}.icon-watch:before{content:'\ead5'}.icon-water-off:before{content:'\ead6'}.icon-water-pump:before{content:'\ead7'}.icon-water:before{content:'\ead8'}.icon-weather-cloudy:before{content:'\ead9'}.icon-weather-fog:before{content:'\eada'}.icon-weather-hail:before{content:'\eadb'}.icon-weather-lightning:before{content:'\eadc'}.icon-weather-night:before{content:'\eadd'}.icon-weather-partlycloudy:before{content:'\eade'}.icon-weather-pouring:before{content:'\eadf'}.icon-weather-rainy:before{content:'\eae0'}.icon-weather-snowy:before{content:'\eae1'}.icon-weather-sunny:before{content:'\eae2'}.icon-weather-sunset-down:before{content:'\eae3'}.icon-weather-sunset-up:before{content:'\eae4'}.icon-weather-sunset:before{content:'\eae5'}.icon-weather-windy-variant:before{content:'\eae6'}.icon-weather-windy:before{content:'\eae7'}.icon-web:before{content:'\eae8'}.icon-webcam:before{content:'\eae9'}.icon-weight-kilogram:before{content:'\eaea'}.icon-weight:before{content:'\eaeb'}.icon-whatsapp:before{content:'\eaec'}.icon-wheelchair-accessibility:before{content:'\eaed'}.icon-white-balance-auto:before{content:'\eaee'}.icon-white-balance-incandescent:before{content:'\eaef'}.icon-white-balance-irradescent:before{content:'\eaf0'}.icon-white-balance-sunny:before{content:'\eaf1'}.icon-wifi:before{content:'\eaf2'}.icon-wii:before{content:'\eaf3'}.icon-wikipedia:before{content:'\eaf4'}.icon-window-close:before{content:'\eaf5'}.icon-window-closed:before{content:'\eaf6'}.icon-window-maximize:before{content:'\eaf7'}.icon-window-minimize:before{content:'\eaf8'}.icon-window-open:before{content:'\eaf9'}.icon-window-restore:before{content:'\eafa'}.icon-windows:before{content:'\eafb'}.icon-wordpress:before{content:'\eafc'}.icon-worker:before{content:'\eafd'}.icon-wunderlist:before{content:'\eafe'}.icon-xbox-controller-off:before{content:'\eaff'}.icon-xbox-controller:before{content:'\eb00'}.icon-xbox:before{content:'\eb01'}.icon-xda:before{content:'\eb02'}.icon-xml:before{content:'\eb03'}.icon-yeast:before{content:'\eb04'}.icon-yelp:before{content:'\eb05'}.icon-youtube-play:before{content:'\eb06'}.icon-youtube:before{content:'\eb07'}.icon-zip-box:before{content:'\eb08'}.avatar{width:40px;min-width:40px;height:40px;line-height:40px;margin:0 8px 0 0;border-radius:50%;font-size:17px;font-weight:500;text-align:center;color:#fff}.avatar.square{border-radius:0}.avatar.small{width:20px;min-width:20px;height:20px;line-height:20px}.avatar.big{width:72px;min-width:72px;height:72px;line-height:72px}.avatar.huge{width:96px;min-width:96px;height:96px;line-height:96px}.form-wrapper{background:#fff;padding:16px}.form-wrapper .form-title{font-size:21px;padding:8px 0}.navigation-simple .item{position:relative;cursor:pointer;text-align:left;margin:0;padding:0 24px;text-transform:none;line-height:48px;max-height:48px;height:48px}.navigation-simple .item md-icon{margin:0 16px 0 0}.navigation-simple .item .title{font-size:13px;font-weight:500;line-height:1}.navigation-simple .item.selected{background-color:rgba(0,0,0,.06)}.navigation-simple .subheader{font-size:13px;border-top:1px solid rgba(0,0,0,.12);font-weight:500;margin-top:8px}.navigation-simple .subheader.light{border-top:1px solid rgba(255,255,255,.12)}.navigation-simple md-divider{margin:8px 0}.simple-pagination{position:relative;display:inline-flex;flex-direction:row;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);background-color:#fff;padding:0 8px}.simple-pagination .pagination-item{min-width:48px;min-height:56px;line-height:56px;border-radius:0;margin:0;font-weight:400;color:rgba(0,0,0,.54)}.simple-pagination .pagination-item:hover{color:rgba(0,0,0,.87)}.simple-pagination .pagination-item.active{cursor:default;color:rgba(0,0,0,.87)}.simple-pagination .pagination-item.disabled{cursor:default;color:rgba(0,0,0,.26)}.price-tables .price-table{position:relative;background-color:#fff;width:280px;border-radius:2px;margin:24px 24px 0 0;overflow:hidden}.price-tables .price-table.style-1 .package-type{font-size:17px;padding:16px 24px}.price-tables .price-table.style-1 .package-type .sale{font-size:13px;font-weight:600}.price-tables .price-table.style-1 .price{padding:32px 32px 16px 32px}.price-tables .price-table.style-1 .price .currency{padding-right:4px;font-size:24px;font-weight:500;color:rgba(0,0,0,.54)}.price-tables .price-table.style-1 .price .value{font-size:72px;font-weight:300;line-height:1}.price-tables .price-table.style-1 .price .period{padding:0 0 5px 4px;font-size:17px;color:rgba(0,0,0,.54)}.price-tables .price-table.style-1 md-divider{margin:16px 32px}.price-tables .price-table.style-1 .terms{padding:16px 32px;font-size:15px}.price-tables .price-table.style-1 .cta-button{margin:16px auto 32px auto;width:128px}.price-tables .price-table.style-2 .badge{position:absolute;top:0;left:50%;transform:translateX(-50%);font-size:11px;font-weight:500;padding:6px 8px}.price-tables .price-table.style-2 .package-type{padding:48px 32px 24px 32px;font-size:20px;font-weight:500;text-align:center}.price-tables .price-table.style-2 .price{padding:0 32px 8px 32px}.price-tables .price-table.style-2 .price .currency{padding-right:4px;font-size:24px;font-weight:500;color:rgba(0,0,0,.54)}.price-tables .price-table.style-2 .price .value{font-size:56px;font-weight:300;line-height:1}.price-tables .price-table.style-2 .period{padding:0 32px;font-size:15px;font-weight:500;color:rgba(0,0,0,.54);text-align:center}.price-tables .price-table.style-2 .terms{padding:32px;font-size:15px}.price-tables .price-table.style-2 .terms .term{padding-bottom:8px}.price-tables .price-table.style-2 .terms .term:last-child{padding-bottom:0}.price-tables .price-table.style-2 .cta-button{margin:8px auto 32px auto;width:128px}.price-tables .price-table.style-3 .package-type{padding:32px;text-align:center}.price-tables .price-table.style-3 .package-type .title{font-size:34px}.price-tables .price-table.style-3 .package-type .subtitle{font-size:17px;color:rgba(0,0,0,.54);font-weight:500}.price-tables .price-table.style-3 .price{padding:16px 32px}.price-tables .price-table.style-3 .price .currency{padding-right:4px;font-size:15px;font-weight:500}.price-tables .price-table.style-3 .price .value{font-size:34px;font-weight:300;line-height:1}.price-tables .price-table.style-3 .price .period{padding-left:4px;text-align:center}.price-tables .price-table.style-3 .terms{margin:32px;font-size:15px;color:rgba(0,0,0,.54)}.price-tables .price-table.style-3 .terms .term{padding-bottom:16px}.price-tables .price-table.style-3 .terms .term:last-child{padding-bottom:0}.price-tables .price-table.style-3 .cta-button{margin:8px 32px}.price-tables .price-table.style-3 .note{padding:8px 32px 16px 32px;text-align:center;color:rgba(0,0,0,.54)}.simple-table-container{background:#fff}.simple-table-container .table-title{font-size:20px;padding:24px}table.simple{width:100%;border:none;border-spacing:0;text-align:left}table.simple thead tr th{padding:16px 8px;font-weight:500;color:rgba(0,0,0,.54);border-bottom:1px solid rgba(0,0,0,.12);white-space:nowrap;min-width:120px}table.simple thead tr th:first-child{padding-left:24px}table.simple thead tr th:last-child{padding-right:24px}table.simple tbody tr td{padding:16px 8px;border-bottom:1px solid rgba(0,0,0,.12)}table.simple tbody tr td:first-child{padding-left:24px}table.simple tbody tr td:last-child{padding-right:24px}table.simple tbody tr:last-child td{border-bottom:none}table.simple.clickable tbody tr{cursor:pointer}table.simple.clickable tbody tr:hover{background:rgba(0,0,0,.03)}html{font-size:62.5%;font-family:Roboto,"Helvetica Neue",Arial,sans-serif;line-height:1.4;letter-spacing:-.1px}body{font-size:1.3rem}body,html{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}form{font-size:1.6rem}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-weight:400}.h1,h1{font-size:2.4rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.6rem}.h4,h4{font-size:1.4rem}.h5,h5{font-size:1.3rem}.h6,h6{font-size:1.2rem}a{text-decoration:none}a:active,a:hover{text-decoration:underline}abbr{cursor:help;border-bottom:1px dotted rgba(0,0,0,.54)}blockquote{border-left:3px solid rgba(0,0,0,.12);font-style:italic;margin:1em 0;padding-left:16px}blockquote footer{font-style:normal}blockquote footer:before{content:'\2014 \00A0'}blockquote.reverse{border-left:none;border-right:3px solid rgba(0,0,0,.12);text-align:right;padding-left:0;padding-right:16px}blockquote.reverse footer:before{content:''}blockquote.reverse footer:after{content:'\2014 \00A0'}code{font-family:Monaco,Menlo,Consolas,"Ubuntu Mono",monospace}code:not(.highlight){background:rgba(0,0,0,.065);color:#106cc8;margin:0 1px;padding:2px 3px;border-radius:2px}dl dt{font-weight:700}dl dd{margin:4px 0 16px 0}mark{background:#f7f49a}pre{line-height:1.6;margin:8px 16px;white-space:pre-wrap}small{font-size:80%}table thead tr th{text-align:left}.text-italic{font-style:italic}.text-semibold{font-weight:600}.text-bold,strong{font-weight:700}.text-strike{text-decoration:line-through}.text-super{vertical-align:super}.text-sub{vertical-align:sub}.text-capitalize{text-transform:capitalize}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-weight-100{font-weight:100}.font-weight-200{font-weight:200}.font-weight-300{font-weight:300}.font-weight-400{font-weight:400}.font-weight-500{font-weight:500}.font-weight-600{font-weight:600}.font-weight-700{font-weight:700}.font-weight-800{font-weight:800}.font-weight-900{font-weight:900}.font-size-2{font-size:2px}.font-size-4{font-size:4px}.font-size-6{font-size:6px}.font-size-8{font-size:8px}.font-size-10{font-size:10px}.font-size-12{font-size:12px}.font-size-14{font-size:14px}.font-size-16{font-size:16px}.font-size-18{font-size:18px}.font-size-20{font-size:20px}.font-size-22{font-size:22px}.font-size-24{font-size:24px}.font-size-26{font-size:26px}.font-size-28{font-size:28px}.font-size-30{font-size:30px}.font-size-32{font-size:32px}.font-size-34{font-size:34px}.font-size-36{font-size:36px}.font-size-38{font-size:38px}.font-size-40{font-size:40px}.font-size-42{font-size:42px}.font-size-44{font-size:44px}.font-size-46{font-size:46px}.font-size-48{font-size:48px}.font-size-50{font-size:50px}.font-size-52{font-size:52px}.font-size-54{font-size:54px}.font-size-56{font-size:56px}.font-size-58{font-size:58px}.font-size-60{font-size:60px}.font-size-62{font-size:62px}.font-size-64{font-size:64px}.font-size-66{font-size:66px}.font-size-68{font-size:68px}.font-size-70{font-size:70px}.font-size-72{font-size:72px}.font-size-74{font-size:74px}.font-size-76{font-size:76px}.font-size-78{font-size:78px}.font-size-80{font-size:80px}.font-size-82{font-size:82px}.font-size-84{font-size:84px}.font-size-86{font-size:86px}.font-size-88{font-size:88px}.font-size-90{font-size:90px}.font-size-92{font-size:92px}.font-size-94{font-size:94px}.font-size-96{font-size:96px}.font-size-98{font-size:98px}.font-size-100{font-size:100px}.font-size-102{font-size:102px}.font-size-104{font-size:104px}.font-size-106{font-size:106px}.font-size-108{font-size:108px}.font-size-110{font-size:110px}.font-size-112{font-size:112px}.font-size-114{font-size:114px}.font-size-116{font-size:116px}.font-size-118{font-size:118px}.font-size-120{font-size:120px}.line-height-2{line-height:2px}.line-height-4{line-height:4px}.line-height-6{line-height:6px}.line-height-8{line-height:8px}.line-height-10{line-height:10px}.line-height-12{line-height:12px}.line-height-14{line-height:14px}.line-height-16{line-height:16px}.line-height-18{line-height:18px}.line-height-20{line-height:20px}.line-height-22{line-height:22px}.line-height-24{line-height:24px}.line-height-26{line-height:26px}.line-height-28{line-height:28px}.line-height-30{line-height:30px}.line-height-32{line-height:32px}.line-height-34{line-height:34px}.line-height-36{line-height:36px}.line-height-38{line-height:38px}.line-height-40{line-height:40px}.line-height-42{line-height:42px}.line-height-44{line-height:44px}.line-height-46{line-height:46px}.line-height-48{line-height:48px}.line-height-50{line-height:50px}.line-height-52{line-height:52px}.line-height-54{line-height:54px}.line-height-56{line-height:56px}.line-height-58{line-height:58px}.line-height-60{line-height:60px}.line-height-62{line-height:62px}.line-height-64{line-height:64px}.line-height-66{line-height:66px}.line-height-68{line-height:68px}.line-height-70{line-height:70px}.line-height-72{line-height:72px}.line-height-74{line-height:74px}.line-height-76{line-height:76px}.line-height-78{line-height:78px}.line-height-80{line-height:80px}.line-height-82{line-height:82px}.line-height-84{line-height:84px}.line-height-86{line-height:86px}.line-height-88{line-height:88px}.line-height-90{line-height:90px}.line-height-92{line-height:92px}.line-height-94{line-height:94px}.line-height-96{line-height:96px}.line-height-98{line-height:98px}.line-height-100{line-height:100px}.line-height-102{line-height:102px}.line-height-104{line-height:104px}.line-height-106{line-height:106px}.line-height-108{line-height:108px}.line-height-110{line-height:110px}.line-height-112{line-height:112px}.line-height-114{line-height:114px}.line-height-116{line-height:116px}.line-height-118{line-height:118px}.line-height-120{line-height:120px}.text-boxed,.text-boxed-light{border-radius:2px;padding:4px 8px;margin:0 8px;font-size:11px;font-weight:500;color:rgba(0,0,0,.54);background-color:rgba(0,0,0,.12);white-space:nowrap}.text-boxed-light{background-color:rgba(255,255,255,.7)}.text-truncate{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-nowrap{white-space:nowrap}html,html *{scrollbar-width:thin;scrollbar-color:rgba(128,128,128,.25) rgba(128,128,128,.25)}::-webkit-scrollbar{width:8px;height:8px;background-color:transparent;box-shadow:none}::-webkit-scrollbar:hover{background-color:transparent}::-webkit-scrollbar-thumb{min-height:8px;min-width:8px;background-color:rgba(128,128,128,.25);box-shadow:none}::-webkit-scrollbar-thumb:hover{background-color:rgba(128,128,128,.125)}::-webkit-scrollbar-thumb:active{background-color:rgba(128,128,128,.15)}.angular-google-map-container{height:400px}.moment-picker .moment-picker-container{width:296px;border:none;border-radius:2px;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);margin-left:0;padding:8px}.moment-picker .moment-picker-container td,.moment-picker .moment-picker-container th{min-width:0;width:40px;height:40px;padding:8px;text-shadow:none;border-radius:35px}.moment-picker .moment-picker-container td:hover,.moment-picker .moment-picker-container th:hover{background:#f5f5f5;background-image:none}.moment-picker .moment-picker-container td.selected{background:#03a9f4;background-image:none}.moment-picker .moment-picker-container .header-view th{border-radius:0;white-space:nowrap;width:auto}.moment-picker .moment-picker-container .header-view th:first-child,.moment-picker .moment-picker-container .header-view th:last-child{width:20%}.c3{transition:all .3s ease}.c3 svg{font:12px RobotoDraft,Roboto,'Helvetica Neue',sans-serif}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{font-family:Roboto,"Helvetica Neue",Arial,sans-serif;user-select:none}.c3 .c3-bars path,.c3 .c3-event-rect,.c3 .c3-legend-item-tile,.c3 .c3-xgrid-focus,.c3 .c3-ygrid{shape-rendering:crispEdges}.c3 .c3-chart-line{transition:all .3s ease}.c3 .c3-line{stroke-width:1px}.c3.stroke-3 .c3-line{stroke-width:3px}.c3.stroke-2 .c3-line{stroke-width:2px}.c3 .c3-circle{transition:all .3s ease;stroke:#fff;stroke-width:2}.c3 .c3-circle._expanded_{stroke-width:3;stroke:#fff}.c3 .c3-chart-arc path{stroke:#fff}.c3 .c3-chart-arc text{fill:#fff;font-size:13px}.c3 .c3-grid line{stroke:rgba(0,0,0,.04);stroke-width:1px;stroke-dasharray:0}.c3 .c3-grid text{fill:#aaa}.c3 .c3-axis .tick{stroke-width:0}.c3 .c3-axis text{fill:rgba(0,0,0,.33)}.c3 .c3-axis line,.c3 .c3-axis path{stroke:rgba(0,0,0,.04)}.c3 .c3-xgrid,.c3 .c3-ygrid{stroke-dasharray:0 0}.c3 .c3-text.c3-empty{fill:grey;font-size:2em}.c3 .c3-bar{stroke-width:0}.c3 .c3-bar._expanded_{fill-opacity:.75}.c3 .c3-target.c3-focused{opacity:1}.c3 .c3-target.c3-focused .c3-target.c3-focused path.c3-step,.c3 .c3-target.c3-focused path.c3-line{stroke-width:3px;transition:all .3s ease}.c3 .c3-target.c3-defocused{opacity:.3!important}.c3 .c3-region{fill:#4682b4;fill-opacity:.1}.c3 .c3-brush .extent{fill-opacity:.1}.c3 .c3-legend-item{font-size:12px}.c3 .c3-legend-item-hidden{opacity:.15}.c3 .c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3 .c3-tooltip-container{z-index:10}.c3 .c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;box-shadow:0 2px 4px -1px rgba(0,0,0,.14),0 4px 5px 0 rgba(0,0,0,.098),0 1px 10px 0 rgba(0,0,0,.084);opacity:1;border-radius:2px;overflow:hidden;padding:4px 0}.c3 .c3-tooltip tr{border:none}.c3 .c3-tooltip th{background-color:transparent;font-size:14px;font-weight:400;padding:8px 12px;text-align:left;color:rgba(0,0,0,.54)}.c3 .c3-tooltip td{font-size:13px;padding:4px 12px!important;background-color:#fff;border-left:none;color:rgba(0,0,0,.84)}.c3 .c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3 .c3-tooltip td.value{font-size:14px!important;text-align:right;color:rgba(0,0,0,.84)}.c3 .c3-area{stroke-width:0;opacity:.2}.c3 .c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3 .c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3 .c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3 .c3-chart-arcs .c3-chart-arcs-gauge-max{fill:#777}.c3 .c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3 .c3-chart-arc .c3-gauge-value{fill:#000}.ct-label{font-size:13px}.ct-chart-donut .ct-label,.ct-chart-pie .ct-label{font-size:13px}.bar-legend,.chart-legend,.doughnut-legend,.line-legend,.pie-legend,.polararea-legend,.radar-legend{margin-top:15px}table.dataTable{width:100%;margin:0 auto;clear:both;border-spacing:0}table.dataTable thead tr{background:#fff}table.dataTable thead th{text-align:left;vertical-align:middle;border-bottom:1px solid rgba(0,0,0,.12);padding:16px 8px}table.dataTable thead th:first-child{padding-left:24px}table.dataTable thead th:last-child{border-right:none;padding-right:24px}table.dataTable thead th:active{outline:0}table.dataTable thead th.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap{white-space:nowrap}table.dataTable thead th .table-header .column-title{display:block;font-weight:600;white-space:nowrap}table.dataTable thead th .table-header .selectize-control{margin-top:15px}table.dataTable thead th .table-header .selectize-control.single .selectize-input{padding:7px 10px}table.dataTable thead th .table-header .selectize-control.single .selectize-input:after{right:10px;border-width:5px 4px 0 4px;border-color:rgba(0,0,0,.12) transparent transparent transparent}table.dataTable thead th .table-header .column-search-input{display:inline-block;margin-top:15px;width:100%;height:33px}table.dataTable thead td{padding:15px;vertical-align:middle}table.dataTable thead td:active{outline:0}table.dataTable thead td.dt-head-left{text-align:left}table.dataTable thead td.dt-head-center{text-align:center}table.dataTable thead td.dt-head-right{text-align:right}table.dataTable thead td.dt-head-justify{text-align:justify}table.dataTable thead td.dt-head-nowrap{white-space:nowrap}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{background:0 0}table.dataTable thead .sorting .table-header .column-title,table.dataTable thead .sorting_asc .table-header .column-title,table.dataTable thead .sorting_desc .table-header .column-title{cursor:pointer}table.dataTable thead .sorting .table-header .column-title:after,table.dataTable thead .sorting_asc .table-header .column-title:after,table.dataTable thead .sorting_desc .table-header .column-title:after{position:relative;font-family:icomoon;font-weight:400;margin-left:10px;top:2px;font-size:16px;color:rgba(0,0,0,.54)}table.dataTable thead .sorting .table-header .column-title:after{content:'\eaa8'}table.dataTable thead .sorting_asc .table-header .column-title:after{content:'\e718'}table.dataTable thead .sorting_desc .table-header .column-title:after{content:'\e715'}table.dataTable tfoot th{font-weight:600;text-align:left;padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable tfoot th.dt-head-left{text-align:left}table.dataTable tfoot th.dt-head-center{text-align:center}table.dataTable tfoot th.dt-head-right{text-align:right}table.dataTable tfoot th.dt-head-justify{text-align:justify}table.dataTable tfoot th.dt-head-nowrap{white-space:nowrap}table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody tr{background-color:#fff}table.dataTable tbody tr.selected{background-color:#b0bed9}table.dataTable tbody tr.details-open td.detail-column i{background:#fff}table.dataTable tbody tr.details-row.odd tr{background:#fff}table.dataTable tbody tr.details-row>td{padding:0}table.dataTable tbody th{padding:14px 15px;vertical-align:middle}table.dataTable tbody th.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap{white-space:nowrap}table.dataTable tbody td{padding:16px 8px;vertical-align:middle}table.dataTable tbody td:first-child{padding-left:24px}table.dataTable tbody td:last-child{padding-right:24px}table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable th.dt-left{text-align:left}table.dataTable th.dt-center{text-align:center}table.dataTable th.dt-right{text-align:right}table.dataTable th.dt-justify{text-align:justify}table.dataTable th.dt-nowrap{white-space:nowrap}table.dataTable td.dt-left{text-align:left}table.dataTable td.dt-center{text-align:center}table.dataTable td.dataTables_empty{height:51px;text-align:center}table.dataTable td.dt-right{text-align:right}table.dataTable td.dt-justify{text-align:justify}table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable.row-border thead{border-bottom:1px solid rgba(0,0,0,.12)}table.dataTable.row-border tbody tr:first-child th{border-top:none}table.dataTable.row-border tbody tr:first-child td{border-top:none}table.dataTable.row-border tbody tr:last-child td{border-bottom:1px solid rgba(0,0,0,.12)}table.dataTable.row-border tbody th{border-top:1px solid rgba(0,0,0,.12)}table.dataTable.row-border tbody td{border-top:1px solid rgba(0,0,0,.12)}table.dataTable.cell-border tbody tr:first-child th{border-top:none}table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th{border-top:1px solid rgba(0,0,0,.12);border-right:1px solid rgba(0,0,0,.12)}table.dataTable.cell-border tbody th:last-child{border-right:none}table.dataTable.cell-border tbody td{border-top:1px solid rgba(0,0,0,.12);border-right:1px solid rgba(0,0,0,.12)}table.dataTable.cell-border tbody td:last-child{border-right:none}table.dataTable.stripe tbody tr.odd{background-color:#fff}table.dataTable.stripe tbody tr.odd.selected{background-color:#abb9d3}table.dataTable.hover tbody tr:hover{background-color:#f5f5f5}table.dataTable.hover tbody tr:hover.selected{background-color:#a9b7d1}table.dataTable.hover tbody tr.odd:hover{background-color:#f5f5f5}table.dataTable.hover tbody tr.odd:hover.selected{background-color:#a9b7d1}table.dataTable.hover tbody tr.even:hover{background-color:#f5f5f5}table.dataTable.hover tbody tr.even:hover.selected{background-color:#a9b7d1}table.dataTable.order-column tbody tr>.sorting_1{background-color:#f9f9f9}table.dataTable.order-column tbody tr>.sorting_2{background-color:#f9f9f9}table.dataTable.order-column tbody tr>.sorting_3{background-color:#f9f9f9}table.dataTable.order-column tbody tr.selected>.sorting_1{background-color:#acbad4}table.dataTable.order-column tbody tr.selected>.sorting_2{background-color:#acbad4}table.dataTable.order-column tbody tr.selected>.sorting_3{background-color:#acbad4}table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:#f5f5f5}table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b3cd}table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a7b5ce}table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b6d0}table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#f9f9f9}table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fbfbfb}table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fdfdfd}table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad4}table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#adbbd6}table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ebebeb}table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#eee}table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a1aec7}table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a2afc8}table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a4b2cb}table.dataTable.order-column.hover tbody tr.odd:hover>.sorting_1{background-color:#eaeaea}table.dataTable.order-column.hover tbody tr.odd:hover>.sorting_2{background-color:#ebebeb}table.dataTable.order-column.hover tbody tr.odd:hover>.sorting_3{background-color:#eee}table.dataTable.order-column.hover tbody tr.odd:hover.selected>.sorting_1{background-color:#a1aec7}table.dataTable.order-column.hover tbody tr.odd:hover.selected>.sorting_2{background-color:#a2afc8}table.dataTable.order-column.hover tbody tr.odd:hover.selected>.sorting_3{background-color:#a4b2cb}table.dataTable.order-column.hover tbody tr.even:hover>.sorting_1{background-color:#eaeaea}table.dataTable.order-column.hover tbody tr.even:hover>.sorting_2{background-color:#ebebeb}table.dataTable.order-column.hover tbody tr.even:hover>.sorting_3{background-color:#eee}table.dataTable.order-column.hover tbody tr.even:hover.selected>.sorting_1{background-color:#a1aec7}table.dataTable.order-column.hover tbody tr.even:hover.selected>.sorting_2{background-color:#a2afc8}table.dataTable.order-column.hover tbody tr.even:hover.selected>.sorting_3{background-color:#a4b2cb}table.dataTable.no-footer{border-bottom:none}table.dataTable.nowrap th{white-space:nowrap}table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th{padding:5px 9px}table.dataTable.compact thead td{padding:5px 9px}table.dataTable.compact tfoot th{padding:5px 9px 3px 9px}table.dataTable.compact tfoot td{padding:5px 9px 3px 9px}table.dataTable.compact tbody th{padding:4px 5px}table.dataTable.compact tbody td{padding:4px 5px}.dataTables_wrapper{display:flex;flex:1 0 auto;flex-direction:column;min-height:0}.dataTables_wrapper .top{padding:16px 24px}.dataTables_wrapper .bottom{display:flex;min-height:64px;justify-content:space-between;padding:16px 8px;border-top:1px solid rgba(0,0,0,.12)}.dataTables_wrapper .bottom .left{display:flex;flex:0 0 50%;max-width:50%;align-self:center;padding:0 8px}.dataTables_wrapper .bottom .left .length{display:block}.dataTables_wrapper .bottom .right{display:flex;flex:0 0 50%;max-width:50%;align-self:center;justify-content:flex-end;padding:0 8px}.dataTables_wrapper .bottom .right .info{display:block;align-self:center}.dataTables_wrapper .bottom .right .info .dataTables_info{padding:0 8px;font-weight:600}.dataTables_wrapper .bottom .right .pagination{display:block;align-self:center;white-space:nowrap}.dataTables_wrapper .bottom .right .pagination .dataTables_paginate{padding:0;margin:0!important}.dataTables_wrapper .dataTables_filter{float:right}.dataTables_wrapper .dataTables_filter input{margin-left:.5em;border:1px solid rgba(0,0,0,.12);height:24px;padding:4px 8px}.dataTables_wrapper .dataTables_paginate .paginate_button{background:#fff;color:rgba(0,0,0,.87);border:1px solid rgba(0,0,0,.12);padding:9px 12px;border-radius:2px;cursor:pointer;user-select:none;margin:0 2px}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{box-shadow:inset 999em 0 0 0 rgba(0,0,0,.05);color:rgba(0,0,0,.87)!important;border:1px solid rgba(0,0,0,.12)!important;background:0 0}.dataTables_wrapper .dataTables_paginate .paginate_button:active{box-shadow:inset 999em 0 0 0 rgba(0,0,0,.08),inset 0 1px 3px 0 rgba(0,0,0,.1),0 1px 0 0 rgba(255,255,255,.35)}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover{color:rgba(0,0,0,.54)!important;border-color:rgba(0,0,0,.12)!important;background:#fff!important;box-shadow:none!important;cursor:default}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:#fff;background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(25%,rgba(255,255,255,.9)),color-stop(75%,rgba(255,255,255,.9)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,.9) 25%,rgba(255,255,255,.9) 75%,rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_scroll{display:flex;flex:1 1 0;flex-direction:column;clear:both;min-height:0}.dataTables_wrapper .dataTables_scroll table.dataTable{box-shadow:none}.dataTables_wrapper .dataTables_scroll table.dataTable.row-border thead{border:none}.dataTables_wrapper .dataTables_scroll .dataTables_scrollHead{display:flex;min-height:56px;box-shadow:0 0 0 1px rgba(0,0,0,.095),0 1px 1px 0 rgba(0,0,0,.1),0 2px 1px 0 rgba(0,0,0,.05);background:#fff;overflow:visible!important}.dataTables_wrapper .dataTables_scroll .dataTables_scrollHead tr th:last-child .table-header .column-title{position:relative;left:7px}.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody{display:flex;overflow-x:hidden!important;overflow-y:scroll!important;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody th>.dataTables_sizing{height:0;overflow:hidden;margin:0!important;padding:0!important}.dataTables_wrapper .dataTables_scroll .dataTables_scrollBody td>.dataTables_sizing{height:0;overflow:hidden;margin:0!important;padding:0!important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:none}.dataTables_wrapper.no-footer .dataTables_scrollBody table,.dataTables_wrapper.no-footer .dataTables_scrollHead table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:'';clear:both;height:0}table.dataTable .show-details{padding:5px 10px;font-weight:700}table.dataTable .action-buttons{display:flex;justify-content:center}table.dataTable .action-buttons .button{padding:8px}.fullpage-datatable .dataTables_wrapper{height:100%;max-height:100%}.explorer-11 .fullpage-datatable .dataTables_scroll{flex:1}table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr>td:first-child,table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr>th:first-child{padding-left:40px}table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr>td:first-child:before,table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr>th:first-child:before{content:'+';width:15px;height:15px;line-height:15px;top:50%;margin-top:-7px;left:8px;color:rgba(0,0,0,.54);background:0 0;border:none;box-shadow:0 0 0 2px rgba(0,0,0,.54);font-weight:700}table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr.parent>td:first-child:before,table.dataTable.dtr-inline.collapsed.dtr-inline.collapsed>tbody>tr.parent>th:first-child:before{background:0 0}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul{display:block}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul li{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;border-bottom:1px solid rgba(0,0,0,.12);padding:8px 0}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul li:first-child{padding-top:0}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul li:last-child{border-bottom:none;padding-bottom:0}table.dataTable.dtr-inline.collapsed>tbody>tr.child ul li .dtr-title{margin-right:8px}[hljs],hljs{display:block;overflow-x:auto;color:#333;background:#f8f8f8;-webkit-text-size-adjust:none}.diff .hljs-header,.hljs-comment{color:#998;font-style:italic}.css .rule .hljs-keyword,.hljs-keyword,.hljs-request,.hljs-status,.hljs-subst,.hljs-winutils,.nginx .hljs-title{color:#333;font-weight:700}.hljs-hexcolor,.hljs-number,.ruby .hljs-constant{color:teal}.hljs-doctag,.hljs-string,.hljs-tag .hljs-value,.tex .hljs-formula{color:#d14}.hljs-id,.hljs-title,.scss .hljs-preprocessor{color:#900;font-weight:700}.hljs-list .hljs-keyword,.hljs-subst{font-weight:400}.hljs-class .hljs-title,.hljs-type,.tex .hljs-command,.vhdl .hljs-literal{color:#458;font-weight:700}.django .hljs-tag .hljs-keyword,.hljs-rule .hljs-property,.hljs-tag,.hljs-tag .hljs-title{color:navy;font-weight:400}.hljs-attribute,.hljs-name,.hljs-variable,.lisp .hljs-body{color:teal}.hljs-regexp{color:#009926}.clojure .hljs-keyword,.hljs-prompt,.hljs-symbol,.lisp .hljs-keyword,.ruby .hljs-symbol .hljs-string,.scheme .hljs-keyword,.tex .hljs-special{color:#990073}.hljs-built_in{color:#0086b3}.hljs-cdata,.hljs-doctype,.hljs-pi,.hljs-pragma,.hljs-preprocessor,.hljs-shebang{color:#999;font-weight:700}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.diff .hljs-change{background:#0086b3}.hljs-chunk{color:#aaa}nvd3{display:block;width:100%;height:100%}nvd3.remove-x-lines .nv-x .tick line{display:none}nvd3.remove-y-lines .nv-y .tick line{display:none}nvd3.remove-line-stroke .nv-groups path.nv-line{stroke-width:0!important}nvd3.remove-opacity .nv-groups .nv-group{fill-opacity:1!important}nvd3.show-line-points .nv-line .nv-scatter .nv-groups .nv-point{fill-opacity:1!important;stroke-opacity:1!important}.nvd3 text{font-family:Roboto,"Helvetica Neue",Arial,sans-serif}.nvd3 line.nv-guideline{stroke:rgba(0,0,0,.54)}.nvd3 .nv-groups .nv-point.hover{stroke-width:3px!important;fill-opacity:1!important;stroke-opacity:1!important}.nvtooltip{background:0 0;color:#fff;padding:0;border:none}.nvtooltip.gravity-n:after{display:block;position:absolute;content:'';width:0;height:0;left:50%;bottom:100%;margin-left:-5px;border:5px solid transparent;border-bottom-color:rgba(0,0,0,.87)}.nvtooltip.gravity-s:after{display:block;position:absolute;content:'';width:0;height:0;top:100%;left:50%;margin-left:-5px;border:5px solid transparent;border-top-color:rgba(0,0,0,.87)}.nvtooltip.gravity-e:after{display:block;position:absolute;content:'';width:0;height:0;top:50%;right:0;margin-top:-6px;margin-right:-11px;border:6px solid transparent;border-left-color:rgba(0,0,0,.87)}.nvtooltip.gravity-w:after{display:block;position:absolute;content:'';width:0;height:0;top:50%;margin-top:-6px;margin-left:-11px;border:6px solid transparent;border-right-color:rgba(0,0,0,.87)}.nvtooltip table{background:rgba(0,0,0,.87);padding:8px 12px;margin:0;border-radius:2px}.nvtooltip table tbody tr td.legend-color-guide div{border:none}.nvtooltip table tbody tr td:last-child{padding-right:0}.ta-root{display:block}.ta-root .ta-scroll-window.form-control{border:1px solid rgba(0,0,0,.12)}.ta-root.focussed>.ta-scroll-window.form-control{outline:0 solid transparent;border:1px solid rgba(0,0,0,.12);box-shadow:none}.ta-root textarea.ta-editor.ta-html{resize:vertical;width:100%!important;border:1px solid rgba(0,0,0,.12);padding:16px}.ta-root .ta-toolbar{border:1px solid rgba(0,0,0,.12);border-bottom:none;background:#f5f5f5}.ta-root .ta-toolbar .ta-group{display:flex;align-items:center;align-content:center;flex-wrap:wrap}.ta-root .ta-toolbar .ta-group #toolbarCC,.ta-root .ta-toolbar .ta-group #toolbarWC{display:inline-block!important;line-height:24px}.ta-root .ta-toolbar .ta-group .md-button{width:40px;min-width:40px;line-height:14px;height:36px;min-height:36px;padding:6px;margin:4px 0}.ta-root .ta-toolbar .ta-group .md-button i{font-size:20px;width:20px;height:20px;line-height:20px}.ng-cloak,.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}.no-padding{padding:0!important}.no-margin{margin:0!important}.no-radius{border-radius:0}.divider-vertical{background:rgba(0,0,0,.12);height:24px;width:1px;margin:0 8px}.hidden{visibility:hidden;opacity:0}[fill-width]{min-width:100%}[fill-height]{min-height:100%}.full-height{height:100%!important}a img{display:block;outline:0}img{max-width:100%;height:auto;vertical-align:top;border:none}.scrollable{display:block;position:relative;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.scrollable.only-x{overflow-x:auto;overflow-y:hidden}.scrollable.only-y{overflow-x:hidden;overflow-y:auto}.flex-scrollable{position:relative;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.flex-scrollable.only-x{overflow-x:auto;overflow-y:hidden}.flex-scrollable.only-y{overflow-x:hidden;overflow-y:auto}.background-image-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:-1}.align-vertical:before{display:inline-block;height:100%;content:'';vertical-align:middle}.align-vertical .align-vertical-bottom,.align-vertical .align-vertical-middle,.align-vertical .align-vertical-top{display:inline-block}.align-vertical .align-vertical-top{vertical-align:top}.align-vertical .align-vertical-middle{vertical-align:middle}.align-vertical .align-vertical-bottom{vertical-align:bottom}.p-0,.padding-0{padding:0}.padding-top-0,.pt-0{padding-top:0}.padding-right-0,.pr-0{padding-right:0}.padding-bottom-0,.pb-0{padding-bottom:0}.padding-left-0,.pl-0{padding-left:0}.padding-horizontal-0,.ph-0{padding-left:0;padding-right:0}.padding-vertical-0,.pv-0{padding-top:0;padding-bottom:0}.p-5,.padding-5{padding:5px}.padding-top-5,.pt-5{padding-top:5px}.padding-right-5,.pr-5{padding-right:5px}.padding-bottom-5,.pb-5{padding-bottom:5px}.padding-left-5,.pl-5{padding-left:5px}.padding-horizontal-5,.ph-5{padding-left:5px;padding-right:5px}.padding-vertical-5,.pv-5{padding-top:5px;padding-bottom:5px}.p-10,.padding-10{padding:10px}.padding-top-10,.pt-10{padding-top:10px}.padding-right-10,.pr-10{padding-right:10px}.padding-bottom-10,.pb-10{padding-bottom:10px}.padding-left-10,.pl-10{padding-left:10px}.padding-horizontal-10,.ph-10{padding-left:10px;padding-right:10px}.padding-vertical-10,.pv-10{padding-top:10px;padding-bottom:10px}.p-15,.padding-15{padding:15px}.padding-top-15,.pt-15{padding-top:15px}.padding-right-15,.pr-15{padding-right:15px}.padding-bottom-15,.pb-15{padding-bottom:15px}.padding-left-15,.pl-15{padding-left:15px}.padding-horizontal-15,.ph-15{padding-left:15px;padding-right:15px}.padding-vertical-15,.pv-15{padding-top:15px;padding-bottom:15px}.p-20,.padding-20{padding:20px}.padding-top-20,.pt-20{padding-top:20px}.padding-right-20,.pr-20{padding-right:20px}.padding-bottom-20,.pb-20{padding-bottom:20px}.padding-left-20,.pl-20{padding-left:20px}.padding-horizontal-20,.ph-20{padding-left:20px;padding-right:20px}.padding-vertical-20,.pv-20{padding-top:20px;padding-bottom:20px}.p-25,.padding-25{padding:25px}.padding-top-25,.pt-25{padding-top:25px}.padding-right-25,.pr-25{padding-right:25px}.padding-bottom-25,.pb-25{padding-bottom:25px}.padding-left-25,.pl-25{padding-left:25px}.padding-horizontal-25,.ph-25{padding-left:25px;padding-right:25px}.padding-vertical-25,.pv-25{padding-top:25px;padding-bottom:25px}.p-30,.padding-30{padding:30px}.padding-top-30,.pt-30{padding-top:30px}.padding-right-30,.pr-30{padding-right:30px}.padding-bottom-30,.pb-30{padding-bottom:30px}.padding-left-30,.pl-30{padding-left:30px}.padding-horizontal-30,.ph-30{padding-left:30px;padding-right:30px}.padding-vertical-30,.pv-30{padding-top:30px;padding-bottom:30px}.p-35,.padding-35{padding:35px}.padding-top-35,.pt-35{padding-top:35px}.padding-right-35,.pr-35{padding-right:35px}.padding-bottom-35,.pb-35{padding-bottom:35px}.padding-left-35,.pl-35{padding-left:35px}.padding-horizontal-35,.ph-35{padding-left:35px;padding-right:35px}.padding-vertical-35,.pv-35{padding-top:35px;padding-bottom:35px}.p-40,.padding-40{padding:40px}.padding-top-40,.pt-40{padding-top:40px}.padding-right-40,.pr-40{padding-right:40px}.padding-bottom-40,.pb-40{padding-bottom:40px}.padding-left-40,.pl-40{padding-left:40px}.padding-horizontal-40,.ph-40{padding-left:40px;padding-right:40px}.padding-vertical-40,.pv-40{padding-top:40px;padding-bottom:40px}.p-45,.padding-45{padding:45px}.padding-top-45,.pt-45{padding-top:45px}.padding-right-45,.pr-45{padding-right:45px}.padding-bottom-45,.pb-45{padding-bottom:45px}.padding-left-45,.pl-45{padding-left:45px}.padding-horizontal-45,.ph-45{padding-left:45px;padding-right:45px}.padding-vertical-45,.pv-45{padding-top:45px;padding-bottom:45px}.p-50,.padding-50{padding:50px}.padding-top-50,.pt-50{padding-top:50px}.padding-right-50,.pr-50{padding-right:50px}.padding-bottom-50,.pb-50{padding-bottom:50px}.padding-left-50,.pl-50{padding-left:50px}.padding-horizontal-50,.ph-50{padding-left:50px;padding-right:50px}.padding-vertical-50,.pv-50{padding-top:50px;padding-bottom:50px}.p-55,.padding-55{padding:55px}.padding-top-55,.pt-55{padding-top:55px}.padding-right-55,.pr-55{padding-right:55px}.padding-bottom-55,.pb-55{padding-bottom:55px}.padding-left-55,.pl-55{padding-left:55px}.padding-horizontal-55,.ph-55{padding-left:55px;padding-right:55px}.padding-vertical-55,.pv-55{padding-top:55px;padding-bottom:55px}.p-60,.padding-60{padding:60px}.padding-top-60,.pt-60{padding-top:60px}.padding-right-60,.pr-60{padding-right:60px}.padding-bottom-60,.pb-60{padding-bottom:60px}.padding-left-60,.pl-60{padding-left:60px}.padding-horizontal-60,.ph-60{padding-left:60px;padding-right:60px}.padding-vertical-60,.pv-60{padding-top:60px;padding-bottom:60px}.p-65,.padding-65{padding:65px}.padding-top-65,.pt-65{padding-top:65px}.padding-right-65,.pr-65{padding-right:65px}.padding-bottom-65,.pb-65{padding-bottom:65px}.padding-left-65,.pl-65{padding-left:65px}.padding-horizontal-65,.ph-65{padding-left:65px;padding-right:65px}.padding-vertical-65,.pv-65{padding-top:65px;padding-bottom:65px}.p-70,.padding-70{padding:70px}.padding-top-70,.pt-70{padding-top:70px}.padding-right-70,.pr-70{padding-right:70px}.padding-bottom-70,.pb-70{padding-bottom:70px}.padding-left-70,.pl-70{padding-left:70px}.padding-horizontal-70,.ph-70{padding-left:70px;padding-right:70px}.padding-vertical-70,.pv-70{padding-top:70px;padding-bottom:70px}.p-75,.padding-75{padding:75px}.padding-top-75,.pt-75{padding-top:75px}.padding-right-75,.pr-75{padding-right:75px}.padding-bottom-75,.pb-75{padding-bottom:75px}.padding-left-75,.pl-75{padding-left:75px}.padding-horizontal-75,.ph-75{padding-left:75px;padding-right:75px}.padding-vertical-75,.pv-75{padding-top:75px;padding-bottom:75px}.p-80,.padding-80{padding:80px}.padding-top-80,.pt-80{padding-top:80px}.padding-right-80,.pr-80{padding-right:80px}.padding-bottom-80,.pb-80{padding-bottom:80px}.padding-left-80,.pl-80{padding-left:80px}.padding-horizontal-80,.ph-80{padding-left:80px;padding-right:80px}.padding-vertical-80,.pv-80{padding-top:80px;padding-bottom:80px}.p-85,.padding-85{padding:85px}.padding-top-85,.pt-85{padding-top:85px}.padding-right-85,.pr-85{padding-right:85px}.padding-bottom-85,.pb-85{padding-bottom:85px}.padding-left-85,.pl-85{padding-left:85px}.padding-horizontal-85,.ph-85{padding-left:85px;padding-right:85px}.padding-vertical-85,.pv-85{padding-top:85px;padding-bottom:85px}.p-90,.padding-90{padding:90px}.padding-top-90,.pt-90{padding-top:90px}.padding-right-90,.pr-90{padding-right:90px}.padding-bottom-90,.pb-90{padding-bottom:90px}.padding-left-90,.pl-90{padding-left:90px}.padding-horizontal-90,.ph-90{padding-left:90px;padding-right:90px}.padding-vertical-90,.pv-90{padding-top:90px;padding-bottom:90px}.p-95,.padding-95{padding:95px}.padding-top-95,.pt-95{padding-top:95px}.padding-right-95,.pr-95{padding-right:95px}.padding-bottom-95,.pb-95{padding-bottom:95px}.padding-left-95,.pl-95{padding-left:95px}.padding-horizontal-95,.ph-95{padding-left:95px;padding-right:95px}.padding-vertical-95,.pv-95{padding-top:95px;padding-bottom:95px}.p-100,.padding-100{padding:100px}.padding-top-100,.pt-100{padding-top:100px}.padding-right-100,.pr-100{padding-right:100px}.padding-bottom-100,.pb-100{padding-bottom:100px}.padding-left-100,.pl-100{padding-left:100px}.padding-horizontal-100,.ph-100{padding-left:100px;padding-right:100px}.padding-vertical-100,.pv-100{padding-top:100px;padding-bottom:100px}.p-8,.padding-8{padding:8px}.padding-top-8,.pt-8{padding-top:8px}.padding-right-8,.pr-8{padding-right:8px}.padding-bottom-8,.pb-8{padding-bottom:8px}.padding-left-8,.pl-8{padding-left:8px}.padding-horizontal-8,.ph-8{padding-left:8px;padding-right:8px}.padding-vertical-8,.pv-8{padding-top:8px;padding-bottom:8px}.p-16,.padding-16{padding:16px}.padding-top-16,.pt-16{padding-top:16px}.padding-right-16,.pr-16{padding-right:16px}.padding-bottom-16,.pb-16{padding-bottom:16px}.padding-left-16,.pl-16{padding-left:16px}.padding-horizontal-16,.ph-16{padding-left:16px;padding-right:16px}.padding-vertical-16,.pv-16{padding-top:16px;padding-bottom:16px}.p-24,.padding-24{padding:24px}.padding-top-24,.pt-24{padding-top:24px}.padding-right-24,.pr-24{padding-right:24px}.padding-bottom-24,.pb-24{padding-bottom:24px}.padding-left-24,.pl-24{padding-left:24px}.padding-horizontal-24,.ph-24{padding-left:24px;padding-right:24px}.padding-vertical-24,.pv-24{padding-top:24px;padding-bottom:24px}.p-32,.padding-32{padding:32px}.padding-top-32,.pt-32{padding-top:32px}.padding-right-32,.pr-32{padding-right:32px}.padding-bottom-32,.pb-32{padding-bottom:32px}.padding-left-32,.pl-32{padding-left:32px}.padding-horizontal-32,.ph-32{padding-left:32px;padding-right:32px}.padding-vertical-32,.pv-32{padding-top:32px;padding-bottom:32px}.p-48,.padding-48{padding:48px}.padding-top-48,.pt-48{padding-top:48px}.padding-right-48,.pr-48{padding-right:48px}.padding-bottom-48,.pb-48{padding-bottom:48px}.padding-left-48,.pl-48{padding-left:48px}.padding-horizontal-48,.ph-48{padding-left:48px;padding-right:48px}.padding-vertical-48,.pv-48{padding-top:48px;padding-bottom:48px}.p-56,.padding-56{padding:56px}.padding-top-56,.pt-56{padding-top:56px}.padding-right-56,.pr-56{padding-right:56px}.padding-bottom-56,.pb-56{padding-bottom:56px}.padding-left-56,.pl-56{padding-left:56px}.padding-horizontal-56,.ph-56{padding-left:56px;padding-right:56px}.padding-vertical-56,.pv-56{padding-top:56px;padding-bottom:56px}.p-64,.padding-64{padding:64px}.padding-top-64,.pt-64{padding-top:64px}.padding-right-64,.pr-64{padding-right:64px}.padding-bottom-64,.pb-64{padding-bottom:64px}.padding-left-64,.pl-64{padding-left:64px}.padding-horizontal-64,.ph-64{padding-left:64px;padding-right:64px}.padding-vertical-64,.pv-64{padding-top:64px;padding-bottom:64px}.p-72,.padding-72{padding:72px}.padding-top-72,.pt-72{padding-top:72px}.padding-right-72,.pr-72{padding-right:72px}.padding-bottom-72,.pb-72{padding-bottom:72px}.padding-left-72,.pl-72{padding-left:72px}.padding-horizontal-72,.ph-72{padding-left:72px;padding-right:72px}.padding-vertical-72,.pv-72{padding-top:72px;padding-bottom:72px}.p-88,.padding-88{padding:88px}.padding-top-88,.pt-88{padding-top:88px}.padding-right-88,.pr-88{padding-right:88px}.padding-bottom-88,.pb-88{padding-bottom:88px}.padding-left-88,.pl-88{padding-left:88px}.padding-horizontal-88,.ph-88{padding-left:88px;padding-right:88px}.padding-vertical-88,.pv-88{padding-top:88px;padding-bottom:88px}.p-96,.padding-96{padding:96px}.padding-top-96,.pt-96{padding-top:96px}.padding-right-96,.pr-96{padding-right:96px}.padding-bottom-96,.pb-96{padding-bottom:96px}.padding-left-96,.pl-96{padding-left:96px}.padding-horizontal-96,.ph-96{padding-left:96px;padding-right:96px}.padding-vertical-96,.pv-96{padding-top:96px;padding-bottom:96px}.m-0,.margin-0{margin:0}.margin-top-0,.mt-0{margin-top:0}.margin-right-0,.mr-0{margin-right:0}.margin-bottom-0,.mb-0{margin-bottom:0}.margin-left-0,.ml-0{margin-left:0}.margin-horizontal-0,.mh-0{margin-left:0;margin-right:0}.margin-vertical-0,.mv-0{margin-top:0;margin-bottom:0}.m-5,.margin-5{margin:5px}.margin-top-5,.mt-5{margin-top:5px}.margin-right-5,.mr-5{margin-right:5px}.margin-bottom-5,.mb-5{margin-bottom:5px}.margin-left-5,.ml-5{margin-left:5px}.margin-horizontal-5,.mh-5{margin-left:5px;margin-right:5px}.margin-vertical-5,.mv-5{margin-top:5px;margin-bottom:5px}.m-10,.margin-10{margin:10px}.margin-top-10,.mt-10{margin-top:10px}.margin-right-10,.mr-10{margin-right:10px}.margin-bottom-10,.mb-10{margin-bottom:10px}.margin-left-10,.ml-10{margin-left:10px}.margin-horizontal-10,.mh-10{margin-left:10px;margin-right:10px}.margin-vertical-10,.mv-10{margin-top:10px;margin-bottom:10px}.m-15,.margin-15{margin:15px}.margin-top-15,.mt-15{margin-top:15px}.margin-right-15,.mr-15{margin-right:15px}.margin-bottom-15,.mb-15{margin-bottom:15px}.margin-left-15,.ml-15{margin-left:15px}.margin-horizontal-15,.mh-15{margin-left:15px;margin-right:15px}.margin-vertical-15,.mv-15{margin-top:15px;margin-bottom:15px}.m-20,.margin-20{margin:20px}.margin-top-20,.mt-20{margin-top:20px}.margin-right-20,.mr-20{margin-right:20px}.margin-bottom-20,.mb-20{margin-bottom:20px}.margin-left-20,.ml-20{margin-left:20px}.margin-horizontal-20,.mh-20{margin-left:20px;margin-right:20px}.margin-vertical-20,.mv-20{margin-top:20px;margin-bottom:20px}.m-25,.margin-25{margin:25px}.margin-top-25,.mt-25{margin-top:25px}.margin-right-25,.mr-25{margin-right:25px}.margin-bottom-25,.mb-25{margin-bottom:25px}.margin-left-25,.ml-25{margin-left:25px}.margin-horizontal-25,.mh-25{margin-left:25px;margin-right:25px}.margin-vertical-25,.mv-25{margin-top:25px;margin-bottom:25px}.m-30,.margin-30{margin:30px}.margin-top-30,.mt-30{margin-top:30px}.margin-right-30,.mr-30{margin-right:30px}.margin-bottom-30,.mb-30{margin-bottom:30px}.margin-left-30,.ml-30{margin-left:30px}.margin-horizontal-30,.mh-30{margin-left:30px;margin-right:30px}.margin-vertical-30,.mv-30{margin-top:30px;margin-bottom:30px}.m-35,.margin-35{margin:35px}.margin-top-35,.mt-35{margin-top:35px}.margin-right-35,.mr-35{margin-right:35px}.margin-bottom-35,.mb-35{margin-bottom:35px}.margin-left-35,.ml-35{margin-left:35px}.margin-horizontal-35,.mh-35{margin-left:35px;margin-right:35px}.margin-vertical-35,.mv-35{margin-top:35px;margin-bottom:35px}.m-40,.margin-40{margin:40px}.margin-top-40,.mt-40{margin-top:40px}.margin-right-40,.mr-40{margin-right:40px}.margin-bottom-40,.mb-40{margin-bottom:40px}.margin-left-40,.ml-40{margin-left:40px}.margin-horizontal-40,.mh-40{margin-left:40px;margin-right:40px}.margin-vertical-40,.mv-40{margin-top:40px;margin-bottom:40px}.m-45,.margin-45{margin:45px}.margin-top-45,.mt-45{margin-top:45px}.margin-right-45,.mr-45{margin-right:45px}.margin-bottom-45,.mb-45{margin-bottom:45px}.margin-left-45,.ml-45{margin-left:45px}.margin-horizontal-45,.mh-45{margin-left:45px;margin-right:45px}.margin-vertical-45,.mv-45{margin-top:45px;margin-bottom:45px}.m-50,.margin-50{margin:50px}.margin-top-50,.mt-50{margin-top:50px}.margin-right-50,.mr-50{margin-right:50px}.margin-bottom-50,.mb-50{margin-bottom:50px}.margin-left-50,.ml-50{margin-left:50px}.margin-horizontal-50,.mh-50{margin-left:50px;margin-right:50px}.margin-vertical-50,.mv-50{margin-top:50px;margin-bottom:50px}.m-55,.margin-55{margin:55px}.margin-top-55,.mt-55{margin-top:55px}.margin-right-55,.mr-55{margin-right:55px}.margin-bottom-55,.mb-55{margin-bottom:55px}.margin-left-55,.ml-55{margin-left:55px}.margin-horizontal-55,.mh-55{margin-left:55px;margin-right:55px}.margin-vertical-55,.mv-55{margin-top:55px;margin-bottom:55px}.m-60,.margin-60{margin:60px}.margin-top-60,.mt-60{margin-top:60px}.margin-right-60,.mr-60{margin-right:60px}.margin-bottom-60,.mb-60{margin-bottom:60px}.margin-left-60,.ml-60{margin-left:60px}.margin-horizontal-60,.mh-60{margin-left:60px;margin-right:60px}.margin-vertical-60,.mv-60{margin-top:60px;margin-bottom:60px}.m-65,.margin-65{margin:65px}.margin-top-65,.mt-65{margin-top:65px}.margin-right-65,.mr-65{margin-right:65px}.margin-bottom-65,.mb-65{margin-bottom:65px}.margin-left-65,.ml-65{margin-left:65px}.margin-horizontal-65,.mh-65{margin-left:65px;margin-right:65px}.margin-vertical-65,.mv-65{margin-top:65px;margin-bottom:65px}.m-70,.margin-70{margin:70px}.margin-top-70,.mt-70{margin-top:70px}.margin-right-70,.mr-70{margin-right:70px}.margin-bottom-70,.mb-70{margin-bottom:70px}.margin-left-70,.ml-70{margin-left:70px}.margin-horizontal-70,.mh-70{margin-left:70px;margin-right:70px}.margin-vertical-70,.mv-70{margin-top:70px;margin-bottom:70px}.m-75,.margin-75{margin:75px}.margin-top-75,.mt-75{margin-top:75px}.margin-right-75,.mr-75{margin-right:75px}.margin-bottom-75,.mb-75{margin-bottom:75px}.margin-left-75,.ml-75{margin-left:75px}.margin-horizontal-75,.mh-75{margin-left:75px;margin-right:75px}.margin-vertical-75,.mv-75{margin-top:75px;margin-bottom:75px}.m-80,.margin-80{margin:80px}.margin-top-80,.mt-80{margin-top:80px}.margin-right-80,.mr-80{margin-right:80px}.margin-bottom-80,.mb-80{margin-bottom:80px}.margin-left-80,.ml-80{margin-left:80px}.margin-horizontal-80,.mh-80{margin-left:80px;margin-right:80px}.margin-vertical-80,.mv-80{margin-top:80px;margin-bottom:80px}.m-85,.margin-85{margin:85px}.margin-top-85,.mt-85{margin-top:85px}.margin-right-85,.mr-85{margin-right:85px}.margin-bottom-85,.mb-85{margin-bottom:85px}.margin-left-85,.ml-85{margin-left:85px}.margin-horizontal-85,.mh-85{margin-left:85px;margin-right:85px}.margin-vertical-85,.mv-85{margin-top:85px;margin-bottom:85px}.m-90,.margin-90{margin:90px}.margin-top-90,.mt-90{margin-top:90px}.margin-right-90,.mr-90{margin-right:90px}.margin-bottom-90,.mb-90{margin-bottom:90px}.margin-left-90,.ml-90{margin-left:90px}.margin-horizontal-90,.mh-90{margin-left:90px;margin-right:90px}.margin-vertical-90,.mv-90{margin-top:90px;margin-bottom:90px}.m-95,.margin-95{margin:95px}.margin-top-95,.mt-95{margin-top:95px}.margin-right-95,.mr-95{margin-right:95px}.margin-bottom-95,.mb-95{margin-bottom:95px}.margin-left-95,.ml-95{margin-left:95px}.margin-horizontal-95,.mh-95{margin-left:95px;margin-right:95px}.margin-vertical-95,.mv-95{margin-top:95px;margin-bottom:95px}.m-100,.margin-100{margin:100px}.margin-top-100,.mt-100{margin-top:100px}.margin-right-100,.mr-100{margin-right:100px}.margin-bottom-100,.mb-100{margin-bottom:100px}.margin-left-100,.ml-100{margin-left:100px}.margin-horizontal-100,.mh-100{margin-left:100px;margin-right:100px}.margin-vertical-100,.mv-100{margin-top:100px;margin-bottom:100px}.m-8,.margin-8{margin:8px}.margin-top-8,.mt-8{margin-top:8px}.margin-right-8,.mr-8{margin-right:8px}.margin-bottom-8,.mb-8{margin-bottom:8px}.margin-left-8,.ml-8{margin-left:8px}.margin-horizontal-8,.mh-8{margin-left:8px;margin-right:8px}.margin-vertical-8,.mv-8{margin-top:8px;margin-bottom:8px}.m-16,.margin-16{margin:16px}.margin-top-16,.mt-16{margin-top:16px}.margin-right-16,.mr-16{margin-right:16px}.margin-bottom-16,.mb-16{margin-bottom:16px}.margin-left-16,.ml-16{margin-left:16px}.margin-horizontal-16,.mh-16{margin-left:16px;margin-right:16px}.margin-vertical-16,.mv-16{margin-top:16px;margin-bottom:16px}.m-24,.margin-24{margin:24px}.margin-top-24,.mt-24{margin-top:24px}.margin-right-24,.mr-24{margin-right:24px}.margin-bottom-24,.mb-24{margin-bottom:24px}.margin-left-24,.ml-24{margin-left:24px}.margin-horizontal-24,.mh-24{margin-left:24px;margin-right:24px}.margin-vertical-24,.mv-24{margin-top:24px;margin-bottom:24px}.m-32,.margin-32{margin:32px}.margin-top-32,.mt-32{margin-top:32px}.margin-right-32,.mr-32{margin-right:32px}.margin-bottom-32,.mb-32{margin-bottom:32px}.margin-left-32,.ml-32{margin-left:32px}.margin-horizontal-32,.mh-32{margin-left:32px;margin-right:32px}.margin-vertical-32,.mv-32{margin-top:32px;margin-bottom:32px}.m-48,.margin-48{margin:48px}.margin-top-48,.mt-48{margin-top:48px}.margin-right-48,.mr-48{margin-right:48px}.margin-bottom-48,.mb-48{margin-bottom:48px}.margin-left-48,.ml-48{margin-left:48px}.margin-horizontal-48,.mh-48{margin-left:48px;margin-right:48px}.margin-vertical-48,.mv-48{margin-top:48px;margin-bottom:48px}.m-56,.margin-56{margin:56px}.margin-top-56,.mt-56{margin-top:56px}.margin-right-56,.mr-56{margin-right:56px}.margin-bottom-56,.mb-56{margin-bottom:56px}.margin-left-56,.ml-56{margin-left:56px}.margin-horizontal-56,.mh-56{margin-left:56px;margin-right:56px}.margin-vertical-56,.mv-56{margin-top:56px;margin-bottom:56px}.m-64,.margin-64{margin:64px}.margin-top-64,.mt-64{margin-top:64px}.margin-right-64,.mr-64{margin-right:64px}.margin-bottom-64,.mb-64{margin-bottom:64px}.margin-left-64,.ml-64{margin-left:64px}.margin-horizontal-64,.mh-64{margin-left:64px;margin-right:64px}.margin-vertical-64,.mv-64{margin-top:64px;margin-bottom:64px}.m-72,.margin-72{margin:72px}.margin-top-72,.mt-72{margin-top:72px}.margin-right-72,.mr-72{margin-right:72px}.margin-bottom-72,.mb-72{margin-bottom:72px}.margin-left-72,.ml-72{margin-left:72px}.margin-horizontal-72,.mh-72{margin-left:72px;margin-right:72px}.margin-vertical-72,.mv-72{margin-top:72px;margin-bottom:72px}.m-88,.margin-88{margin:88px}.margin-top-88,.mt-88{margin-top:88px}.margin-right-88,.mr-88{margin-right:88px}.margin-bottom-88,.mb-88{margin-bottom:88px}.margin-left-88,.ml-88{margin-left:88px}.margin-horizontal-88,.mh-88{margin-left:88px;margin-right:88px}.margin-vertical-88,.mv-88{margin-top:88px;margin-bottom:88px}.m-96,.margin-96{margin:96px}.margin-top-96,.mt-96{margin-top:96px}.margin-right-96,.mr-96{margin-right:96px}.margin-bottom-96,.mb-96{margin-bottom:96px}.margin-left-96,.ml-96{margin-left:96px}.margin-horizontal-96,.mh-96{margin-left:96px;margin-right:96px}.margin-vertical-96,.mv-96{margin-top:96px;margin-bottom:96px}.h-0,.height-0{height:0!important;min-height:0!important;max-height:0!important}.w-0,.width-0{width:0!important;min-width:0!important;max-width:0!important}.h-5,.height-5{height:5px!important;min-height:5px!important;max-height:5px!important}.w-5,.width-5{width:5px!important;min-width:5px!important;max-width:5px!important}.h-10,.height-10{height:10px!important;min-height:10px!important;max-height:10px!important}.w-10,.width-10{width:10px!important;min-width:10px!important;max-width:10px!important}.h-15,.height-15{height:15px!important;min-height:15px!important;max-height:15px!important}.w-15,.width-15{width:15px!important;min-width:15px!important;max-width:15px!important}.h-20,.height-20{height:20px!important;min-height:20px!important;max-height:20px!important}.w-20,.width-20{width:20px!important;min-width:20px!important;max-width:20px!important}.h-25,.height-25{height:25px!important;min-height:25px!important;max-height:25px!important}.w-25,.width-25{width:25px!important;min-width:25px!important;max-width:25px!important}.h-30,.height-30{height:30px!important;min-height:30px!important;max-height:30px!important}.w-30,.width-30{width:30px!important;min-width:30px!important;max-width:30px!important}.h-35,.height-35{height:35px!important;min-height:35px!important;max-height:35px!important}.w-35,.width-35{width:35px!important;min-width:35px!important;max-width:35px!important}.h-40,.height-40{height:40px!important;min-height:40px!important;max-height:40px!important}.w-40,.width-40{width:40px!important;min-width:40px!important;max-width:40px!important}.h-45,.height-45{height:45px!important;min-height:45px!important;max-height:45px!important}.w-45,.width-45{width:45px!important;min-width:45px!important;max-width:45px!important}.h-50,.height-50{height:50px!important;min-height:50px!important;max-height:50px!important}.w-50,.width-50{width:50px!important;min-width:50px!important;max-width:50px!important}.h-55,.height-55{height:55px!important;min-height:55px!important;max-height:55px!important}.w-55,.width-55{width:55px!important;min-width:55px!important;max-width:55px!important}.h-60,.height-60{height:60px!important;min-height:60px!important;max-height:60px!important}.w-60,.width-60{width:60px!important;min-width:60px!important;max-width:60px!important}.h-65,.height-65{height:65px!important;min-height:65px!important;max-height:65px!important}.w-65,.width-65{width:65px!important;min-width:65px!important;max-width:65px!important}.h-70,.height-70{height:70px!important;min-height:70px!important;max-height:70px!important}.w-70,.width-70{width:70px!important;min-width:70px!important;max-width:70px!important}.h-75,.height-75{height:75px!important;min-height:75px!important;max-height:75px!important}.w-75,.width-75{width:75px!important;min-width:75px!important;max-width:75px!important}.h-80,.height-80{height:80px!important;min-height:80px!important;max-height:80px!important}.w-80,.width-80{width:80px!important;min-width:80px!important;max-width:80px!important}.h-85,.height-85{height:85px!important;min-height:85px!important;max-height:85px!important}.w-85,.width-85{width:85px!important;min-width:85px!important;max-width:85px!important}.h-90,.height-90{height:90px!important;min-height:90px!important;max-height:90px!important}.w-90,.width-90{width:90px!important;min-width:90px!important;max-width:90px!important}.h-95,.height-95{height:95px!important;min-height:95px!important;max-height:95px!important}.w-95,.width-95{width:95px!important;min-width:95px!important;max-width:95px!important}.h-100,.height-100{height:100px!important;min-height:100px!important;max-height:100px!important}.w-100,.width-100{width:100px!important;min-width:100px!important;max-width:100px!important}.h-105,.height-105{height:105px!important;min-height:105px!important;max-height:105px!important}.w-105,.width-105{width:105px!important;min-width:105px!important;max-width:105px!important}.h-110,.height-110{height:110px!important;min-height:110px!important;max-height:110px!important}.w-110,.width-110{width:110px!important;min-width:110px!important;max-width:110px!important}.h-115,.height-115{height:115px!important;min-height:115px!important;max-height:115px!important}.w-115,.width-115{width:115px!important;min-width:115px!important;max-width:115px!important}.h-120,.height-120{height:120px!important;min-height:120px!important;max-height:120px!important}.w-120,.width-120{width:120px!important;min-width:120px!important;max-width:120px!important}.h-125,.height-125{height:125px!important;min-height:125px!important;max-height:125px!important}.w-125,.width-125{width:125px!important;min-width:125px!important;max-width:125px!important}.h-130,.height-130{height:130px!important;min-height:130px!important;max-height:130px!important}.w-130,.width-130{width:130px!important;min-width:130px!important;max-width:130px!important}.h-135,.height-135{height:135px!important;min-height:135px!important;max-height:135px!important}.w-135,.width-135{width:135px!important;min-width:135px!important;max-width:135px!important}.h-140,.height-140{height:140px!important;min-height:140px!important;max-height:140px!important}.w-140,.width-140{width:140px!important;min-width:140px!important;max-width:140px!important}.h-145,.height-145{height:145px!important;min-height:145px!important;max-height:145px!important}.w-145,.width-145{width:145px!important;min-width:145px!important;max-width:145px!important}.h-150,.height-150{height:150px!important;min-height:150px!important;max-height:150px!important}.w-150,.width-150{width:150px!important;min-width:150px!important;max-width:150px!important}.h-155,.height-155{height:155px!important;min-height:155px!important;max-height:155px!important}.w-155,.width-155{width:155px!important;min-width:155px!important;max-width:155px!important}.h-160,.height-160{height:160px!important;min-height:160px!important;max-height:160px!important}.w-160,.width-160{width:160px!important;min-width:160px!important;max-width:160px!important}.h-165,.height-165{height:165px!important;min-height:165px!important;max-height:165px!important}.w-165,.width-165{width:165px!important;min-width:165px!important;max-width:165px!important}.h-170,.height-170{height:170px!important;min-height:170px!important;max-height:170px!important}.w-170,.width-170{width:170px!important;min-width:170px!important;max-width:170px!important}.h-175,.height-175{height:175px!important;min-height:175px!important;max-height:175px!important}.w-175,.width-175{width:175px!important;min-width:175px!important;max-width:175px!important}.h-180,.height-180{height:180px!important;min-height:180px!important;max-height:180px!important}.w-180,.width-180{width:180px!important;min-width:180px!important;max-width:180px!important}.h-185,.height-185{height:185px!important;min-height:185px!important;max-height:185px!important}.w-185,.width-185{width:185px!important;min-width:185px!important;max-width:185px!important}.h-190,.height-190{height:190px!important;min-height:190px!important;max-height:190px!important}.w-190,.width-190{width:190px!important;min-width:190px!important;max-width:190px!important}.h-195,.height-195{height:195px!important;min-height:195px!important;max-height:195px!important}.w-195,.width-195{width:195px!important;min-width:195px!important;max-width:195px!important}.h-200,.height-200{height:200px!important;min-height:200px!important;max-height:200px!important}.w-200,.width-200{width:200px!important;min-width:200px!important;max-width:200px!important}.h-205,.height-205{height:205px!important;min-height:205px!important;max-height:205px!important}.w-205,.width-205{width:205px!important;min-width:205px!important;max-width:205px!important}.h-210,.height-210{height:210px!important;min-height:210px!important;max-height:210px!important}.w-210,.width-210{width:210px!important;min-width:210px!important;max-width:210px!important}.h-215,.height-215{height:215px!important;min-height:215px!important;max-height:215px!important}.w-215,.width-215{width:215px!important;min-width:215px!important;max-width:215px!important}.h-220,.height-220{height:220px!important;min-height:220px!important;max-height:220px!important}.w-220,.width-220{width:220px!important;min-width:220px!important;max-width:220px!important}.h-225,.height-225{height:225px!important;min-height:225px!important;max-height:225px!important}.w-225,.width-225{width:225px!important;min-width:225px!important;max-width:225px!important}.h-230,.height-230{height:230px!important;min-height:230px!important;max-height:230px!important}.w-230,.width-230{width:230px!important;min-width:230px!important;max-width:230px!important}.h-235,.height-235{height:235px!important;min-height:235px!important;max-height:235px!important}.w-235,.width-235{width:235px!important;min-width:235px!important;max-width:235px!important}.h-240,.height-240{height:240px!important;min-height:240px!important;max-height:240px!important}.w-240,.width-240{width:240px!important;min-width:240px!important;max-width:240px!important}.h-245,.height-245{height:245px!important;min-height:245px!important;max-height:245px!important}.w-245,.width-245{width:245px!important;min-width:245px!important;max-width:245px!important}.h-250,.height-250{height:250px!important;min-height:250px!important;max-height:250px!important}.w-250,.width-250{width:250px!important;min-width:250px!important;max-width:250px!important}.h-255,.height-255{height:255px!important;min-height:255px!important;max-height:255px!important}.w-255,.width-255{width:255px!important;min-width:255px!important;max-width:255px!important}.h-260,.height-260{height:260px!important;min-height:260px!important;max-height:260px!important}.w-260,.width-260{width:260px!important;min-width:260px!important;max-width:260px!important}.h-265,.height-265{height:265px!important;min-height:265px!important;max-height:265px!important}.w-265,.width-265{width:265px!important;min-width:265px!important;max-width:265px!important}.h-270,.height-270{height:270px!important;min-height:270px!important;max-height:270px!important}.w-270,.width-270{width:270px!important;min-width:270px!important;max-width:270px!important}.h-275,.height-275{height:275px!important;min-height:275px!important;max-height:275px!important}.w-275,.width-275{width:275px!important;min-width:275px!important;max-width:275px!important}.h-280,.height-280{height:280px!important;min-height:280px!important;max-height:280px!important}.w-280,.width-280{width:280px!important;min-width:280px!important;max-width:280px!important}.h-285,.height-285{height:285px!important;min-height:285px!important;max-height:285px!important}.w-285,.width-285{width:285px!important;min-width:285px!important;max-width:285px!important}.h-290,.height-290{height:290px!important;min-height:290px!important;max-height:290px!important}.w-290,.width-290{width:290px!important;min-width:290px!important;max-width:290px!important}.h-295,.height-295{height:295px!important;min-height:295px!important;max-height:295px!important}.w-295,.width-295{width:295px!important;min-width:295px!important;max-width:295px!important}.h-300,.height-300{height:300px!important;min-height:300px!important;max-height:300px!important}.w-300,.width-300{width:300px!important;min-width:300px!important;max-width:300px!important}.h-305,.height-305{height:305px!important;min-height:305px!important;max-height:305px!important}.w-305,.width-305{width:305px!important;min-width:305px!important;max-width:305px!important}.h-310,.height-310{height:310px!important;min-height:310px!important;max-height:310px!important}.w-310,.width-310{width:310px!important;min-width:310px!important;max-width:310px!important}.h-315,.height-315{height:315px!important;min-height:315px!important;max-height:315px!important}.w-315,.width-315{width:315px!important;min-width:315px!important;max-width:315px!important}.h-320,.height-320{height:320px!important;min-height:320px!important;max-height:320px!important}.w-320,.width-320{width:320px!important;min-width:320px!important;max-width:320px!important}.h-325,.height-325{height:325px!important;min-height:325px!important;max-height:325px!important}.w-325,.width-325{width:325px!important;min-width:325px!important;max-width:325px!important}.h-330,.height-330{height:330px!important;min-height:330px!important;max-height:330px!important}.w-330,.width-330{width:330px!important;min-width:330px!important;max-width:330px!important}.h-335,.height-335{height:335px!important;min-height:335px!important;max-height:335px!important}.w-335,.width-335{width:335px!important;min-width:335px!important;max-width:335px!important}.h-340,.height-340{height:340px!important;min-height:340px!important;max-height:340px!important}.w-340,.width-340{width:340px!important;min-width:340px!important;max-width:340px!important}.h-345,.height-345{height:345px!important;min-height:345px!important;max-height:345px!important}.w-345,.width-345{width:345px!important;min-width:345px!important;max-width:345px!important}.h-350,.height-350{height:350px!important;min-height:350px!important;max-height:350px!important}.w-350,.width-350{width:350px!important;min-width:350px!important;max-width:350px!important}.h-355,.height-355{height:355px!important;min-height:355px!important;max-height:355px!important}.w-355,.width-355{width:355px!important;min-width:355px!important;max-width:355px!important}.h-360,.height-360{height:360px!important;min-height:360px!important;max-height:360px!important}.w-360,.width-360{width:360px!important;min-width:360px!important;max-width:360px!important}.h-365,.height-365{height:365px!important;min-height:365px!important;max-height:365px!important}.w-365,.width-365{width:365px!important;min-width:365px!important;max-width:365px!important}.h-370,.height-370{height:370px!important;min-height:370px!important;max-height:370px!important}.w-370,.width-370{width:370px!important;min-width:370px!important;max-width:370px!important}.h-375,.height-375{height:375px!important;min-height:375px!important;max-height:375px!important}.w-375,.width-375{width:375px!important;min-width:375px!important;max-width:375px!important}.h-380,.height-380{height:380px!important;min-height:380px!important;max-height:380px!important}.w-380,.width-380{width:380px!important;min-width:380px!important;max-width:380px!important}.h-385,.height-385{height:385px!important;min-height:385px!important;max-height:385px!important}.w-385,.width-385{width:385px!important;min-width:385px!important;max-width:385px!important}.h-390,.height-390{height:390px!important;min-height:390px!important;max-height:390px!important}.w-390,.width-390{width:390px!important;min-width:390px!important;max-width:390px!important}.h-395,.height-395{height:395px!important;min-height:395px!important;max-height:395px!important}.w-395,.width-395{width:395px!important;min-width:395px!important;max-width:395px!important}.h-400,.height-400{height:400px!important;min-height:400px!important;max-height:400px!important}.w-400,.width-400{width:400px!important;min-width:400px!important;max-width:400px!important}.h-405,.height-405{height:405px!important;min-height:405px!important;max-height:405px!important}.w-405,.width-405{width:405px!important;min-width:405px!important;max-width:405px!important}.h-410,.height-410{height:410px!important;min-height:410px!important;max-height:410px!important}.w-410,.width-410{width:410px!important;min-width:410px!important;max-width:410px!important}.h-415,.height-415{height:415px!important;min-height:415px!important;max-height:415px!important}.w-415,.width-415{width:415px!important;min-width:415px!important;max-width:415px!important}.h-420,.height-420{height:420px!important;min-height:420px!important;max-height:420px!important}.w-420,.width-420{width:420px!important;min-width:420px!important;max-width:420px!important}.h-425,.height-425{height:425px!important;min-height:425px!important;max-height:425px!important}.w-425,.width-425{width:425px!important;min-width:425px!important;max-width:425px!important}.h-430,.height-430{height:430px!important;min-height:430px!important;max-height:430px!important}.w-430,.width-430{width:430px!important;min-width:430px!important;max-width:430px!important}.h-435,.height-435{height:435px!important;min-height:435px!important;max-height:435px!important}.w-435,.width-435{width:435px!important;min-width:435px!important;max-width:435px!important}.h-440,.height-440{height:440px!important;min-height:440px!important;max-height:440px!important}.w-440,.width-440{width:440px!important;min-width:440px!important;max-width:440px!important}.h-445,.height-445{height:445px!important;min-height:445px!important;max-height:445px!important}.w-445,.width-445{width:445px!important;min-width:445px!important;max-width:445px!important}.h-450,.height-450{height:450px!important;min-height:450px!important;max-height:450px!important}.w-450,.width-450{width:450px!important;min-width:450px!important;max-width:450px!important}.h-455,.height-455{height:455px!important;min-height:455px!important;max-height:455px!important}.w-455,.width-455{width:455px!important;min-width:455px!important;max-width:455px!important}.h-460,.height-460{height:460px!important;min-height:460px!important;max-height:460px!important}.w-460,.width-460{width:460px!important;min-width:460px!important;max-width:460px!important}.h-465,.height-465{height:465px!important;min-height:465px!important;max-height:465px!important}.w-465,.width-465{width:465px!important;min-width:465px!important;max-width:465px!important}.h-470,.height-470{height:470px!important;min-height:470px!important;max-height:470px!important}.w-470,.width-470{width:470px!important;min-width:470px!important;max-width:470px!important}.h-475,.height-475{height:475px!important;min-height:475px!important;max-height:475px!important}.w-475,.width-475{width:475px!important;min-width:475px!important;max-width:475px!important}.h-480,.height-480{height:480px!important;min-height:480px!important;max-height:480px!important}.w-480,.width-480{width:480px!important;min-width:480px!important;max-width:480px!important}.h-485,.height-485{height:485px!important;min-height:485px!important;max-height:485px!important}.w-485,.width-485{width:485px!important;min-width:485px!important;max-width:485px!important}.h-490,.height-490{height:490px!important;min-height:490px!important;max-height:490px!important}.w-490,.width-490{width:490px!important;min-width:490px!important;max-width:490px!important}.h-495,.height-495{height:495px!important;min-height:495px!important;max-height:495px!important}.w-495,.width-495{width:495px!important;min-width:495px!important;max-width:495px!important}.h-500,.height-500{height:500px!important;min-height:500px!important;max-height:500px!important}.w-500,.width-500{width:500px!important;min-width:500px!important;max-width:500px!important}.h-8,.height-8{height:8px!important;min-height:8px!important;max-height:8px!important}.w-8,.width-8{width:8px!important;min-width:8px!important;max-width:8px!important}.h-16,.height-16{height:16px!important;min-height:16px!important;max-height:16px!important}.w-16,.width-16{width:16px!important;min-width:16px!important;max-width:16px!important}.h-24,.height-24{height:24px!important;min-height:24px!important;max-height:24px!important}.w-24,.width-24{width:24px!important;min-width:24px!important;max-width:24px!important}.h-32,.height-32{height:32px!important;min-height:32px!important;max-height:32px!important}.w-32,.width-32{width:32px!important;min-width:32px!important;max-width:32px!important}.h-48,.height-48{height:48px!important;min-height:48px!important;max-height:48px!important}.w-48,.width-48{width:48px!important;min-width:48px!important;max-width:48px!important}.h-56,.height-56{height:56px!important;min-height:56px!important;max-height:56px!important}.w-56,.width-56{width:56px!important;min-width:56px!important;max-width:56px!important}.h-64,.height-64{height:64px!important;min-height:64px!important;max-height:64px!important}.w-64,.width-64{width:64px!important;min-width:64px!important;max-width:64px!important}.h-72,.height-72{height:72px!important;min-height:72px!important;max-height:72px!important}.w-72,.width-72{width:72px!important;min-width:72px!important;max-width:72px!important}.h-88,.height-88{height:88px!important;min-height:88px!important;max-height:88px!important}.w-88,.width-88{width:88px!important;min-width:88px!important;max-width:88px!important}.h-96,.height-96{height:96px!important;min-height:96px!important;max-height:96px!important}.w-96,.width-96{width:96px!important;min-width:96px!important;max-width:96px!important}.h-104,.height-104{height:104px!important;min-height:104px!important;max-height:104px!important}.w-104,.width-104{width:104px!important;min-width:104px!important;max-width:104px!important}.h-112,.height-112{height:112px!important;min-height:112px!important;max-height:112px!important}.w-112,.width-112{width:112px!important;min-width:112px!important;max-width:112px!important}.h-128,.height-128{height:128px!important;min-height:128px!important;max-height:128px!important}.w-128,.width-128{width:128px!important;min-width:128px!important;max-width:128px!important}.h-136,.height-136{height:136px!important;min-height:136px!important;max-height:136px!important}.w-136,.width-136{width:136px!important;min-width:136px!important;max-width:136px!important}.h-144,.height-144{height:144px!important;min-height:144px!important;max-height:144px!important}.w-144,.width-144{width:144px!important;min-width:144px!important;max-width:144px!important}.h-152,.height-152{height:152px!important;min-height:152px!important;max-height:152px!important}.w-152,.width-152{width:152px!important;min-width:152px!important;max-width:152px!important}.h-168,.height-168{height:168px!important;min-height:168px!important;max-height:168px!important}.w-168,.width-168{width:168px!important;min-width:168px!important;max-width:168px!important}.h-176,.height-176{height:176px!important;min-height:176px!important;max-height:176px!important}.w-176,.width-176{width:176px!important;min-width:176px!important;max-width:176px!important}.h-184,.height-184{height:184px!important;min-height:184px!important;max-height:184px!important}.w-184,.width-184{width:184px!important;min-width:184px!important;max-width:184px!important}.h-192,.height-192{height:192px!important;min-height:192px!important;max-height:192px!important}.w-192,.width-192{width:192px!important;min-width:192px!important;max-width:192px!important}.h-208,.height-208{height:208px!important;min-height:208px!important;max-height:208px!important}.w-208,.width-208{width:208px!important;min-width:208px!important;max-width:208px!important}.h-216,.height-216{height:216px!important;min-height:216px!important;max-height:216px!important}.w-216,.width-216{width:216px!important;min-width:216px!important;max-width:216px!important}.h-224,.height-224{height:224px!important;min-height:224px!important;max-height:224px!important}.w-224,.width-224{width:224px!important;min-width:224px!important;max-width:224px!important}.h-232,.height-232{height:232px!important;min-height:232px!important;max-height:232px!important}.w-232,.width-232{width:232px!important;min-width:232px!important;max-width:232px!important}.h-248,.height-248{height:248px!important;min-height:248px!important;max-height:248px!important}.w-248,.width-248{width:248px!important;min-width:248px!important;max-width:248px!important}.h-256,.height-256{height:256px!important;min-height:256px!important;max-height:256px!important}.w-256,.width-256{width:256px!important;min-width:256px!important;max-width:256px!important}.h-264,.height-264{height:264px!important;min-height:264px!important;max-height:264px!important}.w-264,.width-264{width:264px!important;min-width:264px!important;max-width:264px!important}.h-272,.height-272{height:272px!important;min-height:272px!important;max-height:272px!important}.w-272,.width-272{width:272px!important;min-width:272px!important;max-width:272px!important}.h-288,.height-288{height:288px!important;min-height:288px!important;max-height:288px!important}.w-288,.width-288{width:288px!important;min-width:288px!important;max-width:288px!important}.h-296,.height-296{height:296px!important;min-height:296px!important;max-height:296px!important}.w-296,.width-296{width:296px!important;min-width:296px!important;max-width:296px!important}.h-304,.height-304{height:304px!important;min-height:304px!important;max-height:304px!important}.w-304,.width-304{width:304px!important;min-width:304px!important;max-width:304px!important}.h-312,.height-312{height:312px!important;min-height:312px!important;max-height:312px!important}.w-312,.width-312{width:312px!important;min-width:312px!important;max-width:312px!important}.h-328,.height-328{height:328px!important;min-height:328px!important;max-height:328px!important}.w-328,.width-328{width:328px!important;min-width:328px!important;max-width:328px!important}.h-336,.height-336{height:336px!important;min-height:336px!important;max-height:336px!important}.w-336,.width-336{width:336px!important;min-width:336px!important;max-width:336px!important}.h-344,.height-344{height:344px!important;min-height:344px!important;max-height:344px!important}.w-344,.width-344{width:344px!important;min-width:344px!important;max-width:344px!important}.h-352,.height-352{height:352px!important;min-height:352px!important;max-height:352px!important}.w-352,.width-352{width:352px!important;min-width:352px!important;max-width:352px!important}.h-368,.height-368{height:368px!important;min-height:368px!important;max-height:368px!important}.w-368,.width-368{width:368px!important;min-width:368px!important;max-width:368px!important}.h-376,.height-376{height:376px!important;min-height:376px!important;max-height:376px!important}.w-376,.width-376{width:376px!important;min-width:376px!important;max-width:376px!important}.h-384,.height-384{height:384px!important;min-height:384px!important;max-height:384px!important}.w-384,.width-384{width:384px!important;min-width:384px!important;max-width:384px!important}.h-392,.height-392{height:392px!important;min-height:392px!important;max-height:392px!important}.w-392,.width-392{width:392px!important;min-width:392px!important;max-width:392px!important}.h-408,.height-408{height:408px!important;min-height:408px!important;max-height:408px!important}.w-408,.width-408{width:408px!important;min-width:408px!important;max-width:408px!important}.h-416,.height-416{height:416px!important;min-height:416px!important;max-height:416px!important}.w-416,.width-416{width:416px!important;min-width:416px!important;max-width:416px!important}.h-424,.height-424{height:424px!important;min-height:424px!important;max-height:424px!important}.w-424,.width-424{width:424px!important;min-width:424px!important;max-width:424px!important}.h-432,.height-432{height:432px!important;min-height:432px!important;max-height:432px!important}.w-432,.width-432{width:432px!important;min-width:432px!important;max-width:432px!important}.h-448,.height-448{height:448px!important;min-height:448px!important;max-height:448px!important}.w-448,.width-448{width:448px!important;min-width:448px!important;max-width:448px!important}.h-456,.height-456{height:456px!important;min-height:456px!important;max-height:456px!important}.w-456,.width-456{width:456px!important;min-width:456px!important;max-width:456px!important}.h-464,.height-464{height:464px!important;min-height:464px!important;max-height:464px!important}.w-464,.width-464{width:464px!important;min-width:464px!important;max-width:464px!important}.h-472,.height-472{height:472px!important;min-height:472px!important;max-height:472px!important}.w-472,.width-472{width:472px!important;min-width:472px!important;max-width:472px!important}.h-488,.height-488{height:488px!important;min-height:488px!important;max-height:488px!important}.w-488,.width-488{width:488px!important;min-width:488px!important;max-width:488px!important}.h-496,.height-496{height:496px!important;min-height:496px!important;max-height:496px!important}.w-496,.width-496{width:496px!important;min-width:496px!important;max-width:496px!important}.h-504,.height-504{height:504px!important;min-height:504px!important;max-height:504px!important}.w-504,.width-504{width:504px!important;min-width:504px!important;max-width:504px!important}.h-512,.height-512{height:512px!important;min-height:512px!important;max-height:512px!important}.w-512,.width-512{width:512px!important;min-width:512px!important;max-width:512px!important}.h-528,.height-528{height:528px!important;min-height:528px!important;max-height:528px!important}.w-528,.width-528{width:528px!important;min-width:528px!important;max-width:528px!important}.h-536,.height-536{height:536px!important;min-height:536px!important;max-height:536px!important}.w-536,.width-536{width:536px!important;min-width:536px!important;max-width:536px!important}.h-544,.height-544{height:544px!important;min-height:544px!important;max-height:544px!important}.w-544,.width-544{width:544px!important;min-width:544px!important;max-width:544px!important}.h-552,.height-552{height:552px!important;min-height:552px!important;max-height:552px!important}.w-552,.width-552{width:552px!important;min-width:552px!important;max-width:552px!important}.h-568,.height-568{height:568px!important;min-height:568px!important;max-height:568px!important}.w-568,.width-568{width:568px!important;min-width:568px!important;max-width:568px!important}.h-576,.height-576{height:576px!important;min-height:576px!important;max-height:576px!important}.w-576,.width-576{width:576px!important;min-width:576px!important;max-width:576px!important}.h-584,.height-584{height:584px!important;min-height:584px!important;max-height:584px!important}.w-584,.width-584{width:584px!important;min-width:584px!important;max-width:584px!important}.h-592,.height-592{height:592px!important;min-height:592px!important;max-height:592px!important}.w-592,.width-592{width:592px!important;min-width:592px!important;max-width:592px!important}.h-608,.height-608{height:608px!important;min-height:608px!important;max-height:608px!important}.w-608,.width-608{width:608px!important;min-width:608px!important;max-width:608px!important}.h-616,.height-616{height:616px!important;min-height:616px!important;max-height:616px!important}.w-616,.width-616{width:616px!important;min-width:616px!important;max-width:616px!important}.h-624,.height-624{height:624px!important;min-height:624px!important;max-height:624px!important}.w-624,.width-624{width:624px!important;min-width:624px!important;max-width:624px!important}.h-632,.height-632{height:632px!important;min-height:632px!important;max-height:632px!important}.w-632,.width-632{width:632px!important;min-width:632px!important;max-width:632px!important}.h-648,.height-648{height:648px!important;min-height:648px!important;max-height:648px!important}.w-648,.width-648{width:648px!important;min-width:648px!important;max-width:648px!important}.h-656,.height-656{height:656px!important;min-height:656px!important;max-height:656px!important}.w-656,.width-656{width:656px!important;min-width:656px!important;max-width:656px!important}.h-664,.height-664{height:664px!important;min-height:664px!important;max-height:664px!important}.w-664,.width-664{width:664px!important;min-width:664px!important;max-width:664px!important}.h-672,.height-672{height:672px!important;min-height:672px!important;max-height:672px!important}.w-672,.width-672{width:672px!important;min-width:672px!important;max-width:672px!important}.h-688,.height-688{height:688px!important;min-height:688px!important;max-height:688px!important}.w-688,.width-688{width:688px!important;min-width:688px!important;max-width:688px!important}.h-696,.height-696{height:696px!important;min-height:696px!important;max-height:696px!important}.w-696,.width-696{width:696px!important;min-width:696px!important;max-width:696px!important}.h-704,.height-704{height:704px!important;min-height:704px!important;max-height:704px!important}.w-704,.width-704{width:704px!important;min-width:704px!important;max-width:704px!important}.h-712,.height-712{height:712px!important;min-height:712px!important;max-height:712px!important}.w-712,.width-712{width:712px!important;min-width:712px!important;max-width:712px!important}.h-728,.height-728{height:728px!important;min-height:728px!important;max-height:728px!important}.w-728,.width-728{width:728px!important;min-width:728px!important;max-width:728px!important}.h-736,.height-736{height:736px!important;min-height:736px!important;max-height:736px!important}.w-736,.width-736{width:736px!important;min-width:736px!important;max-width:736px!important}.h-744,.height-744{height:744px!important;min-height:744px!important;max-height:744px!important}.w-744,.width-744{width:744px!important;min-width:744px!important;max-width:744px!important}.h-752,.height-752{height:752px!important;min-height:752px!important;max-height:752px!important}.w-752,.width-752{width:752px!important;min-width:752px!important;max-width:752px!important}.h-768,.height-768{height:768px!important;min-height:768px!important;max-height:768px!important}.w-768,.width-768{width:768px!important;min-width:768px!important;max-width:768px!important}.h-776,.height-776{height:776px!important;min-height:776px!important;max-height:776px!important}.w-776,.width-776{width:776px!important;min-width:776px!important;max-width:776px!important}.h-784,.height-784{height:784px!important;min-height:784px!important;max-height:784px!important}.w-784,.width-784{width:784px!important;min-width:784px!important;max-width:784px!important}.h-792,.height-792{height:792px!important;min-height:792px!important;max-height:792px!important}.w-792,.width-792{width:792px!important;min-width:792px!important;max-width:792px!important}.b,.border{border:1px solid rgba(0,0,0,.12)}.border-top,.bt{border-top:1px solid rgba(0,0,0,.12)}.border-right,.br{border-right:1px solid rgba(0,0,0,.12)}.bb,.border-bottom{border-bottom:1px solid rgba(0,0,0,.12)}.bl,.border-left{border-left:1px solid rgba(0,0,0,.12)}.bh,.border-horizontal{border-left:1px solid rgba(0,0,0,.12);border-right:1px solid rgba(0,0,0,.12)}.border-vertical,.bv{border-top:1px solid rgba(0,0,0,.12);border-bottom:1px solid rgba(0,0,0,.12)}.brad-1{border-radius:1px}.brad-2{border-radius:2px}.brad-3{border-radius:3px}.brad-4{border-radius:4px}.brad-5{border-radius:5px}.brad-6{border-radius:6px}.brad-7{border-radius:7px}.brad-8{border-radius:8px}.brad-9{border-radius:9px}.brad-10{border-radius:10px}.brad-11{border-radius:11px}.brad-12{border-radius:12px}@media all{.page-break{display:none}}@media print{.page-break{display:block;break-after:always;page-break-after:always}#main #vertical-navigation{display:none}#main #toolbar{display:none}#main #quick-panel{display:none}#main #content{position:relative!important;top:0!important;right:0!important;bottom:0!important;left:0!important;background:0 0!important}ms-theme-options{display:none}.ps-scrollbar-x-rail,.ps-scrollbar-y-rail{display:none!important}.printable{overflow:visible!important}.printable .template-layout{display:inline!important}}.advanced-search-container{border-bottom:1px rgba(0,0,0,.12) solid}.advanced-search-conditions{border-bottom:1px rgba(0,0,0,.12) solid;padding:4px 0}.advanced-search-conditions .errors{font-size:12px;color:#dd2c00;margin-top:10px}.advanced-search-conditions .advanced-search-chips md-chips-wrap{box-shadow:none}.advanced-search-conditions .advanced-search-chips md-chip{position:relative}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-content md-chip-template span p.filter-text{display:inline-block;margin:0}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container{position:absolute;right:4px;top:4px;margin-right:0;height:24px}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container button.remove-filter{position:relative;height:24px;width:24px;line-height:30px;text-align:center;border-radius:50%;border:none;box-shadow:none;padding:0;margin:0;transition:background .15s linear;display:block}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container button.remove-filter md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%,-50%,0);color:#616161}.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container button.remove-filter md-icon:focus,.advanced-search-conditions .advanced-search-chips md-chip .md-chip-remove-container button.remove-filter md-icon:hover{color:rgba(255,0,0,.8)}.advanced-search-conditions .advanced-search-chips md-chips-wrap.md-removable md-chip md-chip-template{padding-right:5px}.advanced-search-bar{padding:10px 0}.advanced-search-bar md-input-container.no-errors{font-size:12px;transition:0s none;-webkit-transition:0s none;animation:0s none;-webkit-animation:0s none}.advanced-search-bar md-input-container.no-errors input{font-family:Arial Unicode MS,Arial,Helvetica}.advanced-search-bar md-input-container.no-errors .md-errors-spacer{min-height:0}md-option div div.operators-list{display:table}md-option div div.operators-list span{display:table-cell}md-option div div.operators-list span.operator-symbol{display:table-cell;font-size:14px;width:30px}.advanced-search-bar mdp-date-picker button{margin:0!important}.advanced-search-bar mdp-date-picker md-input-container{flex:1;margin:0}.advanced-search-bar mdp-date-picker md-input-container label{font-size:12px}.advanced-search-bar mdp-date-picker md-input-container .md-errors-spacer{min-height:0}.advanced-search-bar div md-date-range{font-size:12px;margin-left:10px}.advanced-search-bar div.autocomplete-input md-icon{margin:8px 8px 8px 0}.advanced-search-bar div.autocomplete-input md-autocomplete{font-size:12px!important}.advanced-search-bar div.autocomplete-input md-autocomplete md-autocomplete-wrap{height:0}.advanced-search-bar div.autocomplete-input md-autocomplete md-autocomplete-wrap md-input-container{margin:0}.advanced-search-bar div.autocomplete-input md-autocomplete md-autocomplete-wrap md-input-container input[type=search]{padding:0!important}.advanced-search-bar div.autocomplete-input md-autocomplete md-autocomplete-wrap md-input-container div.md-errors-spacer{min-height:0}md-toolbar.advanced-search-dialog-header{background-image:url(/assets/images/backgrounds/header-bg.png);background-position:top}.md-autocomplete-suggestions-container li .highlight,.md-autocomplete-suggestions-container.md-default-theme li .highlight{color:#ca1d1d;font-weight:700}.chip-disabled{opacity:.4}.ms-card{display:flex;flex-direction:row;padding:8px}.ms-card .ms-card-content-wrapper{position:relative;overflow:hidden;width:100%;max-width:400px;border-radius:2px;background:#fff;box-shadow:0 3px 1px -2px rgba(0,0,0,.14),0 2px 2px 0 rgba(0,0,0,.098),0 1px 5px 0 rgba(0,0,0,.084)}.ms-card .template-1 .media .image{width:100%;border-radius:2px 2px 0 0}.ms-card .template-10 .media{width:80px;min-width:80px;max-width:80px}.ms-card .template-2 .header .avatar .image{display:block;width:40px;height:40px;border-radius:20px}.ms-card .template-2 .media .image{width:100%}.ms-card .template-4 .info{position:absolute;right:0;bottom:0;left:0;z-index:2;background:rgba(0,0,0,.54)}.ms-card .template-4 .media{z-index:1}.ms-card .template-4 .media .image{width:100%}.ms-card .template-5 .media{width:80px;min-width:80px;max-width:80px}.ms-card .template-5 .info,.ms-card .template-5 .media{-ms-flex:0 1 auto}.ms-card .template-8 .media .image{width:100%;border-radius:2px 2px 0 0}.ms-card .template-9 .header .avatar .image{display:block;width:40px;height:40px;border-radius:20px}.ms-card .template-9 .media .image{width:100%}md-tooltip.client-side-logging-tooltip div.md-content{height:auto;max-width:200px;white-space:normal;text-align:center}md-list-item .md-list-item-text p.ms-dual-multiselect-line-xs{font-size:10px!important;padding-top:5px}md-list-item md-icon.hidden{visibility:hidden}md-icon.add-disabled{cursor:default!important;opacity:.4}md-list-item.read-only-mode{cursor:none!important}.ms-form-wizard{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-form-wizard md-tabs md-tabs-wrapper{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas{height:72px}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper{height:72px}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item{opacity:1!important;padding:24px}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item:before{content:'';display:block;position:absolute;top:50%;left:0;right:50%;border-bottom:1px solid rgba(0,0,0,.12);z-index:8}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item:after{content:'';display:block;position:absolute;top:50%;left:50%;right:0;border-bottom:1px solid rgba(0,0,0,.12);z-index:8}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item:first-of-type:before{display:none}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item:last-of-type:after{display:none}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item.md-disabled .ms-form-wizard-step-label .ms-form-wizard-step-number{background:rgba(0,0,0,.12)!important}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-pagination-wrapper md-tab-item .md-ripple-container{z-index:11}.ms-form-wizard md-tabs md-tabs-wrapper md-tabs-canvas md-ink-bar{display:none!important}.ms-form-wizard .ms-form-wizard-step-label{display:inline-block;position:relative;background:#fff;z-index:10;padding:0 16px;line-height:24px}.ms-form-wizard .ms-form-wizard-step-label .ms-form-wizard-step-number{display:inline-block;vertical-align:middle;width:24px;height:24px;line-height:24px;font-size:14px;margin-right:12px;border-radius:50%;color:#fff!important}.ms-form-wizard .ms-form-wizard-step-label .ms-form-wizard-step-number i{line-height:24px!important}.ms-form-wizard .ms-form-wizard-step-label .ms-form-wizard-step-text{display:inline-block;vertical-align:middle;position:relative;line-height:24px}.ms-form-wizard .ms-form-wizard-form{padding:24px 16px}.ms-form-wizard .navigation{padding:16px}.ms-form-wizard .navigation .steps{display:flex;align-items:center;justify-content:center;padding:0 16px}.ms-form-wizard .navigation .steps span{width:5px;height:5px;margin:0 4px;border-radius:50%}.ms-form-wizard .navigation .steps span:not(.md-accent-bg){background:rgba(0,0,0,.12)}.ms-form-wizard .navigation .steps span.selected{width:8px;height:8px}ms-info-bar{display:block;position:relative;width:100%;height:44px;background-color:#e91e63;z-index:99998;box-shadow:0 1px 5px 0 rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12)}ms-info-bar #ms-info-bar-message{padding:8px 16px;line-height:28px;font-size:14px}ms-info-bar #ms-info-bar-message a{overflow:hidden;height:48px;color:#fff}ms-masonry{width:100%;display:block}ms-masonry [ms-masonry-item],ms-masonry ms-masonry-item{transition:transform .3s ease;position:absolute;transform:translate3d(50vw,100vh,0)}ms-material-color-picker md-menu .md-button{font-size:12px}md-menu-content.ms-material-color-picker-menu-content{width:208px;max-width:208px;min-width:208px;padding:0;overflow:hidden}md-menu-content.ms-material-color-picker-menu-content header{height:48px;text-transform:uppercase}md-menu-content.ms-material-color-picker-menu-content header .md-button{display:flex;margin:0}md-menu-content.ms-material-color-picker-menu-content header>span{line-height:13px}md-menu-content.ms-material-color-picker-menu-content .colors{position:relative;width:208px;min-height:258px;height:258px;padding:4px}md-menu-content.ms-material-color-picker-menu-content .colors .color{position:relative;width:46px;height:46px;margin:2px;border-radius:0;cursor:pointer}md-menu-content.ms-material-color-picker-menu-content .colors .color .label{padding:2px;font-size:10px}md-menu-content.ms-material-color-picker-menu-content .colors .color .icon-check{position:absolute;top:2px;right:2px;font-size:16px;opacity:.7}ms-nav{display:block;position:relative;color:rgba(255,255,255,.7);user-select:none;z-index:70}ms-nav ms-nav-item{display:block;position:relative;line-height:48px}ms-nav ms-nav-item.ms-nav-title{line-height:32px;font-size:12px;font-weight:500;margin-top:8px;padding:0 24px;width:100%;color:rgba(255,255,255,.3);text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}ms-nav ms-nav-item .ms-nav-button{display:flex;align-self:flex-start;align-items:center;position:relative;cursor:pointer;padding:0 48px 0 24px;color:rgba(255,255,255,.7);text-decoration:none}ms-nav ms-nav-item .ms-nav-button:not(.active):hover{background:rgba(0,0,0,.1);text-decoration:none}ms-nav ms-nav-item .ms-nav-button .ms-nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s ease-in-out .1s}ms-nav ms-nav-item .ms-nav-button .arrow{position:absolute;top:16px;right:24px;margin:0;transition:transform .3s ease-in-out,opacity .2s ease-in-out .1s}ms-nav ms-nav-item .ms-nav-button .ms-nav-badge{position:absolute;top:50%;right:24px;min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transform:translateY(-50%);transition:opacity .2s ease-in-out .1s}ms-nav ms-nav-item .ms-nav-button.active{color:#fff!important}ms-nav ms-nav-item .ms-nav-button.active .ms-nav-badge{background:#fff!important;color:rgba(0,0,0,.87)!important}ms-nav ms-nav-item .ms-nav-button.active i{color:#fff}ms-nav ms-nav-item i{color:rgba(255,255,255,.7);margin:0 16px 0 0}ms-nav .ms-nav-toggle ms-nav-toggle-items{display:none;overflow:hidden}ms-nav .ms-nav-toggle ms-nav-toggle-items.expand-animation{transition:height .35s cubic-bezier(.25,.46,.45,.94)}ms-nav .ms-nav-toggle ms-nav-toggle-items.collapse-animation{transition:height .35s cubic-bezier(.25,.46,.45,.94)}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:58px}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:68px}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:78px}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:88px}ms-nav .ms-nav-toggle ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item ms-nav-toggle-items ms-nav-item .ms-nav-button{padding-left:98px}ms-nav .ms-nav-toggle.active>.ms-nav-button{color:#fff}ms-nav .ms-nav-toggle.active>.ms-nav-button a,ms-nav .ms-nav-toggle.active>.ms-nav-button md-icon{color:#fff}ms-nav .ms-nav-toggle[collapsed=false]>.ms-nav-button>.arrow{transform:rotate(90deg)}ms-nav>.ms-nav-toggle[collapsed=false]{background-color:rgba(0,0,0,.12)}@media only screen and (min-width:1280px){.ms-nav-folded #ms-nav-fold-close-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:0 0;z-index:998}.ms-nav-folded #ms-nav-fold-open-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item.ms-nav-title{height:32px}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item.ms-nav-title:before{content:'';display:block;position:relative;top:12px;width:16px;border-top:1px solid rgba(255,255,255,.12)}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item.ms-nav-title span{display:none}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item .ms-nav-button{height:48px}.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item .ms-nav-button>.arrow,.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item .ms-nav-button>.ms-nav-badge,.ms-nav-folded:not(.ms-nav-folded-open) ms-nav ms-nav-item .ms-nav-button>.ms-nav-label{opacity:0;visibility:hidden}}.ms-navigation{display:block;position:relative;color:rgba(255,255,255,.7);user-select:none}.ms-navigation li,.ms-navigation ul{padding:0;margin:0}.ms-navigation ul{display:block;overflow:hidden}.ms-navigation ul li{position:relative}.ms-navigation ul li.collapsed ul{display:none}.ms-navigation .animate-height{transition:height .25s cubic-bezier(.25,.46,.45,.94)}.ms-navigation .ms-navigation-node .ms-navigation-item{display:block;position:relative;cursor:pointer;color:rgba(255,255,255,.7)}.ms-navigation .ms-navigation-node .ms-navigation-item:hover{background:rgba(0,0,0,.1)}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button{display:flex;position:relative;width:100%;height:48px;line-height:48px;flex-direction:row;justify-content:flex-start;align-items:center;padding-right:16px;color:rgba(255,255,255,.7);text-decoration:none;white-space:nowrap;overflow:hidden}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button .icon{color:rgba(255,255,255,.7);margin:0 16px 0 0}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button span{white-space:nowrap;overflow:hidden;opacity:1;transition:opacity .25s ease-in-out .1s}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button a{white-space:nowrap;overflow:hidden;opacity:1;transition:opacity .25s ease-in-out .1s}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button .arrow{margin:0;opacity:1;transition:transform .3s ease-in-out,opacity .25s ease-in-out .1s}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button .badge{position:absolute;top:50%;right:16px;min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transform:translateY(-50%);transition:opacity .2s ease-in-out .1s}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button.active{color:#fff}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button.active .icon{color:#fff}.ms-navigation .ms-navigation-node .ms-navigation-item>.ms-navigation-button.active .badge{background:#fff!important;color:rgba(0,0,0,.87)!important}.ms-navigation .ms-navigation-node:not(.collapsed)>.ms-navigation-item>.ms-navigation-button .arrow{transform:rotate(90deg)}.ms-navigation .ms-navigation-node.group>.ms-navigation-item{font-size:12px;font-weight:500;margin-top:8px;cursor:auto;background:0 0!important;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-navigation .ms-navigation-node.group>.ms-navigation-item>.ms-navigation-button{height:32px;line-height:32px;color:rgba(255,255,255,.3)}.ms-navigation .ms-navigation-node:not(.group).has-children:not(.collapsed){background-color:rgba(0,0,0,.12)}.ms-navigation .ms-navigation-node:not(.group).has-children.collapsing{background-color:rgba(0,0,0,.12)}.ms-navigation .ms-navigation-node:not(.group).has-children .has-children:not(.collapsed){background:0 0}.ms-navigation li .ms-navigation-button{padding-left:24px}.ms-navigation li li .ms-navigation-button{padding-left:56px}.ms-navigation li li li .ms-navigation-button{padding-left:72px}.ms-navigation li li li li .ms-navigation-button{padding-left:88px}.ms-navigation li li li li li .ms-navigation-button{padding-left:104px}.ms-navigation li.group .ms-navigation-button{padding-left:24px}.ms-navigation li.group li .ms-navigation-button{padding-left:24px}.ms-navigation li.group li li .ms-navigation-button{padding-left:56px}.ms-navigation li.group li li li .ms-navigation-button{padding-left:72px}.ms-navigation li.group li li li li .ms-navigation-button{padding-left:88px}#horizontal-navigation{height:64px;min-height:64px;max-height:64px;background:#fff;z-index:54}#horizontal-navigation .ms-navigation-horizontal{display:flex;position:relative;user-select:none}#horizontal-navigation .ms-navigation-horizontal li,#horizontal-navigation .ms-navigation-horizontal ul{padding:0;margin:0;list-style:none}#horizontal-navigation .ms-navigation-horizontal .horizontal{display:flex;flex:1}#horizontal-navigation .ms-navigation-horizontal .horizontal li{position:relative;cursor:pointer}#horizontal-navigation .ms-navigation-horizontal .horizontal li:not(.active):hover{background:rgba(0,0,0,.12)}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button{display:block;float:left;padding:12px 14px}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button .arrow{display:none}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button.active{background:0 0;border-bottom:2px solid}#horizontal-navigation .ms-navigation-horizontal .horizontal>li:last-child{margin-right:0}#horizontal-navigation .ms-navigation-horizontal .horizontal>li li .ms-navigation-horizontal-item .ms-navigation-horizontal-button.active{color:#fff!important}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children ul{display:none;position:absolute;background:#fff;z-index:999;min-width:200px;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);top:0;left:100%}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children:hover>ul{display:block}#horizontal-navigation .ms-navigation-horizontal .horizontal>.has-children>ul{top:100%;left:0}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button{display:flex;align-items:center;width:100%;color:rgba(0,0,0,.87);white-space:nowrap;padding:14px 16px;text-decoration:none}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button .icon{color:rgba(0,0,0,.54);margin-right:8px}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button .badge{min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transition:opacity .2s ease-in-out .1s}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button .arrow{margin-left:8px}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button.active .badge{background:#fff!important;color:rgba(0,0,0,.87)!important}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item .ms-navigation-horizontal-button.active .icon{color:#fff}@media only screen and (min-width:960px){body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .animate-height{transition:none}body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node .ms-navigation-item .ms-navigation-button .icon{margin:0}body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node .ms-navigation-item .ms-navigation-button .arrow,body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node .ms-navigation-item .ms-navigation-button .badge,body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node .ms-navigation-item .ms-navigation-button .title{opacity:0;visibility:hidden}body.ms-navigation-folded:not(.ms-navigation-folded-open) .ms-navigation .ms-navigation-node.group>.ms-navigation-item .ms-navigation-button:before{content:'';display:block;position:relative;width:16px;border-top:1px solid rgba(255,255,255,.12)}body.ms-navigation-folded:not(.ms-navigation-folded-open) #ms-navigation-fold-expander{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999}body.ms-navigation-folded #ms-navigation-fold-collapser{position:absolute;top:0;right:0;bottom:0;left:0;z-index:59}}@media only screen and (max-width:960px){body.ms-navigation-horizontal-mobile-menu-active #horizontal-navigation .navigation-toggle{height:64px;margin-right:16px}body.ms-navigation-horizontal-mobile-menu-active #horizontal-navigation .navigation-toggle .md-button{margin:0;width:64px;height:64px}body.ms-navigation-horizontal-mobile-menu-active #horizontal-navigation .ms-navigation-horizontal{display:block!important;background:#fff}#horizontal-navigation{z-index:60}#horizontal-navigation .ms-navigation-horizontal{position:absolute;display:none;top:0;right:0;bottom:0;left:0;padding:0 0 16px 0;z-index:9998;overflow-x:hidden;overflow-y:scroll}#horizontal-navigation .ms-navigation-horizontal .horizontal{flex-direction:column;min-height:100%;width:100%}#horizontal-navigation .ms-navigation-horizontal .horizontal li:not(.active):hover{background:0 0}#horizontal-navigation .ms-navigation-horizontal .horizontal li:not(.active) .ms-navigation-horizontal-item{margin:4px}#horizontal-navigation .ms-navigation-horizontal .horizontal li:not(.active) .ms-navigation-horizontal-item:hover{background:rgba(0,0,0,.12)}#horizontal-navigation .ms-navigation-horizontal .horizontal>li{padding:0 12px}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button{display:flex;float:none}#horizontal-navigation .ms-navigation-horizontal .horizontal>li>.ms-navigation-horizontal-item>.ms-navigation-horizontal-button .arrow{display:block}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children ul{position:relative;top:0;left:0;box-shadow:none}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children:hover>ul{display:none}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children .expanded>.ms-navigation-horizontal-button .arrow{transform:rotate(90deg)}#horizontal-navigation .ms-navigation-horizontal .horizontal .has-children .expanded+ul{display:block;margin-left:16px}#horizontal-navigation .ms-navigation-horizontal .horizontal .ms-navigation-horizontal-item{min-height:48px;height:48px}}md-dialog.md-phonebar-dialog{max-width:720px;width:720px}md-dialog.md-phonebar-dialog md-dialog-content{display:block;position:relative;height:500px}md-dialog.md-phonebar-dialog md-toolbar .title{font-size:17px}md-dialog.md-phonebar-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.md-phonebar-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}md-dialog.md-phonebar-dialog md-tabs{position:static}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}.ms-phonebar{height:64px;font-size:13px}.ms-phonebar .phonebar-container{height:64px;padding:0}.ms-phonebar .phonebar-container .quantity-indicator{display:inline-block;vertical-align:middle;width:8px;height:8px;border-radius:4px;margin-right:5px;margin-left:5px}.ms-phonebar .phonebar-container .sessions{overflow-x:auto}.ms-phonebar .phonebar-container .session{border-radius:3px;border:1px solid #dcdcdc;margin-left:3px;cursor:pointer}.ms-phonebar .phonebar-container .session-info{padding-left:3px;padding-right:3px;color:grey}.ms-phonebar .phonebar-container .session-button{border:1px solid grey;margin:3px}.ms-phonebar .phonebar-container .button-bar{border:1px solid grey}.ms-phonebar .phonebar-container .num-pad{position:fixed;border-radius:3px;border:1px solid #9e9e9e;top:80px;left:80px}.ms-phonebar .phonebar-container .num-pad-logo{height:40px;width:42px}.ms-phonebar .phonebar-container p{margin:0;padding:0 0 10px 0;line-height:10px;font-size:10px}.ms-phonebar .phonebar-container .span4{width:50px;float:left;margin:8px}.ms-phonebar .phonebar-container .num{border:1px solid #9e9e9e;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;height:50px;background-color:#fff;color:#333;cursor:pointer}.ms-phonebar .phonebar-container .num:hover{background-color:#9e9e9e;color:#fff;transition-property:background-color .2s linear 0s;-moz-transition:background-color .2s linear 0s;-webkit-transition:background-color .2s linear 0s;-o-transition:background-color .2s linear 0s}.ms-phonebar .phonebar-container .txt{font-size:20px;text-align:center;margin-top:3px;font-family:Lato,sans-serif;color:#333}.ms-phonebar .phonebar-container .small{font-size:15px}.ms-phonebar .phonebar-container .angucomplete-dropdown{top:45px;overflow-y:auto;max-height:200px}.ms-phonebar .phonebar-container .highlight{color:red}.ms-phonebar .phonebar-container .input-number{margin-left:5px;padding:8px;border:1px solid #ccc;border-radius:3px;box-sizing:border-box}.ms-phonebar .phonebar-container .phonebar{position:relative}.ms-phonebar .phonebar-container .phonebar>div{height:64px;min-width:44px}.ms-phonebar .phonebar-container .phonebar>div.dragging{cursor:grabbing}.ms-phonebar .phonebar-container .phonebar>div.dragging .md-ripple-container{display:none}.ms-phonebar .phonebar-container .phonebar>div.ghost .shortcut{opacity:.27}.ms-phonebar .phonebar-container.mobile-bar-active{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;z-index:99;max-width:none!important}.ms-phonebar .phonebar-container.mobile-bar-active .phonebar,.ms-phonebar .phonebar-container.mobile-bar-active .toggle-mobile-menu{display:flex!important}.ms-phonebar .phonebar-container.mobile-bar-active .toggle-mobile-menu{margin-left:14px}.ms-phonebar .phonebar-container.mobile-bar-active>div{border-right:1px solid rgba(0,0,0,.12)}.quick-filter-container md-select .md-select-value.md-select-placeholder{color:inherit}.quick-filter-container md-select[multiple] md-select-value>:first-child{max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.ms-responsive-table-wrapper{overflow-x:auto;overflow-y:hidden}.ms-search-bar{height:64px;font-size:13px}.ms-search-bar .ms-search-bar-collapser,.ms-search-bar .ms-search-bar-expander{cursor:pointer;padding:0 20px;margin:0;width:64px!important;height:64px!important;line-height:64px!important}.ms-search-bar .ms-search-bar-loader{width:64px!important;height:64px!important;line-height:64px!important}.ms-search-bar .ms-search-button-expanded{pointer-events:none}.ms-search-bar .ms-search-bar-collapser{display:none}.ms-search-bar input{background-color:transparent;font-size:16px}.ms-search-bar .ms-search-bar-results{position:absolute;top:64px;left:0;right:0;overflow-x:hidden;overflow-y:scroll;background:#fff;max-height:300px;box-shadow:0 1px 8px 0 rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.12)}.ms-search-bar .ms-search-bar-results .no-results{font-size:18px;padding:16px;color:rgba(0,0,0,.54)}.ms-search-bar .ms-search-bar-results .result{position:relative;height:56px;min-height:56px;max-height:56px;padding:16px;cursor:pointer}.ms-search-bar .ms-search-bar-results .result.selected{background:rgba(0,0,0,.07)}.ms-search-bar .ms-search-bar-results .result .icon-container{min-width:32px;margin-right:8px}.ms-search-bar .ms-search-bar-results .result .icon-container .square{width:6px;height:6px}.ms-search-bar .ms-search-bar-results .result .title{font-size:16px}.ms-search-bar .ms-search-bar-results .result .description{padding-top:6px;font-size:14px}.ms-search-bar.expanded{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;z-index:10}.ms-search-bar.expanded #ms-search-bar-input{display:block}.ms-search-bar.expanded .ms-search-bar-collapser{display:block}.ms-search-bar.down{top:64px;border-bottom:1px rgba(0,0,0,.12) solid}.ms-search-bar[disabled] input{pointer-events:none}body.ms-search-bar-expanded #toolbar{z-index:999!important}@media screen and (max-width:960px){.ms-search-bar-label{padding:0 8px 0 12px}}.ms-shortcuts{height:64px;font-size:13px}.ms-shortcuts .shortcuts-container{height:64px;padding:0 8px;max-width:400px}.ms-shortcuts .shortcuts-container .shortcuts{position:relative;overflow-x:scroll}.ms-shortcuts .shortcuts-container .shortcuts>div{height:64px;min-width:44px}.ms-shortcuts .shortcuts-container .shortcuts>div.dragging{cursor:grabbing}.ms-shortcuts .shortcuts-container .shortcuts>div.dragging .md-ripple-container{display:none}.ms-shortcuts .shortcuts-container .shortcuts>div.ghost .shortcut{opacity:.27}.ms-shortcuts .shortcuts-container .shortcuts>div .shortcut{margin:2px}.ms-shortcuts .shortcuts-container .shortcuts>div .shortcut .first-letter{display:inline-block;vertical-align:middle;font-size:20px;text-transform:uppercase;color:rgba(0,0,0,.54)}.ms-shortcuts .shortcuts-container .shortcut-menu{margin:0}.ms-shortcuts .shortcuts-container.mobile-bar-active{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;z-index:99;max-width:none!important}.ms-shortcuts .shortcuts-container.mobile-bar-active .shortcut-menu,.ms-shortcuts .shortcuts-container.mobile-bar-active .shortcuts,.ms-shortcuts .shortcuts-container.mobile-bar-active .toggle-mobile-menu{display:flex!important}.ms-shortcuts .shortcuts-container.mobile-bar-active .toggle-mobile-menu{margin-left:14px}.ms-shortcuts .shortcuts-container.mobile-bar-active>div{border-right:1px solid rgba(0,0,0,.12)}#ms-shortcut-add-menu{position:relative;width:240px;min-width:240px;max-width:240px}#ms-shortcut-add-menu .add-shortcut-button{width:48px;height:48px;padding:0 12px;margin:0}#ms-shortcut-add-menu .shortcut-search{height:45px;padding:0 8px}#ms-shortcut-add-menu .shortcut-search .search-icon{width:40px;height:40px;line-height:48px}#ms-shortcut-add-menu .shortcut-search .shortcut-loader{padding:10px}#ms-shortcut-add-menu .shortcut-search input{padding:8px}#ms-shortcut-add-menu .results{position:relative;overflow-y:scroll;max-height:233px;margin-top:8px;padding-top:8px;border-top:1px solid rgba(0,0,0,.12)}#ms-shortcut-add-menu .results .no-results{font-size:18px;padding:16px;color:rgba(0,0,0,.54)}#ms-shortcut-add-menu .results .result{position:relative;min-height:56px;padding:16px;cursor:pointer}#ms-shortcut-add-menu .results .result.selected{background:rgba(0,0,0,.07)}#ms-shortcut-add-menu .results .result .icon-container{min-width:32px;margin-right:8px}#ms-shortcut-add-menu .results .result .icon-container .square{width:6px;height:6px}#ms-shortcut-add-menu .results .result .title{font-size:16px}#ms-shortcut-add-menu .results .result .description{padding-top:6px;font-size:14px}#splash-screen{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#3c4252;z-index:99999}#splash-screen.ng-leave{opacity:1;transition:all linear .2s}#splash-screen.ng-leave-active{opacity:0}#splash-screen .center{display:block;width:100%;position:absolute;top:50%;transform:translateY(-50%)}#splash-screen .logo{width:96px;height:96px;line-height:96px;margin:0 auto;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:56px;text-align:center;border-radius:2px;background-color:#039be5;color:#fff;box-shadow:0 2px 14px 0 rgba(0,0,0,.22)}#splash-screen .spinner-wrapper{display:block;position:relative;width:100%;min-height:100px;height:100px}#splash-screen .spinner-wrapper .spinner{position:absolute;overflow:hidden;left:50%;margin-left:-50px;animation:outer-rotate 2.91667s linear infinite}#splash-screen .spinner-wrapper .spinner .inner{width:100px;height:100px;position:relative;animation:sporadic-rotate 5.25s cubic-bezier(.35,0,.25,1) infinite}#splash-screen .spinner-wrapper .spinner .inner .gap{position:absolute;left:49px;right:49px;top:0;bottom:0;border-top:10px solid;box-sizing:border-box}#splash-screen .spinner-wrapper .spinner .inner .left,#splash-screen .spinner-wrapper .spinner .inner .right{position:absolute;top:0;height:100px;width:50px;overflow:hidden}#splash-screen .spinner-wrapper .spinner .inner .left .half-circle,#splash-screen .spinner-wrapper .spinner .inner .right .half-circle{position:absolute;top:0;width:100px;height:100px;box-sizing:border-box;border:10px solid #4285f4;border-bottom-color:transparent;border-radius:50%}#splash-screen .spinner-wrapper .spinner .inner .left{left:0}#splash-screen .spinner-wrapper .spinner .inner .left .half-circle{left:0;border-right-color:transparent;animation:left-wobble 1.3125s cubic-bezier(.35,0,.25,1) infinite;-webkit-animation:left-wobble 1.3125s cubic-bezier(.35,0,.25,1) infinite}#splash-screen .spinner-wrapper .spinner .inner .right{right:0}#splash-screen .spinner-wrapper .spinner .inner .right .half-circle{right:0;border-left-color:transparent;animation:right-wobble 1.3125s cubic-bezier(.35,0,.25,1) infinite;-webkit-animation:right-wobble 1.3125s cubic-bezier(.35,0,.25,1) infinite}@keyframes outer-rotate{0%{transform:rotate(0) scale(.5)}100%{transform:rotate(360deg) scale(.5)}}@keyframes left-wobble{0%,100%{transform:rotate(130deg)}50%{transform:rotate(-5deg)}}@keyframes right-wobble{0%,100%{transform:rotate(-130deg)}50%{transform:rotate(5deg)}}@keyframes sporadic-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}.ms-stepper .ms-stepper-horizontal{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation{height:72px;min-height:72px;max-height:72px;background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item{display:flex;flex-direction:row;align-items:center;position:relative;height:72px;min-height:72px;max-height:72px;line-height:24px;margin:0;padding:24px;border-radius:0;cursor:pointer;font-size:14px;text-transform:none}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:after,.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:before{content:'';display:block;position:absolute;top:50%;width:24px;border-bottom:1px solid rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:before{left:0}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:after{right:0}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:first-child:before{display:none}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item:last-child:after{display:none}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.current .title{font-weight:600;color:rgba(0,0,0,.87)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.disabled{cursor:default}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.disabled .step{background:rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.disabled .title{color:rgba(0,0,0,.27)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.disabled .subtitle{color:rgba(0,0,0,.27)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item.optional{padding:16px 24px}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item .step{width:24px;min-width:24px;height:24px;border-radius:50%;margin:0 8px 0 16px;color:#fff}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item .step .icon{color:#fff;font-weight:700;line-height:24px!important}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item .title{padding-right:16px;color:rgba(0,0,0,.54)}.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation .ms-stepper-navigation-item .subtitle{font-size:12px;padding-right:16px;color:rgba(0,0,0,.54);line-height:1}.ms-stepper .ms-stepper-horizontal .ms-stepper-steps{padding:24px 16px}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls{padding:0 16px 16px 16px}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots{display:none;align-items:center;justify-content:center;padding:0 16px}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots span{width:5px;height:5px;margin:0 4px;border-radius:50%}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots span:not(.md-accent-bg){background:rgba(0,0,0,.12)}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots span.selected{width:8px;height:8px}@media screen and (max-width:600px){.ms-stepper .ms-stepper-horizontal .ms-stepper-navigation-wrapper .ms-stepper-navigation{display:none}.ms-stepper .ms-stepper-horizontal .ms-stepper-controls .ms-stepper-dots{display:flex}}.ms-stepper .ms-stepper-vertical{position:relative;background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-stepper .ms-stepper-vertical .ms-stepper-vertical-line{display:block;position:absolute;width:1px;top:32px;bottom:32px;left:43px;border-left:1px solid rgba(0,0,0,.12)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps{padding:8px 0}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step{display:block}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item{display:flex;flex-direction:row;align-items:center;position:relative;width:100%;height:72px;min-height:72px;max-height:72px;line-height:24px;margin:0;padding:0 24px;border-radius:0;cursor:pointer;font-size:14px;text-transform:none}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item:first-child:before{display:none}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item:last-child:after{display:none}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item:hover:not(.disabled) .step{background-color:#ececec;border-color:#ececec}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.current .title{font-weight:600;color:rgba(0,0,0,.87)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.disabled{cursor:default}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.disabled .title{color:rgba(0,0,0,.27)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.disabled .subtitle{color:rgba(0,0,0,.27)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item.optional{padding:16px 24px}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item .step{width:40px;min-width:40px;height:40px;margin:0 16px 0 0;border-radius:50%;background:#fff;border:8px solid #fff;color:#fff;transition:border-color .4s cubic-bezier(.25,.8,.25,1),background-color .4s cubic-bezier(.25,.8,.25,1)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item .step .icon{font-weight:700;line-height:28px!important}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item .title{padding-right:16px;color:rgba(0,0,0,.54)}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-navigation-item .subtitle{font-size:12px;padding-right:16px;color:rgba(0,0,0,.54);line-height:1}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-step-content{padding:0 24px 16px 64px}.ms-stepper .ms-stepper-vertical .ms-stepper-steps .ms-stepper-step .ms-stepper-controls{padding:0 16px 16px 56px}.ms-tab-scroll .scroll-arrow{height:inherit;padding:0}.ms-tab-scroll .bar-container{overflow:hidden}.ms-tab-scroll .scroll-container{overflow-x:hidden;overflow-y:hidden;transition:transform .2s ease-in-out}.ms-timeline .ms-timeline-loader{position:relative;display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin:0 auto;background:#fff;font-weight:500;opacity:0;z-index:11;border-radius:50%}.ms-timeline .ms-timeline-loader.show{opacity:1}.ms-timeline .ms-timeline-loader .spinner{width:24px;height:24px;border:3px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%}.ms-widget .ms-widget-front{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-widget .ms-widget-back{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}.ms-widget.sidenav-widget .ms-widget-back,.ms-widget.sidenav-widget .ms-widget-front{box-shadow:none}.ms-widget .flip-to-front{position:absolute;top:0;right:0}.ms-widget .c3{height:100%}.ms-widget .chart-fill-8{margin:0 -8px -8px -8px}.ms-widget .chart-fill-16{margin:0 -16px -16px -16px}.ms-widget .chart-fill-24{margin:0 -24px -24px -24px}.ms-widget .chart-fill-32{margin:0 -32px -32px -32px}.ms-widget .chart-fill-40{margin:0 -40px -40px -40px}.ms-widget .chart-fill-48{margin:0 -48px -48px -48px}.ms-widget .chart-fill-56{margin:0 -56px -56px -56px}.ms-widget .chart-fill-64{margin:0 -64px -64px -64px}.ms-widget .chart-fill-72{margin:0 -72px -72px -72px}.ms-widget .chart-fill-80{margin:0 -80px -80px -80px}.ms-widget{position:relative;font-size:1.3rem;perspective:3000px;padding:12px}.ms-widget .ms-widget-front{display:flex;flex-direction:column;flex:1 1 auto;position:relative;overflow:hidden;visibility:visible;width:100%;opacity:1;z-index:10;border-radius:2px;transition:transform .5s ease-out 0s,visibility 0s ease-in .2s,opacity 0s ease-in .2s;transform:rotateY(0);backface-visibility:hidden}.ms-widget .ms-widget-back{display:block;position:absolute;overflow:hidden;visibility:hidden;opacity:0;z-index:10;top:12px;right:12px;bottom:12px;left:12px;border-radius:2px;transition:transform .5s ease-out 0s,visibility 0s ease-in .2s,opacity 0s ease-in .2s;transform:rotateY(180deg);backface-visibility:hidden}.ms-widget .md-button{margin:0}.ms-widget .md-button.md-icon-button{margin:0}.ms-widget.flipped .ms-widget-front{visibility:hidden;opacity:0;transform:rotateY(180deg)}.ms-widget.flipped .ms-widget-back{display:block;visibility:visible;opacity:1;transform:rotateY(360deg)}.ms-widget.sidenav-widget{padding:0}.ms-widget.ar-2-1 .widget{padding:0;position:relative}.ms-widget.ar-2-1 .widget:before{display:block;content:'';width:100%;padding-top:50%}.ms-widget.ar-2-1 .widget>.widget{position:absolute;top:8px;left:8px;right:8px;bottom:8px}.ms-widget.ar-1-1 .widget{padding:0;position:relative}.ms-widget.ar-1-1 .widget:before{display:block;content:'';width:100%;padding-top:100%}.ms-widget.ar-1-1 .widget>.widget{position:absolute;top:8px;left:8px;right:8px;bottom:8px}.ms-theme-options .ms-theme-options-button{position:absolute;top:160px;right:0;z-index:50;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);width:48px;height:48px;line-height:48px;text-align:center;cursor:pointer;border-radius:0;margin:0;pointer-events:auto;opacity:.75}.ms-theme-options .ms-theme-options-button:hover{opacity:1}.ms-theme-options md-sidenav{width:384px;min-width:384px;max-width:384px}.ms-theme-options md-sidenav .ms-theme-options-list{background:#fff;z-index:12;pointer-events:auto}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option{padding:16px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button{width:160px;max-width:160px;margin:8px 8px 16px 8px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button.md-checked ._md-label img,.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button:hover ._md-label img{opacity:1;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button ._md-container{display:none}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button ._md-label{margin-left:0}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.layout-options md-radio-button ._md-label img{opacity:.8;margin-bottom:8px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.color-palettes md-menu-item{max-width:192px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.color-palettes .theme-button{border-bottom:16px solid;text-align:left;width:101px;height:88px;box-shadow:none;opacity:.8}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.color-palettes .theme-button.active,.ms-theme-options md-sidenav .ms-theme-options-list .theme-option.color-palettes .theme-button:hover{opacity:1;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option md-radio-button{margin:8px}.ms-theme-options md-sidenav .ms-theme-options-list .theme-option .option-title{font-size:14px;font-weight:500;padding:0 8px 12px 8px}#error-404 .content{width:90%;max-width:512px;margin-top:128px}#error-404 .content .error-code{font-size:112px;text-align:center;line-height:1;margin-bottom:16px;font-weight:500}#error-404 .content .message{font-size:24px;text-align:center;color:rgba(0,0,0,.54)}#error-404 .content .search{width:100%;height:56px;line-height:56px;margin:48px auto 16px auto;padding:16px;background:#fff}#error-404 .content .search input{padding:0 0 0 16px}#error-404 .content .back-link{font-size:15px;text-align:center}#error-500 .content{width:90%;max-width:512px;margin-top:128px}#error-500 .content .error-code{font-size:112px;line-height:1;text-align:center;margin-bottom:16px;font-weight:500}#error-500 .content .message{font-size:24px;text-align:center;color:rgba(0,0,0,.54)}#error-500 .content .sub-message{font-size:17px;text-align:center;color:rgba(0,0,0,.54);margin:16px auto 48px auto}#error-500 .content .report-link{text-align:center;font-size:15px}#forgot-password{height:100%;background:url(/assets/images/backgrounds/tech.png) no-repeat;background-size:cover}#forgot-password #forgot-password-form-wrapper{flex:1 0 auto;padding:32px}#forgot-password #forgot-password-form-wrapper #forgot-password-form{width:384px;max-width:384px;padding:32px;text-align:center;background:#fff}#forgot-password #forgot-password-form-wrapper #forgot-password-form .logo{width:128px;height:128px;line-height:128px;font-size:86px;font-weight:500;margin:32px auto;color:#fff;border-radius:2px}#forgot-password #forgot-password-form-wrapper #forgot-password-form .title{font-size:17px;margin:16px 0 32px 0}#forgot-password #forgot-password-form-wrapper #forgot-password-form .logo_login{max-height:200px}#forgot-password #forgot-password-form-wrapper #forgot-password-form form{width:100%;text-align:left}#forgot-password #forgot-password-form-wrapper #forgot-password-form form .submit-button{width:220px;margin:16px auto;display:block}#forgot-password #forgot-password-form-wrapper #forgot-password-form .login{margin:32px auto 24px auto;width:250px;font-weight:500}#forgot-password #forgot-password-form-wrapper #forgot-password-form .login .text{margin-right:8px}@media screen and (max-width:600px){#forgot-password #forgot-password-form-wrapper{padding:16px}#forgot-password #forgot-password-form-wrapper #forgot-password-form{padding:24px;width:100%}#forgot-password #forgot-password-form-wrapper #forgot-password-form form .md-button{width:90%}}#login{height:100%;background:url(/assets/images/backgrounds/tech.png) no-repeat;background-size:cover}#login #login-form-wrapper{flex:1 0 auto;padding:32px}#login #login-form-wrapper #login-form{width:384px;max-width:384px;padding:32px;background:#fff;text-align:center}#login #login-form-wrapper #login-form .logo{width:128px;height:128px;line-height:128px;font-size:86px;font-weight:500;margin:32px auto;color:#fff;border-radius:2px}#login #login-form-wrapper #login-form .title{font-size:17px;margin:16px 0 32px 0}#login #login-form-wrapper #login-form .logo_login{max-height:200px}#login #login-form-wrapper #login-form form{width:100%;text-align:left}#login #login-form-wrapper #login-form form md-checkbox{margin:0}#login #login-form-wrapper #login-form form .remember-forgot-password{font-size:13px;margin-top:8px}#login #login-form-wrapper #login-form form .remember-forgot-password .remember-me{margin-bottom:16px}#login #login-form-wrapper #login-form form .remember-forgot-password .forgot-password{font-size:13px;font-weight:500;margin-bottom:16px}#login #login-form-wrapper #login-form form .submit-button{width:220px;margin:16px auto;display:block}#login #login-form-wrapper #login-form .register{margin:32px auto 24px auto;width:250px;font-weight:500}#login #login-form-wrapper #login-form .register .text{margin-right:8px}#login #login-form-wrapper #login-form .separator{font-size:15px;font-weight:600;margin:24px auto 16px auto;position:relative;overflow:hidden;width:100px;color:rgba(0,0,0,.54)}#login #login-form-wrapper #login-form .separator .text{display:inline-block;vertical-align:baseline;position:relative;padding:0 8px;z-index:9999}#login #login-form-wrapper #login-form .separator .text:after,#login #login-form-wrapper #login-form .separator .text:before{content:'';display:block;width:30px;position:absolute;top:10px;border-top:1px solid rgba(0,0,0,.12)}#login #login-form-wrapper #login-form .separator .text:before{right:100%}#login #login-form-wrapper #login-form .separator .text:after{left:100%}#login #login-form-wrapper #login-form .md-button.facebook,#login #login-form-wrapper #login-form .md-button.google{width:192px;text-transform:none;color:#fff;font-size:13px}#login #login-form-wrapper #login-form .md-button.facebook md-icon,#login #login-form-wrapper #login-form .md-button.google md-icon{color:#fff;margin:0 8px 0 0}#login #login-form-wrapper #login-form .md-button.google{background-color:#d73d32}#login #login-form-wrapper #login-form .md-button.facebook{background-color:#3f5c9a}@media screen and (max-width:600px){#login #login-form-wrapper{padding:16px}#login #login-form-wrapper #login-form{padding:24px;width:100%}#login #login-form-wrapper #login-form form .md-button{width:90%}#login #login-form-wrapper #login-form .md-button.facebook,#login #login-form-wrapper #login-form .md-button.google{width:80%}}md-dialog.extractedReport-dialog{max-width:720px;width:720px}md-dialog.extractedReport-dialog md-dialog-content{display:block;position:relative}md-dialog.extractedReport-dialog md-toolbar .title{font-size:17px}md-dialog.extractedReport-dialog md-input-container textarea{min-height:150px}md-dialog.extractedReport-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.extractedReport-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.extractedReport-dialog .date-container{padding:16px 0 24px 0}md-dialog.extractedReport-dialog .error-list{font-size:13px}md-dialog.extractedReport-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.extractedReport-dialog .error-list .error .message{font-weight:500}md-dialog.extractedReport-dialog .error-list .error .md-button{margin:0}md-dialog.extractedReport-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.extractedReport-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#extractedReports{position:relative}#extractedReports>.header{height:76px;min-height:76px;max-height:76px}#extractedReports>.header .logo .logo-icon{margin:0 16px 0 0}#extractedReports>.header .logo .logo-text{font-size:24px}#extractedReports>.header md-icon{color:#fff}#extractedReports>.header .search-input-wrapper{position:relative}#extractedReports>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#extractedReports>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#extractedReports>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#extractedReports>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#extractedReports>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#extractedReports>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#extractedReports>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#extractedReports>.header.selected-bar .close-button-wrapper{width:244px}#extractedReports>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#extractedReports>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#extractedReports>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#extractedReports #add-extractedReport-button{position:fixed;bottom:8px;right:8px;padding:0}#extractedReports #upload-extractedReport-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.metric-dialog{max-width:720px;width:720px}md-dialog.metric-dialog md-dialog-content{display:block;position:relative}md-dialog.metric-dialog md-toolbar .title{font-size:17px}md-dialog.metric-dialog md-input-container textarea{min-height:150px}md-dialog.metric-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.metric-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.metric-dialog .date-container{padding:16px 0 24px 0}md-dialog.metric-dialog .error-list{font-size:13px}md-dialog.metric-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.metric-dialog .error-list .error .message{font-weight:500}md-dialog.metric-dialog .error-list .error .md-button{margin:0}md-dialog.metric-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.metric-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#metrics{position:relative}#metrics>.header{height:76px;min-height:76px;max-height:76px}#metrics>.header .logo .logo-icon{margin:0 16px 0 0}#metrics>.header .logo .logo-text{font-size:24px}#metrics>.header md-icon{color:#fff}#metrics>.header .search-input-wrapper{position:relative}#metrics>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#metrics>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#metrics>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#metrics>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#metrics>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#metrics>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#metrics>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#metrics>.header.selected-bar .close-button-wrapper{width:244px}#metrics>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#metrics>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#metrics>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#metrics #add-metric-button{position:fixed;bottom:8px;right:8px;padding:0}#metrics #upload-metric-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.report-dialog{max-width:720px;width:720px}md-dialog.report-dialog md-dialog-content{display:block;position:relative}md-dialog.report-dialog md-toolbar .title{font-size:17px}md-dialog.report-dialog md-input-container textarea{min-height:150px}md-dialog.report-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.report-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.report-dialog .date-container{padding:16px 0 24px 0}md-dialog.report-dialog .error-list{font-size:13px}md-dialog.report-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.report-dialog .error-list .error .message{font-weight:500}md-dialog.report-dialog .error-list .error .md-button{margin:0}md-dialog.report-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.report-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.report-dialog{max-width:720px;width:720px}md-dialog.report-dialog md-dialog-content{display:block;position:relative}md-dialog.report-dialog md-toolbar .title{font-size:17px}md-dialog.report-dialog md-input-container textarea{min-height:150px}md-dialog.report-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.report-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.report-dialog .date-container{padding:16px 0 24px 0}md-dialog.report-dialog .error-list{font-size:13px}md-dialog.report-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.report-dialog .error-list .error .message{font-weight:500}md-dialog.report-dialog .error-list .error .md-button{margin:0}md-dialog.report-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.report-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.reportField-dialog{max-width:720px;width:720px}md-dialog.reportField-dialog md-dialog-content{display:block;position:relative}md-dialog.reportField-dialog md-toolbar .title{font-size:17px}md-dialog.reportField-dialog md-input-container textarea{min-height:150px}md-dialog.reportField-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.reportField-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.reportField-dialog .date-container{padding:16px 0 24px 0}md-dialog.reportField-dialog .error-list{font-size:13px}md-dialog.reportField-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.reportField-dialog .error-list .error .message{font-weight:500}md-dialog.reportField-dialog .error-list .error .md-button{margin:0}md-dialog.reportField-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.reportField-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#analytics-report .header{height:76px;min-height:76px;max-height:76px}#analytics-report .header .goto-reports-button{margin-right:16px}#analytics-report .header .report-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#analytics-report .header .report-image img{height:100%;width:auto;max-width:none}#analytics-report .header .subtitle{margin:6px 0 0 0}#analytics-report .report-detail-form-container{padding:24px;margin-bottom:24px}#analytics-report .report-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#analytics-report .report-detail-form-container .handle{cursor:move}#analytics-report .report-detail-form-container md-input-container md-switch{margin:0!important}#analytics-report .report-detail-form-container #report-image-uploader{position:relative}#analytics-report .report-detail-form-container #report-image-uploader.dropping .drop-text{display:flex}#analytics-report .report-detail-form-container #report-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#analytics-report .report-detail-form-container #report-image-uploader .upload-button{margin-bottom:16px}#analytics-report .report-detail-form-container #report-image-uploader .report-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#analytics-report .report-detail-form-container #report-image-uploader .report-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#analytics-report .report-detail-form-container #report-image-uploader .report-image .media{max-height:100%}md-dialog.report-dialog{max-width:720px;width:720px}md-dialog.report-dialog md-dialog-content{display:block;position:relative}md-dialog.report-dialog md-toolbar .title{font-size:17px}md-dialog.report-dialog md-input-container textarea{min-height:150px}md-dialog.report-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.report-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.report-dialog .date-container{padding:16px 0 24px 0}md-dialog.report-dialog .error-list{font-size:13px}md-dialog.report-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.report-dialog .error-list .error .message{font-weight:500}md-dialog.report-dialog .error-list .error .md-button{margin:0}md-dialog.report-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.report-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#reports{position:relative}#reports>.header{height:76px;min-height:76px;max-height:76px}#reports>.header .logo .logo-icon{margin:0 16px 0 0}#reports>.header .logo .logo-text{font-size:24px}#reports>.header md-icon{color:#fff}#reports>.header .search-input-wrapper{position:relative}#reports>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#reports>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#reports>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#reports>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#reports>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#reports>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#reports>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#reports>.header.selected-bar .close-button-wrapper{width:244px}#reports>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#reports>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#reports>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}md-dialog.report-dialog{max-width:720px;width:720px}md-dialog.report-dialog md-dialog-content{display:block;position:relative}md-dialog.report-dialog md-toolbar .title{font-size:17px}md-dialog.report-dialog md-input-container textarea{min-height:150px}md-dialog.report-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.report-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.report-dialog .date-container{padding:16px 0 24px 0}md-dialog.report-dialog .error-list{font-size:13px}md-dialog.report-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.report-dialog .error-list .error .message{font-weight:500}md-dialog.report-dialog .error-list .error .md-button{margin:0}md-dialog.report-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.report-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.web-dialog md-dialog-content{display:block;position:relative}md-dialog.web-dialog md-toolbar .title{font-size:17px}md-dialog.web-dialog md-input-container textarea{min-height:150px}md-dialog.web-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.web-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.web-dialog .date-container{padding:16px 0 24px 0}md-dialog.web-dialog .error-list{font-size:13px}md-dialog.web-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.web-dialog .error-list .error .message{font-weight:500}md-dialog.web-dialog .error-list .error .md-button{margin:0}md-dialog.web-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.web-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.odbc-dialog{max-width:720px;width:720px}md-dialog.odbc-dialog md-dialog-content{display:block;position:relative}md-dialog.odbc-dialog md-toolbar .title{font-size:17px}md-dialog.odbc-dialog md-input-container textarea{min-height:150px}md-dialog.odbc-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.odbc-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.odbc-dialog .date-container{padding:16px 0 24px 0}md-dialog.odbc-dialog .error-list{font-size:13px}md-dialog.odbc-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.odbc-dialog .error-list .error .message{font-weight:500}md-dialog.odbc-dialog .error-list .error .md-button{margin:0}md-dialog.odbc-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.odbc-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#odbcs{position:relative}#odbcs>.header{height:76px;min-height:76px;max-height:76px}#odbcs>.header .logo .logo-icon{margin:0 16px 0 0}#odbcs>.header .logo .logo-text{font-size:24px}#odbcs>.header md-icon{color:#fff}#odbcs>.header .search-input-wrapper{position:relative}#odbcs>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#odbcs>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#odbcs>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#odbcs>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#odbcs>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#odbcs>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#odbcs>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#odbcs>.header.selected-bar .close-button-wrapper{width:244px}#odbcs>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#odbcs>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#odbcs>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#odbcs #add-odbc-button{position:fixed;bottom:8px;right:8px;padding:0}#odbcs #upload-odbc-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.project-dialog{max-width:720px;width:720px}md-dialog.project-dialog md-dialog-content{display:block;position:relative}md-dialog.project-dialog md-toolbar .title{font-size:17px}md-dialog.project-dialog md-input-container textarea{min-height:150px}md-dialog.project-dialog .date-container{padding:16px 0 24px 0}md-dialog.project-dialog .error-list{font-size:13px}md-dialog.project-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.project-dialog .error-list .error .message{font-weight:500}md-dialog.project-dialog .error-list .error .md-button{margin:0}md-dialog.project-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.project-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}md-dialog.project-dialog .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#callysquare-project .header{height:76px;min-height:76px;max-height:76px}#callysquare-project .header .goto-projects-button{margin-right:16px}#callysquare-project .header .project-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#callysquare-project .header .project-image img{height:100%;width:auto;max-width:none}#callysquare-project .header .subtitle{margin:6px 0 0 0}#callysquare-project .project-detail-form-container{padding:24px;margin-bottom:24px}#callysquare-project .project-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#callysquare-project .project-detail-form-container #project-image-uploader{position:relative}#callysquare-project .project-detail-form-container #project-image-uploader.dropping .drop-text{display:flex}#callysquare-project .project-detail-form-container #project-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#callysquare-project .project-detail-form-container #project-image-uploader .upload-button{margin-bottom:16px}#callysquare-project .project-detail-form-container #project-image-uploader .project-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#callysquare-project .project-detail-form-container #project-image-uploader .project-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#callysquare-project .project-detail-form-container #project-image-uploader .project-image .media{max-height:100%}#callysquare-project>.callysquare-content{position:absolute;top:76px;bottom:0;left:0;right:0}#projects{position:relative}#projects>.header{height:76px;min-height:76px;max-height:76px}#projects>.header .logo .logo-icon{margin:0 16px 0 0}#projects>.header .logo .logo-text{font-size:24px}#projects>.header md-icon{color:#fff}#projects>.header .search-input-wrapper{position:relative}#projects>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#projects>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#projects>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#projects>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#projects>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#projects>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#projects>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#projects>.header.selected-bar .close-button-wrapper{width:244px}#projects>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#projects>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#projects>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#projects #add-project-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.squareRecording-dialog{max-width:720px;width:720px}md-dialog.squareRecording-dialog md-dialog-content{display:block;position:relative}md-dialog.squareRecording-dialog md-toolbar .title{font-size:17px}md-dialog.squareRecording-dialog md-input-container textarea{min-height:150px}md-dialog.squareRecording-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.squareRecording-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.squareRecording-dialog .date-container{padding:16px 0 24px 0}md-dialog.squareRecording-dialog .error-list{font-size:13px}md-dialog.squareRecording-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.squareRecording-dialog .error-list .error .message{font-weight:500}md-dialog.squareRecording-dialog .error-list .error .md-button{margin:0}md-dialog.squareRecording-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.squareRecording-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#squareRecordings{position:relative}#squareRecordings>.header{height:76px;min-height:76px;max-height:76px}#squareRecordings>.header .logo .logo-icon{margin:0 16px 0 0}#squareRecordings>.header .logo .logo-text{font-size:24px}#squareRecordings>.header md-icon{color:#fff}#squareRecordings>.header .search-input-wrapper{position:relative}#squareRecordings>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#squareRecordings>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#squareRecordings>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#squareRecordings>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#squareRecordings>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#squareRecordings>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#squareRecordings>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#squareRecordings>.header.selected-bar .close-button-wrapper{width:244px}#squareRecordings>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#squareRecordings>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#squareRecordings>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#squareRecordings #add-squareRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#squareRecordings #upload-squareRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#chatQueues{position:relative}#chatQueues>.header{height:76px;min-height:76px;max-height:76px}#chatQueues>.header .logo .logo-icon{margin:0 16px 0 0}#chatQueues>.header .logo .logo-text{font-size:24px}#chatQueues>.header md-icon{color:#fff}#chatQueues>.header .search-input-wrapper{position:relative}#chatQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#chatQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#chatQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#chatQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#chatQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#chatQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#chatQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#chatQueues>.header.selected-bar .close-button-wrapper{width:244px}#chatQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#chatQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#chatQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#chatQueues #add-chatQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#chatQueues #upload-chatQueue-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.chatQueue-dialog{max-width:720px;width:720px}md-dialog.chatQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.chatQueue-dialog md-toolbar .title{font-size:17px}md-dialog.chatQueue-dialog md-input-container textarea{min-height:150px}md-dialog.chatQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chatQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chatQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatQueue-dialog .error-list{font-size:13px}md-dialog.chatQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatQueue-dialog .error-list .error .message{font-weight:500}md-dialog.chatQueue-dialog .error-list .error .md-button{margin:0}md-dialog.chatQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#chat-chatQueue .header{height:76px;min-height:76px;max-height:76px}#chat-chatQueue .header .goto-chatQueues-button{margin-right:16px}#chat-chatQueue .header .chatQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#chat-chatQueue .header .chatQueue-image img{height:100%;width:auto;max-width:none}#chat-chatQueue .header .subtitle{margin:6px 0 0 0}#chat-chatQueue .chatQueue-detail-form-container{padding:24px;margin-bottom:24px}#chat-chatQueue .chatQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#chat-chatQueue .chatQueue-detail-form-container .handle{cursor:move}#chat-chatQueue .chatQueue-detail-form-container md-input-container md-switch{margin:0!important}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader{position:relative}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader.dropping .drop-text{display:flex}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .upload-button{margin-bottom:16px}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .chatQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .chatQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#chat-chatQueue .chatQueue-detail-form-container #chatQueue-image-uploader .chatQueue-image .media{max-height:100%}#chat-chatQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#chat-chatQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#chat-chatQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#chat-chatQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#chatWebsites{position:relative}#chatWebsites>.header{height:76px;min-height:76px;max-height:76px}#chatWebsites>.header .logo .logo-icon{margin:0 16px 0 0}#chatWebsites>.header .logo .logo-text{font-size:24px}#chatWebsites>.header md-icon{color:#fff}#chatWebsites>.header .search-input-wrapper{position:relative}#chatWebsites>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#chatWebsites>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#chatWebsites>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#chatWebsites>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#chatWebsites>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#chatWebsites>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#chatWebsites>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#chatWebsites>.header.selected-bar .close-button-wrapper{width:244px}#chatWebsites>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#chatWebsites>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#chatWebsites>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#chatWebsites #add-chatWebsite-button{position:fixed;bottom:8px;right:8px;padding:0}#chatWebsites #upload-chatWebsite-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chatWebsite-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatWebsite-dialog{max-width:720px;width:720px}md-dialog.chatWebsite-dialog md-dialog-content{display:block;position:relative}md-dialog.chatWebsite-dialog md-toolbar .title{font-size:17px}md-dialog.chatWebsite-dialog md-input-container textarea{min-height:150px}md-dialog.chatWebsite-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatWebsite-dialog .error-list{font-size:13px}md-dialog.chatWebsite-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatWebsite-dialog .error-list .error .message{font-weight:500}md-dialog.chatWebsite-dialog .error-list .error .md-button{margin:0}md-dialog.chatWebsite-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatWebsite-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.chatCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.chatCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.chatCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.chatCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chatCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chatCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatCannedAnswer-dialog .error-list{font-size:13px}md-dialog.chatCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.chatCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.chatCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.offlineMessage-dialog{max-width:720px;width:720px}md-dialog.offlineMessage-dialog md-dialog-content{display:block;position:relative}md-dialog.offlineMessage-dialog md-toolbar .title{font-size:17px}md-dialog.offlineMessage-dialog md-input-container textarea{min-height:150px}md-dialog.offlineMessage-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.offlineMessage-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.offlineMessage-dialog .date-container{padding:16px 0 24px 0}md-dialog.offlineMessage-dialog .error-list{font-size:13px}md-dialog.offlineMessage-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.offlineMessage-dialog .error-list .error .message{font-weight:500}md-dialog.offlineMessage-dialog .error-list .error .md-button{margin:0}md-dialog.offlineMessage-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.offlineMessage-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.chatProactiveAction-dialog{max-width:720px;width:720px}md-dialog.chatProactiveAction-dialog md-dialog-content{display:block;position:relative}md-dialog.chatProactiveAction-dialog md-toolbar .title{font-size:17px}md-dialog.chatProactiveAction-dialog md-input-container textarea{min-height:150px}md-dialog.chatProactiveAction-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chatProactiveAction-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chatProactiveAction-dialog .date-container{padding:16px 0 24px 0}md-dialog.chatProactiveAction-dialog .error-list{font-size:13px}md-dialog.chatProactiveAction-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chatProactiveAction-dialog .error-list .error .message{font-weight:500}md-dialog.chatProactiveAction-dialog .error-list .error .md-button{margin:0}md-dialog.chatProactiveAction-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chatProactiveAction-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#chat-chatWebsite .header{height:76px;min-height:76px;max-height:76px}#chat-chatWebsite .header .goto-chatWebsites-button{margin-right:16px}#chat-chatWebsite .header .chatWebsite-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#chat-chatWebsite .header .chatWebsite-image img{height:100%;width:auto;max-width:none}#chat-chatWebsite .header .subtitle{margin:6px 0 0 0}#chat-chatWebsite .chatWebsite-detail-form-container{padding:24px;margin-bottom:24px}#chat-chatWebsite .chatWebsite-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#chat-chatWebsite .chatWebsite-detail-form-container .handle{cursor:move}#chat-chatWebsite .chatWebsite-detail-form-container md-input-container md-switch{margin:0!important}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader{position:relative}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader.dropping .drop-text{display:flex}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .upload-button{margin-bottom:16px}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .chatWebsite-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .chatWebsite-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#chat-chatWebsite .chatWebsite-detail-form-container #chatWebsite-image-uploader .chatWebsite-image .media{max-height:100%}#chat-chatWebsite md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#chat-chatWebsite md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#chat-chatWebsite md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#chat-chatWebsite md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#chat-chatWebsite .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#chat-chatWebsite .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#chat-chatWebsite .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#chat-chatWebsite .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#chat-chatWebsite .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#chat-chatWebsite .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#chat-chatWebsite .actionAppData{width:150px!important}}@media screen and (max-width:960px){#chat-chatWebsite .actionAppData{width:80px!important}}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}#companies{position:relative}#companies>.header{height:76px;min-height:76px;max-height:76px}#companies>.header .logo .logo-icon{margin:0 16px 0 0}#companies>.header .logo .logo-text{font-size:24px}#companies>.header md-icon{color:#fff}#companies>.header .search-input-wrapper{position:relative}#companies>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#companies>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#companies>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#companies>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#companies>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#companies>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#companies>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#companies>.header.selected-bar .close-button-wrapper{width:244px}#companies>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#companies>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#companies>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#companies #add-company-button{position:fixed;bottom:8px;right:8px;padding:0}#companies #upload-company-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.company-dialog{max-width:720px;width:720px}md-dialog.company-dialog md-dialog-content{display:block;position:relative}md-dialog.company-dialog md-toolbar .title{font-size:17px}md-dialog.company-dialog md-input-container textarea{min-height:150px}md-dialog.company-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.company-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.company-dialog .date-container{padding:16px 0 24px 0}md-dialog.company-dialog .error-list{font-size:13px}md-dialog.company-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.company-dialog .error-list .error .message{font-weight:500}md-dialog.company-dialog .error-list .error .md-button{margin:0}md-dialog.company-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.company-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#contactmanager-company .header{height:76px;min-height:76px;max-height:76px}#contactmanager-company .header .goto-companies-button{margin-right:16px}#contactmanager-company .header .company-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#contactmanager-company .header .company-image img{height:100%;width:auto;max-width:none}#contactmanager-company .header .subtitle{margin:6px 0 0 0}#contactmanager-company .company-detail-form-container{padding:24px;margin-bottom:24px}#contactmanager-company .company-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#contactmanager-company .company-detail-form-container .handle{cursor:move}#contactmanager-company .company-detail-form-container md-input-container md-switch{margin:0!important}#contactmanager-company .company-detail-form-container #company-image-uploader{position:relative}#contactmanager-company .company-detail-form-container #company-image-uploader.dropping .drop-text{display:flex}#contactmanager-company .company-detail-form-container #company-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#contactmanager-company .company-detail-form-container #company-image-uploader .upload-button{margin-bottom:16px}#contactmanager-company .company-detail-form-container #company-image-uploader .company-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#contactmanager-company .company-detail-form-container #company-image-uploader .company-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#contactmanager-company .company-detail-form-container #company-image-uploader .company-image .media{max-height:100%}#contactmanager-company md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#contactmanager-company md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#contactmanager-company md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#contactmanager-company md-table-container.font-size-12 td.md-cell{font-size:12px!important}#contacts{position:relative}#contacts>.header{height:76px;min-height:76px;max-height:76px}#contacts>.header .logo .logo-icon{margin:0 16px 0 0}#contacts>.header .logo .logo-text{font-size:24px}#contacts>.header md-icon{color:#fff}#contacts>.header .search-input-wrapper{position:relative}#contacts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#contacts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#contacts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#contacts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#contacts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#contacts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#contacts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#contacts>.header.selected-bar .close-button-wrapper{width:244px}#contacts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#contacts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#contacts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#contacts #add-contact-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.cm-contact-dialog{max-width:720px;width:720px}md-dialog.cm-contact-dialog md-dialog-content{display:block;position:relative}md-dialog.cm-contact-dialog md-toolbar .title{font-size:17px}md-dialog.cm-contact-dialog md-input-container textarea{min-height:150px}md-dialog.cm-contact-dialog .date-container{padding:16px 0 24px 0}md-dialog.cm-contact-dialog .error-list{font-size:13px}md-dialog.cm-contact-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cm-contact-dialog .error-list .error .message{font-weight:500}md-dialog.cm-contact-dialog .error-list .error .md-button{margin:0}md-dialog.cm-contact-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cm-contact-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.cm-contact-dialog{max-width:720px;width:720px}md-dialog.cm-contact-dialog md-dialog-content{display:block;position:relative}md-dialog.cm-contact-dialog md-toolbar .title{font-size:17px}md-dialog.cm-contact-dialog md-input-container textarea{min-height:150px}md-dialog.cm-contact-dialog .date-container{padding:16px 0 24px 0}md-dialog.cm-contact-dialog .error-list{font-size:13px}md-dialog.cm-contact-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cm-contact-dialog .error-list .error .message{font-weight:500}md-dialog.cm-contact-dialog .error-list .error .md-button{margin:0}md-dialog.cm-contact-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cm-contact-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.hopper-dialog{max-width:720px;width:720px}md-dialog.hopper-dialog md-dialog-content{display:block;position:relative}md-dialog.hopper-dialog md-toolbar .title{font-size:17px}md-dialog.hopper-dialog md-input-container textarea{min-height:150px}md-dialog.hopper-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.hopper-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.hopper-dialog .date-container{padding:16px 0 24px 0}md-dialog.hopper-dialog .error-list{font-size:13px}md-dialog.hopper-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.hopper-dialog .error-list .error .message{font-weight:500}md-dialog.hopper-dialog .error-list .error .md-button{margin:0}md-dialog.hopper-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.hopper-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#cm-contact .pointer{cursor:pointer}#cm-contact .header{height:76px;min-height:76px;max-height:76px}#cm-contact .header .goto-contacts-button{margin-right:16px}#cm-contact .header .contact-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#cm-contact .header .contact-image img{height:100%;width:auto;max-width:none}#cm-contact .header .subtitle{margin:6px 0 0 0}#cm-contact .contact-detail-form-container{padding:24px;margin-bottom:24px}#cm-contact .contact-detail-form-container md-input-container:not(.md-input-invalid)>md-icon.email{color:green}#cm-contact .contact-detail-form-container md-input-container:not(.md-input-invalid)>md-icon.firstname{color:#1e90ff}#cm-contact .contact-detail-form-container md-input-container.md-input-invalid>md-icon.email,#cm-contact .contact-detail-form-container md-input-container.md-input-invalid>md-icon.firstname{color:red}#cm-contact .contact-detail-form-container .hint{position:absolute;left:2px;right:auto;bottom:7px;font-size:10px;line-height:14px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.import-dialog{max-width:720px;width:720px}md-dialog.import-dialog md-dialog-content{display:block;position:relative}md-dialog.import-dialog md-toolbar .title{font-size:17px}md-dialog.import-dialog md-input-container textarea{min-height:150px}md-dialog.import-dialog .date-container{padding:16px 0 24px 0}md-dialog.import-dialog .error-list{font-size:13px}md-dialog.import-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.import-dialog .error-list .error .message{font-weight:500}md-dialog.import-dialog .error-list .error .md-button{margin:0}md-dialog.import-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.import-dialog .error-list .info{background-color:rgba(24,160,135,.08);border:1px solid rgba(24,160,135,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.import-dialog .error-list .info .message{font-weight:500}md-dialog.import-dialog .error-list .info .md-button{margin:0}md-dialog.import-dialog .error-list .info:last-child{margin-bottom:30px}md-dialog.import-dialog .contact-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}md-dialog.import-dialog .contact-image img{height:100%;width:auto;max-width:none}md-dialog.import-dialog .contact-image .media{max-height:100%}md-dialog.import-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.cm-contact-dialog{max-width:720px;width:720px}md-dialog.cm-contact-dialog md-dialog-content{display:block;position:relative}md-dialog.cm-contact-dialog md-toolbar .title{font-size:17px}md-dialog.cm-contact-dialog md-input-container textarea{min-height:150px}md-dialog.cm-contact-dialog .date-container{padding:16px 0 24px 0}md-dialog.cm-contact-dialog .error-list{font-size:13px}md-dialog.cm-contact-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cm-contact-dialog .error-list .error .message{font-weight:500}md-dialog.cm-contact-dialog .error-list .error .md-button{margin:0}md-dialog.cm-contact-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cm-contact-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.globalCustomField-dialog{max-width:720px;width:720px}md-dialog.globalCustomField-dialog md-dialog-content{display:block;position:relative}md-dialog.globalCustomField-dialog md-toolbar .title{font-size:17px}md-dialog.globalCustomField-dialog md-input-container textarea{min-height:150px}md-dialog.globalCustomField-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.globalCustomField-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.globalCustomField-dialog .date-container{padding:16px 0 24px 0}md-dialog.globalCustomField-dialog .error-list{font-size:13px}md-dialog.globalCustomField-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.globalCustomField-dialog .error-list .error .message{font-weight:500}md-dialog.globalCustomField-dialog .error-list .error .md-button{margin:0}md-dialog.globalCustomField-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.globalCustomField-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#globalCustomFields{position:relative}#globalCustomFields>.header{height:76px;min-height:76px;max-height:76px}#globalCustomFields>.header .logo .logo-icon{margin:0 16px 0 0}#globalCustomFields>.header .logo .logo-text{font-size:24px}#globalCustomFields>.header md-icon{color:#fff}#globalCustomFields>.header .search-input-wrapper{position:relative}#globalCustomFields>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#globalCustomFields>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#globalCustomFields>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#globalCustomFields>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#globalCustomFields>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#globalCustomFields>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#globalCustomFields>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#globalCustomFields>.header.selected-bar .close-button-wrapper{width:244px}#globalCustomFields>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#globalCustomFields>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#globalCustomFields>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#globalCustomFields #add-globalCustomField-button{position:fixed;bottom:8px;right:8px;padding:0}#globalCustomFields #upload-globalCustomField-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.list-dialog{max-width:720px;width:720px}md-dialog.list-dialog md-dialog-content{display:block;position:relative}md-dialog.list-dialog md-toolbar .title{font-size:17px}md-dialog.list-dialog md-input-container textarea{min-height:150px}md-dialog.list-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.list-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.list-dialog .date-container{padding:16px 0 24px 0}md-dialog.list-dialog .error-list{font-size:13px}md-dialog.list-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.list-dialog .error-list .error .message{font-weight:500}md-dialog.list-dialog .error-list .error .md-button{margin:0}md-dialog.list-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.list-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.customField-dialog{max-width:720px;width:720px}md-dialog.customField-dialog md-dialog-content{display:block;position:relative}md-dialog.customField-dialog md-toolbar .title{font-size:17px}md-dialog.customField-dialog md-input-container textarea{min-height:150px}md-dialog.customField-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.customField-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.customField-dialog .date-container{padding:16px 0 24px 0}md-dialog.customField-dialog .error-list{font-size:13px}md-dialog.customField-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.customField-dialog .error-list .error .message{font-weight:500}md-dialog.customField-dialog .error-list .error .md-button{margin:0}md-dialog.customField-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.customField-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#contactmanager-list .header{height:76px;min-height:76px;max-height:76px}#contactmanager-list .header .goto-lists-button{margin-right:16px}#contactmanager-list .header .list-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#contactmanager-list .header .list-image img{height:100%;width:auto;max-width:none}#contactmanager-list .header .subtitle{margin:6px 0 0 0}#contactmanager-list .list-detail-form-container{padding:24px;margin-bottom:24px}#contactmanager-list .list-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#contactmanager-list .list-detail-form-container .handle{cursor:move}#contactmanager-list .list-detail-form-container md-input-container md-switch{margin:0!important}#contactmanager-list .list-detail-form-container #list-image-uploader{position:relative}#contactmanager-list .list-detail-form-container #list-image-uploader.dropping .drop-text{display:flex}#contactmanager-list .list-detail-form-container #list-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#contactmanager-list .list-detail-form-container #list-image-uploader .upload-button{margin-bottom:16px}#contactmanager-list .list-detail-form-container #list-image-uploader .list-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#contactmanager-list .list-detail-form-container #list-image-uploader .list-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#contactmanager-list .list-detail-form-container #list-image-uploader .list-image .media{max-height:100%}#contactmanager-list md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#contactmanager-list md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#contactmanager-list md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#contactmanager-list md-table-container.font-size-12 td.md-cell{font-size:12px!important}#lists{position:relative}#lists>.header{height:76px;min-height:76px;max-height:76px}#lists>.header .logo .logo-icon{margin:0 16px 0 0}#lists>.header .logo .logo-text{font-size:24px}#lists>.header md-icon{color:#fff}#lists>.header .search-input-wrapper{position:relative}#lists>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#lists>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#lists>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#lists>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#lists>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#lists>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#lists>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#lists>.header.selected-bar .close-button-wrapper{width:244px}#lists>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#lists>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#lists>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#lists #add-list-button{position:fixed;bottom:8px;right:8px;padding:0}#lists #upload-list-button{position:fixed;bottom:8px;right:8px;padding:0}#dashboard-custom .filter-header{background-image:url(/assets/images/backgrounds/header-bg.png);color:#fff}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#agent-general{width:100%;height:100%;overflow:hidden}#agent-general .agent-content{width:100%;height:100%;overflow:auto}#agent-general .agent-content.overflow-hidden{overflow:hidden}#agent-general .agent-content md-tabs{width:100%;height:100%}#agent-general .agent-content md-tabs md-tabs-content-wrapper{width:100%;height:calc(100% - 48px)}#agent-general .agent-content md-tabs md-tabs-content-wrapper md-tab-content.md-active{width:100%;height:100%;overflow:auto}#agent-general .agent-general-home-navbar{flex-grow:1;overflow-y:auto;overflow-x:hidden}#agent-general .agent-general-home-navbar::-webkit-scrollbar{width:0;background:0 0}#agent-general .agent-general-home-navbar::-webkit-scrollbar-thumb{background:0 0;border-radius:0}#agent-general .agent-general-home-sections{width:100%;height:100%;overflow:auto}#agent-general .badge{min-width:20px;height:20px;line-height:20px;padding:0 7px;font-size:11px;font-weight:700;border-radius:20px;transition:opacity .2s ease-in-out .1s}#agent-general .table-header{background-image:url(/assets/images/backgrounds/header-bg.png);color:#fff;overflow-x:auto}#agent-general .table-header::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.2)}#agent-general .table-header .md-toolbar-tools div md-select .md-select-value.md-select-placeholder{color:#fff}#agent-general .table-header .md-toolbar-tools div md-select[disabled] .md-select-value.md-select-placeholder{color:#fff}#agent-general .table-header .md-toolbar-tools div md-select[disabled] .md-select-value.md-select-placeholder .md-select-icon{display:none}#agent-general .table-header ms-quick-filter .quick-filter-date-clear-button{color:#fff}#agent-general .tooltip-preview{position:relative;display:inline-block;text-decoration:underline}#agent-general .tooltip-preview .tooltip-preview-text{display:none;opacity:0;width:500px;height:216px;position:fixed;white-space:pre-line;z-index:99999999;overflow:hidden;transition:opacity cubic-bezier(.075,.82,.165,1)}#agent-general .tooltip-preview .tooltip-preview-text .tooltip-preview-text-container{width:100%;height:100%;overflow:hidden}#agent-general .tooltip-preview .tooltip-preview-text .tooltip-preview-text-container .email-preview-message{display:block;display:-webkit-box;margin:0 auto;width:100%;height:100%;line-height:1.4;-webkit-line-clamp:10;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-all}#agent-general .tooltip-preview:hover .tooltip-preview-text{display:block;opacity:1}#agent-general .reload-list md-icon{color:#fff}#agent-general .advanced-search md-icon{color:#fff}#agent-general .create-new md-icon{color:#fff}#agent-general div.draft-manager-bar{background-color:#f5f5f5;position:sticky;height:34px;bottom:0;border-top:1px solid #e0e0e0}#agent-general div.draft-manager-bar ms-tab-scroll{overflow:hidden}#agent-general div.draft-manager-bar ms-tab-scroll div.draft-manager-tab{height:34px;border-right:1px solid #e0e0e0}#agent-general td.width-5,#agent-general th.width-5{width:5px!important;min-width:auto!important;max-width:none!important}#agent-general td.width-10,#agent-general th.width-10{width:10px!important;min-width:auto!important;max-width:none!important}#agent-general td.width-15,#agent-general th.width-15{width:15px!important;min-width:auto!important;max-width:none!important}#agent-general td.no-padding,#agent-general th.no-padding{padding:0!important}#agent-general span.contact-text{width:100px!important}#agent-general span.subject-text{width:300px!important}#agent-general span.no-margin-bottom{margin-bottom:0!important}#agent-general span.no-margin-top{margin-top:0!important}#agent-general md-table-container.interactions-list thead tr th:not(.no-padding):not(.id-header){padding:0 20px 0 0!important}#agent-general md-table-container.interactions-list tbody tr td:not(.no-padding):not(.actions-padding):not(.id){padding:0 20px 0 0!important}#agent-general td.actions-padding{padding:0 8px 0 0!important}#agent-general md-toolbar.md-table-toolbar[disabled]{pointer-events:none}#agent-general md-toolbar.md-table-toolbar[disabled] ms-search-bar{opacity:.7}#agent-general md-toolbar.md-table-toolbar[disabled] ms-quick-filter{opacity:.7}#agent-general md-toolbar.md-table-toolbar[disabled] button.advanced-search,#agent-general md-toolbar.md-table-toolbar[disabled] button.interaction-reload{opacity:.7}#agent-general md-card.call-info-card{min-width:220px}#agent-general md-card.call-info-card md-card-content,#agent-general md-card.call-info-card md-card-header{padding:10px!important}#agent-general md-card.call-info-card button.reload-button{padding:0;height:22px;width:auto}@media screen and (max-width:1280px){#agent-general span.contact-text{width:100px!important}}@media screen and (max-width:1920px){#agent-general span.contact-text{width:150px!important}}#agent-general-dialog{position:fixed;width:100%;height:100%}#agent-general-dialog .agent-content{position:fixed;top:0;bottom:0;left:0;right:0}body .md-select-menu-container{z-index:110}.md-toolbar-tools{font-size:12px}div.toolbar-quick-filter[disabled]{pointer-events:none;opacity:.7}md-dialog.agent-dialog{max-width:720px;width:720px}md-dialog.agent-dialog md-dialog-content{display:block;position:relative}md-dialog.agent-dialog md-toolbar .title{font-size:17px}md-dialog.agent-dialog md-input-container textarea{min-height:150px}md-dialog.agent-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.agent-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.agent-dialog .date-container{padding:16px 0 24px 0}md-dialog.agent-dialog .error-list{font-size:13px}md-dialog.agent-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.agent-dialog .error-list .error .message{font-weight:500}md-dialog.agent-dialog .error-list .error .md-button{margin:0}md-dialog.agent-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.agent-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.agent-dialog{max-width:720px;width:720px}md-dialog.agent-dialog md-dialog-content{display:block;position:relative}md-dialog.agent-dialog md-toolbar .title{font-size:17px}md-dialog.agent-dialog md-input-container textarea{min-height:150px}md-dialog.agent-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.agent-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.agent-dialog .date-container{padding:16px 0 24px 0}md-dialog.agent-dialog .error-list{font-size:13px}md-dialog.agent-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.agent-dialog .error-list .error .message{font-weight:500}md-dialog.agent-dialog .error-list .error .md-button{margin:0}md-dialog.agent-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.agent-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.contact-trigger-dialog{max-width:720px;width:720px}md-dialog.contact-trigger-dialog md-dialog-content{display:block;position:relative;max-height:400px;height:400px}md-dialog.contact-trigger-dialog md-toolbar{background-image:url(/assets/images/backgrounds/header-bg.png);background-position:top}md-dialog.contact-trigger-dialog md-toolbar .title{font-size:17px}md-dialog.contact-trigger-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}md-dialog.contact-trigger-dialog md-dialog-actions button.select-button{position:absolute;right:0;margin-right:16px}md-dialog md-grid-list.one-row-layout{height:150px;max-height:150px}md-dialog md-grid-list.two-rows-layout{height:300px;max-height:300px}md-dialog md-card.contact-info:hover{background-color:#e9eef1ad}@media screen and (max-width:1280px){md-dialog.contact-trigger-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.contact-trigger-dialog{width:90%}}md-dialog.agent-dialog{max-width:720px;width:720px}md-dialog.agent-dialog md-dialog-content{display:block;position:relative}md-dialog.agent-dialog md-toolbar .title{font-size:17px}md-dialog.agent-dialog md-input-container textarea{min-height:150px}md-dialog.agent-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.agent-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.agent-dialog .date-container{padding:16px 0 24px 0}md-dialog.agent-dialog .error-list{font-size:13px}md-dialog.agent-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.agent-dialog .error-list .error .message{font-weight:500}md-dialog.agent-dialog .error-list .error .md-button{margin:0}md-dialog.agent-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.agent-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.details-dialog{max-width:500px;width:500px}md-dialog.details-dialog md-dialog-content{display:block;position:relative}md-dialog.details-dialog md-toolbar .title{font-size:17px}md-dialog.details-dialog md-input-container textarea{min-height:150px}md-dialog.details-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.details-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.details-dialog .date-container{padding:16px 0 24px 0}md-dialog.details-dialog .error-list{font-size:13px}md-dialog.details-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.details-dialog .error-list .error .message{font-weight:500}md-dialog.details-dialog .error-list .error .md-button{margin:0}md-dialog.details-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.details-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#interaction-app .tags{font-size:12px}#interaction-app .tags .tag{border-radius:2px;padding:3px 8px;background-color:rgba(0,0,0,.08)}#interaction-app .tags .tag .tag-color{width:8px;height:8px;margin-right:8px;border-radius:50%}#interaction-app .content-card{position:relative;height:100%}#interaction-app .content-card .interaction{background:linear-gradient(to bottom,rgba(255,255,255,.8) 0,rgba(255,255,255,.6) 20%,rgba(255,255,255,.8))}#interaction-app .content-card .interaction .avatar-small{width:30px;min-width:30px;height:30px;line-height:30px;margin:0 8px 0 0;border-radius:50%;font-size:17px;font-weight:500;text-align:center;color:#fff}#interaction-app .content-card .interaction .interaction-agents{min-height:40px;background-color:#f3f4f5;color:rgba(0,0,0,.87);border-bottom:1px solid rgba(0,0,0,.08)}#interaction-app .content-card .interaction .interaction-agents .responsive-interactions-button{padding:0}#interaction-app .content-card .interaction .interaction-agents .interaction-contact{cursor:pointer}#interaction-app .content-card .interaction .interaction-agents .interaction-contact .avatar{margin-right:16px}#interaction-app .content-card .interaction .interaction-toolbar{min-height:64px;background-color:#f3f4f5;color:rgba(0,0,0,.87);border-bottom:1px solid rgba(0,0,0,.08)}#interaction-app .content-card .interaction .interaction-toolbar md-icon{color:rgba(0,0,0,.87)}#interaction-app .content-card .interaction .interaction-toolbar .responsive-interactions-button{padding:0}#interaction-app .content-card .interaction .interaction-toolbar .interaction-contact{cursor:pointer}#interaction-app .content-card .interaction .interaction-toolbar .interaction-contact .avatar{margin-right:16px}#interaction-app .content-card .interaction .cannedarea{margin-right:7px;font-size:14px;border:1px solid #ccc;border-radius:3px;align-self:stretch}#interaction-app .content-card .interaction .cannedarea md-autocomplete-wrap{padding:0 1em}#interaction-app .content-card .interaction .emojionearea{margin-right:7px}#interaction-app .content-card .interaction #interaction-content{background:url(/assets/images/patterns/circles-light.png) repeat}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content{padding:24px 0}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .subject{color:rgba(0,0,0,.54)}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .subject .subject-text{margin-right:4px;text-transform:lowercase}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info{padding-bottom:16px}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .avatar{margin-right:16px}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .name{margin-right:8px;font-weight:500}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .toggle-details{padding-top:16px;cursor:pointer;font-weight:500}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .details{padding-top:8px}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .details .title{font-weight:500;margin-right:6px}#interaction-app .content-card .interaction #interaction-content .message-row .mail-content .info .details .detail{color:rgba(0,0,0,.54)}#interaction-app .content-card .interaction #interaction-content .message-row .bubble{position:relative;padding:6px 7px 8px 9px;background-color:#fff;border:1px solid #dcdfe1;border-radius:6px;word-break:break-word}#interaction-app .content-card .interaction #interaction-content .message-row .bubble:after,#interaction-app .content-card .interaction #interaction-content .message-row .bubble:before{content:' ';position:absolute;width:0;height:0}#interaction-app .content-card .interaction #interaction-content .message-row .bubble:after{left:-7px;right:auto;top:0;bottom:auto;border:11px solid;border-color:#fff transparent transparent transparent}#interaction-app .content-card .interaction #interaction-content .message-row .bubble:before{left:-9px;right:auto;top:-1px;bottom:auto;border:8px solid;border-color:#dcdfe1 transparent transparent transparent}#interaction-app .content-card .interaction #interaction-content .message-row .bubble .time{font-size:11px;margin-top:0;text-align:right}#interaction-app .content-card .interaction #interaction-content .message-row .bubble .message{white-space:pre-wrap}#interaction-app .content-card .interaction #interaction-content .message-row .bubble .message span{word-break:break-all}#interaction-app .content-card .interaction #interaction-content .message-row.in{padding:5px}#interaction-app .content-card .interaction #interaction-content .message-row.in .avatar{margin:0 16px 0 0}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned{padding:5px;align-items:flex-end}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned .avatar{order:2;margin:0 0 0 16px}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned .bubble{margin-left:auto;order:1}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned .bubble:after{right:-9px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#interaction-app .content-card .interaction #interaction-content .message-row.in-right-aligned .bubble:before{right:-11px;left:auto;-moz-transform:scaleX(-1);-o-transform:scaleX(-1);-webkit-transform:scaleX(-1);transform:scaleX(-1)}#interaction-app .content-card .interaction #interaction-content .message-row.out{padding:5px;align-items:flex-end}#interaction-app .content-card .interaction #interaction-content .message-row.out .avatar{order:2;margin:0 0 0 16px}#interaction-app .content-card .interaction #interaction-content .message-row.out .bubble{margin-left:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#interaction-app .content-card .interaction #interaction-content .message-row.out .bubble:after{right:-7px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#interaction-app .content-card .interaction #interaction-content .message-row.out .bubble:before{right:-9px;left:auto;top:auto;bottom:-1px;border-color:transparent transparent #dfebe0 transparent}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned{padding:5px}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned .avatar{order:1;margin:0 16px 0 0}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned .bubble{background-color:#e8f5e9;border:1px solid #dfebe0;order:2}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned .bubble:after{right:-7px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#interaction-app .content-card .interaction #interaction-content .message-row.out-left-aligned .bubble:before{right:-9px;left:auto;top:auto;bottom:-1px;border-color:transparent transparent #dfebe0 transparent}#interaction-app .content-card .interaction .interaction-footer{min-height:64px;max-height:180px;background-color:#f3f4f5;color:rgba(0,0,0,.87);border-top:1px solid rgba(0,0,0,.08);padding:8px 8px 8px 16px}#interaction-app .content-card .interaction .interaction-footer .reply-form md-input-container{margin:0;padding-right:16px}#interaction-app .content-card .interaction .interaction-footer .reply-form md-input-container textarea{overflow:auto;max-height:80px;transition:height .2s ease}#interaction-app .content-card .interaction .interaction-footer .reply-form md-input-container textarea.grow{height:80px}#interaction-app .content-card .interaction .interaction-footer .reply-form md-input-container .md-errors-spacer{display:none}#interaction-app .content-card .interaction .interaction-footer .reply-form .md-button{margin:0}#interaction-app .content-card .info md-list-item{min-height:40px;height:52px}#interaction-app .content-card .start-point{background:linear-gradient(to bottom,rgba(255,255,255,.8) 0,rgba(255,255,255,.6) 20%,rgba(255,255,255,.8))}#interaction-app .content-card .start-point .big-circle{background:linear-gradient(to bottom,rgba(255,255,255,.8) 0,rgba(255,255,255,.6) 20%,rgba(255,255,255,.8));border-radius:50%;width:300px;height:300px;line-height:300px;text-align:center}#interaction-app .content-card .start-point .app-title{font-weight:500;font-size:32px;margin:12px 0}#interaction-app .content-card .start-point .secondary-text{font-size:16px}#interaction-app .content-card .sidenav md-toolbar{border-bottom:1px solid rgba(0,0,0,.08)}#interaction-app .content-card .sidenav md-toolbar .md-toolbar-tools-bottom .search{height:36px;line-height:36px;padding:8px;background:#fff;font-size:13px}#interaction-app .content-card .sidenav md-toolbar .md-toolbar-tools-bottom .search .icon{margin:0;color:rgba(0,0,0,.54)}#interaction-app .content-card .sidenav md-toolbar .md-toolbar-tools-bottom .search input{padding-left:12px;height:36px;color:rgba(0,0,0,.54)}#interaction-app .content-card .sidenav md-list.contact-list,#interaction-app .content-card .sidenav md-list.interaction-list{position:relative;transition:all .2s ease-out}#interaction-app .content-card .sidenav md-list.contact-list .subheader,#interaction-app .content-card .sidenav md-list.contact-list md-list-item,#interaction-app .content-card .sidenav md-list.interaction-list .subheader,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item{position:absolute;right:0;left:0;width:100%;transition:transform .2s ease-out;background:#fff;will-change:transform}#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-leave,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-leave,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-leave,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-leave{transform:translateY(0);display:none}#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-leave.ng-leave-active,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-leave.ng-leave-active,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-leave.ng-leave-active,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-leave.ng-leave-active{transform:translateY(-100%)}#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-hide,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-hide,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-hide,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-hide{display:none}#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-hide-add-active,#interaction-app .content-card .sidenav md-list.contact-list .subheader.ng-hide-remove-active,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-hide-add-active,#interaction-app .content-card .sidenav md-list.contact-list md-list-item.ng-hide-remove-active,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-hide-add-active,#interaction-app .content-card .sidenav md-list.interaction-list .subheader.ng-hide-remove-active,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-hide-add-active,#interaction-app .content-card .sidenav md-list.interaction-list md-list-item.ng-hide-remove-active{display:block;transition-property:all}#interaction-app .content-card .sidenav md-list.contact-list .subheader,#interaction-app .content-card .sidenav md-list.interaction-list .subheader{padding-left:16px;font-size:20px;font-weight:300;height:88px;line-height:88px}#interaction-app .content-card .sidenav .no-results-message{position:absolute;width:100%;height:88px;padding:16px;background:#fff;font-size:15px;font-weight:400}#interaction-app .avatar-wrapper{position:relative}#interaction-app .avatar-wrapper .avatar{margin-top:0;margin-bottom:0}#interaction-app .status{position:absolute;top:28px;left:28px;border-radius:50%}#interaction-app .status.online{color:#4caf50}#interaction-app .status.online:before{content:'\e709'}#interaction-app .status.do-not-disturb{color:#f44336}#interaction-app .status.do-not-disturb:before{content:'\e912'}#interaction-app .status.away{background-color:#ffc107;color:#fff}#interaction-app .status.away:before{content:'\e727'}#interaction-app .status.offline{color:#4caf50;background-color:#fff}#interaction-app .status.offline:before{content:'\e704'}#interaction-app .editable-wrap{position:relative}#interaction-app .editable-wrap .editable-controls{display:flex;flex-direction:row;align-items:center;width:100%}#interaction-app .editable-wrap .editable-controls .editable-input{width:inherit;background-color:#fff;padding:8px;border:1px solid rgba(0,0,0,.12)}#interaction-app .editable-wrap .editable-controls .editable-buttons{display:inherit}#interaction-app .editable-wrap .editable-controls .editable-buttons .md-button{margin:0}#interaction-app .editable-wrap .editable-controls .editable-buttons .md-button:first-of-type{padding-right:0}#interaction-app .editable-wrap .editable-controls .editable-buttons .md-button .icon-cancel{color:rgba(0,0,0,.32)}#interaction-app .editable-click{cursor:pointer;text-decoration:none;color:inherit;border-bottom:none}#interaction-app .emoji-picker-icon{right:5px;cursor:pointer}#interaction-app .input-show-hide{transition:all linear .5s}#interaction-app .input-show-hide.ng-hide{opacity:0}#interaction-app div.interaction-reply-button-container{display:inline;padding-bottom:14px}#timeline{position:relative;height:auto;padding-bottom:30px}#timeline:before{display:block;position:absolute;z-index:10;content:'';width:2px;background:rgba(0,0,0,.08);top:0;left:50%;bottom:0;margin-left:-1px}#timeline .ms-timeline-item{overflow:hidden;position:relative;z-index:20;width:100%;margin:0 auto;max-width:1200px}#timeline .ms-timeline-item .timeline-card{order:1}#timeline .ms-timeline-item .timeline-card .interaction .header .avatar .image{display:block;width:40px;height:40px;border-radius:20px}#timeline .ms-timeline-item .timeline-card .interaction .media .image{width:100%}#timeline .ms-timeline-item .timeline-point{position:absolute;width:40px;height:40px;line-height:40px;text-align:center;border-radius:50%;left:50%;margin:16px 0 0 -28px;order:2}#timeline .ms-timeline-item .timeline-point md-icon{color:#fff}#timeline .ms-timeline-item .timeline-detail{flex:50% 0 0;padding-top:28px;order:3}#timeline .ms-timeline-item .timeline-detail .time{font-size:15px;padding-left:68px}#timeline .ms-timeline-item .timeline-detail .event{color:rgba(0,0,0,.54);padding-left:68px}#timeline .ms-timeline-item:nth-child(odd) .timeline-card{flex-direction:row-reverse}#timeline .ms-timeline-item:nth-child(even) .timeline-card{order:3;padding-right:0}#timeline .ms-timeline-item:nth-child(even) .timeline-card ms-card{padding-left:84px}#timeline .ms-timeline-item:nth-child(even) .timeline-detail{order:1;padding-left:0;text-align:right}#timeline .ms-timeline-item:nth-child(even) .timeline-detail .event,#timeline .ms-timeline-item:nth-child(even) .timeline-detail .time{padding-right:68px}#timeline .ms-timeline-item:first-child{padding-top:15px}#timeline .ms-timeline-item.animate .timeline-card{animation:slide-in-left .4s}#timeline .ms-timeline-item.animate .timeline-point{animation:slide-in-bottom .4s}#timeline .ms-timeline-item.animate .timeline-detail{animation:slide-in-right .4s}#timeline .ms-timeline-item:nth-child(even).animate .timeline-card{animation:slide-in-right .4s}#timeline .ms-timeline-item:nth-child(even).animate .timeline-detail{animation:slide-in-left .4s}#timeline.timeline-left .ms-timeline-item .timeline-card{order:1}#timeline.timeline-left .ms-timeline-item .timeline-card ms-card{padding-right:68px;padding-left:0;margin-left:auto}#timeline.timeline-left .ms-timeline-item .timeline-detail{order:3;text-align:left}#timeline.timeline-left .ms-timeline-item.animate .timeline-card{animation:slide-in-left .4s}#timeline.timeline-left .ms-timeline-item.animate .timeline-detail{animation:slide-in-right .4s}#timeline.timeline-right .ms-timeline-item .timeline-card{order:3}#timeline.timeline-right .ms-timeline-item .timeline-card ms-card{padding-left:68px;padding-right:0;margin-right:auto}#timeline.timeline-right .ms-timeline-item .timeline-detail{order:1;text-align:right}#timeline.timeline-right .ms-timeline-item .timeline-detail .event,#timeline.timeline-right .ms-timeline-item .timeline-detail .time{padding-right:68px;padding-left:0}#timeline.timeline-right .ms-timeline-item.animate .timeline-card{animation:slide-in-right .4s}#timeline.timeline-right .ms-timeline-item.animate .timeline-detail{animation:slide-in-left .4s}@media screen and (max-width:1280px){#timeline .ms-timeline-item,#timeline.timeline-left .ms-timeline-item,#timeline.timeline-right .ms-timeline-item{display:block}#timeline .ms-timeline-item .timeline-point,#timeline.timeline-left .ms-timeline-item .timeline-point,#timeline.timeline-right .ms-timeline-item .timeline-point{position:relative;left:auto;margin:0 auto 16px auto;padding:0}#timeline .ms-timeline-item .timeline-detail,#timeline.timeline-left .ms-timeline-item .timeline-detail,#timeline.timeline-right .ms-timeline-item .timeline-detail{padding:2px;margin-bottom:16px}#timeline .ms-timeline-item .timeline-detail .event,#timeline .ms-timeline-item .timeline-detail .time,#timeline.timeline-left .ms-timeline-item .timeline-detail .event,#timeline.timeline-left .ms-timeline-item .timeline-detail .time,#timeline.timeline-right .ms-timeline-item .timeline-detail .event,#timeline.timeline-right .ms-timeline-item .timeline-detail .time{padding-right:0;padding-left:0;text-align:center}#timeline .ms-timeline-item .timeline-card ms-card,#timeline.timeline-left .ms-timeline-item .timeline-card ms-card,#timeline.timeline-right .ms-timeline-item .timeline-card ms-card{margin:0 auto;padding:0}#timeline .ms-timeline-item:nth-child(even) .timeline-point,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-point,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-point{position:relative;left:auto;margin:0 auto 16px auto;padding:0}#timeline .ms-timeline-item:nth-child(even) .timeline-detail,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-detail,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-detail{padding:2px;margin-bottom:16px}#timeline .ms-timeline-item:nth-child(even) .timeline-detail .event,#timeline .ms-timeline-item:nth-child(even) .timeline-detail .time,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-detail .event,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-detail .time,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-detail .event,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-detail .time{padding-right:0;padding-left:0;text-align:center}#timeline .ms-timeline-item:nth-child(even) .timeline-card ms-card,#timeline.timeline-left .ms-timeline-item:nth-child(even) .timeline-card ms-card,#timeline.timeline-right .ms-timeline-item:nth-child(even) .timeline-card ms-card{margin:0 auto;padding:0}}md-dialog.compose-dialog{max-width:720px;width:720px}md-dialog.compose-dialog.mail-no-secret{max-height:97%;max-width:90%!important;width:100%!important}md-dialog.compose-dialog md-dialog-content{display:block;position:relative}md-dialog.compose-dialog md-toolbar .title{font-size:17px}md-dialog.compose-dialog md-toolbar .vertical-divider{position:absolute;border-right-width:.5px;border-right-style:solid;height:100%}md-dialog.compose-dialog md-chips md-chip{font-size:12px}md-dialog.compose-dialog md-chips .md-chip-input-container{width:100%}md-dialog.compose-dialog .to{position:relative}md-dialog.compose-dialog .to.hidden-cc input{padding-right:32px}md-dialog.compose-dialog .to.hidden-cc.hidden-bcc input{padding-right:56px}md-dialog.compose-dialog .to.hidden-bcc input{padding-right:32px}md-dialog.compose-dialog .to .cc-bcc{position:absolute;bottom:8px;right:0}md-dialog.compose-dialog .to .cc-bcc .show-bcc,md-dialog.compose-dialog .to .cc-bcc .show-cc{cursor:pointer;font-size:12px}md-dialog.compose-dialog .to .cc-bcc .show-bcc{margin-left:8px}md-dialog.compose-dialog .attachment-list{font-size:13px}md-dialog.compose-dialog .attachment-list .attachment{background-color:rgba(0,0,0,.08);border:1px solid rgba(0,0,0,.16);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.compose-dialog .attachment-list .attachment .filename{font-weight:500}md-dialog.compose-dialog .attachment-list .attachment .md-button{margin:0}md-dialog.compose-dialog .attachment-list .attachment:last-child{margin-bottom:0}md-dialog.compose-dialog .error-list{font-size:13px}md-dialog.compose-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.compose-dialog .error-list .error .message{font-weight:500}md-dialog.compose-dialog .error-list .error .md-button{margin:0}md-dialog.compose-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.compose-dialog .emojionearea{max-width:700px;min-height:300px}md-dialog.compose-dialog md-dialog-actions{position:relative;justify-content:space-between;border-top:1px solid rgba(0,0,0,.12);background-color:rgba(0,0,0,.03)}@media screen and (max-width:960px){md-dialog.compose-dialog{width:80%}}@media screen and (max-width:600px){md-dialog.compose-dialog{width:90%}}md-dialog.disposition-dialog{max-width:720px;width:720px}md-dialog.disposition-dialog md-dialog-content{display:block;position:relative}md-dialog.disposition-dialog md-toolbar .title{font-size:17px}md-dialog.disposition-dialog md-input-container textarea{min-height:150px}md-dialog.disposition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.disposition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.disposition-dialog .date-container{padding:16px 0 24px 0}md-dialog.disposition-dialog .error-list{font-size:13px}md-dialog.disposition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.disposition-dialog .error-list .error .message{font-weight:500}md-dialog.disposition-dialog .error-list .error .md-button{margin:0}md-dialog.disposition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.disposition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.disposition-dialog{max-width:720px;width:720px}md-dialog.disposition-dialog md-dialog-content{display:block;position:relative}md-dialog.disposition-dialog md-toolbar .title{font-size:17px}md-dialog.disposition-dialog md-input-container textarea{min-height:150px}md-dialog.disposition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.disposition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.disposition-dialog .date-container{padding:16px 0 24px 0}md-dialog.disposition-dialog .error-list{font-size:13px}md-dialog.disposition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.disposition-dialog .error-list .error .message{font-weight:500}md-dialog.disposition-dialog .error-list .error .md-button{margin:0}md-dialog.disposition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.disposition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.disposition-dialog{max-width:720px;width:720px}md-dialog.disposition-dialog md-dialog-content{display:block;position:relative}md-dialog.disposition-dialog md-toolbar .title{font-size:17px}md-dialog.disposition-dialog md-input-container textarea{min-height:150px}md-dialog.disposition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.disposition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.disposition-dialog .date-container{padding:16px 0 24px 0}md-dialog.disposition-dialog .error-list{font-size:13px}md-dialog.disposition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.disposition-dialog .error-list .error .message{font-weight:500}md-dialog.disposition-dialog .error-list .error .md-button{margin:0}md-dialog.disposition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.disposition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#dashboard-general>.center>.header{height:160px;min-height:160px;max-height:160px;padding-bottom:0}#dashboard-general>.center>.header .selected-general{background:rgba(0,0,0,.12);color:#fff;padding:8px 16px;height:40px;line-height:24px;font-size:16px}#dashboard-general>.center>.header .general-selector{margin-left:1px;border-radius:0;background:rgba(0,0,0,.12)}#dashboard-general>.center>.header .general-selector md-icon{color:#fff}#dashboard-general>.center>.content{background:0 0;padding:0}#dashboard-general>.center>.content>md-tabs>md-tabs-wrapper{background:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);padding:0 24px}#dashboard-general>.center>.content>md-tabs>md-tabs-wrapper md-tabs-canvas{height:56px}#dashboard-general>.center>.content>md-tabs>md-tabs-wrapper md-tabs-canvas md-pagination-wrapper{height:56px}#dashboard-general>.center>.content>md-tabs>md-tabs-wrapper md-tabs-canvas .md-tab{padding:16px 24px;text-transform:none}#dashboard-general>.center>.content>md-tabs:not(.md-dynamic-height) md-tabs-content-wrapper{top:56px}#dashboard-general>.center>.content>md-tabs>md-tabs-content-wrapper md-tab-content{padding:12px}#dashboard-general>.sidenav{width:330px;min-width:330px;max-width:330px;padding:0;z-index:51;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}#dashboard-general>.sidenav.md-locked-open{width:250px;min-width:250px;max-width:250px;z-index:2;box-shadow:none;background:#eee}#dashboard-general .dashboard-container{padding:24px;margin-bottom:24px}#dashboard-general .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.faxAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.faxAccount-dialog{max-width:720px;width:720px}md-dialog.faxAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.faxAccount-dialog md-toolbar .title{font-size:17px}md-dialog.faxAccount-dialog md-input-container textarea{min-height:150px}md-dialog.faxAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxAccount-dialog .error-list{font-size:13px}md-dialog.faxAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxAccount-dialog .error-list .error .message{font-weight:500}md-dialog.faxAccount-dialog .error-list .error .md-button{margin:0}md-dialog.faxAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#fax-faxAccount .header{height:76px;min-height:76px;max-height:76px}#fax-faxAccount .header .goto-faxAccounts-button{margin-right:16px}#fax-faxAccount .header .faxAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#fax-faxAccount .header .faxAccount-image img{height:100%;width:auto;max-width:none}#fax-faxAccount .header .subtitle{margin:6px 0 0 0}#fax-faxAccount .faxAccount-detail-form-container{padding:24px;margin-bottom:24px}#fax-faxAccount .faxAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#fax-faxAccount .faxAccount-detail-form-container .handle{cursor:move}#fax-faxAccount .faxAccount-detail-form-container md-input-container md-switch{margin:0!important}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader{position:relative}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader.dropping .drop-text{display:flex}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .upload-button{margin-bottom:16px}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .faxAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .faxAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#fax-faxAccount .faxAccount-detail-form-container #faxAccount-image-uploader .faxAccount-image .media{max-height:100%}#fax-faxAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#fax-faxAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#fax-faxAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#fax-faxAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#fax-faxAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#fax-faxAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#fax-faxAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#fax-faxAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#fax-faxAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#fax-faxAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#fax-faxAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#fax-faxAccount .actionAppData{width:80px!important}}#faxAccounts{position:relative}#faxAccounts>.header{height:76px;min-height:76px;max-height:76px}#faxAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#faxAccounts>.header .logo .logo-text{font-size:24px}#faxAccounts>.header md-icon{color:#fff}#faxAccounts>.header .search-input-wrapper{position:relative}#faxAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#faxAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#faxAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#faxAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#faxAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#faxAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#faxAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#faxAccounts>.header.selected-bar .close-button-wrapper{width:244px}#faxAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#faxAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#faxAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#faxAccounts #add-faxAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#faxAccounts #upload-faxAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.faxQueue-dialog{max-width:720px;width:720px}md-dialog.faxQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.faxQueue-dialog md-toolbar .title{font-size:17px}md-dialog.faxQueue-dialog md-input-container textarea{min-height:150px}md-dialog.faxQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.faxQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.faxQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.faxQueue-dialog .error-list{font-size:13px}md-dialog.faxQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.faxQueue-dialog .error-list .error .message{font-weight:500}md-dialog.faxQueue-dialog .error-list .error .md-button{margin:0}md-dialog.faxQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.faxQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#fax-faxQueue .header{height:76px;min-height:76px;max-height:76px}#fax-faxQueue .header .goto-faxQueues-button{margin-right:16px}#fax-faxQueue .header .faxQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#fax-faxQueue .header .faxQueue-image img{height:100%;width:auto;max-width:none}#fax-faxQueue .header .subtitle{margin:6px 0 0 0}#fax-faxQueue .faxQueue-detail-form-container{padding:24px;margin-bottom:24px}#fax-faxQueue .faxQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#fax-faxQueue .faxQueue-detail-form-container .handle{cursor:move}#fax-faxQueue .faxQueue-detail-form-container md-input-container md-switch{margin:0!important}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader{position:relative}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader.dropping .drop-text{display:flex}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .upload-button{margin-bottom:16px}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .faxQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .faxQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#fax-faxQueue .faxQueue-detail-form-container #faxQueue-image-uploader .faxQueue-image .media{max-height:100%}#fax-faxQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#fax-faxQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#fax-faxQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#fax-faxQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#faxQueues{position:relative}#faxQueues>.header{height:76px;min-height:76px;max-height:76px}#faxQueues>.header .logo .logo-icon{margin:0 16px 0 0}#faxQueues>.header .logo .logo-text{font-size:24px}#faxQueues>.header md-icon{color:#fff}#faxQueues>.header .search-input-wrapper{position:relative}#faxQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#faxQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#faxQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#faxQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#faxQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#faxQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#faxQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#faxQueues>.header.selected-bar .close-button-wrapper{width:244px}#faxQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#faxQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#faxQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#faxQueues #add-faxQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#faxQueues #upload-faxQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}#profile .about-tab{max-width:1200px}#profile .about-tab .about{padding:8px}#profile .about-tab .about .general .location md-icon{line-height:13px!important}#profile .about-tab .about .work .job .company{padding:0 16px 0 0;font-weight:500}#profile .about-tab .about .work .job .date{color:rgba(0,0,0,.54)}#profile .about-tab .about-sidebar{padding:8px 8px 8px 32px}#profile .about-tab .about-sidebar .friends .content .friend{padding:4px}#profile .about-tab .about-sidebar .groups .content .group{margin-bottom:16px}#profile .about-tab .about-sidebar .groups .content .group:last-child{margin-bottom:0}#profile .about-tab .about-sidebar .groups .content .group .logo{border:1px solid rgba(0,0,0,.12);margin-right:16px}#profile .about-tab .about-sidebar .groups .content .group .name{font-weight:500;font-size:15px}#profile .about-tab .about-sidebar .groups .content .group .category,#profile .about-tab .about-sidebar .groups .content .group .members{color:rgba(0,0,0,.54)}#profile .about-tab .about-sidebar .groups .content .group .members{margin-top:16px}@media screen and (max-width:960px){#profile .about-tab .about-sidebar{padding:8px}}#maintenance{height:100%;background:url(/assets/images/backgrounds/tech.png) no-repeat;background-size:cover}#maintenance #maintenance-form-wrapper{flex:1 0 auto;padding:32px}#maintenance #maintenance-form-wrapper #maintenance-form{max-width:384px;padding:32px;background:#fff;text-align:center}#maintenance #maintenance-form-wrapper #maintenance-form .logo{width:128px;height:128px;line-height:128px;font-size:86px;font-weight:500;margin:32px auto;color:#fff;border-radius:2px}#maintenance #maintenance-form-wrapper #maintenance-form .title{font-size:17px;margin-top:16px}#maintenance #maintenance-form-wrapper #maintenance-form .subtitle{margin:16px 0;max-width:300px;color:rgba(0,0,0,.54);font-size:15px}@media screen and (max-width:600px){#maintenance #maintenance-form-wrapper{padding:16px}#maintenance #maintenance-form-wrapper #maintenance-form{padding:24px;width:100%}}md-dialog.deskAccount-dialog{max-width:720px;width:720px}md-dialog.deskAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.deskAccount-dialog md-toolbar .title{font-size:17px}md-dialog.deskAccount-dialog md-input-container textarea{min-height:150px}md-dialog.deskAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.deskAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.deskAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.deskAccount-dialog .error-list{font-size:13px}md-dialog.deskAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.deskAccount-dialog .error-list .error .message{font-weight:500}md-dialog.deskAccount-dialog .error-list .error .md-button{margin:0}md-dialog.deskAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.deskAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#deskAccounts{position:relative}#deskAccounts>.header{height:76px;min-height:76px;max-height:76px}#deskAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#deskAccounts>.header .logo .logo-text{font-size:24px}#deskAccounts>.header md-icon{color:#fff}#deskAccounts>.header .search-input-wrapper{position:relative}#deskAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#deskAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#deskAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#deskAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#deskAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#deskAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#deskAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#deskAccounts>.header.selected-bar .close-button-wrapper{width:244px}#deskAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#deskAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#deskAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#deskAccounts #add-deskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#deskAccounts #upload-deskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.deskConfiguration-dialog{max-width:720px;width:720px}md-dialog.deskConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.deskConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.deskConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.deskConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.deskConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.deskConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.deskConfiguration-dialog .error-list{font-size:13px}md-dialog.deskConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.deskConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.deskConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.deskConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.deskConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.deskAccount-item-dialog{max-width:720px;width:720px}md-dialog.deskAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.deskAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.deskAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.deskAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.deskAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.deskAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.deskAccount-item-dialog .error-list{font-size:13px}md-dialog.deskAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.deskAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.deskAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.deskAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.deskAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-deskAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-deskAccount .header .goto-deskAccounts-button{margin-right:16px}#integrations-deskAccount .header .deskAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-deskAccount .header .deskAccount-image img{height:100%;width:auto;max-width:none}#integrations-deskAccount .header .subtitle{margin:6px 0 0 0}#integrations-deskAccount .deskAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-deskAccount .deskAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-deskAccount .deskAccount-detail-form-container .handle{cursor:move}#integrations-deskAccount .deskAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader{position:relative}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader.dropping .drop-text{display:flex}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .deskAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .deskAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-deskAccount .deskAccount-detail-form-container #deskAccount-image-uploader .deskAccount-image .media{max-height:100%}#integrations-deskAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-deskAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-deskAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-deskAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.dynamics365Account-dialog{max-width:720px;width:720px}md-dialog.dynamics365Account-dialog md-dialog-content{display:block;position:relative}md-dialog.dynamics365Account-dialog md-toolbar .title{font-size:17px}md-dialog.dynamics365Account-dialog md-input-container textarea{min-height:150px}md-dialog.dynamics365Account-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.dynamics365Account-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.dynamics365Account-dialog .date-container{padding:16px 0 24px 0}md-dialog.dynamics365Account-dialog .error-list{font-size:13px}md-dialog.dynamics365Account-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.dynamics365Account-dialog .error-list .error .message{font-weight:500}md-dialog.dynamics365Account-dialog .error-list .error .md-button{margin:0}md-dialog.dynamics365Account-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.dynamics365Account-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#dynamics365Accounts{position:relative}#dynamics365Accounts>.header{height:76px;min-height:76px;max-height:76px}#dynamics365Accounts>.header .logo .logo-icon{margin:0 16px 0 0}#dynamics365Accounts>.header .logo .logo-text{font-size:24px}#dynamics365Accounts>.header md-icon{color:#fff}#dynamics365Accounts>.header .search-input-wrapper{position:relative}#dynamics365Accounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#dynamics365Accounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#dynamics365Accounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#dynamics365Accounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#dynamics365Accounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#dynamics365Accounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#dynamics365Accounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#dynamics365Accounts>.header.selected-bar .close-button-wrapper{width:244px}#dynamics365Accounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#dynamics365Accounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#dynamics365Accounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#dynamics365Accounts #add-dynamics365Account-button{position:fixed;bottom:8px;right:8px;padding:0}#dynamics365Accounts #upload-dynamics365Account-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.dynamics365Configuration-dialog{max-width:720px;width:720px}md-dialog.dynamics365Configuration-dialog md-dialog-content{display:block;position:relative}md-dialog.dynamics365Configuration-dialog md-toolbar .title{font-size:17px}md-dialog.dynamics365Configuration-dialog md-input-container textarea{min-height:150px}md-dialog.dynamics365Configuration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.dynamics365Configuration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.dynamics365Configuration-dialog .date-container{padding:16px 0 24px 0}md-dialog.dynamics365Configuration-dialog .error-list{font-size:13px}md-dialog.dynamics365Configuration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.dynamics365Configuration-dialog .error-list .error .message{font-weight:500}md-dialog.dynamics365Configuration-dialog .error-list .error .md-button{margin:0}md-dialog.dynamics365Configuration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.dynamics365Configuration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.dynamics365Account-item-dialog{max-width:720px;width:720px}md-dialog.dynamics365Account-item-dialog md-dialog-content{display:block;position:relative}md-dialog.dynamics365Account-item-dialog md-toolbar .title{font-size:17px}md-dialog.dynamics365Account-item-dialog md-input-container textarea{min-height:150px}md-dialog.dynamics365Account-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.dynamics365Account-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.dynamics365Account-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.dynamics365Account-item-dialog .error-list{font-size:13px}md-dialog.dynamics365Account-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.dynamics365Account-item-dialog .error-list .error .message{font-weight:500}md-dialog.dynamics365Account-item-dialog .error-list .error .md-button{margin:0}md-dialog.dynamics365Account-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.dynamics365Account-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-dynamics365Account .header{height:76px;min-height:76px;max-height:76px}#integrations-dynamics365Account .header .goto-dynamics365Accounts-button{margin-right:16px}#integrations-dynamics365Account .header .dynamics365Account-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-dynamics365Account .header .dynamics365Account-image img{height:100%;width:auto;max-width:none}#integrations-dynamics365Account .header .subtitle{margin:6px 0 0 0}#integrations-dynamics365Account .dynamics365Account-detail-form-container{padding:24px;margin-bottom:24px}#integrations-dynamics365Account .dynamics365Account-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-dynamics365Account .dynamics365Account-detail-form-container .handle{cursor:move}#integrations-dynamics365Account .dynamics365Account-detail-form-container md-input-container md-switch{margin:0!important}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader{position:relative}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader.dropping .drop-text{display:flex}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .upload-button{margin-bottom:16px}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .dynamics365Account-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .dynamics365Account-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-dynamics365Account .dynamics365Account-detail-form-container #dynamics365Account-image-uploader .dynamics365Account-image .media{max-height:100%}#integrations-dynamics365Account md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-dynamics365Account md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-dynamics365Account md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-dynamics365Account md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.freshdeskAccount-dialog{max-width:720px;width:720px}md-dialog.freshdeskAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.freshdeskAccount-dialog md-toolbar .title{font-size:17px}md-dialog.freshdeskAccount-dialog md-input-container textarea{min-height:150px}md-dialog.freshdeskAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshdeskAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshdeskAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshdeskAccount-dialog .error-list{font-size:13px}md-dialog.freshdeskAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshdeskAccount-dialog .error-list .error .message{font-weight:500}md-dialog.freshdeskAccount-dialog .error-list .error .md-button{margin:0}md-dialog.freshdeskAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshdeskAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.freshdeskConfiguration-dialog{max-width:720px;width:720px}md-dialog.freshdeskConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.freshdeskConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.freshdeskConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.freshdeskConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshdeskConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshdeskConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshdeskConfiguration-dialog .error-list{font-size:13px}md-dialog.freshdeskConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshdeskConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.freshdeskConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.freshdeskConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshdeskConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.freshdeskAccount-item-dialog{max-width:720px;width:720px}md-dialog.freshdeskAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.freshdeskAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.freshdeskAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.freshdeskAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshdeskAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshdeskAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshdeskAccount-item-dialog .error-list{font-size:13px}md-dialog.freshdeskAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshdeskAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.freshdeskAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.freshdeskAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshdeskAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-freshdeskAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-freshdeskAccount .header .goto-freshdeskAccounts-button{margin-right:16px}#integrations-freshdeskAccount .header .freshdeskAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-freshdeskAccount .header .freshdeskAccount-image img{height:100%;width:auto;max-width:none}#integrations-freshdeskAccount .header .subtitle{margin:6px 0 0 0}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container .handle{cursor:move}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader{position:relative}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader.dropping .drop-text{display:flex}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .freshdeskAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .freshdeskAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-freshdeskAccount .freshdeskAccount-detail-form-container #freshdeskAccount-image-uploader .freshdeskAccount-image .media{max-height:100%}#integrations-freshdeskAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-freshdeskAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-freshdeskAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-freshdeskAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#freshdeskAccounts{position:relative}#freshdeskAccounts>.header{height:76px;min-height:76px;max-height:76px}#freshdeskAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#freshdeskAccounts>.header .logo .logo-text{font-size:24px}#freshdeskAccounts>.header md-icon{color:#fff}#freshdeskAccounts>.header .search-input-wrapper{position:relative}#freshdeskAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#freshdeskAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#freshdeskAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#freshdeskAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#freshdeskAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#freshdeskAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#freshdeskAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#freshdeskAccounts>.header.selected-bar .close-button-wrapper{width:244px}#freshdeskAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#freshdeskAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#freshdeskAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#freshdeskAccounts #add-freshdeskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#freshdeskAccounts #upload-freshdeskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.freshsalesAccount-dialog{max-width:720px;width:720px}md-dialog.freshsalesAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.freshsalesAccount-dialog md-toolbar .title{font-size:17px}md-dialog.freshsalesAccount-dialog md-input-container textarea{min-height:150px}md-dialog.freshsalesAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshsalesAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshsalesAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshsalesAccount-dialog .error-list{font-size:13px}md-dialog.freshsalesAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshsalesAccount-dialog .error-list .error .message{font-weight:500}md-dialog.freshsalesAccount-dialog .error-list .error .md-button{margin:0}md-dialog.freshsalesAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshsalesAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.freshsalesConfiguration-dialog{max-width:720px;width:720px}md-dialog.freshsalesConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.freshsalesConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.freshsalesConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.freshsalesConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshsalesConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshsalesConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshsalesConfiguration-dialog .error-list{font-size:13px}md-dialog.freshsalesConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshsalesConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.freshsalesConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.freshsalesConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshsalesConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.freshsalesAccount-item-dialog{max-width:720px;width:720px}md-dialog.freshsalesAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.freshsalesAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.freshsalesAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.freshsalesAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.freshsalesAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.freshsalesAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.freshsalesAccount-item-dialog .error-list{font-size:13px}md-dialog.freshsalesAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.freshsalesAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.freshsalesAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.freshsalesAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.freshsalesAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-freshsalesAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-freshsalesAccount .header .goto-freshsalesAccounts-button{margin-right:16px}#integrations-freshsalesAccount .header .freshsalesAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-freshsalesAccount .header .freshsalesAccount-image img{height:100%;width:auto;max-width:none}#integrations-freshsalesAccount .header .subtitle{margin:6px 0 0 0}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container .handle{cursor:move}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader{position:relative}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader.dropping .drop-text{display:flex}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .freshsalesAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .freshsalesAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-freshsalesAccount .freshsalesAccount-detail-form-container #freshsalesAccount-image-uploader .freshsalesAccount-image .media{max-height:100%}#integrations-freshsalesAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-freshsalesAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-freshsalesAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-freshsalesAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#freshsalesAccounts{position:relative}#freshsalesAccounts>.header{height:76px;min-height:76px;max-height:76px}#freshsalesAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#freshsalesAccounts>.header .logo .logo-text{font-size:24px}#freshsalesAccounts>.header md-icon{color:#fff}#freshsalesAccounts>.header .search-input-wrapper{position:relative}#freshsalesAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#freshsalesAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#freshsalesAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#freshsalesAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#freshsalesAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#freshsalesAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#freshsalesAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#freshsalesAccounts>.header.selected-bar .close-button-wrapper{width:244px}#freshsalesAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#freshsalesAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#freshsalesAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#freshsalesAccounts #add-freshsalesAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#freshsalesAccounts #upload-freshsalesAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.salesforceAccount-dialog{max-width:720px;width:720px}md-dialog.salesforceAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.salesforceAccount-dialog md-toolbar .title{font-size:17px}md-dialog.salesforceAccount-dialog md-input-container textarea{min-height:150px}md-dialog.salesforceAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.salesforceAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.salesforceAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.salesforceAccount-dialog .error-list{font-size:13px}md-dialog.salesforceAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.salesforceAccount-dialog .error-list .error .message{font-weight:500}md-dialog.salesforceAccount-dialog .error-list .error .md-button{margin:0}md-dialog.salesforceAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.salesforceAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.salesforceConfiguration-dialog{max-width:720px;width:720px}md-dialog.salesforceConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.salesforceConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.salesforceConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.salesforceConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.salesforceConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.salesforceConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.salesforceConfiguration-dialog .error-list{font-size:13px}md-dialog.salesforceConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.salesforceConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.salesforceConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.salesforceConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.salesforceConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.salesforceAccount-item-dialog{max-width:720px;width:720px}md-dialog.salesforceAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.salesforceAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.salesforceAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.salesforceAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.salesforceAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.salesforceAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.salesforceAccount-item-dialog .error-list{font-size:13px}md-dialog.salesforceAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.salesforceAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.salesforceAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.salesforceAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.salesforceAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-salesforceAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-salesforceAccount .header .goto-salesforceAccounts-button{margin-right:16px}#integrations-salesforceAccount .header .salesforceAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-salesforceAccount .header .salesforceAccount-image img{height:100%;width:auto;max-width:none}#integrations-salesforceAccount .header .subtitle{margin:6px 0 0 0}#integrations-salesforceAccount .salesforceAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-salesforceAccount .salesforceAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-salesforceAccount .salesforceAccount-detail-form-container .handle{cursor:move}#integrations-salesforceAccount .salesforceAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader{position:relative}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader.dropping .drop-text{display:flex}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .salesforceAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .salesforceAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-salesforceAccount .salesforceAccount-detail-form-container #salesforceAccount-image-uploader .salesforceAccount-image .media{max-height:100%}#integrations-salesforceAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-salesforceAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-salesforceAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-salesforceAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#salesforceAccounts{position:relative}#salesforceAccounts>.header{height:76px;min-height:76px;max-height:76px}#salesforceAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#salesforceAccounts>.header .logo .logo-text{font-size:24px}#salesforceAccounts>.header md-icon{color:#fff}#salesforceAccounts>.header .search-input-wrapper{position:relative}#salesforceAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#salesforceAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#salesforceAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#salesforceAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#salesforceAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#salesforceAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#salesforceAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#salesforceAccounts>.header.selected-bar .close-button-wrapper{width:244px}#salesforceAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#salesforceAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#salesforceAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#salesforceAccounts #add-salesforceAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#salesforceAccounts #upload-salesforceAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.servicenowAccount-dialog{max-width:720px;width:720px}md-dialog.servicenowAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.servicenowAccount-dialog md-toolbar .title{font-size:17px}md-dialog.servicenowAccount-dialog md-input-container textarea{min-height:150px}md-dialog.servicenowAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.servicenowAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.servicenowAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.servicenowAccount-dialog .error-list{font-size:13px}md-dialog.servicenowAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.servicenowAccount-dialog .error-list .error .message{font-weight:500}md-dialog.servicenowAccount-dialog .error-list .error .md-button{margin:0}md-dialog.servicenowAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.servicenowAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.servicenowConfiguration-dialog{max-width:720px;width:720px}md-dialog.servicenowConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.servicenowConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.servicenowConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.servicenowConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.servicenowConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.servicenowConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.servicenowConfiguration-dialog .error-list{font-size:13px}md-dialog.servicenowConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.servicenowConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.servicenowConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.servicenowConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.servicenowConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.servicenowAccount-item-dialog{max-width:720px;width:720px}md-dialog.servicenowAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.servicenowAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.servicenowAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.servicenowAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.servicenowAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.servicenowAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.servicenowAccount-item-dialog .error-list{font-size:13px}md-dialog.servicenowAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.servicenowAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.servicenowAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.servicenowAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.servicenowAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-servicenowAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-servicenowAccount .header .goto-servicenowAccounts-button{margin-right:16px}#integrations-servicenowAccount .header .servicenowAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-servicenowAccount .header .servicenowAccount-image img{height:100%;width:auto;max-width:none}#integrations-servicenowAccount .header .subtitle{margin:6px 0 0 0}#integrations-servicenowAccount .servicenowAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-servicenowAccount .servicenowAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-servicenowAccount .servicenowAccount-detail-form-container .handle{cursor:move}#integrations-servicenowAccount .servicenowAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader{position:relative}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader.dropping .drop-text{display:flex}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .servicenowAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .servicenowAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-servicenowAccount .servicenowAccount-detail-form-container #servicenowAccount-image-uploader .servicenowAccount-image .media{max-height:100%}#integrations-servicenowAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-servicenowAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-servicenowAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-servicenowAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#servicenowAccounts{position:relative}#servicenowAccounts>.header{height:76px;min-height:76px;max-height:76px}#servicenowAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#servicenowAccounts>.header .logo .logo-text{font-size:24px}#servicenowAccounts>.header md-icon{color:#fff}#servicenowAccounts>.header .search-input-wrapper{position:relative}#servicenowAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#servicenowAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#servicenowAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#servicenowAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#servicenowAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#servicenowAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#servicenowAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#servicenowAccounts>.header.selected-bar .close-button-wrapper{width:244px}#servicenowAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#servicenowAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#servicenowAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#servicenowAccounts #add-servicenowAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#servicenowAccounts #upload-servicenowAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.sugarcrmAccount-dialog{max-width:720px;width:720px}md-dialog.sugarcrmAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.sugarcrmAccount-dialog md-toolbar .title{font-size:17px}md-dialog.sugarcrmAccount-dialog md-input-container textarea{min-height:150px}md-dialog.sugarcrmAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.sugarcrmAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.sugarcrmAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.sugarcrmAccount-dialog .error-list{font-size:13px}md-dialog.sugarcrmAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.sugarcrmAccount-dialog .error-list .error .message{font-weight:500}md-dialog.sugarcrmAccount-dialog .error-list .error .md-button{margin:0}md-dialog.sugarcrmAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.sugarcrmAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.sugarcrmConfiguration-dialog{max-width:720px;width:720px}md-dialog.sugarcrmConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.sugarcrmConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.sugarcrmConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.sugarcrmConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.sugarcrmConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.sugarcrmConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.sugarcrmConfiguration-dialog .error-list{font-size:13px}md-dialog.sugarcrmConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.sugarcrmConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.sugarcrmConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.sugarcrmConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.sugarcrmConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.sugarcrmAccount-item-dialog{max-width:720px;width:720px}md-dialog.sugarcrmAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.sugarcrmAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.sugarcrmAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.sugarcrmAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.sugarcrmAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.sugarcrmAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.sugarcrmAccount-item-dialog .error-list{font-size:13px}md-dialog.sugarcrmAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.sugarcrmAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.sugarcrmAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.sugarcrmAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.sugarcrmAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-sugarcrmAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-sugarcrmAccount .header .goto-sugarcrmAccounts-button{margin-right:16px}#integrations-sugarcrmAccount .header .sugarcrmAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-sugarcrmAccount .header .sugarcrmAccount-image img{height:100%;width:auto;max-width:none}#integrations-sugarcrmAccount .header .subtitle{margin:6px 0 0 0}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container .handle{cursor:move}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader{position:relative}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader.dropping .drop-text{display:flex}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .sugarcrmAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .sugarcrmAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-sugarcrmAccount .sugarcrmAccount-detail-form-container #sugarcrmAccount-image-uploader .sugarcrmAccount-image .media{max-height:100%}#integrations-sugarcrmAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-sugarcrmAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-sugarcrmAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-sugarcrmAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#sugarcrmAccounts{position:relative}#sugarcrmAccounts>.header{height:76px;min-height:76px;max-height:76px}#sugarcrmAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#sugarcrmAccounts>.header .logo .logo-text{font-size:24px}#sugarcrmAccounts>.header md-icon{color:#fff}#sugarcrmAccounts>.header .search-input-wrapper{position:relative}#sugarcrmAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#sugarcrmAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#sugarcrmAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#sugarcrmAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#sugarcrmAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#sugarcrmAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#sugarcrmAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#sugarcrmAccounts>.header.selected-bar .close-button-wrapper{width:244px}#sugarcrmAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#sugarcrmAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#sugarcrmAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#sugarcrmAccounts #add-sugarcrmAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#sugarcrmAccounts #upload-sugarcrmAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.vtigerAccount-dialog{max-width:720px;width:720px}md-dialog.vtigerAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.vtigerAccount-dialog md-toolbar .title{font-size:17px}md-dialog.vtigerAccount-dialog md-input-container textarea{min-height:150px}md-dialog.vtigerAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.vtigerAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.vtigerAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.vtigerAccount-dialog .error-list{font-size:13px}md-dialog.vtigerAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.vtigerAccount-dialog .error-list .error .message{font-weight:500}md-dialog.vtigerAccount-dialog .error-list .error .md-button{margin:0}md-dialog.vtigerAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.vtigerAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.vtigerConfiguration-dialog{max-width:720px;width:720px}md-dialog.vtigerConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.vtigerConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.vtigerConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.vtigerConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.vtigerConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.vtigerConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.vtigerConfiguration-dialog .error-list{font-size:13px}md-dialog.vtigerConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.vtigerConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.vtigerConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.vtigerConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.vtigerConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.vtigerAccount-item-dialog{max-width:720px;width:720px}md-dialog.vtigerAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.vtigerAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.vtigerAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.vtigerAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.vtigerAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.vtigerAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.vtigerAccount-item-dialog .error-list{font-size:13px}md-dialog.vtigerAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.vtigerAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.vtigerAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.vtigerAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.vtigerAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-vtigerAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-vtigerAccount .header .goto-vtigerAccounts-button{margin-right:16px}#integrations-vtigerAccount .header .vtigerAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-vtigerAccount .header .vtigerAccount-image img{height:100%;width:auto;max-width:none}#integrations-vtigerAccount .header .subtitle{margin:6px 0 0 0}#integrations-vtigerAccount .vtigerAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-vtigerAccount .vtigerAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-vtigerAccount .vtigerAccount-detail-form-container .handle{cursor:move}#integrations-vtigerAccount .vtigerAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader{position:relative}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader.dropping .drop-text{display:flex}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .vtigerAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .vtigerAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-vtigerAccount .vtigerAccount-detail-form-container #vtigerAccount-image-uploader .vtigerAccount-image .media{max-height:100%}#integrations-vtigerAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-vtigerAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-vtigerAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-vtigerAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#vtigerAccounts{position:relative}#vtigerAccounts>.header{height:76px;min-height:76px;max-height:76px}#vtigerAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#vtigerAccounts>.header .logo .logo-text{font-size:24px}#vtigerAccounts>.header md-icon{color:#fff}#vtigerAccounts>.header .search-input-wrapper{position:relative}#vtigerAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#vtigerAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#vtigerAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#vtigerAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#vtigerAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#vtigerAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#vtigerAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#vtigerAccounts>.header.selected-bar .close-button-wrapper{width:244px}#vtigerAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#vtigerAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#vtigerAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#vtigerAccounts #add-vtigerAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#vtigerAccounts #upload-vtigerAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.zendeskAccount-dialog{max-width:720px;width:720px}md-dialog.zendeskAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.zendeskAccount-dialog md-toolbar .title{font-size:17px}md-dialog.zendeskAccount-dialog md-input-container textarea{min-height:150px}md-dialog.zendeskAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zendeskAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zendeskAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.zendeskAccount-dialog .error-list{font-size:13px}md-dialog.zendeskAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zendeskAccount-dialog .error-list .error .message{font-weight:500}md-dialog.zendeskAccount-dialog .error-list .error .md-button{margin:0}md-dialog.zendeskAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zendeskAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.zendeskAccount-item-dialog{max-width:720px;width:720px}md-dialog.zendeskAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.zendeskAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.zendeskAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.zendeskAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zendeskAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zendeskAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.zendeskAccount-item-dialog .error-list{font-size:13px}md-dialog.zendeskAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zendeskAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.zendeskAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.zendeskAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zendeskAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-zendeskAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-zendeskAccount .header .goto-zendeskAccounts-button{margin-right:16px}#integrations-zendeskAccount .header .zendeskAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-zendeskAccount .header .zendeskAccount-image img{height:100%;width:auto;max-width:none}#integrations-zendeskAccount .header .subtitle{margin:6px 0 0 0}#integrations-zendeskAccount .zendeskAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-zendeskAccount .zendeskAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-zendeskAccount .zendeskAccount-detail-form-container .handle{cursor:move}#integrations-zendeskAccount .zendeskAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader{position:relative}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader.dropping .drop-text{display:flex}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .zendeskAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .zendeskAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-zendeskAccount .zendeskAccount-detail-form-container #zendeskAccount-image-uploader .zendeskAccount-image .media{max-height:100%}#integrations-zendeskAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-zendeskAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-zendeskAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-zendeskAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.zendeskConfiguration-dialog{max-width:720px;width:720px}md-dialog.zendeskConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.zendeskConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.zendeskConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.zendeskConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zendeskConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zendeskConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.zendeskConfiguration-dialog .error-list{font-size:13px}md-dialog.zendeskConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zendeskConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.zendeskConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.zendeskConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zendeskConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#zendeskAccounts{position:relative}#zendeskAccounts>.header{height:76px;min-height:76px;max-height:76px}#zendeskAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#zendeskAccounts>.header .logo .logo-text{font-size:24px}#zendeskAccounts>.header md-icon{color:#fff}#zendeskAccounts>.header .search-input-wrapper{position:relative}#zendeskAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#zendeskAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#zendeskAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#zendeskAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#zendeskAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#zendeskAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#zendeskAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#zendeskAccounts>.header.selected-bar .close-button-wrapper{width:244px}#zendeskAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#zendeskAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#zendeskAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#zendeskAccounts #add-zendeskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#zendeskAccounts #upload-zendeskAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.zohoAccount-dialog{max-width:720px;width:720px}md-dialog.zohoAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.zohoAccount-dialog md-toolbar .title{font-size:17px}md-dialog.zohoAccount-dialog md-input-container textarea{min-height:150px}md-dialog.zohoAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zohoAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zohoAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.zohoAccount-dialog .error-list{font-size:13px}md-dialog.zohoAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zohoAccount-dialog .error-list .error .message{font-weight:500}md-dialog.zohoAccount-dialog .error-list .error .md-button{margin:0}md-dialog.zohoAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zohoAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.zohoConfiguration-dialog{max-width:720px;width:720px}md-dialog.zohoConfiguration-dialog md-dialog-content{display:block;position:relative}md-dialog.zohoConfiguration-dialog md-toolbar .title{font-size:17px}md-dialog.zohoConfiguration-dialog md-input-container textarea{min-height:150px}md-dialog.zohoConfiguration-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zohoConfiguration-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zohoConfiguration-dialog .date-container{padding:16px 0 24px 0}md-dialog.zohoConfiguration-dialog .error-list{font-size:13px}md-dialog.zohoConfiguration-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zohoConfiguration-dialog .error-list .error .message{font-weight:500}md-dialog.zohoConfiguration-dialog .error-list .error .md-button{margin:0}md-dialog.zohoConfiguration-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zohoConfiguration-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.zohoAccount-item-dialog{max-width:720px;width:720px}md-dialog.zohoAccount-item-dialog md-dialog-content{display:block;position:relative}md-dialog.zohoAccount-item-dialog md-toolbar .title{font-size:17px}md-dialog.zohoAccount-item-dialog md-input-container textarea{min-height:150px}md-dialog.zohoAccount-item-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.zohoAccount-item-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.zohoAccount-item-dialog .date-container{padding:16px 0 24px 0}md-dialog.zohoAccount-item-dialog .error-list{font-size:13px}md-dialog.zohoAccount-item-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.zohoAccount-item-dialog .error-list .error .message{font-weight:500}md-dialog.zohoAccount-item-dialog .error-list .error .md-button{margin:0}md-dialog.zohoAccount-item-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.zohoAccount-item-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#integrations-zohoAccount .header{height:76px;min-height:76px;max-height:76px}#integrations-zohoAccount .header .goto-zohoAccounts-button{margin-right:16px}#integrations-zohoAccount .header .zohoAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#integrations-zohoAccount .header .zohoAccount-image img{height:100%;width:auto;max-width:none}#integrations-zohoAccount .header .subtitle{margin:6px 0 0 0}#integrations-zohoAccount .zohoAccount-detail-form-container{padding:24px;margin-bottom:24px}#integrations-zohoAccount .zohoAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#integrations-zohoAccount .zohoAccount-detail-form-container .handle{cursor:move}#integrations-zohoAccount .zohoAccount-detail-form-container md-input-container md-switch{margin:0!important}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader{position:relative}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader.dropping .drop-text{display:flex}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .upload-button{margin-bottom:16px}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .zohoAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .zohoAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#integrations-zohoAccount .zohoAccount-detail-form-container #zohoAccount-image-uploader .zohoAccount-image .media{max-height:100%}#integrations-zohoAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#integrations-zohoAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#integrations-zohoAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#integrations-zohoAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}#zohoAccounts{position:relative}#zohoAccounts>.header{height:76px;min-height:76px;max-height:76px}#zohoAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#zohoAccounts>.header .logo .logo-text{font-size:24px}#zohoAccounts>.header md-icon{color:#fff}#zohoAccounts>.header .search-input-wrapper{position:relative}#zohoAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#zohoAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#zohoAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#zohoAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#zohoAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#zohoAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#zohoAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#zohoAccounts>.header.selected-bar .close-button-wrapper{width:244px}#zohoAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#zohoAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#zohoAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#zohoAccounts #add-zohoAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#zohoAccounts #upload-zohoAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.project-dialog{max-width:720px;width:720px}md-dialog.project-dialog md-dialog-content{display:block;position:relative}md-dialog.project-dialog md-toolbar .title{font-size:17px}md-dialog.project-dialog md-input-container textarea{min-height:150px}md-dialog.project-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.project-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.project-dialog .date-container{padding:16px 0 24px 0}md-dialog.project-dialog .error-list{font-size:13px}md-dialog.project-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.project-dialog .error-list .error .message{font-weight:500}md-dialog.project-dialog .error-list .error .md-button{margin:0}md-dialog.project-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.project-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.session-dialog{max-width:720px;width:720px}md-dialog.session-dialog md-dialog-content{display:block;position:relative}md-dialog.session-dialog md-toolbar .title{font-size:17px}md-dialog.session-dialog md-input-container textarea{min-height:150px}md-dialog.session-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.session-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.session-dialog .date-container{padding:16px 0 24px 0}md-dialog.session-dialog .error-list{font-size:13px}md-dialog.session-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.session-dialog .error-list .error .message{font-weight:500}md-dialog.session-dialog .error-list .error .md-button{margin:0}md-dialog.session-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.session-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#jscripty-project .header{height:76px;min-height:76px;max-height:76px}#jscripty-project .header .goto-projects-button{margin-right:16px}#jscripty-project .header .project-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#jscripty-project .header .project-image img{height:100%;width:auto;max-width:none}#jscripty-project .header .subtitle{margin:6px 0 0 0}#jscripty-project .project-detail-form-container{padding:24px;margin-bottom:24px}#jscripty-project .project-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#jscripty-project .project-detail-form-container .handle{cursor:move}#jscripty-project .project-detail-form-container md-input-container md-switch{margin:0!important}#jscripty-project .project-detail-form-container #project-image-uploader{position:relative}#jscripty-project .project-detail-form-container #project-image-uploader.dropping .drop-text{display:flex}#jscripty-project .project-detail-form-container #project-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#jscripty-project .project-detail-form-container #project-image-uploader .upload-button{margin-bottom:16px}#jscripty-project .project-detail-form-container #project-image-uploader .project-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#jscripty-project .project-detail-form-container #project-image-uploader .project-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#jscripty-project .project-detail-form-container #project-image-uploader .project-image .media{max-height:100%}#jscripty-project md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#jscripty-project md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#jscripty-project md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#jscripty-project md-table-container.font-size-12 td.md-cell{font-size:12px!important}#projects{position:relative}#projects>.header{height:76px;min-height:76px;max-height:76px}#projects>.header .logo .logo-icon{margin:0 16px 0 0}#projects>.header .logo .logo-text{font-size:24px}#projects>.header md-icon{color:#fff}#projects>.header .search-input-wrapper{position:relative}#projects>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#projects>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#projects>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#projects>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#projects>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#projects>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#projects>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#projects>.header.selected-bar .close-button-wrapper{width:244px}#projects>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#projects>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#projects>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#projects #add-project-button{position:fixed;bottom:8px;right:8px;padding:0}#projects #upload-project-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mailAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailAccount-dialog{max-width:720px;width:720px}md-dialog.mailAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.mailAccount-dialog md-toolbar .title{font-size:17px}md-dialog.mailAccount-dialog md-input-container textarea{min-height:150px}md-dialog.mailAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailAccount-dialog .error-list{font-size:13px}md-dialog.mailAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailAccount-dialog .error-list .error .message{font-weight:500}md-dialog.mailAccount-dialog .error-list .error .md-button{margin:0}md-dialog.mailAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mailCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.mailCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.mailCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.mailCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.mailCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mailCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mailCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailCannedAnswer-dialog .error-list{font-size:13px}md-dialog.mailCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.mailCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.mailCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#mail-mailAccount .header{height:76px;min-height:76px;max-height:76px}#mail-mailAccount .header .goto-mailAccounts-button{margin-right:16px}#mail-mailAccount .header .mailAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#mail-mailAccount .header .mailAccount-image img{height:100%;width:auto;max-width:none}#mail-mailAccount .header .subtitle{margin:6px 0 0 0}#mail-mailAccount .mailAccount-detail-form-container{padding:24px;margin-bottom:24px}#mail-mailAccount .mailAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#mail-mailAccount .mailAccount-detail-form-container .handle{cursor:move}#mail-mailAccount .mailAccount-detail-form-container md-input-container md-switch{margin:0!important}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader{position:relative}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader.dropping .drop-text{display:flex}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .upload-button{margin-bottom:16px}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .mailAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .mailAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#mail-mailAccount .mailAccount-detail-form-container #mailAccount-image-uploader .mailAccount-image .media{max-height:100%}#mail-mailAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#mail-mailAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#mail-mailAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#mail-mailAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#mail-mailAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#mail-mailAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#mail-mailAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#mail-mailAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#mail-mailAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#mail-mailAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#mail-mailAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#mail-mailAccount .actionAppData{width:80px!important}}#mailAccounts{position:relative}#mailAccounts>.header{height:76px;min-height:76px;max-height:76px}#mailAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#mailAccounts>.header .logo .logo-text{font-size:24px}#mailAccounts>.header md-icon{color:#fff}#mailAccounts>.header .search-input-wrapper{position:relative}#mailAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#mailAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#mailAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#mailAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#mailAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#mailAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#mailAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#mailAccounts>.header.selected-bar .close-button-wrapper{width:244px}#mailAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#mailAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#mailAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#mailAccounts #add-mailAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#mailAccounts #upload-mailAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.mailQueue-dialog{max-width:720px;width:720px}md-dialog.mailQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.mailQueue-dialog md-toolbar .title{font-size:17px}md-dialog.mailQueue-dialog md-input-container textarea{min-height:150px}md-dialog.mailQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mailQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mailQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailQueue-dialog .error-list{font-size:13px}md-dialog.mailQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailQueue-dialog .error-list .error .message{font-weight:500}md-dialog.mailQueue-dialog .error-list .error .md-button{margin:0}md-dialog.mailQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#mail-mailQueue .header{height:76px;min-height:76px;max-height:76px}#mail-mailQueue .header .goto-mailQueues-button{margin-right:16px}#mail-mailQueue .header .mailQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#mail-mailQueue .header .mailQueue-image img{height:100%;width:auto;max-width:none}#mail-mailQueue .header .subtitle{margin:6px 0 0 0}#mail-mailQueue .mailQueue-detail-form-container{padding:24px;margin-bottom:24px}#mail-mailQueue .mailQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#mail-mailQueue .mailQueue-detail-form-container .handle{cursor:move}#mail-mailQueue .mailQueue-detail-form-container md-input-container md-switch{margin:0!important}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader{position:relative}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader.dropping .drop-text{display:flex}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .upload-button{margin-bottom:16px}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .mailQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .mailQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#mail-mailQueue .mailQueue-detail-form-container #mailQueue-image-uploader .mailQueue-image .media{max-height:100%}#mail-mailQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#mail-mailQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#mail-mailQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#mail-mailQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#mailQueues{position:relative}#mailQueues>.header{height:76px;min-height:76px;max-height:76px}#mailQueues>.header .logo .logo-icon{margin:0 16px 0 0}#mailQueues>.header .logo .logo-text{font-size:24px}#mailQueues>.header md-icon{color:#fff}#mailQueues>.header .search-input-wrapper{position:relative}#mailQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#mailQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#mailQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#mailQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#mailQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#mailQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#mailQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#mailQueues>.header.selected-bar .close-button-wrapper{width:244px}#mailQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#mailQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#mailQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#mailQueues #add-mailQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#mailQueues #upload-mailQueue-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.mailSubstatus-dialog{max-width:720px;width:720px}md-dialog.mailSubstatus-dialog md-dialog-content{display:block;position:relative}md-dialog.mailSubstatus-dialog md-toolbar .title{font-size:17px}md-dialog.mailSubstatus-dialog md-input-container textarea{min-height:150px}md-dialog.mailSubstatus-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mailSubstatus-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mailSubstatus-dialog .date-container{padding:16px 0 24px 0}md-dialog.mailSubstatus-dialog .error-list{font-size:13px}md-dialog.mailSubstatus-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mailSubstatus-dialog .error-list .error .message{font-weight:500}md-dialog.mailSubstatus-dialog .error-list .error .md-button{margin:0}md-dialog.mailSubstatus-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mailSubstatus-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#mailSubtatuses{position:relative}#mailSubtatuses>.header{height:76px;min-height:76px;max-height:76px}#mailSubtatuses>.header .logo .logo-icon{margin:0 16px 0 0}#mailSubtatuses>.header .logo .logo-text{font-size:24px}#mailSubtatuses>.header md-icon{color:#fff}#mailSubtatuses>.header .search-input-wrapper{position:relative}#mailSubtatuses>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#mailSubtatuses>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#mailSubtatuses>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#mailSubtatuses>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#mailSubtatuses>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#mailSubtatuses>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#mailSubtatuses>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#mailSubtatuses>.header.selected-bar .close-button-wrapper{width:244px}#mailSubtatuses>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#mailSubtatuses>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#mailSubtatuses>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#mailSubtatuses #add-mailSubstatus-button{position:fixed;bottom:8px;right:8px;padding:0}#mailSubtatuses #upload-mailSubstatus-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}md-dialog.plugin-dialog{max-width:720px;width:720px}md-dialog.plugin-dialog md-dialog-content{display:block;position:relative}md-dialog.plugin-dialog md-toolbar .title{font-size:17px}md-dialog.plugin-dialog md-input-container textarea{min-height:150px}md-dialog.plugin-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.plugin-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.plugin-dialog .date-container{padding:16px 0 24px 0}md-dialog.plugin-dialog .error-list{font-size:13px}md-dialog.plugin-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.plugin-dialog .error-list .error .message{font-weight:500}md-dialog.plugin-dialog .error-list .error .md-button{margin:0}md-dialog.plugin-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.plugin-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#marketplace-plugin .header{height:76px;min-height:76px;max-height:76px}#marketplace-plugin .header .goto-plugins-button{margin-right:16px}#marketplace-plugin .header .plugin-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#marketplace-plugin .header .plugin-image img{height:100%;width:auto;max-width:none}#marketplace-plugin .header .subtitle{margin:6px 0 0 0}#marketplace-plugin .plugin-detail-form-container{padding:24px;margin-bottom:24px}#marketplace-plugin .plugin-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#marketplace-plugin .plugin-detail-form-container .handle{cursor:move}#marketplace-plugin .plugin-detail-form-container md-input-container md-switch{margin:0!important}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader{position:relative}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader.dropping .drop-text{display:flex}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .upload-button{margin-bottom:16px}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .plugin-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .plugin-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#marketplace-plugin .plugin-detail-form-container #plugin-image-uploader .plugin-image .media{max-height:100%}#marketplace-plugin md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#marketplace-plugin md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#marketplace-plugin md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#marketplace-plugin md-table-container.font-size-12 td.md-cell{font-size:12px!important}#plugins{position:relative}#plugins>.header{height:76px;min-height:76px;max-height:76px}#plugins>.header .logo .logo-icon{margin:0 16px 0 0}#plugins>.header .logo .logo-text{font-size:24px}#plugins>.header md-icon{color:#fff}#plugins>.header .search-input-wrapper{position:relative}#plugins>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#plugins>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#plugins>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#plugins>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#plugins>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#plugins>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#plugins>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#plugins>.header.selected-bar .close-button-wrapper{width:244px}#plugins>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#plugins>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#plugins>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#plugins #add-plugin-button{position:fixed;bottom:8px;right:8px;padding:0}#plugins #upload-plugin-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.upload-dialog{max-width:720px;width:720px}md-dialog.upload-dialog md-dialog-content{display:block;position:relative}md-dialog.upload-dialog md-toolbar .title{font-size:17px}md-dialog.upload-dialog md-input-container textarea{min-height:150px}md-dialog.upload-dialog md-progress-linear{padding-top:16px!important}md-dialog.upload-dialog .date-container{padding:16px 0 24px 0}md-dialog.upload-dialog .error-list{font-size:13px}md-dialog.upload-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.upload-dialog .error-list .error .message{font-weight:500}md-dialog.upload-dialog .error-list .error .md-button{margin:0}md-dialog.upload-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.upload-dialog .plugin-image{overflow:hidden;max-width:148px;margin-right:16px;border:3px solid rgba(0,0,0,.12);padding:10px}md-dialog.upload-dialog .plugin-image img{width:auto;max-width:none}md-dialog.upload-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.ivrCampaign-dialog{max-width:720px;width:720px}md-dialog.ivrCampaign-dialog md-dialog-content{display:block;position:relative}md-dialog.ivrCampaign-dialog md-toolbar .title{font-size:17px}md-dialog.ivrCampaign-dialog md-input-container textarea{min-height:150px}md-dialog.ivrCampaign-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.ivrCampaign-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.ivrCampaign-dialog .date-container{padding:16px 0 24px 0}md-dialog.ivrCampaign-dialog .error-list{font-size:13px}md-dialog.ivrCampaign-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.ivrCampaign-dialog .error-list .error .message{font-weight:500}md-dialog.ivrCampaign-dialog .error-list .error .md-button{margin:0}md-dialog.ivrCampaign-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.ivrCampaign-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.hopper-dialog{max-width:720px;width:720px}md-dialog.hopper-dialog md-dialog-content{display:block;position:relative}md-dialog.hopper-dialog md-toolbar .title{font-size:17px}md-dialog.hopper-dialog md-input-container textarea{min-height:150px}md-dialog.hopper-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.hopper-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.hopper-dialog .date-container{padding:16px 0 24px 0}md-dialog.hopper-dialog .error-list{font-size:13px}md-dialog.hopper-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.hopper-dialog .error-list .error .message{font-weight:500}md-dialog.hopper-dialog .error-list .error .md-button{margin:0}md-dialog.hopper-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.hopper-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#motiondialer-ivrCampaign .header{height:76px;min-height:76px;max-height:76px}#motiondialer-ivrCampaign .header .goto-ivrCampaigns-button{margin-right:16px}#motiondialer-ivrCampaign .header .ivrCampaign-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#motiondialer-ivrCampaign .header .ivrCampaign-image img{height:100%;width:auto;max-width:none}#motiondialer-ivrCampaign .header .subtitle{margin:6px 0 0 0}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container{padding:24px;margin-bottom:24px}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container .handle{cursor:move}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container md-input-container md-switch{margin:0!important}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader{position:relative}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader.dropping .drop-text{display:flex}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .upload-button{margin-bottom:16px}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .ivrCampaign-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .ivrCampaign-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#motiondialer-ivrCampaign .ivrCampaign-detail-form-container #ivrCampaign-image-uploader .ivrCampaign-image .media{max-height:100%}#motiondialer-ivrCampaign md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#motiondialer-ivrCampaign md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#motiondialer-ivrCampaign md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#motiondialer-ivrCampaign md-table-container.font-size-12 td.md-cell{font-size:12px!important}#ivrCampaigns{position:relative}#ivrCampaigns>.header{height:76px;min-height:76px;max-height:76px}#ivrCampaigns>.header .logo .logo-icon{margin:0 16px 0 0}#ivrCampaigns>.header .logo .logo-text{font-size:24px}#ivrCampaigns>.header md-icon{color:#fff}#ivrCampaigns>.header .search-input-wrapper{position:relative}#ivrCampaigns>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#ivrCampaigns>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#ivrCampaigns>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#ivrCampaigns>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#ivrCampaigns>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#ivrCampaigns>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#ivrCampaigns>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#ivrCampaigns>.header.selected-bar .close-button-wrapper{width:244px}#ivrCampaigns>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#ivrCampaigns>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#ivrCampaigns>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#ivrCampaigns #add-ivrCampaign-button{position:fixed;bottom:8px;right:8px;padding:0}#ivrCampaigns #upload-ivrCampaign-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.queueCampaign-dialog{max-width:720px;width:720px}md-dialog.queueCampaign-dialog md-dialog-content{display:block;position:relative}md-dialog.queueCampaign-dialog md-toolbar .title{font-size:17px}md-dialog.queueCampaign-dialog md-input-container textarea{min-height:150px}md-dialog.queueCampaign-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.queueCampaign-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.queueCampaign-dialog .date-container{padding:16px 0 24px 0}md-dialog.queueCampaign-dialog .error-list{font-size:13px}md-dialog.queueCampaign-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.queueCampaign-dialog .error-list .error .message{font-weight:500}md-dialog.queueCampaign-dialog .error-list .error .md-button{margin:0}md-dialog.queueCampaign-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.queueCampaign-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.hopper-dialog{max-width:720px;width:720px}md-dialog.hopper-dialog md-dialog-content{display:block;position:relative}md-dialog.hopper-dialog md-toolbar .title{font-size:17px}md-dialog.hopper-dialog md-input-container textarea{min-height:150px}md-dialog.hopper-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.hopper-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.hopper-dialog .date-container{padding:16px 0 24px 0}md-dialog.hopper-dialog .error-list{font-size:13px}md-dialog.hopper-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.hopper-dialog .error-list .error .message{font-weight:500}md-dialog.hopper-dialog .error-list .error .md-button{margin:0}md-dialog.hopper-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.hopper-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#motiondialer-queueCampaign .header{height:76px;min-height:76px;max-height:76px}#motiondialer-queueCampaign .header .goto-queueCampaigns-button{margin-right:16px}#motiondialer-queueCampaign .header .queueCampaign-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#motiondialer-queueCampaign .header .queueCampaign-image img{height:100%;width:auto;max-width:none}#motiondialer-queueCampaign .header .subtitle{margin:6px 0 0 0}#motiondialer-queueCampaign .queueCampaign-detail-form-container{padding:24px;margin-bottom:24px}#motiondialer-queueCampaign .queueCampaign-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#motiondialer-queueCampaign .queueCampaign-detail-form-container .handle{cursor:move}#motiondialer-queueCampaign .queueCampaign-detail-form-container md-input-container md-switch{margin:0!important}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader{position:relative}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader.dropping .drop-text{display:flex}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .upload-button{margin-bottom:16px}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .queueCampaign-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .queueCampaign-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#motiondialer-queueCampaign .queueCampaign-detail-form-container #queueCampaign-image-uploader .queueCampaign-image .media{max-height:100%}#motiondialer-queueCampaign md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#motiondialer-queueCampaign md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#motiondialer-queueCampaign md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#motiondialer-queueCampaign md-table-container.font-size-12 td.md-cell{font-size:12px!important}#queueCampaigns{position:relative}#queueCampaigns>.header{height:76px;min-height:76px;max-height:76px}#queueCampaigns>.header .logo .logo-icon{margin:0 16px 0 0}#queueCampaigns>.header .logo .logo-text{font-size:24px}#queueCampaigns>.header md-icon{color:#fff}#queueCampaigns>.header .search-input-wrapper{position:relative}#queueCampaigns>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#queueCampaigns>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#queueCampaigns>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#queueCampaigns>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#queueCampaigns>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#queueCampaigns>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#queueCampaigns>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#queueCampaigns>.header.selected-bar .close-button-wrapper{width:244px}#queueCampaigns>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#queueCampaigns>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#queueCampaigns>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#queueCampaigns #add-queueCampaign-button{position:fixed;bottom:8px;right:8px;padding:0}#queueCampaigns #upload-queueCampaign-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.predictive-dialog{max-width:720px;width:720px}md-dialog.predictive-dialog md-dialog-content{display:block;position:relative}md-dialog.predictive-dialog md-toolbar .title{font-size:17px}md-dialog.predictive-dialog md-input-container textarea{min-height:150px}md-dialog.predictive-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.predictive-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.predictive-dialog .date-container{padding:16px 0 24px 0}md-dialog.predictive-dialog .error-list{font-size:13px}md-dialog.predictive-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.predictive-dialog .error-list .error .message{font-weight:500}md-dialog.predictive-dialog .error-list .error .md-button{margin:0}md-dialog.predictive-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.predictive-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.openchannelAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelAccount-dialog{max-width:720px;width:720px}md-dialog.openchannelAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelAccount-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelAccount-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelAccount-dialog .error-list{font-size:13px}md-dialog.openchannelAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelAccount-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelAccount-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.openchannelCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.openchannelCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.openchannelCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.openchannelCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelCannedAnswer-dialog .error-list{font-size:13px}md-dialog.openchannelCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#openchannel-openchannelAccount .header{height:76px;min-height:76px;max-height:76px}#openchannel-openchannelAccount .header .goto-openchannelAccounts-button{margin-right:16px}#openchannel-openchannelAccount .header .openchannelAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#openchannel-openchannelAccount .header .openchannelAccount-image img{height:100%;width:auto;max-width:none}#openchannel-openchannelAccount .header .subtitle{margin:6px 0 0 0}#openchannel-openchannelAccount .openchannelAccount-detail-form-container{padding:24px;margin-bottom:24px}#openchannel-openchannelAccount .openchannelAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#openchannel-openchannelAccount .openchannelAccount-detail-form-container .handle{cursor:move}#openchannel-openchannelAccount .openchannelAccount-detail-form-container md-input-container md-switch{margin:0!important}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader{position:relative}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader.dropping .drop-text{display:flex}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .upload-button{margin-bottom:16px}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .openchannelAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .openchannelAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#openchannel-openchannelAccount .openchannelAccount-detail-form-container #openchannelAccount-image-uploader .openchannelAccount-image .media{max-height:100%}#openchannel-openchannelAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#openchannel-openchannelAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#openchannel-openchannelAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#openchannel-openchannelAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#openchannel-openchannelAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#openchannel-openchannelAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#openchannel-openchannelAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#openchannel-openchannelAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#openchannel-openchannelAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#openchannel-openchannelAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#openchannel-openchannelAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#openchannel-openchannelAccount .actionAppData{width:80px!important}}#openchannelAccounts{position:relative}#openchannelAccounts>.header{height:76px;min-height:76px;max-height:76px}#openchannelAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#openchannelAccounts>.header .logo .logo-text{font-size:24px}#openchannelAccounts>.header md-icon{color:#fff}#openchannelAccounts>.header .search-input-wrapper{position:relative}#openchannelAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#openchannelAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#openchannelAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#openchannelAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#openchannelAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#openchannelAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#openchannelAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#openchannelAccounts>.header.selected-bar .close-button-wrapper{width:244px}#openchannelAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#openchannelAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#openchannelAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#openchannelAccounts #add-openchannelAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#openchannelAccounts #upload-openchannelAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.openchannelQueue-dialog{max-width:720px;width:720px}md-dialog.openchannelQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.openchannelQueue-dialog md-toolbar .title{font-size:17px}md-dialog.openchannelQueue-dialog md-input-container textarea{min-height:150px}md-dialog.openchannelQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.openchannelQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.openchannelQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.openchannelQueue-dialog .error-list{font-size:13px}md-dialog.openchannelQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.openchannelQueue-dialog .error-list .error .message{font-weight:500}md-dialog.openchannelQueue-dialog .error-list .error .md-button{margin:0}md-dialog.openchannelQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.openchannelQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#openchannel-openchannelQueue .header{height:76px;min-height:76px;max-height:76px}#openchannel-openchannelQueue .header .goto-openchannelQueues-button{margin-right:16px}#openchannel-openchannelQueue .header .openchannelQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#openchannel-openchannelQueue .header .openchannelQueue-image img{height:100%;width:auto;max-width:none}#openchannel-openchannelQueue .header .subtitle{margin:6px 0 0 0}#openchannel-openchannelQueue .openchannelQueue-detail-form-container{padding:24px;margin-bottom:24px}#openchannel-openchannelQueue .openchannelQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#openchannel-openchannelQueue .openchannelQueue-detail-form-container .handle{cursor:move}#openchannel-openchannelQueue .openchannelQueue-detail-form-container md-input-container md-switch{margin:0!important}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader{position:relative}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader.dropping .drop-text{display:flex}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .upload-button{margin-bottom:16px}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .openchannelQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .openchannelQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#openchannel-openchannelQueue .openchannelQueue-detail-form-container #openchannelQueue-image-uploader .openchannelQueue-image .media{max-height:100%}#openchannel-openchannelQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#openchannel-openchannelQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#openchannel-openchannelQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#openchannel-openchannelQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#openchannelQueues{position:relative}#openchannelQueues>.header{height:76px;min-height:76px;max-height:76px}#openchannelQueues>.header .logo .logo-icon{margin:0 16px 0 0}#openchannelQueues>.header .logo .logo-text{font-size:24px}#openchannelQueues>.header md-icon{color:#fff}#openchannelQueues>.header .search-input-wrapper{position:relative}#openchannelQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#openchannelQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#openchannelQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#openchannelQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#openchannelQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#openchannelQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#openchannelQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#openchannelQueues>.header.selected-bar .close-button-wrapper{width:244px}#openchannelQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#openchannelQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#openchannelQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#openchannelQueues #add-openchannelQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#openchannelQueues #upload-openchannelQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}#plugin .filter-header{background-image:url(/assets/images/backgrounds/header-bg.png);color:#fff}.quick-filter-container-custom md-select[multiple] md-select-value>:first-child{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}#cloudProviders{position:relative}#cloudProviders>.header{height:76px;min-height:76px;max-height:76px}#cloudProviders>.header .logo .logo-icon{margin:0 16px 0 0}#cloudProviders>.header .logo .logo-text{font-size:24px}#cloudProviders>.header md-icon{color:#fff}#cloudProviders>.header .search-input-wrapper{position:relative}#cloudProviders>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#cloudProviders>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#cloudProviders>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#cloudProviders>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#cloudProviders>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#cloudProviders>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#cloudProviders>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#cloudProviders>.header.selected-bar .close-button-wrapper{width:244px}#cloudProviders>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#cloudProviders>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#cloudProviders>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#cloudProviders #add-cloudProvider-button{position:fixed;bottom:8px;right:8px;padding:0}#cloudProviders #upload-cloudProvider-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.cloudProvider-dialog{max-width:720px;width:720px}md-dialog.cloudProvider-dialog md-dialog-content{display:block;position:relative}md-dialog.cloudProvider-dialog md-toolbar .title{font-size:17px}md-dialog.cloudProvider-dialog md-input-container textarea{min-height:150px}md-dialog.cloudProvider-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.cloudProvider-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.cloudProvider-dialog .date-container{padding:16px 0 24px 0}md-dialog.cloudProvider-dialog .error-list{font-size:13px}md-dialog.cloudProvider-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cloudProvider-dialog .error-list .error .message{font-weight:500}md-dialog.cloudProvider-dialog .error-list .error .md-button{margin:0}md-dialog.cloudProvider-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cloudProvider-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.customization-dialog{max-width:720px;width:720px}md-dialog.customization-dialog md-dialog-content{display:block;position:relative}md-dialog.customization-dialog md-toolbar .title{font-size:17px}md-dialog.customization-dialog md-input-container textarea{min-height:150px}md-dialog.customization-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.customization-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.customization-dialog .date-container{padding:16px 0 24px 0}md-dialog.customization-dialog .error-list{font-size:13px}md-dialog.customization-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.customization-dialog .error-list .error .message{font-weight:500}md-dialog.customization-dialog .error-list .error .md-button{margin:0}md-dialog.customization-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.customization-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#customizations{position:relative}#customizations>.header{height:76px;min-height:76px;max-height:76px}#customizations>.header .logo .logo-icon{margin:0 16px 0 0}#customizations>.header .logo .logo-text{font-size:24px}#customizations>.header md-icon{color:#fff}#customizations>.header .search-input-wrapper{position:relative}#customizations>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#customizations>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#customizations>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#customizations>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#customizations>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#customizations>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#customizations>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#customizations>.header.selected-bar .close-button-wrapper{width:244px}#customizations>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#customizations>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#customizations>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#customizations>.content .customization-detail-form-container{padding:24px;margin-bottom:24px}#customizations>.content .customization-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#customizations>.content .customization-detail-form-container .handle{cursor:move}#customizations>.content .customization-detail-form-container md-input-container md-switch{margin:0!important}#customizations>.content .customization-detail-form-container #customization-image-uploader{position:relative}#customizations>.content .customization-detail-form-container #customization-image-uploader.dropping .drop-text{display:flex}#customizations>.content .customization-detail-form-container #customization-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#customizations>.content .customization-detail-form-container #customization-image-uploader .upload-button{margin-bottom:16px}#customizations>.content .customization-detail-form-container #customization-image-uploader .customization-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#customizations>.content .customization-detail-form-container #customization-image-uploader .customization-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#customizations>.content .customization-detail-form-container #customization-image-uploader .customization-image .media{max-height:100%}#customizations #add-customization-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.general-dialog{max-width:720px;width:720px}md-dialog.general-dialog md-dialog-content{display:block;position:relative}md-dialog.general-dialog md-toolbar .title{font-size:17px}md-dialog.general-dialog md-input-container textarea{min-height:150px}md-dialog.general-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.general-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.general-dialog .date-container{padding:16px 0 24px 0}md-dialog.general-dialog .error-list{font-size:13px}md-dialog.general-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.general-dialog .error-list .error .message{font-weight:500}md-dialog.general-dialog .error-list .error .md-button{margin:0}md-dialog.general-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.general-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#generals{position:relative}#generals>.header{height:76px;min-height:76px;max-height:76px}#generals>.header .logo .logo-icon{margin:0 16px 0 0}#generals>.header .logo .logo-text{font-size:24px}#generals>.header md-icon{color:#fff}#generals>.header .search-input-wrapper{position:relative}#generals>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#generals>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#generals>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#generals>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#generals>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#generals>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#generals>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#generals>.header.selected-bar .close-button-wrapper{width:244px}#generals>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#generals>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#generals>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#generals>.content .general-detail-form-container{padding:24px;margin-bottom:24px}#generals>.content .general-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#generals>.content .general-detail-form-container .handle{cursor:move}#generals>.content .general-detail-form-container md-input-container md-switch{margin:0!important}#generals>.content .general-detail-form-container #general-image-uploader{position:relative}#generals>.content .general-detail-form-container #general-image-uploader.dropping .drop-text{display:flex}#generals>.content .general-detail-form-container #general-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#generals>.content .general-detail-form-container #general-image-uploader .upload-button{margin-bottom:16px}#generals>.content .general-detail-form-container #general-image-uploader .general-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#generals>.content .general-detail-form-container #general-image-uploader .general-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#generals>.content .general-detail-form-container #general-image-uploader .general-image .media{max-height:100%}#generals #add-general-button{position:fixed;bottom:8px;right:8px;padding:0}#license{position:relative}#license .blink{animation:blinker 2s linear infinite}#license>.header{height:76px;min-height:76px;max-height:76px}#license>.header .logo .logo-icon{margin:0 16px 0 0}#license>.header .logo .logo-text{font-size:24px}#license>.header md-icon{color:#fff}#license>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#license>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#license>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#license>.content .badge{position:absolute;top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-size:11px;font-weight:500;padding:6px 8px}md-dialog.request-dialog{max-width:720px;width:720px}md-dialog.request-dialog md-dialog-content{display:block;position:relative}md-dialog.request-dialog md-toolbar .title{font-size:17px}md-dialog.request-dialog md-input-container textarea{min-height:150px}md-dialog.request-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.request-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.request-dialog .date-container{padding:16px 0 24px 0}md-dialog.request-dialog .error-list{font-size:13px}md-dialog.request-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.request-dialog .error-list .error .message{font-weight:500}md-dialog.request-dialog .error-list .error .md-button{margin:0}md-dialog.request-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.request-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.update-dialog{max-width:720px;width:720px}md-dialog.update-dialog md-dialog-content{display:block;position:relative}md-dialog.update-dialog md-toolbar .title{font-size:17px}md-dialog.update-dialog md-input-container textarea{min-height:60px}md-dialog.update-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.update-dialog .error-list{font-size:13px}md-dialog.update-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.update-dialog .error-list .error .message{font-weight:500}md-dialog.update-dialog .error-list .error .md-button{margin:0}md-dialog.update-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.update-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.network-dialog{max-width:720px;width:720px}md-dialog.network-dialog md-dialog-content{display:block;position:relative}md-dialog.network-dialog md-toolbar .title{font-size:17px}md-dialog.network-dialog md-input-container textarea{min-height:150px}md-dialog.network-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.network-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.network-dialog .date-container{padding:16px 0 24px 0}md-dialog.network-dialog .error-list{font-size:13px}md-dialog.network-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.network-dialog .error-list .error .message{font-weight:500}md-dialog.network-dialog .error-list .error .md-button{margin:0}md-dialog.network-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.network-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#networks{position:relative}#networks>.header{height:76px;min-height:76px;max-height:76px}#networks>.header .logo .logo-icon{margin:0 16px 0 0}#networks>.header .logo .logo-text{font-size:24px}#networks>.header md-icon{color:#fff}#networks>.header .search-input-wrapper{position:relative}#networks>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#networks>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#networks>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#networks>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#networks>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#networks>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#networks>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#networks>.header.selected-bar .close-button-wrapper{width:244px}#networks>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#networks>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#networks>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#networks #add-network-button{position:fixed;bottom:8px;right:8px;padding:0}#networks #upload-network-button{position:fixed;bottom:8px;right:8px;padding:0}#smtps{position:relative}#smtps>.header{height:76px;min-height:76px;max-height:76px}#smtps>.header .logo .logo-icon{margin:0 16px 0 0}#smtps>.header .logo .logo-text{font-size:24px}#smtps>.header md-icon{color:#fff}#smtps>.header .search-input-wrapper{position:relative}#smtps>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#smtps>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#smtps>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#smtps>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#smtps>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#smtps>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#smtps>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#smtps>.header.selected-bar .close-button-wrapper{width:244px}#smtps>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#smtps>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#smtps>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#smtps>.content .smtp-detail-form-container{padding:24px;margin-bottom:24px}#smtps>.content .smtp-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#smtps>.content .smtp-detail-form-container .handle{cursor:move}#smtps>.content .smtp-detail-form-container md-input-container md-switch{margin:0!important}#smtps>.content .smtp-detail-form-container #smtp-image-uploader{position:relative}#smtps>.content .smtp-detail-form-container #smtp-image-uploader.dropping .drop-text{display:flex}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .upload-button{margin-bottom:16px}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .smtp-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .smtp-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#smtps>.content .smtp-detail-form-container #smtp-image-uploader .smtp-image .media{max-height:100%}#smtps #add-smtp-button{position:fixed;bottom:8px;right:8px;padding:0}#system>.header{height:76px;min-height:76px;max-height:76px}#system>.header .logo .logo-icon{margin:0 16px 0 0}#system>.header .logo .logo-text{font-size:24px}#system>.header md-icon{color:#fff}#system .system-detail-form-container{padding:24px;margin-bottom:24px}#system .system-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#system .system-detail-form-container .handle{cursor:move}#system .system-detail-form-container md-input-container md-switch{margin:0!important}#system .system-detail-form-container #system-image-uploader{position:relative}#system .system-detail-form-container #system-image-uploader.dropping .drop-text{display:flex}#system .system-detail-form-container #system-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#system .system-detail-form-container #system-image-uploader .upload-button{margin-bottom:16px}#system .system-detail-form-container #system-image-uploader .system-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#system .system-detail-form-container #system-image-uploader .system-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#system .system-detail-form-container #system-image-uploader .system-image .media{max-height:100%}#updates{position:relative}#updates>.header{height:76px;min-height:76px;max-height:76px}#updates>.header .logo .logo-icon{margin:0 16px 0 0}#updates>.header .logo .logo-text{font-size:24px}#updates>.header md-icon{color:#fff}#updates>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#updates>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#updates>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.smsAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsAccount-dialog{max-width:720px;width:720px}md-dialog.smsAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.smsAccount-dialog md-toolbar .title{font-size:17px}md-dialog.smsAccount-dialog md-input-container textarea{min-height:150px}md-dialog.smsAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsAccount-dialog .error-list{font-size:13px}md-dialog.smsAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsAccount-dialog .error-list .error .message{font-weight:500}md-dialog.smsAccount-dialog .error-list .error .md-button{margin:0}md-dialog.smsAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.smsCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.smsCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.smsCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.smsCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.smsCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.smsCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.smsCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsCannedAnswer-dialog .error-list{font-size:13px}md-dialog.smsCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.smsCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.smsCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#sms-smsAccount .header{height:76px;min-height:76px;max-height:76px}#sms-smsAccount .header .goto-smsAccounts-button{margin-right:16px}#sms-smsAccount .header .smsAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#sms-smsAccount .header .smsAccount-image img{height:100%;width:auto;max-width:none}#sms-smsAccount .header .subtitle{margin:6px 0 0 0}#sms-smsAccount .smsAccount-detail-form-container{padding:24px;margin-bottom:24px}#sms-smsAccount .smsAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#sms-smsAccount .smsAccount-detail-form-container .handle{cursor:move}#sms-smsAccount .smsAccount-detail-form-container md-input-container md-switch{margin:0!important}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader{position:relative}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader.dropping .drop-text{display:flex}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .upload-button{margin-bottom:16px}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .smsAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .smsAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#sms-smsAccount .smsAccount-detail-form-container #smsAccount-image-uploader .smsAccount-image .media{max-height:100%}#sms-smsAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#sms-smsAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#sms-smsAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#sms-smsAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#sms-smsAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#sms-smsAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#sms-smsAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#sms-smsAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#sms-smsAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#sms-smsAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#sms-smsAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#sms-smsAccount .actionAppData{width:80px!important}}#smsAccounts{position:relative}#smsAccounts>.header{height:76px;min-height:76px;max-height:76px}#smsAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#smsAccounts>.header .logo .logo-text{font-size:24px}#smsAccounts>.header md-icon{color:#fff}#smsAccounts>.header .search-input-wrapper{position:relative}#smsAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#smsAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#smsAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#smsAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#smsAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#smsAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#smsAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#smsAccounts>.header.selected-bar .close-button-wrapper{width:244px}#smsAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#smsAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#smsAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#smsAccounts #add-smsAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#smsAccounts #upload-smsAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.smsQueue-dialog{max-width:720px;width:720px}md-dialog.smsQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.smsQueue-dialog md-toolbar .title{font-size:17px}md-dialog.smsQueue-dialog md-input-container textarea{min-height:150px}md-dialog.smsQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.smsQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.smsQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.smsQueue-dialog .error-list{font-size:13px}md-dialog.smsQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.smsQueue-dialog .error-list .error .message{font-weight:500}md-dialog.smsQueue-dialog .error-list .error .md-button{margin:0}md-dialog.smsQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.smsQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#sms-smsQueue .header{height:76px;min-height:76px;max-height:76px}#sms-smsQueue .header .goto-smsQueues-button{margin-right:16px}#sms-smsQueue .header .smsQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#sms-smsQueue .header .smsQueue-image img{height:100%;width:auto;max-width:none}#sms-smsQueue .header .subtitle{margin:6px 0 0 0}#sms-smsQueue .smsQueue-detail-form-container{padding:24px;margin-bottom:24px}#sms-smsQueue .smsQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#sms-smsQueue .smsQueue-detail-form-container .handle{cursor:move}#sms-smsQueue .smsQueue-detail-form-container md-input-container md-switch{margin:0!important}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader{position:relative}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader.dropping .drop-text{display:flex}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .upload-button{margin-bottom:16px}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .smsQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .smsQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#sms-smsQueue .smsQueue-detail-form-container #smsQueue-image-uploader .smsQueue-image .media{max-height:100%}#sms-smsQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#sms-smsQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#sms-smsQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#sms-smsQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#smsQueues{position:relative}#smsQueues>.header{height:76px;min-height:76px;max-height:76px}#smsQueues>.header .logo .logo-icon{margin:0 16px 0 0}#smsQueues>.header .logo .logo-text{font-size:24px}#smsQueues>.header md-icon{color:#fff}#smsQueues>.header .search-input-wrapper{position:relative}#smsQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#smsQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#smsQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#smsQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#smsQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#smsQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#smsQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#smsQueues>.header.selected-bar .close-button-wrapper{width:244px}#smsQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#smsQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#smsQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#smsQueues #add-smsQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#smsQueues #upload-smsQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#agents{position:relative}#agents>.header{height:76px;min-height:76px;max-height:76px}#agents>.header .logo .logo-icon{margin:0 16px 0 0}#agents>.header .logo .logo-text{font-size:24px}#agents>.header md-icon{color:#fff}#agents>.header .search-input-wrapper{position:relative}#agents>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#agents>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#agents>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#agents>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#agents>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#agents>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#agents>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#agents>.header.selected-bar .close-button-wrapper{width:244px}#agents>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#agents>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#agents>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#agents #add-agent-button{position:fixed;bottom:8px;right:8px;padding:0}#agents #upload-agent-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.agent-dialog{max-width:720px;width:720px}md-dialog.agent-dialog md-dialog-content{display:block;position:relative}md-dialog.agent-dialog md-toolbar .title{font-size:17px}md-dialog.agent-dialog md-input-container textarea{min-height:150px}md-dialog.agent-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.agent-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.agent-dialog .date-container{padding:16px 0 24px 0}md-dialog.agent-dialog .error-list{font-size:13px}md-dialog.agent-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.agent-dialog .error-list .error .message{font-weight:500}md-dialog.agent-dialog .error-list .error .md-button{margin:0}md-dialog.agent-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.agent-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#staff-agent .header{height:76px;min-height:76px;max-height:76px}#staff-agent .header .goto-agents-button{margin-right:16px}#staff-agent .header .agent-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#staff-agent .header .agent-image img{height:100%;width:auto;max-width:none}#staff-agent .header .subtitle{margin:6px 0 0 0}#staff-agent .agent-detail-form-container{padding:24px;margin-bottom:24px}#staff-agent .agent-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#staff-agent .agent-detail-form-container .handle{cursor:move}#staff-agent .agent-detail-form-container md-input-container md-switch{margin:0!important}#staff-agent .agent-detail-form-container #agent-image-uploader{position:relative}#staff-agent .agent-detail-form-container #agent-image-uploader.dropping .drop-text{display:flex}#staff-agent .agent-detail-form-container #agent-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#staff-agent .agent-detail-form-container #agent-image-uploader .upload-button{margin-bottom:16px}#staff-agent .agent-detail-form-container #agent-image-uploader .agent-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#staff-agent .agent-detail-form-container #agent-image-uploader .agent-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#staff-agent .agent-detail-form-container #agent-image-uploader .agent-image .media{max-height:100%}#staff-agent md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#staff-agent md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#staff-agent md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#staff-agent md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.team-dialog{max-width:720px;width:720px}md-dialog.team-dialog md-dialog-content{display:block;position:relative}md-dialog.team-dialog md-toolbar .title{font-size:17px}md-dialog.team-dialog md-input-container textarea{min-height:150px}md-dialog.team-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.team-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.team-dialog .date-container{padding:16px 0 24px 0}md-dialog.team-dialog .error-list{font-size:13px}md-dialog.team-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.team-dialog .error-list .error .message{font-weight:500}md-dialog.team-dialog .error-list .error .md-button{margin:0}md-dialog.team-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.team-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#teams{position:relative}#teams>.header{height:76px;min-height:76px;max-height:76px}#teams>.header .logo .logo-icon{margin:0 16px 0 0}#teams>.header .logo .logo-text{font-size:24px}#teams>.header md-icon{color:#fff}#teams>.header .search-input-wrapper{position:relative}#teams>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#teams>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#teams>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#teams>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#teams>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#teams>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#teams>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#teams>.header.selected-bar .close-button-wrapper{width:244px}#teams>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#teams>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#teams>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#teams #add-team-button{position:fixed;bottom:8px;right:8px;padding:0}#teams #upload-team-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.telephone-dialog{max-width:720px;width:720px}md-dialog.telephone-dialog md-dialog-content{display:block;position:relative}md-dialog.telephone-dialog md-toolbar .title{font-size:17px}md-dialog.telephone-dialog md-input-container textarea{min-height:150px}md-dialog.telephone-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.telephone-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.telephone-dialog .date-container{padding:16px 0 24px 0}md-dialog.telephone-dialog .error-list{font-size:13px}md-dialog.telephone-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.telephone-dialog .error-list .error .message{font-weight:500}md-dialog.telephone-dialog .error-list .error .md-button{margin:0}md-dialog.telephone-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.telephone-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#staff-telephone .header{height:76px;min-height:76px;max-height:76px}#staff-telephone .header .goto-telephones-button{margin-right:16px}#staff-telephone .header .telephone-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#staff-telephone .header .telephone-image img{height:100%;width:auto;max-width:none}#staff-telephone .header .subtitle{margin:6px 0 0 0}#staff-telephone .telephone-detail-form-container{padding:24px;margin-bottom:24px}#staff-telephone .telephone-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#staff-telephone .telephone-detail-form-container .handle{cursor:move}#staff-telephone .telephone-detail-form-container md-input-container md-switch{margin:0!important}#staff-telephone .telephone-detail-form-container #telephone-image-uploader{position:relative}#staff-telephone .telephone-detail-form-container #telephone-image-uploader.dropping .drop-text{display:flex}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .upload-button{margin-bottom:16px}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .telephone-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .telephone-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#staff-telephone .telephone-detail-form-container #telephone-image-uploader .telephone-image .media{max-height:100%}#staff-telephone md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#staff-telephone md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#staff-telephone md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#staff-telephone md-table-container.font-size-12 td.md-cell{font-size:12px!important}#telephones{position:relative}#telephones>.header{height:76px;min-height:76px;max-height:76px}#telephones>.header .logo .logo-icon{margin:0 16px 0 0}#telephones>.header .logo .logo-text{font-size:24px}#telephones>.header md-icon{color:#fff}#telephones>.header .search-input-wrapper{position:relative}#telephones>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#telephones>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#telephones>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#telephones>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#telephones>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#telephones>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#telephones>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#telephones>.header.selected-bar .close-button-wrapper{width:244px}#telephones>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#telephones>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#telephones>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#telephones #add-telephone-button{position:fixed;bottom:8px;right:8px;padding:0}#telephones #upload-telephone-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.userProfile-dialog{max-width:720px;width:720px}md-dialog.userProfile-dialog md-dialog-content{display:block;position:relative}md-dialog.userProfile-dialog md-toolbar .title{font-size:17px}md-dialog.userProfile-dialog md-input-container textarea{min-height:150px}md-dialog.userProfile-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.userProfile-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.userProfile-dialog .date-container{padding:16px 0 24px 0}md-dialog.userProfile-dialog .error-list{font-size:13px}md-dialog.userProfile-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.userProfile-dialog .error-list .error .message{font-weight:500}md-dialog.userProfile-dialog .error-list .error .md-button{margin:0}md-dialog.userProfile-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.userProfile-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#staff-userProfile .header{height:76px;min-height:76px;max-height:76px}#staff-userProfile .header .goto-userProfiles-button{margin-right:16px}#staff-userProfile .header .userProfile-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#staff-userProfile .header .userProfile-image img{height:100%;width:auto;max-width:none}#staff-userProfile .header .subtitle{margin:6px 0 0 0}#staff-userProfile .userProfile-detail-form-container{padding:24px;margin-bottom:24px}#staff-userProfile .userProfile-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#staff-userProfile .userProfile-detail-form-container .handle{cursor:move}#staff-userProfile .userProfile-detail-form-container md-input-container md-switch{margin:0!important}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader{position:relative}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader.dropping .drop-text{display:flex}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .upload-button{margin-bottom:16px}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .userProfile-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .userProfile-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#staff-userProfile .userProfile-detail-form-container #userProfile-image-uploader .userProfile-image .media{max-height:100%}#staff-userProfile md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#staff-userProfile md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#staff-userProfile md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#staff-userProfile md-table-container.font-size-12 td.md-cell{font-size:12px!important}#userProfiles{position:relative}#userProfiles>.header{height:76px;min-height:76px;max-height:76px}#userProfiles>.header .logo .logo-icon{margin:0 16px 0 0}#userProfiles>.header .logo .logo-text{font-size:24px}#userProfiles>.header md-icon{color:#fff}#userProfiles>.header .search-input-wrapper{position:relative}#userProfiles>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#userProfiles>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#userProfiles>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#userProfiles>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#userProfiles>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#userProfiles>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#userProfiles>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#userProfiles>.header.selected-bar .close-button-wrapper{width:244px}#userProfiles>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#userProfiles>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#userProfiles>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#userProfiles #add-userProfile-button{position:fixed;bottom:8px;right:8px;padding:0}#userProfiles #upload-userProfile-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.user-dialog{max-width:720px;width:720px}md-dialog.user-dialog md-dialog-content{display:block;position:relative}md-dialog.user-dialog md-toolbar .title{font-size:17px}md-dialog.user-dialog md-input-container textarea{min-height:150px}md-dialog.user-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.user-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.user-dialog .date-container{padding:16px 0 24px 0}md-dialog.user-dialog .error-list{font-size:13px}md-dialog.user-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.user-dialog .error-list .error .message{font-weight:500}md-dialog.user-dialog .error-list .error .md-button{margin:0}md-dialog.user-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.user-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#staff-user .header{height:76px;min-height:76px;max-height:76px}#staff-user .header .goto-users-button{margin-right:16px}#staff-user .header .user-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#staff-user .header .user-image img{height:100%;width:auto;max-width:none}#staff-user .header .subtitle{margin:6px 0 0 0}#staff-user .user-detail-form-container{padding:24px;margin-bottom:24px}#staff-user .user-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#staff-user .user-detail-form-container .handle{cursor:move}#staff-user .user-detail-form-container md-input-container md-switch{margin:0!important}#staff-user .user-detail-form-container #user-image-uploader{position:relative}#staff-user .user-detail-form-container #user-image-uploader.dropping .drop-text{display:flex}#staff-user .user-detail-form-container #user-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#staff-user .user-detail-form-container #user-image-uploader .upload-button{margin-bottom:16px}#staff-user .user-detail-form-container #user-image-uploader .user-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#staff-user .user-detail-form-container #user-image-uploader .user-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#staff-user .user-detail-form-container #user-image-uploader .user-image .media{max-height:100%}#staff-user md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#staff-user md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#staff-user md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#staff-user md-table-container.font-size-12 td.md-cell{font-size:12px!important}#users{position:relative}#users>.header{height:76px;min-height:76px;max-height:76px}#users>.header .logo .logo-icon{margin:0 16px 0 0}#users>.header .logo .logo-text{font-size:24px}#users>.header md-icon{color:#fff}#users>.header .search-input-wrapper{position:relative}#users>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#users>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#users>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#users>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#users>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#users>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#users>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#users>.header.selected-bar .close-button-wrapper{width:244px}#users>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#users>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#users>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#users #add-user-button{position:fixed;bottom:8px;right:8px;padding:0}#users #upload-user-button{position:fixed;bottom:8px;right:8px;padding:0}#cannedAnswers{position:relative}#cannedAnswers>.header{height:76px;min-height:76px;max-height:76px}#cannedAnswers>.header .logo .logo-icon{margin:0 16px 0 0}#cannedAnswers>.header .logo .logo-text{font-size:24px}#cannedAnswers>.header md-icon{color:#fff}#cannedAnswers>.header .search-input-wrapper{position:relative}#cannedAnswers>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#cannedAnswers>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#cannedAnswers>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#cannedAnswers>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#cannedAnswers>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#cannedAnswers>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#cannedAnswers>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#cannedAnswers>.header.selected-bar .close-button-wrapper{width:244px}#cannedAnswers>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#cannedAnswers>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#cannedAnswers>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#cannedAnswers #add-cannedAnswer-button{position:fixed;bottom:8px;right:8px;padding:0}#cannedAnswers #upload-cannedAnswer-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.cannedAnswer-dialog{max-width:720px;width:720px}md-dialog.cannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.cannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.cannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.cannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.cannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.cannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.cannedAnswer-dialog .error-list{font-size:13px}md-dialog.cannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.cannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.cannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.cannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.cannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.customDashboard-dialog{max-width:720px;width:720px}md-dialog.customDashboard-dialog md-dialog-content{display:block;position:relative}md-dialog.customDashboard-dialog md-toolbar .title{font-size:17px}md-dialog.customDashboard-dialog md-input-container textarea{min-height:150px}md-dialog.customDashboard-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.customDashboard-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.customDashboard-dialog .date-container{padding:16px 0 24px 0}md-dialog.customDashboard-dialog .error-list{font-size:13px}md-dialog.customDashboard-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.customDashboard-dialog .error-list .error .message{font-weight:500}md-dialog.customDashboard-dialog .error-list .error .md-button{margin:0}md-dialog.customDashboard-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.customDashboard-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#customDashboards{position:relative}#customDashboards>.header{height:76px;min-height:76px;max-height:76px}#customDashboards>.header .logo .logo-icon{margin:0 16px 0 0}#customDashboards>.header .logo .logo-text{font-size:24px}#customDashboards>.header md-icon{color:#fff}#customDashboards>.header .search-input-wrapper{position:relative}#customDashboards>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#customDashboards>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#customDashboards>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#customDashboards>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#customDashboards>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#customDashboards>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#customDashboards>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#customDashboards>.header.selected-bar .close-button-wrapper{width:244px}#customDashboards>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#customDashboards>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#customDashboards>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#customDashboards #add-customDashboard-button{position:fixed;bottom:8px;right:8px;padding:0}#customDashboards #upload-customDashboard-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.dashboarditem-dialog{max-width:720px;width:720px}md-dialog.dashboarditem-dialog md-dialog-content{display:block;position:relative}md-dialog.dashboarditem-dialog md-toolbar .title{font-size:17px}md-dialog.dashboarditem-dialog md-input-container textarea{min-height:150px}md-dialog.dashboarditem-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.dashboarditem-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.dashboarditem-dialog .date-container{padding:16px 0 24px 0}md-dialog.dashboarditem-dialog .error-list{font-size:13px}md-dialog.dashboarditem-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.dashboarditem-dialog .error-list .error .message{font-weight:500}md-dialog.dashboarditem-dialog .error-list .error .md-button{margin:0}md-dialog.dashboarditem-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.dashboarditem-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tools-customDashboard .header{height:76px;min-height:76px;max-height:76px}#tools-customDashboard .header .goto-customDashboards-button{margin-right:16px}#tools-customDashboard .header .customDashboard-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#tools-customDashboard .header .customDashboard-image img{height:100%;width:auto;max-width:none}#tools-customDashboard .header .subtitle{margin:6px 0 0 0}#tools-customDashboard .customDashboard-detail-form-container{padding:24px;margin-bottom:24px}#tools-customDashboard .customDashboard-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#tools-customDashboard .customDashboard-detail-form-container .handle{cursor:move}#tools-customDashboard .customDashboard-detail-form-container md-input-container md-switch{margin:0!important}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader{position:relative}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader.dropping .drop-text{display:flex}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .upload-button{margin-bottom:16px}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .customDashboard-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .customDashboard-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#tools-customDashboard .customDashboard-detail-form-container #customDashboard-image-uploader .customDashboard-image .media{max-height:100%}#tools-customDashboard md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#tools-customDashboard md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#tools-customDashboard md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#tools-customDashboard md-table-container.font-size-12 td.md-cell{font-size:12px!important}md-dialog.disposition-dialog{max-width:720px;width:720px}md-dialog.disposition-dialog md-dialog-content{display:block;position:relative}md-dialog.disposition-dialog md-toolbar .title{font-size:17px}md-dialog.disposition-dialog md-input-container textarea{min-height:150px}md-dialog.disposition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.disposition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.disposition-dialog .date-container{padding:16px 0 24px 0}md-dialog.disposition-dialog .error-list{font-size:13px}md-dialog.disposition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.disposition-dialog .error-list .error .message{font-weight:500}md-dialog.disposition-dialog .error-list .error .md-button{margin:0}md-dialog.disposition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.disposition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#dispositions{position:relative}#dispositions>.header{height:76px;min-height:76px;max-height:76px}#dispositions>.header .logo .logo-icon{margin:0 16px 0 0}#dispositions>.header .logo .logo-text{font-size:24px}#dispositions>.header md-icon{color:#fff}#dispositions>.header .search-input-wrapper{position:relative}#dispositions>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#dispositions>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#dispositions>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#dispositions>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#dispositions>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#dispositions>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#dispositions>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#dispositions>.header.selected-bar .close-button-wrapper{width:244px}#dispositions>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#dispositions>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#dispositions>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#dispositions #add-disposition-button{position:fixed;bottom:8px;right:8px;padding:0}#dispositions #upload-disposition-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.interval-dialog{max-width:720px;width:720px}md-dialog.interval-dialog md-dialog-content{display:block;position:relative}md-dialog.interval-dialog md-toolbar .title{font-size:17px}md-dialog.interval-dialog md-input-container textarea{min-height:150px}md-dialog.interval-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.interval-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.interval-dialog .date-container{padding:16px 0 24px 0}md-dialog.interval-dialog .error-list{font-size:13px}md-dialog.interval-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.interval-dialog .error-list .error .message{font-weight:500}md-dialog.interval-dialog .error-list .error .md-button{margin:0}md-dialog.interval-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.interval-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.interval-dialog{max-width:720px;width:720px}md-dialog.interval-dialog md-dialog-content{display:block;position:relative}md-dialog.interval-dialog md-toolbar .title{font-size:17px}md-dialog.interval-dialog md-input-container textarea{min-height:150px}md-dialog.interval-dialog .date-container{padding:16px 0 24px 0}md-dialog.interval-dialog .error-list{font-size:13px}md-dialog.interval-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.interval-dialog .error-list .error .message{font-weight:500}md-dialog.interval-dialog .error-list .error .md-button{margin:0}md-dialog.interval-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.interval-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.interval-dialog{max-width:720px;width:720px}md-dialog.interval-dialog md-dialog-content{display:block;position:relative}md-dialog.interval-dialog md-toolbar .title{font-size:17px}md-dialog.interval-dialog md-input-container textarea{min-height:150px}md-dialog.interval-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.interval-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.interval-dialog .date-container{padding:16px 0 24px 0}md-dialog.interval-dialog .error-list{font-size:13px}md-dialog.interval-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.interval-dialog .error-list .error .message{font-weight:500}md-dialog.interval-dialog .error-list .error .md-button{margin:0}md-dialog.interval-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.interval-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tools-interval .header{height:76px;min-height:76px;max-height:76px}#tools-interval .header .goto-intervals-button{margin-right:16px}#tools-interval .header .interval-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#tools-interval .header .interval-image img{height:100%;width:auto;max-width:none}#tools-interval .header .subtitle{margin:6px 0 0 0}#tools-interval .interval-detail-form-container{padding:24px;margin-bottom:24px}#tools-interval .interval-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#tools-interval .interval-detail-form-container .handle{cursor:move}#tools-interval .interval-detail-form-container md-input-container md-switch{margin:0!important}#tools-interval .interval-detail-form-container #interval-image-uploader{position:relative}#tools-interval .interval-detail-form-container #interval-image-uploader.dropping .drop-text{display:flex}#tools-interval .interval-detail-form-container #interval-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#tools-interval .interval-detail-form-container #interval-image-uploader .upload-button{margin-bottom:16px}#tools-interval .interval-detail-form-container #interval-image-uploader .interval-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#tools-interval .interval-detail-form-container #interval-image-uploader .interval-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#tools-interval .interval-detail-form-container #interval-image-uploader .interval-image .media{max-height:100%}#tools-interval md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#tools-interval md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#tools-interval md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#tools-interval md-table-container.font-size-12 td.md-cell{font-size:12px!important}#intervals{position:relative}#intervals>.header{height:76px;min-height:76px;max-height:76px}#intervals>.header .logo .logo-icon{margin:0 16px 0 0}#intervals>.header .logo .logo-text{font-size:24px}#intervals>.header md-icon{color:#fff}#intervals>.header .search-input-wrapper{position:relative}#intervals>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#intervals>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#intervals>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#intervals>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#intervals>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#intervals>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#intervals>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#intervals>.header.selected-bar .close-button-wrapper{width:244px}#intervals>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#intervals>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#intervals>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#intervals #add-interval-button{position:fixed;bottom:8px;right:8px;padding:0}#intervals #upload-interval-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.pause-dialog{max-width:720px;width:720px}md-dialog.pause-dialog md-dialog-content{display:block;position:relative}md-dialog.pause-dialog md-toolbar .title{font-size:17px}md-dialog.pause-dialog md-input-container textarea{min-height:150px}md-dialog.pause-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.pause-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.pause-dialog .date-container{padding:16px 0 24px 0}md-dialog.pause-dialog .error-list{font-size:13px}md-dialog.pause-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.pause-dialog .error-list .error .message{font-weight:500}md-dialog.pause-dialog .error-list .error .md-button{margin:0}md-dialog.pause-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.pause-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#pauses{position:relative}#pauses>.header{height:76px;min-height:76px;max-height:76px}#pauses>.header .logo .logo-icon{margin:0 16px 0 0}#pauses>.header .logo .logo-text{font-size:24px}#pauses>.header md-icon{color:#fff}#pauses>.header .search-input-wrapper{position:relative}#pauses>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#pauses>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#pauses>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#pauses>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#pauses>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#pauses>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#pauses>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#pauses>.header.selected-bar .close-button-wrapper{width:244px}#pauses>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#pauses>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#pauses>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#pauses #add-pause-button{position:fixed;bottom:8px;right:8px;padding:0}#pauses #upload-pause-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.schedule-dialog{max-width:720px;width:720px}md-dialog.schedule-dialog md-dialog-content{display:block;position:relative}md-dialog.schedule-dialog md-toolbar .title{font-size:17px}md-dialog.schedule-dialog md-input-container textarea{min-height:150px}md-dialog.schedule-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.schedule-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.schedule-dialog .date-container{padding:16px 0 24px 0}md-dialog.schedule-dialog .error-list{font-size:13px}md-dialog.schedule-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.schedule-dialog .error-list .error .message{font-weight:500}md-dialog.schedule-dialog .error-list .error .md-button{margin:0}md-dialog.schedule-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.schedule-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#schedules{position:relative}#schedules>.header{height:76px;min-height:76px;max-height:76px}#schedules>.header .logo .logo-icon{margin:0 16px 0 0}#schedules>.header .logo .logo-text{font-size:24px}#schedules>.header md-icon{color:#fff}#schedules>.header .search-input-wrapper{position:relative}#schedules>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#schedules>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#schedules>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#schedules>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#schedules>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#schedules>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#schedules>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#schedules>.header.selected-bar .close-button-wrapper{width:244px}#schedules>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#schedules>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#schedules>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#schedules #add-schedule-button{position:fixed;bottom:8px;right:8px;padding:0}#schedules #upload-schedule-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.sound-dialog{max-width:720px;width:720px}md-dialog.sound-dialog md-dialog-content{display:block;position:relative}md-dialog.sound-dialog md-toolbar .title{font-size:17px}md-dialog.sound-dialog md-input-container textarea{min-height:150px}md-dialog.sound-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.sound-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.sound-dialog .date-container{padding:16px 0 24px 0}md-dialog.sound-dialog .error-list{font-size:13px}md-dialog.sound-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.sound-dialog .error-list .error .message{font-weight:500}md-dialog.sound-dialog .error-list .error .md-button{margin:0}md-dialog.sound-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.sound-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#sounds{position:relative}#sounds>.header{height:76px;min-height:76px;max-height:76px}#sounds>.header .logo .logo-icon{margin:0 16px 0 0}#sounds>.header .logo .logo-text{font-size:24px}#sounds>.header md-icon{color:#fff}#sounds>.header .search-input-wrapper{position:relative}#sounds>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#sounds>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#sounds>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#sounds>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#sounds>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#sounds>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#sounds>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#sounds>.header.selected-bar .close-button-wrapper{width:244px}#sounds>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#sounds>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#sounds>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#sounds #add-sound-button{position:fixed;bottom:8px;right:8px;padding:0}#sounds #upload-sound-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.upload-dialog{max-width:720px;width:720px}md-dialog.upload-dialog md-dialog-content{display:block;position:relative}md-dialog.upload-dialog md-toolbar .title{font-size:17px}md-dialog.upload-dialog md-input-container textarea{min-height:150px}md-dialog.upload-dialog md-progress-linear{padding-top:16px!important}md-dialog.upload-dialog .date-container{padding:16px 0 24px 0}md-dialog.upload-dialog .error-list{font-size:13px}md-dialog.upload-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.upload-dialog .error-list .error .message{font-weight:500}md-dialog.upload-dialog .error-list .error .md-button{margin:0}md-dialog.upload-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.upload-dialog .sound-image{overflow:hidden;max-width:148px;margin-right:16px;border:3px solid rgba(0,0,0,.12);padding:10px}md-dialog.upload-dialog .sound-image img{width:auto;max-width:none}md-dialog.upload-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.tag-dialog{max-width:720px;width:720px}md-dialog.tag-dialog md-dialog-content{display:block;position:relative}md-dialog.tag-dialog md-toolbar .title{font-size:17px}md-dialog.tag-dialog md-input-container textarea{min-height:150px}md-dialog.tag-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.tag-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.tag-dialog .date-container{padding:16px 0 24px 0}md-dialog.tag-dialog .error-list{font-size:13px}md-dialog.tag-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.tag-dialog .error-list .error .message{font-weight:500}md-dialog.tag-dialog .error-list .error .md-button{margin:0}md-dialog.tag-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.tag-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tags{position:relative}#tags>.header{height:76px;min-height:76px;max-height:76px}#tags>.header .logo .logo-icon{margin:0 16px 0 0}#tags>.header .logo .logo-text{font-size:24px}#tags>.header md-icon{color:#fff}#tags>.header .search-input-wrapper{position:relative}#tags>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#tags>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#tags>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#tags>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#tags>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#tags>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#tags>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#tags>.header.selected-bar .close-button-wrapper{width:244px}#tags>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#tags>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#tags>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#tags #add-tag-button{position:fixed;bottom:8px;right:8px;padding:0}#tags #upload-tag-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.template-dialog{max-width:720px;width:720px}md-dialog.template-dialog md-dialog-content{display:block;position:relative}md-dialog.template-dialog md-toolbar .title{font-size:17px}md-dialog.template-dialog md-input-container textarea{min-height:150px}md-dialog.template-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.template-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.template-dialog .date-container{padding:16px 0 24px 0}md-dialog.template-dialog .error-list{font-size:13px}md-dialog.template-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.template-dialog .error-list .error .message{font-weight:500}md-dialog.template-dialog .error-list .error .md-button{margin:0}md-dialog.template-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.template-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#templates{position:relative}#templates>.header{height:76px;min-height:76px;max-height:76px}#templates>.header .logo .logo-icon{margin:0 16px 0 0}#templates>.header .logo .logo-text{font-size:24px}#templates>.header md-icon{color:#fff}#templates>.header .search-input-wrapper{position:relative}#templates>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#templates>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#templates>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#templates>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#templates>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#templates>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#templates>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#templates>.header.selected-bar .close-button-wrapper{width:244px}#templates>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#templates>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#templates>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#templates #add-template-button{position:fixed;bottom:8px;right:8px;padding:0}#templates #upload-template-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.trigger-dialog{max-width:720px;width:720px}md-dialog.trigger-dialog md-dialog-content{display:block;position:relative}md-dialog.trigger-dialog md-toolbar .title{font-size:17px}md-dialog.trigger-dialog md-input-container textarea{min-height:150px}md-dialog.trigger-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.trigger-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.trigger-dialog .date-container{padding:16px 0 24px 0}md-dialog.trigger-dialog .error-list{font-size:13px}md-dialog.trigger-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.trigger-dialog .error-list .error .message{font-weight:500}md-dialog.trigger-dialog .error-list .error .md-button{margin:0}md-dialog.trigger-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.trigger-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.action-dialog{max-width:720px;width:720px}md-dialog.action-dialog md-dialog-content{display:block;position:relative}md-dialog.action-dialog md-toolbar .title{font-size:17px}md-dialog.action-dialog md-input-container textarea{min-height:150px}md-dialog.action-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.action-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.action-dialog .date-container{padding:16px 0 24px 0}md-dialog.action-dialog .error-list{font-size:13px}md-dialog.action-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.action-dialog .error-list .error .message{font-weight:500}md-dialog.action-dialog .error-list .error .md-button{margin:0}md-dialog.action-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.action-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.allCondition-dialog{max-width:720px;width:720px}md-dialog.allCondition-dialog md-dialog-content{display:block;position:relative}md-dialog.allCondition-dialog md-toolbar .title{font-size:17px}md-dialog.allCondition-dialog md-input-container textarea{min-height:150px}md-dialog.allCondition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.allCondition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.allCondition-dialog .date-container{padding:16px 0 24px 0}md-dialog.allCondition-dialog .error-list{font-size:13px}md-dialog.allCondition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.allCondition-dialog .error-list .error .message{font-weight:500}md-dialog.allCondition-dialog .error-list .error .md-button{margin:0}md-dialog.allCondition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.allCondition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.anyCondition-dialog{max-width:720px;width:720px}md-dialog.anyCondition-dialog md-dialog-content{display:block;position:relative}md-dialog.anyCondition-dialog md-toolbar .title{font-size:17px}md-dialog.anyCondition-dialog md-input-container textarea{min-height:150px}md-dialog.anyCondition-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.anyCondition-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.anyCondition-dialog .date-container{padding:16px 0 24px 0}md-dialog.anyCondition-dialog .error-list{font-size:13px}md-dialog.anyCondition-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.anyCondition-dialog .error-list .error .message{font-weight:500}md-dialog.anyCondition-dialog .error-list .error .md-button{margin:0}md-dialog.anyCondition-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.anyCondition-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tools-trigger .header{height:76px;min-height:76px;max-height:76px}#tools-trigger .header .goto-triggers-button{margin-right:16px}#tools-trigger .header .trigger-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#tools-trigger .header .trigger-image img{height:100%;width:auto;max-width:none}#tools-trigger .header .subtitle{margin:6px 0 0 0}#tools-trigger .trigger-detail-form-container{padding:24px;margin-bottom:24px}#tools-trigger .trigger-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#tools-trigger .trigger-detail-form-container .handle{cursor:move}#tools-trigger .trigger-detail-form-container md-input-container md-switch{margin:0!important}#tools-trigger .trigger-detail-form-container #trigger-image-uploader{position:relative}#tools-trigger .trigger-detail-form-container #trigger-image-uploader.dropping .drop-text{display:flex}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .upload-button{margin-bottom:16px}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .trigger-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .trigger-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#tools-trigger .trigger-detail-form-container #trigger-image-uploader .trigger-image .media{max-height:100%}#tools-trigger md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#tools-trigger md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#tools-trigger md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#tools-trigger md-table-container.font-size-12 td.md-cell{font-size:12px!important}#triggers{position:relative}#triggers>.header{height:76px;min-height:76px;max-height:76px}#triggers>.header .logo .logo-icon{margin:0 16px 0 0}#triggers>.header .logo .logo-text{font-size:24px}#triggers>.header md-icon{color:#fff}#triggers>.header .search-input-wrapper{position:relative}#triggers>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#triggers>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#triggers>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#triggers>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#triggers>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#triggers>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#triggers>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#triggers>.header.selected-bar .close-button-wrapper{width:244px}#triggers>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#triggers>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#triggers>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#triggers #add-trigger-button{position:fixed;bottom:8px;right:8px;padding:0}#triggers #upload-trigger-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.trunk-dialog{max-width:720px;width:720px}md-dialog.trunk-dialog md-dialog-content{display:block;position:relative}md-dialog.trunk-dialog md-toolbar .title{font-size:17px}md-dialog.trunk-dialog md-input-container textarea{min-height:150px}md-dialog.trunk-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.trunk-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.trunk-dialog .date-container{padding:16px 0 24px 0}md-dialog.trunk-dialog .error-list{font-size:13px}md-dialog.trunk-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.trunk-dialog .error-list .error .message{font-weight:500}md-dialog.trunk-dialog .error-list .error .md-button{margin:0}md-dialog.trunk-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.trunk-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#tools-trunk .header{height:76px;min-height:76px;max-height:76px}#tools-trunk .header .goto-trunks-button{margin-right:16px}#tools-trunk .header .trunk-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#tools-trunk .header .trunk-image img{height:100%;width:auto;max-width:none}#tools-trunk .header .subtitle{margin:6px 0 0 0}#tools-trunk .trunk-detail-form-container{padding:24px;margin-bottom:24px}#tools-trunk .trunk-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#tools-trunk .trunk-detail-form-container .handle{cursor:move}#tools-trunk .trunk-detail-form-container md-input-container md-switch{margin:0!important}#tools-trunk .trunk-detail-form-container #trunk-image-uploader{position:relative}#tools-trunk .trunk-detail-form-container #trunk-image-uploader.dropping .drop-text{display:flex}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .upload-button{margin-bottom:16px}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .trunk-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .trunk-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#tools-trunk .trunk-detail-form-container #trunk-image-uploader .trunk-image .media{max-height:100%}#tools-trunk md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#tools-trunk md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#tools-trunk md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#tools-trunk md-table-container.font-size-12 td.md-cell{font-size:12px!important}#trunks{position:relative}#trunks>.header{height:76px;min-height:76px;max-height:76px}#trunks>.header .logo .logo-icon{margin:0 16px 0 0}#trunks>.header .logo .logo-text{font-size:24px}#trunks>.header md-icon{color:#fff}#trunks>.header .search-input-wrapper{position:relative}#trunks>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#trunks>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#trunks>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#trunks>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#trunks>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#trunks>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#trunks>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#trunks>.header.selected-bar .close-button-wrapper{width:244px}#trunks>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#trunks>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#trunks>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#trunks #add-trunk-button{position:fixed;bottom:8px;right:8px;padding:0}#trunks #upload-trunk-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.variable-dialog{max-width:720px;width:720px}md-dialog.variable-dialog md-dialog-content{display:block;position:relative}md-dialog.variable-dialog md-toolbar .title{font-size:17px}md-dialog.variable-dialog md-input-container textarea{min-height:150px}md-dialog.variable-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.variable-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.variable-dialog .date-container{padding:16px 0 24px 0}md-dialog.variable-dialog .error-list{font-size:13px}md-dialog.variable-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.variable-dialog .error-list .error .message{font-weight:500}md-dialog.variable-dialog .error-list .error .md-button{margin:0}md-dialog.variable-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.variable-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#variables{position:relative}#variables>.header{height:76px;min-height:76px;max-height:76px}#variables>.header .logo .logo-icon{margin:0 16px 0 0}#variables>.header .logo .logo-text{font-size:24px}#variables>.header md-icon{color:#fff}#variables>.header .search-input-wrapper{position:relative}#variables>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#variables>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#variables>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#variables>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#variables>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#variables>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#variables>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#variables>.header.selected-bar .close-button-wrapper{width:244px}#variables>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#variables>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#variables>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#variables #add-variable-button{position:fixed;bottom:8px;right:8px;padding:0}#variables #upload-variable-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.screenRecording-dialog{max-width:720px;width:720px}md-dialog.screenRecording-dialog md-dialog-content{display:block;position:relative}md-dialog.screenRecording-dialog md-toolbar .title{font-size:17px}md-dialog.screenRecording-dialog md-input-container textarea{min-height:150px}md-dialog.screenRecording-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.screenRecording-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.screenRecording-dialog .date-container{padding:16px 0 24px 0}md-dialog.screenRecording-dialog .error-list{font-size:13px}md-dialog.screenRecording-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.screenRecording-dialog .error-list .error .message{font-weight:500}md-dialog.screenRecording-dialog .error-list .error .md-button{margin:0}md-dialog.screenRecording-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.screenRecording-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#screenRecordings{position:relative}#screenRecordings>.header{height:76px;min-height:76px;max-height:76px}#screenRecordings>.header .logo .logo-icon{margin:0 16px 0 0}#screenRecordings>.header .logo .logo-text{font-size:24px}#screenRecordings>.header md-icon{color:#fff}#screenRecordings>.header .search-input-wrapper{position:relative}#screenRecordings>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#screenRecordings>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#screenRecordings>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#screenRecordings>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#screenRecordings>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#screenRecordings>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#screenRecordings>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#screenRecordings>.header.selected-bar .close-button-wrapper{width:244px}#screenRecordings>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#screenRecordings>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#screenRecordings>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#screenRecordings #add-screenRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#screenRecordings #upload-screenRecording-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.voice-routing-dialog{max-width:720px;width:720px}md-dialog.voice-routing-dialog md-dialog-content{display:block;position:relative}md-dialog.voice-routing-dialog md-toolbar .title{font-size:17px}md-dialog.voice-routing-dialog md-input-container textarea{min-height:150px}md-dialog.voice-routing-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voice-routing-dialog .date-container{padding:16px 0 24px 0}md-dialog.voice-routing-dialog .error-list{font-size:13px}md-dialog.voice-routing-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voice-routing-dialog .error-list .error .message{font-weight:500}md-dialog.voice-routing-dialog .error-list .error .md-button{margin:0}md-dialog.voice-routing-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voice-routing-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.interval-dialog{max-width:720px;width:720px}md-dialog.interval-dialog md-dialog-content{display:block;position:relative}md-dialog.interval-dialog md-toolbar .title{font-size:17px}md-dialog.interval-dialog md-input-container textarea{min-height:150px}md-dialog.interval-dialog .date-container{padding:16px 0 24px 0}md-dialog.interval-dialog .error-list{font-size:13px}md-dialog.interval-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.interval-dialog .error-list .error .message{font-weight:500}md-dialog.interval-dialog .error-list .error .md-button{margin:0}md-dialog.interval-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.interval-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#chanSpies{position:relative}#chanSpies>.header{height:76px;min-height:76px;max-height:76px}#chanSpies>.header .logo .logo-icon{margin:0 16px 0 0}#chanSpies>.header .logo .logo-text{font-size:24px}#chanSpies>.header md-icon{color:#fff}#chanSpies>.header .search-input-wrapper{position:relative}#chanSpies>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#chanSpies>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#chanSpies>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#chanSpies>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#chanSpies>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#chanSpies>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#chanSpies>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#chanSpies>.header.selected-bar .close-button-wrapper{width:244px}#chanSpies>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#chanSpies>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#chanSpies>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#chanSpies #add-chanSpy-button{position:fixed;bottom:8px;right:8px;padding:0}#chanSpies #upload-chanSpy-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.chanSpy-dialog{max-width:720px;width:720px}md-dialog.chanSpy-dialog md-dialog-content{display:block;position:relative}md-dialog.chanSpy-dialog md-toolbar .title{font-size:17px}md-dialog.chanSpy-dialog md-input-container textarea{min-height:150px}md-dialog.chanSpy-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.chanSpy-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.chanSpy-dialog .date-container{padding:16px 0 24px 0}md-dialog.chanSpy-dialog .error-list{font-size:13px}md-dialog.chanSpy-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.chanSpy-dialog .error-list .error .message{font-weight:500}md-dialog.chanSpy-dialog .error-list .error .md-button{margin:0}md-dialog.chanSpy-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.chanSpy-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#contexts{position:relative}#contexts>.header{height:76px;min-height:76px;max-height:76px}#contexts>.header .logo .logo-icon{margin:0 16px 0 0}#contexts>.header .logo .logo-text{font-size:24px}#contexts>.header md-icon{color:#fff}#contexts>.header .search-input-wrapper{position:relative}#contexts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#contexts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#contexts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#contexts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#contexts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#contexts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#contexts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#contexts>.header.selected-bar .close-button-wrapper{width:244px}#contexts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#contexts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#contexts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#contexts #add-context-button{position:fixed;bottom:8px;right:8px;padding:0}#contexts #upload-context-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.context-dialog{max-width:720px;width:720px}md-dialog.context-dialog md-dialog-content{display:block;position:relative}md-dialog.context-dialog md-toolbar .title{font-size:17px}md-dialog.context-dialog md-input-container textarea{min-height:150px}md-dialog.context-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.context-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.context-dialog .date-container{padding:16px 0 24px 0}md-dialog.context-dialog .error-list{font-size:13px}md-dialog.context-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.context-dialog .error-list .error .message{font-weight:500}md-dialog.context-dialog .error-list .error .md-button{margin:0}md-dialog.context-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.context-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.inbound-route-dialog{max-width:720px;width:720px}md-dialog.inbound-route-dialog md-dialog-content{display:block;position:relative}md-dialog.inbound-route-dialog md-toolbar .title{font-size:17px}md-dialog.inbound-route-dialog md-input-container textarea{min-height:150px}md-dialog.inbound-route-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.inbound-route-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.inbound-route-dialog .date-container{padding:16px 0 24px 0}md-dialog.inbound-route-dialog .error-list{font-size:13px}md-dialog.inbound-route-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.inbound-route-dialog .error-list .error .message{font-weight:500}md-dialog.inbound-route-dialog .error-list .error .md-button{margin:0}md-dialog.inbound-route-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.inbound-route-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-inbound-route .header{height:76px;min-height:76px;max-height:76px}#voice-inbound-route .header .goto-inbound-routes-button{margin-right:16px}#voice-inbound-route .header .inbound-route-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-inbound-route .header .inbound-route-image img{height:100%;width:auto;max-width:none}#voice-inbound-route .header .subtitle{margin:6px 0 0 0}#voice-inbound-route .inbound-route-detail-form-container{padding:24px;margin-bottom:24px}#voice-inbound-route .inbound-route-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-inbound-route .inbound-route-detail-form-container .handle{cursor:move}#voice-inbound-route .inbound-route-detail-form-container md-input-container md-switch{margin:0!important}#voice-inbound-route md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-inbound-route md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-inbound-route md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-inbound-route md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#voice-inbound-route .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#voice-inbound-route .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#voice-inbound-route .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#voice-inbound-route .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#voice-inbound-route .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#voice-inbound-route .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#voice-inbound-route .actionAppData{width:150px!important}}@media screen and (max-width:960px){#voice-inbound-route .actionAppData{width:80px!important}}#inbound-routes{position:relative}#inbound-routes>.header{height:76px;min-height:76px;max-height:76px}#inbound-routes>.header .logo .logo-icon{margin:0 16px 0 0}#inbound-routes>.header .logo .logo-text{font-size:24px}#inbound-routes>.header md-icon{color:#fff}#inbound-routes>.header .search-input-wrapper{position:relative}#inbound-routes>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#inbound-routes>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#inbound-routes>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#inbound-routes>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#inbound-routes>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#inbound-routes>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#inbound-routes>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#inbound-routes>.header.selected-bar .close-button-wrapper{width:244px}#inbound-routes>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#inbound-routes>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#inbound-routes>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#inbound-routes #add-inbound-route-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.internal-route-dialog{max-width:720px;width:720px}md-dialog.internal-route-dialog md-dialog-content{display:block;position:relative}md-dialog.internal-route-dialog md-toolbar .title{font-size:17px}md-dialog.internal-route-dialog md-input-container textarea{min-height:150px}md-dialog.internal-route-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.internal-route-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.internal-route-dialog .date-container{padding:16px 0 24px 0}md-dialog.internal-route-dialog .error-list{font-size:13px}md-dialog.internal-route-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.internal-route-dialog .error-list .error .message{font-weight:500}md-dialog.internal-route-dialog .error-list .error .md-button{margin:0}md-dialog.internal-route-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.internal-route-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-internal-route .header{height:76px;min-height:76px;max-height:76px}#voice-internal-route .header .goto-internal-routes-button{margin-right:16px}#voice-internal-route .header .internal-route-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-internal-route .header .internal-route-image img{height:100%;width:auto;max-width:none}#voice-internal-route .header .subtitle{margin:6px 0 0 0}#voice-internal-route .internal-route-detail-form-container{padding:24px;margin-bottom:24px}#voice-internal-route .internal-route-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-internal-route .internal-route-detail-form-container .handle{cursor:move}#voice-internal-route .internal-route-detail-form-container md-input-container md-switch{margin:0!important}#voice-internal-route md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-internal-route md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-internal-route md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-internal-route md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#voice-internal-route .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#voice-internal-route .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#voice-internal-route .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#voice-internal-route .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#voice-internal-route .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#voice-internal-route .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#voice-internal-route .actionAppData{width:150px!important}}@media screen and (max-width:960px){#voice-internal-route .actionAppData{width:80px!important}}#internal-routes{position:relative}#internal-routes>.header{height:76px;min-height:76px;max-height:76px}#internal-routes>.header .logo .logo-icon{margin:0 16px 0 0}#internal-routes>.header .logo .logo-text{font-size:24px}#internal-routes>.header md-icon{color:#fff}#internal-routes>.header .search-input-wrapper{position:relative}#internal-routes>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#internal-routes>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#internal-routes>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#internal-routes>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#internal-routes>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#internal-routes>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#internal-routes>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#internal-routes>.header.selected-bar .close-button-wrapper{width:244px}#internal-routes>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#internal-routes>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#internal-routes>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#internal-routes #add-internal-route-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.musiconhold-dialog{max-width:720px;width:720px}md-dialog.musiconhold-dialog md-dialog-content{display:block;position:relative}md-dialog.musiconhold-dialog md-toolbar .title{font-size:17px}md-dialog.musiconhold-dialog md-input-container textarea{min-height:150px}md-dialog.musiconhold-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.musiconhold-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.musiconhold-dialog .date-container{padding:16px 0 24px 0}md-dialog.musiconhold-dialog .error-list{font-size:13px}md-dialog.musiconhold-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.musiconhold-dialog .error-list .error .message{font-weight:500}md-dialog.musiconhold-dialog .error-list .error .md-button{margin:0}md-dialog.musiconhold-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.musiconhold-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.mohSound-dialog{max-width:720px;width:720px}md-dialog.mohSound-dialog md-dialog-content{display:block;position:relative}md-dialog.mohSound-dialog md-toolbar .title{font-size:17px}md-dialog.mohSound-dialog md-input-container textarea{min-height:150px}md-dialog.mohSound-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.mohSound-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.mohSound-dialog .date-container{padding:16px 0 24px 0}md-dialog.mohSound-dialog .error-list{font-size:13px}md-dialog.mohSound-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.mohSound-dialog .error-list .error .message{font-weight:500}md-dialog.mohSound-dialog .error-list .error .md-button{margin:0}md-dialog.mohSound-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.mohSound-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-musiconhold .header{height:76px;min-height:76px;max-height:76px}#voice-musiconhold .header .goto-musiconholds-button{margin-right:16px}#voice-musiconhold .header .musiconhold-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-musiconhold .header .musiconhold-image img{height:100%;width:auto;max-width:none}#voice-musiconhold .header .subtitle{margin:6px 0 0 0}#voice-musiconhold .musiconhold-detail-form-container{padding:24px;margin-bottom:24px}#voice-musiconhold .musiconhold-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-musiconhold .musiconhold-detail-form-container .handle{cursor:move}#voice-musiconhold .musiconhold-detail-form-container md-input-container md-switch{margin:0!important}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader{position:relative}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader.dropping .drop-text{display:flex}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .upload-button{margin-bottom:16px}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .musiconhold-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .musiconhold-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#voice-musiconhold .musiconhold-detail-form-container #musiconhold-image-uploader .musiconhold-image .media{max-height:100%}#voice-musiconhold md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-musiconhold md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-musiconhold md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-musiconhold md-table-container.font-size-12 td.md-cell{font-size:12px!important}#musiconholds{position:relative}#musiconholds>.header{height:76px;min-height:76px;max-height:76px}#musiconholds>.header .logo .logo-icon{margin:0 16px 0 0}#musiconholds>.header .logo .logo-text{font-size:24px}#musiconholds>.header md-icon{color:#fff}#musiconholds>.header .search-input-wrapper{position:relative}#musiconholds>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#musiconholds>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#musiconholds>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#musiconholds>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#musiconholds>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#musiconholds>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#musiconholds>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#musiconholds>.header.selected-bar .close-button-wrapper{width:244px}#musiconholds>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#musiconholds>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#musiconholds>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#musiconholds #add-musiconhold-button{position:fixed;bottom:8px;right:8px;padding:0}#musiconholds #upload-musiconhold-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.outbound-route-dialog{max-width:720px;width:720px}md-dialog.outbound-route-dialog md-dialog-content{display:block;position:relative}md-dialog.outbound-route-dialog md-toolbar .title{font-size:17px}md-dialog.outbound-route-dialog md-input-container textarea{min-height:150px}md-dialog.outbound-route-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.outbound-route-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.outbound-route-dialog .date-container{padding:16px 0 24px 0}md-dialog.outbound-route-dialog .error-list{font-size:13px}md-dialog.outbound-route-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.outbound-route-dialog .error-list .error .message{font-weight:500}md-dialog.outbound-route-dialog .error-list .error .md-button{margin:0}md-dialog.outbound-route-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.outbound-route-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-outbound-route .header{height:76px;min-height:76px;max-height:76px}#voice-outbound-route .header .goto-outbound-routes-button{margin-right:16px}#voice-outbound-route .header .outbound-route-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-outbound-route .header .outbound-route-image img{height:100%;width:auto;max-width:none}#voice-outbound-route .header .subtitle{margin:6px 0 0 0}#voice-outbound-route .outbound-route-detail-form-container{padding:24px;margin-bottom:24px}#voice-outbound-route .outbound-route-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-outbound-route .outbound-route-detail-form-container .handle{cursor:move}#voice-outbound-route .outbound-route-detail-form-container md-input-container md-switch{margin:0!important}#voice-outbound-route md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-outbound-route md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-outbound-route md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-outbound-route md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#voice-outbound-route .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#voice-outbound-route .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#voice-outbound-route .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#voice-outbound-route .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#voice-outbound-route .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#voice-outbound-route .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#voice-outbound-route .actionAppData{width:150px!important}}@media screen and (max-width:960px){#voice-outbound-route .actionAppData{width:80px!important}}#outbound-routes{position:relative}#outbound-routes>.header{height:76px;min-height:76px;max-height:76px}#outbound-routes>.header .logo .logo-icon{margin:0 16px 0 0}#outbound-routes>.header .logo .logo-text{font-size:24px}#outbound-routes>.header md-icon{color:#fff}#outbound-routes>.header .search-input-wrapper{position:relative}#outbound-routes>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#outbound-routes>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#outbound-routes>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#outbound-routes>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#outbound-routes>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#outbound-routes>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#outbound-routes>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#outbound-routes>.header.selected-bar .close-button-wrapper{width:244px}#outbound-routes>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#outbound-routes>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#outbound-routes>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#outbound-routes #add-outbound-route-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}#realtime>.content td.text-center span.text-boxed,#realtime>.content td.text-center span.text-boxed-light{display:block}@keyframes blinker{50%{opacity:0}}md-dialog.voicemail-dialog{max-width:720px;width:720px}md-dialog.voicemail-dialog md-dialog-content{display:block;position:relative}md-dialog.voicemail-dialog md-toolbar .title{font-size:17px}md-dialog.voicemail-dialog md-input-container textarea{min-height:150px}md-dialog.voicemail-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voicemail-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.voicemail-dialog .date-container{padding:16px 0 24px 0}md-dialog.voicemail-dialog .error-list{font-size:13px}md-dialog.voicemail-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voicemail-dialog .error-list .error .message{font-weight:500}md-dialog.voicemail-dialog .error-list .error .md-button{margin:0}md-dialog.voicemail-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voicemail-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-voicemail .header{height:76px;min-height:76px;max-height:76px}#voice-voicemail .header .goto-voicemails-button{margin-right:16px}#voice-voicemail .header .voicemail-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-voicemail .header .voicemail-image img{height:100%;width:auto;max-width:none}#voice-voicemail .header .subtitle{margin:6px 0 0 0}#voice-voicemail .voicemail-detail-form-container{padding:24px;margin-bottom:24px}#voice-voicemail .voicemail-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-voicemail .voicemail-detail-form-container .handle{cursor:move}#voice-voicemail .voicemail-detail-form-container md-input-container md-switch{margin:0!important}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader{position:relative}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader.dropping .drop-text{display:flex}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .upload-button{margin-bottom:16px}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .voicemail-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .voicemail-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#voice-voicemail .voicemail-detail-form-container #voicemail-image-uploader .voicemail-image .media{max-height:100%}#voice-voicemail md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-voicemail md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-voicemail md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-voicemail md-table-container.font-size-12 td.md-cell{font-size:12px!important}#voicemails{position:relative}#voicemails>.header{height:76px;min-height:76px;max-height:76px}#voicemails>.header .logo .logo-icon{margin:0 16px 0 0}#voicemails>.header .logo .logo-text{font-size:24px}#voicemails>.header md-icon{color:#fff}#voicemails>.header .search-input-wrapper{position:relative}#voicemails>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#voicemails>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#voicemails>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#voicemails>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#voicemails>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#voicemails>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#voicemails>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#voicemails>.header.selected-bar .close-button-wrapper{width:244px}#voicemails>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#voicemails>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#voicemails>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#voicemails #add-voicemail-button{position:fixed;bottom:8px;right:8px;padding:0}#voicemails #upload-voicemail-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.voicePrefix-dialog{max-width:720px;width:720px}md-dialog.voicePrefix-dialog md-dialog-content{display:block;position:relative}md-dialog.voicePrefix-dialog md-toolbar .title{font-size:17px}md-dialog.voicePrefix-dialog md-input-container textarea{min-height:150px}md-dialog.voicePrefix-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voicePrefix-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.voicePrefix-dialog .date-container{padding:16px 0 24px 0}md-dialog.voicePrefix-dialog .error-list{font-size:13px}md-dialog.voicePrefix-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voicePrefix-dialog .error-list .error .message{font-weight:500}md-dialog.voicePrefix-dialog .error-list .error .md-button{margin:0}md-dialog.voicePrefix-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voicePrefix-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voicePrefixes{position:relative}#voicePrefixes>.header{height:76px;min-height:76px;max-height:76px}#voicePrefixes>.header .logo .logo-icon{margin:0 16px 0 0}#voicePrefixes>.header .logo .logo-text{font-size:24px}#voicePrefixes>.header md-icon{color:#fff}#voicePrefixes>.header .search-input-wrapper{position:relative}#voicePrefixes>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#voicePrefixes>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#voicePrefixes>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#voicePrefixes>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#voicePrefixes>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#voicePrefixes>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#voicePrefixes>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#voicePrefixes>.header.selected-bar .close-button-wrapper{width:244px}#voicePrefixes>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#voicePrefixes>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#voicePrefixes>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#voicePrefixes #add-voicePrefix-button{position:fixed;bottom:8px;right:8px;padding:0}#voicePrefixes #upload-voicePrefix-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.voiceQueue-dialog{max-width:720px;width:720px}md-dialog.voiceQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.voiceQueue-dialog md-toolbar .title{font-size:17px}md-dialog.voiceQueue-dialog md-input-container textarea{min-height:150px}md-dialog.voiceQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voiceQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.voiceQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.voiceQueue-dialog .error-list{font-size:13px}md-dialog.voiceQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voiceQueue-dialog .error-list .error .message{font-weight:500}md-dialog.voiceQueue-dialog .error-list .error .md-button{margin:0}md-dialog.voiceQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voiceQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-voiceQueue .header{height:76px;min-height:76px;max-height:76px}#voice-voiceQueue .header .goto-voiceQueues-button{margin-right:16px}#voice-voiceQueue .header .voiceQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-voiceQueue .header .voiceQueue-image img{height:100%;width:auto;max-width:none}#voice-voiceQueue .header .subtitle{margin:6px 0 0 0}#voice-voiceQueue .voiceQueue-detail-form-container{padding:24px;margin-bottom:24px}#voice-voiceQueue .voiceQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-voiceQueue .voiceQueue-detail-form-container .handle{cursor:move}#voice-voiceQueue .voiceQueue-detail-form-container md-input-container md-switch{margin:0!important}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader{position:relative}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader.dropping .drop-text{display:flex}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .upload-button{margin-bottom:16px}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .voiceQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .voiceQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#voice-voiceQueue .voiceQueue-detail-form-container #voiceQueue-image-uploader .voiceQueue-image .media{max-height:100%}#voice-voiceQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-voiceQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-voiceQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-voiceQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#voiceQueues{position:relative}#voiceQueues>.header{height:76px;min-height:76px;max-height:76px}#voiceQueues>.header .logo .logo-icon{margin:0 16px 0 0}#voiceQueues>.header .logo .logo-text{font-size:24px}#voiceQueues>.header md-icon{color:#fff}#voiceQueues>.header .search-input-wrapper{position:relative}#voiceQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#voiceQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#voiceQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#voiceQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#voiceQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#voiceQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#voiceQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#voiceQueues>.header.selected-bar .close-button-wrapper{width:244px}#voiceQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#voiceQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#voiceQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#voiceQueues #add-voiceQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#voiceQueues #upload-voiceQueue-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.voiceRecording-dialog{max-width:720px;width:720px}md-dialog.voiceRecording-dialog md-dialog-content{display:block;position:relative}md-dialog.voiceRecording-dialog md-toolbar .title{font-size:17px}md-dialog.voiceRecording-dialog md-input-container textarea{min-height:150px}md-dialog.voiceRecording-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.voiceRecording-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.voiceRecording-dialog .date-container{padding:16px 0 24px 0}md-dialog.voiceRecording-dialog .error-list{font-size:13px}md-dialog.voiceRecording-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.voiceRecording-dialog .error-list .error .message{font-weight:500}md-dialog.voiceRecording-dialog .error-list .error .md-button{margin:0}md-dialog.voiceRecording-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.voiceRecording-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#voice-voiceRecording .header{height:76px;min-height:76px;max-height:76px}#voice-voiceRecording .header .goto-voiceRecordings-button{margin-right:16px}#voice-voiceRecording .header .voiceRecording-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#voice-voiceRecording .header .voiceRecording-image img{height:100%;width:auto;max-width:none}#voice-voiceRecording .header .subtitle{margin:6px 0 0 0}#voice-voiceRecording .voiceRecording-detail-form-container{padding:24px;margin-bottom:24px}#voice-voiceRecording .voiceRecording-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#voice-voiceRecording .voiceRecording-detail-form-container .handle{cursor:move}#voice-voiceRecording .voiceRecording-detail-form-container md-input-container md-switch{margin:0!important}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader{position:relative}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader.dropping .drop-text{display:flex}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .upload-button{margin-bottom:16px}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .voiceRecording-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .voiceRecording-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#voice-voiceRecording .voiceRecording-detail-form-container #voiceRecording-image-uploader .voiceRecording-image .media{max-height:100%}#voice-voiceRecording md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#voice-voiceRecording md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#voice-voiceRecording md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#voice-voiceRecording md-table-container.font-size-12 td.md-cell{font-size:12px!important}#voice-voiceRecording .sentiment.POSITIVE{color:#4caf50;font-size:25px}#voice-voiceRecording .sentiment.NEGATIVE{color:#f40505;font-size:30px}#voice-voiceRecording .sentiment.NEUTRAL{color:#03a9f4;font-size:30px}#voice-voiceRecording .sentiment.MIXED{color:#9c27b0;font-size:30px}#voiceRecordings{position:relative}#voiceRecordings>.header{height:76px;min-height:76px;max-height:76px}#voiceRecordings>.header .logo .logo-icon{margin:0 16px 0 0}#voiceRecordings>.header .logo .logo-text{font-size:24px}#voiceRecordings>.header md-icon{color:#fff}#voiceRecordings>.header .search-input-wrapper{position:relative}#voiceRecordings>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#voiceRecordings>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#voiceRecordings>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#voiceRecordings>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#voiceRecordings>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#voiceRecordings>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#voiceRecordings>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#voiceRecordings>.header.selected-bar .close-button-wrapper{width:244px}#voiceRecordings>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#voiceRecordings>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#voiceRecordings>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#voiceRecordings #add-voiceRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#voiceRecordings #upload-voiceRecording-button{position:fixed;bottom:8px;right:8px;padding:0}#realtime{height:auto}#realtime>.content .blink{animation:blinker 2s linear infinite}#realtime>.content .avatar-wrapper{position:relative}#realtime>.content .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .search-input-wrapper{position:relative;margin-left:20px}#realtime>.content .search-input-wrapper label{padding:6px;cursor:pointer}#realtime>.content .search-input-wrapper md-input-container{padding-top:20px}#realtime>.content .main .labels{padding:8px 16px}#realtime>.content .main .labels .label{margin:0 0 2px 4px;padding:2px 5px;font-size:11px;white-space:nowrap;border-radius:2px}#realtime>.content .main .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .main .avatar-wrapper{position:relative}#realtime>.content .main .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#realtime>.content .custom-column{padding:0 24px!important}@keyframes blinker{50%{opacity:0}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.whatsappAccount-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}md-dialog.whatsappAccount-dialog{max-width:720px;width:720px}md-dialog.whatsappAccount-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappAccount-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappAccount-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappAccount-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappAccount-dialog .error-list{font-size:13px}md-dialog.whatsappAccount-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappAccount-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappAccount-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappAccount-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappAccount-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#whatsapp-whatsappAccount .header{height:76px;min-height:76px;max-height:76px}#whatsapp-whatsappAccount .header .goto-whatsappAccounts-button{margin-right:16px}#whatsapp-whatsappAccount .header .whatsappAccount-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#whatsapp-whatsappAccount .header .whatsappAccount-image img{height:100%;width:auto;max-width:none}#whatsapp-whatsappAccount .header .subtitle{margin:6px 0 0 0}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container{padding:24px;margin-bottom:24px}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container .handle{cursor:move}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container md-input-container md-switch{margin:0!important}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader{position:relative}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader.dropping .drop-text{display:flex}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .upload-button{margin-bottom:16px}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .whatsappAccount-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .whatsappAccount-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#whatsapp-whatsappAccount .whatsappAccount-detail-form-container #whatsappAccount-image-uploader .whatsappAccount-image .media{max-height:100%}#whatsapp-whatsappAccount md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#whatsapp-whatsappAccount md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#whatsapp-whatsappAccount md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#whatsapp-whatsappAccount md-table-container.font-size-12 td.md-cell{font-size:12px!important}@media screen and (min-width:1921px){#whatsapp-whatsappAccount .actionAppData{width:800px!important}}@media screen and (max-width:1920px){#whatsapp-whatsappAccount .actionAppData{width:700px!important}}@media screen and (min-width:1751px) and (max-width:1919px){#whatsapp-whatsappAccount .actionAppData{width:600px!important}}@media screen and (min-width:1601px) and (max-width:1750px){#whatsapp-whatsappAccount .actionAppData{width:500px!important}}@media screen and (min-width:1537px) and (max-width:1600px){#whatsapp-whatsappAccount .actionAppData{width:450px!important}}@media screen and (min-width:1281px) and (max-width:1536px){#whatsapp-whatsappAccount .actionAppData{width:300px!important}}@media screen and (max-width:1280px){#whatsapp-whatsappAccount .actionAppData{width:150px!important}}@media screen and (max-width:960px){#whatsapp-whatsappAccount .actionAppData{width:80px!important}}md-dialog.whatsappCannedAnswer-dialog{max-width:720px;width:720px}md-dialog.whatsappCannedAnswer-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappCannedAnswer-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappCannedAnswer-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappCannedAnswer-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.whatsappCannedAnswer-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.whatsappCannedAnswer-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappCannedAnswer-dialog .error-list{font-size:13px}md-dialog.whatsappCannedAnswer-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappCannedAnswer-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappCannedAnswer-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappCannedAnswer-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappCannedAnswer-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#whatsappAccounts{position:relative}#whatsappAccounts>.header{height:76px;min-height:76px;max-height:76px}#whatsappAccounts>.header .logo .logo-icon{margin:0 16px 0 0}#whatsappAccounts>.header .logo .logo-text{font-size:24px}#whatsappAccounts>.header md-icon{color:#fff}#whatsappAccounts>.header .search-input-wrapper{position:relative}#whatsappAccounts>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#whatsappAccounts>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#whatsappAccounts>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#whatsappAccounts>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#whatsappAccounts>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#whatsappAccounts>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#whatsappAccounts>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#whatsappAccounts>.header.selected-bar .close-button-wrapper{width:244px}#whatsappAccounts>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#whatsappAccounts>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#whatsappAccounts>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#whatsappAccounts #add-whatsappAccount-button{position:fixed;bottom:8px;right:8px;padding:0}#whatsappAccounts #upload-whatsappAccount-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.whatsappQueue-dialog{max-width:720px;width:720px}md-dialog.whatsappQueue-dialog md-dialog-content{display:block;position:relative}md-dialog.whatsappQueue-dialog md-toolbar .title{font-size:17px}md-dialog.whatsappQueue-dialog md-input-container textarea{min-height:150px}md-dialog.whatsappQueue-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.whatsappQueue-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.whatsappQueue-dialog .date-container{padding:16px 0 24px 0}md-dialog.whatsappQueue-dialog .error-list{font-size:13px}md-dialog.whatsappQueue-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.whatsappQueue-dialog .error-list .error .message{font-weight:500}md-dialog.whatsappQueue-dialog .error-list .error .md-button{margin:0}md-dialog.whatsappQueue-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.whatsappQueue-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#whatsapp-whatsappQueue .header{height:76px;min-height:76px;max-height:76px}#whatsapp-whatsappQueue .header .goto-whatsappQueues-button{margin-right:16px}#whatsapp-whatsappQueue .header .whatsappQueue-image{overflow:hidden;width:56px;height:56px;margin-right:16px;border:3px solid rgba(0,0,0,.12)}#whatsapp-whatsappQueue .header .whatsappQueue-image img{height:100%;width:auto;max-width:none}#whatsapp-whatsappQueue .header .subtitle{margin:6px 0 0 0}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container{padding:24px;margin-bottom:24px}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container .handle{cursor:move}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container md-input-container md-switch{margin:0!important}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader{position:relative}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader.dropping .drop-text{display:flex}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .drop-text{display:none;position:absolute;top:0;right:0;bottom:0;left:0;padding:16px;text-align:center;border:2px dashed rgba(0,0,0,.12);background:#fff;font-size:20px;z-index:100}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .upload-button{margin-bottom:16px}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .whatsappQueue-image{position:relative;width:200px;height:200px;border:1px solid rgba(0,0,0,.12);margin:8px}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .whatsappQueue-image.uploading .overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.87)}#whatsapp-whatsappQueue .whatsappQueue-detail-form-container #whatsappQueue-image-uploader .whatsappQueue-image .media{max-height:100%}#whatsapp-whatsappQueue md-table-container thead tr th:not(:first-child):not(.no-padding){padding:0 20px 0 0!important}#whatsapp-whatsappQueue md-table-container thead th.md-checkbox-column:not(.no-padding){padding:0 24px!important}#whatsapp-whatsappQueue md-table-container tbody tr td:not(:first-child):not(.no-padding):not(.actions-padding){padding:0 20px 0 0!important}#whatsapp-whatsappQueue md-table-container.font-size-12 td.md-cell{font-size:12px!important}#whatsappQueues{position:relative}#whatsappQueues>.header{height:76px;min-height:76px;max-height:76px}#whatsappQueues>.header .logo .logo-icon{margin:0 16px 0 0}#whatsappQueues>.header .logo .logo-text{font-size:24px}#whatsappQueues>.header md-icon{color:#fff}#whatsappQueues>.header .search-input-wrapper{position:relative}#whatsappQueues>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#whatsappQueues>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#whatsappQueues>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#whatsappQueues>.header .search-input-wrapper md-input-container input{border-bottom:1px solid rgba(255,255,255,.8);color:rgba(255,255,255,.8);width:240px}#whatsappQueues>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#whatsappQueues>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#whatsappQueues>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#whatsappQueues>.header.selected-bar .close-button-wrapper{width:244px}#whatsappQueues>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#whatsappQueues>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#whatsappQueues>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#whatsappQueues #add-whatsappQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#whatsappQueues #upload-whatsappQueue-button{position:fixed;bottom:8px;right:8px;padding:0}#layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation{width:240px;min-width:240px;max-width:240px;overflow-x:hidden;transition:all .3s cubic-bezier(.55,0,.55,.2),width .1s linear,min-width .1s linear,max-width .1s linear;box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}#layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation .navigation-header{height:64px;min-height:64px;background-color:rgba(255,255,255,.05);padding:0 16px 0 24px}#layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation:not(._md-locked-open){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}@media only screen and (min-width:960px){.ms-navigation-folded #content-container{margin-left:64px}.ms-navigation-folded #layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation{position:absolute}.ms-navigation-folded:not(.ms-navigation-folded-open) #layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation{position:absolute;width:64px;min-width:64px;max-width:64px}.ms-navigation-folded:not(.ms-navigation-folded-open) #layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation .navigation-header{padding:0 16px}.ms-navigation-folded:not(.ms-navigation-folded-open) #layout-vertical-navigation-fullwidth-toolbar-2 #vertical-navigation .navigation-header .logo-text{display:none}}#vertical-navigation{width:240px;min-width:240px;max-width:240px;overflow-x:hidden;transition:all .3s cubic-bezier(.55,0,.55,.2),width .1s linear,min-width .1s linear,max-width .1s linear;box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)}#vertical-navigation .navigation-header{height:64px;min-height:64px;background-color:rgba(255,255,255,.05);padding:0 16px 0 24px}#vertical-navigation .navigation-header .logo .logo-image{display:block;width:32px;min-width:32px;height:32px;line-height:32px;text-align:center;font-size:16px;font-weight:500;color:#fff;border-radius:2px}#vertical-navigation .navigation-header .logo .logo-text{color:#fff;margin-left:16px;font-size:16px}#vertical-navigation .navigation-header .fold-toggle{transition:transform .3s ease-in-out .1s;transform:rotate(0);margin:0;padding:8px;width:34px!important;height:34px!important;cursor:pointer}#vertical-navigation:not(._md-locked-open){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}@media only screen and (min-width:960px){.ms-navigation-folded #content-container{margin-left:64px}.ms-navigation-folded #vertical-navigation{position:absolute}.ms-navigation-folded #vertical-navigation .navigation-header .fold-toggle{transform:rotate(180deg);opacity:0}.ms-navigation-folded.ms-navigation-folded-open #vertical-navigation .navigation-header .fold-toggle{transition:transform .3s ease-in-out .1s,opacity .3s ease-in-out .2s;opacity:1}.ms-navigation-folded:not(.ms-navigation-folded-open) #vertical-navigation{position:absolute;width:64px;min-width:64px;max-width:64px}.ms-navigation-folded:not(.ms-navigation-folded-open) #vertical-navigation .navigation-header{padding:0 16px}.ms-navigation-folded:not(.ms-navigation-folded-open) #vertical-navigation .navigation-header .logo-text{display:none}}#quick-panel{width:330px;min-width:330px;max-width:330px;z-index:99}#quick-panel md-content{height:100%}#quick-panel md-content md-tabs{position:static;height:100%}#quick-panel md-content md-tabs md-tabs-wrapper{background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.06)}#quick-panel md-content md-tabs md-tabs-wrapper .md-tab{max-width:none!important}#quick-panel md-content md-tabs md-tabs-content-wrapper md-tab-content{height:100%;overflow:hidden}#quick-panel md-content md-tabs md-tabs-content-wrapper md-tab-content>div{overflow:hidden;height:100%}.unread-message-count-chat{position:absolute;top:5px;left:10px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:10px}@media screen and (max-width:600px){#quick-panel{width:80%;min-width:80%;max-width:80%}}#quick-panel .activity-tab .friends .friend{position:relative}#quick-panel .activity-tab .friends .friend .status{position:absolute;top:8px;left:44px;width:18px;height:18px;z-index:10;border-radius:50%;border:3px solid #fff}#quick-panel .activity-tab .friends .friend .status.online{background-color:#00c853}#quick-panel .activity-tab .friends .friend .status.offline{background-color:#d50000}#quick-panel .activity-tab .friends .friend .status.away{background-color:#ff6d00}#quick-panel .activity-tab .friends .friend .unread-message-count{position:absolute;left:16px;bottom:16px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:11px}#quick-panel .activity-tab .servers .server .status{margin:24px 20px 28px 8px}#quick-panel .activity-tab .servers .server .status.normal{color:#00c853}#quick-panel .activity-tab .servers .server .status.warn{color:#d50000}#quick-panel .activity-tab .servers .server .status.error{color:#ff6d00}#quick-panel .activity-tab .stat md-progress-linear.normal .md-bar{background-color:#00c853}#quick-panel .activity-tab .stat md-progress-linear.normal .md-container{background-color:rgba(0,200,83,.3)}#quick-panel .activity-tab .stat md-progress-linear.warn .md-bar{background-color:#ff6d00}#quick-panel .activity-tab .stat md-progress-linear.warn .md-container{background-color:rgba(255,109,0,.3)}#quick-panel .activity-tab .stat md-progress-linear.alert .md-bar{background-color:#d50000}#quick-panel .activity-tab .stat md-progress-linear.alert .md-container{background-color:rgba(213,0,0,.3)}#quick-panel .chat-tab .chat,#quick-panel .chat-tab .main{position:absolute;width:100%;top:0;bottom:0}#quick-panel .chat-tab .main .contact{position:relative}#quick-panel .chat-tab .main .contact .status{position:absolute;top:8px;left:44px;width:18px;height:18px;border:3px solid #fff;border-radius:50%;z-index:10}#quick-panel .chat-tab .main .contact .status.online{background-color:#00c853}#quick-panel .chat-tab .main .contact .status.offline{background-color:#d50000}#quick-panel .chat-tab .main .contact .status.away{background-color:#ff6d00}#quick-panel .chat-tab .main .contact .unread-message-count{position:absolute;left:16px;bottom:16px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:11px}#quick-panel .chat-tab .main .recent .contact .status{top:18px}#quick-panel .chat-tab .chat{max-height:100%;overflow:hidden}#quick-panel .chat-tab .chat .message-row .bubble{position:relative;padding:8px;background-color:#eceff1;border:1px solid #dcdfe1}#quick-panel .chat-tab .chat .message-row .bubble:after,#quick-panel .chat-tab .chat .message-row .bubble:before{content:' ';position:absolute;width:0;height:0}#quick-panel .chat-tab .chat .message-row .bubble:after{left:-7px;right:auto;top:0;bottom:auto;border:11px solid;border-color:#eceff1 transparent transparent transparent}#quick-panel .chat-tab .chat .message-row .bubble:before{left:-9px;right:auto;top:-1px;bottom:auto;border:8px solid;border-color:#dcdfe1 transparent transparent transparent}#quick-panel .chat-tab .chat .message-row .bubble .time{font-size:11px;margin-top:8px}#quick-panel .chat-tab .chat .message-row .bubble .message{word-wrap:break-word}#quick-panel .chat-tab .chat .message-row.contact .avatar{margin:0 16px 0 0}#quick-panel .chat-tab .chat .message-row.user{align-items:flex-end}#quick-panel .chat-tab .chat .message-row.user .avatar{order:2;margin:0 0 0 16px}#quick-panel .chat-tab .chat .message-row.user .bubble{background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#quick-panel .chat-tab .chat .message-row.user .bubble:after{right:-7px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#quick-panel .chat-tab .chat .message-row.user .bubble:before{right:-9px;left:auto;top:auto;bottom:-1px;border-color:transparent transparent #dfebe0 transparent}#quick-panel .chat-tab .chat .reply{border-top:1px solid rgba(0,0,0,.12)}#quick-panel .chat-tab .chat .reply textarea{margin:8px;resize:none;padding:8px 16px 8px 8px}md-dialog.group-dialog{max-width:720px;width:720px}md-dialog.group-dialog md-dialog-content{display:block;position:relative}md-dialog.group-dialog md-toolbar .title{font-size:17px}md-dialog.group-dialog md-input-container textarea{min-height:150px}md-dialog.group-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.group-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.group-dialog .date-container{padding:16px 0 24px 0}md-dialog.group-dialog .error-list{font-size:13px}md-dialog.group-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.group-dialog .error-list .error .message{font-weight:500}md-dialog.group-dialog .error-list .error .md-button{margin:0}md-dialog.group-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.group-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#quick-panel .group-tab .chat,#quick-panel .group-tab .main{position:absolute;width:100%;top:0;bottom:0}#quick-panel .group-tab .main .contact{position:relative}#quick-panel .group-tab .main .contact .status{position:absolute;top:8px;left:44px;width:18px;height:18px;border:3px solid #fff;border-radius:50%;z-index:10}#quick-panel .group-tab .main .contact .status.online{background-color:#00c853}#quick-panel .group-tab .main .contact .status.offline{background-color:#d50000}#quick-panel .group-tab .main .contact .status.away{background-color:#ff6d00}#quick-panel .group-tab .main .contact .unread-message-count{position:absolute;left:16px;bottom:16px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:11px}#quick-panel .group-tab .main .recent .contact .status{top:18px}#quick-panel .group-tab .chat{max-height:100%;overflow:hidden}#quick-panel .group-tab .chat .message-row{padding:8px}#quick-panel .group-tab .chat .message-row .bubble{position:relative;padding:8px;background-color:#eceff1;border:1px solid #dcdfe1}#quick-panel .group-tab .chat .message-row .bubble:after,#quick-panel .group-tab .chat .message-row .bubble:before{content:' ';position:absolute;width:0;height:0}#quick-panel .group-tab .chat .message-row .bubble:after{left:-7px;right:auto;top:0;bottom:auto;border:11px solid;border-color:#eceff1 transparent transparent transparent}#quick-panel .group-tab .chat .message-row .bubble:before{left:-9px;right:auto;top:-1px;bottom:auto;border:8px solid;border-color:#dcdfe1 transparent transparent transparent}#quick-panel .group-tab .chat .message-row .bubble .time{font-size:11px;margin-top:8px}#quick-panel .group-tab .chat .message-row .bubble .message{word-wrap:break-word}#quick-panel .group-tab .chat .message-row.contact .avatar{margin:0 16px 0 0}#quick-panel .group-tab .chat .message-row.user{align-items:flex-end}#quick-panel .group-tab .chat .message-row.user .avatar{order:2;margin:0 0 0 16px}#quick-panel .group-tab .chat .message-row.user .bubble{background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#quick-panel .group-tab .chat .message-row.user .bubble:after{right:-7px;left:auto;top:auto;bottom:0;border-color:transparent transparent #e8f5e9 transparent}#quick-panel .group-tab .chat .message-row.user .bubble:before{right:-9px;left:auto;top:auto;bottom:-1px;border-color:transparent transparent #dfebe0 transparent}#quick-panel .group-tab .chat .reply{border-top:1px solid rgba(0,0,0,.12)}#quick-panel .group-tab .chat .reply textarea{margin:8px;resize:none;padding:8px 16px 8px 8px}md-dialog.group-dialog{max-width:720px;width:720px}md-dialog.group-dialog md-dialog-content{display:block;position:relative}md-dialog.group-dialog md-toolbar .title{font-size:17px}md-dialog.group-dialog md-input-container textarea{min-height:150px}md-dialog.group-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.group-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.group-dialog .date-container{padding:16px 0 24px 0}md-dialog.group-dialog .error-list{font-size:13px}md-dialog.group-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.group-dialog .error-list .error .message{font-weight:500}md-dialog.group-dialog .error-list .error .md-button{margin:0}md-dialog.group-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.group-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#reset-password{height:100%;background:url(/assets/images/backgrounds/tech.png) no-repeat;background-size:cover}#reset-password #reset-password-form-wrapper{flex:1 0 auto;padding:32px}#reset-password #reset-password-form-wrapper #reset-password-form{width:384px;max-width:384px;padding:32px;text-align:center;background:#fff}#reset-password #reset-password-form-wrapper #reset-password-form .logo{width:128px;height:128px;line-height:128px;font-size:86px;font-weight:500;margin:32px auto;color:#fff;border-radius:2px}#reset-password #reset-password-form-wrapper #reset-password-form .title{font-size:17px;margin:16px 0 32px 0}#reset-password #reset-password-form-wrapper #reset-password-form .logo_login{max-height:200px}#reset-password #reset-password-form-wrapper #reset-password-form form{width:100%;text-align:left}#reset-password #reset-password-form-wrapper #reset-password-form form .submit-button{width:220px;margin:16px auto;display:block}#reset-password #reset-password-form-wrapper #reset-password-form .login{margin:32px auto 24px auto;width:250px;font-weight:500}#reset-password #reset-password-form-wrapper #reset-password-form .login .text{margin-right:8px}@media screen and (max-width:600px){#reset-password #reset-password-form-wrapper{padding:16px}#reset-password #reset-password-form-wrapper #reset-password-form{padding:24px;width:100%}#reset-password #reset-password-form-wrapper #reset-password-form form .md-button{width:90%}}md-dialog.preview-dialog{max-width:1020px;width:1020px}md-dialog.preview-dialog md-dialog-content{display:block;position:relative;padding:0}md-dialog.preview-dialog md-dialog-content .recall-me-info{position:relative;overflow-y:hidden;overflow-x:auto;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.12);min-height:64px;padding:8px 8px 8px 16px}md-dialog.preview-dialog md-toolbar .title{font-size:17px}md-dialog.preview-dialog md-input-container textarea{min-height:150px}md-dialog.preview-dialog md-input-container .hint{font-size:10px;line-height:20px;transition:all .3s cubic-bezier(.55,0,.55,.2);color:rgba(0,0,0,.54)}md-dialog.preview-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.preview-dialog .date-container{padding:16px 0 24px 0}md-dialog.preview-dialog .error-list{font-size:13px}md-dialog.preview-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.preview-dialog .error-list .error .message{font-weight:500}md-dialog.preview-dialog .error-list .error .md-button{margin:0}md-dialog.preview-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.preview-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@media screen and (max-width:1280px){md-dialog.task-dialog{width:80%}}@media screen and (max-width:960px){md-dialog.task-dialog{width:90%}}#toolbar{width:100%;height:64px;min-height:64px;max-height:64px;z-index:55!important}#toolbar .blink{animation:blinker 2s linear infinite}#toolbar #navigation-toggle{width:64px;min-width:64px;height:64px;margin:0;border-right:1px solid rgba(0,0,0,.12);border-radius:0}#toolbar .logo-image{display:block;width:32px;min-width:32px;height:32px;line-height:32px;text-align:center;font-size:16px;font-weight:500;color:#fff;border-radius:2px;margin-left:10px;margin-right:8px}#toolbar #user-menu{height:64px;padding:0}#toolbar #user-menu md-menu-item .md-button{font-size:15px}#toolbar #user-menu md-menu-item .md-button md-icon{margin:auto 16px auto 0}#toolbar #user-menu .user-button{margin:0;padding:0 16px;height:64px;text-transform:none}#toolbar #user-menu .user-button .avatar-wrapper{position:relative}#toolbar #user-menu .user-button .avatar-wrapper .status{position:absolute;bottom:-3px;right:5px}#toolbar #user-menu .user-button .username{margin:0 12px 0 8px}#toolbar #language-menu{height:64px}#toolbar #language-menu .language-button{min-width:64px;height:64px;margin:0;padding:0 16px;border-radius:0}#toolbar #language-menu .language-button .iso{text-transform:uppercase}#toolbar #language-menu .language-button .flag{margin-right:8px}#toolbar #quick-panel-toggle{width:64px;height:64px;margin:0;border-radius:0}#toolbar #quick-panel-toggle .unread-message-count{position:absolute;top:8px;left:38px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:10px}#toolbar .toolbar-separator{height:64px;width:1px;background:rgba(0,0,0,.12)}#language-menu-content md-menu-item .flag{margin-right:16px}#language-message{min-height:88px;max-width:600px}#language-message .md-toast-content{height:90px}.open-contact-count{position:absolute;top:1px;left:25px;width:18px;height:18px;z-index:10;border-radius:50%;text-align:center;line-height:18px;font-size:10px}.md-button.preview-button{min-width:46px;min-height:50px}@media screen and (max-width:600px){#toolbar #user-menu .user-button{min-width:64px;padding:0 2px 0 10px}}.geEditor{font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;font-size:10pt;overflow:hidden;height:100%}.geMenubarContainer .geItem,.geSidebarContainer .geTitle,.geToolbar .geButton,.geToolbar .geLabel{cursor:pointer!important}.geContentEditable div,.geContentEditable table,.geContentEditable table td{border:1px dashed #d3d3d3}.geBackgroundPage{-webkit-box-shadow:0 0 3px 0 #d9d9d9;-moz-box-shadow:0 0 3px 0 #d9d9d9;box-shadow:0 0 3px 0 #d9d9d9}.geMenubarContainer a,.geSidebarContainer a,.geToolbar a{color:#000!important;text-decoration:none}.geDiagramContainer,.geFooterContainer,.geHsplit,.geMenubarContainer,.geOutlineContainer,.geSidebarContainer,.geToolbarContainer,.geVsplit{overflow:hidden;position:absolute;cursor:default}.geDiagramContainer,.geOutlineContainer{background-color:#fff;outline:0}.geMenubar,.geToolbar{white-space:nowrap;display:block;width:100%}.geMenubarContainer .geItem,.geSidebar,.geSidebar .geItem,.geSidebarContainer .geTitle,.geToolbar .geButton,.geToolbar .geLabel,.mxPopupMenuItem{-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;-ms-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.geHint{background-color:#fff;border:1px solid gray;padding:4px 16px 4px 16px;border-radius:3px;-webkit-box-shadow:1px 1px 2px 0 #ddd;-moz-box-shadow:1px 1px 2px 0 #ddd;box-shadow:1px 1px 2px 0 #ddd;opacity:.8}.geStatusAlert{white-space:nowrap;margin-top:-5px;font-size:12px;padding:4px 6px 4px 6px;background-color:#f2dede;border:1px solid #ebccd1;color:#a94442!important;border-radius:3px}.geStatusAlert:hover{background-color:#f1d8d8;border-color:#d6b2b8}.geStatusMessage{white-space:nowrap;margin-top:-5px;padding:4px 6px 4px 6px;font-size:12px;background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;border:1px solid #b2dba1;border-radius:3px;color:#3c763d!important}.geStatusMessage:hover{background:#c8e5bc;border-color:#b2dba1}.geAlert{position:absolute;white-space:nowrap;padding:14px;background-color:#f2dede;border:1px solid #ebccd1;color:#a94442;border-radius:3px;-webkit-box-shadow:2px 2px 3px 0 #ddd;-moz-box-shadow:2px 2px 3px 0 #ddd;box-shadow:2px 2px 3px 0 #ddd}.geBtn{background-color:#f5f5f5;border-radius:2px;border:1px solid #d8d8d8;color:#333;cursor:default;font-size:11px;font-weight:700;height:29px;line-height:27px;margin:0 0 0 8px;min-width:72px;outline:0;padding:0 8px;cursor:pointer}.geBtn:hover{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border:1px solid #c6c6c6;background-color:#f8f8f8;background-image:linear-gradient(#f8f8f8 0,#f1f1f1 100%);color:#111}.geBtn:disabled{opacity:.5}.geBtnUp{background-image:url(data:image/gif;base64,R0lGODlhCgAGAJECAGZmZtXV1f///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0QzM3ODJERjg4NUQxMUU0OTFEQ0E2MzRGQzcwNUY3NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0QzM3ODJFMDg4NUQxMUU0OTFEQ0E2MzRGQzcwNUY3NCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRDMzc4MkREODg1RDExRTQ5MURDQTYzNEZDNzA1Rjc0IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRDMzc4MkRFODg1RDExRTQ5MURDQTYzNEZDNzA1Rjc0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAgAsAAAAAAoABgAAAg6UjwiQBhGYglCKhXFLBQA7);background-position:center center;background-repeat:no-repeat}.geBtnUp:active{background-color:#4d90fe;background-image:linear-gradient(#4d90fe 0,#357ae8 100%)}.geBtnDown{background-image:url(data:image/gif;base64,R0lGODlhCgAGAJECANXV1WZmZv///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0QzM3ODJEQjg4NUQxMUU0OTFEQ0E2MzRGQzcwNUY3NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0QzM3ODJEQzg4NUQxMUU0OTFEQ0E2MzRGQzcwNUY3NCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRDMzc4MkQ5ODg1RDExRTQ5MURDQTYzNEZDNzA1Rjc0IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRDMzc4MkRBODg1RDExRTQ5MURDQTYzNEZDNzA1Rjc0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAgAsAAAAAAoABgAAAg6UjxLLewEiCAnOZBzeBQA7);background-position:center center;background-repeat:no-repeat}.geBtnDown:active{background-color:#4d90fe;background-image:linear-gradient(#4d90fe 0,#357ae8 100%)}.geColorBtn{background-color:#f5f5f5;background-image:linear-gradient(#f5f5f5 0,#e1e1e1 100%);border-radius:4px;border:1px solid rgba(0,0,0,.5);color:#333;cursor:default;margin:0;outline:0;padding:0;cursor:pointer}.geColorBtn:hover{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.7)}.geColorBtn:active{background-color:#4d90fe;background-image:linear-gradient(#4d90fe 0,#357ae8 100%);border:1px solid #2f5bb7;color:#fff}.geColorBtn:disabled{opacity:.5}.gePrimaryBtn{background-color:#4d90fe;background-image:linear-gradient(#4d90fe 0,#4787ed 100%);border:1px solid #3079ed;color:#fff}.gePrimaryBtn:hover{background-color:#357ae8;background-image:linear-gradient(#4d90fe 0,#357ae8 100%);border:1px solid #2f5bb7;color:#fff}.gePrimaryBtn:disabled{opacity:.5}.geAlertLink{color:#843534;font-weight:700;text-decoration:none}.geMenubarContainer{background-color:#fff}.geMenubar{padding:0 2px 0 2px;vertical-align:middle}.geMenubarContainer .geItem,.geToolbar .geItem{padding:6px 8px 6px 8px;cursor:default}.geMenubarContainer .geItem:hover,.geToolbarContainer .geItem:hover{background:#eee}.mxDisabled:hover{background:inherit!important}.geMenubar a.geStatus{color:#b3b3b3;padding-left:6px;display:inline-block;cursor:default!important}.geMenubar a.geStatus:hover{background:0 0}.geMenubarMenu{border:1px solid #d5d5d5!important}.geToolbarContainer{background:#f5f5f5;border-bottom:1px solid #e0e0e0}.geSidebarContainer .geToolbarContainer{background:0 0;border-bottom:none}.geSidebarContainer button{text-overflow:ellipsis;overflow:hidden}.geToolbar{padding:1px 0 0 6px;border-top:1px solid #e0e0e0;-webkit-box-shadow:inset 0 1px 0 0 #fff;-moz-box-shadow:inset 0 1px 0 0 #fff;box-shadow:inset 0 1px 0 0 #fff}.geToolbarContainer .geSeparator{float:left;width:1px;height:34px;background:#e5e5e5;margin-left:6px;margin-right:6px;margin-top:-2px}.geToolbarContainer .geButton{float:left;width:20px;height:20px;padding:0 2px 4px 2px;margin:2px;border:1px solid transparent;cursor:pointer;opacity:.6}.geToolbarContainer .geButton:hover{border:1px solid gray;border-radius:2px;opacity:1;filter:none!important}.geToolbarContainer .geButton:active{border:1px solid #000}div.mxWindow .geButton{margin:-1px 2px 2px 2px;padding:1px 2px 2px 1px}.geToolbarContainer .geLabel{float:left;margin:2px;cursor:pointer;padding:3px 5px 3px 5px;border:1px solid transparent;opacity:.6}.geToolbarContainer .geLabel:hover{border:1px solid gray;border-radius:2px;opacity:.9}.geToolbarContainer .geLabel:active{border:1px solid #000;opacity:1;filter:none!important}.geToolbarContainer .mxDisabled:hover{border:1px solid transparent!important;opacity:.2!important}.geToolbarMenu{border:3px solid #e0e0e0!important;-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;filter:none!important}.geDiagramBackdrop{background-color:#ebebeb;border-style:solid;border-color:#e5e5e5;border-width:1px 0 0 1px}.geSidebarContainer{background:#fff;overflow:hidden;position:absolute;border-top:1px solid #e5e5e5;overflow:auto}.geSidebar{background:#f5f5f5;border-bottom:1px solid #e5e5e5;padding:5px;padding-bottom:12px;overflow:hidden}.geSidebarContainer .geTitle{display:block;font-size:9pt;border-bottom:1px solid #e5e5e5;font-weight:400;padding:6px 0 6px 14px;margin:0;cursor:default;background:#eee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4em}.geSidebarContainer .geTitle:hover{background:#e5e5e5}.geTitle img{opacity:.5}.geTitle img:hover{opacity:1}.geSidebar .geItem{display:inline-block;background-repeat:no-repeat;background-position:50% 50%;border:1px solid transparent;border-radius:2px;cursor:move}.geSidebar .geItem:hover{border:1px solid gray!important}.geItem{vertical-align:top;display:inline-block}.geSidebarTooltip{position:absolute;background:#fff;overflow:hidden;border:1px solid gray;border-radius:8px;-webkit-box-shadow:0 0 2px 2px #d5d5d5;-moz-box-shadow:0 0 2px 2px #d5d5d5;box-shadow:0 0 2px 2px #d5d5d5}.geFooterContainer{background:#e5e5e5;border-top:1px solid silver}.geFooterContainer a{font-size:14px;color:#235695;font-weight:700;text-decoration:none}.geFooterContainer table{border-collapse:collapse;margin:0 auto}.geFooterContainer td{border-left:1px solid silver;border-right:1px solid silver}.geFooterContainer td:hover{background-color:#b3b3b3}.geFooterContainer a{display:block;box-sizing:border-box;width:100%;height:100%;padding:11px 42px 11px 42px;white-space:nowrap}.geHsplit{cursor:col-resize;background-color:#e5e5e5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAHBAMAAADdS/HjAAAAGFBMVEUzMzP///9tbW1QUFCKiopBQUF8fHxfX1/IXlmXAAAAHUlEQVQImWMQEGAQFWUQFmYQF2cQEmIQE2MQEQEACy4BF67hpEwAAAAASUVORK5CYII=);background-repeat:no-repeat;background-position:center center}.geVsplit{font-size:1pt;cursor:row-resize;background-color:#e5e5e5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAEBAMAAACw6DhOAAAAGFBMVEUzMzP///9tbW1QUFCKiopBQUF8fHxfX1/IXlmXAAAAFElEQVQImWNgNVdzYBAUFBRggLMAEzYBy29kEPgAAAAASUVORK5CYII=);background-repeat:no-repeat;background-position:center center}.geHsplit:hover,.geVsplit:hover{background-color:#d5d5d5}.geDialog{position:absolute;background:#fff;overflow:hidden;padding:30px;border:1px solid #acacac;-webkit-box-shadow:0 0 2px 2px #d5d5d5;-moz-box-shadow:0 0 2px 2px #d5d5d5;box-shadow:0 0 2px 2px #d5d5d5;z-index:2}.geDialogClose{position:absolute;width:9px;height:9px;opacity:.5;cursor:pointer}.geDialogClose:hover{opacity:1}.geDialogTitle{box-sizing:border-box;white-space:nowrap;background:#e5e5e5;border-bottom:1px solid silver;font-size:15px;font-weight:700;text-align:center;color:#235695}.geDialogFooter{background:#f5f5f5;white-space:nowrap;text-align:right;box-sizing:border-box;border-top:1px solid #e5e5e5;color:#a9a9a9}.geSprite{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAk/CAYAAACauMYVAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAAWn0lEQVR4Ae2dW4gdxdbHO0aJYjzxTtR4EhSDSNB84kPEQOL9CB/Ex4igg8iAGCSgiIIQH1SOqJAnn4N4wBdvYBRBcYTIp0+OF0SDYoJRgyAmeA1e5lv/PrM6q6urqqu7a2/3ZP4NPVVdtda/Vv2qZ9Nrd++9i2IE2xJoHn/88XOq/ccff5RtepxSuv7HqxPE0GkNtC+lVH/YjiTSKoi+EaqA9T9OG3OW4xNdu3btHPZY9DGbRqRtYhiozaYhunfvXu95aoVCNjqzhqh2uGWbkLVPFrWRWgFfvSFqnW3dOtt2W7c2Zd2evI3OhAbr34g0wb/VZOGIjuRVagG+nrYuKQ1IgARIgARIgARIgARIoEbAm93BwmYb1mP58uXFoUOHgn6wTUok8K4Ddgj+9NNPxamnnhpNhpNENdL169eXVQj32jB93VUAEaJNxKORBtmEmGIAoNCBfGXS9C1TiLRF6huobNOp24g3b97cQBIU8HX4RJVp2+oH2dgI7aAp56m1Z50ESIAESIAESIAESIAESGCREtBMJXX6SclZqpjaUVRJ5CuPEabI623ii3rvXN/SVeFsgioO4SwRquDElNU7E3ZB+kTX9g5QH036kAAJkAAJkAAJkAAJkMDEEqiupBFh36vpsVxF1yJVnqkRjyVCDaoWaWqE6qzlWCKuRaojp0Y8lgg1qFqkqRGqs5ZjibgWqY6cGvFYItSgWJIACZAACZAACZAACZDAJBHwXknbAENX1bGr6IZoSMQO5KvbQUZyi9M36OC2xvRVMRWDnbb6jmT6FFW8+UoyzcdSlUbCVMVZkgAJkAAJkAAJkAAJTCqB1Pypc/yu8Jo1a6KfhE0eAMI7duyYS/04aJIwBCGsUeL507bPmbYKQwCCFsUgYQjaJ2MHC7uCvim1RVxLzSHY5YPUq1atKvbt21fTQBC9sxN8ltcnCNHGKCnR2g8HP/TQQ+U5/Mgjj1RajUjxiXc4hTYrCJtff/213K19pW4bUfdF7Aree++9tf+0p556qtRrRKribsSuoNr1KhEx9pAzonUjDtmynQRIgARIgARIgARIgASOGQLlNbrN6Hy3LNtm6/ovwC+qtVNom66v3/p7Ux4YuLsrZLNst686tiO5grZPHdCmbzCgzdp4I1VHX6kDou/AgQOFFW7Y25HU0ZauA/ps0mb9O0eq4uvWrWv9OrgaE3XsUmaJNDZgdPp29JiI2xcVdY1Tj72iOLE1SpRJJ7pvRBXRPpwuaLOnjfb5Ste/tPE1Rk9sR9n68/XUgcNDEiABEiABEiABEjgmCTTunMkl4Z65ublVbbM97rjj3v3999+3+uyqLFo7Ifjqq6+ulq1YsqQxJr6huXj77beLe+65Z5/6uGVDFAZysVtcdNFFXlGJrpDfPSp13nrrLczouauvvnpj2TD/x3vNjz5flOooUy8uvPDCDV9//fX/yb3ADc8///we7UMZFEXnn3/+WbzwwgvF559/XiBCbCeccEJx/fXXF4899tiyxx9/fNXpp5++VO4K19bAO/3SW/4goquuuqp4+OGHi08//bQ8vuyyy4rbb7+9ePTRR4svvvjioAyy9a+//jqiPt5y6dKl+z777DNZr6Pb+++/P3fHHXfMSd/cGWecMXf55Zcjc3lfBDZ4RdxGnyjkZ2Zm5q655ppSGOIiOuP66nGUKYx++eWX4pVXXilXfGpqqnjppZcKuZNbyDjrzzvvvJk33njjORXTMioqrIoPPvigPDdxmm3cuLG49tpri5tvvrm47bbbVkj/pp9//vlfL7744nYVRBldKBgsW7asEIbFWWedVZx00kkFBvrtt9/QVZ520r/ihx9+gOjOslH+REWx+hC0G04zWcjimWee2X/OOefsWrFiRfHtt98esjZeUTji39H3D4B29EvfPnkP5eErr7zS6pV1r+h7771XfPXVV0HRjz76qCFkGxqvGHIyPycru9Ia+eoS6az8l9UWyGfHNhIgARIgARIgARIgARLoQKBxfer6fvLJJ899/PHHZb506aWXvnvxxRdvdW3c48aV9O7du/eIUZUW3nXXXStvvPHGZbhUf/rpp1dK/z4VQUp5ySWXHJAHhuMJ75133rlKcqfVJ5988mpJJFYfPnx42ZNPPlk88cQTuPu4DG3og83999+/WjKTKgAdrJFHfffdd8Xs7OxWcd4sD//Ofvnll4UIlzvqDz74YCGPkIvJ7Nbvv/++TCpULFgijZTO1TK1nVI/hJTR3edTyNXnn3/+nIjDvrY1mGqvJAm7pP6iHjvlYee4dhgUffPNN9dLzrQG1sjyZJu56aabZlCZ31ZrxS2DoiI0Jcab4IDMT7bNr7/++gwqSMxuuOGGt1D3bY2F8hnNt22S/Goq0l91BSOtLI5W3paId0mEu+abuk8fGR1OeIlOme4Spip4dChPLRjpdddd1ztF7MLUE5O/aSSioek3/p89MZU2YO5uDVFZnAPyb/kf19B3LIL7pf2Ar49tJEACJEACJEACJEAC/Qh4c1O5sfWhXHz9MyK5Rx51/N9Qf+OqD4abNm36hxQrQk5XXHHFvyQz/PDss8++1GfjFf3xxx+RHm595513tp944ollBq3Octfs3YMHD+6US87/iPAeEd6ofVp6Rec7D956662N+6FHjhz5Hxl055lnnrlUbnduEFR75F5qTTgmWj5d/OyzzxYbNtSCXSaDrsSTx7fccstSYd+46o6KIuKVK1cWuIPeZWsVhZjcyC6++eYbPExcyLQLyZ6jYySJ4pamvFlQ3vPDImKXvCAo3CnlQSaCtzgQKcrQ1kkU2TQ+y3vKKafkiRR5KkSBAnxjWzDSBx54YEpuYJfLftpppxUXXHBBsWbNmkLOzZhe2ecVlYh2Crf9El352iBPG+BxhlIY4ueee24lLJxXvPbaaw9UDVLxrr68f7Lz7rvvxim0Wd548Z6k8q9a6sg7GKdKBaL/Lhvkj1dUOyXQ2fvuu08PG6Xc4C5PM7Hr+ZvkDUk2kAAJkAAJkAAJkAAJkAAJLFYC3vdQXBiS+jRvj4mR3AFO8nf1quPt27d3+qho5RirINpQxK6fN410jTZv3lxOH19Rlm3rEiUGbY1UMucySjzNnW3rGmVrpPqh4G3btnUK0nuehVZ58HnZKTQakwAJkAAJkAAJkAAJkAAJZCBQu+YPXeu3jTOWXKBXpGOJzMXTK1JXZCyR94p0LJG5OHpF6oqMJfJekY4lMhcHj0mABEiABEiABEiABEhgnkDXe1Ktd876kKVomJr9ZmFYYcF6f7uwHUaFswmqOISzRKiCE1NWGV/f9090JsdwFph99bOfp1ZQX/6yna8qqCvdVvKlr40Q+0mABEiABEiABEiABBY8gSqP8s2kLbcK5U4juZL2BTi4rTH9timHRrQoBk3fCtnBBomGZjVI1EZn69EPBsMwNMVQlPAZSaQQDm6xaGJ9I4m0lWksouAU2UECJEACJEACJEACJEACJEACWQnITzuVP5mLDEX3Qff4VCRUWnHYtM4GRvpZaDXGJ7j1B391IHusdt5SPwzs7ZRGDKaitgzZF4gm2Gk65JeuGsKmu55F4wemUjb50a+oWeM9lKi1dAKP/Fhawyz0vkDDkA0kQAIkQAIkQAIkQAIkQAILnkAtkUBe1GdGY0kiapG6UaZGPv5IUyNzZzT+SN0IUiMff6SpkbkzGn+kbgSpkY8lUjc4HpMACZAACZAACZAACZAACaQQaOSmqdf5Vty95h/vQ63u6DYyrYdmlSXS6enpOew6WBZRFdOSokoiXxl8Tjp0uqQMPZKFakRqT3p77qVEqDYjiVTFWZIACZAACZAACZAACZDARBKQa/0P5XeLD0lwbT8Z9E/Ywd6dSONKWn5XV38qO/yLyP9VQQa+Yt6+ptsQrfX2PFjkoo08SjHKyk7JzwtfrceeEovkaY5/2nhKnFb7vNAu+3ZfH9qCkaJTfjB9lxSHZcdT2ftl3yc7tk2YCSq+rXX15eTeKQIzUk75BHxtraI+p7a2hqgszgFx+lMd5Ri/Nr1fSvzrJm0NppJFb5Sp7pGFwI+aHZFfud4KJeFrBfEb8mCMH6FGENxIgARIgARIgARIgARIYHERQNJabnL17E+K1KCltPexWkwXWjc+WWw/XTw4foiBN/YswlYwqzCmqoKp025kfKmOMTuKxuj061s4TPvNj14kQAIkQAIkQAIkQAIkQAIBAqEsL9RuZRZOIsFI7bodra9ahdumRbFjx47qXSCta99R63qtegup3vzfI5w+vva2t4uiCwVnGxXqbYK+ILK0eacfmrY74t8WtRsIj0mABEiABEiABEiABEiABBYBAffWMb6lGd/dnTx1+63Xrpi+eWDLJGE4QBi7dcax+63Y+rXarcJWSOvuF4C7InZ2bl95rEJa4ru4vYZOozuLaMLb9l3cqu1+t3ctN0WEaqjl8uXLi0OHDtXstI8lCZAACZAACZAACZAACZAACTQIuFkfjhtGnoZg1uHLVNS/7Y6ZN49SwW3btpU3CiGCHcfYtF8HaS11yjaLW7t2bTVttEM0FUU5IBzcSKwojHw2NtoGUxXEdF0xOO7du3eJtbFiwbovClfcZ2MFGwu1bt26st8ytQ7arna2L1rXSFRAjXWRdPranlyqcKjstPp2VD29VFiFtF2Prc+g+tiFG6vfJfzZ2dklOAsk6i5utCUBEiABEiABEiABEiCBySGgl+DuNX9bhI2MTx0gpHW3nNws2kaqCVqndEf5WSG33mbT+H4pK+AmuuhDFm1tkuptUUCkzaaRR2l27Ca7GpG2q522t5YaiQqogy4S+rWtU6nCobLT6tuRQ/9R2t5b2A5i62MXbqy+jaatziy6jRD7SYAESIAESIAESOBYJtA9ffHQsDkAUsxoHmX9raNt13opNp9gJIvCOZToarKhAySXbZFaoUGX51bI1ilqaeSpk2kejlZlkTMtX6Xsi0Xolcgya6tXL336emgHaHMO9Zev/FYoR6ShwdhOAiRAAiRAAiRAAscYgZFk0dmupO2FXTZRe+WYbTWtaLZIbXQUtTTy1KvsxK5eHmlRySnK1c+2LJXQSJiOJDetIrWvh9U8elYq0Zznac9Y6EYCJEACJEACJEACC43AIsqid+/eXT41m+2qEYIQU+HBa0/BwQgLMiTDHgSynjZ4UdA924uDvmxp2WOSNRdm0TUcPCABEiABEiABEiCBTgQmK4vWa1m9Uhx870UF9VpWr211gE6s1BjOKqhtg0qNcpCI68woXSL9jnVxsq44F6ffYvi8Jo8lItIdEWc5hSAIMRVGOeScHMldcwTIjQRIgARIgARIgAQWAYHJyqJd4DaLru6duEZdj/VytKtf1N6KZovUjkhRSyNPnUzzcLQqi5wpPxdtTwbWSYAESIAESIAESOBYJTCSLLr6vGlXajYXhS+yaG0bdHkOIU3JVbBrcDX7mMigSGujmAOKGhiZqsHzNLa6vcceIsrV74096DgSpiPJoqtI7UvYkNMJTHgvOnhmsIMESIAESIAESIAESIAESCBEoPYW0tCsRDOc0GBsJwESIAESIAESIAESIAESIAESmFQCyAiHfGYyOC8Ij0RchbOLW2FXfLKy6FikwQWJdVjBLGeDCmYRQ+TugsRmwz4SIAESIAESIAESIAESIAESGD2B7GmPhnxsCE9WFj0yttkXa/IFlSVLEiABEiABEiABEiABEiABEuhEIHu6g9FVFGXWu5LZha2g1m3Ek5NFa3S2tJF2WnU1tmKoDxYc+epniVCnz5IESIAESIAESIAESIAESIAEJoMAUh2boA1OfVxBFbfCtYQ3hQNEQnb6Eebat4vFHEJCvvaRRFp9v5RvRF/byy+/7GsuQu1eY1+ju1h2kXz2bCMBEiABEiABEiABEiABEiCBBUYglh12zvgwdyuo+ahl0lnUCqqQK9xJ1CfoE66JxpzUOVZqxDXRmAP6YoOqIOw6iYaErWAvUVfYFUR/7y2GorcoHUmABEiABEiABEiABEiABEjg7yNg70IOvgNpxZA/2d0n3ppGpiZhNvOriaYKhBZAhWuiPuPUgVQQGq33omEcu8+MPivoCyzaZhfMt0BRZ3aSAAmQAAmQAAmQAAmQAAmQwGQTQKI2klQHwiMRV+Hs4iqoA1gstYQXBl1WVXNS9dPjLho121ikNcPUA52yCqf6Be1U0DIMGqd0ZIssZTDakAAJkAAJkAAJkAAJkAAJkEArgexpD0ZU0awpEMSseJZETUVDwr2zaJsx6yC2DQN22lQETqhjH4xARbMJ2uiyRKiMskaooixJgARIgARIgARIgARIgARIYDIIILvTtMeXS7U+fexOA4L6xDFyUew4HpRGIjJ3IBzb9pF8u5hv0GibjcgahtqtTbAOdtPT0zUEOB7EFKNBAJHpPlgwOAV2kAAJkAAJkAAJkAAJkAAJkMDfQmBQMuaLGIKaS/n6O7epIByzCFtBjaZVGE6xPZQutgprBL6yV6Q+IbfNCg+KMCSMAdy+QcfZBQdFQ2cSIAESIAESIAESIAESIAESyEIAqU5bulN7Tjo2qgrpt2Jt2bKlNO/1bDRutELQl+xqGunenK0Fp1NzS5+gOiYJq7GWfSL9e5hqxFoqGj1mSQIkQAIkQAIkQAIkQAIkQAILmIBmdFmmoGLImwYLWrHBgq7YEMEqNx0iAjzevD9npI01cMUbBkMarPgQHa+vins72UgCJEACJEACJEACJEACJEACIyWgGcnQLLAKcnEJji+LrgDnqGRfJA1q4Qlr5CxJgARIgARIgARIgARIgARIIIlA9rTHCmZJzV3BwaI+wb6i48uiEaHuSSsbM/IhiNkn97nCyY5thla4zZb9JEACJEACJEACJEACJEACJLBACNhUBxkfjgeF7gpqGtlHOCnh9T5YHZlCkmjEv+qyA9e++LuycCrWwenyHlbfe66fIXetQu2uXfDYXaw+ixQUZwcJkAAJkAAJkAAJkAAJkAAJTA4B5KZ9o6nSSCtgBbtme9BpiFpBHaircE3UJ9hHuBKNCapwrLSzqUThEBO2TjFx9NVE0eAT7iLoFXWFuwrCP7j5Ig4as4MESIAESIAESIAESIAESIAEFhYBe2dy8F1JK4Zcyu6p4rU0MjUha8sCK9FUwdAi2oEqURinClsB3yDVvWh0wjh27xl9bYK+Qao2u2CpC1Q5s0ICJEACJEACJEACJEACJEACC4OApj5ZolWx1CwwOqgVGyxoxbQeHT3SWSW8GpXmnnoc8a11qV+tUaODmNZrBkMOVBDiXaNtHdeKtxp3NVDxrn60JwESIAESIAESIAESIAESIIHhBDQjyZZHWcEsolYQ8x0s6goOEQ1m0V1FW7NoCGIbPH2IuAiyiLrC2URdYRxzIwESIAESIAESIAESIAESIIFjgIBNzpBD4bjPtKqnjyGgTxcjz8SO477CZTCh7C7UHptB0heBpQjbLDpJ1DrEImz0gd309HRtYXA8iClGgQCmqvtgwUbobCABEiABEiABEiABEiABEiCBiSCQkuV1ChSCmlN1cgwZqyD6swhbQR10kLBP0BWGTWhX20bpEx4UqY5ghbMIusIYQNuylNkFs0RFERIgARIgARIgARIgARIgARLIRgBpT5/Up3pO2kaiQvqtWFu2bCm7e92Uxc1XCCJ9tIOgrimle8PWtasdxwTVUIUViy3VplHGhFUwJdLRM3VD1+m57TwmgTCB/wdigVA7yGo0NAAAAABJRU5ErkJggg==) no-repeat top left;width:21px;height:21px}.geSprite-actualsize{background-position:0 0}.geSprite-bold{background-position:0 -46px}.geSprite-bottom{background-position:0 -92px}.geSprite-center{background-position:0 -138px}.geSprite-delete{background-position:0 -184px}.geSprite-fillcolor{background-position:0 -230px}.geSprite-fit{background-position:0 -276px}.geSprite-fontcolor{background-position:0 -322px}.geSprite-gradientcolor{background-position:0 -368px}.geSprite-image{background-position:0 -414px}.geSprite-italic{background-position:0 -460px}.geSprite-left{background-position:0 -506px}.geSprite-middle{background-position:0 -552px}.geSprite-print{background-position:0 -598px}.geSprite-redo{background-position:0 -644px}.geSprite-right{background-position:0 -690px}.geSprite-shadow{background-position:0 -736px}.geSprite-strokecolor{background-position:0 -782px}.geSprite-top{background-position:0 -828px}.geSprite-underline{background-position:0 -874px}.geSprite-undo{background-position:0 -920px}.geSprite-zoomin{background-position:0 -966px}.geSprite-zoomout{background-position:0 -1012px}.geSprite-helbow{background-position:0 -1058px}.geSprite-velbow{background-position:0 -1104px}.geSprite-straight{background-position:0 -1150px}.geSprite-entity{background-position:0 -1196px}.geSprite-segment{background-position:0 -1242px}.geSprite-orthogonal{background-position:0 -1288px}.geSprite-noarrow{background-position:0 -1334px}.geSprite-endclassic{background-position:0 -1380px}.geSprite-endopen{background-position:0 -1426px}.geSprite-endblock{background-position:0 -1472px}.geSprite-endoval{background-position:0 -1518px}.geSprite-enddiamond{background-position:0 -1564px}.geSprite-endthindiamond{background-position:0 -1610px}.geSprite-endclassictrans{background-position:0 -1656px}.geSprite-endblocktrans{background-position:0 -1702px}.geSprite-endovaltrans{background-position:0 -1748px}.geSprite-enddiamondtrans{background-position:0 -1794px}.geSprite-endthindiamondtrans{background-position:0 -1840px}.geSprite-startclassic{background-position:0 -1886px}.geSprite-startopen{background-position:0 -1932px}.geSprite-startblock{background-position:0 -1978px}.geSprite-startoval{background-position:0 -2024px}.geSprite-startdiamond{background-position:0 -2070px}.geSprite-startthindiamond{background-position:0 -2116px}.geSprite-startclassictrans{background-position:0 -2162px}.geSprite-startblocktrans{background-position:0 -2208px}.geSprite-startovaltrans{background-position:0 -2254px}.geSprite-startdiamondtrans{background-position:0 -2300px}.geSprite-startthindiamondtrans{background-position:0 -2346px}.geSprite-copy{background-position:0 -410px}.geSprite-cut{background-position:0 -320px}.geSprite-paste{background-position:0 -367px}.geSprite-duplicate{background-position:0 -736px}.geSprite-save{background-position:0 -782px}.geSprite-publish{background-position:0 -92px}.geBaseButton{padding:10px;border-radius:6px;border:1px solid silver;cursor:pointer;background-color:#ececec;background-image:linear-gradient(#ececec 0,#fcfcfc 100%)}.geBaseButton:hover{background:#ececec}.geBigButton{color:#fff;border:none;padding:10px;font-size:14pt;white-space:nowrap;border-radius:6px;text-shadow:#295989 0 1px 0;background-color:#428bca;background-image:linear-gradient(#4687ce 0,#3068a2 100%);-webkit-box-shadow:rgba(255,255,255,.0980392) 0 1px 0 0 inset,rgba(0,0,0,.2) 0 1px 1px 0;-moz-box-shadow:rgba(255,255,255,.0980392) 0 1px 0 0 inset,rgba(0,0,0,.2) 0 1px 1px 0;box-shadow:rgba(255,255,255,.0980392) 0 1px 0 0 inset,rgba(0,0,0,.2) 0 1px 1px 0}.geBigButton:hover{background-color:#2d6ca2;background-image:linear-gradient(#5a94d3 0,#3673b5 100%)}.geBigButton:active{background-color:#3673b5;background-image:none}@media print{div.geNoPrint{display:none!important}}html div.mxRubberband{border-color:#00d;background:#9cf}td.mxPopupMenuIcon div{width:16px;height:16px}html div.mxPopupMenu{-webkit-box-shadow:2px 2px 3px #d5d5d5;-moz-box-shadow:2px 2px 3px #d5d5d5;box-shadow:2px 2px 3px #d5d5d5;background:#fff;position:absolute;border:3px solid #e7e7e7;padding:3px}html table.mxPopupMenu{border-collapse:collapse;margin:0}html td.mxPopupMenuItem{padding:7px 30px 7px 30px;font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;font-size:10pt}html td.mxPopupMenuIcon{background-color:#fff;padding:0}td.mxPopupMenuIcon .geIcon{padding:2px;padding-bottom:4px;margin:2px;border:1px solid transparent;opacity:.5}td.mxPopupMenuIcon .geIcon:hover{border:1px solid gray;border-radius:2px;opacity:1}html tr.mxPopupMenuItemHover{background-color:#eee;color:#000}table.mxPopupMenu hr{color:#ccc;background-color:#ccc;border:none;height:1px}table.mxPopupMenu tr{font-size:4pt}html td.mxWindowTitle{font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;text-align:left;font-size:12px;color:#707070;padding:4px}div.mxTooltip{-webkit-box-shadow:3px 3px 12px silver;-moz-box-shadow:3px 3px 12px silver;box-shadow:3px 3px 12px silver;background:#ffc;border-style:solid;border-width:1px;border-color:#000;font-family:Arial;font-size:8pt;position:absolute;cursor:default;padding:4px;color:#000}body{font-family:Arial Unicode MS,Arial,Helvetica;font-size:10pt}
\ No newline at end of file
index 44827bf..13efbec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f84=['contactManager','integration','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action'];(function(_0x4ce315,_0x388074){var _0x1a6160=function(_0x510e0d){while(--_0x510e0d){_0x4ce315['push'](_0x4ce315['shift']());}};_0x1a6160(++_0x388074);}(_0x1f84,0x1b3));var _0x41f8=function(_0x44bd3a,_0x2d3b79){_0x44bd3a=_0x44bd3a-0x0;var _0x1ed9d6=_0x1f84[_0x44bd3a];return _0x1ed9d6;};'use strict';var Sequelize=require(_0x41f8('0x0'));module[_0x41f8('0x1')]={'name':{'type':Sequelize[_0x41f8('0x2')],'get':function(_0xb4448e){return this[_0x41f8('0x3')](_0x41f8('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x41f8('0x5'),_0x41f8('0x6'),'motionbar',_0x41f8('0x7'),'urlForward',_0x41f8('0x8'),_0x41f8('0x9'),_0x41f8('0xa')]],'msg':_0x41f8('0xb')}},'comment':_0x41f8('0xb')},'data1':{'type':Sequelize[_0x41f8('0xc')](0x1000),'comment':_0x41f8('0xd')},'data2':{'type':Sequelize[_0x41f8('0xc')](0x1000),'comment':_0x41f8('0xe')},'data3':{'type':Sequelize[_0x41f8('0xc')](0x1000),'comment':_0x41f8('0xf')},'data4':{'type':Sequelize[_0x41f8('0xc')](0x1000),'comments':_0x41f8('0x10')},'data5':{'type':Sequelize[_0x41f8('0xc')](0x1000),'comments':_0x41f8('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0x41f8('0x12')},'data7':{'type':Sequelize['TEXT'],'comments':_0x41f8('0x13')}};
\ No newline at end of file
+var _0xa895=['urlForward[body]','VIRTUAL','getDataValue','action','STRING','contactManager','jscripty','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x508233,_0x4bbda4){var _0x2b60e3=function(_0x1026f6){while(--_0x1026f6){_0x508233['push'](_0x508233['shift']());}};_0x2b60e3(++_0x4bbda4);}(_0xa895,0x1b4));var _0x5a89=function(_0x23896f,_0x5d53eb){_0x23896f=_0x23896f-0x0;var _0x27ca63=_0xa895[_0x23896f];return _0x27ca63;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5a89('0x0')],'get':function(_0x505723){return this[_0x5a89('0x1')](_0x5a89('0x2'));}},'action':{'type':Sequelize[_0x5a89('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5a89('0x4'),'integration','motionbar',_0x5a89('0x5'),'urlForward','browser','bot',_0x5a89('0x6')]],'msg':_0x5a89('0x7')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x5a89('0x3')](0x1000),'comment':_0x5a89('0x8')},'data2':{'type':Sequelize[_0x5a89('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x5a89('0x3')](0x1000),'comment':_0x5a89('0x9')},'data4':{'type':Sequelize[_0x5a89('0x3')](0x1000),'comments':_0x5a89('0xa')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x5a89('0xb')},'data6':{'type':Sequelize[_0x5a89('0x3')],'comments':_0x5a89('0xc')},'data7':{'type':Sequelize[_0x5a89('0xd')],'comments':_0x5a89('0xe')}};
\ No newline at end of file
index 9944edf..4e3ee4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x430c=['rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','update','body','params','catch','Action','find','eml-format'];(function(_0x24848d,_0x2376f9){var _0x566bff=function(_0x53d76e){while(--_0x53d76e){_0x24848d['push'](_0x24848d['shift']());}};_0x566bff(++_0x2376f9);}(_0x430c,0x1b8));var _0xc430=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0x430c[_0xea35d1];return _0x1d7a7c;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require(_0xc430('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var Mustache=require(_0xc430('0x4'));var util=require(_0xc430('0x5'));var path=require('path');var sox=require(_0xc430('0x6'));var csv=require(_0xc430('0x7'));var ejs=require(_0xc430('0x8'));var fs=require('fs');var fs_extra=require(_0xc430('0x9'));var _=require(_0xc430('0xa'));var squel=require(_0xc430('0xb'));var crypto=require(_0xc430('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc430('0xd'));var Papa=require(_0xc430('0xe'));var Redis=require(_0xc430('0xf'));var authService=require(_0xc430('0x10'));var qs=require(_0xc430('0x11'));var as=require(_0xc430('0x12'));var hardwareService=require(_0xc430('0x13'));var logger=require(_0xc430('0x14'))('api');var utils=require(_0xc430('0x15'));var config=require(_0xc430('0x16'));var licenseUtil=require(_0xc430('0x17'));var db=require(_0xc430('0x18'))['db'];function respondWithStatusCode(_0x45eff3,_0xb46fec){_0xb46fec=_0xb46fec||0xcc;return function(_0x313111){if(_0x313111){return _0x45eff3[_0xc430('0x19')](_0xb46fec);}return _0x45eff3[_0xc430('0x1a')](_0xb46fec)[_0xc430('0x1b')]();};}function respondWithResult(_0x5e170d,_0x4da990){_0x4da990=_0x4da990||0xc8;return function(_0x2c9bfc){if(_0x2c9bfc){return _0x5e170d[_0xc430('0x1a')](_0x4da990)[_0xc430('0x1c')](_0x2c9bfc);}};}function respondWithFilteredResult(_0x33ec20,_0x3d50c2){return function(_0x20b0de){if(_0x20b0de){var _0x1fb091=typeof _0x3d50c2[_0xc430('0x1d')]==='undefined'&&typeof _0x3d50c2[_0xc430('0x1e')]===_0xc430('0x1f');var _0x3948b4=_0x20b0de['count'];var _0xdafe9a=_0x1fb091?0x0:_0x3d50c2[_0xc430('0x1d')];var _0x48ff83=_0x1fb091?_0x20b0de[_0xc430('0x20')]:_0x3d50c2[_0xc430('0x1d')]+_0x3d50c2[_0xc430('0x1e')];var _0x4a5db4;if(_0x48ff83>=_0x3948b4){_0x48ff83=_0x3948b4;_0x4a5db4=0xc8;}else{_0x4a5db4=0xce;}_0x33ec20['status'](_0x4a5db4);return _0x33ec20[_0xc430('0x21')](_0xc430('0x22'),_0xdafe9a+'-'+_0x48ff83+'/'+_0x3948b4)[_0xc430('0x1c')](_0x20b0de);}return null;};}function patchUpdates(_0x58e903){return function(_0x5e6517){try{jsonpatch[_0xc430('0x23')](_0x5e6517,_0x58e903,!![]);}catch(_0x29d3b7){return BPromise[_0xc430('0x24')](_0x29d3b7);}return _0x5e6517[_0xc430('0x25')]();};}function saveUpdates(_0x5c07c0,_0x14a448){return function(_0x444aab){if(_0x444aab){return _0x444aab['update'](_0x5c07c0)[_0xc430('0x26')](function(_0x435714){return _0x435714;});}return null;};}function removeEntity(_0x20484b,_0x5c3056){return function(_0x136569){if(_0x136569){return _0x136569[_0xc430('0x27')]()['then'](function(){_0x20484b[_0xc430('0x1a')](0xcc)[_0xc430('0x1b')]();});}};}function handleEntityNotFound(_0x349c0e,_0x292073){return function(_0x29d209){if(!_0x29d209){_0x349c0e['sendStatus'](0x194);}return _0x29d209;};}function handleError(_0x2064fa,_0x3b3ef3){_0x3b3ef3=_0x3b3ef3||0x1f4;return function(_0x21ff0b){logger[_0xc430('0x28')](_0x21ff0b['stack']);if(_0x21ff0b['name']){delete _0x21ff0b[_0xc430('0x29')];}_0x2064fa[_0xc430('0x1a')](_0x3b3ef3)[_0xc430('0x2a')](_0x21ff0b);};}exports[_0xc430('0x2b')]=function(_0x432afc,_0x19000a){if(_0x432afc[_0xc430('0x2c')]['id']){delete _0x432afc[_0xc430('0x2c')]['id'];}return db['Action']['find']({'where':{'id':_0x432afc[_0xc430('0x2d')]['id']}})[_0xc430('0x26')](handleEntityNotFound(_0x19000a,null))['then'](saveUpdates(_0x432afc[_0xc430('0x2c')],null))[_0xc430('0x26')](respondWithResult(_0x19000a,null))[_0xc430('0x2e')](handleError(_0x19000a,null));};exports['destroy']=function(_0x1427e9,_0x2a95de){return db[_0xc430('0x2f')][_0xc430('0x30')]({'where':{'id':_0x1427e9[_0xc430('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2a95de,null))['then'](removeEntity(_0x2a95de,null))[_0xc430('0x2e')](handleError(_0x2a95de,null));};
\ No newline at end of file
+var _0x6fca=['apply','reject','update','then','error','stack','name','send','body','Action','find','catch','params','rimraf','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0xd04b50,_0x3d635d){var _0x5de236=function(_0x9129b1){while(--_0x9129b1){_0xd04b50['push'](_0xd04b50['shift']());}};_0x5de236(++_0x3d635d);}(_0x6fca,0x187));var _0xa6fc=function(_0x42af54,_0x2735ea){_0x42af54=_0x42af54-0x0;var _0x16e378=_0x6fca[_0x42af54];return _0x16e378;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6fc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa6fc('0x1'));var moment=require(_0xa6fc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa6fc('0x3'));var util=require(_0xa6fc('0x4'));var path=require('path');var sox=require(_0xa6fc('0x5'));var csv=require(_0xa6fc('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6fc('0x7'));var _=require(_0xa6fc('0x8'));var squel=require(_0xa6fc('0x9'));var crypto=require(_0xa6fc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa6fc('0xb'));var toCsv=require(_0xa6fc('0x6'));var querystring=require('querystring');var Papa=require(_0xa6fc('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa6fc('0xd'));var as=require(_0xa6fc('0xe'));var hardwareService=require(_0xa6fc('0xf'));var logger=require('../../config/logger')(_0xa6fc('0x10'));var utils=require(_0xa6fc('0x11'));var config=require(_0xa6fc('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xa6fc('0x13'))['db'];function respondWithStatusCode(_0x3ea94b,_0x374422){_0x374422=_0x374422||0xcc;return function(_0x55afc5){if(_0x55afc5){return _0x3ea94b[_0xa6fc('0x14')](_0x374422);}return _0x3ea94b[_0xa6fc('0x15')](_0x374422)[_0xa6fc('0x16')]();};}function respondWithResult(_0x41ba0f,_0x8926b0){_0x8926b0=_0x8926b0||0xc8;return function(_0x1aa56d){if(_0x1aa56d){return _0x41ba0f[_0xa6fc('0x15')](_0x8926b0)[_0xa6fc('0x17')](_0x1aa56d);}};}function respondWithFilteredResult(_0x40fd52,_0x3e0ca0){return function(_0x823769){if(_0x823769){var _0x320f9c=typeof _0x3e0ca0[_0xa6fc('0x18')]==='undefined'&&typeof _0x3e0ca0[_0xa6fc('0x19')]===_0xa6fc('0x1a');var _0x42d588=_0x823769[_0xa6fc('0x1b')];var _0x331ee4=_0x320f9c?0x0:_0x3e0ca0['offset'];var _0x1b61b3=_0x320f9c?_0x823769['count']:_0x3e0ca0['offset']+_0x3e0ca0[_0xa6fc('0x19')];var _0x77c037;if(_0x1b61b3>=_0x42d588){_0x1b61b3=_0x42d588;_0x77c037=0xc8;}else{_0x77c037=0xce;}_0x40fd52[_0xa6fc('0x15')](_0x77c037);return _0x40fd52[_0xa6fc('0x1c')]('Content-Range',_0x331ee4+'-'+_0x1b61b3+'/'+_0x42d588)[_0xa6fc('0x17')](_0x823769);}return null;};}function patchUpdates(_0x2d1d17){return function(_0x239c77){try{jsonpatch[_0xa6fc('0x1d')](_0x239c77,_0x2d1d17,!![]);}catch(_0x516e3b){return BPromise[_0xa6fc('0x1e')](_0x516e3b);}return _0x239c77['save']();};}function saveUpdates(_0x387201,_0x4994d0){return function(_0x4b65d0){if(_0x4b65d0){return _0x4b65d0[_0xa6fc('0x1f')](_0x387201)[_0xa6fc('0x20')](function(_0x3dcb7a){return _0x3dcb7a;});}return null;};}function removeEntity(_0x10f58b,_0xb63613){return function(_0x59f0dc){if(_0x59f0dc){return _0x59f0dc['destroy']()[_0xa6fc('0x20')](function(){_0x10f58b[_0xa6fc('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x236013,_0x2f6920){return function(_0x49e9e1){if(!_0x49e9e1){_0x236013[_0xa6fc('0x14')](0x194);}return _0x49e9e1;};}function handleError(_0x5052b5,_0x309b10){_0x309b10=_0x309b10||0x1f4;return function(_0x2df866){logger[_0xa6fc('0x21')](_0x2df866[_0xa6fc('0x22')]);if(_0x2df866[_0xa6fc('0x23')]){delete _0x2df866[_0xa6fc('0x23')];}_0x5052b5['status'](_0x309b10)[_0xa6fc('0x24')](_0x2df866);};}exports['update']=function(_0x46a34d,_0x30764a){if(_0x46a34d[_0xa6fc('0x25')]['id']){delete _0x46a34d[_0xa6fc('0x25')]['id'];}return db[_0xa6fc('0x26')][_0xa6fc('0x27')]({'where':{'id':_0x46a34d['params']['id']}})['then'](handleEntityNotFound(_0x30764a,null))['then'](saveUpdates(_0x46a34d[_0xa6fc('0x25')],null))[_0xa6fc('0x20')](respondWithResult(_0x30764a,null))[_0xa6fc('0x28')](handleError(_0x30764a,null));};exports['destroy']=function(_0x1e70d6,_0x53c21c){return db[_0xa6fc('0x26')][_0xa6fc('0x27')]({'where':{'id':_0x1e70d6[_0xa6fc('0x29')]['id']}})['then'](handleEntityNotFound(_0x53c21c,null))[_0xa6fc('0x20')](removeEntity(_0x53c21c,null))[_0xa6fc('0x28')](handleError(_0x53c21c,null));};
\ No newline at end of file
index 4f6770c..9aa31fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf632=['api','request-promise','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x58ba83,_0x53c200){var _0x28ad9f=function(_0x1d6122){while(--_0x1d6122){_0x58ba83['push'](_0x58ba83['shift']());}};_0x28ad9f(++_0x53c200);}(_0xf632,0xf9));var _0x2f63=function(_0x56e569,_0x6e3b88){_0x56e569=_0x56e569-0x0;var _0x372795=_0xf632[_0x56e569];return _0x372795;};'use strict';var _=require(_0x2f63('0x0'));var util=require(_0x2f63('0x1'));var logger=require(_0x2f63('0x2'))(_0x2f63('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f63('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f63('0x5'));var config=require(_0x2f63('0x6'));var attributes=require(_0x2f63('0x7'));module[_0x2f63('0x8')]=function(_0x5df351,_0x2ad5c1){return _0x5df351[_0x2f63('0x9')](_0x2f63('0xa'),attributes,{'tableName':_0x2f63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4bf2=['request-promise','path','rimraf','../../config/environment','./action.attributes','Action','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x55e923,_0x580906){var _0x531d10=function(_0x508422){while(--_0x508422){_0x55e923['push'](_0x55e923['shift']());}};_0x531d10(++_0x580906);}(_0x4bf2,0xa3));var _0x24bf=function(_0x1881ac,_0x57ecf4){_0x1881ac=_0x1881ac-0x0;var _0x3b966e=_0x4bf2[_0x1881ac];return _0x3b966e;};'use strict';var _=require('lodash');var util=require(_0x24bf('0x0'));var logger=require(_0x24bf('0x1'))(_0x24bf('0x2'));var moment=require(_0x24bf('0x3'));var BPromise=require(_0x24bf('0x4'));var rp=require(_0x24bf('0x5'));var fs=require('fs');var path=require(_0x24bf('0x6'));var rimraf=require(_0x24bf('0x7'));var config=require(_0x24bf('0x8'));var attributes=require(_0x24bf('0x9'));module['exports']=function(_0x2d4922,_0x5546d8){return _0x2d4922['define'](_0x24bf('0xa'),attributes,{'tableName':_0x24bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 881e7c0..a3bf517 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x8a9e09,_0x13c855){var _0x2c5459=function(_0x1203a7){while(--_0x1203a7){_0x8a9e09['push'](_0x8a9e09['shift']());}};_0x2c5459(++_0x13c855);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x4975,0x86));var _0x5497=function(_0x1f7c44,_0x16abaf){_0x1f7c44=_0x1f7c44-0x0;var _0x293a07=_0x4975[_0x1f7c44];return _0x293a07;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
index 7508726..0d34fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2c9=['/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put'];(function(_0x204237,_0xb101b9){var _0x26dde7=function(_0x12e506){while(--_0x12e506){_0x204237['push'](_0x204237['shift']());}};_0x26dde7(++_0xb101b9);}(_0xd2c9,0xa5));var _0x9d2c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2c9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9d2c('0x0'));var util=require(_0x9d2c('0x1'));var path=require(_0x9d2c('0x2'));var timeout=require(_0x9d2c('0x3'));var express=require(_0x9d2c('0x4'));var router=express[_0x9d2c('0x5')]();var fs_extra=require(_0x9d2c('0x6'));var auth=require(_0x9d2c('0x7'));var interaction=require(_0x9d2c('0x8'));var config=require('../../config/environment');var controller=require(_0x9d2c('0x9'));router[_0x9d2c('0xa')](_0x9d2c('0xb'),auth[_0x9d2c('0xc')](),controller[_0x9d2c('0xd')]);router['delete'](_0x9d2c('0xb'),auth[_0x9d2c('0xc')](),controller[_0x9d2c('0xe')]);module[_0x9d2c('0xf')]=router;
\ No newline at end of file
+var _0x0488=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x0488,0x146));var _0x8048=function(_0x5462b2,_0x345ed1){_0x5462b2=_0x5462b2-0x0;var _0xb969ca=_0x0488[_0x5462b2];return _0xb969ca;};'use strict';var multer=require('multer');var util=require(_0x8048('0x0'));var path=require('path');var timeout=require(_0x8048('0x1'));var express=require(_0x8048('0x2'));var router=express[_0x8048('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8048('0x4'));var interaction=require(_0x8048('0x5'));var config=require(_0x8048('0x6'));var controller=require(_0x8048('0x7'));router[_0x8048('0x8')](_0x8048('0x9'),auth[_0x8048('0xa')](),controller[_0x8048('0xb')]);router[_0x8048('0xc')](_0x8048('0x9'),auth['isAuthenticated'](),controller[_0x8048('0xd')]);module[_0x8048('0xe')]=router;
\ No newline at end of file
index a65fff3..bb29e5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x48df04,_0x1522b1){var _0x4de5fa=function(_0x3ae6db){while(--_0x3ae6db){_0x48df04['push'](_0x48df04['shift']());}};_0x4de5fa(++_0x1522b1);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x25280c,_0x2edec1){_0x25280c=_0x25280c-0x0;var _0x3a58c3=_0xfdbd[_0x25280c];return _0x3a58c3;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
+var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x46ed,0x168));var _0xd46e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x46ed[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
index b6ea5a6..1134e99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x020b=['moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','CustomReports','error','find','preview','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','length','operator','group','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','field','function','replace','format','orderBy','order','DESC','alias','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','sequelize','toString','QueryTypes','SELECT','join','SUM(%s)','DATE(%s)','condition','AnalyticMetric','clone','output','web','%s-%s.%s','randomstring','generate','csv','custom','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','left_join','Limited\x20Query:','eml-format','rimraf'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x020b,0x1d8));var _0xb020=function(_0x2f8dee,_0xeddbe2){_0x2f8dee=_0x2f8dee-0x0;var _0x2566bb=_0x020b[_0x2f8dee];return _0x2566bb;};'use strict';var emlformat=require(_0xb020('0x0'));var rimraf=require(_0xb020('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb020('0x2'));var BPromise=require(_0xb020('0x3'));var Mustache=require('mustache');var util=require(_0xb020('0x4'));var path=require(_0xb020('0x5'));var sox=require(_0xb020('0x6'));var csv=require(_0xb020('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb020('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb020('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb020('0xa'));var Papa=require(_0xb020('0xb'));var Redis=require(_0xb020('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xb020('0xd'));var as=require(_0xb020('0xe'));var hardwareService=require(_0xb020('0xf'));var logger=require(_0xb020('0x10'))(_0xb020('0x11'));var utils=require(_0xb020('0x12'));var config=require(_0xb020('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb020('0x14'))['db'];var dbH=require(_0xb020('0x14'))[_0xb020('0x15')];function respondWithStatusCode(_0x123dda,_0x1f110a){_0x1f110a=_0x1f110a||0xcc;return function(_0x31e53a){if(_0x31e53a){return _0x123dda[_0xb020('0x16')](_0x1f110a);}return _0x123dda['status'](_0x1f110a)[_0xb020('0x17')]();};}function respondWithResult(_0x2fc704,_0x5c9bc2){_0x5c9bc2=_0x5c9bc2||0xc8;return function(_0x4a77fa){if(_0x4a77fa){return _0x2fc704[_0xb020('0x18')](_0x5c9bc2)[_0xb020('0x19')](_0x4a77fa);}};}function respondWithFilteredResult(_0xe0727d,_0x24250e){return function(_0x36f9d7){if(_0x36f9d7){var _0x444286=typeof _0x24250e['offset']===_0xb020('0x1a')&&typeof _0x24250e[_0xb020('0x1b')]==='undefined';var _0x2890ae=_0x36f9d7[_0xb020('0x1c')];var _0xf93fa0=_0x444286?0x0:_0x24250e['offset'];var _0x55e6e5=_0x444286?_0x36f9d7['count']:_0x24250e['offset']+_0x24250e['limit'];var _0x22fb9a;if(_0x55e6e5>=_0x2890ae){_0x55e6e5=_0x2890ae;_0x22fb9a=0xc8;}else{_0x22fb9a=0xce;}_0xe0727d[_0xb020('0x18')](_0x22fb9a);return _0xe0727d[_0xb020('0x1d')](_0xb020('0x1e'),_0xf93fa0+'-'+_0x55e6e5+'/'+_0x2890ae)[_0xb020('0x19')](_0x36f9d7);}return null;};}function patchUpdates(_0x54326f){return function(_0x23f499){try{jsonpatch[_0xb020('0x1f')](_0x23f499,_0x54326f,!![]);}catch(_0xb462c5){return BPromise[_0xb020('0x20')](_0xb462c5);}return _0x23f499[_0xb020('0x21')]();};}function saveUpdates(_0x6762ba,_0x329b04){return function(_0x319003){if(_0x319003){return _0x319003[_0xb020('0x22')](_0x6762ba)[_0xb020('0x23')](function(_0x1db62d){return _0x1db62d;});}return null;};}function removeEntity(_0x3919e3,_0x4fdf8d){return function(_0x16420c){if(_0x16420c){return _0x16420c[_0xb020('0x24')]()[_0xb020('0x23')](function(){var _0x391e97=_0x16420c[_0xb020('0x25')]({'plain':!![]});var _0x32ac67='CustomReports';return db[_0xb020('0x26')][_0xb020('0x24')]({'where':{'type':_0x32ac67,'resourceId':_0x391e97['id']}})[_0xb020('0x23')](function(){return _0x16420c;});})[_0xb020('0x23')](function(){_0x3919e3[_0xb020('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ea3a3,_0x5f2c2a){return function(_0x2ae8e6){if(!_0x2ae8e6){_0x4ea3a3[_0xb020('0x16')](0x194);}return _0x2ae8e6;};}function handleError(_0x48820e,_0x3020a4){_0x3020a4=_0x3020a4||0x1f4;return function(_0x21b3b0){logger['error'](_0x21b3b0[_0xb020('0x27')]);if(_0x21b3b0[_0xb020('0x28')]){delete _0x21b3b0[_0xb020('0x28')];}_0x48820e[_0xb020('0x18')](_0x3020a4)[_0xb020('0x29')](_0x21b3b0);};}exports[_0xb020('0x2a')]=function(_0x18a149,_0x3c916a){var _0x32ee25={},_0xecd507={},_0x575e78={'count':0x0,'rows':[]};var _0x41e51=_[_0xb020('0x2b')](db[_0xb020('0x2c')][_0xb020('0x2d')],function(_0x2d1b08){return{'name':_0x2d1b08[_0xb020('0x2e')],'type':_0x2d1b08[_0xb020('0x2f')][_0xb020('0x30')]};});_0xecd507[_0xb020('0x31')]=_[_0xb020('0x2b')](_0x41e51,_0xb020('0x28'));_0xecd507['query']=_[_0xb020('0x32')](_0x18a149[_0xb020('0x33')]);_0xecd507[_0xb020('0x34')]=_[_0xb020('0x35')](_0xecd507[_0xb020('0x31')],_0xecd507[_0xb020('0x33')]);_0x32ee25[_0xb020('0x36')]=_[_0xb020('0x35')](_0xecd507[_0xb020('0x31')],qs[_0xb020('0x37')](_0x18a149[_0xb020('0x33')][_0xb020('0x37')]));_0x32ee25[_0xb020('0x36')]=_0x32ee25[_0xb020('0x36')]['length']?_0x32ee25['attributes']:_0xecd507['model'];if(!_0x18a149[_0xb020('0x33')][_0xb020('0x38')]('nolimit')){_0x32ee25[_0xb020('0x1b')]=qs['limit'](_0x18a149[_0xb020('0x33')][_0xb020('0x1b')]);_0x32ee25[_0xb020('0x39')]=qs[_0xb020('0x39')](_0x18a149[_0xb020('0x33')][_0xb020('0x39')]);}_0x32ee25['order']=qs['sort'](_0x18a149['query'][_0xb020('0x3a')]);_0x32ee25[_0xb020('0x3b')]=qs[_0xb020('0x34')](_[_0xb020('0x3c')](_0x18a149['query'],_0xecd507[_0xb020('0x34')]),_0x41e51);if(_0x18a149[_0xb020('0x33')][_0xb020('0x3d')]){_0x32ee25[_0xb020('0x3b')]=_[_0xb020('0x3e')](_0x32ee25[_0xb020('0x3b')],{'$or':_[_0xb020('0x2b')](_0x41e51,function(_0x1965dc){if(_0x1965dc[_0xb020('0x2f')]!==_0xb020('0x3f')){var _0x395547={};_0x395547[_0x1965dc[_0xb020('0x28')]]={'$like':'%'+_0x18a149[_0xb020('0x33')]['filter']+'%'};return _0x395547;}})});}_0x32ee25=_['merge']({},_0x32ee25,_0x18a149['options']);var _0x31d986={'where':_0x32ee25[_0xb020('0x3b')]};return db['AnalyticCustomReport'][_0xb020('0x1c')](_0x31d986)[_0xb020('0x23')](function(_0x5552b4){_0x575e78[_0xb020('0x1c')]=_0x5552b4;if(_0x18a149[_0xb020('0x33')][_0xb020('0x40')]){_0x32ee25['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xb020('0x41')](_0x32ee25);})[_0xb020('0x23')](function(_0x26199e){_0x575e78['rows']=_0x26199e;return _0x575e78;})[_0xb020('0x23')](respondWithFilteredResult(_0x3c916a,_0x32ee25))[_0xb020('0x42')](handleError(_0x3c916a,null));};exports[_0xb020('0x43')]=function(_0x54c1ac,_0x2b57e0){var _0x1a9480={'raw':![],'where':{'id':_0x54c1ac[_0xb020('0x44')]['id']}},_0x4c27a5={};_0x4c27a5[_0xb020('0x31')]=_['keys'](db[_0xb020('0x2c')]['rawAttributes']);_0x4c27a5[_0xb020('0x33')]=_[_0xb020('0x32')](_0x54c1ac['query']);_0x4c27a5['filters']=_[_0xb020('0x35')](_0x4c27a5[_0xb020('0x31')],_0x4c27a5[_0xb020('0x33')]);_0x1a9480[_0xb020('0x36')]=_[_0xb020('0x35')](_0x4c27a5[_0xb020('0x31')],qs[_0xb020('0x37')](_0x54c1ac[_0xb020('0x33')][_0xb020('0x37')]));_0x1a9480[_0xb020('0x36')]=_0x1a9480[_0xb020('0x36')]['length']?_0x1a9480[_0xb020('0x36')]:_0x4c27a5[_0xb020('0x31')];if(_0x54c1ac[_0xb020('0x33')][_0xb020('0x40')]){_0x1a9480[_0xb020('0x45')]=[{'all':!![]}];}_0x1a9480=_[_0xb020('0x3e')]({},_0x1a9480,_0x54c1ac[_0xb020('0x46')]);return db['AnalyticCustomReport']['find'](_0x1a9480)[_0xb020('0x23')](handleEntityNotFound(_0x2b57e0,null))[_0xb020('0x23')](respondWithResult(_0x2b57e0,null))[_0xb020('0x42')](handleError(_0x2b57e0,null));};exports[_0xb020('0x47')]=function(_0x171283,_0x10bef6){return db[_0xb020('0x2c')][_0xb020('0x47')](_0x171283[_0xb020('0x48')],{})[_0xb020('0x23')](function(_0x2755b8){var _0x3ea6d9=_0x171283['user'][_0xb020('0x25')]({'plain':!![]});if(!_0x3ea6d9)throw new Error(_0xb020('0x49'));if(_0x3ea6d9['role']==='user'){var _0x41c31b=_0x2755b8[_0xb020('0x25')]({'plain':!![]});var _0x2548fe=_0xb020('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x2548fe,'userProfileId':_0x3ea6d9[_0xb020('0x4b')]},'raw':!![]})['then'](function(_0x217c7c){if(_0x217c7c&&_0x217c7c['autoAssociation']===0x0){return db[_0xb020('0x26')][_0xb020('0x47')]({'name':_0x41c31b[_0xb020('0x28')],'resourceId':_0x41c31b['id'],'type':_0xb020('0x4c'),'sectionId':_0x217c7c['id']},{})['then'](function(){return _0x2755b8;});}else{return _0x2755b8;}})['catch'](function(_0x54e48c){logger[_0xb020('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54e48c);throw _0x54e48c;});}return _0x2755b8;})[_0xb020('0x23')](respondWithResult(_0x10bef6,0xc9))[_0xb020('0x42')](handleError(_0x10bef6,null));};exports[_0xb020('0x22')]=function(_0x3a6170,_0x52cd91){if(_0x3a6170[_0xb020('0x48')]['id']){delete _0x3a6170[_0xb020('0x48')]['id'];}return db[_0xb020('0x2c')][_0xb020('0x4e')]({'where':{'id':_0x3a6170[_0xb020('0x44')]['id']}})[_0xb020('0x23')](handleEntityNotFound(_0x52cd91,null))['then'](saveUpdates(_0x3a6170['body'],null))[_0xb020('0x23')](respondWithResult(_0x52cd91,null))[_0xb020('0x42')](handleError(_0x52cd91,null));};exports[_0xb020('0x24')]=function(_0xe6975a,_0x584347){return db[_0xb020('0x2c')]['find']({'where':{'id':_0xe6975a[_0xb020('0x44')]['id']}})[_0xb020('0x23')](handleEntityNotFound(_0x584347,null))[_0xb020('0x23')](removeEntity(_0x584347,null))[_0xb020('0x42')](handleError(_0x584347,null));};exports[_0xb020('0x4f')]=function(_0x194e10,_0x5d64de){var _0x5c0e98=0xa;var _0x1e6f2a=['join','left_join',_0xb020('0x50'),_0xb020('0x51')];var _0x81ad99={'SUM':'SUM(%s)','COUNT':_0xb020('0x52'),'COUNT DISTINCT':_0xb020('0x53'),'MAX':_0xb020('0x54'),'MIN':_0xb020('0x55'),'AVG':_0xb020('0x56'),'GROUP_CONCAT':_0xb020('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb020('0x58')};var _0x335a5c={'SEC_TO_TIME':_0xb020('0x59'),'DATE':'DATE(%s)','HOUR':_0xb020('0x5a'),'ROUND':_0xb020('0x5b'),'UNIX_TIMESTAMP':_0xb020('0x5c')};var _0x1ea67a=function(_0x1ad221){return!_[_0xb020('0x5d')]([_0xb020('0x5e'),_0xb020('0x5f'),_0xb020('0x60'),'IS\x20NOT\x20EMPTY'],_0x1ad221);};var _0x33ffdf=function(_0x27f954){if(!_0x27f954||!_0x27f954[_0xb020('0x61')]['length']){return'';}for(var _0x1e40c2='(',_0x35d10c=0x0;_0x35d10c<_0x27f954[_0xb020('0x61')][_0xb020('0x62')];_0x35d10c+=0x1){_0x35d10c>0x0&&(_0x1e40c2+='\x20'+_0x27f954[_0xb020('0x63')]+'\x20');_0x1e40c2+=_0x27f954[_0xb020('0x61')][_0x35d10c][_0xb020('0x64')]?_0x33ffdf(_0x27f954[_0xb020('0x61')][_0x35d10c][_0xb020('0x64')]):_0x27f954[_0xb020('0x61')][_0x35d10c]['field']+'\x20'+_0x27f954[_0xb020('0x61')][_0x35d10c]['condition']+(_0x1ea67a(_0x27f954['rules'][_0x35d10c]['condition'])?'\x20'+_0x27f954[_0xb020('0x61')][_0x35d10c][_0xb020('0x65')]:'');}return _0x1e40c2+')';};var _0x42214c={'where':{'id':_0x194e10[_0xb020('0x44')]['id']}},_0x278d11,_0x56df29,_0x238d7b,_0x20bd49,_0x25d99b;_0x42214c=_[_0xb020('0x3e')]({},_0x42214c,_0x194e10[_0xb020('0x46')]);return db[_0xb020('0x2c')][_0xb020('0x4e')](_0x42214c)[_0xb020('0x23')](function(_0x2b6585){if(_0x2b6585){_0x278d11=_0x2b6585;return _0x2b6585[_0xb020('0x66')]();}return null;})[_0xb020('0x23')](function(_0x4721f8){if(_0x4721f8){if(!_0x4721f8[_0xb020('0x62')]){throw new db[(_0xb020('0x67'))][(_0xb020('0x68'))](_0xb020('0x69'),0x193);}_0x56df29=_0x4721f8;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xb020('0x23')](function(_0x5da114){if(_0x5da114){_0x238d7b=_[_0xb020('0x6a')](_0x5da114,'id');var _0x331fe3;var _0x55e31e=squel[_0xb020('0x6b')]();_0x55e31e[_0xb020('0x6c')](_0x278d11[_0xb020('0x6d')]);for(var _0x30d3fd=0x0;_0x30d3fd<_0x56df29['length'];_0x30d3fd+=0x1){_0x331fe3=_0x56df29[_0x30d3fd][_0xb020('0x6e')]?_0x238d7b[_0x56df29[_0x30d3fd]['MetricId']][_0xb020('0x6f')]:_0x56df29[_0x30d3fd][_0xb020('0x70')];_0x331fe3=_0x56df29[_0x30d3fd][_0xb020('0x71')]?_['replace'](_0x81ad99[_0x56df29[_0x30d3fd][_0xb020('0x71')]],'%s',_0x331fe3):_0x331fe3;_0x331fe3=_0x56df29[_0x30d3fd]['format']?_[_0xb020('0x72')](_0x335a5c[_0x56df29[_0x30d3fd][_0xb020('0x73')]],'%s',_0x331fe3):_0x331fe3;if(_0x56df29[_0x30d3fd]['groupBy']){_0x55e31e[_0xb020('0x64')](_0x331fe3);}_0x56df29[_0x30d3fd][_0xb020('0x74')]&&_0x55e31e[_0xb020('0x75')](_0x331fe3,_0x56df29[_0x30d3fd]['orderBy']===_0xb020('0x76')?![]:!![]);_0x55e31e[_0xb020('0x70')](_0x331fe3,_0x56df29[_0x30d3fd][_0xb020('0x77')]||_0x331fe3);}if(_0x278d11[_0xb020('0x78')]){_0x278d11['joins']=JSON[_0xb020('0x79')](_0x278d11[_0xb020('0x78')]);for(var _0x402a6a=0x0;_0x402a6a<_0x278d11[_0xb020('0x78')][_0xb020('0x62')];_0x402a6a+=0x1){if(_0x278d11[_0xb020('0x78')][_0x402a6a]['type']&&_[_0xb020('0x5d')](_0x1e6f2a,_0x278d11[_0xb020('0x78')][_0x402a6a]['type'])&&_0x278d11[_0xb020('0x78')][_0x402a6a]['parentKey']&&_0x278d11['joins'][_0x402a6a]['foreignTable']&&_0x278d11['joins'][_0x402a6a][_0xb020('0x7a')]){_0x55e31e[_0x278d11[_0xb020('0x78')][_0x402a6a][_0xb020('0x2f')]](_0x278d11[_0xb020('0x78')][_0x402a6a][_0xb020('0x7b')],null,util['format'](_0xb020('0x7c'),_0x278d11[_0xb020('0x6d')],_0x278d11[_0xb020('0x78')][_0x402a6a][_0xb020('0x7d')],_0x278d11[_0xb020('0x78')][_0x402a6a][_0xb020('0x7b')],_0x278d11[_0xb020('0x78')][_0x402a6a]['foreignKey']));}}}if(_0x278d11[_0xb020('0x7e')]){_0x278d11[_0xb020('0x7e')]=JSON[_0xb020('0x79')](_0x278d11[_0xb020('0x7e')]);_0x55e31e[_0xb020('0x3b')](_0x33ffdf(_0x278d11[_0xb020('0x7e')][_0xb020('0x64')]));}_0x25d99b=_0x55e31e['clone']();_0x55e31e[_0xb020('0x1b')](_0x5c0e98);_0x55e31e[_0xb020('0x39')](0x0);logger[_0xb020('0x7f')]('Limited\x20Query:',_0x55e31e['toString']());return dbH[_0xb020('0x80')][_0xb020('0x33')](_0x55e31e[_0xb020('0x81')](),{'type':dbH['sequelize'][_0xb020('0x82')][_0xb020('0x83')]});}})[_0xb020('0x23')](respondWithResult(_0x5d64de,null))['catch'](handleError(_0x5d64de,null));};function runReport(_0x1120c9,_0x544861,_0x16f8f0){var _0x1edb0d=_0x544861['name'];var _0xbc3d58=0xa;var _0x207d8f=[_0xb020('0x84'),'left_join',_0xb020('0x50'),_0xb020('0x51')];var _0x225db7={'SUM':_0xb020('0x85'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xb020('0x55'),'AVG':_0xb020('0x56'),'GROUP_CONCAT':_0xb020('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3d62e7={'SEC_TO_TIME':_0xb020('0x59'),'DATE':_0xb020('0x86'),'HOUR':_0xb020('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb020('0x5c')};var _0x3a410e=function(_0x4b6c06){return!_['includes']([_0xb020('0x5e'),_0xb020('0x5f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4b6c06);};var _0xd2a9e9=function(_0x324401){if(!_0x324401||!_0x324401[_0xb020('0x61')][_0xb020('0x62')]){return'';}for(var _0x5584fd='(',_0x340826=0x0;_0x340826<_0x324401[_0xb020('0x61')][_0xb020('0x62')];_0x340826+=0x1){_0x340826>0x0&&(_0x5584fd+='\x20'+_0x324401[_0xb020('0x63')]+'\x20');_0x5584fd+=_0x324401['rules'][_0x340826][_0xb020('0x64')]?_0xd2a9e9(_0x324401[_0xb020('0x61')][_0x340826][_0xb020('0x64')]):_0x324401['rules'][_0x340826][_0xb020('0x70')]+'\x20'+_0x324401[_0xb020('0x61')][_0x340826][_0xb020('0x87')]+(_0x3a410e(_0x324401[_0xb020('0x61')][_0x340826][_0xb020('0x87')])?'\x20'+_0x324401['rules'][_0x340826]['value']:'');}return _0x5584fd+')';};var _0x95ae0a={'where':{'id':_0x1120c9['id']}},_0x2563f4,_0x1c732f,_0x235ca5,_0x1b68f2,_0x1c53de;_0x95ae0a=_['merge']({},_0x95ae0a,_0x16f8f0);return db['AnalyticCustomReport']['find'](_0x95ae0a)[_0xb020('0x23')](function(_0x431ba1){if(_0x431ba1){_0x2563f4=_0x431ba1;return _0x431ba1[_0xb020('0x66')]();}return null;})[_0xb020('0x23')](function(_0x4481f9){if(_0x4481f9){if(!_0x4481f9['length']){throw new db['Sequelize'][(_0xb020('0x68'))](_0xb020('0x69'),0x193);}_0x1c732f=_0x4481f9;return db[_0xb020('0x88')][_0xb020('0x41')]({'raw':!![]});}return null;})[_0xb020('0x23')](function(_0x3cc7f4){if(_0x3cc7f4){_0x235ca5=_['keyBy'](_0x3cc7f4,'id');var _0xff63b0;var _0x151a21=squel[_0xb020('0x6b')]();_0x151a21[_0xb020('0x6c')](_0x2563f4['table']);for(var _0x133c1b=0x0;_0x133c1b<_0x1c732f[_0xb020('0x62')];_0x133c1b+=0x1){_0xff63b0=_0x1c732f[_0x133c1b]['MetricId']?_0x235ca5[_0x1c732f[_0x133c1b][_0xb020('0x6e')]]['metric']:_0x1c732f[_0x133c1b][_0xb020('0x70')];_0xff63b0=_0x1c732f[_0x133c1b]['function']?_[_0xb020('0x72')](_0x225db7[_0x1c732f[_0x133c1b][_0xb020('0x71')]],'%s',_0xff63b0):_0xff63b0;_0xff63b0=_0x1c732f[_0x133c1b]['format']?_[_0xb020('0x72')](_0x3d62e7[_0x1c732f[_0x133c1b]['format']],'%s',_0xff63b0):_0xff63b0;if(_0x1c732f[_0x133c1b]['groupBy']){_0x151a21[_0xb020('0x64')](_0xff63b0);}_0x1c732f[_0x133c1b][_0xb020('0x74')]&&_0x151a21[_0xb020('0x75')](_0xff63b0,_0x1c732f[_0x133c1b][_0xb020('0x74')]===_0xb020('0x76')?![]:!![]);_0x151a21[_0xb020('0x70')](_0xff63b0,_0x1c732f[_0x133c1b]['alias']||_0xff63b0);}if(_0x2563f4[_0xb020('0x78')]){_0x2563f4[_0xb020('0x78')]=JSON[_0xb020('0x79')](_0x2563f4[_0xb020('0x78')]);for(var _0x2ce36e=0x0;_0x2ce36e<_0x2563f4[_0xb020('0x78')]['length'];_0x2ce36e+=0x1){if(_0x2563f4[_0xb020('0x78')][_0x2ce36e][_0xb020('0x2f')]&&_[_0xb020('0x5d')](_0x207d8f,_0x2563f4['joins'][_0x2ce36e][_0xb020('0x2f')])&&_0x2563f4[_0xb020('0x78')][_0x2ce36e][_0xb020('0x7d')]&&_0x2563f4[_0xb020('0x78')][_0x2ce36e]['foreignTable']&&_0x2563f4['joins'][_0x2ce36e][_0xb020('0x7a')]){_0x151a21[_0x2563f4[_0xb020('0x78')][_0x2ce36e][_0xb020('0x2f')]](_0x2563f4[_0xb020('0x78')][_0x2ce36e][_0xb020('0x7b')],null,util[_0xb020('0x73')](_0xb020('0x7c'),_0x2563f4['table'],_0x2563f4['joins'][_0x2ce36e][_0xb020('0x7d')],_0x2563f4[_0xb020('0x78')][_0x2ce36e]['foreignTable'],_0x2563f4[_0xb020('0x78')][_0x2ce36e]['foreignKey']));}}}if(_0x2563f4[_0xb020('0x7e')]){_0x2563f4[_0xb020('0x7e')]=JSON['parse'](_0x2563f4[_0xb020('0x7e')]);_0x151a21['where'](_0xd2a9e9(_0x2563f4[_0xb020('0x7e')][_0xb020('0x64')]));}_0x1c53de=_0x151a21[_0xb020('0x89')]();_0x151a21[_0xb020('0x1b')](_0xbc3d58);_0x151a21[_0xb020('0x39')](0x0);return;}})[_0xb020('0x23')](function(){if(_0x544861[_0xb020('0x8a')]===_0xb020('0x8b')){return null;}var _0x1c47a2=_['merge'](_0x544861,{'name':_0x544861['fullPath']||_0x544861['name']||_0x2563f4['name'],'basename':_0x1edb0d,'savename':util[_0xb020('0x73')](_0xb020('0x8c'),_0x544861['name']||_0x2563f4['name'],require(_0xb020('0x8d'))[_0xb020('0x8e')](0x4),_0x544861[_0xb020('0x8a')]||_0xb020('0x8f')),'reportId':_0x2563f4['id'],'reportType':_0xb020('0x90')});return db['AnalyticExtractedReport']['create'](_0x1c47a2,{'raw':!![]});})[_0xb020('0x23')](function(_0x1022f4){if(_0x2563f4[_0xb020('0x6d')]==='cdr'){_0x1c53de[_0xb020('0x3b')](_0x2563f4[_0xb020('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x544861[_0xb020('0x91')],_0x544861['endDate']);}else{_0x1c53de[_0xb020('0x3b')](_0x2563f4[_0xb020('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x544861[_0xb020('0x91')],_0x544861[_0xb020('0x92')]);}if(_0x1022f4){logger[_0xb020('0x93')]('Run\x20Query:',_0x1c53de[_0xb020('0x81')]());require(_0xb020('0x94'))[_0xb020('0x95')](path['join'](__dirname,_0xb020('0x96'),_0x1022f4[_0xb020('0x8a')]),[_0x1022f4['id'],_0x1c53de[_0xb020('0x81')](),path[_0xb020('0x84')](__dirname,_0xb020('0x97'),_0x1022f4[_0xb020('0x98')]),_0x1edb0d]);return _0x1022f4;}else{var _0xad0d39=squel['select']();_0xad0d39[_0xb020('0x6c')]('('+_0x1c53de[_0xb020('0x81')]()+')',_0xb020('0x99'));_0xad0d39[_0xb020('0x70')](_0xb020('0x9a'),_0xb020('0x1c'));_0x1c53de['limit'](_0x544861[_0xb020('0x1b')]||_0xbc3d58);_0x1c53de[_0xb020('0x39')](_0x544861[_0xb020('0x39')]||0x0);return dbH['sequelize'][_0xb020('0x33')](_0xad0d39[_0xb020('0x81')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']})[_0xb020('0x23')](function(_0x5b1894){if(!_0x5b1894[_0xb020('0x62')]){_0x1b68f2=0x0;}else{_0x1b68f2=_0x5b1894[0x0][_0xb020('0x1c')]||0x0;}return dbH['sequelize']['query'](_0x1c53de[_0xb020('0x81')](),{'type':dbH[_0xb020('0x80')]['QueryTypes'][_0xb020('0x83')]});})[_0xb020('0x23')](function(_0x12caaf){return{'rows':_0x12caaf||[],'count':_0x1b68f2};});}});}exports[_0xb020('0x9b')]=function(_0x1caa1a,_0x3a71d6){return runReport(_0x1caa1a[_0xb020('0x44')],_0x1caa1a['query'],_0x1caa1a[_0xb020('0x46')])[_0xb020('0x23')](respondWithResult(_0x3a71d6,null))[_0xb020('0x42')](handleError(_0x3a71d6,null));};exports['runReport']=runReport;exports[_0xb020('0x33')]=function(_0x3f0b16,_0x43a17){var _0x1f430f=0xa;var _0x5a86d5=[_0xb020('0x84'),_0xb020('0x9c'),'right_join','cross_join'];var _0x1db5c5={'SUM':_0xb020('0x85'),'COUNT':_0xb020('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb020('0x54'),'MIN':_0xb020('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb020('0x58')};var _0x12c4fe={'SEC_TO_TIME':_0xb020('0x59'),'DATE':_0xb020('0x86'),'HOUR':_0xb020('0x5a'),'ROUND':_0xb020('0x5b'),'UNIX_TIMESTAMP':_0xb020('0x5c')};var _0x25d4ca=function(_0x2a5c56){return!_[_0xb020('0x5d')]([_0xb020('0x5e'),_0xb020('0x5f'),_0xb020('0x60'),'IS\x20NOT\x20EMPTY'],_0x2a5c56);};var _0x2df080=function(_0x3f201c){if(!_0x3f201c||!_0x3f201c[_0xb020('0x61')][_0xb020('0x62')]){return'';}for(var _0x1ff06b='(',_0x1886d2=0x0;_0x1886d2<_0x3f201c[_0xb020('0x61')][_0xb020('0x62')];_0x1886d2+=0x1){_0x1886d2>0x0&&(_0x1ff06b+='\x20'+_0x3f201c[_0xb020('0x63')]+'\x20');_0x1ff06b+=_0x3f201c['rules'][_0x1886d2][_0xb020('0x64')]?_0x2df080(_0x3f201c['rules'][_0x1886d2]['group']):_0x3f201c[_0xb020('0x61')][_0x1886d2][_0xb020('0x70')]+'\x20'+_0x3f201c[_0xb020('0x61')][_0x1886d2]['condition']+(_0x25d4ca(_0x3f201c[_0xb020('0x61')][_0x1886d2][_0xb020('0x87')])?'\x20'+_0x3f201c[_0xb020('0x61')][_0x1886d2][_0xb020('0x65')]:'');}return _0x1ff06b+')';};var _0x57767d={'where':{'id':_0x3f0b16['params']['id']}},_0x669cc8,_0x5822f3,_0x2ab30f,_0x32bba8,_0x7aa6e;_0x57767d=_['merge']({},_0x57767d,_0x3f0b16['options']);return db[_0xb020('0x2c')][_0xb020('0x4e')](_0x57767d)[_0xb020('0x23')](function(_0x3a748a){if(_0x3a748a){_0x669cc8=_0x3a748a;return _0x3a748a[_0xb020('0x66')]();}return null;})['then'](function(_0x1c7984){if(_0x1c7984){if(!_0x1c7984['length']){throw new db[(_0xb020('0x67'))][(_0xb020('0x68'))](_0xb020('0x69'),0x193);}_0x5822f3=_0x1c7984;return db[_0xb020('0x88')][_0xb020('0x41')]({'raw':!![]});}return null;})[_0xb020('0x23')](function(_0x2eee41){if(_0x2eee41){_0x2ab30f=_[_0xb020('0x6a')](_0x2eee41,'id');var _0x4916f7;var _0x379646=squel[_0xb020('0x6b')]();_0x379646[_0xb020('0x6c')](_0x669cc8[_0xb020('0x6d')]);for(var _0x167a01=0x0;_0x167a01<_0x5822f3['length'];_0x167a01+=0x1){_0x4916f7=_0x5822f3[_0x167a01][_0xb020('0x6e')]?_0x2ab30f[_0x5822f3[_0x167a01][_0xb020('0x6e')]][_0xb020('0x6f')]:_0x5822f3[_0x167a01][_0xb020('0x70')];_0x4916f7=_0x5822f3[_0x167a01][_0xb020('0x71')]?_['replace'](_0x1db5c5[_0x5822f3[_0x167a01][_0xb020('0x71')]],'%s',_0x4916f7):_0x4916f7;_0x4916f7=_0x5822f3[_0x167a01][_0xb020('0x73')]?_[_0xb020('0x72')](_0x12c4fe[_0x5822f3[_0x167a01][_0xb020('0x73')]],'%s',_0x4916f7):_0x4916f7;if(_0x5822f3[_0x167a01]['groupBy']){_0x379646[_0xb020('0x64')](_0x4916f7);}_0x5822f3[_0x167a01][_0xb020('0x74')]&&_0x379646[_0xb020('0x75')](_0x4916f7,_0x5822f3[_0x167a01][_0xb020('0x74')]==='DESC'?![]:!![]);_0x379646[_0xb020('0x70')](_0x4916f7,_0x5822f3[_0x167a01][_0xb020('0x77')]||_0x4916f7);}if(_0x669cc8[_0xb020('0x78')]){_0x669cc8[_0xb020('0x78')]=JSON['parse'](_0x669cc8[_0xb020('0x78')]);for(var _0x12cbe5=0x0;_0x12cbe5<_0x669cc8[_0xb020('0x78')][_0xb020('0x62')];_0x12cbe5+=0x1){if(_0x669cc8[_0xb020('0x78')][_0x12cbe5]['type']&&_['includes'](_0x5a86d5,_0x669cc8['joins'][_0x12cbe5][_0xb020('0x2f')])&&_0x669cc8['joins'][_0x12cbe5][_0xb020('0x7d')]&&_0x669cc8['joins'][_0x12cbe5]['foreignTable']&&_0x669cc8[_0xb020('0x78')][_0x12cbe5][_0xb020('0x7a')]){_0x379646[_0x669cc8['joins'][_0x12cbe5][_0xb020('0x2f')]](_0x669cc8[_0xb020('0x78')][_0x12cbe5][_0xb020('0x7b')],null,util['format'](_0xb020('0x7c'),_0x669cc8[_0xb020('0x6d')],_0x669cc8[_0xb020('0x78')][_0x12cbe5]['parentKey'],_0x669cc8[_0xb020('0x78')][_0x12cbe5]['foreignTable'],_0x669cc8[_0xb020('0x78')][_0x12cbe5]['foreignKey']));}}}if(_0x669cc8[_0xb020('0x7e')]){_0x669cc8[_0xb020('0x7e')]=JSON[_0xb020('0x79')](_0x669cc8[_0xb020('0x7e')]);_0x379646[_0xb020('0x3b')](_0x2df080(_0x669cc8[_0xb020('0x7e')][_0xb020('0x64')]));}_0x7aa6e=_0x379646['clone']();_0x379646[_0xb020('0x1b')](_0x1f430f);_0x379646[_0xb020('0x39')](0x0);logger[_0xb020('0x7f')](_0xb020('0x9d'),_0x379646[_0xb020('0x81')]());return dbH[_0xb020('0x80')][_0xb020('0x33')](_0x379646[_0xb020('0x81')](),{'type':dbH[_0xb020('0x80')]['QueryTypes'][_0xb020('0x83')]});}})[_0xb020('0x23')](function(){return{'sql':_0x7aa6e['toString']()};})[_0xb020('0x23')](respondWithResult(_0x43a17,null))['catch'](handleError(_0x43a17,null));};
\ No newline at end of file
+var _0xf14f=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','update','destroy','get','then','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','keys','filters','query','attributes','fields','length','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','metric','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','right_join','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2e8887,_0x51e382){var _0x23328e=function(_0x4f4e27){while(--_0x4f4e27){_0x2e8887['push'](_0x2e8887['shift']());}};_0x23328e(++_0x51e382);}(_0xf14f,0x1e2));var _0xff14=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0xf14f[_0x1ee9a1];return _0x21270f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff14('0x0'));var zipdir=require(_0xff14('0x1'));var jsonpatch=require(_0xff14('0x2'));var rp=require('request-promise');var moment=require(_0xff14('0x3'));var BPromise=require(_0xff14('0x4'));var Mustache=require('mustache');var util=require(_0xff14('0x5'));var path=require(_0xff14('0x6'));var sox=require(_0xff14('0x7'));var csv=require(_0xff14('0x8'));var ejs=require(_0xff14('0x9'));var fs=require('fs');var fs_extra=require(_0xff14('0xa'));var _=require(_0xff14('0xb'));var squel=require(_0xff14('0xc'));var crypto=require(_0xff14('0xd'));var jsforce=require(_0xff14('0xe'));var deskjs=require(_0xff14('0xf'));var toCsv=require('to-csv');var querystring=require(_0xff14('0x10'));var Papa=require(_0xff14('0x11'));var Redis=require(_0xff14('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xff14('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff14('0x14'));var logger=require(_0xff14('0x15'))(_0xff14('0x16'));var utils=require(_0xff14('0x17'));var config=require(_0xff14('0x18'));var licenseUtil=require(_0xff14('0x19'));var db=require(_0xff14('0x1a'))['db'];var dbH=require(_0xff14('0x1a'))[_0xff14('0x1b')];function respondWithStatusCode(_0x4c4f1e,_0x82b132){_0x82b132=_0x82b132||0xcc;return function(_0x2f3f62){if(_0x2f3f62){return _0x4c4f1e[_0xff14('0x1c')](_0x82b132);}return _0x4c4f1e[_0xff14('0x1d')](_0x82b132)[_0xff14('0x1e')]();};}function respondWithResult(_0xc24c51,_0x895d1f){_0x895d1f=_0x895d1f||0xc8;return function(_0x412120){if(_0x412120){return _0xc24c51[_0xff14('0x1d')](_0x895d1f)['json'](_0x412120);}};}function respondWithFilteredResult(_0x25f38b,_0x4f459d){return function(_0xba4ee3){if(_0xba4ee3){var _0x5dae63=typeof _0x4f459d[_0xff14('0x1f')]===_0xff14('0x20')&&typeof _0x4f459d['limit']==='undefined';var _0x4f4a95=_0xba4ee3[_0xff14('0x21')];var _0x2f9577=_0x5dae63?0x0:_0x4f459d[_0xff14('0x1f')];var _0x5e37ed=_0x5dae63?_0xba4ee3[_0xff14('0x21')]:_0x4f459d[_0xff14('0x1f')]+_0x4f459d[_0xff14('0x22')];var _0xb995dc;if(_0x5e37ed>=_0x4f4a95){_0x5e37ed=_0x4f4a95;_0xb995dc=0xc8;}else{_0xb995dc=0xce;}_0x25f38b[_0xff14('0x1d')](_0xb995dc);return _0x25f38b[_0xff14('0x23')]('Content-Range',_0x2f9577+'-'+_0x5e37ed+'/'+_0x4f4a95)[_0xff14('0x24')](_0xba4ee3);}return null;};}function patchUpdates(_0x4352ab){return function(_0x744af6){try{jsonpatch[_0xff14('0x25')](_0x744af6,_0x4352ab,!![]);}catch(_0x1bf6d0){return BPromise[_0xff14('0x26')](_0x1bf6d0);}return _0x744af6['save']();};}function saveUpdates(_0x48c3e3,_0x6f7a87){return function(_0x252b06){if(_0x252b06){return _0x252b06[_0xff14('0x27')](_0x48c3e3)['then'](function(_0x3b2f38){return _0x3b2f38;});}return null;};}function removeEntity(_0x3e13d8,_0x3d1778){return function(_0x228d4a){if(_0x228d4a){return _0x228d4a[_0xff14('0x28')]()['then'](function(){var _0x4a8fbd=_0x228d4a[_0xff14('0x29')]({'plain':!![]});var _0x450c3a='CustomReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x450c3a,'resourceId':_0x4a8fbd['id']}})[_0xff14('0x2a')](function(){return _0x228d4a;});})['then'](function(){_0x3e13d8['status'](0xcc)[_0xff14('0x1e')]();});}};}function handleEntityNotFound(_0x35d03f,_0x14987c){return function(_0x2e4b52){if(!_0x2e4b52){_0x35d03f[_0xff14('0x1c')](0x194);}return _0x2e4b52;};}function handleError(_0x342ef5,_0x332c5a){_0x332c5a=_0x332c5a||0x1f4;return function(_0x5bccbb){logger[_0xff14('0x2b')](_0x5bccbb[_0xff14('0x2c')]);if(_0x5bccbb[_0xff14('0x2d')]){delete _0x5bccbb[_0xff14('0x2d')];}_0x342ef5[_0xff14('0x1d')](_0x332c5a)[_0xff14('0x2e')](_0x5bccbb);};}exports[_0xff14('0x2f')]=function(_0x595788,_0x2d2b98){var _0x145d0d={},_0x13194e={},_0x232a3f={'count':0x0,'rows':[]};var _0x2688ff=_[_0xff14('0x30')](db[_0xff14('0x31')][_0xff14('0x32')],function(_0x20a8cc){return{'name':_0x20a8cc['fieldName'],'type':_0x20a8cc[_0xff14('0x33')][_0xff14('0x34')]};});_0x13194e[_0xff14('0x35')]=_[_0xff14('0x30')](_0x2688ff,_0xff14('0x2d'));_0x13194e['query']=_[_0xff14('0x36')](_0x595788['query']);_0x13194e[_0xff14('0x37')]=_['intersection'](_0x13194e[_0xff14('0x35')],_0x13194e[_0xff14('0x38')]);_0x145d0d[_0xff14('0x39')]=_['intersection'](_0x13194e[_0xff14('0x35')],qs[_0xff14('0x3a')](_0x595788[_0xff14('0x38')][_0xff14('0x3a')]));_0x145d0d[_0xff14('0x39')]=_0x145d0d[_0xff14('0x39')][_0xff14('0x3b')]?_0x145d0d[_0xff14('0x39')]:_0x13194e[_0xff14('0x35')];if(!_0x595788[_0xff14('0x38')]['hasOwnProperty']('nolimit')){_0x145d0d[_0xff14('0x22')]=qs[_0xff14('0x22')](_0x595788['query'][_0xff14('0x22')]);_0x145d0d['offset']=qs['offset'](_0x595788['query']['offset']);}_0x145d0d[_0xff14('0x3c')]=qs['sort'](_0x595788[_0xff14('0x38')][_0xff14('0x3d')]);_0x145d0d['where']=qs[_0xff14('0x37')](_[_0xff14('0x3e')](_0x595788['query'],_0x13194e[_0xff14('0x37')]),_0x2688ff);if(_0x595788[_0xff14('0x38')][_0xff14('0x3f')]){_0x145d0d['where']=_[_0xff14('0x40')](_0x145d0d[_0xff14('0x41')],{'$or':_[_0xff14('0x30')](_0x2688ff,function(_0x526208){if(_0x526208[_0xff14('0x33')]!==_0xff14('0x42')){var _0x25d7fc={};_0x25d7fc[_0x526208[_0xff14('0x2d')]]={'$like':'%'+_0x595788[_0xff14('0x38')][_0xff14('0x3f')]+'%'};return _0x25d7fc;}})});}_0x145d0d=_[_0xff14('0x40')]({},_0x145d0d,_0x595788[_0xff14('0x43')]);var _0x1b2167={'where':_0x145d0d[_0xff14('0x41')]};return db[_0xff14('0x31')][_0xff14('0x21')](_0x1b2167)[_0xff14('0x2a')](function(_0xf547b8){_0x232a3f['count']=_0xf547b8;if(_0x595788[_0xff14('0x38')][_0xff14('0x44')]){_0x145d0d[_0xff14('0x45')]=[{'all':!![]}];}return db[_0xff14('0x31')][_0xff14('0x46')](_0x145d0d);})[_0xff14('0x2a')](function(_0x588dbb){_0x232a3f['rows']=_0x588dbb;return _0x232a3f;})['then'](respondWithFilteredResult(_0x2d2b98,_0x145d0d))[_0xff14('0x47')](handleError(_0x2d2b98,null));};exports[_0xff14('0x48')]=function(_0x40e44f,_0x258575){var _0x43bc4e={'raw':![],'where':{'id':_0x40e44f[_0xff14('0x49')]['id']}},_0x495a61={};_0x495a61[_0xff14('0x35')]=_[_0xff14('0x36')](db[_0xff14('0x31')][_0xff14('0x32')]);_0x495a61[_0xff14('0x38')]=_[_0xff14('0x36')](_0x40e44f[_0xff14('0x38')]);_0x495a61[_0xff14('0x37')]=_['intersection'](_0x495a61[_0xff14('0x35')],_0x495a61[_0xff14('0x38')]);_0x43bc4e[_0xff14('0x39')]=_['intersection'](_0x495a61['model'],qs[_0xff14('0x3a')](_0x40e44f['query'][_0xff14('0x3a')]));_0x43bc4e[_0xff14('0x39')]=_0x43bc4e[_0xff14('0x39')][_0xff14('0x3b')]?_0x43bc4e['attributes']:_0x495a61[_0xff14('0x35')];if(_0x40e44f[_0xff14('0x38')][_0xff14('0x44')]){_0x43bc4e['include']=[{'all':!![]}];}_0x43bc4e=_[_0xff14('0x40')]({},_0x43bc4e,_0x40e44f[_0xff14('0x43')]);return db[_0xff14('0x31')][_0xff14('0x4a')](_0x43bc4e)[_0xff14('0x2a')](handleEntityNotFound(_0x258575,null))[_0xff14('0x2a')](respondWithResult(_0x258575,null))[_0xff14('0x47')](handleError(_0x258575,null));};exports[_0xff14('0x4b')]=function(_0xe0cac2,_0x2b2ee8){return db[_0xff14('0x31')][_0xff14('0x4b')](_0xe0cac2[_0xff14('0x4c')],{})['then'](function(_0x29599e){var _0x54ec76=_0xe0cac2['user']['get']({'plain':!![]});if(!_0x54ec76)throw new Error(_0xff14('0x4d'));if(_0x54ec76['role']===_0xff14('0x4e')){var _0x42dc49=_0x29599e[_0xff14('0x29')]({'plain':!![]});var _0x17d8f2=_0xff14('0x4f');return db[_0xff14('0x50')][_0xff14('0x4a')]({'where':{'name':_0x17d8f2,'userProfileId':_0x54ec76['userProfileId']},'raw':!![]})['then'](function(_0x141e90){if(_0x141e90&&_0x141e90[_0xff14('0x51')]===0x0){return db[_0xff14('0x52')][_0xff14('0x4b')]({'name':_0x42dc49['name'],'resourceId':_0x42dc49['id'],'type':_0xff14('0x53'),'sectionId':_0x141e90['id']},{})[_0xff14('0x2a')](function(){return _0x29599e;});}else{return _0x29599e;}})[_0xff14('0x47')](function(_0xa969e0){logger[_0xff14('0x2b')](_0xff14('0x54'),_0xa969e0);throw _0xa969e0;});}return _0x29599e;})[_0xff14('0x2a')](respondWithResult(_0x2b2ee8,0xc9))[_0xff14('0x47')](handleError(_0x2b2ee8,null));};exports[_0xff14('0x27')]=function(_0x1a19b6,_0x33aafb){if(_0x1a19b6[_0xff14('0x4c')]['id']){delete _0x1a19b6['body']['id'];}return db[_0xff14('0x31')][_0xff14('0x4a')]({'where':{'id':_0x1a19b6[_0xff14('0x49')]['id']}})[_0xff14('0x2a')](handleEntityNotFound(_0x33aafb,null))[_0xff14('0x2a')](saveUpdates(_0x1a19b6[_0xff14('0x4c')],null))[_0xff14('0x2a')](respondWithResult(_0x33aafb,null))[_0xff14('0x47')](handleError(_0x33aafb,null));};exports['destroy']=function(_0x48f6d2,_0x175b8d){return db[_0xff14('0x31')][_0xff14('0x4a')]({'where':{'id':_0x48f6d2[_0xff14('0x49')]['id']}})[_0xff14('0x2a')](handleEntityNotFound(_0x175b8d,null))[_0xff14('0x2a')](removeEntity(_0x175b8d,null))[_0xff14('0x47')](handleError(_0x175b8d,null));};exports[_0xff14('0x55')]=function(_0xc1f575,_0x5aa284){var _0x34cc0b=0xa;var _0x2b16c2=[_0xff14('0x56'),_0xff14('0x57'),'right_join',_0xff14('0x58')];var _0xf0cecc={'SUM':_0xff14('0x59'),'COUNT':_0xff14('0x5a'),'COUNT DISTINCT':_0xff14('0x5b'),'MAX':_0xff14('0x5c'),'MIN':_0xff14('0x5d'),'AVG':_0xff14('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xff14('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34d8cf={'SEC_TO_TIME':_0xff14('0x60'),'DATE':_0xff14('0x61'),'HOUR':_0xff14('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xff14('0x63')};var _0xbed5e7=function(_0x20d777){return!_[_0xff14('0x64')]([_0xff14('0x65'),_0xff14('0x66'),_0xff14('0x67'),_0xff14('0x68')],_0x20d777);};var _0x591031=function(_0x21d572){if(!_0x21d572||!_0x21d572[_0xff14('0x69')][_0xff14('0x3b')]){return'';}for(var _0x1d4eed='(',_0x2d8717=0x0;_0x2d8717<_0x21d572[_0xff14('0x69')]['length'];_0x2d8717+=0x1){_0x2d8717>0x0&&(_0x1d4eed+='\x20'+_0x21d572[_0xff14('0x6a')]+'\x20');_0x1d4eed+=_0x21d572[_0xff14('0x69')][_0x2d8717]['group']?_0x591031(_0x21d572[_0xff14('0x69')][_0x2d8717][_0xff14('0x6b')]):_0x21d572[_0xff14('0x69')][_0x2d8717]['field']+'\x20'+_0x21d572[_0xff14('0x69')][_0x2d8717]['condition']+(_0xbed5e7(_0x21d572[_0xff14('0x69')][_0x2d8717][_0xff14('0x6c')])?'\x20'+_0x21d572['rules'][_0x2d8717][_0xff14('0x6d')]:'');}return _0x1d4eed+')';};var _0x38d18e={'where':{'id':_0xc1f575[_0xff14('0x49')]['id']}},_0x411c20,_0xb90ebf,_0xff3e8d,_0x1c8e9b,_0x5a0e35;_0x38d18e=_[_0xff14('0x40')]({},_0x38d18e,_0xc1f575[_0xff14('0x43')]);return db[_0xff14('0x31')]['find'](_0x38d18e)[_0xff14('0x2a')](function(_0xbd66b7){if(_0xbd66b7){_0x411c20=_0xbd66b7;return _0xbd66b7[_0xff14('0x6e')]();}return null;})[_0xff14('0x2a')](function(_0x327519){if(_0x327519){if(!_0x327519[_0xff14('0x3b')]){throw new db[(_0xff14('0x6f'))][(_0xff14('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xb90ebf=_0x327519;return db[_0xff14('0x71')][_0xff14('0x46')]({'raw':!![]});}return null;})[_0xff14('0x2a')](function(_0x2888e1){if(_0x2888e1){_0xff3e8d=_[_0xff14('0x72')](_0x2888e1,'id');var _0x5d4fa1;var _0x4257a0=squel[_0xff14('0x73')]();_0x4257a0[_0xff14('0x74')](_0x411c20[_0xff14('0x75')]);for(var _0x1fdebc=0x0;_0x1fdebc<_0xb90ebf[_0xff14('0x3b')];_0x1fdebc+=0x1){_0x5d4fa1=_0xb90ebf[_0x1fdebc][_0xff14('0x76')]?_0xff3e8d[_0xb90ebf[_0x1fdebc][_0xff14('0x76')]]['metric']:_0xb90ebf[_0x1fdebc][_0xff14('0x77')];_0x5d4fa1=_0xb90ebf[_0x1fdebc][_0xff14('0x78')]?_[_0xff14('0x79')](_0xf0cecc[_0xb90ebf[_0x1fdebc]['function']],'%s',_0x5d4fa1):_0x5d4fa1;_0x5d4fa1=_0xb90ebf[_0x1fdebc][_0xff14('0x7a')]?_[_0xff14('0x79')](_0x34d8cf[_0xb90ebf[_0x1fdebc]['format']],'%s',_0x5d4fa1):_0x5d4fa1;if(_0xb90ebf[_0x1fdebc][_0xff14('0x7b')]){_0x4257a0['group'](_0x5d4fa1);}_0xb90ebf[_0x1fdebc][_0xff14('0x7c')]&&_0x4257a0[_0xff14('0x3c')](_0x5d4fa1,_0xb90ebf[_0x1fdebc][_0xff14('0x7c')]===_0xff14('0x7d')?![]:!![]);_0x4257a0[_0xff14('0x77')](_0x5d4fa1,_0xb90ebf[_0x1fdebc][_0xff14('0x7e')]||_0x5d4fa1);}if(_0x411c20[_0xff14('0x7f')]){_0x411c20[_0xff14('0x7f')]=JSON['parse'](_0x411c20[_0xff14('0x7f')]);for(var _0x19c897=0x0;_0x19c897<_0x411c20['joins'][_0xff14('0x3b')];_0x19c897+=0x1){if(_0x411c20['joins'][_0x19c897][_0xff14('0x33')]&&_[_0xff14('0x64')](_0x2b16c2,_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x33')])&&_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x80')]&&_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x81')]&&_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x82')]){_0x4257a0[_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x33')]](_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x81')],null,util[_0xff14('0x7a')](_0xff14('0x83'),_0x411c20['table'],_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x80')],_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x81')],_0x411c20[_0xff14('0x7f')][_0x19c897][_0xff14('0x82')]));}}}if(_0x411c20['conditions']){_0x411c20[_0xff14('0x84')]=JSON[_0xff14('0x85')](_0x411c20[_0xff14('0x84')]);_0x4257a0[_0xff14('0x41')](_0x591031(_0x411c20[_0xff14('0x84')][_0xff14('0x6b')]));}_0x5a0e35=_0x4257a0[_0xff14('0x86')]();_0x4257a0[_0xff14('0x22')](_0x34cc0b);_0x4257a0[_0xff14('0x1f')](0x0);logger[_0xff14('0x87')](_0xff14('0x88'),_0x4257a0[_0xff14('0x89')]());return dbH[_0xff14('0x8a')]['query'](_0x4257a0[_0xff14('0x89')](),{'type':dbH[_0xff14('0x8a')][_0xff14('0x8b')][_0xff14('0x8c')]});}})['then'](respondWithResult(_0x5aa284,null))['catch'](handleError(_0x5aa284,null));};function runReport(_0x2ba7e2,_0x4d7c6d,_0xd2caac){var _0x5cdd00=_0x4d7c6d[_0xff14('0x2d')];var _0x31ddae=0xa;var _0x4af72a=[_0xff14('0x56'),_0xff14('0x57'),'right_join',_0xff14('0x58')];var _0x68366a={'SUM':_0xff14('0x59'),'COUNT':_0xff14('0x5a'),'COUNT DISTINCT':_0xff14('0x5b'),'MAX':_0xff14('0x5c'),'MIN':'MIN(%s)','AVG':_0xff14('0x5e'),'GROUP_CONCAT':_0xff14('0x8d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xff14('0x8e')};var _0xbebe61={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xff14('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xff14('0x8f'),'UNIX_TIMESTAMP':_0xff14('0x63')};var _0x57c2e3=function(_0x46f246){return!_[_0xff14('0x64')]([_0xff14('0x65'),_0xff14('0x66'),_0xff14('0x67'),_0xff14('0x68')],_0x46f246);};var _0x966a7d=function(_0x2db90b){if(!_0x2db90b||!_0x2db90b[_0xff14('0x69')][_0xff14('0x3b')]){return'';}for(var _0x5d8edf='(',_0xe15c0b=0x0;_0xe15c0b<_0x2db90b[_0xff14('0x69')][_0xff14('0x3b')];_0xe15c0b+=0x1){_0xe15c0b>0x0&&(_0x5d8edf+='\x20'+_0x2db90b['operator']+'\x20');_0x5d8edf+=_0x2db90b[_0xff14('0x69')][_0xe15c0b]['group']?_0x966a7d(_0x2db90b['rules'][_0xe15c0b][_0xff14('0x6b')]):_0x2db90b['rules'][_0xe15c0b]['field']+'\x20'+_0x2db90b[_0xff14('0x69')][_0xe15c0b][_0xff14('0x6c')]+(_0x57c2e3(_0x2db90b['rules'][_0xe15c0b]['condition'])?'\x20'+_0x2db90b['rules'][_0xe15c0b]['value']:'');}return _0x5d8edf+')';};var _0x46b06e={'where':{'id':_0x2ba7e2['id']}},_0xb32299,_0x129022,_0x436363,_0x3b7528,_0x540512;_0x46b06e=_[_0xff14('0x40')]({},_0x46b06e,_0xd2caac);return db[_0xff14('0x31')][_0xff14('0x4a')](_0x46b06e)[_0xff14('0x2a')](function(_0x332539){if(_0x332539){_0xb32299=_0x332539;return _0x332539[_0xff14('0x6e')]();}return null;})[_0xff14('0x2a')](function(_0x2d1ed0){if(_0x2d1ed0){if(!_0x2d1ed0[_0xff14('0x3b')]){throw new db['Sequelize'][(_0xff14('0x70'))](_0xff14('0x90'),0x193);}_0x129022=_0x2d1ed0;return db[_0xff14('0x71')][_0xff14('0x46')]({'raw':!![]});}return null;})[_0xff14('0x2a')](function(_0x1e4cf5){if(_0x1e4cf5){_0x436363=_['keyBy'](_0x1e4cf5,'id');var _0x1f46e7;var _0x800b0f=squel[_0xff14('0x73')]();_0x800b0f[_0xff14('0x74')](_0xb32299[_0xff14('0x75')]);for(var _0x23911d=0x0;_0x23911d<_0x129022['length'];_0x23911d+=0x1){_0x1f46e7=_0x129022[_0x23911d][_0xff14('0x76')]?_0x436363[_0x129022[_0x23911d][_0xff14('0x76')]][_0xff14('0x91')]:_0x129022[_0x23911d][_0xff14('0x77')];_0x1f46e7=_0x129022[_0x23911d]['function']?_[_0xff14('0x79')](_0x68366a[_0x129022[_0x23911d][_0xff14('0x78')]],'%s',_0x1f46e7):_0x1f46e7;_0x1f46e7=_0x129022[_0x23911d][_0xff14('0x7a')]?_['replace'](_0xbebe61[_0x129022[_0x23911d][_0xff14('0x7a')]],'%s',_0x1f46e7):_0x1f46e7;if(_0x129022[_0x23911d]['groupBy']){_0x800b0f[_0xff14('0x6b')](_0x1f46e7);}_0x129022[_0x23911d][_0xff14('0x7c')]&&_0x800b0f[_0xff14('0x3c')](_0x1f46e7,_0x129022[_0x23911d][_0xff14('0x7c')]==='DESC'?![]:!![]);_0x800b0f[_0xff14('0x77')](_0x1f46e7,_0x129022[_0x23911d][_0xff14('0x7e')]||_0x1f46e7);}if(_0xb32299[_0xff14('0x7f')]){_0xb32299[_0xff14('0x7f')]=JSON[_0xff14('0x85')](_0xb32299[_0xff14('0x7f')]);for(var _0x5021d5=0x0;_0x5021d5<_0xb32299[_0xff14('0x7f')][_0xff14('0x3b')];_0x5021d5+=0x1){if(_0xb32299['joins'][_0x5021d5][_0xff14('0x33')]&&_[_0xff14('0x64')](_0x4af72a,_0xb32299[_0xff14('0x7f')][_0x5021d5][_0xff14('0x33')])&&_0xb32299[_0xff14('0x7f')][_0x5021d5][_0xff14('0x80')]&&_0xb32299[_0xff14('0x7f')][_0x5021d5][_0xff14('0x81')]&&_0xb32299[_0xff14('0x7f')][_0x5021d5]['foreignKey']){_0x800b0f[_0xb32299[_0xff14('0x7f')][_0x5021d5]['type']](_0xb32299['joins'][_0x5021d5][_0xff14('0x81')],null,util[_0xff14('0x7a')](_0xff14('0x83'),_0xb32299[_0xff14('0x75')],_0xb32299[_0xff14('0x7f')][_0x5021d5]['parentKey'],_0xb32299[_0xff14('0x7f')][_0x5021d5][_0xff14('0x81')],_0xb32299['joins'][_0x5021d5]['foreignKey']));}}}if(_0xb32299[_0xff14('0x84')]){_0xb32299[_0xff14('0x84')]=JSON[_0xff14('0x85')](_0xb32299[_0xff14('0x84')]);_0x800b0f['where'](_0x966a7d(_0xb32299[_0xff14('0x84')][_0xff14('0x6b')]));}_0x540512=_0x800b0f[_0xff14('0x86')]();_0x800b0f[_0xff14('0x22')](_0x31ddae);_0x800b0f['offset'](0x0);return;}})[_0xff14('0x2a')](function(){if(_0x4d7c6d[_0xff14('0x92')]===_0xff14('0x93')){return null;}var _0x95c3c6=_['merge'](_0x4d7c6d,{'name':_0x4d7c6d[_0xff14('0x94')]||_0x4d7c6d[_0xff14('0x2d')]||_0xb32299[_0xff14('0x2d')],'basename':_0x5cdd00,'savename':util[_0xff14('0x7a')](_0xff14('0x95'),_0x4d7c6d[_0xff14('0x2d')]||_0xb32299[_0xff14('0x2d')],require('randomstring')['generate'](0x4),_0x4d7c6d[_0xff14('0x92')]||_0xff14('0x96')),'reportId':_0xb32299['id'],'reportType':_0xff14('0x97')});return db[_0xff14('0x98')][_0xff14('0x4b')](_0x95c3c6,{'raw':!![]});})[_0xff14('0x2a')](function(_0x39bfa4){if(_0xb32299[_0xff14('0x75')]==='cdr'){_0x540512[_0xff14('0x41')](_0xb32299[_0xff14('0x75')]+_0xff14('0x99'),_0x4d7c6d[_0xff14('0x9a')],_0x4d7c6d[_0xff14('0x9b')]);}else{_0x540512[_0xff14('0x41')](_0xb32299['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4d7c6d[_0xff14('0x9a')],_0x4d7c6d[_0xff14('0x9b')]);}if(_0x39bfa4){logger['info'](_0xff14('0x9c'),_0x540512[_0xff14('0x89')]());require(_0xff14('0x9d'))[_0xff14('0x9e')](path['join'](__dirname,_0xff14('0x9f'),_0x39bfa4[_0xff14('0x92')]),[_0x39bfa4['id'],_0x540512[_0xff14('0x89')](),path[_0xff14('0x56')](__dirname,_0xff14('0xa0'),_0x39bfa4[_0xff14('0xa1')]),_0x5cdd00]);return _0x39bfa4;}else{var _0x1f9d6b=squel['select']();_0x1f9d6b[_0xff14('0x74')]('('+_0x540512['toString']()+')',_0xff14('0xa2'));_0x1f9d6b[_0xff14('0x77')](_0xff14('0xa3'),_0xff14('0x21'));_0x540512[_0xff14('0x22')](_0x4d7c6d[_0xff14('0x22')]||_0x31ddae);_0x540512[_0xff14('0x1f')](_0x4d7c6d[_0xff14('0x1f')]||0x0);return dbH[_0xff14('0x8a')][_0xff14('0x38')](_0x1f9d6b[_0xff14('0x89')](),{'type':dbH[_0xff14('0x8a')][_0xff14('0x8b')]['SELECT']})[_0xff14('0x2a')](function(_0x1319dc){if(!_0x1319dc[_0xff14('0x3b')]){_0x3b7528=0x0;}else{_0x3b7528=_0x1319dc[0x0][_0xff14('0x21')]||0x0;}return dbH[_0xff14('0x8a')][_0xff14('0x38')](_0x540512[_0xff14('0x89')](),{'type':dbH[_0xff14('0x8a')][_0xff14('0x8b')][_0xff14('0x8c')]});})[_0xff14('0x2a')](function(_0xba9947){return{'rows':_0xba9947||[],'count':_0x3b7528};});}});}exports[_0xff14('0xa4')]=function(_0x23a8ef,_0x36f0f7){return runReport(_0x23a8ef[_0xff14('0x49')],_0x23a8ef[_0xff14('0x38')],_0x23a8ef['options'])['then'](respondWithResult(_0x36f0f7,null))[_0xff14('0x47')](handleError(_0x36f0f7,null));};exports['runReport']=runReport;exports[_0xff14('0x38')]=function(_0x20f370,_0x2c046e){var _0x450070=0xa;var _0x449f44=[_0xff14('0x56'),'left_join',_0xff14('0xa5'),_0xff14('0x58')];var _0x174b31={'SUM':_0xff14('0x59'),'COUNT':_0xff14('0x5a'),'COUNT DISTINCT':_0xff14('0x5b'),'MAX':_0xff14('0x5c'),'MIN':_0xff14('0x5d'),'AVG':_0xff14('0x5e'),'GROUP_CONCAT':_0xff14('0x8d'),'GROUP_CONCAT ASC':_0xff14('0x5f'),'GROUP_CONCAT DESC':_0xff14('0x8e')};var _0x2a3ad8={'SEC_TO_TIME':_0xff14('0x60'),'DATE':_0xff14('0x61'),'HOUR':_0xff14('0x62'),'ROUND':_0xff14('0x8f'),'UNIX_TIMESTAMP':_0xff14('0x63')};var _0x33b7b7=function(_0x24a695){return!_['includes']([_0xff14('0x65'),_0xff14('0x66'),'IS\x20EMPTY',_0xff14('0x68')],_0x24a695);};var _0x50d884=function(_0x5b69d5){if(!_0x5b69d5||!_0x5b69d5[_0xff14('0x69')][_0xff14('0x3b')]){return'';}for(var _0x4cc641='(',_0x340ec2=0x0;_0x340ec2<_0x5b69d5[_0xff14('0x69')][_0xff14('0x3b')];_0x340ec2+=0x1){_0x340ec2>0x0&&(_0x4cc641+='\x20'+_0x5b69d5[_0xff14('0x6a')]+'\x20');_0x4cc641+=_0x5b69d5[_0xff14('0x69')][_0x340ec2][_0xff14('0x6b')]?_0x50d884(_0x5b69d5['rules'][_0x340ec2][_0xff14('0x6b')]):_0x5b69d5['rules'][_0x340ec2][_0xff14('0x77')]+'\x20'+_0x5b69d5[_0xff14('0x69')][_0x340ec2][_0xff14('0x6c')]+(_0x33b7b7(_0x5b69d5[_0xff14('0x69')][_0x340ec2]['condition'])?'\x20'+_0x5b69d5[_0xff14('0x69')][_0x340ec2]['value']:'');}return _0x4cc641+')';};var _0x3819c0={'where':{'id':_0x20f370[_0xff14('0x49')]['id']}},_0x4dd511,_0x158ff8,_0x57f997,_0xf33168,_0x1c6ce2;_0x3819c0=_[_0xff14('0x40')]({},_0x3819c0,_0x20f370[_0xff14('0x43')]);return db[_0xff14('0x31')][_0xff14('0x4a')](_0x3819c0)[_0xff14('0x2a')](function(_0x1f8b6d){if(_0x1f8b6d){_0x4dd511=_0x1f8b6d;return _0x1f8b6d[_0xff14('0x6e')]();}return null;})[_0xff14('0x2a')](function(_0x2fd6e5){if(_0x2fd6e5){if(!_0x2fd6e5['length']){throw new db[(_0xff14('0x6f'))][(_0xff14('0x70'))](_0xff14('0x90'),0x193);}_0x158ff8=_0x2fd6e5;return db[_0xff14('0x71')][_0xff14('0x46')]({'raw':!![]});}return null;})[_0xff14('0x2a')](function(_0x2489e3){if(_0x2489e3){_0x57f997=_[_0xff14('0x72')](_0x2489e3,'id');var _0x15207a;var _0x571e4f=squel[_0xff14('0x73')]();_0x571e4f[_0xff14('0x74')](_0x4dd511['table']);for(var _0x28c896=0x0;_0x28c896<_0x158ff8[_0xff14('0x3b')];_0x28c896+=0x1){_0x15207a=_0x158ff8[_0x28c896][_0xff14('0x76')]?_0x57f997[_0x158ff8[_0x28c896][_0xff14('0x76')]][_0xff14('0x91')]:_0x158ff8[_0x28c896][_0xff14('0x77')];_0x15207a=_0x158ff8[_0x28c896][_0xff14('0x78')]?_['replace'](_0x174b31[_0x158ff8[_0x28c896][_0xff14('0x78')]],'%s',_0x15207a):_0x15207a;_0x15207a=_0x158ff8[_0x28c896][_0xff14('0x7a')]?_[_0xff14('0x79')](_0x2a3ad8[_0x158ff8[_0x28c896][_0xff14('0x7a')]],'%s',_0x15207a):_0x15207a;if(_0x158ff8[_0x28c896]['groupBy']){_0x571e4f[_0xff14('0x6b')](_0x15207a);}_0x158ff8[_0x28c896][_0xff14('0x7c')]&&_0x571e4f[_0xff14('0x3c')](_0x15207a,_0x158ff8[_0x28c896][_0xff14('0x7c')]===_0xff14('0x7d')?![]:!![]);_0x571e4f[_0xff14('0x77')](_0x15207a,_0x158ff8[_0x28c896]['alias']||_0x15207a);}if(_0x4dd511['joins']){_0x4dd511[_0xff14('0x7f')]=JSON[_0xff14('0x85')](_0x4dd511[_0xff14('0x7f')]);for(var _0x404ebf=0x0;_0x404ebf<_0x4dd511[_0xff14('0x7f')][_0xff14('0x3b')];_0x404ebf+=0x1){if(_0x4dd511[_0xff14('0x7f')][_0x404ebf]['type']&&_['includes'](_0x449f44,_0x4dd511['joins'][_0x404ebf]['type'])&&_0x4dd511['joins'][_0x404ebf][_0xff14('0x80')]&&_0x4dd511[_0xff14('0x7f')][_0x404ebf][_0xff14('0x81')]&&_0x4dd511[_0xff14('0x7f')][_0x404ebf][_0xff14('0x82')]){_0x571e4f[_0x4dd511[_0xff14('0x7f')][_0x404ebf][_0xff14('0x33')]](_0x4dd511[_0xff14('0x7f')][_0x404ebf]['foreignTable'],null,util[_0xff14('0x7a')](_0xff14('0x83'),_0x4dd511[_0xff14('0x75')],_0x4dd511[_0xff14('0x7f')][_0x404ebf][_0xff14('0x80')],_0x4dd511[_0xff14('0x7f')][_0x404ebf][_0xff14('0x81')],_0x4dd511[_0xff14('0x7f')][_0x404ebf][_0xff14('0x82')]));}}}if(_0x4dd511['conditions']){_0x4dd511['conditions']=JSON[_0xff14('0x85')](_0x4dd511[_0xff14('0x84')]);_0x571e4f[_0xff14('0x41')](_0x50d884(_0x4dd511[_0xff14('0x84')][_0xff14('0x6b')]));}_0x1c6ce2=_0x571e4f['clone']();_0x571e4f['limit'](_0x450070);_0x571e4f[_0xff14('0x1f')](0x0);logger['debug'](_0xff14('0x88'),_0x571e4f['toString']());return dbH[_0xff14('0x8a')][_0xff14('0x38')](_0x571e4f[_0xff14('0x89')](),{'type':dbH[_0xff14('0x8a')][_0xff14('0x8b')][_0xff14('0x8c')]});}})[_0xff14('0x2a')](function(){return{'sql':_0x1c6ce2[_0xff14('0x89')]()};})[_0xff14('0x2a')](respondWithResult(_0x2c046e,null))[_0xff14('0x47')](handleError(_0x2c046e,null));};
\ No newline at end of file
index dd30861..cb70747 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1575=['analytics_custom_reports','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x5be9b3,_0x2138dc){var _0x5a9514=function(_0x1f5533){while(--_0x1f5533){_0x5be9b3['push'](_0x5be9b3['shift']());}};_0x5a9514(++_0x2138dc);}(_0x1575,0x137));var _0x5157=function(_0x41a60b,_0xc398d){_0x41a60b=_0x41a60b-0x0;var _0x10c95a=_0x1575[_0x41a60b];return _0x10c95a;};'use strict';var _=require(_0x5157('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5157('0x1'));var moment=require(_0x5157('0x2'));var BPromise=require(_0x5157('0x3'));var rp=require(_0x5157('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5157('0x5'));var config=require(_0x5157('0x6'));var attributes=require(_0x5157('0x7'));module[_0x5157('0x8')]=function(_0x278135,_0x54407f){return _0x278135['define']('AnalyticCustomReport',attributes,{'tableName':_0x5157('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x804b=['exports','define','analytics_custom_reports','lodash','api','moment','request-promise','path','rimraf'];(function(_0x19b1c,_0x45e5f5){var _0x2910f8=function(_0x1d4d88){while(--_0x1d4d88){_0x19b1c['push'](_0x19b1c['shift']());}};_0x2910f8(++_0x45e5f5);}(_0x804b,0x111));var _0xb804=function(_0x3fe245,_0xa9e7f9){_0x3fe245=_0x3fe245-0x0;var _0x24d08b=_0x804b[_0x3fe245];return _0x24d08b;};'use strict';var _=require(_0xb804('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb804('0x1'));var moment=require(_0xb804('0x2'));var BPromise=require('bluebird');var rp=require(_0xb804('0x3'));var fs=require('fs');var path=require(_0xb804('0x4'));var rimraf=require(_0xb804('0x5'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xb804('0x6')]=function(_0x2bd970,_0x11f840){return _0x2bd970[_0xb804('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0xb804('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 53d1715..a91677e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1da4=['info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5a6bc5,_0x434298){var _0x27715e=function(_0x71150f){while(--_0x71150f){_0x5a6bc5['push'](_0x5a6bc5['shift']());}};_0x27715e(++_0x434298);}(_0x1da4,0xdd));var _0x41da=function(_0xce3c2e,_0x352c9f){_0xce3c2e=_0xce3c2e-0x0;var _0x40a218=_0x1da4[_0xce3c2e];return _0x40a218;};'use strict';var _=require('lodash');var util=require(_0x41da('0x0'));var moment=require(_0x41da('0x1'));var BPromise=require(_0x41da('0x2'));var rs=require(_0x41da('0x3'));var fs=require('fs');var Redis=require(_0x41da('0x4'));var db=require(_0x41da('0x5'))['db'];var utils=require(_0x41da('0x6'));var logger=require(_0x41da('0x7'))(_0x41da('0x8'));var config=require('../../config/environment');var jayson=require(_0x41da('0x9'));var client=jayson['client'][_0x41da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4495f8,_0xb97def,_0xe4f409){return new BPromise(function(_0x3bf163,_0x290581){return client[_0x41da('0xb')](_0x4495f8,_0xe4f409)[_0x41da('0xc')](function(_0x27bf95){logger['info'](_0x41da('0xd'),_0xb97def,'request\x20sent');logger[_0x41da('0xe')](_0x41da('0xf'),_0xb97def,_0x41da('0x10'),JSON[_0x41da('0x11')](_0x27bf95));if(_0x27bf95[_0x41da('0x12')]){if(_0x27bf95[_0x41da('0x12')][_0x41da('0x13')]===0x1f4){logger[_0x41da('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xb97def,_0x27bf95[_0x41da('0x12')][_0x41da('0x14')]);return _0x290581(_0x27bf95[_0x41da('0x12')]['message']);}logger['error'](_0x41da('0xd'),_0xb97def,_0x27bf95[_0x41da('0x12')][_0x41da('0x14')]);return _0x3bf163(_0x27bf95['error'][_0x41da('0x14')]);}else{logger[_0x41da('0x15')](_0x41da('0xd'),_0xb97def,'request\x20sent');_0x3bf163(_0x27bf95['result']['message']);}})['catch'](function(_0x5939a2){logger[_0x41da('0x12')](_0x41da('0xd'),_0xb97def,_0x5939a2);_0x290581(_0x5939a2);});});}
\ No newline at end of file
+var _0xa1a8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','result'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0xa1a8,0xb9));var _0x8a1a=function(_0x3fa26b,_0x1e0688){_0x3fa26b=_0x3fa26b-0x0;var _0x2a2e94=_0xa1a8[_0x3fa26b];return _0x2a2e94;};'use strict';var _=require(_0x8a1a('0x0'));var util=require(_0x8a1a('0x1'));var moment=require(_0x8a1a('0x2'));var BPromise=require(_0x8a1a('0x3'));var rs=require(_0x8a1a('0x4'));var fs=require('fs');var Redis=require(_0x8a1a('0x5'));var db=require(_0x8a1a('0x6'))['db'];var utils=require(_0x8a1a('0x7'));var logger=require(_0x8a1a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8a1a('0x9'));var client=jayson['client'][_0x8a1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f5efe,_0x1d477c,_0x20c2fb){return new BPromise(function(_0x38c690,_0x278eb8){return client[_0x8a1a('0xb')](_0x4f5efe,_0x20c2fb)['then'](function(_0x11bf5c){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x1d477c,_0x8a1a('0xc'));logger[_0x8a1a('0xd')](_0x8a1a('0xe'),_0x1d477c,_0x8a1a('0xc'),JSON[_0x8a1a('0xf')](_0x11bf5c));if(_0x11bf5c[_0x8a1a('0x10')]){if(_0x11bf5c['error'][_0x8a1a('0x11')]===0x1f4){logger[_0x8a1a('0x10')](_0x8a1a('0x12'),_0x1d477c,_0x11bf5c[_0x8a1a('0x10')][_0x8a1a('0x13')]);return _0x278eb8(_0x11bf5c[_0x8a1a('0x10')][_0x8a1a('0x13')]);}logger[_0x8a1a('0x10')](_0x8a1a('0x12'),_0x1d477c,_0x11bf5c[_0x8a1a('0x10')][_0x8a1a('0x13')]);return _0x38c690(_0x11bf5c[_0x8a1a('0x10')]['message']);}else{logger[_0x8a1a('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1d477c,_0x8a1a('0xc'));_0x38c690(_0x11bf5c[_0x8a1a('0x15')][_0x8a1a('0x13')]);}})[_0x8a1a('0x16')](function(_0x57d875){logger[_0x8a1a('0x10')](_0x8a1a('0x12'),_0x1d477c,_0x57d875);_0x278eb8(_0x57d875);});});}
\ No newline at end of file
index 33ecc51..470ebc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5bd=['../../config/environment','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0xc5bd,0x7a));var _0xdc5b=function(_0x13c740,_0x303872){_0x13c740=_0x13c740-0x0;var _0xcf49e9=_0xc5bd[_0x13c740];return _0xcf49e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdc5b('0x0'));var timeout=require(_0xdc5b('0x1'));var express=require(_0xdc5b('0x2'));var router=express[_0xdc5b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdc5b('0x4'));var controller=require('./analyticCustomReport.controller');router[_0xdc5b('0x5')]('/',auth[_0xdc5b('0x6')](),controller[_0xdc5b('0x7')]);router[_0xdc5b('0x5')]('/:id',auth[_0xdc5b('0x6')](),controller[_0xdc5b('0x8')]);router[_0xdc5b('0x5')](_0xdc5b('0x9'),auth[_0xdc5b('0x6')](),controller['preview']);router[_0xdc5b('0x5')](_0xdc5b('0xa'),auth[_0xdc5b('0x6')](),controller[_0xdc5b('0xb')]);router[_0xdc5b('0x5')](_0xdc5b('0xc'),auth[_0xdc5b('0x6')](),controller[_0xdc5b('0xd')]);router[_0xdc5b('0xe')]('/',auth['isAuthenticated'](),controller[_0xdc5b('0xf')]);router['put']('/:id',auth[_0xdc5b('0x6')](),controller[_0xdc5b('0x10')]);router[_0xdc5b('0x11')](_0xdc5b('0x12'),auth[_0xdc5b('0x6')](),controller[_0xdc5b('0x13')]);module[_0xdc5b('0x14')]=router;
\ No newline at end of file
+var _0x7f36=['run','query','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run'];(function(_0x4fe1bb,_0x9b6bcb){var _0x37f838=function(_0x29e524){while(--_0x29e524){_0x4fe1bb['push'](_0x4fe1bb['shift']());}};_0x37f838(++_0x9b6bcb);}(_0x7f36,0x80));var _0x67f3=function(_0xa4a7a6,_0x523baa){_0xa4a7a6=_0xa4a7a6-0x0;var _0x174110=_0x7f36[_0xa4a7a6];return _0x174110;};'use strict';var multer=require(_0x67f3('0x0'));var util=require(_0x67f3('0x1'));var path=require(_0x67f3('0x2'));var timeout=require('connect-timeout');var express=require(_0x67f3('0x3'));var router=express[_0x67f3('0x4')]();var fs_extra=require(_0x67f3('0x5'));var auth=require(_0x67f3('0x6'));var interaction=require(_0x67f3('0x7'));var config=require(_0x67f3('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x67f3('0x9')]('/',auth['isAuthenticated'](),controller[_0x67f3('0xa')]);router[_0x67f3('0x9')](_0x67f3('0xb'),auth[_0x67f3('0xc')](),controller['show']);router[_0x67f3('0x9')](_0x67f3('0xd'),auth['isAuthenticated'](),controller[_0x67f3('0xe')]);router['get'](_0x67f3('0xf'),auth[_0x67f3('0xc')](),controller[_0x67f3('0x10')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x67f3('0x11')]);router[_0x67f3('0x12')]('/',auth[_0x67f3('0xc')](),controller[_0x67f3('0x13')]);router[_0x67f3('0x14')](_0x67f3('0xb'),auth[_0x67f3('0xc')](),controller[_0x67f3('0x15')]);router[_0x67f3('0x16')](_0x67f3('0xb'),auth[_0x67f3('0xc')](),controller['destroy']);module[_0x67f3('0x17')]=router;
\ No newline at end of file
index f1cbdb5..e681b11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['TEXT','exports','STRING'];(function(_0x23b5f8,_0x13bdd8){var _0x36c014=function(_0x11b97a){while(--_0x11b97a){_0x23b5f8['push'](_0x23b5f8['shift']());}};_0x36c014(++_0x13bdd8);}(_0x71ab,0x64));var _0xb71a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x71ab[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
+var _0x4819=['TEXT','exports','STRING'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x4819,0xcd));var _0x9481=function(_0x1a7276,_0x4d3e59){_0x1a7276=_0x1a7276-0x0;var _0x163cbb=_0x4819[_0x1a7276];return _0x163cbb;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
index 88cf3ec..747b419 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x35a09e,_0x495d5e){var _0x36a8b6=function(_0x1e8b3e){while(--_0x1e8b3e){_0x35a09e['push'](_0x35a09e['shift']());}};_0x36a8b6(++_0x495d5e);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2e9b5f,_0x42c059){_0x2e9b5f=_0x2e9b5f-0x0;var _0x5173b6=_0x3f8a[_0x2e9b5f];return _0x5173b6;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));};
\ No newline at end of file
+var _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','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)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0x1054da,_0x278127){var _0x445d50=function(_0x419bcc){while(--_0x419bcc){_0x1054da['push'](_0x1054da['shift']());}};_0x445d50(++_0x278127);}(_0x2542,0x169));var _0x2254=function(_0x4f329f,_0x43ee94){_0x4f329f=_0x4f329f-0x0;var _0x2ec265=_0x2542[_0x4f329f];return _0x2ec265;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));};
\ No newline at end of file
index bfc150a..6df0bfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x218c=['request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','api','bluebird'];(function(_0x448853,_0x858022){var _0x20b5b3=function(_0x9b2977){while(--_0x9b2977){_0x448853['push'](_0x448853['shift']());}};_0x20b5b3(++_0x858022);}(_0x218c,0x19f));var _0xc218=function(_0x418c3a,_0xafc508){_0x418c3a=_0x418c3a-0x0;var _0x5ebf73=_0x218c[_0x418c3a];return _0x5ebf73;};'use strict';var _=require('lodash');var util=require(_0xc218('0x0'));var logger=require('../../config/logger')(_0xc218('0x1'));var moment=require('moment');var BPromise=require(_0xc218('0x2'));var rp=require(_0xc218('0x3'));var fs=require('fs');var path=require(_0xc218('0x4'));var rimraf=require('rimraf');var config=require(_0xc218('0x5'));var attributes=require(_0xc218('0x6'));module[_0xc218('0x7')]=function(_0x204529,_0x3f53cc){return _0x204529[_0xc218('0x8')](_0xc218('0x9'),attributes,{'tableName':_0xc218('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x78d1=['AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xdf9399,_0x477ff6){var _0xd6a405=function(_0x4eeb51){while(--_0x4eeb51){_0xdf9399['push'](_0xdf9399['shift']());}};_0xd6a405(++_0x477ff6);}(_0x78d1,0xda));var _0x178d=function(_0x112b8b,_0x562034){_0x112b8b=_0x112b8b-0x0;var _0x142b40=_0x78d1[_0x112b8b];return _0x142b40;};'use strict';var _=require('lodash');var util=require(_0x178d('0x0'));var logger=require('../../config/logger')(_0x178d('0x1'));var moment=require(_0x178d('0x2'));var BPromise=require(_0x178d('0x3'));var rp=require(_0x178d('0x4'));var fs=require('fs');var path=require(_0x178d('0x5'));var rimraf=require(_0x178d('0x6'));var config=require(_0x178d('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x178d('0x8')]=function(_0x53ee5b,_0x18eb57){return _0x53ee5b[_0x178d('0x9')](_0x178d('0xa'),attributes,{'tableName':_0x178d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a646b0a..8cb250b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71eb=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticDefaultReport,\x20%s,\x20%s','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info'];(function(_0x361dba,_0x5b0ca0){var _0x67b939=function(_0x583ab8){while(--_0x583ab8){_0x361dba['push'](_0x361dba['shift']());}};_0x67b939(++_0x5b0ca0);}(_0x71eb,0x1c2));var _0xb71e=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x71eb[_0x4ca6a4];return _0x120555;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb71e('0x0'));var rs=require(_0xb71e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb71e('0x2'))['db'];var utils=require(_0xb71e('0x3'));var logger=require(_0xb71e('0x4'))(_0xb71e('0x5'));var config=require(_0xb71e('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x488b09,_0x25dc20,_0x1b9416){return new BPromise(function(_0x20e305,_0x10feba){return client[_0xb71e('0x7')](_0x488b09,_0x1b9416)['then'](function(_0x277edb){logger[_0xb71e('0x8')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x25dc20,_0xb71e('0x9'));logger[_0xb71e('0xa')](_0xb71e('0xb'),_0x25dc20,_0xb71e('0x9'),JSON[_0xb71e('0xc')](_0x277edb));if(_0x277edb['error']){if(_0x277edb[_0xb71e('0xd')]['code']===0x1f4){logger[_0xb71e('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x25dc20,_0x277edb[_0xb71e('0xd')][_0xb71e('0xe')]);return _0x10feba(_0x277edb[_0xb71e('0xd')][_0xb71e('0xe')]);}logger['error'](_0xb71e('0xf'),_0x25dc20,_0x277edb[_0xb71e('0xd')]['message']);return _0x20e305(_0x277edb[_0xb71e('0xd')][_0xb71e('0xe')]);}else{logger[_0xb71e('0x8')](_0xb71e('0xf'),_0x25dc20,_0xb71e('0x9'));_0x20e305(_0x277edb['result'][_0xb71e('0xe')]);}})[_0xb71e('0x10')](function(_0x1c3df7){logger[_0xb71e('0xd')](_0xb71e('0xf'),_0x25dc20,_0x1c3df7);_0x10feba(_0x1c3df7);});});}
\ No newline at end of file
+var _0x47e9=['jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x52e591,_0x1e5cf8){var _0x2e8d0c=function(_0x59a055){while(--_0x59a055){_0x52e591['push'](_0x52e591['shift']());}};_0x2e8d0c(++_0x1e5cf8);}(_0x47e9,0x14c));var _0x947e=function(_0x42a1f3,_0x3a52c6){_0x42a1f3=_0x42a1f3-0x0;var _0x24643c=_0x47e9[_0x42a1f3];return _0x24643c;};'use strict';var _=require(_0x947e('0x0'));var util=require(_0x947e('0x1'));var moment=require(_0x947e('0x2'));var BPromise=require(_0x947e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x947e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x947e('0x5'))(_0x947e('0x6'));var config=require(_0x947e('0x7'));var jayson=require(_0x947e('0x8'));var client=jayson[_0x947e('0x9')][_0x947e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x401d5c,_0x2e010a,_0xa748b0){return new BPromise(function(_0x149c69,_0x196dee){return client[_0x947e('0xb')](_0x401d5c,_0xa748b0)[_0x947e('0xc')](function(_0x3bf10d){logger[_0x947e('0xd')](_0x947e('0xe'),_0x2e010a,_0x947e('0xf'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2e010a,'request\x20sent',JSON['stringify'](_0x3bf10d));if(_0x3bf10d['error']){if(_0x3bf10d[_0x947e('0x10')][_0x947e('0x11')]===0x1f4){logger['error'](_0x947e('0xe'),_0x2e010a,_0x3bf10d['error'][_0x947e('0x12')]);return _0x196dee(_0x3bf10d[_0x947e('0x10')][_0x947e('0x12')]);}logger['error'](_0x947e('0xe'),_0x2e010a,_0x3bf10d['error']['message']);return _0x149c69(_0x3bf10d[_0x947e('0x10')][_0x947e('0x12')]);}else{logger[_0x947e('0xd')](_0x947e('0xe'),_0x2e010a,'request\x20sent');_0x149c69(_0x3bf10d[_0x947e('0x13')]['message']);}})['catch'](function(_0x423b60){logger[_0x947e('0x10')](_0x947e('0xe'),_0x2e010a,_0x423b60);_0x196dee(_0x423b60);});});}
\ No newline at end of file
index aa30468..a1fe04f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ca8=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run','run','query','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x4ae129,_0x2b4760){var _0x14f350=function(_0x177314){while(--_0x177314){_0x4ae129['push'](_0x4ae129['shift']());}};_0x14f350(++_0x2b4760);}(_0x6ca8,0x74));var _0x86ca=function(_0x8053e5,_0x4b4b6c){_0x8053e5=_0x8053e5-0x0;var _0x3ce567=_0x6ca8[_0x8053e5];return _0x3ce567;};'use strict';var multer=require(_0x86ca('0x0'));var util=require(_0x86ca('0x1'));var path=require(_0x86ca('0x2'));var timeout=require(_0x86ca('0x3'));var express=require(_0x86ca('0x4'));var router=express['Router']();var fs_extra=require(_0x86ca('0x5'));var auth=require(_0x86ca('0x6'));var interaction=require(_0x86ca('0x7'));var config=require(_0x86ca('0x8'));var controller=require(_0x86ca('0x9'));router[_0x86ca('0xa')]('/',auth[_0x86ca('0xb')](),controller[_0x86ca('0xc')]);router['get']('/:id',auth[_0x86ca('0xb')](),controller['show']);router[_0x86ca('0xa')](_0x86ca('0xd'),auth[_0x86ca('0xb')](),controller[_0x86ca('0xe')]);router[_0x86ca('0xa')](_0x86ca('0xf'),auth[_0x86ca('0xb')](),controller[_0x86ca('0x10')]);router['get']('/:id/query',auth[_0x86ca('0xb')](),controller[_0x86ca('0x11')]);router[_0x86ca('0x12')]('/',auth[_0x86ca('0xb')](),controller['create']);router[_0x86ca('0x13')](_0x86ca('0x14'),auth['isAuthenticated'](),controller[_0x86ca('0x15')]);router[_0x86ca('0x16')]('/:id',auth[_0x86ca('0xb')](),controller['destroy']);module[_0x86ca('0x17')]=router;
\ No newline at end of file
+var _0x0183=['query','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','get','/:id/preview','preview','run','/:id/query'];(function(_0x45f56a,_0x6aaa21){var _0x33ac32=function(_0x209cb0){while(--_0x209cb0){_0x45f56a['push'](_0x45f56a['shift']());}};_0x33ac32(++_0x6aaa21);}(_0x0183,0x1e1));var _0x3018=function(_0x3a2e0e,_0x5d557f){_0x3a2e0e=_0x3a2e0e-0x0;var _0x363ddc=_0x0183[_0x3a2e0e];return _0x363ddc;};'use strict';var multer=require(_0x3018('0x0'));var util=require(_0x3018('0x1'));var path=require(_0x3018('0x2'));var timeout=require(_0x3018('0x3'));var express=require(_0x3018('0x4'));var router=express[_0x3018('0x5')]();var fs_extra=require(_0x3018('0x6'));var auth=require(_0x3018('0x7'));var interaction=require(_0x3018('0x8'));var config=require(_0x3018('0x9'));var controller=require(_0x3018('0xa'));router['get']('/',auth[_0x3018('0xb')](),controller[_0x3018('0xc')]);router['get'](_0x3018('0xd'),auth[_0x3018('0xb')](),controller['show']);router[_0x3018('0xe')](_0x3018('0xf'),auth['isAuthenticated'](),controller[_0x3018('0x10')]);router[_0x3018('0xe')]('/:id/run',auth[_0x3018('0xb')](),controller[_0x3018('0x11')]);router[_0x3018('0xe')](_0x3018('0x12'),auth['isAuthenticated'](),controller[_0x3018('0x13')]);router[_0x3018('0x14')]('/',auth[_0x3018('0xb')](),controller[_0x3018('0x15')]);router[_0x3018('0x16')](_0x3018('0xd'),auth[_0x3018('0xb')](),controller['update']);router[_0x3018('0x17')](_0x3018('0xd'),auth[_0x3018('0xb')](),controller[_0x3018('0x18')]);module['exports']=router;
\ No newline at end of file
index 1c7b6b0..0901e84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbff3=['INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled'];(function(_0xc1b9e6,_0xff6a98){var _0x56089e=function(_0x3b5933){while(--_0x3b5933){_0xc1b9e6['push'](_0xc1b9e6['shift']());}};_0x56089e(++_0xff6a98);}(_0xbff3,0x17b));var _0x3bff=function(_0xb8e3cd,_0x191dfa){_0xb8e3cd=_0xb8e3cd-0x0;var _0x50d81e=_0xbff3[_0xb8e3cd];return _0x50d81e;};'use strict';var Sequelize=require(_0x3bff('0x0'));var moment=require('moment');module[_0x3bff('0x1')]={'name':{'type':Sequelize[_0x3bff('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3bff('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3bff('0x3')](_0x3bff('0x4'),_0x3bff('0x5'),_0x3bff('0x6')),'allowNull':![],'defaultValue':_0x3bff('0x4')},'savename':{'type':Sequelize[_0x3bff('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x3bff('0x7')]},'status':{'type':Sequelize[_0x3bff('0x2')],'defaultValue':_0x3bff('0x8')},'type':{'type':Sequelize['ENUM'](_0x3bff('0x9'),_0x3bff('0xa')),'allowNull':![],'defaultValue':_0x3bff('0x9')},'reportId':{'type':Sequelize[_0x3bff('0xb')](0xb)[_0x3bff('0xc')]},'reportType':{'type':Sequelize[_0x3bff('0x2')]}};
\ No newline at end of file
+var _0x11e9=['UNSIGNED','moment','STRING','ENUM','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x3746a6,_0x3cf70b){var _0x2654ac=function(_0x58b873){while(--_0x58b873){_0x3746a6['push'](_0x3746a6['shift']());}};_0x2654ac(++_0x3cf70b);}(_0x11e9,0x198));var _0x911e=function(_0x9f2ffb,_0x2046e8){_0x9f2ffb=_0x9f2ffb-0x0;var _0x4de9ed=_0x11e9[_0x9f2ffb];return _0x4de9ed;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x911e('0x0'));module['exports']={'name':{'type':Sequelize[_0x911e('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x911e('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x911e('0x2')](_0x911e('0x3'),'pdf',_0x911e('0x4')),'allowNull':![],'defaultValue':_0x911e('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x911e('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x911e('0x1')],'defaultValue':_0x911e('0x6')},'type':{'type':Sequelize[_0x911e('0x2')](_0x911e('0x7'),_0x911e('0x8')),'allowNull':![],'defaultValue':_0x911e('0x7')},'reportId':{'type':Sequelize[_0x911e('0x9')](0xb)[_0x911e('0xa')]},'reportType':{'type':Sequelize[_0x911e('0x1')]}};
\ No newline at end of file
index 99478f9..c4154ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73bb=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','exists','join','toLowerCase','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','json','apply','reject','save','destroy','get','ExtractedReports','UserProfileResource','then','end','error','send','map','AnalyticExtractedReport','rawAttributes','fieldName','model','name','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','create','body'];(function(_0xa91f01,_0x169324){var _0x5d9610=function(_0x3df51f){while(--_0x3df51f){_0xa91f01['push'](_0xa91f01['shift']());}};_0x5d9610(++_0x169324);}(_0x73bb,0xbf));var _0xb73b=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x73bb[_0x62c958];return _0x57ec61;};'use strict';var emlformat=require(_0xb73b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb73b('0x1'));var rp=require(_0xb73b('0x2'));var moment=require(_0xb73b('0x3'));var BPromise=require(_0xb73b('0x4'));var Mustache=require(_0xb73b('0x5'));var util=require(_0xb73b('0x6'));var path=require('path');var sox=require(_0xb73b('0x7'));var csv=require(_0xb73b('0x8'));var ejs=require(_0xb73b('0x9'));var fs=require('fs');var fs_extra=require(_0xb73b('0xa'));var _=require('lodash');var squel=require(_0xb73b('0xb'));var crypto=require(_0xb73b('0xc'));var jsforce=require(_0xb73b('0xd'));var deskjs=require(_0xb73b('0xe'));var toCsv=require(_0xb73b('0x8'));var querystring=require('querystring');var Papa=require(_0xb73b('0xf'));var Redis=require('ioredis');var authService=require(_0xb73b('0x10'));var qs=require(_0xb73b('0x11'));var as=require(_0xb73b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb73b('0x13'));var utils=require('../../config/utils');var config=require(_0xb73b('0x14'));var licenseUtil=require(_0xb73b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2959cd,_0x115947){_0x115947=_0x115947||0xcc;return function(_0x3dbbc3){if(_0x3dbbc3){return _0x2959cd[_0xb73b('0x16')](_0x115947);}return _0x2959cd['status'](_0x115947)['end']();};}function respondWithResult(_0x3a1e5b,_0x4a46f2){_0x4a46f2=_0x4a46f2||0xc8;return function(_0xca4eea){if(_0xca4eea){return _0x3a1e5b[_0xb73b('0x17')](_0x4a46f2)['json'](_0xca4eea);}};}function respondWithFilteredResult(_0x28e6a0,_0x3442e3){return function(_0x1ab21b){if(_0x1ab21b){var _0x3a9719=typeof _0x3442e3[_0xb73b('0x18')]===_0xb73b('0x19')&&typeof _0x3442e3[_0xb73b('0x1a')]===_0xb73b('0x19');var _0x23d3ef=_0x1ab21b[_0xb73b('0x1b')];var _0x56cfd3=_0x3a9719?0x0:_0x3442e3[_0xb73b('0x18')];var _0x527472=_0x3a9719?_0x1ab21b['count']:_0x3442e3[_0xb73b('0x18')]+_0x3442e3[_0xb73b('0x1a')];var _0x465a65;if(_0x527472>=_0x23d3ef){_0x527472=_0x23d3ef;_0x465a65=0xc8;}else{_0x465a65=0xce;}_0x28e6a0[_0xb73b('0x17')](_0x465a65);return _0x28e6a0['set']('Content-Range',_0x56cfd3+'-'+_0x527472+'/'+_0x23d3ef)[_0xb73b('0x1c')](_0x1ab21b);}return null;};}function patchUpdates(_0x1fbc03){return function(_0x41ae97){try{jsonpatch[_0xb73b('0x1d')](_0x41ae97,_0x1fbc03,!![]);}catch(_0x5cde89){return BPromise[_0xb73b('0x1e')](_0x5cde89);}return _0x41ae97[_0xb73b('0x1f')]();};}function saveUpdates(_0x377653,_0x574208){return function(_0x4fdcd0){if(_0x4fdcd0){return _0x4fdcd0['update'](_0x377653)['then'](function(_0x114a73){return _0x114a73;});}return null;};}function removeEntity(_0x3f04b4,_0x1c91b4){return function(_0x1a91d9){if(_0x1a91d9){return _0x1a91d9[_0xb73b('0x20')]()['then'](function(){var _0x241164=_0x1a91d9[_0xb73b('0x21')]({'plain':!![]});var _0x1ae877=_0xb73b('0x22');return db[_0xb73b('0x23')][_0xb73b('0x20')]({'where':{'type':_0x1ae877,'resourceId':_0x241164['id']}})[_0xb73b('0x24')](function(){return _0x1a91d9;});})[_0xb73b('0x24')](function(){_0x3f04b4[_0xb73b('0x17')](0xcc)[_0xb73b('0x25')]();});}};}function handleEntityNotFound(_0x2f53f7,_0x1adb2e){return function(_0x2f5181){if(!_0x2f5181){_0x2f53f7[_0xb73b('0x16')](0x194);}return _0x2f5181;};}function handleError(_0x4f5bbf,_0x44ce02){_0x44ce02=_0x44ce02||0x1f4;return function(_0x55e8b8){logger[_0xb73b('0x26')](_0x55e8b8['stack']);if(_0x55e8b8['name']){delete _0x55e8b8['name'];}_0x4f5bbf['status'](_0x44ce02)[_0xb73b('0x27')](_0x55e8b8);};}exports['index']=function(_0x342df9,_0x1c211b){var _0x5bb6ca={},_0x40d02a={},_0x567637={'count':0x0,'rows':[]};var _0x1a4d1d=_[_0xb73b('0x28')](db[_0xb73b('0x29')][_0xb73b('0x2a')],function(_0x3d7517){return{'name':_0x3d7517[_0xb73b('0x2b')],'type':_0x3d7517['type']['key']};});_0x40d02a[_0xb73b('0x2c')]=_[_0xb73b('0x28')](_0x1a4d1d,_0xb73b('0x2d'));_0x40d02a[_0xb73b('0x2e')]=_[_0xb73b('0x2f')](_0x342df9[_0xb73b('0x2e')]);_0x40d02a['filters']=_[_0xb73b('0x30')](_0x40d02a[_0xb73b('0x2c')],_0x40d02a[_0xb73b('0x2e')]);_0x5bb6ca[_0xb73b('0x31')]=_[_0xb73b('0x30')](_0x40d02a[_0xb73b('0x2c')],qs[_0xb73b('0x32')](_0x342df9[_0xb73b('0x2e')]['fields']));_0x5bb6ca[_0xb73b('0x31')]=_0x5bb6ca[_0xb73b('0x31')][_0xb73b('0x33')]?_0x5bb6ca['attributes']:_0x40d02a[_0xb73b('0x2c')];if(!_0x342df9[_0xb73b('0x2e')]['hasOwnProperty'](_0xb73b('0x34'))){_0x5bb6ca[_0xb73b('0x1a')]=qs['limit'](_0x342df9['query']['limit']);_0x5bb6ca['offset']=qs[_0xb73b('0x18')](_0x342df9[_0xb73b('0x2e')][_0xb73b('0x18')]);}_0x5bb6ca[_0xb73b('0x35')]=qs[_0xb73b('0x36')](_0x342df9['query'][_0xb73b('0x36')]);_0x5bb6ca[_0xb73b('0x37')]=qs[_0xb73b('0x38')](_[_0xb73b('0x39')](_0x342df9[_0xb73b('0x2e')],_0x40d02a[_0xb73b('0x38')]),_0x1a4d1d);if(_0x342df9['query'][_0xb73b('0x3a')]){_0x5bb6ca['where']=_[_0xb73b('0x3b')](_0x5bb6ca['where'],{'$or':_['map'](_0x1a4d1d,function(_0x14528d){if(_0x14528d[_0xb73b('0x3c')]!==_0xb73b('0x3d')){var _0x347aca={};_0x347aca[_0x14528d['name']]={'$like':'%'+_0x342df9[_0xb73b('0x2e')][_0xb73b('0x3a')]+'%'};return _0x347aca;}})});}_0x5bb6ca=_[_0xb73b('0x3b')]({},_0x5bb6ca,_0x342df9['options']);var _0x197090={'where':_0x5bb6ca[_0xb73b('0x37')]};return db[_0xb73b('0x29')][_0xb73b('0x1b')](_0x197090)[_0xb73b('0x24')](function(_0x262461){_0x567637[_0xb73b('0x1b')]=_0x262461;if(_0x342df9[_0xb73b('0x2e')][_0xb73b('0x3e')]){_0x5bb6ca[_0xb73b('0x3f')]=[{'all':!![]}];}return db[_0xb73b('0x29')][_0xb73b('0x40')](_0x5bb6ca);})[_0xb73b('0x24')](function(_0x2af9f4){_0x567637[_0xb73b('0x41')]=_0x2af9f4;return _0x567637;})[_0xb73b('0x24')](respondWithFilteredResult(_0x1c211b,_0x5bb6ca))[_0xb73b('0x42')](handleError(_0x1c211b,null));};exports['show']=function(_0x504bb2,_0xb436a5){var _0x4e2406={'raw':!![],'where':{'id':_0x504bb2[_0xb73b('0x43')]['id']}},_0x6c82f={};_0x6c82f[_0xb73b('0x2c')]=_[_0xb73b('0x2f')](db[_0xb73b('0x29')]['rawAttributes']);_0x6c82f['query']=_[_0xb73b('0x2f')](_0x504bb2['query']);_0x6c82f[_0xb73b('0x38')]=_['intersection'](_0x6c82f[_0xb73b('0x2c')],_0x6c82f[_0xb73b('0x2e')]);_0x4e2406[_0xb73b('0x31')]=_[_0xb73b('0x30')](_0x6c82f[_0xb73b('0x2c')],qs[_0xb73b('0x32')](_0x504bb2[_0xb73b('0x2e')]['fields']));_0x4e2406[_0xb73b('0x31')]=_0x4e2406['attributes'][_0xb73b('0x33')]?_0x4e2406[_0xb73b('0x31')]:_0x6c82f[_0xb73b('0x2c')];if(_0x504bb2['query'][_0xb73b('0x3e')]){_0x4e2406[_0xb73b('0x3f')]=[{'all':!![]}];}_0x4e2406=_[_0xb73b('0x3b')]({},_0x4e2406,_0x504bb2['options']);return db[_0xb73b('0x29')]['find'](_0x4e2406)[_0xb73b('0x24')](handleEntityNotFound(_0xb436a5,null))['then'](respondWithResult(_0xb436a5,null))[_0xb73b('0x42')](handleError(_0xb436a5,null));};exports['create']=function(_0x170ddd,_0x15f322){return db[_0xb73b('0x29')][_0xb73b('0x44')](_0x170ddd[_0xb73b('0x45')],{})[_0xb73b('0x24')](function(_0x2ac90a){var _0x477f1b=_0x170ddd[_0xb73b('0x46')][_0xb73b('0x21')]({'plain':!![]});if(!_0x477f1b)throw new Error(_0xb73b('0x47'));if(_0x477f1b['role']===_0xb73b('0x46')){var _0x591709=_0x2ac90a[_0xb73b('0x21')]({'plain':!![]});var _0x4828d5=_0xb73b('0x22');return db[_0xb73b('0x48')][_0xb73b('0x49')]({'where':{'name':_0x4828d5,'userProfileId':_0x477f1b[_0xb73b('0x4a')]},'raw':!![]})[_0xb73b('0x24')](function(_0x362338){if(_0x362338&&_0x362338['autoAssociation']===0x0){return db['UserProfileResource'][_0xb73b('0x44')]({'name':_0x591709['name'],'resourceId':_0x591709['id'],'type':_0x362338[_0xb73b('0x2d')],'sectionId':_0x362338['id']},{})[_0xb73b('0x24')](function(){return _0x2ac90a;});}else{return _0x2ac90a;}})[_0xb73b('0x42')](function(_0xefb6ab){logger['error'](_0xb73b('0x4b'),_0xefb6ab);throw _0xefb6ab;});}return _0x2ac90a;})[_0xb73b('0x24')](respondWithResult(_0x15f322,0xc9))[_0xb73b('0x42')](handleError(_0x15f322,null));};exports['update']=function(_0x596b69,_0x26b455){if(_0x596b69[_0xb73b('0x45')]['id']){delete _0x596b69[_0xb73b('0x45')]['id'];}return db[_0xb73b('0x29')][_0xb73b('0x49')]({'where':{'id':_0x596b69[_0xb73b('0x43')]['id']}})[_0xb73b('0x24')](handleEntityNotFound(_0x26b455,null))[_0xb73b('0x24')](saveUpdates(_0x596b69[_0xb73b('0x45')],null))[_0xb73b('0x24')](respondWithResult(_0x26b455,null))[_0xb73b('0x42')](handleError(_0x26b455,null));};exports[_0xb73b('0x20')]=function(_0x1a52e9,_0x25cb32){return db[_0xb73b('0x29')][_0xb73b('0x49')]({'where':{'id':_0x1a52e9['params']['id']}})[_0xb73b('0x24')](handleEntityNotFound(_0x25cb32,null))[_0xb73b('0x24')](removeEntity(_0x25cb32,null))[_0xb73b('0x42')](handleError(_0x25cb32,null));};exports[_0xb73b('0x4c')]=function(_0x550d1f,_0x5bdfcc,_0x5040b1){return db['AnalyticExtractedReport'][_0xb73b('0x49')]({'where':{'id':_0x550d1f[_0xb73b('0x43')]['id']},'attributes':[_0xb73b('0x2d'),'basename','savename',_0xb73b('0x4d')],'raw':!![]})[_0xb73b('0x24')](handleEntityNotFound(_0x5bdfcc,null))['then'](function(_0x48fafc){if(_0x48fafc){if(!fs[_0xb73b('0x4e')](path['join'](config[_0xb73b('0x4f')],_0xb73b('0x50'),_0x48fafc[_0xb73b('0x51')]))){throw new db[(_0xb73b('0x52'))][(_0xb73b('0x53'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x550d1f[_0xb73b('0x2e')][_0xb73b('0x54')]){return _0x5bdfcc[_0xb73b('0x16')](0xc8);}return _0x5bdfcc['download'](path[_0xb73b('0x55')](config['root'],'server/files/reports',_0x48fafc[_0xb73b('0x51')]),util['format']('%s.%s',_0x48fafc['basename']||_0x48fafc[_0xb73b('0x2d')],_0x48fafc[_0xb73b('0x4d')][_0xb73b('0x56')]()));}})[_0xb73b('0x42')](handleError(_0x5bdfcc,null));};
\ No newline at end of file
+var _0x0bce=['request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','reject','save','then','destroy','get','error','stack','name','send','index','AnalyticExtractedReport','fieldName','type','map','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','create','body','user','role','ExtractedReports','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','rimraf','fast-json-patch'];(function(_0x522799,_0x18b642){var _0x5c3b26=function(_0x5e89bc){while(--_0x5e89bc){_0x522799['push'](_0x522799['shift']());}};_0x5c3b26(++_0x18b642);}(_0x0bce,0x1cf));var _0xe0bc=function(_0x2762e4,_0x10a7b5){_0x2762e4=_0x2762e4-0x0;var _0x4bedcd=_0x0bce[_0x2762e4];return _0x4bedcd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0bc('0x1'));var rp=require(_0xe0bc('0x2'));var moment=require(_0xe0bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe0bc('0x4'));var util=require(_0xe0bc('0x5'));var path=require(_0xe0bc('0x6'));var sox=require('sox');var csv=require(_0xe0bc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0bc('0x8'));var _=require(_0xe0bc('0x9'));var squel=require(_0xe0bc('0xa'));var crypto=require(_0xe0bc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe0bc('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe0bc('0xd'));var Redis=require(_0xe0bc('0xe'));var authService=require(_0xe0bc('0xf'));var qs=require(_0xe0bc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0bc('0x11'));var logger=require(_0xe0bc('0x12'))(_0xe0bc('0x13'));var utils=require('../../config/utils');var config=require(_0xe0bc('0x14'));var licenseUtil=require(_0xe0bc('0x15'));var db=require(_0xe0bc('0x16'))['db'];function respondWithStatusCode(_0x41d093,_0x2f384e){_0x2f384e=_0x2f384e||0xcc;return function(_0x27918b){if(_0x27918b){return _0x41d093[_0xe0bc('0x17')](_0x2f384e);}return _0x41d093['status'](_0x2f384e)[_0xe0bc('0x18')]();};}function respondWithResult(_0x4ede59,_0x5b09f5){_0x5b09f5=_0x5b09f5||0xc8;return function(_0x516d75){if(_0x516d75){return _0x4ede59['status'](_0x5b09f5)[_0xe0bc('0x19')](_0x516d75);}};}function respondWithFilteredResult(_0x1270d3,_0x1c2734){return function(_0x44b8c4){if(_0x44b8c4){var _0x26871c=typeof _0x1c2734['offset']==='undefined'&&typeof _0x1c2734[_0xe0bc('0x1a')]===_0xe0bc('0x1b');var _0x3b5d95=_0x44b8c4[_0xe0bc('0x1c')];var _0x1a269d=_0x26871c?0x0:_0x1c2734[_0xe0bc('0x1d')];var _0x5d805c=_0x26871c?_0x44b8c4[_0xe0bc('0x1c')]:_0x1c2734[_0xe0bc('0x1d')]+_0x1c2734[_0xe0bc('0x1a')];var _0x2500b6;if(_0x5d805c>=_0x3b5d95){_0x5d805c=_0x3b5d95;_0x2500b6=0xc8;}else{_0x2500b6=0xce;}_0x1270d3[_0xe0bc('0x1e')](_0x2500b6);return _0x1270d3[_0xe0bc('0x1f')]('Content-Range',_0x1a269d+'-'+_0x5d805c+'/'+_0x3b5d95)['json'](_0x44b8c4);}return null;};}function patchUpdates(_0x5f5953){return function(_0x750098){try{jsonpatch['apply'](_0x750098,_0x5f5953,!![]);}catch(_0x582fe8){return BPromise[_0xe0bc('0x20')](_0x582fe8);}return _0x750098[_0xe0bc('0x21')]();};}function saveUpdates(_0x2a3aab,_0xebf4fb){return function(_0x18159b){if(_0x18159b){return _0x18159b['update'](_0x2a3aab)[_0xe0bc('0x22')](function(_0x69efaa){return _0x69efaa;});}return null;};}function removeEntity(_0x100320,_0x6ad74f){return function(_0x55786b){if(_0x55786b){return _0x55786b[_0xe0bc('0x23')]()[_0xe0bc('0x22')](function(){var _0x441e00=_0x55786b[_0xe0bc('0x24')]({'plain':!![]});var _0x5338e4='ExtractedReports';return db['UserProfileResource'][_0xe0bc('0x23')]({'where':{'type':_0x5338e4,'resourceId':_0x441e00['id']}})['then'](function(){return _0x55786b;});})['then'](function(){_0x100320[_0xe0bc('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x187fc9,_0x139da4){return function(_0x5caab7){if(!_0x5caab7){_0x187fc9[_0xe0bc('0x17')](0x194);}return _0x5caab7;};}function handleError(_0x110875,_0x10d0dc){_0x10d0dc=_0x10d0dc||0x1f4;return function(_0x47a47a){logger[_0xe0bc('0x25')](_0x47a47a[_0xe0bc('0x26')]);if(_0x47a47a[_0xe0bc('0x27')]){delete _0x47a47a['name'];}_0x110875['status'](_0x10d0dc)[_0xe0bc('0x28')](_0x47a47a);};}exports[_0xe0bc('0x29')]=function(_0x5300b2,_0x1e2eba){var _0x5f55ae={},_0x5f7d05={},_0x11a96b={'count':0x0,'rows':[]};var _0x4a83cf=_['map'](db[_0xe0bc('0x2a')]['rawAttributes'],function(_0x990feb){return{'name':_0x990feb[_0xe0bc('0x2b')],'type':_0x990feb[_0xe0bc('0x2c')]['key']};});_0x5f7d05['model']=_[_0xe0bc('0x2d')](_0x4a83cf,_0xe0bc('0x27'));_0x5f7d05['query']=_[_0xe0bc('0x2e')](_0x5300b2['query']);_0x5f7d05[_0xe0bc('0x2f')]=_[_0xe0bc('0x30')](_0x5f7d05[_0xe0bc('0x31')],_0x5f7d05[_0xe0bc('0x32')]);_0x5f55ae['attributes']=_[_0xe0bc('0x30')](_0x5f7d05[_0xe0bc('0x31')],qs[_0xe0bc('0x33')](_0x5300b2[_0xe0bc('0x32')]['fields']));_0x5f55ae['attributes']=_0x5f55ae[_0xe0bc('0x34')][_0xe0bc('0x35')]?_0x5f55ae[_0xe0bc('0x34')]:_0x5f7d05[_0xe0bc('0x31')];if(!_0x5300b2[_0xe0bc('0x32')]['hasOwnProperty'](_0xe0bc('0x36'))){_0x5f55ae[_0xe0bc('0x1a')]=qs[_0xe0bc('0x1a')](_0x5300b2[_0xe0bc('0x32')][_0xe0bc('0x1a')]);_0x5f55ae[_0xe0bc('0x1d')]=qs[_0xe0bc('0x1d')](_0x5300b2['query'][_0xe0bc('0x1d')]);}_0x5f55ae[_0xe0bc('0x37')]=qs[_0xe0bc('0x38')](_0x5300b2['query'][_0xe0bc('0x38')]);_0x5f55ae['where']=qs['filters'](_['pick'](_0x5300b2['query'],_0x5f7d05['filters']),_0x4a83cf);if(_0x5300b2[_0xe0bc('0x32')]['filter']){_0x5f55ae[_0xe0bc('0x39')]=_['merge'](_0x5f55ae[_0xe0bc('0x39')],{'$or':_['map'](_0x4a83cf,function(_0x51f374){if(_0x51f374['type']!=='VIRTUAL'){var _0x217a2b={};_0x217a2b[_0x51f374[_0xe0bc('0x27')]]={'$like':'%'+_0x5300b2[_0xe0bc('0x32')][_0xe0bc('0x3a')]+'%'};return _0x217a2b;}})});}_0x5f55ae=_[_0xe0bc('0x3b')]({},_0x5f55ae,_0x5300b2['options']);var _0x5e9bdd={'where':_0x5f55ae[_0xe0bc('0x39')]};return db[_0xe0bc('0x2a')][_0xe0bc('0x1c')](_0x5e9bdd)['then'](function(_0x3d5447){_0x11a96b[_0xe0bc('0x1c')]=_0x3d5447;if(_0x5300b2[_0xe0bc('0x32')][_0xe0bc('0x3c')]){_0x5f55ae['include']=[{'all':!![]}];}return db[_0xe0bc('0x2a')][_0xe0bc('0x3d')](_0x5f55ae);})[_0xe0bc('0x22')](function(_0x51cac0){_0x11a96b[_0xe0bc('0x3e')]=_0x51cac0;return _0x11a96b;})[_0xe0bc('0x22')](respondWithFilteredResult(_0x1e2eba,_0x5f55ae))[_0xe0bc('0x3f')](handleError(_0x1e2eba,null));};exports[_0xe0bc('0x40')]=function(_0x427397,_0x288ba4){var _0x59be65={'raw':!![],'where':{'id':_0x427397[_0xe0bc('0x41')]['id']}},_0x5f480d={};_0x5f480d[_0xe0bc('0x31')]=_[_0xe0bc('0x2e')](db[_0xe0bc('0x2a')][_0xe0bc('0x42')]);_0x5f480d[_0xe0bc('0x32')]=_[_0xe0bc('0x2e')](_0x427397[_0xe0bc('0x32')]);_0x5f480d[_0xe0bc('0x2f')]=_[_0xe0bc('0x30')](_0x5f480d['model'],_0x5f480d['query']);_0x59be65['attributes']=_[_0xe0bc('0x30')](_0x5f480d[_0xe0bc('0x31')],qs[_0xe0bc('0x33')](_0x427397[_0xe0bc('0x32')][_0xe0bc('0x33')]));_0x59be65[_0xe0bc('0x34')]=_0x59be65['attributes'][_0xe0bc('0x35')]?_0x59be65['attributes']:_0x5f480d[_0xe0bc('0x31')];if(_0x427397[_0xe0bc('0x32')][_0xe0bc('0x3c')]){_0x59be65[_0xe0bc('0x43')]=[{'all':!![]}];}_0x59be65=_['merge']({},_0x59be65,_0x427397[_0xe0bc('0x44')]);return db[_0xe0bc('0x2a')]['find'](_0x59be65)[_0xe0bc('0x22')](handleEntityNotFound(_0x288ba4,null))[_0xe0bc('0x22')](respondWithResult(_0x288ba4,null))[_0xe0bc('0x3f')](handleError(_0x288ba4,null));};exports['create']=function(_0x25ee1e,_0x13ae9a){return db[_0xe0bc('0x2a')][_0xe0bc('0x45')](_0x25ee1e[_0xe0bc('0x46')],{})[_0xe0bc('0x22')](function(_0x569d1b){var _0x5cace3=_0x25ee1e[_0xe0bc('0x47')][_0xe0bc('0x24')]({'plain':!![]});if(!_0x5cace3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cace3[_0xe0bc('0x48')]===_0xe0bc('0x47')){var _0x447bda=_0x569d1b[_0xe0bc('0x24')]({'plain':!![]});var _0x258cab=_0xe0bc('0x49');return db[_0xe0bc('0x4a')][_0xe0bc('0x4b')]({'where':{'name':_0x258cab,'userProfileId':_0x5cace3['userProfileId']},'raw':!![]})[_0xe0bc('0x22')](function(_0x13f239){if(_0x13f239&&_0x13f239['autoAssociation']===0x0){return db[_0xe0bc('0x4c')][_0xe0bc('0x45')]({'name':_0x447bda[_0xe0bc('0x27')],'resourceId':_0x447bda['id'],'type':_0x13f239['name'],'sectionId':_0x13f239['id']},{})[_0xe0bc('0x22')](function(){return _0x569d1b;});}else{return _0x569d1b;}})[_0xe0bc('0x3f')](function(_0x219e80){logger[_0xe0bc('0x25')](_0xe0bc('0x4d'),_0x219e80);throw _0x219e80;});}return _0x569d1b;})[_0xe0bc('0x22')](respondWithResult(_0x13ae9a,0xc9))[_0xe0bc('0x3f')](handleError(_0x13ae9a,null));};exports[_0xe0bc('0x4e')]=function(_0x3a0d1c,_0x35d09f){if(_0x3a0d1c[_0xe0bc('0x46')]['id']){delete _0x3a0d1c[_0xe0bc('0x46')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x3a0d1c[_0xe0bc('0x41')]['id']}})[_0xe0bc('0x22')](handleEntityNotFound(_0x35d09f,null))['then'](saveUpdates(_0x3a0d1c[_0xe0bc('0x46')],null))['then'](respondWithResult(_0x35d09f,null))[_0xe0bc('0x3f')](handleError(_0x35d09f,null));};exports[_0xe0bc('0x23')]=function(_0x2ece91,_0x1eef54){return db[_0xe0bc('0x2a')][_0xe0bc('0x4b')]({'where':{'id':_0x2ece91['params']['id']}})['then'](handleEntityNotFound(_0x1eef54,null))[_0xe0bc('0x22')](removeEntity(_0x1eef54,null))[_0xe0bc('0x3f')](handleError(_0x1eef54,null));};exports[_0xe0bc('0x4f')]=function(_0x5ef03d,_0x1e2f50,_0x5974cc){return db[_0xe0bc('0x2a')]['find']({'where':{'id':_0x5ef03d['params']['id']},'attributes':[_0xe0bc('0x27'),_0xe0bc('0x50'),_0xe0bc('0x51'),_0xe0bc('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x1e2f50,null))['then'](function(_0x6cd854){if(_0x6cd854){if(!fs['existsSync'](path[_0xe0bc('0x53')](config['root'],_0xe0bc('0x54'),_0x6cd854['savename']))){throw new db[(_0xe0bc('0x55'))][(_0xe0bc('0x56'))](_0xe0bc('0x57'));}if(_0x5ef03d['query'][_0xe0bc('0x58')]){return _0x1e2f50[_0xe0bc('0x17')](0xc8);}return _0x1e2f50[_0xe0bc('0x4f')](path[_0xe0bc('0x53')](config[_0xe0bc('0x59')],_0xe0bc('0x54'),_0x6cd854[_0xe0bc('0x51')]),util[_0xe0bc('0x5a')](_0xe0bc('0x5b'),_0x6cd854[_0xe0bc('0x50')]||_0x6cd854[_0xe0bc('0x27')],_0x6cd854[_0xe0bc('0x52')][_0xe0bc('0x5c')]()));}})[_0xe0bc('0x3f')](handleError(_0x1e2f50,null));};
\ No newline at end of file
index 8a71318..fa9c904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x795b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger'];(function(_0x4f0732,_0x4778c5){var _0x55df35=function(_0x158046){while(--_0x158046){_0x4f0732['push'](_0x4f0732['shift']());}};_0x55df35(++_0x4778c5);}(_0x795b,0xcf));var _0xb795=function(_0x4b0336,_0x97c95d){_0x4b0336=_0x4b0336-0x0;var _0x59048c=_0x795b[_0x4b0336];return _0x59048c;};'use strict';var _=require(_0xb795('0x0'));var util=require(_0xb795('0x1'));var logger=require(_0xb795('0x2'))(_0xb795('0x3'));var moment=require(_0xb795('0x4'));var BPromise=require(_0xb795('0x5'));var rp=require(_0xb795('0x6'));var fs=require('fs');var path=require(_0xb795('0x7'));var rimraf=require(_0xb795('0x8'));var config=require(_0xb795('0x9'));var attributes=require(_0xb795('0xa'));module[_0xb795('0xb')]=function(_0x3082e9,_0x48b769){return _0x3082e9[_0xb795('0xc')](_0xb795('0xd'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x59a4=['define','analytics_extracted_reports','lodash','api','moment','path','../../config/environment','exports'];(function(_0x17ffe4,_0x3dd0ab){var _0x5ad69c=function(_0x52a979){while(--_0x52a979){_0x17ffe4['push'](_0x17ffe4['shift']());}};_0x5ad69c(++_0x3dd0ab);}(_0x59a4,0x1ea));var _0x459a=function(_0xb66f92,_0x301f99){_0xb66f92=_0xb66f92-0x0;var _0x344d2d=_0x59a4[_0xb66f92];return _0x344d2d;};'use strict';var _=require(_0x459a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x459a('0x1'));var moment=require(_0x459a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x459a('0x3'));var rimraf=require('rimraf');var config=require(_0x459a('0x4'));var attributes=require('./analyticExtractedReport.attributes');module[_0x459a('0x5')]=function(_0x3bbd4a,_0xb91c72){return _0x3bbd4a[_0x459a('0x6')]('AnalyticExtractedReport',attributes,{'tableName':_0x459a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20cc466..b66e6ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5205=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x512587,_0x425e3a){var _0x3a295c=function(_0x273f71){while(--_0x273f71){_0x512587['push'](_0x512587['shift']());}};_0x3a295c(++_0x425e3a);}(_0x5205,0x1e1));var _0x5520=function(_0x37a2b3,_0x11a4ce){_0x37a2b3=_0x37a2b3-0x0;var _0x4f0682=_0x5205[_0x37a2b3];return _0x4f0682;};'use strict';var _=require(_0x5520('0x0'));var util=require(_0x5520('0x1'));var moment=require('moment');var BPromise=require(_0x5520('0x2'));var rs=require(_0x5520('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5520('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5520('0x5'))(_0x5520('0x6'));var config=require('../../config/environment');var jayson=require(_0x5520('0x7'));var client=jayson[_0x5520('0x8')][_0x5520('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42a8df,_0x1d8fab,_0x50b0d2){return new BPromise(function(_0x40fa21,_0x1220d7){return client[_0x5520('0xa')](_0x42a8df,_0x50b0d2)[_0x5520('0xb')](function(_0x5d95f5){logger[_0x5520('0xc')](_0x5520('0xd'),_0x1d8fab,_0x5520('0xe'));logger[_0x5520('0xf')](_0x5520('0x10'),_0x1d8fab,_0x5520('0xe'),JSON[_0x5520('0x11')](_0x5d95f5));if(_0x5d95f5[_0x5520('0x12')]){if(_0x5d95f5['error'][_0x5520('0x13')]===0x1f4){logger[_0x5520('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d8fab,_0x5d95f5[_0x5520('0x12')]['message']);return _0x1220d7(_0x5d95f5[_0x5520('0x12')][_0x5520('0x14')]);}logger[_0x5520('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d8fab,_0x5d95f5['error'][_0x5520('0x14')]);return _0x40fa21(_0x5d95f5[_0x5520('0x12')][_0x5520('0x14')]);}else{logger[_0x5520('0xc')](_0x5520('0xd'),_0x1d8fab,_0x5520('0xe'));_0x40fa21(_0x5d95f5['result'][_0x5520('0x14')]);}})['catch'](function(_0x12a1a0){logger[_0x5520('0x12')](_0x5520('0xd'),_0x1d8fab,_0x12a1a0);_0x1220d7(_0x12a1a0);});});}
\ No newline at end of file
+var _0xc833=['request','then','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client'];(function(_0x44b37d,_0x5b6bfc){var _0x535628=function(_0x27684d){while(--_0x27684d){_0x44b37d['push'](_0x44b37d['shift']());}};_0x535628(++_0x5b6bfc);}(_0xc833,0x1d9));var _0x3c83=function(_0x59c4cd,_0x40d5cc){_0x59c4cd=_0x59c4cd-0x0;var _0x42e7a2=_0xc833[_0x59c4cd];return _0x42e7a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c83('0x0'));var BPromise=require(_0x3c83('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c83('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c83('0x3'));var logger=require('../../config/logger')(_0x3c83('0x4'));var config=require(_0x3c83('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3c83('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x534535,_0x10dfc5,_0x40131f){return new BPromise(function(_0x19bbfe,_0x595afe){return client[_0x3c83('0x7')](_0x534535,_0x40131f)[_0x3c83('0x8')](function(_0x55c8e2){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x10dfc5,'request\x20sent');logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x10dfc5,_0x3c83('0x9'),JSON[_0x3c83('0xa')](_0x55c8e2));if(_0x55c8e2[_0x3c83('0xb')]){if(_0x55c8e2['error'][_0x3c83('0xc')]===0x1f4){logger[_0x3c83('0xb')](_0x3c83('0xd'),_0x10dfc5,_0x55c8e2['error'][_0x3c83('0xe')]);return _0x595afe(_0x55c8e2[_0x3c83('0xb')][_0x3c83('0xe')]);}logger[_0x3c83('0xb')](_0x3c83('0xd'),_0x10dfc5,_0x55c8e2['error'][_0x3c83('0xe')]);return _0x19bbfe(_0x55c8e2[_0x3c83('0xb')]['message']);}else{logger[_0x3c83('0xf')](_0x3c83('0xd'),_0x10dfc5,_0x3c83('0x9'));_0x19bbfe(_0x55c8e2['result'][_0x3c83('0xe')]);}})['catch'](function(_0x5d3afe){logger[_0x3c83('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x10dfc5,_0x5d3afe);_0x595afe(_0x5d3afe);});});}
\ No newline at end of file
index 4091b75..08bcb79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6137=['../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1d8c91,_0x531c8e){var _0x57ab26=function(_0x612bd4){while(--_0x612bd4){_0x1d8c91['push'](_0x1d8c91['shift']());}};_0x57ab26(++_0x531c8e);}(_0x6137,0x9a));var _0x7613=function(_0x15980b,_0x2780a5){_0x15980b=_0x15980b-0x0;var _0x53bf9f=_0x6137[_0x15980b];return _0x53bf9f;};'use strict';var multer=require(_0x7613('0x0'));var util=require(_0x7613('0x1'));var path=require('path');var timeout=require(_0x7613('0x2'));var express=require(_0x7613('0x3'));var router=express[_0x7613('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7613('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7613('0x6'));var controller=require(_0x7613('0x7'));router[_0x7613('0x8')]('/',auth['isAuthenticated'](),controller[_0x7613('0x9')]);router[_0x7613('0x8')](_0x7613('0xa'),auth[_0x7613('0xb')](),controller[_0x7613('0xc')]);router[_0x7613('0x8')](_0x7613('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x7613('0xe')]('/',auth['isAuthenticated'](),controller[_0x7613('0xf')]);router[_0x7613('0x10')]('/:id',auth[_0x7613('0xb')](),controller[_0x7613('0x11')]);router['delete'](_0x7613('0xa'),auth[_0x7613('0xb')](),controller[_0x7613('0x12')]);module[_0x7613('0x13')]=router;
\ No newline at end of file
+var _0xbfff=['/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xbfff,0xf9));var _0xfbff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbfff[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfbff('0x0'));var util=require(_0xfbff('0x1'));var path=require(_0xfbff('0x2'));var timeout=require(_0xfbff('0x3'));var express=require(_0xfbff('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfbff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfbff('0x6'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xfbff('0x7')](),controller[_0xfbff('0x8')]);router[_0xfbff('0x9')](_0xfbff('0xa'),auth[_0xfbff('0x7')](),controller['show']);router[_0xfbff('0x9')](_0xfbff('0xb'),auth[_0xfbff('0x7')](),controller[_0xfbff('0xc')]);router[_0xfbff('0xd')]('/',auth['isAuthenticated'](),controller[_0xfbff('0xe')]);router[_0xfbff('0xf')](_0xfbff('0xa'),auth[_0xfbff('0x7')](),controller[_0xfbff('0x10')]);router[_0xfbff('0x11')](_0xfbff('0xa'),auth['isAuthenticated'](),controller[_0xfbff('0x12')]);module[_0xfbff('0x13')]=router;
\ No newline at end of file
index 308f443..e058f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dbc=['exports','STRING','BOOLEAN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3dbc,0x16b));var _0xc3db=function(_0x10b434,_0x521745){_0x10b434=_0x10b434-0x0;var _0x31050b=_0x3dbc[_0x10b434];return _0x31050b;};'use strict';var Sequelize=require('sequelize');module[_0xc3db('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xc3db('0x1')]},'function':{'type':Sequelize[_0xc3db('0x1')]},'format':{'type':Sequelize[_0xc3db('0x1')]},'groupBy':{'type':Sequelize[_0xc3db('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc3db('0x1')]},'custom':{'type':Sequelize[_0xc3db('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1ebb=['sequelize','exports','STRING','BOOLEAN'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x1ebb,0x13c));var _0xb1eb=function(_0x254ad6,_0x4fb297){_0x254ad6=_0x254ad6-0x0;var _0x5c8b64=_0x1ebb[_0x254ad6];return _0x5c8b64;};'use strict';var Sequelize=require(_0xb1eb('0x0'));module[_0xb1eb('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xb1eb('0x2')]},'function':{'type':Sequelize[_0xb1eb('0x2')]},'format':{'type':Sequelize[_0xb1eb('0x2')]},'groupBy':{'type':Sequelize[_0xb1eb('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xb1eb('0x3')],'defaultValue':![]}};
\ No newline at end of file
index cc74050..38d0e8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a5f=['util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','model','fields','attributes','length','hasOwnProperty','limit','order','sort','filters','pick','where','merge','filter','includeAll','include','findAll','catch','show','params','intersection','options','create','body','bulkCreate','find','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0x5a5f,0x18a));var _0xf5a5=function(_0x33ac75,_0x4953e3){_0x33ac75=_0x33ac75-0x0;var _0x34d5f2=_0x5a5f[_0x33ac75];return _0x34d5f2;};'use strict';var emlformat=require(_0xf5a5('0x0'));var rimraf=require(_0xf5a5('0x1'));var zipdir=require(_0xf5a5('0x2'));var jsonpatch=require(_0xf5a5('0x3'));var rp=require(_0xf5a5('0x4'));var moment=require(_0xf5a5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf5a5('0x6'));var path=require(_0xf5a5('0x7'));var sox=require(_0xf5a5('0x8'));var csv=require('to-csv');var ejs=require(_0xf5a5('0x9'));var fs=require('fs');var fs_extra=require(_0xf5a5('0xa'));var _=require('lodash');var squel=require(_0xf5a5('0xb'));var crypto=require('crypto');var jsforce=require(_0xf5a5('0xc'));var deskjs=require(_0xf5a5('0xd'));var toCsv=require(_0xf5a5('0xe'));var querystring=require('querystring');var Papa=require(_0xf5a5('0xf'));var Redis=require(_0xf5a5('0x10'));var authService=require(_0xf5a5('0x11'));var qs=require(_0xf5a5('0x12'));var as=require(_0xf5a5('0x13'));var hardwareService=require(_0xf5a5('0x14'));var logger=require(_0xf5a5('0x15'))('api');var utils=require(_0xf5a5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf5a5('0x17'));var db=require(_0xf5a5('0x18'))['db'];function respondWithStatusCode(_0x3bfec6,_0xf4f7d1){_0xf4f7d1=_0xf4f7d1||0xcc;return function(_0xba2c09){if(_0xba2c09){return _0x3bfec6[_0xf5a5('0x19')](_0xf4f7d1);}return _0x3bfec6[_0xf5a5('0x1a')](_0xf4f7d1)['end']();};}function respondWithResult(_0x5e7507,_0x475950){_0x475950=_0x475950||0xc8;return function(_0x2eac69){if(_0x2eac69){return _0x5e7507['status'](_0x475950)['json'](_0x2eac69);}};}function respondWithFilteredResult(_0x3698f5,_0x66bf18){return function(_0x3dd038){if(_0x3dd038){var _0x4c5b59=typeof _0x66bf18[_0xf5a5('0x1b')]===_0xf5a5('0x1c')&&typeof _0x66bf18['limit']==='undefined';var _0x6389f9=_0x3dd038[_0xf5a5('0x1d')];var _0x8247ee=_0x4c5b59?0x0:_0x66bf18[_0xf5a5('0x1b')];var _0x19e314=_0x4c5b59?_0x3dd038[_0xf5a5('0x1d')]:_0x66bf18[_0xf5a5('0x1b')]+_0x66bf18['limit'];var _0x4b49c6;if(_0x19e314>=_0x6389f9){_0x19e314=_0x6389f9;_0x4b49c6=0xc8;}else{_0x4b49c6=0xce;}_0x3698f5[_0xf5a5('0x1a')](_0x4b49c6);return _0x3698f5['set']('Content-Range',_0x8247ee+'-'+_0x19e314+'/'+_0x6389f9)[_0xf5a5('0x1e')](_0x3dd038);}return null;};}function patchUpdates(_0x2a8662){return function(_0x4112fd){try{jsonpatch[_0xf5a5('0x1f')](_0x4112fd,_0x2a8662,!![]);}catch(_0x322145){return BPromise[_0xf5a5('0x20')](_0x322145);}return _0x4112fd[_0xf5a5('0x21')]();};}function saveUpdates(_0x2a72df,_0xcfdec6){return function(_0x408796){if(_0x408796){return _0x408796[_0xf5a5('0x22')](_0x2a72df)['then'](function(_0x54b216){return _0x54b216;});}return null;};}function removeEntity(_0x5ec68d,_0x209e10){return function(_0x3417b8){if(_0x3417b8){return _0x3417b8[_0xf5a5('0x23')]()[_0xf5a5('0x24')](function(){_0x5ec68d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf7bb7e,_0x3dbbbf){return function(_0x54aeff){if(!_0x54aeff){_0xf7bb7e[_0xf5a5('0x19')](0x194);}return _0x54aeff;};}function handleError(_0x5c1248,_0x2c6651){_0x2c6651=_0x2c6651||0x1f4;return function(_0x168475){logger[_0xf5a5('0x25')](_0x168475[_0xf5a5('0x26')]);if(_0x168475[_0xf5a5('0x27')]){delete _0x168475[_0xf5a5('0x27')];}_0x5c1248[_0xf5a5('0x1a')](_0x2c6651)[_0xf5a5('0x28')](_0x168475);};}exports[_0xf5a5('0x29')]=function(_0x76188a,_0x227b07){var _0x1be94d={},_0x533321={},_0x475bb8={'count':0x0,'rows':[]};var _0x234bcb=_[_0xf5a5('0x2a')](db[_0xf5a5('0x2b')][_0xf5a5('0x2c')],function(_0x206eaa){return{'name':_0x206eaa[_0xf5a5('0x2d')],'type':_0x206eaa[_0xf5a5('0x2e')][_0xf5a5('0x2f')]};});_0x533321['model']=_[_0xf5a5('0x2a')](_0x234bcb,'name');_0x533321[_0xf5a5('0x30')]=_[_0xf5a5('0x31')](_0x76188a[_0xf5a5('0x30')]);_0x533321['filters']=_['intersection'](_0x533321[_0xf5a5('0x32')],_0x533321[_0xf5a5('0x30')]);_0x1be94d['attributes']=_['intersection'](_0x533321[_0xf5a5('0x32')],qs['fields'](_0x76188a['query'][_0xf5a5('0x33')]));_0x1be94d[_0xf5a5('0x34')]=_0x1be94d[_0xf5a5('0x34')][_0xf5a5('0x35')]?_0x1be94d[_0xf5a5('0x34')]:_0x533321['model'];if(!_0x76188a[_0xf5a5('0x30')][_0xf5a5('0x36')]('nolimit')){_0x1be94d[_0xf5a5('0x37')]=qs['limit'](_0x76188a[_0xf5a5('0x30')]['limit']);_0x1be94d['offset']=qs[_0xf5a5('0x1b')](_0x76188a[_0xf5a5('0x30')][_0xf5a5('0x1b')]);}_0x1be94d[_0xf5a5('0x38')]=qs[_0xf5a5('0x39')](_0x76188a[_0xf5a5('0x30')][_0xf5a5('0x39')]);_0x1be94d['where']=qs[_0xf5a5('0x3a')](_[_0xf5a5('0x3b')](_0x76188a[_0xf5a5('0x30')],_0x533321['filters']),_0x234bcb);if(_0x76188a[_0xf5a5('0x30')]['filter']){_0x1be94d[_0xf5a5('0x3c')]=_[_0xf5a5('0x3d')](_0x1be94d[_0xf5a5('0x3c')],{'$or':_['map'](_0x234bcb,function(_0x5da0b6){if(_0x5da0b6[_0xf5a5('0x2e')]!=='VIRTUAL'){var _0x4e8e41={};_0x4e8e41[_0x5da0b6[_0xf5a5('0x27')]]={'$like':'%'+_0x76188a[_0xf5a5('0x30')][_0xf5a5('0x3e')]+'%'};return _0x4e8e41;}})});}_0x1be94d=_[_0xf5a5('0x3d')]({},_0x1be94d,_0x76188a['options']);var _0x8c8365={'where':_0x1be94d['where']};return db['AnalyticFieldReport'][_0xf5a5('0x1d')](_0x8c8365)['then'](function(_0x265e09){_0x475bb8[_0xf5a5('0x1d')]=_0x265e09;if(_0x76188a[_0xf5a5('0x30')][_0xf5a5('0x3f')]){_0x1be94d[_0xf5a5('0x40')]=[{'all':!![]}];}return db[_0xf5a5('0x2b')][_0xf5a5('0x41')](_0x1be94d);})['then'](function(_0x27e979){_0x475bb8['rows']=_0x27e979;return _0x475bb8;})[_0xf5a5('0x24')](respondWithFilteredResult(_0x227b07,_0x1be94d))[_0xf5a5('0x42')](handleError(_0x227b07,null));};exports[_0xf5a5('0x43')]=function(_0x2a42b0,_0x2d351e){var _0x4d3a18={'raw':![],'where':{'id':_0x2a42b0[_0xf5a5('0x44')]['id']}},_0x2bddf3={};_0x2bddf3[_0xf5a5('0x32')]=_[_0xf5a5('0x31')](db[_0xf5a5('0x2b')][_0xf5a5('0x2c')]);_0x2bddf3[_0xf5a5('0x30')]=_[_0xf5a5('0x31')](_0x2a42b0[_0xf5a5('0x30')]);_0x2bddf3['filters']=_[_0xf5a5('0x45')](_0x2bddf3[_0xf5a5('0x32')],_0x2bddf3[_0xf5a5('0x30')]);_0x4d3a18[_0xf5a5('0x34')]=_['intersection'](_0x2bddf3[_0xf5a5('0x32')],qs[_0xf5a5('0x33')](_0x2a42b0[_0xf5a5('0x30')][_0xf5a5('0x33')]));_0x4d3a18[_0xf5a5('0x34')]=_0x4d3a18[_0xf5a5('0x34')]['length']?_0x4d3a18[_0xf5a5('0x34')]:_0x2bddf3['model'];if(_0x2a42b0['query'][_0xf5a5('0x3f')]){_0x4d3a18[_0xf5a5('0x40')]=[{'all':!![]}];}_0x4d3a18=_[_0xf5a5('0x3d')]({},_0x4d3a18,_0x2a42b0[_0xf5a5('0x46')]);return db[_0xf5a5('0x2b')]['find'](_0x4d3a18)['then'](handleEntityNotFound(_0x2d351e,null))[_0xf5a5('0x24')](respondWithResult(_0x2d351e,null))[_0xf5a5('0x42')](handleError(_0x2d351e,null));};exports[_0xf5a5('0x47')]=function(_0x3c9ef3,_0x1e403e){return db[_0xf5a5('0x2b')][_0xf5a5('0x47')](_0x3c9ef3[_0xf5a5('0x48')],{})[_0xf5a5('0x24')](respondWithResult(_0x1e403e,0xc9))[_0xf5a5('0x42')](handleError(_0x1e403e,null));};exports[_0xf5a5('0x49')]=function(_0x525c1f,_0x50f684){return db['AnalyticFieldReport']['bulkCreate'](_0x525c1f[_0xf5a5('0x48')],{'raw':![],'individualHooks':!![]})[_0xf5a5('0x24')](respondWithResult(_0x50f684,0xc9))[_0xf5a5('0x42')](handleError(_0x50f684,null));};exports[_0xf5a5('0x22')]=function(_0x10c3dd,_0x3f75bb){if(_0x10c3dd[_0xf5a5('0x48')]['id']){delete _0x10c3dd[_0xf5a5('0x48')]['id'];}return db[_0xf5a5('0x2b')][_0xf5a5('0x4a')]({'where':{'id':_0x10c3dd[_0xf5a5('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f75bb,null))[_0xf5a5('0x24')](saveUpdates(_0x10c3dd[_0xf5a5('0x48')],null))[_0xf5a5('0x24')](respondWithResult(_0x3f75bb,null))[_0xf5a5('0x42')](handleError(_0x3f75bb,null));};exports['destroy']=function(_0x8ce9f5,_0x5ef332){return db[_0xf5a5('0x2b')][_0xf5a5('0x4a')]({'where':{'id':_0x8ce9f5['params']['id']}})[_0xf5a5('0x24')](handleEntityNotFound(_0x5ef332,null))['then'](removeEntity(_0x5ef332,null))[_0xf5a5('0x42')](handleError(_0x5ef332,null));};exports['bulkDestroy']=function(_0x306a87,_0x2ff890){return db[_0xf5a5('0x2b')][_0xf5a5('0x23')]({'where':{'id':_0x306a87['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xf5a5('0x24')](respondWithResult(_0x2ff890,0xcc))[_0xf5a5('0x42')](handleError(_0x2ff890,null));};exports[_0xf5a5('0x4b')]=function(_0x203ae6,_0x4aa119,_0x3aed86){return db[_0xf5a5('0x4c')][_0xf5a5('0x4d')]({'where':{'id':_0x203ae6[_0xf5a5('0x44')]['id']}})['then'](handleEntityNotFound(_0x4aa119,null))[_0xf5a5('0x24')](function(_0x1cc807){if(_0x1cc807){return db[_0xf5a5('0x4e')]['transaction'](function(_0x5e6239){return db[_0xf5a5('0x2b')][_0xf5a5('0x23')]({'where':{'CustomReportId':_0x203ae6['params']['id']},'transaction':_0x5e6239})[_0xf5a5('0x24')](function(_0x5d93a3){var _0x3baee2=_['map'](_0x203ae6[_0xf5a5('0x48')],function(_0x139d7e){delete _0x139d7e['id'];_0x139d7e[_0xf5a5('0x4f')]=_0x203ae6[_0xf5a5('0x44')]['id'];return _0x139d7e;});return db[_0xf5a5('0x2b')][_0xf5a5('0x49')](_0x3baee2,{'transaction':_0x5e6239});});})['then'](function(){return db[_0xf5a5('0x2b')][_0xf5a5('0x41')]({'where':{'CustomReportId':_0x203ae6[_0xf5a5('0x44')]['id']}});});}})[_0xf5a5('0x24')](respondWithResult(_0x4aa119,null))[_0xf5a5('0x42')](handleError(_0x4aa119,null));};
\ No newline at end of file
+var _0x5adc=['query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','params','length','include','find','create','body','bulkCreate','ids','AnalyticCustomReport','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key'];(function(_0x4cec68,_0x39d25a){var _0x5efe80=function(_0x536cbc){while(--_0x536cbc){_0x4cec68['push'](_0x4cec68['shift']());}};_0x5efe80(++_0x39d25a);}(_0x5adc,0x6c));var _0xc5ad=function(_0x57111e,_0x160178){_0x57111e=_0x57111e-0x0;var _0xe2469f=_0x5adc[_0x57111e];return _0xe2469f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5ad('0x0'));var zipdir=require(_0xc5ad('0x1'));var jsonpatch=require(_0xc5ad('0x2'));var rp=require(_0xc5ad('0x3'));var moment=require(_0xc5ad('0x4'));var BPromise=require(_0xc5ad('0x5'));var Mustache=require(_0xc5ad('0x6'));var util=require(_0xc5ad('0x7'));var path=require(_0xc5ad('0x8'));var sox=require(_0xc5ad('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5ad('0xa'));var _=require(_0xc5ad('0xb'));var squel=require(_0xc5ad('0xc'));var crypto=require(_0xc5ad('0xd'));var jsforce=require(_0xc5ad('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc5ad('0xf'));var querystring=require(_0xc5ad('0x10'));var Papa=require(_0xc5ad('0x11'));var Redis=require(_0xc5ad('0x12'));var authService=require(_0xc5ad('0x13'));var qs=require(_0xc5ad('0x14'));var as=require(_0xc5ad('0x15'));var hardwareService=require(_0xc5ad('0x16'));var logger=require('../../config/logger')(_0xc5ad('0x17'));var utils=require('../../config/utils');var config=require(_0xc5ad('0x18'));var licenseUtil=require(_0xc5ad('0x19'));var db=require(_0xc5ad('0x1a'))['db'];function respondWithStatusCode(_0x55399b,_0x4340d3){_0x4340d3=_0x4340d3||0xcc;return function(_0x1adb51){if(_0x1adb51){return _0x55399b[_0xc5ad('0x1b')](_0x4340d3);}return _0x55399b[_0xc5ad('0x1c')](_0x4340d3)[_0xc5ad('0x1d')]();};}function respondWithResult(_0x44269d,_0xb00874){_0xb00874=_0xb00874||0xc8;return function(_0xf4dbc){if(_0xf4dbc){return _0x44269d[_0xc5ad('0x1c')](_0xb00874)[_0xc5ad('0x1e')](_0xf4dbc);}};}function respondWithFilteredResult(_0x303b66,_0x1e83a6){return function(_0x4b547d){if(_0x4b547d){var _0x146230=typeof _0x1e83a6[_0xc5ad('0x1f')]===_0xc5ad('0x20')&&typeof _0x1e83a6[_0xc5ad('0x21')]===_0xc5ad('0x20');var _0x13b530=_0x4b547d[_0xc5ad('0x22')];var _0x55eb59=_0x146230?0x0:_0x1e83a6[_0xc5ad('0x1f')];var _0x25d44b=_0x146230?_0x4b547d['count']:_0x1e83a6[_0xc5ad('0x1f')]+_0x1e83a6[_0xc5ad('0x21')];var _0x35f91b;if(_0x25d44b>=_0x13b530){_0x25d44b=_0x13b530;_0x35f91b=0xc8;}else{_0x35f91b=0xce;}_0x303b66[_0xc5ad('0x1c')](_0x35f91b);return _0x303b66['set'](_0xc5ad('0x23'),_0x55eb59+'-'+_0x25d44b+'/'+_0x13b530)['json'](_0x4b547d);}return null;};}function patchUpdates(_0x5c66ac){return function(_0x1457fb){try{jsonpatch['apply'](_0x1457fb,_0x5c66ac,!![]);}catch(_0x3eec0c){return BPromise[_0xc5ad('0x24')](_0x3eec0c);}return _0x1457fb[_0xc5ad('0x25')]();};}function saveUpdates(_0x304536,_0x12f0a2){return function(_0x26d69a){if(_0x26d69a){return _0x26d69a[_0xc5ad('0x26')](_0x304536)[_0xc5ad('0x27')](function(_0x18c350){return _0x18c350;});}return null;};}function removeEntity(_0x5a1e55,_0xf9b323){return function(_0x2986f2){if(_0x2986f2){return _0x2986f2[_0xc5ad('0x28')]()[_0xc5ad('0x27')](function(){_0x5a1e55[_0xc5ad('0x1c')](0xcc)[_0xc5ad('0x1d')]();});}};}function handleEntityNotFound(_0x13d274,_0x228550){return function(_0x5ade8a){if(!_0x5ade8a){_0x13d274[_0xc5ad('0x1b')](0x194);}return _0x5ade8a;};}function handleError(_0x17dd3c,_0x3efb75){_0x3efb75=_0x3efb75||0x1f4;return function(_0x548fe6){logger['error'](_0x548fe6[_0xc5ad('0x29')]);if(_0x548fe6[_0xc5ad('0x2a')]){delete _0x548fe6[_0xc5ad('0x2a')];}_0x17dd3c[_0xc5ad('0x1c')](_0x3efb75)[_0xc5ad('0x2b')](_0x548fe6);};}exports[_0xc5ad('0x2c')]=function(_0x1d66fe,_0x16961b){var _0x5b153e={},_0x2b52b6={},_0x30bf5f={'count':0x0,'rows':[]};var _0x4eb5ec=_[_0xc5ad('0x2d')](db[_0xc5ad('0x2e')][_0xc5ad('0x2f')],function(_0x1117c1){return{'name':_0x1117c1['fieldName'],'type':_0x1117c1[_0xc5ad('0x30')][_0xc5ad('0x31')]};});_0x2b52b6['model']=_[_0xc5ad('0x2d')](_0x4eb5ec,_0xc5ad('0x2a'));_0x2b52b6[_0xc5ad('0x32')]=_[_0xc5ad('0x33')](_0x1d66fe[_0xc5ad('0x32')]);_0x2b52b6['filters']=_[_0xc5ad('0x34')](_0x2b52b6[_0xc5ad('0x35')],_0x2b52b6[_0xc5ad('0x32')]);_0x5b153e[_0xc5ad('0x36')]=_[_0xc5ad('0x34')](_0x2b52b6[_0xc5ad('0x35')],qs[_0xc5ad('0x37')](_0x1d66fe[_0xc5ad('0x32')][_0xc5ad('0x37')]));_0x5b153e['attributes']=_0x5b153e['attributes']['length']?_0x5b153e[_0xc5ad('0x36')]:_0x2b52b6['model'];if(!_0x1d66fe[_0xc5ad('0x32')][_0xc5ad('0x38')](_0xc5ad('0x39'))){_0x5b153e['limit']=qs['limit'](_0x1d66fe[_0xc5ad('0x32')][_0xc5ad('0x21')]);_0x5b153e['offset']=qs[_0xc5ad('0x1f')](_0x1d66fe[_0xc5ad('0x32')][_0xc5ad('0x1f')]);}_0x5b153e['order']=qs[_0xc5ad('0x3a')](_0x1d66fe[_0xc5ad('0x32')][_0xc5ad('0x3a')]);_0x5b153e['where']=qs[_0xc5ad('0x3b')](_[_0xc5ad('0x3c')](_0x1d66fe['query'],_0x2b52b6[_0xc5ad('0x3b')]),_0x4eb5ec);if(_0x1d66fe[_0xc5ad('0x32')][_0xc5ad('0x3d')]){_0x5b153e[_0xc5ad('0x3e')]=_[_0xc5ad('0x3f')](_0x5b153e['where'],{'$or':_['map'](_0x4eb5ec,function(_0x3cc481){if(_0x3cc481['type']!==_0xc5ad('0x40')){var _0x3da910={};_0x3da910[_0x3cc481['name']]={'$like':'%'+_0x1d66fe['query'][_0xc5ad('0x3d')]+'%'};return _0x3da910;}})});}_0x5b153e=_[_0xc5ad('0x3f')]({},_0x5b153e,_0x1d66fe['options']);var _0x194857={'where':_0x5b153e[_0xc5ad('0x3e')]};return db[_0xc5ad('0x2e')][_0xc5ad('0x22')](_0x194857)[_0xc5ad('0x27')](function(_0x31fca1){_0x30bf5f['count']=_0x31fca1;if(_0x1d66fe[_0xc5ad('0x32')][_0xc5ad('0x41')]){_0x5b153e['include']=[{'all':!![]}];}return db[_0xc5ad('0x2e')][_0xc5ad('0x42')](_0x5b153e);})[_0xc5ad('0x27')](function(_0x1db192){_0x30bf5f['rows']=_0x1db192;return _0x30bf5f;})[_0xc5ad('0x27')](respondWithFilteredResult(_0x16961b,_0x5b153e))[_0xc5ad('0x43')](handleError(_0x16961b,null));};exports['show']=function(_0x3c7a4e,_0x433572){var _0x111b13={'raw':![],'where':{'id':_0x3c7a4e[_0xc5ad('0x44')]['id']}},_0x111cbf={};_0x111cbf[_0xc5ad('0x35')]=_[_0xc5ad('0x33')](db[_0xc5ad('0x2e')][_0xc5ad('0x2f')]);_0x111cbf['query']=_['keys'](_0x3c7a4e[_0xc5ad('0x32')]);_0x111cbf['filters']=_[_0xc5ad('0x34')](_0x111cbf[_0xc5ad('0x35')],_0x111cbf[_0xc5ad('0x32')]);_0x111b13[_0xc5ad('0x36')]=_[_0xc5ad('0x34')](_0x111cbf['model'],qs[_0xc5ad('0x37')](_0x3c7a4e[_0xc5ad('0x32')][_0xc5ad('0x37')]));_0x111b13[_0xc5ad('0x36')]=_0x111b13[_0xc5ad('0x36')][_0xc5ad('0x45')]?_0x111b13['attributes']:_0x111cbf[_0xc5ad('0x35')];if(_0x3c7a4e[_0xc5ad('0x32')][_0xc5ad('0x41')]){_0x111b13[_0xc5ad('0x46')]=[{'all':!![]}];}_0x111b13=_[_0xc5ad('0x3f')]({},_0x111b13,_0x3c7a4e['options']);return db['AnalyticFieldReport'][_0xc5ad('0x47')](_0x111b13)[_0xc5ad('0x27')](handleEntityNotFound(_0x433572,null))['then'](respondWithResult(_0x433572,null))[_0xc5ad('0x43')](handleError(_0x433572,null));};exports['create']=function(_0x1ab240,_0x5ab940){return db['AnalyticFieldReport'][_0xc5ad('0x48')](_0x1ab240[_0xc5ad('0x49')],{})[_0xc5ad('0x27')](respondWithResult(_0x5ab940,0xc9))[_0xc5ad('0x43')](handleError(_0x5ab940,null));};exports[_0xc5ad('0x4a')]=function(_0x65902a,_0xa04f61){return db[_0xc5ad('0x2e')][_0xc5ad('0x4a')](_0x65902a[_0xc5ad('0x49')],{'raw':![],'individualHooks':!![]})[_0xc5ad('0x27')](respondWithResult(_0xa04f61,0xc9))[_0xc5ad('0x43')](handleError(_0xa04f61,null));};exports[_0xc5ad('0x26')]=function(_0xc5f068,_0x3cc5ab){if(_0xc5f068[_0xc5ad('0x49')]['id']){delete _0xc5f068[_0xc5ad('0x49')]['id'];}return db['AnalyticFieldReport'][_0xc5ad('0x47')]({'where':{'id':_0xc5f068[_0xc5ad('0x44')]['id']}})[_0xc5ad('0x27')](handleEntityNotFound(_0x3cc5ab,null))[_0xc5ad('0x27')](saveUpdates(_0xc5f068['body'],null))['then'](respondWithResult(_0x3cc5ab,null))['catch'](handleError(_0x3cc5ab,null));};exports[_0xc5ad('0x28')]=function(_0x5df091,_0xb34489){return db[_0xc5ad('0x2e')][_0xc5ad('0x47')]({'where':{'id':_0x5df091[_0xc5ad('0x44')]['id']}})['then'](handleEntityNotFound(_0xb34489,null))['then'](removeEntity(_0xb34489,null))[_0xc5ad('0x43')](handleError(_0xb34489,null));};exports['bulkDestroy']=function(_0x3e5c38,_0x56fee9){return db['AnalyticFieldReport'][_0xc5ad('0x28')]({'where':{'id':_0x3e5c38[_0xc5ad('0x32')][_0xc5ad('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xc5ad('0x27')](respondWithResult(_0x56fee9,0xcc))[_0xc5ad('0x43')](handleError(_0x56fee9,null));};exports['addFields']=function(_0x38ff25,_0x12010d,_0x2590e2){return db[_0xc5ad('0x4c')]['findOne']({'where':{'id':_0x38ff25[_0xc5ad('0x44')]['id']}})[_0xc5ad('0x27')](handleEntityNotFound(_0x12010d,null))['then'](function(_0x10b097){if(_0x10b097){return db[_0xc5ad('0x4d')][_0xc5ad('0x4e')](function(_0x256785){return db['AnalyticFieldReport'][_0xc5ad('0x28')]({'where':{'CustomReportId':_0x38ff25['params']['id']},'transaction':_0x256785})['then'](function(_0x8e760f){var _0x458798=_[_0xc5ad('0x2d')](_0x38ff25[_0xc5ad('0x49')],function(_0x4ba645){delete _0x4ba645['id'];_0x4ba645['CustomReportId']=_0x38ff25[_0xc5ad('0x44')]['id'];return _0x4ba645;});return db[_0xc5ad('0x2e')][_0xc5ad('0x4a')](_0x458798,{'transaction':_0x256785});});})[_0xc5ad('0x27')](function(){return db[_0xc5ad('0x2e')][_0xc5ad('0x42')]({'where':{'CustomReportId':_0x38ff25[_0xc5ad('0x44')]['id']}});});}})[_0xc5ad('0x27')](respondWithResult(_0x12010d,null))['catch'](handleError(_0x12010d,null));};
\ No newline at end of file
index 439ecf9..fa024d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94da=['../../config/environment','exports','analytics_report_fields','lodash','moment','bluebird'];(function(_0x2e59fe,_0x27d28f){var _0x7815cc=function(_0x54008a){while(--_0x54008a){_0x2e59fe['push'](_0x2e59fe['shift']());}};_0x7815cc(++_0x27d28f);}(_0x94da,0x69));var _0xa94d=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x94da[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0xa94d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa94d('0x1'));var BPromise=require(_0xa94d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa94d('0x3'));var attributes=require('./analyticFieldReport.attributes');module[_0xa94d('0x4')]=function(_0x422e07,_0x3da320){return _0x422e07['define']('AnalyticFieldReport',attributes,{'tableName':_0xa94d('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x531f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x4241a9,_0x543327){var _0x512304=function(_0x1e4245){while(--_0x1e4245){_0x4241a9['push'](_0x4241a9['shift']());}};_0x512304(++_0x543327);}(_0x531f,0x137));var _0xf531=function(_0x3d34f0,_0x4a5dc0){_0x3d34f0=_0x3d34f0-0x0;var _0x135ecd=_0x531f[_0x3d34f0];return _0x135ecd;};'use strict';var _=require(_0xf531('0x0'));var util=require('util');var logger=require(_0xf531('0x1'))(_0xf531('0x2'));var moment=require(_0xf531('0x3'));var BPromise=require(_0xf531('0x4'));var rp=require(_0xf531('0x5'));var fs=require('fs');var path=require(_0xf531('0x6'));var rimraf=require(_0xf531('0x7'));var config=require(_0xf531('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xf531('0x9')]=function(_0xb256ad,_0x4f5c37){return _0xb256ad['define'](_0xf531('0xa'),attributes,{'tableName':_0xf531('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1dd250d..f828700 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a25=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x49a9c1,_0x22e8a8){var _0x4119d7=function(_0x2691bd){while(--_0x2691bd){_0x49a9c1['push'](_0x49a9c1['shift']());}};_0x4119d7(++_0x22e8a8);}(_0x0a25,0xc9));var _0x50a2=function(_0x22b9b7,_0x203492){_0x22b9b7=_0x22b9b7-0x0;var _0xbd7673=_0x0a25[_0x22b9b7];return _0xbd7673;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var moment=require(_0x50a2('0x2'));var BPromise=require(_0x50a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50a2('0x4'));var db=require(_0x50a2('0x5'))['db'];var utils=require(_0x50a2('0x6'));var logger=require('../../config/logger')(_0x50a2('0x7'));var config=require('../../config/environment');var jayson=require(_0x50a2('0x8'));var client=jayson[_0x50a2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c7ad4,_0x4d75cf,_0x47add8){return new BPromise(function(_0x4722c0,_0x4ca0d5){return client[_0x50a2('0xa')](_0x1c7ad4,_0x47add8)[_0x50a2('0xb')](function(_0x298fbe){logger[_0x50a2('0xc')](_0x50a2('0xd'),_0x4d75cf,_0x50a2('0xe'));logger[_0x50a2('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4d75cf,_0x50a2('0xe'),JSON[_0x50a2('0x10')](_0x298fbe));if(_0x298fbe[_0x50a2('0x11')]){if(_0x298fbe['error']['code']===0x1f4){logger[_0x50a2('0x11')](_0x50a2('0xd'),_0x4d75cf,_0x298fbe['error'][_0x50a2('0x12')]);return _0x4ca0d5(_0x298fbe[_0x50a2('0x11')]['message']);}logger[_0x50a2('0x11')](_0x50a2('0xd'),_0x4d75cf,_0x298fbe['error'][_0x50a2('0x12')]);return _0x4722c0(_0x298fbe[_0x50a2('0x11')][_0x50a2('0x12')]);}else{logger[_0x50a2('0xc')](_0x50a2('0xd'),_0x4d75cf,_0x50a2('0xe'));_0x4722c0(_0x298fbe[_0x50a2('0x13')][_0x50a2('0x12')]);}})['catch'](function(_0x384970){logger[_0x50a2('0x11')](_0x50a2('0xd'),_0x4d75cf,_0x384970);_0x4ca0d5(_0x384970);});});}
\ No newline at end of file
+var _0xfab7=['code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0xfab7,0x193));var _0x7fab=function(_0x3729d6,_0x549397){_0x3729d6=_0x3729d6-0x0;var _0x153bff=_0xfab7[_0x3729d6];return _0x153bff;};'use strict';var _=require('lodash');var util=require(_0x7fab('0x0'));var moment=require(_0x7fab('0x1'));var BPromise=require(_0x7fab('0x2'));var rs=require(_0x7fab('0x3'));var fs=require('fs');var Redis=require(_0x7fab('0x4'));var db=require(_0x7fab('0x5'))['db'];var utils=require(_0x7fab('0x6'));var logger=require('../../config/logger')(_0x7fab('0x7'));var config=require(_0x7fab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7fab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x234ddf,_0x283ecd,_0x4464fc){return new BPromise(function(_0x91f69d,_0x2d2ae1){return client[_0x7fab('0xa')](_0x234ddf,_0x4464fc)[_0x7fab('0xb')](function(_0x2b7f38){logger[_0x7fab('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x283ecd,_0x7fab('0xd'));logger[_0x7fab('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x283ecd,_0x7fab('0xd'),JSON[_0x7fab('0xf')](_0x2b7f38));if(_0x2b7f38[_0x7fab('0x10')]){if(_0x2b7f38[_0x7fab('0x10')][_0x7fab('0x11')]===0x1f4){logger[_0x7fab('0x10')](_0x7fab('0x12'),_0x283ecd,_0x2b7f38[_0x7fab('0x10')][_0x7fab('0x13')]);return _0x2d2ae1(_0x2b7f38['error']['message']);}logger['error'](_0x7fab('0x12'),_0x283ecd,_0x2b7f38[_0x7fab('0x10')][_0x7fab('0x13')]);return _0x91f69d(_0x2b7f38[_0x7fab('0x10')][_0x7fab('0x13')]);}else{logger['info'](_0x7fab('0x12'),_0x283ecd,_0x7fab('0xd'));_0x91f69d(_0x2b7f38['result'][_0x7fab('0x13')]);}})[_0x7fab('0x14')](function(_0x5227c0){logger[_0x7fab('0x10')](_0x7fab('0x12'),_0x283ecd,_0x5227c0);_0x2d2ae1(_0x5227c0);});});}
\ No newline at end of file
index 9248a36..443e3a4 100644 (file)
@@ -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(_0x228487,_0x23ed72){var _0x3e1946=function(_0x2c53d9){while(--_0x2c53d9){_0x228487['push'](_0x228487['shift']());}};_0x3e1946(++_0x23ed72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x444add,_0x54d935){var _0x46ab86=function(_0x236d03){while(--_0x236d03){_0x444add['push'](_0x444add['shift']());}};_0x46ab86(++_0x54d935);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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
index 487d759..ef25f28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95c5=['exports','name','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95c5,0x153));var _0x595c=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x95c5[_0x57014b];return _0x2b258a;};'use strict';var Sequelize=require(_0x595c('0x0'));module[_0x595c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x595c('0x2')},'table':{'type':Sequelize[_0x595c('0x3')]},'metric':{'type':Sequelize[_0x595c('0x4')]},'description':{'type':Sequelize[_0x595c('0x3')]}};
\ No newline at end of file
+var _0x6c63=['exports','STRING','name','TEXT','sequelize'];(function(_0x4368d8,_0x536d04){var _0x53f9c4=function(_0x52ea67){while(--_0x52ea67){_0x4368d8['push'](_0x4368d8['shift']());}};_0x53f9c4(++_0x536d04);}(_0x6c63,0x1ee));var _0x36c6=function(_0x37c503,_0x2ed1b1){_0x37c503=_0x37c503-0x0;var _0x6a9344=_0x6c63[_0x37c503];return _0x6a9344;};'use strict';var Sequelize=require(_0x36c6('0x0'));module[_0x36c6('0x1')]={'name':{'type':Sequelize[_0x36c6('0x2')],'allowNull':![],'unique':_0x36c6('0x3')},'table':{'type':Sequelize[_0x36c6('0x2')]},'metric':{'type':Sequelize[_0x36c6('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5077222..5f50470 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x583abb,_0x104950){var _0x5b4766=function(_0x2a5fec){while(--_0x2a5fec){_0x583abb['push'](_0x583abb['shift']());}};_0x5b4766(++_0x104950);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0xf2ca[_0x3e5bc8];return _0xfd84bc;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
+var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x49715b,_0x13faa9){var _0x3cdd3d=function(_0x46330e){while(--_0x46330e){_0x49715b['push'](_0x49715b['shift']());}};_0x3cdd3d(++_0x13faa9);}(_0x55ca,0x126));var _0xa55c=function(_0x1268f4,_0x147117){_0x1268f4=_0x1268f4-0x0;var _0x2f1b05=_0x55ca[_0x1268f4];return _0x2f1b05;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
index cabad1d..ba8f5a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18af=['./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','../../config/logger','moment','rimraf','../../config/environment'];(function(_0x15c033,_0x2800e5){var _0x528f87=function(_0x2abc02){while(--_0x2abc02){_0x15c033['push'](_0x15c033['shift']());}};_0x528f87(++_0x2800e5);}(_0x18af,0x8b));var _0xf18a=function(_0xcbe43d,_0x40a659){_0xcbe43d=_0xcbe43d-0x0;var _0x44ca12=_0x18af[_0xcbe43d];return _0x44ca12;};'use strict';var _=require(_0xf18a('0x0'));var util=require('util');var logger=require(_0xf18a('0x1'))('api');var moment=require(_0xf18a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf18a('0x3'));var config=require(_0xf18a('0x4'));var attributes=require(_0xf18a('0x5'));module[_0xf18a('0x6')]=function(_0x537fb4,_0xd1386e){return _0x537fb4[_0xf18a('0x7')](_0xf18a('0x8'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf4e=['moment','bluebird','path','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api'];(function(_0x49169e,_0x53436f){var _0x18c924=function(_0x319675){while(--_0x319675){_0x49169e['push'](_0x49169e['shift']());}};_0x18c924(++_0x53436f);}(_0xbf4e,0x172));var _0xebf4=function(_0x15440c,_0xcb8510){_0x15440c=_0x15440c-0x0;var _0x4ff778=_0xbf4e[_0x15440c];return _0x4ff778;};'use strict';var _=require(_0xebf4('0x0'));var util=require(_0xebf4('0x1'));var logger=require(_0xebf4('0x2'))(_0xebf4('0x3'));var moment=require(_0xebf4('0x4'));var BPromise=require(_0xebf4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xebf4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xebf4('0x7'));module[_0xebf4('0x8')]=function(_0x5adea8,_0x412bbe){return _0x5adea8[_0xebf4('0x9')](_0xebf4('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0ced488..1f19dd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5f7=['AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x250c22,_0x8fba9){var _0x1e238e=function(_0x4bf2e8){while(--_0x4bf2e8){_0x250c22['push'](_0x250c22['shift']());}};_0x1e238e(++_0x8fba9);}(_0xf5f7,0x198));var _0x7f5f=function(_0x4cc2f9,_0x442285){_0x4cc2f9=_0x4cc2f9-0x0;var _0x212dc4=_0xf5f7[_0x4cc2f9];return _0x212dc4;};'use strict';var _=require(_0x7f5f('0x0'));var util=require(_0x7f5f('0x1'));var moment=require(_0x7f5f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f5f('0x3'))['db'];var utils=require(_0x7f5f('0x4'));var logger=require(_0x7f5f('0x5'))(_0x7f5f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7f5f('0x7')][_0x7f5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35e848,_0x2bd918,_0x1600c6){return new BPromise(function(_0x481db7,_0xf791dc){return client[_0x7f5f('0x9')](_0x35e848,_0x1600c6)[_0x7f5f('0xa')](function(_0x3333a9){logger[_0x7f5f('0xb')](_0x7f5f('0xc'),_0x2bd918,'request\x20sent');logger['debug'](_0x7f5f('0xd'),_0x2bd918,_0x7f5f('0xe'),JSON[_0x7f5f('0xf')](_0x3333a9));if(_0x3333a9[_0x7f5f('0x10')]){if(_0x3333a9[_0x7f5f('0x10')][_0x7f5f('0x11')]===0x1f4){logger[_0x7f5f('0x10')](_0x7f5f('0xc'),_0x2bd918,_0x3333a9['error'][_0x7f5f('0x12')]);return _0xf791dc(_0x3333a9['error'][_0x7f5f('0x12')]);}logger[_0x7f5f('0x10')](_0x7f5f('0xc'),_0x2bd918,_0x3333a9[_0x7f5f('0x10')][_0x7f5f('0x12')]);return _0x481db7(_0x3333a9['error'][_0x7f5f('0x12')]);}else{logger[_0x7f5f('0xb')](_0x7f5f('0xc'),_0x2bd918,_0x7f5f('0xe'));_0x481db7(_0x3333a9[_0x7f5f('0x13')][_0x7f5f('0x12')]);}})[_0x7f5f('0x14')](function(_0x3d1524){logger['error'](_0x7f5f('0xc'),_0x2bd918,_0x3d1524);_0xf791dc(_0x3d1524);});});}
\ No newline at end of file
+var _0x6ddf=['ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','catch','bluebird','randomstring'];(function(_0x1a31d9,_0x1e3a2d){var _0x4e164e=function(_0x108890){while(--_0x108890){_0x1a31d9['push'](_0x1a31d9['shift']());}};_0x4e164e(++_0x1e3a2d);}(_0x6ddf,0x167));var _0xf6dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ddf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf6dd('0x0'));var rs=require(_0xf6dd('0x1'));var fs=require('fs');var Redis=require(_0xf6dd('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6dd('0x3'))('rpc');var config=require(_0xf6dd('0x4'));var jayson=require(_0xf6dd('0x5'));var client=jayson[_0xf6dd('0x6')][_0xf6dd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d5b45,_0x15f358,_0x227a8a){return new BPromise(function(_0x1ea9c5,_0x1a1df3){return client[_0xf6dd('0x8')](_0x3d5b45,_0x227a8a)[_0xf6dd('0x9')](function(_0x58093f){logger['info'](_0xf6dd('0xa'),_0x15f358,'request\x20sent');logger[_0xf6dd('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x15f358,'request\x20sent',JSON['stringify'](_0x58093f));if(_0x58093f[_0xf6dd('0xc')]){if(_0x58093f[_0xf6dd('0xc')][_0xf6dd('0xd')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x15f358,_0x58093f[_0xf6dd('0xc')][_0xf6dd('0xe')]);return _0x1a1df3(_0x58093f[_0xf6dd('0xc')][_0xf6dd('0xe')]);}logger[_0xf6dd('0xc')](_0xf6dd('0xa'),_0x15f358,_0x58093f[_0xf6dd('0xc')][_0xf6dd('0xe')]);return _0x1ea9c5(_0x58093f[_0xf6dd('0xc')][_0xf6dd('0xe')]);}else{logger[_0xf6dd('0xf')](_0xf6dd('0xa'),_0x15f358,_0xf6dd('0x10'));_0x1ea9c5(_0x58093f[_0xf6dd('0x11')]['message']);}})[_0xf6dd('0x12')](function(_0x302b97){logger['error'](_0xf6dd('0xa'),_0x15f358,_0x302b97);_0x1a1df3(_0x302b97);});});}
\ No newline at end of file
index 4d5e02e..d64313f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbd3=['create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post'];(function(_0x346a4d,_0x526469){var _0x3707e9=function(_0x414a80){while(--_0x414a80){_0x346a4d['push'](_0x346a4d['shift']());}};_0x3707e9(++_0x526469);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x459c10,_0x116659){_0x459c10=_0x459c10-0x0;var _0x415b18=_0xcbd3[_0x459c10];return _0x415b18;};'use strict';var multer=require(_0x3cbd('0x0'));var util=require(_0x3cbd('0x1'));var path=require(_0x3cbd('0x2'));var timeout=require(_0x3cbd('0x3'));var express=require(_0x3cbd('0x4'));var router=express[_0x3cbd('0x5')]();var fs_extra=require(_0x3cbd('0x6'));var auth=require(_0x3cbd('0x7'));var interaction=require(_0x3cbd('0x8'));var config=require(_0x3cbd('0x9'));var controller=require('./analyticMetric.controller');router[_0x3cbd('0xa')]('/',auth[_0x3cbd('0xb')](),controller['index']);router[_0x3cbd('0xa')]('/:id',auth[_0x3cbd('0xb')](),controller['show']);router[_0x3cbd('0xc')]('/',auth[_0x3cbd('0xb')](),controller[_0x3cbd('0xd')]);router[_0x3cbd('0xe')](_0x3cbd('0xf'),auth['isAuthenticated'](),controller[_0x3cbd('0x10')]);router['delete'](_0x3cbd('0xf'),auth[_0x3cbd('0xb')](),controller[_0x3cbd('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xdf70=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','show','post','create','put','update','delete','destroy'];(function(_0x350587,_0x428a20){var _0x3e4356=function(_0x4c066e){while(--_0x4c066e){_0x350587['push'](_0x350587['shift']());}};_0x3e4356(++_0x428a20);}(_0xdf70,0x86));var _0x0df7=function(_0x22088d,_0x27deaa){_0x22088d=_0x22088d-0x0;var _0x1dab44=_0xdf70[_0x22088d];return _0x1dab44;};'use strict';var multer=require(_0x0df7('0x0'));var util=require(_0x0df7('0x1'));var path=require(_0x0df7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0df7('0x3'));var router=express[_0x0df7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0df7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0df7('0x6'));var controller=require(_0x0df7('0x7'));router['get']('/',auth[_0x0df7('0x8')](),controller[_0x0df7('0x9')]);router[_0x0df7('0xa')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0xb')]);router[_0x0df7('0xc')]('/',auth[_0x0df7('0x8')](),controller[_0x0df7('0xd')]);router[_0x0df7('0xe')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0xf')]);router[_0x0df7('0x10')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0x11')]);module[_0x0df7('0x12')]=router;
\ No newline at end of file
index cf05183..3b29dcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e1=['exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xc4e1,0x9e));var _0x1c4e=function(_0x2a00bb,_0x1d9baf){_0x2a00bb=_0x2a00bb-0x0;var _0x463039=_0xc4e1[_0x2a00bb];return _0x463039;};'use strict';var Sequelize=require('sequelize');module[_0x1c4e('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xa473=['exports','sequelize'];(function(_0x342a81,_0xeb165b){var _0x390ae5=function(_0x253dd5){while(--_0x253dd5){_0x342a81['push'](_0x342a81['shift']());}};_0x390ae5(++_0xeb165b);}(_0xa473,0x1cb));var _0x3a47=function(_0x301206,_0x285918){_0x301206=_0x301206-0x0;var _0x321386=_0xa473[_0x301206];return _0x321386;};'use strict';var Sequelize=require(_0x3a47('0x0'));module[_0x3a47('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
index b7b3aa4..40c5cbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5953=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','AnalyticTreeReport','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update'];(function(_0x57beb7,_0x7a051f){var _0x20cbbb=function(_0x216125){while(--_0x216125){_0x57beb7['push'](_0x57beb7['shift']());}};_0x20cbbb(++_0x7a051f);}(_0x5953,0x74));var _0x3595=function(_0x200476,_0x260f7f){_0x200476=_0x200476-0x0;var _0x4dd552=_0x5953[_0x200476];return _0x4dd552;};'use strict';var emlformat=require(_0x3595('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3595('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3595('0x2'));var moment=require(_0x3595('0x3'));var BPromise=require(_0x3595('0x4'));var Mustache=require('mustache');var util=require(_0x3595('0x5'));var path=require(_0x3595('0x6'));var sox=require(_0x3595('0x7'));var csv=require(_0x3595('0x8'));var ejs=require(_0x3595('0x9'));var fs=require('fs');var fs_extra=require(_0x3595('0xa'));var _=require(_0x3595('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3595('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3595('0xd'));var Papa=require(_0x3595('0xe'));var Redis=require('ioredis');var authService=require(_0x3595('0xf'));var qs=require(_0x3595('0x10'));var as=require(_0x3595('0x11'));var hardwareService=require(_0x3595('0x12'));var logger=require(_0x3595('0x13'))(_0x3595('0x14'));var utils=require(_0x3595('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3595('0x16'))['db'];function respondWithStatusCode(_0x76fc8d,_0xc7edb9){_0xc7edb9=_0xc7edb9||0xcc;return function(_0x50d568){if(_0x50d568){return _0x76fc8d[_0x3595('0x17')](_0xc7edb9);}return _0x76fc8d[_0x3595('0x18')](_0xc7edb9)[_0x3595('0x19')]();};}function respondWithResult(_0x552d50,_0x563722){_0x563722=_0x563722||0xc8;return function(_0x2d147c){if(_0x2d147c){return _0x552d50[_0x3595('0x18')](_0x563722)['json'](_0x2d147c);}};}function respondWithFilteredResult(_0x23a0cf,_0x4672d4){return function(_0x1d2574){if(_0x1d2574){var _0x56eed0=typeof _0x4672d4[_0x3595('0x1a')]===_0x3595('0x1b')&&typeof _0x4672d4['limit']==='undefined';var _0x3e5c98=_0x1d2574['count'];var _0x2756b2=_0x56eed0?0x0:_0x4672d4[_0x3595('0x1a')];var _0xb69c6f=_0x56eed0?_0x1d2574[_0x3595('0x1c')]:_0x4672d4['offset']+_0x4672d4[_0x3595('0x1d')];var _0x16018a;if(_0xb69c6f>=_0x3e5c98){_0xb69c6f=_0x3e5c98;_0x16018a=0xc8;}else{_0x16018a=0xce;}_0x23a0cf[_0x3595('0x18')](_0x16018a);return _0x23a0cf[_0x3595('0x1e')](_0x3595('0x1f'),_0x2756b2+'-'+_0xb69c6f+'/'+_0x3e5c98)[_0x3595('0x20')](_0x1d2574);}return null;};}function patchUpdates(_0x3484ad){return function(_0x2579a4){try{jsonpatch[_0x3595('0x21')](_0x2579a4,_0x3484ad,!![]);}catch(_0x1a193d){return BPromise[_0x3595('0x22')](_0x1a193d);}return _0x2579a4['save']();};}function saveUpdates(_0x2fd2d4,_0xb8416){return function(_0x460651){if(_0x460651){return _0x460651[_0x3595('0x23')](_0x2fd2d4)[_0x3595('0x24')](function(_0x427572){return _0x427572;});}return null;};}function removeEntity(_0x554805,_0xd1ee3){return function(_0x49c7bd){if(_0x49c7bd){return _0x49c7bd[_0x3595('0x25')]()[_0x3595('0x24')](function(){_0x554805[_0x3595('0x18')](0xcc)[_0x3595('0x19')]();});}};}function handleEntityNotFound(_0x1f7280,_0x4304fc){return function(_0x2f75b8){if(!_0x2f75b8){_0x1f7280[_0x3595('0x17')](0x194);}return _0x2f75b8;};}function handleError(_0x44b83c,_0x32a43e){_0x32a43e=_0x32a43e||0x1f4;return function(_0x51ffcc){logger[_0x3595('0x26')](_0x51ffcc[_0x3595('0x27')]);if(_0x51ffcc[_0x3595('0x28')]){delete _0x51ffcc[_0x3595('0x28')];}_0x44b83c[_0x3595('0x18')](_0x32a43e)[_0x3595('0x29')](_0x51ffcc);};}exports[_0x3595('0x2a')]=function(_0x31792f,_0xcc49fc){var _0x486fcd={},_0x3f50fc={},_0x4b7ce1={'count':0x0,'rows':[]};var _0x5cd2e6=_[_0x3595('0x2b')](db['AnalyticTreeReport'][_0x3595('0x2c')],function(_0x4459aa){return{'name':_0x4459aa[_0x3595('0x2d')],'type':_0x4459aa[_0x3595('0x2e')][_0x3595('0x2f')]};});_0x3f50fc['model']=_['map'](_0x5cd2e6,'name');_0x3f50fc[_0x3595('0x30')]=_[_0x3595('0x31')](_0x31792f[_0x3595('0x30')]);_0x3f50fc[_0x3595('0x32')]=_[_0x3595('0x33')](_0x3f50fc[_0x3595('0x34')],_0x3f50fc[_0x3595('0x30')]);_0x486fcd[_0x3595('0x35')]=_[_0x3595('0x33')](_0x3f50fc['model'],qs[_0x3595('0x36')](_0x31792f[_0x3595('0x30')][_0x3595('0x36')]));_0x486fcd[_0x3595('0x35')]=_0x486fcd[_0x3595('0x35')][_0x3595('0x37')]?_0x486fcd[_0x3595('0x35')]:_0x3f50fc[_0x3595('0x34')];if(!_0x31792f['query']['hasOwnProperty'](_0x3595('0x38'))){_0x486fcd[_0x3595('0x1d')]=qs['limit'](_0x31792f[_0x3595('0x30')]['limit']);_0x486fcd['offset']=qs[_0x3595('0x1a')](_0x31792f[_0x3595('0x30')]['offset']);}_0x486fcd[_0x3595('0x39')]=qs[_0x3595('0x3a')](_0x31792f['query']['sort']);_0x486fcd[_0x3595('0x3b')]=qs[_0x3595('0x32')](_[_0x3595('0x3c')](_0x31792f[_0x3595('0x30')],_0x3f50fc[_0x3595('0x32')]),_0x5cd2e6);if(_0x31792f['query'][_0x3595('0x3d')]){_0x486fcd[_0x3595('0x3b')]=_[_0x3595('0x3e')](_0x486fcd[_0x3595('0x3b')],{'$or':_[_0x3595('0x2b')](_0x5cd2e6,function(_0x122c2c){if(_0x122c2c['type']!==_0x3595('0x3f')){var _0x426ced={};_0x426ced[_0x122c2c['name']]={'$like':'%'+_0x31792f[_0x3595('0x30')][_0x3595('0x3d')]+'%'};return _0x426ced;}})});}_0x486fcd=_[_0x3595('0x3e')]({},_0x486fcd,_0x31792f[_0x3595('0x40')]);var _0x3c7169={'where':_0x486fcd[_0x3595('0x3b')]};return db['AnalyticTreeReport'][_0x3595('0x1c')](_0x3c7169)['then'](function(_0x427393){_0x4b7ce1[_0x3595('0x1c')]=_0x427393;if(_0x31792f['query'][_0x3595('0x41')]){_0x486fcd[_0x3595('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x3595('0x43')](_0x486fcd);})[_0x3595('0x24')](function(_0x5b21a5){_0x4b7ce1[_0x3595('0x44')]=_0x5b21a5;return _0x4b7ce1;})[_0x3595('0x24')](respondWithFilteredResult(_0xcc49fc,_0x486fcd))[_0x3595('0x45')](handleError(_0xcc49fc,null));};exports[_0x3595('0x46')]=function(_0x411d4a,_0x45d3ca){var _0x4a98ad={'raw':!![],'where':{'id':_0x411d4a[_0x3595('0x47')]['id']}},_0x1408a4={};_0x1408a4[_0x3595('0x34')]=_[_0x3595('0x31')](db[_0x3595('0x48')]['rawAttributes']);_0x1408a4[_0x3595('0x30')]=_[_0x3595('0x31')](_0x411d4a['query']);_0x1408a4[_0x3595('0x32')]=_['intersection'](_0x1408a4[_0x3595('0x34')],_0x1408a4[_0x3595('0x30')]);_0x4a98ad['attributes']=_[_0x3595('0x33')](_0x1408a4[_0x3595('0x34')],qs[_0x3595('0x36')](_0x411d4a[_0x3595('0x30')][_0x3595('0x36')]));_0x4a98ad['attributes']=_0x4a98ad[_0x3595('0x35')][_0x3595('0x37')]?_0x4a98ad['attributes']:_0x1408a4[_0x3595('0x34')];if(_0x411d4a[_0x3595('0x30')][_0x3595('0x41')]){_0x4a98ad[_0x3595('0x42')]=[{'all':!![]}];}_0x4a98ad=_['merge']({},_0x4a98ad,_0x411d4a[_0x3595('0x40')]);return db['AnalyticTreeReport'][_0x3595('0x49')](_0x4a98ad)[_0x3595('0x24')](handleEntityNotFound(_0x45d3ca,null))[_0x3595('0x24')](respondWithResult(_0x45d3ca,null))[_0x3595('0x45')](handleError(_0x45d3ca,null));};exports[_0x3595('0x4a')]=function(_0x2dcc64,_0x48c41a){return db[_0x3595('0x48')][_0x3595('0x4a')](_0x2dcc64['body'],{})[_0x3595('0x24')](respondWithResult(_0x48c41a,0xc9))[_0x3595('0x45')](handleError(_0x48c41a,null));};exports[_0x3595('0x23')]=function(_0x340595,_0x101c58){if(_0x340595[_0x3595('0x4b')]['id']){delete _0x340595[_0x3595('0x4b')]['id'];}return db[_0x3595('0x48')][_0x3595('0x49')]({'where':{'id':_0x340595[_0x3595('0x47')]['id']}})[_0x3595('0x24')](handleEntityNotFound(_0x101c58,null))[_0x3595('0x24')](saveUpdates(_0x340595[_0x3595('0x4b')],null))[_0x3595('0x24')](respondWithResult(_0x101c58,null))[_0x3595('0x45')](handleError(_0x101c58,null));};exports[_0x3595('0x25')]=function(_0x523295,_0x92e824){return db[_0x3595('0x48')][_0x3595('0x49')]({'where':{'id':_0x523295[_0x3595('0x47')]['id']}})[_0x3595('0x24')](handleEntityNotFound(_0x92e824,null))[_0x3595('0x24')](removeEntity(_0x92e824,null))[_0x3595('0x45')](handleError(_0x92e824,null));};
\ No newline at end of file
+var _0xe036=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x530a16,_0x27deff){var _0x5586dd=function(_0x163127){while(--_0x163127){_0x530a16['push'](_0x530a16['shift']());}};_0x5586dd(++_0x27deff);}(_0xe036,0xcd));var _0x6e03=function(_0x35deb4,_0x443a74){_0x35deb4=_0x35deb4-0x0;var _0x31d5e6=_0xe036[_0x35deb4];return _0x31d5e6;};'use strict';var emlformat=require(_0x6e03('0x0'));var rimraf=require(_0x6e03('0x1'));var zipdir=require(_0x6e03('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e03('0x3'));var moment=require(_0x6e03('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6e03('0x5'));var util=require(_0x6e03('0x6'));var path=require(_0x6e03('0x7'));var sox=require(_0x6e03('0x8'));var csv=require(_0x6e03('0x9'));var ejs=require(_0x6e03('0xa'));var fs=require('fs');var fs_extra=require(_0x6e03('0xb'));var _=require(_0x6e03('0xc'));var squel=require(_0x6e03('0xd'));var crypto=require(_0x6e03('0xe'));var jsforce=require(_0x6e03('0xf'));var deskjs=require(_0x6e03('0x10'));var toCsv=require(_0x6e03('0x9'));var querystring=require('querystring');var Papa=require(_0x6e03('0x11'));var Redis=require(_0x6e03('0x12'));var authService=require(_0x6e03('0x13'));var qs=require(_0x6e03('0x14'));var as=require(_0x6e03('0x15'));var hardwareService=require(_0x6e03('0x16'));var logger=require(_0x6e03('0x17'))(_0x6e03('0x18'));var utils=require(_0x6e03('0x19'));var config=require(_0x6e03('0x1a'));var licenseUtil=require(_0x6e03('0x1b'));var db=require(_0x6e03('0x1c'))['db'];function respondWithStatusCode(_0x1f9100,_0x1793cf){_0x1793cf=_0x1793cf||0xcc;return function(_0x4ab3b2){if(_0x4ab3b2){return _0x1f9100[_0x6e03('0x1d')](_0x1793cf);}return _0x1f9100[_0x6e03('0x1e')](_0x1793cf)[_0x6e03('0x1f')]();};}function respondWithResult(_0x47ee42,_0x31661f){_0x31661f=_0x31661f||0xc8;return function(_0x1c3745){if(_0x1c3745){return _0x47ee42[_0x6e03('0x1e')](_0x31661f)[_0x6e03('0x20')](_0x1c3745);}};}function respondWithFilteredResult(_0x50d6ee,_0x5a85f5){return function(_0x89870a){if(_0x89870a){var _0x34ac50=typeof _0x5a85f5[_0x6e03('0x21')]===_0x6e03('0x22')&&typeof _0x5a85f5[_0x6e03('0x23')]===_0x6e03('0x22');var _0x1fd8d9=_0x89870a[_0x6e03('0x24')];var _0x2bb58e=_0x34ac50?0x0:_0x5a85f5[_0x6e03('0x21')];var _0x4ac0ef=_0x34ac50?_0x89870a['count']:_0x5a85f5[_0x6e03('0x21')]+_0x5a85f5[_0x6e03('0x23')];var _0x1bef83;if(_0x4ac0ef>=_0x1fd8d9){_0x4ac0ef=_0x1fd8d9;_0x1bef83=0xc8;}else{_0x1bef83=0xce;}_0x50d6ee[_0x6e03('0x1e')](_0x1bef83);return _0x50d6ee[_0x6e03('0x25')]('Content-Range',_0x2bb58e+'-'+_0x4ac0ef+'/'+_0x1fd8d9)[_0x6e03('0x20')](_0x89870a);}return null;};}function patchUpdates(_0x5d4a80){return function(_0x299c18){try{jsonpatch[_0x6e03('0x26')](_0x299c18,_0x5d4a80,!![]);}catch(_0x2e6ed1){return BPromise['reject'](_0x2e6ed1);}return _0x299c18[_0x6e03('0x27')]();};}function saveUpdates(_0x15232d,_0xfdb5ed){return function(_0xaa4ed){if(_0xaa4ed){return _0xaa4ed['update'](_0x15232d)[_0x6e03('0x28')](function(_0x5b2861){return _0x5b2861;});}return null;};}function removeEntity(_0x1197bb,_0x38138c){return function(_0x4ec0b2){if(_0x4ec0b2){return _0x4ec0b2[_0x6e03('0x29')]()[_0x6e03('0x28')](function(){_0x1197bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42332b,_0x2b36f0){return function(_0x443a7d){if(!_0x443a7d){_0x42332b[_0x6e03('0x1d')](0x194);}return _0x443a7d;};}function handleError(_0x2b9029,_0x26f278){_0x26f278=_0x26f278||0x1f4;return function(_0x4fc3ad){logger[_0x6e03('0x2a')](_0x4fc3ad[_0x6e03('0x2b')]);if(_0x4fc3ad[_0x6e03('0x2c')]){delete _0x4fc3ad['name'];}_0x2b9029[_0x6e03('0x1e')](_0x26f278)[_0x6e03('0x2d')](_0x4fc3ad);};}exports['index']=function(_0x5cae86,_0x199eee){var _0x15f89e={},_0x5abb01={},_0x112d26={'count':0x0,'rows':[]};var _0x5ec323=_[_0x6e03('0x2e')](db[_0x6e03('0x2f')][_0x6e03('0x30')],function(_0x4e0397){return{'name':_0x4e0397[_0x6e03('0x31')],'type':_0x4e0397[_0x6e03('0x32')]['key']};});_0x5abb01[_0x6e03('0x33')]=_[_0x6e03('0x2e')](_0x5ec323,_0x6e03('0x2c'));_0x5abb01['query']=_[_0x6e03('0x34')](_0x5cae86[_0x6e03('0x35')]);_0x5abb01[_0x6e03('0x36')]=_[_0x6e03('0x37')](_0x5abb01[_0x6e03('0x33')],_0x5abb01[_0x6e03('0x35')]);_0x15f89e['attributes']=_[_0x6e03('0x37')](_0x5abb01[_0x6e03('0x33')],qs[_0x6e03('0x38')](_0x5cae86[_0x6e03('0x35')][_0x6e03('0x38')]));_0x15f89e[_0x6e03('0x39')]=_0x15f89e[_0x6e03('0x39')][_0x6e03('0x3a')]?_0x15f89e['attributes']:_0x5abb01[_0x6e03('0x33')];if(!_0x5cae86[_0x6e03('0x35')]['hasOwnProperty'](_0x6e03('0x3b'))){_0x15f89e[_0x6e03('0x23')]=qs[_0x6e03('0x23')](_0x5cae86[_0x6e03('0x35')]['limit']);_0x15f89e[_0x6e03('0x21')]=qs[_0x6e03('0x21')](_0x5cae86[_0x6e03('0x35')]['offset']);}_0x15f89e['order']=qs[_0x6e03('0x3c')](_0x5cae86[_0x6e03('0x35')][_0x6e03('0x3c')]);_0x15f89e[_0x6e03('0x3d')]=qs[_0x6e03('0x36')](_[_0x6e03('0x3e')](_0x5cae86[_0x6e03('0x35')],_0x5abb01[_0x6e03('0x36')]),_0x5ec323);if(_0x5cae86[_0x6e03('0x35')][_0x6e03('0x3f')]){_0x15f89e['where']=_[_0x6e03('0x40')](_0x15f89e[_0x6e03('0x3d')],{'$or':_[_0x6e03('0x2e')](_0x5ec323,function(_0x201a2c){if(_0x201a2c['type']!==_0x6e03('0x41')){var _0x1dbada={};_0x1dbada[_0x201a2c[_0x6e03('0x2c')]]={'$like':'%'+_0x5cae86[_0x6e03('0x35')][_0x6e03('0x3f')]+'%'};return _0x1dbada;}})});}_0x15f89e=_[_0x6e03('0x40')]({},_0x15f89e,_0x5cae86[_0x6e03('0x42')]);var _0x1c2d94={'where':_0x15f89e[_0x6e03('0x3d')]};return db[_0x6e03('0x2f')][_0x6e03('0x24')](_0x1c2d94)[_0x6e03('0x28')](function(_0x2dfe34){_0x112d26[_0x6e03('0x24')]=_0x2dfe34;if(_0x5cae86[_0x6e03('0x35')][_0x6e03('0x43')]){_0x15f89e[_0x6e03('0x44')]=[{'all':!![]}];}return db[_0x6e03('0x2f')][_0x6e03('0x45')](_0x15f89e);})[_0x6e03('0x28')](function(_0x25ff91){_0x112d26[_0x6e03('0x46')]=_0x25ff91;return _0x112d26;})[_0x6e03('0x28')](respondWithFilteredResult(_0x199eee,_0x15f89e))['catch'](handleError(_0x199eee,null));};exports[_0x6e03('0x47')]=function(_0x2cd358,_0x1e221d){var _0x5ce028={'raw':!![],'where':{'id':_0x2cd358[_0x6e03('0x48')]['id']}},_0xe75978={};_0xe75978['model']=_['keys'](db[_0x6e03('0x2f')][_0x6e03('0x30')]);_0xe75978[_0x6e03('0x35')]=_[_0x6e03('0x34')](_0x2cd358[_0x6e03('0x35')]);_0xe75978[_0x6e03('0x36')]=_[_0x6e03('0x37')](_0xe75978[_0x6e03('0x33')],_0xe75978[_0x6e03('0x35')]);_0x5ce028[_0x6e03('0x39')]=_[_0x6e03('0x37')](_0xe75978[_0x6e03('0x33')],qs[_0x6e03('0x38')](_0x2cd358[_0x6e03('0x35')][_0x6e03('0x38')]));_0x5ce028[_0x6e03('0x39')]=_0x5ce028[_0x6e03('0x39')][_0x6e03('0x3a')]?_0x5ce028[_0x6e03('0x39')]:_0xe75978[_0x6e03('0x33')];if(_0x2cd358[_0x6e03('0x35')][_0x6e03('0x43')]){_0x5ce028['include']=[{'all':!![]}];}_0x5ce028=_[_0x6e03('0x40')]({},_0x5ce028,_0x2cd358[_0x6e03('0x42')]);return db[_0x6e03('0x2f')][_0x6e03('0x49')](_0x5ce028)[_0x6e03('0x28')](handleEntityNotFound(_0x1e221d,null))[_0x6e03('0x28')](respondWithResult(_0x1e221d,null))[_0x6e03('0x4a')](handleError(_0x1e221d,null));};exports[_0x6e03('0x4b')]=function(_0x58fea6,_0x2f141c){return db[_0x6e03('0x2f')][_0x6e03('0x4b')](_0x58fea6[_0x6e03('0x4c')],{})[_0x6e03('0x28')](respondWithResult(_0x2f141c,0xc9))['catch'](handleError(_0x2f141c,null));};exports[_0x6e03('0x4d')]=function(_0x4c9175,_0x7c43c3){if(_0x4c9175[_0x6e03('0x4c')]['id']){delete _0x4c9175[_0x6e03('0x4c')]['id'];}return db[_0x6e03('0x2f')][_0x6e03('0x49')]({'where':{'id':_0x4c9175[_0x6e03('0x48')]['id']}})[_0x6e03('0x28')](handleEntityNotFound(_0x7c43c3,null))[_0x6e03('0x28')](saveUpdates(_0x4c9175[_0x6e03('0x4c')],null))['then'](respondWithResult(_0x7c43c3,null))[_0x6e03('0x4a')](handleError(_0x7c43c3,null));};exports[_0x6e03('0x29')]=function(_0x272edd,_0x522279){return db[_0x6e03('0x2f')]['find']({'where':{'id':_0x272edd['params']['id']}})[_0x6e03('0x28')](handleEntityNotFound(_0x522279,null))[_0x6e03('0x28')](removeEntity(_0x522279,null))[_0x6e03('0x4a')](handleError(_0x522279,null));};
\ No newline at end of file
index 43347ad..3ec4459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8dd=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','request-promise','./analyticTreeReport.attributes','exports','define'];(function(_0x5d6fcb,_0x2602b7){var _0x24bca5=function(_0xb4121c){while(--_0xb4121c){_0x5d6fcb['push'](_0x5d6fcb['shift']());}};_0x24bca5(++_0x2602b7);}(_0xa8dd,0xe8));var _0xda8d=function(_0x351065,_0xe5cbac){_0x351065=_0x351065-0x0;var _0x148ad6=_0xa8dd[_0x351065];return _0x148ad6;};'use strict';var _=require(_0xda8d('0x0'));var util=require(_0xda8d('0x1'));var logger=require(_0xda8d('0x2'))(_0xda8d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xda8d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xda8d('0x5'));module[_0xda8d('0x6')]=function(_0x18ab55,_0x18124d){return _0x18ab55[_0xda8d('0x7')](_0xda8d('0x8'),attributes,{'tableName':_0xda8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a54=['analytics_report_trees','lodash','api','moment','request-promise','../../config/environment','exports','define','AnalyticTreeReport'];(function(_0x2a896d,_0x315aa2){var _0x48a4e7=function(_0x19cbfd){while(--_0x19cbfd){_0x2a896d['push'](_0x2a896d['shift']());}};_0x48a4e7(++_0x315aa2);}(_0x4a54,0x157));var _0x44a5=function(_0x103651,_0x41a72f){_0x103651=_0x103651-0x0;var _0x334e29=_0x4a54[_0x103651];return _0x334e29;};'use strict';var _=require(_0x44a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x44a5('0x1'));var moment=require(_0x44a5('0x2'));var BPromise=require('bluebird');var rp=require(_0x44a5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x44a5('0x4'));var attributes=require('./analyticTreeReport.attributes');module[_0x44a5('0x5')]=function(_0x179701,_0x4967f5){return _0x179701[_0x44a5('0x6')](_0x44a5('0x7'),attributes,{'tableName':_0x44a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0e98d6a..130cb84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x51db2a,_0x18cb76){var _0x46b29b=function(_0x28431c){while(--_0x28431c){_0x51db2a['push'](_0x51db2a['shift']());}};_0x46b29b(++_0x18cb76);}(_0x1261,0x144));var _0x1126=function(_0x4c67b8,_0x571e13){_0x4c67b8=_0x4c67b8-0x0;var _0xbc26e=_0x1261[_0x4c67b8];return _0xbc26e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x14799c,_0x4d33d6){var _0x2db1d4=function(_0x29a042){while(--_0x29a042){_0x14799c['push'](_0x14799c['shift']());}};_0x2db1d4(++_0x4d33d6);}(_0xdb28,0x106));var _0x8db2=function(_0x18037c,_0x1b5fd3){_0x18037c=_0x18037c-0x0;var _0xf28e2=_0xdb28[_0x18037c];return _0xf28e2;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index df3a88b..84e1a0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5023=['multer','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','update','destroy','exports'];(function(_0x4f12dd,_0x5de6e2){var _0x5ee479=function(_0xe1d9cb){while(--_0xe1d9cb){_0x4f12dd['push'](_0x4f12dd['shift']());}};_0x5ee479(++_0x5de6e2);}(_0x5023,0x1ce));var _0x3502=function(_0x33a89d,_0xed52ed){_0x33a89d=_0x33a89d-0x0;var _0x175025=_0x5023[_0x33a89d];return _0x175025;};'use strict';var multer=require(_0x3502('0x0'));var util=require(_0x3502('0x1'));var path=require(_0x3502('0x2'));var timeout=require(_0x3502('0x3'));var express=require(_0x3502('0x4'));var router=express[_0x3502('0x5')]();var fs_extra=require(_0x3502('0x6'));var auth=require(_0x3502('0x7'));var interaction=require(_0x3502('0x8'));var config=require(_0x3502('0x9'));var controller=require(_0x3502('0xa'));router[_0x3502('0xb')]('/',auth[_0x3502('0xc')](),controller[_0x3502('0xd')]);router[_0x3502('0xb')](_0x3502('0xe'),auth[_0x3502('0xc')](),controller[_0x3502('0xf')]);router[_0x3502('0x10')]('/',auth['isAuthenticated'](),controller[_0x3502('0x11')]);router[_0x3502('0x12')](_0x3502('0xe'),auth[_0x3502('0xc')](),controller[_0x3502('0x13')]);router['delete'](_0x3502('0xe'),auth[_0x3502('0xc')](),controller[_0x3502('0x14')]);module[_0x3502('0x15')]=router;
\ No newline at end of file
+var _0x65fc=['/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0xe1c257,_0x1be9d1){var _0x4b09d8=function(_0x126729){while(--_0x126729){_0xe1c257['push'](_0xe1c257['shift']());}};_0x4b09d8(++_0x1be9d1);}(_0x65fc,0x143));var _0xc65f=function(_0x4b02d0,_0x58eaf0){_0x4b02d0=_0x4b02d0-0x0;var _0x2e82d3=_0x65fc[_0x4b02d0];return _0x2e82d3;};'use strict';var multer=require(_0xc65f('0x0'));var util=require(_0xc65f('0x1'));var path=require(_0xc65f('0x2'));var timeout=require(_0xc65f('0x3'));var express=require('express');var router=express[_0xc65f('0x4')]();var fs_extra=require(_0xc65f('0x5'));var auth=require(_0xc65f('0x6'));var interaction=require(_0xc65f('0x7'));var config=require(_0xc65f('0x8'));var controller=require(_0xc65f('0x9'));router[_0xc65f('0xa')]('/',auth[_0xc65f('0xb')](),controller[_0xc65f('0xc')]);router[_0xc65f('0xa')]('/:id',auth[_0xc65f('0xb')](),controller[_0xc65f('0xd')]);router[_0xc65f('0xe')]('/',auth['isAuthenticated'](),controller[_0xc65f('0xf')]);router[_0xc65f('0x10')](_0xc65f('0x11'),auth[_0xc65f('0xb')](),controller['update']);router['delete']('/:id',auth[_0xc65f('0xb')](),controller[_0xc65f('0x12')]);module[_0xc65f('0x13')]=router;
\ No newline at end of file
index 6e63cac..92001ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0bb=['exports','STRING','sequelize'];(function(_0x506d92,_0x1e5205){var _0x42f58c=function(_0x1b22fb){while(--_0x1b22fb){_0x506d92['push'](_0x506d92['shift']());}};_0x42f58c(++_0x1e5205);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x58c6a9,_0x3a0caf){_0x58c6a9=_0x58c6a9-0x0;var _0x394f21=_0xd0bb[_0x58c6a9];return _0x394f21;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbd0b('0x2')]}};
\ No newline at end of file
+var _0xb38e=['exports','STRING','sequelize'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb38e,0xa7));var _0xeb38=function(_0x45d04a,_0x1074ac){_0x45d04a=_0x45d04a-0x0;var _0x8a5f85=_0xb38e[_0x45d04a];return _0x8a5f85;};'use strict';var Sequelize=require(_0xeb38('0x0'));module[_0xeb38('0x1')]={'name':{'type':Sequelize[_0xeb38('0x2')]},'basename':{'type':Sequelize[_0xeb38('0x2')]},'type':{'type':Sequelize[_0xeb38('0x2')]}};
\ No newline at end of file
index 33d4440..61b2157 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a51=['find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','type','mimetype','download','findOne','join','root','server/files/attachments/','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Attachment','includeAll','include','findAll','rows','catch','show','params','options'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x5a51,0x172));var _0x15a5=function(_0x2ad26d,_0x5644e7){_0x2ad26d=_0x2ad26d-0x0;var _0x1158c8=_0x5a51[_0x2ad26d];return _0x1158c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15a5('0x0'));var zipdir=require(_0x15a5('0x1'));var jsonpatch=require(_0x15a5('0x2'));var rp=require(_0x15a5('0x3'));var moment=require(_0x15a5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15a5('0x5'));var path=require('path');var sox=require(_0x15a5('0x6'));var csv=require(_0x15a5('0x7'));var ejs=require(_0x15a5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15a5('0x9'));var squel=require(_0x15a5('0xa'));var crypto=require('crypto');var jsforce=require(_0x15a5('0xb'));var deskjs=require(_0x15a5('0xc'));var toCsv=require(_0x15a5('0x7'));var querystring=require(_0x15a5('0xd'));var Papa=require(_0x15a5('0xe'));var Redis=require(_0x15a5('0xf'));var authService=require(_0x15a5('0x10'));var qs=require(_0x15a5('0x11'));var as=require(_0x15a5('0x12'));var hardwareService=require(_0x15a5('0x13'));var logger=require(_0x15a5('0x14'))(_0x15a5('0x15'));var utils=require(_0x15a5('0x16'));var config=require(_0x15a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x15a5('0x18'))['db'];function respondWithStatusCode(_0x17d212,_0x1abfb7){_0x1abfb7=_0x1abfb7||0xcc;return function(_0x1545d3){if(_0x1545d3){return _0x17d212['sendStatus'](_0x1abfb7);}return _0x17d212[_0x15a5('0x19')](_0x1abfb7)[_0x15a5('0x1a')]();};}function respondWithResult(_0x4c8e13,_0x2ca061){_0x2ca061=_0x2ca061||0xc8;return function(_0x2e70f4){if(_0x2e70f4){return _0x4c8e13[_0x15a5('0x19')](_0x2ca061)[_0x15a5('0x1b')](_0x2e70f4);}};}function respondWithFilteredResult(_0x1b27ce,_0x14f600){return function(_0x5a1706){if(_0x5a1706){var _0x41eb60=typeof _0x14f600[_0x15a5('0x1c')]===_0x15a5('0x1d')&&typeof _0x14f600['limit']===_0x15a5('0x1d');var _0x1b1fd0=_0x5a1706[_0x15a5('0x1e')];var _0x4acdeb=_0x41eb60?0x0:_0x14f600['offset'];var _0x599360=_0x41eb60?_0x5a1706[_0x15a5('0x1e')]:_0x14f600[_0x15a5('0x1c')]+_0x14f600[_0x15a5('0x1f')];var _0x4290b8;if(_0x599360>=_0x1b1fd0){_0x599360=_0x1b1fd0;_0x4290b8=0xc8;}else{_0x4290b8=0xce;}_0x1b27ce[_0x15a5('0x19')](_0x4290b8);return _0x1b27ce['set'](_0x15a5('0x20'),_0x4acdeb+'-'+_0x599360+'/'+_0x1b1fd0)['json'](_0x5a1706);}return null;};}function patchUpdates(_0x43964f){return function(_0x11f0ea){try{jsonpatch['apply'](_0x11f0ea,_0x43964f,!![]);}catch(_0x3eb135){return BPromise[_0x15a5('0x21')](_0x3eb135);}return _0x11f0ea['save']();};}function saveUpdates(_0x31194e,_0x1725d9){return function(_0x29995c){if(_0x29995c){return _0x29995c[_0x15a5('0x22')](_0x31194e)[_0x15a5('0x23')](function(_0x43a883){return _0x43a883;});}return null;};}function removeEntity(_0x36fdba,_0x10b496){return function(_0x2f7e40){if(_0x2f7e40){return _0x2f7e40[_0x15a5('0x24')]()[_0x15a5('0x23')](function(){_0x36fdba['status'](0xcc)[_0x15a5('0x1a')]();});}};}function handleEntityNotFound(_0x5ea2bb,_0x241e4c){return function(_0x4065f2){if(!_0x4065f2){_0x5ea2bb[_0x15a5('0x25')](0x194);}return _0x4065f2;};}function handleError(_0x2b26f3,_0x156043){_0x156043=_0x156043||0x1f4;return function(_0x3ba1ad){logger[_0x15a5('0x26')](_0x3ba1ad[_0x15a5('0x27')]);if(_0x3ba1ad['name']){delete _0x3ba1ad[_0x15a5('0x28')];}_0x2b26f3['status'](_0x156043)['send'](_0x3ba1ad);};}exports[_0x15a5('0x29')]=function(_0x4c8a2d,_0x43f1b3){var _0x587e01={},_0x2c6bff={},_0x5e8c49={'count':0x0,'rows':[]};var _0x436aec=_[_0x15a5('0x2a')](db['Attachment'][_0x15a5('0x2b')],function(_0x44f935){return{'name':_0x44f935['fieldName'],'type':_0x44f935['type']['key']};});_0x2c6bff[_0x15a5('0x2c')]=_[_0x15a5('0x2a')](_0x436aec,_0x15a5('0x28'));_0x2c6bff[_0x15a5('0x2d')]=_[_0x15a5('0x2e')](_0x4c8a2d[_0x15a5('0x2d')]);_0x2c6bff[_0x15a5('0x2f')]=_[_0x15a5('0x30')](_0x2c6bff[_0x15a5('0x2c')],_0x2c6bff[_0x15a5('0x2d')]);_0x587e01[_0x15a5('0x31')]=_[_0x15a5('0x30')](_0x2c6bff[_0x15a5('0x2c')],qs[_0x15a5('0x32')](_0x4c8a2d['query'][_0x15a5('0x32')]));_0x587e01[_0x15a5('0x31')]=_0x587e01[_0x15a5('0x31')][_0x15a5('0x33')]?_0x587e01[_0x15a5('0x31')]:_0x2c6bff[_0x15a5('0x2c')];if(!_0x4c8a2d[_0x15a5('0x2d')][_0x15a5('0x34')](_0x15a5('0x35'))){_0x587e01[_0x15a5('0x1f')]=qs[_0x15a5('0x1f')](_0x4c8a2d['query'][_0x15a5('0x1f')]);_0x587e01[_0x15a5('0x1c')]=qs[_0x15a5('0x1c')](_0x4c8a2d[_0x15a5('0x2d')][_0x15a5('0x1c')]);}_0x587e01[_0x15a5('0x36')]=qs[_0x15a5('0x37')](_0x4c8a2d[_0x15a5('0x2d')][_0x15a5('0x37')]);_0x587e01[_0x15a5('0x38')]=qs[_0x15a5('0x2f')](_[_0x15a5('0x39')](_0x4c8a2d[_0x15a5('0x2d')],_0x2c6bff[_0x15a5('0x2f')]),_0x436aec);if(_0x4c8a2d[_0x15a5('0x2d')][_0x15a5('0x3a')]){_0x587e01[_0x15a5('0x38')]=_[_0x15a5('0x3b')](_0x587e01[_0x15a5('0x38')],{'$or':_['map'](_0x436aec,function(_0x51bc4c){if(_0x51bc4c['type']!==_0x15a5('0x3c')){var _0x438415={};_0x438415[_0x51bc4c['name']]={'$like':'%'+_0x4c8a2d[_0x15a5('0x2d')][_0x15a5('0x3a')]+'%'};return _0x438415;}})});}_0x587e01=_[_0x15a5('0x3b')]({},_0x587e01,_0x4c8a2d['options']);var _0x5531f3={'where':_0x587e01['where']};return db[_0x15a5('0x3d')]['count'](_0x5531f3)[_0x15a5('0x23')](function(_0x52b4b7){_0x5e8c49[_0x15a5('0x1e')]=_0x52b4b7;if(_0x4c8a2d[_0x15a5('0x2d')][_0x15a5('0x3e')]){_0x587e01[_0x15a5('0x3f')]=[{'all':!![]}];}return db[_0x15a5('0x3d')][_0x15a5('0x40')](_0x587e01);})[_0x15a5('0x23')](function(_0x3992c2){_0x5e8c49[_0x15a5('0x41')]=_0x3992c2;return _0x5e8c49;})[_0x15a5('0x23')](respondWithFilteredResult(_0x43f1b3,_0x587e01))[_0x15a5('0x42')](handleError(_0x43f1b3,null));};exports[_0x15a5('0x43')]=function(_0x153f51,_0x637ba7){var _0x2e28f6={'raw':!![],'where':{'id':_0x153f51[_0x15a5('0x44')]['id']}},_0x4c08f8={};_0x4c08f8[_0x15a5('0x2c')]=_[_0x15a5('0x2e')](db[_0x15a5('0x3d')][_0x15a5('0x2b')]);_0x4c08f8[_0x15a5('0x2d')]=_['keys'](_0x153f51[_0x15a5('0x2d')]);_0x4c08f8[_0x15a5('0x2f')]=_[_0x15a5('0x30')](_0x4c08f8['model'],_0x4c08f8['query']);_0x2e28f6['attributes']=_[_0x15a5('0x30')](_0x4c08f8[_0x15a5('0x2c')],qs[_0x15a5('0x32')](_0x153f51[_0x15a5('0x2d')][_0x15a5('0x32')]));_0x2e28f6[_0x15a5('0x31')]=_0x2e28f6['attributes']['length']?_0x2e28f6[_0x15a5('0x31')]:_0x4c08f8[_0x15a5('0x2c')];if(_0x153f51[_0x15a5('0x2d')][_0x15a5('0x3e')]){_0x2e28f6['include']=[{'all':!![]}];}_0x2e28f6=_[_0x15a5('0x3b')]({},_0x2e28f6,_0x153f51[_0x15a5('0x45')]);return db[_0x15a5('0x3d')][_0x15a5('0x46')](_0x2e28f6)[_0x15a5('0x23')](handleEntityNotFound(_0x637ba7,null))['then'](respondWithResult(_0x637ba7,null))[_0x15a5('0x42')](handleError(_0x637ba7,null));};exports['clone']=function(_0x225926,_0x50d821){var _0x2b58c3={'where':{'id':_0x225926[_0x15a5('0x44')]['id']}},_0x11a3d1={};_0x11a3d1[_0x15a5('0x2c')]=_['keys'](db[_0x15a5('0x3d')][_0x15a5('0x2b')]);_0x2b58c3[_0x15a5('0x31')]=_[_0x15a5('0x30')](_0x11a3d1[_0x15a5('0x2c')],qs[_0x15a5('0x32')](_0x225926[_0x15a5('0x2d')][_0x15a5('0x32')]));_0x2b58c3[_0x15a5('0x31')]=_0x2b58c3['attributes']['length']?_0x2b58c3['attributes']:_0x11a3d1['model'];if(_0x225926[_0x15a5('0x2d')][_0x15a5('0x3e')]){_0x2b58c3[_0x15a5('0x3f')]=[{'all':!![]}];}_0x2b58c3=_[_0x15a5('0x3b')]({},_0x2b58c3,_0x225926[_0x15a5('0x45')]);return db[_0x15a5('0x3d')][_0x15a5('0x46')](_0x2b58c3)[_0x15a5('0x23')](handleEntityNotFound(_0x50d821,null))[_0x15a5('0x23')](function(_0x56a156){if(_0x56a156){var _0x2cad59=_0x56a156[_0x15a5('0x47')]({'plain':!![]});_0x2cad59=qs[_0x15a5('0x48')](_0x2cad59,['id',_0x15a5('0x49'),_0x15a5('0x4a')]);_0x225926[_0x15a5('0x4b')]=_[_0x15a5('0x48')](_0x225926[_0x15a5('0x4b')],['id',_0x15a5('0x49'),'updatedAt']);return db[_0x15a5('0x3d')][_0x15a5('0x4c')](_[_0x15a5('0x3b')](_0x2cad59,_0x225926[_0x15a5('0x4b')]),{'include':_0x225926['query'][_0x15a5('0x3e')]?[{'all':!![]}]:undefined});}})[_0x15a5('0x23')](respondWithResult(_0x50d821,0xc9))[_0x15a5('0x42')](handleError(_0x50d821,null));};exports[_0x15a5('0x22')]=function(_0x44813c,_0x10ae51){if(_0x44813c[_0x15a5('0x4b')]['id']){delete _0x44813c['body']['id'];}return db[_0x15a5('0x3d')][_0x15a5('0x46')]({'where':{'id':_0x44813c[_0x15a5('0x44')]['id']}})['then'](handleEntityNotFound(_0x10ae51,null))[_0x15a5('0x23')](saveUpdates(_0x44813c[_0x15a5('0x4b')],null))[_0x15a5('0x23')](respondWithResult(_0x10ae51,null))[_0x15a5('0x42')](handleError(_0x10ae51,null));};exports[_0x15a5('0x24')]=function(_0x469c3e,_0x566e94){return db['Attachment']['find']({'where':{'id':_0x469c3e[_0x15a5('0x44')]['id']}})[_0x15a5('0x23')](handleEntityNotFound(_0x566e94,null))[_0x15a5('0x23')](removeEntity(_0x566e94,null))[_0x15a5('0x42')](handleError(_0x566e94,null));};exports[_0x15a5('0x4c')]=function(_0xb53c01,_0x258056,_0x319268){_0xb53c01[_0x15a5('0x4b')][_0x15a5('0x28')]=_0xb53c01[_0x15a5('0x4d')][_0x15a5('0x4e')];_0xb53c01[_0x15a5('0x4b')][_0x15a5('0x4f')]=_0xb53c01[_0x15a5('0x4d')][_0x15a5('0x50')];_0xb53c01[_0x15a5('0x4b')][_0x15a5('0x51')]=_0xb53c01[_0x15a5('0x4d')][_0x15a5('0x52')];return db[_0x15a5('0x3d')]['create'](_0xb53c01[_0x15a5('0x4b')])[_0x15a5('0x23')](respondWithResult(_0x258056,0xc9))['catch'](handleError(_0x258056,null));};exports[_0x15a5('0x53')]=function(_0x2a21b3,_0x3ec353,_0x188354){return db['Attachment'][_0x15a5('0x54')]({'where':{'id':_0x2a21b3[_0x15a5('0x44')]['id']},'raw':!![]})[_0x15a5('0x23')](handleEntityNotFound(_0x3ec353,null))[_0x15a5('0x23')](function(_0x52246c){if(_0x52246c){var _0x132a81=_0x52246c['ChatOfflineMessageId']!==null;var _0xbb4766=path[_0x15a5('0x55')](config[_0x15a5('0x56')],_0x15a5('0x57'));if(_0x132a81){_0xbb4766=path[_0x15a5('0x55')](_0xbb4766,'offline-chat/');}var _0x40e5f0=path['join'](_0xbb4766,_0x52246c[_0x15a5('0x4f')]);return _0x3ec353[_0x15a5('0x53')](_0x40e5f0);}})[_0x15a5('0x42')](handleError(_0x3ec353,null));};
\ No newline at end of file
+var _0x450f=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','send','Attachment','rawAttributes','fieldName','type','key','map','name','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','join','offline-chat/','download','eml-format','zip-dir','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x17479d,_0x593129){var _0x2d461c=function(_0x347164){while(--_0x347164){_0x17479d['push'](_0x17479d['shift']());}};_0x2d461c(++_0x593129);}(_0x450f,0xf1));var _0xf450=function(_0x2bb0ff,_0x22c9e2){_0x2bb0ff=_0x2bb0ff-0x0;var _0x497825=_0x450f[_0x2bb0ff];return _0x497825;};'use strict';var emlformat=require(_0xf450('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf450('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf450('0x2'));var path=require(_0xf450('0x3'));var sox=require(_0xf450('0x4'));var csv=require(_0xf450('0x5'));var ejs=require(_0xf450('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf450('0x7'));var squel=require(_0xf450('0x8'));var crypto=require(_0xf450('0x9'));var jsforce=require(_0xf450('0xa'));var deskjs=require(_0xf450('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf450('0xc'));var Papa=require(_0xf450('0xd'));var Redis=require(_0xf450('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf450('0xf'));var as=require(_0xf450('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf450('0x11'))(_0xf450('0x12'));var utils=require(_0xf450('0x13'));var config=require(_0xf450('0x14'));var licenseUtil=require(_0xf450('0x15'));var db=require(_0xf450('0x16'))['db'];function respondWithStatusCode(_0x400f88,_0x37d54d){_0x37d54d=_0x37d54d||0xcc;return function(_0x29d500){if(_0x29d500){return _0x400f88[_0xf450('0x17')](_0x37d54d);}return _0x400f88[_0xf450('0x18')](_0x37d54d)[_0xf450('0x19')]();};}function respondWithResult(_0x4674e5,_0x55a3d3){_0x55a3d3=_0x55a3d3||0xc8;return function(_0x1a58c2){if(_0x1a58c2){return _0x4674e5[_0xf450('0x18')](_0x55a3d3)[_0xf450('0x1a')](_0x1a58c2);}};}function respondWithFilteredResult(_0x58b11f,_0xc61782){return function(_0x168ec6){if(_0x168ec6){var _0x3cdd7d=typeof _0xc61782[_0xf450('0x1b')]===_0xf450('0x1c')&&typeof _0xc61782[_0xf450('0x1d')]===_0xf450('0x1c');var _0x547c7d=_0x168ec6[_0xf450('0x1e')];var _0x585760=_0x3cdd7d?0x0:_0xc61782[_0xf450('0x1b')];var _0xc7ce8c=_0x3cdd7d?_0x168ec6[_0xf450('0x1e')]:_0xc61782[_0xf450('0x1b')]+_0xc61782[_0xf450('0x1d')];var _0x512318;if(_0xc7ce8c>=_0x547c7d){_0xc7ce8c=_0x547c7d;_0x512318=0xc8;}else{_0x512318=0xce;}_0x58b11f[_0xf450('0x18')](_0x512318);return _0x58b11f[_0xf450('0x1f')](_0xf450('0x20'),_0x585760+'-'+_0xc7ce8c+'/'+_0x547c7d)['json'](_0x168ec6);}return null;};}function patchUpdates(_0x3c0668){return function(_0x43ec47){try{jsonpatch[_0xf450('0x21')](_0x43ec47,_0x3c0668,!![]);}catch(_0x454e90){return BPromise['reject'](_0x454e90);}return _0x43ec47[_0xf450('0x22')]();};}function saveUpdates(_0x42adcf,_0x36f742){return function(_0xd3460c){if(_0xd3460c){return _0xd3460c[_0xf450('0x23')](_0x42adcf)[_0xf450('0x24')](function(_0x36a099){return _0x36a099;});}return null;};}function removeEntity(_0x3d03f3,_0x5c475b){return function(_0x239c9d){if(_0x239c9d){return _0x239c9d[_0xf450('0x25')]()[_0xf450('0x24')](function(){_0x3d03f3[_0xf450('0x18')](0xcc)[_0xf450('0x19')]();});}};}function handleEntityNotFound(_0x5e143a,_0x41a7d7){return function(_0x23d62a){if(!_0x23d62a){_0x5e143a[_0xf450('0x17')](0x194);}return _0x23d62a;};}function handleError(_0x2d58fa,_0x5bc7a7){_0x5bc7a7=_0x5bc7a7||0x1f4;return function(_0x3f73f){logger['error'](_0x3f73f[_0xf450('0x26')]);if(_0x3f73f['name']){delete _0x3f73f['name'];}_0x2d58fa[_0xf450('0x18')](_0x5bc7a7)[_0xf450('0x27')](_0x3f73f);};}exports['index']=function(_0x4d9ce4,_0x30805a){var _0x45290a={},_0x5b2442={},_0x59799d={'count':0x0,'rows':[]};var _0x1719b4=_['map'](db[_0xf450('0x28')][_0xf450('0x29')],function(_0x4e2d84){return{'name':_0x4e2d84[_0xf450('0x2a')],'type':_0x4e2d84[_0xf450('0x2b')][_0xf450('0x2c')]};});_0x5b2442['model']=_[_0xf450('0x2d')](_0x1719b4,_0xf450('0x2e'));_0x5b2442['query']=_['keys'](_0x4d9ce4[_0xf450('0x2f')]);_0x5b2442['filters']=_['intersection'](_0x5b2442[_0xf450('0x30')],_0x5b2442[_0xf450('0x2f')]);_0x45290a[_0xf450('0x31')]=_[_0xf450('0x32')](_0x5b2442['model'],qs[_0xf450('0x33')](_0x4d9ce4[_0xf450('0x2f')][_0xf450('0x33')]));_0x45290a['attributes']=_0x45290a['attributes'][_0xf450('0x34')]?_0x45290a['attributes']:_0x5b2442[_0xf450('0x30')];if(!_0x4d9ce4[_0xf450('0x2f')][_0xf450('0x35')]('nolimit')){_0x45290a[_0xf450('0x1d')]=qs[_0xf450('0x1d')](_0x4d9ce4[_0xf450('0x2f')]['limit']);_0x45290a[_0xf450('0x1b')]=qs[_0xf450('0x1b')](_0x4d9ce4['query'][_0xf450('0x1b')]);}_0x45290a[_0xf450('0x36')]=qs['sort'](_0x4d9ce4['query'][_0xf450('0x37')]);_0x45290a[_0xf450('0x38')]=qs[_0xf450('0x39')](_[_0xf450('0x3a')](_0x4d9ce4[_0xf450('0x2f')],_0x5b2442['filters']),_0x1719b4);if(_0x4d9ce4['query'][_0xf450('0x3b')]){_0x45290a['where']=_[_0xf450('0x3c')](_0x45290a[_0xf450('0x38')],{'$or':_['map'](_0x1719b4,function(_0x4b47a4){if(_0x4b47a4['type']!==_0xf450('0x3d')){var _0x5c812e={};_0x5c812e[_0x4b47a4[_0xf450('0x2e')]]={'$like':'%'+_0x4d9ce4[_0xf450('0x2f')]['filter']+'%'};return _0x5c812e;}})});}_0x45290a=_[_0xf450('0x3c')]({},_0x45290a,_0x4d9ce4[_0xf450('0x3e')]);var _0x355b0e={'where':_0x45290a['where']};return db['Attachment']['count'](_0x355b0e)[_0xf450('0x24')](function(_0x7848ee){_0x59799d[_0xf450('0x1e')]=_0x7848ee;if(_0x4d9ce4[_0xf450('0x2f')][_0xf450('0x3f')]){_0x45290a['include']=[{'all':!![]}];}return db[_0xf450('0x28')][_0xf450('0x40')](_0x45290a);})[_0xf450('0x24')](function(_0x42e222){_0x59799d[_0xf450('0x41')]=_0x42e222;return _0x59799d;})[_0xf450('0x24')](respondWithFilteredResult(_0x30805a,_0x45290a))['catch'](handleError(_0x30805a,null));};exports[_0xf450('0x42')]=function(_0x5af523,_0x3f69c6){var _0x5648bb={'raw':!![],'where':{'id':_0x5af523[_0xf450('0x43')]['id']}},_0x81ca94={};_0x81ca94[_0xf450('0x30')]=_[_0xf450('0x44')](db[_0xf450('0x28')][_0xf450('0x29')]);_0x81ca94[_0xf450('0x2f')]=_[_0xf450('0x44')](_0x5af523['query']);_0x81ca94[_0xf450('0x39')]=_[_0xf450('0x32')](_0x81ca94['model'],_0x81ca94[_0xf450('0x2f')]);_0x5648bb[_0xf450('0x31')]=_[_0xf450('0x32')](_0x81ca94[_0xf450('0x30')],qs['fields'](_0x5af523[_0xf450('0x2f')][_0xf450('0x33')]));_0x5648bb['attributes']=_0x5648bb[_0xf450('0x31')][_0xf450('0x34')]?_0x5648bb['attributes']:_0x81ca94[_0xf450('0x30')];if(_0x5af523[_0xf450('0x2f')][_0xf450('0x3f')]){_0x5648bb[_0xf450('0x45')]=[{'all':!![]}];}_0x5648bb=_['merge']({},_0x5648bb,_0x5af523[_0xf450('0x3e')]);return db[_0xf450('0x28')][_0xf450('0x46')](_0x5648bb)[_0xf450('0x24')](handleEntityNotFound(_0x3f69c6,null))[_0xf450('0x24')](respondWithResult(_0x3f69c6,null))[_0xf450('0x47')](handleError(_0x3f69c6,null));};exports['clone']=function(_0x12d1bc,_0x26f2e6){var _0x4a7cc6={'where':{'id':_0x12d1bc[_0xf450('0x43')]['id']}},_0x5df7c6={};_0x5df7c6[_0xf450('0x30')]=_[_0xf450('0x44')](db[_0xf450('0x28')]['rawAttributes']);_0x4a7cc6[_0xf450('0x31')]=_[_0xf450('0x32')](_0x5df7c6['model'],qs[_0xf450('0x33')](_0x12d1bc['query']['fields']));_0x4a7cc6['attributes']=_0x4a7cc6[_0xf450('0x31')][_0xf450('0x34')]?_0x4a7cc6['attributes']:_0x5df7c6[_0xf450('0x30')];if(_0x12d1bc['query'][_0xf450('0x3f')]){_0x4a7cc6[_0xf450('0x45')]=[{'all':!![]}];}_0x4a7cc6=_[_0xf450('0x3c')]({},_0x4a7cc6,_0x12d1bc[_0xf450('0x3e')]);return db[_0xf450('0x28')][_0xf450('0x46')](_0x4a7cc6)[_0xf450('0x24')](handleEntityNotFound(_0x26f2e6,null))[_0xf450('0x24')](function(_0x1505e5){if(_0x1505e5){var _0x74f690=_0x1505e5[_0xf450('0x48')]({'plain':!![]});_0x74f690=qs['omit'](_0x74f690,['id',_0xf450('0x49'),_0xf450('0x4a')]);_0x12d1bc[_0xf450('0x4b')]=_[_0xf450('0x4c')](_0x12d1bc['body'],['id','createdAt',_0xf450('0x4a')]);return db['Attachment'][_0xf450('0x4d')](_[_0xf450('0x3c')](_0x74f690,_0x12d1bc[_0xf450('0x4b')]),{'include':_0x12d1bc[_0xf450('0x2f')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xf450('0x24')](respondWithResult(_0x26f2e6,0xc9))[_0xf450('0x47')](handleError(_0x26f2e6,null));};exports[_0xf450('0x23')]=function(_0x3f5900,_0x52d063){if(_0x3f5900[_0xf450('0x4b')]['id']){delete _0x3f5900[_0xf450('0x4b')]['id'];}return db['Attachment'][_0xf450('0x46')]({'where':{'id':_0x3f5900[_0xf450('0x43')]['id']}})[_0xf450('0x24')](handleEntityNotFound(_0x52d063,null))['then'](saveUpdates(_0x3f5900[_0xf450('0x4b')],null))['then'](respondWithResult(_0x52d063,null))[_0xf450('0x47')](handleError(_0x52d063,null));};exports['destroy']=function(_0x438ec8,_0x4381b8){return db[_0xf450('0x28')][_0xf450('0x46')]({'where':{'id':_0x438ec8[_0xf450('0x43')]['id']}})['then'](handleEntityNotFound(_0x4381b8,null))[_0xf450('0x24')](removeEntity(_0x4381b8,null))[_0xf450('0x47')](handleError(_0x4381b8,null));};exports['create']=function(_0x5d611c,_0x59868b,_0xb268f4){_0x5d611c['body'][_0xf450('0x2e')]=_0x5d611c[_0xf450('0x4e')][_0xf450('0x4f')];_0x5d611c['body'][_0xf450('0x50')]=_0x5d611c[_0xf450('0x4e')][_0xf450('0x51')];_0x5d611c[_0xf450('0x4b')][_0xf450('0x2b')]=_0x5d611c['file'][_0xf450('0x52')];return db['Attachment'][_0xf450('0x4d')](_0x5d611c[_0xf450('0x4b')])[_0xf450('0x24')](respondWithResult(_0x59868b,0xc9))['catch'](handleError(_0x59868b,null));};exports['download']=function(_0x584f04,_0x208b9a,_0x194fc5){return db[_0xf450('0x28')][_0xf450('0x53')]({'where':{'id':_0x584f04[_0xf450('0x43')]['id']},'raw':!![]})[_0xf450('0x24')](handleEntityNotFound(_0x208b9a,null))['then'](function(_0x52e44e){if(_0x52e44e){var _0x427b3b=_0x52e44e[_0xf450('0x54')]!==null;var _0x2f1fde=path['join'](config[_0xf450('0x55')],'server/files/attachments/');if(_0x427b3b){_0x2f1fde=path[_0xf450('0x56')](_0x2f1fde,_0xf450('0x57'));}var _0x44b551=path[_0xf450('0x56')](_0x2f1fde,_0x52e44e[_0xf450('0x50')]);return _0x208b9a[_0xf450('0x58')](_0x44b551);}})[_0xf450('0x47')](handleError(_0x208b9a,null));};
\ No newline at end of file
index b7c604d..1b4eb10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6591=['lodash','bluebird','request-promise','path','rimraf','./attachment.attributes','define','Attachment','attachments'];(function(_0x484b9b,_0x361e6a){var _0x12ea0=function(_0x172f3d){while(--_0x172f3d){_0x484b9b['push'](_0x484b9b['shift']());}};_0x12ea0(++_0x361e6a);}(_0x6591,0x17a));var _0x1659=function(_0x31d866,_0x1e1e3b){_0x31d866=_0x31d866-0x0;var _0x399948=_0x6591[_0x31d866];return _0x399948;};'use strict';var _=require(_0x1659('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1659('0x1'));var rp=require(_0x1659('0x2'));var fs=require('fs');var path=require(_0x1659('0x3'));var rimraf=require(_0x1659('0x4'));var config=require('../../config/environment');var attributes=require(_0x1659('0x5'));module['exports']=function(_0x56c7ad,_0x59e68f){return _0x56c7ad[_0x1659('0x6')](_0x1659('0x7'),attributes,{'tableName':_0x1659('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1daf=['moment','bluebird','request-promise','path','./attachment.attributes','define','attachments','lodash','util','../../config/logger','api'];(function(_0x36b261,_0x504c02){var _0x2cf069=function(_0x2d61cc){while(--_0x2d61cc){_0x36b261['push'](_0x36b261['shift']());}};_0x2cf069(++_0x504c02);}(_0x1daf,0x172));var _0xf1da=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1daf[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf1da('0x0'));var util=require(_0xf1da('0x1'));var logger=require(_0xf1da('0x2'))(_0xf1da('0x3'));var moment=require(_0xf1da('0x4'));var BPromise=require(_0xf1da('0x5'));var rp=require(_0xf1da('0x6'));var fs=require('fs');var path=require(_0xf1da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf1da('0x8'));module['exports']=function(_0x190784,_0x3d541f){return _0x190784[_0xf1da('0x9')]('Attachment',attributes,{'tableName':_0xf1da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 31e02b5..dc26e3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7794=['http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x5ca142,_0x35467e){var _0x3c7da9=function(_0x4f34d6){while(--_0x4f34d6){_0x5ca142['push'](_0x5ca142['shift']());}};_0x3c7da9(++_0x35467e);}(_0x7794,0x7b));var _0x4779=function(_0x3030d6,_0x360386){_0x3030d6=_0x3030d6-0x0;var _0x38831d=_0x7794[_0x3030d6];return _0x38831d;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require(_0x4779('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4779('0x4'))['db'];var utils=require(_0x4779('0x5'));var logger=require('../../config/logger')(_0x4779('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4779('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x339512,_0x523c93,_0xb3fe18){return new BPromise(function(_0x13bb66,_0x270a5f){return client[_0x4779('0x8')](_0x339512,_0xb3fe18)[_0x4779('0x9')](function(_0x7179e1){logger[_0x4779('0xa')]('Attachment,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));logger[_0x4779('0xc')](_0x4779('0xd'),_0x523c93,_0x4779('0xb'),JSON[_0x4779('0xe')](_0x7179e1));if(_0x7179e1[_0x4779('0xf')]){if(_0x7179e1[_0x4779('0xf')][_0x4779('0x10')]===0x1f4){logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1['error']['message']);return _0x270a5f(_0x7179e1['error'][_0x4779('0x12')]);}logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1[_0x4779('0xf')]['message']);return _0x13bb66(_0x7179e1[_0x4779('0xf')][_0x4779('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));_0x13bb66(_0x7179e1[_0x4779('0x13')][_0x4779('0x12')]);}})[_0x4779('0x14')](function(_0x56ec51){logger['error'](_0x4779('0x11'),_0x523c93,_0x56ec51);_0x270a5f(_0x56ec51);});});}exports[_0x4779('0x15')]=function(_0x19fbb6){var _0x582e89=this;return new Promise(function(_0x3dbe70,_0x5d9a58){return db[_0x4779('0x16')][_0x4779('0x17')](_0x19fbb6['body'],{'raw':_0x19fbb6[_0x4779('0x18')]?_0x19fbb6['options'][_0x4779('0x19')]===undefined?!![]:![]:!![]})[_0x4779('0x9')](function(_0x143ef6){logger[_0x4779('0xa')](_0x4779('0x15'),_0x19fbb6);logger[_0x4779('0xc')]('CreateAttachment',_0x19fbb6,JSON[_0x4779('0xe')](_0x143ef6));_0x3dbe70(_0x143ef6);})['catch'](function(_0x4ad246){logger[_0x4779('0xf')](_0x4779('0x15'),_0x4ad246[_0x4779('0x12')],_0x19fbb6);_0x5d9a58(_0x582e89[_0x4779('0xf')](0x1f4,_0x4ad246['message']));});});};
\ No newline at end of file
+var _0xc3fe=['options','raw','CreateAttachment','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','Attachment','body'];(function(_0x141749,_0x477b04){var _0x3e6932=function(_0x47b3f2){while(--_0x47b3f2){_0x141749['push'](_0x141749['shift']());}};_0x3e6932(++_0x477b04);}(_0xc3fe,0xff));var _0xec3f=function(_0xc1faf9,_0x5e0083){_0xc1faf9=_0xc1faf9-0x0;var _0x1223f5=_0xc3fe[_0xc1faf9];return _0x1223f5;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var moment=require(_0xec3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec3f('0x3'));var fs=require('fs');var Redis=require(_0xec3f('0x4'));var db=require(_0xec3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var config=require(_0xec3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b0b84,_0x526183,_0x503775){return new BPromise(function(_0xcb8557,_0x5df7fc){return client[_0xec3f('0xa')](_0x3b0b84,_0x503775)[_0xec3f('0xb')](function(_0x12a7c5){logger[_0xec3f('0xc')]('Attachment,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));logger[_0xec3f('0xe')](_0xec3f('0xf'),_0x526183,_0xec3f('0xd'),JSON[_0xec3f('0x10')](_0x12a7c5));if(_0x12a7c5[_0xec3f('0x11')]){if(_0x12a7c5['error'][_0xec3f('0x12')]===0x1f4){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0x12a7c5['error']['message']);return _0x5df7fc(_0x12a7c5[_0xec3f('0x11')]['message']);}logger['error'](_0xec3f('0x13'),_0x526183,_0x12a7c5[_0xec3f('0x11')][_0xec3f('0x14')]);return _0xcb8557(_0x12a7c5['error']['message']);}else{logger[_0xec3f('0xc')]('Attachment,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));_0xcb8557(_0x12a7c5[_0xec3f('0x15')]['message']);}})[_0xec3f('0x16')](function(_0xb8ee6f){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0xb8ee6f);_0x5df7fc(_0xb8ee6f);});});}exports['CreateAttachment']=function(_0x7805c){var _0xc04d54=this;return new Promise(function(_0x2d338,_0xbd6461){return db[_0xec3f('0x17')]['create'](_0x7805c[_0xec3f('0x18')],{'raw':_0x7805c['options']?_0x7805c[_0xec3f('0x19')][_0xec3f('0x1a')]===undefined?!![]:![]:!![]})[_0xec3f('0xb')](function(_0x47b6f9){logger[_0xec3f('0xc')](_0xec3f('0x1b'),_0x7805c);logger['debug'](_0xec3f('0x1b'),_0x7805c,JSON[_0xec3f('0x10')](_0x47b6f9));_0x2d338(_0x47b6f9);})[_0xec3f('0x16')](function(_0x395b9a){logger['error'](_0xec3f('0x1b'),_0x395b9a[_0xec3f('0x14')],_0x7805c);_0xbd6461(_0xc04d54[_0xec3f('0x11')](0x1f4,_0x395b9a['message']));});});};
\ No newline at end of file
index 95aef72..994d4cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0xdc8926,_0x50a435){var _0x1aa4e6=function(_0x532d9b){while(--_0x532d9b){_0xdc8926['push'](_0xdc8926['shift']());}};_0x1aa4e6(++_0x50a435);}(_0x757a,0xde));var _0xa757=function(_0x2f89f3,_0x582bdb){_0x2f89f3=_0x2f89f3-0x0;var _0x1411ca=_0x757a[_0x2f89f3];return _0x1411ca;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
index 0b4228b..e6691ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77f0=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','blockedAt','online','admin','agent','domain','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1c6955,_0x3dc4d9){var _0x25ee86=function(_0x56aff7){while(--_0x56aff7){_0x1c6955['push'](_0x1c6955['shift']());}};_0x25ee86(++_0x3dc4d9);}(_0x77f0,0x16c));var _0x077f=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x77f0[_0xf50820];return _0x2a9b10;};'use strict';var passport=require(_0x077f('0x0'));var LocalStrategy=require(_0x077f('0x1'))[_0x077f('0x2')];var moment=require(_0x077f('0x3'));var ActiveDirectory=require(_0x077f('0x4'));var BPromise=require(_0x077f('0x5'));var util=require(_0x077f('0x6'));var db=require(_0x077f('0x7'))['db'];var authService=require(_0x077f('0x8'));var utils=require(_0x077f('0x9'));var config=require('../../config/environment');var logger=require(_0x077f('0xa'))(_0x077f('0xb'));function isActiveDirectoryConfigured(_0x243e8a){var _0x3afb48=![];if(typeof _0x243e8a[_0x077f('0xc')]!==_0x077f('0xd')){_0x3afb48=_0x243e8a[_0x077f('0xc')][_0x077f('0xe')]&&_0x243e8a[_0x077f('0xc')]['url']&&_0x243e8a[_0x077f('0xc')]['domain'];}return _0x3afb48;}function adAuthenticate(_0x2682c5,_0x45d431,_0x21ae38){return new BPromise(function(_0x2a7904,_0xe1e047){try{var _0x2f3fd6=new ActiveDirectory(_0x2682c5);_0x2f3fd6[_0x077f('0xf')](_0x45d431,_0x21ae38,function(_0x2ecbfc,_0x214b93){if(_0x2ecbfc){logger[_0x077f('0x10')](_0x077f('0x11'),_0x45d431,util[_0x077f('0x12')](_0x2ecbfc,{'showHidden':![],'depth':null}));_0xe1e047(_0x077f('0x13'));}else if(!_0x214b93){logger[_0x077f('0x10')](_0x077f('0x14'),_0x45d431);_0xe1e047('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2a7904(_0x214b93);}});}catch(_0x227179){_0xe1e047(_0x227179);}});}function ActiveDirectoryAuthenticate(_0x57428d,_0x48773e,_0x5bc345,_0xbbf05){var _0x404c0a,_0x24709d;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x077f('0x15'),_0x48773e);return _0xbbf05(null,![],{'message':_0x077f('0x13')});}return db['Setting'][_0x077f('0x16')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x077f('0x17')],'raw':!![]})[_0x077f('0x18')](function(_0x27efe8){_0x404c0a=_0x27efe8;if(!_0x404c0a[_0x077f('0x19')]){logger[_0x077f('0x10')](_0x077f('0x1a'),_0x48773e);throw new Error(_0x077f('0x13'));}return _0x57428d[_0x077f('0x16')]({'logging':!![],'attributes':['id',_0x077f('0x1b'),_0x077f('0x1c'),_0x077f('0x1d'),'role',_0x077f('0x1e'),_0x077f('0x1f'),_0x077f('0x20'),_0x077f('0x21')],'where':{'name':_0x48773e,'role':{'$or':[_0x077f('0x22'),'user',_0x077f('0x23')]},'adSsoEnabled':!![]}});})[_0x077f('0x18')](function(_0x49e162){if(!_0x49e162||_0x49e162&&_0x49e162[_0x077f('0x1b')]!==_0x48773e){throw new Error(_0x077f('0x13'));}_0x24709d=_0x49e162;var _0x56e1ac=_0x24709d[_0x077f('0x1b')]+'@'+config[_0x077f('0xc')][_0x077f('0x24')];return adAuthenticate(config[_0x077f('0xc')],_0x56e1ac,_0x5bc345);})['then'](function(_0x2ad3cc){if(_0x24709d['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x404c0a[_0x077f('0x17')]>0x0){if(_0x24709d['blocked']){if(moment(_0x24709d[_0x077f('0x20')])['add'](_0x404c0a['blockDuration'],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x077f('0x25')](_0x24709d,0x0,![],null)[_0x077f('0x18')](function(){return utils[_0x077f('0x26')](_0x24709d);})[_0x077f('0x18')](function(){return _0xbbf05(null,_0x24709d);});}else{return utils[_0x077f('0x26')](_0x24709d)[_0x077f('0x18')](function(){return _0xbbf05(null,_0x24709d);});}}else{return utils['getLicense'](_0x24709d)[_0x077f('0x18')](function(){return _0xbbf05(null,_0x24709d);});}})[_0x077f('0x27')](function(_0x321664){return _0xbbf05(null,![],_0x321664);});}function handleError(_0x52cece,_0x3addfc,_0x220272){return _0x52cece[_0x077f('0x28')](_0x3addfc||0x1f4)['send']({'message':_0x220272?_0x220272[_0x077f('0x29')]||_0x220272:''});}exports[_0x077f('0x2a')]=function(_0x25f69d,_0x43269e,_0x38d621){passport[_0x077f('0xf')](_0x077f('0x2b'),function(_0x388159,_0x238e91,_0x57b165){var _0x1b47d2=_0x388159||_0x57b165;if(_0x1b47d2){return handleError(_0x43269e,0x191,_0x1b47d2);}if(!_0x238e91){return handleError(_0x43269e,0x194,{'message':_0x077f('0x2c')});}else{var _0x277d51={'payload':{'id':_0x238e91['id'],'role':_0x238e91[_0x077f('0x2d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x277d51)[_0x077f('0x18')](function(_0x1c3337){_0x43269e['json']({'id':_0x238e91['id'],'token':_0x1c3337,'statusCall':'','isAlreadyLogged':_0x238e91['online']});});}})(_0x25f69d,_0x43269e,_0x38d621);};passport[_0x077f('0x2e')](_0x077f('0x2b'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xb7161b,_0x56e40e,_0x338e87){return ActiveDirectoryAuthenticate(db[_0x077f('0x2f')],_0xb7161b,_0x56e40e,_0x338e87);}));
\ No newline at end of file
+var _0xb53b=['role','blocked','online','admin','name','disabled','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt'];(function(_0x1e7d74,_0x22999e){var _0x3b67a0=function(_0x2549b3){while(--_0x2549b3){_0x1e7d74['push'](_0x1e7d74['shift']());}};_0x3b67a0(++_0x22999e);}(_0xb53b,0xca));var _0xbb53=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xb53b[_0x138f59];return _0x3d114d;};'use strict';var passport=require(_0xbb53('0x0'));var LocalStrategy=require(_0xbb53('0x1'))[_0xbb53('0x2')];var moment=require(_0xbb53('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xbb53('0x4'));var util=require(_0xbb53('0x5'));var db=require(_0xbb53('0x6'))['db'];var authService=require(_0xbb53('0x7'));var utils=require(_0xbb53('0x8'));var config=require(_0xbb53('0x9'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x51ed17){var _0x492e6a=![];if(typeof _0x51ed17['activedirectory']!==_0xbb53('0xa')){_0x492e6a=_0x51ed17[_0xbb53('0xb')][_0xbb53('0xc')]&&_0x51ed17[_0xbb53('0xb')][_0xbb53('0xd')]&&_0x51ed17[_0xbb53('0xb')][_0xbb53('0xe')];}return _0x492e6a;}function adAuthenticate(_0x2e3c37,_0x5203ac,_0x2b21df){return new BPromise(function(_0x59afaf,_0x39130a){try{var _0x53e63c=new ActiveDirectory(_0x2e3c37);_0x53e63c[_0xbb53('0xf')](_0x5203ac,_0x2b21df,function(_0x190d1a,_0x5ae167){if(_0x190d1a){logger[_0xbb53('0x10')](_0xbb53('0x11'),_0x5203ac,util[_0xbb53('0x12')](_0x190d1a,{'showHidden':![],'depth':null}));_0x39130a(_0xbb53('0x13'));}else if(!_0x5ae167){logger['error'](_0xbb53('0x14'),_0x5203ac);_0x39130a(_0xbb53('0x13'));}else{_0x59afaf(_0x5ae167);}});}catch(_0x106057){_0x39130a(_0x106057);}});}function ActiveDirectoryAuthenticate(_0x5227ba,_0xf9d796,_0x21e790,_0x5460a6){var _0xac8dbb,_0x5e0b1a;if(!isActiveDirectoryConfigured(config)){logger[_0xbb53('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xf9d796);return _0x5460a6(null,![],{'message':_0xbb53('0x13')});}return db['Setting'][_0xbb53('0x15')]({'where':{'id':0x1},'attributes':[_0xbb53('0x16'),_0xbb53('0x17')],'raw':!![]})[_0xbb53('0x18')](function(_0x3c5b12){_0xac8dbb=_0x3c5b12;if(!_0xac8dbb['adSsoEnabled']){logger[_0xbb53('0x10')](_0xbb53('0x19'),_0xf9d796);throw new Error(_0xbb53('0x13'));}return _0x5227ba[_0xbb53('0x15')]({'logging':!![],'attributes':['id','name',_0xbb53('0x1a'),_0xbb53('0x1b'),_0xbb53('0x1c'),'disabled',_0xbb53('0x1d'),'blockedAt',_0xbb53('0x1e')],'where':{'name':_0xf9d796,'role':{'$or':[_0xbb53('0x1f'),'user','agent']},'adSsoEnabled':!![]}});})[_0xbb53('0x18')](function(_0x19b4c1){if(!_0x19b4c1||_0x19b4c1&&_0x19b4c1[_0xbb53('0x20')]!==_0xf9d796){throw new Error(_0xbb53('0x13'));}_0x5e0b1a=_0x19b4c1;var _0x47fba4=_0x5e0b1a[_0xbb53('0x20')]+'@'+config[_0xbb53('0xb')][_0xbb53('0xe')];return adAuthenticate(config[_0xbb53('0xb')],_0x47fba4,_0x21e790);})['then'](function(_0xd45c1f){if(_0x5e0b1a[_0xbb53('0x21')]){throw new Error(_0xbb53('0x13'));}if(_0xac8dbb[_0xbb53('0x17')]>0x0){if(_0x5e0b1a[_0xbb53('0x1d')]){if(moment(_0x5e0b1a['blockedAt'])['add'](_0xac8dbb[_0xbb53('0x17')],'minutes')>moment()){throw new Error(_0xbb53('0x13'));}return utils[_0xbb53('0x22')](_0x5e0b1a,0x0,![],null)['then'](function(){return utils[_0xbb53('0x23')](_0x5e0b1a);})[_0xbb53('0x18')](function(){return _0x5460a6(null,_0x5e0b1a);});}else{return utils['getLicense'](_0x5e0b1a)[_0xbb53('0x18')](function(){return _0x5460a6(null,_0x5e0b1a);});}}else{return utils['getLicense'](_0x5e0b1a)['then'](function(){return _0x5460a6(null,_0x5e0b1a);});}})[_0xbb53('0x24')](function(_0x123d72){return _0x5460a6(null,![],_0x123d72);});}function handleError(_0x2ced74,_0x4522a5,_0x11f9a1){return _0x2ced74['status'](_0x4522a5||0x1f4)[_0xbb53('0x25')]({'message':_0x11f9a1?_0x11f9a1[_0xbb53('0x26')]||_0x11f9a1:''});}exports[_0xbb53('0x27')]=function(_0x44ff19,_0x232c2a,_0x50f7f6){passport[_0xbb53('0xf')](_0xbb53('0x28'),function(_0x39bf81,_0x39e4fa,_0x4c8ff5){var _0x50b3e4=_0x39bf81||_0x4c8ff5;if(_0x50b3e4){return handleError(_0x232c2a,0x191,_0x50b3e4);}if(!_0x39e4fa){return handleError(_0x232c2a,0x194,{'message':_0xbb53('0x29')});}else{var _0x2dd231={'payload':{'id':_0x39e4fa['id'],'role':_0x39e4fa['role']},'options':{'expiresIn':0x15180}};return authService[_0xbb53('0x2a')](_0x2dd231)[_0xbb53('0x18')](function(_0x1085b0){_0x232c2a[_0xbb53('0x2b')]({'id':_0x39e4fa['id'],'token':_0x1085b0,'statusCall':'','isAlreadyLogged':_0x39e4fa[_0xbb53('0x1e')]});});}})(_0x44ff19,_0x232c2a,_0x50f7f6);};passport[_0xbb53('0x2c')](_0xbb53('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0xbb53('0x1a')},function(_0x596c0f,_0x286e30,_0x544f59){return ActiveDirectoryAuthenticate(db[_0xbb53('0x2d')],_0x596c0f,_0x286e30,_0x544f59);}));
\ No newline at end of file
index 5b55141..c0aec37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a2e=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x415cf4,_0x1c5b67){var _0x11b6f2=function(_0x4400da){while(--_0x4400da){_0x415cf4['push'](_0x415cf4['shift']());}};_0x11b6f2(++_0x1c5b67);}(_0x6a2e,0x196));var _0xe6a2=function(_0x478a9f,_0x36bfcb){_0x478a9f=_0x478a9f-0x0;var _0x5181c4=_0x6a2e[_0x478a9f];return _0x5181c4;};'use strict';var express=require(_0xe6a2('0x0'));var router=express['Router']();var controller=require(_0xe6a2('0x1'));router[_0xe6a2('0x2')]('/',controller[_0xe6a2('0x3')]);module[_0xe6a2('0x4')]=router;
\ No newline at end of file
+var _0x41cd=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x47795f,_0x4d7da9){var _0x50b712=function(_0x5e581d){while(--_0x5e581d){_0x47795f['push'](_0x47795f['shift']());}};_0x50b712(++_0x4d7da9);}(_0x41cd,0x153));var _0xd41c=function(_0x485bad,_0x21c418){_0x485bad=_0x485bad-0x0;var _0x523c91=_0x41cd[_0x485bad];return _0x523c91;};'use strict';var express=require(_0xd41c('0x0'));var router=express[_0xd41c('0x1')]();var controller=require(_0xd41c('0x2'));router[_0xd41c('0x3')]('/',controller[_0xd41c('0x4')]);module[_0xd41c('0x5')]=router;
\ No newline at end of file
index 4b74ad8..4e94141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x40fd0b,_0x108503){_0x40fd0b=_0x40fd0b-0x0;var _0x3bd3b8=_0x7a54[_0x40fd0b];return _0x3bd3b8;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x7a54,0x106));var _0x47a5=function(_0xd12684,_0x20f1f9){_0xd12684=_0xd12684-0x0;var _0x32d00e=_0x7a54[_0xd12684];return _0x32d00e;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
index d4de239..f78fe8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb36=['isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','get','login','/callback','callback'];(function(_0x549045,_0x568713){var _0x24e33e=function(_0x4e2657){while(--_0x4e2657){_0x549045['push'](_0x549045['shift']());}};_0x24e33e(++_0x568713);}(_0xcb36,0xe9));var _0x6cb3=function(_0x1cf58a,_0x39665b){_0x1cf58a=_0x1cf58a-0x0;var _0x2fd429=_0xcb36[_0x1cf58a];return _0x2fd429;};'use strict';var express=require(_0x6cb3('0x0'));var passport=require(_0x6cb3('0x1'));var router=express['Router']();var controller=require(_0x6cb3('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x6cb3('0x3')]('/',controller[_0x6cb3('0x4')]);router[_0x6cb3('0x3')](_0x6cb3('0x5'),controller[_0x6cb3('0x6')],authService[_0x6cb3('0x7')],userController[_0x6cb3('0x4')],authService[_0x6cb3('0x8')]);module[_0x6cb3('0x9')]=router;
\ No newline at end of file
+var _0x1347=['exports','passport','Router','../user/user.controller.js','../../components/auth/service','login','get','isMiddleware','setTokenCookie'];(function(_0x464eb8,_0x581b99){var _0x4f3483=function(_0x41f74b){while(--_0x41f74b){_0x464eb8['push'](_0x464eb8['shift']());}};_0x4f3483(++_0x581b99);}(_0x1347,0xd0));var _0x7134=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0x1347[_0x36940e];return _0x3283f2;};'use strict';var express=require('express');var passport=require(_0x7134('0x0'));var router=express[_0x7134('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x7134('0x2'));var authService=require(_0x7134('0x3'));router['get']('/',controller[_0x7134('0x4')]);router[_0x7134('0x5')]('/callback',controller['callback'],authService[_0x7134('0x6')],userController[_0x7134('0x4')],authService[_0x7134('0x7')]);module[_0x7134('0x8')]=router;
\ No newline at end of file
index a454365..c3e4df8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3af=['request','SendMail','error','message','stringify','status','login','local-login','signToken','json','online','body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','passport','passport-local','randomstring','moment','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blockedAt','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>'];(function(_0x1c9fc5,_0x3ca335){var _0x4eea03=function(_0x191625){while(--_0x191625){_0x1c9fc5['push'](_0x1c9fc5['shift']());}};_0x4eea03(++_0x3ca335);}(_0xa3af,0xc9));var _0xfa3a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa3af[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var passport=require(_0xfa3a('0x0'));var LocalStrategy=require(_0xfa3a('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xfa3a('0x2'));var moment=require(_0xfa3a('0x3'));var db=require(_0xfa3a('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xfa3a('0x5'));var client=jayson[_0xfa3a('0x6')]['http']({'port':0x232b});function localAuthenticate(_0x1ae283,_0x3b019c,_0x2d9ed4,_0x2a4a4b){var _0x2d80a9,_0x6773ea;return db[_0xfa3a('0x7')][_0xfa3a('0x8')]({'where':{'id':0x1},'attributes':[_0xfa3a('0x9'),_0xfa3a('0xa')],'raw':!![]})[_0xfa3a('0xb')](function(_0x2bbe49){_0x2d80a9=_0x2bbe49;return _0x1ae283[_0xfa3a('0x8')]({'attributes':['id',_0xfa3a('0xc'),_0xfa3a('0xd'),'salt',_0xfa3a('0xe'),_0xfa3a('0xf'),'blocked',_0xfa3a('0x10'),'loginAttempts'],'where':{'name':_0x3b019c,'role':{'$or':[_0xfa3a('0x11'),_0xfa3a('0x12'),_0xfa3a('0x13')]}}});})['then'](function(_0x90dfa1){if(!_0x90dfa1||_0x90dfa1&&_0x90dfa1['name']!==_0x3b019c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x6773ea=_0x90dfa1;return _0x6773ea;}})[_0xfa3a('0xb')](function(){_0x6773ea[_0xfa3a('0x14')](_0x2d9ed4,function(_0x564c16,_0x2b69cf){var _0x107380=_0x6773ea['loginAttempts']+0x1;if(_0x564c16){return _0x2a4a4b(_0x564c16);}else if(!_0x2b69cf){if(_0x6773ea[_0xfa3a('0xf')]){return _0x2a4a4b(null,![],{'message':_0xfa3a('0x15')});}else if(_0x2d80a9[_0xfa3a('0x9')]>0x0){if(_0x6773ea[_0xfa3a('0x16')]){if(_0x2d80a9[_0xfa3a('0xa')]>0x0){if(moment(_0x6773ea[_0xfa3a('0x10')])[_0xfa3a('0x17')](_0x2d80a9[_0xfa3a('0xa')],_0xfa3a('0x18'))>moment()){return _0x2a4a4b(null,![],{'message':_0xfa3a('0x15')});}else{return utils[_0xfa3a('0x19')](_0x6773ea,_0x107380,![],null)[_0xfa3a('0xb')](function(){return _0x2a4a4b(null,![],{'message':_0xfa3a('0x15')});});}}else{return _0x2a4a4b(null,![],{'message':_0xfa3a('0x15')});}}else{if(_0x107380>=_0x2d80a9[_0xfa3a('0x9')]){return utils[_0xfa3a('0x19')](_0x6773ea,0x0,!![],moment())[_0xfa3a('0xb')](function(){return _0x2a4a4b(null,![],{'message':_0xfa3a('0x15')});});}else{return utils[_0xfa3a('0x19')](_0x6773ea,_0x107380,![],null)[_0xfa3a('0xb')](function(){return _0x2a4a4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2a4a4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x6773ea[_0xfa3a('0xf')]){return _0x2a4a4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2d80a9[_0xfa3a('0x9')]>0x0){if(_0x6773ea[_0xfa3a('0x16')]){if(_0x2d80a9[_0xfa3a('0xa')]>0x0){if(moment(_0x6773ea[_0xfa3a('0x10')])[_0xfa3a('0x17')](_0x2d80a9[_0xfa3a('0xa')],_0xfa3a('0x18'))>moment()){return _0x2a4a4b(null,![],{'message':_0xfa3a('0x15')});}else{return utils[_0xfa3a('0x19')](_0x6773ea,0x0,![],null)[_0xfa3a('0xb')](function(){return utils[_0xfa3a('0x1a')](_0x6773ea);})[_0xfa3a('0xb')](function(){return _0x2a4a4b(null,_0x6773ea);});}}else{return _0x2a4a4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x6773ea,0x0,![],null)['then'](function(){return utils[_0xfa3a('0x1a')](_0x6773ea);})['then'](function(){return _0x2a4a4b(null,_0x6773ea);})[_0xfa3a('0x1b')](function(_0x3974fd){return _0x2a4a4b(null,![],_0x3974fd);});}}else{if(_0x6773ea[_0xfa3a('0x16')]){return _0x2a4a4b(null,![],{'message':_0xfa3a('0x15')});}else{return utils['getLicense'](_0x6773ea)[_0xfa3a('0xb')](function(){return _0x2a4a4b(null,_0x6773ea);});}}}});})[_0xfa3a('0x1b')](function(_0x2c3ea5){return _0x2a4a4b(null,![],_0x2c3ea5);});}function sendServiceMail(_0x49bdbe){return db[_0xfa3a('0x1c')][_0xfa3a('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0xfa3a('0x1e')],'include':[{'model':db[_0xfa3a('0x1f')],'as':_0xfa3a('0x20')}]})[_0xfa3a('0xb')](function(_0x5eb778){if(!_0x5eb778){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x86f7c6={'tls':{'rejectUnauthorized':![]}};if(_0x5eb778[_0xfa3a('0x20')][_0xfa3a('0x21')]){_0x86f7c6[_0xfa3a('0x21')]=_0x5eb778['Smtp']['service'];}else{_0x86f7c6[_0xfa3a('0x22')]=_0x5eb778[_0xfa3a('0x20')][_0xfa3a('0x22')];_0x86f7c6['port']=_0x5eb778[_0xfa3a('0x20')][_0xfa3a('0x23')];_0x86f7c6[_0xfa3a('0x24')]=_0x5eb778[_0xfa3a('0x20')]['secure'];}if(_0x5eb778['Smtp'][_0xfa3a('0x25')]){_0x86f7c6[_0xfa3a('0x26')]={'user':_0x5eb778[_0xfa3a('0x20')]['user'],'pass':_0x5eb778[_0xfa3a('0x20')]['pass']};}var _0x235f72={'account':_0x86f7c6,'message':_[_0xfa3a('0x27')]({'from':util[_0xfa3a('0x28')](_0xfa3a('0x29'),_0x5eb778[_0xfa3a('0xc')],_0x5eb778[_0xfa3a('0x1e')]||_0x5eb778[_0xfa3a('0x20')][_0xfa3a('0x12')])},_0x49bdbe)};return client[_0xfa3a('0x2a')](_0xfa3a('0x2b'),_0x235f72);})[_0xfa3a('0xb')](function(_0x187a09){if(_0x187a09[_0xfa3a('0x2c')]){throw new Error(util[_0xfa3a('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x187a09[_0xfa3a('0x2c')][_0xfa3a('0x2d')]||JSON[_0xfa3a('0x2e')](_0x187a09[_0xfa3a('0x2c')])));}return!![];});}function handleError(_0x1a12ee,_0x134a76,_0x54f12a){return _0x1a12ee[_0xfa3a('0x2f')](_0x134a76||0x1f4)['send']({'message':_0x54f12a?_0x54f12a[_0xfa3a('0x2d')]||_0x54f12a:''});}exports[_0xfa3a('0x30')]=function(_0x51c799,_0x283d0c,_0x546f12){passport[_0xfa3a('0x14')](_0xfa3a('0x31'),function(_0xcebd78,_0x56b657,_0x5ad78b){var _0x46b2c5=_0xcebd78||_0x5ad78b;if(_0x46b2c5){return handleError(_0x283d0c,0x191,_0x46b2c5);}if(!_0x56b657){return handleError(_0x283d0c,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x12e0ce={'payload':{'id':_0x56b657['id'],'role':_0x56b657['role']},'options':{'expiresIn':0x15180}};return authService[_0xfa3a('0x32')](_0x12e0ce)['then'](function(_0x4952e2){_0x283d0c[_0xfa3a('0x33')]({'id':_0x56b657['id'],'token':_0x4952e2,'statusCall':'','isAlreadyLogged':_0x56b657[_0xfa3a('0x34')]});});}})(_0x51c799,_0x283d0c,_0x546f12);};exports['forgot']=function(_0x538f5e,_0x4f11e9,_0x399e60){if(!_0x538f5e[_0xfa3a('0x35')][_0xfa3a('0x1e')]){return handleError(_0x4f11e9,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5587c5=rs['generate']();_0x538f5e[_0xfa3a('0x35')][_0xfa3a('0x1e')]=_0x538f5e[_0xfa3a('0x35')][_0xfa3a('0x1e')]['trim']()[_0xfa3a('0x36')]();var _0x107dc9;return db[_0xfa3a('0x7')]['findOne']({'where':{'id':0x1},'attributes':[_0xfa3a('0x9'),_0xfa3a('0xa')],'raw':!![]})[_0xfa3a('0xb')](function(_0x58b1d4){_0x107dc9=_0x58b1d4;return db[_0xfa3a('0x37')][_0xfa3a('0x1d')]({'where':{'email':_0x538f5e[_0xfa3a('0x35')]['email']}});})[_0xfa3a('0xb')](function(_0xf57bdb){if(!_0xf57bdb){throw new Error(_0xfa3a('0x38'));}if(_0xf57bdb[_0xfa3a('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0xf57bdb[_0xfa3a('0x16')]){if(moment(_0xf57bdb[_0xfa3a('0x10')])[_0xfa3a('0x17')](_0x107dc9[_0xfa3a('0xa')],'minutes')>moment()){throw new Error(_0xfa3a('0x39'));}else{_0xf57bdb[_0xfa3a('0x16')]=![];_0xf57bdb[_0xfa3a('0x10')]=null;}}_0xf57bdb['resetPasswordToken']=_0x5587c5;_0xf57bdb[_0xfa3a('0x3a')]=Date['now']()+0x36ee80;return _0xf57bdb[_0xfa3a('0x3b')]();})[_0xfa3a('0xb')](function(){return sendServiceMail({'to':_0x538f5e[_0xfa3a('0x35')][_0xfa3a('0x1e')],'subject':_0xfa3a('0x3c'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xfa3a('0x3d')+_0xfa3a('0x3e')+_0x538f5e[_0xfa3a('0x3f')][_0xfa3a('0x22')]+_0xfa3a('0x40')+_0x5587c5+'\x0a\x0a'+_0xfa3a('0x41')});})[_0xfa3a('0xb')](function(){_0x4f11e9['status'](0xc8)[_0xfa3a('0x42')]({'message':_0xfa3a('0x43')});})[_0xfa3a('0x1b')](function(_0x404dd4){return handleError(_0x4f11e9,0x1f4,_0x404dd4);});};exports[_0xfa3a('0x44')]=function(_0x4969c6,_0x1644f4,_0x4affe3){return db[_0xfa3a('0x37')][_0xfa3a('0x1d')]({'where':{'resetPasswordToken':_0x4969c6[_0xfa3a('0x45')][_0xfa3a('0x46')],'resetPasswordExpires':{'$gt':Date[_0xfa3a('0x47')]()}}})[_0xfa3a('0xb')](function(_0x37f40d){if(!_0x37f40d){throw new Error(_0xfa3a('0x48'));}return db[_0xfa3a('0x7')][_0xfa3a('0x8')]({'attributes':['id',_0xfa3a('0x49'),_0xfa3a('0x4a'),_0xfa3a('0x4b')]})[_0xfa3a('0xb')](function(_0xc7fd33){if(_0xc7fd33[_0xfa3a('0x49')])authService['validatePasswordPattern'](_0x4969c6[_0xfa3a('0x35')][_0xfa3a('0xd')]);if(!_0xc7fd33[_0xfa3a('0x4a')]||!_0x37f40d[_0xfa3a('0x4c')])return _0x37f40d;authService[_0xfa3a('0x4d')](_0x4969c6[_0xfa3a('0x35')][_0xfa3a('0xd')],_0x37f40d[_0xfa3a('0x4c')],_0xc7fd33[_0xfa3a('0x4b')]);return _0x37f40d;})[_0xfa3a('0xb')](function(){_0x37f40d[_0xfa3a('0xd')]=_0x4969c6['body'][_0xfa3a('0xd')];_0x37f40d[_0xfa3a('0x4e')]=null;_0x37f40d[_0xfa3a('0x3a')]=null;return _0x37f40d[_0xfa3a('0x3b')]();});})[_0xfa3a('0xb')](function(){_0x1644f4[_0xfa3a('0x2f')](0xc8)[_0xfa3a('0x42')]({'message':_0xfa3a('0x4f')});})[_0xfa3a('0x1b')](function(_0x4f2415){return handleError(_0x1644f4,0x1f4,_0x4f2415);});};passport[_0xfa3a('0x50')](_0xfa3a('0x31'),new LocalStrategy({'usernameField':_0xfa3a('0xc'),'passwordField':_0xfa3a('0xd')},function(_0x3d88f6,_0x4d0c83,_0x46210a){return localAuthenticate(db[_0xfa3a('0x37')],_0x3d88f6,_0x4d0c83,_0x46210a);}));
\ No newline at end of file
+var _0x5eaf=['Setting','User','find','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordToken','local-login','util','passport','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','client','http','findOne','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockDuration','add','clearBlockUser','minutes','getLicense','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase'];(function(_0x2f0c13,_0x3ecf35){var _0x33dcb4=function(_0x36219c){while(--_0x36219c){_0x2f0c13['push'](_0x2f0c13['shift']());}};_0x33dcb4(++_0x3ecf35);}(_0x5eaf,0x108));var _0xf5ea=function(_0x4af572,_0x2e3535){_0x4af572=_0x4af572-0x0;var _0x4d88f3=_0x5eaf[_0x4af572];return _0x4d88f3;};'use strict';var util=require(_0xf5ea('0x0'));var passport=require(_0xf5ea('0x1'));var LocalStrategy=require('passport-local')[_0xf5ea('0x2')];var jayson=require(_0xf5ea('0x3'));var _=require(_0xf5ea('0x4'));var rs=require(_0xf5ea('0x5'));var moment=require('moment');var db=require(_0xf5ea('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xf5ea('0x7'));var client=jayson[_0xf5ea('0x8')][_0xf5ea('0x9')]({'port':0x232b});function localAuthenticate(_0x43b916,_0x17cbc8,_0x99e305,_0x10267e){var _0x5d96a8,_0x42b3ad;return db['Setting'][_0xf5ea('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xf5ea('0xb')](function(_0x406a7b){_0x5d96a8=_0x406a7b;return _0x43b916[_0xf5ea('0xa')]({'attributes':['id',_0xf5ea('0xc'),_0xf5ea('0xd'),_0xf5ea('0xe'),'role',_0xf5ea('0xf'),_0xf5ea('0x10'),_0xf5ea('0x11'),_0xf5ea('0x12')],'where':{'name':_0x17cbc8,'role':{'$or':[_0xf5ea('0x13'),_0xf5ea('0x14'),_0xf5ea('0x15')]}}});})[_0xf5ea('0xb')](function(_0x140b2c){if(!_0x140b2c||_0x140b2c&&_0x140b2c['name']!==_0x17cbc8){throw new Error(_0xf5ea('0x16'));}else{_0x42b3ad=_0x140b2c;return _0x42b3ad;}})['then'](function(){_0x42b3ad[_0xf5ea('0x17')](_0x99e305,function(_0x4b141f,_0x23521f){var _0x116e2c=_0x42b3ad[_0xf5ea('0x12')]+0x1;if(_0x4b141f){return _0x10267e(_0x4b141f);}else if(!_0x23521f){if(_0x42b3ad[_0xf5ea('0xf')]){return _0x10267e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5d96a8[_0xf5ea('0x18')]>0x0){if(_0x42b3ad['blocked']){if(_0x5d96a8[_0xf5ea('0x19')]>0x0){if(moment(_0x42b3ad[_0xf5ea('0x11')])[_0xf5ea('0x1a')](_0x5d96a8[_0xf5ea('0x19')],'minutes')>moment()){return _0x10267e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf5ea('0x1b')](_0x42b3ad,_0x116e2c,![],null)[_0xf5ea('0xb')](function(){return _0x10267e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x10267e(null,![],{'message':_0xf5ea('0x16')});}}else{if(_0x116e2c>=_0x5d96a8[_0xf5ea('0x18')]){return utils['clearBlockUser'](_0x42b3ad,0x0,!![],moment())[_0xf5ea('0xb')](function(){return _0x10267e(null,![],{'message':_0xf5ea('0x16')});});}else{return utils['clearBlockUser'](_0x42b3ad,_0x116e2c,![],null)[_0xf5ea('0xb')](function(){return _0x10267e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x10267e(null,![],{'message':_0xf5ea('0x16')});}}else{if(_0x42b3ad[_0xf5ea('0xf')]){return _0x10267e(null,![],{'message':_0xf5ea('0x16')});}else if(_0x5d96a8['allowedLoginAttempts']>0x0){if(_0x42b3ad['blocked']){if(_0x5d96a8[_0xf5ea('0x19')]>0x0){if(moment(_0x42b3ad[_0xf5ea('0x11')])[_0xf5ea('0x1a')](_0x5d96a8[_0xf5ea('0x19')],_0xf5ea('0x1c'))>moment()){return _0x10267e(null,![],{'message':_0xf5ea('0x16')});}else{return utils['clearBlockUser'](_0x42b3ad,0x0,![],null)[_0xf5ea('0xb')](function(){return utils[_0xf5ea('0x1d')](_0x42b3ad);})[_0xf5ea('0xb')](function(){return _0x10267e(null,_0x42b3ad);});}}else{return _0x10267e(null,![],{'message':_0xf5ea('0x16')});}}else{return utils['clearBlockUser'](_0x42b3ad,0x0,![],null)['then'](function(){return utils[_0xf5ea('0x1d')](_0x42b3ad);})[_0xf5ea('0xb')](function(){return _0x10267e(null,_0x42b3ad);})['catch'](function(_0x30fb35){return _0x10267e(null,![],_0x30fb35);});}}else{if(_0x42b3ad[_0xf5ea('0x10')]){return _0x10267e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf5ea('0x1d')](_0x42b3ad)[_0xf5ea('0xb')](function(){return _0x10267e(null,_0x42b3ad);});}}}});})['catch'](function(_0x1a11d4){return _0x10267e(null,![],_0x1a11d4);});}function sendServiceMail(_0x7eabcf){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xf5ea('0xc'),'email'],'include':[{'model':db[_0xf5ea('0x1e')],'as':_0xf5ea('0x1f'),'include':[{'model':db['CloudProvider'],'as':_0xf5ea('0x20')}]}]})[_0xf5ea('0xb')](function(_0x4261e1){if(!_0x4261e1){throw new Error(_0xf5ea('0x21'));}var _0x37eb8a=_0x4261e1['getSmtpOptions']();var _0x3eb4b0={'account':_0x37eb8a,'message':_[_0xf5ea('0x22')]({'from':util[_0xf5ea('0x23')](_0xf5ea('0x24'),_0x4261e1[_0xf5ea('0xc')],_0x4261e1[_0xf5ea('0x25')]||_0x4261e1[_0xf5ea('0x1f')][_0xf5ea('0x14')])},_0x7eabcf)};return client[_0xf5ea('0x26')](_0xf5ea('0x27'),_0x3eb4b0);})[_0xf5ea('0xb')](function(_0x2f85db){if(_0x2f85db[_0xf5ea('0x28')]){throw new Error(util[_0xf5ea('0x23')](_0xf5ea('0x29'),_0x2f85db[_0xf5ea('0x28')]['message']||JSON[_0xf5ea('0x2a')](_0x2f85db['error'])));}return!![];});}function handleError(_0x4bde3f,_0xebe09,_0x5a47a4){return _0x4bde3f[_0xf5ea('0x2b')](_0xebe09||0x1f4)[_0xf5ea('0x2c')]({'message':_0x5a47a4?_0x5a47a4[_0xf5ea('0x2d')]||_0x5a47a4:''});}exports[_0xf5ea('0x2e')]=function(_0x3966e3,_0x3d8b02,_0x1f28bf){passport[_0xf5ea('0x17')]('local-login',function(_0x1b66dc,_0x3a72a1,_0x18a325){var _0x22e49c=_0x1b66dc||_0x18a325;if(_0x22e49c){return handleError(_0x3d8b02,0x191,_0x22e49c);}if(!_0x3a72a1){return handleError(_0x3d8b02,0x194,{'message':_0xf5ea('0x2f')});}else{var _0x365817={'payload':{'id':_0x3a72a1['id'],'role':_0x3a72a1[_0xf5ea('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0xf5ea('0x31')](_0x365817)[_0xf5ea('0xb')](function(_0xe17d3c){_0x3d8b02[_0xf5ea('0x32')]({'id':_0x3a72a1['id'],'token':_0xe17d3c,'statusCall':'','isAlreadyLogged':_0x3a72a1['online']});});}})(_0x3966e3,_0x3d8b02,_0x1f28bf);};exports[_0xf5ea('0x33')]=function(_0x5ea142,_0x15b27f){if(!_0x5ea142['body'][_0xf5ea('0x25')]){return handleError(_0x15b27f,0x1f4,{'message':_0xf5ea('0x34')});}var _0x4624e8=rs[_0xf5ea('0x35')]();_0x5ea142[_0xf5ea('0x36')]['email']=_0x5ea142[_0xf5ea('0x36')][_0xf5ea('0x25')]['trim']()[_0xf5ea('0x37')]();var _0x12fb52;return db[_0xf5ea('0x38')][_0xf5ea('0xa')]({'where':{'id':0x1},'attributes':[_0xf5ea('0x18'),_0xf5ea('0x19')],'raw':!![]})[_0xf5ea('0xb')](function(_0x79ecf6){_0x12fb52=_0x79ecf6;return db[_0xf5ea('0x39')][_0xf5ea('0x3a')]({'where':{'email':_0x5ea142['body'][_0xf5ea('0x25')]}});})['then'](function(_0x575c3c){if(!_0x575c3c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x575c3c[_0xf5ea('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x575c3c['blocked']){if(moment(_0x575c3c[_0xf5ea('0x11')])['add'](_0x12fb52[_0xf5ea('0x19')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x575c3c[_0xf5ea('0x10')]=![];_0x575c3c[_0xf5ea('0x11')]=null;}}_0x575c3c['resetPasswordToken']=_0x4624e8;_0x575c3c[_0xf5ea('0x3b')]=Date['now']()+0x36ee80;return _0x575c3c[_0xf5ea('0x3c')]();})['then'](function(){return sendServiceMail({'to':_0x5ea142[_0xf5ea('0x36')][_0xf5ea('0x25')],'subject':_0xf5ea('0x3d'),'text':_0xf5ea('0x3e')+_0xf5ea('0x3f')+'https://'+_0x5ea142[_0xf5ea('0x40')][_0xf5ea('0x41')]+_0xf5ea('0x42')+_0x4624e8+'\x0a\x0a'+_0xf5ea('0x43')});})[_0xf5ea('0xb')](function(){_0x15b27f[_0xf5ea('0x2b')](0xc8)['send']({'message':_0xf5ea('0x44')});})[_0xf5ea('0x45')](function(_0x2218c3){return handleError(_0x15b27f,0x1f4,_0x2218c3);});};exports['reset']=function(_0x4ed917,_0x9b67c1){return db[_0xf5ea('0x39')][_0xf5ea('0x3a')]({'where':{'resetPasswordToken':_0x4ed917['params'][_0xf5ea('0x46')],'resetPasswordExpires':{'$gt':Date[_0xf5ea('0x47')]()}}})[_0xf5ea('0xb')](function(_0x5ef23f){if(!_0x5ef23f){throw new Error(_0xf5ea('0x48'));}return db[_0xf5ea('0x38')][_0xf5ea('0xa')]({'attributes':['id',_0xf5ea('0x49'),_0xf5ea('0x4a'),_0xf5ea('0x4b')]})[_0xf5ea('0xb')](function(_0x229374){if(_0x229374['securePassword'])authService['validatePasswordPattern'](_0x4ed917[_0xf5ea('0x36')][_0xf5ea('0xd')]);if(!_0x229374[_0xf5ea('0x4a')]||!_0x5ef23f[_0xf5ea('0x4c')])return _0x5ef23f;authService[_0xf5ea('0x4d')](_0x4ed917['body'][_0xf5ea('0xd')],_0x5ef23f['previousPasswords'],_0x229374[_0xf5ea('0x4b')]);return _0x5ef23f;})[_0xf5ea('0xb')](function(){_0x5ef23f[_0xf5ea('0xd')]=_0x4ed917[_0xf5ea('0x36')]['password'];_0x5ef23f[_0xf5ea('0x4e')]=null;_0x5ef23f['resetPasswordExpires']=null;return _0x5ef23f[_0xf5ea('0x3c')]();});})[_0xf5ea('0xb')](function(){_0x9b67c1['status'](0xc8)[_0xf5ea('0x2c')]({'message':'Password\x20reset!'});})[_0xf5ea('0x45')](function(_0x12f5e3){return handleError(_0x9b67c1,0x1f4,_0x12f5e3);});};passport['use'](_0xf5ea('0x4f'),new LocalStrategy({'usernameField':_0xf5ea('0xc'),'passwordField':_0xf5ea('0xd')},function(_0xe8a590,_0x8d041c,_0x1e37c6){return localAuthenticate(db[_0xf5ea('0x39')],_0xe8a590,_0x8d041c,_0x1e37c6);}));
\ No newline at end of file
index 299d654..93629ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8b1=['login','/forgot','/reset/:token','reset','exports','express','post'];(function(_0x18247f,_0xc44592){var _0x3ce1c2=function(_0x2aeb28){while(--_0x2aeb28){_0x18247f['push'](_0x18247f['shift']());}};_0x3ce1c2(++_0xc44592);}(_0xc8b1,0x6e));var _0x1c8b=function(_0x4ff72f,_0x33638d){_0x4ff72f=_0x4ff72f-0x0;var _0x14d557=_0xc8b1[_0x4ff72f];return _0x14d557;};'use strict';var express=require(_0x1c8b('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x1c8b('0x1')]('/',controller[_0x1c8b('0x2')]);router[_0x1c8b('0x1')](_0x1c8b('0x3'),controller['forgot']);router[_0x1c8b('0x1')](_0x1c8b('0x4'),controller[_0x1c8b('0x5')]);module[_0x1c8b('0x6')]=router;
\ No newline at end of file
+var _0x4c58=['forgot','/reset/:token','reset','Router','./authLocal.controller','post','login','/forgot'];(function(_0xd4f8de,_0x1cdc51){var _0x4c08cb=function(_0x52acbe){while(--_0x52acbe){_0xd4f8de['push'](_0xd4f8de['shift']());}};_0x4c08cb(++_0x1cdc51);}(_0x4c58,0x1ab));var _0x84c5=function(_0x48b7cb,_0x28a41b){_0x48b7cb=_0x48b7cb-0x0;var _0xd33de2=_0x4c58[_0x48b7cb];return _0xd33de2;};'use strict';var express=require('express');var router=express[_0x84c5('0x0')]();var controller=require(_0x84c5('0x1'));router[_0x84c5('0x2')]('/',controller[_0x84c5('0x3')]);router['post'](_0x84c5('0x4'),controller[_0x84c5('0x5')]);router[_0x84c5('0x2')](_0x84c5('0x6'),controller[_0x84c5('0x7')]);module['exports']=router;
\ No newline at end of file
index 78a6e58..6b4288b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe28c=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0xe28c,0x97));var _0xce28=function(_0x1a4cfc,_0x53a1af){_0x1a4cfc=_0x1a4cfc-0x0;var _0x1bb003=_0xe28c[_0x1a4cfc];return _0x1bb003;};'use strict';var Sequelize=require(_0xce28('0x0'));module['exports']={'name':{'type':Sequelize[_0xce28('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xce28('0x1')]},'description':{'type':Sequelize[_0xce28('0x1')]},'status':{'type':Sequelize[_0xce28('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xce28('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xcc78=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xcc78,0x1eb));var _0x8cc7=function(_0x4f820f,_0x2140f9){_0x4f820f=_0x4f820f-0x0;var _0x3c8c91=_0xcc78[_0x4f820f];return _0x3c8c91;};'use strict';var Sequelize=require(_0x8cc7('0x0'));module[_0x8cc7('0x1')]={'name':{'type':Sequelize[_0x8cc7('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8cc7('0x2')]},'description':{'type':Sequelize[_0x8cc7('0x2')]},'status':{'type':Sequelize[_0x8cc7('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8cc7('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index 4e48080..0051271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a05=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','map','Automation','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','addConditions','Condition','ids','omit','findOne','length','hasOwnProperty','addActions','getActions','Action','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x7a05,0x92));var _0x57a0=function(_0x203e4d,_0x3eb287){_0x203e4d=_0x203e4d-0x0;var _0x3a886c=_0x7a05[_0x203e4d];return _0x3a886c;};'use strict';var emlformat=require(_0x57a0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x57a0('0x1'));var rp=require(_0x57a0('0x2'));var moment=require(_0x57a0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x57a0('0x4'));var util=require(_0x57a0('0x5'));var path=require('path');var sox=require(_0x57a0('0x6'));var csv=require('to-csv');var ejs=require(_0x57a0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57a0('0x8'));var squel=require('squel');var crypto=require(_0x57a0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x57a0('0xa'));var toCsv=require(_0x57a0('0xb'));var querystring=require(_0x57a0('0xc'));var Papa=require('papaparse');var Redis=require(_0x57a0('0xd'));var authService=require(_0x57a0('0xe'));var qs=require(_0x57a0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57a0('0x10'));var logger=require(_0x57a0('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x57a0('0x12'));var licenseUtil=require(_0x57a0('0x13'));var db=require(_0x57a0('0x14'))['db'];function respondWithStatusCode(_0x45241c,_0x1969b5){_0x1969b5=_0x1969b5||0xcc;return function(_0xc71b82){if(_0xc71b82){return _0x45241c[_0x57a0('0x15')](_0x1969b5);}return _0x45241c[_0x57a0('0x16')](_0x1969b5)['end']();};}function respondWithResult(_0x223934,_0x2cfa7e){_0x2cfa7e=_0x2cfa7e||0xc8;return function(_0x3d26ca){if(_0x3d26ca){return _0x223934[_0x57a0('0x16')](_0x2cfa7e)[_0x57a0('0x17')](_0x3d26ca);}};}function respondWithFilteredResult(_0xac911,_0x20c6f1){return function(_0x20c919){if(_0x20c919){var _0x5b6b5e=typeof _0x20c6f1[_0x57a0('0x18')]===_0x57a0('0x19')&&typeof _0x20c6f1[_0x57a0('0x1a')]===_0x57a0('0x19');var _0x2d5de8=_0x20c919[_0x57a0('0x1b')];var _0x4f50d3=_0x5b6b5e?0x0:_0x20c6f1['offset'];var _0xdfed25=_0x5b6b5e?_0x20c919[_0x57a0('0x1b')]:_0x20c6f1[_0x57a0('0x18')]+_0x20c6f1[_0x57a0('0x1a')];var _0x15bdc4;if(_0xdfed25>=_0x2d5de8){_0xdfed25=_0x2d5de8;_0x15bdc4=0xc8;}else{_0x15bdc4=0xce;}_0xac911[_0x57a0('0x16')](_0x15bdc4);return _0xac911['set'](_0x57a0('0x1c'),_0x4f50d3+'-'+_0xdfed25+'/'+_0x2d5de8)[_0x57a0('0x17')](_0x20c919);}return null;};}function patchUpdates(_0x376a96){return function(_0x28dabf){try{jsonpatch[_0x57a0('0x1d')](_0x28dabf,_0x376a96,!![]);}catch(_0x38b620){return BPromise[_0x57a0('0x1e')](_0x38b620);}return _0x28dabf['save']();};}function saveUpdates(_0x5d9f05,_0x298504){return function(_0x13ae14){if(_0x13ae14){return _0x13ae14[_0x57a0('0x1f')](_0x5d9f05)[_0x57a0('0x20')](function(_0x4ec056){return _0x4ec056;});}return null;};}function removeEntity(_0x5ca81c,_0x4b8f1c){return function(_0x233e68){if(_0x233e68){return _0x233e68[_0x57a0('0x21')]()['then'](function(){_0x5ca81c[_0x57a0('0x16')](0xcc)[_0x57a0('0x22')]();});}};}function handleEntityNotFound(_0x4a7ddf,_0x607108){return function(_0x2fe951){if(!_0x2fe951){_0x4a7ddf[_0x57a0('0x15')](0x194);}return _0x2fe951;};}function handleError(_0x414a64,_0xcc5a3b){_0xcc5a3b=_0xcc5a3b||0x1f4;return function(_0x4131f2){logger[_0x57a0('0x23')](_0x4131f2[_0x57a0('0x24')]);if(_0x4131f2['name']){delete _0x4131f2[_0x57a0('0x25')];}_0x414a64[_0x57a0('0x16')](_0xcc5a3b)[_0x57a0('0x26')](_0x4131f2);};}exports['index']=function(_0x530ff4,_0xd39751){var _0x4514ad={},_0x517128={},_0xc7a042={'count':0x0,'rows':[]};var _0x24ee79=_[_0x57a0('0x27')](db[_0x57a0('0x28')]['rawAttributes'],function(_0x8f27a5){return{'name':_0x8f27a5['fieldName'],'type':_0x8f27a5[_0x57a0('0x29')][_0x57a0('0x2a')]};});_0x517128[_0x57a0('0x2b')]=_[_0x57a0('0x27')](_0x24ee79,'name');_0x517128[_0x57a0('0x2c')]=_[_0x57a0('0x2d')](_0x530ff4[_0x57a0('0x2c')]);_0x517128[_0x57a0('0x2e')]=_[_0x57a0('0x2f')](_0x517128[_0x57a0('0x2b')],_0x517128[_0x57a0('0x2c')]);_0x4514ad['attributes']=_[_0x57a0('0x2f')](_0x517128[_0x57a0('0x2b')],qs[_0x57a0('0x30')](_0x530ff4[_0x57a0('0x2c')][_0x57a0('0x30')]));_0x4514ad[_0x57a0('0x31')]=_0x4514ad['attributes']['length']?_0x4514ad['attributes']:_0x517128[_0x57a0('0x2b')];if(!_0x530ff4[_0x57a0('0x2c')]['hasOwnProperty'](_0x57a0('0x32'))){_0x4514ad['limit']=qs['limit'](_0x530ff4[_0x57a0('0x2c')]['limit']);_0x4514ad[_0x57a0('0x18')]=qs['offset'](_0x530ff4[_0x57a0('0x2c')][_0x57a0('0x18')]);}_0x4514ad[_0x57a0('0x33')]=qs[_0x57a0('0x34')](_0x530ff4[_0x57a0('0x2c')][_0x57a0('0x34')]);_0x4514ad['where']=qs['filters'](_[_0x57a0('0x35')](_0x530ff4[_0x57a0('0x2c')],_0x517128[_0x57a0('0x2e')]),_0x24ee79);if(_0x530ff4[_0x57a0('0x2c')][_0x57a0('0x36')]){_0x4514ad[_0x57a0('0x37')]=_[_0x57a0('0x38')](_0x4514ad['where'],{'$or':_[_0x57a0('0x27')](_0x24ee79,function(_0x8775be){if(_0x8775be[_0x57a0('0x29')]!=='VIRTUAL'){var _0x2e1061={};_0x2e1061[_0x8775be[_0x57a0('0x25')]]={'$like':'%'+_0x530ff4[_0x57a0('0x2c')][_0x57a0('0x36')]+'%'};return _0x2e1061;}})});}_0x4514ad=_[_0x57a0('0x38')]({},_0x4514ad,_0x530ff4[_0x57a0('0x39')]);var _0x4c06e2={'where':_0x4514ad['where']};return db['Automation'][_0x57a0('0x1b')](_0x4c06e2)[_0x57a0('0x20')](function(_0x20ab87){_0xc7a042[_0x57a0('0x1b')]=_0x20ab87;if(_0x530ff4[_0x57a0('0x2c')][_0x57a0('0x3a')]){_0x4514ad[_0x57a0('0x3b')]=[{'all':!![]}];}return db[_0x57a0('0x28')][_0x57a0('0x3c')](_0x4514ad);})[_0x57a0('0x20')](function(_0x33348f){_0xc7a042[_0x57a0('0x3d')]=_0x33348f;return _0xc7a042;})[_0x57a0('0x20')](respondWithFilteredResult(_0xd39751,_0x4514ad))[_0x57a0('0x3e')](handleError(_0xd39751,null));};exports['show']=function(_0x2fc8d0,_0x3950b4){var _0xe6a915={'raw':![],'where':{'id':_0x2fc8d0[_0x57a0('0x3f')]['id']}},_0x35eefa={};_0x35eefa['model']=_[_0x57a0('0x2d')](db['Automation'][_0x57a0('0x40')]);_0x35eefa[_0x57a0('0x2c')]=_['keys'](_0x2fc8d0[_0x57a0('0x2c')]);_0x35eefa['filters']=_[_0x57a0('0x2f')](_0x35eefa[_0x57a0('0x2b')],_0x35eefa['query']);_0xe6a915[_0x57a0('0x31')]=_[_0x57a0('0x2f')](_0x35eefa[_0x57a0('0x2b')],qs[_0x57a0('0x30')](_0x2fc8d0[_0x57a0('0x2c')][_0x57a0('0x30')]));_0xe6a915[_0x57a0('0x31')]=_0xe6a915[_0x57a0('0x31')]['length']?_0xe6a915[_0x57a0('0x31')]:_0x35eefa[_0x57a0('0x2b')];if(_0x2fc8d0['query'][_0x57a0('0x3a')]){_0xe6a915['include']=[{'all':!![]}];}_0xe6a915=_[_0x57a0('0x38')]({},_0xe6a915,_0x2fc8d0[_0x57a0('0x39')]);return db['Automation'][_0x57a0('0x41')](_0xe6a915)[_0x57a0('0x20')](handleEntityNotFound(_0x3950b4,null))[_0x57a0('0x20')](respondWithResult(_0x3950b4,null))[_0x57a0('0x3e')](handleError(_0x3950b4,null));};exports[_0x57a0('0x42')]=function(_0x3dc387,_0x1d928e){return db['Automation'][_0x57a0('0x42')](_0x3dc387[_0x57a0('0x43')],{})[_0x57a0('0x20')](respondWithResult(_0x1d928e,0xc9))[_0x57a0('0x3e')](handleError(_0x1d928e,null));};exports[_0x57a0('0x1f')]=function(_0x17985a,_0x421c02){if(_0x17985a[_0x57a0('0x43')]['id']){delete _0x17985a[_0x57a0('0x43')]['id'];}return db[_0x57a0('0x28')][_0x57a0('0x41')]({'where':{'id':_0x17985a['params']['id']}})[_0x57a0('0x20')](handleEntityNotFound(_0x421c02,null))[_0x57a0('0x20')](saveUpdates(_0x17985a[_0x57a0('0x43')],null))[_0x57a0('0x20')](respondWithResult(_0x421c02,null))[_0x57a0('0x3e')](handleError(_0x421c02,null));};exports[_0x57a0('0x21')]=function(_0x5a7d8f,_0x6d0403){return db[_0x57a0('0x28')][_0x57a0('0x41')]({'where':{'id':_0x5a7d8f['params']['id']}})[_0x57a0('0x20')](handleEntityNotFound(_0x6d0403,null))[_0x57a0('0x20')](removeEntity(_0x6d0403,null))['catch'](handleError(_0x6d0403,null));};exports[_0x57a0('0x44')]=function(_0x3af7f8,_0x221d60,_0x51af68){return db[_0x57a0('0x45')][_0x57a0('0x41')]({'where':{'id':_0x3af7f8[_0x57a0('0x3f')]['id']}})[_0x57a0('0x20')](handleEntityNotFound(_0x221d60,null))[_0x57a0('0x20')](function(_0x2a34e7){if(_0x2a34e7){return _0x2a34e7[_0x57a0('0x44')](_0x3af7f8[_0x57a0('0x43')][_0x57a0('0x46')],_[_0x57a0('0x47')](_0x3af7f8[_0x57a0('0x43')],['ids','id'])||{});}})[_0x57a0('0x20')](respondWithResult(_0x221d60,null))[_0x57a0('0x3e')](handleError(_0x221d60,null));};exports['getConditions']=function(_0xbfa402,_0x515a6f,_0x1e2084){var _0x25c1aa={};var _0x1df5e2={};var _0x2e2ef5;var _0xe9323f;return db[_0x57a0('0x28')][_0x57a0('0x48')]({'where':{'id':_0xbfa402[_0x57a0('0x3f')]['id']}})[_0x57a0('0x20')](handleEntityNotFound(_0x515a6f,null))['then'](function(_0x1b88f7){if(_0x1b88f7){_0x2e2ef5=_0x1b88f7;_0x1df5e2[_0x57a0('0x2b')]=_[_0x57a0('0x2d')](db[_0x57a0('0x45')]['rawAttributes']);_0x1df5e2['query']=_[_0x57a0('0x2d')](_0xbfa402[_0x57a0('0x2c')]);_0x1df5e2[_0x57a0('0x2e')]=_[_0x57a0('0x2f')](_0x1df5e2[_0x57a0('0x2b')],_0x1df5e2[_0x57a0('0x2c')]);_0x25c1aa[_0x57a0('0x31')]=_['intersection'](_0x1df5e2['model'],qs['fields'](_0xbfa402[_0x57a0('0x2c')][_0x57a0('0x30')]));_0x25c1aa[_0x57a0('0x31')]=_0x25c1aa[_0x57a0('0x31')][_0x57a0('0x49')]?_0x25c1aa[_0x57a0('0x31')]:_0x1df5e2[_0x57a0('0x2b')];_0x25c1aa['order']=qs['sort'](_0xbfa402[_0x57a0('0x2c')][_0x57a0('0x34')]);_0x25c1aa['where']=qs[_0x57a0('0x2e')](_['pick'](_0xbfa402[_0x57a0('0x2c')],_0x1df5e2['filters']));if(_0xbfa402[_0x57a0('0x2c')][_0x57a0('0x36')]){_0x25c1aa['where']=_[_0x57a0('0x38')](_0x25c1aa[_0x57a0('0x37')],{'$or':_[_0x57a0('0x27')](_0x25c1aa['attributes'],function(_0x37c06c){var _0x776fc1={};_0x776fc1[_0x37c06c]={'$like':'%'+_0xbfa402['query']['filter']+'%'};return _0x776fc1;})});}_0x25c1aa=_[_0x57a0('0x38')]({},_0x25c1aa,_0xbfa402[_0x57a0('0x39')]);return _0x2e2ef5['getConditions'](_0x25c1aa);}})[_0x57a0('0x20')](function(_0x29a5d5){if(_0x29a5d5){_0xe9323f=_0x29a5d5['length'];if(!_0xbfa402[_0x57a0('0x2c')][_0x57a0('0x4a')](_0x57a0('0x32'))){_0x25c1aa['limit']=qs['limit'](_0xbfa402[_0x57a0('0x2c')][_0x57a0('0x1a')]);_0x25c1aa[_0x57a0('0x18')]=qs[_0x57a0('0x18')](_0xbfa402['query'][_0x57a0('0x18')]);}return _0x2e2ef5['getConditions'](_0x25c1aa);}})[_0x57a0('0x20')](function(_0x4d9516){if(_0x4d9516){return _0x4d9516?{'count':_0xe9323f,'rows':_0x4d9516}:null;}})[_0x57a0('0x20')](respondWithResult(_0x515a6f,null))[_0x57a0('0x3e')](handleError(_0x515a6f,null));};exports['addActions']=function(_0x14ce0f,_0x5c95a4,_0x5ede83){return db['Action'][_0x57a0('0x41')]({'where':{'id':_0x14ce0f['params']['id']}})[_0x57a0('0x20')](handleEntityNotFound(_0x5c95a4,null))['then'](function(_0x5950e0){if(_0x5950e0){return _0x5950e0[_0x57a0('0x4b')](_0x14ce0f[_0x57a0('0x43')][_0x57a0('0x46')],_[_0x57a0('0x47')](_0x14ce0f[_0x57a0('0x43')],['ids','id'])||{});}})[_0x57a0('0x20')](respondWithResult(_0x5c95a4,null))[_0x57a0('0x3e')](handleError(_0x5c95a4,null));};exports[_0x57a0('0x4c')]=function(_0x86eb80,_0xe1f232,_0x264cd1){var _0x34d5df={};var _0x59ef68={};var _0x5cab7f;var _0x32257f;return db[_0x57a0('0x28')][_0x57a0('0x48')]({'where':{'id':_0x86eb80[_0x57a0('0x3f')]['id']}})[_0x57a0('0x20')](handleEntityNotFound(_0xe1f232,null))['then'](function(_0x5b6a47){if(_0x5b6a47){_0x5cab7f=_0x5b6a47;_0x59ef68[_0x57a0('0x2b')]=_['keys'](db[_0x57a0('0x4d')]['rawAttributes']);_0x59ef68['query']=_[_0x57a0('0x2d')](_0x86eb80['query']);_0x59ef68[_0x57a0('0x2e')]=_[_0x57a0('0x2f')](_0x59ef68[_0x57a0('0x2b')],_0x59ef68[_0x57a0('0x2c')]);_0x34d5df['attributes']=_[_0x57a0('0x2f')](_0x59ef68[_0x57a0('0x2b')],qs['fields'](_0x86eb80[_0x57a0('0x2c')]['fields']));_0x34d5df[_0x57a0('0x31')]=_0x34d5df['attributes'][_0x57a0('0x49')]?_0x34d5df['attributes']:_0x59ef68[_0x57a0('0x2b')];_0x34d5df[_0x57a0('0x33')]=qs[_0x57a0('0x34')](_0x86eb80['query'][_0x57a0('0x34')]);_0x34d5df[_0x57a0('0x37')]=qs[_0x57a0('0x2e')](_[_0x57a0('0x35')](_0x86eb80[_0x57a0('0x2c')],_0x59ef68[_0x57a0('0x2e')]));if(_0x86eb80[_0x57a0('0x2c')]['filter']){_0x34d5df[_0x57a0('0x37')]=_[_0x57a0('0x38')](_0x34d5df[_0x57a0('0x37')],{'$or':_[_0x57a0('0x27')](_0x34d5df['attributes'],function(_0x9b3324){var _0x3d1b54={};_0x3d1b54[_0x9b3324]={'$like':'%'+_0x86eb80[_0x57a0('0x2c')]['filter']+'%'};return _0x3d1b54;})});}_0x34d5df=_[_0x57a0('0x38')]({},_0x34d5df,_0x86eb80[_0x57a0('0x39')]);return _0x5cab7f[_0x57a0('0x4c')](_0x34d5df);}})[_0x57a0('0x20')](function(_0xb8b727){if(_0xb8b727){_0x32257f=_0xb8b727[_0x57a0('0x49')];if(!_0x86eb80[_0x57a0('0x2c')][_0x57a0('0x4a')]('nolimit')){_0x34d5df[_0x57a0('0x1a')]=qs['limit'](_0x86eb80[_0x57a0('0x2c')][_0x57a0('0x1a')]);_0x34d5df['offset']=qs['offset'](_0x86eb80[_0x57a0('0x2c')][_0x57a0('0x18')]);}return _0x5cab7f[_0x57a0('0x4c')](_0x34d5df);}})[_0x57a0('0x20')](function(_0x323f8c){if(_0x323f8c){return _0x323f8c?{'count':_0x32257f,'rows':_0x323f8c}:null;}})[_0x57a0('0x20')](respondWithResult(_0xe1f232,null))['catch'](handleError(_0xe1f232,null));};
\ No newline at end of file
+var _0x3de3=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','addConditions','Condition','ids','getConditions','findOne','pick','filter','addActions','getActions','Action','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3de3,0xef));var _0x33de=function(_0x466328,_0x4ef08f){_0x466328=_0x466328-0x0;var _0x53dbcf=_0x3de3[_0x466328];return _0x53dbcf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33de('0x0'));var zipdir=require(_0x33de('0x1'));var jsonpatch=require(_0x33de('0x2'));var rp=require('request-promise');var moment=require(_0x33de('0x3'));var BPromise=require(_0x33de('0x4'));var Mustache=require('mustache');var util=require(_0x33de('0x5'));var path=require('path');var sox=require(_0x33de('0x6'));var csv=require(_0x33de('0x7'));var ejs=require(_0x33de('0x8'));var fs=require('fs');var fs_extra=require(_0x33de('0x9'));var _=require(_0x33de('0xa'));var squel=require(_0x33de('0xb'));var crypto=require(_0x33de('0xc'));var jsforce=require(_0x33de('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x33de('0x7'));var querystring=require(_0x33de('0xe'));var Papa=require(_0x33de('0xf'));var Redis=require(_0x33de('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33de('0x11'));var as=require(_0x33de('0x12'));var hardwareService=require(_0x33de('0x13'));var logger=require(_0x33de('0x14'))('api');var utils=require(_0x33de('0x15'));var config=require(_0x33de('0x16'));var licenseUtil=require(_0x33de('0x17'));var db=require(_0x33de('0x18'))['db'];function respondWithStatusCode(_0x2d67ac,_0x2efa63){_0x2efa63=_0x2efa63||0xcc;return function(_0xca9f96){if(_0xca9f96){return _0x2d67ac[_0x33de('0x19')](_0x2efa63);}return _0x2d67ac[_0x33de('0x1a')](_0x2efa63)['end']();};}function respondWithResult(_0x4b4060,_0x437dec){_0x437dec=_0x437dec||0xc8;return function(_0x3d9d14){if(_0x3d9d14){return _0x4b4060['status'](_0x437dec)['json'](_0x3d9d14);}};}function respondWithFilteredResult(_0x32f081,_0x186383){return function(_0x4feb08){if(_0x4feb08){var _0x282c1b=typeof _0x186383[_0x33de('0x1b')]==='undefined'&&typeof _0x186383[_0x33de('0x1c')]===_0x33de('0x1d');var _0x778619=_0x4feb08[_0x33de('0x1e')];var _0x2508de=_0x282c1b?0x0:_0x186383[_0x33de('0x1b')];var _0x4aa8ad=_0x282c1b?_0x4feb08['count']:_0x186383[_0x33de('0x1b')]+_0x186383[_0x33de('0x1c')];var _0x239871;if(_0x4aa8ad>=_0x778619){_0x4aa8ad=_0x778619;_0x239871=0xc8;}else{_0x239871=0xce;}_0x32f081[_0x33de('0x1a')](_0x239871);return _0x32f081[_0x33de('0x1f')]('Content-Range',_0x2508de+'-'+_0x4aa8ad+'/'+_0x778619)['json'](_0x4feb08);}return null;};}function patchUpdates(_0x1f8014){return function(_0x2b03ac){try{jsonpatch[_0x33de('0x20')](_0x2b03ac,_0x1f8014,!![]);}catch(_0x25ee7f){return BPromise[_0x33de('0x21')](_0x25ee7f);}return _0x2b03ac[_0x33de('0x22')]();};}function saveUpdates(_0x2d1f34,_0x39b4fe){return function(_0x510d3c){if(_0x510d3c){return _0x510d3c[_0x33de('0x23')](_0x2d1f34)[_0x33de('0x24')](function(_0x40808c){return _0x40808c;});}return null;};}function removeEntity(_0x7f85c3,_0x249b08){return function(_0x3b018c){if(_0x3b018c){return _0x3b018c[_0x33de('0x25')]()['then'](function(){_0x7f85c3['status'](0xcc)[_0x33de('0x26')]();});}};}function handleEntityNotFound(_0x268bd9,_0x1d8107){return function(_0x4f647a){if(!_0x4f647a){_0x268bd9[_0x33de('0x19')](0x194);}return _0x4f647a;};}function handleError(_0x2e99f8,_0x4c04e6){_0x4c04e6=_0x4c04e6||0x1f4;return function(_0x3451e2){logger[_0x33de('0x27')](_0x3451e2[_0x33de('0x28')]);if(_0x3451e2['name']){delete _0x3451e2[_0x33de('0x29')];}_0x2e99f8[_0x33de('0x1a')](_0x4c04e6)[_0x33de('0x2a')](_0x3451e2);};}exports[_0x33de('0x2b')]=function(_0x267863,_0x37d80f){var _0x570bc6={},_0x4d3218={},_0x3ae410={'count':0x0,'rows':[]};var _0xc0dc9f=_[_0x33de('0x2c')](db[_0x33de('0x2d')][_0x33de('0x2e')],function(_0x2076ab){return{'name':_0x2076ab[_0x33de('0x2f')],'type':_0x2076ab[_0x33de('0x30')][_0x33de('0x31')]};});_0x4d3218[_0x33de('0x32')]=_[_0x33de('0x2c')](_0xc0dc9f,_0x33de('0x29'));_0x4d3218[_0x33de('0x33')]=_['keys'](_0x267863[_0x33de('0x33')]);_0x4d3218[_0x33de('0x34')]=_[_0x33de('0x35')](_0x4d3218[_0x33de('0x32')],_0x4d3218[_0x33de('0x33')]);_0x570bc6[_0x33de('0x36')]=_['intersection'](_0x4d3218[_0x33de('0x32')],qs[_0x33de('0x37')](_0x267863['query'][_0x33de('0x37')]));_0x570bc6['attributes']=_0x570bc6[_0x33de('0x36')][_0x33de('0x38')]?_0x570bc6[_0x33de('0x36')]:_0x4d3218[_0x33de('0x32')];if(!_0x267863[_0x33de('0x33')][_0x33de('0x39')](_0x33de('0x3a'))){_0x570bc6[_0x33de('0x1c')]=qs['limit'](_0x267863['query'][_0x33de('0x1c')]);_0x570bc6[_0x33de('0x1b')]=qs[_0x33de('0x1b')](_0x267863[_0x33de('0x33')]['offset']);}_0x570bc6[_0x33de('0x3b')]=qs[_0x33de('0x3c')](_0x267863[_0x33de('0x33')]['sort']);_0x570bc6['where']=qs[_0x33de('0x34')](_['pick'](_0x267863[_0x33de('0x33')],_0x4d3218[_0x33de('0x34')]),_0xc0dc9f);if(_0x267863[_0x33de('0x33')]['filter']){_0x570bc6[_0x33de('0x3d')]=_[_0x33de('0x3e')](_0x570bc6[_0x33de('0x3d')],{'$or':_[_0x33de('0x2c')](_0xc0dc9f,function(_0x3a88f8){if(_0x3a88f8[_0x33de('0x30')]!==_0x33de('0x3f')){var _0x322d44={};_0x322d44[_0x3a88f8[_0x33de('0x29')]]={'$like':'%'+_0x267863[_0x33de('0x33')]['filter']+'%'};return _0x322d44;}})});}_0x570bc6=_[_0x33de('0x3e')]({},_0x570bc6,_0x267863[_0x33de('0x40')]);var _0x3c0bc3={'where':_0x570bc6[_0x33de('0x3d')]};return db[_0x33de('0x2d')][_0x33de('0x1e')](_0x3c0bc3)[_0x33de('0x24')](function(_0x558eec){_0x3ae410['count']=_0x558eec;if(_0x267863[_0x33de('0x33')][_0x33de('0x41')]){_0x570bc6[_0x33de('0x42')]=[{'all':!![]}];}return db['Automation'][_0x33de('0x43')](_0x570bc6);})[_0x33de('0x24')](function(_0xb3cb83){_0x3ae410[_0x33de('0x44')]=_0xb3cb83;return _0x3ae410;})[_0x33de('0x24')](respondWithFilteredResult(_0x37d80f,_0x570bc6))['catch'](handleError(_0x37d80f,null));};exports[_0x33de('0x45')]=function(_0x2be844,_0x4e8296){var _0x5671c3={'raw':![],'where':{'id':_0x2be844[_0x33de('0x46')]['id']}},_0x3baa49={};_0x3baa49[_0x33de('0x32')]=_[_0x33de('0x47')](db[_0x33de('0x2d')][_0x33de('0x2e')]);_0x3baa49['query']=_['keys'](_0x2be844['query']);_0x3baa49[_0x33de('0x34')]=_[_0x33de('0x35')](_0x3baa49['model'],_0x3baa49[_0x33de('0x33')]);_0x5671c3[_0x33de('0x36')]=_[_0x33de('0x35')](_0x3baa49[_0x33de('0x32')],qs[_0x33de('0x37')](_0x2be844[_0x33de('0x33')][_0x33de('0x37')]));_0x5671c3[_0x33de('0x36')]=_0x5671c3[_0x33de('0x36')][_0x33de('0x38')]?_0x5671c3[_0x33de('0x36')]:_0x3baa49[_0x33de('0x32')];if(_0x2be844['query'][_0x33de('0x41')]){_0x5671c3[_0x33de('0x42')]=[{'all':!![]}];}_0x5671c3=_[_0x33de('0x3e')]({},_0x5671c3,_0x2be844[_0x33de('0x40')]);return db[_0x33de('0x2d')]['find'](_0x5671c3)[_0x33de('0x24')](handleEntityNotFound(_0x4e8296,null))['then'](respondWithResult(_0x4e8296,null))[_0x33de('0x48')](handleError(_0x4e8296,null));};exports[_0x33de('0x49')]=function(_0x3cf8e5,_0x403089){return db[_0x33de('0x2d')][_0x33de('0x49')](_0x3cf8e5[_0x33de('0x4a')],{})[_0x33de('0x24')](respondWithResult(_0x403089,0xc9))[_0x33de('0x48')](handleError(_0x403089,null));};exports['update']=function(_0xa33f46,_0x47e4ab){if(_0xa33f46['body']['id']){delete _0xa33f46[_0x33de('0x4a')]['id'];}return db['Automation'][_0x33de('0x4b')]({'where':{'id':_0xa33f46[_0x33de('0x46')]['id']}})['then'](handleEntityNotFound(_0x47e4ab,null))[_0x33de('0x24')](saveUpdates(_0xa33f46[_0x33de('0x4a')],null))['then'](respondWithResult(_0x47e4ab,null))[_0x33de('0x48')](handleError(_0x47e4ab,null));};exports[_0x33de('0x25')]=function(_0x3b2c09,_0x4598fb){return db[_0x33de('0x2d')][_0x33de('0x4b')]({'where':{'id':_0x3b2c09[_0x33de('0x46')]['id']}})[_0x33de('0x24')](handleEntityNotFound(_0x4598fb,null))[_0x33de('0x24')](removeEntity(_0x4598fb,null))['catch'](handleError(_0x4598fb,null));};exports[_0x33de('0x4c')]=function(_0x5b3fdd,_0x41fbe5,_0x144b0e){return db[_0x33de('0x4d')][_0x33de('0x4b')]({'where':{'id':_0x5b3fdd['params']['id']}})['then'](handleEntityNotFound(_0x41fbe5,null))[_0x33de('0x24')](function(_0x275a13){if(_0x275a13){return _0x275a13[_0x33de('0x4c')](_0x5b3fdd[_0x33de('0x4a')][_0x33de('0x4e')],_['omit'](_0x5b3fdd[_0x33de('0x4a')],['ids','id'])||{});}})['then'](respondWithResult(_0x41fbe5,null))[_0x33de('0x48')](handleError(_0x41fbe5,null));};exports[_0x33de('0x4f')]=function(_0x4d5ff4,_0x40785b,_0x370350){var _0x13e248={};var _0xb3cc75={};var _0x361f9b;var _0x357af3;return db[_0x33de('0x2d')][_0x33de('0x50')]({'where':{'id':_0x4d5ff4[_0x33de('0x46')]['id']}})[_0x33de('0x24')](handleEntityNotFound(_0x40785b,null))[_0x33de('0x24')](function(_0xf066f5){if(_0xf066f5){_0x361f9b=_0xf066f5;_0xb3cc75['model']=_['keys'](db[_0x33de('0x4d')][_0x33de('0x2e')]);_0xb3cc75[_0x33de('0x33')]=_[_0x33de('0x47')](_0x4d5ff4[_0x33de('0x33')]);_0xb3cc75['filters']=_['intersection'](_0xb3cc75[_0x33de('0x32')],_0xb3cc75['query']);_0x13e248['attributes']=_[_0x33de('0x35')](_0xb3cc75[_0x33de('0x32')],qs[_0x33de('0x37')](_0x4d5ff4[_0x33de('0x33')][_0x33de('0x37')]));_0x13e248[_0x33de('0x36')]=_0x13e248[_0x33de('0x36')][_0x33de('0x38')]?_0x13e248[_0x33de('0x36')]:_0xb3cc75[_0x33de('0x32')];_0x13e248[_0x33de('0x3b')]=qs['sort'](_0x4d5ff4[_0x33de('0x33')]['sort']);_0x13e248['where']=qs[_0x33de('0x34')](_[_0x33de('0x51')](_0x4d5ff4['query'],_0xb3cc75['filters']));if(_0x4d5ff4['query'][_0x33de('0x52')]){_0x13e248['where']=_[_0x33de('0x3e')](_0x13e248[_0x33de('0x3d')],{'$or':_[_0x33de('0x2c')](_0x13e248[_0x33de('0x36')],function(_0x58b23f){var _0x26f002={};_0x26f002[_0x58b23f]={'$like':'%'+_0x4d5ff4[_0x33de('0x33')][_0x33de('0x52')]+'%'};return _0x26f002;})});}_0x13e248=_[_0x33de('0x3e')]({},_0x13e248,_0x4d5ff4['options']);return _0x361f9b[_0x33de('0x4f')](_0x13e248);}})[_0x33de('0x24')](function(_0x1d9de9){if(_0x1d9de9){_0x357af3=_0x1d9de9[_0x33de('0x38')];if(!_0x4d5ff4['query'][_0x33de('0x39')]('nolimit')){_0x13e248[_0x33de('0x1c')]=qs['limit'](_0x4d5ff4['query'][_0x33de('0x1c')]);_0x13e248[_0x33de('0x1b')]=qs[_0x33de('0x1b')](_0x4d5ff4[_0x33de('0x33')][_0x33de('0x1b')]);}return _0x361f9b['getConditions'](_0x13e248);}})[_0x33de('0x24')](function(_0x445874){if(_0x445874){return _0x445874?{'count':_0x357af3,'rows':_0x445874}:null;}})[_0x33de('0x24')](respondWithResult(_0x40785b,null))['catch'](handleError(_0x40785b,null));};exports[_0x33de('0x53')]=function(_0x3229bd,_0x2b036c,_0x3690b2){return db['Action'][_0x33de('0x4b')]({'where':{'id':_0x3229bd[_0x33de('0x46')]['id']}})[_0x33de('0x24')](handleEntityNotFound(_0x2b036c,null))[_0x33de('0x24')](function(_0xee493a){if(_0xee493a){return _0xee493a['addActions'](_0x3229bd[_0x33de('0x4a')][_0x33de('0x4e')],_['omit'](_0x3229bd[_0x33de('0x4a')],[_0x33de('0x4e'),'id'])||{});}})[_0x33de('0x24')](respondWithResult(_0x2b036c,null))['catch'](handleError(_0x2b036c,null));};exports[_0x33de('0x54')]=function(_0x3aa2b8,_0x573dfb,_0x1631de){var _0x2ce803={};var _0x118fa7={};var _0x396f7f;var _0x2ba442;return db[_0x33de('0x2d')][_0x33de('0x50')]({'where':{'id':_0x3aa2b8['params']['id']}})[_0x33de('0x24')](handleEntityNotFound(_0x573dfb,null))[_0x33de('0x24')](function(_0xa26328){if(_0xa26328){_0x396f7f=_0xa26328;_0x118fa7[_0x33de('0x32')]=_[_0x33de('0x47')](db[_0x33de('0x55')][_0x33de('0x2e')]);_0x118fa7[_0x33de('0x33')]=_[_0x33de('0x47')](_0x3aa2b8[_0x33de('0x33')]);_0x118fa7['filters']=_['intersection'](_0x118fa7['model'],_0x118fa7['query']);_0x2ce803[_0x33de('0x36')]=_['intersection'](_0x118fa7['model'],qs[_0x33de('0x37')](_0x3aa2b8[_0x33de('0x33')][_0x33de('0x37')]));_0x2ce803['attributes']=_0x2ce803[_0x33de('0x36')][_0x33de('0x38')]?_0x2ce803['attributes']:_0x118fa7[_0x33de('0x32')];_0x2ce803[_0x33de('0x3b')]=qs[_0x33de('0x3c')](_0x3aa2b8[_0x33de('0x33')][_0x33de('0x3c')]);_0x2ce803['where']=qs[_0x33de('0x34')](_[_0x33de('0x51')](_0x3aa2b8[_0x33de('0x33')],_0x118fa7[_0x33de('0x34')]));if(_0x3aa2b8[_0x33de('0x33')][_0x33de('0x52')]){_0x2ce803['where']=_['merge'](_0x2ce803[_0x33de('0x3d')],{'$or':_[_0x33de('0x2c')](_0x2ce803[_0x33de('0x36')],function(_0x3ec72a){var _0x1d767b={};_0x1d767b[_0x3ec72a]={'$like':'%'+_0x3aa2b8[_0x33de('0x33')][_0x33de('0x52')]+'%'};return _0x1d767b;})});}_0x2ce803=_[_0x33de('0x3e')]({},_0x2ce803,_0x3aa2b8[_0x33de('0x40')]);return _0x396f7f[_0x33de('0x54')](_0x2ce803);}})['then'](function(_0xc8116f){if(_0xc8116f){_0x2ba442=_0xc8116f[_0x33de('0x38')];if(!_0x3aa2b8[_0x33de('0x33')][_0x33de('0x39')](_0x33de('0x3a'))){_0x2ce803[_0x33de('0x1c')]=qs[_0x33de('0x1c')](_0x3aa2b8[_0x33de('0x33')][_0x33de('0x1c')]);_0x2ce803['offset']=qs['offset'](_0x3aa2b8[_0x33de('0x33')][_0x33de('0x1b')]);}return _0x396f7f['getActions'](_0x2ce803);}})['then'](function(_0x4bc857){if(_0x4bc857){return _0x4bc857?{'count':_0x2ba442,'rows':_0x4bc857}:null;}})[_0x33de('0x24')](respondWithResult(_0x573dfb,null))[_0x33de('0x48')](handleError(_0x573dfb,null));};
\ No newline at end of file
index de759c8..956d1c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90ef=['request-promise','path','rimraf','../../config/environment','exports','define','tools_automations','lodash','api','bluebird'];(function(_0xcc4043,_0x40db31){var _0x3a8604=function(_0x550c3e){while(--_0x550c3e){_0xcc4043['push'](_0xcc4043['shift']());}};_0x3a8604(++_0x40db31);}(_0x90ef,0x179));var _0xf90e=function(_0xb29fa7,_0xaf074){_0xb29fa7=_0xb29fa7-0x0;var _0x1ff888=_0x90ef[_0xb29fa7];return _0x1ff888;};'use strict';var _=require(_0xf90e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf90e('0x1'));var moment=require('moment');var BPromise=require(_0xf90e('0x2'));var rp=require(_0xf90e('0x3'));var fs=require('fs');var path=require(_0xf90e('0x4'));var rimraf=require(_0xf90e('0x5'));var config=require(_0xf90e('0x6'));var attributes=require('./automation.attributes');module[_0xf90e('0x7')]=function(_0x34ce68,_0x3ff98a){return _0x34ce68[_0xf90e('0x8')]('Automation',attributes,{'tableName':_0xf90e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1b9=['bluebird','path','rimraf','../../config/environment','exports','Automation','tools_automations','util','../../config/logger','api','moment'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xa1b9,0x125));var _0x9a1b=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa1b9[_0x8de54f];return _0x14cba4;};'use strict';var _=require('lodash');var util=require(_0x9a1b('0x0'));var logger=require(_0x9a1b('0x1'))(_0x9a1b('0x2'));var moment=require(_0x9a1b('0x3'));var BPromise=require(_0x9a1b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a1b('0x5'));var rimraf=require(_0x9a1b('0x6'));var config=require(_0x9a1b('0x7'));var attributes=require('./automation.attributes');module[_0x9a1b('0x8')]=function(_0x143712,_0x459eac){return _0x143712['define'](_0x9a1b('0x9'),attributes,{'tableName':_0x9a1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 948f671..2c3576b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5713=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','Automation,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x581935,_0xafd0f7){var _0x4f890a=function(_0x37d231){while(--_0x37d231){_0x581935['push'](_0x581935['shift']());}};_0x4f890a(++_0xafd0f7);}(_0x5713,0x1c7));var _0x3571=function(_0x42f081,_0x82d37f){_0x42f081=_0x42f081-0x0;var _0xafc39d=_0x5713[_0x42f081];return _0xafc39d;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var moment=require('moment');var BPromise=require(_0x3571('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3571('0x3'));var db=require(_0x3571('0x4'))['db'];var utils=require(_0x3571('0x5'));var logger=require(_0x3571('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3571('0x7'));var client=jayson[_0x3571('0x8')][_0x3571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432a48,_0x3a6f29,_0x1f8f0f){return new BPromise(function(_0x48b06d,_0x358ba1){return client[_0x3571('0xa')](_0x432a48,_0x1f8f0f)[_0x3571('0xb')](function(_0x288fc8){logger[_0x3571('0xc')]('Automation,\x20%s,\x20%s',_0x3a6f29,'request\x20sent');logger[_0x3571('0xd')](_0x3571('0xe'),_0x3a6f29,_0x3571('0xf'),JSON['stringify'](_0x288fc8));if(_0x288fc8['error']){if(_0x288fc8['error']['code']===0x1f4){logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x358ba1(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x48b06d(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}else{logger[_0x3571('0xc')](_0x3571('0x11'),_0x3a6f29,_0x3571('0xf'));_0x48b06d(_0x288fc8[_0x3571('0x13')]['message']);}})['catch'](function(_0x48c77e){logger[_0x3571('0x10')]('Automation,\x20%s,\x20%s',_0x3a6f29,_0x48c77e);_0x358ba1(_0x48c77e);});});}
\ No newline at end of file
+var _0x0a48=['request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x5e3a88,_0x147afd){var _0x1364fb=function(_0x1feb1b){while(--_0x1feb1b){_0x5e3a88['push'](_0x5e3a88['shift']());}};_0x1364fb(++_0x147afd);}(_0x0a48,0x95));var _0x80a4=function(_0x16884c,_0x508220){_0x16884c=_0x16884c-0x0;var _0x1c1d13=_0x0a48[_0x16884c];return _0x1c1d13;};'use strict';var _=require(_0x80a4('0x0'));var util=require(_0x80a4('0x1'));var moment=require('moment');var BPromise=require(_0x80a4('0x2'));var rs=require(_0x80a4('0x3'));var fs=require('fs');var Redis=require(_0x80a4('0x4'));var db=require(_0x80a4('0x5'))['db'];var utils=require(_0x80a4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x80a4('0x7'));var jayson=require(_0x80a4('0x8'));var client=jayson[_0x80a4('0x9')][_0x80a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3ac0,_0x3ccc33,_0x55bd77){return new BPromise(function(_0x5c7c37,_0x338d47){return client[_0x80a4('0xb')](_0x5f3ac0,_0x55bd77)['then'](function(_0x5dfe4a){logger[_0x80a4('0xc')](_0x80a4('0xd'),_0x3ccc33,_0x80a4('0xe'));logger[_0x80a4('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x3ccc33,_0x80a4('0xe'),JSON['stringify'](_0x5dfe4a));if(_0x5dfe4a[_0x80a4('0x10')]){if(_0x5dfe4a['error'][_0x80a4('0x11')]===0x1f4){logger[_0x80a4('0x10')]('Automation,\x20%s,\x20%s',_0x3ccc33,_0x5dfe4a[_0x80a4('0x10')][_0x80a4('0x12')]);return _0x338d47(_0x5dfe4a[_0x80a4('0x10')][_0x80a4('0x12')]);}logger[_0x80a4('0x10')](_0x80a4('0xd'),_0x3ccc33,_0x5dfe4a[_0x80a4('0x10')]['message']);return _0x5c7c37(_0x5dfe4a['error'][_0x80a4('0x12')]);}else{logger[_0x80a4('0xc')](_0x80a4('0xd'),_0x3ccc33,_0x80a4('0xe'));_0x5c7c37(_0x5dfe4a['result'][_0x80a4('0x12')]);}})[_0x80a4('0x13')](function(_0x38ba44){logger[_0x80a4('0x10')](_0x80a4('0xd'),_0x3ccc33,_0x38ba44);_0x338d47(_0x38ba44);});});}
\ No newline at end of file
index f923209..8a843c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeef=['../../components/auth/service','../../components/interaction/service','./automation.controller','index','get','isAuthenticated','show','getConditions','getActions','post','create','addConditions','addActions','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xaeef,0x14a));var _0xfaee=function(_0x5f169f,_0x4f64a7){_0x5f169f=_0x5f169f-0x0;var _0xbcd0dc=_0xaeef[_0x5f169f];return _0xbcd0dc;};'use strict';var multer=require(_0xfaee('0x0'));var util=require(_0xfaee('0x1'));var path=require(_0xfaee('0x2'));var timeout=require('connect-timeout');var express=require(_0xfaee('0x3'));var router=express[_0xfaee('0x4')]();var fs_extra=require(_0xfaee('0x5'));var auth=require(_0xfaee('0x6'));var interaction=require(_0xfaee('0x7'));var config=require('../../config/environment');var controller=require(_0xfaee('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfaee('0x9')]);router[_0xfaee('0xa')]('/:id',auth[_0xfaee('0xb')](),controller[_0xfaee('0xc')]);router[_0xfaee('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xfaee('0xd')]);router[_0xfaee('0xa')]('/:id/actions',auth[_0xfaee('0xb')](),controller[_0xfaee('0xe')]);router[_0xfaee('0xf')]('/',auth[_0xfaee('0xb')](),controller[_0xfaee('0x10')]);router['post']('/:id/conditions',auth[_0xfaee('0xb')](),controller[_0xfaee('0x11')]);router[_0xfaee('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0xfaee('0x12')]);router[_0xfaee('0x13')](_0xfaee('0x14'),auth[_0xfaee('0xb')](),controller[_0xfaee('0x15')]);router[_0xfaee('0x16')](_0xfaee('0x14'),auth[_0xfaee('0xb')](),controller['destroy']);module[_0xfaee('0x17')]=router;
\ No newline at end of file
+var _0x8558=['post','create','addActions','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x5d917c,_0x7846a){var _0x4e850f=function(_0x5409f2){while(--_0x5409f2){_0x5d917c['push'](_0x5d917c['shift']());}};_0x4e850f(++_0x7846a);}(_0x8558,0x103));var _0x8855=function(_0x3a9406,_0x3aa098){_0x3a9406=_0x3a9406-0x0;var _0x2d5eac=_0x8558[_0x3a9406];return _0x2d5eac;};'use strict';var multer=require('multer');var util=require(_0x8855('0x0'));var path=require(_0x8855('0x1'));var timeout=require(_0x8855('0x2'));var express=require(_0x8855('0x3'));var router=express[_0x8855('0x4')]();var fs_extra=require(_0x8855('0x5'));var auth=require(_0x8855('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8855('0x7'));var controller=require('./automation.controller');router[_0x8855('0x8')]('/',auth['isAuthenticated'](),controller[_0x8855('0x9')]);router[_0x8855('0x8')](_0x8855('0xa'),auth[_0x8855('0xb')](),controller[_0x8855('0xc')]);router[_0x8855('0x8')](_0x8855('0xd'),auth['isAuthenticated'](),controller[_0x8855('0xe')]);router[_0x8855('0x8')](_0x8855('0xf'),auth[_0x8855('0xb')](),controller[_0x8855('0x10')]);router[_0x8855('0x11')]('/',auth[_0x8855('0xb')](),controller[_0x8855('0x12')]);router['post'](_0x8855('0xd'),auth[_0x8855('0xb')](),controller['addConditions']);router[_0x8855('0x11')](_0x8855('0xf'),auth['isAuthenticated'](),controller[_0x8855('0x13')]);router[_0x8855('0x14')](_0x8855('0xa'),auth[_0x8855('0xb')](),controller['update']);router[_0x8855('0x15')]('/:id',auth[_0x8855('0xb')](),controller['destroy']);module[_0x8855('0x16')]=router;
\ No newline at end of file
index e2afe8b..e5df0bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d91=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','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)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\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','ENUM','ivr'];(function(_0x943727,_0x227a5a){var _0x1a638c=function(_0x1bcbe3){while(--_0x1bcbe3){_0x943727['push'](_0x943727['shift']());}};_0x1a638c(++_0x227a5a);}(_0x1d91,0x150));var _0x11d9=function(_0x4c7700,_0x516cb4){_0x4c7700=_0x4c7700-0x0;var _0x35b822=_0x1d91[_0x4c7700];return _0x35b822;};'use strict';var Sequelize=require(_0x11d9('0x0'));module[_0x11d9('0x1')]={'name':{'type':Sequelize[_0x11d9('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x11d9('0x3')](_0x11d9('0x4')),'allowNull':![],'defaultValue':_0x11d9('0x4')},'description':{'type':Sequelize[_0x11d9('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x11d9('0x5')},'limitCalls':{'type':Sequelize[_0x11d9('0x6')](0x4)[_0x11d9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x11d9('0x6')](0x3)[_0x11d9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11d9('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x11d9('0x6')](0x3)[_0x11d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x11d9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11d9('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11d9('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x11d9('0x6')](0x5)[_0x11d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11d9('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11d9('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x11d9('0x6')](0x5)[_0x11d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x11d9('0x6')](0x3)[_0x11d9('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x11d9('0xc')},'dialTimezone':{'type':Sequelize[_0x11d9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x11d9('0x3')](_0x11d9('0xd'),_0x11d9('0xe'),_0x11d9('0xf')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x11d9('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x11d9('0x10')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x11d9('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x11d9('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x11d9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11d9('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0x11d9('0x6')](0x9)[_0x11d9('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x11d9('0x6')](0x9)[_0x11d9('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x11d9('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x11d9('0x13')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x11d9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x11d9('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x11d9('0x6')](0x9)[_0x11d9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11d9('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0x11d9('0x3')](_0x11d9('0x16'),_0x11d9('0x17')),'defaultValue':_0x11d9('0x16')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x11d9('0x6')](0x3)[_0x11d9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x11d9('0x6')](0x3)[_0x11d9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x11d9('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x11d9('0x6')](0x3)[_0x11d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x11d9('0x6')](0x5)[_0x11d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11d9('0x19')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11d9('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0x11d9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x11d9('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11d9('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x11d9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11d9('0x1c')},'dialMachineMaxRetry':{'type':Sequelize[_0x11d9('0x6')](0x3)[_0x11d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x11d9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x11d9('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11d9('0x1d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11d9('0x1e')}};
\ No newline at end of file
+var _0xa8a9=['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','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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)','#AMD\x20Maximum\x20Word\x20Length','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4634bd,_0x2a9b68){var _0x549413=function(_0xfdea17){while(--_0xfdea17){_0x4634bd['push'](_0x4634bd['shift']());}};_0x549413(++_0x2a9b68);}(_0xa8a9,0x135));var _0x9a8a=function(_0x3ddee1,_0x43be79){_0x3ddee1=_0x3ddee1-0x0;var _0x27a6fe=_0xa8a9[_0x3ddee1];return _0x27a6fe;};'use strict';var Sequelize=require(_0x9a8a('0x0'));module[_0x9a8a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x9a8a('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x9a8a('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9a8a('0x4')],'defaultValue':0x0,'comment':_0x9a8a('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x9a8a('0x6')](0x3)[_0x9a8a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a8a('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9a8a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a8a('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9a8a('0x6')](0x5)[_0x9a8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a8a('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9a8a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a8a('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9a8a('0x6')](0x5)[_0x9a8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a8a('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a8a('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9a8a('0x6')](0x3)[_0x9a8a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9a8a('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x9a8a('0x2')](_0x9a8a('0xf'),_0x9a8a('0x10'),_0x9a8a('0x11')),'defaultValue':_0x9a8a('0xf')},'dialAMDActive':{'type':Sequelize[_0x9a8a('0x4')],'defaultValue':0x0,'comment':_0x9a8a('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x9a8a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9a8a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x9a8a('0x6')](0x9)[_0x9a8a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9a8a('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9a8a('0x6')](0x9)[_0x9a8a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9a8a('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9a8a('0x6')](0x9)[_0x9a8a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9a8a('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x9a8a('0x6')](0x9)[_0x9a8a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9a8a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9a8a('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9a8a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9a8a('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9a8a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9a8a('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9a8a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9a8a('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9a8a('0x2')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x9a8a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9a8a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9a8a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a8a('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x9a8a('0x6')](0x3)[_0x9a8a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x9a8a('0x6')](0x5)[_0x9a8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a8a('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9a8a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a8a('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9a8a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x9a8a('0x6')](0x3)[_0x9a8a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a8a('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9a8a('0x6')](0x5)[_0x9a8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a8a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9a8a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a8a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9a8a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a8a('0x21')}};
\ No newline at end of file
index 88fffc7..95aa2af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca3c=['cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','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','save','update','then','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','catch','params','rawAttributes','omit','updatedAt','createdAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','from'];(function(_0xc3c718,_0x39ae2c){var _0x1b03bd=function(_0xd388e0){while(--_0xd388e0){_0xc3c718['push'](_0xc3c718['shift']());}};_0x1b03bd(++_0x39ae2c);}(_0xca3c,0x99));var _0xcca3=function(_0x138e5b,_0x2a0948){_0x138e5b=_0x138e5b-0x0;var _0x4be587=_0xca3c[_0x138e5b];return _0x4be587;};'use strict';var emlformat=require(_0xcca3('0x0'));var rimraf=require(_0xcca3('0x1'));var zipdir=require(_0xcca3('0x2'));var jsonpatch=require(_0xcca3('0x3'));var rp=require('request-promise');var moment=require(_0xcca3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcca3('0x5'));var util=require(_0xcca3('0x6'));var path=require('path');var sox=require(_0xcca3('0x7'));var csv=require(_0xcca3('0x8'));var ejs=require(_0xcca3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcca3('0xa'));var crypto=require(_0xcca3('0xb'));var jsforce=require(_0xcca3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcca3('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcca3('0xd'));var authService=require(_0xcca3('0xe'));var qs=require(_0xcca3('0xf'));var as=require(_0xcca3('0x10'));var hardwareService=require(_0xcca3('0x11'));var logger=require(_0xcca3('0x12'))(_0xcca3('0x13'));var utils=require(_0xcca3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcca3('0x15'));var db=require(_0xcca3('0x16'))['db'];function respondWithStatusCode(_0xbbbee8,_0x3f7bc4){_0x3f7bc4=_0x3f7bc4||0xcc;return function(_0x5c7b44){if(_0x5c7b44){return _0xbbbee8[_0xcca3('0x17')](_0x3f7bc4);}return _0xbbbee8[_0xcca3('0x18')](_0x3f7bc4)[_0xcca3('0x19')]();};}function respondWithResult(_0x519caa,_0x3fce15){_0x3fce15=_0x3fce15||0xc8;return function(_0x1fd984){if(_0x1fd984){return _0x519caa[_0xcca3('0x18')](_0x3fce15)['json'](_0x1fd984);}};}function respondWithFilteredResult(_0x3d2b38,_0x21df3f){return function(_0x46a0bb){if(_0x46a0bb){var _0x362765=typeof _0x21df3f[_0xcca3('0x1a')]===_0xcca3('0x1b')&&typeof _0x21df3f[_0xcca3('0x1c')]===_0xcca3('0x1b');var _0x414978=_0x46a0bb[_0xcca3('0x1d')];var _0x396508=_0x362765?0x0:_0x21df3f[_0xcca3('0x1a')];var _0x1bd25d=_0x362765?_0x46a0bb[_0xcca3('0x1d')]:_0x21df3f['offset']+_0x21df3f[_0xcca3('0x1c')];var _0x16d011;if(_0x1bd25d>=_0x414978){_0x1bd25d=_0x414978;_0x16d011=0xc8;}else{_0x16d011=0xce;}_0x3d2b38['status'](_0x16d011);return _0x3d2b38[_0xcca3('0x1e')]('Content-Range',_0x396508+'-'+_0x1bd25d+'/'+_0x414978)[_0xcca3('0x1f')](_0x46a0bb);}return null;};}function patchUpdates(_0x545ce7){return function(_0x4c9f98){try{jsonpatch['apply'](_0x4c9f98,_0x545ce7,!![]);}catch(_0x2c4604){return BPromise['reject'](_0x2c4604);}return _0x4c9f98[_0xcca3('0x20')]();};}function saveUpdates(_0x5c3bfd,_0x5acffd){return function(_0x56f97b){if(_0x56f97b){return _0x56f97b[_0xcca3('0x21')](_0x5c3bfd)[_0xcca3('0x22')](function(_0x427feb){return _0x427feb;});}return null;};}function removeEntity(_0x386743,_0x1e282d){return function(_0x2d4314){if(_0x2d4314){return _0x2d4314['destroy']()[_0xcca3('0x22')](function(){var _0x463a93=_0x2d4314['get']({'plain':!![]});var _0x559b48=_0xcca3('0x23');return db[_0xcca3('0x24')][_0xcca3('0x25')]({'where':{'type':_0x559b48,'resourceId':_0x463a93['id']}})['then'](function(){return _0x2d4314;});})[_0xcca3('0x22')](function(){_0x386743['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a1ec3,_0x59a756){return function(_0x5909a2){if(!_0x5909a2){_0x4a1ec3[_0xcca3('0x17')](0x194);}return _0x5909a2;};}function handleError(_0x40be5a,_0x4f0a16){_0x4f0a16=_0x4f0a16||0x1f4;return function(_0x47e638){logger[_0xcca3('0x26')](_0x47e638[_0xcca3('0x27')]);if(_0x47e638[_0xcca3('0x28')]){delete _0x47e638[_0xcca3('0x28')];}_0x40be5a['status'](_0x4f0a16)['send'](_0x47e638);};}exports[_0xcca3('0x29')]=function(_0x208e4e,_0xe880df){var _0x50f212={},_0xc5fd13={},_0xc43c1f={'count':0x0,'rows':[]};var _0xbec7c3=_[_0xcca3('0x2a')](db['Campaign']['rawAttributes'],function(_0x5c5169){return{'name':_0x5c5169[_0xcca3('0x2b')],'type':_0x5c5169[_0xcca3('0x2c')][_0xcca3('0x2d')]};});_0xc5fd13[_0xcca3('0x2e')]=_['map'](_0xbec7c3,_0xcca3('0x28'));_0xc5fd13[_0xcca3('0x2f')]=_[_0xcca3('0x30')](_0x208e4e[_0xcca3('0x2f')]);_0xc5fd13[_0xcca3('0x31')]=_[_0xcca3('0x32')](_0xc5fd13['model'],_0xc5fd13[_0xcca3('0x2f')]);_0x50f212[_0xcca3('0x33')]=_['intersection'](_0xc5fd13[_0xcca3('0x2e')],qs[_0xcca3('0x34')](_0x208e4e[_0xcca3('0x2f')]['fields']));_0x50f212[_0xcca3('0x33')]=_0x50f212[_0xcca3('0x33')][_0xcca3('0x35')]?_0x50f212['attributes']:_0xc5fd13[_0xcca3('0x2e')];if(!_0x208e4e[_0xcca3('0x2f')][_0xcca3('0x36')](_0xcca3('0x37'))){_0x50f212['limit']=qs['limit'](_0x208e4e[_0xcca3('0x2f')][_0xcca3('0x1c')]);_0x50f212[_0xcca3('0x1a')]=qs['offset'](_0x208e4e[_0xcca3('0x2f')]['offset']);}_0x50f212[_0xcca3('0x38')]=qs[_0xcca3('0x39')](_0x208e4e['query'][_0xcca3('0x39')]);_0x50f212[_0xcca3('0x3a')]=qs[_0xcca3('0x31')](_[_0xcca3('0x3b')](_0x208e4e[_0xcca3('0x2f')],_0xc5fd13[_0xcca3('0x31')]),_0xbec7c3);if(_0x208e4e[_0xcca3('0x2f')][_0xcca3('0x3c')]){_0x50f212[_0xcca3('0x3a')]=_[_0xcca3('0x3d')](_0x50f212[_0xcca3('0x3a')],{'$or':_[_0xcca3('0x2a')](_0xbec7c3,function(_0x522766){if(_0x522766[_0xcca3('0x2c')]!==_0xcca3('0x3e')){var _0x56c542={};_0x56c542[_0x522766[_0xcca3('0x28')]]={'$like':'%'+_0x208e4e[_0xcca3('0x2f')]['filter']+'%'};return _0x56c542;}})});}_0x50f212=_[_0xcca3('0x3d')]({},_0x50f212,_0x208e4e[_0xcca3('0x3f')]);var _0x3c2f60={'where':_0x50f212['where']};return db[_0xcca3('0x40')]['count'](_0x3c2f60)[_0xcca3('0x22')](function(_0x57ed3e){_0xc43c1f[_0xcca3('0x1d')]=_0x57ed3e;if(_0x208e4e[_0xcca3('0x2f')][_0xcca3('0x41')]){_0x50f212[_0xcca3('0x42')]=[{'all':!![]}];}return db[_0xcca3('0x40')]['findAll'](_0x50f212);})['then'](function(_0xdc99dc){_0xc43c1f[_0xcca3('0x43')]=_0xdc99dc;return _0xc43c1f;})[_0xcca3('0x22')](respondWithFilteredResult(_0xe880df,_0x50f212))['catch'](handleError(_0xe880df,null));};exports[_0xcca3('0x44')]=function(_0x574fd5,_0x1667f9){var _0x2f8a95={'raw':![],'where':{'id':_0x574fd5['params']['id']}},_0x18b160={};_0x18b160[_0xcca3('0x2e')]=_[_0xcca3('0x30')](db[_0xcca3('0x40')]['rawAttributes']);_0x18b160[_0xcca3('0x2f')]=_[_0xcca3('0x30')](_0x574fd5[_0xcca3('0x2f')]);_0x18b160[_0xcca3('0x31')]=_[_0xcca3('0x32')](_0x18b160[_0xcca3('0x2e')],_0x18b160[_0xcca3('0x2f')]);_0x2f8a95[_0xcca3('0x33')]=_['intersection'](_0x18b160[_0xcca3('0x2e')],qs[_0xcca3('0x34')](_0x574fd5[_0xcca3('0x2f')]['fields']));_0x2f8a95[_0xcca3('0x33')]=_0x2f8a95['attributes']['length']?_0x2f8a95[_0xcca3('0x33')]:_0x18b160['model'];if(_0x574fd5[_0xcca3('0x2f')][_0xcca3('0x41')]){_0x2f8a95[_0xcca3('0x42')]=[{'all':!![]}];}_0x2f8a95=_[_0xcca3('0x3d')]({},_0x2f8a95,_0x574fd5[_0xcca3('0x3f')]);return db[_0xcca3('0x40')][_0xcca3('0x45')](_0x2f8a95)[_0xcca3('0x22')](handleEntityNotFound(_0x1667f9,null))[_0xcca3('0x22')](respondWithResult(_0x1667f9,null))['catch'](handleError(_0x1667f9,null));};exports[_0xcca3('0x46')]=function(_0x1c9a26,_0x31ca1b){return db['Campaign'][_0xcca3('0x46')](_0x1c9a26[_0xcca3('0x47')],{})[_0xcca3('0x22')](function(_0x5c2fb5){var _0x4c35e3=_0x1c9a26[_0xcca3('0x48')]['get']({'plain':!![]});if(!_0x4c35e3)throw new Error(_0xcca3('0x49'));if(_0x4c35e3[_0xcca3('0x4a')]===_0xcca3('0x48')){var _0x34df5d=_0x5c2fb5[_0xcca3('0x4b')]({'plain':!![]});var _0x3b30f3=_0xcca3('0x23');return db[_0xcca3('0x4c')][_0xcca3('0x45')]({'where':{'name':_0x3b30f3,'userProfileId':_0x4c35e3['userProfileId']},'raw':!![]})[_0xcca3('0x22')](function(_0x9bcdc6){if(_0x9bcdc6&&_0x9bcdc6[_0xcca3('0x4d')]===0x0){return db[_0xcca3('0x24')][_0xcca3('0x46')]({'name':_0x34df5d[_0xcca3('0x28')],'resourceId':_0x34df5d['id'],'type':_0x9bcdc6[_0xcca3('0x28')],'sectionId':_0x9bcdc6['id']},{})['then'](function(){return _0x5c2fb5;});}else{return _0x5c2fb5;}})[_0xcca3('0x4e')](function(_0x5b5188){logger[_0xcca3('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b5188);throw _0x5b5188;});}return _0x5c2fb5;})[_0xcca3('0x22')](respondWithResult(_0x31ca1b,0xc9))['catch'](handleError(_0x31ca1b,null));};exports['clone']=function(_0x33e457,_0x293967){var _0x4aee07={'where':{'id':_0x33e457[_0xcca3('0x4f')]['id']}},_0x12abab={};_0x12abab[_0xcca3('0x2e')]=_['keys'](db[_0xcca3('0x40')][_0xcca3('0x50')]);_0x4aee07[_0xcca3('0x33')]=_[_0xcca3('0x32')](_0x12abab['model'],qs[_0xcca3('0x34')](_0x33e457[_0xcca3('0x2f')][_0xcca3('0x34')]));_0x4aee07[_0xcca3('0x33')]=_0x4aee07[_0xcca3('0x33')][_0xcca3('0x35')]?_0x4aee07[_0xcca3('0x33')]:_0x12abab['model'];if(_0x33e457[_0xcca3('0x2f')][_0xcca3('0x41')]){_0x4aee07['include']=[{'all':!![]}];}_0x4aee07=_['merge']({},_0x4aee07,_0x33e457['options']);return db[_0xcca3('0x40')][_0xcca3('0x45')](_0x4aee07)[_0xcca3('0x22')](handleEntityNotFound(_0x293967,null))[_0xcca3('0x22')](function(_0x292e24){if(_0x292e24){var _0x15c816=_0x292e24['get']({'plain':!![]});_0x15c816=qs[_0xcca3('0x51')](_0x15c816,['id','createdAt',_0xcca3('0x52')]);_0x33e457[_0xcca3('0x47')]=_[_0xcca3('0x51')](_0x33e457['body'],['id',_0xcca3('0x53'),_0xcca3('0x52')]);return db[_0xcca3('0x40')][_0xcca3('0x46')](_['merge'](_0x15c816,_0x33e457['body']),{'include':_0x33e457[_0xcca3('0x2f')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x313cc1){var _0xed404f=_0x33e457[_0xcca3('0x48')][_0xcca3('0x4b')]({'plain':!![]});if(!_0xed404f)throw new Error(_0xcca3('0x49'));if(_0xed404f[_0xcca3('0x4a')]===_0xcca3('0x48')){var _0x50cc01=_0x313cc1['get']({'plain':!![]});var _0x3e0ac0=_0xcca3('0x23');return db[_0xcca3('0x4c')][_0xcca3('0x45')]({'where':{'name':_0x3e0ac0,'userProfileId':_0xed404f[_0xcca3('0x54')]},'raw':!![]})['then'](function(_0x61d763){if(_0x61d763&&_0x61d763[_0xcca3('0x4d')]===0x0){return db['UserProfileResource'][_0xcca3('0x46')]({'name':_0x50cc01['name'],'resourceId':_0x50cc01['id'],'type':_0x61d763['name'],'sectionId':_0x61d763['id']},{})[_0xcca3('0x22')](function(){return _0x313cc1;});}else{return _0x313cc1;}})[_0xcca3('0x4e')](function(_0x5eb0ed){logger['error'](_0xcca3('0x55'),_0x5eb0ed);throw _0x5eb0ed;});}return _0x313cc1;});}})[_0xcca3('0x22')](respondWithResult(_0x293967,0xc9))[_0xcca3('0x4e')](handleError(_0x293967,null));};exports[_0xcca3('0x21')]=function(_0x5ebe3a,_0x3677b4){if(_0x5ebe3a[_0xcca3('0x47')]['id']){delete _0x5ebe3a[_0xcca3('0x47')]['id'];}return db['Campaign'][_0xcca3('0x45')]({'where':{'id':_0x5ebe3a[_0xcca3('0x4f')]['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x3677b4,null))[_0xcca3('0x22')](saveUpdates(_0x5ebe3a[_0xcca3('0x47')],null))[_0xcca3('0x22')](respondWithResult(_0x3677b4,null))[_0xcca3('0x4e')](handleError(_0x3677b4,null));};exports[_0xcca3('0x25')]=function(_0x12e067,_0x116fdf){return db[_0xcca3('0x40')]['find']({'where':{'id':_0x12e067[_0xcca3('0x4f')]['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x116fdf,null))[_0xcca3('0x22')](removeEntity(_0x116fdf,null))[_0xcca3('0x4e')](handleError(_0x116fdf,null));};exports['getHoppers']=function(_0x6c160b,_0x3b7621,_0x12a30e){var _0x2af9db={'raw':!![],'where':{}};var _0x4f8d5f={};var _0x5edea6={'count':0x0,'rows':[]};return db[_0xcca3('0x40')][_0xcca3('0x56')]({'where':{'id':_0x6c160b['params']['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x3b7621,null))[_0xcca3('0x22')](function(_0x2c4d0d){if(_0x2c4d0d){_0x4f8d5f[_0xcca3('0x2e')]=_['keys'](db[_0xcca3('0x57')][_0xcca3('0x50')]);_0x4f8d5f[_0xcca3('0x2f')]=_[_0xcca3('0x30')](_0x6c160b[_0xcca3('0x2f')]);_0x4f8d5f[_0xcca3('0x31')]=_[_0xcca3('0x32')](_0x4f8d5f['model'],_0x4f8d5f['query']);_0x2af9db[_0xcca3('0x33')]=_[_0xcca3('0x32')](_0x4f8d5f[_0xcca3('0x2e')],qs[_0xcca3('0x34')](_0x6c160b['query'][_0xcca3('0x34')]));_0x2af9db[_0xcca3('0x33')]=_0x2af9db[_0xcca3('0x33')][_0xcca3('0x35')]?_0x2af9db[_0xcca3('0x33')]:_0x4f8d5f[_0xcca3('0x2e')];if(!_0x6c160b['query'][_0xcca3('0x36')](_0xcca3('0x37'))){_0x2af9db[_0xcca3('0x1c')]=qs[_0xcca3('0x1c')](_0x6c160b['query'][_0xcca3('0x1c')]);_0x2af9db[_0xcca3('0x1a')]=qs[_0xcca3('0x1a')](_0x6c160b[_0xcca3('0x2f')][_0xcca3('0x1a')]);}_0x2af9db[_0xcca3('0x38')]=qs[_0xcca3('0x39')](_0x6c160b[_0xcca3('0x2f')][_0xcca3('0x39')]);_0x2af9db['where']=qs['filters'](_[_0xcca3('0x3b')](_0x6c160b[_0xcca3('0x2f')],_0x4f8d5f[_0xcca3('0x31')]));_0x2af9db[_0xcca3('0x3a')]['CampaignId']=_0x2c4d0d['id'];if(_0x6c160b[_0xcca3('0x2f')][_0xcca3('0x3c')]){_0x2af9db['where']=_[_0xcca3('0x3d')](_0x2af9db[_0xcca3('0x3a')],{'$or':_[_0xcca3('0x2a')](_0x2af9db['attributes'],function(_0x2ba148){var _0x300932={};_0x300932[_0x2ba148]={'$like':'%'+_0x6c160b[_0xcca3('0x2f')][_0xcca3('0x3c')]+'%'};return _0x300932;})});}_0x2af9db=_[_0xcca3('0x3d')]({},_0x2af9db,_0x6c160b[_0xcca3('0x3f')]);return db[_0xcca3('0x57')][_0xcca3('0x1d')]({'where':_0x2af9db['where']})[_0xcca3('0x22')](function(_0x5013db){_0x5edea6[_0xcca3('0x1d')]=_0x5013db;if(_0x6c160b[_0xcca3('0x2f')][_0xcca3('0x41')]){_0x2af9db['include']=[{'all':!![]}];}return db[_0xcca3('0x57')][_0xcca3('0x58')](_0x2af9db);})['then'](function(_0x184d1d){_0x5edea6['rows']=_0x184d1d;return _0x5edea6;});}})[_0xcca3('0x22')](respondWithFilteredResult(_0x3b7621,_0x2af9db))[_0xcca3('0x4e')](handleError(_0x3b7621,null));};exports[_0xcca3('0x59')]=function(_0x1f6ce7,_0x409566,_0xbea25b){var _0x53d792={'raw':!![],'where':{}};var _0x526bc1={};var _0x4b108d={'count':0x0,'rows':[]};return db[_0xcca3('0x40')][_0xcca3('0x56')]({'where':{'id':_0x1f6ce7[_0xcca3('0x4f')]['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x409566,null))[_0xcca3('0x22')](function(_0x102f9e){if(_0x102f9e){_0x526bc1[_0xcca3('0x2e')]=_['keys'](db['CmHopperHistory'][_0xcca3('0x50')]);_0x526bc1['query']=_[_0xcca3('0x30')](_0x1f6ce7[_0xcca3('0x2f')]);_0x526bc1['filters']=_['intersection'](_0x526bc1[_0xcca3('0x2e')],_0x526bc1[_0xcca3('0x2f')]);_0x53d792['attributes']=_[_0xcca3('0x32')](_0x526bc1[_0xcca3('0x2e')],qs['fields'](_0x1f6ce7[_0xcca3('0x2f')][_0xcca3('0x34')]));_0x53d792[_0xcca3('0x33')]=_0x53d792[_0xcca3('0x33')][_0xcca3('0x35')]?_0x53d792[_0xcca3('0x33')]:_0x526bc1[_0xcca3('0x2e')];if(!_0x1f6ce7[_0xcca3('0x2f')][_0xcca3('0x36')](_0xcca3('0x37'))){_0x53d792[_0xcca3('0x1c')]=qs[_0xcca3('0x1c')](_0x1f6ce7[_0xcca3('0x2f')][_0xcca3('0x1c')]);_0x53d792['offset']=qs['offset'](_0x1f6ce7[_0xcca3('0x2f')][_0xcca3('0x1a')]);}_0x53d792[_0xcca3('0x38')]=qs[_0xcca3('0x39')](_0x1f6ce7[_0xcca3('0x2f')][_0xcca3('0x39')]);_0x53d792[_0xcca3('0x3a')]=qs['filters'](_[_0xcca3('0x3b')](_0x1f6ce7[_0xcca3('0x2f')],_0x526bc1[_0xcca3('0x31')]));_0x53d792[_0xcca3('0x3a')]['CampaignId']=_0x102f9e['id'];if(_0x1f6ce7[_0xcca3('0x2f')][_0xcca3('0x3c')]){_0x53d792[_0xcca3('0x3a')]=_[_0xcca3('0x3d')](_0x53d792[_0xcca3('0x3a')],{'$or':_[_0xcca3('0x2a')](_0x53d792[_0xcca3('0x33')],function(_0x5bb367){var _0x545944={};_0x545944[_0x5bb367]={'$like':'%'+_0x1f6ce7[_0xcca3('0x2f')][_0xcca3('0x3c')]+'%'};return _0x545944;})});}_0x53d792=_[_0xcca3('0x3d')]({},_0x53d792,_0x1f6ce7[_0xcca3('0x3f')]);return db[_0xcca3('0x5a')][_0xcca3('0x1d')]({'where':_0x53d792[_0xcca3('0x3a')]})['then'](function(_0x1efc6f){_0x4b108d[_0xcca3('0x1d')]=_0x1efc6f;if(_0x1f6ce7[_0xcca3('0x2f')][_0xcca3('0x41')]){_0x53d792[_0xcca3('0x42')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x53d792);})[_0xcca3('0x22')](function(_0x576215){_0x4b108d['rows']=_0x576215;return _0x4b108d;});}})[_0xcca3('0x22')](respondWithFilteredResult(_0x409566,_0x53d792))['catch'](handleError(_0x409566,null));};exports[_0xcca3('0x5b')]=function(_0x2feee6,_0x2ded5b,_0x55c911){var _0x468f7c={'raw':!![],'where':{}};var _0x75f534={};var _0x4326ea={'count':0x0,'rows':[]};return db[_0xcca3('0x40')][_0xcca3('0x56')]({'where':{'id':_0x2feee6[_0xcca3('0x4f')]['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x2ded5b,null))[_0xcca3('0x22')](function(_0x89ae13){if(_0x89ae13){_0x75f534[_0xcca3('0x2e')]=_[_0xcca3('0x30')](db[_0xcca3('0x5c')][_0xcca3('0x50')]);_0x75f534[_0xcca3('0x2f')]=_['keys'](_0x2feee6[_0xcca3('0x2f')]);_0x75f534[_0xcca3('0x31')]=_[_0xcca3('0x32')](_0x75f534[_0xcca3('0x2e')],_0x75f534[_0xcca3('0x2f')]);_0x468f7c[_0xcca3('0x33')]=_[_0xcca3('0x32')](_0x75f534[_0xcca3('0x2e')],qs['fields'](_0x2feee6[_0xcca3('0x2f')][_0xcca3('0x34')]));_0x468f7c[_0xcca3('0x33')]=_0x468f7c[_0xcca3('0x33')][_0xcca3('0x35')]?_0x468f7c[_0xcca3('0x33')]:_0x75f534[_0xcca3('0x2e')];if(!_0x2feee6[_0xcca3('0x2f')]['hasOwnProperty'](_0xcca3('0x37'))){_0x468f7c[_0xcca3('0x1c')]=qs[_0xcca3('0x1c')](_0x2feee6[_0xcca3('0x2f')]['limit']);_0x468f7c[_0xcca3('0x1a')]=qs[_0xcca3('0x1a')](_0x2feee6[_0xcca3('0x2f')][_0xcca3('0x1a')]);}_0x468f7c['order']=qs['sort'](_0x2feee6[_0xcca3('0x2f')][_0xcca3('0x39')]);_0x468f7c[_0xcca3('0x3a')]=qs[_0xcca3('0x31')](_[_0xcca3('0x3b')](_0x2feee6[_0xcca3('0x2f')],_0x75f534[_0xcca3('0x31')]));_0x468f7c[_0xcca3('0x3a')][_0xcca3('0x5d')]=_0x89ae13['id'];if(_0x2feee6['query'][_0xcca3('0x3c')]){_0x468f7c[_0xcca3('0x3a')]=_[_0xcca3('0x3d')](_0x468f7c['where'],{'$or':_['map'](_0x468f7c[_0xcca3('0x33')],function(_0x467d7c){var _0x4d6a05={};_0x4d6a05[_0x467d7c]={'$like':'%'+_0x2feee6['query'][_0xcca3('0x3c')]+'%'};return _0x4d6a05;})});}_0x468f7c=_['merge']({},_0x468f7c,_0x2feee6[_0xcca3('0x3f')]);return db[_0xcca3('0x5c')][_0xcca3('0x1d')]({'where':_0x468f7c[_0xcca3('0x3a')]})['then'](function(_0x156124){_0x4326ea[_0xcca3('0x1d')]=_0x156124;if(_0x2feee6['query']['includeAll']){_0x468f7c[_0xcca3('0x42')]=[{'all':!![]}];}return db[_0xcca3('0x5c')][_0xcca3('0x58')](_0x468f7c);})[_0xcca3('0x22')](function(_0x485ebd){_0x4326ea[_0xcca3('0x43')]=_0x485ebd;return _0x4326ea;});}})[_0xcca3('0x22')](respondWithFilteredResult(_0x2ded5b,_0x468f7c))[_0xcca3('0x4e')](handleError(_0x2ded5b,null));};exports['getHopperBlacks']=function(_0x5c6458,_0x231647,_0xd1067b){var _0x27145d={'raw':!![],'where':{}};var _0x5b0218={};var _0x1b503c={'count':0x0,'rows':[]};return db[_0xcca3('0x40')]['findOne']({'where':{'id':_0x5c6458[_0xcca3('0x4f')]['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x231647,null))['then'](function(_0x181d75){if(_0x181d75){_0x5b0218[_0xcca3('0x2e')]=_[_0xcca3('0x30')](db[_0xcca3('0x5e')]['rawAttributes']);_0x5b0218['query']=_['keys'](_0x5c6458['query']);_0x5b0218[_0xcca3('0x31')]=_['intersection'](_0x5b0218[_0xcca3('0x2e')],_0x5b0218[_0xcca3('0x2f')]);_0x27145d['attributes']=_[_0xcca3('0x32')](_0x5b0218['model'],qs[_0xcca3('0x34')](_0x5c6458[_0xcca3('0x2f')][_0xcca3('0x34')]));_0x27145d[_0xcca3('0x33')]=_0x27145d[_0xcca3('0x33')][_0xcca3('0x35')]?_0x27145d['attributes']:_0x5b0218[_0xcca3('0x2e')];if(!_0x5c6458[_0xcca3('0x2f')]['hasOwnProperty'](_0xcca3('0x37'))){_0x27145d[_0xcca3('0x1c')]=qs[_0xcca3('0x1c')](_0x5c6458[_0xcca3('0x2f')][_0xcca3('0x1c')]);_0x27145d[_0xcca3('0x1a')]=qs[_0xcca3('0x1a')](_0x5c6458['query'][_0xcca3('0x1a')]);}_0x27145d[_0xcca3('0x38')]=qs[_0xcca3('0x39')](_0x5c6458[_0xcca3('0x2f')]['sort']);_0x27145d[_0xcca3('0x3a')]=qs['filters'](_[_0xcca3('0x3b')](_0x5c6458['query'],_0x5b0218[_0xcca3('0x31')]));_0x27145d['where'][_0xcca3('0x5d')]=_0x181d75['id'];if(_0x5c6458[_0xcca3('0x2f')]['filter']){_0x27145d[_0xcca3('0x3a')]=_[_0xcca3('0x3d')](_0x27145d[_0xcca3('0x3a')],{'$or':_['map'](_0x27145d[_0xcca3('0x33')],function(_0x5008a0){var _0x2bafc0={};_0x2bafc0[_0x5008a0]={'$like':'%'+_0x5c6458['query'][_0xcca3('0x3c')]+'%'};return _0x2bafc0;})});}_0x27145d=_[_0xcca3('0x3d')]({},_0x27145d,_0x5c6458[_0xcca3('0x3f')]);return db[_0xcca3('0x5e')]['count']({'where':_0x27145d['where']})['then'](function(_0x451d11){_0x1b503c[_0xcca3('0x1d')]=_0x451d11;if(_0x5c6458[_0xcca3('0x2f')][_0xcca3('0x41')]){_0x27145d['include']=[{'all':!![]}];}return db[_0xcca3('0x5e')][_0xcca3('0x58')](_0x27145d);})[_0xcca3('0x22')](function(_0x3f6970){_0x1b503c[_0xcca3('0x43')]=_0x3f6970;return _0x1b503c;});}})[_0xcca3('0x22')](respondWithFilteredResult(_0x231647,_0x27145d))[_0xcca3('0x4e')](handleError(_0x231647,null));};exports[_0xcca3('0x5f')]=function(_0x3751cb,_0x31a5cc,_0x243abd){var _0x4a9783={};var _0x367bae={};var _0x2deeb7;var _0x4a61a6;return db[_0xcca3('0x40')]['findOne']({'where':{'id':_0x3751cb['params']['id']}})['then'](handleEntityNotFound(_0x31a5cc,null))[_0xcca3('0x22')](function(_0x14611d){if(_0x14611d){_0x2deeb7=_0x14611d;_0x367bae[_0xcca3('0x2e')]=_[_0xcca3('0x30')](db[_0xcca3('0x60')][_0xcca3('0x50')]);_0x367bae[_0xcca3('0x2f')]=_['keys'](_0x3751cb[_0xcca3('0x2f')]);_0x367bae[_0xcca3('0x31')]=_['intersection'](_0x367bae[_0xcca3('0x2e')],_0x367bae[_0xcca3('0x2f')]);_0x4a9783['attributes']=_['intersection'](_0x367bae[_0xcca3('0x2e')],qs['fields'](_0x3751cb[_0xcca3('0x2f')]['fields']));_0x4a9783[_0xcca3('0x33')]=_0x4a9783[_0xcca3('0x33')][_0xcca3('0x35')]?_0x4a9783[_0xcca3('0x33')]:_0x367bae[_0xcca3('0x2e')];_0x4a9783['order']=qs[_0xcca3('0x39')](_0x3751cb[_0xcca3('0x2f')]['sort']);_0x4a9783[_0xcca3('0x3a')]=qs['filters'](_['pick'](_0x3751cb[_0xcca3('0x2f')],_0x367bae[_0xcca3('0x31')]));if(_0x3751cb[_0xcca3('0x2f')][_0xcca3('0x3c')]){_0x4a9783['where']=_[_0xcca3('0x3d')](_0x4a9783[_0xcca3('0x3a')],{'$or':_[_0xcca3('0x2a')](_0x4a9783[_0xcca3('0x33')],function(_0x19fed9){var _0x59cc33={};_0x59cc33[_0x19fed9]={'$like':'%'+_0x3751cb[_0xcca3('0x2f')]['filter']+'%'};return _0x59cc33;})});}_0x4a9783=_['merge']({},_0x4a9783,_0x3751cb[_0xcca3('0x3f')]);return _0x2deeb7[_0xcca3('0x5f')](_0x4a9783);}})[_0xcca3('0x22')](function(_0x469d37){if(_0x469d37){_0x4a61a6=_0x469d37['length'];if(!_0x3751cb[_0xcca3('0x2f')]['hasOwnProperty'](_0xcca3('0x37'))){_0x4a9783[_0xcca3('0x1c')]=qs[_0xcca3('0x1c')](_0x3751cb['query'][_0xcca3('0x1c')]);_0x4a9783['offset']=qs[_0xcca3('0x1a')](_0x3751cb[_0xcca3('0x2f')][_0xcca3('0x1a')]);}return _0x2deeb7[_0xcca3('0x5f')](_0x4a9783);}})[_0xcca3('0x22')](function(_0x45999a){if(_0x45999a){return _0x45999a?{'count':_0x4a61a6,'rows':_0x45999a}:null;}})[_0xcca3('0x22')](respondWithResult(_0x31a5cc,null))[_0xcca3('0x4e')](handleError(_0x31a5cc,null));};exports[_0xcca3('0x61')]=function(_0x1ed2d6,_0x47559a,_0x4b625c){var _0x1e02c5,_0x18f497;return db[_0xcca3('0x40')]['find']({'where':{'id':_0x1ed2d6[_0xcca3('0x4f')]['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x47559a,null))[_0xcca3('0x22')](function(_0x4cc048){if(_0x4cc048){_0x18f497=_0x4cc048;return _0x4cc048[_0xcca3('0x61')](_0x1ed2d6['body']['ids'],_[_0xcca3('0x51')](_0x1ed2d6['body'],[_0xcca3('0x62'),'id'])||{});}return null;})[_0xcca3('0x63')](function(_0x132053){var _0x5255cc;_0x1e02c5=_0x132053||[];var _0x3d2d54=[];if(_0x132053){for(var _0x56d4ca=0x0;_0x56d4ca<_0x132053['length'];_0x56d4ca+=0x1){var _0x470808=_0x132053[_0x56d4ca][_0xcca3('0x4b')]({'plain':!![]});_0x18f497['dialCheckDuplicateType']=_0x1ed2d6['body']['dialCheckDuplicateType']?_0x1ed2d6[_0xcca3('0x47')]['dialCheckDuplicateType']:_0x18f497[_0xcca3('0x64')];switch(_0x18f497[_0xcca3('0x64')]){case _0xcca3('0x65'):_0x5255cc=squel[_0xcca3('0x66')]()[_0xcca3('0x67')](_0xcca3('0x68'))[_0xcca3('0x69')]([_0xcca3('0x6a'),_0xcca3('0x6b'),_0xcca3('0x6c'),'ListId',_0xcca3('0x5d'),_0xcca3('0x53'),'updatedAt'],squel[_0xcca3('0x6d')]()[_0xcca3('0x6e')](_0xcca3('0x6a'),_0xcca3('0x6a'))[_0xcca3('0x6e')](_0xcca3('0x6f'),_0xcca3('0x6b'))['field']('id',_0xcca3('0x6c'))[_0xcca3('0x6e')](_0x470808[_0xcca3('0x70')]['toString'](),'ListId')['field'](_0x1ed2d6['params']['id'][_0xcca3('0x71')](),_0xcca3('0x5d'))[_0xcca3('0x6e')]('NOW()','createdAt')[_0xcca3('0x6e')](_0xcca3('0x6f'),_0xcca3('0x52'))[_0xcca3('0x72')](_0xcca3('0x73'))['where'](_0xcca3('0x74'))[_0xcca3('0x3a')](_0xcca3('0x75'),_0x470808[_0xcca3('0x70')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xcca3('0x76'),squel['select']()[_0xcca3('0x6e')](_0xcca3('0x77'))[_0xcca3('0x72')](_0xcca3('0x78'))[_0xcca3('0x3a')]('CampaignId\x20=\x20?',_0x1ed2d6['params']['id'][_0xcca3('0x71')]()))[_0xcca3('0x3a')](_0xcca3('0x76'),squel[_0xcca3('0x6d')]()[_0xcca3('0x6e')](_0xcca3('0x79'))[_0xcca3('0x72')](_0xcca3('0x68'))['where']('CampaignId\x20=\x20?',_0x1ed2d6['params']['id'][_0xcca3('0x71')]())))[_0xcca3('0x71')]();break;case _0xcca3('0x7a'):_0x5255cc=squel[_0xcca3('0x66')]()['into'](_0xcca3('0x68'))['fromQuery'](['phone',_0xcca3('0x6b'),_0xcca3('0x6c'),_0xcca3('0x7b'),_0xcca3('0x5d'),_0xcca3('0x53'),'updatedAt'],squel[_0xcca3('0x6d')]()[_0xcca3('0x6e')](_0xcca3('0x6a'),_0xcca3('0x6a'))[_0xcca3('0x6e')](_0xcca3('0x6f'),_0xcca3('0x6b'))[_0xcca3('0x6e')]('id',_0xcca3('0x6c'))[_0xcca3('0x6e')](_0x470808['CmListId'][_0xcca3('0x71')](),_0xcca3('0x7b'))[_0xcca3('0x6e')](_0x1ed2d6[_0xcca3('0x4f')]['id']['toString'](),_0xcca3('0x5d'))[_0xcca3('0x6e')](_0xcca3('0x6f'),_0xcca3('0x53'))[_0xcca3('0x6e')]('NOW()',_0xcca3('0x52'))[_0xcca3('0x72')](_0xcca3('0x73'))[_0xcca3('0x3a')](_0xcca3('0x74'))[_0xcca3('0x3a')](_0xcca3('0x75'),_0x470808[_0xcca3('0x70')]['toString']())[_0xcca3('0x3a')](_0xcca3('0x7c'))[_0xcca3('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xcca3('0x6e')](_0xcca3('0x79'))[_0xcca3('0x72')](_0xcca3('0x68'))[_0xcca3('0x3a')](_0xcca3('0x7d'),_0x1ed2d6['params']['id'][_0xcca3('0x71')]())))[_0xcca3('0x71')]();break;default:_0x5255cc=squel[_0xcca3('0x66')]()[_0xcca3('0x67')](_0xcca3('0x68'))[_0xcca3('0x69')]([_0xcca3('0x6a'),_0xcca3('0x6b'),_0xcca3('0x6c'),_0xcca3('0x7b'),_0xcca3('0x5d'),_0xcca3('0x53'),_0xcca3('0x52')],squel[_0xcca3('0x6d')]()[_0xcca3('0x6e')]('phone',_0xcca3('0x6a'))[_0xcca3('0x6e')]('NOW()','scheduledAt')[_0xcca3('0x6e')]('id',_0xcca3('0x6c'))[_0xcca3('0x6e')](_0x470808[_0xcca3('0x70')]['toString'](),'ListId')['field'](_0x1ed2d6['params']['id'][_0xcca3('0x71')](),_0xcca3('0x5d'))[_0xcca3('0x6e')](_0xcca3('0x6f'),_0xcca3('0x53'))['field']('NOW()',_0xcca3('0x52'))[_0xcca3('0x72')]('cm_contacts')[_0xcca3('0x3a')](_0xcca3('0x74'))[_0xcca3('0x3a')](_0xcca3('0x75'),_0x470808[_0xcca3('0x70')][_0xcca3('0x71')]())[_0xcca3('0x3a')](_0xcca3('0x7c')))[_0xcca3('0x71')]();}_0x3d2d54[_0xcca3('0x7e')](db[_0xcca3('0x7f')][_0xcca3('0x2f')](_0x5255cc));}return BPromise[_0xcca3('0x80')](_0x3d2d54);}})[_0xcca3('0x22')](function(){return _0x1e02c5;})[_0xcca3('0x22')](respondWithResult(_0x47559a,null))[_0xcca3('0x4e')](handleError(_0x47559a,null));};exports[_0xcca3('0x81')]=function(_0x563c98,_0x50532f,_0x4891a8){return db['Campaign'][_0xcca3('0x45')]({'where':{'id':_0x563c98['params']['id']}})['then'](handleEntityNotFound(_0x50532f,null))[_0xcca3('0x22')](function(_0x1e9c31){if(_0x1e9c31){return _0x1e9c31[_0xcca3('0x81')](_0x563c98['query'][_0xcca3('0x62')]);}})[_0xcca3('0x22')](function(_0xc9e44e){if(_0xc9e44e){return db[_0xcca3('0x57')][_0xcca3('0x25')]({'where':{'ListId':_0x563c98[_0xcca3('0x2f')]['ids'],'CampaignId':_0x563c98['params']['id']}})[_0xcca3('0x22')](function(){return _0xc9e44e;});}})[_0xcca3('0x22')](respondWithStatusCode(_0x50532f,null))['catch'](handleError(_0x50532f,null));};exports['getBlackLists']=function(_0x375475,_0x42345e,_0x432bf8){var _0x3c9b6b={};var _0x30ee32={};var _0x3f0832;var _0x1f22a4;return db[_0xcca3('0x40')][_0xcca3('0x56')]({'where':{'id':_0x375475[_0xcca3('0x4f')]['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x42345e,null))['then'](function(_0x3f8073){if(_0x3f8073){_0x3f0832=_0x3f8073;_0x30ee32['model']=_['keys'](db['CmList'][_0xcca3('0x50')]);_0x30ee32['query']=_[_0xcca3('0x30')](_0x375475[_0xcca3('0x2f')]);_0x30ee32[_0xcca3('0x31')]=_['intersection'](_0x30ee32['model'],_0x30ee32[_0xcca3('0x2f')]);_0x3c9b6b[_0xcca3('0x33')]=_[_0xcca3('0x32')](_0x30ee32[_0xcca3('0x2e')],qs[_0xcca3('0x34')](_0x375475['query']['fields']));_0x3c9b6b[_0xcca3('0x33')]=_0x3c9b6b[_0xcca3('0x33')][_0xcca3('0x35')]?_0x3c9b6b[_0xcca3('0x33')]:_0x30ee32[_0xcca3('0x2e')];_0x3c9b6b[_0xcca3('0x38')]=qs['sort'](_0x375475['query']['sort']);_0x3c9b6b['where']=qs[_0xcca3('0x31')](_[_0xcca3('0x3b')](_0x375475['query'],_0x30ee32['filters']));if(_0x375475[_0xcca3('0x2f')][_0xcca3('0x3c')]){_0x3c9b6b[_0xcca3('0x3a')]=_[_0xcca3('0x3d')](_0x3c9b6b['where'],{'$or':_[_0xcca3('0x2a')](_0x3c9b6b[_0xcca3('0x33')],function(_0x16f5e4){var _0x2c02b1={};_0x2c02b1[_0x16f5e4]={'$like':'%'+_0x375475[_0xcca3('0x2f')]['filter']+'%'};return _0x2c02b1;})});}_0x3c9b6b=_[_0xcca3('0x3d')]({},_0x3c9b6b,_0x375475[_0xcca3('0x3f')]);return _0x3f0832[_0xcca3('0x82')](_0x3c9b6b);}})[_0xcca3('0x22')](function(_0x2c0380){if(_0x2c0380){_0x1f22a4=_0x2c0380[_0xcca3('0x35')];if(!_0x375475[_0xcca3('0x2f')][_0xcca3('0x36')](_0xcca3('0x37'))){_0x3c9b6b[_0xcca3('0x1c')]=qs[_0xcca3('0x1c')](_0x375475['query'][_0xcca3('0x1c')]);_0x3c9b6b[_0xcca3('0x1a')]=qs[_0xcca3('0x1a')](_0x375475[_0xcca3('0x2f')]['offset']);}return _0x3f0832[_0xcca3('0x82')](_0x3c9b6b);}})[_0xcca3('0x22')](function(_0x49b71d){if(_0x49b71d){return _0x49b71d?{'count':_0x1f22a4,'rows':_0x49b71d}:null;}})[_0xcca3('0x22')](respondWithResult(_0x42345e,null))[_0xcca3('0x4e')](handleError(_0x42345e,null));};exports[_0xcca3('0x83')]=function(_0x11b738,_0x223e0e,_0x3b39d4){var _0x3e9c83,_0x4a891e;return db[_0xcca3('0x40')][_0xcca3('0x45')]({'where':{'id':_0x11b738['params']['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x223e0e,null))[_0xcca3('0x22')](function(_0x4337fe){if(_0x4337fe){_0x4a891e=_0x4337fe;return _0x4337fe['addBlackLists'](_0x11b738[_0xcca3('0x47')]['ids'],_[_0xcca3('0x51')](_0x11b738[_0xcca3('0x47')],['ids','id'])||{});}return null;})[_0xcca3('0x63')](function(_0x50b3fe){var _0x301951;_0x3e9c83=_0x50b3fe||[];var _0x250993=[];if(_0x50b3fe){for(var _0x3e0445=0x0;_0x3e0445<_0x50b3fe[_0xcca3('0x35')];_0x3e0445+=0x1){var _0x4e5788=_0x50b3fe[_0x3e0445]['get']({'plain':!![]});_0x301951=squel[_0xcca3('0x66')]()['into'](_0xcca3('0x84'))[_0xcca3('0x69')]([_0xcca3('0x6a'),_0xcca3('0x6c'),'ListId','CampaignId','createdAt','updatedAt'],squel[_0xcca3('0x6d')]()['field'](_0xcca3('0x6a'),'phone')[_0xcca3('0x6e')]('id',_0xcca3('0x6c'))[_0xcca3('0x6e')](_0x4e5788[_0xcca3('0x70')][_0xcca3('0x71')](),_0xcca3('0x7b'))['field'](_0x11b738['params']['id'][_0xcca3('0x71')](),'CampaignId')[_0xcca3('0x6e')](_0xcca3('0x6f'),_0xcca3('0x53'))[_0xcca3('0x6e')](_0xcca3('0x6f'),'updatedAt')[_0xcca3('0x72')](_0xcca3('0x73'))[_0xcca3('0x3a')](_0xcca3('0x74'))['where']('ListId\x20=\x20?',_0x4e5788[_0xcca3('0x70')]['toString']())['where'](_0xcca3('0x7c')))[_0xcca3('0x71')]();_0x250993[_0xcca3('0x7e')](db[_0xcca3('0x7f')]['query'](_0x301951));}return BPromise[_0xcca3('0x80')](_0x250993);}})[_0xcca3('0x22')](function(){return _0x3e9c83;})['then'](respondWithResult(_0x223e0e,null))['catch'](handleError(_0x223e0e,null));};exports[_0xcca3('0x85')]=function(_0x3152d2,_0x5cb0e9,_0x2afa0b){return db[_0xcca3('0x40')][_0xcca3('0x45')]({'where':{'id':_0x3152d2['params']['id']}})[_0xcca3('0x22')](handleEntityNotFound(_0x5cb0e9,null))[_0xcca3('0x22')](function(_0x227431){if(_0x227431){return _0x227431['removeBlackLists'](_0x3152d2['query'][_0xcca3('0x62')]);}})[_0xcca3('0x22')](function(_0x5bd6e8){if(_0x5bd6e8){return db[_0xcca3('0x5e')][_0xcca3('0x25')]({'where':{'ListId':_0x3152d2['query']['ids'],'CampaignId':_0x3152d2['params']['id']}})[_0xcca3('0x22')](function(){return _0x5bd6e8;});}})[_0xcca3('0x22')](respondWithStatusCode(_0x5cb0e9,null))[_0xcca3('0x4e')](handleError(_0x5cb0e9,null));};
\ No newline at end of file
+var _0x541f=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','IvrCampaigns','destroy','error','name','send','index','Campaign','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','role','getHoppers','findOne','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','select','field','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','insert','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','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','../../config/license/hardware','../../config/logger'];(function(_0x33ac6b,_0x1ed895){var _0x34cffe=function(_0x17d762){while(--_0x17d762){_0x33ac6b['push'](_0x33ac6b['shift']());}};_0x34cffe(++_0x1ed895);}(_0x541f,0x190));var _0xf541=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x541f[_0x519756];return _0x37047e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf541('0x0'));var zipdir=require(_0xf541('0x1'));var jsonpatch=require(_0xf541('0x2'));var rp=require('request-promise');var moment=require(_0xf541('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf541('0x4'));var util=require(_0xf541('0x5'));var path=require(_0xf541('0x6'));var sox=require(_0xf541('0x7'));var csv=require(_0xf541('0x8'));var ejs=require(_0xf541('0x9'));var fs=require('fs');var fs_extra=require(_0xf541('0xa'));var _=require(_0xf541('0xb'));var squel=require('squel');var crypto=require(_0xf541('0xc'));var jsforce=require(_0xf541('0xd'));var deskjs=require(_0xf541('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf541('0xf'));var Papa=require(_0xf541('0x10'));var Redis=require(_0xf541('0x11'));var authService=require(_0xf541('0x12'));var qs=require(_0xf541('0x13'));var as=require(_0xf541('0x14'));var hardwareService=require(_0xf541('0x15'));var logger=require(_0xf541('0x16'))(_0xf541('0x17'));var utils=require(_0xf541('0x18'));var config=require(_0xf541('0x19'));var licenseUtil=require(_0xf541('0x1a'));var db=require(_0xf541('0x1b'))['db'];function respondWithStatusCode(_0x4c203e,_0x376e17){_0x376e17=_0x376e17||0xcc;return function(_0x507b9d){if(_0x507b9d){return _0x4c203e[_0xf541('0x1c')](_0x376e17);}return _0x4c203e[_0xf541('0x1d')](_0x376e17)[_0xf541('0x1e')]();};}function respondWithResult(_0xd53ef9,_0x2a0612){_0x2a0612=_0x2a0612||0xc8;return function(_0x50cc89){if(_0x50cc89){return _0xd53ef9['status'](_0x2a0612)[_0xf541('0x1f')](_0x50cc89);}};}function respondWithFilteredResult(_0x183161,_0x709bd8){return function(_0x3effe6){if(_0x3effe6){var _0x54dded=typeof _0x709bd8[_0xf541('0x20')]===_0xf541('0x21')&&typeof _0x709bd8['limit']==='undefined';var _0xcff561=_0x3effe6['count'];var _0x116307=_0x54dded?0x0:_0x709bd8[_0xf541('0x20')];var _0x23be0c=_0x54dded?_0x3effe6[_0xf541('0x22')]:_0x709bd8['offset']+_0x709bd8[_0xf541('0x23')];var _0x570c72;if(_0x23be0c>=_0xcff561){_0x23be0c=_0xcff561;_0x570c72=0xc8;}else{_0x570c72=0xce;}_0x183161['status'](_0x570c72);return _0x183161[_0xf541('0x24')]('Content-Range',_0x116307+'-'+_0x23be0c+'/'+_0xcff561)[_0xf541('0x1f')](_0x3effe6);}return null;};}function patchUpdates(_0x551321){return function(_0x5c0fbb){try{jsonpatch[_0xf541('0x25')](_0x5c0fbb,_0x551321,!![]);}catch(_0x42066c){return BPromise[_0xf541('0x26')](_0x42066c);}return _0x5c0fbb[_0xf541('0x27')]();};}function saveUpdates(_0x50173e,_0x16d88f){return function(_0x4030ef){if(_0x4030ef){return _0x4030ef[_0xf541('0x28')](_0x50173e)[_0xf541('0x29')](function(_0x56d8eb){return _0x56d8eb;});}return null;};}function removeEntity(_0x232656,_0x4ba1d1){return function(_0x5f0c26){if(_0x5f0c26){return _0x5f0c26['destroy']()[_0xf541('0x29')](function(){var _0x40a06=_0x5f0c26['get']({'plain':!![]});var _0x53cb15=_0xf541('0x2a');return db['UserProfileResource'][_0xf541('0x2b')]({'where':{'type':_0x53cb15,'resourceId':_0x40a06['id']}})['then'](function(){return _0x5f0c26;});})[_0xf541('0x29')](function(){_0x232656['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fbb2e,_0x48dcef){return function(_0xfea122){if(!_0xfea122){_0x4fbb2e[_0xf541('0x1c')](0x194);}return _0xfea122;};}function handleError(_0x3f3903,_0x364280){_0x364280=_0x364280||0x1f4;return function(_0x163d70){logger[_0xf541('0x2c')](_0x163d70['stack']);if(_0x163d70[_0xf541('0x2d')]){delete _0x163d70['name'];}_0x3f3903['status'](_0x364280)[_0xf541('0x2e')](_0x163d70);};}exports[_0xf541('0x2f')]=function(_0x5f27b2,_0x5368a8){var _0x4e1f56={},_0x5046c6={},_0x375da0={'count':0x0,'rows':[]};var _0x1db50c=_['map'](db[_0xf541('0x30')][_0xf541('0x31')],function(_0x4aed75){return{'name':_0x4aed75[_0xf541('0x32')],'type':_0x4aed75[_0xf541('0x33')]['key']};});_0x5046c6[_0xf541('0x34')]=_['map'](_0x1db50c,_0xf541('0x2d'));_0x5046c6['query']=_['keys'](_0x5f27b2[_0xf541('0x35')]);_0x5046c6['filters']=_[_0xf541('0x36')](_0x5046c6[_0xf541('0x34')],_0x5046c6[_0xf541('0x35')]);_0x4e1f56[_0xf541('0x37')]=_['intersection'](_0x5046c6['model'],qs[_0xf541('0x38')](_0x5f27b2['query'][_0xf541('0x38')]));_0x4e1f56[_0xf541('0x37')]=_0x4e1f56[_0xf541('0x37')][_0xf541('0x39')]?_0x4e1f56[_0xf541('0x37')]:_0x5046c6['model'];if(!_0x5f27b2['query'][_0xf541('0x3a')]('nolimit')){_0x4e1f56[_0xf541('0x23')]=qs[_0xf541('0x23')](_0x5f27b2[_0xf541('0x35')]['limit']);_0x4e1f56[_0xf541('0x20')]=qs[_0xf541('0x20')](_0x5f27b2[_0xf541('0x35')][_0xf541('0x20')]);}_0x4e1f56[_0xf541('0x3b')]=qs['sort'](_0x5f27b2[_0xf541('0x35')][_0xf541('0x3c')]);_0x4e1f56[_0xf541('0x3d')]=qs[_0xf541('0x3e')](_[_0xf541('0x3f')](_0x5f27b2['query'],_0x5046c6[_0xf541('0x3e')]),_0x1db50c);if(_0x5f27b2[_0xf541('0x35')][_0xf541('0x40')]){_0x4e1f56[_0xf541('0x3d')]=_[_0xf541('0x41')](_0x4e1f56[_0xf541('0x3d')],{'$or':_[_0xf541('0x42')](_0x1db50c,function(_0x463c65){if(_0x463c65[_0xf541('0x33')]!==_0xf541('0x43')){var _0x2b9ef7={};_0x2b9ef7[_0x463c65[_0xf541('0x2d')]]={'$like':'%'+_0x5f27b2[_0xf541('0x35')]['filter']+'%'};return _0x2b9ef7;}})});}_0x4e1f56=_[_0xf541('0x41')]({},_0x4e1f56,_0x5f27b2['options']);var _0x343a52={'where':_0x4e1f56[_0xf541('0x3d')]};return db[_0xf541('0x30')][_0xf541('0x22')](_0x343a52)['then'](function(_0x124219){_0x375da0['count']=_0x124219;if(_0x5f27b2['query'][_0xf541('0x44')]){_0x4e1f56[_0xf541('0x45')]=[{'all':!![]}];}return db[_0xf541('0x30')][_0xf541('0x46')](_0x4e1f56);})[_0xf541('0x29')](function(_0x4d97e5){_0x375da0[_0xf541('0x47')]=_0x4d97e5;return _0x375da0;})[_0xf541('0x29')](respondWithFilteredResult(_0x5368a8,_0x4e1f56))['catch'](handleError(_0x5368a8,null));};exports[_0xf541('0x48')]=function(_0x529516,_0x316168){var _0x1537b2={'raw':![],'where':{'id':_0x529516[_0xf541('0x49')]['id']}},_0x2cd443={};_0x2cd443[_0xf541('0x34')]=_[_0xf541('0x4a')](db[_0xf541('0x30')][_0xf541('0x31')]);_0x2cd443['query']=_[_0xf541('0x4a')](_0x529516[_0xf541('0x35')]);_0x2cd443[_0xf541('0x3e')]=_[_0xf541('0x36')](_0x2cd443['model'],_0x2cd443[_0xf541('0x35')]);_0x1537b2[_0xf541('0x37')]=_[_0xf541('0x36')](_0x2cd443[_0xf541('0x34')],qs[_0xf541('0x38')](_0x529516[_0xf541('0x35')][_0xf541('0x38')]));_0x1537b2[_0xf541('0x37')]=_0x1537b2[_0xf541('0x37')]['length']?_0x1537b2['attributes']:_0x2cd443['model'];if(_0x529516['query']['includeAll']){_0x1537b2['include']=[{'all':!![]}];}_0x1537b2=_['merge']({},_0x1537b2,_0x529516[_0xf541('0x4b')]);return db[_0xf541('0x30')]['find'](_0x1537b2)['then'](handleEntityNotFound(_0x316168,null))[_0xf541('0x29')](respondWithResult(_0x316168,null))[_0xf541('0x4c')](handleError(_0x316168,null));};exports[_0xf541('0x4d')]=function(_0x23e074,_0x1380f5){return db['Campaign'][_0xf541('0x4d')](_0x23e074[_0xf541('0x4e')],{})['then'](function(_0x1688e0){var _0x565c96=_0x23e074[_0xf541('0x4f')]['get']({'plain':!![]});if(!_0x565c96)throw new Error(_0xf541('0x50'));if(_0x565c96['role']===_0xf541('0x4f')){var _0x27086c=_0x1688e0[_0xf541('0x51')]({'plain':!![]});var _0x12725d=_0xf541('0x2a');return db[_0xf541('0x52')][_0xf541('0x53')]({'where':{'name':_0x12725d,'userProfileId':_0x565c96['userProfileId']},'raw':!![]})['then'](function(_0x314d1e){if(_0x314d1e&&_0x314d1e[_0xf541('0x54')]===0x0){return db[_0xf541('0x55')][_0xf541('0x4d')]({'name':_0x27086c['name'],'resourceId':_0x27086c['id'],'type':_0x314d1e['name'],'sectionId':_0x314d1e['id']},{})[_0xf541('0x29')](function(){return _0x1688e0;});}else{return _0x1688e0;}})[_0xf541('0x4c')](function(_0x5b8220){logger[_0xf541('0x2c')](_0xf541('0x56'),_0x5b8220);throw _0x5b8220;});}return _0x1688e0;})['then'](respondWithResult(_0x1380f5,0xc9))[_0xf541('0x4c')](handleError(_0x1380f5,null));};exports[_0xf541('0x57')]=function(_0x35ff5b,_0x58447a){var _0x3385cc={'where':{'id':_0x35ff5b[_0xf541('0x49')]['id']}},_0x67f921={};_0x67f921[_0xf541('0x34')]=_['keys'](db[_0xf541('0x30')]['rawAttributes']);_0x3385cc[_0xf541('0x37')]=_[_0xf541('0x36')](_0x67f921[_0xf541('0x34')],qs['fields'](_0x35ff5b[_0xf541('0x35')][_0xf541('0x38')]));_0x3385cc[_0xf541('0x37')]=_0x3385cc[_0xf541('0x37')][_0xf541('0x39')]?_0x3385cc[_0xf541('0x37')]:_0x67f921[_0xf541('0x34')];if(_0x35ff5b[_0xf541('0x35')][_0xf541('0x44')]){_0x3385cc[_0xf541('0x45')]=[{'all':!![]}];}_0x3385cc=_[_0xf541('0x41')]({},_0x3385cc,_0x35ff5b[_0xf541('0x4b')]);return db[_0xf541('0x30')][_0xf541('0x53')](_0x3385cc)[_0xf541('0x29')](handleEntityNotFound(_0x58447a,null))['then'](function(_0x4fd723){if(_0x4fd723){var _0x160cac=_0x4fd723[_0xf541('0x51')]({'plain':!![]});_0x160cac=qs[_0xf541('0x58')](_0x160cac,['id','createdAt','updatedAt']);_0x35ff5b[_0xf541('0x4e')]=_['omit'](_0x35ff5b[_0xf541('0x4e')],['id','createdAt',_0xf541('0x59')]);return db['Campaign'][_0xf541('0x4d')](_['merge'](_0x160cac,_0x35ff5b['body']),{'include':_0x35ff5b[_0xf541('0x35')][_0xf541('0x44')]?[{'all':!![]}]:undefined})[_0xf541('0x29')](function(_0x463911){var _0x2e3d82=_0x35ff5b['user']['get']({'plain':!![]});if(!_0x2e3d82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e3d82[_0xf541('0x5a')]===_0xf541('0x4f')){var _0x9112c7=_0x463911[_0xf541('0x51')]({'plain':!![]});var _0x2cb931=_0xf541('0x2a');return db[_0xf541('0x52')][_0xf541('0x53')]({'where':{'name':_0x2cb931,'userProfileId':_0x2e3d82['userProfileId']},'raw':!![]})[_0xf541('0x29')](function(_0x57a0ef){if(_0x57a0ef&&_0x57a0ef['autoAssociation']===0x0){return db[_0xf541('0x55')][_0xf541('0x4d')]({'name':_0x9112c7[_0xf541('0x2d')],'resourceId':_0x9112c7['id'],'type':_0x57a0ef[_0xf541('0x2d')],'sectionId':_0x57a0ef['id']},{})['then'](function(){return _0x463911;});}else{return _0x463911;}})[_0xf541('0x4c')](function(_0x4dc4fb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dc4fb);throw _0x4dc4fb;});}return _0x463911;});}})['then'](respondWithResult(_0x58447a,0xc9))[_0xf541('0x4c')](handleError(_0x58447a,null));};exports[_0xf541('0x28')]=function(_0x4f257a,_0x513835){if(_0x4f257a[_0xf541('0x4e')]['id']){delete _0x4f257a[_0xf541('0x4e')]['id'];}return db['Campaign']['find']({'where':{'id':_0x4f257a['params']['id']}})[_0xf541('0x29')](handleEntityNotFound(_0x513835,null))['then'](saveUpdates(_0x4f257a[_0xf541('0x4e')],null))[_0xf541('0x29')](respondWithResult(_0x513835,null))['catch'](handleError(_0x513835,null));};exports[_0xf541('0x2b')]=function(_0x1bb186,_0xc5a651){return db[_0xf541('0x30')]['find']({'where':{'id':_0x1bb186['params']['id']}})[_0xf541('0x29')](handleEntityNotFound(_0xc5a651,null))[_0xf541('0x29')](removeEntity(_0xc5a651,null))[_0xf541('0x4c')](handleError(_0xc5a651,null));};exports[_0xf541('0x5b')]=function(_0x54c7df,_0x19a3d1,_0x1bb7c1){var _0x32f276={'raw':!![],'where':{}};var _0x26e356={};var _0x1b890c={'count':0x0,'rows':[]};return db['Campaign'][_0xf541('0x5c')]({'where':{'id':_0x54c7df['params']['id']}})['then'](handleEntityNotFound(_0x19a3d1,null))[_0xf541('0x29')](function(_0x14f70e){if(_0x14f70e){_0x26e356[_0xf541('0x34')]=_['keys'](db['CmHopper'][_0xf541('0x31')]);_0x26e356['query']=_[_0xf541('0x4a')](_0x54c7df[_0xf541('0x35')]);_0x26e356[_0xf541('0x3e')]=_[_0xf541('0x36')](_0x26e356[_0xf541('0x34')],_0x26e356[_0xf541('0x35')]);_0x32f276['attributes']=_['intersection'](_0x26e356[_0xf541('0x34')],qs['fields'](_0x54c7df[_0xf541('0x35')][_0xf541('0x38')]));_0x32f276[_0xf541('0x37')]=_0x32f276['attributes']['length']?_0x32f276[_0xf541('0x37')]:_0x26e356[_0xf541('0x34')];if(!_0x54c7df[_0xf541('0x35')][_0xf541('0x3a')](_0xf541('0x5d'))){_0x32f276[_0xf541('0x23')]=qs[_0xf541('0x23')](_0x54c7df[_0xf541('0x35')][_0xf541('0x23')]);_0x32f276[_0xf541('0x20')]=qs[_0xf541('0x20')](_0x54c7df[_0xf541('0x35')]['offset']);}_0x32f276[_0xf541('0x3b')]=qs['sort'](_0x54c7df['query'][_0xf541('0x3c')]);_0x32f276[_0xf541('0x3d')]=qs[_0xf541('0x3e')](_[_0xf541('0x3f')](_0x54c7df['query'],_0x26e356[_0xf541('0x3e')]));_0x32f276[_0xf541('0x3d')][_0xf541('0x5e')]=_0x14f70e['id'];if(_0x54c7df[_0xf541('0x35')][_0xf541('0x40')]){_0x32f276['where']=_[_0xf541('0x41')](_0x32f276[_0xf541('0x3d')],{'$or':_[_0xf541('0x42')](_0x32f276['attributes'],function(_0x522e47){var _0x490407={};_0x490407[_0x522e47]={'$like':'%'+_0x54c7df['query']['filter']+'%'};return _0x490407;})});}_0x32f276=_['merge']({},_0x32f276,_0x54c7df[_0xf541('0x4b')]);return db[_0xf541('0x5f')][_0xf541('0x22')]({'where':_0x32f276[_0xf541('0x3d')]})[_0xf541('0x29')](function(_0x367622){_0x1b890c[_0xf541('0x22')]=_0x367622;if(_0x54c7df[_0xf541('0x35')][_0xf541('0x44')]){_0x32f276[_0xf541('0x45')]=[{'all':!![]}];}return db[_0xf541('0x5f')][_0xf541('0x46')](_0x32f276);})[_0xf541('0x29')](function(_0x4569e8){_0x1b890c[_0xf541('0x47')]=_0x4569e8;return _0x1b890c;});}})[_0xf541('0x29')](respondWithFilteredResult(_0x19a3d1,_0x32f276))[_0xf541('0x4c')](handleError(_0x19a3d1,null));};exports[_0xf541('0x60')]=function(_0x2ecfe1,_0x5b4d32,_0x7189a3){var _0x59b708={'raw':!![],'where':{}};var _0x5575bf={};var _0x59aa03={'count':0x0,'rows':[]};return db[_0xf541('0x30')]['findOne']({'where':{'id':_0x2ecfe1[_0xf541('0x49')]['id']}})[_0xf541('0x29')](handleEntityNotFound(_0x5b4d32,null))['then'](function(_0x434c1d){if(_0x434c1d){_0x5575bf[_0xf541('0x34')]=_[_0xf541('0x4a')](db[_0xf541('0x61')][_0xf541('0x31')]);_0x5575bf[_0xf541('0x35')]=_['keys'](_0x2ecfe1['query']);_0x5575bf[_0xf541('0x3e')]=_[_0xf541('0x36')](_0x5575bf[_0xf541('0x34')],_0x5575bf[_0xf541('0x35')]);_0x59b708[_0xf541('0x37')]=_[_0xf541('0x36')](_0x5575bf[_0xf541('0x34')],qs['fields'](_0x2ecfe1[_0xf541('0x35')][_0xf541('0x38')]));_0x59b708[_0xf541('0x37')]=_0x59b708['attributes'][_0xf541('0x39')]?_0x59b708[_0xf541('0x37')]:_0x5575bf[_0xf541('0x34')];if(!_0x2ecfe1[_0xf541('0x35')][_0xf541('0x3a')]('nolimit')){_0x59b708['limit']=qs[_0xf541('0x23')](_0x2ecfe1[_0xf541('0x35')][_0xf541('0x23')]);_0x59b708[_0xf541('0x20')]=qs[_0xf541('0x20')](_0x2ecfe1[_0xf541('0x35')]['offset']);}_0x59b708[_0xf541('0x3b')]=qs['sort'](_0x2ecfe1[_0xf541('0x35')][_0xf541('0x3c')]);_0x59b708[_0xf541('0x3d')]=qs['filters'](_[_0xf541('0x3f')](_0x2ecfe1[_0xf541('0x35')],_0x5575bf[_0xf541('0x3e')]));_0x59b708[_0xf541('0x3d')]['CampaignId']=_0x434c1d['id'];if(_0x2ecfe1[_0xf541('0x35')]['filter']){_0x59b708[_0xf541('0x3d')]=_[_0xf541('0x41')](_0x59b708[_0xf541('0x3d')],{'$or':_[_0xf541('0x42')](_0x59b708[_0xf541('0x37')],function(_0x52d5ff){var _0x5028c8={};_0x5028c8[_0x52d5ff]={'$like':'%'+_0x2ecfe1[_0xf541('0x35')][_0xf541('0x40')]+'%'};return _0x5028c8;})});}_0x59b708=_[_0xf541('0x41')]({},_0x59b708,_0x2ecfe1[_0xf541('0x4b')]);return db['CmHopperHistory'][_0xf541('0x22')]({'where':_0x59b708[_0xf541('0x3d')]})[_0xf541('0x29')](function(_0x25a428){_0x59aa03['count']=_0x25a428;if(_0x2ecfe1[_0xf541('0x35')][_0xf541('0x44')]){_0x59b708[_0xf541('0x45')]=[{'all':!![]}];}return db[_0xf541('0x61')][_0xf541('0x46')](_0x59b708);})[_0xf541('0x29')](function(_0x1f50e4){_0x59aa03[_0xf541('0x47')]=_0x1f50e4;return _0x59aa03;});}})[_0xf541('0x29')](respondWithFilteredResult(_0x5b4d32,_0x59b708))[_0xf541('0x4c')](handleError(_0x5b4d32,null));};exports[_0xf541('0x62')]=function(_0x563bad,_0x4e2f6f,_0x3aa2e8){var _0x3a4f71={'raw':!![],'where':{}};var _0x35c36f={};var _0x3a519f={'count':0x0,'rows':[]};return db[_0xf541('0x30')][_0xf541('0x5c')]({'where':{'id':_0x563bad['params']['id']}})['then'](handleEntityNotFound(_0x4e2f6f,null))[_0xf541('0x29')](function(_0x1b9d61){if(_0x1b9d61){_0x35c36f[_0xf541('0x34')]=_[_0xf541('0x4a')](db[_0xf541('0x63')]['rawAttributes']);_0x35c36f[_0xf541('0x35')]=_[_0xf541('0x4a')](_0x563bad[_0xf541('0x35')]);_0x35c36f[_0xf541('0x3e')]=_[_0xf541('0x36')](_0x35c36f[_0xf541('0x34')],_0x35c36f[_0xf541('0x35')]);_0x3a4f71[_0xf541('0x37')]=_['intersection'](_0x35c36f['model'],qs[_0xf541('0x38')](_0x563bad[_0xf541('0x35')][_0xf541('0x38')]));_0x3a4f71[_0xf541('0x37')]=_0x3a4f71[_0xf541('0x37')][_0xf541('0x39')]?_0x3a4f71[_0xf541('0x37')]:_0x35c36f[_0xf541('0x34')];if(!_0x563bad[_0xf541('0x35')][_0xf541('0x3a')](_0xf541('0x5d'))){_0x3a4f71[_0xf541('0x23')]=qs[_0xf541('0x23')](_0x563bad[_0xf541('0x35')][_0xf541('0x23')]);_0x3a4f71[_0xf541('0x20')]=qs[_0xf541('0x20')](_0x563bad[_0xf541('0x35')]['offset']);}_0x3a4f71[_0xf541('0x3b')]=qs[_0xf541('0x3c')](_0x563bad['query'][_0xf541('0x3c')]);_0x3a4f71[_0xf541('0x3d')]=qs['filters'](_[_0xf541('0x3f')](_0x563bad[_0xf541('0x35')],_0x35c36f['filters']));_0x3a4f71[_0xf541('0x3d')]['CampaignId']=_0x1b9d61['id'];if(_0x563bad[_0xf541('0x35')][_0xf541('0x40')]){_0x3a4f71[_0xf541('0x3d')]=_[_0xf541('0x41')](_0x3a4f71[_0xf541('0x3d')],{'$or':_[_0xf541('0x42')](_0x3a4f71[_0xf541('0x37')],function(_0x1aed3f){var _0x14d1e7={};_0x14d1e7[_0x1aed3f]={'$like':'%'+_0x563bad['query'][_0xf541('0x40')]+'%'};return _0x14d1e7;})});}_0x3a4f71=_['merge']({},_0x3a4f71,_0x563bad[_0xf541('0x4b')]);return db[_0xf541('0x63')][_0xf541('0x22')]({'where':_0x3a4f71['where']})[_0xf541('0x29')](function(_0x2f41c8){_0x3a519f['count']=_0x2f41c8;if(_0x563bad[_0xf541('0x35')]['includeAll']){_0x3a4f71[_0xf541('0x45')]=[{'all':!![]}];}return db[_0xf541('0x63')][_0xf541('0x46')](_0x3a4f71);})[_0xf541('0x29')](function(_0x16f274){_0x3a519f[_0xf541('0x47')]=_0x16f274;return _0x3a519f;});}})['then'](respondWithFilteredResult(_0x4e2f6f,_0x3a4f71))[_0xf541('0x4c')](handleError(_0x4e2f6f,null));};exports[_0xf541('0x64')]=function(_0x23f2e0,_0xe48132,_0xede2d7){var _0x5cd437={'raw':!![],'where':{}};var _0x4be10b={};var _0x408570={'count':0x0,'rows':[]};return db['Campaign'][_0xf541('0x5c')]({'where':{'id':_0x23f2e0[_0xf541('0x49')]['id']}})[_0xf541('0x29')](handleEntityNotFound(_0xe48132,null))[_0xf541('0x29')](function(_0x430064){if(_0x430064){_0x4be10b[_0xf541('0x34')]=_[_0xf541('0x4a')](db[_0xf541('0x65')][_0xf541('0x31')]);_0x4be10b[_0xf541('0x35')]=_[_0xf541('0x4a')](_0x23f2e0['query']);_0x4be10b[_0xf541('0x3e')]=_['intersection'](_0x4be10b[_0xf541('0x34')],_0x4be10b[_0xf541('0x35')]);_0x5cd437[_0xf541('0x37')]=_['intersection'](_0x4be10b[_0xf541('0x34')],qs[_0xf541('0x38')](_0x23f2e0[_0xf541('0x35')]['fields']));_0x5cd437[_0xf541('0x37')]=_0x5cd437[_0xf541('0x37')][_0xf541('0x39')]?_0x5cd437[_0xf541('0x37')]:_0x4be10b['model'];if(!_0x23f2e0['query'][_0xf541('0x3a')](_0xf541('0x5d'))){_0x5cd437['limit']=qs['limit'](_0x23f2e0[_0xf541('0x35')]['limit']);_0x5cd437[_0xf541('0x20')]=qs[_0xf541('0x20')](_0x23f2e0['query'][_0xf541('0x20')]);}_0x5cd437[_0xf541('0x3b')]=qs[_0xf541('0x3c')](_0x23f2e0[_0xf541('0x35')]['sort']);_0x5cd437['where']=qs[_0xf541('0x3e')](_[_0xf541('0x3f')](_0x23f2e0[_0xf541('0x35')],_0x4be10b['filters']));_0x5cd437[_0xf541('0x3d')][_0xf541('0x5e')]=_0x430064['id'];if(_0x23f2e0[_0xf541('0x35')][_0xf541('0x40')]){_0x5cd437[_0xf541('0x3d')]=_[_0xf541('0x41')](_0x5cd437[_0xf541('0x3d')],{'$or':_[_0xf541('0x42')](_0x5cd437['attributes'],function(_0x394ec3){var _0xc26acf={};_0xc26acf[_0x394ec3]={'$like':'%'+_0x23f2e0[_0xf541('0x35')][_0xf541('0x40')]+'%'};return _0xc26acf;})});}_0x5cd437=_[_0xf541('0x41')]({},_0x5cd437,_0x23f2e0[_0xf541('0x4b')]);return db[_0xf541('0x65')][_0xf541('0x22')]({'where':_0x5cd437[_0xf541('0x3d')]})[_0xf541('0x29')](function(_0x448173){_0x408570['count']=_0x448173;if(_0x23f2e0[_0xf541('0x35')][_0xf541('0x44')]){_0x5cd437[_0xf541('0x45')]=[{'all':!![]}];}return db[_0xf541('0x65')][_0xf541('0x46')](_0x5cd437);})[_0xf541('0x29')](function(_0x32a659){_0x408570[_0xf541('0x47')]=_0x32a659;return _0x408570;});}})['then'](respondWithFilteredResult(_0xe48132,_0x5cd437))['catch'](handleError(_0xe48132,null));};exports[_0xf541('0x66')]=function(_0x150903,_0x661f5d,_0x10ec60){var _0x1d8da0={};var _0x462db4={};var _0x5403cd;var _0x2eea35;return db[_0xf541('0x30')][_0xf541('0x5c')]({'where':{'id':_0x150903[_0xf541('0x49')]['id']}})[_0xf541('0x29')](handleEntityNotFound(_0x661f5d,null))[_0xf541('0x29')](function(_0x26d13e){if(_0x26d13e){_0x5403cd=_0x26d13e;_0x462db4[_0xf541('0x34')]=_[_0xf541('0x4a')](db['CmList'][_0xf541('0x31')]);_0x462db4['query']=_[_0xf541('0x4a')](_0x150903['query']);_0x462db4[_0xf541('0x3e')]=_['intersection'](_0x462db4[_0xf541('0x34')],_0x462db4[_0xf541('0x35')]);_0x1d8da0[_0xf541('0x37')]=_[_0xf541('0x36')](_0x462db4[_0xf541('0x34')],qs[_0xf541('0x38')](_0x150903['query'][_0xf541('0x38')]));_0x1d8da0[_0xf541('0x37')]=_0x1d8da0[_0xf541('0x37')][_0xf541('0x39')]?_0x1d8da0[_0xf541('0x37')]:_0x462db4[_0xf541('0x34')];_0x1d8da0[_0xf541('0x3b')]=qs[_0xf541('0x3c')](_0x150903['query'][_0xf541('0x3c')]);_0x1d8da0[_0xf541('0x3d')]=qs[_0xf541('0x3e')](_[_0xf541('0x3f')](_0x150903[_0xf541('0x35')],_0x462db4[_0xf541('0x3e')]));if(_0x150903[_0xf541('0x35')][_0xf541('0x40')]){_0x1d8da0[_0xf541('0x3d')]=_[_0xf541('0x41')](_0x1d8da0[_0xf541('0x3d')],{'$or':_[_0xf541('0x42')](_0x1d8da0[_0xf541('0x37')],function(_0x1beb9e){var _0x55bd59={};_0x55bd59[_0x1beb9e]={'$like':'%'+_0x150903['query'][_0xf541('0x40')]+'%'};return _0x55bd59;})});}_0x1d8da0=_[_0xf541('0x41')]({},_0x1d8da0,_0x150903[_0xf541('0x4b')]);return _0x5403cd[_0xf541('0x66')](_0x1d8da0);}})['then'](function(_0x38024d){if(_0x38024d){_0x2eea35=_0x38024d['length'];if(!_0x150903[_0xf541('0x35')][_0xf541('0x3a')](_0xf541('0x5d'))){_0x1d8da0[_0xf541('0x23')]=qs[_0xf541('0x23')](_0x150903[_0xf541('0x35')][_0xf541('0x23')]);_0x1d8da0[_0xf541('0x20')]=qs[_0xf541('0x20')](_0x150903[_0xf541('0x35')]['offset']);}return _0x5403cd[_0xf541('0x66')](_0x1d8da0);}})[_0xf541('0x29')](function(_0x495ae3){if(_0x495ae3){return _0x495ae3?{'count':_0x2eea35,'rows':_0x495ae3}:null;}})[_0xf541('0x29')](respondWithResult(_0x661f5d,null))[_0xf541('0x4c')](handleError(_0x661f5d,null));};exports['addLists']=function(_0x48922b,_0x44118e,_0x22abb0){var _0x30393a,_0x56ac75;return db[_0xf541('0x30')][_0xf541('0x53')]({'where':{'id':_0x48922b['params']['id']}})['then'](handleEntityNotFound(_0x44118e,null))[_0xf541('0x29')](function(_0xb9bc0d){if(_0xb9bc0d){_0x56ac75=_0xb9bc0d;return _0xb9bc0d[_0xf541('0x67')](_0x48922b[_0xf541('0x4e')][_0xf541('0x68')],_[_0xf541('0x58')](_0x48922b[_0xf541('0x4e')],[_0xf541('0x68'),'id'])||{});}return null;})[_0xf541('0x69')](function(_0x34a0fc){var _0x2f5f13;_0x30393a=_0x34a0fc||[];var _0x2da896=[];if(_0x34a0fc){for(var _0x42509b=0x0;_0x42509b<_0x34a0fc['length'];_0x42509b+=0x1){var _0x42b806=_0x34a0fc[_0x42509b]['get']({'plain':!![]});_0x56ac75['dialCheckDuplicateType']=_0x48922b['body'][_0xf541('0x6a')]?_0x48922b[_0xf541('0x4e')][_0xf541('0x6a')]:_0x56ac75['dialCheckDuplicateType'];switch(_0x56ac75['dialCheckDuplicateType']){case _0xf541('0x6b'):_0x2f5f13=squel['insert']()['into'](_0xf541('0x6c'))[_0xf541('0x6d')]([_0xf541('0x6e'),_0xf541('0x6f'),_0xf541('0x70'),_0xf541('0x71'),'CampaignId',_0xf541('0x72'),'updatedAt'],squel[_0xf541('0x73')]()[_0xf541('0x74')](_0xf541('0x6e'),'phone')[_0xf541('0x74')]('NOW()','scheduledAt')['field']('id','ContactId')[_0xf541('0x74')](_0x42b806['CmListId']['toString'](),_0xf541('0x71'))[_0xf541('0x74')](_0x48922b['params']['id']['toString'](),_0xf541('0x5e'))[_0xf541('0x74')](_0xf541('0x75'),'createdAt')[_0xf541('0x74')](_0xf541('0x75'),_0xf541('0x59'))[_0xf541('0x76')](_0xf541('0x77'))[_0xf541('0x3d')](_0xf541('0x78'))[_0xf541('0x3d')](_0xf541('0x79'),_0x42b806[_0xf541('0x7a')][_0xf541('0x7b')]())[_0xf541('0x3d')](_0xf541('0x7c'))[_0xf541('0x3d')](_0xf541('0x7d'),squel[_0xf541('0x73')]()[_0xf541('0x74')](_0xf541('0x7e'))[_0xf541('0x76')](_0xf541('0x7f'))['where'](_0xf541('0x80'),_0x48922b[_0xf541('0x49')]['id'][_0xf541('0x7b')]()))[_0xf541('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf541('0x73')]()[_0xf541('0x74')](_0xf541('0x81'))[_0xf541('0x76')](_0xf541('0x6c'))[_0xf541('0x3d')]('CampaignId\x20=\x20?',_0x48922b[_0xf541('0x49')]['id'][_0xf541('0x7b')]())))[_0xf541('0x7b')]();break;case _0xf541('0x82'):_0x2f5f13=squel['insert']()[_0xf541('0x83')]('cm_hopper')[_0xf541('0x6d')]([_0xf541('0x6e'),_0xf541('0x6f'),_0xf541('0x70'),'ListId',_0xf541('0x5e'),_0xf541('0x72'),'updatedAt'],squel['select']()[_0xf541('0x74')](_0xf541('0x6e'),_0xf541('0x6e'))['field']('NOW()',_0xf541('0x6f'))[_0xf541('0x74')]('id',_0xf541('0x70'))[_0xf541('0x74')](_0x42b806[_0xf541('0x7a')][_0xf541('0x7b')](),_0xf541('0x71'))[_0xf541('0x74')](_0x48922b[_0xf541('0x49')]['id'][_0xf541('0x7b')](),'CampaignId')[_0xf541('0x74')]('NOW()',_0xf541('0x72'))[_0xf541('0x74')](_0xf541('0x75'),_0xf541('0x59'))[_0xf541('0x76')](_0xf541('0x77'))[_0xf541('0x3d')](_0xf541('0x78'))[_0xf541('0x3d')](_0xf541('0x79'),_0x42b806[_0xf541('0x7a')]['toString']())[_0xf541('0x3d')](_0xf541('0x7c'))['where'](_0xf541('0x7d'),squel['select']()[_0xf541('0x74')](_0xf541('0x81'))[_0xf541('0x76')](_0xf541('0x6c'))[_0xf541('0x3d')](_0xf541('0x80'),_0x48922b[_0xf541('0x49')]['id'][_0xf541('0x7b')]())))[_0xf541('0x7b')]();break;default:_0x2f5f13=squel[_0xf541('0x84')]()[_0xf541('0x83')](_0xf541('0x6c'))['fromQuery']([_0xf541('0x6e'),'scheduledAt',_0xf541('0x70'),'ListId',_0xf541('0x5e'),'createdAt',_0xf541('0x59')],squel[_0xf541('0x73')]()[_0xf541('0x74')]('phone',_0xf541('0x6e'))[_0xf541('0x74')](_0xf541('0x75'),_0xf541('0x6f'))[_0xf541('0x74')]('id',_0xf541('0x70'))['field'](_0x42b806[_0xf541('0x7a')][_0xf541('0x7b')](),_0xf541('0x71'))['field'](_0x48922b[_0xf541('0x49')]['id'][_0xf541('0x7b')](),_0xf541('0x5e'))['field'](_0xf541('0x75'),_0xf541('0x72'))[_0xf541('0x74')](_0xf541('0x75'),_0xf541('0x59'))[_0xf541('0x76')]('cm_contacts')['where'](_0xf541('0x78'))[_0xf541('0x3d')]('ListId\x20=\x20?',_0x42b806[_0xf541('0x7a')][_0xf541('0x7b')]())[_0xf541('0x3d')](_0xf541('0x7c')))[_0xf541('0x7b')]();}_0x2da896[_0xf541('0x85')](db[_0xf541('0x86')][_0xf541('0x35')](_0x2f5f13));}return BPromise[_0xf541('0x87')](_0x2da896);}})[_0xf541('0x29')](function(){return _0x30393a;})[_0xf541('0x29')](respondWithResult(_0x44118e,null))[_0xf541('0x4c')](handleError(_0x44118e,null));};exports[_0xf541('0x88')]=function(_0x3192ac,_0x2cdbd1,_0x550b61){return db[_0xf541('0x30')][_0xf541('0x53')]({'where':{'id':_0x3192ac[_0xf541('0x49')]['id']}})[_0xf541('0x29')](handleEntityNotFound(_0x2cdbd1,null))[_0xf541('0x29')](function(_0x36fa99){if(_0x36fa99){return _0x36fa99[_0xf541('0x88')](_0x3192ac[_0xf541('0x35')][_0xf541('0x68')]);}})[_0xf541('0x29')](function(_0x191279){if(_0x191279){return db[_0xf541('0x5f')][_0xf541('0x2b')]({'where':{'ListId':_0x3192ac[_0xf541('0x35')][_0xf541('0x68')],'CampaignId':_0x3192ac['params']['id']}})[_0xf541('0x29')](function(){return _0x191279;});}})[_0xf541('0x29')](respondWithStatusCode(_0x2cdbd1,null))[_0xf541('0x4c')](handleError(_0x2cdbd1,null));};exports[_0xf541('0x89')]=function(_0x493e4e,_0x1e3e72,_0x5a0237){var _0x4acfe={};var _0x14cdc6={};var _0x4374c4;var _0x29474a;return db[_0xf541('0x30')][_0xf541('0x5c')]({'where':{'id':_0x493e4e[_0xf541('0x49')]['id']}})[_0xf541('0x29')](handleEntityNotFound(_0x1e3e72,null))[_0xf541('0x29')](function(_0x57b42d){if(_0x57b42d){_0x4374c4=_0x57b42d;_0x14cdc6[_0xf541('0x34')]=_['keys'](db['CmList'][_0xf541('0x31')]);_0x14cdc6[_0xf541('0x35')]=_[_0xf541('0x4a')](_0x493e4e[_0xf541('0x35')]);_0x14cdc6[_0xf541('0x3e')]=_[_0xf541('0x36')](_0x14cdc6[_0xf541('0x34')],_0x14cdc6['query']);_0x4acfe[_0xf541('0x37')]=_['intersection'](_0x14cdc6['model'],qs['fields'](_0x493e4e[_0xf541('0x35')]['fields']));_0x4acfe[_0xf541('0x37')]=_0x4acfe[_0xf541('0x37')]['length']?_0x4acfe['attributes']:_0x14cdc6[_0xf541('0x34')];_0x4acfe[_0xf541('0x3b')]=qs['sort'](_0x493e4e[_0xf541('0x35')][_0xf541('0x3c')]);_0x4acfe[_0xf541('0x3d')]=qs[_0xf541('0x3e')](_[_0xf541('0x3f')](_0x493e4e['query'],_0x14cdc6[_0xf541('0x3e')]));if(_0x493e4e[_0xf541('0x35')][_0xf541('0x40')]){_0x4acfe['where']=_[_0xf541('0x41')](_0x4acfe['where'],{'$or':_[_0xf541('0x42')](_0x4acfe[_0xf541('0x37')],function(_0x3b5d42){var _0x1d5f17={};_0x1d5f17[_0x3b5d42]={'$like':'%'+_0x493e4e[_0xf541('0x35')]['filter']+'%'};return _0x1d5f17;})});}_0x4acfe=_[_0xf541('0x41')]({},_0x4acfe,_0x493e4e[_0xf541('0x4b')]);return _0x4374c4[_0xf541('0x89')](_0x4acfe);}})[_0xf541('0x29')](function(_0x43eea7){if(_0x43eea7){_0x29474a=_0x43eea7[_0xf541('0x39')];if(!_0x493e4e['query'][_0xf541('0x3a')](_0xf541('0x5d'))){_0x4acfe['limit']=qs[_0xf541('0x23')](_0x493e4e[_0xf541('0x35')][_0xf541('0x23')]);_0x4acfe[_0xf541('0x20')]=qs['offset'](_0x493e4e['query']['offset']);}return _0x4374c4[_0xf541('0x89')](_0x4acfe);}})[_0xf541('0x29')](function(_0x319144){if(_0x319144){return _0x319144?{'count':_0x29474a,'rows':_0x319144}:null;}})[_0xf541('0x29')](respondWithResult(_0x1e3e72,null))[_0xf541('0x4c')](handleError(_0x1e3e72,null));};exports['addBlackLists']=function(_0x49df73,_0x32c660,_0x5e5c41){var _0x22d2b8,_0x15672e;return db[_0xf541('0x30')][_0xf541('0x53')]({'where':{'id':_0x49df73[_0xf541('0x49')]['id']}})[_0xf541('0x29')](handleEntityNotFound(_0x32c660,null))[_0xf541('0x29')](function(_0x18f1a0){if(_0x18f1a0){_0x15672e=_0x18f1a0;return _0x18f1a0[_0xf541('0x8a')](_0x49df73[_0xf541('0x4e')][_0xf541('0x68')],_[_0xf541('0x58')](_0x49df73[_0xf541('0x4e')],['ids','id'])||{});}return null;})[_0xf541('0x69')](function(_0x369782){var _0x4f6e85;_0x22d2b8=_0x369782||[];var _0x2a80f0=[];if(_0x369782){for(var _0x5df9b8=0x0;_0x5df9b8<_0x369782[_0xf541('0x39')];_0x5df9b8+=0x1){var _0x243ce7=_0x369782[_0x5df9b8]['get']({'plain':!![]});_0x4f6e85=squel['insert']()[_0xf541('0x83')](_0xf541('0x8b'))[_0xf541('0x6d')](['phone',_0xf541('0x70'),_0xf541('0x71'),_0xf541('0x5e'),'createdAt',_0xf541('0x59')],squel[_0xf541('0x73')]()['field']('phone','phone')[_0xf541('0x74')]('id',_0xf541('0x70'))[_0xf541('0x74')](_0x243ce7[_0xf541('0x7a')][_0xf541('0x7b')](),_0xf541('0x71'))[_0xf541('0x74')](_0x49df73['params']['id']['toString'](),_0xf541('0x5e'))[_0xf541('0x74')](_0xf541('0x75'),_0xf541('0x72'))['field'](_0xf541('0x75'),'updatedAt')['from'](_0xf541('0x77'))['where'](_0xf541('0x78'))[_0xf541('0x3d')]('ListId\x20=\x20?',_0x243ce7['CmListId']['toString']())[_0xf541('0x3d')](_0xf541('0x7c')))[_0xf541('0x7b')]();_0x2a80f0[_0xf541('0x85')](db[_0xf541('0x86')][_0xf541('0x35')](_0x4f6e85));}return BPromise[_0xf541('0x87')](_0x2a80f0);}})['then'](function(){return _0x22d2b8;})['then'](respondWithResult(_0x32c660,null))['catch'](handleError(_0x32c660,null));};exports[_0xf541('0x8c')]=function(_0x1f6b85,_0x1db463,_0x520be8){return db[_0xf541('0x30')][_0xf541('0x53')]({'where':{'id':_0x1f6b85[_0xf541('0x49')]['id']}})[_0xf541('0x29')](handleEntityNotFound(_0x1db463,null))[_0xf541('0x29')](function(_0x535e99){if(_0x535e99){return _0x535e99[_0xf541('0x8c')](_0x1f6b85[_0xf541('0x35')][_0xf541('0x68')]);}})[_0xf541('0x29')](function(_0x943d71){if(_0x943d71){return db[_0xf541('0x65')][_0xf541('0x2b')]({'where':{'ListId':_0x1f6b85[_0xf541('0x35')][_0xf541('0x68')],'CampaignId':_0x1f6b85[_0xf541('0x49')]['id']}})[_0xf541('0x29')](function(){return _0x943d71;});}})[_0xf541('0x29')](respondWithStatusCode(_0x1db463,null))[_0xf541('0x4c')](handleError(_0x1db463,null));};
\ No newline at end of file
index 6c5ac3a..48b39a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xe86415,_0x4fe3ab){var _0x4dc900=function(_0xc4dd21){while(--_0xc4dd21){_0xe86415['push'](_0xe86415['shift']());}};_0x4dc900(++_0x4fe3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x347456,_0x34d8cc){_0x347456=_0x347456-0x0;var _0x16d47d=_0x7a54[_0x347456];return _0x16d47d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 876ac72..b54a921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed8a=['include','model','attributes','map','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','Campaign,\x20%s,\x20%s','error','message','result','GetCampaign','Campaign','findAll','options','raw','limit'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0xed8a,0xc5));var _0xaed8=function(_0x4902b1,_0x43ed4a){_0x4902b1=_0x4902b1-0x0;var _0x260351=_0xed8a[_0x4902b1];return _0x260351;};'use strict';var _=require(_0xaed8('0x0'));var util=require(_0xaed8('0x1'));var moment=require(_0xaed8('0x2'));var BPromise=require(_0xaed8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaed8('0x4'));var db=require(_0xaed8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaed8('0x6'))(_0xaed8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaed8('0x8')][_0xaed8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3db036,_0x2f6ab8,_0x291304){return new BPromise(function(_0x42bc11,_0x24ba07){return client['request'](_0x3db036,_0x291304)[_0xaed8('0xa')](function(_0x9c677){logger[_0xaed8('0xb')]('Campaign,\x20%s,\x20%s',_0x2f6ab8,_0xaed8('0xc'));logger[_0xaed8('0xd')](_0xaed8('0xe'),_0x2f6ab8,_0xaed8('0xc'),JSON[_0xaed8('0xf')](_0x9c677));if(_0x9c677['error']){if(_0x9c677['error'][_0xaed8('0x10')]===0x1f4){logger['error'](_0xaed8('0x11'),_0x2f6ab8,_0x9c677[_0xaed8('0x12')][_0xaed8('0x13')]);return _0x24ba07(_0x9c677[_0xaed8('0x12')]['message']);}logger[_0xaed8('0x12')](_0xaed8('0x11'),_0x2f6ab8,_0x9c677[_0xaed8('0x12')][_0xaed8('0x13')]);return _0x42bc11(_0x9c677[_0xaed8('0x12')][_0xaed8('0x13')]);}else{logger['info'](_0xaed8('0x11'),_0x2f6ab8,'request\x20sent');_0x42bc11(_0x9c677[_0xaed8('0x14')][_0xaed8('0x13')]);}})['catch'](function(_0x1827a9){logger[_0xaed8('0x12')](_0xaed8('0x11'),_0x2f6ab8,_0x1827a9);_0x24ba07(_0x1827a9);});});}exports[_0xaed8('0x15')]=function(_0x427d37){var _0x1b8eb8=this;return new Promise(function(_0x42eae7,_0x3c6313){return db[_0xaed8('0x16')][_0xaed8('0x17')]({'raw':_0x427d37[_0xaed8('0x18')]?_0x427d37[_0xaed8('0x18')][_0xaed8('0x19')]===undefined?!![]:![]:!![],'where':_0x427d37[_0xaed8('0x18')]?_0x427d37[_0xaed8('0x18')]['where']||null:null,'attributes':_0x427d37['options']?_0x427d37[_0xaed8('0x18')]['attributes']||null:null,'limit':_0x427d37[_0xaed8('0x18')]?_0x427d37[_0xaed8('0x18')][_0xaed8('0x1a')]||null:null,'include':_0x427d37[_0xaed8('0x18')]?_0x427d37['options']['include']?_['map'](_0x427d37[_0xaed8('0x18')][_0xaed8('0x1b')],function(_0x448ef9){return{'model':db[_0x448ef9[_0xaed8('0x1c')]],'as':_0x448ef9['as'],'attributes':_0x448ef9[_0xaed8('0x1d')],'include':_0x448ef9[_0xaed8('0x1b')]?_[_0xaed8('0x1e')](_0x448ef9[_0xaed8('0x1b')],function(_0x10c1fa){return{'model':db[_0x10c1fa['model']],'as':_0x10c1fa['as'],'attributes':_0x10c1fa[_0xaed8('0x1d')],'include':_0x10c1fa[_0xaed8('0x1b')]?_[_0xaed8('0x1e')](_0x10c1fa[_0xaed8('0x1b')],function(_0x349736){return{'model':db[_0x349736[_0xaed8('0x1c')]],'as':_0x349736['as'],'attributes':_0x349736['attributes']};}):[]};}):[]};}):[]:[]})[_0xaed8('0xa')](function(_0x4c442d){logger[_0xaed8('0xb')]('GetCampaign',_0x427d37);logger[_0xaed8('0xd')]('GetCampaign',_0x427d37,JSON[_0xaed8('0xf')](_0x4c442d));_0x42eae7(_0x4c442d);})[_0xaed8('0x1f')](function(_0x284c6a){logger[_0xaed8('0x12')](_0xaed8('0x15'),_0x284c6a[_0xaed8('0x13')],_0x427d37);_0x3c6313(_0x1b8eb8[_0xaed8('0x12')](0x1f4,_0x284c6a[_0xaed8('0x13')]));});});};
\ No newline at end of file
+var _0x02ef=['result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x127a9f,_0x5f0e6a){var _0x3aaa5f=function(_0x3d5eb6){while(--_0x3d5eb6){_0x127a9f['push'](_0x127a9f['shift']());}};_0x3aaa5f(++_0x5f0e6a);}(_0x02ef,0x11a));var _0xf02e=function(_0x2a2cfd,_0x274d1e){_0x2a2cfd=_0x2a2cfd-0x0;var _0x18c062=_0x02ef[_0x2a2cfd];return _0x18c062;};'use strict';var _=require(_0xf02e('0x0'));var util=require('util');var moment=require(_0xf02e('0x1'));var BPromise=require('bluebird');var rs=require(_0xf02e('0x2'));var fs=require('fs');var Redis=require(_0xf02e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf02e('0x4'));var logger=require(_0xf02e('0x5'))(_0xf02e('0x6'));var config=require(_0xf02e('0x7'));var jayson=require(_0xf02e('0x8'));var client=jayson['client'][_0xf02e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x411cbe,_0x13ef2f,_0x4682a6){return new BPromise(function(_0x2b79b3,_0x37abc8){return client[_0xf02e('0xa')](_0x411cbe,_0x4682a6)[_0xf02e('0xb')](function(_0x22a384){logger[_0xf02e('0xc')](_0xf02e('0xd'),_0x13ef2f,_0xf02e('0xe'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x13ef2f,_0xf02e('0xe'),JSON[_0xf02e('0xf')](_0x22a384));if(_0x22a384['error']){if(_0x22a384['error']['code']===0x1f4){logger[_0xf02e('0x10')](_0xf02e('0xd'),_0x13ef2f,_0x22a384[_0xf02e('0x10')][_0xf02e('0x11')]);return _0x37abc8(_0x22a384[_0xf02e('0x10')][_0xf02e('0x11')]);}logger['error'](_0xf02e('0xd'),_0x13ef2f,_0x22a384['error'][_0xf02e('0x11')]);return _0x2b79b3(_0x22a384[_0xf02e('0x10')]['message']);}else{logger[_0xf02e('0xc')](_0xf02e('0xd'),_0x13ef2f,'request\x20sent');_0x2b79b3(_0x22a384[_0xf02e('0x12')]['message']);}})[_0xf02e('0x13')](function(_0x19c7b9){logger[_0xf02e('0x10')](_0xf02e('0xd'),_0x13ef2f,_0x19c7b9);_0x37abc8(_0x19c7b9);});});}exports[_0xf02e('0x14')]=function(_0x5e7f85){var _0x1d670c=this;return new Promise(function(_0x280af9,_0xc310e1){return db['Campaign'][_0xf02e('0x15')]({'raw':_0x5e7f85[_0xf02e('0x16')]?_0x5e7f85['options'][_0xf02e('0x17')]===undefined?!![]:![]:!![],'where':_0x5e7f85[_0xf02e('0x16')]?_0x5e7f85[_0xf02e('0x16')][_0xf02e('0x18')]||null:null,'attributes':_0x5e7f85['options']?_0x5e7f85[_0xf02e('0x16')][_0xf02e('0x19')]||null:null,'limit':_0x5e7f85['options']?_0x5e7f85[_0xf02e('0x16')][_0xf02e('0x1a')]||null:null,'include':_0x5e7f85[_0xf02e('0x16')]?_0x5e7f85['options'][_0xf02e('0x1b')]?_[_0xf02e('0x1c')](_0x5e7f85['options']['include'],function(_0x4b194f){return{'model':db[_0x4b194f[_0xf02e('0x1d')]],'as':_0x4b194f['as'],'attributes':_0x4b194f[_0xf02e('0x19')],'include':_0x4b194f[_0xf02e('0x1b')]?_['map'](_0x4b194f[_0xf02e('0x1b')],function(_0x43e6c1){return{'model':db[_0x43e6c1['model']],'as':_0x43e6c1['as'],'attributes':_0x43e6c1[_0xf02e('0x19')],'include':_0x43e6c1[_0xf02e('0x1b')]?_[_0xf02e('0x1c')](_0x43e6c1[_0xf02e('0x1b')],function(_0x446485){return{'model':db[_0x446485[_0xf02e('0x1d')]],'as':_0x446485['as'],'attributes':_0x446485[_0xf02e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf02e('0xb')](function(_0x19e3d0){logger[_0xf02e('0xc')](_0xf02e('0x14'),_0x5e7f85);logger['debug'](_0xf02e('0x14'),_0x5e7f85,JSON[_0xf02e('0xf')](_0x19e3d0));_0x280af9(_0x19e3d0);})[_0xf02e('0x13')](function(_0x49c554){logger[_0xf02e('0x10')]('GetCampaign',_0x49c554[_0xf02e('0x11')],_0x5e7f85);_0xc310e1(_0x1d670c[_0xf02e('0x10')](0x1f4,_0x49c554['message']));});});};
\ No newline at end of file
index 50831d0..edb7fbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61cd=['removeBlackLists','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./campaign.controller','index','get','/:id','isAuthenticated','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','removeLists'];(function(_0x5be092,_0x5b9ed3){var _0xbf3cba=function(_0x5439dd){while(--_0x5439dd){_0x5be092['push'](_0x5be092['shift']());}};_0xbf3cba(++_0x5b9ed3);}(_0x61cd,0xa7));var _0xd61c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x61cd[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xd61c('0x0'));var util=require(_0xd61c('0x1'));var path=require(_0xd61c('0x2'));var timeout=require(_0xd61c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd61c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd61c('0x5'));var controller=require(_0xd61c('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd61c('0x7')]);router[_0xd61c('0x8')](_0xd61c('0x9'),auth[_0xd61c('0xa')](),controller[_0xd61c('0xb')]);router[_0xd61c('0x8')](_0xd61c('0xc'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xd61c('0x8')](_0xd61c('0xd'),auth[_0xd61c('0xa')](),controller['getHopperHistories']);router[_0xd61c('0x8')](_0xd61c('0xe'),auth[_0xd61c('0xa')](),controller[_0xd61c('0xf')]);router[_0xd61c('0x8')](_0xd61c('0x10'),auth[_0xd61c('0xa')](),controller[_0xd61c('0x11')]);router[_0xd61c('0x8')](_0xd61c('0x12'),auth[_0xd61c('0xa')](),controller[_0xd61c('0x13')]);router['get'](_0xd61c('0x14'),auth[_0xd61c('0xa')](),controller[_0xd61c('0x15')]);router[_0xd61c('0x16')]('/',auth[_0xd61c('0xa')](),controller[_0xd61c('0x17')]);router[_0xd61c('0x16')](_0xd61c('0x18'),auth['isAuthenticated'](),controller[_0xd61c('0x19')]);router[_0xd61c('0x16')](_0xd61c('0x12'),auth[_0xd61c('0xa')](),controller[_0xd61c('0x1a')]);router[_0xd61c('0x16')](_0xd61c('0x14'),auth[_0xd61c('0xa')](),controller[_0xd61c('0x1b')]);router['put'](_0xd61c('0x9'),auth['isAuthenticated'](),controller[_0xd61c('0x1c')]);router['delete']('/:id',auth[_0xd61c('0xa')](),controller['destroy']);router[_0xd61c('0x1d')](_0xd61c('0x12'),auth['isAuthenticated'](),controller[_0xd61c('0x1e')]);router[_0xd61c('0x1d')](_0xd61c('0x14'),auth['isAuthenticated'](),controller[_0xd61c('0x1f')]);module[_0xd61c('0x20')]=router;
\ No newline at end of file
+var _0x9969=['/:id','show','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','delete','removeLists','removeBlackLists','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index'];(function(_0x4b41a1,_0x5aab78){var _0x5e7ca=function(_0x241b9e){while(--_0x241b9e){_0x4b41a1['push'](_0x4b41a1['shift']());}};_0x5e7ca(++_0x5aab78);}(_0x9969,0x130));var _0x9996=function(_0x37cb57,_0x4773f2){_0x37cb57=_0x37cb57-0x0;var _0x2b0317=_0x9969[_0x37cb57];return _0x2b0317;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9996('0x0'));var timeout=require(_0x9996('0x1'));var express=require(_0x9996('0x2'));var router=express[_0x9996('0x3')]();var fs_extra=require(_0x9996('0x4'));var auth=require(_0x9996('0x5'));var interaction=require(_0x9996('0x6'));var config=require(_0x9996('0x7'));var controller=require(_0x9996('0x8'));router[_0x9996('0x9')]('/',auth['isAuthenticated'](),controller[_0x9996('0xa')]);router[_0x9996('0x9')](_0x9996('0xb'),auth['isAuthenticated'](),controller[_0x9996('0xc')]);router[_0x9996('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x9996('0xd')]);router[_0x9996('0x9')](_0x9996('0xe'),auth[_0x9996('0xf')](),controller[_0x9996('0x10')]);router[_0x9996('0x9')](_0x9996('0x11'),auth[_0x9996('0xf')](),controller[_0x9996('0x12')]);router[_0x9996('0x9')](_0x9996('0x13'),auth[_0x9996('0xf')](),controller['getHopperBlacks']);router[_0x9996('0x9')]('/:id/lists',auth[_0x9996('0xf')](),controller[_0x9996('0x14')]);router['get'](_0x9996('0x15'),auth['isAuthenticated'](),controller[_0x9996('0x16')]);router[_0x9996('0x17')]('/',auth[_0x9996('0xf')](),controller[_0x9996('0x18')]);router[_0x9996('0x17')](_0x9996('0x19'),auth['isAuthenticated'](),controller[_0x9996('0x1a')]);router[_0x9996('0x17')](_0x9996('0x1b'),auth['isAuthenticated'](),controller[_0x9996('0x1c')]);router[_0x9996('0x17')]('/:id/blacklists',auth[_0x9996('0xf')](),controller[_0x9996('0x1d')]);router['put']('/:id',auth[_0x9996('0xf')](),controller[_0x9996('0x1e')]);router[_0x9996('0x1f')]('/:id',auth[_0x9996('0xf')](),controller['destroy']);router[_0x9996('0x1f')](_0x9996('0x1b'),auth['isAuthenticated'](),controller[_0x9996('0x20')]);router[_0x9996('0x1f')](_0x9996('0x15'),auth[_0x9996('0xf')](),controller[_0x9996('0x21')]);module[_0x9996('0x22')]=router;
\ No newline at end of file
index 25f9479..2fd3dec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebf8=['VIRTUAL','getDataValue','key','exports','TEXT','STRING'];(function(_0xab647f,_0x58fc7a){var _0x2cd661=function(_0x43b216){while(--_0x43b216){_0xab647f['push'](_0xab647f['shift']());}};_0x2cd661(++_0x58fc7a);}(_0xebf8,0x1bf));var _0x8ebf=function(_0x52d68b,_0x112ba7){_0x52d68b=_0x52d68b-0x0;var _0x29633f=_0xebf8[_0x52d68b];return _0x29633f;};'use strict';var Sequelize=require('sequelize');module[_0x8ebf('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8ebf('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8ebf('0x2')]},'name':{'type':Sequelize[_0x8ebf('0x3')],'get':function(){return this[_0x8ebf('0x4')](_0x8ebf('0x5'));}}};
\ No newline at end of file
+var _0xc67b=['TEXT','VIRTUAL','getDataValue','key','exports','STRING'];(function(_0x35b3e9,_0x1aed1d){var _0x19d6cc=function(_0x6a18b8){while(--_0x6a18b8){_0x35b3e9['push'](_0x35b3e9['shift']());}};_0x19d6cc(++_0x1aed1d);}(_0xc67b,0xc4));var _0xbc67=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc67b[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xbc67('0x0')]={'key':{'type':Sequelize[_0xbc67('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xbc67('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xbc67('0x3')],'get':function(){return this[_0xbc67('0x4')](_0xbc67('0x5'));}}};
\ No newline at end of file
index 2422f52..81427af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e9a=['params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','fields','attributes','length','nolimit','order','sort','filters','pick','where','merge','filter','findAll','rows','catch','show','intersection','include','options','find','update','body'];(function(_0x284f57,_0xa608a1){var _0x591b9f=function(_0x5e4be8){while(--_0x5e4be8){_0x284f57['push'](_0x284f57['shift']());}};_0x591b9f(++_0xa608a1);}(_0x4e9a,0x10c));var _0xa4e9=function(_0x53c2ab,_0x5df38e){_0x53c2ab=_0x53c2ab-0x0;var _0x48d648=_0x4e9a[_0x53c2ab];return _0x48d648;};'use strict';var emlformat=require(_0xa4e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4e9('0x1'));var jsonpatch=require(_0xa4e9('0x2'));var rp=require(_0xa4e9('0x3'));var moment=require(_0xa4e9('0x4'));var BPromise=require(_0xa4e9('0x5'));var Mustache=require(_0xa4e9('0x6'));var util=require(_0xa4e9('0x7'));var path=require(_0xa4e9('0x8'));var sox=require('sox');var csv=require(_0xa4e9('0x9'));var ejs=require(_0xa4e9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4e9('0xb'));var squel=require(_0xa4e9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa4e9('0xd'));var toCsv=require(_0xa4e9('0x9'));var querystring=require('querystring');var Papa=require(_0xa4e9('0xe'));var Redis=require(_0xa4e9('0xf'));var authService=require(_0xa4e9('0x10'));var qs=require(_0xa4e9('0x11'));var as=require(_0xa4e9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa4e9('0x13'));var utils=require(_0xa4e9('0x14'));var config=require(_0xa4e9('0x15'));var licenseUtil=require(_0xa4e9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b2395,_0x4ced91){_0x4ced91=_0x4ced91||0xcc;return function(_0x3d592a){if(_0x3d592a){return _0x3b2395[_0xa4e9('0x17')](_0x4ced91);}return _0x3b2395[_0xa4e9('0x18')](_0x4ced91)['end']();};}function respondWithResult(_0x4ec5f8,_0x52ed14){_0x52ed14=_0x52ed14||0xc8;return function(_0x3b1ded){if(_0x3b1ded){return _0x4ec5f8[_0xa4e9('0x18')](_0x52ed14)[_0xa4e9('0x19')](_0x3b1ded);}};}function respondWithFilteredResult(_0x489b39,_0x30b5ba){return function(_0x468af2){if(_0x468af2){var _0x82780a=typeof _0x30b5ba[_0xa4e9('0x1a')]===_0xa4e9('0x1b')&&typeof _0x30b5ba[_0xa4e9('0x1c')]===_0xa4e9('0x1b');var _0x44ba4c=_0x468af2['count'];var _0x11e22f=_0x82780a?0x0:_0x30b5ba[_0xa4e9('0x1a')];var _0x12ae0c=_0x82780a?_0x468af2[_0xa4e9('0x1d')]:_0x30b5ba[_0xa4e9('0x1a')]+_0x30b5ba[_0xa4e9('0x1c')];var _0x5e4290;if(_0x12ae0c>=_0x44ba4c){_0x12ae0c=_0x44ba4c;_0x5e4290=0xc8;}else{_0x5e4290=0xce;}_0x489b39[_0xa4e9('0x18')](_0x5e4290);return _0x489b39['set'](_0xa4e9('0x1e'),_0x11e22f+'-'+_0x12ae0c+'/'+_0x44ba4c)[_0xa4e9('0x19')](_0x468af2);}return null;};}function patchUpdates(_0x2a9d5c){return function(_0x5d2941){try{jsonpatch['apply'](_0x5d2941,_0x2a9d5c,!![]);}catch(_0x378d1a){return BPromise[_0xa4e9('0x1f')](_0x378d1a);}return _0x5d2941[_0xa4e9('0x20')]();};}function saveUpdates(_0x4b7ec8,_0x40ac4c){return function(_0x1aa765){if(_0x1aa765){return _0x1aa765['update'](_0x4b7ec8)[_0xa4e9('0x21')](function(_0x1f534d){return _0x1f534d;});}return null;};}function removeEntity(_0xc091f5,_0x3b853c){return function(_0x1530e1){if(_0x1530e1){return _0x1530e1[_0xa4e9('0x22')]()['then'](function(){var _0x2342db=_0x1530e1[_0xa4e9('0x23')]({'plain':!![]});var _0x48b8e0=_0xa4e9('0x24');return db[_0xa4e9('0x25')][_0xa4e9('0x22')]({'where':{'type':_0x48b8e0,'resourceId':_0x2342db['id']}})[_0xa4e9('0x21')](function(){return _0x1530e1;});})[_0xa4e9('0x21')](function(){_0xc091f5[_0xa4e9('0x18')](0xcc)[_0xa4e9('0x26')]();});}};}function handleEntityNotFound(_0x2e3e6c,_0x442fe3){return function(_0xf151dc){if(!_0xf151dc){_0x2e3e6c[_0xa4e9('0x17')](0x194);}return _0xf151dc;};}function handleError(_0x4a1ef5,_0x97e8ce){_0x97e8ce=_0x97e8ce||0x1f4;return function(_0x3f40df){logger[_0xa4e9('0x27')](_0x3f40df[_0xa4e9('0x28')]);if(_0x3f40df['name']){delete _0x3f40df[_0xa4e9('0x29')];}_0x4a1ef5[_0xa4e9('0x18')](_0x97e8ce)[_0xa4e9('0x2a')](_0x3f40df);};}exports['index']=function(_0x341ae7,_0x3cdb9c){var _0x5d6b19={},_0x50eb4c={},_0x29e915={'count':0x0,'rows':[]};var _0x24a6ad=_[_0xa4e9('0x2b')](db[_0xa4e9('0x2c')][_0xa4e9('0x2d')],function(_0x5c8d1d){return{'name':_0x5c8d1d[_0xa4e9('0x2e')],'type':_0x5c8d1d['type'][_0xa4e9('0x2f')]};});_0x50eb4c[_0xa4e9('0x30')]=_['map'](_0x24a6ad,_0xa4e9('0x29'));_0x50eb4c[_0xa4e9('0x31')]=_[_0xa4e9('0x32')](_0x341ae7[_0xa4e9('0x31')]);_0x50eb4c['filters']=_['intersection'](_0x50eb4c[_0xa4e9('0x30')],_0x50eb4c[_0xa4e9('0x31')]);_0x5d6b19['attributes']=_['intersection'](_0x50eb4c['model'],qs[_0xa4e9('0x33')](_0x341ae7[_0xa4e9('0x31')][_0xa4e9('0x33')]));_0x5d6b19[_0xa4e9('0x34')]=_0x5d6b19[_0xa4e9('0x34')][_0xa4e9('0x35')]?_0x5d6b19[_0xa4e9('0x34')]:_0x50eb4c['model'];if(!_0x341ae7[_0xa4e9('0x31')]['hasOwnProperty'](_0xa4e9('0x36'))){_0x5d6b19['limit']=qs[_0xa4e9('0x1c')](_0x341ae7['query'][_0xa4e9('0x1c')]);_0x5d6b19['offset']=qs['offset'](_0x341ae7[_0xa4e9('0x31')][_0xa4e9('0x1a')]);}_0x5d6b19[_0xa4e9('0x37')]=qs[_0xa4e9('0x38')](_0x341ae7[_0xa4e9('0x31')]['sort']);_0x5d6b19['where']=qs[_0xa4e9('0x39')](_[_0xa4e9('0x3a')](_0x341ae7['query'],_0x50eb4c['filters']),_0x24a6ad);if(_0x341ae7[_0xa4e9('0x31')]['filter']){_0x5d6b19[_0xa4e9('0x3b')]=_[_0xa4e9('0x3c')](_0x5d6b19[_0xa4e9('0x3b')],{'$or':[{'key':{'$like':'%'+_0x341ae7[_0xa4e9('0x31')][_0xa4e9('0x3d')]+'%'}},{'value':{'$like':'%'+_0x341ae7['query'][_0xa4e9('0x3d')]+'%'}}]});}_0x5d6b19=_[_0xa4e9('0x3c')]({},_0x5d6b19,_0x341ae7['options']);var _0x5dbae5={'where':_0x5d6b19[_0xa4e9('0x3b')]};return db[_0xa4e9('0x2c')][_0xa4e9('0x1d')](_0x5dbae5)[_0xa4e9('0x21')](function(_0x30519c){_0x29e915[_0xa4e9('0x1d')]=_0x30519c;if(_0x341ae7[_0xa4e9('0x31')]['includeAll']){_0x5d6b19['include']=[{'all':!![]}];}return db[_0xa4e9('0x2c')][_0xa4e9('0x3e')](_0x5d6b19);})[_0xa4e9('0x21')](function(_0x1ce846){_0x29e915[_0xa4e9('0x3f')]=_0x1ce846;return _0x29e915;})[_0xa4e9('0x21')](respondWithFilteredResult(_0x3cdb9c,_0x5d6b19))[_0xa4e9('0x40')](handleError(_0x3cdb9c,null));};exports[_0xa4e9('0x41')]=function(_0x28ac85,_0x5747ef){var _0x3f5435={'raw':!![],'where':{'id':_0x28ac85['params']['id']}},_0x4c4cc0={};_0x4c4cc0[_0xa4e9('0x30')]=_[_0xa4e9('0x32')](db[_0xa4e9('0x2c')]['rawAttributes']);_0x4c4cc0[_0xa4e9('0x31')]=_[_0xa4e9('0x32')](_0x28ac85[_0xa4e9('0x31')]);_0x4c4cc0[_0xa4e9('0x39')]=_[_0xa4e9('0x42')](_0x4c4cc0[_0xa4e9('0x30')],_0x4c4cc0[_0xa4e9('0x31')]);_0x3f5435[_0xa4e9('0x34')]=_[_0xa4e9('0x42')](_0x4c4cc0['model'],qs[_0xa4e9('0x33')](_0x28ac85[_0xa4e9('0x31')][_0xa4e9('0x33')]));_0x3f5435[_0xa4e9('0x34')]=_0x3f5435[_0xa4e9('0x34')][_0xa4e9('0x35')]?_0x3f5435[_0xa4e9('0x34')]:_0x4c4cc0['model'];if(_0x28ac85[_0xa4e9('0x31')]['includeAll']){_0x3f5435[_0xa4e9('0x43')]=[{'all':!![]}];}_0x3f5435=_['merge']({},_0x3f5435,_0x28ac85[_0xa4e9('0x44')]);return db[_0xa4e9('0x2c')][_0xa4e9('0x45')](_0x3f5435)[_0xa4e9('0x21')](handleEntityNotFound(_0x5747ef,null))['then'](respondWithResult(_0x5747ef,null))['catch'](handleError(_0x5747ef,null));};exports[_0xa4e9('0x46')]=function(_0x1890db,_0x585f8c){if(_0x1890db[_0xa4e9('0x47')]['id']){delete _0x1890db['body']['id'];}return db['CannedAnswer'][_0xa4e9('0x45')]({'where':{'id':_0x1890db['params']['id']}})[_0xa4e9('0x21')](handleEntityNotFound(_0x585f8c,null))[_0xa4e9('0x21')](saveUpdates(_0x1890db[_0xa4e9('0x47')],null))[_0xa4e9('0x21')](respondWithResult(_0x585f8c,null))['catch'](handleError(_0x585f8c,null));};exports[_0xa4e9('0x22')]=function(_0x4f4d28,_0x1d91d8){return db['CannedAnswer'][_0xa4e9('0x45')]({'where':{'id':_0x4f4d28[_0xa4e9('0x48')]['id']}})[_0xa4e9('0x21')](handleEntityNotFound(_0x1d91d8,null))[_0xa4e9('0x21')](removeEntity(_0x1d91d8,null))[_0xa4e9('0x40')](handleError(_0x1d91d8,null));};exports[_0xa4e9('0x49')]=function(_0x851f2a,_0x30586d){var _0x41d660={'key':_0x851f2a[_0xa4e9('0x47')][_0xa4e9('0x2f')]};if(_0x851f2a[_0xa4e9('0x47')][_0xa4e9('0x4a')]){_0x41d660[_0xa4e9('0x4a')]=_0x851f2a[_0xa4e9('0x47')][_0xa4e9('0x4a')];}else if(_0x851f2a[_0xa4e9('0x47')][_0xa4e9('0x4b')]){_0x41d660[_0xa4e9('0x4b')]=_0x851f2a[_0xa4e9('0x47')][_0xa4e9('0x4b')];}else if(_0x851f2a[_0xa4e9('0x47')][_0xa4e9('0x4c')]){_0x41d660[_0xa4e9('0x4c')]=_0x851f2a['body'][_0xa4e9('0x4c')];}else if(_0x851f2a['body'][_0xa4e9('0x4d')]){_0x41d660[_0xa4e9('0x4d')]=_0x851f2a[_0xa4e9('0x47')][_0xa4e9('0x4d')];}return db['CannedAnswer'][_0xa4e9('0x45')]({'where':_0x41d660})[_0xa4e9('0x21')](function(_0x2a4183){if(_0x2a4183){throw new db[(_0xa4e9('0x4e'))][(_0xa4e9('0x4f'))](_0xa4e9('0x50'));}return db[_0xa4e9('0x2c')][_0xa4e9('0x49')](_0x851f2a[_0xa4e9('0x47')]);})[_0xa4e9('0x21')](function(_0x25599e){var _0x1b3dcd=_0x851f2a['user']['get']({'plain':!![]});if(!_0x1b3dcd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b3dcd[_0xa4e9('0x51')]==='user'){var _0x90a81=_0x25599e['get']({'plain':!![]});return db[_0xa4e9('0x52')]['find']({'where':{'name':_0xa4e9('0x24'),'userProfileId':_0x1b3dcd[_0xa4e9('0x53')]},'raw':!![]})[_0xa4e9('0x21')](function(_0x50cc84){if(_0x50cc84&&_0x50cc84['autoAssociation']===0x0){return db[_0xa4e9('0x25')][_0xa4e9('0x49')]({'name':_0x90a81['name'],'resourceId':_0x90a81['id'],'type':_0x50cc84[_0xa4e9('0x29')],'sectionId':_0x50cc84['id']},{})['then'](function(){return _0x25599e;});}else{return _0x25599e;}})['catch'](function(_0x260b6e){logger[_0xa4e9('0x27')](_0xa4e9('0x54'),_0x260b6e);throw _0x260b6e;});}return _0x25599e;})['then'](respondWithResult(_0x30586d,0xc9))[_0xa4e9('0x40')](handleError(_0x30586d,null));};
\ No newline at end of file
+var _0xdb2f=['model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','options','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','userProfileId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key'];(function(_0x438912,_0x3f7f74){var _0x18112f=function(_0x1b8ac9){while(--_0x1b8ac9){_0x438912['push'](_0x438912['shift']());}};_0x18112f(++_0x3f7f74);}(_0xdb2f,0xd0));var _0xfdb2=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xdb2f[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0xfdb2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdb2('0x1'));var jsonpatch=require(_0xfdb2('0x2'));var rp=require(_0xfdb2('0x3'));var moment=require(_0xfdb2('0x4'));var BPromise=require(_0xfdb2('0x5'));var Mustache=require(_0xfdb2('0x6'));var util=require(_0xfdb2('0x7'));var path=require(_0xfdb2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdb2('0x9'));var fs=require('fs');var fs_extra=require(_0xfdb2('0xa'));var _=require(_0xfdb2('0xb'));var squel=require(_0xfdb2('0xc'));var crypto=require(_0xfdb2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfdb2('0xe'));var toCsv=require(_0xfdb2('0xf'));var querystring=require(_0xfdb2('0x10'));var Papa=require('papaparse');var Redis=require(_0xfdb2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfdb2('0x12'));var as=require(_0xfdb2('0x13'));var hardwareService=require(_0xfdb2('0x14'));var logger=require('../../config/logger')(_0xfdb2('0x15'));var utils=require(_0xfdb2('0x16'));var config=require(_0xfdb2('0x17'));var licenseUtil=require(_0xfdb2('0x18'));var db=require(_0xfdb2('0x19'))['db'];function respondWithStatusCode(_0x5517da,_0x449057){_0x449057=_0x449057||0xcc;return function(_0x49fe77){if(_0x49fe77){return _0x5517da[_0xfdb2('0x1a')](_0x449057);}return _0x5517da[_0xfdb2('0x1b')](_0x449057)[_0xfdb2('0x1c')]();};}function respondWithResult(_0x31dcd5,_0x300e89){_0x300e89=_0x300e89||0xc8;return function(_0x4964c0){if(_0x4964c0){return _0x31dcd5[_0xfdb2('0x1b')](_0x300e89)[_0xfdb2('0x1d')](_0x4964c0);}};}function respondWithFilteredResult(_0x40262c,_0x2b67cf){return function(_0x563e04){if(_0x563e04){var _0x4d2906=typeof _0x2b67cf[_0xfdb2('0x1e')]===_0xfdb2('0x1f')&&typeof _0x2b67cf['limit']===_0xfdb2('0x1f');var _0x5d8ac8=_0x563e04[_0xfdb2('0x20')];var _0x48bafb=_0x4d2906?0x0:_0x2b67cf[_0xfdb2('0x1e')];var _0x3faf6b=_0x4d2906?_0x563e04['count']:_0x2b67cf[_0xfdb2('0x1e')]+_0x2b67cf[_0xfdb2('0x21')];var _0x561060;if(_0x3faf6b>=_0x5d8ac8){_0x3faf6b=_0x5d8ac8;_0x561060=0xc8;}else{_0x561060=0xce;}_0x40262c[_0xfdb2('0x1b')](_0x561060);return _0x40262c[_0xfdb2('0x22')](_0xfdb2('0x23'),_0x48bafb+'-'+_0x3faf6b+'/'+_0x5d8ac8)[_0xfdb2('0x1d')](_0x563e04);}return null;};}function patchUpdates(_0x2446ff){return function(_0x2a2930){try{jsonpatch[_0xfdb2('0x24')](_0x2a2930,_0x2446ff,!![]);}catch(_0x4d2f00){return BPromise[_0xfdb2('0x25')](_0x4d2f00);}return _0x2a2930[_0xfdb2('0x26')]();};}function saveUpdates(_0x3f7f71,_0xeaef67){return function(_0x34c012){if(_0x34c012){return _0x34c012['update'](_0x3f7f71)[_0xfdb2('0x27')](function(_0x403fc3){return _0x403fc3;});}return null;};}function removeEntity(_0x180a4e,_0x1ed8a3){return function(_0x43a529){if(_0x43a529){return _0x43a529[_0xfdb2('0x28')]()[_0xfdb2('0x27')](function(){var _0x48909e=_0x43a529[_0xfdb2('0x29')]({'plain':!![]});var _0x2bb034='CannedAnswers';return db[_0xfdb2('0x2a')][_0xfdb2('0x28')]({'where':{'type':_0x2bb034,'resourceId':_0x48909e['id']}})['then'](function(){return _0x43a529;});})[_0xfdb2('0x27')](function(){_0x180a4e[_0xfdb2('0x1b')](0xcc)[_0xfdb2('0x1c')]();});}};}function handleEntityNotFound(_0x2e8ed4,_0x58b31c){return function(_0x448311){if(!_0x448311){_0x2e8ed4[_0xfdb2('0x1a')](0x194);}return _0x448311;};}function handleError(_0x1e54d8,_0x56106f){_0x56106f=_0x56106f||0x1f4;return function(_0x4a7ad8){logger[_0xfdb2('0x2b')](_0x4a7ad8[_0xfdb2('0x2c')]);if(_0x4a7ad8[_0xfdb2('0x2d')]){delete _0x4a7ad8[_0xfdb2('0x2d')];}_0x1e54d8[_0xfdb2('0x1b')](_0x56106f)['send'](_0x4a7ad8);};}exports[_0xfdb2('0x2e')]=function(_0x54eb50,_0x3a21b4){var _0x2efd29={},_0x526793={},_0x2b1403={'count':0x0,'rows':[]};var _0x3bd025=_[_0xfdb2('0x2f')](db[_0xfdb2('0x30')][_0xfdb2('0x31')],function(_0x1749d2){return{'name':_0x1749d2[_0xfdb2('0x32')],'type':_0x1749d2[_0xfdb2('0x33')][_0xfdb2('0x34')]};});_0x526793[_0xfdb2('0x35')]=_['map'](_0x3bd025,_0xfdb2('0x2d'));_0x526793['query']=_[_0xfdb2('0x36')](_0x54eb50['query']);_0x526793[_0xfdb2('0x37')]=_[_0xfdb2('0x38')](_0x526793[_0xfdb2('0x35')],_0x526793[_0xfdb2('0x39')]);_0x2efd29['attributes']=_[_0xfdb2('0x38')](_0x526793['model'],qs[_0xfdb2('0x3a')](_0x54eb50[_0xfdb2('0x39')]['fields']));_0x2efd29[_0xfdb2('0x3b')]=_0x2efd29[_0xfdb2('0x3b')][_0xfdb2('0x3c')]?_0x2efd29['attributes']:_0x526793['model'];if(!_0x54eb50[_0xfdb2('0x39')][_0xfdb2('0x3d')](_0xfdb2('0x3e'))){_0x2efd29[_0xfdb2('0x21')]=qs[_0xfdb2('0x21')](_0x54eb50[_0xfdb2('0x39')][_0xfdb2('0x21')]);_0x2efd29['offset']=qs['offset'](_0x54eb50[_0xfdb2('0x39')][_0xfdb2('0x1e')]);}_0x2efd29[_0xfdb2('0x3f')]=qs[_0xfdb2('0x40')](_0x54eb50[_0xfdb2('0x39')][_0xfdb2('0x40')]);_0x2efd29[_0xfdb2('0x41')]=qs[_0xfdb2('0x37')](_[_0xfdb2('0x42')](_0x54eb50[_0xfdb2('0x39')],_0x526793[_0xfdb2('0x37')]),_0x3bd025);if(_0x54eb50[_0xfdb2('0x39')][_0xfdb2('0x43')]){_0x2efd29[_0xfdb2('0x41')]=_['merge'](_0x2efd29[_0xfdb2('0x41')],{'$or':[{'key':{'$like':'%'+_0x54eb50['query'][_0xfdb2('0x43')]+'%'}},{'value':{'$like':'%'+_0x54eb50[_0xfdb2('0x39')]['filter']+'%'}}]});}_0x2efd29=_[_0xfdb2('0x44')]({},_0x2efd29,_0x54eb50['options']);var _0x2b2886={'where':_0x2efd29[_0xfdb2('0x41')]};return db['CannedAnswer'][_0xfdb2('0x20')](_0x2b2886)[_0xfdb2('0x27')](function(_0x3743e8){_0x2b1403[_0xfdb2('0x20')]=_0x3743e8;if(_0x54eb50[_0xfdb2('0x39')][_0xfdb2('0x45')]){_0x2efd29[_0xfdb2('0x46')]=[{'all':!![]}];}return db['CannedAnswer'][_0xfdb2('0x47')](_0x2efd29);})['then'](function(_0x5d0853){_0x2b1403['rows']=_0x5d0853;return _0x2b1403;})[_0xfdb2('0x27')](respondWithFilteredResult(_0x3a21b4,_0x2efd29))[_0xfdb2('0x48')](handleError(_0x3a21b4,null));};exports[_0xfdb2('0x49')]=function(_0x3491c0,_0x3fafb3){var _0x1c500e={'raw':!![],'where':{'id':_0x3491c0['params']['id']}},_0x3f6afd={};_0x3f6afd[_0xfdb2('0x35')]=_['keys'](db[_0xfdb2('0x30')][_0xfdb2('0x31')]);_0x3f6afd[_0xfdb2('0x39')]=_[_0xfdb2('0x36')](_0x3491c0[_0xfdb2('0x39')]);_0x3f6afd['filters']=_[_0xfdb2('0x38')](_0x3f6afd[_0xfdb2('0x35')],_0x3f6afd[_0xfdb2('0x39')]);_0x1c500e[_0xfdb2('0x3b')]=_['intersection'](_0x3f6afd[_0xfdb2('0x35')],qs['fields'](_0x3491c0[_0xfdb2('0x39')]['fields']));_0x1c500e[_0xfdb2('0x3b')]=_0x1c500e[_0xfdb2('0x3b')][_0xfdb2('0x3c')]?_0x1c500e[_0xfdb2('0x3b')]:_0x3f6afd[_0xfdb2('0x35')];if(_0x3491c0[_0xfdb2('0x39')][_0xfdb2('0x45')]){_0x1c500e[_0xfdb2('0x46')]=[{'all':!![]}];}_0x1c500e=_[_0xfdb2('0x44')]({},_0x1c500e,_0x3491c0[_0xfdb2('0x4a')]);return db[_0xfdb2('0x30')][_0xfdb2('0x4b')](_0x1c500e)[_0xfdb2('0x27')](handleEntityNotFound(_0x3fafb3,null))['then'](respondWithResult(_0x3fafb3,null))[_0xfdb2('0x48')](handleError(_0x3fafb3,null));};exports[_0xfdb2('0x4c')]=function(_0x10c107,_0x25ffde){if(_0x10c107[_0xfdb2('0x4d')]['id']){delete _0x10c107['body']['id'];}return db[_0xfdb2('0x30')]['find']({'where':{'id':_0x10c107['params']['id']}})['then'](handleEntityNotFound(_0x25ffde,null))[_0xfdb2('0x27')](saveUpdates(_0x10c107[_0xfdb2('0x4d')],null))[_0xfdb2('0x27')](respondWithResult(_0x25ffde,null))[_0xfdb2('0x48')](handleError(_0x25ffde,null));};exports['destroy']=function(_0x5ddbed,_0x220d5e){return db[_0xfdb2('0x30')]['find']({'where':{'id':_0x5ddbed['params']['id']}})[_0xfdb2('0x27')](handleEntityNotFound(_0x220d5e,null))[_0xfdb2('0x27')](removeEntity(_0x220d5e,null))[_0xfdb2('0x48')](handleError(_0x220d5e,null));};exports[_0xfdb2('0x4e')]=function(_0x2b37bc,_0x3df4e2){var _0x165aa7={'key':_0x2b37bc['body'][_0xfdb2('0x34')]};if(_0x2b37bc[_0xfdb2('0x4d')][_0xfdb2('0x4f')]){_0x165aa7[_0xfdb2('0x4f')]=_0x2b37bc[_0xfdb2('0x4d')][_0xfdb2('0x4f')];}else if(_0x2b37bc[_0xfdb2('0x4d')][_0xfdb2('0x50')]){_0x165aa7[_0xfdb2('0x50')]=_0x2b37bc[_0xfdb2('0x4d')][_0xfdb2('0x50')];}else if(_0x2b37bc['body'][_0xfdb2('0x51')]){_0x165aa7['OpenchannelAccountId']=_0x2b37bc[_0xfdb2('0x4d')]['OpenchannelAccountId'];}else if(_0x2b37bc[_0xfdb2('0x4d')][_0xfdb2('0x52')]){_0x165aa7['ChatWebsiteId']=_0x2b37bc['body'][_0xfdb2('0x52')];}return db[_0xfdb2('0x30')][_0xfdb2('0x4b')]({'where':_0x165aa7})['then'](function(_0x289540){if(_0x289540){throw new db[(_0xfdb2('0x53'))][(_0xfdb2('0x54'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xfdb2('0x30')][_0xfdb2('0x4e')](_0x2b37bc[_0xfdb2('0x4d')]);})['then'](function(_0x29b5e3){var _0x399115=_0x2b37bc[_0xfdb2('0x55')][_0xfdb2('0x29')]({'plain':!![]});if(!_0x399115)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x399115['role']===_0xfdb2('0x55')){var _0x47015d=_0x29b5e3[_0xfdb2('0x29')]({'plain':!![]});return db['UserProfileSection'][_0xfdb2('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x399115[_0xfdb2('0x56')]},'raw':!![]})[_0xfdb2('0x27')](function(_0x252d9a){if(_0x252d9a&&_0x252d9a['autoAssociation']===0x0){return db[_0xfdb2('0x2a')][_0xfdb2('0x4e')]({'name':_0x47015d[_0xfdb2('0x2d')],'resourceId':_0x47015d['id'],'type':_0x252d9a['name'],'sectionId':_0x252d9a['id']},{})['then'](function(){return _0x29b5e3;});}else{return _0x29b5e3;}})[_0xfdb2('0x48')](function(_0x2b3fe0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b3fe0);throw _0x2b3fe0;});}return _0x29b5e3;})[_0xfdb2('0x27')](respondWithResult(_0x3df4e2,0xc9))[_0xfdb2('0x48')](handleError(_0x3df4e2,null));};
\ No newline at end of file
index d526314..9d930b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ed3=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x2ef8fa,_0x769cf0){var _0x27b69d=function(_0x274630){while(--_0x274630){_0x2ef8fa['push'](_0x2ef8fa['shift']());}};_0x27b69d(++_0x769cf0);}(_0x2ed3,0xfa));var _0x32ed=function(_0x434804,_0x415f68){_0x434804=_0x434804-0x0;var _0x573fc8=_0x2ed3[_0x434804];return _0x573fc8;};'use strict';var _=require(_0x32ed('0x0'));var util=require(_0x32ed('0x1'));var logger=require(_0x32ed('0x2'))('api');var moment=require(_0x32ed('0x3'));var BPromise=require('bluebird');var rp=require(_0x32ed('0x4'));var fs=require('fs');var path=require(_0x32ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x32ed('0x6'));module[_0x32ed('0x7')]=function(_0x2d1a93,_0x1a4152){return _0x2d1a93[_0x32ed('0x8')](_0x32ed('0x9'),attributes,{'tableName':_0x32ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x32ed('0xb'),'collate':_0x32ed('0xc')});};
\ No newline at end of file
+var _0xbc61=['moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x4babdf,_0x392c3c){var _0x399ed3=function(_0x4a2ea6){while(--_0x4a2ea6){_0x4babdf['push'](_0x4babdf['shift']());}};_0x399ed3(++_0x392c3c);}(_0xbc61,0xdc));var _0x1bc6=function(_0x845fb8,_0xd4a79e){_0x845fb8=_0x845fb8-0x0;var _0x1535a9=_0xbc61[_0x845fb8];return _0x1535a9;};'use strict';var _=require(_0x1bc6('0x0'));var util=require(_0x1bc6('0x1'));var logger=require(_0x1bc6('0x2'))(_0x1bc6('0x3'));var moment=require(_0x1bc6('0x4'));var BPromise=require(_0x1bc6('0x5'));var rp=require(_0x1bc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1bc6('0x7'));var config=require(_0x1bc6('0x8'));var attributes=require(_0x1bc6('0x9'));module[_0x1bc6('0xa')]=function(_0x83731e,_0x3486d6){return _0x83731e[_0x1bc6('0xb')]('CannedAnswer',attributes,{'tableName':_0x1bc6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1bc6('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index ca9b467..7782d90 100644 (file)
@@ -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(_0x189c2f,_0x37db2e){var _0x3032a7=function(_0x1fc229){while(--_0x1fc229){_0x189c2f['push'](_0x189c2f['shift']());}};_0x3032a7(++_0x37db2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x22f8a1,_0x1d18d2){var _0x34a5fd=function(_0x443ff5){while(--_0x443ff5){_0x22f8a1['push'](_0x22f8a1['shift']());}};_0x34a5fd(++_0x1d18d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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
index f600e96..4c25daa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c0=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x13c0,0x69));var _0x013c=function(_0x19cf1f,_0x4105e3){_0x19cf1f=_0x19cf1f-0x0;var _0x234028=_0x13c0[_0x19cf1f];return _0x234028;};'use strict';var multer=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var path=require(_0x013c('0x2'));var timeout=require(_0x013c('0x3'));var express=require(_0x013c('0x4'));var router=express[_0x013c('0x5')]();var fs_extra=require(_0x013c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x013c('0x7'));var config=require(_0x013c('0x8'));var controller=require(_0x013c('0x9'));router['get']('/',auth[_0x013c('0xa')](),controller[_0x013c('0xb')]);router[_0x013c('0xc')](_0x013c('0xd'),auth[_0x013c('0xa')](),controller[_0x013c('0xe')]);router[_0x013c('0xf')]('/',auth[_0x013c('0xa')](),controller[_0x013c('0x10')]);router[_0x013c('0x11')](_0x013c('0xd'),auth[_0x013c('0xa')](),controller['update']);router[_0x013c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x013c('0x13')]);module[_0x013c('0x14')]=router;
\ No newline at end of file
+var _0x775f=['fs-extra','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x241eb9,_0x5ccc3f){var _0x4f916b=function(_0x412d98){while(--_0x412d98){_0x241eb9['push'](_0x241eb9['shift']());}};_0x4f916b(++_0x5ccc3f);}(_0x775f,0x176));var _0xf775=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x775f[_0x21353c];return _0xa99120;};'use strict';var multer=require(_0xf775('0x0'));var util=require(_0xf775('0x1'));var path=require(_0xf775('0x2'));var timeout=require(_0xf775('0x3'));var express=require(_0xf775('0x4'));var router=express[_0xf775('0x5')]();var fs_extra=require(_0xf775('0x6'));var auth=require(_0xf775('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf775('0x8'));router[_0xf775('0x9')]('/',auth[_0xf775('0xa')](),controller[_0xf775('0xb')]);router[_0xf775('0x9')](_0xf775('0xc'),auth[_0xf775('0xa')](),controller[_0xf775('0xd')]);router[_0xf775('0xe')]('/',auth['isAuthenticated'](),controller[_0xf775('0xf')]);router[_0xf775('0x10')](_0xf775('0xc'),auth[_0xf775('0xa')](),controller[_0xf775('0x11')]);router[_0xf775('0x12')](_0xf775('0xc'),auth[_0xf775('0xa')](),controller[_0xf775('0x13')]);module['exports']=router;
\ No newline at end of file
index 010d94c..446ab83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eb9=['INTEGER','sequelize','1970-01-01\x2000:00:01','STRING'];(function(_0xf7fcdd,_0x312cfb){var _0x52e012=function(_0x4fb74c){while(--_0x4fb74c){_0xf7fcdd['push'](_0xf7fcdd['shift']());}};_0x52e012(++_0x312cfb);}(_0x7eb9,0xd9));var _0x97eb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7eb9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x97eb('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x97eb('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x97eb('0x2')]},'dst':{'type':Sequelize[_0x97eb('0x2')]},'dcontext':{'type':Sequelize[_0x97eb('0x2')]},'channel':{'type':Sequelize[_0x97eb('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x97eb('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x97eb('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x97eb('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x97eb('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x97eb('0x2')]},'sequence':{'type':Sequelize[_0x97eb('0x2')]},'peeraccount':{'type':Sequelize[_0x97eb('0x2')]},'type':{'type':Sequelize[_0x97eb('0x2')]},'tag':{'type':Sequelize[_0x97eb('0x2')]}};
\ No newline at end of file
+var _0x2f90=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x390311,_0x179a59){var _0x59eadf=function(_0x1f864f){while(--_0x1f864f){_0x390311['push'](_0x390311['shift']());}};_0x59eadf(++_0x179a59);}(_0x2f90,0x1e9));var _0x02f9=function(_0xcc48af,_0x3639cd){_0xcc48af=_0xcc48af-0x0;var _0x89d1ee=_0x2f90[_0xcc48af];return _0x89d1ee;};'use strict';var Sequelize=require('sequelize');module[_0x02f9('0x0')]={'calldate':{'type':Sequelize[_0x02f9('0x1')],'allowNull':![],'defaultValue':_0x02f9('0x2')},'clid':{'type':Sequelize[_0x02f9('0x3')]},'src':{'type':Sequelize[_0x02f9('0x3')]},'dst':{'type':Sequelize[_0x02f9('0x3')]},'dcontext':{'type':Sequelize[_0x02f9('0x3')]},'channel':{'type':Sequelize[_0x02f9('0x3')]},'dstchannel':{'type':Sequelize[_0x02f9('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x02f9('0x3')]},'duration':{'type':Sequelize[_0x02f9('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x02f9('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x02f9('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x02f9('0x3')]},'uniqueid':{'type':Sequelize[_0x02f9('0x3')]},'linkedid':{'type':Sequelize[_0x02f9('0x3')]},'sequence':{'type':Sequelize[_0x02f9('0x3')]},'peeraccount':{'type':Sequelize[_0x02f9('0x3')]},'type':{'type':Sequelize[_0x02f9('0x3')]},'tag':{'type':Sequelize[_0x02f9('0x3')]}};
\ No newline at end of file
index 692c2f1..4d3f2d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','count','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','map','fieldName','type','key','name','query','keys'];(function(_0x513eb2,_0x17cb6d){var _0x27da46=function(_0x497566){while(--_0x497566){_0x513eb2['push'](_0x513eb2['shift']());}};_0x27da46(++_0x17cb6d);}(_0x3435,0xfa));var _0x5343=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x3435[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require(_0x5343('0x0'));var rimraf=require(_0x5343('0x1'));var zipdir=require(_0x5343('0x2'));var jsonpatch=require(_0x5343('0x3'));var rp=require(_0x5343('0x4'));var moment=require(_0x5343('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5343('0x6'));var util=require(_0x5343('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5343('0x8'));var ejs=require(_0x5343('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x8'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var licenseUtil=require(_0x5343('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ddeb7,_0x5f473f){_0x5f473f=_0x5f473f||0xcc;return function(_0x82074d){if(_0x82074d){return _0x2ddeb7[_0x5343('0x17')](_0x5f473f);}return _0x2ddeb7['status'](_0x5f473f)[_0x5343('0x18')]();};}function respondWithResult(_0x4cdfae,_0x13066f){_0x13066f=_0x13066f||0xc8;return function(_0x46c3d7){if(_0x46c3d7){return _0x4cdfae[_0x5343('0x19')](_0x13066f)[_0x5343('0x1a')](_0x46c3d7);}};}function respondWithFilteredResult(_0x4dbff1,_0x446e90){return function(_0x588a96){if(_0x588a96){var _0x1df724=typeof _0x446e90[_0x5343('0x1b')]===_0x5343('0x1c')&&typeof _0x446e90[_0x5343('0x1d')]===_0x5343('0x1c');var _0x4b5852=_0x588a96['count'];var _0x432992=_0x1df724?0x0:_0x446e90[_0x5343('0x1b')];var _0x1f5098=_0x1df724?_0x588a96['count']:_0x446e90[_0x5343('0x1b')]+_0x446e90[_0x5343('0x1d')];var _0x376c35;if(_0x1f5098>=_0x4b5852){_0x1f5098=_0x4b5852;_0x376c35=0xc8;}else{_0x376c35=0xce;}_0x4dbff1[_0x5343('0x19')](_0x376c35);return _0x4dbff1[_0x5343('0x1e')](_0x5343('0x1f'),_0x432992+'-'+_0x1f5098+'/'+_0x4b5852)[_0x5343('0x1a')](_0x588a96);}return null;};}function patchUpdates(_0x40ba38){return function(_0x35d41d){try{jsonpatch['apply'](_0x35d41d,_0x40ba38,!![]);}catch(_0x287304){return BPromise[_0x5343('0x20')](_0x287304);}return _0x35d41d[_0x5343('0x21')]();};}function saveUpdates(_0x42f92d,_0xd95a5b){return function(_0x4e7c0f){if(_0x4e7c0f){return _0x4e7c0f[_0x5343('0x22')](_0x42f92d)[_0x5343('0x23')](function(_0x24c250){return _0x24c250;});}return null;};}function removeEntity(_0x380aae,_0x290ce8){return function(_0x486597){if(_0x486597){return _0x486597[_0x5343('0x24')]()[_0x5343('0x23')](function(){_0x380aae['status'](0xcc)[_0x5343('0x18')]();});}};}function handleEntityNotFound(_0x96bbf6,_0x1ab5eb){return function(_0x5e4344){if(!_0x5e4344){_0x96bbf6['sendStatus'](0x194);}return _0x5e4344;};}function handleError(_0x462cb6,_0x5871de){_0x5871de=_0x5871de||0x1f4;return function(_0x14d05a){logger['error'](_0x14d05a[_0x5343('0x25')]);if(_0x14d05a['name']){delete _0x14d05a['name'];}_0x462cb6[_0x5343('0x19')](_0x5871de)[_0x5343('0x26')](_0x14d05a);};}exports['index']=function(_0x5d597e,_0x1202bb){var _0x5d0853={},_0x2ed8c9={},_0x47d49a={'count':0x0,'rows':[]};var _0x5c689e=_[_0x5343('0x27')](db['Cdr']['rawAttributes'],function(_0x125e4c){return{'name':_0x125e4c[_0x5343('0x28')],'type':_0x125e4c[_0x5343('0x29')][_0x5343('0x2a')]};});_0x2ed8c9['model']=_['map'](_0x5c689e,_0x5343('0x2b'));_0x2ed8c9[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x5d597e[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],_0x2ed8c9[_0x5343('0x2c')]);_0x5d0853[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],qs[_0x5343('0x32')](_0x5d597e['query']['fields']));_0x5d0853[_0x5343('0x31')]=_0x5d0853[_0x5343('0x31')]['length']?_0x5d0853[_0x5343('0x31')]:_0x2ed8c9['model'];if(!_0x5d597e[_0x5343('0x2c')][_0x5343('0x33')](_0x5343('0x34'))){_0x5d0853[_0x5343('0x1d')]=qs['limit'](_0x5d597e['query'][_0x5343('0x1d')]);_0x5d0853['offset']=qs[_0x5343('0x1b')](_0x5d597e[_0x5343('0x2c')]['offset']);}_0x5d0853[_0x5343('0x35')]=qs['sort'](_0x5d597e['query'][_0x5343('0x36')]);_0x5d0853[_0x5343('0x37')]=qs[_0x5343('0x2e')](_[_0x5343('0x38')](_0x5d597e['query'],_0x2ed8c9['filters']),_0x5c689e);if(_0x5d597e['query']['filter']){_0x5d0853[_0x5343('0x37')]=_[_0x5343('0x39')](_0x5d0853[_0x5343('0x37')],{'$or':_[_0x5343('0x27')](_0x5c689e,function(_0x3c517a){if(_0x3c517a[_0x5343('0x29')]!==_0x5343('0x3a')){var _0x4d2951={};_0x4d2951[_0x3c517a[_0x5343('0x2b')]]={'$like':'%'+_0x5d597e['query'][_0x5343('0x3b')]+'%'};return _0x4d2951;}})});}_0x5d0853=_[_0x5343('0x39')]({},_0x5d0853,_0x5d597e[_0x5343('0x3c')]);var _0x2f004a={'where':_0x5d0853[_0x5343('0x37')]};return db[_0x5343('0x3d')][_0x5343('0x3e')](_0x2f004a)['then'](function(_0xb93d9){_0x47d49a['count']=_0xb93d9;if(_0x5d597e[_0x5343('0x2c')][_0x5343('0x3f')]){_0x5d0853[_0x5343('0x40')]=[{'all':!![]}];}return db[_0x5343('0x3d')][_0x5343('0x41')](_0x5d0853);})[_0x5343('0x23')](function(_0x2c75bd){_0x47d49a['rows']=_0x2c75bd;return _0x47d49a;})[_0x5343('0x23')](respondWithFilteredResult(_0x1202bb,_0x5d0853))[_0x5343('0x42')](handleError(_0x1202bb,null));};exports['show']=function(_0x41df61,_0x16c880){var _0x4c576d={'raw':!![],'where':{'id':_0x41df61[_0x5343('0x43')]['id']}},_0x53c3c7={};_0x53c3c7[_0x5343('0x30')]=_[_0x5343('0x2d')](db['Cdr'][_0x5343('0x44')]);_0x53c3c7[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x41df61[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],_0x53c3c7['query']);_0x4c576d[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],qs[_0x5343('0x32')](_0x41df61[_0x5343('0x2c')][_0x5343('0x32')]));_0x4c576d[_0x5343('0x31')]=_0x4c576d[_0x5343('0x31')][_0x5343('0x45')]?_0x4c576d[_0x5343('0x31')]:_0x53c3c7[_0x5343('0x30')];if(_0x41df61[_0x5343('0x2c')][_0x5343('0x3f')]){_0x4c576d[_0x5343('0x40')]=[{'all':!![]}];}_0x4c576d=_[_0x5343('0x39')]({},_0x4c576d,_0x41df61['options']);return db[_0x5343('0x3d')][_0x5343('0x46')](_0x4c576d)['then'](handleEntityNotFound(_0x16c880,null))[_0x5343('0x23')](respondWithResult(_0x16c880,null))[_0x5343('0x42')](handleError(_0x16c880,null));};exports[_0x5343('0x47')]=function(_0x1da1b7,_0x194316){return db['Cdr'][_0x5343('0x47')](_0x1da1b7['body'],{})['then'](respondWithResult(_0x194316,0xc9))[_0x5343('0x42')](handleError(_0x194316,null));};exports[_0x5343('0x22')]=function(_0x10329c,_0x1cd4ed){if(_0x10329c['body']['id']){delete _0x10329c[_0x5343('0x48')]['id'];}return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x10329c[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x23')](saveUpdates(_0x10329c[_0x5343('0x48')],null))[_0x5343('0x23')](respondWithResult(_0x1cd4ed,null))[_0x5343('0x42')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x24')]=function(_0x566d71,_0x1cbf7c){return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x566d71[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cbf7c,null))[_0x5343('0x23')](removeEntity(_0x1cbf7c,null))[_0x5343('0x42')](handleError(_0x1cbf7c,null));};exports[_0x5343('0x49')]=function(_0x3b3c64,_0xad51f4){return db['Cdr'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));};
\ No newline at end of file
+var _0x126e=['../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','type','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','show','params','intersection','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x1a298b,_0x5b66d4){var _0x26802a=function(_0x6b4a0f){while(--_0x6b4a0f){_0x1a298b['push'](_0x1a298b['shift']());}};_0x26802a(++_0x5b66d4);}(_0x126e,0x108));var _0xe126=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x126e[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe126('0x0'));var zipdir=require(_0xe126('0x1'));var jsonpatch=require(_0xe126('0x2'));var rp=require(_0xe126('0x3'));var moment=require(_0xe126('0x4'));var BPromise=require(_0xe126('0x5'));var Mustache=require('mustache');var util=require(_0xe126('0x6'));var path=require(_0xe126('0x7'));var sox=require(_0xe126('0x8'));var csv=require(_0xe126('0x9'));var ejs=require(_0xe126('0xa'));var fs=require('fs');var fs_extra=require(_0xe126('0xb'));var _=require(_0xe126('0xc'));var squel=require('squel');var crypto=require(_0xe126('0xd'));var jsforce=require(_0xe126('0xe'));var deskjs=require(_0xe126('0xf'));var toCsv=require(_0xe126('0x9'));var querystring=require(_0xe126('0x10'));var Papa=require('papaparse');var Redis=require(_0xe126('0x11'));var authService=require(_0xe126('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe126('0x13'));var hardwareService=require(_0xe126('0x14'));var logger=require('../../config/logger')(_0xe126('0x15'));var utils=require('../../config/utils');var config=require(_0xe126('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe126('0x17'))['db'];function respondWithStatusCode(_0x34ae06,_0x23ff02){_0x23ff02=_0x23ff02||0xcc;return function(_0x38b8c3){if(_0x38b8c3){return _0x34ae06[_0xe126('0x18')](_0x23ff02);}return _0x34ae06[_0xe126('0x19')](_0x23ff02)[_0xe126('0x1a')]();};}function respondWithResult(_0x55f10a,_0xd55baf){_0xd55baf=_0xd55baf||0xc8;return function(_0x1c02c9){if(_0x1c02c9){return _0x55f10a['status'](_0xd55baf)[_0xe126('0x1b')](_0x1c02c9);}};}function respondWithFilteredResult(_0x28d7dd,_0x10bc24){return function(_0x38b0c0){if(_0x38b0c0){var _0x5e52d1=typeof _0x10bc24[_0xe126('0x1c')]===_0xe126('0x1d')&&typeof _0x10bc24[_0xe126('0x1e')]==='undefined';var _0x2b0baa=_0x38b0c0['count'];var _0x46c98a=_0x5e52d1?0x0:_0x10bc24[_0xe126('0x1c')];var _0x19b0a3=_0x5e52d1?_0x38b0c0[_0xe126('0x1f')]:_0x10bc24[_0xe126('0x1c')]+_0x10bc24[_0xe126('0x1e')];var _0x20874b;if(_0x19b0a3>=_0x2b0baa){_0x19b0a3=_0x2b0baa;_0x20874b=0xc8;}else{_0x20874b=0xce;}_0x28d7dd[_0xe126('0x19')](_0x20874b);return _0x28d7dd['set'](_0xe126('0x20'),_0x46c98a+'-'+_0x19b0a3+'/'+_0x2b0baa)[_0xe126('0x1b')](_0x38b0c0);}return null;};}function patchUpdates(_0x35ab64){return function(_0x2e5617){try{jsonpatch[_0xe126('0x21')](_0x2e5617,_0x35ab64,!![]);}catch(_0x24076e){return BPromise[_0xe126('0x22')](_0x24076e);}return _0x2e5617[_0xe126('0x23')]();};}function saveUpdates(_0x5257bc,_0x4a1a97){return function(_0xdb6544){if(_0xdb6544){return _0xdb6544[_0xe126('0x24')](_0x5257bc)[_0xe126('0x25')](function(_0x5f1ce1){return _0x5f1ce1;});}return null;};}function removeEntity(_0x5381e1,_0x47f179){return function(_0x4807d3){if(_0x4807d3){return _0x4807d3[_0xe126('0x26')]()['then'](function(){_0x5381e1[_0xe126('0x19')](0xcc)[_0xe126('0x1a')]();});}};}function handleEntityNotFound(_0x4157ed,_0x1674c9){return function(_0x532409){if(!_0x532409){_0x4157ed['sendStatus'](0x194);}return _0x532409;};}function handleError(_0x26482f,_0x4facea){_0x4facea=_0x4facea||0x1f4;return function(_0x3f5de5){logger[_0xe126('0x27')](_0x3f5de5[_0xe126('0x28')]);if(_0x3f5de5['name']){delete _0x3f5de5[_0xe126('0x29')];}_0x26482f[_0xe126('0x19')](_0x4facea)['send'](_0x3f5de5);};}exports[_0xe126('0x2a')]=function(_0x259059,_0x5a8b2a){var _0x9d9e28={},_0x1fb354={},_0x29dec4={'count':0x0,'rows':[]};var _0x181ccc=_['map'](db[_0xe126('0x2b')][_0xe126('0x2c')],function(_0x5e7bab){return{'name':_0x5e7bab['fieldName'],'type':_0x5e7bab[_0xe126('0x2d')]['key']};});_0x1fb354[_0xe126('0x2e')]=_[_0xe126('0x2f')](_0x181ccc,_0xe126('0x29'));_0x1fb354['query']=_[_0xe126('0x30')](_0x259059[_0xe126('0x31')]);_0x1fb354[_0xe126('0x32')]=_['intersection'](_0x1fb354[_0xe126('0x2e')],_0x1fb354[_0xe126('0x31')]);_0x9d9e28['attributes']=_['intersection'](_0x1fb354[_0xe126('0x2e')],qs[_0xe126('0x33')](_0x259059[_0xe126('0x31')][_0xe126('0x33')]));_0x9d9e28[_0xe126('0x34')]=_0x9d9e28[_0xe126('0x34')][_0xe126('0x35')]?_0x9d9e28[_0xe126('0x34')]:_0x1fb354['model'];if(!_0x259059[_0xe126('0x31')][_0xe126('0x36')](_0xe126('0x37'))){_0x9d9e28[_0xe126('0x1e')]=qs[_0xe126('0x1e')](_0x259059[_0xe126('0x31')]['limit']);_0x9d9e28[_0xe126('0x1c')]=qs[_0xe126('0x1c')](_0x259059[_0xe126('0x31')][_0xe126('0x1c')]);}_0x9d9e28[_0xe126('0x38')]=qs['sort'](_0x259059[_0xe126('0x31')][_0xe126('0x39')]);_0x9d9e28[_0xe126('0x3a')]=qs[_0xe126('0x32')](_['pick'](_0x259059[_0xe126('0x31')],_0x1fb354[_0xe126('0x32')]),_0x181ccc);if(_0x259059[_0xe126('0x31')][_0xe126('0x3b')]){_0x9d9e28[_0xe126('0x3a')]=_[_0xe126('0x3c')](_0x9d9e28['where'],{'$or':_[_0xe126('0x2f')](_0x181ccc,function(_0x1a8edf){if(_0x1a8edf[_0xe126('0x2d')]!=='VIRTUAL'){var _0x5073bc={};_0x5073bc[_0x1a8edf[_0xe126('0x29')]]={'$like':'%'+_0x259059[_0xe126('0x31')][_0xe126('0x3b')]+'%'};return _0x5073bc;}})});}_0x9d9e28=_[_0xe126('0x3c')]({},_0x9d9e28,_0x259059[_0xe126('0x3d')]);var _0x1c128d={'where':_0x9d9e28['where']};return db[_0xe126('0x2b')][_0xe126('0x1f')](_0x1c128d)['then'](function(_0x4eb3d7){_0x29dec4[_0xe126('0x1f')]=_0x4eb3d7;if(_0x259059[_0xe126('0x31')]['includeAll']){_0x9d9e28[_0xe126('0x3e')]=[{'all':!![]}];}return db[_0xe126('0x2b')]['findAll'](_0x9d9e28);})[_0xe126('0x25')](function(_0x366754){_0x29dec4['rows']=_0x366754;return _0x29dec4;})[_0xe126('0x25')](respondWithFilteredResult(_0x5a8b2a,_0x9d9e28))['catch'](handleError(_0x5a8b2a,null));};exports[_0xe126('0x3f')]=function(_0x23d1d8,_0x5d5111){var _0x3613de={'raw':!![],'where':{'id':_0x23d1d8[_0xe126('0x40')]['id']}},_0x149b84={};_0x149b84['model']=_[_0xe126('0x30')](db['Cdr'][_0xe126('0x2c')]);_0x149b84[_0xe126('0x31')]=_[_0xe126('0x30')](_0x23d1d8[_0xe126('0x31')]);_0x149b84[_0xe126('0x32')]=_[_0xe126('0x41')](_0x149b84[_0xe126('0x2e')],_0x149b84[_0xe126('0x31')]);_0x3613de[_0xe126('0x34')]=_[_0xe126('0x41')](_0x149b84[_0xe126('0x2e')],qs['fields'](_0x23d1d8['query'][_0xe126('0x33')]));_0x3613de[_0xe126('0x34')]=_0x3613de['attributes'][_0xe126('0x35')]?_0x3613de[_0xe126('0x34')]:_0x149b84[_0xe126('0x2e')];if(_0x23d1d8[_0xe126('0x31')]['includeAll']){_0x3613de[_0xe126('0x3e')]=[{'all':!![]}];}_0x3613de=_[_0xe126('0x3c')]({},_0x3613de,_0x23d1d8[_0xe126('0x3d')]);return db[_0xe126('0x2b')][_0xe126('0x42')](_0x3613de)[_0xe126('0x25')](handleEntityNotFound(_0x5d5111,null))[_0xe126('0x25')](respondWithResult(_0x5d5111,null))[_0xe126('0x43')](handleError(_0x5d5111,null));};exports[_0xe126('0x44')]=function(_0xccc25d,_0x23007d){return db[_0xe126('0x2b')][_0xe126('0x44')](_0xccc25d['body'],{})['then'](respondWithResult(_0x23007d,0xc9))['catch'](handleError(_0x23007d,null));};exports['update']=function(_0xe642ae,_0x8d5abd){if(_0xe642ae[_0xe126('0x45')]['id']){delete _0xe642ae[_0xe126('0x45')]['id'];}return db[_0xe126('0x2b')][_0xe126('0x42')]({'where':{'id':_0xe642ae[_0xe126('0x40')]['id']}})['then'](handleEntityNotFound(_0x8d5abd,null))['then'](saveUpdates(_0xe642ae[_0xe126('0x45')],null))[_0xe126('0x25')](respondWithResult(_0x8d5abd,null))['catch'](handleError(_0x8d5abd,null));};exports[_0xe126('0x26')]=function(_0x209002,_0x518e43){return db[_0xe126('0x2b')][_0xe126('0x42')]({'where':{'id':_0x209002['params']['id']}})['then'](handleEntityNotFound(_0x518e43,null))[_0xe126('0x25')](removeEntity(_0x518e43,null))[_0xe126('0x43')](handleError(_0x518e43,null));};exports[_0xe126('0x46')]=function(_0x48fbed,_0x31e193){return db['Cdr'][_0xe126('0x46')]()[_0xe126('0x25')](respondWithResult(_0x31e193,null))['catch'](handleError(_0x31e193,null));};
\ No newline at end of file
index e1444f0..97c20d4 100644 (file)
@@ -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(_0x11f3b5,_0x231db0){var _0x564bd4=function(_0x56e513){while(--_0x56e513){_0x11f3b5['push'](_0x11f3b5['shift']());}};_0x564bd4(++_0x231db0);}(_0x7a54,0x106));var _0x47a5=function(_0x4fbe72,_0x334523){_0x4fbe72=_0x4fbe72-0x0;var _0x236ccd=_0x7a54[_0x4fbe72];return _0x236ccd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x54c874,_0x18650b){var _0x10ab0a=function(_0x55f4a4){while(--_0x55f4a4){_0x54c874['push'](_0x54c874['shift']());}};_0x10ab0a(++_0x18650b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
index 5370c4f..b89a85f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf14d=['info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x426841,_0x36070e){var _0x297178=function(_0x4e90c0){while(--_0x4e90c0){_0x426841['push'](_0x426841['shift']());}};_0x297178(++_0x36070e);}(_0xf14d,0x1c1));var _0xdf14=function(_0x50ff44,_0x5acd61){_0x50ff44=_0x50ff44-0x0;var _0x548147=_0xf14d[_0x50ff44];return _0x548147;};'use strict';var _=require(_0xdf14('0x0'));var util=require(_0xdf14('0x1'));var moment=require(_0xdf14('0x2'));var BPromise=require(_0xdf14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf14('0x4'))['db'];var utils=require(_0xdf14('0x5'));var logger=require(_0xdf14('0x6'))(_0xdf14('0x7'));var config=require(_0xdf14('0x8'));var jayson=require(_0xdf14('0x9'));var client=jayson[_0xdf14('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2be48a,_0x3d22c2,_0x25394e){return new BPromise(function(_0x186958,_0x1946ac){return client[_0xdf14('0xb')](_0x2be48a,_0x25394e)[_0xdf14('0xc')](function(_0x3bc616){logger[_0xdf14('0xd')](_0xdf14('0xe'),_0x3d22c2,_0xdf14('0xf'));logger[_0xdf14('0x10')](_0xdf14('0x11'),_0x3d22c2,'request\x20sent',JSON['stringify'](_0x3bc616));if(_0x3bc616['error']){if(_0x3bc616[_0xdf14('0x12')][_0xdf14('0x13')]===0x1f4){logger[_0xdf14('0x12')](_0xdf14('0xe'),_0x3d22c2,_0x3bc616['error']['message']);return _0x1946ac(_0x3bc616[_0xdf14('0x12')]['message']);}logger[_0xdf14('0x12')](_0xdf14('0xe'),_0x3d22c2,_0x3bc616['error'][_0xdf14('0x14')]);return _0x186958(_0x3bc616['error']['message']);}else{logger[_0xdf14('0xd')](_0xdf14('0xe'),_0x3d22c2,'request\x20sent');_0x186958(_0x3bc616['result'][_0xdf14('0x14')]);}})[_0xdf14('0x15')](function(_0x571625){logger['error'](_0xdf14('0xe'),_0x3d22c2,_0x571625);_0x1946ac(_0x571625);});});}
\ No newline at end of file
+var _0xe7c1=['message','catch','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Cdr,\x20%s,\x20%s'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0xe7c1,0x122));var _0x1e7c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe7c1[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x1e7c('0x0'));var moment=require(_0x1e7c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e7c('0x2'));var db=require(_0x1e7c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1e7c('0x4'));var config=require(_0x1e7c('0x5'));var jayson=require(_0x1e7c('0x6'));var client=jayson[_0x1e7c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe6d8,_0x3819c2,_0x367263){return new BPromise(function(_0x15bffa,_0x426e6e){return client[_0x1e7c('0x8')](_0x3fe6d8,_0x367263)['then'](function(_0x45c8e8){logger[_0x1e7c('0x9')]('Cdr,\x20%s,\x20%s',_0x3819c2,'request\x20sent');logger[_0x1e7c('0xa')](_0x1e7c('0xb'),_0x3819c2,_0x1e7c('0xc'),JSON[_0x1e7c('0xd')](_0x45c8e8));if(_0x45c8e8['error']){if(_0x45c8e8[_0x1e7c('0xe')]['code']===0x1f4){logger['error'](_0x1e7c('0xf'),_0x3819c2,_0x45c8e8['error']['message']);return _0x426e6e(_0x45c8e8[_0x1e7c('0xe')][_0x1e7c('0x10')]);}logger['error'](_0x1e7c('0xf'),_0x3819c2,_0x45c8e8[_0x1e7c('0xe')][_0x1e7c('0x10')]);return _0x15bffa(_0x45c8e8[_0x1e7c('0xe')]['message']);}else{logger[_0x1e7c('0x9')](_0x1e7c('0xf'),_0x3819c2,_0x1e7c('0xc'));_0x15bffa(_0x45c8e8['result'][_0x1e7c('0x10')]);}})[_0x1e7c('0x11')](function(_0x3fe180){logger['error'](_0x1e7c('0xf'),_0x3819c2,_0x3fe180);_0x426e6e(_0x3fe180);});});}
\ No newline at end of file
index bf05630..649e91c 100644 (file)
@@ -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(_0x2958a7,_0x569f19){var _0x1e0865=function(_0x230883){while(--_0x230883){_0x2958a7['push'](_0x2958a7['shift']());}};_0x1e0865(++_0x569f19);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x530245,_0x1541ab){var _0x22506d=function(_0x395400){while(--_0x395400){_0x530245['push'](_0x530245['shift']());}};_0x22506d(++_0x1541ab);}(_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
index 55ef0b9..5c162a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x414f=['INTEGER','TEXT','STRING','sequelize','exports'];(function(_0x590e5a,_0x5d556b){var _0x6a49c6=function(_0x32a2be){while(--_0x32a2be){_0x590e5a['push'](_0x590e5a['shift']());}};_0x6a49c6(++_0x5d556b);}(_0x414f,0x139));var _0xf414=function(_0x277563,_0x566184){_0x277563=_0x277563-0x0;var _0xc114d5=_0x414f[_0x277563];return _0xc114d5;};'use strict';var Sequelize=require(_0xf414('0x0'));module[_0xf414('0x1')]={'priority':{'type':Sequelize[_0xf414('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf414('0x3')]()},'description':{'type':Sequelize[_0xf414('0x4')]},'interval':{'type':Sequelize[_0xf414('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x7eae=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0xf9bcaf,_0x3c9230){var _0x1dff25=function(_0x4905bf){while(--_0x4905bf){_0xf9bcaf['push'](_0xf9bcaf['shift']());}};_0x1dff25(++_0x3c9230);}(_0x7eae,0x165));var _0xe7ea=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7eae[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0xe7ea('0x0')]={'priority':{'type':Sequelize[_0xe7ea('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe7ea('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe7ea('0x3')]()},'description':{'type':Sequelize[_0xe7ea('0x2')]},'interval':{'type':Sequelize[_0xe7ea('0x2')],'defaultValue':_0xe7ea('0x4')}};
\ No newline at end of file
index 0068cd2..dcecaef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c0=['moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../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','save','update','destroy','then','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','options','body','find','catch','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x43b281,_0x4bdba8){_0x43b281=_0x43b281-0x0;var _0x39eef0=_0xe0c0[_0x43b281];return _0x39eef0;};'use strict';var emlformat=require(_0x0e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e0c('0x1'));var jsonpatch=require(_0x0e0c('0x2'));var rp=require(_0x0e0c('0x3'));var moment=require(_0x0e0c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e0c('0x5'));var util=require(_0x0e0c('0x6'));var path=require(_0x0e0c('0x7'));var sox=require('sox');var csv=require(_0x0e0c('0x8'));var ejs=require(_0x0e0c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e0c('0xa'));var squel=require(_0x0e0c('0xb'));var crypto=require(_0x0e0c('0xc'));var jsforce=require(_0x0e0c('0xd'));var deskjs=require(_0x0e0c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e0c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0e0c('0x10'));var as=require(_0x0e0c('0x11'));var hardwareService=require(_0x0e0c('0x12'));var logger=require(_0x0e0c('0x13'))(_0x0e0c('0x14'));var utils=require(_0x0e0c('0x15'));var config=require(_0x0e0c('0x16'));var licenseUtil=require(_0x0e0c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x246fd6,_0x5c31c7){_0x5c31c7=_0x5c31c7||0xcc;return function(_0x5794fa){if(_0x5794fa){return _0x246fd6[_0x0e0c('0x18')](_0x5c31c7);}return _0x246fd6[_0x0e0c('0x19')](_0x5c31c7)[_0x0e0c('0x1a')]();};}function respondWithResult(_0x305042,_0x1b598b){_0x1b598b=_0x1b598b||0xc8;return function(_0x19f315){if(_0x19f315){return _0x305042['status'](_0x1b598b)[_0x0e0c('0x1b')](_0x19f315);}};}function respondWithFilteredResult(_0x27cbcd,_0x3b6d65){return function(_0x4ebe33){if(_0x4ebe33){var _0x368ba0=typeof _0x3b6d65[_0x0e0c('0x1c')]===_0x0e0c('0x1d')&&typeof _0x3b6d65[_0x0e0c('0x1e')]===_0x0e0c('0x1d');var _0x2b0cb6=_0x4ebe33[_0x0e0c('0x1f')];var _0x18f3ef=_0x368ba0?0x0:_0x3b6d65[_0x0e0c('0x1c')];var _0x562f2c=_0x368ba0?_0x4ebe33[_0x0e0c('0x1f')]:_0x3b6d65['offset']+_0x3b6d65['limit'];var _0x5518b6;if(_0x562f2c>=_0x2b0cb6){_0x562f2c=_0x2b0cb6;_0x5518b6=0xc8;}else{_0x5518b6=0xce;}_0x27cbcd[_0x0e0c('0x19')](_0x5518b6);return _0x27cbcd[_0x0e0c('0x20')](_0x0e0c('0x21'),_0x18f3ef+'-'+_0x562f2c+'/'+_0x2b0cb6)[_0x0e0c('0x1b')](_0x4ebe33);}return null;};}function patchUpdates(_0x26ad69){return function(_0x3cc1cc){try{jsonpatch['apply'](_0x3cc1cc,_0x26ad69,!![]);}catch(_0x177ec6){return BPromise['reject'](_0x177ec6);}return _0x3cc1cc[_0x0e0c('0x22')]();};}function saveUpdates(_0x4419e9,_0x58fa02){return function(_0x2d01e5){if(_0x2d01e5){return _0x2d01e5[_0x0e0c('0x23')](_0x4419e9)['then'](function(_0x3346aa){return _0x3346aa;});}return null;};}function removeEntity(_0x29ee52,_0x315b35){return function(_0x29ff87){if(_0x29ff87){return _0x29ff87[_0x0e0c('0x24')]()[_0x0e0c('0x25')](function(){_0x29ee52[_0x0e0c('0x19')](0xcc)[_0x0e0c('0x1a')]();});}};}function handleEntityNotFound(_0x426bf1,_0x3ae1b4){return function(_0x5a7519){if(!_0x5a7519){_0x426bf1[_0x0e0c('0x18')](0x194);}return _0x5a7519;};}function handleError(_0x429f6f,_0x48a33a){_0x48a33a=_0x48a33a||0x1f4;return function(_0x59f3e8){logger[_0x0e0c('0x26')](_0x59f3e8['stack']);if(_0x59f3e8[_0x0e0c('0x27')]){delete _0x59f3e8[_0x0e0c('0x27')];}_0x429f6f[_0x0e0c('0x19')](_0x48a33a)[_0x0e0c('0x28')](_0x59f3e8);};}exports[_0x0e0c('0x29')]=function(_0x15bb5a,_0x252143){var _0x2d1444={'raw':!![],'where':{'id':_0x15bb5a[_0x0e0c('0x2a')]['id']}},_0x2c9c82={};_0x2c9c82[_0x0e0c('0x2b')]=_[_0x0e0c('0x2c')](db[_0x0e0c('0x2d')][_0x0e0c('0x2e')]);_0x2c9c82[_0x0e0c('0x2f')]=_[_0x0e0c('0x2c')](_0x15bb5a['query']);_0x2c9c82[_0x0e0c('0x30')]=_[_0x0e0c('0x31')](_0x2c9c82[_0x0e0c('0x2b')],_0x2c9c82[_0x0e0c('0x2f')]);_0x2d1444[_0x0e0c('0x32')]=_['intersection'](_0x2c9c82[_0x0e0c('0x2b')],qs['fields'](_0x15bb5a[_0x0e0c('0x2f')][_0x0e0c('0x33')]));_0x2d1444['attributes']=_0x2d1444['attributes']['length']?_0x2d1444['attributes']:_0x2c9c82[_0x0e0c('0x2b')];if(_0x15bb5a[_0x0e0c('0x2f')][_0x0e0c('0x34')]){_0x2d1444['include']=[{'all':!![]}];}_0x2d1444=_['merge']({},_0x2d1444,_0x15bb5a[_0x0e0c('0x35')]);return db[_0x0e0c('0x2d')]['find'](_0x2d1444)['then'](handleEntityNotFound(_0x252143,null))[_0x0e0c('0x25')](respondWithResult(_0x252143,null))['catch'](handleError(_0x252143,null));};exports[_0x0e0c('0x23')]=function(_0x3e55e1,_0x463e62){if(_0x3e55e1[_0x0e0c('0x36')]['id']){delete _0x3e55e1[_0x0e0c('0x36')]['id'];}return db[_0x0e0c('0x2d')][_0x0e0c('0x37')]({'where':{'id':_0x3e55e1['params']['id']}})[_0x0e0c('0x25')](handleEntityNotFound(_0x463e62,null))[_0x0e0c('0x25')](saveUpdates(_0x3e55e1[_0x0e0c('0x36')],null))[_0x0e0c('0x25')](respondWithResult(_0x463e62,null))[_0x0e0c('0x38')](handleError(_0x463e62,null));};exports[_0x0e0c('0x24')]=function(_0x785831,_0x35f525){return db['ChatApplication']['find']({'where':{'id':_0x785831[_0x0e0c('0x2a')]['id']}})[_0x0e0c('0x25')](handleEntityNotFound(_0x35f525,null))[_0x0e0c('0x25')](removeEntity(_0x35f525,null))[_0x0e0c('0x38')](handleError(_0x35f525,null));};
\ No newline at end of file
+var _0xcd31=['include','options','catch','body','ChatApplication','find','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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/environment','../../config/license/util','sendStatus','status','offset','count','limit','set','Content-Range','reject','update','then','error','name','send','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','includeAll'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xcd31,0x15d));var _0x1cd3=function(_0xf1da27,_0xb75ece){_0xf1da27=_0xf1da27-0x0;var _0x310539=_0xcd31[_0xf1da27];return _0x310539;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cd3('0x0'));var zipdir=require(_0x1cd3('0x1'));var jsonpatch=require(_0x1cd3('0x2'));var rp=require('request-promise');var moment=require(_0x1cd3('0x3'));var BPromise=require(_0x1cd3('0x4'));var Mustache=require(_0x1cd3('0x5'));var util=require(_0x1cd3('0x6'));var path=require(_0x1cd3('0x7'));var sox=require(_0x1cd3('0x8'));var csv=require('to-csv');var ejs=require(_0x1cd3('0x9'));var fs=require('fs');var fs_extra=require(_0x1cd3('0xa'));var _=require(_0x1cd3('0xb'));var squel=require('squel');var crypto=require(_0x1cd3('0xc'));var jsforce=require(_0x1cd3('0xd'));var deskjs=require(_0x1cd3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1cd3('0xf'));var Papa=require(_0x1cd3('0x10'));var Redis=require(_0x1cd3('0x11'));var authService=require(_0x1cd3('0x12'));var qs=require(_0x1cd3('0x13'));var as=require(_0x1cd3('0x14'));var hardwareService=require(_0x1cd3('0x15'));var logger=require('../../config/logger')(_0x1cd3('0x16'));var utils=require(_0x1cd3('0x17'));var config=require(_0x1cd3('0x18'));var licenseUtil=require(_0x1cd3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfe288e,_0x4c9c6d){_0x4c9c6d=_0x4c9c6d||0xcc;return function(_0x41016f){if(_0x41016f){return _0xfe288e[_0x1cd3('0x1a')](_0x4c9c6d);}return _0xfe288e[_0x1cd3('0x1b')](_0x4c9c6d)['end']();};}function respondWithResult(_0x5b885f,_0x1a874c){_0x1a874c=_0x1a874c||0xc8;return function(_0x1def57){if(_0x1def57){return _0x5b885f[_0x1cd3('0x1b')](_0x1a874c)['json'](_0x1def57);}};}function respondWithFilteredResult(_0x2b28cf,_0x40cbbf){return function(_0x5a2b84){if(_0x5a2b84){var _0x418da3=typeof _0x40cbbf['offset']==='undefined'&&typeof _0x40cbbf['limit']==='undefined';var _0x5ca15c=_0x5a2b84['count'];var _0x14c491=_0x418da3?0x0:_0x40cbbf[_0x1cd3('0x1c')];var _0xf82a46=_0x418da3?_0x5a2b84[_0x1cd3('0x1d')]:_0x40cbbf[_0x1cd3('0x1c')]+_0x40cbbf[_0x1cd3('0x1e')];var _0x35870b;if(_0xf82a46>=_0x5ca15c){_0xf82a46=_0x5ca15c;_0x35870b=0xc8;}else{_0x35870b=0xce;}_0x2b28cf[_0x1cd3('0x1b')](_0x35870b);return _0x2b28cf[_0x1cd3('0x1f')](_0x1cd3('0x20'),_0x14c491+'-'+_0xf82a46+'/'+_0x5ca15c)['json'](_0x5a2b84);}return null;};}function patchUpdates(_0x33fc72){return function(_0x2368b3){try{jsonpatch['apply'](_0x2368b3,_0x33fc72,!![]);}catch(_0x26b59a){return BPromise[_0x1cd3('0x21')](_0x26b59a);}return _0x2368b3['save']();};}function saveUpdates(_0x20cda5,_0x159d22){return function(_0x330741){if(_0x330741){return _0x330741[_0x1cd3('0x22')](_0x20cda5)['then'](function(_0x4f6920){return _0x4f6920;});}return null;};}function removeEntity(_0x29ff8c,_0x1a6dad){return function(_0x49c7b1){if(_0x49c7b1){return _0x49c7b1['destroy']()[_0x1cd3('0x23')](function(){_0x29ff8c[_0x1cd3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55aa9c,_0x34b15f){return function(_0x1589fa){if(!_0x1589fa){_0x55aa9c['sendStatus'](0x194);}return _0x1589fa;};}function handleError(_0x5635f9,_0x1c86f6){_0x1c86f6=_0x1c86f6||0x1f4;return function(_0xc311a9){logger[_0x1cd3('0x24')](_0xc311a9['stack']);if(_0xc311a9['name']){delete _0xc311a9[_0x1cd3('0x25')];}_0x5635f9['status'](_0x1c86f6)[_0x1cd3('0x26')](_0xc311a9);};}exports[_0x1cd3('0x27')]=function(_0x268501,_0x4b7c0b){var _0xae9d0c={'raw':!![],'where':{'id':_0x268501[_0x1cd3('0x28')]['id']}},_0x53979a={};_0x53979a[_0x1cd3('0x29')]=_[_0x1cd3('0x2a')](db['ChatApplication'][_0x1cd3('0x2b')]);_0x53979a[_0x1cd3('0x2c')]=_[_0x1cd3('0x2a')](_0x268501[_0x1cd3('0x2c')]);_0x53979a[_0x1cd3('0x2d')]=_['intersection'](_0x53979a[_0x1cd3('0x29')],_0x53979a[_0x1cd3('0x2c')]);_0xae9d0c[_0x1cd3('0x2e')]=_[_0x1cd3('0x2f')](_0x53979a[_0x1cd3('0x29')],qs[_0x1cd3('0x30')](_0x268501['query'][_0x1cd3('0x30')]));_0xae9d0c[_0x1cd3('0x2e')]=_0xae9d0c['attributes']['length']?_0xae9d0c[_0x1cd3('0x2e')]:_0x53979a[_0x1cd3('0x29')];if(_0x268501[_0x1cd3('0x2c')][_0x1cd3('0x31')]){_0xae9d0c[_0x1cd3('0x32')]=[{'all':!![]}];}_0xae9d0c=_['merge']({},_0xae9d0c,_0x268501[_0x1cd3('0x33')]);return db['ChatApplication']['find'](_0xae9d0c)[_0x1cd3('0x23')](handleEntityNotFound(_0x4b7c0b,null))[_0x1cd3('0x23')](respondWithResult(_0x4b7c0b,null))[_0x1cd3('0x34')](handleError(_0x4b7c0b,null));};exports[_0x1cd3('0x22')]=function(_0x5f30da,_0xd22c1f){if(_0x5f30da['body']['id']){delete _0x5f30da[_0x1cd3('0x35')]['id'];}return db[_0x1cd3('0x36')][_0x1cd3('0x37')]({'where':{'id':_0x5f30da[_0x1cd3('0x28')]['id']}})['then'](handleEntityNotFound(_0xd22c1f,null))['then'](saveUpdates(_0x5f30da[_0x1cd3('0x35')],null))['then'](respondWithResult(_0xd22c1f,null))[_0x1cd3('0x34')](handleError(_0xd22c1f,null));};exports[_0x1cd3('0x38')]=function(_0x2e54a5,_0x346379){return db[_0x1cd3('0x36')]['find']({'where':{'id':_0x2e54a5['params']['id']}})['then'](handleEntityNotFound(_0x346379,null))['then'](removeEntity(_0x346379,null))[_0x1cd3('0x34')](handleError(_0x346379,null));};
\ No newline at end of file
index 65a5ace..d0a4cbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecd9=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports'];(function(_0x3c2db3,_0x24c785){var _0xdaa083=function(_0x524b23){while(--_0x524b23){_0x3c2db3['push'](_0x3c2db3['shift']());}};_0xdaa083(++_0x24c785);}(_0xecd9,0x13f));var _0x9ecd=function(_0x2d4a46,_0x121ed7){_0x2d4a46=_0x2d4a46-0x0;var _0x5bbabe=_0xecd9[_0x2d4a46];return _0x5bbabe;};'use strict';var _=require(_0x9ecd('0x0'));var util=require(_0x9ecd('0x1'));var logger=require(_0x9ecd('0x2'))(_0x9ecd('0x3'));var moment=require(_0x9ecd('0x4'));var BPromise=require(_0x9ecd('0x5'));var rp=require(_0x9ecd('0x6'));var fs=require('fs');var path=require(_0x9ecd('0x7'));var rimraf=require('rimraf');var config=require(_0x9ecd('0x8'));var attributes=require(_0x9ecd('0x9'));module[_0x9ecd('0xa')]=function(_0x3106a4,_0x18346c){return _0x3106a4['define'](_0x9ecd('0xb'),attributes,{'tableName':_0x9ecd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ecd('0xd'),'collate':_0x9ecd('0xe')});};
\ No newline at end of file
+var _0x0d62=['ChatApplication','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports'];(function(_0xbcf65f,_0x3b259c){var _0x450a2c=function(_0x3952bb){while(--_0x3952bb){_0xbcf65f['push'](_0xbcf65f['shift']());}};_0x450a2c(++_0x3b259c);}(_0x0d62,0x10f));var _0x20d6=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x0d62[_0x44c768];return _0x55daf5;};'use strict';var _=require('lodash');var util=require(_0x20d6('0x0'));var logger=require(_0x20d6('0x1'))('api');var moment=require(_0x20d6('0x2'));var BPromise=require(_0x20d6('0x3'));var rp=require(_0x20d6('0x4'));var fs=require('fs');var path=require(_0x20d6('0x5'));var rimraf=require(_0x20d6('0x6'));var config=require('../../config/environment');var attributes=require(_0x20d6('0x7'));module[_0x20d6('0x8')]=function(_0x43e94b,_0x37fc73){return _0x43e94b['define'](_0x20d6('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 7cd7a35..543e3cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3439=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x3439,0x1c3));var _0x9343=function(_0x10e5d8,_0x193b9f){_0x10e5d8=_0x10e5d8-0x0;var _0x560274=_0x3439[_0x10e5d8];return _0x560274;};'use strict';var _=require(_0x9343('0x0'));var util=require(_0x9343('0x1'));var moment=require(_0x9343('0x2'));var BPromise=require(_0x9343('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9343('0x4'));var db=require(_0x9343('0x5'))['db'];var utils=require(_0x9343('0x6'));var logger=require(_0x9343('0x7'))(_0x9343('0x8'));var config=require('../../config/environment');var jayson=require(_0x9343('0x9'));var client=jayson[_0x9343('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb4d5ac,_0x48d893,_0x2c1ba4){return new BPromise(function(_0x2c12dc,_0x1002f9){return client[_0x9343('0xb')](_0xb4d5ac,_0x2c1ba4)[_0x9343('0xc')](function(_0xde54fe){logger[_0x9343('0xd')](_0x9343('0xe'),_0x48d893,_0x9343('0xf'));logger[_0x9343('0x10')](_0x9343('0x11'),_0x48d893,_0x9343('0xf'),JSON['stringify'](_0xde54fe));if(_0xde54fe[_0x9343('0x12')]){if(_0xde54fe[_0x9343('0x12')]['code']===0x1f4){logger[_0x9343('0x12')](_0x9343('0xe'),_0x48d893,_0xde54fe[_0x9343('0x12')][_0x9343('0x13')]);return _0x1002f9(_0xde54fe[_0x9343('0x12')][_0x9343('0x13')]);}logger[_0x9343('0x12')](_0x9343('0xe'),_0x48d893,_0xde54fe[_0x9343('0x12')][_0x9343('0x13')]);return _0x2c12dc(_0xde54fe['error'][_0x9343('0x13')]);}else{logger[_0x9343('0xd')](_0x9343('0xe'),_0x48d893,_0x9343('0xf'));_0x2c12dc(_0xde54fe[_0x9343('0x14')]['message']);}})[_0x9343('0x15')](function(_0x423d9d){logger[_0x9343('0x12')](_0x9343('0xe'),_0x48d893,_0x423d9d);_0x1002f9(_0x423d9d);});});}
\ No newline at end of file
+var _0x8b53=['../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x94db58,_0x334a9e){var _0x3cbad1=function(_0x30e611){while(--_0x30e611){_0x94db58['push'](_0x94db58['shift']());}};_0x3cbad1(++_0x334a9e);}(_0x8b53,0x9b));var _0x38b5=function(_0x2eedf5,_0x15ba0b){_0x2eedf5=_0x2eedf5-0x0;var _0x1bb52d=_0x8b53[_0x2eedf5];return _0x1bb52d;};'use strict';var _=require(_0x38b5('0x0'));var util=require(_0x38b5('0x1'));var moment=require(_0x38b5('0x2'));var BPromise=require(_0x38b5('0x3'));var rs=require(_0x38b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x38b5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x38b5('0x6')][_0x38b5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x66484c,_0x172be8,_0x190c65){return new BPromise(function(_0x14a07,_0x2e746d){return client[_0x38b5('0x8')](_0x66484c,_0x190c65)[_0x38b5('0x9')](function(_0x2751f8){logger['info']('ChatApplication,\x20%s,\x20%s',_0x172be8,_0x38b5('0xa'));logger[_0x38b5('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x172be8,'request\x20sent',JSON[_0x38b5('0xc')](_0x2751f8));if(_0x2751f8[_0x38b5('0xd')]){if(_0x2751f8['error'][_0x38b5('0xe')]===0x1f4){logger[_0x38b5('0xd')](_0x38b5('0xf'),_0x172be8,_0x2751f8[_0x38b5('0xd')][_0x38b5('0x10')]);return _0x2e746d(_0x2751f8[_0x38b5('0xd')]['message']);}logger[_0x38b5('0xd')]('ChatApplication,\x20%s,\x20%s',_0x172be8,_0x2751f8[_0x38b5('0xd')][_0x38b5('0x10')]);return _0x14a07(_0x2751f8[_0x38b5('0xd')][_0x38b5('0x10')]);}else{logger[_0x38b5('0x11')](_0x38b5('0xf'),_0x172be8,_0x38b5('0xa'));_0x14a07(_0x2751f8[_0x38b5('0x12')][_0x38b5('0x10')]);}})[_0x38b5('0x13')](function(_0x1652d6){logger['error'](_0x38b5('0xf'),_0x172be8,_0x1652d6);_0x2e746d(_0x1652d6);});});}
\ No newline at end of file
index a5e4064..58ba4b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95eb=['destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete'];(function(_0x442385,_0x1ef369){var _0x56114c=function(_0x1ae667){while(--_0x1ae667){_0x442385['push'](_0x442385['shift']());}};_0x56114c(++_0x1ef369);}(_0x95eb,0x9b));var _0xb95e=function(_0x5f2533,_0xe398a2){_0x5f2533=_0x5f2533-0x0;var _0x39f428=_0x95eb[_0x5f2533];return _0x39f428;};'use strict';var multer=require(_0xb95e('0x0'));var util=require(_0xb95e('0x1'));var path=require('path');var timeout=require(_0xb95e('0x2'));var express=require('express');var router=express[_0xb95e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb95e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb95e('0x5'));var controller=require(_0xb95e('0x6'));router[_0xb95e('0x7')](_0xb95e('0x8'),auth[_0xb95e('0x9')](),controller[_0xb95e('0xa')]);router[_0xb95e('0xb')](_0xb95e('0x8'),auth[_0xb95e('0x9')](),controller['update']);router[_0xb95e('0xc')]('/:id',auth[_0xb95e('0x9')](),controller[_0xb95e('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xd89b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x3cecb2,_0x160469){var _0x615171=function(_0x77282){while(--_0x77282){_0x3cecb2['push'](_0x3cecb2['shift']());}};_0x615171(++_0x160469);}(_0xd89b,0x82));var _0xbd89=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd89b[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xbd89('0x0'));var util=require(_0xbd89('0x1'));var path=require(_0xbd89('0x2'));var timeout=require(_0xbd89('0x3'));var express=require(_0xbd89('0x4'));var router=express[_0xbd89('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbd89('0x6'));var interaction=require(_0xbd89('0x7'));var config=require(_0xbd89('0x8'));var controller=require(_0xbd89('0x9'));router[_0xbd89('0xa')](_0xbd89('0xb'),auth['isAuthenticated'](),controller[_0xbd89('0xc')]);router[_0xbd89('0xd')](_0xbd89('0xb'),auth[_0xbd89('0xe')](),controller[_0xbd89('0xf')]);router['delete']('/:id',auth[_0xbd89('0xe')](),controller[_0xbd89('0x10')]);module['exports']=router;
\ No newline at end of file
index 82e6ffb..5037a58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cfd=['sequelize','exports','STRING','BOOLEAN'];(function(_0x5a6678,_0xb5d1c6){var _0x31bcf2=function(_0x1318fc){while(--_0x1318fc){_0x5a6678['push'](_0x5a6678['shift']());}};_0x31bcf2(++_0xb5d1c6);}(_0x4cfd,0x170));var _0xd4cf=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x4cfd[_0xf51c06];return _0x1d5420;};'use strict';var Sequelize=require(_0xd4cf('0x0'));module[_0xd4cf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd4cf('0x2')]},'write':{'type':Sequelize[_0xd4cf('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5f52=['BOOLEAN','sequelize','exports','STRING'];(function(_0x24b78f,_0x22d90a){var _0x450887=function(_0x1d675a){while(--_0x1d675a){_0x24b78f['push'](_0x24b78f['shift']());}};_0x450887(++_0x22d90a);}(_0x5f52,0xb5));var _0x25f5=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x5f52[_0x58eec7];return _0x25c5d3;};'use strict';var Sequelize=require(_0x25f5('0x0'));module[_0x25f5('0x1')]={'name':{'type':Sequelize[_0x25f5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x25f5('0x2')]},'write':{'type':Sequelize[_0x25f5('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 4642b92..549a4d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ef3=['removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','offset','limit','count','Content-Range','json','apply','reject','then','stack','name','map','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','catch','show','keys','ChatGroup','includeAll','options','find','create','body','params','destroy','describe','getUnread','toInteger','addMembers','omit','ids','getMembers','findOne','User','rawAttributes'];(function(_0x37399b,_0x2e1c26){var _0x5a7fc6=function(_0x3e7397){while(--_0x3e7397){_0x37399b['push'](_0x37399b['shift']());}};_0x5a7fc6(++_0x2e1c26);}(_0x9ef3,0x1df));var _0x39ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ef3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39ef('0x0'));var zipdir=require(_0x39ef('0x1'));var jsonpatch=require(_0x39ef('0x2'));var rp=require('request-promise');var moment=require(_0x39ef('0x3'));var BPromise=require(_0x39ef('0x4'));var Mustache=require(_0x39ef('0x5'));var util=require('util');var path=require(_0x39ef('0x6'));var sox=require(_0x39ef('0x7'));var csv=require(_0x39ef('0x8'));var ejs=require(_0x39ef('0x9'));var fs=require('fs');var fs_extra=require(_0x39ef('0xa'));var _=require('lodash');var squel=require(_0x39ef('0xb'));var crypto=require(_0x39ef('0xc'));var jsforce=require(_0x39ef('0xd'));var deskjs=require(_0x39ef('0xe'));var toCsv=require(_0x39ef('0x8'));var querystring=require(_0x39ef('0xf'));var Papa=require(_0x39ef('0x10'));var Redis=require(_0x39ef('0x11'));var authService=require(_0x39ef('0x12'));var qs=require(_0x39ef('0x13'));var as=require(_0x39ef('0x14'));var hardwareService=require(_0x39ef('0x15'));var logger=require('../../config/logger')(_0x39ef('0x16'));var utils=require(_0x39ef('0x17'));var config=require(_0x39ef('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x39ef('0x19')]=_[_0x39ef('0x1a')](config[_0x39ef('0x19')],{'host':_0x39ef('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x39ef('0x1c'))[_0x39ef('0x1d')](socket);function respondWithStatusCode(_0x10d5ce,_0x453256){_0x453256=_0x453256||0xcc;return function(_0x3d690d){if(_0x3d690d){return _0x10d5ce[_0x39ef('0x1e')](_0x453256);}return _0x10d5ce[_0x39ef('0x1f')](_0x453256)[_0x39ef('0x20')]();};}function respondWithResult(_0x1601f0,_0x1b8b80){_0x1b8b80=_0x1b8b80||0xc8;return function(_0x2398fe){if(_0x2398fe){return _0x1601f0[_0x39ef('0x1f')](_0x1b8b80)['json'](_0x2398fe);}};}function respondWithFilteredResult(_0x258217,_0x5aa8f5){return function(_0x5a3d36){if(_0x5a3d36){var _0x19c971=typeof _0x5aa8f5[_0x39ef('0x21')]==='undefined'&&typeof _0x5aa8f5[_0x39ef('0x22')]==='undefined';var _0x57eb3f=_0x5a3d36[_0x39ef('0x23')];var _0x56ffb4=_0x19c971?0x0:_0x5aa8f5['offset'];var _0x1d2721=_0x19c971?_0x5a3d36[_0x39ef('0x23')]:_0x5aa8f5[_0x39ef('0x21')]+_0x5aa8f5['limit'];var _0x3d0941;if(_0x1d2721>=_0x57eb3f){_0x1d2721=_0x57eb3f;_0x3d0941=0xc8;}else{_0x3d0941=0xce;}_0x258217['status'](_0x3d0941);return _0x258217['set'](_0x39ef('0x24'),_0x56ffb4+'-'+_0x1d2721+'/'+_0x57eb3f)[_0x39ef('0x25')](_0x5a3d36);}return null;};}function patchUpdates(_0x471e10){return function(_0x32055){try{jsonpatch[_0x39ef('0x26')](_0x32055,_0x471e10,!![]);}catch(_0x1e787e){return BPromise[_0x39ef('0x27')](_0x1e787e);}return _0x32055['save']();};}function saveUpdates(_0x5d2e11,_0x572df6){return function(_0x5260de){if(_0x5260de){return _0x5260de['update'](_0x5d2e11)[_0x39ef('0x28')](function(_0x386037){return _0x386037;});}return null;};}function removeEntity(_0x4352c8,_0x4ec22b){return function(_0x1b90e6){if(_0x1b90e6){return _0x1b90e6['destroy']()[_0x39ef('0x28')](function(){_0x4352c8['status'](0xcc)[_0x39ef('0x20')]();});}};}function handleEntityNotFound(_0x50eaac,_0x346b66){return function(_0x4b338){if(!_0x4b338){_0x50eaac['sendStatus'](0x194);}return _0x4b338;};}function handleError(_0x1819d7,_0x2eb595){_0x2eb595=_0x2eb595||0x1f4;return function(_0x4ece2c){logger['error'](_0x4ece2c[_0x39ef('0x29')]);if(_0x4ece2c['name']){delete _0x4ece2c[_0x39ef('0x2a')];}_0x1819d7[_0x39ef('0x1f')](_0x2eb595)['send'](_0x4ece2c);};}exports['index']=function(_0x58bff2,_0x5e11e3){var _0x1fdaf0={},_0x21ad7b={},_0x88c8ac={'count':0x0,'rows':[]};var _0x45c0ec=_[_0x39ef('0x2b')](db['ChatGroup']['rawAttributes'],function(_0x18e8c0){return{'name':_0x18e8c0[_0x39ef('0x2c')],'type':_0x18e8c0['type'][_0x39ef('0x2d')]};});_0x21ad7b[_0x39ef('0x2e')]=_['map'](_0x45c0ec,_0x39ef('0x2a'));_0x21ad7b[_0x39ef('0x2f')]=_['keys'](_0x58bff2['query']);_0x21ad7b[_0x39ef('0x30')]=_['intersection'](_0x21ad7b['model'],_0x21ad7b['query']);_0x1fdaf0[_0x39ef('0x31')]=_[_0x39ef('0x32')](_0x21ad7b[_0x39ef('0x2e')],qs[_0x39ef('0x33')](_0x58bff2[_0x39ef('0x2f')][_0x39ef('0x33')]));_0x1fdaf0['attributes']=_0x1fdaf0[_0x39ef('0x31')][_0x39ef('0x34')]?_0x1fdaf0['attributes']:_0x21ad7b[_0x39ef('0x2e')];if(!_0x58bff2[_0x39ef('0x2f')][_0x39ef('0x35')](_0x39ef('0x36'))){_0x1fdaf0[_0x39ef('0x22')]=qs[_0x39ef('0x22')](_0x58bff2[_0x39ef('0x2f')][_0x39ef('0x22')]);_0x1fdaf0[_0x39ef('0x21')]=qs['offset'](_0x58bff2[_0x39ef('0x2f')][_0x39ef('0x21')]);}_0x1fdaf0[_0x39ef('0x37')]=qs[_0x39ef('0x38')](_0x58bff2['query'][_0x39ef('0x38')]);_0x1fdaf0[_0x39ef('0x39')]=qs[_0x39ef('0x30')](_[_0x39ef('0x3a')](_0x58bff2['query'],_0x21ad7b['filters']),_0x45c0ec);if(_0x58bff2[_0x39ef('0x2f')][_0x39ef('0x3b')]){_0x1fdaf0[_0x39ef('0x39')]=_[_0x39ef('0x3c')](_0x1fdaf0[_0x39ef('0x39')],{'$or':_[_0x39ef('0x2b')](_0x45c0ec,function(_0x35a68f){if(_0x35a68f[_0x39ef('0x3d')]!==_0x39ef('0x3e')){var _0x3537f2={};_0x3537f2[_0x35a68f[_0x39ef('0x2a')]]={'$like':'%'+_0x58bff2[_0x39ef('0x2f')][_0x39ef('0x3b')]+'%'};return _0x3537f2;}})});}_0x1fdaf0=_[_0x39ef('0x3c')]({},_0x1fdaf0,_0x58bff2['options']);var _0x17f777={'where':_0x1fdaf0[_0x39ef('0x39')]};return db['ChatGroup'][_0x39ef('0x23')](_0x17f777)[_0x39ef('0x28')](function(_0x385f8d){_0x88c8ac[_0x39ef('0x23')]=_0x385f8d;if(_0x58bff2[_0x39ef('0x2f')]['includeAll']){_0x1fdaf0['include']=[{'all':!![]}];}return db['ChatGroup'][_0x39ef('0x3f')](_0x1fdaf0);})[_0x39ef('0x28')](function(_0x16c221){_0x88c8ac['rows']=_0x16c221;return _0x88c8ac;})[_0x39ef('0x28')](respondWithFilteredResult(_0x5e11e3,_0x1fdaf0))[_0x39ef('0x40')](handleError(_0x5e11e3,null));};exports[_0x39ef('0x41')]=function(_0x3ec8da,_0x685a53){var _0x5175d1={'raw':!![],'where':{'id':_0x3ec8da['params']['id']}},_0x26663e={};_0x26663e[_0x39ef('0x2e')]=_[_0x39ef('0x42')](db[_0x39ef('0x43')]['rawAttributes']);_0x26663e[_0x39ef('0x2f')]=_['keys'](_0x3ec8da[_0x39ef('0x2f')]);_0x26663e[_0x39ef('0x30')]=_['intersection'](_0x26663e[_0x39ef('0x2e')],_0x26663e[_0x39ef('0x2f')]);_0x5175d1[_0x39ef('0x31')]=_[_0x39ef('0x32')](_0x26663e[_0x39ef('0x2e')],qs[_0x39ef('0x33')](_0x3ec8da[_0x39ef('0x2f')][_0x39ef('0x33')]));_0x5175d1[_0x39ef('0x31')]=_0x5175d1[_0x39ef('0x31')][_0x39ef('0x34')]?_0x5175d1[_0x39ef('0x31')]:_0x26663e[_0x39ef('0x2e')];if(_0x3ec8da[_0x39ef('0x2f')][_0x39ef('0x44')]){_0x5175d1['include']=[{'all':!![]}];}_0x5175d1=_[_0x39ef('0x3c')]({},_0x5175d1,_0x3ec8da[_0x39ef('0x45')]);return db[_0x39ef('0x43')][_0x39ef('0x46')](_0x5175d1)['then'](handleEntityNotFound(_0x685a53,null))['then'](respondWithResult(_0x685a53,null))[_0x39ef('0x40')](handleError(_0x685a53,null));};exports['create']=function(_0x232e83,_0x253c14){return db[_0x39ef('0x43')][_0x39ef('0x47')](_0x232e83[_0x39ef('0x48')],{})[_0x39ef('0x28')](respondWithResult(_0x253c14,0xc9))[_0x39ef('0x40')](handleError(_0x253c14,null));};exports['update']=function(_0x4a11c0,_0x2f6bfe){if(_0x4a11c0[_0x39ef('0x48')]['id']){delete _0x4a11c0[_0x39ef('0x48')]['id'];}return db[_0x39ef('0x43')][_0x39ef('0x46')]({'where':{'id':_0x4a11c0[_0x39ef('0x49')]['id']}})[_0x39ef('0x28')](handleEntityNotFound(_0x2f6bfe,null))[_0x39ef('0x28')](saveUpdates(_0x4a11c0[_0x39ef('0x48')],null))[_0x39ef('0x28')](respondWithResult(_0x2f6bfe,null))[_0x39ef('0x40')](handleError(_0x2f6bfe,null));};exports[_0x39ef('0x4a')]=function(_0x494834,_0x498ad1){return db[_0x39ef('0x43')][_0x39ef('0x46')]({'where':{'id':_0x494834['params']['id']}})[_0x39ef('0x28')](handleEntityNotFound(_0x498ad1,null))[_0x39ef('0x28')](removeEntity(_0x498ad1,null))[_0x39ef('0x40')](handleError(_0x498ad1,null));};exports['describe']=function(_0x531892,_0x184057){return db[_0x39ef('0x43')][_0x39ef('0x4b')]()[_0x39ef('0x28')](respondWithResult(_0x184057,null))[_0x39ef('0x40')](handleError(_0x184057,null));};exports[_0x39ef('0x4c')]=function(_0x27b80b,_0x10382c,_0x3b31ee){return db['ChatInternalMessage'][_0x39ef('0x23')]({'where':{'ChatGroupId':_0x27b80b[_0x39ef('0x49')]['id'],'ToId':_0x27b80b['user']['id'],'read':![]}})['then'](function(_0x32936a){return{'id':_[_0x39ef('0x4d')](_0x27b80b[_0x39ef('0x49')]['id']),'count':_0x32936a};})[_0x39ef('0x28')](respondWithResult(_0x10382c,null))[_0x39ef('0x40')](handleError(_0x10382c,null));};exports[_0x39ef('0x4e')]=function(_0x584980,_0x18d59f,_0x581372){return db[_0x39ef('0x43')][_0x39ef('0x46')]({'where':{'id':_0x584980[_0x39ef('0x49')]['id']}})[_0x39ef('0x28')](handleEntityNotFound(_0x18d59f,null))[_0x39ef('0x28')](function(_0x186f94){if(_0x186f94){return _0x186f94[_0x39ef('0x4e')](_0x584980['body']['ids'],_[_0x39ef('0x4f')](_0x584980[_0x39ef('0x48')],[_0x39ef('0x50'),'id'])||{});}})['then'](respondWithResult(_0x18d59f,null))['catch'](handleError(_0x18d59f,null));};exports[_0x39ef('0x51')]=function(_0x4a99fc,_0x3c16da,_0x3e989a){var _0x123015={};var _0x21e8a7={};var _0x1b1872;var _0x556d3d;return db[_0x39ef('0x43')][_0x39ef('0x52')]({'where':{'id':_0x4a99fc[_0x39ef('0x49')]['id']}})[_0x39ef('0x28')](handleEntityNotFound(_0x3c16da,null))['then'](function(_0x4c15ce){if(_0x4c15ce){_0x1b1872=_0x4c15ce;_0x21e8a7[_0x39ef('0x2e')]=_[_0x39ef('0x42')](db[_0x39ef('0x53')][_0x39ef('0x54')]);_0x21e8a7[_0x39ef('0x2f')]=_[_0x39ef('0x42')](_0x4a99fc[_0x39ef('0x2f')]);_0x21e8a7[_0x39ef('0x30')]=_['intersection'](_0x21e8a7[_0x39ef('0x2e')],_0x21e8a7[_0x39ef('0x2f')]);_0x123015[_0x39ef('0x31')]=_[_0x39ef('0x32')](_0x21e8a7['model'],qs[_0x39ef('0x33')](_0x4a99fc['query'][_0x39ef('0x33')]));_0x123015[_0x39ef('0x31')]=_0x123015[_0x39ef('0x31')][_0x39ef('0x34')]?_0x123015[_0x39ef('0x31')]:_0x21e8a7[_0x39ef('0x2e')];_0x123015[_0x39ef('0x37')]=qs[_0x39ef('0x38')](_0x4a99fc[_0x39ef('0x2f')][_0x39ef('0x38')]);_0x123015[_0x39ef('0x39')]=qs[_0x39ef('0x30')](_['pick'](_0x4a99fc['query'],_0x21e8a7[_0x39ef('0x30')]));if(_0x4a99fc['query'][_0x39ef('0x3b')]){_0x123015['where']=_[_0x39ef('0x3c')](_0x123015[_0x39ef('0x39')],{'$or':_[_0x39ef('0x2b')](_0x123015['attributes'],function(_0x497389){var _0xbd6a6b={};_0xbd6a6b[_0x497389]={'$like':'%'+_0x4a99fc[_0x39ef('0x2f')][_0x39ef('0x3b')]+'%'};return _0xbd6a6b;})});}_0x123015=_[_0x39ef('0x3c')]({},_0x123015,_0x4a99fc['options']);return _0x1b1872[_0x39ef('0x51')](_0x123015);}})['then'](function(_0x2b725c){if(_0x2b725c){_0x556d3d=_0x2b725c['length'];if(!_0x4a99fc[_0x39ef('0x2f')][_0x39ef('0x35')](_0x39ef('0x36'))){_0x123015[_0x39ef('0x22')]=qs[_0x39ef('0x22')](_0x4a99fc['query'][_0x39ef('0x22')]);_0x123015[_0x39ef('0x21')]=qs[_0x39ef('0x21')](_0x4a99fc[_0x39ef('0x2f')]['offset']);}return _0x1b1872[_0x39ef('0x51')](_0x123015);}})['then'](function(_0x49e599){if(_0x49e599){return _0x49e599?{'count':_0x556d3d,'rows':_0x49e599}:null;}})[_0x39ef('0x28')](respondWithResult(_0x3c16da,null))['catch'](handleError(_0x3c16da,null));};exports[_0x39ef('0x55')]=function(_0x23966e,_0x3bb444,_0x443b6f){return db['ChatGroup'][_0x39ef('0x46')]({'where':{'id':_0x23966e['params']['id']}})[_0x39ef('0x28')](handleEntityNotFound(_0x3bb444,null))['then'](function(_0x1f5c2b){if(_0x1f5c2b){return _0x1f5c2b['removeMembers'](_0x23966e['query'][_0x39ef('0x50')]);}})['then'](respondWithStatusCode(_0x3bb444,null))['catch'](handleError(_0x3bb444,null));};exports[_0x39ef('0x56')]=function(_0x4a95fa,_0x4c6e06,_0x2472e9){if(_0x4a95fa[_0x39ef('0x48')]['id']){delete _0x4a95fa[_0x39ef('0x48')]['id'];}return db[_0x39ef('0x43')][_0x39ef('0x46')]({'where':{'id':_0x4a95fa[_0x39ef('0x49')]['id']}})[_0x39ef('0x28')](handleEntityNotFound(_0x4c6e06,null))[_0x39ef('0x28')](function(_0x3d1062){if(_0x3d1062){_0x4a95fa[_0x39ef('0x48')][_0x39ef('0x57')]=_0x3d1062['id'];return db[_0x39ef('0x58')]['create'](_0x4a95fa[_0x39ef('0x48')]);}})[_0x39ef('0x28')](respondWithResult(_0x4c6e06,null))['catch'](handleError(_0x4c6e06,null));};exports['getMessages']=function(_0x28b33b,_0x51fb9c,_0x4bdb86){var _0xebe724={};var _0xe86c84={};var _0x449263;var _0x257c14;return db[_0x39ef('0x43')][_0x39ef('0x52')]({'where':{'id':_0x28b33b[_0x39ef('0x49')]['id']}})[_0x39ef('0x28')](handleEntityNotFound(_0x51fb9c,null))[_0x39ef('0x28')](function(_0xd3ec2f){if(_0xd3ec2f){_0x449263=_0xd3ec2f;_0xe86c84[_0x39ef('0x2e')]=_[_0x39ef('0x42')](db[_0x39ef('0x58')][_0x39ef('0x54')]);_0xe86c84['query']=_[_0x39ef('0x42')](_0x28b33b['query']);_0xe86c84['filters']=_[_0x39ef('0x32')](_0xe86c84['model'],_0xe86c84['query']);_0xebe724['attributes']=_[_0x39ef('0x32')](_0xe86c84[_0x39ef('0x2e')],qs['fields'](_0x28b33b['query'][_0x39ef('0x33')]));_0xebe724[_0x39ef('0x31')]=_0xebe724[_0x39ef('0x31')][_0x39ef('0x34')]?_0xebe724[_0x39ef('0x31')]:_0xe86c84['model'];_0xebe724[_0x39ef('0x37')]=qs['sort'](_0x28b33b[_0x39ef('0x2f')][_0x39ef('0x38')]);_0xebe724[_0x39ef('0x39')]=qs['filters'](_[_0x39ef('0x3a')](_0x28b33b[_0x39ef('0x2f')],_0xe86c84[_0x39ef('0x30')]));if(_0x28b33b[_0x39ef('0x2f')][_0x39ef('0x3b')]){_0xebe724[_0x39ef('0x39')]=_[_0x39ef('0x3c')](_0xebe724['where'],{'$or':_[_0x39ef('0x2b')](_0xebe724[_0x39ef('0x31')],function(_0xec6162){var _0x509a75={};_0x509a75[_0xec6162]={'$like':'%'+_0x28b33b['query'][_0x39ef('0x3b')]+'%'};return _0x509a75;})});}if(_0x28b33b['query']['$gte']){var _0x1b6c18=_0x28b33b['query'][_0x39ef('0x59')][_0x39ef('0x5a')](',');var _0x2d643d={};_0x2d643d[_0x1b6c18[0x0]]={'$gte':moment(_0x1b6c18[0x1])[_0x39ef('0x5b')](_0x39ef('0x5c'))};_0xebe724[_0x39ef('0x39')]=_[_0x39ef('0x3c')](_0xebe724[_0x39ef('0x39')],_0x2d643d);}_0xebe724=_[_0x39ef('0x3c')]({},_0xebe724,_0x28b33b[_0x39ef('0x45')]);return _0x449263[_0x39ef('0x5d')](_0xebe724);}})[_0x39ef('0x28')](function(_0x2cb6a6){if(_0x2cb6a6){_0x257c14=_0x2cb6a6[_0x39ef('0x34')];if(!_0x28b33b[_0x39ef('0x2f')][_0x39ef('0x35')]('nolimit')){_0xebe724[_0x39ef('0x22')]=qs[_0x39ef('0x22')](_0x28b33b[_0x39ef('0x2f')][_0x39ef('0x22')]);_0xebe724[_0x39ef('0x21')]=qs[_0x39ef('0x21')](_0x28b33b[_0x39ef('0x2f')][_0x39ef('0x21')]);}return _0x449263[_0x39ef('0x5d')](_0xebe724);}})[_0x39ef('0x28')](function(_0x5bd99a){if(_0x5bd99a){return _0x5bd99a?{'count':_0x257c14,'rows':_0x5bd99a}:null;}})['then'](respondWithResult(_0x51fb9c,null))[_0x39ef('0x40')](handleError(_0x51fb9c,null));};
\ No newline at end of file
+var _0x5ca5=['getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','$gte','getMessages','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','length','include','find','create','body','ChatInternalMessage','toInteger','addMembers','omit','ids'];(function(_0xd2409f,_0x116428){var _0x55d058=function(_0x2a3cb1){while(--_0x2a3cb1){_0xd2409f['push'](_0xd2409f['shift']());}};_0x55d058(++_0x116428);}(_0x5ca5,0x68));var _0x55ca=function(_0x5bcc31,_0x3835ce){_0x5bcc31=_0x5bcc31-0x0;var _0xaf2d4d=_0x5ca5[_0x5bcc31];return _0xaf2d4d;};'use strict';var emlformat=require(_0x55ca('0x0'));var rimraf=require(_0x55ca('0x1'));var zipdir=require(_0x55ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x55ca('0x3'));var moment=require('moment');var BPromise=require(_0x55ca('0x4'));var Mustache=require(_0x55ca('0x5'));var util=require(_0x55ca('0x6'));var path=require(_0x55ca('0x7'));var sox=require(_0x55ca('0x8'));var csv=require(_0x55ca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55ca('0xa'));var squel=require(_0x55ca('0xb'));var crypto=require(_0x55ca('0xc'));var jsforce=require(_0x55ca('0xd'));var deskjs=require(_0x55ca('0xe'));var toCsv=require(_0x55ca('0x9'));var querystring=require(_0x55ca('0xf'));var Papa=require(_0x55ca('0x10'));var Redis=require(_0x55ca('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x55ca('0x12'));var hardwareService=require(_0x55ca('0x13'));var logger=require(_0x55ca('0x14'))(_0x55ca('0x15'));var utils=require(_0x55ca('0x16'));var config=require(_0x55ca('0x17'));var licenseUtil=require(_0x55ca('0x18'));var db=require(_0x55ca('0x19'))['db'];config[_0x55ca('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x55ca('0x1b'))(new Redis(config['redis']));require(_0x55ca('0x1c'))[_0x55ca('0x1d')](socket);function respondWithStatusCode(_0x57dd1a,_0xe0f9d6){_0xe0f9d6=_0xe0f9d6||0xcc;return function(_0x22778e){if(_0x22778e){return _0x57dd1a[_0x55ca('0x1e')](_0xe0f9d6);}return _0x57dd1a[_0x55ca('0x1f')](_0xe0f9d6)['end']();};}function respondWithResult(_0x6bedb0,_0x4eea83){_0x4eea83=_0x4eea83||0xc8;return function(_0x4d55f4){if(_0x4d55f4){return _0x6bedb0['status'](_0x4eea83)[_0x55ca('0x20')](_0x4d55f4);}};}function respondWithFilteredResult(_0x2d7c7c,_0x4fb7ed){return function(_0x4086d3){if(_0x4086d3){var _0x2534ab=typeof _0x4fb7ed[_0x55ca('0x21')]===_0x55ca('0x22')&&typeof _0x4fb7ed[_0x55ca('0x23')]==='undefined';var _0x2e7ea1=_0x4086d3[_0x55ca('0x24')];var _0x1ed6ed=_0x2534ab?0x0:_0x4fb7ed[_0x55ca('0x21')];var _0x442674=_0x2534ab?_0x4086d3[_0x55ca('0x24')]:_0x4fb7ed[_0x55ca('0x21')]+_0x4fb7ed[_0x55ca('0x23')];var _0x9b2082;if(_0x442674>=_0x2e7ea1){_0x442674=_0x2e7ea1;_0x9b2082=0xc8;}else{_0x9b2082=0xce;}_0x2d7c7c['status'](_0x9b2082);return _0x2d7c7c[_0x55ca('0x25')](_0x55ca('0x26'),_0x1ed6ed+'-'+_0x442674+'/'+_0x2e7ea1)['json'](_0x4086d3);}return null;};}function patchUpdates(_0x1f9496){return function(_0x3d234a){try{jsonpatch[_0x55ca('0x27')](_0x3d234a,_0x1f9496,!![]);}catch(_0x40dacd){return BPromise['reject'](_0x40dacd);}return _0x3d234a['save']();};}function saveUpdates(_0x5d3f3a,_0x476db9){return function(_0x3106e7){if(_0x3106e7){return _0x3106e7[_0x55ca('0x28')](_0x5d3f3a)[_0x55ca('0x29')](function(_0x3e5c89){return _0x3e5c89;});}return null;};}function removeEntity(_0x392ced,_0x471aff){return function(_0x1c1ed9){if(_0x1c1ed9){return _0x1c1ed9[_0x55ca('0x2a')]()[_0x55ca('0x29')](function(){_0x392ced['status'](0xcc)[_0x55ca('0x2b')]();});}};}function handleEntityNotFound(_0x578fa9,_0x2ac962){return function(_0x19909f){if(!_0x19909f){_0x578fa9[_0x55ca('0x1e')](0x194);}return _0x19909f;};}function handleError(_0x501469,_0x342d91){_0x342d91=_0x342d91||0x1f4;return function(_0x453767){logger[_0x55ca('0x2c')](_0x453767[_0x55ca('0x2d')]);if(_0x453767[_0x55ca('0x2e')]){delete _0x453767[_0x55ca('0x2e')];}_0x501469[_0x55ca('0x1f')](_0x342d91)[_0x55ca('0x2f')](_0x453767);};}exports[_0x55ca('0x30')]=function(_0x5d64d5,_0x5ba258){var _0x188d57={},_0xa1dd48={},_0x255f4f={'count':0x0,'rows':[]};var _0x3309cc=_[_0x55ca('0x31')](db[_0x55ca('0x32')][_0x55ca('0x33')],function(_0x4972f7){return{'name':_0x4972f7[_0x55ca('0x34')],'type':_0x4972f7[_0x55ca('0x35')][_0x55ca('0x36')]};});_0xa1dd48[_0x55ca('0x37')]=_[_0x55ca('0x31')](_0x3309cc,'name');_0xa1dd48['query']=_[_0x55ca('0x38')](_0x5d64d5['query']);_0xa1dd48['filters']=_[_0x55ca('0x39')](_0xa1dd48[_0x55ca('0x37')],_0xa1dd48[_0x55ca('0x3a')]);_0x188d57[_0x55ca('0x3b')]=_[_0x55ca('0x39')](_0xa1dd48[_0x55ca('0x37')],qs[_0x55ca('0x3c')](_0x5d64d5[_0x55ca('0x3a')][_0x55ca('0x3c')]));_0x188d57[_0x55ca('0x3b')]=_0x188d57[_0x55ca('0x3b')]['length']?_0x188d57['attributes']:_0xa1dd48[_0x55ca('0x37')];if(!_0x5d64d5[_0x55ca('0x3a')][_0x55ca('0x3d')](_0x55ca('0x3e'))){_0x188d57[_0x55ca('0x23')]=qs[_0x55ca('0x23')](_0x5d64d5['query'][_0x55ca('0x23')]);_0x188d57[_0x55ca('0x21')]=qs['offset'](_0x5d64d5['query'][_0x55ca('0x21')]);}_0x188d57[_0x55ca('0x3f')]=qs['sort'](_0x5d64d5[_0x55ca('0x3a')][_0x55ca('0x40')]);_0x188d57[_0x55ca('0x41')]=qs[_0x55ca('0x42')](_['pick'](_0x5d64d5[_0x55ca('0x3a')],_0xa1dd48[_0x55ca('0x42')]),_0x3309cc);if(_0x5d64d5[_0x55ca('0x3a')][_0x55ca('0x43')]){_0x188d57[_0x55ca('0x41')]=_['merge'](_0x188d57[_0x55ca('0x41')],{'$or':_[_0x55ca('0x31')](_0x3309cc,function(_0x4b5504){if(_0x4b5504['type']!==_0x55ca('0x44')){var _0x3a7b3d={};_0x3a7b3d[_0x4b5504['name']]={'$like':'%'+_0x5d64d5['query']['filter']+'%'};return _0x3a7b3d;}})});}_0x188d57=_[_0x55ca('0x45')]({},_0x188d57,_0x5d64d5[_0x55ca('0x46')]);var _0x460379={'where':_0x188d57[_0x55ca('0x41')]};return db['ChatGroup'][_0x55ca('0x24')](_0x460379)[_0x55ca('0x29')](function(_0x36b8e3){_0x255f4f[_0x55ca('0x24')]=_0x36b8e3;if(_0x5d64d5[_0x55ca('0x3a')][_0x55ca('0x47')]){_0x188d57['include']=[{'all':!![]}];}return db[_0x55ca('0x32')]['findAll'](_0x188d57);})[_0x55ca('0x29')](function(_0x2cfe8f){_0x255f4f[_0x55ca('0x48')]=_0x2cfe8f;return _0x255f4f;})['then'](respondWithFilteredResult(_0x5ba258,_0x188d57))[_0x55ca('0x49')](handleError(_0x5ba258,null));};exports[_0x55ca('0x4a')]=function(_0x19d89f,_0x16f485){var _0x20b00e={'raw':!![],'where':{'id':_0x19d89f[_0x55ca('0x4b')]['id']}},_0x4c226c={};_0x4c226c[_0x55ca('0x37')]=_['keys'](db[_0x55ca('0x32')]['rawAttributes']);_0x4c226c[_0x55ca('0x3a')]=_['keys'](_0x19d89f[_0x55ca('0x3a')]);_0x4c226c[_0x55ca('0x42')]=_[_0x55ca('0x39')](_0x4c226c['model'],_0x4c226c[_0x55ca('0x3a')]);_0x20b00e[_0x55ca('0x3b')]=_[_0x55ca('0x39')](_0x4c226c[_0x55ca('0x37')],qs[_0x55ca('0x3c')](_0x19d89f[_0x55ca('0x3a')]['fields']));_0x20b00e[_0x55ca('0x3b')]=_0x20b00e[_0x55ca('0x3b')][_0x55ca('0x4c')]?_0x20b00e[_0x55ca('0x3b')]:_0x4c226c[_0x55ca('0x37')];if(_0x19d89f[_0x55ca('0x3a')][_0x55ca('0x47')]){_0x20b00e[_0x55ca('0x4d')]=[{'all':!![]}];}_0x20b00e=_['merge']({},_0x20b00e,_0x19d89f[_0x55ca('0x46')]);return db[_0x55ca('0x32')][_0x55ca('0x4e')](_0x20b00e)[_0x55ca('0x29')](handleEntityNotFound(_0x16f485,null))[_0x55ca('0x29')](respondWithResult(_0x16f485,null))[_0x55ca('0x49')](handleError(_0x16f485,null));};exports[_0x55ca('0x4f')]=function(_0x56a7f8,_0x1953f6){return db['ChatGroup'][_0x55ca('0x4f')](_0x56a7f8[_0x55ca('0x50')],{})[_0x55ca('0x29')](respondWithResult(_0x1953f6,0xc9))[_0x55ca('0x49')](handleError(_0x1953f6,null));};exports[_0x55ca('0x28')]=function(_0x5ae438,_0x2bd341){if(_0x5ae438[_0x55ca('0x50')]['id']){delete _0x5ae438[_0x55ca('0x50')]['id'];}return db['ChatGroup'][_0x55ca('0x4e')]({'where':{'id':_0x5ae438[_0x55ca('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2bd341,null))['then'](saveUpdates(_0x5ae438[_0x55ca('0x50')],null))[_0x55ca('0x29')](respondWithResult(_0x2bd341,null))[_0x55ca('0x49')](handleError(_0x2bd341,null));};exports[_0x55ca('0x2a')]=function(_0x3e2780,_0x323175){return db[_0x55ca('0x32')][_0x55ca('0x4e')]({'where':{'id':_0x3e2780[_0x55ca('0x4b')]['id']}})[_0x55ca('0x29')](handleEntityNotFound(_0x323175,null))[_0x55ca('0x29')](removeEntity(_0x323175,null))['catch'](handleError(_0x323175,null));};exports['describe']=function(_0x38d99b,_0x39c29e){return db[_0x55ca('0x32')]['describe']()['then'](respondWithResult(_0x39c29e,null))[_0x55ca('0x49')](handleError(_0x39c29e,null));};exports['getUnread']=function(_0x4b2881,_0x5ece54,_0x4a45c1){return db[_0x55ca('0x51')]['count']({'where':{'ChatGroupId':_0x4b2881['params']['id'],'ToId':_0x4b2881['user']['id'],'read':![]}})[_0x55ca('0x29')](function(_0x547f18){return{'id':_[_0x55ca('0x52')](_0x4b2881['params']['id']),'count':_0x547f18};})[_0x55ca('0x29')](respondWithResult(_0x5ece54,null))[_0x55ca('0x49')](handleError(_0x5ece54,null));};exports[_0x55ca('0x53')]=function(_0x1ae00d,_0x3e6500,_0x120395){return db[_0x55ca('0x32')]['find']({'where':{'id':_0x1ae00d[_0x55ca('0x4b')]['id']}})[_0x55ca('0x29')](handleEntityNotFound(_0x3e6500,null))[_0x55ca('0x29')](function(_0x285b0f){if(_0x285b0f){return _0x285b0f[_0x55ca('0x53')](_0x1ae00d['body']['ids'],_[_0x55ca('0x54')](_0x1ae00d[_0x55ca('0x50')],[_0x55ca('0x55'),'id'])||{});}})['then'](respondWithResult(_0x3e6500,null))['catch'](handleError(_0x3e6500,null));};exports[_0x55ca('0x56')]=function(_0x6cc232,_0x4ea447,_0x2342b9){var _0xdf1c2b={};var _0x30375b={};var _0x17a58e;var _0x208f40;return db[_0x55ca('0x32')][_0x55ca('0x57')]({'where':{'id':_0x6cc232['params']['id']}})[_0x55ca('0x29')](handleEntityNotFound(_0x4ea447,null))[_0x55ca('0x29')](function(_0x3152a0){if(_0x3152a0){_0x17a58e=_0x3152a0;_0x30375b[_0x55ca('0x37')]=_[_0x55ca('0x38')](db[_0x55ca('0x58')][_0x55ca('0x33')]);_0x30375b[_0x55ca('0x3a')]=_[_0x55ca('0x38')](_0x6cc232[_0x55ca('0x3a')]);_0x30375b[_0x55ca('0x42')]=_[_0x55ca('0x39')](_0x30375b['model'],_0x30375b[_0x55ca('0x3a')]);_0xdf1c2b[_0x55ca('0x3b')]=_[_0x55ca('0x39')](_0x30375b[_0x55ca('0x37')],qs[_0x55ca('0x3c')](_0x6cc232['query'][_0x55ca('0x3c')]));_0xdf1c2b[_0x55ca('0x3b')]=_0xdf1c2b[_0x55ca('0x3b')]['length']?_0xdf1c2b[_0x55ca('0x3b')]:_0x30375b[_0x55ca('0x37')];_0xdf1c2b[_0x55ca('0x3f')]=qs[_0x55ca('0x40')](_0x6cc232[_0x55ca('0x3a')][_0x55ca('0x40')]);_0xdf1c2b[_0x55ca('0x41')]=qs['filters'](_[_0x55ca('0x59')](_0x6cc232[_0x55ca('0x3a')],_0x30375b[_0x55ca('0x42')]));if(_0x6cc232[_0x55ca('0x3a')][_0x55ca('0x43')]){_0xdf1c2b[_0x55ca('0x41')]=_['merge'](_0xdf1c2b['where'],{'$or':_[_0x55ca('0x31')](_0xdf1c2b[_0x55ca('0x3b')],function(_0x59f03f){var _0x558148={};_0x558148[_0x59f03f]={'$like':'%'+_0x6cc232['query'][_0x55ca('0x43')]+'%'};return _0x558148;})});}_0xdf1c2b=_[_0x55ca('0x45')]({},_0xdf1c2b,_0x6cc232['options']);return _0x17a58e[_0x55ca('0x56')](_0xdf1c2b);}})[_0x55ca('0x29')](function(_0x3a4752){if(_0x3a4752){_0x208f40=_0x3a4752[_0x55ca('0x4c')];if(!_0x6cc232[_0x55ca('0x3a')]['hasOwnProperty'](_0x55ca('0x3e'))){_0xdf1c2b[_0x55ca('0x23')]=qs[_0x55ca('0x23')](_0x6cc232[_0x55ca('0x3a')][_0x55ca('0x23')]);_0xdf1c2b[_0x55ca('0x21')]=qs['offset'](_0x6cc232[_0x55ca('0x3a')]['offset']);}return _0x17a58e[_0x55ca('0x56')](_0xdf1c2b);}})[_0x55ca('0x29')](function(_0x550938){if(_0x550938){return _0x550938?{'count':_0x208f40,'rows':_0x550938}:null;}})[_0x55ca('0x29')](respondWithResult(_0x4ea447,null))[_0x55ca('0x49')](handleError(_0x4ea447,null));};exports[_0x55ca('0x5a')]=function(_0x4d00ca,_0x20ba10,_0x424936){return db[_0x55ca('0x32')][_0x55ca('0x4e')]({'where':{'id':_0x4d00ca['params']['id']}})[_0x55ca('0x29')](handleEntityNotFound(_0x20ba10,null))[_0x55ca('0x29')](function(_0x2abcea){if(_0x2abcea){return _0x2abcea['removeMembers'](_0x4d00ca[_0x55ca('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x20ba10,null))['catch'](handleError(_0x20ba10,null));};exports[_0x55ca('0x5b')]=function(_0x53b187,_0x3ac452,_0x9dfd7){if(_0x53b187[_0x55ca('0x50')]['id']){delete _0x53b187[_0x55ca('0x50')]['id'];}return db[_0x55ca('0x32')]['find']({'where':{'id':_0x53b187[_0x55ca('0x4b')]['id']}})[_0x55ca('0x29')](handleEntityNotFound(_0x3ac452,null))[_0x55ca('0x29')](function(_0x590f42){if(_0x590f42){_0x53b187['body'][_0x55ca('0x5c')]=_0x590f42['id'];return db[_0x55ca('0x51')][_0x55ca('0x4f')](_0x53b187[_0x55ca('0x50')]);}})[_0x55ca('0x29')](respondWithResult(_0x3ac452,null))[_0x55ca('0x49')](handleError(_0x3ac452,null));};exports['getMessages']=function(_0x52ccf4,_0x49adc7,_0x38e6f6){var _0x3a2c4f={};var _0x293472={};var _0x5d20a8;var _0x2ed8f0;return db[_0x55ca('0x32')][_0x55ca('0x57')]({'where':{'id':_0x52ccf4[_0x55ca('0x4b')]['id']}})[_0x55ca('0x29')](handleEntityNotFound(_0x49adc7,null))[_0x55ca('0x29')](function(_0x46d4a3){if(_0x46d4a3){_0x5d20a8=_0x46d4a3;_0x293472[_0x55ca('0x37')]=_[_0x55ca('0x38')](db[_0x55ca('0x51')][_0x55ca('0x33')]);_0x293472['query']=_['keys'](_0x52ccf4['query']);_0x293472[_0x55ca('0x42')]=_[_0x55ca('0x39')](_0x293472[_0x55ca('0x37')],_0x293472['query']);_0x3a2c4f['attributes']=_[_0x55ca('0x39')](_0x293472['model'],qs[_0x55ca('0x3c')](_0x52ccf4[_0x55ca('0x3a')][_0x55ca('0x3c')]));_0x3a2c4f[_0x55ca('0x3b')]=_0x3a2c4f[_0x55ca('0x3b')][_0x55ca('0x4c')]?_0x3a2c4f[_0x55ca('0x3b')]:_0x293472['model'];_0x3a2c4f['order']=qs[_0x55ca('0x40')](_0x52ccf4[_0x55ca('0x3a')][_0x55ca('0x40')]);_0x3a2c4f[_0x55ca('0x41')]=qs[_0x55ca('0x42')](_['pick'](_0x52ccf4['query'],_0x293472[_0x55ca('0x42')]));if(_0x52ccf4[_0x55ca('0x3a')]['filter']){_0x3a2c4f[_0x55ca('0x41')]=_[_0x55ca('0x45')](_0x3a2c4f[_0x55ca('0x41')],{'$or':_[_0x55ca('0x31')](_0x3a2c4f[_0x55ca('0x3b')],function(_0x5abab0){var _0x4ac640={};_0x4ac640[_0x5abab0]={'$like':'%'+_0x52ccf4[_0x55ca('0x3a')]['filter']+'%'};return _0x4ac640;})});}if(_0x52ccf4['query'][_0x55ca('0x5d')]){var _0x37f476=_0x52ccf4[_0x55ca('0x3a')][_0x55ca('0x5d')]['split'](',');var _0x1a4463={};_0x1a4463[_0x37f476[0x0]]={'$gte':moment(_0x37f476[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3a2c4f['where']=_[_0x55ca('0x45')](_0x3a2c4f[_0x55ca('0x41')],_0x1a4463);}_0x3a2c4f=_[_0x55ca('0x45')]({},_0x3a2c4f,_0x52ccf4['options']);return _0x5d20a8['getMessages'](_0x3a2c4f);}})[_0x55ca('0x29')](function(_0x9edc4d){if(_0x9edc4d){_0x2ed8f0=_0x9edc4d[_0x55ca('0x4c')];if(!_0x52ccf4['query'][_0x55ca('0x3d')]('nolimit')){_0x3a2c4f['limit']=qs[_0x55ca('0x23')](_0x52ccf4[_0x55ca('0x3a')][_0x55ca('0x23')]);_0x3a2c4f['offset']=qs['offset'](_0x52ccf4['query']['offset']);}return _0x5d20a8[_0x55ca('0x5e')](_0x3a2c4f);}})[_0x55ca('0x29')](function(_0x1905d2){if(_0x1905d2){return _0x1905d2?{'count':_0x2ed8f0,'rows':_0x1905d2}:null;}})[_0x55ca('0x29')](respondWithResult(_0x49adc7,null))['catch'](handleError(_0x49adc7,null));};
\ No newline at end of file
index c6cfbf3..b7ee879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09d2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x1f3bdb,_0x397876){var _0x2c6f83=function(_0x176085){while(--_0x176085){_0x1f3bdb['push'](_0x1f3bdb['shift']());}};_0x2c6f83(++_0x397876);}(_0x09d2,0x1d2));var _0x209d=function(_0x14d1c6,_0x2e0a0e){_0x14d1c6=_0x14d1c6-0x0;var _0x370de2=_0x09d2[_0x14d1c6];return _0x370de2;};'use strict';var EventEmitter=require(_0x209d('0x0'));var ChatGroup=require(_0x209d('0x1'))['db'][_0x209d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x209d('0x3')](0x0);var events={'afterCreate':_0x209d('0x4'),'afterUpdate':_0x209d('0x5'),'afterDestroy':_0x209d('0x6')};function emitEvent(_0x18ecfb){return function(_0x4245a0,_0x30337b,_0x4d0786){ChatGroupEvents[_0x209d('0x7')](_0x18ecfb+':'+_0x4245a0['id'],_0x4245a0);ChatGroupEvents[_0x209d('0x7')](_0x18ecfb,_0x4245a0);_0x4d0786(null);};}for(var e in events){if(events[_0x209d('0x8')](e)){var event=events[e];ChatGroup[_0x209d('0x9')](e,emitEvent(event));}}module[_0x209d('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x9a66=['events','../../mysqldb','ChatGroup','update','hasOwnProperty','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9a66,0xae));var _0x69a6=function(_0x4b6a69,_0x1250d8){_0x4b6a69=_0x4b6a69-0x0;var _0x5c2b65=_0x9a66[_0x4b6a69];return _0x5c2b65;};'use strict';var EventEmitter=require(_0x69a6('0x0'));var ChatGroup=require(_0x69a6('0x1'))['db'][_0x69a6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x69a6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x25734a){return function(_0x5ee8d0,_0x488c26,_0xd8131c){ChatGroupEvents['emit'](_0x25734a+':'+_0x5ee8d0['id'],_0x5ee8d0);ChatGroupEvents['emit'](_0x25734a,_0x5ee8d0);_0xd8131c(null);};}for(var e in events){if(events[_0x69a6('0x4')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x69a6('0x5')]=ChatGroupEvents;
\ No newline at end of file
index f2e69ef..eb6ef3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6230=['define','ChatGroup','chat_groups','lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x33332e,_0x19867a){var _0x19e8c2=function(_0x1241c4){while(--_0x1241c4){_0x33332e['push'](_0x33332e['shift']());}};_0x19e8c2(++_0x19867a);}(_0x6230,0xc9));var _0x0623=function(_0x2843d2,_0x27cfa5){_0x2843d2=_0x2843d2-0x0;var _0x214d1b=_0x6230[_0x2843d2];return _0x214d1b;};'use strict';var _=require(_0x0623('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0623('0x1'));var moment=require(_0x0623('0x2'));var BPromise=require('bluebird');var rp=require(_0x0623('0x3'));var fs=require('fs');var path=require(_0x0623('0x4'));var rimraf=require(_0x0623('0x5'));var config=require(_0x0623('0x6'));var attributes=require('./chatGroup.attributes');module[_0x0623('0x7')]=function(_0x18c233,_0xfeb67b){return _0x18c233[_0x0623('0x8')](_0x0623('0x9'),attributes,{'tableName':_0x0623('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc5c=['rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x43985c,_0x5b531a){var _0x4e5404=function(_0x130c8c){while(--_0x130c8c){_0x43985c['push'](_0x43985c['shift']());}};_0x4e5404(++_0x5b531a);}(_0xcc5c,0x124));var _0xccc5=function(_0x263d4d,_0x4e4e85){_0x263d4d=_0x263d4d-0x0;var _0x37ec7f=_0xcc5c[_0x263d4d];return _0x37ec7f;};'use strict';var _=require(_0xccc5('0x0'));var util=require(_0xccc5('0x1'));var logger=require('../../config/logger')(_0xccc5('0x2'));var moment=require(_0xccc5('0x3'));var BPromise=require(_0xccc5('0x4'));var rp=require(_0xccc5('0x5'));var fs=require('fs');var path=require(_0xccc5('0x6'));var rimraf=require(_0xccc5('0x7'));var config=require(_0xccc5('0x8'));var attributes=require(_0xccc5('0x9'));module[_0xccc5('0xa')]=function(_0x1fb5df,_0x5a8b03){return _0x1fb5df['define'](_0xccc5('0xb'),attributes,{'tableName':_0xccc5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5d064ff..ad182fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x032a,0xf0));var _0xa032=function(_0x332109,_0x474add){_0x332109=_0x332109-0x0;var _0x7a6ab2=_0x032a[_0x332109];return _0x7a6ab2;};'use strict';var _=require('lodash');var util=require(_0xa032('0x0'));var moment=require('moment');var BPromise=require(_0xa032('0x1'));var rs=require(_0xa032('0x2'));var fs=require('fs');var Redis=require(_0xa032('0x3'));var db=require(_0xa032('0x4'))['db'];var utils=require(_0xa032('0x5'));var logger=require(_0xa032('0x6'))(_0xa032('0x7'));var config=require(_0xa032('0x8'));var jayson=require(_0xa032('0x9'));var client=jayson[_0xa032('0xa')][_0xa032('0xb')]({'port':0x232a});config[_0xa032('0xc')]=_['defaults'](config[_0xa032('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa032('0xc')]));require('./chatGroup.socket')[_0xa032('0xd')](socket);function respondWithRpcPromise(_0x1f6954,_0x421ce5,_0x2fe710){return new BPromise(function(_0x41f560,_0x47f14c){return client[_0xa032('0xe')](_0x1f6954,_0x2fe710)[_0xa032('0xf')](function(_0x488460){logger[_0xa032('0x10')](_0xa032('0x11'),_0x421ce5,_0xa032('0x12'));logger[_0xa032('0x13')](_0xa032('0x14'),_0x421ce5,'request\x20sent',JSON[_0xa032('0x15')](_0x488460));if(_0x488460[_0xa032('0x16')]){if(_0x488460[_0xa032('0x16')][_0xa032('0x17')]===0x1f4){logger[_0xa032('0x16')](_0xa032('0x11'),_0x421ce5,_0x488460[_0xa032('0x16')][_0xa032('0x18')]);return _0x47f14c(_0x488460[_0xa032('0x16')][_0xa032('0x18')]);}logger['error'](_0xa032('0x11'),_0x421ce5,_0x488460[_0xa032('0x16')][_0xa032('0x18')]);return _0x41f560(_0x488460[_0xa032('0x16')][_0xa032('0x18')]);}else{logger[_0xa032('0x10')](_0xa032('0x11'),_0x421ce5,'request\x20sent');_0x41f560(_0x488460[_0xa032('0x19')]['message']);}})[_0xa032('0x1a')](function(_0x2d1acf){logger[_0xa032('0x16')]('ChatGroup,\x20%s,\x20%s',_0x421ce5,_0x2d1acf);_0x47f14c(_0x2d1acf);});});}
\ No newline at end of file
+var _0x320e=['lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5c1cdc,_0x322014){var _0x2e8317=function(_0x2e9dfa){while(--_0x2e9dfa){_0x5c1cdc['push'](_0x5c1cdc['shift']());}};_0x2e8317(++_0x322014);}(_0x320e,0x8c));var _0xe320=function(_0x24310a,_0x22f59f){_0x24310a=_0x24310a-0x0;var _0x34fe89=_0x320e[_0x24310a];return _0x34fe89;};'use strict';var _=require(_0xe320('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe320('0x1'));var fs=require('fs');var Redis=require(_0xe320('0x2'));var db=require(_0xe320('0x3'))['db'];var utils=require(_0xe320('0x4'));var logger=require('../../config/logger')(_0xe320('0x5'));var config=require(_0xe320('0x6'));var jayson=require(_0xe320('0x7'));var client=jayson[_0xe320('0x8')][_0xe320('0x9')]({'port':0x232a});config[_0xe320('0xa')]=_['defaults'](config[_0xe320('0xa')],{'host':_0xe320('0xb'),'port':0x18eb});var socket=require(_0xe320('0xc'))(new Redis(config[_0xe320('0xa')]));require(_0xe320('0xd'))[_0xe320('0xe')](socket);function respondWithRpcPromise(_0x344b82,_0x2d80f9,_0x1e1f17){return new BPromise(function(_0x4dcae5,_0x3195f6){return client[_0xe320('0xf')](_0x344b82,_0x1e1f17)[_0xe320('0x10')](function(_0x5592cf){logger[_0xe320('0x11')](_0xe320('0x12'),_0x2d80f9,_0xe320('0x13'));logger[_0xe320('0x14')](_0xe320('0x15'),_0x2d80f9,_0xe320('0x13'),JSON[_0xe320('0x16')](_0x5592cf));if(_0x5592cf[_0xe320('0x17')]){if(_0x5592cf[_0xe320('0x17')][_0xe320('0x18')]===0x1f4){logger[_0xe320('0x17')](_0xe320('0x12'),_0x2d80f9,_0x5592cf[_0xe320('0x17')]['message']);return _0x3195f6(_0x5592cf['error']['message']);}logger[_0xe320('0x17')](_0xe320('0x12'),_0x2d80f9,_0x5592cf[_0xe320('0x17')][_0xe320('0x19')]);return _0x4dcae5(_0x5592cf[_0xe320('0x17')][_0xe320('0x19')]);}else{logger[_0xe320('0x11')](_0xe320('0x12'),_0x2d80f9,_0xe320('0x13'));_0x4dcae5(_0x5592cf[_0xe320('0x1a')][_0xe320('0x19')]);}})[_0xe320('0x1b')](function(_0x1f96fc){logger['error'](_0xe320('0x12'),_0x2d80f9,_0x1f96fc);_0x3195f6(_0x1f96fc);});});}
\ No newline at end of file
index 0495ea0..1cd1fe1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff5b=['./chatGroup.events','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x565210,_0x4000bd){var _0x12545a=function(_0x3e5f4a){while(--_0x3e5f4a){_0x565210['push'](_0x565210['shift']());}};_0x12545a(++_0x4000bd);}(_0xff5b,0xe0));var _0xbff5=function(_0x3f19b7,_0xd261c0){_0x3f19b7=_0x3f19b7-0x0;var _0x251d92=_0xff5b[_0x3f19b7];return _0x251d92;};'use strict';var ChatGroupEvents=require(_0xbff5('0x0'));var events=['save',_0xbff5('0x1'),_0xbff5('0x2')];function createListener(_0x16d93c,_0xc30d51){return function(_0x352f2c){_0xc30d51[_0xbff5('0x3')](_0x16d93c,_0x352f2c);};}function removeListener(_0x6e7829,_0x19b5cc){return function(){ChatGroupEvents[_0xbff5('0x4')](_0x6e7829,_0x19b5cc);};}exports[_0xbff5('0x5')]=function(_0xa9e6ad){for(var _0x125cf0=0x0,_0x5a829a=events[_0xbff5('0x6')];_0x125cf0<_0x5a829a;_0x125cf0++){var _0x49b335=events[_0x125cf0];var _0x61d13b=createListener(_0xbff5('0x7')+_0x49b335,_0xa9e6ad);ChatGroupEvents['on'](_0x49b335,_0x61d13b);}};
\ No newline at end of file
+var _0x06b0=['length','./chatGroup.events','remove','update','emit'];(function(_0x58c95d,_0x2f7afb){var _0x4a0212=function(_0x669632){while(--_0x669632){_0x58c95d['push'](_0x58c95d['shift']());}};_0x4a0212(++_0x2f7afb);}(_0x06b0,0x1e6));var _0x006b=function(_0x372846,_0x3cf518){_0x372846=_0x372846-0x0;var _0x631aa1=_0x06b0[_0x372846];return _0x631aa1;};'use strict';var ChatGroupEvents=require(_0x006b('0x0'));var events=['save',_0x006b('0x1'),_0x006b('0x2')];function createListener(_0xde0d4d,_0x34df51){return function(_0x2d4069){_0x34df51[_0x006b('0x3')](_0xde0d4d,_0x2d4069);};}function removeListener(_0x4c7db9,_0x58a140){return function(){ChatGroupEvents['removeListener'](_0x4c7db9,_0x58a140);};}exports['register']=function(_0x204b56){for(var _0x5f547a=0x0,_0xfe7b0a=events[_0x006b('0x4')];_0x5f547a<_0xfe7b0a;_0x5f547a++){var _0x271ccd=events[_0x5f547a];var _0x2b068b=createListener('chatGroup:'+_0x271ccd,_0x204b56);ChatGroupEvents['on'](_0x271ccd,_0x2b068b);}};
\ No newline at end of file
index dff84f6..2a025f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x262a=['delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x262a,0xeb));var _0xa262=function(_0x3ab0ac,_0x1ea9cf){_0x3ab0ac=_0x3ab0ac-0x0;var _0x1f743d=_0x262a[_0x3ab0ac];return _0x1f743d;};'use strict';var multer=require(_0xa262('0x0'));var util=require(_0xa262('0x1'));var path=require(_0xa262('0x2'));var timeout=require('connect-timeout');var express=require(_0xa262('0x3'));var router=express[_0xa262('0x4')]();var fs_extra=require(_0xa262('0x5'));var auth=require(_0xa262('0x6'));var interaction=require(_0xa262('0x7'));var config=require('../../config/environment');var controller=require(_0xa262('0x8'));router[_0xa262('0x9')]('/',auth[_0xa262('0xa')](),controller[_0xa262('0xb')]);router[_0xa262('0x9')](_0xa262('0xc'),auth[_0xa262('0xa')](),controller['describe']);router[_0xa262('0x9')](_0xa262('0xd'),auth['isAuthenticated'](),controller[_0xa262('0xe')]);router[_0xa262('0x9')](_0xa262('0xf'),auth[_0xa262('0xa')](),controller[_0xa262('0x10')]);router[_0xa262('0x9')](_0xa262('0x11'),auth[_0xa262('0xa')](),controller['getMembers']);router[_0xa262('0x9')](_0xa262('0x12'),auth[_0xa262('0xa')](),controller[_0xa262('0x13')]);router[_0xa262('0x14')]('/',auth[_0xa262('0xa')](),controller[_0xa262('0x15')]);router[_0xa262('0x14')]('/:id/members',auth[_0xa262('0xa')](),controller[_0xa262('0x16')]);router[_0xa262('0x14')](_0xa262('0x12'),auth[_0xa262('0xa')](),controller[_0xa262('0x17')]);router[_0xa262('0x18')](_0xa262('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa262('0x19')]('/:id',auth[_0xa262('0xa')](),controller['destroy']);router['delete'](_0xa262('0x11'),auth[_0xa262('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x552e=['/:id/messages','getMessages','create','addMembers','post','addMessage','put','update','destroy','delete','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id','isAuthenticated','show','/:id/unread','getUnread','/:id/members','getMembers'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x552e,0x167));var _0xe552=function(_0x751052,_0x179ffa){_0x751052=_0x751052-0x0;var _0x421d1e=_0x552e[_0x751052];return _0x421d1e;};'use strict';var multer=require(_0xe552('0x0'));var util=require(_0xe552('0x1'));var path=require(_0xe552('0x2'));var timeout=require(_0xe552('0x3'));var express=require(_0xe552('0x4'));var router=express[_0xe552('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe552('0x6'));var interaction=require(_0xe552('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xe552('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe552('0x9'),auth['isAuthenticated'](),controller[_0xe552('0xa')]);router['get'](_0xe552('0xb'),auth[_0xe552('0xc')](),controller[_0xe552('0xd')]);router[_0xe552('0x8')](_0xe552('0xe'),auth[_0xe552('0xc')](),controller[_0xe552('0xf')]);router[_0xe552('0x8')](_0xe552('0x10'),auth['isAuthenticated'](),controller[_0xe552('0x11')]);router[_0xe552('0x8')](_0xe552('0x12'),auth[_0xe552('0xc')](),controller[_0xe552('0x13')]);router['post']('/',auth[_0xe552('0xc')](),controller[_0xe552('0x14')]);router['post'](_0xe552('0x10'),auth[_0xe552('0xc')](),controller[_0xe552('0x15')]);router[_0xe552('0x16')]('/:id/messages',auth['isAuthenticated'](),controller[_0xe552('0x17')]);router[_0xe552('0x18')]('/:id',auth[_0xe552('0xc')](),controller[_0xe552('0x19')]);router['delete'](_0xe552('0xb'),auth[_0xe552('0xc')](),controller[_0xe552('0x1a')]);router[_0xe552('0x1b')]('/:id/members',auth['isAuthenticated'](),controller[_0xe552('0x1c')]);module['exports']=router;
\ No newline at end of file
index 64f29c0..e7614db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x546ce8,_0x164792){var _0x3777ac=function(_0x5c4a48){while(--_0x5c4a48){_0x546ce8['push'](_0x546ce8['shift']());}};_0x3777ac(++_0x164792);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'closed':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0baf('0x2')]},'ratingType':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x4'),_0x0baf('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x0baf('0x6')]},'pathTranscript':{'type':Sequelize[_0x0baf('0x6')]},'mailTranscript':{'type':Sequelize[_0x0baf('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0baf('0x8')]},'disposition':{'type':Sequelize[_0x0baf('0x7')]},'secondDisposition':{'type':Sequelize[_0x0baf('0x7')]},'thirdDisposition':{'type':Sequelize[_0x0baf('0x7')]},'note':{'type':Sequelize[_0x0baf('0x7')]},'browserName':{'type':Sequelize[_0x0baf('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0baf('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x0baf('0x7')]},'deviceVendor':{'type':Sequelize[_0x0baf('0x7')]},'deviceType':{'type':Sequelize[_0x0baf('0x7')]},'referer':{'type':Sequelize[_0x0baf('0x6')]},'customerIp':{'type':Sequelize[_0x0baf('0x7')]},'formData':{'type':Sequelize[_0x0baf('0x6')](_0x0baf('0x9'))},'read1stAt':{'type':Sequelize[_0x0baf('0x8')]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x3')]('in',_0x0baf('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x0baf('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb78e=['BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xb78e,0x1c9));var _0xeb78=function(_0x3669a5,_0x4ebe68){_0x3669a5=_0x3669a5-0x0;var _0x3567af=_0xb78e[_0x3669a5];return _0x3567af;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb78('0x2')]},'ratingType':{'type':Sequelize[_0xeb78('0x3')](_0xeb78('0x4'),_0xeb78('0x5')),'defaultValue':_0xeb78('0x4')},'ratingMessage':{'type':Sequelize[_0xeb78('0x6')]},'pathTranscript':{'type':Sequelize[_0xeb78('0x6')]},'mailTranscript':{'type':Sequelize[_0xeb78('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeb78('0x7')]},'secondDisposition':{'type':Sequelize[_0xeb78('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeb78('0x7')]},'note':{'type':Sequelize[_0xeb78('0x7')]},'browserName':{'type':Sequelize[_0xeb78('0x7')]},'browserVersion':{'type':Sequelize[_0xeb78('0x7')]},'osName':{'type':Sequelize[_0xeb78('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xeb78('0x7')]},'deviceVendor':{'type':Sequelize[_0xeb78('0x7')]},'deviceType':{'type':Sequelize[_0xeb78('0x7')]},'referer':{'type':Sequelize[_0xeb78('0x6')]},'customerIp':{'type':Sequelize[_0xeb78('0x7')]},'formData':{'type':Sequelize[_0xeb78('0x6')](_0xeb78('0x8'))},'read1stAt':{'type':Sequelize[_0xeb78('0x9')]},'lastMsgAt':{'type':Sequelize[_0xeb78('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xeb78('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb78('0x7')]},'customerPort':{'type':Sequelize[_0xeb78('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xeb78('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeb78('0xb')],'defaultValue':![]}};
\ No newline at end of file
index 1353624..e81ce1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc7=['GROUP_CONCAT(DISTINCT\x20t.id)','toString','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','destroy','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','attachmentDownload','findOne','Unauthorized','Attachment','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','ChatMessage','Messages','agentAlias','customer','Visitor','website_alias','%s%d','System','agent_alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','rawAttributes','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','alias','addTags','spread','chatInteractionTags:save','removeTags','unix','root','server','files','tmp','attachments','lastName','createdAt','direction','Account','mkdirSync','Owner','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','basename','createReadStream','createWriteStream','out','firstName','renderFile','views','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','client','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','render','merge','body','contact','interaction','account','map','fullname','TagIds','split','forEach','Tags','push','unmanaged','closed','UserId','waiting','disposition','abandoned','answered','talking','total','index','fieldName','type','key','keys','query','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','find','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','ChatInteraction','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.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal'];(function(_0xe218e3,_0x587348){var _0x4b2c70=function(_0x31a348){while(--_0x31a348){_0xe218e3['push'](_0xe218e3['shift']());}};_0x4b2c70(++_0x587348);}(_0x5fc7,0x7c));var _0x75fc=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x5fc7[_0x53fe97];return _0x5c49a2;};'use strict';var emlformat=require(_0x75fc('0x0'));var rimraf=require(_0x75fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x75fc('0x2'));var Mustache=require('mustache');var util=require(_0x75fc('0x3'));var path=require(_0x75fc('0x4'));var sox=require(_0x75fc('0x5'));var csv=require(_0x75fc('0x6'));var ejs=require(_0x75fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75fc('0x8'));var squel=require(_0x75fc('0x9'));var crypto=require('crypto');var jsforce=require(_0x75fc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x75fc('0x6'));var querystring=require(_0x75fc('0xb'));var Papa=require(_0x75fc('0xc'));var Redis=require(_0x75fc('0xd'));var authService=require(_0x75fc('0xe'));var qs=require(_0x75fc('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x75fc('0x10'));var hardwareService=require(_0x75fc('0x11'));var logger=require(_0x75fc('0x12'))(_0x75fc('0x13'));var utils=require(_0x75fc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x75fc('0x15'));var db=require(_0x75fc('0x16'))['db'];config['redis']=_[_0x75fc('0x17')](config[_0x75fc('0x18')],{'host':_0x75fc('0x19'),'port':0x18eb});var socket=require(_0x75fc('0x1a'))(new Redis(config[_0x75fc('0x18')]));require(_0x75fc('0x1b'))[_0x75fc('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x75fc('0x1d')]({'port':0x232b});var client9004=jayson[_0x75fc('0x1e')][_0x75fc('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x19d036,_0x12b86f,_0x476724,_0x346de9){return new BPromise(function(_0x351044,_0x2e27cc){var _0x429361=_0x346de9||client;return _0x429361['request'](_0x19d036,_0x476724)['then'](function(_0x1df757){logger[_0x75fc('0x1f')](_0x75fc('0x20'),_0x12b86f,_0x75fc('0x21'));logger[_0x75fc('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x12b86f,_0x75fc('0x21'),JSON[_0x75fc('0x23')](_0x1df757));if(_0x1df757[_0x75fc('0x24')]){if(_0x1df757[_0x75fc('0x24')][_0x75fc('0x25')]===0x1f4){logger[_0x75fc('0x24')](_0x75fc('0x20'),_0x12b86f,_0x1df757['error'][_0x75fc('0x26')]);return _0x2e27cc(_0x1df757['error'][_0x75fc('0x26')]);}logger[_0x75fc('0x24')](_0x75fc('0x20'),_0x12b86f,_0x1df757[_0x75fc('0x24')][_0x75fc('0x26')]);return _0x351044(_0x1df757[_0x75fc('0x24')][_0x75fc('0x26')]);}else{logger[_0x75fc('0x1f')](_0x75fc('0x20'),_0x12b86f,_0x75fc('0x21'));_0x351044(_0x1df757['result'][_0x75fc('0x26')]);}})[_0x75fc('0x27')](function(_0x3750fd){logger[_0x75fc('0x24')](_0x75fc('0x20'),_0x12b86f,_0x3750fd);_0x2e27cc(_0x3750fd);});});}function respondWithStatusCode(_0x23d0b8,_0x1a0f9c){_0x1a0f9c=_0x1a0f9c||0xcc;return function(_0x466a22){if(_0x466a22){return _0x23d0b8[_0x75fc('0x28')](_0x1a0f9c);}return _0x23d0b8[_0x75fc('0x29')](_0x1a0f9c)[_0x75fc('0x2a')]();};}function respondWithResult(_0xe2a226,_0x29fdd9){_0x29fdd9=_0x29fdd9||0xc8;return function(_0x4d53cd){if(_0x4d53cd){return _0xe2a226['status'](_0x29fdd9)[_0x75fc('0x2b')](_0x4d53cd);}};}function respondWithFilteredResult(_0x348923,_0x20fe19){return function(_0x563d0d){if(_0x563d0d){var _0x15d8ba=typeof _0x20fe19[_0x75fc('0x2c')]==='undefined'&&typeof _0x20fe19[_0x75fc('0x2d')]==='undefined';var _0x5993e3=_0x563d0d[_0x75fc('0x2e')];var _0x41b1fb=_0x15d8ba?0x0:_0x20fe19[_0x75fc('0x2c')];var _0x131dc9=_0x15d8ba?_0x563d0d['count']:_0x20fe19[_0x75fc('0x2c')]+_0x20fe19[_0x75fc('0x2d')];var _0x3aa31d;if(_0x131dc9>=_0x5993e3){_0x131dc9=_0x5993e3;_0x3aa31d=0xc8;}else{_0x3aa31d=0xce;}_0x348923[_0x75fc('0x29')](_0x3aa31d);return _0x348923[_0x75fc('0x2f')](_0x75fc('0x30'),_0x41b1fb+'-'+_0x131dc9+'/'+_0x5993e3)[_0x75fc('0x2b')](_0x563d0d);}return null;};}function patchUpdates(_0x546adc){return function(_0x58aa67){try{jsonpatch[_0x75fc('0x31')](_0x58aa67,_0x546adc,!![]);}catch(_0x1871ec){return BPromise[_0x75fc('0x32')](_0x1871ec);}return _0x58aa67[_0x75fc('0x33')]();};}function saveUpdates(_0x52b023,_0x3583f8){return function(_0x1f5850){if(_0x1f5850){return _0x1f5850[_0x75fc('0x34')](_0x52b023)['then'](function(_0x195013){return _0x195013;});}return null;};}function removeEntity(_0x4e9a65,_0x206549){return function(_0x5cd793){if(_0x5cd793){return _0x5cd793['destroy']()[_0x75fc('0x35')](function(){_0x4e9a65['status'](0xcc)[_0x75fc('0x2a')]();});}};}function handleEntityNotFound(_0x39adc7,_0x9889d1){return function(_0x4fc363){if(!_0x4fc363){_0x39adc7['sendStatus'](0x194);}return _0x4fc363;};}function handleError(_0x50ca20,_0x256038){_0x256038=_0x256038||0x1f4;return function(_0xfd36c5){logger[_0x75fc('0x24')](_0xfd36c5[_0x75fc('0x36')]);if(_0xfd36c5[_0x75fc('0x37')]){delete _0xfd36c5['name'];}_0x50ca20['status'](_0x256038)[_0x75fc('0x38')](_0xfd36c5);};}function getMustacheRender(_0x2ec508,_0x4b79d6){return Mustache[_0x75fc('0x39')](_0x2ec508,_[_0x75fc('0x3a')](_0x4b79d6[_0x75fc('0x3b')],{'contact':_0x4b79d6[_0x75fc('0x3c')],'message':_0x4b79d6[_0x75fc('0x26')],'agent':_0x4b79d6['agent'],'interaction':_0x4b79d6[_0x75fc('0x3d')],'account':_0x4b79d6[_0x75fc('0x3e')]}))||'';}function getInteractionUsers(_0x3a5e6c,_0x440f22){return new BPromise(function(_0x47edb3,_0x7507d9){try{if(_0x440f22[_0x3a5e6c['id']]){_0x3a5e6c['Users']=_[_0x75fc('0x3f')](_0x440f22[_0x3a5e6c['id']],function(_0x268a8b){return{'id':_0x268a8b['id'],'fullname':_0x268a8b[_0x75fc('0x40')]};});}}catch(_0x16abb7){_0x7507d9(_0x16abb7);}_0x47edb3(_0x3a5e6c);});}function getInteractionTags(_0x4c3ffe,_0xc869b9){return new BPromise(function(_0x5ad438,_0x13d902){try{if(_0x4c3ffe['TagIds']){_0x4c3ffe['Tags']=[];_0x4c3ffe[_0x75fc('0x41')][_0x75fc('0x42')](',')[_0x75fc('0x43')](function(_0x15f03b){_0x4c3ffe[_0x75fc('0x44')][_0x75fc('0x45')](_0xc869b9[_0x15f03b]);});}delete _0x4c3ffe[_0x75fc('0x41')];}catch(_0x15385e){_0x13d902(_0x15385e);}_0x5ad438(_0x4c3ffe);});}function updateChatInteraction(_0x40ba10,_0x59f2df,_0x331ae8){return new BPromise(function(_0x1f95d4,_0xaf5873){return getInteractionUsers(_0x40ba10,_0x331ae8)['then'](function(_0x203175){return getInteractionTags(_0x203175,_0x59f2df);})[_0x75fc('0x35')](function(_0x5bacac){return getStateInteraction(_0x5bacac);})['then'](function(_0x1fdeb4){_0x1f95d4(_0x1fdeb4);})[_0x75fc('0x27')](function(_0x4612ec){_0xaf5873(_0x4612ec);});});}function getStateInteraction(_0x238c97){return new BPromise(function(_0x15fb29){_0x238c97['waiting']=0x0;_0x238c97['talking']=0x0;_0x238c97['answered']=0x0;_0x238c97[_0x75fc('0x46')]=0x0;_0x238c97['abandoned']=0x0;_0x238c97['total']=0x0;if(!_0x238c97[_0x75fc('0x47')]&&!_0x238c97[_0x75fc('0x48')]){_0x238c97[_0x75fc('0x49')]+=0x1;}if(!_0x238c97[_0x75fc('0x47')]&&_0x238c97[_0x75fc('0x48')]){_0x238c97['talking']+=0x1;if(_0x238c97[_0x75fc('0x49')]){_0x238c97[_0x75fc('0x49')]-=0x1;}}if(_0x238c97[_0x75fc('0x47')]&&_0x238c97[_0x75fc('0x4a')]===_0x75fc('0x4b')){_0x238c97[_0x75fc('0x4b')]+=0x1;if(_0x238c97['waiting']){_0x238c97[_0x75fc('0x49')]-=0x1;}}else if(_0x238c97['closed']&&!_0x238c97['UserId']&&_0x238c97[_0x75fc('0x4a')]){_0x238c97[_0x75fc('0x46')]+=0x1;if(_0x238c97[_0x75fc('0x49')]){_0x238c97[_0x75fc('0x49')]-=0x1;}}else if(_0x238c97[_0x75fc('0x47')]&&_0x238c97['UserId']){_0x238c97[_0x75fc('0x4c')]+=0x1;if(_0x238c97['talking']){_0x238c97[_0x75fc('0x4d')]-=0x1;}}_0x238c97[_0x75fc('0x4e')]+=0x1;_0x15fb29(_0x238c97);});}exports[_0x75fc('0x4f')]=function(_0x321649,_0x3ac56f){var _0x3126f9={},_0xb290a4={},_0x505ace={'count':0x0,'rows':[]};var _0xcdf5df=_[_0x75fc('0x3f')](db['ChatInteraction']['rawAttributes'],function(_0x196cb2){return{'name':_0x196cb2[_0x75fc('0x50')],'type':_0x196cb2[_0x75fc('0x51')][_0x75fc('0x52')]};});_0xb290a4['model']=_[_0x75fc('0x3f')](_0xcdf5df,_0x75fc('0x37'));_0xb290a4['query']=_[_0x75fc('0x53')](_0x321649[_0x75fc('0x54')]);_0xb290a4['filters']=_[_0x75fc('0x55')](_0xb290a4['model'],_0xb290a4[_0x75fc('0x54')]);_0x3126f9['attributes']=_['intersection'](_0xb290a4['model'],qs[_0x75fc('0x56')](_0x321649['query']['fields']));_0x3126f9[_0x75fc('0x57')]=_0x3126f9[_0x75fc('0x57')][_0x75fc('0x58')]?_0x3126f9['attributes']:_0xb290a4[_0x75fc('0x59')];if(!_0x321649[_0x75fc('0x54')][_0x75fc('0x5a')](_0x75fc('0x5b'))){_0x3126f9[_0x75fc('0x2d')]=qs[_0x75fc('0x2d')](_0x321649[_0x75fc('0x54')][_0x75fc('0x2d')]);_0x3126f9[_0x75fc('0x2c')]=qs['offset'](_0x321649[_0x75fc('0x54')]['offset']);}_0x3126f9[_0x75fc('0x5c')]=qs[_0x75fc('0x5d')](_0x321649[_0x75fc('0x54')][_0x75fc('0x5d')]);_0x3126f9[_0x75fc('0x5e')]=qs[_0x75fc('0x5f')](_[_0x75fc('0x60')](_0x321649[_0x75fc('0x54')],_0xb290a4[_0x75fc('0x5f')]),_0xcdf5df);var _0x423821=[];var _0x579b78=squel[_0x75fc('0x61')]()['field']('id')[_0x75fc('0x62')](_0x75fc('0x37'))[_0x75fc('0x62')](_0x75fc('0x63'))[_0x75fc('0x64')](_0x75fc('0x65'));var _0x4057d3=squel[_0x75fc('0x61')]()[_0x75fc('0x62')](_0x75fc('0x66'))[_0x75fc('0x62')](_0x75fc('0x67'))[_0x75fc('0x62')](_0x75fc('0x68'))[_0x75fc('0x64')](_0x75fc('0x69'),'ui')[_0x75fc('0x6a')](_0x75fc('0x6b'),'u',_0x75fc('0x6c'));var _0x30540d=squel['select']()[_0x75fc('0x64')](_0x75fc('0x6d'),'i')['left_join'](_0x75fc('0x6e'),'c',_0x75fc('0x6f'))[_0x75fc('0x6a')](_0x75fc('0x6b'),'o',_0x75fc('0x70'))[_0x75fc('0x6a')](_0x75fc('0x71'),'a',_0x75fc('0x72'))['left_join'](_0x75fc('0x73'),'me',_0x75fc('0x74'))[_0x75fc('0x6a')]('chat_interaction_has_tags','it',_0x75fc('0x75'))[_0x75fc('0x6a')](_0x75fc('0x65'),'t','t.id\x20=\x20it.TagId');var _0x348a60=squel[_0x75fc('0x76')]();var _0x1d06ea=[];var _0x3a0208=squel[_0x75fc('0x76')]();var _0x3ba1cc;if(_0x321649[_0x75fc('0x54')][_0x75fc('0x77')]){_0x3ba1cc=as[_0x75fc('0x78')](_0x321649['query'][_0x75fc('0x77')]);var _0x2baa0a=_0x3ba1cc[_0x75fc('0x79')];for(var _0x347488=0x0;_0x347488<_0x3ba1cc['conditions'][_0x75fc('0x58')];_0x347488++){var _0xcf59ac=_0x3ba1cc['conditions'][_0x347488];var _0x39add3='i';var _0x527348=_['find'](_0xcdf5df,[_0x75fc('0x37'),_0xcf59ac[_0x75fc('0x62')]]);if(!_0x527348){switch(_0xcf59ac['field']){case _0x75fc('0x7a'):if(_0xcf59ac[_0x75fc('0x7b')]==0x1){_0x30540d[_0x75fc('0x7c')]('`'+_0xcf59ac['field']+_0x75fc('0x7d'));}else{_0x30540d[_0x75fc('0x7c')]('`'+_0xcf59ac[_0x75fc('0x62')]+_0x75fc('0x7e'));}break;case _0x75fc('0x7f'):if(_0xcf59ac[_0x75fc('0x80')]===_0x75fc('0x81')){if(_0xcf59ac[_0x75fc('0x7b')]['split']('\x20')[_0x75fc('0x58')]>0x1){_0x348a60[_0x2baa0a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x75fc('0x82')](_0xcf59ac['value']),null);}else{var _0x4c38b7='%'+_0xcf59ac['value']+'%';_0x348a60[_0x2baa0a](_0x75fc('0x83'),_0x4c38b7,_0x4c38b7,_0x4c38b7);}}else{_0x527348=_['find'](_0xcdf5df,[_0x75fc('0x37'),_0x75fc('0x84')]);_0xcf59ac[_0x75fc('0x62')]=_0x75fc('0x84');_0x48f03f=as[_0x75fc('0x85')](_0x39add3,_0x527348[_0x75fc('0x51')],_0xcf59ac);_0x348a60[_0x2baa0a](_0x48f03f[_0x75fc('0x86')],_0x48f03f[_0x75fc('0x7b')][_0x75fc('0x87')],_0x48f03f[_0x75fc('0x7b')][_0x75fc('0x2a')]);}break;case _0x75fc('0x88'):var _0x4a986d=_0xcf59ac[_0x75fc('0x7b')][_0x75fc('0x42')](',')[_0x75fc('0x3f')](function(_0x5dae70){return Number(_0x5dae70);});_0x4a986d[_0x75fc('0x43')](function(_0x52bccf){_0x3a0208['or'](_0x75fc('0x89'),'%,'+_0x52bccf+',%');});_0x1d06ea=_[_0x75fc('0x8a')](_0x1d06ea,_0x4a986d);break;case _0x75fc('0x8b'):if(_0xcf59ac[_0x75fc('0x80')]==='$substring'){_0x348a60[_0x2baa0a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xcf59ac[_0x75fc('0x7b')]+'%',null);}else{_0x527348=_[_0x75fc('0x8c')](_0xcdf5df,[_0x75fc('0x37'),_0x75fc('0x48')]);_0xcf59ac[_0x75fc('0x62')]=_0x75fc('0x48');_0x48f03f=as['buildExpression'](_0x39add3,_0x527348['type'],_0xcf59ac);_0x348a60[_0x2baa0a](_0x48f03f[_0x75fc('0x86')],_0x48f03f['value']['start'],_0x48f03f[_0x75fc('0x7b')][_0x75fc('0x2a')]);}break;case _0x75fc('0x3b'):_0x48f03f=as[_0x75fc('0x85')]('me',null,_0xcf59ac);_0x348a60[_0x2baa0a](_0x48f03f[_0x75fc('0x86')],_0x48f03f[_0x75fc('0x7b')][_0x75fc('0x87')],_0x48f03f[_0x75fc('0x7b')]['end']);break;}}else{var _0x48f03f=as['buildExpression'](_0x39add3,_0x527348[_0x75fc('0x51')],_0xcf59ac);_0x348a60[_0x2baa0a](_0x48f03f[_0x75fc('0x86')],_0x48f03f[_0x75fc('0x7b')][_0x75fc('0x87')],_0x48f03f[_0x75fc('0x7b')][_0x75fc('0x2a')]);}}}else{var _0x219614=_(_0x321649[_0x75fc('0x54')])[_0x75fc('0x53')]()['map'](function(_0x56d0c9){return _[_0x75fc('0x8d')](_0xcdf5df,[_0x75fc('0x37'),_0x56d0c9])?_0x56d0c9:undefined;})[_0x75fc('0x8e')]()[_0x75fc('0x7b')]();if(!_[_0x75fc('0x8f')](_0x219614)){_0x219614[_0x75fc('0x43')](function(_0xad616){if(_0xad616===_0x75fc('0x90')){_0x30540d[_0x75fc('0x5e')](_0x75fc('0x91'),[][_0x75fc('0x92')](_0x321649[_0x75fc('0x54')][_0xad616]));}else if(_0xad616==='createdAt'){var _0x4f5541=JSON[_0x75fc('0x93')](_0x321649[_0x75fc('0x54')][_0xad616])[_0x75fc('0x94')];var _0x239f2b=JSON[_0x75fc('0x93')](_0x321649[_0x75fc('0x54')][_0xad616])['$lte'];_0x30540d[_0x75fc('0x5e')](_0x75fc('0x95'),_0x4f5541,_0x239f2b);}else{if(_0x321649[_0x75fc('0x54')][_0xad616]===_0x75fc('0x96')){_0x30540d[_0x75fc('0x5e')]('i.'+_0xad616+_0x75fc('0x97'));}else{_0x30540d[_0x75fc('0x5e')]('i.'+_0xad616+'\x20=\x20?',_0x321649[_0x75fc('0x54')][_0xad616]);}}});}if(_0x321649[_0x75fc('0x54')][_0x75fc('0x98')]){if(_0x321649['query']['read']==0x1){_0x30540d['having']('`unreadMessages`\x20=\x200');}else{_0x30540d['having'](_0x75fc('0x99'));}}if(_0x321649['query'][_0x75fc('0x9a')]){_0x1d06ea=_[_0x75fc('0x9b')](_0x321649[_0x75fc('0x54')]['tag'])?_0x321649[_0x75fc('0x54')]['tag']:new Array(_0x321649['query'][_0x75fc('0x9a')]);_0x1d06ea[_0x75fc('0x43')](function(_0x34ccb9){_0x3a0208['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x34ccb9+',%');});}if(_0x321649[_0x75fc('0x54')][_0x75fc('0x9c')]){var _0x1a3cf1=_0x321649['query']['filter'][_0x75fc('0x9d')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x75fc('0x9e')](_0x1a3cf1)){_0x348a60['or']('i.id\x20LIKE\x20?',_0x1a3cf1+'%');}else{_0x348a60['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x75fc('0x82')](_0x1a3cf1))['or'](_0x75fc('0x9f'),_0x1a3cf1+'%');}}}_0x30540d[_0x75fc('0x5e')](_0x348a60);_0x30540d[_0x75fc('0xa0')](_0x75fc('0xa1'));var _0xfb6f0={'type':db[_0x75fc('0xa2')][_0x75fc('0xa3')]['SELECT'],'raw':!![]};var _0x32133f=_0x30540d[_0x75fc('0xa4')]();_0x32133f[_0x75fc('0x62')]('i.id');_0x32133f[_0x75fc('0x62')](_0x75fc('0xa5'),_0x75fc('0x7a'));if(_0x3126f9['order']){_0x3126f9[_0x75fc('0x5c')]['forEach'](function(_0x1622e2){var _0x3fbd71=_0x1622e2[0x0]===_0x75fc('0xa6')?_0x1622e2[0x0]:'i.'+_0x1622e2[0x0];_0x30540d[_0x75fc('0x5c')](_0x3fbd71,_0x1622e2[0x1]===_0x75fc('0xa7')?![]:!![]);});}if(!_[_0x75fc('0x8f')](_0x1d06ea)){_0x30540d[_0x75fc('0x7c')](_0x3a0208);_0x32133f[_0x75fc('0x5e')](_0x75fc('0xa8'),_0x1d06ea);}BPromise['resolve']()[_0x75fc('0x35')](function(){if(!_0x3ba1cc){if(_0x321649[_0x75fc('0x54')][_0x75fc('0x90')])return;_0x32133f[_0x75fc('0x5e')](_0x75fc('0xa9'));_0x30540d[_0x75fc('0x5e')](_0x75fc('0xa9'));return;}if(_0x321649[_0x75fc('0xaa')][_0x75fc('0xab')]!==_0x75fc('0xac'))return;return _0x321649[_0x75fc('0xaa')][_0x75fc('0xad')]({'attributes':['id'],'raw':!![]})['then'](function(_0x41634e){if(_[_0x75fc('0x8f')](_0x41634e)){_0x32133f['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x30540d[_0x75fc('0x5e')](_0x75fc('0xae'));}else{_0x32133f[_0x75fc('0x5e')](_0x75fc('0x91'),_['map'](_0x41634e,'id'));_0x30540d[_0x75fc('0x5e')](_0x75fc('0x91'),_[_0x75fc('0x3f')](_0x41634e,'id'));}});})[_0x75fc('0x35')](function(){if(_0x321649[_0x75fc('0xaa')][_0x75fc('0xab')]===_0x75fc('0xac')&&!_0x3ba1cc&&!_0x321649[_0x75fc('0x54')][_0x75fc('0x90')])return[];return db[_0x75fc('0xaf')][_0x75fc('0x54')](_0x32133f['toString'](),_0xfb6f0);})[_0x75fc('0x35')](function(_0x1f9c69){_0x505ace[_0x75fc('0x2e')]=_0x1f9c69[_0x75fc('0x58')];if(_0x505ace[_0x75fc('0x2e')]===0x0)return[];return db[_0x75fc('0xaf')]['query'](_0x579b78['toString'](),_0xfb6f0)['then'](function(_0x18982f){_0x423821=_['keyBy'](_0x18982f,'id');_0xfb6f0=_[_0x75fc('0x3a')](_0xfb6f0,{'model':db[_0x75fc('0xb0')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x321649[_0x75fc('0x54')][_0x75fc('0x56')]){_0x3126f9['attributes'][_0x75fc('0x43')](function(_0x1b3398){_0x30540d['field']('i.'+_0x1b3398);});}else{_0x30540d[_0x75fc('0x62')](_0x75fc('0xa5'),'unreadMessages');_0x30540d[_0x75fc('0x62')]('a.key','Account.key');_0x30540d[_0x75fc('0x62')](_0x75fc('0xb1'),_0x75fc('0xb2'));_0x30540d[_0x75fc('0x62')](_0x75fc('0xb3'),_0x75fc('0xa6'));_0x30540d['field'](_0x75fc('0xb4'));_0x30540d['field'](_0x75fc('0xb5'),_0x75fc('0xb6'));_0x30540d['field'](_0x75fc('0xb7'),'Contact.lastName');_0x30540d[_0x75fc('0x62')](_0x75fc('0xb8'),_0x75fc('0xb9'));_0x30540d[_0x75fc('0x62')](_0x75fc('0xba'),_0x75fc('0xbb'));_0x30540d[_0x75fc('0x62')](_0x75fc('0xbc'),_0x75fc('0xbd'));_0x30540d[_0x75fc('0x62')](_0x75fc('0xbe'),_0x75fc('0xbf'));_0x30540d[_0x75fc('0x62')](_0x75fc('0xc0'),_0x75fc('0xc1'));_0x30540d['field'](_0x75fc('0xc2'),'Owner.internal');_0x30540d[_0x75fc('0x62')](_0x75fc('0xc3'),_0x75fc('0x41'));}if(_0x3126f9[_0x75fc('0x2d')])_0x30540d[_0x75fc('0x2d')](_0x3126f9[_0x75fc('0x2d')]);if(_0x3126f9[_0x75fc('0x2c')])_0x30540d[_0x75fc('0x2c')](_0x3126f9[_0x75fc('0x2c')]);return db[_0x75fc('0xaf')][_0x75fc('0x54')](_0x30540d[_0x75fc('0xc4')](),_0xfb6f0);})['then'](function(_0x50e1e7){if(_0x50e1e7[_0x75fc('0x58')]>0x0)_0x4057d3[_0x75fc('0x5e')]('ui.ChatInteractionId\x20IN\x20?',_[_0x75fc('0x3f')](_0x50e1e7,'id'));return db[_0x75fc('0xaf')][_0x75fc('0x54')](_0x4057d3['toString'](),_0xfb6f0)[_0x75fc('0x35')](function(_0x3dc3a1){var _0x574d8e=_['groupBy'](_0x3dc3a1,_0x75fc('0xc5'));var _0x244892=[];_0x50e1e7[_0x75fc('0x43')](function(_0x13393e){_0x244892['push'](updateChatInteraction(_0x13393e,_0x423821,_0x574d8e));});return BPromise[_0x75fc('0xc6')](_0x244892);});});})[_0x75fc('0x35')](function(_0x557fd6){_0x505ace[_0x75fc('0xc7')]=_0x557fd6;return _0x505ace;})[_0x75fc('0x35')](respondWithFilteredResult(_0x3ac56f,_0x3126f9))['catch'](handleError(_0x3ac56f,null));};exports[_0x75fc('0xc8')]=function(_0x187188,_0x2250ee){var _0x4d44b0={'raw':![],'where':{'id':_0x187188[_0x75fc('0xc9')]['id']}},_0x3a06b2={};_0x3a06b2['model']=_[_0x75fc('0x53')](db[_0x75fc('0xb0')]['rawAttributes']);_0x3a06b2[_0x75fc('0x54')]=_[_0x75fc('0x53')](_0x187188['query']);_0x3a06b2[_0x75fc('0x5f')]=_[_0x75fc('0x55')](_0x3a06b2[_0x75fc('0x59')],_0x3a06b2[_0x75fc('0x54')]);_0x4d44b0[_0x75fc('0x57')]=_[_0x75fc('0x55')](_0x3a06b2[_0x75fc('0x59')],qs[_0x75fc('0x56')](_0x187188[_0x75fc('0x54')][_0x75fc('0x56')]));_0x4d44b0[_0x75fc('0x57')]=_0x4d44b0[_0x75fc('0x57')][_0x75fc('0x58')]?_0x4d44b0['attributes']:_0x3a06b2[_0x75fc('0x59')];if(_0x187188['query'][_0x75fc('0xca')]){_0x4d44b0[_0x75fc('0xcb')]=[{'all':!![]}];}_0x4d44b0=_[_0x75fc('0x3a')]({},_0x4d44b0,_0x187188[_0x75fc('0xcc')]);return db[_0x75fc('0xb0')]['find'](_0x4d44b0)[_0x75fc('0x35')](handleEntityNotFound(_0x2250ee,null))[_0x75fc('0x35')](respondWithResult(_0x2250ee,null))['catch'](handleError(_0x2250ee,null));};exports[_0x75fc('0xcd')]=function(_0x3bb7c2,_0x2ef4eb){return db[_0x75fc('0xb0')][_0x75fc('0xcd')](_0x3bb7c2[_0x75fc('0x3b')],{})[_0x75fc('0x35')](respondWithResult(_0x2ef4eb,0xc9))[_0x75fc('0x27')](handleError(_0x2ef4eb,null));};exports[_0x75fc('0x34')]=function(_0xe5b8a1,_0xf59f80){if(_0xe5b8a1[_0x75fc('0x3b')]['id']){delete _0xe5b8a1['body']['id'];}return db[_0x75fc('0xb0')]['find']({'where':{'id':_0xe5b8a1[_0x75fc('0xc9')]['id']}})['then'](handleEntityNotFound(_0xf59f80,null))['then'](saveUpdates(_0xe5b8a1[_0x75fc('0x3b')],null))[_0x75fc('0x35')](respondWithResult(_0xf59f80,null))['catch'](handleError(_0xf59f80,null));};exports[_0x75fc('0xce')]=function(_0x581e59,_0x56f44f){return db[_0x75fc('0xb0')][_0x75fc('0x8c')]({'where':{'id':_0x581e59['params']['id']}})[_0x75fc('0x35')](handleEntityNotFound(_0x56f44f,null))['then'](removeEntity(_0x56f44f,null))[_0x75fc('0x27')](handleError(_0x56f44f,null));};exports[_0x75fc('0xcf')]=function(_0x8483c1,_0x5c70be){return db[_0x75fc('0xb0')][_0x75fc('0xcf')]()[_0x75fc('0x35')](respondWithResult(_0x5c70be,null))['catch'](handleError(_0x5c70be,null));};exports[_0x75fc('0xd0')]=function(_0x2aaf46,_0x283361){var _0x235be6=_0x2aaf46[_0x75fc('0xc9')]['id'];var _0x2be552;var _0x4e1d89;var _0x48758a;return db['ChatInteraction']['findOne']({'where':{'id':_0x235be6}})[_0x75fc('0x35')](function(_0x12c1d3){_0x2be552=_0x12c1d3;return db[_0x75fc('0xd1')]['findOne']({'where':{'id':_0x12c1d3['ChatWebsiteId']},'attributes':['id',_0x75fc('0xd2'),_0x75fc('0xd3'),_0x75fc('0xd4'),'vidaooNote',_0x75fc('0xd5')],'raw':!![]});})['then'](function(_0x264547){if(_0x264547&&_0x264547['vidaooApiKey']&&_0x264547['vidaooEscalation']){_0x4e1d89=_0x264547;var _0x2b32df={'interaction':{'id':_0x235be6},'agent':{'id':_0x2aaf46[_0x75fc('0xaa')]['id'],'name':_0x2aaf46[_0x75fc('0xaa')]['name'],'fullname':_0x2aaf46[_0x75fc('0xaa')][_0x75fc('0x40')],'email':_0x2aaf46[_0x75fc('0xaa')][_0x75fc('0xd6')]},'contact':_0x2aaf46[_0x75fc('0x3b')][_0x75fc('0x3c')],'account':_0x2aaf46[_0x75fc('0x3b')][_0x75fc('0x3e')]};var _0x30fb52={'rejectUnauthorized':![],'method':_0x75fc('0xd7'),'url':_0x75fc('0xd8'),'headers':{'X-APIKEY':_0x264547[_0x75fc('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2aaf46[_0x75fc('0xaa')][_0x75fc('0xd6')]],'buttons':null,'topic':_0x4e1d89[_0x75fc('0xd4')],'note':_[_0x75fc('0xd9')](_0x4e1d89[_0x75fc('0xda')])?null:getMustacheRender(_0x4e1d89['vidaooNote'],_0x2b32df),'metadata':null},'redirect':_0x75fc('0xdb'),'json':!![]};try{if(!_['isNull'](_0x4e1d89[_0x75fc('0xd5')])){var _0x3cb22b=getMustacheRender(_0x4e1d89[_0x75fc('0xd5')],_0x2b32df);var _0xacaa61=JSON[_0x75fc('0x93')](_0x3cb22b);_0x30fb52[_0x75fc('0x3b')][_0x75fc('0xdc')]=_0xacaa61;}}catch(_0x42f71c){throw new db[(_0x75fc('0xa2'))][(_0x75fc('0xdd'))](_0x75fc('0xde'));}return rp(_0x30fb52);}else{throw new db[(_0x75fc('0xa2'))]['ValidationError'](_0x75fc('0xdf'));}})[_0x75fc('0x35')](function(_0x5dc387){_0x48758a=_0x5dc387;if(_0x48758a['id']){var _0xbcebae={'body':_0x48758a[_0x75fc('0xe0')],'ChatWebsiteId':_0x4e1d89['id'],'ChatInteractionId':_0x2be552['id'],'direction':'out','UserId':_0x2aaf46[_0x75fc('0xaa')]['id']};return db['ChatMessage'][_0x75fc('0xcd')](_0xbcebae,{});}else{throw new db[(_0x75fc('0xa2'))][(_0x75fc('0xdd'))](_0x75fc('0xe1'));}})[_0x75fc('0x35')](function(){return _0x2be552['updateAttributes']({'vidaooSessionId':_0x48758a['id']});})[_0x75fc('0x35')](respondWithResult(_0x283361,null))[_0x75fc('0x27')](handleError(_0x283361,null));};exports[_0x75fc('0xe2')]=function(_0x53120c,_0x4366d9){if(_0x53120c[_0x75fc('0x3b')]['id']){delete _0x53120c[_0x75fc('0x3b')]['id'];}return db[_0x75fc('0xb0')][_0x75fc('0x8c')]({'where':{'id':_0x53120c[_0x75fc('0xc9')]['id']},'include':[{'model':db[_0x75fc('0xe3')],'as':_0x75fc('0x7f')}]})[_0x75fc('0x35')](handleEntityNotFound(_0x4366d9,null))['then'](saveUpdates(_0x53120c[_0x75fc('0x3b')],null))['then'](respondWithResult(_0x4366d9,null))[_0x75fc('0x27')](handleError(_0x4366d9,null));};exports[_0x75fc('0xe4')]=function(_0x2bdb5a,_0x5ee41e,_0x1755d9){if(_0x2bdb5a['body']['id']){delete _0x2bdb5a[_0x75fc('0x3b')]['id'];}return db[_0x75fc('0xb0')]['find']({'where':{'id':_0x2bdb5a[_0x75fc('0xc9')]['id']}})[_0x75fc('0x35')](function(_0x4870b5){if(!_0x4870b5){logger['error'](_0x75fc('0xe5'),_0x75fc('0xe4'),0x194,_0x75fc('0xe6'));_0x5ee41e[_0x75fc('0x28')](0x194);}else{if(_0x4870b5['UserId']){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0x4870b5;})[_0x75fc('0x35')](function(_0x1a7a7e){if(_0x1a7a7e){return _0x1a7a7e[_0x75fc('0x34')]({'closed':_0x2bdb5a[_0x75fc('0x3b')][_0x75fc('0x47')],'disposition':_0x2bdb5a['body']['disposition']})[_0x75fc('0x35')](function(_0x25916d){return _0x25916d;});}})['then'](function(_0x1a7945){return respondWithRpcPromise(_0x75fc('0xe7'),_0x75fc('0xe4'),_0x2bdb5a[_0x75fc('0x3b')],client9004);})[_0x75fc('0x35')](respondWithResult(_0x5ee41e,null))[_0x75fc('0x27')](handleError(_0x5ee41e,null));};exports[_0x75fc('0xe8')]=function(_0x416e8f,_0x305997,_0x6e4cfd){_0x416e8f[_0x75fc('0x3b')][_0x75fc('0x37')]=_0x416e8f[_0x75fc('0xe9')][_0x75fc('0xea')];_0x416e8f[_0x75fc('0x3b')]['basename']=_0x416e8f[_0x75fc('0xe9')][_0x75fc('0xeb')];_0x416e8f[_0x75fc('0x3b')][_0x75fc('0x51')]=_0x416e8f[_0x75fc('0xe9')][_0x75fc('0xec')];return db['Attachment'][_0x75fc('0xcd')](_0x416e8f[_0x75fc('0x3b')])[_0x75fc('0x35')](respondWithResult(_0x305997,0xc9))[_0x75fc('0x27')](handleError(_0x305997,null));};exports[_0x75fc('0xed')]=function(_0x39857b,_0x2eb141,_0x4df317){return db[_0x75fc('0xb0')][_0x75fc('0xee')]({'where':{'id':_0x39857b[_0x75fc('0xc9')]['id']},'raw':!![]})[_0x75fc('0x35')](handleEntityNotFound(_0x2eb141,null))['then'](function(_0x39517c){if(_0x39517c){if(_0x39517c[_0x75fc('0x47')]){return _0x2eb141[_0x75fc('0x29')](0x193)[_0x75fc('0x2b')]({'status':0x193,'message':_0x75fc('0xef')});}return db[_0x75fc('0xf0')][_0x75fc('0xee')]({'where':{'id':_0x39857b[_0x75fc('0x54')]['attachId']},'raw':!![]})[_0x75fc('0x35')](handleEntityNotFound(_0x2eb141,null));}})['then'](function(_0x469863){if(_0x469863){var _0x57d1bc=_0x469863[_0x75fc('0xf1')]!==null;var _0x84d324=path[_0x75fc('0xf2')](config['root'],_0x75fc('0xf3'));if(_0x57d1bc){_0x84d324=path[_0x75fc('0xf2')](_0x84d324,_0x75fc('0xf4'));}var _0x878700=path[_0x75fc('0xf2')](_0x84d324,_0x469863['basename']);return _0x2eb141[_0x75fc('0xf5')](_0x878700);}})[_0x75fc('0x27')](handleError(_0x2eb141,null));};exports[_0x75fc('0xf6')]=function(_0x197339,_0x5b73dc){var _0x488c95=null;var _0x3a562c=null;var _0x181695=null;var _0x765fb6=null;if(_0x197339[_0x75fc('0x3b')]['id']){delete _0x197339[_0x75fc('0x3b')]['id'];}if(_0x197339[_0x75fc('0x3b')][_0x75fc('0xf7')]){_0x765fb6=path[_0x75fc('0xf2')](config['root'],'server/files/chat/upload/',util[_0x75fc('0xf8')](_0x75fc('0xf9'),Date[_0x75fc('0xfa')]()));_0x197339[_0x75fc('0x3b')]['pathTranscript']=_0x765fb6;}return db['ChatInteraction']['find']({'where':{'id':_0x197339[_0x75fc('0xc9')]['id']},'include':[{'model':db[_0x75fc('0xfb')],'as':_0x75fc('0xfc'),'include':[{'model':db[_0x75fc('0x8b')],'as':_0x75fc('0x8b')}]}]})[_0x75fc('0x35')](handleEntityNotFound(_0x5b73dc,null))[_0x75fc('0x35')](saveUpdates(_0x197339['body'],null))[_0x75fc('0x35')](function(_0x2b0dad){if(_0x2b0dad){_0x488c95=_0x2b0dad;return db[_0x75fc('0xd1')][_0x75fc('0x8c')]({'where':{'id':_0x488c95[_0x75fc('0x90')]}});}})[_0x75fc('0x35')](function(_0x27569b){if(_0x27569b){_0x181695=_0x27569b;return db[_0x75fc('0xe3')]['find']({'where':{'id':_0x488c95[_0x75fc('0x84')]}});}})[_0x75fc('0x35')](function(_0x15a055){if(_0x15a055){_0x3a562c=_0x15a055;if(_0x765fb6){var _0x1d91cd=null;for(var _0x5d55d1=0x1;_0x5d55d1<_0x488c95[_0x75fc('0xfc')][_0x75fc('0x58')];++_0x5d55d1){_0x1d91cd=_0x488c95[_0x75fc('0xfc')][_0x5d55d1];var _0x4997ab=_0x1d91cd[_0x75fc('0x48')]?util[_0x75fc('0xf8')]('%s%d',_0x181695[_0x75fc('0xfd')],_0x1d91cd['UserId']):'System';var _0x1753a4=_0x197339[_0x75fc('0x3b')][_0x75fc('0xfe')]||util[_0x75fc('0xf8')]('%s%d',_0x75fc('0xff'),_0x1d91cd['ContactId']);switch(_0x181695['agentIdentifier']){case _0x75fc('0x100'):_0x4997ab=_0x1d91cd[_0x75fc('0x48')]?util['format'](_0x75fc('0x101'),_0x181695['agentAlias'],_0x1d91cd[_0x75fc('0x48')]):_0x75fc('0x102');break;case _0x75fc('0x103'):_0x4997ab=_0x1d91cd[_0x75fc('0x48')]?_0x1d91cd[_0x75fc('0x8b')]['alias']||_0x1d91cd[_0x75fc('0x8b')][_0x75fc('0x40')]:_0x75fc('0x102');break;case'agent_fullname':_0x4997ab=_0x1d91cd[_0x75fc('0x48')]?_0x1d91cd[_0x75fc('0x8b')][_0x75fc('0x40')]:_0x75fc('0x102');break;default:_0x4997ab=_0x1d91cd[_0x75fc('0x48')]?util[_0x75fc('0xf8')](_0x75fc('0x101'),_0x181695['agentAlias'],_0x1d91cd['UserId']):'System';}var _0x980aaf=util['format'](_0x75fc('0x104'),moment(_0x1d91cd['createdAt'])[_0x75fc('0xf8')](_0x75fc('0x105')),_0x1d91cd['direction']==='in'?_0x1753a4:_0x4997ab,_0x1d91cd[_0x75fc('0x3b')]);if(!_0x1d91cd[_0x75fc('0x106')]){fs[_0x75fc('0x107')](_0x765fb6,_0x980aaf);}}return db[_0x75fc('0x108')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x75fc('0x109'),'raw':!![]}]});}}})[_0x75fc('0x35')](function(_0x434763){if(_0x434763&&_0x434763[_0x75fc('0x109')]&&_0x197339[_0x75fc('0x3b')]){var _0x3c1f22={'tls':{'rejectUnauthorized':![]}};if(_0x434763['Smtp'][_0x75fc('0x10a')]){_0x3c1f22[_0x75fc('0x10a')]=_0x434763[_0x75fc('0x109')]['service'];}else{_0x3c1f22[_0x75fc('0x10b')]=_0x434763['Smtp']['host'];_0x3c1f22[_0x75fc('0x10c')]=_0x434763['Smtp'][_0x75fc('0x10c')];_0x3c1f22[_0x75fc('0x10d')]=_0x434763['Smtp'][_0x75fc('0x10d')];}if(_0x434763[_0x75fc('0x109')][_0x75fc('0x10e')]){_0x3c1f22[_0x75fc('0x10f')]={'user':_0x434763[_0x75fc('0x109')]['user'],'pass':_0x434763[_0x75fc('0x109')][_0x75fc('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x3c1f22,'message':{'from':util[_0x75fc('0xf8')](_0x75fc('0x111'),_0x434763[_0x75fc('0x37')],_0x434763[_0x75fc('0xd6')]||_0x434763[_0x75fc('0x109')]['user']),'to':_0x197339[_0x75fc('0x3b')][_0x75fc('0xf7')],'subject':'Mail\x20Transcript','text':util[_0x75fc('0xf8')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x197339[_0x75fc('0x3b')][_0x75fc('0xf7')]),'attachments':[{'path':_0x765fb6}]}})[_0x75fc('0x35')](function(){return _0x488c95;})[_0x75fc('0x27')](function(_0x240856){console[_0x75fc('0x24')](_0x240856);});}else{return _0x488c95;}})['then'](respondWithStatusCode(_0x5b73dc,0xc8))[_0x75fc('0x27')](handleError(_0x5b73dc,null));};exports[_0x75fc('0x112')]=function(_0x3f1b6d,_0x121667,_0x30e253){return db[_0x75fc('0xfb')][_0x75fc('0x8c')]({'where':{'id':_0x3f1b6d[_0x75fc('0xc9')]['id']}})[_0x75fc('0x35')](handleEntityNotFound(_0x121667,null))[_0x75fc('0x35')](function(_0x25b308){if(_0x25b308){return _0x25b308['addMessage'](_0x3f1b6d[_0x75fc('0x3b')][_0x75fc('0x113')],_[_0x75fc('0x114')](_0x3f1b6d['body'],[_0x75fc('0x113'),'id'])||{});}})[_0x75fc('0x35')](respondWithResult(_0x121667,null))[_0x75fc('0x27')](handleError(_0x121667,null));};exports[_0x75fc('0x115')]=function(_0x570dae,_0x1f3084,_0x23acb3){var _0x12233c={'raw':![],'where':{}};var _0x7bcad1={};var _0x5d0926={'count':0x0,'rows':[]};return db[_0x75fc('0xb0')][_0x75fc('0xee')]({'where':{'id':_0x570dae['params']['id']}})['then'](handleEntityNotFound(_0x1f3084,null))[_0x75fc('0x35')](function(_0x569ec2){if(_0x569ec2){_0x7bcad1[_0x75fc('0x59')]=_[_0x75fc('0x53')](db[_0x75fc('0xfb')][_0x75fc('0x116')]);_0x7bcad1['query']=_[_0x75fc('0x53')](_0x570dae['query']);_0x7bcad1[_0x75fc('0x5f')]=_[_0x75fc('0x55')](_0x7bcad1[_0x75fc('0x59')],_0x7bcad1[_0x75fc('0x54')]);_0x12233c[_0x75fc('0x57')]=_[_0x75fc('0x55')](_0x7bcad1[_0x75fc('0x59')],qs[_0x75fc('0x56')](_0x570dae[_0x75fc('0x54')][_0x75fc('0x56')]));_0x12233c['attributes']=_0x12233c[_0x75fc('0x57')][_0x75fc('0x58')]?_0x12233c[_0x75fc('0x57')]:_0x7bcad1[_0x75fc('0x59')];if(!_0x570dae['query'][_0x75fc('0x5a')](_0x75fc('0x5b'))){_0x12233c[_0x75fc('0x2d')]=qs[_0x75fc('0x2d')](_0x570dae[_0x75fc('0x54')][_0x75fc('0x2d')]);_0x12233c[_0x75fc('0x2c')]=qs['offset'](_0x570dae['query']['offset']);}_0x12233c[_0x75fc('0x5c')]=qs[_0x75fc('0x5d')](_0x570dae[_0x75fc('0x54')][_0x75fc('0x5d')]);_0x12233c['where']=qs['filters'](_[_0x75fc('0x60')](_0x570dae['query'],_0x7bcad1[_0x75fc('0x5f')]));_0x12233c[_0x75fc('0x5e')][_0x75fc('0xc5')]=_0x569ec2['id'];if(_0x570dae[_0x75fc('0x54')][_0x75fc('0x9c')]){_0x12233c[_0x75fc('0x5e')]=_[_0x75fc('0x3a')](_0x12233c[_0x75fc('0x5e')],{'$or':_[_0x75fc('0x3f')](_0x12233c[_0x75fc('0x57')],function(_0x26caf1){var _0x5a957d={};_0x5a957d[_0x26caf1]={'$like':'%'+_0x570dae[_0x75fc('0x54')]['filter']+'%'};return _0x5a957d;})});}if(_0x570dae[_0x75fc('0x54')]['$gte']){var _0x4ce226=_0x570dae[_0x75fc('0x54')][_0x75fc('0x94')][_0x75fc('0x42')](',');var _0x1c4e19={};_0x1c4e19[_0x4ce226[0x0]]={'$gte':moment(_0x4ce226[0x1])['format'](_0x75fc('0x117'))};_0x12233c[_0x75fc('0x5e')]=_['merge'](_0x12233c[_0x75fc('0x5e')],_0x1c4e19);}_0x12233c=_[_0x75fc('0x3a')]({},_0x12233c,_0x570dae[_0x75fc('0xcc')]);return db[_0x75fc('0xfb')][_0x75fc('0x2e')]({'where':_0x12233c[_0x75fc('0x5e')]})['then'](function(_0x54448c){_0x5d0926[_0x75fc('0x2e')]=_0x54448c;if(_0x570dae[_0x75fc('0x54')]['includeAll']){_0x12233c[_0x75fc('0xcb')]=[{'all':!![]}];}return db[_0x75fc('0xfb')][_0x75fc('0x118')](_0x12233c);})['then'](function(_0x210aa4){_0x5d0926[_0x75fc('0xc7')]=_0x210aa4;return _0x5d0926;});}})[_0x75fc('0x35')](respondWithFilteredResult(_0x1f3084,_0x12233c))[_0x75fc('0x27')](handleError(_0x1f3084,null));};exports[_0x75fc('0x119')]=function(_0xddad92,_0x12baf8,_0x59bcd4){var _0x5dcc91={'where':{}},_0x218982={},_0x37c39d={'count':0x0,'rows':[]};return db[_0x75fc('0xb0')][_0x75fc('0xee')]({'where':{'id':_0xddad92['params']['id']}})['then'](handleEntityNotFound(_0x12baf8,null))['then'](function(_0x4bc92a){if(_0x4bc92a){_0x218982[_0x75fc('0x59')]=_[_0x75fc('0x53')](db[_0x75fc('0xfb')][_0x75fc('0x116')]);_0x218982[_0x75fc('0x54')]=_['keys'](_0xddad92[_0x75fc('0x54')]);_0x218982[_0x75fc('0x5f')]=_[_0x75fc('0x55')](_0x218982[_0x75fc('0x59')],_0x218982[_0x75fc('0x54')]);_0x5dcc91['attributes']=_[_0x75fc('0x55')](_0x218982[_0x75fc('0x59')],qs[_0x75fc('0x56')](_0xddad92['query'][_0x75fc('0x56')]));_0x5dcc91[_0x75fc('0x57')]=_0x5dcc91[_0x75fc('0x57')][_0x75fc('0x58')]?_0x5dcc91['attributes']:_0x218982[_0x75fc('0x59')];if(!_0xddad92[_0x75fc('0x54')][_0x75fc('0x5a')](_0x75fc('0x5b'))){_0x5dcc91[_0x75fc('0x2d')]=qs[_0x75fc('0x2d')](_0xddad92[_0x75fc('0x54')][_0x75fc('0x2d')]);_0x5dcc91[_0x75fc('0x2c')]=qs['offset'](_0xddad92['query'][_0x75fc('0x2c')]);}_0x5dcc91[_0x75fc('0x5c')]=qs['sort'](_0xddad92[_0x75fc('0x54')][_0x75fc('0x5d')]);_0x5dcc91['where']=qs['filters'](_[_0x75fc('0x60')](_0xddad92[_0x75fc('0x54')],_0x218982['filters']));_0x5dcc91[_0x75fc('0x5e')][_0x75fc('0xc5')]=_0x4bc92a['id'];if(_0xddad92[_0x75fc('0x54')][_0x75fc('0x9c')]){_0x5dcc91['where']=_[_0x75fc('0x3a')](_0x5dcc91[_0x75fc('0x5e')],{'$or':_[_0x75fc('0x3f')](_0x5dcc91[_0x75fc('0x57')],function(_0x2ec061){var _0x3623fc={};_0x3623fc[_0x2ec061]={'$like':'%'+_0xddad92[_0x75fc('0x54')][_0x75fc('0x9c')]+'%'};return _0x3623fc;})});}_0x5dcc91[_0x75fc('0x5e')]['secret']=![];if(_0xddad92[_0x75fc('0x54')]['id']){_0x5dcc91[_0x75fc('0x5e')]['id']={'$gt':_0xddad92['query']['id']};}_0x5dcc91=_[_0x75fc('0x3a')]({},_0x5dcc91,_0xddad92[_0x75fc('0xcc')]);return db[_0x75fc('0xfb')][_0x75fc('0x2e')]({'where':_0x5dcc91['where']})['then'](function(_0x58e686){_0x37c39d[_0x75fc('0x2e')]=_0x58e686;_0x5dcc91[_0x75fc('0xcb')]=[];if(_0xddad92[_0x75fc('0x54')]['includeAgent']){_0x5dcc91[_0x75fc('0xcb')][_0x75fc('0x45')]({'model':db[_0x75fc('0x8b')],'as':_0x75fc('0x8b'),'attributes':['id',_0x75fc('0x40'),_0x75fc('0x11a')]});}if(_0xddad92[_0x75fc('0x54')][_0x75fc('0xca')]){_0x5dcc91['include']=[{'all':!![]}];}return db[_0x75fc('0xfb')][_0x75fc('0x118')](_0x5dcc91);})['then'](function(_0xe7f5c6){_0x37c39d[_0x75fc('0xc7')]=_0xe7f5c6;return _0x37c39d;});}})[_0x75fc('0x35')](respondWithFilteredResult(_0x12baf8,_0x5dcc91))['catch'](handleError(_0x12baf8,null));};exports[_0x75fc('0x11b')]=function(_0x596a95,_0x372ad1,_0x2db54e){return db['ChatInteraction'][_0x75fc('0x8c')]({'where':{'id':_0x596a95[_0x75fc('0xc9')]['id']}})[_0x75fc('0x35')](handleEntityNotFound(_0x372ad1,null))[_0x75fc('0x35')](function(_0x5c1a16){if(_0x5c1a16){return _0x5c1a16['setTags'](_0x596a95['body'][_0x75fc('0x113')],_[_0x75fc('0x114')](_0x596a95['body'],[_0x75fc('0x113'),'id'])||{})[_0x75fc('0x11c')](function(){return db[_0x75fc('0x88')][_0x75fc('0x118')]({'attributes':['id','name','color'],'where':{'id':_0x596a95[_0x75fc('0x3b')]['ids']}});})[_0x75fc('0x35')](function(_0x1422eb){socket['emit'](_0x75fc('0x11d'),{'id':Number(_0x596a95['params']['id']),'tags':_0x1422eb||[]});return{'id':Number(_0x596a95[_0x75fc('0xc9')]['id']),'tags':_0x1422eb||[]};});}})[_0x75fc('0x35')](respondWithResult(_0x372ad1,null))[_0x75fc('0x27')](handleError(_0x372ad1,null));};exports[_0x75fc('0x11e')]=function(_0x30250f,_0x28c7ff,_0x5f2a10){return db['ChatInteraction'][_0x75fc('0x8c')]({'where':{'id':_0x30250f['params']['id']}})[_0x75fc('0x35')](handleEntityNotFound(_0x28c7ff,null))[_0x75fc('0x35')](function(_0x20d900){if(_0x20d900){return _0x20d900[_0x75fc('0x11e')](_0x30250f[_0x75fc('0x54')][_0x75fc('0x113')]);}})['then'](respondWithStatusCode(_0x28c7ff,null))[_0x75fc('0x27')](handleError(_0x28c7ff,null));};exports[_0x75fc('0xf5')]=function(_0x430f0c,_0x4717f0){var _0x3affb9=moment()[_0x75fc('0x11f')]()['toString']();var _0x417538=path['join'](config[_0x75fc('0x120')],_0x75fc('0x121'),_0x75fc('0x122'),_0x75fc('0x123'));var _0x181f37=path[_0x75fc('0xf2')](config[_0x75fc('0x120')],_0x75fc('0x121'),'files',_0x75fc('0x124'));var _0x5f3793=path[_0x75fc('0xf2')](_0x417538,_0x3affb9);var _0x594368=util[_0x75fc('0xf8')]('transcript-%d-%s.zip',_0x430f0c[_0x75fc('0xc9')]['id'],_0x3affb9);var _0x35585b=path[_0x75fc('0xf2')](_0x417538,_0x594368);var _0x4e2522=[];_0x4e2522[_0x75fc('0x45')]({'model':db[_0x75fc('0x8b')],'as':'User','attributes':['id',_0x75fc('0x40')],'raw':!![]});_0x4e2522[_0x75fc('0x45')]({'model':db[_0x75fc('0xe3')],'as':_0x75fc('0x7f'),'attributes':['id','firstName',_0x75fc('0x125')],'raw':!![]});if(_0x430f0c[_0x75fc('0x54')][_0x75fc('0x124')]){_0x4e2522[_0x75fc('0x45')]({'model':db[_0x75fc('0xf0')],'as':_0x75fc('0xf0'),'raw':!![]});}var _0x295cfb=[{'model':db[_0x75fc('0xfb')],'as':_0x75fc('0xfc'),'attributes':['id',_0x75fc('0x3b'),_0x75fc('0x126'),_0x75fc('0x127'),'secret',_0x75fc('0x98')],'include':_0x4e2522}];_0x295cfb[_0x75fc('0x45')]({'model':db['ChatWebsite'],'as':_0x75fc('0x128'),'attributes':['id',_0x75fc('0x37')]});_0x295cfb[_0x75fc('0x45')]({'model':db[_0x75fc('0x8b')],'as':'Owner','attributes':['id',_0x75fc('0x40')]});return db[_0x75fc('0xb0')][_0x75fc('0x8c')]({'where':{'id':_0x430f0c[_0x75fc('0xc9')]['id']},'include':_0x295cfb})[_0x75fc('0x35')](handleEntityNotFound(_0x4717f0,null))[_0x75fc('0x35')](function(_0x575f7b){if(_0x575f7b){var _0x577c61=_0x575f7b['get']({'plain':!![]});fs[_0x75fc('0x129')](_0x5f3793);var _0x1a9b53={'channel':'Chat','account':_0x577c61[_0x75fc('0x128')]['name'],'agent':_0x577c61[_0x75fc('0x12a')]?_0x577c61[_0x75fc('0x12a')][_0x75fc('0x40')]:_0x75fc('0x12b'),'createdAt':moment(_0x577c61[_0x75fc('0x126')])[_0x75fc('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x75fc('0xc4')](),'closedAt':_0x577c61['closed']?moment(_0x577c61[_0x75fc('0x12c')])['format'](_0x75fc('0x117'))[_0x75fc('0xc4')]():'','disposition':_0x577c61[_0x75fc('0x4a')],'chatInfo':{'browser':_0x577c61[_0x75fc('0x12d')],'os':_0x577c61['osName'],'referer':_0x577c61[_0x75fc('0x12e')],'customerIp':_0x577c61[_0x75fc('0x12f')],'customerPort':_0x577c61[_0x75fc('0x130')]?_0x577c61[_0x75fc('0x130')]:_0x75fc('0x12b')},'messages':_(_0x577c61[_0x75fc('0xfc')])[_0x75fc('0x131')]()['filter']({'secret':![]})[_0x75fc('0x3f')](function(_0x23622b){if(_0x23622b[_0x75fc('0xf0')]){var _0x3dffa1=path[_0x75fc('0xf2')](_0x181f37,_0x23622b['Attachment'][_0x75fc('0x132')]);if(fs['existsSync'](_0x3dffa1)){fs[_0x75fc('0x133')](_0x3dffa1)['pipe'](fs[_0x75fc('0x134')](path['join'](_0x5f3793,_0x23622b[_0x75fc('0xf0')][_0x75fc('0x132')])));}}return{'date':moment(_0x23622b['createdAt'])['format'](_0x75fc('0x117'))[_0x75fc('0xc4')](),'sender':_0x23622b[_0x75fc('0x127')]===_0x75fc('0x135')?_0x23622b[_0x75fc('0x8b')]?_0x23622b[_0x75fc('0x8b')]['fullname']:_0x75fc('0x102'):_0x23622b['Contact'][_0x75fc('0x136')]+(_0x23622b[_0x75fc('0x7f')][_0x75fc('0x125')]?'\x20'+_0x23622b['Contact']['lastName']:''),'body':_0x23622b['Attachment']?_0x23622b[_0x75fc('0xf0')][_0x75fc('0x132')]:_0x23622b['body'],'direction':_0x23622b[_0x75fc('0x127')]===_0x75fc('0x135')?'A':'C','secret':_0x23622b[_0x75fc('0x106')],'read':_0x23622b[_0x75fc('0x98')],'attachment':_0x23622b[_0x75fc('0xf0')]};})[_0x75fc('0x7b')]()};return ejs[_0x75fc('0x137')](path['join'](config[_0x75fc('0x120')],'server',_0x75fc('0x138'),'downloadInteraction.ejs'),{'interaction':_0x1a9b53})[_0x75fc('0x35')](function(_0x6c1560){var _0x4009f1=path[_0x75fc('0xf2')](_0x5f3793,_0x75fc('0x139')+_0x577c61['id']+'-'+_0x3affb9+_0x75fc('0x13a'));var _0x5339c1={'path':_0x4009f1,'channel':_0x75fc('0x13b'),'interactionId':_0x577c61['id']};return pdf['createPdfFromHTML'](_0x6c1560,_0x5339c1);})[_0x75fc('0x35')](function(){return new BPromise(function(_0x2e7071,_0x1dac87){zipdir(_0x5f3793,{'saveTo':_0x35585b},function(_0x2311e8,_0x2fab08){if(_0x2311e8)return _0x1dac87(_0x2311e8);return _0x2e7071(_0x2fab08);});})[_0x75fc('0x35')](function(){return new BPromise(function(_0x4f696c,_0x121520){rimraf(_0x5f3793,function(_0x1494f1){if(_0x1494f1)_0x121520(_0x1494f1);return _0x4f696c();});});})[_0x75fc('0x35')](function(){return _0x4717f0[_0x75fc('0xf5')](_0x35585b,_0x594368,function(_0x355e88){if(_0x355e88){console[_0x75fc('0x13c')](_0x75fc('0x13d'),_0x355e88);}else{fs[_0x75fc('0x13e')](_0x35585b);}});});});}else{return _0x4717f0[_0x75fc('0x28')](0xc8);}})[_0x75fc('0x27')](handleError(_0x4717f0,null));};
\ No newline at end of file
+var _0xa9e0=['createPdfFromHTML','err','rimraf','zip-dir','request-promise','mustache','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','account','Users','fullname','Tags','TagIds','split','forEach','push','catch','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','total','index','map','ChatInteraction','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','select','field','from','u.fullname','user_has_chat_interactions','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','keys','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','group','i.id','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','attachmentUpload','file','originalname','filename','Attachment','Unauthorized','findOne','attachId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','hasOwnProperty','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','color','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x4c8b0e,_0x1f4abc){var _0xe367d6=function(_0x2c1042){while(--_0x2c1042){_0x4c8b0e['push'](_0x4c8b0e['shift']());}};_0xe367d6(++_0x1f4abc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var rimraf=require(_0x0a9e('0x0'));var zipdir=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x3'));var util=require('util');var path=require(_0x0a9e('0x4'));var ejs=require(_0x0a9e('0x5'));var fs=require('fs');var _=require(_0x0a9e('0x6'));var squel=require(_0x0a9e('0x7'));var Redis=require(_0x0a9e('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0x0a9e('0x9'));var pdf=require(_0x0a9e('0xa'));var logger=require(_0x0a9e('0xb'))('api');var config=require('../../config/environment');var db=require(_0x0a9e('0xc'))['db'];config['redis']=_['defaults'](config[_0x0a9e('0xd')],{'host':_0x0a9e('0xe'),'port':0x18eb});var socket=require(_0x0a9e('0xf'))(new Redis(config[_0x0a9e('0xd')]));require(_0x0a9e('0x10'))[_0x0a9e('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0x0a9e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x13')](_0x36471c,_0x26d672)[_0x0a9e('0x14')](function(_0x281129){logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x18'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x19')]){if(_0x281129[_0x0a9e('0x19')]['code']===0x1f4){logger[_0x0a9e('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x5db4b0(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}logger[_0x0a9e('0x19')](_0x0a9e('0x16'),_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x69aeb7(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}else{logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1b')][_0x0a9e('0x1a')]);}})['catch'](function(_0x20f109){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1c')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1d')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1e')](_0x3b45bc)[_0x0a9e('0x1f')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x20')]===_0x0a9e('0x21')&&typeof _0x5ea472[_0x0a9e('0x22')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x23')]:_0x5ea472[_0x0a9e('0x20')]+_0x5ea472[_0x0a9e('0x22')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1e')](_0x140511);return _0x16b1ca[_0x0a9e('0x24')](_0x0a9e('0x25'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x26')](_0x3652a7)[_0x0a9e('0x14')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x27')]()[_0x0a9e('0x14')](function(){_0x15b200[_0x0a9e('0x1e')](0xcc)[_0x0a9e('0x1d')]();});}};}function handleEntityNotFound(_0x296f41){return function(_0x2e8759){if(!_0x2e8759){_0x296f41[_0x0a9e('0x1c')](0x194);}return _0x2e8759;};}function handleError(_0x540530,_0x426950){_0x426950=_0x426950||0x1f4;return function(_0x5d1e0e){logger[_0x0a9e('0x19')](_0x5d1e0e[_0x0a9e('0x28')]);if(_0x5d1e0e[_0x0a9e('0x29')]){delete _0x5d1e0e[_0x0a9e('0x29')];}_0x540530[_0x0a9e('0x1e')](_0x426950)['send'](_0x5d1e0e);};}function getMustacheRender(_0x66c1d2,_0x46f0a5){return Mustache[_0x0a9e('0x2a')](_0x66c1d2,_[_0x0a9e('0x2b')](_0x46f0a5[_0x0a9e('0x2c')],{'contact':_0x46f0a5[_0x0a9e('0x2d')],'message':_0x46f0a5[_0x0a9e('0x1a')],'agent':_0x46f0a5[_0x0a9e('0x2e')],'interaction':_0x46f0a5['interaction'],'account':_0x46f0a5[_0x0a9e('0x2f')]}))||'';}function getInteractionUsers(_0x5e7238,_0x2cc7a0){return new BPromise(function(_0x14b13f,_0x2b7e7f){try{if(_0x2cc7a0[_0x5e7238['id']]){_0x5e7238[_0x0a9e('0x30')]=_['map'](_0x2cc7a0[_0x5e7238['id']],function(_0x191e91){return{'id':_0x191e91['id'],'fullname':_0x191e91[_0x0a9e('0x31')]};});}}catch(_0x1fa90d){_0x2b7e7f(_0x1fa90d);}_0x14b13f(_0x5e7238);});}function getInteractionTags(_0x15de0e,_0x4853b1){return new BPromise(function(_0x54135e,_0x1e8694){try{if(_0x15de0e['TagIds']){_0x15de0e[_0x0a9e('0x32')]=[];_0x15de0e[_0x0a9e('0x33')][_0x0a9e('0x34')](',')[_0x0a9e('0x35')](function(_0x4f41ae){_0x15de0e[_0x0a9e('0x32')][_0x0a9e('0x36')](_0x4853b1[_0x4f41ae]);});}delete _0x15de0e[_0x0a9e('0x33')];}catch(_0x533942){_0x1e8694(_0x533942);}_0x54135e(_0x15de0e);});}function updateChatInteraction(_0x1dbf74,_0x1a180b,_0x289467){return new BPromise(function(_0x4c1c0e,_0x546ef8){return getInteractionUsers(_0x1dbf74,_0x289467)[_0x0a9e('0x14')](function(_0x40d766){return getInteractionTags(_0x40d766,_0x1a180b);})['then'](function(_0x2b814e){return getStateInteraction(_0x2b814e);})[_0x0a9e('0x14')](function(_0x2e1b3a){_0x4c1c0e(_0x2e1b3a);})[_0x0a9e('0x37')](function(_0x4b38d9){_0x546ef8(_0x4b38d9);});});}function getStateInteraction(_0x5a594b){return new BPromise(function(_0x15e37d){_0x5a594b[_0x0a9e('0x38')]=0x0;_0x5a594b['talking']=0x0;_0x5a594b[_0x0a9e('0x39')]=0x0;_0x5a594b[_0x0a9e('0x3a')]=0x0;_0x5a594b[_0x0a9e('0x3b')]=0x0;_0x5a594b['total']=0x0;if(!_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x38')]+=0x1;}if(!_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x3e')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3f')]===_0x0a9e('0x3b')){_0x5a594b[_0x0a9e('0x3b')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b['UserId']&&_0x5a594b['disposition']){_0x5a594b[_0x0a9e('0x3a')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x39')]+=0x1;if(_0x5a594b[_0x0a9e('0x3e')]){_0x5a594b[_0x0a9e('0x3e')]-=0x1;}}_0x5a594b[_0x0a9e('0x40')]+=0x1;_0x15e37d(_0x5a594b);});}exports[_0x0a9e('0x41')]=function(_0x2c2cb0,_0x35ed4a){var _0x5026aa={},_0x117c99={},_0x138b8b={'count':0x0,'rows':[]};var _0xdd268f=_[_0x0a9e('0x42')](db[_0x0a9e('0x43')][_0x0a9e('0x44')],function(_0x21eb86){return{'name':_0x21eb86[_0x0a9e('0x45')],'type':_0x21eb86['type'][_0x0a9e('0x46')]};});_0x117c99['model']=_[_0x0a9e('0x42')](_0xdd268f,_0x0a9e('0x29'));_0x117c99[_0x0a9e('0x47')]=_['keys'](_0x2c2cb0[_0x0a9e('0x47')]);_0x117c99[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x117c99[_0x0a9e('0x4a')],_0x117c99[_0x0a9e('0x47')]);_0x5026aa[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x117c99['model'],qs[_0x0a9e('0x4c')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x5026aa[_0x0a9e('0x4b')]=_0x5026aa[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x5026aa[_0x0a9e('0x4b')]:_0x117c99[_0x0a9e('0x4a')];if(!_0x2c2cb0[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x5026aa[_0x0a9e('0x22')]=qs['limit'](_0x2c2cb0['query']['limit']);_0x5026aa[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x5026aa[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x5026aa['where']=qs['filters'](_['pick'](_0x2c2cb0[_0x0a9e('0x47')],_0x117c99[_0x0a9e('0x48')]),_0xdd268f);var _0x14d602=[];var _0x5bb3ed=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('id')['field']('name')[_0x0a9e('0x52')]('color')[_0x0a9e('0x53')]('tools_tags');var _0x2e5e62=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('u.id')[_0x0a9e('0x52')](_0x0a9e('0x54'))['field']('ui.ChatInteractionId')[_0x0a9e('0x53')](_0x0a9e('0x55'),'ui')['left_join'](_0x0a9e('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x211ef9=squel['select']()[_0x0a9e('0x53')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x0a9e('0x57'))['left_join'](_0x0a9e('0x56'),'o',_0x0a9e('0x58'))[_0x0a9e('0x59')](_0x0a9e('0x5a'),'a',_0x0a9e('0x5b'))[_0x0a9e('0x59')](_0x0a9e('0x5c'),'me',_0x0a9e('0x5d'))['left_join'](_0x0a9e('0x5e'),'it',_0x0a9e('0x5f'))[_0x0a9e('0x59')](_0x0a9e('0x60'),'t',_0x0a9e('0x61'));var _0x156662=squel['expr']();var _0x956fbe=[];var _0x26bc80=squel['expr']();var _0x3649cc;if(_0x2c2cb0['query'][_0x0a9e('0x62')]){_0x3649cc=as['parseSearch'](_0x2c2cb0['query']['search']);var _0x273cb5=_0x3649cc['sqlOperator'];for(var _0x2244d6=0x0;_0x2244d6<_0x3649cc[_0x0a9e('0x63')][_0x0a9e('0x4d')];_0x2244d6++){var _0x7be420=_0x3649cc[_0x0a9e('0x63')][_0x2244d6];var _0x26d7db='i';var _0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x7be420[_0x0a9e('0x52')]]);if(!_0x49eed0){switch(_0x7be420[_0x0a9e('0x52')]){case _0x0a9e('0x65'):if(_0x7be420['value']==0x1){_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420[_0x0a9e('0x52')]+_0x0a9e('0x67'));}else{_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420['field']+_0x0a9e('0x68'));}break;case _0x0a9e('0x69'):if(_0x7be420['operator']===_0x0a9e('0x6a')){if(_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')]('\x20')[_0x0a9e('0x4d')]>0x1){_0x156662[_0x273cb5](_0x0a9e('0x6c'),qs['getFullTextValue'](_0x7be420[_0x0a9e('0x6b')]),null);}else{var _0x2937e0='%'+_0x7be420[_0x0a9e('0x6b')]+'%';_0x156662[_0x273cb5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2937e0,_0x2937e0,_0x2937e0);}}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name','ContactId']);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x6d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x72'):var _0x2e89b7=_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')](',')[_0x0a9e('0x42')](function(_0x320898){return Number(_0x320898);});_0x2e89b7[_0x0a9e('0x35')](function(_0x2a28c0){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x2a28c0+',%');});_0x956fbe=_['union'](_0x956fbe,_0x2e89b7);break;case _0x0a9e('0x74'):if(_0x7be420[_0x0a9e('0x75')]===_0x0a9e('0x6a')){_0x156662[_0x273cb5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x7be420[_0x0a9e('0x6b')]+'%',null);}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x0a9e('0x3d')]);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x3d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f['value']['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x2c'):_0x235f8f=as[_0x0a9e('0x6e')]('me',null,_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')]['end']);break;}}else{var _0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f[_0x0a9e('0x6b')]['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}}}else{var _0x4c46c1=_(_0x2c2cb0[_0x0a9e('0x47')])[_0x0a9e('0x76')]()[_0x0a9e('0x42')](function(_0x317c0c){return _['some'](_0xdd268f,[_0x0a9e('0x29'),_0x317c0c])?_0x317c0c:undefined;})[_0x0a9e('0x77')]()[_0x0a9e('0x6b')]();if(!_[_0x0a9e('0x78')](_0x4c46c1)){_0x4c46c1['forEach'](function(_0x109ccb){if(_0x109ccb===_0x0a9e('0x79')){_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),[]['concat'](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]));}else if(_0x109ccb===_0x0a9e('0x7c')){var _0x30a4c7=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7e')];var _0x40fc56=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7f')];_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x80'),_0x30a4c7,_0x40fc56);}else{if(_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]===_0x0a9e('0x81')){_0x211ef9['where']('i.'+_0x109ccb+_0x0a9e('0x82'));}else{_0x211ef9[_0x0a9e('0x7a')]('i.'+_0x109ccb+_0x0a9e('0x83'),_0x2c2cb0['query'][_0x109ccb]);}}});}if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]==0x1){_0x211ef9['having']('`unreadMessages`\x20=\x200');}else{_0x211ef9[_0x0a9e('0x66')](_0x0a9e('0x85'));}}if(_0x2c2cb0['query'][_0x0a9e('0x86')]){_0x956fbe=_['isArray'](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')])?_0x2c2cb0['query'][_0x0a9e('0x86')]:new Array(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')]);_0x956fbe[_0x0a9e('0x35')](function(_0x3755fe){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x3755fe+',%');});}if(_0x2c2cb0[_0x0a9e('0x47')]['filter']){var _0x2973d3=_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x87')][_0x0a9e('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0a9e('0x89')](_0x2973d3)){_0x156662['or'](_0x0a9e('0x8a'),_0x2973d3+'%');}else{_0x156662['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x8b')](_0x2973d3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2973d3+'%');}}}_0x211ef9[_0x0a9e('0x7a')](_0x156662);_0x211ef9[_0x0a9e('0x8c')](_0x0a9e('0x8d'));var _0x385d52={'type':db['Sequelize']['QueryTypes'][_0x0a9e('0x8e')],'raw':!![]};var _0x2b9c01=_0x211ef9[_0x0a9e('0x8f')]();_0x2b9c01['field'](_0x0a9e('0x8d'));_0x2b9c01[_0x0a9e('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5026aa[_0x0a9e('0x4f')]){_0x5026aa['order']['forEach'](function(_0x4dc6b3){var _0x81d748=_0x4dc6b3[0x0]===_0x0a9e('0x90')?_0x4dc6b3[0x0]:'i.'+_0x4dc6b3[0x0];_0x211ef9[_0x0a9e('0x4f')](_0x81d748,_0x4dc6b3[0x1]===_0x0a9e('0x91')?![]:!![]);});}if(!_[_0x0a9e('0x78')](_0x956fbe)){_0x211ef9[_0x0a9e('0x66')](_0x26bc80);_0x2b9c01['where'](_0x0a9e('0x92'),_0x956fbe);}BPromise['resolve']()[_0x0a9e('0x14')](function(){if(!_0x3649cc){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return;_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x93'));return;}if(_0x2c2cb0[_0x0a9e('0x94')]['role']!==_0x0a9e('0x2e'))return;return _0x2c2cb0[_0x0a9e('0x94')][_0x0a9e('0x95')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x14')](function(_0x255e49){if(_[_0x0a9e('0x78')](_0x255e49)){_0x2b9c01[_0x0a9e('0x7a')](_0x0a9e('0x96'));_0x211ef9['where'](_0x0a9e('0x96'));}else{_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0a9e('0x42')](_0x255e49,'id'));_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),_['map'](_0x255e49,'id'));}});})[_0x0a9e('0x14')](function(){if(_0x2c2cb0['user'][_0x0a9e('0x97')]===_0x0a9e('0x2e')&&!_0x3649cc&&!_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x2b9c01[_0x0a9e('0x99')](),_0x385d52);})[_0x0a9e('0x14')](function(_0x501050){_0x138b8b[_0x0a9e('0x23')]=_0x501050[_0x0a9e('0x4d')];if(_0x138b8b[_0x0a9e('0x23')]===0x0)return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x5bb3ed[_0x0a9e('0x99')](),_0x385d52)[_0x0a9e('0x14')](function(_0x33f0c9){_0x14d602=_[_0x0a9e('0x9a')](_0x33f0c9,'id');_0x385d52=_[_0x0a9e('0x2b')](_0x385d52,{'model':db[_0x0a9e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]){_0x5026aa['attributes'][_0x0a9e('0x35')](function(_0x23e2bd){_0x211ef9[_0x0a9e('0x52')]('i.'+_0x23e2bd);});}else{_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9b'),'unreadMessages');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9c'),'Account.key');_0x211ef9[_0x0a9e('0x52')]('a.mandatoryDisposition',_0x0a9e('0x9d'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9e'),_0x0a9e('0x90'));_0x211ef9['field'](_0x0a9e('0x9f'));_0x211ef9['field'](_0x0a9e('0xa0'),_0x0a9e('0xa1'));_0x211ef9['field'](_0x0a9e('0xa2'),_0x0a9e('0xa3'));_0x211ef9[_0x0a9e('0x52')]('c.email','Contact.email');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa4'),_0x0a9e('0xa5'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x211ef9['field'](_0x0a9e('0xaa'),'Owner.fullname');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xab'),_0x0a9e('0xac'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xad'),'TagIds');}if(_0x5026aa[_0x0a9e('0x22')])_0x211ef9[_0x0a9e('0x22')](_0x5026aa[_0x0a9e('0x22')]);if(_0x5026aa[_0x0a9e('0x20')])_0x211ef9[_0x0a9e('0x20')](_0x5026aa['offset']);return db['sequelize'][_0x0a9e('0x47')](_0x211ef9['toString'](),_0x385d52);})[_0x0a9e('0x14')](function(_0x4658df){if(_0x4658df[_0x0a9e('0x4d')]>0x0)_0x2e5e62[_0x0a9e('0x7a')](_0x0a9e('0xae'),_[_0x0a9e('0x42')](_0x4658df,'id'));return db['sequelize']['query'](_0x2e5e62[_0x0a9e('0x99')](),_0x385d52)['then'](function(_0x2469d1){var _0x5c689c=_[_0x0a9e('0xaf')](_0x2469d1,'ChatInteractionId');var _0x558d60=[];_0x4658df[_0x0a9e('0x35')](function(_0xb8db59){_0x558d60['push'](updateChatInteraction(_0xb8db59,_0x14d602,_0x5c689c));});return BPromise[_0x0a9e('0xb0')](_0x558d60);});});})[_0x0a9e('0x14')](function(_0x15c6b9){_0x138b8b[_0x0a9e('0xb1')]=_0x15c6b9;return _0x138b8b;})[_0x0a9e('0x14')](respondWithFilteredResult(_0x35ed4a,_0x5026aa))['catch'](handleError(_0x35ed4a,null));};exports['show']=function(_0x16449b,_0x22286c){var _0x41c8cd={'raw':![],'where':{'id':_0x16449b[_0x0a9e('0xb2')]['id']}},_0x24beb6={};_0x24beb6['model']=_[_0x0a9e('0x76')](db[_0x0a9e('0x43')]['rawAttributes']);_0x24beb6[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x16449b[_0x0a9e('0x47')]);_0x24beb6[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],_0x24beb6[_0x0a9e('0x47')]);_0x41c8cd[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],qs['fields'](_0x16449b[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x41c8cd[_0x0a9e('0x4b')]=_0x41c8cd[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x41c8cd['attributes']:_0x24beb6['model'];if(_0x16449b[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x41c8cd[_0x0a9e('0xb4')]=[{'all':!![]}];}_0x41c8cd=_[_0x0a9e('0x2b')]({},_0x41c8cd,_0x16449b[_0x0a9e('0xb5')]);return db['ChatInteraction'][_0x0a9e('0x64')](_0x41c8cd)[_0x0a9e('0x14')](handleEntityNotFound(_0x22286c,null))[_0x0a9e('0x14')](respondWithResult(_0x22286c,null))['catch'](handleError(_0x22286c,null));};exports[_0x0a9e('0xb6')]=function(_0x59aa7b,_0x2144ca){return db['ChatInteraction'][_0x0a9e('0xb6')](_0x59aa7b[_0x0a9e('0x2c')],{})[_0x0a9e('0x14')](respondWithResult(_0x2144ca,0xc9))['catch'](handleError(_0x2144ca,null));};exports[_0x0a9e('0x26')]=function(_0x5ed560,_0x4383da){if(_0x5ed560[_0x0a9e('0x2c')]['id']){delete _0x5ed560[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x5ed560[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x14')](saveUpdates(_0x5ed560[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x4383da,null))[_0x0a9e('0x37')](handleError(_0x4383da,null));};exports[_0x0a9e('0x27')]=function(_0x2415fe,_0x399def){return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x2415fe['params']['id']}})['then'](handleEntityNotFound(_0x399def,null))[_0x0a9e('0x14')](removeEntity(_0x399def,null))['catch'](handleError(_0x399def,null));};exports[_0x0a9e('0xb7')]=function(_0x3428c9,_0x5d6b69){return db[_0x0a9e('0x43')][_0x0a9e('0xb7')]()[_0x0a9e('0x14')](respondWithResult(_0x5d6b69,null))[_0x0a9e('0x37')](handleError(_0x5d6b69,null));};exports['createVidaooSession']=function(_0x148fd9,_0x26cb76){var _0x374f0b=_0x148fd9[_0x0a9e('0xb2')]['id'];var _0x5d0e1f;var _0x19e9ed;var _0x1a0b08;return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x374f0b}})[_0x0a9e('0x14')](function(_0x270df8){_0x5d0e1f=_0x270df8;return db[_0x0a9e('0xb8')]['findOne']({'where':{'id':_0x270df8[_0x0a9e('0x79')]},'attributes':['id',_0x0a9e('0xb9'),_0x0a9e('0xba'),_0x0a9e('0xbb'),_0x0a9e('0xbc'),'vidaooMetadata'],'raw':!![]});})[_0x0a9e('0x14')](function(_0x289e65){if(_0x289e65&&_0x289e65['vidaooApiKey']&&_0x289e65[_0x0a9e('0xba')]){_0x19e9ed=_0x289e65;var _0x1fcfe6={'interaction':{'id':_0x374f0b},'agent':{'id':_0x148fd9[_0x0a9e('0x94')]['id'],'name':_0x148fd9['user']['name'],'fullname':_0x148fd9['user'][_0x0a9e('0x31')],'email':_0x148fd9[_0x0a9e('0x94')]['email']},'contact':_0x148fd9[_0x0a9e('0x2c')][_0x0a9e('0x2d')],'account':_0x148fd9[_0x0a9e('0x2c')]['account']};var _0x9fc93e={'rejectUnauthorized':![],'method':_0x0a9e('0xbd'),'url':_0x0a9e('0xbe'),'headers':{'X-APIKEY':_0x289e65[_0x0a9e('0xb9')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x148fd9[_0x0a9e('0x94')][_0x0a9e('0xbf')]],'buttons':null,'topic':_0x19e9ed[_0x0a9e('0xbb')],'note':_[_0x0a9e('0xc0')](_0x19e9ed[_0x0a9e('0xbc')])?null:getMustacheRender(_0x19e9ed['vidaooNote'],_0x1fcfe6),'metadata':null},'redirect':_0x0a9e('0xc1'),'json':!![]};try{if(!_['isNull'](_0x19e9ed[_0x0a9e('0xc2')])){var _0x4093e6=getMustacheRender(_0x19e9ed[_0x0a9e('0xc2')],_0x1fcfe6);var _0x3cf222=JSON[_0x0a9e('0x7d')](_0x4093e6);_0x9fc93e[_0x0a9e('0x2c')]['metadata']=_0x3cf222;}}catch(_0x1a0314){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))](_0x0a9e('0xc5'));}return rp(_0x9fc93e);}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xc6'));}})[_0x0a9e('0x14')](function(_0x1c9539){_0x1a0b08=_0x1c9539;if(_0x1a0b08['id']){var _0xc2e7b={'body':_0x1a0b08[_0x0a9e('0xc7')],'ChatWebsiteId':_0x19e9ed['id'],'ChatInteractionId':_0x5d0e1f['id'],'direction':_0x0a9e('0xc8'),'UserId':_0x148fd9[_0x0a9e('0x94')]['id']};return db[_0x0a9e('0xc9')][_0x0a9e('0xb6')](_0xc2e7b,{});}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xca'));}})[_0x0a9e('0x14')](function(){return _0x5d0e1f[_0x0a9e('0xcb')]({'vidaooSessionId':_0x1a0b08['id']});})[_0x0a9e('0x14')](respondWithResult(_0x26cb76,null))[_0x0a9e('0x37')](handleError(_0x26cb76,null));};exports[_0x0a9e('0xcc')]=function(_0x20ae21,_0x566b90){if(_0x20ae21[_0x0a9e('0x2c')]['id']){delete _0x20ae21[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x20ae21[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69')}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x566b90,null))[_0x0a9e('0x14')](saveUpdates(_0x20ae21[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x566b90,null))[_0x0a9e('0x37')](handleError(_0x566b90,null));};exports[_0x0a9e('0xce')]=function(_0x451010,_0x5a7dad){if(_0x451010[_0x0a9e('0x2c')]['id']){delete _0x451010[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x451010[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](function(_0x5cb48d){if(!_0x5cb48d){logger[_0x0a9e('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x5a7dad[_0x0a9e('0x1c')](0x194);}else{if(_0x5cb48d[_0x0a9e('0x3d')]){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))]('Interaction\x20already\x20assigned');}}return _0x5cb48d;})[_0x0a9e('0x14')](function(_0x309fa9){if(_0x309fa9){return _0x309fa9[_0x0a9e('0x26')]({'closed':_0x451010[_0x0a9e('0x2c')][_0x0a9e('0x3c')],'disposition':_0x451010['body']['disposition']})[_0x0a9e('0x14')](function(_0x33bcb2){return _0x33bcb2;});}})[_0x0a9e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x0a9e('0xce'),_0x451010[_0x0a9e('0x2c')],client9004);})[_0x0a9e('0x14')](respondWithResult(_0x5a7dad,null))['catch'](handleError(_0x5a7dad,null));};exports[_0x0a9e('0xcf')]=function(_0x2bf85d,_0x15ba6b){_0x2bf85d['body'][_0x0a9e('0x29')]=_0x2bf85d[_0x0a9e('0xd0')][_0x0a9e('0xd1')];_0x2bf85d['body']['basename']=_0x2bf85d['file'][_0x0a9e('0xd2')];_0x2bf85d[_0x0a9e('0x2c')][_0x0a9e('0x6f')]=_0x2bf85d[_0x0a9e('0xd0')]['mimetype'];return db[_0x0a9e('0xd3')]['create'](_0x2bf85d[_0x0a9e('0x2c')])[_0x0a9e('0x14')](respondWithResult(_0x15ba6b,0xc9))[_0x0a9e('0x37')](handleError(_0x15ba6b,null));};exports['attachmentDownload']=function(_0x33b4b3,_0x33a26c){return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x33b4b3[_0x0a9e('0xb2')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33a26c,null))[_0x0a9e('0x14')](function(_0x5c57e1){if(_0x5c57e1){if(_0x5c57e1[_0x0a9e('0x3c')]){return _0x33a26c['status'](0x193)[_0x0a9e('0x1f')]({'status':0x193,'message':_0x0a9e('0xd4')});}return db[_0x0a9e('0xd3')][_0x0a9e('0xd5')]({'where':{'id':_0x33b4b3[_0x0a9e('0x47')][_0x0a9e('0xd6')]},'raw':!![]})[_0x0a9e('0x14')](handleEntityNotFound(_0x33a26c,null));}})['then'](function(_0x35ace3){if(_0x35ace3){var _0x1c9ea2=_0x35ace3['ChatOfflineMessageId']!==null;var _0xf4fb77=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0xd8'));if(_0x1c9ea2){_0xf4fb77=path[_0x0a9e('0xd7')](_0xf4fb77,_0x0a9e('0xd9'));}var _0x569528=path[_0x0a9e('0xd7')](_0xf4fb77,_0x35ace3[_0x0a9e('0xda')]);return _0x33a26c[_0x0a9e('0xdb')](_0x569528);}})[_0x0a9e('0x37')](handleError(_0x33a26c,null));};exports[_0x0a9e('0xdc')]=function(_0x29fdfe,_0x3ba897){var _0x74d9b8=null;var _0x22767f=null;var _0x426c3c=null;if(_0x29fdfe['body']['id']){delete _0x29fdfe[_0x0a9e('0x2c')]['id'];}if(_0x29fdfe['body'][_0x0a9e('0xdd')]){_0x426c3c=path[_0x0a9e('0xd7')](config[_0x0a9e('0xde')],_0x0a9e('0xdf'),util[_0x0a9e('0xe0')](_0x0a9e('0xe1'),Date['now']()));_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe2')]=_0x426c3c;}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x29fdfe[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xe3'),'include':[{'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74')}]}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x3ba897,null))[_0x0a9e('0x14')](saveUpdates(_0x29fdfe['body'],null))[_0x0a9e('0x14')](function(_0x228c10){if(_0x228c10){_0x74d9b8=_0x228c10;return db[_0x0a9e('0xb8')][_0x0a9e('0x64')]({'where':{'id':_0x74d9b8[_0x0a9e('0x79')]}});}})[_0x0a9e('0x14')](function(_0x8120e){if(_0x8120e){_0x22767f=_0x8120e;return db['CmContact']['find']({'where':{'id':_0x74d9b8[_0x0a9e('0x6d')]}});}})[_0x0a9e('0x14')](function(_0x1f4929){if(_0x1f4929){if(_0x426c3c){var _0x1bf692=null;for(var _0x40e2da=0x1;_0x40e2da<_0x74d9b8[_0x0a9e('0xe3')][_0x0a9e('0x4d')];++_0x40e2da){_0x1bf692=_0x74d9b8['Messages'][_0x40e2da];var _0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');var _0x54f0b8=_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe7')]||util[_0x0a9e('0xe0')]('%s%d',_0x0a9e('0xe8'),_0x1bf692[_0x0a9e('0x6d')]);switch(_0x22767f[_0x0a9e('0xe9')]){case _0x0a9e('0xea'):_0x39ea62=_0x1bf692['UserId']?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');break;case _0x0a9e('0xeb'):_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?_0x1bf692[_0x0a9e('0x74')]['alias']||_0x1bf692[_0x0a9e('0x74')][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;case _0x0a9e('0xec'):_0x39ea62=_0x1bf692['UserId']?_0x1bf692['User'][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;default:_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util['format'](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692['UserId']):_0x0a9e('0xe6');}var _0x5d19b1=util[_0x0a9e('0xe0')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1bf692['createdAt'])['format'](_0x0a9e('0xed')),_0x1bf692[_0x0a9e('0xee')]==='in'?_0x54f0b8:_0x39ea62,_0x1bf692[_0x0a9e('0x2c')]);if(!_0x1bf692[_0x0a9e('0xef')]){fs[_0x0a9e('0xf0')](_0x426c3c,_0x5d19b1);}}return db[_0x0a9e('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0a9e('0xf2')],'as':_0x0a9e('0xf3'),'raw':!![],'include':[{'model':db[_0x0a9e('0xf4')],'as':_0x0a9e('0xf4'),'raw':!![]}]}]});}}})[_0x0a9e('0x14')](function(_0x18dccf){if(!_0x18dccf||!_0x18dccf[_0x0a9e('0xf3')]||!_0x29fdfe['body'])return _0x74d9b8;var _0x49baaa=_0x18dccf[_0x0a9e('0xf5')]();return respondWithRpcPromise('SendMail',_0x0a9e('0xf6'),{'account':_0x49baaa,'message':{'from':util[_0x0a9e('0xe0')](_0x0a9e('0xf7'),_0x18dccf[_0x0a9e('0x29')],_0x18dccf[_0x0a9e('0xbf')]||_0x18dccf[_0x0a9e('0xf3')]['user']),'to':_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x0a9e('0xe0')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript']),'attachments':[{'path':_0x426c3c}]}})['then'](function(){return _0x74d9b8;})[_0x0a9e('0x37')](function(_0x4a7a3c){logger[_0x0a9e('0x19')](_0x4a7a3c);});})[_0x0a9e('0x14')](respondWithStatusCode(_0x3ba897,0xc8))[_0x0a9e('0x37')](handleError(_0x3ba897,null));};exports['addMessage']=function(_0x4152cd,_0x1209c4){return db[_0x0a9e('0xc9')]['find']({'where':{'id':_0x4152cd['params']['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1209c4,null))[_0x0a9e('0x14')](function(_0x89d2cb){if(_0x89d2cb){return _0x89d2cb[_0x0a9e('0xf8')](_0x4152cd[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x4152cd[_0x0a9e('0x2c')],[_0x0a9e('0xf9'),'id'])||{});}})[_0x0a9e('0x14')](respondWithResult(_0x1209c4,null))['catch'](handleError(_0x1209c4,null));};exports['getMessages']=function(_0x558171,_0x5975fa){var _0x19dcc2={'raw':![],'where':{}};var _0x2ce30f={};var _0x2d21c7={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x558171[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5975fa,null))['then'](function(_0x5c3ecf){if(_0x5c3ecf){_0x2ce30f[_0x0a9e('0x4a')]=_[_0x0a9e('0x76')](db['ChatMessage'][_0x0a9e('0x44')]);_0x2ce30f[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x558171[_0x0a9e('0x47')]);_0x2ce30f[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],_0x2ce30f[_0x0a9e('0x47')]);_0x19dcc2[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x558171['query'][_0x0a9e('0x4c')]));_0x19dcc2[_0x0a9e('0x4b')]=_0x19dcc2[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x19dcc2[_0x0a9e('0x4b')]:_0x2ce30f[_0x0a9e('0x4a')];if(!_0x558171[_0x0a9e('0x47')][_0x0a9e('0xfb')](_0x0a9e('0x4e'))){_0x19dcc2[_0x0a9e('0x22')]=qs[_0x0a9e('0x22')](_0x558171[_0x0a9e('0x47')]['limit']);_0x19dcc2['offset']=qs[_0x0a9e('0x20')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x19dcc2[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x19dcc2['where']=qs[_0x0a9e('0x48')](_['pick'](_0x558171[_0x0a9e('0x47')],_0x2ce30f[_0x0a9e('0x48')]));_0x19dcc2[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x5c3ecf['id'];if(_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x19dcc2[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x19dcc2[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x19dcc2[_0x0a9e('0x4b')],function(_0x8231e5){var _0x43111e={};_0x43111e[_0x8231e5]={'$like':'%'+_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x43111e;})});}if(_0x558171[_0x0a9e('0x47')]['$gte']){var _0x54cf62=_0x558171[_0x0a9e('0x47')][_0x0a9e('0x7e')]['split'](',');var _0x5500de={};_0x5500de[_0x54cf62[0x0]]={'$gte':moment(_0x54cf62[0x1])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))};_0x19dcc2[_0x0a9e('0x7a')]=_['merge'](_0x19dcc2[_0x0a9e('0x7a')],_0x5500de);}_0x19dcc2=_['merge']({},_0x19dcc2,_0x558171[_0x0a9e('0xb5')]);return db['ChatMessage'][_0x0a9e('0x23')]({'where':_0x19dcc2['where']})[_0x0a9e('0x14')](function(_0x21e210){_0x2d21c7[_0x0a9e('0x23')]=_0x21e210;if(_0x558171['query'][_0x0a9e('0xb3')]){_0x19dcc2['include']=[{'all':!![]}];}return db['ChatMessage'][_0x0a9e('0xfe')](_0x19dcc2);})[_0x0a9e('0x14')](function(_0x3c691f){_0x2d21c7[_0x0a9e('0xb1')]=_0x3c691f;return _0x2d21c7;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x5975fa,_0x19dcc2))[_0x0a9e('0x37')](handleError(_0x5975fa,null));};exports[_0x0a9e('0xff')]=function(_0x82504f,_0x1a3143){var _0x151f16={'where':{}},_0xd6938={},_0x98bf26={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x82504f[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1a3143,null))[_0x0a9e('0x14')](function(_0x643f66){if(_0x643f66){_0xd6938[_0x0a9e('0x4a')]=_['keys'](db[_0x0a9e('0xc9')][_0x0a9e('0x44')]);_0xd6938[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x82504f['query']);_0xd6938['filters']=_['intersection'](_0xd6938[_0x0a9e('0x4a')],_0xd6938['query']);_0x151f16[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0xd6938[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x151f16[_0x0a9e('0x4b')]=_0x151f16[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x151f16[_0x0a9e('0x4b')]:_0xd6938['model'];if(!_0x82504f[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x151f16['limit']=qs[_0x0a9e('0x22')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x22')]);_0x151f16['offset']=qs[_0x0a9e('0x20')](_0x82504f[_0x0a9e('0x47')]['offset']);}_0x151f16['order']=qs[_0x0a9e('0x50')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x151f16['where']=qs['filters'](_['pick'](_0x82504f[_0x0a9e('0x47')],_0xd6938[_0x0a9e('0x48')]));_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x643f66['id'];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x151f16[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x151f16[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x151f16[_0x0a9e('0x4b')],function(_0x2f4de1){var _0x13215c={};_0x13215c[_0x2f4de1]={'$like':'%'+_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x13215c;})});}_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xef')]=![];if(_0x82504f[_0x0a9e('0x47')]['id']){_0x151f16['where']['id']={'$gt':_0x82504f[_0x0a9e('0x47')]['id']};}_0x151f16=_[_0x0a9e('0x2b')]({},_0x151f16,_0x82504f[_0x0a9e('0xb5')]);return db[_0x0a9e('0xc9')][_0x0a9e('0x23')]({'where':_0x151f16[_0x0a9e('0x7a')]})['then'](function(_0x4739ed){_0x98bf26[_0x0a9e('0x23')]=_0x4739ed;_0x151f16[_0x0a9e('0xb4')]=[];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x100')]){_0x151f16[_0x0a9e('0xb4')][_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id','fullname','alias']});}if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x151f16['include']=[{'all':!![]}];}return db[_0x0a9e('0xc9')][_0x0a9e('0xfe')](_0x151f16);})['then'](function(_0x1ca7c8){_0x98bf26['rows']=_0x1ca7c8;return _0x98bf26;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x1a3143,_0x151f16))[_0x0a9e('0x37')](handleError(_0x1a3143,null));};exports['addTags']=function(_0x27a41c,_0x31ab12){return db['ChatInteraction'][_0x0a9e('0x64')]({'where':{'id':_0x27a41c[_0x0a9e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x31ab12,null))[_0x0a9e('0x14')](function(_0x237994){if(_0x237994){return _0x237994[_0x0a9e('0x101')](_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x27a41c['body'],[_0x0a9e('0xf9'),'id'])||{})[_0x0a9e('0x102')](function(){return db['Tag'][_0x0a9e('0xfe')]({'attributes':['id',_0x0a9e('0x29'),_0x0a9e('0x103')],'where':{'id':_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')]}});})[_0x0a9e('0x14')](function(_0x368a12){socket['emit']('chatInteractionTags:save',{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]});return{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]};});}})['then'](respondWithResult(_0x31ab12,null))[_0x0a9e('0x37')](handleError(_0x31ab12,null));};exports[_0x0a9e('0x104')]=function(_0x556344,_0x5c23aa){return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x556344[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5c23aa,null))[_0x0a9e('0x14')](function(_0x175c97){if(_0x175c97){return _0x175c97[_0x0a9e('0x104')](_0x556344[_0x0a9e('0x47')]['ids']);}})[_0x0a9e('0x14')](respondWithStatusCode(_0x5c23aa,null))[_0x0a9e('0x37')](handleError(_0x5c23aa,null));};exports['download']=function(_0x44cdb8,_0x1c0d54){var _0x2e0e9b=moment()[_0x0a9e('0x105')]()[_0x0a9e('0x99')]();var _0x2f1cc0=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0x106'),'files',_0x0a9e('0x107'));var _0xd456e6=path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'files',_0x0a9e('0x108'));var _0x4e03f5=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x2e0e9b);var _0x9c686f=util['format'](_0x0a9e('0x109'),_0x44cdb8['params']['id'],_0x2e0e9b);var _0x1d046c=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x9c686f);var _0x732141=[];_0x732141[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id',_0x0a9e('0x31')],'raw':!![]});_0x732141['push']({'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69'),'attributes':['id',_0x0a9e('0x10a'),_0x0a9e('0x10b')],'raw':!![]});if(_0x44cdb8[_0x0a9e('0x47')]['attachments']){_0x732141[_0x0a9e('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3a459c=[{'model':db['ChatMessage'],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2c'),'createdAt',_0x0a9e('0xee'),_0x0a9e('0xef'),_0x0a9e('0x84')],'include':_0x732141}];_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0xb8')],'as':_0x0a9e('0x10c'),'attributes':['id',_0x0a9e('0x29')]});_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':'Owner','attributes':['id',_0x0a9e('0x31')]});return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x44cdb8[_0x0a9e('0xb2')]['id']},'include':_0x3a459c})['then'](handleEntityNotFound(_0x1c0d54,null))[_0x0a9e('0x14')](function(_0x439f25){if(_0x439f25){var _0x333d3c=_0x439f25['get']({'plain':!![]});fs[_0x0a9e('0x10d')](_0x4e03f5);var _0x2191c6={'channel':_0x0a9e('0x10e'),'account':_0x333d3c['Account'][_0x0a9e('0x29')],'agent':_0x333d3c['Owner']?_0x333d3c[_0x0a9e('0x10f')][_0x0a9e('0x31')]:_0x0a9e('0x110'),'createdAt':moment(_0x333d3c[_0x0a9e('0x7c')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'closedAt':_0x333d3c['closed']?moment(_0x333d3c[_0x0a9e('0x111')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')]():'','disposition':_0x333d3c[_0x0a9e('0x3f')],'chatInfo':{'browser':_0x333d3c[_0x0a9e('0x112')],'os':_0x333d3c[_0x0a9e('0x113')],'referer':_0x333d3c[_0x0a9e('0x114')],'customerIp':_0x333d3c[_0x0a9e('0x115')],'customerPort':_0x333d3c[_0x0a9e('0x116')]?_0x333d3c[_0x0a9e('0x116')]:_0x0a9e('0x110')},'messages':_(_0x333d3c[_0x0a9e('0xe3')])[_0x0a9e('0x117')]()[_0x0a9e('0x87')]({'secret':![]})[_0x0a9e('0x42')](function(_0x1008a1){if(_0x1008a1[_0x0a9e('0xd3')]){var _0x6276a4=path[_0x0a9e('0xd7')](_0xd456e6,_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]);if(fs[_0x0a9e('0x118')](_0x6276a4)){fs['createReadStream'](_0x6276a4)[_0x0a9e('0x119')](fs[_0x0a9e('0x11a')](path[_0x0a9e('0xd7')](_0x4e03f5,_0x1008a1['Attachment'][_0x0a9e('0xda')])));}}return{'date':moment(_0x1008a1['createdAt'])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'sender':_0x1008a1[_0x0a9e('0xee')]===_0x0a9e('0xc8')?_0x1008a1[_0x0a9e('0x74')]?_0x1008a1[_0x0a9e('0x74')][_0x0a9e('0x31')]:'System':_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10a')]+(_0x1008a1['Contact'][_0x0a9e('0x10b')]?'\x20'+_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10b')]:''),'body':_0x1008a1['Attachment']?_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]:_0x1008a1[_0x0a9e('0x2c')],'direction':_0x1008a1[_0x0a9e('0xee')]==='out'?'A':'C','secret':_0x1008a1[_0x0a9e('0xef')],'read':_0x1008a1[_0x0a9e('0x84')],'attachment':_0x1008a1[_0x0a9e('0xd3')]};})[_0x0a9e('0x6b')]()};return ejs[_0x0a9e('0x11b')](path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'views',_0x0a9e('0x11c')),{'interaction':_0x2191c6})[_0x0a9e('0x14')](function(_0x38284a){var _0x54246a=path['join'](_0x4e03f5,_0x0a9e('0x11d')+_0x333d3c['id']+'-'+_0x2e0e9b+_0x0a9e('0x11e'));var _0x271485={'path':_0x54246a,'channel':_0x0a9e('0x10e'),'interactionId':_0x333d3c['id']};return pdf[_0x0a9e('0x11f')](_0x38284a,_0x271485);})[_0x0a9e('0x14')](function(){return new Promise(function(_0x312e02,_0x221274){zipdir(_0x4e03f5,{'saveTo':_0x1d046c},function(_0x54c9d6,_0x5cc8cb){if(_0x54c9d6)return _0x221274(_0x54c9d6);return _0x312e02(_0x5cc8cb);});})[_0x0a9e('0x14')](function(){return new BPromise(function(_0x5330c2,_0x803bc){rimraf(_0x4e03f5,function(_0xef29b6){if(_0xef29b6)_0x803bc(_0xef29b6);return _0x5330c2();});});})[_0x0a9e('0x14')](function(){return _0x1c0d54[_0x0a9e('0xdb')](_0x1d046c,_0x9c686f,function(_0x57b11b){if(_0x57b11b){logger[_0x0a9e('0x19')](_0x0a9e('0x120'),_0x57b11b);}else{fs['unlinkSync'](_0x1d046c);}});});});}else{return _0x1c0d54[_0x0a9e('0x1c')](0xc8);}})['catch'](handleError(_0x1c0d54,null));};
\ No newline at end of file
index e9e9d93..fa4a4e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1006=['remove','getUsers','setDataValue','Users','map','then','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1006,0xd7));var _0x6100=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x1006[_0x21549c];return _0x426cbd;};'use strict';var EventEmitter=require(_0x6100('0x0'));var ChatInteraction=require(_0x6100('0x1'))['db'][_0x6100('0x2')];var ChatMessage=require(_0x6100('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6100('0x3')](0x0);var events={'afterCreate':_0x6100('0x4'),'afterUpdate':_0x6100('0x5'),'afterDestroy':_0x6100('0x6')};function emitEvent(_0x19889c){return function(_0x5bb3ce,_0x36901b,_0x2bc9c5){_0x5bb3ce[_0x6100('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2478e9){_0x5bb3ce[_0x6100('0x8')](_0x6100('0x9'),_0x2478e9[_0x6100('0xa')](function(_0xf32b44){return{'id':_0xf32b44['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5bb3ce['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6100('0xb')](function(_0x5471f8){_0x5bb3ce['setDataValue'](_0x6100('0xc'),_0x5471f8['length']);ChatInteractionEvents[_0x6100('0xd')](_0x19889c+':'+_0x5bb3ce['id'],_0x5bb3ce);ChatInteractionEvents['emit'](_0x19889c,_0x5bb3ce);_0x2bc9c5(null);})['catch'](_0x2bc9c5(null));};}for(var e in events){if(events[_0x6100('0xe')](e)){var event=events[e];ChatInteraction[_0x6100('0xf')](e,emitEvent(event));}}module[_0x6100('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x105b=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch'];(function(_0x59f9cb,_0x505279){var _0x5b250c=function(_0x54137c){while(--_0x54137c){_0x59f9cb['push'](_0x59f9cb['shift']());}};_0x5b250c(++_0x505279);}(_0x105b,0x1a1));var _0xb105=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x105b[_0x2b5eae];return _0x5f3ac9;};'use strict';var EventEmitter=require(_0xb105('0x0'));var ChatInteraction=require(_0xb105('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xb105('0x1'))['db'][_0xb105('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb105('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb105('0x4'),'afterDestroy':_0xb105('0x5')};function emitEvent(_0x4f67e1){return function(_0x462402,_0x2f7284,_0x1aa31b){_0x462402[_0xb105('0x6')]({'attributes':['id'],'raw':!![]})[_0xb105('0x7')](function(_0x295309){_0x462402['setDataValue'](_0xb105('0x8'),_0x295309[_0xb105('0x9')](function(_0x3c19d8){return{'id':_0x3c19d8['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x462402['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x148467){_0x462402[_0xb105('0xa')](_0xb105('0xb'),_0x148467[_0xb105('0xc')]);ChatInteractionEvents[_0xb105('0xd')](_0x4f67e1+':'+_0x462402['id'],_0x462402);ChatInteractionEvents[_0xb105('0xd')](_0x4f67e1,_0x462402);_0x1aa31b(null);})[_0xb105('0xe')](_0x1aa31b(null));};}for(var e in events){if(events[_0xb105('0xf')](e)){var event=events[e];ChatInteraction[_0xb105('0x10')](e,emitEvent(event));}}module[_0xb105('0x11')]=ChatInteractionEvents;
\ No newline at end of file
index dacc28a..b6ab5c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6a0=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatInteraction.attributes','define','chat_interactions','changed','closed'];(function(_0x2e86ff,_0x9b131c){var _0x2961bb=function(_0x17fa65){while(--_0x17fa65){_0x2e86ff['push'](_0x2e86ff['shift']());}};_0x2961bb(++_0x9b131c);}(_0xd6a0,0x84));var _0x0d6a=function(_0x3ba2aa,_0x4ddb0d){_0x3ba2aa=_0x3ba2aa-0x0;var _0x49430f=_0xd6a0[_0x3ba2aa];return _0x49430f;};'use strict';var _=require(_0x0d6a('0x0'));var util=require(_0x0d6a('0x1'));var logger=require(_0x0d6a('0x2'))(_0x0d6a('0x3'));var moment=require('moment');var BPromise=require(_0x0d6a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0d6a('0x5'));var config=require(_0x0d6a('0x6'));var attributes=require(_0x0d6a('0x7'));module['exports']=function(_0x4d85f2,_0x43bae2){return _0x4d85f2[_0x0d6a('0x8')]('ChatInteraction',attributes,{'tableName':_0x0d6a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x238d7e,_0x2bf24c,_0x37d69d){if(_0x238d7e[_0x0d6a('0xa')](_0x0d6a('0xb'))){_0x238d7e[_0x0d6a('0xc')]=moment()[_0x0d6a('0xd')](_0x0d6a('0xe'));}_0x37d69d(null,_0x238d7e);}},'charset':'utf8mb4','collate':_0x0d6a('0xf')});};
\ No newline at end of file
+var _0x74f7=['../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x335014,_0x1a877c){var _0x5bac6d=function(_0x20a00c){while(--_0x20a00c){_0x335014['push'](_0x335014['shift']());}};_0x5bac6d(++_0x1a877c);}(_0x74f7,0xd6));var _0x774f=function(_0x45c6bb,_0x2cacae){_0x45c6bb=_0x45c6bb-0x0;var _0x3d6a3f=_0x74f7[_0x45c6bb];return _0x3d6a3f;};'use strict';var _=require(_0x774f('0x0'));var util=require(_0x774f('0x1'));var logger=require(_0x774f('0x2'))(_0x774f('0x3'));var moment=require(_0x774f('0x4'));var BPromise=require('bluebird');var rp=require(_0x774f('0x5'));var fs=require('fs');var path=require(_0x774f('0x6'));var rimraf=require('rimraf');var config=require(_0x774f('0x7'));var attributes=require(_0x774f('0x8'));module[_0x774f('0x9')]=function(_0x5048cf,_0x2b297f){return _0x5048cf[_0x774f('0xa')](_0x774f('0xb'),attributes,{'tableName':_0x774f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e0435,_0x1cbd56,_0x949cc3){if(_0x3e0435[_0x774f('0xd')]('closed')){_0x3e0435[_0x774f('0xe')]=moment()[_0x774f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x949cc3(null,_0x3e0435);}},'charset':_0x774f('0x10'),'collate':_0x774f('0x11')});};
\ No newline at end of file
index cbb5181..60f31b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa45b=['message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','then','AddTagsToChatInteraction','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x46ca3d,_0x360bad){var _0x3c195e=function(_0x394f9c){while(--_0x394f9c){_0x46ca3d['push'](_0x46ca3d['shift']());}};_0x3c195e(++_0x360bad);}(_0xa45b,0x1e9));var _0xba45=function(_0x36dd85,_0x35d11b){_0x36dd85=_0x36dd85-0x0;var _0xa4459b=_0xa45b[_0x36dd85];return _0xa4459b;};'use strict';var _=require(_0xba45('0x0'));var util=require(_0xba45('0x1'));var moment=require(_0xba45('0x2'));var BPromise=require(_0xba45('0x3'));var rs=require(_0xba45('0x4'));var fs=require('fs');var Redis=require(_0xba45('0x5'));var db=require(_0xba45('0x6'))['db'];var utils=require(_0xba45('0x7'));var logger=require(_0xba45('0x8'))(_0xba45('0x9'));var config=require(_0xba45('0xa'));var jayson=require(_0xba45('0xb'));var client=jayson['client'][_0xba45('0xc')]({'port':0x232a});config[_0xba45('0xd')]=_[_0xba45('0xe')](config[_0xba45('0xd')],{'host':_0xba45('0xf'),'port':0x18eb});var socket=require(_0xba45('0x10'))(new Redis(config[_0xba45('0xd')]));require(_0xba45('0x11'))['register'](socket);function respondWithRpcPromise(_0x4695e5,_0x4ed8fa,_0x2dfa4d){return new BPromise(function(_0x55f79f,_0x271e32){return client[_0xba45('0x12')](_0x4695e5,_0x2dfa4d)['then'](function(_0x9d0345){logger[_0xba45('0x13')](_0xba45('0x14'),_0x4ed8fa,_0xba45('0x15'));logger[_0xba45('0x16')](_0xba45('0x17'),_0x4ed8fa,_0xba45('0x15'),JSON[_0xba45('0x18')](_0x9d0345));if(_0x9d0345['error']){if(_0x9d0345[_0xba45('0x19')][_0xba45('0x1a')]===0x1f4){logger[_0xba45('0x19')](_0xba45('0x14'),_0x4ed8fa,_0x9d0345['error']['message']);return _0x271e32(_0x9d0345[_0xba45('0x19')]['message']);}logger[_0xba45('0x19')](_0xba45('0x14'),_0x4ed8fa,_0x9d0345[_0xba45('0x19')][_0xba45('0x1b')]);return _0x55f79f(_0x9d0345[_0xba45('0x19')]['message']);}else{logger[_0xba45('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x4ed8fa,_0xba45('0x15'));_0x55f79f(_0x9d0345[_0xba45('0x1c')][_0xba45('0x1b')]);}})[_0xba45('0x1d')](function(_0x2205e8){logger[_0xba45('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x4ed8fa,_0x2205e8);_0x271e32(_0x2205e8);});});}exports[_0xba45('0x1e')]=function(_0xe5c1c2){var _0x5149b4=this;return new Promise(function(_0x2773d7,_0x3e5ee9){return db[_0xba45('0x1f')][_0xba45('0x20')](_0xe5c1c2[_0xba45('0x21')],{'raw':_0xe5c1c2[_0xba45('0x22')]?_0xe5c1c2[_0xba45('0x22')][_0xba45('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe5c1c2['options']?_0xe5c1c2[_0xba45('0x22')][_0xba45('0x24')]||null:null,'attributes':_0xe5c1c2[_0xba45('0x22')]?_0xe5c1c2[_0xba45('0x22')][_0xba45('0x25')]||null:null,'limit':_0xe5c1c2['options']?_0xe5c1c2['options']['limit']||null:null})[_0xba45('0x26')](function(_0x5ea118){logger[_0xba45('0x13')](_0xba45('0x1e'),_0xe5c1c2);logger[_0xba45('0x16')]('UpdateChatInteraction',_0xe5c1c2,JSON['stringify'](_0x5ea118));_0x2773d7(_0x5ea118);})['catch'](function(_0x485d6d){logger[_0xba45('0x19')](_0xba45('0x1e'),_0x485d6d['message'],_0xe5c1c2);_0x3e5ee9(_0x5149b4[_0xba45('0x19')](0x1f4,_0x485d6d[_0xba45('0x1b')]));});});};exports[_0xba45('0x27')]=function(_0x1f2824){return new Promise(function(_0x45d686,_0x263925){return db['ChatInteraction']['find']({'where':_0x1f2824[_0xba45('0x22')]?_0x1f2824[_0xba45('0x22')]['where']||null:null})[_0xba45('0x26')](function(_0x561bfd){if(_0x561bfd){return _0x561bfd['addTags'](_0x1f2824['body'][_0xba45('0x28')],_[_0xba45('0x29')](_0x1f2824['body'],['ids','id'])||{});}})['spread'](function(_0x336127){logger[_0xba45('0x13')](_0xba45('0x2a'),_0x1f2824);logger[_0xba45('0x16')]('AddTags',_0x1f2824,JSON[_0xba45('0x18')](_0x336127));_0x45d686(_0x336127);})[_0xba45('0x1d')](function(_0x444a50){logger['error'](_0xba45('0x2a'),_0x444a50['message'],_0x1f2824);_0x263925(_this[_0xba45('0x19')](0x1f4,_0x444a50[_0xba45('0x1b')]));});});};
\ No newline at end of file
+var _0xabd8=['message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','attributes','AddTagsToChatInteraction','find','where','addTags','omit','ids','spread','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x172660,_0x260d9b){var _0x83204f=function(_0x4d6c80){while(--_0x4d6c80){_0x172660['push'](_0x172660['shift']());}};_0x83204f(++_0x260d9b);}(_0xabd8,0xb4));var _0x8abd=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0xabd8[_0x2df724];return _0x1b2504;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8abd('0x0'));var rs=require(_0x8abd('0x1'));var fs=require('fs');var Redis=require(_0x8abd('0x2'));var db=require(_0x8abd('0x3'))['db'];var utils=require(_0x8abd('0x4'));var logger=require(_0x8abd('0x5'))('rpc');var config=require(_0x8abd('0x6'));var jayson=require(_0x8abd('0x7'));var client=jayson[_0x8abd('0x8')][_0x8abd('0x9')]({'port':0x232a});config[_0x8abd('0xa')]=_[_0x8abd('0xb')](config[_0x8abd('0xa')],{'host':_0x8abd('0xc'),'port':0x18eb});var socket=require(_0x8abd('0xd'))(new Redis(config['redis']));require(_0x8abd('0xe'))['register'](socket);function respondWithRpcPromise(_0x5e694e,_0x400379,_0x2bd7fd){return new BPromise(function(_0x5e40f1,_0x18bdb1){return client[_0x8abd('0xf')](_0x5e694e,_0x2bd7fd)[_0x8abd('0x10')](function(_0x5c5f33){logger[_0x8abd('0x11')](_0x8abd('0x12'),_0x400379,_0x8abd('0x13'));logger[_0x8abd('0x14')](_0x8abd('0x15'),_0x400379,_0x8abd('0x13'),JSON[_0x8abd('0x16')](_0x5c5f33));if(_0x5c5f33[_0x8abd('0x17')]){if(_0x5c5f33['error'][_0x8abd('0x18')]===0x1f4){logger['error'](_0x8abd('0x12'),_0x400379,_0x5c5f33['error']['message']);return _0x18bdb1(_0x5c5f33['error']['message']);}logger[_0x8abd('0x17')](_0x8abd('0x12'),_0x400379,_0x5c5f33['error'][_0x8abd('0x19')]);return _0x5e40f1(_0x5c5f33[_0x8abd('0x17')]['message']);}else{logger[_0x8abd('0x11')](_0x8abd('0x12'),_0x400379,_0x8abd('0x13'));_0x5e40f1(_0x5c5f33[_0x8abd('0x1a')][_0x8abd('0x19')]);}})[_0x8abd('0x1b')](function(_0x1a7496){logger[_0x8abd('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x400379,_0x1a7496);_0x18bdb1(_0x1a7496);});});}exports[_0x8abd('0x1c')]=function(_0x17db38){var _0x15b996=this;return new Promise(function(_0x44c3f6,_0x368398){return db[_0x8abd('0x1d')]['update'](_0x17db38[_0x8abd('0x1e')],{'raw':_0x17db38[_0x8abd('0x1f')]?_0x17db38['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17db38['options']?_0x17db38['options']['where']||null:null,'attributes':_0x17db38[_0x8abd('0x1f')]?_0x17db38[_0x8abd('0x1f')][_0x8abd('0x20')]||null:null,'limit':_0x17db38[_0x8abd('0x1f')]?_0x17db38[_0x8abd('0x1f')]['limit']||null:null})['then'](function(_0x510444){logger[_0x8abd('0x11')](_0x8abd('0x1c'),_0x17db38);logger[_0x8abd('0x14')](_0x8abd('0x1c'),_0x17db38,JSON['stringify'](_0x510444));_0x44c3f6(_0x510444);})[_0x8abd('0x1b')](function(_0x1240b4){logger[_0x8abd('0x17')]('UpdateChatInteraction',_0x1240b4['message'],_0x17db38);_0x368398(_0x15b996[_0x8abd('0x17')](0x1f4,_0x1240b4[_0x8abd('0x19')]));});});};exports[_0x8abd('0x21')]=function(_0x2ab81f){return new Promise(function(_0x283931,_0x482e42){return db[_0x8abd('0x1d')][_0x8abd('0x22')]({'where':_0x2ab81f[_0x8abd('0x1f')]?_0x2ab81f['options'][_0x8abd('0x23')]||null:null})[_0x8abd('0x10')](function(_0x4acc05){if(_0x4acc05){return _0x4acc05[_0x8abd('0x24')](_0x2ab81f['body']['ids'],_[_0x8abd('0x25')](_0x2ab81f[_0x8abd('0x1e')],[_0x8abd('0x26'),'id'])||{});}})[_0x8abd('0x27')](function(_0x1edd2d){logger[_0x8abd('0x11')](_0x8abd('0x28'),_0x2ab81f);logger[_0x8abd('0x14')](_0x8abd('0x28'),_0x2ab81f,JSON[_0x8abd('0x16')](_0x1edd2d));_0x283931(_0x1edd2d);})[_0x8abd('0x1b')](function(_0x38c3b0){logger[_0x8abd('0x17')](_0x8abd('0x28'),_0x38c3b0[_0x8abd('0x19')],_0x2ab81f);_0x482e42(_this[_0x8abd('0x17')](0x1f4,_0x38c3b0[_0x8abd('0x19')]));});});};
\ No newline at end of file
index a368406..36da862 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae0c=['emit','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae0c,0x97));var _0xcae0=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xae0c[_0x19950b];return _0x3c6b41;};'use strict';var ChatInteractionEvents=require(_0xcae0('0x0'));var events=[_0xcae0('0x1'),_0xcae0('0x2'),'update'];function createListener(_0x31335e,_0x11fc8a){return function(_0x55d7ad){_0x11fc8a[_0xcae0('0x3')](_0x31335e,_0x55d7ad);};}function removeListener(_0x33adfb,_0x486041){return function(){ChatInteractionEvents['removeListener'](_0x33adfb,_0x486041);};}exports[_0xcae0('0x4')]=function(_0x53e6f2){for(var _0x511670=0x0,_0x456bd7=events[_0xcae0('0x5')];_0x511670<_0x456bd7;_0x511670++){var _0x2dc31e=events[_0x511670];var _0x1b4a12=createListener(_0xcae0('0x6')+_0x2dc31e,_0x53e6f2);ChatInteractionEvents['on'](_0x2dc31e,_0x1b4a12);}};
\ No newline at end of file
+var _0xaf66=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x534a72,_0x5c02d7){var _0x543cc2=function(_0x1732bf){while(--_0x1732bf){_0x534a72['push'](_0x534a72['shift']());}};_0x543cc2(++_0x5c02d7);}(_0xaf66,0x7f));var _0x6af6=function(_0x34933a,_0x327378){_0x34933a=_0x34933a-0x0;var _0x36abb4=_0xaf66[_0x34933a];return _0x36abb4;};'use strict';var ChatInteractionEvents=require(_0x6af6('0x0'));var events=[_0x6af6('0x1'),_0x6af6('0x2'),_0x6af6('0x3')];function createListener(_0x432c55,_0x577e32){return function(_0x3c6e57){_0x577e32[_0x6af6('0x4')](_0x432c55,_0x3c6e57);};}function removeListener(_0x50c606,_0x13ba75){return function(){ChatInteractionEvents[_0x6af6('0x5')](_0x50c606,_0x13ba75);};}exports[_0x6af6('0x6')]=function(_0x2c5ecd){for(var _0x5a0817=0x0,_0x102ea5=events[_0x6af6('0x7')];_0x5a0817<_0x102ea5;_0x5a0817++){var _0x27993c=events[_0x5a0817];var _0x318904=createListener(_0x6af6('0x8')+_0x27993c,_0x2c5ecd);ChatInteractionEvents['on'](_0x27993c,_0x318904);}};
\ No newline at end of file
index 4605892..f645bc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8178=['close','delete','chatinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','/:id/messages','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close'];(function(_0x511045,_0x10c2dc){var _0xe73397=function(_0x4802b9){while(--_0x4802b9){_0x511045['push'](_0x511045['shift']());}};_0xe73397(++_0x10c2dc);}(_0x8178,0x19e));var _0x8817=function(_0x41ea87,_0x3c961d){_0x41ea87=_0x41ea87-0x0;var _0x5933d0=_0x8178[_0x41ea87];return _0x5933d0;};'use strict';var multer=require(_0x8817('0x0'));var util=require(_0x8817('0x1'));var path=require(_0x8817('0x2'));var timeout=require(_0x8817('0x3'));var express=require(_0x8817('0x4'));var router=express[_0x8817('0x5')]();var fs_extra=require(_0x8817('0x6'));var auth=require(_0x8817('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8817('0x8'));router[_0x8817('0x9')]('/',auth[_0x8817('0xa')](),controller[_0x8817('0xb')]);router[_0x8817('0x9')]('/describe',auth[_0x8817('0xa')](),controller[_0x8817('0xc')]);router['get'](_0x8817('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x8817('0xe')]);router[_0x8817('0x9')](_0x8817('0xf'),auth[_0x8817('0x10')](),controller[_0x8817('0x11')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x8817('0x12')]);router[_0x8817('0x9')](_0x8817('0x13'),auth[_0x8817('0x10')](),controller[_0x8817('0x14')]);router[_0x8817('0x9')]('/:id/download',auth[_0x8817('0xa')](),controller[_0x8817('0x15')]);router[_0x8817('0x16')]('/',auth[_0x8817('0xa')](),controller[_0x8817('0x17')]);router[_0x8817('0x16')](_0x8817('0x18'),auth[_0x8817('0xa')](),controller[_0x8817('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e99a0,_0x503f1d,_0x3af792){_0x3af792(null,path['join'](config['root'],_0x8817('0x1a')));},'filename':function(_0x77d619,_0x1a7df6,_0x3d1256){_0x3d1256(null,util[_0x8817('0x1b')](_0x8817('0x1c'),Date[_0x8817('0x1d')](),_0x1a7df6[_0x8817('0x1e')][_0x8817('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8817('0x16')](_0x8817('0x20'),upload[_0x8817('0x21')]('file'),controller['attachmentUpload']);router[_0x8817('0x16')](_0x8817('0x22'),auth[_0x8817('0x10')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x8817('0xa')](),interaction[_0x8817('0x23')](_0x8817('0x24'),'chatinteraction:addtags'),controller[_0x8817('0x25')]);router[_0x8817('0x26')](_0x8817('0xd'),auth['isAuthenticated'](),interaction[_0x8817('0x23')](_0x8817('0x24'),_0x8817('0x27')),controller[_0x8817('0x28')]);router['put'](_0x8817('0x29'),controller[_0x8817('0x2a')]);router[_0x8817('0x26')](_0x8817('0x2b'),auth[_0x8817('0x10')](),controller['abandon']);router[_0x8817('0x26')](_0x8817('0x2c'),controller[_0x8817('0x2d')]);router[_0x8817('0x2e')](_0x8817('0xd'),auth['isAuthenticated'](),interaction[_0x8817('0x23')](_0x8817('0x24'),_0x8817('0x2f')),controller['destroy']);router[_0x8817('0x2e')](_0x8817('0x30'),auth[_0x8817('0xa')](),controller[_0x8817('0x31')]);module[_0x8817('0x32')]=router;
\ No newline at end of file
+var _0x6ed0=['format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','chat','addTags','put','/:id','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','join','root'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0x6ed0,0x1a6));var _0x06ed=function(_0x1752ae,_0x7983ef){_0x1752ae=_0x1752ae-0x0;var _0x83bebf=_0x6ed0[_0x1752ae];return _0x83bebf;};'use strict';var multer=require(_0x06ed('0x0'));var util=require(_0x06ed('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x06ed('0x2'));var router=express[_0x06ed('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x06ed('0x4'));var interaction=require(_0x06ed('0x5'));var config=require(_0x06ed('0x6'));var controller=require(_0x06ed('0x7'));router[_0x06ed('0x8')]('/',auth[_0x06ed('0x9')](),controller[_0x06ed('0xa')]);router['get'](_0x06ed('0xb'),auth['isAuthenticated'](),controller[_0x06ed('0xc')]);router[_0x06ed('0x8')]('/:id',auth[_0x06ed('0xd')](),controller[_0x06ed('0xe')]);router[_0x06ed('0x8')](_0x06ed('0xf'),auth[_0x06ed('0xd')](),controller[_0x06ed('0x10')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x06ed('0x11')]);router[_0x06ed('0x8')](_0x06ed('0x12'),auth[_0x06ed('0xd')](),controller[_0x06ed('0x13')]);router[_0x06ed('0x8')](_0x06ed('0x14'),auth[_0x06ed('0x9')](),controller['download']);router[_0x06ed('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x06ed('0x15')](_0x06ed('0x16'),auth[_0x06ed('0x9')](),controller[_0x06ed('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3cb53a,_0x23ee20,_0x278301){_0x278301(null,path[_0x06ed('0x18')](config[_0x06ed('0x19')],'server/files/attachments/'));},'filename':function(_0x508676,_0x468867,_0x4ec1e3){_0x4ec1e3(null,util[_0x06ed('0x1a')](_0x06ed('0x1b'),Date[_0x06ed('0x1c')](),_0x468867[_0x06ed('0x1d')][_0x06ed('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x06ed('0x15')](_0x06ed('0x1f'),upload[_0x06ed('0x20')](_0x06ed('0x21')),controller[_0x06ed('0x22')]);router[_0x06ed('0x15')](_0x06ed('0x23'),auth[_0x06ed('0xd')](),controller[_0x06ed('0x24')]);router['post']('/:id/tags',auth[_0x06ed('0x9')](),interaction['tracked'](_0x06ed('0x25'),'chatinteraction:addtags'),controller[_0x06ed('0x26')]);router[_0x06ed('0x27')](_0x06ed('0x28'),auth[_0x06ed('0x9')](),interaction[_0x06ed('0x29')](_0x06ed('0x25'),_0x06ed('0x2a')),controller[_0x06ed('0x2b')]);router['put'](_0x06ed('0x2c'),controller[_0x06ed('0x2d')]);router[_0x06ed('0x27')](_0x06ed('0x2e'),auth[_0x06ed('0xd')](),controller[_0x06ed('0x2f')]);router[_0x06ed('0x27')](_0x06ed('0x30'),controller[_0x06ed('0x31')]);router['delete'](_0x06ed('0x28'),auth[_0x06ed('0x9')](),interaction[_0x06ed('0x29')](_0x06ed('0x25'),_0x06ed('0x32')),controller[_0x06ed('0x33')]);router[_0x06ed('0x34')](_0x06ed('0x35'),auth[_0x06ed('0x9')](),controller[_0x06ed('0x36')]);module[_0x06ed('0x37')]=router;
\ No newline at end of file
index 1021da5..44a74cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ca6=['INTEGER','sequelize','exports','TEXT','BOOLEAN'];(function(_0x503580,_0x359679){var _0x2e39d0=function(_0x1a94b4){while(--_0x1a94b4){_0x503580['push'](_0x503580['shift']());}};_0x2e39d0(++_0x359679);}(_0x1ca6,0xc9));var _0x61ca=function(_0x78cad1,_0xe4df2a){_0x78cad1=_0x78cad1-0x0;var _0x5409c7=_0x1ca6[_0x78cad1];return _0x5409c7;};'use strict';var Sequelize=require(_0x61ca('0x0'));module[_0x61ca('0x1')]={'body':{'type':Sequelize[_0x61ca('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x61ca('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x61ca('0x4')]}};
\ No newline at end of file
+var _0x0101=['TEXT','sequelize','exports'];(function(_0xcde1f0,_0x5638e5){var _0x48bee5=function(_0x31fdb9){while(--_0x31fdb9){_0xcde1f0['push'](_0xcde1f0['shift']());}};_0x48bee5(++_0x5638e5);}(_0x0101,0xdf));var _0x1010=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0101[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1010('0x0'));module[_0x1010('0x1')]={'body':{'type':Sequelize[_0x1010('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 7ef9bfa..89b1081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8973=['attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','get','messages','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','internal','online','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','isEmpty','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','intersection','model','fields'];(function(_0x3b81dc,_0x468d40){var _0x28c81a=function(_0x27c619){while(--_0x27c619){_0x3b81dc['push'](_0x3b81dc['shift']());}};_0x28c81a(++_0x468d40);}(_0x8973,0x10a));var _0x3897=function(_0x1e79bd,_0x616ca5){_0x1e79bd=_0x1e79bd-0x0;var _0x124621=_0x8973[_0x1e79bd];return _0x124621;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3897('0x0'));var zipdir=require(_0x3897('0x1'));var jsonpatch=require(_0x3897('0x2'));var rp=require(_0x3897('0x3'));var moment=require(_0x3897('0x4'));var BPromise=require(_0x3897('0x5'));var Mustache=require(_0x3897('0x6'));var util=require('util');var path=require(_0x3897('0x7'));var sox=require(_0x3897('0x8'));var csv=require(_0x3897('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3897('0xa'));var squel=require(_0x3897('0xb'));var crypto=require('crypto');var jsforce=require(_0x3897('0xc'));var deskjs=require(_0x3897('0xd'));var toCsv=require(_0x3897('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3897('0xe'));var authService=require(_0x3897('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3897('0x10'));var hardwareService=require(_0x3897('0x11'));var logger=require('../../config/logger')(_0x3897('0x12'));var utils=require(_0x3897('0x13'));var config=require(_0x3897('0x14'));var licenseUtil=require(_0x3897('0x15'));var db=require(_0x3897('0x16'))['db'];config[_0x3897('0x17')]=_[_0x3897('0x18')](config[_0x3897('0x17')],{'host':_0x3897('0x19'),'port':0x18eb});var socket=require(_0x3897('0x1a'))(new Redis(config[_0x3897('0x17')]));require(_0x3897('0x1b'))['register'](socket);function respondWithStatusCode(_0x4def6b,_0x1cad12){_0x1cad12=_0x1cad12||0xcc;return function(_0x23d807){if(_0x23d807){return _0x4def6b['sendStatus'](_0x1cad12);}return _0x4def6b[_0x3897('0x1c')](_0x1cad12)[_0x3897('0x1d')]();};}function respondWithResult(_0xbd5a8a,_0x2be144){_0x2be144=_0x2be144||0xc8;return function(_0x3403e3){if(_0x3403e3){return _0xbd5a8a[_0x3897('0x1c')](_0x2be144)[_0x3897('0x1e')](_0x3403e3);}};}function respondWithFilteredResult(_0x2bb7f5,_0x5d8d83){return function(_0xdc3a1e){if(_0xdc3a1e){var _0x1a7024=typeof _0x5d8d83[_0x3897('0x1f')]===_0x3897('0x20')&&typeof _0x5d8d83[_0x3897('0x21')]===_0x3897('0x20');var _0x7430bb=_0xdc3a1e[_0x3897('0x22')];var _0x54a3c3=_0x1a7024?0x0:_0x5d8d83[_0x3897('0x1f')];var _0x8fa026=_0x1a7024?_0xdc3a1e[_0x3897('0x22')]:_0x5d8d83[_0x3897('0x1f')]+_0x5d8d83['limit'];var _0x1cbf90;if(_0x8fa026>=_0x7430bb){_0x8fa026=_0x7430bb;_0x1cbf90=0xc8;}else{_0x1cbf90=0xce;}_0x2bb7f5[_0x3897('0x1c')](_0x1cbf90);return _0x2bb7f5['set'](_0x3897('0x23'),_0x54a3c3+'-'+_0x8fa026+'/'+_0x7430bb)[_0x3897('0x1e')](_0xdc3a1e);}return null;};}function patchUpdates(_0x56e0a6){return function(_0x5166f5){try{jsonpatch[_0x3897('0x24')](_0x5166f5,_0x56e0a6,!![]);}catch(_0x45a20f){return BPromise[_0x3897('0x25')](_0x45a20f);}return _0x5166f5[_0x3897('0x26')]();};}function saveUpdates(_0x2a4c48,_0x2bf298){return function(_0x1399e4){if(_0x1399e4){return _0x1399e4[_0x3897('0x27')](_0x2a4c48)[_0x3897('0x28')](function(_0x5e5309){return _0x5e5309;});}return null;};}function removeEntity(_0x3e14f2,_0x4a3d7a){return function(_0x31d675){if(_0x31d675){return _0x31d675[_0x3897('0x29')]()[_0x3897('0x28')](function(){_0x3e14f2['status'](0xcc)[_0x3897('0x1d')]();});}};}function handleEntityNotFound(_0x5c2b5e,_0x5d2975){return function(_0x15cbbf){if(!_0x15cbbf){_0x5c2b5e[_0x3897('0x2a')](0x194);}return _0x15cbbf;};}function handleError(_0x48c84c,_0x386783){_0x386783=_0x386783||0x1f4;return function(_0x3277d9){logger[_0x3897('0x2b')](_0x3277d9[_0x3897('0x2c')]);if(_0x3277d9['name']){delete _0x3277d9[_0x3897('0x2d')];}_0x48c84c[_0x3897('0x1c')](_0x386783)[_0x3897('0x2e')](_0x3277d9);};}exports[_0x3897('0x2f')]=function(_0x4578c5,_0x3dbc78){var _0x3b7d21={},_0xcdcb19={},_0x2e3acd={'count':0x0,'rows':[]};var _0x4d3d8b=_[_0x3897('0x30')](db[_0x3897('0x31')][_0x3897('0x32')],function(_0x4d5135){return{'name':_0x4d5135['fieldName'],'type':_0x4d5135[_0x3897('0x33')][_0x3897('0x34')]};});_0xcdcb19['model']=_['map'](_0x4d3d8b,'name');_0xcdcb19[_0x3897('0x35')]=_[_0x3897('0x36')](_0x4578c5[_0x3897('0x35')]);_0xcdcb19['filters']=_[_0x3897('0x37')](_0xcdcb19['model'],_0xcdcb19[_0x3897('0x35')]);_0x3b7d21['attributes']=_['intersection'](_0xcdcb19[_0x3897('0x38')],qs[_0x3897('0x39')](_0x4578c5[_0x3897('0x35')][_0x3897('0x39')]));_0x3b7d21['attributes']=_0x3b7d21[_0x3897('0x3a')]['length']?_0x3b7d21[_0x3897('0x3a')]:_0xcdcb19['model'];if(!_0x4578c5[_0x3897('0x35')][_0x3897('0x3b')](_0x3897('0x3c'))){_0x3b7d21[_0x3897('0x21')]=qs[_0x3897('0x21')](_0x4578c5[_0x3897('0x35')][_0x3897('0x21')]);_0x3b7d21[_0x3897('0x1f')]=qs[_0x3897('0x1f')](_0x4578c5[_0x3897('0x35')]['offset']);}_0x3b7d21[_0x3897('0x3d')]=qs[_0x3897('0x3e')](_0x4578c5['query'][_0x3897('0x3e')]);_0x3b7d21['where']=qs[_0x3897('0x3f')](_[_0x3897('0x40')](_0x4578c5[_0x3897('0x35')],_0xcdcb19[_0x3897('0x3f')]),_0x4d3d8b);if(_0x4578c5['query'][_0x3897('0x41')]){_0x3b7d21[_0x3897('0x42')]=_[_0x3897('0x43')](_0x3b7d21[_0x3897('0x42')],{'$or':_['map'](_0x4d3d8b,function(_0x2cada1){if(_0x2cada1['type']!==_0x3897('0x44')){var _0x1e4cf5={};_0x1e4cf5[_0x2cada1[_0x3897('0x2d')]]={'$like':'%'+_0x4578c5[_0x3897('0x35')][_0x3897('0x41')]+'%'};return _0x1e4cf5;}})});}_0x3b7d21=_[_0x3897('0x43')]({},_0x3b7d21,_0x4578c5[_0x3897('0x45')]);var _0x4f1a09={'where':_0x3b7d21[_0x3897('0x42')]};return db['ChatInternalMessage'][_0x3897('0x22')](_0x4f1a09)[_0x3897('0x28')](function(_0x2b5c5d){_0x2e3acd['count']=_0x2b5c5d;if(_0x4578c5[_0x3897('0x35')][_0x3897('0x46')]){_0x3b7d21[_0x3897('0x47')]=[{'all':!![]}];}return db[_0x3897('0x31')][_0x3897('0x48')](_0x3b7d21);})[_0x3897('0x28')](function(_0x3ebe52){_0x2e3acd[_0x3897('0x49')]=_0x3ebe52;return _0x2e3acd;})[_0x3897('0x28')](respondWithFilteredResult(_0x3dbc78,_0x3b7d21))[_0x3897('0x4a')](handleError(_0x3dbc78,null));};exports[_0x3897('0x4b')]=function(_0xa40aa9,_0x48ac32){var _0x2856d6={'raw':!![],'where':{'id':_0xa40aa9[_0x3897('0x4c')]['id']}},_0x340ea7={};_0x340ea7[_0x3897('0x38')]=_[_0x3897('0x36')](db[_0x3897('0x31')][_0x3897('0x32')]);_0x340ea7[_0x3897('0x35')]=_[_0x3897('0x36')](_0xa40aa9[_0x3897('0x35')]);_0x340ea7[_0x3897('0x3f')]=_[_0x3897('0x37')](_0x340ea7[_0x3897('0x38')],_0x340ea7['query']);_0x2856d6[_0x3897('0x3a')]=_[_0x3897('0x37')](_0x340ea7[_0x3897('0x38')],qs['fields'](_0xa40aa9[_0x3897('0x35')]['fields']));_0x2856d6['attributes']=_0x2856d6['attributes'][_0x3897('0x4d')]?_0x2856d6[_0x3897('0x3a')]:_0x340ea7[_0x3897('0x38')];if(_0xa40aa9[_0x3897('0x35')][_0x3897('0x46')]){_0x2856d6['include']=[{'all':!![]}];}_0x2856d6=_[_0x3897('0x43')]({},_0x2856d6,_0xa40aa9[_0x3897('0x45')]);return db[_0x3897('0x31')][_0x3897('0x4e')](_0x2856d6)[_0x3897('0x28')](handleEntityNotFound(_0x48ac32,null))[_0x3897('0x28')](respondWithResult(_0x48ac32,null))[_0x3897('0x4a')](handleError(_0x48ac32,null));};exports['create']=function(_0x313d83,_0xba00f7){return db[_0x3897('0x31')][_0x3897('0x4f')](_0x313d83[_0x3897('0x50')],{})[_0x3897('0x28')](respondWithResult(_0xba00f7,0xc9))[_0x3897('0x4a')](handleError(_0xba00f7,null));};exports[_0x3897('0x27')]=function(_0x425df6,_0x3f64b1){if(_0x425df6['body']['id']){delete _0x425df6[_0x3897('0x50')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x425df6[_0x3897('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3f64b1,null))[_0x3897('0x28')](saveUpdates(_0x425df6[_0x3897('0x50')],null))[_0x3897('0x28')](respondWithResult(_0x3f64b1,null))['catch'](handleError(_0x3f64b1,null));};exports[_0x3897('0x29')]=function(_0x27aae8,_0x521fd5){return db[_0x3897('0x31')][_0x3897('0x4e')]({'where':{'id':_0x27aae8[_0x3897('0x4c')]['id']}})['then'](handleEntityNotFound(_0x521fd5,null))[_0x3897('0x28')](removeEntity(_0x521fd5,null))[_0x3897('0x4a')](handleError(_0x521fd5,null));};exports[_0x3897('0x51')]=function(_0x35f596,_0x576cb1){return db[_0x3897('0x31')]['describe']()[_0x3897('0x28')](respondWithResult(_0x576cb1,null))[_0x3897('0x4a')](handleError(_0x576cb1,null));};function wrapUser(_0x466d23){return function(_0x57a11a){var _0x16d285=_0x466d23[_0x3897('0x52')]({'plain':!![]});_0x16d285[_0x3897('0x53')]=[];if(_0x57a11a){_0x16d285['lastMessageAt']=_0x57a11a[_0x3897('0x54')];_0x16d285[_0x3897('0x55')]=_0x57a11a;}else{_0x16d285['lastMessageAt']=moment(0x0)[_0x3897('0x56')](_0x3897('0x57'));_0x16d285[_0x3897('0x55')]={};}return _0x16d285;};}exports[_0x3897('0x58')]=function(_0x22bc16,_0x3e8108,_0x48471d){var _0x54e353=[];return db['User'][_0x3897('0x48')]({'where':{'role':[_0x3897('0x59'),_0x3897('0x5a'),_0x3897('0x5b')]},'attributes':['id','fullname',_0x3897('0x2d'),'role','userpic',_0x3897('0x5c'),_0x3897('0x5d'),'lastLoginAt','allowmessenger',_0x3897('0x5e')],'order':qs[_0x3897('0x3e')]('-online'),'include':[{'model':db[_0x3897('0x5f')],'as':_0x3897('0x60'),'attributes':['id',_0x3897('0x2d'),_0x3897('0x33')],'through':{'attributes':[]}}]})[_0x3897('0x28')](function(_0x14e969){if(_0x14e969){var _0x12d572=_0x22bc16[_0x3897('0x5b')][_0x3897('0x52')]({'plain':!![]});if(!_0x12d572)throw new Error(_0x3897('0x61'));if(_0x12d572['role']==='user'){return db[_0x3897('0x62')][_0x3897('0x4e')]({'where':{'name':_0x3897('0x63'),'userProfileId':_0x12d572['userProfileId']},'raw':!![]})[_0x3897('0x28')](function(_0x1d56ad){if(_0x1d56ad){if(_0x1d56ad['autoAssociation']===0x0){return db[_0x3897('0x64')][_0x3897('0x48')]({'where':{'sectionId':_0x1d56ad['id']},'raw':!![]})[_0x3897('0x28')](function(_0x327aa7){var _0x12b194=[];if(_[_0x3897('0x65')](_0x327aa7)){_0x12b194=_['filter'](_0x14e969,function(_0x4ffa09){if(_0x4ffa09['role']!==_0x3897('0x59')){return _0x4ffa09;}});return _0x12b194;}else{for(var _0x53f51a=0x0;_0x53f51a<_0x14e969[_0x3897('0x4d')];_0x53f51a++){var _0x4d68a7=_0x14e969[_0x53f51a];if(_0x4d68a7['role']==='agent'){var _0x312960=_[_0x3897('0x4e')](_0x327aa7,function(_0x2a88c9){return _0x2a88c9['resourceId']===_0x4d68a7['id'];});if(_0x312960)_0x12b194['push'](_0x4d68a7);}else{_0x12b194[_0x3897('0x66')](_0x4d68a7);}}return _0x12b194;}});}else{return _0x14e969;}}else{var _0x791b81=_['filter'](_0x14e969,function(_0x1d0e8f){if(_0x1d0e8f['role']!==_0x3897('0x59')){return _0x1d0e8f;}});return _0x791b81;}});}else{return _0x14e969;}}})[_0x3897('0x28')](function(_0x4a7090){var _0x11ac82=[];if(_0x4a7090){_0x54e353=_0x4a7090;for(var _0x462977=0x0;_0x462977<_0x4a7090[_0x3897('0x4d')];_0x462977+=0x1){_0x54e353[_0x462977][_0x3897('0x53')]=[];_0x11ac82[_0x3897('0x66')](db['ChatInternalMessage'][_0x3897('0x4e')]({'where':{'FromId':[_0x22bc16[_0x3897('0x5b')]['id'],_0x4a7090[_0x462977]['id']],'ToId':[_0x22bc16['user']['id'],_0x4a7090[_0x462977]['id']],'ChatGroupId':null},'attributes':['id',_0x3897('0x54'),_0x3897('0x67'),_0x3897('0x68'),_0x3897('0x69'),_0x3897('0x50')],'order':qs[_0x3897('0x3e')](_0x3897('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x4a7090[_0x462977])));}return BPromise[_0x3897('0x6b')](_0x11ac82);}return[];})['then'](function(_0x2edc15){return{'rows':_0x2edc15,'count':_0x2edc15[_0x3897('0x4d')]};})[_0x3897('0x28')](respondWithResult(_0x3e8108,null))[_0x3897('0x4a')](handleError(_0x3e8108,null));};
\ No newline at end of file
+var _0x4439=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','include','findAll','catch','show','intersection','options','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','fullname','role','userpic','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','limit','count','json','apply','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','model'];(function(_0xdf5462,_0x66522a){var _0x12bcb0=function(_0x467132){while(--_0x467132){_0xdf5462['push'](_0xdf5462['shift']());}};_0x12bcb0(++_0x66522a);}(_0x4439,0x1dd));var _0x9443=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0x4439[_0x1a5946];return _0x25e9d5;};'use strict';var emlformat=require(_0x9443('0x0'));var rimraf=require(_0x9443('0x1'));var zipdir=require(_0x9443('0x2'));var jsonpatch=require(_0x9443('0x3'));var rp=require(_0x9443('0x4'));var moment=require(_0x9443('0x5'));var BPromise=require(_0x9443('0x6'));var Mustache=require(_0x9443('0x7'));var util=require('util');var path=require(_0x9443('0x8'));var sox=require(_0x9443('0x9'));var csv=require('to-csv');var ejs=require(_0x9443('0xa'));var fs=require('fs');var fs_extra=require(_0x9443('0xb'));var _=require(_0x9443('0xc'));var squel=require(_0x9443('0xd'));var crypto=require(_0x9443('0xe'));var jsforce=require(_0x9443('0xf'));var deskjs=require(_0x9443('0x10'));var toCsv=require(_0x9443('0x11'));var querystring=require('querystring');var Papa=require(_0x9443('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9443('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9443('0x14'))(_0x9443('0x15'));var utils=require(_0x9443('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9443('0x17'));var db=require(_0x9443('0x18'))['db'];config['redis']=_[_0x9443('0x19')](config['redis'],{'host':_0x9443('0x1a'),'port':0x18eb});var socket=require(_0x9443('0x1b'))(new Redis(config['redis']));require(_0x9443('0x1c'))['register'](socket);function respondWithStatusCode(_0x51348a,_0x14ed4a){_0x14ed4a=_0x14ed4a||0xcc;return function(_0x45a534){if(_0x45a534){return _0x51348a[_0x9443('0x1d')](_0x14ed4a);}return _0x51348a[_0x9443('0x1e')](_0x14ed4a)[_0x9443('0x1f')]();};}function respondWithResult(_0x25bb2f,_0x29f2ff){_0x29f2ff=_0x29f2ff||0xc8;return function(_0x58f567){if(_0x58f567){return _0x25bb2f[_0x9443('0x1e')](_0x29f2ff)['json'](_0x58f567);}};}function respondWithFilteredResult(_0x82ea8b,_0x56728c){return function(_0x2e8560){if(_0x2e8560){var _0x428c74=typeof _0x56728c[_0x9443('0x20')]==='undefined'&&typeof _0x56728c[_0x9443('0x21')]==='undefined';var _0x2d23c4=_0x2e8560[_0x9443('0x22')];var _0x56856a=_0x428c74?0x0:_0x56728c[_0x9443('0x20')];var _0x15a019=_0x428c74?_0x2e8560[_0x9443('0x22')]:_0x56728c[_0x9443('0x20')]+_0x56728c[_0x9443('0x21')];var _0x20ffad;if(_0x15a019>=_0x2d23c4){_0x15a019=_0x2d23c4;_0x20ffad=0xc8;}else{_0x20ffad=0xce;}_0x82ea8b[_0x9443('0x1e')](_0x20ffad);return _0x82ea8b['set']('Content-Range',_0x56856a+'-'+_0x15a019+'/'+_0x2d23c4)[_0x9443('0x23')](_0x2e8560);}return null;};}function patchUpdates(_0x558f27){return function(_0x5eb868){try{jsonpatch[_0x9443('0x24')](_0x5eb868,_0x558f27,!![]);}catch(_0x2555a8){return BPromise['reject'](_0x2555a8);}return _0x5eb868['save']();};}function saveUpdates(_0x2c7d28,_0x567c8b){return function(_0x173db0){if(_0x173db0){return _0x173db0[_0x9443('0x25')](_0x2c7d28)[_0x9443('0x26')](function(_0x2e5211){return _0x2e5211;});}return null;};}function removeEntity(_0x40aef4,_0x149f39){return function(_0x3f7995){if(_0x3f7995){return _0x3f7995['destroy']()['then'](function(){_0x40aef4[_0x9443('0x1e')](0xcc)[_0x9443('0x1f')]();});}};}function handleEntityNotFound(_0x39373e,_0x58282c){return function(_0x54f559){if(!_0x54f559){_0x39373e[_0x9443('0x1d')](0x194);}return _0x54f559;};}function handleError(_0x2f06d8,_0x47d88f){_0x47d88f=_0x47d88f||0x1f4;return function(_0x559fd4){logger[_0x9443('0x27')](_0x559fd4[_0x9443('0x28')]);if(_0x559fd4[_0x9443('0x29')]){delete _0x559fd4[_0x9443('0x29')];}_0x2f06d8['status'](_0x47d88f)[_0x9443('0x2a')](_0x559fd4);};}exports[_0x9443('0x2b')]=function(_0x21044f,_0x3cdc0f){var _0x167ad9={},_0x5bd3ed={},_0x1671c1={'count':0x0,'rows':[]};var _0x2f8c9e=_[_0x9443('0x2c')](db[_0x9443('0x2d')][_0x9443('0x2e')],function(_0x3a19b1){return{'name':_0x3a19b1[_0x9443('0x2f')],'type':_0x3a19b1[_0x9443('0x30')][_0x9443('0x31')]};});_0x5bd3ed['model']=_[_0x9443('0x2c')](_0x2f8c9e,'name');_0x5bd3ed[_0x9443('0x32')]=_[_0x9443('0x33')](_0x21044f[_0x9443('0x32')]);_0x5bd3ed['filters']=_['intersection'](_0x5bd3ed[_0x9443('0x34')],_0x5bd3ed[_0x9443('0x32')]);_0x167ad9['attributes']=_['intersection'](_0x5bd3ed[_0x9443('0x34')],qs[_0x9443('0x35')](_0x21044f[_0x9443('0x32')]['fields']));_0x167ad9[_0x9443('0x36')]=_0x167ad9[_0x9443('0x36')][_0x9443('0x37')]?_0x167ad9['attributes']:_0x5bd3ed[_0x9443('0x34')];if(!_0x21044f['query'][_0x9443('0x38')](_0x9443('0x39'))){_0x167ad9[_0x9443('0x21')]=qs[_0x9443('0x21')](_0x21044f['query'][_0x9443('0x21')]);_0x167ad9[_0x9443('0x20')]=qs[_0x9443('0x20')](_0x21044f[_0x9443('0x32')][_0x9443('0x20')]);}_0x167ad9[_0x9443('0x3a')]=qs[_0x9443('0x3b')](_0x21044f[_0x9443('0x32')]['sort']);_0x167ad9[_0x9443('0x3c')]=qs[_0x9443('0x3d')](_['pick'](_0x21044f['query'],_0x5bd3ed[_0x9443('0x3d')]),_0x2f8c9e);if(_0x21044f['query'][_0x9443('0x3e')]){_0x167ad9[_0x9443('0x3c')]=_['merge'](_0x167ad9[_0x9443('0x3c')],{'$or':_[_0x9443('0x2c')](_0x2f8c9e,function(_0x224c5b){if(_0x224c5b[_0x9443('0x30')]!==_0x9443('0x3f')){var _0x1ee84b={};_0x1ee84b[_0x224c5b[_0x9443('0x29')]]={'$like':'%'+_0x21044f[_0x9443('0x32')][_0x9443('0x3e')]+'%'};return _0x1ee84b;}})});}_0x167ad9=_[_0x9443('0x40')]({},_0x167ad9,_0x21044f['options']);var _0x2dfc92={'where':_0x167ad9[_0x9443('0x3c')]};return db[_0x9443('0x2d')][_0x9443('0x22')](_0x2dfc92)[_0x9443('0x26')](function(_0x393257){_0x1671c1[_0x9443('0x22')]=_0x393257;if(_0x21044f[_0x9443('0x32')]['includeAll']){_0x167ad9[_0x9443('0x41')]=[{'all':!![]}];}return db[_0x9443('0x2d')][_0x9443('0x42')](_0x167ad9);})['then'](function(_0x63b00f){_0x1671c1['rows']=_0x63b00f;return _0x1671c1;})[_0x9443('0x26')](respondWithFilteredResult(_0x3cdc0f,_0x167ad9))[_0x9443('0x43')](handleError(_0x3cdc0f,null));};exports[_0x9443('0x44')]=function(_0x5b9318,_0x3afb81){var _0x16f044={'raw':!![],'where':{'id':_0x5b9318['params']['id']}},_0x40c442={};_0x40c442[_0x9443('0x34')]=_[_0x9443('0x33')](db[_0x9443('0x2d')][_0x9443('0x2e')]);_0x40c442[_0x9443('0x32')]=_[_0x9443('0x33')](_0x5b9318[_0x9443('0x32')]);_0x40c442[_0x9443('0x3d')]=_['intersection'](_0x40c442[_0x9443('0x34')],_0x40c442[_0x9443('0x32')]);_0x16f044['attributes']=_[_0x9443('0x45')](_0x40c442[_0x9443('0x34')],qs[_0x9443('0x35')](_0x5b9318[_0x9443('0x32')][_0x9443('0x35')]));_0x16f044[_0x9443('0x36')]=_0x16f044['attributes'][_0x9443('0x37')]?_0x16f044[_0x9443('0x36')]:_0x40c442[_0x9443('0x34')];if(_0x5b9318[_0x9443('0x32')]['includeAll']){_0x16f044[_0x9443('0x41')]=[{'all':!![]}];}_0x16f044=_[_0x9443('0x40')]({},_0x16f044,_0x5b9318[_0x9443('0x46')]);return db[_0x9443('0x2d')][_0x9443('0x47')](_0x16f044)['then'](handleEntityNotFound(_0x3afb81,null))['then'](respondWithResult(_0x3afb81,null))[_0x9443('0x43')](handleError(_0x3afb81,null));};exports[_0x9443('0x48')]=function(_0xeb0ca0,_0x2f1b94){return db[_0x9443('0x2d')][_0x9443('0x48')](_0xeb0ca0[_0x9443('0x49')],{})[_0x9443('0x26')](respondWithResult(_0x2f1b94,0xc9))[_0x9443('0x43')](handleError(_0x2f1b94,null));};exports[_0x9443('0x25')]=function(_0x40ede1,_0x2e2ced){if(_0x40ede1['body']['id']){delete _0x40ede1['body']['id'];}return db[_0x9443('0x2d')][_0x9443('0x47')]({'where':{'id':_0x40ede1[_0x9443('0x4a')]['id']}})[_0x9443('0x26')](handleEntityNotFound(_0x2e2ced,null))[_0x9443('0x26')](saveUpdates(_0x40ede1[_0x9443('0x49')],null))[_0x9443('0x26')](respondWithResult(_0x2e2ced,null))[_0x9443('0x43')](handleError(_0x2e2ced,null));};exports['destroy']=function(_0xf23c9c,_0x6e8d0e){return db[_0x9443('0x2d')][_0x9443('0x47')]({'where':{'id':_0xf23c9c[_0x9443('0x4a')]['id']}})[_0x9443('0x26')](handleEntityNotFound(_0x6e8d0e,null))[_0x9443('0x26')](removeEntity(_0x6e8d0e,null))[_0x9443('0x43')](handleError(_0x6e8d0e,null));};exports[_0x9443('0x4b')]=function(_0x14b040,_0x45a995){return db[_0x9443('0x2d')][_0x9443('0x4b')]()[_0x9443('0x26')](respondWithResult(_0x45a995,null))[_0x9443('0x43')](handleError(_0x45a995,null));};function wrapUser(_0x4822b0){return function(_0x364eff){var _0x99e116=_0x4822b0[_0x9443('0x4c')]({'plain':!![]});_0x99e116['messages']=[];if(_0x364eff){_0x99e116[_0x9443('0x4d')]=_0x364eff[_0x9443('0x4e')];_0x99e116[_0x9443('0x4f')]=_0x364eff;}else{_0x99e116[_0x9443('0x4d')]=moment(0x0)[_0x9443('0x50')](_0x9443('0x51'));_0x99e116[_0x9443('0x4f')]={};}return _0x99e116;};}exports[_0x9443('0x52')]=function(_0x1aecc9,_0x44d1bd,_0x70f3a0){var _0x49810a=[];return db[_0x9443('0x53')][_0x9443('0x42')]({'where':{'role':[_0x9443('0x54'),'admin','user']},'attributes':['id',_0x9443('0x55'),_0x9443('0x29'),_0x9443('0x56'),_0x9443('0x57'),'internal','online','lastLoginAt',_0x9443('0x58'),_0x9443('0x59')],'order':qs['sort'](_0x9443('0x5a')),'include':[{'model':db[_0x9443('0x5b')],'as':_0x9443('0x5c'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x9443('0x26')](function(_0x35df88){if(_0x35df88){var _0x5d501e=_0x1aecc9[_0x9443('0x5d')][_0x9443('0x4c')]({'plain':!![]});if(!_0x5d501e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d501e[_0x9443('0x56')]===_0x9443('0x5d')){return db['UserProfileSection'][_0x9443('0x47')]({'where':{'name':_0x9443('0x5e'),'userProfileId':_0x5d501e[_0x9443('0x5f')]},'raw':!![]})[_0x9443('0x26')](function(_0x274634){if(_0x274634){if(_0x274634[_0x9443('0x60')]===0x0){return db[_0x9443('0x61')][_0x9443('0x42')]({'where':{'sectionId':_0x274634['id']},'raw':!![]})['then'](function(_0x1cc99a){var _0xd33b1e=[];if(_[_0x9443('0x62')](_0x1cc99a)){_0xd33b1e=_[_0x9443('0x3e')](_0x35df88,function(_0x40712a){if(_0x40712a[_0x9443('0x56')]!==_0x9443('0x54')){return _0x40712a;}});return _0xd33b1e;}else{for(var _0x2e8817=0x0;_0x2e8817<_0x35df88[_0x9443('0x37')];_0x2e8817++){var _0x54157a=_0x35df88[_0x2e8817];if(_0x54157a[_0x9443('0x56')]===_0x9443('0x54')){var _0x203af7=_[_0x9443('0x47')](_0x1cc99a,function(_0x23a6d0){return _0x23a6d0['resourceId']===_0x54157a['id'];});if(_0x203af7)_0xd33b1e[_0x9443('0x63')](_0x54157a);}else{_0xd33b1e['push'](_0x54157a);}}return _0xd33b1e;}});}else{return _0x35df88;}}else{var _0x151a7d=_[_0x9443('0x3e')](_0x35df88,function(_0x491094){if(_0x491094[_0x9443('0x56')]!==_0x9443('0x54')){return _0x491094;}});return _0x151a7d;}});}else{return _0x35df88;}}})['then'](function(_0x18b906){var _0x1041de=[];if(_0x18b906){_0x49810a=_0x18b906;for(var _0x119b7c=0x0;_0x119b7c<_0x18b906['length'];_0x119b7c+=0x1){_0x49810a[_0x119b7c][_0x9443('0x64')]=[];_0x1041de['push'](db[_0x9443('0x2d')][_0x9443('0x47')]({'where':{'FromId':[_0x1aecc9['user']['id'],_0x18b906[_0x119b7c]['id']],'ToId':[_0x1aecc9[_0x9443('0x5d')]['id'],_0x18b906[_0x119b7c]['id']],'ChatGroupId':null},'attributes':['id',_0x9443('0x4e'),_0x9443('0x65'),_0x9443('0x66'),_0x9443('0x67'),'body'],'order':qs['sort'](_0x9443('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x18b906[_0x119b7c])));}return BPromise[_0x9443('0x69')](_0x1041de);}return[];})[_0x9443('0x26')](function(_0x781b70){return{'rows':_0x781b70,'count':_0x781b70[_0x9443('0x37')]};})[_0x9443('0x26')](respondWithResult(_0x44d1bd,null))[_0x9443('0x43')](handleError(_0x44d1bd,null));};
\ No newline at end of file
index d30ee5d..2a0e5ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca8a=['exports','events','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1fcc6b,_0x4fb0d1){var _0x4b0c12=function(_0x1d0ec1){while(--_0x1d0ec1){_0x1fcc6b['push'](_0x1fcc6b['shift']());}};_0x4b0c12(++_0x4fb0d1);}(_0xca8a,0xa3));var _0xaca8=function(_0x344253,_0x342072){_0x344253=_0x344253-0x0;var _0x3ee620=_0xca8a[_0x344253];return _0x3ee620;};'use strict';var EventEmitter=require(_0xaca8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xaca8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xaca8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaca8('0x3'),'afterDestroy':_0xaca8('0x4')};function emitEvent(_0x38c525){return function(_0x4f4ad4,_0x318079,_0xcb77c4){ChatInternalMessageEvents[_0xaca8('0x5')](_0x38c525+':'+_0x4f4ad4['id'],_0x4f4ad4);ChatInternalMessageEvents['emit'](_0x38c525,_0x4f4ad4);_0xcb77c4(null);};}for(var e in events){if(events[_0xaca8('0x6')](e)){var event=events[e];ChatInternalMessage[_0xaca8('0x7')](e,emitEvent(event));}}module[_0xaca8('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xa770=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatInternalMessage'];(function(_0xf79a37,_0x1dd6c3){var _0x21d45d=function(_0x1898ba){while(--_0x1898ba){_0xf79a37['push'](_0xf79a37['shift']());}};_0x21d45d(++_0x1dd6c3);}(_0xa770,0xc6));var _0x0a77=function(_0x9c666f,_0xbb846){_0x9c666f=_0x9c666f-0x0;var _0x12fa31=_0xa770[_0x9c666f];return _0x12fa31;};'use strict';var EventEmitter=require(_0x0a77('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x0a77('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0a77('0x2')](0x0);var events={'afterCreate':_0x0a77('0x3'),'afterUpdate':_0x0a77('0x4'),'afterDestroy':_0x0a77('0x5')};function emitEvent(_0x3e4f9f){return function(_0x49ce5b,_0x295fd5,_0x273e7f){ChatInternalMessageEvents[_0x0a77('0x6')](_0x3e4f9f+':'+_0x49ce5b['id'],_0x49ce5b);ChatInternalMessageEvents['emit'](_0x3e4f9f,_0x49ce5b);_0x273e7f(null);};}for(var e in events){if(events[_0x0a77('0x7')](e)){var event=events[e];ChatInternalMessage[_0x0a77('0x8')](e,emitEvent(event));}}module[_0x0a77('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
index 87cce80..0d260ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11ff=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x11ff,0x1dd));var _0xf11f=function(_0x510716,_0x39f6e8){_0x510716=_0x510716-0x0;var _0x5003a5=_0x11ff[_0x510716];return _0x5003a5;};'use strict';var _=require(_0xf11f('0x0'));var util=require('util');var logger=require(_0xf11f('0x1'))(_0xf11f('0x2'));var moment=require(_0xf11f('0x3'));var BPromise=require(_0xf11f('0x4'));var rp=require(_0xf11f('0x5'));var fs=require('fs');var path=require(_0xf11f('0x6'));var rimraf=require('rimraf');var config=require(_0xf11f('0x7'));var attributes=require(_0xf11f('0x8'));module['exports']=function(_0x4ca4d8,_0x2752bc){return _0x4ca4d8[_0xf11f('0x9')](_0xf11f('0xa'),attributes,{'tableName':_0xf11f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf11f('0xc'),'collate':_0xf11f('0xd')});};
\ No newline at end of file
+var _0x4bc1=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x2931bf,_0x32f83c){var _0x2c4402=function(_0x39467b){while(--_0x39467b){_0x2931bf['push'](_0x2931bf['shift']());}};_0x2c4402(++_0x32f83c);}(_0x4bc1,0x1c7));var _0x14bc=function(_0x251e2d,_0xce5077){_0x251e2d=_0x251e2d-0x0;var _0x19762e=_0x4bc1[_0x251e2d];return _0x19762e;};'use strict';var _=require(_0x14bc('0x0'));var util=require(_0x14bc('0x1'));var logger=require('../../config/logger')(_0x14bc('0x2'));var moment=require(_0x14bc('0x3'));var BPromise=require(_0x14bc('0x4'));var rp=require(_0x14bc('0x5'));var fs=require('fs');var path=require(_0x14bc('0x6'));var rimraf=require(_0x14bc('0x7'));var config=require('../../config/environment');var attributes=require(_0x14bc('0x8'));module[_0x14bc('0x9')]=function(_0x488685,_0x3102f6){return _0x488685['define'](_0x14bc('0xa'),attributes,{'tableName':_0x14bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x14bc('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d615a34..ece91a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x559f=['./chatInternalMessage.socket','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x396631,_0x4bceda){var _0x234d9d=function(_0x5c6bb3){while(--_0x5c6bb3){_0x396631['push'](_0x396631['shift']());}};_0x234d9d(++_0x4bceda);}(_0x559f,0xf5));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf559('0x0'));var util=require(_0xf559('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf559('0x2'));var fs=require('fs');var Redis=require(_0xf559('0x3'));var db=require(_0xf559('0x4'))['db'];var utils=require(_0xf559('0x5'));var logger=require(_0xf559('0x6'))(_0xf559('0x7'));var config=require('../../config/environment');var jayson=require(_0xf559('0x8'));var client=jayson[_0xf559('0x9')][_0xf559('0xa')]({'port':0x232a});config[_0xf559('0xb')]=_[_0xf559('0xc')](config[_0xf559('0xb')],{'host':_0xf559('0xd'),'port':0x18eb});var socket=require(_0xf559('0xe'))(new Redis(config[_0xf559('0xb')]));require(_0xf559('0xf'))['register'](socket);function respondWithRpcPromise(_0x43a338,_0xc95df8,_0x3598d3){return new BPromise(function(_0x278122,_0x21693b){return client[_0xf559('0x10')](_0x43a338,_0x3598d3)['then'](function(_0x34fc6f){logger['info'](_0xf559('0x11'),_0xc95df8,_0xf559('0x12'));logger['debug'](_0xf559('0x13'),_0xc95df8,_0xf559('0x12'),JSON['stringify'](_0x34fc6f));if(_0x34fc6f[_0xf559('0x14')]){if(_0x34fc6f[_0xf559('0x14')][_0xf559('0x15')]===0x1f4){logger[_0xf559('0x14')](_0xf559('0x11'),_0xc95df8,_0x34fc6f['error'][_0xf559('0x16')]);return _0x21693b(_0x34fc6f[_0xf559('0x14')]['message']);}logger[_0xf559('0x14')](_0xf559('0x11'),_0xc95df8,_0x34fc6f[_0xf559('0x14')][_0xf559('0x16')]);return _0x278122(_0x34fc6f[_0xf559('0x14')]['message']);}else{logger[_0xf559('0x17')](_0xf559('0x11'),_0xc95df8,_0xf559('0x12'));_0x278122(_0x34fc6f[_0xf559('0x18')]['message']);}})[_0xf559('0x19')](function(_0x28afad){logger[_0xf559('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0xc95df8,_0x28afad);_0x21693b(_0x28afad);});});}
\ No newline at end of file
+var _0xb647=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x261b45,_0x1feb7a){var _0x4d7206=function(_0x46b5a2){while(--_0x46b5a2){_0x261b45['push'](_0x261b45['shift']());}};_0x4d7206(++_0x1feb7a);}(_0xb647,0xdb));var _0x7b64=function(_0x165e50,_0x528ba1){_0x165e50=_0x165e50-0x0;var _0x637e1=_0xb647[_0x165e50];return _0x637e1;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var moment=require(_0x7b64('0x2'));var BPromise=require(_0x7b64('0x3'));var rs=require(_0x7b64('0x4'));var fs=require('fs');var Redis=require(_0x7b64('0x5'));var db=require(_0x7b64('0x6'))['db'];var utils=require(_0x7b64('0x7'));var logger=require('../../config/logger')(_0x7b64('0x8'));var config=require('../../config/environment');var jayson=require(_0x7b64('0x9'));var client=jayson[_0x7b64('0xa')][_0x7b64('0xb')]({'port':0x232a});config[_0x7b64('0xc')]=_[_0x7b64('0xd')](config[_0x7b64('0xc')],{'host':_0x7b64('0xe'),'port':0x18eb});var socket=require(_0x7b64('0xf'))(new Redis(config[_0x7b64('0xc')]));require('./chatInternalMessage.socket')[_0x7b64('0x10')](socket);function respondWithRpcPromise(_0x49718f,_0x71805b,_0x4c8014){return new BPromise(function(_0x5bce4c,_0x35ed61){return client[_0x7b64('0x11')](_0x49718f,_0x4c8014)['then'](function(_0x763c51){logger[_0x7b64('0x12')](_0x7b64('0x13'),_0x71805b,_0x7b64('0x14'));logger[_0x7b64('0x15')](_0x7b64('0x16'),_0x71805b,_0x7b64('0x14'),JSON['stringify'](_0x763c51));if(_0x763c51[_0x7b64('0x17')]){if(_0x763c51['error']['code']===0x1f4){logger[_0x7b64('0x17')](_0x7b64('0x13'),_0x71805b,_0x763c51[_0x7b64('0x17')][_0x7b64('0x18')]);return _0x35ed61(_0x763c51[_0x7b64('0x17')][_0x7b64('0x18')]);}logger[_0x7b64('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x71805b,_0x763c51[_0x7b64('0x17')][_0x7b64('0x18')]);return _0x5bce4c(_0x763c51[_0x7b64('0x17')][_0x7b64('0x18')]);}else{logger[_0x7b64('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x71805b,_0x7b64('0x14'));_0x5bce4c(_0x763c51[_0x7b64('0x19')]['message']);}})[_0x7b64('0x1a')](function(_0x28615d){logger['error'](_0x7b64('0x13'),_0x71805b,_0x28615d);_0x35ed61(_0x28615d);});});}
\ No newline at end of file
index 4c63793..de56304 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3474=['register','length','./chatInternalMessage.events','remove','update','emit','removeListener'];(function(_0x39341e,_0x403a23){var _0x595772=function(_0xb0da42){while(--_0xb0da42){_0x39341e['push'](_0x39341e['shift']());}};_0x595772(++_0x403a23);}(_0x3474,0x198));var _0x4347=function(_0x177628,_0x5451ed){_0x177628=_0x177628-0x0;var _0xb06098=_0x3474[_0x177628];return _0xb06098;};'use strict';var ChatInternalMessageEvents=require(_0x4347('0x0'));var events=['save',_0x4347('0x1'),_0x4347('0x2')];function createListener(_0x356b90,_0x17b726){return function(_0x2d4a81){_0x17b726[_0x4347('0x3')](_0x356b90,_0x2d4a81);};}function removeListener(_0x1307a1,_0x2a4f59){return function(){ChatInternalMessageEvents[_0x4347('0x4')](_0x1307a1,_0x2a4f59);};}exports[_0x4347('0x5')]=function(_0x54de25){for(var _0x4617d5=0x0,_0xaabba1=events[_0x4347('0x6')];_0x4617d5<_0xaabba1;_0x4617d5++){var _0x2c11fd=events[_0x4617d5];var _0x3edf98=createListener('chatInternalMessage:'+_0x2c11fd,_0x54de25);ChatInternalMessageEvents['on'](_0x2c11fd,_0x3edf98);}};
\ No newline at end of file
+var _0x1e3a=['register','./chatInternalMessage.events','update','emit','removeListener'];(function(_0x147914,_0x3a9e3c){var _0x5146c3=function(_0x13594a){while(--_0x13594a){_0x147914['push'](_0x147914['shift']());}};_0x5146c3(++_0x3a9e3c);}(_0x1e3a,0x137));var _0xa1e3=function(_0xf67a90,_0x2eb2f3){_0xf67a90=_0xf67a90-0x0;var _0x648b2=_0x1e3a[_0xf67a90];return _0x648b2;};'use strict';var ChatInternalMessageEvents=require(_0xa1e3('0x0'));var events=['save','remove',_0xa1e3('0x1')];function createListener(_0x5524e4,_0xb97e5e){return function(_0x3242f8){_0xb97e5e[_0xa1e3('0x2')](_0x5524e4,_0x3242f8);};}function removeListener(_0x4357d9,_0xfa0b61){return function(){ChatInternalMessageEvents[_0xa1e3('0x3')](_0x4357d9,_0xfa0b61);};}exports[_0xa1e3('0x4')]=function(_0x444b95){for(var _0x2d747c=0x0,_0x612033=events['length'];_0x2d747c<_0x612033;_0x2d747c++){var _0x2fce37=events[_0x2d747c];var _0x42c9ff=createListener('chatInternalMessage:'+_0x2fce37,_0x444b95);ChatInternalMessageEvents['on'](_0x2fce37,_0x42c9ff);}};
\ No newline at end of file
index 15cba84..05614e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0280=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','/users','getUsers','/:id','show','put','delete','destroy','util','path','connect-timeout'];(function(_0x59b58a,_0x1d2950){var _0x4d4cf3=function(_0xbd9829){while(--_0xbd9829){_0x59b58a['push'](_0x59b58a['shift']());}};_0x4d4cf3(++_0x1d2950);}(_0x0280,0x123));var _0x0028=function(_0x1d4720,_0x4d051c){_0x1d4720=_0x1d4720-0x0;var _0x2ac38d=_0x0280[_0x1d4720];return _0x2ac38d;};'use strict';var multer=require('multer');var util=require(_0x0028('0x0'));var path=require(_0x0028('0x1'));var timeout=require(_0x0028('0x2'));var express=require(_0x0028('0x3'));var router=express[_0x0028('0x4')]();var fs_extra=require(_0x0028('0x5'));var auth=require(_0x0028('0x6'));var interaction=require(_0x0028('0x7'));var config=require(_0x0028('0x8'));var controller=require(_0x0028('0x9'));router[_0x0028('0xa')]('/',auth['isAuthenticated'](),controller[_0x0028('0xb')]);router[_0x0028('0xa')](_0x0028('0xc'),auth[_0x0028('0xd')](),controller['describe']);router[_0x0028('0xa')](_0x0028('0xe'),auth[_0x0028('0xd')](),controller[_0x0028('0xf')]);router[_0x0028('0xa')](_0x0028('0x10'),auth[_0x0028('0xd')](),controller[_0x0028('0x11')]);router['post']('/',auth[_0x0028('0xd')](),controller['create']);router[_0x0028('0x12')](_0x0028('0x10'),controller['update']);router[_0x0028('0x13')](_0x0028('0x10'),auth[_0x0028('0xd')](),controller[_0x0028('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x81ff=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/users','getUsers','/:id','post','create','put','update','delete','exports','multer'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x81ff,0x149));var _0xf81f=function(_0x40694c,_0x305dff){_0x40694c=_0x40694c-0x0;var _0x2cd611=_0x81ff[_0x40694c];return _0x2cd611;};'use strict';var multer=require(_0xf81f('0x0'));var util=require('util');var path=require(_0xf81f('0x1'));var timeout=require(_0xf81f('0x2'));var express=require(_0xf81f('0x3'));var router=express['Router']();var fs_extra=require(_0xf81f('0x4'));var auth=require(_0xf81f('0x5'));var interaction=require(_0xf81f('0x6'));var config=require(_0xf81f('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf81f('0x8')]);router['get'](_0xf81f('0x9'),auth[_0xf81f('0xa')](),controller[_0xf81f('0xb')]);router[_0xf81f('0xc')](_0xf81f('0xd'),auth['isAuthenticated'](),controller[_0xf81f('0xe')]);router['get'](_0xf81f('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xf81f('0x10')]('/',auth[_0xf81f('0xa')](),controller[_0xf81f('0x11')]);router[_0xf81f('0x12')](_0xf81f('0xf'),controller[_0xf81f('0x13')]);router[_0xf81f('0x14')](_0xf81f('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xf81f('0x15')]=router;
\ No newline at end of file
index b0afe07..895fd68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61d0=['STRING','sequelize','TEXT','medium','BOOLEAN','out'];(function(_0x5164ad,_0x42a04e){var _0x2d2d9b=function(_0x684665){while(--_0x684665){_0x5164ad['push'](_0x5164ad['shift']());}};_0x2d2d9b(++_0x42a04e);}(_0x61d0,0x187));var _0x061d=function(_0x5a037a,_0x44a3fc){_0x5a037a=_0x5a037a-0x0;var _0x28ff57=_0x61d0[_0x5a037a];return _0x28ff57;};'use strict';var Sequelize=require(_0x061d('0x0'));module['exports']={'body':{'type':Sequelize[_0x061d('0x1')](_0x061d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x061d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x061d('0x4')),'defaultValue':_0x061d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x061d('0x5')]},'providerResponse':{'type':Sequelize[_0x061d('0x1')]}};
\ No newline at end of file
+var _0xe3d4=['out','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x2646c3,_0x3d2147){var _0x5f0a8c=function(_0x42d42){while(--_0x42d42){_0x2646c3['push'](_0x2646c3['shift']());}};_0x5f0a8c(++_0x3d2147);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x18a01c,_0xd1a13a){_0x18a01c=_0x18a01c-0x0;var _0x2b0cd6=_0xe3d4[_0x18a01c];return _0x2b0cd6;};'use strict';var Sequelize=require('sequelize');module[_0x4e3d('0x0')]={'body':{'type':Sequelize[_0x4e3d('0x1')](_0x4e3d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x4e3d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4e3d('0x4')]('in','out'),'defaultValue':_0x4e3d('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4e3d('0x6')]},'providerResponse':{'type':Sequelize[_0x4e3d('0x1')]}};
\ No newline at end of file
index eef8b03..f26d416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd880=['QueryTypes','SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','event','acceptmessage','parse','../../config/logger','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','Sequelize','motionChannel','EventManager','formData','eml-format','rimraf','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../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','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end','stack','name','ChatMessage','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','length','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','update','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd880,0x9b));var _0x0d88=function(_0x43075a,_0x3aa0c9){_0x43075a=_0x43075a-0x0;var _0x40311e=_0xd880[_0x43075a];return _0x40311e;};'use strict';var emlformat=require(_0x0d88('0x0'));var rimraf=require(_0x0d88('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d88('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0d88('0x3'));var util=require('util');var path=require(_0x0d88('0x4'));var sox=require(_0x0d88('0x5'));var csv=require('to-csv');var ejs=require(_0x0d88('0x6'));var fs=require('fs');var fs_extra=require(_0x0d88('0x7'));var _=require(_0x0d88('0x8'));var squel=require(_0x0d88('0x9'));var crypto=require(_0x0d88('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0d88('0xb'));var toCsv=require(_0x0d88('0xc'));var querystring=require(_0x0d88('0xd'));var Papa=require(_0x0d88('0xe'));var Redis=require(_0x0d88('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d88('0x10'));var logger=require('../../config/logger')(_0x0d88('0x11'));var utils=require(_0x0d88('0x12'));var config=require(_0x0d88('0x13'));var licenseUtil=require(_0x0d88('0x14'));var db=require(_0x0d88('0x15'))['db'];config[_0x0d88('0x16')]=_[_0x0d88('0x17')](config[_0x0d88('0x16')],{'host':_0x0d88('0x18'),'port':0x18eb});var socket=require(_0x0d88('0x19'))(new Redis(config[_0x0d88('0x16')]));require('./chatMessage.socket')[_0x0d88('0x1a')](socket);var jayson=require(_0x0d88('0x1b'));var client=jayson[_0x0d88('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x0d88('0x1c')][_0x0d88('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1c4ee5,_0x3473eb,_0x1db1d8,_0x3b3e66){return new BPromise(function(_0x164c9f,_0x258f54){var _0x3acf8b=_0x3b3e66||client;return _0x3acf8b[_0x0d88('0x1e')](_0x1c4ee5,_0x1db1d8)[_0x0d88('0x1f')](function(_0x56a4e0){logger[_0x0d88('0x20')](_0x0d88('0x21'),_0x3473eb,_0x0d88('0x22'));logger[_0x0d88('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3473eb,'request\x20sent',JSON['stringify'](_0x56a4e0));if(_0x56a4e0['error']){if(_0x56a4e0[_0x0d88('0x24')][_0x0d88('0x25')]===0x1f4){logger[_0x0d88('0x24')]('ChatMessage,\x20%s,\x20%s',_0x3473eb,_0x56a4e0['error'][_0x0d88('0x26')]);return _0x258f54(_0x56a4e0[_0x0d88('0x24')][_0x0d88('0x26')]);}logger[_0x0d88('0x24')](_0x0d88('0x21'),_0x3473eb,_0x56a4e0['error'][_0x0d88('0x26')]);return _0x164c9f(_0x56a4e0['error']['message']);}else{logger[_0x0d88('0x20')](_0x0d88('0x21'),_0x3473eb,'request\x20sent');_0x164c9f(_0x56a4e0[_0x0d88('0x27')][_0x0d88('0x26')]);}})[_0x0d88('0x28')](function(_0x50bbb1){logger['error'](_0x0d88('0x21'),_0x3473eb,_0x50bbb1);_0x258f54(_0x50bbb1);});});}function respondWithStatusCode(_0x47bbea,_0x141321){_0x141321=_0x141321||0xcc;return function(_0x37c9bb){if(_0x37c9bb){return _0x47bbea[_0x0d88('0x29')](_0x141321);}return _0x47bbea[_0x0d88('0x2a')](_0x141321)['end']();};}function respondWithResult(_0x51c003,_0x2792f7){_0x2792f7=_0x2792f7||0xc8;return function(_0x7add00){if(_0x7add00){return _0x51c003[_0x0d88('0x2a')](_0x2792f7)[_0x0d88('0x2b')](_0x7add00);}};}function respondWithFilteredResult(_0x111521,_0x109dad){return function(_0x1dc7f1){if(_0x1dc7f1){var _0x35deb6=typeof _0x109dad[_0x0d88('0x2c')]===_0x0d88('0x2d')&&typeof _0x109dad[_0x0d88('0x2e')]===_0x0d88('0x2d');var _0x3f0f14=_0x1dc7f1[_0x0d88('0x2f')];var _0x4fa74e=_0x35deb6?0x0:_0x109dad['offset'];var _0x239c00=_0x35deb6?_0x1dc7f1[_0x0d88('0x2f')]:_0x109dad['offset']+_0x109dad[_0x0d88('0x2e')];var _0x526db4;if(_0x239c00>=_0x3f0f14){_0x239c00=_0x3f0f14;_0x526db4=0xc8;}else{_0x526db4=0xce;}_0x111521[_0x0d88('0x2a')](_0x526db4);return _0x111521[_0x0d88('0x30')](_0x0d88('0x31'),_0x4fa74e+'-'+_0x239c00+'/'+_0x3f0f14)['json'](_0x1dc7f1);}return null;};}function patchUpdates(_0x29fbef){return function(_0x356ce7){try{jsonpatch[_0x0d88('0x32')](_0x356ce7,_0x29fbef,!![]);}catch(_0x222c88){return BPromise[_0x0d88('0x33')](_0x222c88);}return _0x356ce7[_0x0d88('0x34')]();};}function saveUpdates(_0x29a653,_0x2015fd){return function(_0xdb00ef){if(_0xdb00ef){return _0xdb00ef['update'](_0x29a653)[_0x0d88('0x1f')](function(_0x24e4a7){return _0x24e4a7;});}return null;};}function removeEntity(_0x45cf9e,_0x21af39){return function(_0x27a16e){if(_0x27a16e){return _0x27a16e[_0x0d88('0x35')]()['then'](function(){_0x45cf9e[_0x0d88('0x2a')](0xcc)[_0x0d88('0x36')]();});}};}function handleEntityNotFound(_0x2e0872,_0x436e16){return function(_0x27b7b6){if(!_0x27b7b6){_0x2e0872[_0x0d88('0x29')](0x194);}return _0x27b7b6;};}function handleError(_0x267342,_0xb26b94){_0xb26b94=_0xb26b94||0x1f4;return function(_0x59c2ba){logger[_0x0d88('0x24')](_0x59c2ba[_0x0d88('0x37')]);if(_0x59c2ba[_0x0d88('0x38')]){delete _0x59c2ba[_0x0d88('0x38')];}_0x267342[_0x0d88('0x2a')](_0xb26b94)['send'](_0x59c2ba);};}exports['index']=function(_0xbd236d,_0x278e60){var _0x311f63={},_0x358720={},_0x262b49={'count':0x0,'rows':[]};var _0x599117=_['map'](db[_0x0d88('0x39')][_0x0d88('0x3a')],function(_0x3d7317){return{'name':_0x3d7317['fieldName'],'type':_0x3d7317[_0x0d88('0x3b')][_0x0d88('0x3c')]};});_0x358720['model']=_['map'](_0x599117,_0x0d88('0x38'));_0x358720['query']=_[_0x0d88('0x3d')](_0xbd236d[_0x0d88('0x3e')]);_0x358720[_0x0d88('0x3f')]=_['intersection'](_0x358720[_0x0d88('0x40')],_0x358720['query']);_0x311f63[_0x0d88('0x41')]=_[_0x0d88('0x42')](_0x358720[_0x0d88('0x40')],qs[_0x0d88('0x43')](_0xbd236d[_0x0d88('0x3e')]['fields']));_0x311f63[_0x0d88('0x41')]=_0x311f63[_0x0d88('0x41')]['length']?_0x311f63[_0x0d88('0x41')]:_0x358720['model'];if(!_0xbd236d['query'][_0x0d88('0x44')](_0x0d88('0x45'))){_0x311f63[_0x0d88('0x2e')]=qs['limit'](_0xbd236d[_0x0d88('0x3e')][_0x0d88('0x2e')]);_0x311f63['offset']=qs[_0x0d88('0x2c')](_0xbd236d['query'][_0x0d88('0x2c')]);}_0x311f63['order']=qs[_0x0d88('0x46')](_0xbd236d[_0x0d88('0x3e')][_0x0d88('0x46')]);_0x311f63[_0x0d88('0x47')]=qs['filters'](_[_0x0d88('0x48')](_0xbd236d[_0x0d88('0x3e')],_0x358720[_0x0d88('0x3f')]),_0x599117);if(_0xbd236d['query'][_0x0d88('0x49')]){_0x311f63[_0x0d88('0x47')]=_[_0x0d88('0x4a')](_0x311f63[_0x0d88('0x47')],{'$or':_[_0x0d88('0x4b')](_0x599117,function(_0x153577){if(_0x153577['type']!=='VIRTUAL'){var _0x6dccd1={};_0x6dccd1[_0x153577['name']]={'$like':'%'+_0xbd236d['query']['filter']+'%'};return _0x6dccd1;}})});}_0x311f63=_[_0x0d88('0x4a')]({},_0x311f63,_0xbd236d[_0x0d88('0x4c')]);var _0x15e8a6={'where':_0x311f63[_0x0d88('0x47')]};return db[_0x0d88('0x39')][_0x0d88('0x2f')](_0x15e8a6)[_0x0d88('0x1f')](function(_0x30c9a5){_0x262b49[_0x0d88('0x2f')]=_0x30c9a5;if(_0xbd236d[_0x0d88('0x3e')][_0x0d88('0x4d')]){_0x311f63[_0x0d88('0x4e')]=[{'all':!![]}];}return db['ChatMessage'][_0x0d88('0x4f')](_0x311f63);})['then'](function(_0x35d874){_0x262b49[_0x0d88('0x50')]=_0x35d874;return _0x262b49;})[_0x0d88('0x1f')](respondWithFilteredResult(_0x278e60,_0x311f63))[_0x0d88('0x28')](handleError(_0x278e60,null));};exports[_0x0d88('0x51')]=function(_0x4d5b4f,_0x371bad){var _0x5c1b4e={'raw':!![],'where':{'id':_0x4d5b4f['params']['id']}},_0x338a50={};_0x338a50[_0x0d88('0x40')]=_[_0x0d88('0x3d')](db[_0x0d88('0x39')][_0x0d88('0x3a')]);_0x338a50['query']=_[_0x0d88('0x3d')](_0x4d5b4f[_0x0d88('0x3e')]);_0x338a50['filters']=_[_0x0d88('0x42')](_0x338a50['model'],_0x338a50['query']);_0x5c1b4e[_0x0d88('0x41')]=_[_0x0d88('0x42')](_0x338a50['model'],qs[_0x0d88('0x43')](_0x4d5b4f['query'][_0x0d88('0x43')]));_0x5c1b4e[_0x0d88('0x41')]=_0x5c1b4e[_0x0d88('0x41')][_0x0d88('0x52')]?_0x5c1b4e[_0x0d88('0x41')]:_0x338a50[_0x0d88('0x40')];if(_0x4d5b4f[_0x0d88('0x3e')][_0x0d88('0x4d')]){_0x5c1b4e[_0x0d88('0x4e')]=[{'all':!![]}];}_0x5c1b4e=_[_0x0d88('0x4a')]({},_0x5c1b4e,_0x4d5b4f[_0x0d88('0x4c')]);return db[_0x0d88('0x39')][_0x0d88('0x53')](_0x5c1b4e)[_0x0d88('0x1f')](handleEntityNotFound(_0x371bad,null))['then'](respondWithResult(_0x371bad,null))[_0x0d88('0x28')](handleError(_0x371bad,null));};exports[_0x0d88('0x54')]=function(_0x1811fb,_0xc84a59){return db[_0x0d88('0x39')][_0x0d88('0x54')](_0x1811fb[_0x0d88('0x55')],{})[_0x0d88('0x1f')](respondWithResult(_0xc84a59,0xc9))[_0x0d88('0x28')](handleError(_0xc84a59,null));};exports['update']=function(_0x585e85,_0xf10d94){if(_0x585e85['body']['id']){delete _0x585e85['body']['id'];}return db[_0x0d88('0x39')][_0x0d88('0x53')]({'where':{'id':_0x585e85[_0x0d88('0x56')]['id']}})['then'](handleEntityNotFound(_0xf10d94,null))[_0x0d88('0x1f')](saveUpdates(_0x585e85['body'],null))['then'](respondWithResult(_0xf10d94,null))['catch'](handleError(_0xf10d94,null));};exports[_0x0d88('0x35')]=function(_0xdc6a78,_0x5599f8){return db[_0x0d88('0x39')][_0x0d88('0x53')]({'where':{'id':_0xdc6a78['params']['id']}})[_0x0d88('0x1f')](handleEntityNotFound(_0x5599f8,null))[_0x0d88('0x1f')](removeEntity(_0x5599f8,null))[_0x0d88('0x28')](handleError(_0x5599f8,null));};exports[_0x0d88('0x57')]=function(_0x5e0418,_0x288c0d){return db['ChatMessage'][_0x0d88('0x57')]()[_0x0d88('0x1f')](respondWithResult(_0x288c0d,null))['catch'](handleError(_0x288c0d,null));};var interaction_log=require('../../config/logger')(_0x0d88('0x58'));exports[_0x0d88('0x59')]=function(_0x6fde03,_0xfa2646,_0x213fdb){var _0x391794={'agent':{},'channel':_0x0d88('0x5a')};if(_0x6fde03[_0x0d88('0x55')]['id']){delete _0x6fde03[_0x0d88('0x55')]['id'];}_0x6fde03[_0x0d88('0x55')][_0x0d88('0x5b')]=!![];_0x6fde03['body'][_0x0d88('0x5c')]=moment()[_0x0d88('0x5d')](_0x0d88('0x5e'));_0x6fde03[_0x0d88('0x55')][_0x0d88('0x5f')]=_0x6fde03[_0x0d88('0x55')][_0x0d88('0x5f')]||_0x6fde03[_0x0d88('0x60')]['id'];_0x391794[_0x0d88('0x61')]['id']=_0x6fde03[_0x0d88('0x55')][_0x0d88('0x5f')];return db[_0x0d88('0x39')][_0x0d88('0x53')]({'where':{'id':_0x6fde03[_0x0d88('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xfa2646,null))[_0x0d88('0x1f')](saveUpdates(_0x6fde03['body'],null))['then'](function(_0x98e0e5){if(_0x98e0e5){_0x391794[_0x0d88('0x26')]=_0x98e0e5[_0x0d88('0x62')]({'plain':!![]});return db[_0x0d88('0x63')][_0x0d88('0x53')]({'where':{'id':_0x98e0e5[_0x0d88('0x64')]}});}return null;})[_0x0d88('0x1f')](handleEntityNotFound(_0xfa2646,null))[_0x0d88('0x1f')](function(_0x4b05d4){if(_0x4b05d4){return _0x4b05d4[_0x0d88('0x65')]({'UserId':_0x6fde03[_0x0d88('0x55')][_0x0d88('0x5f')],'read1stAt':_[_0x0d88('0x66')](_0x4b05d4['read1stAt'])?moment()[_0x0d88('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0d88('0x1f')](function(_0x3463d4){if(_0x3463d4){_0x391794[_0x0d88('0x67')]=_0x3463d4['get']({'plain':!![]});interaction_log[_0x0d88('0x20')](_0x0d88('0x68'),_0x6fde03[_0x0d88('0x60')]['id'],_0x6fde03[_0x0d88('0x60')][_0x0d88('0x38')],_0x6fde03[_0x0d88('0x60')][_0x0d88('0x69')],_0x391794['interaction']['id'],_0x6fde03[_0x0d88('0x55')]?JSON[_0x0d88('0x6a')](_0x6fde03[_0x0d88('0x55')]):'null');return respondWithRpcPromise(_0x0d88('0x6b'),_0x0d88('0x6c'),_0x391794);}return null;})[_0x0d88('0x1f')](function(_0x29e937){var _0x1896b0=_0x0d88('0x6d')+_0x29e937[_0x0d88('0x26')]['ContactId'];return db[_0x0d88('0x6e')][_0x0d88('0x3e')](_0x1896b0,{'type':db['Sequelize'][_0x0d88('0x6f')][_0x0d88('0x70')],'raw':!![]})[_0x0d88('0x1f')](function(_0x456852){return _0x456852;});})[_0x0d88('0x1f')](function(_0x1bc829){if(_0x1bc829){_0x391794['message']['contact']=_0x1bc829[0x0];if(!_0x6fde03[_0x0d88('0x55')][_0x0d88('0x5f')])return;return db[_0x0d88('0x71')]['find']({'where':{'id':_0x6fde03[_0x0d88('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0x0d88('0x38'),_0x0d88('0x72'),'email',_0x0d88('0x73')],'raw':!![]});}return null;})[_0x0d88('0x1f')](function(_0x338a01){if(!_0x338a01)return null;_0x391794[_0x0d88('0x26')][_0x0d88('0x61')]=_0x338a01;return _0x391794;})[_0x0d88('0x1f')](function(_0x3d9540){if(_0x3d9540){if(_0x6fde03[_0x0d88('0x55')][_0x0d88('0x74')]){_0x391794[_0x0d88('0x26')][_0x0d88('0x75')]=util[_0x0d88('0x5d')](_0x0d88('0x76'),_0x6fde03[_0x0d88('0x60')][_0x0d88('0x38')]);_0x391794[_0x0d88('0x26')][_0x0d88('0x77')]=_0x391794[_0x0d88('0x77')];_0x391794['message']['motionChannel']=_0x391794[_0x0d88('0x77')];_0x391794[_0x0d88('0x26')][_0x0d88('0x78')]=_0x0d88('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x0d88('0x79'),'message':_[_0x0d88('0x4a')](_0x391794['message'],JSON[_0x0d88('0x7a')](_0x391794[_0x0d88('0x67')]['formData']))},client9002)[_0x0d88('0x1f')](function(){return _0x391794;});}return _0x391794;}return null;})[_0x0d88('0x1f')](respondWithResult(_0xfa2646,null))[_0x0d88('0x28')](handleError(_0xfa2646,null));};var interaction_log=require(_0x0d88('0x7b'))(_0x0d88('0x58'));exports[_0x0d88('0x33')]=function(_0x3f58bb,_0x29e423,_0x5b4dd0){var _0x520add={'agent':{},'channel':_0x0d88('0x5a')};if(_0x3f58bb[_0x0d88('0x55')]['id']){delete _0x3f58bb['body']['id'];}_0x3f58bb[_0x0d88('0x55')][_0x0d88('0x5f')]=_0x3f58bb[_0x0d88('0x55')][_0x0d88('0x5f')]||_0x3f58bb['user']['id'];_0x520add[_0x0d88('0x61')]['id']=_0x3f58bb['body'][_0x0d88('0x5f')];return db[_0x0d88('0x39')][_0x0d88('0x53')]({'where':{'id':_0x3f58bb[_0x0d88('0x56')]['id'],'UserId':null}})[_0x0d88('0x1f')](handleEntityNotFound(_0x29e423,null))[_0x0d88('0x1f')](function(_0x34fda6){if(_0x34fda6){_0x520add[_0x0d88('0x26')]=_0x34fda6[_0x0d88('0x62')]({'plain':!![]});return db[_0x0d88('0x63')][_0x0d88('0x53')]({'where':{'id':_0x34fda6[_0x0d88('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x29e423,null))[_0x0d88('0x1f')](function(_0xe8adcf){if(_0xe8adcf){_0x520add[_0x0d88('0x67')]=_0xe8adcf[_0x0d88('0x62')]({'plain':!![]});interaction_log[_0x0d88('0x20')](_0x0d88('0x7c'),_0x3f58bb[_0x0d88('0x60')]['id'],_0x3f58bb['user'][_0x0d88('0x38')],_0x3f58bb[_0x0d88('0x60')]['role'],_0x520add[_0x0d88('0x67')]['id'],_0x3f58bb[_0x0d88('0x55')]?JSON[_0x0d88('0x6a')](_0x3f58bb[_0x0d88('0x55')]):_0x0d88('0x7d'));return respondWithRpcPromise(_0x0d88('0x7e'),_0x0d88('0x7f'),_0x520add);}return null;})[_0x0d88('0x1f')](function(_0x27f0f3){var _0x5acf83=_0x0d88('0x6d')+_0x27f0f3[_0x0d88('0x26')][_0x0d88('0x80')];return db[_0x0d88('0x6e')][_0x0d88('0x3e')](_0x5acf83,{'type':db[_0x0d88('0x81')][_0x0d88('0x6f')][_0x0d88('0x70')],'raw':!![]})[_0x0d88('0x1f')](function(_0xa9ca61){return _0xa9ca61;});})['then'](function(_0x46b33e){if(_0x46b33e){_0x520add[_0x0d88('0x26')]['contact']=_0x46b33e[0x0];if(!_0x3f58bb[_0x0d88('0x55')][_0x0d88('0x5f')])return;return db[_0x0d88('0x71')][_0x0d88('0x53')]({'where':{'id':_0x3f58bb['body'][_0x0d88('0x5f')],'role':_0x0d88('0x61')},'attributes':['id',_0x0d88('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x372bec){if(!_0x372bec)return null;_0x520add[_0x0d88('0x26')][_0x0d88('0x61')]=_0x372bec;return _0x520add;})[_0x0d88('0x1f')](function(_0xb42e06){if(_0xb42e06){_0xb42e06[_0x0d88('0x26')][_0x0d88('0x75')]=util['format'](_0x0d88('0x76'),_0x3f58bb[_0x0d88('0x60')][_0x0d88('0x38')]);_0xb42e06[_0x0d88('0x26')][_0x0d88('0x77')]=_0x520add[_0x0d88('0x77')];_0xb42e06[_0x0d88('0x26')][_0x0d88('0x82')]=_0x520add[_0x0d88('0x77')];_0xb42e06['message'][_0x0d88('0x78')]='reject';respondWithRpcPromise(_0x0d88('0x83'),'EventManager',{'event':'rejectmessage','message':_[_0x0d88('0x4a')](_0x520add[_0x0d88('0x26')],JSON[_0x0d88('0x7a')](_0x520add['interaction'][_0x0d88('0x84')]))},client9002);return _0x520add;}return null;})['then'](respondWithResult(_0x29e423,null))[_0x0d88('0x28')](handleError(_0x29e423,null));};
\ No newline at end of file
+var _0x609e=['request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','filters','options','find','create','body','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteraction','isNil','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','agent','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','User','interface','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./chatMessage.socket','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x609e,0xf1));var _0xe609=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x609e[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require(_0xe609('0x0'));var rimraf=require(_0xe609('0x1'));var zipdir=require(_0xe609('0x2'));var jsonpatch=require(_0xe609('0x3'));var rp=require(_0xe609('0x4'));var moment=require(_0xe609('0x5'));var BPromise=require(_0xe609('0x6'));var Mustache=require(_0xe609('0x7'));var util=require(_0xe609('0x8'));var path=require(_0xe609('0x9'));var sox=require(_0xe609('0xa'));var csv=require(_0xe609('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe609('0xc'));var _=require(_0xe609('0xd'));var squel=require(_0xe609('0xe'));var crypto=require(_0xe609('0xf'));var jsforce=require(_0xe609('0x10'));var deskjs=require(_0xe609('0x11'));var toCsv=require(_0xe609('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe609('0x12'));var authService=require(_0xe609('0x13'));var qs=require(_0xe609('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe609('0x15'))(_0xe609('0x16'));var utils=require(_0xe609('0x17'));var config=require(_0xe609('0x18'));var licenseUtil=require(_0xe609('0x19'));var db=require(_0xe609('0x1a'))['db'];config['redis']=_[_0xe609('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe609('0x1c'))(new Redis(config[_0xe609('0x1d')]));require(_0xe609('0x1e'))['register'](socket);var jayson=require(_0xe609('0x1f'));var client=jayson[_0xe609('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0xe609('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x257300,_0x2eb6a8,_0x59b14e,_0x2456f7){return new BPromise(function(_0x449438,_0x12099b){var _0x2c2168=_0x2456f7||client;return _0x2c2168['request'](_0x257300,_0x59b14e)[_0xe609('0x22')](function(_0x4c075d){logger[_0xe609('0x23')](_0xe609('0x24'),_0x2eb6a8,_0xe609('0x25'));logger[_0xe609('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2eb6a8,_0xe609('0x25'),JSON[_0xe609('0x27')](_0x4c075d));if(_0x4c075d[_0xe609('0x28')]){if(_0x4c075d[_0xe609('0x28')]['code']===0x1f4){logger[_0xe609('0x28')](_0xe609('0x24'),_0x2eb6a8,_0x4c075d[_0xe609('0x28')][_0xe609('0x29')]);return _0x12099b(_0x4c075d[_0xe609('0x28')][_0xe609('0x29')]);}logger[_0xe609('0x28')](_0xe609('0x24'),_0x2eb6a8,_0x4c075d[_0xe609('0x28')][_0xe609('0x29')]);return _0x449438(_0x4c075d[_0xe609('0x28')][_0xe609('0x29')]);}else{logger['info'](_0xe609('0x24'),_0x2eb6a8,'request\x20sent');_0x449438(_0x4c075d[_0xe609('0x2a')]['message']);}})[_0xe609('0x2b')](function(_0x224f54){logger[_0xe609('0x28')]('ChatMessage,\x20%s,\x20%s',_0x2eb6a8,_0x224f54);_0x12099b(_0x224f54);});});}function respondWithStatusCode(_0x4fa2b4,_0x418449){_0x418449=_0x418449||0xcc;return function(_0x3273b6){if(_0x3273b6){return _0x4fa2b4[_0xe609('0x2c')](_0x418449);}return _0x4fa2b4[_0xe609('0x2d')](_0x418449)[_0xe609('0x2e')]();};}function respondWithResult(_0x369a96,_0xf00111){_0xf00111=_0xf00111||0xc8;return function(_0x19922b){if(_0x19922b){return _0x369a96[_0xe609('0x2d')](_0xf00111)[_0xe609('0x2f')](_0x19922b);}};}function respondWithFilteredResult(_0xdc3ffb,_0x1ba7ce){return function(_0xb5916){if(_0xb5916){var _0x3ed40c=typeof _0x1ba7ce[_0xe609('0x30')]===_0xe609('0x31')&&typeof _0x1ba7ce['limit']===_0xe609('0x31');var _0x6e5ffe=_0xb5916[_0xe609('0x32')];var _0x505aa9=_0x3ed40c?0x0:_0x1ba7ce[_0xe609('0x30')];var _0x20a4f6=_0x3ed40c?_0xb5916[_0xe609('0x32')]:_0x1ba7ce[_0xe609('0x30')]+_0x1ba7ce[_0xe609('0x33')];var _0x91ad56;if(_0x20a4f6>=_0x6e5ffe){_0x20a4f6=_0x6e5ffe;_0x91ad56=0xc8;}else{_0x91ad56=0xce;}_0xdc3ffb[_0xe609('0x2d')](_0x91ad56);return _0xdc3ffb[_0xe609('0x34')](_0xe609('0x35'),_0x505aa9+'-'+_0x20a4f6+'/'+_0x6e5ffe)[_0xe609('0x2f')](_0xb5916);}return null;};}function patchUpdates(_0x3cbd57){return function(_0x54b6cf){try{jsonpatch['apply'](_0x54b6cf,_0x3cbd57,!![]);}catch(_0xf8ffb){return BPromise[_0xe609('0x36')](_0xf8ffb);}return _0x54b6cf[_0xe609('0x37')]();};}function saveUpdates(_0x5df935,_0x546927){return function(_0x1221f5){if(_0x1221f5){return _0x1221f5[_0xe609('0x38')](_0x5df935)[_0xe609('0x22')](function(_0x107dab){return _0x107dab;});}return null;};}function removeEntity(_0xcd54b4,_0x4d1b20){return function(_0x29cf58){if(_0x29cf58){return _0x29cf58[_0xe609('0x39')]()[_0xe609('0x22')](function(){_0xcd54b4[_0xe609('0x2d')](0xcc)[_0xe609('0x2e')]();});}};}function handleEntityNotFound(_0x5131bd,_0x38f56a){return function(_0x208aad){if(!_0x208aad){_0x5131bd['sendStatus'](0x194);}return _0x208aad;};}function handleError(_0x424e3c,_0x5b9fbf){_0x5b9fbf=_0x5b9fbf||0x1f4;return function(_0x17860c){logger[_0xe609('0x28')](_0x17860c[_0xe609('0x3a')]);if(_0x17860c[_0xe609('0x3b')]){delete _0x17860c[_0xe609('0x3b')];}_0x424e3c[_0xe609('0x2d')](_0x5b9fbf)[_0xe609('0x3c')](_0x17860c);};}exports[_0xe609('0x3d')]=function(_0x3283af,_0x4c250b){var _0x2cccc1={},_0x1c75c3={},_0x1e1399={'count':0x0,'rows':[]};var _0x779866=_['map'](db[_0xe609('0x3e')][_0xe609('0x3f')],function(_0x58097a){return{'name':_0x58097a[_0xe609('0x40')],'type':_0x58097a['type'][_0xe609('0x41')]};});_0x1c75c3['model']=_[_0xe609('0x42')](_0x779866,_0xe609('0x3b'));_0x1c75c3[_0xe609('0x43')]=_[_0xe609('0x44')](_0x3283af[_0xe609('0x43')]);_0x1c75c3['filters']=_['intersection'](_0x1c75c3[_0xe609('0x45')],_0x1c75c3[_0xe609('0x43')]);_0x2cccc1[_0xe609('0x46')]=_[_0xe609('0x47')](_0x1c75c3[_0xe609('0x45')],qs['fields'](_0x3283af[_0xe609('0x43')][_0xe609('0x48')]));_0x2cccc1[_0xe609('0x46')]=_0x2cccc1[_0xe609('0x46')][_0xe609('0x49')]?_0x2cccc1[_0xe609('0x46')]:_0x1c75c3[_0xe609('0x45')];if(!_0x3283af['query'][_0xe609('0x4a')](_0xe609('0x4b'))){_0x2cccc1[_0xe609('0x33')]=qs[_0xe609('0x33')](_0x3283af[_0xe609('0x43')][_0xe609('0x33')]);_0x2cccc1[_0xe609('0x30')]=qs[_0xe609('0x30')](_0x3283af[_0xe609('0x43')]['offset']);}_0x2cccc1[_0xe609('0x4c')]=qs[_0xe609('0x4d')](_0x3283af[_0xe609('0x43')][_0xe609('0x4d')]);_0x2cccc1[_0xe609('0x4e')]=qs['filters'](_[_0xe609('0x4f')](_0x3283af[_0xe609('0x43')],_0x1c75c3['filters']),_0x779866);if(_0x3283af['query'][_0xe609('0x50')]){_0x2cccc1['where']=_[_0xe609('0x51')](_0x2cccc1['where'],{'$or':_[_0xe609('0x42')](_0x779866,function(_0xe9f6f0){if(_0xe9f6f0[_0xe609('0x52')]!==_0xe609('0x53')){var _0x258df2={};_0x258df2[_0xe9f6f0[_0xe609('0x3b')]]={'$like':'%'+_0x3283af[_0xe609('0x43')][_0xe609('0x50')]+'%'};return _0x258df2;}})});}_0x2cccc1=_[_0xe609('0x51')]({},_0x2cccc1,_0x3283af['options']);var _0x195c9f={'where':_0x2cccc1['where']};return db[_0xe609('0x3e')][_0xe609('0x32')](_0x195c9f)[_0xe609('0x22')](function(_0x4ff63d){_0x1e1399['count']=_0x4ff63d;if(_0x3283af[_0xe609('0x43')][_0xe609('0x54')]){_0x2cccc1[_0xe609('0x55')]=[{'all':!![]}];}return db[_0xe609('0x3e')][_0xe609('0x56')](_0x2cccc1);})[_0xe609('0x22')](function(_0xac0911){_0x1e1399[_0xe609('0x57')]=_0xac0911;return _0x1e1399;})[_0xe609('0x22')](respondWithFilteredResult(_0x4c250b,_0x2cccc1))[_0xe609('0x2b')](handleError(_0x4c250b,null));};exports[_0xe609('0x58')]=function(_0x3edc41,_0x596a1e){var _0x37f50a={'raw':!![],'where':{'id':_0x3edc41[_0xe609('0x59')]['id']}},_0x53ff50={};_0x53ff50[_0xe609('0x45')]=_['keys'](db[_0xe609('0x3e')]['rawAttributes']);_0x53ff50['query']=_[_0xe609('0x44')](_0x3edc41[_0xe609('0x43')]);_0x53ff50[_0xe609('0x5a')]=_[_0xe609('0x47')](_0x53ff50['model'],_0x53ff50[_0xe609('0x43')]);_0x37f50a[_0xe609('0x46')]=_[_0xe609('0x47')](_0x53ff50[_0xe609('0x45')],qs['fields'](_0x3edc41[_0xe609('0x43')][_0xe609('0x48')]));_0x37f50a[_0xe609('0x46')]=_0x37f50a[_0xe609('0x46')][_0xe609('0x49')]?_0x37f50a[_0xe609('0x46')]:_0x53ff50[_0xe609('0x45')];if(_0x3edc41[_0xe609('0x43')][_0xe609('0x54')]){_0x37f50a[_0xe609('0x55')]=[{'all':!![]}];}_0x37f50a=_[_0xe609('0x51')]({},_0x37f50a,_0x3edc41[_0xe609('0x5b')]);return db[_0xe609('0x3e')][_0xe609('0x5c')](_0x37f50a)['then'](handleEntityNotFound(_0x596a1e,null))[_0xe609('0x22')](respondWithResult(_0x596a1e,null))[_0xe609('0x2b')](handleError(_0x596a1e,null));};exports[_0xe609('0x5d')]=function(_0x41fc18,_0x22f00e){return db[_0xe609('0x3e')][_0xe609('0x5d')](_0x41fc18[_0xe609('0x5e')],{})[_0xe609('0x22')](respondWithResult(_0x22f00e,0xc9))[_0xe609('0x2b')](handleError(_0x22f00e,null));};exports['update']=function(_0x24dfbb,_0x28d45d){if(_0x24dfbb[_0xe609('0x5e')]['id']){delete _0x24dfbb[_0xe609('0x5e')]['id'];}return db['ChatMessage'][_0xe609('0x5c')]({'where':{'id':_0x24dfbb[_0xe609('0x59')]['id']}})[_0xe609('0x22')](handleEntityNotFound(_0x28d45d,null))[_0xe609('0x22')](saveUpdates(_0x24dfbb[_0xe609('0x5e')],null))[_0xe609('0x22')](respondWithResult(_0x28d45d,null))['catch'](handleError(_0x28d45d,null));};exports[_0xe609('0x39')]=function(_0x4fd609,_0x562956){return db[_0xe609('0x3e')][_0xe609('0x5c')]({'where':{'id':_0x4fd609[_0xe609('0x59')]['id']}})['then'](handleEntityNotFound(_0x562956,null))[_0xe609('0x22')](removeEntity(_0x562956,null))[_0xe609('0x2b')](handleError(_0x562956,null));};exports[_0xe609('0x5f')]=function(_0x3edaea,_0xea51f3){return db[_0xe609('0x3e')][_0xe609('0x5f')]()[_0xe609('0x22')](respondWithResult(_0xea51f3,null))[_0xe609('0x2b')](handleError(_0xea51f3,null));};var interaction_log=require('../../config/logger')(_0xe609('0x60'));exports[_0xe609('0x61')]=function(_0x3bca76,_0x49c8e7,_0x20113c){var _0x5dc4fb={'agent':{},'channel':_0xe609('0x62')};if(_0x3bca76[_0xe609('0x5e')]['id']){delete _0x3bca76[_0xe609('0x5e')]['id'];}_0x3bca76[_0xe609('0x5e')]['read']=!![];_0x3bca76[_0xe609('0x5e')][_0xe609('0x63')]=moment()[_0xe609('0x64')](_0xe609('0x65'));_0x3bca76[_0xe609('0x5e')][_0xe609('0x66')]=_0x3bca76[_0xe609('0x5e')][_0xe609('0x66')]||_0x3bca76['user']['id'];_0x5dc4fb['agent']['id']=_0x3bca76[_0xe609('0x5e')][_0xe609('0x66')];return db['ChatMessage']['find']({'where':{'id':_0x3bca76[_0xe609('0x59')]['id'],'UserId':null}})[_0xe609('0x22')](handleEntityNotFound(_0x49c8e7,null))['then'](saveUpdates(_0x3bca76[_0xe609('0x5e')],null))[_0xe609('0x22')](function(_0x134de0){if(_0x134de0){_0x5dc4fb['message']=_0x134de0['get']({'plain':!![]});return db[_0xe609('0x67')]['find']({'where':{'id':_0x134de0['ChatInteractionId']}});}return null;})[_0xe609('0x22')](handleEntityNotFound(_0x49c8e7,null))[_0xe609('0x22')](function(_0x22828b){if(_0x22828b){return _0x22828b[_0xe609('0x38')]({'UserId':_0x3bca76['body'][_0xe609('0x66')],'read1stAt':_[_0xe609('0x68')](_0x22828b['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe609('0x22')](function(_0x556d88){if(_0x556d88){_0x5dc4fb[_0xe609('0x69')]=_0x556d88[_0xe609('0x6a')]({'plain':!![]});interaction_log[_0xe609('0x23')](_0xe609('0x6b'),_0x3bca76[_0xe609('0x6c')]['id'],_0x3bca76[_0xe609('0x6c')][_0xe609('0x3b')],_0x3bca76['user'][_0xe609('0x6d')],_0x5dc4fb[_0xe609('0x69')]['id'],_0x3bca76[_0xe609('0x5e')]?JSON[_0xe609('0x27')](_0x3bca76[_0xe609('0x5e')]):_0xe609('0x6e'));return respondWithRpcPromise(_0xe609('0x6f'),_0xe609('0x70'),_0x5dc4fb);}return null;})[_0xe609('0x22')](function(_0x2ce6f1){var _0x5c03c2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2ce6f1[_0xe609('0x29')][_0xe609('0x71')];return db[_0xe609('0x72')]['query'](_0x5c03c2,{'type':db[_0xe609('0x73')]['QueryTypes'][_0xe609('0x74')],'raw':!![]})['then'](function(_0x232187){return _0x232187;});})[_0xe609('0x22')](function(_0x1d5b5a){if(_0x1d5b5a){_0x5dc4fb['message'][_0xe609('0x75')]=_0x1d5b5a[0x0];if(!_0x3bca76[_0xe609('0x5e')][_0xe609('0x66')])return;return db['User'][_0xe609('0x5c')]({'where':{'id':_0x3bca76[_0xe609('0x5e')][_0xe609('0x66')],'role':_0xe609('0x76')},'attributes':['id','name',_0xe609('0x77'),_0xe609('0x78'),_0xe609('0x79')],'raw':!![]});}return null;})[_0xe609('0x22')](function(_0x4700a0){if(!_0x4700a0)return null;_0x5dc4fb[_0xe609('0x29')][_0xe609('0x76')]=_0x4700a0;return _0x5dc4fb;})['then'](function(_0x54ec4c){if(_0x54ec4c){if(_0x3bca76['body']['manual']){_0x5dc4fb['message']['interface']=util[_0xe609('0x64')](_0xe609('0x7a'),_0x3bca76[_0xe609('0x6c')][_0xe609('0x3b')]);_0x5dc4fb[_0xe609('0x29')][_0xe609('0x7b')]=_0x5dc4fb['channel'];_0x5dc4fb['message'][_0xe609('0x7c')]=_0x5dc4fb[_0xe609('0x7b')];_0x5dc4fb['message'][_0xe609('0x7d')]=_0xe609('0x61');return respondWithRpcPromise(_0xe609('0x7e'),_0xe609('0x7e'),{'event':_0xe609('0x7f'),'message':_[_0xe609('0x51')](_0x5dc4fb[_0xe609('0x29')],JSON['parse'](_0x5dc4fb['interaction'][_0xe609('0x80')]))},client9002)['then'](function(){return _0x5dc4fb;});}return _0x5dc4fb;}return null;})['then'](respondWithResult(_0x49c8e7,null))['catch'](handleError(_0x49c8e7,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xe609('0x36')]=function(_0x38579b,_0x8681,_0xa91140){var _0x43eef9={'agent':{},'channel':_0xe609('0x62')};if(_0x38579b[_0xe609('0x5e')]['id']){delete _0x38579b[_0xe609('0x5e')]['id'];}_0x38579b['body'][_0xe609('0x66')]=_0x38579b[_0xe609('0x5e')][_0xe609('0x66')]||_0x38579b[_0xe609('0x6c')]['id'];_0x43eef9[_0xe609('0x76')]['id']=_0x38579b[_0xe609('0x5e')][_0xe609('0x66')];return db[_0xe609('0x3e')][_0xe609('0x5c')]({'where':{'id':_0x38579b[_0xe609('0x59')]['id'],'UserId':null}})[_0xe609('0x22')](handleEntityNotFound(_0x8681,null))[_0xe609('0x22')](function(_0x467b66){if(_0x467b66){_0x43eef9[_0xe609('0x29')]=_0x467b66[_0xe609('0x6a')]({'plain':!![]});return db[_0xe609('0x67')][_0xe609('0x5c')]({'where':{'id':_0x467b66[_0xe609('0x81')]}});}return null;})[_0xe609('0x22')](handleEntityNotFound(_0x8681,null))[_0xe609('0x22')](function(_0x3e49ae){if(_0x3e49ae){_0x43eef9[_0xe609('0x69')]=_0x3e49ae['get']({'plain':!![]});interaction_log[_0xe609('0x23')](_0xe609('0x82'),_0x38579b[_0xe609('0x6c')]['id'],_0x38579b[_0xe609('0x6c')][_0xe609('0x3b')],_0x38579b[_0xe609('0x6c')]['role'],_0x43eef9[_0xe609('0x69')]['id'],_0x38579b['body']?JSON[_0xe609('0x27')](_0x38579b[_0xe609('0x5e')]):_0xe609('0x6e'));return respondWithRpcPromise(_0xe609('0x83'),_0xe609('0x84'),_0x43eef9);}return null;})['then'](function(_0x1f0ab6){var _0xe16c4f=_0xe609('0x85')+_0x1f0ab6['message'][_0xe609('0x71')];return db[_0xe609('0x72')][_0xe609('0x43')](_0xe16c4f,{'type':db[_0xe609('0x73')][_0xe609('0x86')][_0xe609('0x74')],'raw':!![]})[_0xe609('0x22')](function(_0x11a381){return _0x11a381;});})[_0xe609('0x22')](function(_0x26a24d){if(_0x26a24d){_0x43eef9[_0xe609('0x29')][_0xe609('0x75')]=_0x26a24d[0x0];if(!_0x38579b['body']['UserId'])return;return db[_0xe609('0x87')][_0xe609('0x5c')]({'where':{'id':_0x38579b['body'][_0xe609('0x66')],'role':'agent'},'attributes':['id',_0xe609('0x3b'),_0xe609('0x77'),_0xe609('0x78'),_0xe609('0x79')],'raw':!![]});}return null;})[_0xe609('0x22')](function(_0x4e2428){if(!_0x4e2428)return null;_0x43eef9[_0xe609('0x29')]['agent']=_0x4e2428;return _0x43eef9;})[_0xe609('0x22')](function(_0x3322d0){if(_0x3322d0){_0x3322d0[_0xe609('0x29')][_0xe609('0x88')]=util['format'](_0xe609('0x7a'),_0x38579b[_0xe609('0x6c')][_0xe609('0x3b')]);_0x3322d0[_0xe609('0x29')][_0xe609('0x7b')]=_0x43eef9[_0xe609('0x7b')];_0x3322d0[_0xe609('0x29')]['motionChannel']=_0x43eef9['channel'];_0x3322d0['message'][_0xe609('0x7d')]='reject';respondWithRpcPromise(_0xe609('0x7e'),_0xe609('0x7e'),{'event':_0xe609('0x89'),'message':_[_0xe609('0x51')](_0x43eef9[_0xe609('0x29')],JSON[_0xe609('0x8a')](_0x43eef9[_0xe609('0x69')][_0xe609('0x80')]))},client9002);return _0x43eef9;}return null;})[_0xe609('0x22')](respondWithResult(_0x8681,null))[_0xe609('0x2b')](handleError(_0x8681,null));};
\ No newline at end of file
index 51f2341..4cff109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0e3=['exports','events','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x263323,_0x1f1924){var _0x5f0447=function(_0xd5ce57){while(--_0xd5ce57){_0x263323['push'](_0x263323['shift']());}};_0x5f0447(++_0x1f1924);}(_0xb0e3,0x86));var _0x3b0e=function(_0xf3de87,_0x2dd6a8){_0xf3de87=_0xf3de87-0x0;var _0x40e503=_0xb0e3[_0xf3de87];return _0x40e503;};'use strict';var EventEmitter=require(_0x3b0e('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3b0e('0x1')](0x0);var events={'afterCreate':_0x3b0e('0x2'),'afterUpdate':_0x3b0e('0x3'),'afterDestroy':_0x3b0e('0x4')};function emitEvent(_0xefa071){return function(_0x283d40,_0x286707,_0x2d2b91){ChatMessageEvents['emit'](_0xefa071+':'+_0x283d40['id'],_0x283d40);ChatMessageEvents['emit'](_0xefa071,_0x283d40);_0x2d2b91(null);};}for(var e in events){if(events[_0x3b0e('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x3b0e('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x3ee3=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x221a05,_0x26d7c){var _0xe32384=function(_0x196632){while(--_0x196632){_0x221a05['push'](_0x221a05['shift']());}};_0xe32384(++_0x26d7c);}(_0x3ee3,0x1b9));var _0x33ee=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3ee3[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x33ee('0x0'));var ChatMessage=require(_0x33ee('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x33ee('0x2')](0x0);var events={'afterCreate':_0x33ee('0x3'),'afterUpdate':_0x33ee('0x4'),'afterDestroy':_0x33ee('0x5')};function emitEvent(_0x1b8e3c){return function(_0x928bff,_0x2583ad,_0xdec4fd){ChatMessageEvents[_0x33ee('0x6')](_0x1b8e3c+':'+_0x928bff['id'],_0x928bff);ChatMessageEvents['emit'](_0x1b8e3c,_0x928bff);_0xdec4fd(null);};}for(var e in events){if(events[_0x33ee('0x7')](e)){var event=events[e];ChatMessage[_0x33ee('0x8')](e,emitEvent(event));}}module[_0x33ee('0x9')]=ChatMessageEvents;
\ No newline at end of file
index a4c1254..6e6cd10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4250=['chat_messages','fti_chat_messages','body','FULLTEXT','models','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x1c2d57,_0x295a8e){var _0x4231ea=function(_0x5ae278){while(--_0x5ae278){_0x1c2d57['push'](_0x1c2d57['shift']());}};_0x4231ea(++_0x295a8e);}(_0x4250,0x146));var _0x0425=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x4250[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0425('0x0'));var util=require(_0x0425('0x1'));var logger=require(_0x0425('0x2'))(_0x0425('0x3'));var moment=require('moment');var BPromise=require(_0x0425('0x4'));var rp=require(_0x0425('0x5'));var fs=require('fs');var path=require(_0x0425('0x6'));var rimraf=require('rimraf');var config=require(_0x0425('0x7'));var attributes=require(_0x0425('0x8'));module[_0x0425('0x9')]=function(_0x1e9547,_0x307761){return _0x1e9547[_0x0425('0xa')](_0x0425('0xb'),attributes,{'tableName':_0x0425('0xc'),'paranoid':![],'indexes':[{'name':_0x0425('0xd'),'fields':[_0x0425('0xe')],'type':_0x0425('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x765182,_0x5b9c2f,_0x4612cd){var _0x308c73=_0x1e9547[_0x0425('0x10')];var _0x357131=_0x765182['get']({'plain':!![]});if(_0x357131['direction'][_0x0425('0x11')]()==='in'||_0x357131['direction'][_0x0425('0x11')]()===_0x0425('0x12')&&!_0x357131['secret']&&!_[_0x0425('0x13')](_0x357131[_0x0425('0x14')])){_0x308c73[_0x0425('0x15')][_0x0425('0x16')]({'where':{'id':_0x357131['ChatInteractionId']}})[_0x0425('0x17')](function(_0x23e4fb){if(_0x23e4fb){_0x23e4fb['update']({'lastMsgAt':_0x357131['createdAt'],'lastMsgDirection':_0x357131['direction'][_0x0425('0x11')]()});}})[_0x0425('0x18')](function(_0x1cd255){console['error'](_0x1cd255);});}_0x4612cd();}},'charset':'utf8mb4','collate':_0x0425('0x19')});};
\ No newline at end of file
+var _0xfaf4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x386306,_0x1363c9){var _0xcb23d=function(_0x1fc525){while(--_0x1fc525){_0x386306['push'](_0x386306['shift']());}};_0xcb23d(++_0x1363c9);}(_0xfaf4,0x129));var _0x4faf=function(_0x4f3412,_0x39fb27){_0x4f3412=_0x4f3412-0x0;var _0x10b019=_0xfaf4[_0x4f3412];return _0x10b019;};'use strict';var _=require(_0x4faf('0x0'));var util=require('util');var logger=require(_0x4faf('0x1'))(_0x4faf('0x2'));var moment=require(_0x4faf('0x3'));var BPromise=require(_0x4faf('0x4'));var rp=require(_0x4faf('0x5'));var fs=require('fs');var path=require(_0x4faf('0x6'));var rimraf=require(_0x4faf('0x7'));var config=require(_0x4faf('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x21c146,_0x2051ed){return _0x21c146[_0x4faf('0x9')](_0x4faf('0xa'),attributes,{'tableName':_0x4faf('0xb'),'paranoid':![],'indexes':[{'name':_0x4faf('0xc'),'fields':[_0x4faf('0xd')],'type':_0x4faf('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x18989c,_0x3dc1ce,_0x29b16a){var _0x486d3d=_0x21c146[_0x4faf('0xf')];var _0x26c1cd=_0x18989c[_0x4faf('0x10')]({'plain':!![]});if(_0x26c1cd['direction'][_0x4faf('0x11')]()==='in'||_0x26c1cd[_0x4faf('0x12')]['toLowerCase']()===_0x4faf('0x13')&&!_0x26c1cd[_0x4faf('0x14')]&&!_[_0x4faf('0x15')](_0x26c1cd['UserId'])){_0x486d3d[_0x4faf('0x16')][_0x4faf('0x17')]({'where':{'id':_0x26c1cd[_0x4faf('0x18')]}})[_0x4faf('0x19')](function(_0x361bde){if(_0x361bde){_0x361bde[_0x4faf('0x1a')]({'lastMsgAt':_0x26c1cd['createdAt'],'lastMsgDirection':_0x26c1cd['direction']['toLowerCase']()});}})[_0x4faf('0x1b')](function(_0x2bf74f){console['error'](_0x2bf74f);});}_0x29b16a();}},'charset':_0x4faf('0x1c'),'collate':_0x4faf('0x1d')});};
\ No newline at end of file
index 9458844..9af0cf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x688c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','redis','register','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','ChatMessage','create','body','options','CreateChatMessage','lodash','util','bluebird','randomstring','ioredis'];(function(_0x12a2ab,_0x539334){var _0x770499=function(_0x47815b){while(--_0x47815b){_0x12a2ab['push'](_0x12a2ab['shift']());}};_0x770499(++_0x539334);}(_0x688c,0xa0));var _0xc688=function(_0x578a88,_0x1f7a3e){_0x578a88=_0x578a88-0x0;var _0x51bda4=_0x688c[_0x578a88];return _0x51bda4;};'use strict';var _=require(_0xc688('0x0'));var util=require(_0xc688('0x1'));var moment=require('moment');var BPromise=require(_0xc688('0x2'));var rs=require(_0xc688('0x3'));var fs=require('fs');var Redis=require(_0xc688('0x4'));var db=require(_0xc688('0x5'))['db'];var utils=require(_0xc688('0x6'));var logger=require(_0xc688('0x7'))(_0xc688('0x8'));var config=require(_0xc688('0x9'));var jayson=require(_0xc688('0xa'));var client=jayson[_0xc688('0xb')]['http']({'port':0x232a});config['redis']=_[_0xc688('0xc')](config['redis'],{'host':_0xc688('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc688('0xe')]));require('./chatMessage.socket')[_0xc688('0xf')](socket);function respondWithRpcPromise(_0x1f313a,_0x5d0bea,_0x27e074){return new BPromise(function(_0x3ad741,_0xb6482c){return client[_0xc688('0x10')](_0x1f313a,_0x27e074)[_0xc688('0x11')](function(_0x53dcfe){logger['info'](_0xc688('0x12'),_0x5d0bea,'request\x20sent');logger[_0xc688('0x13')](_0xc688('0x14'),_0x5d0bea,'request\x20sent',JSON[_0xc688('0x15')](_0x53dcfe));if(_0x53dcfe['error']){if(_0x53dcfe[_0xc688('0x16')]['code']===0x1f4){logger[_0xc688('0x16')](_0xc688('0x12'),_0x5d0bea,_0x53dcfe[_0xc688('0x16')][_0xc688('0x17')]);return _0xb6482c(_0x53dcfe[_0xc688('0x16')][_0xc688('0x17')]);}logger[_0xc688('0x16')](_0xc688('0x12'),_0x5d0bea,_0x53dcfe[_0xc688('0x16')]['message']);return _0x3ad741(_0x53dcfe['error']['message']);}else{logger[_0xc688('0x18')](_0xc688('0x12'),_0x5d0bea,_0xc688('0x19'));_0x3ad741(_0x53dcfe[_0xc688('0x1a')][_0xc688('0x17')]);}})[_0xc688('0x1b')](function(_0x2c758f){logger['error'](_0xc688('0x12'),_0x5d0bea,_0x2c758f);_0xb6482c(_0x2c758f);});});}exports['CreateChatMessage']=function(_0x2b3226){var _0xdc94be=this;return new Promise(function(_0x1b438e,_0x8cfe0a){return db[_0xc688('0x1c')][_0xc688('0x1d')](_0x2b3226[_0xc688('0x1e')],{'raw':_0x2b3226[_0xc688('0x1f')]?_0x2b3226['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x34f7d2){logger[_0xc688('0x18')](_0xc688('0x20'),_0x2b3226);logger[_0xc688('0x13')](_0xc688('0x20'),_0x2b3226,JSON[_0xc688('0x15')](_0x34f7d2));_0x1b438e(_0x34f7d2);})[_0xc688('0x1b')](function(_0x2515f6){logger[_0xc688('0x16')]('CreateChatMessage',_0x2515f6[_0xc688('0x17')],_0x2b3226);_0x8cfe0a(_0xdc94be['error'](0x1f4,_0x2515f6['message']));});});};
\ No newline at end of file
+var _0x6ba7=['then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request'];(function(_0x3d351c,_0x46b774){var _0x2c86ae=function(_0x529448){while(--_0x529448){_0x3d351c['push'](_0x3d351c['shift']());}};_0x2c86ae(++_0x46b774);}(_0x6ba7,0x94));var _0x76ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ba7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x76ba('0x0'));var moment=require('moment');var BPromise=require(_0x76ba('0x1'));var rs=require(_0x76ba('0x2'));var fs=require('fs');var Redis=require(_0x76ba('0x3'));var db=require(_0x76ba('0x4'))['db'];var utils=require(_0x76ba('0x5'));var logger=require('../../config/logger')(_0x76ba('0x6'));var config=require(_0x76ba('0x7'));var jayson=require(_0x76ba('0x8'));var client=jayson[_0x76ba('0x9')]['http']({'port':0x232a});config[_0x76ba('0xa')]=_[_0x76ba('0xb')](config[_0x76ba('0xa')],{'host':_0x76ba('0xc'),'port':0x18eb});var socket=require(_0x76ba('0xd'))(new Redis(config[_0x76ba('0xa')]));require(_0x76ba('0xe'))[_0x76ba('0xf')](socket);function respondWithRpcPromise(_0x58f51b,_0x2b913c,_0x122e44){return new BPromise(function(_0x3f3e0c,_0xbf9766){return client[_0x76ba('0x10')](_0x58f51b,_0x122e44)[_0x76ba('0x11')](function(_0x2cce5b){logger[_0x76ba('0x12')]('ChatMessage,\x20%s,\x20%s',_0x2b913c,_0x76ba('0x13'));logger[_0x76ba('0x14')](_0x76ba('0x15'),_0x2b913c,_0x76ba('0x13'),JSON[_0x76ba('0x16')](_0x2cce5b));if(_0x2cce5b[_0x76ba('0x17')]){if(_0x2cce5b[_0x76ba('0x17')]['code']===0x1f4){logger['error'](_0x76ba('0x18'),_0x2b913c,_0x2cce5b['error'][_0x76ba('0x19')]);return _0xbf9766(_0x2cce5b[_0x76ba('0x17')][_0x76ba('0x19')]);}logger[_0x76ba('0x17')](_0x76ba('0x18'),_0x2b913c,_0x2cce5b[_0x76ba('0x17')][_0x76ba('0x19')]);return _0x3f3e0c(_0x2cce5b[_0x76ba('0x17')][_0x76ba('0x19')]);}else{logger[_0x76ba('0x12')]('ChatMessage,\x20%s,\x20%s',_0x2b913c,_0x76ba('0x13'));_0x3f3e0c(_0x2cce5b[_0x76ba('0x1a')][_0x76ba('0x19')]);}})['catch'](function(_0x5a245f){logger['error'](_0x76ba('0x18'),_0x2b913c,_0x5a245f);_0xbf9766(_0x5a245f);});});}exports[_0x76ba('0x1b')]=function(_0x5695b3){var _0x204597=this;return new Promise(function(_0x78b39b,_0x87e6a9){return db[_0x76ba('0x1c')][_0x76ba('0x1d')](_0x5695b3[_0x76ba('0x1e')],{'raw':_0x5695b3[_0x76ba('0x1f')]?_0x5695b3[_0x76ba('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x76ba('0x11')](function(_0x590e94){logger[_0x76ba('0x12')](_0x76ba('0x1b'),_0x5695b3);logger[_0x76ba('0x14')](_0x76ba('0x1b'),_0x5695b3,JSON[_0x76ba('0x16')](_0x590e94));_0x78b39b(_0x590e94);})[_0x76ba('0x20')](function(_0x3e1fbb){logger['error'](_0x76ba('0x1b'),_0x3e1fbb[_0x76ba('0x19')],_0x5695b3);_0x87e6a9(_0x204597[_0x76ba('0x17')](0x1f4,_0x3e1fbb[_0x76ba('0x19')]));});});};
\ No newline at end of file
index 5dab1f1..920bd06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c32=['remove','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var ChatMessageEvents=require(_0x26c3('0x0'));var events=['save',_0x26c3('0x1'),'update'];function createListener(_0x3428b4,_0x4eac69){return function(_0x3847b3){_0x4eac69[_0x26c3('0x2')](_0x3428b4,_0x3847b3);};}function removeListener(_0x5e8a24,_0x4c2de2){return function(){ChatMessageEvents[_0x26c3('0x3')](_0x5e8a24,_0x4c2de2);};}exports[_0x26c3('0x4')]=function(_0x421941){for(var _0x402393=0x0,_0x17bc12=events[_0x26c3('0x5')];_0x402393<_0x17bc12;_0x402393++){var _0x438a89=events[_0x402393];var _0x11ed3d=createListener(_0x26c3('0x6')+_0x438a89,_0x421941);ChatMessageEvents['on'](_0x438a89,_0x11ed3d);}};
\ No newline at end of file
+var _0x8819=['removeListener','register','length','chatMessage:','remove','update'];(function(_0x54d5ac,_0x31a3f8){var _0x28dc98=function(_0x53a362){while(--_0x53a362){_0x54d5ac['push'](_0x54d5ac['shift']());}};_0x28dc98(++_0x31a3f8);}(_0x8819,0x94));var _0x9881=function(_0x2fd10f,_0x109b61){_0x2fd10f=_0x2fd10f-0x0;var _0x36d10c=_0x8819[_0x2fd10f];return _0x36d10c;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x9881('0x0'),_0x9881('0x1')];function createListener(_0x317d26,_0x14cd6c){return function(_0x17e6bf){_0x14cd6c['emit'](_0x317d26,_0x17e6bf);};}function removeListener(_0x333d6f,_0x446deb){return function(){ChatMessageEvents[_0x9881('0x2')](_0x333d6f,_0x446deb);};}exports[_0x9881('0x3')]=function(_0x1791fd){for(var _0x2a3664=0x0,_0x5f1d45=events[_0x9881('0x4')];_0x2a3664<_0x5f1d45;_0x2a3664++){var _0x4a6471=events[_0x2a3664];var _0x530547=createListener(_0x9881('0x5')+_0x4a6471,_0x1791fd);ChatMessageEvents['on'](_0x4a6471,_0x530547);}};
\ No newline at end of file
index 95d04a8..1afe9be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf12d=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','show','tracked','chat','chatmessage:create','create','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29bf92,_0x5eeb05){var _0x1d9040=function(_0x3782e8){while(--_0x3782e8){_0x29bf92['push'](_0x29bf92['shift']());}};_0x1d9040(++_0x5eeb05);}(_0xf12d,0x89));var _0xdf12=function(_0x24223a,_0x37018e){_0x24223a=_0x24223a-0x0;var _0x2972ab=_0xf12d[_0x24223a];return _0x2972ab;};'use strict';var multer=require(_0xdf12('0x0'));var util=require(_0xdf12('0x1'));var path=require(_0xdf12('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf12('0x3'));var router=express[_0xdf12('0x4')]();var fs_extra=require(_0xdf12('0x5'));var auth=require(_0xdf12('0x6'));var interaction=require(_0xdf12('0x7'));var config=require(_0xdf12('0x8'));var controller=require(_0xdf12('0x9'));router[_0xdf12('0xa')]('/',auth[_0xdf12('0xb')](),controller[_0xdf12('0xc')]);router[_0xdf12('0xa')](_0xdf12('0xd'),auth[_0xdf12('0xb')](),controller['describe']);router[_0xdf12('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xdf12('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xdf12('0xf')](_0xdf12('0x10'),_0xdf12('0x11')),controller[_0xdf12('0x12')]);router['put'](_0xdf12('0x13'),controller[_0xdf12('0x14')]);router[_0xdf12('0x15')](_0xdf12('0x16'),auth[_0xdf12('0xb')](),controller[_0xdf12('0x17')]);router[_0xdf12('0x15')](_0xdf12('0x18'),auth[_0xdf12('0xb')](),controller[_0xdf12('0x19')]);router[_0xdf12('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xdf12('0x1b')]);module[_0xdf12('0x1c')]=router;
\ No newline at end of file
+var _0xff5d=['fs-extra','../../components/interaction/service','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','show','tracked','chat','chatmessage:create','create','put','/:id','update','/:id/accept','reject','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xff5d,0xab));var _0xdff5=function(_0x4a5382,_0x225948){_0x4a5382=_0x4a5382-0x0;var _0x26bb0b=_0xff5d[_0x4a5382];return _0x26bb0b;};'use strict';var multer=require(_0xdff5('0x0'));var util=require('util');var path=require(_0xdff5('0x1'));var timeout=require(_0xdff5('0x2'));var express=require('express');var router=express[_0xdff5('0x3')]();var fs_extra=require(_0xdff5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdff5('0x5'));var config=require('../../config/environment');var controller=require(_0xdff5('0x6'));router[_0xdff5('0x7')]('/',auth['isAuthenticated'](),controller[_0xdff5('0x8')]);router[_0xdff5('0x7')](_0xdff5('0x9'),auth[_0xdff5('0xa')](),controller[_0xdff5('0xb')]);router[_0xdff5('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xdff5('0xc')]);router['post']('/',auth[_0xdff5('0xa')](),interaction[_0xdff5('0xd')](_0xdff5('0xe'),_0xdff5('0xf')),controller[_0xdff5('0x10')]);router[_0xdff5('0x11')](_0xdff5('0x12'),controller[_0xdff5('0x13')]);router[_0xdff5('0x11')](_0xdff5('0x14'),auth[_0xdff5('0xa')](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xdff5('0x15')]);router[_0xdff5('0x16')](_0xdff5('0x12'),auth[_0xdff5('0xa')](),controller[_0xdff5('0x17')]);module[_0xdff5('0x18')]=router;
\ No newline at end of file
index 54acfa2..abf15d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['medium','TEXT','exports'];(function(_0x54f4e5,_0x30f533){var _0x185954=function(_0x2f35b1){while(--_0x2f35b1){_0x54f4e5['push'](_0x54f4e5['shift']());}};_0x185954(++_0x30f533);}(_0xadb5,0xad));var _0x5adb=function(_0x5ed432,_0x2e2859){_0x5ed432=_0x5ed432-0x0;var _0x170df5=_0xadb5[_0x5ed432];return _0x170df5;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x2b431b,_0x5234e6){var _0x59c98e=function(_0x1fd056){while(--_0x1fd056){_0x2b431b['push'](_0x2b431b['shift']());}};_0x59c98e(++_0x5234e6);}(_0xadb5,0xad));var _0x5adb=function(_0x709ef9,_0x5edcfc){_0x709ef9=_0x709ef9-0x0;var _0xe37ff7=_0xadb5[_0x709ef9];return _0xe37ff7;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
index 11fa27d..788a246 100644 (file)
@@ -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(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7a54,0x106));var _0x47a5=function(_0x989b05,_0x208ca7){_0x989b05=_0x989b05-0x0;var _0x1cbad3=_0x7a54[_0x989b05];return _0x1cbad3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x7a54,0x106));var _0x47a5=function(_0x4cdda2,_0x33643c){_0x4cdda2=_0x4cdda2-0x0;var _0x1d1a6d=_0x7a54[_0x4cdda2];return _0x1d1a6d;};'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
index 582434d..ed94e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fc4=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x1ba136,_0x2ccacc){var _0x3161d2=function(_0x252f01){while(--_0x252f01){_0x1ba136['push'](_0x1ba136['shift']());}};_0x3161d2(++_0x2ccacc);}(_0x9fc4,0x6a));var _0x49fc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9fc4[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x49fc('0x0'));var ChatOfflineMessage=require(_0x49fc('0x1'))['db'][_0x49fc('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x49fc('0x3')](0x0);var events={'afterCreate':_0x49fc('0x4'),'afterUpdate':_0x49fc('0x5'),'afterDestroy':_0x49fc('0x6')};function emitEvent(_0x53020f){return function(_0x276ddf,_0x9efd23,_0x2479e4){ChatOfflineMessageEvents[_0x49fc('0x7')](_0x53020f+':'+_0x276ddf['id'],_0x276ddf);ChatOfflineMessageEvents[_0x49fc('0x7')](_0x53020f,_0x276ddf);_0x2479e4(null);};}for(var e in events){if(events[_0x49fc('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x49fc('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x9d35=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x3a99f4,_0x2a81c1){var _0xea0b42=function(_0x41f533){while(--_0x41f533){_0x3a99f4['push'](_0x3a99f4['shift']());}};_0xea0b42(++_0x2a81c1);}(_0x9d35,0x174));var _0x59d3=function(_0x134058,_0x423995){_0x134058=_0x134058-0x0;var _0x14a1a9=_0x9d35[_0x134058];return _0x14a1a9;};'use strict';var EventEmitter=require(_0x59d3('0x0'));var ChatOfflineMessage=require(_0x59d3('0x1'))['db'][_0x59d3('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x59d3('0x3')](0x0);var events={'afterCreate':_0x59d3('0x4'),'afterUpdate':_0x59d3('0x5'),'afterDestroy':_0x59d3('0x6')};function emitEvent(_0x5c35b1){return function(_0xd4ff2a,_0x20e02a,_0x23329e){ChatOfflineMessageEvents['emit'](_0x5c35b1+':'+_0xd4ff2a['id'],_0xd4ff2a);ChatOfflineMessageEvents[_0x59d3('0x7')](_0x5c35b1,_0xd4ff2a);_0x23329e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x59d3('0x8')](e,emitEvent(event));}}module[_0x59d3('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
index dddb753..014b62e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa82d=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','define'];(function(_0x52a1a1,_0x4e04d6){var _0x4713da=function(_0x5849cf){while(--_0x5849cf){_0x52a1a1['push'](_0x52a1a1['shift']());}};_0x4713da(++_0x4e04d6);}(_0xa82d,0x15b));var _0xda82=function(_0xc9bd6,_0x17ff7e){_0xc9bd6=_0xc9bd6-0x0;var _0x249978=_0xa82d[_0xc9bd6];return _0x249978;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0xdb6090){return _0xdb6090[_0xda82('0x0')]('ChatOfflineMessage',attributes,{'tableName':_0xda82('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda82('0x2'),'collate':_0xda82('0x3')});};
\ No newline at end of file
+var _0x000b=['define','ChatOfflineMessage','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x000b,0x1cb));var _0xb000=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x000b[_0x1098db];return _0x14f090;};'use strict';var attributes=require(_0xb000('0x0'));module['exports']=function(_0x35a423){return _0x35a423[_0xb000('0x1')](_0xb000('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb000('0x3')});};
\ No newline at end of file
index d050dbd..dd07a68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6da6=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6da6,0xa5));var _0x66da=function(_0x3aa779,_0x4a18c5){_0x3aa779=_0x3aa779-0x0;var _0x2fd150=_0x6da6[_0x3aa779];return _0x2fd150;};'use strict';var _=require('lodash');var util=require(_0x66da('0x0'));var moment=require('moment');var BPromise=require(_0x66da('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66da('0x2'));var db=require(_0x66da('0x3'))['db'];var utils=require(_0x66da('0x4'));var logger=require(_0x66da('0x5'))(_0x66da('0x6'));var config=require(_0x66da('0x7'));var jayson=require(_0x66da('0x8'));var client=jayson[_0x66da('0x9')][_0x66da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4261be,_0x1143ef,_0x185850){return new BPromise(function(_0x4f2b81,_0x57b850){return client[_0x66da('0xb')](_0x4261be,_0x185850)[_0x66da('0xc')](function(_0x247afe){logger[_0x66da('0xd')](_0x66da('0xe'),_0x1143ef,'request\x20sent');logger[_0x66da('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1143ef,'request\x20sent',JSON['stringify'](_0x247afe));if(_0x247afe[_0x66da('0x10')]){if(_0x247afe['error'][_0x66da('0x11')]===0x1f4){logger[_0x66da('0x10')](_0x66da('0xe'),_0x1143ef,_0x247afe[_0x66da('0x10')]['message']);return _0x57b850(_0x247afe[_0x66da('0x10')][_0x66da('0x12')]);}logger[_0x66da('0x10')](_0x66da('0xe'),_0x1143ef,_0x247afe['error'][_0x66da('0x12')]);return _0x4f2b81(_0x247afe['error'][_0x66da('0x12')]);}else{logger[_0x66da('0xd')](_0x66da('0xe'),_0x1143ef,_0x66da('0x13'));_0x4f2b81(_0x247afe[_0x66da('0x14')][_0x66da('0x12')]);}})[_0x66da('0x15')](function(_0x2d9cc6){logger['error'](_0x66da('0xe'),_0x1143ef,_0x2d9cc6);_0x57b850(_0x2d9cc6);});});}
\ No newline at end of file
+var _0x315b=['stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x224107,_0x14acb3){var _0x2e8ae5=function(_0xfebf0a){while(--_0xfebf0a){_0x224107['push'](_0x224107['shift']());}};_0x2e8ae5(++_0x14acb3);}(_0x315b,0xae));var _0xb315=function(_0x30daaa,_0x35be42){_0x30daaa=_0x30daaa-0x0;var _0x1df000=_0x315b[_0x30daaa];return _0x1df000;};'use strict';var _=require(_0xb315('0x0'));var util=require(_0xb315('0x1'));var moment=require(_0xb315('0x2'));var BPromise=require(_0xb315('0x3'));var rs=require(_0xb315('0x4'));var fs=require('fs');var Redis=require(_0xb315('0x5'));var db=require(_0xb315('0x6'))['db'];var utils=require(_0xb315('0x7'));var logger=require(_0xb315('0x8'))(_0xb315('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb315('0xa')][_0xb315('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x228a9d,_0x4e6deb,_0x265773){return new BPromise(function(_0x3e3c54,_0x1d3671){return client[_0xb315('0xc')](_0x228a9d,_0x265773)[_0xb315('0xd')](function(_0x2002c6){logger['info'](_0xb315('0xe'),_0x4e6deb,'request\x20sent');logger[_0xb315('0xf')](_0xb315('0x10'),_0x4e6deb,_0xb315('0x11'),JSON[_0xb315('0x12')](_0x2002c6));if(_0x2002c6['error']){if(_0x2002c6[_0xb315('0x13')][_0xb315('0x14')]===0x1f4){logger[_0xb315('0x13')](_0xb315('0xe'),_0x4e6deb,_0x2002c6[_0xb315('0x13')][_0xb315('0x15')]);return _0x1d3671(_0x2002c6[_0xb315('0x13')]['message']);}logger[_0xb315('0x13')](_0xb315('0xe'),_0x4e6deb,_0x2002c6[_0xb315('0x13')][_0xb315('0x15')]);return _0x3e3c54(_0x2002c6[_0xb315('0x13')][_0xb315('0x15')]);}else{logger[_0xb315('0x16')](_0xb315('0xe'),_0x4e6deb,'request\x20sent');_0x3e3c54(_0x2002c6['result'][_0xb315('0x15')]);}})[_0xb315('0x17')](function(_0x85f553){logger[_0xb315('0x13')](_0xb315('0xe'),_0x4e6deb,_0x85f553);_0x1d3671(_0x85f553);});});}
\ No newline at end of file
index 69fd19d..cae26f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfba7=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x364424,_0x324ab4){var _0xe04a41=function(_0x3bd017){while(--_0x3bd017){_0x364424['push'](_0x364424['shift']());}};_0xe04a41(++_0x324ab4);}(_0xfba7,0x12b));var _0x7fba=function(_0x92b32e,_0x590b2f){_0x92b32e=_0x92b32e-0x0;var _0x2d67b5=_0xfba7[_0x92b32e];return _0x2d67b5;};'use strict';var multer=require('multer');var util=require(_0x7fba('0x0'));var path=require(_0x7fba('0x1'));var timeout=require(_0x7fba('0x2'));var express=require(_0x7fba('0x3'));var router=express[_0x7fba('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7fba('0x5'));var config=require(_0x7fba('0x6'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x7fba('0x7')](),controller[_0x7fba('0x8')]);router[_0x7fba('0x9')](_0x7fba('0xa'),auth['isAuthenticated'](),controller[_0x7fba('0xb')]);router[_0x7fba('0x9')](_0x7fba('0xc'),auth[_0x7fba('0x7')](),controller[_0x7fba('0xd')]);router[_0x7fba('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7fba('0xf')](_0x7fba('0xc'),auth['isAuthenticated'](),controller[_0x7fba('0x10')]);router[_0x7fba('0x11')](_0x7fba('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7fba('0x12')]=router;
\ No newline at end of file
+var _0xc8b1=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put'];(function(_0x586681,_0x51c760){var _0x20edc5=function(_0x546ad5){while(--_0x546ad5){_0x586681['push'](_0x586681['shift']());}};_0x20edc5(++_0x51c760);}(_0xc8b1,0x157));var _0x1c8b=function(_0x4ce613,_0x1884ce){_0x4ce613=_0x4ce613-0x0;var _0x413bbf=_0xc8b1[_0x4ce613];return _0x413bbf;};'use strict';var multer=require(_0x1c8b('0x0'));var util=require(_0x1c8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1c8b('0x2'));var router=express[_0x1c8b('0x3')]();var fs_extra=require(_0x1c8b('0x4'));var auth=require(_0x1c8b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1c8b('0x6'));var controller=require(_0x1c8b('0x7'));router[_0x1c8b('0x8')]('/',auth[_0x1c8b('0x9')](),controller[_0x1c8b('0xa')]);router[_0x1c8b('0x8')](_0x1c8b('0xb'),auth[_0x1c8b('0x9')](),controller[_0x1c8b('0xc')]);router[_0x1c8b('0x8')](_0x1c8b('0xd'),auth[_0x1c8b('0x9')](),controller[_0x1c8b('0xe')]);router['post']('/',auth[_0x1c8b('0x9')](),controller[_0x1c8b('0xf')]);router[_0x1c8b('0x10')](_0x1c8b('0xd'),auth[_0x1c8b('0x9')](),controller['update']);router[_0x1c8b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1c8b('0x12')]);module[_0x1c8b('0x13')]=router;
\ No newline at end of file
index 9ec1dc9..b652b7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4541=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x269371,_0x3b729e){var _0x2cb363=function(_0x121cbc){while(--_0x121cbc){_0x269371['push'](_0x269371['shift']());}};_0x2cb363(++_0x3b729e);}(_0x4541,0x1a9));var _0x1454=function(_0x2242e5,_0x55bc75){_0x2242e5=_0x2242e5-0x0;var _0x2c22a3=_0x4541[_0x2242e5];return _0x2c22a3;};'use strict';var Sequelize=require(_0x1454('0x0'));module[_0x1454('0x1')]={'name':{'type':Sequelize[_0x1454('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1454('0x3')](_0x1454('0x4'),_0x1454('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x1454('0x2')]},'timeout':{'type':Sequelize[_0x1454('0x6')]}};
\ No newline at end of file
+var _0x4a70=['exports','ENUM','timeout','STRING'];(function(_0x2c6ad8,_0x51e32f){var _0x290132=function(_0x199c77){while(--_0x199c77){_0x2c6ad8['push'](_0x2c6ad8['shift']());}};_0x290132(++_0x51e32f);}(_0x4a70,0x64));var _0x04a7=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x4a70[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require('sequelize');module[_0x04a7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x04a7('0x1')]('mouseOver',_0x04a7('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x04a7('0x3')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index e4d17d1..5f5dc67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef8b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','status','show','params','model','keys','query','filters','attributes','intersection','fields','includeAll','include','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x5957f7,_0x2b346b){var _0x42f2cf=function(_0x44eb49){while(--_0x44eb49){_0x5957f7['push'](_0x5957f7['shift']());}};_0x42f2cf(++_0x2b346b);}(_0xef8b,0x192));var _0xbef8=function(_0x5844c3,_0x13fc8c){_0x5844c3=_0x5844c3-0x0;var _0x3a4d56=_0xef8b[_0x5844c3];return _0x3a4d56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbef8('0x0'));var zipdir=require(_0xbef8('0x1'));var jsonpatch=require(_0xbef8('0x2'));var rp=require(_0xbef8('0x3'));var moment=require(_0xbef8('0x4'));var BPromise=require(_0xbef8('0x5'));var Mustache=require(_0xbef8('0x6'));var util=require(_0xbef8('0x7'));var path=require(_0xbef8('0x8'));var sox=require(_0xbef8('0x9'));var csv=require(_0xbef8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbef8('0xb'));var _=require(_0xbef8('0xc'));var squel=require(_0xbef8('0xd'));var crypto=require('crypto');var jsforce=require(_0xbef8('0xe'));var deskjs=require(_0xbef8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbef8('0x10'));var authService=require(_0xbef8('0x11'));var qs=require(_0xbef8('0x12'));var as=require(_0xbef8('0x13'));var hardwareService=require(_0xbef8('0x14'));var logger=require(_0xbef8('0x15'))(_0xbef8('0x16'));var utils=require(_0xbef8('0x17'));var config=require(_0xbef8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbef8('0x19'))['db'];function respondWithStatusCode(_0x345393,_0x311cf5){_0x311cf5=_0x311cf5||0xcc;return function(_0x58b93f){if(_0x58b93f){return _0x345393['sendStatus'](_0x311cf5);}return _0x345393['status'](_0x311cf5)[_0xbef8('0x1a')]();};}function respondWithResult(_0x4924b6,_0x3074ca){_0x3074ca=_0x3074ca||0xc8;return function(_0x2ab1e0){if(_0x2ab1e0){return _0x4924b6['status'](_0x3074ca)[_0xbef8('0x1b')](_0x2ab1e0);}};}function respondWithFilteredResult(_0x542f03,_0x583ba8){return function(_0x2ec530){if(_0x2ec530){var _0x58ce7b=typeof _0x583ba8['offset']===_0xbef8('0x1c')&&typeof _0x583ba8[_0xbef8('0x1d')]===_0xbef8('0x1c');var _0x321ad0=_0x2ec530[_0xbef8('0x1e')];var _0x175891=_0x58ce7b?0x0:_0x583ba8['offset'];var _0x45b64b=_0x58ce7b?_0x2ec530[_0xbef8('0x1e')]:_0x583ba8['offset']+_0x583ba8[_0xbef8('0x1d')];var _0x46c92c;if(_0x45b64b>=_0x321ad0){_0x45b64b=_0x321ad0;_0x46c92c=0xc8;}else{_0x46c92c=0xce;}_0x542f03['status'](_0x46c92c);return _0x542f03[_0xbef8('0x1f')](_0xbef8('0x20'),_0x175891+'-'+_0x45b64b+'/'+_0x321ad0)[_0xbef8('0x1b')](_0x2ec530);}return null;};}function patchUpdates(_0x4e763a){return function(_0x5abdf1){try{jsonpatch[_0xbef8('0x21')](_0x5abdf1,_0x4e763a,!![]);}catch(_0x450de9){return BPromise[_0xbef8('0x22')](_0x450de9);}return _0x5abdf1[_0xbef8('0x23')]();};}function saveUpdates(_0x51540d,_0x54dfe4){return function(_0x34d494){if(_0x34d494){return _0x34d494[_0xbef8('0x24')](_0x51540d)[_0xbef8('0x25')](function(_0x2c426d){return _0x2c426d;});}return null;};}function removeEntity(_0x45755e,_0x5ce920){return function(_0x31cacf){if(_0x31cacf){return _0x31cacf[_0xbef8('0x26')]()[_0xbef8('0x25')](function(){_0x45755e['status'](0xcc)[_0xbef8('0x1a')]();});}};}function handleEntityNotFound(_0x573218,_0xe976a1){return function(_0x5d5f5a){if(!_0x5d5f5a){_0x573218[_0xbef8('0x27')](0x194);}return _0x5d5f5a;};}function handleError(_0x55aa51,_0x2af6df){_0x2af6df=_0x2af6df||0x1f4;return function(_0x566f16){logger[_0xbef8('0x28')](_0x566f16[_0xbef8('0x29')]);if(_0x566f16[_0xbef8('0x2a')]){delete _0x566f16[_0xbef8('0x2a')];}_0x55aa51[_0xbef8('0x2b')](_0x2af6df)['send'](_0x566f16);};}exports[_0xbef8('0x2c')]=function(_0x3b36f3,_0x2ba8ac){var _0x5a982e={'raw':!![],'where':{'id':_0x3b36f3[_0xbef8('0x2d')]['id']}},_0x14d651={};_0x14d651[_0xbef8('0x2e')]=_[_0xbef8('0x2f')](db['ChatProactiveAction']['rawAttributes']);_0x14d651[_0xbef8('0x30')]=_[_0xbef8('0x2f')](_0x3b36f3['query']);_0x14d651[_0xbef8('0x31')]=_['intersection'](_0x14d651[_0xbef8('0x2e')],_0x14d651['query']);_0x5a982e[_0xbef8('0x32')]=_[_0xbef8('0x33')](_0x14d651[_0xbef8('0x2e')],qs[_0xbef8('0x34')](_0x3b36f3['query'][_0xbef8('0x34')]));_0x5a982e[_0xbef8('0x32')]=_0x5a982e[_0xbef8('0x32')]['length']?_0x5a982e['attributes']:_0x14d651[_0xbef8('0x2e')];if(_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x35')]){_0x5a982e[_0xbef8('0x36')]=[{'all':!![]}];}_0x5a982e=_['merge']({},_0x5a982e,_0x3b36f3['options']);return db[_0xbef8('0x37')][_0xbef8('0x38')](_0x5a982e)[_0xbef8('0x25')](handleEntityNotFound(_0x2ba8ac,null))[_0xbef8('0x25')](respondWithResult(_0x2ba8ac,null))[_0xbef8('0x39')](handleError(_0x2ba8ac,null));};exports[_0xbef8('0x3a')]=function(_0x5109db,_0x56ab5e){return db[_0xbef8('0x37')][_0xbef8('0x3a')](_0x5109db[_0xbef8('0x3b')],{})[_0xbef8('0x25')](respondWithResult(_0x56ab5e,0xc9))[_0xbef8('0x39')](handleError(_0x56ab5e,null));};exports[_0xbef8('0x24')]=function(_0x17ece7,_0x31a7b8){if(_0x17ece7[_0xbef8('0x3b')]['id']){delete _0x17ece7[_0xbef8('0x3b')]['id'];}return db['ChatProactiveAction'][_0xbef8('0x38')]({'where':{'id':_0x17ece7[_0xbef8('0x2d')]['id']}})['then'](handleEntityNotFound(_0x31a7b8,null))['then'](saveUpdates(_0x17ece7['body'],null))[_0xbef8('0x25')](respondWithResult(_0x31a7b8,null))[_0xbef8('0x39')](handleError(_0x31a7b8,null));};exports['destroy']=function(_0x32543a,_0x4c5c16){return db[_0xbef8('0x37')][_0xbef8('0x38')]({'where':{'id':_0x32543a[_0xbef8('0x2d')]['id']}})[_0xbef8('0x25')](handleEntityNotFound(_0x4c5c16,null))[_0xbef8('0x25')](removeEntity(_0x4c5c16,null))[_0xbef8('0x39')](handleError(_0x4c5c16,null));};
\ No newline at end of file
+var _0x28a2=['ChatProactiveAction','filters','intersection','model','query','fields','attributes','length','includeAll','include','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','show','keys'];(function(_0x172f1b,_0x1d79ed){var _0xbbdaf3=function(_0x3698da){while(--_0x3698da){_0x172f1b['push'](_0x172f1b['shift']());}};_0xbbdaf3(++_0x1d79ed);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x228a('0x0'));var rimraf=require(_0x228a('0x1'));var zipdir=require(_0x228a('0x2'));var jsonpatch=require(_0x228a('0x3'));var rp=require(_0x228a('0x4'));var moment=require(_0x228a('0x5'));var BPromise=require(_0x228a('0x6'));var Mustache=require('mustache');var util=require(_0x228a('0x7'));var path=require('path');var sox=require(_0x228a('0x8'));var csv=require(_0x228a('0x9'));var ejs=require(_0x228a('0xa'));var fs=require('fs');var fs_extra=require(_0x228a('0xb'));var _=require(_0x228a('0xc'));var squel=require('squel');var crypto=require(_0x228a('0xd'));var jsforce=require(_0x228a('0xe'));var deskjs=require(_0x228a('0xf'));var toCsv=require(_0x228a('0x9'));var querystring=require('querystring');var Papa=require(_0x228a('0x10'));var Redis=require(_0x228a('0x11'));var authService=require(_0x228a('0x12'));var qs=require(_0x228a('0x13'));var as=require(_0x228a('0x14'));var hardwareService=require(_0x228a('0x15'));var logger=require(_0x228a('0x16'))(_0x228a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x228a('0x18'))['db'];function respondWithStatusCode(_0x25a026,_0x2914fd){_0x2914fd=_0x2914fd||0xcc;return function(_0x128af1){if(_0x128af1){return _0x25a026[_0x228a('0x19')](_0x2914fd);}return _0x25a026['status'](_0x2914fd)[_0x228a('0x1a')]();};}function respondWithResult(_0x10248a,_0x45f1b2){_0x45f1b2=_0x45f1b2||0xc8;return function(_0x53ff6d){if(_0x53ff6d){return _0x10248a['status'](_0x45f1b2)[_0x228a('0x1b')](_0x53ff6d);}};}function respondWithFilteredResult(_0xdcc2c3,_0x11ffa3){return function(_0x2e4f17){if(_0x2e4f17){var _0x262ce9=typeof _0x11ffa3[_0x228a('0x1c')]===_0x228a('0x1d')&&typeof _0x11ffa3[_0x228a('0x1e')]==='undefined';var _0x34de98=_0x2e4f17['count'];var _0x2f71ad=_0x262ce9?0x0:_0x11ffa3[_0x228a('0x1c')];var _0x16c281=_0x262ce9?_0x2e4f17[_0x228a('0x1f')]:_0x11ffa3['offset']+_0x11ffa3['limit'];var _0x1334b8;if(_0x16c281>=_0x34de98){_0x16c281=_0x34de98;_0x1334b8=0xc8;}else{_0x1334b8=0xce;}_0xdcc2c3[_0x228a('0x20')](_0x1334b8);return _0xdcc2c3[_0x228a('0x21')](_0x228a('0x22'),_0x2f71ad+'-'+_0x16c281+'/'+_0x34de98)[_0x228a('0x1b')](_0x2e4f17);}return null;};}function patchUpdates(_0x396acf){return function(_0x1b0f7e){try{jsonpatch[_0x228a('0x23')](_0x1b0f7e,_0x396acf,!![]);}catch(_0x2f0f30){return BPromise['reject'](_0x2f0f30);}return _0x1b0f7e[_0x228a('0x24')]();};}function saveUpdates(_0x5dc077,_0x23d188){return function(_0x4837af){if(_0x4837af){return _0x4837af[_0x228a('0x25')](_0x5dc077)[_0x228a('0x26')](function(_0x3c14ca){return _0x3c14ca;});}return null;};}function removeEntity(_0x2203b7,_0x1c2b93){return function(_0x386a66){if(_0x386a66){return _0x386a66[_0x228a('0x27')]()[_0x228a('0x26')](function(){_0x2203b7[_0x228a('0x20')](0xcc)[_0x228a('0x1a')]();});}};}function handleEntityNotFound(_0x40a2b7,_0x4d3363){return function(_0x58b3d3){if(!_0x58b3d3){_0x40a2b7[_0x228a('0x19')](0x194);}return _0x58b3d3;};}function handleError(_0x2f5ce3,_0x2c1ef1){_0x2c1ef1=_0x2c1ef1||0x1f4;return function(_0x4c893e){logger[_0x228a('0x28')](_0x4c893e[_0x228a('0x29')]);if(_0x4c893e[_0x228a('0x2a')]){delete _0x4c893e['name'];}_0x2f5ce3['status'](_0x2c1ef1)['send'](_0x4c893e);};}exports[_0x228a('0x2b')]=function(_0x196f7,_0x4b5961){var _0x1d6d87={'raw':!![],'where':{'id':_0x196f7['params']['id']}},_0x4065e0={};_0x4065e0['model']=_[_0x228a('0x2c')](db[_0x228a('0x2d')]['rawAttributes']);_0x4065e0['query']=_[_0x228a('0x2c')](_0x196f7['query']);_0x4065e0[_0x228a('0x2e')]=_[_0x228a('0x2f')](_0x4065e0[_0x228a('0x30')],_0x4065e0[_0x228a('0x31')]);_0x1d6d87['attributes']=_[_0x228a('0x2f')](_0x4065e0[_0x228a('0x30')],qs['fields'](_0x196f7[_0x228a('0x31')][_0x228a('0x32')]));_0x1d6d87[_0x228a('0x33')]=_0x1d6d87[_0x228a('0x33')][_0x228a('0x34')]?_0x1d6d87[_0x228a('0x33')]:_0x4065e0[_0x228a('0x30')];if(_0x196f7[_0x228a('0x31')][_0x228a('0x35')]){_0x1d6d87[_0x228a('0x36')]=[{'all':!![]}];}_0x1d6d87=_['merge']({},_0x1d6d87,_0x196f7[_0x228a('0x37')]);return db[_0x228a('0x2d')][_0x228a('0x38')](_0x1d6d87)['then'](handleEntityNotFound(_0x4b5961,null))[_0x228a('0x26')](respondWithResult(_0x4b5961,null))[_0x228a('0x39')](handleError(_0x4b5961,null));};exports[_0x228a('0x3a')]=function(_0x144bbe,_0x53da95){return db['ChatProactiveAction'][_0x228a('0x3a')](_0x144bbe[_0x228a('0x3b')],{})['then'](respondWithResult(_0x53da95,0xc9))[_0x228a('0x39')](handleError(_0x53da95,null));};exports['update']=function(_0x28f350,_0x11762b){if(_0x28f350[_0x228a('0x3b')]['id']){delete _0x28f350['body']['id'];}return db[_0x228a('0x2d')][_0x228a('0x38')]({'where':{'id':_0x28f350[_0x228a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x11762b,null))[_0x228a('0x26')](saveUpdates(_0x28f350[_0x228a('0x3b')],null))[_0x228a('0x26')](respondWithResult(_0x11762b,null))[_0x228a('0x39')](handleError(_0x11762b,null));};exports[_0x228a('0x27')]=function(_0x1e2e28,_0x5d0b0d){return db['ChatProactiveAction']['find']({'where':{'id':_0x1e2e28['params']['id']}})[_0x228a('0x26')](handleEntityNotFound(_0x5d0b0d,null))[_0x228a('0x26')](removeEntity(_0x5d0b0d,null))[_0x228a('0x39')](handleError(_0x5d0b0d,null));};
\ No newline at end of file
index acf47c2..01cad69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7982=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x7982,0x79));var _0x2798=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x7982[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x2798('0x0'));var util=require(_0x2798('0x1'));var logger=require(_0x2798('0x2'))(_0x2798('0x3'));var moment=require(_0x2798('0x4'));var BPromise=require(_0x2798('0x5'));var rp=require(_0x2798('0x6'));var fs=require('fs');var path=require(_0x2798('0x7'));var rimraf=require(_0x2798('0x8'));var config=require(_0x2798('0x9'));var attributes=require(_0x2798('0xa'));module[_0x2798('0xb')]=function(_0x1ac1e2,_0x9511d8){return _0x1ac1e2[_0x2798('0xc')](_0x2798('0xd'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad35=['chat_proactive_actions','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0xad35,0x181));var _0x5ad3=function(_0x435ab9,_0x310b07){_0x435ab9=_0x435ab9-0x0;var _0x3a57c8=_0xad35[_0x435ab9];return _0x3a57c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5ad3('0x0'))(_0x5ad3('0x1'));var moment=require('moment');var BPromise=require(_0x5ad3('0x2'));var rp=require(_0x5ad3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ad3('0x4'));var attributes=require('./chatProactiveAction.attributes');module[_0x5ad3('0x5')]=function(_0x5546f2,_0x3b2da6){return _0x5546f2[_0x5ad3('0x6')]('ChatProactiveAction',attributes,{'tableName':_0x5ad3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6449512..7248c07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0c5=['rpc','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xc0c5,0x126));var _0x5c0c=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xc0c5[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x5c0c('0x0'));var util=require(_0x5c0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5c0c('0x2'));var fs=require('fs');var Redis=require(_0x5c0c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c0c('0x4'));var logger=require(_0x5c0c('0x5'))(_0x5c0c('0x6'));var config=require(_0x5c0c('0x7'));var jayson=require(_0x5c0c('0x8'));var client=jayson[_0x5c0c('0x9')][_0x5c0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeec9ed,_0x1503eb,_0x39f826){return new BPromise(function(_0x2580f8,_0x5d94ca){return client[_0x5c0c('0xb')](_0xeec9ed,_0x39f826)['then'](function(_0x1cc94b){logger['info'](_0x5c0c('0xc'),_0x1503eb,_0x5c0c('0xd'));logger[_0x5c0c('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1503eb,'request\x20sent',JSON[_0x5c0c('0xf')](_0x1cc94b));if(_0x1cc94b['error']){if(_0x1cc94b['error']['code']===0x1f4){logger[_0x5c0c('0x10')](_0x5c0c('0xc'),_0x1503eb,_0x1cc94b['error'][_0x5c0c('0x11')]);return _0x5d94ca(_0x1cc94b[_0x5c0c('0x10')][_0x5c0c('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1503eb,_0x1cc94b['error']['message']);return _0x2580f8(_0x1cc94b[_0x5c0c('0x10')][_0x5c0c('0x11')]);}else{logger[_0x5c0c('0x12')](_0x5c0c('0xc'),_0x1503eb,'request\x20sent');_0x2580f8(_0x1cc94b[_0x5c0c('0x13')]['message']);}})['catch'](function(_0x4d2429){logger[_0x5c0c('0x10')](_0x5c0c('0xc'),_0x1503eb,_0x4d2429);_0x5d94ca(_0x4d2429);});});}
\ No newline at end of file
+var _0xe3a0=['result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x204faa,_0x4593fa){var _0x59b44b=function(_0x551b62){while(--_0x551b62){_0x204faa['push'](_0x204faa['shift']());}};_0x59b44b(++_0x4593fa);}(_0xe3a0,0x178));var _0x0e3a=function(_0x3257c5,_0x4d350c){_0x3257c5=_0x3257c5-0x0;var _0x46cbea=_0xe3a0[_0x3257c5];return _0x46cbea;};'use strict';var _=require('lodash');var util=require(_0x0e3a('0x0'));var moment=require(_0x0e3a('0x1'));var BPromise=require('bluebird');var rs=require(_0x0e3a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e3a('0x3'))['db'];var utils=require(_0x0e3a('0x4'));var logger=require(_0x0e3a('0x5'))(_0x0e3a('0x6'));var config=require(_0x0e3a('0x7'));var jayson=require(_0x0e3a('0x8'));var client=jayson[_0x0e3a('0x9')][_0x0e3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c5bbd,_0x1fbd0d,_0x367eee){return new BPromise(function(_0x50df86,_0x4c5911){return client[_0x0e3a('0xb')](_0x2c5bbd,_0x367eee)['then'](function(_0x8bca93){logger[_0x0e3a('0xc')](_0x0e3a('0xd'),_0x1fbd0d,_0x0e3a('0xe'));logger['debug'](_0x0e3a('0xf'),_0x1fbd0d,_0x0e3a('0xe'),JSON[_0x0e3a('0x10')](_0x8bca93));if(_0x8bca93[_0x0e3a('0x11')]){if(_0x8bca93['error'][_0x0e3a('0x12')]===0x1f4){logger[_0x0e3a('0x11')](_0x0e3a('0xd'),_0x1fbd0d,_0x8bca93[_0x0e3a('0x11')]['message']);return _0x4c5911(_0x8bca93[_0x0e3a('0x11')]['message']);}logger[_0x0e3a('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1fbd0d,_0x8bca93[_0x0e3a('0x11')][_0x0e3a('0x13')]);return _0x50df86(_0x8bca93[_0x0e3a('0x11')]['message']);}else{logger[_0x0e3a('0xc')](_0x0e3a('0xd'),_0x1fbd0d,_0x0e3a('0xe'));_0x50df86(_0x8bca93[_0x0e3a('0x14')][_0x0e3a('0x13')]);}})[_0x0e3a('0x15')](function(_0x1c158e){logger[_0x0e3a('0x11')](_0x0e3a('0xd'),_0x1fbd0d,_0x1c158e);_0x4c5911(_0x1c158e);});});}
\ No newline at end of file
index 9f67026..8701916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x237e2a,_0x2dda16){var _0x25f50c=function(_0x21d8f2){while(--_0x21d8f2){_0x237e2a['push'](_0x237e2a['shift']());}};_0x25f50c(++_0x2dda16);}(_0x032e,0x124));var _0xe032=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x032e[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x126123,_0xb6db8c){var _0x249ef6=function(_0x36739b){while(--_0x36739b){_0x126123['push'](_0x126123['shift']());}};_0x249ef6(++_0xb6db8c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1756f3,_0x60f2ce){_0x1756f3=_0x1756f3-0x0;var _0x2795f1=_0x7fbe[_0x1756f3];return _0x2795f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router;
\ No newline at end of file
index a9f4b48..c965822 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf823=['sequelize','exports','name','STRING','beepall','roundrobin'];(function(_0x86adae,_0x3ed21b){var _0x226f03=function(_0x5be7f6){while(--_0x5be7f6){_0x86adae['push'](_0x86adae['shift']());}};_0x226f03(++_0x3ed21b);}(_0xf823,0xd8));var _0x3f82=function(_0x554c9,_0xea73cd){_0x554c9=_0x554c9-0x0;var _0x510813=_0xf823[_0x554c9];return _0x510813;};'use strict';var Sequelize=require(_0x3f82('0x0'));module[_0x3f82('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3f82('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3f82('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x3f82('0x4'),_0x3f82('0x5'))}};
\ No newline at end of file
+var _0xf106=['exports','STRING','name','INTEGER','rrmemory','sequelize'];(function(_0x11c123,_0x264be0){var _0x536b69=function(_0x483a9d){while(--_0x483a9d){_0x11c123['push'](_0x11c123['shift']());}};_0x536b69(++_0x264be0);}(_0xf106,0xc5));var _0x6f10=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xf106[_0x3e2fcf];return _0x497db7;};'use strict';var Sequelize=require(_0x6f10('0x0'));module[_0x6f10('0x1')]={'name':{'type':Sequelize[_0x6f10('0x2')],'unique':_0x6f10('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6f10('0x2')]},'timeout':{'type':Sequelize[_0x6f10('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6f10('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
index 7211ef8..b1f48e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e77=['where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','chatPause','getTeams','Team','order','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','addAgents','spread','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x21310f,_0x2b178d){var _0x5bb5a3=function(_0x5ea0ff){while(--_0x5ea0ff){_0x21310f['push'](_0x21310f['shift']());}};_0x5bb5a3(++_0x2b178d);}(_0x2e77,0xda));var _0x72e7=function(_0x1ba0c6,_0x18b121){_0x1ba0c6=_0x1ba0c6-0x0;var _0x2ac21b=_0x2e77[_0x1ba0c6];return _0x2ac21b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x72e7('0x0'));var zipdir=require(_0x72e7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x72e7('0x2'));var BPromise=require(_0x72e7('0x3'));var Mustache=require(_0x72e7('0x4'));var util=require(_0x72e7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x72e7('0x6'));var ejs=require(_0x72e7('0x7'));var fs=require('fs');var fs_extra=require(_0x72e7('0x8'));var _=require(_0x72e7('0x9'));var squel=require(_0x72e7('0xa'));var crypto=require(_0x72e7('0xb'));var jsforce=require(_0x72e7('0xc'));var deskjs=require(_0x72e7('0xd'));var toCsv=require(_0x72e7('0x6'));var querystring=require(_0x72e7('0xe'));var Papa=require('papaparse');var Redis=require(_0x72e7('0xf'));var authService=require(_0x72e7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x72e7('0x11'));var hardwareService=require(_0x72e7('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x72e7('0x13'));var config=require(_0x72e7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x72e7('0x15'))['db'];config[_0x72e7('0x16')]=_[_0x72e7('0x17')](config['redis'],{'host':_0x72e7('0x18'),'port':0x18eb});var socket=require(_0x72e7('0x19'))(new Redis(config[_0x72e7('0x16')]));require(_0x72e7('0x1a'))[_0x72e7('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x72e7('0x1c')][_0x72e7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x19d7e1,_0x3bdeab,_0x41c5e9,_0x2479a3){return new BPromise(function(_0x1af934,_0xae183a){var _0x41ccea=_0x2479a3||client;return _0x41ccea[_0x72e7('0x1e')](_0x19d7e1,_0x41c5e9)['then'](function(_0x58e641){logger[_0x72e7('0x1f')](_0x72e7('0x20'),_0x3bdeab,_0x72e7('0x21'));logger[_0x72e7('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3bdeab,'request\x20sent',JSON['stringify'](_0x58e641));if(_0x58e641['error']){if(_0x58e641[_0x72e7('0x23')][_0x72e7('0x24')]===0x1f4){logger[_0x72e7('0x23')](_0x72e7('0x20'),_0x3bdeab,_0x58e641[_0x72e7('0x23')][_0x72e7('0x25')]);return _0xae183a(_0x58e641[_0x72e7('0x23')][_0x72e7('0x25')]);}logger['error'](_0x72e7('0x20'),_0x3bdeab,_0x58e641[_0x72e7('0x23')]['message']);return _0x1af934(_0x58e641[_0x72e7('0x23')]['message']);}else{logger[_0x72e7('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x3bdeab,'request\x20sent');_0x1af934(_0x58e641[_0x72e7('0x26')][_0x72e7('0x25')]);}})[_0x72e7('0x27')](function(_0x1108e2){logger[_0x72e7('0x23')](_0x72e7('0x20'),_0x3bdeab,_0x1108e2);_0xae183a(_0x1108e2);});});}function respondWithStatusCode(_0x2f7b07,_0x3d7f63){_0x3d7f63=_0x3d7f63||0xcc;return function(_0x44d4e9){if(_0x44d4e9){return _0x2f7b07[_0x72e7('0x28')](_0x3d7f63);}return _0x2f7b07[_0x72e7('0x29')](_0x3d7f63)[_0x72e7('0x2a')]();};}function respondWithResult(_0x3f48ec,_0x47e930){_0x47e930=_0x47e930||0xc8;return function(_0x396fef){if(_0x396fef){return _0x3f48ec[_0x72e7('0x29')](_0x47e930)[_0x72e7('0x2b')](_0x396fef);}};}function respondWithFilteredResult(_0xfcd34c,_0x332481){return function(_0x1d3440){if(_0x1d3440){var _0xd67880=typeof _0x332481['offset']===_0x72e7('0x2c')&&typeof _0x332481[_0x72e7('0x2d')]==='undefined';var _0x3ad7cb=_0x1d3440[_0x72e7('0x2e')];var _0x1d3709=_0xd67880?0x0:_0x332481[_0x72e7('0x2f')];var _0x100ae5=_0xd67880?_0x1d3440[_0x72e7('0x2e')]:_0x332481[_0x72e7('0x2f')]+_0x332481[_0x72e7('0x2d')];var _0x41a561;if(_0x100ae5>=_0x3ad7cb){_0x100ae5=_0x3ad7cb;_0x41a561=0xc8;}else{_0x41a561=0xce;}_0xfcd34c[_0x72e7('0x29')](_0x41a561);return _0xfcd34c[_0x72e7('0x30')]('Content-Range',_0x1d3709+'-'+_0x100ae5+'/'+_0x3ad7cb)[_0x72e7('0x2b')](_0x1d3440);}return null;};}function patchUpdates(_0x50d8fb){return function(_0x3dc372){try{jsonpatch[_0x72e7('0x31')](_0x3dc372,_0x50d8fb,!![]);}catch(_0x142a64){return BPromise['reject'](_0x142a64);}return _0x3dc372[_0x72e7('0x32')]();};}function saveUpdates(_0x35a23a,_0x493179){return function(_0x56b07){if(_0x56b07){return _0x56b07[_0x72e7('0x33')](_0x35a23a)[_0x72e7('0x34')](function(_0x335063){return _0x335063;});}return null;};}function removeEntity(_0x3798b8,_0x4eba1c){return function(_0x26ed0b){if(_0x26ed0b){return _0x26ed0b[_0x72e7('0x35')]()[_0x72e7('0x34')](function(){var _0x25061d=_0x26ed0b[_0x72e7('0x36')]({'plain':!![]});var _0xe874dc=_0x72e7('0x37');return db[_0x72e7('0x38')]['destroy']({'where':{'type':_0xe874dc,'resourceId':_0x25061d['id']}})[_0x72e7('0x34')](function(){return _0x26ed0b;});})['then'](function(){_0x3798b8[_0x72e7('0x29')](0xcc)[_0x72e7('0x2a')]();});}};}function handleEntityNotFound(_0x36ec0c,_0x53f780){return function(_0x5f5d78){if(!_0x5f5d78){_0x36ec0c[_0x72e7('0x28')](0x194);}return _0x5f5d78;};}function handleError(_0x17052e,_0x26a449){_0x26a449=_0x26a449||0x1f4;return function(_0x2934a5){logger[_0x72e7('0x23')](_0x2934a5[_0x72e7('0x39')]);if(_0x2934a5[_0x72e7('0x3a')]){delete _0x2934a5[_0x72e7('0x3a')];}_0x17052e[_0x72e7('0x29')](_0x26a449)[_0x72e7('0x3b')](_0x2934a5);};}exports['index']=function(_0x16b35e,_0x5df2b8){var _0x3e84c2={},_0x926ec5={},_0x3c6169={'count':0x0,'rows':[]};var _0x3558ae=_[_0x72e7('0x3c')](db[_0x72e7('0x3d')][_0x72e7('0x3e')],function(_0x5456df){return{'name':_0x5456df[_0x72e7('0x3f')],'type':_0x5456df[_0x72e7('0x40')]['key']};});_0x926ec5['model']=_[_0x72e7('0x3c')](_0x3558ae,_0x72e7('0x3a'));_0x926ec5[_0x72e7('0x41')]=_[_0x72e7('0x42')](_0x16b35e[_0x72e7('0x41')]);_0x926ec5[_0x72e7('0x43')]=_[_0x72e7('0x44')](_0x926ec5[_0x72e7('0x45')],_0x926ec5[_0x72e7('0x41')]);_0x3e84c2[_0x72e7('0x46')]=_[_0x72e7('0x44')](_0x926ec5[_0x72e7('0x45')],qs[_0x72e7('0x47')](_0x16b35e[_0x72e7('0x41')][_0x72e7('0x47')]));_0x3e84c2[_0x72e7('0x46')]=_0x3e84c2[_0x72e7('0x46')][_0x72e7('0x48')]?_0x3e84c2[_0x72e7('0x46')]:_0x926ec5['model'];if(!_0x16b35e[_0x72e7('0x41')][_0x72e7('0x49')](_0x72e7('0x4a'))){_0x3e84c2[_0x72e7('0x2d')]=qs[_0x72e7('0x2d')](_0x16b35e['query'][_0x72e7('0x2d')]);_0x3e84c2['offset']=qs['offset'](_0x16b35e[_0x72e7('0x41')][_0x72e7('0x2f')]);}_0x3e84c2['order']=qs['sort'](_0x16b35e[_0x72e7('0x41')][_0x72e7('0x4b')]);_0x3e84c2[_0x72e7('0x4c')]=qs['filters'](_[_0x72e7('0x4d')](_0x16b35e[_0x72e7('0x41')],_0x926ec5[_0x72e7('0x43')]),_0x3558ae);if(_0x16b35e['query']['filter']){_0x3e84c2[_0x72e7('0x4c')]=_[_0x72e7('0x4e')](_0x3e84c2['where'],{'$or':_[_0x72e7('0x3c')](_0x3558ae,function(_0x5f799){if(_0x5f799[_0x72e7('0x40')]!==_0x72e7('0x4f')){var _0x3e1b6e={};_0x3e1b6e[_0x5f799[_0x72e7('0x3a')]]={'$like':'%'+_0x16b35e[_0x72e7('0x41')][_0x72e7('0x50')]+'%'};return _0x3e1b6e;}})});}_0x3e84c2=_[_0x72e7('0x4e')]({},_0x3e84c2,_0x16b35e[_0x72e7('0x51')]);var _0x14d30a={'where':_0x3e84c2[_0x72e7('0x4c')]};return db[_0x72e7('0x3d')]['count'](_0x14d30a)['then'](function(_0x248ef0){_0x3c6169[_0x72e7('0x2e')]=_0x248ef0;if(_0x16b35e['query']['includeAll']){_0x3e84c2[_0x72e7('0x52')]=[{'all':!![]}];}return db[_0x72e7('0x3d')][_0x72e7('0x53')](_0x3e84c2);})['then'](function(_0x305f2f){_0x3c6169[_0x72e7('0x54')]=_0x305f2f;return _0x3c6169;})['then'](respondWithFilteredResult(_0x5df2b8,_0x3e84c2))['catch'](handleError(_0x5df2b8,null));};exports[_0x72e7('0x55')]=function(_0x2c13a7,_0x59bf04){var _0x1fa11e={'raw':!![],'where':{'id':_0x2c13a7[_0x72e7('0x56')]['id']}},_0x303a0d={};_0x303a0d[_0x72e7('0x45')]=_[_0x72e7('0x42')](db['ChatQueue'][_0x72e7('0x3e')]);_0x303a0d[_0x72e7('0x41')]=_[_0x72e7('0x42')](_0x2c13a7['query']);_0x303a0d[_0x72e7('0x43')]=_[_0x72e7('0x44')](_0x303a0d[_0x72e7('0x45')],_0x303a0d[_0x72e7('0x41')]);_0x1fa11e[_0x72e7('0x46')]=_[_0x72e7('0x44')](_0x303a0d[_0x72e7('0x45')],qs['fields'](_0x2c13a7[_0x72e7('0x41')]['fields']));_0x1fa11e[_0x72e7('0x46')]=_0x1fa11e[_0x72e7('0x46')]['length']?_0x1fa11e['attributes']:_0x303a0d[_0x72e7('0x45')];if(_0x2c13a7[_0x72e7('0x41')][_0x72e7('0x57')]){_0x1fa11e['include']=[{'all':!![]}];}_0x1fa11e=_[_0x72e7('0x4e')]({},_0x1fa11e,_0x2c13a7[_0x72e7('0x51')]);return db[_0x72e7('0x3d')][_0x72e7('0x58')](_0x1fa11e)[_0x72e7('0x34')](handleEntityNotFound(_0x59bf04,null))[_0x72e7('0x34')](respondWithResult(_0x59bf04,null))[_0x72e7('0x27')](handleError(_0x59bf04,null));};exports[_0x72e7('0x59')]=function(_0x41fa13,_0x3292d2){return db[_0x72e7('0x3d')][_0x72e7('0x59')](_0x41fa13[_0x72e7('0x5a')],{})[_0x72e7('0x34')](function(_0x293fe5){var _0x159203=_0x41fa13[_0x72e7('0x5b')][_0x72e7('0x36')]({'plain':!![]});if(!_0x159203)throw new Error(_0x72e7('0x5c'));if(_0x159203['role']==='user'){var _0x5b910c=_0x293fe5[_0x72e7('0x36')]({'plain':!![]});var _0x31c357='ChatQueues';return db[_0x72e7('0x5d')]['find']({'where':{'name':_0x31c357,'userProfileId':_0x159203[_0x72e7('0x5e')]},'raw':!![]})['then'](function(_0x149ea5){if(_0x149ea5&&_0x149ea5[_0x72e7('0x5f')]===0x0){return db[_0x72e7('0x38')][_0x72e7('0x59')]({'name':_0x5b910c['name'],'resourceId':_0x5b910c['id'],'type':_0x149ea5['name'],'sectionId':_0x149ea5['id']},{})['then'](function(){return _0x293fe5;});}else{return _0x293fe5;}})[_0x72e7('0x27')](function(_0x4538e4){logger['error'](_0x72e7('0x60'),_0x4538e4);throw _0x4538e4;});}return _0x293fe5;})[_0x72e7('0x34')](respondWithResult(_0x3292d2,0xc9))[_0x72e7('0x27')](handleError(_0x3292d2,null));};exports['update']=function(_0x303a51,_0x24f69a){if(_0x303a51[_0x72e7('0x5a')]['id']){delete _0x303a51[_0x72e7('0x5a')]['id'];}return db[_0x72e7('0x3d')][_0x72e7('0x58')]({'where':{'id':_0x303a51[_0x72e7('0x56')]['id']}})[_0x72e7('0x34')](handleEntityNotFound(_0x24f69a,null))[_0x72e7('0x34')](saveUpdates(_0x303a51['body'],null))[_0x72e7('0x34')](respondWithResult(_0x24f69a,null))['catch'](handleError(_0x24f69a,null));};exports[_0x72e7('0x35')]=function(_0xddb8c8,_0x374862){return db[_0x72e7('0x3d')]['find']({'where':{'id':_0xddb8c8['params']['id']}})[_0x72e7('0x34')](handleEntityNotFound(_0x374862,null))['then'](removeEntity(_0x374862,null))[_0x72e7('0x27')](handleError(_0x374862,null));};exports['describe']=function(_0x2b8474,_0x247443){return db['ChatQueue'][_0x72e7('0x61')]()[_0x72e7('0x34')](respondWithResult(_0x247443,null))[_0x72e7('0x27')](handleError(_0x247443,null));};exports['getMembers']=function(_0x527630,_0x332821,_0x2d2978){var _0x59d619={'raw':!![],'where':{}},_0x27881a={},_0x24de64;return db[_0x72e7('0x3d')][_0x72e7('0x62')]({'where':{'id':_0x527630[_0x72e7('0x56')]['id']}})[_0x72e7('0x34')](handleEntityNotFound(_0x332821,null))['then'](function(_0x1cf9bc){if(_0x1cf9bc){_0x24de64=_0x1cf9bc[_0x72e7('0x36')]({'plain':!![]});_0x27881a[_0x72e7('0x45')]=_['keys'](db['UserChatQueue'][_0x72e7('0x3e')]);_0x27881a['query']=_['keys'](_0x527630[_0x72e7('0x41')]);_0x27881a[_0x72e7('0x43')]=_[_0x72e7('0x44')](_0x27881a[_0x72e7('0x45')],_0x27881a[_0x72e7('0x41')]);_0x59d619[_0x72e7('0x46')]=_[_0x72e7('0x44')](_0x27881a[_0x72e7('0x45')],qs[_0x72e7('0x47')](_0x527630[_0x72e7('0x41')]['fields']));_0x59d619[_0x72e7('0x46')]=_0x59d619['attributes'][_0x72e7('0x48')]?_0x59d619[_0x72e7('0x46')]:_0x27881a['model'];if(!_0x527630[_0x72e7('0x41')][_0x72e7('0x49')](_0x72e7('0x4a'))){_0x59d619[_0x72e7('0x2d')]=qs[_0x72e7('0x2d')](_0x527630['query']['limit']);_0x59d619[_0x72e7('0x2f')]=qs['offset'](_0x527630[_0x72e7('0x41')][_0x72e7('0x2f')]);}_0x59d619['order']=qs[_0x72e7('0x4b')](_0x527630[_0x72e7('0x41')]['sort']);_0x59d619[_0x72e7('0x4c')]=qs[_0x72e7('0x43')](_[_0x72e7('0x4d')](_0x527630['query'],_0x27881a['filters']));_0x59d619[_0x72e7('0x4c')][_0x72e7('0x63')]=_0x1cf9bc['id'];if(_0x527630[_0x72e7('0x41')][_0x72e7('0x50')]){_0x59d619[_0x72e7('0x4c')]=_[_0x72e7('0x4e')](_0x59d619[_0x72e7('0x4c')],{'$or':_['map'](_0x59d619[_0x72e7('0x46')],function(_0x3acebc){var _0x25a0a0={};_0x25a0a0[_0x3acebc]={'$like':'%'+_0x527630[_0x72e7('0x41')]['filter']+'%'};return _0x25a0a0;})});}_0x59d619=_[_0x72e7('0x4e')]({},_0x59d619,_0x527630[_0x72e7('0x51')]);return db[_0x72e7('0x64')][_0x72e7('0x53')](_0x59d619);}})['then'](function(_0x48c6ac){if(_0x48c6ac){return db[_0x72e7('0x65')][_0x72e7('0x66')]({'where':{'id':_[_0x72e7('0x3c')](_0x48c6ac,_0x72e7('0x67')),'role':_0x72e7('0x68')},'attributes':['id',_0x72e7('0x3a'),'chatPause',_0x72e7('0x69'),_0x72e7('0x6a')]});}})[_0x72e7('0x34')](function(_0x3be2cf){if(_0x3be2cf){return{'count':_0x3be2cf[_0x72e7('0x2e')],'rows':_[_0x72e7('0x3c')](_0x3be2cf[_0x72e7('0x54')],function(_0x2cc400){return{'membername':_0x2cc400[_0x72e7('0x3a')],'UserId':_0x2cc400['id'],'queue_name':_0x24de64[_0x72e7('0x3a')],'ChatQueueId':_0x24de64['id'],'interface':util['format'](_0x72e7('0x6b'),_0x72e7('0x6c'),_0x2cc400[_0x72e7('0x3a')]),'penalty':0x0,'paused':_0x2cc400[_0x72e7('0x6d')],'createdAt':_0x2cc400['createdAt'],'updatedAt':_0x2cc400[_0x72e7('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x72e7('0x34')](respondWithFilteredResult(_0x332821,_0x59d619))[_0x72e7('0x27')](handleError(_0x332821,null));};exports[_0x72e7('0x6e')]=function(_0x4a4cc1,_0x306960,_0x42acd4){var _0x720820={};var _0x1b2259={};var _0x21ed62;var _0x4918a0;return db[_0x72e7('0x3d')][_0x72e7('0x62')]({'where':{'id':_0x4a4cc1[_0x72e7('0x56')]['id']}})['then'](handleEntityNotFound(_0x306960,null))[_0x72e7('0x34')](function(_0x4c138d){if(_0x4c138d){_0x21ed62=_0x4c138d;_0x1b2259[_0x72e7('0x45')]=_[_0x72e7('0x42')](db[_0x72e7('0x6f')]['rawAttributes']);_0x1b2259[_0x72e7('0x41')]=_[_0x72e7('0x42')](_0x4a4cc1[_0x72e7('0x41')]);_0x1b2259[_0x72e7('0x43')]=_[_0x72e7('0x44')](_0x1b2259[_0x72e7('0x45')],_0x1b2259['query']);_0x720820[_0x72e7('0x46')]=_[_0x72e7('0x44')](_0x1b2259[_0x72e7('0x45')],qs[_0x72e7('0x47')](_0x4a4cc1[_0x72e7('0x41')][_0x72e7('0x47')]));_0x720820[_0x72e7('0x46')]=_0x720820[_0x72e7('0x46')][_0x72e7('0x48')]?_0x720820[_0x72e7('0x46')]:_0x1b2259['model'];_0x720820[_0x72e7('0x70')]=qs[_0x72e7('0x4b')](_0x4a4cc1[_0x72e7('0x41')]['sort']);_0x720820[_0x72e7('0x4c')]=qs[_0x72e7('0x43')](_[_0x72e7('0x4d')](_0x4a4cc1['query'],_0x1b2259[_0x72e7('0x43')]));if(_0x4a4cc1[_0x72e7('0x41')]['filter']){_0x720820[_0x72e7('0x4c')]=_[_0x72e7('0x4e')](_0x720820[_0x72e7('0x4c')],{'$or':_['map'](_0x720820['attributes'],function(_0x352f61){var _0xa55426={};_0xa55426[_0x352f61]={'$like':'%'+_0x4a4cc1['query'][_0x72e7('0x50')]+'%'};return _0xa55426;})});}_0x720820=_[_0x72e7('0x4e')]({},_0x720820,_0x4a4cc1[_0x72e7('0x51')]);return _0x21ed62[_0x72e7('0x6e')](_0x720820);}})[_0x72e7('0x34')](function(_0x2ecce0){if(_0x2ecce0){_0x4918a0=_0x2ecce0[_0x72e7('0x48')];if(!_0x4a4cc1[_0x72e7('0x41')]['hasOwnProperty'](_0x72e7('0x4a'))){_0x720820[_0x72e7('0x2d')]=qs[_0x72e7('0x2d')](_0x4a4cc1[_0x72e7('0x41')][_0x72e7('0x2d')]);_0x720820[_0x72e7('0x2f')]=qs['offset'](_0x4a4cc1[_0x72e7('0x41')][_0x72e7('0x2f')]);}return _0x21ed62[_0x72e7('0x6e')](_0x720820);}})[_0x72e7('0x34')](function(_0x2293df){if(_0x2293df){return _0x2293df?{'count':_0x4918a0,'rows':_0x2293df}:null;}})[_0x72e7('0x34')](respondWithResult(_0x306960,null))[_0x72e7('0x27')](handleError(_0x306960,null));};exports[_0x72e7('0x71')]=function(_0x3e46b9,_0x2e9e02,_0x1b27d6){var _0x365732=_0x3e46b9['body']['ids'];return db[_0x72e7('0x6f')]['findAll']({'where':{'id':_0x365732},'attributes':['id'],'include':[{'model':db[_0x72e7('0x65')],'as':_0x72e7('0x72'),'attributes':['id',_0x72e7('0x3a'),'online',_0x72e7('0x73'),_0x72e7('0x74')],'raw':!![]}]})[_0x72e7('0x34')](function(_0x3da88e){if(_0x3da88e){var _0x2fff0c=_[_0x72e7('0x75')](_0x3da88e,function(_0x484c9d){var _0x4d2ddd=_0x484c9d[_0x72e7('0x36')]({'plain':!![]});return _0x4d2ddd[_0x72e7('0x72')];});return db[_0x72e7('0x3d')]['find']({'where':{'id':_0x3e46b9[_0x72e7('0x56')]['id']}})[_0x72e7('0x34')](function(_0x1d9bbb){return db[_0x72e7('0x76')][_0x72e7('0x77')](function(_0x4547e7){return _0x1d9bbb[_0x72e7('0x71')](_0x365732,{'transaction':_0x4547e7})['then'](function(){return BPromise['each'](_0x2fff0c,function(_0x5f26d2){return db[_0x72e7('0x64')][_0x72e7('0x78')]({'where':{'UserId':_0x5f26d2['id'],'ChatQueueId':_0x3e46b9[_0x72e7('0x56')]['id']},'transaction':_0x4547e7});});})[_0x72e7('0x34')](function(){_0x2fff0c[_0x72e7('0x79')](function(_0x595fc2){socket[_0x72e7('0x7a')](_0x72e7('0x7b'),{'UserId':_0x595fc2['id'],'ChatQueueId':_0x1d9bbb['id']});});});});});}})[_0x72e7('0x34')](respondWithStatusCode(_0x2e9e02,null))[_0x72e7('0x27')](handleError(_0x2e9e02,null));};exports[_0x72e7('0x7c')]=function(_0x78304f,_0x121e4f,_0x148265){return db[_0x72e7('0x6f')]['findAll']({'where':{'id':_0x78304f[_0x72e7('0x41')][_0x72e7('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x72e7('0x65')],'as':_0x72e7('0x72'),'attributes':['id'],'raw':!![]}]})[_0x72e7('0x34')](handleEntityNotFound(_0x121e4f,null))[_0x72e7('0x34')](function(_0x5b1a96){var _0x405888=_[_0x72e7('0x3c')](_0x5b1a96,'id');var _0x11a40c=[];var _0x166136=[];var _0x2167ff=squel['select']();_0x2167ff['field']('tq.TeamId')['from'](_0x72e7('0x7e'),'tq')[_0x72e7('0x7f')]('user_has_teams','ut',_0x72e7('0x80'))[_0x72e7('0x4c')](_0x72e7('0x81'),_0x78304f[_0x72e7('0x56')]['id']);for(var _0x1972ed=0x0;_0x1972ed<_0x5b1a96['length'];_0x1972ed+=0x1){let _0x5b452d=_0x5b1a96[_0x1972ed];for(var _0x51f656=0x0;_0x51f656<_0x5b452d[_0x72e7('0x72')][_0x72e7('0x48')];_0x51f656+=0x1){let _0x44d747=_0x5b452d[_0x72e7('0x72')][_0x51f656];var _0x201104=_0x2167ff[_0x72e7('0x82')]();_0x201104['where'](_0x72e7('0x83'),_0x44d747['id']);_0x166136['push'](db[_0x72e7('0x76')][_0x72e7('0x41')](_0x201104[_0x72e7('0x84')](),{'type':db['sequelize'][_0x72e7('0x85')]['SELECT']})[_0x72e7('0x34')](function(_0x50433c){if(_0x50433c['length']===0x1){return _0x44d747['id'];}else{var _0xbcd18a=_[_0x72e7('0x86')](_[_0x72e7('0x3c')](_0x50433c,_0x72e7('0x87')),function(_0x3d1286){return _[_0x72e7('0x88')](_0x405888,_0x3d1286);});if(_0xbcd18a){return _0x44d747['id'];}}}));}}return BPromise[_0x72e7('0x89')](_0x166136)['then'](function(_0x1e04f9){_0x11a40c=_(_0x11a40c)[_0x72e7('0x8a')](_0x1e04f9)[_0x72e7('0x8b')]()['value']();return db[_0x72e7('0x3d')]['find']({'where':{'id':_0x78304f[_0x72e7('0x56')]['id']}})[_0x72e7('0x34')](function(_0x39af94){return db[_0x72e7('0x76')][_0x72e7('0x77')](function(_0x98449d){return _0x39af94[_0x72e7('0x7c')](_0x78304f['query'][_0x72e7('0x7d')],{'transaction':_0x98449d})['then'](function(){if(!_[_0x72e7('0x8c')](_0x11a40c)){return _0x39af94[_0x72e7('0x8d')](_0x11a40c,{'transaction':_0x98449d});}})[_0x72e7('0x34')](function(){_0x11a40c[_0x72e7('0x79')](function(_0xc2014b){socket[_0x72e7('0x7a')]('userChatQueue:remove',{'UserId':_0xc2014b,'ChatQueueId':_0x39af94['id']});});});});});});})['then'](respondWithStatusCode(_0x121e4f,null))[_0x72e7('0x27')](handleError(_0x121e4f,null));};exports[_0x72e7('0x8e')]=function(_0x22bcd4,_0x590eb0,_0xac8b3b){return db['ChatQueue'][_0x72e7('0x58')]({'where':{'id':_0x22bcd4[_0x72e7('0x56')]['id']}})['then'](handleEntityNotFound(_0x590eb0,null))[_0x72e7('0x34')](function(_0x139385){if(_0x139385){return _0x139385[_0x72e7('0x8e')](_0x22bcd4['body'][_0x72e7('0x7d')],_['omit'](_0x22bcd4['body'],[_0x72e7('0x7d'),'id'])||{})[_0x72e7('0x8f')](function(_0x2f8a50){for(var _0x5113d8=0x0;_0x5113d8<_0x22bcd4[_0x72e7('0x5a')][_0x72e7('0x7d')][_0x72e7('0x48')];_0x5113d8+=0x1){socket[_0x72e7('0x7a')](_0x72e7('0x7b'),{'UserId':Number(_0x22bcd4['body'][_0x72e7('0x7d')][_0x5113d8]),'ChatQueueId':Number(_0x22bcd4[_0x72e7('0x56')]['id'])});}return _0x2f8a50;});}})[_0x72e7('0x34')](respondWithResult(_0x590eb0,null))[_0x72e7('0x27')](handleError(_0x590eb0,null));};exports[_0x72e7('0x8d')]=function(_0x529ec3,_0x22ee01,_0x386813){return db[_0x72e7('0x3d')][_0x72e7('0x58')]({'where':{'id':_0x529ec3[_0x72e7('0x56')]['id']}})[_0x72e7('0x34')](handleEntityNotFound(_0x22ee01,null))['then'](function(_0x11d7c8){if(_0x11d7c8){return _0x11d7c8[_0x72e7('0x8d')](_0x529ec3[_0x72e7('0x41')][_0x72e7('0x7d')])['then'](function(){if(_[_0x72e7('0x90')](_0x529ec3[_0x72e7('0x41')][_0x72e7('0x7d')])){for(var _0x1e8930=0x0;_0x1e8930<_0x529ec3['query'][_0x72e7('0x7d')][_0x72e7('0x48')];_0x1e8930+=0x1){socket['emit'](_0x72e7('0x91'),{'UserId':Number(_0x529ec3['query']['ids'][_0x1e8930]),'ChatQueueId':Number(_0x529ec3[_0x72e7('0x56')]['id'])});}}else{socket['emit'](_0x72e7('0x91'),{'UserId':Number(_0x529ec3[_0x72e7('0x41')][_0x72e7('0x7d')]),'ChatQueueId':Number(_0x529ec3['params']['id'])});}});}})[_0x72e7('0x34')](respondWithStatusCode(_0x22ee01,null))['catch'](handleError(_0x22ee01,null));};exports[_0x72e7('0x92')]=function(_0xbe2ab9,_0x10b435,_0x227bce){var _0x10bc1c={};var _0x490a7e={};var _0x59fb21;var _0x3a856b;return db[_0x72e7('0x3d')][_0x72e7('0x62')]({'where':{'id':_0xbe2ab9['params']['id']}})['then'](handleEntityNotFound(_0x10b435,null))['then'](function(_0x21aca1){if(_0x21aca1){_0x59fb21=_0x21aca1;_0x490a7e[_0x72e7('0x45')]=_[_0x72e7('0x42')](db[_0x72e7('0x65')][_0x72e7('0x3e')]);_0x490a7e['query']=_[_0x72e7('0x42')](_0xbe2ab9[_0x72e7('0x41')]);_0x490a7e[_0x72e7('0x43')]=_[_0x72e7('0x44')](_0x490a7e['model'],_0x490a7e[_0x72e7('0x41')]);_0x10bc1c[_0x72e7('0x46')]=_[_0x72e7('0x44')](_0x490a7e['model'],qs[_0x72e7('0x47')](_0xbe2ab9['query']['fields']));_0x10bc1c[_0x72e7('0x46')]=_0x10bc1c[_0x72e7('0x46')][_0x72e7('0x48')]?_0x10bc1c[_0x72e7('0x46')]:_0x490a7e[_0x72e7('0x45')];_0x10bc1c['order']=qs[_0x72e7('0x4b')](_0xbe2ab9[_0x72e7('0x41')][_0x72e7('0x4b')]);_0x10bc1c[_0x72e7('0x4c')]=qs['filters'](_[_0x72e7('0x4d')](_0xbe2ab9['query'],_0x490a7e['filters']));if(_0xbe2ab9[_0x72e7('0x41')][_0x72e7('0x50')]){_0x10bc1c[_0x72e7('0x4c')]=_['merge'](_0x10bc1c['where'],{'$or':_[_0x72e7('0x3c')](_0x10bc1c[_0x72e7('0x46')],function(_0x5c1f1a){var _0x7fe768={};_0x7fe768[_0x5c1f1a]={'$like':'%'+_0xbe2ab9[_0x72e7('0x41')][_0x72e7('0x50')]+'%'};return _0x7fe768;})});}_0x10bc1c=_[_0x72e7('0x4e')]({},_0x10bc1c,_0xbe2ab9[_0x72e7('0x51')]);return _0x59fb21[_0x72e7('0x92')](_0x10bc1c);}})[_0x72e7('0x34')](function(_0x3c6a72){if(_0x3c6a72){_0x3a856b=_0x3c6a72[_0x72e7('0x48')];if(!_0xbe2ab9[_0x72e7('0x41')]['hasOwnProperty'](_0x72e7('0x4a'))){_0x10bc1c['limit']=qs['limit'](_0xbe2ab9[_0x72e7('0x41')][_0x72e7('0x2d')]);_0x10bc1c['offset']=qs['offset'](_0xbe2ab9[_0x72e7('0x41')][_0x72e7('0x2f')]);}return _0x59fb21[_0x72e7('0x92')](_0x10bc1c);}})[_0x72e7('0x34')](function(_0x20b02a){if(_0x20b02a){return _0x20b02a?{'count':_0x3a856b,'rows':_0x20b02a}:null;}})[_0x72e7('0x34')](respondWithResult(_0x10b435,null))[_0x72e7('0x27')](handleError(_0x10b435,null));};
\ No newline at end of file
+var _0x9422=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','rawAttributes','order','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','voicePause','interface','sequelize','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','value','transaction','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','name','send','index','ChatQueue','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x51a50b,_0x264cda){var _0x4a3ca7=function(_0xe3033b){while(--_0xe3033b){_0x51a50b['push'](_0x51a50b['shift']());}};_0x4a3ca7(++_0x264cda);}(_0x9422,0x160));var _0x2942=function(_0x3d3f2c,_0x5b761c){_0x3d3f2c=_0x3d3f2c-0x0;var _0x28a28b=_0x9422[_0x3d3f2c];return _0x28a28b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2942('0x0'));var zipdir=require(_0x2942('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2942('0x2'));var moment=require(_0x2942('0x3'));var BPromise=require(_0x2942('0x4'));var Mustache=require(_0x2942('0x5'));var util=require('util');var path=require(_0x2942('0x6'));var sox=require(_0x2942('0x7'));var csv=require('to-csv');var ejs=require(_0x2942('0x8'));var fs=require('fs');var fs_extra=require(_0x2942('0x9'));var _=require(_0x2942('0xa'));var squel=require(_0x2942('0xb'));var crypto=require(_0x2942('0xc'));var jsforce=require(_0x2942('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2942('0xe'));var querystring=require(_0x2942('0xf'));var Papa=require(_0x2942('0x10'));var Redis=require(_0x2942('0x11'));var authService=require(_0x2942('0x12'));var qs=require(_0x2942('0x13'));var as=require(_0x2942('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2942('0x15'))(_0x2942('0x16'));var utils=require('../../config/utils');var config=require(_0x2942('0x17'));var licenseUtil=require(_0x2942('0x18'));var db=require(_0x2942('0x19'))['db'];config[_0x2942('0x1a')]=_[_0x2942('0x1b')](config[_0x2942('0x1a')],{'host':_0x2942('0x1c'),'port':0x18eb});var socket=require(_0x2942('0x1d'))(new Redis(config[_0x2942('0x1a')]));require(_0x2942('0x1e'))[_0x2942('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2942('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe9620b,_0x341226,_0x38e5d0,_0xaccb4d){return new BPromise(function(_0x1f235f,_0x3a2cdd){var _0x4bd203=_0xaccb4d||client;return _0x4bd203['request'](_0xe9620b,_0x38e5d0)[_0x2942('0x21')](function(_0x15bbd5){logger['info'](_0x2942('0x22'),_0x341226,_0x2942('0x23'));logger[_0x2942('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x341226,_0x2942('0x23'),JSON[_0x2942('0x25')](_0x15bbd5));if(_0x15bbd5['error']){if(_0x15bbd5[_0x2942('0x26')][_0x2942('0x27')]===0x1f4){logger[_0x2942('0x26')](_0x2942('0x22'),_0x341226,_0x15bbd5[_0x2942('0x26')]['message']);return _0x3a2cdd(_0x15bbd5['error'][_0x2942('0x28')]);}logger[_0x2942('0x26')](_0x2942('0x22'),_0x341226,_0x15bbd5[_0x2942('0x26')][_0x2942('0x28')]);return _0x1f235f(_0x15bbd5[_0x2942('0x26')][_0x2942('0x28')]);}else{logger[_0x2942('0x29')](_0x2942('0x22'),_0x341226,'request\x20sent');_0x1f235f(_0x15bbd5[_0x2942('0x2a')][_0x2942('0x28')]);}})[_0x2942('0x2b')](function(_0x5e47b5){logger[_0x2942('0x26')]('ChatQueue,\x20%s,\x20%s',_0x341226,_0x5e47b5);_0x3a2cdd(_0x5e47b5);});});}function respondWithStatusCode(_0x3dc358,_0x2c4d22){_0x2c4d22=_0x2c4d22||0xcc;return function(_0x319d60){if(_0x319d60){return _0x3dc358[_0x2942('0x2c')](_0x2c4d22);}return _0x3dc358[_0x2942('0x2d')](_0x2c4d22)[_0x2942('0x2e')]();};}function respondWithResult(_0xcc5515,_0x62a605){_0x62a605=_0x62a605||0xc8;return function(_0x422ad6){if(_0x422ad6){return _0xcc5515[_0x2942('0x2d')](_0x62a605)[_0x2942('0x2f')](_0x422ad6);}};}function respondWithFilteredResult(_0x16b8fb,_0x18865d){return function(_0x29ef54){if(_0x29ef54){var _0x14dddb=typeof _0x18865d[_0x2942('0x30')]===_0x2942('0x31')&&typeof _0x18865d['limit']===_0x2942('0x31');var _0x25e597=_0x29ef54[_0x2942('0x32')];var _0x55b1df=_0x14dddb?0x0:_0x18865d[_0x2942('0x30')];var _0x336166=_0x14dddb?_0x29ef54[_0x2942('0x32')]:_0x18865d[_0x2942('0x30')]+_0x18865d[_0x2942('0x33')];var _0x4b382b;if(_0x336166>=_0x25e597){_0x336166=_0x25e597;_0x4b382b=0xc8;}else{_0x4b382b=0xce;}_0x16b8fb['status'](_0x4b382b);return _0x16b8fb[_0x2942('0x34')](_0x2942('0x35'),_0x55b1df+'-'+_0x336166+'/'+_0x25e597)[_0x2942('0x2f')](_0x29ef54);}return null;};}function patchUpdates(_0x5ee932){return function(_0x58abe5){try{jsonpatch[_0x2942('0x36')](_0x58abe5,_0x5ee932,!![]);}catch(_0x231414){return BPromise[_0x2942('0x37')](_0x231414);}return _0x58abe5['save']();};}function saveUpdates(_0x7a7d9e,_0x21a8be){return function(_0x5d140d){if(_0x5d140d){return _0x5d140d[_0x2942('0x38')](_0x7a7d9e)[_0x2942('0x21')](function(_0xe2bff3){return _0xe2bff3;});}return null;};}function removeEntity(_0x256ba9,_0x321688){return function(_0x1080f6){if(_0x1080f6){return _0x1080f6[_0x2942('0x39')]()[_0x2942('0x21')](function(){var _0xd22735=_0x1080f6[_0x2942('0x3a')]({'plain':!![]});var _0x5c42cf='ChatQueues';return db[_0x2942('0x3b')][_0x2942('0x39')]({'where':{'type':_0x5c42cf,'resourceId':_0xd22735['id']}})['then'](function(){return _0x1080f6;});})[_0x2942('0x21')](function(){_0x256ba9['status'](0xcc)[_0x2942('0x2e')]();});}};}function handleEntityNotFound(_0x1a6489,_0x49348e){return function(_0x2033cc){if(!_0x2033cc){_0x1a6489[_0x2942('0x2c')](0x194);}return _0x2033cc;};}function handleError(_0x3e7fa4,_0x3d9d9c){_0x3d9d9c=_0x3d9d9c||0x1f4;return function(_0x2c9aa8){logger[_0x2942('0x26')](_0x2c9aa8['stack']);if(_0x2c9aa8[_0x2942('0x3c')]){delete _0x2c9aa8[_0x2942('0x3c')];}_0x3e7fa4['status'](_0x3d9d9c)[_0x2942('0x3d')](_0x2c9aa8);};}exports[_0x2942('0x3e')]=function(_0x2d608a,_0x3f04a9){var _0x38db12={},_0x5d3519={},_0x3efc69={'count':0x0,'rows':[]};var _0x52be7f=_['map'](db[_0x2942('0x3f')]['rawAttributes'],function(_0x264b6c){return{'name':_0x264b6c[_0x2942('0x40')],'type':_0x264b6c[_0x2942('0x41')][_0x2942('0x42')]};});_0x5d3519['model']=_[_0x2942('0x43')](_0x52be7f,'name');_0x5d3519[_0x2942('0x44')]=_[_0x2942('0x45')](_0x2d608a[_0x2942('0x44')]);_0x5d3519[_0x2942('0x46')]=_[_0x2942('0x47')](_0x5d3519[_0x2942('0x48')],_0x5d3519['query']);_0x38db12['attributes']=_[_0x2942('0x47')](_0x5d3519['model'],qs[_0x2942('0x49')](_0x2d608a[_0x2942('0x44')][_0x2942('0x49')]));_0x38db12[_0x2942('0x4a')]=_0x38db12[_0x2942('0x4a')][_0x2942('0x4b')]?_0x38db12[_0x2942('0x4a')]:_0x5d3519[_0x2942('0x48')];if(!_0x2d608a[_0x2942('0x44')][_0x2942('0x4c')](_0x2942('0x4d'))){_0x38db12[_0x2942('0x33')]=qs[_0x2942('0x33')](_0x2d608a[_0x2942('0x44')]['limit']);_0x38db12['offset']=qs[_0x2942('0x30')](_0x2d608a[_0x2942('0x44')][_0x2942('0x30')]);}_0x38db12['order']=qs[_0x2942('0x4e')](_0x2d608a[_0x2942('0x44')][_0x2942('0x4e')]);_0x38db12[_0x2942('0x4f')]=qs['filters'](_[_0x2942('0x50')](_0x2d608a[_0x2942('0x44')],_0x5d3519['filters']),_0x52be7f);if(_0x2d608a[_0x2942('0x44')][_0x2942('0x51')]){_0x38db12[_0x2942('0x4f')]=_[_0x2942('0x52')](_0x38db12[_0x2942('0x4f')],{'$or':_[_0x2942('0x43')](_0x52be7f,function(_0x22a51d){if(_0x22a51d[_0x2942('0x41')]!==_0x2942('0x53')){var _0x28b773={};_0x28b773[_0x22a51d['name']]={'$like':'%'+_0x2d608a['query']['filter']+'%'};return _0x28b773;}})});}_0x38db12=_[_0x2942('0x52')]({},_0x38db12,_0x2d608a[_0x2942('0x54')]);var _0x228cf2={'where':_0x38db12[_0x2942('0x4f')]};return db[_0x2942('0x3f')][_0x2942('0x32')](_0x228cf2)[_0x2942('0x21')](function(_0xd336c5){_0x3efc69[_0x2942('0x32')]=_0xd336c5;if(_0x2d608a[_0x2942('0x44')]['includeAll']){_0x38db12[_0x2942('0x55')]=[{'all':!![]}];}return db[_0x2942('0x3f')][_0x2942('0x56')](_0x38db12);})['then'](function(_0x18da49){_0x3efc69[_0x2942('0x57')]=_0x18da49;return _0x3efc69;})[_0x2942('0x21')](respondWithFilteredResult(_0x3f04a9,_0x38db12))[_0x2942('0x2b')](handleError(_0x3f04a9,null));};exports[_0x2942('0x58')]=function(_0x2df37a,_0x16b045){var _0x5178de={'raw':!![],'where':{'id':_0x2df37a['params']['id']}},_0x1f7572={};_0x1f7572[_0x2942('0x48')]=_[_0x2942('0x45')](db['ChatQueue']['rawAttributes']);_0x1f7572[_0x2942('0x44')]=_['keys'](_0x2df37a['query']);_0x1f7572['filters']=_[_0x2942('0x47')](_0x1f7572[_0x2942('0x48')],_0x1f7572[_0x2942('0x44')]);_0x5178de[_0x2942('0x4a')]=_['intersection'](_0x1f7572[_0x2942('0x48')],qs[_0x2942('0x49')](_0x2df37a['query'][_0x2942('0x49')]));_0x5178de[_0x2942('0x4a')]=_0x5178de['attributes'][_0x2942('0x4b')]?_0x5178de['attributes']:_0x1f7572['model'];if(_0x2df37a[_0x2942('0x44')][_0x2942('0x59')]){_0x5178de['include']=[{'all':!![]}];}_0x5178de=_[_0x2942('0x52')]({},_0x5178de,_0x2df37a[_0x2942('0x54')]);return db['ChatQueue'][_0x2942('0x5a')](_0x5178de)['then'](handleEntityNotFound(_0x16b045,null))[_0x2942('0x21')](respondWithResult(_0x16b045,null))['catch'](handleError(_0x16b045,null));};exports['create']=function(_0x3167dc,_0xd8f1c){return db[_0x2942('0x3f')][_0x2942('0x5b')](_0x3167dc[_0x2942('0x5c')],{})[_0x2942('0x21')](function(_0x58e8ac){var _0x461910=_0x3167dc[_0x2942('0x5d')][_0x2942('0x3a')]({'plain':!![]});if(!_0x461910)throw new Error(_0x2942('0x5e'));if(_0x461910[_0x2942('0x5f')]==='user'){var _0x20cbaf=_0x58e8ac['get']({'plain':!![]});var _0xdba19='ChatQueues';return db[_0x2942('0x60')][_0x2942('0x5a')]({'where':{'name':_0xdba19,'userProfileId':_0x461910[_0x2942('0x61')]},'raw':!![]})['then'](function(_0x58bdc2){if(_0x58bdc2&&_0x58bdc2[_0x2942('0x62')]===0x0){return db[_0x2942('0x3b')][_0x2942('0x5b')]({'name':_0x20cbaf['name'],'resourceId':_0x20cbaf['id'],'type':_0x58bdc2['name'],'sectionId':_0x58bdc2['id']},{})[_0x2942('0x21')](function(){return _0x58e8ac;});}else{return _0x58e8ac;}})[_0x2942('0x2b')](function(_0x58dab6){logger[_0x2942('0x26')](_0x2942('0x63'),_0x58dab6);throw _0x58dab6;});}return _0x58e8ac;})[_0x2942('0x21')](respondWithResult(_0xd8f1c,0xc9))['catch'](handleError(_0xd8f1c,null));};exports[_0x2942('0x38')]=function(_0x5cf89e,_0x5487ed){if(_0x5cf89e[_0x2942('0x5c')]['id']){delete _0x5cf89e[_0x2942('0x5c')]['id'];}return db[_0x2942('0x3f')]['find']({'where':{'id':_0x5cf89e[_0x2942('0x64')]['id']}})['then'](handleEntityNotFound(_0x5487ed,null))[_0x2942('0x21')](saveUpdates(_0x5cf89e[_0x2942('0x5c')],null))[_0x2942('0x21')](respondWithResult(_0x5487ed,null))['catch'](handleError(_0x5487ed,null));};exports[_0x2942('0x39')]=function(_0x58c0a2,_0x57d833){return db['ChatQueue'][_0x2942('0x5a')]({'where':{'id':_0x58c0a2[_0x2942('0x64')]['id']}})[_0x2942('0x21')](handleEntityNotFound(_0x57d833,null))['then'](removeEntity(_0x57d833,null))[_0x2942('0x2b')](handleError(_0x57d833,null));};exports[_0x2942('0x65')]=function(_0x3a32a2,_0xb11db0){return db['ChatQueue'][_0x2942('0x65')]()[_0x2942('0x21')](respondWithResult(_0xb11db0,null))['catch'](handleError(_0xb11db0,null));};exports[_0x2942('0x66')]=function(_0x534aec,_0x219de2,_0x18fc80){var _0x20590f={'raw':!![],'where':{}},_0x2196bb={},_0x5ccb52;return db[_0x2942('0x3f')][_0x2942('0x67')]({'where':{'id':_0x534aec[_0x2942('0x64')]['id']}})[_0x2942('0x21')](handleEntityNotFound(_0x219de2,null))[_0x2942('0x21')](function(_0x44f6e0){if(_0x44f6e0){_0x5ccb52=_0x44f6e0[_0x2942('0x3a')]({'plain':!![]});_0x2196bb[_0x2942('0x48')]=_[_0x2942('0x45')](db['UserChatQueue'][_0x2942('0x68')]);_0x2196bb['query']=_[_0x2942('0x45')](_0x534aec[_0x2942('0x44')]);_0x2196bb[_0x2942('0x46')]=_[_0x2942('0x47')](_0x2196bb['model'],_0x2196bb['query']);_0x20590f[_0x2942('0x4a')]=_['intersection'](_0x2196bb['model'],qs[_0x2942('0x49')](_0x534aec['query'][_0x2942('0x49')]));_0x20590f[_0x2942('0x4a')]=_0x20590f['attributes'][_0x2942('0x4b')]?_0x20590f['attributes']:_0x2196bb[_0x2942('0x48')];if(!_0x534aec[_0x2942('0x44')]['hasOwnProperty'](_0x2942('0x4d'))){_0x20590f['limit']=qs[_0x2942('0x33')](_0x534aec[_0x2942('0x44')][_0x2942('0x33')]);_0x20590f[_0x2942('0x30')]=qs[_0x2942('0x30')](_0x534aec['query']['offset']);}_0x20590f[_0x2942('0x69')]=qs[_0x2942('0x4e')](_0x534aec[_0x2942('0x44')][_0x2942('0x4e')]);_0x20590f[_0x2942('0x4f')]=qs[_0x2942('0x46')](_[_0x2942('0x50')](_0x534aec['query'],_0x2196bb[_0x2942('0x46')]));_0x20590f['where']['ChatQueueId']=_0x44f6e0['id'];if(_0x534aec[_0x2942('0x44')][_0x2942('0x51')]){_0x20590f[_0x2942('0x4f')]=_['merge'](_0x20590f['where'],{'$or':_[_0x2942('0x43')](_0x20590f[_0x2942('0x4a')],function(_0x58b700){var _0xa9052={};_0xa9052[_0x58b700]={'$like':'%'+_0x534aec[_0x2942('0x44')]['filter']+'%'};return _0xa9052;})});}_0x20590f=_[_0x2942('0x52')]({},_0x20590f,_0x534aec['options']);return db['UserChatQueue'][_0x2942('0x56')](_0x20590f);}})[_0x2942('0x21')](function(_0x311c6e){if(_0x311c6e){return db['User']['findAndCountAll']({'where':{'id':_[_0x2942('0x43')](_0x311c6e,_0x2942('0x6a')),'role':_0x2942('0x6b')},'attributes':['id',_0x2942('0x3c'),'chatPause',_0x2942('0x6c'),_0x2942('0x6d')]});}})['then'](function(_0x3bf9ca){if(_0x3bf9ca){return{'count':_0x3bf9ca[_0x2942('0x32')],'rows':_['map'](_0x3bf9ca[_0x2942('0x57')],function(_0x974e1a){return{'membername':_0x974e1a[_0x2942('0x3c')],'UserId':_0x974e1a['id'],'queue_name':_0x5ccb52[_0x2942('0x3c')],'ChatQueueId':_0x5ccb52['id'],'interface':util[_0x2942('0x6e')](_0x2942('0x6f'),_0x2942('0x70'),_0x974e1a[_0x2942('0x3c')]),'penalty':0x0,'paused':_0x974e1a['chatPause'],'createdAt':_0x974e1a[_0x2942('0x6d')],'updatedAt':_0x974e1a[_0x2942('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2942('0x21')](respondWithFilteredResult(_0x219de2,_0x20590f))['catch'](handleError(_0x219de2,null));};exports[_0x2942('0x71')]=function(_0x3e41b9,_0x4cf091,_0x3cdd9f){var _0x47f565={};var _0x423a38={};var _0x38b511;var _0x561ade;return db[_0x2942('0x3f')]['findOne']({'where':{'id':_0x3e41b9['params']['id']}})[_0x2942('0x21')](handleEntityNotFound(_0x4cf091,null))[_0x2942('0x21')](function(_0x1b1d5d){if(_0x1b1d5d){_0x38b511=_0x1b1d5d;_0x423a38[_0x2942('0x48')]=_[_0x2942('0x45')](db[_0x2942('0x72')][_0x2942('0x68')]);_0x423a38[_0x2942('0x44')]=_[_0x2942('0x45')](_0x3e41b9[_0x2942('0x44')]);_0x423a38[_0x2942('0x46')]=_[_0x2942('0x47')](_0x423a38['model'],_0x423a38['query']);_0x47f565[_0x2942('0x4a')]=_[_0x2942('0x47')](_0x423a38[_0x2942('0x48')],qs[_0x2942('0x49')](_0x3e41b9[_0x2942('0x44')]['fields']));_0x47f565[_0x2942('0x4a')]=_0x47f565['attributes'][_0x2942('0x4b')]?_0x47f565[_0x2942('0x4a')]:_0x423a38['model'];_0x47f565[_0x2942('0x69')]=qs[_0x2942('0x4e')](_0x3e41b9[_0x2942('0x44')]['sort']);_0x47f565[_0x2942('0x4f')]=qs[_0x2942('0x46')](_[_0x2942('0x50')](_0x3e41b9[_0x2942('0x44')],_0x423a38['filters']));if(_0x3e41b9['query'][_0x2942('0x51')]){_0x47f565[_0x2942('0x4f')]=_[_0x2942('0x52')](_0x47f565['where'],{'$or':_[_0x2942('0x43')](_0x47f565[_0x2942('0x4a')],function(_0x44872c){var _0x22bd30={};_0x22bd30[_0x44872c]={'$like':'%'+_0x3e41b9[_0x2942('0x44')][_0x2942('0x51')]+'%'};return _0x22bd30;})});}_0x47f565=_[_0x2942('0x52')]({},_0x47f565,_0x3e41b9[_0x2942('0x54')]);return _0x38b511['getTeams'](_0x47f565);}})['then'](function(_0x1c96fb){if(_0x1c96fb){_0x561ade=_0x1c96fb['length'];if(!_0x3e41b9[_0x2942('0x44')]['hasOwnProperty']('nolimit')){_0x47f565[_0x2942('0x33')]=qs[_0x2942('0x33')](_0x3e41b9[_0x2942('0x44')][_0x2942('0x33')]);_0x47f565['offset']=qs[_0x2942('0x30')](_0x3e41b9['query'][_0x2942('0x30')]);}return _0x38b511[_0x2942('0x71')](_0x47f565);}})[_0x2942('0x21')](function(_0x1ce707){if(_0x1ce707){return _0x1ce707?{'count':_0x561ade,'rows':_0x1ce707}:null;}})[_0x2942('0x21')](respondWithResult(_0x4cf091,null))[_0x2942('0x2b')](handleError(_0x4cf091,null));};exports[_0x2942('0x73')]=function(_0xde11eb,_0x32fea9,_0x573f87){var _0x3329a9=_0xde11eb[_0x2942('0x5c')][_0x2942('0x74')];return db[_0x2942('0x72')][_0x2942('0x56')]({'where':{'id':_0x3329a9},'attributes':['id'],'include':[{'model':db[_0x2942('0x75')],'as':_0x2942('0x76'),'attributes':['id','name','online',_0x2942('0x77'),_0x2942('0x78')],'raw':!![]}]})[_0x2942('0x21')](function(_0x67041){if(_0x67041){var _0xf2e1ec=_['flatMap'](_0x67041,function(_0x2bbdd1){var _0x149b87=_0x2bbdd1[_0x2942('0x3a')]({'plain':!![]});return _0x149b87[_0x2942('0x76')];});return db[_0x2942('0x3f')][_0x2942('0x5a')]({'where':{'id':_0xde11eb['params']['id']}})[_0x2942('0x21')](function(_0x384344){return db[_0x2942('0x79')]['transaction'](function(_0x26746a){return _0x384344['addTeams'](_0x3329a9,{'transaction':_0x26746a})[_0x2942('0x21')](function(){return BPromise['each'](_0xf2e1ec,function(_0x3ea7b4){return db[_0x2942('0x7a')][_0x2942('0x7b')]({'where':{'UserId':_0x3ea7b4['id'],'ChatQueueId':_0xde11eb[_0x2942('0x64')]['id']},'transaction':_0x26746a});});})[_0x2942('0x21')](function(){_0xf2e1ec[_0x2942('0x7c')](function(_0x1d6f1c){socket[_0x2942('0x7d')](_0x2942('0x7e'),{'UserId':_0x1d6f1c['id'],'ChatQueueId':_0x384344['id']});});});});});}})[_0x2942('0x21')](respondWithStatusCode(_0x32fea9,null))['catch'](handleError(_0x32fea9,null));};exports['removeTeams']=function(_0xd488b0,_0x2e3281,_0x4156a7){return db['Team'][_0x2942('0x56')]({'where':{'id':_0xd488b0[_0x2942('0x44')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2942('0x75')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e3281,null))[_0x2942('0x21')](function(_0x2cf7f9){var _0xbf1d5e=_[_0x2942('0x43')](_0x2cf7f9,'id');var _0xfb46f6=[];var _0x197f97=[];var _0x1c0225=squel['select']();_0x1c0225[_0x2942('0x7f')]('tq.TeamId')[_0x2942('0x80')]('team_has_chat_queues','tq')[_0x2942('0x81')](_0x2942('0x82'),'ut',_0x2942('0x83'))[_0x2942('0x4f')](_0x2942('0x84'),_0xd488b0[_0x2942('0x64')]['id']);for(var _0x4b0c32=0x0;_0x4b0c32<_0x2cf7f9[_0x2942('0x4b')];_0x4b0c32+=0x1){let _0x1cf45a=_0x2cf7f9[_0x4b0c32];for(var _0x2231ce=0x0;_0x2231ce<_0x1cf45a['Agents'][_0x2942('0x4b')];_0x2231ce+=0x1){let _0x2d5db6=_0x1cf45a[_0x2942('0x76')][_0x2231ce];var _0x1e8119=_0x1c0225['clone']();_0x1e8119[_0x2942('0x4f')](_0x2942('0x85'),_0x2d5db6['id']);_0x197f97['push'](db[_0x2942('0x79')][_0x2942('0x44')](_0x1e8119[_0x2942('0x86')](),{'type':db[_0x2942('0x79')][_0x2942('0x87')][_0x2942('0x88')]})[_0x2942('0x21')](function(_0x5af10e){if(_0x5af10e[_0x2942('0x4b')]===0x1){return _0x2d5db6['id'];}else{var _0x365e97=_[_0x2942('0x89')](_[_0x2942('0x43')](_0x5af10e,_0x2942('0x8a')),function(_0x2920ea){return _['includes'](_0xbf1d5e,_0x2920ea);});if(_0x365e97){return _0x2d5db6['id'];}}}));}}return BPromise[_0x2942('0x8b')](_0x197f97)[_0x2942('0x21')](function(_0x487d3a){_0xfb46f6=_(_0xfb46f6)['union'](_0x487d3a)['compact']()[_0x2942('0x8c')]();return db[_0x2942('0x3f')][_0x2942('0x5a')]({'where':{'id':_0xd488b0[_0x2942('0x64')]['id']}})[_0x2942('0x21')](function(_0x1cf011){return db['sequelize'][_0x2942('0x8d')](function(_0x12522a){return _0x1cf011[_0x2942('0x8e')](_0xd488b0[_0x2942('0x44')][_0x2942('0x74')],{'transaction':_0x12522a})[_0x2942('0x21')](function(){if(!_[_0x2942('0x8f')](_0xfb46f6)){return _0x1cf011[_0x2942('0x90')](_0xfb46f6,{'transaction':_0x12522a});}})[_0x2942('0x21')](function(){_0xfb46f6[_0x2942('0x7c')](function(_0x233f24){socket[_0x2942('0x7d')](_0x2942('0x91'),{'UserId':_0x233f24,'ChatQueueId':_0x1cf011['id']});});});});});});})[_0x2942('0x21')](respondWithStatusCode(_0x2e3281,null))[_0x2942('0x2b')](handleError(_0x2e3281,null));};exports[_0x2942('0x92')]=function(_0x342194,_0x56b17e,_0x19233b){return db[_0x2942('0x3f')][_0x2942('0x5a')]({'where':{'id':_0x342194[_0x2942('0x64')]['id']}})[_0x2942('0x21')](handleEntityNotFound(_0x56b17e,null))[_0x2942('0x21')](function(_0x2d215d){if(_0x2d215d){return _0x2d215d[_0x2942('0x92')](_0x342194[_0x2942('0x5c')][_0x2942('0x74')],_[_0x2942('0x93')](_0x342194[_0x2942('0x5c')],[_0x2942('0x74'),'id'])||{})[_0x2942('0x94')](function(_0x19a93f){for(var _0x1b0e15=0x0;_0x1b0e15<_0x342194[_0x2942('0x5c')][_0x2942('0x74')][_0x2942('0x4b')];_0x1b0e15+=0x1){socket[_0x2942('0x7d')]('userChatQueue:save',{'UserId':Number(_0x342194[_0x2942('0x5c')]['ids'][_0x1b0e15]),'ChatQueueId':Number(_0x342194['params']['id'])});}return _0x19a93f;});}})['then'](respondWithResult(_0x56b17e,null))['catch'](handleError(_0x56b17e,null));};exports['removeAgents']=function(_0x18bec2,_0x360206,_0x3aaf6a){return db[_0x2942('0x3f')][_0x2942('0x5a')]({'where':{'id':_0x18bec2['params']['id']}})[_0x2942('0x21')](handleEntityNotFound(_0x360206,null))[_0x2942('0x21')](function(_0xc99d02){if(_0xc99d02){return _0xc99d02[_0x2942('0x90')](_0x18bec2[_0x2942('0x44')][_0x2942('0x74')])['then'](function(){if(_['isArray'](_0x18bec2[_0x2942('0x44')][_0x2942('0x74')])){for(var _0x73e4e0=0x0;_0x73e4e0<_0x18bec2[_0x2942('0x44')][_0x2942('0x74')][_0x2942('0x4b')];_0x73e4e0+=0x1){socket[_0x2942('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x18bec2[_0x2942('0x44')][_0x2942('0x74')][_0x73e4e0]),'ChatQueueId':Number(_0x18bec2[_0x2942('0x64')]['id'])});}}else{socket[_0x2942('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x18bec2[_0x2942('0x44')][_0x2942('0x74')]),'ChatQueueId':Number(_0x18bec2[_0x2942('0x64')]['id'])});}});}})[_0x2942('0x21')](respondWithStatusCode(_0x360206,null))[_0x2942('0x2b')](handleError(_0x360206,null));};exports[_0x2942('0x95')]=function(_0x2dfe3d,_0x1544fd,_0x2e9424){var _0xa4555a={};var _0x538d62={};var _0xede6a8;var _0x27b6fa;return db['ChatQueue'][_0x2942('0x67')]({'where':{'id':_0x2dfe3d['params']['id']}})[_0x2942('0x21')](handleEntityNotFound(_0x1544fd,null))[_0x2942('0x21')](function(_0x337d97){if(_0x337d97){_0xede6a8=_0x337d97;_0x538d62[_0x2942('0x48')]=_[_0x2942('0x45')](db[_0x2942('0x75')][_0x2942('0x68')]);_0x538d62['query']=_[_0x2942('0x45')](_0x2dfe3d[_0x2942('0x44')]);_0x538d62[_0x2942('0x46')]=_['intersection'](_0x538d62[_0x2942('0x48')],_0x538d62[_0x2942('0x44')]);_0xa4555a['attributes']=_[_0x2942('0x47')](_0x538d62[_0x2942('0x48')],qs[_0x2942('0x49')](_0x2dfe3d[_0x2942('0x44')]['fields']));_0xa4555a[_0x2942('0x4a')]=_0xa4555a[_0x2942('0x4a')][_0x2942('0x4b')]?_0xa4555a['attributes']:_0x538d62[_0x2942('0x48')];_0xa4555a['order']=qs[_0x2942('0x4e')](_0x2dfe3d[_0x2942('0x44')][_0x2942('0x4e')]);_0xa4555a[_0x2942('0x4f')]=qs['filters'](_[_0x2942('0x50')](_0x2dfe3d[_0x2942('0x44')],_0x538d62[_0x2942('0x46')]));if(_0x2dfe3d[_0x2942('0x44')]['filter']){_0xa4555a[_0x2942('0x4f')]=_[_0x2942('0x52')](_0xa4555a[_0x2942('0x4f')],{'$or':_[_0x2942('0x43')](_0xa4555a[_0x2942('0x4a')],function(_0x254df2){var _0x417106={};_0x417106[_0x254df2]={'$like':'%'+_0x2dfe3d[_0x2942('0x44')][_0x2942('0x51')]+'%'};return _0x417106;})});}_0xa4555a=_[_0x2942('0x52')]({},_0xa4555a,_0x2dfe3d[_0x2942('0x54')]);return _0xede6a8[_0x2942('0x95')](_0xa4555a);}})[_0x2942('0x21')](function(_0x108df1){if(_0x108df1){_0x27b6fa=_0x108df1[_0x2942('0x4b')];if(!_0x2dfe3d[_0x2942('0x44')][_0x2942('0x4c')]('nolimit')){_0xa4555a[_0x2942('0x33')]=qs[_0x2942('0x33')](_0x2dfe3d[_0x2942('0x44')][_0x2942('0x33')]);_0xa4555a[_0x2942('0x30')]=qs['offset'](_0x2dfe3d[_0x2942('0x44')][_0x2942('0x30')]);}return _0xede6a8['getAgents'](_0xa4555a);}})[_0x2942('0x21')](function(_0x11e261){if(_0x11e261){return _0x11e261?{'count':_0x27b6fa,'rows':_0x11e261}:null;}})['then'](respondWithResult(_0x1544fd,null))[_0x2942('0x2b')](handleError(_0x1544fd,null));};
\ No newline at end of file
index 402dee6..0e038e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd63=['emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x19d31e,_0x493eb4){var _0x4ce98f=function(_0x314bcb){while(--_0x314bcb){_0x19d31e['push'](_0x19d31e['shift']());}};_0x4ce98f(++_0x493eb4);}(_0xcd63,0xe4));var _0x3cd6=function(_0x3efd4f,_0x46f435){_0x3efd4f=_0x3efd4f-0x0;var _0x4413e0=_0xcd63[_0x3efd4f];return _0x4413e0;};'use strict';var EventEmitter=require(_0x3cd6('0x0'));var ChatQueue=require(_0x3cd6('0x1'))['db'][_0x3cd6('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3cd6('0x3')](0x0);var events={'afterCreate':_0x3cd6('0x4'),'afterUpdate':'update','afterDestroy':_0x3cd6('0x5')};function emitEvent(_0xe68763){return function(_0x508944,_0x4ac7a8,_0x3e96b9){ChatQueueEvents[_0x3cd6('0x6')](_0xe68763+':'+_0x508944['id'],_0x508944);ChatQueueEvents[_0x3cd6('0x6')](_0xe68763,_0x508944);_0x3e96b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x3cd6('0x7')](e,emitEvent(event));}}module[_0x3cd6('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x98ac=['emit','hook','exports','ChatQueue','update','remove'];(function(_0x37db1a,_0x5cb922){var _0x158bdf=function(_0x5eb316){while(--_0x5eb316){_0x37db1a['push'](_0x37db1a['shift']());}};_0x158bdf(++_0x5cb922);}(_0x98ac,0x1d1));var _0xc98a=function(_0x21e7c1,_0x5b0efc){_0x21e7c1=_0x21e7c1-0x0;var _0xeecaa2=_0x98ac[_0x21e7c1];return _0xeecaa2;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xc98a('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc98a('0x1'),'afterDestroy':_0xc98a('0x2')};function emitEvent(_0xc0737a){return function(_0x141041,_0xe44835,_0x4f0402){ChatQueueEvents[_0xc98a('0x3')](_0xc0737a+':'+_0x141041['id'],_0x141041);ChatQueueEvents[_0xc98a('0x3')](_0xc0737a,_0x141041);_0x4f0402(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc98a('0x4')](e,emitEvent(event));}}module[_0xc98a('0x5')]=ChatQueueEvents;
\ No newline at end of file
index 65714ee..387fb7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6389=['request-promise','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x6389,0xf3));var _0x9638=function(_0xad088,_0x232e93){_0xad088=_0xad088-0x0;var _0x458275=_0x6389[_0xad088];return _0x458275;};'use strict';var _=require(_0x9638('0x0'));var util=require(_0x9638('0x1'));var logger=require(_0x9638('0x2'))('api');var moment=require(_0x9638('0x3'));var BPromise=require(_0x9638('0x4'));var rp=require(_0x9638('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module['exports']=function(_0x54a952,_0x2a8e26){return _0x54a952['define'](_0x9638('0x6'),attributes,{'tableName':_0x9638('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x53ba=['bluebird','request-promise','path','rimraf','exports','define','chat_queues','util','../../config/logger','moment'];(function(_0x46b9e4,_0x2f7771){var _0x192506=function(_0x3f0abc){while(--_0x3f0abc){_0x46b9e4['push'](_0x46b9e4['shift']());}};_0x192506(++_0x2f7771);}(_0x53ba,0x18d));var _0xa53b=function(_0x3493d4,_0x45c8e1){_0x3493d4=_0x3493d4-0x0;var _0x3bfd70=_0x53ba[_0x3493d4];return _0x3bfd70;};'use strict';var _=require('lodash');var util=require(_0xa53b('0x0'));var logger=require(_0xa53b('0x1'))('api');var moment=require(_0xa53b('0x2'));var BPromise=require(_0xa53b('0x3'));var rp=require(_0xa53b('0x4'));var fs=require('fs');var path=require(_0xa53b('0x5'));var rimraf=require(_0xa53b('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xa53b('0x7')]=function(_0x54a04d,_0x491268){return _0x54a04d[_0xa53b('0x8')]('ChatQueue',attributes,{'tableName':_0xa53b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e7a2c99..72121af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd509=['result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','model','map','stringify','find','where','ShowChatQueue','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0xe74558,_0x5273d5){var _0x50e228=function(_0x2f6eed){while(--_0x2f6eed){_0xe74558['push'](_0xe74558['shift']());}};_0x50e228(++_0x5273d5);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d50('0x0'));var BPromise=require(_0x9d50('0x1'));var rs=require(_0x9d50('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9d50('0x3'));var logger=require(_0x9d50('0x4'))('rpc');var config=require(_0x9d50('0x5'));var jayson=require(_0x9d50('0x6'));var client=jayson[_0x9d50('0x7')]['http']({'port':0x232a});config[_0x9d50('0x8')]=_['defaults'](config[_0x9d50('0x8')],{'host':_0x9d50('0x9'),'port':0x18eb});var socket=require(_0x9d50('0xa'))(new Redis(config[_0x9d50('0x8')]));require(_0x9d50('0xb'))['register'](socket);function respondWithRpcPromise(_0x26cbf6,_0x49bad9,_0x500912){return new BPromise(function(_0x2de74f,_0x568351){return client[_0x9d50('0xc')](_0x26cbf6,_0x500912)[_0x9d50('0xd')](function(_0x457c24){logger[_0x9d50('0xe')](_0x9d50('0xf'),_0x49bad9,_0x9d50('0x10'));logger[_0x9d50('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x49bad9,_0x9d50('0x10'),JSON['stringify'](_0x457c24));if(_0x457c24[_0x9d50('0x12')]){if(_0x457c24[_0x9d50('0x12')][_0x9d50('0x13')]===0x1f4){logger[_0x9d50('0x12')](_0x9d50('0xf'),_0x49bad9,_0x457c24[_0x9d50('0x12')][_0x9d50('0x14')]);return _0x568351(_0x457c24[_0x9d50('0x12')][_0x9d50('0x14')]);}logger[_0x9d50('0x12')](_0x9d50('0xf'),_0x49bad9,_0x457c24[_0x9d50('0x12')]['message']);return _0x2de74f(_0x457c24[_0x9d50('0x12')][_0x9d50('0x14')]);}else{logger[_0x9d50('0xe')](_0x9d50('0xf'),_0x49bad9,_0x9d50('0x10'));_0x2de74f(_0x457c24[_0x9d50('0x15')][_0x9d50('0x14')]);}})[_0x9d50('0x16')](function(_0x9c7a90){logger[_0x9d50('0x12')](_0x9d50('0xf'),_0x49bad9,_0x9c7a90);_0x568351(_0x9c7a90);});});}exports[_0x9d50('0x17')]=function(_0x24415e){var _0x7582d1=this;return new Promise(function(_0x243f64,_0x8905d3){return db[_0x9d50('0x18')][_0x9d50('0x19')]({'raw':_0x24415e[_0x9d50('0x1a')]?_0x24415e[_0x9d50('0x1a')][_0x9d50('0x1b')]===undefined?!![]:![]:!![],'where':_0x24415e[_0x9d50('0x1a')]?_0x24415e[_0x9d50('0x1a')]['where']||null:null,'attributes':_0x24415e[_0x9d50('0x1a')]?_0x24415e[_0x9d50('0x1a')][_0x9d50('0x1c')]||null:null,'limit':_0x24415e[_0x9d50('0x1a')]?_0x24415e[_0x9d50('0x1a')][_0x9d50('0x1d')]||null:null,'include':_0x24415e[_0x9d50('0x1a')]?_0x24415e[_0x9d50('0x1a')][_0x9d50('0x1e')]?_['map'](_0x24415e[_0x9d50('0x1a')]['include'],function(_0x5c58e0){return{'model':db[_0x5c58e0[_0x9d50('0x1f')]],'as':_0x5c58e0['as'],'attributes':_0x5c58e0[_0x9d50('0x1c')],'include':_0x5c58e0[_0x9d50('0x1e')]?_[_0x9d50('0x20')](_0x5c58e0['include'],function(_0x9623aa){return{'model':db[_0x9623aa[_0x9d50('0x1f')]],'as':_0x9623aa['as'],'attributes':_0x9623aa['attributes'],'include':_0x9623aa[_0x9d50('0x1e')]?_['map'](_0x9623aa[_0x9d50('0x1e')],function(_0x460420){return{'model':db[_0x460420[_0x9d50('0x1f')]],'as':_0x460420['as'],'attributes':_0x460420['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d50('0xd')](function(_0x515252){logger[_0x9d50('0xe')](_0x9d50('0x17'),_0x24415e);logger[_0x9d50('0x11')](_0x9d50('0x17'),_0x24415e,JSON[_0x9d50('0x21')](_0x515252));_0x243f64(_0x515252);})[_0x9d50('0x16')](function(_0x22f811){logger[_0x9d50('0x12')](_0x9d50('0x17'),_0x22f811['message'],_0x24415e);_0x8905d3(_0x7582d1[_0x9d50('0x12')](0x1f4,_0x22f811['message']));});});};exports['ShowChatQueue']=function(_0x438a50){var _0x1ad417=this;return new Promise(function(_0x15d4cc,_0x5e2854){return db[_0x9d50('0x18')][_0x9d50('0x22')]({'raw':_0x438a50[_0x9d50('0x1a')]?_0x438a50[_0x9d50('0x1a')][_0x9d50('0x1b')]===undefined?!![]:![]:!![],'where':_0x438a50[_0x9d50('0x1a')]?_0x438a50[_0x9d50('0x1a')][_0x9d50('0x23')]||null:null,'attributes':_0x438a50[_0x9d50('0x1a')]?_0x438a50[_0x9d50('0x1a')][_0x9d50('0x1c')]||null:null,'include':_0x438a50[_0x9d50('0x1a')]?_0x438a50[_0x9d50('0x1a')][_0x9d50('0x1e')]?_[_0x9d50('0x20')](_0x438a50['options'][_0x9d50('0x1e')],function(_0x554874){return{'model':db[_0x554874[_0x9d50('0x1f')]],'as':_0x554874['as'],'attributes':_0x554874['attributes'],'include':_0x554874[_0x9d50('0x1e')]?_[_0x9d50('0x20')](_0x554874[_0x9d50('0x1e')],function(_0x2e90dc){return{'model':db[_0x2e90dc[_0x9d50('0x1f')]],'as':_0x2e90dc['as'],'attributes':_0x2e90dc['attributes'],'include':_0x2e90dc[_0x9d50('0x1e')]?_[_0x9d50('0x20')](_0x2e90dc[_0x9d50('0x1e')],function(_0x66d578){return{'model':db[_0x66d578[_0x9d50('0x1f')]],'as':_0x66d578['as'],'attributes':_0x66d578[_0x9d50('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9d50('0xd')](function(_0x2a39e8){logger['info'](_0x9d50('0x24'),_0x438a50);logger['debug'](_0x9d50('0x24'),_0x438a50,JSON[_0x9d50('0x21')](_0x2a39e8));_0x15d4cc(_0x2a39e8);})[_0x9d50('0x16')](function(_0x174a89){logger[_0x9d50('0x12')](_0x9d50('0x24'),_0x174a89['message'],_0x438a50);_0x5e2854(_0x1ad417['error'](0x1f4,_0x174a89[_0x9d50('0x14')]));});});};
\ No newline at end of file
+var _0x6ee9=['./chatQueue.socket','register','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options','where','attributes','limit','map','model','include','debug','ShowChatQueue','find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x50a246,_0x124827){var _0x5221e5=function(_0x401bb9){while(--_0x401bb9){_0x50a246['push'](_0x50a246['shift']());}};_0x5221e5(++_0x124827);}(_0x6ee9,0x9c));var _0x96ee=function(_0x26c51c,_0x545ee9){_0x26c51c=_0x26c51c-0x0;var _0x15b3ef=_0x6ee9[_0x26c51c];return _0x15b3ef;};'use strict';var _=require('lodash');var util=require(_0x96ee('0x0'));var moment=require(_0x96ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x96ee('0x2'));var fs=require('fs');var Redis=require(_0x96ee('0x3'));var db=require(_0x96ee('0x4'))['db'];var utils=require(_0x96ee('0x5'));var logger=require(_0x96ee('0x6'))(_0x96ee('0x7'));var config=require(_0x96ee('0x8'));var jayson=require(_0x96ee('0x9'));var client=jayson[_0x96ee('0xa')][_0x96ee('0xb')]({'port':0x232a});config[_0x96ee('0xc')]=_[_0x96ee('0xd')](config[_0x96ee('0xc')],{'host':_0x96ee('0xe'),'port':0x18eb});var socket=require(_0x96ee('0xf'))(new Redis(config[_0x96ee('0xc')]));require(_0x96ee('0x10'))[_0x96ee('0x11')](socket);function respondWithRpcPromise(_0x1c5c60,_0x257d42,_0x4ad65b){return new BPromise(function(_0x5138f0,_0x9afae3){return client[_0x96ee('0x12')](_0x1c5c60,_0x4ad65b)[_0x96ee('0x13')](function(_0x6fc9f2){logger[_0x96ee('0x14')]('ChatQueue,\x20%s,\x20%s',_0x257d42,_0x96ee('0x15'));logger['debug'](_0x96ee('0x16'),_0x257d42,_0x96ee('0x15'),JSON[_0x96ee('0x17')](_0x6fc9f2));if(_0x6fc9f2[_0x96ee('0x18')]){if(_0x6fc9f2[_0x96ee('0x18')][_0x96ee('0x19')]===0x1f4){logger[_0x96ee('0x18')](_0x96ee('0x1a'),_0x257d42,_0x6fc9f2[_0x96ee('0x18')][_0x96ee('0x1b')]);return _0x9afae3(_0x6fc9f2[_0x96ee('0x18')]['message']);}logger[_0x96ee('0x18')](_0x96ee('0x1a'),_0x257d42,_0x6fc9f2[_0x96ee('0x18')]['message']);return _0x5138f0(_0x6fc9f2[_0x96ee('0x18')]['message']);}else{logger[_0x96ee('0x14')](_0x96ee('0x1a'),_0x257d42,_0x96ee('0x15'));_0x5138f0(_0x6fc9f2[_0x96ee('0x1c')]['message']);}})[_0x96ee('0x1d')](function(_0x32bc67){logger['error']('ChatQueue,\x20%s,\x20%s',_0x257d42,_0x32bc67);_0x9afae3(_0x32bc67);});});}exports[_0x96ee('0x1e')]=function(_0x3db99f){var _0x9a6ae2=this;return new Promise(function(_0x9ae300,_0x392bf6){return db['ChatQueue'][_0x96ee('0x1f')]({'raw':_0x3db99f[_0x96ee('0x20')]?_0x3db99f[_0x96ee('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3db99f[_0x96ee('0x20')]?_0x3db99f[_0x96ee('0x20')][_0x96ee('0x21')]||null:null,'attributes':_0x3db99f[_0x96ee('0x20')]?_0x3db99f['options'][_0x96ee('0x22')]||null:null,'limit':_0x3db99f['options']?_0x3db99f[_0x96ee('0x20')][_0x96ee('0x23')]||null:null,'include':_0x3db99f[_0x96ee('0x20')]?_0x3db99f[_0x96ee('0x20')]['include']?_[_0x96ee('0x24')](_0x3db99f[_0x96ee('0x20')]['include'],function(_0x375497){return{'model':db[_0x375497[_0x96ee('0x25')]],'as':_0x375497['as'],'attributes':_0x375497[_0x96ee('0x22')],'include':_0x375497[_0x96ee('0x26')]?_[_0x96ee('0x24')](_0x375497[_0x96ee('0x26')],function(_0x38779a){return{'model':db[_0x38779a[_0x96ee('0x25')]],'as':_0x38779a['as'],'attributes':_0x38779a[_0x96ee('0x22')],'include':_0x38779a[_0x96ee('0x26')]?_[_0x96ee('0x24')](_0x38779a[_0x96ee('0x26')],function(_0x19c6da){return{'model':db[_0x19c6da[_0x96ee('0x25')]],'as':_0x19c6da['as'],'attributes':_0x19c6da[_0x96ee('0x22')]};}):[]};}):[]};}):[]:[]})[_0x96ee('0x13')](function(_0x2d1567){logger['info'](_0x96ee('0x1e'),_0x3db99f);logger[_0x96ee('0x27')]('GetChatQueue',_0x3db99f,JSON[_0x96ee('0x17')](_0x2d1567));_0x9ae300(_0x2d1567);})[_0x96ee('0x1d')](function(_0x802745){logger['error'](_0x96ee('0x1e'),_0x802745[_0x96ee('0x1b')],_0x3db99f);_0x392bf6(_0x9a6ae2[_0x96ee('0x18')](0x1f4,_0x802745[_0x96ee('0x1b')]));});});};exports[_0x96ee('0x28')]=function(_0x4e8420){var _0x1cf2f6=this;return new Promise(function(_0x8f7c5,_0x32fbcd){return db['ChatQueue'][_0x96ee('0x29')]({'raw':_0x4e8420[_0x96ee('0x20')]?_0x4e8420[_0x96ee('0x20')][_0x96ee('0x2a')]===undefined?!![]:![]:!![],'where':_0x4e8420[_0x96ee('0x20')]?_0x4e8420[_0x96ee('0x20')][_0x96ee('0x21')]||null:null,'attributes':_0x4e8420[_0x96ee('0x20')]?_0x4e8420[_0x96ee('0x20')]['attributes']||null:null,'include':_0x4e8420['options']?_0x4e8420['options'][_0x96ee('0x26')]?_[_0x96ee('0x24')](_0x4e8420[_0x96ee('0x20')][_0x96ee('0x26')],function(_0x4f56de){return{'model':db[_0x4f56de[_0x96ee('0x25')]],'as':_0x4f56de['as'],'attributes':_0x4f56de['attributes'],'include':_0x4f56de[_0x96ee('0x26')]?_[_0x96ee('0x24')](_0x4f56de['include'],function(_0x4b7cd9){return{'model':db[_0x4b7cd9[_0x96ee('0x25')]],'as':_0x4b7cd9['as'],'attributes':_0x4b7cd9[_0x96ee('0x22')],'include':_0x4b7cd9[_0x96ee('0x26')]?_[_0x96ee('0x24')](_0x4b7cd9[_0x96ee('0x26')],function(_0x318d23){return{'model':db[_0x318d23[_0x96ee('0x25')]],'as':_0x318d23['as'],'attributes':_0x318d23[_0x96ee('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4899db){logger[_0x96ee('0x14')](_0x96ee('0x28'),_0x4e8420);logger['debug'](_0x96ee('0x28'),_0x4e8420,JSON['stringify'](_0x4899db));_0x8f7c5(_0x4899db);})['catch'](function(_0x3cfc88){logger[_0x96ee('0x18')](_0x96ee('0x28'),_0x3cfc88[_0x96ee('0x1b')],_0x4e8420);_0x32fbcd(_0x1cf2f6['error'](0x1f4,_0x3cfc88[_0x96ee('0x1b')]));});});};
\ No newline at end of file
index 74fef92..1e163dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a2c=['chatQueue:','./chatQueue.events','remove','update','emit','register'];(function(_0x5bf201,_0x469cf7){var _0x121f95=function(_0x3766d6){while(--_0x3766d6){_0x5bf201['push'](_0x5bf201['shift']());}};_0x121f95(++_0x469cf7);}(_0x7a2c,0x17b));var _0xc7a2=function(_0xc32b68,_0x389fe7){_0xc32b68=_0xc32b68-0x0;var _0x38259d=_0x7a2c[_0xc32b68];return _0x38259d;};'use strict';var ChatQueueEvents=require(_0xc7a2('0x0'));var events=['save',_0xc7a2('0x1'),_0xc7a2('0x2')];function createListener(_0x409ec5,_0x26fb61){return function(_0x44d702){_0x26fb61[_0xc7a2('0x3')](_0x409ec5,_0x44d702);};}function removeListener(_0x3f2b0d,_0x34cd60){return function(){ChatQueueEvents['removeListener'](_0x3f2b0d,_0x34cd60);};}exports[_0xc7a2('0x4')]=function(_0x1ddbae){for(var _0x5f334e=0x0,_0x481430=events['length'];_0x5f334e<_0x481430;_0x5f334e++){var _0x1dd150=events[_0x5f334e];var _0x3de428=createListener(_0xc7a2('0x5')+_0x1dd150,_0x1ddbae);ChatQueueEvents['on'](_0x1dd150,_0x3de428);}};
\ No newline at end of file
+var _0xd6d6=['chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x105d6c,_0x40e434){var _0x1ee89c=function(_0x270619){while(--_0x270619){_0x105d6c['push'](_0x105d6c['shift']());}};_0x1ee89c(++_0x40e434);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4af78f,_0x53d46b){_0x4af78f=_0x4af78f-0x0;var _0x5c7292=_0xd6d6[_0x4af78f];return _0x5c7292;};'use strict';var ChatQueueEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatQueueEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatQueueEvents['on'](_0x18f824,_0xd49f57);}};
\ No newline at end of file
index 8a1e784..36a5365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5fc3,0xa8));var _0x35fc=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0x5fc3[_0x25fa5c];return _0x1bade2;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x5b051b,_0x84c359){_0x5b051b=_0x5b051b-0x0;var _0x4716bb=_0x3e74[_0x5b051b];return _0x4716bb;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
index 147beff..68daf33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa67b=['moment','sequelize','exports','STRING','DATE'];(function(_0x358ec6,_0x5d5d2a){var _0x52e5ea=function(_0x55e4c2){while(--_0x55e4c2){_0x358ec6['push'](_0x358ec6['shift']());}};_0x52e5ea(++_0x5d5d2a);}(_0xa67b,0x10e));var _0xba67=function(_0x5e3c9a,_0x4b84a4){_0x5e3c9a=_0x5e3c9a-0x0;var _0x58b9bd=_0xa67b[_0x5e3c9a];return _0x58b9bd;};'use strict';var moment=require(_0xba67('0x0'));var Sequelize=require(_0xba67('0x1'));module[_0xba67('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xba67('0x3')]},'joinAt':{'type':Sequelize[_0xba67('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xba67('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xba67('0x3')]}};
\ No newline at end of file
+var _0x093a=['STRING','DATE','sequelize','exports'];(function(_0x5db0db,_0x575eed){var _0x737199=function(_0x103c59){while(--_0x103c59){_0x5db0db['push'](_0x5db0db['shift']());}};_0x737199(++_0x575eed);}(_0x093a,0x16a));var _0xa093=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0x093a[_0x254076];return _0x21a93e;};'use strict';var moment=require('moment');var Sequelize=require(_0xa093('0x0'));module[_0xa093('0x1')]={'uniqueid':{'type':Sequelize[_0xa093('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa093('0x3')]},'acceptAt':{'type':Sequelize[_0xa093('0x3')]},'exitAt':{'type':Sequelize[_0xa093('0x3')]},'reason':{'type':Sequelize[_0xa093('0x2')]}};
\ No newline at end of file
index a09f573..180e9e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2087=['include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options'];(function(_0x5db8c6,_0x34ced1){var _0x709b85=function(_0x155a1f){while(--_0x155a1f){_0x5db8c6['push'](_0x5db8c6['shift']());}};_0x709b85(++_0x34ced1);}(_0x2087,0xf3));var _0x7208=function(_0x206023,_0x300c07){_0x206023=_0x206023-0x0;var _0x20f774=_0x2087[_0x206023];return _0x20f774;};'use strict';var emlformat=require(_0x7208('0x0'));var rimraf=require(_0x7208('0x1'));var zipdir=require(_0x7208('0x2'));var jsonpatch=require(_0x7208('0x3'));var rp=require('request-promise');var moment=require(_0x7208('0x4'));var BPromise=require(_0x7208('0x5'));var Mustache=require(_0x7208('0x6'));var util=require(_0x7208('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7208('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7208('0x9'));var _=require('lodash');var squel=require(_0x7208('0xa'));var crypto=require(_0x7208('0xb'));var jsforce=require(_0x7208('0xc'));var deskjs=require(_0x7208('0xd'));var toCsv=require(_0x7208('0x8'));var querystring=require(_0x7208('0xe'));var Papa=require(_0x7208('0xf'));var Redis=require('ioredis');var authService=require(_0x7208('0x10'));var qs=require(_0x7208('0x11'));var as=require(_0x7208('0x12'));var hardwareService=require(_0x7208('0x13'));var logger=require(_0x7208('0x14'))(_0x7208('0x15'));var utils=require('../../config/utils');var config=require(_0x7208('0x16'));var licenseUtil=require(_0x7208('0x17'));var db=require(_0x7208('0x18'))['db'];function respondWithStatusCode(_0x86a763,_0x207595){_0x207595=_0x207595||0xcc;return function(_0x22ee6c){if(_0x22ee6c){return _0x86a763['sendStatus'](_0x207595);}return _0x86a763[_0x7208('0x19')](_0x207595)[_0x7208('0x1a')]();};}function respondWithResult(_0x234927,_0x26515b){_0x26515b=_0x26515b||0xc8;return function(_0xfe87de){if(_0xfe87de){return _0x234927[_0x7208('0x19')](_0x26515b)[_0x7208('0x1b')](_0xfe87de);}};}function respondWithFilteredResult(_0x3254d1,_0x238ada){return function(_0x320a12){if(_0x320a12){var _0x340a10=typeof _0x238ada['offset']==='undefined'&&typeof _0x238ada[_0x7208('0x1c')]===_0x7208('0x1d');var _0x5b22d6=_0x320a12[_0x7208('0x1e')];var _0x2d0b05=_0x340a10?0x0:_0x238ada['offset'];var _0x31028d=_0x340a10?_0x320a12[_0x7208('0x1e')]:_0x238ada[_0x7208('0x1f')]+_0x238ada[_0x7208('0x1c')];var _0x1d0551;if(_0x31028d>=_0x5b22d6){_0x31028d=_0x5b22d6;_0x1d0551=0xc8;}else{_0x1d0551=0xce;}_0x3254d1[_0x7208('0x19')](_0x1d0551);return _0x3254d1[_0x7208('0x20')](_0x7208('0x21'),_0x2d0b05+'-'+_0x31028d+'/'+_0x5b22d6)[_0x7208('0x1b')](_0x320a12);}return null;};}function patchUpdates(_0x41cd3a){return function(_0x3c17db){try{jsonpatch[_0x7208('0x22')](_0x3c17db,_0x41cd3a,!![]);}catch(_0x2c220f){return BPromise[_0x7208('0x23')](_0x2c220f);}return _0x3c17db[_0x7208('0x24')]();};}function saveUpdates(_0x47da91,_0x52bce8){return function(_0x11bae6){if(_0x11bae6){return _0x11bae6[_0x7208('0x25')](_0x47da91)[_0x7208('0x26')](function(_0x4d9011){return _0x4d9011;});}return null;};}function removeEntity(_0x1b95dc,_0x216167){return function(_0x328128){if(_0x328128){return _0x328128[_0x7208('0x27')]()[_0x7208('0x26')](function(){_0x1b95dc[_0x7208('0x19')](0xcc)[_0x7208('0x1a')]();});}};}function handleEntityNotFound(_0x126dae,_0x26c2d7){return function(_0x12f4ff){if(!_0x12f4ff){_0x126dae[_0x7208('0x28')](0x194);}return _0x12f4ff;};}function handleError(_0x56066a,_0xef71a9){_0xef71a9=_0xef71a9||0x1f4;return function(_0x15a091){logger[_0x7208('0x29')](_0x15a091[_0x7208('0x2a')]);if(_0x15a091[_0x7208('0x2b')]){delete _0x15a091[_0x7208('0x2b')];}_0x56066a[_0x7208('0x19')](_0xef71a9)['send'](_0x15a091);};}exports[_0x7208('0x2c')]=function(_0x5c5394,_0x495844){var _0xdc6577={},_0x2cc481={},_0x480ce3={'count':0x0,'rows':[]};var _0x21f63d=_[_0x7208('0x2d')](db[_0x7208('0x2e')][_0x7208('0x2f')],function(_0x2f3576){return{'name':_0x2f3576[_0x7208('0x30')],'type':_0x2f3576[_0x7208('0x31')]['key']};});_0x2cc481[_0x7208('0x32')]=_[_0x7208('0x2d')](_0x21f63d,_0x7208('0x2b'));_0x2cc481['query']=_['keys'](_0x5c5394[_0x7208('0x33')]);_0x2cc481[_0x7208('0x34')]=_[_0x7208('0x35')](_0x2cc481[_0x7208('0x32')],_0x2cc481[_0x7208('0x33')]);_0xdc6577[_0x7208('0x36')]=_[_0x7208('0x35')](_0x2cc481['model'],qs['fields'](_0x5c5394['query'][_0x7208('0x37')]));_0xdc6577[_0x7208('0x36')]=_0xdc6577[_0x7208('0x36')][_0x7208('0x38')]?_0xdc6577[_0x7208('0x36')]:_0x2cc481[_0x7208('0x32')];if(!_0x5c5394['query'][_0x7208('0x39')]('nolimit')){_0xdc6577['limit']=qs[_0x7208('0x1c')](_0x5c5394['query'][_0x7208('0x1c')]);_0xdc6577[_0x7208('0x1f')]=qs[_0x7208('0x1f')](_0x5c5394['query'][_0x7208('0x1f')]);}_0xdc6577['order']=qs[_0x7208('0x3a')](_0x5c5394['query'][_0x7208('0x3a')]);_0xdc6577['where']=qs[_0x7208('0x34')](_[_0x7208('0x3b')](_0x5c5394[_0x7208('0x33')],_0x2cc481[_0x7208('0x34')]),_0x21f63d);if(_0x5c5394[_0x7208('0x33')][_0x7208('0x3c')]){_0xdc6577[_0x7208('0x3d')]=_['merge'](_0xdc6577[_0x7208('0x3d')],{'$or':_[_0x7208('0x2d')](_0x21f63d,function(_0x2c9b2b){if(_0x2c9b2b['type']!==_0x7208('0x3e')){var _0x9e59f7={};_0x9e59f7[_0x2c9b2b[_0x7208('0x2b')]]={'$like':'%'+_0x5c5394[_0x7208('0x33')]['filter']+'%'};return _0x9e59f7;}})});}_0xdc6577=_[_0x7208('0x3f')]({},_0xdc6577,_0x5c5394[_0x7208('0x40')]);var _0x370957={'where':_0xdc6577[_0x7208('0x3d')]};return db[_0x7208('0x2e')][_0x7208('0x1e')](_0x370957)['then'](function(_0x4394ca){_0x480ce3['count']=_0x4394ca;if(_0x5c5394[_0x7208('0x33')]['includeAll']){_0xdc6577[_0x7208('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x7208('0x42')](_0xdc6577);})['then'](function(_0x52efef){_0x480ce3[_0x7208('0x43')]=_0x52efef;return _0x480ce3;})[_0x7208('0x26')](respondWithFilteredResult(_0x495844,_0xdc6577))['catch'](handleError(_0x495844,null));};exports[_0x7208('0x44')]=function(_0x1fb348,_0x28548c){var _0x10a1a7={'raw':!![],'where':{'id':_0x1fb348['params']['id']}},_0x4968ba={};_0x4968ba[_0x7208('0x32')]=_['keys'](db[_0x7208('0x2e')][_0x7208('0x2f')]);_0x4968ba[_0x7208('0x33')]=_[_0x7208('0x45')](_0x1fb348[_0x7208('0x33')]);_0x4968ba['filters']=_[_0x7208('0x35')](_0x4968ba[_0x7208('0x32')],_0x4968ba[_0x7208('0x33')]);_0x10a1a7[_0x7208('0x36')]=_[_0x7208('0x35')](_0x4968ba[_0x7208('0x32')],qs['fields'](_0x1fb348[_0x7208('0x33')]['fields']));_0x10a1a7[_0x7208('0x36')]=_0x10a1a7['attributes']['length']?_0x10a1a7['attributes']:_0x4968ba[_0x7208('0x32')];if(_0x1fb348[_0x7208('0x33')][_0x7208('0x46')]){_0x10a1a7[_0x7208('0x41')]=[{'all':!![]}];}_0x10a1a7=_['merge']({},_0x10a1a7,_0x1fb348[_0x7208('0x40')]);return db[_0x7208('0x2e')][_0x7208('0x47')](_0x10a1a7)[_0x7208('0x26')](handleEntityNotFound(_0x28548c,null))[_0x7208('0x26')](respondWithResult(_0x28548c,null))[_0x7208('0x48')](handleError(_0x28548c,null));};exports[_0x7208('0x49')]=function(_0x5496a1,_0x44d2ac){return db[_0x7208('0x2e')][_0x7208('0x49')](_0x5496a1[_0x7208('0x4a')],{})['then'](respondWithResult(_0x44d2ac,0xc9))['catch'](handleError(_0x44d2ac,null));};exports[_0x7208('0x25')]=function(_0x454b51,_0x4f06ec){if(_0x454b51[_0x7208('0x4a')]['id']){delete _0x454b51[_0x7208('0x4a')]['id'];}return db[_0x7208('0x2e')][_0x7208('0x47')]({'where':{'id':_0x454b51[_0x7208('0x4b')]['id']}})[_0x7208('0x26')](handleEntityNotFound(_0x4f06ec,null))[_0x7208('0x26')](saveUpdates(_0x454b51[_0x7208('0x4a')],null))['then'](respondWithResult(_0x4f06ec,null))['catch'](handleError(_0x4f06ec,null));};exports['destroy']=function(_0x1631c4,_0x22697c){return db[_0x7208('0x2e')][_0x7208('0x47')]({'where':{'id':_0x1631c4[_0x7208('0x4b')]['id']}})[_0x7208('0x26')](handleEntityNotFound(_0x22697c,null))[_0x7208('0x26')](removeEntity(_0x22697c,null))['catch'](handleError(_0x22697c,null));};exports[_0x7208('0x4c')]=function(_0x5502b8,_0x5bc91a){return db[_0x7208('0x2e')][_0x7208('0x4c')]()['then'](respondWithResult(_0x5bc91a,null))[_0x7208('0x48')](handleError(_0x5bc91a,null));};
\ No newline at end of file
+var _0x078a=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x078a,0x12d));var _0xa078=function(_0x34c68b,_0x3e35b6){_0x34c68b=_0x34c68b-0x0;var _0x1f7cd6=_0x078a[_0x34c68b];return _0x1f7cd6;};'use strict';var emlformat=require(_0xa078('0x0'));var rimraf=require(_0xa078('0x1'));var zipdir=require(_0xa078('0x2'));var jsonpatch=require(_0xa078('0x3'));var rp=require(_0xa078('0x4'));var moment=require(_0xa078('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa078('0x6'));var util=require(_0xa078('0x7'));var path=require(_0xa078('0x8'));var sox=require('sox');var csv=require(_0xa078('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa078('0xa'));var _=require(_0xa078('0xb'));var squel=require(_0xa078('0xc'));var crypto=require(_0xa078('0xd'));var jsforce=require(_0xa078('0xe'));var deskjs=require(_0xa078('0xf'));var toCsv=require(_0xa078('0x9'));var querystring=require(_0xa078('0x10'));var Papa=require('papaparse');var Redis=require(_0xa078('0x11'));var authService=require(_0xa078('0x12'));var qs=require(_0xa078('0x13'));var as=require(_0xa078('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa078('0x15'))(_0xa078('0x16'));var utils=require(_0xa078('0x17'));var config=require(_0xa078('0x18'));var licenseUtil=require(_0xa078('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31efe8,_0x23e314){_0x23e314=_0x23e314||0xcc;return function(_0x3e1d0a){if(_0x3e1d0a){return _0x31efe8[_0xa078('0x1a')](_0x23e314);}return _0x31efe8[_0xa078('0x1b')](_0x23e314)[_0xa078('0x1c')]();};}function respondWithResult(_0x43064b,_0x214106){_0x214106=_0x214106||0xc8;return function(_0x162163){if(_0x162163){return _0x43064b[_0xa078('0x1b')](_0x214106)[_0xa078('0x1d')](_0x162163);}};}function respondWithFilteredResult(_0x195ed7,_0x4fee95){return function(_0x3a24f8){if(_0x3a24f8){var _0x410ff9=typeof _0x4fee95[_0xa078('0x1e')]==='undefined'&&typeof _0x4fee95[_0xa078('0x1f')]===_0xa078('0x20');var _0x5da909=_0x3a24f8[_0xa078('0x21')];var _0xde9c46=_0x410ff9?0x0:_0x4fee95[_0xa078('0x1e')];var _0x5943ca=_0x410ff9?_0x3a24f8[_0xa078('0x21')]:_0x4fee95[_0xa078('0x1e')]+_0x4fee95[_0xa078('0x1f')];var _0x24f9a1;if(_0x5943ca>=_0x5da909){_0x5943ca=_0x5da909;_0x24f9a1=0xc8;}else{_0x24f9a1=0xce;}_0x195ed7[_0xa078('0x1b')](_0x24f9a1);return _0x195ed7[_0xa078('0x22')]('Content-Range',_0xde9c46+'-'+_0x5943ca+'/'+_0x5da909)['json'](_0x3a24f8);}return null;};}function patchUpdates(_0x240a5f){return function(_0x4a19f1){try{jsonpatch[_0xa078('0x23')](_0x4a19f1,_0x240a5f,!![]);}catch(_0x1023eb){return BPromise[_0xa078('0x24')](_0x1023eb);}return _0x4a19f1[_0xa078('0x25')]();};}function saveUpdates(_0x262134,_0x3af3e6){return function(_0x59577c){if(_0x59577c){return _0x59577c[_0xa078('0x26')](_0x262134)['then'](function(_0x5b05e3){return _0x5b05e3;});}return null;};}function removeEntity(_0x17d034,_0x20a368){return function(_0x5b7278){if(_0x5b7278){return _0x5b7278['destroy']()[_0xa078('0x27')](function(){_0x17d034[_0xa078('0x1b')](0xcc)[_0xa078('0x1c')]();});}};}function handleEntityNotFound(_0x262b22,_0x52d202){return function(_0x3b746a){if(!_0x3b746a){_0x262b22[_0xa078('0x1a')](0x194);}return _0x3b746a;};}function handleError(_0x550560,_0xeb5d3d){_0xeb5d3d=_0xeb5d3d||0x1f4;return function(_0x4596ca){logger[_0xa078('0x28')](_0x4596ca[_0xa078('0x29')]);if(_0x4596ca[_0xa078('0x2a')]){delete _0x4596ca[_0xa078('0x2a')];}_0x550560[_0xa078('0x1b')](_0xeb5d3d)[_0xa078('0x2b')](_0x4596ca);};}exports[_0xa078('0x2c')]=function(_0x18d6b2,_0x308085){var _0x5ae5ac={},_0x2e2199={},_0x2c972e={'count':0x0,'rows':[]};var _0x1fee4d=_[_0xa078('0x2d')](db[_0xa078('0x2e')][_0xa078('0x2f')],function(_0x5cd3d6){return{'name':_0x5cd3d6[_0xa078('0x30')],'type':_0x5cd3d6['type'][_0xa078('0x31')]};});_0x2e2199[_0xa078('0x32')]=_[_0xa078('0x2d')](_0x1fee4d,_0xa078('0x2a'));_0x2e2199['query']=_[_0xa078('0x33')](_0x18d6b2[_0xa078('0x34')]);_0x2e2199[_0xa078('0x35')]=_[_0xa078('0x36')](_0x2e2199[_0xa078('0x32')],_0x2e2199['query']);_0x5ae5ac['attributes']=_[_0xa078('0x36')](_0x2e2199[_0xa078('0x32')],qs['fields'](_0x18d6b2[_0xa078('0x34')][_0xa078('0x37')]));_0x5ae5ac['attributes']=_0x5ae5ac[_0xa078('0x38')][_0xa078('0x39')]?_0x5ae5ac[_0xa078('0x38')]:_0x2e2199[_0xa078('0x32')];if(!_0x18d6b2[_0xa078('0x34')][_0xa078('0x3a')](_0xa078('0x3b'))){_0x5ae5ac[_0xa078('0x1f')]=qs['limit'](_0x18d6b2[_0xa078('0x34')][_0xa078('0x1f')]);_0x5ae5ac['offset']=qs[_0xa078('0x1e')](_0x18d6b2['query']['offset']);}_0x5ae5ac['order']=qs['sort'](_0x18d6b2[_0xa078('0x34')]['sort']);_0x5ae5ac[_0xa078('0x3c')]=qs[_0xa078('0x35')](_['pick'](_0x18d6b2[_0xa078('0x34')],_0x2e2199[_0xa078('0x35')]),_0x1fee4d);if(_0x18d6b2[_0xa078('0x34')]['filter']){_0x5ae5ac[_0xa078('0x3c')]=_[_0xa078('0x3d')](_0x5ae5ac[_0xa078('0x3c')],{'$or':_[_0xa078('0x2d')](_0x1fee4d,function(_0x51bcc2){if(_0x51bcc2[_0xa078('0x3e')]!==_0xa078('0x3f')){var _0x103179={};_0x103179[_0x51bcc2[_0xa078('0x2a')]]={'$like':'%'+_0x18d6b2[_0xa078('0x34')]['filter']+'%'};return _0x103179;}})});}_0x5ae5ac=_['merge']({},_0x5ae5ac,_0x18d6b2[_0xa078('0x40')]);var _0x3dda89={'where':_0x5ae5ac[_0xa078('0x3c')]};return db[_0xa078('0x2e')]['count'](_0x3dda89)[_0xa078('0x27')](function(_0x29a8e2){_0x2c972e[_0xa078('0x21')]=_0x29a8e2;if(_0x18d6b2[_0xa078('0x34')][_0xa078('0x41')]){_0x5ae5ac[_0xa078('0x42')]=[{'all':!![]}];}return db[_0xa078('0x2e')][_0xa078('0x43')](_0x5ae5ac);})[_0xa078('0x27')](function(_0x365407){_0x2c972e[_0xa078('0x44')]=_0x365407;return _0x2c972e;})[_0xa078('0x27')](respondWithFilteredResult(_0x308085,_0x5ae5ac))[_0xa078('0x45')](handleError(_0x308085,null));};exports[_0xa078('0x46')]=function(_0x374420,_0x157317){var _0xc85e1b={'raw':!![],'where':{'id':_0x374420[_0xa078('0x47')]['id']}},_0x306144={};_0x306144['model']=_[_0xa078('0x33')](db[_0xa078('0x2e')][_0xa078('0x2f')]);_0x306144[_0xa078('0x34')]=_[_0xa078('0x33')](_0x374420[_0xa078('0x34')]);_0x306144[_0xa078('0x35')]=_[_0xa078('0x36')](_0x306144[_0xa078('0x32')],_0x306144[_0xa078('0x34')]);_0xc85e1b['attributes']=_[_0xa078('0x36')](_0x306144[_0xa078('0x32')],qs[_0xa078('0x37')](_0x374420[_0xa078('0x34')][_0xa078('0x37')]));_0xc85e1b[_0xa078('0x38')]=_0xc85e1b[_0xa078('0x38')]['length']?_0xc85e1b[_0xa078('0x38')]:_0x306144['model'];if(_0x374420[_0xa078('0x34')][_0xa078('0x41')]){_0xc85e1b['include']=[{'all':!![]}];}_0xc85e1b=_[_0xa078('0x3d')]({},_0xc85e1b,_0x374420[_0xa078('0x40')]);return db[_0xa078('0x2e')][_0xa078('0x48')](_0xc85e1b)[_0xa078('0x27')](handleEntityNotFound(_0x157317,null))['then'](respondWithResult(_0x157317,null))['catch'](handleError(_0x157317,null));};exports[_0xa078('0x49')]=function(_0x38eeb1,_0x4f685f){return db[_0xa078('0x2e')][_0xa078('0x49')](_0x38eeb1['body'],{})[_0xa078('0x27')](respondWithResult(_0x4f685f,0xc9))[_0xa078('0x45')](handleError(_0x4f685f,null));};exports[_0xa078('0x26')]=function(_0x4bf214,_0x1c386f){if(_0x4bf214[_0xa078('0x4a')]['id']){delete _0x4bf214[_0xa078('0x4a')]['id'];}return db[_0xa078('0x2e')][_0xa078('0x48')]({'where':{'id':_0x4bf214[_0xa078('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c386f,null))[_0xa078('0x27')](saveUpdates(_0x4bf214[_0xa078('0x4a')],null))['then'](respondWithResult(_0x1c386f,null))['catch'](handleError(_0x1c386f,null));};exports[_0xa078('0x4b')]=function(_0x2c941d,_0x2c3b45){return db['ChatQueueReport'][_0xa078('0x48')]({'where':{'id':_0x2c941d[_0xa078('0x47')]['id']}})[_0xa078('0x27')](handleEntityNotFound(_0x2c3b45,null))['then'](removeEntity(_0x2c3b45,null))['catch'](handleError(_0x2c3b45,null));};exports['describe']=function(_0x5c9de6,_0x103661){return db[_0xa078('0x2e')][_0xa078('0x4c')]()['then'](respondWithResult(_0x103661,null))['catch'](handleError(_0x103661,null));};
\ No newline at end of file
index d08b85e..fe0d6c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x3118d0,_0x5da02e){var _0x4a7336=function(_0x30085a){while(--_0x30085a){_0x3118d0['push'](_0x3118d0['shift']());}};_0x4a7336(++_0x5da02e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xb7e7[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index f680798..be69960 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x213f=['CreateChatQueueReport','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport','create','options','raw','then'];(function(_0x9fdca,_0x364493){var _0x4037a3=function(_0x241c66){while(--_0x241c66){_0x9fdca['push'](_0x9fdca['shift']());}};_0x4037a3(++_0x364493);}(_0x213f,0xdf));var _0xf213=function(_0x3c865c,_0x5777de){_0x3c865c=_0x3c865c-0x0;var _0x5d1a91=_0x213f[_0x3c865c];return _0x5d1a91;};'use strict';var _=require(_0xf213('0x0'));var util=require('util');var moment=require(_0xf213('0x1'));var BPromise=require(_0xf213('0x2'));var rs=require(_0xf213('0x3'));var fs=require('fs');var Redis=require(_0xf213('0x4'));var db=require(_0xf213('0x5'))['db'];var utils=require(_0xf213('0x6'));var logger=require(_0xf213('0x7'))('rpc');var config=require(_0xf213('0x8'));var jayson=require(_0xf213('0x9'));var client=jayson[_0xf213('0xa')][_0xf213('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51958c,_0x43792b,_0x8ef7ca){return new BPromise(function(_0x45a751,_0x3577f9){return client[_0xf213('0xc')](_0x51958c,_0x8ef7ca)['then'](function(_0x4f0cd8){logger[_0xf213('0xd')](_0xf213('0xe'),_0x43792b,'request\x20sent');logger[_0xf213('0xf')](_0xf213('0x10'),_0x43792b,_0xf213('0x11'),JSON[_0xf213('0x12')](_0x4f0cd8));if(_0x4f0cd8[_0xf213('0x13')]){if(_0x4f0cd8[_0xf213('0x13')][_0xf213('0x14')]===0x1f4){logger['error'](_0xf213('0xe'),_0x43792b,_0x4f0cd8['error'][_0xf213('0x15')]);return _0x3577f9(_0x4f0cd8[_0xf213('0x13')][_0xf213('0x15')]);}logger[_0xf213('0x13')](_0xf213('0xe'),_0x43792b,_0x4f0cd8[_0xf213('0x13')][_0xf213('0x15')]);return _0x45a751(_0x4f0cd8['error'][_0xf213('0x15')]);}else{logger['info'](_0xf213('0xe'),_0x43792b,_0xf213('0x11'));_0x45a751(_0x4f0cd8[_0xf213('0x16')]['message']);}})[_0xf213('0x17')](function(_0xd25e71){logger[_0xf213('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x43792b,_0xd25e71);_0x3577f9(_0xd25e71);});});}exports['CreateChatQueueReport']=function(_0x191c16){var _0x1f041b=this;return new Promise(function(_0x20255f,_0x5a5e9b){return db[_0xf213('0x18')][_0xf213('0x19')](_0x191c16['body'],{'raw':_0x191c16[_0xf213('0x1a')]?_0x191c16['options'][_0xf213('0x1b')]===undefined?!![]:![]:!![]})[_0xf213('0x1c')](function(_0x5b134b){logger['info'](_0xf213('0x1d'),_0x191c16);logger[_0xf213('0xf')](_0xf213('0x1d'),_0x191c16,JSON[_0xf213('0x12')](_0x5b134b));_0x20255f(_0x5b134b);})[_0xf213('0x17')](function(_0x5f3502){logger[_0xf213('0x13')](_0xf213('0x1d'),_0x5f3502[_0xf213('0x15')],_0x191c16);_0x5a5e9b(_0x1f041b['error'](0x1f4,_0x5f3502['message']));});});};exports[_0xf213('0x1e')]=function(_0x52ef41){var _0x3d73d=this;return new Promise(function(_0x446a6b,_0x9eea7){return db[_0xf213('0x18')][_0xf213('0x1f')](_0x52ef41[_0xf213('0x20')],{'raw':_0x52ef41[_0xf213('0x1a')]?_0x52ef41[_0xf213('0x1a')][_0xf213('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52ef41['options']?_0x52ef41[_0xf213('0x1a')][_0xf213('0x21')]||null:null,'attributes':_0x52ef41[_0xf213('0x1a')]?_0x52ef41['options'][_0xf213('0x22')]||null:null,'limit':_0x52ef41[_0xf213('0x1a')]?_0x52ef41[_0xf213('0x1a')][_0xf213('0x23')]||null:null})[_0xf213('0x1c')](function(_0x338911){logger[_0xf213('0xd')]('UpdateChatQueueReport',_0x52ef41);logger[_0xf213('0xf')](_0xf213('0x1e'),_0x52ef41,JSON[_0xf213('0x12')](_0x338911));_0x446a6b(_0x338911);})[_0xf213('0x17')](function(_0x4ea5dd){logger['error'](_0xf213('0x1e'),_0x4ea5dd[_0xf213('0x15')],_0x52ef41);_0x9eea7(_0x3d73d['error'](0x1f4,_0x4ea5dd[_0xf213('0x15')]));});});};
\ No newline at end of file
+var _0x7529=['rpc','client','http','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','ChatQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x29119b,_0x5738ff){var _0x3f8683=function(_0x510d32){while(--_0x510d32){_0x29119b['push'](_0x29119b['shift']());}};_0x3f8683(++_0x5738ff);}(_0x7529,0x1c6));var _0x9752=function(_0x468c38,_0x5f00bf){_0x468c38=_0x468c38-0x0;var _0x21ea89=_0x7529[_0x468c38];return _0x21ea89;};'use strict';var _=require(_0x9752('0x0'));var util=require(_0x9752('0x1'));var moment=require(_0x9752('0x2'));var BPromise=require(_0x9752('0x3'));var rs=require(_0x9752('0x4'));var fs=require('fs');var Redis=require(_0x9752('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9752('0x6'));var logger=require(_0x9752('0x7'))(_0x9752('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9752('0x9')][_0x9752('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x270062,_0x3d95e4,_0x1d4276){return new BPromise(function(_0x1157a4,_0x2f5f21){return client[_0x9752('0xb')](_0x270062,_0x1d4276)[_0x9752('0xc')](function(_0x4a0dbb){logger[_0x9752('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3d95e4,'request\x20sent');logger[_0x9752('0xe')](_0x9752('0xf'),_0x3d95e4,_0x9752('0x10'),JSON[_0x9752('0x11')](_0x4a0dbb));if(_0x4a0dbb[_0x9752('0x12')]){if(_0x4a0dbb[_0x9752('0x12')][_0x9752('0x13')]===0x1f4){logger[_0x9752('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3d95e4,_0x4a0dbb['error']['message']);return _0x2f5f21(_0x4a0dbb[_0x9752('0x12')][_0x9752('0x14')]);}logger[_0x9752('0x12')](_0x9752('0x15'),_0x3d95e4,_0x4a0dbb[_0x9752('0x12')][_0x9752('0x14')]);return _0x1157a4(_0x4a0dbb[_0x9752('0x12')][_0x9752('0x14')]);}else{logger[_0x9752('0xd')](_0x9752('0x15'),_0x3d95e4,_0x9752('0x10'));_0x1157a4(_0x4a0dbb[_0x9752('0x16')][_0x9752('0x14')]);}})[_0x9752('0x17')](function(_0x1e077d){logger[_0x9752('0x12')](_0x9752('0x15'),_0x3d95e4,_0x1e077d);_0x2f5f21(_0x1e077d);});});}exports[_0x9752('0x18')]=function(_0x5f573a){var _0x5d8ecf=this;return new Promise(function(_0x6de83a,_0x4cab0e){return db['ChatQueueReport'][_0x9752('0x19')](_0x5f573a[_0x9752('0x1a')],{'raw':_0x5f573a[_0x9752('0x1b')]?_0x5f573a[_0x9752('0x1b')][_0x9752('0x1c')]===undefined?!![]:![]:!![]})[_0x9752('0xc')](function(_0x55595f){logger[_0x9752('0xd')](_0x9752('0x18'),_0x5f573a);logger['debug']('CreateChatQueueReport',_0x5f573a,JSON[_0x9752('0x11')](_0x55595f));_0x6de83a(_0x55595f);})[_0x9752('0x17')](function(_0x2d14b1){logger[_0x9752('0x12')]('CreateChatQueueReport',_0x2d14b1[_0x9752('0x14')],_0x5f573a);_0x4cab0e(_0x5d8ecf[_0x9752('0x12')](0x1f4,_0x2d14b1[_0x9752('0x14')]));});});};exports[_0x9752('0x1d')]=function(_0x3468e4){var _0x88f3a5=this;return new Promise(function(_0x47f24d,_0xc0d4e1){return db[_0x9752('0x1e')][_0x9752('0x1f')](_0x3468e4['body'],{'raw':_0x3468e4[_0x9752('0x1b')]?_0x3468e4[_0x9752('0x1b')][_0x9752('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3468e4[_0x9752('0x1b')]?_0x3468e4['options']['where']||null:null,'attributes':_0x3468e4[_0x9752('0x1b')]?_0x3468e4[_0x9752('0x1b')]['attributes']||null:null,'limit':_0x3468e4[_0x9752('0x1b')]?_0x3468e4[_0x9752('0x1b')][_0x9752('0x20')]||null:null})[_0x9752('0xc')](function(_0x515c95){logger[_0x9752('0xd')](_0x9752('0x1d'),_0x3468e4);logger[_0x9752('0xe')](_0x9752('0x1d'),_0x3468e4,JSON[_0x9752('0x11')](_0x515c95));_0x47f24d(_0x515c95);})[_0x9752('0x17')](function(_0x42b066){logger[_0x9752('0x12')](_0x9752('0x1d'),_0x42b066[_0x9752('0x14')],_0x3468e4);_0xc0d4e1(_0x88f3a5[_0x9752('0x12')](0x1f4,_0x42b066[_0x9752('0x14')]));});});};
\ No newline at end of file
index 7ebe5c3..47c9803 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8c1=['put','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x3d0571,_0x354b77){var _0x4259a0=function(_0x27eaea){while(--_0x27eaea){_0x3d0571['push'](_0x3d0571['shift']());}};_0x4259a0(++_0x354b77);}(_0xe8c1,0x154));var _0x1e8c=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0xe8c1[_0x1b51ea];return _0x18bbdc;};'use strict';var multer=require(_0x1e8c('0x0'));var util=require(_0x1e8c('0x1'));var path=require(_0x1e8c('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e8c('0x3'));var router=express[_0x1e8c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1e8c('0x5'));var config=require(_0x1e8c('0x6'));var controller=require(_0x1e8c('0x7'));router[_0x1e8c('0x8')]('/',auth[_0x1e8c('0x9')](),controller[_0x1e8c('0xa')]);router[_0x1e8c('0x8')](_0x1e8c('0xb'),auth[_0x1e8c('0x9')](),controller[_0x1e8c('0xc')]);router[_0x1e8c('0x8')](_0x1e8c('0xd'),auth[_0x1e8c('0x9')](),controller[_0x1e8c('0xe')]);router[_0x1e8c('0xf')]('/',auth[_0x1e8c('0x9')](),controller[_0x1e8c('0x10')]);router[_0x1e8c('0x11')]('/:id',auth[_0x1e8c('0x9')](),controller[_0x1e8c('0x12')]);router[_0x1e8c('0x13')]('/:id',auth[_0x1e8c('0x9')](),controller[_0x1e8c('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xaa9e=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put'];(function(_0x5890ed,_0x5eec7c){var _0x49ef9b=function(_0x3d68eb){while(--_0x3d68eb){_0x5890ed['push'](_0x5890ed['shift']());}};_0x49ef9b(++_0x5eec7c);}(_0xaa9e,0x80));var _0xeaa9=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0xaa9e[_0x1098db];return _0x14f090;};'use strict';var multer=require('multer');var util=require(_0xeaa9('0x0'));var path=require(_0xeaa9('0x1'));var timeout=require(_0xeaa9('0x2'));var express=require(_0xeaa9('0x3'));var router=express[_0xeaa9('0x4')]();var fs_extra=require(_0xeaa9('0x5'));var auth=require(_0xeaa9('0x6'));var interaction=require(_0xeaa9('0x7'));var config=require(_0xeaa9('0x8'));var controller=require(_0xeaa9('0x9'));router['get']('/',auth[_0xeaa9('0xa')](),controller[_0xeaa9('0xb')]);router[_0xeaa9('0xc')](_0xeaa9('0xd'),auth[_0xeaa9('0xa')](),controller[_0xeaa9('0xe')]);router[_0xeaa9('0xc')](_0xeaa9('0xf'),auth[_0xeaa9('0xa')](),controller[_0xeaa9('0x10')]);router[_0xeaa9('0x11')]('/',auth[_0xeaa9('0xa')](),controller['create']);router[_0xeaa9('0x12')](_0xeaa9('0xf'),auth[_0xeaa9('0xa')](),controller['update']);router[_0xeaa9('0x13')](_0xeaa9('0xf'),auth[_0xeaa9('0xa')](),controller[_0xeaa9('0x14')]);module['exports']=router;
\ No newline at end of file
index 72c9dd4..91f44e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3ce2d2,_0x4808d4){_0x3ce2d2=_0x3ce2d2-0x0;var _0x58c6a7=_0xb43b[_0x3ce2d2];return _0x58c6a7;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x475d1b,_0x4d04d1){var _0x49fcfe=function(_0x5baaa4){while(--_0x5baaa4){_0x475d1b['push'](_0x475d1b['shift']());}};_0x49fcfe(++_0x4d04d1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x591a90,_0x5525b0){_0x591a90=_0x591a90-0x0;var _0x551587=_0xcb91[_0x591a90];return _0x551587;};'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
index 1008359..a5848f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc34d=['json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','query','nolimit','order','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range'];(function(_0xd1c7fe,_0x154107){var _0x54895d=function(_0x6d43d5){while(--_0x6d43d5){_0xd1c7fe['push'](_0xd1c7fe['shift']());}};_0x54895d(++_0x154107);}(_0xc34d,0x15a));var _0xdc34=function(_0x2f0135,_0x43ca8e){_0x2f0135=_0x2f0135-0x0;var _0x3e7f8a=_0xc34d[_0x2f0135];return _0x3e7f8a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc34('0x0'));var zipdir=require(_0xdc34('0x1'));var jsonpatch=require(_0xdc34('0x2'));var rp=require(_0xdc34('0x3'));var moment=require(_0xdc34('0x4'));var BPromise=require(_0xdc34('0x5'));var Mustache=require(_0xdc34('0x6'));var util=require(_0xdc34('0x7'));var path=require(_0xdc34('0x8'));var sox=require(_0xdc34('0x9'));var csv=require(_0xdc34('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc34('0xb'));var _=require(_0xdc34('0xc'));var squel=require(_0xdc34('0xd'));var crypto=require('crypto');var jsforce=require(_0xdc34('0xe'));var deskjs=require(_0xdc34('0xf'));var toCsv=require(_0xdc34('0xa'));var querystring=require('querystring');var Papa=require(_0xdc34('0x10'));var Redis=require('ioredis');var authService=require(_0xdc34('0x11'));var qs=require(_0xdc34('0x12'));var as=require(_0xdc34('0x13'));var hardwareService=require(_0xdc34('0x14'));var logger=require(_0xdc34('0x15'))(_0xdc34('0x16'));var utils=require(_0xdc34('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdc34('0x18'));var db=require(_0xdc34('0x19'))['db'];function respondWithStatusCode(_0x15ec15,_0x2f83e4){_0x2f83e4=_0x2f83e4||0xcc;return function(_0x465900){if(_0x465900){return _0x15ec15['sendStatus'](_0x2f83e4);}return _0x15ec15[_0xdc34('0x1a')](_0x2f83e4)[_0xdc34('0x1b')]();};}function respondWithResult(_0x2043c0,_0x4a4d2e){_0x4a4d2e=_0x4a4d2e||0xc8;return function(_0x14d710){if(_0x14d710){return _0x2043c0[_0xdc34('0x1a')](_0x4a4d2e)['json'](_0x14d710);}};}function respondWithFilteredResult(_0x5f3b00,_0x403a3f){return function(_0xe6bdc2){if(_0xe6bdc2){var _0x318574=typeof _0x403a3f[_0xdc34('0x1c')]===_0xdc34('0x1d')&&typeof _0x403a3f['limit']===_0xdc34('0x1d');var _0x5d7584=_0xe6bdc2[_0xdc34('0x1e')];var _0x536502=_0x318574?0x0:_0x403a3f[_0xdc34('0x1c')];var _0x1272a2=_0x318574?_0xe6bdc2[_0xdc34('0x1e')]:_0x403a3f[_0xdc34('0x1c')]+_0x403a3f[_0xdc34('0x1f')];var _0x40b141;if(_0x1272a2>=_0x5d7584){_0x1272a2=_0x5d7584;_0x40b141=0xc8;}else{_0x40b141=0xce;}_0x5f3b00[_0xdc34('0x1a')](_0x40b141);return _0x5f3b00[_0xdc34('0x20')](_0xdc34('0x21'),_0x536502+'-'+_0x1272a2+'/'+_0x5d7584)[_0xdc34('0x22')](_0xe6bdc2);}return null;};}function patchUpdates(_0xdb0a9){return function(_0x16427c){try{jsonpatch[_0xdc34('0x23')](_0x16427c,_0xdb0a9,!![]);}catch(_0x446ff1){return BPromise[_0xdc34('0x24')](_0x446ff1);}return _0x16427c['save']();};}function saveUpdates(_0x166017,_0x29c46e){return function(_0x5b2607){if(_0x5b2607){return _0x5b2607[_0xdc34('0x25')](_0x166017)['then'](function(_0x326ccc){return _0x326ccc;});}return null;};}function removeEntity(_0x18cb6e,_0x3fe4ed){return function(_0x1fd50c){if(_0x1fd50c){return _0x1fd50c['destroy']()[_0xdc34('0x26')](function(){_0x18cb6e[_0xdc34('0x1a')](0xcc)[_0xdc34('0x1b')]();});}};}function handleEntityNotFound(_0x22608a,_0x5d5e9e){return function(_0x218225){if(!_0x218225){_0x22608a[_0xdc34('0x27')](0x194);}return _0x218225;};}function handleError(_0x63f1cf,_0x44042d){_0x44042d=_0x44042d||0x1f4;return function(_0x5b6a09){logger[_0xdc34('0x28')](_0x5b6a09[_0xdc34('0x29')]);if(_0x5b6a09[_0xdc34('0x2a')]){delete _0x5b6a09[_0xdc34('0x2a')];}_0x63f1cf[_0xdc34('0x1a')](_0x44042d)[_0xdc34('0x2b')](_0x5b6a09);};}exports[_0xdc34('0x2c')]=function(_0x4fb662,_0x33bacf){var _0x25d021={},_0x14a7cb={},_0x52e857={'count':0x0,'rows':[]};var _0x27ce71=_[_0xdc34('0x2d')](db[_0xdc34('0x2e')][_0xdc34('0x2f')],function(_0x35cec7){return{'name':_0x35cec7[_0xdc34('0x30')],'type':_0x35cec7[_0xdc34('0x31')][_0xdc34('0x32')]};});_0x14a7cb[_0xdc34('0x33')]=_[_0xdc34('0x2d')](_0x27ce71,'name');_0x14a7cb['query']=_[_0xdc34('0x34')](_0x4fb662['query']);_0x14a7cb[_0xdc34('0x35')]=_[_0xdc34('0x36')](_0x14a7cb[_0xdc34('0x33')],_0x14a7cb['query']);_0x25d021[_0xdc34('0x37')]=_[_0xdc34('0x36')](_0x14a7cb['model'],qs['fields'](_0x4fb662['query'][_0xdc34('0x38')]));_0x25d021[_0xdc34('0x37')]=_0x25d021['attributes'][_0xdc34('0x39')]?_0x25d021['attributes']:_0x14a7cb['model'];if(!_0x4fb662[_0xdc34('0x3a')]['hasOwnProperty'](_0xdc34('0x3b'))){_0x25d021[_0xdc34('0x1f')]=qs[_0xdc34('0x1f')](_0x4fb662[_0xdc34('0x3a')][_0xdc34('0x1f')]);_0x25d021['offset']=qs[_0xdc34('0x1c')](_0x4fb662[_0xdc34('0x3a')][_0xdc34('0x1c')]);}_0x25d021[_0xdc34('0x3c')]=qs[_0xdc34('0x3d')](_0x4fb662[_0xdc34('0x3a')]['sort']);_0x25d021['where']=qs[_0xdc34('0x35')](_['pick'](_0x4fb662['query'],_0x14a7cb['filters']),_0x27ce71);if(_0x4fb662[_0xdc34('0x3a')][_0xdc34('0x3e')]){_0x25d021['where']=_[_0xdc34('0x3f')](_0x25d021[_0xdc34('0x40')],{'$or':_[_0xdc34('0x2d')](_0x27ce71,function(_0x1fa388){if(_0x1fa388[_0xdc34('0x31')]!==_0xdc34('0x41')){var _0x374d3c={};_0x374d3c[_0x1fa388[_0xdc34('0x2a')]]={'$like':'%'+_0x4fb662[_0xdc34('0x3a')][_0xdc34('0x3e')]+'%'};return _0x374d3c;}})});}_0x25d021=_[_0xdc34('0x3f')]({},_0x25d021,_0x4fb662['options']);var _0xbe9215={'where':_0x25d021['where']};return db['ChatTransferReport'][_0xdc34('0x1e')](_0xbe9215)[_0xdc34('0x26')](function(_0xb812c6){_0x52e857[_0xdc34('0x1e')]=_0xb812c6;if(_0x4fb662[_0xdc34('0x3a')][_0xdc34('0x42')]){_0x25d021[_0xdc34('0x43')]=[{'all':!![]}];}return db[_0xdc34('0x2e')][_0xdc34('0x44')](_0x25d021);})[_0xdc34('0x26')](function(_0x21bac2){_0x52e857['rows']=_0x21bac2;return _0x52e857;})[_0xdc34('0x26')](respondWithFilteredResult(_0x33bacf,_0x25d021))['catch'](handleError(_0x33bacf,null));};exports[_0xdc34('0x45')]=function(_0x128909,_0x5cc31b){var _0x3236ea={'raw':!![],'where':{'id':_0x128909[_0xdc34('0x46')]['id']}},_0x409ef0={};_0x409ef0[_0xdc34('0x33')]=_['keys'](db[_0xdc34('0x2e')][_0xdc34('0x2f')]);_0x409ef0[_0xdc34('0x3a')]=_[_0xdc34('0x34')](_0x128909[_0xdc34('0x3a')]);_0x409ef0['filters']=_[_0xdc34('0x36')](_0x409ef0[_0xdc34('0x33')],_0x409ef0['query']);_0x3236ea[_0xdc34('0x37')]=_['intersection'](_0x409ef0[_0xdc34('0x33')],qs['fields'](_0x128909[_0xdc34('0x3a')]['fields']));_0x3236ea[_0xdc34('0x37')]=_0x3236ea['attributes'][_0xdc34('0x39')]?_0x3236ea[_0xdc34('0x37')]:_0x409ef0[_0xdc34('0x33')];if(_0x128909['query'][_0xdc34('0x42')]){_0x3236ea[_0xdc34('0x43')]=[{'all':!![]}];}_0x3236ea=_['merge']({},_0x3236ea,_0x128909[_0xdc34('0x47')]);return db[_0xdc34('0x2e')][_0xdc34('0x48')](_0x3236ea)[_0xdc34('0x26')](handleEntityNotFound(_0x5cc31b,null))[_0xdc34('0x26')](respondWithResult(_0x5cc31b,null))[_0xdc34('0x49')](handleError(_0x5cc31b,null));};exports['create']=function(_0x2481dc,_0x5a51c6){return db[_0xdc34('0x2e')]['create'](_0x2481dc[_0xdc34('0x4a')],{})['then'](respondWithResult(_0x5a51c6,0xc9))[_0xdc34('0x49')](handleError(_0x5a51c6,null));};exports[_0xdc34('0x25')]=function(_0x3313d4,_0x58d022){if(_0x3313d4['body']['id']){delete _0x3313d4['body']['id'];}return db[_0xdc34('0x2e')][_0xdc34('0x48')]({'where':{'id':_0x3313d4[_0xdc34('0x46')]['id']}})['then'](handleEntityNotFound(_0x58d022,null))['then'](saveUpdates(_0x3313d4[_0xdc34('0x4a')],null))[_0xdc34('0x26')](respondWithResult(_0x58d022,null))[_0xdc34('0x49')](handleError(_0x58d022,null));};exports['destroy']=function(_0x3111b6,_0x2f893f){return db['ChatTransferReport']['find']({'where':{'id':_0x3111b6['params']['id']}})[_0xdc34('0x26')](handleEntityNotFound(_0x2f893f,null))[_0xdc34('0x26')](removeEntity(_0x2f893f,null))[_0xdc34('0x49')](handleError(_0x2f893f,null));};exports[_0xdc34('0x4b')]=function(_0x4751d0,_0x9d3346){return db[_0xdc34('0x2e')][_0xdc34('0x4b')]()[_0xdc34('0x26')](respondWithResult(_0x9d3346,null))['catch'](handleError(_0x9d3346,null));};
\ No newline at end of file
+var _0x6dbe=['crypto','jsforce','querystring','papaparse','../../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','Content-Range','apply','reject','update','destroy','error','stack','send','index','ChatTransferReport','fieldName','type','key','model','map','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','then','includeAll','include','findAll','params','create','catch','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6dbe,0x1b0));var _0xe6db=function(_0xad6616,_0x534dfe){_0xad6616=_0xad6616-0x0;var _0x36dce3=_0x6dbe[_0xad6616];return _0x36dce3;};'use strict';var emlformat=require(_0xe6db('0x0'));var rimraf=require(_0xe6db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6db('0x2'));var rp=require(_0xe6db('0x3'));var moment=require(_0xe6db('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe6db('0x5'));var sox=require(_0xe6db('0x6'));var csv=require(_0xe6db('0x7'));var ejs=require(_0xe6db('0x8'));var fs=require('fs');var fs_extra=require(_0xe6db('0x9'));var _=require(_0xe6db('0xa'));var squel=require(_0xe6db('0xb'));var crypto=require(_0xe6db('0xc'));var jsforce=require(_0xe6db('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe6db('0x7'));var querystring=require(_0xe6db('0xe'));var Papa=require(_0xe6db('0xf'));var Redis=require('ioredis');var authService=require(_0xe6db('0x10'));var qs=require(_0xe6db('0x11'));var as=require(_0xe6db('0x12'));var hardwareService=require(_0xe6db('0x13'));var logger=require(_0xe6db('0x14'))(_0xe6db('0x15'));var utils=require(_0xe6db('0x16'));var config=require(_0xe6db('0x17'));var licenseUtil=require(_0xe6db('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x284e8d,_0x5d2152){_0x5d2152=_0x5d2152||0xcc;return function(_0x492031){if(_0x492031){return _0x284e8d[_0xe6db('0x19')](_0x5d2152);}return _0x284e8d[_0xe6db('0x1a')](_0x5d2152)[_0xe6db('0x1b')]();};}function respondWithResult(_0x324c0b,_0x57cbff){_0x57cbff=_0x57cbff||0xc8;return function(_0xc983b3){if(_0xc983b3){return _0x324c0b[_0xe6db('0x1a')](_0x57cbff)[_0xe6db('0x1c')](_0xc983b3);}};}function respondWithFilteredResult(_0x1b8b85,_0x8e7909){return function(_0x4bb0fc){if(_0x4bb0fc){var _0x4a1c6d=typeof _0x8e7909[_0xe6db('0x1d')]===_0xe6db('0x1e')&&typeof _0x8e7909[_0xe6db('0x1f')]===_0xe6db('0x1e');var _0x2c254f=_0x4bb0fc[_0xe6db('0x20')];var _0x21c9dc=_0x4a1c6d?0x0:_0x8e7909[_0xe6db('0x1d')];var _0x1a8833=_0x4a1c6d?_0x4bb0fc['count']:_0x8e7909[_0xe6db('0x1d')]+_0x8e7909[_0xe6db('0x1f')];var _0x498e8c;if(_0x1a8833>=_0x2c254f){_0x1a8833=_0x2c254f;_0x498e8c=0xc8;}else{_0x498e8c=0xce;}_0x1b8b85['status'](_0x498e8c);return _0x1b8b85['set'](_0xe6db('0x21'),_0x21c9dc+'-'+_0x1a8833+'/'+_0x2c254f)['json'](_0x4bb0fc);}return null;};}function patchUpdates(_0x1b2f3c){return function(_0x3034ec){try{jsonpatch[_0xe6db('0x22')](_0x3034ec,_0x1b2f3c,!![]);}catch(_0x568689){return BPromise[_0xe6db('0x23')](_0x568689);}return _0x3034ec['save']();};}function saveUpdates(_0x2f1eef,_0x205f96){return function(_0x132cbb){if(_0x132cbb){return _0x132cbb[_0xe6db('0x24')](_0x2f1eef)['then'](function(_0x4be3b1){return _0x4be3b1;});}return null;};}function removeEntity(_0x256721,_0x14326d){return function(_0x588125){if(_0x588125){return _0x588125[_0xe6db('0x25')]()['then'](function(){_0x256721[_0xe6db('0x1a')](0xcc)[_0xe6db('0x1b')]();});}};}function handleEntityNotFound(_0x145ab8,_0xa40733){return function(_0x244ff1){if(!_0x244ff1){_0x145ab8['sendStatus'](0x194);}return _0x244ff1;};}function handleError(_0xaf1ae9,_0x54dfa7){_0x54dfa7=_0x54dfa7||0x1f4;return function(_0x431c13){logger[_0xe6db('0x26')](_0x431c13[_0xe6db('0x27')]);if(_0x431c13['name']){delete _0x431c13['name'];}_0xaf1ae9[_0xe6db('0x1a')](_0x54dfa7)[_0xe6db('0x28')](_0x431c13);};}exports[_0xe6db('0x29')]=function(_0xcc5570,_0x6dbb11){var _0xf3e1bc={},_0x22340a={},_0x5b49d7={'count':0x0,'rows':[]};var _0x59678c=_['map'](db[_0xe6db('0x2a')]['rawAttributes'],function(_0x573098){return{'name':_0x573098[_0xe6db('0x2b')],'type':_0x573098[_0xe6db('0x2c')][_0xe6db('0x2d')]};});_0x22340a[_0xe6db('0x2e')]=_[_0xe6db('0x2f')](_0x59678c,_0xe6db('0x30'));_0x22340a[_0xe6db('0x31')]=_[_0xe6db('0x32')](_0xcc5570[_0xe6db('0x31')]);_0x22340a['filters']=_['intersection'](_0x22340a[_0xe6db('0x2e')],_0x22340a['query']);_0xf3e1bc[_0xe6db('0x33')]=_[_0xe6db('0x34')](_0x22340a[_0xe6db('0x2e')],qs[_0xe6db('0x35')](_0xcc5570[_0xe6db('0x31')]['fields']));_0xf3e1bc['attributes']=_0xf3e1bc[_0xe6db('0x33')][_0xe6db('0x36')]?_0xf3e1bc[_0xe6db('0x33')]:_0x22340a[_0xe6db('0x2e')];if(!_0xcc5570[_0xe6db('0x31')][_0xe6db('0x37')](_0xe6db('0x38'))){_0xf3e1bc[_0xe6db('0x1f')]=qs[_0xe6db('0x1f')](_0xcc5570['query']['limit']);_0xf3e1bc[_0xe6db('0x1d')]=qs[_0xe6db('0x1d')](_0xcc5570[_0xe6db('0x31')][_0xe6db('0x1d')]);}_0xf3e1bc[_0xe6db('0x39')]=qs[_0xe6db('0x3a')](_0xcc5570['query']['sort']);_0xf3e1bc[_0xe6db('0x3b')]=qs[_0xe6db('0x3c')](_['pick'](_0xcc5570[_0xe6db('0x31')],_0x22340a[_0xe6db('0x3c')]),_0x59678c);if(_0xcc5570[_0xe6db('0x31')]['filter']){_0xf3e1bc[_0xe6db('0x3b')]=_[_0xe6db('0x3d')](_0xf3e1bc[_0xe6db('0x3b')],{'$or':_['map'](_0x59678c,function(_0x2fbf62){if(_0x2fbf62['type']!=='VIRTUAL'){var _0x2a5960={};_0x2a5960[_0x2fbf62['name']]={'$like':'%'+_0xcc5570['query'][_0xe6db('0x3e')]+'%'};return _0x2a5960;}})});}_0xf3e1bc=_['merge']({},_0xf3e1bc,_0xcc5570[_0xe6db('0x3f')]);var _0xc73051={'where':_0xf3e1bc[_0xe6db('0x3b')]};return db[_0xe6db('0x2a')]['count'](_0xc73051)[_0xe6db('0x40')](function(_0xd94970){_0x5b49d7['count']=_0xd94970;if(_0xcc5570['query'][_0xe6db('0x41')]){_0xf3e1bc[_0xe6db('0x42')]=[{'all':!![]}];}return db[_0xe6db('0x2a')][_0xe6db('0x43')](_0xf3e1bc);})[_0xe6db('0x40')](function(_0x30dc6c){_0x5b49d7['rows']=_0x30dc6c;return _0x5b49d7;})[_0xe6db('0x40')](respondWithFilteredResult(_0x6dbb11,_0xf3e1bc))['catch'](handleError(_0x6dbb11,null));};exports['show']=function(_0x163025,_0x313f49){var _0x246a3f={'raw':!![],'where':{'id':_0x163025[_0xe6db('0x44')]['id']}},_0x391db4={};_0x391db4[_0xe6db('0x2e')]=_['keys'](db['ChatTransferReport']['rawAttributes']);_0x391db4['query']=_[_0xe6db('0x32')](_0x163025['query']);_0x391db4[_0xe6db('0x3c')]=_[_0xe6db('0x34')](_0x391db4[_0xe6db('0x2e')],_0x391db4['query']);_0x246a3f[_0xe6db('0x33')]=_[_0xe6db('0x34')](_0x391db4[_0xe6db('0x2e')],qs[_0xe6db('0x35')](_0x163025[_0xe6db('0x31')][_0xe6db('0x35')]));_0x246a3f[_0xe6db('0x33')]=_0x246a3f[_0xe6db('0x33')]['length']?_0x246a3f[_0xe6db('0x33')]:_0x391db4[_0xe6db('0x2e')];if(_0x163025[_0xe6db('0x31')][_0xe6db('0x41')]){_0x246a3f[_0xe6db('0x42')]=[{'all':!![]}];}_0x246a3f=_[_0xe6db('0x3d')]({},_0x246a3f,_0x163025[_0xe6db('0x3f')]);return db[_0xe6db('0x2a')]['find'](_0x246a3f)[_0xe6db('0x40')](handleEntityNotFound(_0x313f49,null))[_0xe6db('0x40')](respondWithResult(_0x313f49,null))['catch'](handleError(_0x313f49,null));};exports[_0xe6db('0x45')]=function(_0x556084,_0x339ccf){return db[_0xe6db('0x2a')][_0xe6db('0x45')](_0x556084['body'],{})[_0xe6db('0x40')](respondWithResult(_0x339ccf,0xc9))[_0xe6db('0x46')](handleError(_0x339ccf,null));};exports[_0xe6db('0x24')]=function(_0x4e48fd,_0x5a24d5){if(_0x4e48fd[_0xe6db('0x47')]['id']){delete _0x4e48fd[_0xe6db('0x47')]['id'];}return db['ChatTransferReport'][_0xe6db('0x48')]({'where':{'id':_0x4e48fd[_0xe6db('0x44')]['id']}})[_0xe6db('0x40')](handleEntityNotFound(_0x5a24d5,null))['then'](saveUpdates(_0x4e48fd['body'],null))[_0xe6db('0x40')](respondWithResult(_0x5a24d5,null))[_0xe6db('0x46')](handleError(_0x5a24d5,null));};exports[_0xe6db('0x25')]=function(_0x3dfbf4,_0x4ca96c){return db[_0xe6db('0x2a')][_0xe6db('0x48')]({'where':{'id':_0x3dfbf4['params']['id']}})[_0xe6db('0x40')](handleEntityNotFound(_0x4ca96c,null))[_0xe6db('0x40')](removeEntity(_0x4ca96c,null))[_0xe6db('0x46')](handleError(_0x4ca96c,null));};exports[_0xe6db('0x49')]=function(_0x292f4d,_0x1207e5){return db[_0xe6db('0x2a')][_0xe6db('0x49')]()['then'](respondWithResult(_0x1207e5,null))[_0xe6db('0x46')](handleError(_0x1207e5,null));};
\ No newline at end of file
index 06f0e5d..4437775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x894c=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x366d6f,_0x1db5c2){var _0x2acd9b=function(_0x29dd15){while(--_0x29dd15){_0x366d6f['push'](_0x366d6f['shift']());}};_0x2acd9b(++_0x1db5c2);}(_0x894c,0xc0));var _0xc894=function(_0x4c5b63,_0x533bc5){_0x4c5b63=_0x4c5b63-0x0;var _0x1e459b=_0x894c[_0x4c5b63];return _0x1e459b;};'use strict';var _=require(_0xc894('0x0'));var util=require(_0xc894('0x1'));var logger=require('../../config/logger')(_0xc894('0x2'));var moment=require(_0xc894('0x3'));var BPromise=require(_0xc894('0x4'));var rp=require(_0xc894('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc894('0x6'));var config=require(_0xc894('0x7'));var attributes=require(_0xc894('0x8'));module['exports']=function(_0x3ce870,_0x1cd033){return _0x3ce870['define'](_0xc894('0x9'),attributes,{'tableName':_0xc894('0xa'),'paranoid':![],'indexes':[{'name':_0xc894('0xb'),'fields':[_0xc894('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9d2=['./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','../../config/logger','api','moment','request-promise'];(function(_0x22bd31,_0x2a1a7b){var _0x2079f6=function(_0x19150a){while(--_0x19150a){_0x22bd31['push'](_0x22bd31['shift']());}};_0x2079f6(++_0x2a1a7b);}(_0xa9d2,0xac));var _0x2a9d=function(_0x5d3d06,_0x16c9f9){_0x5d3d06=_0x5d3d06-0x0;var _0xabbe2b=_0xa9d2[_0x5d3d06];return _0xabbe2b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2a9d('0x0'))(_0x2a9d('0x1'));var moment=require(_0x2a9d('0x2'));var BPromise=require('bluebird');var rp=require(_0x2a9d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2a9d('0x4'));module[_0x2a9d('0x5')]=function(_0x12fe85,_0xe03c34){return _0x12fe85['define']('ChatTransferReport',attributes,{'tableName':_0x2a9d('0x6'),'paranoid':![],'indexes':[{'name':_0x2a9d('0x7'),'fields':[_0x2a9d('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
index 047baa1..25798c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a39=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x5cc8ce,_0x23c838){var _0x4e3f49=function(_0x5799f6){while(--_0x5799f6){_0x5cc8ce['push'](_0x5cc8ce['shift']());}};_0x4e3f49(++_0x23c838);}(_0x0a39,0x15c));var _0x90a3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0a39[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x90a3('0x0'));var util=require(_0x90a3('0x1'));var moment=require(_0x90a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90a3('0x3'))['db'];var utils=require(_0x90a3('0x4'));var logger=require(_0x90a3('0x5'))(_0x90a3('0x6'));var config=require(_0x90a3('0x7'));var jayson=require(_0x90a3('0x8'));var client=jayson['client'][_0x90a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x597e3e,_0x3f1884,_0x19abf1){return new BPromise(function(_0x296038,_0x620a20){return client[_0x90a3('0xa')](_0x597e3e,_0x19abf1)[_0x90a3('0xb')](function(_0x18b6ec){logger[_0x90a3('0xc')](_0x90a3('0xd'),_0x3f1884,'request\x20sent');logger['debug'](_0x90a3('0xe'),_0x3f1884,_0x90a3('0xf'),JSON[_0x90a3('0x10')](_0x18b6ec));if(_0x18b6ec[_0x90a3('0x11')]){if(_0x18b6ec[_0x90a3('0x11')][_0x90a3('0x12')]===0x1f4){logger[_0x90a3('0x11')](_0x90a3('0xd'),_0x3f1884,_0x18b6ec[_0x90a3('0x11')][_0x90a3('0x13')]);return _0x620a20(_0x18b6ec[_0x90a3('0x11')][_0x90a3('0x13')]);}logger[_0x90a3('0x11')](_0x90a3('0xd'),_0x3f1884,_0x18b6ec[_0x90a3('0x11')][_0x90a3('0x13')]);return _0x296038(_0x18b6ec[_0x90a3('0x11')][_0x90a3('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x3f1884,'request\x20sent');_0x296038(_0x18b6ec[_0x90a3('0x14')][_0x90a3('0x13')]);}})[_0x90a3('0x15')](function(_0x5943c2){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3f1884,_0x5943c2);_0x620a20(_0x5943c2);});});}
\ No newline at end of file
+var _0xaf24=['../../config/environment','jayson/promise','client','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','moment','bluebird','ioredis','rpc'];(function(_0x153e25,_0x11aa00){var _0x229586=function(_0x5a2af6){while(--_0x5a2af6){_0x153e25['push'](_0x153e25['shift']());}};_0x229586(++_0x11aa00);}(_0xaf24,0x1ac));var _0x4af2=function(_0x49e762,_0x4593f3){_0x49e762=_0x49e762-0x0;var _0x2bbfaa=_0xaf24[_0x49e762];return _0x2bbfaa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4af2('0x0'));var BPromise=require(_0x4af2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4af2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4af2('0x3'));var config=require(_0x4af2('0x4'));var jayson=require(_0x4af2('0x5'));var client=jayson[_0x4af2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb429dc,_0x4a37d0,_0x5dddb6){return new BPromise(function(_0x52d023,_0x10d9b9){return client['request'](_0xb429dc,_0x5dddb6)['then'](function(_0x2fefdc){logger['info'](_0x4af2('0x7'),_0x4a37d0,'request\x20sent');logger[_0x4af2('0x8')](_0x4af2('0x9'),_0x4a37d0,'request\x20sent',JSON[_0x4af2('0xa')](_0x2fefdc));if(_0x2fefdc[_0x4af2('0xb')]){if(_0x2fefdc[_0x4af2('0xb')][_0x4af2('0xc')]===0x1f4){logger[_0x4af2('0xb')](_0x4af2('0x7'),_0x4a37d0,_0x2fefdc[_0x4af2('0xb')][_0x4af2('0xd')]);return _0x10d9b9(_0x2fefdc['error'][_0x4af2('0xd')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4a37d0,_0x2fefdc[_0x4af2('0xb')][_0x4af2('0xd')]);return _0x52d023(_0x2fefdc['error'][_0x4af2('0xd')]);}else{logger[_0x4af2('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x4a37d0,_0x4af2('0xf'));_0x52d023(_0x2fefdc[_0x4af2('0x10')][_0x4af2('0xd')]);}})[_0x4af2('0x11')](function(_0x359389){logger[_0x4af2('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x4a37d0,_0x359389);_0x10d9b9(_0x359389);});});}
\ No newline at end of file
index aa15ef4..c398c1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac1a=['get','isAuthenticated','index','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller'];(function(_0x52305c,_0x423d72){var _0x240f99=function(_0x2e9509){while(--_0x2e9509){_0x52305c['push'](_0x52305c['shift']());}};_0x240f99(++_0x423d72);}(_0xac1a,0xe7));var _0xaac1=function(_0x1b8a4b,_0x51521e){_0x1b8a4b=_0x1b8a4b-0x0;var _0x3064d5=_0xac1a[_0x1b8a4b];return _0x3064d5;};'use strict';var multer=require(_0xaac1('0x0'));var util=require(_0xaac1('0x1'));var path=require(_0xaac1('0x2'));var timeout=require(_0xaac1('0x3'));var express=require(_0xaac1('0x4'));var router=express[_0xaac1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaac1('0x6'));var interaction=require(_0xaac1('0x7'));var config=require('../../config/environment');var controller=require(_0xaac1('0x8'));router[_0xaac1('0x9')]('/',auth[_0xaac1('0xa')](),controller[_0xaac1('0xb')]);router[_0xaac1('0x9')](_0xaac1('0xc'),auth[_0xaac1('0xa')](),controller['describe']);router[_0xaac1('0x9')](_0xaac1('0xd'),auth['isAuthenticated'](),controller[_0xaac1('0xe')]);router['post']('/',auth[_0xaac1('0xa')](),controller[_0xaac1('0xf')]);router[_0xaac1('0x10')](_0xaac1('0xd'),auth[_0xaac1('0xa')](),controller[_0xaac1('0x11')]);router['delete'](_0xaac1('0xd'),auth[_0xaac1('0xa')](),controller[_0xaac1('0x12')]);module[_0xaac1('0x13')]=router;
\ No newline at end of file
+var _0x6773=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x3b3017,_0x531959){var _0xd8fd8d=function(_0x537d8f){while(--_0x537d8f){_0x3b3017['push'](_0x3b3017['shift']());}};_0xd8fd8d(++_0x531959);}(_0x6773,0x123));var _0x3677=function(_0x4a5438,_0x19aa59){_0x4a5438=_0x4a5438-0x0;var _0x35a70d=_0x6773[_0x4a5438];return _0x35a70d;};'use strict';var multer=require('multer');var util=require(_0x3677('0x0'));var path=require(_0x3677('0x1'));var timeout=require(_0x3677('0x2'));var express=require(_0x3677('0x3'));var router=express[_0x3677('0x4')]();var fs_extra=require(_0x3677('0x5'));var auth=require(_0x3677('0x6'));var interaction=require(_0x3677('0x7'));var config=require(_0x3677('0x8'));var controller=require(_0x3677('0x9'));router['get']('/',auth[_0x3677('0xa')](),controller[_0x3677('0xb')]);router[_0x3677('0xc')](_0x3677('0xd'),auth[_0x3677('0xa')](),controller[_0x3677('0xe')]);router['get'](_0x3677('0xf'),auth['isAuthenticated'](),controller[_0x3677('0x10')]);router['post']('/',auth[_0x3677('0xa')](),controller[_0x3677('0x11')]);router[_0x3677('0x12')]('/:id',auth[_0x3677('0xa')](),controller['update']);router[_0x3677('0x13')](_0x3677('0xf'),auth[_0x3677('0xa')](),controller[_0x3677('0x14')]);module[_0x3677('0x15')]=router;
\ No newline at end of file
index 0e4edac..649740e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fbf=['exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','TEXT','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.','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}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x8fbf,0xbb));var _0xf8fb=function(_0x9c04a1,_0x489790){_0x9c04a1=_0x9c04a1-0x0;var _0x11f6a6=_0x8fbf[_0x9c04a1];return _0x11f6a6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf8fb('0x0'));module[_0xf8fb('0x1')]={'name':{'type':Sequelize[_0xf8fb('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf8fb('0x2')],'allowNull':![],'unique':_0xf8fb('0x3')},'description':{'type':Sequelize[_0xf8fb('0x2')]},'mapKey':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x5')},'customerAlias':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf8fb('0x2')],'allowNull':![],'defaultValue':_0xf8fb('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf8fb('0x2')],'allowNull':![],'defaultValue':_0xf8fb('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf8fb('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf8fb('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf8fb('0x2')]},'animation':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf8fb('0xa')](_0xf8fb('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0xc')},'offline_chat_button':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xf8fb('0xe')},'download_transcript':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf8fb('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x10')},'noteTitle':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf8fb('0x11')},'closingMessage':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x12')},'closingMessageButton':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf8fb('0x13')},'conditionAgreement':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x14')},'ratingType':{'type':Sequelize[_0xf8fb('0xa')](_0xf8fb('0x15'),'thumb'),'defaultValue':_0xf8fb('0x15')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf8fb('0x16')],'defaultValue':function(){return JSON[_0xf8fb('0x17')]({'items':[{'type':_0xf8fb('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xf8fb('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xf8fb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8fb('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf8fb('0x1a')](_0xf8fb('0x1b'))?JSON[_0xf8fb('0x1c')](this[_0xf8fb('0x1a')]('onlineForm')):{};},'set':function(_0x367295){return this[_0xf8fb('0x1d')](_0xf8fb('0x1b'),JSON['stringify'](_0x367295));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf8fb('0x17')]({'items':[{'type':_0xf8fb('0x18'),'props':{'title':_0xf8fb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8fb('0x4'),'type':_0xf8fb('0x4')},'variable':null},{'type':_0xf8fb('0x1e'),'config':{'placeholder':_0xf8fb('0x1f')},'props':{'title':_0xf8fb('0x1f'),'helpText':_0xf8fb('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf8fb('0x21'))?JSON[_0xf8fb('0x1c')](this[_0xf8fb('0x1a')]('offlineForm')):{};},'set':function(_0x30b3db){return this['setDataValue'](_0xf8fb('0x21'),JSON['stringify'](_0x30b3db));}},'token':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf8fb('0x2')]},'forwardOffline':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf8fb('0x2')]},'waitingTitle':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x22')},'waitingMessage':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xf8fb('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf8fb('0x25')},'skipUnmanaged':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x13')},'sendUnmanaged':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf8fb('0x16')]},'showAgentAvatar':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf8fb('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf8fb('0x16')],'defaultValue':function(){return _0xf8fb('0x26');}},'notificationSound':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf8fb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x28')},'verticalAlignment':{'type':Sequelize[_0xf8fb('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x29')},'defaultTitle':{'type':Sequelize[_0xf8fb('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf8fb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf8fb('0x2')],'defaultValue':_0xf8fb('0x2a')},'systemAvatar':{'type':Sequelize[_0xf8fb('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf8fb('0x8')],'comment':_0xf8fb('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x40b00a){if(!_0x40b00a)this[_0xf8fb('0x1d')](_0xf8fb('0x2c'),null);this['setDataValue'](_0xf8fb('0x2d'),_0x40b00a);}},'vidaooEscalation':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf8fb('0x2')]},'vidaooTopic':{'type':Sequelize[_0xf8fb('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xf8fb('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf8fb('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf8fb('0x16')]}};
\ No newline at end of file
+var _0x1a92=['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.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Skip','Feedback','TEXT','stringify','input','text','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x1a92,0xd6));var _0x21a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a92[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x21a9('0x0'));var rs=require(_0x21a9('0x1'));module['exports']={'name':{'type':Sequelize[_0x21a9('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x21a9('0x3')},'description':{'type':Sequelize[_0x21a9('0x2')]},'mapKey':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x21a9('0x4')},'key':{'type':Sequelize[_0x21a9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x21a9('0x5')},'customerAlias':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x21a9('0x2')],'allowNull':![],'defaultValue':_0x21a9('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x21a9('0x2')],'allowNull':![],'defaultValue':_0x21a9('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x21a9('0x2')],'allowNull':![],'defaultValue':_0x21a9('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x21a9('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x21a9('0x2')]},'animation':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x21a9('0xa')](_0x21a9('0xb'),_0x21a9('0xc')),'defaultValue':_0x21a9('0xb')},'header_online':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0xd')},'start_chat_button':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0xe')},'download_transcript':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x21a9('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x11')},'placeholderMessage':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x12')},'closingMessage':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x13')},'conditionAgreement':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x14')},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x21a9('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x21a9('0x15')],'defaultValue':function(){return JSON[_0x21a9('0x16')]({'items':[{'type':_0x21a9('0x17'),'variable':null,'config':{'placeholder':'name','type':_0x21a9('0x18'),'required':!![]},'props':{'title':_0x21a9('0x19'),'helpText':''}},{'type':_0x21a9('0x17'),'props':{'title':_0x21a9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x21a9('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x21a9('0x1a')](_0x21a9('0x1b'))?JSON['parse'](this[_0x21a9('0x1a')]('onlineForm')):{};},'set':function(_0x3972e8){return this[_0x21a9('0x1c')]('onlineForm',JSON[_0x21a9('0x16')](_0x3972e8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x21a9('0x17'),'props':{'title':_0x21a9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x21a9('0x4'),'type':_0x21a9('0x4')},'variable':null},{'type':_0x21a9('0x1d'),'config':{'placeholder':_0x21a9('0x1e')},'props':{'title':'Comments','helpText':_0x21a9('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x21a9('0x20')](this[_0x21a9('0x1a')](_0x21a9('0x21'))):{};},'set':function(_0x51f65){return this[_0x21a9('0x1c')](_0x21a9('0x21'),JSON[_0x21a9('0x16')](_0x51f65));}},'token':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':function(){return rs[_0x21a9('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x21a9('0x2')]},'forwardOffline':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x21a9('0x23')},'waitingMessage':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x21a9('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x27')},'skipUnmanaged':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x13')},'sendUnmanaged':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x21a9('0x15')]},'showAgentAvatar':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x21a9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x21a9('0x15')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x21a9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x29')},'verticalAlignment':{'type':Sequelize[_0x21a9('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x2a')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x21a9('0x2b')},'defaultTitle':{'type':Sequelize[_0x21a9('0x2')]},'customerAvatar':{'type':Sequelize[_0x21a9('0x15')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x21a9('0x2')],'allowNull':![],'defaultValue':_0x21a9('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x21a9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x21a9('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x21a9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':_0x21a9('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x21a9('0x8')],'comment':_0x21a9('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x21a9('0x2f'),'set':function(_0x179d60){if(!_0x179d60)this[_0x21a9('0x1c')](_0x21a9('0x30'),null);this[_0x21a9('0x1c')](_0x21a9('0x31'),_0x179d60);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x21a9('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x21a9('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x21a9('0x15')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x21a9('0x15')]}};
\ No newline at end of file
index 501a1e5..91c0990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccdc=['list','account','Applications','Contacts','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','version','format','%s\x20%s','browser','unknown','device','vendor','type','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','fromString','originalname','server','attachments','offline-chat','basename','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','secure','auth','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','toPairsIn','mapValues','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','getInteractions','Contact','User','Owner','fullname','internal','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getLicense','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','emit','getAgents','bluebird','mustache','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','info','result','sendStatus','status','json','undefined','limit','count','offset','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','name','send','Pause','map','rawAttributes','fieldName','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','show','mandatoryDispositionPause','keys','merge','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','getLogo','join','root','../../config/license/util','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','systemAvatar','notify','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','ChatApplication','applications'];(function(_0x55f160,_0x722f1f){var _0x1ddce6=function(_0x28552a){while(--_0x28552a){_0x55f160['push'](_0x55f160['shift']());}};_0x1ddce6(++_0x722f1f);}(_0xccdc,0x1c4));var _0xcccd=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xccdc[_0x24061a];return _0x82054e;};'use strict';var BPromise=require(_0xcccd('0x0'));var Mustache=require(_0xcccd('0x1'));var util=require('util');var path=require('path');var ejs=require(_0xcccd('0x2'));var fs=require('fs');var fs_extra=require(_0xcccd('0x3'));var _=require(_0xcccd('0x4'));var querystring=require(_0xcccd('0x5'));var Redis=require(_0xcccd('0x6'));var qs=require(_0xcccd('0x7'));var logger=require(_0xcccd('0x8'))(_0xcccd('0x9'));var config=require(_0xcccd('0xa'));var db=require(_0xcccd('0xb'))['db'];config['redis']=_[_0xcccd('0xc')](config[_0xcccd('0xd')],{'host':_0xcccd('0xe'),'port':0x18eb});var socket=require(_0xcccd('0xf'))(new Redis(config[_0xcccd('0xd')]));require(_0xcccd('0x10'))[_0xcccd('0x11')](socket);var htmlToText=require(_0xcccd('0x12'));var jayson=require('jayson/promise');var client=jayson[_0xcccd('0x13')][_0xcccd('0x14')]({'port':0x232c});var client9002=jayson[_0xcccd('0x13')][_0xcccd('0x14')]({'port':0x232a});var client9003=jayson[_0xcccd('0x13')][_0xcccd('0x14')]({'port':0x232b});var client9001=jayson[_0xcccd('0x13')][_0xcccd('0x14')]({'port':0x2329});function respondWithRpcPromise(_0xab2b48,_0x120475,_0x3e7e04,_0x367d61){return new BPromise(function(_0x2838c0,_0x321205){var _0xf922c5=_0x367d61||client;return _0xf922c5[_0xcccd('0x15')](_0xab2b48,_0x3e7e04)[_0xcccd('0x16')](function(_0x2b172f){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x120475,_0xcccd('0x17'));logger[_0xcccd('0x18')](_0xcccd('0x19'),_0x120475,'request\x20sent',JSON[_0xcccd('0x1a')](_0x2b172f));if(_0x2b172f[_0xcccd('0x1b')]){if(_0x2b172f[_0xcccd('0x1b')]['code']===0x1f4){logger[_0xcccd('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x120475,_0x2b172f['error'][_0xcccd('0x1c')]);return _0x321205(_0x2b172f[_0xcccd('0x1b')][_0xcccd('0x1c')]);}logger[_0xcccd('0x1b')](_0xcccd('0x1d'),_0x120475,_0x2b172f[_0xcccd('0x1b')][_0xcccd('0x1c')]);return _0x2838c0(_0x2b172f[_0xcccd('0x1b')][_0xcccd('0x1c')]);}else{logger[_0xcccd('0x1e')](_0xcccd('0x1d'),_0x120475,_0xcccd('0x17'));_0x2838c0(_0x2b172f[_0xcccd('0x1f')][_0xcccd('0x1c')]);}})['catch'](function(_0x4f0902){logger['error'](_0xcccd('0x1d'),_0x120475,_0x4f0902);_0x321205(_0x4f0902);});});}function respondWithStatusCode(_0x3f71cc,_0x2303db){_0x2303db=_0x2303db||0xcc;return function(_0x8e8e29){if(_0x8e8e29){return _0x3f71cc[_0xcccd('0x20')](_0x2303db);}return _0x3f71cc[_0xcccd('0x21')](_0x2303db)['end']();};}function respondWithResult(_0x37bf95,_0x378c88){_0x378c88=_0x378c88||0xc8;return function(_0x55cff5){if(_0x55cff5){return _0x37bf95['status'](_0x378c88)[_0xcccd('0x22')](_0x55cff5);}};}function respondWithFilteredResult(_0x45fc3d,_0x21932e){return function(_0x79a0dc){if(_0x79a0dc){var _0x2dbdc3=typeof _0x21932e['offset']===_0xcccd('0x23')&&typeof _0x21932e[_0xcccd('0x24')]===_0xcccd('0x23');var _0x4de957=_0x79a0dc[_0xcccd('0x25')];var _0x599ba4=_0x2dbdc3?0x0:_0x21932e[_0xcccd('0x26')];var _0x536d7b=_0x2dbdc3?_0x79a0dc[_0xcccd('0x25')]:_0x21932e[_0xcccd('0x26')]+_0x21932e[_0xcccd('0x24')];var _0x4d7981;if(_0x536d7b>=_0x4de957){_0x536d7b=_0x4de957;_0x4d7981=0xc8;}else{_0x4d7981=0xce;}_0x45fc3d[_0xcccd('0x21')](_0x4d7981);return _0x45fc3d['set'](_0xcccd('0x27'),_0x599ba4+'-'+_0x536d7b+'/'+_0x4de957)['json'](_0x79a0dc);}return null;};}function saveUpdates(_0x5a92a3){return function(_0x21dc67){if(_0x21dc67){return _0x21dc67[_0xcccd('0x28')](_0x5a92a3)['then'](function(_0x2bdc3e){return _0x2bdc3e;});}return null;};}function removeEntity(_0x505670){return function(_0x36a8ef){if(_0x36a8ef){return _0x36a8ef[_0xcccd('0x29')]()[_0xcccd('0x16')](function(){var _0x39730f=_0x36a8ef[_0xcccd('0x2a')]({'plain':!![]});var _0x296b23=_0xcccd('0x2b');return db[_0xcccd('0x2c')][_0xcccd('0x29')]({'where':{'type':_0x296b23,'resourceId':_0x39730f['id']}})[_0xcccd('0x16')](function(){return _0x36a8ef;});})[_0xcccd('0x16')](function(){_0x505670['status'](0xcc)[_0xcccd('0x2d')]();});}};}function handleEntityNotFound(_0x6515c4){return function(_0x5d8891){if(!_0x5d8891){_0x6515c4[_0xcccd('0x20')](0x194);}return _0x5d8891;};}function handleError(_0x374e34,_0xcd00d2){_0xcd00d2=_0xcd00d2||0x1f4;return function(_0xefbc7c){logger[_0xcccd('0x1b')](_0xefbc7c['stack']);if(_0xefbc7c[_0xcccd('0x2e')]){delete _0xefbc7c[_0xcccd('0x2e')];}_0x374e34[_0xcccd('0x21')](_0xcd00d2)[_0xcccd('0x2f')](_0xefbc7c);};}exports['index']=function(_0x5e9585,_0x2b736f){var _0x338464={'include':[{'model':db[_0xcccd('0x30')],'as':'mandatoryDispositionPause'}]},_0x840af0={},_0x28bf24={'count':0x0,'rows':[]};var _0x3f9f82=_[_0xcccd('0x31')](db['ChatWebsite'][_0xcccd('0x32')],function(_0x508fd6){return{'name':_0x508fd6[_0xcccd('0x33')],'type':_0x508fd6['type']['key']};});_0x840af0['model']=_[_0xcccd('0x31')](_0x3f9f82,_0xcccd('0x2e'));_0x840af0[_0xcccd('0x34')]=_['keys'](_0x5e9585[_0xcccd('0x34')]);_0x840af0[_0xcccd('0x35')]=_['intersection'](_0x840af0[_0xcccd('0x36')],_0x840af0[_0xcccd('0x34')]);_0x338464[_0xcccd('0x37')]=_[_0xcccd('0x38')](_0x840af0[_0xcccd('0x36')],qs[_0xcccd('0x39')](_0x5e9585[_0xcccd('0x34')][_0xcccd('0x39')]));_0x338464['attributes']=_0x338464['attributes'][_0xcccd('0x3a')]?_0x338464[_0xcccd('0x37')]:_0x840af0['model'];if(!_0x5e9585[_0xcccd('0x34')][_0xcccd('0x3b')](_0xcccd('0x3c'))){_0x338464[_0xcccd('0x24')]=qs['limit'](_0x5e9585[_0xcccd('0x34')][_0xcccd('0x24')]);_0x338464[_0xcccd('0x26')]=qs[_0xcccd('0x26')](_0x5e9585[_0xcccd('0x34')]['offset']);}_0x338464[_0xcccd('0x3d')]=qs[_0xcccd('0x3e')](_0x5e9585[_0xcccd('0x34')][_0xcccd('0x3e')]);_0x338464[_0xcccd('0x3f')]=qs['filters'](_[_0xcccd('0x40')](_0x5e9585[_0xcccd('0x34')],_0x840af0[_0xcccd('0x35')]),_0x3f9f82);if(_0x5e9585[_0xcccd('0x34')][_0xcccd('0x41')]){_0x338464['where']=_['merge'](_0x338464[_0xcccd('0x3f')],{'$or':_[_0xcccd('0x31')](_0x3f9f82,function(_0x19b9e1){if(_0x19b9e1['type']!==_0xcccd('0x42')){var _0x3ebf96={};_0x3ebf96[_0x19b9e1[_0xcccd('0x2e')]]={'$like':'%'+_0x5e9585[_0xcccd('0x34')][_0xcccd('0x41')]+'%'};return _0x3ebf96;}})});}_0x338464=_['merge']({},_0x338464,_0x5e9585[_0xcccd('0x43')]);var _0x405df0={'where':_0x338464[_0xcccd('0x3f')]};return db[_0xcccd('0x44')][_0xcccd('0x25')](_0x405df0)[_0xcccd('0x16')](function(_0xfec55){_0x28bf24[_0xcccd('0x25')]=_0xfec55;if(_0x5e9585[_0xcccd('0x34')][_0xcccd('0x45')]){_0x338464[_0xcccd('0x46')]=[{'all':!![]}];}return db[_0xcccd('0x44')][_0xcccd('0x47')](_0x338464);})[_0xcccd('0x16')](function(_0x3dcc9d){_0x28bf24[_0xcccd('0x48')]=_0x3dcc9d;return _0x28bf24;})[_0xcccd('0x16')](respondWithFilteredResult(_0x2b736f,_0x338464))['catch'](handleError(_0x2b736f,null));};exports[_0xcccd('0x49')]=function(_0x22593c,_0x314c0c){var _0x176ea0={'raw':![],'where':{'id':_0x22593c['params']['id']},'include':[{'model':db[_0xcccd('0x30')],'as':_0xcccd('0x4a')}]},_0x5ec397={};_0x5ec397[_0xcccd('0x36')]=_[_0xcccd('0x4b')](db[_0xcccd('0x44')][_0xcccd('0x32')]);_0x5ec397[_0xcccd('0x34')]=_[_0xcccd('0x4b')](_0x22593c[_0xcccd('0x34')]);_0x5ec397[_0xcccd('0x35')]=_[_0xcccd('0x38')](_0x5ec397[_0xcccd('0x36')],_0x5ec397[_0xcccd('0x34')]);_0x176ea0[_0xcccd('0x37')]=_[_0xcccd('0x38')](_0x5ec397[_0xcccd('0x36')],qs['fields'](_0x22593c[_0xcccd('0x34')]['fields']));_0x176ea0[_0xcccd('0x37')]=_0x176ea0[_0xcccd('0x37')][_0xcccd('0x3a')]?_0x176ea0['attributes']:_0x5ec397[_0xcccd('0x36')];if(_0x22593c['query']['includeAll']){_0x176ea0[_0xcccd('0x46')]=[{'all':!![]}];}_0x176ea0=_[_0xcccd('0x4c')]({},_0x176ea0,_0x22593c['options']);return db[_0xcccd('0x44')][_0xcccd('0x4d')](_0x176ea0)[_0xcccd('0x16')](handleEntityNotFound(_0x314c0c,null))[_0xcccd('0x16')](respondWithResult(_0x314c0c,null))['catch'](handleError(_0x314c0c,null));};exports['create']=function(_0x204f06,_0x78bc26){return db['ChatWebsite']['create'](_0x204f06['body'],{})[_0xcccd('0x16')](function(_0x5818a6){var _0x36ffe4=_0x204f06[_0xcccd('0x4e')][_0xcccd('0x2a')]({'plain':!![]});if(!_0x36ffe4)throw new Error(_0xcccd('0x4f'));if(_0x36ffe4[_0xcccd('0x50')]===_0xcccd('0x4e')){var _0x1b6481=_0x5818a6[_0xcccd('0x2a')]({'plain':!![]});var _0x1d4ca5=_0xcccd('0x2b');return db[_0xcccd('0x51')][_0xcccd('0x4d')]({'where':{'name':_0x1d4ca5,'userProfileId':_0x36ffe4['userProfileId']},'raw':!![]})['then'](function(_0xcb2ee4){if(_0xcb2ee4&&_0xcb2ee4[_0xcccd('0x52')]===0x0){return db[_0xcccd('0x2c')][_0xcccd('0x53')]({'name':_0x1b6481[_0xcccd('0x2e')],'resourceId':_0x1b6481['id'],'type':_0xcb2ee4['name'],'sectionId':_0xcb2ee4['id']},{})[_0xcccd('0x16')](function(){return _0x5818a6;});}else{return _0x5818a6;}})[_0xcccd('0x54')](function(_0x497914){logger[_0xcccd('0x1b')](_0xcccd('0x55'),_0x497914);throw _0x497914;});}return _0x5818a6;})[_0xcccd('0x16')](respondWithResult(_0x78bc26,0xc9))[_0xcccd('0x54')](handleError(_0x78bc26,null));};exports[_0xcccd('0x28')]=function(_0x5522d6,_0x3393b9){if(_0x5522d6['body']['id']){delete _0x5522d6['body']['id'];}return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x5522d6[_0xcccd('0x56')]['id']},'include':[{'model':db[_0xcccd('0x30')],'as':_0xcccd('0x4a')}]})[_0xcccd('0x16')](handleEntityNotFound(_0x3393b9,null))[_0xcccd('0x16')](saveUpdates(_0x5522d6[_0xcccd('0x57')],null))[_0xcccd('0x16')](respondWithResult(_0x3393b9,null))[_0xcccd('0x54')](handleError(_0x3393b9,null));};exports[_0xcccd('0x29')]=function(_0x565879,_0xc819b7){return db['ChatWebsite'][_0xcccd('0x4d')]({'where':{'id':_0x565879['params']['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0xc819b7,null))[_0xcccd('0x16')](removeEntity(_0xc819b7,null))[_0xcccd('0x54')](handleError(_0xc819b7,null));};exports['describe']=function(_0x32a22f,_0x2845c5){return db[_0xcccd('0x44')][_0xcccd('0x58')]()[_0xcccd('0x16')](respondWithResult(_0x2845c5,null))['catch'](handleError(_0x2845c5,null));};exports[_0xcccd('0x59')]=function(_0x5125d0,_0x504e56){if(_0x5125d0[_0xcccd('0x57')]['id']){delete _0x5125d0[_0xcccd('0x57')]['id'];}return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x5125d0[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x504e56,null))[_0xcccd('0x16')](function(_0x3e00ca){if(_0x3e00ca){_0x5125d0[_0xcccd('0x57')][_0xcccd('0x5a')]=_0x3e00ca['id'];return db[_0xcccd('0x5b')][_0xcccd('0x53')](_0x5125d0['body']);}})[_0xcccd('0x16')](respondWithResult(_0x504e56,null))[_0xcccd('0x54')](handleError(_0x504e56,null));};exports['getDispositions']=function(_0x53ccdc,_0x42021d){var _0x3307fd={'raw':![],'where':{}};var _0xcba45b={};var _0x3d054c={'count':0x0,'rows':[]};return db[_0xcccd('0x44')][_0xcccd('0x5c')]({'where':{'id':_0x53ccdc['params']['id']}})['then'](handleEntityNotFound(_0x42021d,null))[_0xcccd('0x16')](function(_0xe6ca1e){if(_0xe6ca1e){_0xcba45b['model']=_['keys'](db['Disposition']['rawAttributes']);_0xcba45b[_0xcccd('0x34')]=_[_0xcccd('0x4b')](_0x53ccdc['query']);_0xcba45b[_0xcccd('0x35')]=_['intersection'](_0xcba45b[_0xcccd('0x36')],_0xcba45b[_0xcccd('0x34')]);_0x3307fd['attributes']=_[_0xcccd('0x38')](_0xcba45b[_0xcccd('0x36')],qs[_0xcccd('0x39')](_0x53ccdc[_0xcccd('0x34')]['fields']));_0x3307fd[_0xcccd('0x37')]=_0x3307fd['attributes'][_0xcccd('0x3a')]?_0x3307fd[_0xcccd('0x37')]:_0xcba45b[_0xcccd('0x36')];if(!_0x53ccdc['query'][_0xcccd('0x3b')](_0xcccd('0x3c'))){_0x3307fd[_0xcccd('0x24')]=qs[_0xcccd('0x24')](_0x53ccdc[_0xcccd('0x34')][_0xcccd('0x24')]);_0x3307fd[_0xcccd('0x26')]=qs[_0xcccd('0x26')](_0x53ccdc[_0xcccd('0x34')][_0xcccd('0x26')]);}_0x3307fd['order']=qs[_0xcccd('0x3e')](_0x53ccdc[_0xcccd('0x34')][_0xcccd('0x3e')]);_0x3307fd[_0xcccd('0x3f')]=qs[_0xcccd('0x35')](_[_0xcccd('0x40')](_0x53ccdc[_0xcccd('0x34')],_0xcba45b['filters']));_0x3307fd[_0xcccd('0x3f')][_0xcccd('0x5a')]=_0xe6ca1e['id'];if(_0x53ccdc[_0xcccd('0x34')][_0xcccd('0x41')]){_0x3307fd[_0xcccd('0x3f')]=_['merge'](_0x3307fd['where'],{'$or':_[_0xcccd('0x31')](_0x3307fd[_0xcccd('0x37')],function(_0x5f13f1){var _0x48c350={};_0x48c350[_0x5f13f1]={'$like':'%'+_0x53ccdc[_0xcccd('0x34')]['filter']+'%'};return _0x48c350;})});}_0x3307fd=_[_0xcccd('0x4c')]({},_0x3307fd,_0x53ccdc['options']);return db[_0xcccd('0x5b')]['count']({'where':_0x3307fd['where']})[_0xcccd('0x16')](function(_0x3ede52){_0x3d054c[_0xcccd('0x25')]=_0x3ede52;if(_0x53ccdc[_0xcccd('0x34')][_0xcccd('0x45')]){_0x3307fd['include']=[{'all':!![]}];}return db[_0xcccd('0x5b')]['findAll'](_0x3307fd);})[_0xcccd('0x16')](function(_0x1bcb59){_0x3d054c['rows']=_0x1bcb59;return _0x3d054c;});}})[_0xcccd('0x16')](respondWithFilteredResult(_0x42021d,_0x3307fd))[_0xcccd('0x54')](handleError(_0x42021d,null));};exports[_0xcccd('0x5d')]=function(_0xe4ce37,_0x8c84b7){return db[_0xcccd('0x44')]['find']({'where':{'id':_0xe4ce37['params']['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x8c84b7,null))[_0xcccd('0x16')](function(_0x1451bd){if(_0x1451bd){return _0x1451bd['removeDispositions'](_0xe4ce37[_0xcccd('0x34')]['ids']);}})[_0xcccd('0x16')](respondWithStatusCode(_0x8c84b7,null))[_0xcccd('0x54')](handleError(_0x8c84b7,null));};exports[_0xcccd('0x5e')]=function(_0x243dd9,_0x52ac6f){if(_0x243dd9['body']['id']){delete _0x243dd9['body']['id'];}return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x243dd9[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x52ac6f,null))[_0xcccd('0x16')](function(_0x6f335b){if(_0x6f335b){_0x243dd9[_0xcccd('0x57')][_0xcccd('0x5a')]=_0x6f335b['id'];return db[_0xcccd('0x5f')][_0xcccd('0x53')](_0x243dd9[_0xcccd('0x57')]);}})['then'](respondWithResult(_0x52ac6f,null))[_0xcccd('0x54')](handleError(_0x52ac6f,null));};exports[_0xcccd('0x60')]=function(_0x86fe12,_0x183da1){var _0x4e9176={'raw':![],'where':{}};var _0x1b2d4f={};var _0x30c59d={'count':0x0,'rows':[]};return db[_0xcccd('0x44')][_0xcccd('0x5c')]({'where':{'id':_0x86fe12[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x183da1,null))[_0xcccd('0x16')](function(_0x46e23a){if(_0x46e23a){_0x1b2d4f[_0xcccd('0x36')]=_[_0xcccd('0x4b')](db['CannedAnswer'][_0xcccd('0x32')]);_0x1b2d4f[_0xcccd('0x34')]=_[_0xcccd('0x4b')](_0x86fe12[_0xcccd('0x34')]);_0x1b2d4f[_0xcccd('0x35')]=_[_0xcccd('0x38')](_0x1b2d4f[_0xcccd('0x36')],_0x1b2d4f[_0xcccd('0x34')]);_0x4e9176['attributes']=_['intersection'](_0x1b2d4f[_0xcccd('0x36')],qs[_0xcccd('0x39')](_0x86fe12[_0xcccd('0x34')][_0xcccd('0x39')]));_0x4e9176[_0xcccd('0x37')]=_0x4e9176['attributes']['length']?_0x4e9176['attributes']:_0x1b2d4f[_0xcccd('0x36')];if(!_0x86fe12[_0xcccd('0x34')][_0xcccd('0x3b')](_0xcccd('0x3c'))){_0x4e9176['limit']=qs[_0xcccd('0x24')](_0x86fe12[_0xcccd('0x34')][_0xcccd('0x24')]);_0x4e9176[_0xcccd('0x26')]=qs['offset'](_0x86fe12['query'][_0xcccd('0x26')]);}_0x4e9176[_0xcccd('0x3d')]=qs[_0xcccd('0x3e')](_0x86fe12[_0xcccd('0x34')][_0xcccd('0x3e')]);_0x4e9176[_0xcccd('0x3f')]=qs[_0xcccd('0x35')](_[_0xcccd('0x40')](_0x86fe12[_0xcccd('0x34')],_0x1b2d4f[_0xcccd('0x35')]));_0x4e9176[_0xcccd('0x3f')][_0xcccd('0x5a')]=_0x46e23a['id'];if(_0x86fe12[_0xcccd('0x34')]['filter']){_0x4e9176[_0xcccd('0x3f')]=_[_0xcccd('0x4c')](_0x4e9176['where'],{'$or':_[_0xcccd('0x31')](_0x4e9176[_0xcccd('0x37')],function(_0x6e84fa){var _0x34554e={};_0x34554e[_0x6e84fa]={'$like':'%'+_0x86fe12[_0xcccd('0x34')][_0xcccd('0x41')]+'%'};return _0x34554e;})});}_0x4e9176=_['merge']({},_0x4e9176,_0x86fe12[_0xcccd('0x43')]);return db[_0xcccd('0x5f')][_0xcccd('0x25')]({'where':_0x4e9176['where']})['then'](function(_0x280208){_0x30c59d[_0xcccd('0x25')]=_0x280208;if(_0x86fe12[_0xcccd('0x34')]['includeAll']){_0x4e9176['include']=[{'all':!![]}];}return db[_0xcccd('0x5f')]['findAll'](_0x4e9176);})[_0xcccd('0x16')](function(_0x514108){_0x30c59d[_0xcccd('0x48')]=_0x514108;return _0x30c59d;});}})[_0xcccd('0x16')](respondWithFilteredResult(_0x183da1,_0x4e9176))[_0xcccd('0x54')](handleError(_0x183da1,null));};exports['removeAnswers']=function(_0x15f07d,_0x535c11){return db['ChatWebsite'][_0xcccd('0x4d')]({'where':{'id':_0x15f07d[_0xcccd('0x56')]['id']}})['then'](handleEntityNotFound(_0x535c11,null))['then'](function(_0x3d3203){if(_0x3d3203){return _0x3d3203[_0xcccd('0x61')](_0x15f07d[_0xcccd('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x535c11,null))['catch'](handleError(_0x535c11,null));};exports['addLogo']=function(_0x47e0e0,_0x3b6c92){_0x47e0e0['body'][_0xcccd('0x62')]=_0x47e0e0['file'][_0xcccd('0x63')];return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x47e0e0['params']['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x3b6c92,null))[_0xcccd('0x16')](saveUpdates(_0x47e0e0[_0xcccd('0x57')],null))[_0xcccd('0x16')](respondWithResult(_0x3b6c92,null))[_0xcccd('0x54')](handleError(_0x3b6c92,null));};exports[_0xcccd('0x64')]=function(_0x1e8597,_0xa890f2){_0x1e8597[_0xcccd('0x57')][_0xcccd('0x65')]=_0x1e8597[_0xcccd('0x66')]['filename'];return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x1e8597[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0xa890f2,null))[_0xcccd('0x16')](saveUpdates(_0x1e8597['body'],null))[_0xcccd('0x16')](respondWithResult(_0xa890f2,null))[_0xcccd('0x54')](handleError(_0xa890f2,null));};exports[_0xcccd('0x67')]=function(_0x551b86,_0x24fd73){_0x551b86[_0xcccd('0x57')]['customerAvatar']=_0x551b86[_0xcccd('0x66')][_0xcccd('0x63')];return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x551b86[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x24fd73,null))[_0xcccd('0x16')](saveUpdates(_0x551b86[_0xcccd('0x57')],null))[_0xcccd('0x16')](respondWithResult(_0x24fd73,null))[_0xcccd('0x54')](handleError(_0x24fd73,null));};exports[_0xcccd('0x68')]=function(_0x8dd91f,_0x5c19b9){_0x8dd91f[_0xcccd('0x57')]['systemAvatar']=_0x8dd91f[_0xcccd('0x66')][_0xcccd('0x63')];return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x8dd91f[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x5c19b9,null))[_0xcccd('0x16')](saveUpdates(_0x8dd91f[_0xcccd('0x57')],null))[_0xcccd('0x16')](respondWithResult(_0x5c19b9,null))[_0xcccd('0x54')](handleError(_0x5c19b9,null));};exports[_0xcccd('0x69')]=function(_0x558f21,_0x10269d){var _0x708681=path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],'server/files/images/logos/default_logo.svg');var _0x4e7865={'where':{'id':_0x558f21[_0xcccd('0x56')]['id']},'attributes':['id',_0xcccd('0x62')],'raw':!![]};var _0x2be3c7=![];return require(_0xcccd('0x6c'))['getLicense']()[_0xcccd('0x16')](function(_0x574389){if(_0x574389){_0x2be3c7=_0x574389[_0xcccd('0x6d')];}})[_0xcccd('0x16')](function(){return db[_0xcccd('0x44')][_0xcccd('0x4d')](_0x4e7865);})[_0xcccd('0x16')](handleEntityNotFound(_0x10269d,null))[_0xcccd('0x16')](function(_0x418075){if(_0x418075){if(!_['isNil'](_0x418075['sitepic'])){if(fs[_0xcccd('0x6e')](path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0x6f'),_0x418075['sitepic']))&&_0x2be3c7){_0x708681=path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0x6f'),_0x418075[_0xcccd('0x62')]);}}return _0x10269d[_0xcccd('0x70')](_0x708681);}})['catch'](handleError(_0x10269d,null));};exports[_0xcccd('0x71')]=function(_0x3cd6aa,_0x3c7726){var _0x545ece=path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0x72'));var _0x347e58={'where':{'id':_0x3cd6aa[_0xcccd('0x56')]['id']},'attributes':['id',_0xcccd('0x65')],'raw':!![]};return db[_0xcccd('0x44')][_0xcccd('0x4d')](_0x347e58)[_0xcccd('0x16')](handleEntityNotFound(_0x3c7726,null))['then'](function(_0xf4a322){if(_0xf4a322){if(!_[_0xcccd('0x73')](_0xf4a322[_0xcccd('0x65')])){if(fs[_0xcccd('0x6e')](path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0x74'),_0xf4a322['agentAvatar']))){_0x545ece=path['join'](config[_0xcccd('0x6b')],_0xcccd('0x74'),_0xf4a322['agentAvatar']);}}return _0x3c7726[_0xcccd('0x70')](_0x545ece);}})[_0xcccd('0x54')](handleError(_0x3c7726,null));};exports[_0xcccd('0x75')]=function(_0x53c581,_0xe39312){var _0x4165f8=path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0x76'));var _0x12f5cd={'where':{'id':_0x53c581[_0xcccd('0x56')]['id']},'attributes':['id','customerAvatar',_0xcccd('0x77')],'raw':!![]};return db[_0xcccd('0x44')][_0xcccd('0x4d')](_0x12f5cd)['then'](handleEntityNotFound(_0xe39312,null))['then'](function(_0x34f72b){if(_0x34f72b){if(!_['isNil'](_0x34f72b[_0xcccd('0x78')])){if(fs[_0xcccd('0x6e')](path['join'](config[_0xcccd('0x6b')],_0xcccd('0x74'),_0x34f72b[_0xcccd('0x78')]))&&_0x34f72b[_0xcccd('0x77')]){_0x4165f8=path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0x74'),_0x34f72b[_0xcccd('0x78')]);}}return _0xe39312[_0xcccd('0x70')](_0x4165f8);}})['catch'](handleError(_0xe39312,null));};exports[_0xcccd('0x79')]=function(_0x585797,_0x4bbc82){var _0xa12636=path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],'server/files/images/avatars/system_avatar.png');var _0x432911={'where':{'id':_0x585797[_0xcccd('0x56')]['id']},'attributes':['id',_0xcccd('0x7a')],'raw':!![]};return db['ChatWebsite']['find'](_0x432911)[_0xcccd('0x16')](handleEntityNotFound(_0x4bbc82,null))[_0xcccd('0x16')](function(_0x3ad7df){if(_0x3ad7df){if(!_[_0xcccd('0x73')](_0x3ad7df['systemAvatar'])){if(fs[_0xcccd('0x6e')](path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0x74'),_0x3ad7df[_0xcccd('0x7a')]))){_0xa12636=path[_0xcccd('0x6a')](config['root'],'server/files/images/avatars/',_0x3ad7df[_0xcccd('0x7a')]);}}return _0x4bbc82[_0xcccd('0x70')](_0xa12636);}})[_0xcccd('0x54')](handleError(_0x4bbc82,null));};exports[_0xcccd('0x7b')]=function(_0x30f3ea,_0x50add3){var _0x600a45=require('user-agent-parser');var _0x16babc=new _0x600a45();var _0x181cd9=_0x16babc[_0xcccd('0x7c')](_0x30f3ea[_0xcccd('0x7d')][_0xcccd('0x7e')])['getResult']();var _0x3df807={'body':_0x30f3ea[_0xcccd('0x57')],'channel':_0xcccd('0x7f')};var _0x47c855=[];var _0xb98cc2=[];var _0x40ecdd={};var _0x34d389=![];return db[_0xcccd('0x80')][_0xcccd('0x58')]()[_0xcccd('0x16')](function(_0x2abc95){if(!_0x2abc95){throw new db[(_0xcccd('0x81'))][(_0xcccd('0x82'))](_0xcccd('0x83'));}_0x47c855=_[_0xcccd('0x84')](_['keys'](_0x2abc95),[_0xcccd('0x85'),_0xcccd('0x86')]);_0xb98cc2=_[_0xcccd('0x84')](_[_0xcccd('0x4b')](_0x2abc95),['createdAt',_0xcccd('0x86'),'CompanyId',_0xcccd('0x87')]);if(_0x30f3ea[_0xcccd('0x57')]['id']){delete _0x30f3ea[_0xcccd('0x57')]['id'];}if(_['isNil'](_0x30f3ea['body'][_0xcccd('0x88')])){throw new db[(_0xcccd('0x81'))]['ValidationError'](_0xcccd('0x89'));}if(_['isNil'](_0x30f3ea[_0xcccd('0x57')]['body'])||_0x30f3ea['body'][_0xcccd('0x57')]===''){throw new db['Sequelize'][(_0xcccd('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcccd('0x73')](_0x30f3ea[_0xcccd('0x57')][_0xcccd('0x8a')])){throw new db[(_0xcccd('0x81'))][(_0xcccd('0x82'))](_0xcccd('0x8b')+_0xb98cc2);}if(!_[_0xcccd('0x8c')](_0xb98cc2,_0x30f3ea[_0xcccd('0x57')][_0xcccd('0x8a')])){throw new db['Sequelize']['ValidationError'](_0xcccd('0x8d')+_0xb98cc2);}_0x40ecdd[_0x30f3ea[_0xcccd('0x57')][_0xcccd('0x8a')]]=_0x30f3ea[_0xcccd('0x57')][_0xcccd('0x88')];})[_0xcccd('0x16')](function(){return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x30f3ea[_0xcccd('0x56')]['id']},'include':[{'model':db[_0xcccd('0x8e')],'as':_0xcccd('0x8f'),'include':[{'model':db[_0xcccd('0x80')],'as':'Contacts','where':_0x40ecdd,'limit':0x1,'order':[[_0xcccd('0x86'),'DESC']]}]},{'model':db[_0xcccd('0x90')],'as':'Applications'}]});})[_0xcccd('0x16')](handleEntityNotFound(_0x50add3,null))[_0xcccd('0x16')](function(_0x5db44b){if(_0x5db44b&&_0x5db44b[_0xcccd('0x8f')]){_0x3df807['account']=_0x5db44b;_0x3df807[_0xcccd('0x91')]=_0x5db44b['Applications'];_0x3df807[_0xcccd('0x92')]=_0x5db44b[_0xcccd('0x8f')];_0x3df807[_0xcccd('0x91')]=_['orderBy'](_0x3df807[_0xcccd('0x91')],['priority'],['asc']);if(_0x3df807[_0xcccd('0x93')][_0xcccd('0x94')]){delete _0x3df807[_0xcccd('0x93')][_0xcccd('0x94')];}if(_0x3df807['account'][_0xcccd('0x8f')]&&_0x3df807[_0xcccd('0x93')][_0xcccd('0x8f')][_0xcccd('0x95')]['length']){return _0x3df807['account']['List'][_0xcccd('0x95')][0x0];}var _0x14711a=_[_0xcccd('0xc')](_0x30f3ea[_0xcccd('0x57')],{'firstName':_0x30f3ea[_0xcccd('0x57')][_0xcccd('0x88')],'ListId':_0x5db44b[_0xcccd('0x87')]});_0x14711a[_0x30f3ea[_0xcccd('0x57')][_0xcccd('0x8a')]]=_0x30f3ea['body']['from'];return db[_0xcccd('0x80')][_0xcccd('0x53')](_0x14711a,{'fields':_0x47c855,'raw':!![]});}})['then'](handleEntityNotFound(_0x50add3,null))[_0xcccd('0x16')](function(_0xfecd27){_0x3df807[_0xcccd('0x96')]=_0xfecd27;var _0x117304=_0x30f3ea[_0xcccd('0x57')]['customerIp'];if(_0x30f3ea[_0xcccd('0x7d')][_0xcccd('0x97')]){_0x117304=_0x30f3ea[_0xcccd('0x7d')][_0xcccd('0x97')];}else if(_0x30f3ea[_0xcccd('0x7d')][_0xcccd('0x98')]){_0x117304=_[_0xcccd('0x99')](_0x30f3ea[_0xcccd('0x7d')][_0xcccd('0x98')][_0xcccd('0x9a')](','));}if(_0xfecd27){var _0x592204={'ContactId':_0xfecd27['id'],'ChatWebsiteId':_0x30f3ea['params']['id'],'from':(_0xfecd27[_0xcccd('0x9b')]||'')+'\x20'+(_0xfecd27['lastName']||''),'customerIp':_0x117304,'customerPort':_0x30f3ea[_0xcccd('0x7d')][_0xcccd('0x9c')]?_0x30f3ea[_0xcccd('0x7d')][_0xcccd('0x9c')]:null,'referer':_0x30f3ea['body']['referer'],'browserName':_0x181cd9['browser']['name']&&_0x181cd9['browser'][_0xcccd('0x9d')]?util[_0xcccd('0x9e')](_0xcccd('0x9f'),_0x181cd9['browser'][_0xcccd('0x2e')],_0x181cd9[_0xcccd('0xa0')][_0xcccd('0x9d')]):_0xcccd('0xa1'),'browserVersion':_0x181cd9['browser'][_0xcccd('0x9d')]||_0xcccd('0xa1'),'osName':util[_0xcccd('0x9e')](_0xcccd('0x9f'),_0x181cd9['os']['name'],_0x181cd9['os'][_0xcccd('0x9d')]),'osVersion':_0x181cd9['os']['version'],'deviceModel':_0x181cd9['device'][_0xcccd('0x36')]&&_0x181cd9['device']['vendor']?util['format']('%s\x20%s\x20%s',_0x181cd9[_0xcccd('0xa2')][_0xcccd('0x36')],_0x181cd9[_0xcccd('0xa2')][_0xcccd('0xa3')],_0x181cd9[_0xcccd('0xa2')][_0xcccd('0xa4')]):null,'deviceVendor':_0x181cd9['device']['vendor'],'deviceType':_0x181cd9[_0xcccd('0xa2')][_0xcccd('0xa4')],'formData':JSON[_0xcccd('0x1a')](_0x30f3ea['body'])};var _0x360505={'ChatWebsiteId':_0x30f3ea[_0xcccd('0x56')]['id'],'closed':![]};if(_0x30f3ea['body'][_0xcccd('0xa5')]){_0x360505[_0xcccd('0xa5')]=_0x30f3ea[_0xcccd('0x57')][_0xcccd('0xa5')];return db['ChatInteraction']['find']({'where':_0x360505})['then'](function(_0x4d6b40){if(_0x4d6b40){return[_0x4d6b40,![]];}_0x592204[_0xcccd('0xa5')]=_0x30f3ea[_0xcccd('0x57')][_0xcccd('0xa5')];_0x592204['externalUrl']=_0x30f3ea[_0xcccd('0x57')][_0xcccd('0xa6')];return db[_0xcccd('0xa7')]['create'](_0x592204)['then'](function(_0x46443d){return[_0x46443d,!![]];});});}_0x360505[_0xcccd('0xa8')]=_0xfecd27['id'];if(_0x30f3ea[_0xcccd('0x57')][_0xcccd('0xa9')]&&_0x30f3ea[_0xcccd('0x57')]['interaction']['id']){_0x360505['id']=_0x30f3ea['body'][_0xcccd('0xa9')]['id'];return db[_0xcccd('0xa7')][_0xcccd('0x4d')]({'where':_0x360505})[_0xcccd('0x16')](function(_0x49856f){if(_0x49856f){return[_0x49856f,![]];}return db[_0xcccd('0xa7')][_0xcccd('0x53')](_0x592204)[_0xcccd('0x16')](function(_0x51ba8f){return[_0x51ba8f,!![]];});});}return db[_0xcccd('0xa7')][_0xcccd('0x53')](_0x592204)[_0xcccd('0x16')](function(_0x5b4776){return[_0x5b4776,!![]];});}})[_0xcccd('0xaa')](function(_0xab852a,_0x14bd2c){if(_0xab852a){_0x34d389=_0x14bd2c;if(!_0x14bd2c){var _0x37c1d8={'from':(_0x3df807[_0xcccd('0x96')][_0xcccd('0x9b')]||'')+'\x20'+(_0x3df807['contact'][_0xcccd('0xab')]||'')};if(_0x30f3ea[_0xcccd('0x57')]['threadId']&&_0x30f3ea[_0xcccd('0x57')][_0xcccd('0xac')]&&_0x30f3ea['body']['threadId']!=_0x30f3ea['body']['messageId']){_0x37c1d8[_0xcccd('0xa5')]=_0x30f3ea[_0xcccd('0x57')]['messageId'];}return _0xab852a[_0xcccd('0x28')](_0x37c1d8);}else{return _0xab852a;}}})[_0xcccd('0x16')](function(_0x1ecba1){_0x3df807['interaction']=_0x1ecba1[_0xcccd('0x2a')]({'plain':!![]});_0x3df807[_0xcccd('0xa9')][_0xcccd('0xad')]=_0x34d389;if(_0x3df807['interaction']['created']){if(_0x3df807[_0xcccd('0x93')][_0xcccd('0xae')]){_0x3df807['applications'][_0xcccd('0xaf')]({'id':0x0,'priority':_0x3df807[_0xcccd('0x91')]['length']+0x1,'app':_0xcccd('0xb0'),'appdata':_0xcccd('0xb1'),'interval':_0xcccd('0xb2')});}}return db[_0xcccd('0xb3')]['create']({'body':_0x30f3ea[_0xcccd('0x57')][_0xcccd('0x57')],'ChatWebsiteId':_0x30f3ea['params']['id'],'ChatInteractionId':_0x1ecba1['id'],'direction':'in','ContactId':_0x3df807[_0xcccd('0x96')]['id'],'AttachmentId':_0x30f3ea[_0xcccd('0x57')]['AttachmentId']});})[_0xcccd('0x16')](function(_0x2b3f80){_0x3df807[_0xcccd('0x1c')]=_0x2b3f80;if(_0x3df807['interaction'][_0xcccd('0xb4')]){return db['User']['find']({'attributes':['id',_0xcccd('0x2e')],'where':{'id':_0x3df807[_0xcccd('0xa9')][_0xcccd('0xb4')]}})[_0xcccd('0x16')](function(_0x3435a4){if(_0x3435a4){_0x3df807[_0xcccd('0x91')][_0xcccd('0xb5')]({'id':0x0,'priority':0x0,'app':_0xcccd('0xb6'),'appdata':_0x3435a4[_0xcccd('0x2e')]+','+(_0x3df807[_0xcccd('0x93')][_0xcccd('0xb7')]||0xa),'interval':_0xcccd('0xb2')});_0x3df807[_0xcccd('0xb8')]=!![];}return respondWithRpcPromise(_0xcccd('0xb9'),_0xcccd('0xba'),_0x3df807);});}return respondWithRpcPromise(_0xcccd('0xb9'),_0xcccd('0xba'),_0x3df807);})[_0xcccd('0x16')](function(_0x277a61){respondWithRpcPromise(_0xcccd('0xbb'),'EventManager',{'event':_0xcccd('0x7b'),'message':_0x277a61},client9002);return _0x277a61;})[_0xcccd('0x16')](respondWithResult(_0x50add3,null))[_0xcccd('0x54')](handleError(_0x50add3,null));};exports[_0xcccd('0xbc')]=function(_0x46ec02,_0xd1215d){var _0x26c449,_0x38c7d4,_0x16852a;var _0x14149e=[];var _0xcd6856={};var _0x4d6c9e=_0x46ec02[_0xcccd('0xbd')]||[];var _0x3fe872=[];var _0x4e2427;return db[_0xcccd('0x80')][_0xcccd('0x58')]()[_0xcccd('0x16')](function(_0x3d459b){if(!_0x3d459b){throw new db[(_0xcccd('0x81'))][(_0xcccd('0x82'))](_0xcccd('0x83'));}_0x14149e=_[_0xcccd('0x84')](_[_0xcccd('0x4b')](_0x3d459b),[_0xcccd('0x85'),_0xcccd('0x86'),'CompanyId',_0xcccd('0x87')]);if(_0x46ec02[_0xcccd('0x57')]['id']){delete _0x46ec02[_0xcccd('0x57')]['id'];}if(_[_0xcccd('0x73')](_0x46ec02['body']['from'])){throw _0xd1215d[_0xcccd('0x21')](0x1f4)[_0xcccd('0x2f')](new db['Sequelize'][(_0xcccd('0x82'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x46ec02['body'][_0xcccd('0x57')])||_0x46ec02[_0xcccd('0x57')][_0xcccd('0x57')]===''){throw _0xd1215d[_0xcccd('0x21')](0x1f4)[_0xcccd('0x2f')](new db[(_0xcccd('0x81'))][(_0xcccd('0x82'))](_0xcccd('0xbe')));}if(_['isNil'](_0x46ec02['body'][_0xcccd('0xbf')])){throw _0xd1215d[_0xcccd('0x21')](0x1f4)[_0xcccd('0x2f')](new db[(_0xcccd('0x81'))][(_0xcccd('0x82'))](_0xcccd('0xc0')+_0x14149e));}if(!_[_0xcccd('0x8c')](_0x14149e,_0x46ec02[_0xcccd('0x57')]['mapKeyOffline'])){throw _0xd1215d['status'](0x1f4)[_0xcccd('0x2f')](new db['Sequelize']['ValidationError'](_0xcccd('0xc1')+_0x14149e));}_0xcd6856[_0x46ec02[_0xcccd('0x57')][_0xcccd('0xbf')]]=_0x46ec02[_0xcccd('0x57')][_0xcccd('0x88')];})['then'](function(){return db['ChatWebsite'][_0xcccd('0x4d')]({'where':{'id':_0x46ec02[_0xcccd('0x56')]['id']},'include':[{'model':db[_0xcccd('0x8e')],'as':_0xcccd('0x8f')},{'model':db[_0xcccd('0xc2')],'as':'MailAccount'}]});})[_0xcccd('0x16')](handleEntityNotFound(_0xd1215d,null))[_0xcccd('0x16')](function(_0x18eba3){if(_0x18eba3&&_0x18eba3['List']){_0x38c7d4=_0x18eba3;var _0x5aee98=_['defaults'](_0x46ec02['body'],{'firstName':_0x46ec02[_0xcccd('0x57')][_0xcccd('0x88')],'phone':_0x46ec02[_0xcccd('0x57')][_0xcccd('0x88')],'ListId':_0x18eba3[_0xcccd('0x87')]});_0x5aee98[_0x46ec02['body'][_0xcccd('0xbf')]]=_0x46ec02[_0xcccd('0x57')][_0xcccd('0x88')];return db[_0xcccd('0x80')]['findOrCreate']({'where':_0xcd6856,'defaults':_0x5aee98});}})[_0xcccd('0xaa')](function(_0x59bf26){if(_0x59bf26){_0x16852a=_0x59bf26;var _0x2c5b50=fs[_0xcccd('0xc3')](path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0xc4')),_0xcccd('0xc5'));var _0x586683=ejs[_0xcccd('0xc6')](_0x2c5b50,{'body':_[_0xcccd('0xc7')](_0x46ec02[_0xcccd('0x57')][_0xcccd('0x57')]),'bodyTitle':_0x38c7d4['offlineMessageBody']});return db['ChatOfflineMessage'][_0xcccd('0x53')]({'body':_0x586683,'plainBody':htmlToText[_0xcccd('0xc8')](_0x586683),'ContactId':_0x59bf26['id'],'ChatWebsiteId':_0x38c7d4['id']});}})[_0xcccd('0x16')](function(_0x3c3f53){_0x4e2427=_0x3c3f53;if(_0x4d6c9e[_0xcccd('0x3a')]){var _0x42d0dc=_0x4d6c9e[_0xcccd('0x31')](function(_0x3ee20b){return{'name':_0x3ee20b[_0xcccd('0xc9')],'basename':_0x3ee20b[_0xcccd('0x63')],'type':_0x3ee20b['mimetype'],'ChatOfflineMessageId':_0x3c3f53['id']};});_0x3fe872=_0x42d0dc[_0xcccd('0x31')](_0x4ea2cd=>{var _0x4e6bc5={'filename':_0x4ea2cd[_0xcccd('0x2e')],'path':path[_0xcccd('0x6a')](config['root'],_0xcccd('0xca'),_0xcccd('0xbd'),_0xcccd('0xcb'),_0xcccd('0xcc'),_0x4ea2cd[_0xcccd('0xcd')])};return _0x4e6bc5;});if(!_0x38c7d4['openNewInteraction']){return db[_0xcccd('0xce')]['transaction'](function(_0xcd4667){return db[_0xcccd('0xcf')][_0xcccd('0xd0')](_0x42d0dc,{'transaction':_0xcd4667});});}}})[_0xcccd('0x16')](function(){if(_0x4e2427){_0x26c449=_0x4e2427;return db[_0xcccd('0xc2')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xcccd('0xd1')],'as':_0xcccd('0xd2'),'raw':!![]}]});}})[_0xcccd('0x16')](function(_0x5a5494){if(_0x5a5494&&_0x5a5494[_0xcccd('0xd2')]&&_0x38c7d4[_0xcccd('0xd3')]&&_0x38c7d4[_0xcccd('0xd4')]){var _0x5ac9c2={'tls':{'rejectUnauthorized':![]}};if(_0x5a5494[_0xcccd('0xd2')][_0xcccd('0xd5')]){_0x5ac9c2['service']=_0x5a5494[_0xcccd('0xd2')][_0xcccd('0xd5')];}else{_0x5ac9c2[_0xcccd('0xd6')]=_0x5a5494[_0xcccd('0xd2')][_0xcccd('0xd6')];_0x5ac9c2['port']=_0x5a5494[_0xcccd('0xd2')]['port'];_0x5ac9c2[_0xcccd('0xd7')]=_0x5a5494[_0xcccd('0xd2')][_0xcccd('0xd7')];}if(_0x5a5494[_0xcccd('0xd2')]['authentication']){_0x5ac9c2[_0xcccd('0xd8')]={'user':_0x5a5494[_0xcccd('0xd2')][_0xcccd('0x4e')],'pass':_0x5a5494[_0xcccd('0xd2')]['pass']};}return respondWithRpcPromise('SendMail',_0xcccd('0xd9'),{'account':_0x5ac9c2,'message':{'from':util['format'](_0xcccd('0xda'),_0x5a5494[_0xcccd('0x2e')],_0x5a5494[_0xcccd('0xdb')]||_0x5a5494['Smtp'][_0xcccd('0x4e')]),'to':_0x38c7d4[_0xcccd('0xd4')],'subject':_0x38c7d4[_0xcccd('0xdc')],'html':_0x26c449[_0xcccd('0x57')],'attachments':_0x3fe872}},client9003)[_0xcccd('0x16')](function(){return _0x26c449;})[_0xcccd('0x54')](function(_0x37f1f5){console['error'](_0x37f1f5);});}})[_0xcccd('0x16')](function(){if(_0x38c7d4&&_0x38c7d4[_0xcccd('0xdd')]&&_0x38c7d4['MailAccountId']){var _0x514d9d=[];if(_0x4d6c9e['length']){_0x514d9d=_0x4d6c9e[_0xcccd('0x31')](function(_0x22cc84){return{'name':_0x22cc84[_0xcccd('0xc9')],'basename':_0x22cc84[_0xcccd('0x63')],'type':_0x22cc84['mimetype'],'ChatOfflineMessageId':_0x4e2427['id']};});}var _0x792b98;if(!_[_0xcccd('0x73')](_0x38c7d4['subjectOffline'])){var _0x82861b=_[_0xcccd('0x31')](_0x46ec02[_0xcccd('0x57')],function(_0x10c138){return _0x10c138;});var _0x470b81=_[_0xcccd('0xde')](_0x82861b)[0x0];var _0x1c5782=_[_0xcccd('0xdf')](_0x470b81,function(_0x53ff1e){return _0x53ff1e;});_0x792b98=_0x1c5782[0x1][_0x38c7d4[_0xcccd('0xe0')]];}var _0x522b2e={'from':_0x16852a[_0xcccd('0xdb')],'firstName':_0x16852a['firstName'],'lastName':_0x16852a[_0xcccd('0xab')],'mapKey':_0xcccd('0xdb'),'message':{'from':_0x16852a[_0xcccd('0xdb')],'to':_0x38c7d4[_0xcccd('0xc2')][_0xcccd('0xdb')],'cc':'','subject':_[_0xcccd('0x73')](_0x792b98)?_0x38c7d4[_0xcccd('0xdc')]:_0x792b98,'messageId':'','sentAt':new Date(),'attach':_0x514d9d[_0xcccd('0x3a')],'attachments':_0x514d9d,'originChannel':_0xcccd('0xe1'),'ChatWebsiteId':_0x38c7d4['id'],'ChatOfflineMessageId':_0x26c449['id'],'originTo':_0x38c7d4['MailAccount'][_0xcccd('0xdb')]},'body':_0x26c449[_0xcccd('0x57')]};var _0x41dd26={'account':{'id':_0x38c7d4[_0xcccd('0xe2')]},'body':_0x522b2e,'log':_0xcccd('0xe3')};return respondWithRpcPromise(_0xcccd('0xe3'),_0xcccd('0xe4'),_0x41dd26,client9001)[_0xcccd('0x16')](function(){return _0x26c449;})[_0xcccd('0x54')](function(_0x4ba36f){console[_0xcccd('0x1b')](_0x4ba36f);});}return;})[_0xcccd('0x16')](function(){if(_0x26c449){return _0x26c449;}})['then'](respondWithResult(_0xd1215d,null))['catch'](function(_0x508703){console['error']('catch',_0x508703);for(var _0x516e2b of _0x4d6c9e){var _0x48bd76=path['join'](config['root'],_0xcccd('0xca'),'files',_0xcccd('0xcb'),_0xcccd('0xcc'),_0x516e2b[_0xcccd('0x63')]);fs_extra['remove'](_0x48bd76)['catch'](function(_0x35162a){console[_0xcccd('0x1b')](_0xcccd('0xe5'),_0x48bd76,_0x35162a);});}});};exports[_0xcccd('0xe6')]=function(_0x21bcc4,_0x45584e){return db[_0xcccd('0xa7')][_0xcccd('0x4d')]({'where':{'id':_0x21bcc4['params']['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x45584e,null))[_0xcccd('0x16')](function(_0x6117cd){if(_0x6117cd){return _0x6117cd['addInteraction'](_0x21bcc4[_0xcccd('0x57')][_0xcccd('0xe7')],_[_0xcccd('0xe8')](_0x21bcc4[_0xcccd('0x57')],[_0xcccd('0xe7'),'id'])||{});}})[_0xcccd('0x16')](respondWithResult(_0x45584e,null))[_0xcccd('0x54')](handleError(_0x45584e,null));};exports[_0xcccd('0xe9')]=function(_0x342ac0,_0x2b8c05){var _0x1c5206={'raw':![],'where':{}};var _0x567ca9={};var _0x5eb37b={'count':0x0,'rows':[]};return db[_0xcccd('0x44')][_0xcccd('0x5c')]({'where':{'id':_0x342ac0[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x2b8c05,null))[_0xcccd('0x16')](function(_0x3074d5){if(_0x3074d5){_0x567ca9[_0xcccd('0x36')]=_[_0xcccd('0x4b')](db[_0xcccd('0xa7')]['rawAttributes']);_0x567ca9[_0xcccd('0x34')]=_['keys'](_0x342ac0['query']);_0x567ca9[_0xcccd('0x35')]=_[_0xcccd('0x38')](_0x567ca9[_0xcccd('0x36')],_0x567ca9['query']);_0x1c5206[_0xcccd('0x37')]=_[_0xcccd('0x38')](_0x567ca9[_0xcccd('0x36')],qs[_0xcccd('0x39')](_0x342ac0[_0xcccd('0x34')][_0xcccd('0x39')]));_0x1c5206[_0xcccd('0x37')]=_0x1c5206['attributes'][_0xcccd('0x3a')]?_0x1c5206['attributes']:_0x567ca9[_0xcccd('0x36')];if(!_0x342ac0['query'][_0xcccd('0x3b')](_0xcccd('0x3c'))){_0x1c5206[_0xcccd('0x24')]=qs['limit'](_0x342ac0[_0xcccd('0x34')]['limit']);_0x1c5206[_0xcccd('0x26')]=qs[_0xcccd('0x26')](_0x342ac0[_0xcccd('0x34')]['offset']);}_0x1c5206[_0xcccd('0x3d')]=qs[_0xcccd('0x3e')](_0x342ac0['query'][_0xcccd('0x3e')]);_0x1c5206[_0xcccd('0x3f')]=qs[_0xcccd('0x35')](_[_0xcccd('0x40')](_0x342ac0[_0xcccd('0x34')],_0x567ca9['filters']));_0x1c5206[_0xcccd('0x3f')][_0xcccd('0x5a')]=_0x3074d5['id'];if(_0x342ac0[_0xcccd('0x34')][_0xcccd('0x41')]){_0x1c5206[_0xcccd('0x3f')]=_[_0xcccd('0x4c')](_0x1c5206[_0xcccd('0x3f')],{'$or':_[_0xcccd('0x31')](_0x1c5206[_0xcccd('0x37')],function(_0x48d6be){var _0xe3bcf={};_0xe3bcf[_0x48d6be]={'$like':'%'+_0x342ac0[_0xcccd('0x34')][_0xcccd('0x41')]+'%'};return _0xe3bcf;})});}_0x1c5206=_[_0xcccd('0x4c')]({},_0x1c5206,_0x342ac0[_0xcccd('0x43')]);return db[_0xcccd('0xa7')]['count']({'where':_0x1c5206[_0xcccd('0x3f')]})['then'](function(_0x45fb14){_0x5eb37b['count']=_0x45fb14;if(_0x342ac0[_0xcccd('0x34')][_0xcccd('0x45')]){_0x1c5206['include']=[{'model':db['CmContact'],'as':_0xcccd('0xea'),'required':![]},{'model':db[_0xcccd('0xeb')],'as':_0xcccd('0xec'),'attributes':[_0xcccd('0x2e'),_0xcccd('0xed'),_0xcccd('0xee')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xcccd('0x2e'),_0xcccd('0xef')],'where':_0x342ac0[_0xcccd('0x34')][_0xcccd('0xf0')]?{'id':_0x342ac0['query'][_0xcccd('0xf0')]}:undefined,'required':_0x342ac0[_0xcccd('0x34')]['tag']?!![]:![]}];}return db[_0xcccd('0xa7')][_0xcccd('0x47')](_0x1c5206);})[_0xcccd('0x16')](function(_0x241c50){_0x5eb37b[_0xcccd('0x48')]=_0x241c50;return _0x5eb37b;});}})[_0xcccd('0x16')](respondWithFilteredResult(_0x2b8c05,_0x1c5206))[_0xcccd('0x54')](handleError(_0x2b8c05,null));};function iftimePromise(_0x11ce72,_0x5251e9){return respondWithRpcPromise(_0xcccd('0xf1'),_0xcccd('0xf2'),{'command':_0x5251e9[_0xcccd('0xf3')]?util[_0xcccd('0x9e')](_0xcccd('0xf4'),_0x11ce72[_0xcccd('0xf5')],_0x5251e9[_0xcccd('0xf3')]):util[_0xcccd('0x9e')](_0xcccd('0xf6'),_0x11ce72['interval'])},client9002)[_0xcccd('0x16')](function(_0x1b7a47){var _0x5acd67=_0x1b7a47&&_0x1b7a47[_0xcccd('0xf7')](_0xcccd('0xf8'))>=0x0?!![]:![];logger[_0xcccd('0x1e')](_0xcccd('0xf9'),_0x5251e9['id'],_0x11ce72['id'],_0x11ce72['interval'],_0x5acd67?_0xcccd('0xfa'):'OFFLINE',_0x5251e9[_0xcccd('0xf3')]?_0x5251e9[_0xcccd('0xf3')]:_0xcccd('0xfb'));return _0x5acd67;})['catch'](function(_0xc9891a){logger[_0xcccd('0x1b')](_0xcccd('0xf9'),_0x5251e9['id'],_0x11ce72['id'],_0x11ce72[_0xcccd('0xf5')],util[_0xcccd('0xfc')](_0xc9891a,{'showHidden':![],'depth':null}),_0x5251e9['timezone']?_0x5251e9[_0xcccd('0xf3')]:_0xcccd('0xfb'));return![];});}exports[_0xcccd('0xf2')]=function(_0x26de80,_0x5a4ca9){var _0x1b6b3d=0x0;var _0x4a0f6d=0x0;var _0x56edba=![];var _0x571420;var _0x14ce9c;return db[_0xcccd('0x44')]['find']({'where':{'id':_0x26de80[_0xcccd('0x56')]['id']},'include':[{'model':db['Interval'],'as':_0xcccd('0xfd'),'include':[{'model':db[_0xcccd('0xfd')],'as':_0xcccd('0xfe'),'attributes':['id',_0xcccd('0xf5')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5a4ca9,null))[_0xcccd('0x16')](function(_0x4e7a1a){if(_0x4e7a1a){_0x571420=_0x4e7a1a;return _0x4e7a1a['getProactiveActions']({'raw':!![]});}})[_0xcccd('0x16')](function(_0x2a1079){if(_0x571420){if(_0x2a1079){_0x14ce9c=_0x2a1079;}}return require(_0xcccd('0x6c'))[_0xcccd('0xff')]();})[_0xcccd('0x16')](function(_0x1ab0d8){if(_0x1ab0d8){_0x4a0f6d=_0x1ab0d8[_0xcccd('0x100')];_0x56edba=_0x1ab0d8[_0xcccd('0x6d')];}})[_0xcccd('0x16')](function(){return db[_0xcccd('0xa7')]['count']({'where':{'closed':![]}});})[_0xcccd('0x16')](function(_0x3ae4e8){_0x1b6b3d=_0x3ae4e8;if(_0x4a0f6d&&_0x3ae4e8>_0x4a0f6d){return db['License'][_0xcccd('0x5c')]({'where':{'id':0x1}})[_0xcccd('0x16')](function(_0x2876d7){if(_0x2876d7){_0x2876d7[_0xcccd('0x101')](_0xcccd('0x102'));}});}})[_0xcccd('0x16')](function(){if(_0x571420[_0xcccd('0xfd')]&&_0x571420['Interval'][_0xcccd('0xfe')]){var _0x23af9c=[];for(var _0x169151=0x0;_0x169151<_0x571420[_0xcccd('0xfd')][_0xcccd('0xfe')][_0xcccd('0x3a')];_0x169151++){var _0x486173=_0x571420[_0xcccd('0xfd')]['Intervals'][_0x169151][_0xcccd('0x2a')]({'plain':!![]});_0x23af9c[_0xcccd('0xaf')](iftimePromise(_0x486173,_0x571420));}return BPromise[_0xcccd('0x103')](_0x23af9c)['then'](function(_0x3b8e1d){return _[_0xcccd('0x104')](_0x3b8e1d);});}else{return!![];}})[_0xcccd('0x16')](function(_0x26aa91){var _0x33d817=fs[_0xcccd('0xc3')](path[_0xcccd('0x6a')](config[_0xcccd('0x6b')],_0xcccd('0x105')),_0xcccd('0xc5'));var _0x50241b={'remote':_0x571420[_0xcccd('0x106')],'query':querystring[_0xcccd('0x1a')](_[_0xcccd('0x4c')](_0x571420['get']({'plain':!![]}),{'customerIp':_0x26de80[_0xcccd('0x7d')][_0xcccd('0x98')]||_0x26de80[_0xcccd('0x7d')][_0xcccd('0x107')]||_0x26de80[_0xcccd('0x108')][_0xcccd('0x109')]||_0x26de80['ip'],'referer':_0x26de80['headers'][_0xcccd('0x10a')],'openedInteractions':_0x1b6b3d,'maxInteractions':_0x4a0f6d,'virtual':_0x56edba['virtual'],'online':_0x26aa91,'custom':_0x56edba}))['replace'](/'/g,'\x5c\x27')};_0x5a4ca9[_0xcccd('0x2f')](ejs[_0xcccd('0xc6')](Mustache[_0xcccd('0xc6')](_0x33d817,_0x50241b),{'proactiveActions':_0x14ce9c,'alignment':_0x571420[_0xcccd('0x10b')],'verticalAlignment':_0x571420[_0xcccd('0x10c')],'div_color':_0x571420[_0xcccd('0xef')],'labelText':_0x571420[_0xcccd('0x10d')],'text_color':_0x571420['textColor'],'button_color':_0x571420[_0xcccd('0x10e')],'background_color':_0x571420[_0xcccd('0x10f')],'hideWhenOffline':_0x571420[_0xcccd('0x110')],'interval':_0x571420[_0xcccd('0x111')]}));})['catch'](handleError(_0x5a4ca9,null));};exports[_0xcccd('0x112')]=function(_0x3db066,_0x57be09){var _0x124cfd=_0x3db066[_0xcccd('0x56')]['id'];var _0x2722a9=_0x3db066[_0xcccd('0x57')];var _0x324664=0xc8;var _0x5d54a5=null;return db['sequelize'][_0xcccd('0x113')]({'isolationLevel':db['sequelize'][_0xcccd('0x114')][_0xcccd('0x115')][_0xcccd('0x116')]},function(_0x135257){return db[_0xcccd('0x44')][_0xcccd('0x5c')]({'where':{'id':_0x124cfd},'transaction':_0x135257})[_0xcccd('0x16')](function(_0x48f100){if(_0x48f100){return db[_0xcccd('0x90')]['destroy']({'where':{'ChatWebsiteId':_0x124cfd},'transaction':_0x135257})[_0xcccd('0x16')](function(){var _0x63117f=_['map'](_0x2722a9,function(_0x4e5f38){_0x4e5f38[_0xcccd('0x5a')]=_0x124cfd;return _0x4e5f38;});return db[_0xcccd('0x90')][_0xcccd('0xd0')](_0x63117f,{'transaction':_0x135257});});}else{_0x324664=0x194;_0x5d54a5=[];}});})[_0xcccd('0x16')](function(){if(_0x324664!==0x194){return db['ChatApplication'][_0xcccd('0x117')]({'where':{'ChatWebsiteId':_0x124cfd},'order':_0xcccd('0x118')})[_0xcccd('0x16')](function(_0x1d64e7){_0x5d54a5=_0x1d64e7;});}})[_0xcccd('0x54')](function(_0x1a965){_0x324664=0x1f4;logger[_0xcccd('0x1b')](_0x1a965['stack']);if(_0x1a965[_0xcccd('0x2e')]){delete _0x1a965[_0xcccd('0x2e')];}_0x5d54a5=_0x1a965;})['finally'](function(){if(_0x5d54a5===null){_0x57be09[_0xcccd('0x20')](_0x324664);}else{if(_0x324664===0x1f4){_0x57be09[_0xcccd('0x21')](_0x324664)['send'](_0x5d54a5);}else{_0x57be09[_0xcccd('0x21')](_0x324664)[_0xcccd('0x22')](_0x5d54a5);}}});};exports[_0xcccd('0x119')]=function(_0x2304af,_0x34b890){var _0x36c44c={};var _0x26af46={};var _0x182ff5;var _0x2967e0;return db[_0xcccd('0x44')][_0xcccd('0x5c')]({'where':{'id':_0x2304af[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x34b890,null))[_0xcccd('0x16')](function(_0x167b97){if(_0x167b97){_0x182ff5=_0x167b97;_0x26af46[_0xcccd('0x36')]=_[_0xcccd('0x4b')](db['ChatApplication'][_0xcccd('0x32')]);_0x26af46['query']=_[_0xcccd('0x4b')](_0x2304af['query']);_0x26af46[_0xcccd('0x35')]=_['intersection'](_0x26af46[_0xcccd('0x36')],_0x26af46[_0xcccd('0x34')]);_0x36c44c[_0xcccd('0x37')]=_['intersection'](_0x26af46[_0xcccd('0x36')],qs[_0xcccd('0x39')](_0x2304af[_0xcccd('0x34')]['fields']));_0x36c44c['attributes']=_0x36c44c[_0xcccd('0x37')][_0xcccd('0x3a')]?_0x36c44c[_0xcccd('0x37')]:_0x26af46[_0xcccd('0x36')];_0x36c44c[_0xcccd('0x3d')]=qs['sort'](_0x2304af[_0xcccd('0x34')]['sort']);_0x36c44c[_0xcccd('0x3f')]=qs[_0xcccd('0x35')](_[_0xcccd('0x40')](_0x2304af[_0xcccd('0x34')],_0x26af46[_0xcccd('0x35')]));if(_0x2304af[_0xcccd('0x34')][_0xcccd('0x41')]){_0x36c44c['where']=_['merge'](_0x36c44c[_0xcccd('0x3f')],{'$or':_[_0xcccd('0x31')](_0x36c44c[_0xcccd('0x37')],function(_0x55826d){var _0x280f18={};_0x280f18[_0x55826d]={'$like':'%'+_0x2304af[_0xcccd('0x34')][_0xcccd('0x41')]+'%'};return _0x280f18;})});}_0x36c44c=_[_0xcccd('0x4c')]({},_0x36c44c,_0x2304af['options']);return _0x182ff5[_0xcccd('0x119')](_0x36c44c);}})['then'](function(_0x235f0a){if(_0x235f0a){_0x2967e0=_0x235f0a['length'];if(!_0x2304af['query'][_0xcccd('0x3b')]('nolimit')){_0x36c44c[_0xcccd('0x24')]=qs[_0xcccd('0x24')](_0x2304af[_0xcccd('0x34')][_0xcccd('0x24')]);_0x36c44c[_0xcccd('0x26')]=qs[_0xcccd('0x26')](_0x2304af[_0xcccd('0x34')][_0xcccd('0x26')]);}return _0x182ff5[_0xcccd('0x119')](_0x36c44c);}})[_0xcccd('0x16')](function(_0x43fe60){if(_0x43fe60){return _0x43fe60?{'count':_0x2967e0,'rows':_0x43fe60}:null;}})[_0xcccd('0x16')](respondWithResult(_0x34b890,null))['catch'](handleError(_0x34b890,null));};exports[_0xcccd('0x11a')]=function(_0x17380b,_0x17d1fb){return db['chatProactiveAction']['find']({'where':{'id':_0x17380b[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x17d1fb,null))[_0xcccd('0x16')](function(_0x42b009){if(_0x42b009){return _0x42b009[_0xcccd('0x11a')](_0x17380b[_0xcccd('0x57')][_0xcccd('0xe7')],_['omit'](_0x17380b[_0xcccd('0x57')],[_0xcccd('0xe7'),'id'])||{});}})[_0xcccd('0x16')](respondWithResult(_0x17d1fb,null))['catch'](handleError(_0x17d1fb,null));};exports[_0xcccd('0x11b')]=function(_0x1206b9,_0x473b9a){var _0x50bf0e={};var _0x2c0225={};var _0x52a761;var _0x5b0ca3;return db[_0xcccd('0x44')][_0xcccd('0x5c')]({'where':{'id':_0x1206b9[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x473b9a,null))['then'](function(_0x2220ae){if(_0x2220ae){_0x52a761=_0x2220ae;_0x2c0225[_0xcccd('0x36')]=_[_0xcccd('0x4b')](db[_0xcccd('0x11c')][_0xcccd('0x32')]);_0x2c0225[_0xcccd('0x34')]=_['keys'](_0x1206b9[_0xcccd('0x34')]);_0x2c0225[_0xcccd('0x35')]=_[_0xcccd('0x38')](_0x2c0225[_0xcccd('0x36')],_0x2c0225[_0xcccd('0x34')]);_0x50bf0e[_0xcccd('0x37')]=_[_0xcccd('0x38')](_0x2c0225[_0xcccd('0x36')],qs[_0xcccd('0x39')](_0x1206b9['query'][_0xcccd('0x39')]));_0x50bf0e[_0xcccd('0x37')]=_0x50bf0e['attributes']['length']?_0x50bf0e[_0xcccd('0x37')]:_0x2c0225[_0xcccd('0x36')];_0x50bf0e[_0xcccd('0x3d')]=qs['sort'](_0x1206b9[_0xcccd('0x34')][_0xcccd('0x3e')]);_0x50bf0e[_0xcccd('0x3f')]=qs[_0xcccd('0x35')](_[_0xcccd('0x40')](_0x1206b9[_0xcccd('0x34')],_0x2c0225[_0xcccd('0x35')]));if(_0x1206b9[_0xcccd('0x34')][_0xcccd('0x41')]){_0x50bf0e[_0xcccd('0x3f')]=_[_0xcccd('0x4c')](_0x50bf0e[_0xcccd('0x3f')],{'$or':_[_0xcccd('0x31')](_0x50bf0e['attributes'],function(_0x48a2f3){var _0x151efe={};_0x151efe[_0x48a2f3]={'$like':'%'+_0x1206b9[_0xcccd('0x34')][_0xcccd('0x41')]+'%'};return _0x151efe;})});}_0x50bf0e=_['merge']({},_0x50bf0e,_0x1206b9[_0xcccd('0x43')]);return _0x52a761[_0xcccd('0x11b')](_0x50bf0e);}})[_0xcccd('0x16')](function(_0x357bd3){if(_0x357bd3){_0x5b0ca3=_0x357bd3[_0xcccd('0x3a')];if(!_0x1206b9[_0xcccd('0x34')][_0xcccd('0x3b')](_0xcccd('0x3c'))){_0x50bf0e['limit']=qs[_0xcccd('0x24')](_0x1206b9[_0xcccd('0x34')][_0xcccd('0x24')]);_0x50bf0e['offset']=qs['offset'](_0x1206b9[_0xcccd('0x34')][_0xcccd('0x26')]);}return _0x52a761[_0xcccd('0x11b')](_0x50bf0e);}})[_0xcccd('0x16')](function(_0x35bf58){if(_0x35bf58){return _0x35bf58?{'count':_0x5b0ca3,'rows':_0x35bf58}:null;}})['then'](respondWithResult(_0x473b9a,null))['catch'](handleError(_0x473b9a,null));};exports[_0xcccd('0x11d')]=function(_0x458cf0,_0x4d49e9){var _0x2a7cdd=_0x458cf0['query']['online']===_0xcccd('0x11e')?_0xcccd('0x11f'):_0xcccd('0x120');return db[_0xcccd('0x44')]['find']({'attributes':['id',_0x2a7cdd],'where':{'id':_0x458cf0[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x4d49e9,null))[_0xcccd('0x16')](function(_0xfe9af7){if(_0xfe9af7){var _0x586935=_0xfe9af7[_0x2a7cdd];var _0x54a52c=_0x586935&&_0x586935[_0xcccd('0x121')]?_0x586935[_0xcccd('0x121')]:[];_0x4d49e9[_0xcccd('0x2f')]({'fromKey':_[_0xcccd('0x73')](_0x586935[_0xcccd('0x122')])?undefined:_0x586935[_0xcccd('0x122')],'count':_0x54a52c['length'],'rows':_0x54a52c});}})[_0xcccd('0x54')](handleError(_0x4d49e9,null));};exports[_0xcccd('0x123')]=function(_0x56c043,_0x51e279){var _0x214dda={'raw':![],'where':{}};var _0x3af2f4={};var _0x3e706a={'count':0x0,'rows':[]};return db[_0xcccd('0x44')][_0xcccd('0x5c')]({'where':{'id':_0x56c043[_0xcccd('0x56')]['id']}})['then'](handleEntityNotFound(_0x51e279,null))['then'](function(_0xb8fee){if(_0xb8fee){_0x3af2f4['model']=_[_0xcccd('0x4b')](db[_0xcccd('0x124')]['rawAttributes']);_0x3af2f4[_0xcccd('0x34')]=_[_0xcccd('0x4b')](_0x56c043['query']);_0x3af2f4[_0xcccd('0x35')]=_[_0xcccd('0x38')](_0x3af2f4['model'],_0x3af2f4[_0xcccd('0x34')]);_0x214dda[_0xcccd('0x37')]=_[_0xcccd('0x38')](_0x3af2f4[_0xcccd('0x36')],qs[_0xcccd('0x39')](_0x56c043['query']['fields']));_0x214dda[_0xcccd('0x37')]=_0x214dda[_0xcccd('0x37')]['length']?_0x214dda[_0xcccd('0x37')]:_0x3af2f4[_0xcccd('0x36')];if(!_0x56c043['query']['hasOwnProperty'](_0xcccd('0x3c'))){_0x214dda[_0xcccd('0x24')]=qs[_0xcccd('0x24')](_0x56c043[_0xcccd('0x34')][_0xcccd('0x24')]);_0x214dda[_0xcccd('0x26')]=qs['offset'](_0x56c043[_0xcccd('0x34')]['offset']);}_0x214dda[_0xcccd('0x3d')]=qs[_0xcccd('0x3e')](_0x56c043[_0xcccd('0x34')][_0xcccd('0x3e')]);_0x214dda[_0xcccd('0x3f')]=qs[_0xcccd('0x35')](_[_0xcccd('0x40')](_0x56c043[_0xcccd('0x34')],_0x3af2f4[_0xcccd('0x35')]));_0x214dda[_0xcccd('0x3f')]['ChatWebsiteId']=_0xb8fee['id'];if(_0x56c043[_0xcccd('0x34')][_0xcccd('0x41')]){_0x214dda[_0xcccd('0x3f')]=_[_0xcccd('0x4c')](_0x214dda['where'],{'$or':_[_0xcccd('0x31')](_0x214dda[_0xcccd('0x37')],function(_0x20033c){var _0x442824={};_0x442824[_0x20033c]={'$like':'%'+_0x56c043[_0xcccd('0x34')][_0xcccd('0x41')]+'%'};return _0x442824;})});}_0x214dda=_[_0xcccd('0x4c')]({},_0x214dda,_0x56c043[_0xcccd('0x43')]);return db[_0xcccd('0x124')][_0xcccd('0x25')]({'where':_0x214dda['where']})[_0xcccd('0x16')](function(_0x18cc3e){_0x3e706a['count']=_0x18cc3e;if(_0x56c043['query'][_0xcccd('0x45')]){_0x214dda[_0xcccd('0x46')]=[{'all':!![]}];}else{_0x214dda[_0xcccd('0x46')]=[{'model':db[_0xcccd('0x80')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0xcccd('0x125'),'required':![]}];}return db[_0xcccd('0x124')][_0xcccd('0x47')](_0x214dda);})['then'](function(_0x41ed4f){_0x3e706a[_0xcccd('0x48')]=_0x41ed4f;return _0x3e706a;});}})[_0xcccd('0x16')](respondWithFilteredResult(_0x51e279,_0x214dda))['catch'](handleError(_0x51e279,null));};exports[_0xcccd('0x126')]=function(_0x5c816d,_0x3b4b3e){return db[_0xcccd('0x44')][_0xcccd('0x4d')]({'where':{'id':_0x5c816d[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x3b4b3e,null))[_0xcccd('0x16')](function(_0x5696c8){if(_0x5696c8){return _0x5696c8[_0xcccd('0x126')](_0x5c816d[_0xcccd('0x57')]['ids'],_[_0xcccd('0xe8')](_0x5c816d[_0xcccd('0x57')],[_0xcccd('0xe7'),'id'])||{})[_0xcccd('0xaa')](function(_0x171e96){for(var _0x5b815e=0x0;_0x5b815e<_0x5c816d['body'][_0xcccd('0xe7')]['length'];_0x5b815e+=0x1){socket['emit'](_0xcccd('0x127'),{'UserId':Number(_0x5c816d[_0xcccd('0x57')]['ids'][_0x5b815e]),'ChatWebsiteId':Number(_0x5c816d[_0xcccd('0x56')]['id'])});}return _0x171e96;});}})['then'](respondWithResult(_0x3b4b3e,null))[_0xcccd('0x54')](handleError(_0x3b4b3e,null));};exports[_0xcccd('0x128')]=function(_0x4e2cf7,_0x38a38d){return db[_0xcccd('0x44')]['find']({'where':{'id':_0x4e2cf7[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x38a38d,null))[_0xcccd('0x16')](function(_0x447757){if(_0x447757){return _0x447757[_0xcccd('0x128')](_0x4e2cf7[_0xcccd('0x34')][_0xcccd('0xe7')])[_0xcccd('0x16')](function(){if(_['isArray'](_0x4e2cf7[_0xcccd('0x34')]['ids'])){for(var _0x5715d2=0x0;_0x5715d2<_0x4e2cf7[_0xcccd('0x34')][_0xcccd('0xe7')]['length'];_0x5715d2+=0x1){socket[_0xcccd('0x129')]('userChatWebsite:remove',{'UserId':Number(_0x4e2cf7['query'][_0xcccd('0xe7')][_0x5715d2]),'ChatWebsiteId':Number(_0x4e2cf7[_0xcccd('0x56')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x4e2cf7[_0xcccd('0x34')][_0xcccd('0xe7')]),'ChatWebsiteId':Number(_0x4e2cf7[_0xcccd('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x38a38d,null))['catch'](handleError(_0x38a38d,null));};exports[_0xcccd('0x12a')]=function(_0x4de05f,_0x5c914f){var _0x2e157d={};var _0x197990={};var _0x30133c;var _0x119749;return db[_0xcccd('0x44')][_0xcccd('0x5c')]({'where':{'id':_0x4de05f[_0xcccd('0x56')]['id']}})[_0xcccd('0x16')](handleEntityNotFound(_0x5c914f,null))[_0xcccd('0x16')](function(_0x319aca){if(_0x319aca){_0x30133c=_0x319aca;_0x197990[_0xcccd('0x36')]=_[_0xcccd('0x4b')](db[_0xcccd('0xeb')][_0xcccd('0x32')]);_0x197990[_0xcccd('0x34')]=_[_0xcccd('0x4b')](_0x4de05f[_0xcccd('0x34')]);_0x197990[_0xcccd('0x35')]=_['intersection'](_0x197990[_0xcccd('0x36')],_0x197990['query']);_0x2e157d[_0xcccd('0x37')]=_[_0xcccd('0x38')](_0x197990[_0xcccd('0x36')],qs['fields'](_0x4de05f[_0xcccd('0x34')]['fields']));_0x2e157d[_0xcccd('0x37')]=_0x2e157d[_0xcccd('0x37')][_0xcccd('0x3a')]?_0x2e157d[_0xcccd('0x37')]:_0x197990[_0xcccd('0x36')];_0x2e157d['order']=qs[_0xcccd('0x3e')](_0x4de05f[_0xcccd('0x34')][_0xcccd('0x3e')]);_0x2e157d[_0xcccd('0x3f')]=qs[_0xcccd('0x35')](_[_0xcccd('0x40')](_0x4de05f[_0xcccd('0x34')],_0x197990['filters']));if(_0x4de05f[_0xcccd('0x34')][_0xcccd('0x41')]){_0x2e157d[_0xcccd('0x3f')]=_['merge'](_0x2e157d[_0xcccd('0x3f')],{'$or':_[_0xcccd('0x31')](_0x2e157d[_0xcccd('0x37')],function(_0x2f7afd){var _0x55b200={};_0x55b200[_0x2f7afd]={'$like':'%'+_0x4de05f[_0xcccd('0x34')][_0xcccd('0x41')]+'%'};return _0x55b200;})});}_0x2e157d=_[_0xcccd('0x4c')]({},_0x2e157d,_0x4de05f['options']);return _0x30133c[_0xcccd('0x12a')](_0x2e157d);}})[_0xcccd('0x16')](function(_0x1485c5){if(_0x1485c5){_0x119749=_0x1485c5['length'];if(!_0x4de05f['query']['hasOwnProperty'](_0xcccd('0x3c'))){_0x2e157d[_0xcccd('0x24')]=qs[_0xcccd('0x24')](_0x4de05f[_0xcccd('0x34')][_0xcccd('0x24')]);_0x2e157d[_0xcccd('0x26')]=qs[_0xcccd('0x26')](_0x4de05f['query'][_0xcccd('0x26')]);}return _0x30133c[_0xcccd('0x12a')](_0x2e157d);}})[_0xcccd('0x16')](function(_0x45b79e){if(_0x45b79e){return _0x45b79e?{'count':_0x119749,'rows':_0x45b79e}:null;}})[_0xcccd('0x16')](respondWithResult(_0x5c914f,null))[_0xcccd('0x54')](handleError(_0x5c914f,null));};
\ No newline at end of file
+var _0x2427=['subjectOffline','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','getInteractions','Owner','fullname','internal','Tag','color','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','push','all','some','readFileSync','server/files/chat/iframe.ejs','connection','alignment','labelText','textColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','fs-extra','querystring','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','http','client','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','undefined','limit','count','set','json','update','destroy','get','UserProfileResource','stack','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','headers','user-agent','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','version','format','%s\x20%s','browser','unknown','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','interaction','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','offline','files','createdAt','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','utf8','render','toPairs','offlineMessageBody','fromString','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','originalname'];(function(_0x3045ab,_0x8248c1){var _0x2e71ec=function(_0x1965ff){while(--_0x1965ff){_0x3045ab['push'](_0x3045ab['shift']());}};_0x2e71ec(++_0x8248c1);}(_0x2427,0x165));var _0x7242=function(_0x67208e,_0x47d89f){_0x67208e=_0x67208e-0x0;var _0x213699=_0x2427[_0x67208e];return _0x213699;};'use strict';var BPromise=require(_0x7242('0x0'));var Mustache=require(_0x7242('0x1'));var util=require('util');var path=require(_0x7242('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7242('0x3'));var _=require('lodash');var querystring=require(_0x7242('0x4'));var Redis=require(_0x7242('0x5'));var qs=require(_0x7242('0x6'));var logger=require('../../config/logger')(_0x7242('0x7'));var config=require('../../config/environment');var db=require(_0x7242('0x8'))['db'];config[_0x7242('0x9')]=_[_0x7242('0xa')](config[_0x7242('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7242('0xb'))(new Redis(config[_0x7242('0x9')]));require('./chatWebsite.socket')[_0x7242('0xc')](socket);var htmlToText=require(_0x7242('0xd'));var jayson=require(_0x7242('0xe'));var client=jayson['client'][_0x7242('0xf')]({'port':0x232c});var client9002=jayson[_0x7242('0x10')][_0x7242('0xf')]({'port':0x232a});var client9003=jayson[_0x7242('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x7242('0x10')][_0x7242('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x4ea646,_0x2efc1e,_0x406138,_0x438ff5){return new BPromise(function(_0x51f95b,_0x4bd60d){var _0x25ed7a=_0x438ff5||client;return _0x25ed7a['request'](_0x4ea646,_0x406138)[_0x7242('0x11')](function(_0x375ca6){logger[_0x7242('0x12')](_0x7242('0x13'),_0x2efc1e,_0x7242('0x14'));logger[_0x7242('0x15')](_0x7242('0x16'),_0x2efc1e,'request\x20sent',JSON[_0x7242('0x17')](_0x375ca6));if(_0x375ca6['error']){if(_0x375ca6[_0x7242('0x18')][_0x7242('0x19')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2efc1e,_0x375ca6['error'][_0x7242('0x1a')]);return _0x4bd60d(_0x375ca6[_0x7242('0x18')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2efc1e,_0x375ca6[_0x7242('0x18')]['message']);return _0x51f95b(_0x375ca6[_0x7242('0x18')]['message']);}else{logger[_0x7242('0x12')](_0x7242('0x13'),_0x2efc1e,_0x7242('0x14'));_0x51f95b(_0x375ca6[_0x7242('0x1b')][_0x7242('0x1a')]);}})[_0x7242('0x1c')](function(_0x298495){logger['error'](_0x7242('0x13'),_0x2efc1e,_0x298495);_0x4bd60d(_0x298495);});});}function respondWithStatusCode(_0x36fc79,_0x14d113){_0x14d113=_0x14d113||0xcc;return function(_0x546be9){if(_0x546be9){return _0x36fc79[_0x7242('0x1d')](_0x14d113);}return _0x36fc79[_0x7242('0x1e')](_0x14d113)[_0x7242('0x1f')]();};}function respondWithResult(_0x28ea5d,_0x3bf221){_0x3bf221=_0x3bf221||0xc8;return function(_0x15c180){if(_0x15c180){return _0x28ea5d[_0x7242('0x1e')](_0x3bf221)['json'](_0x15c180);}};}function respondWithFilteredResult(_0x4ce2b2,_0x42ad68){return function(_0x41e5a5){if(_0x41e5a5){var _0x38854a=typeof _0x42ad68[_0x7242('0x20')]===_0x7242('0x21')&&typeof _0x42ad68[_0x7242('0x22')]===_0x7242('0x21');var _0x58da69=_0x41e5a5[_0x7242('0x23')];var _0xf28340=_0x38854a?0x0:_0x42ad68[_0x7242('0x20')];var _0x4bc615=_0x38854a?_0x41e5a5[_0x7242('0x23')]:_0x42ad68[_0x7242('0x20')]+_0x42ad68[_0x7242('0x22')];var _0x32ccf2;if(_0x4bc615>=_0x58da69){_0x4bc615=_0x58da69;_0x32ccf2=0xc8;}else{_0x32ccf2=0xce;}_0x4ce2b2[_0x7242('0x1e')](_0x32ccf2);return _0x4ce2b2[_0x7242('0x24')]('Content-Range',_0xf28340+'-'+_0x4bc615+'/'+_0x58da69)[_0x7242('0x25')](_0x41e5a5);}return null;};}function saveUpdates(_0x1657c6){return function(_0x3fe364){if(_0x3fe364){return _0x3fe364[_0x7242('0x26')](_0x1657c6)['then'](function(_0x13f986){return _0x13f986;});}return null;};}function removeEntity(_0x31adf5){return function(_0x3ac1df){if(_0x3ac1df){return _0x3ac1df[_0x7242('0x27')]()[_0x7242('0x11')](function(){var _0x59a014=_0x3ac1df[_0x7242('0x28')]({'plain':!![]});var _0x150a98='ChatWebsites';return db[_0x7242('0x29')][_0x7242('0x27')]({'where':{'type':_0x150a98,'resourceId':_0x59a014['id']}})[_0x7242('0x11')](function(){return _0x3ac1df;});})['then'](function(){_0x31adf5[_0x7242('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a85a8){return function(_0x30e6b9){if(!_0x30e6b9){_0x5a85a8['sendStatus'](0x194);}return _0x30e6b9;};}function handleError(_0x306057,_0x549b94){_0x549b94=_0x549b94||0x1f4;return function(_0x12b6f6){logger[_0x7242('0x18')](_0x12b6f6[_0x7242('0x2a')]);if(_0x12b6f6['name']){delete _0x12b6f6['name'];}_0x306057[_0x7242('0x1e')](_0x549b94)[_0x7242('0x2b')](_0x12b6f6);};}exports[_0x7242('0x2c')]=function(_0x164a6a,_0x424e3b){var _0x33279e={'include':[{'model':db['Pause'],'as':_0x7242('0x2d')}]},_0x5613fb={},_0x44a988={'count':0x0,'rows':[]};var _0x2cc7f8=_[_0x7242('0x2e')](db[_0x7242('0x2f')][_0x7242('0x30')],function(_0x57b3f6){return{'name':_0x57b3f6[_0x7242('0x31')],'type':_0x57b3f6[_0x7242('0x32')][_0x7242('0x33')]};});_0x5613fb[_0x7242('0x34')]=_[_0x7242('0x2e')](_0x2cc7f8,_0x7242('0x35'));_0x5613fb[_0x7242('0x36')]=_[_0x7242('0x37')](_0x164a6a[_0x7242('0x36')]);_0x5613fb['filters']=_[_0x7242('0x38')](_0x5613fb[_0x7242('0x34')],_0x5613fb[_0x7242('0x36')]);_0x33279e[_0x7242('0x39')]=_['intersection'](_0x5613fb['model'],qs[_0x7242('0x3a')](_0x164a6a['query'][_0x7242('0x3a')]));_0x33279e[_0x7242('0x39')]=_0x33279e['attributes'][_0x7242('0x3b')]?_0x33279e['attributes']:_0x5613fb[_0x7242('0x34')];if(!_0x164a6a['query'][_0x7242('0x3c')](_0x7242('0x3d'))){_0x33279e['limit']=qs[_0x7242('0x22')](_0x164a6a[_0x7242('0x36')][_0x7242('0x22')]);_0x33279e[_0x7242('0x20')]=qs[_0x7242('0x20')](_0x164a6a['query'][_0x7242('0x20')]);}_0x33279e['order']=qs[_0x7242('0x3e')](_0x164a6a[_0x7242('0x36')][_0x7242('0x3e')]);_0x33279e['where']=qs[_0x7242('0x3f')](_['pick'](_0x164a6a['query'],_0x5613fb[_0x7242('0x3f')]),_0x2cc7f8);if(_0x164a6a[_0x7242('0x36')]['filter']){_0x33279e['where']=_['merge'](_0x33279e[_0x7242('0x40')],{'$or':_[_0x7242('0x2e')](_0x2cc7f8,function(_0x574d87){if(_0x574d87[_0x7242('0x32')]!==_0x7242('0x41')){var _0x8bb267={};_0x8bb267[_0x574d87[_0x7242('0x35')]]={'$like':'%'+_0x164a6a[_0x7242('0x36')][_0x7242('0x42')]+'%'};return _0x8bb267;}})});}_0x33279e=_[_0x7242('0x43')]({},_0x33279e,_0x164a6a[_0x7242('0x44')]);var _0x3fa628={'where':_0x33279e[_0x7242('0x40')]};return db['ChatWebsite']['count'](_0x3fa628)[_0x7242('0x11')](function(_0x1a55bb){_0x44a988['count']=_0x1a55bb;if(_0x164a6a[_0x7242('0x36')][_0x7242('0x45')]){_0x33279e[_0x7242('0x46')]=[{'all':!![]}];}return db[_0x7242('0x2f')][_0x7242('0x47')](_0x33279e);})[_0x7242('0x11')](function(_0x25cfbc){_0x44a988[_0x7242('0x48')]=_0x25cfbc;return _0x44a988;})['then'](respondWithFilteredResult(_0x424e3b,_0x33279e))['catch'](handleError(_0x424e3b,null));};exports['show']=function(_0x41c4b8,_0x44b66f){var _0x5249c1={'raw':![],'where':{'id':_0x41c4b8[_0x7242('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x7242('0x2d')}]},_0x164511={};_0x164511[_0x7242('0x34')]=_[_0x7242('0x37')](db[_0x7242('0x2f')][_0x7242('0x30')]);_0x164511[_0x7242('0x36')]=_[_0x7242('0x37')](_0x41c4b8[_0x7242('0x36')]);_0x164511[_0x7242('0x3f')]=_['intersection'](_0x164511[_0x7242('0x34')],_0x164511[_0x7242('0x36')]);_0x5249c1[_0x7242('0x39')]=_[_0x7242('0x38')](_0x164511[_0x7242('0x34')],qs[_0x7242('0x3a')](_0x41c4b8['query']['fields']));_0x5249c1[_0x7242('0x39')]=_0x5249c1[_0x7242('0x39')][_0x7242('0x3b')]?_0x5249c1[_0x7242('0x39')]:_0x164511[_0x7242('0x34')];if(_0x41c4b8['query'][_0x7242('0x45')]){_0x5249c1[_0x7242('0x46')]=[{'all':!![]}];}_0x5249c1=_['merge']({},_0x5249c1,_0x41c4b8[_0x7242('0x44')]);return db[_0x7242('0x2f')][_0x7242('0x4a')](_0x5249c1)[_0x7242('0x11')](handleEntityNotFound(_0x44b66f,null))[_0x7242('0x11')](respondWithResult(_0x44b66f,null))[_0x7242('0x1c')](handleError(_0x44b66f,null));};exports['create']=function(_0x3559bf,_0xed538d){return db[_0x7242('0x2f')]['create'](_0x3559bf['body'],{})[_0x7242('0x11')](function(_0x3dbe76){var _0x389e9b=_0x3559bf[_0x7242('0x4b')][_0x7242('0x28')]({'plain':!![]});if(!_0x389e9b)throw new Error(_0x7242('0x4c'));if(_0x389e9b[_0x7242('0x4d')]===_0x7242('0x4b')){var _0x17cbe0=_0x3dbe76['get']({'plain':!![]});var _0x2747d6=_0x7242('0x4e');return db[_0x7242('0x4f')][_0x7242('0x4a')]({'where':{'name':_0x2747d6,'userProfileId':_0x389e9b[_0x7242('0x50')]},'raw':!![]})[_0x7242('0x11')](function(_0xff34c3){if(_0xff34c3&&_0xff34c3[_0x7242('0x51')]===0x0){return db[_0x7242('0x29')][_0x7242('0x52')]({'name':_0x17cbe0[_0x7242('0x35')],'resourceId':_0x17cbe0['id'],'type':_0xff34c3[_0x7242('0x35')],'sectionId':_0xff34c3['id']},{})[_0x7242('0x11')](function(){return _0x3dbe76;});}else{return _0x3dbe76;}})[_0x7242('0x1c')](function(_0x56db4c){logger[_0x7242('0x18')](_0x7242('0x53'),_0x56db4c);throw _0x56db4c;});}return _0x3dbe76;})[_0x7242('0x11')](respondWithResult(_0xed538d,0xc9))[_0x7242('0x1c')](handleError(_0xed538d,null));};exports[_0x7242('0x26')]=function(_0x1fd58e,_0x4e7f30){if(_0x1fd58e[_0x7242('0x54')]['id']){delete _0x1fd58e[_0x7242('0x54')]['id'];}return db['ChatWebsite'][_0x7242('0x4a')]({'where':{'id':_0x1fd58e[_0x7242('0x49')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4e7f30,null))['then'](saveUpdates(_0x1fd58e[_0x7242('0x54')],null))[_0x7242('0x11')](respondWithResult(_0x4e7f30,null))['catch'](handleError(_0x4e7f30,null));};exports[_0x7242('0x27')]=function(_0x3d399d,_0x10bae6){return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x3d399d[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x10bae6,null))['then'](removeEntity(_0x10bae6,null))['catch'](handleError(_0x10bae6,null));};exports[_0x7242('0x55')]=function(_0x48661b,_0x181ad3){return db[_0x7242('0x2f')][_0x7242('0x55')]()[_0x7242('0x11')](respondWithResult(_0x181ad3,null))[_0x7242('0x1c')](handleError(_0x181ad3,null));};exports[_0x7242('0x56')]=function(_0x50fce2,_0x21f8ae){if(_0x50fce2[_0x7242('0x54')]['id']){delete _0x50fce2[_0x7242('0x54')]['id'];}return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x50fce2['params']['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x21f8ae,null))[_0x7242('0x11')](function(_0x230766){if(_0x230766){_0x50fce2[_0x7242('0x54')][_0x7242('0x57')]=_0x230766['id'];return db[_0x7242('0x58')]['create'](_0x50fce2[_0x7242('0x54')]);}})['then'](respondWithResult(_0x21f8ae,null))[_0x7242('0x1c')](handleError(_0x21f8ae,null));};exports[_0x7242('0x59')]=function(_0x18a230,_0x2bff51){var _0x4fb312={'raw':![],'where':{}};var _0x51cc1a={};var _0x99c33e={'count':0x0,'rows':[]};return db[_0x7242('0x2f')][_0x7242('0x5a')]({'where':{'id':_0x18a230[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x2bff51,null))[_0x7242('0x11')](function(_0x48cbdb){if(_0x48cbdb){_0x51cc1a[_0x7242('0x34')]=_[_0x7242('0x37')](db[_0x7242('0x58')][_0x7242('0x30')]);_0x51cc1a['query']=_[_0x7242('0x37')](_0x18a230['query']);_0x51cc1a[_0x7242('0x3f')]=_['intersection'](_0x51cc1a[_0x7242('0x34')],_0x51cc1a[_0x7242('0x36')]);_0x4fb312[_0x7242('0x39')]=_[_0x7242('0x38')](_0x51cc1a[_0x7242('0x34')],qs[_0x7242('0x3a')](_0x18a230[_0x7242('0x36')][_0x7242('0x3a')]));_0x4fb312[_0x7242('0x39')]=_0x4fb312[_0x7242('0x39')][_0x7242('0x3b')]?_0x4fb312[_0x7242('0x39')]:_0x51cc1a[_0x7242('0x34')];if(!_0x18a230['query'][_0x7242('0x3c')](_0x7242('0x3d'))){_0x4fb312[_0x7242('0x22')]=qs[_0x7242('0x22')](_0x18a230[_0x7242('0x36')]['limit']);_0x4fb312[_0x7242('0x20')]=qs[_0x7242('0x20')](_0x18a230[_0x7242('0x36')][_0x7242('0x20')]);}_0x4fb312[_0x7242('0x5b')]=qs[_0x7242('0x3e')](_0x18a230[_0x7242('0x36')]['sort']);_0x4fb312['where']=qs[_0x7242('0x3f')](_[_0x7242('0x5c')](_0x18a230['query'],_0x51cc1a[_0x7242('0x3f')]));_0x4fb312[_0x7242('0x40')][_0x7242('0x57')]=_0x48cbdb['id'];if(_0x18a230[_0x7242('0x36')][_0x7242('0x42')]){_0x4fb312[_0x7242('0x40')]=_['merge'](_0x4fb312[_0x7242('0x40')],{'$or':_[_0x7242('0x2e')](_0x4fb312['attributes'],function(_0x3700f3){var _0x20fd7d={};_0x20fd7d[_0x3700f3]={'$like':'%'+_0x18a230[_0x7242('0x36')][_0x7242('0x42')]+'%'};return _0x20fd7d;})});}_0x4fb312=_[_0x7242('0x43')]({},_0x4fb312,_0x18a230['options']);return db[_0x7242('0x58')][_0x7242('0x23')]({'where':_0x4fb312['where']})[_0x7242('0x11')](function(_0x135738){_0x99c33e[_0x7242('0x23')]=_0x135738;if(_0x18a230['query'][_0x7242('0x45')]){_0x4fb312[_0x7242('0x46')]=[{'all':!![]}];}return db[_0x7242('0x58')]['findAll'](_0x4fb312);})[_0x7242('0x11')](function(_0x457365){_0x99c33e[_0x7242('0x48')]=_0x457365;return _0x99c33e;});}})[_0x7242('0x11')](respondWithFilteredResult(_0x2bff51,_0x4fb312))[_0x7242('0x1c')](handleError(_0x2bff51,null));};exports[_0x7242('0x5d')]=function(_0x19df97,_0x2f67d0){return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x19df97['params']['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x2f67d0,null))['then'](function(_0x17121e){if(_0x17121e){return _0x17121e[_0x7242('0x5d')](_0x19df97['query'][_0x7242('0x5e')]);}})['then'](respondWithStatusCode(_0x2f67d0,null))[_0x7242('0x1c')](handleError(_0x2f67d0,null));};exports[_0x7242('0x5f')]=function(_0x58c3ea,_0x4b510f){if(_0x58c3ea[_0x7242('0x54')]['id']){delete _0x58c3ea[_0x7242('0x54')]['id'];}return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x58c3ea[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x4b510f,null))[_0x7242('0x11')](function(_0x8ed7a9){if(_0x8ed7a9){_0x58c3ea[_0x7242('0x54')][_0x7242('0x57')]=_0x8ed7a9['id'];return db[_0x7242('0x60')][_0x7242('0x52')](_0x58c3ea['body']);}})[_0x7242('0x11')](respondWithResult(_0x4b510f,null))[_0x7242('0x1c')](handleError(_0x4b510f,null));};exports['getAnswers']=function(_0x164892,_0x97545c){var _0x4b57a7={'raw':![],'where':{}};var _0x109e5c={};var _0x87d666={'count':0x0,'rows':[]};return db[_0x7242('0x2f')]['findOne']({'where':{'id':_0x164892['params']['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x97545c,null))[_0x7242('0x11')](function(_0x2098ee){if(_0x2098ee){_0x109e5c[_0x7242('0x34')]=_[_0x7242('0x37')](db[_0x7242('0x60')][_0x7242('0x30')]);_0x109e5c[_0x7242('0x36')]=_[_0x7242('0x37')](_0x164892[_0x7242('0x36')]);_0x109e5c[_0x7242('0x3f')]=_[_0x7242('0x38')](_0x109e5c[_0x7242('0x34')],_0x109e5c[_0x7242('0x36')]);_0x4b57a7[_0x7242('0x39')]=_[_0x7242('0x38')](_0x109e5c['model'],qs[_0x7242('0x3a')](_0x164892[_0x7242('0x36')][_0x7242('0x3a')]));_0x4b57a7['attributes']=_0x4b57a7[_0x7242('0x39')][_0x7242('0x3b')]?_0x4b57a7['attributes']:_0x109e5c[_0x7242('0x34')];if(!_0x164892[_0x7242('0x36')][_0x7242('0x3c')](_0x7242('0x3d'))){_0x4b57a7['limit']=qs[_0x7242('0x22')](_0x164892[_0x7242('0x36')][_0x7242('0x22')]);_0x4b57a7[_0x7242('0x20')]=qs['offset'](_0x164892['query'][_0x7242('0x20')]);}_0x4b57a7['order']=qs[_0x7242('0x3e')](_0x164892[_0x7242('0x36')][_0x7242('0x3e')]);_0x4b57a7[_0x7242('0x40')]=qs['filters'](_[_0x7242('0x5c')](_0x164892[_0x7242('0x36')],_0x109e5c[_0x7242('0x3f')]));_0x4b57a7[_0x7242('0x40')]['ChatWebsiteId']=_0x2098ee['id'];if(_0x164892[_0x7242('0x36')][_0x7242('0x42')]){_0x4b57a7['where']=_[_0x7242('0x43')](_0x4b57a7[_0x7242('0x40')],{'$or':_[_0x7242('0x2e')](_0x4b57a7['attributes'],function(_0x1b060e){var _0x52f468={};_0x52f468[_0x1b060e]={'$like':'%'+_0x164892[_0x7242('0x36')][_0x7242('0x42')]+'%'};return _0x52f468;})});}_0x4b57a7=_[_0x7242('0x43')]({},_0x4b57a7,_0x164892[_0x7242('0x44')]);return db[_0x7242('0x60')][_0x7242('0x23')]({'where':_0x4b57a7[_0x7242('0x40')]})[_0x7242('0x11')](function(_0x123842){_0x87d666[_0x7242('0x23')]=_0x123842;if(_0x164892[_0x7242('0x36')][_0x7242('0x45')]){_0x4b57a7[_0x7242('0x46')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7242('0x47')](_0x4b57a7);})['then'](function(_0x39e512){_0x87d666[_0x7242('0x48')]=_0x39e512;return _0x87d666;});}})[_0x7242('0x11')](respondWithFilteredResult(_0x97545c,_0x4b57a7))[_0x7242('0x1c')](handleError(_0x97545c,null));};exports[_0x7242('0x61')]=function(_0x2221e6,_0x2f81e2){return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x2221e6[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x2f81e2,null))[_0x7242('0x11')](function(_0xe3d30b){if(_0xe3d30b){return _0xe3d30b[_0x7242('0x61')](_0x2221e6[_0x7242('0x36')][_0x7242('0x5e')]);}})[_0x7242('0x11')](respondWithStatusCode(_0x2f81e2,null))[_0x7242('0x1c')](handleError(_0x2f81e2,null));};exports[_0x7242('0x62')]=function(_0x247431,_0x3c77af){_0x247431['body']['sitepic']=_0x247431[_0x7242('0x63')][_0x7242('0x64')];return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x247431['params']['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x3c77af,null))[_0x7242('0x11')](saveUpdates(_0x247431['body'],null))[_0x7242('0x11')](respondWithResult(_0x3c77af,null))[_0x7242('0x1c')](handleError(_0x3c77af,null));};exports[_0x7242('0x65')]=function(_0x4fe905,_0x50660b){_0x4fe905[_0x7242('0x54')][_0x7242('0x66')]=_0x4fe905[_0x7242('0x63')]['filename'];return db[_0x7242('0x2f')]['find']({'where':{'id':_0x4fe905[_0x7242('0x49')]['id']}})['then'](handleEntityNotFound(_0x50660b,null))[_0x7242('0x11')](saveUpdates(_0x4fe905[_0x7242('0x54')],null))[_0x7242('0x11')](respondWithResult(_0x50660b,null))[_0x7242('0x1c')](handleError(_0x50660b,null));};exports['addCustomerAvatar']=function(_0x1483c9,_0x46a727){_0x1483c9[_0x7242('0x54')][_0x7242('0x67')]=_0x1483c9[_0x7242('0x63')]['filename'];return db[_0x7242('0x2f')]['find']({'where':{'id':_0x1483c9['params']['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x46a727,null))[_0x7242('0x11')](saveUpdates(_0x1483c9[_0x7242('0x54')],null))['then'](respondWithResult(_0x46a727,null))[_0x7242('0x1c')](handleError(_0x46a727,null));};exports[_0x7242('0x68')]=function(_0x1d9b14,_0x151943){_0x1d9b14[_0x7242('0x54')]['systemAvatar']=_0x1d9b14[_0x7242('0x63')][_0x7242('0x64')];return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x1d9b14[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x151943,null))[_0x7242('0x11')](saveUpdates(_0x1d9b14[_0x7242('0x54')],null))['then'](respondWithResult(_0x151943,null))[_0x7242('0x1c')](handleError(_0x151943,null));};exports[_0x7242('0x69')]=function(_0x904d4,_0x9a4c01){var _0x1a06c5=path[_0x7242('0x6a')](config[_0x7242('0x6b')],_0x7242('0x6c'));var _0x23a42a={'where':{'id':_0x904d4['params']['id']},'attributes':['id',_0x7242('0x6d')],'raw':!![]};var _0x23cc45=![];return require(_0x7242('0x6e'))[_0x7242('0x6f')]()['then'](function(_0x43a177){if(_0x43a177){_0x23cc45=_0x43a177[_0x7242('0x70')];}})[_0x7242('0x11')](function(){return db[_0x7242('0x2f')]['find'](_0x23a42a);})[_0x7242('0x11')](handleEntityNotFound(_0x9a4c01,null))[_0x7242('0x11')](function(_0x36cdbb){if(_0x36cdbb){if(!_[_0x7242('0x71')](_0x36cdbb[_0x7242('0x6d')])){if(fs[_0x7242('0x72')](path['join'](config[_0x7242('0x6b')],'server/files/images/logos/',_0x36cdbb[_0x7242('0x6d')]))&&_0x23cc45){_0x1a06c5=path[_0x7242('0x6a')](config[_0x7242('0x6b')],_0x7242('0x73'),_0x36cdbb['sitepic']);}}return _0x9a4c01[_0x7242('0x74')](_0x1a06c5);}})[_0x7242('0x1c')](handleError(_0x9a4c01,null));};exports[_0x7242('0x75')]=function(_0x34b0bf,_0x125146){var _0x234a98=path['join'](config['root'],_0x7242('0x76'));var _0x1a5d24={'where':{'id':_0x34b0bf[_0x7242('0x49')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7242('0x2f')][_0x7242('0x4a')](_0x1a5d24)[_0x7242('0x11')](handleEntityNotFound(_0x125146,null))[_0x7242('0x11')](function(_0x1f98b8){if(_0x1f98b8){if(!_[_0x7242('0x71')](_0x1f98b8[_0x7242('0x66')])){if(fs[_0x7242('0x72')](path[_0x7242('0x6a')](config['root'],_0x7242('0x77'),_0x1f98b8['agentAvatar']))){_0x234a98=path[_0x7242('0x6a')](config[_0x7242('0x6b')],_0x7242('0x77'),_0x1f98b8[_0x7242('0x66')]);}}return _0x125146[_0x7242('0x74')](_0x234a98);}})[_0x7242('0x1c')](handleError(_0x125146,null));};exports['getCustomerAvatar']=function(_0x29dbeb,_0x49aee6){var _0x13768e=path['join'](config[_0x7242('0x6b')],_0x7242('0x78'));var _0x1ea4d9={'where':{'id':_0x29dbeb['params']['id']},'attributes':['id',_0x7242('0x67'),_0x7242('0x79')],'raw':!![]};return db['ChatWebsite'][_0x7242('0x4a')](_0x1ea4d9)[_0x7242('0x11')](handleEntityNotFound(_0x49aee6,null))[_0x7242('0x11')](function(_0x36ea3f){if(_0x36ea3f){if(!_[_0x7242('0x71')](_0x36ea3f[_0x7242('0x67')])){if(fs[_0x7242('0x72')](path[_0x7242('0x6a')](config[_0x7242('0x6b')],_0x7242('0x77'),_0x36ea3f[_0x7242('0x67')]))&&_0x36ea3f[_0x7242('0x79')]){_0x13768e=path[_0x7242('0x6a')](config['root'],_0x7242('0x77'),_0x36ea3f['customerAvatar']);}}return _0x49aee6[_0x7242('0x74')](_0x13768e);}})['catch'](handleError(_0x49aee6,null));};exports[_0x7242('0x7a')]=function(_0x5c073f,_0x58ebbc){var _0x1705b7=path[_0x7242('0x6a')](config['root'],_0x7242('0x7b'));var _0x5a9ae1={'where':{'id':_0x5c073f[_0x7242('0x49')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x7242('0x2f')]['find'](_0x5a9ae1)[_0x7242('0x11')](handleEntityNotFound(_0x58ebbc,null))['then'](function(_0x37d99f){if(_0x37d99f){if(!_[_0x7242('0x71')](_0x37d99f[_0x7242('0x7c')])){if(fs[_0x7242('0x72')](path['join'](config[_0x7242('0x6b')],_0x7242('0x77'),_0x37d99f[_0x7242('0x7c')]))){_0x1705b7=path[_0x7242('0x6a')](config[_0x7242('0x6b')],_0x7242('0x77'),_0x37d99f['systemAvatar']);}}return _0x58ebbc['download'](_0x1705b7);}})['catch'](handleError(_0x58ebbc,null));};exports[_0x7242('0x7d')]=function(_0x490efc,_0x58828f){var _0x4a9723=require(_0x7242('0x7e'));var _0x59f7b3=new _0x4a9723();var _0x543bb3=_0x59f7b3['setUA'](_0x490efc[_0x7242('0x7f')][_0x7242('0x80')])['getResult']();var _0x5c4f86={'body':_0x490efc[_0x7242('0x54')],'channel':'chat'};var _0x39eb5f=[];var _0x44ec7e=[];var _0x3f2496={};var _0x41a4aa=![];return db[_0x7242('0x81')][_0x7242('0x55')]()['then'](function(_0x36df70){if(!_0x36df70){throw new db['Sequelize'][(_0x7242('0x82'))](_0x7242('0x83'));}_0x39eb5f=_[_0x7242('0x84')](_[_0x7242('0x37')](_0x36df70),['createdAt',_0x7242('0x85')]);_0x44ec7e=_[_0x7242('0x84')](_[_0x7242('0x37')](_0x36df70),['createdAt','updatedAt',_0x7242('0x86'),'ListId']);if(_0x490efc[_0x7242('0x54')]['id']){delete _0x490efc[_0x7242('0x54')]['id'];}if(_[_0x7242('0x71')](_0x490efc[_0x7242('0x54')][_0x7242('0x87')])){throw new db[(_0x7242('0x88'))][(_0x7242('0x82'))](_0x7242('0x89'));}if(_[_0x7242('0x71')](_0x490efc[_0x7242('0x54')][_0x7242('0x54')])||_0x490efc[_0x7242('0x54')]['body']===''){throw new db['Sequelize'][(_0x7242('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7242('0x71')](_0x490efc['body'][_0x7242('0x8a')])){throw new db[(_0x7242('0x88'))][(_0x7242('0x82'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44ec7e);}if(!_[_0x7242('0x8b')](_0x44ec7e,_0x490efc[_0x7242('0x54')][_0x7242('0x8a')])){throw new db[(_0x7242('0x88'))][(_0x7242('0x82'))](_0x7242('0x8c')+_0x44ec7e);}_0x3f2496[_0x490efc['body'][_0x7242('0x8a')]]=_0x490efc['body'][_0x7242('0x87')];})[_0x7242('0x11')](function(){return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x490efc['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x7242('0x8d'),'where':_0x3f2496,'limit':0x1,'order':[[_0x7242('0x85'),_0x7242('0x8e')]]}]},{'model':db[_0x7242('0x8f')],'as':_0x7242('0x90')}]});})[_0x7242('0x11')](handleEntityNotFound(_0x58828f,null))[_0x7242('0x11')](function(_0x42aa6b){if(_0x42aa6b&&_0x42aa6b[_0x7242('0x91')]){_0x5c4f86[_0x7242('0x92')]=_0x42aa6b;_0x5c4f86[_0x7242('0x93')]=_0x42aa6b[_0x7242('0x90')];_0x5c4f86[_0x7242('0x94')]=_0x42aa6b['List'];_0x5c4f86[_0x7242('0x93')]=_[_0x7242('0x95')](_0x5c4f86[_0x7242('0x93')],['priority'],[_0x7242('0x96')]);if(_0x5c4f86[_0x7242('0x92')][_0x7242('0x90')]){delete _0x5c4f86[_0x7242('0x92')]['Applications'];}if(_0x5c4f86[_0x7242('0x92')][_0x7242('0x91')]&&_0x5c4f86[_0x7242('0x92')][_0x7242('0x91')][_0x7242('0x8d')][_0x7242('0x3b')]){return _0x5c4f86[_0x7242('0x92')][_0x7242('0x91')][_0x7242('0x8d')][0x0];}var _0x16c944=_[_0x7242('0xa')](_0x490efc[_0x7242('0x54')],{'firstName':_0x490efc[_0x7242('0x54')][_0x7242('0x87')],'ListId':_0x42aa6b['ListId']});_0x16c944[_0x490efc[_0x7242('0x54')][_0x7242('0x8a')]]=_0x490efc[_0x7242('0x54')][_0x7242('0x87')];return db['CmContact'][_0x7242('0x52')](_0x16c944,{'fields':_0x39eb5f,'raw':!![]});}})['then'](handleEntityNotFound(_0x58828f,null))[_0x7242('0x11')](function(_0x125371){_0x5c4f86[_0x7242('0x97')]=_0x125371;var _0x5dd3d5=_0x490efc[_0x7242('0x54')][_0x7242('0x98')];if(_0x490efc[_0x7242('0x7f')][_0x7242('0x99')]){_0x5dd3d5=_0x490efc['headers'][_0x7242('0x99')];}else if(_0x490efc[_0x7242('0x7f')][_0x7242('0x9a')]){_0x5dd3d5=_[_0x7242('0x9b')](_0x490efc[_0x7242('0x7f')][_0x7242('0x9a')]['split'](','));}if(_0x125371){var _0x5f286c={'ContactId':_0x125371['id'],'ChatWebsiteId':_0x490efc['params']['id'],'from':(_0x125371[_0x7242('0x9c')]||'')+'\x20'+(_0x125371['lastName']||''),'customerIp':_0x5dd3d5,'customerPort':_0x490efc[_0x7242('0x7f')][_0x7242('0x9d')]?_0x490efc['headers'][_0x7242('0x9d')]:null,'referer':_0x490efc[_0x7242('0x54')][_0x7242('0x9e')],'browserName':_0x543bb3['browser'][_0x7242('0x35')]&&_0x543bb3['browser'][_0x7242('0x9f')]?util[_0x7242('0xa0')](_0x7242('0xa1'),_0x543bb3[_0x7242('0xa2')][_0x7242('0x35')],_0x543bb3[_0x7242('0xa2')][_0x7242('0x9f')]):_0x7242('0xa3'),'browserVersion':_0x543bb3[_0x7242('0xa2')][_0x7242('0x9f')]||'unknown','osName':util[_0x7242('0xa0')]('%s\x20%s',_0x543bb3['os']['name'],_0x543bb3['os'][_0x7242('0x9f')]),'osVersion':_0x543bb3['os'][_0x7242('0x9f')],'deviceModel':_0x543bb3[_0x7242('0xa4')][_0x7242('0x34')]&&_0x543bb3[_0x7242('0xa4')]['vendor']?util[_0x7242('0xa0')](_0x7242('0xa5'),_0x543bb3[_0x7242('0xa4')][_0x7242('0x34')],_0x543bb3[_0x7242('0xa4')]['vendor'],_0x543bb3[_0x7242('0xa4')][_0x7242('0x32')]):null,'deviceVendor':_0x543bb3[_0x7242('0xa4')][_0x7242('0xa6')],'deviceType':_0x543bb3[_0x7242('0xa4')][_0x7242('0x32')],'formData':JSON[_0x7242('0x17')](_0x490efc[_0x7242('0x54')])};var _0x59d1a4={'ChatWebsiteId':_0x490efc[_0x7242('0x49')]['id'],'closed':![]};if(_0x490efc[_0x7242('0x54')][_0x7242('0xa7')]){_0x59d1a4[_0x7242('0xa7')]=_0x490efc[_0x7242('0x54')][_0x7242('0xa7')];return db['ChatInteraction'][_0x7242('0x4a')]({'where':_0x59d1a4})['then'](function(_0x1ff180){if(_0x1ff180){return[_0x1ff180,![]];}_0x5f286c[_0x7242('0xa7')]=_0x490efc['body'][_0x7242('0xa7')];_0x5f286c[_0x7242('0xa8')]=_0x490efc['body']['externalUrl'];return db[_0x7242('0xa9')][_0x7242('0x52')](_0x5f286c)['then'](function(_0x209ed1){return[_0x209ed1,!![]];});});}_0x59d1a4['ContactId']=_0x125371['id'];if(_0x490efc[_0x7242('0x54')][_0x7242('0xaa')]&&_0x490efc[_0x7242('0x54')][_0x7242('0xaa')]['id']){_0x59d1a4['id']=_0x490efc['body'][_0x7242('0xaa')]['id'];return db['ChatInteraction']['find']({'where':_0x59d1a4})[_0x7242('0x11')](function(_0x17f0c){if(_0x17f0c){return[_0x17f0c,![]];}return db['ChatInteraction'][_0x7242('0x52')](_0x5f286c)[_0x7242('0x11')](function(_0x520337){return[_0x520337,!![]];});});}return db[_0x7242('0xa9')][_0x7242('0x52')](_0x5f286c)[_0x7242('0x11')](function(_0x3f8b5b){return[_0x3f8b5b,!![]];});}})['spread'](function(_0x12e27e,_0x2f3174){if(_0x12e27e){_0x41a4aa=_0x2f3174;if(!_0x2f3174){var _0x4d80ff={'from':(_0x5c4f86[_0x7242('0x97')][_0x7242('0x9c')]||'')+'\x20'+(_0x5c4f86[_0x7242('0x97')][_0x7242('0xab')]||'')};if(_0x490efc['body'][_0x7242('0xa7')]&&_0x490efc[_0x7242('0x54')]['messageId']&&_0x490efc['body'][_0x7242('0xa7')]!=_0x490efc['body'][_0x7242('0xac')]){_0x4d80ff[_0x7242('0xa7')]=_0x490efc[_0x7242('0x54')]['messageId'];}return _0x12e27e[_0x7242('0x26')](_0x4d80ff);}else{return _0x12e27e;}}})[_0x7242('0x11')](function(_0x4ab1fc){_0x5c4f86[_0x7242('0xaa')]=_0x4ab1fc[_0x7242('0x28')]({'plain':!![]});_0x5c4f86['interaction'][_0x7242('0xad')]=_0x41a4aa;if(_0x5c4f86[_0x7242('0xaa')][_0x7242('0xad')]){if(_0x5c4f86['account'][_0x7242('0xae')]){_0x5c4f86[_0x7242('0x93')]['push']({'id':0x0,'priority':_0x5c4f86[_0x7242('0x93')][_0x7242('0x3b')]+0x1,'app':_0x7242('0xaf'),'appdata':_0x7242('0xb0'),'interval':_0x7242('0xb1')});}}return db['ChatMessage'][_0x7242('0x52')]({'body':_0x490efc[_0x7242('0x54')][_0x7242('0x54')],'ChatWebsiteId':_0x490efc[_0x7242('0x49')]['id'],'ChatInteractionId':_0x4ab1fc['id'],'direction':'in','ContactId':_0x5c4f86[_0x7242('0x97')]['id'],'AttachmentId':_0x490efc[_0x7242('0x54')]['AttachmentId']});})[_0x7242('0x11')](function(_0x4cf2fc){_0x5c4f86[_0x7242('0x1a')]=_0x4cf2fc;if(_0x5c4f86['interaction'][_0x7242('0xb2')]){return db[_0x7242('0xb3')]['find']({'attributes':['id',_0x7242('0x35')],'where':{'id':_0x5c4f86[_0x7242('0xaa')]['UserId']}})['then'](function(_0x2ab6f6){if(_0x2ab6f6){_0x5c4f86[_0x7242('0x93')][_0x7242('0xb4')]({'id':0x0,'priority':0x0,'app':_0x7242('0xb5'),'appdata':_0x2ab6f6['name']+','+(_0x5c4f86['account'][_0x7242('0xb6')]||0xa),'interval':_0x7242('0xb1')});_0x5c4f86[_0x7242('0xb7')]=!![];}return respondWithRpcPromise(_0x7242('0xb8'),_0x7242('0xb9'),_0x5c4f86);});}return respondWithRpcPromise(_0x7242('0xb8'),'startRouting',_0x5c4f86);})[_0x7242('0x11')](function(_0x139d55){respondWithRpcPromise('EventManager','EventManager',{'event':_0x7242('0x7d'),'message':_0x139d55},client9002);return _0x139d55;})[_0x7242('0x11')](respondWithResult(_0x58828f,null))['catch'](handleError(_0x58828f,null));};exports[_0x7242('0xba')]=function(_0x549328,_0x3dc97b){var _0x254e3d,_0xea25ff,_0x4d42ac;var _0x423a31=[];var _0x3de7d8={};var _0x1038d2=_0x549328[_0x7242('0xbb')]||[];var _0x3d01ee=[];var _0x77ce4b;return db[_0x7242('0x81')][_0x7242('0x55')]()[_0x7242('0x11')](function(_0x27e88a){if(!_0x27e88a){throw new db['Sequelize'][(_0x7242('0x82'))](_0x7242('0x83'));}_0x423a31=_[_0x7242('0x84')](_['keys'](_0x27e88a),[_0x7242('0xbc'),'updatedAt',_0x7242('0x86'),'ListId']);if(_0x549328[_0x7242('0x54')]['id']){delete _0x549328[_0x7242('0x54')]['id'];}if(_[_0x7242('0x71')](_0x549328[_0x7242('0x54')][_0x7242('0x87')])){throw _0x3dc97b[_0x7242('0x1e')](0x1f4)[_0x7242('0x2b')](new db[(_0x7242('0x88'))][(_0x7242('0x82'))](_0x7242('0x89')));}if(_[_0x7242('0x71')](_0x549328[_0x7242('0x54')][_0x7242('0x54')])||_0x549328[_0x7242('0x54')][_0x7242('0x54')]===''){throw _0x3dc97b[_0x7242('0x1e')](0x1f4)[_0x7242('0x2b')](new db[(_0x7242('0x88'))][(_0x7242('0x82'))](_0x7242('0xbd')));}if(_[_0x7242('0x71')](_0x549328[_0x7242('0x54')]['mapKeyOffline'])){throw _0x3dc97b[_0x7242('0x1e')](0x1f4)[_0x7242('0x2b')](new db[(_0x7242('0x88'))]['ValidationError'](_0x7242('0xbe')+_0x423a31));}if(!_[_0x7242('0x8b')](_0x423a31,_0x549328[_0x7242('0x54')]['mapKeyOffline'])){throw _0x3dc97b[_0x7242('0x1e')](0x1f4)[_0x7242('0x2b')](new db[(_0x7242('0x88'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x423a31));}_0x3de7d8[_0x549328[_0x7242('0x54')][_0x7242('0xbf')]]=_0x549328[_0x7242('0x54')][_0x7242('0x87')];})[_0x7242('0x11')](function(){return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x549328['params']['id']},'include':[{'model':db[_0x7242('0xc0')],'as':_0x7242('0x91')},{'model':db[_0x7242('0xc1')],'as':_0x7242('0xc1')}]});})[_0x7242('0x11')](handleEntityNotFound(_0x3dc97b,null))['then'](function(_0x41687d){if(_0x41687d&&_0x41687d['List']){_0xea25ff=_0x41687d;var _0x36c39a=_[_0x7242('0xa')](_0x549328[_0x7242('0x54')],{'firstName':_0x549328[_0x7242('0x54')][_0x7242('0x87')],'phone':_0x549328[_0x7242('0x54')]['from'],'ListId':_0x41687d['ListId']});_0x36c39a[_0x549328[_0x7242('0x54')][_0x7242('0xbf')]]=_0x549328[_0x7242('0x54')][_0x7242('0x87')];return db['CmContact'][_0x7242('0xc2')]({'where':_0x3de7d8,'defaults':_0x36c39a});}})['spread'](function(_0x43c12e){if(_0x43c12e){_0x4d42ac=_0x43c12e;var _0xf826e8=fs['readFileSync'](path[_0x7242('0x6a')](config[_0x7242('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),_0x7242('0xc3'));var _0x22fec8=ejs[_0x7242('0xc4')](_0xf826e8,{'body':_[_0x7242('0xc5')](_0x549328[_0x7242('0x54')][_0x7242('0x54')]),'bodyTitle':_0xea25ff[_0x7242('0xc6')]});return db['ChatOfflineMessage'][_0x7242('0x52')]({'body':_0x22fec8,'plainBody':htmlToText[_0x7242('0xc7')](_0x22fec8),'ContactId':_0x43c12e['id'],'ChatWebsiteId':_0xea25ff['id']});}})[_0x7242('0x11')](function(_0x3953c7){_0x77ce4b=_0x3953c7;if(_0x1038d2[_0x7242('0x3b')]){var _0x12bd46=_0x1038d2[_0x7242('0x2e')](function(_0x4fc83f){return{'name':_0x4fc83f['originalname'],'basename':_0x4fc83f['filename'],'type':_0x4fc83f[_0x7242('0xc8')],'ChatOfflineMessageId':_0x3953c7['id']};});_0x3d01ee=_0x12bd46[_0x7242('0x2e')](_0xa31941=>{var _0xa7e1a3={'filename':_0xa31941[_0x7242('0x35')],'path':path[_0x7242('0x6a')](config[_0x7242('0x6b')],'server','files',_0x7242('0xc9'),_0x7242('0xca'),_0xa31941[_0x7242('0xcb')])};return _0xa7e1a3;});if(!_0xea25ff[_0x7242('0xcc')]){return db[_0x7242('0xcd')][_0x7242('0xce')](function(_0xa8cdfb){return db[_0x7242('0xcf')]['bulkCreate'](_0x12bd46,{'transaction':_0xa8cdfb});});}}})[_0x7242('0x11')](function(){if(_0x77ce4b){_0x254e3d=_0x77ce4b;return db[_0x7242('0xc1')][_0x7242('0x5a')]({'where':{'service':!![]},'include':[{'model':db[_0x7242('0xd0')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7242('0xd1')],'as':_0x7242('0xd1'),'raw':!![]}]}]});}})[_0x7242('0x11')](function(_0xb67ab3){if(_0xb67ab3&&_0xb67ab3['Smtp']&&_0xea25ff[_0x7242('0xd2')]&&_0xea25ff[_0x7242('0xd3')]){var _0x19c354=_0xb67ab3[_0x7242('0xd4')]();return respondWithRpcPromise(_0x7242('0xd5'),_0x7242('0xd6'),{'account':_0x19c354,'message':{'from':util[_0x7242('0xa0')](_0x7242('0xd7'),_0xb67ab3[_0x7242('0x35')],_0xb67ab3[_0x7242('0xd8')]||_0xb67ab3['Smtp'][_0x7242('0x4b')]),'to':_0xea25ff['forwardOfflineAddress'],'subject':_0xea25ff[_0x7242('0xd9')],'html':_0x254e3d[_0x7242('0x54')],'attachments':_0x3d01ee}},client9003)[_0x7242('0x11')](function(){return _0x254e3d;})[_0x7242('0x1c')](function(_0x47be6f){logger['error'](_0x47be6f);});}})['then'](function(){if(_0xea25ff&&_0xea25ff[_0x7242('0xcc')]&&_0xea25ff['MailAccountId']){var _0x51f815=[];if(_0x1038d2[_0x7242('0x3b')]){_0x51f815=_0x1038d2['map'](function(_0x3352d3){return{'name':_0x3352d3[_0x7242('0xda')],'basename':_0x3352d3[_0x7242('0x64')],'type':_0x3352d3[_0x7242('0xc8')],'ChatOfflineMessageId':_0x77ce4b['id']};});}var _0x14da86;if(!_['isNil'](_0xea25ff[_0x7242('0xdb')])){var _0x294b43=_[_0x7242('0x2e')](_0x549328['body'],function(_0x1fe7bd){return _0x1fe7bd;});var _0x534d26=_['toPairsIn'](_0x294b43)[0x0];var _0x4414a0=_[_0x7242('0xdc')](_0x534d26,function(_0x3c66a9){return _0x3c66a9;});_0x14da86=_0x4414a0[0x1][_0xea25ff[_0x7242('0xdb')]];}var _0x22b318={'from':_0x4d42ac[_0x7242('0xd8')],'firstName':_0x4d42ac[_0x7242('0x9c')],'lastName':_0x4d42ac[_0x7242('0xab')],'mapKey':_0x7242('0xd8'),'message':{'from':_0x4d42ac['email'],'to':_0xea25ff['MailAccount'][_0x7242('0xd8')],'cc':'','subject':_[_0x7242('0x71')](_0x14da86)?_0xea25ff[_0x7242('0xd9')]:_0x14da86,'messageId':'','sentAt':new Date(),'attach':_0x51f815[_0x7242('0x3b')],'attachments':_0x51f815,'originChannel':_0x7242('0xdd'),'ChatWebsiteId':_0xea25ff['id'],'ChatOfflineMessageId':_0x254e3d['id'],'originTo':_0xea25ff[_0x7242('0xc1')]['email']},'body':_0x254e3d[_0x7242('0x54')]};var _0x3850ab={'account':{'id':_0xea25ff[_0x7242('0xde')]},'body':_0x22b318,'log':_0x7242('0xdf')};return respondWithRpcPromise(_0x7242('0xdf'),_0x7242('0xe0'),_0x3850ab,client9001)['then'](function(){return _0x254e3d;})['catch'](function(_0x5f0ea3){logger['error'](_0x5f0ea3);});}return;})[_0x7242('0x11')](function(){if(_0x254e3d){return _0x254e3d;}})['then'](respondWithResult(_0x3dc97b,null))[_0x7242('0x1c')](function(_0x55094e){logger['error']('catch',_0x55094e);for(var _0x28b5a6 of _0x1038d2){var _0x5aa2a1=path[_0x7242('0x6a')](config[_0x7242('0x6b')],_0x7242('0xe1'),_0x7242('0xbb'),'attachments',_0x7242('0xca'),_0x28b5a6[_0x7242('0x64')]);fs_extra[_0x7242('0xe2')](_0x5aa2a1)['catch'](function(_0x251f50){logger[_0x7242('0x18')](_0x7242('0xe3'),_0x5aa2a1,_0x251f50);});}});};exports['addInteraction']=function(_0x23845f,_0x474f49){return db[_0x7242('0xa9')]['find']({'where':{'id':_0x23845f[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x474f49,null))[_0x7242('0x11')](function(_0x19bc93){if(_0x19bc93){return _0x19bc93['addInteraction'](_0x23845f[_0x7242('0x54')][_0x7242('0x5e')],_['omit'](_0x23845f['body'],['ids','id'])||{});}})[_0x7242('0x11')](respondWithResult(_0x474f49,null))['catch'](handleError(_0x474f49,null));};exports[_0x7242('0xe4')]=function(_0x35e693,_0x224f4c){var _0x35d487={'raw':![],'where':{}};var _0x87af2c={};var _0x5e4670={'count':0x0,'rows':[]};return db[_0x7242('0x2f')][_0x7242('0x5a')]({'where':{'id':_0x35e693[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x224f4c,null))[_0x7242('0x11')](function(_0xa8ddbf){if(_0xa8ddbf){_0x87af2c['model']=_[_0x7242('0x37')](db[_0x7242('0xa9')][_0x7242('0x30')]);_0x87af2c['query']=_[_0x7242('0x37')](_0x35e693['query']);_0x87af2c[_0x7242('0x3f')]=_[_0x7242('0x38')](_0x87af2c[_0x7242('0x34')],_0x87af2c['query']);_0x35d487[_0x7242('0x39')]=_[_0x7242('0x38')](_0x87af2c[_0x7242('0x34')],qs[_0x7242('0x3a')](_0x35e693['query'][_0x7242('0x3a')]));_0x35d487[_0x7242('0x39')]=_0x35d487[_0x7242('0x39')]['length']?_0x35d487[_0x7242('0x39')]:_0x87af2c['model'];if(!_0x35e693[_0x7242('0x36')][_0x7242('0x3c')]('nolimit')){_0x35d487[_0x7242('0x22')]=qs[_0x7242('0x22')](_0x35e693[_0x7242('0x36')][_0x7242('0x22')]);_0x35d487[_0x7242('0x20')]=qs['offset'](_0x35e693[_0x7242('0x36')][_0x7242('0x20')]);}_0x35d487[_0x7242('0x5b')]=qs[_0x7242('0x3e')](_0x35e693[_0x7242('0x36')][_0x7242('0x3e')]);_0x35d487[_0x7242('0x40')]=qs[_0x7242('0x3f')](_[_0x7242('0x5c')](_0x35e693[_0x7242('0x36')],_0x87af2c[_0x7242('0x3f')]));_0x35d487[_0x7242('0x40')][_0x7242('0x57')]=_0xa8ddbf['id'];if(_0x35e693[_0x7242('0x36')]['filter']){_0x35d487[_0x7242('0x40')]=_[_0x7242('0x43')](_0x35d487['where'],{'$or':_[_0x7242('0x2e')](_0x35d487['attributes'],function(_0x4e7660){var _0x3b94c2={};_0x3b94c2[_0x4e7660]={'$like':'%'+_0x35e693['query'][_0x7242('0x42')]+'%'};return _0x3b94c2;})});}_0x35d487=_[_0x7242('0x43')]({},_0x35d487,_0x35e693[_0x7242('0x44')]);return db[_0x7242('0xa9')][_0x7242('0x23')]({'where':_0x35d487[_0x7242('0x40')]})[_0x7242('0x11')](function(_0x44cb4a){_0x5e4670['count']=_0x44cb4a;if(_0x35e693[_0x7242('0x36')]['includeAll']){_0x35d487[_0x7242('0x46')]=[{'model':db[_0x7242('0x81')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x7242('0xe5'),'attributes':[_0x7242('0x35'),_0x7242('0xe6'),_0x7242('0xe7')],'required':![]},{'model':db[_0x7242('0xe8')],'as':'Tags','attributes':['id',_0x7242('0x35'),_0x7242('0xe9')],'where':_0x35e693[_0x7242('0x36')]['tag']?{'id':_0x35e693[_0x7242('0x36')]['tag']}:undefined,'required':_0x35e693[_0x7242('0x36')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0x7242('0x47')](_0x35d487);})[_0x7242('0x11')](function(_0x955c23){_0x5e4670[_0x7242('0x48')]=_0x955c23;return _0x5e4670;});}})[_0x7242('0x11')](respondWithFilteredResult(_0x224f4c,_0x35d487))[_0x7242('0x1c')](handleError(_0x224f4c,null));};function iftimePromise(_0x3b8bc3,_0x5e525f){return respondWithRpcPromise(_0x7242('0xea'),_0x7242('0xeb'),{'command':_0x5e525f['timezone']?util['format'](_0x7242('0xec'),_0x3b8bc3[_0x7242('0xed')],_0x5e525f[_0x7242('0xee')]):util['format'](_0x7242('0xef'),_0x3b8bc3[_0x7242('0xed')])},client9002)[_0x7242('0x11')](function(_0x38bc64){var _0x1a2250=_0x38bc64&&_0x38bc64[_0x7242('0xf0')](_0x7242('0xf1'))>=0x0?!![]:![];logger[_0x7242('0x12')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5e525f['id'],_0x3b8bc3['id'],_0x3b8bc3[_0x7242('0xed')],_0x1a2250?_0x7242('0xf2'):'OFFLINE',_0x5e525f[_0x7242('0xee')]?_0x5e525f[_0x7242('0xee')]:_0x7242('0xf3'));return _0x1a2250;})[_0x7242('0x1c')](function(_0x20228c){logger[_0x7242('0x18')](_0x7242('0xf4'),_0x5e525f['id'],_0x3b8bc3['id'],_0x3b8bc3[_0x7242('0xed')],util['inspect'](_0x20228c,{'showHidden':![],'depth':null}),_0x5e525f[_0x7242('0xee')]?_0x5e525f[_0x7242('0xee')]:'No\x20timezone');return![];});}exports[_0x7242('0xeb')]=function(_0xb0bd60,_0x4dbdf9){var _0x2e4d66=0x0;var _0x52d387=0x0;var _0x236173=![];var _0x5da4eb;var _0x32d56e;return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0xb0bd60[_0x7242('0x49')]['id']},'include':[{'model':db[_0x7242('0xf5')],'as':_0x7242('0xf5'),'include':[{'model':db['Interval'],'as':_0x7242('0xf6'),'attributes':['id',_0x7242('0xed')],'raw':!![]}]}]})[_0x7242('0x11')](handleEntityNotFound(_0x4dbdf9,null))['then'](function(_0x53b020){if(_0x53b020){_0x5da4eb=_0x53b020;return _0x53b020[_0x7242('0xf7')]({'raw':!![]});}})[_0x7242('0x11')](function(_0x57a885){if(_0x5da4eb){if(_0x57a885){_0x32d56e=_0x57a885;}}return require(_0x7242('0x6e'))[_0x7242('0x6f')]();})['then'](function(_0x4ff9f5){if(_0x4ff9f5){_0x52d387=_0x4ff9f5[_0x7242('0xf8')];_0x236173=_0x4ff9f5[_0x7242('0x70')];}})[_0x7242('0x11')](function(){return db[_0x7242('0xa9')]['count']({'where':{'closed':![]}});})['then'](function(_0x9506e8){_0x2e4d66=_0x9506e8;if(_0x52d387&&_0x9506e8>_0x52d387){return db[_0x7242('0xf9')][_0x7242('0x5a')]({'where':{'id':0x1}})['then'](function(_0x4e3103){if(_0x4e3103){_0x4e3103['increment']('chatLicenseExceeded');}});}})['then'](function(){if(_0x5da4eb[_0x7242('0xf5')]&&_0x5da4eb[_0x7242('0xf5')][_0x7242('0xf6')]){var _0x3c7975=[];for(var _0x564945=0x0;_0x564945<_0x5da4eb[_0x7242('0xf5')]['Intervals'][_0x7242('0x3b')];_0x564945++){var _0x173a4c=_0x5da4eb[_0x7242('0xf5')]['Intervals'][_0x564945][_0x7242('0x28')]({'plain':!![]});_0x3c7975[_0x7242('0xfa')](iftimePromise(_0x173a4c,_0x5da4eb));}return BPromise[_0x7242('0xfb')](_0x3c7975)[_0x7242('0x11')](function(_0x3ae673){return _[_0x7242('0xfc')](_0x3ae673);});}else{return!![];}})[_0x7242('0x11')](function(_0x4362d9){var _0x4a5c46=fs[_0x7242('0xfd')](path['join'](config[_0x7242('0x6b')],_0x7242('0xfe')),_0x7242('0xc3'));var _0x2a9033={'remote':_0x5da4eb['remote'],'query':querystring[_0x7242('0x17')](_[_0x7242('0x43')](_0x5da4eb[_0x7242('0x28')]({'plain':!![]}),{'customerIp':_0xb0bd60[_0x7242('0x7f')]['x-forwarded-for']||_0xb0bd60[_0x7242('0x7f')]['x-real-ip']||_0xb0bd60[_0x7242('0xff')]['remoteAddress']||_0xb0bd60['ip'],'referer':_0xb0bd60['headers'][_0x7242('0x9e')],'openedInteractions':_0x2e4d66,'maxInteractions':_0x52d387,'virtual':_0x236173['virtual'],'online':_0x4362d9,'custom':_0x236173}))['replace'](/'/g,'\x5c\x27')};_0x4dbdf9[_0x7242('0x2b')](ejs['render'](Mustache[_0x7242('0xc4')](_0x4a5c46,_0x2a9033),{'proactiveActions':_0x32d56e,'alignment':_0x5da4eb[_0x7242('0x100')],'verticalAlignment':_0x5da4eb['verticalAlignment'],'div_color':_0x5da4eb[_0x7242('0xe9')],'labelText':_0x5da4eb[_0x7242('0x101')],'text_color':_0x5da4eb[_0x7242('0x102')],'button_color':_0x5da4eb['color_button'],'background_color':_0x5da4eb['backgroundColor'],'hideWhenOffline':_0x5da4eb['hideWhenOffline'],'interval':_0x5da4eb['IntervalId']}));})[_0x7242('0x1c')](handleError(_0x4dbdf9,null));};exports[_0x7242('0x103')]=function(_0x4b29b8,_0x1d5697){var _0x2c3b9a=_0x4b29b8[_0x7242('0x49')]['id'];var _0x4f6206=_0x4b29b8['body'];var _0xf884d7=0xc8;var _0x36360e=null;return db[_0x7242('0xcd')][_0x7242('0xce')]({'isolationLevel':db[_0x7242('0xcd')][_0x7242('0x104')][_0x7242('0x105')][_0x7242('0x106')]},function(_0x38cb2b){return db[_0x7242('0x2f')]['findOne']({'where':{'id':_0x2c3b9a},'transaction':_0x38cb2b})[_0x7242('0x11')](function(_0x34212d){if(_0x34212d){return db[_0x7242('0x8f')][_0x7242('0x27')]({'where':{'ChatWebsiteId':_0x2c3b9a},'transaction':_0x38cb2b})['then'](function(){var _0x260c75=_[_0x7242('0x2e')](_0x4f6206,function(_0x41dfd9){_0x41dfd9[_0x7242('0x57')]=_0x2c3b9a;return _0x41dfd9;});return db[_0x7242('0x8f')][_0x7242('0x107')](_0x260c75,{'transaction':_0x38cb2b});});}else{_0xf884d7=0x194;_0x36360e=[];}});})['then'](function(){if(_0xf884d7!==0x194){return db[_0x7242('0x8f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2c3b9a},'order':_0x7242('0x108')})['then'](function(_0x10b90f){_0x36360e=_0x10b90f;});}})['catch'](function(_0x540d78){_0xf884d7=0x1f4;logger[_0x7242('0x18')](_0x540d78['stack']);if(_0x540d78['name']){delete _0x540d78['name'];}_0x36360e=_0x540d78;})[_0x7242('0x109')](function(){if(_0x36360e===null){_0x1d5697[_0x7242('0x1d')](_0xf884d7);}else{if(_0xf884d7===0x1f4){_0x1d5697[_0x7242('0x1e')](_0xf884d7)[_0x7242('0x2b')](_0x36360e);}else{_0x1d5697[_0x7242('0x1e')](_0xf884d7)['json'](_0x36360e);}}});};exports['getApplications']=function(_0x5565d4,_0x51b96c){var _0x53caef={};var _0x234a35={};var _0x2ad583;var _0x3cf6db;return db[_0x7242('0x2f')][_0x7242('0x5a')]({'where':{'id':_0x5565d4[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x51b96c,null))[_0x7242('0x11')](function(_0x54a3a9){if(_0x54a3a9){_0x2ad583=_0x54a3a9;_0x234a35['model']=_[_0x7242('0x37')](db[_0x7242('0x8f')]['rawAttributes']);_0x234a35[_0x7242('0x36')]=_[_0x7242('0x37')](_0x5565d4[_0x7242('0x36')]);_0x234a35[_0x7242('0x3f')]=_[_0x7242('0x38')](_0x234a35['model'],_0x234a35['query']);_0x53caef['attributes']=_[_0x7242('0x38')](_0x234a35[_0x7242('0x34')],qs[_0x7242('0x3a')](_0x5565d4[_0x7242('0x36')]['fields']));_0x53caef[_0x7242('0x39')]=_0x53caef[_0x7242('0x39')][_0x7242('0x3b')]?_0x53caef['attributes']:_0x234a35[_0x7242('0x34')];_0x53caef['order']=qs[_0x7242('0x3e')](_0x5565d4[_0x7242('0x36')][_0x7242('0x3e')]);_0x53caef[_0x7242('0x40')]=qs[_0x7242('0x3f')](_[_0x7242('0x5c')](_0x5565d4[_0x7242('0x36')],_0x234a35[_0x7242('0x3f')]));if(_0x5565d4[_0x7242('0x36')][_0x7242('0x42')]){_0x53caef[_0x7242('0x40')]=_['merge'](_0x53caef[_0x7242('0x40')],{'$or':_[_0x7242('0x2e')](_0x53caef[_0x7242('0x39')],function(_0x42ce86){var _0x4a728a={};_0x4a728a[_0x42ce86]={'$like':'%'+_0x5565d4[_0x7242('0x36')]['filter']+'%'};return _0x4a728a;})});}_0x53caef=_[_0x7242('0x43')]({},_0x53caef,_0x5565d4[_0x7242('0x44')]);return _0x2ad583[_0x7242('0x10a')](_0x53caef);}})[_0x7242('0x11')](function(_0x3a1bf6){if(_0x3a1bf6){_0x3cf6db=_0x3a1bf6['length'];if(!_0x5565d4[_0x7242('0x36')]['hasOwnProperty']('nolimit')){_0x53caef[_0x7242('0x22')]=qs[_0x7242('0x22')](_0x5565d4[_0x7242('0x36')][_0x7242('0x22')]);_0x53caef[_0x7242('0x20')]=qs[_0x7242('0x20')](_0x5565d4[_0x7242('0x36')][_0x7242('0x20')]);}return _0x2ad583[_0x7242('0x10a')](_0x53caef);}})[_0x7242('0x11')](function(_0x2c84fc){if(_0x2c84fc){return _0x2c84fc?{'count':_0x3cf6db,'rows':_0x2c84fc}:null;}})[_0x7242('0x11')](respondWithResult(_0x51b96c,null))[_0x7242('0x1c')](handleError(_0x51b96c,null));};exports[_0x7242('0x10b')]=function(_0x4a120c,_0x19f77d){return db[_0x7242('0x10c')]['find']({'where':{'id':_0x4a120c['params']['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x19f77d,null))[_0x7242('0x11')](function(_0x2ded04){if(_0x2ded04){return _0x2ded04['addProactiveActions'](_0x4a120c[_0x7242('0x54')][_0x7242('0x5e')],_[_0x7242('0x10d')](_0x4a120c[_0x7242('0x54')],['ids','id'])||{});}})[_0x7242('0x11')](respondWithResult(_0x19f77d,null))['catch'](handleError(_0x19f77d,null));};exports[_0x7242('0xf7')]=function(_0x1d6fe8,_0xf1dfd4){var _0xb936d7={};var _0x428d61={};var _0xd0174d;var _0x947891;return db[_0x7242('0x2f')][_0x7242('0x5a')]({'where':{'id':_0x1d6fe8['params']['id']}})['then'](handleEntityNotFound(_0xf1dfd4,null))[_0x7242('0x11')](function(_0x4f5681){if(_0x4f5681){_0xd0174d=_0x4f5681;_0x428d61[_0x7242('0x34')]=_[_0x7242('0x37')](db['ChatProactiveAction'][_0x7242('0x30')]);_0x428d61[_0x7242('0x36')]=_['keys'](_0x1d6fe8[_0x7242('0x36')]);_0x428d61[_0x7242('0x3f')]=_[_0x7242('0x38')](_0x428d61[_0x7242('0x34')],_0x428d61[_0x7242('0x36')]);_0xb936d7[_0x7242('0x39')]=_[_0x7242('0x38')](_0x428d61[_0x7242('0x34')],qs[_0x7242('0x3a')](_0x1d6fe8[_0x7242('0x36')][_0x7242('0x3a')]));_0xb936d7[_0x7242('0x39')]=_0xb936d7[_0x7242('0x39')][_0x7242('0x3b')]?_0xb936d7[_0x7242('0x39')]:_0x428d61['model'];_0xb936d7[_0x7242('0x5b')]=qs['sort'](_0x1d6fe8[_0x7242('0x36')][_0x7242('0x3e')]);_0xb936d7['where']=qs[_0x7242('0x3f')](_['pick'](_0x1d6fe8['query'],_0x428d61[_0x7242('0x3f')]));if(_0x1d6fe8[_0x7242('0x36')]['filter']){_0xb936d7[_0x7242('0x40')]=_['merge'](_0xb936d7[_0x7242('0x40')],{'$or':_[_0x7242('0x2e')](_0xb936d7[_0x7242('0x39')],function(_0x33017e){var _0x13c17f={};_0x13c17f[_0x33017e]={'$like':'%'+_0x1d6fe8['query'][_0x7242('0x42')]+'%'};return _0x13c17f;})});}_0xb936d7=_['merge']({},_0xb936d7,_0x1d6fe8['options']);return _0xd0174d[_0x7242('0xf7')](_0xb936d7);}})[_0x7242('0x11')](function(_0x48306d){if(_0x48306d){_0x947891=_0x48306d[_0x7242('0x3b')];if(!_0x1d6fe8[_0x7242('0x36')]['hasOwnProperty'](_0x7242('0x3d'))){_0xb936d7[_0x7242('0x22')]=qs['limit'](_0x1d6fe8[_0x7242('0x36')]['limit']);_0xb936d7[_0x7242('0x20')]=qs[_0x7242('0x20')](_0x1d6fe8[_0x7242('0x36')][_0x7242('0x20')]);}return _0xd0174d['getProactiveActions'](_0xb936d7);}})[_0x7242('0x11')](function(_0x2c2458){if(_0x2c2458){return _0x2c2458?{'count':_0x947891,'rows':_0x2c2458}:null;}})[_0x7242('0x11')](respondWithResult(_0xf1dfd4,null))[_0x7242('0x1c')](handleError(_0xf1dfd4,null));};exports[_0x7242('0x10e')]=function(_0x204004,_0x1088b2){var _0x2aeb60=_0x204004['query'][_0x7242('0x10f')]===_0x7242('0x110')?_0x7242('0x111'):_0x7242('0x112');return db['ChatWebsite'][_0x7242('0x4a')]({'attributes':['id',_0x2aeb60],'where':{'id':_0x204004[_0x7242('0x49')]['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x1088b2,null))[_0x7242('0x11')](function(_0xc3d27c){if(_0xc3d27c){var _0x41efa1=_0xc3d27c[_0x2aeb60];var _0x17f274=_0x41efa1&&_0x41efa1[_0x7242('0x113')]?_0x41efa1[_0x7242('0x113')]:[];_0x1088b2[_0x7242('0x2b')]({'fromKey':_[_0x7242('0x71')](_0x41efa1['fromKey'])?undefined:_0x41efa1[_0x7242('0x114')],'count':_0x17f274[_0x7242('0x3b')],'rows':_0x17f274});}})[_0x7242('0x1c')](handleError(_0x1088b2,null));};exports[_0x7242('0x115')]=function(_0x54f5a9,_0x349f68){var _0x41784e={'raw':![],'where':{}};var _0x238745={};var _0x481de5={'count':0x0,'rows':[]};return db[_0x7242('0x2f')]['findOne']({'where':{'id':_0x54f5a9['params']['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x349f68,null))[_0x7242('0x11')](function(_0x466bd9){if(_0x466bd9){_0x238745['model']=_['keys'](db[_0x7242('0x116')][_0x7242('0x30')]);_0x238745[_0x7242('0x36')]=_[_0x7242('0x37')](_0x54f5a9[_0x7242('0x36')]);_0x238745[_0x7242('0x3f')]=_[_0x7242('0x38')](_0x238745[_0x7242('0x34')],_0x238745[_0x7242('0x36')]);_0x41784e[_0x7242('0x39')]=_[_0x7242('0x38')](_0x238745['model'],qs[_0x7242('0x3a')](_0x54f5a9[_0x7242('0x36')][_0x7242('0x3a')]));_0x41784e[_0x7242('0x39')]=_0x41784e[_0x7242('0x39')][_0x7242('0x3b')]?_0x41784e['attributes']:_0x238745[_0x7242('0x34')];if(!_0x54f5a9[_0x7242('0x36')][_0x7242('0x3c')]('nolimit')){_0x41784e['limit']=qs[_0x7242('0x22')](_0x54f5a9[_0x7242('0x36')][_0x7242('0x22')]);_0x41784e[_0x7242('0x20')]=qs[_0x7242('0x20')](_0x54f5a9[_0x7242('0x36')][_0x7242('0x20')]);}_0x41784e[_0x7242('0x5b')]=qs[_0x7242('0x3e')](_0x54f5a9[_0x7242('0x36')][_0x7242('0x3e')]);_0x41784e[_0x7242('0x40')]=qs['filters'](_[_0x7242('0x5c')](_0x54f5a9[_0x7242('0x36')],_0x238745[_0x7242('0x3f')]));_0x41784e[_0x7242('0x40')][_0x7242('0x57')]=_0x466bd9['id'];if(_0x54f5a9[_0x7242('0x36')]['filter']){_0x41784e[_0x7242('0x40')]=_[_0x7242('0x43')](_0x41784e[_0x7242('0x40')],{'$or':_[_0x7242('0x2e')](_0x41784e[_0x7242('0x39')],function(_0x2b9329){var _0x2766fb={};_0x2766fb[_0x2b9329]={'$like':'%'+_0x54f5a9[_0x7242('0x36')][_0x7242('0x42')]+'%'};return _0x2766fb;})});}_0x41784e=_['merge']({},_0x41784e,_0x54f5a9['options']);return db[_0x7242('0x116')][_0x7242('0x23')]({'where':_0x41784e[_0x7242('0x40')]})['then'](function(_0x38fbad){_0x481de5[_0x7242('0x23')]=_0x38fbad;if(_0x54f5a9[_0x7242('0x36')][_0x7242('0x45')]){_0x41784e[_0x7242('0x46')]=[{'all':!![]}];}else{_0x41784e['include']=[{'model':db[_0x7242('0x81')],'as':_0x7242('0x117'),'required':![]},{'model':db[_0x7242('0xcf')],'as':_0x7242('0x118'),'required':![]}];}return db[_0x7242('0x116')][_0x7242('0x47')](_0x41784e);})[_0x7242('0x11')](function(_0x12e0d1){_0x481de5[_0x7242('0x48')]=_0x12e0d1;return _0x481de5;});}})[_0x7242('0x11')](respondWithFilteredResult(_0x349f68,_0x41784e))['catch'](handleError(_0x349f68,null));};exports['addAgents']=function(_0x43d2b3,_0x41a3e6){return db[_0x7242('0x2f')][_0x7242('0x4a')]({'where':{'id':_0x43d2b3[_0x7242('0x49')]['id']}})['then'](handleEntityNotFound(_0x41a3e6,null))[_0x7242('0x11')](function(_0x16d669){if(_0x16d669){return _0x16d669['addAgents'](_0x43d2b3[_0x7242('0x54')][_0x7242('0x5e')],_[_0x7242('0x10d')](_0x43d2b3[_0x7242('0x54')],[_0x7242('0x5e'),'id'])||{})[_0x7242('0x119')](function(_0xc7720e){for(var _0x405add=0x0;_0x405add<_0x43d2b3['body']['ids'][_0x7242('0x3b')];_0x405add+=0x1){socket[_0x7242('0x11a')](_0x7242('0x11b'),{'UserId':Number(_0x43d2b3[_0x7242('0x54')][_0x7242('0x5e')][_0x405add]),'ChatWebsiteId':Number(_0x43d2b3['params']['id'])});}return _0xc7720e;});}})['then'](respondWithResult(_0x41a3e6,null))['catch'](handleError(_0x41a3e6,null));};exports[_0x7242('0x11c')]=function(_0x480592,_0x347221){return db['ChatWebsite'][_0x7242('0x4a')]({'where':{'id':_0x480592['params']['id']}})[_0x7242('0x11')](handleEntityNotFound(_0x347221,null))['then'](function(_0x13b70e){if(_0x13b70e){return _0x13b70e[_0x7242('0x11c')](_0x480592[_0x7242('0x36')]['ids'])['then'](function(){if(_[_0x7242('0x11d')](_0x480592['query'][_0x7242('0x5e')])){for(var _0x53672a=0x0;_0x53672a<_0x480592[_0x7242('0x36')][_0x7242('0x5e')][_0x7242('0x3b')];_0x53672a+=0x1){socket[_0x7242('0x11a')](_0x7242('0x11e'),{'UserId':Number(_0x480592['query'][_0x7242('0x5e')][_0x53672a]),'ChatWebsiteId':Number(_0x480592[_0x7242('0x49')]['id'])});}}else{socket['emit'](_0x7242('0x11e'),{'UserId':Number(_0x480592[_0x7242('0x36')][_0x7242('0x5e')]),'ChatWebsiteId':Number(_0x480592[_0x7242('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x347221,null))[_0x7242('0x1c')](handleError(_0x347221,null));};exports[_0x7242('0x11f')]=function(_0x46ef4e,_0x47c808){var _0x382c9d={};var _0x1792a7={};var _0x2f70ad;var _0x363284;return db[_0x7242('0x2f')]['findOne']({'where':{'id':_0x46ef4e[_0x7242('0x49')]['id']}})['then'](handleEntityNotFound(_0x47c808,null))[_0x7242('0x11')](function(_0x1467f0){if(_0x1467f0){_0x2f70ad=_0x1467f0;_0x1792a7[_0x7242('0x34')]=_['keys'](db['User']['rawAttributes']);_0x1792a7[_0x7242('0x36')]=_[_0x7242('0x37')](_0x46ef4e['query']);_0x1792a7[_0x7242('0x3f')]=_[_0x7242('0x38')](_0x1792a7[_0x7242('0x34')],_0x1792a7['query']);_0x382c9d[_0x7242('0x39')]=_[_0x7242('0x38')](_0x1792a7[_0x7242('0x34')],qs[_0x7242('0x3a')](_0x46ef4e[_0x7242('0x36')][_0x7242('0x3a')]));_0x382c9d[_0x7242('0x39')]=_0x382c9d['attributes'][_0x7242('0x3b')]?_0x382c9d[_0x7242('0x39')]:_0x1792a7[_0x7242('0x34')];_0x382c9d['order']=qs[_0x7242('0x3e')](_0x46ef4e[_0x7242('0x36')][_0x7242('0x3e')]);_0x382c9d['where']=qs[_0x7242('0x3f')](_[_0x7242('0x5c')](_0x46ef4e['query'],_0x1792a7[_0x7242('0x3f')]));if(_0x46ef4e[_0x7242('0x36')]['filter']){_0x382c9d[_0x7242('0x40')]=_[_0x7242('0x43')](_0x382c9d[_0x7242('0x40')],{'$or':_[_0x7242('0x2e')](_0x382c9d[_0x7242('0x39')],function(_0x43990a){var _0x597c69={};_0x597c69[_0x43990a]={'$like':'%'+_0x46ef4e['query']['filter']+'%'};return _0x597c69;})});}_0x382c9d=_[_0x7242('0x43')]({},_0x382c9d,_0x46ef4e[_0x7242('0x44')]);return _0x2f70ad[_0x7242('0x11f')](_0x382c9d);}})['then'](function(_0x16f530){if(_0x16f530){_0x363284=_0x16f530[_0x7242('0x3b')];if(!_0x46ef4e['query'][_0x7242('0x3c')]('nolimit')){_0x382c9d[_0x7242('0x22')]=qs[_0x7242('0x22')](_0x46ef4e[_0x7242('0x36')][_0x7242('0x22')]);_0x382c9d[_0x7242('0x20')]=qs[_0x7242('0x20')](_0x46ef4e[_0x7242('0x36')][_0x7242('0x20')]);}return _0x2f70ad[_0x7242('0x11f')](_0x382c9d);}})[_0x7242('0x11')](function(_0x348cb5){if(_0x348cb5){return _0x348cb5?{'count':_0x363284,'rows':_0x348cb5}:null;}})[_0x7242('0x11')](respondWithResult(_0x47c808,null))[_0x7242('0x1c')](handleError(_0x47c808,null));};
\ No newline at end of file
index ae25e76..cd47cb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98e1=['emit','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','remove'];(function(_0x180951,_0x12b8ab){var _0x3a0ef6=function(_0x2a3c67){while(--_0x2a3c67){_0x180951['push'](_0x180951['shift']());}};_0x3a0ef6(++_0x12b8ab);}(_0x98e1,0x160));var _0x198e=function(_0x510347,_0x28e469){_0x510347=_0x510347-0x0;var _0xd2126a=_0x98e1[_0x510347];return _0xd2126a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x198e('0x0'))['db'][_0x198e('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x198e('0x2')](0x0);var events={'afterCreate':_0x198e('0x3'),'afterUpdate':'update','afterDestroy':_0x198e('0x4')};function emitEvent(_0x4e997a){return function(_0x4a102f,_0x3bd989,_0x2f1cda){ChatWebsiteEvents[_0x198e('0x5')](_0x4e997a+':'+_0x4a102f['id'],_0x4a102f);ChatWebsiteEvents[_0x198e('0x5')](_0x4e997a,_0x4a102f);_0x2f1cda(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x198e('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x42b0=['emit','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x595c65,_0x5d5f72){var _0x505ca9=function(_0x28bc71){while(--_0x28bc71){_0x595c65['push'](_0x595c65['shift']());}};_0x505ca9(++_0x5d5f72);}(_0x42b0,0xbc));var _0x042b=function(_0x1501e1,_0x5343a7){_0x1501e1=_0x1501e1-0x0;var _0x1c2ce2=_0x42b0[_0x1501e1];return _0x1c2ce2;};'use strict';var EventEmitter=require(_0x042b('0x0'));var ChatWebsite=require(_0x042b('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x042b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x042b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x51e9e9){return function(_0x401a0c,_0xd73d53,_0x2a26d1){ChatWebsiteEvents[_0x042b('0x4')](_0x51e9e9+':'+_0x401a0c['id'],_0x401a0c);ChatWebsiteEvents[_0x042b('0x4')](_0x51e9e9,_0x401a0c);_0x2a26d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x042b('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
index 36337dd..e1b5204 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2743=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','../../config/logger'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0x2743,0xb3));var _0x3274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2743[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3274('0x0'))(_0x3274('0x1'));var moment=require(_0x3274('0x2'));var BPromise=require(_0x3274('0x3'));var rp=require(_0x3274('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3274('0x5'));var config=require(_0x3274('0x6'));var attributes=require(_0x3274('0x7'));module[_0x3274('0x8')]=function(_0x42f7c0,_0x36d47b){return _0x42f7c0[_0x3274('0x9')](_0x3274('0xa'),attributes,{'tableName':_0x3274('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4ca=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4ca,0xb6));var _0xaf4c=function(_0x2a3edf,_0x4ba7bf){_0x2a3edf=_0x2a3edf-0x0;var _0x2343a0=_0xf4ca[_0x2a3edf];return _0x2343a0;};'use strict';var _=require(_0xaf4c('0x0'));var util=require(_0xaf4c('0x1'));var logger=require(_0xaf4c('0x2'))(_0xaf4c('0x3'));var moment=require(_0xaf4c('0x4'));var BPromise=require(_0xaf4c('0x5'));var rp=require(_0xaf4c('0x6'));var fs=require('fs');var path=require(_0xaf4c('0x7'));var rimraf=require(_0xaf4c('0x8'));var config=require(_0xaf4c('0x9'));var attributes=require(_0xaf4c('0xa'));module[_0xaf4c('0xb')]=function(_0xea73e,_0x4decb4){return _0xea73e['define'](_0xaf4c('0xc'),attributes,{'tableName':_0xaf4c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b04811..ab2631d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2218=['defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x33b702,_0x4d8909){var _0x17dba7=function(_0x35ea8d){while(--_0x35ea8d){_0x33b702['push'](_0x33b702['shift']());}};_0x17dba7(++_0x4d8909);}(_0x2218,0x8c));var _0x8221=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x2218[_0x534c8f];return _0x5a57f5;};'use strict';var _=require('lodash');var util=require(_0x8221('0x0'));var moment=require(_0x8221('0x1'));var BPromise=require(_0x8221('0x2'));var rs=require(_0x8221('0x3'));var fs=require('fs');var Redis=require(_0x8221('0x4'));var db=require(_0x8221('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8221('0x6'))(_0x8221('0x7'));var config=require(_0x8221('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8221('0x9')]['http']({'port':0x232a});config['redis']=_[_0x8221('0xa')](config[_0x8221('0xb')],{'host':_0x8221('0xc'),'port':0x18eb});var socket=require(_0x8221('0xd'))(new Redis(config['redis']));require(_0x8221('0xe'))['register'](socket);function respondWithRpcPromise(_0xbfa286,_0x59e0e1,_0xee3552){return new BPromise(function(_0x1a4c8d,_0x3a6244){return client['request'](_0xbfa286,_0xee3552)[_0x8221('0xf')](function(_0x2c96da){logger[_0x8221('0x10')](_0x8221('0x11'),_0x59e0e1,'request\x20sent');logger['debug'](_0x8221('0x12'),_0x59e0e1,_0x8221('0x13'),JSON[_0x8221('0x14')](_0x2c96da));if(_0x2c96da['error']){if(_0x2c96da['error'][_0x8221('0x15')]===0x1f4){logger[_0x8221('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x59e0e1,_0x2c96da[_0x8221('0x16')][_0x8221('0x17')]);return _0x3a6244(_0x2c96da['error'][_0x8221('0x17')]);}logger[_0x8221('0x16')](_0x8221('0x11'),_0x59e0e1,_0x2c96da[_0x8221('0x16')][_0x8221('0x17')]);return _0x1a4c8d(_0x2c96da[_0x8221('0x16')][_0x8221('0x17')]);}else{logger[_0x8221('0x10')](_0x8221('0x11'),_0x59e0e1,_0x8221('0x13'));_0x1a4c8d(_0x2c96da[_0x8221('0x18')][_0x8221('0x17')]);}})['catch'](function(_0x419d2b){logger[_0x8221('0x16')](_0x8221('0x11'),_0x59e0e1,_0x419d2b);_0x3a6244(_0x419d2b);});});}
\ No newline at end of file
+var _0xfea7=['client','http','redis','defaults','register','request','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise'];(function(_0x1efc8c,_0x46e5ef){var _0x2f2ace=function(_0x1623a4){while(--_0x1623a4){_0x1efc8c['push'](_0x1efc8c['shift']());}};_0x2f2ace(++_0x46e5ef);}(_0xfea7,0x1ad));var _0x7fea=function(_0x2fe5be,_0x36c205){_0x2fe5be=_0x2fe5be-0x0;var _0x543bb3=_0xfea7[_0x2fe5be];return _0x543bb3;};'use strict';var _=require('lodash');var util=require(_0x7fea('0x0'));var moment=require(_0x7fea('0x1'));var BPromise=require(_0x7fea('0x2'));var rs=require(_0x7fea('0x3'));var fs=require('fs');var Redis=require(_0x7fea('0x4'));var db=require(_0x7fea('0x5'))['db'];var utils=require(_0x7fea('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7fea('0x7'));var client=jayson[_0x7fea('0x8')][_0x7fea('0x9')]({'port':0x232a});config[_0x7fea('0xa')]=_[_0x7fea('0xb')](config[_0x7fea('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x7fea('0xc')](socket);function respondWithRpcPromise(_0x3b191e,_0x36642f,_0x4fc392){return new BPromise(function(_0x228ebc,_0xe00e8e){return client[_0x7fea('0xd')](_0x3b191e,_0x4fc392)['then'](function(_0x64774b){logger[_0x7fea('0xe')](_0x7fea('0xf'),_0x36642f,'request\x20sent');logger['debug'](_0x7fea('0x10'),_0x36642f,'request\x20sent',JSON[_0x7fea('0x11')](_0x64774b));if(_0x64774b['error']){if(_0x64774b[_0x7fea('0x12')][_0x7fea('0x13')]===0x1f4){logger[_0x7fea('0x12')](_0x7fea('0xf'),_0x36642f,_0x64774b[_0x7fea('0x12')]['message']);return _0xe00e8e(_0x64774b['error'][_0x7fea('0x14')]);}logger[_0x7fea('0x12')](_0x7fea('0xf'),_0x36642f,_0x64774b['error'][_0x7fea('0x14')]);return _0x228ebc(_0x64774b[_0x7fea('0x12')][_0x7fea('0x14')]);}else{logger[_0x7fea('0xe')](_0x7fea('0xf'),_0x36642f,_0x7fea('0x15'));_0x228ebc(_0x64774b['result'][_0x7fea('0x14')]);}})[_0x7fea('0x16')](function(_0x6bc08d){logger[_0x7fea('0x12')](_0x7fea('0xf'),_0x36642f,_0x6bc08d);_0xe00e8e(_0x6bc08d);});});}
\ No newline at end of file
index 82a57e4..93e35f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50fb=['chatWebsite:','./chatWebsite.events','remove','length'];(function(_0x22aaa8,_0x571e94){var _0x42479e=function(_0x109487){while(--_0x109487){_0x22aaa8['push'](_0x22aaa8['shift']());}};_0x42479e(++_0x571e94);}(_0x50fb,0xe5));var _0xb50f=function(_0x463ccc,_0x41a53d){_0x463ccc=_0x463ccc-0x0;var _0x3b98c5=_0x50fb[_0x463ccc];return _0x3b98c5;};'use strict';var ChatWebsiteEvents=require(_0xb50f('0x0'));var events=['save',_0xb50f('0x1'),'update'];function createListener(_0x31b659,_0x4e7f89){return function(_0x4d16b7){_0x4e7f89['emit'](_0x31b659,_0x4d16b7);};}function removeListener(_0x2043b1,_0x5bf5e5){return function(){ChatWebsiteEvents['removeListener'](_0x2043b1,_0x5bf5e5);};}exports['register']=function(_0x163975){for(var _0x128d89=0x0,_0x369765=events[_0xb50f('0x2')];_0x128d89<_0x369765;_0x128d89++){var _0x2e7325=events[_0x128d89];var _0x346a34=createListener(_0xb50f('0x3')+_0x2e7325,_0x163975);ChatWebsiteEvents['on'](_0x2e7325,_0x346a34);}};
\ No newline at end of file
+var _0x5daa=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x56e1c5,_0x44c854){var _0x5377dd=function(_0x3ac0dd){while(--_0x3ac0dd){_0x56e1c5['push'](_0x56e1c5['shift']());}};_0x5377dd(++_0x44c854);}(_0x5daa,0x8b));var _0xa5da=function(_0x3b10f9,_0x46039d){_0x3b10f9=_0x3b10f9-0x0;var _0x1f24f7=_0x5daa[_0x3b10f9];return _0x1f24f7;};'use strict';var ChatWebsiteEvents=require(_0xa5da('0x0'));var events=[_0xa5da('0x1'),_0xa5da('0x2'),_0xa5da('0x3')];function createListener(_0x39cf1e,_0x1e02d6){return function(_0x33c494){_0x1e02d6[_0xa5da('0x4')](_0x39cf1e,_0x33c494);};}function removeListener(_0x4ed6fa,_0x58c71a){return function(){ChatWebsiteEvents['removeListener'](_0x4ed6fa,_0x58c71a);};}exports[_0xa5da('0x5')]=function(_0x5718c2){for(var _0xff0c27=0x0,_0x4d8b18=events[_0xa5da('0x6')];_0xff0c27<_0x4d8b18;_0xff0c27++){var _0x42b614=events[_0xff0c27];var _0x4aa65e=createListener(_0xa5da('0x7')+_0x42b614,_0x5718c2);ChatWebsiteEvents['on'](_0x42b614,_0x4aa65e);}};
\ No newline at end of file
index 27ca3bb..2b5690d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa54a=['now','single','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','put','update','destroy','removeDispositions','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','file'];(function(_0x2dfb4d,_0x3b0382){var _0x22319e=function(_0x52e810){while(--_0x52e810){_0x2dfb4d['push'](_0x2dfb4d['shift']());}};_0x22319e(++_0x3b0382);}(_0xa54a,0xaa));var _0xaa54=function(_0x3ee1e9,_0x2cedcd){_0x3ee1e9=_0x3ee1e9-0x0;var _0x5265f0=_0xa54a[_0x3ee1e9];return _0x5265f0;};'use strict';var multer=require(_0xaa54('0x0'));var util=require(_0xaa54('0x1'));var path=require(_0xaa54('0x2'));var timeout=require(_0xaa54('0x3'));var express=require('express');var router=express[_0xaa54('0x4')]();var fs_extra=require(_0xaa54('0x5'));var auth=require(_0xaa54('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaa54('0x7'));var controller=require(_0xaa54('0x8'));router[_0xaa54('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaa54('0x9')](_0xaa54('0xa'),auth[_0xaa54('0xb')](),controller[_0xaa54('0xc')]);router['get'](_0xaa54('0xd'),auth[_0xaa54('0xb')](),controller[_0xaa54('0xe')]);router[_0xaa54('0x9')](_0xaa54('0xf'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x10')]);router[_0xaa54('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xaa54('0x11')]);router[_0xaa54('0x9')]('/:id/logo',controller[_0xaa54('0x12')]);router[_0xaa54('0x9')](_0xaa54('0x13'),controller['getAvatar']);router[_0xaa54('0x9')](_0xaa54('0x14'),controller[_0xaa54('0x15')]);router[_0xaa54('0x9')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xaa54('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xaa54('0x16')]);router[_0xaa54('0x9')](_0xaa54('0x17'),controller['getSnippet']);router[_0xaa54('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0xaa54('0x18')]);router[_0xaa54('0x9')](_0xaa54('0x19'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x1a')]);router[_0xaa54('0x9')](_0xaa54('0x1b'),controller['getFields']);router[_0xaa54('0x9')](_0xaa54('0x1c'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x1d')]);router[_0xaa54('0x9')](_0xaa54('0x1e'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x1f')]);router['post']('/',auth[_0xaa54('0xb')](),controller[_0xaa54('0x20')]);router[_0xaa54('0x21')]('/:id/dispositions',auth[_0xaa54('0xb')](),controller[_0xaa54('0x22')]);router['post'](_0xaa54('0x23'),auth['isAuthenticated'](),controller[_0xaa54('0x24')]);var upload=multer({'storage':multer[_0xaa54('0x25')]({'destination':function(_0x1d235c,_0x3e8bca,_0x89863){_0x89863(null,path[_0xaa54('0x26')](config[_0xaa54('0x27')],_0xaa54('0x28')));},'filename':function(_0x1f791e,_0x290aa5,_0x21850b){_0x21850b(null,util[_0xaa54('0x29')](_0xaa54('0x2a'),Date['now'](),_0x290aa5[_0xaa54('0x2b')]));}})});router['post'](_0xaa54('0x2c'),upload['single'](_0xaa54('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e971c,_0x323e8b,_0x3d2b2a){_0x3d2b2a(null,path[_0xaa54('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x36b0fa,_0x5dfc28,_0x8b346){_0x8b346(null,util[_0xaa54('0x29')](_0xaa54('0x2a'),Date[_0xaa54('0x2e')](),_0x5dfc28[_0xaa54('0x2b')]));}})});router[_0xaa54('0x21')]('/:id/avatar',upload[_0xaa54('0x2f')](_0xaa54('0x2d')),controller[_0xaa54('0x30')]);var upload=multer({'storage':multer[_0xaa54('0x25')]({'destination':function(_0x2ca20c,_0x32851a,_0x4f8688){_0x4f8688(null,path[_0xaa54('0x26')](config[_0xaa54('0x27')],'server/files/images/avatars/'));},'filename':function(_0xdaeaea,_0x42287a,_0x2b47eb){_0x2b47eb(null,util[_0xaa54('0x29')](_0xaa54('0x2a'),Date[_0xaa54('0x2e')](),_0x42287a[_0xaa54('0x2b')]));}})});router[_0xaa54('0x21')](_0xaa54('0x14'),upload[_0xaa54('0x2f')]('file'),controller[_0xaa54('0x31')]);var upload=multer({'storage':multer[_0xaa54('0x25')]({'destination':function(_0x19fdcb,_0x31b8c4,_0x13b534){_0x13b534(null,path[_0xaa54('0x26')](config[_0xaa54('0x27')],'server/files/images/avatars/'));},'filename':function(_0x4ab890,_0x55b37e,_0x827431){_0x827431(null,util[_0xaa54('0x29')](_0xaa54('0x2a'),Date[_0xaa54('0x2e')](),_0x55b37e['originalname']));}})});router[_0xaa54('0x21')](_0xaa54('0x32'),upload['single']('file'),controller[_0xaa54('0x33')]);router[_0xaa54('0x21')](_0xaa54('0x34'),controller[_0xaa54('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xaa54('0x25')]({'destination':function(_0x5235dd,_0x48380c,_0x541fb6){const _0x5f496c=path['join'](config[_0xaa54('0x27')],_0xaa54('0x36'),_0xaa54('0x37'),'offline-chat');fs_extra[_0xaa54('0x38')](_0x5f496c,function(){_0x541fb6(null,_0x5f496c);});},'filename':function(_0xac7cc3,_0x1f31ed,_0x250f68){const _0x1f58bd=_0x1f31ed[_0xaa54('0x2b')][_0xaa54('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x331fa7=path[_0xaa54('0x3a')](_0x1f58bd);const _0x17e4bb=Date[_0xaa54('0x2e')]()+'-'+_0x1f58bd[_0xaa54('0x39')](_0x331fa7,'')+_0x331fa7;_0x250f68(null,_0x17e4bb);}})});router[_0xaa54('0x21')](_0xaa54('0x3b'),offlineUploadMulter[_0xaa54('0x3c')](),controller[_0xaa54('0x3d')]);router[_0xaa54('0x21')]('/:id/interactions',auth[_0xaa54('0xb')](),controller[_0xaa54('0x3e')]);router[_0xaa54('0x21')]('/:id/applications',auth[_0xaa54('0xb')](),controller[_0xaa54('0x3f')]);router[_0xaa54('0x21')](_0xaa54('0x19'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x40')]);router[_0xaa54('0x21')](_0xaa54('0x1e'),auth[_0xaa54('0xb')](),controller['addAgents']);router[_0xaa54('0x41')](_0xaa54('0xd'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x42')]);router['delete'](_0xaa54('0xd'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x43')]);router['delete'](_0xaa54('0xf'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x44')]);router[_0xaa54('0x45')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xaa54('0x45')](_0xaa54('0x1e'),auth[_0xaa54('0xb')](),controller[_0xaa54('0x46')]);module[_0xaa54('0x47')]=router;
\ No newline at end of file
+var _0xa6c2=['/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','post','create','join','root','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','/:id/users','addAgents','put','/:id','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatWebsite.controller','isAuthenticated','index','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x37df7f,_0x4c827d){var _0x59fd67=function(_0x3069ce){while(--_0x3069ce){_0x37df7f['push'](_0x37df7f['shift']());}};_0x59fd67(++_0x4c827d);}(_0xa6c2,0x185));var _0x2a6c=function(_0x3d11be,_0x1b9a8c){_0x3d11be=_0x3d11be-0x0;var _0x4b657b=_0xa6c2[_0x3d11be];return _0x4b657b;};'use strict';var multer=require(_0x2a6c('0x0'));var util=require(_0x2a6c('0x1'));var path=require(_0x2a6c('0x2'));var timeout=require(_0x2a6c('0x3'));var express=require(_0x2a6c('0x4'));var router=express['Router']();var fs_extra=require(_0x2a6c('0x5'));var auth=require(_0x2a6c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2a6c('0x7'));router['get']('/',auth[_0x2a6c('0x8')](),controller[_0x2a6c('0x9')]);router[_0x2a6c('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2a6c('0xa')]('/:id',auth[_0x2a6c('0x8')](),controller[_0x2a6c('0xb')]);router[_0x2a6c('0xa')](_0x2a6c('0xc'),auth['isAuthenticated'](),controller[_0x2a6c('0xd')]);router[_0x2a6c('0xa')](_0x2a6c('0xe'),auth[_0x2a6c('0x8')](),controller[_0x2a6c('0xf')]);router['get'](_0x2a6c('0x10'),controller['getLogo']);router[_0x2a6c('0xa')](_0x2a6c('0x11'),controller[_0x2a6c('0x12')]);router[_0x2a6c('0xa')](_0x2a6c('0x13'),controller[_0x2a6c('0x14')]);router[_0x2a6c('0xa')](_0x2a6c('0x15'),controller[_0x2a6c('0x16')]);router[_0x2a6c('0xa')](_0x2a6c('0x17'),auth['isAuthenticated'](),controller[_0x2a6c('0x18')]);router['get'](_0x2a6c('0x19'),controller[_0x2a6c('0x1a')]);router[_0x2a6c('0xa')](_0x2a6c('0x1b'),auth[_0x2a6c('0x8')](),controller[_0x2a6c('0x1c')]);router['get'](_0x2a6c('0x1d'),auth[_0x2a6c('0x8')](),controller['getProactiveActions']);router[_0x2a6c('0xa')](_0x2a6c('0x1e'),controller['getFields']);router[_0x2a6c('0xa')](_0x2a6c('0x1f'),auth['isAuthenticated'](),controller[_0x2a6c('0x20')]);router[_0x2a6c('0xa')]('/:id/users',auth[_0x2a6c('0x8')](),controller['getAgents']);router[_0x2a6c('0x21')]('/',auth['isAuthenticated'](),controller[_0x2a6c('0x22')]);router[_0x2a6c('0x21')](_0x2a6c('0xc'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x2a6c('0x21')]('/:id/canned_answers',auth[_0x2a6c('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x57f743,_0x44e45a,_0x20a1a0){_0x20a1a0(null,path[_0x2a6c('0x23')](config[_0x2a6c('0x24')],'server/files/images/logos/'));},'filename':function(_0x2ac045,_0x34fab3,_0x3e290d){_0x3e290d(null,util[_0x2a6c('0x25')](_0x2a6c('0x26'),Date[_0x2a6c('0x27')](),_0x34fab3[_0x2a6c('0x28')]));}})});router[_0x2a6c('0x21')](_0x2a6c('0x10'),upload[_0x2a6c('0x29')](_0x2a6c('0x2a')),controller[_0x2a6c('0x2b')]);var upload=multer({'storage':multer[_0x2a6c('0x2c')]({'destination':function(_0x13ea6d,_0x507d0f,_0x5f4737){_0x5f4737(null,path[_0x2a6c('0x23')](config[_0x2a6c('0x24')],_0x2a6c('0x2d')));},'filename':function(_0xce8912,_0xbef179,_0x10ced){_0x10ced(null,util[_0x2a6c('0x25')](_0x2a6c('0x26'),Date[_0x2a6c('0x27')](),_0xbef179[_0x2a6c('0x28')]));}})});router['post']('/:id/avatar',upload['single']('file'),controller[_0x2a6c('0x2e')]);var upload=multer({'storage':multer[_0x2a6c('0x2c')]({'destination':function(_0xc35568,_0x50833e,_0x1313be){_0x1313be(null,path[_0x2a6c('0x23')](config[_0x2a6c('0x24')],_0x2a6c('0x2d')));},'filename':function(_0x1ce49e,_0x5f1bf6,_0x44bf35){_0x44bf35(null,util['format'](_0x2a6c('0x26'),Date[_0x2a6c('0x27')](),_0x5f1bf6[_0x2a6c('0x28')]));}})});router['post'](_0x2a6c('0x13'),upload[_0x2a6c('0x29')](_0x2a6c('0x2a')),controller[_0x2a6c('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c5add,_0x268cab,_0x4d9e4a){_0x4d9e4a(null,path[_0x2a6c('0x23')](config[_0x2a6c('0x24')],_0x2a6c('0x2d')));},'filename':function(_0x2a5e51,_0x29d10e,_0x4318d9){_0x4318d9(null,util[_0x2a6c('0x25')](_0x2a6c('0x26'),Date['now'](),_0x29d10e['originalname']));}})});router[_0x2a6c('0x21')](_0x2a6c('0x15'),upload[_0x2a6c('0x29')](_0x2a6c('0x2a')),controller[_0x2a6c('0x30')]);router['post']('/:id/notify',controller[_0x2a6c('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0x2a6c('0x2c')]({'destination':function(_0x5544bd,_0x1b467a,_0x547db2){const _0x2fde53=path[_0x2a6c('0x23')](config[_0x2a6c('0x24')],_0x2a6c('0x32'),_0x2a6c('0x33'),'offline-chat');fs_extra[_0x2a6c('0x34')](_0x2fde53,function(){_0x547db2(null,_0x2fde53);});},'filename':function(_0x2f4c19,_0x77bdc4,_0x5447ae){const _0x215f70=_0x77bdc4['originalname'][_0x2a6c('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2c2984=path[_0x2a6c('0x36')](_0x215f70);const _0x2ea606=Date[_0x2a6c('0x27')]()+'-'+_0x215f70[_0x2a6c('0x35')](_0x2c2984,'')+_0x2c2984;_0x5447ae(null,_0x2ea606);}})});router['post'](_0x2a6c('0x37'),offlineUploadMulter[_0x2a6c('0x38')](),controller[_0x2a6c('0x39')]);router['post'](_0x2a6c('0x17'),auth[_0x2a6c('0x8')](),controller[_0x2a6c('0x3a')]);router['post']('/:id/applications',auth[_0x2a6c('0x8')](),controller[_0x2a6c('0x3b')]);router[_0x2a6c('0x21')](_0x2a6c('0x1d'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x2a6c('0x21')](_0x2a6c('0x3c'),auth[_0x2a6c('0x8')](),controller[_0x2a6c('0x3d')]);router[_0x2a6c('0x3e')](_0x2a6c('0x3f'),auth[_0x2a6c('0x8')](),controller['update']);router[_0x2a6c('0x40')](_0x2a6c('0x3f'),auth[_0x2a6c('0x8')](),controller['destroy']);router[_0x2a6c('0x40')](_0x2a6c('0xc'),auth[_0x2a6c('0x8')](),controller[_0x2a6c('0x41')]);router['delete'](_0x2a6c('0xe'),auth[_0x2a6c('0x8')](),controller[_0x2a6c('0x42')]);router[_0x2a6c('0x40')](_0x2a6c('0x3c'),auth['isAuthenticated'](),controller[_0x2a6c('0x43')]);module[_0x2a6c('0x44')]=router;
\ No newline at end of file
index 6392a6b..f09af34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153a=['Router','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment'];(function(_0x475aa9,_0x439aab){var _0x360bbc=function(_0x331a22){while(--_0x331a22){_0x475aa9['push'](_0x475aa9['shift']());}};_0x360bbc(++_0x439aab);}(_0x153a,0x10e));var _0xa153=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x153a[_0x44bcb0];return _0xfaf881;};var beaverLogger=require(_0xa153('0x0'));var express=require('express');var auth=require(_0xa153('0x1'));var config=require(_0xa153('0x2'));var router=express[_0xa153('0x3')]();var isProduction=config['env']===_0xa153('0x4')||![];function clientSideLogs(_0x11a42d,_0x206238,_0x5c351a){var _0x530381=_0x11a42d[_0xa153('0x5')][_0xa153('0x6')](_0xa153('0x7'));if(!_0x530381){throw new Error(_0xa153('0x8'));}return beaverLogger[_0xa153('0x9')]({'uri':'/client-logs','logger':_0x530381,'enableCors':!isProduction})(_0x11a42d,_0x206238,_0x5c351a);}router[_0xa153('0xa')](auth[_0xa153('0xb')](),clientSideLogs);module[_0xa153('0xc')]=router;
\ No newline at end of file
+var _0xd3d4=['use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','production','get','client-side-logger','expressEndpoint','/client-logs'];(function(_0x16fe67,_0x5db580){var _0x4ce69c=function(_0x5cd386){while(--_0x5cd386){_0x16fe67['push'](_0x16fe67['shift']());}};_0x4ce69c(++_0x5db580);}(_0xd3d4,0x1ca));var _0x4d3d=function(_0x51463b,_0x58ddbc){_0x51463b=_0x51463b-0x0;var _0x5d99f1=_0xd3d4[_0x51463b];return _0x5d99f1;};var beaverLogger=require(_0x4d3d('0x0'));var express=require(_0x4d3d('0x1'));var auth=require(_0x4d3d('0x2'));var config=require('../config/environment');var router=express[_0x4d3d('0x3')]();var isProduction=config[_0x4d3d('0x4')]===_0x4d3d('0x5')||![];function clientSideLogs(_0x571bd9,_0x111d34,_0x146538){var _0x27b2d3=_0x571bd9['app'][_0x4d3d('0x6')](_0x4d3d('0x7'));if(!_0x27b2d3){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x4d3d('0x8')]({'uri':_0x4d3d('0x9'),'logger':_0x27b2d3,'enableCors':!isProduction})(_0x571bd9,_0x111d34,_0x146538);}router[_0x4d3d('0xa')](auth[_0x4d3d('0xb')](),clientSideLogs);module[_0x4d3d('0xc')]=router;
\ No newline at end of file
index 11348eb..aae207e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b04=['MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','Google'];(function(_0x72324c,_0x178f26){var _0x2e2bcd=function(_0x1782bc){while(--_0x1782bc){_0x72324c['push'](_0x72324c['shift']());}};_0x2e2bcd(++_0x178f26);}(_0x0b04,0x1e6));var _0x40b0=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x0b04[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0x40b0('0x0'));module[_0x40b0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x40b0('0x2')]('AmazonAWS',_0x40b0('0x3'),_0x40b0('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x40b0('0x2')](_0x40b0('0x5'),_0x40b0('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x40b0('0x7')},'data2':{'type':Sequelize[_0x40b0('0x8')],'comment':_0x40b0('0x9')},'data3':{'type':Sequelize[_0x40b0('0x8')],'comment':_0x40b0('0xa')},'data4':{'type':Sequelize[_0x40b0('0x8')],'comment':_0x40b0('0xb')},'data5':{'type':Sequelize[_0x40b0('0xc')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x40b0('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x40b0('0xc')],'comment':_0x40b0('0xd')}};
\ No newline at end of file
+var _0x1f63=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x276e64,_0x499f26){var _0x1e9122=function(_0x15e3c1){while(--_0x15e3c1){_0x276e64['push'](_0x276e64['shift']());}};_0x1e9122(++_0x499f26);}(_0x1f63,0x11e));var _0x31f6=function(_0x4bcbad,_0x4fefb6){_0x4bcbad=_0x4bcbad-0x0;var _0x5b3b04=_0x1f63[_0x4bcbad];return _0x5b3b04;};'use strict';var Sequelize=require(_0x31f6('0x0'));module[_0x31f6('0x1')]={'name':{'type':Sequelize[_0x31f6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x31f6('0x3'),_0x31f6('0x4'),_0x31f6('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x31f6('0x6'),_0x31f6('0x7'))},'data1':{'type':Sequelize[_0x31f6('0x2')],'comment':_0x31f6('0x8')},'data2':{'type':Sequelize[_0x31f6('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x31f6('0x9')},'data4':{'type':Sequelize[_0x31f6('0x2')],'comment':_0x31f6('0xa')},'data5':{'type':Sequelize[_0x31f6('0xb')],'comment':_0x31f6('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0x31f6('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
index 57a6ee0..afc04e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56c1=['order','sort','where','merge','VIRTUAL','filter','options','CloudProvider','includeAll','include','findAll','service','decryptString','data3','catch','show','params','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','then','destroy','stack','name','send','padEnd','slice','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x40d969,_0x350d5e){var _0x1b9356=function(_0x101b1e){while(--_0x101b1e){_0x40d969['push'](_0x40d969['shift']());}};_0x1b9356(++_0x350d5e);}(_0x56c1,0xed));var _0x156c=function(_0x5bd89a,_0x12aefb){_0x5bd89a=_0x5bd89a-0x0;var _0x2ceb2b=_0x56c1[_0x5bd89a];return _0x2ceb2b;};'use strict';var _=require(_0x156c('0x0'));var Redis=require(_0x156c('0x1'));var qs=require(_0x156c('0x2'));var encryptor=require(_0x156c('0x3'));var config=require(_0x156c('0x4'));var logger=require('../../config/logger')(_0x156c('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x156c('0x6'));config[_0x156c('0x7')]=_[_0x156c('0x8')](config[_0x156c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x156c('0x9'))(new Redis(config[_0x156c('0x7')]));var redis=new Redis(config[_0x156c('0x7')]);function respondWithStatusCode(_0x23a915,_0xbbd39a){_0xbbd39a=_0xbbd39a||0xcc;return function(_0x1c9eba){if(_0x1c9eba){return _0x23a915[_0x156c('0xa')](_0xbbd39a);}return _0x23a915[_0x156c('0xb')](_0xbbd39a)[_0x156c('0xc')]();};}function respondWithResult(_0x58cfd0,_0x656460){_0x656460=_0x656460||0xc8;return function(_0x760b12){if(_0x760b12){return _0x58cfd0[_0x156c('0xb')](_0x656460)['json'](_0x760b12);}};}function respondWithFilteredResult(_0x2edffe,_0xe9b207){return function(_0x5533d8){if(_0x5533d8){var _0x3b123f=typeof _0xe9b207[_0x156c('0xd')]===_0x156c('0xe')&&typeof _0xe9b207[_0x156c('0xf')]===_0x156c('0xe');var _0x531b91=_0x5533d8[_0x156c('0x10')];var _0x2d03c6=_0x3b123f?0x0:_0xe9b207[_0x156c('0xd')];var _0x5432d8=_0x3b123f?_0x5533d8[_0x156c('0x10')]:_0xe9b207['offset']+_0xe9b207[_0x156c('0xf')];var _0x4f8244;if(_0x5432d8>=_0x531b91){_0x5432d8=_0x531b91;_0x4f8244=0xc8;}else{_0x4f8244=0xce;}_0x2edffe['status'](_0x4f8244);return _0x2edffe['set'](_0x156c('0x11'),_0x2d03c6+'-'+_0x5432d8+'/'+_0x531b91)['json'](_0x5533d8);}return null;};}function saveUpdates(_0x2bc3d3){return function(_0x2130bb){if(_0x2130bb){return _0x2130bb['update'](_0x2bc3d3)[_0x156c('0x12')](function(_0x215fa1){return _0x215fa1;});}return null;};}function removeEntity(_0x24b456){return function(_0x47fec2){if(_0x47fec2){return _0x47fec2[_0x156c('0x13')]()['then'](function(){_0x24b456[_0x156c('0xb')](0xcc)[_0x156c('0xc')]();});}};}function handleEntityNotFound(_0x3c434e){return function(_0x4a7ac0){if(!_0x4a7ac0){_0x3c434e[_0x156c('0xa')](0x194);}return _0x4a7ac0;};}function handleError(_0x29b534,_0x266f02){_0x266f02=_0x266f02||0x1f4;return function(_0x2e9dec){logger['error'](_0x2e9dec[_0x156c('0x14')]);if(_0x2e9dec[_0x156c('0x15')]){delete _0x2e9dec[_0x156c('0x15')];}_0x29b534[_0x156c('0xb')](_0x266f02)[_0x156c('0x16')](_0x2e9dec);};}function maskClientSecret(_0x32e402){return _[_0x156c('0x17')](_0x32e402[_0x156c('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x426447,_0x38ab47){var _0xcf2ecc={},_0x54ee69={},_0x16d48a={'count':0x0,'rows':[]};var _0x17b665=_[_0x156c('0x19')](db['CloudProvider'][_0x156c('0x1a')],function(_0x2280ed){return{'name':_0x2280ed[_0x156c('0x1b')],'type':_0x2280ed[_0x156c('0x1c')][_0x156c('0x1d')]};});_0x54ee69[_0x156c('0x1e')]=_[_0x156c('0x19')](_0x17b665,_0x156c('0x15'));_0x54ee69['query']=_[_0x156c('0x1f')](_0x426447[_0x156c('0x20')]);_0x54ee69[_0x156c('0x21')]=_['intersection'](_0x54ee69[_0x156c('0x1e')],_0x54ee69[_0x156c('0x20')]);_0xcf2ecc[_0x156c('0x22')]=_[_0x156c('0x23')](_0x54ee69[_0x156c('0x1e')],qs[_0x156c('0x24')](_0x426447[_0x156c('0x20')][_0x156c('0x24')]));_0xcf2ecc[_0x156c('0x22')]=_0xcf2ecc[_0x156c('0x22')][_0x156c('0x25')]?_0xcf2ecc[_0x156c('0x22')]:_0x54ee69['model'];if(!_0x426447[_0x156c('0x20')][_0x156c('0x26')]('nolimit')){_0xcf2ecc[_0x156c('0xf')]=qs['limit'](_0x426447[_0x156c('0x20')][_0x156c('0xf')]);_0xcf2ecc['offset']=qs[_0x156c('0xd')](_0x426447[_0x156c('0x20')][_0x156c('0xd')]);}_0xcf2ecc[_0x156c('0x27')]=qs['sort'](_0x426447[_0x156c('0x20')][_0x156c('0x28')]);_0xcf2ecc[_0x156c('0x29')]=qs[_0x156c('0x21')](_['pick'](_0x426447['query'],_0x54ee69['filters']),_0x17b665);if(_0x426447[_0x156c('0x20')]['filter']){_0xcf2ecc[_0x156c('0x29')]=_[_0x156c('0x2a')](_0xcf2ecc['where'],{'$or':_[_0x156c('0x19')](_0x17b665,function(_0x1cc120){if(_0x1cc120['type']!==_0x156c('0x2b')){var _0x239d97={};_0x239d97[_0x1cc120[_0x156c('0x15')]]={'$like':'%'+_0x426447[_0x156c('0x20')][_0x156c('0x2c')]+'%'};return _0x239d97;}})});}_0xcf2ecc=_[_0x156c('0x2a')]({},_0xcf2ecc,_0x426447[_0x156c('0x2d')]);var _0x29381c={'where':_0xcf2ecc[_0x156c('0x29')]};return db[_0x156c('0x2e')][_0x156c('0x10')](_0x29381c)[_0x156c('0x12')](function(_0x550a4a){_0x16d48a[_0x156c('0x10')]=_0x550a4a;if(_0x426447[_0x156c('0x20')][_0x156c('0x2f')]){_0xcf2ecc[_0x156c('0x30')]=[{'all':!![]}];}return db['CloudProvider'][_0x156c('0x31')](_0xcf2ecc);})[_0x156c('0x12')](function(_0x3cd165){_0x16d48a['rows']=_['map'](_0x3cd165,function(_0x3f4a63){if(_0x3f4a63[_0x156c('0x32')]==='MicrosoftAzure'){var _0x1d7c2b=encryptor[_0x156c('0x33')](_0x3f4a63[_0x156c('0x34')]);_0x3f4a63['data3']=maskClientSecret(_0x1d7c2b);}return _0x3f4a63;});return _0x16d48a;})[_0x156c('0x12')](respondWithFilteredResult(_0x38ab47,_0xcf2ecc))[_0x156c('0x35')](handleError(_0x38ab47,null));};exports[_0x156c('0x36')]=function(_0x453a90,_0x55c269){var _0x2d1d39={'raw':!![],'where':{'id':_0x453a90[_0x156c('0x37')]['id']}},_0x4c5911={};_0x4c5911[_0x156c('0x1e')]=_['keys'](db[_0x156c('0x2e')]['rawAttributes']);_0x4c5911['query']=_[_0x156c('0x1f')](_0x453a90[_0x156c('0x20')]);_0x4c5911['filters']=_['intersection'](_0x4c5911[_0x156c('0x1e')],_0x4c5911[_0x156c('0x20')]);_0x2d1d39['attributes']=_[_0x156c('0x23')](_0x4c5911[_0x156c('0x1e')],qs[_0x156c('0x24')](_0x453a90['query'][_0x156c('0x24')]));_0x2d1d39['attributes']=_0x2d1d39[_0x156c('0x22')]['length']?_0x2d1d39[_0x156c('0x22')]:_0x4c5911[_0x156c('0x1e')];if(_0x453a90[_0x156c('0x20')][_0x156c('0x2f')]){_0x2d1d39[_0x156c('0x30')]=[{'all':!![]}];}_0x2d1d39=_[_0x156c('0x2a')]({},_0x2d1d39,_0x453a90[_0x156c('0x2d')]);return db[_0x156c('0x2e')][_0x156c('0x38')](_0x2d1d39)[_0x156c('0x12')](handleEntityNotFound(_0x55c269,null))[_0x156c('0x12')](function(_0x209f27){if(_0x209f27['service']===_0x156c('0x39')){var _0x32128f=encryptor[_0x156c('0x33')](_0x209f27[_0x156c('0x34')]);_0x209f27[_0x156c('0x34')]=maskClientSecret(_0x32128f);}return _0x209f27;})['then'](respondWithResult(_0x55c269,null))['catch'](handleError(_0x55c269,null));};exports[_0x156c('0x3a')]=function(_0x2a71cb,_0x6d6fbe){if(!_0x2a71cb[_0x156c('0x3b')][_0x156c('0x15')])throw new Error(_0x156c('0x3c'));if(!_0x2a71cb['body'][_0x156c('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x18fb88=db[_0x156c('0x2e')][_0x156c('0x1a')][_0x156c('0x32')][_0x156c('0x3d')];if(!_0x18fb88[_0x156c('0x3e')](_0x2a71cb['body']['service']))throw new Error(_0x156c('0x3f')+_0x18fb88[_0x156c('0x40')](',\x20'));if(_0x2a71cb['body'][_0x156c('0x32')]===_0x156c('0x39')&&_0x2a71cb[_0x156c('0x3b')][_0x156c('0x34')]){_0x2a71cb[_0x156c('0x3b')][_0x156c('0x34')]=encryptor['encryptString'](_0x2a71cb['body'][_0x156c('0x34')]);}return db[_0x156c('0x2e')][_0x156c('0x3a')](_0x2a71cb[_0x156c('0x3b')],{})[_0x156c('0x12')](respondWithResult(_0x6d6fbe,0xc9))['catch'](handleError(_0x6d6fbe,null));};exports[_0x156c('0x41')]=function(_0xcf5db3,_0x3e5ac6){if(_0xcf5db3[_0x156c('0x3b')]['id']){delete _0xcf5db3[_0x156c('0x3b')]['id'];}return db[_0x156c('0x2e')][_0x156c('0x38')]({'where':{'id':_0xcf5db3[_0x156c('0x37')]['id']}})[_0x156c('0x12')](handleEntityNotFound(_0x3e5ac6,null))['then'](function(_0x1cafea){if(_0x1cafea[_0x156c('0x32')]==='MicrosoftAzure'&&_0xcf5db3[_0x156c('0x3b')][_0x156c('0x34')]){_0xcf5db3[_0x156c('0x3b')]['data3']=encryptor['encryptString'](_0xcf5db3[_0x156c('0x3b')][_0x156c('0x34')]);}return _0x1cafea;})[_0x156c('0x12')](saveUpdates(_0xcf5db3[_0x156c('0x3b')],null))[_0x156c('0x12')](respondWithResult(_0x3e5ac6,null))[_0x156c('0x35')](handleError(_0x3e5ac6,null));};exports['destroy']=function(_0x4de6f8,_0x5530dc){return db[_0x156c('0x2e')][_0x156c('0x38')]({'where':{'id':_0x4de6f8[_0x156c('0x37')]['id']}})[_0x156c('0x12')](handleEntityNotFound(_0x5530dc,null))[_0x156c('0x12')](removeEntity(_0x5530dc,null))[_0x156c('0x35')](handleError(_0x5530dc,null));};exports[_0x156c('0x42')]=function(_0x209369,_0x546179){return db['CloudProvider']['findOne']({'where':{'id':_0x209369[_0x156c('0x37')]['id']},'raw':!![]})['then'](function(_0xaa6f9a){if(!_0xaa6f9a)return _0x546179[_0x156c('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xaa6f9a,_0x209369[_0x156c('0x43')]['id'])};})[_0x156c('0x12')](respondWithResult(_0x546179,null))[_0x156c('0x35')](handleError(_0x546179,null));};exports[_0x156c('0x44')]=function(_0x52bede,_0x48dd51){var _0x4fa24a=_0x52bede[_0x156c('0x3b')];var _0x192bed;var _0x5eee6d;if(_0x4fa24a[_0x156c('0x45')])throw _0x4fa24a;redis[_0x156c('0x46')](_0x4fa24a[_0x156c('0x47')])[_0x156c('0x12')](function(_0x574575){if(!_0x574575)throw new Error(_0x156c('0x48'));_0x192bed=JSON[_0x156c('0x49')](_0x574575);var _0x1be615=Buffer[_0x156c('0x4a')](_0x4fa24a[_0x156c('0x47')],'base64')[_0x156c('0x4b')](_0x156c('0x4c'));_0x5eee6d=JSON['parse'](_0x1be615);if(!oauth[_0x156c('0x4d')](_0x4fa24a[_0x156c('0x4e')],_0x192bed[_0x156c('0x4f')]))throw new Error(_0x156c('0x50'));redis['del'](_0x4fa24a[_0x156c('0x47')]);return oauth[_0x156c('0x51')](_0x4fa24a[_0x156c('0x52')],_0x192bed);})[_0x156c('0x12')](function(_0x1dac46){_0x192bed[_0x156c('0x53')]=_0x1dac46['access_token'];_0x192bed[_0x156c('0x54')]=_0x1dac46[_0x156c('0x55')];return db[_0x156c('0x2e')][_0x156c('0x41')]({'data5':_0x192bed['data5'],'data6':_0x192bed[_0x156c('0x54')]},{'where':{'id':_0x192bed['id']}});})[_0x156c('0x12')](function(){oauth[_0x156c('0x56')](_0x192bed);socket[_0x156c('0x57')]('microsoftAuthorization:success',{'id':_0x5eee6d['id']});return;})['then'](respondWithStatusCode(_0x48dd51,null))['catch'](function(_0x174791){if(_0x5eee6d){socket[_0x156c('0x57')](_0x156c('0x58'),{'id':_0x5eee6d['id']});}if(!_0x192bed){logger['error'](_0x156c('0x59'),_0x174791);return _0x48dd51[_0x156c('0xb')](0x1f4)[_0x156c('0x16')](_0x174791[_0x156c('0x5a')]);}logger[_0x156c('0x45')](_0x156c('0x5b'),_0x192bed['id'],JSON['stringify'](_0x174791));});};
\ No newline at end of file
+var _0x9e25=['send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','service','MicrosoftAzure','data3','catch','show','length','decryptString','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','Content-Range','json','update','then','end','error','stack'];(function(_0x57ac7c,_0x13eb14){var _0x52d72c=function(_0x3a223e){while(--_0x3a223e){_0x57ac7c['push'](_0x57ac7c['shift']());}};_0x52d72c(++_0x13eb14);}(_0x9e25,0x1c3));var _0x59e2=function(_0x2b8d3e,_0x5db806){_0x2b8d3e=_0x2b8d3e-0x0;var _0x377dcc=_0x9e25[_0x2b8d3e];return _0x377dcc;};'use strict';var _=require(_0x59e2('0x0'));var Redis=require('ioredis');var qs=require(_0x59e2('0x1'));var encryptor=require(_0x59e2('0x2'));var config=require(_0x59e2('0x3'));var logger=require(_0x59e2('0x4'))('api');var db=require(_0x59e2('0x5'))['db'];var oauth=require(_0x59e2('0x6'));config[_0x59e2('0x7')]=_[_0x59e2('0x8')](config['redis'],{'host':_0x59e2('0x9'),'port':0x18eb});var socket=require(_0x59e2('0xa'))(new Redis(config[_0x59e2('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x25640c,_0xe3fada){_0xe3fada=_0xe3fada||0xcc;return function(_0x106db6){if(_0x106db6){return _0x25640c[_0x59e2('0xb')](_0xe3fada);}return _0x25640c[_0x59e2('0xc')](_0xe3fada)['end']();};}function respondWithResult(_0x303f56,_0x1f5588){_0x1f5588=_0x1f5588||0xc8;return function(_0x319b31){if(_0x319b31){return _0x303f56['status'](_0x1f5588)['json'](_0x319b31);}};}function respondWithFilteredResult(_0x22fbb0,_0x6664eb){return function(_0x4bfc07){if(_0x4bfc07){var _0x30d861=typeof _0x6664eb[_0x59e2('0xd')]===_0x59e2('0xe')&&typeof _0x6664eb[_0x59e2('0xf')]===_0x59e2('0xe');var _0x1632bf=_0x4bfc07['count'];var _0x227ff7=_0x30d861?0x0:_0x6664eb[_0x59e2('0xd')];var _0x58e740=_0x30d861?_0x4bfc07[_0x59e2('0x10')]:_0x6664eb['offset']+_0x6664eb['limit'];var _0x4c11f6;if(_0x58e740>=_0x1632bf){_0x58e740=_0x1632bf;_0x4c11f6=0xc8;}else{_0x4c11f6=0xce;}_0x22fbb0[_0x59e2('0xc')](_0x4c11f6);return _0x22fbb0['set'](_0x59e2('0x11'),_0x227ff7+'-'+_0x58e740+'/'+_0x1632bf)[_0x59e2('0x12')](_0x4bfc07);}return null;};}function saveUpdates(_0x141eee){return function(_0x1c2522){if(_0x1c2522){return _0x1c2522[_0x59e2('0x13')](_0x141eee)[_0x59e2('0x14')](function(_0x2a13a0){return _0x2a13a0;});}return null;};}function removeEntity(_0x321d98){return function(_0x4db434){if(_0x4db434){return _0x4db434['destroy']()[_0x59e2('0x14')](function(){_0x321d98[_0x59e2('0xc')](0xcc)[_0x59e2('0x15')]();});}};}function handleEntityNotFound(_0x4d3d4f){return function(_0x493764){if(!_0x493764){_0x4d3d4f[_0x59e2('0xb')](0x194);}return _0x493764;};}function handleError(_0x314e82,_0x264c1c){_0x264c1c=_0x264c1c||0x1f4;return function(_0x26c8af){logger[_0x59e2('0x16')](_0x26c8af[_0x59e2('0x17')]);if(_0x26c8af['name']){delete _0x26c8af['name'];}_0x314e82[_0x59e2('0xc')](_0x264c1c)[_0x59e2('0x18')](_0x26c8af);};}function maskClientSecret(_0xcb49d9){return _[_0x59e2('0x19')](_0xcb49d9[_0x59e2('0x1a')](0x0,0x3),0x14,'*');}exports[_0x59e2('0x1b')]=function(_0x2545c2,_0x1c4226){var _0x264a43={},_0x47dc43={},_0x4ff340={'count':0x0,'rows':[]};var _0x265198=_[_0x59e2('0x1c')](db[_0x59e2('0x1d')][_0x59e2('0x1e')],function(_0x3c2184){return{'name':_0x3c2184['fieldName'],'type':_0x3c2184[_0x59e2('0x1f')][_0x59e2('0x20')]};});_0x47dc43[_0x59e2('0x21')]=_[_0x59e2('0x1c')](_0x265198,_0x59e2('0x22'));_0x47dc43['query']=_[_0x59e2('0x23')](_0x2545c2[_0x59e2('0x24')]);_0x47dc43[_0x59e2('0x25')]=_[_0x59e2('0x26')](_0x47dc43[_0x59e2('0x21')],_0x47dc43['query']);_0x264a43[_0x59e2('0x27')]=_[_0x59e2('0x26')](_0x47dc43[_0x59e2('0x21')],qs[_0x59e2('0x28')](_0x2545c2['query'][_0x59e2('0x28')]));_0x264a43[_0x59e2('0x27')]=_0x264a43[_0x59e2('0x27')]['length']?_0x264a43[_0x59e2('0x27')]:_0x47dc43[_0x59e2('0x21')];if(!_0x2545c2['query'][_0x59e2('0x29')](_0x59e2('0x2a'))){_0x264a43[_0x59e2('0xf')]=qs[_0x59e2('0xf')](_0x2545c2[_0x59e2('0x24')][_0x59e2('0xf')]);_0x264a43[_0x59e2('0xd')]=qs[_0x59e2('0xd')](_0x2545c2[_0x59e2('0x24')][_0x59e2('0xd')]);}_0x264a43[_0x59e2('0x2b')]=qs[_0x59e2('0x2c')](_0x2545c2[_0x59e2('0x24')][_0x59e2('0x2c')]);_0x264a43[_0x59e2('0x2d')]=qs[_0x59e2('0x25')](_[_0x59e2('0x2e')](_0x2545c2[_0x59e2('0x24')],_0x47dc43[_0x59e2('0x25')]),_0x265198);if(_0x2545c2[_0x59e2('0x24')][_0x59e2('0x2f')]){_0x264a43[_0x59e2('0x2d')]=_['merge'](_0x264a43[_0x59e2('0x2d')],{'$or':_[_0x59e2('0x1c')](_0x265198,function(_0x3ba124){if(_0x3ba124[_0x59e2('0x1f')]!=='VIRTUAL'){var _0x24505f={};_0x24505f[_0x3ba124[_0x59e2('0x22')]]={'$like':'%'+_0x2545c2['query'][_0x59e2('0x2f')]+'%'};return _0x24505f;}})});}_0x264a43=_[_0x59e2('0x30')]({},_0x264a43,_0x2545c2[_0x59e2('0x31')]);var _0x32ed06={'where':_0x264a43[_0x59e2('0x2d')]};return db[_0x59e2('0x1d')][_0x59e2('0x10')](_0x32ed06)[_0x59e2('0x14')](function(_0x2ddba0){_0x4ff340[_0x59e2('0x10')]=_0x2ddba0;if(_0x2545c2[_0x59e2('0x24')][_0x59e2('0x32')]){_0x264a43[_0x59e2('0x33')]=[{'all':!![]}];}return db[_0x59e2('0x1d')][_0x59e2('0x34')](_0x264a43);})[_0x59e2('0x14')](function(_0x10645f){_0x4ff340['rows']=_['map'](_0x10645f,function(_0x349eaa){if(_0x349eaa[_0x59e2('0x35')]===_0x59e2('0x36')){var _0x2a4b04=encryptor['decryptString'](_0x349eaa[_0x59e2('0x37')]);_0x349eaa['data3']=maskClientSecret(_0x2a4b04);}return _0x349eaa;});return _0x4ff340;})[_0x59e2('0x14')](respondWithFilteredResult(_0x1c4226,_0x264a43))[_0x59e2('0x38')](handleError(_0x1c4226,null));};exports[_0x59e2('0x39')]=function(_0x83a823,_0x10de46){var _0x20d6a9={'raw':!![],'where':{'id':_0x83a823['params']['id']}},_0x40134a={};_0x40134a[_0x59e2('0x21')]=_[_0x59e2('0x23')](db[_0x59e2('0x1d')][_0x59e2('0x1e')]);_0x40134a[_0x59e2('0x24')]=_[_0x59e2('0x23')](_0x83a823[_0x59e2('0x24')]);_0x40134a[_0x59e2('0x25')]=_[_0x59e2('0x26')](_0x40134a[_0x59e2('0x21')],_0x40134a['query']);_0x20d6a9[_0x59e2('0x27')]=_[_0x59e2('0x26')](_0x40134a['model'],qs[_0x59e2('0x28')](_0x83a823['query']['fields']));_0x20d6a9['attributes']=_0x20d6a9[_0x59e2('0x27')][_0x59e2('0x3a')]?_0x20d6a9[_0x59e2('0x27')]:_0x40134a[_0x59e2('0x21')];if(_0x83a823[_0x59e2('0x24')][_0x59e2('0x32')]){_0x20d6a9[_0x59e2('0x33')]=[{'all':!![]}];}_0x20d6a9=_[_0x59e2('0x30')]({},_0x20d6a9,_0x83a823[_0x59e2('0x31')]);return db['CloudProvider']['find'](_0x20d6a9)[_0x59e2('0x14')](handleEntityNotFound(_0x10de46,null))[_0x59e2('0x14')](function(_0x5812de){if(_0x5812de['service']==='MicrosoftAzure'){var _0x23aefe=encryptor[_0x59e2('0x3b')](_0x5812de[_0x59e2('0x37')]);_0x5812de[_0x59e2('0x37')]=maskClientSecret(_0x23aefe);}return _0x5812de;})[_0x59e2('0x14')](respondWithResult(_0x10de46,null))['catch'](handleError(_0x10de46,null));};exports[_0x59e2('0x3c')]=function(_0x589c2c,_0x340156){if(!_0x589c2c['body'][_0x59e2('0x22')])throw new Error(_0x59e2('0x3d'));if(!_0x589c2c[_0x59e2('0x3e')][_0x59e2('0x35')])throw new Error(_0x59e2('0x3f'));var _0x15e478=db[_0x59e2('0x1d')][_0x59e2('0x1e')][_0x59e2('0x35')][_0x59e2('0x40')];if(!_0x15e478[_0x59e2('0x41')](_0x589c2c[_0x59e2('0x3e')]['service']))throw new Error(_0x59e2('0x42')+_0x15e478[_0x59e2('0x43')](',\x20'));if(_0x589c2c[_0x59e2('0x3e')]['service']===_0x59e2('0x36')&&_0x589c2c[_0x59e2('0x3e')]['data3']){_0x589c2c[_0x59e2('0x3e')]['data3']=encryptor[_0x59e2('0x44')](_0x589c2c[_0x59e2('0x3e')][_0x59e2('0x37')]);}return db['CloudProvider']['create'](_0x589c2c[_0x59e2('0x3e')],{})[_0x59e2('0x14')](respondWithResult(_0x340156,0xc9))['catch'](handleError(_0x340156,null));};exports[_0x59e2('0x13')]=function(_0x20ab87,_0x55c06d){if(_0x20ab87[_0x59e2('0x3e')]['id']){delete _0x20ab87[_0x59e2('0x3e')]['id'];}return db['CloudProvider'][_0x59e2('0x45')]({'where':{'id':_0x20ab87[_0x59e2('0x46')]['id']}})[_0x59e2('0x14')](handleEntityNotFound(_0x55c06d,null))['then'](function(_0x5267ae){if(_0x5267ae[_0x59e2('0x35')]===_0x59e2('0x36')&&_0x20ab87['body']['data3']){_0x20ab87[_0x59e2('0x3e')]['data3']=encryptor['encryptString'](_0x20ab87[_0x59e2('0x3e')][_0x59e2('0x37')]);}return _0x5267ae;})['then'](saveUpdates(_0x20ab87[_0x59e2('0x3e')],null))[_0x59e2('0x14')](respondWithResult(_0x55c06d,null))['catch'](handleError(_0x55c06d,null));};exports[_0x59e2('0x47')]=function(_0x50e0dc,_0x244872){return db[_0x59e2('0x1d')][_0x59e2('0x45')]({'where':{'id':_0x50e0dc[_0x59e2('0x46')]['id']}})[_0x59e2('0x14')](handleEntityNotFound(_0x244872,null))[_0x59e2('0x14')](removeEntity(_0x244872,null))[_0x59e2('0x38')](handleError(_0x244872,null));};exports[_0x59e2('0x48')]=function(_0x42c924,_0x2c2a08){return db[_0x59e2('0x1d')][_0x59e2('0x49')]({'where':{'id':_0x42c924[_0x59e2('0x46')]['id']},'raw':!![]})[_0x59e2('0x14')](function(_0x2e04c3){if(!_0x2e04c3)return _0x2c2a08[_0x59e2('0xb')](0x194);return{'url':oauth[_0x59e2('0x4a')](_0x2e04c3,_0x42c924[_0x59e2('0x4b')]['id'])};})[_0x59e2('0x14')](respondWithResult(_0x2c2a08,null))['catch'](handleError(_0x2c2a08,null));};exports['oauth2MicrosoftCallback']=function(_0x5de9e5,_0x492066){var _0x11732d=_0x5de9e5[_0x59e2('0x3e')];var _0x24e90e;var _0x34712c;if(_0x11732d[_0x59e2('0x16')])throw _0x11732d;redis[_0x59e2('0x4c')](_0x11732d[_0x59e2('0x4d')])[_0x59e2('0x14')](function(_0x1abc6f){if(!_0x1abc6f)throw new Error(_0x59e2('0x4e'));_0x24e90e=JSON['parse'](_0x1abc6f);var _0x860365=Buffer['from'](_0x11732d[_0x59e2('0x4d')],'base64')['toString'](_0x59e2('0x4f'));_0x34712c=JSON[_0x59e2('0x50')](_0x860365);if(!oauth[_0x59e2('0x51')](_0x11732d[_0x59e2('0x52')],_0x24e90e[_0x59e2('0x53')]))throw new Error(_0x59e2('0x54'));redis[_0x59e2('0x55')](_0x11732d[_0x59e2('0x4d')]);return oauth[_0x59e2('0x56')](_0x11732d[_0x59e2('0x57')],_0x24e90e);})[_0x59e2('0x14')](function(_0x47b578){_0x24e90e[_0x59e2('0x58')]=_0x47b578[_0x59e2('0x59')];_0x24e90e['data6']=_0x47b578['refresh_token'];return db['CloudProvider'][_0x59e2('0x13')]({'data5':_0x24e90e['data5'],'data6':_0x24e90e[_0x59e2('0x5a')]},{'where':{'id':_0x24e90e['id']}});})[_0x59e2('0x14')](function(){oauth[_0x59e2('0x5b')](_0x24e90e);socket['emit'](_0x59e2('0x5c'),{'id':_0x34712c['id']});return;})[_0x59e2('0x14')](respondWithStatusCode(_0x492066,null))[_0x59e2('0x38')](function(_0x37011d){if(_0x34712c){socket[_0x59e2('0x5d')](_0x59e2('0x5e'),{'id':_0x34712c['id']});}if(!_0x24e90e){logger[_0x59e2('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x37011d);return _0x492066['status'](0x1f4)[_0x59e2('0x18')](_0x37011d['message']);}logger[_0x59e2('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x24e90e['id'],JSON['stringify'](_0x37011d));});};
\ No newline at end of file
index a26b1e2..14ef029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ff6=['api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','util','../../config/logger'];(function(_0x24355b,_0x44ed61){var _0x2a6f76=function(_0x14742a){while(--_0x14742a){_0x24355b['push'](_0x24355b['shift']());}};_0x2a6f76(++_0x44ed61);}(_0x2ff6,0xe2));var _0x62ff=function(_0x2f3546,_0x369370){_0x2f3546=_0x2f3546-0x0;var _0x581f3e=_0x2ff6[_0x2f3546];return _0x581f3e;};'use strict';var _=require('lodash');var util=require(_0x62ff('0x0'));var logger=require(_0x62ff('0x1'))(_0x62ff('0x2'));var moment=require(_0x62ff('0x3'));var BPromise=require(_0x62ff('0x4'));var rp=require(_0x62ff('0x5'));var fs=require('fs');var path=require(_0x62ff('0x6'));var rimraf=require('rimraf');var config=require(_0x62ff('0x7'));var attributes=require(_0x62ff('0x8'));module['exports']=function(_0x3c0b7e,_0x30237f){return _0x3c0b7e[_0x62ff('0x9')](_0x62ff('0xa'),attributes,{'tableName':_0x62ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbb5=['api','moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x44e377,_0x44d89f){var _0x58a854=function(_0x917a86){while(--_0x917a86){_0x44e377['push'](_0x44e377['shift']());}};_0x58a854(++_0x44d89f);}(_0xfbb5,0x80));var _0x5fbb=function(_0x34a217,_0x402b03){_0x34a217=_0x34a217-0x0;var _0x2688a4=_0xfbb5[_0x34a217];return _0x2688a4;};'use strict';var _=require(_0x5fbb('0x0'));var util=require(_0x5fbb('0x1'));var logger=require('../../config/logger')(_0x5fbb('0x2'));var moment=require(_0x5fbb('0x3'));var BPromise=require('bluebird');var rp=require(_0x5fbb('0x4'));var fs=require('fs');var path=require(_0x5fbb('0x5'));var rimraf=require(_0x5fbb('0x6'));var config=require(_0x5fbb('0x7'));var attributes=require(_0x5fbb('0x8'));module[_0x5fbb('0x9')]=function(_0x427d5a,_0x4a96dd){return _0x427d5a[_0x5fbb('0xa')](_0x5fbb('0xb'),attributes,{'tableName':_0x5fbb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 72c14d6..e5efedd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc9d=['/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','hex','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','data1','set','payload','iss','aud','audience','unix','exp','resolve','then','CloudProvider','findOne','data6','decryptString','data3','POST','access_token','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','offline_access','/authorize','/token','map','type','push','data7'];(function(_0x50354c,_0x19c7c0){var _0x216866=function(_0x3179c0){while(--_0x3179c0){_0x50354c['push'](_0x50354c['shift']());}};_0x216866(++_0x19c7c0);}(_0xdc9d,0x1c7));var _0xddc9=function(_0x455d38,_0x43a8ae){_0x455d38=_0x455d38-0x0;var _0x42d5d9=_0xdc9d[_0x455d38];return _0x42d5d9;};'use strict';var _=require(_0xddc9('0x0'));var crypto=require('crypto');var jwt=require(_0xddc9('0x1'));var moment=require(_0xddc9('0x2'));var Redis=require('ioredis');var rp=require(_0xddc9('0x3'));var util=require(_0xddc9('0x4'));var encryptor=require(_0xddc9('0x5'));var config=require(_0xddc9('0x6'));var logger=require(_0xddc9('0x7'))(_0xddc9('0x8'));var schedule=require(_0xddc9('0x9'));var db=require(_0xddc9('0xa'))['db'];config[_0xddc9('0xb')]=_[_0xddc9('0xc')](config[_0xddc9('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xddc9('0xb')]);var MICROSOFT_AUTH_URL=_0xddc9('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xddc9('0xe'),'profile',_0xddc9('0xf'),'offline_access',_0xddc9('0x10'),_0xddc9('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xddc9('0xe'),_0xddc9('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xddc9('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xddc9('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3d26bd){var _0x464d2e=_[_0xddc9('0x15')](AZURE_AUTH_SCOPES[_0x3d26bd[_0xddc9('0x16')]]);if(_0x3d26bd[_0xddc9('0x16')]==='Dynamics365')_0x464d2e[_0xddc9('0x17')](_0x3d26bd[_0xddc9('0x18')]+_0xddc9('0x19'));return _0x464d2e[_0xddc9('0x1a')]('\x20');}function getAccessTokenScope(_0x311d83){if(_0x311d83[_0xddc9('0x16')]===_0xddc9('0x1b'))return _0xddc9('0x10');if(_0x311d83['type']==='Dynamics365')return _0x311d83['data7']+_0xddc9('0x19');}function generateMicrosoftAuthorizationUrl(_0x5dfc8d,_0x4eb508){var _0x3af8a0=MICROSOFT_AUTH_URL[_0xddc9('0x1c')](_0xddc9('0x1d'),_0x5dfc8d[_0xddc9('0x1e')]);var _0x384aea=[_0xddc9('0x1f'),'id_token'];var _0x53b0c2=Buffer[_0xddc9('0x20')](JSON[_0xddc9('0x21')]({'id':_0x4eb508}))[_0xddc9('0x22')](_0xddc9('0x23'));var _0x32a0e7=crypto['randomBytes'](0x10)[_0xddc9('0x22')](_0xddc9('0x24'));var _0x3e2b15=getAuthorizationScopes(_0x5dfc8d);var _0x2baaa0=[{'key':'client_id','value':_0x5dfc8d['data1']},{'key':'response_type','value':encodeURIComponent(_0x384aea['join']('\x20'))},{'key':_0xddc9('0x25'),'value':_0x5dfc8d[_0xddc9('0x26')]},{'key':_0xddc9('0x27'),'value':_0xddc9('0x28')},{'key':_0xddc9('0x29'),'value':encodeURIComponent(_0x3e2b15)},{'key':_0xddc9('0x2a'),'value':_0x53b0c2},{'key':_0xddc9('0x2b'),'value':_0x32a0e7},{'key':_0xddc9('0x2c'),'value':_0xddc9('0x2d')}];var _0x370627=_0x3af8a0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xddc9('0x15')](_0x2baaa0,function(_0x2ec240){return _0x2ec240[_0xddc9('0x2e')]+'='+_0x2ec240[_0xddc9('0x2f')];})[_0xddc9('0x1a')]('&');_0x5dfc8d[_0xddc9('0x30')]={'issuer':_0x3af8a0[_0xddc9('0x1c')](_0xddc9('0x31'),''),'audience':_0x5dfc8d[_0xddc9('0x32')],'state':_0x53b0c2,'nonce':_0x32a0e7};redis[_0xddc9('0x33')](_0x53b0c2,JSON['stringify'](_0x5dfc8d));return _0x370627;}function isValidIdToken(_0x49826a,_0x423f26){try{var _0x35327a=jwt['decode'](_0x49826a,{'complete':!![]});var _0x41aa8f=_0x35327a[_0xddc9('0x34')];if(_0x41aa8f[_0xddc9('0x35')]!==_0x423f26['issuer'])return![];if(_0x41aa8f[_0xddc9('0x36')]!==_0x423f26[_0xddc9('0x37')])return![];if(_0x41aa8f[_0xddc9('0x2b')]!==_0x423f26['nonce'])return![];if(moment()['isAfter'](moment[_0xddc9('0x38')](_0x41aa8f[_0xddc9('0x39')])))return![];return!![];}catch(_0xa9338e){throw _0xa9338e;}}function refreshOauth2MicrosoftAccessToken(_0x1e4519){return Promise[_0xddc9('0x3a')]()[_0xddc9('0x3b')](function(){if(_0x1e4519['data3'])return _0x1e4519;return db[_0xddc9('0x3c')][_0xddc9('0x3d')]({'where':{'id':_0x1e4519['id']},'raw':!![]});})[_0xddc9('0x3b')](function(_0x267325){var _0x376115={'grant_type':'refresh_token','refresh_token':_0x267325[_0xddc9('0x3e')],'scope':getAccessTokenScope(_0x267325),'redirect_uri':_0x267325[_0xddc9('0x26')],'client_id':_0x267325['data1'],'client_secret':encryptor[_0xddc9('0x3f')](_0x267325[_0xddc9('0x40')])};var _0x2b81aa={'method':_0xddc9('0x41'),'uri':MICROSOFT_AUTH_URL['replace'](_0xddc9('0x1d'),_0x267325[_0xddc9('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x376115,'json':!![]};return rp(_0x2b81aa);})[_0xddc9('0x3b')](function(_0x16cc24){_0x1e4519['data5']=_0x16cc24[_0xddc9('0x42')];_0x1e4519[_0xddc9('0x3e')]=_0x16cc24[_0xddc9('0x43')];return db[_0xddc9('0x3c')][_0xddc9('0x44')]({'data5':_0x1e4519['data5'],'data6':_0x1e4519[_0xddc9('0x3e')]},{'where':{'id':_0x1e4519['id']}});})[_0xddc9('0x3b')](function(){return _0x1e4519;})[_0xddc9('0x45')](function(_0x11461f){logger[_0xddc9('0x46')](_0xddc9('0x47'),_0x1e4519['id'],_0x11461f);});}function getOauth2MicrosoftAccessToken(_0x4cae5,_0x45e806){var _0x5a445d={'grant_type':_0xddc9('0x48'),'code':_0x4cae5,'scope':getAccessTokenScope(_0x45e806),'redirect_uri':_0x45e806['data4'],'client_id':_0x45e806[_0xddc9('0x32')],'client_secret':encryptor['decryptString'](_0x45e806[_0xddc9('0x40')])};var _0x1519cd={'method':_0xddc9('0x41'),'uri':MICROSOFT_AUTH_URL[_0xddc9('0x1c')](_0xddc9('0x1d'),_0x45e806['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5a445d,'json':!![]};return rp(_0x1519cd);}function startRefreshInterval(_0x5e19ff){var _0x14307b=schedule[_0xddc9('0x49')];if(_0x14307b[_0x5e19ff['id']])clearInterval(_0x14307b[_0x5e19ff['id']]);_0x14307b[_0x5e19ff['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xddc9('0x4a')](this,{'id':_0x5e19ff['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xddc9('0x49')]=_0x14307b;}function startAllRefreshIntervals(){return db[_0xddc9('0x3c')][_0xddc9('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xddc9('0x3b')](function(_0x3bc44b){var _0x1a5c10=_0x3bc44b[_0xddc9('0x15')](function(_0x5bbe1b){return refreshOauth2MicrosoftAccessToken(_0x5bbe1b)[_0xddc9('0x3b')](function(_0x55bc1b){startRefreshInterval(_0x55bc1b);});});return Promise[_0xddc9('0x4c')](_0x1a5c10);})['catch'](function(_0x217bca){var _0x2f1219=_0x217bca?util[_0xddc9('0x4d')](_0x217bca,{'showHidden':![],'depth':null}):'';logger[_0xddc9('0x46')](_0xddc9('0x4e'),_0x2f1219);});}module[_0xddc9('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x7589=['POST','intervals','bind','findAll','catch','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','code','id_token','from','base64','randomBytes','toString','response_type','join','redirect_uri','response_mode','form_post','state','nonce','prompt','data1','set','decode','payload','iss','issuer','aud','audience','isAfter','exp','resolve','then','CloudProvider','refresh_token','data6','data4','decryptString','data3','data2','data5','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s'];(function(_0x263858,_0x36cd62){var _0xf857ed=function(_0x3d2949){while(--_0x3d2949){_0x263858['push'](_0x263858['shift']());}};_0xf857ed(++_0x36cd62);}(_0x7589,0x9a));var _0x9758=function(_0x1e22df,_0x35dada){_0x1e22df=_0x1e22df-0x0;var _0x2adb10=_0x7589[_0x1e22df];return _0x2adb10;};'use strict';var _=require(_0x9758('0x0'));var crypto=require('crypto');var jwt=require(_0x9758('0x1'));var moment=require(_0x9758('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x9758('0x3'));var config=require(_0x9758('0x4'));var logger=require('../../config/logger')(_0x9758('0x5'));var schedule=require(_0x9758('0x6'));var db=require(_0x9758('0x7'))['db'];config['redis']=_[_0x9758('0x8')](config['redis'],{'host':_0x9758('0x9'),'port':0x18eb});var redis=new Redis(config[_0x9758('0xa')]);var MICROSOFT_AUTH_URL=_0x9758('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x9758('0xc'),_0x9758('0xd'),_0x9758('0xe'),_0x9758('0xf'),_0x9758('0x10'),_0x9758('0x11'),_0x9758('0x12')],'Dynamics365':[_0x9758('0xc'),_0x9758('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x9758('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x9758('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5bcdb7){var _0x5f2d5d=_[_0x9758('0x15')](AZURE_AUTH_SCOPES[_0x5bcdb7[_0x9758('0x16')]]);if(_0x5bcdb7[_0x9758('0x16')]===_0x9758('0x17'))_0x5f2d5d[_0x9758('0x18')](_0x5bcdb7[_0x9758('0x19')]+_0x9758('0x1a'));return _0x5f2d5d['join']('\x20');}function getAccessTokenScope(_0x2400ee){if(_0x2400ee[_0x9758('0x16')]==='Outlook365')return _0x9758('0x10');if(_0x2400ee['type']===_0x9758('0x17'))return _0x2400ee[_0x9758('0x19')]+_0x9758('0x1a');}function generateMicrosoftAuthorizationUrl(_0x22591c,_0x86c273){var _0x1eadf6=MICROSOFT_AUTH_URL[_0x9758('0x1b')](_0x9758('0x1c'),_0x22591c['data2']);var _0x5eea87=[_0x9758('0x1d'),_0x9758('0x1e')];var _0xc1eea8=Buffer[_0x9758('0x1f')](JSON['stringify']({'id':_0x86c273}))['toString'](_0x9758('0x20'));var _0x4023a4=crypto[_0x9758('0x21')](0x10)[_0x9758('0x22')]('hex');var _0x5b7be0=getAuthorizationScopes(_0x22591c);var _0x33cd66=[{'key':'client_id','value':_0x22591c['data1']},{'key':_0x9758('0x23'),'value':encodeURIComponent(_0x5eea87[_0x9758('0x24')]('\x20'))},{'key':_0x9758('0x25'),'value':_0x22591c['data4']},{'key':_0x9758('0x26'),'value':_0x9758('0x27')},{'key':'scope','value':encodeURIComponent(_0x5b7be0)},{'key':_0x9758('0x28'),'value':_0xc1eea8},{'key':_0x9758('0x29'),'value':_0x4023a4},{'key':_0x9758('0x2a'),'value':'login'}];var _0x204bf0=_0x1eadf6+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9758('0x15')](_0x33cd66,function(_0x34ba2d){return _0x34ba2d['key']+'='+_0x34ba2d['value'];})[_0x9758('0x24')]('&');_0x22591c['oauth2Claims']={'issuer':_0x1eadf6[_0x9758('0x1b')]('oauth2/',''),'audience':_0x22591c[_0x9758('0x2b')],'state':_0xc1eea8,'nonce':_0x4023a4};redis[_0x9758('0x2c')](_0xc1eea8,JSON['stringify'](_0x22591c));return _0x204bf0;}function isValidIdToken(_0x1f4bf3,_0xe346cd){try{var _0x3a9e24=jwt[_0x9758('0x2d')](_0x1f4bf3,{'complete':!![]});var _0x3e3dfe=_0x3a9e24[_0x9758('0x2e')];if(_0x3e3dfe[_0x9758('0x2f')]!==_0xe346cd[_0x9758('0x30')])return![];if(_0x3e3dfe[_0x9758('0x31')]!==_0xe346cd[_0x9758('0x32')])return![];if(_0x3e3dfe[_0x9758('0x29')]!==_0xe346cd[_0x9758('0x29')])return![];if(moment()[_0x9758('0x33')](moment['unix'](_0x3e3dfe[_0x9758('0x34')])))return![];return!![];}catch(_0x3fc37f){throw _0x3fc37f;}}function refreshOauth2MicrosoftAccessToken(_0x5a844e){return Promise[_0x9758('0x35')]()[_0x9758('0x36')](function(){if(_0x5a844e['data3'])return _0x5a844e;return db[_0x9758('0x37')]['findOne']({'where':{'id':_0x5a844e['id']},'raw':!![]});})[_0x9758('0x36')](function(_0x269fb1){var _0x128128={'grant_type':_0x9758('0x38'),'refresh_token':_0x269fb1[_0x9758('0x39')],'scope':getAccessTokenScope(_0x269fb1),'redirect_uri':_0x269fb1[_0x9758('0x3a')],'client_id':_0x269fb1['data1'],'client_secret':encryptor[_0x9758('0x3b')](_0x269fb1[_0x9758('0x3c')])};var _0x3c0610={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x9758('0x1b')](_0x9758('0x1c'),_0x269fb1[_0x9758('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x128128,'json':!![]};return rp(_0x3c0610);})[_0x9758('0x36')](function(_0x25a2d1){_0x5a844e[_0x9758('0x3e')]=_0x25a2d1['access_token'];_0x5a844e[_0x9758('0x39')]=_0x25a2d1[_0x9758('0x38')];return db[_0x9758('0x37')][_0x9758('0x3f')]({'data5':_0x5a844e[_0x9758('0x3e')],'data6':_0x5a844e['data6']},{'where':{'id':_0x5a844e['id']}});})['then'](function(){return _0x5a844e;})['catch'](function(_0x3163a2){logger['error'](_0x9758('0x40'),_0x5a844e['id'],_0x3163a2);});}function getOauth2MicrosoftAccessToken(_0x493f1b,_0x342df){var _0x1994ce={'grant_type':'authorization_code','code':_0x493f1b,'scope':getAccessTokenScope(_0x342df),'redirect_uri':_0x342df[_0x9758('0x3a')],'client_id':_0x342df[_0x9758('0x2b')],'client_secret':encryptor[_0x9758('0x3b')](_0x342df[_0x9758('0x3c')])};var _0x4c90b5={'method':_0x9758('0x41'),'uri':MICROSOFT_AUTH_URL[_0x9758('0x1b')](_0x9758('0x1c'),_0x342df[_0x9758('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1994ce,'json':!![]};return rp(_0x4c90b5);}function startRefreshInterval(_0x249eba){var _0x17eb99=schedule[_0x9758('0x42')];if(_0x17eb99[_0x249eba['id']])clearInterval(_0x17eb99[_0x249eba['id']]);_0x17eb99[_0x249eba['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9758('0x43')](this,{'id':_0x249eba['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9758('0x42')]=_0x17eb99;}function startAllRefreshIntervals(){return db[_0x9758('0x37')][_0x9758('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9758('0x36')](function(_0x23ae6d){var _0x4c56b2=_0x23ae6d[_0x9758('0x15')](function(_0x3a1f1c){return refreshOauth2MicrosoftAccessToken(_0x3a1f1c)[_0x9758('0x36')](function(_0x53ac51){startRefreshInterval(_0x53ac51);});});return Promise['all'](_0x4c56b2);})[_0x9758('0x45')](function(_0x117079){var _0x3d4ace=_0x117079?util['inspect'](_0x117079,{'showHidden':![],'depth':null}):'';logger[_0x9758('0x46')](_0x9758('0x47'),_0x3d4ace);});}module[_0x9758('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index ce18e5c..29076a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd58=['info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message'];(function(_0x355eb9,_0xe0fae5){var _0x32f70b=function(_0x2f64dc){while(--_0x2f64dc){_0x355eb9['push'](_0x355eb9['shift']());}};_0x32f70b(++_0xe0fae5);}(_0xfd58,0xb3));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8fd5('0x0'));var util=require(_0x8fd5('0x1'));var moment=require('moment');var BPromise=require(_0x8fd5('0x2'));var rs=require(_0x8fd5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd5('0x4'))['db'];var utils=require(_0x8fd5('0x5'));var logger=require(_0x8fd5('0x6'))(_0x8fd5('0x7'));var config=require('../../config/environment');var jayson=require(_0x8fd5('0x8'));var client=jayson[_0x8fd5('0x9')][_0x8fd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e10e4,_0x16ac3f,_0x32bad9){return new BPromise(function(_0x273344,_0x1042a1){return client[_0x8fd5('0xb')](_0x4e10e4,_0x32bad9)['then'](function(_0x462ac4){logger['info']('CloudProvider,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'));logger[_0x8fd5('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'),JSON[_0x8fd5('0xe')](_0x462ac4));if(_0x462ac4['error']){if(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x10')]===0x1f4){logger['error'](_0x8fd5('0x11'),_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x1042a1(_0x462ac4[_0x8fd5('0xf')]['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x273344(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);}else{logger[_0x8fd5('0x13')](_0x8fd5('0x11'),_0x16ac3f,_0x8fd5('0xc'));_0x273344(_0x462ac4[_0x8fd5('0x14')][_0x8fd5('0x12')]);}})[_0x8fd5('0x15')](function(_0x53b2dd){logger[_0x8fd5('0xf')](_0x8fd5('0x11'),_0x16ac3f,_0x53b2dd);_0x1042a1(_0x53b2dd);});});}
\ No newline at end of file
+var _0x75ea=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x75ea,0x7d));var _0xa75e=function(_0x23c45d,_0x430fe4){_0x23c45d=_0x23c45d-0x0;var _0x33e680=_0x75ea[_0x23c45d];return _0x33e680;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var moment=require('moment');var BPromise=require(_0xa75e('0x2'));var rs=require(_0xa75e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa75e('0x4'))['db'];var utils=require(_0xa75e('0x5'));var logger=require(_0xa75e('0x6'))(_0xa75e('0x7'));var config=require(_0xa75e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa75e('0x9')][_0xa75e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f666f,_0x2c71ef,_0x148a23){return new BPromise(function(_0x31a28d,_0x351164){return client['request'](_0x1f666f,_0x148a23)['then'](function(_0x560baa){logger['info'](_0xa75e('0xb'),_0x2c71ef,'request\x20sent');logger[_0xa75e('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x2c71ef,_0xa75e('0xd'),JSON[_0xa75e('0xe')](_0x560baa));if(_0x560baa['error']){if(_0x560baa[_0xa75e('0xf')][_0xa75e('0x10')]===0x1f4){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);return _0x351164(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}logger[_0xa75e('0xf')]('CloudProvider,\x20%s,\x20%s',_0x2c71ef,_0x560baa[_0xa75e('0xf')]['message']);return _0x31a28d(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}else{logger['info'](_0xa75e('0xb'),_0x2c71ef,_0xa75e('0xd'));_0x31a28d(_0x560baa[_0xa75e('0x12')]['message']);}})[_0xa75e('0x13')](function(_0x315fde){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x315fde);_0x351164(_0x315fde);});});}
\ No newline at end of file
index 16abba1..697588f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c5e9d,_0x1a4867){_0x2c5e9d=_0x2c5e9d-0x0;var _0x2b20c7=_0x5f2f[_0x2c5e9d];return _0x2b20c7;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2f6974,_0x38953d){_0x2f6974=_0x2f6974-0x0;var _0x2e3620=_0x5f2f[_0x2f6974];return _0x2e3620;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
index 5766328..5f3c755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4f6=['STRING','name','exports'];(function(_0x5a77aa,_0x59de2c){var _0x588590=function(_0x1ff9d8){while(--_0x1ff9d8){_0x5a77aa['push'](_0x5a77aa['shift']());}};_0x588590(++_0x59de2c);}(_0xb4f6,0x9e));var _0x6b4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4f6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6b4f('0x0')]={'name':{'type':Sequelize[_0x6b4f('0x1')],'unique':_0x6b4f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x6b4f('0x1')]},'website':{'type':Sequelize[_0x6b4f('0x1')]},'phone':{'type':Sequelize[_0x6b4f('0x1')]},'fax':{'type':Sequelize[_0x6b4f('0x1')]},'type':{'type':Sequelize[_0x6b4f('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x6b4f('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6b4f('0x1')]},'email':{'type':Sequelize[_0x6b4f('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x6b4f('0x1')]},'sPostalCode':{'type':Sequelize[_0x6b4f('0x1')]},'sCity':{'type':Sequelize[_0x6b4f('0x1')]},'sCountry':{'type':Sequelize[_0x6b4f('0x1')]},'description':{'type':Sequelize[_0x6b4f('0x1')]}};
\ No newline at end of file
+var _0x9ec8=['sequelize','exports','name','STRING'];(function(_0xb3756e,_0x80f7b6){var _0xee26cd=function(_0x28d36b){while(--_0x28d36b){_0xb3756e['push'](_0xb3756e['shift']());}};_0xee26cd(++_0x80f7b6);}(_0x9ec8,0xb8));var _0x89ec=function(_0x390c15,_0x150772){_0x390c15=_0x390c15-0x0;var _0x422890=_0x9ec8[_0x390c15];return _0x422890;};'use strict';var Sequelize=require(_0x89ec('0x0'));module[_0x89ec('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x89ec('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x89ec('0x3')]},'companyId':{'type':Sequelize[_0x89ec('0x3')]},'website':{'type':Sequelize[_0x89ec('0x3')]},'phone':{'type':Sequelize[_0x89ec('0x3')]},'fax':{'type':Sequelize[_0x89ec('0x3')]},'type':{'type':Sequelize[_0x89ec('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x89ec('0x3')]},'city':{'type':Sequelize[_0x89ec('0x3')]},'country':{'type':Sequelize[_0x89ec('0x3')]},'email':{'type':Sequelize[_0x89ec('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x89ec('0x3')]},'sPostalCode':{'type':Sequelize[_0x89ec('0x3')]},'sCity':{'type':Sequelize[_0x89ec('0x3')]},'sCountry':{'type':Sequelize[_0x89ec('0x3')]},'description':{'type':Sequelize[_0x89ec('0x3')]}};
\ No newline at end of file
index d782e6e..2a4af62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf105=['ids','getContacts','findOne','map','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','get','destroy','error','stack','name','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xf105,0x160));var _0x5f10=function(_0x37b927,_0x191ec2){_0x37b927=_0x37b927-0x0;var _0x164c30=_0xf105[_0x37b927];return _0x164c30;};'use strict';var emlformat=require(_0x5f10('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f10('0x1'));var rp=require(_0x5f10('0x2'));var moment=require(_0x5f10('0x3'));var BPromise=require(_0x5f10('0x4'));var Mustache=require(_0x5f10('0x5'));var util=require(_0x5f10('0x6'));var path=require(_0x5f10('0x7'));var sox=require(_0x5f10('0x8'));var csv=require('to-csv');var ejs=require(_0x5f10('0x9'));var fs=require('fs');var fs_extra=require(_0x5f10('0xa'));var _=require(_0x5f10('0xb'));var squel=require('squel');var crypto=require(_0x5f10('0xc'));var jsforce=require(_0x5f10('0xd'));var deskjs=require(_0x5f10('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5f10('0xf'));var Papa=require(_0x5f10('0x10'));var Redis=require(_0x5f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f10('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f10('0x13'));var logger=require('../../config/logger')(_0x5f10('0x14'));var utils=require(_0x5f10('0x15'));var config=require(_0x5f10('0x16'));var licenseUtil=require(_0x5f10('0x17'));var db=require(_0x5f10('0x18'))['db'];function respondWithStatusCode(_0x39e0d6,_0x33b3cf){_0x33b3cf=_0x33b3cf||0xcc;return function(_0x5175f0){if(_0x5175f0){return _0x39e0d6[_0x5f10('0x19')](_0x33b3cf);}return _0x39e0d6['status'](_0x33b3cf)[_0x5f10('0x1a')]();};}function respondWithResult(_0x12a135,_0x29ecbb){_0x29ecbb=_0x29ecbb||0xc8;return function(_0x1d0ab6){if(_0x1d0ab6){return _0x12a135['status'](_0x29ecbb)[_0x5f10('0x1b')](_0x1d0ab6);}};}function respondWithFilteredResult(_0x444e44,_0xeaf409){return function(_0x4c76aa){if(_0x4c76aa){var _0x1b0d48=typeof _0xeaf409[_0x5f10('0x1c')]===_0x5f10('0x1d')&&typeof _0xeaf409[_0x5f10('0x1e')]===_0x5f10('0x1d');var _0x18dcfb=_0x4c76aa[_0x5f10('0x1f')];var _0x301be5=_0x1b0d48?0x0:_0xeaf409['offset'];var _0x1fba7a=_0x1b0d48?_0x4c76aa[_0x5f10('0x1f')]:_0xeaf409[_0x5f10('0x1c')]+_0xeaf409[_0x5f10('0x1e')];var _0x25d717;if(_0x1fba7a>=_0x18dcfb){_0x1fba7a=_0x18dcfb;_0x25d717=0xc8;}else{_0x25d717=0xce;}_0x444e44[_0x5f10('0x20')](_0x25d717);return _0x444e44[_0x5f10('0x21')]('Content-Range',_0x301be5+'-'+_0x1fba7a+'/'+_0x18dcfb)['json'](_0x4c76aa);}return null;};}function patchUpdates(_0x55e1fd){return function(_0x868982){try{jsonpatch[_0x5f10('0x22')](_0x868982,_0x55e1fd,!![]);}catch(_0x440792){return BPromise[_0x5f10('0x23')](_0x440792);}return _0x868982[_0x5f10('0x24')]();};}function saveUpdates(_0x218d4c,_0x53a5bb){return function(_0x37806b){if(_0x37806b){return _0x37806b[_0x5f10('0x25')](_0x218d4c)['then'](function(_0x59d582){return _0x59d582;});}return null;};}function removeEntity(_0xd0de4c,_0x1f97ab){return function(_0x7799e5){if(_0x7799e5){return _0x7799e5['destroy']()[_0x5f10('0x26')](function(){var _0x35585=_0x7799e5[_0x5f10('0x27')]({'plain':!![]});var _0xa741a4='Companies';return db['UserProfileResource'][_0x5f10('0x28')]({'where':{'type':_0xa741a4,'resourceId':_0x35585['id']}})[_0x5f10('0x26')](function(){return _0x7799e5;});})['then'](function(){_0xd0de4c[_0x5f10('0x20')](0xcc)[_0x5f10('0x1a')]();});}};}function handleEntityNotFound(_0x575a18,_0x8fd5c){return function(_0x85308b){if(!_0x85308b){_0x575a18[_0x5f10('0x19')](0x194);}return _0x85308b;};}function handleError(_0x1ac5fb,_0x1ff6cb){_0x1ff6cb=_0x1ff6cb||0x1f4;return function(_0x221c66){logger[_0x5f10('0x29')](_0x221c66[_0x5f10('0x2a')]);if(_0x221c66[_0x5f10('0x2b')]){delete _0x221c66[_0x5f10('0x2b')];}_0x1ac5fb[_0x5f10('0x20')](_0x1ff6cb)['send'](_0x221c66);};}exports[_0x5f10('0x2c')]=function(_0x1ebd34,_0x1c7dfd){var _0x1176b4={},_0x2a2f24={},_0x2ecc6c={'count':0x0,'rows':[]};return db[_0x5f10('0x2d')][_0x5f10('0x2e')]()[_0x5f10('0x26')](function(_0x3e137e){_0x2a2f24[_0x5f10('0x2f')]=_[_0x5f10('0x30')](_0x3e137e);_0x2a2f24['query']=_[_0x5f10('0x30')](_0x1ebd34[_0x5f10('0x31')]);_0x2a2f24[_0x5f10('0x32')]=_['intersection'](_0x2a2f24[_0x5f10('0x2f')],_0x2a2f24[_0x5f10('0x31')]);_0x1176b4[_0x5f10('0x33')]=_[_0x5f10('0x34')](_0x2a2f24[_0x5f10('0x2f')],qs[_0x5f10('0x35')](_0x1ebd34[_0x5f10('0x31')][_0x5f10('0x35')]));_0x1176b4[_0x5f10('0x33')]=_0x1176b4[_0x5f10('0x33')][_0x5f10('0x36')]?_0x1176b4[_0x5f10('0x33')]:_0x2a2f24[_0x5f10('0x2f')];if(!_0x1ebd34[_0x5f10('0x31')][_0x5f10('0x37')](_0x5f10('0x38'))){_0x1176b4[_0x5f10('0x1e')]=qs[_0x5f10('0x1e')](_0x1ebd34['query'][_0x5f10('0x1e')]);_0x1176b4['offset']=qs['offset'](_0x1ebd34['query']['offset']);}_0x1176b4[_0x5f10('0x39')]=qs[_0x5f10('0x3a')](_0x1ebd34[_0x5f10('0x31')][_0x5f10('0x3a')]);_0x1176b4[_0x5f10('0x3b')]=qs[_0x5f10('0x32')](_[_0x5f10('0x3c')](_0x1ebd34[_0x5f10('0x31')],_0x2a2f24['filters']),_0x3e137e);if(_0x1ebd34[_0x5f10('0x31')]['filter']){_0x1176b4[_0x5f10('0x3b')]=_['merge'](_0x1176b4[_0x5f10('0x3b')],{'$or':_['map'](_0x1176b4[_0x5f10('0x33')],function(_0x22e53f){var _0x2ed93c={};_0x2ed93c[_0x22e53f]={'$like':'%'+_0x1ebd34[_0x5f10('0x31')][_0x5f10('0x3d')]+'%'};return _0x2ed93c;})});}_0x1176b4=_['merge']({},_0x1176b4,_0x1ebd34[_0x5f10('0x3e')]);var _0x2131d0={'where':_0x1176b4['where']};return db[_0x5f10('0x2d')]['count'](_0x2131d0)[_0x5f10('0x26')](function(_0x1fa740){_0x2ecc6c[_0x5f10('0x1f')]=_0x1fa740;if(_0x1ebd34['query'][_0x5f10('0x3f')]){_0x1176b4[_0x5f10('0x40')]=[{'all':!![]}];}return db[_0x5f10('0x2d')][_0x5f10('0x41')](_0x1176b4);})[_0x5f10('0x26')](function(_0x3fb52c){_0x2ecc6c[_0x5f10('0x42')]=_0x3fb52c;return _0x2ecc6c;})[_0x5f10('0x26')](respondWithFilteredResult(_0x1c7dfd,_0x1176b4))['catch'](handleError(_0x1c7dfd,null));})[_0x5f10('0x43')](handleError(_0x1c7dfd,null));};exports[_0x5f10('0x44')]=function(_0x36b80f,_0x3e3c02){var _0x4d4d58={'raw':![],'where':{'id':_0x36b80f[_0x5f10('0x45')]['id']}},_0x2abd6e={};_0x2abd6e[_0x5f10('0x2f')]=_[_0x5f10('0x30')](db[_0x5f10('0x2d')]['rawAttributes']);_0x2abd6e['query']=_[_0x5f10('0x30')](_0x36b80f[_0x5f10('0x31')]);_0x2abd6e['filters']=_['intersection'](_0x2abd6e[_0x5f10('0x2f')],_0x2abd6e[_0x5f10('0x31')]);_0x4d4d58['attributes']=_['intersection'](_0x2abd6e[_0x5f10('0x2f')],qs['fields'](_0x36b80f['query'][_0x5f10('0x35')]));_0x4d4d58[_0x5f10('0x33')]=_0x4d4d58[_0x5f10('0x33')][_0x5f10('0x36')]?_0x4d4d58[_0x5f10('0x33')]:_0x2abd6e[_0x5f10('0x2f')];if(_0x36b80f['query'][_0x5f10('0x3f')]){_0x4d4d58[_0x5f10('0x40')]=[{'all':!![]}];}_0x4d4d58=_[_0x5f10('0x46')]({},_0x4d4d58,_0x36b80f['options']);return db['CmCompany'][_0x5f10('0x47')](_0x4d4d58)[_0x5f10('0x26')](handleEntityNotFound(_0x3e3c02,null))[_0x5f10('0x26')](respondWithResult(_0x3e3c02,null))[_0x5f10('0x43')](handleError(_0x3e3c02,null));};exports[_0x5f10('0x48')]=function(_0x477eb3,_0x5d0ae9){return db[_0x5f10('0x2d')][_0x5f10('0x48')](_0x477eb3[_0x5f10('0x49')],{})[_0x5f10('0x26')](function(_0x2600ce){var _0xe18de4=_0x477eb3[_0x5f10('0x4a')][_0x5f10('0x27')]({'plain':!![]});if(!_0xe18de4)throw new Error(_0x5f10('0x4b'));if(_0xe18de4[_0x5f10('0x4c')]===_0x5f10('0x4a')){var _0x53da3e=_0x2600ce[_0x5f10('0x27')]({'plain':!![]});var _0x49560c='Companies';return db[_0x5f10('0x4d')]['find']({'where':{'name':_0x49560c,'userProfileId':_0xe18de4[_0x5f10('0x4e')]},'raw':!![]})[_0x5f10('0x26')](function(_0x2595c8){if(_0x2595c8&&_0x2595c8[_0x5f10('0x4f')]===0x0){return db['UserProfileResource'][_0x5f10('0x48')]({'name':_0x53da3e[_0x5f10('0x2b')],'resourceId':_0x53da3e['id'],'type':_0x2595c8[_0x5f10('0x2b')],'sectionId':_0x2595c8['id']},{})[_0x5f10('0x26')](function(){return _0x2600ce;});}else{return _0x2600ce;}})[_0x5f10('0x43')](function(_0x154b06){logger[_0x5f10('0x29')](_0x5f10('0x50'),_0x154b06);throw _0x154b06;});}return _0x2600ce;})['then'](respondWithResult(_0x5d0ae9,0xc9))[_0x5f10('0x43')](handleError(_0x5d0ae9,null));};exports[_0x5f10('0x25')]=function(_0xa91b3e,_0x4e1434){if(_0xa91b3e[_0x5f10('0x49')]['id']){delete _0xa91b3e['body']['id'];}return db[_0x5f10('0x2d')][_0x5f10('0x47')]({'where':{'id':_0xa91b3e[_0x5f10('0x45')]['id']}})[_0x5f10('0x26')](handleEntityNotFound(_0x4e1434,null))['then'](saveUpdates(_0xa91b3e[_0x5f10('0x49')],null))[_0x5f10('0x26')](respondWithResult(_0x4e1434,null))[_0x5f10('0x43')](handleError(_0x4e1434,null));};exports['destroy']=function(_0x2c9a0c,_0x5c242e){return db['CmCompany']['find']({'where':{'id':_0x2c9a0c[_0x5f10('0x45')]['id']}})[_0x5f10('0x26')](handleEntityNotFound(_0x5c242e,null))[_0x5f10('0x26')](removeEntity(_0x5c242e,null))[_0x5f10('0x43')](handleError(_0x5c242e,null));};exports[_0x5f10('0x2e')]=function(_0x6a4937,_0x140d92){return db[_0x5f10('0x2d')][_0x5f10('0x2e')]()[_0x5f10('0x26')](respondWithResult(_0x140d92,null))[_0x5f10('0x43')](handleError(_0x140d92,null));};exports[_0x5f10('0x51')]=function(_0x21c1ef,_0x4613e3,_0x4ed19d){return db[_0x5f10('0x52')][_0x5f10('0x47')]({'where':{'id':_0x21c1ef[_0x5f10('0x45')]['id']}})['then'](handleEntityNotFound(_0x4613e3,null))['then'](function(_0x41bb5b){if(_0x41bb5b){return _0x41bb5b[_0x5f10('0x51')](_0x21c1ef['body'][_0x5f10('0x53')],_['omit'](_0x21c1ef[_0x5f10('0x49')],[_0x5f10('0x53'),'id'])||{});}})[_0x5f10('0x26')](respondWithResult(_0x4613e3,null))[_0x5f10('0x43')](handleError(_0x4613e3,null));};exports[_0x5f10('0x54')]=function(_0x185d1b,_0x40a86e,_0x38cbcd){var _0x5b750d={};var _0x48ee50={};var _0x3dd4d4;var _0x51c71c;return db['CmCompany'][_0x5f10('0x55')]({'where':{'id':_0x185d1b[_0x5f10('0x45')]['id']}})['then'](handleEntityNotFound(_0x40a86e,null))[_0x5f10('0x26')](function(_0x3f231a){if(_0x3f231a){_0x3dd4d4=_0x3f231a;_0x48ee50['model']=_['keys'](db[_0x5f10('0x52')]['rawAttributes']);_0x48ee50[_0x5f10('0x31')]=_[_0x5f10('0x30')](_0x185d1b['query']);_0x48ee50[_0x5f10('0x32')]=_[_0x5f10('0x34')](_0x48ee50[_0x5f10('0x2f')],_0x48ee50[_0x5f10('0x31')]);_0x5b750d['attributes']=_['intersection'](_0x48ee50[_0x5f10('0x2f')],qs['fields'](_0x185d1b[_0x5f10('0x31')][_0x5f10('0x35')]));_0x5b750d[_0x5f10('0x33')]=_0x5b750d[_0x5f10('0x33')][_0x5f10('0x36')]?_0x5b750d[_0x5f10('0x33')]:_0x48ee50[_0x5f10('0x2f')];_0x5b750d[_0x5f10('0x39')]=qs[_0x5f10('0x3a')](_0x185d1b[_0x5f10('0x31')]['sort']);_0x5b750d[_0x5f10('0x3b')]=qs[_0x5f10('0x32')](_[_0x5f10('0x3c')](_0x185d1b[_0x5f10('0x31')],_0x48ee50[_0x5f10('0x32')]));if(_0x185d1b['query'][_0x5f10('0x3d')]){_0x5b750d[_0x5f10('0x3b')]=_[_0x5f10('0x46')](_0x5b750d['where'],{'$or':_[_0x5f10('0x56')](_0x5b750d[_0x5f10('0x33')],function(_0x57304a){var _0x4357e4={};_0x4357e4[_0x57304a]={'$like':'%'+_0x185d1b['query'][_0x5f10('0x3d')]+'%'};return _0x4357e4;})});}_0x5b750d=_[_0x5f10('0x46')]({},_0x5b750d,_0x185d1b[_0x5f10('0x3e')]);return _0x3dd4d4[_0x5f10('0x54')](_0x5b750d);}})['then'](function(_0x33e63b){if(_0x33e63b){_0x51c71c=_0x33e63b[_0x5f10('0x36')];if(!_0x185d1b['query'][_0x5f10('0x37')](_0x5f10('0x38'))){_0x5b750d[_0x5f10('0x1e')]=qs[_0x5f10('0x1e')](_0x185d1b[_0x5f10('0x31')][_0x5f10('0x1e')]);_0x5b750d[_0x5f10('0x1c')]=qs[_0x5f10('0x1c')](_0x185d1b['query']['offset']);}return _0x3dd4d4['getContacts'](_0x5b750d);}})['then'](function(_0x13a123){if(_0x13a123){return _0x13a123?{'count':_0x51c71c,'rows':_0x13a123}:null;}})[_0x5f10('0x26')](respondWithResult(_0x40a86e,null))['catch'](handleError(_0x40a86e,null));};
\ No newline at end of file
+var _0x81ab=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','json','apply','reject','save','update','then','destroy','Companies','UserProfileResource','end','error','stack','name','send','index','CmCompany','describe','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','merge','filter','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','pick','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x1ad1bc,_0x13321b){var _0x2e23c4=function(_0xdef6f5){while(--_0xdef6f5){_0x1ad1bc['push'](_0x1ad1bc['shift']());}};_0x2e23c4(++_0x13321b);}(_0x81ab,0xa4));var _0xb81a=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x81ab[_0x49c057];return _0xd8f0e6;};'use strict';var emlformat=require(_0xb81a('0x0'));var rimraf=require(_0xb81a('0x1'));var zipdir=require(_0xb81a('0x2'));var jsonpatch=require(_0xb81a('0x3'));var rp=require('request-promise');var moment=require(_0xb81a('0x4'));var BPromise=require(_0xb81a('0x5'));var Mustache=require('mustache');var util=require(_0xb81a('0x6'));var path=require(_0xb81a('0x7'));var sox=require(_0xb81a('0x8'));var csv=require(_0xb81a('0x9'));var ejs=require(_0xb81a('0xa'));var fs=require('fs');var fs_extra=require(_0xb81a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb81a('0xc'));var jsforce=require(_0xb81a('0xd'));var deskjs=require(_0xb81a('0xe'));var toCsv=require(_0xb81a('0x9'));var querystring=require('querystring');var Papa=require(_0xb81a('0xf'));var Redis=require(_0xb81a('0x10'));var authService=require(_0xb81a('0x11'));var qs=require(_0xb81a('0x12'));var as=require(_0xb81a('0x13'));var hardwareService=require(_0xb81a('0x14'));var logger=require(_0xb81a('0x15'))(_0xb81a('0x16'));var utils=require(_0xb81a('0x17'));var config=require(_0xb81a('0x18'));var licenseUtil=require(_0xb81a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50f2ea,_0x3f2289){_0x3f2289=_0x3f2289||0xcc;return function(_0x529837){if(_0x529837){return _0x50f2ea[_0xb81a('0x1a')](_0x3f2289);}return _0x50f2ea['status'](_0x3f2289)['end']();};}function respondWithResult(_0x48fe87,_0x581e09){_0x581e09=_0x581e09||0xc8;return function(_0x2a4ccd){if(_0x2a4ccd){return _0x48fe87[_0xb81a('0x1b')](_0x581e09)['json'](_0x2a4ccd);}};}function respondWithFilteredResult(_0x2167d8,_0x25e791){return function(_0x2efe9b){if(_0x2efe9b){var _0x501480=typeof _0x25e791[_0xb81a('0x1c')]==='undefined'&&typeof _0x25e791['limit']===_0xb81a('0x1d');var _0x446f9d=_0x2efe9b[_0xb81a('0x1e')];var _0x259244=_0x501480?0x0:_0x25e791[_0xb81a('0x1c')];var _0x3bf815=_0x501480?_0x2efe9b[_0xb81a('0x1e')]:_0x25e791[_0xb81a('0x1c')]+_0x25e791['limit'];var _0x2ee85c;if(_0x3bf815>=_0x446f9d){_0x3bf815=_0x446f9d;_0x2ee85c=0xc8;}else{_0x2ee85c=0xce;}_0x2167d8[_0xb81a('0x1b')](_0x2ee85c);return _0x2167d8['set']('Content-Range',_0x259244+'-'+_0x3bf815+'/'+_0x446f9d)[_0xb81a('0x1f')](_0x2efe9b);}return null;};}function patchUpdates(_0x314ee3){return function(_0x548b76){try{jsonpatch[_0xb81a('0x20')](_0x548b76,_0x314ee3,!![]);}catch(_0x25bd15){return BPromise[_0xb81a('0x21')](_0x25bd15);}return _0x548b76[_0xb81a('0x22')]();};}function saveUpdates(_0x2df34b,_0x165f4a){return function(_0x198a45){if(_0x198a45){return _0x198a45[_0xb81a('0x23')](_0x2df34b)[_0xb81a('0x24')](function(_0x3c4026){return _0x3c4026;});}return null;};}function removeEntity(_0x294d4a,_0x79cd58){return function(_0x5adb69){if(_0x5adb69){return _0x5adb69[_0xb81a('0x25')]()[_0xb81a('0x24')](function(){var _0x15fb66=_0x5adb69['get']({'plain':!![]});var _0x30baf6=_0xb81a('0x26');return db[_0xb81a('0x27')][_0xb81a('0x25')]({'where':{'type':_0x30baf6,'resourceId':_0x15fb66['id']}})[_0xb81a('0x24')](function(){return _0x5adb69;});})[_0xb81a('0x24')](function(){_0x294d4a['status'](0xcc)[_0xb81a('0x28')]();});}};}function handleEntityNotFound(_0x585165,_0x165d48){return function(_0x44a512){if(!_0x44a512){_0x585165[_0xb81a('0x1a')](0x194);}return _0x44a512;};}function handleError(_0x523993,_0x506291){_0x506291=_0x506291||0x1f4;return function(_0x578b73){logger[_0xb81a('0x29')](_0x578b73[_0xb81a('0x2a')]);if(_0x578b73[_0xb81a('0x2b')]){delete _0x578b73[_0xb81a('0x2b')];}_0x523993[_0xb81a('0x1b')](_0x506291)[_0xb81a('0x2c')](_0x578b73);};}exports[_0xb81a('0x2d')]=function(_0x126263,_0x1615e0){var _0x4a0ea4={},_0x494993={},_0x2a0405={'count':0x0,'rows':[]};return db[_0xb81a('0x2e')][_0xb81a('0x2f')]()[_0xb81a('0x24')](function(_0xf968a6){_0x494993[_0xb81a('0x30')]=_['keys'](_0xf968a6);_0x494993[_0xb81a('0x31')]=_[_0xb81a('0x32')](_0x126263[_0xb81a('0x31')]);_0x494993['filters']=_['intersection'](_0x494993[_0xb81a('0x30')],_0x494993['query']);_0x4a0ea4[_0xb81a('0x33')]=_[_0xb81a('0x34')](_0x494993[_0xb81a('0x30')],qs[_0xb81a('0x35')](_0x126263[_0xb81a('0x31')][_0xb81a('0x35')]));_0x4a0ea4[_0xb81a('0x33')]=_0x4a0ea4[_0xb81a('0x33')][_0xb81a('0x36')]?_0x4a0ea4[_0xb81a('0x33')]:_0x494993[_0xb81a('0x30')];if(!_0x126263[_0xb81a('0x31')][_0xb81a('0x37')]('nolimit')){_0x4a0ea4[_0xb81a('0x38')]=qs['limit'](_0x126263[_0xb81a('0x31')][_0xb81a('0x38')]);_0x4a0ea4['offset']=qs[_0xb81a('0x1c')](_0x126263[_0xb81a('0x31')]['offset']);}_0x4a0ea4[_0xb81a('0x39')]=qs['sort'](_0x126263[_0xb81a('0x31')][_0xb81a('0x3a')]);_0x4a0ea4[_0xb81a('0x3b')]=qs[_0xb81a('0x3c')](_['pick'](_0x126263[_0xb81a('0x31')],_0x494993[_0xb81a('0x3c')]),_0xf968a6);if(_0x126263[_0xb81a('0x31')]['filter']){_0x4a0ea4[_0xb81a('0x3b')]=_[_0xb81a('0x3d')](_0x4a0ea4[_0xb81a('0x3b')],{'$or':_['map'](_0x4a0ea4[_0xb81a('0x33')],function(_0x80be08){var _0x40450b={};_0x40450b[_0x80be08]={'$like':'%'+_0x126263[_0xb81a('0x31')][_0xb81a('0x3e')]+'%'};return _0x40450b;})});}_0x4a0ea4=_[_0xb81a('0x3d')]({},_0x4a0ea4,_0x126263[_0xb81a('0x3f')]);var _0x20ecde={'where':_0x4a0ea4[_0xb81a('0x3b')]};return db[_0xb81a('0x2e')]['count'](_0x20ecde)[_0xb81a('0x24')](function(_0x37d9ae){_0x2a0405[_0xb81a('0x1e')]=_0x37d9ae;if(_0x126263[_0xb81a('0x31')][_0xb81a('0x40')]){_0x4a0ea4[_0xb81a('0x41')]=[{'all':!![]}];}return db[_0xb81a('0x2e')]['findAll'](_0x4a0ea4);})['then'](function(_0x4683ba){_0x2a0405[_0xb81a('0x42')]=_0x4683ba;return _0x2a0405;})['then'](respondWithFilteredResult(_0x1615e0,_0x4a0ea4))[_0xb81a('0x43')](handleError(_0x1615e0,null));})[_0xb81a('0x43')](handleError(_0x1615e0,null));};exports['show']=function(_0x3c534e,_0x3c1663){var _0x1c69d3={'raw':![],'where':{'id':_0x3c534e[_0xb81a('0x44')]['id']}},_0x1574a1={};_0x1574a1[_0xb81a('0x30')]=_[_0xb81a('0x32')](db[_0xb81a('0x2e')][_0xb81a('0x45')]);_0x1574a1['query']=_['keys'](_0x3c534e['query']);_0x1574a1[_0xb81a('0x3c')]=_[_0xb81a('0x34')](_0x1574a1[_0xb81a('0x30')],_0x1574a1[_0xb81a('0x31')]);_0x1c69d3['attributes']=_['intersection'](_0x1574a1[_0xb81a('0x30')],qs[_0xb81a('0x35')](_0x3c534e['query'][_0xb81a('0x35')]));_0x1c69d3['attributes']=_0x1c69d3[_0xb81a('0x33')]['length']?_0x1c69d3[_0xb81a('0x33')]:_0x1574a1[_0xb81a('0x30')];if(_0x3c534e[_0xb81a('0x31')][_0xb81a('0x40')]){_0x1c69d3[_0xb81a('0x41')]=[{'all':!![]}];}_0x1c69d3=_[_0xb81a('0x3d')]({},_0x1c69d3,_0x3c534e[_0xb81a('0x3f')]);return db['CmCompany'][_0xb81a('0x46')](_0x1c69d3)[_0xb81a('0x24')](handleEntityNotFound(_0x3c1663,null))[_0xb81a('0x24')](respondWithResult(_0x3c1663,null))[_0xb81a('0x43')](handleError(_0x3c1663,null));};exports[_0xb81a('0x47')]=function(_0x3b5390,_0x5e820b){return db[_0xb81a('0x2e')][_0xb81a('0x47')](_0x3b5390[_0xb81a('0x48')],{})[_0xb81a('0x24')](function(_0x140d23){var _0x21afa1=_0x3b5390[_0xb81a('0x49')][_0xb81a('0x4a')]({'plain':!![]});if(!_0x21afa1)throw new Error(_0xb81a('0x4b'));if(_0x21afa1[_0xb81a('0x4c')]===_0xb81a('0x49')){var _0x42ae8a=_0x140d23[_0xb81a('0x4a')]({'plain':!![]});var _0x30aaea=_0xb81a('0x26');return db['UserProfileSection'][_0xb81a('0x46')]({'where':{'name':_0x30aaea,'userProfileId':_0x21afa1[_0xb81a('0x4d')]},'raw':!![]})[_0xb81a('0x24')](function(_0x54de52){if(_0x54de52&&_0x54de52[_0xb81a('0x4e')]===0x0){return db[_0xb81a('0x27')][_0xb81a('0x47')]({'name':_0x42ae8a[_0xb81a('0x2b')],'resourceId':_0x42ae8a['id'],'type':_0x54de52[_0xb81a('0x2b')],'sectionId':_0x54de52['id']},{})[_0xb81a('0x24')](function(){return _0x140d23;});}else{return _0x140d23;}})[_0xb81a('0x43')](function(_0x270f40){logger[_0xb81a('0x29')](_0xb81a('0x4f'),_0x270f40);throw _0x270f40;});}return _0x140d23;})[_0xb81a('0x24')](respondWithResult(_0x5e820b,0xc9))[_0xb81a('0x43')](handleError(_0x5e820b,null));};exports[_0xb81a('0x23')]=function(_0x5e39e5,_0x9dff2a){if(_0x5e39e5[_0xb81a('0x48')]['id']){delete _0x5e39e5['body']['id'];}return db[_0xb81a('0x2e')]['find']({'where':{'id':_0x5e39e5[_0xb81a('0x44')]['id']}})[_0xb81a('0x24')](handleEntityNotFound(_0x9dff2a,null))[_0xb81a('0x24')](saveUpdates(_0x5e39e5[_0xb81a('0x48')],null))[_0xb81a('0x24')](respondWithResult(_0x9dff2a,null))[_0xb81a('0x43')](handleError(_0x9dff2a,null));};exports['destroy']=function(_0x3d1659,_0x497735){return db[_0xb81a('0x2e')]['find']({'where':{'id':_0x3d1659['params']['id']}})[_0xb81a('0x24')](handleEntityNotFound(_0x497735,null))['then'](removeEntity(_0x497735,null))[_0xb81a('0x43')](handleError(_0x497735,null));};exports['describe']=function(_0x14d865,_0x4d0a98){return db[_0xb81a('0x2e')][_0xb81a('0x2f')]()[_0xb81a('0x24')](respondWithResult(_0x4d0a98,null))[_0xb81a('0x43')](handleError(_0x4d0a98,null));};exports[_0xb81a('0x50')]=function(_0x146e0b,_0x2c3a7e,_0x5644ca){return db[_0xb81a('0x51')][_0xb81a('0x46')]({'where':{'id':_0x146e0b[_0xb81a('0x44')]['id']}})[_0xb81a('0x24')](handleEntityNotFound(_0x2c3a7e,null))['then'](function(_0x845d67){if(_0x845d67){return _0x845d67['addContacts'](_0x146e0b[_0xb81a('0x48')][_0xb81a('0x52')],_[_0xb81a('0x53')](_0x146e0b[_0xb81a('0x48')],[_0xb81a('0x52'),'id'])||{});}})[_0xb81a('0x24')](respondWithResult(_0x2c3a7e,null))[_0xb81a('0x43')](handleError(_0x2c3a7e,null));};exports[_0xb81a('0x54')]=function(_0x49ce3a,_0xa64f39,_0x205f1b){var _0x438fa3={};var _0x361c2f={};var _0x42e90d;var _0xf409ea;return db['CmCompany'][_0xb81a('0x55')]({'where':{'id':_0x49ce3a[_0xb81a('0x44')]['id']}})[_0xb81a('0x24')](handleEntityNotFound(_0xa64f39,null))[_0xb81a('0x24')](function(_0x339610){if(_0x339610){_0x42e90d=_0x339610;_0x361c2f[_0xb81a('0x30')]=_[_0xb81a('0x32')](db[_0xb81a('0x51')][_0xb81a('0x45')]);_0x361c2f[_0xb81a('0x31')]=_[_0xb81a('0x32')](_0x49ce3a[_0xb81a('0x31')]);_0x361c2f['filters']=_[_0xb81a('0x34')](_0x361c2f[_0xb81a('0x30')],_0x361c2f[_0xb81a('0x31')]);_0x438fa3[_0xb81a('0x33')]=_[_0xb81a('0x34')](_0x361c2f[_0xb81a('0x30')],qs[_0xb81a('0x35')](_0x49ce3a[_0xb81a('0x31')][_0xb81a('0x35')]));_0x438fa3['attributes']=_0x438fa3[_0xb81a('0x33')][_0xb81a('0x36')]?_0x438fa3[_0xb81a('0x33')]:_0x361c2f[_0xb81a('0x30')];_0x438fa3['order']=qs[_0xb81a('0x3a')](_0x49ce3a['query'][_0xb81a('0x3a')]);_0x438fa3[_0xb81a('0x3b')]=qs['filters'](_[_0xb81a('0x56')](_0x49ce3a['query'],_0x361c2f[_0xb81a('0x3c')]));if(_0x49ce3a[_0xb81a('0x31')]['filter']){_0x438fa3[_0xb81a('0x3b')]=_['merge'](_0x438fa3['where'],{'$or':_[_0xb81a('0x57')](_0x438fa3['attributes'],function(_0x4b054b){var _0x228a31={};_0x228a31[_0x4b054b]={'$like':'%'+_0x49ce3a[_0xb81a('0x31')]['filter']+'%'};return _0x228a31;})});}_0x438fa3=_[_0xb81a('0x3d')]({},_0x438fa3,_0x49ce3a[_0xb81a('0x3f')]);return _0x42e90d[_0xb81a('0x54')](_0x438fa3);}})[_0xb81a('0x24')](function(_0x377eb5){if(_0x377eb5){_0xf409ea=_0x377eb5[_0xb81a('0x36')];if(!_0x49ce3a[_0xb81a('0x31')][_0xb81a('0x37')](_0xb81a('0x58'))){_0x438fa3[_0xb81a('0x38')]=qs[_0xb81a('0x38')](_0x49ce3a[_0xb81a('0x31')][_0xb81a('0x38')]);_0x438fa3['offset']=qs[_0xb81a('0x1c')](_0x49ce3a['query'][_0xb81a('0x1c')]);}return _0x42e90d[_0xb81a('0x54')](_0x438fa3);}})[_0xb81a('0x24')](function(_0x1df7af){if(_0x1df7af){return _0x1df7af?{'count':_0xf409ea,'rows':_0x1df7af}:null;}})[_0xb81a('0x24')](respondWithResult(_0xa64f39,null))[_0xb81a('0x43')](handleError(_0xa64f39,null));};
\ No newline at end of file
index 6c388e5..95dc4aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cfe=['../../config/logger','api','moment','request-promise','path','rimraf','./cmCompany.attributes','CmCompany','cm_companies','lodash','util'];(function(_0xb6bf9c,_0x368fbb){var _0x450853=function(_0x45a657){while(--_0x45a657){_0xb6bf9c['push'](_0xb6bf9c['shift']());}};_0x450853(++_0x368fbb);}(_0x9cfe,0x1e2));var _0xe9cf=function(_0x2a2cf3,_0x5c25dd){_0x2a2cf3=_0x2a2cf3-0x0;var _0x264b7d=_0x9cfe[_0x2a2cf3];return _0x264b7d;};'use strict';var _=require(_0xe9cf('0x0'));var util=require(_0xe9cf('0x1'));var logger=require(_0xe9cf('0x2'))(_0xe9cf('0x3'));var moment=require(_0xe9cf('0x4'));var BPromise=require('bluebird');var rp=require(_0xe9cf('0x5'));var fs=require('fs');var path=require(_0xe9cf('0x6'));var rimraf=require(_0xe9cf('0x7'));var config=require('../../config/environment');var attributes=require(_0xe9cf('0x8'));module['exports']=function(_0x5bb3db,_0x5026de){return _0x5bb3db['define'](_0xe9cf('0x9'),attributes,{'tableName':_0xe9cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12b1=['moment','bluebird','rimraf','../../config/environment','exports','define','cm_companies','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12b1,0x19c));var _0x112b=function(_0x55a89e,_0x1a05ab){_0x55a89e=_0x55a89e-0x0;var _0x3aa2bd=_0x12b1[_0x55a89e];return _0x3aa2bd;};'use strict';var _=require('lodash');var util=require(_0x112b('0x0'));var logger=require(_0x112b('0x1'))('api');var moment=require(_0x112b('0x2'));var BPromise=require(_0x112b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x112b('0x4'));var config=require(_0x112b('0x5'));var attributes=require('./cmCompany.attributes');module[_0x112b('0x6')]=function(_0x50a62e,_0x14fab6){return _0x50a62e[_0x112b('0x7')]('CmCompany',attributes,{'tableName':_0x112b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ee66b8f..f3ea3e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4991=['jayson/promise','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4909db,_0x5e4b83){var _0x13fb99=function(_0xe0b520){while(--_0xe0b520){_0x4909db['push'](_0x4909db['shift']());}};_0x13fb99(++_0x5e4b83);}(_0x4991,0x19d));var _0x1499=function(_0x4d25c7,_0x1b2f6d){_0x4d25c7=_0x4d25c7-0x0;var _0x15f645=_0x4991[_0x4d25c7];return _0x15f645;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require(_0x1499('0x2'));var rs=require(_0x1499('0x3'));var fs=require('fs');var Redis=require(_0x1499('0x4'));var db=require(_0x1499('0x5'))['db'];var utils=require(_0x1499('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1499('0x7'));var client=jayson['client'][_0x1499('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f5d04,_0x5446b9,_0x320e25){return new BPromise(function(_0x1fa8d3,_0x538f8d){return client['request'](_0x5f5d04,_0x320e25)[_0x1499('0x9')](function(_0xa3f0bf){logger[_0x1499('0xa')]('CmCompany,\x20%s,\x20%s',_0x5446b9,_0x1499('0xb'));logger[_0x1499('0xc')](_0x1499('0xd'),_0x5446b9,_0x1499('0xb'),JSON[_0x1499('0xe')](_0xa3f0bf));if(_0xa3f0bf['error']){if(_0xa3f0bf[_0x1499('0xf')][_0x1499('0x10')]===0x1f4){logger['error'](_0x1499('0x11'),_0x5446b9,_0xa3f0bf['error'][_0x1499('0x12')]);return _0x538f8d(_0xa3f0bf[_0x1499('0xf')][_0x1499('0x12')]);}logger[_0x1499('0xf')](_0x1499('0x11'),_0x5446b9,_0xa3f0bf[_0x1499('0xf')][_0x1499('0x12')]);return _0x1fa8d3(_0xa3f0bf[_0x1499('0xf')][_0x1499('0x12')]);}else{logger[_0x1499('0xa')](_0x1499('0x11'),_0x5446b9,_0x1499('0xb'));_0x1fa8d3(_0xa3f0bf[_0x1499('0x13')]['message']);}})[_0x1499('0x14')](function(_0x319b1a){logger[_0x1499('0xf')](_0x1499('0x11'),_0x5446b9,_0x319b1a);_0x538f8d(_0x319b1a);});});}
\ No newline at end of file
+var _0x82d3=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x82d3,0x1cb));var _0x382d=function(_0x26e571,_0x1434e5){_0x26e571=_0x26e571-0x0;var _0x55ea78=_0x82d3[_0x26e571];return _0x55ea78;};'use strict';var _=require(_0x382d('0x0'));var util=require(_0x382d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x382d('0x2'));var fs=require('fs');var Redis=require(_0x382d('0x3'));var db=require(_0x382d('0x4'))['db'];var utils=require(_0x382d('0x5'));var logger=require(_0x382d('0x6'))(_0x382d('0x7'));var config=require(_0x382d('0x8'));var jayson=require(_0x382d('0x9'));var client=jayson[_0x382d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa68f,_0x399538,_0x36be5b){return new BPromise(function(_0x8b9cf5,_0x23477f){return client[_0x382d('0xb')](_0x4aa68f,_0x36be5b)['then'](function(_0x23551e){logger[_0x382d('0xc')]('CmCompany,\x20%s,\x20%s',_0x399538,_0x382d('0xd'));logger[_0x382d('0xe')](_0x382d('0xf'),_0x399538,_0x382d('0xd'),JSON[_0x382d('0x10')](_0x23551e));if(_0x23551e[_0x382d('0x11')]){if(_0x23551e[_0x382d('0x11')][_0x382d('0x12')]===0x1f4){logger[_0x382d('0x11')](_0x382d('0x13'),_0x399538,_0x23551e[_0x382d('0x11')][_0x382d('0x14')]);return _0x23477f(_0x23551e[_0x382d('0x11')][_0x382d('0x14')]);}logger['error'](_0x382d('0x13'),_0x399538,_0x23551e['error'][_0x382d('0x14')]);return _0x8b9cf5(_0x23551e[_0x382d('0x11')]['message']);}else{logger['info'](_0x382d('0x13'),_0x399538,_0x382d('0xd'));_0x8b9cf5(_0x23551e[_0x382d('0x15')][_0x382d('0x14')]);}})[_0x382d('0x16')](function(_0x13c999){logger[_0x382d('0x11')]('CmCompany,\x20%s,\x20%s',_0x399538,_0x13c999);_0x23477f(_0x13c999);});});}
\ No newline at end of file
index 7322628..3f92895 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeadf=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','multer','path','connect-timeout','express'];(function(_0x105c0a,_0x1489ca){var _0x264ad7=function(_0x5ef639){while(--_0x5ef639){_0x105c0a['push'](_0x105c0a['shift']());}};_0x264ad7(++_0x1489ca);}(_0xeadf,0xa4));var _0xfead=function(_0xeb80e,_0x337608){_0xeb80e=_0xeb80e-0x0;var _0x68e9d7=_0xeadf[_0xeb80e];return _0x68e9d7;};'use strict';var multer=require(_0xfead('0x0'));var util=require('util');var path=require(_0xfead('0x1'));var timeout=require(_0xfead('0x2'));var express=require(_0xfead('0x3'));var router=express[_0xfead('0x4')]();var fs_extra=require(_0xfead('0x5'));var auth=require(_0xfead('0x6'));var interaction=require(_0xfead('0x7'));var config=require(_0xfead('0x8'));var controller=require('./cmCompany.controller');router[_0xfead('0x9')]('/',auth['isAuthenticated'](),controller[_0xfead('0xa')]);router['get'](_0xfead('0xb'),auth['isAuthenticated'](),controller[_0xfead('0xc')]);router['get'](_0xfead('0xd'),auth[_0xfead('0xe')](),controller[_0xfead('0xf')]);router['get'](_0xfead('0x10'),auth[_0xfead('0xe')](),controller[_0xfead('0x11')]);router[_0xfead('0x12')]('/',auth[_0xfead('0xe')](),controller[_0xfead('0x13')]);router[_0xfead('0x12')](_0xfead('0x10'),auth[_0xfead('0xe')](),controller[_0xfead('0x14')]);router[_0xfead('0x15')](_0xfead('0xd'),auth[_0xfead('0xe')](),controller[_0xfead('0x16')]);router[_0xfead('0x17')]('/:id',auth[_0xfead('0xe')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb2fa=['./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xb2fa,0xc9));var _0xab2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb2fa[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xab2f('0x0'));var util=require(_0xab2f('0x1'));var path=require(_0xab2f('0x2'));var timeout=require('connect-timeout');var express=require(_0xab2f('0x3'));var router=express[_0xab2f('0x4')]();var fs_extra=require(_0xab2f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab2f('0x6'));router[_0xab2f('0x7')]('/',auth[_0xab2f('0x8')](),controller[_0xab2f('0x9')]);router['get'](_0xab2f('0xa'),auth[_0xab2f('0x8')](),controller[_0xab2f('0xb')]);router[_0xab2f('0x7')]('/:id',auth[_0xab2f('0x8')](),controller[_0xab2f('0xc')]);router[_0xab2f('0x7')](_0xab2f('0xd'),auth['isAuthenticated'](),controller[_0xab2f('0xe')]);router['post']('/',auth[_0xab2f('0x8')](),controller[_0xab2f('0xf')]);router[_0xab2f('0x10')](_0xab2f('0xd'),auth[_0xab2f('0x8')](),controller[_0xab2f('0x11')]);router[_0xab2f('0x12')]('/:id',auth[_0xab2f('0x8')](),controller[_0xab2f('0x13')]);router[_0xab2f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xab2f('0x15')]);module[_0xab2f('0x16')]=router;
\ No newline at end of file
index fa3c055..750601d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x2032,0xd9));var _0x2203=function(_0x34c65f,_0x3c61fb){_0x34c65f=_0x34c65f-0x0;var _0x4a903b=_0x2032[_0x34c65f];return _0x4a903b;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}};
\ No newline at end of file
+var _0x5f66=['sequelize','STRING','INTEGER','DATE'];(function(_0xee37f1,_0x189f43){var _0x37fd54=function(_0x3c8109){while(--_0x3c8109){_0xee37f1['push'](_0xee37f1['shift']());}};_0x37fd54(++_0x189f43);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var Sequelize=require(_0x65f6('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x65f6('0x1')]},'street':{'type':Sequelize[_0x65f6('0x1')]},'postalCode':{'type':Sequelize[_0x65f6('0x1')]},'city':{'type':Sequelize[_0x65f6('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x65f6('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x65f6('0x1')]},'mobile':{'type':Sequelize[_0x65f6('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x65f6('0x1')]},'facebook':{'type':Sequelize[_0x65f6('0x1')]},'fb_data':{'type':Sequelize[_0x65f6('0x1')]},'twitter':{'type':Sequelize[_0x65f6('0x1')]},'skype':{'type':Sequelize[_0x65f6('0x1')]},'teams':{'type':Sequelize[_0x65f6('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x65f6('0x1')]},'telegram':{'type':Sequelize[_0x65f6('0x1')]},'UserId':{'type':Sequelize[_0x65f6('0x2')]},'priority':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x65f6('0x2')]}};
\ No newline at end of file
index 570d1fa..72f58b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e5f=['SELECT','clone','order','DESC','resolve','user','role','some','getLists','isEmpty','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','map','agent','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.mobile','c.fax','c.ListId','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','catch','params','tags','columnName','analytics','findAll','displayName','alias','custom','values','body','get','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','dialTimezone','timezones','utcOffset','duplicates','$or','findOrCreate','show','Tag','color','$and','omit','cf_%d','pickBy','format','table','setFields','id\x20=\x20?','toParam','phone','getTags','options','setTags','ids','getHoppers','includeAll','include','rows','getHopperHistories','CmHopperHistory','rawAttributes','ContactId','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','firstName','No\x20firstName\x20column\x20specified','root','file','filename','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','import','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify','message','exit','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','starttime','endtime','note','userDisposition','userSecondDisposition','fullname','createdAt','findAndCountAll','startCase','chat','Website','Account','closed','closedAt','secondDisposition','UserId','key','Owner','browserName','customerIp','customerPort','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','flatten','slice','moment','bluebird','path','squel','ioredis','../../components/parsers/advancedSearch','api','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','register','json','offset','undefined','count','limit','status','set','update','destroy','then','end','sendStatus','error','stack','name','send','CmContact','describe','length','keys','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','value','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','ListId','concat','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes'];(function(_0xde40bf,_0x18a79b){var _0x363c56=function(_0x3d64d9){while(--_0x3d64d9){_0xde40bf['push'](_0xde40bf['shift']());}};_0x363c56(++_0x18a79b);}(_0x6e5f,0x1bc));var _0xf6e5=function(_0x44425a,_0x345e3a){_0x44425a=_0x44425a-0x0;var _0x595887=_0x6e5f[_0x44425a];return _0x595887;};'use strict';var moment=require(_0xf6e5('0x0'));var BPromise=require(_0xf6e5('0x1'));var util=require('util');var path=require(_0xf6e5('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf6e5('0x3'));var Papa=require('papaparse');var Redis=require(_0xf6e5('0x4'));var qs=require('../../components/parsers/qs');var as=require(_0xf6e5('0x5'));var logger=require('../../config/logger')(_0xf6e5('0x6'));var config=require('../../config/environment');var shared=require(_0xf6e5('0x7'));var db=require(_0xf6e5('0x8'))['db'];config[_0xf6e5('0x9')]=_['defaults'](config['redis'],{'host':_0xf6e5('0xa'),'port':0x18eb});var socket=require(_0xf6e5('0xb'))(new Redis(config['redis']));require('./cmContact.socket')[_0xf6e5('0xc')](socket);function respondWithResult(_0x186c6d,_0x2a872d){_0x2a872d=_0x2a872d||0xc8;return function(_0x1137fe){if(_0x1137fe){return _0x186c6d['status'](_0x2a872d)[_0xf6e5('0xd')](_0x1137fe);}};}function respondWithFilteredResult(_0x4dd7e3,_0x32ff8d){return function(_0x112c38){if(_0x112c38){var _0x40dc82=typeof _0x32ff8d[_0xf6e5('0xe')]===_0xf6e5('0xf')&&typeof _0x32ff8d['limit']===_0xf6e5('0xf');var _0x19c6a7=_0x112c38[_0xf6e5('0x10')];var _0x48ece8=_0x40dc82?0x0:_0x32ff8d[_0xf6e5('0xe')];var _0x534851=_0x40dc82?_0x112c38['count']:_0x32ff8d['offset']+_0x32ff8d[_0xf6e5('0x11')];var _0x31a18c;if(_0x534851>=_0x19c6a7){_0x534851=_0x19c6a7;_0x31a18c=0xc8;}else{_0x31a18c=0xce;}_0x4dd7e3[_0xf6e5('0x12')](_0x31a18c);return _0x4dd7e3[_0xf6e5('0x13')]('Content-Range',_0x48ece8+'-'+_0x534851+'/'+_0x19c6a7)[_0xf6e5('0xd')](_0x112c38);}return null;};}function saveUpdates(_0x407285){return function(_0x50fbbc){if(_0x50fbbc){return _0x50fbbc[_0xf6e5('0x14')](_0x407285)['then'](function(_0x40e658){return _0x40e658;});}return null;};}function removeEntity(_0x2874f6){return function(_0x3ced3d){if(_0x3ced3d){return _0x3ced3d[_0xf6e5('0x15')]()[_0xf6e5('0x16')](function(){_0x2874f6[_0xf6e5('0x12')](0xcc)[_0xf6e5('0x17')]();});}};}function handleEntityNotFound(_0x3eec93){return function(_0x396845){if(!_0x396845){_0x3eec93[_0xf6e5('0x18')](0x194);}return _0x396845;};}function handleError(_0x4e60ac,_0x4ec0d0){_0x4ec0d0=_0x4ec0d0||0x1f4;return function(_0xaa8a47){logger[_0xf6e5('0x19')](_0xaa8a47[_0xf6e5('0x1a')]);if(_0xaa8a47[_0xf6e5('0x1b')]){delete _0xaa8a47[_0xf6e5('0x1b')];}_0x4e60ac['status'](_0x4ec0d0)[_0xf6e5('0x1c')](_0xaa8a47);};}exports['index']=function(_0x319ac0,_0x5d4f40){var _0x21eecb={},_0x4bf61e={},_0x1a108b={'count':0x0,'rows':[]};return db[_0xf6e5('0x1d')][_0xf6e5('0x1e')]()[_0xf6e5('0x16')](function(_0x301443){var _0xb83250=[];for(var _0xaef6f3=0x0;_0xaef6f3<Object['keys'](_0x301443)[_0xf6e5('0x1f')];_0xaef6f3++){var _0x16f6bb=Object[_0xf6e5('0x20')](_0x301443)[_0xaef6f3];if(_[_0xf6e5('0x21')](_0x16f6bb,_0xf6e5('0x22'))){_0xb83250[_0xf6e5('0x23')](db[_0xf6e5('0x24')][_0xf6e5('0x25')]({'where':{'id':_[_0xf6e5('0x26')](_0x16f6bb,_0xf6e5('0x22'))},'raw':!![]}));}}return BPromise[_0xf6e5('0x27')](_0xb83250)[_0xf6e5('0x16')](function(_0x15ab67){for(var _0x2d3d19=0x0;_0x2d3d19<_0x15ab67[_0xf6e5('0x1f')];_0x2d3d19++){if(_0x15ab67[_0x2d3d19]){var _0x2beccd=_0xf6e5('0x22')+_0x15ab67[_0x2d3d19]['id'];var _0x54dad6=_0x301443[_0x2beccd];_0x54dad6[_0xf6e5('0x28')]=_0x15ab67[_0x2d3d19][_0xf6e5('0x29')];}}return _0x301443;});})[_0xf6e5('0x16')](function(_0x35bc62){_0x4bf61e[_0xf6e5('0x2a')]=_[_0xf6e5('0x20')](_0x35bc62);_0x4bf61e[_0xf6e5('0x2b')]=_[_0xf6e5('0x20')](_0x319ac0[_0xf6e5('0x2b')]);_0x4bf61e[_0xf6e5('0x2c')]=_[_0xf6e5('0x2d')](_0x4bf61e[_0xf6e5('0x2a')],_0x4bf61e[_0xf6e5('0x2b')]);_0x21eecb[_0xf6e5('0x2e')]=_['intersection'](_0x4bf61e[_0xf6e5('0x2a')],qs['fields'](_0x319ac0['query'][_0xf6e5('0x2f')]));_0x21eecb[_0xf6e5('0x2e')]=_0x21eecb[_0xf6e5('0x2e')][_0xf6e5('0x1f')]?_0x21eecb[_0xf6e5('0x2e')]:_0x4bf61e[_0xf6e5('0x2a')];if(!_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x30')](_0xf6e5('0x31'))){_0x21eecb[_0xf6e5('0x11')]=qs['limit'](_0x319ac0['query'][_0xf6e5('0x11')]);_0x21eecb[_0xf6e5('0xe')]=qs[_0xf6e5('0xe')](_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0xe')]);}_0x21eecb['order']=qs[_0xf6e5('0x32')](_0x319ac0['query'][_0xf6e5('0x32')]);_0x21eecb[_0xf6e5('0x33')]=qs[_0xf6e5('0x2c')](_[_0xf6e5('0x34')](_0x319ac0[_0xf6e5('0x2b')],_0x4bf61e[_0xf6e5('0x2c')]),_0x35bc62);var _0x8d52a7=[];var _0xc9fc0a=squel[_0xf6e5('0x35')]()[_0xf6e5('0x36')]('id')['field'](_0xf6e5('0x1b'))[_0xf6e5('0x36')]('color')[_0xf6e5('0x37')](_0xf6e5('0x38'));var _0x1eadde=squel[_0xf6e5('0x35')]()['from'](_0xf6e5('0x39'),'c')[_0xf6e5('0x3a')](_0xf6e5('0x3b'),'uc',_0xf6e5('0x3c'))['left_join']('cm_contact_has_tags','ct',_0xf6e5('0x3d'))[_0xf6e5('0x3a')](_0xf6e5('0x38'),'t',_0xf6e5('0x3e'))['where'](_0xf6e5('0x3f'));var _0x50ea2d=squel[_0xf6e5('0x40')]();var _0x1af222=[];var _0x557bb3=squel[_0xf6e5('0x40')]();var _0x22cb4e;if(_0x319ac0['query'][_0xf6e5('0x41')]){_0x22cb4e=as['parseSearch'](_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x41')]);var _0x566e30=_0x22cb4e['sqlOperator'];for(var _0x1f3367=0x0;_0x1f3367<_0x22cb4e[_0xf6e5('0x42')][_0xf6e5('0x1f')];_0x1f3367++){var _0x453ec0=_0x22cb4e['conditions'][_0x1f3367];var _0x1b7206='c';var _0x4d88a6=_(_0x35bc62)[_0xf6e5('0x20')]()[_0xf6e5('0x43')](function(_0x484c37){return _0x484c37===_0x453ec0[_0xf6e5('0x36')];});if(_0x4d88a6)_0x4d88a6=_0x35bc62[_0x453ec0[_0xf6e5('0x36')]];if(!_0x4d88a6){if(_0x453ec0['field']==='Tag'){var _0x2b790e=_0x453ec0[_0xf6e5('0x44')]['split'](',')['map'](function(_0x45470d){return Number(_0x45470d);});_0x2b790e[_0xf6e5('0x45')](function(_0x9779b6){_0x557bb3['or'](_0xf6e5('0x46'),'%,'+_0x9779b6+',%');});_0x1af222=_[_0xf6e5('0x47')](_0x1af222,_0x2b790e);}else if(_0x453ec0['field']===_0xf6e5('0x48')){_0x50ea2d[_0xf6e5('0x49')](_0xf6e5('0x4a'),_0x453ec0[_0xf6e5('0x44')]);}}else{if(_0x453ec0['field']===_0xf6e5('0x4b')||_0x4d88a6[_0xf6e5('0x28')]===_0xf6e5('0x4c'))_0x453ec0[_0xf6e5('0x4d')]=_0xf6e5('0x4e');var _0x5af444=as[_0xf6e5('0x4f')](_0x1b7206,_0x4d88a6[_0xf6e5('0x29')],_0x453ec0);_0x50ea2d[_0x566e30](_0x5af444[_0xf6e5('0x50')],_0x5af444[_0xf6e5('0x44')][_0xf6e5('0x51')],_0x5af444[_0xf6e5('0x44')][_0xf6e5('0x17')]);}}}else{var _0x2e8a9e=_(Object[_0xf6e5('0x20')](_0x319ac0['query']))['map'](function(_0x3e5a06){return _0x35bc62['hasOwnProperty'](_0x3e5a06)?_0x3e5a06:undefined;})[_0xf6e5('0x52')](function(_0x2f3f4a){return!_[_0xf6e5('0x53')](_0x2f3f4a);})[_0xf6e5('0x44')]();if(_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x54')])_0x2e8a9e[_0xf6e5('0x23')](_0xf6e5('0x54'));if(!_['isEmpty'](_0x2e8a9e)){_0x2e8a9e[_0xf6e5('0x45')](function(_0x57b168){if(_0x57b168===_0xf6e5('0x55')){_0x1eadde['where']('c.ListId\x20IN\x20?',[][_0xf6e5('0x56')](_0x319ac0['query'][_0x57b168]));}else if(_0x57b168===_0xf6e5('0x54')){var _0x10dafa='%'+_0x319ac0[_0xf6e5('0x2b')][_0x57b168]+'%';_0x1eadde[_0xf6e5('0x33')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x10dafa);}else{_0x1eadde[_0xf6e5('0x33')]('c.'+_0x57b168+'\x20=\x20?',_0x319ac0['query'][_0x57b168]);}});}if(_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x57')]){_0x1af222=_[_0xf6e5('0x58')](_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x57')])?_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x57')]:new Array(_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x57')]);_0x1af222['forEach'](function(_0x58931b){_0x557bb3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58931b+',%');});}if(_0x319ac0['query']['filter']){var _0x45a4fd=_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x52')][_0xf6e5('0x59')]('\x5c','\x5c\x5c')[_0xf6e5('0x59')](/'/g,'\x27\x27');if(_0x45a4fd['split']('\x20')[_0xf6e5('0x1f')]>0x1){_0x50ea2d['or'](_0xf6e5('0x5a'),qs['getFullTextValue'](_0x45a4fd),null);}else{if(qs[_0xf6e5('0x5b')](_0x45a4fd)){_0x50ea2d['or'](_0xf6e5('0x5c'),_0x45a4fd+'%');_0x50ea2d['or'](_0xf6e5('0x5d'),_0x45a4fd+'%');_0x50ea2d['or'](_0xf6e5('0x5e'),_0x45a4fd+'%');_0x50ea2d['or'](_0xf6e5('0x5f'),_0x45a4fd+'%');}else if(qs[_0xf6e5('0x60')](_0x45a4fd)){_0x50ea2d['or']('c.email\x20LIKE\x20?',_0x45a4fd+'%');}else{_0x50ea2d['or'](_0xf6e5('0x61'),'%'+_0x45a4fd+'%');_0x50ea2d['or'](_0xf6e5('0x62'),'%'+_0x45a4fd+'%');_0x50ea2d['or'](_0xf6e5('0x63'),'%'+_0x45a4fd+'%');}}}}_0x1eadde[_0xf6e5('0x33')](_0x50ea2d);_0x1eadde[_0xf6e5('0x64')](_0xf6e5('0x65'));var _0x555f4c={'type':db[_0xf6e5('0x66')][_0xf6e5('0x67')][_0xf6e5('0x68')],'raw':!![]};var _0x518b74=_0x1eadde[_0xf6e5('0x69')]()[_0xf6e5('0x36')](_0xf6e5('0x65'));if(_0x21eecb[_0xf6e5('0x6a')]){_0x21eecb[_0xf6e5('0x6a')][_0xf6e5('0x45')](function(_0x156555){_0x1eadde['order']('c.'+_0x156555[0x0],_0x156555[0x1]===_0xf6e5('0x6b')?![]:!![]);});}if(!_['isEmpty'](_0x1af222)){_0x1eadde['having'](_0x557bb3);_0x518b74[_0xf6e5('0x33')]('t.id\x20IN\x20?',_0x1af222);}BPromise[_0xf6e5('0x6c')]()['then'](function(){if(!_0x22cb4e)return;if(_0x319ac0[_0xf6e5('0x6d')][_0xf6e5('0x6e')]!=='agent')return;if(!_[_0xf6e5('0x6f')](_0x22cb4e[_0xf6e5('0x42')],[_0xf6e5('0x36'),'User'])){return _0x319ac0[_0xf6e5('0x6d')][_0xf6e5('0x70')]({'attributes':['id'],'raw':!![]})[_0xf6e5('0x16')](function(_0x354a1d){if(_[_0xf6e5('0x71')](_0x354a1d)){_0x518b74[_0xf6e5('0x33')](_0xf6e5('0x72'));_0x1eadde[_0xf6e5('0x33')](_0xf6e5('0x72'));}else{_0x518b74[_0xf6e5('0x33')](_0xf6e5('0x73'),_[_0xf6e5('0x74')](_0x354a1d,'id'));_0x1eadde[_0xf6e5('0x33')](_0xf6e5('0x73'),_[_0xf6e5('0x74')](_0x354a1d,'id'));}});}})[_0xf6e5('0x16')](function(){if(_0x319ac0[_0xf6e5('0x6d')][_0xf6e5('0x6e')]===_0xf6e5('0x75')&&!_0x22cb4e&&!_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x55')])return[];return db[_0xf6e5('0x76')][_0xf6e5('0x2b')](_0x518b74[_0xf6e5('0x77')](),_0x555f4c);})[_0xf6e5('0x16')](function(_0x4f2d77){_0x1a108b[_0xf6e5('0x10')]=_0x4f2d77[_0xf6e5('0x1f')];if(_0x1a108b[_0xf6e5('0x10')]===0x0)return[];return db[_0xf6e5('0x76')]['query'](_0xc9fc0a[_0xf6e5('0x77')](),_0x555f4c)[_0xf6e5('0x16')](function(_0x3b50b2){_0x8d52a7=_[_0xf6e5('0x78')](_0x3b50b2,'id');_0x555f4c=_[_0xf6e5('0x79')](_0x555f4c,{'model':db[_0xf6e5('0x1d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x319ac0[_0xf6e5('0x2b')][_0xf6e5('0x2f')]){_0x21eecb[_0xf6e5('0x2e')][_0xf6e5('0x45')](function(_0x5ab341){_0x1eadde[_0xf6e5('0x36')]('c.'+_0x5ab341);});}else{_0x1eadde['field'](_0xf6e5('0x65'));_0x1eadde[_0xf6e5('0x36')](_0xf6e5('0x7a'));_0x1eadde[_0xf6e5('0x36')](_0xf6e5('0x7b'));_0x1eadde['field']('c.phone');_0x1eadde[_0xf6e5('0x36')](_0xf6e5('0x7c'));_0x1eadde[_0xf6e5('0x36')](_0xf6e5('0x7d'));_0x1eadde[_0xf6e5('0x36')]('c.email');_0x1eadde[_0xf6e5('0x36')](_0xf6e5('0x7e'));_0x1eadde[_0xf6e5('0x36')]('c.createdAt');_0x1eadde[_0xf6e5('0x36')]('c.deletedAt');_0x1eadde[_0xf6e5('0x36')](_0xf6e5('0x7f'));_0x1eadde[_0xf6e5('0x36')](_0xf6e5('0x80'),_0xf6e5('0x81'));}if(_0x21eecb[_0xf6e5('0x11')])_0x1eadde['limit'](_0x21eecb[_0xf6e5('0x11')]);if(_0x21eecb[_0xf6e5('0xe')])_0x1eadde[_0xf6e5('0xe')](_0x21eecb[_0xf6e5('0xe')]);return db[_0xf6e5('0x76')][_0xf6e5('0x2b')](_0x1eadde[_0xf6e5('0x77')](),_0x555f4c);});})[_0xf6e5('0x16')](function(_0x1a05e3){_0x1a05e3[_0xf6e5('0x45')](function(_0x29f830){if(_0x29f830[_0xf6e5('0x81')]){_0x29f830[_0xf6e5('0x82')]=[];_0x29f830['TagIds'][_0xf6e5('0x83')](',')[_0xf6e5('0x45')](function(_0x27f91f){_0x29f830[_0xf6e5('0x82')][_0xf6e5('0x23')](_0x8d52a7[_0x27f91f]);});}delete _0x29f830[_0xf6e5('0x81')];});_0x1a108b['rows']=_0x1a05e3;return _0x1a108b;})[_0xf6e5('0x16')](respondWithFilteredResult(_0x5d4f40,_0x21eecb));})[_0xf6e5('0x84')](handleError(_0x5d4f40,null));};exports[_0xf6e5('0x15')]=function(_0xce72da,_0x3e0abe){return db[_0xf6e5('0x1d')]['find']({'where':{'id':_0xce72da[_0xf6e5('0x85')]['id']}})[_0xf6e5('0x16')](handleEntityNotFound(_0x3e0abe,null))[_0xf6e5('0x16')](removeEntity(_0x3e0abe,null))[_0xf6e5('0x84')](handleError(_0x3e0abe,null));};exports[_0xf6e5('0x1e')]=function(_0x4725ed,_0x3aefcb){return db[_0xf6e5('0x1d')][_0xf6e5('0x1e')]()['then'](function(_0x1ec7be){delete _0x1ec7be[_0xf6e5('0x86')];for(var _0x544ce0=0x0;_0x544ce0<Object[_0xf6e5('0x20')](_0x1ec7be)[_0xf6e5('0x1f')];_0x544ce0++){var _0x52fab3=Object['keys'](_0x1ec7be)[_0x544ce0];if(!_[_0xf6e5('0x21')](_0x52fab3,_0xf6e5('0x22'))){_0x1ec7be[_0x52fab3][_0xf6e5('0x87')]=_0x52fab3;_0x1ec7be[_0x52fab3]['displayName']=_0x52fab3;}}return _0x1ec7be;})[_0xf6e5('0x16')](function(_0x43bf53){var _0x165207={'where':Boolean(_0x4725ed['query'][_0xf6e5('0x88')])===!![]?undefined:{'$or':[{'ListId':_0x4725ed[_0xf6e5('0x2b')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xf6e5('0x24')][_0xf6e5('0x89')](_0x165207)[_0xf6e5('0x16')](function(_0x1f340d){for(var _0x611870=0x0;_0x611870<_0x1f340d['length'];_0x611870++){var _0x121d13=_0xf6e5('0x22')+_0x1f340d[_0x611870]['id'];_0x43bf53[_0x121d13][_0xf6e5('0x87')]=_0x121d13;_0x43bf53[_0x121d13][_0xf6e5('0x8a')]=_0x1f340d[_0x611870][_0xf6e5('0x8b')];_0x43bf53[_0x121d13][_0xf6e5('0x8c')]={'type':_0x1f340d[_0x611870]['type'],'values':_0x1f340d[_0x611870][_0xf6e5('0x8d')]};}Object[_0xf6e5('0x20')](_0x43bf53)[_0xf6e5('0x45')](function(_0x3e5d2a){if(!_0x43bf53[_0x3e5d2a][_0xf6e5('0x30')](_0xf6e5('0x87'))){delete _0x43bf53[_0x3e5d2a];}});return _0x43bf53;});})[_0xf6e5('0x16')](respondWithResult(_0x3aefcb,null))['catch'](handleError(_0x3aefcb,null));};exports[_0xf6e5('0x79')]=function(_0x3adbbf,_0x57b0a4){var _0x2eff78;var _0x5d6f1b;var _0x56a0cc;if(_0x3adbbf[_0xf6e5('0x8e')]['id']){delete _0x3adbbf[_0xf6e5('0x8e')]['id'];}return db['CmContact']['findAll']({'where':{'id':[_0x3adbbf['body']['to'],_0x3adbbf[_0xf6e5('0x8e')][_0xf6e5('0x37')]]}})[_0xf6e5('0x16')](function(_0x558b3f){if(_0x558b3f){if(_0x558b3f[_0xf6e5('0x1f')]!==0x2){return null;}_0x558b3f[0x0]=_0x558b3f[0x0][_0xf6e5('0x8f')]({'plain':!![]});_0x558b3f[0x1]=_0x558b3f[0x1][_0xf6e5('0x8f')]({'plain':!![]});delete _0x558b3f[0x0]['id'];delete _0x558b3f[0x1]['id'];return _['mergeWith'](_0x558b3f[0x0],_0x558b3f[0x1],function(_0x585659,_0x378a88){if(Array[_0xf6e5('0x58')](_0x378a88)&&!_0x378a88[_0xf6e5('0x1f')]){return _0x585659;}else if(!_0x378a88){return _0x585659;}});}})[_0xf6e5('0x16')](handleEntityNotFound(_0x57b0a4,null))['then'](function(_0x41c72d){if(_0x41c72d){if(_0x41c72d[_0xf6e5('0x86')]&&_[_0xf6e5('0x58')](_0x41c72d[_0xf6e5('0x86')])){_0x41c72d['tags']=_0x41c72d['tags'][_0xf6e5('0x90')]();}logger[_0xf6e5('0x91')](_0xf6e5('0x92'),_0x3adbbf[_0xf6e5('0x8e')]['to'],_0x3adbbf[_0xf6e5('0x8e')]['from']);return db[_0xf6e5('0x93')][_0xf6e5('0x15')]({'where':{'ContactId':[_0x3adbbf[_0xf6e5('0x8e')]['to'],_0x3adbbf[_0xf6e5('0x8e')][_0xf6e5('0x37')]]}})['then'](function(_0x592bdb){logger[_0xf6e5('0x91')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x592bdb);return db[_0xf6e5('0x94')][_0xf6e5('0x15')]({'where':{'ContactId':[_0x3adbbf[_0xf6e5('0x8e')]['to'],_0x3adbbf[_0xf6e5('0x8e')][_0xf6e5('0x37')]]}})[_0xf6e5('0x16')](function(_0x26554f){logger['info'](_0xf6e5('0x95'),_0x26554f);return db['CmContact']['create'](_0x41c72d);});});}})[_0xf6e5('0x16')](function(_0xe3e1be){if(_0xe3e1be){_0x2eff78=_0xe3e1be;_0x5d6f1b={'ContactId':_0x2eff78['id']};_0x56a0cc={'where':{'ContactId':[_0x3adbbf[_0xf6e5('0x8e')]['to'],_0x3adbbf[_0xf6e5('0x8e')][_0xf6e5('0x37')]]}};return db['ChatInteraction'][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x96')]['update'](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x97')]['update'](_0x5d6f1b,_0x56a0cc);}})['then'](function(){if(_0x2eff78){return db[_0xf6e5('0x98')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})['then'](function(){if(_0x2eff78){return db[_0xf6e5('0x99')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x98')]['update'](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x99')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db['SmsInteraction'][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x9a')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x9b')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x9c')]['update'](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x9d')]['update'](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x9e')]['update'](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0x9f')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db['CmHopperHistory']['update'](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0xa0')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})['then'](function(){if(_0x2eff78){return db[_0xf6e5('0xa1')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})['then'](function(){if(_0x2eff78){return db['ChatQueueReport'][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0xa2')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0xa3')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db['OpenchannelQueueReport'][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0xa4')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0xa5')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0xa6')][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db[_0xf6e5('0xa7')]['update'](_0x5d6f1b,_0x56a0cc);}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return db['WhatsappQueueReport'][_0xf6e5('0x14')](_0x5d6f1b,_0x56a0cc);}})['then'](function(){if(_0x2eff78){return db[_0xf6e5('0x1d')][_0xf6e5('0x15')]({'where':{'id':[_0x3adbbf[_0xf6e5('0x8e')]['to'],_0x3adbbf[_0xf6e5('0x8e')]['from']]}});}})[_0xf6e5('0x16')](function(){if(_0x2eff78){return _0x2eff78;}})[_0xf6e5('0x16')](respondWithResult(_0x57b0a4,null))[_0xf6e5('0x84')](handleError(_0x57b0a4,null));};exports[_0xf6e5('0xa8')]=function(_0x59ff03,_0x51c9a8){return db[_0xf6e5('0x1d')][_0xf6e5('0x1e')]()[_0xf6e5('0x16')](function(_0x123561){if(_0x59ff03['body'][_0xf6e5('0x86')]&&_['isArray'](_0x59ff03[_0xf6e5('0x8e')][_0xf6e5('0x86')])){if(_0x59ff03['body'][_0xf6e5('0x86')][_0xf6e5('0x1f')]){_0x59ff03[_0xf6e5('0x8e')][_0xf6e5('0x86')]=_0x59ff03['body'][_0xf6e5('0x86')][_0xf6e5('0x90')](';')+';';}else{_0x59ff03[_0xf6e5('0x8e')][_0xf6e5('0x86')]=null;}}else{_0x59ff03[_0xf6e5('0x8e')][_0xf6e5('0x86')]=null;}if(!_[_0xf6e5('0x53')](_0x59ff03[_0xf6e5('0x8e')][_0xf6e5('0xa9')])){var _0x47264b=_0x59ff03[_0xf6e5('0x8e')][_0xf6e5('0xa9')];if(!_[_0xf6e5('0x53')](shared[_0xf6e5('0xaa')][_0x47264b]))_0x59ff03[_0xf6e5('0x8e')][_0xf6e5('0xab')]=shared[_0xf6e5('0xaa')][_0x47264b]['utcOffset'];}return db[_0xf6e5('0x1d')]['create'](_0x59ff03[_0xf6e5('0x8e')],{'fields':_[_0xf6e5('0x20')](_0x123561),'raw':!![]});})[_0xf6e5('0x16')](respondWithResult(_0x51c9a8,0xc9))[_0xf6e5('0x84')](handleError(_0x51c9a8,null));};exports['bulkCreate']=function(_0x4244ee,_0x319030){var _0x4215ca=0x0;var _0x344169=0x0;var _0x57f0eb=0x0;return db['CmContact'][_0xf6e5('0x1e')]()[_0xf6e5('0x16')](function(_0x2500e7){return BPromise['each'](_0x4244ee[_0xf6e5('0x8e')],function(_0x572a96){var _0x3806fd={'where':{'$or':[]},'defaults':_0x572a96,'fields':_[_0xf6e5('0x20')](_0x2500e7),'raw':!![]};if(_0x572a96[_0xf6e5('0xac')]){for(var _0x5f2edb=0x0;_0x5f2edb<_0x572a96['duplicates'][_0xf6e5('0x1f')];_0x5f2edb++){var _0x3c1268={};_0x3c1268[_0x572a96['duplicates'][_0x5f2edb]]=_0x572a96[_0x572a96[_0xf6e5('0xac')][_0x5f2edb]];_0x3806fd[_0xf6e5('0x33')][_0xf6e5('0xad')]['push'](_0x3c1268);}_0x3806fd['where'][_0xf6e5('0x55')]=_0x572a96[_0xf6e5('0x55')];}return db[_0xf6e5('0x1d')][_0xf6e5('0xae')](_0x3806fd)['spread'](function(_0x290c85,_0x1f9b6f){if(_0x1f9b6f){_0x4215ca++;}else{_0x57f0eb++;}})[_0xf6e5('0x84')](function(){_0x344169++;});});})[_0xf6e5('0x16')](function(_0x1e0a8b){if(_0x1e0a8b){return{'success':_0x4215ca,'failure':_0x344169,'duplicates':_0x57f0eb};}})[_0xf6e5('0x16')](respondWithResult(_0x319030,0xc9))['catch'](handleError(_0x319030,null));};exports[_0xf6e5('0xaf')]=function(_0x1c6849,_0x2a74db){var _0x36923f;return db[_0xf6e5('0x1d')][_0xf6e5('0x1e')]()[_0xf6e5('0x16')](function(_0x5498d6){return db[_0xf6e5('0x1d')][_0xf6e5('0x43')]({'where':{'id':_0x1c6849[_0xf6e5('0x85')]['id']},'include':[{'model':db[_0xf6e5('0xb0')],'as':'Tags','attributes':['id',_0xf6e5('0x1b'),_0xf6e5('0xb1')],'required':_0x1c6849['query'][_0xf6e5('0x57')]?!![]:![]}],'attributes':_[_0xf6e5('0x20')](_0x5498d6)});})[_0xf6e5('0x16')](function(_0x2b1de4){if(!_[_0xf6e5('0x53')](_0x2b1de4)){_0x36923f=_0x2b1de4[_0xf6e5('0x8f')]({'plain':!![]});var _0x53cc11={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2b1de4&&_0x2b1de4[_0xf6e5('0x55')]){if(_0x2b1de4[_0xf6e5('0x55')]){_0x53cc11['where'][_0xf6e5('0xb2')][_0xf6e5('0x23')]({'ListId':{'$ne':_0x2b1de4[_0xf6e5('0x55')]}});}}return db[_0xf6e5('0x24')][_0xf6e5('0x89')](_0x53cc11);}})[_0xf6e5('0x16')](function(_0xefc172){if(!_[_0xf6e5('0x53')](_0xefc172)){return _[_0xf6e5('0xb3')](_0x36923f,_[_0xf6e5('0x74')](_0xefc172,function(_0x221772){return util['format'](_0xf6e5('0xb4'),_0x221772['id']);}));}})[_0xf6e5('0x16')](handleEntityNotFound(_0x2a74db,null))[_0xf6e5('0x16')](respondWithResult(_0x2a74db,null))['catch'](handleError(_0x2a74db,null));};exports[_0xf6e5('0x14')]=function(_0x4c6d32,_0x3aec3a){var _0x2d6894;if(_0x4c6d32['body']['id']){delete _0x4c6d32[_0xf6e5('0x8e')]['id'];}if(!_[_0xf6e5('0x53')](_0x4c6d32[_0xf6e5('0x8e')][_0xf6e5('0xa9')])){var _0xbcd947=_0x4c6d32[_0xf6e5('0x8e')][_0xf6e5('0xa9')];if(!_['isNil'](shared[_0xf6e5('0xaa')][_0xbcd947]))_0x4c6d32[_0xf6e5('0x8e')]['utcOffset']=shared[_0xf6e5('0xaa')][_0xbcd947]['utcOffset'];}return db[_0xf6e5('0x1d')]['find']({'where':{'id':_0x4c6d32[_0xf6e5('0x85')]['id']}})['then'](handleEntityNotFound(_0x3aec3a,null))[_0xf6e5('0x16')](saveUpdates(_0x4c6d32['body'],null))[_0xf6e5('0x16')](function(_0xff4b50){_0x2d6894=_0xff4b50;var _0x385342={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xff4b50&&_0xff4b50[_0xf6e5('0x55')]){if(_0xff4b50[_0xf6e5('0x55')]){_0x385342[_0xf6e5('0x33')]['$and'][_0xf6e5('0x23')]({'ListId':{'$ne':_0xff4b50['ListId']}});}}return db[_0xf6e5('0x24')]['findAll'](_0x385342);})[_0xf6e5('0x16')](function(_0x1dfb32){if(_0x1dfb32){return _[_0xf6e5('0xb3')](_[_0xf6e5('0xb5')](_0x4c6d32[_0xf6e5('0x8e')],function(_0xb17ce7,_0x216fc8){return _['startsWith'](_0x216fc8,_0xf6e5('0x22'));}),_[_0xf6e5('0x74')](_0x1dfb32,function(_0xb7b4e3){return util[_0xf6e5('0xb6')](_0xf6e5('0xb4'),_0xb7b4e3['id']);}));}})[_0xf6e5('0x16')](function(_0x2a9e36){if(_0x2a9e36&&!_['isEmpty'](_0x2a9e36)){var _0x2e0a4f=squel['update']()[_0xf6e5('0xb7')](_0xf6e5('0x39'))[_0xf6e5('0xb8')](_0x2a9e36)[_0xf6e5('0x33')](_0xf6e5('0xb9'),_0x4c6d32[_0xf6e5('0x85')]['id'])[_0xf6e5('0xba')]();return db[_0xf6e5('0x76')][_0xf6e5('0x2b')](_0x2e0a4f['text'],{'replacements':_0x2e0a4f['values']});}})[_0xf6e5('0x16')](function(){if(_0x4c6d32[_0xf6e5('0x8e')][_0xf6e5('0xbb')]&&_0x2d6894){return db[_0xf6e5('0x93')]['update']({'phone':_0x4c6d32[_0xf6e5('0x8e')]['phone']},{'where':{'ContactId':_0x2d6894['id']}});}})['then'](function(){return _0x2d6894;})[_0xf6e5('0x16')](respondWithResult(_0x3aec3a,null))['catch'](handleError(_0x3aec3a,null));};exports[_0xf6e5('0xbc')]=function(_0x4db61d,_0x5e6ff4){var _0x5cff7e={};var _0x6641f9={};var _0x202a84;var _0x1c0dfe;return db['CmContact'][_0xf6e5('0x25')]({'where':{'id':_0x4db61d[_0xf6e5('0x85')]['id']}})[_0xf6e5('0x16')](handleEntityNotFound(_0x5e6ff4,null))[_0xf6e5('0x16')](function(_0x2bc454){if(_0x2bc454){_0x202a84=_0x2bc454;_0x6641f9[_0xf6e5('0x2a')]=_[_0xf6e5('0x20')](db[_0xf6e5('0xb0')]['rawAttributes']);_0x6641f9[_0xf6e5('0x2b')]=_[_0xf6e5('0x20')](_0x4db61d[_0xf6e5('0x2b')]);_0x6641f9[_0xf6e5('0x2c')]=_['intersection'](_0x6641f9[_0xf6e5('0x2a')],_0x6641f9[_0xf6e5('0x2b')]);_0x5cff7e[_0xf6e5('0x2e')]=_['intersection'](_0x6641f9[_0xf6e5('0x2a')],qs[_0xf6e5('0x2f')](_0x4db61d[_0xf6e5('0x2b')][_0xf6e5('0x2f')]));_0x5cff7e['attributes']=_0x5cff7e[_0xf6e5('0x2e')]['length']?_0x5cff7e['attributes']:_0x6641f9[_0xf6e5('0x2a')];_0x5cff7e[_0xf6e5('0x6a')]=qs['sort'](_0x4db61d[_0xf6e5('0x2b')][_0xf6e5('0x32')]);_0x5cff7e[_0xf6e5('0x33')]=qs[_0xf6e5('0x2c')](_[_0xf6e5('0x34')](_0x4db61d[_0xf6e5('0x2b')],_0x6641f9[_0xf6e5('0x2c')]));if(_0x4db61d[_0xf6e5('0x2b')][_0xf6e5('0x52')]){_0x5cff7e['where']=_[_0xf6e5('0x79')](_0x5cff7e[_0xf6e5('0x33')],{'$or':_[_0xf6e5('0x74')](_0x5cff7e['attributes'],function(_0x488fa8){var _0x224ba1={};_0x224ba1[_0x488fa8]={'$like':'%'+_0x4db61d[_0xf6e5('0x2b')][_0xf6e5('0x52')]+'%'};return _0x224ba1;})});}_0x5cff7e=_[_0xf6e5('0x79')]({},_0x5cff7e,_0x4db61d[_0xf6e5('0xbd')]);return _0x202a84[_0xf6e5('0xbc')](_0x5cff7e);}})['then'](function(_0x24ff42){if(_0x24ff42){_0x1c0dfe=_0x24ff42[_0xf6e5('0x1f')];if(!_0x4db61d['query'][_0xf6e5('0x30')](_0xf6e5('0x31'))){_0x5cff7e['limit']=qs['limit'](_0x4db61d[_0xf6e5('0x2b')][_0xf6e5('0x11')]);_0x5cff7e[_0xf6e5('0xe')]=qs[_0xf6e5('0xe')](_0x4db61d[_0xf6e5('0x2b')][_0xf6e5('0xe')]);}return _0x202a84[_0xf6e5('0xbc')](_0x5cff7e);}})[_0xf6e5('0x16')](function(_0x989bbe){if(_0x989bbe){return _0x989bbe?{'count':_0x1c0dfe,'rows':_0x989bbe}:null;}})[_0xf6e5('0x16')](respondWithResult(_0x5e6ff4,null))['catch'](handleError(_0x5e6ff4,null));};exports[_0xf6e5('0xbe')]=function(_0x44162e,_0x55ee7b){if(_0x44162e['body']['id']){delete _0x44162e[_0xf6e5('0x8e')]['id'];}return db[_0xf6e5('0x1d')][_0xf6e5('0x25')]({'where':{'id':_0x44162e[_0xf6e5('0x85')]['id']}})[_0xf6e5('0x16')](handleEntityNotFound(_0x55ee7b,null))[_0xf6e5('0x16')](function(_0x302763){if(_0x302763){return _0x302763['setTags'](_0x44162e[_0xf6e5('0x8e')][_0xf6e5('0xbf')]||[]);}return null;})['then'](respondWithResult(_0x55ee7b,null))[_0xf6e5('0x84')](handleError(_0x55ee7b,null));};exports[_0xf6e5('0xc0')]=function(_0x496b26,_0x3a2b29){var _0x458b54={'raw':![],'where':{}};var _0x1dcc67={};var _0x14602b={'count':0x0,'rows':[]};return db[_0xf6e5('0x1d')][_0xf6e5('0x25')]({'where':{'id':_0x496b26['params']['id']}})['then'](handleEntityNotFound(_0x3a2b29,null))[_0xf6e5('0x16')](function(_0xf07332){if(_0xf07332){_0x1dcc67[_0xf6e5('0x2a')]=_[_0xf6e5('0x20')](db[_0xf6e5('0x93')]['rawAttributes']);_0x1dcc67['query']=_[_0xf6e5('0x20')](_0x496b26[_0xf6e5('0x2b')]);_0x1dcc67[_0xf6e5('0x2c')]=_[_0xf6e5('0x2d')](_0x1dcc67['model'],_0x1dcc67[_0xf6e5('0x2b')]);_0x458b54[_0xf6e5('0x2e')]=_['intersection'](_0x1dcc67['model'],qs['fields'](_0x496b26[_0xf6e5('0x2b')]['fields']));_0x458b54[_0xf6e5('0x2e')]=_0x458b54[_0xf6e5('0x2e')][_0xf6e5('0x1f')]?_0x458b54[_0xf6e5('0x2e')]:_0x1dcc67[_0xf6e5('0x2a')];if(!_0x496b26[_0xf6e5('0x2b')][_0xf6e5('0x30')](_0xf6e5('0x31'))){_0x458b54[_0xf6e5('0x11')]=qs['limit'](_0x496b26[_0xf6e5('0x2b')]['limit']);_0x458b54[_0xf6e5('0xe')]=qs[_0xf6e5('0xe')](_0x496b26['query'][_0xf6e5('0xe')]);}_0x458b54[_0xf6e5('0x6a')]=qs[_0xf6e5('0x32')](_0x496b26[_0xf6e5('0x2b')][_0xf6e5('0x32')]);_0x458b54[_0xf6e5('0x33')]=qs[_0xf6e5('0x2c')](_['pick'](_0x496b26[_0xf6e5('0x2b')],_0x1dcc67[_0xf6e5('0x2c')]));_0x458b54[_0xf6e5('0x33')]['ContactId']=_0xf07332['id'];if(_0x496b26[_0xf6e5('0x2b')][_0xf6e5('0x52')]){_0x458b54[_0xf6e5('0x33')]=_[_0xf6e5('0x79')](_0x458b54[_0xf6e5('0x33')],{'$or':_['map'](_0x458b54['attributes'],function(_0x4dcc8d){var _0x10abc1={};_0x10abc1[_0x4dcc8d]={'$like':'%'+_0x496b26['query'][_0xf6e5('0x52')]+'%'};return _0x10abc1;})});}_0x458b54=_['merge']({},_0x458b54,_0x496b26[_0xf6e5('0xbd')]);return db[_0xf6e5('0x93')][_0xf6e5('0x10')]({'where':_0x458b54[_0xf6e5('0x33')]})[_0xf6e5('0x16')](function(_0x54999e){_0x14602b[_0xf6e5('0x10')]=_0x54999e;if(_0x496b26[_0xf6e5('0x2b')][_0xf6e5('0xc1')]){_0x458b54[_0xf6e5('0xc2')]=[{'all':!![]}];}return db[_0xf6e5('0x93')][_0xf6e5('0x89')](_0x458b54);})[_0xf6e5('0x16')](function(_0x294235){_0x14602b[_0xf6e5('0xc3')]=_0x294235;return _0x14602b;});}})[_0xf6e5('0x16')](respondWithFilteredResult(_0x3a2b29,_0x458b54))['catch'](handleError(_0x3a2b29,null));};exports[_0xf6e5('0xc4')]=function(_0xf94c3c,_0x32b4c8){var _0x100840={'raw':!![],'where':{}};var _0x4fa726={};var _0x5291f7={'count':0x0,'rows':[]};return db['CmContact'][_0xf6e5('0x25')]({'where':{'id':_0xf94c3c[_0xf6e5('0x85')]['id']}})['then'](handleEntityNotFound(_0x32b4c8,null))[_0xf6e5('0x16')](function(_0x262a5e){if(_0x262a5e){_0x4fa726[_0xf6e5('0x2a')]=_['keys'](db[_0xf6e5('0xc5')][_0xf6e5('0xc6')]);_0x4fa726[_0xf6e5('0x2b')]=_[_0xf6e5('0x20')](_0xf94c3c['query']);_0x4fa726['filters']=_['intersection'](_0x4fa726['model'],_0x4fa726['query']);_0x100840['attributes']=_[_0xf6e5('0x2d')](_0x4fa726[_0xf6e5('0x2a')],qs[_0xf6e5('0x2f')](_0xf94c3c[_0xf6e5('0x2b')]['fields']));_0x100840[_0xf6e5('0x2e')]=_0x100840[_0xf6e5('0x2e')][_0xf6e5('0x1f')]?_0x100840['attributes']:_0x4fa726[_0xf6e5('0x2a')];if(!_0xf94c3c[_0xf6e5('0x2b')][_0xf6e5('0x30')](_0xf6e5('0x31'))){_0x100840[_0xf6e5('0x11')]=qs[_0xf6e5('0x11')](_0xf94c3c[_0xf6e5('0x2b')]['limit']);_0x100840[_0xf6e5('0xe')]=qs[_0xf6e5('0xe')](_0xf94c3c[_0xf6e5('0x2b')][_0xf6e5('0xe')]);}_0x100840['order']=qs[_0xf6e5('0x32')](_0xf94c3c[_0xf6e5('0x2b')][_0xf6e5('0x32')]);_0x100840[_0xf6e5('0x33')]=qs[_0xf6e5('0x2c')](_[_0xf6e5('0x34')](_0xf94c3c[_0xf6e5('0x2b')],_0x4fa726['filters']));_0x100840[_0xf6e5('0x33')][_0xf6e5('0xc7')]=_0x262a5e['id'];if(_0xf94c3c['query']['filter']){_0x100840[_0xf6e5('0x33')]=_[_0xf6e5('0x79')](_0x100840['where'],{'$or':_[_0xf6e5('0x74')](_0x100840[_0xf6e5('0x2e')],function(_0x564ec5){var _0x3b5624={};_0x3b5624[_0x564ec5]={'$like':'%'+_0xf94c3c['query'][_0xf6e5('0x52')]+'%'};return _0x3b5624;})});}_0x100840=_[_0xf6e5('0x79')]({},_0x100840,_0xf94c3c['options']);return db[_0xf6e5('0xc5')][_0xf6e5('0x10')]({'where':_0x100840[_0xf6e5('0x33')]})[_0xf6e5('0x16')](function(_0x1ae72b){_0x5291f7[_0xf6e5('0x10')]=_0x1ae72b;if(_0xf94c3c[_0xf6e5('0x2b')][_0xf6e5('0xc1')]){_0x100840[_0xf6e5('0xc2')]=[{'all':!![]}];}return db[_0xf6e5('0xc5')][_0xf6e5('0x89')](_0x100840);})[_0xf6e5('0x16')](function(_0x26059e){_0x5291f7[_0xf6e5('0xc3')]=_0x26059e;return _0x5291f7;});}})[_0xf6e5('0x16')](respondWithFilteredResult(_0x32b4c8,_0x100840))[_0xf6e5('0x84')](handleError(_0x32b4c8,null));};exports['getHopperFinals']=function(_0x240dc6,_0x58dde0){var _0x1b7490={'raw':!![],'where':{}};var _0xf9394={};var _0x18dc28={'count':0x0,'rows':[]};return db[_0xf6e5('0x1d')][_0xf6e5('0x25')]({'where':{'id':_0x240dc6[_0xf6e5('0x85')]['id']}})['then'](handleEntityNotFound(_0x58dde0,null))['then'](function(_0x1cb5d8){if(_0x1cb5d8){_0xf9394[_0xf6e5('0x2a')]=_[_0xf6e5('0x20')](db[_0xf6e5('0x9f')][_0xf6e5('0xc6')]);_0xf9394[_0xf6e5('0x2b')]=_[_0xf6e5('0x20')](_0x240dc6[_0xf6e5('0x2b')]);_0xf9394[_0xf6e5('0x2c')]=_[_0xf6e5('0x2d')](_0xf9394[_0xf6e5('0x2a')],_0xf9394[_0xf6e5('0x2b')]);_0x1b7490['attributes']=_[_0xf6e5('0x2d')](_0xf9394[_0xf6e5('0x2a')],qs[_0xf6e5('0x2f')](_0x240dc6[_0xf6e5('0x2b')]['fields']));_0x1b7490[_0xf6e5('0x2e')]=_0x1b7490[_0xf6e5('0x2e')][_0xf6e5('0x1f')]?_0x1b7490[_0xf6e5('0x2e')]:_0xf9394[_0xf6e5('0x2a')];if(!_0x240dc6[_0xf6e5('0x2b')][_0xf6e5('0x30')](_0xf6e5('0x31'))){_0x1b7490[_0xf6e5('0x11')]=qs[_0xf6e5('0x11')](_0x240dc6[_0xf6e5('0x2b')][_0xf6e5('0x11')]);_0x1b7490['offset']=qs[_0xf6e5('0xe')](_0x240dc6['query'][_0xf6e5('0xe')]);}_0x1b7490[_0xf6e5('0x6a')]=qs['sort'](_0x240dc6[_0xf6e5('0x2b')][_0xf6e5('0x32')]);_0x1b7490[_0xf6e5('0x33')]=qs['filters'](_[_0xf6e5('0x34')](_0x240dc6[_0xf6e5('0x2b')],_0xf9394[_0xf6e5('0x2c')]));_0x1b7490[_0xf6e5('0x33')][_0xf6e5('0xc7')]=_0x1cb5d8['id'];if(_0x240dc6[_0xf6e5('0x2b')][_0xf6e5('0x52')]){_0x1b7490[_0xf6e5('0x33')]=_[_0xf6e5('0x79')](_0x1b7490[_0xf6e5('0x33')],{'$or':_['map'](_0x1b7490[_0xf6e5('0x2e')],function(_0x5ccbe8){var _0x5944bb={};_0x5944bb[_0x5ccbe8]={'$like':'%'+_0x240dc6[_0xf6e5('0x2b')][_0xf6e5('0x52')]+'%'};return _0x5944bb;})});}_0x1b7490=_['merge']({},_0x1b7490,_0x240dc6[_0xf6e5('0xbd')]);return db[_0xf6e5('0x9f')][_0xf6e5('0x10')]({'where':_0x1b7490[_0xf6e5('0x33')]})[_0xf6e5('0x16')](function(_0x1cb911){_0x18dc28[_0xf6e5('0x10')]=_0x1cb911;if(_0x240dc6['query'][_0xf6e5('0xc1')]){_0x1b7490[_0xf6e5('0xc2')]=[{'all':!![]}];}return db[_0xf6e5('0x9f')][_0xf6e5('0x89')](_0x1b7490);})['then'](function(_0x2e5df1){_0x18dc28[_0xf6e5('0xc3')]=_0x2e5df1;return _0x18dc28;});}})[_0xf6e5('0x16')](respondWithFilteredResult(_0x58dde0,_0x1b7490))[_0xf6e5('0x84')](handleError(_0x58dde0,null));};exports['getJscriptySessions']=function(_0x57db71,_0x22f35c){var _0x4fb758={'raw':!![],'where':{}};var _0xb4ae9a={};var _0x1c99bb={'count':0x0,'rows':[]};return db[_0xf6e5('0x1d')][_0xf6e5('0x25')]({'where':{'id':_0x57db71[_0xf6e5('0x85')]['id']}})[_0xf6e5('0x16')](handleEntityNotFound(_0x22f35c,null))[_0xf6e5('0x16')](function(_0x5e6ee8){if(_0x5e6ee8){_0xb4ae9a['model']=_[_0xf6e5('0x20')](db[_0xf6e5('0xa5')][_0xf6e5('0xc6')]);_0xb4ae9a[_0xf6e5('0x2b')]=_['keys'](_0x57db71[_0xf6e5('0x2b')]);_0xb4ae9a[_0xf6e5('0x2c')]=_[_0xf6e5('0x2d')](_0xb4ae9a[_0xf6e5('0x2a')],_0xb4ae9a['query']);_0x4fb758[_0xf6e5('0x2e')]=_['intersection'](_0xb4ae9a[_0xf6e5('0x2a')],qs[_0xf6e5('0x2f')](_0x57db71[_0xf6e5('0x2b')][_0xf6e5('0x2f')]));_0x4fb758[_0xf6e5('0x2e')]=_0x4fb758[_0xf6e5('0x2e')][_0xf6e5('0x1f')]?_0x4fb758['attributes']:_0xb4ae9a['model'];if(!_0x57db71[_0xf6e5('0x2b')][_0xf6e5('0x30')](_0xf6e5('0x31'))){_0x4fb758[_0xf6e5('0x11')]=qs[_0xf6e5('0x11')](_0x57db71[_0xf6e5('0x2b')][_0xf6e5('0x11')]);_0x4fb758[_0xf6e5('0xe')]=qs[_0xf6e5('0xe')](_0x57db71[_0xf6e5('0x2b')][_0xf6e5('0xe')]);}_0x4fb758[_0xf6e5('0x6a')]=qs[_0xf6e5('0x32')](_0x57db71[_0xf6e5('0x2b')][_0xf6e5('0x32')]);_0x4fb758[_0xf6e5('0x33')]=qs[_0xf6e5('0x2c')](_[_0xf6e5('0x34')](_0x57db71[_0xf6e5('0x2b')],_0xb4ae9a[_0xf6e5('0x2c')]));_0x4fb758['where'][_0xf6e5('0xc7')]=_0x5e6ee8['id'];if(_0x57db71['query']['filter']){_0x4fb758['where']=_['merge'](_0x4fb758['where'],{'$or':_['map'](_0x4fb758[_0xf6e5('0x2e')],function(_0xafcf86){var _0x5ce4f9={};_0x5ce4f9[_0xafcf86]={'$like':'%'+_0x57db71[_0xf6e5('0x2b')]['filter']+'%'};return _0x5ce4f9;})});}_0x4fb758=_[_0xf6e5('0x79')]({},_0x4fb758,_0x57db71[_0xf6e5('0xbd')]);return db[_0xf6e5('0xa5')][_0xf6e5('0x10')]({'where':_0x4fb758[_0xf6e5('0x33')]})['then'](function(_0xd869f7){_0x1c99bb[_0xf6e5('0x10')]=_0xd869f7;if(_0x57db71[_0xf6e5('0x2b')][_0xf6e5('0xc1')]){_0x4fb758[_0xf6e5('0xc2')]=[{'all':!![]}];}return db[_0xf6e5('0xa5')][_0xf6e5('0x89')](_0x4fb758);})[_0xf6e5('0x16')](function(_0x2f03ea){_0x1c99bb[_0xf6e5('0xc3')]=_0x2f03ea;return _0x1c99bb;});}})[_0xf6e5('0x16')](respondWithFilteredResult(_0x22f35c,_0x4fb758))[_0xf6e5('0x84')](handleError(_0x22f35c,null));};exports[_0xf6e5('0xc8')]=function(_0x2f81d8,_0x1c5c73){try{if(!_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0x55')]){throw new Error(_0xf6e5('0xc9'));}if(!_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0xca')]){throw new Error(_0xf6e5('0xcb'));}if(!_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0xcc')]){throw new Error(_0xf6e5('0xcd'));}if(!_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0xce')]){throw new Error(_0xf6e5('0xcf'));}var _0x2ee0d1=_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0xca')][_0xf6e5('0x83')](',');var _0x18f156=_0x2f81d8['body'][_0xf6e5('0xcc')][_0xf6e5('0x83')](',');if(!_0x2ee0d1[_0xf6e5('0x1f')]||!_0x18f156[_0xf6e5('0x1f')]||_0x2ee0d1['length']!==_0x18f156[_0xf6e5('0x1f')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0x2f')]=_[_0xf6e5('0xd0')](_0x2ee0d1,_0x18f156);if(!_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0x2f')][_0xf6e5('0xbb')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0x2f')][_0xf6e5('0xd1')]){throw new Error(_0xf6e5('0xd2'));}var _0x58d150=path[_0xf6e5('0x90')](config[_0xf6e5('0xd3')],'server/files/tmp',_0x2f81d8[_0xf6e5('0xd4')][_0xf6e5('0xd5')]);fs['chmodSync'](_0x58d150,parseInt('0777',0x8));var _0x480ae3=require(_0xf6e5('0xd6'))[_0xf6e5('0xd7')](path[_0xf6e5('0x90')](__dirname,_0xf6e5('0xd8')),[_0x58d150,_0x2f81d8[_0xf6e5('0x8e')]['binding_keys'],_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0xcc')],_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0x55')],_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0xd9')],_0x2f81d8[_0xf6e5('0x8e')][_0xf6e5('0xac')],_0x2f81d8[_0xf6e5('0x8e')]['socket_timestamp']]);return _0x1c5c73[_0xf6e5('0x12')](0xc8)[_0xf6e5('0xd')]({'message':_0xf6e5('0xda'),'pid':_0x480ae3[_0xf6e5('0xdb')]});}catch(_0x249232){return _0x1c5c73[_0xf6e5('0x12')](0x1f4)[_0xf6e5('0x1c')](_0x249232);}};exports['upload']=function(_0x282393,_0x2dd525){var _0x2dbe98=fs[_0xf6e5('0xdc')](_0x282393['file'][_0xf6e5('0x2')]);Papa[_0xf6e5('0xdd')](_0x2dbe98,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4e71ed){return _0x2dd525[_0xf6e5('0x12')](0xc8)['json']({'file':_0x282393['file'],'fields':_0x4e71ed['meta']['fields']});}});};exports[_0xf6e5('0xde')]=function(_0xf2e190,_0x135b76){return db[_0xf6e5('0x48')][_0xf6e5('0x89')]({'raw':!![],'attributes':['id'],'where':{'role':_0xf6e5('0x75')}})[_0xf6e5('0x16')](function(_0x2208aa){var _0x2b772a=![];if(!_0xf2e190[_0xf6e5('0x8e')][_0xf6e5('0x55')]){throw new Error(_0xf6e5('0xc9'));}if(!_0xf2e190['body']['binding'][_0xf6e5('0xbb')]){throw new Error(_0xf6e5('0xdf'));}if(!_0xf2e190[_0xf6e5('0x8e')]['binding']['firstName']){throw new Error(_0xf6e5('0xd2'));}if(!_0xf2e190['body'][_0xf6e5('0xce')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1a89f0=require(_0xf6e5('0xd6'))[_0xf6e5('0xd7')](path['join'](__dirname,_0xf6e5('0xe0')),[_0xf2e190['params']['id'],JSON[_0xf6e5('0xe1')](_0xf2e190[_0xf6e5('0x8e')]),JSON['stringify'](_0x2208aa)]);_0x1a89f0['on'](_0xf6e5('0xe2'),function(){_0x2b772a=!![];return _0x135b76['status'](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x1a89f0['pid']});});_0x1a89f0['on'](_0xf6e5('0xe3'),function(_0xdf503a){if(_0xdf503a&&!_0x2b772a){return _0x135b76[_0xf6e5('0x12')](0x1f4)[_0xf6e5('0xd')]({'message':'error\x20child\x20process','pid':_0x1a89f0['pid']});}});})[_0xf6e5('0x84')](handleError(_0x135b76,null));};exports['getJourney']=function(_0xfa2b1a,_0x34d133){var _0x5a382f=[_0xf6e5('0xe4'),'chat',_0xf6e5('0xe5'),_0xf6e5('0xe6'),_0xf6e5('0xe7'),_0xf6e5('0xe8'),_0xf6e5('0xe9')];var _0x285277={'offset':0x0,'order':qs[_0xf6e5('0x32')](_0xf6e5('0xea'))},_0x5d0c2d={'count':0x0,'rows':[]};Promise[_0xf6e5('0x6c')]()[_0xf6e5('0x16')](function(){if(_0xfa2b1a['query'][_0xf6e5('0xeb')]){if(!_[_0xf6e5('0xec')](_0x5a382f,_0xfa2b1a['query'][_0xf6e5('0xeb')]['toLowerCase']())){throw new Error('Invalid\x20channel');}_0x5a382f=[_0xfa2b1a[_0xf6e5('0x2b')]['channel'][_0xf6e5('0xed')]()];}if(_0xfa2b1a['query'][_0xf6e5('0xee')]){try{var _0x4c1b99=JSON[_0xf6e5('0xdd')](_0xfa2b1a[_0xf6e5('0x2b')][_0xf6e5('0xee')]);if(!moment(_0x4c1b99[_0xf6e5('0x37')])[_0xf6e5('0xef')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x4c1b99['to'])[_0xf6e5('0xef')]()){throw new Error(_0xf6e5('0xf0'));}}catch(_0x2d14b4){throw new Error(_0xf6e5('0xf1'));}}if(!_0xfa2b1a[_0xf6e5('0x2b')][_0xf6e5('0x30')](_0xf6e5('0x31'))){_0x285277[_0xf6e5('0x11')]=qs[_0xf6e5('0x11')](_0xfa2b1a['query'][_0xf6e5('0x11')]||0xa);_0x285277[_0xf6e5('0xe')]=qs[_0xf6e5('0xe')](_0xfa2b1a[_0xf6e5('0x2b')][_0xf6e5('0xe')]);}var _0x5254a4=_0x5a382f[_0xf6e5('0x74')](function(_0x53919c){if(_0x53919c===_0xf6e5('0xe9')){var _0x50e88b={'attributes':['id','uniqueid',_0xf6e5('0x29'),_0xf6e5('0xf2'),'destination','callerid',_0xf6e5('0xf3'),_0xf6e5('0xf4'),'duration',_0xf6e5('0xf5'),'createdAt',_0xf6e5('0xf6'),_0xf6e5('0xf7'),'userThirdDisposition','UserId'],'where':{'ContactId':_0xfa2b1a[_0xf6e5('0x85')]['id']},'include':[{'model':db[_0xf6e5('0x48')],'as':_0xf6e5('0x48'),'attributes':['id','name',_0xf6e5('0xf8'),_0xf6e5('0x8b')]}],'order':[[_0xf6e5('0xf9'),_0xf6e5('0x6b')]]};if(_0xfa2b1a[_0xf6e5('0x2b')]['range']){_0x50e88b[_0xf6e5('0x33')][_0xf6e5('0xf9')]={'$gte':_0x4c1b99['from'],'$lte':_0x4c1b99['to']};}return db['VoiceCallReport'][_0xf6e5('0xfa')](_0x50e88b)[_0xf6e5('0x16')](function(_0x2f4e7d){_0x5d0c2d[_0xf6e5('0x10')]+=_0x2f4e7d[_0xf6e5('0x10')];return _[_0xf6e5('0x74')](_0x2f4e7d[_0xf6e5('0xc3')],function(_0x47581a){var _0x1ea1b5=_0x47581a[_0xf6e5('0x8f')]({'plain':!![]});_0x1ea1b5[_0xf6e5('0xeb')]=_0x53919c;if(_0x1ea1b5['User']){_0x1ea1b5['User']={'id':_0x1ea1b5[_0xf6e5('0x48')]['id'],'name':_0x1ea1b5['User'][_0xf6e5('0x1b')],'fullname':_0x1ea1b5[_0xf6e5('0x48')]['fullname'],'alias':_0x1ea1b5[_0xf6e5('0x48')][_0xf6e5('0x8b')]};}return _0x1ea1b5;});});}else{var _0x49fa64=_[_0xf6e5('0xfb')](_0x53919c)+(_0x53919c===_0xf6e5('0xfc')?_0xf6e5('0xfd'):_0xf6e5('0xfe'));var _0x10c630={'attributes':['id',_0xf6e5('0xff'),_0xf6e5('0x100'),_0xf6e5('0xf9'),'note','disposition',_0xf6e5('0x101'),'thirdDisposition',_0xf6e5('0x102'),_0x49fa64+'Id'],'where':{'ContactId':_0xfa2b1a[_0xf6e5('0x85')]['id']},'include':[{'model':db[_0x49fa64],'as':_0xf6e5('0xfe'),'attributes':['id',_0xf6e5('0x1b'),_0xf6e5('0x103')]},{'model':db[_0xf6e5('0x48')],'as':_0xf6e5('0x104'),'attributes':['id',_0xf6e5('0x1b'),_0xf6e5('0xf8')]},{'model':db[_0xf6e5('0xb0')],'as':_0xf6e5('0x82'),'attributes':['id',_0xf6e5('0x1b'),_0xf6e5('0xb1')],'through':{'attributes':[]}}],'order':[[_0xf6e5('0xf9'),_0xf6e5('0x6b')]]};if(_0xfa2b1a[_0xf6e5('0x2b')][_0xf6e5('0xee')]){_0x10c630[_0xf6e5('0x33')][_0xf6e5('0xf9')]={'$gte':_0x4c1b99[_0xf6e5('0x37')],'$lte':_0x4c1b99['to']};}switch(_0x53919c){case _0xf6e5('0xfc'):_0x10c630['attributes'][_0xf6e5('0x23')](_0xf6e5('0x105'),_0xf6e5('0x106'),_0xf6e5('0x107'),'deviceModel',_0xf6e5('0x108'),_0xf6e5('0x109'),'ratingType',_0xf6e5('0x10a'),_0xf6e5('0x10b'));break;case _0xf6e5('0xe4'):_0x10c630[_0xf6e5('0x2e')][_0xf6e5('0x23')](_0xf6e5('0x10c'),_0xf6e5('0x10d'));break;case _0xf6e5('0xe6'):_0x10c630['attributes'][_0xf6e5('0x23')](_0xf6e5('0x10e'),_0xf6e5('0x10f'));break;}return db[_[_0xf6e5('0xfb')](_0x53919c)+'Interaction'][_0xf6e5('0xfa')](_0x10c630)[_0xf6e5('0x16')](function(_0x47d83){_0x5d0c2d[_0xf6e5('0x10')]+=_0x47d83[_0xf6e5('0x10')];return _[_0xf6e5('0x74')](_0x47d83[_0xf6e5('0xc3')],function(_0x5a5d80){var _0xef324=_0x5a5d80['get']({'plain':!![]});_0xef324[_0xf6e5('0xeb')]=_0x53919c;if(_0xef324['Owner']){_0xef324['Owner']={'id':_0xef324['Owner']['id'],'name':_0xef324['Owner']['name'],'fullname':_0xef324[_0xf6e5('0x104')][_0xf6e5('0xf8')]};}return _0xef324;});});}});return Promise[_0xf6e5('0x27')](_0x5254a4);})['then'](function(_0x2b51be){return _(_0x2b51be)[_0xf6e5('0x110')]()['sortBy'](_0xf6e5('0xf9'))['reverse']()['value']();})[_0xf6e5('0x16')](function(_0x1c8104){_0x5d0c2d[_0xf6e5('0xc3')]=_0x285277[_0xf6e5('0x11')]?_0x1c8104[_0xf6e5('0x111')](_0x285277[_0xf6e5('0xe')],_0x285277[_0xf6e5('0xe')]+_0x285277[_0xf6e5('0x11')]):_0x1c8104;return _0x5d0c2d;})[_0xf6e5('0x16')](respondWithFilteredResult(_0x34d133,_0x285277))[_0xf6e5('0x84')](handleError(_0x34d133,null));};
\ No newline at end of file
+var _0xc4f5=['SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','bulkCreate','duplicates','$or','findOrCreate','spread','show','params','format','cf_%d','$and','omit','pickBy','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','pick','options','setTags','ids','ContactId','includeAll','include','nolimit','getHopperFinals','CmHopperFinal','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','path','parse','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','getJourney','mail','chat','sms','whatsapp','voice','channel','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','key','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','substatus','openchannel','externalUrl','threadId','Interaction','Owner','flatten','slice','util','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','end','sendStatus','error','stack','name','send','CmContact','length','keys','startsWith','cf_','CmCustomField','findOne','trimStart','all','fieldType','type','query','filters','intersection','model','fields','attributes','order','sort','where','select','field','color','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','value','DATE','text','map','hasOwnProperty','filter','isNil','push','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','User','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','describe','tags','columnName','analytics','findAll','displayName','alias','values','body','from','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport'];(function(_0x37fcda,_0x2f5aa1){var _0xf5ed91=function(_0x3c3241){while(--_0x3c3241){_0x37fcda['push'](_0x37fcda['shift']());}};_0xf5ed91(++_0x2f5aa1);}(_0xc4f5,0x75));var _0x5c4f=function(_0x5837d1,_0x4661e0){_0x5837d1=_0x5837d1-0x0;var _0x43b3b7=_0xc4f5[_0x5837d1];return _0x43b3b7;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x5c4f('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x5c4f('0x1'));var squel=require(_0x5c4f('0x2'));var Papa=require(_0x5c4f('0x3'));var Redis=require(_0x5c4f('0x4'));var qs=require(_0x5c4f('0x5'));var as=require(_0x5c4f('0x6'));var logger=require(_0x5c4f('0x7'))(_0x5c4f('0x8'));var config=require(_0x5c4f('0x9'));var shared=require('../../config/environment/shared');var db=require(_0x5c4f('0xa'))['db'];config[_0x5c4f('0xb')]=_['defaults'](config[_0x5c4f('0xb')],{'host':_0x5c4f('0xc'),'port':0x18eb});var socket=require(_0x5c4f('0xd'))(new Redis(config[_0x5c4f('0xb')]));require('./cmContact.socket')[_0x5c4f('0xe')](socket);function respondWithResult(_0x1a143f,_0x523301){_0x523301=_0x523301||0xc8;return function(_0x249bb9){if(_0x249bb9){return _0x1a143f[_0x5c4f('0xf')](_0x523301)[_0x5c4f('0x10')](_0x249bb9);}};}function respondWithFilteredResult(_0x592b65,_0xe7379f){return function(_0x2a4c06){if(_0x2a4c06){var _0xe02394=typeof _0xe7379f[_0x5c4f('0x11')]===_0x5c4f('0x12')&&typeof _0xe7379f[_0x5c4f('0x13')]===_0x5c4f('0x12');var _0x56c291=_0x2a4c06[_0x5c4f('0x14')];var _0x15c8f4=_0xe02394?0x0:_0xe7379f[_0x5c4f('0x11')];var _0x2bf021=_0xe02394?_0x2a4c06[_0x5c4f('0x14')]:_0xe7379f[_0x5c4f('0x11')]+_0xe7379f[_0x5c4f('0x13')];var _0x229c47;if(_0x2bf021>=_0x56c291){_0x2bf021=_0x56c291;_0x229c47=0xc8;}else{_0x229c47=0xce;}_0x592b65['status'](_0x229c47);return _0x592b65[_0x5c4f('0x15')](_0x5c4f('0x16'),_0x15c8f4+'-'+_0x2bf021+'/'+_0x56c291)['json'](_0x2a4c06);}return null;};}function saveUpdates(_0x2a3eb8){return function(_0x3fcf73){if(_0x3fcf73){return _0x3fcf73['update'](_0x2a3eb8)['then'](function(_0x4ace7a){return _0x4ace7a;});}return null;};}function removeEntity(_0x289a76){return function(_0x10844f){if(_0x10844f){return _0x10844f[_0x5c4f('0x17')]()[_0x5c4f('0x18')](function(){_0x289a76[_0x5c4f('0xf')](0xcc)[_0x5c4f('0x19')]();});}};}function handleEntityNotFound(_0x58ec3e){return function(_0x4e18a6){if(!_0x4e18a6){_0x58ec3e[_0x5c4f('0x1a')](0x194);}return _0x4e18a6;};}function handleError(_0x47413e,_0x4d34d2){_0x4d34d2=_0x4d34d2||0x1f4;return function(_0x1080a7){logger[_0x5c4f('0x1b')](_0x1080a7[_0x5c4f('0x1c')]);if(_0x1080a7[_0x5c4f('0x1d')]){delete _0x1080a7['name'];}_0x47413e['status'](_0x4d34d2)[_0x5c4f('0x1e')](_0x1080a7);};}exports['index']=function(_0x1e5a35,_0x532cb2){var _0x241ae4={},_0x5e0aa3={},_0x1fd735={'count':0x0,'rows':[]};return db[_0x5c4f('0x1f')]['describe']()[_0x5c4f('0x18')](function(_0xda8bc5){var _0x2c4f05=[];for(var _0x1bd9c8=0x0;_0x1bd9c8<Object['keys'](_0xda8bc5)[_0x5c4f('0x20')];_0x1bd9c8++){var _0x3f3850=Object[_0x5c4f('0x21')](_0xda8bc5)[_0x1bd9c8];if(_[_0x5c4f('0x22')](_0x3f3850,_0x5c4f('0x23'))){_0x2c4f05['push'](db[_0x5c4f('0x24')][_0x5c4f('0x25')]({'where':{'id':_[_0x5c4f('0x26')](_0x3f3850,'cf_')},'raw':!![]}));}}return BPromise[_0x5c4f('0x27')](_0x2c4f05)[_0x5c4f('0x18')](function(_0x2fc9b7){for(var _0x5cb872=0x0;_0x5cb872<_0x2fc9b7[_0x5c4f('0x20')];_0x5cb872++){if(_0x2fc9b7[_0x5cb872]){var _0x577f7c=_0x5c4f('0x23')+_0x2fc9b7[_0x5cb872]['id'];var _0x41748f=_0xda8bc5[_0x577f7c];_0x41748f[_0x5c4f('0x28')]=_0x2fc9b7[_0x5cb872][_0x5c4f('0x29')];}}return _0xda8bc5;});})['then'](function(_0x152037){_0x5e0aa3['model']=_['keys'](_0x152037);_0x5e0aa3[_0x5c4f('0x2a')]=_[_0x5c4f('0x21')](_0x1e5a35[_0x5c4f('0x2a')]);_0x5e0aa3[_0x5c4f('0x2b')]=_['intersection'](_0x5e0aa3['model'],_0x5e0aa3[_0x5c4f('0x2a')]);_0x241ae4['attributes']=_[_0x5c4f('0x2c')](_0x5e0aa3[_0x5c4f('0x2d')],qs[_0x5c4f('0x2e')](_0x1e5a35[_0x5c4f('0x2a')][_0x5c4f('0x2e')]));_0x241ae4['attributes']=_0x241ae4[_0x5c4f('0x2f')][_0x5c4f('0x20')]?_0x241ae4['attributes']:_0x5e0aa3[_0x5c4f('0x2d')];if(!_0x1e5a35[_0x5c4f('0x2a')]['hasOwnProperty']('nolimit')){_0x241ae4[_0x5c4f('0x13')]=qs[_0x5c4f('0x13')](_0x1e5a35[_0x5c4f('0x2a')][_0x5c4f('0x13')]);_0x241ae4[_0x5c4f('0x11')]=qs[_0x5c4f('0x11')](_0x1e5a35[_0x5c4f('0x2a')]['offset']);}_0x241ae4[_0x5c4f('0x30')]=qs[_0x5c4f('0x31')](_0x1e5a35[_0x5c4f('0x2a')][_0x5c4f('0x31')]);_0x241ae4[_0x5c4f('0x32')]=qs[_0x5c4f('0x2b')](_['pick'](_0x1e5a35[_0x5c4f('0x2a')],_0x5e0aa3[_0x5c4f('0x2b')]),_0x152037);var _0x418db8=[];var _0x24cb68=squel[_0x5c4f('0x33')]()['field']('id')[_0x5c4f('0x34')]('name')[_0x5c4f('0x34')](_0x5c4f('0x35'))['from'](_0x5c4f('0x36'));var _0xc6bec1=squel['select']()['from'](_0x5c4f('0x37'),'c')[_0x5c4f('0x38')]('cm_user_has_contacts','uc',_0x5c4f('0x39'))[_0x5c4f('0x38')](_0x5c4f('0x3a'),'ct',_0x5c4f('0x3b'))[_0x5c4f('0x38')]('tools_tags','t','t.id\x20=\x20ct.TagId')[_0x5c4f('0x32')](_0x5c4f('0x3c'));var _0x2b1bf1=squel[_0x5c4f('0x3d')]();var _0x3d9e08=[];var _0x5c7b08=squel[_0x5c4f('0x3d')]();var _0x193a1e;if(_0x1e5a35[_0x5c4f('0x2a')][_0x5c4f('0x3e')]){_0x193a1e=as[_0x5c4f('0x3f')](_0x1e5a35['query']['search']);var _0xd63e3f=_0x193a1e['sqlOperator'];for(var _0x2f84e8=0x0;_0x2f84e8<_0x193a1e['conditions']['length'];_0x2f84e8++){var _0x827807=_0x193a1e[_0x5c4f('0x40')][_0x2f84e8];var _0x383c18='c';var _0x18a785=_(_0x152037)[_0x5c4f('0x21')]()[_0x5c4f('0x41')](function(_0x594861){return _0x594861===_0x827807[_0x5c4f('0x34')];});if(_0x18a785)_0x18a785=_0x152037[_0x827807[_0x5c4f('0x34')]];if(!_0x18a785){if(_0x827807[_0x5c4f('0x34')]===_0x5c4f('0x42')){var _0x63363=_0x827807['value'][_0x5c4f('0x43')](',')['map'](function(_0xd6243){return Number(_0xd6243);});_0x63363['forEach'](function(_0x10bdc3){_0x5c7b08['or'](_0x5c4f('0x44'),'%,'+_0x10bdc3+',%');});_0x3d9e08=_['union'](_0x3d9e08,_0x63363);}else if(_0x827807[_0x5c4f('0x34')]==='User'){_0x2b1bf1[_0x5c4f('0x45')](_0x5c4f('0x46'),_0x827807[_0x5c4f('0x47')]);}}else{if(_0x827807[_0x5c4f('0x34')]==='dateOfBirth'||_0x18a785[_0x5c4f('0x28')]==='datetime')_0x827807['castTo']=_0x5c4f('0x48');var _0x3bd977=as['buildExpression'](_0x383c18,_0x18a785[_0x5c4f('0x29')],_0x827807);_0x2b1bf1[_0xd63e3f](_0x3bd977[_0x5c4f('0x49')],_0x3bd977['value']['start'],_0x3bd977[_0x5c4f('0x47')][_0x5c4f('0x19')]);}}}else{var _0x2183d4=_(Object[_0x5c4f('0x21')](_0x1e5a35['query']))[_0x5c4f('0x4a')](function(_0x2a06a3){return _0x152037[_0x5c4f('0x4b')](_0x2a06a3)?_0x2a06a3:undefined;})[_0x5c4f('0x4c')](function(_0x566bc6){return!_[_0x5c4f('0x4d')](_0x566bc6);})['value']();if(_0x1e5a35[_0x5c4f('0x2a')]['Contact'])_0x2183d4[_0x5c4f('0x4e')](_0x5c4f('0x4f'));if(!_[_0x5c4f('0x50')](_0x2183d4)){_0x2183d4[_0x5c4f('0x51')](function(_0x12b446){if(_0x12b446===_0x5c4f('0x52')){_0xc6bec1[_0x5c4f('0x32')](_0x5c4f('0x53'),[][_0x5c4f('0x54')](_0x1e5a35[_0x5c4f('0x2a')][_0x12b446]));}else if(_0x12b446==='Contact'){var _0x2c75f0='%'+_0x1e5a35[_0x5c4f('0x2a')][_0x12b446]+'%';_0xc6bec1[_0x5c4f('0x32')](_0x5c4f('0x55'),_0x2c75f0);}else{_0xc6bec1['where']('c.'+_0x12b446+'\x20=\x20?',_0x1e5a35[_0x5c4f('0x2a')][_0x12b446]);}});}if(_0x1e5a35['query']['tag']){_0x3d9e08=_[_0x5c4f('0x56')](_0x1e5a35[_0x5c4f('0x2a')]['tag'])?_0x1e5a35[_0x5c4f('0x2a')][_0x5c4f('0x57')]:new Array(_0x1e5a35['query']['tag']);_0x3d9e08['forEach'](function(_0x1b1cc2){_0x5c7b08['or'](_0x5c4f('0x44'),'%,'+_0x1b1cc2+',%');});}if(_0x1e5a35[_0x5c4f('0x2a')][_0x5c4f('0x4c')]){var _0x5cfc42=_0x1e5a35[_0x5c4f('0x2a')][_0x5c4f('0x4c')][_0x5c4f('0x58')]('\x5c','\x5c\x5c')[_0x5c4f('0x58')](/'/g,'\x27\x27');if(_0x5cfc42['split']('\x20')['length']>0x1){_0x2b1bf1['or'](_0x5c4f('0x59'),qs[_0x5c4f('0x5a')](_0x5cfc42),null);}else{if(qs['isNumeric'](_0x5cfc42)){_0x2b1bf1['or'](_0x5c4f('0x5b'),_0x5cfc42+'%');_0x2b1bf1['or'](_0x5c4f('0x5c'),_0x5cfc42+'%');_0x2b1bf1['or'](_0x5c4f('0x5d'),_0x5cfc42+'%');_0x2b1bf1['or'](_0x5c4f('0x5e'),_0x5cfc42+'%');}else if(qs[_0x5c4f('0x5f')](_0x5cfc42)){_0x2b1bf1['or'](_0x5c4f('0x60'),_0x5cfc42+'%');}else{_0x2b1bf1['or'](_0x5c4f('0x61'),'%'+_0x5cfc42+'%');_0x2b1bf1['or']('c.lastName\x20LIKE\x20?','%'+_0x5cfc42+'%');_0x2b1bf1['or'](_0x5c4f('0x60'),'%'+_0x5cfc42+'%');}}}}_0xc6bec1[_0x5c4f('0x32')](_0x2b1bf1);_0xc6bec1[_0x5c4f('0x62')](_0x5c4f('0x63'));var _0x48eeec={'type':db['Sequelize'][_0x5c4f('0x64')][_0x5c4f('0x65')],'raw':!![]};var _0x1422bd=_0xc6bec1[_0x5c4f('0x66')]()['field'](_0x5c4f('0x63'));if(_0x241ae4[_0x5c4f('0x30')]){_0x241ae4[_0x5c4f('0x30')]['forEach'](function(_0x53dfa4){_0xc6bec1[_0x5c4f('0x30')]('c.'+_0x53dfa4[0x0],_0x53dfa4[0x1]===_0x5c4f('0x67')?![]:!![]);});}if(!_[_0x5c4f('0x50')](_0x3d9e08)){_0xc6bec1[_0x5c4f('0x68')](_0x5c7b08);_0x1422bd[_0x5c4f('0x32')](_0x5c4f('0x69'),_0x3d9e08);}BPromise[_0x5c4f('0x6a')]()[_0x5c4f('0x18')](function(){if(!_0x193a1e)return;if(_0x1e5a35[_0x5c4f('0x6b')][_0x5c4f('0x6c')]!=='agent')return;if(!_['some'](_0x193a1e[_0x5c4f('0x40')],[_0x5c4f('0x34'),_0x5c4f('0x6d')])){return _0x1e5a35['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x5c4f('0x18')](function(_0x23595f){if(_[_0x5c4f('0x50')](_0x23595f)){_0x1422bd[_0x5c4f('0x32')](_0x5c4f('0x6e'));_0xc6bec1[_0x5c4f('0x32')](_0x5c4f('0x6e'));}else{_0x1422bd['where']('c.ListId\x20IN\x20?',_[_0x5c4f('0x4a')](_0x23595f,'id'));_0xc6bec1[_0x5c4f('0x32')](_0x5c4f('0x53'),_['map'](_0x23595f,'id'));}});}})[_0x5c4f('0x18')](function(){if(_0x1e5a35['user'][_0x5c4f('0x6c')]===_0x5c4f('0x6f')&&!_0x193a1e&&!_0x1e5a35[_0x5c4f('0x2a')][_0x5c4f('0x52')])return[];return db[_0x5c4f('0x70')][_0x5c4f('0x2a')](_0x1422bd[_0x5c4f('0x71')](),_0x48eeec);})[_0x5c4f('0x18')](function(_0x53f49f){_0x1fd735[_0x5c4f('0x14')]=_0x53f49f[_0x5c4f('0x20')];if(_0x1fd735[_0x5c4f('0x14')]===0x0)return[];return db[_0x5c4f('0x70')][_0x5c4f('0x2a')](_0x24cb68['toString'](),_0x48eeec)[_0x5c4f('0x18')](function(_0x2754cb){_0x418db8=_[_0x5c4f('0x72')](_0x2754cb,'id');_0x48eeec=_[_0x5c4f('0x73')](_0x48eeec,{'model':db[_0x5c4f('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e5a35['query'][_0x5c4f('0x2e')]){_0x241ae4[_0x5c4f('0x2f')]['forEach'](function(_0x552ddf){_0xc6bec1[_0x5c4f('0x34')]('c.'+_0x552ddf);});}else{_0xc6bec1[_0x5c4f('0x34')](_0x5c4f('0x63'));_0xc6bec1[_0x5c4f('0x34')](_0x5c4f('0x74'));_0xc6bec1[_0x5c4f('0x34')](_0x5c4f('0x75'));_0xc6bec1[_0x5c4f('0x34')]('c.phone');_0xc6bec1['field'](_0x5c4f('0x76'));_0xc6bec1['field'](_0x5c4f('0x77'));_0xc6bec1['field'](_0x5c4f('0x78'));_0xc6bec1[_0x5c4f('0x34')](_0x5c4f('0x79'));_0xc6bec1['field'](_0x5c4f('0x7a'));_0xc6bec1['field']('c.deletedAt');_0xc6bec1[_0x5c4f('0x34')](_0x5c4f('0x7b'));_0xc6bec1['field'](_0x5c4f('0x7c'),_0x5c4f('0x7d'));}if(_0x241ae4[_0x5c4f('0x13')])_0xc6bec1['limit'](_0x241ae4[_0x5c4f('0x13')]);if(_0x241ae4[_0x5c4f('0x11')])_0xc6bec1[_0x5c4f('0x11')](_0x241ae4[_0x5c4f('0x11')]);return db[_0x5c4f('0x70')]['query'](_0xc6bec1[_0x5c4f('0x71')](),_0x48eeec);});})['then'](function(_0x2115d4){_0x2115d4[_0x5c4f('0x51')](function(_0x49cb79){if(_0x49cb79[_0x5c4f('0x7d')]){_0x49cb79['Tags']=[];_0x49cb79[_0x5c4f('0x7d')][_0x5c4f('0x43')](',')[_0x5c4f('0x51')](function(_0x475fad){_0x49cb79[_0x5c4f('0x7e')]['push'](_0x418db8[_0x475fad]);});}delete _0x49cb79[_0x5c4f('0x7d')];});_0x1fd735[_0x5c4f('0x7f')]=_0x2115d4;return _0x1fd735;})[_0x5c4f('0x18')](respondWithFilteredResult(_0x532cb2,_0x241ae4));})['catch'](handleError(_0x532cb2,null));};exports[_0x5c4f('0x17')]=function(_0x14bb85,_0x43b3df){return db[_0x5c4f('0x1f')][_0x5c4f('0x41')]({'where':{'id':_0x14bb85['params']['id']}})['then'](handleEntityNotFound(_0x43b3df,null))[_0x5c4f('0x18')](removeEntity(_0x43b3df,null))[_0x5c4f('0x80')](handleError(_0x43b3df,null));};exports[_0x5c4f('0x81')]=function(_0x1b79db,_0x1aa569){return db[_0x5c4f('0x1f')][_0x5c4f('0x81')]()[_0x5c4f('0x18')](function(_0x2da761){delete _0x2da761[_0x5c4f('0x82')];for(var _0x47dc66=0x0;_0x47dc66<Object[_0x5c4f('0x21')](_0x2da761)[_0x5c4f('0x20')];_0x47dc66++){var _0x31d0c1=Object[_0x5c4f('0x21')](_0x2da761)[_0x47dc66];if(!_[_0x5c4f('0x22')](_0x31d0c1,'cf_')){_0x2da761[_0x31d0c1][_0x5c4f('0x83')]=_0x31d0c1;_0x2da761[_0x31d0c1]['displayName']=_0x31d0c1;}}return _0x2da761;})[_0x5c4f('0x18')](function(_0x4f0933){var _0x39dcaa={'where':Boolean(_0x1b79db[_0x5c4f('0x2a')][_0x5c4f('0x84')])===!![]?undefined:{'$or':[{'ListId':_0x1b79db[_0x5c4f('0x2a')]['id']},{'ListId':null}]},'raw':!![]};return db['CmCustomField'][_0x5c4f('0x85')](_0x39dcaa)['then'](function(_0x22ebed){for(var _0x1e82bd=0x0;_0x1e82bd<_0x22ebed['length'];_0x1e82bd++){var _0x41df43='cf_'+_0x22ebed[_0x1e82bd]['id'];_0x4f0933[_0x41df43][_0x5c4f('0x83')]=_0x41df43;_0x4f0933[_0x41df43][_0x5c4f('0x86')]=_0x22ebed[_0x1e82bd][_0x5c4f('0x87')];_0x4f0933[_0x41df43]['custom']={'type':_0x22ebed[_0x1e82bd]['type'],'values':_0x22ebed[_0x1e82bd][_0x5c4f('0x88')]};}Object[_0x5c4f('0x21')](_0x4f0933)[_0x5c4f('0x51')](function(_0x172d4a){if(!_0x4f0933[_0x172d4a]['hasOwnProperty'](_0x5c4f('0x83'))){delete _0x4f0933[_0x172d4a];}});return _0x4f0933;});})[_0x5c4f('0x18')](respondWithResult(_0x1aa569,null))[_0x5c4f('0x80')](handleError(_0x1aa569,null));};exports[_0x5c4f('0x73')]=function(_0x24d5cf,_0x241757){var _0x49e1e0;var _0x2ad3db;var _0x564114;if(_0x24d5cf[_0x5c4f('0x89')]['id']){delete _0x24d5cf[_0x5c4f('0x89')]['id'];}return db['CmContact'][_0x5c4f('0x85')]({'where':{'id':[_0x24d5cf[_0x5c4f('0x89')]['to'],_0x24d5cf[_0x5c4f('0x89')][_0x5c4f('0x8a')]]}})[_0x5c4f('0x18')](function(_0x205252){if(_0x205252){if(_0x205252['length']!==0x2){return null;}_0x205252[0x0]=_0x205252[0x0]['get']({'plain':!![]});_0x205252[0x1]=_0x205252[0x1][_0x5c4f('0x8b')]({'plain':!![]});delete _0x205252[0x0]['id'];delete _0x205252[0x1]['id'];return _[_0x5c4f('0x8c')](_0x205252[0x0],_0x205252[0x1],function(_0x1b51a6,_0x2c7836){if(Array['isArray'](_0x2c7836)&&!_0x2c7836['length']){return _0x1b51a6;}else if(!_0x2c7836){return _0x1b51a6;}});}})[_0x5c4f('0x18')](handleEntityNotFound(_0x241757,null))[_0x5c4f('0x18')](function(_0x56fd37){if(_0x56fd37){if(_0x56fd37[_0x5c4f('0x82')]&&_[_0x5c4f('0x56')](_0x56fd37[_0x5c4f('0x82')])){_0x56fd37['tags']=_0x56fd37['tags'][_0x5c4f('0x8d')]();}logger['info'](_0x5c4f('0x8e'),_0x24d5cf[_0x5c4f('0x89')]['to'],_0x24d5cf['body']['from']);return db[_0x5c4f('0x8f')][_0x5c4f('0x17')]({'where':{'ContactId':[_0x24d5cf[_0x5c4f('0x89')]['to'],_0x24d5cf[_0x5c4f('0x89')]['from']]}})[_0x5c4f('0x18')](function(_0x2a1df9){logger[_0x5c4f('0x90')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x2a1df9);return db[_0x5c4f('0x91')][_0x5c4f('0x17')]({'where':{'ContactId':[_0x24d5cf[_0x5c4f('0x89')]['to'],_0x24d5cf[_0x5c4f('0x89')]['from']]}})[_0x5c4f('0x18')](function(_0x17bf03){logger[_0x5c4f('0x90')](_0x5c4f('0x92'),_0x17bf03);return db['CmContact'][_0x5c4f('0x93')](_0x56fd37);});});}})[_0x5c4f('0x18')](function(_0x249a09){if(_0x249a09){_0x49e1e0=_0x249a09;_0x2ad3db={'ContactId':_0x49e1e0['id']};_0x564114={'where':{'ContactId':[_0x24d5cf[_0x5c4f('0x89')]['to'],_0x24d5cf[_0x5c4f('0x89')][_0x5c4f('0x8a')]]}};return db[_0x5c4f('0x94')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0x96')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db['ChatOfflineMessage'][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})['then'](function(){if(_0x49e1e0){return db[_0x5c4f('0x97')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db['MailMessage'][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0x97')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0x98')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0x99')]['update'](_0x2ad3db,_0x564114);}})['then'](function(){if(_0x49e1e0){return db['SmsMessage'][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0x9a')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0x9b')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db['OpenchannelInteraction'][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db['OpenchannelMessage'][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db['CmHopperFinal'][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0x9c')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})['then'](function(){if(_0x49e1e0){return db[_0x5c4f('0x9d')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0x9e')]['update'](_0x2ad3db,_0x564114);}})['then'](function(){if(_0x49e1e0){return db[_0x5c4f('0x9f')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0xa0')]['update'](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0xa1')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})['then'](function(){if(_0x49e1e0){return db['OpenchannelQueueReport'][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0xa2')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db['JscriptySessionReport'][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0xa3')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})['then'](function(){if(_0x49e1e0){return db[_0x5c4f('0xa4')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db[_0x5c4f('0xa5')][_0x5c4f('0x95')](_0x2ad3db,_0x564114);}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return db['CmContact'][_0x5c4f('0x17')]({'where':{'id':[_0x24d5cf[_0x5c4f('0x89')]['to'],_0x24d5cf['body'][_0x5c4f('0x8a')]]}});}})[_0x5c4f('0x18')](function(){if(_0x49e1e0){return _0x49e1e0;}})[_0x5c4f('0x18')](respondWithResult(_0x241757,null))[_0x5c4f('0x80')](handleError(_0x241757,null));};exports[_0x5c4f('0x93')]=function(_0x5b82be,_0x25f5f6){return db[_0x5c4f('0x1f')][_0x5c4f('0x81')]()[_0x5c4f('0x18')](function(_0x2231a4){if(_0x5b82be[_0x5c4f('0x89')][_0x5c4f('0x82')]&&_[_0x5c4f('0x56')](_0x5b82be['body']['tags'])){if(_0x5b82be[_0x5c4f('0x89')][_0x5c4f('0x82')][_0x5c4f('0x20')]){_0x5b82be[_0x5c4f('0x89')][_0x5c4f('0x82')]=_0x5b82be[_0x5c4f('0x89')][_0x5c4f('0x82')][_0x5c4f('0x8d')](';')+';';}else{_0x5b82be['body'][_0x5c4f('0x82')]=null;}}else{_0x5b82be[_0x5c4f('0x89')][_0x5c4f('0x82')]=null;}if(!_[_0x5c4f('0x4d')](_0x5b82be[_0x5c4f('0x89')][_0x5c4f('0xa6')])){var _0x20b2b6=_0x5b82be[_0x5c4f('0x89')][_0x5c4f('0xa6')];if(!_['isNil'](shared[_0x5c4f('0xa7')][_0x20b2b6]))_0x5b82be[_0x5c4f('0x89')][_0x5c4f('0xa8')]=shared[_0x5c4f('0xa7')][_0x20b2b6][_0x5c4f('0xa8')];}return db[_0x5c4f('0x1f')]['create'](_0x5b82be[_0x5c4f('0x89')],{'fields':_['keys'](_0x2231a4),'raw':!![]});})[_0x5c4f('0x18')](respondWithResult(_0x25f5f6,0xc9))[_0x5c4f('0x80')](handleError(_0x25f5f6,null));};exports[_0x5c4f('0xa9')]=function(_0x69a89a,_0x48f0a8){var _0x4c57ef=0x0;var _0x41df3b=0x0;var _0x3ea86c=0x0;return db[_0x5c4f('0x1f')][_0x5c4f('0x81')]()[_0x5c4f('0x18')](function(_0x155c67){return BPromise['each'](_0x69a89a['body'],function(_0x235637){var _0x5d60cd={'where':{'$or':[]},'defaults':_0x235637,'fields':_[_0x5c4f('0x21')](_0x155c67),'raw':!![]};if(_0x235637[_0x5c4f('0xaa')]){for(var _0x4e2825=0x0;_0x4e2825<_0x235637[_0x5c4f('0xaa')]['length'];_0x4e2825++){var _0x4bf709={};_0x4bf709[_0x235637[_0x5c4f('0xaa')][_0x4e2825]]=_0x235637[_0x235637[_0x5c4f('0xaa')][_0x4e2825]];_0x5d60cd[_0x5c4f('0x32')][_0x5c4f('0xab')][_0x5c4f('0x4e')](_0x4bf709);}_0x5d60cd['where'][_0x5c4f('0x52')]=_0x235637[_0x5c4f('0x52')];}return db[_0x5c4f('0x1f')][_0x5c4f('0xac')](_0x5d60cd)[_0x5c4f('0xad')](function(_0x2fd0ad,_0x42fa30){if(_0x42fa30){_0x4c57ef++;}else{_0x3ea86c++;}})[_0x5c4f('0x80')](function(){_0x41df3b++;});});})[_0x5c4f('0x18')](function(_0xb21482){if(_0xb21482){return{'success':_0x4c57ef,'failure':_0x41df3b,'duplicates':_0x3ea86c};}})[_0x5c4f('0x18')](respondWithResult(_0x48f0a8,0xc9))[_0x5c4f('0x80')](handleError(_0x48f0a8,null));};exports[_0x5c4f('0xae')]=function(_0x41d1ae,_0x17901e){var _0x5d611c;return db[_0x5c4f('0x1f')][_0x5c4f('0x81')]()[_0x5c4f('0x18')](function(_0x49c772){return db[_0x5c4f('0x1f')][_0x5c4f('0x41')]({'where':{'id':_0x41d1ae[_0x5c4f('0xaf')]['id']},'include':[{'model':db[_0x5c4f('0x42')],'as':_0x5c4f('0x7e'),'attributes':['id','name',_0x5c4f('0x35')],'required':_0x41d1ae['query'][_0x5c4f('0x57')]?!![]:![]}],'attributes':_[_0x5c4f('0x21')](_0x49c772)});})[_0x5c4f('0x18')](function(_0x44be22){if(!_[_0x5c4f('0x4d')](_0x44be22)){_0x5d611c=_0x44be22[_0x5c4f('0x8b')]({'plain':!![]});var _0x22d2c1={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x44be22&&_0x44be22['ListId']){if(_0x44be22[_0x5c4f('0x52')]){_0x22d2c1[_0x5c4f('0x32')]['$and'][_0x5c4f('0x4e')]({'ListId':{'$ne':_0x44be22[_0x5c4f('0x52')]}});}}return db[_0x5c4f('0x24')][_0x5c4f('0x85')](_0x22d2c1);}})['then'](function(_0x50f1d7){if(!_[_0x5c4f('0x4d')](_0x50f1d7)){return _['omit'](_0x5d611c,_['map'](_0x50f1d7,function(_0x1fc4e5){return util[_0x5c4f('0xb0')](_0x5c4f('0xb1'),_0x1fc4e5['id']);}));}})[_0x5c4f('0x18')](handleEntityNotFound(_0x17901e,null))[_0x5c4f('0x18')](respondWithResult(_0x17901e,null))[_0x5c4f('0x80')](handleError(_0x17901e,null));};exports[_0x5c4f('0x95')]=function(_0x3a8a4c,_0x508fe7){var _0x105875;if(_0x3a8a4c['body']['id']){delete _0x3a8a4c['body']['id'];}if(!_[_0x5c4f('0x4d')](_0x3a8a4c[_0x5c4f('0x89')][_0x5c4f('0xa6')])){var _0x56de1a=_0x3a8a4c['body']['dialTimezone'];if(!_[_0x5c4f('0x4d')](shared[_0x5c4f('0xa7')][_0x56de1a]))_0x3a8a4c[_0x5c4f('0x89')]['utcOffset']=shared[_0x5c4f('0xa7')][_0x56de1a]['utcOffset'];}return db[_0x5c4f('0x1f')]['find']({'where':{'id':_0x3a8a4c[_0x5c4f('0xaf')]['id']}})[_0x5c4f('0x18')](handleEntityNotFound(_0x508fe7,null))[_0x5c4f('0x18')](saveUpdates(_0x3a8a4c['body'],null))[_0x5c4f('0x18')](function(_0x9f57df){_0x105875=_0x9f57df;var _0x494e21={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x9f57df&&_0x9f57df[_0x5c4f('0x52')]){if(_0x9f57df['ListId']){_0x494e21[_0x5c4f('0x32')][_0x5c4f('0xb2')][_0x5c4f('0x4e')]({'ListId':{'$ne':_0x9f57df[_0x5c4f('0x52')]}});}}return db['CmCustomField'][_0x5c4f('0x85')](_0x494e21);})[_0x5c4f('0x18')](function(_0x45f1ed){if(_0x45f1ed){return _[_0x5c4f('0xb3')](_[_0x5c4f('0xb4')](_0x3a8a4c[_0x5c4f('0x89')],function(_0x4da561,_0x5cc8f3){return _[_0x5c4f('0x22')](_0x5cc8f3,_0x5c4f('0x23'));}),_[_0x5c4f('0x4a')](_0x45f1ed,function(_0x3fcb92){return util[_0x5c4f('0xb0')](_0x5c4f('0xb1'),_0x3fcb92['id']);}));}})[_0x5c4f('0x18')](function(_0x27f024){if(_0x27f024&&!_['isEmpty'](_0x27f024)){var _0x50be33=squel[_0x5c4f('0x95')]()['table'](_0x5c4f('0x37'))[_0x5c4f('0xb5')](_0x27f024)[_0x5c4f('0x32')](_0x5c4f('0xb6'),_0x3a8a4c[_0x5c4f('0xaf')]['id'])[_0x5c4f('0xb7')]();return db[_0x5c4f('0x70')][_0x5c4f('0x2a')](_0x50be33['text'],{'replacements':_0x50be33['values']});}})[_0x5c4f('0x18')](function(){if(_0x3a8a4c[_0x5c4f('0x89')][_0x5c4f('0xb8')]&&_0x105875){return db['CmHopper'][_0x5c4f('0x95')]({'phone':_0x3a8a4c['body']['phone']},{'where':{'ContactId':_0x105875['id']}});}})[_0x5c4f('0x18')](function(){return _0x105875;})[_0x5c4f('0x18')](respondWithResult(_0x508fe7,null))[_0x5c4f('0x80')](handleError(_0x508fe7,null));};exports[_0x5c4f('0xb9')]=function(_0xb013f4,_0x41199e){var _0x2e8258={};var _0x470312={};var _0xb42f8;var _0x4a5dee;return db[_0x5c4f('0x1f')][_0x5c4f('0x25')]({'where':{'id':_0xb013f4[_0x5c4f('0xaf')]['id']}})[_0x5c4f('0x18')](handleEntityNotFound(_0x41199e,null))[_0x5c4f('0x18')](function(_0x1944ee){if(_0x1944ee){_0xb42f8=_0x1944ee;_0x470312[_0x5c4f('0x2d')]=_['keys'](db['Tag'][_0x5c4f('0xba')]);_0x470312[_0x5c4f('0x2a')]=_[_0x5c4f('0x21')](_0xb013f4[_0x5c4f('0x2a')]);_0x470312['filters']=_[_0x5c4f('0x2c')](_0x470312[_0x5c4f('0x2d')],_0x470312['query']);_0x2e8258['attributes']=_[_0x5c4f('0x2c')](_0x470312[_0x5c4f('0x2d')],qs[_0x5c4f('0x2e')](_0xb013f4[_0x5c4f('0x2a')][_0x5c4f('0x2e')]));_0x2e8258[_0x5c4f('0x2f')]=_0x2e8258[_0x5c4f('0x2f')]['length']?_0x2e8258[_0x5c4f('0x2f')]:_0x470312[_0x5c4f('0x2d')];_0x2e8258['order']=qs['sort'](_0xb013f4[_0x5c4f('0x2a')][_0x5c4f('0x31')]);_0x2e8258[_0x5c4f('0x32')]=qs[_0x5c4f('0x2b')](_[_0x5c4f('0xbb')](_0xb013f4[_0x5c4f('0x2a')],_0x470312[_0x5c4f('0x2b')]));if(_0xb013f4[_0x5c4f('0x2a')][_0x5c4f('0x4c')]){_0x2e8258[_0x5c4f('0x32')]=_[_0x5c4f('0x73')](_0x2e8258[_0x5c4f('0x32')],{'$or':_['map'](_0x2e8258[_0x5c4f('0x2f')],function(_0x5a2e2a){var _0x5e95fa={};_0x5e95fa[_0x5a2e2a]={'$like':'%'+_0xb013f4[_0x5c4f('0x2a')]['filter']+'%'};return _0x5e95fa;})});}_0x2e8258=_['merge']({},_0x2e8258,_0xb013f4[_0x5c4f('0xbc')]);return _0xb42f8['getTags'](_0x2e8258);}})[_0x5c4f('0x18')](function(_0x5e7269){if(_0x5e7269){_0x4a5dee=_0x5e7269[_0x5c4f('0x20')];if(!_0xb013f4[_0x5c4f('0x2a')][_0x5c4f('0x4b')]('nolimit')){_0x2e8258[_0x5c4f('0x13')]=qs[_0x5c4f('0x13')](_0xb013f4[_0x5c4f('0x2a')][_0x5c4f('0x13')]);_0x2e8258['offset']=qs[_0x5c4f('0x11')](_0xb013f4[_0x5c4f('0x2a')][_0x5c4f('0x11')]);}return _0xb42f8[_0x5c4f('0xb9')](_0x2e8258);}})[_0x5c4f('0x18')](function(_0x351775){if(_0x351775){return _0x351775?{'count':_0x4a5dee,'rows':_0x351775}:null;}})[_0x5c4f('0x18')](respondWithResult(_0x41199e,null))[_0x5c4f('0x80')](handleError(_0x41199e,null));};exports[_0x5c4f('0xbd')]=function(_0x24e119,_0xc4a573){if(_0x24e119[_0x5c4f('0x89')]['id']){delete _0x24e119[_0x5c4f('0x89')]['id'];}return db['CmContact'][_0x5c4f('0x25')]({'where':{'id':_0x24e119['params']['id']}})['then'](handleEntityNotFound(_0xc4a573,null))[_0x5c4f('0x18')](function(_0x4081b4){if(_0x4081b4){return _0x4081b4[_0x5c4f('0xbd')](_0x24e119[_0x5c4f('0x89')][_0x5c4f('0xbe')]||[]);}return null;})[_0x5c4f('0x18')](respondWithResult(_0xc4a573,null))[_0x5c4f('0x80')](handleError(_0xc4a573,null));};exports['getHoppers']=function(_0x2319eb,_0x57d130){var _0x19beb2={'raw':![],'where':{}};var _0x58c058={};var _0xbad30d={'count':0x0,'rows':[]};return db[_0x5c4f('0x1f')]['findOne']({'where':{'id':_0x2319eb[_0x5c4f('0xaf')]['id']}})['then'](handleEntityNotFound(_0x57d130,null))[_0x5c4f('0x18')](function(_0x22fe52){if(_0x22fe52){_0x58c058[_0x5c4f('0x2d')]=_[_0x5c4f('0x21')](db[_0x5c4f('0x8f')][_0x5c4f('0xba')]);_0x58c058[_0x5c4f('0x2a')]=_[_0x5c4f('0x21')](_0x2319eb[_0x5c4f('0x2a')]);_0x58c058[_0x5c4f('0x2b')]=_[_0x5c4f('0x2c')](_0x58c058[_0x5c4f('0x2d')],_0x58c058[_0x5c4f('0x2a')]);_0x19beb2[_0x5c4f('0x2f')]=_[_0x5c4f('0x2c')](_0x58c058[_0x5c4f('0x2d')],qs['fields'](_0x2319eb[_0x5c4f('0x2a')][_0x5c4f('0x2e')]));_0x19beb2['attributes']=_0x19beb2[_0x5c4f('0x2f')][_0x5c4f('0x20')]?_0x19beb2[_0x5c4f('0x2f')]:_0x58c058[_0x5c4f('0x2d')];if(!_0x2319eb[_0x5c4f('0x2a')]['hasOwnProperty']('nolimit')){_0x19beb2[_0x5c4f('0x13')]=qs[_0x5c4f('0x13')](_0x2319eb[_0x5c4f('0x2a')][_0x5c4f('0x13')]);_0x19beb2[_0x5c4f('0x11')]=qs[_0x5c4f('0x11')](_0x2319eb[_0x5c4f('0x2a')]['offset']);}_0x19beb2[_0x5c4f('0x30')]=qs['sort'](_0x2319eb[_0x5c4f('0x2a')]['sort']);_0x19beb2[_0x5c4f('0x32')]=qs[_0x5c4f('0x2b')](_[_0x5c4f('0xbb')](_0x2319eb['query'],_0x58c058[_0x5c4f('0x2b')]));_0x19beb2[_0x5c4f('0x32')][_0x5c4f('0xbf')]=_0x22fe52['id'];if(_0x2319eb[_0x5c4f('0x2a')][_0x5c4f('0x4c')]){_0x19beb2['where']=_[_0x5c4f('0x73')](_0x19beb2['where'],{'$or':_[_0x5c4f('0x4a')](_0x19beb2['attributes'],function(_0x5da382){var _0x5c351d={};_0x5c351d[_0x5da382]={'$like':'%'+_0x2319eb['query']['filter']+'%'};return _0x5c351d;})});}_0x19beb2=_[_0x5c4f('0x73')]({},_0x19beb2,_0x2319eb[_0x5c4f('0xbc')]);return db['CmHopper'][_0x5c4f('0x14')]({'where':_0x19beb2[_0x5c4f('0x32')]})[_0x5c4f('0x18')](function(_0x1bf530){_0xbad30d[_0x5c4f('0x14')]=_0x1bf530;if(_0x2319eb[_0x5c4f('0x2a')][_0x5c4f('0xc0')]){_0x19beb2[_0x5c4f('0xc1')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x19beb2);})[_0x5c4f('0x18')](function(_0x3c4c09){_0xbad30d[_0x5c4f('0x7f')]=_0x3c4c09;return _0xbad30d;});}})[_0x5c4f('0x18')](respondWithFilteredResult(_0x57d130,_0x19beb2))[_0x5c4f('0x80')](handleError(_0x57d130,null));};exports['getHopperHistories']=function(_0x519975,_0x22330c){var _0x51ee1c={'raw':!![],'where':{}};var _0x2d7375={};var _0x2c1424={'count':0x0,'rows':[]};return db[_0x5c4f('0x1f')]['findOne']({'where':{'id':_0x519975[_0x5c4f('0xaf')]['id']}})[_0x5c4f('0x18')](handleEntityNotFound(_0x22330c,null))[_0x5c4f('0x18')](function(_0x52267c){if(_0x52267c){_0x2d7375[_0x5c4f('0x2d')]=_[_0x5c4f('0x21')](db['CmHopperHistory'][_0x5c4f('0xba')]);_0x2d7375[_0x5c4f('0x2a')]=_[_0x5c4f('0x21')](_0x519975[_0x5c4f('0x2a')]);_0x2d7375[_0x5c4f('0x2b')]=_[_0x5c4f('0x2c')](_0x2d7375[_0x5c4f('0x2d')],_0x2d7375[_0x5c4f('0x2a')]);_0x51ee1c[_0x5c4f('0x2f')]=_[_0x5c4f('0x2c')](_0x2d7375[_0x5c4f('0x2d')],qs[_0x5c4f('0x2e')](_0x519975[_0x5c4f('0x2a')][_0x5c4f('0x2e')]));_0x51ee1c[_0x5c4f('0x2f')]=_0x51ee1c[_0x5c4f('0x2f')][_0x5c4f('0x20')]?_0x51ee1c[_0x5c4f('0x2f')]:_0x2d7375[_0x5c4f('0x2d')];if(!_0x519975[_0x5c4f('0x2a')]['hasOwnProperty'](_0x5c4f('0xc2'))){_0x51ee1c[_0x5c4f('0x13')]=qs[_0x5c4f('0x13')](_0x519975[_0x5c4f('0x2a')][_0x5c4f('0x13')]);_0x51ee1c[_0x5c4f('0x11')]=qs[_0x5c4f('0x11')](_0x519975[_0x5c4f('0x2a')]['offset']);}_0x51ee1c[_0x5c4f('0x30')]=qs[_0x5c4f('0x31')](_0x519975[_0x5c4f('0x2a')][_0x5c4f('0x31')]);_0x51ee1c[_0x5c4f('0x32')]=qs[_0x5c4f('0x2b')](_[_0x5c4f('0xbb')](_0x519975['query'],_0x2d7375[_0x5c4f('0x2b')]));_0x51ee1c[_0x5c4f('0x32')][_0x5c4f('0xbf')]=_0x52267c['id'];if(_0x519975[_0x5c4f('0x2a')]['filter']){_0x51ee1c[_0x5c4f('0x32')]=_[_0x5c4f('0x73')](_0x51ee1c[_0x5c4f('0x32')],{'$or':_[_0x5c4f('0x4a')](_0x51ee1c[_0x5c4f('0x2f')],function(_0xaa346){var _0x50b22f={};_0x50b22f[_0xaa346]={'$like':'%'+_0x519975['query'][_0x5c4f('0x4c')]+'%'};return _0x50b22f;})});}_0x51ee1c=_[_0x5c4f('0x73')]({},_0x51ee1c,_0x519975['options']);return db[_0x5c4f('0x9c')][_0x5c4f('0x14')]({'where':_0x51ee1c[_0x5c4f('0x32')]})[_0x5c4f('0x18')](function(_0x2522f8){_0x2c1424[_0x5c4f('0x14')]=_0x2522f8;if(_0x519975['query']['includeAll']){_0x51ee1c[_0x5c4f('0xc1')]=[{'all':!![]}];}return db[_0x5c4f('0x9c')]['findAll'](_0x51ee1c);})[_0x5c4f('0x18')](function(_0x5cce22){_0x2c1424[_0x5c4f('0x7f')]=_0x5cce22;return _0x2c1424;});}})[_0x5c4f('0x18')](respondWithFilteredResult(_0x22330c,_0x51ee1c))[_0x5c4f('0x80')](handleError(_0x22330c,null));};exports[_0x5c4f('0xc3')]=function(_0x56a6fe,_0x5e5afe){var _0xa82a6e={'raw':!![],'where':{}};var _0x131607={};var _0x463d21={'count':0x0,'rows':[]};return db[_0x5c4f('0x1f')]['findOne']({'where':{'id':_0x56a6fe['params']['id']}})[_0x5c4f('0x18')](handleEntityNotFound(_0x5e5afe,null))[_0x5c4f('0x18')](function(_0x21057b){if(_0x21057b){_0x131607['model']=_['keys'](db[_0x5c4f('0xc4')][_0x5c4f('0xba')]);_0x131607[_0x5c4f('0x2a')]=_[_0x5c4f('0x21')](_0x56a6fe[_0x5c4f('0x2a')]);_0x131607[_0x5c4f('0x2b')]=_['intersection'](_0x131607[_0x5c4f('0x2d')],_0x131607[_0x5c4f('0x2a')]);_0xa82a6e[_0x5c4f('0x2f')]=_[_0x5c4f('0x2c')](_0x131607[_0x5c4f('0x2d')],qs[_0x5c4f('0x2e')](_0x56a6fe[_0x5c4f('0x2a')][_0x5c4f('0x2e')]));_0xa82a6e[_0x5c4f('0x2f')]=_0xa82a6e[_0x5c4f('0x2f')][_0x5c4f('0x20')]?_0xa82a6e[_0x5c4f('0x2f')]:_0x131607[_0x5c4f('0x2d')];if(!_0x56a6fe[_0x5c4f('0x2a')][_0x5c4f('0x4b')](_0x5c4f('0xc2'))){_0xa82a6e[_0x5c4f('0x13')]=qs[_0x5c4f('0x13')](_0x56a6fe[_0x5c4f('0x2a')][_0x5c4f('0x13')]);_0xa82a6e['offset']=qs[_0x5c4f('0x11')](_0x56a6fe['query'][_0x5c4f('0x11')]);}_0xa82a6e[_0x5c4f('0x30')]=qs[_0x5c4f('0x31')](_0x56a6fe[_0x5c4f('0x2a')]['sort']);_0xa82a6e['where']=qs[_0x5c4f('0x2b')](_[_0x5c4f('0xbb')](_0x56a6fe[_0x5c4f('0x2a')],_0x131607[_0x5c4f('0x2b')]));_0xa82a6e[_0x5c4f('0x32')][_0x5c4f('0xbf')]=_0x21057b['id'];if(_0x56a6fe['query'][_0x5c4f('0x4c')]){_0xa82a6e[_0x5c4f('0x32')]=_['merge'](_0xa82a6e['where'],{'$or':_['map'](_0xa82a6e['attributes'],function(_0x92ef99){var _0x26e702={};_0x26e702[_0x92ef99]={'$like':'%'+_0x56a6fe[_0x5c4f('0x2a')][_0x5c4f('0x4c')]+'%'};return _0x26e702;})});}_0xa82a6e=_['merge']({},_0xa82a6e,_0x56a6fe[_0x5c4f('0xbc')]);return db[_0x5c4f('0xc4')]['count']({'where':_0xa82a6e[_0x5c4f('0x32')]})['then'](function(_0x9fb69e){_0x463d21[_0x5c4f('0x14')]=_0x9fb69e;if(_0x56a6fe[_0x5c4f('0x2a')][_0x5c4f('0xc0')]){_0xa82a6e[_0x5c4f('0xc1')]=[{'all':!![]}];}return db[_0x5c4f('0xc4')]['findAll'](_0xa82a6e);})[_0x5c4f('0x18')](function(_0x81c9cf){_0x463d21[_0x5c4f('0x7f')]=_0x81c9cf;return _0x463d21;});}})[_0x5c4f('0x18')](respondWithFilteredResult(_0x5e5afe,_0xa82a6e))['catch'](handleError(_0x5e5afe,null));};exports['getJscriptySessions']=function(_0xd34363,_0x523f47){var _0x439972={'raw':!![],'where':{}};var _0x4b3000={};var _0x42e365={'count':0x0,'rows':[]};return db[_0x5c4f('0x1f')]['findOne']({'where':{'id':_0xd34363[_0x5c4f('0xaf')]['id']}})[_0x5c4f('0x18')](handleEntityNotFound(_0x523f47,null))[_0x5c4f('0x18')](function(_0x5006f0){if(_0x5006f0){_0x4b3000[_0x5c4f('0x2d')]=_[_0x5c4f('0x21')](db[_0x5c4f('0xc5')][_0x5c4f('0xba')]);_0x4b3000[_0x5c4f('0x2a')]=_[_0x5c4f('0x21')](_0xd34363['query']);_0x4b3000['filters']=_[_0x5c4f('0x2c')](_0x4b3000['model'],_0x4b3000['query']);_0x439972[_0x5c4f('0x2f')]=_[_0x5c4f('0x2c')](_0x4b3000[_0x5c4f('0x2d')],qs[_0x5c4f('0x2e')](_0xd34363[_0x5c4f('0x2a')]['fields']));_0x439972[_0x5c4f('0x2f')]=_0x439972['attributes'][_0x5c4f('0x20')]?_0x439972[_0x5c4f('0x2f')]:_0x4b3000[_0x5c4f('0x2d')];if(!_0xd34363[_0x5c4f('0x2a')][_0x5c4f('0x4b')](_0x5c4f('0xc2'))){_0x439972[_0x5c4f('0x13')]=qs[_0x5c4f('0x13')](_0xd34363[_0x5c4f('0x2a')][_0x5c4f('0x13')]);_0x439972[_0x5c4f('0x11')]=qs['offset'](_0xd34363[_0x5c4f('0x2a')][_0x5c4f('0x11')]);}_0x439972[_0x5c4f('0x30')]=qs['sort'](_0xd34363[_0x5c4f('0x2a')]['sort']);_0x439972[_0x5c4f('0x32')]=qs[_0x5c4f('0x2b')](_[_0x5c4f('0xbb')](_0xd34363[_0x5c4f('0x2a')],_0x4b3000['filters']));_0x439972[_0x5c4f('0x32')][_0x5c4f('0xbf')]=_0x5006f0['id'];if(_0xd34363[_0x5c4f('0x2a')][_0x5c4f('0x4c')]){_0x439972['where']=_[_0x5c4f('0x73')](_0x439972[_0x5c4f('0x32')],{'$or':_[_0x5c4f('0x4a')](_0x439972[_0x5c4f('0x2f')],function(_0x471da7){var _0x48ec0f={};_0x48ec0f[_0x471da7]={'$like':'%'+_0xd34363[_0x5c4f('0x2a')][_0x5c4f('0x4c')]+'%'};return _0x48ec0f;})});}_0x439972=_[_0x5c4f('0x73')]({},_0x439972,_0xd34363['options']);return db[_0x5c4f('0xc5')]['count']({'where':_0x439972[_0x5c4f('0x32')]})[_0x5c4f('0x18')](function(_0x15deaf){_0x42e365[_0x5c4f('0x14')]=_0x15deaf;if(_0xd34363[_0x5c4f('0x2a')][_0x5c4f('0xc0')]){_0x439972[_0x5c4f('0xc1')]=[{'all':!![]}];}return db[_0x5c4f('0xc5')][_0x5c4f('0x85')](_0x439972);})[_0x5c4f('0x18')](function(_0x553dd8){_0x42e365[_0x5c4f('0x7f')]=_0x553dd8;return _0x42e365;});}})[_0x5c4f('0x18')](respondWithFilteredResult(_0x523f47,_0x439972))[_0x5c4f('0x80')](handleError(_0x523f47,null));};exports[_0x5c4f('0xc6')]=function(_0x35fc4d,_0x2f58c4){try{if(!_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0x52')]){throw new Error(_0x5c4f('0xc7'));}if(!_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0xc8')]){throw new Error(_0x5c4f('0xc9'));}if(!_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0xca')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x35fc4d['body']['socket_timestamp']){throw new Error(_0x5c4f('0xcb'));}var _0x342fdd=_0x35fc4d['body'][_0x5c4f('0xc8')]['split'](',');var _0x383622=_0x35fc4d['body']['binding_values'][_0x5c4f('0x43')](',');if(!_0x342fdd[_0x5c4f('0x20')]||!_0x383622[_0x5c4f('0x20')]||_0x342fdd['length']!==_0x383622[_0x5c4f('0x20')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0x2e')]=_['zipObject'](_0x342fdd,_0x383622);if(!_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0x2e')][_0x5c4f('0xb8')]){throw new Error(_0x5c4f('0xcc'));}if(!_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0x2e')][_0x5c4f('0xcd')]){throw new Error(_0x5c4f('0xce'));}var _0x23ff27=path[_0x5c4f('0x8d')](config[_0x5c4f('0xcf')],'server/files/tmp',_0x35fc4d[_0x5c4f('0xd0')][_0x5c4f('0xd1')]);fs[_0x5c4f('0xd2')](_0x23ff27,parseInt(_0x5c4f('0xd3'),0x8));var _0x3429bf=require(_0x5c4f('0xd4'))[_0x5c4f('0xd5')](path['join'](__dirname,_0x5c4f('0xd6')),[_0x23ff27,_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0xc8')],_0x35fc4d['body']['binding_values'],_0x35fc4d['body'][_0x5c4f('0x52')],_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0xd7')],_0x35fc4d[_0x5c4f('0x89')]['duplicates'],_0x35fc4d[_0x5c4f('0x89')][_0x5c4f('0xd8')]]);return _0x2f58c4['status'](0xc8)[_0x5c4f('0x10')]({'message':_0x5c4f('0xd9'),'pid':_0x3429bf['pid']});}catch(_0x4d5cd9){return _0x2f58c4['status'](0x1f4)['send'](_0x4d5cd9);}};exports['upload']=function(_0x867971,_0x1fbd9e){var _0x1dfd6e=fs['createReadStream'](_0x867971[_0x5c4f('0xd0')][_0x5c4f('0xda')]);Papa[_0x5c4f('0xdb')](_0x1dfd6e,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x8bdaeb){return _0x1fbd9e[_0x5c4f('0xf')](0xc8)[_0x5c4f('0x10')]({'file':_0x867971[_0x5c4f('0xd0')],'fields':_0x8bdaeb['meta'][_0x5c4f('0x2e')]});}});};exports[_0x5c4f('0xdc')]=function(_0x46980,_0x19ae01){return db[_0x5c4f('0x6d')][_0x5c4f('0x85')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x5c4f('0x18')](function(_0x44bd2c){var _0x1387a1=![];if(!_0x46980[_0x5c4f('0x89')][_0x5c4f('0x52')]){throw new Error(_0x5c4f('0xc7'));}if(!_0x46980[_0x5c4f('0x89')][_0x5c4f('0xdd')]['phone']){throw new Error(_0x5c4f('0xcc'));}if(!_0x46980[_0x5c4f('0x89')][_0x5c4f('0xdd')][_0x5c4f('0xcd')]){throw new Error(_0x5c4f('0xce'));}if(!_0x46980[_0x5c4f('0x89')][_0x5c4f('0xd8')]){throw new Error(_0x5c4f('0xcb'));}var _0xb57504=require(_0x5c4f('0xd4'))['fork'](path[_0x5c4f('0x8d')](__dirname,_0x5c4f('0xde')),[_0x46980['params']['id'],JSON[_0x5c4f('0xdf')](_0x46980['body']),JSON[_0x5c4f('0xdf')](_0x44bd2c)]);_0xb57504['on'](_0x5c4f('0xe0'),function(){_0x1387a1=!![];return _0x19ae01[_0x5c4f('0xf')](0xc8)[_0x5c4f('0x10')]({'message':_0x5c4f('0xe1'),'pid':_0xb57504[_0x5c4f('0xe2')]});});_0xb57504['on']('exit',function(_0x3692ec){if(_0x3692ec&&!_0x1387a1){return _0x19ae01['status'](0x1f4)[_0x5c4f('0x10')]({'message':_0x5c4f('0xe3'),'pid':_0xb57504['pid']});}});})[_0x5c4f('0x80')](handleError(_0x19ae01,null));};exports[_0x5c4f('0xe4')]=function(_0x253077,_0x11b274){var _0x47f848=[_0x5c4f('0xe5'),_0x5c4f('0xe6'),_0x5c4f('0xe7'),'openchannel','fax',_0x5c4f('0xe8'),_0x5c4f('0xe9')];var _0x57a40f={'offset':0x0,'order':qs[_0x5c4f('0x31')]('-createdAt')},_0x2fdbb4={'count':0x0,'rows':[]};Promise['resolve']()[_0x5c4f('0x18')](function(){if(_0x253077[_0x5c4f('0x2a')][_0x5c4f('0xea')]){if(!_['includes'](_0x47f848,_0x253077[_0x5c4f('0x2a')][_0x5c4f('0xea')]['toLowerCase']())){throw new Error(_0x5c4f('0xeb'));}_0x47f848=[_0x253077[_0x5c4f('0x2a')][_0x5c4f('0xea')][_0x5c4f('0xec')]()];}if(_0x253077[_0x5c4f('0x2a')][_0x5c4f('0xed')]){try{var _0x32bf91=JSON['parse'](_0x253077[_0x5c4f('0x2a')][_0x5c4f('0xed')]);if(!moment(_0x32bf91[_0x5c4f('0x8a')])[_0x5c4f('0xee')]()){throw new Error(_0x5c4f('0xef'));}if(!moment(_0x32bf91['to'])[_0x5c4f('0xee')]()){throw new Error(_0x5c4f('0xf0'));}}catch(_0x401bbb){throw new Error(_0x5c4f('0xf1'));}}if(!_0x253077[_0x5c4f('0x2a')]['hasOwnProperty'](_0x5c4f('0xc2'))){_0x57a40f['limit']=qs[_0x5c4f('0x13')](_0x253077[_0x5c4f('0x2a')][_0x5c4f('0x13')]||0xa);_0x57a40f['offset']=qs[_0x5c4f('0x11')](_0x253077['query'][_0x5c4f('0x11')]);}var _0x352362=_0x47f848['map'](function(_0x2aded4){if(_0x2aded4===_0x5c4f('0xe9')){var _0x11ea31={'attributes':['id',_0x5c4f('0xf2'),_0x5c4f('0x29'),_0x5c4f('0xf3'),_0x5c4f('0xf4'),'callerid',_0x5c4f('0xf5'),_0x5c4f('0xf6'),_0x5c4f('0xf7'),'note',_0x5c4f('0xf8'),_0x5c4f('0xf9'),_0x5c4f('0xfa'),_0x5c4f('0xfb'),_0x5c4f('0xfc')],'where':{'ContactId':_0x253077[_0x5c4f('0xaf')]['id']},'include':[{'model':db['User'],'as':_0x5c4f('0x6d'),'attributes':['id','name',_0x5c4f('0xfd'),_0x5c4f('0x87')]}],'order':[[_0x5c4f('0xf8'),_0x5c4f('0x67')]]};if(_0x253077[_0x5c4f('0x2a')]['range']){_0x11ea31[_0x5c4f('0x32')][_0x5c4f('0xf8')]={'$gte':_0x32bf91[_0x5c4f('0x8a')],'$lte':_0x32bf91['to']};}return db['VoiceCallReport'][_0x5c4f('0xfe')](_0x11ea31)[_0x5c4f('0x18')](function(_0x2c7659){_0x2fdbb4[_0x5c4f('0x14')]+=_0x2c7659[_0x5c4f('0x14')];return _[_0x5c4f('0x4a')](_0x2c7659[_0x5c4f('0x7f')],function(_0x4973dd){var _0x35ec0e=_0x4973dd[_0x5c4f('0x8b')]({'plain':!![]});_0x35ec0e['channel']=_0x2aded4;if(_0x35ec0e['User']){_0x35ec0e[_0x5c4f('0x6d')]={'id':_0x35ec0e[_0x5c4f('0x6d')]['id'],'name':_0x35ec0e['User'][_0x5c4f('0x1d')],'fullname':_0x35ec0e[_0x5c4f('0x6d')][_0x5c4f('0xfd')],'alias':_0x35ec0e[_0x5c4f('0x6d')][_0x5c4f('0x87')]};}return _0x35ec0e;});});}else{var _0x41fc6c=_[_0x5c4f('0xff')](_0x2aded4)+(_0x2aded4===_0x5c4f('0xe6')?'Website':_0x5c4f('0x100'));var _0xb781ab={'attributes':['id',_0x5c4f('0x101'),_0x5c4f('0x102'),_0x5c4f('0xf8'),_0x5c4f('0x103'),_0x5c4f('0x104'),_0x5c4f('0x105'),_0x5c4f('0x106'),_0x5c4f('0xfc'),_0x41fc6c+'Id'],'where':{'ContactId':_0x253077[_0x5c4f('0xaf')]['id']},'include':[{'model':db[_0x41fc6c],'as':_0x5c4f('0x100'),'attributes':['id',_0x5c4f('0x1d'),_0x5c4f('0x107')]},{'model':db[_0x5c4f('0x6d')],'as':'Owner','attributes':['id',_0x5c4f('0x1d'),_0x5c4f('0xfd')]},{'model':db[_0x5c4f('0x42')],'as':_0x5c4f('0x7e'),'attributes':['id',_0x5c4f('0x1d'),_0x5c4f('0x35')],'through':{'attributes':[]}}],'order':[['createdAt',_0x5c4f('0x67')]]};if(_0x253077[_0x5c4f('0x2a')][_0x5c4f('0xed')]){_0xb781ab[_0x5c4f('0x32')][_0x5c4f('0xf8')]={'$gte':_0x32bf91['from'],'$lte':_0x32bf91['to']};}switch(_0x2aded4){case _0x5c4f('0xe6'):_0xb781ab[_0x5c4f('0x2f')][_0x5c4f('0x4e')](_0x5c4f('0x108'),'customerIp',_0x5c4f('0x109'),_0x5c4f('0x10a'),_0x5c4f('0x10b'),_0x5c4f('0x10c'),_0x5c4f('0x10d'),'ratingValue',_0x5c4f('0x10e'));break;case _0x5c4f('0xe5'):_0xb781ab[_0x5c4f('0x2f')]['push']('subject',_0x5c4f('0x10f'));break;case _0x5c4f('0x110'):_0xb781ab[_0x5c4f('0x2f')][_0x5c4f('0x4e')](_0x5c4f('0x111'),_0x5c4f('0x112'));break;}return db[_[_0x5c4f('0xff')](_0x2aded4)+_0x5c4f('0x113')][_0x5c4f('0xfe')](_0xb781ab)[_0x5c4f('0x18')](function(_0x32befb){_0x2fdbb4[_0x5c4f('0x14')]+=_0x32befb['count'];return _['map'](_0x32befb[_0x5c4f('0x7f')],function(_0x3c37e){var _0x1b9a2a=_0x3c37e[_0x5c4f('0x8b')]({'plain':!![]});_0x1b9a2a['channel']=_0x2aded4;if(_0x1b9a2a['Owner']){_0x1b9a2a[_0x5c4f('0x114')]={'id':_0x1b9a2a[_0x5c4f('0x114')]['id'],'name':_0x1b9a2a[_0x5c4f('0x114')]['name'],'fullname':_0x1b9a2a[_0x5c4f('0x114')][_0x5c4f('0xfd')]};}return _0x1b9a2a;});});}});return Promise[_0x5c4f('0x27')](_0x352362);})[_0x5c4f('0x18')](function(_0x41b09c){return _(_0x41b09c)[_0x5c4f('0x115')]()['sortBy']('createdAt')['reverse']()[_0x5c4f('0x47')]();})['then'](function(_0x388422){_0x2fdbb4['rows']=_0x57a40f[_0x5c4f('0x13')]?_0x388422[_0x5c4f('0x116')](_0x57a40f[_0x5c4f('0x11')],_0x57a40f[_0x5c4f('0x11')]+_0x57a40f['limit']):_0x388422;return _0x2fdbb4;})[_0x5c4f('0x18')](respondWithFilteredResult(_0x11b274,_0x57a40f))[_0x5c4f('0x80')](handleError(_0x11b274,null));};
\ No newline at end of file
index 24380fd..cee74d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c14=['save','update','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x1c14,0x7b));var _0x41c1=function(_0x400d1e,_0x3ded33){_0x400d1e=_0x400d1e-0x0;var _0x286bf6=_0x1c14[_0x400d1e];return _0x286bf6;};'use strict';var EventEmitter=require(_0x41c1('0x0'));var CmContact=require(_0x41c1('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x41c1('0x2')](0x0);var events={'afterCreate':_0x41c1('0x3'),'afterUpdate':_0x41c1('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd73afd){return function(_0x41a3d,_0x19215f,_0x36dcb3){CmContactEvents[_0x41c1('0x5')](_0xd73afd+':'+_0x41a3d['id'],_0x41a3d);CmContactEvents[_0x41c1('0x5')](_0xd73afd,_0x41a3d);_0x36dcb3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x41c1('0x6')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0x0ea3=['update','emit','hook','exports','CmContact','setMaxListeners','save'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x0ea3,0x17e));var _0x30ea=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x0ea3[_0x2706da];return _0x3ba87e;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db'][_0x30ea('0x0')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x30ea('0x1')](0x0);var events={'afterCreate':_0x30ea('0x2'),'afterUpdate':_0x30ea('0x3'),'afterDestroy':'remove'};function emitEvent(_0x49a5fc){return function(_0x567cdf,_0x42dc62,_0x28770){CmContactEvents[_0x30ea('0x4')](_0x49a5fc+':'+_0x567cdf['id'],_0x567cdf);CmContactEvents[_0x30ea('0x4')](_0x49a5fc,_0x567cdf);_0x28770(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x30ea('0x5')](e,emitEvent(event));}}module[_0x30ea('0x6')]=CmContactEvents;
\ No newline at end of file
index bb7515a..8cdefba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe08c=['VoiceQueue','findOne','then','dialTimezone','timezones','utcOffset','add','minutes','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','ListId','priority','callbackUniqueid','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','catch','findAll','Lists','length','always','onlyIfOpen','outbound','CmList','CmHopperBlack','cmContact,\x20%s,\x20%s','message','dialCheckDuplicateType','BlackLists','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','phone','fti_cm_contacts','firstName','lastName','email','utf8mb4','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil'];(function(_0x232ca2,_0x56f575){var _0xb6e6ae=function(_0x17ce27){while(--_0x17ce27){_0x232ca2['push'](_0x232ca2['shift']());}};_0xb6e6ae(++_0x56f575);}(_0xe08c,0x1e8));var _0xce08=function(_0x15d2a0,_0x4424cb){_0x15d2a0=_0x15d2a0-0x0;var _0x4870f6=_0xe08c[_0x15d2a0];return _0x4870f6;};'use strict';var _=require(_0xce08('0x0'));var util=require(_0xce08('0x1'));var logger=require(_0xce08('0x2'))(_0xce08('0x3'));var moment=require(_0xce08('0x4'));var BPromise=require(_0xce08('0x5'));var rp=require(_0xce08('0x6'));var fs=require('fs');var path=require(_0xce08('0x7'));var rimraf=require(_0xce08('0x8'));var config=require(_0xce08('0x9'));var shared=require(_0xce08('0xa'));var attributes=require(_0xce08('0xb'));module['exports']=function(_0x3b9859,_0x128855){return _0x3b9859[_0xce08('0xc')](_0xce08('0xd'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xce08('0xe'),'fields':[_0xce08('0xe')]},{'name':_0xce08('0xf'),'fields':[_0xce08('0x10'),_0xce08('0x11'),_0xce08('0xe'),'mobile','fax',_0xce08('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xce08('0x13'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x7a7aaf,_0x2af2e5,_0x5c9a6b){var _0x28a43d=_0x3b9859[_0xce08('0x14')];var _0x5111c4=_0x7a7aaf[_0xce08('0x15')]({'plain':!![]});function _0x2d8626(){return function(_0x1c2ab3){logger[_0xce08('0x16')](_0xce08('0x17'),_0xce08('0x18'),util[_0xce08('0x19')](_0x1c2ab3,{'showHidden':![],'depth':null}));};}function _0x5df620(_0x17163a,_0x531441){var _0x3559ba=_0x531441[_0xce08('0x1a')]?_0x531441['scheduledat']:moment()[_0xce08('0x1b')](_0xce08('0x1c'));return new BPromise(function(_0x122539,_0x352b4b){if(_[_0xce08('0x1d')](_0x531441['dialTimezone'])){_0x122539({'ret':_0x3559ba});}else{_0x28a43d[_0xce08('0x1e')][_0xce08('0x1f')]({'where':{'id':_0x17163a['id']}})[_0xce08('0x20')](function(_0x238446){if(!_['isNil'](_0x238446)){var _0x3e13ea=_0x238446[_0xce08('0x21')];if(!_[_0xce08('0x1d')](_0x3e13ea)){var _0x1f3ba8=shared[_0xce08('0x22')];var _0x3eeebf=_0x1f3ba8[_0x3e13ea];var _0xe5a37c=_0x1f3ba8[_0x531441[_0xce08('0x21')]];if(!_[_0xce08('0x1d')](_0x3eeebf)&&!_[_0xce08('0x1d')](_0xe5a37c)){var _0x249782=_0x3eeebf[_0xce08('0x23')]-_0xe5a37c[_0xce08('0x23')];_0x3559ba=_0x531441[_0xce08('0x1a')]?_0x531441[_0xce08('0x1a')]:moment();var _0x5f1387=moment(_0x3559ba)[_0xce08('0x24')](_0x249782,_0xce08('0x25'));_0x122539({'ret':_0x5f1387[_0xce08('0x1b')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x122539({'ret':_0x3559ba});}else _0x122539({'ret':_0x3559ba});}else{_0x122539({'ret':_0x3559ba});}});}});return 0xa;}var _0x3b3a1c=function(_0x1f5f3f){return new BPromise(function(_0x32ccdb,_0xa3246a){_0x5df620(_0x1f5f3f,_0x5111c4)[_0xce08('0x20')](function(_0x56689d){_0x5111c4[_0xce08('0x1a')]=_0x56689d[_0xce08('0x26')];_0x28a43d['CmHopper'][_0xce08('0x1f')]({'where':{'phone':_0x5111c4['phone'],'VoiceQueueId':_0x1f5f3f['id']}})[_0xce08('0x20')](function(_0x3c854c){if(!_[_0xce08('0x1d')](_0x3c854c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5111c4[_0xce08('0xe')]+_0xce08('0x27')+_0x1f5f3f['id']);}return _0x28a43d[_0xce08('0x28')]['create']({'phone':_0x5111c4[_0xce08('0xe')],'ContactId':_0x5111c4['id'],'ListId':_0x5111c4[_0xce08('0x29')],'priority':_0x5111c4[_0xce08('0x2a')]?_0x5111c4[_0xce08('0x2a')]:0x2,'scheduledat':_0x5111c4['scheduledat']?_0x5111c4[_0xce08('0x1a')]:moment()[_0xce08('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5111c4[_0xce08('0x2b')]?!![]:![],'callbackuniqueid':_0x5111c4['callbackUniqueid']?_0x5111c4[_0xce08('0x2b')]:undefined,'callbackat':_0x5111c4['callbackUniqueid']?moment()[_0xce08('0x1b')](_0xce08('0x1c')):undefined,'VoiceQueueId':_0x1f5f3f['id']});})['catch'](function(_0x4b3d6a){_0xa3246a(_0x4b3d6a);});});});};var _0x3e620c=function(_0x49d248){return new BPromise(function(_0x75ab1c,_0x89b477){_0x5df620(_0x49d248,_0x5111c4)[_0xce08('0x20')](function(_0x296518){_0x5111c4[_0xce08('0x1a')]=_0x296518[_0xce08('0x26')];_0x28a43d['CmHopper'][_0xce08('0x1f')]({'where':{'phone':_0x5111c4[_0xce08('0xe')],'VoiceQueueId':_0x49d248['id']}})['then'](function(_0x421583){if(!_[_0xce08('0x1d')](_0x421583)){throw new Error(_0xce08('0x2c')+_0x5111c4['phone']+_0xce08('0x2d')+_0x49d248['id']);}return _0x28a43d[_0xce08('0x2e')][_0xce08('0x1f')]({'where':{'calleridnum':_0x5111c4[_0xce08('0xe')],'VoiceQueueId':_0x49d248['id']}});})[_0xce08('0x20')](function(_0x202218){if(!_['isNil'](_0x202218)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5111c4[_0xce08('0xe')]+_0xce08('0x2f')+_0x49d248['id']);}return _0x28a43d[_0xce08('0x28')][_0xce08('0x30')]({'phone':_0x5111c4[_0xce08('0xe')],'ContactId':_0x5111c4['id'],'ListId':_0x5111c4[_0xce08('0x29')],'priority':_0x5111c4[_0xce08('0x2a')]?_0x5111c4[_0xce08('0x2a')]:0x2,'scheduledat':_0x5111c4[_0xce08('0x1a')]?_0x5111c4[_0xce08('0x1a')]:moment()[_0xce08('0x1b')](_0xce08('0x1c')),'callback':_0x5111c4[_0xce08('0x2b')]?!![]:![],'callbackuniqueid':_0x5111c4['callbackUniqueid']?_0x5111c4[_0xce08('0x2b')]:undefined,'callbackat':_0x5111c4[_0xce08('0x2b')]?moment()[_0xce08('0x1b')](_0xce08('0x1c')):undefined,'VoiceQueueId':_0x49d248['id']});})['catch'](function(_0x5327ca){_0x89b477(_0x5327ca);});});});};function _0x5e650f(){return function(_0xc0e3dd){logger['error']('cmContact',_0xce08('0x18'),util[_0xce08('0x19')](_0xc0e3dd,{'showHidden':![],'depth':null}));};}function _0x3899bd(_0x41680b,_0x3becd0){var _0x4c3160=_0x3becd0[_0xce08('0x1a')]?_0x3becd0['scheduledat']:moment()[_0xce08('0x1b')](_0xce08('0x1c'));return new BPromise(function(_0x5a5c1d,_0x179310){if(_[_0xce08('0x1d')](_0x3becd0[_0xce08('0x21')])){_0x5a5c1d({'ret':_0x4c3160});}else{_0x28a43d[_0xce08('0x31')][_0xce08('0x1f')]({'where':{'id':_0x41680b['id']}})['then'](function(_0x1bad41){if(!_['isNil'](_0x1bad41)){var _0x8e5d10=_0x1bad41[_0xce08('0x21')];if(!_[_0xce08('0x1d')](_0x8e5d10)){var _0x3df5bb=shared['timezones'];var _0x10e9c4=_0x3df5bb[_0x8e5d10];var _0x55bc7e=_0x3df5bb[_0x3becd0[_0xce08('0x21')]];if(!_['isNil'](_0x10e9c4)&&!_[_0xce08('0x1d')](_0x55bc7e)){var _0xd77f61=_0x10e9c4['utcOffset']-_0x55bc7e[_0xce08('0x23')];_0x4c3160=_0x3becd0[_0xce08('0x1a')]?_0x3becd0[_0xce08('0x1a')]:moment();var _0x2859d8=moment(_0x4c3160)['add'](_0xd77f61,_0xce08('0x25'));_0x5a5c1d({'ret':_0x2859d8[_0xce08('0x1b')](_0xce08('0x1c'))});}else _0x5a5c1d({'ret':_0x4c3160});}else _0x5a5c1d({'ret':_0x4c3160});}else{_0x5a5c1d({'ret':_0x4c3160});}});}});return 0xa;}var _0x88bae5=function(_0xa9e4c5){return new BPromise(function(_0xee6b0,_0xf9d9f3){_0x3899bd(_0xa9e4c5,_0x5111c4)[_0xce08('0x20')](function(_0x583aca){_0x5111c4[_0xce08('0x1a')]=_0x583aca[_0xce08('0x26')];_0x28a43d[_0xce08('0x28')][_0xce08('0x1f')]({'where':{'phone':_0x5111c4['phone'],'CampaignId':_0xa9e4c5['id']}})[_0xce08('0x20')](function(_0x16dde1){if(!_[_0xce08('0x1d')](_0x16dde1)){throw new Error(_0xce08('0x2c')+_0x5111c4[_0xce08('0xe')]+_0xce08('0x32')+_0xa9e4c5['id']);}return _0x28a43d['CmHopper'][_0xce08('0x30')]({'phone':_0x5111c4[_0xce08('0xe')],'ContactId':_0x5111c4['id'],'ListId':_0x5111c4['ListId'],'priority':_0x5111c4[_0xce08('0x2a')]?_0x5111c4[_0xce08('0x2a')]:0x2,'scheduledat':_0x5111c4[_0xce08('0x1a')]?_0x5111c4[_0xce08('0x1a')]:moment()[_0xce08('0x1b')](_0xce08('0x1c')),'callback':_0x5111c4[_0xce08('0x2b')]?!![]:![],'callbackuniqueid':_0x5111c4[_0xce08('0x2b')]?_0x5111c4[_0xce08('0x2b')]:undefined,'callbackat':_0x5111c4[_0xce08('0x2b')]?moment()[_0xce08('0x1b')](_0xce08('0x1c')):undefined,'CampaignId':_0xa9e4c5['id']});})['catch'](function(_0x3e4c51){_0xf9d9f3(_0x3e4c51);});});});};var _0x7b4bc3=function(_0x47bbd2){return new BPromise(function(_0x1fac1b,_0x607fec){_0x3899bd(_0x47bbd2,_0x5111c4)[_0xce08('0x20')](function(_0x335c1f){_0x5111c4['scheduledat']=_0x335c1f[_0xce08('0x26')];_0x28a43d[_0xce08('0x28')][_0xce08('0x1f')]({'where':{'phone':_0x5111c4[_0xce08('0xe')],'CampaignId':_0x47bbd2['id']}})[_0xce08('0x20')](function(_0x4cbb6a){if(!_[_0xce08('0x1d')](_0x4cbb6a)){throw new Error(_0xce08('0x2c')+_0x5111c4[_0xce08('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x47bbd2['id']);}return _0x28a43d[_0xce08('0x2e')][_0xce08('0x1f')]({'where':{'calleridnum':_0x5111c4[_0xce08('0xe')],'CampaignId':_0x47bbd2['id']}});})[_0xce08('0x20')](function(_0x4152a5){if(!_[_0xce08('0x1d')](_0x4152a5)){throw new Error(_0xce08('0x33')+_0x5111c4[_0xce08('0xe')]+_0xce08('0x34')+_0x47bbd2['id']);}return _0x28a43d['CmHopper'][_0xce08('0x30')]({'phone':_0x5111c4['phone'],'ContactId':_0x5111c4['id'],'ListId':_0x5111c4[_0xce08('0x29')],'priority':_0x5111c4[_0xce08('0x2a')]?_0x5111c4[_0xce08('0x2a')]:0x2,'scheduledat':_0x5111c4['scheduledat']?_0x5111c4['scheduledat']:moment()[_0xce08('0x1b')](_0xce08('0x1c')),'callback':_0x5111c4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5111c4['callbackUniqueid']?_0x5111c4[_0xce08('0x2b')]:undefined,'callbackat':_0x5111c4[_0xce08('0x2b')]?moment()[_0xce08('0x1b')](_0xce08('0x1c')):undefined,'CampaignId':_0x47bbd2['id']});})[_0xce08('0x35')](function(_0x70f51){_0x607fec(_0x70f51);});});});};if(_0x5111c4[_0xce08('0x29')]){_0x28a43d[_0xce08('0x1e')][_0xce08('0x36')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0xce08('0x21')],'include':[{'model':_0x28a43d['CmList'],'as':_0xce08('0x37'),'where':{'id':_0x5111c4['ListId']}}]})[_0xce08('0x20')](function(_0x46c3e8){if(_0x46c3e8){var _0x1ffbac=[];for(var _0x5a9ac2=0x0,_0x2ae23d;_0x5a9ac2<_0x46c3e8[_0xce08('0x38')];_0x5a9ac2+=0x1){_0x2ae23d=_0x46c3e8[_0x5a9ac2][_0xce08('0x15')]({'plain':!![]});switch(_0x2ae23d['dialCheckDuplicateType']){case _0xce08('0x39'):_0x3e620c(_0x2ae23d)[_0xce08('0x35')](_0x2d8626());break;case _0xce08('0x3a'):_0x3b3a1c(_0x2ae23d)[_0xce08('0x35')](_0x2d8626());break;default:_0x3899bd(_0x2ae23d,_0x5111c4)['then'](function(_0x2fe144){_0x5111c4[_0xce08('0x1a')]=_0x2fe144['ret'];_0x28a43d[_0xce08('0x28')][_0xce08('0x30')]({'phone':_0x5111c4[_0xce08('0xe')],'ContactId':_0x5111c4['id'],'ListId':_0x5111c4[_0xce08('0x29')],'scheduledat':_0x5111c4[_0xce08('0x1a')]?_0x5111c4[_0xce08('0x1a')]:moment()[_0xce08('0x1b')](_0xce08('0x1c')),'priority':_0x5111c4[_0xce08('0x2a')]?_0x5111c4[_0xce08('0x2a')]:0x2,'callback':_0x5111c4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5111c4[_0xce08('0x2b')]?_0x5111c4[_0xce08('0x2b')]:undefined,'callbackat':_0x5111c4[_0xce08('0x2b')]?moment()[_0xce08('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2ae23d['id']})[_0xce08('0x35')](_0x2d8626());});}}}})[_0xce08('0x20')](function(){return _0x28a43d[_0xce08('0x1e')][_0xce08('0x36')]({'where':{'type':_0xce08('0x3b')},'attributes':['id'],'include':[{'model':_0x28a43d[_0xce08('0x3c')],'as':'BlackLists','where':{'id':_0x5111c4['ListId']}}]})['then'](function(_0x11de1b){if(_0x11de1b){var _0xa91e7b=[];for(var _0x5d36e4=0x0,_0x342acb;_0x5d36e4<_0x11de1b['length'];_0x5d36e4+=0x1){_0x342acb=_0x11de1b[_0x5d36e4]['get']({'plain':!![]});_0x28a43d[_0xce08('0x3d')][_0xce08('0x30')]({'phone':_0x5111c4[_0xce08('0xe')],'ContactId':_0x5111c4['id'],'ListId':_0x5111c4[_0xce08('0x29')],'VoiceQueueId':_0x342acb['id']})[_0xce08('0x35')](function(_0x4ac0e0){logger['error'](_0xce08('0x3e'),_0xce08('0x18'),_0x4ac0e0[_0xce08('0x3f')]);});}}});})[_0xce08('0x20')](function(){return _0x28a43d['Campaign'][_0xce08('0x36')]({'attributes':['id',_0xce08('0x40'),_0xce08('0x21')],'include':[{'model':_0x28a43d[_0xce08('0x3c')],'as':'Lists','where':{'id':_0x5111c4[_0xce08('0x29')]}}]})['then'](function(_0x3f85b1){if(_0x3f85b1){var _0x2774f6=[];for(var _0x2a6bc2=0x0,_0x422e4d;_0x2a6bc2<_0x3f85b1['length'];_0x2a6bc2+=0x1){_0x422e4d=_0x3f85b1[_0x2a6bc2][_0xce08('0x15')]({'plain':!![]});switch(_0x422e4d[_0xce08('0x40')]){case _0xce08('0x39'):_0x7b4bc3(_0x422e4d)['catch'](_0x5e650f());break;case'onlyIfOpen':_0x88bae5(_0x422e4d)[_0xce08('0x35')](_0x5e650f());break;default:_0x28a43d[_0xce08('0x28')]['create']({'phone':_0x5111c4[_0xce08('0xe')],'ContactId':_0x5111c4['id'],'ListId':_0x5111c4[_0xce08('0x29')],'scheduledat':_0x5111c4[_0xce08('0x1a')]?_0x5111c4[_0xce08('0x1a')]:moment()[_0xce08('0x1b')](_0xce08('0x1c')),'priority':_0x5111c4['priority']?_0x5111c4[_0xce08('0x2a')]:0x2,'callback':_0x5111c4[_0xce08('0x2b')]?!![]:![],'callbackuniqueid':_0x5111c4[_0xce08('0x2b')]?_0x5111c4[_0xce08('0x2b')]:undefined,'callbackat':_0x5111c4[_0xce08('0x2b')]?moment()[_0xce08('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x422e4d['id']})['catch'](_0x5e650f());}}}});})[_0xce08('0x20')](function(){return _0x28a43d[_0xce08('0x31')]['findAll']({'attributes':['id'],'include':[{'model':_0x28a43d['CmList'],'as':_0xce08('0x41'),'where':{'id':_0x5111c4[_0xce08('0x29')]}}]})[_0xce08('0x20')](function(_0x317cb4){if(_0x317cb4){var _0x6dc80b=[];for(var _0x406b15=0x0,_0x101f05;_0x406b15<_0x317cb4[_0xce08('0x38')];_0x406b15+=0x1){_0x101f05=_0x317cb4[_0x406b15][_0xce08('0x15')]({'plain':!![]});_0x28a43d[_0xce08('0x3d')]['create']({'phone':_0x5111c4[_0xce08('0xe')],'ContactId':_0x5111c4['id'],'ListId':_0x5111c4[_0xce08('0x29')],'CampaignId':_0x101f05['id']})[_0xce08('0x35')](function(_0x7fa2ca){logger[_0xce08('0x16')](_0xce08('0x3e'),'afterCreate',_0x7fa2ca[_0xce08('0x3f')]);});}}});})['then'](function(){_0x5c9a6b();})[_0xce08('0x35')](function(_0x3d2a3a){logger[_0xce08('0x16')](_0xce08('0x3e'),_0xce08('0x18'),_0x3d2a3a[_0xce08('0x3f')]);_0x5c9a6b(_0x3d2a3a);});}else{_0x5c9a6b(new Error(_0xce08('0x42')));}},'afterDestroy':function(_0x51d011,_0x3d80a7,_0x1458fe){var _0xccfe05=_0x3b9859[_0xce08('0x14')];var _0x295c52=_0x51d011[_0xce08('0x15')]({'plain':!![]});return _0xccfe05['CmHopper'][_0xce08('0x36')]({'raw':!![],'where':{'ListId':_0x295c52[_0xce08('0x29')],'ContactId':_0x295c52['id']}})[_0xce08('0x20')](function(_0x459d22){if(!_[_0xce08('0x43')](_0x459d22)){var _0x35abdb=[];for(var _0x25b51f=0x0;_0x25b51f<_0x459d22[_0xce08('0x38')];_0x25b51f+=0x1){var _0x5e6b3e=_0xccfe05[_0xce08('0x28')][_0xce08('0x44')]({'where':{'ListId':_0x459d22[_0x25b51f][_0xce08('0x29')],'ContactId':_0x459d22[_0x25b51f]['ContactId'],'VoiceQueueId':_0x459d22[_0x25b51f][_0xce08('0x45')],'CampaignId':_0x459d22[_0x25b51f]['CampaignId']}});_0x35abdb[_0xce08('0x46')](_0x5e6b3e);}return BPromise[_0xce08('0x47')](_0x35abdb);}})[_0xce08('0x20')](function(_0x4703e7){logger[_0xce08('0x48')](_0xce08('0x49'),util[_0xce08('0x19')](_0x4703e7,{'showHidden':![],'depth':null}));_0x1458fe();})[_0xce08('0x35')](function(_0x448f4e){logger[_0xce08('0x16')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x448f4e,{'showHidden':![],'depth':null}));_0x1458fe(_0x448f4e);});}}});};
\ No newline at end of file
+var _0x0961=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','findOne','then','isNil','timezones','utcOffset','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','catch','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','CmList','length','get','VoiceQueue','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','findAll','Lists','always','onlyIfOpen','models','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0961,0x17a));var _0x1096=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0x0961[_0x52f159];return _0x156799;};'use strict';var _=require(_0x1096('0x0'));var util=require(_0x1096('0x1'));var logger=require(_0x1096('0x2'))(_0x1096('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1096('0x4'));var fs=require('fs');var path=require(_0x1096('0x5'));var rimraf=require(_0x1096('0x6'));var config=require(_0x1096('0x7'));var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module[_0x1096('0x8')]=function(_0x56cf9c,_0x15a976){return _0x56cf9c[_0x1096('0x9')](_0x1096('0xa'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x1096('0xb'),'fields':[_0x1096('0xb')]},{'name':_0x1096('0xc'),'fields':[_0x1096('0xd'),_0x1096('0xe'),_0x1096('0xb'),_0x1096('0xf'),_0x1096('0x10'),_0x1096('0x11')],'type':_0x1096('0x12')}],'timestamps':!![],'charset':_0x1096('0x13'),'collate':_0x1096('0x14'),'hooks':{'afterCreate':function(_0x29a49e,_0x57642f,_0x223fc2){var _0x559e5e=_0x56cf9c['models'];var _0x4ca89d=_0x29a49e['get']({'plain':!![]});function _0x4d4e45(){return function(_0x12fbb2){logger[_0x1096('0x15')](_0x1096('0x16'),_0x1096('0x17'),util[_0x1096('0x18')](_0x12fbb2,{'showHidden':![],'depth':null}));};}function _0x258060(_0x29bd8d,_0x4b9669){var _0x208136=_0x4b9669[_0x1096('0x19')]?_0x4b9669['scheduledat']:moment()[_0x1096('0x1a')](_0x1096('0x1b'));return new BPromise(function(_0x47aea3,_0x538540){if(_['isNil'](_0x4b9669[_0x1096('0x1c')])){_0x47aea3({'ret':_0x208136});}else{_0x559e5e['VoiceQueue'][_0x1096('0x1d')]({'where':{'id':_0x29bd8d['id']}})[_0x1096('0x1e')](function(_0x39a976){if(!_[_0x1096('0x1f')](_0x39a976)){var _0x38c858=_0x39a976[_0x1096('0x1c')];if(!_['isNil'](_0x38c858)){var _0x1a6193=shared[_0x1096('0x20')];var _0x3a14f0=_0x1a6193[_0x38c858];var _0x25f2bd=_0x1a6193[_0x4b9669[_0x1096('0x1c')]];if(!_['isNil'](_0x3a14f0)&&!_[_0x1096('0x1f')](_0x25f2bd)){var _0x2f33c7=_0x3a14f0[_0x1096('0x21')]-_0x25f2bd['utcOffset'];_0x208136=_0x4b9669[_0x1096('0x19')]?_0x4b9669['scheduledat']:moment();var _0x7459e=moment(_0x208136)['add'](_0x2f33c7,_0x1096('0x22'));_0x47aea3({'ret':_0x7459e[_0x1096('0x1a')](_0x1096('0x1b'))});}else _0x47aea3({'ret':_0x208136});}else _0x47aea3({'ret':_0x208136});}else{_0x47aea3({'ret':_0x208136});}});}});return 0xa;}var _0x3a214d=function(_0x178e23){return new BPromise(function(_0x4de5f4,_0x49c813){_0x258060(_0x178e23,_0x4ca89d)['then'](function(_0x17cb8e){_0x4ca89d[_0x1096('0x19')]=_0x17cb8e[_0x1096('0x23')];_0x559e5e[_0x1096('0x24')][_0x1096('0x1d')]({'where':{'phone':_0x4ca89d[_0x1096('0xb')],'VoiceQueueId':_0x178e23['id']}})[_0x1096('0x1e')](function(_0x3b0535){if(!_['isNil'](_0x3b0535)){throw new Error(_0x1096('0x25')+_0x4ca89d['phone']+_0x1096('0x26')+_0x178e23['id']);}return _0x559e5e['CmHopper']['create']({'phone':_0x4ca89d[_0x1096('0xb')],'ContactId':_0x4ca89d['id'],'ListId':_0x4ca89d[_0x1096('0x27')],'priority':_0x4ca89d[_0x1096('0x28')]?_0x4ca89d[_0x1096('0x28')]:0x2,'scheduledat':_0x4ca89d[_0x1096('0x19')]?_0x4ca89d[_0x1096('0x19')]:moment()[_0x1096('0x1a')](_0x1096('0x1b')),'callback':_0x4ca89d[_0x1096('0x29')]?!![]:![],'callbackuniqueid':_0x4ca89d['callbackUniqueid']?_0x4ca89d[_0x1096('0x29')]:undefined,'callbackat':_0x4ca89d[_0x1096('0x29')]?moment()['format'](_0x1096('0x1b')):undefined,'VoiceQueueId':_0x178e23['id']});})['catch'](function(_0x9b2f2b){_0x49c813(_0x9b2f2b);});});});};var _0x237056=function(_0x2bce68){return new BPromise(function(_0x2e1977,_0x52ed49){_0x258060(_0x2bce68,_0x4ca89d)['then'](function(_0x2021be){_0x4ca89d[_0x1096('0x19')]=_0x2021be['ret'];_0x559e5e[_0x1096('0x24')]['findOne']({'where':{'phone':_0x4ca89d['phone'],'VoiceQueueId':_0x2bce68['id']}})[_0x1096('0x1e')](function(_0x3c03a3){if(!_[_0x1096('0x1f')](_0x3c03a3)){throw new Error(_0x1096('0x25')+_0x4ca89d[_0x1096('0xb')]+_0x1096('0x2a')+_0x2bce68['id']);}return _0x559e5e[_0x1096('0x2b')][_0x1096('0x1d')]({'where':{'calleridnum':_0x4ca89d[_0x1096('0xb')],'VoiceQueueId':_0x2bce68['id']}});})[_0x1096('0x1e')](function(_0x35a65d){if(!_[_0x1096('0x1f')](_0x35a65d)){throw new Error(_0x1096('0x2c')+_0x4ca89d['phone']+_0x1096('0x2d')+_0x2bce68['id']);}return _0x559e5e[_0x1096('0x24')][_0x1096('0x2e')]({'phone':_0x4ca89d[_0x1096('0xb')],'ContactId':_0x4ca89d['id'],'ListId':_0x4ca89d[_0x1096('0x27')],'priority':_0x4ca89d['priority']?_0x4ca89d[_0x1096('0x28')]:0x2,'scheduledat':_0x4ca89d[_0x1096('0x19')]?_0x4ca89d[_0x1096('0x19')]:moment()[_0x1096('0x1a')](_0x1096('0x1b')),'callback':_0x4ca89d[_0x1096('0x29')]?!![]:![],'callbackuniqueid':_0x4ca89d[_0x1096('0x29')]?_0x4ca89d['callbackUniqueid']:undefined,'callbackat':_0x4ca89d['callbackUniqueid']?moment()[_0x1096('0x1a')](_0x1096('0x1b')):undefined,'VoiceQueueId':_0x2bce68['id']});})[_0x1096('0x2f')](function(_0x5bf131){_0x52ed49(_0x5bf131);});});});};function _0x2b16a8(){return function(_0x54624d){logger[_0x1096('0x15')](_0x1096('0x16'),_0x1096('0x17'),util[_0x1096('0x18')](_0x54624d,{'showHidden':![],'depth':null}));};}function _0x27a66b(_0xffb349,_0x5c79fe){var _0x10aeb4=_0x5c79fe[_0x1096('0x19')]?_0x5c79fe[_0x1096('0x19')]:moment()[_0x1096('0x1a')](_0x1096('0x1b'));return new BPromise(function(_0x286156,_0x8ed4a4){if(_['isNil'](_0x5c79fe[_0x1096('0x1c')])){_0x286156({'ret':_0x10aeb4});}else{_0x559e5e[_0x1096('0x30')][_0x1096('0x1d')]({'where':{'id':_0xffb349['id']}})[_0x1096('0x1e')](function(_0x496192){if(!_[_0x1096('0x1f')](_0x496192)){var _0x3bb59a=_0x496192['dialTimezone'];if(!_[_0x1096('0x1f')](_0x3bb59a)){var _0x25fd01=shared[_0x1096('0x20')];var _0xc5ef56=_0x25fd01[_0x3bb59a];var _0x4ef58a=_0x25fd01[_0x5c79fe[_0x1096('0x1c')]];if(!_[_0x1096('0x1f')](_0xc5ef56)&&!_[_0x1096('0x1f')](_0x4ef58a)){var _0x5755fb=_0xc5ef56[_0x1096('0x21')]-_0x4ef58a['utcOffset'];_0x10aeb4=_0x5c79fe[_0x1096('0x19')]?_0x5c79fe[_0x1096('0x19')]:moment();var _0x3f7426=moment(_0x10aeb4)['add'](_0x5755fb,_0x1096('0x22'));_0x286156({'ret':_0x3f7426[_0x1096('0x1a')](_0x1096('0x1b'))});}else _0x286156({'ret':_0x10aeb4});}else _0x286156({'ret':_0x10aeb4});}else{_0x286156({'ret':_0x10aeb4});}});}});return 0xa;}var _0x46fbe5=function(_0x26d758){return new BPromise(function(_0x3507f3,_0x58dcc4){_0x27a66b(_0x26d758,_0x4ca89d)[_0x1096('0x1e')](function(_0x4072a3){_0x4ca89d['scheduledat']=_0x4072a3[_0x1096('0x23')];_0x559e5e[_0x1096('0x24')][_0x1096('0x1d')]({'where':{'phone':_0x4ca89d[_0x1096('0xb')],'CampaignId':_0x26d758['id']}})[_0x1096('0x1e')](function(_0x5d7363){if(!_[_0x1096('0x1f')](_0x5d7363)){throw new Error(_0x1096('0x25')+_0x4ca89d[_0x1096('0xb')]+_0x1096('0x31')+_0x26d758['id']);}return _0x559e5e[_0x1096('0x24')][_0x1096('0x2e')]({'phone':_0x4ca89d[_0x1096('0xb')],'ContactId':_0x4ca89d['id'],'ListId':_0x4ca89d['ListId'],'priority':_0x4ca89d[_0x1096('0x28')]?_0x4ca89d[_0x1096('0x28')]:0x2,'scheduledat':_0x4ca89d[_0x1096('0x19')]?_0x4ca89d['scheduledat']:moment()[_0x1096('0x1a')](_0x1096('0x1b')),'callback':_0x4ca89d[_0x1096('0x29')]?!![]:![],'callbackuniqueid':_0x4ca89d[_0x1096('0x29')]?_0x4ca89d[_0x1096('0x29')]:undefined,'callbackat':_0x4ca89d['callbackUniqueid']?moment()[_0x1096('0x1a')](_0x1096('0x1b')):undefined,'CampaignId':_0x26d758['id']});})[_0x1096('0x2f')](function(_0x3fe21f){_0x58dcc4(_0x3fe21f);});});});};var _0x8c81ce=function(_0x4f8ee1){return new BPromise(function(_0x37d9a,_0x4389b3){_0x27a66b(_0x4f8ee1,_0x4ca89d)[_0x1096('0x1e')](function(_0x5c8184){_0x4ca89d['scheduledat']=_0x5c8184[_0x1096('0x23')];_0x559e5e[_0x1096('0x24')][_0x1096('0x1d')]({'where':{'phone':_0x4ca89d[_0x1096('0xb')],'CampaignId':_0x4f8ee1['id']}})[_0x1096('0x1e')](function(_0x1192bc){if(!_[_0x1096('0x1f')](_0x1192bc)){throw new Error(_0x1096('0x25')+_0x4ca89d[_0x1096('0xb')]+_0x1096('0x32')+_0x4f8ee1['id']);}return _0x559e5e[_0x1096('0x2b')]['findOne']({'where':{'calleridnum':_0x4ca89d[_0x1096('0xb')],'CampaignId':_0x4f8ee1['id']}});})['then'](function(_0x39fc92){if(!_[_0x1096('0x1f')](_0x39fc92)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4ca89d[_0x1096('0xb')]+_0x1096('0x33')+_0x4f8ee1['id']);}return _0x559e5e['CmHopper'][_0x1096('0x2e')]({'phone':_0x4ca89d[_0x1096('0xb')],'ContactId':_0x4ca89d['id'],'ListId':_0x4ca89d[_0x1096('0x27')],'priority':_0x4ca89d[_0x1096('0x28')]?_0x4ca89d[_0x1096('0x28')]:0x2,'scheduledat':_0x4ca89d['scheduledat']?_0x4ca89d[_0x1096('0x19')]:moment()['format'](_0x1096('0x1b')),'callback':_0x4ca89d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4ca89d['callbackUniqueid']?_0x4ca89d[_0x1096('0x29')]:undefined,'callbackat':_0x4ca89d[_0x1096('0x29')]?moment()[_0x1096('0x1a')](_0x1096('0x1b')):undefined,'CampaignId':_0x4f8ee1['id']});})['catch'](function(_0x1ac951){_0x4389b3(_0x1ac951);});});});};if(_0x4ca89d[_0x1096('0x27')]){_0x559e5e['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x1096('0x34'),_0x1096('0x1c')],'include':[{'model':_0x559e5e[_0x1096('0x35')],'as':'Lists','where':{'id':_0x4ca89d[_0x1096('0x27')]}}]})[_0x1096('0x1e')](function(_0x32f4ad){if(_0x32f4ad){var _0x5116d5=[];for(var _0x3390f8=0x0,_0x294d2f;_0x3390f8<_0x32f4ad[_0x1096('0x36')];_0x3390f8+=0x1){_0x294d2f=_0x32f4ad[_0x3390f8][_0x1096('0x37')]({'plain':!![]});switch(_0x294d2f[_0x1096('0x34')]){case'always':_0x237056(_0x294d2f)[_0x1096('0x2f')](_0x4d4e45());break;case'onlyIfOpen':_0x3a214d(_0x294d2f)[_0x1096('0x2f')](_0x4d4e45());break;default:_0x27a66b(_0x294d2f,_0x4ca89d)[_0x1096('0x1e')](function(_0x48a52a){_0x4ca89d[_0x1096('0x19')]=_0x48a52a[_0x1096('0x23')];_0x559e5e[_0x1096('0x24')]['create']({'phone':_0x4ca89d[_0x1096('0xb')],'ContactId':_0x4ca89d['id'],'ListId':_0x4ca89d[_0x1096('0x27')],'scheduledat':_0x4ca89d['scheduledat']?_0x4ca89d[_0x1096('0x19')]:moment()[_0x1096('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4ca89d['priority']?_0x4ca89d['priority']:0x2,'callback':_0x4ca89d[_0x1096('0x29')]?!![]:![],'callbackuniqueid':_0x4ca89d['callbackUniqueid']?_0x4ca89d['callbackUniqueid']:undefined,'callbackat':_0x4ca89d[_0x1096('0x29')]?moment()[_0x1096('0x1a')](_0x1096('0x1b')):undefined,'VoiceQueueId':_0x294d2f['id']})[_0x1096('0x2f')](_0x4d4e45());});}}}})[_0x1096('0x1e')](function(){return _0x559e5e[_0x1096('0x38')]['findAll']({'where':{'type':_0x1096('0x39')},'attributes':['id'],'include':[{'model':_0x559e5e['CmList'],'as':_0x1096('0x3a'),'where':{'id':_0x4ca89d[_0x1096('0x27')]}}]})[_0x1096('0x1e')](function(_0x2f24e2){if(_0x2f24e2){var _0x1d1e9e=[];for(var _0x4099bb=0x0,_0x50a250;_0x4099bb<_0x2f24e2[_0x1096('0x36')];_0x4099bb+=0x1){_0x50a250=_0x2f24e2[_0x4099bb][_0x1096('0x37')]({'plain':!![]});_0x559e5e[_0x1096('0x3b')][_0x1096('0x2e')]({'phone':_0x4ca89d['phone'],'ContactId':_0x4ca89d['id'],'ListId':_0x4ca89d[_0x1096('0x27')],'VoiceQueueId':_0x50a250['id']})['catch'](function(_0xb2f1a4){logger['error'](_0x1096('0x3c'),'afterCreate',_0xb2f1a4[_0x1096('0x3d')]);});}}});})['then'](function(){return _0x559e5e['Campaign'][_0x1096('0x3e')]({'attributes':['id',_0x1096('0x34'),_0x1096('0x1c')],'include':[{'model':_0x559e5e[_0x1096('0x35')],'as':_0x1096('0x3f'),'where':{'id':_0x4ca89d[_0x1096('0x27')]}}]})[_0x1096('0x1e')](function(_0x3d00ee){if(_0x3d00ee){var _0x5905a6=[];for(var _0x2ff0af=0x0,_0x38f172;_0x2ff0af<_0x3d00ee['length'];_0x2ff0af+=0x1){_0x38f172=_0x3d00ee[_0x2ff0af][_0x1096('0x37')]({'plain':!![]});switch(_0x38f172[_0x1096('0x34')]){case _0x1096('0x40'):_0x8c81ce(_0x38f172)[_0x1096('0x2f')](_0x2b16a8());break;case _0x1096('0x41'):_0x46fbe5(_0x38f172)[_0x1096('0x2f')](_0x2b16a8());break;default:_0x559e5e['CmHopper'][_0x1096('0x2e')]({'phone':_0x4ca89d[_0x1096('0xb')],'ContactId':_0x4ca89d['id'],'ListId':_0x4ca89d[_0x1096('0x27')],'scheduledat':_0x4ca89d[_0x1096('0x19')]?_0x4ca89d[_0x1096('0x19')]:moment()[_0x1096('0x1a')](_0x1096('0x1b')),'priority':_0x4ca89d[_0x1096('0x28')]?_0x4ca89d[_0x1096('0x28')]:0x2,'callback':_0x4ca89d[_0x1096('0x29')]?!![]:![],'callbackuniqueid':_0x4ca89d['callbackUniqueid']?_0x4ca89d[_0x1096('0x29')]:undefined,'callbackat':_0x4ca89d[_0x1096('0x29')]?moment()['format'](_0x1096('0x1b')):undefined,'CampaignId':_0x38f172['id']})[_0x1096('0x2f')](_0x2b16a8());}}}});})[_0x1096('0x1e')](function(){return _0x559e5e[_0x1096('0x30')][_0x1096('0x3e')]({'attributes':['id'],'include':[{'model':_0x559e5e[_0x1096('0x35')],'as':_0x1096('0x3a'),'where':{'id':_0x4ca89d[_0x1096('0x27')]}}]})[_0x1096('0x1e')](function(_0x5e0530){if(_0x5e0530){var _0x5d0665=[];for(var _0x4ed29c=0x0,_0x3a644a;_0x4ed29c<_0x5e0530[_0x1096('0x36')];_0x4ed29c+=0x1){_0x3a644a=_0x5e0530[_0x4ed29c]['get']({'plain':!![]});_0x559e5e[_0x1096('0x3b')][_0x1096('0x2e')]({'phone':_0x4ca89d[_0x1096('0xb')],'ContactId':_0x4ca89d['id'],'ListId':_0x4ca89d[_0x1096('0x27')],'CampaignId':_0x3a644a['id']})[_0x1096('0x2f')](function(_0x3a33d2){logger[_0x1096('0x15')]('cmContact,\x20%s,\x20%s',_0x1096('0x17'),_0x3a33d2['message']);});}}});})[_0x1096('0x1e')](function(){_0x223fc2();})[_0x1096('0x2f')](function(_0x1e2a74){logger[_0x1096('0x15')](_0x1096('0x3c'),_0x1096('0x17'),_0x1e2a74['message']);_0x223fc2(_0x1e2a74);});}else{_0x223fc2(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x4c6586,_0x2fe930,_0x376f5c){var _0x45e422=_0x56cf9c[_0x1096('0x42')];var _0x458b3e=_0x4c6586[_0x1096('0x37')]({'plain':!![]});return _0x45e422[_0x1096('0x24')][_0x1096('0x3e')]({'raw':!![],'where':{'ListId':_0x458b3e[_0x1096('0x27')],'ContactId':_0x458b3e['id']}})[_0x1096('0x1e')](function(_0x8acb3a){if(!_[_0x1096('0x43')](_0x8acb3a)){var _0x3748aa=[];for(var _0x10cc93=0x0;_0x10cc93<_0x8acb3a[_0x1096('0x36')];_0x10cc93+=0x1){var _0x484516=_0x45e422['CmHopper'][_0x1096('0x44')]({'where':{'ListId':_0x8acb3a[_0x10cc93][_0x1096('0x27')],'ContactId':_0x8acb3a[_0x10cc93][_0x1096('0x45')],'VoiceQueueId':_0x8acb3a[_0x10cc93][_0x1096('0x46')],'CampaignId':_0x8acb3a[_0x10cc93]['CampaignId']}});_0x3748aa[_0x1096('0x47')](_0x484516);}return BPromise[_0x1096('0x48')](_0x3748aa);}})[_0x1096('0x1e')](function(_0x3b4359){logger[_0x1096('0x49')](_0x1096('0x4a'),util[_0x1096('0x18')](_0x3b4359,{'showHidden':![],'depth':null}));_0x376f5c();})[_0x1096('0x2f')](function(_0x5ec4be){logger[_0x1096('0x15')](_0x1096('0x4b'),util[_0x1096('0x18')](_0x5ec4be,{'showHidden':![],'depth':null}));_0x376f5c(_0x5ec4be);});}}});};
\ No newline at end of file
index 3ac2168..8735281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fac=['CreateCmContact','debug','lodash','util','moment','bluebird','randomstring','squel','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','then','info','CmContact,\x20%s,\x20%s','request\x20sent','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetCmContact','catch','create','body','keys','update','cm_contacts','set','id\x20=\x20?','toString','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0fac,0x144));var _0xc0fa=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0fac[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xc0fa('0x0'));var util=require(_0xc0fa('0x1'));var moment=require(_0xc0fa('0x2'));var BPromise=require(_0xc0fa('0x3'));var rs=require(_0xc0fa('0x4'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0xc0fa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0fa('0x6'));var logger=require(_0xc0fa('0x7'))(_0xc0fa('0x8'));var config=require(_0xc0fa('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc0fa('0xa')]({'port':0x232a});config[_0xc0fa('0xb')]=_['defaults'](config[_0xc0fa('0xb')],{'host':_0xc0fa('0xc'),'port':0x18eb});var socket=require(_0xc0fa('0xd'))(new Redis(config[_0xc0fa('0xb')]));require('./cmContact.socket')['register'](socket);function respondWithRpcPromise(_0xd6f2fd,_0x17d7e1,_0x2da1b2){return new BPromise(function(_0x47ce77,_0xf0b277){return client['request'](_0xd6f2fd,_0x2da1b2)[_0xc0fa('0xe')](function(_0x44e4ca){logger[_0xc0fa('0xf')](_0xc0fa('0x10'),_0x17d7e1,_0xc0fa('0x11'));logger['debug'](_0xc0fa('0x12'),_0x17d7e1,_0xc0fa('0x11'),JSON[_0xc0fa('0x13')](_0x44e4ca));if(_0x44e4ca[_0xc0fa('0x14')]){if(_0x44e4ca[_0xc0fa('0x14')][_0xc0fa('0x15')]===0x1f4){logger['error']('CmContact,\x20%s,\x20%s',_0x17d7e1,_0x44e4ca[_0xc0fa('0x14')][_0xc0fa('0x16')]);return _0xf0b277(_0x44e4ca[_0xc0fa('0x14')]['message']);}logger[_0xc0fa('0x14')](_0xc0fa('0x10'),_0x17d7e1,_0x44e4ca['error']['message']);return _0x47ce77(_0x44e4ca[_0xc0fa('0x14')]['message']);}else{logger['info'](_0xc0fa('0x10'),_0x17d7e1,_0xc0fa('0x11'));_0x47ce77(_0x44e4ca[_0xc0fa('0x17')][_0xc0fa('0x16')]);}})['catch'](function(_0x1ff30d){logger['error'](_0xc0fa('0x10'),_0x17d7e1,_0x1ff30d);_0xf0b277(_0x1ff30d);});});}exports['GetCmContact']=function(_0x4e0490){var _0x483967=this;return new Promise(function(_0xfcd174,_0x430c02){return db['CmContact'][_0xc0fa('0x18')]({'raw':_0x4e0490[_0xc0fa('0x19')]?_0x4e0490['options'][_0xc0fa('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e0490[_0xc0fa('0x19')]?_0x4e0490[_0xc0fa('0x19')][_0xc0fa('0x1b')]||null:null,'attributes':_0x4e0490[_0xc0fa('0x19')]?_0x4e0490[_0xc0fa('0x19')][_0xc0fa('0x1c')]||null:null,'limit':_0x4e0490['options']?_0x4e0490['options'][_0xc0fa('0x1d')]||null:null,'include':_0x4e0490['options']?_0x4e0490[_0xc0fa('0x19')][_0xc0fa('0x1e')]?_['map'](_0x4e0490[_0xc0fa('0x19')][_0xc0fa('0x1e')],function(_0x37621d){return{'model':db[_0x37621d['model']],'as':_0x37621d['as'],'attributes':_0x37621d['attributes'],'include':_0x37621d[_0xc0fa('0x1e')]?_[_0xc0fa('0x1f')](_0x37621d['include'],function(_0x1dac2f){return{'model':db[_0x1dac2f[_0xc0fa('0x20')]],'as':_0x1dac2f['as'],'attributes':_0x1dac2f['attributes'],'include':_0x1dac2f[_0xc0fa('0x1e')]?_[_0xc0fa('0x1f')](_0x1dac2f[_0xc0fa('0x1e')],function(_0x21b7a9){return{'model':db[_0x21b7a9['model']],'as':_0x21b7a9['as'],'attributes':_0x21b7a9[_0xc0fa('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0fa('0xe')](function(_0x18c434){logger['info'](_0xc0fa('0x21'),_0x4e0490);logger['debug'](_0xc0fa('0x21'),_0x4e0490,JSON['stringify'](_0x18c434));_0xfcd174(_0x18c434);})[_0xc0fa('0x22')](function(_0x2b34f2){logger[_0xc0fa('0x14')]('GetCmContact',_0x2b34f2[_0xc0fa('0x16')],_0x4e0490);_0x430c02(_0x483967[_0xc0fa('0x14')](0x1f4,_0x2b34f2[_0xc0fa('0x16')]));});});};exports['CreateCmContact']=function(_0x9b0384){var _0xecdcb7=this;return new Promise(function(_0x41184d,_0x8f536b){return db['CmContact'][_0xc0fa('0x23')](_0x9b0384[_0xc0fa('0x24')],{'raw':_0x9b0384[_0xc0fa('0x19')]?_0x9b0384['options']['raw']===undefined?!![]:![]:!![]})[_0xc0fa('0xe')](function(_0x36cdb9){var _0x45ef04;for(var _0x348575=0x0;_0x348575<Object[_0xc0fa('0x25')](_0x9b0384[_0xc0fa('0x24')])['length'];_0x348575++){var _0x4a4e91=Object[_0xc0fa('0x25')](_0x9b0384[_0xc0fa('0x24')])[_0x348575];if(_0x4a4e91['startsWith']('cf_')){_0x45ef04=squel[_0xc0fa('0x26')]()['table'](_0xc0fa('0x27'))[_0xc0fa('0x28')](_0x4a4e91,_0x9b0384[_0xc0fa('0x24')][_0x4a4e91])[_0xc0fa('0x1b')](_0xc0fa('0x29'),_0x36cdb9['id'])[_0xc0fa('0x2a')]();break;}}if(!_0x45ef04)return _0x36cdb9;return db[_0xc0fa('0x2b')]['query'](_0x45ef04)[_0xc0fa('0xe')](function(){return _0x36cdb9;});})[_0xc0fa('0xe')](function(_0x3403b9){logger[_0xc0fa('0xf')](_0xc0fa('0x2c'),_0x9b0384);logger[_0xc0fa('0x2d')](_0xc0fa('0x2c'),_0x9b0384,JSON[_0xc0fa('0x13')](_0x3403b9));_0x41184d(_0x3403b9);})[_0xc0fa('0x22')](function(_0x609d9c){logger[_0xc0fa('0x14')](_0xc0fa('0x2c'),_0x609d9c[_0xc0fa('0x16')],_0x9b0384);_0x8f536b(_0xecdcb7[_0xc0fa('0x14')](0x1f4,_0x609d9c['message']));});});};
\ No newline at end of file
+var _0x8270=['id\x20=\x20?','toString','query','lodash','util','moment','randomstring','ioredis','squel','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./cmContact.socket','register','request','then','request\x20sent','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContact,\x20%s,\x20%s','message','info','catch','GetCmContact','CmContact','options','raw','attributes','include','map','model','debug','CreateCmContact','create','body','keys','startsWith','cf_','update','table','cm_contacts','where'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x8270,0x168));var _0x0827=function(_0x403cd4,_0x3b3c4f){_0x403cd4=_0x403cd4-0x0;var _0xe63a6a=_0x8270[_0x403cd4];return _0xe63a6a;};'use strict';var _=require(_0x0827('0x0'));var util=require(_0x0827('0x1'));var moment=require(_0x0827('0x2'));var BPromise=require('bluebird');var rs=require(_0x0827('0x3'));var fs=require('fs');var Redis=require(_0x0827('0x4'));var squel=require(_0x0827('0x5'));var db=require(_0x0827('0x6'))['db'];var utils=require(_0x0827('0x7'));var logger=require(_0x0827('0x8'))(_0x0827('0x9'));var config=require(_0x0827('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0827('0xb')][_0x0827('0xc')]({'port':0x232a});config[_0x0827('0xd')]=_[_0x0827('0xe')](config[_0x0827('0xd')],{'host':_0x0827('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0827('0x10'))[_0x0827('0x11')](socket);function respondWithRpcPromise(_0x447d07,_0xb6fecd,_0xf7365b){return new BPromise(function(_0x34475f,_0x1083c6){return client[_0x0827('0x12')](_0x447d07,_0xf7365b)[_0x0827('0x13')](function(_0x3bade2){logger['info']('CmContact,\x20%s,\x20%s',_0xb6fecd,_0x0827('0x14'));logger['debug'](_0x0827('0x15'),_0xb6fecd,_0x0827('0x14'),JSON[_0x0827('0x16')](_0x3bade2));if(_0x3bade2[_0x0827('0x17')]){if(_0x3bade2[_0x0827('0x17')][_0x0827('0x18')]===0x1f4){logger[_0x0827('0x17')](_0x0827('0x19'),_0xb6fecd,_0x3bade2[_0x0827('0x17')]['message']);return _0x1083c6(_0x3bade2[_0x0827('0x17')]['message']);}logger['error'](_0x0827('0x19'),_0xb6fecd,_0x3bade2[_0x0827('0x17')]['message']);return _0x34475f(_0x3bade2[_0x0827('0x17')][_0x0827('0x1a')]);}else{logger[_0x0827('0x1b')](_0x0827('0x19'),_0xb6fecd,'request\x20sent');_0x34475f(_0x3bade2['result']['message']);}})[_0x0827('0x1c')](function(_0x927a20){logger[_0x0827('0x17')](_0x0827('0x19'),_0xb6fecd,_0x927a20);_0x1083c6(_0x927a20);});});}exports[_0x0827('0x1d')]=function(_0x48f576){var _0x5504dc=this;return new Promise(function(_0x480cff,_0x213b68){return db[_0x0827('0x1e')]['findAll']({'raw':_0x48f576[_0x0827('0x1f')]?_0x48f576[_0x0827('0x1f')][_0x0827('0x20')]===undefined?!![]:![]:!![],'where':_0x48f576[_0x0827('0x1f')]?_0x48f576[_0x0827('0x1f')]['where']||null:null,'attributes':_0x48f576[_0x0827('0x1f')]?_0x48f576[_0x0827('0x1f')][_0x0827('0x21')]||null:null,'limit':_0x48f576[_0x0827('0x1f')]?_0x48f576[_0x0827('0x1f')]['limit']||null:null,'include':_0x48f576[_0x0827('0x1f')]?_0x48f576[_0x0827('0x1f')][_0x0827('0x22')]?_[_0x0827('0x23')](_0x48f576[_0x0827('0x1f')]['include'],function(_0x180b16){return{'model':db[_0x180b16['model']],'as':_0x180b16['as'],'attributes':_0x180b16[_0x0827('0x21')],'include':_0x180b16[_0x0827('0x22')]?_[_0x0827('0x23')](_0x180b16[_0x0827('0x22')],function(_0x110342){return{'model':db[_0x110342['model']],'as':_0x110342['as'],'attributes':_0x110342[_0x0827('0x21')],'include':_0x110342[_0x0827('0x22')]?_[_0x0827('0x23')](_0x110342[_0x0827('0x22')],function(_0x559808){return{'model':db[_0x559808[_0x0827('0x24')]],'as':_0x559808['as'],'attributes':_0x559808[_0x0827('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x115003){logger[_0x0827('0x1b')](_0x0827('0x1d'),_0x48f576);logger[_0x0827('0x25')](_0x0827('0x1d'),_0x48f576,JSON['stringify'](_0x115003));_0x480cff(_0x115003);})['catch'](function(_0x3fea50){logger[_0x0827('0x17')](_0x0827('0x1d'),_0x3fea50[_0x0827('0x1a')],_0x48f576);_0x213b68(_0x5504dc[_0x0827('0x17')](0x1f4,_0x3fea50['message']));});});};exports[_0x0827('0x26')]=function(_0x5a7df4){var _0x35917d=this;return new Promise(function(_0x2bf0b7,_0x37b3f1){return db[_0x0827('0x1e')][_0x0827('0x27')](_0x5a7df4[_0x0827('0x28')],{'raw':_0x5a7df4[_0x0827('0x1f')]?_0x5a7df4[_0x0827('0x1f')][_0x0827('0x20')]===undefined?!![]:![]:!![]})[_0x0827('0x13')](function(_0x241418){var _0x549af6;for(var _0x28aab9=0x0;_0x28aab9<Object[_0x0827('0x29')](_0x5a7df4['body'])['length'];_0x28aab9++){var _0x119d4c=Object[_0x0827('0x29')](_0x5a7df4[_0x0827('0x28')])[_0x28aab9];if(_0x119d4c[_0x0827('0x2a')](_0x0827('0x2b'))){_0x549af6=squel[_0x0827('0x2c')]()[_0x0827('0x2d')](_0x0827('0x2e'))['set'](_0x119d4c,_0x5a7df4[_0x0827('0x28')][_0x119d4c])[_0x0827('0x2f')](_0x0827('0x30'),_0x241418['id'])[_0x0827('0x31')]();break;}}if(!_0x549af6)return _0x241418;return db['sequelize'][_0x0827('0x32')](_0x549af6)['then'](function(){return _0x241418;});})[_0x0827('0x13')](function(_0x2dfe2c){logger[_0x0827('0x1b')](_0x0827('0x26'),_0x5a7df4);logger['debug']('CreateCmContact',_0x5a7df4,JSON[_0x0827('0x16')](_0x2dfe2c));_0x2bf0b7(_0x2dfe2c);})[_0x0827('0x1c')](function(_0x2ec592){logger[_0x0827('0x17')](_0x0827('0x26'),_0x2ec592[_0x0827('0x1a')],_0x5a7df4);_0x37b3f1(_0x35917d[_0x0827('0x17')](0x1f4,_0x2ec592[_0x0827('0x1a')]));});});};
\ No newline at end of file
index 1431a11..42dd6e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 1970b44..2bb1882 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2976=['join','root','server/files/tmp','originalname','replace','format','basename','now','extname','/csv','file','uploadCsv','%s-%s%s','upload','/upload/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','/:id','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','merge','post','bulkCreate','setTags','diskStorage'];(function(_0xc1860,_0x5c719c){var _0x3e211a=function(_0x50d7a4){while(--_0x50d7a4){_0xc1860['push'](_0xc1860['shift']());}};_0x3e211a(++_0x5c719c);}(_0x2976,0xa3));var _0x6297=function(_0x1e51bd,_0x163cd4){_0x1e51bd=_0x1e51bd-0x0;var _0x15befb=_0x2976[_0x1e51bd];return _0x15befb;};'use strict';var multer=require(_0x6297('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6297('0x1'));var express=require(_0x6297('0x2'));var router=express[_0x6297('0x3')]();var fs_extra=require(_0x6297('0x4'));var auth=require(_0x6297('0x5'));var interaction=require(_0x6297('0x6'));var config=require(_0x6297('0x7'));var controller=require(_0x6297('0x8'));router[_0x6297('0x9')]('/',auth[_0x6297('0xa')](),controller['index']);router[_0x6297('0x9')](_0x6297('0xb'),auth[_0x6297('0xa')](),controller[_0x6297('0xc')]);router[_0x6297('0x9')](_0x6297('0xd'),auth[_0x6297('0xa')](),controller['show']);router['get'](_0x6297('0xe'),auth[_0x6297('0xa')](),controller[_0x6297('0xf')]);router[_0x6297('0x9')](_0x6297('0x10'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x6297('0x9')](_0x6297('0x11'),auth[_0x6297('0xa')](),controller['getHopperHistories']);router[_0x6297('0x9')](_0x6297('0x12'),auth[_0x6297('0xa')](),controller[_0x6297('0x13')]);router[_0x6297('0x9')](_0x6297('0x14'),auth['isAuthenticated'](),controller[_0x6297('0x15')]);router['get'](_0x6297('0x16'),auth['isAuthenticated'](),controller[_0x6297('0x17')]);router['post']('/merge',auth[_0x6297('0xa')](),controller[_0x6297('0x18')]);router[_0x6297('0x19')]('/',auth[_0x6297('0xa')](),controller['create']);router[_0x6297('0x19')]('/create_many',auth[_0x6297('0xa')](),controller[_0x6297('0x1a')]);router[_0x6297('0x19')]('/:id/tags',auth[_0x6297('0xa')](),controller[_0x6297('0x1b')]);var upload=multer({'storage':multer[_0x6297('0x1c')]({'destination':function(_0x4faacf,_0x58d0e9,_0x5f4fb0){_0x5f4fb0(null,path[_0x6297('0x1d')](config[_0x6297('0x1e')],_0x6297('0x1f')));},'filename':function(_0x586ccb,_0x2390e3,_0xb73b79){_0x2390e3[_0x6297('0x20')]=_0x2390e3[_0x6297('0x20')][_0x6297('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb73b79(null,util[_0x6297('0x22')]('%s-%s%s',path[_0x6297('0x23')](_0x2390e3[_0x6297('0x20')],path['extname'](_0x2390e3[_0x6297('0x20')])),Date[_0x6297('0x24')](),path[_0x6297('0x25')](_0x2390e3[_0x6297('0x20')])));}})});router['post'](_0x6297('0x26'),upload['single'](_0x6297('0x27')),controller[_0x6297('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4292b2,_0x34e418,_0x37f3aa){_0x37f3aa(null,path[_0x6297('0x1d')](config[_0x6297('0x1e')],_0x6297('0x1f')));},'filename':function(_0x26707f,_0xeef9b,_0x40e8e9){_0xeef9b[_0x6297('0x20')]=_0xeef9b[_0x6297('0x20')][_0x6297('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40e8e9(null,util[_0x6297('0x22')](_0x6297('0x29'),path[_0x6297('0x23')](_0xeef9b['originalname'],path[_0x6297('0x25')](_0xeef9b[_0x6297('0x20')])),Date[_0x6297('0x24')](),path[_0x6297('0x25')](_0xeef9b[_0x6297('0x20')])));}})});router[_0x6297('0x19')]('/upload',upload['single']('file'),controller[_0x6297('0x2a')]);router[_0x6297('0x19')](_0x6297('0x2b'),auth['isAuthenticated'](),controller['import']);router['put'](_0x6297('0xd'),auth[_0x6297('0xa')](),controller[_0x6297('0x2c')]);router[_0x6297('0x2d')](_0x6297('0xd'),auth['isAuthenticated'](),controller[_0x6297('0x2e')]);module[_0x6297('0x2f')]=router;
\ No newline at end of file
+var _0x1213=['now','/csv','single','uploadCsv','upload','/upload/:id','import','put','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContact.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','/:id/journey','getJourney','merge','post','create','/create_many','bulkCreate','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname'];(function(_0x3edf22,_0x499b95){var _0x1fd51e=function(_0xdeb3bc){while(--_0xdeb3bc){_0x3edf22['push'](_0x3edf22['shift']());}};_0x1fd51e(++_0x499b95);}(_0x1213,0x98));var _0x3121=function(_0x4e7abc,_0x2aeca1){_0x4e7abc=_0x4e7abc-0x0;var _0x428796=_0x1213[_0x4e7abc];return _0x428796;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3121('0x0'));var timeout=require(_0x3121('0x1'));var express=require('express');var router=express[_0x3121('0x2')]();var fs_extra=require(_0x3121('0x3'));var auth=require(_0x3121('0x4'));var interaction=require(_0x3121('0x5'));var config=require('../../config/environment');var controller=require(_0x3121('0x6'));router['get']('/',auth[_0x3121('0x7')](),controller[_0x3121('0x8')]);router['get'](_0x3121('0x9'),auth[_0x3121('0x7')](),controller[_0x3121('0xa')]);router[_0x3121('0xb')](_0x3121('0xc'),auth['isAuthenticated'](),controller[_0x3121('0xd')]);router[_0x3121('0xb')]('/:id/tags',auth[_0x3121('0x7')](),controller['getTags']);router[_0x3121('0xb')]('/:id/hoppers',auth[_0x3121('0x7')](),controller[_0x3121('0xe')]);router[_0x3121('0xb')](_0x3121('0xf'),auth[_0x3121('0x7')](),controller[_0x3121('0x10')]);router[_0x3121('0xb')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x3121('0x11')]);router['get'](_0x3121('0x12'),auth[_0x3121('0x7')](),controller['getJscriptySessions']);router['get'](_0x3121('0x13'),auth[_0x3121('0x7')](),controller[_0x3121('0x14')]);router['post']('/merge',auth[_0x3121('0x7')](),controller[_0x3121('0x15')]);router[_0x3121('0x16')]('/',auth[_0x3121('0x7')](),controller[_0x3121('0x17')]);router['post'](_0x3121('0x18'),auth[_0x3121('0x7')](),controller[_0x3121('0x19')]);router[_0x3121('0x16')]('/:id/tags',auth[_0x3121('0x7')](),controller['setTags']);var upload=multer({'storage':multer[_0x3121('0x1a')]({'destination':function(_0x5319ea,_0x588b9c,_0x30f422){_0x30f422(null,path[_0x3121('0x1b')](config[_0x3121('0x1c')],_0x3121('0x1d')));},'filename':function(_0x4aa92c,_0x41158f,_0x20c8f1){_0x41158f[_0x3121('0x1e')]=_0x41158f[_0x3121('0x1e')][_0x3121('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20c8f1(null,util[_0x3121('0x20')](_0x3121('0x21'),path[_0x3121('0x22')](_0x41158f[_0x3121('0x1e')],path[_0x3121('0x23')](_0x41158f['originalname'])),Date[_0x3121('0x24')](),path[_0x3121('0x23')](_0x41158f['originalname'])));}})});router[_0x3121('0x16')](_0x3121('0x25'),upload[_0x3121('0x26')]('file'),controller[_0x3121('0x27')]);var upload=multer({'storage':multer[_0x3121('0x1a')]({'destination':function(_0x1f4b18,_0x2c3f0f,_0x2dce19){_0x2dce19(null,path['join'](config[_0x3121('0x1c')],_0x3121('0x1d')));},'filename':function(_0x4485ce,_0x158569,_0x2a641c){_0x158569[_0x3121('0x1e')]=_0x158569[_0x3121('0x1e')][_0x3121('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2a641c(null,util[_0x3121('0x20')]('%s-%s%s',path[_0x3121('0x22')](_0x158569['originalname'],path[_0x3121('0x23')](_0x158569['originalname'])),Date[_0x3121('0x24')](),path[_0x3121('0x23')](_0x158569['originalname'])));}})});router[_0x3121('0x16')]('/upload',upload['single']('file'),controller[_0x3121('0x28')]);router[_0x3121('0x16')](_0x3121('0x29'),auth[_0x3121('0x7')](),controller[_0x3121('0x2a')]);router[_0x3121('0x2b')](_0x3121('0xc'),auth[_0x3121('0x7')](),controller[_0x3121('0x2c')]);router[_0x3121('0x2d')](_0x3121('0xc'),auth[_0x3121('0x7')](),controller[_0x3121('0x2e')]);module['exports']=router;
\ No newline at end of file
index 0667119..1fe5b03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc230=['sequelize','lodash','exports','getDataValue','STRING','setDataValue','alias','TEXT','long','select','parse','values','isArray','BOOLEAN','voice'];(function(_0x17159c,_0xeb7f01){var _0x3de8fb=function(_0x26c687){while(--_0x26c687){_0x17159c['push'](_0x17159c['shift']());}};_0x3de8fb(++_0xeb7f01);}(_0xc230,0xe1));var _0x0c23=function(_0x1392a8,_0x3bee86){_0x1392a8=_0x1392a8-0x0;var _0x1a00ba=_0xc230[_0x1392a8];return _0x1a00ba;};'use strict';var Sequelize=require(_0x0c23('0x0'));var _=require(_0x0c23('0x1'));module[_0x0c23('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5576dd){return this[_0x0c23('0x3')]('alias');}},'alias':{'type':Sequelize[_0x0c23('0x4')],'allowNull':![],'set':function(_0x318c2e){this[_0x0c23('0x5')](_0x0c23('0x6'),_0x318c2e?_0x318c2e:this[_0x0c23('0x3')]('name'));}},'type':{'type':Sequelize[_0x0c23('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x0c23('0x7')](_0x0c23('0x8')),'get':function(){if(this['getDataValue']('type')===_0x0c23('0x9')){return JSON[_0x0c23('0xa')](this[_0x0c23('0x3')](_0x0c23('0xb')));}else{return this['getDataValue'](_0x0c23('0xb'));}},'set':function(_0x34204b){if(Array[_0x0c23('0xc')](_0x34204b)){this[_0x0c23('0x5')]('values',JSON['stringify'](_0x34204b));}else{this['setDataValue']('values',_0x34204b);}}},'required':{'type':Sequelize[_0x0c23('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0c23('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x0c23('0xe'))}};
\ No newline at end of file
+var _0x22ce=['alias','getDataValue','name','TEXT','type','select','values','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','STRING','setDataValue'];(function(_0x5759fa,_0x4850ac){var _0x4bf7e2=function(_0x14cd2b){while(--_0x14cd2b){_0x5759fa['push'](_0x5759fa['shift']());}};_0x4bf7e2(++_0x4850ac);}(_0x22ce,0x14a));var _0xe22c=function(_0x495b2c,_0x4f5564){_0x495b2c=_0x495b2c-0x0;var _0x1f99da=_0x22ce[_0x495b2c];return _0x1f99da;};'use strict';var Sequelize=require(_0xe22c('0x0'));var _=require(_0xe22c('0x1'));module[_0xe22c('0x2')]={'name':{'type':Sequelize[_0xe22c('0x3')],'get':function(_0x1463aa){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xe22c('0x4')],'allowNull':![],'set':function(_0x31a32c){this[_0xe22c('0x5')](_0xe22c('0x6'),_0x31a32c?_0x31a32c:this[_0xe22c('0x7')](_0xe22c('0x8')));}},'type':{'type':Sequelize[_0xe22c('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xe22c('0x9')]('long'),'get':function(){if(this[_0xe22c('0x7')](_0xe22c('0xa'))===_0xe22c('0xb')){return JSON['parse'](this[_0xe22c('0x7')](_0xe22c('0xc')));}else{return this['getDataValue'](_0xe22c('0xc'));}},'set':function(_0x3cfc55){if(Array['isArray'](_0x3cfc55)){this['setDataValue'](_0xe22c('0xc'),JSON['stringify'](_0x3cfc55));}else{this[_0xe22c('0x5')](_0xe22c('0xc'),_0x3cfc55);}}},'required':{'type':Sequelize[_0xe22c('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe22c('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe22c('0xe')](_0xe22c('0xf'))}};
\ No newline at end of file
index bc933a1..c4f6f0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47bb=['filter','VIRTUAL','merge','options','CmCustomField','includeAll','include','findAll','catch','params','keys','rawAttributes','body','find','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','rimraf','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','name','send','type','key','model','differenceBy','map','query','filters','intersection','attributes','fields','order','sort','where'];(function(_0x2c8d85,_0x590fef){var _0x277ef4=function(_0x7c7a91){while(--_0x7c7a91){_0x2c8d85['push'](_0x2c8d85['shift']());}};_0x277ef4(++_0x590fef);}(_0x47bb,0x1ca));var _0xb47b=function(_0x25fded,_0x34216e){_0x25fded=_0x25fded-0x0;var _0x269156=_0x47bb[_0x25fded];return _0x269156;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb47b('0x0'));var zipdir=require(_0xb47b('0x1'));var jsonpatch=require(_0xb47b('0x2'));var rp=require(_0xb47b('0x3'));var moment=require(_0xb47b('0x4'));var BPromise=require(_0xb47b('0x5'));var Mustache=require(_0xb47b('0x6'));var util=require(_0xb47b('0x7'));var path=require(_0xb47b('0x8'));var sox=require(_0xb47b('0x9'));var csv=require(_0xb47b('0xa'));var ejs=require(_0xb47b('0xb'));var fs=require('fs');var fs_extra=require(_0xb47b('0xc'));var _=require(_0xb47b('0xd'));var squel=require(_0xb47b('0xe'));var crypto=require(_0xb47b('0xf'));var jsforce=require(_0xb47b('0x10'));var deskjs=require(_0xb47b('0x11'));var toCsv=require(_0xb47b('0xa'));var querystring=require(_0xb47b('0x12'));var Papa=require(_0xb47b('0x13'));var Redis=require(_0xb47b('0x14'));var authService=require(_0xb47b('0x15'));var qs=require(_0xb47b('0x16'));var as=require(_0xb47b('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb47b('0x18'));var utils=require(_0xb47b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb47b('0x1a'));var db=require(_0xb47b('0x1b'))['db'];function respondWithStatusCode(_0x406890,_0x5969ae){_0x5969ae=_0x5969ae||0xcc;return function(_0x2b0725){if(_0x2b0725){return _0x406890[_0xb47b('0x1c')](_0x5969ae);}return _0x406890[_0xb47b('0x1d')](_0x5969ae)[_0xb47b('0x1e')]();};}function respondWithResult(_0x542cbf,_0x3071af){_0x3071af=_0x3071af||0xc8;return function(_0x2a04b5){if(_0x2a04b5){return _0x542cbf[_0xb47b('0x1d')](_0x3071af)[_0xb47b('0x1f')](_0x2a04b5);}};}function respondWithFilteredResult(_0x5ca24d,_0x371cc3){return function(_0x1fb170){if(_0x1fb170){var _0x192e79=typeof _0x371cc3[_0xb47b('0x20')]===_0xb47b('0x21')&&typeof _0x371cc3[_0xb47b('0x22')]===_0xb47b('0x21');var _0x4f8fb6=_0x1fb170['count'];var _0x219ca1=_0x192e79?0x0:_0x371cc3[_0xb47b('0x20')];var _0x51c627=_0x192e79?_0x1fb170[_0xb47b('0x23')]:_0x371cc3[_0xb47b('0x20')]+_0x371cc3['limit'];var _0x1225ec;if(_0x51c627>=_0x4f8fb6){_0x51c627=_0x4f8fb6;_0x1225ec=0xc8;}else{_0x1225ec=0xce;}_0x5ca24d[_0xb47b('0x1d')](_0x1225ec);return _0x5ca24d['set'](_0xb47b('0x24'),_0x219ca1+'-'+_0x51c627+'/'+_0x4f8fb6)[_0xb47b('0x1f')](_0x1fb170);}return null;};}function patchUpdates(_0x75137){return function(_0x3a989d){try{jsonpatch[_0xb47b('0x25')](_0x3a989d,_0x75137,!![]);}catch(_0x20ad2d){return BPromise[_0xb47b('0x26')](_0x20ad2d);}return _0x3a989d['save']();};}function saveUpdates(_0xdfae9e,_0x4d2f10){return function(_0x4314cb){if(_0x4314cb){return _0x4314cb[_0xb47b('0x27')](_0xdfae9e)['then'](function(_0x423f86){return _0x423f86;});}return null;};}function removeEntity(_0x929f09,_0x51c0d2){return function(_0x478d63){if(_0x478d63){return _0x478d63[_0xb47b('0x28')]()[_0xb47b('0x29')](function(){_0x929f09[_0xb47b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb2a86,_0x587819){return function(_0x90f5d5){if(!_0x90f5d5){_0xdb2a86[_0xb47b('0x1c')](0x194);}return _0x90f5d5;};}function handleError(_0x178675,_0x323ead){_0x323ead=_0x323ead||0x1f4;return function(_0x43b43b){logger[_0xb47b('0x2a')](_0x43b43b['stack']);if(_0x43b43b[_0xb47b('0x2b')]){delete _0x43b43b[_0xb47b('0x2b')];}_0x178675[_0xb47b('0x1d')](_0x323ead)[_0xb47b('0x2c')](_0x43b43b);};}exports['index']=function(_0x4eb2cc,_0x750f3e){var _0x504cb8={},_0x424118={},_0x5a8d90={'count':0x0,'rows':[]};var _0x50a063=_['map'](db['CmCustomField']['rawAttributes'],function(_0x5b52bb){return{'name':_0x5b52bb['fieldName'],'type':_0x5b52bb[_0xb47b('0x2d')][_0xb47b('0x2e')]};});_0x424118[_0xb47b('0x2f')]=_[_0xb47b('0x30')](_[_0xb47b('0x31')](_0x50a063,_0xb47b('0x2b')),[_0xb47b('0x2b')]);_0x424118['query']=_['keys'](_0x4eb2cc[_0xb47b('0x32')]);_0x424118[_0xb47b('0x33')]=_[_0xb47b('0x34')](_0x424118[_0xb47b('0x2f')],_0x424118[_0xb47b('0x32')]);_0x504cb8[_0xb47b('0x35')]=_[_0xb47b('0x34')](_0x424118[_0xb47b('0x2f')],qs[_0xb47b('0x36')](_0x4eb2cc['query'][_0xb47b('0x36')]));_0x504cb8[_0xb47b('0x35')]=_0x504cb8[_0xb47b('0x35')]['length']?_0x504cb8[_0xb47b('0x35')]:_0x424118[_0xb47b('0x2f')];if(!_0x4eb2cc[_0xb47b('0x32')]['hasOwnProperty']('nolimit')){_0x504cb8[_0xb47b('0x22')]=qs[_0xb47b('0x22')](_0x4eb2cc[_0xb47b('0x32')][_0xb47b('0x22')]);_0x504cb8[_0xb47b('0x20')]=qs[_0xb47b('0x20')](_0x4eb2cc[_0xb47b('0x32')][_0xb47b('0x20')]);}_0x504cb8[_0xb47b('0x37')]=qs[_0xb47b('0x38')](_0x4eb2cc[_0xb47b('0x32')][_0xb47b('0x38')]);_0x504cb8[_0xb47b('0x39')]=qs[_0xb47b('0x33')](_['pick'](_0x4eb2cc[_0xb47b('0x32')],_0x424118['filters']),_0x50a063);if(_0x4eb2cc[_0xb47b('0x32')][_0xb47b('0x3a')]){_0x504cb8[_0xb47b('0x39')]=_['merge'](_0x504cb8['where'],{'$or':_[_0xb47b('0x31')](_0x50a063,function(_0x2c0a0c){if(_0x2c0a0c[_0xb47b('0x2d')]!==_0xb47b('0x3b')){var _0x20fef={};_0x20fef[_0x2c0a0c[_0xb47b('0x2b')]]={'$like':'%'+_0x4eb2cc['query'][_0xb47b('0x3a')]+'%'};return _0x20fef;}})});}_0x504cb8=_[_0xb47b('0x3c')]({},_0x504cb8,_0x4eb2cc[_0xb47b('0x3d')]);var _0x598d9d={'where':_0x504cb8[_0xb47b('0x39')]};return db[_0xb47b('0x3e')][_0xb47b('0x23')](_0x598d9d)['then'](function(_0x28b16c){_0x5a8d90['count']=_0x28b16c;if(_0x4eb2cc[_0xb47b('0x32')][_0xb47b('0x3f')]){_0x504cb8[_0xb47b('0x40')]=[{'all':!![]}];}return db[_0xb47b('0x3e')][_0xb47b('0x41')](_0x504cb8);})[_0xb47b('0x29')](function(_0x1142fb){_0x5a8d90['rows']=_0x1142fb;return _0x5a8d90;})['then'](respondWithFilteredResult(_0x750f3e,_0x504cb8))[_0xb47b('0x42')](handleError(_0x750f3e,null));};exports['show']=function(_0x1c9ba4,_0x31500e){var _0x1d2714={'raw':!![],'where':{'id':_0x1c9ba4[_0xb47b('0x43')]['id']}},_0x3401ac={};_0x3401ac[_0xb47b('0x2f')]=_[_0xb47b('0x44')](db['CmCustomField'][_0xb47b('0x45')]);_0x3401ac['query']=_[_0xb47b('0x44')](_0x1c9ba4[_0xb47b('0x32')]);_0x3401ac[_0xb47b('0x33')]=_[_0xb47b('0x34')](_0x3401ac['model'],_0x3401ac[_0xb47b('0x32')]);_0x1d2714['attributes']=_[_0xb47b('0x34')](_0x3401ac[_0xb47b('0x2f')],qs[_0xb47b('0x36')](_0x1c9ba4[_0xb47b('0x32')][_0xb47b('0x36')]));_0x1d2714[_0xb47b('0x35')]=_0x1d2714[_0xb47b('0x35')]['length']?_0x1d2714[_0xb47b('0x35')]:_0x3401ac[_0xb47b('0x2f')];if(_0x1c9ba4[_0xb47b('0x32')]['includeAll']){_0x1d2714[_0xb47b('0x40')]=[{'all':!![]}];}_0x1d2714=_[_0xb47b('0x3c')]({},_0x1d2714,_0x1c9ba4['options']);return db['CmCustomField']['find'](_0x1d2714)[_0xb47b('0x29')](handleEntityNotFound(_0x31500e,null))['then'](respondWithResult(_0x31500e,null))[_0xb47b('0x42')](handleError(_0x31500e,null));};exports[_0xb47b('0x27')]=function(_0x24294e,_0x2a6b88){if(_0x24294e[_0xb47b('0x46')]['id']){delete _0x24294e[_0xb47b('0x46')]['id'];}return db[_0xb47b('0x3e')][_0xb47b('0x47')]({'where':{'id':_0x24294e['params']['id']}})[_0xb47b('0x29')](handleEntityNotFound(_0x2a6b88,null))[_0xb47b('0x29')](saveUpdates(_0x24294e[_0xb47b('0x46')],null))[_0xb47b('0x29')](respondWithResult(_0x2a6b88,null))[_0xb47b('0x42')](handleError(_0x2a6b88,null));};exports[_0xb47b('0x28')]=function(_0x36fc40,_0xcfa003){return db['CmCustomField']['find']({'where':{'id':_0x36fc40['params']['id']}})[_0xb47b('0x29')](handleEntityNotFound(_0xcfa003,null))[_0xb47b('0x29')](removeEntity(_0xcfa003,null))[_0xb47b('0x42')](handleError(_0xcfa003,null));};exports[_0xb47b('0x48')]=function(_0x14337a,_0x2ecbce){var _0x41a7bb;return db[_0xb47b('0x49')][_0xb47b('0x4a')](function(_0xb29dcb){return db[_0xb47b('0x3e')][_0xb47b('0x48')](_0x14337a[_0xb47b('0x46')],{'transaction':_0xb29dcb})[_0xb47b('0x29')](function(_0x4bd9b9){_0x41a7bb=_0x4bd9b9;var _0x1eab97={'type':db[_0xb47b('0x4b')][_0xb47b('0x4c')],'transaction':_0xb29dcb};switch(_0x14337a[_0xb47b('0x46')][_0xb47b('0x2d')]){case _0xb47b('0x4d'):_0x1eab97[_0xb47b('0x2d')]=db[_0xb47b('0x4b')][_0xb47b('0x4c')];break;case _0xb47b('0x4e'):_0x1eab97['type']=db[_0xb47b('0x4b')][_0xb47b('0x4f')];break;case _0xb47b('0x50'):_0x1eab97[_0xb47b('0x2d')]=db[_0xb47b('0x4b')]['BOOLEAN'];_0x1eab97[_0xb47b('0x51')]=![];break;default:}return db[_0xb47b('0x49')][_0xb47b('0x52')][_0xb47b('0x53')](_0xb47b('0x54'),util['format'](_0xb47b('0x55'),_0x41a7bb['id']),_0x1eab97);})[_0xb47b('0x29')](function(){return _0x41a7bb;});})['then'](respondWithResult(_0x2ecbce,0xc9))[_0xb47b('0x42')](handleError(_0x2ecbce,null));};
\ No newline at end of file
+var _0x6385=['Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','include','find','params','body','create','sequelize','transaction'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6385,0x162));var _0x5638=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x6385[_0x3ce2c4];return _0x4047c1;};'use strict';var emlformat=require(_0x5638('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5638('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5638('0x2'));var BPromise=require(_0x5638('0x3'));var Mustache=require(_0x5638('0x4'));var util=require(_0x5638('0x5'));var path=require(_0x5638('0x6'));var sox=require(_0x5638('0x7'));var csv=require(_0x5638('0x8'));var ejs=require(_0x5638('0x9'));var fs=require('fs');var fs_extra=require(_0x5638('0xa'));var _=require(_0x5638('0xb'));var squel=require(_0x5638('0xc'));var crypto=require(_0x5638('0xd'));var jsforce=require(_0x5638('0xe'));var deskjs=require(_0x5638('0xf'));var toCsv=require(_0x5638('0x8'));var querystring=require(_0x5638('0x10'));var Papa=require(_0x5638('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5638('0x12'));var as=require(_0x5638('0x13'));var hardwareService=require(_0x5638('0x14'));var logger=require('../../config/logger')(_0x5638('0x15'));var utils=require('../../config/utils');var config=require(_0x5638('0x16'));var licenseUtil=require(_0x5638('0x17'));var db=require(_0x5638('0x18'))['db'];function respondWithStatusCode(_0x538ee6,_0x124671){_0x124671=_0x124671||0xcc;return function(_0x548d3e){if(_0x548d3e){return _0x538ee6[_0x5638('0x19')](_0x124671);}return _0x538ee6[_0x5638('0x1a')](_0x124671)[_0x5638('0x1b')]();};}function respondWithResult(_0x1794f5,_0x1bc8c3){_0x1bc8c3=_0x1bc8c3||0xc8;return function(_0x49a0a0){if(_0x49a0a0){return _0x1794f5[_0x5638('0x1a')](_0x1bc8c3)[_0x5638('0x1c')](_0x49a0a0);}};}function respondWithFilteredResult(_0x4f4438,_0x42e908){return function(_0x83e1bb){if(_0x83e1bb){var _0x55c886=typeof _0x42e908['offset']===_0x5638('0x1d')&&typeof _0x42e908[_0x5638('0x1e')]===_0x5638('0x1d');var _0x4943ea=_0x83e1bb[_0x5638('0x1f')];var _0x3c8549=_0x55c886?0x0:_0x42e908[_0x5638('0x20')];var _0x21a7e5=_0x55c886?_0x83e1bb[_0x5638('0x1f')]:_0x42e908[_0x5638('0x20')]+_0x42e908[_0x5638('0x1e')];var _0x5160ff;if(_0x21a7e5>=_0x4943ea){_0x21a7e5=_0x4943ea;_0x5160ff=0xc8;}else{_0x5160ff=0xce;}_0x4f4438[_0x5638('0x1a')](_0x5160ff);return _0x4f4438[_0x5638('0x21')](_0x5638('0x22'),_0x3c8549+'-'+_0x21a7e5+'/'+_0x4943ea)[_0x5638('0x1c')](_0x83e1bb);}return null;};}function patchUpdates(_0x1e7594){return function(_0x5cb289){try{jsonpatch['apply'](_0x5cb289,_0x1e7594,!![]);}catch(_0x1d8f37){return BPromise[_0x5638('0x23')](_0x1d8f37);}return _0x5cb289[_0x5638('0x24')]();};}function saveUpdates(_0x32a318,_0x320ef8){return function(_0x1fdd8d){if(_0x1fdd8d){return _0x1fdd8d['update'](_0x32a318)[_0x5638('0x25')](function(_0x211ba8){return _0x211ba8;});}return null;};}function removeEntity(_0x43560c,_0x1440a6){return function(_0x4dfd43){if(_0x4dfd43){return _0x4dfd43[_0x5638('0x26')]()[_0x5638('0x25')](function(){_0x43560c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e85b6,_0x98b98a){return function(_0x59d4ba){if(!_0x59d4ba){_0x4e85b6[_0x5638('0x19')](0x194);}return _0x59d4ba;};}function handleError(_0x3943c7,_0x1ecb57){_0x1ecb57=_0x1ecb57||0x1f4;return function(_0x1597eb){logger['error'](_0x1597eb[_0x5638('0x27')]);if(_0x1597eb[_0x5638('0x28')]){delete _0x1597eb[_0x5638('0x28')];}_0x3943c7['status'](_0x1ecb57)[_0x5638('0x29')](_0x1597eb);};}exports['index']=function(_0xab5260,_0xe5245a){var _0x28856b={},_0x3dbc1b={},_0x4abe71={'count':0x0,'rows':[]};var _0x3e0183=_[_0x5638('0x2a')](db[_0x5638('0x2b')][_0x5638('0x2c')],function(_0xa862b5){return{'name':_0xa862b5[_0x5638('0x2d')],'type':_0xa862b5[_0x5638('0x2e')]['key']};});_0x3dbc1b[_0x5638('0x2f')]=_[_0x5638('0x30')](_[_0x5638('0x2a')](_0x3e0183,'name'),['name']);_0x3dbc1b['query']=_[_0x5638('0x31')](_0xab5260[_0x5638('0x32')]);_0x3dbc1b[_0x5638('0x33')]=_[_0x5638('0x34')](_0x3dbc1b['model'],_0x3dbc1b[_0x5638('0x32')]);_0x28856b[_0x5638('0x35')]=_[_0x5638('0x34')](_0x3dbc1b[_0x5638('0x2f')],qs[_0x5638('0x36')](_0xab5260['query'][_0x5638('0x36')]));_0x28856b[_0x5638('0x35')]=_0x28856b['attributes'][_0x5638('0x37')]?_0x28856b[_0x5638('0x35')]:_0x3dbc1b[_0x5638('0x2f')];if(!_0xab5260[_0x5638('0x32')]['hasOwnProperty'](_0x5638('0x38'))){_0x28856b[_0x5638('0x1e')]=qs[_0x5638('0x1e')](_0xab5260[_0x5638('0x32')][_0x5638('0x1e')]);_0x28856b[_0x5638('0x20')]=qs[_0x5638('0x20')](_0xab5260[_0x5638('0x32')][_0x5638('0x20')]);}_0x28856b[_0x5638('0x39')]=qs[_0x5638('0x3a')](_0xab5260['query'][_0x5638('0x3a')]);_0x28856b['where']=qs[_0x5638('0x33')](_[_0x5638('0x3b')](_0xab5260['query'],_0x3dbc1b[_0x5638('0x33')]),_0x3e0183);if(_0xab5260[_0x5638('0x32')][_0x5638('0x3c')]){_0x28856b[_0x5638('0x3d')]=_['merge'](_0x28856b[_0x5638('0x3d')],{'$or':_[_0x5638('0x2a')](_0x3e0183,function(_0x3c5339){if(_0x3c5339[_0x5638('0x2e')]!==_0x5638('0x3e')){var _0x502766={};_0x502766[_0x3c5339['name']]={'$like':'%'+_0xab5260[_0x5638('0x32')][_0x5638('0x3c')]+'%'};return _0x502766;}})});}_0x28856b=_[_0x5638('0x3f')]({},_0x28856b,_0xab5260[_0x5638('0x40')]);var _0x4f3681={'where':_0x28856b[_0x5638('0x3d')]};return db[_0x5638('0x2b')][_0x5638('0x1f')](_0x4f3681)[_0x5638('0x25')](function(_0x413a90){_0x4abe71['count']=_0x413a90;if(_0xab5260['query'][_0x5638('0x41')]){_0x28856b['include']=[{'all':!![]}];}return db['CmCustomField'][_0x5638('0x42')](_0x28856b);})[_0x5638('0x25')](function(_0x1229b3){_0x4abe71[_0x5638('0x43')]=_0x1229b3;return _0x4abe71;})[_0x5638('0x25')](respondWithFilteredResult(_0xe5245a,_0x28856b))[_0x5638('0x44')](handleError(_0xe5245a,null));};exports['show']=function(_0xd6e79c,_0x1ad0b3){var _0x4752c0={'raw':!![],'where':{'id':_0xd6e79c['params']['id']}},_0x761322={};_0x761322[_0x5638('0x2f')]=_[_0x5638('0x31')](db[_0x5638('0x2b')][_0x5638('0x2c')]);_0x761322[_0x5638('0x32')]=_[_0x5638('0x31')](_0xd6e79c[_0x5638('0x32')]);_0x761322[_0x5638('0x33')]=_[_0x5638('0x34')](_0x761322[_0x5638('0x2f')],_0x761322[_0x5638('0x32')]);_0x4752c0['attributes']=_[_0x5638('0x34')](_0x761322[_0x5638('0x2f')],qs[_0x5638('0x36')](_0xd6e79c[_0x5638('0x32')][_0x5638('0x36')]));_0x4752c0[_0x5638('0x35')]=_0x4752c0[_0x5638('0x35')]['length']?_0x4752c0[_0x5638('0x35')]:_0x761322[_0x5638('0x2f')];if(_0xd6e79c[_0x5638('0x32')][_0x5638('0x41')]){_0x4752c0[_0x5638('0x45')]=[{'all':!![]}];}_0x4752c0=_[_0x5638('0x3f')]({},_0x4752c0,_0xd6e79c[_0x5638('0x40')]);return db[_0x5638('0x2b')][_0x5638('0x46')](_0x4752c0)[_0x5638('0x25')](handleEntityNotFound(_0x1ad0b3,null))[_0x5638('0x25')](respondWithResult(_0x1ad0b3,null))['catch'](handleError(_0x1ad0b3,null));};exports['update']=function(_0x32435c,_0x2b6431){if(_0x32435c['body']['id']){delete _0x32435c['body']['id'];}return db[_0x5638('0x2b')]['find']({'where':{'id':_0x32435c[_0x5638('0x47')]['id']}})[_0x5638('0x25')](handleEntityNotFound(_0x2b6431,null))[_0x5638('0x25')](saveUpdates(_0x32435c[_0x5638('0x48')],null))['then'](respondWithResult(_0x2b6431,null))['catch'](handleError(_0x2b6431,null));};exports['destroy']=function(_0x54a18f,_0x5e7257){return db[_0x5638('0x2b')][_0x5638('0x46')]({'where':{'id':_0x54a18f['params']['id']}})[_0x5638('0x25')](handleEntityNotFound(_0x5e7257,null))[_0x5638('0x25')](removeEntity(_0x5e7257,null))[_0x5638('0x44')](handleError(_0x5e7257,null));};exports[_0x5638('0x49')]=function(_0x5e0dae,_0x460ea4){var _0x8caed;return db[_0x5638('0x4a')][_0x5638('0x4b')](function(_0x5c8ccc){return db[_0x5638('0x2b')][_0x5638('0x49')](_0x5e0dae[_0x5638('0x48')],{'transaction':_0x5c8ccc})[_0x5638('0x25')](function(_0x37cac1){_0x8caed=_0x37cac1;var _0x331bc8={'type':db[_0x5638('0x4c')][_0x5638('0x4d')],'transaction':_0x5c8ccc};switch(_0x5e0dae['body'][_0x5638('0x2e')]){case _0x5638('0x4e'):_0x331bc8[_0x5638('0x2e')]=db[_0x5638('0x4c')][_0x5638('0x4d')];break;case _0x5638('0x4f'):_0x331bc8[_0x5638('0x2e')]=db[_0x5638('0x4c')][_0x5638('0x50')];break;case'switch':_0x331bc8['type']=db['Sequelize'][_0x5638('0x51')];_0x331bc8[_0x5638('0x52')]=![];break;default:}return db[_0x5638('0x4a')][_0x5638('0x53')]['addColumn'](_0x5638('0x54'),util[_0x5638('0x55')]('cf_%d',_0x8caed['id']),_0x331bc8);})[_0x5638('0x25')](function(){return _0x8caed;});})[_0x5638('0x25')](respondWithResult(_0x460ea4,0xc9))[_0x5638('0x44')](handleError(_0x460ea4,null));};
\ No newline at end of file
index 8b48844..0321a37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7394=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','bluebird'];(function(_0x35acb8,_0x2aac0c){var _0x526b12=function(_0x3bd649){while(--_0x3bd649){_0x35acb8['push'](_0x35acb8['shift']());}};_0x526b12(++_0x2aac0c);}(_0x7394,0x95));var _0x4739=function(_0x2c93dd,_0x14c99a){_0x2c93dd=_0x2c93dd-0x0;var _0x3cb77c=_0x7394[_0x2c93dd];return _0x3cb77c;};'use strict';var _=require(_0x4739('0x0'));var util=require(_0x4739('0x1'));var logger=require(_0x4739('0x2'))(_0x4739('0x3'));var moment=require('moment');var BPromise=require(_0x4739('0x4'));var rp=require(_0x4739('0x5'));var fs=require('fs');var path=require(_0x4739('0x6'));var rimraf=require(_0x4739('0x7'));var config=require(_0x4739('0x8'));var attributes=require(_0x4739('0x9'));module[_0x4739('0xa')]=function(_0x53e6d4,_0x3a1830){return _0x53e6d4[_0x4739('0xb')](_0x4739('0xc'),attributes,{'tableName':_0x4739('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x646e=['api','moment','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x646e,0x1aa));var _0xe646=function(_0x3c938d,_0x5aaa3f){_0x3c938d=_0x3c938d-0x0;var _0xbd5d3a=_0x646e[_0x3c938d];return _0xbd5d3a;};'use strict';var _=require(_0xe646('0x0'));var util=require(_0xe646('0x1'));var logger=require(_0xe646('0x2'))(_0xe646('0x3'));var moment=require(_0xe646('0x4'));var BPromise=require('bluebird');var rp=require(_0xe646('0x5'));var fs=require('fs');var path=require(_0xe646('0x6'));var rimraf=require('rimraf');var config=require(_0xe646('0x7'));var attributes=require(_0xe646('0x8'));module[_0xe646('0x9')]=function(_0x562a97,_0x1f748a){return _0x562a97[_0xe646('0xa')](_0xe646('0xb'),attributes,{'tableName':_0xe646('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8e5d013..7ee3ce5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5940=['../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3c6bbd,_0x57a608){var _0x2f63ce=function(_0x24f4d3){while(--_0x24f4d3){_0x3c6bbd['push'](_0x3c6bbd['shift']());}};_0x2f63ce(++_0x57a608);}(_0x5940,0x118));var _0x0594=function(_0x2009a4,_0xec46d5){_0x2009a4=_0x2009a4-0x0;var _0x745ea1=_0x5940[_0x2009a4];return _0x745ea1;};'use strict';var _=require('lodash');var util=require(_0x0594('0x0'));var moment=require('moment');var BPromise=require(_0x0594('0x1'));var rs=require(_0x0594('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0594('0x3'))['db'];var utils=require(_0x0594('0x4'));var logger=require(_0x0594('0x5'))('rpc');var config=require(_0x0594('0x6'));var jayson=require(_0x0594('0x7'));var client=jayson[_0x0594('0x8')][_0x0594('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dca25,_0x245d5e,_0x5acce2){return new BPromise(function(_0x30efb5,_0x3401f0){return client[_0x0594('0xa')](_0x4dca25,_0x5acce2)[_0x0594('0xb')](function(_0x53cb20){logger[_0x0594('0xc')](_0x0594('0xd'),_0x245d5e,_0x0594('0xe'));logger[_0x0594('0xf')](_0x0594('0x10'),_0x245d5e,'request\x20sent',JSON[_0x0594('0x11')](_0x53cb20));if(_0x53cb20[_0x0594('0x12')]){if(_0x53cb20['error'][_0x0594('0x13')]===0x1f4){logger[_0x0594('0x12')](_0x0594('0xd'),_0x245d5e,_0x53cb20['error'][_0x0594('0x14')]);return _0x3401f0(_0x53cb20[_0x0594('0x12')][_0x0594('0x14')]);}logger[_0x0594('0x12')](_0x0594('0xd'),_0x245d5e,_0x53cb20[_0x0594('0x12')][_0x0594('0x14')]);return _0x30efb5(_0x53cb20[_0x0594('0x12')][_0x0594('0x14')]);}else{logger[_0x0594('0xc')]('CmCustomField,\x20%s,\x20%s',_0x245d5e,_0x0594('0xe'));_0x30efb5(_0x53cb20['result']['message']);}})[_0x0594('0x15')](function(_0x3ca69b){logger[_0x0594('0x12')](_0x0594('0xd'),_0x245d5e,_0x3ca69b);_0x3401f0(_0x3ca69b);});});}
\ No newline at end of file
+var _0x1ee0=['info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','client','request','then'];(function(_0x2b3be7,_0x564b63){var _0x2bd0c2=function(_0x49c735){while(--_0x49c735){_0x2b3be7['push'](_0x2b3be7['shift']());}};_0x2bd0c2(++_0x564b63);}(_0x1ee0,0xfb));var _0x01ee=function(_0x2f86bd,_0x24e6f4){_0x2f86bd=_0x2f86bd-0x0;var _0x7d42e6=_0x1ee0[_0x2f86bd];return _0x7d42e6;};'use strict';var _=require(_0x01ee('0x0'));var util=require(_0x01ee('0x1'));var moment=require(_0x01ee('0x2'));var BPromise=require(_0x01ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x01ee('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x01ee('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x362641,_0x2453fe,_0x149016){return new BPromise(function(_0x3c90f5,_0x288745){return client[_0x01ee('0x7')](_0x362641,_0x149016)[_0x01ee('0x8')](function(_0x5204b5){logger[_0x01ee('0x9')](_0x01ee('0xa'),_0x2453fe,'request\x20sent');logger[_0x01ee('0xb')](_0x01ee('0xc'),_0x2453fe,'request\x20sent',JSON[_0x01ee('0xd')](_0x5204b5));if(_0x5204b5[_0x01ee('0xe')]){if(_0x5204b5[_0x01ee('0xe')][_0x01ee('0xf')]===0x1f4){logger[_0x01ee('0xe')](_0x01ee('0xa'),_0x2453fe,_0x5204b5[_0x01ee('0xe')][_0x01ee('0x10')]);return _0x288745(_0x5204b5[_0x01ee('0xe')][_0x01ee('0x10')]);}logger[_0x01ee('0xe')](_0x01ee('0xa'),_0x2453fe,_0x5204b5[_0x01ee('0xe')][_0x01ee('0x10')]);return _0x3c90f5(_0x5204b5[_0x01ee('0xe')]['message']);}else{logger[_0x01ee('0x9')](_0x01ee('0xa'),_0x2453fe,_0x01ee('0x11'));_0x3c90f5(_0x5204b5[_0x01ee('0x12')][_0x01ee('0x10')]);}})[_0x01ee('0x13')](function(_0x448e06){logger['error']('CmCustomField,\x20%s,\x20%s',_0x2453fe,_0x448e06);_0x288745(_0x448e06);});});}
\ No newline at end of file
index d10e6db..36b9185 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc8d=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x17d3b4,_0x2e302a){var _0x338173=function(_0x57e383){while(--_0x57e383){_0x17d3b4['push'](_0x17d3b4['shift']());}};_0x338173(++_0x2e302a);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdbc8('0x0'));var util=require('util');var path=require(_0xdbc8('0x1'));var timeout=require(_0xdbc8('0x2'));var express=require(_0xdbc8('0x3'));var router=express[_0xdbc8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdbc8('0x5'));var interaction=require(_0xdbc8('0x6'));var config=require(_0xdbc8('0x7'));var controller=require('./cmCustomField.controller');router[_0xdbc8('0x8')]('/',auth[_0xdbc8('0x9')](),controller[_0xdbc8('0xa')]);router['get'](_0xdbc8('0xb'),auth['isAuthenticated'](),controller[_0xdbc8('0xc')]);router[_0xdbc8('0xd')]('/',auth['isAuthenticated'](),controller[_0xdbc8('0xe')]);router[_0xdbc8('0xf')](_0xdbc8('0xb'),auth[_0xdbc8('0x9')](),controller[_0xdbc8('0x10')]);router[_0xdbc8('0x11')](_0xdbc8('0xb'),auth[_0xdbc8('0x9')](),controller[_0xdbc8('0x12')]);module[_0xdbc8('0x13')]=router;
\ No newline at end of file
+var _0x9dbe=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3c9159,_0x58f463){var _0x3a6f26=function(_0x57c4f7){while(--_0x57c4f7){_0x3c9159['push'](_0x3c9159['shift']());}};_0x3a6f26(++_0x58f463);}(_0x9dbe,0x174));var _0xe9db=function(_0x545cc0,_0xcc3dbe){_0x545cc0=_0x545cc0-0x0;var _0x1844cb=_0x9dbe[_0x545cc0];return _0x1844cb;};'use strict';var multer=require(_0xe9db('0x0'));var util=require(_0xe9db('0x1'));var path=require(_0xe9db('0x2'));var timeout=require(_0xe9db('0x3'));var express=require(_0xe9db('0x4'));var router=express[_0xe9db('0x5')]();var fs_extra=require(_0xe9db('0x6'));var auth=require(_0xe9db('0x7'));var interaction=require(_0xe9db('0x8'));var config=require(_0xe9db('0x9'));var controller=require(_0xe9db('0xa'));router[_0xe9db('0xb')]('/',auth[_0xe9db('0xc')](),controller['index']);router['get']('/:id',auth[_0xe9db('0xc')](),controller[_0xe9db('0xd')]);router['post']('/',auth[_0xe9db('0xc')](),controller[_0xe9db('0xe')]);router[_0xe9db('0xf')](_0xe9db('0x10'),auth[_0xe9db('0xc')](),controller['update']);router['delete'](_0xe9db('0x10'),auth[_0xe9db('0xc')](),controller['destroy']);module[_0xe9db('0x11')]=router;
\ No newline at end of file
index 39cce94..dd1c900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x2bdf8a,_0x2efd9d){var _0x107984=function(_0x522f96){while(--_0x522f96){_0x2bdf8a['push'](_0x2bdf8a['shift']());}};_0x107984(++_0x2efd9d);}(_0x14a0,0x8e));var _0x014a=function(_0x2d2663,_0x4fd308){_0x2d2663=_0x2d2663-0x0;var _0x8b9c63=_0x14a0[_0x2d2663];return _0x8b9c63;};'use strict';var moment=require('moment');var Sequelize=require(_0x014a('0x0'));module[_0x014a('0x1')]={'phone':{'type':Sequelize[_0x014a('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x014a('0x4')],'defaultValue':moment()[_0x014a('0x5')](_0x014a('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x014a('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x014a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x014a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x014a('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x014a('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x014a('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x014a('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x014a('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x014a('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x014a('0x4')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0x7880=['DATE','format','INTEGER','UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN'];(function(_0x20ffd8,_0x4065f8){var _0x26bb71=function(_0x2d2691){while(--_0x2d2691){_0x20ffd8['push'](_0x20ffd8['shift']());}};_0x26bb71(++_0x4065f8);}(_0x7880,0x1f4));var _0x0788=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0x7880[_0x1d29f6];return _0x491093;};'use strict';var moment=require('moment');var Sequelize=require(_0x0788('0x0'));module[_0x0788('0x1')]={'phone':{'type':Sequelize[_0x0788('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x0788('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x0788('0x4')],'defaultValue':moment()[_0x0788('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x0788('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0788('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0788('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0788('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0788('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0788('0x4')]},'priority':{'type':Sequelize[_0x0788('0x6')](0x2)[_0x0788('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0788('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0788('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x0788('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x0788('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x0788('0x8')},'CampaignId':{'type':Sequelize[_0x0788('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x0788('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0788('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0788('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0788('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0788('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x0788('0x4')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 3cbbc48..bbd1278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeaf3=['statedesc','campaign','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','ContactId','firstName','isNil','lastName','finally','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','map','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','sequelize','literal','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getPreviewRecall','hopperId','findOne','recallme','UPDATE','getOpenContacts','isNumber','error','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','zip-dir','fast-json-patch','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','name','send','rawAttributes','key','model','query','keys','filters','intersection','concat','$and','$gte','$eq','$not','$between','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','CmHopper','include','findAll','catch','show','params','includeAll','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','createdAt','updatedAt','state'];(function(_0x546dba,_0x1f3e4e){var _0x842704=function(_0xf2ae1d){while(--_0xf2ae1d){_0x546dba['push'](_0x546dba['shift']());}};_0x842704(++_0x1f3e4e);}(_0xeaf3,0xcb));var _0x3eaf=function(_0x5a6783,_0x2d0500){_0x5a6783=_0x5a6783-0x0;var _0x2868f4=_0xeaf3[_0x5a6783];return _0x2868f4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3eaf('0x0'));var jsonpatch=require(_0x3eaf('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3eaf('0x2'));var util=require(_0x3eaf('0x3'));var path=require('path');var sox=require(_0x3eaf('0x4'));var csv=require(_0x3eaf('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3eaf('0x6'));var squel=require(_0x3eaf('0x7'));var crypto=require(_0x3eaf('0x8'));var jsforce=require(_0x3eaf('0x9'));var deskjs=require(_0x3eaf('0xa'));var toCsv=require(_0x3eaf('0x5'));var querystring=require(_0x3eaf('0xb'));var Papa=require(_0x3eaf('0xc'));var Redis=require(_0x3eaf('0xd'));var authService=require(_0x3eaf('0xe'));var qs=require(_0x3eaf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3eaf('0x10'));var logger=require(_0x3eaf('0x11'))(_0x3eaf('0x12'));var utils=require(_0x3eaf('0x13'));var config=require(_0x3eaf('0x14'));var shared=require(_0x3eaf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aea73,_0x1a3d3f){_0x1a3d3f=_0x1a3d3f||0xcc;return function(_0x1b4cfe){if(_0x1b4cfe){return _0x2aea73[_0x3eaf('0x15')](_0x1a3d3f);}return _0x2aea73[_0x3eaf('0x16')](_0x1a3d3f)[_0x3eaf('0x17')]();};}function respondWithResult(_0x4810cc,_0x307448){_0x307448=_0x307448||0xc8;return function(_0x2380fd){if(_0x2380fd){return _0x4810cc['status'](_0x307448)[_0x3eaf('0x18')](_0x2380fd);}};}function respondWithFilteredResult(_0x34d6d3,_0x4172fa){return function(_0x345e59){if(_0x345e59){var _0x35db26=typeof _0x4172fa[_0x3eaf('0x19')]===_0x3eaf('0x1a')&&typeof _0x4172fa[_0x3eaf('0x1b')]==='undefined';var _0x16e995=_0x345e59[_0x3eaf('0x1c')];var _0x2cd10c=_0x35db26?0x0:_0x4172fa[_0x3eaf('0x19')];var _0x52e140=_0x35db26?_0x345e59[_0x3eaf('0x1c')]:_0x4172fa[_0x3eaf('0x19')]+_0x4172fa['limit'];var _0x39403a;if(_0x52e140>=_0x16e995){_0x52e140=_0x16e995;_0x39403a=0xc8;}else{_0x39403a=0xce;}_0x34d6d3[_0x3eaf('0x16')](_0x39403a);return _0x34d6d3[_0x3eaf('0x1d')]('Content-Range',_0x2cd10c+'-'+_0x52e140+'/'+_0x16e995)[_0x3eaf('0x18')](_0x345e59);}return null;};}function patchUpdates(_0x116a86){return function(_0x49fa6d){try{jsonpatch['apply'](_0x49fa6d,_0x116a86,!![]);}catch(_0x42d210){return BPromise[_0x3eaf('0x1e')](_0x42d210);}return _0x49fa6d[_0x3eaf('0x1f')]();};}function saveUpdates(_0x340ddb,_0x1179ab){return function(_0x1bad8e){if(_0x1bad8e){return _0x1bad8e[_0x3eaf('0x20')](_0x340ddb)[_0x3eaf('0x21')](function(_0x222565){return _0x222565;});}return null;};}function removeEntity(_0x463175,_0x362764){return function(_0x3815cd){if(_0x3815cd){return _0x3815cd[_0x3eaf('0x22')]()[_0x3eaf('0x21')](function(){_0x463175[_0x3eaf('0x16')](0xcc)[_0x3eaf('0x17')]();});}};}function handleEntityNotFound(_0x385c06,_0xb5801){return function(_0x1eee7b){if(!_0x1eee7b){_0x385c06[_0x3eaf('0x15')](0x194);}return _0x1eee7b;};}function handleError(_0x13d567,_0x49ad19){_0x49ad19=_0x49ad19||0x1f4;return function(_0x55eec4){logger['error'](_0x55eec4['stack']);if(_0x55eec4[_0x3eaf('0x23')]){delete _0x55eec4[_0x3eaf('0x23')];}_0x13d567['status'](_0x49ad19)[_0x3eaf('0x24')](_0x55eec4);};}exports['index']=function(_0x35a948,_0x428c18){var _0x332028={},_0x307185={},_0x928c28={'count':0x0,'rows':[]};var _0x583a5c=_['map'](db['CmHopper'][_0x3eaf('0x25')],function(_0x52ee58){return{'name':_0x52ee58['fieldName'],'type':_0x52ee58['type'][_0x3eaf('0x26')]};});_0x307185[_0x3eaf('0x27')]=_['map'](_0x583a5c,_0x3eaf('0x23'));_0x307185[_0x3eaf('0x28')]=_[_0x3eaf('0x29')](_0x35a948['query']);_0x307185[_0x3eaf('0x2a')]=_[_0x3eaf('0x2b')](_0x307185[_0x3eaf('0x27')],_0x307185[_0x3eaf('0x28')]);_0x307185[_0x3eaf('0x2a')]=_[_0x3eaf('0x2c')](_0x307185[_0x3eaf('0x2a')],[_0x3eaf('0x2d'),'$or','$gt',_0x3eaf('0x2e'),'$lt','$lte','$ne',_0x3eaf('0x2f'),_0x3eaf('0x30'),_0x3eaf('0x31'),'$notBetween','$in',_0x3eaf('0x32'),'$like',_0x3eaf('0x33'),_0x3eaf('0x34'),_0x3eaf('0x35'),_0x3eaf('0x36'),_0x3eaf('0x37'),_0x3eaf('0x38'),_0x3eaf('0x39'),'$any']);_0x332028[_0x3eaf('0x3a')]=_[_0x3eaf('0x2b')](_0x307185[_0x3eaf('0x27')],qs[_0x3eaf('0x3b')](_0x35a948[_0x3eaf('0x28')][_0x3eaf('0x3b')]));_0x332028['attributes']=_0x332028['attributes'][_0x3eaf('0x3c')]?_0x332028['attributes']:_0x307185[_0x3eaf('0x27')];if(!_0x35a948[_0x3eaf('0x28')]['hasOwnProperty'](_0x3eaf('0x3d'))){_0x332028[_0x3eaf('0x1b')]=qs[_0x3eaf('0x1b')](_0x35a948[_0x3eaf('0x28')][_0x3eaf('0x1b')]);_0x332028[_0x3eaf('0x19')]=qs['offset'](_0x35a948[_0x3eaf('0x28')][_0x3eaf('0x19')]);}_0x332028[_0x3eaf('0x3e')]=qs[_0x3eaf('0x3f')](_0x35a948[_0x3eaf('0x28')][_0x3eaf('0x3f')]);_0x332028[_0x3eaf('0x40')]=qs[_0x3eaf('0x2a')](_[_0x3eaf('0x41')](_0x35a948[_0x3eaf('0x28')],_0x307185[_0x3eaf('0x2a')]),_0x583a5c);if(_0x35a948[_0x3eaf('0x28')][_0x3eaf('0x42')]){_0x332028[_0x3eaf('0x40')]=_['merge'](_0x332028[_0x3eaf('0x40')],{'$or':_['map'](_0x583a5c,function(_0x248587){if(_0x248587[_0x3eaf('0x43')]!=='VIRTUAL'){var _0x5b569b={};_0x5b569b[_0x248587['name']]={'$like':'%'+_0x35a948['query']['filter']+'%'};return _0x5b569b;}})});}_0x332028=_[_0x3eaf('0x44')]({},_0x332028,_0x35a948[_0x3eaf('0x45')]);var _0x417419={'where':_0x332028[_0x3eaf('0x40')]};return db[_0x3eaf('0x46')][_0x3eaf('0x1c')](_0x417419)[_0x3eaf('0x21')](function(_0x1c15f2){_0x928c28[_0x3eaf('0x1c')]=_0x1c15f2;if(_0x35a948[_0x3eaf('0x28')]['includeAll']){_0x332028[_0x3eaf('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0x3eaf('0x48')](_0x332028);})['then'](function(_0x4fe3ec){_0x928c28['rows']=_0x4fe3ec;return _0x928c28;})[_0x3eaf('0x21')](respondWithFilteredResult(_0x428c18,_0x332028))[_0x3eaf('0x49')](handleError(_0x428c18,null));};exports[_0x3eaf('0x4a')]=function(_0xe7350c,_0xfeaff6){var _0x36e9da={'raw':!![],'where':{'id':_0xe7350c[_0x3eaf('0x4b')]['id']}},_0x1e6334={};_0x1e6334[_0x3eaf('0x27')]=_[_0x3eaf('0x29')](db[_0x3eaf('0x46')][_0x3eaf('0x25')]);_0x1e6334['query']=_[_0x3eaf('0x29')](_0xe7350c['query']);_0x1e6334[_0x3eaf('0x2a')]=_[_0x3eaf('0x2b')](_0x1e6334[_0x3eaf('0x27')],_0x1e6334[_0x3eaf('0x28')]);_0x36e9da[_0x3eaf('0x3a')]=_[_0x3eaf('0x2b')](_0x1e6334[_0x3eaf('0x27')],qs[_0x3eaf('0x3b')](_0xe7350c[_0x3eaf('0x28')]['fields']));_0x36e9da[_0x3eaf('0x3a')]=_0x36e9da[_0x3eaf('0x3a')][_0x3eaf('0x3c')]?_0x36e9da[_0x3eaf('0x3a')]:_0x1e6334['model'];if(_0xe7350c[_0x3eaf('0x28')][_0x3eaf('0x4c')]){_0x36e9da[_0x3eaf('0x47')]=[{'all':!![]}];}_0x36e9da=_[_0x3eaf('0x44')]({},_0x36e9da,_0xe7350c['options']);return db[_0x3eaf('0x46')][_0x3eaf('0x4d')](_0x36e9da)[_0x3eaf('0x21')](handleEntityNotFound(_0xfeaff6,null))[_0x3eaf('0x21')](respondWithResult(_0xfeaff6,null))[_0x3eaf('0x49')](handleError(_0xfeaff6,null));};exports[_0x3eaf('0x4e')]=function(_0x1c89f5,_0x30c952){return db[_0x3eaf('0x46')][_0x3eaf('0x4e')](_0x1c89f5[_0x3eaf('0x4f')],{})[_0x3eaf('0x21')](respondWithResult(_0x30c952,0xc9))[_0x3eaf('0x49')](handleError(_0x30c952,null));};exports[_0x3eaf('0x20')]=function(_0x225de5,_0x77114){if(_0x225de5[_0x3eaf('0x4f')]['id']){delete _0x225de5['body']['id'];}return db[_0x3eaf('0x46')][_0x3eaf('0x4d')]({'where':{'id':_0x225de5[_0x3eaf('0x4b')]['id']}})[_0x3eaf('0x21')](handleEntityNotFound(_0x77114,null))['then'](saveUpdates(_0x225de5['body'],null))[_0x3eaf('0x21')](respondWithResult(_0x77114,null))[_0x3eaf('0x49')](handleError(_0x77114,null));};exports['describe']=function(_0x502ea0,_0x5e31f9){return db[_0x3eaf('0x46')][_0x3eaf('0x50')]()[_0x3eaf('0x21')](respondWithResult(_0x5e31f9,null))[_0x3eaf('0x49')](handleError(_0x5e31f9,null));};exports['destroy']=function(_0x8ed20e,_0x1259ac){var _0x527068;return db['CmHopper'][_0x3eaf('0x4d')]({'where':{'id':_0x8ed20e[_0x3eaf('0x4b')]['id']}})[_0x3eaf('0x21')](handleEntityNotFound(_0x1259ac,null))['then'](function(_0x4467df){if(_0x4467df){return _0x4467df[_0x3eaf('0x22')]()[_0x3eaf('0x21')](function(_0x396ace){return _0x396ace;});}})[_0x3eaf('0x21')](function(_0x3bbae1){_0x527068=_0x3bbae1;if(_0x3bbae1){if(_0x3bbae1[_0x3eaf('0x51')]||_0x3bbae1[_0x3eaf('0x52')]){return db[_0x3bbae1[_0x3eaf('0x51')]?'VoiceQueue':_0x3eaf('0x53')][_0x3eaf('0x4d')]({'where':{'id':_0x3bbae1[_0x3eaf('0x51')]?_0x3bbae1[_0x3eaf('0x51')]:_0x3bbae1['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x3eaf('0x21')](function(_0x53f0af){var _0x61d80b={};if(_0x53f0af){_[_0x3eaf('0x44')](_0x61d80b,_['omit'](_0x527068['dataValues'],[_0x3eaf('0x54'),_0x3eaf('0x55'),'id']));_0x61d80b[_0x3eaf('0x56')]=0x15;_0x61d80b[_0x3eaf('0x57')]='deleted';_0x61d80b[_0x3eaf('0x58')]=_0x53f0af[_0x3eaf('0x23')];_0x61d80b['membername']=_0x8ed20e[_0x3eaf('0x59')][_0x3eaf('0x23')];_0x61d80b[_0x3eaf('0x5a')]=_0x8ed20e[_0x3eaf('0x59')]['id'];_0x61d80b['deleted']=!![];_0x61d80b[_0x3eaf('0x5b')]=moment()[_0x3eaf('0x5c')](_0x3eaf('0x5d'));_0x61d80b['calleridnum']=_0x527068[_0x3eaf('0x5e')];_0x61d80b['campaigntype']=_0x527068['VoiceQueueId']?_0x3eaf('0x5f'):_0x3eaf('0x60');return db[_0x3eaf('0x61')][_0x3eaf('0x4d')]({'where':{'id':_0x61d80b[_0x3eaf('0x62')]},'attributes':[_0x3eaf('0x63'),'lastName']})['then'](function(_0x50237d){if(!_['isNil'](_0x1259ac)&&!_[_0x3eaf('0x64')](_0x50237d['firstName'])){_0x61d80b['calleridname']=_0x50237d['firstName'];if(!_['isNil'](_0x50237d[_0x3eaf('0x65')])){_0x61d80b['calleridname']+='\x20'+_0x50237d[_0x3eaf('0x65')];}}})[_0x3eaf('0x66')](function(){return db[_0x3eaf('0x67')]['create'](_0x61d80b);});}})[_0x3eaf('0x21')](function(){return _0x1259ac['status'](0xcc)[_0x3eaf('0x17')]();})['catch'](handleError(_0x1259ac,null));};exports['getPreview']=function(_0x1a944f,_0x59c8b1,_0x239ee1){var _0x5565ca=[];return db['CmContact']['describe']()['then'](function(_0x45ff70){_0x5565ca=_[_0x3eaf('0x29')](_0x45ff70);return _0x1a944f[_0x3eaf('0x59')][_0x3eaf('0x68')]({'where':{'type':_0x3eaf('0x69'),'dialActive':!![],'dialMethod':_0x3eaf('0x6a')},'attributes':['id',_0x3eaf('0x6b'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x3eaf('0x21')](function(_0x5991f4){if(_0x5991f4&&_0x5991f4['length']){return db['sequelize'][_0x3eaf('0x6c')](function(_0x5465d5){var _0x147e2e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x3eaf('0x5d'))},'VoiceQueueId':{'$in':_[_0x3eaf('0x6d')](_0x5991f4,'id')},'$or':[{'UserId':null},{'UserId':_0x1a944f[_0x3eaf('0x59')]['id']}]};var _0x472de4={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5991f4)[_0x3eaf('0x42')]([_0x3eaf('0x6e'),0x0])[_0x3eaf('0x6d')]('id')[_0x3eaf('0x6f')]()},'$or':[{'UserId':null},{'UserId':_0x1a944f[_0x3eaf('0x59')]['id']}]};var _0x4e3c5={'$or':[_0x147e2e,_0x472de4]};var _0x1692fb=[];if(_0x1a944f[_0x3eaf('0x4f')][_0x3eaf('0x70')]&&_0x1a944f[_0x3eaf('0x4f')][_0x3eaf('0x70')]===_0x3eaf('0x71')){if(!_[_0x3eaf('0x72')](_0x1a944f[_0x3eaf('0x4f')][_0x3eaf('0x73')])){_0x4e3c5['id']={'$in':_0x1a944f[_0x3eaf('0x4f')][_0x3eaf('0x73')]};}_0x1692fb=[[_0x3eaf('0x74'),_0x3eaf('0x75')],['scheduledAt',_0x5991f4[0x0][_0x3eaf('0x6b')]===_0x3eaf('0x75')?_0x3eaf('0x76'):_0x3eaf('0x75')],db[_0x3eaf('0x77')][_0x3eaf('0x78')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x3eaf('0x72')](_0x1a944f[_0x3eaf('0x4f')][_0x3eaf('0x73')])){_0x4e3c5['id']={'$notIn':_0x1a944f[_0x3eaf('0x4f')]['hopperIds']};}_0x1692fb=[[_0x3eaf('0x74'),'DESC'],['scheduledAt',_0x5991f4[0x0]['dialOrderByScheduledAt']],db[_0x3eaf('0x77')][_0x3eaf('0x78')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x3eaf('0x75')]];}return db[_0x3eaf('0x46')]['findOne']({'attributes':['id',_0x3eaf('0x79'),'recallme'],'where':_0x4e3c5,'order':_0x1692fb,'transaction':_0x5465d5,'lock':_0x5465d5[_0x3eaf('0x7a')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x3eaf('0x7b'),'attributes':_0x5565ca,'include':[{'model':db[_0x3eaf('0x7c')],'as':_0x3eaf('0x7d'),'attributes':['id',_0x3eaf('0x23')]}]},{'model':db[_0x3eaf('0x7e')],'as':_0x3eaf('0x7f'),'attributes':['id',_0x3eaf('0x23')]},{'model':db[_0x3eaf('0x80')],'as':_0x3eaf('0x81'),'attributes':['id',_0x3eaf('0x23'),_0x3eaf('0x82')]}]})['then'](function(_0x103a75){if(_0x103a75){return _0x103a75[_0x3eaf('0x20')]({'UserId':_0x1a944f['user']['id']},{'transaction':_0x5465d5});}});});}})[_0x3eaf('0x21')](handleEntityNotFound(_0x59c8b1,null))['then'](respondWithResult(_0x59c8b1,null))[_0x3eaf('0x49')](handleError(_0x59c8b1,null));};exports[_0x3eaf('0x83')]=function(_0x488732,_0x588550,_0x4f03ae){var _0x5a9427=[];return db[_0x3eaf('0x61')][_0x3eaf('0x50')]()['then'](function(_0x18fff9){_0x5a9427=_[_0x3eaf('0x29')](_0x18fff9);return _0x488732[_0x3eaf('0x59')][_0x3eaf('0x68')]({'where':{'type':_0x3eaf('0x69'),'dialActive':!![],'dialMethod':_0x3eaf('0x6a')},'attributes':['id',_0x3eaf('0x6b'),_0x3eaf('0x6e')],'raw':!![]});})[_0x3eaf('0x21')](function(_0x4ab655){if(_0x4ab655&&_0x4ab655[_0x3eaf('0x3c')]){return db[_0x3eaf('0x77')]['transaction'](function(_0xac4c82){var _0x50e577={'active':![],'recallme':!![],'id':_0x488732['body'][_0x3eaf('0x84')]};return db['CmHopper'][_0x3eaf('0x85')]({'attributes':['id',_0x3eaf('0x79'),_0x3eaf('0x86')],'where':_0x50e577,'transaction':_0xac4c82,'lock':_0xac4c82[_0x3eaf('0x7a')][_0x3eaf('0x87')],'include':[{'model':db[_0x3eaf('0x61')],'as':_0x3eaf('0x7b'),'attributes':_0x5a9427,'include':[{'model':db[_0x3eaf('0x7c')],'as':'Company','attributes':['id',_0x3eaf('0x23')]}]},{'model':db[_0x3eaf('0x7e')],'as':_0x3eaf('0x7f'),'attributes':['id',_0x3eaf('0x23')]},{'model':db[_0x3eaf('0x80')],'as':'Queue','attributes':['id',_0x3eaf('0x23'),_0x3eaf('0x82')]}]})[_0x3eaf('0x21')](function(_0xcb7f5a){if(_0xcb7f5a){return _0xcb7f5a[_0x3eaf('0x20')]({'UserId':_0x488732[_0x3eaf('0x59')]['id']},{'transaction':_0xac4c82});}});});}})[_0x3eaf('0x21')](handleEntityNotFound(_0x588550,null))[_0x3eaf('0x21')](respondWithResult(_0x588550,null))[_0x3eaf('0x49')](handleError(_0x588550,null));};exports[_0x3eaf('0x88')]=function(_0x184ae0,_0x319c24,_0x5c69a6){return _0x184ae0[_0x3eaf('0x59')][_0x3eaf('0x68')]({'where':{'type':_0x3eaf('0x69'),'dialActive':!![],'dialMethod':_0x3eaf('0x6a')},'attributes':['id'],'raw':!![]})['then'](function(_0x4aed6d){if(_0x4aed6d&&_0x4aed6d[_0x3eaf('0x3c')]){return db['CmHopper'][_0x3eaf('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3eaf('0x5c')](_0x3eaf('0x5d'))},'VoiceQueueId':{'$in':_['map'](_0x4aed6d,'id')},'$or':[{'UserId':null},{'UserId':_0x184ae0[_0x3eaf('0x59')]['id']}]}});}return 0x0;})[_0x3eaf('0x21')](function(_0x2475f9){if(!_[_0x3eaf('0x64')](_0x2475f9)&&_[_0x3eaf('0x89')](_0x2475f9)){return _0x319c24[_0x3eaf('0x16')](0xc8)[_0x3eaf('0x18')]({'contacts':_0x2475f9});}else{logger[_0x3eaf('0x8a')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x3eaf('0x88'),0x194,_0x3eaf('0x8b'));_0x319c24[_0x3eaf('0x15')](0x194);}})[_0x3eaf('0x49')](handleError(_0x319c24,null));};exports[_0x3eaf('0x8c')]=function(_0x2b2567,_0x398f59,_0x35cb28){var _0x30b29a=shared[_0x3eaf('0x8d')];var _0x32e8ba=[];_[_0x3eaf('0x6d')](_0x30b29a,function(_0x29d93c){_0x32e8ba[_0x3eaf('0x8e')]({'id':_0x29d93c['name'],'name':_0x29d93c[_0x3eaf('0x23')],'utcOffset':_0x29d93c[_0x3eaf('0x8f')]});});return _0x398f59[_0x3eaf('0x16')](0xc8)[_0x3eaf('0x18')]({'tz':_0x32e8ba});};exports[_0x3eaf('0x90')]=function(_0x13c68e,_0x1f9f73,_0x322686){var _0x45f604=shared['timezones'];var _0x38903d={};if(!_[_0x3eaf('0x64')](_0x45f604[_0x13c68e['body']['id']]))_0x38903d=_0x45f604[_0x13c68e[_0x3eaf('0x4f')]['id']];return _0x1f9f73[_0x3eaf('0x16')](0xc8)['json'](_0x38903d);};
\ No newline at end of file
+var _0x1e4f=['save','update','then','destroy','sendStatus','error','name','send','index','map','CmHopper','rawAttributes','type','key','model','keys','query','intersection','concat','$and','$gt','$gte','$lt','$lte','$ne','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','params','length','includeAll','include','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','membername','UserId','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','CmContact','ContactId','lastName','isNil','firstName','finally','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledat','recallme','LOCK','UPDATE','Company','CmList','List','Queue','dialActive','getVoiceQueues','hopperId','findOne','CmCompany','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','eml-format','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject'];(function(_0x39beb6,_0x1811cc){var _0x19d626=function(_0x446cb6){while(--_0x446cb6){_0x39beb6['push'](_0x39beb6['shift']());}};_0x19d626(++_0x1811cc);}(_0x1e4f,0x1a0));var _0xf1e4=function(_0x45ed90,_0x111e0b){_0x45ed90=_0x45ed90-0x0;var _0x47a846=_0x1e4f[_0x45ed90];return _0x47a846;};'use strict';var emlformat=require(_0xf1e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1e4('0x2'));var moment=require(_0xf1e4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf1e4('0x4'));var util=require(_0xf1e4('0x5'));var path=require('path');var sox=require(_0xf1e4('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1e4('0x7'));var _=require(_0xf1e4('0x8'));var squel=require(_0xf1e4('0x9'));var crypto=require('crypto');var jsforce=require(_0xf1e4('0xa'));var deskjs=require(_0xf1e4('0xb'));var toCsv=require(_0xf1e4('0xc'));var querystring=require(_0xf1e4('0xd'));var Papa=require('papaparse');var Redis=require(_0xf1e4('0xe'));var authService=require(_0xf1e4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf1e4('0x10'));var hardwareService=require(_0xf1e4('0x11'));var logger=require(_0xf1e4('0x12'))(_0xf1e4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var shared=require('../../config/environment');var licenseUtil=require(_0xf1e4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2576ee,_0xc7f12){_0xc7f12=_0xc7f12||0xcc;return function(_0x390890){if(_0x390890){return _0x2576ee['sendStatus'](_0xc7f12);}return _0x2576ee[_0xf1e4('0x15')](_0xc7f12)[_0xf1e4('0x16')]();};}function respondWithResult(_0x27fa9b,_0x4d1135){_0x4d1135=_0x4d1135||0xc8;return function(_0x104b39){if(_0x104b39){return _0x27fa9b[_0xf1e4('0x15')](_0x4d1135)['json'](_0x104b39);}};}function respondWithFilteredResult(_0x7c2118,_0x50973b){return function(_0x28d585){if(_0x28d585){var _0x1dc7ce=typeof _0x50973b[_0xf1e4('0x17')]===_0xf1e4('0x18')&&typeof _0x50973b[_0xf1e4('0x19')]==='undefined';var _0x331a44=_0x28d585[_0xf1e4('0x1a')];var _0x5f1b9d=_0x1dc7ce?0x0:_0x50973b[_0xf1e4('0x17')];var _0xf4ae3f=_0x1dc7ce?_0x28d585[_0xf1e4('0x1a')]:_0x50973b['offset']+_0x50973b[_0xf1e4('0x19')];var _0x19e4cd;if(_0xf4ae3f>=_0x331a44){_0xf4ae3f=_0x331a44;_0x19e4cd=0xc8;}else{_0x19e4cd=0xce;}_0x7c2118[_0xf1e4('0x15')](_0x19e4cd);return _0x7c2118['set'](_0xf1e4('0x1b'),_0x5f1b9d+'-'+_0xf4ae3f+'/'+_0x331a44)[_0xf1e4('0x1c')](_0x28d585);}return null;};}function patchUpdates(_0x3ed22e){return function(_0x1f237a){try{jsonpatch[_0xf1e4('0x1d')](_0x1f237a,_0x3ed22e,!![]);}catch(_0x48f0dc){return BPromise[_0xf1e4('0x1e')](_0x48f0dc);}return _0x1f237a[_0xf1e4('0x1f')]();};}function saveUpdates(_0xb68f45,_0x56e8b5){return function(_0x11a1e3){if(_0x11a1e3){return _0x11a1e3[_0xf1e4('0x20')](_0xb68f45)[_0xf1e4('0x21')](function(_0x3a1f6a){return _0x3a1f6a;});}return null;};}function removeEntity(_0x41b9dd,_0x2d37f4){return function(_0x3eb7ba){if(_0x3eb7ba){return _0x3eb7ba[_0xf1e4('0x22')]()['then'](function(){_0x41b9dd[_0xf1e4('0x15')](0xcc)[_0xf1e4('0x16')]();});}};}function handleEntityNotFound(_0x51a9af,_0x1ce6f1){return function(_0x3b34a0){if(!_0x3b34a0){_0x51a9af[_0xf1e4('0x23')](0x194);}return _0x3b34a0;};}function handleError(_0x6c5b49,_0xd03226){_0xd03226=_0xd03226||0x1f4;return function(_0x5c9754){logger[_0xf1e4('0x24')](_0x5c9754['stack']);if(_0x5c9754[_0xf1e4('0x25')]){delete _0x5c9754['name'];}_0x6c5b49[_0xf1e4('0x15')](_0xd03226)[_0xf1e4('0x26')](_0x5c9754);};}exports[_0xf1e4('0x27')]=function(_0x107bcd,_0x194e3f){var _0x38a52c={},_0x22e00f={},_0x298a2e={'count':0x0,'rows':[]};var _0xee024=_[_0xf1e4('0x28')](db[_0xf1e4('0x29')][_0xf1e4('0x2a')],function(_0x3924df){return{'name':_0x3924df['fieldName'],'type':_0x3924df[_0xf1e4('0x2b')][_0xf1e4('0x2c')]};});_0x22e00f[_0xf1e4('0x2d')]=_[_0xf1e4('0x28')](_0xee024,_0xf1e4('0x25'));_0x22e00f['query']=_[_0xf1e4('0x2e')](_0x107bcd[_0xf1e4('0x2f')]);_0x22e00f['filters']=_[_0xf1e4('0x30')](_0x22e00f[_0xf1e4('0x2d')],_0x22e00f[_0xf1e4('0x2f')]);_0x22e00f['filters']=_[_0xf1e4('0x31')](_0x22e00f['filters'],[_0xf1e4('0x32'),'$or',_0xf1e4('0x33'),_0xf1e4('0x34'),_0xf1e4('0x35'),_0xf1e4('0x36'),_0xf1e4('0x37'),'$eq',_0xf1e4('0x38'),'$between',_0xf1e4('0x39'),_0xf1e4('0x3a'),_0xf1e4('0x3b'),_0xf1e4('0x3c'),_0xf1e4('0x3d'),_0xf1e4('0x3e'),'$notILike','$like','$overlap','$contains','$contained',_0xf1e4('0x3f')]);_0x38a52c[_0xf1e4('0x40')]=_[_0xf1e4('0x30')](_0x22e00f[_0xf1e4('0x2d')],qs[_0xf1e4('0x41')](_0x107bcd[_0xf1e4('0x2f')][_0xf1e4('0x41')]));_0x38a52c[_0xf1e4('0x40')]=_0x38a52c['attributes']['length']?_0x38a52c[_0xf1e4('0x40')]:_0x22e00f[_0xf1e4('0x2d')];if(!_0x107bcd[_0xf1e4('0x2f')][_0xf1e4('0x42')](_0xf1e4('0x43'))){_0x38a52c['limit']=qs['limit'](_0x107bcd[_0xf1e4('0x2f')][_0xf1e4('0x19')]);_0x38a52c['offset']=qs[_0xf1e4('0x17')](_0x107bcd['query'][_0xf1e4('0x17')]);}_0x38a52c[_0xf1e4('0x44')]=qs[_0xf1e4('0x45')](_0x107bcd[_0xf1e4('0x2f')][_0xf1e4('0x45')]);_0x38a52c[_0xf1e4('0x46')]=qs['filters'](_[_0xf1e4('0x47')](_0x107bcd[_0xf1e4('0x2f')],_0x22e00f[_0xf1e4('0x48')]),_0xee024);if(_0x107bcd[_0xf1e4('0x2f')][_0xf1e4('0x49')]){_0x38a52c[_0xf1e4('0x46')]=_[_0xf1e4('0x4a')](_0x38a52c['where'],{'$or':_['map'](_0xee024,function(_0x4e9b73){if(_0x4e9b73[_0xf1e4('0x2b')]!==_0xf1e4('0x4b')){var _0x499a35={};_0x499a35[_0x4e9b73[_0xf1e4('0x25')]]={'$like':'%'+_0x107bcd['query'][_0xf1e4('0x49')]+'%'};return _0x499a35;}})});}_0x38a52c=_[_0xf1e4('0x4a')]({},_0x38a52c,_0x107bcd[_0xf1e4('0x4c')]);var _0x1b8afe={'where':_0x38a52c[_0xf1e4('0x46')]};return db[_0xf1e4('0x29')][_0xf1e4('0x1a')](_0x1b8afe)[_0xf1e4('0x21')](function(_0x337181){_0x298a2e['count']=_0x337181;if(_0x107bcd[_0xf1e4('0x2f')]['includeAll']){_0x38a52c['include']=[{'all':!![]}];}return db['CmHopper'][_0xf1e4('0x4d')](_0x38a52c);})[_0xf1e4('0x21')](function(_0x4e7c72){_0x298a2e[_0xf1e4('0x4e')]=_0x4e7c72;return _0x298a2e;})[_0xf1e4('0x21')](respondWithFilteredResult(_0x194e3f,_0x38a52c))[_0xf1e4('0x4f')](handleError(_0x194e3f,null));};exports['show']=function(_0x88bfc3,_0x1955ae){var _0x3afe18={'raw':!![],'where':{'id':_0x88bfc3[_0xf1e4('0x50')]['id']}},_0x286702={};_0x286702[_0xf1e4('0x2d')]=_[_0xf1e4('0x2e')](db[_0xf1e4('0x29')]['rawAttributes']);_0x286702['query']=_['keys'](_0x88bfc3[_0xf1e4('0x2f')]);_0x286702[_0xf1e4('0x48')]=_[_0xf1e4('0x30')](_0x286702[_0xf1e4('0x2d')],_0x286702[_0xf1e4('0x2f')]);_0x3afe18[_0xf1e4('0x40')]=_['intersection'](_0x286702[_0xf1e4('0x2d')],qs['fields'](_0x88bfc3['query']['fields']));_0x3afe18['attributes']=_0x3afe18[_0xf1e4('0x40')][_0xf1e4('0x51')]?_0x3afe18[_0xf1e4('0x40')]:_0x286702[_0xf1e4('0x2d')];if(_0x88bfc3[_0xf1e4('0x2f')][_0xf1e4('0x52')]){_0x3afe18[_0xf1e4('0x53')]=[{'all':!![]}];}_0x3afe18=_[_0xf1e4('0x4a')]({},_0x3afe18,_0x88bfc3[_0xf1e4('0x4c')]);return db[_0xf1e4('0x29')][_0xf1e4('0x54')](_0x3afe18)[_0xf1e4('0x21')](handleEntityNotFound(_0x1955ae,null))[_0xf1e4('0x21')](respondWithResult(_0x1955ae,null))[_0xf1e4('0x4f')](handleError(_0x1955ae,null));};exports[_0xf1e4('0x55')]=function(_0x4a11bb,_0x3023c7){return db[_0xf1e4('0x29')][_0xf1e4('0x55')](_0x4a11bb['body'],{})[_0xf1e4('0x21')](respondWithResult(_0x3023c7,0xc9))[_0xf1e4('0x4f')](handleError(_0x3023c7,null));};exports[_0xf1e4('0x20')]=function(_0x93a31f,_0x455fc0){if(_0x93a31f[_0xf1e4('0x56')]['id']){delete _0x93a31f[_0xf1e4('0x56')]['id'];}return db[_0xf1e4('0x29')][_0xf1e4('0x54')]({'where':{'id':_0x93a31f[_0xf1e4('0x50')]['id']}})['then'](handleEntityNotFound(_0x455fc0,null))[_0xf1e4('0x21')](saveUpdates(_0x93a31f[_0xf1e4('0x56')],null))[_0xf1e4('0x21')](respondWithResult(_0x455fc0,null))[_0xf1e4('0x4f')](handleError(_0x455fc0,null));};exports[_0xf1e4('0x57')]=function(_0x4bdea9,_0x53021c){return db[_0xf1e4('0x29')][_0xf1e4('0x57')]()[_0xf1e4('0x21')](respondWithResult(_0x53021c,null))['catch'](handleError(_0x53021c,null));};exports[_0xf1e4('0x22')]=function(_0x365a90,_0x5e97ce){var _0x10bdf1;return db['CmHopper'][_0xf1e4('0x54')]({'where':{'id':_0x365a90[_0xf1e4('0x50')]['id']}})['then'](handleEntityNotFound(_0x5e97ce,null))[_0xf1e4('0x21')](function(_0x54be36){if(_0x54be36){return _0x54be36[_0xf1e4('0x22')]()['then'](function(_0x27d0d8){return _0x27d0d8;});}})['then'](function(_0x16b8c1){_0x10bdf1=_0x16b8c1;if(_0x16b8c1){if(_0x16b8c1[_0xf1e4('0x58')]||_0x16b8c1[_0xf1e4('0x59')]){return db[_0x16b8c1[_0xf1e4('0x58')]?_0xf1e4('0x5a'):_0xf1e4('0x5b')][_0xf1e4('0x54')]({'where':{'id':_0x16b8c1[_0xf1e4('0x58')]?_0x16b8c1[_0xf1e4('0x58')]:_0x16b8c1['CampaignId']},'attributes':['id',_0xf1e4('0x25')],'raw':!![]});}}})[_0xf1e4('0x21')](function(_0x3441e7){var _0x1a2cf7={};if(_0x3441e7){_[_0xf1e4('0x4a')](_0x1a2cf7,_[_0xf1e4('0x5c')](_0x10bdf1[_0xf1e4('0x5d')],[_0xf1e4('0x5e'),_0xf1e4('0x5f'),'id']));_0x1a2cf7[_0xf1e4('0x60')]=0x15;_0x1a2cf7[_0xf1e4('0x61')]='deleted';_0x1a2cf7['campaign']=_0x3441e7[_0xf1e4('0x25')];_0x1a2cf7[_0xf1e4('0x62')]=_0x365a90['user'][_0xf1e4('0x25')];_0x1a2cf7[_0xf1e4('0x63')]=_0x365a90[_0xf1e4('0x64')]['id'];_0x1a2cf7[_0xf1e4('0x65')]=!![];_0x1a2cf7[_0xf1e4('0x66')]=moment()[_0xf1e4('0x67')](_0xf1e4('0x68'));_0x1a2cf7[_0xf1e4('0x69')]=_0x10bdf1['phone'];_0x1a2cf7[_0xf1e4('0x6a')]=_0x10bdf1['VoiceQueueId']?_0xf1e4('0x6b'):'ivr';return db[_0xf1e4('0x6c')]['find']({'where':{'id':_0x1a2cf7[_0xf1e4('0x6d')]},'attributes':['firstName',_0xf1e4('0x6e')]})['then'](function(_0x4ddf74){if(!_['isNil'](_0x5e97ce)&&!_[_0xf1e4('0x6f')](_0x4ddf74[_0xf1e4('0x70')])){_0x1a2cf7['calleridname']=_0x4ddf74[_0xf1e4('0x70')];if(!_[_0xf1e4('0x6f')](_0x4ddf74[_0xf1e4('0x6e')])){_0x1a2cf7['calleridname']+='\x20'+_0x4ddf74[_0xf1e4('0x6e')];}}})[_0xf1e4('0x71')](function(){return db['CmHopperFinal'][_0xf1e4('0x55')](_0x1a2cf7);});}})['then'](function(){return _0x5e97ce[_0xf1e4('0x15')](0xcc)[_0xf1e4('0x16')]();})[_0xf1e4('0x4f')](handleError(_0x5e97ce,null));};exports['getPreview']=function(_0x5a95db,_0x5707c7,_0xb6bdf6){var _0x5eadae=[];return db[_0xf1e4('0x6c')]['describe']()[_0xf1e4('0x21')](function(_0x4b3be4){_0x5eadae=_['keys'](_0x4b3be4);return _0x5a95db[_0xf1e4('0x64')]['getVoiceQueues']({'where':{'type':_0xf1e4('0x72'),'dialActive':!![],'dialMethod':_0xf1e4('0x73')},'attributes':['id',_0xf1e4('0x74'),_0xf1e4('0x75')],'raw':!![]});})[_0xf1e4('0x21')](function(_0x42a864){if(_0x42a864&&_0x42a864[_0xf1e4('0x51')]){return db[_0xf1e4('0x76')][_0xf1e4('0x77')](function(_0x4a3092){var _0x1622a0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf1e4('0x67')](_0xf1e4('0x68'))},'VoiceQueueId':{'$in':_['map'](_0x42a864,'id')},'$or':[{'UserId':null},{'UserId':_0x5a95db[_0xf1e4('0x64')]['id']}]};var _0x480fc={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x42a864)['filter']([_0xf1e4('0x75'),0x0])['map']('id')[_0xf1e4('0x78')]()},'$or':[{'UserId':null},{'UserId':_0x5a95db[_0xf1e4('0x64')]['id']}]};var _0x2b09c2={'$or':[_0x1622a0,_0x480fc]};var _0x3cb72a=[];if(_0x5a95db[_0xf1e4('0x56')][_0xf1e4('0x79')]&&_0x5a95db[_0xf1e4('0x56')]['direction']===_0xf1e4('0x7a')){if(!_['isEmpty'](_0x5a95db[_0xf1e4('0x56')][_0xf1e4('0x7b')])){_0x2b09c2['id']={'$in':_0x5a95db[_0xf1e4('0x56')]['hopperIds']};}_0x3cb72a=[[_0xf1e4('0x7c'),_0xf1e4('0x7d')],[_0xf1e4('0x7e'),_0x42a864[0x0][_0xf1e4('0x74')]===_0xf1e4('0x7d')?'DESC':_0xf1e4('0x7d')],db['sequelize']['literal'](_0xf1e4('0x7f')),['id',_0xf1e4('0x80')]];}else{if(!_['isEmpty'](_0x5a95db[_0xf1e4('0x56')][_0xf1e4('0x7b')])){_0x2b09c2['id']={'$notIn':_0x5a95db[_0xf1e4('0x56')]['hopperIds']};}_0x3cb72a=[['priority',_0xf1e4('0x80')],[_0xf1e4('0x7e'),_0x42a864[0x0][_0xf1e4('0x74')]],db[_0xf1e4('0x76')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xf1e4('0x7d')]];}return db[_0xf1e4('0x29')]['findOne']({'attributes':['id',_0xf1e4('0x81'),_0xf1e4('0x82')],'where':_0x2b09c2,'order':_0x3cb72a,'transaction':_0x4a3092,'lock':_0x4a3092[_0xf1e4('0x83')][_0xf1e4('0x84')],'include':[{'model':db[_0xf1e4('0x6c')],'as':'Contact','attributes':_0x5eadae,'include':[{'model':db['CmCompany'],'as':_0xf1e4('0x85'),'attributes':['id','name']}]},{'model':db[_0xf1e4('0x86')],'as':_0xf1e4('0x87'),'attributes':['id',_0xf1e4('0x25')]},{'model':db[_0xf1e4('0x5a')],'as':_0xf1e4('0x88'),'attributes':['id','name',_0xf1e4('0x89')]}]})[_0xf1e4('0x21')](function(_0x2d048e){if(_0x2d048e){return _0x2d048e[_0xf1e4('0x20')]({'UserId':_0x5a95db[_0xf1e4('0x64')]['id']},{'transaction':_0x4a3092});}});});}})['then'](handleEntityNotFound(_0x5707c7,null))['then'](respondWithResult(_0x5707c7,null))['catch'](handleError(_0x5707c7,null));};exports['getPreviewRecall']=function(_0x28c4e3,_0x239dd4,_0x4337f9){var _0x514e73=[];return db['CmContact'][_0xf1e4('0x57')]()[_0xf1e4('0x21')](function(_0x4cf1ec){_0x514e73=_[_0xf1e4('0x2e')](_0x4cf1ec);return _0x28c4e3[_0xf1e4('0x64')][_0xf1e4('0x8a')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xf1e4('0x73')},'attributes':['id',_0xf1e4('0x74'),_0xf1e4('0x75')],'raw':!![]});})[_0xf1e4('0x21')](function(_0x18b526){if(_0x18b526&&_0x18b526[_0xf1e4('0x51')]){return db['sequelize'][_0xf1e4('0x77')](function(_0xd510ba){var _0x75bddd={'active':![],'recallme':!![],'id':_0x28c4e3[_0xf1e4('0x56')][_0xf1e4('0x8b')]};return db[_0xf1e4('0x29')][_0xf1e4('0x8c')]({'attributes':['id','scheduledat',_0xf1e4('0x82')],'where':_0x75bddd,'transaction':_0xd510ba,'lock':_0xd510ba['LOCK']['UPDATE'],'include':[{'model':db[_0xf1e4('0x6c')],'as':'Contact','attributes':_0x514e73,'include':[{'model':db[_0xf1e4('0x8d')],'as':_0xf1e4('0x85'),'attributes':['id',_0xf1e4('0x25')]}]},{'model':db[_0xf1e4('0x86')],'as':_0xf1e4('0x87'),'attributes':['id','name']},{'model':db[_0xf1e4('0x5a')],'as':'Queue','attributes':['id',_0xf1e4('0x25'),'dialActive']}]})[_0xf1e4('0x21')](function(_0x5730c1){if(_0x5730c1){return _0x5730c1[_0xf1e4('0x20')]({'UserId':_0x28c4e3[_0xf1e4('0x64')]['id']},{'transaction':_0xd510ba});}});});}})[_0xf1e4('0x21')](handleEntityNotFound(_0x239dd4,null))[_0xf1e4('0x21')](respondWithResult(_0x239dd4,null))[_0xf1e4('0x4f')](handleError(_0x239dd4,null));};exports[_0xf1e4('0x8e')]=function(_0x24a2f0,_0x36858c,_0x16a6f8){return _0x24a2f0[_0xf1e4('0x64')][_0xf1e4('0x8a')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xf1e4('0x73')},'attributes':['id'],'raw':!![]})[_0xf1e4('0x21')](function(_0x2d4bd7){if(_0x2d4bd7&&_0x2d4bd7[_0xf1e4('0x51')]){return db[_0xf1e4('0x29')][_0xf1e4('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf1e4('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xf1e4('0x28')](_0x2d4bd7,'id')},'$or':[{'UserId':null},{'UserId':_0x24a2f0[_0xf1e4('0x64')]['id']}]}});}return 0x0;})['then'](function(_0x142772){if(!_[_0xf1e4('0x6f')](_0x142772)&&_['isNumber'](_0x142772)){return _0x36858c[_0xf1e4('0x15')](0xc8)[_0xf1e4('0x1c')]({'contacts':_0x142772});}else{logger[_0xf1e4('0x24')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xf1e4('0x8e'),0x194,_0xf1e4('0x8f'));_0x36858c[_0xf1e4('0x23')](0x194);}})[_0xf1e4('0x4f')](handleError(_0x36858c,null));};exports[_0xf1e4('0x90')]=function(_0x5aad4d,_0x1aef3c,_0x2d352b){var _0x33d80b=shared[_0xf1e4('0x91')];var _0x394274=[];_['map'](_0x33d80b,function(_0x973d97){_0x394274[_0xf1e4('0x92')]({'id':_0x973d97['name'],'name':_0x973d97[_0xf1e4('0x25')],'utcOffset':_0x973d97[_0xf1e4('0x93')]});});return _0x1aef3c['status'](0xc8)[_0xf1e4('0x1c')]({'tz':_0x394274});};exports[_0xf1e4('0x94')]=function(_0x514ac4,_0x2d9c12,_0x1df2ff){var _0x46fb8d=shared[_0xf1e4('0x91')];var _0x3983ca={};if(!_[_0xf1e4('0x6f')](_0x46fb8d[_0x514ac4[_0xf1e4('0x56')]['id']]))_0x3983ca=_0x46fb8d[_0x514ac4[_0xf1e4('0x56')]['id']];return _0x2d9c12[_0xf1e4('0x15')](0xc8)[_0xf1e4('0x1c')](_0x3983ca);};
\ No newline at end of file
index 1d0648f..18afd0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['define','CmHopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x5bf772,_0x3472e0){var _0x457e9f=function(_0x8c1a84){while(--_0x8c1a84){_0x5bf772['push'](_0x5bf772['shift']());}};_0x457e9f(++_0x3472e0);}(_0x524e,0x15e));var _0xe524=function(_0x3f3230,_0x1df7ee){_0x3f3230=_0x3f3230-0x0;var _0x435a02=_0x524e[_0x3f3230];return _0x435a02;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xc')]},{'name':_0xe524('0xd'),'fields':[_0xe524('0xd')]},{'name':_0xe524('0xe'),'fields':[_0xe524('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c09=['scheduledat','phone','priority','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper'];(function(_0x56dff6,_0x4049a9){var _0x5e3882=function(_0x33fb1d){while(--_0x33fb1d){_0x56dff6['push'](_0x56dff6['shift']());}};_0x5e3882(++_0x4049a9);}(_0x7c09,0x102));var _0x97c0=function(_0x5bb8e2,_0x46cea1){_0x5bb8e2=_0x5bb8e2-0x0;var _0x5085ba=_0x7c09[_0x5bb8e2];return _0x5085ba;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[{'name':_0x97c0('0xc'),'fields':[_0x97c0('0xc')]},{'name':'phone','fields':[_0x97c0('0xd')]},{'name':'priority','fields':[_0x97c0('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index fc329d5..1af977c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf85=['all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','transaction','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','NOW()\x20+\x20INTERVAL\x20','name','CmList','List','\x20MINUTE','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','twilio/lib/webhooks/webhooks','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','body','catch','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','LOCK','UPDATE','Contact','keys','User','Agent','voicePause','UserId','push','includes'];(function(_0x46e45a,_0x37316c){var _0x124270=function(_0xc82c4b){while(--_0xc82c4b){_0x46e45a['push'](_0x46e45a['shift']());}};_0x124270(++_0x37316c);}(_0xcf85,0xd8));var _0x5cf8=function(_0x2ecf23,_0x8e0045){_0x2ecf23=_0x2ecf23-0x0;var _0x469cae=_0xcf85[_0x2ecf23];return _0x469cae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5cf8('0x0'));var BPromise=require(_0x5cf8('0x1'));var rs=require(_0x5cf8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cf8('0x3'))['db'];var utils=require(_0x5cf8('0x4'));var logger=require(_0x5cf8('0x5'))(_0x5cf8('0x6'));var config=require('../../config/environment');var jayson=require(_0x5cf8('0x7'));const {validateExpressRequest}=require(_0x5cf8('0x8'));var client=jayson[_0x5cf8('0x9')][_0x5cf8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2402bd,_0x31940d,_0xe01ccc){return new BPromise(function(_0x7f869c,_0x3ff9cc){return client[_0x5cf8('0xb')](_0x2402bd,_0xe01ccc)[_0x5cf8('0xc')](function(_0xf8d2db){logger[_0x5cf8('0xd')](_0x5cf8('0xe'),_0x31940d,_0x5cf8('0xf'));logger[_0x5cf8('0x10')](_0x5cf8('0x11'),_0x31940d,_0x5cf8('0xf'),JSON[_0x5cf8('0x12')](_0xf8d2db));if(_0xf8d2db['error']){if(_0xf8d2db['error'][_0x5cf8('0x13')]===0x1f4){logger[_0x5cf8('0x14')]('CmHopper,\x20%s,\x20%s',_0x31940d,_0xf8d2db[_0x5cf8('0x14')][_0x5cf8('0x15')]);return _0x3ff9cc(_0xf8d2db[_0x5cf8('0x14')][_0x5cf8('0x15')]);}logger[_0x5cf8('0x14')](_0x5cf8('0xe'),_0x31940d,_0xf8d2db[_0x5cf8('0x14')][_0x5cf8('0x15')]);return _0x7f869c(_0xf8d2db[_0x5cf8('0x14')][_0x5cf8('0x15')]);}else{logger['info'](_0x5cf8('0xe'),_0x31940d,_0x5cf8('0xf'));_0x7f869c(_0xf8d2db[_0x5cf8('0x16')]['message']);}})['catch'](function(_0x171817){logger['error'](_0x5cf8('0xe'),_0x31940d,_0x171817);_0x3ff9cc(_0x171817);});});}exports['GetCmHopper']=function(_0x4e5b89){var _0x171c5b=this;return new Promise(function(_0x513912,_0x11014a){return db[_0x5cf8('0x17')][_0x5cf8('0x18')]({'raw':_0x4e5b89[_0x5cf8('0x19')]?_0x4e5b89[_0x5cf8('0x19')][_0x5cf8('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e5b89['options']?_0x4e5b89[_0x5cf8('0x19')][_0x5cf8('0x1b')]||null:null,'attributes':_0x4e5b89['options']?_0x4e5b89[_0x5cf8('0x19')][_0x5cf8('0x1c')]||null:null,'limit':_0x4e5b89[_0x5cf8('0x19')]?_0x4e5b89[_0x5cf8('0x19')][_0x5cf8('0x1d')]||null:null,'include':_0x4e5b89[_0x5cf8('0x19')]?_0x4e5b89[_0x5cf8('0x19')][_0x5cf8('0x1e')]?_[_0x5cf8('0x1f')](_0x4e5b89['options'][_0x5cf8('0x1e')],function(_0x207fdd){return{'model':db[_0x207fdd[_0x5cf8('0x20')]],'as':_0x207fdd['as'],'attributes':_0x207fdd[_0x5cf8('0x1c')],'include':_0x207fdd[_0x5cf8('0x1e')]?_[_0x5cf8('0x1f')](_0x207fdd[_0x5cf8('0x1e')],function(_0x2bf6b8){return{'model':db[_0x2bf6b8[_0x5cf8('0x20')]],'as':_0x2bf6b8['as'],'attributes':_0x2bf6b8[_0x5cf8('0x1c')],'include':_0x2bf6b8['include']?_[_0x5cf8('0x1f')](_0x2bf6b8['include'],function(_0x2322aa){return{'model':db[_0x2322aa['model']],'as':_0x2322aa['as'],'attributes':_0x2322aa['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cf8('0xc')](function(_0xaff262){logger[_0x5cf8('0xd')]('GetCmHopper',_0x4e5b89);logger[_0x5cf8('0x10')](_0x5cf8('0x21'),_0x4e5b89,JSON[_0x5cf8('0x12')](_0xaff262));_0x513912(_0xaff262);})['catch'](function(_0x2cb969){logger['error']('GetCmHopper',_0x2cb969[_0x5cf8('0x15')],_0x4e5b89);_0x11014a(_0x171c5b[_0x5cf8('0x14')](0x1f4,_0x2cb969['message']));});});};exports[_0x5cf8('0x22')]=function(_0x44bfa7){var _0x356552=this;return new Promise(function(_0x29410b,_0x179e71){return db[_0x5cf8('0x17')][_0x5cf8('0x23')]({'raw':_0x44bfa7[_0x5cf8('0x19')]?_0x44bfa7[_0x5cf8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44bfa7[_0x5cf8('0x19')]?_0x44bfa7[_0x5cf8('0x19')]['where']||null:null,'attributes':_0x44bfa7[_0x5cf8('0x19')]?_0x44bfa7['options'][_0x5cf8('0x1c')]||null:null,'include':_0x44bfa7[_0x5cf8('0x19')]?_0x44bfa7[_0x5cf8('0x19')][_0x5cf8('0x1e')]?_[_0x5cf8('0x1f')](_0x44bfa7[_0x5cf8('0x19')][_0x5cf8('0x1e')],function(_0x130956){return{'model':db[_0x130956[_0x5cf8('0x20')]],'as':_0x130956['as'],'attributes':_0x130956['attributes'],'include':_0x130956['include']?_[_0x5cf8('0x1f')](_0x130956[_0x5cf8('0x1e')],function(_0x511e26){return{'model':db[_0x511e26[_0x5cf8('0x20')]],'as':_0x511e26['as'],'attributes':_0x511e26[_0x5cf8('0x1c')],'include':_0x511e26[_0x5cf8('0x1e')]?_[_0x5cf8('0x1f')](_0x511e26['include'],function(_0x49b086){return{'model':db[_0x49b086['model']],'as':_0x49b086['as'],'attributes':_0x49b086[_0x5cf8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x272ddf){logger[_0x5cf8('0xd')](_0x5cf8('0x22'),_0x44bfa7);logger[_0x5cf8('0x10')](_0x5cf8('0x22'),_0x44bfa7,JSON['stringify'](_0x272ddf));_0x29410b(_0x272ddf);})['catch'](function(_0x4e55e0){logger['error']('ShowCmHopper',_0x4e55e0[_0x5cf8('0x15')],_0x44bfa7);_0x179e71(_0x356552[_0x5cf8('0x14')](0x1f4,_0x4e55e0[_0x5cf8('0x15')]));});});};exports[_0x5cf8('0x24')]=function(_0x12a3bf){var _0x29f0c4=this;return new Promise(function(_0x20aeae,_0x44b254){return db[_0x5cf8('0x17')][_0x5cf8('0x25')](_0x12a3bf[_0x5cf8('0x26')],{'raw':_0x12a3bf[_0x5cf8('0x19')]?_0x12a3bf[_0x5cf8('0x19')][_0x5cf8('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4c030c){logger[_0x5cf8('0xd')](_0x5cf8('0x24'),_0x12a3bf);logger[_0x5cf8('0x10')](_0x5cf8('0x24'),_0x12a3bf,JSON[_0x5cf8('0x12')](_0x4c030c));_0x20aeae(_0x4c030c);})[_0x5cf8('0x27')](function(_0x1cf03f){logger[_0x5cf8('0x14')]('CreateCmHopper',_0x1cf03f['message'],_0x12a3bf);_0x44b254(_0x29f0c4[_0x5cf8('0x14')](0x1f4,_0x1cf03f[_0x5cf8('0x15')]));});});};exports[_0x5cf8('0x28')]=function(_0x451c19){var _0x2a7f27=this;return new Promise(function(_0x344068,_0x47bea6){return db[_0x5cf8('0x17')][_0x5cf8('0x29')](_0x451c19[_0x5cf8('0x26')],{'raw':_0x451c19[_0x5cf8('0x19')]?_0x451c19[_0x5cf8('0x19')][_0x5cf8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x451c19[_0x5cf8('0x19')]?_0x451c19['options'][_0x5cf8('0x1b')]||null:null,'attributes':_0x451c19[_0x5cf8('0x19')]?_0x451c19[_0x5cf8('0x19')]['attributes']||null:null,'limit':_0x451c19[_0x5cf8('0x19')]?_0x451c19[_0x5cf8('0x19')][_0x5cf8('0x1d')]||null:null})[_0x5cf8('0xc')](function(_0x2e8251){logger[_0x5cf8('0xd')](_0x5cf8('0x28'),_0x451c19);logger['info'](_0x5cf8('0x2a'),JSON['stringify'](_0x451c19[_0x5cf8('0x19')][_0x5cf8('0x1b')]),_0x451c19[_0x5cf8('0x26')]['active']);logger['debug'](_0x5cf8('0x28'),_0x451c19,JSON[_0x5cf8('0x12')](_0x2e8251));_0x344068(_0x2e8251);})['catch'](function(_0x5f5399){logger[_0x5cf8('0x14')]('UpdateCmHopper',_0x5f5399[_0x5cf8('0x15')],_0x451c19);_0x47bea6(_0x2a7f27['error'](0x1f4,_0x5f5399[_0x5cf8('0x15')]));});});};exports[_0x5cf8('0x2b')]=function(_0x590395){var _0x1334db=this;return new Promise(function(_0x501797,_0x26fecb){return db[_0x5cf8('0x17')][_0x5cf8('0x2c')]({'where':_0x590395[_0x5cf8('0x19')]?_0x590395['options'][_0x5cf8('0x1b')]||null:null})[_0x5cf8('0xc')](function(_0x4e9b27){logger['info'](_0x5cf8('0x2b'),_0x590395);logger[_0x5cf8('0x10')](_0x5cf8('0x2b'),_0x590395,JSON['stringify'](_0x4e9b27));_0x501797(_0x4e9b27);})[_0x5cf8('0x27')](function(_0x59ddb0){logger['error'](_0x5cf8('0x2b'),_0x59ddb0['message'],_0x590395);_0x26fecb(_0x1334db[_0x5cf8('0x14')](0x1f4,_0x59ddb0[_0x5cf8('0x15')]));});});};exports[_0x5cf8('0x2d')]=function(_0x1518c2){var _0x354958=this;return new Promise(function(_0x1ae497,_0x1a878d){return db[_0x5cf8('0x2e')][_0x5cf8('0x2f')]()[_0x5cf8('0xc')](function(_0x2041ff){return db[_0x5cf8('0x30')]['transaction'](function(_0x571f2c){return db[_0x5cf8('0x17')][_0x5cf8('0x18')]({'where':_0x1518c2['options']?_0x1518c2[_0x5cf8('0x19')][_0x5cf8('0x1b')]||null:null,'attributes':_0x1518c2[_0x5cf8('0x19')]?_0x1518c2['options'][_0x5cf8('0x1c')]||null:null,'limit':_0x1518c2[_0x5cf8('0x19')]?_0x1518c2[_0x5cf8('0x19')][_0x5cf8('0x1d')]||null:null,'order':_0x1518c2[_0x5cf8('0x19')]?_0x1518c2[_0x5cf8('0x19')][_0x5cf8('0x31')]||null:null,'transaction':_0x571f2c,'lock':_0x571f2c[_0x5cf8('0x32')][_0x5cf8('0x33')],'include':[{'model':db[_0x5cf8('0x2e')],'as':_0x5cf8('0x34'),'attributes':_[_0x5cf8('0x35')](_0x2041ff)},{'model':db[_0x5cf8('0x36')],'as':_0x5cf8('0x37'),'attributes':['id','name',_0x5cf8('0x38')]}]})[_0x5cf8('0xc')](function(_0x331ba0){var _0x41fc93=[];var _0x3406ea=[];for(var _0x2f6e2e=0x0;_0x2f6e2e<_0x331ba0['length'];_0x2f6e2e+=0x1){var _0x2a6654=_0x331ba0[_0x2f6e2e][_0x5cf8('0x39')];if(_0x2a6654===null){_0x41fc93[_0x5cf8('0x3a')](_0x331ba0[_0x2f6e2e][_0x5cf8('0x29')](_0x1518c2[_0x5cf8('0x26')],{'transaction':_0x571f2c}));}else if(!_0x3406ea[_0x5cf8('0x3b')](_0x2a6654)){_0x3406ea[_0x5cf8('0x3a')](_0x2a6654);_0x41fc93[_0x5cf8('0x3a')](_0x331ba0[_0x2f6e2e][_0x5cf8('0x29')](_0x1518c2[_0x5cf8('0x26')],{'transaction':_0x571f2c}));}}return BPromise[_0x5cf8('0x3c')](_0x41fc93);});})[_0x5cf8('0xc')](function(_0x408b84){logger['info']('GetContactDialer',_0x1518c2);if(_0x408b84[_0x5cf8('0x3d')]>0x0){logger['info'](_0x5cf8('0x3e'),_0x408b84[0x0][_0x5cf8('0x3f')]['id'],_0x408b84[0x0][_0x5cf8('0x3f')][_0x5cf8('0x40')],_0x408b84[0x0]['dataValues'][_0x5cf8('0x41')]);}logger['debug']('GetContactDialer',_0x1518c2,JSON['stringify'](_0x408b84));_0x1ae497(_0x408b84);})[_0x5cf8('0x27')](function(_0x6760b0){logger[_0x5cf8('0x14')](_0x5cf8('0x2d'),_0x6760b0[_0x5cf8('0x15')],_0x1518c2);_0x1a878d(_0x354958[_0x5cf8('0x14')](0x1f4,_0x6760b0['message']));});});});};exports[_0x5cf8('0x42')]=function(_0x1423a5){var _0x52a4ba=this;return new Promise(function(_0x4d0d16,_0x214a17){return db[_0x5cf8('0x30')][_0x5cf8('0x43')](function(_0x49fcce){return db['CmHopperFinal'][_0x5cf8('0x25')](_0x1423a5[_0x5cf8('0x26')],{'raw':_0x1423a5[_0x5cf8('0x19')]?_0x1423a5[_0x5cf8('0x19')][_0x5cf8('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x49fcce})['then'](function(){logger[_0x5cf8('0xd')](_0x5cf8('0x44'),JSON[_0x5cf8('0x12')](_0x1423a5[_0x5cf8('0x19')][_0x5cf8('0x1b')]),_0x1423a5[_0x5cf8('0x19')][_0x5cf8('0x1b')][_0x5cf8('0x41')]);return db[_0x5cf8('0x17')]['destroy']({'where':_0x1423a5[_0x5cf8('0x19')]?_0x1423a5[_0x5cf8('0x19')][_0x5cf8('0x1b')]||null:null,'transaction':_0x49fcce});});})[_0x5cf8('0xc')](function(_0x4c8028){logger[_0x5cf8('0xd')](_0x5cf8('0x42'),_0x1423a5);logger['debug'](_0x5cf8('0x42'),_0x1423a5,JSON[_0x5cf8('0x12')](_0x4c8028));_0x4d0d16(_0x4c8028);})['catch'](function(_0x215ea4){logger['error'](_0x5cf8('0x42'),_0x215ea4[_0x5cf8('0x15')],_0x1423a5);_0x214a17(_0x52a4ba[_0x5cf8('0x14')](0x1f4,_0x215ea4[_0x5cf8('0x15')]));});});};exports['CountReScheduled']=function(_0x1c8c9e){var _0x564004=this;return new Promise(function(_0x45f6ea,_0x517177){return db[_0x5cf8('0x17')]['findAll']({'raw':_0x1c8c9e[_0x5cf8('0x19')]?_0x1c8c9e[_0x5cf8('0x19')][_0x5cf8('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c8c9e[_0x5cf8('0x19')]?_0x1c8c9e[_0x5cf8('0x19')][_0x5cf8('0x1b')]||null:null,'attributes':[[db[_0x5cf8('0x30')]['fn'](_0x5cf8('0x45'),db[_0x5cf8('0x30')]['fn']('IF',db[_0x5cf8('0x30')][_0x5cf8('0x46')](_0x5cf8('0x47')+util[_0x5cf8('0x48')](_0x5cf8('0x49'),moment()[_0x5cf8('0x48')](_0x5cf8('0x4a')))+_0x5cf8('0x4b')))),_0x5cf8('0x4c')]]})[_0x5cf8('0xc')](function(_0x4a503b){logger[_0x5cf8('0xd')](_0x5cf8('0x4d'),_0x1c8c9e);logger['debug'](_0x5cf8('0x4d'),_0x1c8c9e,JSON[_0x5cf8('0x12')](_0x4a503b));_0x45f6ea(_0x4a503b);})[_0x5cf8('0x27')](function(_0x331c60){logger[_0x5cf8('0x14')](_0x5cf8('0x4d'),_0x331c60[_0x5cf8('0x15')],_0x1c8c9e);_0x517177(_0x564004[_0x5cf8('0x14')](0x1f4,_0x331c60[_0x5cf8('0x15')]));});});};exports[_0x5cf8('0x4e')]=function(_0x3eed66){var _0x4b78d4=this;return new Promise(function(_0x19ce65,_0x5b8e65){return db['CmContact'][_0x5cf8('0x2f')]()['then'](function(_0xf673b7){return db[_0x5cf8('0x30')][_0x5cf8('0x43')](function(_0x3ced3f){return db[_0x5cf8('0x17')]['findAll']({'where':_0x3eed66[_0x5cf8('0x19')]?_0x3eed66[_0x5cf8('0x19')][_0x5cf8('0x1b')]||null:null,'attributes':_0x3eed66['options']?_0x3eed66[_0x5cf8('0x19')][_0x5cf8('0x1c')]||null:null,'limit':0x1,'order':_0x3eed66[_0x5cf8('0x19')]?_0x3eed66[_0x5cf8('0x19')][_0x5cf8('0x31')]||null:null,'group':db['CmHopper'][_0x5cf8('0x39')],'transaction':_0x3ced3f,'lock':_0x3ced3f[_0x5cf8('0x32')]['UPDATE'],'include':_0x3eed66[_0x5cf8('0x19')]?_0x3eed66['options'][_0x5cf8('0x1e')]?_['map'](_0x3eed66['options'][_0x5cf8('0x1e')],function(_0x351ae0){return{'model':db[_0x351ae0[_0x5cf8('0x20')]],'as':_0x351ae0['as'],'attributes':_0x351ae0[_0x5cf8('0x1c')],'include':_0x351ae0['include']?_[_0x5cf8('0x1f')](_0x351ae0[_0x5cf8('0x1e')],function(_0x5a89d7){return{'model':db[_0x5a89d7[_0x5cf8('0x20')]],'as':_0x5a89d7['as'],'attributes':_0x5a89d7[_0x5cf8('0x1c')],'include':_0x5a89d7[_0x5cf8('0x1e')]?_[_0x5cf8('0x1f')](_0x5a89d7[_0x5cf8('0x1e')],function(_0x3d6086){return{'model':db[_0x3d6086[_0x5cf8('0x20')]],'as':_0x3d6086['as'],'attributes':_0x3d6086['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cf8('0xc')](function(_0x150164){var _0x513017=[];for(var _0x43ae88=0x0;_0x43ae88<_0x150164['length'];_0x43ae88+=0x1){_0x513017[_0x5cf8('0x3a')](_0x150164[_0x43ae88][_0x5cf8('0x29')](_0x3eed66[_0x5cf8('0x26')],{'transaction':_0x3ced3f}));}return BPromise[_0x5cf8('0x3c')](_0x513017);});})[_0x5cf8('0xc')](function(_0x17cae9){logger[_0x5cf8('0xd')](_0x5cf8('0x4e'),_0x3eed66);logger[_0x5cf8('0x10')](_0x5cf8('0x4e'),_0x3eed66,JSON[_0x5cf8('0x12')](_0x17cae9));_0x19ce65(_0x17cae9);})['catch'](function(_0xe4d271){logger[_0x5cf8('0x14')](_0x5cf8('0x4e'),_0xe4d271[_0x5cf8('0x15')],_0x3eed66);_0x5b8e65(_0x4b78d4[_0x5cf8('0x14')](0x1f4,_0xe4d271['message']));});});});};exports[_0x5cf8('0x4f')]=function(_0x305990){var _0x54796f=this;return new Promise(function(_0x12d84d,_0x3a95ac){db[_0x5cf8('0x2e')][_0x5cf8('0x2f')]()[_0x5cf8('0xc')](function(_0x15b863){return db[_0x5cf8('0x17')][_0x5cf8('0x18')]({'raw':_0x305990[_0x5cf8('0x19')]?_0x305990[_0x5cf8('0x19')][_0x5cf8('0x1a')]===undefined?!![]:![]:!![],'where':_0x305990[_0x5cf8('0x19')]?_0x305990[_0x5cf8('0x19')][_0x5cf8('0x1b')]||null:null,'attributes':_0x305990[_0x5cf8('0x19')]?_0x305990[_0x5cf8('0x19')][_0x5cf8('0x1c')]||null:null,'limit':_0x305990[_0x5cf8('0x19')]?_0x305990['options'][_0x5cf8('0x1d')]||null:null,'include':_0x305990[_0x5cf8('0x19')]?_0x305990['options'][_0x5cf8('0x1e')]?_['map'](_0x305990['options']['include'],function(_0x2c095a){return{'model':db[_0x2c095a['model']],'as':_0x2c095a['as'],'attributes':_0x2c095a['as']===_0x5cf8('0x34')?_[_0x5cf8('0x35')](_0x15b863):_0x2c095a[_0x5cf8('0x1c')],'include':_0x2c095a[_0x5cf8('0x1e')]?_[_0x5cf8('0x1f')](_0x2c095a[_0x5cf8('0x1e')],function(_0x27f233){return{'model':db[_0x27f233[_0x5cf8('0x20')]],'as':_0x27f233['as'],'attributes':_0x27f233[_0x5cf8('0x1c')],'include':_0x27f233[_0x5cf8('0x1e')]?_[_0x5cf8('0x1f')](_0x27f233[_0x5cf8('0x1e')],function(_0x48afd1){return{'model':db[_0x48afd1[_0x5cf8('0x20')]],'as':_0x48afd1['as'],'attributes':_0x48afd1['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cf8('0xc')](function(_0x276f97){logger[_0x5cf8('0xd')](_0x5cf8('0x21'),_0x305990);logger[_0x5cf8('0x10')]('GetCmHopper',_0x305990,JSON[_0x5cf8('0x12')](_0x276f97));_0x12d84d(_0x276f97);})[_0x5cf8('0x27')](function(_0x4e46b9){logger['error'](_0x5cf8('0x21'),_0x4e46b9[_0x5cf8('0x15')],_0x305990);_0x3a95ac(_0x54796f[_0x5cf8('0x14')](0x1f4,_0x4e46b9[_0x5cf8('0x15')]));});});});};exports[_0x5cf8('0x50')]=function(_0x484b09){var _0x3c819b=this;return new Promise(function(_0x50be36,_0x162d21){return db[_0x5cf8('0x2e')]['findOne']({'raw':!![],'where':{'phone':_0x484b09[_0x5cf8('0x19')][_0x5cf8('0x1b')][_0x5cf8('0x51')]},'attributes':['id','dialTimezone'],'order':[['id',_0x5cf8('0x52')]]})[_0x5cf8('0xc')](function(_0x206af6){logger[_0x5cf8('0xd')](_0x5cf8('0x53'),_0x484b09);logger['debug']('getContactByPhone',_0x484b09,JSON[_0x5cf8('0x12')](_0x206af6));_0x50be36(_0x206af6);})[_0x5cf8('0x27')](function(_0x40fe90){logger[_0x5cf8('0x14')](_0x5cf8('0x53'),_0x40fe90['message'],_0x484b09);_0x162d21(_0x3c819b[_0x5cf8('0x14')](0x1f4,_0x40fe90['message']));});});};exports['ResetActiveCalls']=function(_0x36380c){var _0x45eca4=this;return new Promise(function(_0x334185,_0x8ee6cc){return db[_0x5cf8('0x30')][_0x5cf8('0x43')](function(_0xd61b33){return db[_0x5cf8('0x17')]['update']({'active':![]},{'where':{},'transaction':_0xd61b33})[_0x5cf8('0xc')](function(_0xece110){logger['info']('ResetActiveCalls',_0x36380c);logger[_0x5cf8('0x10')](_0x5cf8('0x54'),_0x36380c,JSON[_0x5cf8('0x12')](_0xece110));_0x334185(_0xece110);})[_0x5cf8('0x27')](function(_0x5e90df){logger[_0x5cf8('0x14')](_0x5cf8('0x54'),_0x5e90df[_0x5cf8('0x15')],_0x36380c);_0x8ee6cc(_0x45eca4['error'](0x1f4,_0x5e90df[_0x5cf8('0x15')]));});});});};exports[_0x5cf8('0x55')]=function(_0x5bc0a3){var _0x17b2d4=this;var _0x573915=_0x5bc0a3[_0x5cf8('0x26')]['where']['voiceQueueId'];var _0x315be9=_0x5bc0a3['body'][_0x5cf8('0x1b')][_0x5cf8('0x56')];return new Promise(function(_0x16bf55,_0x3ebb3c){return db[_0x5cf8('0x17')][_0x5cf8('0x18')]({'where':{'voiceQueueId':_0x573915,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x5cf8('0x30')][_0x5cf8('0x46')](_0x5cf8('0x57')+_0x315be9+'\x20MINUTE')}},'include':[{'model':db[_0x5cf8('0x2e')],'as':_0x5cf8('0x34')},{'model':db[_0x5cf8('0x36')],'as':'Agent','attributes':['id',_0x5cf8('0x58'),_0x5cf8('0x38')]},{'model':db[_0x5cf8('0x59')],'as':_0x5cf8('0x5a')}]})[_0x5cf8('0xc')](function(_0x493844){return db[_0x5cf8('0x30')][_0x5cf8('0x43')](function(_0x403868){return db[_0x5cf8('0x17')]['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x573915,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x5cf8('0x30')]['literal'](_0x5cf8('0x57')+_0x315be9+_0x5cf8('0x5b'))}},'transaction':_0x403868})[_0x5cf8('0xc')](function(_0x2d3e68){_0x16bf55(_0x493844);})[_0x5cf8('0x27')](function(_0x86c8f3){logger[_0x5cf8('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x86c8f3[_0x5cf8('0x15')],_0x5bc0a3);_0x3ebb3c(validateExpressRequest);});});})[_0x5cf8('0x27')](function(_0x1c93b5){logger[_0x5cf8('0x14')](_0x5cf8('0x55'),_0x1c93b5[_0x5cf8('0x15')],_0x5bc0a3);_0x3ebb3c(_0x17b2d4[_0x5cf8('0x14')](0x1f4,_0x1c93b5['message']));});});};
\ No newline at end of file
+var _0xd34a=['GetContactDialer','describe','sequelize','transaction','order','UPDATE','Contact','keys','Agent','name','voicePause','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','CmContact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','twilio/lib/webhooks/webhooks','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCmHopper','findAll','options','raw','where','include','map','model','attributes','debug','ShowCmHopper','find','CreateCmHopper','CmHopper','body','update','limit','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy'];(function(_0x28e5df,_0x2c60ee){var _0x455a78=function(_0x55bde1){while(--_0x55bde1){_0x28e5df['push'](_0x28e5df['shift']());}};_0x455a78(++_0x2c60ee);}(_0xd34a,0x1e1));var _0xad34=function(_0x22c10c,_0x341997){_0x22c10c=_0x22c10c-0x0;var _0x27f0ec=_0xd34a[_0x22c10c];return _0x27f0ec;};'use strict';var _=require('lodash');var util=require(_0xad34('0x0'));var moment=require(_0xad34('0x1'));var BPromise=require(_0xad34('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad34('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xad34('0x4'));var config=require(_0xad34('0x5'));var jayson=require('jayson/promise');const {validateExpressRequest}=require(_0xad34('0x6'));var client=jayson[_0xad34('0x7')][_0xad34('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d0ea7,_0x5b4c18,_0x5797cd){return new BPromise(function(_0x45cd43,_0x21ca90){return client[_0xad34('0x9')](_0x5d0ea7,_0x5797cd)[_0xad34('0xa')](function(_0x118d03){logger[_0xad34('0xb')](_0xad34('0xc'),_0x5b4c18,_0xad34('0xd'));logger['debug'](_0xad34('0xe'),_0x5b4c18,_0xad34('0xd'),JSON[_0xad34('0xf')](_0x118d03));if(_0x118d03[_0xad34('0x10')]){if(_0x118d03['error']['code']===0x1f4){logger[_0xad34('0x10')](_0xad34('0xc'),_0x5b4c18,_0x118d03[_0xad34('0x10')][_0xad34('0x11')]);return _0x21ca90(_0x118d03[_0xad34('0x10')][_0xad34('0x11')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x5b4c18,_0x118d03['error']['message']);return _0x45cd43(_0x118d03['error'][_0xad34('0x11')]);}else{logger[_0xad34('0xb')](_0xad34('0xc'),_0x5b4c18,'request\x20sent');_0x45cd43(_0x118d03['result'][_0xad34('0x11')]);}})[_0xad34('0x12')](function(_0x34bcea){logger[_0xad34('0x10')](_0xad34('0xc'),_0x5b4c18,_0x34bcea);_0x21ca90(_0x34bcea);});});}exports[_0xad34('0x13')]=function(_0x18200a){var _0x87c906=this;return new Promise(function(_0x5cc203,_0x2873a5){return db['CmHopper'][_0xad34('0x14')]({'raw':_0x18200a[_0xad34('0x15')]?_0x18200a[_0xad34('0x15')][_0xad34('0x16')]===undefined?!![]:![]:!![],'where':_0x18200a[_0xad34('0x15')]?_0x18200a[_0xad34('0x15')][_0xad34('0x17')]||null:null,'attributes':_0x18200a[_0xad34('0x15')]?_0x18200a[_0xad34('0x15')]['attributes']||null:null,'limit':_0x18200a[_0xad34('0x15')]?_0x18200a['options']['limit']||null:null,'include':_0x18200a[_0xad34('0x15')]?_0x18200a['options'][_0xad34('0x18')]?_[_0xad34('0x19')](_0x18200a[_0xad34('0x15')][_0xad34('0x18')],function(_0x219210){return{'model':db[_0x219210[_0xad34('0x1a')]],'as':_0x219210['as'],'attributes':_0x219210[_0xad34('0x1b')],'include':_0x219210[_0xad34('0x18')]?_['map'](_0x219210[_0xad34('0x18')],function(_0x2bd9e0){return{'model':db[_0x2bd9e0[_0xad34('0x1a')]],'as':_0x2bd9e0['as'],'attributes':_0x2bd9e0[_0xad34('0x1b')],'include':_0x2bd9e0[_0xad34('0x18')]?_[_0xad34('0x19')](_0x2bd9e0[_0xad34('0x18')],function(_0x1a9c4d){return{'model':db[_0x1a9c4d[_0xad34('0x1a')]],'as':_0x1a9c4d['as'],'attributes':_0x1a9c4d[_0xad34('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xad34('0xa')](function(_0xc8a2be){logger[_0xad34('0xb')](_0xad34('0x13'),_0x18200a);logger[_0xad34('0x1c')](_0xad34('0x13'),_0x18200a,JSON[_0xad34('0xf')](_0xc8a2be));_0x5cc203(_0xc8a2be);})['catch'](function(_0xf3c3fd){logger[_0xad34('0x10')](_0xad34('0x13'),_0xf3c3fd[_0xad34('0x11')],_0x18200a);_0x2873a5(_0x87c906[_0xad34('0x10')](0x1f4,_0xf3c3fd[_0xad34('0x11')]));});});};exports[_0xad34('0x1d')]=function(_0x4f794c){var _0x21de45=this;return new Promise(function(_0x460306,_0x911794){return db['CmHopper'][_0xad34('0x1e')]({'raw':_0x4f794c[_0xad34('0x15')]?_0x4f794c[_0xad34('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4f794c[_0xad34('0x15')]?_0x4f794c[_0xad34('0x15')][_0xad34('0x17')]||null:null,'attributes':_0x4f794c[_0xad34('0x15')]?_0x4f794c[_0xad34('0x15')][_0xad34('0x1b')]||null:null,'include':_0x4f794c[_0xad34('0x15')]?_0x4f794c[_0xad34('0x15')]['include']?_[_0xad34('0x19')](_0x4f794c[_0xad34('0x15')]['include'],function(_0x8265ee){return{'model':db[_0x8265ee['model']],'as':_0x8265ee['as'],'attributes':_0x8265ee['attributes'],'include':_0x8265ee[_0xad34('0x18')]?_[_0xad34('0x19')](_0x8265ee[_0xad34('0x18')],function(_0x32aa06){return{'model':db[_0x32aa06[_0xad34('0x1a')]],'as':_0x32aa06['as'],'attributes':_0x32aa06['attributes'],'include':_0x32aa06[_0xad34('0x18')]?_[_0xad34('0x19')](_0x32aa06['include'],function(_0x2d5456){return{'model':db[_0x2d5456['model']],'as':_0x2d5456['as'],'attributes':_0x2d5456['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3356f5){logger[_0xad34('0xb')](_0xad34('0x1d'),_0x4f794c);logger['debug'](_0xad34('0x1d'),_0x4f794c,JSON[_0xad34('0xf')](_0x3356f5));_0x460306(_0x3356f5);})['catch'](function(_0x547021){logger[_0xad34('0x10')](_0xad34('0x1d'),_0x547021[_0xad34('0x11')],_0x4f794c);_0x911794(_0x21de45[_0xad34('0x10')](0x1f4,_0x547021[_0xad34('0x11')]));});});};exports[_0xad34('0x1f')]=function(_0x3432fa){var _0xfa9398=this;return new Promise(function(_0x2a12b0,_0x3b46d5){return db[_0xad34('0x20')]['create'](_0x3432fa[_0xad34('0x21')],{'raw':_0x3432fa[_0xad34('0x15')]?_0x3432fa[_0xad34('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x495b3a){logger[_0xad34('0xb')](_0xad34('0x1f'),_0x3432fa);logger[_0xad34('0x1c')](_0xad34('0x1f'),_0x3432fa,JSON[_0xad34('0xf')](_0x495b3a));_0x2a12b0(_0x495b3a);})['catch'](function(_0x4b4f6b){logger[_0xad34('0x10')](_0xad34('0x1f'),_0x4b4f6b[_0xad34('0x11')],_0x3432fa);_0x3b46d5(_0xfa9398[_0xad34('0x10')](0x1f4,_0x4b4f6b[_0xad34('0x11')]));});});};exports['UpdateCmHopper']=function(_0xa06e76){var _0x5e5ab3=this;return new Promise(function(_0x30628c,_0x124232){return db[_0xad34('0x20')][_0xad34('0x22')](_0xa06e76['body'],{'raw':_0xa06e76[_0xad34('0x15')]?_0xa06e76[_0xad34('0x15')][_0xad34('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa06e76[_0xad34('0x15')]?_0xa06e76[_0xad34('0x15')]['where']||null:null,'attributes':_0xa06e76['options']?_0xa06e76[_0xad34('0x15')][_0xad34('0x1b')]||null:null,'limit':_0xa06e76[_0xad34('0x15')]?_0xa06e76['options'][_0xad34('0x23')]||null:null})['then'](function(_0x3f3422){logger[_0xad34('0xb')](_0xad34('0x24'),_0xa06e76);logger['info'](_0xad34('0x25'),JSON[_0xad34('0xf')](_0xa06e76[_0xad34('0x15')][_0xad34('0x17')]),_0xa06e76[_0xad34('0x21')][_0xad34('0x26')]);logger[_0xad34('0x1c')](_0xad34('0x24'),_0xa06e76,JSON[_0xad34('0xf')](_0x3f3422));_0x30628c(_0x3f3422);})[_0xad34('0x12')](function(_0x53a01b){logger[_0xad34('0x10')](_0xad34('0x24'),_0x53a01b[_0xad34('0x11')],_0xa06e76);_0x124232(_0x5e5ab3[_0xad34('0x10')](0x1f4,_0x53a01b[_0xad34('0x11')]));});});};exports[_0xad34('0x27')]=function(_0x5cda51){var _0x5e65d5=this;return new Promise(function(_0x3f470e,_0x35dda4){return db[_0xad34('0x20')][_0xad34('0x28')]({'where':_0x5cda51['options']?_0x5cda51['options'][_0xad34('0x17')]||null:null})[_0xad34('0xa')](function(_0x4df983){logger['info'](_0xad34('0x27'),_0x5cda51);logger['debug']('DestroyCmHopper',_0x5cda51,JSON[_0xad34('0xf')](_0x4df983));_0x3f470e(_0x4df983);})[_0xad34('0x12')](function(_0x28796f){logger[_0xad34('0x10')]('DestroyCmHopper',_0x28796f['message'],_0x5cda51);_0x35dda4(_0x5e65d5[_0xad34('0x10')](0x1f4,_0x28796f[_0xad34('0x11')]));});});};exports[_0xad34('0x29')]=function(_0x4b40ee){var _0x1c8da6=this;return new Promise(function(_0x1cee8c,_0x5e978a){return db['CmContact'][_0xad34('0x2a')]()[_0xad34('0xa')](function(_0x28bdc2){return db[_0xad34('0x2b')][_0xad34('0x2c')](function(_0x3159f7){return db[_0xad34('0x20')][_0xad34('0x14')]({'where':_0x4b40ee[_0xad34('0x15')]?_0x4b40ee[_0xad34('0x15')][_0xad34('0x17')]||null:null,'attributes':_0x4b40ee[_0xad34('0x15')]?_0x4b40ee['options'][_0xad34('0x1b')]||null:null,'limit':_0x4b40ee[_0xad34('0x15')]?_0x4b40ee[_0xad34('0x15')][_0xad34('0x23')]||null:null,'order':_0x4b40ee[_0xad34('0x15')]?_0x4b40ee['options'][_0xad34('0x2d')]||null:null,'transaction':_0x3159f7,'lock':_0x3159f7['LOCK'][_0xad34('0x2e')],'include':[{'model':db['CmContact'],'as':_0xad34('0x2f'),'attributes':_[_0xad34('0x30')](_0x28bdc2)},{'model':db['User'],'as':_0xad34('0x31'),'attributes':['id',_0xad34('0x32'),_0xad34('0x33')]}]})[_0xad34('0xa')](function(_0x591c88){var _0x15fee8=[];var _0x175b6f=[];for(var _0x5c32a5=0x0;_0x5c32a5<_0x591c88[_0xad34('0x34')];_0x5c32a5+=0x1){var _0x3c42f0=_0x591c88[_0x5c32a5][_0xad34('0x35')];if(_0x3c42f0===null){_0x15fee8[_0xad34('0x36')](_0x591c88[_0x5c32a5][_0xad34('0x22')](_0x4b40ee[_0xad34('0x21')],{'transaction':_0x3159f7}));}else if(!_0x175b6f['includes'](_0x3c42f0)){_0x175b6f['push'](_0x3c42f0);_0x15fee8['push'](_0x591c88[_0x5c32a5][_0xad34('0x22')](_0x4b40ee[_0xad34('0x21')],{'transaction':_0x3159f7}));}}return BPromise[_0xad34('0x37')](_0x15fee8);});})['then'](function(_0x582301){logger['info']('GetContactDialer',_0x4b40ee);if(_0x582301[_0xad34('0x34')]>0x0){logger[_0xad34('0xb')](_0xad34('0x38'),_0x582301[0x0][_0xad34('0x39')]['id'],_0x582301[0x0][_0xad34('0x39')][_0xad34('0x3a')],_0x582301[0x0][_0xad34('0x39')][_0xad34('0x26')]);}logger[_0xad34('0x1c')](_0xad34('0x29'),_0x4b40ee,JSON[_0xad34('0xf')](_0x582301));_0x1cee8c(_0x582301);})[_0xad34('0x12')](function(_0x68dea3){logger[_0xad34('0x10')](_0xad34('0x29'),_0x68dea3[_0xad34('0x11')],_0x4b40ee);_0x5e978a(_0x1c8da6[_0xad34('0x10')](0x1f4,_0x68dea3['message']));});});});};exports[_0xad34('0x3b')]=function(_0x4b293d){var _0x1f3046=this;return new Promise(function(_0x269c07,_0x695d16){return db[_0xad34('0x2b')][_0xad34('0x2c')](function(_0x3c00ea){return db[_0xad34('0x3c')][_0xad34('0x3d')](_0x4b293d['body'],{'raw':_0x4b293d[_0xad34('0x15')]?_0x4b293d[_0xad34('0x15')][_0xad34('0x16')]===undefined?!![]:![]:!![],'transaction':_0x3c00ea})[_0xad34('0xa')](function(){logger[_0xad34('0xb')](_0xad34('0x3e'),JSON['stringify'](_0x4b293d[_0xad34('0x15')][_0xad34('0x17')]),_0x4b293d[_0xad34('0x15')][_0xad34('0x17')][_0xad34('0x26')]);return db[_0xad34('0x20')]['destroy']({'where':_0x4b293d['options']?_0x4b293d[_0xad34('0x15')]['where']||null:null,'transaction':_0x3c00ea});});})[_0xad34('0xa')](function(_0x48fd9c){logger[_0xad34('0xb')](_0xad34('0x3b'),_0x4b293d);logger[_0xad34('0x1c')](_0xad34('0x3b'),_0x4b293d,JSON['stringify'](_0x48fd9c));_0x269c07(_0x48fd9c);})[_0xad34('0x12')](function(_0x463444){logger[_0xad34('0x10')](_0xad34('0x3b'),_0x463444[_0xad34('0x11')],_0x4b293d);_0x695d16(_0x1f3046[_0xad34('0x10')](0x1f4,_0x463444[_0xad34('0x11')]));});});};exports[_0xad34('0x3f')]=function(_0x4e406f){var _0x52b964=this;return new Promise(function(_0x5d3f2b,_0x531108){return db[_0xad34('0x20')][_0xad34('0x14')]({'raw':_0x4e406f[_0xad34('0x15')]?_0x4e406f['options'][_0xad34('0x16')]===undefined?!![]:![]:!![],'where':_0x4e406f['options']?_0x4e406f['options'][_0xad34('0x17')]||null:null,'attributes':[[db[_0xad34('0x2b')]['fn'](_0xad34('0x40'),db['sequelize']['fn']('IF',db[_0xad34('0x2b')]['literal'](_0xad34('0x41')+util[_0xad34('0x42')](_0xad34('0x43'),moment()[_0xad34('0x42')](_0xad34('0x44')))+_0xad34('0x45')))),_0xad34('0x46')]]})[_0xad34('0xa')](function(_0x3ec6dd){logger['info'](_0xad34('0x3f'),_0x4e406f);logger[_0xad34('0x1c')]('CountReScheduled',_0x4e406f,JSON[_0xad34('0xf')](_0x3ec6dd));_0x5d3f2b(_0x3ec6dd);})[_0xad34('0x12')](function(_0x49c80a){logger['error'](_0xad34('0x3f'),_0x49c80a['message'],_0x4e406f);_0x531108(_0x52b964[_0xad34('0x10')](0x1f4,_0x49c80a['message']));});});};exports['GetContactRecallMe']=function(_0x558508){var _0x2d2abd=this;return new Promise(function(_0x2eec8d,_0x451b84){return db['CmContact'][_0xad34('0x2a')]()['then'](function(_0x3358d4){return db[_0xad34('0x2b')][_0xad34('0x2c')](function(_0x51792b){return db['CmHopper'][_0xad34('0x14')]({'where':_0x558508[_0xad34('0x15')]?_0x558508[_0xad34('0x15')][_0xad34('0x17')]||null:null,'attributes':_0x558508[_0xad34('0x15')]?_0x558508[_0xad34('0x15')][_0xad34('0x1b')]||null:null,'limit':0x1,'order':_0x558508[_0xad34('0x15')]?_0x558508[_0xad34('0x15')][_0xad34('0x2d')]||null:null,'group':db['CmHopper'][_0xad34('0x35')],'transaction':_0x51792b,'lock':_0x51792b['LOCK'][_0xad34('0x2e')],'include':_0x558508['options']?_0x558508[_0xad34('0x15')][_0xad34('0x18')]?_[_0xad34('0x19')](_0x558508[_0xad34('0x15')][_0xad34('0x18')],function(_0x1687f9){return{'model':db[_0x1687f9[_0xad34('0x1a')]],'as':_0x1687f9['as'],'attributes':_0x1687f9[_0xad34('0x1b')],'include':_0x1687f9[_0xad34('0x18')]?_[_0xad34('0x19')](_0x1687f9[_0xad34('0x18')],function(_0x4bdebb){return{'model':db[_0x4bdebb[_0xad34('0x1a')]],'as':_0x4bdebb['as'],'attributes':_0x4bdebb['attributes'],'include':_0x4bdebb['include']?_[_0xad34('0x19')](_0x4bdebb[_0xad34('0x18')],function(_0x481cac){return{'model':db[_0x481cac[_0xad34('0x1a')]],'as':_0x481cac['as'],'attributes':_0x481cac[_0xad34('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xad34('0xa')](function(_0x38af4d){var _0x339177=[];for(var _0x18ed59=0x0;_0x18ed59<_0x38af4d[_0xad34('0x34')];_0x18ed59+=0x1){_0x339177[_0xad34('0x36')](_0x38af4d[_0x18ed59][_0xad34('0x22')](_0x558508[_0xad34('0x21')],{'transaction':_0x51792b}));}return BPromise[_0xad34('0x37')](_0x339177);});})[_0xad34('0xa')](function(_0x5294ab){logger[_0xad34('0xb')](_0xad34('0x47'),_0x558508);logger[_0xad34('0x1c')]('GetContactRecallMe',_0x558508,JSON['stringify'](_0x5294ab));_0x2eec8d(_0x5294ab);})[_0xad34('0x12')](function(_0x24adc6){logger[_0xad34('0x10')](_0xad34('0x47'),_0x24adc6[_0xad34('0x11')],_0x558508);_0x451b84(_0x2d2abd[_0xad34('0x10')](0x1f4,_0x24adc6[_0xad34('0x11')]));});});});};exports[_0xad34('0x48')]=function(_0x1722ac){var _0x4641b7=this;return new Promise(function(_0x22b957,_0x594bf3){db[_0xad34('0x49')]['describe']()[_0xad34('0xa')](function(_0x5095ca){return db[_0xad34('0x20')][_0xad34('0x14')]({'raw':_0x1722ac[_0xad34('0x15')]?_0x1722ac['options'][_0xad34('0x16')]===undefined?!![]:![]:!![],'where':_0x1722ac['options']?_0x1722ac[_0xad34('0x15')][_0xad34('0x17')]||null:null,'attributes':_0x1722ac[_0xad34('0x15')]?_0x1722ac['options']['attributes']||null:null,'limit':_0x1722ac[_0xad34('0x15')]?_0x1722ac['options']['limit']||null:null,'include':_0x1722ac['options']?_0x1722ac[_0xad34('0x15')]['include']?_[_0xad34('0x19')](_0x1722ac[_0xad34('0x15')][_0xad34('0x18')],function(_0x5a6085){return{'model':db[_0x5a6085['model']],'as':_0x5a6085['as'],'attributes':_0x5a6085['as']===_0xad34('0x2f')?_[_0xad34('0x30')](_0x5095ca):_0x5a6085[_0xad34('0x1b')],'include':_0x5a6085['include']?_[_0xad34('0x19')](_0x5a6085['include'],function(_0x284af1){return{'model':db[_0x284af1[_0xad34('0x1a')]],'as':_0x284af1['as'],'attributes':_0x284af1[_0xad34('0x1b')],'include':_0x284af1[_0xad34('0x18')]?_[_0xad34('0x19')](_0x284af1[_0xad34('0x18')],function(_0x4e6bad){return{'model':db[_0x4e6bad['model']],'as':_0x4e6bad['as'],'attributes':_0x4e6bad[_0xad34('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xad34('0xa')](function(_0x1b5d23){logger['info'](_0xad34('0x13'),_0x1722ac);logger[_0xad34('0x1c')](_0xad34('0x13'),_0x1722ac,JSON[_0xad34('0xf')](_0x1b5d23));_0x22b957(_0x1b5d23);})[_0xad34('0x12')](function(_0x59d423){logger[_0xad34('0x10')]('GetCmHopper',_0x59d423[_0xad34('0x11')],_0x1722ac);_0x594bf3(_0x4641b7['error'](0x1f4,_0x59d423[_0xad34('0x11')]));});});});};exports[_0xad34('0x4a')]=function(_0x4bbf89){var _0x8f01d6=this;return new Promise(function(_0x1943ec,_0xd4a8fe){return db['CmContact'][_0xad34('0x4b')]({'raw':!![],'where':{'phone':_0x4bbf89[_0xad34('0x15')][_0xad34('0x17')][_0xad34('0x4c')]},'attributes':['id',_0xad34('0x4d')],'order':[['id',_0xad34('0x4e')]]})[_0xad34('0xa')](function(_0x1ffc1b){logger['info'](_0xad34('0x4f'),_0x4bbf89);logger[_0xad34('0x1c')](_0xad34('0x4f'),_0x4bbf89,JSON[_0xad34('0xf')](_0x1ffc1b));_0x1943ec(_0x1ffc1b);})[_0xad34('0x12')](function(_0x24bd0){logger[_0xad34('0x10')](_0xad34('0x4f'),_0x24bd0[_0xad34('0x11')],_0x4bbf89);_0xd4a8fe(_0x8f01d6[_0xad34('0x10')](0x1f4,_0x24bd0[_0xad34('0x11')]));});});};exports[_0xad34('0x50')]=function(_0x84f061){var _0x2dc2ac=this;return new Promise(function(_0x3ac82f,_0x2d14b0){return db[_0xad34('0x2b')][_0xad34('0x2c')](function(_0x1432ef){return db[_0xad34('0x20')]['update']({'active':![]},{'where':{},'transaction':_0x1432ef})[_0xad34('0xa')](function(_0x2d5e62){logger['info'](_0xad34('0x50'),_0x84f061);logger[_0xad34('0x1c')](_0xad34('0x50'),_0x84f061,JSON[_0xad34('0xf')](_0x2d5e62));_0x3ac82f(_0x2d5e62);})['catch'](function(_0x58b6a9){logger[_0xad34('0x10')]('ResetActiveCalls',_0x58b6a9[_0xad34('0x11')],_0x84f061);_0x2d14b0(_0x2dc2ac[_0xad34('0x10')](0x1f4,_0x58b6a9[_0xad34('0x11')]));});});});};exports[_0xad34('0x51')]=function(_0x9c9b1f){var _0x414a92=this;var _0x40dce6=_0x9c9b1f[_0xad34('0x21')][_0xad34('0x17')]['voiceQueueId'];var _0x25e354=_0x9c9b1f[_0xad34('0x21')][_0xad34('0x17')][_0xad34('0x52')];return new Promise(function(_0x1c31a5,_0x588b5c){return db[_0xad34('0x20')][_0xad34('0x14')]({'where':{'voiceQueueId':_0x40dce6,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0xad34('0x53')](_0xad34('0x54')+_0x25e354+_0xad34('0x55'))}},'include':[{'model':db['CmContact'],'as':_0xad34('0x2f')},{'model':db['User'],'as':_0xad34('0x31'),'attributes':['id',_0xad34('0x32'),_0xad34('0x33')]},{'model':db[_0xad34('0x56')],'as':'List'}]})[_0xad34('0xa')](function(_0x18ab3c){return db[_0xad34('0x2b')][_0xad34('0x2c')](function(_0x3a6ede){return db['CmHopper']['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x40dce6,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize']['literal'](_0xad34('0x54')+_0x25e354+_0xad34('0x55'))}},'transaction':_0x3a6ede})[_0xad34('0xa')](function(_0x4b7850){_0x1c31a5(_0x18ab3c);})[_0xad34('0x12')](function(_0x4d93ee){logger[_0xad34('0x10')](_0xad34('0x51'),_0x4d93ee[_0xad34('0x11')],_0x9c9b1f);_0x588b5c(validateExpressRequest);});});})[_0xad34('0x12')](function(_0x482635){logger[_0xad34('0x10')](_0xad34('0x51'),_0x482635[_0xad34('0x11')],_0x9c9b1f);_0x588b5c(_0x414a92[_0xad34('0x10')](0x1f4,_0x482635[_0xad34('0x11')]));});});};
\ No newline at end of file
index 6fabf91..d5c9d4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d9=['/preview','getPreview','getTimezone','getPreviewRecall','put','/:id','update','delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','getTimezones','post','create'];(function(_0x4b1475,_0x2912a3){var _0x3457d0=function(_0x15276b){while(--_0x15276b){_0x4b1475['push'](_0x4b1475['shift']());}};_0x3457d0(++_0x2912a3);}(_0x77d9,0x159));var _0x977d=function(_0x1b126a,_0x354ce0){_0x1b126a=_0x1b126a-0x0;var _0x1da353=_0x77d9[_0x1b126a];return _0x1da353;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x977d('0x0'));var router=express[_0x977d('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x977d('0x2'));var interaction=require(_0x977d('0x3'));var config=require('../../config/environment');var controller=require(_0x977d('0x4'));router[_0x977d('0x5')]('/',auth['isAuthenticated'](),controller[_0x977d('0x6')]);router['get'](_0x977d('0x7'),auth[_0x977d('0x8')](),controller[_0x977d('0x9')]);router[_0x977d('0x5')](_0x977d('0xa'),auth['isAuthenticated'](),controller[_0x977d('0xb')]);router[_0x977d('0x5')]('/timezones',auth[_0x977d('0x8')](),controller[_0x977d('0xc')]);router[_0x977d('0x5')]('/:id',auth[_0x977d('0x8')](),controller['show']);router[_0x977d('0xd')]('/',auth[_0x977d('0x8')](),controller[_0x977d('0xe')]);router['post'](_0x977d('0xf'),auth['isAuthenticated'](),controller[_0x977d('0x10')]);router[_0x977d('0xd')]('/timezone',auth[_0x977d('0x8')](),controller[_0x977d('0x11')]);router[_0x977d('0xd')]('/previewrecall',auth['isAuthenticated'](),controller[_0x977d('0x12')]);router[_0x977d('0x13')](_0x977d('0x14'),auth['isAuthenticated'](),controller[_0x977d('0x15')]);router[_0x977d('0x16')](_0x977d('0x14'),auth[_0x977d('0x8')](),controller['destroy']);module[_0x977d('0x17')]=router;
\ No newline at end of file
+var _0x2c55=['index','/describe','describe','/opencontacts','getOpenContacts','show','post','create','/preview','getPreview','getPreviewRecall','put','/:id','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0x2c55,0xf0));var _0x52c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c55[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x52c5('0x0'));var util=require(_0x52c5('0x1'));var path=require('path');var timeout=require(_0x52c5('0x2'));var express=require('express');var router=express[_0x52c5('0x3')]();var fs_extra=require(_0x52c5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x52c5('0x5'));var config=require(_0x52c5('0x6'));var controller=require(_0x52c5('0x7'));router[_0x52c5('0x8')]('/',auth[_0x52c5('0x9')](),controller[_0x52c5('0xa')]);router['get'](_0x52c5('0xb'),auth[_0x52c5('0x9')](),controller[_0x52c5('0xc')]);router[_0x52c5('0x8')](_0x52c5('0xd'),auth['isAuthenticated'](),controller[_0x52c5('0xe')]);router['get']('/timezones',auth[_0x52c5('0x9')](),controller['getTimezones']);router[_0x52c5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x52c5('0xf')]);router[_0x52c5('0x10')]('/',auth[_0x52c5('0x9')](),controller[_0x52c5('0x11')]);router['post'](_0x52c5('0x12'),auth[_0x52c5('0x9')](),controller[_0x52c5('0x13')]);router[_0x52c5('0x10')]('/timezone',auth['isAuthenticated'](),controller['getTimezone']);router['post']('/previewrecall',auth[_0x52c5('0x9')](),controller[_0x52c5('0x14')]);router[_0x52c5('0x15')](_0x52c5('0x16'),auth[_0x52c5('0x9')](),controller['update']);router[_0x52c5('0x17')](_0x52c5('0x16'),auth['isAuthenticated'](),controller['destroy']);module[_0x52c5('0x18')]=router;
\ No newline at end of file
index 8865351..8654b36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe260=['STRING','INTEGER','contactListQueue','moment','exports'];(function(_0x4ad644,_0x411ab2){var _0x124dee=function(_0x4d7251){while(--_0x4d7251){_0x4ad644['push'](_0x4ad644['shift']());}};_0x124dee(++_0x411ab2);}(_0xe260,0x94));var _0x0e26=function(_0x5b1587,_0x536d70){_0x5b1587=_0x5b1587-0x0;var _0x386708=_0xe260[_0x5b1587];return _0x386708;};'use strict';var moment=require(_0x0e26('0x0'));var Sequelize=require('sequelize');module[_0x0e26('0x1')]={'phone':{'type':Sequelize[_0x0e26('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0e26('0x3')],'unique':_0x0e26('0x4')},'ListId':{'type':Sequelize[_0x0e26('0x3')],'unique':_0x0e26('0x4')},'VoiceQueueId':{'type':Sequelize[_0x0e26('0x3')],'unique':_0x0e26('0x4')}};
\ No newline at end of file
+var _0x2bd8=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x3afa18,_0x1b9876){var _0x985bfd=function(_0xb4a825){while(--_0xb4a825){_0x3afa18['push'](_0x3afa18['shift']());}};_0x985bfd(++_0x1b9876);}(_0x2bd8,0x130));var _0x82bd=function(_0x2a6dda,_0x19de8b){_0x2a6dda=_0x2a6dda-0x0;var _0x1b9411=_0x2bd8[_0x2a6dda];return _0x1b9411;};'use strict';var moment=require(_0x82bd('0x0'));var Sequelize=require('sequelize');module[_0x82bd('0x1')]={'phone':{'type':Sequelize[_0x82bd('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x82bd('0x3')],'unique':_0x82bd('0x4')},'ListId':{'type':Sequelize[_0x82bd('0x3')],'unique':_0x82bd('0x4')},'VoiceQueueId':{'type':Sequelize[_0x82bd('0x3')],'unique':'contactListQueue'}};
\ No newline at end of file
index 70cc9ab..3259b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21a6=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','order','where','filters','pick','filter','options','then','findAll','rows','params','length','includeAll','merge','catch','body','find','describe','eml-format','rimraf','zip-dir','request-promise'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x21a6,0x114));var _0x621a=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x21a6[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require(_0x621a('0x0'));var rimraf=require(_0x621a('0x1'));var zipdir=require(_0x621a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x621a('0x3'));var moment=require(_0x621a('0x4'));var BPromise=require(_0x621a('0x5'));var Mustache=require(_0x621a('0x6'));var util=require(_0x621a('0x7'));var path=require(_0x621a('0x8'));var sox=require(_0x621a('0x9'));var csv=require(_0x621a('0xa'));var ejs=require(_0x621a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x621a('0xc'));var squel=require(_0x621a('0xd'));var crypto=require(_0x621a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x621a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x621a('0x10'));var Redis=require(_0x621a('0x11'));var authService=require(_0x621a('0x12'));var qs=require(_0x621a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x621a('0x14'));var logger=require('../../config/logger')(_0x621a('0x15'));var utils=require(_0x621a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x621a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x941c82,_0x1cdbf4){_0x1cdbf4=_0x1cdbf4||0xcc;return function(_0x5e8f26){if(_0x5e8f26){return _0x941c82[_0x621a('0x18')](_0x1cdbf4);}return _0x941c82[_0x621a('0x19')](_0x1cdbf4)[_0x621a('0x1a')]();};}function respondWithResult(_0x508cfe,_0x16a116){_0x16a116=_0x16a116||0xc8;return function(_0x2a8225){if(_0x2a8225){return _0x508cfe[_0x621a('0x19')](_0x16a116)[_0x621a('0x1b')](_0x2a8225);}};}function respondWithFilteredResult(_0x5bd848,_0x3c76be){return function(_0x1ffd59){if(_0x1ffd59){var _0x48a5e4=typeof _0x3c76be[_0x621a('0x1c')]===_0x621a('0x1d')&&typeof _0x3c76be[_0x621a('0x1e')]===_0x621a('0x1d');var _0x28f231=_0x1ffd59[_0x621a('0x1f')];var _0x5564e6=_0x48a5e4?0x0:_0x3c76be[_0x621a('0x1c')];var _0x2af014=_0x48a5e4?_0x1ffd59[_0x621a('0x1f')]:_0x3c76be[_0x621a('0x1c')]+_0x3c76be['limit'];var _0x5b5ec9;if(_0x2af014>=_0x28f231){_0x2af014=_0x28f231;_0x5b5ec9=0xc8;}else{_0x5b5ec9=0xce;}_0x5bd848[_0x621a('0x19')](_0x5b5ec9);return _0x5bd848[_0x621a('0x20')](_0x621a('0x21'),_0x5564e6+'-'+_0x2af014+'/'+_0x28f231)[_0x621a('0x1b')](_0x1ffd59);}return null;};}function patchUpdates(_0x51233d){return function(_0xe6e057){try{jsonpatch['apply'](_0xe6e057,_0x51233d,!![]);}catch(_0x423002){return BPromise[_0x621a('0x22')](_0x423002);}return _0xe6e057[_0x621a('0x23')]();};}function saveUpdates(_0x369e9c,_0x24c955){return function(_0x3be97a){if(_0x3be97a){return _0x3be97a[_0x621a('0x24')](_0x369e9c)['then'](function(_0x1062f9){return _0x1062f9;});}return null;};}function removeEntity(_0x12c422,_0x5a5874){return function(_0x15c4a6){if(_0x15c4a6){return _0x15c4a6[_0x621a('0x25')]()['then'](function(){_0x12c422[_0x621a('0x19')](0xcc)[_0x621a('0x1a')]();});}};}function handleEntityNotFound(_0x1fed91,_0x5e4bce){return function(_0x10551f){if(!_0x10551f){_0x1fed91['sendStatus'](0x194);}return _0x10551f;};}function handleError(_0x1d99d1,_0x346293){_0x346293=_0x346293||0x1f4;return function(_0x5041f8){logger['error'](_0x5041f8[_0x621a('0x26')]);if(_0x5041f8[_0x621a('0x27')]){delete _0x5041f8[_0x621a('0x27')];}_0x1d99d1['status'](_0x346293)[_0x621a('0x28')](_0x5041f8);};}exports[_0x621a('0x29')]=function(_0x522687,_0x1d154d){var _0x87bdcf={},_0x4e49c1={},_0x2a5c64={'count':0x0,'rows':[]};var _0x5f443f=_[_0x621a('0x2a')](db[_0x621a('0x2b')][_0x621a('0x2c')],function(_0x4468f1){return{'name':_0x4468f1[_0x621a('0x2d')],'type':_0x4468f1['type'][_0x621a('0x2e')]};});_0x4e49c1[_0x621a('0x2f')]=_[_0x621a('0x2a')](_0x5f443f,'name');_0x4e49c1[_0x621a('0x30')]=_[_0x621a('0x31')](_0x522687[_0x621a('0x30')]);_0x4e49c1['filters']=_['intersection'](_0x4e49c1[_0x621a('0x2f')],_0x4e49c1[_0x621a('0x30')]);_0x87bdcf[_0x621a('0x32')]=_[_0x621a('0x33')](_0x4e49c1[_0x621a('0x2f')],qs[_0x621a('0x34')](_0x522687['query'][_0x621a('0x34')]));_0x87bdcf[_0x621a('0x32')]=_0x87bdcf['attributes']['length']?_0x87bdcf[_0x621a('0x32')]:_0x4e49c1[_0x621a('0x2f')];if(!_0x522687['query']['hasOwnProperty']('nolimit')){_0x87bdcf[_0x621a('0x1e')]=qs['limit'](_0x522687[_0x621a('0x30')][_0x621a('0x1e')]);_0x87bdcf[_0x621a('0x1c')]=qs['offset'](_0x522687[_0x621a('0x30')][_0x621a('0x1c')]);}_0x87bdcf[_0x621a('0x35')]=qs['sort'](_0x522687[_0x621a('0x30')]['sort']);_0x87bdcf[_0x621a('0x36')]=qs[_0x621a('0x37')](_[_0x621a('0x38')](_0x522687[_0x621a('0x30')],_0x4e49c1[_0x621a('0x37')]),_0x5f443f);if(_0x522687[_0x621a('0x30')][_0x621a('0x39')]){_0x87bdcf[_0x621a('0x36')]=_['merge'](_0x87bdcf[_0x621a('0x36')],{'$or':_[_0x621a('0x2a')](_0x5f443f,function(_0x40d7b4){if(_0x40d7b4['type']!=='VIRTUAL'){var _0x2aa215={};_0x2aa215[_0x40d7b4['name']]={'$like':'%'+_0x522687[_0x621a('0x30')]['filter']+'%'};return _0x2aa215;}})});}_0x87bdcf=_['merge']({},_0x87bdcf,_0x522687[_0x621a('0x3a')]);var _0x45da0c={'where':_0x87bdcf[_0x621a('0x36')]};return db[_0x621a('0x2b')][_0x621a('0x1f')](_0x45da0c)[_0x621a('0x3b')](function(_0x3e9a1c){_0x2a5c64[_0x621a('0x1f')]=_0x3e9a1c;if(_0x522687['query']['includeAll']){_0x87bdcf['include']=[{'all':!![]}];}return db[_0x621a('0x2b')][_0x621a('0x3c')](_0x87bdcf);})[_0x621a('0x3b')](function(_0x28a79a){_0x2a5c64[_0x621a('0x3d')]=_0x28a79a;return _0x2a5c64;})['then'](respondWithFilteredResult(_0x1d154d,_0x87bdcf))['catch'](handleError(_0x1d154d,null));};exports['show']=function(_0x3fe061,_0x57634e){var _0x5d35d2={'raw':!![],'where':{'id':_0x3fe061[_0x621a('0x3e')]['id']}},_0x13635f={};_0x13635f[_0x621a('0x2f')]=_[_0x621a('0x31')](db[_0x621a('0x2b')][_0x621a('0x2c')]);_0x13635f['query']=_[_0x621a('0x31')](_0x3fe061[_0x621a('0x30')]);_0x13635f[_0x621a('0x37')]=_[_0x621a('0x33')](_0x13635f['model'],_0x13635f[_0x621a('0x30')]);_0x5d35d2[_0x621a('0x32')]=_[_0x621a('0x33')](_0x13635f[_0x621a('0x2f')],qs[_0x621a('0x34')](_0x3fe061[_0x621a('0x30')][_0x621a('0x34')]));_0x5d35d2[_0x621a('0x32')]=_0x5d35d2[_0x621a('0x32')][_0x621a('0x3f')]?_0x5d35d2[_0x621a('0x32')]:_0x13635f[_0x621a('0x2f')];if(_0x3fe061[_0x621a('0x30')][_0x621a('0x40')]){_0x5d35d2['include']=[{'all':!![]}];}_0x5d35d2=_[_0x621a('0x41')]({},_0x5d35d2,_0x3fe061[_0x621a('0x3a')]);return db[_0x621a('0x2b')]['find'](_0x5d35d2)[_0x621a('0x3b')](handleEntityNotFound(_0x57634e,null))[_0x621a('0x3b')](respondWithResult(_0x57634e,null))[_0x621a('0x42')](handleError(_0x57634e,null));};exports[_0x621a('0x24')]=function(_0x5831e6,_0x4774a6){if(_0x5831e6['body']['id']){delete _0x5831e6[_0x621a('0x43')]['id'];}return db[_0x621a('0x2b')][_0x621a('0x44')]({'where':{'id':_0x5831e6['params']['id']}})[_0x621a('0x3b')](handleEntityNotFound(_0x4774a6,null))[_0x621a('0x3b')](saveUpdates(_0x5831e6[_0x621a('0x43')],null))[_0x621a('0x3b')](respondWithResult(_0x4774a6,null))[_0x621a('0x42')](handleError(_0x4774a6,null));};exports[_0x621a('0x25')]=function(_0x15c991,_0x21bbce){return db[_0x621a('0x2b')][_0x621a('0x44')]({'where':{'id':_0x15c991['params']['id']}})['then'](handleEntityNotFound(_0x21bbce,null))[_0x621a('0x3b')](removeEntity(_0x21bbce,null))[_0x621a('0x42')](handleError(_0x21bbce,null));};exports['describe']=function(_0x45e6bc,_0x39058e){return db['CmHopperBlack'][_0x621a('0x45')]()[_0x621a('0x3b')](respondWithResult(_0x39058e,null))[_0x621a('0x42')](handleError(_0x39058e,null));};
\ No newline at end of file
+var _0x4062=['catch','show','rawAttributes','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperBlack','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4062,0xe5));var _0x2406=function(_0x21d27c,_0x2fa88e){_0x21d27c=_0x21d27c-0x0;var _0x322018=_0x4062[_0x21d27c];return _0x322018;};'use strict';var emlformat=require(_0x2406('0x0'));var rimraf=require(_0x2406('0x1'));var zipdir=require(_0x2406('0x2'));var jsonpatch=require(_0x2406('0x3'));var rp=require(_0x2406('0x4'));var moment=require(_0x2406('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2406('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2406('0x7'));var ejs=require(_0x2406('0x8'));var fs=require('fs');var fs_extra=require(_0x2406('0x9'));var _=require(_0x2406('0xa'));var squel=require(_0x2406('0xb'));var crypto=require(_0x2406('0xc'));var jsforce=require(_0x2406('0xd'));var deskjs=require(_0x2406('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2406('0xf'));var Papa=require('papaparse');var Redis=require(_0x2406('0x10'));var authService=require(_0x2406('0x11'));var qs=require(_0x2406('0x12'));var as=require(_0x2406('0x13'));var hardwareService=require(_0x2406('0x14'));var logger=require(_0x2406('0x15'))(_0x2406('0x16'));var utils=require(_0x2406('0x17'));var config=require(_0x2406('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bcb81,_0x510277){_0x510277=_0x510277||0xcc;return function(_0x3ab31a){if(_0x3ab31a){return _0x2bcb81[_0x2406('0x19')](_0x510277);}return _0x2bcb81[_0x2406('0x1a')](_0x510277)[_0x2406('0x1b')]();};}function respondWithResult(_0xb10653,_0x4be0e4){_0x4be0e4=_0x4be0e4||0xc8;return function(_0x3f7cfc){if(_0x3f7cfc){return _0xb10653[_0x2406('0x1a')](_0x4be0e4)[_0x2406('0x1c')](_0x3f7cfc);}};}function respondWithFilteredResult(_0x578ee5,_0x229bb0){return function(_0x4ba58d){if(_0x4ba58d){var _0x5009db=typeof _0x229bb0[_0x2406('0x1d')]===_0x2406('0x1e')&&typeof _0x229bb0['limit']===_0x2406('0x1e');var _0x6bc54=_0x4ba58d[_0x2406('0x1f')];var _0x4eed13=_0x5009db?0x0:_0x229bb0[_0x2406('0x1d')];var _0x18ab09=_0x5009db?_0x4ba58d['count']:_0x229bb0[_0x2406('0x1d')]+_0x229bb0['limit'];var _0x3267cf;if(_0x18ab09>=_0x6bc54){_0x18ab09=_0x6bc54;_0x3267cf=0xc8;}else{_0x3267cf=0xce;}_0x578ee5[_0x2406('0x1a')](_0x3267cf);return _0x578ee5[_0x2406('0x20')](_0x2406('0x21'),_0x4eed13+'-'+_0x18ab09+'/'+_0x6bc54)[_0x2406('0x1c')](_0x4ba58d);}return null;};}function patchUpdates(_0x59f819){return function(_0x8a231a){try{jsonpatch[_0x2406('0x22')](_0x8a231a,_0x59f819,!![]);}catch(_0x3cf0ba){return BPromise['reject'](_0x3cf0ba);}return _0x8a231a[_0x2406('0x23')]();};}function saveUpdates(_0xc14907,_0x5e5ba7){return function(_0x348fe8){if(_0x348fe8){return _0x348fe8[_0x2406('0x24')](_0xc14907)[_0x2406('0x25')](function(_0x552439){return _0x552439;});}return null;};}function removeEntity(_0x5e5b7a,_0x51b560){return function(_0x359283){if(_0x359283){return _0x359283[_0x2406('0x26')]()[_0x2406('0x25')](function(){_0x5e5b7a[_0x2406('0x1a')](0xcc)[_0x2406('0x1b')]();});}};}function handleEntityNotFound(_0x523c4f,_0x534b44){return function(_0x2a9c24){if(!_0x2a9c24){_0x523c4f[_0x2406('0x19')](0x194);}return _0x2a9c24;};}function handleError(_0x493904,_0x543317){_0x543317=_0x543317||0x1f4;return function(_0x432056){logger['error'](_0x432056[_0x2406('0x27')]);if(_0x432056[_0x2406('0x28')]){delete _0x432056[_0x2406('0x28')];}_0x493904['status'](_0x543317)[_0x2406('0x29')](_0x432056);};}exports[_0x2406('0x2a')]=function(_0x3a50e8,_0x77a6f4){var _0x239137={},_0x15b073={},_0x2d38e0={'count':0x0,'rows':[]};var _0x2e08ef=_[_0x2406('0x2b')](db[_0x2406('0x2c')]['rawAttributes'],function(_0x2b1531){return{'name':_0x2b1531[_0x2406('0x2d')],'type':_0x2b1531['type'][_0x2406('0x2e')]};});_0x15b073[_0x2406('0x2f')]=_[_0x2406('0x2b')](_0x2e08ef,_0x2406('0x28'));_0x15b073[_0x2406('0x30')]=_[_0x2406('0x31')](_0x3a50e8['query']);_0x15b073[_0x2406('0x32')]=_[_0x2406('0x33')](_0x15b073[_0x2406('0x2f')],_0x15b073[_0x2406('0x30')]);_0x239137[_0x2406('0x34')]=_[_0x2406('0x33')](_0x15b073[_0x2406('0x2f')],qs[_0x2406('0x35')](_0x3a50e8[_0x2406('0x30')][_0x2406('0x35')]));_0x239137['attributes']=_0x239137[_0x2406('0x34')][_0x2406('0x36')]?_0x239137[_0x2406('0x34')]:_0x15b073[_0x2406('0x2f')];if(!_0x3a50e8['query'][_0x2406('0x37')]('nolimit')){_0x239137[_0x2406('0x38')]=qs[_0x2406('0x38')](_0x3a50e8['query'][_0x2406('0x38')]);_0x239137[_0x2406('0x1d')]=qs[_0x2406('0x1d')](_0x3a50e8[_0x2406('0x30')]['offset']);}_0x239137['order']=qs['sort'](_0x3a50e8['query'][_0x2406('0x39')]);_0x239137[_0x2406('0x3a')]=qs[_0x2406('0x32')](_[_0x2406('0x3b')](_0x3a50e8['query'],_0x15b073['filters']),_0x2e08ef);if(_0x3a50e8[_0x2406('0x30')][_0x2406('0x3c')]){_0x239137[_0x2406('0x3a')]=_[_0x2406('0x3d')](_0x239137[_0x2406('0x3a')],{'$or':_[_0x2406('0x2b')](_0x2e08ef,function(_0x29f69d){if(_0x29f69d[_0x2406('0x3e')]!==_0x2406('0x3f')){var _0x433e3e={};_0x433e3e[_0x29f69d[_0x2406('0x28')]]={'$like':'%'+_0x3a50e8[_0x2406('0x30')][_0x2406('0x3c')]+'%'};return _0x433e3e;}})});}_0x239137=_[_0x2406('0x3d')]({},_0x239137,_0x3a50e8[_0x2406('0x40')]);var _0x3ec1c7={'where':_0x239137[_0x2406('0x3a')]};return db[_0x2406('0x2c')][_0x2406('0x1f')](_0x3ec1c7)[_0x2406('0x25')](function(_0x74fc04){_0x2d38e0[_0x2406('0x1f')]=_0x74fc04;if(_0x3a50e8['query'][_0x2406('0x41')]){_0x239137[_0x2406('0x42')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x239137);})['then'](function(_0x36b1e1){_0x2d38e0['rows']=_0x36b1e1;return _0x2d38e0;})[_0x2406('0x25')](respondWithFilteredResult(_0x77a6f4,_0x239137))[_0x2406('0x43')](handleError(_0x77a6f4,null));};exports[_0x2406('0x44')]=function(_0x6ef3ad,_0x5448bd){var _0x3eb2f4={'raw':!![],'where':{'id':_0x6ef3ad['params']['id']}},_0x564b4c={};_0x564b4c[_0x2406('0x2f')]=_[_0x2406('0x31')](db[_0x2406('0x2c')][_0x2406('0x45')]);_0x564b4c[_0x2406('0x30')]=_[_0x2406('0x31')](_0x6ef3ad[_0x2406('0x30')]);_0x564b4c[_0x2406('0x32')]=_[_0x2406('0x33')](_0x564b4c[_0x2406('0x2f')],_0x564b4c[_0x2406('0x30')]);_0x3eb2f4[_0x2406('0x34')]=_['intersection'](_0x564b4c[_0x2406('0x2f')],qs['fields'](_0x6ef3ad['query'][_0x2406('0x35')]));_0x3eb2f4['attributes']=_0x3eb2f4[_0x2406('0x34')][_0x2406('0x36')]?_0x3eb2f4[_0x2406('0x34')]:_0x564b4c[_0x2406('0x2f')];if(_0x6ef3ad[_0x2406('0x30')][_0x2406('0x41')]){_0x3eb2f4[_0x2406('0x42')]=[{'all':!![]}];}_0x3eb2f4=_[_0x2406('0x3d')]({},_0x3eb2f4,_0x6ef3ad[_0x2406('0x40')]);return db[_0x2406('0x2c')][_0x2406('0x46')](_0x3eb2f4)[_0x2406('0x25')](handleEntityNotFound(_0x5448bd,null))['then'](respondWithResult(_0x5448bd,null))[_0x2406('0x43')](handleError(_0x5448bd,null));};exports['update']=function(_0x538af5,_0x6c8dbb){if(_0x538af5[_0x2406('0x47')]['id']){delete _0x538af5['body']['id'];}return db[_0x2406('0x2c')][_0x2406('0x46')]({'where':{'id':_0x538af5[_0x2406('0x48')]['id']}})[_0x2406('0x25')](handleEntityNotFound(_0x6c8dbb,null))[_0x2406('0x25')](saveUpdates(_0x538af5[_0x2406('0x47')],null))[_0x2406('0x25')](respondWithResult(_0x6c8dbb,null))['catch'](handleError(_0x6c8dbb,null));};exports[_0x2406('0x26')]=function(_0x392e11,_0x13cacc){return db['CmHopperBlack'][_0x2406('0x46')]({'where':{'id':_0x392e11[_0x2406('0x48')]['id']}})[_0x2406('0x25')](handleEntityNotFound(_0x13cacc,null))[_0x2406('0x25')](removeEntity(_0x13cacc,null))[_0x2406('0x43')](handleError(_0x13cacc,null));};exports[_0x2406('0x49')]=function(_0x39bb86,_0x2cd590){return db[_0x2406('0x2c')][_0x2406('0x49')]()['then'](respondWithResult(_0x2cd590,null))[_0x2406('0x43')](handleError(_0x2cd590,null));};
\ No newline at end of file
index bf31ed6..1c2a20f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x550c=['moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','api'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x550c,0x135));var _0xc550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc550('0x0'));var util=require(_0xc550('0x1'));var logger=require('../../config/logger')(_0xc550('0x2'));var moment=require(_0xc550('0x3'));var BPromise=require(_0xc550('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc550('0x5'));var rimraf=require(_0xc550('0x6'));var config=require(_0xc550('0x7'));var attributes=require(_0xc550('0x8'));module['exports']=function(_0x5f51a8,_0x5ce484){return _0x5f51a8[_0xc550('0x9')](_0xc550('0xa'),attributes,{'tableName':_0xc550('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4220=['api','moment','bluebird','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','cm_hopper_black','util','../../config/logger'];(function(_0x5e9125,_0x2fde4a){var _0x1b85a5=function(_0x264fd8){while(--_0x264fd8){_0x5e9125['push'](_0x5e9125['shift']());}};_0x1b85a5(++_0x2fde4a);}(_0x4220,0x76));var _0x0422=function(_0x21423c,_0x400720){_0x21423c=_0x21423c-0x0;var _0x283f66=_0x4220[_0x21423c];return _0x283f66;};'use strict';var _=require('lodash');var util=require(_0x0422('0x0'));var logger=require(_0x0422('0x1'))(_0x0422('0x2'));var moment=require(_0x0422('0x3'));var BPromise=require(_0x0422('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0422('0x5'));var config=require(_0x0422('0x6'));var attributes=require(_0x0422('0x7'));module[_0x0422('0x8')]=function(_0x4dddfb,_0x5b5b3d){return _0x4dddfb['define']('CmHopperBlack',attributes,{'tableName':_0x0422('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 30e04c0..46289c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc48d=['client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','map','include','model','UpdateCmHopperBlack','update','body','where','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x8306d6,_0x7dd7b4){var _0x21c9c8=function(_0x3f18a2){while(--_0x3f18a2){_0x8306d6['push'](_0x8306d6['shift']());}};_0x21c9c8(++_0x7dd7b4);}(_0xc48d,0x6b));var _0xdc48=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0xc48d[_0x389832];return _0x59429e;};'use strict';var _=require(_0xdc48('0x0'));var util=require(_0xdc48('0x1'));var moment=require('moment');var BPromise=require(_0xdc48('0x2'));var rs=require(_0xdc48('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc48('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc48('0x5'))(_0xdc48('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdc48('0x7')][_0xdc48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x409f49,_0x39200c,_0x1645c4){return new BPromise(function(_0x1e58ce,_0x112bdb){return client[_0xdc48('0x9')](_0x409f49,_0x1645c4)[_0xdc48('0xa')](function(_0x44a3c4){logger[_0xdc48('0xb')](_0xdc48('0xc'),_0x39200c,_0xdc48('0xd'));logger[_0xdc48('0xe')](_0xdc48('0xf'),_0x39200c,'request\x20sent',JSON[_0xdc48('0x10')](_0x44a3c4));if(_0x44a3c4['error']){if(_0x44a3c4[_0xdc48('0x11')][_0xdc48('0x12')]===0x1f4){logger['error'](_0xdc48('0xc'),_0x39200c,_0x44a3c4['error'][_0xdc48('0x13')]);return _0x112bdb(_0x44a3c4['error'][_0xdc48('0x13')]);}logger[_0xdc48('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x39200c,_0x44a3c4['error']['message']);return _0x1e58ce(_0x44a3c4[_0xdc48('0x11')]['message']);}else{logger[_0xdc48('0xb')](_0xdc48('0xc'),_0x39200c,_0xdc48('0xd'));_0x1e58ce(_0x44a3c4[_0xdc48('0x14')]['message']);}})[_0xdc48('0x15')](function(_0x4487fc){logger['error'](_0xdc48('0xc'),_0x39200c,_0x4487fc);_0x112bdb(_0x4487fc);});});}exports[_0xdc48('0x16')]=function(_0x568da9){var _0x9f0fdb=this;return new Promise(function(_0x282c1a,_0x43542f){return db[_0xdc48('0x17')][_0xdc48('0x18')]({'raw':_0x568da9[_0xdc48('0x19')]?_0x568da9[_0xdc48('0x19')][_0xdc48('0x1a')]===undefined?!![]:![]:!![],'where':_0x568da9[_0xdc48('0x19')]?_0x568da9['options']['where']||null:null,'attributes':_0x568da9[_0xdc48('0x19')]?_0x568da9[_0xdc48('0x19')][_0xdc48('0x1b')]||null:null,'limit':_0x568da9['options']?_0x568da9[_0xdc48('0x19')][_0xdc48('0x1c')]||null:null,'include':_0x568da9[_0xdc48('0x19')]?_0x568da9[_0xdc48('0x19')]['include']?_[_0xdc48('0x1d')](_0x568da9[_0xdc48('0x19')][_0xdc48('0x1e')],function(_0x2203cb){return{'model':db[_0x2203cb[_0xdc48('0x1f')]],'as':_0x2203cb['as'],'attributes':_0x2203cb[_0xdc48('0x1b')],'include':_0x2203cb[_0xdc48('0x1e')]?_[_0xdc48('0x1d')](_0x2203cb[_0xdc48('0x1e')],function(_0x4ae220){return{'model':db[_0x4ae220[_0xdc48('0x1f')]],'as':_0x4ae220['as'],'attributes':_0x4ae220[_0xdc48('0x1b')],'include':_0x4ae220[_0xdc48('0x1e')]?_[_0xdc48('0x1d')](_0x4ae220[_0xdc48('0x1e')],function(_0x3f7869){return{'model':db[_0x3f7869[_0xdc48('0x1f')]],'as':_0x3f7869['as'],'attributes':_0x3f7869[_0xdc48('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdc48('0xa')](function(_0x314ec5){logger[_0xdc48('0xb')](_0xdc48('0x16'),_0x568da9);logger[_0xdc48('0xe')](_0xdc48('0x16'),_0x568da9,JSON[_0xdc48('0x10')](_0x314ec5));_0x282c1a(_0x314ec5);})[_0xdc48('0x15')](function(_0x4d96ed){logger[_0xdc48('0x11')]('GetCmHopperBlack',_0x4d96ed[_0xdc48('0x13')],_0x568da9);_0x43542f(_0x9f0fdb['error'](0x1f4,_0x4d96ed['message']));});});};exports[_0xdc48('0x20')]=function(_0x2dec39){var _0x4a2a1a=this;return new Promise(function(_0x5bd75e,_0xe52cfd){return db[_0xdc48('0x17')][_0xdc48('0x21')](_0x2dec39[_0xdc48('0x22')],{'raw':_0x2dec39[_0xdc48('0x19')]?_0x2dec39[_0xdc48('0x19')][_0xdc48('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dec39['options']?_0x2dec39[_0xdc48('0x19')][_0xdc48('0x23')]||null:null,'attributes':_0x2dec39[_0xdc48('0x19')]?_0x2dec39['options'][_0xdc48('0x1b')]||null:null,'limit':_0x2dec39[_0xdc48('0x19')]?_0x2dec39[_0xdc48('0x19')][_0xdc48('0x1c')]||null:null})[_0xdc48('0xa')](function(_0x26d06b){logger[_0xdc48('0xb')](_0xdc48('0x20'),_0x2dec39);logger[_0xdc48('0xe')]('UpdateCmHopperBlack',_0x2dec39,JSON[_0xdc48('0x10')](_0x26d06b));_0x5bd75e(_0x26d06b);})['catch'](function(_0x62f9b8){logger['error']('UpdateCmHopperBlack',_0x62f9b8[_0xdc48('0x13')],_0x2dec39);_0xe52cfd(_0x4a2a1a[_0xdc48('0x11')](0x1f4,_0x62f9b8[_0xdc48('0x13')]));});});};exports[_0xdc48('0x24')]=function(_0x4212e8){var _0x5051bc=this;return new Promise(function(_0x468110,_0x2d50d5){return db[_0xdc48('0x17')][_0xdc48('0x25')]({'where':_0x4212e8[_0xdc48('0x19')]?_0x4212e8[_0xdc48('0x19')][_0xdc48('0x23')]||null:null})['then'](function(_0x59b253){logger[_0xdc48('0xb')](_0xdc48('0x24'),_0x4212e8);logger[_0xdc48('0xe')]('DestroyCmHopperBlack',_0x4212e8,JSON['stringify'](_0x59b253));_0x468110(_0x59b253);})['catch'](function(_0x373657){logger['error'](_0xdc48('0x24'),_0x373657[_0xdc48('0x13')],_0x4212e8);_0x2d50d5(_0x5051bc[_0xdc48('0x11')](0x1f4,_0x373657[_0xdc48('0x13')]));});});};
\ No newline at end of file
+var _0xff43=['catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','update','body','raw','UpdateCmHopperBlack','DestroyCmHopperBlack','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x10a5f3,_0x4e6887){var _0x1fa766=function(_0x16b9d4){while(--_0x16b9d4){_0x10a5f3['push'](_0x10a5f3['shift']());}};_0x1fa766(++_0x4e6887);}(_0xff43,0xc9));var _0x3ff4=function(_0x21f00d,_0x451261){_0x21f00d=_0x21f00d-0x0;var _0x1f84c8=_0xff43[_0x21f00d];return _0x1f84c8;};'use strict';var _=require('lodash');var util=require(_0x3ff4('0x0'));var moment=require(_0x3ff4('0x1'));var BPromise=require(_0x3ff4('0x2'));var rs=require(_0x3ff4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ff4('0x4'))['db'];var utils=require(_0x3ff4('0x5'));var logger=require(_0x3ff4('0x6'))(_0x3ff4('0x7'));var config=require(_0x3ff4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ff4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a5909,_0x3e31da,_0x513a90){return new BPromise(function(_0x32b816,_0x39859c){return client[_0x3ff4('0xa')](_0x1a5909,_0x513a90)[_0x3ff4('0xb')](function(_0xaebbe4){logger[_0x3ff4('0xc')](_0x3ff4('0xd'),_0x3e31da,_0x3ff4('0xe'));logger[_0x3ff4('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3e31da,_0x3ff4('0xe'),JSON[_0x3ff4('0x10')](_0xaebbe4));if(_0xaebbe4['error']){if(_0xaebbe4[_0x3ff4('0x11')][_0x3ff4('0x12')]===0x1f4){logger[_0x3ff4('0x11')](_0x3ff4('0xd'),_0x3e31da,_0xaebbe4[_0x3ff4('0x11')][_0x3ff4('0x13')]);return _0x39859c(_0xaebbe4['error'][_0x3ff4('0x13')]);}logger['error'](_0x3ff4('0xd'),_0x3e31da,_0xaebbe4[_0x3ff4('0x11')][_0x3ff4('0x13')]);return _0x32b816(_0xaebbe4[_0x3ff4('0x11')]['message']);}else{logger[_0x3ff4('0xc')](_0x3ff4('0xd'),_0x3e31da,_0x3ff4('0xe'));_0x32b816(_0xaebbe4[_0x3ff4('0x14')]['message']);}})[_0x3ff4('0x15')](function(_0x3b6fbc){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x3e31da,_0x3b6fbc);_0x39859c(_0x3b6fbc);});});}exports[_0x3ff4('0x16')]=function(_0x131d1a){var _0x13a2b6=this;return new Promise(function(_0x13ddbc,_0x582f6c){return db[_0x3ff4('0x17')][_0x3ff4('0x18')]({'raw':_0x131d1a[_0x3ff4('0x19')]?_0x131d1a['options']['raw']===undefined?!![]:![]:!![],'where':_0x131d1a[_0x3ff4('0x19')]?_0x131d1a[_0x3ff4('0x19')][_0x3ff4('0x1a')]||null:null,'attributes':_0x131d1a[_0x3ff4('0x19')]?_0x131d1a[_0x3ff4('0x19')][_0x3ff4('0x1b')]||null:null,'limit':_0x131d1a['options']?_0x131d1a['options'][_0x3ff4('0x1c')]||null:null,'include':_0x131d1a[_0x3ff4('0x19')]?_0x131d1a[_0x3ff4('0x19')]['include']?_['map'](_0x131d1a[_0x3ff4('0x19')][_0x3ff4('0x1d')],function(_0x7b38e7){return{'model':db[_0x7b38e7['model']],'as':_0x7b38e7['as'],'attributes':_0x7b38e7[_0x3ff4('0x1b')],'include':_0x7b38e7[_0x3ff4('0x1d')]?_[_0x3ff4('0x1e')](_0x7b38e7['include'],function(_0x3d6142){return{'model':db[_0x3d6142[_0x3ff4('0x1f')]],'as':_0x3d6142['as'],'attributes':_0x3d6142['attributes'],'include':_0x3d6142[_0x3ff4('0x1d')]?_[_0x3ff4('0x1e')](_0x3d6142[_0x3ff4('0x1d')],function(_0x17b3ef){return{'model':db[_0x17b3ef['model']],'as':_0x17b3ef['as'],'attributes':_0x17b3ef[_0x3ff4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3ff4('0xb')](function(_0x1839ed){logger[_0x3ff4('0xc')](_0x3ff4('0x16'),_0x131d1a);logger[_0x3ff4('0xf')]('GetCmHopperBlack',_0x131d1a,JSON[_0x3ff4('0x10')](_0x1839ed));_0x13ddbc(_0x1839ed);})[_0x3ff4('0x15')](function(_0x2390c6){logger['error'](_0x3ff4('0x16'),_0x2390c6[_0x3ff4('0x13')],_0x131d1a);_0x582f6c(_0x13a2b6[_0x3ff4('0x11')](0x1f4,_0x2390c6[_0x3ff4('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x2fcf9c){var _0x461ae7=this;return new Promise(function(_0x53f1c9,_0x89196d){return db[_0x3ff4('0x17')][_0x3ff4('0x20')](_0x2fcf9c[_0x3ff4('0x21')],{'raw':_0x2fcf9c[_0x3ff4('0x19')]?_0x2fcf9c[_0x3ff4('0x19')][_0x3ff4('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fcf9c['options']?_0x2fcf9c[_0x3ff4('0x19')]['where']||null:null,'attributes':_0x2fcf9c[_0x3ff4('0x19')]?_0x2fcf9c[_0x3ff4('0x19')][_0x3ff4('0x1b')]||null:null,'limit':_0x2fcf9c[_0x3ff4('0x19')]?_0x2fcf9c[_0x3ff4('0x19')][_0x3ff4('0x1c')]||null:null})[_0x3ff4('0xb')](function(_0x54e81d){logger[_0x3ff4('0xc')](_0x3ff4('0x23'),_0x2fcf9c);logger['debug'](_0x3ff4('0x23'),_0x2fcf9c,JSON[_0x3ff4('0x10')](_0x54e81d));_0x53f1c9(_0x54e81d);})[_0x3ff4('0x15')](function(_0x689beb){logger[_0x3ff4('0x11')]('UpdateCmHopperBlack',_0x689beb[_0x3ff4('0x13')],_0x2fcf9c);_0x89196d(_0x461ae7[_0x3ff4('0x11')](0x1f4,_0x689beb['message']));});});};exports['DestroyCmHopperBlack']=function(_0x4159f3){var _0x38a646=this;return new Promise(function(_0x8a176a,_0x493713){return db[_0x3ff4('0x17')]['destroy']({'where':_0x4159f3[_0x3ff4('0x19')]?_0x4159f3[_0x3ff4('0x19')][_0x3ff4('0x1a')]||null:null})[_0x3ff4('0xb')](function(_0x225d5f){logger['info'](_0x3ff4('0x24'),_0x4159f3);logger['debug'](_0x3ff4('0x24'),_0x4159f3,JSON[_0x3ff4('0x10')](_0x225d5f));_0x8a176a(_0x225d5f);})[_0x3ff4('0x15')](function(_0xc65596){logger[_0x3ff4('0x11')](_0x3ff4('0x24'),_0xc65596[_0x3ff4('0x13')],_0x4159f3);_0x493713(_0x38a646[_0x3ff4('0x11')](0x1f4,_0xc65596[_0x3ff4('0x13')]));});});};
\ No newline at end of file
index 40f3d36..0e8644d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82c4=['get','/describe','describe','show','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated'];(function(_0x2dabde,_0x3e2cf9){var _0x22b27c=function(_0x3451d4){while(--_0x3451d4){_0x2dabde['push'](_0x2dabde['shift']());}};_0x22b27c(++_0x3e2cf9);}(_0x82c4,0x1ca));var _0x482c=function(_0x113a7b,_0x3d8bae){_0x113a7b=_0x113a7b-0x0;var _0xa6fedf=_0x82c4[_0x113a7b];return _0xa6fedf;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var fs_extra=require(_0x482c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x482c('0x7'));var config=require('../../config/environment');var controller=require(_0x482c('0x8'));router['get']('/',auth[_0x482c('0x9')](),controller['index']);router[_0x482c('0xa')](_0x482c('0xb'),auth[_0x482c('0x9')](),controller[_0x482c('0xc')]);router[_0x482c('0xa')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0xd')]);router[_0x482c('0xe')](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x10')]);router['delete'](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xafc4=['multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','put','delete','destroy'];(function(_0xa3ae9a,_0x5a905d){var _0x260c65=function(_0x7374a3){while(--_0x7374a3){_0xa3ae9a['push'](_0xa3ae9a['shift']());}};_0x260c65(++_0x5a905d);}(_0xafc4,0x69));var _0x4afc=function(_0x5dd8af,_0x378175){_0x5dd8af=_0x5dd8af-0x0;var _0x51b2cf=_0xafc4[_0x5dd8af];return _0x51b2cf;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var fs_extra=require(_0x4afc('0x4'));var auth=require(_0x4afc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x4afc('0x6')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x8')]);router[_0x4afc('0x6')](_0x4afc('0x9'),auth[_0x4afc('0x7')](),controller['describe']);router[_0x4afc('0x6')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xb')]);router[_0x4afc('0xc')](_0x4afc('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4afc('0xd')]('/:id',auth[_0x4afc('0x7')](),controller[_0x4afc('0xe')]);module['exports']=router;
\ No newline at end of file
index d9a4ec9..e299dd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ca2=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x3bdb88,_0x36f661){var _0x25144d=function(_0x56e5a7){while(--_0x56e5a7){_0x3bdb88['push'](_0x3bdb88['shift']());}};_0x25144d(++_0x36f661);}(_0x5ca2,0xd5));var _0x25ca=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5ca2[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x25ca('0x0'));var moment=require(_0x25ca('0x1'));module[_0x25ca('0x2')]={'state':{'type':Sequelize[_0x25ca('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x25ca('0x4')]},'scheduledat':{'type':Sequelize[_0x25ca('0x5')]},'countbusyretry':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x25ca('0x4')]},'calleridname':{'type':Sequelize[_0x25ca('0x4')]},'starttime':{'type':Sequelize[_0x25ca('0x5')]},'responsetime':{'type':Sequelize[_0x25ca('0x5')]},'answertime':{'type':Sequelize[_0x25ca('0x5')]},'droptime':{'type':Sequelize[_0x25ca('0x5')]},'endtime':{'type':Sequelize[_0x25ca('0x5')]},'ringtime':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x25ca('0x4')]},'campaign':{'type':Sequelize[_0x25ca('0x4')]},'campaigntype':{'type':Sequelize[_0x25ca('0x4')]},'membername':{'type':Sequelize[_0x25ca('0x4')]},'reason':{'type':Sequelize[_0x25ca('0x4')]},'disposition':{'type':Sequelize[_0x25ca('0x4')]},'secondDisposition':{'type':Sequelize[_0x25ca('0x4')]},'thirdDisposition':{'type':Sequelize[_0x25ca('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x109ab2){var _0x5f39c9=this[_0x25ca('0x6')](_0x25ca('0x7'));if(_0x5f39c9&&_0x109ab2){this[_0x25ca('0x8')](_0x25ca('0x9'),moment(_0x109ab2)[_0x25ca('0xa')](moment(_0x5f39c9),_0x25ca('0xb')));}return this['setDataValue'](_0x25ca('0xc'),_0x109ab2);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x25ca('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x25ca('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x25ca('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x25ca('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x25ca('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x25ca('0x5')]},'deleted':{'type':Sequelize[_0x25ca('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x25ca('0x5')]},'recallme':{'type':Sequelize[_0x25ca('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x25ca('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x25ca('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc4c5=['diff','seconds','dispositionat','BOOLEAN','sequelize','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x444869,_0x3fd329){var _0x2fac8e=function(_0x482fa7){while(--_0x482fa7){_0x444869['push'](_0x444869['shift']());}};_0x2fac8e(++_0x3fd329);}(_0xc4c5,0x112));var _0x5c4c=function(_0xea81de,_0x28c9c5){_0xea81de=_0xea81de-0x0;var _0x4f6419=_0xc4c5[_0xea81de];return _0x4f6419;};'use strict';var Sequelize=require(_0x5c4c('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x5c4c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x5c4c('0x2')]},'scheduledat':{'type':Sequelize[_0x5c4c('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5c4c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5c4c('0x3')]},'responsetime':{'type':Sequelize[_0x5c4c('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5c4c('0x3')]},'ringtime':{'type':Sequelize[_0x5c4c('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5c4c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5c4c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5c4c('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5c4c('0x2')]},'campaign':{'type':Sequelize[_0x5c4c('0x2')]},'campaigntype':{'type':Sequelize[_0x5c4c('0x2')]},'membername':{'type':Sequelize[_0x5c4c('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5c4c('0x2')]},'secondDisposition':{'type':Sequelize[_0x5c4c('0x2')]},'thirdDisposition':{'type':Sequelize[_0x5c4c('0x2')]},'dispositionat':{'type':Sequelize[_0x5c4c('0x3')],'set':function(_0x2ec1a6){var _0x5c54fc=this[_0x5c4c('0x4')]('endtime');if(_0x5c54fc&&_0x2ec1a6){this[_0x5c4c('0x5')]('followuptime',moment(_0x2ec1a6)[_0x5c4c('0x6')](moment(_0x5c54fc),_0x5c4c('0x7')));}return this[_0x5c4c('0x5')](_0x5c4c('0x8'),_0x2ec1a6);}},'amd':{'type':Sequelize[_0x5c4c('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5c4c('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5c4c('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5c4c('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x5c4c('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5c4c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5c4c('0x3')]},'deleted':{'type':Sequelize[_0x5c4c('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5c4c('0x3')]},'recallme':{'type':Sequelize[_0x5c4c('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5c4c('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x5c4c('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5c4c('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5c4c('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index c8a1971..e55e1d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x2872b0,_0x4b0855){var _0x58b379=function(_0x18954b){while(--_0x18954b){_0x2872b0['push'](_0x2872b0['shift']());}};_0x58b379(++_0x4b0855);}(_0x781d,0x14a));var _0xd781=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x781d[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':!![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));};
\ No newline at end of file
+var _0x3f8a=['rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','group','Campaign','scheduledAt','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x5afa6b,_0x2e33ba){_0x5afa6b=_0x5afa6b-0x0;var _0x556819=_0x3f8a[_0x5afa6b];return _0x556819;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];function respondWithStatusCode(_0x2e71a0,_0x1afd01){_0x1afd01=_0x1afd01||0xcc;return function(_0x63de8b){if(_0x63de8b){return _0x2e71a0[_0xa3f8('0x1d')](_0x1afd01);}return _0x2e71a0[_0xa3f8('0x1e')](_0x1afd01)[_0xa3f8('0x1f')]();};}function respondWithResult(_0x2c5e15,_0x5b2c33){_0x5b2c33=_0x5b2c33||0xc8;return function(_0x2d8f74){if(_0x2d8f74){return _0x2c5e15[_0xa3f8('0x1e')](_0x5b2c33)[_0xa3f8('0x20')](_0x2d8f74);}};}function respondWithFilteredResult(_0x21a170,_0x5caebf){return function(_0x39c450){if(_0x39c450){var _0x33b98e=typeof _0x5caebf[_0xa3f8('0x21')]===_0xa3f8('0x22')&&typeof _0x5caebf[_0xa3f8('0x23')]===_0xa3f8('0x22');var _0x2f0659=_0x39c450[_0xa3f8('0x24')];var _0x2cb49f=_0x33b98e?0x0:_0x5caebf[_0xa3f8('0x21')];var _0x54b870=_0x33b98e?_0x39c450[_0xa3f8('0x24')]:_0x5caebf['offset']+_0x5caebf[_0xa3f8('0x23')];var _0x3dc3e5;if(_0x54b870>=_0x2f0659){_0x54b870=_0x2f0659;_0x3dc3e5=0xc8;}else{_0x3dc3e5=0xce;}_0x21a170[_0xa3f8('0x1e')](_0x3dc3e5);return _0x21a170[_0xa3f8('0x25')]('Content-Range',_0x2cb49f+'-'+_0x54b870+'/'+_0x2f0659)[_0xa3f8('0x20')](_0x39c450);}return null;};}function patchUpdates(_0x5b0d57){return function(_0x43c393){try{jsonpatch['apply'](_0x43c393,_0x5b0d57,!![]);}catch(_0x4066bb){return BPromise[_0xa3f8('0x26')](_0x4066bb);}return _0x43c393[_0xa3f8('0x27')]();};}function saveUpdates(_0x474893,_0x3a6a57){return function(_0x1e5f30){if(_0x1e5f30){return _0x1e5f30[_0xa3f8('0x28')](_0x474893)['then'](function(_0xae76ec){return _0xae76ec;});}return null;};}function removeEntity(_0x4d0e72,_0x3ce57b){return function(_0xa5a697){if(_0xa5a697){return _0xa5a697[_0xa3f8('0x29')]()[_0xa3f8('0x2a')](function(){_0x4d0e72[_0xa3f8('0x1e')](0xcc)[_0xa3f8('0x1f')]();});}};}function handleEntityNotFound(_0x6e3cb4,_0x34884d){return function(_0x1e22b8){if(!_0x1e22b8){_0x6e3cb4[_0xa3f8('0x1d')](0x194);}return _0x1e22b8;};}function handleError(_0x545a28,_0x1c3358){_0x1c3358=_0x1c3358||0x1f4;return function(_0x2d29c1){logger[_0xa3f8('0x2b')](_0x2d29c1['stack']);if(_0x2d29c1[_0xa3f8('0x2c')]){delete _0x2d29c1['name'];}_0x545a28[_0xa3f8('0x1e')](_0x1c3358)[_0xa3f8('0x2d')](_0x2d29c1);};}exports[_0xa3f8('0x2e')]=function(_0x4ea213,_0x458824){var _0x5e69e2={},_0x21c57e={},_0x4281ea={'count':0x0,'rows':[]};var _0x226153=_[_0xa3f8('0x2f')](db[_0xa3f8('0x30')][_0xa3f8('0x31')],function(_0x23c854){return{'name':_0x23c854[_0xa3f8('0x32')],'type':_0x23c854[_0xa3f8('0x33')][_0xa3f8('0x34')]};});_0x21c57e[_0xa3f8('0x35')]=_['map'](_0x226153,_0xa3f8('0x2c'));_0x21c57e[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](_0x4ea213[_0xa3f8('0x36')]);_0x21c57e[_0xa3f8('0x38')]=_['intersection'](_0x21c57e[_0xa3f8('0x35')],_0x21c57e[_0xa3f8('0x36')]);_0x5e69e2['attributes']=_[_0xa3f8('0x39')](_0x21c57e[_0xa3f8('0x35')],qs['fields'](_0x4ea213[_0xa3f8('0x36')]['fields']));_0x5e69e2['attributes']=_0x5e69e2[_0xa3f8('0x3a')][_0xa3f8('0x3b')]?_0x5e69e2['attributes']:_0x21c57e[_0xa3f8('0x35')];if(!_0x4ea213['query'][_0xa3f8('0x3c')](_0xa3f8('0x3d'))){_0x5e69e2[_0xa3f8('0x23')]=qs[_0xa3f8('0x23')](_0x4ea213['query'][_0xa3f8('0x23')]);_0x5e69e2['offset']=qs[_0xa3f8('0x21')](_0x4ea213['query'][_0xa3f8('0x21')]);}_0x5e69e2['order']=qs['sort'](_0x4ea213['query'][_0xa3f8('0x3e')]);_0x5e69e2[_0xa3f8('0x3f')]=qs[_0xa3f8('0x38')](_[_0xa3f8('0x40')](_0x4ea213['query'],_0x21c57e[_0xa3f8('0x38')]),_0x226153);if(_0x4ea213[_0xa3f8('0x36')][_0xa3f8('0x41')]){_0x5e69e2[_0xa3f8('0x3f')]=_[_0xa3f8('0x42')](_0x5e69e2[_0xa3f8('0x3f')],{'$or':_['map'](_0x226153,function(_0x14db5b){if(_0x14db5b[_0xa3f8('0x33')]!==_0xa3f8('0x43')){var _0x51de10={};_0x51de10[_0x14db5b[_0xa3f8('0x2c')]]={'$like':'%'+_0x4ea213[_0xa3f8('0x36')]['filter']+'%'};return _0x51de10;}})});}_0x5e69e2=_[_0xa3f8('0x42')]({},_0x5e69e2,_0x4ea213['options']);var _0xbf8209={'where':_0x5e69e2['where']};return db[_0xa3f8('0x30')][_0xa3f8('0x24')](_0xbf8209)[_0xa3f8('0x2a')](function(_0x2a77be){_0x4281ea[_0xa3f8('0x24')]=_0x2a77be;if(_0x4ea213['query'][_0xa3f8('0x44')]){_0x5e69e2[_0xa3f8('0x45')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xa3f8('0x46')](_0x5e69e2);})['then'](function(_0x6ff4d4){_0x4281ea[_0xa3f8('0x47')]=_0x6ff4d4;return _0x4281ea;})[_0xa3f8('0x2a')](respondWithFilteredResult(_0x458824,_0x5e69e2))[_0xa3f8('0x48')](handleError(_0x458824,null));};exports[_0xa3f8('0x49')]=function(_0x4d2b8b,_0x180e87){var _0x2b17ff={'raw':!![],'where':{'id':_0x4d2b8b[_0xa3f8('0x4a')]['id']}},_0x23fe02={};_0x23fe02[_0xa3f8('0x35')]=_['keys'](db[_0xa3f8('0x30')][_0xa3f8('0x31')]);_0x23fe02[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](_0x4d2b8b[_0xa3f8('0x36')]);_0x23fe02[_0xa3f8('0x38')]=_[_0xa3f8('0x39')](_0x23fe02[_0xa3f8('0x35')],_0x23fe02[_0xa3f8('0x36')]);_0x2b17ff[_0xa3f8('0x3a')]=_[_0xa3f8('0x39')](_0x23fe02[_0xa3f8('0x35')],qs[_0xa3f8('0x4b')](_0x4d2b8b['query']['fields']));_0x2b17ff['attributes']=_0x2b17ff[_0xa3f8('0x3a')][_0xa3f8('0x3b')]?_0x2b17ff[_0xa3f8('0x3a')]:_0x23fe02[_0xa3f8('0x35')];if(_0x4d2b8b[_0xa3f8('0x36')][_0xa3f8('0x44')]){_0x2b17ff['include']=[{'all':!![]}];}_0x2b17ff=_[_0xa3f8('0x42')]({},_0x2b17ff,_0x4d2b8b[_0xa3f8('0x4c')]);return db[_0xa3f8('0x30')][_0xa3f8('0x4d')](_0x2b17ff)['then'](handleEntityNotFound(_0x180e87,null))[_0xa3f8('0x2a')](respondWithResult(_0x180e87,null))[_0xa3f8('0x48')](handleError(_0x180e87,null));};exports[_0xa3f8('0x4e')]=function(_0x523b46,_0x5cae9e){return db['CmHopperFinal'][_0xa3f8('0x4e')]()[_0xa3f8('0x2a')](respondWithResult(_0x5cae9e,null))['catch'](handleError(_0x5cae9e,null));};exports[_0xa3f8('0x28')]=function(_0x1f7af7,_0x410de5){if(_0x1f7af7[_0xa3f8('0x4f')][_0xa3f8('0x50')]){delete _0x1f7af7[_0xa3f8('0x4f')][_0xa3f8('0x50')];}return db[_0xa3f8('0x30')][_0xa3f8('0x4d')]({'where':{'uniqueid':_0x1f7af7[_0xa3f8('0x4a')]['id']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x410de5,null))[_0xa3f8('0x2a')](saveUpdates(_0x1f7af7[_0xa3f8('0x4f')],null))[_0xa3f8('0x2a')](respondWithResult(_0x410de5,null))[_0xa3f8('0x48')](handleError(_0x410de5,null));};exports[_0xa3f8('0x51')]=function(_0x42082d,_0x559ae7,_0x4addd2){return db[_0xa3f8('0x30')][_0xa3f8('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x42082d['params']['id']},'attributes':[[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x55')))),_0xa3f8('0x56')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x57')))),_0xa3f8('0x58')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db['sequelize'][_0xa3f8('0x54')]('`state`\x20=\x205,\x201,\x20null'))),_0xa3f8('0x59')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5a')))),_0xa3f8('0x5b')],[db['sequelize']['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5c')))),'dropContacts'],[db['sequelize']['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa3f8('0x5d')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0xa3f8('0x5e')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5f')))),'answeringMachine']]})['then'](handleEntityNotFound(_0x559ae7,null))['then'](respondWithResult(_0x559ae7,null))[_0xa3f8('0x48')](handleError(_0x559ae7,null));};exports[_0xa3f8('0x60')]=function(_0x3096d0,_0x398f64,_0x185b38){return db[_0xa3f8('0x30')][_0xa3f8('0x46')]({'raw':![],'where':{'CampaignId':_0x3096d0[_0xa3f8('0x4a')]['id']},'attributes':[[db['sequelize']['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x55')))),_0xa3f8('0x56')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')]['literal'](_0xa3f8('0x57')))),_0xa3f8('0x58')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5a')))),_0xa3f8('0x5b')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5c')))),_0xa3f8('0x61')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x62')))),_0xa3f8('0x5d')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x63')))),_0xa3f8('0x5e')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5f')))),'answeringMachine']]})[_0xa3f8('0x2a')](handleEntityNotFound(_0x398f64,null))[_0xa3f8('0x2a')](respondWithResult(_0x398f64,null))['catch'](handleError(_0x398f64,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x1955aa,_0x296931,_0x2c0f71){return db[_0xa3f8('0x64')][_0xa3f8('0x4d')]({'where':{'id':_0x1955aa[_0xa3f8('0x4a')]['id']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x296931,null))[_0xa3f8('0x2a')](function(_0x4f5f62){var _0xf76898;if(_0x4f5f62){_0xf76898=squel[_0xa3f8('0x65')]()[_0xa3f8('0x66')]('cm_hopper')[_0xa3f8('0x67')]([_0xa3f8('0x68'),'scheduledAt',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b'),_0xa3f8('0x6c'),_0xa3f8('0x6d')],squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x70'),_0xa3f8('0x68'))['field'](_0xa3f8('0x71'),'scheduledAt')[_0xa3f8('0x6f')]('ANY_VALUE(ContactId)',_0xa3f8('0x69'))[_0xa3f8('0x6f')](_0xa3f8('0x72'),_0xa3f8('0x6a'))[_0xa3f8('0x6f')]('ANY_VALUE(VoiceQueueId)',_0xa3f8('0x6b'))[_0xa3f8('0x6f')]('NOW()',_0xa3f8('0x6c'))[_0xa3f8('0x6f')](_0xa3f8('0x71'),_0xa3f8('0x6d'))[_0xa3f8('0x73')](_0xa3f8('0x74'))['where'](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id'][_0xa3f8('0x76')]())['where'](_0xa3f8('0x77'),_0x1955aa['body'][_0xa3f8('0x78')]['toString']())['where'](_0xa3f8('0x79'))['where'](_0xa3f8('0x7a'),squel['select']()[_0xa3f8('0x6f')](_0xa3f8('0x68'))[_0xa3f8('0x73')](_0xa3f8('0x7b'))['where'](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id']['toString']()))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x7c'))[_0xa3f8('0x73')](_0xa3f8('0x74'))[_0xa3f8('0x3f')](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id']['toString']())[_0xa3f8('0x3f')](_0xa3f8('0x7d')))[_0xa3f8('0x7e')](_0xa3f8('0x69')))[_0xa3f8('0x76')]();return db[_0xa3f8('0x52')][_0xa3f8('0x36')](_0xf76898);}return[];})[_0xa3f8('0x2a')](respondWithResult(_0x296931,null))[_0xa3f8('0x48')](handleError(_0x296931,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2e2d99,_0x3da7ee,_0x3f6834){return db[_0xa3f8('0x7f')][_0xa3f8('0x4d')]({'where':{'id':_0x2e2d99[_0xa3f8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3da7ee,null))[_0xa3f8('0x2a')](function(_0x3175fc){var _0x224199;if(_0x3175fc){_0x224199=squel[_0xa3f8('0x65')]()['into'](_0xa3f8('0x7b'))[_0xa3f8('0x67')]([_0xa3f8('0x68'),_0xa3f8('0x80'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x81'),_0xa3f8('0x6c'),_0xa3f8('0x6d')],squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')]('ANY_VALUE(calleridnum)',_0xa3f8('0x68'))['field'](_0xa3f8('0x71'),_0xa3f8('0x80'))[_0xa3f8('0x6f')](_0xa3f8('0x82'),_0xa3f8('0x69'))[_0xa3f8('0x6f')](_0xa3f8('0x72'),_0xa3f8('0x6a'))['field'](_0xa3f8('0x83'),'CampaignId')[_0xa3f8('0x6f')]('NOW()',_0xa3f8('0x6c'))['field'](_0xa3f8('0x71'),_0xa3f8('0x6d'))[_0xa3f8('0x73')](_0xa3f8('0x74'))['where'](_0xa3f8('0x84'),_0x2e2d99[_0xa3f8('0x4a')]['id'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x77'),_0x2e2d99[_0xa3f8('0x4f')]['state'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x79'))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel['select']()[_0xa3f8('0x6f')](_0xa3f8('0x68'))['from'](_0xa3f8('0x7b'))[_0xa3f8('0x3f')](_0xa3f8('0x84'),_0x2e2d99['params']['id'][_0xa3f8('0x76')]()))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x7c'))[_0xa3f8('0x73')]('cm_hopper_final')[_0xa3f8('0x3f')](_0xa3f8('0x84'),_0x2e2d99['params']['id'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x7d')))[_0xa3f8('0x7e')](_0xa3f8('0x69')))[_0xa3f8('0x76')]();return db[_0xa3f8('0x52')]['query'](_0x224199);}return[];})[_0xa3f8('0x2a')](respondWithResult(_0x3da7ee,null))[_0xa3f8('0x48')](handleError(_0x3da7ee,null));};exports[_0xa3f8('0x85')]=function(_0x2eaf1e,_0x39494d,_0x1673ac){return db[_0xa3f8('0x86')]['findOne']({'where':{'VoiceQueueId':_0x2eaf1e[_0xa3f8('0x4f')][_0xa3f8('0x6b')],'CampaignId':_0x2eaf1e[_0xa3f8('0x4f')][_0xa3f8('0x81')],'ContactId':_0x2eaf1e['body']['ContactId']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x39494d,null))['then'](function(_0x36f6c4){if(_0x36f6c4){return _0x36f6c4;}return null;})[_0xa3f8('0x2a')](respondWithResult(_0x39494d,null))[_0xa3f8('0x48')](handleError(_0x39494d,null));};
\ No newline at end of file
index afdae6d..98f4fa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc436=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x579bfc,_0x2e2eea){var _0x4711e4=function(_0x3f99db){while(--_0x3f99db){_0x579bfc['push'](_0x579bfc['shift']());}};_0x4711e4(++_0x2e2eea);}(_0xc436,0xec));var _0x6c43=function(_0x599a69,_0x37ea47){_0x599a69=_0x599a69-0x0;var _0x3421fa=_0xc436[_0x599a69];return _0x3421fa;};'use strict';var _=require(_0x6c43('0x0'));var util=require(_0x6c43('0x1'));var logger=require(_0x6c43('0x2'))('api');var moment=require(_0x6c43('0x3'));var BPromise=require(_0x6c43('0x4'));var rp=require(_0x6c43('0x5'));var fs=require('fs');var path=require(_0x6c43('0x6'));var rimraf=require(_0x6c43('0x7'));var config=require(_0x6c43('0x8'));var attributes=require(_0x6c43('0x9'));module['exports']=function(_0x59ca25,_0x27c443){return _0x59ca25[_0x6c43('0xa')](_0x6c43('0xb'),attributes,{'tableName':_0x6c43('0xc'),'paranoid':![],'indexes':[{'name':_0x6c43('0xd'),'fields':[_0x6c43('0xd')]},{'name':'uniqueid','fields':[_0x6c43('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x45b4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','lodash','util','../../config/logger','api'];(function(_0x5bfd0f,_0x128006){var _0x5cfe39=function(_0x26bf9c){while(--_0x26bf9c){_0x5bfd0f['push'](_0x5bfd0f['shift']());}};_0x5cfe39(++_0x128006);}(_0x45b4,0x10a));var _0x445b=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0x45b4[_0x1d3577];return _0x277d9a;};'use strict';var _=require(_0x445b('0x0'));var util=require(_0x445b('0x1'));var logger=require(_0x445b('0x2'))(_0x445b('0x3'));var moment=require(_0x445b('0x4'));var BPromise=require(_0x445b('0x5'));var rp=require(_0x445b('0x6'));var fs=require('fs');var path=require(_0x445b('0x7'));var rimraf=require(_0x445b('0x8'));var config=require(_0x445b('0x9'));var attributes=require(_0x445b('0xa'));module[_0x445b('0xb')]=function(_0x5253eb,_0xdf9c43){return _0x5253eb['define'](_0x445b('0xc'),attributes,{'tableName':_0x445b('0xd'),'paranoid':![],'indexes':[{'name':_0x445b('0xe'),'fields':[_0x445b('0xe')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 8b2a364..521a52d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2b78a2,_0x59aa60){var _0x1ed13a=function(_0x38d028){while(--_0x38d028){_0x2b78a2['push'](_0x2b78a2['shift']());}};_0x1ed13a(++_0x59aa60);}(_0x7a54,0x106));var _0x47a5=function(_0x15bcb8,_0x2b9763){_0x15bcb8=_0x15bcb8-0x0;var _0x270d9a=_0x7a54[_0x15bcb8];return _0x270d9a;};'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')]('CmHopperFinal,\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);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3763a0,_0x168777){var _0x3535f1=function(_0x31e933){while(--_0x31e933){_0x3763a0['push'](_0x3763a0['shift']());}};_0x3535f1(++_0x168777);}(_0xb10b,0x12a));var _0xbb10=function(_0x47640d,_0x109c5a){_0x47640d=_0x47640d-0x0;var _0x22246f=_0xb10b[_0x47640d];return _0x22246f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
index 2716bb5..e18d6df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed35=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','index','/describe','describe','/:id','show','get','/voice/queue/countAttributes/:id','isAuthenticated','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x14c682,_0x1b1e86){var _0x28fb04=function(_0x3d1e3c){while(--_0x3d1e3c){_0x14c682['push'](_0x14c682['shift']());}};_0x28fb04(++_0x1b1e86);}(_0xed35,0xaa));var _0x5ed3=function(_0x1710cc,_0x4b9181){_0x1710cc=_0x1710cc-0x0;var _0x552220=_0xed35[_0x1710cc];return _0x552220;};'use strict';var multer=require(_0x5ed3('0x0'));var util=require(_0x5ed3('0x1'));var path=require('path');var timeout=require(_0x5ed3('0x2'));var express=require(_0x5ed3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5ed3('0x4'));var interaction=require(_0x5ed3('0x5'));var config=require('../../config/environment');var controller=require(_0x5ed3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5ed3('0x7')]);router['get'](_0x5ed3('0x8'),auth['isAuthenticated'](),controller[_0x5ed3('0x9')]);router['get'](_0x5ed3('0xa'),auth['isAuthenticated'](),controller[_0x5ed3('0xb')]);router[_0x5ed3('0xc')](_0x5ed3('0xd'),auth[_0x5ed3('0xe')](),controller[_0x5ed3('0xf')]);router[_0x5ed3('0xc')](_0x5ed3('0x10'),auth[_0x5ed3('0xe')](),controller[_0x5ed3('0x11')]);router[_0x5ed3('0x12')](_0x5ed3('0x13'),auth[_0x5ed3('0xe')](),controller[_0x5ed3('0x14')]);router[_0x5ed3('0x12')](_0x5ed3('0x15'),auth['isAuthenticated'](),controller[_0x5ed3('0x16')]);router['post'](_0x5ed3('0x17'),auth['isAuthenticated'](),controller[_0x5ed3('0x18')]);router[_0x5ed3('0x19')](_0x5ed3('0xa'),auth['isAuthenticated'](),controller[_0x5ed3('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x3222=['countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id'];(function(_0x260952,_0x1484bb){var _0x4fa779=function(_0x5f246c){while(--_0x5f246c){_0x260952['push'](_0x260952['shift']());}};_0x4fa779(++_0x1484bb);}(_0x3222,0xe1));var _0x2322=function(_0x25890d,_0x117550){_0x25890d=_0x25890d-0x0;var _0x2873e3=_0x3222[_0x25890d];return _0x2873e3;};'use strict';var multer=require(_0x2322('0x0'));var util=require(_0x2322('0x1'));var path=require(_0x2322('0x2'));var timeout=require(_0x2322('0x3'));var express=require(_0x2322('0x4'));var router=express[_0x2322('0x5')]();var fs_extra=require(_0x2322('0x6'));var auth=require(_0x2322('0x7'));var interaction=require(_0x2322('0x8'));var config=require(_0x2322('0x9'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x2322('0xa')](),controller[_0x2322('0xb')]);router[_0x2322('0xc')]('/describe',auth[_0x2322('0xa')](),controller[_0x2322('0xd')]);router[_0x2322('0xc')](_0x2322('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x2322('0xc')]('/voice/queue/countAttributes/:id',auth[_0x2322('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x2322('0xc')]('/campaign/countAttributes/:id',auth[_0x2322('0xa')](),controller[_0x2322('0xf')]);router[_0x2322('0x10')](_0x2322('0x11'),auth[_0x2322('0xa')](),controller[_0x2322('0x12')]);router[_0x2322('0x10')](_0x2322('0x13'),auth['isAuthenticated'](),controller[_0x2322('0x14')]);router[_0x2322('0x10')](_0x2322('0x15'),auth['isAuthenticated'](),controller[_0x2322('0x16')]);router['put'](_0x2322('0xe'),auth[_0x2322('0xa')](),controller['update']);module[_0x2322('0x17')]=router;
\ No newline at end of file
index 9b9218e..8427267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c58=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x18f6e2,_0x12fa30){var _0x2daf9f=function(_0xd3a8a4){while(--_0xd3a8a4){_0x18f6e2['push'](_0x18f6e2['shift']());}};_0x2daf9f(++_0x12fa30);}(_0x3c58,0xaa));var _0x83c5=function(_0x4a1220,_0x8f8337){_0x4a1220=_0x4a1220-0x0;var _0x1fcb2d=_0x3c58[_0x4a1220];return _0x1fcb2d;};'use strict';var Sequelize=require(_0x83c5('0x0'));module[_0x83c5('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x83c5('0x2')]},'scheduledat':{'type':Sequelize[_0x83c5('0x3')]},'countbusyretry':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x83c5('0x2')]},'originatecalleridname':{'type':Sequelize[_0x83c5('0x2')]},'calleridnum':{'type':Sequelize[_0x83c5('0x2')]},'calleridname':{'type':Sequelize[_0x83c5('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x83c5('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x83c5('0x2')]},'reason':{'type':Sequelize[_0x83c5('0x2')]},'amd':{'type':Sequelize[_0x83c5('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x83c5('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x83c5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x83c5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x83c5('0x3')]},'recallme':{'type':Sequelize[_0x83c5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x83c5('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x83c5('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x83c5('0x2')]}};
\ No newline at end of file
+var _0x7fab=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x14e521,_0x53742a){var _0x334d5f=function(_0x5ae19e){while(--_0x5ae19e){_0x14e521['push'](_0x14e521['shift']());}};_0x334d5f(++_0x53742a);}(_0x7fab,0xd0));var _0xb7fa=function(_0x4014c8,_0x38efb6){_0x4014c8=_0x4014c8-0x0;var _0x194847=_0x7fab[_0x4014c8];return _0x194847;};'use strict';var Sequelize=require(_0xb7fa('0x0'));module[_0xb7fa('0x1')]={'state':{'type':Sequelize[_0xb7fa('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb7fa('0x3')]},'scheduledat':{'type':Sequelize[_0xb7fa('0x4')]},'countbusyretry':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb7fa('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xb7fa('0x3')]},'originatecalleridname':{'type':Sequelize[_0xb7fa('0x3')]},'calleridnum':{'type':Sequelize[_0xb7fa('0x3')]},'calleridname':{'type':Sequelize[_0xb7fa('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb7fa('0x4')]},'answertime':{'type':Sequelize[_0xb7fa('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb7fa('0x4')]},'ringtime':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb7fa('0x3')]},'campaign':{'type':Sequelize[_0xb7fa('0x3')]},'campaigntype':{'type':Sequelize[_0xb7fa('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xb7fa('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xb7fa('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb7fa('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb7fa('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xb7fa('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb7fa('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb7fa('0x3')]}};
\ No newline at end of file
index a677df3..b55f6be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a52=['nolimit','order','sort','where','filters','merge','filter','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','uniqueid','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','model','query','keys','attributes','length','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2a52,0x134));var _0x22a5=function(_0x22048d,_0x30c7d3){_0x22048d=_0x22048d-0x0;var _0x33328b=_0x2a52[_0x22048d];return _0x33328b;};'use strict';var emlformat=require(_0x22a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22a5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x22a5('0x2'));var moment=require('moment');var BPromise=require(_0x22a5('0x3'));var Mustache=require(_0x22a5('0x4'));var util=require(_0x22a5('0x5'));var path=require(_0x22a5('0x6'));var sox=require(_0x22a5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22a5('0x8'));var _=require(_0x22a5('0x9'));var squel=require(_0x22a5('0xa'));var crypto=require('crypto');var jsforce=require(_0x22a5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x22a5('0xc'));var querystring=require('querystring');var Papa=require(_0x22a5('0xd'));var Redis=require(_0x22a5('0xe'));var authService=require(_0x22a5('0xf'));var qs=require(_0x22a5('0x10'));var as=require(_0x22a5('0x11'));var hardwareService=require(_0x22a5('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x22a5('0x13'));var licenseUtil=require(_0x22a5('0x14'));var db=require(_0x22a5('0x15'))['db'];function respondWithStatusCode(_0x1c0dc5,_0x4847db){_0x4847db=_0x4847db||0xcc;return function(_0x3d67fb){if(_0x3d67fb){return _0x1c0dc5['sendStatus'](_0x4847db);}return _0x1c0dc5[_0x22a5('0x16')](_0x4847db)[_0x22a5('0x17')]();};}function respondWithResult(_0x1f3ee9,_0x28d95e){_0x28d95e=_0x28d95e||0xc8;return function(_0xb3c7ad){if(_0xb3c7ad){return _0x1f3ee9[_0x22a5('0x16')](_0x28d95e)[_0x22a5('0x18')](_0xb3c7ad);}};}function respondWithFilteredResult(_0x26c9ef,_0x1c3f9a){return function(_0x587b7b){if(_0x587b7b){var _0x364e10=typeof _0x1c3f9a[_0x22a5('0x19')]==='undefined'&&typeof _0x1c3f9a[_0x22a5('0x1a')]===_0x22a5('0x1b');var _0xf3f219=_0x587b7b[_0x22a5('0x1c')];var _0x3a008d=_0x364e10?0x0:_0x1c3f9a[_0x22a5('0x19')];var _0x14be62=_0x364e10?_0x587b7b[_0x22a5('0x1c')]:_0x1c3f9a[_0x22a5('0x19')]+_0x1c3f9a['limit'];var _0x9bf400;if(_0x14be62>=_0xf3f219){_0x14be62=_0xf3f219;_0x9bf400=0xc8;}else{_0x9bf400=0xce;}_0x26c9ef[_0x22a5('0x16')](_0x9bf400);return _0x26c9ef['set'](_0x22a5('0x1d'),_0x3a008d+'-'+_0x14be62+'/'+_0xf3f219)[_0x22a5('0x18')](_0x587b7b);}return null;};}function patchUpdates(_0x3834b9){return function(_0x985477){try{jsonpatch[_0x22a5('0x1e')](_0x985477,_0x3834b9,!![]);}catch(_0x42c466){return BPromise[_0x22a5('0x1f')](_0x42c466);}return _0x985477[_0x22a5('0x20')]();};}function saveUpdates(_0x55ec2d,_0xd96a4b){return function(_0x43e08c){if(_0x43e08c){return _0x43e08c[_0x22a5('0x21')](_0x55ec2d)[_0x22a5('0x22')](function(_0x12d5b8){return _0x12d5b8;});}return null;};}function removeEntity(_0x2cf703,_0x384839){return function(_0x2dc5bd){if(_0x2dc5bd){return _0x2dc5bd[_0x22a5('0x23')]()[_0x22a5('0x22')](function(){_0x2cf703[_0x22a5('0x16')](0xcc)[_0x22a5('0x17')]();});}};}function handleEntityNotFound(_0x671d9,_0x2b399e){return function(_0x1f0045){if(!_0x1f0045){_0x671d9[_0x22a5('0x24')](0x194);}return _0x1f0045;};}function handleError(_0x4cf8fb,_0x25b6cb){_0x25b6cb=_0x25b6cb||0x1f4;return function(_0x2afb28){logger[_0x22a5('0x25')](_0x2afb28[_0x22a5('0x26')]);if(_0x2afb28[_0x22a5('0x27')]){delete _0x2afb28[_0x22a5('0x27')];}_0x4cf8fb[_0x22a5('0x16')](_0x25b6cb)[_0x22a5('0x28')](_0x2afb28);};}exports[_0x22a5('0x29')]=function(_0x3fff91,_0x1e8910){var _0x3845fb={},_0x40af16={},_0x2ea2b6={'count':0x0,'rows':[]};var _0x1e1a2f=_[_0x22a5('0x2a')](db[_0x22a5('0x2b')][_0x22a5('0x2c')],function(_0x25b49a){return{'name':_0x25b49a[_0x22a5('0x2d')],'type':_0x25b49a['type']['key']};});_0x40af16[_0x22a5('0x2e')]=_[_0x22a5('0x2a')](_0x1e1a2f,_0x22a5('0x27'));_0x40af16[_0x22a5('0x2f')]=_[_0x22a5('0x30')](_0x3fff91[_0x22a5('0x2f')]);_0x40af16['filters']=_['intersection'](_0x40af16[_0x22a5('0x2e')],_0x40af16['query']);_0x3845fb[_0x22a5('0x31')]=_['intersection'](_0x40af16[_0x22a5('0x2e')],qs['fields'](_0x3fff91['query']['fields']));_0x3845fb[_0x22a5('0x31')]=_0x3845fb[_0x22a5('0x31')][_0x22a5('0x32')]?_0x3845fb[_0x22a5('0x31')]:_0x40af16[_0x22a5('0x2e')];if(!_0x3fff91[_0x22a5('0x2f')][_0x22a5('0x33')](_0x22a5('0x34'))){_0x3845fb[_0x22a5('0x1a')]=qs[_0x22a5('0x1a')](_0x3fff91[_0x22a5('0x2f')]['limit']);_0x3845fb[_0x22a5('0x19')]=qs[_0x22a5('0x19')](_0x3fff91['query']['offset']);}_0x3845fb[_0x22a5('0x35')]=qs['sort'](_0x3fff91['query'][_0x22a5('0x36')]);_0x3845fb[_0x22a5('0x37')]=qs[_0x22a5('0x38')](_['pick'](_0x3fff91['query'],_0x40af16[_0x22a5('0x38')]),_0x1e1a2f);if(_0x3fff91[_0x22a5('0x2f')]['filter']){_0x3845fb[_0x22a5('0x37')]=_[_0x22a5('0x39')](_0x3845fb[_0x22a5('0x37')],{'$or':_[_0x22a5('0x2a')](_0x1e1a2f,function(_0xe7ea10){if(_0xe7ea10['type']!=='VIRTUAL'){var _0x5a66d3={};_0x5a66d3[_0xe7ea10['name']]={'$like':'%'+_0x3fff91['query'][_0x22a5('0x3a')]+'%'};return _0x5a66d3;}})});}_0x3845fb=_[_0x22a5('0x39')]({},_0x3845fb,_0x3fff91[_0x22a5('0x3b')]);var _0x2fae71={'where':_0x3845fb['where']};return db[_0x22a5('0x2b')][_0x22a5('0x1c')](_0x2fae71)[_0x22a5('0x22')](function(_0x2e502f){_0x2ea2b6[_0x22a5('0x1c')]=_0x2e502f;if(_0x3fff91[_0x22a5('0x2f')][_0x22a5('0x3c')]){_0x3845fb[_0x22a5('0x3d')]=[{'all':!![]}];}return db[_0x22a5('0x2b')][_0x22a5('0x3e')](_0x3845fb);})[_0x22a5('0x22')](function(_0x23d50a){_0x2ea2b6[_0x22a5('0x3f')]=_0x23d50a;return _0x2ea2b6;})['then'](respondWithFilteredResult(_0x1e8910,_0x3845fb))[_0x22a5('0x40')](handleError(_0x1e8910,null));};exports['show']=function(_0xe67d40,_0x425af2){var _0x2d7c00={'raw':!![],'where':{'id':_0xe67d40[_0x22a5('0x41')]['id']}},_0x2923fb={};_0x2923fb[_0x22a5('0x2e')]=_['keys'](db[_0x22a5('0x2b')]['rawAttributes']);_0x2923fb[_0x22a5('0x2f')]=_[_0x22a5('0x30')](_0xe67d40[_0x22a5('0x2f')]);_0x2923fb[_0x22a5('0x38')]=_[_0x22a5('0x42')](_0x2923fb[_0x22a5('0x2e')],_0x2923fb[_0x22a5('0x2f')]);_0x2d7c00[_0x22a5('0x31')]=_[_0x22a5('0x42')](_0x2923fb[_0x22a5('0x2e')],qs['fields'](_0xe67d40[_0x22a5('0x2f')]['fields']));_0x2d7c00[_0x22a5('0x31')]=_0x2d7c00[_0x22a5('0x31')]['length']?_0x2d7c00['attributes']:_0x2923fb[_0x22a5('0x2e')];if(_0xe67d40[_0x22a5('0x2f')][_0x22a5('0x3c')]){_0x2d7c00['include']=[{'all':!![]}];}_0x2d7c00=_[_0x22a5('0x39')]({},_0x2d7c00,_0xe67d40[_0x22a5('0x3b')]);return db[_0x22a5('0x2b')][_0x22a5('0x43')](_0x2d7c00)['then'](handleEntityNotFound(_0x425af2,null))[_0x22a5('0x22')](respondWithResult(_0x425af2,null))[_0x22a5('0x40')](handleError(_0x425af2,null));};exports[_0x22a5('0x44')]=function(_0x5a08a1,_0xa799f2){return db['CmHopperHistory'][_0x22a5('0x44')](_0x5a08a1[_0x22a5('0x45')],{})[_0x22a5('0x22')](respondWithResult(_0xa799f2,0xc9))[_0x22a5('0x40')](handleError(_0xa799f2,null));};exports[_0x22a5('0x46')]=function(_0x31fb29,_0x10f565){return db[_0x22a5('0x2b')][_0x22a5('0x46')]()[_0x22a5('0x22')](respondWithResult(_0x10f565,null))[_0x22a5('0x40')](handleError(_0x10f565,null));};exports[_0x22a5('0x21')]=function(_0x557663,_0x7a20a0){if(_0x557663[_0x22a5('0x45')][_0x22a5('0x47')]){delete _0x557663[_0x22a5('0x45')][_0x22a5('0x47')];}return db[_0x22a5('0x2b')][_0x22a5('0x43')]({'where':{'uniqueid':_0x557663[_0x22a5('0x41')]['id']}})[_0x22a5('0x22')](handleEntityNotFound(_0x7a20a0,null))[_0x22a5('0x22')](saveUpdates(_0x557663[_0x22a5('0x45')],null))[_0x22a5('0x22')](respondWithResult(_0x7a20a0,null))['catch'](handleError(_0x7a20a0,null));};
\ No newline at end of file
+var _0xf3f9=['error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','catch','params','intersection','includeAll','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','update','then','destroy'];(function(_0x521b98,_0x57ee52){var _0xa3abf3=function(_0x4f17e3){while(--_0x4f17e3){_0x521b98['push'](_0x521b98['shift']());}};_0xa3abf3(++_0x57ee52);}(_0xf3f9,0x19e));var _0x9f3f=function(_0x5eac37,_0x2f0ea8){_0x5eac37=_0x5eac37-0x0;var _0x5c204d=_0xf3f9[_0x5eac37];return _0x5c204d;};'use strict';var emlformat=require(_0x9f3f('0x0'));var rimraf=require(_0x9f3f('0x1'));var zipdir=require(_0x9f3f('0x2'));var jsonpatch=require(_0x9f3f('0x3'));var rp=require(_0x9f3f('0x4'));var moment=require(_0x9f3f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f3f('0x6'));var util=require('util');var path=require(_0x9f3f('0x7'));var sox=require(_0x9f3f('0x8'));var csv=require(_0x9f3f('0x9'));var ejs=require(_0x9f3f('0xa'));var fs=require('fs');var fs_extra=require(_0x9f3f('0xb'));var _=require('lodash');var squel=require(_0x9f3f('0xc'));var crypto=require(_0x9f3f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f3f('0x9'));var querystring=require(_0x9f3f('0xe'));var Papa=require(_0x9f3f('0xf'));var Redis=require(_0x9f3f('0x10'));var authService=require(_0x9f3f('0x11'));var qs=require(_0x9f3f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f3f('0x13'))(_0x9f3f('0x14'));var utils=require('../../config/utils');var config=require(_0x9f3f('0x15'));var licenseUtil=require(_0x9f3f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aa2bc,_0x1a5964){_0x1a5964=_0x1a5964||0xcc;return function(_0x683e49){if(_0x683e49){return _0x2aa2bc[_0x9f3f('0x17')](_0x1a5964);}return _0x2aa2bc[_0x9f3f('0x18')](_0x1a5964)[_0x9f3f('0x19')]();};}function respondWithResult(_0x2b2a3f,_0x513b3e){_0x513b3e=_0x513b3e||0xc8;return function(_0xb374a4){if(_0xb374a4){return _0x2b2a3f[_0x9f3f('0x18')](_0x513b3e)[_0x9f3f('0x1a')](_0xb374a4);}};}function respondWithFilteredResult(_0x6cb2dc,_0x48809d){return function(_0x3d9078){if(_0x3d9078){var _0x18b32f=typeof _0x48809d['offset']==='undefined'&&typeof _0x48809d[_0x9f3f('0x1b')]===_0x9f3f('0x1c');var _0x4a767a=_0x3d9078['count'];var _0x1bec51=_0x18b32f?0x0:_0x48809d[_0x9f3f('0x1d')];var _0x206df4=_0x18b32f?_0x3d9078[_0x9f3f('0x1e')]:_0x48809d[_0x9f3f('0x1d')]+_0x48809d[_0x9f3f('0x1b')];var _0x1eb37b;if(_0x206df4>=_0x4a767a){_0x206df4=_0x4a767a;_0x1eb37b=0xc8;}else{_0x1eb37b=0xce;}_0x6cb2dc[_0x9f3f('0x18')](_0x1eb37b);return _0x6cb2dc['set'](_0x9f3f('0x1f'),_0x1bec51+'-'+_0x206df4+'/'+_0x4a767a)[_0x9f3f('0x1a')](_0x3d9078);}return null;};}function patchUpdates(_0x2dde24){return function(_0x39a335){try{jsonpatch[_0x9f3f('0x20')](_0x39a335,_0x2dde24,!![]);}catch(_0x2fefb5){return BPromise['reject'](_0x2fefb5);}return _0x39a335['save']();};}function saveUpdates(_0x605439,_0x478e8d){return function(_0x301e64){if(_0x301e64){return _0x301e64[_0x9f3f('0x21')](_0x605439)[_0x9f3f('0x22')](function(_0x557288){return _0x557288;});}return null;};}function removeEntity(_0x4f9050,_0xdc8531){return function(_0x472c18){if(_0x472c18){return _0x472c18[_0x9f3f('0x23')]()[_0x9f3f('0x22')](function(){_0x4f9050[_0x9f3f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x474651,_0x59963f){return function(_0x104b75){if(!_0x104b75){_0x474651[_0x9f3f('0x17')](0x194);}return _0x104b75;};}function handleError(_0x558491,_0x5dd94c){_0x5dd94c=_0x5dd94c||0x1f4;return function(_0x451f3d){logger[_0x9f3f('0x24')](_0x451f3d[_0x9f3f('0x25')]);if(_0x451f3d[_0x9f3f('0x26')]){delete _0x451f3d[_0x9f3f('0x26')];}_0x558491['status'](_0x5dd94c)[_0x9f3f('0x27')](_0x451f3d);};}exports[_0x9f3f('0x28')]=function(_0x1debe0,_0x490053){var _0x283246={},_0x35e045={},_0x472958={'count':0x0,'rows':[]};var _0x230ff8=_[_0x9f3f('0x29')](db[_0x9f3f('0x2a')][_0x9f3f('0x2b')],function(_0x12cbfa){return{'name':_0x12cbfa[_0x9f3f('0x2c')],'type':_0x12cbfa['type'][_0x9f3f('0x2d')]};});_0x35e045[_0x9f3f('0x2e')]=_[_0x9f3f('0x29')](_0x230ff8,_0x9f3f('0x26'));_0x35e045[_0x9f3f('0x2f')]=_[_0x9f3f('0x30')](_0x1debe0[_0x9f3f('0x2f')]);_0x35e045['filters']=_['intersection'](_0x35e045[_0x9f3f('0x2e')],_0x35e045['query']);_0x283246[_0x9f3f('0x31')]=_['intersection'](_0x35e045[_0x9f3f('0x2e')],qs[_0x9f3f('0x32')](_0x1debe0[_0x9f3f('0x2f')][_0x9f3f('0x32')]));_0x283246[_0x9f3f('0x31')]=_0x283246[_0x9f3f('0x31')][_0x9f3f('0x33')]?_0x283246['attributes']:_0x35e045[_0x9f3f('0x2e')];if(!_0x1debe0['query'][_0x9f3f('0x34')](_0x9f3f('0x35'))){_0x283246[_0x9f3f('0x1b')]=qs[_0x9f3f('0x1b')](_0x1debe0[_0x9f3f('0x2f')][_0x9f3f('0x1b')]);_0x283246['offset']=qs[_0x9f3f('0x1d')](_0x1debe0[_0x9f3f('0x2f')][_0x9f3f('0x1d')]);}_0x283246[_0x9f3f('0x36')]=qs[_0x9f3f('0x37')](_0x1debe0[_0x9f3f('0x2f')][_0x9f3f('0x37')]);_0x283246[_0x9f3f('0x38')]=qs['filters'](_[_0x9f3f('0x39')](_0x1debe0[_0x9f3f('0x2f')],_0x35e045[_0x9f3f('0x3a')]),_0x230ff8);if(_0x1debe0['query'][_0x9f3f('0x3b')]){_0x283246['where']=_[_0x9f3f('0x3c')](_0x283246[_0x9f3f('0x38')],{'$or':_[_0x9f3f('0x29')](_0x230ff8,function(_0x2a57f3){if(_0x2a57f3[_0x9f3f('0x3d')]!==_0x9f3f('0x3e')){var _0x1621ae={};_0x1621ae[_0x2a57f3[_0x9f3f('0x26')]]={'$like':'%'+_0x1debe0['query'][_0x9f3f('0x3b')]+'%'};return _0x1621ae;}})});}_0x283246=_[_0x9f3f('0x3c')]({},_0x283246,_0x1debe0[_0x9f3f('0x3f')]);var _0x190d66={'where':_0x283246[_0x9f3f('0x38')]};return db[_0x9f3f('0x2a')]['count'](_0x190d66)[_0x9f3f('0x22')](function(_0xd72e61){_0x472958['count']=_0xd72e61;if(_0x1debe0[_0x9f3f('0x2f')]['includeAll']){_0x283246[_0x9f3f('0x40')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9f3f('0x41')](_0x283246);})[_0x9f3f('0x22')](function(_0x3079b1){_0x472958['rows']=_0x3079b1;return _0x472958;})[_0x9f3f('0x22')](respondWithFilteredResult(_0x490053,_0x283246))[_0x9f3f('0x42')](handleError(_0x490053,null));};exports['show']=function(_0x5c4be0,_0x340b4d){var _0x37e7b4={'raw':!![],'where':{'id':_0x5c4be0[_0x9f3f('0x43')]['id']}},_0x86fe59={};_0x86fe59[_0x9f3f('0x2e')]=_[_0x9f3f('0x30')](db[_0x9f3f('0x2a')]['rawAttributes']);_0x86fe59['query']=_[_0x9f3f('0x30')](_0x5c4be0['query']);_0x86fe59['filters']=_[_0x9f3f('0x44')](_0x86fe59[_0x9f3f('0x2e')],_0x86fe59[_0x9f3f('0x2f')]);_0x37e7b4[_0x9f3f('0x31')]=_[_0x9f3f('0x44')](_0x86fe59[_0x9f3f('0x2e')],qs[_0x9f3f('0x32')](_0x5c4be0['query'][_0x9f3f('0x32')]));_0x37e7b4[_0x9f3f('0x31')]=_0x37e7b4[_0x9f3f('0x31')][_0x9f3f('0x33')]?_0x37e7b4[_0x9f3f('0x31')]:_0x86fe59[_0x9f3f('0x2e')];if(_0x5c4be0[_0x9f3f('0x2f')][_0x9f3f('0x45')]){_0x37e7b4[_0x9f3f('0x40')]=[{'all':!![]}];}_0x37e7b4=_[_0x9f3f('0x3c')]({},_0x37e7b4,_0x5c4be0[_0x9f3f('0x3f')]);return db['CmHopperHistory'][_0x9f3f('0x46')](_0x37e7b4)[_0x9f3f('0x22')](handleEntityNotFound(_0x340b4d,null))[_0x9f3f('0x22')](respondWithResult(_0x340b4d,null))[_0x9f3f('0x42')](handleError(_0x340b4d,null));};exports[_0x9f3f('0x47')]=function(_0x1a4a20,_0x598219){return db[_0x9f3f('0x2a')]['create'](_0x1a4a20[_0x9f3f('0x48')],{})[_0x9f3f('0x22')](respondWithResult(_0x598219,0xc9))[_0x9f3f('0x42')](handleError(_0x598219,null));};exports[_0x9f3f('0x49')]=function(_0x3b738a,_0xa302de){return db[_0x9f3f('0x2a')][_0x9f3f('0x49')]()[_0x9f3f('0x22')](respondWithResult(_0xa302de,null))[_0x9f3f('0x42')](handleError(_0xa302de,null));};exports[_0x9f3f('0x21')]=function(_0x9fc464,_0x185690){if(_0x9fc464['body'][_0x9f3f('0x4a')]){delete _0x9fc464[_0x9f3f('0x48')][_0x9f3f('0x4a')];}return db[_0x9f3f('0x2a')][_0x9f3f('0x46')]({'where':{'uniqueid':_0x9fc464[_0x9f3f('0x43')]['id']}})[_0x9f3f('0x22')](handleEntityNotFound(_0x185690,null))[_0x9f3f('0x22')](saveUpdates(_0x9fc464[_0x9f3f('0x48')],null))[_0x9f3f('0x22')](respondWithResult(_0x185690,null))[_0x9f3f('0x42')](handleError(_0x185690,null));};
\ No newline at end of file
index 553dc94..1947bb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce14=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','uniqueid','util'];(function(_0x430524,_0x23b611){var _0x3a726d=function(_0x5cc39d){while(--_0x5cc39d){_0x430524['push'](_0x430524['shift']());}};_0x3a726d(++_0x23b611);}(_0xce14,0x17f));var _0x4ce1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xce14[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x4ce1('0x0'));var logger=require('../../config/logger')(_0x4ce1('0x1'));var moment=require(_0x4ce1('0x2'));var BPromise=require('bluebird');var rp=require(_0x4ce1('0x3'));var fs=require('fs');var path=require(_0x4ce1('0x4'));var rimraf=require(_0x4ce1('0x5'));var config=require(_0x4ce1('0x6'));var attributes=require(_0x4ce1('0x7'));module['exports']=function(_0x10aaa0,_0x3954d4){return _0x10aaa0[_0x4ce1('0x8')](_0x4ce1('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x4ce1('0xa'),'fields':[_0x4ce1('0xa')]},{'name':_0x4ce1('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa93a=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','../../config/logger','bluebird','path','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x5e3661,_0x2594f8){var _0x822b07=function(_0xaf32de){while(--_0xaf32de){_0x5e3661['push'](_0x5e3661['shift']());}};_0x822b07(++_0x2594f8);}(_0xa93a,0xb8));var _0xaa93=function(_0x91a903,_0x182281){_0x91a903=_0x91a903-0x0;var _0x25afe7=_0xa93a[_0x91a903];return _0x25afe7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa93('0x0'))('api');var moment=require('moment');var BPromise=require(_0xaa93('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa93('0x2'));var rimraf=require('rimraf');var config=require(_0xaa93('0x3'));var attributes=require(_0xaa93('0x4'));module[_0xaa93('0x5')]=function(_0xed4247,_0x165af0){return _0xed4247['define'](_0xaa93('0x6'),attributes,{'tableName':_0xaa93('0x7'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xaa93('0x8')]},{'name':'uniqueid','fields':[_0xaa93('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 345b534..53fbd15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b05=['predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null'];(function(_0x548957,_0x4e8118){var _0x1ec776=function(_0x39526d){while(--_0x39526d){_0x548957['push'](_0x548957['shift']());}};_0x1ec776(++_0x4e8118);}(_0x5b05,0x190));var _0x55b0=function(_0x1e99ff,_0x30a600){_0x1e99ff=_0x1e99ff-0x0;var _0x257349=_0x5b05[_0x1e99ff];return _0x257349;};'use strict';var _=require('lodash');var util=require(_0x55b0('0x0'));var moment=require(_0x55b0('0x1'));var BPromise=require(_0x55b0('0x2'));var rs=require(_0x55b0('0x3'));var fs=require('fs');var Redis=require(_0x55b0('0x4'));var db=require(_0x55b0('0x5'))['db'];var utils=require(_0x55b0('0x6'));var logger=require(_0x55b0('0x7'))(_0x55b0('0x8'));var config=require(_0x55b0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x55b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe0c407,_0x46c475,_0x355e20){return new BPromise(function(_0xdf375f,_0x598abf){return client[_0x55b0('0xb')](_0xe0c407,_0x355e20)[_0x55b0('0xc')](function(_0xc1d43){logger[_0x55b0('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x46c475,'request\x20sent');logger[_0x55b0('0xe')](_0x55b0('0xf'),_0x46c475,_0x55b0('0x10'),JSON[_0x55b0('0x11')](_0xc1d43));if(_0xc1d43[_0x55b0('0x12')]){if(_0xc1d43[_0x55b0('0x12')]['code']===0x1f4){logger[_0x55b0('0x12')](_0x55b0('0x13'),_0x46c475,_0xc1d43['error'][_0x55b0('0x14')]);return _0x598abf(_0xc1d43[_0x55b0('0x12')][_0x55b0('0x14')]);}logger[_0x55b0('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x46c475,_0xc1d43['error']['message']);return _0xdf375f(_0xc1d43[_0x55b0('0x12')]['message']);}else{logger[_0x55b0('0xd')](_0x55b0('0x13'),_0x46c475,'request\x20sent');_0xdf375f(_0xc1d43[_0x55b0('0x15')][_0x55b0('0x14')]);}})[_0x55b0('0x16')](function(_0x947f96){logger[_0x55b0('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x46c475,_0x947f96);_0x598abf(_0x947f96);});});}exports[_0x55b0('0x17')]=function(_0x20b1c5){var _0x4e7bf1=this;return new Promise(function(_0x5ca2ec,_0x5404cb){return db[_0x55b0('0x18')][_0x55b0('0x19')](_0x20b1c5[_0x55b0('0x1a')],{'raw':_0x20b1c5['options']?_0x20b1c5[_0x55b0('0x1b')][_0x55b0('0x1c')]===undefined?!![]:![]:!![]})[_0x55b0('0xc')](function(_0x3ff56c){logger['info'](_0x55b0('0x17'),_0x20b1c5);logger[_0x55b0('0xe')](_0x55b0('0x17'),_0x20b1c5,JSON[_0x55b0('0x11')](_0x3ff56c));_0x5ca2ec(_0x3ff56c);})['catch'](function(_0x4082ce){logger['error'](_0x55b0('0x17'),_0x4082ce['message'],_0x20b1c5);_0x5404cb(_0x4e7bf1[_0x55b0('0x12')](0x1f4,_0x4082ce[_0x55b0('0x14')]));});});};exports[_0x55b0('0x1d')]=function(_0x3056f8){var _0x248568=this;return new Promise(function(_0x29f498,_0xa0ede8){return db['CmHopperHistory'][_0x55b0('0x1e')]({'raw':_0x3056f8['options']?_0x3056f8[_0x55b0('0x1b')][_0x55b0('0x1c')]===undefined?!![]:![]:!![],'where':_0x3056f8[_0x55b0('0x1b')]?_0x3056f8['options'][_0x55b0('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')][_0x55b0('0x22')]('id')),_0x55b0('0x23')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x25')))),_0x55b0('0x26')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')]['literal'](_0x55b0('0x28')))),_0x55b0('0x29')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x2a'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')]['literal'](_0x55b0('0x2b')))),'predictiveIntervalAvgHoldtime'],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x2a'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x2c')))),_0x55b0('0x2d')]]})[_0x55b0('0xc')](function(_0x322cef){logger[_0x55b0('0xd')]('AvgHandleTime',_0x3056f8);logger[_0x55b0('0xe')](_0x55b0('0x1d'),_0x3056f8,JSON[_0x55b0('0x11')](_0x322cef));_0x29f498(_0x322cef);})[_0x55b0('0x16')](function(_0x2ef920){logger[_0x55b0('0x12')](_0x55b0('0x1d'),_0x2ef920[_0x55b0('0x14')],_0x3056f8);_0xa0ede8(_0x248568[_0x55b0('0x12')](0x1f4,_0x2ef920['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x274d5b){var _0x58863d=this;return new Promise(function(_0x365c57,_0x592d6e){return db[_0x55b0('0x18')][_0x55b0('0x1e')]({'raw':_0x274d5b['options']?_0x274d5b[_0x55b0('0x1b')][_0x55b0('0x1c')]===undefined?!![]:![]:!![],'where':_0x274d5b[_0x55b0('0x1b')]?_0x274d5b['options']['where']||null:null,'attributes':[['campaign',_0x55b0('0x2e')],[db['sequelize']['fn']('COUNT',db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')]['literal'](_0x55b0('0x2f')))),_0x55b0('0x30')],[db['sequelize']['fn']('COUNT',db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')]('`state`\x20=\x203,\x201,\x20null'))),_0x55b0('0x31')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x25')))),_0x55b0('0x32')],[db[_0x55b0('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x33')))),_0x55b0('0x34')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x35')))),_0x55b0('0x36')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db['sequelize']['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x37')))),'outboundDropCallsDayTimeout'],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x38')))),'outboundDropCallsDayCallersExit'],[db[_0x55b0('0x21')]['fn']('COUNT',db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x39')))),_0x55b0('0x3a')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')]['fn']('IF',db['sequelize']['literal'](_0x55b0('0x3b')))),_0x55b0('0x3c')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x55b0('0x24')](_0x55b0('0x3d')))),_0x55b0('0x3e')],[db['sequelize']['fn']('COUNT',db[_0x55b0('0x21')]['fn']('IF',db['sequelize'][_0x55b0('0x24')](_0x55b0('0x3f')))),_0x55b0('0x40')],[db[_0x55b0('0x21')]['fn']('COUNT',db[_0x55b0('0x21')]['fn']('IF',db['sequelize'][_0x55b0('0x24')](_0x55b0('0x41')))),_0x55b0('0x42')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db['sequelize']['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x43')))),_0x55b0('0x40')],[db['sequelize']['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x44')))),'outboundReCallsDay']],'group':[_0x55b0('0x45')]})[_0x55b0('0xc')](function(_0x44ca57){logger['info'](_0x55b0('0x46'),_0x274d5b);logger[_0x55b0('0xe')](_0x55b0('0x46'),_0x274d5b,JSON[_0x55b0('0x11')](_0x44ca57));_0x365c57(_0x44ca57);})[_0x55b0('0x16')](function(_0x555c0f){logger[_0x55b0('0x12')](_0x55b0('0x46'),_0x555c0f[_0x55b0('0x14')],_0x274d5b);_0x592d6e(_0x58863d['error'](0x1f4,_0x555c0f[_0x55b0('0x14')]));});});};exports[_0x55b0('0x47')]=function(_0x309e60){var _0x4c54ca=this;return new Promise(function(_0x1ec85a,_0x5d2c28){return db[_0x55b0('0x18')][_0x55b0('0x1e')]({'raw':_0x309e60['options']?_0x309e60['options'][_0x55b0('0x1c')]===undefined?!![]:![]:!![],'where':_0x309e60[_0x55b0('0x1b')]?_0x309e60[_0x55b0('0x1b')][_0x55b0('0x1f')]||null:null,'attributes':[[_0x55b0('0x45'),_0x55b0('0x2e')],[db[_0x55b0('0x21')]['fn'](_0x55b0('0x20'),db['sequelize']['col']('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x55b0('0x20'),db[_0x55b0('0x21')]['fn']('IF',db[_0x55b0('0x21')][_0x55b0('0x24')](_0x55b0('0x25')))),_0x55b0('0x48')]],'group':[_0x55b0('0x45')]})['then'](function(_0x2ba2ae){logger[_0x55b0('0xd')]('GetCampaignHopperHistory',_0x309e60);logger[_0x55b0('0xe')]('GetCampaignHopperHistory',_0x309e60,JSON[_0x55b0('0x11')](_0x2ba2ae));_0x1ec85a(_0x2ba2ae);})['catch'](function(_0x153d0a){logger[_0x55b0('0x12')](_0x55b0('0x47'),_0x153d0a['message'],_0x309e60);_0x5d2c28(_0x4c54ca[_0x55b0('0x12')](0x1f4,_0x153d0a[_0x55b0('0x14')]));});});};
\ No newline at end of file
+var _0xb469=['sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','stringify','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2013,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','CreateCmHopperHistory','create','body','options','raw','catch','AvgHandleTime','CmHopperHistory','findAll','where'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb469,0x13b));var _0x9b46=function(_0x3cb055,_0x2a8ef8){_0x3cb055=_0x3cb055-0x0;var _0x3c2778=_0xb469[_0x3cb055];return _0x3c2778;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var BPromise=require(_0x9b46('0x3'));var rs=require(_0x9b46('0x4'));var fs=require('fs');var Redis=require(_0x9b46('0x5'));var db=require(_0x9b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b46('0x7'))(_0x9b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b46('0x9'));var client=jayson[_0x9b46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2dd3,_0x5bd834,_0x4c1ed9){return new BPromise(function(_0x34c0de,_0x545b6c){return client[_0x9b46('0xb')](_0x1b2dd3,_0x4c1ed9)[_0x9b46('0xc')](function(_0x43a112){logger['info'](_0x9b46('0xd'),_0x5bd834,'request\x20sent');logger[_0x9b46('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x5bd834,_0x9b46('0xf'),JSON['stringify'](_0x43a112));if(_0x43a112[_0x9b46('0x10')]){if(_0x43a112[_0x9b46('0x10')]['code']===0x1f4){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112['error'][_0x9b46('0x11')]);return _0x545b6c(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);return _0x34c0de(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}else{logger[_0x9b46('0x12')](_0x9b46('0xd'),_0x5bd834,_0x9b46('0xf'));_0x34c0de(_0x43a112[_0x9b46('0x13')]['message']);}})['catch'](function(_0x52c1b8){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x52c1b8);_0x545b6c(_0x52c1b8);});});}exports[_0x9b46('0x14')]=function(_0x5c5cc9){var _0x5dd7bd=this;return new Promise(function(_0x3d9efa,_0x4ccfd0){return db['CmHopperHistory'][_0x9b46('0x15')](_0x5c5cc9[_0x9b46('0x16')],{'raw':_0x5c5cc9['options']?_0x5c5cc9[_0x9b46('0x17')][_0x9b46('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55aece){logger[_0x9b46('0x12')](_0x9b46('0x14'),_0x5c5cc9);logger[_0x9b46('0xe')]('CreateCmHopperHistory',_0x5c5cc9,JSON['stringify'](_0x55aece));_0x3d9efa(_0x55aece);})[_0x9b46('0x19')](function(_0x51d2ca){logger[_0x9b46('0x10')](_0x9b46('0x14'),_0x51d2ca['message'],_0x5c5cc9);_0x4ccfd0(_0x5dd7bd[_0x9b46('0x10')](0x1f4,_0x51d2ca['message']));});});};exports[_0x9b46('0x1a')]=function(_0x2b6f72){var _0x4d3b1b=this;return new Promise(function(_0x4615b7,_0x31ca63){return db[_0x9b46('0x1b')][_0x9b46('0x1c')]({'raw':_0x2b6f72[_0x9b46('0x17')]?_0x2b6f72[_0x9b46('0x17')][_0x9b46('0x18')]===undefined?!![]:![]:!![],'where':_0x2b6f72['options']?_0x2b6f72[_0x9b46('0x17')][_0x9b46('0x1d')]||null:null,'attributes':[[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')][_0x9b46('0x20')]('id')),_0x9b46('0x21')],[db['sequelize']['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x23')))),_0x9b46('0x24')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0x9b46('0x25')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x26')))),_0x9b46('0x27')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x28'),db[_0x9b46('0x1e')]['fn']('IF',db['sequelize'][_0x9b46('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x9b46('0x29')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x28'),db['sequelize']['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x2a')))),_0x9b46('0x2b')]]})[_0x9b46('0xc')](function(_0x5cb73f){logger['info'](_0x9b46('0x1a'),_0x2b6f72);logger[_0x9b46('0xe')](_0x9b46('0x1a'),_0x2b6f72,JSON[_0x9b46('0x2c')](_0x5cb73f));_0x4615b7(_0x5cb73f);})['catch'](function(_0x44327d){logger['error'](_0x9b46('0x1a'),_0x44327d[_0x9b46('0x11')],_0x2b6f72);_0x31ca63(_0x4d3b1b[_0x9b46('0x10')](0x1f4,_0x44327d[_0x9b46('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1a96df){var _0x532086=this;return new Promise(function(_0x28a9c3,_0x2da43f){return db[_0x9b46('0x1b')][_0x9b46('0x1c')]({'raw':_0x1a96df[_0x9b46('0x17')]?_0x1a96df[_0x9b46('0x17')][_0x9b46('0x18')]===undefined?!![]:![]:!![],'where':_0x1a96df[_0x9b46('0x17')]?_0x1a96df[_0x9b46('0x17')][_0x9b46('0x1d')]||null:null,'attributes':[[_0x9b46('0x2d'),'name'],[db[_0x9b46('0x1e')]['fn']('COUNT',db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')]['literal'](_0x9b46('0x2e')))),'outboundNoSuchCallsDay'],[db[_0x9b46('0x1e')]['fn']('COUNT',db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x2f')))),_0x9b46('0x30')],[db['sequelize']['fn']('COUNT',db[_0x9b46('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x9b46('0x1e')]['fn']('COUNT',db[_0x9b46('0x1e')]['fn']('IF',db['sequelize'][_0x9b46('0x22')](_0x9b46('0x31')))),_0x9b46('0x32')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x33')))),'outboundCongestionCallsDay'],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x34')))),_0x9b46('0x35')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x36')))),_0x9b46('0x37')],[db['sequelize']['fn']('COUNT',db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x38')))),'outboundBlacklistCallsDay'],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db['sequelize'][_0x9b46('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),_0x9b46('0x39')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db['sequelize']['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x3a')))),_0x9b46('0x3b')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db['sequelize']['fn']('IF',db[_0x9b46('0x1e')][_0x9b46('0x22')](_0x9b46('0x3c')))),_0x9b46('0x3d')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db['sequelize']['fn']('IF',db[_0x9b46('0x1e')]['literal'](_0x9b46('0x3e')))),_0x9b46('0x3b')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db['sequelize'][_0x9b46('0x22')](_0x9b46('0x3f')))),_0x9b46('0x40')]],'group':[_0x9b46('0x2d')]})[_0x9b46('0xc')](function(_0x14080e){logger[_0x9b46('0x12')](_0x9b46('0x41'),_0x1a96df);logger[_0x9b46('0xe')](_0x9b46('0x41'),_0x1a96df,JSON[_0x9b46('0x2c')](_0x14080e));_0x28a9c3(_0x14080e);})['catch'](function(_0x551a64){logger['error'](_0x9b46('0x41'),_0x551a64['message'],_0x1a96df);_0x2da43f(_0x532086[_0x9b46('0x10')](0x1f4,_0x551a64['message']));});});};exports[_0x9b46('0x42')]=function(_0x52a3d4){var _0x161bbc=this;return new Promise(function(_0x443ccd,_0x15e3d6){return db[_0x9b46('0x1b')][_0x9b46('0x1c')]({'raw':_0x52a3d4['options']?_0x52a3d4[_0x9b46('0x17')][_0x9b46('0x18')]===undefined?!![]:![]:!![],'where':_0x52a3d4[_0x9b46('0x17')]?_0x52a3d4[_0x9b46('0x17')][_0x9b46('0x1d')]||null:null,'attributes':[['campaign','name'],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')][_0x9b46('0x20')]('id')),_0x9b46('0x43')],[db[_0x9b46('0x1e')]['fn'](_0x9b46('0x1f'),db[_0x9b46('0x1e')]['fn']('IF',db['sequelize'][_0x9b46('0x22')](_0x9b46('0x23')))),_0x9b46('0x44')]],'group':['campaign']})[_0x9b46('0xc')](function(_0x145200){logger[_0x9b46('0x12')](_0x9b46('0x42'),_0x52a3d4);logger[_0x9b46('0xe')](_0x9b46('0x42'),_0x52a3d4,JSON['stringify'](_0x145200));_0x443ccd(_0x145200);})[_0x9b46('0x19')](function(_0x16b9a1){logger[_0x9b46('0x10')](_0x9b46('0x42'),_0x16b9a1[_0x9b46('0x11')],_0x52a3d4);_0x15e3d6(_0x161bbc[_0x9b46('0x10')](0x1f4,_0x16b9a1['message']));});});};
\ No newline at end of file
index a323855..dd17d00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f4d=['create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','describe','/:id','show','post'];(function(_0x33c5dd,_0x58e2c7){var _0x5089af=function(_0x236371){while(--_0x236371){_0x33c5dd['push'](_0x33c5dd['shift']());}};_0x5089af(++_0x58e2c7);}(_0x4f4d,0x134));var _0xd4f4=function(_0x38ae4f,_0x1d3180){_0x38ae4f=_0x38ae4f-0x0;var _0x1e92db=_0x4f4d[_0x38ae4f];return _0x1e92db;};'use strict';var multer=require(_0xd4f4('0x0'));var util=require(_0xd4f4('0x1'));var path=require(_0xd4f4('0x2'));var timeout=require(_0xd4f4('0x3'));var express=require(_0xd4f4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd4f4('0x5'));var interaction=require(_0xd4f4('0x6'));var config=require(_0xd4f4('0x7'));var controller=require(_0xd4f4('0x8'));router[_0xd4f4('0x9')]('/',auth[_0xd4f4('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd4f4('0xb')]);router[_0xd4f4('0x9')](_0xd4f4('0xc'),auth[_0xd4f4('0xa')](),controller[_0xd4f4('0xd')]);router[_0xd4f4('0xe')]('/',auth[_0xd4f4('0xa')](),controller[_0xd4f4('0xf')]);router[_0xd4f4('0x10')](_0xd4f4('0xc'),auth[_0xd4f4('0xa')](),controller[_0xd4f4('0x11')]);module[_0xd4f4('0x12')]=router;
\ No newline at end of file
+var _0x3b93=['isAuthenticated','index','/describe','describe','/:id','show','post','create','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x65c9d8,_0x5952fc){var _0x52de83=function(_0x2365da){while(--_0x2365da){_0x65c9d8['push'](_0x65c9d8['shift']());}};_0x52de83(++_0x5952fc);}(_0x3b93,0x139));var _0x33b9=function(_0x1b739d,_0x1713b1){_0x1b739d=_0x1b739d-0x0;var _0x22798a=_0x3b93[_0x1b739d];return _0x22798a;};'use strict';var multer=require(_0x33b9('0x0'));var util=require(_0x33b9('0x1'));var path=require(_0x33b9('0x2'));var timeout=require(_0x33b9('0x3'));var express=require(_0x33b9('0x4'));var router=express[_0x33b9('0x5')]();var fs_extra=require(_0x33b9('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x33b9('0x7'));var controller=require(_0x33b9('0x8'));router[_0x33b9('0x9')]('/',auth[_0x33b9('0xa')](),controller[_0x33b9('0xb')]);router[_0x33b9('0x9')](_0x33b9('0xc'),auth[_0x33b9('0xa')](),controller[_0x33b9('0xd')]);router[_0x33b9('0x9')](_0x33b9('0xe'),auth[_0x33b9('0xa')](),controller[_0x33b9('0xf')]);router[_0x33b9('0x10')]('/',auth['isAuthenticated'](),controller[_0x33b9('0x11')]);router['put']('/:id',auth[_0x33b9('0xa')](),controller[_0x33b9('0x12')]);module['exports']=router;
\ No newline at end of file
index 433692b..cb520fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a08=['STRING','sequelize','exports'];(function(_0x439d74,_0x59405f){var _0x116622=function(_0x4a6a61){while(--_0x4a6a61){_0x439d74['push'](_0x439d74['shift']());}};_0x116622(++_0x59405f);}(_0x7a08,0x11e));var _0x87a0=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x7a08[_0x31e5cb];return _0x4170df;};'use strict';var Sequelize=require(_0x87a0('0x0'));module[_0x87a0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x87a0('0x2')]},'dialPrefix':{'type':Sequelize[_0x87a0('0x2')]}};
\ No newline at end of file
+var _0x34e8=['sequelize','exports','STRING','name'];(function(_0x536f5c,_0x25d0be){var _0x535d5a=function(_0x287ff0){while(--_0x287ff0){_0x536f5c['push'](_0x536f5c['shift']());}};_0x535d5a(++_0x25d0be);}(_0x34e8,0x12c));var _0x834e=function(_0x10e0fa,_0x359b34){_0x10e0fa=_0x10e0fa-0x0;var _0x521c80=_0x34e8[_0x10e0fa];return _0x521c80;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x834e('0x2')]}};
\ No newline at end of file
index 0b6099c..ca61834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f8a=['pick','filter','merge','VIRTUAL','CmList','include','findAll','rows','catch','length','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ListId','Disposition','getDispositions','findOne','hasOwnProperty','includeAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','each','success','dataValues','errors','push','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','isEmpty','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','transaction','addCustomFields','Sequelize','TEXT','number','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','end','error','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where'];(function(_0x3b0e97,_0x52a018){var _0x200b84=function(_0x37da17){while(--_0x37da17){_0x3b0e97['push'](_0x3b0e97['shift']());}};_0x200b84(++_0x52a018);}(_0x1f8a,0xe3));var _0xa1f8=function(_0x655d2,_0x4ad7df){_0x655d2=_0x655d2-0x0;var _0x445c80=_0x1f8a[_0x655d2];return _0x445c80;};'use strict';var emlformat=require(_0xa1f8('0x0'));var rimraf=require(_0xa1f8('0x1'));var zipdir=require(_0xa1f8('0x2'));var jsonpatch=require(_0xa1f8('0x3'));var rp=require(_0xa1f8('0x4'));var moment=require(_0xa1f8('0x5'));var BPromise=require(_0xa1f8('0x6'));var Mustache=require('mustache');var util=require(_0xa1f8('0x7'));var path=require(_0xa1f8('0x8'));var sox=require(_0xa1f8('0x9'));var csv=require(_0xa1f8('0xa'));var ejs=require(_0xa1f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa1f8('0xc'));var _=require(_0xa1f8('0xd'));var squel=require(_0xa1f8('0xe'));var crypto=require(_0xa1f8('0xf'));var jsforce=require(_0xa1f8('0x10'));var deskjs=require(_0xa1f8('0x11'));var toCsv=require(_0xa1f8('0xa'));var querystring=require(_0xa1f8('0x12'));var Papa=require('papaparse');var Redis=require(_0xa1f8('0x13'));var authService=require(_0xa1f8('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa1f8('0x15'));var hardwareService=require(_0xa1f8('0x16'));var logger=require('../../config/logger')(_0xa1f8('0x17'));var utils=require('../../config/utils');var config=require(_0xa1f8('0x18'));var licenseUtil=require(_0xa1f8('0x19'));var db=require(_0xa1f8('0x1a'))['db'];config[_0xa1f8('0x1b')]=_[_0xa1f8('0x1c')](config[_0xa1f8('0x1b')],{'host':_0xa1f8('0x1d'),'port':0x18eb});var socket=require(_0xa1f8('0x1e'))(new Redis(config[_0xa1f8('0x1b')]));require(_0xa1f8('0x1f'))[_0xa1f8('0x20')](socket);function respondWithStatusCode(_0x271edc,_0x5ec1a3){_0x5ec1a3=_0x5ec1a3||0xcc;return function(_0x422c03){if(_0x422c03){return _0x271edc[_0xa1f8('0x21')](_0x5ec1a3);}return _0x271edc[_0xa1f8('0x22')](_0x5ec1a3)['end']();};}function respondWithResult(_0x367b35,_0x727204){_0x727204=_0x727204||0xc8;return function(_0xd6298d){if(_0xd6298d){return _0x367b35[_0xa1f8('0x22')](_0x727204)[_0xa1f8('0x23')](_0xd6298d);}};}function respondWithFilteredResult(_0x518521,_0x10ad31){return function(_0x21a607){if(_0x21a607){var _0x14b1f2=typeof _0x10ad31[_0xa1f8('0x24')]===_0xa1f8('0x25')&&typeof _0x10ad31[_0xa1f8('0x26')]===_0xa1f8('0x25');var _0x194efc=_0x21a607[_0xa1f8('0x27')];var _0x2340cb=_0x14b1f2?0x0:_0x10ad31[_0xa1f8('0x24')];var _0x4524c7=_0x14b1f2?_0x21a607[_0xa1f8('0x27')]:_0x10ad31[_0xa1f8('0x24')]+_0x10ad31[_0xa1f8('0x26')];var _0x2514e2;if(_0x4524c7>=_0x194efc){_0x4524c7=_0x194efc;_0x2514e2=0xc8;}else{_0x2514e2=0xce;}_0x518521[_0xa1f8('0x22')](_0x2514e2);return _0x518521[_0xa1f8('0x28')](_0xa1f8('0x29'),_0x2340cb+'-'+_0x4524c7+'/'+_0x194efc)[_0xa1f8('0x23')](_0x21a607);}return null;};}function patchUpdates(_0x713d04){return function(_0x5acb04){try{jsonpatch[_0xa1f8('0x2a')](_0x5acb04,_0x713d04,!![]);}catch(_0x5ed7dd){return BPromise[_0xa1f8('0x2b')](_0x5ed7dd);}return _0x5acb04[_0xa1f8('0x2c')]();};}function saveUpdates(_0x22903f,_0x272444){return function(_0x33daa5){if(_0x33daa5){return _0x33daa5[_0xa1f8('0x2d')](_0x22903f)[_0xa1f8('0x2e')](function(_0x31d640){return _0x31d640;});}return null;};}function removeEntity(_0x43960e,_0x1e585e){return function(_0x338eae){if(_0x338eae){return _0x338eae[_0xa1f8('0x2f')]()[_0xa1f8('0x2e')](function(){var _0x3b80ab=_0x338eae['get']({'plain':!![]});var _0x340504=_0xa1f8('0x30');return db[_0xa1f8('0x31')][_0xa1f8('0x2f')]({'where':{'type':_0x340504,'resourceId':_0x3b80ab['id']}})[_0xa1f8('0x2e')](function(){return _0x338eae;});})[_0xa1f8('0x2e')](function(){_0x43960e[_0xa1f8('0x22')](0xcc)[_0xa1f8('0x32')]();});}};}function handleEntityNotFound(_0x1d12bf,_0x461b8b){return function(_0x521b42){if(!_0x521b42){_0x1d12bf['sendStatus'](0x194);}return _0x521b42;};}function handleError(_0x550664,_0x23e4a2){_0x23e4a2=_0x23e4a2||0x1f4;return function(_0x103d15){logger[_0xa1f8('0x33')](_0x103d15['stack']);if(_0x103d15[_0xa1f8('0x34')]){delete _0x103d15[_0xa1f8('0x34')];}_0x550664[_0xa1f8('0x22')](_0x23e4a2)['send'](_0x103d15);};}exports[_0xa1f8('0x35')]=function(_0x2118d7,_0x44a1e6){var _0x56385b={},_0x304a04={},_0x32455b={'count':0x0,'rows':[]};var _0x32bc4a=_['map'](db['CmList'][_0xa1f8('0x36')],function(_0x27554d){return{'name':_0x27554d['fieldName'],'type':_0x27554d[_0xa1f8('0x37')][_0xa1f8('0x38')]};});_0x304a04[_0xa1f8('0x39')]=_[_0xa1f8('0x3a')](_0x32bc4a,_0xa1f8('0x34'));_0x304a04[_0xa1f8('0x3b')]=_[_0xa1f8('0x3c')](_0x2118d7['query']);_0x304a04[_0xa1f8('0x3d')]=_[_0xa1f8('0x3e')](_0x304a04[_0xa1f8('0x39')],_0x304a04[_0xa1f8('0x3b')]);_0x56385b[_0xa1f8('0x3f')]=_[_0xa1f8('0x3e')](_0x304a04['model'],qs[_0xa1f8('0x40')](_0x2118d7[_0xa1f8('0x3b')][_0xa1f8('0x40')]));_0x56385b[_0xa1f8('0x3f')]=_0x56385b[_0xa1f8('0x3f')]['length']?_0x56385b[_0xa1f8('0x3f')]:_0x304a04[_0xa1f8('0x39')];if(!_0x2118d7['query']['hasOwnProperty'](_0xa1f8('0x41'))){_0x56385b[_0xa1f8('0x26')]=qs[_0xa1f8('0x26')](_0x2118d7['query'][_0xa1f8('0x26')]);_0x56385b[_0xa1f8('0x24')]=qs['offset'](_0x2118d7['query']['offset']);}_0x56385b[_0xa1f8('0x42')]=qs[_0xa1f8('0x43')](_0x2118d7[_0xa1f8('0x3b')]['sort']);_0x56385b[_0xa1f8('0x44')]=qs['filters'](_[_0xa1f8('0x45')](_0x2118d7['query'],_0x304a04['filters']),_0x32bc4a);if(_0x2118d7[_0xa1f8('0x3b')][_0xa1f8('0x46')]){_0x56385b['where']=_[_0xa1f8('0x47')](_0x56385b['where'],{'$or':_[_0xa1f8('0x3a')](_0x32bc4a,function(_0x1056bd){if(_0x1056bd[_0xa1f8('0x37')]!==_0xa1f8('0x48')){var _0x559750={};_0x559750[_0x1056bd[_0xa1f8('0x34')]]={'$like':'%'+_0x2118d7[_0xa1f8('0x3b')][_0xa1f8('0x46')]+'%'};return _0x559750;}})});}_0x56385b=_['merge']({},_0x56385b,_0x2118d7['options']);var _0x4b463f={'where':_0x56385b[_0xa1f8('0x44')]};return db[_0xa1f8('0x49')][_0xa1f8('0x27')](_0x4b463f)[_0xa1f8('0x2e')](function(_0x4048bf){_0x32455b[_0xa1f8('0x27')]=_0x4048bf;if(_0x2118d7[_0xa1f8('0x3b')]['includeAll']){_0x56385b[_0xa1f8('0x4a')]=[{'all':!![]}];}return db[_0xa1f8('0x49')][_0xa1f8('0x4b')](_0x56385b);})[_0xa1f8('0x2e')](function(_0x3549db){_0x32455b[_0xa1f8('0x4c')]=_0x3549db;return _0x32455b;})[_0xa1f8('0x2e')](respondWithFilteredResult(_0x44a1e6,_0x56385b))[_0xa1f8('0x4d')](handleError(_0x44a1e6,null));};exports['show']=function(_0x5d666c,_0x1449c9){var _0x56988f={'raw':![],'where':{'id':_0x5d666c['params']['id']}},_0x572d3d={};_0x572d3d[_0xa1f8('0x39')]=_[_0xa1f8('0x3c')](db[_0xa1f8('0x49')][_0xa1f8('0x36')]);_0x572d3d['query']=_[_0xa1f8('0x3c')](_0x5d666c[_0xa1f8('0x3b')]);_0x572d3d['filters']=_[_0xa1f8('0x3e')](_0x572d3d[_0xa1f8('0x39')],_0x572d3d['query']);_0x56988f[_0xa1f8('0x3f')]=_[_0xa1f8('0x3e')](_0x572d3d[_0xa1f8('0x39')],qs[_0xa1f8('0x40')](_0x5d666c[_0xa1f8('0x3b')][_0xa1f8('0x40')]));_0x56988f['attributes']=_0x56988f[_0xa1f8('0x3f')][_0xa1f8('0x4e')]?_0x56988f['attributes']:_0x572d3d['model'];if(_0x5d666c['query']['includeAll']){_0x56988f[_0xa1f8('0x4a')]=[{'all':!![]}];}_0x56988f=_[_0xa1f8('0x47')]({},_0x56988f,_0x5d666c[_0xa1f8('0x4f')]);return db[_0xa1f8('0x49')][_0xa1f8('0x50')](_0x56988f)[_0xa1f8('0x2e')](handleEntityNotFound(_0x1449c9,null))['then'](respondWithResult(_0x1449c9,null))[_0xa1f8('0x4d')](handleError(_0x1449c9,null));};exports[_0xa1f8('0x51')]=function(_0x3bca66,_0x466d20){return db[_0xa1f8('0x49')][_0xa1f8('0x51')](_0x3bca66[_0xa1f8('0x52')],{})['then'](function(_0x574804){var _0x733755=_0x3bca66[_0xa1f8('0x53')][_0xa1f8('0x54')]({'plain':!![]});if(!_0x733755)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x733755[_0xa1f8('0x55')]===_0xa1f8('0x53')){var _0x453fe9=_0x574804[_0xa1f8('0x54')]({'plain':!![]});var _0x58573e=_0xa1f8('0x30');return db[_0xa1f8('0x56')][_0xa1f8('0x50')]({'where':{'name':_0x58573e,'userProfileId':_0x733755[_0xa1f8('0x57')]},'raw':!![]})[_0xa1f8('0x2e')](function(_0x4ebc4f){if(_0x4ebc4f&&_0x4ebc4f[_0xa1f8('0x58')]===0x0){return db[_0xa1f8('0x31')][_0xa1f8('0x51')]({'name':_0x453fe9[_0xa1f8('0x34')],'resourceId':_0x453fe9['id'],'type':_0x4ebc4f[_0xa1f8('0x34')],'sectionId':_0x4ebc4f['id']},{})[_0xa1f8('0x2e')](function(){return _0x574804;});}else{return _0x574804;}})[_0xa1f8('0x4d')](function(_0x295c13){logger[_0xa1f8('0x33')](_0xa1f8('0x59'),_0x295c13);throw _0x295c13;});}return _0x574804;})[_0xa1f8('0x2e')](respondWithResult(_0x466d20,0xc9))[_0xa1f8('0x4d')](handleError(_0x466d20,null));};exports[_0xa1f8('0x2d')]=function(_0xf95439,_0x19bb05){if(_0xf95439['body']['id']){delete _0xf95439[_0xa1f8('0x52')]['id'];}return db['CmList'][_0xa1f8('0x50')]({'where':{'id':_0xf95439[_0xa1f8('0x5a')]['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x19bb05,null))['then'](saveUpdates(_0xf95439[_0xa1f8('0x52')],null))['then'](respondWithResult(_0x19bb05,null))[_0xa1f8('0x4d')](handleError(_0x19bb05,null));};exports[_0xa1f8('0x2f')]=function(_0xc0639,_0x3babac){return db['CmList']['find']({'where':{'id':_0xc0639[_0xa1f8('0x5a')]['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x3babac,null))[_0xa1f8('0x2e')](removeEntity(_0x3babac,null))[_0xa1f8('0x4d')](handleError(_0x3babac,null));};exports[_0xa1f8('0x5b')]=function(_0x4f1d9a,_0x14a698){return db['CmList']['describe']()[_0xa1f8('0x2e')](respondWithResult(_0x14a698,null))['catch'](handleError(_0x14a698,null));};exports['addDisposition']=function(_0x24b6b6,_0x542966,_0x4b8633){if(_0x24b6b6[_0xa1f8('0x52')]['id']){delete _0x24b6b6['body']['id'];}return db['CmList']['find']({'where':{'id':_0x24b6b6[_0xa1f8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x542966,null))[_0xa1f8('0x2e')](function(_0x47ef95){if(_0x47ef95){_0x24b6b6[_0xa1f8('0x52')][_0xa1f8('0x5c')]=_0x47ef95['id'];return db[_0xa1f8('0x5d')][_0xa1f8('0x51')](_0x24b6b6[_0xa1f8('0x52')]);}})[_0xa1f8('0x2e')](respondWithResult(_0x542966,null))['catch'](handleError(_0x542966,null));};exports[_0xa1f8('0x5e')]=function(_0xee0f2,_0x4637d8,_0x2179e2){var _0xd5c385={'raw':![],'where':{}};var _0x1aff72={};var _0x3014cd={'count':0x0,'rows':[]};return db[_0xa1f8('0x49')][_0xa1f8('0x5f')]({'where':{'id':_0xee0f2[_0xa1f8('0x5a')]['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x4637d8,null))[_0xa1f8('0x2e')](function(_0x20ad80){if(_0x20ad80){_0x1aff72[_0xa1f8('0x39')]=_[_0xa1f8('0x3c')](db[_0xa1f8('0x5d')][_0xa1f8('0x36')]);_0x1aff72[_0xa1f8('0x3b')]=_[_0xa1f8('0x3c')](_0xee0f2[_0xa1f8('0x3b')]);_0x1aff72[_0xa1f8('0x3d')]=_[_0xa1f8('0x3e')](_0x1aff72['model'],_0x1aff72[_0xa1f8('0x3b')]);_0xd5c385[_0xa1f8('0x3f')]=_[_0xa1f8('0x3e')](_0x1aff72['model'],qs['fields'](_0xee0f2[_0xa1f8('0x3b')]['fields']));_0xd5c385[_0xa1f8('0x3f')]=_0xd5c385[_0xa1f8('0x3f')][_0xa1f8('0x4e')]?_0xd5c385[_0xa1f8('0x3f')]:_0x1aff72[_0xa1f8('0x39')];if(!_0xee0f2[_0xa1f8('0x3b')][_0xa1f8('0x60')](_0xa1f8('0x41'))){_0xd5c385['limit']=qs['limit'](_0xee0f2[_0xa1f8('0x3b')]['limit']);_0xd5c385[_0xa1f8('0x24')]=qs[_0xa1f8('0x24')](_0xee0f2['query'][_0xa1f8('0x24')]);}_0xd5c385['order']=qs[_0xa1f8('0x43')](_0xee0f2[_0xa1f8('0x3b')][_0xa1f8('0x43')]);_0xd5c385[_0xa1f8('0x44')]=qs['filters'](_[_0xa1f8('0x45')](_0xee0f2[_0xa1f8('0x3b')],_0x1aff72[_0xa1f8('0x3d')]));_0xd5c385[_0xa1f8('0x44')][_0xa1f8('0x5c')]=_0x20ad80['id'];if(_0xee0f2[_0xa1f8('0x3b')][_0xa1f8('0x46')]){_0xd5c385[_0xa1f8('0x44')]=_[_0xa1f8('0x47')](_0xd5c385[_0xa1f8('0x44')],{'$or':_['map'](_0xd5c385[_0xa1f8('0x3f')],function(_0x2f7e84){var _0x3a2b82={};_0x3a2b82[_0x2f7e84]={'$like':'%'+_0xee0f2[_0xa1f8('0x3b')][_0xa1f8('0x46')]+'%'};return _0x3a2b82;})});}_0xd5c385=_[_0xa1f8('0x47')]({},_0xd5c385,_0xee0f2['options']);return db[_0xa1f8('0x5d')][_0xa1f8('0x27')]({'where':_0xd5c385[_0xa1f8('0x44')]})[_0xa1f8('0x2e')](function(_0x4b0fee){_0x3014cd[_0xa1f8('0x27')]=_0x4b0fee;if(_0xee0f2[_0xa1f8('0x3b')][_0xa1f8('0x61')]){_0xd5c385[_0xa1f8('0x4a')]=[{'all':!![]}];}return db[_0xa1f8('0x5d')][_0xa1f8('0x4b')](_0xd5c385);})[_0xa1f8('0x2e')](function(_0x1a931f){_0x3014cd['rows']=_0x1a931f;return _0x3014cd;});}})[_0xa1f8('0x2e')](respondWithFilteredResult(_0x4637d8,_0xd5c385))[_0xa1f8('0x4d')](handleError(_0x4637d8,null));};exports[_0xa1f8('0x62')]=function(_0x32e90c,_0x4bf3ea,_0x4e9d48){return db['CmList'][_0xa1f8('0x50')]({'where':{'id':_0x32e90c[_0xa1f8('0x5a')]['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x4bf3ea,null))[_0xa1f8('0x2e')](function(_0x59a0a7){if(_0x59a0a7){return _0x59a0a7[_0xa1f8('0x62')](_0x32e90c['query'][_0xa1f8('0x63')]);}})[_0xa1f8('0x2e')](respondWithStatusCode(_0x4bf3ea,null))['catch'](handleError(_0x4bf3ea,null));};exports[_0xa1f8('0x64')]=function(_0x74cc70,_0x191fad,_0x570a45){return db[_0xa1f8('0x49')][_0xa1f8('0x50')]({'where':{'id':_0x74cc70[_0xa1f8('0x5a')]['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x191fad,null))[_0xa1f8('0x2e')](function(_0x196655){if(_0x196655){var _0xecda12=[];var _0x3ce96b={'success':[],'errors':[]};return db[_0xa1f8('0x65')][_0xa1f8('0x5b')]()[_0xa1f8('0x2e')](function(_0x10ac35){if(_0x74cc70['body'][_0xa1f8('0x66')]&&_[_0xa1f8('0x67')](_0x74cc70[_0xa1f8('0x52')][_0xa1f8('0x66')])){if(_0x74cc70[_0xa1f8('0x52')][_0xa1f8('0x66')][_0xa1f8('0x4e')]){_0x74cc70[_0xa1f8('0x52')]['tags']=_0x74cc70[_0xa1f8('0x52')]['tags'][_0xa1f8('0x68')](';')+';';}else{_0x74cc70['body'][_0xa1f8('0x66')]=null;}}else{_0x74cc70[_0xa1f8('0x52')][_0xa1f8('0x66')]=null;}if(_0x74cc70['body']&&_['isArray'](_0x74cc70[_0xa1f8('0x52')])){for(var _0x37a4f9=0x0;_0x37a4f9<_0x74cc70[_0xa1f8('0x52')][_0xa1f8('0x4e')];_0x37a4f9+=0x1){_0x74cc70[_0xa1f8('0x52')][_0x37a4f9][_0xa1f8('0x5c')]=_0x74cc70[_0xa1f8('0x5a')]['id'];_0xecda12['push'](_0x74cc70[_0xa1f8('0x52')][_0x37a4f9]);}return BPromise[_0xa1f8('0x69')](_0xecda12,function(_0x40b26c){return db[_0xa1f8('0x65')][_0xa1f8('0x51')](_['omit'](_0x40b26c,[_0xa1f8('0x63'),'id'])||{},{'fields':_[_0xa1f8('0x3c')](_0x10ac35),'raw':!![]})[_0xa1f8('0x2e')](function(_0x40cff2){_0x3ce96b[_0xa1f8('0x6a')]['push'](_0x40cff2[_0xa1f8('0x6b')]);})[_0xa1f8('0x4d')](function(_0x1f2f1c){_0x3ce96b[_0xa1f8('0x6c')][_0xa1f8('0x6d')]({'data':_0x40b26c,'error':_0x1f2f1c['message']});});})[_0xa1f8('0x2e')](function(_0x145dfd){return _0x3ce96b;})[_0xa1f8('0x4d')](function(_0xe4f36d){return _0xe4f36d;});}else{_0x191fad['status'](0x190)[_0xa1f8('0x23')]({'message':_0xa1f8('0x6e')});}});}})['then'](respondWithResult(_0x191fad,null))[_0xa1f8('0x4d')](handleError(_0x191fad,null));};exports[_0xa1f8('0x6f')]=function(_0x15e65a,_0x5b4a6f,_0x279145){var _0x173121;return db[_0xa1f8('0x49')][_0xa1f8('0x50')]({'where':{'id':_0x15e65a['params']['id']},'include':[{'model':db[_0xa1f8('0x70')],'as':'CustomFields'}]})[_0xa1f8('0x2e')](handleEntityNotFound(_0x5b4a6f,null))[_0xa1f8('0x2e')](function(_0x37fc3b){if(_0x37fc3b){_0x173121=_0x37fc3b;return db[_0xa1f8('0x65')][_0xa1f8('0x36')];}})['then'](function(_0x42d195){if(_0x42d195){var _0x320d9b={};var _0x4aeb3e={};_0x4aeb3e[_0xa1f8('0x39')]=_[_0xa1f8('0x71')](_['keys'](_0x42d195),_[_0xa1f8('0x3a')](_0x173121[_0xa1f8('0x72')],function(_0x2c15a2){return util[_0xa1f8('0x73')](_0xa1f8('0x74'),_0x2c15a2['id']);}));_0x4aeb3e[_0xa1f8('0x3b')]=_['keys'](_0x15e65a[_0xa1f8('0x3b')]);_0x4aeb3e[_0xa1f8('0x3d')]=_[_0xa1f8('0x3e')](_0x4aeb3e[_0xa1f8('0x39')],_0x4aeb3e[_0xa1f8('0x3b')]);_0x320d9b[_0xa1f8('0x3f')]=_['intersection'](_0x4aeb3e['model'],qs['fields'](_0x15e65a[_0xa1f8('0x3b')][_0xa1f8('0x40')]));_0x320d9b[_0xa1f8('0x3f')]=_0x320d9b[_0xa1f8('0x3f')][_0xa1f8('0x4e')]?_0x320d9b[_0xa1f8('0x3f')]:_0x4aeb3e[_0xa1f8('0x39')];if(!_0x15e65a['query'][_0xa1f8('0x60')](_0xa1f8('0x41'))){_0x320d9b[_0xa1f8('0x26')]=qs[_0xa1f8('0x26')](_0x15e65a[_0xa1f8('0x3b')][_0xa1f8('0x26')]);_0x320d9b[_0xa1f8('0x24')]=qs[_0xa1f8('0x24')](_0x15e65a[_0xa1f8('0x3b')][_0xa1f8('0x24')]);}_0x320d9b['order']=qs[_0xa1f8('0x43')](_0x15e65a[_0xa1f8('0x3b')]['sort']);_0x320d9b[_0xa1f8('0x44')]=qs[_0xa1f8('0x3d')](_[_0xa1f8('0x45')](_0x15e65a[_0xa1f8('0x3b')],_0x4aeb3e['filters']));_0x320d9b['raw']=!![];if(_0x15e65a[_0xa1f8('0x3b')]['filter']){_0x320d9b[_0xa1f8('0x44')]=_[_0xa1f8('0x47')](_0x320d9b[_0xa1f8('0x44')],{'$or':_[_0xa1f8('0x3a')](_0x320d9b['attributes'],function(_0xdd1800){var _0x14f055={};_0x14f055[_0xdd1800]={'$like':'%'+_0x15e65a[_0xa1f8('0x3b')]['filter']+'%'};return _0x14f055;})});}_0x320d9b=_[_0xa1f8('0x47')]({},_0x320d9b,_0x15e65a['options']);return _0x173121[_0xa1f8('0x6f')](_0x320d9b);}})['then'](respondWithResult(_0x5b4a6f,null))['catch'](handleError(_0x5b4a6f,null));};exports['getContactsCsv']=function(_0x5f1dd1,_0x48a8e3,_0x303855){var _0x2039c5;return db[_0xa1f8('0x49')][_0xa1f8('0x50')]({'where':{'id':_0x5f1dd1[_0xa1f8('0x5a')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xa1f8('0x2e')](handleEntityNotFound(_0x48a8e3,null))[_0xa1f8('0x2e')](function(_0x376957){if(_0x376957){_0x2039c5=_0x376957;return db[_0xa1f8('0x65')][_0xa1f8('0x36')];}})[_0xa1f8('0x2e')](function(_0xa03494){if(_0xa03494){var _0x26c376={};var _0x178687={};_0x178687[_0xa1f8('0x39')]=_[_0xa1f8('0x71')](_[_0xa1f8('0x3c')](_0xa03494),_['map'](_0x2039c5['CustomFields'],function(_0x213535){return util['format'](_0xa1f8('0x74'),_0x213535['id']);}));_0x178687['query']=_[_0xa1f8('0x3c')](_0x5f1dd1['query']);_0x178687[_0xa1f8('0x3d')]=_['intersection'](_0x178687[_0xa1f8('0x39')],_0x178687[_0xa1f8('0x3b')]);_0x26c376['attributes']=_['intersection'](_0x178687[_0xa1f8('0x39')],qs[_0xa1f8('0x40')](_0x5f1dd1[_0xa1f8('0x3b')][_0xa1f8('0x40')]));_0x26c376[_0xa1f8('0x3f')]=_0x26c376[_0xa1f8('0x3f')][_0xa1f8('0x4e')]?_0x26c376['attributes']:_0x178687['model'];if(!_0x5f1dd1[_0xa1f8('0x3b')][_0xa1f8('0x60')](_0xa1f8('0x41'))){_0x26c376[_0xa1f8('0x26')]=qs[_0xa1f8('0x26')](_0x5f1dd1['query'][_0xa1f8('0x26')]);_0x26c376[_0xa1f8('0x24')]=qs[_0xa1f8('0x24')](_0x5f1dd1[_0xa1f8('0x3b')]['offset']);}_0x26c376['order']=qs[_0xa1f8('0x43')](_0x5f1dd1['query'][_0xa1f8('0x43')]);_0x26c376[_0xa1f8('0x44')]=qs[_0xa1f8('0x3d')](_[_0xa1f8('0x45')](_0x5f1dd1[_0xa1f8('0x3b')],_0x178687[_0xa1f8('0x3d')]));_0x26c376[_0xa1f8('0x75')]=!![];if(_0x5f1dd1['query'][_0xa1f8('0x46')]){_0x26c376['where']=_['merge'](_0x26c376[_0xa1f8('0x44')],{'$or':_[_0xa1f8('0x3a')](_0x26c376[_0xa1f8('0x3f')],function(_0x533bdb){var _0x6f14ec={};_0x6f14ec[_0x533bdb]={'$like':'%'+_0x5f1dd1[_0xa1f8('0x3b')][_0xa1f8('0x46')]+'%'};return _0x6f14ec;})});}_0x26c376=_[_0xa1f8('0x47')]({},_0x26c376,_0x5f1dd1[_0xa1f8('0x4f')]);return _0x2039c5['getContacts'](_0x26c376);}})['then'](function(_0x238445){if(!_[_0xa1f8('0x76')](_0x238445)){var _0x46b467=toCsv(_0x238445);var _0x1db8b3=Date['now']();fs['writeFileSync'](util[_0xa1f8('0x73')]('/tmp/list_%d_%s.csv',_0x2039c5['id'],_0x1db8b3),_0x46b467);_0x48a8e3['setHeader'](_0xa1f8('0x77'),_0xa1f8('0x78')+util['format'](_0xa1f8('0x79'),_0x2039c5['id'],_0x1db8b3));_0x48a8e3[_0xa1f8('0x7a')]('Content-type',_0xa1f8('0x7b'));return _0x48a8e3['download'](util[_0xa1f8('0x73')]('/tmp/list_%d_%s.csv',_0x2039c5['id'],_0x1db8b3));}else{return _0x48a8e3['sendStatus'](0xcc);}})['catch'](handleError(_0x48a8e3,null));};exports['addCustomField']=function(_0x28704a,_0x139ffb,_0x48c28f){var _0x4a1c5c;delete _0x28704a['body']['id'];return db[_0xa1f8('0x49')][_0xa1f8('0x5f')]({'where':{'id':_0x28704a[_0xa1f8('0x5a')]['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x139ffb,null))[_0xa1f8('0x2e')](function(_0x11c6cb){if(_0x11c6cb){return db['sequelize'][_0xa1f8('0x7c')](function(_0xbf8fcd){return db[_0xa1f8('0x70')]['create'](_0x28704a[_0xa1f8('0x52')],{'transaction':_0xbf8fcd})[_0xa1f8('0x2e')](function(_0xed8234){_0x4a1c5c=_0xed8234;return _0x11c6cb[_0xa1f8('0x7d')](_0xed8234,{'transaction':_0xbf8fcd});})[_0xa1f8('0x2e')](function(){var _0x2a4b2c={'type':db[_0xa1f8('0x7e')]['TEXT'],'transaction':_0xbf8fcd};switch(_0x28704a[_0xa1f8('0x52')][_0xa1f8('0x37')]){case'text':_0x2a4b2c['type']=db[_0xa1f8('0x7e')][_0xa1f8('0x7f')];break;case _0xa1f8('0x80'):_0x2a4b2c['type']=db[_0xa1f8('0x7e')]['INTEGER'];break;case _0xa1f8('0x81'):_0x2a4b2c['type']=db[_0xa1f8('0x7e')][_0xa1f8('0x82')];_0x2a4b2c[_0xa1f8('0x83')]=![];break;default:}return db[_0xa1f8('0x84')][_0xa1f8('0x85')][_0xa1f8('0x86')](_0xa1f8('0x87'),util[_0xa1f8('0x73')](_0xa1f8('0x88'),_0x4a1c5c['id']),_0x2a4b2c);})['then'](function(){return _0x4a1c5c;});});}})['then'](respondWithResult(_0x139ffb,null))[_0xa1f8('0x4d')](handleError(_0x139ffb,null));};exports[_0xa1f8('0x89')]=function(_0x25c9a2,_0x19b051,_0x198310){var _0xf90543={};var _0x3025a0={};var _0xe5bffa;var _0x29e364;return db[_0xa1f8('0x49')][_0xa1f8('0x5f')]({'where':{'id':_0x25c9a2[_0xa1f8('0x5a')]['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x19b051,null))['then'](function(_0xd30dd0){if(_0xd30dd0){_0xe5bffa=_0xd30dd0;_0x3025a0[_0xa1f8('0x39')]=_['keys'](db[_0xa1f8('0x70')][_0xa1f8('0x36')]);_0x3025a0[_0xa1f8('0x3b')]=_[_0xa1f8('0x3c')](_0x25c9a2[_0xa1f8('0x3b')]);_0x3025a0[_0xa1f8('0x3d')]=_['intersection'](_0x3025a0[_0xa1f8('0x39')],_0x3025a0['query']);_0xf90543[_0xa1f8('0x3f')]=_[_0xa1f8('0x3e')](_0x3025a0[_0xa1f8('0x39')],qs[_0xa1f8('0x40')](_0x25c9a2['query'][_0xa1f8('0x40')]));_0xf90543[_0xa1f8('0x3f')]=_0xf90543[_0xa1f8('0x3f')]['length']?_0xf90543[_0xa1f8('0x3f')]:_0x3025a0[_0xa1f8('0x39')];_0xf90543[_0xa1f8('0x42')]=qs[_0xa1f8('0x43')](_0x25c9a2[_0xa1f8('0x3b')]['sort']);_0xf90543[_0xa1f8('0x44')]=qs[_0xa1f8('0x3d')](_[_0xa1f8('0x45')](_0x25c9a2[_0xa1f8('0x3b')],_0x3025a0[_0xa1f8('0x3d')]));_0xf90543['where']=_[_0xa1f8('0x47')](_0xf90543[_0xa1f8('0x44')],{'$or':[{'ListId':_0xd30dd0['id']},{'ListId':null}]});if(_0x25c9a2['query'][_0xa1f8('0x46')]){_0xf90543[_0xa1f8('0x44')]=_[_0xa1f8('0x47')](_0xf90543[_0xa1f8('0x44')],{'$or':_['map'](_0xf90543['attributes'],function(_0x215852){var _0xc59761={};_0xc59761[_0x215852]={'$like':'%'+_0x25c9a2[_0xa1f8('0x3b')]['filter']+'%'};return _0xc59761;})});}_0xf90543=_[_0xa1f8('0x47')]({},_0xf90543,_0x25c9a2[_0xa1f8('0x4f')]);return db['CmCustomField'][_0xa1f8('0x8a')](_0xf90543);}})[_0xa1f8('0x2e')](respondWithResult(_0x19b051,null))[_0xa1f8('0x4d')](handleError(_0x19b051,null));};exports[_0xa1f8('0x8b')]=function(_0x51e6c4,_0x156d8f,_0x4310dd){return db[_0xa1f8('0x49')][_0xa1f8('0x50')]({'where':{'id':_0x51e6c4[_0xa1f8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x156d8f,null))[_0xa1f8('0x2e')](function(_0x5d5221){if(_0x5d5221){return _0x5d5221[_0xa1f8('0x8b')](_0x51e6c4[_0xa1f8('0x52')][_0xa1f8('0x63')],_[_0xa1f8('0x8c')](_0x51e6c4[_0xa1f8('0x52')],['ids','id'])||{})[_0xa1f8('0x8d')](function(_0x3d0896){for(var _0x348084=0x0;_0x348084<_0x51e6c4[_0xa1f8('0x52')]['ids']['length'];_0x348084+=0x1){socket[_0xa1f8('0x8e')](_0xa1f8('0x8f'),{'UserId':Number(_0x51e6c4['body'][_0xa1f8('0x63')][_0x348084]),'CmListId':Number(_0x51e6c4[_0xa1f8('0x5a')]['id'])});}return _0x3d0896;});}})[_0xa1f8('0x2e')](respondWithResult(_0x156d8f,null))[_0xa1f8('0x4d')](handleError(_0x156d8f,null));};exports[_0xa1f8('0x90')]=function(_0x3b30c9,_0x5abd14,_0x5b959f){return db[_0xa1f8('0x49')]['find']({'where':{'id':_0x3b30c9[_0xa1f8('0x5a')]['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x5abd14,null))[_0xa1f8('0x2e')](function(_0x4cabe1){if(_0x4cabe1){return _0x4cabe1[_0xa1f8('0x90')](_0x3b30c9['query'][_0xa1f8('0x63')])[_0xa1f8('0x2e')](function(){if(_[_0xa1f8('0x67')](_0x3b30c9[_0xa1f8('0x3b')][_0xa1f8('0x63')])){for(var _0x41bc46=0x0;_0x41bc46<_0x3b30c9[_0xa1f8('0x3b')]['ids'][_0xa1f8('0x4e')];_0x41bc46+=0x1){socket['emit'](_0xa1f8('0x91'),{'UserId':Number(_0x3b30c9[_0xa1f8('0x3b')][_0xa1f8('0x63')][_0x41bc46]),'CmListId':Number(_0x3b30c9['params']['id'])});}}else{socket[_0xa1f8('0x8e')](_0xa1f8('0x91'),{'UserId':Number(_0x3b30c9['query'][_0xa1f8('0x63')]),'CmListId':Number(_0x3b30c9[_0xa1f8('0x5a')]['id'])});}});}})[_0xa1f8('0x2e')](respondWithStatusCode(_0x5abd14,null))[_0xa1f8('0x4d')](handleError(_0x5abd14,null));};exports[_0xa1f8('0x92')]=function(_0x53f152,_0x3e4005,_0x5a7e6c){var _0x1b8408={};var _0x39e82b={};var _0x25250a;var _0x464131;return db[_0xa1f8('0x49')][_0xa1f8('0x5f')]({'where':{'id':_0x53f152['params']['id']}})[_0xa1f8('0x2e')](handleEntityNotFound(_0x3e4005,null))['then'](function(_0x38b377){if(_0x38b377){_0x25250a=_0x38b377;_0x39e82b[_0xa1f8('0x39')]=_[_0xa1f8('0x3c')](db[_0xa1f8('0x93')][_0xa1f8('0x36')]);_0x39e82b[_0xa1f8('0x3b')]=_[_0xa1f8('0x3c')](_0x53f152[_0xa1f8('0x3b')]);_0x39e82b['filters']=_[_0xa1f8('0x3e')](_0x39e82b[_0xa1f8('0x39')],_0x39e82b[_0xa1f8('0x3b')]);_0x1b8408[_0xa1f8('0x3f')]=_[_0xa1f8('0x3e')](_0x39e82b['model'],qs['fields'](_0x53f152['query'][_0xa1f8('0x40')]));_0x1b8408[_0xa1f8('0x3f')]=_0x1b8408[_0xa1f8('0x3f')][_0xa1f8('0x4e')]?_0x1b8408['attributes']:_0x39e82b[_0xa1f8('0x39')];_0x1b8408[_0xa1f8('0x42')]=qs['sort'](_0x53f152[_0xa1f8('0x3b')][_0xa1f8('0x43')]);_0x1b8408[_0xa1f8('0x44')]=qs['filters'](_[_0xa1f8('0x45')](_0x53f152[_0xa1f8('0x3b')],_0x39e82b['filters']));if(_0x53f152[_0xa1f8('0x3b')][_0xa1f8('0x46')]){_0x1b8408[_0xa1f8('0x44')]=_[_0xa1f8('0x47')](_0x1b8408[_0xa1f8('0x44')],{'$or':_['map'](_0x1b8408['attributes'],function(_0x508e57){var _0x536cb4={};_0x536cb4[_0x508e57]={'$like':'%'+_0x53f152[_0xa1f8('0x3b')][_0xa1f8('0x46')]+'%'};return _0x536cb4;})});}_0x1b8408=_['merge']({},_0x1b8408,_0x53f152[_0xa1f8('0x4f')]);return _0x25250a['getAgents'](_0x1b8408);}})[_0xa1f8('0x2e')](function(_0x3dd260){if(_0x3dd260){_0x464131=_0x3dd260[_0xa1f8('0x4e')];if(!_0x53f152[_0xa1f8('0x3b')][_0xa1f8('0x60')]('nolimit')){_0x1b8408[_0xa1f8('0x26')]=qs[_0xa1f8('0x26')](_0x53f152[_0xa1f8('0x3b')][_0xa1f8('0x26')]);_0x1b8408[_0xa1f8('0x24')]=qs[_0xa1f8('0x24')](_0x53f152['query']['offset']);}return _0x25250a[_0xa1f8('0x92')](_0x1b8408);}})[_0xa1f8('0x2e')](function(_0x409cf7){if(_0x409cf7){return _0x409cf7?{'count':_0x464131,'rows':_0x409cf7}:null;}})[_0xa1f8('0x2e')](respondWithResult(_0x3e4005,null))[_0xa1f8('0x4d')](handleError(_0x3e4005,null));};
\ No newline at end of file
+var _0x388b=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','end','status','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','map','CmList','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','offset','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','length','hasOwnProperty','order','removeDispositions','addContacts','CmContact','tags','join','push','each','omit','ids','dataValues','errors','message','getContacts','CustomFields','concat','format','cf_%d','raw','getContactsCsv','CmCustomField','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','number','Sequelize','INTEGER','switch','defaultValue','queryInterface','addColumn','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','getAgents','User','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x53960c,_0x2be148){var _0x511911=function(_0x2b10f2){while(--_0x2b10f2){_0x53960c['push'](_0x53960c['shift']());}};_0x511911(++_0x2be148);}(_0x388b,0x82));var _0xb388=function(_0x3a25ec,_0x81563e){_0x3a25ec=_0x3a25ec-0x0;var _0xcd0e25=_0x388b[_0x3a25ec];return _0xcd0e25;};'use strict';var emlformat=require(_0xb388('0x0'));var rimraf=require(_0xb388('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb388('0x2'));var rp=require('request-promise');var moment=require(_0xb388('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb388('0x4'));var util=require(_0xb388('0x5'));var path=require(_0xb388('0x6'));var sox=require(_0xb388('0x7'));var csv=require(_0xb388('0x8'));var ejs=require(_0xb388('0x9'));var fs=require('fs');var fs_extra=require(_0xb388('0xa'));var _=require(_0xb388('0xb'));var squel=require(_0xb388('0xc'));var crypto=require(_0xb388('0xd'));var jsforce=require(_0xb388('0xe'));var deskjs=require(_0xb388('0xf'));var toCsv=require(_0xb388('0x8'));var querystring=require(_0xb388('0x10'));var Papa=require(_0xb388('0x11'));var Redis=require('ioredis');var authService=require(_0xb388('0x12'));var qs=require(_0xb388('0x13'));var as=require(_0xb388('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb388('0x15'))('api');var utils=require(_0xb388('0x16'));var config=require(_0xb388('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb388('0x18'))['db'];config[_0xb388('0x19')]=_[_0xb388('0x1a')](config['redis'],{'host':_0xb388('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb388('0x19')]));require(_0xb388('0x1c'))['register'](socket);function respondWithStatusCode(_0x551530,_0x5c0324){_0x5c0324=_0x5c0324||0xcc;return function(_0x17aa3f){if(_0x17aa3f){return _0x551530['sendStatus'](_0x5c0324);}return _0x551530['status'](_0x5c0324)[_0xb388('0x1d')]();};}function respondWithResult(_0x2cdfed,_0x86d873){_0x86d873=_0x86d873||0xc8;return function(_0x457d2f){if(_0x457d2f){return _0x2cdfed[_0xb388('0x1e')](_0x86d873)[_0xb388('0x1f')](_0x457d2f);}};}function respondWithFilteredResult(_0x3278d7,_0x459b56){return function(_0x1cdcbe){if(_0x1cdcbe){var _0x5117b6=typeof _0x459b56['offset']===_0xb388('0x20')&&typeof _0x459b56[_0xb388('0x21')]===_0xb388('0x20');var _0xaf4cfa=_0x1cdcbe['count'];var _0x2f0155=_0x5117b6?0x0:_0x459b56['offset'];var _0x187b09=_0x5117b6?_0x1cdcbe[_0xb388('0x22')]:_0x459b56['offset']+_0x459b56[_0xb388('0x21')];var _0x5e63f0;if(_0x187b09>=_0xaf4cfa){_0x187b09=_0xaf4cfa;_0x5e63f0=0xc8;}else{_0x5e63f0=0xce;}_0x3278d7['status'](_0x5e63f0);return _0x3278d7[_0xb388('0x23')](_0xb388('0x24'),_0x2f0155+'-'+_0x187b09+'/'+_0xaf4cfa)[_0xb388('0x1f')](_0x1cdcbe);}return null;};}function patchUpdates(_0xf4944d){return function(_0x4c6b6a){try{jsonpatch[_0xb388('0x25')](_0x4c6b6a,_0xf4944d,!![]);}catch(_0x57a9a0){return BPromise['reject'](_0x57a9a0);}return _0x4c6b6a[_0xb388('0x26')]();};}function saveUpdates(_0x5cf6d6,_0x514eeb){return function(_0x56b083){if(_0x56b083){return _0x56b083[_0xb388('0x27')](_0x5cf6d6)[_0xb388('0x28')](function(_0x563747){return _0x563747;});}return null;};}function removeEntity(_0x106e94,_0x35e72b){return function(_0x41fbaa){if(_0x41fbaa){return _0x41fbaa[_0xb388('0x29')]()[_0xb388('0x28')](function(){var _0x38705b=_0x41fbaa[_0xb388('0x2a')]({'plain':!![]});var _0x119e9b='Lists';return db[_0xb388('0x2b')][_0xb388('0x29')]({'where':{'type':_0x119e9b,'resourceId':_0x38705b['id']}})[_0xb388('0x28')](function(){return _0x41fbaa;});})[_0xb388('0x28')](function(){_0x106e94['status'](0xcc)[_0xb388('0x1d')]();});}};}function handleEntityNotFound(_0x17a3b5,_0x45bc5f){return function(_0x9f8b30){if(!_0x9f8b30){_0x17a3b5[_0xb388('0x2c')](0x194);}return _0x9f8b30;};}function handleError(_0x72efd5,_0x307a10){_0x307a10=_0x307a10||0x1f4;return function(_0x1543b8){logger[_0xb388('0x2d')](_0x1543b8[_0xb388('0x2e')]);if(_0x1543b8['name']){delete _0x1543b8[_0xb388('0x2f')];}_0x72efd5[_0xb388('0x1e')](_0x307a10)['send'](_0x1543b8);};}exports[_0xb388('0x30')]=function(_0x4d62e3,_0x362f60){var _0x2c5d6c={},_0x1f1dd2={},_0x3d4471={'count':0x0,'rows':[]};var _0x505efd=_[_0xb388('0x31')](db[_0xb388('0x32')]['rawAttributes'],function(_0x6220e5){return{'name':_0x6220e5[_0xb388('0x33')],'type':_0x6220e5[_0xb388('0x34')][_0xb388('0x35')]};});_0x1f1dd2[_0xb388('0x36')]=_[_0xb388('0x31')](_0x505efd,'name');_0x1f1dd2[_0xb388('0x37')]=_[_0xb388('0x38')](_0x4d62e3[_0xb388('0x37')]);_0x1f1dd2[_0xb388('0x39')]=_[_0xb388('0x3a')](_0x1f1dd2[_0xb388('0x36')],_0x1f1dd2[_0xb388('0x37')]);_0x2c5d6c[_0xb388('0x3b')]=_[_0xb388('0x3a')](_0x1f1dd2[_0xb388('0x36')],qs['fields'](_0x4d62e3[_0xb388('0x37')][_0xb388('0x3c')]));_0x2c5d6c['attributes']=_0x2c5d6c[_0xb388('0x3b')]['length']?_0x2c5d6c[_0xb388('0x3b')]:_0x1f1dd2[_0xb388('0x36')];if(!_0x4d62e3[_0xb388('0x37')]['hasOwnProperty'](_0xb388('0x3d'))){_0x2c5d6c[_0xb388('0x21')]=qs[_0xb388('0x21')](_0x4d62e3[_0xb388('0x37')][_0xb388('0x21')]);_0x2c5d6c[_0xb388('0x3e')]=qs[_0xb388('0x3e')](_0x4d62e3[_0xb388('0x37')][_0xb388('0x3e')]);}_0x2c5d6c['order']=qs[_0xb388('0x3f')](_0x4d62e3[_0xb388('0x37')][_0xb388('0x3f')]);_0x2c5d6c[_0xb388('0x40')]=qs['filters'](_[_0xb388('0x41')](_0x4d62e3[_0xb388('0x37')],_0x1f1dd2[_0xb388('0x39')]),_0x505efd);if(_0x4d62e3[_0xb388('0x37')]['filter']){_0x2c5d6c[_0xb388('0x40')]=_[_0xb388('0x42')](_0x2c5d6c[_0xb388('0x40')],{'$or':_[_0xb388('0x31')](_0x505efd,function(_0x991add){if(_0x991add[_0xb388('0x34')]!==_0xb388('0x43')){var _0x3bdd2f={};_0x3bdd2f[_0x991add['name']]={'$like':'%'+_0x4d62e3['query'][_0xb388('0x44')]+'%'};return _0x3bdd2f;}})});}_0x2c5d6c=_[_0xb388('0x42')]({},_0x2c5d6c,_0x4d62e3[_0xb388('0x45')]);var _0x19b24c={'where':_0x2c5d6c[_0xb388('0x40')]};return db[_0xb388('0x32')][_0xb388('0x22')](_0x19b24c)[_0xb388('0x28')](function(_0x108cab){_0x3d4471[_0xb388('0x22')]=_0x108cab;if(_0x4d62e3[_0xb388('0x37')][_0xb388('0x46')]){_0x2c5d6c['include']=[{'all':!![]}];}return db[_0xb388('0x32')][_0xb388('0x47')](_0x2c5d6c);})['then'](function(_0x4b3369){_0x3d4471[_0xb388('0x48')]=_0x4b3369;return _0x3d4471;})[_0xb388('0x28')](respondWithFilteredResult(_0x362f60,_0x2c5d6c))[_0xb388('0x49')](handleError(_0x362f60,null));};exports[_0xb388('0x4a')]=function(_0x15d8c7,_0x33f07c){var _0x2e8186={'raw':![],'where':{'id':_0x15d8c7[_0xb388('0x4b')]['id']}},_0xc7f8b9={};_0xc7f8b9['model']=_[_0xb388('0x38')](db[_0xb388('0x32')][_0xb388('0x4c')]);_0xc7f8b9[_0xb388('0x37')]=_[_0xb388('0x38')](_0x15d8c7['query']);_0xc7f8b9[_0xb388('0x39')]=_[_0xb388('0x3a')](_0xc7f8b9[_0xb388('0x36')],_0xc7f8b9[_0xb388('0x37')]);_0x2e8186[_0xb388('0x3b')]=_[_0xb388('0x3a')](_0xc7f8b9[_0xb388('0x36')],qs['fields'](_0x15d8c7['query'][_0xb388('0x3c')]));_0x2e8186[_0xb388('0x3b')]=_0x2e8186[_0xb388('0x3b')]['length']?_0x2e8186[_0xb388('0x3b')]:_0xc7f8b9[_0xb388('0x36')];if(_0x15d8c7['query']['includeAll']){_0x2e8186[_0xb388('0x4d')]=[{'all':!![]}];}_0x2e8186=_[_0xb388('0x42')]({},_0x2e8186,_0x15d8c7['options']);return db[_0xb388('0x32')][_0xb388('0x4e')](_0x2e8186)['then'](handleEntityNotFound(_0x33f07c,null))[_0xb388('0x28')](respondWithResult(_0x33f07c,null))['catch'](handleError(_0x33f07c,null));};exports[_0xb388('0x4f')]=function(_0xb14079,_0x1f646b){return db[_0xb388('0x32')]['create'](_0xb14079[_0xb388('0x50')],{})[_0xb388('0x28')](function(_0x20eb16){var _0x29c8ce=_0xb14079[_0xb388('0x51')]['get']({'plain':!![]});if(!_0x29c8ce)throw new Error(_0xb388('0x52'));if(_0x29c8ce[_0xb388('0x53')]===_0xb388('0x51')){var _0x13ea1e=_0x20eb16[_0xb388('0x2a')]({'plain':!![]});var _0xf3b1b8=_0xb388('0x54');return db[_0xb388('0x55')]['find']({'where':{'name':_0xf3b1b8,'userProfileId':_0x29c8ce['userProfileId']},'raw':!![]})[_0xb388('0x28')](function(_0x9f3052){if(_0x9f3052&&_0x9f3052[_0xb388('0x56')]===0x0){return db[_0xb388('0x2b')][_0xb388('0x4f')]({'name':_0x13ea1e[_0xb388('0x2f')],'resourceId':_0x13ea1e['id'],'type':_0x9f3052[_0xb388('0x2f')],'sectionId':_0x9f3052['id']},{})[_0xb388('0x28')](function(){return _0x20eb16;});}else{return _0x20eb16;}})['catch'](function(_0x49096b){logger['error'](_0xb388('0x57'),_0x49096b);throw _0x49096b;});}return _0x20eb16;})['then'](respondWithResult(_0x1f646b,0xc9))[_0xb388('0x49')](handleError(_0x1f646b,null));};exports[_0xb388('0x27')]=function(_0x50b083,_0xab3d01){if(_0x50b083[_0xb388('0x50')]['id']){delete _0x50b083[_0xb388('0x50')]['id'];}return db['CmList']['find']({'where':{'id':_0x50b083['params']['id']}})[_0xb388('0x28')](handleEntityNotFound(_0xab3d01,null))[_0xb388('0x28')](saveUpdates(_0x50b083[_0xb388('0x50')],null))['then'](respondWithResult(_0xab3d01,null))[_0xb388('0x49')](handleError(_0xab3d01,null));};exports[_0xb388('0x29')]=function(_0x9106b3,_0x1de24a){return db[_0xb388('0x32')]['find']({'where':{'id':_0x9106b3[_0xb388('0x4b')]['id']}})[_0xb388('0x28')](handleEntityNotFound(_0x1de24a,null))[_0xb388('0x28')](removeEntity(_0x1de24a,null))[_0xb388('0x49')](handleError(_0x1de24a,null));};exports[_0xb388('0x58')]=function(_0x4d7efb,_0x56784d){return db[_0xb388('0x32')][_0xb388('0x58')]()['then'](respondWithResult(_0x56784d,null))[_0xb388('0x49')](handleError(_0x56784d,null));};exports[_0xb388('0x59')]=function(_0x54e9b3,_0x36060d,_0x189697){if(_0x54e9b3[_0xb388('0x50')]['id']){delete _0x54e9b3[_0xb388('0x50')]['id'];}return db[_0xb388('0x32')][_0xb388('0x4e')]({'where':{'id':_0x54e9b3[_0xb388('0x4b')]['id']}})[_0xb388('0x28')](handleEntityNotFound(_0x36060d,null))[_0xb388('0x28')](function(_0x35e9e7){if(_0x35e9e7){_0x54e9b3['body'][_0xb388('0x5a')]=_0x35e9e7['id'];return db[_0xb388('0x5b')][_0xb388('0x4f')](_0x54e9b3[_0xb388('0x50')]);}})[_0xb388('0x28')](respondWithResult(_0x36060d,null))[_0xb388('0x49')](handleError(_0x36060d,null));};exports[_0xb388('0x5c')]=function(_0x5d8754,_0x173eed,_0x1bb4bd){var _0x5a8355={'raw':![],'where':{}};var _0x6860b1={};var _0x63aa17={'count':0x0,'rows':[]};return db[_0xb388('0x32')][_0xb388('0x5d')]({'where':{'id':_0x5d8754[_0xb388('0x4b')]['id']}})[_0xb388('0x28')](handleEntityNotFound(_0x173eed,null))[_0xb388('0x28')](function(_0xd6e899){if(_0xd6e899){_0x6860b1['model']=_[_0xb388('0x38')](db[_0xb388('0x5b')][_0xb388('0x4c')]);_0x6860b1[_0xb388('0x37')]=_['keys'](_0x5d8754[_0xb388('0x37')]);_0x6860b1[_0xb388('0x39')]=_[_0xb388('0x3a')](_0x6860b1[_0xb388('0x36')],_0x6860b1[_0xb388('0x37')]);_0x5a8355[_0xb388('0x3b')]=_[_0xb388('0x3a')](_0x6860b1[_0xb388('0x36')],qs[_0xb388('0x3c')](_0x5d8754['query'][_0xb388('0x3c')]));_0x5a8355[_0xb388('0x3b')]=_0x5a8355['attributes'][_0xb388('0x5e')]?_0x5a8355['attributes']:_0x6860b1[_0xb388('0x36')];if(!_0x5d8754['query'][_0xb388('0x5f')]('nolimit')){_0x5a8355[_0xb388('0x21')]=qs[_0xb388('0x21')](_0x5d8754[_0xb388('0x37')][_0xb388('0x21')]);_0x5a8355[_0xb388('0x3e')]=qs[_0xb388('0x3e')](_0x5d8754[_0xb388('0x37')][_0xb388('0x3e')]);}_0x5a8355[_0xb388('0x60')]=qs['sort'](_0x5d8754['query'][_0xb388('0x3f')]);_0x5a8355[_0xb388('0x40')]=qs[_0xb388('0x39')](_[_0xb388('0x41')](_0x5d8754['query'],_0x6860b1['filters']));_0x5a8355[_0xb388('0x40')][_0xb388('0x5a')]=_0xd6e899['id'];if(_0x5d8754[_0xb388('0x37')][_0xb388('0x44')]){_0x5a8355['where']=_[_0xb388('0x42')](_0x5a8355[_0xb388('0x40')],{'$or':_[_0xb388('0x31')](_0x5a8355['attributes'],function(_0x2be7ce){var _0x1b9247={};_0x1b9247[_0x2be7ce]={'$like':'%'+_0x5d8754[_0xb388('0x37')]['filter']+'%'};return _0x1b9247;})});}_0x5a8355=_['merge']({},_0x5a8355,_0x5d8754['options']);return db[_0xb388('0x5b')][_0xb388('0x22')]({'where':_0x5a8355[_0xb388('0x40')]})[_0xb388('0x28')](function(_0x1ede4f){_0x63aa17[_0xb388('0x22')]=_0x1ede4f;if(_0x5d8754['query'][_0xb388('0x46')]){_0x5a8355[_0xb388('0x4d')]=[{'all':!![]}];}return db['Disposition'][_0xb388('0x47')](_0x5a8355);})[_0xb388('0x28')](function(_0x22381f){_0x63aa17[_0xb388('0x48')]=_0x22381f;return _0x63aa17;});}})[_0xb388('0x28')](respondWithFilteredResult(_0x173eed,_0x5a8355))[_0xb388('0x49')](handleError(_0x173eed,null));};exports[_0xb388('0x61')]=function(_0x2b718c,_0x2cc626,_0x3f24ab){return db[_0xb388('0x32')]['find']({'where':{'id':_0x2b718c['params']['id']}})[_0xb388('0x28')](handleEntityNotFound(_0x2cc626,null))[_0xb388('0x28')](function(_0x56339d){if(_0x56339d){return _0x56339d[_0xb388('0x61')](_0x2b718c[_0xb388('0x37')]['ids']);}})[_0xb388('0x28')](respondWithStatusCode(_0x2cc626,null))['catch'](handleError(_0x2cc626,null));};exports[_0xb388('0x62')]=function(_0x1e1a80,_0x2d0d32,_0x3409f9){return db[_0xb388('0x32')][_0xb388('0x4e')]({'where':{'id':_0x1e1a80[_0xb388('0x4b')]['id']}})[_0xb388('0x28')](handleEntityNotFound(_0x2d0d32,null))[_0xb388('0x28')](function(_0x1739e5){if(_0x1739e5){var _0x467d31=[];var _0x2aae56={'success':[],'errors':[]};return db[_0xb388('0x63')]['describe']()['then'](function(_0x123d89){if(_0x1e1a80['body']['tags']&&_['isArray'](_0x1e1a80[_0xb388('0x50')][_0xb388('0x64')])){if(_0x1e1a80[_0xb388('0x50')][_0xb388('0x64')][_0xb388('0x5e')]){_0x1e1a80[_0xb388('0x50')][_0xb388('0x64')]=_0x1e1a80[_0xb388('0x50')]['tags'][_0xb388('0x65')](';')+';';}else{_0x1e1a80[_0xb388('0x50')][_0xb388('0x64')]=null;}}else{_0x1e1a80[_0xb388('0x50')][_0xb388('0x64')]=null;}if(_0x1e1a80['body']&&_['isArray'](_0x1e1a80['body'])){for(var _0x5146e7=0x0;_0x5146e7<_0x1e1a80[_0xb388('0x50')][_0xb388('0x5e')];_0x5146e7+=0x1){_0x1e1a80[_0xb388('0x50')][_0x5146e7][_0xb388('0x5a')]=_0x1e1a80[_0xb388('0x4b')]['id'];_0x467d31[_0xb388('0x66')](_0x1e1a80[_0xb388('0x50')][_0x5146e7]);}return BPromise[_0xb388('0x67')](_0x467d31,function(_0x29d17e){return db['CmContact'][_0xb388('0x4f')](_[_0xb388('0x68')](_0x29d17e,[_0xb388('0x69'),'id'])||{},{'fields':_[_0xb388('0x38')](_0x123d89),'raw':!![]})['then'](function(_0x3ac511){_0x2aae56['success'][_0xb388('0x66')](_0x3ac511[_0xb388('0x6a')]);})[_0xb388('0x49')](function(_0x33391f){_0x2aae56[_0xb388('0x6b')][_0xb388('0x66')]({'data':_0x29d17e,'error':_0x33391f[_0xb388('0x6c')]});});})[_0xb388('0x28')](function(_0x50980a){return _0x2aae56;})[_0xb388('0x49')](function(_0x421c85){return _0x421c85;});}else{_0x2d0d32[_0xb388('0x1e')](0x190)[_0xb388('0x1f')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xb388('0x28')](respondWithResult(_0x2d0d32,null))[_0xb388('0x49')](handleError(_0x2d0d32,null));};exports[_0xb388('0x6d')]=function(_0x16b4f8,_0x1a745b,_0x1ae0e0){var _0x32ceeb;return db[_0xb388('0x32')][_0xb388('0x4e')]({'where':{'id':_0x16b4f8['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xb388('0x6e')}]})[_0xb388('0x28')](handleEntityNotFound(_0x1a745b,null))[_0xb388('0x28')](function(_0x45fd25){if(_0x45fd25){_0x32ceeb=_0x45fd25;return db[_0xb388('0x63')][_0xb388('0x4c')];}})['then'](function(_0x1ebf79){if(_0x1ebf79){var _0x4537fc={};var _0x550094={};_0x550094[_0xb388('0x36')]=_[_0xb388('0x6f')](_[_0xb388('0x38')](_0x1ebf79),_[_0xb388('0x31')](_0x32ceeb[_0xb388('0x6e')],function(_0x346c76){return util[_0xb388('0x70')](_0xb388('0x71'),_0x346c76['id']);}));_0x550094[_0xb388('0x37')]=_[_0xb388('0x38')](_0x16b4f8[_0xb388('0x37')]);_0x550094[_0xb388('0x39')]=_['intersection'](_0x550094[_0xb388('0x36')],_0x550094[_0xb388('0x37')]);_0x4537fc[_0xb388('0x3b')]=_['intersection'](_0x550094[_0xb388('0x36')],qs[_0xb388('0x3c')](_0x16b4f8[_0xb388('0x37')][_0xb388('0x3c')]));_0x4537fc['attributes']=_0x4537fc[_0xb388('0x3b')][_0xb388('0x5e')]?_0x4537fc[_0xb388('0x3b')]:_0x550094[_0xb388('0x36')];if(!_0x16b4f8[_0xb388('0x37')][_0xb388('0x5f')](_0xb388('0x3d'))){_0x4537fc[_0xb388('0x21')]=qs[_0xb388('0x21')](_0x16b4f8[_0xb388('0x37')]['limit']);_0x4537fc[_0xb388('0x3e')]=qs['offset'](_0x16b4f8['query'][_0xb388('0x3e')]);}_0x4537fc[_0xb388('0x60')]=qs[_0xb388('0x3f')](_0x16b4f8[_0xb388('0x37')][_0xb388('0x3f')]);_0x4537fc[_0xb388('0x40')]=qs[_0xb388('0x39')](_['pick'](_0x16b4f8[_0xb388('0x37')],_0x550094[_0xb388('0x39')]));_0x4537fc[_0xb388('0x72')]=!![];if(_0x16b4f8[_0xb388('0x37')][_0xb388('0x44')]){_0x4537fc[_0xb388('0x40')]=_[_0xb388('0x42')](_0x4537fc['where'],{'$or':_['map'](_0x4537fc[_0xb388('0x3b')],function(_0x1892ef){var _0x4f0082={};_0x4f0082[_0x1892ef]={'$like':'%'+_0x16b4f8[_0xb388('0x37')][_0xb388('0x44')]+'%'};return _0x4f0082;})});}_0x4537fc=_['merge']({},_0x4537fc,_0x16b4f8['options']);return _0x32ceeb['getContacts'](_0x4537fc);}})['then'](respondWithResult(_0x1a745b,null))[_0xb388('0x49')](handleError(_0x1a745b,null));};exports[_0xb388('0x73')]=function(_0x55453b,_0x17b642,_0x386e47){var _0x3a58a8;return db[_0xb388('0x32')]['find']({'where':{'id':_0x55453b['params']['id']},'include':[{'model':db[_0xb388('0x74')],'as':_0xb388('0x6e')}]})[_0xb388('0x28')](handleEntityNotFound(_0x17b642,null))['then'](function(_0x3bda7c){if(_0x3bda7c){_0x3a58a8=_0x3bda7c;return db['CmContact']['rawAttributes'];}})['then'](function(_0x46302a){if(_0x46302a){var _0x14dc88={};var _0x505f0a={};_0x505f0a[_0xb388('0x36')]=_[_0xb388('0x6f')](_[_0xb388('0x38')](_0x46302a),_[_0xb388('0x31')](_0x3a58a8[_0xb388('0x6e')],function(_0x1054f3){return util[_0xb388('0x70')]('cf_%d',_0x1054f3['id']);}));_0x505f0a[_0xb388('0x37')]=_[_0xb388('0x38')](_0x55453b[_0xb388('0x37')]);_0x505f0a[_0xb388('0x39')]=_[_0xb388('0x3a')](_0x505f0a[_0xb388('0x36')],_0x505f0a['query']);_0x14dc88[_0xb388('0x3b')]=_[_0xb388('0x3a')](_0x505f0a[_0xb388('0x36')],qs[_0xb388('0x3c')](_0x55453b[_0xb388('0x37')][_0xb388('0x3c')]));_0x14dc88[_0xb388('0x3b')]=_0x14dc88[_0xb388('0x3b')][_0xb388('0x5e')]?_0x14dc88['attributes']:_0x505f0a['model'];if(!_0x55453b[_0xb388('0x37')]['hasOwnProperty']('nolimit')){_0x14dc88['limit']=qs[_0xb388('0x21')](_0x55453b[_0xb388('0x37')][_0xb388('0x21')]);_0x14dc88[_0xb388('0x3e')]=qs[_0xb388('0x3e')](_0x55453b['query'][_0xb388('0x3e')]);}_0x14dc88[_0xb388('0x60')]=qs[_0xb388('0x3f')](_0x55453b[_0xb388('0x37')][_0xb388('0x3f')]);_0x14dc88[_0xb388('0x40')]=qs[_0xb388('0x39')](_[_0xb388('0x41')](_0x55453b[_0xb388('0x37')],_0x505f0a[_0xb388('0x39')]));_0x14dc88[_0xb388('0x72')]=!![];if(_0x55453b[_0xb388('0x37')][_0xb388('0x44')]){_0x14dc88[_0xb388('0x40')]=_['merge'](_0x14dc88[_0xb388('0x40')],{'$or':_[_0xb388('0x31')](_0x14dc88[_0xb388('0x3b')],function(_0x291821){var _0x491f49={};_0x491f49[_0x291821]={'$like':'%'+_0x55453b[_0xb388('0x37')][_0xb388('0x44')]+'%'};return _0x491f49;})});}_0x14dc88=_[_0xb388('0x42')]({},_0x14dc88,_0x55453b[_0xb388('0x45')]);return _0x3a58a8['getContacts'](_0x14dc88);}})['then'](function(_0x55832f){if(!_[_0xb388('0x75')](_0x55832f)){var _0x20d068=toCsv(_0x55832f);var _0x31f4f0=Date['now']();fs[_0xb388('0x76')](util[_0xb388('0x70')](_0xb388('0x77'),_0x3a58a8['id'],_0x31f4f0),_0x20d068);_0x17b642[_0xb388('0x78')]('Content-disposition','attachment;\x20filename='+util['format'](_0xb388('0x79'),_0x3a58a8['id'],_0x31f4f0));_0x17b642[_0xb388('0x78')](_0xb388('0x7a'),_0xb388('0x7b'));return _0x17b642['download'](util['format'](_0xb388('0x77'),_0x3a58a8['id'],_0x31f4f0));}else{return _0x17b642['sendStatus'](0xcc);}})[_0xb388('0x49')](handleError(_0x17b642,null));};exports[_0xb388('0x7c')]=function(_0x60441f,_0x1e428e,_0x115057){var _0x310a14;delete _0x60441f[_0xb388('0x50')]['id'];return db[_0xb388('0x32')][_0xb388('0x5d')]({'where':{'id':_0x60441f[_0xb388('0x4b')]['id']}})[_0xb388('0x28')](handleEntityNotFound(_0x1e428e,null))['then'](function(_0x1dac63){if(_0x1dac63){return db[_0xb388('0x7d')][_0xb388('0x7e')](function(_0x20ac03){return db['CmCustomField']['create'](_0x60441f[_0xb388('0x50')],{'transaction':_0x20ac03})[_0xb388('0x28')](function(_0x16ef1a){_0x310a14=_0x16ef1a;return _0x1dac63[_0xb388('0x7f')](_0x16ef1a,{'transaction':_0x20ac03});})[_0xb388('0x28')](function(){var _0xd3f997={'type':db['Sequelize'][_0xb388('0x80')],'transaction':_0x20ac03};switch(_0x60441f[_0xb388('0x50')][_0xb388('0x34')]){case _0xb388('0x81'):_0xd3f997[_0xb388('0x34')]=db['Sequelize'][_0xb388('0x80')];break;case _0xb388('0x82'):_0xd3f997[_0xb388('0x34')]=db[_0xb388('0x83')][_0xb388('0x84')];break;case _0xb388('0x85'):_0xd3f997['type']=db[_0xb388('0x83')]['BOOLEAN'];_0xd3f997[_0xb388('0x86')]=![];break;default:}return db['sequelize'][_0xb388('0x87')][_0xb388('0x88')]('cm_contacts',util[_0xb388('0x70')]('cf_%s',_0x310a14['id']),_0xd3f997);})[_0xb388('0x28')](function(){return _0x310a14;});});}})['then'](respondWithResult(_0x1e428e,null))[_0xb388('0x49')](handleError(_0x1e428e,null));};exports['getCustomFields']=function(_0x2a2b82,_0x174bf7,_0x4e37ae){var _0x2c86e3={};var _0x6eecd2={};var _0x5c4de3;var _0x2f9b5f;return db[_0xb388('0x32')][_0xb388('0x5d')]({'where':{'id':_0x2a2b82[_0xb388('0x4b')]['id']}})[_0xb388('0x28')](handleEntityNotFound(_0x174bf7,null))[_0xb388('0x28')](function(_0x14dde3){if(_0x14dde3){_0x5c4de3=_0x14dde3;_0x6eecd2[_0xb388('0x36')]=_[_0xb388('0x38')](db[_0xb388('0x74')]['rawAttributes']);_0x6eecd2['query']=_[_0xb388('0x38')](_0x2a2b82['query']);_0x6eecd2[_0xb388('0x39')]=_[_0xb388('0x3a')](_0x6eecd2[_0xb388('0x36')],_0x6eecd2[_0xb388('0x37')]);_0x2c86e3[_0xb388('0x3b')]=_['intersection'](_0x6eecd2[_0xb388('0x36')],qs['fields'](_0x2a2b82[_0xb388('0x37')]['fields']));_0x2c86e3[_0xb388('0x3b')]=_0x2c86e3[_0xb388('0x3b')][_0xb388('0x5e')]?_0x2c86e3[_0xb388('0x3b')]:_0x6eecd2[_0xb388('0x36')];_0x2c86e3[_0xb388('0x60')]=qs[_0xb388('0x3f')](_0x2a2b82[_0xb388('0x37')][_0xb388('0x3f')]);_0x2c86e3[_0xb388('0x40')]=qs[_0xb388('0x39')](_[_0xb388('0x41')](_0x2a2b82[_0xb388('0x37')],_0x6eecd2[_0xb388('0x39')]));_0x2c86e3[_0xb388('0x40')]=_['merge'](_0x2c86e3[_0xb388('0x40')],{'$or':[{'ListId':_0x14dde3['id']},{'ListId':null}]});if(_0x2a2b82[_0xb388('0x37')]['filter']){_0x2c86e3[_0xb388('0x40')]=_[_0xb388('0x42')](_0x2c86e3['where'],{'$or':_[_0xb388('0x31')](_0x2c86e3[_0xb388('0x3b')],function(_0x7cb7f9){var _0x38e777={};_0x38e777[_0x7cb7f9]={'$like':'%'+_0x2a2b82[_0xb388('0x37')][_0xb388('0x44')]+'%'};return _0x38e777;})});}_0x2c86e3=_[_0xb388('0x42')]({},_0x2c86e3,_0x2a2b82[_0xb388('0x45')]);return db[_0xb388('0x74')][_0xb388('0x89')](_0x2c86e3);}})[_0xb388('0x28')](respondWithResult(_0x174bf7,null))[_0xb388('0x49')](handleError(_0x174bf7,null));};exports[_0xb388('0x8a')]=function(_0x1ad87a,_0x27001d,_0x24b17a){return db['CmList'][_0xb388('0x4e')]({'where':{'id':_0x1ad87a[_0xb388('0x4b')]['id']}})[_0xb388('0x28')](handleEntityNotFound(_0x27001d,null))[_0xb388('0x28')](function(_0x2abfe0){if(_0x2abfe0){return _0x2abfe0[_0xb388('0x8a')](_0x1ad87a['body']['ids'],_[_0xb388('0x68')](_0x1ad87a[_0xb388('0x50')],[_0xb388('0x69'),'id'])||{})[_0xb388('0x8b')](function(_0xa92ac5){for(var _0x3227a2=0x0;_0x3227a2<_0x1ad87a[_0xb388('0x50')]['ids']['length'];_0x3227a2+=0x1){socket[_0xb388('0x8c')](_0xb388('0x8d'),{'UserId':Number(_0x1ad87a[_0xb388('0x50')]['ids'][_0x3227a2]),'CmListId':Number(_0x1ad87a['params']['id'])});}return _0xa92ac5;});}})[_0xb388('0x28')](respondWithResult(_0x27001d,null))[_0xb388('0x49')](handleError(_0x27001d,null));};exports['removeAgents']=function(_0xa13331,_0x523407,_0x242abc){return db[_0xb388('0x32')][_0xb388('0x4e')]({'where':{'id':_0xa13331['params']['id']}})['then'](handleEntityNotFound(_0x523407,null))['then'](function(_0x4fa5cc){if(_0x4fa5cc){return _0x4fa5cc[_0xb388('0x8e')](_0xa13331[_0xb388('0x37')][_0xb388('0x69')])[_0xb388('0x28')](function(){if(_[_0xb388('0x8f')](_0xa13331[_0xb388('0x37')][_0xb388('0x69')])){for(var _0x33c7f8=0x0;_0x33c7f8<_0xa13331[_0xb388('0x37')][_0xb388('0x69')][_0xb388('0x5e')];_0x33c7f8+=0x1){socket[_0xb388('0x8c')](_0xb388('0x90'),{'UserId':Number(_0xa13331[_0xb388('0x37')][_0xb388('0x69')][_0x33c7f8]),'CmListId':Number(_0xa13331[_0xb388('0x4b')]['id'])});}}else{socket[_0xb388('0x8c')](_0xb388('0x90'),{'UserId':Number(_0xa13331['query'][_0xb388('0x69')]),'CmListId':Number(_0xa13331[_0xb388('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x523407,null))[_0xb388('0x49')](handleError(_0x523407,null));};exports[_0xb388('0x91')]=function(_0x3e12fd,_0x38bc9e,_0x35a9a1){var _0x1c35c1={};var _0x443c24={};var _0x526f88;var _0x31f674;return db[_0xb388('0x32')][_0xb388('0x5d')]({'where':{'id':_0x3e12fd[_0xb388('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38bc9e,null))['then'](function(_0x5c8469){if(_0x5c8469){_0x526f88=_0x5c8469;_0x443c24[_0xb388('0x36')]=_[_0xb388('0x38')](db[_0xb388('0x92')][_0xb388('0x4c')]);_0x443c24[_0xb388('0x37')]=_['keys'](_0x3e12fd[_0xb388('0x37')]);_0x443c24[_0xb388('0x39')]=_[_0xb388('0x3a')](_0x443c24['model'],_0x443c24['query']);_0x1c35c1[_0xb388('0x3b')]=_[_0xb388('0x3a')](_0x443c24[_0xb388('0x36')],qs[_0xb388('0x3c')](_0x3e12fd[_0xb388('0x37')][_0xb388('0x3c')]));_0x1c35c1['attributes']=_0x1c35c1[_0xb388('0x3b')][_0xb388('0x5e')]?_0x1c35c1[_0xb388('0x3b')]:_0x443c24[_0xb388('0x36')];_0x1c35c1[_0xb388('0x60')]=qs[_0xb388('0x3f')](_0x3e12fd['query'][_0xb388('0x3f')]);_0x1c35c1[_0xb388('0x40')]=qs[_0xb388('0x39')](_[_0xb388('0x41')](_0x3e12fd['query'],_0x443c24['filters']));if(_0x3e12fd[_0xb388('0x37')][_0xb388('0x44')]){_0x1c35c1[_0xb388('0x40')]=_['merge'](_0x1c35c1[_0xb388('0x40')],{'$or':_[_0xb388('0x31')](_0x1c35c1[_0xb388('0x3b')],function(_0x4323a1){var _0x2a3a68={};_0x2a3a68[_0x4323a1]={'$like':'%'+_0x3e12fd[_0xb388('0x37')][_0xb388('0x44')]+'%'};return _0x2a3a68;})});}_0x1c35c1=_[_0xb388('0x42')]({},_0x1c35c1,_0x3e12fd[_0xb388('0x45')]);return _0x526f88['getAgents'](_0x1c35c1);}})[_0xb388('0x28')](function(_0x54ecc3){if(_0x54ecc3){_0x31f674=_0x54ecc3[_0xb388('0x5e')];if(!_0x3e12fd[_0xb388('0x37')][_0xb388('0x5f')]('nolimit')){_0x1c35c1[_0xb388('0x21')]=qs['limit'](_0x3e12fd['query'][_0xb388('0x21')]);_0x1c35c1[_0xb388('0x3e')]=qs[_0xb388('0x3e')](_0x3e12fd[_0xb388('0x37')][_0xb388('0x3e')]);}return _0x526f88['getAgents'](_0x1c35c1);}})[_0xb388('0x28')](function(_0x3688c8){if(_0x3688c8){return _0x3688c8?{'count':_0x31f674,'rows':_0x3688c8}:null;}})[_0xb388('0x28')](respondWithResult(_0x38bc9e,null))['catch'](handleError(_0x38bc9e,null));};
\ No newline at end of file
index ca91abe..0771ec3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x1a8dc3,_0x395536){var _0x2a9c1e=function(_0x57c309){while(--_0x57c309){_0x1a8dc3['push'](_0x1a8dc3['shift']());}};_0x2a9c1e(++_0x395536);}(_0x814b,0x1a2));var _0xb814=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x814b[_0x5c4e16];return _0x36044a;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents;
\ No newline at end of file
+var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0x5fc3[_0x289e64];return _0x30246c;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
index 5c10ca8..87b0b52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x3b42fd,_0x555175){var _0x7268a4=function(_0x11e746){while(--_0x11e746){_0x3b42fd['push'](_0x3b42fd['shift']());}};_0x7268a4(++_0x555175);}(_0xee5b,0x1f4));var _0xbee5=function(_0x48e4ba,_0x4c7d72){_0x48e4ba=_0x48e4ba-0x0;var _0xefbc4d=_0xee5b[_0x48e4ba];return _0xefbc4d;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f7a=['CmList','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x46ea38,_0xf9fbd0){_0x46ea38=_0x46ea38-0x0;var _0x160a17=_0x6f7a[_0x46ea38];return _0x160a17;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var moment=require('moment');var BPromise=require(_0xa6f7('0x4'));var rp=require(_0xa6f7('0x5'));var fs=require('fs');var path=require(_0xa6f7('0x6'));var rimraf=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var attributes=require(_0xa6f7('0x9'));module[_0xa6f7('0xa')]=function(_0x20cccd,_0x1fdd5f){return _0x20cccd[_0xa6f7('0xb')](_0xa6f7('0xc'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b225349..5d9e6fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc091=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment'];(function(_0x124f92,_0xbe6647){var _0x1f6372=function(_0x516a43){while(--_0x516a43){_0x124f92['push'](_0x124f92['shift']());}};_0x1f6372(++_0xbe6647);}(_0xc091,0x6a));var _0x1c09=function(_0x4da95b,_0x37e0cb){_0x4da95b=_0x4da95b-0x0;var _0x48cf8a=_0xc091[_0x4da95b];return _0x48cf8a;};'use strict';var _=require('lodash');var util=require(_0x1c09('0x0'));var moment=require(_0x1c09('0x1'));var BPromise=require(_0x1c09('0x2'));var rs=require(_0x1c09('0x3'));var fs=require('fs');var Redis=require(_0x1c09('0x4'));var db=require(_0x1c09('0x5'))['db'];var utils=require(_0x1c09('0x6'));var logger=require(_0x1c09('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1c09('0x8'));var client=jayson[_0x1c09('0x9')][_0x1c09('0xa')]({'port':0x232a});config[_0x1c09('0xb')]=_[_0x1c09('0xc')](config[_0x1c09('0xb')],{'host':_0x1c09('0xd'),'port':0x18eb});var socket=require(_0x1c09('0xe'))(new Redis(config['redis']));require(_0x1c09('0xf'))[_0x1c09('0x10')](socket);function respondWithRpcPromise(_0x188857,_0x591383,_0x4728ce){return new BPromise(function(_0x54225c,_0x59d3f3){return client['request'](_0x188857,_0x4728ce)['then'](function(_0x382b70){logger[_0x1c09('0x11')](_0x1c09('0x12'),_0x591383,_0x1c09('0x13'));logger[_0x1c09('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x591383,_0x1c09('0x13'),JSON[_0x1c09('0x15')](_0x382b70));if(_0x382b70[_0x1c09('0x16')]){if(_0x382b70['error'][_0x1c09('0x17')]===0x1f4){logger['error'](_0x1c09('0x12'),_0x591383,_0x382b70['error'][_0x1c09('0x18')]);return _0x59d3f3(_0x382b70[_0x1c09('0x16')][_0x1c09('0x18')]);}logger[_0x1c09('0x16')](_0x1c09('0x12'),_0x591383,_0x382b70['error'][_0x1c09('0x18')]);return _0x54225c(_0x382b70[_0x1c09('0x16')]['message']);}else{logger[_0x1c09('0x11')](_0x1c09('0x12'),_0x591383,_0x1c09('0x13'));_0x54225c(_0x382b70[_0x1c09('0x19')][_0x1c09('0x18')]);}})[_0x1c09('0x1a')](function(_0x34580f){logger['error'](_0x1c09('0x12'),_0x591383,_0x34580f);_0x59d3f3(_0x34580f);});});}
\ No newline at end of file
+var _0x1e26=['socket.io-emitter','./cmList.socket','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x458644,_0x3bacff){var _0x3eab98=function(_0x5c6afd){while(--_0x5c6afd){_0x458644['push'](_0x458644['shift']());}};_0x3eab98(++_0x3bacff);}(_0x1e26,0xdc));var _0x61e2=function(_0x596952,_0x3574fb){_0x596952=_0x596952-0x0;var _0x52c3ae=_0x1e26[_0x596952];return _0x52c3ae;};'use strict';var _=require(_0x61e2('0x0'));var util=require('util');var moment=require(_0x61e2('0x1'));var BPromise=require(_0x61e2('0x2'));var rs=require(_0x61e2('0x3'));var fs=require('fs');var Redis=require(_0x61e2('0x4'));var db=require(_0x61e2('0x5'))['db'];var utils=require(_0x61e2('0x6'));var logger=require(_0x61e2('0x7'))(_0x61e2('0x8'));var config=require(_0x61e2('0x9'));var jayson=require(_0x61e2('0xa'));var client=jayson[_0x61e2('0xb')]['http']({'port':0x232a});config[_0x61e2('0xc')]=_[_0x61e2('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x61e2('0xe'))(new Redis(config[_0x61e2('0xc')]));require(_0x61e2('0xf'))['register'](socket);function respondWithRpcPromise(_0x1e6d94,_0x265a87,_0x320459){return new BPromise(function(_0x2cb07e,_0x311d9a){return client[_0x61e2('0x10')](_0x1e6d94,_0x320459)['then'](function(_0x107cc9){logger[_0x61e2('0x11')](_0x61e2('0x12'),_0x265a87,_0x61e2('0x13'));logger[_0x61e2('0x14')](_0x61e2('0x15'),_0x265a87,'request\x20sent',JSON['stringify'](_0x107cc9));if(_0x107cc9[_0x61e2('0x16')]){if(_0x107cc9[_0x61e2('0x16')]['code']===0x1f4){logger['error'](_0x61e2('0x12'),_0x265a87,_0x107cc9[_0x61e2('0x16')][_0x61e2('0x17')]);return _0x311d9a(_0x107cc9['error'][_0x61e2('0x17')]);}logger[_0x61e2('0x16')](_0x61e2('0x12'),_0x265a87,_0x107cc9[_0x61e2('0x16')][_0x61e2('0x17')]);return _0x2cb07e(_0x107cc9[_0x61e2('0x16')][_0x61e2('0x17')]);}else{logger[_0x61e2('0x11')](_0x61e2('0x12'),_0x265a87,'request\x20sent');_0x2cb07e(_0x107cc9[_0x61e2('0x18')][_0x61e2('0x17')]);}})[_0x61e2('0x19')](function(_0x31db83){logger['error'](_0x61e2('0x12'),_0x265a87,_0x31db83);_0x311d9a(_0x31db83);});});}
\ No newline at end of file
index b6e983d..d6be478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe777=['cmList:','./cmList.events','save','remove','update','emit','register'];(function(_0x10c2d3,_0x2f5914){var _0x5a0b13=function(_0x412864){while(--_0x412864){_0x10c2d3['push'](_0x10c2d3['shift']());}};_0x5a0b13(++_0x2f5914);}(_0xe777,0x1ac));var _0x7e77=function(_0x142597,_0x41456c){_0x142597=_0x142597-0x0;var _0x4c4400=_0xe777[_0x142597];return _0x4c4400;};'use strict';var CmListEvents=require(_0x7e77('0x0'));var events=[_0x7e77('0x1'),_0x7e77('0x2'),_0x7e77('0x3')];function createListener(_0x1efa85,_0x10ca31){return function(_0x477fd3){_0x10ca31[_0x7e77('0x4')](_0x1efa85,_0x477fd3);};}function removeListener(_0x5e57cd,_0x1581cd){return function(){CmListEvents['removeListener'](_0x5e57cd,_0x1581cd);};}exports[_0x7e77('0x5')]=function(_0x13219a){for(var _0x847276=0x0,_0x5ad9a0=events['length'];_0x847276<_0x5ad9a0;_0x847276++){var _0x28fd2e=events[_0x847276];var _0x174ad6=createListener(_0x7e77('0x6')+_0x28fd2e,_0x13219a);CmListEvents['on'](_0x28fd2e,_0x174ad6);}};
\ No newline at end of file
+var _0xdd13=['cmList:','./cmList.events','save','remove','emit','removeListener','register','length'];(function(_0x4a354b,_0x3256e5){var _0x5b28e3=function(_0x23c6db){while(--_0x23c6db){_0x4a354b['push'](_0x4a354b['shift']());}};_0x5b28e3(++_0x3256e5);}(_0xdd13,0x81));var _0x3dd1=function(_0x4c475e,_0x290441){_0x4c475e=_0x4c475e-0x0;var _0x26afcd=_0xdd13[_0x4c475e];return _0x26afcd;};'use strict';var CmListEvents=require(_0x3dd1('0x0'));var events=[_0x3dd1('0x1'),_0x3dd1('0x2'),'update'];function createListener(_0x1fa9b7,_0x3cab56){return function(_0x19348e){_0x3cab56[_0x3dd1('0x3')](_0x1fa9b7,_0x19348e);};}function removeListener(_0x27c5e7,_0x43f083){return function(){CmListEvents[_0x3dd1('0x4')](_0x27c5e7,_0x43f083);};}exports[_0x3dd1('0x5')]=function(_0xcf0e44){for(var _0x183617=0x0,_0x3eddea=events[_0x3dd1('0x6')];_0x183617<_0x3eddea;_0x183617++){var _0x2a43a0=events[_0x183617];var _0x50624c=createListener(_0x3dd1('0x7')+_0x2a43a0,_0xcf0e44);CmListEvents['on'](_0x2a43a0,_0x50624c);}};
\ No newline at end of file
index fc439dd..a7756c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddcb=['/:id/dispositions','getDispositions','getContacts','getContactsCsv','getCustomFields','post','addDisposition','/:id/contacts','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x5b381b,_0x567d93){var _0x1d3426=function(_0x3dfed9){while(--_0x3dfed9){_0x5b381b['push'](_0x5b381b['shift']());}};_0x1d3426(++_0x567d93);}(_0xddcb,0xd3));var _0xbddc=function(_0x5484cf,_0x153f52){_0x5484cf=_0x5484cf-0x0;var _0x5b7de7=_0xddcb[_0x5484cf];return _0x5b7de7;};'use strict';var multer=require('multer');var util=require(_0xbddc('0x0'));var path=require(_0xbddc('0x1'));var timeout=require(_0xbddc('0x2'));var express=require('express');var router=express[_0xbddc('0x3')]();var fs_extra=require(_0xbddc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbddc('0x5'));var config=require(_0xbddc('0x6'));var controller=require(_0xbddc('0x7'));router[_0xbddc('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xbddc('0x9')](),controller[_0xbddc('0xa')]);router[_0xbddc('0x8')](_0xbddc('0xb'),auth['isAuthenticated'](),controller[_0xbddc('0xc')]);router[_0xbddc('0x8')](_0xbddc('0xd'),auth[_0xbddc('0x9')](),controller[_0xbddc('0xe')]);router[_0xbddc('0x8')]('/:id/contacts',auth[_0xbddc('0x9')](),controller[_0xbddc('0xf')]);router[_0xbddc('0x8')]('/:id/contacts/csv',auth[_0xbddc('0x9')](),controller[_0xbddc('0x10')]);router[_0xbddc('0x8')]('/:id/fields',auth[_0xbddc('0x9')](),controller[_0xbddc('0x11')]);router[_0xbddc('0x8')]('/:id/users',auth[_0xbddc('0x9')](),controller['getAgents']);router[_0xbddc('0x12')]('/',auth[_0xbddc('0x9')](),controller['create']);router[_0xbddc('0x12')](_0xbddc('0xd'),auth[_0xbddc('0x9')](),controller[_0xbddc('0x13')]);router[_0xbddc('0x12')](_0xbddc('0x14'),auth[_0xbddc('0x9')](),controller[_0xbddc('0x15')]);router['post'](_0xbddc('0x16'),auth['isAuthenticated'](),controller[_0xbddc('0x17')]);router[_0xbddc('0x12')](_0xbddc('0x18'),auth[_0xbddc('0x9')](),controller[_0xbddc('0x19')]);router['put'](_0xbddc('0xb'),auth[_0xbddc('0x9')](),controller[_0xbddc('0x1a')]);router[_0xbddc('0x1b')](_0xbddc('0xb'),auth[_0xbddc('0x9')](),controller[_0xbddc('0x1c')]);router[_0xbddc('0x1b')](_0xbddc('0xd'),auth[_0xbddc('0x9')](),controller[_0xbddc('0x1d')]);router[_0xbddc('0x1b')](_0xbddc('0x18'),auth[_0xbddc('0x9')](),controller[_0xbddc('0x1e')]);module[_0xbddc('0x1f')]=router;
\ No newline at end of file
+var _0x3617=['/:id/users','removeAgents','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getAgents','post','create','addDisposition','addContacts','put','update','removeDispositions'];(function(_0x55949d,_0x1b90b3){var _0x532e99=function(_0x2f20b4){while(--_0x2f20b4){_0x55949d['push'](_0x55949d['shift']());}};_0x532e99(++_0x1b90b3);}(_0x3617,0x139));var _0x7361=function(_0xb955ef,_0x19fd0d){_0xb955ef=_0xb955ef-0x0;var _0x595d52=_0x3617[_0xb955ef];return _0x595d52;};'use strict';var multer=require(_0x7361('0x0'));var util=require(_0x7361('0x1'));var path=require('path');var timeout=require(_0x7361('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7361('0x3'));var auth=require(_0x7361('0x4'));var interaction=require(_0x7361('0x5'));var config=require(_0x7361('0x6'));var controller=require(_0x7361('0x7'));router[_0x7361('0x8')]('/',auth[_0x7361('0x9')](),controller['index']);router[_0x7361('0x8')](_0x7361('0xa'),auth[_0x7361('0x9')](),controller[_0x7361('0xb')]);router[_0x7361('0x8')](_0x7361('0xc'),auth[_0x7361('0x9')](),controller[_0x7361('0xd')]);router[_0x7361('0x8')](_0x7361('0xe'),auth[_0x7361('0x9')](),controller[_0x7361('0xf')]);router[_0x7361('0x8')](_0x7361('0x10'),auth[_0x7361('0x9')](),controller[_0x7361('0x11')]);router['get']('/:id/contacts/csv',auth[_0x7361('0x9')](),controller[_0x7361('0x12')]);router['get'](_0x7361('0x13'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x7361('0x8')]('/:id/users',auth[_0x7361('0x9')](),controller[_0x7361('0x14')]);router[_0x7361('0x15')]('/',auth['isAuthenticated'](),controller[_0x7361('0x16')]);router['post'](_0x7361('0xe'),auth[_0x7361('0x9')](),controller[_0x7361('0x17')]);router[_0x7361('0x15')](_0x7361('0x10'),auth[_0x7361('0x9')](),controller[_0x7361('0x18')]);router[_0x7361('0x15')]('/:id/fields',auth['isAuthenticated'](),controller['addCustomField']);router[_0x7361('0x15')]('/:id/users',auth[_0x7361('0x9')](),controller['addAgents']);router[_0x7361('0x19')](_0x7361('0xc'),auth[_0x7361('0x9')](),controller[_0x7361('0x1a')]);router['delete'](_0x7361('0xc'),auth[_0x7361('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x7361('0x9')](),controller[_0x7361('0x1b')]);router['delete'](_0x7361('0x1c'),auth[_0x7361('0x9')](),controller[_0x7361('0x1d')]);module[_0x7361('0x1e')]=router;
\ No newline at end of file
index e32a6ab..7e219c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8999=['getDataValue','field','STRING','exports','VIRTUAL'];(function(_0x312e53,_0x369a90){var _0x292b3c=function(_0x7f499a){while(--_0x7f499a){_0x312e53['push'](_0x312e53['shift']());}};_0x292b3c(++_0x369a90);}(_0x8999,0x11b));var _0x9899=function(_0x2df2eb,_0x3959a0){_0x2df2eb=_0x2df2eb-0x0;var _0xa5abb9=_0x8999[_0x2df2eb];return _0xa5abb9;};'use strict';var Sequelize=require('sequelize');module[_0x9899('0x0')]={'name':{'type':Sequelize[_0x9899('0x1')],'get':function(_0x4e87c1){return this[_0x9899('0x2')](_0x9899('0x3'));}},'field':{'type':Sequelize[_0x9899('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x9899('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x9899('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0x4121=['STRING','exports','VIRTUAL','getDataValue'];(function(_0x3b7fb0,_0x553e21){var _0x3b7fc5=function(_0x286bdc){while(--_0x286bdc){_0x3b7fb0['push'](_0x3b7fb0['shift']());}};_0x3b7fc5(++_0x553e21);}(_0x4121,0x191));var _0x1412=function(_0x5120d8,_0x27a7a9){_0x5120d8=_0x5120d8-0x0;var _0x7f7a8c=_0x4121[_0x5120d8];return _0x7f7a8c;};'use strict';var Sequelize=require('sequelize');module[_0x1412('0x0')]={'name':{'type':Sequelize[_0x1412('0x1')],'get':function(_0x43e8d2){return this[_0x1412('0x2')]('field');}},'field':{'type':Sequelize[_0x1412('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x1412('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 45447eb..df50a5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['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','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x26dfb5,_0x9e8aaf){var _0x5cd6c9=function(_0x46f806){while(--_0x46f806){_0x26dfb5['push'](_0x26dfb5['shift']());}};_0x5cd6c9(++_0x9e8aaf);}(_0x7a54,0x106));var _0x47a5=function(_0x325cbd,_0x2abb1c){_0x325cbd=_0x325cbd-0x0;var _0x5cb730=_0x7a54[_0x325cbd];return _0x5cb730;};'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('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x7a54=['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','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x26bb4b,_0x273acf){var _0x3aaf29=function(_0x3e9948){while(--_0x3e9948){_0x26bb4b['push'](_0x26bb4b['shift']());}};_0x3aaf29(++_0x273acf);}(_0x7a54,0x106));var _0x47a5=function(_0x570254,_0x249ecc){_0x570254=_0x570254-0x0;var _0x4bf55d=_0x7a54[_0x570254];return _0x4bf55d;};'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('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
index 7f97f59..12c84be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58b5=['api','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x25f8e8,_0x519d8e){var _0x1df02c=function(_0x1bee7b){while(--_0x1bee7b){_0x25f8e8['push'](_0x25f8e8['shift']());}};_0x1df02c(++_0x519d8e);}(_0x58b5,0x1a1));var _0x558b=function(_0x42121d,_0x1c31ab){_0x42121d=_0x42121d-0x0;var _0x2d6fde=_0x58b5[_0x42121d];return _0x2d6fde;};'use strict';var _=require(_0x558b('0x0'));var util=require(_0x558b('0x1'));var logger=require(_0x558b('0x2'))(_0x558b('0x3'));var moment=require('moment');var BPromise=require(_0x558b('0x4'));var rp=require(_0x558b('0x5'));var fs=require('fs');var path=require(_0x558b('0x6'));var rimraf=require(_0x558b('0x7'));var config=require(_0x558b('0x8'));var attributes=require(_0x558b('0x9'));module['exports']=function(_0x190b33,_0x5e681f){return _0x190b33['define'](_0x558b('0xa'),attributes,{'tableName':_0x558b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x89e5=['request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','tools_conditions','lodash','util','api','moment','bluebird'];(function(_0x37d6eb,_0x166b0a){var _0x1dd4d8=function(_0x113dd4){while(--_0x113dd4){_0x37d6eb['push'](_0x37d6eb['shift']());}};_0x1dd4d8(++_0x166b0a);}(_0x89e5,0x119));var _0x589e=function(_0x524da7,_0x15bdbd){_0x524da7=_0x524da7-0x0;var _0x154014=_0x89e5[_0x524da7];return _0x154014;};'use strict';var _=require(_0x589e('0x0'));var util=require(_0x589e('0x1'));var logger=require('../../config/logger')(_0x589e('0x2'));var moment=require(_0x589e('0x3'));var BPromise=require(_0x589e('0x4'));var rp=require(_0x589e('0x5'));var fs=require('fs');var path=require(_0x589e('0x6'));var rimraf=require(_0x589e('0x7'));var config=require(_0x589e('0x8'));var attributes=require(_0x589e('0x9'));module[_0x589e('0xa')]=function(_0x2eaafe,_0x41fd4e){return _0x2eaafe[_0x589e('0xb')]('Condition',attributes,{'tableName':_0x589e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1acb745..782643b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x908c=['then','info','Condition,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x908c,0x154));var _0xc908=function(_0x32b4d4,_0x27dbde){_0x32b4d4=_0x32b4d4-0x0;var _0xec1b39=_0x908c[_0x32b4d4];return _0xec1b39;};'use strict';var _=require(_0xc908('0x0'));var util=require(_0xc908('0x1'));var moment=require(_0xc908('0x2'));var BPromise=require(_0xc908('0x3'));var rs=require(_0xc908('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc908('0x5'))['db'];var utils=require(_0xc908('0x6'));var logger=require('../../config/logger')(_0xc908('0x7'));var config=require(_0xc908('0x8'));var jayson=require(_0xc908('0x9'));var client=jayson[_0xc908('0xa')][_0xc908('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x117010,_0x31aeea,_0x3d9fe3){return new BPromise(function(_0x247230,_0x22e4e0){return client['request'](_0x117010,_0x3d9fe3)[_0xc908('0xc')](function(_0x372903){logger[_0xc908('0xd')](_0xc908('0xe'),_0x31aeea,'request\x20sent');logger[_0xc908('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x31aeea,'request\x20sent',JSON[_0xc908('0x10')](_0x372903));if(_0x372903[_0xc908('0x11')]){if(_0x372903[_0xc908('0x11')][_0xc908('0x12')]===0x1f4){logger['error'](_0xc908('0xe'),_0x31aeea,_0x372903[_0xc908('0x11')][_0xc908('0x13')]);return _0x22e4e0(_0x372903['error'][_0xc908('0x13')]);}logger['error']('Condition,\x20%s,\x20%s',_0x31aeea,_0x372903[_0xc908('0x11')]['message']);return _0x247230(_0x372903[_0xc908('0x11')][_0xc908('0x13')]);}else{logger[_0xc908('0xd')](_0xc908('0xe'),_0x31aeea,'request\x20sent');_0x247230(_0x372903[_0xc908('0x14')]['message']);}})[_0xc908('0x15')](function(_0x31ae10){logger[_0xc908('0x11')](_0xc908('0xe'),_0x31aeea,_0x31ae10);_0x22e4e0(_0x31ae10);});});}
\ No newline at end of file
+var _0x5c0a=['message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x57f7d7,_0x41443c){var _0x11b297=function(_0x2783ce){while(--_0x2783ce){_0x57f7d7['push'](_0x57f7d7['shift']());}};_0x11b297(++_0x41443c);}(_0x5c0a,0x142));var _0xa5c0=function(_0xc37c8,_0x182df1){_0xc37c8=_0xc37c8-0x0;var _0x77188f=_0x5c0a[_0xc37c8];return _0x77188f;};'use strict';var _=require(_0xa5c0('0x0'));var util=require(_0xa5c0('0x1'));var moment=require(_0xa5c0('0x2'));var BPromise=require(_0xa5c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5c0('0x5'));var logger=require(_0xa5c0('0x6'))('rpc');var config=require(_0xa5c0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa5c0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dd5d9,_0x13d81e,_0x4e95dc){return new BPromise(function(_0x3651d4,_0xafc35d){return client[_0xa5c0('0x9')](_0x2dd5d9,_0x4e95dc)[_0xa5c0('0xa')](function(_0x14f9b1){logger[_0xa5c0('0xb')](_0xa5c0('0xc'),_0x13d81e,'request\x20sent');logger[_0xa5c0('0xd')](_0xa5c0('0xe'),_0x13d81e,_0xa5c0('0xf'),JSON[_0xa5c0('0x10')](_0x14f9b1));if(_0x14f9b1['error']){if(_0x14f9b1[_0xa5c0('0x11')]['code']===0x1f4){logger[_0xa5c0('0x11')](_0xa5c0('0xc'),_0x13d81e,_0x14f9b1[_0xa5c0('0x11')][_0xa5c0('0x12')]);return _0xafc35d(_0x14f9b1[_0xa5c0('0x11')][_0xa5c0('0x12')]);}logger['error'](_0xa5c0('0xc'),_0x13d81e,_0x14f9b1[_0xa5c0('0x11')][_0xa5c0('0x12')]);return _0x3651d4(_0x14f9b1['error'][_0xa5c0('0x12')]);}else{logger[_0xa5c0('0xb')]('Condition,\x20%s,\x20%s',_0x13d81e,_0xa5c0('0xf'));_0x3651d4(_0x14f9b1[_0xa5c0('0x13')]['message']);}})['catch'](function(_0x544426){logger[_0xa5c0('0x11')](_0xa5c0('0xc'),_0x13d81e,_0x544426);_0xafc35d(_0x544426);});});}
\ No newline at end of file
index c93b217..5e4d923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49fb=['../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x63af34,_0x597d36){var _0x134e2d=function(_0x43f62d){while(--_0x43f62d){_0x63af34['push'](_0x63af34['shift']());}};_0x134e2d(++_0x597d36);}(_0x49fb,0x78));var _0xb49f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x49fb[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xb49f('0x0'));var util=require(_0xb49f('0x1'));var path=require(_0xb49f('0x2'));var timeout=require(_0xb49f('0x3'));var express=require('express');var router=express[_0xb49f('0x4')]();var fs_extra=require(_0xb49f('0x5'));var auth=require(_0xb49f('0x6'));var interaction=require(_0xb49f('0x7'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xb49f('0x8')](_0xb49f('0x9'),auth[_0xb49f('0xa')](),controller[_0xb49f('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb49f('0xc')]);module[_0xb49f('0xd')]=router;
\ No newline at end of file
+var _0x386f=['delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','isAuthenticated','update'];(function(_0x3389ab,_0x2e27da){var _0x1be72f=function(_0x11f1b4){while(--_0x11f1b4){_0x3389ab['push'](_0x3389ab['shift']());}};_0x1be72f(++_0x2e27da);}(_0x386f,0xb8));var _0xf386=function(_0xf22e2d,_0x20e8fc){_0xf22e2d=_0xf22e2d-0x0;var _0x298f2c=_0x386f[_0xf22e2d];return _0x298f2c;};'use strict';var multer=require(_0xf386('0x0'));var util=require(_0xf386('0x1'));var path=require(_0xf386('0x2'));var timeout=require('connect-timeout');var express=require(_0xf386('0x3'));var router=express[_0xf386('0x4')]();var fs_extra=require(_0xf386('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf386('0x6'));var config=require(_0xf386('0x7'));var controller=require(_0xf386('0x8'));router['put']('/:id',auth[_0xf386('0x9')](),controller[_0xf386('0xa')]);router[_0xf386('0xb')](_0xf386('0xc'),auth[_0xf386('0x9')](),controller[_0xf386('0xd')]);module[_0xf386('0xe')]=router;
\ No newline at end of file
index c753f45..e254796 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['STRING','name'];(function(_0xeb7136,_0x3a86f4){var _0x143d0e=function(_0x52be6a){while(--_0x52be6a){_0xeb7136['push'](_0xeb7136['shift']());}};_0x143d0e(++_0x3a86f4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
+var _0xb7e7=['STRING','sequelize'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb7e7[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}};
\ No newline at end of file
index 775c5cc..0a32f0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a28=['DashboardItem','pick','rimraf','fast-json-patch','request-promise','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','destroy','get','CustomDashboards','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','length','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','total','attrSerie2','attrSerie3','attrEmailAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x5a28,0x179));var _0x85a2=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0x5a28[_0xcd5a3d];return _0xd43207;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x85a2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85a2('0x1'));var rp=require(_0x85a2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x85a2('0x3'));var path=require('path');var sox=require(_0x85a2('0x4'));var csv=require('to-csv');var ejs=require(_0x85a2('0x5'));var fs=require('fs');var fs_extra=require(_0x85a2('0x6'));var _=require(_0x85a2('0x7'));var squel=require(_0x85a2('0x8'));var crypto=require(_0x85a2('0x9'));var jsforce=require(_0x85a2('0xa'));var deskjs=require(_0x85a2('0xb'));var toCsv=require('to-csv');var querystring=require(_0x85a2('0xc'));var Papa=require('papaparse');var Redis=require(_0x85a2('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x85a2('0xe'));var hardwareService=require(_0x85a2('0xf'));var logger=require(_0x85a2('0x10'))(_0x85a2('0x11'));var utils=require('../../config/utils');var config=require(_0x85a2('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x85a2('0x13'))['db'];config[_0x85a2('0x14')]=_[_0x85a2('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x85a2('0x16'))(new Redis(config[_0x85a2('0x14')]));require(_0x85a2('0x17'))[_0x85a2('0x18')](socket);function respondWithStatusCode(_0x1773d7,_0x16e803){_0x16e803=_0x16e803||0xcc;return function(_0x3ae1f2){if(_0x3ae1f2){return _0x1773d7[_0x85a2('0x19')](_0x16e803);}return _0x1773d7[_0x85a2('0x1a')](_0x16e803)[_0x85a2('0x1b')]();};}function respondWithResult(_0x4b8c9b,_0x467dc9){_0x467dc9=_0x467dc9||0xc8;return function(_0x2df518){if(_0x2df518){return _0x4b8c9b[_0x85a2('0x1a')](_0x467dc9)[_0x85a2('0x1c')](_0x2df518);}};}function respondWithFilteredResult(_0x19303d,_0x23c1f3){return function(_0x2046e7){if(_0x2046e7){var _0x2c2084=typeof _0x23c1f3[_0x85a2('0x1d')]===_0x85a2('0x1e')&&typeof _0x23c1f3['limit']==='undefined';var _0x6182b7=_0x2046e7[_0x85a2('0x1f')];var _0x41b0af=_0x2c2084?0x0:_0x23c1f3[_0x85a2('0x1d')];var _0x49d29f=_0x2c2084?_0x2046e7[_0x85a2('0x1f')]:_0x23c1f3[_0x85a2('0x1d')]+_0x23c1f3[_0x85a2('0x20')];var _0x1924d0;if(_0x49d29f>=_0x6182b7){_0x49d29f=_0x6182b7;_0x1924d0=0xc8;}else{_0x1924d0=0xce;}_0x19303d[_0x85a2('0x1a')](_0x1924d0);return _0x19303d[_0x85a2('0x21')]('Content-Range',_0x41b0af+'-'+_0x49d29f+'/'+_0x6182b7)['json'](_0x2046e7);}return null;};}function patchUpdates(_0x452cbf){return function(_0x1f6456){try{jsonpatch[_0x85a2('0x22')](_0x1f6456,_0x452cbf,!![]);}catch(_0x1a5f5d){return BPromise['reject'](_0x1a5f5d);}return _0x1f6456['save']();};}function saveUpdates(_0x160ee4,_0x1ded23){return function(_0x31d305){if(_0x31d305){return _0x31d305[_0x85a2('0x23')](_0x160ee4)[_0x85a2('0x24')](function(_0x2737fd){return _0x2737fd;});}return null;};}function removeEntity(_0x2bac3f,_0x427069){return function(_0x511dc1){if(_0x511dc1){return _0x511dc1[_0x85a2('0x25')]()[_0x85a2('0x24')](function(){var _0x39da9a=_0x511dc1[_0x85a2('0x26')]({'plain':!![]});var _0x3c226a=_0x85a2('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c226a,'resourceId':_0x39da9a['id']}})[_0x85a2('0x24')](function(){return _0x511dc1;});})[_0x85a2('0x24')](function(){_0x2bac3f[_0x85a2('0x1a')](0xcc)[_0x85a2('0x1b')]();});}};}function handleEntityNotFound(_0x2b3f44,_0x208a39){return function(_0x57face){if(!_0x57face){_0x2b3f44[_0x85a2('0x19')](0x194);}return _0x57face;};}function handleError(_0x50b5ab,_0x46c889){_0x46c889=_0x46c889||0x1f4;return function(_0x18e99a){logger['error'](_0x18e99a[_0x85a2('0x28')]);if(_0x18e99a['name']){delete _0x18e99a[_0x85a2('0x29')];}_0x50b5ab[_0x85a2('0x1a')](_0x46c889)[_0x85a2('0x2a')](_0x18e99a);};}exports[_0x85a2('0x2b')]=function(_0x193ae7,_0x588ea1){var _0x59a375={},_0xef390={},_0x3513ed={'count':0x0,'rows':[]};var _0x55dd8c=_[_0x85a2('0x2c')](db['Dashboard'][_0x85a2('0x2d')],function(_0x2de36b){return{'name':_0x2de36b[_0x85a2('0x2e')],'type':_0x2de36b[_0x85a2('0x2f')]['key']};});_0xef390[_0x85a2('0x30')]=_['map'](_0x55dd8c,'name');_0xef390[_0x85a2('0x31')]=_[_0x85a2('0x32')](_0x193ae7['query']);_0xef390[_0x85a2('0x33')]=_[_0x85a2('0x34')](_0xef390[_0x85a2('0x30')],_0xef390[_0x85a2('0x31')]);_0x59a375[_0x85a2('0x35')]=_['intersection'](_0xef390[_0x85a2('0x30')],qs[_0x85a2('0x36')](_0x193ae7['query'][_0x85a2('0x36')]));_0x59a375[_0x85a2('0x35')]=_0x59a375[_0x85a2('0x35')]['length']?_0x59a375[_0x85a2('0x35')]:_0xef390[_0x85a2('0x30')];if(!_0x193ae7[_0x85a2('0x31')][_0x85a2('0x37')](_0x85a2('0x38'))){_0x59a375[_0x85a2('0x20')]=qs[_0x85a2('0x20')](_0x193ae7[_0x85a2('0x31')][_0x85a2('0x20')]);_0x59a375[_0x85a2('0x1d')]=qs['offset'](_0x193ae7[_0x85a2('0x31')][_0x85a2('0x1d')]);}_0x59a375[_0x85a2('0x39')]=qs[_0x85a2('0x3a')](_0x193ae7['query']['sort']);_0x59a375[_0x85a2('0x3b')]=qs[_0x85a2('0x33')](_['pick'](_0x193ae7['query'],_0xef390[_0x85a2('0x33')]),_0x55dd8c);if(_0x193ae7[_0x85a2('0x31')][_0x85a2('0x3c')]){_0x59a375[_0x85a2('0x3b')]=_[_0x85a2('0x3d')](_0x59a375[_0x85a2('0x3b')],{'$or':_[_0x85a2('0x2c')](_0x55dd8c,function(_0x212d94){if(_0x212d94[_0x85a2('0x2f')]!==_0x85a2('0x3e')){var _0x5d9f69={};_0x5d9f69[_0x212d94[_0x85a2('0x29')]]={'$like':'%'+_0x193ae7[_0x85a2('0x31')][_0x85a2('0x3c')]+'%'};return _0x5d9f69;}})});}_0x59a375=_[_0x85a2('0x3d')]({},_0x59a375,_0x193ae7[_0x85a2('0x3f')]);var _0x4405ce={'where':_0x59a375[_0x85a2('0x3b')]};return db[_0x85a2('0x40')]['count'](_0x4405ce)['then'](function(_0x5c86da){_0x3513ed[_0x85a2('0x1f')]=_0x5c86da;if(_0x193ae7[_0x85a2('0x31')][_0x85a2('0x41')]){_0x59a375[_0x85a2('0x42')]=[{'all':!![]}];}return db[_0x85a2('0x40')][_0x85a2('0x43')](_0x59a375);})[_0x85a2('0x24')](function(_0x2d0e5f){_0x3513ed[_0x85a2('0x44')]=_0x2d0e5f;return _0x3513ed;})[_0x85a2('0x24')](respondWithFilteredResult(_0x588ea1,_0x59a375))[_0x85a2('0x45')](handleError(_0x588ea1,null));};exports[_0x85a2('0x46')]=function(_0x1e4a8b,_0x56790d){var _0x3e3a79={'raw':![],'where':{'id':_0x1e4a8b['params']['id']}},_0x84ebd8={};_0x84ebd8[_0x85a2('0x30')]=_[_0x85a2('0x32')](db[_0x85a2('0x40')]['rawAttributes']);_0x84ebd8[_0x85a2('0x31')]=_[_0x85a2('0x32')](_0x1e4a8b[_0x85a2('0x31')]);_0x84ebd8[_0x85a2('0x33')]=_[_0x85a2('0x34')](_0x84ebd8[_0x85a2('0x30')],_0x84ebd8[_0x85a2('0x31')]);_0x3e3a79[_0x85a2('0x35')]=_['intersection'](_0x84ebd8['model'],qs[_0x85a2('0x36')](_0x1e4a8b[_0x85a2('0x31')][_0x85a2('0x36')]));_0x3e3a79[_0x85a2('0x35')]=_0x3e3a79[_0x85a2('0x35')]['length']?_0x3e3a79['attributes']:_0x84ebd8[_0x85a2('0x30')];if(_0x1e4a8b[_0x85a2('0x31')]['includeAll']){_0x3e3a79[_0x85a2('0x42')]=[{'all':!![]}];}_0x3e3a79=_[_0x85a2('0x3d')]({},_0x3e3a79,_0x1e4a8b[_0x85a2('0x3f')]);return db[_0x85a2('0x40')][_0x85a2('0x47')](_0x3e3a79)['then'](handleEntityNotFound(_0x56790d,null))['then'](respondWithResult(_0x56790d,null))[_0x85a2('0x45')](handleError(_0x56790d,null));};exports[_0x85a2('0x48')]=function(_0x3ae491,_0x3dfd4a){return db['Dashboard'][_0x85a2('0x48')](_0x3ae491[_0x85a2('0x49')],{})[_0x85a2('0x24')](function(_0x45bec2){var _0x555834=_0x3ae491[_0x85a2('0x4a')][_0x85a2('0x26')]({'plain':!![]});if(!_0x555834)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x555834[_0x85a2('0x4b')]==='user'){var _0x416e05=_0x45bec2['get']({'plain':!![]});var _0x23f22d=_0x85a2('0x27');return db[_0x85a2('0x4c')][_0x85a2('0x47')]({'where':{'name':_0x23f22d,'userProfileId':_0x555834[_0x85a2('0x4d')]},'raw':!![]})['then'](function(_0xe74f95){if(_0xe74f95&&_0xe74f95['autoAssociation']===0x0){return db[_0x85a2('0x4e')][_0x85a2('0x48')]({'name':_0x416e05[_0x85a2('0x29')],'resourceId':_0x416e05['id'],'type':_0xe74f95[_0x85a2('0x29')],'sectionId':_0xe74f95['id']},{})[_0x85a2('0x24')](function(){return _0x45bec2;});}else{return _0x45bec2;}})['catch'](function(_0x28a531){logger[_0x85a2('0x4f')](_0x85a2('0x50'),_0x28a531);throw _0x28a531;});}return _0x45bec2;})[_0x85a2('0x24')](respondWithResult(_0x3dfd4a,0xc9))[_0x85a2('0x45')](handleError(_0x3dfd4a,null));};exports[_0x85a2('0x51')]=function(_0x39c9dd,_0x7851e2){var _0x4f31e2={'where':{'id':_0x39c9dd[_0x85a2('0x52')]['id']}},_0x544eae={};_0x544eae[_0x85a2('0x30')]=_[_0x85a2('0x32')](db[_0x85a2('0x40')][_0x85a2('0x2d')]);_0x4f31e2[_0x85a2('0x35')]=_[_0x85a2('0x34')](_0x544eae[_0x85a2('0x30')],qs[_0x85a2('0x36')](_0x39c9dd['query'][_0x85a2('0x36')]));_0x4f31e2[_0x85a2('0x35')]=_0x4f31e2[_0x85a2('0x35')][_0x85a2('0x53')]?_0x4f31e2[_0x85a2('0x35')]:_0x544eae[_0x85a2('0x30')];if(_0x39c9dd['query'][_0x85a2('0x41')]){_0x4f31e2['include']=[{'all':!![]}];}_0x4f31e2=_[_0x85a2('0x3d')]({},_0x4f31e2,_0x39c9dd[_0x85a2('0x3f')]);return db[_0x85a2('0x40')][_0x85a2('0x47')](_0x4f31e2)['then'](handleEntityNotFound(_0x7851e2,null))['then'](function(_0x11e91d){if(_0x11e91d){var _0xeb9ec2=_0x11e91d[_0x85a2('0x26')]({'plain':!![]});_0xeb9ec2=qs['omit'](_0xeb9ec2,['id',_0x85a2('0x54'),_0x85a2('0x55')]);_0x39c9dd['body']=_['omit'](_0x39c9dd[_0x85a2('0x49')],['id',_0x85a2('0x54'),_0x85a2('0x55')]);return db[_0x85a2('0x40')][_0x85a2('0x48')](_[_0x85a2('0x3d')](_0xeb9ec2,_0x39c9dd[_0x85a2('0x49')]),{'include':_0x39c9dd['query'][_0x85a2('0x41')]?[{'all':!![]}]:undefined})[_0x85a2('0x24')](function(_0x54b5a8){var _0x4d4ded=_0x39c9dd[_0x85a2('0x4a')]['get']({'plain':!![]});if(!_0x4d4ded)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d4ded[_0x85a2('0x4b')]===_0x85a2('0x4a')){var _0x2d2de0=_0x54b5a8[_0x85a2('0x26')]({'plain':!![]});var _0x5afe08=_0x85a2('0x27');return db[_0x85a2('0x4c')]['find']({'where':{'name':_0x5afe08,'userProfileId':_0x4d4ded[_0x85a2('0x4d')]},'raw':!![]})[_0x85a2('0x24')](function(_0x4e67eb){if(_0x4e67eb&&_0x4e67eb['autoAssociation']===0x0){return db[_0x85a2('0x4e')]['create']({'name':_0x2d2de0[_0x85a2('0x29')],'resourceId':_0x2d2de0['id'],'type':_0x4e67eb[_0x85a2('0x29')],'sectionId':_0x4e67eb['id']},{})[_0x85a2('0x24')](function(){return _0x54b5a8;});}else{return _0x54b5a8;}})[_0x85a2('0x45')](function(_0x5d96c2){logger[_0x85a2('0x4f')](_0x85a2('0x50'),_0x5d96c2);throw _0x5d96c2;});}return _0x54b5a8;});}})[_0x85a2('0x24')](respondWithResult(_0x7851e2,0xc9))[_0x85a2('0x45')](handleError(_0x7851e2,null));};exports['update']=function(_0x826a73,_0x55dd1f){if(_0x826a73[_0x85a2('0x49')]['id']){delete _0x826a73[_0x85a2('0x49')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x826a73[_0x85a2('0x52')]['id']}})['then'](handleEntityNotFound(_0x55dd1f,null))[_0x85a2('0x24')](saveUpdates(_0x826a73[_0x85a2('0x49')],null))['then'](respondWithResult(_0x55dd1f,null))[_0x85a2('0x45')](handleError(_0x55dd1f,null));};exports[_0x85a2('0x25')]=function(_0x38d4cf,_0x486394){return db[_0x85a2('0x40')][_0x85a2('0x47')]({'where':{'id':_0x38d4cf[_0x85a2('0x52')]['id']}})['then'](handleEntityNotFound(_0x486394,null))[_0x85a2('0x24')](removeEntity(_0x486394,null))[_0x85a2('0x45')](handleError(_0x486394,null));};function widgetAttributes(_0x9c1f5d){try{switch(_0x9c1f5d[_0x85a2('0x2f')]){case _0x85a2('0x56'):return[{'name':'attrUrl','value':_0x9c1f5d[_0x85a2('0x57')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x0]?_0x9c1f5d[_0x85a2('0x58')][0x0][_0x85a2('0x59')]:undefined)||_0x85a2('0x5a')}];case'custom':return[{'name':_0x85a2('0x5b'),'value':_0x9c1f5d[_0x85a2('0x5b')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x0]?_0x9c1f5d[_0x85a2('0x58')][0x0][_0x85a2('0x59')]:undefined)||''}];case _0x85a2('0x5c'):return[{'name':_0x85a2('0x5d'),'value':_0x9c1f5d['attrHourFormat']||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x0]?_0x9c1f5d[_0x85a2('0x58')][0x0][_0x85a2('0x59')]:undefined)||_0x85a2('0x5e')},{'name':_0x85a2('0x5f'),'value':_0x9c1f5d['attrTimezone']||(_0x9c1f5d['attrs']&&_0x9c1f5d[_0x85a2('0x58')][0x1]?_0x9c1f5d[_0x85a2('0x58')][0x1]['value']:undefined)||_0x85a2('0x60')},{'name':_0x85a2('0x61'),'value':_0x9c1f5d['attrFontSize']||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x2]?_0x9c1f5d[_0x85a2('0x58')][0x2]['value']:undefined)||0xc}];case _0x85a2('0x62'):return[{'name':_0x85a2('0x63'),'value':_0x9c1f5d[_0x85a2('0x63')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x0]?_0x9c1f5d[_0x85a2('0x58')][0x0][_0x85a2('0x59')]:undefined)||'total'},{'name':_0x85a2('0x64'),'value':_0x9c1f5d[_0x85a2('0x64')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x1]?_0x9c1f5d['attrs'][0x1][_0x85a2('0x59')]:undefined)||[]},{'name':_0x85a2('0x61'),'value':_0x9c1f5d[_0x85a2('0x61')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x2]?_0x9c1f5d[_0x85a2('0x58')][0x2][_0x85a2('0x59')]:undefined)||0x14},{'name':_0x85a2('0x65'),'value':_0x9c1f5d[_0x85a2('0x65')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x3]?_0x9c1f5d['attrs'][0x3][_0x85a2('0x59')]:undefined)||_0x85a2('0x66')},{'name':'attrEmailAccounts','value':_0x9c1f5d['attrEmailAccounts']||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x4]?_0x9c1f5d['attrs'][0x4]['value']:undefined)||''},{'name':_0x85a2('0x67'),'value':_0x9c1f5d['attrFaxAccounts']||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x5]?_0x9c1f5d[_0x85a2('0x58')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x9c1f5d[_0x85a2('0x68')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x6]?_0x9c1f5d[_0x85a2('0x58')][0x6][_0x85a2('0x59')]:undefined)||''},{'name':_0x85a2('0x69'),'value':_0x9c1f5d[_0x85a2('0x69')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x7]?_0x9c1f5d[_0x85a2('0x58')][0x7][_0x85a2('0x59')]:undefined)||''},{'name':_0x85a2('0x6a'),'value':_0x9c1f5d[_0x85a2('0x6a')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x8]?_0x9c1f5d[_0x85a2('0x58')][0x8][_0x85a2('0x59')]:undefined)||''},{'name':_0x85a2('0x6b'),'value':_0x9c1f5d[_0x85a2('0x6b')]||(_0x9c1f5d['attrs']&&_0x9c1f5d[_0x85a2('0x58')][0x9]?_0x9c1f5d[_0x85a2('0x58')][0x9][_0x85a2('0x59')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x85a2('0x6c'),'value':_0x9c1f5d[_0x85a2('0x6c')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x0]?_0x9c1f5d[_0x85a2('0x58')][0x0]['value']:undefined)||_0x85a2('0x6d')},{'name':_0x85a2('0x6e'),'value':_0x9c1f5d[_0x85a2('0x6e')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x1]?_0x9c1f5d[_0x85a2('0x58')][0x1][_0x85a2('0x59')]:undefined)||null},{'name':'attrSerie3','value':_0x9c1f5d[_0x85a2('0x6f')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x2]?_0x9c1f5d['attrs'][0x2][_0x85a2('0x59')]:undefined)||null},{'name':_0x85a2('0x64'),'value':_0x9c1f5d[_0x85a2('0x64')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x3]?_0x9c1f5d[_0x85a2('0x58')][0x3]['value']:undefined)||[]},{'name':_0x85a2('0x65'),'value':_0x9c1f5d[_0x85a2('0x65')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x4]?_0x9c1f5d[_0x85a2('0x58')][0x4]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x9c1f5d[_0x85a2('0x70')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x5]?_0x9c1f5d[_0x85a2('0x58')][0x5][_0x85a2('0x59')]:undefined)||''},{'name':_0x85a2('0x67'),'value':_0x9c1f5d[_0x85a2('0x67')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x6]?_0x9c1f5d[_0x85a2('0x58')][0x6][_0x85a2('0x59')]:undefined)||''},{'name':_0x85a2('0x68'),'value':_0x9c1f5d[_0x85a2('0x68')]||(_0x9c1f5d['attrs']&&_0x9c1f5d['attrs'][0x7]?_0x9c1f5d[_0x85a2('0x58')][0x7][_0x85a2('0x59')]:undefined)||''},{'name':_0x85a2('0x69'),'value':_0x9c1f5d[_0x85a2('0x69')]||(_0x9c1f5d['attrs']&&_0x9c1f5d['attrs'][0x8]?_0x9c1f5d['attrs'][0x8]['value']:undefined)||''},{'name':_0x85a2('0x6a'),'value':_0x9c1f5d[_0x85a2('0x6a')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x9]?_0x9c1f5d[_0x85a2('0x58')][0x9][_0x85a2('0x59')]:undefined)||''},{'name':'attrChatWebsites','value':_0x9c1f5d['attrChatWebsites']||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0xa]?_0x9c1f5d[_0x85a2('0x58')][0xa][_0x85a2('0x59')]:undefined)||''}];case _0x85a2('0x71'):return[{'name':_0x85a2('0x72'),'type':_0x9c1f5d[_0x85a2('0x73')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d['attrs'][0x0]?_0x9c1f5d['attrs'][0x0][_0x85a2('0x2f')]:undefined)||null,'value':_0x9c1f5d['attrReport']||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x0]?_0x9c1f5d[_0x85a2('0x58')][0x0][_0x85a2('0x59')]:undefined)||null},{'name':'attrRefresh','value':_0x9c1f5d[_0x85a2('0x74')]||(_0x9c1f5d[_0x85a2('0x58')]&&_0x9c1f5d[_0x85a2('0x58')][0x1]?_0x9c1f5d['attrs'][0x1][_0x85a2('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x221ef4){logger[_0x85a2('0x4f')](_0x85a2('0x75'),JSON[_0x85a2('0x76')](_0x221ef4));return[];}}exports[_0x85a2('0x77')]=function(_0x3b2a8d,_0x508238,_0x5ad1cc){if(_0x3b2a8d[_0x85a2('0x49')]['id']){delete _0x3b2a8d[_0x85a2('0x49')]['id'];}return db[_0x85a2('0x40')][_0x85a2('0x47')]({'where':{'id':_0x3b2a8d[_0x85a2('0x52')]['id']}})['then'](handleEntityNotFound(_0x508238,null))[_0x85a2('0x24')](function(_0x419ab7){if(_0x419ab7){_0x3b2a8d['body'][_0x85a2('0x78')]=_0x419ab7['id'];_0x3b2a8d[_0x85a2('0x49')][_0x85a2('0x58')]=widgetAttributes(_0x3b2a8d[_0x85a2('0x49')]);return db['DashboardItem'][_0x85a2('0x48')](_0x3b2a8d[_0x85a2('0x49')]);}})[_0x85a2('0x24')](respondWithResult(_0x508238,null))[_0x85a2('0x45')](handleError(_0x508238,null));};exports[_0x85a2('0x79')]=function(_0x5126cb,_0x24c20c,_0x1632d7){var _0x2520f8={};var _0x172562={};var _0x4d87ad;var _0x5ce68d;return db[_0x85a2('0x40')][_0x85a2('0x7a')]({'where':{'id':_0x5126cb[_0x85a2('0x52')]['id']}})[_0x85a2('0x24')](handleEntityNotFound(_0x24c20c,null))[_0x85a2('0x24')](function(_0x3cfa34){if(_0x3cfa34){_0x4d87ad=_0x3cfa34;_0x172562[_0x85a2('0x30')]=_[_0x85a2('0x32')](db[_0x85a2('0x7b')][_0x85a2('0x2d')]);_0x172562[_0x85a2('0x31')]=_[_0x85a2('0x32')](_0x5126cb[_0x85a2('0x31')]);_0x172562['filters']=_[_0x85a2('0x34')](_0x172562[_0x85a2('0x30')],_0x172562['query']);_0x2520f8['attributes']=_['intersection'](_0x172562[_0x85a2('0x30')],qs[_0x85a2('0x36')](_0x5126cb[_0x85a2('0x31')][_0x85a2('0x36')]));_0x2520f8['attributes']=_0x2520f8[_0x85a2('0x35')][_0x85a2('0x53')]?_0x2520f8[_0x85a2('0x35')]:_0x172562[_0x85a2('0x30')];_0x2520f8[_0x85a2('0x39')]=qs[_0x85a2('0x3a')](_0x5126cb['query'][_0x85a2('0x3a')]);_0x2520f8['where']=qs['filters'](_[_0x85a2('0x7c')](_0x5126cb['query'],_0x172562['filters']));if(_0x5126cb['query'][_0x85a2('0x3c')]){_0x2520f8[_0x85a2('0x3b')]=_['merge'](_0x2520f8[_0x85a2('0x3b')],{'$or':_[_0x85a2('0x2c')](_0x2520f8[_0x85a2('0x35')],function(_0x28604b){var _0x148b70={};_0x148b70[_0x28604b]={'$like':'%'+_0x5126cb[_0x85a2('0x31')][_0x85a2('0x3c')]+'%'};return _0x148b70;})});}_0x2520f8=_[_0x85a2('0x3d')]({},_0x2520f8,_0x5126cb[_0x85a2('0x3f')]);return _0x4d87ad[_0x85a2('0x79')](_0x2520f8);}})['then'](function(_0x4659fa){if(_0x4659fa){_0x5ce68d=_0x4659fa[_0x85a2('0x53')];if(!_0x5126cb[_0x85a2('0x31')][_0x85a2('0x37')]('nolimit')){_0x2520f8['limit']=qs[_0x85a2('0x20')](_0x5126cb['query'][_0x85a2('0x20')]);_0x2520f8[_0x85a2('0x1d')]=qs[_0x85a2('0x1d')](_0x5126cb[_0x85a2('0x31')][_0x85a2('0x1d')]);}return _0x4d87ad[_0x85a2('0x79')](_0x2520f8);}})[_0x85a2('0x24')](function(_0x6fe5fa){if(_0x6fe5fa){return _0x6fe5fa?{'count':_0x5ce68d,'rows':_0x6fe5fa}:null;}})['then'](respondWithResult(_0x24c20c,null))[_0x85a2('0x45')](handleError(_0x24c20c,null));};
\ No newline at end of file
+var _0x62c6=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','get','CustomDashboards','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','keys','filters','intersection','model','attributes','fields','length','query','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','Dashboard','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','DashboardItem','getItems','pick','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x4dd42b,_0x3adbfc){var _0x258e9b=function(_0x275d28){while(--_0x275d28){_0x4dd42b['push'](_0x4dd42b['shift']());}};_0x258e9b(++_0x3adbfc);}(_0x62c6,0x7b));var _0x662c=function(_0x3f5a19,_0xba068e){_0x3f5a19=_0x3f5a19-0x0;var _0x6b51a0=_0x62c6[_0x3f5a19];return _0x6b51a0;};'use strict';var emlformat=require(_0x662c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x662c('0x1'));var jsonpatch=require(_0x662c('0x2'));var rp=require(_0x662c('0x3'));var moment=require(_0x662c('0x4'));var BPromise=require(_0x662c('0x5'));var Mustache=require('mustache');var util=require(_0x662c('0x6'));var path=require(_0x662c('0x7'));var sox=require(_0x662c('0x8'));var csv=require(_0x662c('0x9'));var ejs=require(_0x662c('0xa'));var fs=require('fs');var fs_extra=require(_0x662c('0xb'));var _=require(_0x662c('0xc'));var squel=require(_0x662c('0xd'));var crypto=require(_0x662c('0xe'));var jsforce=require(_0x662c('0xf'));var deskjs=require(_0x662c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x662c('0x11'));var Redis=require('ioredis');var authService=require(_0x662c('0x12'));var qs=require(_0x662c('0x13'));var as=require(_0x662c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x662c('0x15'));var utils=require(_0x662c('0x16'));var config=require(_0x662c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x662c('0x18'))['db'];config[_0x662c('0x19')]=_[_0x662c('0x1a')](config[_0x662c('0x19')],{'host':_0x662c('0x1b'),'port':0x18eb});var socket=require(_0x662c('0x1c'))(new Redis(config[_0x662c('0x19')]));require(_0x662c('0x1d'))[_0x662c('0x1e')](socket);function respondWithStatusCode(_0x3f0f6d,_0x477bcc){_0x477bcc=_0x477bcc||0xcc;return function(_0x44e9c7){if(_0x44e9c7){return _0x3f0f6d['sendStatus'](_0x477bcc);}return _0x3f0f6d['status'](_0x477bcc)[_0x662c('0x1f')]();};}function respondWithResult(_0x2604b6,_0xc5b015){_0xc5b015=_0xc5b015||0xc8;return function(_0x5b7f7e){if(_0x5b7f7e){return _0x2604b6['status'](_0xc5b015)[_0x662c('0x20')](_0x5b7f7e);}};}function respondWithFilteredResult(_0x3e6bdc,_0x55bae3){return function(_0x20fd85){if(_0x20fd85){var _0x4120b3=typeof _0x55bae3[_0x662c('0x21')]===_0x662c('0x22')&&typeof _0x55bae3[_0x662c('0x23')]==='undefined';var _0x34209b=_0x20fd85[_0x662c('0x24')];var _0xf0df5=_0x4120b3?0x0:_0x55bae3[_0x662c('0x21')];var _0x2d805c=_0x4120b3?_0x20fd85[_0x662c('0x24')]:_0x55bae3['offset']+_0x55bae3[_0x662c('0x23')];var _0x2751e3;if(_0x2d805c>=_0x34209b){_0x2d805c=_0x34209b;_0x2751e3=0xc8;}else{_0x2751e3=0xce;}_0x3e6bdc[_0x662c('0x25')](_0x2751e3);return _0x3e6bdc[_0x662c('0x26')](_0x662c('0x27'),_0xf0df5+'-'+_0x2d805c+'/'+_0x34209b)[_0x662c('0x20')](_0x20fd85);}return null;};}function patchUpdates(_0x298edc){return function(_0x3b0ef0){try{jsonpatch[_0x662c('0x28')](_0x3b0ef0,_0x298edc,!![]);}catch(_0xc72b9a){return BPromise[_0x662c('0x29')](_0xc72b9a);}return _0x3b0ef0['save']();};}function saveUpdates(_0x42b462,_0x1c0abd){return function(_0x5a37a3){if(_0x5a37a3){return _0x5a37a3[_0x662c('0x2a')](_0x42b462)[_0x662c('0x2b')](function(_0x3e5269){return _0x3e5269;});}return null;};}function removeEntity(_0xd00c55,_0x630da4){return function(_0x47726a){if(_0x47726a){return _0x47726a['destroy']()['then'](function(){var _0x32b45b=_0x47726a[_0x662c('0x2c')]({'plain':!![]});var _0x8234f0=_0x662c('0x2d');return db[_0x662c('0x2e')][_0x662c('0x2f')]({'where':{'type':_0x8234f0,'resourceId':_0x32b45b['id']}})['then'](function(){return _0x47726a;});})[_0x662c('0x2b')](function(){_0xd00c55[_0x662c('0x25')](0xcc)[_0x662c('0x1f')]();});}};}function handleEntityNotFound(_0xf35401,_0x3fc9e4){return function(_0x4d3969){if(!_0x4d3969){_0xf35401[_0x662c('0x30')](0x194);}return _0x4d3969;};}function handleError(_0x6f2a72,_0x293468){_0x293468=_0x293468||0x1f4;return function(_0x3e4c08){logger[_0x662c('0x31')](_0x3e4c08[_0x662c('0x32')]);if(_0x3e4c08[_0x662c('0x33')]){delete _0x3e4c08[_0x662c('0x33')];}_0x6f2a72[_0x662c('0x25')](_0x293468)[_0x662c('0x34')](_0x3e4c08);};}exports[_0x662c('0x35')]=function(_0x510001,_0x1f3ab8){var _0x573872={},_0x37ea50={},_0x1e4e76={'count':0x0,'rows':[]};var _0x492716=_[_0x662c('0x36')](db['Dashboard'][_0x662c('0x37')],function(_0x337687){return{'name':_0x337687[_0x662c('0x38')],'type':_0x337687['type']['key']};});_0x37ea50['model']=_[_0x662c('0x36')](_0x492716,_0x662c('0x33'));_0x37ea50['query']=_[_0x662c('0x39')](_0x510001['query']);_0x37ea50[_0x662c('0x3a')]=_[_0x662c('0x3b')](_0x37ea50[_0x662c('0x3c')],_0x37ea50['query']);_0x573872[_0x662c('0x3d')]=_['intersection'](_0x37ea50['model'],qs[_0x662c('0x3e')](_0x510001['query'][_0x662c('0x3e')]));_0x573872[_0x662c('0x3d')]=_0x573872['attributes'][_0x662c('0x3f')]?_0x573872['attributes']:_0x37ea50[_0x662c('0x3c')];if(!_0x510001[_0x662c('0x40')][_0x662c('0x41')]('nolimit')){_0x573872['limit']=qs['limit'](_0x510001['query'][_0x662c('0x23')]);_0x573872[_0x662c('0x21')]=qs[_0x662c('0x21')](_0x510001[_0x662c('0x40')][_0x662c('0x21')]);}_0x573872[_0x662c('0x42')]=qs[_0x662c('0x43')](_0x510001[_0x662c('0x40')][_0x662c('0x43')]);_0x573872[_0x662c('0x44')]=qs[_0x662c('0x3a')](_['pick'](_0x510001[_0x662c('0x40')],_0x37ea50[_0x662c('0x3a')]),_0x492716);if(_0x510001[_0x662c('0x40')][_0x662c('0x45')]){_0x573872[_0x662c('0x44')]=_[_0x662c('0x46')](_0x573872[_0x662c('0x44')],{'$or':_['map'](_0x492716,function(_0x4247a){if(_0x4247a[_0x662c('0x47')]!==_0x662c('0x48')){var _0xefbeee={};_0xefbeee[_0x4247a['name']]={'$like':'%'+_0x510001[_0x662c('0x40')][_0x662c('0x45')]+'%'};return _0xefbeee;}})});}_0x573872=_['merge']({},_0x573872,_0x510001[_0x662c('0x49')]);var _0x3f76d3={'where':_0x573872[_0x662c('0x44')]};return db[_0x662c('0x4a')][_0x662c('0x24')](_0x3f76d3)['then'](function(_0x40689d){_0x1e4e76[_0x662c('0x24')]=_0x40689d;if(_0x510001[_0x662c('0x40')][_0x662c('0x4b')]){_0x573872[_0x662c('0x4c')]=[{'all':!![]}];}return db[_0x662c('0x4a')]['findAll'](_0x573872);})[_0x662c('0x2b')](function(_0x33d961){_0x1e4e76[_0x662c('0x4d')]=_0x33d961;return _0x1e4e76;})[_0x662c('0x2b')](respondWithFilteredResult(_0x1f3ab8,_0x573872))[_0x662c('0x4e')](handleError(_0x1f3ab8,null));};exports[_0x662c('0x4f')]=function(_0x1fd631,_0x4bc879){var _0x3c8d40={'raw':![],'where':{'id':_0x1fd631['params']['id']}},_0x4ea15d={};_0x4ea15d[_0x662c('0x3c')]=_[_0x662c('0x39')](db[_0x662c('0x4a')][_0x662c('0x37')]);_0x4ea15d[_0x662c('0x40')]=_[_0x662c('0x39')](_0x1fd631[_0x662c('0x40')]);_0x4ea15d[_0x662c('0x3a')]=_['intersection'](_0x4ea15d['model'],_0x4ea15d[_0x662c('0x40')]);_0x3c8d40[_0x662c('0x3d')]=_[_0x662c('0x3b')](_0x4ea15d['model'],qs[_0x662c('0x3e')](_0x1fd631['query'][_0x662c('0x3e')]));_0x3c8d40['attributes']=_0x3c8d40[_0x662c('0x3d')]['length']?_0x3c8d40[_0x662c('0x3d')]:_0x4ea15d[_0x662c('0x3c')];if(_0x1fd631['query'][_0x662c('0x4b')]){_0x3c8d40[_0x662c('0x4c')]=[{'all':!![]}];}_0x3c8d40=_['merge']({},_0x3c8d40,_0x1fd631[_0x662c('0x49')]);return db[_0x662c('0x4a')][_0x662c('0x50')](_0x3c8d40)[_0x662c('0x2b')](handleEntityNotFound(_0x4bc879,null))[_0x662c('0x2b')](respondWithResult(_0x4bc879,null))[_0x662c('0x4e')](handleError(_0x4bc879,null));};exports['create']=function(_0x5ca42e,_0x50e3ef){return db['Dashboard'][_0x662c('0x51')](_0x5ca42e[_0x662c('0x52')],{})['then'](function(_0xb5e9be){var _0x15caa5=_0x5ca42e[_0x662c('0x53')]['get']({'plain':!![]});if(!_0x15caa5)throw new Error(_0x662c('0x54'));if(_0x15caa5['role']===_0x662c('0x53')){var _0x2e8536=_0xb5e9be[_0x662c('0x2c')]({'plain':!![]});var _0x1d9e50='CustomDashboards';return db[_0x662c('0x55')][_0x662c('0x50')]({'where':{'name':_0x1d9e50,'userProfileId':_0x15caa5[_0x662c('0x56')]},'raw':!![]})[_0x662c('0x2b')](function(_0x5cf7c1){if(_0x5cf7c1&&_0x5cf7c1[_0x662c('0x57')]===0x0){return db[_0x662c('0x2e')]['create']({'name':_0x2e8536[_0x662c('0x33')],'resourceId':_0x2e8536['id'],'type':_0x5cf7c1[_0x662c('0x33')],'sectionId':_0x5cf7c1['id']},{})[_0x662c('0x2b')](function(){return _0xb5e9be;});}else{return _0xb5e9be;}})['catch'](function(_0x533687){logger['error'](_0x662c('0x58'),_0x533687);throw _0x533687;});}return _0xb5e9be;})['then'](respondWithResult(_0x50e3ef,0xc9))[_0x662c('0x4e')](handleError(_0x50e3ef,null));};exports[_0x662c('0x59')]=function(_0x1140f5,_0x1957bb){var _0x537d4e={'where':{'id':_0x1140f5[_0x662c('0x5a')]['id']}},_0x434058={};_0x434058[_0x662c('0x3c')]=_[_0x662c('0x39')](db[_0x662c('0x4a')][_0x662c('0x37')]);_0x537d4e['attributes']=_[_0x662c('0x3b')](_0x434058[_0x662c('0x3c')],qs[_0x662c('0x3e')](_0x1140f5[_0x662c('0x40')][_0x662c('0x3e')]));_0x537d4e['attributes']=_0x537d4e[_0x662c('0x3d')][_0x662c('0x3f')]?_0x537d4e[_0x662c('0x3d')]:_0x434058[_0x662c('0x3c')];if(_0x1140f5[_0x662c('0x40')]['includeAll']){_0x537d4e[_0x662c('0x4c')]=[{'all':!![]}];}_0x537d4e=_[_0x662c('0x46')]({},_0x537d4e,_0x1140f5['options']);return db[_0x662c('0x4a')][_0x662c('0x50')](_0x537d4e)[_0x662c('0x2b')](handleEntityNotFound(_0x1957bb,null))['then'](function(_0x5f2254){if(_0x5f2254){var _0x245c3d=_0x5f2254[_0x662c('0x2c')]({'plain':!![]});_0x245c3d=qs[_0x662c('0x5b')](_0x245c3d,['id','createdAt','updatedAt']);_0x1140f5[_0x662c('0x52')]=_['omit'](_0x1140f5[_0x662c('0x52')],['id',_0x662c('0x5c'),_0x662c('0x5d')]);return db['Dashboard'][_0x662c('0x51')](_[_0x662c('0x46')](_0x245c3d,_0x1140f5[_0x662c('0x52')]),{'include':_0x1140f5[_0x662c('0x40')]['includeAll']?[{'all':!![]}]:undefined})[_0x662c('0x2b')](function(_0x1080b9){var _0x48dd5d=_0x1140f5[_0x662c('0x53')][_0x662c('0x2c')]({'plain':!![]});if(!_0x48dd5d)throw new Error(_0x662c('0x54'));if(_0x48dd5d[_0x662c('0x5e')]==='user'){var _0x5d3980=_0x1080b9[_0x662c('0x2c')]({'plain':!![]});var _0x895607=_0x662c('0x2d');return db['UserProfileSection'][_0x662c('0x50')]({'where':{'name':_0x895607,'userProfileId':_0x48dd5d[_0x662c('0x56')]},'raw':!![]})['then'](function(_0x414078){if(_0x414078&&_0x414078[_0x662c('0x57')]===0x0){return db[_0x662c('0x2e')]['create']({'name':_0x5d3980[_0x662c('0x33')],'resourceId':_0x5d3980['id'],'type':_0x414078['name'],'sectionId':_0x414078['id']},{})[_0x662c('0x2b')](function(){return _0x1080b9;});}else{return _0x1080b9;}})[_0x662c('0x4e')](function(_0x26bba5){logger[_0x662c('0x31')](_0x662c('0x58'),_0x26bba5);throw _0x26bba5;});}return _0x1080b9;});}})['then'](respondWithResult(_0x1957bb,0xc9))['catch'](handleError(_0x1957bb,null));};exports[_0x662c('0x2a')]=function(_0x29ca64,_0x270dfc){if(_0x29ca64[_0x662c('0x52')]['id']){delete _0x29ca64['body']['id'];}return db[_0x662c('0x4a')][_0x662c('0x50')]({'where':{'id':_0x29ca64[_0x662c('0x5a')]['id']}})[_0x662c('0x2b')](handleEntityNotFound(_0x270dfc,null))[_0x662c('0x2b')](saveUpdates(_0x29ca64[_0x662c('0x52')],null))['then'](respondWithResult(_0x270dfc,null))['catch'](handleError(_0x270dfc,null));};exports['destroy']=function(_0x290442,_0x5e62e3){return db['Dashboard']['find']({'where':{'id':_0x290442[_0x662c('0x5a')]['id']}})[_0x662c('0x2b')](handleEntityNotFound(_0x5e62e3,null))[_0x662c('0x2b')](removeEntity(_0x5e62e3,null))['catch'](handleError(_0x5e62e3,null));};function widgetAttributes(_0x462bbc){try{switch(_0x462bbc[_0x662c('0x47')]){case _0x662c('0x5f'):return[{'name':_0x662c('0x60'),'value':_0x462bbc[_0x662c('0x60')]||(_0x462bbc['attrs']&&_0x462bbc[_0x662c('0x61')][0x0]?_0x462bbc[_0x662c('0x61')][0x0][_0x662c('0x62')]:undefined)||'https://'}];case _0x662c('0x63'):return[{'name':_0x662c('0x64'),'value':_0x462bbc[_0x662c('0x64')]||(_0x462bbc['attrs']&&_0x462bbc[_0x662c('0x61')][0x0]?_0x462bbc['attrs'][0x0][_0x662c('0x62')]:undefined)||''}];case _0x662c('0x65'):return[{'name':_0x662c('0x66'),'value':_0x462bbc[_0x662c('0x66')]||(_0x462bbc['attrs']&&_0x462bbc[_0x662c('0x61')][0x0]?_0x462bbc[_0x662c('0x61')][0x0][_0x662c('0x62')]:undefined)||'HH:mm:ss'},{'name':_0x662c('0x67'),'value':_0x462bbc['attrTimezone']||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x1]?_0x462bbc[_0x662c('0x61')][0x1]['value']:undefined)||'0.00'},{'name':_0x662c('0x68'),'value':_0x462bbc['attrFontSize']||(_0x462bbc['attrs']&&_0x462bbc[_0x662c('0x61')][0x2]?_0x462bbc[_0x662c('0x61')][0x2][_0x662c('0x62')]:undefined)||0xc}];case _0x662c('0x69'):return[{'name':_0x662c('0x6a'),'value':_0x462bbc['attrMetric']||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x0]?_0x462bbc[_0x662c('0x61')][0x0][_0x662c('0x62')]:undefined)||'total'},{'name':_0x662c('0x6b'),'value':_0x462bbc[_0x662c('0x6b')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x1]?_0x462bbc['attrs'][0x1]['value']:undefined)||[]},{'name':_0x662c('0x68'),'value':_0x462bbc[_0x662c('0x68')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x2]?_0x462bbc[_0x662c('0x61')][0x2][_0x662c('0x62')]:undefined)||0x14},{'name':_0x662c('0x6c'),'value':_0x462bbc[_0x662c('0x6c')]||(_0x462bbc['attrs']&&_0x462bbc[_0x662c('0x61')][0x3]?_0x462bbc['attrs'][0x3]['value']:undefined)||'voice'},{'name':_0x662c('0x6d'),'value':_0x462bbc['attrEmailAccounts']||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x4]?_0x462bbc['attrs'][0x4][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x6e'),'value':_0x462bbc[_0x662c('0x6e')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x5]?_0x462bbc[_0x662c('0x61')][0x5][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x6f'),'value':_0x462bbc['attrSmsAccounts']||(_0x462bbc['attrs']&&_0x462bbc['attrs'][0x6]?_0x462bbc[_0x662c('0x61')][0x6][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x70'),'value':_0x462bbc[_0x662c('0x70')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x7]?_0x462bbc[_0x662c('0x61')][0x7][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x71'),'value':_0x462bbc['attrWhatsappAccounts']||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc['attrs'][0x8]?_0x462bbc[_0x662c('0x61')][0x8][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x72'),'value':_0x462bbc[_0x662c('0x72')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x9]?_0x462bbc[_0x662c('0x61')][0x9][_0x662c('0x62')]:undefined)||''}];case _0x662c('0x73'):case _0x662c('0x74'):return[{'name':_0x662c('0x75'),'value':_0x462bbc[_0x662c('0x75')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x0]?_0x462bbc['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x662c('0x76'),'value':_0x462bbc[_0x662c('0x76')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x1]?_0x462bbc[_0x662c('0x61')][0x1]['value']:undefined)||null},{'name':_0x662c('0x77'),'value':_0x462bbc['attrSerie3']||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x2]?_0x462bbc[_0x662c('0x61')][0x2][_0x662c('0x62')]:undefined)||null},{'name':_0x662c('0x6b'),'value':_0x462bbc['attrVoiceQueues']||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x3]?_0x462bbc['attrs'][0x3]['value']:undefined)||[]},{'name':_0x662c('0x6c'),'value':_0x462bbc[_0x662c('0x6c')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x4]?_0x462bbc[_0x662c('0x61')][0x4][_0x662c('0x62')]:undefined)||_0x662c('0x78')},{'name':_0x662c('0x6d'),'value':_0x462bbc[_0x662c('0x6d')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x5]?_0x462bbc[_0x662c('0x61')][0x5][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x6e'),'value':_0x462bbc[_0x662c('0x6e')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x6]?_0x462bbc[_0x662c('0x61')][0x6][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x6f'),'value':_0x462bbc[_0x662c('0x6f')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x7]?_0x462bbc[_0x662c('0x61')][0x7]['value']:undefined)||''},{'name':_0x662c('0x70'),'value':_0x462bbc[_0x662c('0x70')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x8]?_0x462bbc[_0x662c('0x61')][0x8][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x71'),'value':_0x462bbc[_0x662c('0x71')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x9]?_0x462bbc['attrs'][0x9][_0x662c('0x62')]:undefined)||''},{'name':_0x662c('0x72'),'value':_0x462bbc['attrChatWebsites']||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0xa]?_0x462bbc['attrs'][0xa][_0x662c('0x62')]:undefined)||''}];case _0x662c('0x79'):return[{'name':'attrReport','type':_0x462bbc[_0x662c('0x7a')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x0]?_0x462bbc[_0x662c('0x61')][0x0][_0x662c('0x47')]:undefined)||null,'value':_0x462bbc['attrReport']||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc[_0x662c('0x61')][0x0]?_0x462bbc[_0x662c('0x61')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x462bbc[_0x662c('0x7b')]||(_0x462bbc[_0x662c('0x61')]&&_0x462bbc['attrs'][0x1]?_0x462bbc['attrs'][0x1][_0x662c('0x62')]:undefined)||0x0}];default:return[];}}catch(_0xf31a38){logger[_0x662c('0x31')](_0x662c('0x7c'),JSON['stringify'](_0xf31a38));return[];}}exports['addItem']=function(_0x46c9b6,_0x501b04,_0x253656){if(_0x46c9b6['body']['id']){delete _0x46c9b6['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x46c9b6[_0x662c('0x5a')]['id']}})[_0x662c('0x2b')](handleEntityNotFound(_0x501b04,null))[_0x662c('0x2b')](function(_0x52310c){if(_0x52310c){_0x46c9b6['body'][_0x662c('0x7d')]=_0x52310c['id'];_0x46c9b6[_0x662c('0x52')]['attrs']=widgetAttributes(_0x46c9b6[_0x662c('0x52')]);return db[_0x662c('0x7e')][_0x662c('0x51')](_0x46c9b6[_0x662c('0x52')]);}})['then'](respondWithResult(_0x501b04,null))[_0x662c('0x4e')](handleError(_0x501b04,null));};exports[_0x662c('0x7f')]=function(_0xb7c0ee,_0x20514d,_0x10f594){var _0x5aa18b={};var _0x580061={};var _0x495726;var _0x32f882;return db[_0x662c('0x4a')]['findOne']({'where':{'id':_0xb7c0ee[_0x662c('0x5a')]['id']}})[_0x662c('0x2b')](handleEntityNotFound(_0x20514d,null))[_0x662c('0x2b')](function(_0x451f05){if(_0x451f05){_0x495726=_0x451f05;_0x580061[_0x662c('0x3c')]=_[_0x662c('0x39')](db[_0x662c('0x7e')]['rawAttributes']);_0x580061[_0x662c('0x40')]=_[_0x662c('0x39')](_0xb7c0ee['query']);_0x580061[_0x662c('0x3a')]=_[_0x662c('0x3b')](_0x580061[_0x662c('0x3c')],_0x580061[_0x662c('0x40')]);_0x5aa18b[_0x662c('0x3d')]=_['intersection'](_0x580061[_0x662c('0x3c')],qs['fields'](_0xb7c0ee[_0x662c('0x40')]['fields']));_0x5aa18b['attributes']=_0x5aa18b[_0x662c('0x3d')][_0x662c('0x3f')]?_0x5aa18b[_0x662c('0x3d')]:_0x580061[_0x662c('0x3c')];_0x5aa18b[_0x662c('0x42')]=qs[_0x662c('0x43')](_0xb7c0ee[_0x662c('0x40')][_0x662c('0x43')]);_0x5aa18b[_0x662c('0x44')]=qs[_0x662c('0x3a')](_[_0x662c('0x80')](_0xb7c0ee[_0x662c('0x40')],_0x580061[_0x662c('0x3a')]));if(_0xb7c0ee['query'][_0x662c('0x45')]){_0x5aa18b[_0x662c('0x44')]=_[_0x662c('0x46')](_0x5aa18b[_0x662c('0x44')],{'$or':_[_0x662c('0x36')](_0x5aa18b['attributes'],function(_0x7c1898){var _0x14cca8={};_0x14cca8[_0x7c1898]={'$like':'%'+_0xb7c0ee[_0x662c('0x40')][_0x662c('0x45')]+'%'};return _0x14cca8;})});}_0x5aa18b=_[_0x662c('0x46')]({},_0x5aa18b,_0xb7c0ee[_0x662c('0x49')]);return _0x495726[_0x662c('0x7f')](_0x5aa18b);}})['then'](function(_0x19dca4){if(_0x19dca4){_0x32f882=_0x19dca4['length'];if(!_0xb7c0ee[_0x662c('0x40')][_0x662c('0x41')](_0x662c('0x81'))){_0x5aa18b['limit']=qs[_0x662c('0x23')](_0xb7c0ee[_0x662c('0x40')]['limit']);_0x5aa18b['offset']=qs[_0x662c('0x21')](_0xb7c0ee[_0x662c('0x40')][_0x662c('0x21')]);}return _0x495726[_0x662c('0x7f')](_0x5aa18b);}})[_0x662c('0x2b')](function(_0x26804e){if(_0x26804e){return _0x26804e?{'count':_0x32f882,'rows':_0x26804e}:null;}})['then'](respondWithResult(_0x20514d,null))[_0x662c('0x4e')](handleError(_0x20514d,null));};
\ No newline at end of file
index 4c2181c..b234ba3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8a3=['Dashboard','save','update','remove','emit','hook','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe8a3,0x19d));var _0x3e8a=function(_0x3d3b05,_0x334c57){_0x3d3b05=_0x3d3b05-0x0;var _0x2c6ca3=_0xe8a3[_0x3d3b05];return _0x2c6ca3;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x3e8a('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e8a('0x1'),'afterUpdate':_0x3e8a('0x2'),'afterDestroy':_0x3e8a('0x3')};function emitEvent(_0x390b60){return function(_0xbeff3d,_0x397b05,_0x5c1bee){DashboardEvents[_0x3e8a('0x4')](_0x390b60+':'+_0xbeff3d['id'],_0xbeff3d);DashboardEvents[_0x3e8a('0x4')](_0x390b60,_0xbeff3d);_0x5c1bee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x3e8a('0x5')](e,emitEvent(event));}}module[_0x3e8a('0x6')]=DashboardEvents;
\ No newline at end of file
+var _0x6657=['Dashboard','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x238f4d,_0x248011){var _0x3f9355=function(_0x29bfff){while(--_0x29bfff){_0x238f4d['push'](_0x238f4d['shift']());}};_0x3f9355(++_0x248011);}(_0x6657,0x17f));var _0x7665=function(_0x303fed,_0x5eecd3){_0x303fed=_0x303fed-0x0;var _0x1d9585=_0x6657[_0x303fed];return _0x1d9585;};'use strict';var EventEmitter=require(_0x7665('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x7665('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7665('0x2')](0x0);var events={'afterCreate':_0x7665('0x3'),'afterUpdate':_0x7665('0x4'),'afterDestroy':'remove'};function emitEvent(_0x386ca9){return function(_0x2ed8cb,_0x26acc4,_0x1c33b1){DashboardEvents[_0x7665('0x5')](_0x386ca9+':'+_0x2ed8cb['id'],_0x2ed8cb);DashboardEvents[_0x7665('0x5')](_0x386ca9,_0x2ed8cb);_0x1c33b1(null);};}for(var e in events){if(events[_0x7665('0x6')](e)){var event=events[e];Dashboard[_0x7665('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
index 133770b..837a342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42e9=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dashboard','dashboards'];(function(_0x41cd50,_0x5eda62){var _0xb2366c=function(_0x1eb92e){while(--_0x1eb92e){_0x41cd50['push'](_0x41cd50['shift']());}};_0xb2366c(++_0x5eda62);}(_0x42e9,0xa9));var _0x942e=function(_0x56f648,_0x1609a3){_0x56f648=_0x56f648-0x0;var _0x520d26=_0x42e9[_0x56f648];return _0x520d26;};'use strict';var _=require(_0x942e('0x0'));var util=require(_0x942e('0x1'));var logger=require('../../config/logger')(_0x942e('0x2'));var moment=require(_0x942e('0x3'));var BPromise=require(_0x942e('0x4'));var rp=require(_0x942e('0x5'));var fs=require('fs');var path=require(_0x942e('0x6'));var rimraf=require(_0x942e('0x7'));var config=require(_0x942e('0x8'));var attributes=require('./dashboard.attributes');module[_0x942e('0x9')]=function(_0x4623d9,_0x167d63){return _0x4623d9[_0x942e('0xa')](_0x942e('0xb'),attributes,{'tableName':_0x942e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x691a=['moment','bluebird','request-promise','path','rimraf','exports','define','Dashboard','dashboards','lodash','util','api'];(function(_0xe8f26b,_0x4f04eb){var _0x544918=function(_0x363c0a){while(--_0x363c0a){_0xe8f26b['push'](_0xe8f26b['shift']());}};_0x544918(++_0x4f04eb);}(_0x691a,0xed));var _0xa691=function(_0x512708,_0x187a94){_0x512708=_0x512708-0x0;var _0x4b6228=_0x691a[_0x512708];return _0x4b6228;};'use strict';var _=require(_0xa691('0x0'));var util=require(_0xa691('0x1'));var logger=require('../../config/logger')(_0xa691('0x2'));var moment=require(_0xa691('0x3'));var BPromise=require(_0xa691('0x4'));var rp=require(_0xa691('0x5'));var fs=require('fs');var path=require(_0xa691('0x6'));var rimraf=require(_0xa691('0x7'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0xa691('0x8')]=function(_0x13fcd8,_0x991e88){return _0x13fcd8[_0xa691('0x9')](_0xa691('0xa'),attributes,{'tableName':_0xa691('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2344e4a..3bcaefa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e5=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc4e5,0x157));var _0x5c4e=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0xc4e5[_0x1bb47b];return _0x566418;};'use strict';var _=require(_0x5c4e('0x0'));var util=require(_0x5c4e('0x1'));var moment=require(_0x5c4e('0x2'));var BPromise=require(_0x5c4e('0x3'));var rs=require(_0x5c4e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c4e('0x5'))['db'];var utils=require(_0x5c4e('0x6'));var logger=require(_0x5c4e('0x7'))('rpc');var config=require(_0x5c4e('0x8'));var jayson=require(_0x5c4e('0x9'));var client=jayson[_0x5c4e('0xa')][_0x5c4e('0xb')]({'port':0x232a});config['redis']=_[_0x5c4e('0xc')](config[_0x5c4e('0xd')],{'host':_0x5c4e('0xe'),'port':0x18eb});var socket=require(_0x5c4e('0xf'))(new Redis(config[_0x5c4e('0xd')]));require(_0x5c4e('0x10'))[_0x5c4e('0x11')](socket);function respondWithRpcPromise(_0x273685,_0x37c5fe,_0x39054c){return new BPromise(function(_0x509ccf,_0x1dab57){return client[_0x5c4e('0x12')](_0x273685,_0x39054c)[_0x5c4e('0x13')](function(_0x4906ab){logger[_0x5c4e('0x14')](_0x5c4e('0x15'),_0x37c5fe,_0x5c4e('0x16'));logger[_0x5c4e('0x17')](_0x5c4e('0x18'),_0x37c5fe,_0x5c4e('0x16'),JSON[_0x5c4e('0x19')](_0x4906ab));if(_0x4906ab['error']){if(_0x4906ab['error'][_0x5c4e('0x1a')]===0x1f4){logger[_0x5c4e('0x1b')](_0x5c4e('0x15'),_0x37c5fe,_0x4906ab[_0x5c4e('0x1b')][_0x5c4e('0x1c')]);return _0x1dab57(_0x4906ab[_0x5c4e('0x1b')][_0x5c4e('0x1c')]);}logger['error'](_0x5c4e('0x15'),_0x37c5fe,_0x4906ab[_0x5c4e('0x1b')][_0x5c4e('0x1c')]);return _0x509ccf(_0x4906ab[_0x5c4e('0x1b')][_0x5c4e('0x1c')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x37c5fe,_0x5c4e('0x16'));_0x509ccf(_0x4906ab[_0x5c4e('0x1d')][_0x5c4e('0x1c')]);}})[_0x5c4e('0x1e')](function(_0x36e44f){logger['error']('Dashboard,\x20%s,\x20%s',_0x37c5fe,_0x36e44f);_0x1dab57(_0x36e44f);});});}
\ No newline at end of file
+var _0xa510=['stringify','code','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3aa0c6,_0x479f87){var _0x24f355=function(_0x1d73ff){while(--_0x1d73ff){_0x3aa0c6['push'](_0x3aa0c6['shift']());}};_0x24f355(++_0x479f87);}(_0xa510,0x16e));var _0x0a51=function(_0x587f07,_0x670507){_0x587f07=_0x587f07-0x0;var _0x1bae9c=_0xa510[_0x587f07];return _0x1bae9c;};'use strict';var _=require('lodash');var util=require(_0x0a51('0x0'));var moment=require(_0x0a51('0x1'));var BPromise=require(_0x0a51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a51('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a51('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0a51('0x5'));var client=jayson[_0x0a51('0x6')]['http']({'port':0x232a});config[_0x0a51('0x7')]=_[_0x0a51('0x8')](config[_0x0a51('0x7')],{'host':_0x0a51('0x9'),'port':0x18eb});var socket=require(_0x0a51('0xa'))(new Redis(config[_0x0a51('0x7')]));require('./dashboard.socket')[_0x0a51('0xb')](socket);function respondWithRpcPromise(_0x268385,_0x6e8691,_0x3e231e){return new BPromise(function(_0x4248bc,_0x38719c){return client[_0x0a51('0xc')](_0x268385,_0x3e231e)[_0x0a51('0xd')](function(_0x18d69d){logger[_0x0a51('0xe')](_0x0a51('0xf'),_0x6e8691,'request\x20sent');logger['debug'](_0x0a51('0x10'),_0x6e8691,_0x0a51('0x11'),JSON[_0x0a51('0x12')](_0x18d69d));if(_0x18d69d['error']){if(_0x18d69d['error'][_0x0a51('0x13')]===0x1f4){logger[_0x0a51('0x14')]('Dashboard,\x20%s,\x20%s',_0x6e8691,_0x18d69d[_0x0a51('0x14')][_0x0a51('0x15')]);return _0x38719c(_0x18d69d['error']['message']);}logger[_0x0a51('0x14')](_0x0a51('0xf'),_0x6e8691,_0x18d69d[_0x0a51('0x14')][_0x0a51('0x15')]);return _0x4248bc(_0x18d69d[_0x0a51('0x14')][_0x0a51('0x15')]);}else{logger[_0x0a51('0xe')](_0x0a51('0xf'),_0x6e8691,_0x0a51('0x11'));_0x4248bc(_0x18d69d[_0x0a51('0x16')][_0x0a51('0x15')]);}})[_0x0a51('0x17')](function(_0x4f4223){logger[_0x0a51('0x14')](_0x0a51('0xf'),_0x6e8691,_0x4f4223);_0x38719c(_0x4f4223);});});}
\ No newline at end of file
index bfa1248..92f934c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2655=['length','./dashboard.events','save','remove','update','emit','register'];(function(_0x2751c1,_0x178e6f){var _0x1ce8b4=function(_0x2d7ba2){while(--_0x2d7ba2){_0x2751c1['push'](_0x2751c1['shift']());}};_0x1ce8b4(++_0x178e6f);}(_0x2655,0x120));var _0x5265=function(_0x2f227e,_0x3bafe8){_0x2f227e=_0x2f227e-0x0;var _0x425df5=_0x2655[_0x2f227e];return _0x425df5;};'use strict';var DashboardEvents=require(_0x5265('0x0'));var events=[_0x5265('0x1'),_0x5265('0x2'),_0x5265('0x3')];function createListener(_0x5dc935,_0x5e91e5){return function(_0x10bcd7){_0x5e91e5[_0x5265('0x4')](_0x5dc935,_0x10bcd7);};}function removeListener(_0x292248,_0x5c599a){return function(){DashboardEvents['removeListener'](_0x292248,_0x5c599a);};}exports[_0x5265('0x5')]=function(_0xa1ea6c){for(var _0x2c9a63=0x0,_0x449c3f=events[_0x5265('0x6')];_0x2c9a63<_0x449c3f;_0x2c9a63++){var _0x557cb5=events[_0x2c9a63];var _0x2f2f56=createListener('dashboard:'+_0x557cb5,_0xa1ea6c);DashboardEvents['on'](_0x557cb5,_0x2f2f56);}};
\ No newline at end of file
+var _0xdb8a=['./dashboard.events','save','remove','update','emit','register','length','dashboard:'];(function(_0x2d188b,_0x21fea7){var _0x513463=function(_0x4235c9){while(--_0x4235c9){_0x2d188b['push'](_0x2d188b['shift']());}};_0x513463(++_0x21fea7);}(_0xdb8a,0x170));var _0xadb8=function(_0x52f915,_0x1a2d71){_0x52f915=_0x52f915-0x0;var _0x2b5563=_0xdb8a[_0x52f915];return _0x2b5563;};'use strict';var DashboardEvents=require(_0xadb8('0x0'));var events=[_0xadb8('0x1'),_0xadb8('0x2'),_0xadb8('0x3')];function createListener(_0x39728e,_0x3015bd){return function(_0x3ea8fc){_0x3015bd[_0xadb8('0x4')](_0x39728e,_0x3ea8fc);};}function removeListener(_0x4607e8,_0xfd1c68){return function(){DashboardEvents['removeListener'](_0x4607e8,_0xfd1c68);};}exports[_0xadb8('0x5')]=function(_0xd4e5c2){for(var _0x5c3d43=0x0,_0x2d73b1=events[_0xadb8('0x6')];_0x5c3d43<_0x2d73b1;_0x5c3d43++){var _0x356395=events[_0x5c3d43];var _0x177704=createListener(_0xadb8('0x7')+_0x356395,_0xd4e5c2);DashboardEvents['on'](_0x356395,_0x177704);}};
\ No newline at end of file
index a36a4bf..a999c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47b2=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','getItems','clone','post','addItem','put','update','delete','destroy','exports'];(function(_0x5f48fe,_0x3cfdfc){var _0x56e783=function(_0xe0a136){while(--_0xe0a136){_0x5f48fe['push'](_0x5f48fe['shift']());}};_0x56e783(++_0x3cfdfc);}(_0x47b2,0x7e));var _0x247b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47b2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x247b('0x0'));var util=require('util');var path=require(_0x247b('0x1'));var timeout=require(_0x247b('0x2'));var express=require(_0x247b('0x3'));var router=express[_0x247b('0x4')]();var fs_extra=require(_0x247b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x247b('0x6'));var config=require('../../config/environment');var controller=require(_0x247b('0x7'));router[_0x247b('0x8')]('/',auth[_0x247b('0x9')](),controller[_0x247b('0xa')]);router[_0x247b('0x8')](_0x247b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x247b('0x8')]('/:id/items',auth['isAuthenticated'](),controller[_0x247b('0xc')]);router['post']('/',auth[_0x247b('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x247b('0x9')](),controller[_0x247b('0xd')]);router[_0x247b('0xe')]('/:id/items',auth[_0x247b('0x9')](),controller[_0x247b('0xf')]);router[_0x247b('0x10')](_0x247b('0xb'),auth['isAuthenticated'](),controller[_0x247b('0x11')]);router[_0x247b('0x12')](_0x247b('0xb'),auth[_0x247b('0x9')](),controller[_0x247b('0x13')]);module[_0x247b('0x14')]=router;
\ No newline at end of file
+var _0x3e08=['isAuthenticated','index','/:id','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','multer','util','path','express','fs-extra','./dashboard.controller','get'];(function(_0xf0ec68,_0x255a53){var _0x5978e1=function(_0x18d7cd){while(--_0x18d7cd){_0xf0ec68['push'](_0xf0ec68['shift']());}};_0x5978e1(++_0x255a53);}(_0x3e08,0x134));var _0x83e0=function(_0x27fe26,_0x3b8ca7){_0x27fe26=_0x27fe26-0x0;var _0x4fcb35=_0x3e08[_0x27fe26];return _0x4fcb35;};'use strict';var multer=require(_0x83e0('0x0'));var util=require(_0x83e0('0x1'));var path=require(_0x83e0('0x2'));var timeout=require('connect-timeout');var express=require(_0x83e0('0x3'));var router=express['Router']();var fs_extra=require(_0x83e0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x83e0('0x5'));router[_0x83e0('0x6')]('/',auth[_0x83e0('0x7')](),controller[_0x83e0('0x8')]);router['get'](_0x83e0('0x9'),auth[_0x83e0('0x7')](),controller[_0x83e0('0xa')]);router[_0x83e0('0x6')]('/:id/items',auth[_0x83e0('0x7')](),controller[_0x83e0('0xb')]);router[_0x83e0('0xc')]('/',auth[_0x83e0('0x7')](),controller[_0x83e0('0xd')]);router[_0x83e0('0xc')](_0x83e0('0xe'),auth[_0x83e0('0x7')](),controller[_0x83e0('0xf')]);router[_0x83e0('0xc')](_0x83e0('0x10'),auth[_0x83e0('0x7')](),controller[_0x83e0('0x11')]);router[_0x83e0('0x12')](_0x83e0('0x9'),auth[_0x83e0('0x7')](),controller[_0x83e0('0x13')]);router[_0x83e0('0x14')](_0x83e0('0x9'),auth[_0x83e0('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 334edf6..084af76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash'];(function(_0x4ac48d,_0x171a68){var _0x7537af=function(_0x1c6ca6){while(--_0x1c6ca6){_0x4ac48d['push'](_0x4ac48d['shift']());}};_0x7537af(++_0x171a68);}(_0x2542,0x169));var _0x2254=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x2542[_0x48326a];return _0x466709;};'use strict';var Sequelize=require(_0x2254('0x0'));var squel=require(_0x2254('0x1'));var _=require(_0x2254('0x2'));module[_0x2254('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2254('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x2254('0x5')),'get':function(){try{return JSON[_0x2254('0x6')](this[_0x2254('0x7')](_0x2254('0x8')));}catch(_0x76c902){return[];}},'set':function(_0x508183){try{this[_0x2254('0x9')](_0x2254('0x8'),JSON[_0x2254('0xa')](_0x508183));}catch(_0x3c45ec){this[_0x2254('0x9')](_0x2254('0x8'),JSON[_0x2254('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x2254('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x2254('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x2254('0xb')]},'col':{'type':Sequelize[_0x2254('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2254('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x2254('0x4')],'allowNull':![],'defaultValue':_0x2254('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x2254('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x1986e4,_0x506ed2){var _0x4be35e=function(_0x52e4f4){while(--_0x52e4f4){_0x1986e4['push'](_0x1986e4['shift']());}};_0x4be35e(++_0x506ed2);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x1f78df,_0x429953){_0x1f78df=_0x1f78df-0x0;var _0x2e4f3e=_0xc6ac[_0x1f78df];return _0x2e4f3e;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'defaultValue':0xc}};
\ No newline at end of file
index 742e18a..3e34669 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d95=['counter','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize'];(function(_0x22da96,_0xfc5108){var _0x5a35dd=function(_0x19f9bc){while(--_0x19f9bc){_0x22da96['push'](_0x22da96['shift']());}};_0x5a35dd(++_0xfc5108);}(_0x5d95,0x77));var _0x55d9=function(_0x55a650,_0x4b8759){_0x55a650=_0x55a650-0x0;var _0x2d223a=_0x5d95[_0x55a650];return _0x2d223a;};'use strict';var emlformat=require(_0x55d9('0x0'));var rimraf=require(_0x55d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55d9('0x2'));var rp=require(_0x55d9('0x3'));var moment=require(_0x55d9('0x4'));var BPromise=require(_0x55d9('0x5'));var Mustache=require(_0x55d9('0x6'));var util=require('util');var path=require(_0x55d9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x55d9('0x8'));var fs=require('fs');var fs_extra=require(_0x55d9('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x55d9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x55d9('0xb'));var authService=require(_0x55d9('0xc'));var qs=require(_0x55d9('0xd'));var as=require(_0x55d9('0xe'));var hardwareService=require(_0x55d9('0xf'));var logger=require(_0x55d9('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x55d9('0x11'));var licenseUtil=require(_0x55d9('0x12'));var db=require(_0x55d9('0x13'))['db'];config[_0x55d9('0x14')]=_[_0x55d9('0x15')](config[_0x55d9('0x14')],{'host':_0x55d9('0x16'),'port':0x18eb});var socket=require(_0x55d9('0x17'))(new Redis(config[_0x55d9('0x14')]));require('./dashboardItem.socket')[_0x55d9('0x18')](socket);function respondWithStatusCode(_0x39967c,_0x12a15c){_0x12a15c=_0x12a15c||0xcc;return function(_0xf68641){if(_0xf68641){return _0x39967c[_0x55d9('0x19')](_0x12a15c);}return _0x39967c[_0x55d9('0x1a')](_0x12a15c)[_0x55d9('0x1b')]();};}function respondWithResult(_0x5c66e2,_0xe3e5a9){_0xe3e5a9=_0xe3e5a9||0xc8;return function(_0x374fa7){if(_0x374fa7){return _0x5c66e2[_0x55d9('0x1a')](_0xe3e5a9)[_0x55d9('0x1c')](_0x374fa7);}};}function respondWithFilteredResult(_0x45a0cc,_0x43ee2c){return function(_0x50faa6){if(_0x50faa6){var _0xce6a36=typeof _0x43ee2c[_0x55d9('0x1d')]==='undefined'&&typeof _0x43ee2c['limit']==='undefined';var _0xed70ef=_0x50faa6[_0x55d9('0x1e')];var _0x191c3e=_0xce6a36?0x0:_0x43ee2c[_0x55d9('0x1d')];var _0x535ad9=_0xce6a36?_0x50faa6[_0x55d9('0x1e')]:_0x43ee2c[_0x55d9('0x1d')]+_0x43ee2c[_0x55d9('0x1f')];var _0x556d6f;if(_0x535ad9>=_0xed70ef){_0x535ad9=_0xed70ef;_0x556d6f=0xc8;}else{_0x556d6f=0xce;}_0x45a0cc[_0x55d9('0x1a')](_0x556d6f);return _0x45a0cc[_0x55d9('0x20')](_0x55d9('0x21'),_0x191c3e+'-'+_0x535ad9+'/'+_0xed70ef)[_0x55d9('0x1c')](_0x50faa6);}return null;};}function patchUpdates(_0x54c648){return function(_0x53e684){try{jsonpatch[_0x55d9('0x22')](_0x53e684,_0x54c648,!![]);}catch(_0x416cc6){return BPromise[_0x55d9('0x23')](_0x416cc6);}return _0x53e684[_0x55d9('0x24')]();};}function saveUpdates(_0x334a6b,_0x36d8ab){return function(_0x10be56){if(_0x10be56){return _0x10be56[_0x55d9('0x25')](_0x334a6b)[_0x55d9('0x26')](function(_0x4bd725){return _0x4bd725;});}return null;};}function removeEntity(_0x2686d7,_0x2c5d21){return function(_0x4cca69){if(_0x4cca69){return _0x4cca69[_0x55d9('0x27')]()['then'](function(){_0x2686d7[_0x55d9('0x1a')](0xcc)[_0x55d9('0x1b')]();});}};}function handleEntityNotFound(_0x28d332,_0x6daac1){return function(_0x22218f){if(!_0x22218f){_0x28d332['sendStatus'](0x194);}return _0x22218f;};}function handleError(_0x2c640c,_0x4a6806){_0x4a6806=_0x4a6806||0x1f4;return function(_0x4c1bbe){logger[_0x55d9('0x28')](_0x4c1bbe[_0x55d9('0x29')]);if(_0x4c1bbe[_0x55d9('0x2a')]){delete _0x4c1bbe['name'];}_0x2c640c[_0x55d9('0x1a')](_0x4a6806)[_0x55d9('0x2b')](_0x4c1bbe);};}exports[_0x55d9('0x2c')]=function(_0xccae56,_0x1c89cd){var _0x8464a3={'raw':![],'where':{'id':_0xccae56[_0x55d9('0x2d')]['id']}},_0x19ca6a={};_0x19ca6a[_0x55d9('0x2e')]=_[_0x55d9('0x2f')](db[_0x55d9('0x30')][_0x55d9('0x31')]);_0x19ca6a[_0x55d9('0x32')]=_[_0x55d9('0x2f')](_0xccae56[_0x55d9('0x32')]);_0x19ca6a[_0x55d9('0x33')]=_[_0x55d9('0x34')](_0x19ca6a[_0x55d9('0x2e')],_0x19ca6a[_0x55d9('0x32')]);_0x8464a3[_0x55d9('0x35')]=_[_0x55d9('0x34')](_0x19ca6a[_0x55d9('0x2e')],qs[_0x55d9('0x36')](_0xccae56[_0x55d9('0x32')]['fields']));_0x8464a3['attributes']=_0x8464a3[_0x55d9('0x35')][_0x55d9('0x37')]?_0x8464a3[_0x55d9('0x35')]:_0x19ca6a[_0x55d9('0x2e')];if(_0xccae56[_0x55d9('0x32')][_0x55d9('0x38')]){_0x8464a3[_0x55d9('0x39')]=[{'all':!![]}];}_0x8464a3=_[_0x55d9('0x3a')]({},_0x8464a3,_0xccae56['options']);return db[_0x55d9('0x30')][_0x55d9('0x3b')](_0x8464a3)[_0x55d9('0x26')](handleEntityNotFound(_0x1c89cd,null))[_0x55d9('0x26')](respondWithResult(_0x1c89cd,null))[_0x55d9('0x3c')](handleError(_0x1c89cd,null));};exports['destroy']=function(_0x9dbc6e,_0xe0f35c){return db[_0x55d9('0x30')][_0x55d9('0x3b')]({'where':{'id':_0x9dbc6e[_0x55d9('0x2d')]['id']}})[_0x55d9('0x26')](handleEntityNotFound(_0xe0f35c,null))[_0x55d9('0x26')](removeEntity(_0xe0f35c,null))[_0x55d9('0x3c')](handleError(_0xe0f35c,null));};function widgetAttributes(_0x189de2){try{switch(_0x189de2[_0x55d9('0x3d')]){case _0x55d9('0x3e'):return[{'name':_0x55d9('0x3f'),'value':_0x189de2[_0x55d9('0x3f')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x0]?_0x189de2[_0x55d9('0x40')][0x0][_0x55d9('0x41')]:undefined)||'https://'}];case _0x55d9('0x42'):return[{'name':'attrPath','value':_0x189de2[_0x55d9('0x43')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x0]?_0x189de2[_0x55d9('0x40')][0x0]['value']:undefined)||''}];case _0x55d9('0x44'):return[{'name':_0x55d9('0x45'),'value':_0x189de2[_0x55d9('0x45')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2['attrs'][0x0]?_0x189de2['attrs'][0x0][_0x55d9('0x41')]:undefined)||_0x55d9('0x46')},{'name':'attrTimezone','value':_0x189de2['attrTimezone']||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x1]?_0x189de2[_0x55d9('0x40')][0x1][_0x55d9('0x41')]:undefined)||_0x55d9('0x47')},{'name':_0x55d9('0x48'),'value':_0x189de2['attrFontSize']||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x2]?_0x189de2[_0x55d9('0x40')][0x2][_0x55d9('0x41')]:undefined)||0xc}];case _0x55d9('0x49'):return[{'name':'attrMetric','value':_0x189de2['attrMetric']||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x0]?_0x189de2[_0x55d9('0x40')][0x0][_0x55d9('0x41')]:undefined)||_0x55d9('0x4a')},{'name':_0x55d9('0x4b'),'value':_0x189de2[_0x55d9('0x4b')]||(_0x189de2['attrs']&&_0x189de2[_0x55d9('0x40')][0x1]?_0x189de2[_0x55d9('0x40')][0x1][_0x55d9('0x41')]:undefined)||[]},{'name':_0x55d9('0x48'),'value':_0x189de2[_0x55d9('0x48')]||(_0x189de2['attrs']&&_0x189de2['attrs'][0x2]?_0x189de2[_0x55d9('0x40')][0x2]['value']:undefined)||0x14},{'name':_0x55d9('0x4c'),'value':_0x189de2['attrChannel']||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x3]?_0x189de2[_0x55d9('0x40')][0x3][_0x55d9('0x41')]:undefined)||'voice'},{'name':_0x55d9('0x4d'),'value':_0x189de2['attrEmailAccounts']||(_0x189de2['attrs']&&_0x189de2['attrs'][0x4]?_0x189de2[_0x55d9('0x40')][0x4][_0x55d9('0x41')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x189de2[_0x55d9('0x4e')]||(_0x189de2['attrs']&&_0x189de2[_0x55d9('0x40')][0x5]?_0x189de2[_0x55d9('0x40')][0x5][_0x55d9('0x41')]:undefined)||''},{'name':_0x55d9('0x4f'),'value':_0x189de2[_0x55d9('0x4f')]||(_0x189de2['attrs']&&_0x189de2['attrs'][0x6]?_0x189de2[_0x55d9('0x40')][0x6][_0x55d9('0x41')]:undefined)||''},{'name':_0x55d9('0x50'),'value':_0x189de2[_0x55d9('0x50')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2['attrs'][0x7]?_0x189de2[_0x55d9('0x40')][0x7][_0x55d9('0x41')]:undefined)||''},{'name':_0x55d9('0x51'),'value':_0x189de2[_0x55d9('0x51')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x8]?_0x189de2[_0x55d9('0x40')][0x8]['value']:undefined)||''},{'name':_0x55d9('0x52'),'value':_0x189de2[_0x55d9('0x52')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x9]?_0x189de2[_0x55d9('0x40')][0x9]['value']:undefined)||''}];case _0x55d9('0x53'):case _0x55d9('0x54'):return[{'name':_0x55d9('0x55'),'value':_0x189de2[_0x55d9('0x55')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x0]?_0x189de2[_0x55d9('0x40')][0x0][_0x55d9('0x41')]:undefined)||_0x55d9('0x4a')},{'name':_0x55d9('0x56'),'value':_0x189de2[_0x55d9('0x56')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x1]?_0x189de2[_0x55d9('0x40')][0x1]['value']:undefined)||null},{'name':_0x55d9('0x57'),'value':_0x189de2[_0x55d9('0x57')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x2]?_0x189de2[_0x55d9('0x40')][0x2][_0x55d9('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x189de2['attrVoiceQueues']||(_0x189de2[_0x55d9('0x40')]&&_0x189de2['attrs'][0x3]?_0x189de2[_0x55d9('0x40')][0x3][_0x55d9('0x41')]:undefined)||[]},{'name':_0x55d9('0x4c'),'value':_0x189de2[_0x55d9('0x4c')]||(_0x189de2['attrs']&&_0x189de2[_0x55d9('0x40')][0x4]?_0x189de2['attrs'][0x4][_0x55d9('0x41')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x189de2[_0x55d9('0x4d')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x5]?_0x189de2[_0x55d9('0x40')][0x5][_0x55d9('0x41')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x189de2[_0x55d9('0x4e')]||(_0x189de2['attrs']&&_0x189de2[_0x55d9('0x40')][0x6]?_0x189de2[_0x55d9('0x40')][0x6][_0x55d9('0x41')]:undefined)||''},{'name':_0x55d9('0x4f'),'value':_0x189de2[_0x55d9('0x4f')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2['attrs'][0x7]?_0x189de2[_0x55d9('0x40')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x189de2[_0x55d9('0x50')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x8]?_0x189de2[_0x55d9('0x40')][0x8]['value']:undefined)||''},{'name':_0x55d9('0x51'),'value':_0x189de2[_0x55d9('0x51')]||(_0x189de2['attrs']&&_0x189de2[_0x55d9('0x40')][0x9]?_0x189de2[_0x55d9('0x40')][0x9][_0x55d9('0x41')]:undefined)||''},{'name':_0x55d9('0x52'),'value':_0x189de2[_0x55d9('0x52')]||(_0x189de2['attrs']&&_0x189de2[_0x55d9('0x40')][0xa]?_0x189de2[_0x55d9('0x40')][0xa][_0x55d9('0x41')]:undefined)||''}];case _0x55d9('0x58'):return[{'name':_0x55d9('0x59'),'type':_0x189de2[_0x55d9('0x5a')]||(_0x189de2['attrs']&&_0x189de2[_0x55d9('0x40')][0x0]?_0x189de2['attrs'][0x0][_0x55d9('0x3d')]:undefined)||null,'value':_0x189de2[_0x55d9('0x59')]||(_0x189de2['attrs']&&_0x189de2['attrs'][0x0]?_0x189de2['attrs'][0x0][_0x55d9('0x41')]:undefined)||null},{'name':_0x55d9('0x5b'),'value':_0x189de2[_0x55d9('0x5b')]||(_0x189de2[_0x55d9('0x40')]&&_0x189de2[_0x55d9('0x40')][0x1]?_0x189de2['attrs'][0x1][_0x55d9('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x1b246f){logger[_0x55d9('0x28')](_0x55d9('0x5c'),JSON[_0x55d9('0x5d')](_0x1b246f));return[];}}exports[_0x55d9('0x5e')]=function(_0x1ddf8a,_0x14d93b){if(_0x1ddf8a[_0x55d9('0x5f')]){_0x1ddf8a['body'][_0x55d9('0x40')]=widgetAttributes(_0x1ddf8a[_0x55d9('0x5f')]);}return db['DashboardItem']['create'](_0x1ddf8a[_0x55d9('0x5f')],{})[_0x55d9('0x26')](respondWithResult(_0x14d93b,0xc9))[_0x55d9('0x3c')](handleError(_0x14d93b,null));};exports[_0x55d9('0x25')]=function(_0x27aa20,_0xe68a5){if(_0x27aa20[_0x55d9('0x5f')]['id']){delete _0x27aa20[_0x55d9('0x5f')]['id'];}_0x27aa20[_0x55d9('0x5f')]['attrs']=widgetAttributes(_0x27aa20['body']);return db[_0x55d9('0x30')][_0x55d9('0x3b')]({'where':{'id':_0x27aa20[_0x55d9('0x2d')]['id']}})[_0x55d9('0x26')](handleEntityNotFound(_0xe68a5,null))[_0x55d9('0x26')](saveUpdates(_0x27aa20['body'],null))[_0x55d9('0x26')](respondWithResult(_0xe68a5,null))[_0x55d9('0x3c')](handleError(_0xe68a5,null));};
\ No newline at end of file
+var _0xe978=['attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','include','merge','options','find','catch','params','type','iframe','attrs','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts'];(function(_0x283e00,_0x1ff96a){var _0x46d423=function(_0x48fd0b){while(--_0x48fd0b){_0x283e00['push'](_0x283e00['shift']());}};_0x46d423(++_0x1ff96a);}(_0xe978,0x70));var _0x8e97=function(_0x56c042,_0x1c9e21){_0x56c042=_0x56c042-0x0;var _0x36471f=_0xe978[_0x56c042];return _0x36471f;};'use strict';var emlformat=require(_0x8e97('0x0'));var rimraf=require(_0x8e97('0x1'));var zipdir=require(_0x8e97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8e97('0x3'));var BPromise=require(_0x8e97('0x4'));var Mustache=require(_0x8e97('0x5'));var util=require(_0x8e97('0x6'));var path=require(_0x8e97('0x7'));var sox=require('sox');var csv=require(_0x8e97('0x8'));var ejs=require(_0x8e97('0x9'));var fs=require('fs');var fs_extra=require(_0x8e97('0xa'));var _=require(_0x8e97('0xb'));var squel=require(_0x8e97('0xc'));var crypto=require('crypto');var jsforce=require(_0x8e97('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8e97('0x8'));var querystring=require(_0x8e97('0xe'));var Papa=require(_0x8e97('0xf'));var Redis=require('ioredis');var authService=require(_0x8e97('0x10'));var qs=require(_0x8e97('0x11'));var as=require(_0x8e97('0x12'));var hardwareService=require(_0x8e97('0x13'));var logger=require(_0x8e97('0x14'))(_0x8e97('0x15'));var utils=require(_0x8e97('0x16'));var config=require(_0x8e97('0x17'));var licenseUtil=require(_0x8e97('0x18'));var db=require(_0x8e97('0x19'))['db'];config[_0x8e97('0x1a')]=_['defaults'](config[_0x8e97('0x1a')],{'host':_0x8e97('0x1b'),'port':0x18eb});var socket=require(_0x8e97('0x1c'))(new Redis(config[_0x8e97('0x1a')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x583c0a,_0x516c91){_0x516c91=_0x516c91||0xcc;return function(_0x5d78c5){if(_0x5d78c5){return _0x583c0a['sendStatus'](_0x516c91);}return _0x583c0a[_0x8e97('0x1d')](_0x516c91)['end']();};}function respondWithResult(_0x33b6b3,_0x3bb176){_0x3bb176=_0x3bb176||0xc8;return function(_0x4943c1){if(_0x4943c1){return _0x33b6b3['status'](_0x3bb176)[_0x8e97('0x1e')](_0x4943c1);}};}function respondWithFilteredResult(_0x3f3738,_0xb779ed){return function(_0x2f475c){if(_0x2f475c){var _0x2155ab=typeof _0xb779ed[_0x8e97('0x1f')]===_0x8e97('0x20')&&typeof _0xb779ed[_0x8e97('0x21')]===_0x8e97('0x20');var _0x596d71=_0x2f475c[_0x8e97('0x22')];var _0x442f99=_0x2155ab?0x0:_0xb779ed[_0x8e97('0x1f')];var _0x19f487=_0x2155ab?_0x2f475c[_0x8e97('0x22')]:_0xb779ed[_0x8e97('0x1f')]+_0xb779ed[_0x8e97('0x21')];var _0x5a5c99;if(_0x19f487>=_0x596d71){_0x19f487=_0x596d71;_0x5a5c99=0xc8;}else{_0x5a5c99=0xce;}_0x3f3738[_0x8e97('0x1d')](_0x5a5c99);return _0x3f3738[_0x8e97('0x23')](_0x8e97('0x24'),_0x442f99+'-'+_0x19f487+'/'+_0x596d71)[_0x8e97('0x1e')](_0x2f475c);}return null;};}function patchUpdates(_0x387748){return function(_0x1763e7){try{jsonpatch[_0x8e97('0x25')](_0x1763e7,_0x387748,!![]);}catch(_0x18fcdb){return BPromise[_0x8e97('0x26')](_0x18fcdb);}return _0x1763e7[_0x8e97('0x27')]();};}function saveUpdates(_0x517c1e,_0x5d5a94){return function(_0x4b08ed){if(_0x4b08ed){return _0x4b08ed[_0x8e97('0x28')](_0x517c1e)[_0x8e97('0x29')](function(_0x2be986){return _0x2be986;});}return null;};}function removeEntity(_0xcee009,_0x1bae19){return function(_0x10f327){if(_0x10f327){return _0x10f327[_0x8e97('0x2a')]()[_0x8e97('0x29')](function(){_0xcee009['status'](0xcc)[_0x8e97('0x2b')]();});}};}function handleEntityNotFound(_0x2a5f18,_0x33e801){return function(_0x5bb338){if(!_0x5bb338){_0x2a5f18[_0x8e97('0x2c')](0x194);}return _0x5bb338;};}function handleError(_0x4ef232,_0x7f0baf){_0x7f0baf=_0x7f0baf||0x1f4;return function(_0x7f3ea1){logger[_0x8e97('0x2d')](_0x7f3ea1[_0x8e97('0x2e')]);if(_0x7f3ea1[_0x8e97('0x2f')]){delete _0x7f3ea1[_0x8e97('0x2f')];}_0x4ef232[_0x8e97('0x1d')](_0x7f0baf)['send'](_0x7f3ea1);};}exports['show']=function(_0x1271c1,_0x364296){var _0x19d800={'raw':![],'where':{'id':_0x1271c1['params']['id']}},_0x3f24d0={};_0x3f24d0[_0x8e97('0x30')]=_[_0x8e97('0x31')](db[_0x8e97('0x32')][_0x8e97('0x33')]);_0x3f24d0[_0x8e97('0x34')]=_['keys'](_0x1271c1[_0x8e97('0x34')]);_0x3f24d0[_0x8e97('0x35')]=_[_0x8e97('0x36')](_0x3f24d0[_0x8e97('0x30')],_0x3f24d0[_0x8e97('0x34')]);_0x19d800['attributes']=_[_0x8e97('0x36')](_0x3f24d0['model'],qs[_0x8e97('0x37')](_0x1271c1[_0x8e97('0x34')][_0x8e97('0x37')]));_0x19d800[_0x8e97('0x38')]=_0x19d800[_0x8e97('0x38')]['length']?_0x19d800[_0x8e97('0x38')]:_0x3f24d0[_0x8e97('0x30')];if(_0x1271c1['query']['includeAll']){_0x19d800[_0x8e97('0x39')]=[{'all':!![]}];}_0x19d800=_[_0x8e97('0x3a')]({},_0x19d800,_0x1271c1[_0x8e97('0x3b')]);return db['DashboardItem'][_0x8e97('0x3c')](_0x19d800)[_0x8e97('0x29')](handleEntityNotFound(_0x364296,null))[_0x8e97('0x29')](respondWithResult(_0x364296,null))[_0x8e97('0x3d')](handleError(_0x364296,null));};exports[_0x8e97('0x2a')]=function(_0x535fde,_0x197b29){return db['DashboardItem'][_0x8e97('0x3c')]({'where':{'id':_0x535fde[_0x8e97('0x3e')]['id']}})[_0x8e97('0x29')](handleEntityNotFound(_0x197b29,null))['then'](removeEntity(_0x197b29,null))['catch'](handleError(_0x197b29,null));};function widgetAttributes(_0x3b8fae){try{switch(_0x3b8fae[_0x8e97('0x3f')]){case _0x8e97('0x40'):return[{'name':'attrUrl','value':_0x3b8fae['attrUrl']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0]['value']:undefined)||'https://'}];case _0x8e97('0x42'):return[{'name':'attrPath','value':_0x3b8fae[_0x8e97('0x43')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x44')]:undefined)||''}];case _0x8e97('0x45'):return[{'name':_0x8e97('0x46'),'value':_0x3b8fae['attrHourFormat']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x44')]:undefined)||_0x8e97('0x47')},{'name':_0x8e97('0x48'),'value':_0x3b8fae[_0x8e97('0x48')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x1]?_0x3b8fae[_0x8e97('0x41')][0x1][_0x8e97('0x44')]:undefined)||_0x8e97('0x49')},{'name':'attrFontSize','value':_0x3b8fae[_0x8e97('0x4a')]||(_0x3b8fae['attrs']&&_0x3b8fae[_0x8e97('0x41')][0x2]?_0x3b8fae[_0x8e97('0x41')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x8e97('0x4b'),'value':_0x3b8fae[_0x8e97('0x4b')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x44')]:undefined)||_0x8e97('0x4c')},{'name':'attrVoiceQueues','value':_0x3b8fae[_0x8e97('0x4d')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x1]?_0x3b8fae[_0x8e97('0x41')][0x1][_0x8e97('0x44')]:undefined)||[]},{'name':_0x8e97('0x4a'),'value':_0x3b8fae['attrFontSize']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x2]?_0x3b8fae[_0x8e97('0x41')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x3b8fae[_0x8e97('0x4e')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x3]?_0x3b8fae[_0x8e97('0x41')][0x3][_0x8e97('0x44')]:undefined)||_0x8e97('0x4f')},{'name':'attrEmailAccounts','value':_0x3b8fae[_0x8e97('0x50')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x4]?_0x3b8fae[_0x8e97('0x41')][0x4]['value']:undefined)||''},{'name':_0x8e97('0x51'),'value':_0x3b8fae['attrFaxAccounts']||(_0x3b8fae['attrs']&&_0x3b8fae[_0x8e97('0x41')][0x5]?_0x3b8fae[_0x8e97('0x41')][0x5][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x52'),'value':_0x3b8fae[_0x8e97('0x52')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x6]?_0x3b8fae[_0x8e97('0x41')][0x6][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x53'),'value':_0x3b8fae[_0x8e97('0x53')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x7]?_0x3b8fae['attrs'][0x7][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x54'),'value':_0x3b8fae['attrWhatsappAccounts']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x8]?_0x3b8fae[_0x8e97('0x41')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x3b8fae[_0x8e97('0x55')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x9]?_0x3b8fae[_0x8e97('0x41')][0x9][_0x8e97('0x44')]:undefined)||''}];case _0x8e97('0x56'):case _0x8e97('0x57'):return[{'name':_0x8e97('0x58'),'value':_0x3b8fae[_0x8e97('0x58')]||(_0x3b8fae['attrs']&&_0x3b8fae['attrs'][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x44')]:undefined)||_0x8e97('0x4c')},{'name':_0x8e97('0x59'),'value':_0x3b8fae['attrSerie2']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x1]?_0x3b8fae['attrs'][0x1][_0x8e97('0x44')]:undefined)||null},{'name':_0x8e97('0x5a'),'value':_0x3b8fae[_0x8e97('0x5a')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x2]?_0x3b8fae[_0x8e97('0x41')][0x2]['value']:undefined)||null},{'name':_0x8e97('0x4d'),'value':_0x3b8fae[_0x8e97('0x4d')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x3]?_0x3b8fae[_0x8e97('0x41')][0x3]['value']:undefined)||[]},{'name':_0x8e97('0x4e'),'value':_0x3b8fae['attrChannel']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x4]?_0x3b8fae['attrs'][0x4][_0x8e97('0x44')]:undefined)||_0x8e97('0x4f')},{'name':_0x8e97('0x50'),'value':_0x3b8fae[_0x8e97('0x50')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x5]?_0x3b8fae[_0x8e97('0x41')][0x5][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x51'),'value':_0x3b8fae['attrFaxAccounts']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x6]?_0x3b8fae[_0x8e97('0x41')][0x6][_0x8e97('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3b8fae[_0x8e97('0x52')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x7]?_0x3b8fae[_0x8e97('0x41')][0x7][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x53'),'value':_0x3b8fae[_0x8e97('0x53')]||(_0x3b8fae['attrs']&&_0x3b8fae['attrs'][0x8]?_0x3b8fae['attrs'][0x8][_0x8e97('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3b8fae['attrWhatsappAccounts']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x9]?_0x3b8fae[_0x8e97('0x41')][0x9][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x55'),'value':_0x3b8fae['attrChatWebsites']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0xa]?_0x3b8fae[_0x8e97('0x41')][0xa][_0x8e97('0x44')]:undefined)||''}];case _0x8e97('0x5b'):return[{'name':_0x8e97('0x5c'),'type':_0x3b8fae['reportType']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x3f')]:undefined)||null,'value':_0x3b8fae[_0x8e97('0x5c')]||(_0x3b8fae['attrs']&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0]['value']:undefined)||null},{'name':_0x8e97('0x5d'),'value':_0x3b8fae[_0x8e97('0x5d')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x1]?_0x3b8fae['attrs'][0x1][_0x8e97('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x5ec6d5){logger[_0x8e97('0x2d')](_0x8e97('0x5e'),JSON['stringify'](_0x5ec6d5));return[];}}exports[_0x8e97('0x5f')]=function(_0x36eaa6,_0x32a851){if(_0x36eaa6[_0x8e97('0x60')]){_0x36eaa6[_0x8e97('0x60')][_0x8e97('0x41')]=widgetAttributes(_0x36eaa6[_0x8e97('0x60')]);}return db[_0x8e97('0x32')][_0x8e97('0x5f')](_0x36eaa6[_0x8e97('0x60')],{})[_0x8e97('0x29')](respondWithResult(_0x32a851,0xc9))[_0x8e97('0x3d')](handleError(_0x32a851,null));};exports[_0x8e97('0x28')]=function(_0x181e0f,_0x4f5dce){if(_0x181e0f[_0x8e97('0x60')]['id']){delete _0x181e0f[_0x8e97('0x60')]['id'];}_0x181e0f['body'][_0x8e97('0x41')]=widgetAttributes(_0x181e0f['body']);return db[_0x8e97('0x32')]['find']({'where':{'id':_0x181e0f[_0x8e97('0x3e')]['id']}})[_0x8e97('0x29')](handleEntityNotFound(_0x4f5dce,null))['then'](saveUpdates(_0x181e0f[_0x8e97('0x60')],null))['then'](respondWithResult(_0x4f5dce,null))[_0x8e97('0x3d')](handleError(_0x4f5dce,null));};
\ No newline at end of file
index 4761e32..e7a0a14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d11=['hook','exports','events','../../mysqldb','DashboardItem','save','remove','emit','hasOwnProperty'];(function(_0x487a8b,_0x569091){var _0x98f0b0=function(_0x4d2e7a){while(--_0x4d2e7a){_0x487a8b['push'](_0x487a8b['shift']());}};_0x98f0b0(++_0x569091);}(_0x6d11,0xbf));var _0x16d1=function(_0x2b0a93,_0x143777){_0x2b0a93=_0x2b0a93-0x0;var _0x5eba97=_0x6d11[_0x2b0a93];return _0x5eba97;};'use strict';var EventEmitter=require(_0x16d1('0x0'));var DashboardItem=require(_0x16d1('0x1'))['db'][_0x16d1('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16d1('0x3'),'afterUpdate':'update','afterDestroy':_0x16d1('0x4')};function emitEvent(_0x2e1a35){return function(_0x4bce83,_0x48754e,_0x3e0e86){DashboardItemEvents[_0x16d1('0x5')](_0x2e1a35+':'+_0x4bce83['id'],_0x4bce83);DashboardItemEvents[_0x16d1('0x5')](_0x2e1a35,_0x4bce83);_0x3e0e86(null);};}for(var e in events){if(events[_0x16d1('0x6')](e)){var event=events[e];DashboardItem[_0x16d1('0x7')](e,emitEvent(event));}}module[_0x16d1('0x8')]=DashboardItemEvents;
\ No newline at end of file
+var _0x50d4=['DashboardItem','setMaxListeners','save','update','remove','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4d919f,_0x5b0e3b){var _0x521be6=function(_0x283ce3){while(--_0x283ce3){_0x4d919f['push'](_0x4d919f['shift']());}};_0x521be6(++_0x5b0e3b);}(_0x50d4,0x181));var _0x450d=function(_0xed560e,_0x6f6c43){_0xed560e=_0xed560e-0x0;var _0x58f7ae=_0x50d4[_0xed560e];return _0x58f7ae;};'use strict';var EventEmitter=require(_0x450d('0x0'));var DashboardItem=require(_0x450d('0x1'))['db'][_0x450d('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x450d('0x3')](0x0);var events={'afterCreate':_0x450d('0x4'),'afterUpdate':_0x450d('0x5'),'afterDestroy':_0x450d('0x6')};function emitEvent(_0x1d79ef){return function(_0x373e7e,_0x28fab2,_0x390a89){DashboardItemEvents['emit'](_0x1d79ef+':'+_0x373e7e['id'],_0x373e7e);DashboardItemEvents['emit'](_0x1d79ef,_0x373e7e);_0x390a89(null);};}for(var e in events){if(events[_0x450d('0x7')](e)){var event=events[e];DashboardItem[_0x450d('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 1ccdf4d..c79b8ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9deb=['dashboard_items','util','api','bluebird','request-promise','path','rimraf','exports','define','DashboardItem'];(function(_0xe4190d,_0x459660){var _0x4499dc=function(_0xf859cf){while(--_0xf859cf){_0xe4190d['push'](_0xe4190d['shift']());}};_0x4499dc(++_0x459660);}(_0x9deb,0x12d));var _0xb9de=function(_0x4687a0,_0x25cac9){_0x4687a0=_0x4687a0-0x0;var _0x44f721=_0x9deb[_0x4687a0];return _0x44f721;};'use strict';var _=require('lodash');var util=require(_0xb9de('0x0'));var logger=require('../../config/logger')(_0xb9de('0x1'));var moment=require('moment');var BPromise=require(_0xb9de('0x2'));var rp=require(_0xb9de('0x3'));var fs=require('fs');var path=require(_0xb9de('0x4'));var rimraf=require(_0xb9de('0x5'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xb9de('0x6')]=function(_0x22f2fb,_0x1c0adf){return _0x22f2fb[_0xb9de('0x7')](_0xb9de('0x8'),attributes,{'tableName':_0xb9de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ac2=['path','rimraf','../../config/environment','./dashboardItem.attributes','define','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0x1ac2,0xfd));var _0x21ac=function(_0xf320a5,_0xd3dd98){_0xf320a5=_0xf320a5-0x0;var _0x2bfed3=_0x1ac2[_0xf320a5];return _0x2bfed3;};'use strict';var _=require(_0x21ac('0x0'));var util=require(_0x21ac('0x1'));var logger=require(_0x21ac('0x2'))(_0x21ac('0x3'));var moment=require(_0x21ac('0x4'));var BPromise=require(_0x21ac('0x5'));var rp=require(_0x21ac('0x6'));var fs=require('fs');var path=require(_0x21ac('0x7'));var rimraf=require(_0x21ac('0x8'));var config=require(_0x21ac('0x9'));var attributes=require(_0x21ac('0xa'));module['exports']=function(_0x3d9cc8,_0x142e2e){return _0x3d9cc8[_0x21ac('0xb')]('DashboardItem',attributes,{'tableName':_0x21ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5ee222a..d4bdb0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3f5=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x385131,_0x254af9){var _0x20fcef=function(_0x4d237f){while(--_0x4d237f){_0x385131['push'](_0x385131['shift']());}};_0x20fcef(++_0x254af9);}(_0xf3f5,0x114));var _0x5f3f=function(_0x36b210,_0x209666){_0x36b210=_0x36b210-0x0;var _0x56fee6=_0xf3f5[_0x36b210];return _0x56fee6;};'use strict';var _=require(_0x5f3f('0x0'));var util=require(_0x5f3f('0x1'));var moment=require(_0x5f3f('0x2'));var BPromise=require(_0x5f3f('0x3'));var rs=require(_0x5f3f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f3f('0x5'))['db'];var utils=require(_0x5f3f('0x6'));var logger=require('../../config/logger')(_0x5f3f('0x7'));var config=require('../../config/environment');var jayson=require(_0x5f3f('0x8'));var client=jayson[_0x5f3f('0x9')][_0x5f3f('0xa')]({'port':0x232a});config[_0x5f3f('0xb')]=_[_0x5f3f('0xc')](config['redis'],{'host':_0x5f3f('0xd'),'port':0x18eb});var socket=require(_0x5f3f('0xe'))(new Redis(config['redis']));require(_0x5f3f('0xf'))[_0x5f3f('0x10')](socket);function respondWithRpcPromise(_0x404217,_0x9ecbe0,_0x4b3da3){return new BPromise(function(_0x2d0ced,_0xfe58a6){return client[_0x5f3f('0x11')](_0x404217,_0x4b3da3)[_0x5f3f('0x12')](function(_0x1febb7){logger['info']('DashboardItem,\x20%s,\x20%s',_0x9ecbe0,'request\x20sent');logger[_0x5f3f('0x13')](_0x5f3f('0x14'),_0x9ecbe0,'request\x20sent',JSON[_0x5f3f('0x15')](_0x1febb7));if(_0x1febb7[_0x5f3f('0x16')]){if(_0x1febb7[_0x5f3f('0x16')][_0x5f3f('0x17')]===0x1f4){logger[_0x5f3f('0x16')](_0x5f3f('0x18'),_0x9ecbe0,_0x1febb7[_0x5f3f('0x16')]['message']);return _0xfe58a6(_0x1febb7[_0x5f3f('0x16')]['message']);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x9ecbe0,_0x1febb7[_0x5f3f('0x16')][_0x5f3f('0x19')]);return _0x2d0ced(_0x1febb7[_0x5f3f('0x16')][_0x5f3f('0x19')]);}else{logger['info'](_0x5f3f('0x18'),_0x9ecbe0,'request\x20sent');_0x2d0ced(_0x1febb7[_0x5f3f('0x1a')][_0x5f3f('0x19')]);}})[_0x5f3f('0x1b')](function(_0x4f42a1){logger['error'](_0x5f3f('0x18'),_0x9ecbe0,_0x4f42a1);_0xfe58a6(_0x4f42a1);});});}
\ No newline at end of file
+var _0xb6cc=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x1163c3,_0x3aedc6){var _0x7a7cb5=function(_0x2e4054){while(--_0x2e4054){_0x1163c3['push'](_0x1163c3['shift']());}};_0x7a7cb5(++_0x3aedc6);}(_0xb6cc,0xc8));var _0xcb6c=function(_0x36e7cd,_0x50b6b6){_0x36e7cd=_0x36e7cd-0x0;var _0x48aa0c=_0xb6cc[_0x36e7cd];return _0x48aa0c;};'use strict';var _=require(_0xcb6c('0x0'));var util=require(_0xcb6c('0x1'));var moment=require(_0xcb6c('0x2'));var BPromise=require(_0xcb6c('0x3'));var rs=require(_0xcb6c('0x4'));var fs=require('fs');var Redis=require(_0xcb6c('0x5'));var db=require(_0xcb6c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcb6c('0x7'));var config=require(_0xcb6c('0x8'));var jayson=require(_0xcb6c('0x9'));var client=jayson[_0xcb6c('0xa')]['http']({'port':0x232a});config[_0xcb6c('0xb')]=_[_0xcb6c('0xc')](config['redis'],{'host':_0xcb6c('0xd'),'port':0x18eb});var socket=require(_0xcb6c('0xe'))(new Redis(config[_0xcb6c('0xb')]));require(_0xcb6c('0xf'))['register'](socket);function respondWithRpcPromise(_0x259ec2,_0x176eb1,_0x40c2ac){return new BPromise(function(_0x108973,_0xe37be){return client['request'](_0x259ec2,_0x40c2ac)[_0xcb6c('0x10')](function(_0xba58f4){logger[_0xcb6c('0x11')](_0xcb6c('0x12'),_0x176eb1,_0xcb6c('0x13'));logger[_0xcb6c('0x14')](_0xcb6c('0x15'),_0x176eb1,_0xcb6c('0x13'),JSON[_0xcb6c('0x16')](_0xba58f4));if(_0xba58f4[_0xcb6c('0x17')]){if(_0xba58f4['error']['code']===0x1f4){logger['error'](_0xcb6c('0x12'),_0x176eb1,_0xba58f4[_0xcb6c('0x17')][_0xcb6c('0x18')]);return _0xe37be(_0xba58f4['error'][_0xcb6c('0x18')]);}logger[_0xcb6c('0x17')]('DashboardItem,\x20%s,\x20%s',_0x176eb1,_0xba58f4[_0xcb6c('0x17')][_0xcb6c('0x18')]);return _0x108973(_0xba58f4[_0xcb6c('0x17')]['message']);}else{logger[_0xcb6c('0x11')](_0xcb6c('0x12'),_0x176eb1,_0xcb6c('0x13'));_0x108973(_0xba58f4[_0xcb6c('0x19')][_0xcb6c('0x18')]);}})['catch'](function(_0x57091b){logger['error'](_0xcb6c('0x12'),_0x176eb1,_0x57091b);_0xe37be(_0x57091b);});});}
\ No newline at end of file
index 7421753..281e265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c9f=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x3c9f,0x104));var _0xf3c9=function(_0x63733c,_0x5e2480){_0x63733c=_0x63733c-0x0;var _0x217afa=_0x3c9f[_0x63733c];return _0x217afa;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xf3c9('0x0'),_0xf3c9('0x1'),_0xf3c9('0x2')];function createListener(_0x511550,_0x3e813b){return function(_0x3a9811){_0x3e813b[_0xf3c9('0x3')](_0x511550,_0x3a9811);};}function removeListener(_0x3a60bf,_0x350cd8){return function(){DashboardItemEvents[_0xf3c9('0x4')](_0x3a60bf,_0x350cd8);};}exports[_0xf3c9('0x5')]=function(_0x47cfaf){for(var _0x4485f0=0x0,_0x4f15fe=events[_0xf3c9('0x6')];_0x4485f0<_0x4f15fe;_0x4485f0++){var _0x5c20d6=events[_0x4485f0];var _0x46555a=createListener(_0xf3c9('0x7')+_0x5c20d6,_0x47cfaf);DashboardItemEvents['on'](_0x5c20d6,_0x46555a);}};
\ No newline at end of file
+var _0x96d0=['save','remove','emit','register','length','dashboardItem:'];(function(_0x5e343c,_0x5d5c6a){var _0x497243=function(_0x49bcda){while(--_0x49bcda){_0x5e343c['push'](_0x5e343c['shift']());}};_0x497243(++_0x5d5c6a);}(_0x96d0,0xea));var _0x096d=function(_0x560684,_0x4fe7fd){_0x560684=_0x560684-0x0;var _0x51ec93=_0x96d0[_0x560684];return _0x51ec93;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x096d('0x0'),_0x096d('0x1'),'update'];function createListener(_0x20b820,_0x5318b0){return function(_0xfa768f){_0x5318b0[_0x096d('0x2')](_0x20b820,_0xfa768f);};}function removeListener(_0x3224b8,_0x548db7){return function(){DashboardItemEvents['removeListener'](_0x3224b8,_0x548db7);};}exports[_0x096d('0x3')]=function(_0x45097c){for(var _0x10b155=0x0,_0x1eb3f9=events[_0x096d('0x4')];_0x10b155<_0x1eb3f9;_0x10b155++){var _0x1792b3=events[_0x10b155];var _0x3253ce=createListener(_0x096d('0x5')+_0x1792b3,_0x45097c);DashboardItemEvents['on'](_0x1792b3,_0x3253ce);}};
\ No newline at end of file
index 83741a3..113b761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a1=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./dashboardItem.controller','/:id','show','create','put','isAuthenticated','delete'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xa8a1,0x13c));var _0x1a8a=function(_0x8741ac,_0x221589){_0x8741ac=_0x8741ac-0x0;var _0xfe2dc=_0xa8a1[_0x8741ac];return _0xfe2dc;};'use strict';var multer=require(_0x1a8a('0x0'));var util=require(_0x1a8a('0x1'));var path=require('path');var timeout=require(_0x1a8a('0x2'));var express=require(_0x1a8a('0x3'));var router=express[_0x1a8a('0x4')]();var fs_extra=require(_0x1a8a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a8a('0x6'));var controller=require(_0x1a8a('0x7'));router['get'](_0x1a8a('0x8'),auth['isAuthenticated'](),controller[_0x1a8a('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a8a('0xa')]);router[_0x1a8a('0xb')](_0x1a8a('0x8'),auth[_0x1a8a('0xc')](),controller['update']);router[_0x1a8a('0xd')](_0x1a8a('0x8'),auth[_0x1a8a('0xc')](),controller['destroy']);module[_0x1a8a('0xe')]=router;
\ No newline at end of file
+var _0x165d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','destroy','exports','multer','path'];(function(_0x17ef0c,_0x4c932f){var _0x223793=function(_0x3b0426){while(--_0x3b0426){_0x17ef0c['push'](_0x17ef0c['shift']());}};_0x223793(++_0x4c932f);}(_0x165d,0x142));var _0xd165=function(_0x1408f1,_0x235cbf){_0x1408f1=_0x1408f1-0x0;var _0x273976=_0x165d[_0x1408f1];return _0x273976;};'use strict';var multer=require(_0xd165('0x0'));var util=require('util');var path=require(_0xd165('0x1'));var timeout=require(_0xd165('0x2'));var express=require(_0xd165('0x3'));var router=express[_0xd165('0x4')]();var fs_extra=require(_0xd165('0x5'));var auth=require(_0xd165('0x6'));var interaction=require(_0xd165('0x7'));var config=require(_0xd165('0x8'));var controller=require(_0xd165('0x9'));router[_0xd165('0xa')](_0xd165('0xb'),auth[_0xd165('0xc')](),controller[_0xd165('0xd')]);router[_0xd165('0xe')]('/',auth[_0xd165('0xc')](),controller[_0xd165('0xf')]);router['put'](_0xd165('0xb'),auth[_0xd165('0xc')](),controller['update']);router['delete'](_0xd165('0xb'),auth['isAuthenticated'](),controller[_0xd165('0x10')]);module[_0xd165('0x11')]=router;
\ No newline at end of file
index 44626fa..320b13f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadcf=['second','STRING','sequelize','exports','ENUM','first'];(function(_0x1c6e79,_0x526d7f){var _0x302dad=function(_0x397889){while(--_0x397889){_0x1c6e79['push'](_0x1c6e79['shift']());}};_0x302dad(++_0x526d7f);}(_0xadcf,0x7a));var _0xfadc=function(_0x33692e,_0x12b5b0){_0x33692e=_0x33692e-0x0;var _0x5966e3=_0xadcf[_0x33692e];return _0x5966e3;};'use strict';var Sequelize=require(_0xfadc('0x0'));module[_0xfadc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xfadc('0x2')](_0xfadc('0x3'),_0xfadc('0x4'),'third'),'allowNull':![],'defaultValue':_0xfadc('0x3')},'description':{'type':Sequelize[_0xfadc('0x5')]}};
\ No newline at end of file
+var _0xdb2a=['first','second','sequelize','STRING'];(function(_0x3c29cb,_0x1aa693){var _0x137314=function(_0x585a8c){while(--_0x585a8c){_0x3c29cb['push'](_0x3c29cb['shift']());}};_0x137314(++_0x1aa693);}(_0xdb2a,0xd2));var _0xadb2=function(_0x1c67f2,_0x179a4c){_0x1c67f2=_0x1c67f2-0x0;var _0x24402d=_0xdb2a[_0x1c67f2];return _0x24402d;};'use strict';var Sequelize=require(_0xadb2('0x0'));module['exports']={'name':{'type':Sequelize[_0xadb2('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xadb2('0x2'),_0xadb2('0x3'),'third'),'allowNull':![],'defaultValue':_0xadb2('0x2')},'description':{'type':Sequelize[_0xadb2('0x1')]}};
\ No newline at end of file
index 09af63f..054bb45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89a1=['error','stack','name','index','Disposition','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Dispositions','UserProfileResource'];(function(_0x3ad2be,_0x36fe53){var _0xefbd6a=function(_0x358fb9){while(--_0x358fb9){_0x3ad2be['push'](_0x3ad2be['shift']());}};_0xefbd6a(++_0x36fe53);}(_0x89a1,0x1db));var _0x189a=function(_0x49287d,_0x2aca01){_0x49287d=_0x49287d-0x0;var _0x2633a5=_0x89a1[_0x49287d];return _0x2633a5;};'use strict';var emlformat=require(_0x189a('0x0'));var rimraf=require(_0x189a('0x1'));var zipdir=require(_0x189a('0x2'));var jsonpatch=require(_0x189a('0x3'));var rp=require(_0x189a('0x4'));var moment=require(_0x189a('0x5'));var BPromise=require(_0x189a('0x6'));var Mustache=require(_0x189a('0x7'));var util=require(_0x189a('0x8'));var path=require(_0x189a('0x9'));var sox=require(_0x189a('0xa'));var csv=require(_0x189a('0xb'));var ejs=require(_0x189a('0xc'));var fs=require('fs');var fs_extra=require(_0x189a('0xd'));var _=require(_0x189a('0xe'));var squel=require(_0x189a('0xf'));var crypto=require(_0x189a('0x10'));var jsforce=require(_0x189a('0x11'));var deskjs=require(_0x189a('0x12'));var toCsv=require(_0x189a('0xb'));var querystring=require('querystring');var Papa=require(_0x189a('0x13'));var Redis=require(_0x189a('0x14'));var authService=require(_0x189a('0x15'));var qs=require(_0x189a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x189a('0x17'));var logger=require(_0x189a('0x18'))(_0x189a('0x19'));var utils=require(_0x189a('0x1a'));var config=require(_0x189a('0x1b'));var licenseUtil=require(_0x189a('0x1c'));var db=require(_0x189a('0x1d'))['db'];function respondWithStatusCode(_0x5c9cbd,_0x5d824e){_0x5d824e=_0x5d824e||0xcc;return function(_0x4e3c1b){if(_0x4e3c1b){return _0x5c9cbd[_0x189a('0x1e')](_0x5d824e);}return _0x5c9cbd[_0x189a('0x1f')](_0x5d824e)[_0x189a('0x20')]();};}function respondWithResult(_0xe22296,_0x2e0917){_0x2e0917=_0x2e0917||0xc8;return function(_0x5d0be8){if(_0x5d0be8){return _0xe22296[_0x189a('0x1f')](_0x2e0917)[_0x189a('0x21')](_0x5d0be8);}};}function respondWithFilteredResult(_0x7c9909,_0x1e2b1b){return function(_0x1fbc2b){if(_0x1fbc2b){var _0x57d55a=typeof _0x1e2b1b[_0x189a('0x22')]===_0x189a('0x23')&&typeof _0x1e2b1b[_0x189a('0x24')]==='undefined';var _0x1eaad8=_0x1fbc2b[_0x189a('0x25')];var _0x447639=_0x57d55a?0x0:_0x1e2b1b[_0x189a('0x22')];var _0x110a25=_0x57d55a?_0x1fbc2b[_0x189a('0x25')]:_0x1e2b1b[_0x189a('0x22')]+_0x1e2b1b[_0x189a('0x24')];var _0x4057cb;if(_0x110a25>=_0x1eaad8){_0x110a25=_0x1eaad8;_0x4057cb=0xc8;}else{_0x4057cb=0xce;}_0x7c9909['status'](_0x4057cb);return _0x7c9909[_0x189a('0x26')](_0x189a('0x27'),_0x447639+'-'+_0x110a25+'/'+_0x1eaad8)[_0x189a('0x21')](_0x1fbc2b);}return null;};}function patchUpdates(_0x1e1ae7){return function(_0x4f4c84){try{jsonpatch[_0x189a('0x28')](_0x4f4c84,_0x1e1ae7,!![]);}catch(_0x44dc29){return BPromise['reject'](_0x44dc29);}return _0x4f4c84[_0x189a('0x29')]();};}function saveUpdates(_0x3679cc,_0x25b622){return function(_0x3fffaa){if(_0x3fffaa){return _0x3fffaa[_0x189a('0x2a')](_0x3679cc)[_0x189a('0x2b')](function(_0x2aaa79){return _0x2aaa79;});}return null;};}function removeEntity(_0x5d8e2c,_0x328e53){return function(_0x40c815){if(_0x40c815){return _0x40c815[_0x189a('0x2c')]()[_0x189a('0x2b')](function(){var _0x14dc56=_0x40c815['get']({'plain':!![]});var _0x302bf2=_0x189a('0x2d');return db[_0x189a('0x2e')]['destroy']({'where':{'type':_0x302bf2,'resourceId':_0x14dc56['id']}})[_0x189a('0x2b')](function(){return _0x40c815;});})[_0x189a('0x2b')](function(){_0x5d8e2c[_0x189a('0x1f')](0xcc)[_0x189a('0x20')]();});}};}function handleEntityNotFound(_0x403bee,_0x18c148){return function(_0x1ee335){if(!_0x1ee335){_0x403bee['sendStatus'](0x194);}return _0x1ee335;};}function handleError(_0x4b63c6,_0x2cded7){_0x2cded7=_0x2cded7||0x1f4;return function(_0x250069){logger[_0x189a('0x2f')](_0x250069[_0x189a('0x30')]);if(_0x250069[_0x189a('0x31')]){delete _0x250069[_0x189a('0x31')];}_0x4b63c6[_0x189a('0x1f')](_0x2cded7)['send'](_0x250069);};}exports[_0x189a('0x32')]=function(_0x26aa4d,_0xbacae1){var _0x4f7d11={},_0x5ccae7={},_0x2a6397={'count':0x0,'rows':[]};var _0x13bbd6=_['map'](db[_0x189a('0x33')][_0x189a('0x34')],function(_0xed6e77){return{'name':_0xed6e77[_0x189a('0x35')],'type':_0xed6e77[_0x189a('0x36')][_0x189a('0x37')]};});_0x5ccae7['model']=_[_0x189a('0x38')](_0x13bbd6,_0x189a('0x31'));_0x5ccae7[_0x189a('0x39')]=_[_0x189a('0x3a')](_0x26aa4d[_0x189a('0x39')]);_0x5ccae7[_0x189a('0x3b')]=_[_0x189a('0x3c')](_0x5ccae7[_0x189a('0x3d')],_0x5ccae7[_0x189a('0x39')]);_0x4f7d11[_0x189a('0x3e')]=_[_0x189a('0x3c')](_0x5ccae7[_0x189a('0x3d')],qs['fields'](_0x26aa4d[_0x189a('0x39')][_0x189a('0x3f')]));_0x4f7d11[_0x189a('0x3e')]=_0x4f7d11[_0x189a('0x3e')][_0x189a('0x40')]?_0x4f7d11[_0x189a('0x3e')]:_0x5ccae7[_0x189a('0x3d')];if(!_0x26aa4d[_0x189a('0x39')][_0x189a('0x41')](_0x189a('0x42'))){_0x4f7d11['limit']=qs[_0x189a('0x24')](_0x26aa4d[_0x189a('0x39')][_0x189a('0x24')]);_0x4f7d11[_0x189a('0x22')]=qs['offset'](_0x26aa4d[_0x189a('0x39')][_0x189a('0x22')]);}_0x4f7d11['order']=qs['sort'](_0x26aa4d[_0x189a('0x39')][_0x189a('0x43')]);_0x4f7d11[_0x189a('0x44')]=qs[_0x189a('0x3b')](_['pick'](_0x26aa4d[_0x189a('0x39')],_0x5ccae7['filters']),_0x13bbd6);if(_0x26aa4d[_0x189a('0x39')][_0x189a('0x45')]){_0x4f7d11['where']=_[_0x189a('0x46')](_0x4f7d11[_0x189a('0x44')],{'$or':_[_0x189a('0x38')](_0x13bbd6,function(_0x4aa109){if(_0x4aa109[_0x189a('0x36')]!=='VIRTUAL'){var _0x45adaf={};_0x45adaf[_0x4aa109['name']]={'$like':'%'+_0x26aa4d[_0x189a('0x39')][_0x189a('0x45')]+'%'};return _0x45adaf;}})});}_0x4f7d11=_[_0x189a('0x46')]({},_0x4f7d11,_0x26aa4d[_0x189a('0x47')]);var _0x48aede={'where':_0x4f7d11[_0x189a('0x44')]};return db[_0x189a('0x33')]['count'](_0x48aede)['then'](function(_0x11ff1b){_0x2a6397[_0x189a('0x25')]=_0x11ff1b;if(_0x26aa4d[_0x189a('0x39')][_0x189a('0x48')]){_0x4f7d11[_0x189a('0x49')]=[{'all':!![]}];}return db[_0x189a('0x33')]['findAll'](_0x4f7d11);})['then'](function(_0xe038c8){_0x2a6397[_0x189a('0x4a')]=_0xe038c8;return _0x2a6397;})[_0x189a('0x2b')](respondWithFilteredResult(_0xbacae1,_0x4f7d11))[_0x189a('0x4b')](handleError(_0xbacae1,null));};exports['show']=function(_0x32175c,_0xd83441){var _0x183027={'raw':!![],'where':{'id':_0x32175c[_0x189a('0x4c')]['id']}},_0x2189db={};_0x2189db['model']=_[_0x189a('0x3a')](db['Disposition']['rawAttributes']);_0x2189db['query']=_[_0x189a('0x3a')](_0x32175c['query']);_0x2189db['filters']=_[_0x189a('0x3c')](_0x2189db['model'],_0x2189db[_0x189a('0x39')]);_0x183027[_0x189a('0x3e')]=_['intersection'](_0x2189db[_0x189a('0x3d')],qs[_0x189a('0x3f')](_0x32175c[_0x189a('0x39')][_0x189a('0x3f')]));_0x183027['attributes']=_0x183027['attributes'][_0x189a('0x40')]?_0x183027[_0x189a('0x3e')]:_0x2189db[_0x189a('0x3d')];if(_0x32175c[_0x189a('0x39')][_0x189a('0x48')]){_0x183027[_0x189a('0x49')]=[{'all':!![]}];}_0x183027=_['merge']({},_0x183027,_0x32175c[_0x189a('0x47')]);return db['Disposition']['find'](_0x183027)[_0x189a('0x2b')](handleEntityNotFound(_0xd83441,null))[_0x189a('0x2b')](respondWithResult(_0xd83441,null))['catch'](handleError(_0xd83441,null));};exports[_0x189a('0x4d')]=function(_0x232e03,_0x30c1dd){return db['Disposition'][_0x189a('0x4d')](_0x232e03[_0x189a('0x4e')],{})['then'](function(_0x4ae0cb){var _0x36d9a4=_0x232e03[_0x189a('0x4f')][_0x189a('0x50')]({'plain':!![]});if(!_0x36d9a4)throw new Error(_0x189a('0x51'));if(_0x36d9a4[_0x189a('0x52')]===_0x189a('0x4f')){var _0x15d83a=_0x4ae0cb[_0x189a('0x50')]({'plain':!![]});var _0x538b98=_0x189a('0x2d');return db[_0x189a('0x53')][_0x189a('0x54')]({'where':{'name':_0x538b98,'userProfileId':_0x36d9a4[_0x189a('0x55')]},'raw':!![]})['then'](function(_0x2c2b89){if(_0x2c2b89&&_0x2c2b89['autoAssociation']===0x0){return db[_0x189a('0x2e')][_0x189a('0x4d')]({'name':_0x15d83a[_0x189a('0x31')],'resourceId':_0x15d83a['id'],'type':_0x2c2b89[_0x189a('0x31')],'sectionId':_0x2c2b89['id']},{})[_0x189a('0x2b')](function(){return _0x4ae0cb;});}else{return _0x4ae0cb;}})[_0x189a('0x4b')](function(_0xb654){logger[_0x189a('0x2f')](_0x189a('0x56'),_0xb654);throw _0xb654;});}return _0x4ae0cb;})['then'](respondWithResult(_0x30c1dd,0xc9))[_0x189a('0x4b')](handleError(_0x30c1dd,null));};exports[_0x189a('0x2a')]=function(_0x2277c2,_0x304289){if(_0x2277c2[_0x189a('0x4e')]['id']){delete _0x2277c2[_0x189a('0x4e')]['id'];}return db['Disposition']['find']({'where':{'id':_0x2277c2[_0x189a('0x4c')]['id']}})[_0x189a('0x2b')](handleEntityNotFound(_0x304289,null))[_0x189a('0x2b')](saveUpdates(_0x2277c2[_0x189a('0x4e')],null))[_0x189a('0x2b')](respondWithResult(_0x304289,null))['catch'](handleError(_0x304289,null));};exports[_0x189a('0x2c')]=function(_0x412a61,_0x404e77){return db[_0x189a('0x33')][_0x189a('0x54')]({'where':{'id':_0x412a61[_0x189a('0x4c')]['id']}})[_0x189a('0x2b')](handleEntityNotFound(_0x404e77,null))[_0x189a('0x2b')](removeEntity(_0x404e77,null))[_0x189a('0x4b')](handleError(_0x404e77,null));};
\ No newline at end of file
+var _0x53ae=['../../components/parsers/qs','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Dispositions','destroy','name','map','Disposition','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','rawAttributes','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x280924,_0xd36640){var _0x4d8eda=function(_0x32915e){while(--_0x32915e){_0x280924['push'](_0x280924['shift']());}};_0x4d8eda(++_0xd36640);}(_0x53ae,0x133));var _0xe53a=function(_0x3ab392,_0xb5e4fd){_0x3ab392=_0x3ab392-0x0;var _0x1e0a71=_0x53ae[_0x3ab392];return _0x1e0a71;};'use strict';var emlformat=require(_0xe53a('0x0'));var rimraf=require(_0xe53a('0x1'));var zipdir=require(_0xe53a('0x2'));var jsonpatch=require(_0xe53a('0x3'));var rp=require(_0xe53a('0x4'));var moment=require(_0xe53a('0x5'));var BPromise=require(_0xe53a('0x6'));var Mustache=require(_0xe53a('0x7'));var util=require(_0xe53a('0x8'));var path=require(_0xe53a('0x9'));var sox=require(_0xe53a('0xa'));var csv=require(_0xe53a('0xb'));var ejs=require(_0xe53a('0xc'));var fs=require('fs');var fs_extra=require(_0xe53a('0xd'));var _=require(_0xe53a('0xe'));var squel=require('squel');var crypto=require(_0xe53a('0xf'));var jsforce=require(_0xe53a('0x10'));var deskjs=require(_0xe53a('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe53a('0x12'));var Papa=require('papaparse');var Redis=require(_0xe53a('0x13'));var authService=require(_0xe53a('0x14'));var qs=require(_0xe53a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe53a('0x16'));var db=require(_0xe53a('0x17'))['db'];function respondWithStatusCode(_0x151257,_0x5b79db){_0x5b79db=_0x5b79db||0xcc;return function(_0xe19030){if(_0xe19030){return _0x151257[_0xe53a('0x18')](_0x5b79db);}return _0x151257[_0xe53a('0x19')](_0x5b79db)[_0xe53a('0x1a')]();};}function respondWithResult(_0x29d8bd,_0x2236c9){_0x2236c9=_0x2236c9||0xc8;return function(_0x1b1a46){if(_0x1b1a46){return _0x29d8bd[_0xe53a('0x19')](_0x2236c9)[_0xe53a('0x1b')](_0x1b1a46);}};}function respondWithFilteredResult(_0x583ae6,_0xff5857){return function(_0x442218){if(_0x442218){var _0x4740c6=typeof _0xff5857[_0xe53a('0x1c')]===_0xe53a('0x1d')&&typeof _0xff5857[_0xe53a('0x1e')]===_0xe53a('0x1d');var _0x1f6679=_0x442218['count'];var _0x22ef78=_0x4740c6?0x0:_0xff5857[_0xe53a('0x1c')];var _0x23c12c=_0x4740c6?_0x442218[_0xe53a('0x1f')]:_0xff5857[_0xe53a('0x1c')]+_0xff5857['limit'];var _0x2ffb03;if(_0x23c12c>=_0x1f6679){_0x23c12c=_0x1f6679;_0x2ffb03=0xc8;}else{_0x2ffb03=0xce;}_0x583ae6['status'](_0x2ffb03);return _0x583ae6[_0xe53a('0x20')](_0xe53a('0x21'),_0x22ef78+'-'+_0x23c12c+'/'+_0x1f6679)['json'](_0x442218);}return null;};}function patchUpdates(_0x2717f9){return function(_0x483cd0){try{jsonpatch['apply'](_0x483cd0,_0x2717f9,!![]);}catch(_0x1bc197){return BPromise[_0xe53a('0x22')](_0x1bc197);}return _0x483cd0[_0xe53a('0x23')]();};}function saveUpdates(_0x1cb698,_0x3ed116){return function(_0x4f9c6b){if(_0x4f9c6b){return _0x4f9c6b[_0xe53a('0x24')](_0x1cb698)[_0xe53a('0x25')](function(_0x479a90){return _0x479a90;});}return null;};}function removeEntity(_0xe790fe,_0x1bc313){return function(_0x393263){if(_0x393263){return _0x393263['destroy']()['then'](function(){var _0x36add6=_0x393263[_0xe53a('0x26')]({'plain':!![]});var _0x6b5f3b=_0xe53a('0x27');return db['UserProfileResource'][_0xe53a('0x28')]({'where':{'type':_0x6b5f3b,'resourceId':_0x36add6['id']}})[_0xe53a('0x25')](function(){return _0x393263;});})[_0xe53a('0x25')](function(){_0xe790fe[_0xe53a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54111,_0x48bc7e){return function(_0x1fa929){if(!_0x1fa929){_0x54111[_0xe53a('0x18')](0x194);}return _0x1fa929;};}function handleError(_0x3387a7,_0x297eeb){_0x297eeb=_0x297eeb||0x1f4;return function(_0x230914){logger['error'](_0x230914['stack']);if(_0x230914[_0xe53a('0x29')]){delete _0x230914['name'];}_0x3387a7[_0xe53a('0x19')](_0x297eeb)['send'](_0x230914);};}exports['index']=function(_0x57dad2,_0x122f43){var _0x5b0bb7={},_0x273e80={},_0x2f5f9c={'count':0x0,'rows':[]};var _0x1bc4f8=_[_0xe53a('0x2a')](db[_0xe53a('0x2b')]['rawAttributes'],function(_0x1ae11d){return{'name':_0x1ae11d[_0xe53a('0x2c')],'type':_0x1ae11d[_0xe53a('0x2d')][_0xe53a('0x2e')]};});_0x273e80[_0xe53a('0x2f')]=_[_0xe53a('0x2a')](_0x1bc4f8,_0xe53a('0x29'));_0x273e80[_0xe53a('0x30')]=_[_0xe53a('0x31')](_0x57dad2[_0xe53a('0x30')]);_0x273e80['filters']=_['intersection'](_0x273e80[_0xe53a('0x2f')],_0x273e80[_0xe53a('0x30')]);_0x5b0bb7[_0xe53a('0x32')]=_[_0xe53a('0x33')](_0x273e80[_0xe53a('0x2f')],qs[_0xe53a('0x34')](_0x57dad2[_0xe53a('0x30')]['fields']));_0x5b0bb7['attributes']=_0x5b0bb7['attributes']['length']?_0x5b0bb7[_0xe53a('0x32')]:_0x273e80[_0xe53a('0x2f')];if(!_0x57dad2['query'][_0xe53a('0x35')](_0xe53a('0x36'))){_0x5b0bb7[_0xe53a('0x1e')]=qs[_0xe53a('0x1e')](_0x57dad2[_0xe53a('0x30')]['limit']);_0x5b0bb7[_0xe53a('0x1c')]=qs[_0xe53a('0x1c')](_0x57dad2[_0xe53a('0x30')][_0xe53a('0x1c')]);}_0x5b0bb7[_0xe53a('0x37')]=qs[_0xe53a('0x38')](_0x57dad2[_0xe53a('0x30')][_0xe53a('0x38')]);_0x5b0bb7[_0xe53a('0x39')]=qs[_0xe53a('0x3a')](_[_0xe53a('0x3b')](_0x57dad2[_0xe53a('0x30')],_0x273e80[_0xe53a('0x3a')]),_0x1bc4f8);if(_0x57dad2[_0xe53a('0x30')][_0xe53a('0x3c')]){_0x5b0bb7[_0xe53a('0x39')]=_['merge'](_0x5b0bb7['where'],{'$or':_[_0xe53a('0x2a')](_0x1bc4f8,function(_0x4d0a6c){if(_0x4d0a6c[_0xe53a('0x2d')]!==_0xe53a('0x3d')){var _0x3b7212={};_0x3b7212[_0x4d0a6c[_0xe53a('0x29')]]={'$like':'%'+_0x57dad2[_0xe53a('0x30')][_0xe53a('0x3c')]+'%'};return _0x3b7212;}})});}_0x5b0bb7=_[_0xe53a('0x3e')]({},_0x5b0bb7,_0x57dad2[_0xe53a('0x3f')]);var _0x45700d={'where':_0x5b0bb7[_0xe53a('0x39')]};return db[_0xe53a('0x2b')][_0xe53a('0x1f')](_0x45700d)[_0xe53a('0x25')](function(_0x1419e5){_0x2f5f9c[_0xe53a('0x1f')]=_0x1419e5;if(_0x57dad2[_0xe53a('0x30')][_0xe53a('0x40')]){_0x5b0bb7['include']=[{'all':!![]}];}return db[_0xe53a('0x2b')][_0xe53a('0x41')](_0x5b0bb7);})['then'](function(_0x1c0f3b){_0x2f5f9c[_0xe53a('0x42')]=_0x1c0f3b;return _0x2f5f9c;})[_0xe53a('0x25')](respondWithFilteredResult(_0x122f43,_0x5b0bb7))['catch'](handleError(_0x122f43,null));};exports['show']=function(_0x833bc5,_0xa51acb){var _0x539e4b={'raw':!![],'where':{'id':_0x833bc5['params']['id']}},_0x551c6b={};_0x551c6b[_0xe53a('0x2f')]=_[_0xe53a('0x31')](db[_0xe53a('0x2b')][_0xe53a('0x43')]);_0x551c6b[_0xe53a('0x30')]=_[_0xe53a('0x31')](_0x833bc5[_0xe53a('0x30')]);_0x551c6b['filters']=_[_0xe53a('0x33')](_0x551c6b['model'],_0x551c6b[_0xe53a('0x30')]);_0x539e4b[_0xe53a('0x32')]=_['intersection'](_0x551c6b[_0xe53a('0x2f')],qs[_0xe53a('0x34')](_0x833bc5[_0xe53a('0x30')]['fields']));_0x539e4b[_0xe53a('0x32')]=_0x539e4b[_0xe53a('0x32')]['length']?_0x539e4b[_0xe53a('0x32')]:_0x551c6b[_0xe53a('0x2f')];if(_0x833bc5[_0xe53a('0x30')][_0xe53a('0x40')]){_0x539e4b[_0xe53a('0x44')]=[{'all':!![]}];}_0x539e4b=_[_0xe53a('0x3e')]({},_0x539e4b,_0x833bc5['options']);return db['Disposition'][_0xe53a('0x45')](_0x539e4b)[_0xe53a('0x25')](handleEntityNotFound(_0xa51acb,null))['then'](respondWithResult(_0xa51acb,null))[_0xe53a('0x46')](handleError(_0xa51acb,null));};exports[_0xe53a('0x47')]=function(_0x3ca424,_0x2e4d06){return db[_0xe53a('0x2b')][_0xe53a('0x47')](_0x3ca424['body'],{})[_0xe53a('0x25')](function(_0x301803){var _0x2329ca=_0x3ca424[_0xe53a('0x48')][_0xe53a('0x26')]({'plain':!![]});if(!_0x2329ca)throw new Error(_0xe53a('0x49'));if(_0x2329ca[_0xe53a('0x4a')]===_0xe53a('0x48')){var _0x25084f=_0x301803[_0xe53a('0x26')]({'plain':!![]});var _0x31b0de=_0xe53a('0x27');return db[_0xe53a('0x4b')][_0xe53a('0x45')]({'where':{'name':_0x31b0de,'userProfileId':_0x2329ca[_0xe53a('0x4c')]},'raw':!![]})[_0xe53a('0x25')](function(_0x27bd8f){if(_0x27bd8f&&_0x27bd8f['autoAssociation']===0x0){return db[_0xe53a('0x4d')][_0xe53a('0x47')]({'name':_0x25084f[_0xe53a('0x29')],'resourceId':_0x25084f['id'],'type':_0x27bd8f[_0xe53a('0x29')],'sectionId':_0x27bd8f['id']},{})[_0xe53a('0x25')](function(){return _0x301803;});}else{return _0x301803;}})['catch'](function(_0x42f029){logger[_0xe53a('0x4e')](_0xe53a('0x4f'),_0x42f029);throw _0x42f029;});}return _0x301803;})[_0xe53a('0x25')](respondWithResult(_0x2e4d06,0xc9))['catch'](handleError(_0x2e4d06,null));};exports['update']=function(_0x32225d,_0x401043){if(_0x32225d[_0xe53a('0x50')]['id']){delete _0x32225d[_0xe53a('0x50')]['id'];}return db['Disposition'][_0xe53a('0x45')]({'where':{'id':_0x32225d['params']['id']}})[_0xe53a('0x25')](handleEntityNotFound(_0x401043,null))['then'](saveUpdates(_0x32225d[_0xe53a('0x50')],null))['then'](respondWithResult(_0x401043,null))['catch'](handleError(_0x401043,null));};exports[_0xe53a('0x28')]=function(_0x50f557,_0x47def9){return db[_0xe53a('0x2b')]['find']({'where':{'id':_0x50f557[_0xe53a('0x51')]['id']}})[_0xe53a('0x25')](handleEntityNotFound(_0x47def9,null))[_0xe53a('0x25')](removeEntity(_0x47def9,null))['catch'](handleError(_0x47def9,null));};
\ No newline at end of file
index 8c6daf7..3c4106b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x754b=['name_chat','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','exports','define','Disposition','name_voice','name'];(function(_0x2b0698,_0x13247e){var _0x4abf4a=function(_0x91630a){while(--_0x91630a){_0x2b0698['push'](_0x2b0698['shift']());}};_0x4abf4a(++_0x13247e);}(_0x754b,0x136));var _0xb754=function(_0xf05c4d,_0x140378){_0xf05c4d=_0xf05c4d-0x0;var _0x14030b=_0x754b[_0xf05c4d];return _0x14030b;};'use strict';var _=require(_0xb754('0x0'));var util=require(_0xb754('0x1'));var logger=require(_0xb754('0x2'))(_0xb754('0x3'));var moment=require(_0xb754('0x4'));var BPromise=require(_0xb754('0x5'));var rp=require(_0xb754('0x6'));var fs=require('fs');var path=require(_0xb754('0x7'));var rimraf=require(_0xb754('0x8'));var config=require('../../config/environment');var attributes=require(_0xb754('0x9'));module[_0xb754('0xa')]=function(_0x16ccb7,_0x1b4d18){return _0x16ccb7[_0xb754('0xb')](_0xb754('0xc'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xb754('0xd'),'fields':[_0xb754('0xe'),'ListId']},{'unique':!![],'name':_0xb754('0xf'),'fields':[_0xb754('0xe'),_0xb754('0x10')]},{'unique':!![],'name':_0xb754('0x11'),'fields':[_0xb754('0xe'),_0xb754('0x12')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0xb754('0x13'),'fields':['name',_0xb754('0x14')]},{'unique':!![],'name':_0xb754('0x15'),'fields':[_0xb754('0xe'),_0xb754('0x16')]},{'unique':!![],'name':_0xb754('0x17'),'fields':['name',_0xb754('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e85=['path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14e529,_0x46dba8){var _0x534805=function(_0x123af7){while(--_0x123af7){_0x14e529['push'](_0x14e529['shift']());}};_0x534805(++_0x46dba8);}(_0x9e85,0x13f));var _0x59e8=function(_0x12f313,_0x270e76){_0x12f313=_0x12f313-0x0;var _0x3d7705=_0x9e85[_0x12f313];return _0x3d7705;};'use strict';var _=require('lodash');var util=require(_0x59e8('0x0'));var logger=require(_0x59e8('0x1'))(_0x59e8('0x2'));var moment=require(_0x59e8('0x3'));var BPromise=require(_0x59e8('0x4'));var rp=require(_0x59e8('0x5'));var fs=require('fs');var path=require(_0x59e8('0x6'));var rimraf=require(_0x59e8('0x7'));var config=require(_0x59e8('0x8'));var attributes=require(_0x59e8('0x9'));module[_0x59e8('0xa')]=function(_0xc1d64d,_0xed07c9){return _0xc1d64d['define'](_0x59e8('0xb'),attributes,{'tableName':_0x59e8('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x59e8('0xd'),'fields':['name',_0x59e8('0xe')]},{'unique':!![],'name':_0x59e8('0xf'),'fields':[_0x59e8('0x10'),'ChatWebsiteId']},{'unique':!![],'name':_0x59e8('0x11'),'fields':[_0x59e8('0x10'),_0x59e8('0x12')]},{'unique':!![],'name':_0x59e8('0x13'),'fields':[_0x59e8('0x10'),'SmsAccountId']},{'unique':!![],'name':_0x59e8('0x14'),'fields':['name',_0x59e8('0x15')]},{'unique':!![],'name':_0x59e8('0x16'),'fields':[_0x59e8('0x10'),'OpenchannelAccountId']},{'unique':!![],'name':_0x59e8('0x17'),'fields':['name',_0x59e8('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
index 803553b..7202f32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0xcc9ab6,_0x8114d3){var _0x161d30=function(_0x38769a){while(--_0x38769a){_0xcc9ab6['push'](_0xcc9ab6['shift']());}};_0x161d30(++_0x8114d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0xaebf7e,_0x813b7c){var _0x123f25=function(_0x4d3561){while(--_0x4d3561){_0xaebf7e['push'](_0xaebf7e['shift']());}};_0x123f25(++_0x813b7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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
index fd641c1..da9f171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5934=['put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','show','post'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0x5934,0x146));var _0x4593=function(_0x2622d4,_0x230138){_0x2622d4=_0x2622d4-0x0;var _0x1686ac=_0x5934[_0x2622d4];return _0x1686ac;};'use strict';var multer=require(_0x4593('0x0'));var util=require(_0x4593('0x1'));var path=require(_0x4593('0x2'));var timeout=require('connect-timeout');var express=require(_0x4593('0x3'));var router=express[_0x4593('0x4')]();var fs_extra=require(_0x4593('0x5'));var auth=require(_0x4593('0x6'));var interaction=require(_0x4593('0x7'));var config=require(_0x4593('0x8'));var controller=require(_0x4593('0x9'));router[_0x4593('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4593('0xa')]('/:id',auth[_0x4593('0xb')](),controller[_0x4593('0xc')]);router[_0x4593('0xd')]('/',auth[_0x4593('0xb')](),controller['create']);router[_0x4593('0xe')](_0x4593('0xf'),auth[_0x4593('0xb')](),controller[_0x4593('0x10')]);router[_0x4593('0x11')]('/:id',auth[_0x4593('0xb')](),controller[_0x4593('0x12')]);module[_0x4593('0x13')]=router;
\ No newline at end of file
+var _0xb7fd=['show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated'];(function(_0x4619a1,_0x513b89){var _0x46eaef=function(_0xc5e34c){while(--_0xc5e34c){_0x4619a1['push'](_0x4619a1['shift']());}};_0x46eaef(++_0x513b89);}(_0xb7fd,0xaf));var _0xdb7f=function(_0x5f0890,_0x5a92c9){_0x5f0890=_0x5f0890-0x0;var _0x34f79a=_0xb7fd[_0x5f0890];return _0x34f79a;};'use strict';var multer=require(_0xdb7f('0x0'));var util=require(_0xdb7f('0x1'));var path=require(_0xdb7f('0x2'));var timeout=require('connect-timeout');var express=require(_0xdb7f('0x3'));var router=express[_0xdb7f('0x4')]();var fs_extra=require(_0xdb7f('0x5'));var auth=require(_0xdb7f('0x6'));var interaction=require(_0xdb7f('0x7'));var config=require(_0xdb7f('0x8'));var controller=require(_0xdb7f('0x9'));router[_0xdb7f('0xa')]('/',auth['isAuthenticated'](),controller[_0xdb7f('0xb')]);router[_0xdb7f('0xa')](_0xdb7f('0xc'),auth[_0xdb7f('0xd')](),controller[_0xdb7f('0xe')]);router[_0xdb7f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdb7f('0x10')](_0xdb7f('0xc'),auth['isAuthenticated'](),controller[_0xdb7f('0x11')]);router[_0xdb7f('0x12')](_0xdb7f('0xc'),auth[_0xdb7f('0xd')](),controller[_0xdb7f('0x13')]);module[_0xdb7f('0x14')]=router;
\ No newline at end of file
index 83c28ea..f273e91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb719=['14400','4800','INTEGER','KHOMP','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','yes','localstationid','ENUM','2400','7200','9600','12000'];(function(_0x3fe848,_0x3b1129){var _0x54d01b=function(_0x130d59){while(--_0x130d59){_0x3fe848['push'](_0x3fe848['shift']());}};_0x54d01b(++_0x3b1129);}(_0xb719,0x170));var _0x9b71=function(_0x2be104,_0x4bf5d0){_0x2be104=_0x2be104-0x0;var _0x31c115=_0xb719[_0x2be104];return _0x31c115;};'use strict';var Sequelize=require(_0x9b71('0x0'));module[_0x9b71('0x1')]={'name':{'type':Sequelize[_0x9b71('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9b71('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x9b71('0x3'),'no'),'defaultValue':_0x9b71('0x3')},'headerinfo':{'type':Sequelize[_0x9b71('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x9b71('0x2')],'unique':_0x9b71('0x4')},'minrate':{'type':Sequelize[_0x9b71('0x5')](_0x9b71('0x6'),'4800',_0x9b71('0x7'),_0x9b71('0x8'),_0x9b71('0x9'),_0x9b71('0xa')),'defaultValue':_0x9b71('0xb')},'maxrate':{'type':Sequelize[_0x9b71('0x5')]('2400','4800',_0x9b71('0x7'),'9600',_0x9b71('0x9'),_0x9b71('0xa')),'defaultValue':_0x9b71('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9b71('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9b71('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP','IAX','DADHI',_0x9b71('0xd')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9b71('0xe');}},'notificationSound':{'type':Sequelize[_0x9b71('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9b71('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9b71('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9b71('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9b71('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9b71('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9b71('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9b71('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x10469){if(!_0x10469)this[_0x9b71('0x10')](_0x9b71('0x11'),null);this[_0x9b71('0x10')]('mandatoryDisposition',_0x10469);}}};
\ No newline at end of file
+var _0xe8e9=['STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','SIP','DADHI','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x299590,_0x571eaf){var _0x58321b=function(_0x4977a5){while(--_0x4977a5){_0x299590['push'](_0x299590['shift']());}};_0x58321b(++_0x571eaf);}(_0xe8e9,0x129));var _0x9e8e=function(_0x2922a5,_0x1a4e1a){_0x2922a5=_0x2922a5-0x0;var _0x35aacf=_0xe8e9[_0x2922a5];return _0x35aacf;};'use strict';var Sequelize=require(_0x9e8e('0x0'));module[_0x9e8e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9e8e('0x2')]},'ecm':{'type':Sequelize[_0x9e8e('0x3')](_0x9e8e('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x9e8e('0x2')],'defaultValue':_0x9e8e('0x5')},'localstationid':{'type':Sequelize[_0x9e8e('0x2')],'unique':_0x9e8e('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x9e8e('0x7'),_0x9e8e('0x8'),_0x9e8e('0x9'),_0x9e8e('0xa'),_0x9e8e('0xb'),'14400'),'defaultValue':_0x9e8e('0x8')},'maxrate':{'type':Sequelize[_0x9e8e('0x3')](_0x9e8e('0x7'),_0x9e8e('0x8'),_0x9e8e('0x9'),_0x9e8e('0xa'),_0x9e8e('0xb'),_0x9e8e('0xc')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x9e8e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9e8e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9e8e('0x3')](_0x9e8e('0xd'),'IAX',_0x9e8e('0xe'),'KHOMP'),'defaultValue':_0x9e8e('0xd')},'key':{'type':Sequelize[_0x9e8e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9e8e('0xf')],'defaultValue':function(){return _0x9e8e('0x10');}},'notificationSound':{'type':Sequelize[_0x9e8e('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9e8e('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9e8e('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9e8e('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9e8e('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9e8e('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9e8e('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x9e8e('0x11')],'defaultValue':![],'comment':_0x9e8e('0x14'),'set':function(_0x17168d){if(!_0x17168d)this[_0x9e8e('0x15')]('mandatoryDispositionPauseId',null);this[_0x9e8e('0x15')](_0x9e8e('0x16'),_0x17168d);}}};
\ No newline at end of file
index b1c8cb0..7b6f4ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf267=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','Contact','User','Tag','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','tech','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0xf267,0x17a));var _0x7f26=function(_0x2f96f5,_0x5dfe82){_0x2f96f5=_0x2f96f5-0x0;var _0x36c803=_0xf267[_0x2f96f5];return _0x36c803;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f26('0x0'));var zipdir=require(_0x7f26('0x1'));var jsonpatch=require(_0x7f26('0x2'));var rp=require(_0x7f26('0x3'));var moment=require(_0x7f26('0x4'));var BPromise=require(_0x7f26('0x5'));var Mustache=require(_0x7f26('0x6'));var util=require(_0x7f26('0x7'));var path=require('path');var sox=require(_0x7f26('0x8'));var csv=require(_0x7f26('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f26('0xa'));var _=require(_0x7f26('0xb'));var squel=require(_0x7f26('0xc'));var crypto=require('crypto');var jsforce=require(_0x7f26('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7f26('0x9'));var querystring=require(_0x7f26('0xe'));var Papa=require(_0x7f26('0xf'));var Redis=require(_0x7f26('0x10'));var authService=require(_0x7f26('0x11'));var qs=require(_0x7f26('0x12'));var as=require(_0x7f26('0x13'));var hardwareService=require(_0x7f26('0x14'));var logger=require('../../config/logger')(_0x7f26('0x15'));var utils=require(_0x7f26('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7f26('0x17'));var db=require(_0x7f26('0x18'))['db'];config[_0x7f26('0x19')]=_[_0x7f26('0x1a')](config['redis'],{'host':_0x7f26('0x1b'),'port':0x18eb});var socket=require(_0x7f26('0x1c'))(new Redis(config[_0x7f26('0x19')]));require(_0x7f26('0x1d'))[_0x7f26('0x1e')](socket);var jayson=require(_0x7f26('0x1f'));var client=jayson[_0x7f26('0x20')][_0x7f26('0x21')]({'port':0x232c});var client9002=jayson[_0x7f26('0x20')][_0x7f26('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5155ca,_0x2f1656,_0x7c77f0,_0xc13a4){return new BPromise(function(_0x4358e4,_0x3cb42f){var _0x1719b6=_0xc13a4||client;return _0x1719b6[_0x7f26('0x22')](_0x5155ca,_0x7c77f0)['then'](function(_0x1bbf54){logger[_0x7f26('0x23')](_0x7f26('0x24'),_0x2f1656,_0x7f26('0x25'));logger[_0x7f26('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2f1656,'request\x20sent',JSON[_0x7f26('0x27')](_0x1bbf54));if(_0x1bbf54[_0x7f26('0x28')]){if(_0x1bbf54[_0x7f26('0x28')][_0x7f26('0x29')]===0x1f4){logger[_0x7f26('0x28')](_0x7f26('0x24'),_0x2f1656,_0x1bbf54['error'][_0x7f26('0x2a')]);return _0x3cb42f(_0x1bbf54[_0x7f26('0x28')][_0x7f26('0x2a')]);}logger[_0x7f26('0x28')](_0x7f26('0x24'),_0x2f1656,_0x1bbf54[_0x7f26('0x28')][_0x7f26('0x2a')]);return _0x4358e4(_0x1bbf54[_0x7f26('0x28')][_0x7f26('0x2a')]);}else{logger[_0x7f26('0x23')](_0x7f26('0x24'),_0x2f1656,'request\x20sent');_0x4358e4(_0x1bbf54['result'][_0x7f26('0x2a')]);}})[_0x7f26('0x2b')](function(_0x5c019a){logger[_0x7f26('0x28')](_0x7f26('0x24'),_0x2f1656,_0x5c019a);_0x3cb42f(_0x5c019a);});});}function respondWithStatusCode(_0x55cf7e,_0x33b09e){_0x33b09e=_0x33b09e||0xcc;return function(_0x6bc469){if(_0x6bc469){return _0x55cf7e[_0x7f26('0x2c')](_0x33b09e);}return _0x55cf7e[_0x7f26('0x2d')](_0x33b09e)['end']();};}function respondWithResult(_0x27687d,_0x1a7180){_0x1a7180=_0x1a7180||0xc8;return function(_0x2beda4){if(_0x2beda4){return _0x27687d[_0x7f26('0x2d')](_0x1a7180)[_0x7f26('0x2e')](_0x2beda4);}};}function respondWithFilteredResult(_0x55bed0,_0x17dba8){return function(_0x1656fb){if(_0x1656fb){var _0x216a39=typeof _0x17dba8[_0x7f26('0x2f')]===_0x7f26('0x30')&&typeof _0x17dba8[_0x7f26('0x31')]==='undefined';var _0xd43cd8=_0x1656fb[_0x7f26('0x32')];var _0x28696f=_0x216a39?0x0:_0x17dba8[_0x7f26('0x2f')];var _0x576a77=_0x216a39?_0x1656fb[_0x7f26('0x32')]:_0x17dba8[_0x7f26('0x2f')]+_0x17dba8[_0x7f26('0x31')];var _0xbc6620;if(_0x576a77>=_0xd43cd8){_0x576a77=_0xd43cd8;_0xbc6620=0xc8;}else{_0xbc6620=0xce;}_0x55bed0[_0x7f26('0x2d')](_0xbc6620);return _0x55bed0['set'](_0x7f26('0x33'),_0x28696f+'-'+_0x576a77+'/'+_0xd43cd8)[_0x7f26('0x2e')](_0x1656fb);}return null;};}function patchUpdates(_0xd5fc95){return function(_0x1981cb){try{jsonpatch[_0x7f26('0x34')](_0x1981cb,_0xd5fc95,!![]);}catch(_0x165bfb){return BPromise[_0x7f26('0x35')](_0x165bfb);}return _0x1981cb[_0x7f26('0x36')]();};}function saveUpdates(_0x395636,_0x171d82){return function(_0xf9c7a8){if(_0xf9c7a8){return _0xf9c7a8[_0x7f26('0x37')](_0x395636)[_0x7f26('0x38')](function(_0x54d42a){return _0x54d42a;});}return null;};}function removeEntity(_0x3a9411,_0x505eaf){return function(_0x5cd732){if(_0x5cd732){return _0x5cd732['destroy']()[_0x7f26('0x38')](function(){var _0x18c23b=_0x5cd732[_0x7f26('0x39')]({'plain':!![]});var _0x2d44f4='FaxAccounts';return db[_0x7f26('0x3a')][_0x7f26('0x3b')]({'where':{'type':_0x2d44f4,'resourceId':_0x18c23b['id']}})[_0x7f26('0x38')](function(){return _0x5cd732;});})[_0x7f26('0x38')](function(){_0x3a9411[_0x7f26('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x376ce7,_0x330cd6){return function(_0x5f05bf){if(!_0x5f05bf){_0x376ce7['sendStatus'](0x194);}return _0x5f05bf;};}function handleError(_0x31a620,_0x2a4a3f){_0x2a4a3f=_0x2a4a3f||0x1f4;return function(_0x3189a5){logger[_0x7f26('0x28')](_0x3189a5[_0x7f26('0x3c')]);if(_0x3189a5['name']){delete _0x3189a5[_0x7f26('0x3d')];}_0x31a620[_0x7f26('0x2d')](_0x2a4a3f)[_0x7f26('0x3e')](_0x3189a5);};}exports[_0x7f26('0x3f')]=function(_0x18d029,_0x302198){var _0x542488={'include':[{'model':db[_0x7f26('0x40')],'as':_0x7f26('0x41')}]},_0x41e55e={},_0x221524={'count':0x0,'rows':[]};var _0x1dfe25=_[_0x7f26('0x42')](db[_0x7f26('0x43')][_0x7f26('0x44')],function(_0x30be73){return{'name':_0x30be73[_0x7f26('0x45')],'type':_0x30be73[_0x7f26('0x46')][_0x7f26('0x47')]};});_0x41e55e['model']=_[_0x7f26('0x42')](_0x1dfe25,'name');_0x41e55e[_0x7f26('0x48')]=_['keys'](_0x18d029[_0x7f26('0x48')]);_0x41e55e[_0x7f26('0x49')]=_['intersection'](_0x41e55e['model'],_0x41e55e[_0x7f26('0x48')]);_0x542488[_0x7f26('0x4a')]=_[_0x7f26('0x4b')](_0x41e55e[_0x7f26('0x4c')],qs[_0x7f26('0x4d')](_0x18d029[_0x7f26('0x48')]['fields']));_0x542488[_0x7f26('0x4a')]=_0x542488[_0x7f26('0x4a')]['length']?_0x542488[_0x7f26('0x4a')]:_0x41e55e[_0x7f26('0x4c')];if(!_0x18d029['query'][_0x7f26('0x4e')](_0x7f26('0x4f'))){_0x542488[_0x7f26('0x31')]=qs['limit'](_0x18d029[_0x7f26('0x48')][_0x7f26('0x31')]);_0x542488[_0x7f26('0x2f')]=qs[_0x7f26('0x2f')](_0x18d029['query']['offset']);}_0x542488[_0x7f26('0x50')]=qs[_0x7f26('0x51')](_0x18d029['query'][_0x7f26('0x51')]);_0x542488[_0x7f26('0x52')]=qs[_0x7f26('0x49')](_[_0x7f26('0x53')](_0x18d029[_0x7f26('0x48')],_0x41e55e[_0x7f26('0x49')]),_0x1dfe25);if(_0x18d029['query'][_0x7f26('0x54')]){_0x542488[_0x7f26('0x52')]=_[_0x7f26('0x55')](_0x542488['where'],{'$or':_[_0x7f26('0x42')](_0x1dfe25,function(_0x1c517d){if(_0x1c517d[_0x7f26('0x46')]!==_0x7f26('0x56')){var _0x3a6c9a={};_0x3a6c9a[_0x1c517d['name']]={'$like':'%'+_0x18d029['query'][_0x7f26('0x54')]+'%'};return _0x3a6c9a;}})});}_0x542488=_['merge']({},_0x542488,_0x18d029[_0x7f26('0x57')]);var _0x13cddb={'where':_0x542488[_0x7f26('0x52')]};return db[_0x7f26('0x43')][_0x7f26('0x32')](_0x13cddb)[_0x7f26('0x38')](function(_0x21f543){_0x221524[_0x7f26('0x32')]=_0x21f543;if(_0x18d029[_0x7f26('0x48')][_0x7f26('0x58')]){_0x542488[_0x7f26('0x59')]=[{'all':!![]}];}return db[_0x7f26('0x43')][_0x7f26('0x5a')](_0x542488);})[_0x7f26('0x38')](function(_0x2551cc){_0x221524[_0x7f26('0x5b')]=_0x2551cc;return _0x221524;})[_0x7f26('0x38')](respondWithFilteredResult(_0x302198,_0x542488))[_0x7f26('0x2b')](handleError(_0x302198,null));};exports[_0x7f26('0x5c')]=function(_0x43f642,_0x19ca57){var _0x179e8d={'raw':![],'where':{'id':_0x43f642[_0x7f26('0x5d')]['id']},'include':[{'model':db[_0x7f26('0x40')],'as':'mandatoryDispositionPause'}]},_0x1775b8={};_0x1775b8[_0x7f26('0x4c')]=_[_0x7f26('0x5e')](db['FaxAccount']['rawAttributes']);_0x1775b8[_0x7f26('0x48')]=_[_0x7f26('0x5e')](_0x43f642[_0x7f26('0x48')]);_0x1775b8[_0x7f26('0x49')]=_[_0x7f26('0x4b')](_0x1775b8[_0x7f26('0x4c')],_0x1775b8['query']);_0x179e8d[_0x7f26('0x4a')]=_['intersection'](_0x1775b8['model'],qs[_0x7f26('0x4d')](_0x43f642['query'][_0x7f26('0x4d')]));_0x179e8d[_0x7f26('0x4a')]=_0x179e8d[_0x7f26('0x4a')][_0x7f26('0x5f')]?_0x179e8d[_0x7f26('0x4a')]:_0x1775b8[_0x7f26('0x4c')];if(_0x43f642[_0x7f26('0x48')]['includeAll']){_0x179e8d[_0x7f26('0x59')]=[{'all':!![]}];}_0x179e8d=_['merge']({},_0x179e8d,_0x43f642[_0x7f26('0x57')]);return db[_0x7f26('0x43')]['find'](_0x179e8d)['then'](handleEntityNotFound(_0x19ca57,null))[_0x7f26('0x38')](respondWithResult(_0x19ca57,null))['catch'](handleError(_0x19ca57,null));};exports[_0x7f26('0x60')]=function(_0x1655fe,_0x40b687){return db['FaxAccount'][_0x7f26('0x60')](_0x1655fe[_0x7f26('0x61')],{})[_0x7f26('0x38')](function(_0x137adc){var _0x48db2e=_0x1655fe[_0x7f26('0x62')][_0x7f26('0x39')]({'plain':!![]});if(!_0x48db2e)throw new Error(_0x7f26('0x63'));if(_0x48db2e[_0x7f26('0x64')]==='user'){var _0x298b0e=_0x137adc[_0x7f26('0x39')]({'plain':!![]});var _0x1b721d=_0x7f26('0x65');return db['UserProfileSection'][_0x7f26('0x66')]({'where':{'name':_0x1b721d,'userProfileId':_0x48db2e[_0x7f26('0x67')]},'raw':!![]})[_0x7f26('0x38')](function(_0x2c5942){if(_0x2c5942&&_0x2c5942[_0x7f26('0x68')]===0x0){return db[_0x7f26('0x3a')][_0x7f26('0x60')]({'name':_0x298b0e['name'],'resourceId':_0x298b0e['id'],'type':_0x2c5942[_0x7f26('0x3d')],'sectionId':_0x2c5942['id']},{})[_0x7f26('0x38')](function(){return _0x137adc;});}else{return _0x137adc;}})[_0x7f26('0x2b')](function(_0xdf37e4){logger['error'](_0x7f26('0x69'),_0xdf37e4);throw _0xdf37e4;});}return _0x137adc;})['then'](respondWithResult(_0x40b687,0xc9))[_0x7f26('0x2b')](handleError(_0x40b687,null));};exports[_0x7f26('0x37')]=function(_0x4b2809,_0x23b2c8){if(_0x4b2809[_0x7f26('0x61')]['id']){delete _0x4b2809['body']['id'];}return db[_0x7f26('0x43')]['find']({'where':{'id':_0x4b2809[_0x7f26('0x5d')]['id']},'include':[{'model':db[_0x7f26('0x40')],'as':_0x7f26('0x41')}]})[_0x7f26('0x38')](handleEntityNotFound(_0x23b2c8,null))[_0x7f26('0x38')](saveUpdates(_0x4b2809[_0x7f26('0x61')],null))[_0x7f26('0x38')](respondWithResult(_0x23b2c8,null))['catch'](handleError(_0x23b2c8,null));};exports[_0x7f26('0x3b')]=function(_0x3dda85,_0x43e3d3){return db[_0x7f26('0x43')][_0x7f26('0x66')]({'where':{'id':_0x3dda85[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x43e3d3,null))[_0x7f26('0x38')](removeEntity(_0x43e3d3,null))[_0x7f26('0x2b')](handleError(_0x43e3d3,null));};exports['describe']=function(_0x111b09,_0x3e53ee){return db['FaxAccount'][_0x7f26('0x6a')]()['then'](respondWithResult(_0x3e53ee,null))['catch'](handleError(_0x3e53ee,null));};exports[_0x7f26('0x6b')]=function(_0x3cd209,_0x471f58,_0x1fb7cc){if(_0x3cd209[_0x7f26('0x61')]['id']){delete _0x3cd209[_0x7f26('0x61')]['id'];}return db[_0x7f26('0x43')]['find']({'where':{'id':_0x3cd209[_0x7f26('0x5d')]['id']}})['then'](handleEntityNotFound(_0x471f58,null))['then'](function(_0x498509){if(_0x498509){_0x3cd209['body'][_0x7f26('0x6c')]=_0x498509['id'];return db['Disposition']['create'](_0x3cd209['body']);}})[_0x7f26('0x38')](respondWithResult(_0x471f58,null))[_0x7f26('0x2b')](handleError(_0x471f58,null));};exports['getDispositions']=function(_0x5b2117,_0x429a4f,_0x63bb3c){var _0x7343ea={'raw':![],'where':{}};var _0xb93614={};var _0x598072={'count':0x0,'rows':[]};return db[_0x7f26('0x43')][_0x7f26('0x6d')]({'where':{'id':_0x5b2117[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x429a4f,null))[_0x7f26('0x38')](function(_0x2f59e0){if(_0x2f59e0){_0xb93614[_0x7f26('0x4c')]=_['keys'](db['Disposition']['rawAttributes']);_0xb93614[_0x7f26('0x48')]=_[_0x7f26('0x5e')](_0x5b2117[_0x7f26('0x48')]);_0xb93614[_0x7f26('0x49')]=_['intersection'](_0xb93614[_0x7f26('0x4c')],_0xb93614[_0x7f26('0x48')]);_0x7343ea[_0x7f26('0x4a')]=_[_0x7f26('0x4b')](_0xb93614['model'],qs[_0x7f26('0x4d')](_0x5b2117[_0x7f26('0x48')][_0x7f26('0x4d')]));_0x7343ea[_0x7f26('0x4a')]=_0x7343ea['attributes']['length']?_0x7343ea[_0x7f26('0x4a')]:_0xb93614[_0x7f26('0x4c')];if(!_0x5b2117['query'][_0x7f26('0x4e')](_0x7f26('0x4f'))){_0x7343ea['limit']=qs[_0x7f26('0x31')](_0x5b2117[_0x7f26('0x48')][_0x7f26('0x31')]);_0x7343ea[_0x7f26('0x2f')]=qs[_0x7f26('0x2f')](_0x5b2117[_0x7f26('0x48')][_0x7f26('0x2f')]);}_0x7343ea[_0x7f26('0x50')]=qs['sort'](_0x5b2117[_0x7f26('0x48')][_0x7f26('0x51')]);_0x7343ea['where']=qs[_0x7f26('0x49')](_[_0x7f26('0x53')](_0x5b2117['query'],_0xb93614['filters']));_0x7343ea[_0x7f26('0x52')][_0x7f26('0x6c')]=_0x2f59e0['id'];if(_0x5b2117[_0x7f26('0x48')][_0x7f26('0x54')]){_0x7343ea['where']=_[_0x7f26('0x55')](_0x7343ea[_0x7f26('0x52')],{'$or':_[_0x7f26('0x42')](_0x7343ea[_0x7f26('0x4a')],function(_0x1c83e2){var _0x500bc9={};_0x500bc9[_0x1c83e2]={'$like':'%'+_0x5b2117[_0x7f26('0x48')]['filter']+'%'};return _0x500bc9;})});}_0x7343ea=_[_0x7f26('0x55')]({},_0x7343ea,_0x5b2117['options']);return db['Disposition'][_0x7f26('0x32')]({'where':_0x7343ea[_0x7f26('0x52')]})[_0x7f26('0x38')](function(_0x1ea2cf){_0x598072[_0x7f26('0x32')]=_0x1ea2cf;if(_0x5b2117[_0x7f26('0x48')][_0x7f26('0x58')]){_0x7343ea[_0x7f26('0x59')]=[{'all':!![]}];}return db[_0x7f26('0x6e')][_0x7f26('0x5a')](_0x7343ea);})['then'](function(_0x431ddc){_0x598072[_0x7f26('0x5b')]=_0x431ddc;return _0x598072;});}})[_0x7f26('0x38')](respondWithFilteredResult(_0x429a4f,_0x7343ea))[_0x7f26('0x2b')](handleError(_0x429a4f,null));};exports['removeDispositions']=function(_0x2b1159,_0xeb5a9e,_0x287a2b){return db[_0x7f26('0x43')][_0x7f26('0x66')]({'where':{'id':_0x2b1159[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0xeb5a9e,null))[_0x7f26('0x38')](function(_0x2825b2){if(_0x2825b2){return _0x2825b2[_0x7f26('0x6f')](_0x2b1159[_0x7f26('0x48')]['ids']);}})[_0x7f26('0x38')](respondWithStatusCode(_0xeb5a9e,null))[_0x7f26('0x2b')](handleError(_0xeb5a9e,null));};exports[_0x7f26('0x70')]=function(_0xbc4a9d,_0x35df3a,_0x1defdd){if(_0xbc4a9d[_0x7f26('0x61')]['id']){delete _0xbc4a9d[_0x7f26('0x61')]['id'];}return db[_0x7f26('0x43')]['find']({'where':{'id':_0xbc4a9d[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x35df3a,null))['then'](function(_0x2bb701){if(_0x2bb701){_0xbc4a9d[_0x7f26('0x61')][_0x7f26('0x6c')]=_0x2bb701['id'];return db[_0x7f26('0x71')]['create'](_0xbc4a9d[_0x7f26('0x61')]);}})[_0x7f26('0x38')](respondWithResult(_0x35df3a,null))[_0x7f26('0x2b')](handleError(_0x35df3a,null));};exports[_0x7f26('0x72')]=function(_0x4b2c45,_0x3ab558,_0x4e4b85){var _0x1a6fa3={'raw':![],'where':{}};var _0x24d472={};var _0x371b47={'count':0x0,'rows':[]};return db[_0x7f26('0x43')]['findOne']({'where':{'id':_0x4b2c45['params']['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x3ab558,null))['then'](function(_0x5b0eb0){if(_0x5b0eb0){_0x24d472[_0x7f26('0x4c')]=_[_0x7f26('0x5e')](db[_0x7f26('0x71')][_0x7f26('0x44')]);_0x24d472[_0x7f26('0x48')]=_[_0x7f26('0x5e')](_0x4b2c45[_0x7f26('0x48')]);_0x24d472[_0x7f26('0x49')]=_[_0x7f26('0x4b')](_0x24d472[_0x7f26('0x4c')],_0x24d472['query']);_0x1a6fa3[_0x7f26('0x4a')]=_['intersection'](_0x24d472['model'],qs[_0x7f26('0x4d')](_0x4b2c45['query']['fields']));_0x1a6fa3[_0x7f26('0x4a')]=_0x1a6fa3[_0x7f26('0x4a')][_0x7f26('0x5f')]?_0x1a6fa3['attributes']:_0x24d472['model'];if(!_0x4b2c45[_0x7f26('0x48')][_0x7f26('0x4e')](_0x7f26('0x4f'))){_0x1a6fa3[_0x7f26('0x31')]=qs[_0x7f26('0x31')](_0x4b2c45[_0x7f26('0x48')][_0x7f26('0x31')]);_0x1a6fa3[_0x7f26('0x2f')]=qs['offset'](_0x4b2c45[_0x7f26('0x48')][_0x7f26('0x2f')]);}_0x1a6fa3['order']=qs[_0x7f26('0x51')](_0x4b2c45[_0x7f26('0x48')][_0x7f26('0x51')]);_0x1a6fa3[_0x7f26('0x52')]=qs[_0x7f26('0x49')](_[_0x7f26('0x53')](_0x4b2c45[_0x7f26('0x48')],_0x24d472['filters']));_0x1a6fa3[_0x7f26('0x52')][_0x7f26('0x6c')]=_0x5b0eb0['id'];if(_0x4b2c45['query'][_0x7f26('0x54')]){_0x1a6fa3[_0x7f26('0x52')]=_['merge'](_0x1a6fa3[_0x7f26('0x52')],{'$or':_[_0x7f26('0x42')](_0x1a6fa3[_0x7f26('0x4a')],function(_0xe3eea){var _0xf64670={};_0xf64670[_0xe3eea]={'$like':'%'+_0x4b2c45[_0x7f26('0x48')][_0x7f26('0x54')]+'%'};return _0xf64670;})});}_0x1a6fa3=_[_0x7f26('0x55')]({},_0x1a6fa3,_0x4b2c45[_0x7f26('0x57')]);return db[_0x7f26('0x71')]['count']({'where':_0x1a6fa3[_0x7f26('0x52')]})[_0x7f26('0x38')](function(_0x5711ad){_0x371b47[_0x7f26('0x32')]=_0x5711ad;if(_0x4b2c45[_0x7f26('0x48')]['includeAll']){_0x1a6fa3[_0x7f26('0x59')]=[{'all':!![]}];}return db[_0x7f26('0x71')][_0x7f26('0x5a')](_0x1a6fa3);})[_0x7f26('0x38')](function(_0x524f41){_0x371b47[_0x7f26('0x5b')]=_0x524f41;return _0x371b47;});}})[_0x7f26('0x38')](respondWithFilteredResult(_0x3ab558,_0x1a6fa3))[_0x7f26('0x2b')](handleError(_0x3ab558,null));};exports[_0x7f26('0x73')]=function(_0x34e890,_0x17b198,_0xa925f8){return db[_0x7f26('0x43')][_0x7f26('0x66')]({'where':{'id':_0x34e890[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x17b198,null))['then'](function(_0x10cc81){if(_0x10cc81){return _0x10cc81[_0x7f26('0x73')](_0x34e890['query'][_0x7f26('0x74')]);}})[_0x7f26('0x38')](respondWithStatusCode(_0x17b198,null))['catch'](handleError(_0x17b198,null));};exports[_0x7f26('0x75')]=function(_0x3318d5,_0x19bcb2,_0x144039){return db[_0x7f26('0x76')][_0x7f26('0x66')]({'where':{'id':_0x3318d5[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x19bcb2,null))[_0x7f26('0x38')](function(_0x7a55ba){if(_0x7a55ba){return _0x7a55ba[_0x7f26('0x75')](_0x3318d5[_0x7f26('0x61')][_0x7f26('0x74')],_[_0x7f26('0x77')](_0x3318d5[_0x7f26('0x61')],[_0x7f26('0x74'),'id'])||{});}})[_0x7f26('0x38')](respondWithResult(_0x19bcb2,null))[_0x7f26('0x2b')](handleError(_0x19bcb2,null));};exports['getInteractions']=function(_0x957e4f,_0x417c31,_0x389898){var _0x4ba39b={'raw':![],'where':{}};var _0x4c314d={};var _0x156686={'count':0x0,'rows':[]};return db[_0x7f26('0x43')][_0x7f26('0x6d')]({'where':{'id':_0x957e4f[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x417c31,null))[_0x7f26('0x38')](function(_0x5e2224){if(_0x5e2224){_0x4c314d['model']=_[_0x7f26('0x5e')](db['FaxInteraction']['rawAttributes']);_0x4c314d[_0x7f26('0x48')]=_['keys'](_0x957e4f[_0x7f26('0x48')]);_0x4c314d[_0x7f26('0x49')]=_[_0x7f26('0x4b')](_0x4c314d[_0x7f26('0x4c')],_0x4c314d[_0x7f26('0x48')]);_0x4ba39b[_0x7f26('0x4a')]=_[_0x7f26('0x4b')](_0x4c314d[_0x7f26('0x4c')],qs['fields'](_0x957e4f[_0x7f26('0x48')]['fields']));_0x4ba39b['attributes']=_0x4ba39b['attributes'][_0x7f26('0x5f')]?_0x4ba39b[_0x7f26('0x4a')]:_0x4c314d[_0x7f26('0x4c')];if(!_0x957e4f[_0x7f26('0x48')][_0x7f26('0x4e')](_0x7f26('0x4f'))){_0x4ba39b[_0x7f26('0x31')]=qs['limit'](_0x957e4f['query'][_0x7f26('0x31')]);_0x4ba39b[_0x7f26('0x2f')]=qs['offset'](_0x957e4f['query'][_0x7f26('0x2f')]);}_0x4ba39b[_0x7f26('0x50')]=qs[_0x7f26('0x51')](_0x957e4f[_0x7f26('0x48')][_0x7f26('0x51')]);_0x4ba39b[_0x7f26('0x52')]=qs[_0x7f26('0x49')](_[_0x7f26('0x53')](_0x957e4f['query'],_0x4c314d[_0x7f26('0x49')]));_0x4ba39b['where'][_0x7f26('0x6c')]=_0x5e2224['id'];if(_0x957e4f['query'][_0x7f26('0x54')]){_0x4ba39b['where']=_[_0x7f26('0x55')](_0x4ba39b[_0x7f26('0x52')],{'$or':_['map'](_0x4ba39b[_0x7f26('0x4a')],function(_0x5d24f6){var _0x524c27={};_0x524c27[_0x5d24f6]={'$like':'%'+_0x957e4f['query'][_0x7f26('0x54')]+'%'};return _0x524c27;})});}_0x4ba39b=_[_0x7f26('0x55')]({},_0x4ba39b,_0x957e4f['options']);return db['FaxInteraction'][_0x7f26('0x32')]({'where':_0x4ba39b[_0x7f26('0x52')]})[_0x7f26('0x38')](function(_0x34be8c){_0x156686[_0x7f26('0x32')]=_0x34be8c;if(_0x957e4f[_0x7f26('0x48')][_0x7f26('0x58')]){_0x4ba39b[_0x7f26('0x59')]=[{'model':db['CmContact'],'as':_0x7f26('0x78'),'required':![]},{'model':db[_0x7f26('0x79')],'as':'Owner','attributes':[_0x7f26('0x3d'),'fullname','internal'],'required':![]},{'model':db[_0x7f26('0x7a')],'as':'Tags','attributes':['id',_0x7f26('0x3d'),'color'],'where':_0x957e4f[_0x7f26('0x48')][_0x7f26('0x7b')]?{'id':_0x957e4f[_0x7f26('0x48')][_0x7f26('0x7b')]}:undefined,'required':_0x957e4f[_0x7f26('0x48')]['tag']?!![]:![]}];}return db[_0x7f26('0x76')][_0x7f26('0x5a')](_0x4ba39b);})['then'](function(_0x2c3374){_0x156686[_0x7f26('0x5b')]=_0x2c3374;return _0x156686;});}})[_0x7f26('0x38')](respondWithFilteredResult(_0x417c31,_0x4ba39b))[_0x7f26('0x2b')](handleError(_0x417c31,null));};exports[_0x7f26('0x7c')]=function(_0xb421d3,_0x44f366){var _0x4120e9=_0xb421d3[_0x7f26('0x5d')]['id'];var _0x31d55e=_0xb421d3[_0x7f26('0x61')];var _0x1ee92e=0xc8;var _0x5a7b48=null;return db[_0x7f26('0x7d')]['transaction']({'isolationLevel':db['sequelize'][_0x7f26('0x7e')][_0x7f26('0x7f')]['READ_COMMITTED']},function(_0x2490bf){return db[_0x7f26('0x43')][_0x7f26('0x6d')]({'where':{'id':_0x4120e9},'transaction':_0x2490bf})[_0x7f26('0x38')](function(_0x25dba1){if(_0x25dba1){return db[_0x7f26('0x80')][_0x7f26('0x3b')]({'where':{'FaxAccountId':_0x4120e9},'transaction':_0x2490bf})[_0x7f26('0x38')](function(){var _0x194312=_['map'](_0x31d55e,function(_0x52a4c5){_0x52a4c5[_0x7f26('0x6c')]=_0x4120e9;return _0x52a4c5;});return db['FaxApplication'][_0x7f26('0x81')](_0x194312,{'transaction':_0x2490bf});});}else{_0x1ee92e=0x194;_0x5a7b48=[];}});})[_0x7f26('0x38')](function(){if(_0x1ee92e!==0x194){return db['FaxApplication'][_0x7f26('0x82')]({'where':{'FaxAccountId':_0x4120e9},'order':_0x7f26('0x83')})[_0x7f26('0x38')](function(_0x459ed9){_0x5a7b48=_0x459ed9;});}})[_0x7f26('0x2b')](function(_0x270e61){_0x1ee92e=0x1f4;logger[_0x7f26('0x28')](_0x270e61[_0x7f26('0x3c')]);if(_0x270e61['name']){delete _0x270e61['name'];}_0x5a7b48=_0x270e61;})[_0x7f26('0x84')](function(){if(_0x5a7b48===null){_0x44f366[_0x7f26('0x2c')](_0x1ee92e);}else{if(_0x1ee92e===0x1f4){_0x44f366[_0x7f26('0x2d')](_0x1ee92e)[_0x7f26('0x3e')](_0x5a7b48);}else{_0x44f366[_0x7f26('0x2d')](_0x1ee92e)[_0x7f26('0x2e')](_0x5a7b48);}}});};exports['getApplications']=function(_0x4e94b1,_0x23643a,_0x272d1a){var _0x4d7786={};var _0x52f643={};var _0x16875b;var _0x19362e;return db[_0x7f26('0x43')][_0x7f26('0x6d')]({'where':{'id':_0x4e94b1[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x23643a,null))['then'](function(_0x2682cf){if(_0x2682cf){_0x16875b=_0x2682cf;_0x52f643[_0x7f26('0x4c')]=_[_0x7f26('0x5e')](db[_0x7f26('0x80')][_0x7f26('0x44')]);_0x52f643['query']=_[_0x7f26('0x5e')](_0x4e94b1[_0x7f26('0x48')]);_0x52f643['filters']=_[_0x7f26('0x4b')](_0x52f643['model'],_0x52f643['query']);_0x4d7786[_0x7f26('0x4a')]=_[_0x7f26('0x4b')](_0x52f643[_0x7f26('0x4c')],qs[_0x7f26('0x4d')](_0x4e94b1[_0x7f26('0x48')][_0x7f26('0x4d')]));_0x4d7786['attributes']=_0x4d7786['attributes'][_0x7f26('0x5f')]?_0x4d7786[_0x7f26('0x4a')]:_0x52f643[_0x7f26('0x4c')];_0x4d7786[_0x7f26('0x50')]=qs['sort'](_0x4e94b1['query'][_0x7f26('0x51')]);_0x4d7786['where']=qs['filters'](_[_0x7f26('0x53')](_0x4e94b1['query'],_0x52f643['filters']));if(_0x4e94b1[_0x7f26('0x48')][_0x7f26('0x54')]){_0x4d7786[_0x7f26('0x52')]=_[_0x7f26('0x55')](_0x4d7786[_0x7f26('0x52')],{'$or':_[_0x7f26('0x42')](_0x4d7786[_0x7f26('0x4a')],function(_0x30f27f){var _0x65f0e8={};_0x65f0e8[_0x30f27f]={'$like':'%'+_0x4e94b1[_0x7f26('0x48')]['filter']+'%'};return _0x65f0e8;})});}_0x4d7786=_[_0x7f26('0x55')]({},_0x4d7786,_0x4e94b1[_0x7f26('0x57')]);return _0x16875b[_0x7f26('0x85')](_0x4d7786);}})[_0x7f26('0x38')](function(_0x32f98f){if(_0x32f98f){_0x19362e=_0x32f98f[_0x7f26('0x5f')];if(!_0x4e94b1[_0x7f26('0x48')]['hasOwnProperty'](_0x7f26('0x4f'))){_0x4d7786[_0x7f26('0x31')]=qs[_0x7f26('0x31')](_0x4e94b1['query'][_0x7f26('0x31')]);_0x4d7786[_0x7f26('0x2f')]=qs[_0x7f26('0x2f')](_0x4e94b1[_0x7f26('0x48')][_0x7f26('0x2f')]);}return _0x16875b['getApplications'](_0x4d7786);}})[_0x7f26('0x38')](function(_0x5ca089){if(_0x5ca089){return _0x5ca089?{'count':_0x19362e,'rows':_0x5ca089}:null;}})['then'](respondWithResult(_0x23643a,null))[_0x7f26('0x2b')](handleError(_0x23643a,null));};function Extension(_0x1ac44d,_0x5b590b,_0x19d3da,_0x1056ea){this[_0x7f26('0x86')]=_0x7f26('0x87');this[_0x7f26('0x88')]=_0x1ac44d[_0x7f26('0x89')];this[_0x7f26('0x8a')]=_0x1056ea;this[_0x7f26('0x46')]=_0x7f26('0x8b');this[_0x7f26('0x8c')]='Fax\x20Extension';this[_0x7f26('0x6c')]=_0x1ac44d['id'];this[_0x7f26('0x83')]=_0x5b590b;this[_0x7f26('0x8d')]=_0x19d3da;}function createExtensionsReciveFax(_0x595080){var _0x3d0fed=0x1;var _0x740722=[];_0x740722[_0x7f26('0x8e')](new Extension(_0x595080,_0x3d0fed,'',_0x7f26('0x8f')));_0x3d0fed+=0x1;_0x740722['push'](new Extension(_0x595080,_0x3d0fed,_0x7f26('0x90'),_0x7f26('0x91')));_0x3d0fed+=0x1;for(var _0xec66a5 in _0x595080){if(_0x595080[_0x7f26('0x4e')](_0xec66a5)&&(_0xec66a5===_0x7f26('0x92')||_0xec66a5==='localstationid'||_0xec66a5===_0x7f26('0x93')||_0xec66a5===_0x7f26('0x94')||_0xec66a5===_0x7f26('0x95')||_0xec66a5==='maxrate'||_0xec66a5===_0x7f26('0x96')||_0xec66a5==='modem'||_0xec66a5==='t38timeout')){_0x740722[_0x7f26('0x8e')](new Extension(_0x595080,_0x3d0fed,_0x7f26('0x97')+_0xec66a5+')='+_0x595080[_0xec66a5],_0x7f26('0x91')));_0x3d0fed+=0x1;}}_0x740722[_0x7f26('0x8e')](new Extension(_0x595080,_0x3d0fed,'6',_0x7f26('0x98')));_0x3d0fed+=0x1;_0x740722['push'](new Extension(_0x595080,_0x3d0fed,_0x7f26('0x99'),'ReceiveFax'));_0x3d0fed=0x0;return _0x740722;}exports[_0x7f26('0x9a')]=function(_0x1a6d3d,_0x567519,_0x2e49d8){var _0x270ce0;return db[_0x7f26('0x7d')]['transaction'](function(_0x4b0099){return db[_0x7f26('0x43')]['create'](_0x1a6d3d[_0x7f26('0x61')],{'transaction':_0x4b0099})[_0x7f26('0x38')](function(_0x5cd3e4){_0x270ce0=_0x5cd3e4[_0x7f26('0x39')]({'plain':!![]});return db[_0x7f26('0x9b')][_0x7f26('0x81')](createExtensionsReciveFax(_0x270ce0),{'transaction':_0x4b0099});});})[_0x7f26('0x38')](function(){return _0x270ce0;})['then'](respondWithResult(_0x567519,null))[_0x7f26('0x2b')](handleError(_0x567519,null));};exports[_0x7f26('0x9c')]=function(_0x575bd7,_0x29e21e,_0x55d254){var _0x5a8e61;return db[_0x7f26('0x7d')]['transaction'](function(_0x4c3cf4){return db[_0x7f26('0x43')][_0x7f26('0x37')](_0x575bd7[_0x7f26('0x61')],{'where':{'id':_0x575bd7[_0x7f26('0x61')]['id']},'transaction':_0x4c3cf4})['then'](function(_0x155f30){return db[_0x7f26('0x9b')][_0x7f26('0x3b')]({'where':{'FaxAccountId':_0x575bd7['body']['id']},'transaction':_0x4c3cf4})[_0x7f26('0x38')](function(_0xbd90d4){return db[_0x7f26('0x9b')][_0x7f26('0x81')](createExtensionsReciveFax(_[_0x7f26('0x77')](_0x575bd7[_0x7f26('0x61')],[_0x7f26('0x9d'),_0x7f26('0x47'),'createdAt',_0x7f26('0x9e'),_0x7f26('0x9f'),_0x7f26('0xa0')])),{'transaction':_0x4c3cf4});});});})[_0x7f26('0x38')](function(){return db['FaxAccount'][_0x7f26('0xa1')](_0x575bd7[_0x7f26('0x61')]['id']);})[_0x7f26('0x38')](respondWithResult(_0x29e21e,null))[_0x7f26('0x2b')](handleError(_0x29e21e,null));};exports[_0x7f26('0xa2')]=function(_0x53ab2d,_0x514578,_0x1a75e8){var _0x537e93={'raw':!![],'where':{}};var _0x5bec57={};var _0x1f5d99={'count':0x0,'rows':[]};return db[_0x7f26('0x43')]['findOne']({'where':{'id':_0x53ab2d[_0x7f26('0x5d')]['id']}})['then'](handleEntityNotFound(_0x514578,null))[_0x7f26('0x38')](function(_0x4d6166){if(_0x4d6166){_0x5bec57[_0x7f26('0x4c')]=_[_0x7f26('0x5e')](db[_0x7f26('0xa3')][_0x7f26('0x44')]);_0x5bec57[_0x7f26('0x48')]=_[_0x7f26('0x5e')](_0x53ab2d[_0x7f26('0x48')]);_0x5bec57[_0x7f26('0x49')]=_[_0x7f26('0x4b')](_0x5bec57[_0x7f26('0x4c')],_0x5bec57['query']);_0x537e93[_0x7f26('0x4a')]=_['intersection'](_0x5bec57['model'],qs[_0x7f26('0x4d')](_0x53ab2d[_0x7f26('0x48')][_0x7f26('0x4d')]));_0x537e93['attributes']=_0x537e93[_0x7f26('0x4a')][_0x7f26('0x5f')]?_0x537e93[_0x7f26('0x4a')]:_0x5bec57[_0x7f26('0x4c')];if(!_0x53ab2d['query'][_0x7f26('0x4e')](_0x7f26('0x4f'))){_0x537e93[_0x7f26('0x31')]=qs['limit'](_0x53ab2d[_0x7f26('0x48')][_0x7f26('0x31')]);_0x537e93['offset']=qs[_0x7f26('0x2f')](_0x53ab2d[_0x7f26('0x48')]['offset']);}_0x537e93[_0x7f26('0x50')]=qs[_0x7f26('0x51')](_0x53ab2d[_0x7f26('0x48')][_0x7f26('0x51')]);_0x537e93[_0x7f26('0x52')]=qs[_0x7f26('0x49')](_[_0x7f26('0x53')](_0x53ab2d[_0x7f26('0x48')],_0x5bec57[_0x7f26('0x49')]));_0x537e93[_0x7f26('0x52')][_0x7f26('0x6c')]=_0x4d6166['id'];if(_0x53ab2d[_0x7f26('0x48')]['filter']){_0x537e93[_0x7f26('0x52')]=_[_0x7f26('0x55')](_0x537e93['where'],{'$or':_['map'](_0x537e93[_0x7f26('0x4a')],function(_0x253d0e){var _0x381427={};_0x381427[_0x253d0e]={'$like':'%'+_0x53ab2d[_0x7f26('0x48')]['filter']+'%'};return _0x381427;})});}if(_0x53ab2d[_0x7f26('0x48')][_0x7f26('0xa4')]){var _0x129148=_0x53ab2d[_0x7f26('0x48')][_0x7f26('0xa4')][_0x7f26('0xa5')](',');var _0x2d5fc2={};_0x2d5fc2[_0x129148[0x0]]={'$gte':moment(_0x129148[0x1])[_0x7f26('0xa6')](_0x7f26('0xa7'))};_0x537e93[_0x7f26('0x52')]=_[_0x7f26('0x55')](_0x537e93['where'],_0x2d5fc2);}_0x537e93=_['merge']({},_0x537e93,_0x53ab2d[_0x7f26('0x57')]);return db[_0x7f26('0xa3')]['count']({'where':_0x537e93[_0x7f26('0x52')]})[_0x7f26('0x38')](function(_0x31f7a7){_0x1f5d99[_0x7f26('0x32')]=_0x31f7a7;if(_0x53ab2d['query'][_0x7f26('0x58')]){_0x537e93[_0x7f26('0x59')]=[{'all':!![]}];}return db[_0x7f26('0xa3')][_0x7f26('0x5a')](_0x537e93);})['then'](function(_0x58bd31){_0x1f5d99[_0x7f26('0x5b')]=_0x58bd31;return _0x1f5d99;});}})[_0x7f26('0x38')](respondWithFilteredResult(_0x514578,_0x537e93))[_0x7f26('0x2b')](handleError(_0x514578,null));};exports['send']=function(_0x3ab3b1,_0x2a26c7,_0x4f5a91){var _0xb15390,_0x6e9e6e={},_0x214a90;if(_0x3ab3b1['body']['to']){_0x214a90=_0x3ab3b1[_0x7f26('0x61')]['to'][0x0];}return db[_0x7f26('0x43')][_0x7f26('0x66')]({'where':{'id':_0x3ab3b1[_0x7f26('0x5d')]['id']},'include':[{'model':db[_0x7f26('0xa8')],'as':_0x7f26('0xa9'),'include':[{'model':db[_0x7f26('0xaa')],'as':'Contacts','where':{'fax':_0x214a90},'limit':0x1,'order':[[_0x7f26('0x9e'),'DESC']]}]}]})[_0x7f26('0x38')](handleEntityNotFound(_0x2a26c7,null))['then'](function(_0x40f1f1){_0xb15390=_0x40f1f1;if(_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')]&&_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')]['length']){for(var _0x56ab7d=0x0;_0x56ab7d<_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')]['length'];_0x56ab7d+=0x1){_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')][_0x56ab7d]={'filename':_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')][_0x56ab7d][_0x7f26('0x3d')],'id':_0x3ab3b1['body'][_0x7f26('0xab')][_0x56ab7d]['id'],'path':path['join'](config[_0x7f26('0xac')],_0x7f26('0xad'),_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')][_0x56ab7d][_0x7f26('0xae')])};}}return respondWithRpcPromise('CheckAfterSend',_0x7f26('0xaf'),{'FaxAccountId':_['isNil'](_0x3ab3b1[_0x7f26('0x5d')]['id'])?undefined:_0x3ab3b1[_0x7f26('0x5d')]['id'],'path':_[_0x7f26('0xb0')](_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')][0x0][_0x7f26('0xb1')])?undefined:_0x3ab3b1['body'][_0x7f26('0xab')][0x0]['path'],'fax':_[_0x7f26('0xb0')](_0x3ab3b1[_0x7f26('0x61')]['to'][0x0])?undefined:_0x3ab3b1[_0x7f26('0x61')]['to'][0x0]},client9002);})[_0x7f26('0x38')](function(){if(_0xb15390){if(_['isNil'](_0x3ab3b1['body']['from'])){_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xb2')]=util[_0x7f26('0xa6')](_0x7f26('0xb3'),_0xb15390[_0x7f26('0x3d')],_0xb15390['fax']);}if(_0xb15390[_0x7f26('0xa9')]){if(_0xb15390[_0x7f26('0xa9')][_0x7f26('0xb4')]['length']){return _0xb15390[_0x7f26('0xa9')][_0x7f26('0xb4')][0x0];}else{return db[_0x7f26('0xaa')][_0x7f26('0x60')](_[_0x7f26('0x1a')](_0x3ab3b1['body'],{'firstName':_0x3ab3b1[_0x7f26('0x61')]['to'][0x0],'phone':_0x3ab3b1[_0x7f26('0x61')]['to'][0x0],'fax':_0x3ab3b1[_0x7f26('0x61')]['to'][0x0],'ListId':_0xb15390[_0x7f26('0xa0')]}));}}else{throw new Error(_0x7f26('0xb5'));}}else{throw new Error(_0x7f26('0xb6'));}})[_0x7f26('0x38')](function(_0xa53895){if(_0xa53895){return db[_0x7f26('0x76')]['find']({'where':{'ContactId':_0xa53895['id'],'closed':![],'FaxAccountId':_0xb15390['id']}})[_0x7f26('0x38')](function(_0x1e679d){if(_0x1e679d){return[_0x1e679d,![]];}return db['FaxInteraction'][_0x7f26('0x60')]({'UserId':_0x3ab3b1['user']['id'],'ContactId':_0xa53895['id'],'FaxAccountId':_0xb15390['id'],'fax':_0x3ab3b1[_0x7f26('0x61')]['to'][0x0],'firstMsgDirection':_0x7f26('0xb7'),'Messages':[_[_0x7f26('0x55')](_0x3ab3b1['body'],{'read':![],'body':_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')][0x0]['filename'],'FaxAccountId':_0xb15390['id'],'UserId':_0x3ab3b1['user']['id'],'ContactId':_0xa53895['id'],'AttachmentId':_0x3ab3b1['body'][_0x7f26('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x7f26('0xa3')],'as':_0x7f26('0xb8')}]})[_0x7f26('0x38')](function(_0x30da05){return[_0x30da05,!![]];});});}else{throw new Error(_0x7f26('0xb9'));}})['spread'](function(_0x1c1623,_0x470dab){if(_0x470dab){return _0x1c1623;}return db[_0x7f26('0xa3')][_0x7f26('0x60')]({'direction':_0x7f26('0xb7'),'read':![],'body':_0x3ab3b1['body'][_0x7f26('0xab')][0x0][_0x7f26('0xba')],'FaxAccountId':_0xb15390['id'],'FaxInteractionId':_0x1c1623['id'],'UserId':_0x3ab3b1[_0x7f26('0x62')]['id'],'ContactId':_0x1c1623['ContactId'],'AttachmentId':_0x3ab3b1['body'][_0x7f26('0xab')][0x0]['id']})['then'](function(_0x3b0ab5){_0x1c1623['dataValues'][_0x7f26('0xb8')]=[];_0x1c1623[_0x7f26('0xbb')][_0x7f26('0xb8')][_0x7f26('0x8e')](_0x3b0ab5[_0x7f26('0xbb')]);return _0x1c1623;});})[_0x7f26('0x38')](function(_0x5e8079){respondWithRpcPromise('SendFax',_0x7f26('0xbc'),{'FaxAccountId':_['isNil'](_0x3ab3b1[_0x7f26('0x5d')]['id'])?undefined:_0x3ab3b1[_0x7f26('0x5d')]['id'],'path':_[_0x7f26('0xb0')](_0x3ab3b1[_0x7f26('0x61')][_0x7f26('0xab')][0x0][_0x7f26('0xb1')])?undefined:_0x3ab3b1['body']['attachments'][0x0][_0x7f26('0xb1')],'fax':_[_0x7f26('0xb0')](_0x3ab3b1[_0x7f26('0x61')]['to'][0x0])?undefined:_0x3ab3b1['body']['to'][0x0],'AttachmentId':_0x3ab3b1[_0x7f26('0x61')]['attachments'][0x0]['id']},client9002)[_0x7f26('0x38')](function(_0x2d3476){logger[_0x7f26('0x23')]('SendFaxRpc,\x20%s',_0x2d3476);})[_0x7f26('0x2b')](function(_0x17d6c6){logger[_0x7f26('0x23')](_0x7f26('0xbd'),_0x17d6c6);});return _0x5e8079;})['then'](respondWithResult(_0x2a26c7,null))[_0x7f26('0x2b')](handleError(_0x2a26c7,null));};exports[_0x7f26('0xbe')]=function(_0x3ac205,_0x44fd6e,_0x5b678a){return db[_0x7f26('0x43')][_0x7f26('0x66')]({'where':{'id':_0x3ac205[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x44fd6e,null))['then'](function(_0x4807ff){if(_0x4807ff){return _0x4807ff['addAgents'](_0x3ac205[_0x7f26('0x61')][_0x7f26('0x74')],_['omit'](_0x3ac205[_0x7f26('0x61')],[_0x7f26('0x74'),'id'])||{})[_0x7f26('0xbf')](function(_0x4362cb){for(var _0x3f5ff1=0x0;_0x3f5ff1<_0x3ac205[_0x7f26('0x61')][_0x7f26('0x74')][_0x7f26('0x5f')];_0x3f5ff1+=0x1){socket[_0x7f26('0xc0')](_0x7f26('0xc1'),{'UserId':Number(_0x3ac205[_0x7f26('0x61')][_0x7f26('0x74')][_0x3f5ff1]),'FaxAccountId':Number(_0x3ac205[_0x7f26('0x5d')]['id'])});}return _0x4362cb;});}})[_0x7f26('0x38')](respondWithResult(_0x44fd6e,null))[_0x7f26('0x2b')](handleError(_0x44fd6e,null));};exports['removeAgents']=function(_0x4ff967,_0x2e3892,_0x4b105a){return db['FaxAccount'][_0x7f26('0x66')]({'where':{'id':_0x4ff967[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0x2e3892,null))[_0x7f26('0x38')](function(_0x458db9){if(_0x458db9){return _0x458db9['removeAgents'](_0x4ff967[_0x7f26('0x48')][_0x7f26('0x74')])['then'](function(){if(_[_0x7f26('0xc2')](_0x4ff967[_0x7f26('0x48')][_0x7f26('0x74')])){for(var _0x42c899=0x0;_0x42c899<_0x4ff967[_0x7f26('0x48')][_0x7f26('0x74')][_0x7f26('0x5f')];_0x42c899+=0x1){socket[_0x7f26('0xc0')]('userFaxAccount:remove',{'UserId':Number(_0x4ff967[_0x7f26('0x48')]['ids'][_0x42c899]),'FaxAccountId':Number(_0x4ff967[_0x7f26('0x5d')]['id'])});}}else{socket[_0x7f26('0xc0')](_0x7f26('0xc3'),{'UserId':Number(_0x4ff967['query']['ids']),'FaxAccountId':Number(_0x4ff967[_0x7f26('0x5d')]['id'])});}});}})[_0x7f26('0x38')](respondWithStatusCode(_0x2e3892,null))['catch'](handleError(_0x2e3892,null));};exports[_0x7f26('0xc4')]=function(_0x69f413,_0xbd03b2,_0x2b7d96){var _0x5517ec={};var _0x54e614={};var _0x2cc342;var _0x4b5de9;return db[_0x7f26('0x43')][_0x7f26('0x6d')]({'where':{'id':_0x69f413[_0x7f26('0x5d')]['id']}})[_0x7f26('0x38')](handleEntityNotFound(_0xbd03b2,null))[_0x7f26('0x38')](function(_0x38bc59){if(_0x38bc59){_0x2cc342=_0x38bc59;_0x54e614[_0x7f26('0x4c')]=_['keys'](db[_0x7f26('0x79')][_0x7f26('0x44')]);_0x54e614['query']=_[_0x7f26('0x5e')](_0x69f413['query']);_0x54e614['filters']=_[_0x7f26('0x4b')](_0x54e614[_0x7f26('0x4c')],_0x54e614[_0x7f26('0x48')]);_0x5517ec[_0x7f26('0x4a')]=_[_0x7f26('0x4b')](_0x54e614[_0x7f26('0x4c')],qs[_0x7f26('0x4d')](_0x69f413[_0x7f26('0x48')][_0x7f26('0x4d')]));_0x5517ec[_0x7f26('0x4a')]=_0x5517ec[_0x7f26('0x4a')]['length']?_0x5517ec[_0x7f26('0x4a')]:_0x54e614[_0x7f26('0x4c')];_0x5517ec['order']=qs['sort'](_0x69f413[_0x7f26('0x48')][_0x7f26('0x51')]);_0x5517ec[_0x7f26('0x52')]=qs[_0x7f26('0x49')](_[_0x7f26('0x53')](_0x69f413[_0x7f26('0x48')],_0x54e614['filters']));if(_0x69f413[_0x7f26('0x48')]['filter']){_0x5517ec[_0x7f26('0x52')]=_['merge'](_0x5517ec['where'],{'$or':_[_0x7f26('0x42')](_0x5517ec[_0x7f26('0x4a')],function(_0x213358){var _0x363750={};_0x363750[_0x213358]={'$like':'%'+_0x69f413['query'][_0x7f26('0x54')]+'%'};return _0x363750;})});}_0x5517ec=_['merge']({},_0x5517ec,_0x69f413['options']);return _0x2cc342[_0x7f26('0xc4')](_0x5517ec);}})[_0x7f26('0x38')](function(_0x996a0a){if(_0x996a0a){_0x4b5de9=_0x996a0a[_0x7f26('0x5f')];if(!_0x69f413[_0x7f26('0x48')][_0x7f26('0x4e')]('nolimit')){_0x5517ec[_0x7f26('0x31')]=qs[_0x7f26('0x31')](_0x69f413[_0x7f26('0x48')][_0x7f26('0x31')]);_0x5517ec[_0x7f26('0x2f')]=qs[_0x7f26('0x2f')](_0x69f413[_0x7f26('0x48')][_0x7f26('0x2f')]);}return _0x2cc342['getAgents'](_0x5517ec);}})[_0x7f26('0x38')](function(_0xcb4fef){if(_0xcb4fef){return _0xcb4fef?{'count':_0x4b5de9,'rows':_0xcb4fef}:null;}})[_0x7f26('0x38')](respondWithResult(_0xbd03b2,null))[_0x7f26('0x2b')](handleError(_0xbd03b2,null));};
\ No newline at end of file
+var _0x3ff7=['order','count','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','pick','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','READ_COMMITTED','FaxApplication','findAndCountAll','priority','getApplications','context','exten','app','system','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','FAXOPT(','Wait','addAccountApplications','transaction','bulkCreate','updateAccountApplications','update','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','Contact\x20not\x20found','out','filename','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','info','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','http','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','save','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','FaxAccount','includeAll','include','findAll','rows','show','params','keys','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','FaxAccountId','Disposition','findOne','nolimit'];(function(_0x389636,_0x2ede39){var _0x3caf83=function(_0x1db0b3){while(--_0x1db0b3){_0x389636['push'](_0x389636['shift']());}};_0x3caf83(++_0x2ede39);}(_0x3ff7,0x124));var _0x73ff=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x3ff7[_0x37d3f3];return _0x185c9c;};'use strict';var emlformat=require(_0x73ff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x73ff('0x1'));var moment=require(_0x73ff('0x2'));var BPromise=require(_0x73ff('0x3'));var Mustache=require(_0x73ff('0x4'));var util=require(_0x73ff('0x5'));var path=require(_0x73ff('0x6'));var sox=require(_0x73ff('0x7'));var csv=require(_0x73ff('0x8'));var ejs=require(_0x73ff('0x9'));var fs=require('fs');var fs_extra=require(_0x73ff('0xa'));var _=require('lodash');var squel=require(_0x73ff('0xb'));var crypto=require(_0x73ff('0xc'));var jsforce=require(_0x73ff('0xd'));var deskjs=require(_0x73ff('0xe'));var toCsv=require('to-csv');var querystring=require(_0x73ff('0xf'));var Papa=require(_0x73ff('0x10'));var Redis=require(_0x73ff('0x11'));var authService=require(_0x73ff('0x12'));var qs=require(_0x73ff('0x13'));var as=require(_0x73ff('0x14'));var hardwareService=require(_0x73ff('0x15'));var logger=require(_0x73ff('0x16'))(_0x73ff('0x17'));var utils=require(_0x73ff('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x73ff('0x19'));var db=require(_0x73ff('0x1a'))['db'];config[_0x73ff('0x1b')]=_[_0x73ff('0x1c')](config[_0x73ff('0x1b')],{'host':_0x73ff('0x1d'),'port':0x18eb});var socket=require(_0x73ff('0x1e'))(new Redis(config[_0x73ff('0x1b')]));require(_0x73ff('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x73ff('0x20')]({'port':0x232c});var client9002=jayson[_0x73ff('0x21')][_0x73ff('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x342756,_0x5a0e41,_0x27279b,_0x13d30d){return new BPromise(function(_0x12d405,_0x241a3b){var _0x234fd5=_0x13d30d||client;return _0x234fd5[_0x73ff('0x22')](_0x342756,_0x27279b)[_0x73ff('0x23')](function(_0x5aec17){logger['info'](_0x73ff('0x24'),_0x5a0e41,_0x73ff('0x25'));logger[_0x73ff('0x26')](_0x73ff('0x27'),_0x5a0e41,_0x73ff('0x25'),JSON[_0x73ff('0x28')](_0x5aec17));if(_0x5aec17[_0x73ff('0x29')]){if(_0x5aec17[_0x73ff('0x29')][_0x73ff('0x2a')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5a0e41,_0x5aec17[_0x73ff('0x29')]['message']);return _0x241a3b(_0x5aec17[_0x73ff('0x29')][_0x73ff('0x2b')]);}logger[_0x73ff('0x29')](_0x73ff('0x24'),_0x5a0e41,_0x5aec17['error'][_0x73ff('0x2b')]);return _0x12d405(_0x5aec17[_0x73ff('0x29')][_0x73ff('0x2b')]);}else{logger['info'](_0x73ff('0x24'),_0x5a0e41,_0x73ff('0x25'));_0x12d405(_0x5aec17[_0x73ff('0x2c')][_0x73ff('0x2b')]);}})[_0x73ff('0x2d')](function(_0x1ca258){logger[_0x73ff('0x29')](_0x73ff('0x24'),_0x5a0e41,_0x1ca258);_0x241a3b(_0x1ca258);});});}function respondWithStatusCode(_0x21ad6e,_0x18f5e6){_0x18f5e6=_0x18f5e6||0xcc;return function(_0x4c73b5){if(_0x4c73b5){return _0x21ad6e[_0x73ff('0x2e')](_0x18f5e6);}return _0x21ad6e['status'](_0x18f5e6)[_0x73ff('0x2f')]();};}function respondWithResult(_0x5e588b,_0x450355){_0x450355=_0x450355||0xc8;return function(_0x54ca3e){if(_0x54ca3e){return _0x5e588b[_0x73ff('0x30')](_0x450355)[_0x73ff('0x31')](_0x54ca3e);}};}function respondWithFilteredResult(_0x4835e5,_0xf7e7ac){return function(_0x49030f){if(_0x49030f){var _0xf5ec0d=typeof _0xf7e7ac[_0x73ff('0x32')]===_0x73ff('0x33')&&typeof _0xf7e7ac[_0x73ff('0x34')]==='undefined';var _0x2def4f=_0x49030f['count'];var _0x5e57d3=_0xf5ec0d?0x0:_0xf7e7ac[_0x73ff('0x32')];var _0x38eeeb=_0xf5ec0d?_0x49030f['count']:_0xf7e7ac[_0x73ff('0x32')]+_0xf7e7ac[_0x73ff('0x34')];var _0x1e2a92;if(_0x38eeeb>=_0x2def4f){_0x38eeeb=_0x2def4f;_0x1e2a92=0xc8;}else{_0x1e2a92=0xce;}_0x4835e5[_0x73ff('0x30')](_0x1e2a92);return _0x4835e5[_0x73ff('0x35')](_0x73ff('0x36'),_0x5e57d3+'-'+_0x38eeeb+'/'+_0x2def4f)[_0x73ff('0x31')](_0x49030f);}return null;};}function patchUpdates(_0x5c66b6){return function(_0x229b4b){try{jsonpatch['apply'](_0x229b4b,_0x5c66b6,!![]);}catch(_0x401d63){return BPromise['reject'](_0x401d63);}return _0x229b4b[_0x73ff('0x37')]();};}function saveUpdates(_0x3cd8b9,_0x2e761d){return function(_0x152522){if(_0x152522){return _0x152522['update'](_0x3cd8b9)['then'](function(_0x8f1b28){return _0x8f1b28;});}return null;};}function removeEntity(_0x32c748,_0x216fbf){return function(_0x27c2bf){if(_0x27c2bf){return _0x27c2bf[_0x73ff('0x38')]()[_0x73ff('0x23')](function(){var _0x1cf935=_0x27c2bf[_0x73ff('0x39')]({'plain':!![]});var _0x28a9df=_0x73ff('0x3a');return db[_0x73ff('0x3b')]['destroy']({'where':{'type':_0x28a9df,'resourceId':_0x1cf935['id']}})['then'](function(){return _0x27c2bf;});})[_0x73ff('0x23')](function(){_0x32c748[_0x73ff('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x263592,_0x793054){return function(_0xc19540){if(!_0xc19540){_0x263592['sendStatus'](0x194);}return _0xc19540;};}function handleError(_0x2a7bcf,_0x33dd6c){_0x33dd6c=_0x33dd6c||0x1f4;return function(_0x3b72e1){logger['error'](_0x3b72e1[_0x73ff('0x3c')]);if(_0x3b72e1['name']){delete _0x3b72e1[_0x73ff('0x3d')];}_0x2a7bcf[_0x73ff('0x30')](_0x33dd6c)[_0x73ff('0x3e')](_0x3b72e1);};}exports[_0x73ff('0x3f')]=function(_0x47ad80,_0x1617d3){var _0x4a0ceb={'include':[{'model':db[_0x73ff('0x40')],'as':_0x73ff('0x41')}]},_0x26ced1={},_0x456ff8={'count':0x0,'rows':[]};var _0x38cd22=_[_0x73ff('0x42')](db['FaxAccount']['rawAttributes'],function(_0x4a338b){return{'name':_0x4a338b[_0x73ff('0x43')],'type':_0x4a338b['type'][_0x73ff('0x44')]};});_0x26ced1[_0x73ff('0x45')]=_['map'](_0x38cd22,'name');_0x26ced1[_0x73ff('0x46')]=_['keys'](_0x47ad80[_0x73ff('0x46')]);_0x26ced1[_0x73ff('0x47')]=_[_0x73ff('0x48')](_0x26ced1[_0x73ff('0x45')],_0x26ced1[_0x73ff('0x46')]);_0x4a0ceb[_0x73ff('0x49')]=_[_0x73ff('0x48')](_0x26ced1[_0x73ff('0x45')],qs['fields'](_0x47ad80[_0x73ff('0x46')][_0x73ff('0x4a')]));_0x4a0ceb[_0x73ff('0x49')]=_0x4a0ceb[_0x73ff('0x49')][_0x73ff('0x4b')]?_0x4a0ceb['attributes']:_0x26ced1[_0x73ff('0x45')];if(!_0x47ad80[_0x73ff('0x46')][_0x73ff('0x4c')]('nolimit')){_0x4a0ceb['limit']=qs[_0x73ff('0x34')](_0x47ad80[_0x73ff('0x46')][_0x73ff('0x34')]);_0x4a0ceb['offset']=qs[_0x73ff('0x32')](_0x47ad80[_0x73ff('0x46')][_0x73ff('0x32')]);}_0x4a0ceb['order']=qs['sort'](_0x47ad80[_0x73ff('0x46')][_0x73ff('0x4d')]);_0x4a0ceb[_0x73ff('0x4e')]=qs['filters'](_['pick'](_0x47ad80['query'],_0x26ced1[_0x73ff('0x47')]),_0x38cd22);if(_0x47ad80[_0x73ff('0x46')][_0x73ff('0x4f')]){_0x4a0ceb[_0x73ff('0x4e')]=_[_0x73ff('0x50')](_0x4a0ceb[_0x73ff('0x4e')],{'$or':_[_0x73ff('0x42')](_0x38cd22,function(_0x57f145){if(_0x57f145['type']!==_0x73ff('0x51')){var _0xacaf43={};_0xacaf43[_0x57f145[_0x73ff('0x3d')]]={'$like':'%'+_0x47ad80[_0x73ff('0x46')]['filter']+'%'};return _0xacaf43;}})});}_0x4a0ceb=_[_0x73ff('0x50')]({},_0x4a0ceb,_0x47ad80[_0x73ff('0x52')]);var _0x1f7a28={'where':_0x4a0ceb[_0x73ff('0x4e')]};return db[_0x73ff('0x53')]['count'](_0x1f7a28)[_0x73ff('0x23')](function(_0x3df3ea){_0x456ff8['count']=_0x3df3ea;if(_0x47ad80[_0x73ff('0x46')][_0x73ff('0x54')]){_0x4a0ceb[_0x73ff('0x55')]=[{'all':!![]}];}return db[_0x73ff('0x53')][_0x73ff('0x56')](_0x4a0ceb);})[_0x73ff('0x23')](function(_0x1f4208){_0x456ff8[_0x73ff('0x57')]=_0x1f4208;return _0x456ff8;})[_0x73ff('0x23')](respondWithFilteredResult(_0x1617d3,_0x4a0ceb))['catch'](handleError(_0x1617d3,null));};exports[_0x73ff('0x58')]=function(_0x23f2b0,_0xe8c719){var _0x4b19ea={'raw':![],'where':{'id':_0x23f2b0[_0x73ff('0x59')]['id']},'include':[{'model':db[_0x73ff('0x40')],'as':_0x73ff('0x41')}]},_0x43b00d={};_0x43b00d[_0x73ff('0x45')]=_[_0x73ff('0x5a')](db[_0x73ff('0x53')][_0x73ff('0x5b')]);_0x43b00d['query']=_[_0x73ff('0x5a')](_0x23f2b0[_0x73ff('0x46')]);_0x43b00d['filters']=_[_0x73ff('0x48')](_0x43b00d[_0x73ff('0x45')],_0x43b00d[_0x73ff('0x46')]);_0x4b19ea[_0x73ff('0x49')]=_[_0x73ff('0x48')](_0x43b00d[_0x73ff('0x45')],qs['fields'](_0x23f2b0['query']['fields']));_0x4b19ea[_0x73ff('0x49')]=_0x4b19ea[_0x73ff('0x49')]['length']?_0x4b19ea[_0x73ff('0x49')]:_0x43b00d[_0x73ff('0x45')];if(_0x23f2b0['query']['includeAll']){_0x4b19ea['include']=[{'all':!![]}];}_0x4b19ea=_[_0x73ff('0x50')]({},_0x4b19ea,_0x23f2b0['options']);return db['FaxAccount']['find'](_0x4b19ea)[_0x73ff('0x23')](handleEntityNotFound(_0xe8c719,null))[_0x73ff('0x23')](respondWithResult(_0xe8c719,null))[_0x73ff('0x2d')](handleError(_0xe8c719,null));};exports[_0x73ff('0x5c')]=function(_0x426bd2,_0x1ffb28){return db['FaxAccount'][_0x73ff('0x5c')](_0x426bd2['body'],{})['then'](function(_0x16df75){var _0x5886df=_0x426bd2[_0x73ff('0x5d')][_0x73ff('0x39')]({'plain':!![]});if(!_0x5886df)throw new Error(_0x73ff('0x5e'));if(_0x5886df['role']===_0x73ff('0x5d')){var _0x1cf516=_0x16df75[_0x73ff('0x39')]({'plain':!![]});var _0x5d9474=_0x73ff('0x3a');return db[_0x73ff('0x5f')]['find']({'where':{'name':_0x5d9474,'userProfileId':_0x5886df['userProfileId']},'raw':!![]})[_0x73ff('0x23')](function(_0x281e15){if(_0x281e15&&_0x281e15[_0x73ff('0x60')]===0x0){return db[_0x73ff('0x3b')][_0x73ff('0x5c')]({'name':_0x1cf516[_0x73ff('0x3d')],'resourceId':_0x1cf516['id'],'type':_0x281e15[_0x73ff('0x3d')],'sectionId':_0x281e15['id']},{})[_0x73ff('0x23')](function(){return _0x16df75;});}else{return _0x16df75;}})['catch'](function(_0x557bcc){logger[_0x73ff('0x29')](_0x73ff('0x61'),_0x557bcc);throw _0x557bcc;});}return _0x16df75;})[_0x73ff('0x23')](respondWithResult(_0x1ffb28,0xc9))[_0x73ff('0x2d')](handleError(_0x1ffb28,null));};exports['update']=function(_0x5b90f9,_0x2de882){if(_0x5b90f9[_0x73ff('0x62')]['id']){delete _0x5b90f9['body']['id'];}return db[_0x73ff('0x53')][_0x73ff('0x63')]({'where':{'id':_0x5b90f9[_0x73ff('0x59')]['id']},'include':[{'model':db[_0x73ff('0x40')],'as':_0x73ff('0x41')}]})[_0x73ff('0x23')](handleEntityNotFound(_0x2de882,null))[_0x73ff('0x23')](saveUpdates(_0x5b90f9[_0x73ff('0x62')],null))['then'](respondWithResult(_0x2de882,null))['catch'](handleError(_0x2de882,null));};exports['destroy']=function(_0x2a3ae4,_0x5c8bff){return db[_0x73ff('0x53')][_0x73ff('0x63')]({'where':{'id':_0x2a3ae4['params']['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x5c8bff,null))[_0x73ff('0x23')](removeEntity(_0x5c8bff,null))[_0x73ff('0x2d')](handleError(_0x5c8bff,null));};exports[_0x73ff('0x64')]=function(_0x487688,_0x1edad0){return db[_0x73ff('0x53')][_0x73ff('0x64')]()[_0x73ff('0x23')](respondWithResult(_0x1edad0,null))[_0x73ff('0x2d')](handleError(_0x1edad0,null));};exports[_0x73ff('0x65')]=function(_0xb1acce,_0x26e60e,_0x12af47){if(_0xb1acce[_0x73ff('0x62')]['id']){delete _0xb1acce[_0x73ff('0x62')]['id'];}return db[_0x73ff('0x53')][_0x73ff('0x63')]({'where':{'id':_0xb1acce[_0x73ff('0x59')]['id']}})['then'](handleEntityNotFound(_0x26e60e,null))[_0x73ff('0x23')](function(_0x2e271f){if(_0x2e271f){_0xb1acce['body'][_0x73ff('0x66')]=_0x2e271f['id'];return db[_0x73ff('0x67')][_0x73ff('0x5c')](_0xb1acce['body']);}})[_0x73ff('0x23')](respondWithResult(_0x26e60e,null))[_0x73ff('0x2d')](handleError(_0x26e60e,null));};exports['getDispositions']=function(_0x214277,_0x3d96ee,_0x1bdb72){var _0x1536ee={'raw':![],'where':{}};var _0x5edd2f={};var _0x3c63b0={'count':0x0,'rows':[]};return db[_0x73ff('0x53')][_0x73ff('0x68')]({'where':{'id':_0x214277['params']['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x3d96ee,null))[_0x73ff('0x23')](function(_0x33eef2){if(_0x33eef2){_0x5edd2f[_0x73ff('0x45')]=_[_0x73ff('0x5a')](db[_0x73ff('0x67')][_0x73ff('0x5b')]);_0x5edd2f['query']=_['keys'](_0x214277[_0x73ff('0x46')]);_0x5edd2f[_0x73ff('0x47')]=_[_0x73ff('0x48')](_0x5edd2f[_0x73ff('0x45')],_0x5edd2f[_0x73ff('0x46')]);_0x1536ee['attributes']=_['intersection'](_0x5edd2f[_0x73ff('0x45')],qs[_0x73ff('0x4a')](_0x214277[_0x73ff('0x46')][_0x73ff('0x4a')]));_0x1536ee[_0x73ff('0x49')]=_0x1536ee[_0x73ff('0x49')]['length']?_0x1536ee[_0x73ff('0x49')]:_0x5edd2f[_0x73ff('0x45')];if(!_0x214277['query']['hasOwnProperty'](_0x73ff('0x69'))){_0x1536ee['limit']=qs[_0x73ff('0x34')](_0x214277[_0x73ff('0x46')]['limit']);_0x1536ee[_0x73ff('0x32')]=qs[_0x73ff('0x32')](_0x214277[_0x73ff('0x46')][_0x73ff('0x32')]);}_0x1536ee[_0x73ff('0x6a')]=qs[_0x73ff('0x4d')](_0x214277[_0x73ff('0x46')]['sort']);_0x1536ee[_0x73ff('0x4e')]=qs[_0x73ff('0x47')](_['pick'](_0x214277[_0x73ff('0x46')],_0x5edd2f['filters']));_0x1536ee[_0x73ff('0x4e')][_0x73ff('0x66')]=_0x33eef2['id'];if(_0x214277[_0x73ff('0x46')][_0x73ff('0x4f')]){_0x1536ee['where']=_[_0x73ff('0x50')](_0x1536ee[_0x73ff('0x4e')],{'$or':_['map'](_0x1536ee[_0x73ff('0x49')],function(_0x33a62c){var _0x4ccba4={};_0x4ccba4[_0x33a62c]={'$like':'%'+_0x214277[_0x73ff('0x46')][_0x73ff('0x4f')]+'%'};return _0x4ccba4;})});}_0x1536ee=_[_0x73ff('0x50')]({},_0x1536ee,_0x214277[_0x73ff('0x52')]);return db[_0x73ff('0x67')][_0x73ff('0x6b')]({'where':_0x1536ee[_0x73ff('0x4e')]})[_0x73ff('0x23')](function(_0x5dbe78){_0x3c63b0[_0x73ff('0x6b')]=_0x5dbe78;if(_0x214277[_0x73ff('0x46')][_0x73ff('0x54')]){_0x1536ee[_0x73ff('0x55')]=[{'all':!![]}];}return db[_0x73ff('0x67')][_0x73ff('0x56')](_0x1536ee);})[_0x73ff('0x23')](function(_0x1fe971){_0x3c63b0['rows']=_0x1fe971;return _0x3c63b0;});}})[_0x73ff('0x23')](respondWithFilteredResult(_0x3d96ee,_0x1536ee))[_0x73ff('0x2d')](handleError(_0x3d96ee,null));};exports[_0x73ff('0x6c')]=function(_0x1c565e,_0x537e56,_0x595cc7){return db[_0x73ff('0x53')][_0x73ff('0x63')]({'where':{'id':_0x1c565e['params']['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x537e56,null))[_0x73ff('0x23')](function(_0x447926){if(_0x447926){return _0x447926[_0x73ff('0x6c')](_0x1c565e['query'][_0x73ff('0x6d')]);}})[_0x73ff('0x23')](respondWithStatusCode(_0x537e56,null))['catch'](handleError(_0x537e56,null));};exports[_0x73ff('0x6e')]=function(_0x502393,_0x509c95,_0x4e426e){if(_0x502393[_0x73ff('0x62')]['id']){delete _0x502393[_0x73ff('0x62')]['id'];}return db[_0x73ff('0x53')][_0x73ff('0x63')]({'where':{'id':_0x502393['params']['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x509c95,null))[_0x73ff('0x23')](function(_0x13820e){if(_0x13820e){_0x502393[_0x73ff('0x62')][_0x73ff('0x66')]=_0x13820e['id'];return db['CannedAnswer'][_0x73ff('0x5c')](_0x502393[_0x73ff('0x62')]);}})['then'](respondWithResult(_0x509c95,null))[_0x73ff('0x2d')](handleError(_0x509c95,null));};exports[_0x73ff('0x6f')]=function(_0x2f7ec4,_0x16062f,_0x139e50){var _0x51eddb={'raw':![],'where':{}};var _0x1c2ba9={};var _0x5035b3={'count':0x0,'rows':[]};return db[_0x73ff('0x53')][_0x73ff('0x68')]({'where':{'id':_0x2f7ec4[_0x73ff('0x59')]['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x16062f,null))[_0x73ff('0x23')](function(_0x5a765d){if(_0x5a765d){_0x1c2ba9[_0x73ff('0x45')]=_[_0x73ff('0x5a')](db[_0x73ff('0x70')]['rawAttributes']);_0x1c2ba9[_0x73ff('0x46')]=_[_0x73ff('0x5a')](_0x2f7ec4[_0x73ff('0x46')]);_0x1c2ba9[_0x73ff('0x47')]=_[_0x73ff('0x48')](_0x1c2ba9[_0x73ff('0x45')],_0x1c2ba9['query']);_0x51eddb['attributes']=_['intersection'](_0x1c2ba9[_0x73ff('0x45')],qs['fields'](_0x2f7ec4[_0x73ff('0x46')]['fields']));_0x51eddb[_0x73ff('0x49')]=_0x51eddb[_0x73ff('0x49')]['length']?_0x51eddb[_0x73ff('0x49')]:_0x1c2ba9[_0x73ff('0x45')];if(!_0x2f7ec4['query']['hasOwnProperty'](_0x73ff('0x69'))){_0x51eddb[_0x73ff('0x34')]=qs['limit'](_0x2f7ec4[_0x73ff('0x46')]['limit']);_0x51eddb[_0x73ff('0x32')]=qs[_0x73ff('0x32')](_0x2f7ec4[_0x73ff('0x46')][_0x73ff('0x32')]);}_0x51eddb['order']=qs['sort'](_0x2f7ec4['query']['sort']);_0x51eddb[_0x73ff('0x4e')]=qs['filters'](_[_0x73ff('0x71')](_0x2f7ec4[_0x73ff('0x46')],_0x1c2ba9[_0x73ff('0x47')]));_0x51eddb[_0x73ff('0x4e')][_0x73ff('0x66')]=_0x5a765d['id'];if(_0x2f7ec4[_0x73ff('0x46')][_0x73ff('0x4f')]){_0x51eddb[_0x73ff('0x4e')]=_['merge'](_0x51eddb[_0x73ff('0x4e')],{'$or':_[_0x73ff('0x42')](_0x51eddb[_0x73ff('0x49')],function(_0x438495){var _0x2214eb={};_0x2214eb[_0x438495]={'$like':'%'+_0x2f7ec4[_0x73ff('0x46')]['filter']+'%'};return _0x2214eb;})});}_0x51eddb=_['merge']({},_0x51eddb,_0x2f7ec4[_0x73ff('0x52')]);return db['CannedAnswer']['count']({'where':_0x51eddb['where']})['then'](function(_0x28552f){_0x5035b3[_0x73ff('0x6b')]=_0x28552f;if(_0x2f7ec4[_0x73ff('0x46')][_0x73ff('0x54')]){_0x51eddb[_0x73ff('0x55')]=[{'all':!![]}];}return db[_0x73ff('0x70')][_0x73ff('0x56')](_0x51eddb);})[_0x73ff('0x23')](function(_0x12e6a4){_0x5035b3['rows']=_0x12e6a4;return _0x5035b3;});}})[_0x73ff('0x23')](respondWithFilteredResult(_0x16062f,_0x51eddb))['catch'](handleError(_0x16062f,null));};exports['removeAnswers']=function(_0x5e0452,_0x2c4a0c,_0xa90e25){return db[_0x73ff('0x53')]['find']({'where':{'id':_0x5e0452['params']['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x2c4a0c,null))[_0x73ff('0x23')](function(_0x3e52af){if(_0x3e52af){return _0x3e52af[_0x73ff('0x72')](_0x5e0452['query'][_0x73ff('0x6d')]);}})[_0x73ff('0x23')](respondWithStatusCode(_0x2c4a0c,null))[_0x73ff('0x2d')](handleError(_0x2c4a0c,null));};exports[_0x73ff('0x73')]=function(_0x407a17,_0xb05aa8,_0x4c92cf){return db[_0x73ff('0x74')][_0x73ff('0x63')]({'where':{'id':_0x407a17['params']['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0xb05aa8,null))[_0x73ff('0x23')](function(_0x9b0835){if(_0x9b0835){return _0x9b0835['addInteraction'](_0x407a17[_0x73ff('0x62')]['ids'],_[_0x73ff('0x75')](_0x407a17[_0x73ff('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0xb05aa8,null))['catch'](handleError(_0xb05aa8,null));};exports[_0x73ff('0x76')]=function(_0x551a9e,_0x12588e,_0x23d0eb){var _0x25879f={'raw':![],'where':{}};var _0x190278={};var _0x1ed870={'count':0x0,'rows':[]};return db[_0x73ff('0x53')]['findOne']({'where':{'id':_0x551a9e[_0x73ff('0x59')]['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x12588e,null))[_0x73ff('0x23')](function(_0x3271d2){if(_0x3271d2){_0x190278[_0x73ff('0x45')]=_[_0x73ff('0x5a')](db['FaxInteraction'][_0x73ff('0x5b')]);_0x190278[_0x73ff('0x46')]=_[_0x73ff('0x5a')](_0x551a9e[_0x73ff('0x46')]);_0x190278[_0x73ff('0x47')]=_[_0x73ff('0x48')](_0x190278[_0x73ff('0x45')],_0x190278[_0x73ff('0x46')]);_0x25879f['attributes']=_[_0x73ff('0x48')](_0x190278[_0x73ff('0x45')],qs['fields'](_0x551a9e[_0x73ff('0x46')]['fields']));_0x25879f[_0x73ff('0x49')]=_0x25879f[_0x73ff('0x49')][_0x73ff('0x4b')]?_0x25879f[_0x73ff('0x49')]:_0x190278[_0x73ff('0x45')];if(!_0x551a9e[_0x73ff('0x46')][_0x73ff('0x4c')](_0x73ff('0x69'))){_0x25879f['limit']=qs[_0x73ff('0x34')](_0x551a9e[_0x73ff('0x46')][_0x73ff('0x34')]);_0x25879f[_0x73ff('0x32')]=qs[_0x73ff('0x32')](_0x551a9e[_0x73ff('0x46')][_0x73ff('0x32')]);}_0x25879f['order']=qs['sort'](_0x551a9e[_0x73ff('0x46')][_0x73ff('0x4d')]);_0x25879f[_0x73ff('0x4e')]=qs['filters'](_['pick'](_0x551a9e[_0x73ff('0x46')],_0x190278['filters']));_0x25879f[_0x73ff('0x4e')][_0x73ff('0x66')]=_0x3271d2['id'];if(_0x551a9e['query'][_0x73ff('0x4f')]){_0x25879f['where']=_[_0x73ff('0x50')](_0x25879f[_0x73ff('0x4e')],{'$or':_['map'](_0x25879f[_0x73ff('0x49')],function(_0x138e31){var _0x409881={};_0x409881[_0x138e31]={'$like':'%'+_0x551a9e[_0x73ff('0x46')][_0x73ff('0x4f')]+'%'};return _0x409881;})});}_0x25879f=_[_0x73ff('0x50')]({},_0x25879f,_0x551a9e[_0x73ff('0x52')]);return db[_0x73ff('0x74')][_0x73ff('0x6b')]({'where':_0x25879f['where']})[_0x73ff('0x23')](function(_0xa0284){_0x1ed870['count']=_0xa0284;if(_0x551a9e[_0x73ff('0x46')]['includeAll']){_0x25879f[_0x73ff('0x55')]=[{'model':db[_0x73ff('0x77')],'as':_0x73ff('0x78'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x73ff('0x3d'),_0x73ff('0x79'),_0x73ff('0x7a')],'required':![]},{'model':db[_0x73ff('0x7b')],'as':_0x73ff('0x7c'),'attributes':['id','name',_0x73ff('0x7d')],'where':_0x551a9e[_0x73ff('0x46')]['tag']?{'id':_0x551a9e[_0x73ff('0x46')]['tag']}:undefined,'required':_0x551a9e[_0x73ff('0x46')][_0x73ff('0x7e')]?!![]:![]}];}return db[_0x73ff('0x74')]['findAll'](_0x25879f);})[_0x73ff('0x23')](function(_0x215bd4){_0x1ed870[_0x73ff('0x57')]=_0x215bd4;return _0x1ed870;});}})[_0x73ff('0x23')](respondWithFilteredResult(_0x12588e,_0x25879f))[_0x73ff('0x2d')](handleError(_0x12588e,null));};exports[_0x73ff('0x7f')]=function(_0x4fb163,_0x1e71cc){var _0x43858a=_0x4fb163['params']['id'];var _0x61de19=_0x4fb163[_0x73ff('0x62')];var _0x25347d=0xc8;var _0x113922=null;return db[_0x73ff('0x80')]['transaction']({'isolationLevel':db[_0x73ff('0x80')][_0x73ff('0x81')]['ISOLATION_LEVELS'][_0x73ff('0x82')]},function(_0x4e8122){return db[_0x73ff('0x53')]['findOne']({'where':{'id':_0x43858a},'transaction':_0x4e8122})['then'](function(_0x51e657){if(_0x51e657){return db[_0x73ff('0x83')][_0x73ff('0x38')]({'where':{'FaxAccountId':_0x43858a},'transaction':_0x4e8122})[_0x73ff('0x23')](function(){var _0x18b922=_[_0x73ff('0x42')](_0x61de19,function(_0x4cacaf){_0x4cacaf[_0x73ff('0x66')]=_0x43858a;return _0x4cacaf;});return db[_0x73ff('0x83')]['bulkCreate'](_0x18b922,{'transaction':_0x4e8122});});}else{_0x25347d=0x194;_0x113922=[];}});})[_0x73ff('0x23')](function(){if(_0x25347d!==0x194){return db[_0x73ff('0x83')][_0x73ff('0x84')]({'where':{'FaxAccountId':_0x43858a},'order':_0x73ff('0x85')})[_0x73ff('0x23')](function(_0x12d823){_0x113922=_0x12d823;});}})['catch'](function(_0x2868a3){_0x25347d=0x1f4;logger[_0x73ff('0x29')](_0x2868a3[_0x73ff('0x3c')]);if(_0x2868a3[_0x73ff('0x3d')]){delete _0x2868a3[_0x73ff('0x3d')];}_0x113922=_0x2868a3;})['finally'](function(){if(_0x113922===null){_0x1e71cc[_0x73ff('0x2e')](_0x25347d);}else{if(_0x25347d===0x1f4){_0x1e71cc[_0x73ff('0x30')](_0x25347d)['send'](_0x113922);}else{_0x1e71cc[_0x73ff('0x30')](_0x25347d)['json'](_0x113922);}}});};exports[_0x73ff('0x86')]=function(_0x1d6d08,_0x3845cc,_0xb31988){var _0x55f446={};var _0x18af06={};var _0x3d5607;var _0xdf1d64;return db[_0x73ff('0x53')][_0x73ff('0x68')]({'where':{'id':_0x1d6d08[_0x73ff('0x59')]['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x3845cc,null))[_0x73ff('0x23')](function(_0x120816){if(_0x120816){_0x3d5607=_0x120816;_0x18af06[_0x73ff('0x45')]=_[_0x73ff('0x5a')](db[_0x73ff('0x83')]['rawAttributes']);_0x18af06[_0x73ff('0x46')]=_[_0x73ff('0x5a')](_0x1d6d08['query']);_0x18af06[_0x73ff('0x47')]=_[_0x73ff('0x48')](_0x18af06[_0x73ff('0x45')],_0x18af06[_0x73ff('0x46')]);_0x55f446[_0x73ff('0x49')]=_[_0x73ff('0x48')](_0x18af06[_0x73ff('0x45')],qs[_0x73ff('0x4a')](_0x1d6d08[_0x73ff('0x46')]['fields']));_0x55f446[_0x73ff('0x49')]=_0x55f446[_0x73ff('0x49')][_0x73ff('0x4b')]?_0x55f446['attributes']:_0x18af06[_0x73ff('0x45')];_0x55f446[_0x73ff('0x6a')]=qs[_0x73ff('0x4d')](_0x1d6d08[_0x73ff('0x46')][_0x73ff('0x4d')]);_0x55f446['where']=qs['filters'](_[_0x73ff('0x71')](_0x1d6d08[_0x73ff('0x46')],_0x18af06[_0x73ff('0x47')]));if(_0x1d6d08[_0x73ff('0x46')][_0x73ff('0x4f')]){_0x55f446[_0x73ff('0x4e')]=_[_0x73ff('0x50')](_0x55f446['where'],{'$or':_[_0x73ff('0x42')](_0x55f446[_0x73ff('0x49')],function(_0x5e83bb){var _0xd39336={};_0xd39336[_0x5e83bb]={'$like':'%'+_0x1d6d08[_0x73ff('0x46')][_0x73ff('0x4f')]+'%'};return _0xd39336;})});}_0x55f446=_[_0x73ff('0x50')]({},_0x55f446,_0x1d6d08[_0x73ff('0x52')]);return _0x3d5607[_0x73ff('0x86')](_0x55f446);}})[_0x73ff('0x23')](function(_0x22b579){if(_0x22b579){_0xdf1d64=_0x22b579[_0x73ff('0x4b')];if(!_0x1d6d08[_0x73ff('0x46')][_0x73ff('0x4c')](_0x73ff('0x69'))){_0x55f446[_0x73ff('0x34')]=qs[_0x73ff('0x34')](_0x1d6d08[_0x73ff('0x46')][_0x73ff('0x34')]);_0x55f446[_0x73ff('0x32')]=qs['offset'](_0x1d6d08[_0x73ff('0x46')][_0x73ff('0x32')]);}return _0x3d5607[_0x73ff('0x86')](_0x55f446);}})[_0x73ff('0x23')](function(_0x10e0fc){if(_0x10e0fc){return _0x10e0fc?{'count':_0xdf1d64,'rows':_0x10e0fc}:null;}})[_0x73ff('0x23')](respondWithResult(_0x3845cc,null))[_0x73ff('0x2d')](handleError(_0x3845cc,null));};function Extension(_0x5bb167,_0x4dca38,_0x24a34c,_0x3f3c5e){this[_0x73ff('0x87')]='from-voip-provider';this[_0x73ff('0x88')]=_0x5bb167['localstationid'];this[_0x73ff('0x89')]=_0x3f3c5e;this['type']=_0x73ff('0x8a');this['description']=_0x73ff('0x8b');this[_0x73ff('0x66')]=_0x5bb167['id'];this['priority']=_0x4dca38;this[_0x73ff('0x8c')]=_0x24a34c;}function createExtensionsReciveFax(_0x308bb4){var _0x3968b2=0x1;var _0x1b6f3e=[];_0x1b6f3e['push'](new Extension(_0x308bb4,_0x3968b2,'',_0x73ff('0x8d')));_0x3968b2+=0x1;_0x1b6f3e[_0x73ff('0x8e')](new Extension(_0x308bb4,_0x3968b2,_0x73ff('0x8f'),_0x73ff('0x90')));_0x3968b2+=0x1;for(var _0x41e4d8 in _0x308bb4){if(_0x308bb4[_0x73ff('0x4c')](_0x41e4d8)&&(_0x41e4d8===_0x73ff('0x91')||_0x41e4d8==='localstationid'||_0x41e4d8===_0x73ff('0x92')||_0x41e4d8===_0x73ff('0x93')||_0x41e4d8===_0x73ff('0x94')||_0x41e4d8===_0x73ff('0x95')||_0x41e4d8==='minrate'||_0x41e4d8==='modem'||_0x41e4d8==='t38timeout')){_0x1b6f3e[_0x73ff('0x8e')](new Extension(_0x308bb4,_0x3968b2,_0x73ff('0x96')+_0x41e4d8+')='+_0x308bb4[_0x41e4d8],_0x73ff('0x90')));_0x3968b2+=0x1;}}_0x1b6f3e[_0x73ff('0x8e')](new Extension(_0x308bb4,_0x3968b2,'6',_0x73ff('0x97')));_0x3968b2+=0x1;_0x1b6f3e[_0x73ff('0x8e')](new Extension(_0x308bb4,_0x3968b2,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax'));_0x3968b2=0x0;return _0x1b6f3e;}exports[_0x73ff('0x98')]=function(_0x2d1c7d,_0x40327a,_0x4437e5){var _0x1e56dd;return db[_0x73ff('0x80')][_0x73ff('0x99')](function(_0x45ec0f){return db[_0x73ff('0x53')]['create'](_0x2d1c7d[_0x73ff('0x62')],{'transaction':_0x45ec0f})[_0x73ff('0x23')](function(_0x5daeea){_0x1e56dd=_0x5daeea[_0x73ff('0x39')]({'plain':!![]});return db['VoiceExtension'][_0x73ff('0x9a')](createExtensionsReciveFax(_0x1e56dd),{'transaction':_0x45ec0f});});})[_0x73ff('0x23')](function(){return _0x1e56dd;})[_0x73ff('0x23')](respondWithResult(_0x40327a,null))['catch'](handleError(_0x40327a,null));};exports[_0x73ff('0x9b')]=function(_0x3da146,_0x2eaca9,_0x34bcd2){var _0x98023b;return db['sequelize'][_0x73ff('0x99')](function(_0x4dd242){return db['FaxAccount'][_0x73ff('0x9c')](_0x3da146[_0x73ff('0x62')],{'where':{'id':_0x3da146[_0x73ff('0x62')]['id']},'transaction':_0x4dd242})[_0x73ff('0x23')](function(_0x3cfc42){return db[_0x73ff('0x9d')]['destroy']({'where':{'FaxAccountId':_0x3da146[_0x73ff('0x62')]['id']},'transaction':_0x4dd242})[_0x73ff('0x23')](function(_0x12e987){return db[_0x73ff('0x9d')][_0x73ff('0x9a')](createExtensionsReciveFax(_[_0x73ff('0x75')](_0x3da146[_0x73ff('0x62')],[_0x73ff('0x9e'),_0x73ff('0x44'),_0x73ff('0x9f'),_0x73ff('0xa0'),_0x73ff('0xa1'),_0x73ff('0xa2')])),{'transaction':_0x4dd242});});});})[_0x73ff('0x23')](function(){return db[_0x73ff('0x53')][_0x73ff('0xa3')](_0x3da146[_0x73ff('0x62')]['id']);})[_0x73ff('0x23')](respondWithResult(_0x2eaca9,null))[_0x73ff('0x2d')](handleError(_0x2eaca9,null));};exports['getMessages']=function(_0x4eb8aa,_0x499fbc,_0x4c163d){var _0x324005={'raw':!![],'where':{}};var _0x3c507f={};var _0x3ac404={'count':0x0,'rows':[]};return db['FaxAccount'][_0x73ff('0x68')]({'where':{'id':_0x4eb8aa[_0x73ff('0x59')]['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x499fbc,null))[_0x73ff('0x23')](function(_0x30b03c){if(_0x30b03c){_0x3c507f[_0x73ff('0x45')]=_[_0x73ff('0x5a')](db[_0x73ff('0xa4')]['rawAttributes']);_0x3c507f[_0x73ff('0x46')]=_[_0x73ff('0x5a')](_0x4eb8aa[_0x73ff('0x46')]);_0x3c507f[_0x73ff('0x47')]=_['intersection'](_0x3c507f['model'],_0x3c507f[_0x73ff('0x46')]);_0x324005[_0x73ff('0x49')]=_[_0x73ff('0x48')](_0x3c507f[_0x73ff('0x45')],qs[_0x73ff('0x4a')](_0x4eb8aa[_0x73ff('0x46')]['fields']));_0x324005[_0x73ff('0x49')]=_0x324005[_0x73ff('0x49')][_0x73ff('0x4b')]?_0x324005[_0x73ff('0x49')]:_0x3c507f[_0x73ff('0x45')];if(!_0x4eb8aa['query']['hasOwnProperty'](_0x73ff('0x69'))){_0x324005[_0x73ff('0x34')]=qs[_0x73ff('0x34')](_0x4eb8aa[_0x73ff('0x46')][_0x73ff('0x34')]);_0x324005[_0x73ff('0x32')]=qs['offset'](_0x4eb8aa[_0x73ff('0x46')][_0x73ff('0x32')]);}_0x324005['order']=qs[_0x73ff('0x4d')](_0x4eb8aa[_0x73ff('0x46')][_0x73ff('0x4d')]);_0x324005[_0x73ff('0x4e')]=qs[_0x73ff('0x47')](_['pick'](_0x4eb8aa[_0x73ff('0x46')],_0x3c507f['filters']));_0x324005[_0x73ff('0x4e')][_0x73ff('0x66')]=_0x30b03c['id'];if(_0x4eb8aa[_0x73ff('0x46')][_0x73ff('0x4f')]){_0x324005[_0x73ff('0x4e')]=_[_0x73ff('0x50')](_0x324005[_0x73ff('0x4e')],{'$or':_[_0x73ff('0x42')](_0x324005[_0x73ff('0x49')],function(_0x4bc441){var _0x2b8e68={};_0x2b8e68[_0x4bc441]={'$like':'%'+_0x4eb8aa['query'][_0x73ff('0x4f')]+'%'};return _0x2b8e68;})});}if(_0x4eb8aa[_0x73ff('0x46')][_0x73ff('0xa5')]){var _0x3a7b97=_0x4eb8aa[_0x73ff('0x46')][_0x73ff('0xa5')][_0x73ff('0xa6')](',');var _0x5a5959={};_0x5a5959[_0x3a7b97[0x0]]={'$gte':moment(_0x3a7b97[0x1])[_0x73ff('0xa7')](_0x73ff('0xa8'))};_0x324005[_0x73ff('0x4e')]=_[_0x73ff('0x50')](_0x324005['where'],_0x5a5959);}_0x324005=_['merge']({},_0x324005,_0x4eb8aa[_0x73ff('0x52')]);return db[_0x73ff('0xa4')][_0x73ff('0x6b')]({'where':_0x324005[_0x73ff('0x4e')]})[_0x73ff('0x23')](function(_0x151e05){_0x3ac404[_0x73ff('0x6b')]=_0x151e05;if(_0x4eb8aa['query'][_0x73ff('0x54')]){_0x324005[_0x73ff('0x55')]=[{'all':!![]}];}return db[_0x73ff('0xa4')][_0x73ff('0x56')](_0x324005);})[_0x73ff('0x23')](function(_0x57a76d){_0x3ac404[_0x73ff('0x57')]=_0x57a76d;return _0x3ac404;});}})[_0x73ff('0x23')](respondWithFilteredResult(_0x499fbc,_0x324005))[_0x73ff('0x2d')](handleError(_0x499fbc,null));};exports[_0x73ff('0x3e')]=function(_0x1f7bdb,_0x2a7e35,_0x57c596){var _0x57e7f9,_0x3ebf05={},_0x2716c9;if(_0x1f7bdb[_0x73ff('0x62')]['to']){_0x2716c9=_0x1f7bdb[_0x73ff('0x62')]['to'][0x0];}return db[_0x73ff('0x53')][_0x73ff('0x63')]({'where':{'id':_0x1f7bdb[_0x73ff('0x59')]['id']},'include':[{'model':db[_0x73ff('0xa9')],'as':_0x73ff('0xaa'),'include':[{'model':db[_0x73ff('0x77')],'as':_0x73ff('0xab'),'where':{'fax':_0x2716c9},'limit':0x1,'order':[[_0x73ff('0xa0'),'DESC']]}]}]})[_0x73ff('0x23')](handleEntityNotFound(_0x2a7e35,null))['then'](function(_0x57a415){_0x57e7f9=_0x57a415;if(_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')]&&_0x1f7bdb['body'][_0x73ff('0xac')]['length']){for(var _0x13f2df=0x0;_0x13f2df<_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')]['length'];_0x13f2df+=0x1){_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')][_0x13f2df]={'filename':_0x1f7bdb[_0x73ff('0x62')]['attachments'][_0x13f2df]['name'],'id':_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')][_0x13f2df]['id'],'path':path[_0x73ff('0xad')](config[_0x73ff('0xae')],_0x73ff('0xaf'),_0x1f7bdb['body']['attachments'][_0x13f2df][_0x73ff('0xb0')])};}}return respondWithRpcPromise(_0x73ff('0xb1'),'CheckAfterSend',{'FaxAccountId':_[_0x73ff('0xb2')](_0x1f7bdb[_0x73ff('0x59')]['id'])?undefined:_0x1f7bdb[_0x73ff('0x59')]['id'],'path':_[_0x73ff('0xb2')](_0x1f7bdb['body'][_0x73ff('0xac')][0x0]['path'])?undefined:_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')][0x0][_0x73ff('0x6')],'fax':_[_0x73ff('0xb2')](_0x1f7bdb[_0x73ff('0x62')]['to'][0x0])?undefined:_0x1f7bdb[_0x73ff('0x62')]['to'][0x0]},client9002);})[_0x73ff('0x23')](function(){if(_0x57e7f9){if(_[_0x73ff('0xb2')](_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xb3')])){_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xb3')]=util[_0x73ff('0xa7')]('\x22%s\x22\x20<%s>',_0x57e7f9[_0x73ff('0x3d')],_0x57e7f9[_0x73ff('0xb4')]);}if(_0x57e7f9[_0x73ff('0xaa')]){if(_0x57e7f9['List'][_0x73ff('0xab')][_0x73ff('0x4b')]){return _0x57e7f9[_0x73ff('0xaa')]['Contacts'][0x0];}else{return db[_0x73ff('0x77')]['create'](_[_0x73ff('0x1c')](_0x1f7bdb['body'],{'firstName':_0x1f7bdb['body']['to'][0x0],'phone':_0x1f7bdb['body']['to'][0x0],'fax':_0x1f7bdb[_0x73ff('0x62')]['to'][0x0],'ListId':_0x57e7f9['ListId']}));}}else{throw new Error(_0x73ff('0xb5'));}}else{throw new Error(_0x73ff('0xb6'));}})[_0x73ff('0x23')](function(_0x4a6301){if(_0x4a6301){return db[_0x73ff('0x74')][_0x73ff('0x63')]({'where':{'ContactId':_0x4a6301['id'],'closed':![],'FaxAccountId':_0x57e7f9['id']}})[_0x73ff('0x23')](function(_0x396528){if(_0x396528){return[_0x396528,![]];}return db[_0x73ff('0x74')][_0x73ff('0x5c')]({'UserId':_0x1f7bdb[_0x73ff('0x5d')]['id'],'ContactId':_0x4a6301['id'],'FaxAccountId':_0x57e7f9['id'],'fax':_0x1f7bdb[_0x73ff('0x62')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x1f7bdb[_0x73ff('0x62')],{'read':![],'body':_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')][0x0]['filename'],'FaxAccountId':_0x57e7f9['id'],'UserId':_0x1f7bdb[_0x73ff('0x5d')]['id'],'ContactId':_0x4a6301['id'],'AttachmentId':_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x73ff('0xa4')],'as':'Messages'}]})[_0x73ff('0x23')](function(_0x76be46){return[_0x76be46,!![]];});});}else{throw new Error(_0x73ff('0xb7'));}})['spread'](function(_0x147571,_0x136cb0){if(_0x136cb0){return _0x147571;}return db[_0x73ff('0xa4')][_0x73ff('0x5c')]({'direction':_0x73ff('0xb8'),'read':![],'body':_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')][0x0][_0x73ff('0xb9')],'FaxAccountId':_0x57e7f9['id'],'FaxInteractionId':_0x147571['id'],'UserId':_0x1f7bdb[_0x73ff('0x5d')]['id'],'ContactId':_0x147571['ContactId'],'AttachmentId':_0x1f7bdb['body']['attachments'][0x0]['id']})[_0x73ff('0x23')](function(_0x3c8ae1){_0x147571[_0x73ff('0xba')][_0x73ff('0xbb')]=[];_0x147571['dataValues']['Messages']['push'](_0x3c8ae1[_0x73ff('0xba')]);return _0x147571;});})['then'](function(_0x553d77){respondWithRpcPromise('SendFax',_0x73ff('0xbc'),{'FaxAccountId':_[_0x73ff('0xb2')](_0x1f7bdb[_0x73ff('0x59')]['id'])?undefined:_0x1f7bdb['params']['id'],'path':_[_0x73ff('0xb2')](_0x1f7bdb[_0x73ff('0x62')]['attachments'][0x0][_0x73ff('0x6')])?undefined:_0x1f7bdb[_0x73ff('0x62')]['attachments'][0x0][_0x73ff('0x6')],'fax':_[_0x73ff('0xb2')](_0x1f7bdb[_0x73ff('0x62')]['to'][0x0])?undefined:_0x1f7bdb[_0x73ff('0x62')]['to'][0x0],'AttachmentId':_0x1f7bdb[_0x73ff('0x62')][_0x73ff('0xac')][0x0]['id']},client9002)['then'](function(_0x407d23){logger['info'](_0x73ff('0xbd'),_0x407d23);})['catch'](function(_0x327584){logger[_0x73ff('0xbe')](_0x73ff('0xbd'),_0x327584);});return _0x553d77;})[_0x73ff('0x23')](respondWithResult(_0x2a7e35,null))[_0x73ff('0x2d')](handleError(_0x2a7e35,null));};exports[_0x73ff('0xbf')]=function(_0x4f1d81,_0x364df9,_0x3d5b05){return db[_0x73ff('0x53')]['find']({'where':{'id':_0x4f1d81[_0x73ff('0x59')]['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x364df9,null))[_0x73ff('0x23')](function(_0x3aca5f){if(_0x3aca5f){return _0x3aca5f['addAgents'](_0x4f1d81[_0x73ff('0x62')][_0x73ff('0x6d')],_['omit'](_0x4f1d81[_0x73ff('0x62')],[_0x73ff('0x6d'),'id'])||{})[_0x73ff('0xc0')](function(_0x350284){for(var _0x4957eb=0x0;_0x4957eb<_0x4f1d81[_0x73ff('0x62')][_0x73ff('0x6d')]['length'];_0x4957eb+=0x1){socket[_0x73ff('0xc1')](_0x73ff('0xc2'),{'UserId':Number(_0x4f1d81[_0x73ff('0x62')]['ids'][_0x4957eb]),'FaxAccountId':Number(_0x4f1d81[_0x73ff('0x59')]['id'])});}return _0x350284;});}})['then'](respondWithResult(_0x364df9,null))[_0x73ff('0x2d')](handleError(_0x364df9,null));};exports[_0x73ff('0xc3')]=function(_0x59e90b,_0x2d7c42,_0x5c101e){return db[_0x73ff('0x53')][_0x73ff('0x63')]({'where':{'id':_0x59e90b[_0x73ff('0x59')]['id']}})[_0x73ff('0x23')](handleEntityNotFound(_0x2d7c42,null))[_0x73ff('0x23')](function(_0x3fe067){if(_0x3fe067){return _0x3fe067[_0x73ff('0xc3')](_0x59e90b[_0x73ff('0x46')][_0x73ff('0x6d')])[_0x73ff('0x23')](function(){if(_[_0x73ff('0xc4')](_0x59e90b[_0x73ff('0x46')][_0x73ff('0x6d')])){for(var _0x470b59=0x0;_0x470b59<_0x59e90b[_0x73ff('0x46')][_0x73ff('0x6d')][_0x73ff('0x4b')];_0x470b59+=0x1){socket[_0x73ff('0xc1')](_0x73ff('0xc5'),{'UserId':Number(_0x59e90b[_0x73ff('0x46')][_0x73ff('0x6d')][_0x470b59]),'FaxAccountId':Number(_0x59e90b[_0x73ff('0x59')]['id'])});}}else{socket[_0x73ff('0xc1')](_0x73ff('0xc5'),{'UserId':Number(_0x59e90b[_0x73ff('0x46')]['ids']),'FaxAccountId':Number(_0x59e90b[_0x73ff('0x59')]['id'])});}});}})[_0x73ff('0x23')](respondWithStatusCode(_0x2d7c42,null))[_0x73ff('0x2d')](handleError(_0x2d7c42,null));};exports[_0x73ff('0xc6')]=function(_0x5b829e,_0x4e52ce,_0x1f328d){var _0x4a2fc2={};var _0x280cbd={};var _0x3ef878;var _0x35d99e;return db[_0x73ff('0x53')][_0x73ff('0x68')]({'where':{'id':_0x5b829e['params']['id']}})['then'](handleEntityNotFound(_0x4e52ce,null))[_0x73ff('0x23')](function(_0x55c042){if(_0x55c042){_0x3ef878=_0x55c042;_0x280cbd[_0x73ff('0x45')]=_['keys'](db['User'][_0x73ff('0x5b')]);_0x280cbd[_0x73ff('0x46')]=_[_0x73ff('0x5a')](_0x5b829e[_0x73ff('0x46')]);_0x280cbd[_0x73ff('0x47')]=_['intersection'](_0x280cbd[_0x73ff('0x45')],_0x280cbd[_0x73ff('0x46')]);_0x4a2fc2[_0x73ff('0x49')]=_['intersection'](_0x280cbd['model'],qs[_0x73ff('0x4a')](_0x5b829e[_0x73ff('0x46')][_0x73ff('0x4a')]));_0x4a2fc2[_0x73ff('0x49')]=_0x4a2fc2[_0x73ff('0x49')][_0x73ff('0x4b')]?_0x4a2fc2[_0x73ff('0x49')]:_0x280cbd[_0x73ff('0x45')];_0x4a2fc2[_0x73ff('0x6a')]=qs[_0x73ff('0x4d')](_0x5b829e[_0x73ff('0x46')][_0x73ff('0x4d')]);_0x4a2fc2[_0x73ff('0x4e')]=qs[_0x73ff('0x47')](_[_0x73ff('0x71')](_0x5b829e[_0x73ff('0x46')],_0x280cbd[_0x73ff('0x47')]));if(_0x5b829e[_0x73ff('0x46')][_0x73ff('0x4f')]){_0x4a2fc2[_0x73ff('0x4e')]=_['merge'](_0x4a2fc2[_0x73ff('0x4e')],{'$or':_['map'](_0x4a2fc2[_0x73ff('0x49')],function(_0x5abf1a){var _0x115208={};_0x115208[_0x5abf1a]={'$like':'%'+_0x5b829e[_0x73ff('0x46')]['filter']+'%'};return _0x115208;})});}_0x4a2fc2=_[_0x73ff('0x50')]({},_0x4a2fc2,_0x5b829e[_0x73ff('0x52')]);return _0x3ef878[_0x73ff('0xc6')](_0x4a2fc2);}})[_0x73ff('0x23')](function(_0x304d78){if(_0x304d78){_0x35d99e=_0x304d78['length'];if(!_0x5b829e[_0x73ff('0x46')]['hasOwnProperty'](_0x73ff('0x69'))){_0x4a2fc2[_0x73ff('0x34')]=qs[_0x73ff('0x34')](_0x5b829e[_0x73ff('0x46')][_0x73ff('0x34')]);_0x4a2fc2[_0x73ff('0x32')]=qs[_0x73ff('0x32')](_0x5b829e[_0x73ff('0x46')][_0x73ff('0x32')]);}return _0x3ef878[_0x73ff('0xc6')](_0x4a2fc2);}})['then'](function(_0x2539d9){if(_0x2539d9){return _0x2539d9?{'count':_0x35d99e,'rows':_0x2539d9}:null;}})[_0x73ff('0x23')](respondWithResult(_0x4e52ce,null))['catch'](handleError(_0x4e52ce,null));};
\ No newline at end of file
index 12f033e..c36a321 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa94=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove'];(function(_0x38e65e,_0x36d9a7){var _0x4f2b87=function(_0x2c476e){while(--_0x2c476e){_0x38e65e['push'](_0x38e65e['shift']());}};_0x4f2b87(++_0x36d9a7);}(_0xfa94,0x1f2));var _0x4fa9=function(_0x406fbb,_0x1093e5){_0x406fbb=_0x406fbb-0x0;var _0x8e921d=_0xfa94[_0x406fbb];return _0x8e921d;};'use strict';var EventEmitter=require(_0x4fa9('0x0'));var FaxAccount=require(_0x4fa9('0x1'))['db'][_0x4fa9('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4fa9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4fa9('0x4'),'afterDestroy':_0x4fa9('0x5')};function emitEvent(_0x37ed45){return function(_0x44286a,_0x5dccf2,_0x559501){FaxAccountEvents[_0x4fa9('0x6')](_0x37ed45+':'+_0x44286a['id'],_0x44286a);FaxAccountEvents['emit'](_0x37ed45,_0x44286a);_0x559501(null);};}for(var e in events){if(events[_0x4fa9('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x4fa9('0x8')]=FaxAccountEvents;
\ No newline at end of file
+var _0x2ba7=['emit','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2ba7,0xe9));var _0x72ba=function(_0x492ae5,_0x9d5f15){_0x492ae5=_0x492ae5-0x0;var _0x5a28ab=_0x2ba7[_0x492ae5];return _0x5a28ab;};'use strict';var EventEmitter=require(_0x72ba('0x0'));var FaxAccount=require(_0x72ba('0x1'))['db'][_0x72ba('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x72ba('0x3')](0x0);var events={'afterCreate':_0x72ba('0x4'),'afterUpdate':_0x72ba('0x5'),'afterDestroy':_0x72ba('0x6')};function emitEvent(_0x160afc){return function(_0x205f12,_0x4f9375,_0x9ad7c7){FaxAccountEvents[_0x72ba('0x7')](_0x160afc+':'+_0x205f12['id'],_0x205f12);FaxAccountEvents[_0x72ba('0x7')](_0x160afc,_0x205f12);_0x9ad7c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x72ba('0x8')](e,emitEvent(event));}}module[_0x72ba('0x9')]=FaxAccountEvents;
\ No newline at end of file
index ed5c0f5..c8cd464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9420=['rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1c5b34,_0x4c97dc){var _0x3510fd=function(_0x3bc604){while(--_0x3bc604){_0x1c5b34['push'](_0x1c5b34['shift']());}};_0x3510fd(++_0x4c97dc);}(_0x9420,0x77));var _0x0942=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x9420[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0942('0x0'));var util=require(_0x0942('0x1'));var logger=require(_0x0942('0x2'))(_0x0942('0x3'));var moment=require(_0x0942('0x4'));var BPromise=require(_0x0942('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0942('0x6'));var rimraf=require(_0x0942('0x7'));var config=require(_0x0942('0x8'));var attributes=require(_0x0942('0x9'));module[_0x0942('0xa')]=function(_0x1b972e,_0x4ac6b3){return _0x1b972e[_0x0942('0xb')](_0x0942('0xc'),attributes,{'tableName':_0x0942('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8278=['define','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports'];(function(_0x4d9947,_0x12e363){var _0x264ae9=function(_0x90af8b){while(--_0x90af8b){_0x4d9947['push'](_0x4d9947['shift']());}};_0x264ae9(++_0x12e363);}(_0x8278,0xc5));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8827('0x0'));var util=require(_0x8827('0x1'));var logger=require(_0x8827('0x2'))(_0x8827('0x3'));var moment=require(_0x8827('0x4'));var BPromise=require(_0x8827('0x5'));var rp=require(_0x8827('0x6'));var fs=require('fs');var path=require(_0x8827('0x7'));var rimraf=require(_0x8827('0x8'));var config=require('../../config/environment');var attributes=require(_0x8827('0x9'));module[_0x8827('0xa')]=function(_0x281809,_0x4a24fc){return _0x281809[_0x8827('0xb')]('FaxAccount',attributes,{'tableName':_0x8827('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2e893cf..08c4f2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8495=['request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxAccount','findAll','options','where','attributes','limit','map','include','model','then','debug','stringify','body','fax','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','FaxAccount','CmList','List','CmContact','DESC','FaxApplication','get','applications','Applications','orderBy','priority','asc','account','Contacts','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','register'];(function(_0x4bec5a,_0x59ffc3){var _0x3a7601=function(_0x26c063){while(--_0x26c063){_0x4bec5a['push'](_0x4bec5a['shift']());}};_0x3a7601(++_0x59ffc3);}(_0x8495,0x1aa));var _0x5849=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8495[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x5849('0x0'));var util=require(_0x5849('0x1'));var moment=require(_0x5849('0x2'));var BPromise=require(_0x5849('0x3'));var rs=require(_0x5849('0x4'));var fs=require('fs');var Redis=require(_0x5849('0x5'));var db=require(_0x5849('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5849('0x7'))('rpc');var config=require(_0x5849('0x8'));var jayson=require(_0x5849('0x9'));var client=jayson['client'][_0x5849('0xa')]({'port':0x232c});config['redis']=_[_0x5849('0xb')](config['redis'],{'host':_0x5849('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')[_0x5849('0xd')](socket);function respondWithRpcPromise(_0x4d8ae0,_0x1ac1de,_0x9340cb){return new BPromise(function(_0x36d560,_0x2cbbd0){return client[_0x5849('0xe')](_0x4d8ae0,_0x9340cb)['then'](function(_0x5f134a){logger[_0x5849('0xf')](_0x5849('0x10'),_0x1ac1de,_0x5849('0x11'));logger['debug'](_0x5849('0x12'),_0x1ac1de,_0x5849('0x11'),JSON['stringify'](_0x5f134a));if(_0x5f134a[_0x5849('0x13')]){if(_0x5f134a[_0x5849('0x13')][_0x5849('0x14')]===0x1f4){logger[_0x5849('0x13')]('FaxAccount,\x20%s,\x20%s',_0x1ac1de,_0x5f134a[_0x5849('0x13')]['message']);return _0x2cbbd0(_0x5f134a[_0x5849('0x13')]['message']);}logger[_0x5849('0x13')](_0x5849('0x10'),_0x1ac1de,_0x5f134a[_0x5849('0x13')]['message']);return _0x36d560(_0x5f134a[_0x5849('0x13')][_0x5849('0x15')]);}else{logger[_0x5849('0xf')]('FaxAccount,\x20%s,\x20%s',_0x1ac1de,'request\x20sent');_0x36d560(_0x5f134a[_0x5849('0x16')][_0x5849('0x15')]);}})['catch'](function(_0x212ddb){logger[_0x5849('0x13')](_0x5849('0x10'),_0x1ac1de,_0x212ddb);_0x2cbbd0(_0x212ddb);});});}exports[_0x5849('0x17')]=function(_0x1d531e){var _0x5d39ab=this;return new Promise(function(_0x3ea0d5,_0x362345){return db['FaxAccount'][_0x5849('0x18')]({'raw':_0x1d531e[_0x5849('0x19')]?_0x1d531e[_0x5849('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1d531e['options']?_0x1d531e['options'][_0x5849('0x1a')]||null:null,'attributes':_0x1d531e[_0x5849('0x19')]?_0x1d531e[_0x5849('0x19')][_0x5849('0x1b')]||null:null,'limit':_0x1d531e[_0x5849('0x19')]?_0x1d531e[_0x5849('0x19')][_0x5849('0x1c')]||null:null,'include':_0x1d531e[_0x5849('0x19')]?_0x1d531e[_0x5849('0x19')]['include']?_[_0x5849('0x1d')](_0x1d531e[_0x5849('0x19')][_0x5849('0x1e')],function(_0x173102){return{'model':db[_0x173102[_0x5849('0x1f')]],'as':_0x173102['as'],'attributes':_0x173102[_0x5849('0x1b')],'include':_0x173102[_0x5849('0x1e')]?_[_0x5849('0x1d')](_0x173102[_0x5849('0x1e')],function(_0x13946e){return{'model':db[_0x13946e[_0x5849('0x1f')]],'as':_0x13946e['as'],'attributes':_0x13946e[_0x5849('0x1b')],'include':_0x13946e['include']?_['map'](_0x13946e[_0x5849('0x1e')],function(_0x230141){return{'model':db[_0x230141[_0x5849('0x1f')]],'as':_0x230141['as'],'attributes':_0x230141[_0x5849('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5849('0x20')](function(_0x2c0702){logger['info'](_0x5849('0x17'),_0x1d531e);logger[_0x5849('0x21')](_0x5849('0x17'),_0x1d531e,JSON[_0x5849('0x22')](_0x2c0702));_0x3ea0d5(_0x2c0702);})['catch'](function(_0x25b589){logger[_0x5849('0x13')](_0x5849('0x17'),_0x25b589['message'],_0x1d531e);_0x362345(_0x5d39ab[_0x5849('0x13')](0x1f4,_0x25b589[_0x5849('0x15')]));});});};exports['NotifyFaxAccount']=function(_0x269ace,_0x514bec,_0x562d0d){var _0x165d3c=this;return new Promise(function(_0x2f4490,_0x416b9c){var _0x5da884={'body':_0x269ace[_0x5849('0x23')],'channel':_0x5849('0x24')};var _0x498699=[];var _0x165a62=[];var _0x39a8b2={};return db['CmContact']['describe']()[_0x5849('0x20')](function(_0x2cab75){if(!_0x2cab75){throw new db[(_0x5849('0x25'))][(_0x5849('0x26'))](_0x5849('0x27'));}_0x498699=_['difference'](_[_0x5849('0x28')](_0x2cab75),[_0x5849('0x29'),_0x5849('0x2a')]);_0x165a62=_['difference'](_[_0x5849('0x28')](_0x2cab75),[_0x5849('0x29'),'updatedAt',_0x5849('0x2b'),_0x5849('0x2c')]);if(_0x269ace[_0x5849('0x23')]['id']){delete _0x269ace[_0x5849('0x23')]['id'];}if(_[_0x5849('0x2d')](_0x269ace['body'][_0x5849('0x2e')])){throw new db['Sequelize'][(_0x5849('0x26'))](_0x5849('0x2f'));}if(_['isNil'](_0x269ace[_0x5849('0x23')]['body'])||_0x269ace[_0x5849('0x23')][_0x5849('0x23')]===''){throw new db['Sequelize'][(_0x5849('0x26'))](_0x5849('0x30'));}if(_[_0x5849('0x2d')](_0x269ace['body'][_0x5849('0x31')])){throw new db[(_0x5849('0x25'))][(_0x5849('0x26'))](_0x5849('0x32')+_0x165a62);}if(!_[_0x5849('0x33')](_0x165a62,_0x269ace['body'][_0x5849('0x31')])){throw new db[(_0x5849('0x25'))][(_0x5849('0x26'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x165a62);}_0x39a8b2[_0x269ace[_0x5849('0x23')][_0x5849('0x31')]]=_0x269ace[_0x5849('0x23')]['from'];})['then'](function(){return db[_0x5849('0x34')]['find']({'where':{'id':_0x269ace['account']['id']},'include':[{'model':db[_0x5849('0x35')],'as':_0x5849('0x36'),'include':[{'model':db[_0x5849('0x37')],'as':'Contacts','where':_0x39a8b2,'limit':0x1,'order':[['updatedAt',_0x5849('0x38')]]}]},{'model':db[_0x5849('0x39')],'as':'Applications'}]});})['then'](function(_0x560f01){if(_0x560f01&&_0x560f01[_0x5849('0x36')]){var _0x16f46b=_0x560f01[_0x5849('0x3a')]({'plain':!![]});_0x5da884['account']=_0x16f46b;_0x5da884[_0x5849('0x3b')]=_0x16f46b[_0x5849('0x3c')];_0x5da884['list']=_0x16f46b[_0x5849('0x36')];_0x5da884[_0x5849('0x3b')]=_[_0x5849('0x3d')](_0x5da884[_0x5849('0x3b')],[_0x5849('0x3e')],[_0x5849('0x3f')]);if(_0x5da884['account'][_0x5849('0x3c')]){delete _0x5da884[_0x5849('0x40')]['Applications'];}if(_0x5da884[_0x5849('0x40')]['List']&&_0x5da884[_0x5849('0x40')][_0x5849('0x36')][_0x5849('0x41')][_0x5849('0x42')]){return _0x5da884[_0x5849('0x40')][_0x5849('0x36')][_0x5849('0x41')][0x0];}var _0x4c7334=_[_0x5849('0xb')](_0x269ace[_0x5849('0x23')],{'firstName':_0x269ace[_0x5849('0x23')][_0x5849('0x2e')],'ListId':_0x16f46b[_0x5849('0x2c')]});_0x4c7334[_0x269ace[_0x5849('0x23')][_0x5849('0x31')]]=_0x269ace[_0x5849('0x23')]['from'];return db[_0x5849('0x37')][_0x5849('0x43')](_0x4c7334,{'fields':_0x498699,'raw':!![]});}})['then'](function(_0x423fe2){_0x5da884[_0x5849('0x44')]=_0x423fe2;if(_0x423fe2){var _0x525544={'ContactId':_0x423fe2['id'],'FaxAccountId':_0x269ace[_0x5849('0x40')]['id'],'fax':_0x423fe2[_0x5849('0x24')]};return db[_0x5849('0x45')]['find']({'where':{'ContactId':_0x423fe2['id'],'closed':![],'FaxAccountId':_0x269ace['account']['id']}})['then'](function(_0x6f677d){if(_0x6f677d){return[_0x6f677d,![]];}return db[_0x5849('0x45')]['create'](_0x525544)[_0x5849('0x20')](function(_0x29b038){return[_0x29b038,!![]];});});}else{throw new Error(_0x5849('0x46'));}})[_0x5849('0x47')](function(_0x16358f,_0x33c7d2){var _0x3e2aad=_0x16358f['get']({'plain':!![]});if(_0x33c7d2){if(_0x5da884['account'][_0x5849('0x48')]){_0x5da884[_0x5849('0x3b')][_0x5849('0x49')]({'id':0x0,'priority':_0x5da884['applications'][_0x5849('0x42')]+0x1,'app':_0x5849('0x4a'),'appdata':'unmanaged','interval':_0x5849('0x4b')});}_0x3e2aad[_0x5849('0x4c')]=!![];}else{_0x3e2aad[_0x5849('0x4c')]=![];}_0x5da884[_0x5849('0x4d')]=_0x3e2aad;return db[_0x5849('0x4e')][_0x5849('0x43')]({'body':_0x269ace['body'][_0x5849('0x23')],'FaxAccountId':_0x269ace[_0x5849('0x40')]['id'],'FaxInteractionId':_0x16358f['id'],'direction':'in','ContactId':_0x16358f[_0x5849('0x4f')],'AttachmentId':_0x269ace[_0x5849('0x23')]['AttachmentId']});})['then'](function(_0x4c1cc4){_0x5da884[_0x5849('0x15')]=_0x4c1cc4;if(_0x5da884['interaction']['UserId']){return db['User']['find']({'attributes':['id',_0x5849('0x50')],'where':{'id':_0x5da884[_0x5849('0x4d')][_0x5849('0x51')]}})[_0x5849('0x20')](function(_0x47aefd){if(_0x47aefd){_0x5da884[_0x5849('0x3b')][_0x5849('0x52')]({'id':0x0,'priority':0x0,'app':_0x5849('0x53'),'appdata':_0x47aefd['name']+','+(_0x5da884[_0x5849('0x40')][_0x5849('0x54')]||0xa),'interval':_0x5849('0x4b')});}return respondWithRpcPromise(_0x5849('0x55'),'startRouting',_0x5da884);});}return respondWithRpcPromise(_0x5849('0x55'),_0x5849('0x56'),_0x5da884);})[_0x5849('0x20')](function(_0x485f3b){_0x2f4490(_0x485f3b);})[_0x5849('0x57')](function(_0x218232){_0x416b9c(_0x165d3c[_0x5849('0x13')](0x1f4,_0x218232[_0x5849('0x15')]));});});};
\ No newline at end of file
+var _0x2945=['agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','options','raw','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','keys','ListId','from','from\x20is\x20mandatory','isNil','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','find','account','CmList','List','Contacts','updatedAt','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x2945,0x10f));var _0x5294=function(_0x2365a9,_0x2214cc){_0x2365a9=_0x2365a9-0x0;var _0x2e7fa2=_0x2945[_0x2365a9];return _0x2e7fa2;};'use strict';var _=require(_0x5294('0x0'));var util=require('util');var moment=require(_0x5294('0x1'));var BPromise=require(_0x5294('0x2'));var rs=require(_0x5294('0x3'));var fs=require('fs');var Redis=require(_0x5294('0x4'));var db=require(_0x5294('0x5'))['db'];var utils=require(_0x5294('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5294('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5294('0x8')][_0x5294('0x9')]({'port':0x232c});config[_0x5294('0xa')]=_['defaults'](config[_0x5294('0xa')],{'host':_0x5294('0xb'),'port':0x18eb});var socket=require(_0x5294('0xc'))(new Redis(config['redis']));require(_0x5294('0xd'))[_0x5294('0xe')](socket);function respondWithRpcPromise(_0x3cb812,_0x575096,_0x233c0c){return new BPromise(function(_0x8ed6df,_0x29c5c5){return client['request'](_0x3cb812,_0x233c0c)[_0x5294('0xf')](function(_0x3d39f2){logger[_0x5294('0x10')]('FaxAccount,\x20%s,\x20%s',_0x575096,'request\x20sent');logger[_0x5294('0x11')](_0x5294('0x12'),_0x575096,_0x5294('0x13'),JSON[_0x5294('0x14')](_0x3d39f2));if(_0x3d39f2[_0x5294('0x15')]){if(_0x3d39f2[_0x5294('0x15')][_0x5294('0x16')]===0x1f4){logger[_0x5294('0x15')]('FaxAccount,\x20%s,\x20%s',_0x575096,_0x3d39f2[_0x5294('0x15')]['message']);return _0x29c5c5(_0x3d39f2[_0x5294('0x15')][_0x5294('0x17')]);}logger[_0x5294('0x15')](_0x5294('0x18'),_0x575096,_0x3d39f2[_0x5294('0x15')]['message']);return _0x8ed6df(_0x3d39f2[_0x5294('0x15')][_0x5294('0x17')]);}else{logger[_0x5294('0x10')]('FaxAccount,\x20%s,\x20%s',_0x575096,_0x5294('0x13'));_0x8ed6df(_0x3d39f2[_0x5294('0x19')][_0x5294('0x17')]);}})[_0x5294('0x1a')](function(_0x3881e8){logger['error'](_0x5294('0x18'),_0x575096,_0x3881e8);_0x29c5c5(_0x3881e8);});});}exports[_0x5294('0x1b')]=function(_0x387833){var _0x115f10=this;return new Promise(function(_0x3846e0,_0x388275){return db[_0x5294('0x1c')]['findAll']({'raw':_0x387833[_0x5294('0x1d')]?_0x387833[_0x5294('0x1d')][_0x5294('0x1e')]===undefined?!![]:![]:!![],'where':_0x387833[_0x5294('0x1d')]?_0x387833[_0x5294('0x1d')]['where']||null:null,'attributes':_0x387833[_0x5294('0x1d')]?_0x387833[_0x5294('0x1d')][_0x5294('0x1f')]||null:null,'limit':_0x387833[_0x5294('0x1d')]?_0x387833[_0x5294('0x1d')][_0x5294('0x20')]||null:null,'include':_0x387833['options']?_0x387833[_0x5294('0x1d')]['include']?_['map'](_0x387833[_0x5294('0x1d')][_0x5294('0x21')],function(_0x370f81){return{'model':db[_0x370f81['model']],'as':_0x370f81['as'],'attributes':_0x370f81[_0x5294('0x1f')],'include':_0x370f81[_0x5294('0x21')]?_[_0x5294('0x22')](_0x370f81[_0x5294('0x21')],function(_0x3551c3){return{'model':db[_0x3551c3[_0x5294('0x23')]],'as':_0x3551c3['as'],'attributes':_0x3551c3[_0x5294('0x1f')],'include':_0x3551c3['include']?_[_0x5294('0x22')](_0x3551c3[_0x5294('0x21')],function(_0x1d3b10){return{'model':db[_0x1d3b10[_0x5294('0x23')]],'as':_0x1d3b10['as'],'attributes':_0x1d3b10[_0x5294('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c31b7){logger[_0x5294('0x10')](_0x5294('0x1b'),_0x387833);logger[_0x5294('0x11')]('GetFaxAccount',_0x387833,JSON[_0x5294('0x14')](_0x3c31b7));_0x3846e0(_0x3c31b7);})['catch'](function(_0x3a9d97){logger[_0x5294('0x15')]('GetFaxAccount',_0x3a9d97['message'],_0x387833);_0x388275(_0x115f10[_0x5294('0x15')](0x1f4,_0x3a9d97[_0x5294('0x17')]));});});};exports[_0x5294('0x24')]=function(_0x1653af,_0x1c30b7,_0x16541b){var _0x1dd9cb=this;return new Promise(function(_0x3497ce,_0x52a08c){var _0x284065={'body':_0x1653af[_0x5294('0x25')],'channel':_0x5294('0x26')};var _0x385bb5=[];var _0x27d8c3=[];var _0x3c5bc8={};return db[_0x5294('0x27')]['describe']()[_0x5294('0xf')](function(_0x340629){if(!_0x340629){throw new db[(_0x5294('0x28'))][(_0x5294('0x29'))](_0x5294('0x2a'));}_0x385bb5=_[_0x5294('0x2b')](_['keys'](_0x340629),[_0x5294('0x2c'),'updatedAt']);_0x27d8c3=_[_0x5294('0x2b')](_[_0x5294('0x2d')](_0x340629),['createdAt','updatedAt','CompanyId',_0x5294('0x2e')]);if(_0x1653af[_0x5294('0x25')]['id']){delete _0x1653af[_0x5294('0x25')]['id'];}if(_['isNil'](_0x1653af[_0x5294('0x25')][_0x5294('0x2f')])){throw new db[(_0x5294('0x28'))][(_0x5294('0x29'))](_0x5294('0x30'));}if(_[_0x5294('0x31')](_0x1653af['body'][_0x5294('0x25')])||_0x1653af[_0x5294('0x25')][_0x5294('0x25')]===''){throw new db['Sequelize']['ValidationError'](_0x5294('0x32'));}if(_[_0x5294('0x31')](_0x1653af[_0x5294('0x25')][_0x5294('0x33')])){throw new db[(_0x5294('0x28'))][(_0x5294('0x29'))](_0x5294('0x34')+_0x27d8c3);}if(!_[_0x5294('0x35')](_0x27d8c3,_0x1653af[_0x5294('0x25')]['mapKey'])){throw new db[(_0x5294('0x28'))][(_0x5294('0x29'))](_0x5294('0x36')+_0x27d8c3);}_0x3c5bc8[_0x1653af[_0x5294('0x25')][_0x5294('0x33')]]=_0x1653af[_0x5294('0x25')][_0x5294('0x2f')];})['then'](function(){return db[_0x5294('0x1c')][_0x5294('0x37')]({'where':{'id':_0x1653af[_0x5294('0x38')]['id']},'include':[{'model':db[_0x5294('0x39')],'as':_0x5294('0x3a'),'include':[{'model':db[_0x5294('0x27')],'as':_0x5294('0x3b'),'where':_0x3c5bc8,'limit':0x1,'order':[[_0x5294('0x3c'),_0x5294('0x3d')]]}]},{'model':db[_0x5294('0x3e')],'as':_0x5294('0x3f')}]});})[_0x5294('0xf')](function(_0x506977){if(_0x506977&&_0x506977[_0x5294('0x3a')]){var _0x5b4cd9=_0x506977[_0x5294('0x40')]({'plain':!![]});_0x284065[_0x5294('0x38')]=_0x5b4cd9;_0x284065[_0x5294('0x41')]=_0x5b4cd9[_0x5294('0x3f')];_0x284065[_0x5294('0x42')]=_0x5b4cd9['List'];_0x284065[_0x5294('0x41')]=_[_0x5294('0x43')](_0x284065[_0x5294('0x41')],[_0x5294('0x44')],[_0x5294('0x45')]);if(_0x284065[_0x5294('0x38')][_0x5294('0x3f')]){delete _0x284065[_0x5294('0x38')]['Applications'];}if(_0x284065['account'][_0x5294('0x3a')]&&_0x284065[_0x5294('0x38')][_0x5294('0x3a')]['Contacts'][_0x5294('0x46')]){return _0x284065['account'][_0x5294('0x3a')][_0x5294('0x3b')][0x0];}var _0x31bed2=_[_0x5294('0x47')](_0x1653af[_0x5294('0x25')],{'firstName':_0x1653af[_0x5294('0x25')][_0x5294('0x2f')],'ListId':_0x5b4cd9[_0x5294('0x2e')]});_0x31bed2[_0x1653af[_0x5294('0x25')][_0x5294('0x33')]]=_0x1653af[_0x5294('0x25')][_0x5294('0x2f')];return db[_0x5294('0x27')][_0x5294('0x48')](_0x31bed2,{'fields':_0x385bb5,'raw':!![]});}})['then'](function(_0x1a1cc7){_0x284065[_0x5294('0x49')]=_0x1a1cc7;if(_0x1a1cc7){var _0x30cfa0={'ContactId':_0x1a1cc7['id'],'FaxAccountId':_0x1653af[_0x5294('0x38')]['id'],'fax':_0x1a1cc7[_0x5294('0x26')]};return db['FaxInteraction'][_0x5294('0x37')]({'where':{'ContactId':_0x1a1cc7['id'],'closed':![],'FaxAccountId':_0x1653af[_0x5294('0x38')]['id']}})[_0x5294('0xf')](function(_0x37f1bb){if(_0x37f1bb){return[_0x37f1bb,![]];}return db[_0x5294('0x4a')]['create'](_0x30cfa0)['then'](function(_0x5795d0){return[_0x5795d0,!![]];});});}else{throw new Error(_0x5294('0x4b'));}})['spread'](function(_0x30a6f3,_0x5978ab){var _0x20f97e=_0x30a6f3[_0x5294('0x40')]({'plain':!![]});if(_0x5978ab){if(_0x284065[_0x5294('0x38')]['autoclose']){_0x284065[_0x5294('0x41')]['push']({'id':0x0,'priority':_0x284065[_0x5294('0x41')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x5294('0x4c')});}_0x20f97e[_0x5294('0x4d')]=!![];}else{_0x20f97e[_0x5294('0x4d')]=![];}_0x284065[_0x5294('0x4e')]=_0x20f97e;return db[_0x5294('0x4f')]['create']({'body':_0x1653af['body'][_0x5294('0x25')],'FaxAccountId':_0x1653af['account']['id'],'FaxInteractionId':_0x30a6f3['id'],'direction':'in','ContactId':_0x30a6f3[_0x5294('0x50')],'AttachmentId':_0x1653af['body'][_0x5294('0x51')]});})[_0x5294('0xf')](function(_0x45317f){_0x284065[_0x5294('0x17')]=_0x45317f;if(_0x284065[_0x5294('0x4e')][_0x5294('0x52')]){return db[_0x5294('0x53')]['find']({'attributes':['id',_0x5294('0x54')],'where':{'id':_0x284065['interaction']['UserId']}})[_0x5294('0xf')](function(_0x22e8a1){if(_0x22e8a1){_0x284065[_0x5294('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5294('0x55'),'appdata':_0x22e8a1[_0x5294('0x54')]+','+(_0x284065['account'][_0x5294('0x56')]||0xa),'interval':_0x5294('0x4c')});}return respondWithRpcPromise(_0x5294('0x57'),_0x5294('0x58'),_0x284065);});}return respondWithRpcPromise(_0x5294('0x57'),_0x5294('0x58'),_0x284065);})[_0x5294('0xf')](function(_0x5e1011){_0x3497ce(_0x5e1011);})['catch'](function(_0x426ea8){_0x52a08c(_0x1dd9cb[_0x5294('0x15')](0x1f4,_0x426ea8['message']));});});};
\ No newline at end of file
index 636869e..2ed34f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['faxAccount:','./faxAccount.events','save','update','emit','removeListener','register','length'];(function(_0x3dd3cd,_0x5ea724){var _0xdf70f8=function(_0x38dcdb){while(--_0x38dcdb){_0x3dd3cd['push'](_0x3dd3cd['shift']());}};_0xdf70f8(++_0x5ea724);}(_0xb016,0x119));var _0x6b01=function(_0x38ba33,_0x2c78dc){_0x38ba33=_0x38ba33-0x0;var _0x45d139=_0xb016[_0x38ba33];return _0x45d139;};'use strict';var FaxAccountEvents=require(_0x6b01('0x0'));var events=[_0x6b01('0x1'),'remove',_0x6b01('0x2')];function createListener(_0x314923,_0x467506){return function(_0x19a874){_0x467506[_0x6b01('0x3')](_0x314923,_0x19a874);};}function removeListener(_0x91d146,_0x386bf9){return function(){FaxAccountEvents[_0x6b01('0x4')](_0x91d146,_0x386bf9);};}exports[_0x6b01('0x5')]=function(_0x202a38){for(var _0x503a4c=0x0,_0x509f3e=events[_0x6b01('0x6')];_0x503a4c<_0x509f3e;_0x503a4c++){var _0x4a46f1=events[_0x503a4c];var _0x262cf1=createListener(_0x6b01('0x7')+_0x4a46f1,_0x202a38);FaxAccountEvents['on'](_0x4a46f1,_0x262cf1);}};
\ No newline at end of file
+var _0xbf11=['./faxAccount.events','save','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x46b638,_0xb954d5){var _0x23b80f=function(_0x3422e0){while(--_0x3422e0){_0x46b638['push'](_0x46b638['shift']());}};_0x23b80f(++_0xb954d5);}(_0xbf11,0xab));var _0x1bf1=function(_0x28c1c0,_0x2398aa){_0x28c1c0=_0x28c1c0-0x0;var _0x2ff1e3=_0xbf11[_0x28c1c0];return _0x2ff1e3;};'use strict';var FaxAccountEvents=require(_0x1bf1('0x0'));var events=[_0x1bf1('0x1'),_0x1bf1('0x2'),_0x1bf1('0x3')];function createListener(_0xb17457,_0x9e4967){return function(_0x3bfb5a){_0x9e4967[_0x1bf1('0x4')](_0xb17457,_0x3bfb5a);};}function removeListener(_0x14a980,_0x49261c){return function(){FaxAccountEvents[_0x1bf1('0x5')](_0x14a980,_0x49261c);};}exports[_0x1bf1('0x6')]=function(_0x143ab9){for(var _0x2aaf72=0x0,_0x1d148e=events[_0x1bf1('0x7')];_0x2aaf72<_0x1d148e;_0x2aaf72++){var _0x2b7854=events[_0x2aaf72];var _0x33b918=createListener(_0x1bf1('0x8')+_0x2b7854,_0x143ab9);FaxAccountEvents['on'](_0x2b7854,_0x33b918);}};
\ No newline at end of file
index f89de45..13c1a5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x1e15ed,_0x1f68ab){var _0x12bccf=function(_0x3330c9){while(--_0x3330c9){_0x1e15ed['push'](_0x1e15ed['shift']());}};_0x12bccf(++_0x1f68ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x59c381,_0x3b767d){var _0x4aaa6d=function(_0x453ce5){while(--_0x453ce5){_0x59c381['push'](_0x59c381['shift']());}};_0x4aaa6d(++_0x3b767d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
index 00f6eb0..281532e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f96=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x70adaa,_0x1d9bd0){var _0x4f399c=function(_0x1b1cfc){while(--_0x1b1cfc){_0x70adaa['push'](_0x70adaa['shift']());}};_0x4f399c(++_0x1d9bd0);}(_0x6f96,0xa9));var _0x66f9=function(_0x5d4cc7,_0x2a5c7e){_0x5d4cc7=_0x5d4cc7-0x0;var _0x463188=_0x6f96[_0x5d4cc7];return _0x463188;};'use strict';var Sequelize=require(_0x66f9('0x0'));module[_0x66f9('0x1')]={'priority':{'type':Sequelize[_0x66f9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x66f9('0x3')],'allowNull':![],'defaultValue':_0x66f9('0x4')},'appdata':{'type':Sequelize[_0x66f9('0x5')]()},'description':{'type':Sequelize[_0x66f9('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x66f9('0x6')}};
\ No newline at end of file
+var _0x4edc=['sequelize','exports','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x4edc,0xde));var _0xc4ed=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x4edc[_0x525af9];return _0x129fbf;};'use strict';var Sequelize=require(_0xc4ed('0x0'));module[_0xc4ed('0x1')]={'priority':{'type':Sequelize[_0xc4ed('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc4ed('0x3')]()},'description':{'type':Sequelize[_0xc4ed('0x4')]},'interval':{'type':Sequelize[_0xc4ed('0x4')],'defaultValue':_0xc4ed('0x5')}};
\ No newline at end of file
index 76d067e..493f340 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a01=['catch','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','fields','length','model','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','FaxApplication','rows'];(function(_0xa0a1ab,_0x6d0eb7){var _0x3d57aa=function(_0x44d9be){while(--_0x44d9be){_0xa0a1ab['push'](_0xa0a1ab['shift']());}};_0x3d57aa(++_0x6d0eb7);}(_0x1a01,0x1c7));var _0x11a0=function(_0x29a3cf,_0x2d787a){_0x29a3cf=_0x29a3cf-0x0;var _0x3dca8f=_0x1a01[_0x29a3cf];return _0x3dca8f;};'use strict';var emlformat=require(_0x11a0('0x0'));var rimraf=require(_0x11a0('0x1'));var zipdir=require(_0x11a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11a0('0x3'));var moment=require(_0x11a0('0x4'));var BPromise=require(_0x11a0('0x5'));var Mustache=require(_0x11a0('0x6'));var util=require(_0x11a0('0x7'));var path=require(_0x11a0('0x8'));var sox=require(_0x11a0('0x9'));var csv=require(_0x11a0('0xa'));var ejs=require(_0x11a0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11a0('0xc'));var squel=require(_0x11a0('0xd'));var crypto=require(_0x11a0('0xe'));var jsforce=require(_0x11a0('0xf'));var deskjs=require(_0x11a0('0x10'));var toCsv=require(_0x11a0('0xa'));var querystring=require(_0x11a0('0x11'));var Papa=require(_0x11a0('0x12'));var Redis=require(_0x11a0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x11a0('0x14'));var as=require(_0x11a0('0x15'));var hardwareService=require(_0x11a0('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x11a0('0x17'));var config=require(_0x11a0('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38b7ff,_0x5085fb){_0x5085fb=_0x5085fb||0xcc;return function(_0x73adfa){if(_0x73adfa){return _0x38b7ff[_0x11a0('0x19')](_0x5085fb);}return _0x38b7ff[_0x11a0('0x1a')](_0x5085fb)[_0x11a0('0x1b')]();};}function respondWithResult(_0x26e00e,_0x20874){_0x20874=_0x20874||0xc8;return function(_0x51d2fc){if(_0x51d2fc){return _0x26e00e[_0x11a0('0x1a')](_0x20874)[_0x11a0('0x1c')](_0x51d2fc);}};}function respondWithFilteredResult(_0x4432f7,_0x401e21){return function(_0x28c8ef){if(_0x28c8ef){var _0x1d51a4=typeof _0x401e21[_0x11a0('0x1d')]===_0x11a0('0x1e')&&typeof _0x401e21[_0x11a0('0x1f')]===_0x11a0('0x1e');var _0x1ace3e=_0x28c8ef['count'];var _0x253331=_0x1d51a4?0x0:_0x401e21['offset'];var _0x22383f=_0x1d51a4?_0x28c8ef['count']:_0x401e21[_0x11a0('0x1d')]+_0x401e21[_0x11a0('0x1f')];var _0x33caab;if(_0x22383f>=_0x1ace3e){_0x22383f=_0x1ace3e;_0x33caab=0xc8;}else{_0x33caab=0xce;}_0x4432f7[_0x11a0('0x1a')](_0x33caab);return _0x4432f7[_0x11a0('0x20')](_0x11a0('0x21'),_0x253331+'-'+_0x22383f+'/'+_0x1ace3e)[_0x11a0('0x1c')](_0x28c8ef);}return null;};}function patchUpdates(_0x29c46c){return function(_0x251d86){try{jsonpatch[_0x11a0('0x22')](_0x251d86,_0x29c46c,!![]);}catch(_0x160ae4){return BPromise[_0x11a0('0x23')](_0x160ae4);}return _0x251d86[_0x11a0('0x24')]();};}function saveUpdates(_0xd557e3,_0x37dcc8){return function(_0x257a25){if(_0x257a25){return _0x257a25[_0x11a0('0x25')](_0xd557e3)[_0x11a0('0x26')](function(_0x40bb00){return _0x40bb00;});}return null;};}function removeEntity(_0x2fea1a,_0x33fe02){return function(_0x5d46eb){if(_0x5d46eb){return _0x5d46eb[_0x11a0('0x27')]()[_0x11a0('0x26')](function(){_0x2fea1a[_0x11a0('0x1a')](0xcc)[_0x11a0('0x1b')]();});}};}function handleEntityNotFound(_0xca4143,_0x479d38){return function(_0x34ceaa){if(!_0x34ceaa){_0xca4143[_0x11a0('0x19')](0x194);}return _0x34ceaa;};}function handleError(_0x181bf6,_0x3926d5){_0x3926d5=_0x3926d5||0x1f4;return function(_0x44322c){logger[_0x11a0('0x28')](_0x44322c[_0x11a0('0x29')]);if(_0x44322c[_0x11a0('0x2a')]){delete _0x44322c[_0x11a0('0x2a')];}_0x181bf6[_0x11a0('0x1a')](_0x3926d5)['send'](_0x44322c);};}exports[_0x11a0('0x2b')]=function(_0x261baa,_0xbc186){var _0x2f6b31={},_0x27c542={},_0x9d021c={'count':0x0,'rows':[]};var _0x576527=_[_0x11a0('0x2c')](db['FaxApplication'][_0x11a0('0x2d')],function(_0x428a78){return{'name':_0x428a78[_0x11a0('0x2e')],'type':_0x428a78[_0x11a0('0x2f')][_0x11a0('0x30')]};});_0x27c542['model']=_[_0x11a0('0x2c')](_0x576527,'name');_0x27c542['query']=_[_0x11a0('0x31')](_0x261baa[_0x11a0('0x32')]);_0x27c542[_0x11a0('0x33')]=_['intersection'](_0x27c542['model'],_0x27c542[_0x11a0('0x32')]);_0x2f6b31[_0x11a0('0x34')]=_[_0x11a0('0x35')](_0x27c542['model'],qs[_0x11a0('0x36')](_0x261baa[_0x11a0('0x32')][_0x11a0('0x36')]));_0x2f6b31['attributes']=_0x2f6b31[_0x11a0('0x34')][_0x11a0('0x37')]?_0x2f6b31[_0x11a0('0x34')]:_0x27c542[_0x11a0('0x38')];if(!_0x261baa[_0x11a0('0x32')]['hasOwnProperty']('nolimit')){_0x2f6b31[_0x11a0('0x1f')]=qs[_0x11a0('0x1f')](_0x261baa[_0x11a0('0x32')][_0x11a0('0x1f')]);_0x2f6b31['offset']=qs[_0x11a0('0x1d')](_0x261baa[_0x11a0('0x32')]['offset']);}_0x2f6b31[_0x11a0('0x39')]=qs[_0x11a0('0x3a')](_0x261baa[_0x11a0('0x32')][_0x11a0('0x3a')]);_0x2f6b31[_0x11a0('0x3b')]=qs[_0x11a0('0x33')](_[_0x11a0('0x3c')](_0x261baa['query'],_0x27c542['filters']),_0x576527);if(_0x261baa[_0x11a0('0x32')][_0x11a0('0x3d')]){_0x2f6b31[_0x11a0('0x3b')]=_[_0x11a0('0x3e')](_0x2f6b31[_0x11a0('0x3b')],{'$or':_[_0x11a0('0x2c')](_0x576527,function(_0x4b4cbe){if(_0x4b4cbe[_0x11a0('0x2f')]!==_0x11a0('0x3f')){var _0x193c85={};_0x193c85[_0x4b4cbe[_0x11a0('0x2a')]]={'$like':'%'+_0x261baa[_0x11a0('0x32')]['filter']+'%'};return _0x193c85;}})});}_0x2f6b31=_['merge']({},_0x2f6b31,_0x261baa[_0x11a0('0x40')]);var _0x5a107={'where':_0x2f6b31[_0x11a0('0x3b')]};return db['FaxApplication']['count'](_0x5a107)['then'](function(_0x2a9500){_0x9d021c[_0x11a0('0x41')]=_0x2a9500;if(_0x261baa[_0x11a0('0x32')][_0x11a0('0x42')]){_0x2f6b31[_0x11a0('0x43')]=[{'all':!![]}];}return db[_0x11a0('0x44')]['findAll'](_0x2f6b31);})[_0x11a0('0x26')](function(_0x52392c){_0x9d021c[_0x11a0('0x45')]=_0x52392c;return _0x9d021c;})[_0x11a0('0x26')](respondWithFilteredResult(_0xbc186,_0x2f6b31))['catch'](handleError(_0xbc186,null));};exports['show']=function(_0xf6b90b,_0x106477){var _0x4c9905={'raw':!![],'where':{'id':_0xf6b90b['params']['id']}},_0x1c2b09={};_0x1c2b09['model']=_['keys'](db[_0x11a0('0x44')][_0x11a0('0x2d')]);_0x1c2b09[_0x11a0('0x32')]=_[_0x11a0('0x31')](_0xf6b90b[_0x11a0('0x32')]);_0x1c2b09[_0x11a0('0x33')]=_[_0x11a0('0x35')](_0x1c2b09[_0x11a0('0x38')],_0x1c2b09['query']);_0x4c9905[_0x11a0('0x34')]=_[_0x11a0('0x35')](_0x1c2b09['model'],qs[_0x11a0('0x36')](_0xf6b90b[_0x11a0('0x32')]['fields']));_0x4c9905[_0x11a0('0x34')]=_0x4c9905[_0x11a0('0x34')][_0x11a0('0x37')]?_0x4c9905[_0x11a0('0x34')]:_0x1c2b09[_0x11a0('0x38')];if(_0xf6b90b[_0x11a0('0x32')][_0x11a0('0x42')]){_0x4c9905['include']=[{'all':!![]}];}_0x4c9905=_[_0x11a0('0x3e')]({},_0x4c9905,_0xf6b90b['options']);return db['FaxApplication']['find'](_0x4c9905)[_0x11a0('0x26')](handleEntityNotFound(_0x106477,null))[_0x11a0('0x26')](respondWithResult(_0x106477,null))[_0x11a0('0x46')](handleError(_0x106477,null));};exports[_0x11a0('0x47')]=function(_0x102252,_0x37d340){return db[_0x11a0('0x44')][_0x11a0('0x47')](_0x102252[_0x11a0('0x48')],{})['then'](respondWithResult(_0x37d340,0xc9))[_0x11a0('0x46')](handleError(_0x37d340,null));};exports[_0x11a0('0x25')]=function(_0x15dbda,_0x5b5a35){if(_0x15dbda[_0x11a0('0x48')]['id']){delete _0x15dbda[_0x11a0('0x48')]['id'];}return db['FaxApplication'][_0x11a0('0x49')]({'where':{'id':_0x15dbda[_0x11a0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b5a35,null))[_0x11a0('0x26')](saveUpdates(_0x15dbda[_0x11a0('0x48')],null))[_0x11a0('0x26')](respondWithResult(_0x5b5a35,null))[_0x11a0('0x46')](handleError(_0x5b5a35,null));};exports[_0x11a0('0x27')]=function(_0x28e0c1,_0x19c2f7){return db[_0x11a0('0x44')][_0x11a0('0x49')]({'where':{'id':_0x28e0c1[_0x11a0('0x4a')]['id']}})[_0x11a0('0x26')](handleEntityNotFound(_0x19c2f7,null))[_0x11a0('0x26')](removeEntity(_0x19c2f7,null))[_0x11a0('0x46')](handleError(_0x19c2f7,null));};
\ No newline at end of file
+var _0xbf1a=['params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch'];(function(_0x156dba,_0x4e513e){var _0xa401c=function(_0x2fcb8c){while(--_0x2fcb8c){_0x156dba['push'](_0x156dba['shift']());}};_0xa401c(++_0x4e513e);}(_0xbf1a,0x93));var _0xabf1=function(_0x1f860d,_0x3f4da3){_0x1f860d=_0x1f860d-0x0;var _0x5798a0=_0xbf1a[_0x1f860d];return _0x5798a0;};'use strict';var emlformat=require(_0xabf1('0x0'));var rimraf=require(_0xabf1('0x1'));var zipdir=require(_0xabf1('0x2'));var jsonpatch=require(_0xabf1('0x3'));var rp=require(_0xabf1('0x4'));var moment=require(_0xabf1('0x5'));var BPromise=require(_0xabf1('0x6'));var Mustache=require(_0xabf1('0x7'));var util=require('util');var path=require('path');var sox=require(_0xabf1('0x8'));var csv=require(_0xabf1('0x9'));var ejs=require(_0xabf1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabf1('0xb'));var crypto=require(_0xabf1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xabf1('0xd'));var toCsv=require(_0xabf1('0x9'));var querystring=require(_0xabf1('0xe'));var Papa=require(_0xabf1('0xf'));var Redis=require(_0xabf1('0x10'));var authService=require(_0xabf1('0x11'));var qs=require(_0xabf1('0x12'));var as=require(_0xabf1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabf1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xabf1('0x15'));var licenseUtil=require(_0xabf1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x535194,_0x2e822a){_0x2e822a=_0x2e822a||0xcc;return function(_0x2fa898){if(_0x2fa898){return _0x535194[_0xabf1('0x17')](_0x2e822a);}return _0x535194[_0xabf1('0x18')](_0x2e822a)[_0xabf1('0x19')]();};}function respondWithResult(_0x5a8c95,_0x1d8ec0){_0x1d8ec0=_0x1d8ec0||0xc8;return function(_0xbcc91c){if(_0xbcc91c){return _0x5a8c95[_0xabf1('0x18')](_0x1d8ec0)['json'](_0xbcc91c);}};}function respondWithFilteredResult(_0x9a2e2e,_0x21c65f){return function(_0xff745c){if(_0xff745c){var _0xd2847b=typeof _0x21c65f[_0xabf1('0x1a')]==='undefined'&&typeof _0x21c65f['limit']==='undefined';var _0x5440bd=_0xff745c[_0xabf1('0x1b')];var _0x16f721=_0xd2847b?0x0:_0x21c65f[_0xabf1('0x1a')];var _0x510ba1=_0xd2847b?_0xff745c[_0xabf1('0x1b')]:_0x21c65f[_0xabf1('0x1a')]+_0x21c65f['limit'];var _0x47d83f;if(_0x510ba1>=_0x5440bd){_0x510ba1=_0x5440bd;_0x47d83f=0xc8;}else{_0x47d83f=0xce;}_0x9a2e2e[_0xabf1('0x18')](_0x47d83f);return _0x9a2e2e[_0xabf1('0x1c')](_0xabf1('0x1d'),_0x16f721+'-'+_0x510ba1+'/'+_0x5440bd)[_0xabf1('0x1e')](_0xff745c);}return null;};}function patchUpdates(_0x56c413){return function(_0x1d91b0){try{jsonpatch['apply'](_0x1d91b0,_0x56c413,!![]);}catch(_0x4754f5){return BPromise[_0xabf1('0x1f')](_0x4754f5);}return _0x1d91b0['save']();};}function saveUpdates(_0x5c4a30,_0x1c7786){return function(_0x4ac9e2){if(_0x4ac9e2){return _0x4ac9e2[_0xabf1('0x20')](_0x5c4a30)[_0xabf1('0x21')](function(_0x188a05){return _0x188a05;});}return null;};}function removeEntity(_0x4d05bc,_0x3d9c1a){return function(_0x693e22){if(_0x693e22){return _0x693e22[_0xabf1('0x22')]()[_0xabf1('0x21')](function(){_0x4d05bc[_0xabf1('0x18')](0xcc)[_0xabf1('0x19')]();});}};}function handleEntityNotFound(_0x6571e7,_0x5e1ee1){return function(_0x591449){if(!_0x591449){_0x6571e7['sendStatus'](0x194);}return _0x591449;};}function handleError(_0x31e50e,_0xebf97){_0xebf97=_0xebf97||0x1f4;return function(_0x12938e){logger[_0xabf1('0x23')](_0x12938e[_0xabf1('0x24')]);if(_0x12938e['name']){delete _0x12938e[_0xabf1('0x25')];}_0x31e50e[_0xabf1('0x18')](_0xebf97)[_0xabf1('0x26')](_0x12938e);};}exports[_0xabf1('0x27')]=function(_0x133f87,_0x414cb6){var _0x5befb0={},_0x1e06a6={},_0x2e56d2={'count':0x0,'rows':[]};var _0x1e527a=_[_0xabf1('0x28')](db[_0xabf1('0x29')][_0xabf1('0x2a')],function(_0xd074a2){return{'name':_0xd074a2[_0xabf1('0x2b')],'type':_0xd074a2[_0xabf1('0x2c')][_0xabf1('0x2d')]};});_0x1e06a6[_0xabf1('0x2e')]=_[_0xabf1('0x28')](_0x1e527a,_0xabf1('0x25'));_0x1e06a6[_0xabf1('0x2f')]=_[_0xabf1('0x30')](_0x133f87[_0xabf1('0x2f')]);_0x1e06a6[_0xabf1('0x31')]=_[_0xabf1('0x32')](_0x1e06a6['model'],_0x1e06a6['query']);_0x5befb0[_0xabf1('0x33')]=_[_0xabf1('0x32')](_0x1e06a6['model'],qs[_0xabf1('0x34')](_0x133f87[_0xabf1('0x2f')][_0xabf1('0x34')]));_0x5befb0['attributes']=_0x5befb0[_0xabf1('0x33')][_0xabf1('0x35')]?_0x5befb0[_0xabf1('0x33')]:_0x1e06a6[_0xabf1('0x2e')];if(!_0x133f87[_0xabf1('0x2f')]['hasOwnProperty']('nolimit')){_0x5befb0[_0xabf1('0x36')]=qs[_0xabf1('0x36')](_0x133f87['query']['limit']);_0x5befb0[_0xabf1('0x1a')]=qs['offset'](_0x133f87[_0xabf1('0x2f')]['offset']);}_0x5befb0[_0xabf1('0x37')]=qs[_0xabf1('0x38')](_0x133f87['query'][_0xabf1('0x38')]);_0x5befb0[_0xabf1('0x39')]=qs['filters'](_[_0xabf1('0x3a')](_0x133f87[_0xabf1('0x2f')],_0x1e06a6[_0xabf1('0x31')]),_0x1e527a);if(_0x133f87[_0xabf1('0x2f')][_0xabf1('0x3b')]){_0x5befb0[_0xabf1('0x39')]=_['merge'](_0x5befb0[_0xabf1('0x39')],{'$or':_[_0xabf1('0x28')](_0x1e527a,function(_0x1710b6){if(_0x1710b6['type']!=='VIRTUAL'){var _0x43e593={};_0x43e593[_0x1710b6[_0xabf1('0x25')]]={'$like':'%'+_0x133f87['query']['filter']+'%'};return _0x43e593;}})});}_0x5befb0=_[_0xabf1('0x3c')]({},_0x5befb0,_0x133f87[_0xabf1('0x3d')]);var _0x149d54={'where':_0x5befb0[_0xabf1('0x39')]};return db[_0xabf1('0x29')][_0xabf1('0x1b')](_0x149d54)[_0xabf1('0x21')](function(_0x42b54e){_0x2e56d2[_0xabf1('0x1b')]=_0x42b54e;if(_0x133f87['query'][_0xabf1('0x3e')]){_0x5befb0['include']=[{'all':!![]}];}return db[_0xabf1('0x29')][_0xabf1('0x3f')](_0x5befb0);})[_0xabf1('0x21')](function(_0x4cdf10){_0x2e56d2[_0xabf1('0x40')]=_0x4cdf10;return _0x2e56d2;})[_0xabf1('0x21')](respondWithFilteredResult(_0x414cb6,_0x5befb0))[_0xabf1('0x41')](handleError(_0x414cb6,null));};exports['show']=function(_0xdbdcb2,_0x8e60e1){var _0x2f2e07={'raw':!![],'where':{'id':_0xdbdcb2[_0xabf1('0x42')]['id']}},_0x259b6d={};_0x259b6d[_0xabf1('0x2e')]=_[_0xabf1('0x30')](db[_0xabf1('0x29')][_0xabf1('0x2a')]);_0x259b6d['query']=_[_0xabf1('0x30')](_0xdbdcb2['query']);_0x259b6d[_0xabf1('0x31')]=_['intersection'](_0x259b6d[_0xabf1('0x2e')],_0x259b6d[_0xabf1('0x2f')]);_0x2f2e07[_0xabf1('0x33')]=_[_0xabf1('0x32')](_0x259b6d['model'],qs[_0xabf1('0x34')](_0xdbdcb2[_0xabf1('0x2f')]['fields']));_0x2f2e07[_0xabf1('0x33')]=_0x2f2e07[_0xabf1('0x33')][_0xabf1('0x35')]?_0x2f2e07[_0xabf1('0x33')]:_0x259b6d[_0xabf1('0x2e')];if(_0xdbdcb2[_0xabf1('0x2f')]['includeAll']){_0x2f2e07[_0xabf1('0x43')]=[{'all':!![]}];}_0x2f2e07=_[_0xabf1('0x3c')]({},_0x2f2e07,_0xdbdcb2['options']);return db[_0xabf1('0x29')][_0xabf1('0x44')](_0x2f2e07)[_0xabf1('0x21')](handleEntityNotFound(_0x8e60e1,null))[_0xabf1('0x21')](respondWithResult(_0x8e60e1,null))[_0xabf1('0x41')](handleError(_0x8e60e1,null));};exports[_0xabf1('0x45')]=function(_0x2e4ab4,_0x3482b4){return db[_0xabf1('0x29')][_0xabf1('0x45')](_0x2e4ab4[_0xabf1('0x46')],{})[_0xabf1('0x21')](respondWithResult(_0x3482b4,0xc9))['catch'](handleError(_0x3482b4,null));};exports[_0xabf1('0x20')]=function(_0x260656,_0x41b377){if(_0x260656[_0xabf1('0x46')]['id']){delete _0x260656['body']['id'];}return db[_0xabf1('0x29')][_0xabf1('0x44')]({'where':{'id':_0x260656[_0xabf1('0x42')]['id']}})[_0xabf1('0x21')](handleEntityNotFound(_0x41b377,null))['then'](saveUpdates(_0x260656[_0xabf1('0x46')],null))[_0xabf1('0x21')](respondWithResult(_0x41b377,null))[_0xabf1('0x41')](handleError(_0x41b377,null));};exports[_0xabf1('0x22')]=function(_0x527e96,_0x502821){return db[_0xabf1('0x29')][_0xabf1('0x44')]({'where':{'id':_0x527e96[_0xabf1('0x42')]['id']}})[_0xabf1('0x21')](handleEntityNotFound(_0x502821,null))['then'](removeEntity(_0x502821,null))[_0xabf1('0x41')](handleError(_0x502821,null));};
\ No newline at end of file
index f67caa2..33fabcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8291=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','define'];(function(_0x41225c,_0x51efcc){var _0x447927=function(_0x11c454){while(--_0x11c454){_0x41225c['push'](_0x41225c['shift']());}};_0x447927(++_0x51efcc);}(_0x8291,0xee));var _0x1829=function(_0x21080b,_0x4e267e){_0x21080b=_0x21080b-0x0;var _0x59de05=_0x8291[_0x21080b];return _0x59de05;};'use strict';var _=require(_0x1829('0x0'));var util=require(_0x1829('0x1'));var logger=require(_0x1829('0x2'))(_0x1829('0x3'));var moment=require('moment');var BPromise=require(_0x1829('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1829('0x5'));var rimraf=require(_0x1829('0x6'));var config=require(_0x1829('0x7'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x109357,_0x5616fc){return _0x109357[_0x1829('0x8')](_0x1829('0x9'),attributes,{'tableName':_0x1829('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1829('0xb'),'collate':_0x1829('0xc')});};
\ No newline at end of file
+var _0x627e=['define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x26b36b,_0x5c7b28){var _0x55413b=function(_0x5d40c6){while(--_0x5d40c6){_0x26b36b['push'](_0x26b36b['shift']());}};_0x55413b(++_0x5c7b28);}(_0x627e,0xb5));var _0xe627=function(_0x1e0e84,_0x4592dd){_0x1e0e84=_0x1e0e84-0x0;var _0x510c61=_0x627e[_0x1e0e84];return _0x510c61;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var logger=require(_0xe627('0x2'))(_0xe627('0x3'));var moment=require('moment');var BPromise=require(_0xe627('0x4'));var rp=require(_0xe627('0x5'));var fs=require('fs');var path=require(_0xe627('0x6'));var rimraf=require(_0xe627('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x3a093b,_0x304f64){return _0x3a093b[_0xe627('0x8')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 82a13d3..323e20f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2bb=['then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x17ec03,_0x57dcf9){var _0x5122d4=function(_0xa2d347){while(--_0xa2d347){_0x17ec03['push'](_0x17ec03['shift']());}};_0x5122d4(++_0x57dcf9);}(_0xb2bb,0x198));var _0xbb2b=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0xb2bb[_0x1757f2];return _0x5e7212;};'use strict';var _=require(_0xbb2b('0x0'));var util=require('util');var moment=require(_0xbb2b('0x1'));var BPromise=require(_0xbb2b('0x2'));var rs=require(_0xbb2b('0x3'));var fs=require('fs');var Redis=require(_0xbb2b('0x4'));var db=require(_0xbb2b('0x5'))['db'];var utils=require(_0xbb2b('0x6'));var logger=require(_0xbb2b('0x7'))('rpc');var config=require(_0xbb2b('0x8'));var jayson=require(_0xbb2b('0x9'));var client=jayson[_0xbb2b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x573913,_0x37069c,_0x16c228){return new BPromise(function(_0x3d15ac,_0x577de5){return client[_0xbb2b('0xb')](_0x573913,_0x16c228)[_0xbb2b('0xc')](function(_0x225783){logger[_0xbb2b('0xd')](_0xbb2b('0xe'),_0x37069c,_0xbb2b('0xf'));logger[_0xbb2b('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x37069c,'request\x20sent',JSON[_0xbb2b('0x11')](_0x225783));if(_0x225783[_0xbb2b('0x12')]){if(_0x225783['error'][_0xbb2b('0x13')]===0x1f4){logger[_0xbb2b('0x12')](_0xbb2b('0xe'),_0x37069c,_0x225783['error'][_0xbb2b('0x14')]);return _0x577de5(_0x225783[_0xbb2b('0x12')][_0xbb2b('0x14')]);}logger['error'](_0xbb2b('0xe'),_0x37069c,_0x225783[_0xbb2b('0x12')][_0xbb2b('0x14')]);return _0x3d15ac(_0x225783[_0xbb2b('0x12')]['message']);}else{logger[_0xbb2b('0xd')](_0xbb2b('0xe'),_0x37069c,_0xbb2b('0xf'));_0x3d15ac(_0x225783[_0xbb2b('0x15')][_0xbb2b('0x14')]);}})['catch'](function(_0x25df95){logger[_0xbb2b('0x12')](_0xbb2b('0xe'),_0x37069c,_0x25df95);_0x577de5(_0x25df95);});});}exports[_0xbb2b('0x16')]=function(_0x49e14a){var _0x30b18f=this;return new Promise(function(_0x385255,_0x29de7f){return db[_0xbb2b('0x17')][_0xbb2b('0x18')](_0x49e14a[_0xbb2b('0x19')],{'raw':_0x49e14a['options']?_0x49e14a[_0xbb2b('0x1a')][_0xbb2b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49e14a[_0xbb2b('0x1a')]?_0x49e14a[_0xbb2b('0x1a')]['where']||null:null,'attributes':_0x49e14a[_0xbb2b('0x1a')]?_0x49e14a[_0xbb2b('0x1a')]['attributes']||null:null,'limit':_0x49e14a[_0xbb2b('0x1a')]?_0x49e14a['options'][_0xbb2b('0x1c')]||null:null})[_0xbb2b('0xc')](function(_0x5d1b8e){logger[_0xbb2b('0xd')](_0xbb2b('0x16'),_0x49e14a);logger[_0xbb2b('0x10')](_0xbb2b('0x16'),_0x49e14a,JSON[_0xbb2b('0x11')](_0x5d1b8e));_0x385255(_0x5d1b8e);})[_0xbb2b('0x1d')](function(_0x5d4faa){logger[_0xbb2b('0x12')](_0xbb2b('0x16'),_0x5d4faa['message'],_0x49e14a);_0x29de7f(_0x30b18f[_0xbb2b('0x12')](0x1f4,_0x5d4faa[_0xbb2b('0x14')]));});});};
\ No newline at end of file
+var _0x9123=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x3f55d4,_0x67fe3c){var _0x2cff44=function(_0x3a6d7f){while(--_0x3a6d7f){_0x3f55d4['push'](_0x3f55d4['shift']());}};_0x2cff44(++_0x67fe3c);}(_0x9123,0xb0));var _0x3912=function(_0x37454f,_0x3064d6){_0x37454f=_0x37454f-0x0;var _0x5ee8e9=_0x9123[_0x37454f];return _0x5ee8e9;};'use strict';var _=require(_0x3912('0x0'));var util=require(_0x3912('0x1'));var moment=require(_0x3912('0x2'));var BPromise=require(_0x3912('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3912('0x4'));var db=require(_0x3912('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3912('0x6'));var config=require(_0x3912('0x7'));var jayson=require(_0x3912('0x8'));var client=jayson[_0x3912('0x9')][_0x3912('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c6626,_0xacc0b9,_0x4fe04d){return new BPromise(function(_0x5ab4b1,_0x23c911){return client[_0x3912('0xb')](_0x4c6626,_0x4fe04d)[_0x3912('0xc')](function(_0x5832f1){logger[_0x3912('0xd')](_0x3912('0xe'),_0xacc0b9,_0x3912('0xf'));logger[_0x3912('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0xacc0b9,_0x3912('0xf'),JSON[_0x3912('0x11')](_0x5832f1));if(_0x5832f1[_0x3912('0x12')]){if(_0x5832f1['error'][_0x3912('0x13')]===0x1f4){logger[_0x3912('0x12')]('FaxApplication,\x20%s,\x20%s',_0xacc0b9,_0x5832f1['error']['message']);return _0x23c911(_0x5832f1['error']['message']);}logger[_0x3912('0x12')](_0x3912('0xe'),_0xacc0b9,_0x5832f1[_0x3912('0x12')][_0x3912('0x14')]);return _0x5ab4b1(_0x5832f1[_0x3912('0x12')][_0x3912('0x14')]);}else{logger[_0x3912('0xd')](_0x3912('0xe'),_0xacc0b9,_0x3912('0xf'));_0x5ab4b1(_0x5832f1['result'][_0x3912('0x14')]);}})['catch'](function(_0x373b03){logger[_0x3912('0x12')]('FaxApplication,\x20%s,\x20%s',_0xacc0b9,_0x373b03);_0x23c911(_0x373b03);});});}exports[_0x3912('0x15')]=function(_0x6a0271){var _0x22dc2b=this;return new Promise(function(_0x2244f2,_0x56c512){return db[_0x3912('0x16')][_0x3912('0x17')](_0x6a0271[_0x3912('0x18')],{'raw':_0x6a0271['options']?_0x6a0271[_0x3912('0x19')][_0x3912('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a0271['options']?_0x6a0271['options'][_0x3912('0x1b')]||null:null,'attributes':_0x6a0271[_0x3912('0x19')]?_0x6a0271[_0x3912('0x19')][_0x3912('0x1c')]||null:null,'limit':_0x6a0271[_0x3912('0x19')]?_0x6a0271[_0x3912('0x19')][_0x3912('0x1d')]||null:null})[_0x3912('0xc')](function(_0x59247a){logger['info']('UpdateFaxApplication',_0x6a0271);logger['debug'](_0x3912('0x15'),_0x6a0271,JSON[_0x3912('0x11')](_0x59247a));_0x2244f2(_0x59247a);})['catch'](function(_0x2f1a4c){logger[_0x3912('0x12')](_0x3912('0x15'),_0x2f1a4c[_0x3912('0x14')],_0x6a0271);_0x56c512(_0x22dc2b['error'](0x1f4,_0x2f1a4c[_0x3912('0x14')]));});});};
\ No newline at end of file
index 47dd4b7..b10a3f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xb688,0xcf));var _0x8b68=function(_0x584eb0,_0x5188ab){_0x584eb0=_0x584eb0-0x0;var _0x569dcc=_0xb688[_0x584eb0];return _0x569dcc;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router;
\ No newline at end of file
+var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x1cb17c,_0x1df764){var _0x262a30=function(_0x420970){while(--_0x420970){_0x1cb17c['push'](_0x1cb17c['shift']());}};_0x262a30(++_0x1df764);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xc0906e,_0x2215d1){_0xc0906e=_0xc0906e-0x0;var _0x508e4f=_0xdd4f[_0xc0906e];return _0x508e4f;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router;
\ No newline at end of file
index c9c971a..cd5dfa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x564f=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x2a7ee1,_0x3660c5){var _0x1d2284=function(_0x3f17f8){while(--_0x3f17f8){_0x2a7ee1['push'](_0x2a7ee1['shift']());}};_0x1d2284(++_0x3660c5);}(_0x564f,0x123));var _0xf564=function(_0x6a935a,_0x43da04){_0x6a935a=_0x6a935a-0x0;var _0x15180f=_0x564f[_0x6a935a];return _0x15180f;};'use strict';var Sequelize=require(_0xf564('0x0'));module[_0xf564('0x1')]={'closed':{'type':Sequelize[_0xf564('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf564('0x3')]},'disposition':{'type':Sequelize[_0xf564('0x4')]},'secondDisposition':{'type':Sequelize[_0xf564('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf564('0x4')]},'read1stAt':{'type':Sequelize[_0xf564('0x3')]},'fax':{'type':Sequelize[_0xf564('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf564('0x5')]('in',_0xf564('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf564('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf564('0x5')]('in',_0xf564('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x7ba0=['sequelize','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x56122d,_0x485a3f){var _0x32537f=function(_0x446a9f){while(--_0x446a9f){_0x56122d['push'](_0x56122d['shift']());}};_0x32537f(++_0x485a3f);}(_0x7ba0,0x7e));var _0x07ba=function(_0x2d5b1b,_0x4a72e9){_0x2d5b1b=_0x2d5b1b-0x0;var _0x31ffe2=_0x7ba0[_0x2d5b1b];return _0x31ffe2;};'use strict';var Sequelize=require(_0x07ba('0x0'));module[_0x07ba('0x1')]={'closed':{'type':Sequelize[_0x07ba('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x07ba('0x3')]},'secondDisposition':{'type':Sequelize[_0x07ba('0x3')]},'thirdDisposition':{'type':Sequelize[_0x07ba('0x3')]},'note':{'type':Sequelize[_0x07ba('0x3')]},'read1stAt':{'type':Sequelize[_0x07ba('0x4')]},'fax':{'type':Sequelize[_0x07ba('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x07ba('0x5')]('in',_0x07ba('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index ee14307..2b11040 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cc4=['existsSync','createReadStream','pipe','createWriteStream','basename','log','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','Users','map','fullname','TagIds','split','forEach','Tags','catch','waiting','talking','answered','unmanaged','total','UserId','closed','index','FaxInteraction','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','u.id\x20=\x20ui.UserId','select','fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','keys','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','rows','show','params','include','merge','options','create','describe','addMessage','ids','omit','getMessages','FaxMessage','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','faxInteractionTags:save','removeTags','download','root','server','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync'];(function(_0x11a615,_0x373217){var _0x2ca902=function(_0x453c81){while(--_0x453c81){_0x11a615['push'](_0x11a615['shift']());}};_0x2ca902(++_0x373217);}(_0x4cc4,0x1d0));var _0x44cc=function(_0x321efa,_0x3a7e8e){_0x321efa=_0x321efa-0x0;var _0x3d266f=_0x4cc4[_0x321efa];return _0x3d266f;};'use strict';var emlformat=require(_0x44cc('0x0'));var rimraf=require(_0x44cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44cc('0x2'));var moment=require(_0x44cc('0x3'));var BPromise=require(_0x44cc('0x4'));var Mustache=require(_0x44cc('0x5'));var util=require(_0x44cc('0x6'));var path=require(_0x44cc('0x7'));var sox=require(_0x44cc('0x8'));var csv=require(_0x44cc('0x9'));var ejs=require(_0x44cc('0xa'));var fs=require('fs');var fs_extra=require(_0x44cc('0xb'));var _=require(_0x44cc('0xc'));var squel=require('squel');var crypto=require(_0x44cc('0xd'));var jsforce=require(_0x44cc('0xe'));var deskjs=require(_0x44cc('0xf'));var toCsv=require(_0x44cc('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x44cc('0x10'));var authService=require(_0x44cc('0x11'));var qs=require(_0x44cc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44cc('0x13'));var logger=require(_0x44cc('0x14'))(_0x44cc('0x15'));var utils=require(_0x44cc('0x16'));var config=require(_0x44cc('0x17'));var licenseUtil=require(_0x44cc('0x18'));var db=require(_0x44cc('0x19'))['db'];config[_0x44cc('0x1a')]=_['defaults'](config[_0x44cc('0x1a')],{'host':_0x44cc('0x1b'),'port':0x18eb});var socket=require(_0x44cc('0x1c'))(new Redis(config[_0x44cc('0x1a')]));require(_0x44cc('0x1d'))[_0x44cc('0x1e')](socket);function respondWithStatusCode(_0x5d9d6b,_0x34f5fd){_0x34f5fd=_0x34f5fd||0xcc;return function(_0x28d374){if(_0x28d374){return _0x5d9d6b[_0x44cc('0x1f')](_0x34f5fd);}return _0x5d9d6b['status'](_0x34f5fd)[_0x44cc('0x20')]();};}function respondWithResult(_0x2e1c66,_0x40cf8a){_0x40cf8a=_0x40cf8a||0xc8;return function(_0x23e388){if(_0x23e388){return _0x2e1c66[_0x44cc('0x21')](_0x40cf8a)[_0x44cc('0x22')](_0x23e388);}};}function respondWithFilteredResult(_0x53f61c,_0x575346){return function(_0x39cb9b){if(_0x39cb9b){var _0x1e6e82=typeof _0x575346[_0x44cc('0x23')]==='undefined'&&typeof _0x575346[_0x44cc('0x24')]===_0x44cc('0x25');var _0x4a93d8=_0x39cb9b[_0x44cc('0x26')];var _0x55ef86=_0x1e6e82?0x0:_0x575346[_0x44cc('0x23')];var _0x4bbb6b=_0x1e6e82?_0x39cb9b[_0x44cc('0x26')]:_0x575346[_0x44cc('0x23')]+_0x575346[_0x44cc('0x24')];var _0x503724;if(_0x4bbb6b>=_0x4a93d8){_0x4bbb6b=_0x4a93d8;_0x503724=0xc8;}else{_0x503724=0xce;}_0x53f61c[_0x44cc('0x21')](_0x503724);return _0x53f61c[_0x44cc('0x27')](_0x44cc('0x28'),_0x55ef86+'-'+_0x4bbb6b+'/'+_0x4a93d8)['json'](_0x39cb9b);}return null;};}function patchUpdates(_0x38b605){return function(_0x4a2617){try{jsonpatch[_0x44cc('0x29')](_0x4a2617,_0x38b605,!![]);}catch(_0x51f976){return BPromise[_0x44cc('0x2a')](_0x51f976);}return _0x4a2617['save']();};}function saveUpdates(_0xfbb61e,_0x139ea5){return function(_0x204503){if(_0x204503){return _0x204503[_0x44cc('0x2b')](_0xfbb61e)[_0x44cc('0x2c')](function(_0x3dd8ff){return _0x3dd8ff;});}return null;};}function removeEntity(_0x3cc8f6,_0x404f4d){return function(_0xff2d5e){if(_0xff2d5e){return _0xff2d5e[_0x44cc('0x2d')]()[_0x44cc('0x2c')](function(){_0x3cc8f6['status'](0xcc)[_0x44cc('0x20')]();});}};}function handleEntityNotFound(_0x5f4311,_0x227a93){return function(_0x1dba9b){if(!_0x1dba9b){_0x5f4311['sendStatus'](0x194);}return _0x1dba9b;};}function handleError(_0x5041b7,_0x1053e7){_0x1053e7=_0x1053e7||0x1f4;return function(_0x3f9d56){logger[_0x44cc('0x2e')](_0x3f9d56['stack']);if(_0x3f9d56[_0x44cc('0x2f')]){delete _0x3f9d56[_0x44cc('0x2f')];}_0x5041b7[_0x44cc('0x21')](_0x1053e7)[_0x44cc('0x30')](_0x3f9d56);};}function getInteractionUsers(_0x126c9f,_0x362ab1){return new BPromise(function(_0x59aa22,_0x1a35da){try{if(_0x362ab1[_0x126c9f['id']]){_0x126c9f[_0x44cc('0x31')]=_[_0x44cc('0x32')](_0x362ab1[_0x126c9f['id']],function(_0x45d3de){return{'id':_0x45d3de['id'],'fullname':_0x45d3de[_0x44cc('0x33')]};});}}catch(_0x52f4bc){_0x1a35da(_0x52f4bc);}_0x59aa22(_0x126c9f);});}function getInteractionTags(_0x4625ce,_0xc80627){return new BPromise(function(_0x25d028,_0x4a4c6a){try{if(_0x4625ce[_0x44cc('0x34')]){_0x4625ce['Tags']=[];_0x4625ce[_0x44cc('0x34')][_0x44cc('0x35')](',')[_0x44cc('0x36')](function(_0x3084b0){_0x4625ce[_0x44cc('0x37')]['push'](_0xc80627[_0x3084b0]);});}delete _0x4625ce[_0x44cc('0x34')];}catch(_0x111b5d){_0x4a4c6a(_0x111b5d);}_0x25d028(_0x4625ce);});}function updateFaxInteraction(_0x22ff66,_0xae6de5,_0xc79919){return new BPromise(function(_0x2007bb,_0x523a2e){return getInteractionUsers(_0x22ff66,_0xc79919)[_0x44cc('0x2c')](function(_0x51926e){return getInteractionTags(_0x51926e,_0xae6de5);})[_0x44cc('0x2c')](function(_0x3c5496){return getStateInteraction(_0x3c5496);})['then'](function(_0x5452ac){_0x2007bb(_0x5452ac);})[_0x44cc('0x38')](function(_0xcb7c0c){_0x523a2e(_0xcb7c0c);});});}function getStateInteraction(_0x545298){return new BPromise(function(_0x4e1def){_0x545298[_0x44cc('0x39')]=0x0;_0x545298[_0x44cc('0x3a')]=0x0;_0x545298[_0x44cc('0x3b')]=0x0;_0x545298[_0x44cc('0x3c')]=0x0;_0x545298[_0x44cc('0x3d')]=0x0;if(!_0x545298['closed']&&!_0x545298['UserId']){_0x545298['waiting']+=0x1;}if(!_0x545298['closed']&&_0x545298[_0x44cc('0x3e')]){_0x545298[_0x44cc('0x3a')]+=0x1;if(_0x545298[_0x44cc('0x39')]){_0x545298[_0x44cc('0x39')]-=0x1;}}if(_0x545298[_0x44cc('0x3f')]&&_0x545298['UserId']){_0x545298['answered']+=0x1;if(_0x545298[_0x44cc('0x3a')]){_0x545298[_0x44cc('0x3a')]-=0x1;}}if(_0x545298[_0x44cc('0x3f')]&&!_0x545298['UserId']){_0x545298[_0x44cc('0x3c')]+=0x1;if(_0x545298[_0x44cc('0x39')]){_0x545298['waiting']-=0x1;}}_0x545298['total']+=0x1;_0x4e1def(_0x545298);});}exports[_0x44cc('0x40')]=function(_0x46d478,_0x539b28){var _0x43e5b0={},_0x5d82a7={},_0x53541d={'count':0x0,'rows':[]};var _0x42e990=_['map'](db[_0x44cc('0x41')][_0x44cc('0x42')],function(_0x3defd0){return{'name':_0x3defd0[_0x44cc('0x43')],'type':_0x3defd0[_0x44cc('0x44')]['key']};});_0x5d82a7['model']=_[_0x44cc('0x32')](_0x42e990,_0x44cc('0x2f'));_0x5d82a7[_0x44cc('0x45')]=_['keys'](_0x46d478['query']);_0x5d82a7[_0x44cc('0x46')]=_[_0x44cc('0x47')](_0x5d82a7[_0x44cc('0x48')],_0x5d82a7[_0x44cc('0x45')]);_0x43e5b0['attributes']=_[_0x44cc('0x47')](_0x5d82a7[_0x44cc('0x48')],qs[_0x44cc('0x49')](_0x46d478[_0x44cc('0x45')]['fields']));_0x43e5b0[_0x44cc('0x4a')]=_0x43e5b0['attributes'][_0x44cc('0x4b')]?_0x43e5b0[_0x44cc('0x4a')]:_0x5d82a7[_0x44cc('0x48')];if(!_0x46d478['query'][_0x44cc('0x4c')](_0x44cc('0x4d'))){_0x43e5b0[_0x44cc('0x24')]=qs[_0x44cc('0x24')](_0x46d478[_0x44cc('0x45')][_0x44cc('0x24')]);_0x43e5b0[_0x44cc('0x23')]=qs[_0x44cc('0x23')](_0x46d478[_0x44cc('0x45')]['offset']);}_0x43e5b0[_0x44cc('0x4e')]=qs['sort'](_0x46d478[_0x44cc('0x45')][_0x44cc('0x4f')]);_0x43e5b0[_0x44cc('0x50')]=qs['filters'](_[_0x44cc('0x51')](_0x46d478['query'],_0x5d82a7[_0x44cc('0x46')]),_0x42e990);var _0x1f2827=[];var _0xd4d8c8=squel['select']()[_0x44cc('0x52')]('id')[_0x44cc('0x52')](_0x44cc('0x2f'))[_0x44cc('0x52')](_0x44cc('0x53'))[_0x44cc('0x54')]('tools_tags');var _0x45ce87=squel['select']()[_0x44cc('0x52')]('u.id')[_0x44cc('0x52')](_0x44cc('0x55'))[_0x44cc('0x52')](_0x44cc('0x56'))['from'](_0x44cc('0x57'),'ui')['left_join']('users','u',_0x44cc('0x58'));var _0xd840b2=squel[_0x44cc('0x59')]()[_0x44cc('0x54')](_0x44cc('0x5a'),'i')[_0x44cc('0x5b')]('cm_contacts','c',_0x44cc('0x5c'))[_0x44cc('0x5b')](_0x44cc('0x5d'),'o',_0x44cc('0x5e'))[_0x44cc('0x5b')]('fax_accounts','a',_0x44cc('0x5f'))[_0x44cc('0x5b')](_0x44cc('0x60'),'me',_0x44cc('0x61'))[_0x44cc('0x5b')]('fax_interaction_has_tags','it',_0x44cc('0x62'))[_0x44cc('0x5b')]('tools_tags','t',_0x44cc('0x63'));var _0x511794=squel[_0x44cc('0x64')]();var _0x384b8b=[];var _0x3a85c9=squel[_0x44cc('0x64')]();var _0x484d98;if(_0x46d478[_0x44cc('0x45')]['search']){_0x484d98=as[_0x44cc('0x65')](_0x46d478[_0x44cc('0x45')][_0x44cc('0x66')]);var _0x5daafb=_0x484d98[_0x44cc('0x67')];for(var _0x334708=0x0;_0x334708<_0x484d98[_0x44cc('0x68')]['length'];_0x334708++){var _0x20bd6e=_0x484d98[_0x44cc('0x68')][_0x334708];var _0x44c273='i';var _0x8fecef=_[_0x44cc('0x69')](_0x42e990,[_0x44cc('0x2f'),_0x20bd6e['field']]);if(!_0x8fecef){switch(_0x20bd6e[_0x44cc('0x52')]){case'unreadMessages':if(_0x20bd6e[_0x44cc('0x6a')]==0x1){_0xd840b2[_0x44cc('0x6b')]('`'+_0x20bd6e[_0x44cc('0x52')]+_0x44cc('0x6c'));}else{_0xd840b2[_0x44cc('0x6b')]('`'+_0x20bd6e['field']+_0x44cc('0x6d'));}break;case _0x44cc('0x6e'):if(_0x20bd6e[_0x44cc('0x6f')]===_0x44cc('0x70')){if(_0x20bd6e['value'][_0x44cc('0x35')]('\x20')[_0x44cc('0x4b')]>0x1){_0x511794[_0x5daafb](_0x44cc('0x71'),qs[_0x44cc('0x72')](_0x20bd6e['value']),null);}else{var _0x15fd33='%'+_0x20bd6e['value']+'%';_0x511794[_0x5daafb]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x15fd33,_0x15fd33,_0x15fd33);}}else{_0x8fecef=_['find'](_0x42e990,[_0x44cc('0x2f'),_0x44cc('0x73')]);_0x20bd6e[_0x44cc('0x52')]='ContactId';_0x36d169=as[_0x44cc('0x74')](_0x44c273,_0x8fecef[_0x44cc('0x44')],_0x20bd6e);_0x511794[_0x5daafb](_0x36d169[_0x44cc('0x75')],_0x36d169[_0x44cc('0x6a')]['start'],_0x36d169[_0x44cc('0x6a')][_0x44cc('0x20')]);}break;case'Tag':var _0x56e1f1=_0x20bd6e[_0x44cc('0x6a')][_0x44cc('0x35')](',')[_0x44cc('0x32')](function(_0x5c770c){return Number(_0x5c770c);});_0x56e1f1[_0x44cc('0x36')](function(_0x45cafb){_0x3a85c9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x45cafb+',%');});_0x384b8b=_[_0x44cc('0x76')](_0x384b8b,_0x56e1f1);break;case _0x44cc('0x77'):if(_0x20bd6e['operator']===_0x44cc('0x70')){_0x511794[_0x5daafb](_0x44cc('0x78'),'%'+_0x20bd6e['value']+'%',null);}else{_0x8fecef=_[_0x44cc('0x69')](_0x42e990,[_0x44cc('0x2f'),_0x44cc('0x3e')]);_0x20bd6e[_0x44cc('0x52')]=_0x44cc('0x3e');_0x36d169=as[_0x44cc('0x74')](_0x44c273,_0x8fecef[_0x44cc('0x44')],_0x20bd6e);_0x511794[_0x5daafb](_0x36d169[_0x44cc('0x75')],_0x36d169['value'][_0x44cc('0x79')],_0x36d169[_0x44cc('0x6a')][_0x44cc('0x20')]);}break;case _0x44cc('0x7a'):_0x36d169=as[_0x44cc('0x74')]('me',null,_0x20bd6e);_0x511794[_0x5daafb](_0x36d169['text'],_0x36d169[_0x44cc('0x6a')]['start'],_0x36d169[_0x44cc('0x6a')][_0x44cc('0x20')]);break;}}else{var _0x36d169=as[_0x44cc('0x74')](_0x44c273,_0x8fecef['type'],_0x20bd6e);_0x511794[_0x5daafb](_0x36d169[_0x44cc('0x75')],_0x36d169[_0x44cc('0x6a')]['start'],_0x36d169[_0x44cc('0x6a')][_0x44cc('0x20')]);}}}else{var _0x2d2c14=_(_0x46d478['query'])[_0x44cc('0x7b')]()[_0x44cc('0x32')](function(_0x2f191e){return _[_0x44cc('0x7c')](_0x42e990,['name',_0x2f191e])?_0x2f191e:undefined;})[_0x44cc('0x7d')]()['value']();if(!_[_0x44cc('0x7e')](_0x2d2c14)){_0x2d2c14[_0x44cc('0x36')](function(_0x142590){if(_0x142590===_0x44cc('0x7f')){_0xd840b2[_0x44cc('0x50')](_0x44cc('0x80'),[][_0x44cc('0x81')](_0x46d478[_0x44cc('0x45')][_0x142590]));}else if(_0x142590==='createdAt'){var _0x16eabb=JSON['parse'](_0x46d478[_0x44cc('0x45')][_0x142590])[_0x44cc('0x82')];var _0xac032e=JSON[_0x44cc('0x83')](_0x46d478['query'][_0x142590])[_0x44cc('0x84')];_0xd840b2[_0x44cc('0x50')](_0x44cc('0x85'),_0x16eabb,_0xac032e);}else{if(_0x46d478[_0x44cc('0x45')][_0x142590]===_0x44cc('0x86')){_0xd840b2[_0x44cc('0x50')]('i.'+_0x142590+'\x20IS\x20NULL');}else{_0xd840b2[_0x44cc('0x50')]('i.'+_0x142590+_0x44cc('0x87'),_0x46d478['query'][_0x142590]);}}});}if(_0x46d478['query'][_0x44cc('0x88')]){if(_0x46d478[_0x44cc('0x45')][_0x44cc('0x88')]==0x1){_0xd840b2[_0x44cc('0x6b')](_0x44cc('0x89'));}else{_0xd840b2[_0x44cc('0x6b')](_0x44cc('0x8a'));}}if(_0x46d478['query'][_0x44cc('0x8b')]){_0x384b8b=_[_0x44cc('0x8c')](_0x46d478[_0x44cc('0x45')][_0x44cc('0x8b')])?_0x46d478['query']['tag']:new Array(_0x46d478[_0x44cc('0x45')][_0x44cc('0x8b')]);_0x384b8b[_0x44cc('0x36')](function(_0xa1ef){_0x3a85c9['or'](_0x44cc('0x8d'),'%,'+_0xa1ef+',%');});}if(_0x46d478[_0x44cc('0x45')][_0x44cc('0x8e')]){var _0x4ebff7=_0x46d478[_0x44cc('0x45')][_0x44cc('0x8e')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x44cc('0x8f')](_0x4ebff7)){_0x511794['or'](_0x44cc('0x90'),_0x4ebff7+'%')['or'](_0x44cc('0x91'),_0x4ebff7+'%');}_0x511794['or'](_0x44cc('0x92'),_0x4ebff7+'%');}}_0xd840b2['where'](_0x511794);_0xd840b2[_0x44cc('0x93')](_0x44cc('0x94'));var _0x4f1187={'type':db['Sequelize'][_0x44cc('0x95')]['SELECT'],'raw':!![]};var _0x2b94a4=_0xd840b2[_0x44cc('0x96')]();_0x2b94a4[_0x44cc('0x52')]('i.id');_0x2b94a4['field'](_0x44cc('0x97'),_0x44cc('0x98'));if(_0x43e5b0[_0x44cc('0x4e')]){_0x43e5b0['order'][_0x44cc('0x36')](function(_0x3522e0){var _0x445aeb=_0x3522e0[0x0]===_0x44cc('0x99')?_0x3522e0[0x0]:'i.'+_0x3522e0[0x0];_0xd840b2[_0x44cc('0x4e')](_0x445aeb,_0x3522e0[0x1]===_0x44cc('0x9a')?![]:!![]);});}if(!_[_0x44cc('0x7e')](_0x384b8b)){_0xd840b2[_0x44cc('0x6b')](_0x3a85c9);_0x2b94a4[_0x44cc('0x50')](_0x44cc('0x9b'),_0x384b8b);}BPromise[_0x44cc('0x9c')]()[_0x44cc('0x2c')](function(){if(!_0x484d98){if(_0x46d478[_0x44cc('0x45')]['FaxAccountId'])return;_0x2b94a4[_0x44cc('0x50')](_0x44cc('0x9d'));_0xd840b2[_0x44cc('0x50')](_0x44cc('0x9d'));return;}if(_0x46d478[_0x44cc('0x9e')][_0x44cc('0x9f')]!==_0x44cc('0xa0'))return;return _0x46d478['user'][_0x44cc('0xa1')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2521ba){if(_[_0x44cc('0x7e')](_0x2521ba)){_0x2b94a4[_0x44cc('0x50')](_0x44cc('0xa2'));_0xd840b2[_0x44cc('0x50')](_0x44cc('0xa2'));}else{_0x2b94a4[_0x44cc('0x50')]('i.FaxAccountId\x20IN\x20?',_[_0x44cc('0x32')](_0x2521ba,'id'));_0xd840b2['where'](_0x44cc('0x80'),_['map'](_0x2521ba,'id'));}});})[_0x44cc('0x2c')](function(){if(_0x46d478['user'][_0x44cc('0x9f')]===_0x44cc('0xa0')&&!_0x484d98&&!_0x46d478[_0x44cc('0x45')][_0x44cc('0x7f')])return[];return db[_0x44cc('0xa3')][_0x44cc('0x45')](_0x2b94a4[_0x44cc('0xa4')](),_0x4f1187);})['then'](function(_0x477584){_0x53541d[_0x44cc('0x26')]=_0x477584[_0x44cc('0x4b')];if(_0x53541d[_0x44cc('0x26')]===0x0)return[];return db[_0x44cc('0xa3')][_0x44cc('0x45')](_0xd4d8c8[_0x44cc('0xa4')](),_0x4f1187)[_0x44cc('0x2c')](function(_0x2619ea){_0x1f2827=_[_0x44cc('0xa5')](_0x2619ea,'id');_0x4f1187=_['merge'](_0x4f1187,{'model':db[_0x44cc('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46d478['query'][_0x44cc('0x49')]){_0x43e5b0[_0x44cc('0x4a')]['forEach'](function(_0x2b4e46){_0xd840b2[_0x44cc('0x52')]('i.'+_0x2b4e46);});}else{_0xd840b2[_0x44cc('0x52')](_0x44cc('0x97'),_0x44cc('0x98'));_0xd840b2['field'](_0x44cc('0xa6'),'Account.key');_0xd840b2[_0x44cc('0x52')]('a.mandatoryDisposition',_0x44cc('0xa7'));_0xd840b2[_0x44cc('0x52')](_0x44cc('0xa8'),_0x44cc('0x99'));_0xd840b2[_0x44cc('0x52')]('i.*');_0xd840b2[_0x44cc('0x52')](_0x44cc('0xa9'),_0x44cc('0xaa'));_0xd840b2[_0x44cc('0x52')]('c.lastName',_0x44cc('0xab'));_0xd840b2[_0x44cc('0x52')](_0x44cc('0xac'),_0x44cc('0xad'));_0xd840b2[_0x44cc('0x52')](_0x44cc('0xae'),'Contact.phone');_0xd840b2[_0x44cc('0x52')](_0x44cc('0xaf'),'Contact.mobile');_0xd840b2[_0x44cc('0x52')](_0x44cc('0xb0'),_0x44cc('0xb1'));_0xd840b2['field'](_0x44cc('0xb2'),_0x44cc('0xb3'));_0xd840b2['field'](_0x44cc('0xb4'),_0x44cc('0xb5'));_0xd840b2[_0x44cc('0x52')](_0x44cc('0xb6'),'TagIds');}if(_0x43e5b0[_0x44cc('0x24')])_0xd840b2[_0x44cc('0x24')](_0x43e5b0[_0x44cc('0x24')]);if(_0x43e5b0[_0x44cc('0x23')])_0xd840b2[_0x44cc('0x23')](_0x43e5b0[_0x44cc('0x23')]);return db['sequelize']['query'](_0xd840b2['toString'](),_0x4f1187);})[_0x44cc('0x2c')](function(_0x99f016){if(_0x99f016['length']>0x0)_0x45ce87[_0x44cc('0x50')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x99f016,'id'));return db[_0x44cc('0xa3')]['query'](_0x45ce87['toString'](),_0x4f1187)['then'](function(_0x3511af){var _0x378c1b=_[_0x44cc('0xb7')](_0x3511af,'FaxInteractionId');var _0x34b76b=[];_0x99f016[_0x44cc('0x36')](function(_0x3847c1){_0x34b76b[_0x44cc('0xb8')](updateFaxInteraction(_0x3847c1,_0x1f2827,_0x378c1b));});return BPromise[_0x44cc('0xb9')](_0x34b76b);});});})[_0x44cc('0x2c')](function(_0x10b7f0){_0x53541d[_0x44cc('0xba')]=_0x10b7f0;return _0x53541d;})[_0x44cc('0x2c')](respondWithFilteredResult(_0x539b28,_0x43e5b0))[_0x44cc('0x38')](handleError(_0x539b28,null));};exports[_0x44cc('0xbb')]=function(_0x1f8dbc,_0x3b3d91){var _0x965ae={'raw':![],'where':{'id':_0x1f8dbc[_0x44cc('0xbc')]['id']}},_0x48e64e={};_0x48e64e['model']=_['keys'](db[_0x44cc('0x41')][_0x44cc('0x42')]);_0x48e64e['query']=_[_0x44cc('0x7b')](_0x1f8dbc['query']);_0x48e64e[_0x44cc('0x46')]=_[_0x44cc('0x47')](_0x48e64e['model'],_0x48e64e[_0x44cc('0x45')]);_0x965ae['attributes']=_[_0x44cc('0x47')](_0x48e64e['model'],qs[_0x44cc('0x49')](_0x1f8dbc[_0x44cc('0x45')]['fields']));_0x965ae['attributes']=_0x965ae['attributes'][_0x44cc('0x4b')]?_0x965ae[_0x44cc('0x4a')]:_0x48e64e['model'];if(_0x1f8dbc[_0x44cc('0x45')]['includeAll']){_0x965ae[_0x44cc('0xbd')]=[{'all':!![]}];}_0x965ae=_[_0x44cc('0xbe')]({},_0x965ae,_0x1f8dbc[_0x44cc('0xbf')]);return db[_0x44cc('0x41')][_0x44cc('0x69')](_0x965ae)[_0x44cc('0x2c')](handleEntityNotFound(_0x3b3d91,null))[_0x44cc('0x2c')](respondWithResult(_0x3b3d91,null))['catch'](handleError(_0x3b3d91,null));};exports[_0x44cc('0xc0')]=function(_0x160c55,_0x1edea0){return db['FaxInteraction']['create'](_0x160c55[_0x44cc('0x7a')],{})[_0x44cc('0x2c')](respondWithResult(_0x1edea0,0xc9))[_0x44cc('0x38')](handleError(_0x1edea0,null));};exports[_0x44cc('0x2b')]=function(_0x18050f,_0x47f190){if(_0x18050f[_0x44cc('0x7a')]['id']){delete _0x18050f[_0x44cc('0x7a')]['id'];}return db[_0x44cc('0x41')]['find']({'where':{'id':_0x18050f[_0x44cc('0xbc')]['id']}})[_0x44cc('0x2c')](handleEntityNotFound(_0x47f190,null))[_0x44cc('0x2c')](saveUpdates(_0x18050f[_0x44cc('0x7a')],null))['then'](respondWithResult(_0x47f190,null))[_0x44cc('0x38')](handleError(_0x47f190,null));};exports[_0x44cc('0x2d')]=function(_0x4fa06f,_0x360248){return db[_0x44cc('0x41')][_0x44cc('0x69')]({'where':{'id':_0x4fa06f[_0x44cc('0xbc')]['id']}})[_0x44cc('0x2c')](handleEntityNotFound(_0x360248,null))[_0x44cc('0x2c')](removeEntity(_0x360248,null))[_0x44cc('0x38')](handleError(_0x360248,null));};exports['describe']=function(_0x181b8c,_0x529eca){return db[_0x44cc('0x41')][_0x44cc('0xc1')]()[_0x44cc('0x2c')](respondWithResult(_0x529eca,null))[_0x44cc('0x38')](handleError(_0x529eca,null));};exports[_0x44cc('0xc2')]=function(_0x5d3ddc,_0x581548,_0x24bad9){return db['FaxMessage'][_0x44cc('0x69')]({'where':{'id':_0x5d3ddc[_0x44cc('0xbc')]['id']}})[_0x44cc('0x2c')](handleEntityNotFound(_0x581548,null))['then'](function(_0x20e989){if(_0x20e989){return _0x20e989['addMessage'](_0x5d3ddc[_0x44cc('0x7a')][_0x44cc('0xc3')],_[_0x44cc('0xc4')](_0x5d3ddc[_0x44cc('0x7a')],[_0x44cc('0xc3'),'id'])||{});}})[_0x44cc('0x2c')](respondWithResult(_0x581548,null))[_0x44cc('0x38')](handleError(_0x581548,null));};exports[_0x44cc('0xc5')]=function(_0x10fb01,_0x3ad811,_0x2299a7){var _0x59d444={'raw':![],'where':{}};var _0x304d8a={};var _0x16bca4={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x10fb01['params']['id']}})[_0x44cc('0x2c')](handleEntityNotFound(_0x3ad811,null))[_0x44cc('0x2c')](function(_0x2b676b){if(_0x2b676b){_0x304d8a[_0x44cc('0x48')]=_[_0x44cc('0x7b')](db[_0x44cc('0xc6')]['rawAttributes']);_0x304d8a['query']=_[_0x44cc('0x7b')](_0x10fb01[_0x44cc('0x45')]);_0x304d8a[_0x44cc('0x46')]=_[_0x44cc('0x47')](_0x304d8a['model'],_0x304d8a[_0x44cc('0x45')]);_0x59d444[_0x44cc('0x4a')]=_[_0x44cc('0x47')](_0x304d8a[_0x44cc('0x48')],qs[_0x44cc('0x49')](_0x10fb01[_0x44cc('0x45')][_0x44cc('0x49')]));_0x59d444[_0x44cc('0x4a')]=_0x59d444[_0x44cc('0x4a')][_0x44cc('0x4b')]?_0x59d444[_0x44cc('0x4a')]:_0x304d8a[_0x44cc('0x48')];if(!_0x10fb01['query'][_0x44cc('0x4c')](_0x44cc('0x4d'))){_0x59d444[_0x44cc('0x24')]=qs[_0x44cc('0x24')](_0x10fb01['query'][_0x44cc('0x24')]);_0x59d444[_0x44cc('0x23')]=qs[_0x44cc('0x23')](_0x10fb01[_0x44cc('0x45')][_0x44cc('0x23')]);}_0x59d444['order']=qs[_0x44cc('0x4f')](_0x10fb01[_0x44cc('0x45')][_0x44cc('0x4f')]);_0x59d444[_0x44cc('0x50')]=qs[_0x44cc('0x46')](_['pick'](_0x10fb01[_0x44cc('0x45')],_0x304d8a[_0x44cc('0x46')]));_0x59d444[_0x44cc('0x50')][_0x44cc('0xc7')]=_0x2b676b['id'];if(_0x10fb01[_0x44cc('0x45')][_0x44cc('0x8e')]){_0x59d444[_0x44cc('0x50')]=_[_0x44cc('0xbe')](_0x59d444[_0x44cc('0x50')],{'$or':_[_0x44cc('0x32')](_0x59d444[_0x44cc('0x4a')],function(_0x587d69){var _0x5587b4={};_0x5587b4[_0x587d69]={'$like':'%'+_0x10fb01[_0x44cc('0x45')][_0x44cc('0x8e')]+'%'};return _0x5587b4;})});}if(_0x10fb01[_0x44cc('0x45')][_0x44cc('0x82')]){var _0xd5228f=_0x10fb01[_0x44cc('0x45')]['$gte'][_0x44cc('0x35')](',');var _0x1b588a={};_0x1b588a[_0xd5228f[0x0]]={'$gte':moment(_0xd5228f[0x1])[_0x44cc('0xc8')](_0x44cc('0xc9'))};_0x59d444['where']=_[_0x44cc('0xbe')](_0x59d444[_0x44cc('0x50')],_0x1b588a);}_0x59d444=_[_0x44cc('0xbe')]({},_0x59d444,_0x10fb01['options']);return db[_0x44cc('0xc6')][_0x44cc('0x26')]({'where':_0x59d444[_0x44cc('0x50')]})[_0x44cc('0x2c')](function(_0x46c6f5){_0x16bca4['count']=_0x46c6f5;if(_0x10fb01[_0x44cc('0x45')]['includeAll']){_0x59d444[_0x44cc('0xbd')]=[{'all':!![]}];}return db['FaxMessage'][_0x44cc('0xca')](_0x59d444);})[_0x44cc('0x2c')](function(_0x1f6dc5){_0x16bca4[_0x44cc('0xba')]=_0x1f6dc5;return _0x16bca4;});}})[_0x44cc('0x2c')](respondWithFilteredResult(_0x3ad811,_0x59d444))['catch'](handleError(_0x3ad811,null));};exports['addTags']=function(_0x48b1d2,_0x1286f0,_0x5f14c3){return db[_0x44cc('0x41')]['find']({'where':{'id':_0x48b1d2['params']['id']}})[_0x44cc('0x2c')](handleEntityNotFound(_0x1286f0,null))[_0x44cc('0x2c')](function(_0x2a3fe3){if(_0x2a3fe3){return _0x2a3fe3[_0x44cc('0xcb')](_0x48b1d2[_0x44cc('0x7a')][_0x44cc('0xc3')],_['omit'](_0x48b1d2['body'],['ids','id'])||{})[_0x44cc('0xcc')](function(){return db['Tag'][_0x44cc('0xca')]({'attributes':['id',_0x44cc('0x2f'),'color'],'where':{'id':_0x48b1d2[_0x44cc('0x7a')][_0x44cc('0xc3')]}});})[_0x44cc('0x2c')](function(_0x3c30f1){socket[_0x44cc('0xcd')](_0x44cc('0xce'),{'id':Number(_0x48b1d2['params']['id']),'tags':_0x3c30f1||[]});return{'id':Number(_0x48b1d2[_0x44cc('0xbc')]['id']),'tags':_0x3c30f1||[]};});}})['then'](respondWithResult(_0x1286f0,null))[_0x44cc('0x38')](handleError(_0x1286f0,null));};exports[_0x44cc('0xcf')]=function(_0x2f8b92,_0x2f2f72,_0x44c87c){return db[_0x44cc('0x41')][_0x44cc('0x69')]({'where':{'id':_0x2f8b92[_0x44cc('0xbc')]['id']}})[_0x44cc('0x2c')](handleEntityNotFound(_0x2f2f72,null))[_0x44cc('0x2c')](function(_0x26f208){if(_0x26f208){return _0x26f208[_0x44cc('0xcf')](_0x2f8b92[_0x44cc('0x45')]['ids']);}})[_0x44cc('0x2c')](respondWithStatusCode(_0x2f2f72,null))[_0x44cc('0x38')](handleError(_0x2f2f72,null));};exports[_0x44cc('0xd0')]=function(_0x59d58d,_0x361d7d){var _0xa3358e=moment()['unix']()[_0x44cc('0xa4')]();var _0x2ac80e=path['join'](config[_0x44cc('0xd1')],_0x44cc('0xd2'),'files',_0x44cc('0xd3'));var _0x352c66=path[_0x44cc('0xd4')](config[_0x44cc('0xd1')],'server','files',_0x44cc('0xd5'));var _0x5f53d8=path[_0x44cc('0xd4')](_0x2ac80e,_0xa3358e);var _0x51eb01=util['format'](_0x44cc('0xd6'),_0x59d58d['params']['id'],_0xa3358e);var _0x27a58a=path[_0x44cc('0xd4')](_0x2ac80e,_0x51eb01);var _0x14bf3f=[];_0x14bf3f[_0x44cc('0xb8')]({'model':db[_0x44cc('0xd7')],'as':_0x44cc('0xd7'),'raw':!![]});var _0x404aac=[{'model':db[_0x44cc('0xc6')],'as':_0x44cc('0xd8'),'attributes':['id',_0x44cc('0x7a'),_0x44cc('0xd9')],'include':_0x14bf3f}];return db[_0x44cc('0x41')][_0x44cc('0x69')]({'where':{'id':_0x59d58d['params']['id']},'include':_0x404aac})[_0x44cc('0x2c')](handleEntityNotFound(_0x361d7d,null))[_0x44cc('0x2c')](function(_0x5ebb65){if(_0x5ebb65&&_0x5ebb65[_0x44cc('0xd8')]){var _0x90df2d=_0x5ebb65[_0x44cc('0xda')]({'plain':!![]});fs[_0x44cc('0xdb')](_0x5f53d8);for(var _0x2da215=0x0;_0x2da215<_0x90df2d[_0x44cc('0xd8')][_0x44cc('0x4b')];_0x2da215++){var _0x18cf82=_0x90df2d[_0x44cc('0xd8')][_0x2da215][_0x44cc('0xd7')];if(_0x18cf82){var _0x37b7e6=path[_0x44cc('0xd4')](_0x352c66,_0x18cf82['basename']);if(fs[_0x44cc('0xdc')](_0x37b7e6)){fs[_0x44cc('0xdd')](_0x37b7e6)[_0x44cc('0xde')](fs[_0x44cc('0xdf')](path[_0x44cc('0xd4')](_0x5f53d8,_0x18cf82[_0x44cc('0xe0')])));}}}return BPromise[_0x44cc('0x9c')]()[_0x44cc('0x2c')](function(){return new BPromise(function(_0x2dc63f,_0x281a42){zipdir(_0x5f53d8,{'saveTo':_0x27a58a},function(_0x5e4a39,_0x31eb4a){if(_0x5e4a39)return _0x281a42(_0x5e4a39);return _0x2dc63f(_0x31eb4a);});})[_0x44cc('0x2c')](function(){return new BPromise(function(_0x401bfc,_0x25f9d8){rimraf(_0x5f53d8,function(_0xf7511e){if(_0xf7511e)_0x25f9d8(_0xf7511e);return _0x401bfc();});});})[_0x44cc('0x2c')](function(){return _0x361d7d[_0x44cc('0xd0')](_0x27a58a,_0x51eb01,function(_0x5d10a3){if(_0x5d10a3){console[_0x44cc('0xe1')](_0x44cc('0xe2'),_0x5d10a3);}else{fs[_0x44cc('0xe3')](_0x27a58a);}});});});}else{return _0x361d7d[_0x44cc('0x1f')](0xc8);}})['catch'](handleError(_0x361d7d,null));};
\ No newline at end of file
+var _0x18d2=['u.fullname','user_has_fax_interactions','users','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','length','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?','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','merge','a.key','Account.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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','all','rows','catch','show','params','intersection','includeAll','include','create','update','destroy','describe','addMessage','ids','getMessages','findOne','FaxMessage','hasOwnProperty','nolimit','FaxInteractionId','format','options','findAll','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','unlinkSync','fast-json-patch','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','map','fullname','split','forEach','TagIds','waiting','talking','answered','unmanaged','closed','UserId','total','index','FaxInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','offset','order','sort','where','pick','select','field','from','tools_tags'];(function(_0x49481d,_0xd95b74){var _0x27dd6e=function(_0xee3740){while(--_0xee3740){_0x49481d['push'](_0x49481d['shift']());}};_0x27dd6e(++_0xd95b74);}(_0x18d2,0x93));var _0x218d=function(_0x2b6783,_0x4679fe){_0x2b6783=_0x2b6783-0x0;var _0x3a68b6=_0x18d2[_0x2b6783];return _0x3a68b6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x218d('0x0'));var rp=require('request-promise');var moment=require(_0x218d('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x218d('0x2'));var util=require(_0x218d('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x218d('0x4'));var fs=require('fs');var fs_extra=require(_0x218d('0x5'));var _=require(_0x218d('0x6'));var squel=require(_0x218d('0x7'));var crypto=require(_0x218d('0x8'));var jsforce=require(_0x218d('0x9'));var deskjs=require(_0x218d('0xa'));var toCsv=require(_0x218d('0xb'));var querystring=require(_0x218d('0xc'));var Papa=require(_0x218d('0xd'));var Redis=require('ioredis');var authService=require(_0x218d('0xe'));var qs=require(_0x218d('0xf'));var as=require(_0x218d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x218d('0x11'));var config=require(_0x218d('0x12'));var licenseUtil=require(_0x218d('0x13'));var db=require(_0x218d('0x14'))['db'];config['redis']=_[_0x218d('0x15')](config[_0x218d('0x16')],{'host':_0x218d('0x17'),'port':0x18eb});var socket=require(_0x218d('0x18'))(new Redis(config['redis']));require(_0x218d('0x19'))[_0x218d('0x1a')](socket);function respondWithStatusCode(_0xb2fa31,_0x10aa57){_0x10aa57=_0x10aa57||0xcc;return function(_0x3bfe3c){if(_0x3bfe3c){return _0xb2fa31[_0x218d('0x1b')](_0x10aa57);}return _0xb2fa31[_0x218d('0x1c')](_0x10aa57)[_0x218d('0x1d')]();};}function respondWithResult(_0x308aff,_0x52b7fd){_0x52b7fd=_0x52b7fd||0xc8;return function(_0x2851c5){if(_0x2851c5){return _0x308aff[_0x218d('0x1c')](_0x52b7fd)[_0x218d('0x1e')](_0x2851c5);}};}function respondWithFilteredResult(_0x4fa12c,_0x1f2d11){return function(_0x42930e){if(_0x42930e){var _0x5790f9=typeof _0x1f2d11['offset']===_0x218d('0x1f')&&typeof _0x1f2d11[_0x218d('0x20')]===_0x218d('0x1f');var _0x494694=_0x42930e[_0x218d('0x21')];var _0xca43b4=_0x5790f9?0x0:_0x1f2d11['offset'];var _0x197af6=_0x5790f9?_0x42930e[_0x218d('0x21')]:_0x1f2d11['offset']+_0x1f2d11[_0x218d('0x20')];var _0x2e023b;if(_0x197af6>=_0x494694){_0x197af6=_0x494694;_0x2e023b=0xc8;}else{_0x2e023b=0xce;}_0x4fa12c[_0x218d('0x1c')](_0x2e023b);return _0x4fa12c[_0x218d('0x22')](_0x218d('0x23'),_0xca43b4+'-'+_0x197af6+'/'+_0x494694)['json'](_0x42930e);}return null;};}function patchUpdates(_0x5f4450){return function(_0x2d7d84){try{jsonpatch[_0x218d('0x24')](_0x2d7d84,_0x5f4450,!![]);}catch(_0x40d780){return BPromise[_0x218d('0x25')](_0x40d780);}return _0x2d7d84['save']();};}function saveUpdates(_0x39af44,_0x1c4f84){return function(_0x45c8f8){if(_0x45c8f8){return _0x45c8f8['update'](_0x39af44)['then'](function(_0x490dad){return _0x490dad;});}return null;};}function removeEntity(_0x428809,_0x35bf0a){return function(_0x795c2b){if(_0x795c2b){return _0x795c2b['destroy']()[_0x218d('0x26')](function(){_0x428809[_0x218d('0x1c')](0xcc)[_0x218d('0x1d')]();});}};}function handleEntityNotFound(_0x94b408,_0x340aa2){return function(_0x3c4ec9){if(!_0x3c4ec9){_0x94b408['sendStatus'](0x194);}return _0x3c4ec9;};}function handleError(_0x715b13,_0x187d32){_0x187d32=_0x187d32||0x1f4;return function(_0x3a7a54){logger[_0x218d('0x27')](_0x3a7a54[_0x218d('0x28')]);if(_0x3a7a54['name']){delete _0x3a7a54[_0x218d('0x29')];}_0x715b13['status'](_0x187d32)[_0x218d('0x2a')](_0x3a7a54);};}function getInteractionUsers(_0x45c2a3,_0x383f4f){return new BPromise(function(_0x4cc1ec,_0x5055a3){try{if(_0x383f4f[_0x45c2a3['id']]){_0x45c2a3['Users']=_[_0x218d('0x2b')](_0x383f4f[_0x45c2a3['id']],function(_0x1b992b){return{'id':_0x1b992b['id'],'fullname':_0x1b992b[_0x218d('0x2c')]};});}}catch(_0x94af02){_0x5055a3(_0x94af02);}_0x4cc1ec(_0x45c2a3);});}function getInteractionTags(_0xed9076,_0x334928){return new BPromise(function(_0x68606e,_0x3b9b4f){try{if(_0xed9076['TagIds']){_0xed9076['Tags']=[];_0xed9076['TagIds'][_0x218d('0x2d')](',')[_0x218d('0x2e')](function(_0x5409b3){_0xed9076['Tags']['push'](_0x334928[_0x5409b3]);});}delete _0xed9076[_0x218d('0x2f')];}catch(_0x1a71a8){_0x3b9b4f(_0x1a71a8);}_0x68606e(_0xed9076);});}function updateFaxInteraction(_0x5c3382,_0x31a56c,_0x20c7dc){return new BPromise(function(_0x18a6d5,_0x33f473){return getInteractionUsers(_0x5c3382,_0x20c7dc)[_0x218d('0x26')](function(_0x5c10b4){return getInteractionTags(_0x5c10b4,_0x31a56c);})['then'](function(_0x3abf3d){return getStateInteraction(_0x3abf3d);})[_0x218d('0x26')](function(_0x7cb298){_0x18a6d5(_0x7cb298);})['catch'](function(_0x5bf6a5){_0x33f473(_0x5bf6a5);});});}function getStateInteraction(_0x292fcd){return new BPromise(function(_0x4377b4){_0x292fcd[_0x218d('0x30')]=0x0;_0x292fcd[_0x218d('0x31')]=0x0;_0x292fcd[_0x218d('0x32')]=0x0;_0x292fcd[_0x218d('0x33')]=0x0;_0x292fcd['total']=0x0;if(!_0x292fcd[_0x218d('0x34')]&&!_0x292fcd[_0x218d('0x35')]){_0x292fcd['waiting']+=0x1;}if(!_0x292fcd[_0x218d('0x34')]&&_0x292fcd['UserId']){_0x292fcd['talking']+=0x1;if(_0x292fcd[_0x218d('0x30')]){_0x292fcd['waiting']-=0x1;}}if(_0x292fcd[_0x218d('0x34')]&&_0x292fcd['UserId']){_0x292fcd[_0x218d('0x32')]+=0x1;if(_0x292fcd[_0x218d('0x31')]){_0x292fcd['talking']-=0x1;}}if(_0x292fcd[_0x218d('0x34')]&&!_0x292fcd[_0x218d('0x35')]){_0x292fcd[_0x218d('0x33')]+=0x1;if(_0x292fcd[_0x218d('0x30')]){_0x292fcd[_0x218d('0x30')]-=0x1;}}_0x292fcd[_0x218d('0x36')]+=0x1;_0x4377b4(_0x292fcd);});}exports[_0x218d('0x37')]=function(_0x9f5d73,_0x16ff78){var _0x4f4f0a={},_0x54881e={},_0x5c8981={'count':0x0,'rows':[]};var _0x1000dc=_[_0x218d('0x2b')](db[_0x218d('0x38')][_0x218d('0x39')],function(_0x5dfa00){return{'name':_0x5dfa00[_0x218d('0x3a')],'type':_0x5dfa00[_0x218d('0x3b')][_0x218d('0x3c')]};});_0x54881e[_0x218d('0x3d')]=_[_0x218d('0x2b')](_0x1000dc,'name');_0x54881e['query']=_[_0x218d('0x3e')](_0x9f5d73[_0x218d('0x3f')]);_0x54881e[_0x218d('0x40')]=_['intersection'](_0x54881e['model'],_0x54881e[_0x218d('0x3f')]);_0x4f4f0a[_0x218d('0x41')]=_['intersection'](_0x54881e[_0x218d('0x3d')],qs[_0x218d('0x42')](_0x9f5d73[_0x218d('0x3f')][_0x218d('0x42')]));_0x4f4f0a[_0x218d('0x41')]=_0x4f4f0a[_0x218d('0x41')]['length']?_0x4f4f0a[_0x218d('0x41')]:_0x54881e[_0x218d('0x3d')];if(!_0x9f5d73[_0x218d('0x3f')]['hasOwnProperty']('nolimit')){_0x4f4f0a[_0x218d('0x20')]=qs[_0x218d('0x20')](_0x9f5d73[_0x218d('0x3f')][_0x218d('0x20')]);_0x4f4f0a[_0x218d('0x43')]=qs['offset'](_0x9f5d73[_0x218d('0x3f')][_0x218d('0x43')]);}_0x4f4f0a[_0x218d('0x44')]=qs[_0x218d('0x45')](_0x9f5d73[_0x218d('0x3f')][_0x218d('0x45')]);_0x4f4f0a[_0x218d('0x46')]=qs[_0x218d('0x40')](_[_0x218d('0x47')](_0x9f5d73[_0x218d('0x3f')],_0x54881e[_0x218d('0x40')]),_0x1000dc);var _0x12d894=[];var _0x1fe614=squel[_0x218d('0x48')]()['field']('id')[_0x218d('0x49')]('name')[_0x218d('0x49')]('color')[_0x218d('0x4a')](_0x218d('0x4b'));var _0x46e91b=squel[_0x218d('0x48')]()[_0x218d('0x49')]('u.id')[_0x218d('0x49')](_0x218d('0x4c'))[_0x218d('0x49')]('ui.FaxInteractionId')[_0x218d('0x4a')](_0x218d('0x4d'),'ui')['left_join'](_0x218d('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x3230c8=squel[_0x218d('0x48')]()[_0x218d('0x4a')](_0x218d('0x4f'),'i')[_0x218d('0x50')](_0x218d('0x51'),'c',_0x218d('0x52'))[_0x218d('0x50')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x218d('0x53'),'a',_0x218d('0x54'))[_0x218d('0x50')](_0x218d('0x55'),'me',_0x218d('0x56'))['left_join']('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x218d('0x50')]('tools_tags','t',_0x218d('0x57'));var _0x5b3ea9=squel[_0x218d('0x58')]();var _0x350921=[];var _0x405bad=squel[_0x218d('0x58')]();var _0x463c5d;if(_0x9f5d73[_0x218d('0x3f')][_0x218d('0x59')]){_0x463c5d=as[_0x218d('0x5a')](_0x9f5d73['query']['search']);var _0x5ead16=_0x463c5d['sqlOperator'];for(var _0x39f8d9=0x0;_0x39f8d9<_0x463c5d[_0x218d('0x5b')]['length'];_0x39f8d9++){var _0x4929d8=_0x463c5d[_0x218d('0x5b')][_0x39f8d9];var _0x581f94='i';var _0x4bf60e=_[_0x218d('0x5c')](_0x1000dc,['name',_0x4929d8[_0x218d('0x49')]]);if(!_0x4bf60e){switch(_0x4929d8[_0x218d('0x49')]){case'unreadMessages':if(_0x4929d8['value']==0x1){_0x3230c8[_0x218d('0x5d')]('`'+_0x4929d8['field']+_0x218d('0x5e'));}else{_0x3230c8[_0x218d('0x5d')]('`'+_0x4929d8[_0x218d('0x49')]+_0x218d('0x5f'));}break;case'Contact':if(_0x4929d8[_0x218d('0x60')]===_0x218d('0x61')){if(_0x4929d8[_0x218d('0x62')][_0x218d('0x2d')]('\x20')[_0x218d('0x63')]>0x1){_0x5b3ea9[_0x5ead16](_0x218d('0x64'),qs[_0x218d('0x65')](_0x4929d8[_0x218d('0x62')]),null);}else{var _0x56117b='%'+_0x4929d8[_0x218d('0x62')]+'%';_0x5b3ea9[_0x5ead16](_0x218d('0x66'),_0x56117b,_0x56117b,_0x56117b);}}else{_0x4bf60e=_[_0x218d('0x5c')](_0x1000dc,[_0x218d('0x29'),'ContactId']);_0x4929d8['field']='ContactId';_0x1a4d32=as[_0x218d('0x67')](_0x581f94,_0x4bf60e['type'],_0x4929d8);_0x5b3ea9[_0x5ead16](_0x1a4d32[_0x218d('0x68')],_0x1a4d32[_0x218d('0x62')]['start'],_0x1a4d32[_0x218d('0x62')][_0x218d('0x1d')]);}break;case _0x218d('0x69'):var _0x27978b=_0x4929d8[_0x218d('0x62')][_0x218d('0x2d')](',')[_0x218d('0x2b')](function(_0x557494){return Number(_0x557494);});_0x27978b[_0x218d('0x2e')](function(_0x85ba8e){_0x405bad['or'](_0x218d('0x6a'),'%,'+_0x85ba8e+',%');});_0x350921=_[_0x218d('0x6b')](_0x350921,_0x27978b);break;case _0x218d('0x6c'):if(_0x4929d8[_0x218d('0x60')]===_0x218d('0x61')){_0x5b3ea9[_0x5ead16](_0x218d('0x6d'),'%'+_0x4929d8['value']+'%',null);}else{_0x4bf60e=_['find'](_0x1000dc,[_0x218d('0x29'),_0x218d('0x35')]);_0x4929d8[_0x218d('0x49')]=_0x218d('0x35');_0x1a4d32=as['buildExpression'](_0x581f94,_0x4bf60e[_0x218d('0x3b')],_0x4929d8);_0x5b3ea9[_0x5ead16](_0x1a4d32['text'],_0x1a4d32[_0x218d('0x62')][_0x218d('0x6e')],_0x1a4d32[_0x218d('0x62')][_0x218d('0x1d')]);}break;case _0x218d('0x6f'):_0x1a4d32=as[_0x218d('0x67')]('me',null,_0x4929d8);_0x5b3ea9[_0x5ead16](_0x1a4d32[_0x218d('0x68')],_0x1a4d32['value']['start'],_0x1a4d32['value'][_0x218d('0x1d')]);break;}}else{var _0x1a4d32=as[_0x218d('0x67')](_0x581f94,_0x4bf60e[_0x218d('0x3b')],_0x4929d8);_0x5b3ea9[_0x5ead16](_0x1a4d32[_0x218d('0x68')],_0x1a4d32[_0x218d('0x62')][_0x218d('0x6e')],_0x1a4d32[_0x218d('0x62')]['end']);}}}else{var _0x20290b=_(_0x9f5d73[_0x218d('0x3f')])[_0x218d('0x3e')]()['map'](function(_0xfa02af){return _[_0x218d('0x70')](_0x1000dc,['name',_0xfa02af])?_0xfa02af:undefined;})[_0x218d('0x71')]()[_0x218d('0x62')]();if(!_[_0x218d('0x72')](_0x20290b)){_0x20290b['forEach'](function(_0x242c34){if(_0x242c34==='FaxAccountId'){_0x3230c8['where'](_0x218d('0x73'),[][_0x218d('0x74')](_0x9f5d73[_0x218d('0x3f')][_0x242c34]));}else if(_0x242c34===_0x218d('0x75')){var _0x48a59f=JSON[_0x218d('0x76')](_0x9f5d73[_0x218d('0x3f')][_0x242c34])[_0x218d('0x77')];var _0x3460ae=JSON['parse'](_0x9f5d73[_0x218d('0x3f')][_0x242c34])[_0x218d('0x78')];_0x3230c8['where'](_0x218d('0x79'),_0x48a59f,_0x3460ae);}else{if(_0x9f5d73[_0x218d('0x3f')][_0x242c34]===_0x218d('0x7a')){_0x3230c8[_0x218d('0x46')]('i.'+_0x242c34+_0x218d('0x7b'));}else{_0x3230c8['where']('i.'+_0x242c34+'\x20=\x20?',_0x9f5d73['query'][_0x242c34]);}}});}if(_0x9f5d73['query'][_0x218d('0x7c')]){if(_0x9f5d73[_0x218d('0x3f')][_0x218d('0x7c')]==0x1){_0x3230c8[_0x218d('0x5d')](_0x218d('0x7d'));}else{_0x3230c8[_0x218d('0x5d')](_0x218d('0x7e'));}}if(_0x9f5d73[_0x218d('0x3f')][_0x218d('0x7f')]){_0x350921=_['isArray'](_0x9f5d73['query'][_0x218d('0x7f')])?_0x9f5d73[_0x218d('0x3f')][_0x218d('0x7f')]:new Array(_0x9f5d73[_0x218d('0x3f')][_0x218d('0x7f')]);_0x350921[_0x218d('0x2e')](function(_0x4547e3){_0x405bad['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4547e3+',%');});}if(_0x9f5d73['query'][_0x218d('0x80')]){var _0x52ed32=_0x9f5d73['query']['filter'][_0x218d('0x81')]('\x5c','\x5c\x5c')[_0x218d('0x81')](/'/g,'\x27\x27');if(qs[_0x218d('0x82')](_0x52ed32)){_0x5b3ea9['or'](_0x218d('0x83'),_0x52ed32+'%')['or'](_0x218d('0x84'),_0x52ed32+'%');}_0x5b3ea9['or'](_0x218d('0x85'),_0x52ed32+'%');}}_0x3230c8[_0x218d('0x46')](_0x5b3ea9);_0x3230c8[_0x218d('0x86')](_0x218d('0x87'));var _0x6d99a7={'type':db[_0x218d('0x88')][_0x218d('0x89')][_0x218d('0x8a')],'raw':!![]};var _0x51175f=_0x3230c8[_0x218d('0x8b')]();_0x51175f[_0x218d('0x49')](_0x218d('0x87'));_0x51175f[_0x218d('0x49')](_0x218d('0x8c'),_0x218d('0x8d'));if(_0x4f4f0a[_0x218d('0x44')]){_0x4f4f0a['order']['forEach'](function(_0x5c27c0){var _0x4de9b6=_0x5c27c0[0x0]==='contactName'?_0x5c27c0[0x0]:'i.'+_0x5c27c0[0x0];_0x3230c8['order'](_0x4de9b6,_0x5c27c0[0x1]==='DESC'?![]:!![]);});}if(!_[_0x218d('0x72')](_0x350921)){_0x3230c8[_0x218d('0x5d')](_0x405bad);_0x51175f[_0x218d('0x46')](_0x218d('0x8e'),_0x350921);}BPromise[_0x218d('0x8f')]()['then'](function(){if(!_0x463c5d){if(_0x9f5d73['query'][_0x218d('0x90')])return;_0x51175f[_0x218d('0x46')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x3230c8['where'](_0x218d('0x91'));return;}if(_0x9f5d73['user']['role']!==_0x218d('0x92'))return;return _0x9f5d73['user'][_0x218d('0x93')]({'attributes':['id'],'raw':!![]})[_0x218d('0x26')](function(_0x365176){if(_[_0x218d('0x72')](_0x365176)){_0x51175f['where'](_0x218d('0x94'));_0x3230c8[_0x218d('0x46')](_0x218d('0x94'));}else{_0x51175f['where'](_0x218d('0x73'),_[_0x218d('0x2b')](_0x365176,'id'));_0x3230c8[_0x218d('0x46')](_0x218d('0x73'),_[_0x218d('0x2b')](_0x365176,'id'));}});})[_0x218d('0x26')](function(){if(_0x9f5d73[_0x218d('0x95')]['role']===_0x218d('0x92')&&!_0x463c5d&&!_0x9f5d73[_0x218d('0x3f')]['FaxAccountId'])return[];return db[_0x218d('0x96')]['query'](_0x51175f[_0x218d('0x97')](),_0x6d99a7);})[_0x218d('0x26')](function(_0x4f0de4){_0x5c8981[_0x218d('0x21')]=_0x4f0de4[_0x218d('0x63')];if(_0x5c8981['count']===0x0)return[];return db[_0x218d('0x96')][_0x218d('0x3f')](_0x1fe614[_0x218d('0x97')](),_0x6d99a7)[_0x218d('0x26')](function(_0x59bafe){_0x12d894=_[_0x218d('0x98')](_0x59bafe,'id');_0x6d99a7=_[_0x218d('0x99')](_0x6d99a7,{'model':db[_0x218d('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x9f5d73[_0x218d('0x3f')][_0x218d('0x42')]){_0x4f4f0a[_0x218d('0x41')]['forEach'](function(_0x389a2f){_0x3230c8[_0x218d('0x49')]('i.'+_0x389a2f);});}else{_0x3230c8['field'](_0x218d('0x8c'),_0x218d('0x8d'));_0x3230c8[_0x218d('0x49')](_0x218d('0x9a'),_0x218d('0x9b'));_0x3230c8[_0x218d('0x49')](_0x218d('0x9c'),_0x218d('0x9d'));_0x3230c8[_0x218d('0x49')](_0x218d('0x9e'),_0x218d('0x9f'));_0x3230c8[_0x218d('0x49')](_0x218d('0xa0'));_0x3230c8[_0x218d('0x49')](_0x218d('0xa1'),_0x218d('0xa2'));_0x3230c8[_0x218d('0x49')](_0x218d('0xa3'),_0x218d('0xa4'));_0x3230c8[_0x218d('0x49')]('c.email',_0x218d('0xa5'));_0x3230c8[_0x218d('0x49')](_0x218d('0xa6'),_0x218d('0xa7'));_0x3230c8[_0x218d('0x49')](_0x218d('0xa8'),_0x218d('0xa9'));_0x3230c8[_0x218d('0x49')](_0x218d('0xaa'),_0x218d('0xab'));_0x3230c8[_0x218d('0x49')]('o.fullname',_0x218d('0xac'));_0x3230c8['field'](_0x218d('0xad'),_0x218d('0xae'));_0x3230c8[_0x218d('0x49')](_0x218d('0xaf'),'TagIds');}if(_0x4f4f0a[_0x218d('0x20')])_0x3230c8['limit'](_0x4f4f0a['limit']);if(_0x4f4f0a['offset'])_0x3230c8[_0x218d('0x43')](_0x4f4f0a[_0x218d('0x43')]);return db[_0x218d('0x96')][_0x218d('0x3f')](_0x3230c8[_0x218d('0x97')](),_0x6d99a7);})['then'](function(_0x2cf8ca){if(_0x2cf8ca[_0x218d('0x63')]>0x0)_0x46e91b[_0x218d('0x46')](_0x218d('0xb0'),_[_0x218d('0x2b')](_0x2cf8ca,'id'));return db['sequelize'][_0x218d('0x3f')](_0x46e91b[_0x218d('0x97')](),_0x6d99a7)[_0x218d('0x26')](function(_0x4350d9){var _0x47384e=_['groupBy'](_0x4350d9,'FaxInteractionId');var _0x3605d6=[];_0x2cf8ca[_0x218d('0x2e')](function(_0x56b117){_0x3605d6['push'](updateFaxInteraction(_0x56b117,_0x12d894,_0x47384e));});return BPromise[_0x218d('0xb1')](_0x3605d6);});});})[_0x218d('0x26')](function(_0x6ba253){_0x5c8981[_0x218d('0xb2')]=_0x6ba253;return _0x5c8981;})[_0x218d('0x26')](respondWithFilteredResult(_0x16ff78,_0x4f4f0a))[_0x218d('0xb3')](handleError(_0x16ff78,null));};exports[_0x218d('0xb4')]=function(_0x560cab,_0x4f4543){var _0x80fe89={'raw':![],'where':{'id':_0x560cab[_0x218d('0xb5')]['id']}},_0xaf0847={};_0xaf0847[_0x218d('0x3d')]=_[_0x218d('0x3e')](db[_0x218d('0x38')][_0x218d('0x39')]);_0xaf0847[_0x218d('0x3f')]=_['keys'](_0x560cab[_0x218d('0x3f')]);_0xaf0847[_0x218d('0x40')]=_[_0x218d('0xb6')](_0xaf0847[_0x218d('0x3d')],_0xaf0847[_0x218d('0x3f')]);_0x80fe89[_0x218d('0x41')]=_[_0x218d('0xb6')](_0xaf0847['model'],qs[_0x218d('0x42')](_0x560cab[_0x218d('0x3f')][_0x218d('0x42')]));_0x80fe89[_0x218d('0x41')]=_0x80fe89[_0x218d('0x41')][_0x218d('0x63')]?_0x80fe89['attributes']:_0xaf0847[_0x218d('0x3d')];if(_0x560cab[_0x218d('0x3f')][_0x218d('0xb7')]){_0x80fe89[_0x218d('0xb8')]=[{'all':!![]}];}_0x80fe89=_[_0x218d('0x99')]({},_0x80fe89,_0x560cab['options']);return db[_0x218d('0x38')][_0x218d('0x5c')](_0x80fe89)[_0x218d('0x26')](handleEntityNotFound(_0x4f4543,null))[_0x218d('0x26')](respondWithResult(_0x4f4543,null))[_0x218d('0xb3')](handleError(_0x4f4543,null));};exports[_0x218d('0xb9')]=function(_0x2fde01,_0x101228){return db[_0x218d('0x38')][_0x218d('0xb9')](_0x2fde01['body'],{})[_0x218d('0x26')](respondWithResult(_0x101228,0xc9))['catch'](handleError(_0x101228,null));};exports[_0x218d('0xba')]=function(_0x5237fa,_0x2bbe01){if(_0x5237fa[_0x218d('0x6f')]['id']){delete _0x5237fa[_0x218d('0x6f')]['id'];}return db[_0x218d('0x38')][_0x218d('0x5c')]({'where':{'id':_0x5237fa[_0x218d('0xb5')]['id']}})[_0x218d('0x26')](handleEntityNotFound(_0x2bbe01,null))[_0x218d('0x26')](saveUpdates(_0x5237fa[_0x218d('0x6f')],null))[_0x218d('0x26')](respondWithResult(_0x2bbe01,null))[_0x218d('0xb3')](handleError(_0x2bbe01,null));};exports[_0x218d('0xbb')]=function(_0x588419,_0x1a2f2f){return db['FaxInteraction'][_0x218d('0x5c')]({'where':{'id':_0x588419[_0x218d('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1a2f2f,null))['then'](removeEntity(_0x1a2f2f,null))['catch'](handleError(_0x1a2f2f,null));};exports['describe']=function(_0x34f2f5,_0x20687a){return db[_0x218d('0x38')][_0x218d('0xbc')]()[_0x218d('0x26')](respondWithResult(_0x20687a,null))[_0x218d('0xb3')](handleError(_0x20687a,null));};exports[_0x218d('0xbd')]=function(_0x2c66b1,_0xf381c0,_0x2527b6){return db['FaxMessage'][_0x218d('0x5c')]({'where':{'id':_0x2c66b1[_0x218d('0xb5')]['id']}})[_0x218d('0x26')](handleEntityNotFound(_0xf381c0,null))[_0x218d('0x26')](function(_0x255c10){if(_0x255c10){return _0x255c10[_0x218d('0xbd')](_0x2c66b1[_0x218d('0x6f')][_0x218d('0xbe')],_['omit'](_0x2c66b1[_0x218d('0x6f')],[_0x218d('0xbe'),'id'])||{});}})[_0x218d('0x26')](respondWithResult(_0xf381c0,null))['catch'](handleError(_0xf381c0,null));};exports[_0x218d('0xbf')]=function(_0x34dbec,_0xa9e0ae,_0x5cea62){var _0x1b65d3={'raw':![],'where':{}};var _0x1ec968={};var _0x3a0b4d={'count':0x0,'rows':[]};return db[_0x218d('0x38')][_0x218d('0xc0')]({'where':{'id':_0x34dbec[_0x218d('0xb5')]['id']}})[_0x218d('0x26')](handleEntityNotFound(_0xa9e0ae,null))[_0x218d('0x26')](function(_0x418bef){if(_0x418bef){_0x1ec968['model']=_[_0x218d('0x3e')](db[_0x218d('0xc1')][_0x218d('0x39')]);_0x1ec968[_0x218d('0x3f')]=_[_0x218d('0x3e')](_0x34dbec[_0x218d('0x3f')]);_0x1ec968[_0x218d('0x40')]=_[_0x218d('0xb6')](_0x1ec968[_0x218d('0x3d')],_0x1ec968[_0x218d('0x3f')]);_0x1b65d3[_0x218d('0x41')]=_['intersection'](_0x1ec968[_0x218d('0x3d')],qs[_0x218d('0x42')](_0x34dbec[_0x218d('0x3f')][_0x218d('0x42')]));_0x1b65d3[_0x218d('0x41')]=_0x1b65d3[_0x218d('0x41')][_0x218d('0x63')]?_0x1b65d3[_0x218d('0x41')]:_0x1ec968[_0x218d('0x3d')];if(!_0x34dbec[_0x218d('0x3f')][_0x218d('0xc2')](_0x218d('0xc3'))){_0x1b65d3['limit']=qs[_0x218d('0x20')](_0x34dbec[_0x218d('0x3f')][_0x218d('0x20')]);_0x1b65d3[_0x218d('0x43')]=qs['offset'](_0x34dbec[_0x218d('0x3f')]['offset']);}_0x1b65d3[_0x218d('0x44')]=qs[_0x218d('0x45')](_0x34dbec[_0x218d('0x3f')]['sort']);_0x1b65d3['where']=qs[_0x218d('0x40')](_['pick'](_0x34dbec['query'],_0x1ec968['filters']));_0x1b65d3['where'][_0x218d('0xc4')]=_0x418bef['id'];if(_0x34dbec[_0x218d('0x3f')][_0x218d('0x80')]){_0x1b65d3[_0x218d('0x46')]=_[_0x218d('0x99')](_0x1b65d3[_0x218d('0x46')],{'$or':_['map'](_0x1b65d3[_0x218d('0x41')],function(_0x548774){var _0x43af65={};_0x43af65[_0x548774]={'$like':'%'+_0x34dbec[_0x218d('0x3f')]['filter']+'%'};return _0x43af65;})});}if(_0x34dbec[_0x218d('0x3f')]['$gte']){var _0x4f326b=_0x34dbec[_0x218d('0x3f')][_0x218d('0x77')][_0x218d('0x2d')](',');var _0x39f3bd={};_0x39f3bd[_0x4f326b[0x0]]={'$gte':moment(_0x4f326b[0x1])[_0x218d('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1b65d3[_0x218d('0x46')]=_[_0x218d('0x99')](_0x1b65d3[_0x218d('0x46')],_0x39f3bd);}_0x1b65d3=_[_0x218d('0x99')]({},_0x1b65d3,_0x34dbec[_0x218d('0xc6')]);return db['FaxMessage'][_0x218d('0x21')]({'where':_0x1b65d3[_0x218d('0x46')]})[_0x218d('0x26')](function(_0x22484c){_0x3a0b4d[_0x218d('0x21')]=_0x22484c;if(_0x34dbec[_0x218d('0x3f')]['includeAll']){_0x1b65d3[_0x218d('0xb8')]=[{'all':!![]}];}return db[_0x218d('0xc1')][_0x218d('0xc7')](_0x1b65d3);})['then'](function(_0x545154){_0x3a0b4d['rows']=_0x545154;return _0x3a0b4d;});}})['then'](respondWithFilteredResult(_0xa9e0ae,_0x1b65d3))[_0x218d('0xb3')](handleError(_0xa9e0ae,null));};exports['addTags']=function(_0x54c9c0,_0x5cec28,_0x36490c){return db[_0x218d('0x38')]['find']({'where':{'id':_0x54c9c0[_0x218d('0xb5')]['id']}})['then'](handleEntityNotFound(_0x5cec28,null))[_0x218d('0x26')](function(_0x60b09){if(_0x60b09){return _0x60b09['setTags'](_0x54c9c0['body'][_0x218d('0xbe')],_['omit'](_0x54c9c0['body'],[_0x218d('0xbe'),'id'])||{})[_0x218d('0xc8')](function(){return db['Tag'][_0x218d('0xc7')]({'attributes':['id',_0x218d('0x29'),'color'],'where':{'id':_0x54c9c0[_0x218d('0x6f')][_0x218d('0xbe')]}});})[_0x218d('0x26')](function(_0x37dbcd){socket[_0x218d('0xc9')](_0x218d('0xca'),{'id':Number(_0x54c9c0[_0x218d('0xb5')]['id']),'tags':_0x37dbcd||[]});return{'id':Number(_0x54c9c0[_0x218d('0xb5')]['id']),'tags':_0x37dbcd||[]};});}})[_0x218d('0x26')](respondWithResult(_0x5cec28,null))[_0x218d('0xb3')](handleError(_0x5cec28,null));};exports[_0x218d('0xcb')]=function(_0x3b6aab,_0x590232,_0x2a98ee){return db[_0x218d('0x38')][_0x218d('0x5c')]({'where':{'id':_0x3b6aab[_0x218d('0xb5')]['id']}})[_0x218d('0x26')](handleEntityNotFound(_0x590232,null))[_0x218d('0x26')](function(_0x1ecfb9){if(_0x1ecfb9){return _0x1ecfb9['removeTags'](_0x3b6aab[_0x218d('0x3f')][_0x218d('0xbe')]);}})[_0x218d('0x26')](respondWithStatusCode(_0x590232,null))[_0x218d('0xb3')](handleError(_0x590232,null));};exports[_0x218d('0xcc')]=function(_0x3cf3bc,_0x7a6d47){var _0xf18d28=moment()[_0x218d('0xcd')]()[_0x218d('0x97')]();var _0x499a9a=path[_0x218d('0xce')](config[_0x218d('0xcf')],_0x218d('0xd0'),_0x218d('0xd1'),_0x218d('0xd2'));var _0x4e2ace=path[_0x218d('0xce')](config[_0x218d('0xcf')],_0x218d('0xd0'),'files',_0x218d('0xd3'));var _0x1c95a2=path['join'](_0x499a9a,_0xf18d28);var _0x32234f=util[_0x218d('0xc5')](_0x218d('0xd4'),_0x3cf3bc[_0x218d('0xb5')]['id'],_0xf18d28);var _0x37bd65=path['join'](_0x499a9a,_0x32234f);var _0x3cd954=[];_0x3cd954[_0x218d('0xd5')]({'model':db[_0x218d('0xd6')],'as':'Attachment','raw':!![]});var _0x22582a=[{'model':db[_0x218d('0xc1')],'as':_0x218d('0xd7'),'attributes':['id','body',_0x218d('0x75')],'include':_0x3cd954}];return db[_0x218d('0x38')]['find']({'where':{'id':_0x3cf3bc[_0x218d('0xb5')]['id']},'include':_0x22582a})[_0x218d('0x26')](handleEntityNotFound(_0x7a6d47,null))[_0x218d('0x26')](function(_0x125fd5){if(_0x125fd5&&_0x125fd5[_0x218d('0xd7')]){var _0x22e21d=_0x125fd5['get']({'plain':!![]});fs[_0x218d('0xd8')](_0x1c95a2);for(var _0x1f2db9=0x0;_0x1f2db9<_0x22e21d[_0x218d('0xd7')][_0x218d('0x63')];_0x1f2db9++){var _0x4620eb=_0x22e21d[_0x218d('0xd7')][_0x1f2db9][_0x218d('0xd6')];if(_0x4620eb){var _0x20d566=path[_0x218d('0xce')](_0x4e2ace,_0x4620eb[_0x218d('0xd9')]);if(fs['existsSync'](_0x20d566)){fs[_0x218d('0xda')](_0x20d566)[_0x218d('0xdb')](fs[_0x218d('0xdc')](path['join'](_0x1c95a2,_0x4620eb['basename'])));}}}return BPromise[_0x218d('0x8f')]()[_0x218d('0x26')](function(){return new BPromise(function(_0x4da762,_0x438900){zipdir(_0x1c95a2,{'saveTo':_0x37bd65},function(_0xd343b9,_0x525ec3){if(_0xd343b9)return _0x438900(_0xd343b9);return _0x4da762(_0x525ec3);});})[_0x218d('0x26')](function(){return new BPromise(function(_0x3bbd46,_0x3bc4a3){rimraf(_0x1c95a2,function(_0xf764d0){if(_0xf764d0)_0x3bc4a3(_0xf764d0);return _0x3bbd46();});});})[_0x218d('0x26')](function(){return _0x7a6d47[_0x218d('0xcc')](_0x37bd65,_0x32234f,function(_0x4a65ad){if(_0x4a65ad){console[_0x218d('0xdd')]('err',_0x4a65ad);}else{fs[_0x218d('0xde')](_0x37bd65);}});});});}else{return _0x7a6d47[_0x218d('0x1b')](0xc8);}})[_0x218d('0xb3')](handleError(_0x7a6d47,null));};
\ No newline at end of file
index 40735ea..3eacbcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x033f=['setMaxListeners','save','update','Users','map','findAll','then','setDataValue','length','emit','catch','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage'];(function(_0x262989,_0xf5fdf3){var _0x353a60=function(_0x1c4669){while(--_0x1c4669){_0x262989['push'](_0x262989['shift']());}};_0x353a60(++_0xf5fdf3);}(_0x033f,0x73));var _0xf033=function(_0x54a946,_0x30a84e){_0x54a946=_0x54a946-0x0;var _0x4484af=_0x033f[_0x54a946];return _0x4484af;};'use strict';var EventEmitter=require(_0xf033('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xf033('0x1')];var FaxMessage=require(_0xf033('0x2'))['db'][_0xf033('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf033('0x4')](0x0);var events={'afterCreate':_0xf033('0x5'),'afterUpdate':_0xf033('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2933f2){return function(_0x57e7aa,_0xf137ad,_0x49a7dc){_0x57e7aa['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3103a6){_0x57e7aa['setDataValue'](_0xf033('0x7'),_0x3103a6[_0xf033('0x8')](function(_0x3fa009){return{'id':_0x3fa009['id']};}));return FaxMessage[_0xf033('0x9')]({'where':{'FaxInteractionId':_0x57e7aa['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf033('0xa')](function(_0x4eec40){_0x57e7aa[_0xf033('0xb')]('unreadMessages',_0x4eec40[_0xf033('0xc')]);FaxInteractionEvents[_0xf033('0xd')](_0x2933f2+':'+_0x57e7aa['id'],_0x57e7aa);FaxInteractionEvents['emit'](_0x2933f2,_0x57e7aa);_0x49a7dc(null);})[_0xf033('0xe')](_0x49a7dc(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xf033('0xf')](e,emitEvent(event));}}module[_0xf033('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0xcd58=['../../mysqldb','FaxMessage','save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xcd58,0x1ec));var _0x8cd5=function(_0xf4129c,_0x44fcf1){_0xf4129c=_0xf4129c-0x0;var _0x426611=_0xcd58[_0xf4129c];return _0x426611;};'use strict';var EventEmitter=require(_0x8cd5('0x0'));var FaxInteraction=require(_0x8cd5('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0x8cd5('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8cd5('0x3'),'afterUpdate':_0x8cd5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x361f5a){return function(_0x4da308,_0xa0776,_0x1b96e8){_0x4da308[_0x8cd5('0x5')]({'attributes':['id'],'raw':!![]})[_0x8cd5('0x6')](function(_0x3feba6){_0x4da308[_0x8cd5('0x7')](_0x8cd5('0x8'),_0x3feba6['map'](function(_0x37caa0){return{'id':_0x37caa0['id']};}));return FaxMessage[_0x8cd5('0x9')]({'where':{'FaxInteractionId':_0x4da308['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8cd5('0x6')](function(_0x43dcb2){_0x4da308['setDataValue'](_0x8cd5('0xa'),_0x43dcb2[_0x8cd5('0xb')]);FaxInteractionEvents[_0x8cd5('0xc')](_0x361f5a+':'+_0x4da308['id'],_0x4da308);FaxInteractionEvents['emit'](_0x361f5a,_0x4da308);_0x1b96e8(null);})[_0x8cd5('0xd')](_0x1b96e8(null));};}for(var e in events){if(events[_0x8cd5('0xe')](e)){var event=events[e];FaxInteraction[_0x8cd5('0xf')](e,emitEvent(event));}}module[_0x8cd5('0x10')]=FaxInteractionEvents;
\ No newline at end of file
index 9c5f7b2..719eb2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff06=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x5d7254,_0x3c638c){var _0xc1ada1=function(_0x27e4b7){while(--_0x27e4b7){_0x5d7254['push'](_0x5d7254['shift']());}};_0xc1ada1(++_0x3c638c);}(_0xff06,0x1ae));var _0x6ff0=function(_0x514038,_0x450ef3){_0x514038=_0x514038-0x0;var _0x589720=_0xff06[_0x514038];return _0x589720;};'use strict';var _=require(_0x6ff0('0x0'));var util=require(_0x6ff0('0x1'));var logger=require(_0x6ff0('0x2'))(_0x6ff0('0x3'));var moment=require(_0x6ff0('0x4'));var BPromise=require(_0x6ff0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ff0('0x6'));var rimraf=require(_0x6ff0('0x7'));var config=require(_0x6ff0('0x8'));var attributes=require(_0x6ff0('0x9'));module[_0x6ff0('0xa')]=function(_0x422a8d,_0x21ac90){return _0x422a8d[_0x6ff0('0xb')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3db9bc,_0x560398,_0xbf3b47){if(_0x3db9bc['changed'](_0x6ff0('0xc'))){_0x3db9bc[_0x6ff0('0xd')]=moment()[_0x6ff0('0xe')](_0x6ff0('0xf'));}_0xbf3b47(null,_0x3db9bc);}}});};
\ No newline at end of file
+var _0x77cb=['../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x89af8e,_0x5d53bb){var _0x569d36=function(_0x468466){while(--_0x468466){_0x89af8e['push'](_0x89af8e['shift']());}};_0x569d36(++_0x5d53bb);}(_0x77cb,0x1b2));var _0xb77c=function(_0x1c89e1,_0x4e4f6e){_0x1c89e1=_0x1c89e1-0x0;var _0x4df70d=_0x77cb[_0x1c89e1];return _0x4df70d;};'use strict';var _=require(_0xb77c('0x0'));var util=require(_0xb77c('0x1'));var logger=require(_0xb77c('0x2'))(_0xb77c('0x3'));var moment=require(_0xb77c('0x4'));var BPromise=require(_0xb77c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb77c('0x6'));var rimraf=require(_0xb77c('0x7'));var config=require(_0xb77c('0x8'));var attributes=require(_0xb77c('0x9'));module[_0xb77c('0xa')]=function(_0x3708df,_0x60b4b8){return _0x3708df[_0xb77c('0xb')](_0xb77c('0xc'),attributes,{'tableName':_0xb77c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c60c2,_0xd77fdd,_0x1af0f6){if(_0x2c60c2['changed']('closed')){_0x2c60c2[_0xb77c('0xe')]=moment()[_0xb77c('0xf')](_0xb77c('0x10'));}_0x1af0f6(null,_0x2c60c2);}}});};
\ No newline at end of file
index 26ce990..9461bc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ed=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','catch','find','omit','spread','AddTags','util','moment','randomstring','ioredis'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xa9ed,0x77));var _0xda9e=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0xa9ed[_0x12a554];return _0x244ba0;};'use strict';var _=require('lodash');var util=require(_0xda9e('0x0'));var moment=require(_0xda9e('0x1'));var BPromise=require('bluebird');var rs=require(_0xda9e('0x2'));var fs=require('fs');var Redis=require(_0xda9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda9e('0x4'));var logger=require(_0xda9e('0x5'))(_0xda9e('0x6'));var config=require(_0xda9e('0x7'));var jayson=require(_0xda9e('0x8'));var client=jayson['client'][_0xda9e('0x9')]({'port':0x232a});config[_0xda9e('0xa')]=_[_0xda9e('0xb')](config[_0xda9e('0xa')],{'host':_0xda9e('0xc'),'port':0x18eb});var socket=require(_0xda9e('0xd'))(new Redis(config[_0xda9e('0xa')]));require(_0xda9e('0xe'))[_0xda9e('0xf')](socket);function respondWithRpcPromise(_0x3288e4,_0x122be7,_0x1fd9e6){return new BPromise(function(_0x281619,_0x46a71f){return client[_0xda9e('0x10')](_0x3288e4,_0x1fd9e6)[_0xda9e('0x11')](function(_0x14dbac){logger[_0xda9e('0x12')](_0xda9e('0x13'),_0x122be7,'request\x20sent');logger[_0xda9e('0x14')](_0xda9e('0x15'),_0x122be7,'request\x20sent',JSON[_0xda9e('0x16')](_0x14dbac));if(_0x14dbac['error']){if(_0x14dbac[_0xda9e('0x17')][_0xda9e('0x18')]===0x1f4){logger['error'](_0xda9e('0x13'),_0x122be7,_0x14dbac[_0xda9e('0x17')][_0xda9e('0x19')]);return _0x46a71f(_0x14dbac[_0xda9e('0x17')][_0xda9e('0x19')]);}logger[_0xda9e('0x17')](_0xda9e('0x13'),_0x122be7,_0x14dbac['error']['message']);return _0x281619(_0x14dbac['error'][_0xda9e('0x19')]);}else{logger[_0xda9e('0x12')](_0xda9e('0x13'),_0x122be7,_0xda9e('0x1a'));_0x281619(_0x14dbac[_0xda9e('0x1b')][_0xda9e('0x19')]);}})['catch'](function(_0x59f11f){logger[_0xda9e('0x17')](_0xda9e('0x13'),_0x122be7,_0x59f11f);_0x46a71f(_0x59f11f);});});}exports[_0xda9e('0x1c')]=function(_0x1be891){var _0x4b21fa=this;return new Promise(function(_0x46ddc5,_0x61c826){return db[_0xda9e('0x1d')][_0xda9e('0x1e')](_0x1be891[_0xda9e('0x1f')],{'raw':_0x1be891[_0xda9e('0x20')]?_0x1be891['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1be891[_0xda9e('0x20')]?_0x1be891[_0xda9e('0x20')][_0xda9e('0x21')]||null:null,'attributes':_0x1be891[_0xda9e('0x20')]?_0x1be891[_0xda9e('0x20')][_0xda9e('0x22')]||null:null,'limit':_0x1be891[_0xda9e('0x20')]?_0x1be891[_0xda9e('0x20')][_0xda9e('0x23')]||null:null})[_0xda9e('0x11')](function(_0x589e81){logger[_0xda9e('0x12')]('UpdateFaxInteraction',_0x1be891);logger[_0xda9e('0x14')](_0xda9e('0x1c'),_0x1be891,JSON[_0xda9e('0x16')](_0x589e81));_0x46ddc5(_0x589e81);})[_0xda9e('0x24')](function(_0x49679d){logger['error'](_0xda9e('0x1c'),_0x49679d[_0xda9e('0x19')],_0x1be891);_0x61c826(_0x4b21fa[_0xda9e('0x17')](0x1f4,_0x49679d[_0xda9e('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x394a02){return new Promise(function(_0x29323f,_0x2612d3){return db[_0xda9e('0x1d')][_0xda9e('0x25')]({'where':_0x394a02[_0xda9e('0x20')]?_0x394a02[_0xda9e('0x20')][_0xda9e('0x21')]||null:null})['then'](function(_0x131000){if(_0x131000){return _0x131000['addTags'](_0x394a02[_0xda9e('0x1f')]['ids'],_[_0xda9e('0x26')](_0x394a02['body'],['ids','id'])||{});}})[_0xda9e('0x27')](function(_0x2352bf){logger[_0xda9e('0x12')](_0xda9e('0x28'),_0x394a02);logger['debug'](_0xda9e('0x28'),_0x394a02,JSON[_0xda9e('0x16')](_0x2352bf));_0x29323f(_0x2352bf);})['catch'](function(_0x201ce9){logger[_0xda9e('0x17')](_0xda9e('0x28'),_0x201ce9[_0xda9e('0x19')],_0x394a02);_0x2612d3(_this[_0xda9e('0x17')](0x1f4,_0x201ce9[_0xda9e('0x19')]));});});};
\ No newline at end of file
+var _0xf42b=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','limit','then','debug','AddTagsToFaxInteraction','body','ids','omit','spread','AddTags','lodash','util','bluebird'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xf42b,0x135));var _0xbf42=function(_0x48b369,_0x5034b3){_0x48b369=_0x48b369-0x0;var _0x4188d4=_0xf42b[_0x48b369];return _0x4188d4;};'use strict';var _=require(_0xbf42('0x0'));var util=require(_0xbf42('0x1'));var moment=require('moment');var BPromise=require(_0xbf42('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf42('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf42('0x4'));var logger=require(_0xbf42('0x5'))(_0xbf42('0x6'));var config=require('../../config/environment');var jayson=require(_0xbf42('0x7'));var client=jayson[_0xbf42('0x8')]['http']({'port':0x232a});config[_0xbf42('0x9')]=_[_0xbf42('0xa')](config[_0xbf42('0x9')],{'host':_0xbf42('0xb'),'port':0x18eb});var socket=require(_0xbf42('0xc'))(new Redis(config[_0xbf42('0x9')]));require(_0xbf42('0xd'))['register'](socket);function respondWithRpcPromise(_0x565bb2,_0x5cb9ce,_0x34a23e){return new BPromise(function(_0x199550,_0x585ac1){return client[_0xbf42('0xe')](_0x565bb2,_0x34a23e)['then'](function(_0x415608){logger[_0xbf42('0xf')](_0xbf42('0x10'),_0x5cb9ce,_0xbf42('0x11'));logger['debug'](_0xbf42('0x12'),_0x5cb9ce,_0xbf42('0x11'),JSON[_0xbf42('0x13')](_0x415608));if(_0x415608[_0xbf42('0x14')]){if(_0x415608[_0xbf42('0x14')]['code']===0x1f4){logger[_0xbf42('0x14')](_0xbf42('0x10'),_0x5cb9ce,_0x415608['error'][_0xbf42('0x15')]);return _0x585ac1(_0x415608[_0xbf42('0x14')]['message']);}logger[_0xbf42('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x5cb9ce,_0x415608['error'][_0xbf42('0x15')]);return _0x199550(_0x415608[_0xbf42('0x14')]['message']);}else{logger[_0xbf42('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x5cb9ce,_0xbf42('0x11'));_0x199550(_0x415608[_0xbf42('0x16')][_0xbf42('0x15')]);}})[_0xbf42('0x17')](function(_0x9f1fdd){logger[_0xbf42('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x5cb9ce,_0x9f1fdd);_0x585ac1(_0x9f1fdd);});});}exports[_0xbf42('0x18')]=function(_0x485d2b){var _0x56aee9=this;return new Promise(function(_0x23629c,_0x2e05c7){return db[_0xbf42('0x19')][_0xbf42('0x1a')](_0x485d2b['body'],{'raw':_0x485d2b[_0xbf42('0x1b')]?_0x485d2b[_0xbf42('0x1b')][_0xbf42('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x485d2b[_0xbf42('0x1b')]?_0x485d2b['options'][_0xbf42('0x1d')]||null:null,'attributes':_0x485d2b[_0xbf42('0x1b')]?_0x485d2b['options']['attributes']||null:null,'limit':_0x485d2b[_0xbf42('0x1b')]?_0x485d2b[_0xbf42('0x1b')][_0xbf42('0x1e')]||null:null})[_0xbf42('0x1f')](function(_0x14683a){logger[_0xbf42('0xf')](_0xbf42('0x18'),_0x485d2b);logger[_0xbf42('0x20')](_0xbf42('0x18'),_0x485d2b,JSON[_0xbf42('0x13')](_0x14683a));_0x23629c(_0x14683a);})[_0xbf42('0x17')](function(_0x28206e){logger[_0xbf42('0x14')]('UpdateFaxInteraction',_0x28206e[_0xbf42('0x15')],_0x485d2b);_0x2e05c7(_0x56aee9[_0xbf42('0x14')](0x1f4,_0x28206e[_0xbf42('0x15')]));});});};exports[_0xbf42('0x21')]=function(_0x16ee89){return new Promise(function(_0x5e4d5a,_0x4e4889){return db[_0xbf42('0x19')]['find']({'where':_0x16ee89['options']?_0x16ee89['options'][_0xbf42('0x1d')]||null:null})['then'](function(_0x5ec98e){if(_0x5ec98e){return _0x5ec98e['addTags'](_0x16ee89[_0xbf42('0x22')][_0xbf42('0x23')],_[_0xbf42('0x24')](_0x16ee89[_0xbf42('0x22')],['ids','id'])||{});}})[_0xbf42('0x25')](function(_0x521f54){logger[_0xbf42('0xf')](_0xbf42('0x26'),_0x16ee89);logger[_0xbf42('0x20')](_0xbf42('0x26'),_0x16ee89,JSON['stringify'](_0x521f54));_0x5e4d5a(_0x521f54);})[_0xbf42('0x17')](function(_0x3c3841){logger[_0xbf42('0x14')]('AddTags',_0x3c3841[_0xbf42('0x15')],_0x16ee89);_0x4e4889(_this[_0xbf42('0x14')](0x1f4,_0x3c3841[_0xbf42('0x15')]));});});};
\ No newline at end of file
index 2e33063..7a94bb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb94e=['save','remove','update','emit','removeListener','./faxInteraction.events'];(function(_0x499933,_0x5659e9){var _0x2bd282=function(_0x4f139b){while(--_0x4f139b){_0x499933['push'](_0x499933['shift']());}};_0x2bd282(++_0x5659e9);}(_0xb94e,0x119));var _0xeb94=function(_0x51d093,_0x9b4e0b){_0x51d093=_0x51d093-0x0;var _0x3467d6=_0xb94e[_0x51d093];return _0x3467d6;};'use strict';var FaxInteractionEvents=require(_0xeb94('0x0'));var events=[_0xeb94('0x1'),_0xeb94('0x2'),_0xeb94('0x3')];function createListener(_0x45b7ae,_0x71f3b0){return function(_0x4dc84e){_0x71f3b0[_0xeb94('0x4')](_0x45b7ae,_0x4dc84e);};}function removeListener(_0x348a8e,_0x43d21f){return function(){FaxInteractionEvents[_0xeb94('0x5')](_0x348a8e,_0x43d21f);};}exports['register']=function(_0x12b447){for(var _0x3b8e6f=0x0,_0x57421f=events['length'];_0x3b8e6f<_0x57421f;_0x3b8e6f++){var _0x3e7367=events[_0x3b8e6f];var _0x27ef97=createListener('faxInteraction:'+_0x3e7367,_0x12b447);FaxInteractionEvents['on'](_0x3e7367,_0x27ef97);}};
\ No newline at end of file
+var _0xbf5d=['update','emit','removeListener','register','faxInteraction:','save'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xbf5d,0xad));var _0xdbf5=function(_0x26b717,_0xa41077){_0x26b717=_0x26b717-0x0;var _0x12928d=_0xbf5d[_0x26b717];return _0x12928d;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xdbf5('0x0'),'remove',_0xdbf5('0x1')];function createListener(_0x5104f8,_0xc6008e){return function(_0x39984f){_0xc6008e[_0xdbf5('0x2')](_0x5104f8,_0x39984f);};}function removeListener(_0x112d8d,_0x487f7f){return function(){FaxInteractionEvents[_0xdbf5('0x3')](_0x112d8d,_0x487f7f);};}exports[_0xdbf5('0x4')]=function(_0x422120){for(var _0x57e092=0x0,_0x32d561=events['length'];_0x57e092<_0x32d561;_0x57e092++){var _0x7b79c2=events[_0x57e092];var _0xb61215=createListener(_0xdbf5('0x5')+_0x7b79c2,_0x422120);FaxInteractionEvents['on'](_0x7b79c2,_0xb61215);}};
\ No newline at end of file
index e3dfdd7..1e2dada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3a0=['tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','/:id/messages','addMessage','post','/:id/tags'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc3a0,0x13d));var _0x0c3a=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0xc3a0[_0xce6f11];return _0x35b709;};'use strict';var multer=require(_0x0c3a('0x0'));var util=require('util');var path=require(_0x0c3a('0x1'));var timeout=require('connect-timeout');var express=require(_0x0c3a('0x2'));var router=express[_0x0c3a('0x3')]();var fs_extra=require(_0x0c3a('0x4'));var auth=require(_0x0c3a('0x5'));var interaction=require(_0x0c3a('0x6'));var config=require(_0x0c3a('0x7'));var controller=require(_0x0c3a('0x8'));router[_0x0c3a('0x9')]('/',auth[_0x0c3a('0xa')](),controller[_0x0c3a('0xb')]);router[_0x0c3a('0x9')](_0x0c3a('0xc'),auth[_0x0c3a('0xa')](),controller[_0x0c3a('0xd')]);router[_0x0c3a('0x9')](_0x0c3a('0xe'),auth[_0x0c3a('0xa')](),controller[_0x0c3a('0xf')]);router[_0x0c3a('0x9')]('/:id/messages',auth[_0x0c3a('0xa')](),controller[_0x0c3a('0x10')]);router[_0x0c3a('0x9')](_0x0c3a('0x11'),auth[_0x0c3a('0xa')](),controller[_0x0c3a('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x0c3a('0x13'),auth[_0x0c3a('0xa')](),controller[_0x0c3a('0x14')]);router[_0x0c3a('0x15')](_0x0c3a('0x16'),auth[_0x0c3a('0xa')](),interaction[_0x0c3a('0x17')](_0x0c3a('0x18'),_0x0c3a('0x19')),controller[_0x0c3a('0x1a')]);router['put'](_0x0c3a('0xe'),auth[_0x0c3a('0xa')](),interaction['tracked']('fax',_0x0c3a('0x1b')),controller[_0x0c3a('0x1c')]);router[_0x0c3a('0x1d')](_0x0c3a('0xe'),auth[_0x0c3a('0xa')](),interaction[_0x0c3a('0x17')](_0x0c3a('0x18'),_0x0c3a('0x1e')),controller[_0x0c3a('0x1f')]);router['delete']('/:id/tags',auth[_0x0c3a('0xa')](),controller[_0x0c3a('0x20')]);module[_0x0c3a('0x21')]=router;
\ No newline at end of file
+var _0x2016=['index','get','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','faxinteraction:update','faxinteraction:destroy','removeTags','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller'];(function(_0x52aa41,_0x2f377b){var _0x10dcde=function(_0x49ef0b){while(--_0x49ef0b){_0x52aa41['push'](_0x52aa41['shift']());}};_0x10dcde(++_0x2f377b);}(_0x2016,0xf5));var _0x6201=function(_0xef0c32,_0x1ef690){_0xef0c32=_0xef0c32-0x0;var _0x16ad29=_0x2016[_0xef0c32];return _0x16ad29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6201('0x0'));var timeout=require(_0x6201('0x1'));var express=require('express');var router=express[_0x6201('0x2')]();var fs_extra=require(_0x6201('0x3'));var auth=require(_0x6201('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6201('0x5'));var controller=require(_0x6201('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6201('0x7')]);router[_0x6201('0x8')](_0x6201('0x9'),auth[_0x6201('0xa')](),controller['describe']);router[_0x6201('0x8')](_0x6201('0xb'),auth['isAuthenticated'](),controller[_0x6201('0xc')]);router[_0x6201('0x8')](_0x6201('0xd'),auth['isAuthenticated'](),controller[_0x6201('0xe')]);router['get'](_0x6201('0xf'),auth[_0x6201('0xa')](),controller[_0x6201('0x10')]);router[_0x6201('0x11')]('/',auth['isAuthenticated'](),controller[_0x6201('0x12')]);router[_0x6201('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6201('0x13')]);router['post'](_0x6201('0x14'),auth[_0x6201('0xa')](),interaction[_0x6201('0x15')](_0x6201('0x16'),_0x6201('0x17')),controller['addTags']);router['put'](_0x6201('0xb'),auth[_0x6201('0xa')](),interaction[_0x6201('0x15')]('fax',_0x6201('0x18')),controller['update']);router['delete'](_0x6201('0xb'),auth[_0x6201('0xa')](),interaction[_0x6201('0x15')]('fax',_0x6201('0x19')),controller['destroy']);router['delete'](_0x6201('0x14'),auth['isAuthenticated'](),controller[_0x6201('0x1a')]);module[_0x6201('0x1b')]=router;
\ No newline at end of file
index fb315a3..77c3d30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6658=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x4998eb,_0xbae7c7){var _0x525a74=function(_0x48d3f6){while(--_0x48d3f6){_0x4998eb['push'](_0x4998eb['shift']());}};_0x525a74(++_0xbae7c7);}(_0x6658,0x198));var _0x8665=function(_0x1740fe,_0x382cfc){_0x1740fe=_0x1740fe-0x0;var _0x5f198a=_0x6658[_0x1740fe];return _0x5f198a;};'use strict';var Sequelize=require(_0x8665('0x0'));module[_0x8665('0x1')]={'body':{'type':Sequelize[_0x8665('0x2')](_0x8665('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8665('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8665('0x5')]('in',_0x8665('0x6')),'defaultValue':_0x8665('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x8665('0x7')]}};
\ No newline at end of file
+var _0xfd0f=['exports','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x2c71bd,_0x65d60d){var _0x2509f9=function(_0x29e67c){while(--_0x29e67c){_0x2c71bd['push'](_0x2c71bd['shift']());}};_0x2509f9(++_0x65d60d);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x3f5a5a,_0x318a5d){_0x3f5a5a=_0x3f5a5a-0x0;var _0x4896a6=_0xfd0f[_0x3f5a5a];return _0x4896a6;};'use strict';var Sequelize=require(_0xffd0('0x0'));module[_0xffd0('0x1')]={'body':{'type':Sequelize['TEXT'](_0xffd0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xffd0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd0('0x4')]('in','out'),'defaultValue':_0xffd0('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xffd0('0x6')]}};
\ No newline at end of file
index beae491..ccce9d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fae=['./faxMessage.socket','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','undefined','count','offset','set','apply','reject','save','update','destroy','stack','name','send','map','FaxMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','show','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','fullname','internal','motionChannel','rejectmessage','create','findOne','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','root','server','files','attachments','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x366013,_0x595e06){var _0x4e3613=function(_0x1ba449){while(--_0x1ba449){_0x366013['push'](_0x366013['shift']());}};_0x4e3613(++_0x595e06);}(_0x5fae,0x19b));var _0xe5fa=function(_0x4f1864,_0x5c5ca8){_0x4f1864=_0x4f1864-0x0;var _0x56fe3f=_0x5fae[_0x4f1864];return _0x56fe3f;};'use strict';var emlformat=require(_0xe5fa('0x0'));var rimraf=require(_0xe5fa('0x1'));var zipdir=require(_0xe5fa('0x2'));var jsonpatch=require(_0xe5fa('0x3'));var rp=require(_0xe5fa('0x4'));var moment=require(_0xe5fa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe5fa('0x6'));var util=require(_0xe5fa('0x7'));var path=require(_0xe5fa('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe5fa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5fa('0xa'));var squel=require('squel');var crypto=require(_0xe5fa('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe5fa('0xc'));var Papa=require(_0xe5fa('0xd'));var Redis=require(_0xe5fa('0xe'));var authService=require(_0xe5fa('0xf'));var qs=require(_0xe5fa('0x10'));var as=require(_0xe5fa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5fa('0x12'))('api');var utils=require(_0xe5fa('0x13'));var config=require(_0xe5fa('0x14'));var licenseUtil=require(_0xe5fa('0x15'));var db=require(_0xe5fa('0x16'))['db'];config[_0xe5fa('0x17')]=_[_0xe5fa('0x18')](config[_0xe5fa('0x17')],{'host':_0xe5fa('0x19'),'port':0x18eb});var socket=require(_0xe5fa('0x1a'))(new Redis(config[_0xe5fa('0x17')]));require(_0xe5fa('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe5fa('0x1c')][_0xe5fa('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xe5fa('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x307b60,_0x5a755b,_0x1ce285,_0x54d410){return new BPromise(function(_0x6090aa,_0x34240a){var _0x390300=_0x54d410||client;return _0x390300[_0xe5fa('0x1e')](_0x307b60,_0x1ce285)[_0xe5fa('0x1f')](function(_0x17c09a){logger['info'](_0xe5fa('0x20'),_0x5a755b,_0xe5fa('0x21'));logger[_0xe5fa('0x22')](_0xe5fa('0x23'),_0x5a755b,_0xe5fa('0x21'),JSON[_0xe5fa('0x24')](_0x17c09a));if(_0x17c09a[_0xe5fa('0x25')]){if(_0x17c09a[_0xe5fa('0x25')][_0xe5fa('0x26')]===0x1f4){logger['error'](_0xe5fa('0x20'),_0x5a755b,_0x17c09a['error'][_0xe5fa('0x27')]);return _0x34240a(_0x17c09a[_0xe5fa('0x25')][_0xe5fa('0x27')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x5a755b,_0x17c09a[_0xe5fa('0x25')][_0xe5fa('0x27')]);return _0x6090aa(_0x17c09a[_0xe5fa('0x25')][_0xe5fa('0x27')]);}else{logger[_0xe5fa('0x28')](_0xe5fa('0x20'),_0x5a755b,_0xe5fa('0x21'));_0x6090aa(_0x17c09a[_0xe5fa('0x29')]['message']);}})[_0xe5fa('0x2a')](function(_0x438367){logger['error'](_0xe5fa('0x20'),_0x5a755b,_0x438367);_0x34240a(_0x438367);});});}function respondWithStatusCode(_0x3b0740,_0x533b8b){_0x533b8b=_0x533b8b||0xcc;return function(_0x2e3517){if(_0x2e3517){return _0x3b0740[_0xe5fa('0x2b')](_0x533b8b);}return _0x3b0740['status'](_0x533b8b)[_0xe5fa('0x2c')]();};}function respondWithResult(_0x5c8464,_0xd0f3e5){_0xd0f3e5=_0xd0f3e5||0xc8;return function(_0xfee749){if(_0xfee749){return _0x5c8464[_0xe5fa('0x2d')](_0xd0f3e5)[_0xe5fa('0x2e')](_0xfee749);}};}function respondWithFilteredResult(_0x4fdf0e,_0x39e207){return function(_0x208b8d){if(_0x208b8d){var _0x62a7ad=typeof _0x39e207['offset']===_0xe5fa('0x2f')&&typeof _0x39e207['limit']===_0xe5fa('0x2f');var _0x3c2123=_0x208b8d[_0xe5fa('0x30')];var _0x22e2ae=_0x62a7ad?0x0:_0x39e207['offset'];var _0x41e12f=_0x62a7ad?_0x208b8d[_0xe5fa('0x30')]:_0x39e207[_0xe5fa('0x31')]+_0x39e207['limit'];var _0x5f2ecd;if(_0x41e12f>=_0x3c2123){_0x41e12f=_0x3c2123;_0x5f2ecd=0xc8;}else{_0x5f2ecd=0xce;}_0x4fdf0e[_0xe5fa('0x2d')](_0x5f2ecd);return _0x4fdf0e[_0xe5fa('0x32')]('Content-Range',_0x22e2ae+'-'+_0x41e12f+'/'+_0x3c2123)['json'](_0x208b8d);}return null;};}function patchUpdates(_0x102910){return function(_0x5cac00){try{jsonpatch[_0xe5fa('0x33')](_0x5cac00,_0x102910,!![]);}catch(_0x58595c){return BPromise[_0xe5fa('0x34')](_0x58595c);}return _0x5cac00[_0xe5fa('0x35')]();};}function saveUpdates(_0x4a01e8,_0x4f3db7){return function(_0x1036d9){if(_0x1036d9){return _0x1036d9[_0xe5fa('0x36')](_0x4a01e8)[_0xe5fa('0x1f')](function(_0x492235){return _0x492235;});}return null;};}function removeEntity(_0x4056ed,_0x497d29){return function(_0xfc8597){if(_0xfc8597){return _0xfc8597[_0xe5fa('0x37')]()['then'](function(){_0x4056ed['status'](0xcc)[_0xe5fa('0x2c')]();});}};}function handleEntityNotFound(_0x209077,_0xb477b6){return function(_0x337d3b){if(!_0x337d3b){_0x209077[_0xe5fa('0x2b')](0x194);}return _0x337d3b;};}function handleError(_0x2bdac1,_0x536710){_0x536710=_0x536710||0x1f4;return function(_0x5dc3b0){logger['error'](_0x5dc3b0[_0xe5fa('0x38')]);if(_0x5dc3b0[_0xe5fa('0x39')]){delete _0x5dc3b0[_0xe5fa('0x39')];}_0x2bdac1[_0xe5fa('0x2d')](_0x536710)[_0xe5fa('0x3a')](_0x5dc3b0);};}exports['index']=function(_0x57ed17,_0x1f2bc6){var _0x3238a2={},_0x205b50={},_0x3655d7={'count':0x0,'rows':[]};var _0xc6ace=_[_0xe5fa('0x3b')](db[_0xe5fa('0x3c')][_0xe5fa('0x3d')],function(_0x4a3c0b){return{'name':_0x4a3c0b[_0xe5fa('0x3e')],'type':_0x4a3c0b[_0xe5fa('0x3f')][_0xe5fa('0x40')]};});_0x205b50['model']=_[_0xe5fa('0x3b')](_0xc6ace,_0xe5fa('0x39'));_0x205b50[_0xe5fa('0x41')]=_[_0xe5fa('0x42')](_0x57ed17[_0xe5fa('0x41')]);_0x205b50[_0xe5fa('0x43')]=_[_0xe5fa('0x44')](_0x205b50[_0xe5fa('0x45')],_0x205b50[_0xe5fa('0x41')]);_0x3238a2[_0xe5fa('0x46')]=_[_0xe5fa('0x44')](_0x205b50[_0xe5fa('0x45')],qs[_0xe5fa('0x47')](_0x57ed17['query']['fields']));_0x3238a2[_0xe5fa('0x46')]=_0x3238a2[_0xe5fa('0x46')][_0xe5fa('0x48')]?_0x3238a2[_0xe5fa('0x46')]:_0x205b50[_0xe5fa('0x45')];if(!_0x57ed17['query']['hasOwnProperty'](_0xe5fa('0x49'))){_0x3238a2[_0xe5fa('0x4a')]=qs[_0xe5fa('0x4a')](_0x57ed17['query'][_0xe5fa('0x4a')]);_0x3238a2[_0xe5fa('0x31')]=qs[_0xe5fa('0x31')](_0x57ed17['query'][_0xe5fa('0x31')]);}_0x3238a2[_0xe5fa('0x4b')]=qs[_0xe5fa('0x4c')](_0x57ed17[_0xe5fa('0x41')]['sort']);_0x3238a2['where']=qs[_0xe5fa('0x43')](_['pick'](_0x57ed17[_0xe5fa('0x41')],_0x205b50[_0xe5fa('0x43')]),_0xc6ace);if(_0x57ed17[_0xe5fa('0x41')]['filter']){_0x3238a2[_0xe5fa('0x4d')]=_[_0xe5fa('0x4e')](_0x3238a2[_0xe5fa('0x4d')],{'$or':_[_0xe5fa('0x3b')](_0xc6ace,function(_0x31b13d){if(_0x31b13d['type']!=='VIRTUAL'){var _0x407621={};_0x407621[_0x31b13d['name']]={'$like':'%'+_0x57ed17[_0xe5fa('0x41')][_0xe5fa('0x4f')]+'%'};return _0x407621;}})});}_0x3238a2=_[_0xe5fa('0x4e')]({},_0x3238a2,_0x57ed17[_0xe5fa('0x50')]);var _0x57ef5d={'where':_0x3238a2[_0xe5fa('0x4d')]};return db[_0xe5fa('0x3c')][_0xe5fa('0x30')](_0x57ef5d)[_0xe5fa('0x1f')](function(_0x9df5e5){_0x3655d7['count']=_0x9df5e5;if(_0x57ed17[_0xe5fa('0x41')][_0xe5fa('0x51')]){_0x3238a2[_0xe5fa('0x52')]=[{'all':!![]}];}return db[_0xe5fa('0x3c')][_0xe5fa('0x53')](_0x3238a2);})[_0xe5fa('0x1f')](function(_0x2f1424){_0x3655d7[_0xe5fa('0x54')]=_0x2f1424;return _0x3655d7;})[_0xe5fa('0x1f')](respondWithFilteredResult(_0x1f2bc6,_0x3238a2))['catch'](handleError(_0x1f2bc6,null));};exports[_0xe5fa('0x55')]=function(_0xe97be5,_0x100e6b){var _0x1e559b={'raw':!![],'where':{'id':_0xe97be5[_0xe5fa('0x56')]['id']}},_0x53febe={};_0x53febe['model']=_[_0xe5fa('0x42')](db[_0xe5fa('0x3c')]['rawAttributes']);_0x53febe['query']=_[_0xe5fa('0x42')](_0xe97be5[_0xe5fa('0x41')]);_0x53febe[_0xe5fa('0x43')]=_[_0xe5fa('0x44')](_0x53febe[_0xe5fa('0x45')],_0x53febe[_0xe5fa('0x41')]);_0x1e559b[_0xe5fa('0x46')]=_[_0xe5fa('0x44')](_0x53febe[_0xe5fa('0x45')],qs[_0xe5fa('0x47')](_0xe97be5['query']['fields']));_0x1e559b[_0xe5fa('0x46')]=_0x1e559b['attributes'][_0xe5fa('0x48')]?_0x1e559b[_0xe5fa('0x46')]:_0x53febe[_0xe5fa('0x45')];if(_0xe97be5['query']['includeAll']){_0x1e559b[_0xe5fa('0x52')]=[{'all':!![]}];}_0x1e559b=_[_0xe5fa('0x4e')]({},_0x1e559b,_0xe97be5[_0xe5fa('0x50')]);return db[_0xe5fa('0x3c')][_0xe5fa('0x57')](_0x1e559b)[_0xe5fa('0x1f')](handleEntityNotFound(_0x100e6b,null))['then'](respondWithResult(_0x100e6b,null))['catch'](handleError(_0x100e6b,null));};exports[_0xe5fa('0x36')]=function(_0x2fb046,_0x310821){if(_0x2fb046[_0xe5fa('0x58')]['id']){delete _0x2fb046['body']['id'];}return db[_0xe5fa('0x3c')][_0xe5fa('0x57')]({'where':{'id':_0x2fb046[_0xe5fa('0x56')]['id']}})[_0xe5fa('0x1f')](handleEntityNotFound(_0x310821,null))[_0xe5fa('0x1f')](saveUpdates(_0x2fb046[_0xe5fa('0x58')],null))[_0xe5fa('0x1f')](respondWithResult(_0x310821,null))[_0xe5fa('0x2a')](handleError(_0x310821,null));};exports[_0xe5fa('0x37')]=function(_0x1d7c4d,_0xa45191){return db[_0xe5fa('0x3c')][_0xe5fa('0x57')]({'where':{'id':_0x1d7c4d[_0xe5fa('0x56')]['id']}})[_0xe5fa('0x1f')](handleEntityNotFound(_0xa45191,null))[_0xe5fa('0x1f')](removeEntity(_0xa45191,null))[_0xe5fa('0x2a')](handleError(_0xa45191,null));};exports[_0xe5fa('0x59')]=function(_0x3dfa18,_0x4d0b3d){return db[_0xe5fa('0x3c')][_0xe5fa('0x59')]()[_0xe5fa('0x1f')](respondWithResult(_0x4d0b3d,null))['catch'](handleError(_0x4d0b3d,null));};var interaction_log=require('../../config/logger')(_0xe5fa('0x5a'));exports[_0xe5fa('0x5b')]=function(_0x11c978,_0x84035c,_0x3e2bcd){var _0x56727b={'agent':{},'channel':_0xe5fa('0x5c')};if(_0x11c978[_0xe5fa('0x58')]['id']){delete _0x11c978['body']['id'];}_0x11c978[_0xe5fa('0x58')][_0xe5fa('0x5d')]=!![];_0x11c978[_0xe5fa('0x58')][_0xe5fa('0x5e')]=moment()[_0xe5fa('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x11c978['body'][_0xe5fa('0x60')]=_0x11c978[_0xe5fa('0x58')][_0xe5fa('0x60')]||_0x11c978[_0xe5fa('0x61')]['id'];_0x56727b[_0xe5fa('0x62')]['id']=_0x11c978[_0xe5fa('0x58')]['UserId'];return db[_0xe5fa('0x3c')][_0xe5fa('0x57')]({'where':{'id':_0x11c978['params']['id'],'UserId':null}})[_0xe5fa('0x1f')](handleEntityNotFound(_0x84035c,null))[_0xe5fa('0x1f')](saveUpdates(_0x11c978[_0xe5fa('0x58')],null))[_0xe5fa('0x1f')](function(_0x4243e8){if(_0x4243e8){_0x56727b['message']=_0x4243e8[_0xe5fa('0x63')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4243e8[_0xe5fa('0x64')]}});}return null;})[_0xe5fa('0x1f')](handleEntityNotFound(_0x84035c,null))[_0xe5fa('0x1f')](function(_0x399ccf){if(_0x399ccf){return _0x399ccf[_0xe5fa('0x36')]({'UserId':_0x11c978[_0xe5fa('0x58')][_0xe5fa('0x60')],'read1stAt':_[_0xe5fa('0x65')](_0x399ccf[_0xe5fa('0x66')])?moment()[_0xe5fa('0x5f')](_0xe5fa('0x67')):undefined});}return null;})[_0xe5fa('0x1f')](function(_0x5b6725){if(_0x5b6725){_0x56727b['interaction']=_0x5b6725[_0xe5fa('0x63')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11c978[_0xe5fa('0x61')]['id'],_0x11c978[_0xe5fa('0x61')][_0xe5fa('0x39')],_0x11c978[_0xe5fa('0x61')][_0xe5fa('0x68')],_0x56727b[_0xe5fa('0x69')]['id'],_0x11c978[_0xe5fa('0x58')]?JSON['stringify'](_0x11c978[_0xe5fa('0x58')]):'null');return respondWithRpcPromise(_0xe5fa('0x6a'),_0xe5fa('0x6b'),_0x56727b);}return null;})[_0xe5fa('0x1f')](function(_0x505aef){var _0x225069=_0xe5fa('0x6c')+_0x505aef[_0xe5fa('0x27')][_0xe5fa('0x6d')];return db['sequelize'][_0xe5fa('0x41')](_0x225069,{'type':db[_0xe5fa('0x6e')][_0xe5fa('0x6f')][_0xe5fa('0x70')],'raw':!![]})[_0xe5fa('0x1f')](function(_0x87857){return _0x87857;});})['then'](function(_0x26b47e){if(_0x26b47e){_0x56727b[_0xe5fa('0x27')][_0xe5fa('0x71')]=_0x26b47e[0x0];if(!_0x11c978[_0xe5fa('0x58')][_0xe5fa('0x60')])return;return db[_0xe5fa('0x72')][_0xe5fa('0x57')]({'where':{'id':_0x11c978['body']['UserId'],'role':_0xe5fa('0x62')},'attributes':['id',_0xe5fa('0x39'),'fullname',_0xe5fa('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3952d5){if(!_0x3952d5)return null;_0x56727b['message'][_0xe5fa('0x62')]=_0x3952d5;return _0x56727b;})[_0xe5fa('0x1f')](function(_0x49515e){if(_0x49515e){if(_0x11c978['body'][_0xe5fa('0x74')]){_0x56727b[_0xe5fa('0x27')][_0xe5fa('0x75')]=util[_0xe5fa('0x5f')](_0xe5fa('0x76'),_0x11c978[_0xe5fa('0x61')][_0xe5fa('0x39')]);_0x56727b['message'][_0xe5fa('0x77')]=_0x56727b[_0xe5fa('0x77')];_0x56727b[_0xe5fa('0x27')]['motionChannel']=_0x56727b[_0xe5fa('0x77')];_0x56727b[_0xe5fa('0x27')][_0xe5fa('0x78')]=_0xe5fa('0x5b');return respondWithRpcPromise('EventManager',_0xe5fa('0x79'),{'event':_0xe5fa('0x7a'),'message':_0x56727b[_0xe5fa('0x27')]},client9002)[_0xe5fa('0x1f')](function(){return _0x56727b;});}return _0x56727b;}return null;})[_0xe5fa('0x1f')](respondWithResult(_0x84035c,null))[_0xe5fa('0x2a')](handleError(_0x84035c,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xe5fa('0x34')]=function(_0x4d4e59,_0x4f6cc2,_0xdae94f){var _0x3b7110={'agent':{},'channel':_0xe5fa('0x5c')};if(_0x4d4e59['body']['id']){delete _0x4d4e59[_0xe5fa('0x58')]['id'];}_0x4d4e59[_0xe5fa('0x58')][_0xe5fa('0x60')]=_0x4d4e59['body'][_0xe5fa('0x60')]||_0x4d4e59[_0xe5fa('0x61')]['id'];_0x3b7110['agent']['id']=_0x4d4e59[_0xe5fa('0x58')][_0xe5fa('0x60')];return db[_0xe5fa('0x3c')][_0xe5fa('0x57')]({'where':{'id':_0x4d4e59['params']['id'],'UserId':null}})[_0xe5fa('0x1f')](handleEntityNotFound(_0x4f6cc2,null))[_0xe5fa('0x1f')](function(_0x4c0e6f){if(_0x4c0e6f){_0x3b7110[_0xe5fa('0x27')]=_0x4c0e6f[_0xe5fa('0x63')]({'plain':!![]});return db[_0xe5fa('0x7b')][_0xe5fa('0x57')]({'where':{'id':_0x4c0e6f[_0xe5fa('0x64')]}});}return null;})[_0xe5fa('0x1f')](handleEntityNotFound(_0x4f6cc2,null))[_0xe5fa('0x1f')](function(_0x2af936){if(_0x2af936){_0x3b7110[_0xe5fa('0x69')]=_0x2af936[_0xe5fa('0x63')]({'plain':!![]});interaction_log[_0xe5fa('0x28')](_0xe5fa('0x7c'),_0x4d4e59['user']['id'],_0x4d4e59[_0xe5fa('0x61')][_0xe5fa('0x39')],_0x4d4e59[_0xe5fa('0x61')][_0xe5fa('0x68')],_0x3b7110[_0xe5fa('0x69')]['id'],_0x4d4e59[_0xe5fa('0x58')]?JSON['stringify'](_0x4d4e59['body']):'null');return respondWithRpcPromise(_0xe5fa('0x7d'),_0xe5fa('0x7e'),_0x3b7110);}return null;})[_0xe5fa('0x1f')](function(_0x3821ca){var _0x4a167f=_0xe5fa('0x6c')+_0x3821ca['message'][_0xe5fa('0x6d')];return db[_0xe5fa('0x7f')]['query'](_0x4a167f,{'type':db[_0xe5fa('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe5fa('0x1f')](function(_0x27feb5){return _0x27feb5;});})[_0xe5fa('0x1f')](function(_0x2ddd0d){if(_0x2ddd0d){_0x3b7110[_0xe5fa('0x27')][_0xe5fa('0x71')]=_0x2ddd0d[0x0];if(!_0x4d4e59[_0xe5fa('0x58')][_0xe5fa('0x60')])return;return db[_0xe5fa('0x72')][_0xe5fa('0x57')]({'where':{'id':_0x4d4e59[_0xe5fa('0x58')][_0xe5fa('0x60')],'role':_0xe5fa('0x62')},'attributes':['id',_0xe5fa('0x39'),_0xe5fa('0x80'),_0xe5fa('0x73'),_0xe5fa('0x81')],'raw':!![]});}return null;})[_0xe5fa('0x1f')](function(_0x28b318){if(!_0x28b318)return null;_0x3b7110[_0xe5fa('0x27')]['agent']=_0x28b318;return _0x3b7110;})[_0xe5fa('0x1f')](function(_0x777aec){if(_0x777aec){_0x777aec['message'][_0xe5fa('0x75')]=util['format'](_0xe5fa('0x76'),_0x4d4e59[_0xe5fa('0x61')][_0xe5fa('0x39')]);_0x777aec['message'][_0xe5fa('0x77')]=_0x3b7110[_0xe5fa('0x77')];_0x777aec[_0xe5fa('0x27')][_0xe5fa('0x82')]=_0x3b7110[_0xe5fa('0x77')];_0x777aec[_0xe5fa('0x27')][_0xe5fa('0x78')]='reject';respondWithRpcPromise(_0xe5fa('0x79'),_0xe5fa('0x79'),{'event':_0xe5fa('0x83'),'message':_0x777aec[_0xe5fa('0x27')]},client9002);return _0x3b7110;}return null;})['then'](respondWithResult(_0x4f6cc2,null))['catch'](handleError(_0x4f6cc2,null));};exports[_0xe5fa('0x84')]=function(_0x1c6f54,_0x57d916){var _0x454e2e;return db[_0xe5fa('0x3c')][_0xe5fa('0x84')](_0x1c6f54['body'],{})[_0xe5fa('0x1f')](function(_0x312a1d){_0x454e2e=_0x312a1d;return db['CmContact'][_0xe5fa('0x85')]({'where':{'id':_0x454e2e[_0xe5fa('0x6d')]}});})['then'](function(_0x3352a3){if(_[_0xe5fa('0x65')](_0x3352a3)){return;}else{_0x454e2e['fax']=_0x3352a3[_0xe5fa('0x5c')];return db[_0xe5fa('0x86')]['findOne']({'where':{'id':_0x454e2e['AttachmentId']}});}})[_0xe5fa('0x1f')](function(_0x406bb9){return respondWithRpcPromise(_0xe5fa('0x87'),_0xe5fa('0x87'),{'FaxAccountId':_[_0xe5fa('0x65')](_0x1c6f54[_0xe5fa('0x58')])?undefined:_0x1c6f54['body'][_0xe5fa('0x88')],'path':_[_0xe5fa('0x65')](_0x406bb9)?undefined:util[_0xe5fa('0x5f')](_0xe5fa('0x89'),_0x406bb9[_0xe5fa('0x8a')]),'fax':_['isNil'](_0x454e2e[_0xe5fa('0x5c')])?undefined:_0x454e2e[_0xe5fa('0x5c')],'AttachmentId':_0x454e2e[_0xe5fa('0x8b')]},client9002);})[_0xe5fa('0x1f')](respondWithResult(_0x57d916,0xc9))[_0xe5fa('0x2a')](handleError(_0x57d916,null));};exports[_0xe5fa('0x8c')]=function(_0x2c2e0b,_0x55f55e){var _0x293108=path['join'](config[_0xe5fa('0x8d')],_0xe5fa('0x8e'),_0xe5fa('0x8f'),_0xe5fa('0x90'));return db[_0xe5fa('0x3c')]['find']({'where':{'id':_0x2c2e0b[_0xe5fa('0x56')]['id']},'include':[{'model':db[_0xe5fa('0x86')],'as':_0xe5fa('0x86')}]})['then'](handleEntityNotFound(_0x55f55e,null))[_0xe5fa('0x1f')](function(_0x499f15){if(_0x499f15){return _0x55f55e[_0xe5fa('0x8c')](path[_0xe5fa('0x91')](_0x293108,_0x499f15['Attachment'][_0xe5fa('0x8a')]));}})[_0xe5fa('0x2a')](handleError(_0x55f55e,null));};
\ No newline at end of file
+var _0x6e61=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','name','send','index','map','FaxMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','rows','keys','include','find','body','params','describe','fax-interactions','accept','fax','read','readAt','format','UserId','agent','FaxInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','ContactId','sequelize','Sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','fullname','event','EventManager','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','Attachment','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x59f0e9,_0x5d57f2){var _0x2554bc=function(_0x2237b9){while(--_0x2237b9){_0x59f0e9['push'](_0x59f0e9['shift']());}};_0x2554bc(++_0x5d57f2);}(_0x6e61,0x188));var _0x16e6=function(_0x4ccf9a,_0x435c2a){_0x4ccf9a=_0x4ccf9a-0x0;var _0x2a9d60=_0x6e61[_0x4ccf9a];return _0x2a9d60;};'use strict';var emlformat=require(_0x16e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16e6('0x1'));var jsonpatch=require(_0x16e6('0x2'));var rp=require('request-promise');var moment=require(_0x16e6('0x3'));var BPromise=require(_0x16e6('0x4'));var Mustache=require(_0x16e6('0x5'));var util=require(_0x16e6('0x6'));var path=require(_0x16e6('0x7'));var sox=require(_0x16e6('0x8'));var csv=require(_0x16e6('0x9'));var ejs=require(_0x16e6('0xa'));var fs=require('fs');var fs_extra=require(_0x16e6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x16e6('0xc'));var jsforce=require(_0x16e6('0xd'));var deskjs=require(_0x16e6('0xe'));var toCsv=require(_0x16e6('0x9'));var querystring=require(_0x16e6('0xf'));var Papa=require(_0x16e6('0x10'));var Redis=require(_0x16e6('0x11'));var authService=require(_0x16e6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16e6('0x13'));var logger=require(_0x16e6('0x14'))('api');var utils=require(_0x16e6('0x15'));var config=require(_0x16e6('0x16'));var licenseUtil=require(_0x16e6('0x17'));var db=require(_0x16e6('0x18'))['db'];config[_0x16e6('0x19')]=_[_0x16e6('0x1a')](config[_0x16e6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x16e6('0x1b'))(new Redis(config['redis']));require(_0x16e6('0x1c'))[_0x16e6('0x1d')](socket);var jayson=require(_0x16e6('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41a52d,_0x5239b5,_0x595bb7,_0x4130b9){return new BPromise(function(_0x12411e,_0x5d4297){var _0x2c907f=_0x4130b9||client;return _0x2c907f[_0x16e6('0x1f')](_0x41a52d,_0x595bb7)[_0x16e6('0x20')](function(_0x12dda6){logger[_0x16e6('0x21')](_0x16e6('0x22'),_0x5239b5,_0x16e6('0x23'));logger[_0x16e6('0x24')](_0x16e6('0x25'),_0x5239b5,'request\x20sent',JSON[_0x16e6('0x26')](_0x12dda6));if(_0x12dda6[_0x16e6('0x27')]){if(_0x12dda6[_0x16e6('0x27')][_0x16e6('0x28')]===0x1f4){logger[_0x16e6('0x27')]('FaxMessage,\x20%s,\x20%s',_0x5239b5,_0x12dda6['error'][_0x16e6('0x29')]);return _0x5d4297(_0x12dda6[_0x16e6('0x27')][_0x16e6('0x29')]);}logger[_0x16e6('0x27')](_0x16e6('0x22'),_0x5239b5,_0x12dda6['error'][_0x16e6('0x29')]);return _0x12411e(_0x12dda6[_0x16e6('0x27')][_0x16e6('0x29')]);}else{logger[_0x16e6('0x21')]('FaxMessage,\x20%s,\x20%s',_0x5239b5,'request\x20sent');_0x12411e(_0x12dda6['result'][_0x16e6('0x29')]);}})[_0x16e6('0x2a')](function(_0x5817cd){logger['error'](_0x16e6('0x22'),_0x5239b5,_0x5817cd);_0x5d4297(_0x5817cd);});});}function respondWithStatusCode(_0x4b70c3,_0x5e8a32){_0x5e8a32=_0x5e8a32||0xcc;return function(_0x2da254){if(_0x2da254){return _0x4b70c3[_0x16e6('0x2b')](_0x5e8a32);}return _0x4b70c3[_0x16e6('0x2c')](_0x5e8a32)[_0x16e6('0x2d')]();};}function respondWithResult(_0x325150,_0x293ed3){_0x293ed3=_0x293ed3||0xc8;return function(_0x2b293f){if(_0x2b293f){return _0x325150[_0x16e6('0x2c')](_0x293ed3)['json'](_0x2b293f);}};}function respondWithFilteredResult(_0x299f1e,_0x309150){return function(_0x59bd43){if(_0x59bd43){var _0xb9517c=typeof _0x309150['offset']===_0x16e6('0x2e')&&typeof _0x309150[_0x16e6('0x2f')]==='undefined';var _0x2d12c3=_0x59bd43[_0x16e6('0x30')];var _0x2bd6e0=_0xb9517c?0x0:_0x309150[_0x16e6('0x31')];var _0x38cdff=_0xb9517c?_0x59bd43[_0x16e6('0x30')]:_0x309150[_0x16e6('0x31')]+_0x309150[_0x16e6('0x2f')];var _0x504068;if(_0x38cdff>=_0x2d12c3){_0x38cdff=_0x2d12c3;_0x504068=0xc8;}else{_0x504068=0xce;}_0x299f1e[_0x16e6('0x2c')](_0x504068);return _0x299f1e[_0x16e6('0x32')](_0x16e6('0x33'),_0x2bd6e0+'-'+_0x38cdff+'/'+_0x2d12c3)[_0x16e6('0x34')](_0x59bd43);}return null;};}function patchUpdates(_0x139bc6){return function(_0x4248a1){try{jsonpatch['apply'](_0x4248a1,_0x139bc6,!![]);}catch(_0x18719d){return BPromise[_0x16e6('0x35')](_0x18719d);}return _0x4248a1[_0x16e6('0x36')]();};}function saveUpdates(_0x28bb1e,_0xffe40a){return function(_0x2996e2){if(_0x2996e2){return _0x2996e2[_0x16e6('0x37')](_0x28bb1e)['then'](function(_0x5f1874){return _0x5f1874;});}return null;};}function removeEntity(_0x1c3287,_0x390b58){return function(_0x197305){if(_0x197305){return _0x197305['destroy']()[_0x16e6('0x20')](function(){_0x1c3287[_0x16e6('0x2c')](0xcc)[_0x16e6('0x2d')]();});}};}function handleEntityNotFound(_0x194624,_0x32a24d){return function(_0x54bdeb){if(!_0x54bdeb){_0x194624[_0x16e6('0x2b')](0x194);}return _0x54bdeb;};}function handleError(_0x3bbdde,_0x3fd837){_0x3fd837=_0x3fd837||0x1f4;return function(_0x51e7dc){logger[_0x16e6('0x27')](_0x51e7dc['stack']);if(_0x51e7dc['name']){delete _0x51e7dc[_0x16e6('0x38')];}_0x3bbdde[_0x16e6('0x2c')](_0x3fd837)[_0x16e6('0x39')](_0x51e7dc);};}exports[_0x16e6('0x3a')]=function(_0x563f77,_0x291d6a){var _0x1bfe82={},_0x34b194={},_0x1d1438={'count':0x0,'rows':[]};var _0x237e7a=_[_0x16e6('0x3b')](db[_0x16e6('0x3c')][_0x16e6('0x3d')],function(_0x3cad50){return{'name':_0x3cad50['fieldName'],'type':_0x3cad50[_0x16e6('0x3e')][_0x16e6('0x3f')]};});_0x34b194[_0x16e6('0x40')]=_['map'](_0x237e7a,'name');_0x34b194[_0x16e6('0x41')]=_['keys'](_0x563f77[_0x16e6('0x41')]);_0x34b194[_0x16e6('0x42')]=_[_0x16e6('0x43')](_0x34b194[_0x16e6('0x40')],_0x34b194[_0x16e6('0x41')]);_0x1bfe82[_0x16e6('0x44')]=_[_0x16e6('0x43')](_0x34b194[_0x16e6('0x40')],qs[_0x16e6('0x45')](_0x563f77[_0x16e6('0x41')][_0x16e6('0x45')]));_0x1bfe82[_0x16e6('0x44')]=_0x1bfe82[_0x16e6('0x44')][_0x16e6('0x46')]?_0x1bfe82[_0x16e6('0x44')]:_0x34b194['model'];if(!_0x563f77[_0x16e6('0x41')]['hasOwnProperty']('nolimit')){_0x1bfe82[_0x16e6('0x2f')]=qs['limit'](_0x563f77[_0x16e6('0x41')][_0x16e6('0x2f')]);_0x1bfe82['offset']=qs[_0x16e6('0x31')](_0x563f77[_0x16e6('0x41')][_0x16e6('0x31')]);}_0x1bfe82[_0x16e6('0x47')]=qs['sort'](_0x563f77[_0x16e6('0x41')][_0x16e6('0x48')]);_0x1bfe82[_0x16e6('0x49')]=qs[_0x16e6('0x42')](_[_0x16e6('0x4a')](_0x563f77['query'],_0x34b194[_0x16e6('0x42')]),_0x237e7a);if(_0x563f77[_0x16e6('0x41')][_0x16e6('0x4b')]){_0x1bfe82[_0x16e6('0x49')]=_[_0x16e6('0x4c')](_0x1bfe82[_0x16e6('0x49')],{'$or':_[_0x16e6('0x3b')](_0x237e7a,function(_0x5a2fa5){if(_0x5a2fa5[_0x16e6('0x3e')]!=='VIRTUAL'){var _0x1b2205={};_0x1b2205[_0x5a2fa5[_0x16e6('0x38')]]={'$like':'%'+_0x563f77[_0x16e6('0x41')]['filter']+'%'};return _0x1b2205;}})});}_0x1bfe82=_[_0x16e6('0x4c')]({},_0x1bfe82,_0x563f77[_0x16e6('0x4d')]);var _0xb7ccb7={'where':_0x1bfe82[_0x16e6('0x49')]};return db['FaxMessage'][_0x16e6('0x30')](_0xb7ccb7)[_0x16e6('0x20')](function(_0x618aa){_0x1d1438[_0x16e6('0x30')]=_0x618aa;if(_0x563f77[_0x16e6('0x41')][_0x16e6('0x4e')]){_0x1bfe82['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1bfe82);})[_0x16e6('0x20')](function(_0x5001bf){_0x1d1438[_0x16e6('0x4f')]=_0x5001bf;return _0x1d1438;})['then'](respondWithFilteredResult(_0x291d6a,_0x1bfe82))[_0x16e6('0x2a')](handleError(_0x291d6a,null));};exports['show']=function(_0x374d50,_0x25c86f){var _0x2a17ff={'raw':!![],'where':{'id':_0x374d50['params']['id']}},_0x11819={};_0x11819[_0x16e6('0x40')]=_['keys'](db[_0x16e6('0x3c')][_0x16e6('0x3d')]);_0x11819['query']=_[_0x16e6('0x50')](_0x374d50[_0x16e6('0x41')]);_0x11819[_0x16e6('0x42')]=_[_0x16e6('0x43')](_0x11819[_0x16e6('0x40')],_0x11819[_0x16e6('0x41')]);_0x2a17ff[_0x16e6('0x44')]=_[_0x16e6('0x43')](_0x11819[_0x16e6('0x40')],qs['fields'](_0x374d50[_0x16e6('0x41')]['fields']));_0x2a17ff['attributes']=_0x2a17ff[_0x16e6('0x44')][_0x16e6('0x46')]?_0x2a17ff[_0x16e6('0x44')]:_0x11819[_0x16e6('0x40')];if(_0x374d50[_0x16e6('0x41')]['includeAll']){_0x2a17ff[_0x16e6('0x51')]=[{'all':!![]}];}_0x2a17ff=_[_0x16e6('0x4c')]({},_0x2a17ff,_0x374d50[_0x16e6('0x4d')]);return db['FaxMessage'][_0x16e6('0x52')](_0x2a17ff)[_0x16e6('0x20')](handleEntityNotFound(_0x25c86f,null))[_0x16e6('0x20')](respondWithResult(_0x25c86f,null))[_0x16e6('0x2a')](handleError(_0x25c86f,null));};exports[_0x16e6('0x37')]=function(_0x11205f,_0x2011d8){if(_0x11205f[_0x16e6('0x53')]['id']){delete _0x11205f[_0x16e6('0x53')]['id'];}return db[_0x16e6('0x3c')][_0x16e6('0x52')]({'where':{'id':_0x11205f[_0x16e6('0x54')]['id']}})['then'](handleEntityNotFound(_0x2011d8,null))['then'](saveUpdates(_0x11205f[_0x16e6('0x53')],null))[_0x16e6('0x20')](respondWithResult(_0x2011d8,null))[_0x16e6('0x2a')](handleError(_0x2011d8,null));};exports['destroy']=function(_0x3bdaee,_0xc23239){return db[_0x16e6('0x3c')][_0x16e6('0x52')]({'where':{'id':_0x3bdaee[_0x16e6('0x54')]['id']}})[_0x16e6('0x20')](handleEntityNotFound(_0xc23239,null))['then'](removeEntity(_0xc23239,null))[_0x16e6('0x2a')](handleError(_0xc23239,null));};exports[_0x16e6('0x55')]=function(_0x3d2c31,_0x79fc0b){return db[_0x16e6('0x3c')]['describe']()['then'](respondWithResult(_0x79fc0b,null))[_0x16e6('0x2a')](handleError(_0x79fc0b,null));};var interaction_log=require(_0x16e6('0x14'))(_0x16e6('0x56'));exports[_0x16e6('0x57')]=function(_0x57b0fa,_0x134f25,_0x3c4bee){var _0x38b966={'agent':{},'channel':_0x16e6('0x58')};if(_0x57b0fa[_0x16e6('0x53')]['id']){delete _0x57b0fa[_0x16e6('0x53')]['id'];}_0x57b0fa[_0x16e6('0x53')][_0x16e6('0x59')]=!![];_0x57b0fa['body'][_0x16e6('0x5a')]=moment()[_0x16e6('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x57b0fa[_0x16e6('0x53')]['UserId']=_0x57b0fa[_0x16e6('0x53')][_0x16e6('0x5c')]||_0x57b0fa['user']['id'];_0x38b966[_0x16e6('0x5d')]['id']=_0x57b0fa[_0x16e6('0x53')][_0x16e6('0x5c')];return db['FaxMessage'][_0x16e6('0x52')]({'where':{'id':_0x57b0fa[_0x16e6('0x54')]['id'],'UserId':null}})[_0x16e6('0x20')](handleEntityNotFound(_0x134f25,null))['then'](saveUpdates(_0x57b0fa[_0x16e6('0x53')],null))[_0x16e6('0x20')](function(_0x3f47a8){if(_0x3f47a8){_0x38b966[_0x16e6('0x29')]=_0x3f47a8['get']({'plain':!![]});return db[_0x16e6('0x5e')][_0x16e6('0x52')]({'where':{'id':_0x3f47a8['FaxInteractionId']}});}return null;})[_0x16e6('0x20')](handleEntityNotFound(_0x134f25,null))[_0x16e6('0x20')](function(_0x4eddb9){if(_0x4eddb9){return _0x4eddb9['update']({'UserId':_0x57b0fa[_0x16e6('0x53')][_0x16e6('0x5c')],'read1stAt':_[_0x16e6('0x5f')](_0x4eddb9['read1stAt'])?moment()[_0x16e6('0x5b')](_0x16e6('0x60')):undefined});}return null;})[_0x16e6('0x20')](function(_0x1f3e95){if(_0x1f3e95){_0x38b966[_0x16e6('0x61')]=_0x1f3e95[_0x16e6('0x62')]({'plain':!![]});interaction_log[_0x16e6('0x21')](_0x16e6('0x63'),_0x57b0fa[_0x16e6('0x64')]['id'],_0x57b0fa[_0x16e6('0x64')]['name'],_0x57b0fa[_0x16e6('0x64')][_0x16e6('0x65')],_0x38b966[_0x16e6('0x61')]['id'],_0x57b0fa[_0x16e6('0x53')]?JSON['stringify'](_0x57b0fa[_0x16e6('0x53')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x38b966);}return null;})[_0x16e6('0x20')](function(_0x149498){var _0x2206fb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x149498[_0x16e6('0x29')][_0x16e6('0x66')];return db[_0x16e6('0x67')]['query'](_0x2206fb,{'type':db[_0x16e6('0x68')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x398b0e){return _0x398b0e;});})[_0x16e6('0x20')](function(_0x2ee2f1){if(_0x2ee2f1){_0x38b966[_0x16e6('0x29')][_0x16e6('0x69')]=_0x2ee2f1[0x0];if(!_0x57b0fa[_0x16e6('0x53')][_0x16e6('0x5c')])return;return db[_0x16e6('0x6a')][_0x16e6('0x52')]({'where':{'id':_0x57b0fa[_0x16e6('0x53')][_0x16e6('0x5c')],'role':_0x16e6('0x5d')},'attributes':['id',_0x16e6('0x38'),'fullname',_0x16e6('0x6b'),_0x16e6('0x6c')],'raw':!![]});}return null;})[_0x16e6('0x20')](function(_0x2ebd8c){if(!_0x2ebd8c)return null;_0x38b966[_0x16e6('0x29')][_0x16e6('0x5d')]=_0x2ebd8c;return _0x38b966;})['then'](function(_0x21acfc){if(_0x21acfc){if(_0x57b0fa[_0x16e6('0x53')][_0x16e6('0x6d')]){_0x38b966['message'][_0x16e6('0x6e')]=util[_0x16e6('0x5b')](_0x16e6('0x6f'),_0x57b0fa[_0x16e6('0x64')]['name']);_0x38b966[_0x16e6('0x29')]['channel']=_0x38b966['channel'];_0x38b966[_0x16e6('0x29')]['motionChannel']=_0x38b966[_0x16e6('0x70')];_0x38b966['message']['event']=_0x16e6('0x57');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x16e6('0x71'),'message':_0x38b966['message']},client9002)['then'](function(){return _0x38b966;});}return _0x38b966;}return null;})[_0x16e6('0x20')](respondWithResult(_0x134f25,null))[_0x16e6('0x2a')](handleError(_0x134f25,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['reject']=function(_0x2b57f4,_0x678643,_0x3f9f60){var _0x4be48b={'agent':{},'channel':_0x16e6('0x58')};if(_0x2b57f4[_0x16e6('0x53')]['id']){delete _0x2b57f4[_0x16e6('0x53')]['id'];}_0x2b57f4[_0x16e6('0x53')][_0x16e6('0x5c')]=_0x2b57f4[_0x16e6('0x53')][_0x16e6('0x5c')]||_0x2b57f4[_0x16e6('0x64')]['id'];_0x4be48b[_0x16e6('0x5d')]['id']=_0x2b57f4[_0x16e6('0x53')][_0x16e6('0x5c')];return db[_0x16e6('0x3c')][_0x16e6('0x52')]({'where':{'id':_0x2b57f4[_0x16e6('0x54')]['id'],'UserId':null}})[_0x16e6('0x20')](handleEntityNotFound(_0x678643,null))[_0x16e6('0x20')](function(_0x39a5dd){if(_0x39a5dd){_0x4be48b[_0x16e6('0x29')]=_0x39a5dd[_0x16e6('0x62')]({'plain':!![]});return db[_0x16e6('0x5e')][_0x16e6('0x52')]({'where':{'id':_0x39a5dd[_0x16e6('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x678643,null))[_0x16e6('0x20')](function(_0x5b8846){if(_0x5b8846){_0x4be48b[_0x16e6('0x61')]=_0x5b8846['get']({'plain':!![]});interaction_log[_0x16e6('0x21')](_0x16e6('0x73'),_0x2b57f4[_0x16e6('0x64')]['id'],_0x2b57f4[_0x16e6('0x64')][_0x16e6('0x38')],_0x2b57f4['user'][_0x16e6('0x65')],_0x4be48b[_0x16e6('0x61')]['id'],_0x2b57f4['body']?JSON['stringify'](_0x2b57f4[_0x16e6('0x53')]):_0x16e6('0x74'));return respondWithRpcPromise(_0x16e6('0x75'),_0x16e6('0x76'),_0x4be48b);}return null;})[_0x16e6('0x20')](function(_0x9bb34c){var _0x1efc9a=_0x16e6('0x77')+_0x9bb34c[_0x16e6('0x29')][_0x16e6('0x66')];return db[_0x16e6('0x67')][_0x16e6('0x41')](_0x1efc9a,{'type':db[_0x16e6('0x68')]['QueryTypes'][_0x16e6('0x78')],'raw':!![]})[_0x16e6('0x20')](function(_0x1a2489){return _0x1a2489;});})[_0x16e6('0x20')](function(_0x2095af){if(_0x2095af){_0x4be48b[_0x16e6('0x29')][_0x16e6('0x69')]=_0x2095af[0x0];if(!_0x2b57f4['body'][_0x16e6('0x5c')])return;return db[_0x16e6('0x6a')][_0x16e6('0x52')]({'where':{'id':_0x2b57f4[_0x16e6('0x53')][_0x16e6('0x5c')],'role':_0x16e6('0x5d')},'attributes':['id','name',_0x16e6('0x79'),_0x16e6('0x6b'),_0x16e6('0x6c')],'raw':!![]});}return null;})[_0x16e6('0x20')](function(_0x283b67){if(!_0x283b67)return null;_0x4be48b[_0x16e6('0x29')][_0x16e6('0x5d')]=_0x283b67;return _0x4be48b;})[_0x16e6('0x20')](function(_0x1b6925){if(_0x1b6925){_0x1b6925[_0x16e6('0x29')][_0x16e6('0x6e')]=util[_0x16e6('0x5b')](_0x16e6('0x6f'),_0x2b57f4[_0x16e6('0x64')][_0x16e6('0x38')]);_0x1b6925[_0x16e6('0x29')]['channel']=_0x4be48b[_0x16e6('0x70')];_0x1b6925[_0x16e6('0x29')]['motionChannel']=_0x4be48b['channel'];_0x1b6925[_0x16e6('0x29')][_0x16e6('0x7a')]=_0x16e6('0x35');respondWithRpcPromise(_0x16e6('0x7b'),'EventManager',{'event':_0x16e6('0x7c'),'message':_0x1b6925[_0x16e6('0x29')]},client9002);return _0x4be48b;}return null;})['then'](respondWithResult(_0x678643,null))[_0x16e6('0x2a')](handleError(_0x678643,null));};exports[_0x16e6('0x7d')]=function(_0x3c5744,_0x3dfe4e){var _0x8eb27f;return db['FaxMessage'][_0x16e6('0x7d')](_0x3c5744[_0x16e6('0x53')],{})['then'](function(_0x284180){_0x8eb27f=_0x284180;return db[_0x16e6('0x7e')][_0x16e6('0x7f')]({'where':{'id':_0x8eb27f[_0x16e6('0x66')]}});})[_0x16e6('0x20')](function(_0x48f7cf){if(_['isNil'](_0x48f7cf)){return;}else{_0x8eb27f[_0x16e6('0x58')]=_0x48f7cf['fax'];return db['Attachment'][_0x16e6('0x7f')]({'where':{'id':_0x8eb27f[_0x16e6('0x80')]}});}})[_0x16e6('0x20')](function(_0x5154bd){return respondWithRpcPromise(_0x16e6('0x81'),_0x16e6('0x81'),{'FaxAccountId':_[_0x16e6('0x5f')](_0x3c5744[_0x16e6('0x53')])?undefined:_0x3c5744[_0x16e6('0x53')][_0x16e6('0x82')],'path':_[_0x16e6('0x5f')](_0x5154bd)?undefined:util[_0x16e6('0x5b')](_0x16e6('0x83'),_0x5154bd[_0x16e6('0x84')]),'fax':_['isNil'](_0x8eb27f[_0x16e6('0x58')])?undefined:_0x8eb27f[_0x16e6('0x58')],'AttachmentId':_0x8eb27f[_0x16e6('0x80')]},client9002);})[_0x16e6('0x20')](respondWithResult(_0x3dfe4e,0xc9))[_0x16e6('0x2a')](handleError(_0x3dfe4e,null));};exports[_0x16e6('0x85')]=function(_0x3e9c78,_0x15ffe1){var _0x4be9e3=path[_0x16e6('0x86')](config[_0x16e6('0x87')],'server',_0x16e6('0x88'),'attachments');return db['FaxMessage'][_0x16e6('0x52')]({'where':{'id':_0x3e9c78[_0x16e6('0x54')]['id']},'include':[{'model':db[_0x16e6('0x89')],'as':_0x16e6('0x89')}]})[_0x16e6('0x20')](handleEntityNotFound(_0x15ffe1,null))[_0x16e6('0x20')](function(_0x39ef64){if(_0x39ef64){return _0x15ffe1['download'](path[_0x16e6('0x86')](_0x4be9e3,_0x39ef64['Attachment'][_0x16e6('0x84')]));}})[_0x16e6('0x2a')](handleError(_0x15ffe1,null));};
\ No newline at end of file
index c6f54bf..4a5a386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f71=['save','emit','hasOwnProperty','hook','exports','events','FaxMessage'];(function(_0x57da8c,_0x13adc5){var _0x408517=function(_0x30e84f){while(--_0x30e84f){_0x57da8c['push'](_0x57da8c['shift']());}};_0x408517(++_0x13adc5);}(_0x5f71,0xc9));var _0x15f7=function(_0x1d2539,_0x15c437){_0x1d2539=_0x1d2539-0x0;var _0x2fdc97=_0x5f71[_0x1d2539];return _0x2fdc97;};'use strict';var EventEmitter=require(_0x15f7('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x15f7('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x15f7('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x510b60){return function(_0x3a9fe1,_0x3fa535,_0x5593f3){FaxMessageEvents[_0x15f7('0x3')](_0x510b60+':'+_0x3a9fe1['id'],_0x3a9fe1);FaxMessageEvents[_0x15f7('0x3')](_0x510b60,_0x3a9fe1);_0x5593f3(null);};}for(var e in events){if(events[_0x15f7('0x4')](e)){var event=events[e];FaxMessage[_0x15f7('0x5')](e,emitEvent(event));}}module[_0x15f7('0x6')]=FaxMessageEvents;
\ No newline at end of file
+var _0xc5c8=['events','../../mysqldb','FaxMessage','save','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5c8,0x118));var _0x8c5c=function(_0x4324d9,_0x5cd2de){_0x4324d9=_0x4324d9-0x0;var _0x5c66f9=_0xc5c8[_0x4324d9];return _0x5c66f9;};'use strict';var EventEmitter=require(_0x8c5c('0x0'));var FaxMessage=require(_0x8c5c('0x1'))['db'][_0x8c5c('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c5c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xf33a8e){return function(_0x210e70,_0x56f1db,_0x302b48){FaxMessageEvents[_0x8c5c('0x4')](_0xf33a8e+':'+_0x210e70['id'],_0x210e70);FaxMessageEvents[_0x8c5c('0x4')](_0xf33a8e,_0x210e70);_0x302b48(null);};}for(var e in events){if(events[_0x8c5c('0x5')](e)){var event=events[e];FaxMessage[_0x8c5c('0x6')](e,emitEvent(event));}}module[_0x8c5c('0x7')]=FaxMessageEvents;
\ No newline at end of file
index ab4f077..f0e9e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d57=['../../config/environment','exports','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','direction','toLowerCase','secret','UserId','FaxInteractionId','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9d57,0xeb));var _0x79d5=function(_0x19e0c7,_0x8c57f){_0x19e0c7=_0x19e0c7-0x0;var _0x1fd31=_0x9d57[_0x19e0c7];return _0x1fd31;};'use strict';var _=require(_0x79d5('0x0'));var util=require(_0x79d5('0x1'));var logger=require(_0x79d5('0x2'))(_0x79d5('0x3'));var moment=require(_0x79d5('0x4'));var BPromise=require(_0x79d5('0x5'));var rp=require(_0x79d5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x79d5('0x7'));var attributes=require('./faxMessage.attributes');module[_0x79d5('0x8')]=function(_0x477bd5,_0x13dbd1){return _0x477bd5['define'](_0x79d5('0x9'),attributes,{'tableName':_0x79d5('0xa'),'paranoid':![],'indexes':[{'name':_0x79d5('0xb'),'fields':['body'],'type':_0x79d5('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x359658,_0x454d74,_0x2e1867){var _0x178bff=_0x477bd5[_0x79d5('0xd')];var _0x233a0a=_0x359658['get']({'plain':!![]});if(_0x233a0a['direction']['toLowerCase']()==='in'||_0x233a0a[_0x79d5('0xe')][_0x79d5('0xf')]()==='out'&&!_0x233a0a[_0x79d5('0x10')]&&!_['isNil'](_0x233a0a[_0x79d5('0x11')])){_0x178bff['FaxInteraction']['findOne']({'where':{'id':_0x233a0a[_0x79d5('0x12')]}})[_0x79d5('0x13')](function(_0x7de113){if(_0x7de113){_0x7de113['update']({'lastMsgAt':_0x233a0a['createdAt'],'lastMsgDirection':_0x233a0a['direction']['toLowerCase']()});}})[_0x79d5('0x14')](function(_0x3feffd){console['error'](_0x3feffd);});}_0x2e1867();}},'charset':_0x79d5('0x15'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6208=['FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x14fa70,_0x35a394){var _0x360f0d=function(_0x130fa1){while(--_0x130fa1){_0x14fa70['push'](_0x14fa70['shift']());}};_0x360f0d(++_0x35a394);}(_0x6208,0xf0));var _0x8620=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x6208[_0xa990b7];return _0x52c99c;};'use strict';var _=require(_0x8620('0x0'));var util=require(_0x8620('0x1'));var logger=require(_0x8620('0x2'))(_0x8620('0x3'));var moment=require(_0x8620('0x4'));var BPromise=require(_0x8620('0x5'));var rp=require(_0x8620('0x6'));var fs=require('fs');var path=require(_0x8620('0x7'));var rimraf=require(_0x8620('0x8'));var config=require('../../config/environment');var attributes=require(_0x8620('0x9'));module[_0x8620('0xa')]=function(_0x1195e8,_0xadbf45){return _0x1195e8['define'](_0x8620('0xb'),attributes,{'tableName':_0x8620('0xc'),'paranoid':![],'indexes':[{'name':_0x8620('0xd'),'fields':[_0x8620('0xe')],'type':_0x8620('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50c507,_0x559f95,_0x4bdc7c){var _0xe026a8=_0x1195e8[_0x8620('0x10')];var _0x5b5e86=_0x50c507[_0x8620('0x11')]({'plain':!![]});if(_0x5b5e86['direction'][_0x8620('0x12')]()==='in'||_0x5b5e86[_0x8620('0x13')][_0x8620('0x12')]()===_0x8620('0x14')&&!_0x5b5e86[_0x8620('0x15')]&&!_[_0x8620('0x16')](_0x5b5e86[_0x8620('0x17')])){_0xe026a8[_0x8620('0x18')][_0x8620('0x19')]({'where':{'id':_0x5b5e86[_0x8620('0x1a')]}})[_0x8620('0x1b')](function(_0x198a16){if(_0x198a16){_0x198a16[_0x8620('0x1c')]({'lastMsgAt':_0x5b5e86['createdAt'],'lastMsgDirection':_0x5b5e86[_0x8620('0x13')]['toLowerCase']()});}})[_0x8620('0x1d')](function(_0x135f43){console[_0x8620('0x1e')](_0x135f43);});}_0x4bdc7c();}},'charset':_0x8620('0x1f'),'collate':_0x8620('0x20')});};
\ No newline at end of file
index be100fa..7b1365c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x2db6e0,_0x48e33d){var _0x42e88f=function(_0x2cbb76){while(--_0x2cbb76){_0x2db6e0['push'](_0x2db6e0['shift']());}};_0x42e88f(++_0x48e33d);}(_0x9f62,0x154));var _0x29f6=function(_0x295723,_0x1d869d){_0x295723=_0x295723-0x0;var _0x505fe6=_0x9f62[_0x295723];return _0x505fe6;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});};
\ No newline at end of file
+var _0x207c=['result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message'];(function(_0xdeaf15,_0x2b0bc6){var _0x5ddf24=function(_0x555aab){while(--_0x555aab){_0xdeaf15['push'](_0xdeaf15['shift']());}};_0x5ddf24(++_0x2b0bc6);}(_0x207c,0x1e8));var _0xc207=function(_0x4baae3,_0x5f0235){_0x4baae3=_0x4baae3-0x0;var _0x454819=_0x207c[_0x4baae3];return _0x454819;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});config[_0xc207('0x9')]=_[_0xc207('0xa')](config['redis'],{'host':_0xc207('0xb'),'port':0x18eb});var socket=require(_0xc207('0xc'))(new Redis(config[_0xc207('0x9')]));require('./faxMessage.socket')[_0xc207('0xd')](socket);function respondWithRpcPromise(_0x817576,_0x216e14,_0x13ec41){return new BPromise(function(_0x201162,_0x347549){return client['request'](_0x817576,_0x13ec41)['then'](function(_0x5b556f){logger[_0xc207('0xe')]('FaxMessage,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'));logger[_0xc207('0x10')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'),JSON[_0xc207('0x11')](_0x5b556f));if(_0x5b556f[_0xc207('0x12')]){if(_0x5b556f[_0xc207('0x12')][_0xc207('0x13')]===0x1f4){logger['error'](_0xc207('0x14'),_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x347549(_0x5b556f[_0xc207('0x12')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x201162(_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);}else{logger['info'](_0xc207('0x14'),_0x216e14,_0xc207('0xf'));_0x201162(_0x5b556f[_0xc207('0x16')]['message']);}})[_0xc207('0x17')](function(_0x488cc0){logger[_0xc207('0x12')](_0xc207('0x14'),_0x216e14,_0x488cc0);_0x347549(_0x488cc0);});});}exports[_0xc207('0x18')]=function(_0x461f6a){var _0xce0770=this;return new Promise(function(_0x2caec5,_0x35c0b0){return db[_0xc207('0x19')][_0xc207('0x1a')](_0x461f6a[_0xc207('0x1b')],{'raw':_0x461f6a[_0xc207('0x1c')]?_0x461f6a[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x163b36){logger['info'](_0xc207('0x18'),_0x461f6a);logger[_0xc207('0x10')](_0xc207('0x18'),_0x461f6a,JSON[_0xc207('0x11')](_0x163b36));_0x2caec5(_0x163b36);})[_0xc207('0x17')](function(_0xd209ac){logger[_0xc207('0x12')](_0xc207('0x18'),_0xd209ac[_0xc207('0x15')],_0x461f6a);_0x35c0b0(_0xce0770[_0xc207('0x12')](0x1f4,_0xd209ac[_0xc207('0x15')]));});});};exports[_0xc207('0x1e')]=function(_0x3f738e){var _0x138970=this;return new Promise(function(_0x1445d3,_0x56a066){return db[_0xc207('0x19')]['update'](_0x3f738e['body'],{'raw':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')]['where']||null:null,'attributes':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1f')]||null:null,'limit':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x20')]||null:null})[_0xc207('0x21')](function(_0x27bc72){logger[_0xc207('0xe')](_0xc207('0x1e'),_0x3f738e);logger[_0xc207('0x10')](_0xc207('0x1e'),_0x3f738e,JSON[_0xc207('0x11')](_0x27bc72));_0x1445d3(_0x27bc72);})['catch'](function(_0x1cc799){logger[_0xc207('0x12')](_0xc207('0x1e'),_0x1cc799[_0xc207('0x15')],_0x3f738e);_0x56a066(_0x138970[_0xc207('0x12')](0x1f4,_0x1cc799[_0xc207('0x15')]));});});};
\ No newline at end of file
index a1bca3d..1f3cc62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd90=['faxMessage:','save','remove','update','emit','removeListener','register','length'];(function(_0x208a88,_0x1ab574){var _0x2b83a8=function(_0x57c955){while(--_0x57c955){_0x208a88['push'](_0x208a88['shift']());}};_0x2b83a8(++_0x1ab574);}(_0xfd90,0x121));var _0x0fd9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfd90[_0x20a584];return _0x4b41a8;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x0fd9('0x0'),_0x0fd9('0x1'),_0x0fd9('0x2')];function createListener(_0x3020ff,_0x743fad){return function(_0x27e966){_0x743fad[_0x0fd9('0x3')](_0x3020ff,_0x27e966);};}function removeListener(_0x22c332,_0x42e260){return function(){FaxMessageEvents[_0x0fd9('0x4')](_0x22c332,_0x42e260);};}exports[_0x0fd9('0x5')]=function(_0x29ed3f){for(var _0x4a183c=0x0,_0x7fe44a=events[_0x0fd9('0x6')];_0x4a183c<_0x7fe44a;_0x4a183c++){var _0x35157d=events[_0x4a183c];var _0x1c911b=createListener(_0x0fd9('0x7')+_0x35157d,_0x29ed3f);FaxMessageEvents['on'](_0x35157d,_0x1c911b);}};
\ No newline at end of file
+var _0xcb89=['length','faxMessage:','./faxMessage.events','remove','update','emit','removeListener','register'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xcb89,0x122));var _0x9cb8=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xcb89[_0x51020b];return _0x371e47;};'use strict';var FaxMessageEvents=require(_0x9cb8('0x0'));var events=['save',_0x9cb8('0x1'),_0x9cb8('0x2')];function createListener(_0x1cfb56,_0xe1e457){return function(_0x2389e0){_0xe1e457[_0x9cb8('0x3')](_0x1cfb56,_0x2389e0);};}function removeListener(_0xf54990,_0xa2401d){return function(){FaxMessageEvents[_0x9cb8('0x4')](_0xf54990,_0xa2401d);};}exports[_0x9cb8('0x5')]=function(_0x67f12f){for(var _0x5dcb88=0x0,_0x379ed5=events[_0x9cb8('0x6')];_0x5dcb88<_0x379ed5;_0x5dcb88++){var _0x4c1fa4=events[_0x5dcb88];var _0x3a31cf=createListener(_0x9cb8('0x7')+_0x4c1fa4,_0x67f12f);FaxMessageEvents['on'](_0x4c1fa4,_0x3a31cf);}};
\ No newline at end of file
index 741f042..e72cd34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f68=['/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept'];(function(_0x373db9,_0x5819cd){var _0x3b423f=function(_0x1256cc){while(--_0x1256cc){_0x373db9['push'](_0x373db9['shift']());}};_0x3b423f(++_0x5819cd);}(_0x2f68,0x9a));var _0x82f6=function(_0x1f3c70,_0x527dc9){_0x1f3c70=_0x1f3c70-0x0;var _0x1ca994=_0x2f68[_0x1f3c70];return _0x1ca994;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./faxMessage.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),interaction[_0x82f6('0xe')](_0x82f6('0xf'),_0x82f6('0x10')),controller['create']);router[_0x82f6('0x11')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x12')]);router[_0x82f6('0x11')](_0x82f6('0x13'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x14')]);router[_0x82f6('0x11')](_0x82f6('0x15'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x16')]);router['delete'](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x17')]);module[_0x82f6('0x18')]=router;
\ No newline at end of file
+var _0xf290=['/:id','show','/:id/download','download','post','fax','create','put','update','accept','/:id/reject','reject','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x439a6a,_0x318c65){var _0x58111d=function(_0x28c5a4){while(--_0x28c5a4){_0x439a6a['push'](_0x439a6a['shift']());}};_0x58111d(++_0x318c65);}(_0xf290,0xde));var _0x0f29=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xf290[_0x31b5b2];return _0x364f13;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var fs_extra=require(_0x0f29('0x3'));var auth=require(_0x0f29('0x4'));var interaction=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var controller=require('./faxMessage.controller');router[_0x0f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f29('0x8')]);router[_0x0f29('0x7')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xb')]);router[_0x0f29('0x7')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xd')]);router[_0x0f29('0x7')](_0x0f29('0xe'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xf')]);router[_0x0f29('0x10')]('/',auth[_0x0f29('0xa')](),interaction['tracked'](_0x0f29('0x11'),'faxmessage:create'),controller[_0x0f29('0x12')]);router[_0x0f29('0x13')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x14')]);router[_0x0f29('0x13')]('/:id/accept',auth[_0x0f29('0xa')](),controller[_0x0f29('0x15')]);router[_0x0f29('0x13')](_0x0f29('0x16'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x17')]);router[_0x0f29('0x18')](_0x0f29('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0f29('0x19')]=router;
\ No newline at end of file
index f554bc5..a735be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ea8=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x5e67d8,_0x248cb8){var _0x58de85=function(_0x18f694){while(--_0x18f694){_0x5e67d8['push'](_0x5e67d8['shift']());}};_0x58de85(++_0x248cb8);}(_0x8ea8,0x193));var _0x88ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x88ea('0x0')]={'name':{'type':Sequelize[_0x88ea('0x1')],'unique':_0x88ea('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x88ea('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x88ea('0x4')](_0x88ea('0x5'),_0x88ea('0x6'),_0x88ea('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x88ea('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8303=['beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x3f9dd9,_0x5d17c8){var _0x235dbe=function(_0x505759){while(--_0x505759){_0x3f9dd9['push'](_0x3f9dd9['shift']());}};_0x235dbe(++_0x5d17c8);}(_0x8303,0xaa));var _0x3830=function(_0x287cd7,_0xcd2ee3){_0x287cd7=_0x287cd7-0x0;var _0x44d7f8=_0x8303[_0x287cd7];return _0x44d7f8;};'use strict';var Sequelize=require(_0x3830('0x0'));module['exports']={'name':{'type':Sequelize[_0x3830('0x1')],'unique':_0x3830('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3830('0x1')]},'timeout':{'type':Sequelize[_0x3830('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3830('0x4')](_0x3830('0x5'),_0x3830('0x6'),_0x3830('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3830('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index a4c11f6..4fa62c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d81=['length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','getMembers','UserFaxQueue','order','FaxQueueId','findAndCountAll','agent','faxPause','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','removeAgents','forEach','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','offset','limit','set','Content-Range','reject','then','destroy','get','FaxQueues','UserProfileResource','end','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x264d1d,_0x2f6b54){var _0x1fe1e8=function(_0x4f3d98){while(--_0x4f3d98){_0x264d1d['push'](_0x264d1d['shift']());}};_0x1fe1e8(++_0x2f6b54);}(_0x4d81,0x175));var _0x14d8=function(_0x2e9452,_0x3188a9){_0x2e9452=_0x2e9452-0x0;var _0x36a8da=_0x4d81[_0x2e9452];return _0x36a8da;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x14d8('0x0'));var jsonpatch=require(_0x14d8('0x1'));var rp=require('request-promise');var moment=require(_0x14d8('0x2'));var BPromise=require(_0x14d8('0x3'));var Mustache=require(_0x14d8('0x4'));var util=require(_0x14d8('0x5'));var path=require(_0x14d8('0x6'));var sox=require(_0x14d8('0x7'));var csv=require(_0x14d8('0x8'));var ejs=require(_0x14d8('0x9'));var fs=require('fs');var fs_extra=require(_0x14d8('0xa'));var _=require(_0x14d8('0xb'));var squel=require('squel');var crypto=require(_0x14d8('0xc'));var jsforce=require(_0x14d8('0xd'));var deskjs=require(_0x14d8('0xe'));var toCsv=require(_0x14d8('0x8'));var querystring=require(_0x14d8('0xf'));var Papa=require(_0x14d8('0x10'));var Redis=require(_0x14d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14d8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14d8('0x13'));var logger=require(_0x14d8('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x14d8('0x15'));var licenseUtil=require(_0x14d8('0x16'));var db=require('../../mysqldb')['db'];config[_0x14d8('0x17')]=_[_0x14d8('0x18')](config[_0x14d8('0x17')],{'host':_0x14d8('0x19'),'port':0x18eb});var socket=require(_0x14d8('0x1a'))(new Redis(config[_0x14d8('0x17')]));require(_0x14d8('0x1b'))[_0x14d8('0x1c')](socket);function respondWithStatusCode(_0x58bb55,_0x4262db){_0x4262db=_0x4262db||0xcc;return function(_0x3b40e0){if(_0x3b40e0){return _0x58bb55[_0x14d8('0x1d')](_0x4262db);}return _0x58bb55['status'](_0x4262db)['end']();};}function respondWithResult(_0x879d97,_0x4ae233){_0x4ae233=_0x4ae233||0xc8;return function(_0x1d577f){if(_0x1d577f){return _0x879d97[_0x14d8('0x1e')](_0x4ae233)[_0x14d8('0x1f')](_0x1d577f);}};}function respondWithFilteredResult(_0x2ad3a1,_0x166e2c){return function(_0x4ea156){if(_0x4ea156){var _0x39c453=typeof _0x166e2c['offset']===_0x14d8('0x20')&&typeof _0x166e2c['limit']===_0x14d8('0x20');var _0x2d6385=_0x4ea156['count'];var _0x471761=_0x39c453?0x0:_0x166e2c[_0x14d8('0x21')];var _0x56b93b=_0x39c453?_0x4ea156['count']:_0x166e2c[_0x14d8('0x21')]+_0x166e2c[_0x14d8('0x22')];var _0x4e1723;if(_0x56b93b>=_0x2d6385){_0x56b93b=_0x2d6385;_0x4e1723=0xc8;}else{_0x4e1723=0xce;}_0x2ad3a1[_0x14d8('0x1e')](_0x4e1723);return _0x2ad3a1[_0x14d8('0x23')](_0x14d8('0x24'),_0x471761+'-'+_0x56b93b+'/'+_0x2d6385)[_0x14d8('0x1f')](_0x4ea156);}return null;};}function patchUpdates(_0x59d32c){return function(_0x2993ce){try{jsonpatch['apply'](_0x2993ce,_0x59d32c,!![]);}catch(_0x12a9fe){return BPromise[_0x14d8('0x25')](_0x12a9fe);}return _0x2993ce['save']();};}function saveUpdates(_0x9c0fbd,_0xa032c1){return function(_0x2e140f){if(_0x2e140f){return _0x2e140f['update'](_0x9c0fbd)[_0x14d8('0x26')](function(_0x253d0d){return _0x253d0d;});}return null;};}function removeEntity(_0x19361f,_0x23df79){return function(_0x260f6f){if(_0x260f6f){return _0x260f6f[_0x14d8('0x27')]()[_0x14d8('0x26')](function(){var _0x2cdc4f=_0x260f6f[_0x14d8('0x28')]({'plain':!![]});var _0xb02ba1=_0x14d8('0x29');return db[_0x14d8('0x2a')][_0x14d8('0x27')]({'where':{'type':_0xb02ba1,'resourceId':_0x2cdc4f['id']}})[_0x14d8('0x26')](function(){return _0x260f6f;});})[_0x14d8('0x26')](function(){_0x19361f[_0x14d8('0x1e')](0xcc)[_0x14d8('0x2b')]();});}};}function handleEntityNotFound(_0x334b8f,_0x4a622a){return function(_0x3dd07f){if(!_0x3dd07f){_0x334b8f[_0x14d8('0x1d')](0x194);}return _0x3dd07f;};}function handleError(_0x11552a,_0x44ea92){_0x44ea92=_0x44ea92||0x1f4;return function(_0x4f6dcd){logger[_0x14d8('0x2c')](_0x4f6dcd[_0x14d8('0x2d')]);if(_0x4f6dcd[_0x14d8('0x2e')]){delete _0x4f6dcd['name'];}_0x11552a['status'](_0x44ea92)[_0x14d8('0x2f')](_0x4f6dcd);};}exports[_0x14d8('0x30')]=function(_0xacc490,_0x268771){var _0x173bb7={},_0x3ac318={},_0x27c9b4={'count':0x0,'rows':[]};var _0x2ae0de=_[_0x14d8('0x31')](db[_0x14d8('0x32')][_0x14d8('0x33')],function(_0x29156){return{'name':_0x29156[_0x14d8('0x34')],'type':_0x29156[_0x14d8('0x35')][_0x14d8('0x36')]};});_0x3ac318[_0x14d8('0x37')]=_[_0x14d8('0x31')](_0x2ae0de,_0x14d8('0x2e'));_0x3ac318[_0x14d8('0x38')]=_[_0x14d8('0x39')](_0xacc490['query']);_0x3ac318[_0x14d8('0x3a')]=_[_0x14d8('0x3b')](_0x3ac318['model'],_0x3ac318[_0x14d8('0x38')]);_0x173bb7[_0x14d8('0x3c')]=_[_0x14d8('0x3b')](_0x3ac318[_0x14d8('0x37')],qs[_0x14d8('0x3d')](_0xacc490[_0x14d8('0x38')][_0x14d8('0x3d')]));_0x173bb7['attributes']=_0x173bb7[_0x14d8('0x3c')][_0x14d8('0x3e')]?_0x173bb7[_0x14d8('0x3c')]:_0x3ac318['model'];if(!_0xacc490[_0x14d8('0x38')]['hasOwnProperty'](_0x14d8('0x3f'))){_0x173bb7['limit']=qs[_0x14d8('0x22')](_0xacc490[_0x14d8('0x38')][_0x14d8('0x22')]);_0x173bb7[_0x14d8('0x21')]=qs[_0x14d8('0x21')](_0xacc490['query'][_0x14d8('0x21')]);}_0x173bb7['order']=qs[_0x14d8('0x40')](_0xacc490['query']['sort']);_0x173bb7[_0x14d8('0x41')]=qs[_0x14d8('0x3a')](_[_0x14d8('0x42')](_0xacc490['query'],_0x3ac318[_0x14d8('0x3a')]),_0x2ae0de);if(_0xacc490[_0x14d8('0x38')][_0x14d8('0x43')]){_0x173bb7[_0x14d8('0x41')]=_[_0x14d8('0x44')](_0x173bb7['where'],{'$or':_[_0x14d8('0x31')](_0x2ae0de,function(_0x31e4e3){if(_0x31e4e3[_0x14d8('0x35')]!==_0x14d8('0x45')){var _0x27d883={};_0x27d883[_0x31e4e3[_0x14d8('0x2e')]]={'$like':'%'+_0xacc490[_0x14d8('0x38')][_0x14d8('0x43')]+'%'};return _0x27d883;}})});}_0x173bb7=_[_0x14d8('0x44')]({},_0x173bb7,_0xacc490[_0x14d8('0x46')]);var _0x579f47={'where':_0x173bb7[_0x14d8('0x41')]};return db[_0x14d8('0x32')]['count'](_0x579f47)[_0x14d8('0x26')](function(_0x133355){_0x27c9b4[_0x14d8('0x47')]=_0x133355;if(_0xacc490[_0x14d8('0x38')][_0x14d8('0x48')]){_0x173bb7[_0x14d8('0x49')]=[{'all':!![]}];}return db[_0x14d8('0x32')][_0x14d8('0x4a')](_0x173bb7);})[_0x14d8('0x26')](function(_0x5e8319){_0x27c9b4[_0x14d8('0x4b')]=_0x5e8319;return _0x27c9b4;})[_0x14d8('0x26')](respondWithFilteredResult(_0x268771,_0x173bb7))[_0x14d8('0x4c')](handleError(_0x268771,null));};exports[_0x14d8('0x4d')]=function(_0x1f9c5e,_0xeb049c){var _0x407402={'raw':!![],'where':{'id':_0x1f9c5e[_0x14d8('0x4e')]['id']}},_0x7b0c77={};_0x7b0c77[_0x14d8('0x37')]=_['keys'](db[_0x14d8('0x32')][_0x14d8('0x33')]);_0x7b0c77[_0x14d8('0x38')]=_[_0x14d8('0x39')](_0x1f9c5e[_0x14d8('0x38')]);_0x7b0c77[_0x14d8('0x3a')]=_['intersection'](_0x7b0c77[_0x14d8('0x37')],_0x7b0c77[_0x14d8('0x38')]);_0x407402[_0x14d8('0x3c')]=_[_0x14d8('0x3b')](_0x7b0c77['model'],qs[_0x14d8('0x3d')](_0x1f9c5e[_0x14d8('0x38')][_0x14d8('0x3d')]));_0x407402[_0x14d8('0x3c')]=_0x407402[_0x14d8('0x3c')]['length']?_0x407402['attributes']:_0x7b0c77[_0x14d8('0x37')];if(_0x1f9c5e[_0x14d8('0x38')][_0x14d8('0x48')]){_0x407402[_0x14d8('0x49')]=[{'all':!![]}];}_0x407402=_['merge']({},_0x407402,_0x1f9c5e[_0x14d8('0x46')]);return db[_0x14d8('0x32')][_0x14d8('0x4f')](_0x407402)[_0x14d8('0x26')](handleEntityNotFound(_0xeb049c,null))[_0x14d8('0x26')](respondWithResult(_0xeb049c,null))[_0x14d8('0x4c')](handleError(_0xeb049c,null));};exports[_0x14d8('0x50')]=function(_0x1196db,_0x29c0af){return db[_0x14d8('0x32')]['create'](_0x1196db['body'],{})[_0x14d8('0x26')](function(_0x195959){var _0x57bbdc=_0x1196db[_0x14d8('0x51')][_0x14d8('0x28')]({'plain':!![]});if(!_0x57bbdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57bbdc[_0x14d8('0x52')]===_0x14d8('0x51')){var _0x309f15=_0x195959['get']({'plain':!![]});var _0x82dfb8=_0x14d8('0x29');return db[_0x14d8('0x53')][_0x14d8('0x4f')]({'where':{'name':_0x82dfb8,'userProfileId':_0x57bbdc[_0x14d8('0x54')]},'raw':!![]})['then'](function(_0x9ebe9e){if(_0x9ebe9e&&_0x9ebe9e[_0x14d8('0x55')]===0x0){return db['UserProfileResource'][_0x14d8('0x50')]({'name':_0x309f15[_0x14d8('0x2e')],'resourceId':_0x309f15['id'],'type':_0x9ebe9e['name'],'sectionId':_0x9ebe9e['id']},{})[_0x14d8('0x26')](function(){return _0x195959;});}else{return _0x195959;}})[_0x14d8('0x4c')](function(_0x3ab182){logger[_0x14d8('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ab182);throw _0x3ab182;});}return _0x195959;})['then'](respondWithResult(_0x29c0af,0xc9))[_0x14d8('0x4c')](handleError(_0x29c0af,null));};exports[_0x14d8('0x56')]=function(_0x32d3aa,_0x47c8a5){if(_0x32d3aa['body']['id']){delete _0x32d3aa[_0x14d8('0x57')]['id'];}return db[_0x14d8('0x32')][_0x14d8('0x4f')]({'where':{'id':_0x32d3aa['params']['id']}})['then'](handleEntityNotFound(_0x47c8a5,null))['then'](saveUpdates(_0x32d3aa[_0x14d8('0x57')],null))[_0x14d8('0x26')](respondWithResult(_0x47c8a5,null))[_0x14d8('0x4c')](handleError(_0x47c8a5,null));};exports[_0x14d8('0x27')]=function(_0x1ba5e5,_0x5b838c){return db[_0x14d8('0x32')][_0x14d8('0x4f')]({'where':{'id':_0x1ba5e5[_0x14d8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5b838c,null))[_0x14d8('0x26')](removeEntity(_0x5b838c,null))[_0x14d8('0x4c')](handleError(_0x5b838c,null));};exports[_0x14d8('0x58')]=function(_0x10f72a,_0x260101){return db[_0x14d8('0x32')][_0x14d8('0x58')]()[_0x14d8('0x26')](respondWithResult(_0x260101,null))['catch'](handleError(_0x260101,null));};exports[_0x14d8('0x59')]=function(_0x22bfae,_0x230c3a,_0x2b403c){var _0x453c98={'raw':!![],'where':{}},_0x3eed18={},_0x544f15;return db[_0x14d8('0x32')]['findOne']({'where':{'id':_0x22bfae['params']['id']}})[_0x14d8('0x26')](handleEntityNotFound(_0x230c3a,null))[_0x14d8('0x26')](function(_0x441faf){if(_0x441faf){_0x544f15=_0x441faf[_0x14d8('0x28')]({'plain':!![]});_0x3eed18[_0x14d8('0x37')]=_[_0x14d8('0x39')](db[_0x14d8('0x5a')][_0x14d8('0x33')]);_0x3eed18[_0x14d8('0x38')]=_[_0x14d8('0x39')](_0x22bfae[_0x14d8('0x38')]);_0x3eed18[_0x14d8('0x3a')]=_[_0x14d8('0x3b')](_0x3eed18[_0x14d8('0x37')],_0x3eed18[_0x14d8('0x38')]);_0x453c98['attributes']=_[_0x14d8('0x3b')](_0x3eed18['model'],qs[_0x14d8('0x3d')](_0x22bfae[_0x14d8('0x38')][_0x14d8('0x3d')]));_0x453c98[_0x14d8('0x3c')]=_0x453c98[_0x14d8('0x3c')][_0x14d8('0x3e')]?_0x453c98[_0x14d8('0x3c')]:_0x3eed18[_0x14d8('0x37')];if(!_0x22bfae[_0x14d8('0x38')]['hasOwnProperty'](_0x14d8('0x3f'))){_0x453c98[_0x14d8('0x22')]=qs['limit'](_0x22bfae[_0x14d8('0x38')][_0x14d8('0x22')]);_0x453c98[_0x14d8('0x21')]=qs[_0x14d8('0x21')](_0x22bfae[_0x14d8('0x38')]['offset']);}_0x453c98[_0x14d8('0x5b')]=qs[_0x14d8('0x40')](_0x22bfae[_0x14d8('0x38')][_0x14d8('0x40')]);_0x453c98[_0x14d8('0x41')]=qs[_0x14d8('0x3a')](_['pick'](_0x22bfae[_0x14d8('0x38')],_0x3eed18[_0x14d8('0x3a')]));_0x453c98['where'][_0x14d8('0x5c')]=_0x441faf['id'];if(_0x22bfae[_0x14d8('0x38')][_0x14d8('0x43')]){_0x453c98[_0x14d8('0x41')]=_['merge'](_0x453c98[_0x14d8('0x41')],{'$or':_[_0x14d8('0x31')](_0x453c98[_0x14d8('0x3c')],function(_0x3b05d1){var _0x1e48a0={};_0x1e48a0[_0x3b05d1]={'$like':'%'+_0x22bfae['query']['filter']+'%'};return _0x1e48a0;})});}_0x453c98=_['merge']({},_0x453c98,_0x22bfae[_0x14d8('0x46')]);return db['UserFaxQueue'][_0x14d8('0x4a')](_0x453c98);}})[_0x14d8('0x26')](function(_0x1fb8d7){if(_0x1fb8d7){return db['User'][_0x14d8('0x5d')]({'where':{'id':_[_0x14d8('0x31')](_0x1fb8d7,'UserId'),'role':_0x14d8('0x5e')},'attributes':['id',_0x14d8('0x2e'),_0x14d8('0x5f'),'updatedAt',_0x14d8('0x60')]});}})[_0x14d8('0x26')](function(_0x78e4b3){if(_0x78e4b3){return{'count':_0x78e4b3[_0x14d8('0x47')],'rows':_['map'](_0x78e4b3[_0x14d8('0x4b')],function(_0x4e7566){return{'membername':_0x4e7566['name'],'UserId':_0x4e7566['id'],'queue_name':_0x544f15[_0x14d8('0x2e')],'FaxQueueId':_0x544f15['id'],'interface':util[_0x14d8('0x61')](_0x14d8('0x62'),_0x14d8('0x63'),_0x4e7566[_0x14d8('0x2e')]),'penalty':0x0,'paused':_0x4e7566[_0x14d8('0x5f')],'createdAt':_0x4e7566[_0x14d8('0x60')],'updatedAt':_0x4e7566['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x14d8('0x26')](respondWithFilteredResult(_0x230c3a,_0x453c98))[_0x14d8('0x4c')](handleError(_0x230c3a,null));};exports[_0x14d8('0x64')]=function(_0x528789,_0x1da0b4,_0x34d6eb){var _0x94fdac={};var _0x25555f={};var _0x23dfbb;var _0x51f8a1;return db[_0x14d8('0x32')][_0x14d8('0x65')]({'where':{'id':_0x528789[_0x14d8('0x4e')]['id']}})[_0x14d8('0x26')](handleEntityNotFound(_0x1da0b4,null))[_0x14d8('0x26')](function(_0x27e7e4){if(_0x27e7e4){_0x23dfbb=_0x27e7e4;_0x25555f['model']=_[_0x14d8('0x39')](db[_0x14d8('0x66')][_0x14d8('0x33')]);_0x25555f[_0x14d8('0x38')]=_[_0x14d8('0x39')](_0x528789[_0x14d8('0x38')]);_0x25555f[_0x14d8('0x3a')]=_['intersection'](_0x25555f[_0x14d8('0x37')],_0x25555f[_0x14d8('0x38')]);_0x94fdac[_0x14d8('0x3c')]=_['intersection'](_0x25555f[_0x14d8('0x37')],qs[_0x14d8('0x3d')](_0x528789['query'][_0x14d8('0x3d')]));_0x94fdac[_0x14d8('0x3c')]=_0x94fdac['attributes']['length']?_0x94fdac[_0x14d8('0x3c')]:_0x25555f[_0x14d8('0x37')];_0x94fdac['order']=qs[_0x14d8('0x40')](_0x528789[_0x14d8('0x38')][_0x14d8('0x40')]);_0x94fdac[_0x14d8('0x41')]=qs['filters'](_[_0x14d8('0x42')](_0x528789[_0x14d8('0x38')],_0x25555f[_0x14d8('0x3a')]));if(_0x528789[_0x14d8('0x38')]['filter']){_0x94fdac['where']=_[_0x14d8('0x44')](_0x94fdac[_0x14d8('0x41')],{'$or':_[_0x14d8('0x31')](_0x94fdac[_0x14d8('0x3c')],function(_0x3311d7){var _0x522f6c={};_0x522f6c[_0x3311d7]={'$like':'%'+_0x528789[_0x14d8('0x38')][_0x14d8('0x43')]+'%'};return _0x522f6c;})});}_0x94fdac=_[_0x14d8('0x44')]({},_0x94fdac,_0x528789[_0x14d8('0x46')]);return _0x23dfbb[_0x14d8('0x64')](_0x94fdac);}})['then'](function(_0x21638f){if(_0x21638f){_0x51f8a1=_0x21638f[_0x14d8('0x3e')];if(!_0x528789['query']['hasOwnProperty'](_0x14d8('0x3f'))){_0x94fdac['limit']=qs['limit'](_0x528789[_0x14d8('0x38')]['limit']);_0x94fdac[_0x14d8('0x21')]=qs['offset'](_0x528789['query'][_0x14d8('0x21')]);}return _0x23dfbb['getTeams'](_0x94fdac);}})[_0x14d8('0x26')](function(_0x329ca8){if(_0x329ca8){return _0x329ca8?{'count':_0x51f8a1,'rows':_0x329ca8}:null;}})['then'](respondWithResult(_0x1da0b4,null))['catch'](handleError(_0x1da0b4,null));};exports[_0x14d8('0x67')]=function(_0x3c4eec,_0x4da6f4,_0x25f4cd){var _0x3e507b=_0x3c4eec[_0x14d8('0x57')][_0x14d8('0x68')];return db[_0x14d8('0x66')]['findAll']({'where':{'id':_0x3e507b},'attributes':['id'],'include':[{'model':db[_0x14d8('0x69')],'as':_0x14d8('0x6a'),'attributes':['id',_0x14d8('0x2e'),_0x14d8('0x6b'),_0x14d8('0x6c'),_0x14d8('0x6d')],'raw':!![]}]})[_0x14d8('0x26')](function(_0x3f096a){if(_0x3f096a){var _0x31c3ae=_[_0x14d8('0x6e')](_0x3f096a,function(_0x2c4ffb){var _0x38a95d=_0x2c4ffb[_0x14d8('0x28')]({'plain':!![]});return _0x38a95d['Agents'];});return db[_0x14d8('0x32')]['find']({'where':{'id':_0x3c4eec['params']['id']}})['then'](function(_0x15b6b6){return db[_0x14d8('0x6f')]['transaction'](function(_0x28dd9d){return _0x15b6b6[_0x14d8('0x67')](_0x3e507b,{'transaction':_0x28dd9d})[_0x14d8('0x26')](function(){return BPromise[_0x14d8('0x70')](_0x31c3ae,function(_0x5695c5){return db[_0x14d8('0x5a')]['findOrCreate']({'where':{'UserId':_0x5695c5['id'],'FaxQueueId':_0x3c4eec[_0x14d8('0x4e')]['id']},'transaction':_0x28dd9d});});})[_0x14d8('0x26')](function(){_0x31c3ae['forEach'](function(_0x587e56){socket['emit'](_0x14d8('0x71'),{'UserId':_0x587e56['id'],'FaxQueueId':_0x15b6b6['id']});});});});});}})[_0x14d8('0x26')](respondWithStatusCode(_0x4da6f4,null))[_0x14d8('0x4c')](handleError(_0x4da6f4,null));};exports[_0x14d8('0x72')]=function(_0x84e688,_0x1401d6,_0x9656e2){return db['Team'][_0x14d8('0x4a')]({'where':{'id':_0x84e688[_0x14d8('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x14d8('0x26')](handleEntityNotFound(_0x1401d6,null))[_0x14d8('0x26')](function(_0x4754d8){var _0x28d94f=_[_0x14d8('0x31')](_0x4754d8,'id');var _0x292dfc=[];var _0x16cf7d=[];var _0x2bb6e6=squel[_0x14d8('0x73')]();_0x2bb6e6[_0x14d8('0x74')]('tq.TeamId')[_0x14d8('0x75')](_0x14d8('0x76'),'tq')[_0x14d8('0x77')](_0x14d8('0x78'),'ut',_0x14d8('0x79'))[_0x14d8('0x41')](_0x14d8('0x7a'),_0x84e688['params']['id']);for(var _0x5ab05b=0x0;_0x5ab05b<_0x4754d8[_0x14d8('0x3e')];_0x5ab05b+=0x1){let _0x4b426c=_0x4754d8[_0x5ab05b];for(var _0x1f5dae=0x0;_0x1f5dae<_0x4b426c['Agents'][_0x14d8('0x3e')];_0x1f5dae+=0x1){let _0x5868ff=_0x4b426c[_0x14d8('0x6a')][_0x1f5dae];var _0x334219=_0x2bb6e6[_0x14d8('0x7b')]();_0x334219[_0x14d8('0x41')](_0x14d8('0x7c'),_0x5868ff['id']);_0x16cf7d[_0x14d8('0x7d')](db[_0x14d8('0x6f')]['query'](_0x334219[_0x14d8('0x7e')](),{'type':db['sequelize'][_0x14d8('0x7f')][_0x14d8('0x80')]})[_0x14d8('0x26')](function(_0x52bba4){if(_0x52bba4[_0x14d8('0x3e')]===0x1){return _0x5868ff['id'];}else{var _0x4cabea=_['every'](_[_0x14d8('0x31')](_0x52bba4,_0x14d8('0x81')),function(_0x40dcd4){return _[_0x14d8('0x82')](_0x28d94f,_0x40dcd4);});if(_0x4cabea){return _0x5868ff['id'];}}}));}}return BPromise[_0x14d8('0x83')](_0x16cf7d)[_0x14d8('0x26')](function(_0xe31d28){_0x292dfc=_(_0x292dfc)[_0x14d8('0x84')](_0xe31d28)[_0x14d8('0x85')]()[_0x14d8('0x86')]();return db[_0x14d8('0x32')][_0x14d8('0x4f')]({'where':{'id':_0x84e688[_0x14d8('0x4e')]['id']}})[_0x14d8('0x26')](function(_0x2c972a){return db[_0x14d8('0x6f')][_0x14d8('0x87')](function(_0x1b46ef){return _0x2c972a[_0x14d8('0x72')](_0x84e688[_0x14d8('0x38')][_0x14d8('0x68')],{'transaction':_0x1b46ef})[_0x14d8('0x26')](function(){if(!_['isEmpty'](_0x292dfc)){return _0x2c972a[_0x14d8('0x88')](_0x292dfc,{'transaction':_0x1b46ef});}})[_0x14d8('0x26')](function(){_0x292dfc[_0x14d8('0x89')](function(_0x550d06){socket[_0x14d8('0x8a')](_0x14d8('0x8b'),{'UserId':_0x550d06,'FaxQueueId':_0x2c972a['id']});});});});});});})[_0x14d8('0x26')](respondWithStatusCode(_0x1401d6,null))['catch'](handleError(_0x1401d6,null));};exports['addAgents']=function(_0x5abb74,_0x327c9f,_0x59e6f4){return db[_0x14d8('0x32')][_0x14d8('0x4f')]({'where':{'id':_0x5abb74['params']['id']}})[_0x14d8('0x26')](handleEntityNotFound(_0x327c9f,null))[_0x14d8('0x26')](function(_0x2c2ce5){if(_0x2c2ce5){return _0x2c2ce5[_0x14d8('0x8c')](_0x5abb74['body'][_0x14d8('0x68')],_[_0x14d8('0x8d')](_0x5abb74['body'],['ids','id'])||{})[_0x14d8('0x8e')](function(_0x3b6ecd){for(var _0x47a86e=0x0;_0x47a86e<_0x5abb74[_0x14d8('0x57')][_0x14d8('0x68')]['length'];_0x47a86e+=0x1){socket[_0x14d8('0x8a')]('userFaxQueue:save',{'UserId':Number(_0x5abb74[_0x14d8('0x57')][_0x14d8('0x68')][_0x47a86e]),'FaxQueueId':Number(_0x5abb74[_0x14d8('0x4e')]['id'])});}return _0x3b6ecd;});}})[_0x14d8('0x26')](respondWithResult(_0x327c9f,null))[_0x14d8('0x4c')](handleError(_0x327c9f,null));};exports[_0x14d8('0x88')]=function(_0xca4015,_0xb1748d,_0x34e93f){return db[_0x14d8('0x32')][_0x14d8('0x4f')]({'where':{'id':_0xca4015[_0x14d8('0x4e')]['id']}})[_0x14d8('0x26')](handleEntityNotFound(_0xb1748d,null))[_0x14d8('0x26')](function(_0xf492ec){if(_0xf492ec){return _0xf492ec[_0x14d8('0x88')](_0xca4015[_0x14d8('0x38')]['ids'])['then'](function(){if(_[_0x14d8('0x8f')](_0xca4015[_0x14d8('0x38')][_0x14d8('0x68')])){for(var _0x1adeff=0x0;_0x1adeff<_0xca4015[_0x14d8('0x38')]['ids']['length'];_0x1adeff+=0x1){socket[_0x14d8('0x8a')](_0x14d8('0x8b'),{'UserId':Number(_0xca4015[_0x14d8('0x38')]['ids'][_0x1adeff]),'FaxQueueId':Number(_0xca4015[_0x14d8('0x4e')]['id'])});}}else{socket[_0x14d8('0x8a')](_0x14d8('0x8b'),{'UserId':Number(_0xca4015[_0x14d8('0x38')][_0x14d8('0x68')]),'FaxQueueId':Number(_0xca4015[_0x14d8('0x4e')]['id'])});}});}})[_0x14d8('0x26')](respondWithStatusCode(_0xb1748d,null))[_0x14d8('0x4c')](handleError(_0xb1748d,null));};exports['getAgents']=function(_0x5bc184,_0x2c1083,_0x3b5ebc){var _0x1f1785={};var _0x45012f={};var _0x34b4da;var _0x42ce6a;return db[_0x14d8('0x32')][_0x14d8('0x65')]({'where':{'id':_0x5bc184[_0x14d8('0x4e')]['id']}})[_0x14d8('0x26')](handleEntityNotFound(_0x2c1083,null))[_0x14d8('0x26')](function(_0x3b51e2){if(_0x3b51e2){_0x34b4da=_0x3b51e2;_0x45012f['model']=_[_0x14d8('0x39')](db[_0x14d8('0x69')]['rawAttributes']);_0x45012f[_0x14d8('0x38')]=_[_0x14d8('0x39')](_0x5bc184[_0x14d8('0x38')]);_0x45012f[_0x14d8('0x3a')]=_[_0x14d8('0x3b')](_0x45012f[_0x14d8('0x37')],_0x45012f['query']);_0x1f1785[_0x14d8('0x3c')]=_[_0x14d8('0x3b')](_0x45012f[_0x14d8('0x37')],qs['fields'](_0x5bc184[_0x14d8('0x38')][_0x14d8('0x3d')]));_0x1f1785['attributes']=_0x1f1785[_0x14d8('0x3c')][_0x14d8('0x3e')]?_0x1f1785[_0x14d8('0x3c')]:_0x45012f[_0x14d8('0x37')];_0x1f1785[_0x14d8('0x5b')]=qs['sort'](_0x5bc184[_0x14d8('0x38')][_0x14d8('0x40')]);_0x1f1785[_0x14d8('0x41')]=qs[_0x14d8('0x3a')](_[_0x14d8('0x42')](_0x5bc184[_0x14d8('0x38')],_0x45012f[_0x14d8('0x3a')]));if(_0x5bc184['query'][_0x14d8('0x43')]){_0x1f1785[_0x14d8('0x41')]=_[_0x14d8('0x44')](_0x1f1785['where'],{'$or':_[_0x14d8('0x31')](_0x1f1785[_0x14d8('0x3c')],function(_0x1e00ed){var _0x59b5f6={};_0x59b5f6[_0x1e00ed]={'$like':'%'+_0x5bc184[_0x14d8('0x38')][_0x14d8('0x43')]+'%'};return _0x59b5f6;})});}_0x1f1785=_[_0x14d8('0x44')]({},_0x1f1785,_0x5bc184[_0x14d8('0x46')]);return _0x34b4da[_0x14d8('0x90')](_0x1f1785);}})[_0x14d8('0x26')](function(_0x9db403){if(_0x9db403){_0x42ce6a=_0x9db403[_0x14d8('0x3e')];if(!_0x5bc184['query']['hasOwnProperty'](_0x14d8('0x3f'))){_0x1f1785[_0x14d8('0x22')]=qs[_0x14d8('0x22')](_0x5bc184['query'][_0x14d8('0x22')]);_0x1f1785[_0x14d8('0x21')]=qs[_0x14d8('0x21')](_0x5bc184[_0x14d8('0x38')][_0x14d8('0x21')]);}return _0x34b4da[_0x14d8('0x90')](_0x1f1785);}})[_0x14d8('0x26')](function(_0x3d699e){if(_0x3d699e){return _0x3d699e?{'count':_0x42ce6a,'rows':_0x3d699e}:null;}})['then'](respondWithResult(_0x2c1083,null))[_0x14d8('0x4c')](handleError(_0x2c1083,null));};
\ No newline at end of file
+var _0xa606=['catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','rawAttributes','filter','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','addAgents','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','FaxQueues','UserProfileResource','destroy','end','error','name','map','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','FaxQueue','includeAll','include','findAll','rows'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0xa606,0x1ea));var _0x6a60=function(_0x49883a,_0x45184c){_0x49883a=_0x49883a-0x0;var _0x5aca4c=_0xa606[_0x49883a];return _0x5aca4c;};'use strict';var emlformat=require(_0x6a60('0x0'));var rimraf=require(_0x6a60('0x1'));var zipdir=require(_0x6a60('0x2'));var jsonpatch=require(_0x6a60('0x3'));var rp=require(_0x6a60('0x4'));var moment=require(_0x6a60('0x5'));var BPromise=require(_0x6a60('0x6'));var Mustache=require(_0x6a60('0x7'));var util=require(_0x6a60('0x8'));var path=require('path');var sox=require(_0x6a60('0x9'));var csv=require('to-csv');var ejs=require(_0x6a60('0xa'));var fs=require('fs');var fs_extra=require(_0x6a60('0xb'));var _=require(_0x6a60('0xc'));var squel=require(_0x6a60('0xd'));var crypto=require(_0x6a60('0xe'));var jsforce=require(_0x6a60('0xf'));var deskjs=require(_0x6a60('0x10'));var toCsv=require(_0x6a60('0x11'));var querystring=require(_0x6a60('0x12'));var Papa=require(_0x6a60('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a60('0x14'));var hardwareService=require(_0x6a60('0x15'));var logger=require(_0x6a60('0x16'))(_0x6a60('0x17'));var utils=require(_0x6a60('0x18'));var config=require(_0x6a60('0x19'));var licenseUtil=require(_0x6a60('0x1a'));var db=require(_0x6a60('0x1b'))['db'];config[_0x6a60('0x1c')]=_[_0x6a60('0x1d')](config['redis'],{'host':_0x6a60('0x1e'),'port':0x18eb});var socket=require(_0x6a60('0x1f'))(new Redis(config[_0x6a60('0x1c')]));require(_0x6a60('0x20'))[_0x6a60('0x21')](socket);function respondWithStatusCode(_0x1231dc,_0x546205){_0x546205=_0x546205||0xcc;return function(_0x27f932){if(_0x27f932){return _0x1231dc[_0x6a60('0x22')](_0x546205);}return _0x1231dc[_0x6a60('0x23')](_0x546205)['end']();};}function respondWithResult(_0x72c4e8,_0x56b414){_0x56b414=_0x56b414||0xc8;return function(_0x2193eb){if(_0x2193eb){return _0x72c4e8['status'](_0x56b414)[_0x6a60('0x24')](_0x2193eb);}};}function respondWithFilteredResult(_0x4a2d68,_0x19ee10){return function(_0x5d5e98){if(_0x5d5e98){var _0x226f88=typeof _0x19ee10[_0x6a60('0x25')]==='undefined'&&typeof _0x19ee10[_0x6a60('0x26')]===_0x6a60('0x27');var _0x18cb19=_0x5d5e98['count'];var _0xf5b4b3=_0x226f88?0x0:_0x19ee10['offset'];var _0x3cb8cc=_0x226f88?_0x5d5e98[_0x6a60('0x28')]:_0x19ee10['offset']+_0x19ee10[_0x6a60('0x26')];var _0x2df4dc;if(_0x3cb8cc>=_0x18cb19){_0x3cb8cc=_0x18cb19;_0x2df4dc=0xc8;}else{_0x2df4dc=0xce;}_0x4a2d68[_0x6a60('0x23')](_0x2df4dc);return _0x4a2d68[_0x6a60('0x29')]('Content-Range',_0xf5b4b3+'-'+_0x3cb8cc+'/'+_0x18cb19)['json'](_0x5d5e98);}return null;};}function patchUpdates(_0x18d5be){return function(_0x46e1c4){try{jsonpatch['apply'](_0x46e1c4,_0x18d5be,!![]);}catch(_0x1ee1bb){return BPromise[_0x6a60('0x2a')](_0x1ee1bb);}return _0x46e1c4[_0x6a60('0x2b')]();};}function saveUpdates(_0x36b0d1,_0x4386dd){return function(_0x22efd7){if(_0x22efd7){return _0x22efd7[_0x6a60('0x2c')](_0x36b0d1)['then'](function(_0x47963e){return _0x47963e;});}return null;};}function removeEntity(_0xfc495b,_0x48831c){return function(_0x4d5c36){if(_0x4d5c36){return _0x4d5c36['destroy']()[_0x6a60('0x2d')](function(){var _0x37f22b=_0x4d5c36['get']({'plain':!![]});var _0x41bf79=_0x6a60('0x2e');return db[_0x6a60('0x2f')][_0x6a60('0x30')]({'where':{'type':_0x41bf79,'resourceId':_0x37f22b['id']}})[_0x6a60('0x2d')](function(){return _0x4d5c36;});})[_0x6a60('0x2d')](function(){_0xfc495b[_0x6a60('0x23')](0xcc)[_0x6a60('0x31')]();});}};}function handleEntityNotFound(_0x2842b6,_0x76719d){return function(_0x583eda){if(!_0x583eda){_0x2842b6['sendStatus'](0x194);}return _0x583eda;};}function handleError(_0x3cae37,_0xb02aa4){_0xb02aa4=_0xb02aa4||0x1f4;return function(_0x199413){logger[_0x6a60('0x32')](_0x199413['stack']);if(_0x199413[_0x6a60('0x33')]){delete _0x199413['name'];}_0x3cae37[_0x6a60('0x23')](_0xb02aa4)['send'](_0x199413);};}exports['index']=function(_0x2c209e,_0x3d176c){var _0x2d8b2d={},_0x105e06={},_0x57eecc={'count':0x0,'rows':[]};var _0x3888fd=_[_0x6a60('0x34')](db['FaxQueue']['rawAttributes'],function(_0x59b4f0){return{'name':_0x59b4f0[_0x6a60('0x35')],'type':_0x59b4f0['type'][_0x6a60('0x36')]};});_0x105e06[_0x6a60('0x37')]=_[_0x6a60('0x34')](_0x3888fd,_0x6a60('0x33'));_0x105e06['query']=_['keys'](_0x2c209e[_0x6a60('0x38')]);_0x105e06[_0x6a60('0x39')]=_[_0x6a60('0x3a')](_0x105e06['model'],_0x105e06[_0x6a60('0x38')]);_0x2d8b2d[_0x6a60('0x3b')]=_[_0x6a60('0x3a')](_0x105e06['model'],qs[_0x6a60('0x3c')](_0x2c209e[_0x6a60('0x38')]['fields']));_0x2d8b2d[_0x6a60('0x3b')]=_0x2d8b2d[_0x6a60('0x3b')]['length']?_0x2d8b2d[_0x6a60('0x3b')]:_0x105e06[_0x6a60('0x37')];if(!_0x2c209e[_0x6a60('0x38')][_0x6a60('0x3d')](_0x6a60('0x3e'))){_0x2d8b2d[_0x6a60('0x26')]=qs[_0x6a60('0x26')](_0x2c209e[_0x6a60('0x38')][_0x6a60('0x26')]);_0x2d8b2d['offset']=qs[_0x6a60('0x25')](_0x2c209e[_0x6a60('0x38')]['offset']);}_0x2d8b2d[_0x6a60('0x3f')]=qs[_0x6a60('0x40')](_0x2c209e[_0x6a60('0x38')][_0x6a60('0x40')]);_0x2d8b2d[_0x6a60('0x41')]=qs[_0x6a60('0x39')](_[_0x6a60('0x42')](_0x2c209e[_0x6a60('0x38')],_0x105e06[_0x6a60('0x39')]),_0x3888fd);if(_0x2c209e[_0x6a60('0x38')]['filter']){_0x2d8b2d[_0x6a60('0x41')]=_[_0x6a60('0x43')](_0x2d8b2d['where'],{'$or':_['map'](_0x3888fd,function(_0xd32ae1){if(_0xd32ae1['type']!=='VIRTUAL'){var _0x43e74a={};_0x43e74a[_0xd32ae1[_0x6a60('0x33')]]={'$like':'%'+_0x2c209e['query']['filter']+'%'};return _0x43e74a;}})});}_0x2d8b2d=_[_0x6a60('0x43')]({},_0x2d8b2d,_0x2c209e[_0x6a60('0x44')]);var _0x1c48da={'where':_0x2d8b2d[_0x6a60('0x41')]};return db[_0x6a60('0x45')]['count'](_0x1c48da)['then'](function(_0x3984be){_0x57eecc[_0x6a60('0x28')]=_0x3984be;if(_0x2c209e[_0x6a60('0x38')][_0x6a60('0x46')]){_0x2d8b2d[_0x6a60('0x47')]=[{'all':!![]}];}return db[_0x6a60('0x45')][_0x6a60('0x48')](_0x2d8b2d);})['then'](function(_0x113281){_0x57eecc[_0x6a60('0x49')]=_0x113281;return _0x57eecc;})[_0x6a60('0x2d')](respondWithFilteredResult(_0x3d176c,_0x2d8b2d))[_0x6a60('0x4a')](handleError(_0x3d176c,null));};exports[_0x6a60('0x4b')]=function(_0x2ce2b9,_0x1175fe){var _0x44d43b={'raw':!![],'where':{'id':_0x2ce2b9[_0x6a60('0x4c')]['id']}},_0x49d9f1={};_0x49d9f1[_0x6a60('0x37')]=_[_0x6a60('0x4d')](db[_0x6a60('0x45')]['rawAttributes']);_0x49d9f1['query']=_[_0x6a60('0x4d')](_0x2ce2b9[_0x6a60('0x38')]);_0x49d9f1[_0x6a60('0x39')]=_[_0x6a60('0x3a')](_0x49d9f1[_0x6a60('0x37')],_0x49d9f1[_0x6a60('0x38')]);_0x44d43b[_0x6a60('0x3b')]=_[_0x6a60('0x3a')](_0x49d9f1['model'],qs['fields'](_0x2ce2b9[_0x6a60('0x38')][_0x6a60('0x3c')]));_0x44d43b[_0x6a60('0x3b')]=_0x44d43b[_0x6a60('0x3b')][_0x6a60('0x4e')]?_0x44d43b['attributes']:_0x49d9f1[_0x6a60('0x37')];if(_0x2ce2b9[_0x6a60('0x38')][_0x6a60('0x46')]){_0x44d43b[_0x6a60('0x47')]=[{'all':!![]}];}_0x44d43b=_[_0x6a60('0x43')]({},_0x44d43b,_0x2ce2b9[_0x6a60('0x44')]);return db[_0x6a60('0x45')][_0x6a60('0x4f')](_0x44d43b)['then'](handleEntityNotFound(_0x1175fe,null))[_0x6a60('0x2d')](respondWithResult(_0x1175fe,null))['catch'](handleError(_0x1175fe,null));};exports[_0x6a60('0x50')]=function(_0x1f7929,_0x26d493){return db[_0x6a60('0x45')][_0x6a60('0x50')](_0x1f7929[_0x6a60('0x51')],{})[_0x6a60('0x2d')](function(_0x9c7ee8){var _0x2609e4=_0x1f7929[_0x6a60('0x52')]['get']({'plain':!![]});if(!_0x2609e4)throw new Error(_0x6a60('0x53'));if(_0x2609e4[_0x6a60('0x54')]===_0x6a60('0x52')){var _0x45df8c=_0x9c7ee8[_0x6a60('0x55')]({'plain':!![]});var _0x13ee42='FaxQueues';return db[_0x6a60('0x56')]['find']({'where':{'name':_0x13ee42,'userProfileId':_0x2609e4[_0x6a60('0x57')]},'raw':!![]})[_0x6a60('0x2d')](function(_0x727104){if(_0x727104&&_0x727104['autoAssociation']===0x0){return db[_0x6a60('0x2f')][_0x6a60('0x50')]({'name':_0x45df8c[_0x6a60('0x33')],'resourceId':_0x45df8c['id'],'type':_0x727104[_0x6a60('0x33')],'sectionId':_0x727104['id']},{})['then'](function(){return _0x9c7ee8;});}else{return _0x9c7ee8;}})[_0x6a60('0x4a')](function(_0x210b8e){logger[_0x6a60('0x32')](_0x6a60('0x58'),_0x210b8e);throw _0x210b8e;});}return _0x9c7ee8;})['then'](respondWithResult(_0x26d493,0xc9))['catch'](handleError(_0x26d493,null));};exports[_0x6a60('0x2c')]=function(_0x457908,_0x58c184){if(_0x457908[_0x6a60('0x51')]['id']){delete _0x457908['body']['id'];}return db[_0x6a60('0x45')][_0x6a60('0x4f')]({'where':{'id':_0x457908[_0x6a60('0x4c')]['id']}})[_0x6a60('0x2d')](handleEntityNotFound(_0x58c184,null))[_0x6a60('0x2d')](saveUpdates(_0x457908[_0x6a60('0x51')],null))[_0x6a60('0x2d')](respondWithResult(_0x58c184,null))[_0x6a60('0x4a')](handleError(_0x58c184,null));};exports[_0x6a60('0x30')]=function(_0x107afa,_0x5d030b){return db[_0x6a60('0x45')]['find']({'where':{'id':_0x107afa[_0x6a60('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5d030b,null))[_0x6a60('0x2d')](removeEntity(_0x5d030b,null))[_0x6a60('0x4a')](handleError(_0x5d030b,null));};exports[_0x6a60('0x59')]=function(_0xef025e,_0x3f6c2e){return db[_0x6a60('0x45')][_0x6a60('0x59')]()['then'](respondWithResult(_0x3f6c2e,null))[_0x6a60('0x4a')](handleError(_0x3f6c2e,null));};exports[_0x6a60('0x5a')]=function(_0x3b82da,_0x1006e1,_0x3ffcb7){var _0x3d4853={'raw':!![],'where':{}},_0x2874c5={},_0x1ac77c;return db[_0x6a60('0x45')][_0x6a60('0x5b')]({'where':{'id':_0x3b82da['params']['id']}})['then'](handleEntityNotFound(_0x1006e1,null))[_0x6a60('0x2d')](function(_0x34a82d){if(_0x34a82d){_0x1ac77c=_0x34a82d[_0x6a60('0x55')]({'plain':!![]});_0x2874c5['model']=_[_0x6a60('0x4d')](db[_0x6a60('0x5c')][_0x6a60('0x5d')]);_0x2874c5['query']=_[_0x6a60('0x4d')](_0x3b82da[_0x6a60('0x38')]);_0x2874c5[_0x6a60('0x39')]=_[_0x6a60('0x3a')](_0x2874c5[_0x6a60('0x37')],_0x2874c5[_0x6a60('0x38')]);_0x3d4853['attributes']=_[_0x6a60('0x3a')](_0x2874c5[_0x6a60('0x37')],qs[_0x6a60('0x3c')](_0x3b82da['query']['fields']));_0x3d4853[_0x6a60('0x3b')]=_0x3d4853['attributes'][_0x6a60('0x4e')]?_0x3d4853[_0x6a60('0x3b')]:_0x2874c5[_0x6a60('0x37')];if(!_0x3b82da[_0x6a60('0x38')][_0x6a60('0x3d')](_0x6a60('0x3e'))){_0x3d4853[_0x6a60('0x26')]=qs[_0x6a60('0x26')](_0x3b82da[_0x6a60('0x38')]['limit']);_0x3d4853['offset']=qs[_0x6a60('0x25')](_0x3b82da[_0x6a60('0x38')][_0x6a60('0x25')]);}_0x3d4853[_0x6a60('0x3f')]=qs[_0x6a60('0x40')](_0x3b82da[_0x6a60('0x38')][_0x6a60('0x40')]);_0x3d4853['where']=qs[_0x6a60('0x39')](_['pick'](_0x3b82da[_0x6a60('0x38')],_0x2874c5[_0x6a60('0x39')]));_0x3d4853[_0x6a60('0x41')]['FaxQueueId']=_0x34a82d['id'];if(_0x3b82da[_0x6a60('0x38')][_0x6a60('0x5e')]){_0x3d4853['where']=_[_0x6a60('0x43')](_0x3d4853['where'],{'$or':_[_0x6a60('0x34')](_0x3d4853[_0x6a60('0x3b')],function(_0x35f4c7){var _0x429ebc={};_0x429ebc[_0x35f4c7]={'$like':'%'+_0x3b82da[_0x6a60('0x38')][_0x6a60('0x5e')]+'%'};return _0x429ebc;})});}_0x3d4853=_[_0x6a60('0x43')]({},_0x3d4853,_0x3b82da[_0x6a60('0x44')]);return db['UserFaxQueue'][_0x6a60('0x48')](_0x3d4853);}})[_0x6a60('0x2d')](function(_0x4ceab0){if(_0x4ceab0){return db['User']['findAndCountAll']({'where':{'id':_[_0x6a60('0x34')](_0x4ceab0,_0x6a60('0x5f')),'role':_0x6a60('0x60')},'attributes':['id','name',_0x6a60('0x61'),_0x6a60('0x62'),_0x6a60('0x63')]});}})[_0x6a60('0x2d')](function(_0xd6d66f){if(_0xd6d66f){return{'count':_0xd6d66f[_0x6a60('0x28')],'rows':_[_0x6a60('0x34')](_0xd6d66f['rows'],function(_0x26fd1f){return{'membername':_0x26fd1f['name'],'UserId':_0x26fd1f['id'],'queue_name':_0x1ac77c[_0x6a60('0x33')],'FaxQueueId':_0x1ac77c['id'],'interface':util[_0x6a60('0x64')](_0x6a60('0x65'),_0x6a60('0x66'),_0x26fd1f[_0x6a60('0x33')]),'penalty':0x0,'paused':_0x26fd1f[_0x6a60('0x61')],'createdAt':_0x26fd1f[_0x6a60('0x63')],'updatedAt':_0x26fd1f[_0x6a60('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6a60('0x2d')](respondWithFilteredResult(_0x1006e1,_0x3d4853))[_0x6a60('0x4a')](handleError(_0x1006e1,null));};exports[_0x6a60('0x67')]=function(_0x2caac7,_0x4db909,_0x3f3380){var _0x5e33bf={};var _0x21ee13={};var _0x45483a;var _0x14bc80;return db[_0x6a60('0x45')][_0x6a60('0x5b')]({'where':{'id':_0x2caac7[_0x6a60('0x4c')]['id']}})[_0x6a60('0x2d')](handleEntityNotFound(_0x4db909,null))[_0x6a60('0x2d')](function(_0x287cbd){if(_0x287cbd){_0x45483a=_0x287cbd;_0x21ee13['model']=_[_0x6a60('0x4d')](db['Team']['rawAttributes']);_0x21ee13[_0x6a60('0x38')]=_[_0x6a60('0x4d')](_0x2caac7['query']);_0x21ee13[_0x6a60('0x39')]=_['intersection'](_0x21ee13[_0x6a60('0x37')],_0x21ee13[_0x6a60('0x38')]);_0x5e33bf[_0x6a60('0x3b')]=_[_0x6a60('0x3a')](_0x21ee13['model'],qs[_0x6a60('0x3c')](_0x2caac7['query'][_0x6a60('0x3c')]));_0x5e33bf[_0x6a60('0x3b')]=_0x5e33bf['attributes'][_0x6a60('0x4e')]?_0x5e33bf[_0x6a60('0x3b')]:_0x21ee13[_0x6a60('0x37')];_0x5e33bf[_0x6a60('0x3f')]=qs[_0x6a60('0x40')](_0x2caac7['query'][_0x6a60('0x40')]);_0x5e33bf['where']=qs[_0x6a60('0x39')](_['pick'](_0x2caac7[_0x6a60('0x38')],_0x21ee13[_0x6a60('0x39')]));if(_0x2caac7[_0x6a60('0x38')]['filter']){_0x5e33bf[_0x6a60('0x41')]=_[_0x6a60('0x43')](_0x5e33bf[_0x6a60('0x41')],{'$or':_[_0x6a60('0x34')](_0x5e33bf[_0x6a60('0x3b')],function(_0x31fb7c){var _0x444a2d={};_0x444a2d[_0x31fb7c]={'$like':'%'+_0x2caac7[_0x6a60('0x38')][_0x6a60('0x5e')]+'%'};return _0x444a2d;})});}_0x5e33bf=_[_0x6a60('0x43')]({},_0x5e33bf,_0x2caac7[_0x6a60('0x44')]);return _0x45483a[_0x6a60('0x67')](_0x5e33bf);}})[_0x6a60('0x2d')](function(_0x42a5fe){if(_0x42a5fe){_0x14bc80=_0x42a5fe[_0x6a60('0x4e')];if(!_0x2caac7[_0x6a60('0x38')]['hasOwnProperty'](_0x6a60('0x3e'))){_0x5e33bf[_0x6a60('0x26')]=qs[_0x6a60('0x26')](_0x2caac7[_0x6a60('0x38')][_0x6a60('0x26')]);_0x5e33bf[_0x6a60('0x25')]=qs[_0x6a60('0x25')](_0x2caac7[_0x6a60('0x38')][_0x6a60('0x25')]);}return _0x45483a[_0x6a60('0x67')](_0x5e33bf);}})['then'](function(_0x1cde53){if(_0x1cde53){return _0x1cde53?{'count':_0x14bc80,'rows':_0x1cde53}:null;}})[_0x6a60('0x2d')](respondWithResult(_0x4db909,null))[_0x6a60('0x4a')](handleError(_0x4db909,null));};exports[_0x6a60('0x68')]=function(_0xcbaf68,_0x4b3dd3,_0x53a863){var _0x43857b=_0xcbaf68[_0x6a60('0x51')][_0x6a60('0x69')];return db[_0x6a60('0x6a')][_0x6a60('0x48')]({'where':{'id':_0x43857b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6a60('0x6b'),'attributes':['id',_0x6a60('0x33'),'online',_0x6a60('0x6c'),_0x6a60('0x6d')],'raw':!![]}]})[_0x6a60('0x2d')](function(_0xbc234f){if(_0xbc234f){var _0x2e3fc2=_['flatMap'](_0xbc234f,function(_0x502cde){var _0x4ebc10=_0x502cde[_0x6a60('0x55')]({'plain':!![]});return _0x4ebc10[_0x6a60('0x6b')];});return db[_0x6a60('0x45')][_0x6a60('0x4f')]({'where':{'id':_0xcbaf68[_0x6a60('0x4c')]['id']}})[_0x6a60('0x2d')](function(_0x59c438){return db['sequelize'][_0x6a60('0x6e')](function(_0x1a1cce){return _0x59c438[_0x6a60('0x68')](_0x43857b,{'transaction':_0x1a1cce})[_0x6a60('0x2d')](function(){return BPromise[_0x6a60('0x6f')](_0x2e3fc2,function(_0x389b2a){return db['UserFaxQueue'][_0x6a60('0x70')]({'where':{'UserId':_0x389b2a['id'],'FaxQueueId':_0xcbaf68[_0x6a60('0x4c')]['id']},'transaction':_0x1a1cce});});})['then'](function(){_0x2e3fc2[_0x6a60('0x71')](function(_0x5e392b){socket[_0x6a60('0x72')](_0x6a60('0x73'),{'UserId':_0x5e392b['id'],'FaxQueueId':_0x59c438['id']});});});});});}})[_0x6a60('0x2d')](respondWithStatusCode(_0x4b3dd3,null))[_0x6a60('0x4a')](handleError(_0x4b3dd3,null));};exports[_0x6a60('0x74')]=function(_0x26c29b,_0x4b5cb3,_0x2577e5){return db[_0x6a60('0x6a')][_0x6a60('0x48')]({'where':{'id':_0x26c29b[_0x6a60('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6a60('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x6a60('0x2d')](handleEntityNotFound(_0x4b5cb3,null))[_0x6a60('0x2d')](function(_0x427c64){var _0x4cb9e8=_[_0x6a60('0x34')](_0x427c64,'id');var _0x29a37f=[];var _0x2a1e28=[];var _0x51e25a=squel[_0x6a60('0x75')]();_0x51e25a[_0x6a60('0x76')](_0x6a60('0x77'))['from'](_0x6a60('0x78'),'tq')[_0x6a60('0x79')](_0x6a60('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6a60('0x41')](_0x6a60('0x7b'),_0x26c29b[_0x6a60('0x4c')]['id']);for(var _0x3af17f=0x0;_0x3af17f<_0x427c64[_0x6a60('0x4e')];_0x3af17f+=0x1){let _0x1adedf=_0x427c64[_0x3af17f];for(var _0x1cafdf=0x0;_0x1cafdf<_0x1adedf[_0x6a60('0x6b')][_0x6a60('0x4e')];_0x1cafdf+=0x1){let _0x180b7c=_0x1adedf[_0x6a60('0x6b')][_0x1cafdf];var _0x165321=_0x51e25a['clone']();_0x165321['where']('ut.UserId\x20=\x20?',_0x180b7c['id']);_0x2a1e28[_0x6a60('0x7c')](db[_0x6a60('0x7d')][_0x6a60('0x38')](_0x165321[_0x6a60('0x7e')](),{'type':db[_0x6a60('0x7d')][_0x6a60('0x7f')][_0x6a60('0x80')]})[_0x6a60('0x2d')](function(_0x89a836){if(_0x89a836[_0x6a60('0x4e')]===0x1){return _0x180b7c['id'];}else{var _0x17a92d=_[_0x6a60('0x81')](_[_0x6a60('0x34')](_0x89a836,_0x6a60('0x82')),function(_0x754ad2){return _[_0x6a60('0x83')](_0x4cb9e8,_0x754ad2);});if(_0x17a92d){return _0x180b7c['id'];}}}));}}return BPromise[_0x6a60('0x84')](_0x2a1e28)[_0x6a60('0x2d')](function(_0x2df83d){_0x29a37f=_(_0x29a37f)[_0x6a60('0x85')](_0x2df83d)[_0x6a60('0x86')]()['value']();return db[_0x6a60('0x45')][_0x6a60('0x4f')]({'where':{'id':_0x26c29b[_0x6a60('0x4c')]['id']}})[_0x6a60('0x2d')](function(_0x3c3445){return db[_0x6a60('0x7d')][_0x6a60('0x6e')](function(_0x1f8cdd){return _0x3c3445[_0x6a60('0x74')](_0x26c29b['query']['ids'],{'transaction':_0x1f8cdd})[_0x6a60('0x2d')](function(){if(!_[_0x6a60('0x87')](_0x29a37f)){return _0x3c3445[_0x6a60('0x88')](_0x29a37f,{'transaction':_0x1f8cdd});}})['then'](function(){_0x29a37f[_0x6a60('0x71')](function(_0x29b3e8){socket['emit']('userFaxQueue:remove',{'UserId':_0x29b3e8,'FaxQueueId':_0x3c3445['id']});});});});});});})[_0x6a60('0x2d')](respondWithStatusCode(_0x4b5cb3,null))[_0x6a60('0x4a')](handleError(_0x4b5cb3,null));};exports[_0x6a60('0x89')]=function(_0x1d83ce,_0x821f32,_0x465724){return db[_0x6a60('0x45')]['find']({'where':{'id':_0x1d83ce[_0x6a60('0x4c')]['id']}})[_0x6a60('0x2d')](handleEntityNotFound(_0x821f32,null))[_0x6a60('0x2d')](function(_0x1f629b){if(_0x1f629b){return _0x1f629b[_0x6a60('0x89')](_0x1d83ce[_0x6a60('0x51')][_0x6a60('0x69')],_['omit'](_0x1d83ce[_0x6a60('0x51')],[_0x6a60('0x69'),'id'])||{})['spread'](function(_0x2efe07){for(var _0x4efa9d=0x0;_0x4efa9d<_0x1d83ce['body']['ids'][_0x6a60('0x4e')];_0x4efa9d+=0x1){socket[_0x6a60('0x72')](_0x6a60('0x73'),{'UserId':Number(_0x1d83ce[_0x6a60('0x51')]['ids'][_0x4efa9d]),'FaxQueueId':Number(_0x1d83ce[_0x6a60('0x4c')]['id'])});}return _0x2efe07;});}})[_0x6a60('0x2d')](respondWithResult(_0x821f32,null))[_0x6a60('0x4a')](handleError(_0x821f32,null));};exports[_0x6a60('0x88')]=function(_0x2f438b,_0x1c9316,_0x35e7f3){return db[_0x6a60('0x45')]['find']({'where':{'id':_0x2f438b[_0x6a60('0x4c')]['id']}})[_0x6a60('0x2d')](handleEntityNotFound(_0x1c9316,null))['then'](function(_0x3f4eff){if(_0x3f4eff){return _0x3f4eff['removeAgents'](_0x2f438b[_0x6a60('0x38')][_0x6a60('0x69')])[_0x6a60('0x2d')](function(){if(_[_0x6a60('0x8a')](_0x2f438b['query'][_0x6a60('0x69')])){for(var _0x4ab4b8=0x0;_0x4ab4b8<_0x2f438b['query'][_0x6a60('0x69')][_0x6a60('0x4e')];_0x4ab4b8+=0x1){socket[_0x6a60('0x72')]('userFaxQueue:remove',{'UserId':Number(_0x2f438b[_0x6a60('0x38')][_0x6a60('0x69')][_0x4ab4b8]),'FaxQueueId':Number(_0x2f438b[_0x6a60('0x4c')]['id'])});}}else{socket[_0x6a60('0x72')](_0x6a60('0x8b'),{'UserId':Number(_0x2f438b[_0x6a60('0x38')]['ids']),'FaxQueueId':Number(_0x2f438b[_0x6a60('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c9316,null))['catch'](handleError(_0x1c9316,null));};exports[_0x6a60('0x8c')]=function(_0x16e67a,_0x3e4c3e,_0x1583b3){var _0x33d65b={};var _0x1c9831={};var _0x26c9e0;var _0x182213;return db[_0x6a60('0x45')][_0x6a60('0x5b')]({'where':{'id':_0x16e67a[_0x6a60('0x4c')]['id']}})[_0x6a60('0x2d')](handleEntityNotFound(_0x3e4c3e,null))[_0x6a60('0x2d')](function(_0x2c2ded){if(_0x2c2ded){_0x26c9e0=_0x2c2ded;_0x1c9831[_0x6a60('0x37')]=_[_0x6a60('0x4d')](db['User'][_0x6a60('0x5d')]);_0x1c9831[_0x6a60('0x38')]=_[_0x6a60('0x4d')](_0x16e67a[_0x6a60('0x38')]);_0x1c9831[_0x6a60('0x39')]=_['intersection'](_0x1c9831[_0x6a60('0x37')],_0x1c9831[_0x6a60('0x38')]);_0x33d65b[_0x6a60('0x3b')]=_[_0x6a60('0x3a')](_0x1c9831[_0x6a60('0x37')],qs[_0x6a60('0x3c')](_0x16e67a[_0x6a60('0x38')]['fields']));_0x33d65b[_0x6a60('0x3b')]=_0x33d65b['attributes'][_0x6a60('0x4e')]?_0x33d65b[_0x6a60('0x3b')]:_0x1c9831[_0x6a60('0x37')];_0x33d65b[_0x6a60('0x3f')]=qs[_0x6a60('0x40')](_0x16e67a['query']['sort']);_0x33d65b[_0x6a60('0x41')]=qs[_0x6a60('0x39')](_[_0x6a60('0x42')](_0x16e67a[_0x6a60('0x38')],_0x1c9831[_0x6a60('0x39')]));if(_0x16e67a['query'][_0x6a60('0x5e')]){_0x33d65b[_0x6a60('0x41')]=_['merge'](_0x33d65b[_0x6a60('0x41')],{'$or':_[_0x6a60('0x34')](_0x33d65b[_0x6a60('0x3b')],function(_0x3e4d5f){var _0x549f2c={};_0x549f2c[_0x3e4d5f]={'$like':'%'+_0x16e67a[_0x6a60('0x38')][_0x6a60('0x5e')]+'%'};return _0x549f2c;})});}_0x33d65b=_[_0x6a60('0x43')]({},_0x33d65b,_0x16e67a['options']);return _0x26c9e0[_0x6a60('0x8c')](_0x33d65b);}})[_0x6a60('0x2d')](function(_0x37ebc0){if(_0x37ebc0){_0x182213=_0x37ebc0['length'];if(!_0x16e67a[_0x6a60('0x38')][_0x6a60('0x3d')](_0x6a60('0x3e'))){_0x33d65b['limit']=qs[_0x6a60('0x26')](_0x16e67a['query'][_0x6a60('0x26')]);_0x33d65b[_0x6a60('0x25')]=qs['offset'](_0x16e67a[_0x6a60('0x38')][_0x6a60('0x25')]);}return _0x26c9e0['getAgents'](_0x33d65b);}})['then'](function(_0xcd9f83){if(_0xcd9f83){return _0xcd9f83?{'count':_0x182213,'rows':_0xcd9f83}:null;}})['then'](respondWithResult(_0x3e4c3e,null))[_0x6a60('0x4a')](handleError(_0x3e4c3e,null));};
\ No newline at end of file
index cb6d91c..ff368d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3c0=['exports','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x34b781,_0x407a1a){var _0x4b2b30=function(_0x5662f2){while(--_0x5662f2){_0x34b781['push'](_0x34b781['shift']());}};_0x4b2b30(++_0x407a1a);}(_0xa3c0,0x179));var _0x0a3c=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xa3c0[_0x18a436];return _0x5c2cf8;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x0a3c('0x0'))['db'][_0x0a3c('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x0a3c('0x2')](0x0);var events={'afterCreate':_0x0a3c('0x3'),'afterUpdate':_0x0a3c('0x4'),'afterDestroy':_0x0a3c('0x5')};function emitEvent(_0x1739bb){return function(_0x56a7b5,_0x4d8f58,_0x17ea2d){FaxQueueEvents[_0x0a3c('0x6')](_0x1739bb+':'+_0x56a7b5['id'],_0x56a7b5);FaxQueueEvents['emit'](_0x1739bb,_0x56a7b5);_0x17ea2d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x0a3c('0x7')]=FaxQueueEvents;
\ No newline at end of file
+var _0xbdbc=['exports','../../mysqldb','FaxQueue','update','remove','emit','hasOwnProperty','hook'];(function(_0x2a4d8e,_0x50cd98){var _0x5f3da5=function(_0x4972fa){while(--_0x4972fa){_0x2a4d8e['push'](_0x2a4d8e['shift']());}};_0x5f3da5(++_0x50cd98);}(_0xbdbc,0x1f1));var _0xcbdb=function(_0xcff8d1,_0x36bb26){_0xcff8d1=_0xcff8d1-0x0;var _0x201167=_0xbdbc[_0xcff8d1];return _0x201167;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xcbdb('0x0'))['db'][_0xcbdb('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcbdb('0x2'),'afterDestroy':_0xcbdb('0x3')};function emitEvent(_0x7b6556){return function(_0x600cfc,_0x5b0094,_0xede13a){FaxQueueEvents[_0xcbdb('0x4')](_0x7b6556+':'+_0x600cfc['id'],_0x600cfc);FaxQueueEvents[_0xcbdb('0x4')](_0x7b6556,_0x600cfc);_0xede13a(null);};}for(var e in events){if(events[_0xcbdb('0x5')](e)){var event=events[e];FaxQueue[_0xcbdb('0x6')](e,emitEvent(event));}}module[_0xcbdb('0x7')]=FaxQueueEvents;
\ No newline at end of file
index 398b4d3..076b0ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28dc=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','fax_queues'];(function(_0x1b13d7,_0x559f6c){var _0x4dbba1=function(_0x3d50dc){while(--_0x3d50dc){_0x1b13d7['push'](_0x1b13d7['shift']());}};_0x4dbba1(++_0x559f6c);}(_0x28dc,0xf7));var _0xc28d=function(_0x4e4061,_0x26503b){_0x4e4061=_0x4e4061-0x0;var _0x371dbd=_0x28dc[_0x4e4061];return _0x371dbd;};'use strict';var _=require(_0xc28d('0x0'));var util=require(_0xc28d('0x1'));var logger=require(_0xc28d('0x2'))(_0xc28d('0x3'));var moment=require(_0xc28d('0x4'));var BPromise=require(_0xc28d('0x5'));var rp=require(_0xc28d('0x6'));var fs=require('fs');var path=require(_0xc28d('0x7'));var rimraf=require(_0xc28d('0x8'));var config=require(_0xc28d('0x9'));var attributes=require(_0xc28d('0xa'));module['exports']=function(_0x1529d6,_0x18fdfe){return _0x1529d6['define'](_0xc28d('0xb'),attributes,{'tableName':_0xc28d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac99=['../../config/environment','./faxQueue.attributes','define','fax_queues','lodash','moment','bluebird','request-promise'];(function(_0x740ac8,_0x92e121){var _0x193e0d=function(_0x3afae8){while(--_0x3afae8){_0x740ac8['push'](_0x740ac8['shift']());}};_0x193e0d(++_0x92e121);}(_0xac99,0x164));var _0x9ac9=function(_0x7cce8d,_0x8d7c9c){_0x7cce8d=_0x7cce8d-0x0;var _0x381b50=_0xac99[_0x7cce8d];return _0x381b50;};'use strict';var _=require(_0x9ac9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9ac9('0x1'));var BPromise=require(_0x9ac9('0x2'));var rp=require(_0x9ac9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ac9('0x4'));var attributes=require(_0x9ac9('0x5'));module['exports']=function(_0x45c24e,_0x5d1683){return _0x45c24e[_0x9ac9('0x6')]('FaxQueue',attributes,{'tableName':_0x9ac9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 60a94cf..7f0455a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90c7=['FaxQueue,\x20%s,\x20%s','info','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','FaxQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x90c7,0x194));var _0x790c=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x90c7[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x790c('0x0'));var util=require('util');var moment=require(_0x790c('0x1'));var BPromise=require(_0x790c('0x2'));var rs=require(_0x790c('0x3'));var fs=require('fs');var Redis=require(_0x790c('0x4'));var db=require(_0x790c('0x5'))['db'];var utils=require(_0x790c('0x6'));var logger=require(_0x790c('0x7'))(_0x790c('0x8'));var config=require('../../config/environment');var jayson=require(_0x790c('0x9'));var client=jayson[_0x790c('0xa')][_0x790c('0xb')]({'port':0x232a});config['redis']=_[_0x790c('0xc')](config[_0x790c('0xd')],{'host':_0x790c('0xe'),'port':0x18eb});var socket=require(_0x790c('0xf'))(new Redis(config[_0x790c('0xd')]));require('./faxQueue.socket')[_0x790c('0x10')](socket);function respondWithRpcPromise(_0x2073a9,_0x915d42,_0x27260e){return new BPromise(function(_0x510dc1,_0x20b085){return client[_0x790c('0x11')](_0x2073a9,_0x27260e)[_0x790c('0x12')](function(_0x37e0ba){logger['info']('FaxQueue,\x20%s,\x20%s',_0x915d42,_0x790c('0x13'));logger[_0x790c('0x14')](_0x790c('0x15'),_0x915d42,_0x790c('0x13'),JSON[_0x790c('0x16')](_0x37e0ba));if(_0x37e0ba[_0x790c('0x17')]){if(_0x37e0ba[_0x790c('0x17')][_0x790c('0x18')]===0x1f4){logger[_0x790c('0x17')]('FaxQueue,\x20%s,\x20%s',_0x915d42,_0x37e0ba[_0x790c('0x17')][_0x790c('0x19')]);return _0x20b085(_0x37e0ba[_0x790c('0x17')][_0x790c('0x19')]);}logger[_0x790c('0x17')](_0x790c('0x1a'),_0x915d42,_0x37e0ba[_0x790c('0x17')]['message']);return _0x510dc1(_0x37e0ba[_0x790c('0x17')][_0x790c('0x19')]);}else{logger[_0x790c('0x1b')]('FaxQueue,\x20%s,\x20%s',_0x915d42,_0x790c('0x13'));_0x510dc1(_0x37e0ba[_0x790c('0x1c')][_0x790c('0x19')]);}})[_0x790c('0x1d')](function(_0x4dc3da){logger[_0x790c('0x17')]('FaxQueue,\x20%s,\x20%s',_0x915d42,_0x4dc3da);_0x20b085(_0x4dc3da);});});}exports[_0x790c('0x1e')]=function(_0xd222dc){var _0x572aee=this;return new Promise(function(_0x44e3af,_0x41b6ff){return db['FaxQueue'][_0x790c('0x1f')]({'raw':_0xd222dc[_0x790c('0x20')]?_0xd222dc['options'][_0x790c('0x21')]===undefined?!![]:![]:!![],'where':_0xd222dc[_0x790c('0x20')]?_0xd222dc[_0x790c('0x20')][_0x790c('0x22')]||null:null,'attributes':_0xd222dc[_0x790c('0x20')]?_0xd222dc['options'][_0x790c('0x23')]||null:null,'limit':_0xd222dc['options']?_0xd222dc['options'][_0x790c('0x24')]||null:null,'include':_0xd222dc[_0x790c('0x20')]?_0xd222dc[_0x790c('0x20')][_0x790c('0x25')]?_[_0x790c('0x26')](_0xd222dc[_0x790c('0x20')][_0x790c('0x25')],function(_0x4542d5){return{'model':db[_0x4542d5['model']],'as':_0x4542d5['as'],'attributes':_0x4542d5[_0x790c('0x23')],'include':_0x4542d5['include']?_['map'](_0x4542d5[_0x790c('0x25')],function(_0xcb2a3d){return{'model':db[_0xcb2a3d[_0x790c('0x27')]],'as':_0xcb2a3d['as'],'attributes':_0xcb2a3d['attributes'],'include':_0xcb2a3d[_0x790c('0x25')]?_[_0x790c('0x26')](_0xcb2a3d[_0x790c('0x25')],function(_0x42c320){return{'model':db[_0x42c320[_0x790c('0x27')]],'as':_0x42c320['as'],'attributes':_0x42c320[_0x790c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x790c('0x12')](function(_0x5431ef){logger[_0x790c('0x1b')](_0x790c('0x1e'),_0xd222dc);logger[_0x790c('0x14')]('GetFaxQueue',_0xd222dc,JSON['stringify'](_0x5431ef));_0x44e3af(_0x5431ef);})['catch'](function(_0x533d0e){logger[_0x790c('0x17')](_0x790c('0x1e'),_0x533d0e[_0x790c('0x19')],_0xd222dc);_0x41b6ff(_0x572aee['error'](0x1f4,_0x533d0e[_0x790c('0x19')]));});});};exports[_0x790c('0x28')]=function(_0x39231c){var _0x3c8f88=this;return new Promise(function(_0xf3a11,_0x4c8daf){return db[_0x790c('0x29')][_0x790c('0x2a')]({'raw':_0x39231c[_0x790c('0x20')]?_0x39231c[_0x790c('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x39231c[_0x790c('0x20')]?_0x39231c['options'][_0x790c('0x22')]||null:null,'attributes':_0x39231c['options']?_0x39231c['options'][_0x790c('0x23')]||null:null,'include':_0x39231c[_0x790c('0x20')]?_0x39231c[_0x790c('0x20')][_0x790c('0x25')]?_['map'](_0x39231c[_0x790c('0x20')][_0x790c('0x25')],function(_0x4afc7c){return{'model':db[_0x4afc7c[_0x790c('0x27')]],'as':_0x4afc7c['as'],'attributes':_0x4afc7c[_0x790c('0x23')],'include':_0x4afc7c['include']?_[_0x790c('0x26')](_0x4afc7c[_0x790c('0x25')],function(_0x3c3fc6){return{'model':db[_0x3c3fc6[_0x790c('0x27')]],'as':_0x3c3fc6['as'],'attributes':_0x3c3fc6[_0x790c('0x23')],'include':_0x3c3fc6[_0x790c('0x25')]?_[_0x790c('0x26')](_0x3c3fc6[_0x790c('0x25')],function(_0x484773){return{'model':db[_0x484773[_0x790c('0x27')]],'as':_0x484773['as'],'attributes':_0x484773[_0x790c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x790c('0x12')](function(_0x515dcb){logger['info'](_0x790c('0x28'),_0x39231c);logger[_0x790c('0x14')]('ShowFaxQueue',_0x39231c,JSON[_0x790c('0x16')](_0x515dcb));_0xf3a11(_0x515dcb);})[_0x790c('0x1d')](function(_0x3258d3){logger['error'](_0x790c('0x28'),_0x3258d3[_0x790c('0x19')],_0x39231c);_0x4c8daf(_0x3c8f88[_0x790c('0x17')](0x1f4,_0x3258d3[_0x790c('0x19')]));});});};
\ No newline at end of file
+var _0xb219=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','findAll','options','where','attributes','include','map','model','GetFaxQueue','ShowFaxQueue','FaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3f6ae6,_0x2f0cc6){var _0x1387ce=function(_0x28b319){while(--_0x28b319){_0x3f6ae6['push'](_0x3f6ae6['shift']());}};_0x1387ce(++_0x2f0cc6);}(_0xb219,0xbe));var _0x9b21=function(_0x3b2308,_0x53754c){_0x3b2308=_0x3b2308-0x0;var _0x42a190=_0xb219[_0x3b2308];return _0x42a190;};'use strict';var _=require(_0x9b21('0x0'));var util=require(_0x9b21('0x1'));var moment=require(_0x9b21('0x2'));var BPromise=require(_0x9b21('0x3'));var rs=require(_0x9b21('0x4'));var fs=require('fs');var Redis=require(_0x9b21('0x5'));var db=require(_0x9b21('0x6'))['db'];var utils=require(_0x9b21('0x7'));var logger=require(_0x9b21('0x8'))(_0x9b21('0x9'));var config=require(_0x9b21('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x9b21('0xb')][_0x9b21('0xc')]({'port':0x232a});config[_0x9b21('0xd')]=_[_0x9b21('0xe')](config[_0x9b21('0xd')],{'host':_0x9b21('0xf'),'port':0x18eb});var socket=require(_0x9b21('0x10'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x9b21('0x11')](socket);function respondWithRpcPromise(_0x4132a2,_0x12dd38,_0x2d596d){return new BPromise(function(_0x52152e,_0x14bd0b){return client['request'](_0x4132a2,_0x2d596d)[_0x9b21('0x12')](function(_0x1cb062){logger[_0x9b21('0x13')](_0x9b21('0x14'),_0x12dd38,_0x9b21('0x15'));logger[_0x9b21('0x16')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x12dd38,'request\x20sent',JSON[_0x9b21('0x17')](_0x1cb062));if(_0x1cb062['error']){if(_0x1cb062[_0x9b21('0x18')]['code']===0x1f4){logger['error'](_0x9b21('0x14'),_0x12dd38,_0x1cb062[_0x9b21('0x18')][_0x9b21('0x19')]);return _0x14bd0b(_0x1cb062['error']['message']);}logger[_0x9b21('0x18')](_0x9b21('0x14'),_0x12dd38,_0x1cb062[_0x9b21('0x18')][_0x9b21('0x19')]);return _0x52152e(_0x1cb062[_0x9b21('0x18')][_0x9b21('0x19')]);}else{logger[_0x9b21('0x13')](_0x9b21('0x14'),_0x12dd38,_0x9b21('0x15'));_0x52152e(_0x1cb062[_0x9b21('0x1a')][_0x9b21('0x19')]);}})[_0x9b21('0x1b')](function(_0x4a7960){logger[_0x9b21('0x18')](_0x9b21('0x14'),_0x12dd38,_0x4a7960);_0x14bd0b(_0x4a7960);});});}exports['GetFaxQueue']=function(_0xd649cf){var _0x1accb0=this;return new Promise(function(_0x153e63,_0x441954){return db['FaxQueue'][_0x9b21('0x1c')]({'raw':_0xd649cf['options']?_0xd649cf['options']['raw']===undefined?!![]:![]:!![],'where':_0xd649cf[_0x9b21('0x1d')]?_0xd649cf[_0x9b21('0x1d')][_0x9b21('0x1e')]||null:null,'attributes':_0xd649cf[_0x9b21('0x1d')]?_0xd649cf[_0x9b21('0x1d')][_0x9b21('0x1f')]||null:null,'limit':_0xd649cf['options']?_0xd649cf[_0x9b21('0x1d')]['limit']||null:null,'include':_0xd649cf['options']?_0xd649cf[_0x9b21('0x1d')][_0x9b21('0x20')]?_[_0x9b21('0x21')](_0xd649cf['options'][_0x9b21('0x20')],function(_0x4810d1){return{'model':db[_0x4810d1['model']],'as':_0x4810d1['as'],'attributes':_0x4810d1[_0x9b21('0x1f')],'include':_0x4810d1[_0x9b21('0x20')]?_[_0x9b21('0x21')](_0x4810d1[_0x9b21('0x20')],function(_0x1955db){return{'model':db[_0x1955db[_0x9b21('0x22')]],'as':_0x1955db['as'],'attributes':_0x1955db['attributes'],'include':_0x1955db[_0x9b21('0x20')]?_[_0x9b21('0x21')](_0x1955db['include'],function(_0x5ea9e2){return{'model':db[_0x5ea9e2[_0x9b21('0x22')]],'as':_0x5ea9e2['as'],'attributes':_0x5ea9e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b21('0x12')](function(_0x452d36){logger[_0x9b21('0x13')]('GetFaxQueue',_0xd649cf);logger[_0x9b21('0x16')](_0x9b21('0x23'),_0xd649cf,JSON[_0x9b21('0x17')](_0x452d36));_0x153e63(_0x452d36);})[_0x9b21('0x1b')](function(_0x592758){logger[_0x9b21('0x18')]('GetFaxQueue',_0x592758[_0x9b21('0x19')],_0xd649cf);_0x441954(_0x1accb0['error'](0x1f4,_0x592758[_0x9b21('0x19')]));});});};exports[_0x9b21('0x24')]=function(_0x57a5c6){var _0xcf3b02=this;return new Promise(function(_0x4a45d3,_0x3ac20b){return db[_0x9b21('0x25')][_0x9b21('0x26')]({'raw':_0x57a5c6[_0x9b21('0x1d')]?_0x57a5c6[_0x9b21('0x1d')][_0x9b21('0x27')]===undefined?!![]:![]:!![],'where':_0x57a5c6[_0x9b21('0x1d')]?_0x57a5c6[_0x9b21('0x1d')]['where']||null:null,'attributes':_0x57a5c6['options']?_0x57a5c6[_0x9b21('0x1d')][_0x9b21('0x1f')]||null:null,'include':_0x57a5c6[_0x9b21('0x1d')]?_0x57a5c6['options'][_0x9b21('0x20')]?_[_0x9b21('0x21')](_0x57a5c6['options'][_0x9b21('0x20')],function(_0x4601fb){return{'model':db[_0x4601fb[_0x9b21('0x22')]],'as':_0x4601fb['as'],'attributes':_0x4601fb['attributes'],'include':_0x4601fb[_0x9b21('0x20')]?_[_0x9b21('0x21')](_0x4601fb[_0x9b21('0x20')],function(_0x3807ad){return{'model':db[_0x3807ad[_0x9b21('0x22')]],'as':_0x3807ad['as'],'attributes':_0x3807ad[_0x9b21('0x1f')],'include':_0x3807ad['include']?_[_0x9b21('0x21')](_0x3807ad['include'],function(_0x501ab2){return{'model':db[_0x501ab2[_0x9b21('0x22')]],'as':_0x501ab2['as'],'attributes':_0x501ab2[_0x9b21('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9b21('0x12')](function(_0x55b05e){logger[_0x9b21('0x13')]('ShowFaxQueue',_0x57a5c6);logger[_0x9b21('0x16')](_0x9b21('0x24'),_0x57a5c6,JSON[_0x9b21('0x17')](_0x55b05e));_0x4a45d3(_0x55b05e);})[_0x9b21('0x1b')](function(_0x5593a3){logger['error'](_0x9b21('0x24'),_0x5593a3[_0x9b21('0x19')],_0x57a5c6);_0x3ac20b(_0xcf3b02[_0x9b21('0x18')](0x1f4,_0x5593a3[_0x9b21('0x19')]));});});};
\ No newline at end of file
index f38ba6d..e42177b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fa9=['emit','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x14b74f,_0xf24abd){var _0x11f35e=function(_0x2575a0){while(--_0x2575a0){_0x14b74f['push'](_0x14b74f['shift']());}};_0x11f35e(++_0xf24abd);}(_0x2fa9,0x144));var _0x92fa=function(_0x3a9e45,_0x230e08){_0x3a9e45=_0x3a9e45-0x0;var _0x3ae158=_0x2fa9[_0x3a9e45];return _0x3ae158;};'use strict';var FaxQueueEvents=require(_0x92fa('0x0'));var events=[_0x92fa('0x1'),_0x92fa('0x2'),_0x92fa('0x3')];function createListener(_0x103ebe,_0x3221b5){return function(_0x5d24db){_0x3221b5[_0x92fa('0x4')](_0x103ebe,_0x5d24db);};}function removeListener(_0x2f9f15,_0x361e63){return function(){FaxQueueEvents['removeListener'](_0x2f9f15,_0x361e63);};}exports[_0x92fa('0x5')]=function(_0x3fa3cc){for(var _0x1a9f28=0x0,_0x4a3d25=events[_0x92fa('0x6')];_0x1a9f28<_0x4a3d25;_0x1a9f28++){var _0x30cf75=events[_0x1a9f28];var _0x3f5bd9=createListener(_0x92fa('0x7')+_0x30cf75,_0x3fa3cc);FaxQueueEvents['on'](_0x30cf75,_0x3f5bd9);}};
\ No newline at end of file
+var _0xb2cf=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x5e72dc,_0xa12f95){var _0x197a74=function(_0xaa9cc0){while(--_0xaa9cc0){_0x5e72dc['push'](_0x5e72dc['shift']());}};_0x197a74(++_0xa12f95);}(_0xb2cf,0x10c));var _0xfb2c=function(_0x3888ab,_0x4caa19){_0x3888ab=_0x3888ab-0x0;var _0x5e1f10=_0xb2cf[_0x3888ab];return _0x5e1f10;};'use strict';var FaxQueueEvents=require(_0xfb2c('0x0'));var events=[_0xfb2c('0x1'),_0xfb2c('0x2'),_0xfb2c('0x3')];function createListener(_0xdf4835,_0x554fb4){return function(_0xe5a7f){_0x554fb4[_0xfb2c('0x4')](_0xdf4835,_0xe5a7f);};}function removeListener(_0x50c2de,_0x46ef6e){return function(){FaxQueueEvents[_0xfb2c('0x5')](_0x50c2de,_0x46ef6e);};}exports[_0xfb2c('0x6')]=function(_0x25fabe){for(var _0xf7c813=0x0,_0x21d85a=events[_0xfb2c('0x7')];_0xf7c813<_0x21d85a;_0xf7c813++){var _0x112145=events[_0xf7c813];var _0x31e653=createListener(_0xfb2c('0x8')+_0x112145,_0x25fabe);FaxQueueEvents['on'](_0x112145,_0x31e653);}};
\ No newline at end of file
index f857b25..ab37f1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7de=['removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0xb7de,0xc7));var _0xeb7d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb7de[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var path=require(_0xeb7d('0x2'));var timeout=require('connect-timeout');var express=require(_0xeb7d('0x3'));var router=express[_0xeb7d('0x4')]();var fs_extra=require(_0xeb7d('0x5'));var auth=require(_0xeb7d('0x6'));var interaction=require(_0xeb7d('0x7'));var config=require('../../config/environment');var controller=require(_0xeb7d('0x8'));router[_0xeb7d('0x9')]('/',auth[_0xeb7d('0xa')](),controller[_0xeb7d('0xb')]);router[_0xeb7d('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xeb7d('0xc')]);router[_0xeb7d('0x9')](_0xeb7d('0xd'),auth[_0xeb7d('0xa')](),controller['show']);router[_0xeb7d('0x9')](_0xeb7d('0xe'),auth[_0xeb7d('0xa')](),controller['getMembers']);router['get'](_0xeb7d('0xf'),auth['isAuthenticated'](),controller[_0xeb7d('0x10')]);router[_0xeb7d('0x9')](_0xeb7d('0x11'),auth[_0xeb7d('0xa')](),controller[_0xeb7d('0x12')]);router[_0xeb7d('0x13')]('/',auth['isAuthenticated'](),controller[_0xeb7d('0x14')]);router[_0xeb7d('0x13')](_0xeb7d('0xf'),auth[_0xeb7d('0xa')](),controller[_0xeb7d('0x15')]);router['post'](_0xeb7d('0x11'),auth['isAuthenticated'](),controller[_0xeb7d('0x16')]);router[_0xeb7d('0x17')](_0xeb7d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xeb7d('0x18')](_0xeb7d('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xeb7d('0x18')](_0xeb7d('0xf'),auth['isAuthenticated'](),controller[_0xeb7d('0x19')]);router[_0xeb7d('0x18')](_0xeb7d('0x11'),auth[_0xeb7d('0xa')](),controller[_0xeb7d('0x1a')]);module[_0xeb7d('0x1b')]=router;
\ No newline at end of file
+var _0xa498=['getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','getMembers','/:id/teams'];(function(_0x5d5d50,_0x11e423){var _0x22930a=function(_0x4160cd){while(--_0x4160cd){_0x5d5d50['push'](_0x5d5d50['shift']());}};_0x22930a(++_0x11e423);}(_0xa498,0x1d6));var _0x8a49=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0xa498[_0xa28b1a];return _0x4c9b78;};'use strict';var multer=require('multer');var util=require(_0x8a49('0x0'));var path=require(_0x8a49('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a49('0x2')]();var fs_extra=require(_0x8a49('0x3'));var auth=require(_0x8a49('0x4'));var interaction=require(_0x8a49('0x5'));var config=require(_0x8a49('0x6'));var controller=require('./faxQueue.controller');router[_0x8a49('0x7')]('/',auth['isAuthenticated'](),controller[_0x8a49('0x8')]);router[_0x8a49('0x7')](_0x8a49('0x9'),auth['isAuthenticated'](),controller[_0x8a49('0xa')]);router[_0x8a49('0x7')](_0x8a49('0xb'),auth[_0x8a49('0xc')](),controller[_0x8a49('0xd')]);router[_0x8a49('0x7')]('/:id/members',auth[_0x8a49('0xc')](),controller[_0x8a49('0xe')]);router[_0x8a49('0x7')](_0x8a49('0xf'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x10')]);router[_0x8a49('0x7')](_0x8a49('0x11'),auth[_0x8a49('0xc')](),controller['getAgents']);router[_0x8a49('0x12')]('/',auth[_0x8a49('0xc')](),controller[_0x8a49('0x13')]);router['post'](_0x8a49('0xf'),auth['isAuthenticated'](),controller[_0x8a49('0x14')]);router[_0x8a49('0x12')]('/:id/users',auth[_0x8a49('0xc')](),controller[_0x8a49('0x15')]);router[_0x8a49('0x16')](_0x8a49('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8a49('0x17')](_0x8a49('0xb'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x18')]);router['delete'](_0x8a49('0xf'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x19')]);router[_0x8a49('0x17')](_0x8a49('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x8a49('0x1a')]=router;
\ No newline at end of file
index 0d18111..6a9a069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b12=['STRING','DATE','moment','exports'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x1b12,0x1b6));var _0x21b1=function(_0x365714,_0x243206){_0x365714=_0x365714-0x0;var _0x467fef=_0x1b12[_0x365714];return _0x467fef;};'use strict';var moment=require(_0x21b1('0x0'));var Sequelize=require('sequelize');module[_0x21b1('0x1')]={'uniqueid':{'type':Sequelize[_0x21b1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x21b1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x21b1('0x3')]},'acceptAt':{'type':Sequelize[_0x21b1('0x3')]},'exitAt':{'type':Sequelize[_0x21b1('0x3')]},'reason':{'type':Sequelize[_0x21b1('0x2')]}};
\ No newline at end of file
+var _0x21c3=['STRING','exports','DATE'];(function(_0x1d137a,_0x11d36a){var _0x54e6a9=function(_0x24ee4b){while(--_0x24ee4b){_0x1d137a['push'](_0x1d137a['shift']());}};_0x54e6a9(++_0x11d36a);}(_0x21c3,0x1a5));var _0x321c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x21c3[_0x3947c9];return _0x2e7871;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x321c('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x321c('0x1')]},'leaveAt':{'type':Sequelize[_0x321c('0x1')]},'acceptAt':{'type':Sequelize[_0x321c('0x1')]},'exitAt':{'type':Sequelize[_0x321c('0x1')]},'reason':{'type':Sequelize[_0x321c('0x2')]}};
\ No newline at end of file
index 23c5fc5..89d4a87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe13e=['body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','stack','name','send','index','map','FaxQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','params','fields','length','include','options','find','catch','create'];(function(_0x5383e9,_0x430659){var _0x2ac336=function(_0x41ed55){while(--_0x41ed55){_0x5383e9['push'](_0x5383e9['shift']());}};_0x2ac336(++_0x430659);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee13('0x0'));var jsonpatch=require(_0xee13('0x1'));var rp=require(_0xee13('0x2'));var moment=require(_0xee13('0x3'));var BPromise=require(_0xee13('0x4'));var Mustache=require(_0xee13('0x5'));var util=require(_0xee13('0x6'));var path=require(_0xee13('0x7'));var sox=require(_0xee13('0x8'));var csv=require(_0xee13('0x9'));var ejs=require(_0xee13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee13('0xb'));var squel=require(_0xee13('0xc'));var crypto=require(_0xee13('0xd'));var jsforce=require(_0xee13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee13('0x9'));var querystring=require(_0xee13('0xf'));var Papa=require(_0xee13('0x10'));var Redis=require(_0xee13('0x11'));var authService=require(_0xee13('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xee13('0x13'));var hardwareService=require(_0xee13('0x14'));var logger=require('../../config/logger')(_0xee13('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee13('0x16'))['db'];function respondWithStatusCode(_0x4ae893,_0x3060d8){_0x3060d8=_0x3060d8||0xcc;return function(_0x43f002){if(_0x43f002){return _0x4ae893[_0xee13('0x17')](_0x3060d8);}return _0x4ae893[_0xee13('0x18')](_0x3060d8)[_0xee13('0x19')]();};}function respondWithResult(_0xeb630e,_0x2f7cd3){_0x2f7cd3=_0x2f7cd3||0xc8;return function(_0x50fd97){if(_0x50fd97){return _0xeb630e[_0xee13('0x18')](_0x2f7cd3)[_0xee13('0x1a')](_0x50fd97);}};}function respondWithFilteredResult(_0xafe3d8,_0x53e5a5){return function(_0x38eb56){if(_0x38eb56){var _0x6de406=typeof _0x53e5a5['offset']===_0xee13('0x1b')&&typeof _0x53e5a5[_0xee13('0x1c')]===_0xee13('0x1b');var _0x1eb454=_0x38eb56[_0xee13('0x1d')];var _0x3a5819=_0x6de406?0x0:_0x53e5a5[_0xee13('0x1e')];var _0x33bd9c=_0x6de406?_0x38eb56[_0xee13('0x1d')]:_0x53e5a5[_0xee13('0x1e')]+_0x53e5a5['limit'];var _0x462257;if(_0x33bd9c>=_0x1eb454){_0x33bd9c=_0x1eb454;_0x462257=0xc8;}else{_0x462257=0xce;}_0xafe3d8[_0xee13('0x18')](_0x462257);return _0xafe3d8['set'](_0xee13('0x1f'),_0x3a5819+'-'+_0x33bd9c+'/'+_0x1eb454)['json'](_0x38eb56);}return null;};}function patchUpdates(_0x17e664){return function(_0x4a49c0){try{jsonpatch[_0xee13('0x20')](_0x4a49c0,_0x17e664,!![]);}catch(_0x28f763){return BPromise['reject'](_0x28f763);}return _0x4a49c0[_0xee13('0x21')]();};}function saveUpdates(_0x248aae,_0x3f9dfd){return function(_0x3231b0){if(_0x3231b0){return _0x3231b0[_0xee13('0x22')](_0x248aae)['then'](function(_0xd93336){return _0xd93336;});}return null;};}function removeEntity(_0x46bd44,_0x4c705c){return function(_0x255ff2){if(_0x255ff2){return _0x255ff2['destroy']()[_0xee13('0x23')](function(){_0x46bd44['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x381508,_0x323e1e){return function(_0x49eddd){if(!_0x49eddd){_0x381508[_0xee13('0x17')](0x194);}return _0x49eddd;};}function handleError(_0x37cf4b,_0x19096f){_0x19096f=_0x19096f||0x1f4;return function(_0x48b604){logger['error'](_0x48b604[_0xee13('0x24')]);if(_0x48b604[_0xee13('0x25')]){delete _0x48b604[_0xee13('0x25')];}_0x37cf4b[_0xee13('0x18')](_0x19096f)[_0xee13('0x26')](_0x48b604);};}exports[_0xee13('0x27')]=function(_0x148477,_0x29ddad){var _0x28d237={},_0x458e12={},_0x3aeaac={'count':0x0,'rows':[]};var _0x37f57d=_[_0xee13('0x28')](db[_0xee13('0x29')][_0xee13('0x2a')],function(_0x122983){return{'name':_0x122983['fieldName'],'type':_0x122983['type'][_0xee13('0x2b')]};});_0x458e12[_0xee13('0x2c')]=_[_0xee13('0x28')](_0x37f57d,_0xee13('0x25'));_0x458e12['query']=_[_0xee13('0x2d')](_0x148477[_0xee13('0x2e')]);_0x458e12[_0xee13('0x2f')]=_[_0xee13('0x30')](_0x458e12[_0xee13('0x2c')],_0x458e12[_0xee13('0x2e')]);_0x28d237[_0xee13('0x31')]=_[_0xee13('0x30')](_0x458e12[_0xee13('0x2c')],qs['fields'](_0x148477[_0xee13('0x2e')]['fields']));_0x28d237['attributes']=_0x28d237[_0xee13('0x31')]['length']?_0x28d237[_0xee13('0x31')]:_0x458e12['model'];if(!_0x148477[_0xee13('0x2e')][_0xee13('0x32')](_0xee13('0x33'))){_0x28d237[_0xee13('0x1c')]=qs[_0xee13('0x1c')](_0x148477[_0xee13('0x2e')][_0xee13('0x1c')]);_0x28d237[_0xee13('0x1e')]=qs[_0xee13('0x1e')](_0x148477['query'][_0xee13('0x1e')]);}_0x28d237[_0xee13('0x34')]=qs[_0xee13('0x35')](_0x148477['query'][_0xee13('0x35')]);_0x28d237[_0xee13('0x36')]=qs[_0xee13('0x2f')](_[_0xee13('0x37')](_0x148477[_0xee13('0x2e')],_0x458e12[_0xee13('0x2f')]),_0x37f57d);if(_0x148477['query'][_0xee13('0x38')]){_0x28d237[_0xee13('0x36')]=_[_0xee13('0x39')](_0x28d237['where'],{'$or':_[_0xee13('0x28')](_0x37f57d,function(_0xbe91b9){if(_0xbe91b9['type']!==_0xee13('0x3a')){var _0xfb099c={};_0xfb099c[_0xbe91b9[_0xee13('0x25')]]={'$like':'%'+_0x148477[_0xee13('0x2e')][_0xee13('0x38')]+'%'};return _0xfb099c;}})});}_0x28d237=_['merge']({},_0x28d237,_0x148477['options']);var _0x17ebe1={'where':_0x28d237[_0xee13('0x36')]};return db[_0xee13('0x29')][_0xee13('0x1d')](_0x17ebe1)[_0xee13('0x23')](function(_0x65d670){_0x3aeaac[_0xee13('0x1d')]=_0x65d670;if(_0x148477[_0xee13('0x2e')][_0xee13('0x3b')]){_0x28d237['include']=[{'all':!![]}];}return db[_0xee13('0x29')][_0xee13('0x3c')](_0x28d237);})[_0xee13('0x23')](function(_0x3acae4){_0x3aeaac['rows']=_0x3acae4;return _0x3aeaac;})['then'](respondWithFilteredResult(_0x29ddad,_0x28d237))['catch'](handleError(_0x29ddad,null));};exports[_0xee13('0x3d')]=function(_0x493aae,_0x4b5288){var _0x16d84a={'raw':!![],'where':{'id':_0x493aae[_0xee13('0x3e')]['id']}},_0x4a7ce6={};_0x4a7ce6[_0xee13('0x2c')]=_[_0xee13('0x2d')](db['FaxQueueReport'][_0xee13('0x2a')]);_0x4a7ce6[_0xee13('0x2e')]=_['keys'](_0x493aae['query']);_0x4a7ce6['filters']=_[_0xee13('0x30')](_0x4a7ce6['model'],_0x4a7ce6[_0xee13('0x2e')]);_0x16d84a[_0xee13('0x31')]=_[_0xee13('0x30')](_0x4a7ce6[_0xee13('0x2c')],qs[_0xee13('0x3f')](_0x493aae[_0xee13('0x2e')][_0xee13('0x3f')]));_0x16d84a[_0xee13('0x31')]=_0x16d84a[_0xee13('0x31')][_0xee13('0x40')]?_0x16d84a[_0xee13('0x31')]:_0x4a7ce6[_0xee13('0x2c')];if(_0x493aae[_0xee13('0x2e')][_0xee13('0x3b')]){_0x16d84a[_0xee13('0x41')]=[{'all':!![]}];}_0x16d84a=_[_0xee13('0x39')]({},_0x16d84a,_0x493aae[_0xee13('0x42')]);return db[_0xee13('0x29')][_0xee13('0x43')](_0x16d84a)[_0xee13('0x23')](handleEntityNotFound(_0x4b5288,null))[_0xee13('0x23')](respondWithResult(_0x4b5288,null))[_0xee13('0x44')](handleError(_0x4b5288,null));};exports[_0xee13('0x45')]=function(_0x3aeb91,_0x33676c){return db[_0xee13('0x29')]['create'](_0x3aeb91[_0xee13('0x46')],{})[_0xee13('0x23')](respondWithResult(_0x33676c,0xc9))[_0xee13('0x44')](handleError(_0x33676c,null));};exports[_0xee13('0x22')]=function(_0x136fb2,_0x587642){if(_0x136fb2['body']['id']){delete _0x136fb2['body']['id'];}return db[_0xee13('0x29')][_0xee13('0x43')]({'where':{'id':_0x136fb2[_0xee13('0x3e')]['id']}})[_0xee13('0x23')](handleEntityNotFound(_0x587642,null))[_0xee13('0x23')](saveUpdates(_0x136fb2[_0xee13('0x46')],null))[_0xee13('0x23')](respondWithResult(_0x587642,null))['catch'](handleError(_0x587642,null));};exports[_0xee13('0x47')]=function(_0x32e326,_0x225eda){return db[_0xee13('0x29')]['find']({'where':{'id':_0x32e326[_0xee13('0x3e')]['id']}})[_0xee13('0x23')](handleEntityNotFound(_0x225eda,null))['then'](removeEntity(_0x225eda,null))['catch'](handleError(_0x225eda,null));};exports[_0xee13('0x48')]=function(_0x4356bf,_0x37fe13){return db[_0xee13('0x29')][_0xee13('0x48')]()[_0xee13('0x23')](respondWithResult(_0x37fe13,null))[_0xee13('0x44')](handleError(_0x37fe13,null));};
\ No newline at end of file
+var _0xe356=['rows','catch','params','keys','rawAttributes','merge','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','map','FaxQueueReport','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','options','includeAll','include','findAll'];(function(_0x360e7d,_0x1272e1){var _0x22c7d4=function(_0x1c45ac){while(--_0x1c45ac){_0x360e7d['push'](_0x360e7d['shift']());}};_0x22c7d4(++_0x1272e1);}(_0xe356,0x1ee));var _0x6e35=function(_0xd608a5,_0x23d898){_0xd608a5=_0xd608a5-0x0;var _0x57440f=_0xe356[_0xd608a5];return _0x57440f;};'use strict';var emlformat=require(_0x6e35('0x0'));var rimraf=require(_0x6e35('0x1'));var zipdir=require(_0x6e35('0x2'));var jsonpatch=require(_0x6e35('0x3'));var rp=require('request-promise');var moment=require(_0x6e35('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6e35('0x5'));var util=require(_0x6e35('0x6'));var path=require(_0x6e35('0x7'));var sox=require('sox');var csv=require(_0x6e35('0x8'));var ejs=require(_0x6e35('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e35('0xa'));var squel=require(_0x6e35('0xb'));var crypto=require(_0x6e35('0xc'));var jsforce=require(_0x6e35('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6e35('0x8'));var querystring=require('querystring');var Papa=require(_0x6e35('0xe'));var Redis=require('ioredis');var authService=require(_0x6e35('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e35('0x10'));var logger=require(_0x6e35('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6e35('0x12'));var licenseUtil=require(_0x6e35('0x13'));var db=require(_0x6e35('0x14'))['db'];function respondWithStatusCode(_0x59629f,_0x191e2c){_0x191e2c=_0x191e2c||0xcc;return function(_0x27458c){if(_0x27458c){return _0x59629f[_0x6e35('0x15')](_0x191e2c);}return _0x59629f['status'](_0x191e2c)[_0x6e35('0x16')]();};}function respondWithResult(_0x1de65c,_0x101bb2){_0x101bb2=_0x101bb2||0xc8;return function(_0x4c18b4){if(_0x4c18b4){return _0x1de65c[_0x6e35('0x17')](_0x101bb2)[_0x6e35('0x18')](_0x4c18b4);}};}function respondWithFilteredResult(_0xb2eb2a,_0x5e8a07){return function(_0x213d21){if(_0x213d21){var _0x189588=typeof _0x5e8a07[_0x6e35('0x19')]==='undefined'&&typeof _0x5e8a07[_0x6e35('0x1a')]===_0x6e35('0x1b');var _0x350832=_0x213d21[_0x6e35('0x1c')];var _0x58a622=_0x189588?0x0:_0x5e8a07[_0x6e35('0x19')];var _0x2bd771=_0x189588?_0x213d21['count']:_0x5e8a07[_0x6e35('0x19')]+_0x5e8a07[_0x6e35('0x1a')];var _0x19fe35;if(_0x2bd771>=_0x350832){_0x2bd771=_0x350832;_0x19fe35=0xc8;}else{_0x19fe35=0xce;}_0xb2eb2a[_0x6e35('0x17')](_0x19fe35);return _0xb2eb2a[_0x6e35('0x1d')](_0x6e35('0x1e'),_0x58a622+'-'+_0x2bd771+'/'+_0x350832)['json'](_0x213d21);}return null;};}function patchUpdates(_0x35f44){return function(_0x3d0eb8){try{jsonpatch[_0x6e35('0x1f')](_0x3d0eb8,_0x35f44,!![]);}catch(_0x22fac9){return BPromise[_0x6e35('0x20')](_0x22fac9);}return _0x3d0eb8[_0x6e35('0x21')]();};}function saveUpdates(_0x2a2428,_0xa9044f){return function(_0x2a2813){if(_0x2a2813){return _0x2a2813['update'](_0x2a2428)[_0x6e35('0x22')](function(_0x546db4){return _0x546db4;});}return null;};}function removeEntity(_0x5793fd,_0x301c39){return function(_0x529510){if(_0x529510){return _0x529510[_0x6e35('0x23')]()['then'](function(){_0x5793fd[_0x6e35('0x17')](0xcc)[_0x6e35('0x16')]();});}};}function handleEntityNotFound(_0x24afad,_0x217b15){return function(_0x1309b0){if(!_0x1309b0){_0x24afad[_0x6e35('0x15')](0x194);}return _0x1309b0;};}function handleError(_0x3cbfe4,_0x21c84b){_0x21c84b=_0x21c84b||0x1f4;return function(_0x353bfb){logger[_0x6e35('0x24')](_0x353bfb['stack']);if(_0x353bfb[_0x6e35('0x25')]){delete _0x353bfb[_0x6e35('0x25')];}_0x3cbfe4[_0x6e35('0x17')](_0x21c84b)['send'](_0x353bfb);};}exports['index']=function(_0x441f7f,_0xc4838e){var _0x3167d6={},_0x4f4514={},_0x598d3c={'count':0x0,'rows':[]};var _0x357175=_[_0x6e35('0x26')](db[_0x6e35('0x27')]['rawAttributes'],function(_0x46208a){return{'name':_0x46208a[_0x6e35('0x28')],'type':_0x46208a[_0x6e35('0x29')]['key']};});_0x4f4514[_0x6e35('0x2a')]=_[_0x6e35('0x26')](_0x357175,_0x6e35('0x25'));_0x4f4514[_0x6e35('0x2b')]=_['keys'](_0x441f7f[_0x6e35('0x2b')]);_0x4f4514['filters']=_[_0x6e35('0x2c')](_0x4f4514[_0x6e35('0x2a')],_0x4f4514[_0x6e35('0x2b')]);_0x3167d6[_0x6e35('0x2d')]=_[_0x6e35('0x2c')](_0x4f4514[_0x6e35('0x2a')],qs[_0x6e35('0x2e')](_0x441f7f[_0x6e35('0x2b')][_0x6e35('0x2e')]));_0x3167d6[_0x6e35('0x2d')]=_0x3167d6['attributes'][_0x6e35('0x2f')]?_0x3167d6[_0x6e35('0x2d')]:_0x4f4514['model'];if(!_0x441f7f['query'][_0x6e35('0x30')]('nolimit')){_0x3167d6[_0x6e35('0x1a')]=qs[_0x6e35('0x1a')](_0x441f7f['query'][_0x6e35('0x1a')]);_0x3167d6[_0x6e35('0x19')]=qs[_0x6e35('0x19')](_0x441f7f['query'][_0x6e35('0x19')]);}_0x3167d6[_0x6e35('0x31')]=qs[_0x6e35('0x32')](_0x441f7f[_0x6e35('0x2b')][_0x6e35('0x32')]);_0x3167d6[_0x6e35('0x33')]=qs['filters'](_[_0x6e35('0x34')](_0x441f7f[_0x6e35('0x2b')],_0x4f4514[_0x6e35('0x35')]),_0x357175);if(_0x441f7f[_0x6e35('0x2b')]['filter']){_0x3167d6[_0x6e35('0x33')]=_['merge'](_0x3167d6['where'],{'$or':_[_0x6e35('0x26')](_0x357175,function(_0x22074f){if(_0x22074f['type']!=='VIRTUAL'){var _0x173126={};_0x173126[_0x22074f[_0x6e35('0x25')]]={'$like':'%'+_0x441f7f[_0x6e35('0x2b')]['filter']+'%'};return _0x173126;}})});}_0x3167d6=_['merge']({},_0x3167d6,_0x441f7f[_0x6e35('0x36')]);var _0x411eeb={'where':_0x3167d6['where']};return db[_0x6e35('0x27')][_0x6e35('0x1c')](_0x411eeb)['then'](function(_0x53bc05){_0x598d3c[_0x6e35('0x1c')]=_0x53bc05;if(_0x441f7f['query'][_0x6e35('0x37')]){_0x3167d6[_0x6e35('0x38')]=[{'all':!![]}];}return db[_0x6e35('0x27')][_0x6e35('0x39')](_0x3167d6);})[_0x6e35('0x22')](function(_0x3a2e26){_0x598d3c[_0x6e35('0x3a')]=_0x3a2e26;return _0x598d3c;})['then'](respondWithFilteredResult(_0xc4838e,_0x3167d6))[_0x6e35('0x3b')](handleError(_0xc4838e,null));};exports['show']=function(_0x1d8c28,_0x2b5cf5){var _0x2d8179={'raw':!![],'where':{'id':_0x1d8c28[_0x6e35('0x3c')]['id']}},_0x52b987={};_0x52b987['model']=_[_0x6e35('0x3d')](db[_0x6e35('0x27')][_0x6e35('0x3e')]);_0x52b987[_0x6e35('0x2b')]=_[_0x6e35('0x3d')](_0x1d8c28[_0x6e35('0x2b')]);_0x52b987[_0x6e35('0x35')]=_[_0x6e35('0x2c')](_0x52b987[_0x6e35('0x2a')],_0x52b987[_0x6e35('0x2b')]);_0x2d8179['attributes']=_[_0x6e35('0x2c')](_0x52b987['model'],qs['fields'](_0x1d8c28['query']['fields']));_0x2d8179[_0x6e35('0x2d')]=_0x2d8179['attributes'][_0x6e35('0x2f')]?_0x2d8179['attributes']:_0x52b987[_0x6e35('0x2a')];if(_0x1d8c28[_0x6e35('0x2b')][_0x6e35('0x37')]){_0x2d8179[_0x6e35('0x38')]=[{'all':!![]}];}_0x2d8179=_[_0x6e35('0x3f')]({},_0x2d8179,_0x1d8c28[_0x6e35('0x36')]);return db[_0x6e35('0x27')]['find'](_0x2d8179)[_0x6e35('0x22')](handleEntityNotFound(_0x2b5cf5,null))['then'](respondWithResult(_0x2b5cf5,null))[_0x6e35('0x3b')](handleError(_0x2b5cf5,null));};exports[_0x6e35('0x40')]=function(_0x277e1d,_0x52ac83){return db[_0x6e35('0x27')][_0x6e35('0x40')](_0x277e1d['body'],{})[_0x6e35('0x22')](respondWithResult(_0x52ac83,0xc9))[_0x6e35('0x3b')](handleError(_0x52ac83,null));};exports[_0x6e35('0x41')]=function(_0x10ffa9,_0xdc364a){if(_0x10ffa9[_0x6e35('0x42')]['id']){delete _0x10ffa9['body']['id'];}return db[_0x6e35('0x27')]['find']({'where':{'id':_0x10ffa9[_0x6e35('0x3c')]['id']}})[_0x6e35('0x22')](handleEntityNotFound(_0xdc364a,null))['then'](saveUpdates(_0x10ffa9[_0x6e35('0x42')],null))[_0x6e35('0x22')](respondWithResult(_0xdc364a,null))[_0x6e35('0x3b')](handleError(_0xdc364a,null));};exports[_0x6e35('0x23')]=function(_0x142a1a,_0x1fe514){return db['FaxQueueReport'][_0x6e35('0x43')]({'where':{'id':_0x142a1a[_0x6e35('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1fe514,null))[_0x6e35('0x22')](removeEntity(_0x1fe514,null))[_0x6e35('0x3b')](handleError(_0x1fe514,null));};exports[_0x6e35('0x44')]=function(_0x2624ac,_0x1db30d){return db[_0x6e35('0x27')][_0x6e35('0x44')]()['then'](respondWithResult(_0x1db30d,null))[_0x6e35('0x3b')](handleError(_0x1db30d,null));};
\ No newline at end of file
index d53b5bc..3da020e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x471808,_0x470e7a){var _0xb46439=function(_0x4dd8aa){while(--_0x4dd8aa){_0x471808['push'](_0x471808['shift']());}};_0xb46439(++_0x470e7a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23c184,_0xc987c9){var _0x5623cb=function(_0x4dce68){while(--_0x4dce68){_0x23c184['push'](_0x23c184['shift']());}};_0x5623cb(++_0xc987c9);}(_0x4975,0x86));var _0x5497=function(_0x5c2336,_0x445abf){_0x5c2336=_0x5c2336-0x0;var _0x25ac5=_0x4975[_0x5c2336];return _0x25ac5;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 5a62528..3bf1c53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d48=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','debug','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment','bluebird'];(function(_0x3bfe35,_0x244208){var _0x2121a7=function(_0xc0c309){while(--_0xc0c309){_0x3bfe35['push'](_0x3bfe35['shift']());}};_0x2121a7(++_0x244208);}(_0x5d48,0x7c));var _0x85d4=function(_0x26fe06,_0x55c3ca){_0x26fe06=_0x26fe06-0x0;var _0x1ec488=_0x5d48[_0x26fe06];return _0x1ec488;};'use strict';var _=require(_0x85d4('0x0'));var util=require(_0x85d4('0x1'));var moment=require(_0x85d4('0x2'));var BPromise=require(_0x85d4('0x3'));var rs=require(_0x85d4('0x4'));var fs=require('fs');var Redis=require(_0x85d4('0x5'));var db=require(_0x85d4('0x6'))['db'];var utils=require(_0x85d4('0x7'));var logger=require(_0x85d4('0x8'))('rpc');var config=require(_0x85d4('0x9'));var jayson=require(_0x85d4('0xa'));var client=jayson[_0x85d4('0xb')][_0x85d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bf614,_0x3abc1d,_0x1e86c4){return new BPromise(function(_0x374f61,_0x228309){return client['request'](_0x2bf614,_0x1e86c4)[_0x85d4('0xd')](function(_0x4bcf13){logger[_0x85d4('0xe')](_0x85d4('0xf'),_0x3abc1d,'request\x20sent');logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x3abc1d,'request\x20sent',JSON[_0x85d4('0x10')](_0x4bcf13));if(_0x4bcf13[_0x85d4('0x11')]){if(_0x4bcf13[_0x85d4('0x11')][_0x85d4('0x12')]===0x1f4){logger[_0x85d4('0x11')](_0x85d4('0xf'),_0x3abc1d,_0x4bcf13[_0x85d4('0x11')][_0x85d4('0x13')]);return _0x228309(_0x4bcf13[_0x85d4('0x11')][_0x85d4('0x13')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x3abc1d,_0x4bcf13[_0x85d4('0x11')]['message']);return _0x374f61(_0x4bcf13[_0x85d4('0x11')][_0x85d4('0x13')]);}else{logger[_0x85d4('0xe')](_0x85d4('0xf'),_0x3abc1d,'request\x20sent');_0x374f61(_0x4bcf13[_0x85d4('0x14')]['message']);}})[_0x85d4('0x15')](function(_0x5e13b7){logger[_0x85d4('0x11')](_0x85d4('0xf'),_0x3abc1d,_0x5e13b7);_0x228309(_0x5e13b7);});});}exports[_0x85d4('0x16')]=function(_0x20813d){var _0x5a60bf=this;return new Promise(function(_0x5ce6e7,_0x2c738d){return db[_0x85d4('0x17')][_0x85d4('0x18')](_0x20813d[_0x85d4('0x19')],{'raw':_0x20813d['options']?_0x20813d[_0x85d4('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x85d4('0xd')](function(_0x43be65){logger[_0x85d4('0xe')](_0x85d4('0x16'),_0x20813d);logger[_0x85d4('0x1b')]('CreateFaxQueueReport',_0x20813d,JSON[_0x85d4('0x10')](_0x43be65));_0x5ce6e7(_0x43be65);})[_0x85d4('0x15')](function(_0x46fedf){logger[_0x85d4('0x11')](_0x85d4('0x16'),_0x46fedf[_0x85d4('0x13')],_0x20813d);_0x2c738d(_0x5a60bf['error'](0x1f4,_0x46fedf[_0x85d4('0x13')]));});});};exports[_0x85d4('0x1c')]=function(_0x161c26){var _0x162b9b=this;return new Promise(function(_0x3fa16b,_0x3e2006){return db[_0x85d4('0x17')][_0x85d4('0x1d')](_0x161c26[_0x85d4('0x19')],{'raw':_0x161c26[_0x85d4('0x1a')]?_0x161c26[_0x85d4('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x161c26[_0x85d4('0x1a')]?_0x161c26[_0x85d4('0x1a')]['where']||null:null,'attributes':_0x161c26[_0x85d4('0x1a')]?_0x161c26[_0x85d4('0x1a')][_0x85d4('0x1e')]||null:null,'limit':_0x161c26[_0x85d4('0x1a')]?_0x161c26[_0x85d4('0x1a')][_0x85d4('0x1f')]||null:null})['then'](function(_0x5a4761){logger['info']('UpdateFaxQueueReport',_0x161c26);logger[_0x85d4('0x1b')](_0x85d4('0x1c'),_0x161c26,JSON[_0x85d4('0x10')](_0x5a4761));_0x3fa16b(_0x5a4761);})['catch'](function(_0x1d79c5){logger['error'](_0x85d4('0x1c'),_0x1d79c5[_0x85d4('0x13')],_0x161c26);_0x3e2006(_0x162b9b[_0x85d4('0x11')](0x1f4,_0x1d79c5[_0x85d4('0x13')]));});});};
\ No newline at end of file
+var _0x566f=['body','options','raw','debug','UpdateFaxQueueReport','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport'];(function(_0x48732f,_0x3c0f88){var _0x57a296=function(_0x368ee0){while(--_0x368ee0){_0x48732f['push'](_0x48732f['shift']());}};_0x57a296(++_0x3c0f88);}(_0x566f,0x108));var _0xf566=function(_0x517900,_0x1da8f2){_0x517900=_0x517900-0x0;var _0x350616=_0x566f[_0x517900];return _0x350616;};'use strict';var _=require('lodash');var util=require(_0xf566('0x0'));var moment=require('moment');var BPromise=require(_0xf566('0x1'));var rs=require(_0xf566('0x2'));var fs=require('fs');var Redis=require(_0xf566('0x3'));var db=require(_0xf566('0x4'))['db'];var utils=require(_0xf566('0x5'));var logger=require(_0xf566('0x6'))(_0xf566('0x7'));var config=require(_0xf566('0x8'));var jayson=require(_0xf566('0x9'));var client=jayson[_0xf566('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30a023,_0x26aa61,_0x21c564){return new BPromise(function(_0x559f7f,_0x2f319b){return client[_0xf566('0xb')](_0x30a023,_0x21c564)[_0xf566('0xc')](function(_0x75de90){logger[_0xf566('0xd')](_0xf566('0xe'),_0x26aa61,_0xf566('0xf'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x26aa61,_0xf566('0xf'),JSON[_0xf566('0x10')](_0x75de90));if(_0x75de90[_0xf566('0x11')]){if(_0x75de90[_0xf566('0x11')][_0xf566('0x12')]===0x1f4){logger[_0xf566('0x11')](_0xf566('0xe'),_0x26aa61,_0x75de90[_0xf566('0x11')][_0xf566('0x13')]);return _0x2f319b(_0x75de90[_0xf566('0x11')]['message']);}logger[_0xf566('0x11')](_0xf566('0xe'),_0x26aa61,_0x75de90[_0xf566('0x11')]['message']);return _0x559f7f(_0x75de90[_0xf566('0x11')]['message']);}else{logger[_0xf566('0xd')](_0xf566('0xe'),_0x26aa61,_0xf566('0xf'));_0x559f7f(_0x75de90[_0xf566('0x14')][_0xf566('0x13')]);}})[_0xf566('0x15')](function(_0x87fa44){logger[_0xf566('0x11')](_0xf566('0xe'),_0x26aa61,_0x87fa44);_0x2f319b(_0x87fa44);});});}exports[_0xf566('0x16')]=function(_0x50dc2d){var _0x33e2df=this;return new Promise(function(_0x2e14bf,_0x379a08){return db[_0xf566('0x17')]['create'](_0x50dc2d[_0xf566('0x18')],{'raw':_0x50dc2d[_0xf566('0x19')]?_0x50dc2d[_0xf566('0x19')][_0xf566('0x1a')]===undefined?!![]:![]:!![]})[_0xf566('0xc')](function(_0x376ad5){logger[_0xf566('0xd')]('CreateFaxQueueReport',_0x50dc2d);logger[_0xf566('0x1b')](_0xf566('0x16'),_0x50dc2d,JSON[_0xf566('0x10')](_0x376ad5));_0x2e14bf(_0x376ad5);})['catch'](function(_0xe790e5){logger[_0xf566('0x11')]('CreateFaxQueueReport',_0xe790e5[_0xf566('0x13')],_0x50dc2d);_0x379a08(_0x33e2df[_0xf566('0x11')](0x1f4,_0xe790e5[_0xf566('0x13')]));});});};exports[_0xf566('0x1c')]=function(_0x31cce2){var _0x3836c5=this;return new Promise(function(_0xf851cb,_0x364f1d){return db[_0xf566('0x17')]['update'](_0x31cce2[_0xf566('0x18')],{'raw':_0x31cce2[_0xf566('0x19')]?_0x31cce2[_0xf566('0x19')][_0xf566('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31cce2[_0xf566('0x19')]?_0x31cce2[_0xf566('0x19')][_0xf566('0x1d')]||null:null,'attributes':_0x31cce2['options']?_0x31cce2[_0xf566('0x19')][_0xf566('0x1e')]||null:null,'limit':_0x31cce2['options']?_0x31cce2[_0xf566('0x19')][_0xf566('0x1f')]||null:null})[_0xf566('0xc')](function(_0x4f2401){logger[_0xf566('0xd')]('UpdateFaxQueueReport',_0x31cce2);logger[_0xf566('0x1b')](_0xf566('0x1c'),_0x31cce2,JSON['stringify'](_0x4f2401));_0xf851cb(_0x4f2401);})[_0xf566('0x15')](function(_0x39a7d5){logger[_0xf566('0x11')](_0xf566('0x1c'),_0x39a7d5[_0xf566('0x13')],_0x31cce2);_0x364f1d(_0x3836c5[_0xf566('0x11')](0x1f4,_0x39a7d5[_0xf566('0x13')]));});});};
\ No newline at end of file
index 0e13aee..743a80c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58ee=['put','/:id','delete','destroy','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','show','post','create'];(function(_0x3c010b,_0x39b764){var _0x2158f5=function(_0x1e7a40){while(--_0x1e7a40){_0x3c010b['push'](_0x3c010b['shift']());}};_0x2158f5(++_0x39b764);}(_0x58ee,0x84));var _0xe58e=function(_0xe718f,_0x182e6a){_0xe718f=_0xe718f-0x0;var _0x31b388=_0x58ee[_0xe718f];return _0x31b388;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe58e('0x0'));var express=require(_0xe58e('0x1'));var router=express['Router']();var fs_extra=require(_0xe58e('0x2'));var auth=require(_0xe58e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe58e('0x4'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0xe58e('0x5')](),controller[_0xe58e('0x6')]);router[_0xe58e('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xe58e('0x8')]);router[_0xe58e('0x7')]('/:id',auth[_0xe58e('0x5')](),controller[_0xe58e('0x9')]);router[_0xe58e('0xa')]('/',auth['isAuthenticated'](),controller[_0xe58e('0xb')]);router[_0xe58e('0xc')](_0xe58e('0xd'),auth[_0xe58e('0x5')](),controller['update']);router[_0xe58e('0xe')]('/:id',auth[_0xe58e('0x5')](),controller[_0xe58e('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x8b95=['isAuthenticated','index','get','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller'];(function(_0x2cb64b,_0x5c3db9){var _0x510a6d=function(_0x13b042){while(--_0x13b042){_0x2cb64b['push'](_0x2cb64b['shift']());}};_0x510a6d(++_0x5c3db9);}(_0x8b95,0x16c));var _0x58b9=function(_0x528af3,_0x35b5e7){_0x528af3=_0x528af3-0x0;var _0x90f4ea=_0x8b95[_0x528af3];return _0x90f4ea;};'use strict';var multer=require(_0x58b9('0x0'));var util=require(_0x58b9('0x1'));var path=require(_0x58b9('0x2'));var timeout=require(_0x58b9('0x3'));var express=require('express');var router=express[_0x58b9('0x4')]();var fs_extra=require(_0x58b9('0x5'));var auth=require(_0x58b9('0x6'));var interaction=require(_0x58b9('0x7'));var config=require(_0x58b9('0x8'));var controller=require(_0x58b9('0x9'));router['get']('/',auth[_0x58b9('0xa')](),controller[_0x58b9('0xb')]);router[_0x58b9('0xc')](_0x58b9('0xd'),auth[_0x58b9('0xa')](),controller[_0x58b9('0xe')]);router[_0x58b9('0xc')](_0x58b9('0xf'),auth[_0x58b9('0xa')](),controller[_0x58b9('0x10')]);router[_0x58b9('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x58b9('0x12')](_0x58b9('0xf'),auth[_0x58b9('0xa')](),controller['update']);router[_0x58b9('0x13')](_0x58b9('0xf'),auth['isAuthenticated'](),controller[_0x58b9('0x14')]);module[_0x58b9('0x15')]=router;
\ No newline at end of file
index 5288520..4f7f0ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x47c0a5,_0x21fb53){var _0x50878c=function(_0xa930){while(--_0xa930){_0x47c0a5['push'](_0x47c0a5['shift']());}};_0x50878c(++_0x21fb53);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0xcaad4,_0x270dcc){var _0x2e9b55=function(_0x555696){while(--_0x555696){_0xcaad4['push'](_0xcaad4['shift']());}};_0x2e9b55(++_0x270dcc);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
index ffb7d06..d079cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41b3=['Content-Range','apply','reject','save','update','then','destroy','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x41b3,0x1a0));var _0x341b=function(_0x295dd5,_0x5313e9){_0x295dd5=_0x295dd5-0x0;var _0x566d66=_0x41b3[_0x295dd5];return _0x566d66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x341b('0x0'));var zipdir=require(_0x341b('0x1'));var jsonpatch=require(_0x341b('0x2'));var rp=require(_0x341b('0x3'));var moment=require(_0x341b('0x4'));var BPromise=require(_0x341b('0x5'));var Mustache=require(_0x341b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x341b('0x7'));var csv=require(_0x341b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x341b('0x9'));var _=require(_0x341b('0xa'));var squel=require(_0x341b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x341b('0x8'));var querystring=require(_0x341b('0xc'));var Papa=require(_0x341b('0xd'));var Redis=require(_0x341b('0xe'));var authService=require(_0x341b('0xf'));var qs=require(_0x341b('0x10'));var as=require(_0x341b('0x11'));var hardwareService=require(_0x341b('0x12'));var logger=require(_0x341b('0x13'))(_0x341b('0x14'));var utils=require(_0x341b('0x15'));var config=require(_0x341b('0x16'));var licenseUtil=require(_0x341b('0x17'));var db=require(_0x341b('0x18'))['db'];function respondWithStatusCode(_0x3bfba3,_0xfb7a2e){_0xfb7a2e=_0xfb7a2e||0xcc;return function(_0x453297){if(_0x453297){return _0x3bfba3[_0x341b('0x19')](_0xfb7a2e);}return _0x3bfba3[_0x341b('0x1a')](_0xfb7a2e)[_0x341b('0x1b')]();};}function respondWithResult(_0x1f68b8,_0x2dbc93){_0x2dbc93=_0x2dbc93||0xc8;return function(_0x2152e3){if(_0x2152e3){return _0x1f68b8[_0x341b('0x1a')](_0x2dbc93)[_0x341b('0x1c')](_0x2152e3);}};}function respondWithFilteredResult(_0x30f700,_0x147eeb){return function(_0x46474e){if(_0x46474e){var _0x3b9ab8=typeof _0x147eeb[_0x341b('0x1d')]===_0x341b('0x1e')&&typeof _0x147eeb[_0x341b('0x1f')]==='undefined';var _0x43b57c=_0x46474e[_0x341b('0x20')];var _0x52080e=_0x3b9ab8?0x0:_0x147eeb[_0x341b('0x1d')];var _0x420764=_0x3b9ab8?_0x46474e[_0x341b('0x20')]:_0x147eeb[_0x341b('0x1d')]+_0x147eeb[_0x341b('0x1f')];var _0x5e8851;if(_0x420764>=_0x43b57c){_0x420764=_0x43b57c;_0x5e8851=0xc8;}else{_0x5e8851=0xce;}_0x30f700[_0x341b('0x1a')](_0x5e8851);return _0x30f700[_0x341b('0x21')](_0x341b('0x22'),_0x52080e+'-'+_0x420764+'/'+_0x43b57c)[_0x341b('0x1c')](_0x46474e);}return null;};}function patchUpdates(_0x310156){return function(_0x2b6daa){try{jsonpatch[_0x341b('0x23')](_0x2b6daa,_0x310156,!![]);}catch(_0x5bb93c){return BPromise[_0x341b('0x24')](_0x5bb93c);}return _0x2b6daa[_0x341b('0x25')]();};}function saveUpdates(_0x4fa435,_0x580b62){return function(_0xae04ca){if(_0xae04ca){return _0xae04ca[_0x341b('0x26')](_0x4fa435)[_0x341b('0x27')](function(_0x4b1dce){return _0x4b1dce;});}return null;};}function removeEntity(_0x5525d6,_0x2a756f){return function(_0x2ee09d){if(_0x2ee09d){return _0x2ee09d[_0x341b('0x28')]()[_0x341b('0x27')](function(){_0x5525d6[_0x341b('0x1a')](0xcc)[_0x341b('0x1b')]();});}};}function handleEntityNotFound(_0x4a698,_0x3a9021){return function(_0x472084){if(!_0x472084){_0x4a698['sendStatus'](0x194);}return _0x472084;};}function handleError(_0x8a13b,_0x1b2dee){_0x1b2dee=_0x1b2dee||0x1f4;return function(_0x4a8e64){logger['error'](_0x4a8e64['stack']);if(_0x4a8e64['name']){delete _0x4a8e64[_0x341b('0x29')];}_0x8a13b[_0x341b('0x1a')](_0x1b2dee)[_0x341b('0x2a')](_0x4a8e64);};}exports['index']=function(_0x5aec0a,_0x1b504c){var _0x27a79b={},_0x16b672={},_0x584139={'count':0x0,'rows':[]};var _0x591845=_[_0x341b('0x2b')](db[_0x341b('0x2c')][_0x341b('0x2d')],function(_0x1059d1){return{'name':_0x1059d1[_0x341b('0x2e')],'type':_0x1059d1[_0x341b('0x2f')]['key']};});_0x16b672[_0x341b('0x30')]=_[_0x341b('0x2b')](_0x591845,'name');_0x16b672[_0x341b('0x31')]=_[_0x341b('0x32')](_0x5aec0a[_0x341b('0x31')]);_0x16b672[_0x341b('0x33')]=_[_0x341b('0x34')](_0x16b672[_0x341b('0x30')],_0x16b672['query']);_0x27a79b[_0x341b('0x35')]=_[_0x341b('0x34')](_0x16b672[_0x341b('0x30')],qs['fields'](_0x5aec0a['query'][_0x341b('0x36')]));_0x27a79b[_0x341b('0x35')]=_0x27a79b[_0x341b('0x35')][_0x341b('0x37')]?_0x27a79b[_0x341b('0x35')]:_0x16b672[_0x341b('0x30')];if(!_0x5aec0a[_0x341b('0x31')][_0x341b('0x38')]('nolimit')){_0x27a79b[_0x341b('0x1f')]=qs[_0x341b('0x1f')](_0x5aec0a['query'][_0x341b('0x1f')]);_0x27a79b[_0x341b('0x1d')]=qs['offset'](_0x5aec0a[_0x341b('0x31')][_0x341b('0x1d')]);}_0x27a79b[_0x341b('0x39')]=qs[_0x341b('0x3a')](_0x5aec0a[_0x341b('0x31')][_0x341b('0x3a')]);_0x27a79b[_0x341b('0x3b')]=qs[_0x341b('0x33')](_[_0x341b('0x3c')](_0x5aec0a[_0x341b('0x31')],_0x16b672[_0x341b('0x33')]),_0x591845);if(_0x5aec0a[_0x341b('0x31')][_0x341b('0x3d')]){_0x27a79b[_0x341b('0x3b')]=_['merge'](_0x27a79b[_0x341b('0x3b')],{'$or':_[_0x341b('0x2b')](_0x591845,function(_0x47a451){if(_0x47a451[_0x341b('0x2f')]!==_0x341b('0x3e')){var _0x32ea4d={};_0x32ea4d[_0x47a451[_0x341b('0x29')]]={'$like':'%'+_0x5aec0a[_0x341b('0x31')][_0x341b('0x3d')]+'%'};return _0x32ea4d;}})});}_0x27a79b=_['merge']({},_0x27a79b,_0x5aec0a[_0x341b('0x3f')]);var _0x2d5fd3={'where':_0x27a79b[_0x341b('0x3b')]};return db[_0x341b('0x2c')][_0x341b('0x20')](_0x2d5fd3)[_0x341b('0x27')](function(_0x352166){_0x584139[_0x341b('0x20')]=_0x352166;if(_0x5aec0a[_0x341b('0x31')][_0x341b('0x40')]){_0x27a79b[_0x341b('0x41')]=[{'all':!![]}];}return db[_0x341b('0x2c')][_0x341b('0x42')](_0x27a79b);})[_0x341b('0x27')](function(_0x427f7b){_0x584139[_0x341b('0x43')]=_0x427f7b;return _0x584139;})['then'](respondWithFilteredResult(_0x1b504c,_0x27a79b))[_0x341b('0x44')](handleError(_0x1b504c,null));};exports[_0x341b('0x45')]=function(_0x49ac63,_0x171722){var _0x2115e7={'raw':!![],'where':{'id':_0x49ac63[_0x341b('0x46')]['id']}},_0x5034bb={};_0x5034bb[_0x341b('0x30')]=_[_0x341b('0x32')](db[_0x341b('0x2c')][_0x341b('0x2d')]);_0x5034bb['query']=_[_0x341b('0x32')](_0x49ac63[_0x341b('0x31')]);_0x5034bb['filters']=_[_0x341b('0x34')](_0x5034bb[_0x341b('0x30')],_0x5034bb[_0x341b('0x31')]);_0x2115e7['attributes']=_['intersection'](_0x5034bb[_0x341b('0x30')],qs[_0x341b('0x36')](_0x49ac63['query']['fields']));_0x2115e7['attributes']=_0x2115e7[_0x341b('0x35')][_0x341b('0x37')]?_0x2115e7[_0x341b('0x35')]:_0x5034bb[_0x341b('0x30')];if(_0x49ac63['query'][_0x341b('0x40')]){_0x2115e7[_0x341b('0x41')]=[{'all':!![]}];}_0x2115e7=_['merge']({},_0x2115e7,_0x49ac63[_0x341b('0x3f')]);return db[_0x341b('0x2c')][_0x341b('0x47')](_0x2115e7)[_0x341b('0x27')](handleEntityNotFound(_0x171722,null))[_0x341b('0x27')](respondWithResult(_0x171722,null))[_0x341b('0x44')](handleError(_0x171722,null));};exports[_0x341b('0x48')]=function(_0x4754b4,_0x9b9930){return db[_0x341b('0x2c')][_0x341b('0x48')](_0x4754b4[_0x341b('0x49')],{})[_0x341b('0x27')](respondWithResult(_0x9b9930,0xc9))[_0x341b('0x44')](handleError(_0x9b9930,null));};exports['update']=function(_0x3e0515,_0x311be4){if(_0x3e0515[_0x341b('0x49')]['id']){delete _0x3e0515[_0x341b('0x49')]['id'];}return db[_0x341b('0x2c')][_0x341b('0x47')]({'where':{'id':_0x3e0515[_0x341b('0x46')]['id']}})[_0x341b('0x27')](handleEntityNotFound(_0x311be4,null))[_0x341b('0x27')](saveUpdates(_0x3e0515[_0x341b('0x49')],null))[_0x341b('0x27')](respondWithResult(_0x311be4,null))[_0x341b('0x44')](handleError(_0x311be4,null));};exports['destroy']=function(_0x1d27d6,_0x55c746){return db[_0x341b('0x2c')]['find']({'where':{'id':_0x1d27d6[_0x341b('0x46')]['id']}})[_0x341b('0x27')](handleEntityNotFound(_0x55c746,null))[_0x341b('0x27')](removeEntity(_0x55c746,null))[_0x341b('0x44')](handleError(_0x55c746,null));};exports[_0x341b('0x4a')]=function(_0x3074b5,_0xe70646){return db['FaxTransferReport']['describe']()[_0x341b('0x27')](respondWithResult(_0xe70646,null))[_0x341b('0x44')](handleError(_0xe70646,null));};
\ No newline at end of file
+var _0x8d83=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','create','body','find','catch','describe','eml-format','rimraf','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','end','name','FaxTransferReport','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','length'];(function(_0x261b30,_0x4b4ae4){var _0x5643d0=function(_0x534d6a){while(--_0x534d6a){_0x261b30['push'](_0x261b30['shift']());}};_0x5643d0(++_0x4b4ae4);}(_0x8d83,0xd8));var _0x38d8=function(_0xacb68d,_0x1de886){_0xacb68d=_0xacb68d-0x0;var _0x1c37e9=_0x8d83[_0xacb68d];return _0x1c37e9;};'use strict';var emlformat=require(_0x38d8('0x0'));var rimraf=require(_0x38d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38d8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x38d8('0x3'));var util=require('util');var path=require(_0x38d8('0x4'));var sox=require(_0x38d8('0x5'));var csv=require(_0x38d8('0x6'));var ejs=require(_0x38d8('0x7'));var fs=require('fs');var fs_extra=require(_0x38d8('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x38d8('0x9'));var jsforce=require(_0x38d8('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x38d8('0xb'));var Papa=require('papaparse');var Redis=require(_0x38d8('0xc'));var authService=require(_0x38d8('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38d8('0xe'));var logger=require(_0x38d8('0xf'))('api');var utils=require(_0x38d8('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd61f10,_0xc067b3){_0xc067b3=_0xc067b3||0xcc;return function(_0x14f599){if(_0x14f599){return _0xd61f10[_0x38d8('0x11')](_0xc067b3);}return _0xd61f10[_0x38d8('0x12')](_0xc067b3)['end']();};}function respondWithResult(_0x139305,_0x5f5049){_0x5f5049=_0x5f5049||0xc8;return function(_0xbc4c71){if(_0xbc4c71){return _0x139305[_0x38d8('0x12')](_0x5f5049)[_0x38d8('0x13')](_0xbc4c71);}};}function respondWithFilteredResult(_0x11b505,_0x13a26b){return function(_0x29d48a){if(_0x29d48a){var _0x1aa17b=typeof _0x13a26b[_0x38d8('0x14')]===_0x38d8('0x15')&&typeof _0x13a26b[_0x38d8('0x16')]===_0x38d8('0x15');var _0x4f2b95=_0x29d48a[_0x38d8('0x17')];var _0x21f490=_0x1aa17b?0x0:_0x13a26b[_0x38d8('0x14')];var _0x53ce6b=_0x1aa17b?_0x29d48a['count']:_0x13a26b['offset']+_0x13a26b[_0x38d8('0x16')];var _0x53a5a4;if(_0x53ce6b>=_0x4f2b95){_0x53ce6b=_0x4f2b95;_0x53a5a4=0xc8;}else{_0x53a5a4=0xce;}_0x11b505[_0x38d8('0x12')](_0x53a5a4);return _0x11b505[_0x38d8('0x18')]('Content-Range',_0x21f490+'-'+_0x53ce6b+'/'+_0x4f2b95)[_0x38d8('0x13')](_0x29d48a);}return null;};}function patchUpdates(_0x407ab8){return function(_0x4d6613){try{jsonpatch[_0x38d8('0x19')](_0x4d6613,_0x407ab8,!![]);}catch(_0x2f881a){return BPromise[_0x38d8('0x1a')](_0x2f881a);}return _0x4d6613['save']();};}function saveUpdates(_0x21949d,_0x10c123){return function(_0x1f318c){if(_0x1f318c){return _0x1f318c[_0x38d8('0x1b')](_0x21949d)['then'](function(_0x3c1662){return _0x3c1662;});}return null;};}function removeEntity(_0x2e4a38,_0x208139){return function(_0x46cee1){if(_0x46cee1){return _0x46cee1[_0x38d8('0x1c')]()[_0x38d8('0x1d')](function(){_0x2e4a38[_0x38d8('0x12')](0xcc)[_0x38d8('0x1e')]();});}};}function handleEntityNotFound(_0x45cc0d,_0x2bc7f2){return function(_0x46c075){if(!_0x46c075){_0x45cc0d[_0x38d8('0x11')](0x194);}return _0x46c075;};}function handleError(_0x2e78ba,_0x47e998){_0x47e998=_0x47e998||0x1f4;return function(_0x18ffe8){logger['error'](_0x18ffe8['stack']);if(_0x18ffe8[_0x38d8('0x1f')]){delete _0x18ffe8[_0x38d8('0x1f')];}_0x2e78ba[_0x38d8('0x12')](_0x47e998)['send'](_0x18ffe8);};}exports['index']=function(_0x31fa7d,_0x5278c4){var _0xd3412b={},_0x61fe1f={},_0x42d497={'count':0x0,'rows':[]};var _0x437fc3=_['map'](db[_0x38d8('0x20')][_0x38d8('0x21')],function(_0x4923be){return{'name':_0x4923be[_0x38d8('0x22')],'type':_0x4923be['type'][_0x38d8('0x23')]};});_0x61fe1f['model']=_[_0x38d8('0x24')](_0x437fc3,_0x38d8('0x1f'));_0x61fe1f[_0x38d8('0x25')]=_[_0x38d8('0x26')](_0x31fa7d[_0x38d8('0x25')]);_0x61fe1f['filters']=_[_0x38d8('0x27')](_0x61fe1f[_0x38d8('0x28')],_0x61fe1f['query']);_0xd3412b['attributes']=_['intersection'](_0x61fe1f[_0x38d8('0x28')],qs[_0x38d8('0x29')](_0x31fa7d[_0x38d8('0x25')][_0x38d8('0x29')]));_0xd3412b['attributes']=_0xd3412b[_0x38d8('0x2a')][_0x38d8('0x2b')]?_0xd3412b['attributes']:_0x61fe1f[_0x38d8('0x28')];if(!_0x31fa7d['query'][_0x38d8('0x2c')](_0x38d8('0x2d'))){_0xd3412b['limit']=qs[_0x38d8('0x16')](_0x31fa7d[_0x38d8('0x25')]['limit']);_0xd3412b[_0x38d8('0x14')]=qs[_0x38d8('0x14')](_0x31fa7d[_0x38d8('0x25')][_0x38d8('0x14')]);}_0xd3412b[_0x38d8('0x2e')]=qs['sort'](_0x31fa7d[_0x38d8('0x25')][_0x38d8('0x2f')]);_0xd3412b[_0x38d8('0x30')]=qs[_0x38d8('0x31')](_[_0x38d8('0x32')](_0x31fa7d[_0x38d8('0x25')],_0x61fe1f[_0x38d8('0x31')]),_0x437fc3);if(_0x31fa7d[_0x38d8('0x25')][_0x38d8('0x33')]){_0xd3412b['where']=_[_0x38d8('0x34')](_0xd3412b[_0x38d8('0x30')],{'$or':_[_0x38d8('0x24')](_0x437fc3,function(_0x317ab4){if(_0x317ab4['type']!==_0x38d8('0x35')){var _0xf0600c={};_0xf0600c[_0x317ab4[_0x38d8('0x1f')]]={'$like':'%'+_0x31fa7d[_0x38d8('0x25')][_0x38d8('0x33')]+'%'};return _0xf0600c;}})});}_0xd3412b=_[_0x38d8('0x34')]({},_0xd3412b,_0x31fa7d[_0x38d8('0x36')]);var _0x304b30={'where':_0xd3412b[_0x38d8('0x30')]};return db['FaxTransferReport']['count'](_0x304b30)[_0x38d8('0x1d')](function(_0x2ac979){_0x42d497['count']=_0x2ac979;if(_0x31fa7d[_0x38d8('0x25')][_0x38d8('0x37')]){_0xd3412b['include']=[{'all':!![]}];}return db[_0x38d8('0x20')][_0x38d8('0x38')](_0xd3412b);})[_0x38d8('0x1d')](function(_0x1131f5){_0x42d497['rows']=_0x1131f5;return _0x42d497;})[_0x38d8('0x1d')](respondWithFilteredResult(_0x5278c4,_0xd3412b))['catch'](handleError(_0x5278c4,null));};exports[_0x38d8('0x39')]=function(_0x537f30,_0x46c8e6){var _0x1df097={'raw':!![],'where':{'id':_0x537f30[_0x38d8('0x3a')]['id']}},_0x3e01d3={};_0x3e01d3[_0x38d8('0x28')]=_[_0x38d8('0x26')](db[_0x38d8('0x20')][_0x38d8('0x21')]);_0x3e01d3[_0x38d8('0x25')]=_[_0x38d8('0x26')](_0x537f30[_0x38d8('0x25')]);_0x3e01d3[_0x38d8('0x31')]=_[_0x38d8('0x27')](_0x3e01d3['model'],_0x3e01d3[_0x38d8('0x25')]);_0x1df097[_0x38d8('0x2a')]=_[_0x38d8('0x27')](_0x3e01d3['model'],qs['fields'](_0x537f30[_0x38d8('0x25')]['fields']));_0x1df097[_0x38d8('0x2a')]=_0x1df097[_0x38d8('0x2a')][_0x38d8('0x2b')]?_0x1df097[_0x38d8('0x2a')]:_0x3e01d3['model'];if(_0x537f30['query'][_0x38d8('0x37')]){_0x1df097[_0x38d8('0x3b')]=[{'all':!![]}];}_0x1df097=_[_0x38d8('0x34')]({},_0x1df097,_0x537f30[_0x38d8('0x36')]);return db['FaxTransferReport']['find'](_0x1df097)[_0x38d8('0x1d')](handleEntityNotFound(_0x46c8e6,null))[_0x38d8('0x1d')](respondWithResult(_0x46c8e6,null))['catch'](handleError(_0x46c8e6,null));};exports[_0x38d8('0x3c')]=function(_0x3e8aa5,_0x490425){return db[_0x38d8('0x20')][_0x38d8('0x3c')](_0x3e8aa5[_0x38d8('0x3d')],{})[_0x38d8('0x1d')](respondWithResult(_0x490425,0xc9))['catch'](handleError(_0x490425,null));};exports[_0x38d8('0x1b')]=function(_0x46a813,_0x9516a6){if(_0x46a813['body']['id']){delete _0x46a813[_0x38d8('0x3d')]['id'];}return db[_0x38d8('0x20')][_0x38d8('0x3e')]({'where':{'id':_0x46a813[_0x38d8('0x3a')]['id']}})[_0x38d8('0x1d')](handleEntityNotFound(_0x9516a6,null))[_0x38d8('0x1d')](saveUpdates(_0x46a813[_0x38d8('0x3d')],null))['then'](respondWithResult(_0x9516a6,null))[_0x38d8('0x3f')](handleError(_0x9516a6,null));};exports[_0x38d8('0x1c')]=function(_0x1679ec,_0x23ffff){return db[_0x38d8('0x20')][_0x38d8('0x3e')]({'where':{'id':_0x1679ec[_0x38d8('0x3a')]['id']}})[_0x38d8('0x1d')](handleEntityNotFound(_0x23ffff,null))[_0x38d8('0x1d')](removeEntity(_0x23ffff,null))[_0x38d8('0x3f')](handleError(_0x23ffff,null));};exports[_0x38d8('0x40')]=function(_0x2266be,_0x2423da){return db[_0x38d8('0x20')]['describe']()['then'](respondWithResult(_0x2423da,null))['catch'](handleError(_0x2423da,null));};
\ No newline at end of file
index 962f648..3a0207c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe421=['exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes'];(function(_0x357379,_0x314a4a){var _0x27a56c=function(_0x336bdd){while(--_0x336bdd){_0x357379['push'](_0x357379['shift']());}};_0x27a56c(++_0x314a4a);}(_0xe421,0x10f));var _0x1e42=function(_0x58cc0c,_0x317d61){_0x58cc0c=_0x58cc0c-0x0;var _0x107eaa=_0xe421[_0x58cc0c];return _0x107eaa;};'use strict';var _=require(_0x1e42('0x0'));var util=require(_0x1e42('0x1'));var logger=require('../../config/logger')(_0x1e42('0x2'));var moment=require(_0x1e42('0x3'));var BPromise=require(_0x1e42('0x4'));var rp=require(_0x1e42('0x5'));var fs=require('fs');var path=require(_0x1e42('0x6'));var rimraf=require('rimraf');var config=require(_0x1e42('0x7'));var attributes=require(_0x1e42('0x8'));module[_0x1e42('0x9')]=function(_0x25fc1c,_0x339b55){return _0x25fc1c[_0x1e42('0xa')](_0x1e42('0xb'),attributes,{'tableName':_0x1e42('0xc'),'paranoid':![],'indexes':[{'name':_0x1e42('0xd'),'fields':[_0x1e42('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cde=['lodash','api','path','rimraf','exports','define','uniqueid'];(function(_0x928b87,_0x53480a){var _0x1e7638=function(_0x1e2184){while(--_0x1e2184){_0x928b87['push'](_0x928b87['shift']());}};_0x1e7638(++_0x53480a);}(_0x8cde,0x1d5));var _0xe8cd=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x8cde[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xe8cd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe8cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8cd('0x2'));var rimraf=require(_0xe8cd('0x3'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0xe8cd('0x4')]=function(_0x18e6d8,_0x538cf4){return _0x18e6d8[_0xe8cd('0x5')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xe8cd('0x6'),'fields':[_0xe8cd('0x6')]}],'timestamps':!![]});};
\ No newline at end of file
index f68ad97..54f8b8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7e9=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','request','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x3c3a43,_0xb8dd53){var _0x23e197=function(_0x1fb6cb){while(--_0x1fb6cb){_0x3c3a43['push'](_0x3c3a43['shift']());}};_0x23e197(++_0xb8dd53);}(_0xc7e9,0x1c8));var _0x9c7e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7e9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x9c7e('0x0'));var moment=require(_0x9c7e('0x1'));var BPromise=require(_0x9c7e('0x2'));var rs=require(_0x9c7e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c7e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c7e('0x5'))('rpc');var config=require(_0x9c7e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9c7e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c893c,_0x550123,_0x3c8631){return new BPromise(function(_0x141349,_0x517fc4){return client[_0x9c7e('0x8')](_0x1c893c,_0x3c8631)[_0x9c7e('0x9')](function(_0x5d4d90){logger['info'](_0x9c7e('0xa'),_0x550123,'request\x20sent');logger[_0x9c7e('0xb')](_0x9c7e('0xc'),_0x550123,_0x9c7e('0xd'),JSON[_0x9c7e('0xe')](_0x5d4d90));if(_0x5d4d90[_0x9c7e('0xf')]){if(_0x5d4d90['error'][_0x9c7e('0x10')]===0x1f4){logger[_0x9c7e('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x550123,_0x5d4d90[_0x9c7e('0xf')][_0x9c7e('0x11')]);return _0x517fc4(_0x5d4d90[_0x9c7e('0xf')][_0x9c7e('0x11')]);}logger[_0x9c7e('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x550123,_0x5d4d90[_0x9c7e('0xf')][_0x9c7e('0x11')]);return _0x141349(_0x5d4d90['error']['message']);}else{logger['info'](_0x9c7e('0xa'),_0x550123,'request\x20sent');_0x141349(_0x5d4d90['result']['message']);}})[_0x9c7e('0x12')](function(_0x12a668){logger[_0x9c7e('0xf')](_0x9c7e('0xa'),_0x550123,_0x12a668);_0x517fc4(_0x12a668);});});}
\ No newline at end of file
+var _0x8835=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x3fb07b,_0x2920ca){var _0x15cdb4=function(_0x93d9d5){while(--_0x93d9d5){_0x3fb07b['push'](_0x3fb07b['shift']());}};_0x15cdb4(++_0x2920ca);}(_0x8835,0x1ed));var _0x5883=function(_0x9c26d,_0x5b4537){_0x9c26d=_0x9c26d-0x0;var _0x23d7bb=_0x8835[_0x9c26d];return _0x23d7bb;};'use strict';var _=require(_0x5883('0x0'));var util=require(_0x5883('0x1'));var moment=require(_0x5883('0x2'));var BPromise=require(_0x5883('0x3'));var rs=require(_0x5883('0x4'));var fs=require('fs');var Redis=require(_0x5883('0x5'));var db=require(_0x5883('0x6'))['db'];var utils=require(_0x5883('0x7'));var logger=require(_0x5883('0x8'))(_0x5883('0x9'));var config=require('../../config/environment');var jayson=require(_0x5883('0xa'));var client=jayson[_0x5883('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6f2049,_0x48383f,_0x52b587){return new BPromise(function(_0x125dbc,_0x38d11b){return client['request'](_0x6f2049,_0x52b587)[_0x5883('0xc')](function(_0x91f7b7){logger[_0x5883('0xd')](_0x5883('0xe'),_0x48383f,_0x5883('0xf'));logger['debug'](_0x5883('0x10'),_0x48383f,_0x5883('0xf'),JSON[_0x5883('0x11')](_0x91f7b7));if(_0x91f7b7['error']){if(_0x91f7b7[_0x5883('0x12')][_0x5883('0x13')]===0x1f4){logger[_0x5883('0x12')](_0x5883('0xe'),_0x48383f,_0x91f7b7['error'][_0x5883('0x14')]);return _0x38d11b(_0x91f7b7[_0x5883('0x12')]['message']);}logger[_0x5883('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x48383f,_0x91f7b7[_0x5883('0x12')][_0x5883('0x14')]);return _0x125dbc(_0x91f7b7[_0x5883('0x12')]['message']);}else{logger[_0x5883('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x48383f,'request\x20sent');_0x125dbc(_0x91f7b7[_0x5883('0x15')][_0x5883('0x14')]);}})[_0x5883('0x16')](function(_0x2ab060){logger[_0x5883('0x12')](_0x5883('0xe'),_0x48383f,_0x2ab060);_0x38d11b(_0x2ab060);});});}
\ No newline at end of file
index f44bc41..08bade5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x712d=['/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','get'];(function(_0x43e4f9,_0x250f37){var _0x1d1878=function(_0x5a3675){while(--_0x5a3675){_0x43e4f9['push'](_0x43e4f9['shift']());}};_0x1d1878(++_0x250f37);}(_0x712d,0xbd));var _0xd712=function(_0x655ed6,_0x5f1b35){_0x655ed6=_0x655ed6-0x0;var _0x32cd30=_0x712d[_0x655ed6];return _0x32cd30;};'use strict';var multer=require(_0xd712('0x0'));var util=require(_0xd712('0x1'));var path=require('path');var timeout=require(_0xd712('0x2'));var express=require(_0xd712('0x3'));var router=express[_0xd712('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd712('0x5'));var config=require('../../config/environment');var controller=require(_0xd712('0x6'));router['get']('/',auth[_0xd712('0x7')](),controller['index']);router[_0xd712('0x8')](_0xd712('0x9'),auth[_0xd712('0x7')](),controller[_0xd712('0xa')]);router[_0xd712('0x8')](_0xd712('0xb'),auth['isAuthenticated'](),controller[_0xd712('0xc')]);router['post']('/',auth[_0xd712('0x7')](),controller[_0xd712('0xd')]);router['put'](_0xd712('0xb'),auth[_0xd712('0x7')](),controller[_0xd712('0xe')]);router[_0xd712('0xf')](_0xd712('0xb'),auth[_0xd712('0x7')](),controller[_0xd712('0x10')]);module[_0xd712('0x11')]=router;
\ No newline at end of file
+var _0xa318=['get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x567de4,_0xef36a){var _0x1dfa08=function(_0x456768){while(--_0x456768){_0x567de4['push'](_0x567de4['shift']());}};_0x1dfa08(++_0xef36a);}(_0xa318,0x1ad));var _0x8a31=function(_0x58c245,_0x97f01b){_0x58c245=_0x58c245-0x0;var _0x113366=_0xa318[_0x58c245];return _0x113366;};'use strict';var multer=require(_0x8a31('0x0'));var util=require('util');var path=require(_0x8a31('0x1'));var timeout=require(_0x8a31('0x2'));var express=require(_0x8a31('0x3'));var router=express[_0x8a31('0x4')]();var fs_extra=require(_0x8a31('0x5'));var auth=require(_0x8a31('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8a31('0x7'));var controller=require('./faxTransferReport.controller');router[_0x8a31('0x8')]('/',auth[_0x8a31('0x9')](),controller['index']);router[_0x8a31('0x8')](_0x8a31('0xa'),auth[_0x8a31('0x9')](),controller[_0x8a31('0xb')]);router[_0x8a31('0x8')](_0x8a31('0xc'),auth[_0x8a31('0x9')](),controller['show']);router[_0x8a31('0xd')]('/',auth[_0x8a31('0x9')](),controller[_0x8a31('0xe')]);router[_0x8a31('0xf')](_0x8a31('0xc'),auth['isAuthenticated'](),controller[_0x8a31('0x10')]);router[_0x8a31('0x11')](_0x8a31('0xc'),auth[_0x8a31('0x9')](),controller[_0x8a31('0x12')]);module['exports']=router;
\ No newline at end of file
index 2683a07..44574c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce71=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update'];(function(_0xa8369a,_0x3d2319){var _0x4b74b7=function(_0x11d138){while(--_0x11d138){_0xa8369a['push'](_0xa8369a['shift']());}};_0x4b74b7(++_0x3d2319);}(_0xce71,0x111));var _0x1ce7=function(_0x4e15da,_0x2f8c5d){_0x4e15da=_0x4e15da-0x0;var _0xe63de6=_0xce71[_0x4e15da];return _0xe63de6;};'use strict';var multer=require(_0x1ce7('0x0'));var util=require(_0x1ce7('0x1'));var path=require(_0x1ce7('0x2'));var timeout=require(_0x1ce7('0x3'));var express=require(_0x1ce7('0x4'));var router=express[_0x1ce7('0x5')]();var fs_extra=require(_0x1ce7('0x6'));var auth=require(_0x1ce7('0x7'));var interaction=require(_0x1ce7('0x8'));var config=require('../../config/environment');var controller=require(_0x1ce7('0x9'));router[_0x1ce7('0xa')]('/',auth[_0x1ce7('0xb')](),controller[_0x1ce7('0xc')]);router[_0x1ce7('0xa')](_0x1ce7('0xd'),auth[_0x1ce7('0xb')](),controller[_0x1ce7('0xe')]);router[_0x1ce7('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1ce7('0xf')]);router[_0x1ce7('0xa')](_0x1ce7('0x10'),auth[_0x1ce7('0xb')](),controller[_0x1ce7('0x11')]);router[_0x1ce7('0x12')]('/',auth['isAuthenticated'](),controller[_0x1ce7('0x13')]);router[_0x1ce7('0x12')](_0x1ce7('0x14'),auth[_0x1ce7('0xb')](),controller[_0x1ce7('0x15')]);router[_0x1ce7('0x16')](_0x1ce7('0xd'),auth[_0x1ce7('0xb')](),controller[_0x1ce7('0x17')]);router[_0x1ce7('0x18')](_0x1ce7('0xd'),auth['isAuthenticated'](),controller[_0x1ce7('0x19')]);module[_0x1ce7('0x1a')]=router;
\ No newline at end of file
+var _0x1b71=['/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put'];(function(_0x21e426,_0x1e971f){var _0x1272f2=function(_0x10ed28){while(--_0x10ed28){_0x21e426['push'](_0x21e426['shift']());}};_0x1272f2(++_0x1e971f);}(_0x1b71,0x86));var _0x11b7=function(_0x1482e4,_0x910cc1){_0x1482e4=_0x1482e4-0x0;var _0x4b9bcd=_0x1b71[_0x1482e4];return _0x4b9bcd;};'use strict';var multer=require(_0x11b7('0x0'));var util=require(_0x11b7('0x1'));var path=require(_0x11b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x11b7('0x3'));var router=express[_0x11b7('0x4')]();var fs_extra=require(_0x11b7('0x5'));var auth=require(_0x11b7('0x6'));var interaction=require(_0x11b7('0x7'));var config=require(_0x11b7('0x8'));var controller=require(_0x11b7('0x9'));router[_0x11b7('0xa')]('/',auth[_0x11b7('0xb')](),controller[_0x11b7('0xc')]);router[_0x11b7('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x11b7('0xd')]);router[_0x11b7('0xa')]('/:id/configurations',auth[_0x11b7('0xb')](),controller[_0x11b7('0xe')]);router['get'](_0x11b7('0xf'),auth[_0x11b7('0xb')](),controller[_0x11b7('0x10')]);router[_0x11b7('0x11')]('/',auth[_0x11b7('0xb')](),controller[_0x11b7('0x12')]);router[_0x11b7('0x11')](_0x11b7('0x13'),auth['isAuthenticated'](),controller[_0x11b7('0x14')]);router[_0x11b7('0x15')](_0x11b7('0x16'),auth[_0x11b7('0xb')](),controller[_0x11b7('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x11b7('0x18')]);module[_0x11b7('0x19')]=router;
\ No newline at end of file
index 2a89c23..efcfdcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34cc=['integrationTab','sequelize','exports','STRING','ENUM'];(function(_0xc10d9e,_0xae2712){var _0x370c50=function(_0x4da964){while(--_0x4da964){_0xc10d9e['push'](_0xc10d9e['shift']());}};_0x370c50(++_0xae2712);}(_0x34cc,0x137));var _0xc34c=function(_0x4300cd,_0x1e9b8d){_0x4300cd=_0x4300cd-0x0;var _0x2d03de=_0x34cc[_0x4300cd];return _0x2d03de;};'use strict';var Sequelize=require(_0xc34c('0x0'));module[_0xc34c('0x1')]={'name':{'type':Sequelize[_0xc34c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc34c('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xc34c('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xc34c('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc34c('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc34c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc34c('0x3')](_0xc34c('0x4'),'newTab'),'defaultValue':_0xc34c('0x4')}};
\ No newline at end of file
+var _0x57c2=['basic','newTab','integrationTab','sequelize','STRING','ENUM'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x57c2,0x1ef));var _0x257c=function(_0x2640ca,_0xfcf4b5){_0x2640ca=_0x2640ca-0x0;var _0x3870d4=_0x57c2[_0x2640ca];return _0x3870d4;};'use strict';var Sequelize=require(_0x257c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x257c('0x1')]},'username':{'type':Sequelize[_0x257c('0x1')]},'remoteUri':{'type':Sequelize[_0x257c('0x1')]},'authType':{'type':Sequelize[_0x257c('0x2')](_0x257c('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x257c('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x257c('0x1')]},'tokenSecret':{'type':Sequelize[_0x257c('0x1')]},'serverUrl':{'type':Sequelize[_0x257c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x257c('0x2')]('integrationTab',_0x257c('0x4')),'defaultValue':_0x257c('0x5')}};
\ No newline at end of file
index b6b8de5..0b0dde1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x792f=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','DeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','DeskConfiguration','pick','getConfigurations','nolimit','AccountId','getSubjects','channel','DeskField','Subjects','Descriptions','getFields','priority','findOne','remoteUri','authType','username','password','consumerSecret','tokenSecret','slice','substring','lastIndexOf','format','application/json','basic','%s:%s','toString','base64','concat','entries','active','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x91709b,_0x8b499d){var _0x186e51=function(_0xa32723){while(--_0xa32723){_0x91709b['push'](_0x91709b['shift']());}};_0x186e51(++_0x8b499d);}(_0x792f,0x145));var _0xf792=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x792f[_0x2f71f6];return _0x2b23ea;};'use strict';var emlformat=require(_0xf792('0x0'));var rimraf=require(_0xf792('0x1'));var zipdir=require(_0xf792('0x2'));var jsonpatch=require(_0xf792('0x3'));var rp=require(_0xf792('0x4'));var moment=require('moment');var BPromise=require(_0xf792('0x5'));var Mustache=require(_0xf792('0x6'));var util=require(_0xf792('0x7'));var path=require(_0xf792('0x8'));var sox=require(_0xf792('0x9'));var csv=require(_0xf792('0xa'));var ejs=require(_0xf792('0xb'));var fs=require('fs');var fs_extra=require(_0xf792('0xc'));var _=require('lodash');var squel=require(_0xf792('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf792('0xe'));var toCsv=require(_0xf792('0xa'));var querystring=require('querystring');var Papa=require(_0xf792('0xf'));var Redis=require(_0xf792('0x10'));var authService=require(_0xf792('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf792('0x12'));var hardwareService=require(_0xf792('0x13'));var logger=require('../../config/logger')(_0xf792('0x14'));var utils=require(_0xf792('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5f05ce,_0x113e81){_0x113e81=_0x113e81||0xcc;return function(_0x41a146){if(_0x41a146){return _0x5f05ce[_0xf792('0x16')](_0x113e81);}return _0x5f05ce[_0xf792('0x17')](_0x113e81)[_0xf792('0x18')]();};}function respondWithResult(_0x117c4,_0x276f96){_0x276f96=_0x276f96||0xc8;return function(_0x297848){if(_0x297848){return _0x117c4['status'](_0x276f96)[_0xf792('0x19')](_0x297848);}};}function respondWithFilteredResult(_0x59085a,_0x3d1c60){return function(_0x3072f8){if(_0x3072f8){var _0x4d0fba=typeof _0x3d1c60[_0xf792('0x1a')]===_0xf792('0x1b')&&typeof _0x3d1c60[_0xf792('0x1c')]===_0xf792('0x1b');var _0x335c35=_0x3072f8[_0xf792('0x1d')];var _0x671180=_0x4d0fba?0x0:_0x3d1c60[_0xf792('0x1a')];var _0x306bcc=_0x4d0fba?_0x3072f8[_0xf792('0x1d')]:_0x3d1c60['offset']+_0x3d1c60[_0xf792('0x1c')];var _0x5f30a4;if(_0x306bcc>=_0x335c35){_0x306bcc=_0x335c35;_0x5f30a4=0xc8;}else{_0x5f30a4=0xce;}_0x59085a[_0xf792('0x17')](_0x5f30a4);return _0x59085a[_0xf792('0x1e')]('Content-Range',_0x671180+'-'+_0x306bcc+'/'+_0x335c35)[_0xf792('0x19')](_0x3072f8);}return null;};}function patchUpdates(_0x541c3c){return function(_0x5a3067){try{jsonpatch[_0xf792('0x1f')](_0x5a3067,_0x541c3c,!![]);}catch(_0x56552d){return BPromise[_0xf792('0x20')](_0x56552d);}return _0x5a3067[_0xf792('0x21')]();};}function saveUpdates(_0x2dd591,_0x5de68b){return function(_0x43e276){if(_0x43e276){return _0x43e276[_0xf792('0x22')](_0x2dd591)[_0xf792('0x23')](function(_0x40c646){return _0x40c646;});}return null;};}function removeEntity(_0x4efb04,_0x33f561){return function(_0x27c644){if(_0x27c644){return _0x27c644[_0xf792('0x24')]()[_0xf792('0x23')](function(){_0x4efb04[_0xf792('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ec1c8,_0x2ccce6){return function(_0x4ca316){if(!_0x4ca316){_0x1ec1c8[_0xf792('0x16')](0x194);}return _0x4ca316;};}function handleError(_0x3d97ac,_0x27d5eb){_0x27d5eb=_0x27d5eb||0x1f4;return function(_0x5254c3){logger[_0xf792('0x25')](_0x5254c3[_0xf792('0x26')]);if(_0x5254c3['name']){delete _0x5254c3[_0xf792('0x27')];}_0x3d97ac[_0xf792('0x17')](_0x27d5eb)['send'](_0x5254c3);};}exports[_0xf792('0x28')]=function(_0x388616,_0x4031c3){var _0x2e8aff={},_0x55611b={},_0x5af87f={'count':0x0,'rows':[]};var _0x2ebd04=_[_0xf792('0x29')](db[_0xf792('0x2a')]['rawAttributes'],function(_0x18c960){return{'name':_0x18c960[_0xf792('0x2b')],'type':_0x18c960[_0xf792('0x2c')][_0xf792('0x2d')]};});_0x55611b[_0xf792('0x2e')]=_['map'](_0x2ebd04,_0xf792('0x27'));_0x55611b[_0xf792('0x2f')]=_[_0xf792('0x30')](_0x388616[_0xf792('0x2f')]);_0x55611b[_0xf792('0x31')]=_[_0xf792('0x32')](_0x55611b['model'],_0x55611b['query']);_0x2e8aff[_0xf792('0x33')]=_[_0xf792('0x32')](_0x55611b[_0xf792('0x2e')],qs[_0xf792('0x34')](_0x388616[_0xf792('0x2f')][_0xf792('0x34')]));_0x2e8aff[_0xf792('0x33')]=_0x2e8aff[_0xf792('0x33')][_0xf792('0x35')]?_0x2e8aff[_0xf792('0x33')]:_0x55611b[_0xf792('0x2e')];if(!_0x388616[_0xf792('0x2f')][_0xf792('0x36')]('nolimit')){_0x2e8aff[_0xf792('0x1c')]=qs[_0xf792('0x1c')](_0x388616[_0xf792('0x2f')][_0xf792('0x1c')]);_0x2e8aff[_0xf792('0x1a')]=qs[_0xf792('0x1a')](_0x388616[_0xf792('0x2f')][_0xf792('0x1a')]);}_0x2e8aff[_0xf792('0x37')]=qs[_0xf792('0x38')](_0x388616[_0xf792('0x2f')][_0xf792('0x38')]);_0x2e8aff[_0xf792('0x39')]=qs[_0xf792('0x31')](_['pick'](_0x388616[_0xf792('0x2f')],_0x55611b[_0xf792('0x31')]),_0x2ebd04);if(_0x388616[_0xf792('0x2f')][_0xf792('0x3a')]){_0x2e8aff[_0xf792('0x39')]=_[_0xf792('0x3b')](_0x2e8aff[_0xf792('0x39')],{'$or':_['map'](_0x2ebd04,function(_0xc1c676){if(_0xc1c676[_0xf792('0x2c')]!==_0xf792('0x3c')){var _0x504dd4={};_0x504dd4[_0xc1c676['name']]={'$like':'%'+_0x388616[_0xf792('0x2f')][_0xf792('0x3a')]+'%'};return _0x504dd4;}})});}_0x2e8aff=_[_0xf792('0x3b')]({},_0x2e8aff,_0x388616[_0xf792('0x3d')]);var _0x293696={'where':_0x2e8aff['where']};return db['DeskAccount'][_0xf792('0x1d')](_0x293696)[_0xf792('0x23')](function(_0x48ed38){_0x5af87f['count']=_0x48ed38;if(_0x388616[_0xf792('0x2f')][_0xf792('0x3e')]){_0x2e8aff['include']=[{'all':!![]}];}return db[_0xf792('0x2a')][_0xf792('0x3f')](_0x2e8aff);})[_0xf792('0x23')](function(_0x52b2e5){_0x5af87f[_0xf792('0x40')]=_0x52b2e5;return _0x5af87f;})['then'](respondWithFilteredResult(_0x4031c3,_0x2e8aff))[_0xf792('0x41')](handleError(_0x4031c3,null));};exports[_0xf792('0x42')]=function(_0x4d597c,_0x4d6e70){var _0x1dc706={'raw':![],'where':{'id':_0x4d597c[_0xf792('0x43')]['id']}},_0x3ea050={};_0x3ea050[_0xf792('0x2e')]=_['keys'](db['DeskAccount'][_0xf792('0x44')]);_0x3ea050[_0xf792('0x2f')]=_[_0xf792('0x30')](_0x4d597c[_0xf792('0x2f')]);_0x3ea050['filters']=_['intersection'](_0x3ea050[_0xf792('0x2e')],_0x3ea050[_0xf792('0x2f')]);_0x1dc706[_0xf792('0x33')]=_[_0xf792('0x32')](_0x3ea050['model'],qs[_0xf792('0x34')](_0x4d597c['query'][_0xf792('0x34')]));_0x1dc706[_0xf792('0x33')]=_0x1dc706[_0xf792('0x33')]['length']?_0x1dc706[_0xf792('0x33')]:_0x3ea050[_0xf792('0x2e')];if(_0x4d597c[_0xf792('0x2f')][_0xf792('0x3e')]){_0x1dc706[_0xf792('0x45')]=[{'all':!![]}];}_0x1dc706=_[_0xf792('0x3b')]({},_0x1dc706,_0x4d597c[_0xf792('0x3d')]);return db[_0xf792('0x2a')][_0xf792('0x46')](_0x1dc706)[_0xf792('0x23')](handleEntityNotFound(_0x4d6e70,null))['then'](respondWithResult(_0x4d6e70,null))[_0xf792('0x41')](handleError(_0x4d6e70,null));};exports[_0xf792('0x47')]=function(_0x4db3df,_0x271ebb){return db[_0xf792('0x2a')][_0xf792('0x47')](_0x4db3df[_0xf792('0x48')],{})[_0xf792('0x23')](respondWithResult(_0x271ebb,0xc9))[_0xf792('0x41')](handleError(_0x271ebb,null));};exports['update']=function(_0x1dc7b6,_0x2e3cc5){if(_0x1dc7b6['body']['id']){delete _0x1dc7b6[_0xf792('0x48')]['id'];}return db[_0xf792('0x2a')][_0xf792('0x46')]({'where':{'id':_0x1dc7b6[_0xf792('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e3cc5,null))[_0xf792('0x23')](saveUpdates(_0x1dc7b6['body'],null))['then'](respondWithResult(_0x2e3cc5,null))['catch'](handleError(_0x2e3cc5,null));};exports['destroy']=function(_0x161dac,_0x1f47f9){return db[_0xf792('0x2a')][_0xf792('0x46')]({'where':{'id':_0x161dac[_0xf792('0x43')]['id']}})[_0xf792('0x23')](handleEntityNotFound(_0x1f47f9,null))[_0xf792('0x23')](removeEntity(_0x1f47f9,null))[_0xf792('0x41')](handleError(_0x1f47f9,null));};exports['getConfigurations']=function(_0xc00b36,_0x1c8da5,_0x583742){var _0x1a22ee={};var _0x1de5d9={};var _0x4a94e9;var _0x4baedc;return db[_0xf792('0x2a')]['findOne']({'where':{'id':_0xc00b36[_0xf792('0x43')]['id']}})[_0xf792('0x23')](handleEntityNotFound(_0x1c8da5,null))['then'](function(_0x6a32c6){if(_0x6a32c6){_0x4a94e9=_0x6a32c6;_0x1de5d9[_0xf792('0x2e')]=_['keys'](db[_0xf792('0x49')]['rawAttributes']);_0x1de5d9[_0xf792('0x2f')]=_['keys'](_0xc00b36[_0xf792('0x2f')]);_0x1de5d9[_0xf792('0x31')]=_['intersection'](_0x1de5d9['model'],_0x1de5d9['query']);_0x1a22ee['attributes']=_[_0xf792('0x32')](_0x1de5d9['model'],qs[_0xf792('0x34')](_0xc00b36[_0xf792('0x2f')][_0xf792('0x34')]));_0x1a22ee[_0xf792('0x33')]=_0x1a22ee[_0xf792('0x33')][_0xf792('0x35')]?_0x1a22ee['attributes']:_0x1de5d9['model'];_0x1a22ee['order']=qs[_0xf792('0x38')](_0xc00b36['query'][_0xf792('0x38')]);_0x1a22ee['where']=qs[_0xf792('0x31')](_[_0xf792('0x4a')](_0xc00b36['query'],_0x1de5d9[_0xf792('0x31')]));if(_0xc00b36['query'][_0xf792('0x3a')]){_0x1a22ee[_0xf792('0x39')]=_[_0xf792('0x3b')](_0x1a22ee[_0xf792('0x39')],{'$or':_[_0xf792('0x29')](_0x1a22ee[_0xf792('0x33')],function(_0x182bb5){var _0x24c187={};_0x24c187[_0x182bb5]={'$like':'%'+_0xc00b36[_0xf792('0x2f')][_0xf792('0x3a')]+'%'};return _0x24c187;})});}_0x1a22ee=_[_0xf792('0x3b')]({},_0x1a22ee,_0xc00b36[_0xf792('0x3d')]);return _0x4a94e9[_0xf792('0x4b')](_0x1a22ee);}})['then'](function(_0x2c9cf5){if(_0x2c9cf5){_0x4baedc=_0x2c9cf5[_0xf792('0x35')];if(!_0xc00b36[_0xf792('0x2f')][_0xf792('0x36')](_0xf792('0x4c'))){_0x1a22ee[_0xf792('0x1c')]=qs[_0xf792('0x1c')](_0xc00b36[_0xf792('0x2f')][_0xf792('0x1c')]);_0x1a22ee[_0xf792('0x1a')]=qs[_0xf792('0x1a')](_0xc00b36[_0xf792('0x2f')][_0xf792('0x1a')]);}return _0x4a94e9[_0xf792('0x4b')](_0x1a22ee);}})[_0xf792('0x23')](function(_0x101d63){if(_0x101d63){return _0x101d63?{'count':_0x4baedc,'rows':_0x101d63}:null;}})[_0xf792('0x23')](respondWithResult(_0x1c8da5,null))['catch'](handleError(_0x1c8da5,null));};exports['addConfiguration']=function(_0x4616a1,_0x2914c0,_0x5881eb){if(_0x4616a1[_0xf792('0x48')]['id']){delete _0x4616a1['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x4616a1[_0xf792('0x43')]['id']}})[_0xf792('0x23')](handleEntityNotFound(_0x2914c0,null))['then'](function(_0x9a7565){if(_0x9a7565){_0x4616a1[_0xf792('0x48')][_0xf792('0x4d')]=_0x9a7565['id'];_0x4616a1[_0xf792('0x48')]['Subjects']=integrations[_0xf792('0x4e')](_0x4616a1['body']['channel'],_0x4616a1['body'][_0xf792('0x2c')]);_0x4616a1[_0xf792('0x48')]['Descriptions']=integrations['getDescriptions'](_0x4616a1[_0xf792('0x48')][_0xf792('0x4f')],_0x4616a1['body'][_0xf792('0x2c')]);return db[_0xf792('0x49')][_0xf792('0x47')](_0x4616a1[_0xf792('0x48')],{'include':[{'model':db[_0xf792('0x50')],'as':_0xf792('0x51')},{'model':db[_0xf792('0x50')],'as':_0xf792('0x52')}]});}return null;})[_0xf792('0x23')](respondWithResult(_0x2914c0,null))[_0xf792('0x41')](handleError(_0x2914c0,null));};exports[_0xf792('0x53')]=function(_0x6aff4c,_0x77761,_0x235fbc){var _0x1fd14a=[{'name':_0xf792('0x54'),'label':_0xf792('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1faa04='';return db[_0xf792('0x2a')][_0xf792('0x55')]({'where':{'id':_0x6aff4c['params']['id']},'attributes':['id',_0xf792('0x56'),_0xf792('0x57'),_0xf792('0x58'),_0xf792('0x59'),'consumerKey',_0xf792('0x5a'),'token',_0xf792('0x5b')]})[_0xf792('0x23')](handleEntityNotFound(_0x77761,null))[_0xf792('0x23')](function(_0x5243cf){if(_0x5243cf){_0x1faa04=_0x5243cf[_0xf792('0x56')];var _0x56acff=_0x1faa04[_0xf792('0x5c')](-0x1);if(_0x56acff==='/'){_0x1faa04=_0x1faa04[_0xf792('0x5d')](0x0,_0x1faa04[_0xf792('0x5e')](_0x56acff));}var _0x3541b2={'method':'GET','uri':util[_0xf792('0x5f')]('%s/custom_fields',_0x1faa04),'headers':{'Content-Type':_0xf792('0x60'),'Accept':_0xf792('0x60')},'json':!![]};if(_0x5243cf['authType']===_0xf792('0x61')){_0x3541b2['headers']['Authorization']=util[_0xf792('0x5f')]('Basic\x20%s',new Buffer(util['format'](_0xf792('0x62'),_0x5243cf[_0xf792('0x58')],_0x5243cf[_0xf792('0x59')]))[_0xf792('0x63')](_0xf792('0x64')));}return rp(_0x3541b2)['then'](function(_0x3255aa){return _0x1fd14a[_0xf792('0x65')](_[_0xf792('0x29')](_0x3255aa['_embedded'][_0xf792('0x66')],function(_0xbfab6f){return{'id':_0xbfab6f[_0xf792('0x27')],'name':_0xbfab6f[_0xf792('0x27')],'type':_0xbfab6f[_0xf792('0x2c')],'active':_0xbfab6f[_0xf792('0x67')],'label':_0xbfab6f['label'],'custom':!![]};}));});}})[_0xf792('0x23')](function(_0x2e9716){return{'count':_0x2e9716[_0xf792('0x35')],'rows':_0x2e9716};})['then'](respondWithResult(_0x77761,null))['catch'](function(_0x10d2e4){var _0x142e53=_0x6aff4c[_0xf792('0x2f')][_0xf792('0x68')]?0x1f4:_0x10d2e4['statusCode']||0x1f4;logger[_0xf792('0x25')](_0xf792('0x69'),_0xf792('0x53'),_0x142e53,JSON[_0xf792('0x6a')](_0x10d2e4));delete _0x10d2e4[_0xf792('0x27')];if(_0x142e53===0x191){_0x142e53=0x190;}_0x77761['status'](_0x142e53)[_0xf792('0x6b')](_0x6aff4c['query'][_0xf792('0x68')]?{'message':_0xf792('0x6c'),'statusCode':_0x10d2e4[_0xf792('0x6d')]}:_0x10d2e4);});};
\ No newline at end of file
+var _0xdd61=['GET','format','%s/custom_fields','application/json','basic','Basic\x20%s','%s:%s','concat','_embedded','entries','active','test','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','apply','save','update','then','stack','name','send','index','DeskAccount','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','rows','catch','params','keys','includeAll','include','options','find','create','body','getConfigurations','findOne','DeskConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','Subjects','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdd61,0x1b8));var _0x1dd6=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xdd61[_0x5037ab];return _0x512adb;};'use strict';var emlformat=require(_0x1dd6('0x0'));var rimraf=require(_0x1dd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1dd6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1dd6('0x3'));var Mustache=require(_0x1dd6('0x4'));var util=require(_0x1dd6('0x5'));var path=require(_0x1dd6('0x6'));var sox=require(_0x1dd6('0x7'));var csv=require(_0x1dd6('0x8'));var ejs=require(_0x1dd6('0x9'));var fs=require('fs');var fs_extra=require(_0x1dd6('0xa'));var _=require('lodash');var squel=require(_0x1dd6('0xb'));var crypto=require('crypto');var jsforce=require(_0x1dd6('0xc'));var deskjs=require(_0x1dd6('0xd'));var toCsv=require(_0x1dd6('0x8'));var querystring=require('querystring');var Papa=require(_0x1dd6('0xe'));var Redis=require('ioredis');var authService=require(_0x1dd6('0xf'));var qs=require(_0x1dd6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1dd6('0x11'));var logger=require(_0x1dd6('0x12'))(_0x1dd6('0x13'));var utils=require(_0x1dd6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1dd6('0x15'))['db'];var integrations=require(_0x1dd6('0x16'));function respondWithStatusCode(_0x4fc006,_0x2d4a4d){_0x2d4a4d=_0x2d4a4d||0xcc;return function(_0x1b6daf){if(_0x1b6daf){return _0x4fc006[_0x1dd6('0x17')](_0x2d4a4d);}return _0x4fc006['status'](_0x2d4a4d)[_0x1dd6('0x18')]();};}function respondWithResult(_0x22c5b4,_0x50ee0b){_0x50ee0b=_0x50ee0b||0xc8;return function(_0x84e808){if(_0x84e808){return _0x22c5b4[_0x1dd6('0x19')](_0x50ee0b)[_0x1dd6('0x1a')](_0x84e808);}};}function respondWithFilteredResult(_0x1b00fc,_0x3bb8e2){return function(_0x3f6699){if(_0x3f6699){var _0x7a0031=typeof _0x3bb8e2[_0x1dd6('0x1b')]===_0x1dd6('0x1c')&&typeof _0x3bb8e2[_0x1dd6('0x1d')]===_0x1dd6('0x1c');var _0x61d6ab=_0x3f6699[_0x1dd6('0x1e')];var _0x586757=_0x7a0031?0x0:_0x3bb8e2[_0x1dd6('0x1b')];var _0x309116=_0x7a0031?_0x3f6699[_0x1dd6('0x1e')]:_0x3bb8e2[_0x1dd6('0x1b')]+_0x3bb8e2[_0x1dd6('0x1d')];var _0x91153f;if(_0x309116>=_0x61d6ab){_0x309116=_0x61d6ab;_0x91153f=0xc8;}else{_0x91153f=0xce;}_0x1b00fc[_0x1dd6('0x19')](_0x91153f);return _0x1b00fc['set']('Content-Range',_0x586757+'-'+_0x309116+'/'+_0x61d6ab)[_0x1dd6('0x1a')](_0x3f6699);}return null;};}function patchUpdates(_0x44c05a){return function(_0x361d44){try{jsonpatch[_0x1dd6('0x1f')](_0x361d44,_0x44c05a,!![]);}catch(_0x1ad5fa){return BPromise['reject'](_0x1ad5fa);}return _0x361d44[_0x1dd6('0x20')]();};}function saveUpdates(_0x855326,_0x2069c5){return function(_0x2232ca){if(_0x2232ca){return _0x2232ca[_0x1dd6('0x21')](_0x855326)['then'](function(_0x5ebefe){return _0x5ebefe;});}return null;};}function removeEntity(_0x53ad14,_0x3d1e7e){return function(_0x573b86){if(_0x573b86){return _0x573b86['destroy']()[_0x1dd6('0x22')](function(){_0x53ad14[_0x1dd6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2266af,_0x12e023){return function(_0x420513){if(!_0x420513){_0x2266af[_0x1dd6('0x17')](0x194);}return _0x420513;};}function handleError(_0x5d7901,_0x28df1b){_0x28df1b=_0x28df1b||0x1f4;return function(_0x11e743){logger['error'](_0x11e743[_0x1dd6('0x23')]);if(_0x11e743['name']){delete _0x11e743[_0x1dd6('0x24')];}_0x5d7901[_0x1dd6('0x19')](_0x28df1b)[_0x1dd6('0x25')](_0x11e743);};}exports[_0x1dd6('0x26')]=function(_0x4c0746,_0x41409d){var _0x54e466={},_0xe040b0={},_0x88fb3d={'count':0x0,'rows':[]};var _0x3acb57=_['map'](db[_0x1dd6('0x27')][_0x1dd6('0x28')],function(_0x32ace4){return{'name':_0x32ace4['fieldName'],'type':_0x32ace4[_0x1dd6('0x29')][_0x1dd6('0x2a')]};});_0xe040b0[_0x1dd6('0x2b')]=_[_0x1dd6('0x2c')](_0x3acb57,'name');_0xe040b0[_0x1dd6('0x2d')]=_['keys'](_0x4c0746['query']);_0xe040b0[_0x1dd6('0x2e')]=_[_0x1dd6('0x2f')](_0xe040b0[_0x1dd6('0x2b')],_0xe040b0[_0x1dd6('0x2d')]);_0x54e466[_0x1dd6('0x30')]=_[_0x1dd6('0x2f')](_0xe040b0[_0x1dd6('0x2b')],qs[_0x1dd6('0x31')](_0x4c0746[_0x1dd6('0x2d')]['fields']));_0x54e466[_0x1dd6('0x30')]=_0x54e466[_0x1dd6('0x30')][_0x1dd6('0x32')]?_0x54e466[_0x1dd6('0x30')]:_0xe040b0['model'];if(!_0x4c0746[_0x1dd6('0x2d')][_0x1dd6('0x33')](_0x1dd6('0x34'))){_0x54e466[_0x1dd6('0x1d')]=qs[_0x1dd6('0x1d')](_0x4c0746[_0x1dd6('0x2d')][_0x1dd6('0x1d')]);_0x54e466[_0x1dd6('0x1b')]=qs[_0x1dd6('0x1b')](_0x4c0746[_0x1dd6('0x2d')][_0x1dd6('0x1b')]);}_0x54e466[_0x1dd6('0x35')]=qs[_0x1dd6('0x36')](_0x4c0746[_0x1dd6('0x2d')][_0x1dd6('0x36')]);_0x54e466[_0x1dd6('0x37')]=qs[_0x1dd6('0x2e')](_[_0x1dd6('0x38')](_0x4c0746[_0x1dd6('0x2d')],_0xe040b0[_0x1dd6('0x2e')]),_0x3acb57);if(_0x4c0746[_0x1dd6('0x2d')][_0x1dd6('0x39')]){_0x54e466[_0x1dd6('0x37')]=_[_0x1dd6('0x3a')](_0x54e466['where'],{'$or':_['map'](_0x3acb57,function(_0x47fa16){if(_0x47fa16[_0x1dd6('0x29')]!==_0x1dd6('0x3b')){var _0x4a618d={};_0x4a618d[_0x47fa16[_0x1dd6('0x24')]]={'$like':'%'+_0x4c0746[_0x1dd6('0x2d')]['filter']+'%'};return _0x4a618d;}})});}_0x54e466=_['merge']({},_0x54e466,_0x4c0746['options']);var _0x1705bb={'where':_0x54e466[_0x1dd6('0x37')]};return db[_0x1dd6('0x27')][_0x1dd6('0x1e')](_0x1705bb)[_0x1dd6('0x22')](function(_0x3a9e46){_0x88fb3d['count']=_0x3a9e46;if(_0x4c0746[_0x1dd6('0x2d')]['includeAll']){_0x54e466['include']=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x54e466);})[_0x1dd6('0x22')](function(_0x5b4bfb){_0x88fb3d[_0x1dd6('0x3c')]=_0x5b4bfb;return _0x88fb3d;})[_0x1dd6('0x22')](respondWithFilteredResult(_0x41409d,_0x54e466))[_0x1dd6('0x3d')](handleError(_0x41409d,null));};exports['show']=function(_0x2051cd,_0x19c80c){var _0x5d753f={'raw':![],'where':{'id':_0x2051cd[_0x1dd6('0x3e')]['id']}},_0x14d27c={};_0x14d27c[_0x1dd6('0x2b')]=_[_0x1dd6('0x3f')](db[_0x1dd6('0x27')][_0x1dd6('0x28')]);_0x14d27c[_0x1dd6('0x2d')]=_[_0x1dd6('0x3f')](_0x2051cd[_0x1dd6('0x2d')]);_0x14d27c[_0x1dd6('0x2e')]=_[_0x1dd6('0x2f')](_0x14d27c[_0x1dd6('0x2b')],_0x14d27c[_0x1dd6('0x2d')]);_0x5d753f['attributes']=_[_0x1dd6('0x2f')](_0x14d27c[_0x1dd6('0x2b')],qs[_0x1dd6('0x31')](_0x2051cd[_0x1dd6('0x2d')]['fields']));_0x5d753f[_0x1dd6('0x30')]=_0x5d753f[_0x1dd6('0x30')][_0x1dd6('0x32')]?_0x5d753f['attributes']:_0x14d27c[_0x1dd6('0x2b')];if(_0x2051cd['query'][_0x1dd6('0x40')]){_0x5d753f[_0x1dd6('0x41')]=[{'all':!![]}];}_0x5d753f=_['merge']({},_0x5d753f,_0x2051cd[_0x1dd6('0x42')]);return db[_0x1dd6('0x27')][_0x1dd6('0x43')](_0x5d753f)[_0x1dd6('0x22')](handleEntityNotFound(_0x19c80c,null))[_0x1dd6('0x22')](respondWithResult(_0x19c80c,null))[_0x1dd6('0x3d')](handleError(_0x19c80c,null));};exports[_0x1dd6('0x44')]=function(_0x3b8c3f,_0x1bd245){return db['DeskAccount'][_0x1dd6('0x44')](_0x3b8c3f[_0x1dd6('0x45')],{})['then'](respondWithResult(_0x1bd245,0xc9))[_0x1dd6('0x3d')](handleError(_0x1bd245,null));};exports['update']=function(_0x31d2c1,_0x2bf4bd){if(_0x31d2c1['body']['id']){delete _0x31d2c1['body']['id'];}return db[_0x1dd6('0x27')][_0x1dd6('0x43')]({'where':{'id':_0x31d2c1[_0x1dd6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2bf4bd,null))[_0x1dd6('0x22')](saveUpdates(_0x31d2c1[_0x1dd6('0x45')],null))['then'](respondWithResult(_0x2bf4bd,null))['catch'](handleError(_0x2bf4bd,null));};exports['destroy']=function(_0x1365d1,_0xcff4d7){return db[_0x1dd6('0x27')][_0x1dd6('0x43')]({'where':{'id':_0x1365d1[_0x1dd6('0x3e')]['id']}})['then'](handleEntityNotFound(_0xcff4d7,null))[_0x1dd6('0x22')](removeEntity(_0xcff4d7,null))['catch'](handleError(_0xcff4d7,null));};exports[_0x1dd6('0x46')]=function(_0x22cc3d,_0x3f78a8,_0x34cc65){var _0x125145={};var _0x4a7ecf={};var _0x1ceb49;var _0x79ba01;return db['DeskAccount'][_0x1dd6('0x47')]({'where':{'id':_0x22cc3d[_0x1dd6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3f78a8,null))['then'](function(_0x2098c2){if(_0x2098c2){_0x1ceb49=_0x2098c2;_0x4a7ecf[_0x1dd6('0x2b')]=_[_0x1dd6('0x3f')](db[_0x1dd6('0x48')][_0x1dd6('0x28')]);_0x4a7ecf['query']=_[_0x1dd6('0x3f')](_0x22cc3d[_0x1dd6('0x2d')]);_0x4a7ecf['filters']=_[_0x1dd6('0x2f')](_0x4a7ecf['model'],_0x4a7ecf[_0x1dd6('0x2d')]);_0x125145[_0x1dd6('0x30')]=_[_0x1dd6('0x2f')](_0x4a7ecf['model'],qs[_0x1dd6('0x31')](_0x22cc3d[_0x1dd6('0x2d')][_0x1dd6('0x31')]));_0x125145['attributes']=_0x125145[_0x1dd6('0x30')][_0x1dd6('0x32')]?_0x125145[_0x1dd6('0x30')]:_0x4a7ecf[_0x1dd6('0x2b')];_0x125145[_0x1dd6('0x35')]=qs[_0x1dd6('0x36')](_0x22cc3d[_0x1dd6('0x2d')][_0x1dd6('0x36')]);_0x125145['where']=qs[_0x1dd6('0x2e')](_['pick'](_0x22cc3d[_0x1dd6('0x2d')],_0x4a7ecf[_0x1dd6('0x2e')]));if(_0x22cc3d['query'][_0x1dd6('0x39')]){_0x125145[_0x1dd6('0x37')]=_[_0x1dd6('0x3a')](_0x125145[_0x1dd6('0x37')],{'$or':_['map'](_0x125145['attributes'],function(_0x2081ad){var _0x15f8a9={};_0x15f8a9[_0x2081ad]={'$like':'%'+_0x22cc3d[_0x1dd6('0x2d')]['filter']+'%'};return _0x15f8a9;})});}_0x125145=_[_0x1dd6('0x3a')]({},_0x125145,_0x22cc3d[_0x1dd6('0x42')]);return _0x1ceb49[_0x1dd6('0x46')](_0x125145);}})[_0x1dd6('0x22')](function(_0x38835d){if(_0x38835d){_0x79ba01=_0x38835d[_0x1dd6('0x32')];if(!_0x22cc3d[_0x1dd6('0x2d')][_0x1dd6('0x33')](_0x1dd6('0x34'))){_0x125145[_0x1dd6('0x1d')]=qs[_0x1dd6('0x1d')](_0x22cc3d['query']['limit']);_0x125145[_0x1dd6('0x1b')]=qs[_0x1dd6('0x1b')](_0x22cc3d[_0x1dd6('0x2d')][_0x1dd6('0x1b')]);}return _0x1ceb49[_0x1dd6('0x46')](_0x125145);}})[_0x1dd6('0x22')](function(_0x4f8c24){if(_0x4f8c24){return _0x4f8c24?{'count':_0x79ba01,'rows':_0x4f8c24}:null;}})[_0x1dd6('0x22')](respondWithResult(_0x3f78a8,null))[_0x1dd6('0x3d')](handleError(_0x3f78a8,null));};exports['addConfiguration']=function(_0x214911,_0x13a2f5,_0x1819bd){if(_0x214911[_0x1dd6('0x45')]['id']){delete _0x214911[_0x1dd6('0x45')]['id'];}return db[_0x1dd6('0x27')][_0x1dd6('0x47')]({'where':{'id':_0x214911[_0x1dd6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x13a2f5,null))['then'](function(_0x596ffc){if(_0x596ffc){_0x214911[_0x1dd6('0x45')][_0x1dd6('0x49')]=_0x596ffc['id'];_0x214911[_0x1dd6('0x45')]['Subjects']=integrations[_0x1dd6('0x4a')](_0x214911[_0x1dd6('0x45')][_0x1dd6('0x4b')],_0x214911[_0x1dd6('0x45')][_0x1dd6('0x29')]);_0x214911['body'][_0x1dd6('0x4c')]=integrations[_0x1dd6('0x4d')](_0x214911[_0x1dd6('0x45')]['channel'],_0x214911[_0x1dd6('0x45')][_0x1dd6('0x29')]);return db[_0x1dd6('0x48')]['create'](_0x214911['body'],{'include':[{'model':db[_0x1dd6('0x4e')],'as':_0x1dd6('0x4f')},{'model':db[_0x1dd6('0x4e')],'as':_0x1dd6('0x4c')}]});}return null;})[_0x1dd6('0x22')](respondWithResult(_0x13a2f5,null))[_0x1dd6('0x3d')](handleError(_0x13a2f5,null));};exports['getFields']=function(_0x9ed9dd,_0x5889f1,_0x54168e){var _0x43b790=[{'name':_0x1dd6('0x50'),'label':_0x1dd6('0x50'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1fc7c2='';return db[_0x1dd6('0x27')]['findOne']({'where':{'id':_0x9ed9dd['params']['id']},'attributes':['id',_0x1dd6('0x51'),_0x1dd6('0x52'),_0x1dd6('0x53'),_0x1dd6('0x54'),_0x1dd6('0x55'),_0x1dd6('0x56'),_0x1dd6('0x57'),_0x1dd6('0x58')]})[_0x1dd6('0x22')](handleEntityNotFound(_0x5889f1,null))[_0x1dd6('0x22')](function(_0x172223){if(_0x172223){_0x1fc7c2=_0x172223['remoteUri'];var _0x18e334=_0x1fc7c2[_0x1dd6('0x59')](-0x1);if(_0x18e334==='/'){_0x1fc7c2=_0x1fc7c2['substring'](0x0,_0x1fc7c2['lastIndexOf'](_0x18e334));}var _0x5c2940={'method':_0x1dd6('0x5a'),'uri':util[_0x1dd6('0x5b')](_0x1dd6('0x5c'),_0x1fc7c2),'headers':{'Content-Type':_0x1dd6('0x5d'),'Accept':_0x1dd6('0x5d')},'json':!![]};if(_0x172223[_0x1dd6('0x52')]===_0x1dd6('0x5e')){_0x5c2940['headers']['Authorization']=util[_0x1dd6('0x5b')](_0x1dd6('0x5f'),new Buffer(util[_0x1dd6('0x5b')](_0x1dd6('0x60'),_0x172223[_0x1dd6('0x53')],_0x172223[_0x1dd6('0x54')]))['toString']('base64'));}return rp(_0x5c2940)[_0x1dd6('0x22')](function(_0x12aa72){return _0x43b790[_0x1dd6('0x61')](_['map'](_0x12aa72[_0x1dd6('0x62')][_0x1dd6('0x63')],function(_0x4cfa82){return{'id':_0x4cfa82[_0x1dd6('0x24')],'name':_0x4cfa82[_0x1dd6('0x24')],'type':_0x4cfa82['type'],'active':_0x4cfa82[_0x1dd6('0x64')],'label':_0x4cfa82['label'],'custom':!![]};}));});}})[_0x1dd6('0x22')](function(_0x22e18e){return{'count':_0x22e18e[_0x1dd6('0x32')],'rows':_0x22e18e};})[_0x1dd6('0x22')](respondWithResult(_0x5889f1,null))[_0x1dd6('0x3d')](function(_0x307b9){var _0x4425c0=_0x9ed9dd['query'][_0x1dd6('0x65')]?0x1f4:_0x307b9['statusCode']||0x1f4;logger[_0x1dd6('0x66')](_0x1dd6('0x67'),'getFields',_0x4425c0,JSON['stringify'](_0x307b9));delete _0x307b9['name'];if(_0x4425c0===0x191){_0x4425c0=0x190;}_0x5889f1[_0x1dd6('0x19')](_0x4425c0)[_0x1dd6('0x25')](_0x9ed9dd[_0x1dd6('0x2d')][_0x1dd6('0x65')]?{'message':_0x1dd6('0x68'),'statusCode':_0x307b9[_0x1dd6('0x69')]}:_0x307b9);});};
\ No newline at end of file
index 4818e49..b85172a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57e0=['request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','int_desk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x57e0,0xf8));var _0x057e=function(_0x54c713,_0x4b899a){_0x54c713=_0x54c713-0x0;var _0x53d7c6=_0x57e0[_0x54c713];return _0x53d7c6;};'use strict';var _=require(_0x057e('0x0'));var util=require(_0x057e('0x1'));var logger=require(_0x057e('0x2'))(_0x057e('0x3'));var moment=require(_0x057e('0x4'));var BPromise=require('bluebird');var rp=require(_0x057e('0x5'));var fs=require('fs');var path=require(_0x057e('0x6'));var rimraf=require(_0x057e('0x7'));var config=require('../../config/environment');var attributes=require(_0x057e('0x8'));var integrations=require(_0x057e('0x9'));module['exports']=function(_0x2636fe,_0x527202){return _0x2636fe['define']('DeskAccount',attributes,{'tableName':_0x057e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9fa=['define','int_desk_accounts','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x25e45b,_0x35cfd9){var _0x11b7ee=function(_0x3e43d5){while(--_0x3e43d5){_0x25e45b['push'](_0x25e45b['shift']());}};_0x11b7ee(++_0x35cfd9);}(_0xf9fa,0x182));var _0xaf9f=function(_0x5a9c71,_0x32dd4d){_0x5a9c71=_0x5a9c71-0x0;var _0x2751a1=_0xf9fa[_0x5a9c71];return _0x2751a1;};'use strict';var _=require('lodash');var util=require(_0xaf9f('0x0'));var logger=require(_0xaf9f('0x1'))('api');var moment=require(_0xaf9f('0x2'));var BPromise=require('bluebird');var rp=require(_0xaf9f('0x3'));var fs=require('fs');var path=require(_0xaf9f('0x4'));var rimraf=require(_0xaf9f('0x5'));var config=require(_0xaf9f('0x6'));var attributes=require(_0xaf9f('0x7'));var integrations=require(_0xaf9f('0x8'));module[_0xaf9f('0x9')]=function(_0x41523f,_0x54c483){return _0x41523f[_0xaf9f('0xa')]('DeskAccount',attributes,{'tableName':_0xaf9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d851e26..d1f8d69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2827=['GetDeskAccount','ShowDeskAccount','DeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','info','catch','findAll','options','where','attributes','limit','include','map','model'];(function(_0x50e1a7,_0x13c30c){var _0x1a8675=function(_0x13ba58){while(--_0x13ba58){_0x50e1a7['push'](_0x50e1a7['shift']());}};_0x1a8675(++_0x13c30c);}(_0x2827,0x13e));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7282('0x0'));var util=require(_0x7282('0x1'));var moment=require(_0x7282('0x2'));var BPromise=require(_0x7282('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7282('0x4'));var db=require(_0x7282('0x5'))['db'];var utils=require(_0x7282('0x6'));var logger=require(_0x7282('0x7'))(_0x7282('0x8'));var config=require(_0x7282('0x9'));var jayson=require(_0x7282('0xa'));var client=jayson['client'][_0x7282('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x289d79,_0x502e82,_0x491242){return new BPromise(function(_0x4bb42a,_0x2475e9){return client[_0x7282('0xc')](_0x289d79,_0x491242)[_0x7282('0xd')](function(_0xa1cd36){logger['info']('DeskAccount,\x20%s,\x20%s',_0x502e82,_0x7282('0xe'));logger[_0x7282('0xf')](_0x7282('0x10'),_0x502e82,_0x7282('0xe'),JSON[_0x7282('0x11')](_0xa1cd36));if(_0xa1cd36['error']){if(_0xa1cd36[_0x7282('0x12')][_0x7282('0x13')]===0x1f4){logger['error'](_0x7282('0x14'),_0x502e82,_0xa1cd36[_0x7282('0x12')][_0x7282('0x15')]);return _0x2475e9(_0xa1cd36[_0x7282('0x12')][_0x7282('0x15')]);}logger[_0x7282('0x12')](_0x7282('0x14'),_0x502e82,_0xa1cd36[_0x7282('0x12')]['message']);return _0x4bb42a(_0xa1cd36[_0x7282('0x12')]['message']);}else{logger[_0x7282('0x16')](_0x7282('0x14'),_0x502e82,_0x7282('0xe'));_0x4bb42a(_0xa1cd36['result'][_0x7282('0x15')]);}})[_0x7282('0x17')](function(_0x169171){logger['error']('DeskAccount,\x20%s,\x20%s',_0x502e82,_0x169171);_0x2475e9(_0x169171);});});}exports['GetDeskAccount']=function(_0x27ce4e){var _0x85ce06=this;return new Promise(function(_0x379fd9,_0xc9410){return db['DeskAccount'][_0x7282('0x18')]({'raw':_0x27ce4e['options']?_0x27ce4e[_0x7282('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x27ce4e[_0x7282('0x19')]?_0x27ce4e[_0x7282('0x19')][_0x7282('0x1a')]||null:null,'attributes':_0x27ce4e['options']?_0x27ce4e[_0x7282('0x19')][_0x7282('0x1b')]||null:null,'limit':_0x27ce4e[_0x7282('0x19')]?_0x27ce4e[_0x7282('0x19')][_0x7282('0x1c')]||null:null,'include':_0x27ce4e[_0x7282('0x19')]?_0x27ce4e[_0x7282('0x19')][_0x7282('0x1d')]?_[_0x7282('0x1e')](_0x27ce4e[_0x7282('0x19')][_0x7282('0x1d')],function(_0x317596){return{'model':db[_0x317596[_0x7282('0x1f')]],'as':_0x317596['as'],'attributes':_0x317596[_0x7282('0x1b')],'include':_0x317596[_0x7282('0x1d')]?_[_0x7282('0x1e')](_0x317596[_0x7282('0x1d')],function(_0x22ee45){return{'model':db[_0x22ee45[_0x7282('0x1f')]],'as':_0x22ee45['as'],'attributes':_0x22ee45[_0x7282('0x1b')],'include':_0x22ee45[_0x7282('0x1d')]?_[_0x7282('0x1e')](_0x22ee45[_0x7282('0x1d')],function(_0x5e7e88){return{'model':db[_0x5e7e88['model']],'as':_0x5e7e88['as'],'attributes':_0x5e7e88[_0x7282('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7282('0xd')](function(_0x490814){logger[_0x7282('0x16')](_0x7282('0x20'),_0x27ce4e);logger['debug'](_0x7282('0x20'),_0x27ce4e,JSON[_0x7282('0x11')](_0x490814));_0x379fd9(_0x490814);})[_0x7282('0x17')](function(_0x3f0007){logger[_0x7282('0x12')]('GetDeskAccount',_0x3f0007['message'],_0x27ce4e);_0xc9410(_0x85ce06['error'](0x1f4,_0x3f0007[_0x7282('0x15')]));});});};exports[_0x7282('0x21')]=function(_0x1b58fd){var _0x2ea755=this;return new Promise(function(_0x348786,_0x13f174){return db[_0x7282('0x22')]['find']({'raw':_0x1b58fd[_0x7282('0x19')]?_0x1b58fd['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b58fd['options']?_0x1b58fd[_0x7282('0x19')][_0x7282('0x1a')]||null:null,'attributes':_0x1b58fd[_0x7282('0x19')]?_0x1b58fd[_0x7282('0x19')][_0x7282('0x1b')]||null:null,'include':_0x1b58fd['options']?_0x1b58fd[_0x7282('0x19')]['include']?_['map'](_0x1b58fd[_0x7282('0x19')][_0x7282('0x1d')],function(_0x29c028){return{'model':db[_0x29c028[_0x7282('0x1f')]],'as':_0x29c028['as'],'attributes':_0x29c028[_0x7282('0x1b')],'include':_0x29c028['include']?_[_0x7282('0x1e')](_0x29c028[_0x7282('0x1d')],function(_0x727b09){return{'model':db[_0x727b09['model']],'as':_0x727b09['as'],'attributes':_0x727b09[_0x7282('0x1b')],'include':_0x727b09['include']?_[_0x7282('0x1e')](_0x727b09[_0x7282('0x1d')],function(_0x28e49b){return{'model':db[_0x28e49b[_0x7282('0x1f')]],'as':_0x28e49b['as'],'attributes':_0x28e49b[_0x7282('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x296d99){logger[_0x7282('0x16')](_0x7282('0x21'),_0x1b58fd);logger['debug'](_0x7282('0x21'),_0x1b58fd,JSON[_0x7282('0x11')](_0x296d99));_0x348786(_0x296d99);})[_0x7282('0x17')](function(_0x5afc3c){logger[_0x7282('0x12')](_0x7282('0x21'),_0x5afc3c[_0x7282('0x15')],_0x1b58fd);_0x13f174(_0x2ea755[_0x7282('0x12')](0x1f4,_0x5afc3c[_0x7282('0x15')]));});});};
\ No newline at end of file
+var _0x6975=['find','ShowDeskAccount','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','include','model','map'];(function(_0x179c89,_0x3a69b2){var _0x4b87e5=function(_0xbdf6f2){while(--_0xbdf6f2){_0x179c89['push'](_0x179c89['shift']());}};_0x4b87e5(++_0x3a69b2);}(_0x6975,0x1af));var _0x5697=function(_0x5dca17,_0x43cdb8){_0x5dca17=_0x5dca17-0x0;var _0xcc7f0c=_0x6975[_0x5dca17];return _0xcc7f0c;};'use strict';var _=require(_0x5697('0x0'));var util=require(_0x5697('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5697('0x2'));var fs=require('fs');var Redis=require(_0x5697('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5697('0x4'));var logger=require(_0x5697('0x5'))(_0x5697('0x6'));var config=require(_0x5697('0x7'));var jayson=require(_0x5697('0x8'));var client=jayson[_0x5697('0x9')][_0x5697('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b8826,_0x5cb9f1,_0x299a52){return new BPromise(function(_0x1e5fbe,_0x257d38){return client[_0x5697('0xb')](_0x3b8826,_0x299a52)[_0x5697('0xc')](function(_0x24bebf){logger[_0x5697('0xd')](_0x5697('0xe'),_0x5cb9f1,'request\x20sent');logger[_0x5697('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5cb9f1,'request\x20sent',JSON[_0x5697('0x10')](_0x24bebf));if(_0x24bebf[_0x5697('0x11')]){if(_0x24bebf['error'][_0x5697('0x12')]===0x1f4){logger[_0x5697('0x11')]('DeskAccount,\x20%s,\x20%s',_0x5cb9f1,_0x24bebf['error'][_0x5697('0x13')]);return _0x257d38(_0x24bebf[_0x5697('0x11')]['message']);}logger[_0x5697('0x11')](_0x5697('0xe'),_0x5cb9f1,_0x24bebf[_0x5697('0x11')][_0x5697('0x13')]);return _0x1e5fbe(_0x24bebf[_0x5697('0x11')][_0x5697('0x13')]);}else{logger[_0x5697('0xd')](_0x5697('0xe'),_0x5cb9f1,'request\x20sent');_0x1e5fbe(_0x24bebf[_0x5697('0x14')]['message']);}})[_0x5697('0x15')](function(_0x2fd49d){logger['error'](_0x5697('0xe'),_0x5cb9f1,_0x2fd49d);_0x257d38(_0x2fd49d);});});}exports[_0x5697('0x16')]=function(_0x3c7691){var _0xd469f8=this;return new Promise(function(_0x4fbbef,_0x52e45f){return db[_0x5697('0x17')][_0x5697('0x18')]({'raw':_0x3c7691[_0x5697('0x19')]?_0x3c7691[_0x5697('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3c7691[_0x5697('0x19')]?_0x3c7691[_0x5697('0x19')][_0x5697('0x1a')]||null:null,'attributes':_0x3c7691[_0x5697('0x19')]?_0x3c7691[_0x5697('0x19')][_0x5697('0x1b')]||null:null,'limit':_0x3c7691[_0x5697('0x19')]?_0x3c7691[_0x5697('0x19')]['limit']||null:null,'include':_0x3c7691[_0x5697('0x19')]?_0x3c7691['options']['include']?_['map'](_0x3c7691[_0x5697('0x19')][_0x5697('0x1c')],function(_0x57c4b8){return{'model':db[_0x57c4b8[_0x5697('0x1d')]],'as':_0x57c4b8['as'],'attributes':_0x57c4b8[_0x5697('0x1b')],'include':_0x57c4b8['include']?_[_0x5697('0x1e')](_0x57c4b8[_0x5697('0x1c')],function(_0x210104){return{'model':db[_0x210104[_0x5697('0x1d')]],'as':_0x210104['as'],'attributes':_0x210104[_0x5697('0x1b')],'include':_0x210104[_0x5697('0x1c')]?_[_0x5697('0x1e')](_0x210104[_0x5697('0x1c')],function(_0x292cee){return{'model':db[_0x292cee[_0x5697('0x1d')]],'as':_0x292cee['as'],'attributes':_0x292cee[_0x5697('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5697('0xc')](function(_0x2e27e7){logger[_0x5697('0xd')](_0x5697('0x16'),_0x3c7691);logger[_0x5697('0xf')](_0x5697('0x16'),_0x3c7691,JSON['stringify'](_0x2e27e7));_0x4fbbef(_0x2e27e7);})[_0x5697('0x15')](function(_0xcdb577){logger['error'](_0x5697('0x16'),_0xcdb577[_0x5697('0x13')],_0x3c7691);_0x52e45f(_0xd469f8[_0x5697('0x11')](0x1f4,_0xcdb577[_0x5697('0x13')]));});});};exports['ShowDeskAccount']=function(_0x2974bb){var _0x4d189a=this;return new Promise(function(_0xc4e666,_0x29c3c1){return db['DeskAccount'][_0x5697('0x1f')]({'raw':_0x2974bb['options']?_0x2974bb[_0x5697('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2974bb[_0x5697('0x19')]?_0x2974bb[_0x5697('0x19')][_0x5697('0x1a')]||null:null,'attributes':_0x2974bb[_0x5697('0x19')]?_0x2974bb['options'][_0x5697('0x1b')]||null:null,'include':_0x2974bb[_0x5697('0x19')]?_0x2974bb[_0x5697('0x19')][_0x5697('0x1c')]?_['map'](_0x2974bb[_0x5697('0x19')][_0x5697('0x1c')],function(_0x239d13){return{'model':db[_0x239d13[_0x5697('0x1d')]],'as':_0x239d13['as'],'attributes':_0x239d13[_0x5697('0x1b')],'include':_0x239d13[_0x5697('0x1c')]?_[_0x5697('0x1e')](_0x239d13[_0x5697('0x1c')],function(_0x3fe4ae){return{'model':db[_0x3fe4ae['model']],'as':_0x3fe4ae['as'],'attributes':_0x3fe4ae[_0x5697('0x1b')],'include':_0x3fe4ae[_0x5697('0x1c')]?_[_0x5697('0x1e')](_0x3fe4ae['include'],function(_0x448cf7){return{'model':db[_0x448cf7[_0x5697('0x1d')]],'as':_0x448cf7['as'],'attributes':_0x448cf7[_0x5697('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe3066){logger[_0x5697('0xd')](_0x5697('0x20'),_0x2974bb);logger[_0x5697('0xf')]('ShowDeskAccount',_0x2974bb,JSON['stringify'](_0xe3066));_0xc4e666(_0xe3066);})[_0x5697('0x15')](function(_0x565c6d){logger[_0x5697('0x11')](_0x5697('0x20'),_0x565c6d[_0x5697('0x13')],_0x2974bb);_0x29c3c1(_0x4d189a[_0x5697('0x11')](0x1f4,_0x565c6d[_0x5697('0x13')]));});});};
\ No newline at end of file
index d65454a..667a25f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x55ca,0x126));var _0xa55c=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x55ca[_0x257b0e];return _0x27ac2a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router;
\ No newline at end of file
+var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x443761,_0x27fb3f){var _0x37ebd8=function(_0x2954be){while(--_0x2954be){_0x443761['push'](_0x443761['shift']());}};_0x37ebd8(++_0x27fb3f);}(_0x34e8,0x12c));var _0x834e=function(_0x3ca003,_0x207921){_0x3ca003=_0x3ca003-0x0;var _0x1bf272=_0x34e8[_0x3ca003];return _0x1bf272;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router;
\ No newline at end of file
index f94b631..6d471c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f91=['exports','STRING','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2f91,0xaa));var _0x12f9=function(_0x512de1,_0x51bb53){_0x512de1=_0x512de1-0x0;var _0xd21d24=_0x2f91[_0x512de1];return _0xd21d24;};'use strict';var Sequelize=require(_0x12f9('0x0'));module[_0x12f9('0x1')]={'name':{'type':Sequelize[_0x12f9('0x2')]},'description':{'type':Sequelize[_0x12f9('0x2')]}};
\ No newline at end of file
+var _0xdf4d=['sequelize'];(function(_0x4fa97c,_0x4aa6ab){var _0x518c7f=function(_0x2bd135){while(--_0x2bd135){_0x4fa97c['push'](_0x4fa97c['shift']());}};_0x518c7f(++_0x4aa6ab);}(_0xdf4d,0xe7));var _0xddf4=function(_0x52be18,_0x4d4a38){_0x52be18=_0x52be18-0x0;var _0xd2b7ff=_0xdf4d[_0x52be18];return _0xd2b7ff;};'use strict';var Sequelize=require(_0xddf4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 21e79f7..774b267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe5e=['setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','DeskConfiguration','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','update','getFields','DeskField','findOne','getSubjects','getDescriptions','Tag','getTags'];(function(_0x3424b3,_0x522fe4){var _0x55ca87=function(_0x3d0cd6){while(--_0x3d0cd6){_0x3424b3['push'](_0x3424b3['shift']());}};_0x55ca87(++_0x522fe4);}(_0xfe5e,0xa8));var _0xefe5=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0xfe5e[_0x5c7e53];return _0x1c9af9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefe5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefe5('0x1'));var rp=require(_0xefe5('0x2'));var moment=require(_0xefe5('0x3'));var BPromise=require(_0xefe5('0x4'));var Mustache=require(_0xefe5('0x5'));var util=require(_0xefe5('0x6'));var path=require(_0xefe5('0x7'));var sox=require(_0xefe5('0x8'));var csv=require(_0xefe5('0x9'));var ejs=require(_0xefe5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xefe5('0xb'));var squel=require(_0xefe5('0xc'));var crypto=require('crypto');var jsforce=require(_0xefe5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xefe5('0x9'));var querystring=require(_0xefe5('0xe'));var Papa=require('papaparse');var Redis=require(_0xefe5('0xf'));var authService=require(_0xefe5('0x10'));var qs=require(_0xefe5('0x11'));var as=require(_0xefe5('0x12'));var hardwareService=require(_0xefe5('0x13'));var logger=require(_0xefe5('0x14'))(_0xefe5('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xefe5('0x16'));var db=require(_0xefe5('0x17'))['db'];function respondWithStatusCode(_0x2a1715,_0x9ccae3){_0x9ccae3=_0x9ccae3||0xcc;return function(_0x140c5d){if(_0x140c5d){return _0x2a1715[_0xefe5('0x18')](_0x9ccae3);}return _0x2a1715['status'](_0x9ccae3)[_0xefe5('0x19')]();};}function respondWithResult(_0x27457b,_0x32b37f){_0x32b37f=_0x32b37f||0xc8;return function(_0x3eff83){if(_0x3eff83){return _0x27457b[_0xefe5('0x1a')](_0x32b37f)[_0xefe5('0x1b')](_0x3eff83);}};}function respondWithFilteredResult(_0x124db9,_0x34d16a){return function(_0x3eea77){if(_0x3eea77){var _0x57e4ad=typeof _0x34d16a[_0xefe5('0x1c')]===_0xefe5('0x1d')&&typeof _0x34d16a['limit']===_0xefe5('0x1d');var _0x22a6d1=_0x3eea77['count'];var _0x5f52ac=_0x57e4ad?0x0:_0x34d16a[_0xefe5('0x1c')];var _0x1cee2c=_0x57e4ad?_0x3eea77['count']:_0x34d16a[_0xefe5('0x1c')]+_0x34d16a[_0xefe5('0x1e')];var _0x1d7d43;if(_0x1cee2c>=_0x22a6d1){_0x1cee2c=_0x22a6d1;_0x1d7d43=0xc8;}else{_0x1d7d43=0xce;}_0x124db9[_0xefe5('0x1a')](_0x1d7d43);return _0x124db9[_0xefe5('0x1f')](_0xefe5('0x20'),_0x5f52ac+'-'+_0x1cee2c+'/'+_0x22a6d1)[_0xefe5('0x1b')](_0x3eea77);}return null;};}function patchUpdates(_0x81890b){return function(_0x276d5d){try{jsonpatch[_0xefe5('0x21')](_0x276d5d,_0x81890b,!![]);}catch(_0x28cb68){return BPromise['reject'](_0x28cb68);}return _0x276d5d[_0xefe5('0x22')]();};}function saveUpdates(_0x5061da,_0x20602e){return function(_0x56a8bd){if(_0x56a8bd){return _0x56a8bd['update'](_0x5061da)[_0xefe5('0x23')](function(_0x206553){return _0x206553;});}return null;};}function removeEntity(_0x1c95ae,_0x191350){return function(_0x205cc7){if(_0x205cc7){return _0x205cc7[_0xefe5('0x24')]()[_0xefe5('0x23')](function(){_0x1c95ae[_0xefe5('0x1a')](0xcc)[_0xefe5('0x19')]();});}};}function handleEntityNotFound(_0x4d858b,_0x118915){return function(_0x37970b){if(!_0x37970b){_0x4d858b[_0xefe5('0x18')](0x194);}return _0x37970b;};}function handleError(_0x4776d0,_0x53ea52){_0x53ea52=_0x53ea52||0x1f4;return function(_0xa089ee){logger[_0xefe5('0x25')](_0xa089ee[_0xefe5('0x26')]);if(_0xa089ee[_0xefe5('0x27')]){delete _0xa089ee[_0xefe5('0x27')];}_0x4776d0[_0xefe5('0x1a')](_0x53ea52)['send'](_0xa089ee);};}exports['index']=function(_0x122d47,_0x1b368e){var _0x1311c4={},_0x1c9687={},_0x2eb11c={'count':0x0,'rows':[]};var _0x1b7b03=_['map'](db[_0xefe5('0x28')][_0xefe5('0x29')],function(_0x296740){return{'name':_0x296740[_0xefe5('0x2a')],'type':_0x296740[_0xefe5('0x2b')]['key']};});_0x1c9687[_0xefe5('0x2c')]=_[_0xefe5('0x2d')](_0x1b7b03,_0xefe5('0x27'));_0x1c9687[_0xefe5('0x2e')]=_['keys'](_0x122d47[_0xefe5('0x2e')]);_0x1c9687[_0xefe5('0x2f')]=_[_0xefe5('0x30')](_0x1c9687['model'],_0x1c9687[_0xefe5('0x2e')]);_0x1311c4[_0xefe5('0x31')]=_[_0xefe5('0x30')](_0x1c9687['model'],qs[_0xefe5('0x32')](_0x122d47[_0xefe5('0x2e')][_0xefe5('0x32')]));_0x1311c4[_0xefe5('0x31')]=_0x1311c4['attributes'][_0xefe5('0x33')]?_0x1311c4[_0xefe5('0x31')]:_0x1c9687[_0xefe5('0x2c')];if(!_0x122d47[_0xefe5('0x2e')][_0xefe5('0x34')](_0xefe5('0x35'))){_0x1311c4[_0xefe5('0x1e')]=qs['limit'](_0x122d47[_0xefe5('0x2e')][_0xefe5('0x1e')]);_0x1311c4[_0xefe5('0x1c')]=qs[_0xefe5('0x1c')](_0x122d47['query']['offset']);}_0x1311c4[_0xefe5('0x36')]=qs[_0xefe5('0x37')](_0x122d47['query']['sort']);_0x1311c4[_0xefe5('0x38')]=qs[_0xefe5('0x2f')](_[_0xefe5('0x39')](_0x122d47[_0xefe5('0x2e')],_0x1c9687[_0xefe5('0x2f')]),_0x1b7b03);if(_0x122d47[_0xefe5('0x2e')][_0xefe5('0x3a')]){_0x1311c4['where']=_[_0xefe5('0x3b')](_0x1311c4[_0xefe5('0x38')],{'$or':_['map'](_0x1b7b03,function(_0x3a580e){if(_0x3a580e['type']!=='VIRTUAL'){var _0x3ec642={};_0x3ec642[_0x3a580e[_0xefe5('0x27')]]={'$like':'%'+_0x122d47[_0xefe5('0x2e')][_0xefe5('0x3a')]+'%'};return _0x3ec642;}})});}_0x1311c4=_[_0xefe5('0x3b')]({},_0x1311c4,_0x122d47[_0xefe5('0x3c')]);var _0x3a69ab={'where':_0x1311c4[_0xefe5('0x38')]};return db['DeskConfiguration']['count'](_0x3a69ab)[_0xefe5('0x23')](function(_0x14e7b1){_0x2eb11c[_0xefe5('0x3d')]=_0x14e7b1;if(_0x122d47[_0xefe5('0x2e')]['includeAll']){_0x1311c4[_0xefe5('0x3e')]=[{'all':!![]}];}return db[_0xefe5('0x28')][_0xefe5('0x3f')](_0x1311c4);})[_0xefe5('0x23')](function(_0x23e85f){_0x2eb11c[_0xefe5('0x40')]=_0x23e85f;return _0x2eb11c;})[_0xefe5('0x23')](respondWithFilteredResult(_0x1b368e,_0x1311c4))[_0xefe5('0x41')](handleError(_0x1b368e,null));};exports[_0xefe5('0x42')]=function(_0x5b077a,_0x381c89){var _0x2fa5da={'raw':![],'where':{'id':_0x5b077a[_0xefe5('0x43')]['id']}},_0x11ae4e={};_0x11ae4e[_0xefe5('0x2c')]=_[_0xefe5('0x44')](db[_0xefe5('0x28')]['rawAttributes']);_0x11ae4e['query']=_[_0xefe5('0x44')](_0x5b077a[_0xefe5('0x2e')]);_0x11ae4e[_0xefe5('0x2f')]=_['intersection'](_0x11ae4e['model'],_0x11ae4e['query']);_0x2fa5da[_0xefe5('0x31')]=_[_0xefe5('0x30')](_0x11ae4e['model'],qs[_0xefe5('0x32')](_0x5b077a[_0xefe5('0x2e')]['fields']));_0x2fa5da[_0xefe5('0x31')]=_0x2fa5da[_0xefe5('0x31')][_0xefe5('0x33')]?_0x2fa5da[_0xefe5('0x31')]:_0x11ae4e['model'];if(_0x5b077a[_0xefe5('0x2e')][_0xefe5('0x45')]){_0x2fa5da['include']=[{'all':!![]}];}_0x2fa5da=_[_0xefe5('0x3b')]({},_0x2fa5da,_0x5b077a['options']);return db['DeskConfiguration'][_0xefe5('0x46')](_0x2fa5da)['then'](handleEntityNotFound(_0x381c89,null))[_0xefe5('0x23')](respondWithResult(_0x381c89,null))[_0xefe5('0x41')](handleError(_0x381c89,null));};exports[_0xefe5('0x47')]=function(_0x27e240,_0x154577){return db['DeskConfiguration']['create'](_0x27e240[_0xefe5('0x48')],{})[_0xefe5('0x23')](respondWithResult(_0x154577,0xc9))['catch'](handleError(_0x154577,null));};exports[_0xefe5('0x49')]=function(_0x5d24f3,_0x423d89){if(_0x5d24f3['body']['id']){delete _0x5d24f3['body']['id'];}return db[_0xefe5('0x28')][_0xefe5('0x46')]({'where':{'id':_0x5d24f3['params']['id']}})[_0xefe5('0x23')](handleEntityNotFound(_0x423d89,null))[_0xefe5('0x23')](saveUpdates(_0x5d24f3[_0xefe5('0x48')],null))['then'](respondWithResult(_0x423d89,null))['catch'](handleError(_0x423d89,null));};exports[_0xefe5('0x24')]=function(_0xc0db6e,_0x2a8cf7){return db[_0xefe5('0x28')][_0xefe5('0x46')]({'where':{'id':_0xc0db6e[_0xefe5('0x43')]['id']}})[_0xefe5('0x23')](handleEntityNotFound(_0x2a8cf7,null))[_0xefe5('0x23')](removeEntity(_0x2a8cf7,null))['catch'](handleError(_0x2a8cf7,null));};exports[_0xefe5('0x4a')]=function(_0x368234,_0x313836,_0x4f7acf){var _0x444596={};var _0x501660={};var _0x313cdd;var _0x8eb6f5;return db[_0xefe5('0x28')]['findOne']({'where':{'id':_0x368234['params']['id']}})[_0xefe5('0x23')](handleEntityNotFound(_0x313836,null))['then'](function(_0x428bdf){if(_0x428bdf){_0x313cdd=_0x428bdf;_0x501660[_0xefe5('0x2c')]=_['keys'](db[_0xefe5('0x4b')][_0xefe5('0x29')]);_0x501660['query']=_[_0xefe5('0x44')](_0x368234[_0xefe5('0x2e')]);_0x501660[_0xefe5('0x2f')]=_[_0xefe5('0x30')](_0x501660[_0xefe5('0x2c')],_0x501660[_0xefe5('0x2e')]);_0x444596[_0xefe5('0x31')]=_[_0xefe5('0x30')](_0x501660[_0xefe5('0x2c')],qs[_0xefe5('0x32')](_0x368234[_0xefe5('0x2e')]['fields']));_0x444596[_0xefe5('0x31')]=_0x444596[_0xefe5('0x31')][_0xefe5('0x33')]?_0x444596[_0xefe5('0x31')]:_0x501660['model'];_0x444596[_0xefe5('0x36')]=qs[_0xefe5('0x37')](_0x368234[_0xefe5('0x2e')][_0xefe5('0x37')]);_0x444596[_0xefe5('0x38')]=qs[_0xefe5('0x2f')](_[_0xefe5('0x39')](_0x368234['query'],_0x501660['filters']));if(_0x368234[_0xefe5('0x2e')][_0xefe5('0x3a')]){_0x444596[_0xefe5('0x38')]=_[_0xefe5('0x3b')](_0x444596[_0xefe5('0x38')],{'$or':_[_0xefe5('0x2d')](_0x444596[_0xefe5('0x31')],function(_0x3009a9){var _0x404ac6={};_0x404ac6[_0x3009a9]={'$like':'%'+_0x368234['query'][_0xefe5('0x3a')]+'%'};return _0x404ac6;})});}_0x444596=_['merge']({},_0x444596,_0x368234[_0xefe5('0x3c')]);return _0x313cdd['getFields'](_0x444596);}})['then'](function(_0x3b3ee0){if(_0x3b3ee0){_0x8eb6f5=_0x3b3ee0['length'];if(!_0x368234['query'][_0xefe5('0x34')]('nolimit')){_0x444596[_0xefe5('0x1e')]=qs[_0xefe5('0x1e')](_0x368234['query']['limit']);_0x444596[_0xefe5('0x1c')]=qs[_0xefe5('0x1c')](_0x368234['query'][_0xefe5('0x1c')]);}return _0x313cdd[_0xefe5('0x4a')](_0x444596);}})[_0xefe5('0x23')](function(_0x8e1ea1){if(_0x8e1ea1){return _0x8e1ea1?{'count':_0x8eb6f5,'rows':_0x8e1ea1}:null;}})[_0xefe5('0x23')](respondWithResult(_0x313836,null))['catch'](handleError(_0x313836,null));};exports['getSubjects']=function(_0xf673c,_0xe9cc57,_0xa220f4){var _0x1cb978={};var _0x23a948={};var _0x6803f3;var _0x8f9685;return db[_0xefe5('0x28')][_0xefe5('0x4c')]({'where':{'id':_0xf673c['params']['id']}})[_0xefe5('0x23')](handleEntityNotFound(_0xe9cc57,null))[_0xefe5('0x23')](function(_0xdad949){if(_0xdad949){_0x6803f3=_0xdad949;_0x23a948['model']=_[_0xefe5('0x44')](db[_0xefe5('0x4b')][_0xefe5('0x29')]);_0x23a948[_0xefe5('0x2e')]=_[_0xefe5('0x44')](_0xf673c[_0xefe5('0x2e')]);_0x23a948[_0xefe5('0x2f')]=_[_0xefe5('0x30')](_0x23a948[_0xefe5('0x2c')],_0x23a948[_0xefe5('0x2e')]);_0x1cb978['attributes']=_[_0xefe5('0x30')](_0x23a948['model'],qs['fields'](_0xf673c[_0xefe5('0x2e')][_0xefe5('0x32')]));_0x1cb978['attributes']=_0x1cb978[_0xefe5('0x31')][_0xefe5('0x33')]?_0x1cb978[_0xefe5('0x31')]:_0x23a948[_0xefe5('0x2c')];_0x1cb978[_0xefe5('0x36')]=qs[_0xefe5('0x37')](_0xf673c[_0xefe5('0x2e')][_0xefe5('0x37')]);_0x1cb978[_0xefe5('0x38')]=qs[_0xefe5('0x2f')](_['pick'](_0xf673c['query'],_0x23a948['filters']));if(_0xf673c[_0xefe5('0x2e')][_0xefe5('0x3a')]){_0x1cb978[_0xefe5('0x38')]=_[_0xefe5('0x3b')](_0x1cb978['where'],{'$or':_[_0xefe5('0x2d')](_0x1cb978[_0xefe5('0x31')],function(_0x1f217c){var _0x459f2d={};_0x459f2d[_0x1f217c]={'$like':'%'+_0xf673c[_0xefe5('0x2e')]['filter']+'%'};return _0x459f2d;})});}_0x1cb978=_[_0xefe5('0x3b')]({},_0x1cb978,_0xf673c[_0xefe5('0x3c')]);return _0x6803f3['getSubjects'](_0x1cb978);}})[_0xefe5('0x23')](function(_0xe969fe){if(_0xe969fe){_0x8f9685=_0xe969fe[_0xefe5('0x33')];if(!_0xf673c[_0xefe5('0x2e')][_0xefe5('0x34')](_0xefe5('0x35'))){_0x1cb978['limit']=qs[_0xefe5('0x1e')](_0xf673c[_0xefe5('0x2e')][_0xefe5('0x1e')]);_0x1cb978[_0xefe5('0x1c')]=qs[_0xefe5('0x1c')](_0xf673c[_0xefe5('0x2e')][_0xefe5('0x1c')]);}return _0x6803f3[_0xefe5('0x4d')](_0x1cb978);}})[_0xefe5('0x23')](function(_0x38a23a){if(_0x38a23a){return _0x38a23a?{'count':_0x8f9685,'rows':_0x38a23a}:null;}})[_0xefe5('0x23')](respondWithResult(_0xe9cc57,null))[_0xefe5('0x41')](handleError(_0xe9cc57,null));};exports[_0xefe5('0x4e')]=function(_0x2eb374,_0x512e20,_0x40a795){var _0x8b189e={};var _0x16d99d={};var _0x2011ed;var _0x48fe7d;return db['DeskConfiguration'][_0xefe5('0x4c')]({'where':{'id':_0x2eb374[_0xefe5('0x43')]['id']}})[_0xefe5('0x23')](handleEntityNotFound(_0x512e20,null))[_0xefe5('0x23')](function(_0xc077c6){if(_0xc077c6){_0x2011ed=_0xc077c6;_0x16d99d['model']=_[_0xefe5('0x44')](db[_0xefe5('0x4b')][_0xefe5('0x29')]);_0x16d99d[_0xefe5('0x2e')]=_[_0xefe5('0x44')](_0x2eb374[_0xefe5('0x2e')]);_0x16d99d[_0xefe5('0x2f')]=_['intersection'](_0x16d99d[_0xefe5('0x2c')],_0x16d99d[_0xefe5('0x2e')]);_0x8b189e[_0xefe5('0x31')]=_['intersection'](_0x16d99d['model'],qs[_0xefe5('0x32')](_0x2eb374[_0xefe5('0x2e')][_0xefe5('0x32')]));_0x8b189e[_0xefe5('0x31')]=_0x8b189e['attributes'][_0xefe5('0x33')]?_0x8b189e[_0xefe5('0x31')]:_0x16d99d[_0xefe5('0x2c')];_0x8b189e[_0xefe5('0x36')]=qs['sort'](_0x2eb374['query'][_0xefe5('0x37')]);_0x8b189e[_0xefe5('0x38')]=qs[_0xefe5('0x2f')](_[_0xefe5('0x39')](_0x2eb374[_0xefe5('0x2e')],_0x16d99d['filters']));if(_0x2eb374[_0xefe5('0x2e')][_0xefe5('0x3a')]){_0x8b189e[_0xefe5('0x38')]=_[_0xefe5('0x3b')](_0x8b189e[_0xefe5('0x38')],{'$or':_[_0xefe5('0x2d')](_0x8b189e[_0xefe5('0x31')],function(_0x27bf7f){var _0x1e9716={};_0x1e9716[_0x27bf7f]={'$like':'%'+_0x2eb374[_0xefe5('0x2e')]['filter']+'%'};return _0x1e9716;})});}_0x8b189e=_[_0xefe5('0x3b')]({},_0x8b189e,_0x2eb374[_0xefe5('0x3c')]);return _0x2011ed[_0xefe5('0x4e')](_0x8b189e);}})[_0xefe5('0x23')](function(_0x4eaa4f){if(_0x4eaa4f){_0x48fe7d=_0x4eaa4f[_0xefe5('0x33')];if(!_0x2eb374[_0xefe5('0x2e')]['hasOwnProperty'](_0xefe5('0x35'))){_0x8b189e[_0xefe5('0x1e')]=qs['limit'](_0x2eb374[_0xefe5('0x2e')]['limit']);_0x8b189e[_0xefe5('0x1c')]=qs[_0xefe5('0x1c')](_0x2eb374[_0xefe5('0x2e')]['offset']);}return _0x2011ed[_0xefe5('0x4e')](_0x8b189e);}})['then'](function(_0x4b17c1){if(_0x4b17c1){return _0x4b17c1?{'count':_0x48fe7d,'rows':_0x4b17c1}:null;}})['then'](respondWithResult(_0x512e20,null))[_0xefe5('0x41')](handleError(_0x512e20,null));};exports['getTags']=function(_0x57bbe7,_0x1e1d9b,_0x4eab39){var _0x189dd0={};var _0x4278dd={};var _0x5b3202;var _0x53ec80;return db[_0xefe5('0x28')][_0xefe5('0x4c')]({'where':{'id':_0x57bbe7[_0xefe5('0x43')]['id']}})['then'](handleEntityNotFound(_0x1e1d9b,null))['then'](function(_0x1e1d12){if(_0x1e1d12){_0x5b3202=_0x1e1d12;_0x4278dd['model']=_[_0xefe5('0x44')](db[_0xefe5('0x4f')][_0xefe5('0x29')]);_0x4278dd[_0xefe5('0x2e')]=_[_0xefe5('0x44')](_0x57bbe7[_0xefe5('0x2e')]);_0x4278dd[_0xefe5('0x2f')]=_[_0xefe5('0x30')](_0x4278dd[_0xefe5('0x2c')],_0x4278dd[_0xefe5('0x2e')]);_0x189dd0['attributes']=_['intersection'](_0x4278dd[_0xefe5('0x2c')],qs[_0xefe5('0x32')](_0x57bbe7[_0xefe5('0x2e')][_0xefe5('0x32')]));_0x189dd0[_0xefe5('0x31')]=_0x189dd0[_0xefe5('0x31')]['length']?_0x189dd0[_0xefe5('0x31')]:_0x4278dd['model'];_0x189dd0['order']=qs[_0xefe5('0x37')](_0x57bbe7[_0xefe5('0x2e')][_0xefe5('0x37')]);_0x189dd0[_0xefe5('0x38')]=qs[_0xefe5('0x2f')](_[_0xefe5('0x39')](_0x57bbe7[_0xefe5('0x2e')],_0x4278dd['filters']));if(_0x57bbe7[_0xefe5('0x2e')]['filter']){_0x189dd0['where']=_[_0xefe5('0x3b')](_0x189dd0[_0xefe5('0x38')],{'$or':_[_0xefe5('0x2d')](_0x189dd0[_0xefe5('0x31')],function(_0x382461){var _0x296545={};_0x296545[_0x382461]={'$like':'%'+_0x57bbe7[_0xefe5('0x2e')]['filter']+'%'};return _0x296545;})});}_0x189dd0=_[_0xefe5('0x3b')]({},_0x189dd0,_0x57bbe7[_0xefe5('0x3c')]);return _0x5b3202[_0xefe5('0x50')](_0x189dd0);}})[_0xefe5('0x23')](function(_0x1891e8){if(_0x1891e8){_0x53ec80=_0x1891e8[_0xefe5('0x33')];if(!_0x57bbe7[_0xefe5('0x2e')][_0xefe5('0x34')](_0xefe5('0x35'))){_0x189dd0[_0xefe5('0x1e')]=qs[_0xefe5('0x1e')](_0x57bbe7[_0xefe5('0x2e')][_0xefe5('0x1e')]);_0x189dd0[_0xefe5('0x1c')]=qs[_0xefe5('0x1c')](_0x57bbe7[_0xefe5('0x2e')][_0xefe5('0x1c')]);}return _0x5b3202[_0xefe5('0x50')](_0x189dd0);}})[_0xefe5('0x23')](function(_0x43dba1){if(_0x43dba1){return _0x43dba1?{'count':_0x53ec80,'rows':_0x43dba1}:null;}})[_0xefe5('0x23')](respondWithResult(_0x1e1d9b,null))[_0xefe5('0x41')](handleError(_0x1e1d9b,null));};exports[_0xefe5('0x51')]=function(_0x369869,_0x3b16ea,_0x42e3c2){if(_0x369869[_0xefe5('0x48')]['id']){delete _0x369869[_0xefe5('0x48')]['id'];}return db[_0xefe5('0x28')][_0xefe5('0x4c')]({'where':{'id':_0x369869[_0xefe5('0x43')]['id']}})[_0xefe5('0x23')](handleEntityNotFound(_0x3b16ea,null))['then'](function(_0x4cf23a){if(_0x4cf23a){return _0x4cf23a[_0xefe5('0x51')](_0x369869[_0xefe5('0x48')][_0xefe5('0x52')]||[]);}return null;})[_0xefe5('0x23')](respondWithResult(_0x3b16ea,null))[_0xefe5('0x41')](handleError(_0x3b16ea,null));};
\ No newline at end of file
+var _0x481d=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','error','stack','name','send','map','DeskConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','fields','options','find','create','body','params','destroy','getFields','findOne','DeskField','getSubjects','hasOwnProperty','getDescriptions','Tag','getTags','setTags'];(function(_0x368388,_0x117007){var _0x52a720=function(_0x4acd6b){while(--_0x4acd6b){_0x368388['push'](_0x368388['shift']());}};_0x52a720(++_0x117007);}(_0x481d,0xf9));var _0xd481=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0x481d[_0x35e75a];return _0xb23c7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd481('0x0'));var zipdir=require(_0xd481('0x1'));var jsonpatch=require(_0xd481('0x2'));var rp=require(_0xd481('0x3'));var moment=require(_0xd481('0x4'));var BPromise=require(_0xd481('0x5'));var Mustache=require(_0xd481('0x6'));var util=require(_0xd481('0x7'));var path=require('path');var sox=require(_0xd481('0x8'));var csv=require(_0xd481('0x9'));var ejs=require(_0xd481('0xa'));var fs=require('fs');var fs_extra=require(_0xd481('0xb'));var _=require(_0xd481('0xc'));var squel=require(_0xd481('0xd'));var crypto=require(_0xd481('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd481('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd481('0x10'));var Papa=require('papaparse');var Redis=require(_0xd481('0x11'));var authService=require(_0xd481('0x12'));var qs=require(_0xd481('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd481('0x14'));var logger=require(_0xd481('0x15'))(_0xd481('0x16'));var utils=require('../../config/utils');var config=require(_0xd481('0x17'));var licenseUtil=require(_0xd481('0x18'));var db=require(_0xd481('0x19'))['db'];function respondWithStatusCode(_0x14d17e,_0x3da897){_0x3da897=_0x3da897||0xcc;return function(_0x132aad){if(_0x132aad){return _0x14d17e[_0xd481('0x1a')](_0x3da897);}return _0x14d17e[_0xd481('0x1b')](_0x3da897)[_0xd481('0x1c')]();};}function respondWithResult(_0x59ea48,_0x1ea95b){_0x1ea95b=_0x1ea95b||0xc8;return function(_0x5a4b9e){if(_0x5a4b9e){return _0x59ea48[_0xd481('0x1b')](_0x1ea95b)[_0xd481('0x1d')](_0x5a4b9e);}};}function respondWithFilteredResult(_0x43fa16,_0x34689c){return function(_0x30eec0){if(_0x30eec0){var _0x506c12=typeof _0x34689c[_0xd481('0x1e')]==='undefined'&&typeof _0x34689c[_0xd481('0x1f')]===_0xd481('0x20');var _0x514415=_0x30eec0[_0xd481('0x21')];var _0x3df540=_0x506c12?0x0:_0x34689c[_0xd481('0x1e')];var _0x5c34a4=_0x506c12?_0x30eec0['count']:_0x34689c['offset']+_0x34689c[_0xd481('0x1f')];var _0x2a0198;if(_0x5c34a4>=_0x514415){_0x5c34a4=_0x514415;_0x2a0198=0xc8;}else{_0x2a0198=0xce;}_0x43fa16[_0xd481('0x1b')](_0x2a0198);return _0x43fa16[_0xd481('0x22')](_0xd481('0x23'),_0x3df540+'-'+_0x5c34a4+'/'+_0x514415)[_0xd481('0x1d')](_0x30eec0);}return null;};}function patchUpdates(_0x13c7c4){return function(_0x59ad76){try{jsonpatch['apply'](_0x59ad76,_0x13c7c4,!![]);}catch(_0x4fd110){return BPromise[_0xd481('0x24')](_0x4fd110);}return _0x59ad76['save']();};}function saveUpdates(_0x9f186d,_0x37f876){return function(_0x2dc274){if(_0x2dc274){return _0x2dc274[_0xd481('0x25')](_0x9f186d)[_0xd481('0x26')](function(_0x54888d){return _0x54888d;});}return null;};}function removeEntity(_0x37d723,_0xadfa6f){return function(_0x204714){if(_0x204714){return _0x204714['destroy']()[_0xd481('0x26')](function(){_0x37d723[_0xd481('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b4261,_0x10fd07){return function(_0x285c1){if(!_0x285c1){_0x3b4261[_0xd481('0x1a')](0x194);}return _0x285c1;};}function handleError(_0x3f8ceb,_0x4bf92f){_0x4bf92f=_0x4bf92f||0x1f4;return function(_0x36ffe6){logger[_0xd481('0x27')](_0x36ffe6[_0xd481('0x28')]);if(_0x36ffe6[_0xd481('0x29')]){delete _0x36ffe6[_0xd481('0x29')];}_0x3f8ceb[_0xd481('0x1b')](_0x4bf92f)[_0xd481('0x2a')](_0x36ffe6);};}exports['index']=function(_0x5ccb29,_0x3b3fbc){var _0x35281a={},_0x276bd6={},_0x9350d8={'count':0x0,'rows':[]};var _0x1eae59=_[_0xd481('0x2b')](db[_0xd481('0x2c')][_0xd481('0x2d')],function(_0x486d63){return{'name':_0x486d63['fieldName'],'type':_0x486d63[_0xd481('0x2e')][_0xd481('0x2f')]};});_0x276bd6['model']=_[_0xd481('0x2b')](_0x1eae59,_0xd481('0x29'));_0x276bd6[_0xd481('0x30')]=_[_0xd481('0x31')](_0x5ccb29['query']);_0x276bd6[_0xd481('0x32')]=_[_0xd481('0x33')](_0x276bd6[_0xd481('0x34')],_0x276bd6[_0xd481('0x30')]);_0x35281a['attributes']=_[_0xd481('0x33')](_0x276bd6['model'],qs['fields'](_0x5ccb29[_0xd481('0x30')]['fields']));_0x35281a[_0xd481('0x35')]=_0x35281a[_0xd481('0x35')][_0xd481('0x36')]?_0x35281a[_0xd481('0x35')]:_0x276bd6[_0xd481('0x34')];if(!_0x5ccb29[_0xd481('0x30')]['hasOwnProperty'](_0xd481('0x37'))){_0x35281a[_0xd481('0x1f')]=qs[_0xd481('0x1f')](_0x5ccb29[_0xd481('0x30')][_0xd481('0x1f')]);_0x35281a[_0xd481('0x1e')]=qs[_0xd481('0x1e')](_0x5ccb29['query'][_0xd481('0x1e')]);}_0x35281a[_0xd481('0x38')]=qs['sort'](_0x5ccb29[_0xd481('0x30')][_0xd481('0x39')]);_0x35281a['where']=qs[_0xd481('0x32')](_[_0xd481('0x3a')](_0x5ccb29[_0xd481('0x30')],_0x276bd6[_0xd481('0x32')]),_0x1eae59);if(_0x5ccb29[_0xd481('0x30')][_0xd481('0x3b')]){_0x35281a[_0xd481('0x3c')]=_[_0xd481('0x3d')](_0x35281a[_0xd481('0x3c')],{'$or':_[_0xd481('0x2b')](_0x1eae59,function(_0x4e7641){if(_0x4e7641[_0xd481('0x2e')]!=='VIRTUAL'){var _0x4e9799={};_0x4e9799[_0x4e7641[_0xd481('0x29')]]={'$like':'%'+_0x5ccb29[_0xd481('0x30')][_0xd481('0x3b')]+'%'};return _0x4e9799;}})});}_0x35281a=_[_0xd481('0x3d')]({},_0x35281a,_0x5ccb29['options']);var _0x58baa7={'where':_0x35281a[_0xd481('0x3c')]};return db[_0xd481('0x2c')][_0xd481('0x21')](_0x58baa7)['then'](function(_0xb4f82b){_0x9350d8[_0xd481('0x21')]=_0xb4f82b;if(_0x5ccb29[_0xd481('0x30')][_0xd481('0x3e')]){_0x35281a[_0xd481('0x3f')]=[{'all':!![]}];}return db[_0xd481('0x2c')][_0xd481('0x40')](_0x35281a);})[_0xd481('0x26')](function(_0x373e24){_0x9350d8[_0xd481('0x41')]=_0x373e24;return _0x9350d8;})[_0xd481('0x26')](respondWithFilteredResult(_0x3b3fbc,_0x35281a))[_0xd481('0x42')](handleError(_0x3b3fbc,null));};exports['show']=function(_0x19bacd,_0x360d92){var _0x3716e2={'raw':![],'where':{'id':_0x19bacd['params']['id']}},_0x28f51c={};_0x28f51c[_0xd481('0x34')]=_['keys'](db[_0xd481('0x2c')][_0xd481('0x2d')]);_0x28f51c[_0xd481('0x30')]=_[_0xd481('0x31')](_0x19bacd['query']);_0x28f51c['filters']=_[_0xd481('0x33')](_0x28f51c[_0xd481('0x34')],_0x28f51c[_0xd481('0x30')]);_0x3716e2[_0xd481('0x35')]=_[_0xd481('0x33')](_0x28f51c[_0xd481('0x34')],qs['fields'](_0x19bacd['query'][_0xd481('0x43')]));_0x3716e2[_0xd481('0x35')]=_0x3716e2['attributes'][_0xd481('0x36')]?_0x3716e2[_0xd481('0x35')]:_0x28f51c['model'];if(_0x19bacd[_0xd481('0x30')][_0xd481('0x3e')]){_0x3716e2[_0xd481('0x3f')]=[{'all':!![]}];}_0x3716e2=_[_0xd481('0x3d')]({},_0x3716e2,_0x19bacd[_0xd481('0x44')]);return db[_0xd481('0x2c')][_0xd481('0x45')](_0x3716e2)['then'](handleEntityNotFound(_0x360d92,null))[_0xd481('0x26')](respondWithResult(_0x360d92,null))[_0xd481('0x42')](handleError(_0x360d92,null));};exports[_0xd481('0x46')]=function(_0x49d01b,_0xed2ff1){return db[_0xd481('0x2c')][_0xd481('0x46')](_0x49d01b[_0xd481('0x47')],{})[_0xd481('0x26')](respondWithResult(_0xed2ff1,0xc9))[_0xd481('0x42')](handleError(_0xed2ff1,null));};exports[_0xd481('0x25')]=function(_0x50800b,_0x4c41e0){if(_0x50800b['body']['id']){delete _0x50800b['body']['id'];}return db[_0xd481('0x2c')][_0xd481('0x45')]({'where':{'id':_0x50800b[_0xd481('0x48')]['id']}})[_0xd481('0x26')](handleEntityNotFound(_0x4c41e0,null))['then'](saveUpdates(_0x50800b[_0xd481('0x47')],null))[_0xd481('0x26')](respondWithResult(_0x4c41e0,null))['catch'](handleError(_0x4c41e0,null));};exports[_0xd481('0x49')]=function(_0x370fd7,_0x229ce9){return db[_0xd481('0x2c')][_0xd481('0x45')]({'where':{'id':_0x370fd7[_0xd481('0x48')]['id']}})[_0xd481('0x26')](handleEntityNotFound(_0x229ce9,null))['then'](removeEntity(_0x229ce9,null))[_0xd481('0x42')](handleError(_0x229ce9,null));};exports[_0xd481('0x4a')]=function(_0x4bb496,_0x3b42a6,_0x3b87cf){var _0x3ffc6e={};var _0x4dab6c={};var _0x56f6bb;var _0x29a597;return db[_0xd481('0x2c')][_0xd481('0x4b')]({'where':{'id':_0x4bb496[_0xd481('0x48')]['id']}})[_0xd481('0x26')](handleEntityNotFound(_0x3b42a6,null))[_0xd481('0x26')](function(_0x2bec65){if(_0x2bec65){_0x56f6bb=_0x2bec65;_0x4dab6c[_0xd481('0x34')]=_['keys'](db[_0xd481('0x4c')]['rawAttributes']);_0x4dab6c[_0xd481('0x30')]=_['keys'](_0x4bb496[_0xd481('0x30')]);_0x4dab6c[_0xd481('0x32')]=_['intersection'](_0x4dab6c[_0xd481('0x34')],_0x4dab6c['query']);_0x3ffc6e[_0xd481('0x35')]=_[_0xd481('0x33')](_0x4dab6c[_0xd481('0x34')],qs[_0xd481('0x43')](_0x4bb496['query']['fields']));_0x3ffc6e[_0xd481('0x35')]=_0x3ffc6e[_0xd481('0x35')][_0xd481('0x36')]?_0x3ffc6e[_0xd481('0x35')]:_0x4dab6c[_0xd481('0x34')];_0x3ffc6e['order']=qs[_0xd481('0x39')](_0x4bb496[_0xd481('0x30')][_0xd481('0x39')]);_0x3ffc6e['where']=qs[_0xd481('0x32')](_[_0xd481('0x3a')](_0x4bb496[_0xd481('0x30')],_0x4dab6c[_0xd481('0x32')]));if(_0x4bb496[_0xd481('0x30')][_0xd481('0x3b')]){_0x3ffc6e[_0xd481('0x3c')]=_[_0xd481('0x3d')](_0x3ffc6e[_0xd481('0x3c')],{'$or':_[_0xd481('0x2b')](_0x3ffc6e[_0xd481('0x35')],function(_0x2ab29f){var _0x3a4d2e={};_0x3a4d2e[_0x2ab29f]={'$like':'%'+_0x4bb496[_0xd481('0x30')][_0xd481('0x3b')]+'%'};return _0x3a4d2e;})});}_0x3ffc6e=_[_0xd481('0x3d')]({},_0x3ffc6e,_0x4bb496[_0xd481('0x44')]);return _0x56f6bb['getFields'](_0x3ffc6e);}})[_0xd481('0x26')](function(_0x38fddf){if(_0x38fddf){_0x29a597=_0x38fddf['length'];if(!_0x4bb496[_0xd481('0x30')]['hasOwnProperty'](_0xd481('0x37'))){_0x3ffc6e['limit']=qs[_0xd481('0x1f')](_0x4bb496['query'][_0xd481('0x1f')]);_0x3ffc6e[_0xd481('0x1e')]=qs[_0xd481('0x1e')](_0x4bb496['query'][_0xd481('0x1e')]);}return _0x56f6bb[_0xd481('0x4a')](_0x3ffc6e);}})[_0xd481('0x26')](function(_0x99a887){if(_0x99a887){return _0x99a887?{'count':_0x29a597,'rows':_0x99a887}:null;}})['then'](respondWithResult(_0x3b42a6,null))[_0xd481('0x42')](handleError(_0x3b42a6,null));};exports[_0xd481('0x4d')]=function(_0x3b720d,_0x477985,_0x158915){var _0x599160={};var _0x2e547c={};var _0x1617e3;var _0x51ce8e;return db[_0xd481('0x2c')][_0xd481('0x4b')]({'where':{'id':_0x3b720d['params']['id']}})[_0xd481('0x26')](handleEntityNotFound(_0x477985,null))[_0xd481('0x26')](function(_0x3ca437){if(_0x3ca437){_0x1617e3=_0x3ca437;_0x2e547c[_0xd481('0x34')]=_['keys'](db[_0xd481('0x4c')]['rawAttributes']);_0x2e547c['query']=_[_0xd481('0x31')](_0x3b720d[_0xd481('0x30')]);_0x2e547c[_0xd481('0x32')]=_[_0xd481('0x33')](_0x2e547c[_0xd481('0x34')],_0x2e547c[_0xd481('0x30')]);_0x599160[_0xd481('0x35')]=_['intersection'](_0x2e547c[_0xd481('0x34')],qs[_0xd481('0x43')](_0x3b720d[_0xd481('0x30')]['fields']));_0x599160['attributes']=_0x599160[_0xd481('0x35')][_0xd481('0x36')]?_0x599160[_0xd481('0x35')]:_0x2e547c['model'];_0x599160[_0xd481('0x38')]=qs['sort'](_0x3b720d[_0xd481('0x30')][_0xd481('0x39')]);_0x599160['where']=qs[_0xd481('0x32')](_[_0xd481('0x3a')](_0x3b720d[_0xd481('0x30')],_0x2e547c[_0xd481('0x32')]));if(_0x3b720d[_0xd481('0x30')][_0xd481('0x3b')]){_0x599160[_0xd481('0x3c')]=_[_0xd481('0x3d')](_0x599160[_0xd481('0x3c')],{'$or':_['map'](_0x599160[_0xd481('0x35')],function(_0x2e2e40){var _0x330151={};_0x330151[_0x2e2e40]={'$like':'%'+_0x3b720d[_0xd481('0x30')][_0xd481('0x3b')]+'%'};return _0x330151;})});}_0x599160=_[_0xd481('0x3d')]({},_0x599160,_0x3b720d['options']);return _0x1617e3[_0xd481('0x4d')](_0x599160);}})['then'](function(_0x1dd916){if(_0x1dd916){_0x51ce8e=_0x1dd916[_0xd481('0x36')];if(!_0x3b720d['query'][_0xd481('0x4e')](_0xd481('0x37'))){_0x599160[_0xd481('0x1f')]=qs[_0xd481('0x1f')](_0x3b720d[_0xd481('0x30')]['limit']);_0x599160[_0xd481('0x1e')]=qs[_0xd481('0x1e')](_0x3b720d['query']['offset']);}return _0x1617e3[_0xd481('0x4d')](_0x599160);}})[_0xd481('0x26')](function(_0x115a3c){if(_0x115a3c){return _0x115a3c?{'count':_0x51ce8e,'rows':_0x115a3c}:null;}})[_0xd481('0x26')](respondWithResult(_0x477985,null))[_0xd481('0x42')](handleError(_0x477985,null));};exports['getDescriptions']=function(_0x52ba07,_0x4db17d,_0xd1a787){var _0x1ea0de={};var _0x5cb117={};var _0x131025;var _0x56c35f;return db[_0xd481('0x2c')][_0xd481('0x4b')]({'where':{'id':_0x52ba07[_0xd481('0x48')]['id']}})[_0xd481('0x26')](handleEntityNotFound(_0x4db17d,null))[_0xd481('0x26')](function(_0x4ab49a){if(_0x4ab49a){_0x131025=_0x4ab49a;_0x5cb117[_0xd481('0x34')]=_[_0xd481('0x31')](db[_0xd481('0x4c')][_0xd481('0x2d')]);_0x5cb117['query']=_[_0xd481('0x31')](_0x52ba07[_0xd481('0x30')]);_0x5cb117[_0xd481('0x32')]=_[_0xd481('0x33')](_0x5cb117[_0xd481('0x34')],_0x5cb117[_0xd481('0x30')]);_0x1ea0de['attributes']=_[_0xd481('0x33')](_0x5cb117[_0xd481('0x34')],qs[_0xd481('0x43')](_0x52ba07[_0xd481('0x30')][_0xd481('0x43')]));_0x1ea0de[_0xd481('0x35')]=_0x1ea0de[_0xd481('0x35')][_0xd481('0x36')]?_0x1ea0de[_0xd481('0x35')]:_0x5cb117[_0xd481('0x34')];_0x1ea0de[_0xd481('0x38')]=qs[_0xd481('0x39')](_0x52ba07['query'][_0xd481('0x39')]);_0x1ea0de[_0xd481('0x3c')]=qs[_0xd481('0x32')](_[_0xd481('0x3a')](_0x52ba07[_0xd481('0x30')],_0x5cb117[_0xd481('0x32')]));if(_0x52ba07[_0xd481('0x30')]['filter']){_0x1ea0de[_0xd481('0x3c')]=_[_0xd481('0x3d')](_0x1ea0de['where'],{'$or':_['map'](_0x1ea0de[_0xd481('0x35')],function(_0x366afd){var _0x5c7242={};_0x5c7242[_0x366afd]={'$like':'%'+_0x52ba07[_0xd481('0x30')][_0xd481('0x3b')]+'%'};return _0x5c7242;})});}_0x1ea0de=_['merge']({},_0x1ea0de,_0x52ba07[_0xd481('0x44')]);return _0x131025[_0xd481('0x4f')](_0x1ea0de);}})['then'](function(_0x1115da){if(_0x1115da){_0x56c35f=_0x1115da[_0xd481('0x36')];if(!_0x52ba07[_0xd481('0x30')][_0xd481('0x4e')](_0xd481('0x37'))){_0x1ea0de[_0xd481('0x1f')]=qs[_0xd481('0x1f')](_0x52ba07[_0xd481('0x30')][_0xd481('0x1f')]);_0x1ea0de['offset']=qs[_0xd481('0x1e')](_0x52ba07[_0xd481('0x30')][_0xd481('0x1e')]);}return _0x131025['getDescriptions'](_0x1ea0de);}})[_0xd481('0x26')](function(_0x5f1ec2){if(_0x5f1ec2){return _0x5f1ec2?{'count':_0x56c35f,'rows':_0x5f1ec2}:null;}})[_0xd481('0x26')](respondWithResult(_0x4db17d,null))[_0xd481('0x42')](handleError(_0x4db17d,null));};exports['getTags']=function(_0x2216e4,_0x174112,_0x19634e){var _0x4f18eb={};var _0x1ea044={};var _0xd1f5d1;var _0x48c207;return db[_0xd481('0x2c')][_0xd481('0x4b')]({'where':{'id':_0x2216e4[_0xd481('0x48')]['id']}})[_0xd481('0x26')](handleEntityNotFound(_0x174112,null))[_0xd481('0x26')](function(_0x1e9ee3){if(_0x1e9ee3){_0xd1f5d1=_0x1e9ee3;_0x1ea044[_0xd481('0x34')]=_[_0xd481('0x31')](db[_0xd481('0x50')][_0xd481('0x2d')]);_0x1ea044[_0xd481('0x30')]=_[_0xd481('0x31')](_0x2216e4[_0xd481('0x30')]);_0x1ea044[_0xd481('0x32')]=_[_0xd481('0x33')](_0x1ea044[_0xd481('0x34')],_0x1ea044['query']);_0x4f18eb[_0xd481('0x35')]=_['intersection'](_0x1ea044[_0xd481('0x34')],qs['fields'](_0x2216e4[_0xd481('0x30')]['fields']));_0x4f18eb[_0xd481('0x35')]=_0x4f18eb['attributes'][_0xd481('0x36')]?_0x4f18eb['attributes']:_0x1ea044[_0xd481('0x34')];_0x4f18eb[_0xd481('0x38')]=qs[_0xd481('0x39')](_0x2216e4[_0xd481('0x30')]['sort']);_0x4f18eb[_0xd481('0x3c')]=qs[_0xd481('0x32')](_[_0xd481('0x3a')](_0x2216e4[_0xd481('0x30')],_0x1ea044[_0xd481('0x32')]));if(_0x2216e4[_0xd481('0x30')][_0xd481('0x3b')]){_0x4f18eb[_0xd481('0x3c')]=_['merge'](_0x4f18eb[_0xd481('0x3c')],{'$or':_[_0xd481('0x2b')](_0x4f18eb[_0xd481('0x35')],function(_0x43a3da){var _0x26f658={};_0x26f658[_0x43a3da]={'$like':'%'+_0x2216e4[_0xd481('0x30')][_0xd481('0x3b')]+'%'};return _0x26f658;})});}_0x4f18eb=_[_0xd481('0x3d')]({},_0x4f18eb,_0x2216e4[_0xd481('0x44')]);return _0xd1f5d1[_0xd481('0x51')](_0x4f18eb);}})[_0xd481('0x26')](function(_0x363d45){if(_0x363d45){_0x48c207=_0x363d45[_0xd481('0x36')];if(!_0x2216e4[_0xd481('0x30')]['hasOwnProperty'](_0xd481('0x37'))){_0x4f18eb[_0xd481('0x1f')]=qs[_0xd481('0x1f')](_0x2216e4[_0xd481('0x30')][_0xd481('0x1f')]);_0x4f18eb['offset']=qs[_0xd481('0x1e')](_0x2216e4[_0xd481('0x30')]['offset']);}return _0xd1f5d1['getTags'](_0x4f18eb);}})[_0xd481('0x26')](function(_0x5438a7){if(_0x5438a7){return _0x5438a7?{'count':_0x48c207,'rows':_0x5438a7}:null;}})['then'](respondWithResult(_0x174112,null))['catch'](handleError(_0x174112,null));};exports[_0xd481('0x52')]=function(_0x338a3e,_0x5895e6,_0x4a6ad4){if(_0x338a3e[_0xd481('0x47')]['id']){delete _0x338a3e[_0xd481('0x47')]['id'];}return db[_0xd481('0x2c')][_0xd481('0x4b')]({'where':{'id':_0x338a3e[_0xd481('0x48')]['id']}})[_0xd481('0x26')](handleEntityNotFound(_0x5895e6,null))[_0xd481('0x26')](function(_0x369a8b){if(_0x369a8b){return _0x369a8b[_0xd481('0x52')](_0x338a3e[_0xd481('0x47')]['ids']||[]);}return null;})['then'](respondWithResult(_0x5895e6,null))['catch'](handleError(_0x5895e6,null));};
\ No newline at end of file
index ce73760..624376d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37e9=['bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x37e9,0x1f4));var _0x937e=function(_0x54862a,_0x1fe1dc){_0x54862a=_0x54862a-0x0;var _0xa35917=_0x37e9[_0x54862a];return _0xa35917;};'use strict';var _=require('lodash');var util=require(_0x937e('0x0'));var logger=require(_0x937e('0x1'))(_0x937e('0x2'));var moment=require(_0x937e('0x3'));var BPromise=require(_0x937e('0x4'));var rp=require(_0x937e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x937e('0x6'));var config=require(_0x937e('0x7'));var attributes=require(_0x937e('0x8'));module[_0x937e('0x9')]=function(_0x3830a6,_0x24c1c7){return _0x3830a6['define'](_0x937e('0xa'),attributes,{'tableName':_0x937e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ffa=['exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x48571c,_0x1cf377){var _0x5025a9=function(_0xc1688c){while(--_0xc1688c){_0x48571c['push'](_0x48571c['shift']());}};_0x5025a9(++_0x1cf377);}(_0x5ffa,0x118));var _0xa5ff=function(_0x279eac,_0x5a6b55){_0x279eac=_0x279eac-0x0;var _0x392f94=_0x5ffa[_0x279eac];return _0x392f94;};'use strict';var _=require('lodash');var util=require(_0xa5ff('0x0'));var logger=require(_0xa5ff('0x1'))(_0xa5ff('0x2'));var moment=require(_0xa5ff('0x3'));var BPromise=require(_0xa5ff('0x4'));var rp=require(_0xa5ff('0x5'));var fs=require('fs');var path=require(_0xa5ff('0x6'));var rimraf=require('rimraf');var config=require(_0xa5ff('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xa5ff('0x8')]=function(_0x16dad2,_0x3fa31d){return _0x16dad2[_0xa5ff('0x9')](_0xa5ff('0xa'),attributes,{'tableName':_0xa5ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 62c99af..630fd6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0936=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x893906,_0x57f59f){var _0x2205f8=function(_0x1575fa){while(--_0x1575fa){_0x893906['push'](_0x893906['shift']());}};_0x2205f8(++_0x57f59f);}(_0x0936,0xde));var _0x6093=function(_0x1acc4a,_0x31db27){_0x1acc4a=_0x1acc4a-0x0;var _0x50eda2=_0x0936[_0x1acc4a];return _0x50eda2;};'use strict';var _=require(_0x6093('0x0'));var util=require(_0x6093('0x1'));var moment=require(_0x6093('0x2'));var BPromise=require(_0x6093('0x3'));var rs=require(_0x6093('0x4'));var fs=require('fs');var Redis=require(_0x6093('0x5'));var db=require(_0x6093('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6093('0x7'));var config=require(_0x6093('0x8'));var jayson=require(_0x6093('0x9'));var client=jayson[_0x6093('0xa')][_0x6093('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7d812e,_0x478323,_0x54df66){return new BPromise(function(_0x5280b8,_0x219592){return client[_0x6093('0xc')](_0x7d812e,_0x54df66)[_0x6093('0xd')](function(_0x178aba){logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));logger[_0x6093('0x11')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x478323,'request\x20sent',JSON[_0x6093('0x12')](_0x178aba));if(_0x178aba[_0x6093('0x13')]){if(_0x178aba[_0x6093('0x13')][_0x6093('0x14')]===0x1f4){logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x219592(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x5280b8(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}else{logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));_0x5280b8(_0x178aba[_0x6093('0x16')][_0x6093('0x15')]);}})[_0x6093('0x17')](function(_0x5c8f2a){logger['error'](_0x6093('0xf'),_0x478323,_0x5c8f2a);_0x219592(_0x5c8f2a);});});}
\ No newline at end of file
+var _0xaadd=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0xaadd,0x19b));var _0xdaad=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0xaadd[_0x4f11cb];return _0x491488;};'use strict';var _=require(_0xdaad('0x0'));var util=require(_0xdaad('0x1'));var moment=require(_0xdaad('0x2'));var BPromise=require(_0xdaad('0x3'));var rs=require(_0xdaad('0x4'));var fs=require('fs');var Redis=require(_0xdaad('0x5'));var db=require(_0xdaad('0x6'))['db'];var utils=require(_0xdaad('0x7'));var logger=require('../../config/logger')(_0xdaad('0x8'));var config=require(_0xdaad('0x9'));var jayson=require(_0xdaad('0xa'));var client=jayson[_0xdaad('0xb')][_0xdaad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57d15f,_0x4046a9,_0x1d299f){return new BPromise(function(_0x464bc1,_0x3fbb1a){return client[_0xdaad('0xd')](_0x57d15f,_0x1d299f)[_0xdaad('0xe')](function(_0x33ae2b){logger[_0xdaad('0xf')](_0xdaad('0x10'),_0x4046a9,_0xdaad('0x11'));logger[_0xdaad('0x12')](_0xdaad('0x13'),_0x4046a9,'request\x20sent',JSON[_0xdaad('0x14')](_0x33ae2b));if(_0x33ae2b['error']){if(_0x33ae2b[_0xdaad('0x15')]['code']===0x1f4){logger[_0xdaad('0x15')](_0xdaad('0x10'),_0x4046a9,_0x33ae2b[_0xdaad('0x15')]['message']);return _0x3fbb1a(_0x33ae2b[_0xdaad('0x15')][_0xdaad('0x16')]);}logger[_0xdaad('0x15')](_0xdaad('0x10'),_0x4046a9,_0x33ae2b[_0xdaad('0x15')][_0xdaad('0x16')]);return _0x464bc1(_0x33ae2b[_0xdaad('0x15')][_0xdaad('0x16')]);}else{logger[_0xdaad('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x4046a9,'request\x20sent');_0x464bc1(_0x33ae2b[_0xdaad('0x17')][_0xdaad('0x16')]);}})[_0xdaad('0x18')](function(_0x3a4ce9){logger[_0xdaad('0x15')](_0xdaad('0x10'),_0x4046a9,_0x3a4ce9);_0x3fbb1a(_0x3a4ce9);});});}
\ No newline at end of file
index 59c5b2e..2452aa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0294=['util','path','express','Router','fs-extra','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','multer'];(function(_0x185a70,_0x460fa6){var _0x50f429=function(_0x2cb1b9){while(--_0x2cb1b9){_0x185a70['push'](_0x185a70['shift']());}};_0x50f429(++_0x460fa6);}(_0x0294,0xb3));var _0x4029=function(_0x134b6e,_0x21b5ca){_0x134b6e=_0x134b6e-0x0;var _0x2229a9=_0x0294[_0x134b6e];return _0x2229a9;};'use strict';var multer=require(_0x4029('0x0'));var util=require(_0x4029('0x1'));var path=require(_0x4029('0x2'));var timeout=require('connect-timeout');var express=require(_0x4029('0x3'));var router=express[_0x4029('0x4')]();var fs_extra=require(_0x4029('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4029('0x6'));var controller=require(_0x4029('0x7'));router[_0x4029('0x8')]('/',auth['isAuthenticated'](),controller[_0x4029('0x9')]);router[_0x4029('0x8')](_0x4029('0xa'),auth[_0x4029('0xb')](),controller[_0x4029('0xc')]);router[_0x4029('0xd')]('/',auth[_0x4029('0xb')](),controller[_0x4029('0xe')]);router[_0x4029('0xf')](_0x4029('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4029('0x10')](_0x4029('0xa'),auth[_0x4029('0xb')](),controller['destroy']);module[_0x4029('0x11')]=router;
\ No newline at end of file
+var _0x05ed=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','post','isAuthenticated','create','delete'];(function(_0x2ca079,_0x2ae5e6){var _0x4069cc=function(_0xb730f9){while(--_0xb730f9){_0x2ca079['push'](_0x2ca079['shift']());}};_0x4069cc(++_0x2ae5e6);}(_0x05ed,0x14b));var _0xd05e=function(_0x2b012b,_0x463e28){_0x2b012b=_0x2b012b-0x0;var _0x32c4cf=_0x05ed[_0x2b012b];return _0x32c4cf;};'use strict';var multer=require(_0xd05e('0x0'));var util=require('util');var path=require(_0xd05e('0x1'));var timeout=require(_0xd05e('0x2'));var express=require('express');var router=express[_0xd05e('0x3')]();var fs_extra=require(_0xd05e('0x4'));var auth=require(_0xd05e('0x5'));var interaction=require(_0xd05e('0x6'));var config=require(_0xd05e('0x7'));var controller=require('./intDeskField.controller');router[_0xd05e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd05e('0x8')](_0xd05e('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xd05e('0xa')]('/',auth[_0xd05e('0xb')](),controller[_0xd05e('0xc')]);router['put'](_0xd05e('0x9'),auth[_0xd05e('0xb')](),controller['update']);router[_0xd05e('0xd')](_0xd05e('0x9'),auth[_0xd05e('0xb')](),controller['destroy']);module[_0xd05e('0xe')]=router;
\ No newline at end of file
index 781faa2..a5cd0be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x959b=['variable','BOOLEAN','sequelize','exports','string','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x15f7ee,_0x5dd20f){var _0x4941af=function(_0x219727){while(--_0x219727){_0x15f7ee['push'](_0x15f7ee['shift']());}};_0x4941af(++_0x5dd20f);}(_0x959b,0x160));var _0xb959=function(_0x9485bc,_0x16d345){_0x9485bc=_0x9485bc-0x0;var _0x26c20b=_0x959b[_0x9485bc];return _0x26c20b;};'use strict';var Sequelize=require(_0xb959('0x0'));module[_0xb959('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb959('0x2'),'variable',_0xb959('0x3'),_0xb959('0x4'),_0xb959('0x5')),'defaultValue':_0xb959('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb959('0x6')]},'keyType':{'type':Sequelize[_0xb959('0x7')]('string',_0xb959('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xb959('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb959('0x6')]},'customField':{'type':Sequelize[_0xb959('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb959('0x6')]}};
\ No newline at end of file
+var _0xd053=['exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x321274,_0x18db05){var _0x331d13=function(_0xeed79d){while(--_0xeed79d){_0x321274['push'](_0x321274['shift']());}};_0x331d13(++_0x18db05);}(_0xd053,0x116));var _0x3d05=function(_0x2a8cb7,_0x314d29){_0x2a8cb7=_0x2a8cb7-0x0;var _0x183a1f=_0xd053[_0x2a8cb7];return _0x183a1f;};'use strict';var Sequelize=require(_0x3d05('0x0'));module[_0x3d05('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3d05('0x2'),_0x3d05('0x3'),_0x3d05('0x4'),_0x3d05('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3d05('0x6')]},'key':{'type':Sequelize[_0x3d05('0x6')]},'keyType':{'type':Sequelize[_0x3d05('0x7')](_0x3d05('0x2'),'variable',_0x3d05('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3d05('0x6')]},'nameField':{'type':Sequelize[_0x3d05('0x6')]},'customField':{'type':Sequelize[_0x3d05('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3d05('0x6')]}};
\ No newline at end of file
index d360681..969249c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eca=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','DeskField','includeAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x5eca,0x10e));var _0xa5ec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5eca[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xa5ec('0x0'));var rimraf=require(_0xa5ec('0x1'));var zipdir=require(_0xa5ec('0x2'));var jsonpatch=require(_0xa5ec('0x3'));var rp=require(_0xa5ec('0x4'));var moment=require('moment');var BPromise=require(_0xa5ec('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa5ec('0x6'));var sox=require(_0xa5ec('0x7'));var csv=require(_0xa5ec('0x8'));var ejs=require(_0xa5ec('0x9'));var fs=require('fs');var fs_extra=require(_0xa5ec('0xa'));var _=require(_0xa5ec('0xb'));var squel=require(_0xa5ec('0xc'));var crypto=require('crypto');var jsforce=require(_0xa5ec('0xd'));var deskjs=require(_0xa5ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa5ec('0xf'));var Papa=require('papaparse');var Redis=require(_0xa5ec('0x10'));var authService=require(_0xa5ec('0x11'));var qs=require(_0xa5ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5ec('0x13'));var logger=require(_0xa5ec('0x14'))(_0xa5ec('0x15'));var utils=require(_0xa5ec('0x16'));var config=require(_0xa5ec('0x17'));var licenseUtil=require(_0xa5ec('0x18'));var db=require(_0xa5ec('0x19'))['db'];function respondWithStatusCode(_0x703db5,_0x3e5ce7){_0x3e5ce7=_0x3e5ce7||0xcc;return function(_0x69bcea){if(_0x69bcea){return _0x703db5[_0xa5ec('0x1a')](_0x3e5ce7);}return _0x703db5[_0xa5ec('0x1b')](_0x3e5ce7)[_0xa5ec('0x1c')]();};}function respondWithResult(_0x58c1d7,_0x21c65a){_0x21c65a=_0x21c65a||0xc8;return function(_0x241d2b){if(_0x241d2b){return _0x58c1d7[_0xa5ec('0x1b')](_0x21c65a)[_0xa5ec('0x1d')](_0x241d2b);}};}function respondWithFilteredResult(_0x142305,_0x2fe110){return function(_0x54288a){if(_0x54288a){var _0x471de4=typeof _0x2fe110['offset']===_0xa5ec('0x1e')&&typeof _0x2fe110[_0xa5ec('0x1f')]===_0xa5ec('0x1e');var _0x32281e=_0x54288a[_0xa5ec('0x20')];var _0x372767=_0x471de4?0x0:_0x2fe110[_0xa5ec('0x21')];var _0x29fbb4=_0x471de4?_0x54288a[_0xa5ec('0x20')]:_0x2fe110[_0xa5ec('0x21')]+_0x2fe110['limit'];var _0x7613;if(_0x29fbb4>=_0x32281e){_0x29fbb4=_0x32281e;_0x7613=0xc8;}else{_0x7613=0xce;}_0x142305[_0xa5ec('0x1b')](_0x7613);return _0x142305[_0xa5ec('0x22')](_0xa5ec('0x23'),_0x372767+'-'+_0x29fbb4+'/'+_0x32281e)[_0xa5ec('0x1d')](_0x54288a);}return null;};}function patchUpdates(_0x3560d7){return function(_0x1255bc){try{jsonpatch[_0xa5ec('0x24')](_0x1255bc,_0x3560d7,!![]);}catch(_0x2a0602){return BPromise['reject'](_0x2a0602);}return _0x1255bc[_0xa5ec('0x25')]();};}function saveUpdates(_0x3581b7,_0x3c957){return function(_0xa2daff){if(_0xa2daff){return _0xa2daff[_0xa5ec('0x26')](_0x3581b7)[_0xa5ec('0x27')](function(_0x1995f4){return _0x1995f4;});}return null;};}function removeEntity(_0x364770,_0x5eef95){return function(_0x584d82){if(_0x584d82){return _0x584d82['destroy']()[_0xa5ec('0x27')](function(){_0x364770['status'](0xcc)[_0xa5ec('0x1c')]();});}};}function handleEntityNotFound(_0x38be6b,_0x57ef19){return function(_0x20612a){if(!_0x20612a){_0x38be6b[_0xa5ec('0x1a')](0x194);}return _0x20612a;};}function handleError(_0x4ff18c,_0x4643aa){_0x4643aa=_0x4643aa||0x1f4;return function(_0x12bfbb){logger['error'](_0x12bfbb[_0xa5ec('0x28')]);if(_0x12bfbb['name']){delete _0x12bfbb[_0xa5ec('0x29')];}_0x4ff18c[_0xa5ec('0x1b')](_0x4643aa)[_0xa5ec('0x2a')](_0x12bfbb);};}exports[_0xa5ec('0x2b')]=function(_0x39907f,_0x40a05a){var _0x45e32c={},_0x2cda8c={},_0x25ef57={'count':0x0,'rows':[]};var _0x4c1871=_[_0xa5ec('0x2c')](db['DeskField']['rawAttributes'],function(_0xa8caab){return{'name':_0xa8caab[_0xa5ec('0x2d')],'type':_0xa8caab[_0xa5ec('0x2e')][_0xa5ec('0x2f')]};});_0x2cda8c[_0xa5ec('0x30')]=_[_0xa5ec('0x2c')](_0x4c1871,'name');_0x2cda8c[_0xa5ec('0x31')]=_[_0xa5ec('0x32')](_0x39907f['query']);_0x2cda8c[_0xa5ec('0x33')]=_[_0xa5ec('0x34')](_0x2cda8c[_0xa5ec('0x30')],_0x2cda8c[_0xa5ec('0x31')]);_0x45e32c['attributes']=_[_0xa5ec('0x34')](_0x2cda8c[_0xa5ec('0x30')],qs[_0xa5ec('0x35')](_0x39907f[_0xa5ec('0x31')]['fields']));_0x45e32c[_0xa5ec('0x36')]=_0x45e32c['attributes'][_0xa5ec('0x37')]?_0x45e32c[_0xa5ec('0x36')]:_0x2cda8c['model'];if(!_0x39907f['query'][_0xa5ec('0x38')](_0xa5ec('0x39'))){_0x45e32c[_0xa5ec('0x1f')]=qs[_0xa5ec('0x1f')](_0x39907f[_0xa5ec('0x31')]['limit']);_0x45e32c[_0xa5ec('0x21')]=qs[_0xa5ec('0x21')](_0x39907f[_0xa5ec('0x31')][_0xa5ec('0x21')]);}_0x45e32c[_0xa5ec('0x3a')]=qs[_0xa5ec('0x3b')](_0x39907f['query'][_0xa5ec('0x3b')]);_0x45e32c['where']=qs[_0xa5ec('0x33')](_[_0xa5ec('0x3c')](_0x39907f[_0xa5ec('0x31')],_0x2cda8c[_0xa5ec('0x33')]),_0x4c1871);if(_0x39907f[_0xa5ec('0x31')]['filter']){_0x45e32c[_0xa5ec('0x3d')]=_[_0xa5ec('0x3e')](_0x45e32c[_0xa5ec('0x3d')],{'$or':_[_0xa5ec('0x2c')](_0x4c1871,function(_0x12feed){if(_0x12feed[_0xa5ec('0x2e')]!==_0xa5ec('0x3f')){var _0x5dda81={};_0x5dda81[_0x12feed[_0xa5ec('0x29')]]={'$like':'%'+_0x39907f[_0xa5ec('0x31')]['filter']+'%'};return _0x5dda81;}})});}_0x45e32c=_[_0xa5ec('0x3e')]({},_0x45e32c,_0x39907f[_0xa5ec('0x40')]);var _0x3c4f1c={'where':_0x45e32c[_0xa5ec('0x3d')]};return db[_0xa5ec('0x41')][_0xa5ec('0x20')](_0x3c4f1c)[_0xa5ec('0x27')](function(_0x1c13b2){_0x25ef57[_0xa5ec('0x20')]=_0x1c13b2;if(_0x39907f[_0xa5ec('0x31')][_0xa5ec('0x42')]){_0x45e32c['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x45e32c);})['then'](function(_0x1744be){_0x25ef57[_0xa5ec('0x43')]=_0x1744be;return _0x25ef57;})[_0xa5ec('0x27')](respondWithFilteredResult(_0x40a05a,_0x45e32c))[_0xa5ec('0x44')](handleError(_0x40a05a,null));};exports[_0xa5ec('0x45')]=function(_0x1ae6e4,_0xa6369a){var _0x46d042={'raw':!![],'where':{'id':_0x1ae6e4[_0xa5ec('0x46')]['id']}},_0x56dfa4={};_0x56dfa4['model']=_[_0xa5ec('0x32')](db[_0xa5ec('0x41')]['rawAttributes']);_0x56dfa4['query']=_[_0xa5ec('0x32')](_0x1ae6e4[_0xa5ec('0x31')]);_0x56dfa4[_0xa5ec('0x33')]=_[_0xa5ec('0x34')](_0x56dfa4[_0xa5ec('0x30')],_0x56dfa4[_0xa5ec('0x31')]);_0x46d042[_0xa5ec('0x36')]=_[_0xa5ec('0x34')](_0x56dfa4[_0xa5ec('0x30')],qs[_0xa5ec('0x35')](_0x1ae6e4['query']['fields']));_0x46d042[_0xa5ec('0x36')]=_0x46d042[_0xa5ec('0x36')][_0xa5ec('0x37')]?_0x46d042[_0xa5ec('0x36')]:_0x56dfa4[_0xa5ec('0x30')];if(_0x1ae6e4[_0xa5ec('0x31')][_0xa5ec('0x42')]){_0x46d042['include']=[{'all':!![]}];}_0x46d042=_[_0xa5ec('0x3e')]({},_0x46d042,_0x1ae6e4['options']);return db['DeskField'][_0xa5ec('0x47')](_0x46d042)[_0xa5ec('0x27')](handleEntityNotFound(_0xa6369a,null))[_0xa5ec('0x27')](respondWithResult(_0xa6369a,null))['catch'](handleError(_0xa6369a,null));};exports[_0xa5ec('0x48')]=function(_0x55c3c7,_0xfcc42b){return db[_0xa5ec('0x41')][_0xa5ec('0x48')](_0x55c3c7[_0xa5ec('0x49')],{})[_0xa5ec('0x27')](respondWithResult(_0xfcc42b,0xc9))[_0xa5ec('0x44')](handleError(_0xfcc42b,null));};exports['update']=function(_0x485f07,_0xc74073){if(_0x485f07['body']['id']){delete _0x485f07[_0xa5ec('0x49')]['id'];}return db[_0xa5ec('0x41')]['find']({'where':{'id':_0x485f07['params']['id']}})[_0xa5ec('0x27')](handleEntityNotFound(_0xc74073,null))[_0xa5ec('0x27')](saveUpdates(_0x485f07[_0xa5ec('0x49')],null))[_0xa5ec('0x27')](respondWithResult(_0xc74073,null))['catch'](handleError(_0xc74073,null));};exports['destroy']=function(_0x388f20,_0x17b719){return db[_0xa5ec('0x41')][_0xa5ec('0x47')]({'where':{'id':_0x388f20[_0xa5ec('0x46')]['id']}})[_0xa5ec('0x27')](handleEntityNotFound(_0x17b719,null))[_0xa5ec('0x27')](removeEntity(_0x17b719,null))[_0xa5ec('0x44')](handleError(_0x17b719,null));};
\ No newline at end of file
+var _0xa9f3=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','filter','then','includeAll','include','DeskField','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0xa9f3,0x1de));var _0x3a9f=function(_0x422951,_0x3ab626){_0x422951=_0x422951-0x0;var _0x21c25d=_0xa9f3[_0x422951];return _0x21c25d;};'use strict';var emlformat=require(_0x3a9f('0x0'));var rimraf=require(_0x3a9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a9f('0x2'));var rp=require(_0x3a9f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3a9f('0x4'));var util=require(_0x3a9f('0x5'));var path=require('path');var sox=require(_0x3a9f('0x6'));var csv=require(_0x3a9f('0x7'));var ejs=require(_0x3a9f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3a9f('0x9'));var jsforce=require(_0x3a9f('0xa'));var deskjs=require(_0x3a9f('0xb'));var toCsv=require(_0x3a9f('0x7'));var querystring=require('querystring');var Papa=require(_0x3a9f('0xc'));var Redis=require(_0x3a9f('0xd'));var authService=require(_0x3a9f('0xe'));var qs=require(_0x3a9f('0xf'));var as=require(_0x3a9f('0x10'));var hardwareService=require(_0x3a9f('0x11'));var logger=require(_0x3a9f('0x12'))('api');var utils=require(_0x3a9f('0x13'));var config=require(_0x3a9f('0x14'));var licenseUtil=require(_0x3a9f('0x15'));var db=require(_0x3a9f('0x16'))['db'];function respondWithStatusCode(_0x103ed8,_0x34139d){_0x34139d=_0x34139d||0xcc;return function(_0x233599){if(_0x233599){return _0x103ed8['sendStatus'](_0x34139d);}return _0x103ed8[_0x3a9f('0x17')](_0x34139d)[_0x3a9f('0x18')]();};}function respondWithResult(_0x3fd8d0,_0x47112b){_0x47112b=_0x47112b||0xc8;return function(_0x130333){if(_0x130333){return _0x3fd8d0[_0x3a9f('0x17')](_0x47112b)[_0x3a9f('0x19')](_0x130333);}};}function respondWithFilteredResult(_0xd47bc2,_0x48b997){return function(_0x18a554){if(_0x18a554){var _0x10a665=typeof _0x48b997[_0x3a9f('0x1a')]==='undefined'&&typeof _0x48b997[_0x3a9f('0x1b')]===_0x3a9f('0x1c');var _0x2cfc8a=_0x18a554[_0x3a9f('0x1d')];var _0x1e2565=_0x10a665?0x0:_0x48b997[_0x3a9f('0x1a')];var _0x6c202c=_0x10a665?_0x18a554['count']:_0x48b997[_0x3a9f('0x1a')]+_0x48b997[_0x3a9f('0x1b')];var _0x41d9b2;if(_0x6c202c>=_0x2cfc8a){_0x6c202c=_0x2cfc8a;_0x41d9b2=0xc8;}else{_0x41d9b2=0xce;}_0xd47bc2[_0x3a9f('0x17')](_0x41d9b2);return _0xd47bc2[_0x3a9f('0x1e')](_0x3a9f('0x1f'),_0x1e2565+'-'+_0x6c202c+'/'+_0x2cfc8a)[_0x3a9f('0x19')](_0x18a554);}return null;};}function patchUpdates(_0x56fc71){return function(_0xf17f4){try{jsonpatch['apply'](_0xf17f4,_0x56fc71,!![]);}catch(_0x104ab2){return BPromise[_0x3a9f('0x20')](_0x104ab2);}return _0xf17f4[_0x3a9f('0x21')]();};}function saveUpdates(_0x576951,_0x515fc3){return function(_0x3d4e26){if(_0x3d4e26){return _0x3d4e26[_0x3a9f('0x22')](_0x576951)['then'](function(_0xbb6ab4){return _0xbb6ab4;});}return null;};}function removeEntity(_0x583a63,_0x3bbf81){return function(_0x483175){if(_0x483175){return _0x483175['destroy']()['then'](function(){_0x583a63['status'](0xcc)[_0x3a9f('0x18')]();});}};}function handleEntityNotFound(_0x37e641,_0x2b5bd1){return function(_0x22366a){if(!_0x22366a){_0x37e641['sendStatus'](0x194);}return _0x22366a;};}function handleError(_0x2df982,_0x2bf7c2){_0x2bf7c2=_0x2bf7c2||0x1f4;return function(_0x5c641c){logger['error'](_0x5c641c[_0x3a9f('0x23')]);if(_0x5c641c[_0x3a9f('0x24')]){delete _0x5c641c['name'];}_0x2df982[_0x3a9f('0x17')](_0x2bf7c2)[_0x3a9f('0x25')](_0x5c641c);};}exports[_0x3a9f('0x26')]=function(_0x313e80,_0x3aa580){var _0x493315={},_0x2a529e={},_0x1c1c18={'count':0x0,'rows':[]};var _0x310bb4=_[_0x3a9f('0x27')](db['DeskField'][_0x3a9f('0x28')],function(_0x37298d){return{'name':_0x37298d[_0x3a9f('0x29')],'type':_0x37298d[_0x3a9f('0x2a')][_0x3a9f('0x2b')]};});_0x2a529e[_0x3a9f('0x2c')]=_[_0x3a9f('0x27')](_0x310bb4,'name');_0x2a529e[_0x3a9f('0x2d')]=_['keys'](_0x313e80[_0x3a9f('0x2d')]);_0x2a529e['filters']=_['intersection'](_0x2a529e['model'],_0x2a529e[_0x3a9f('0x2d')]);_0x493315[_0x3a9f('0x2e')]=_[_0x3a9f('0x2f')](_0x2a529e[_0x3a9f('0x2c')],qs['fields'](_0x313e80[_0x3a9f('0x2d')][_0x3a9f('0x30')]));_0x493315[_0x3a9f('0x2e')]=_0x493315[_0x3a9f('0x2e')]['length']?_0x493315[_0x3a9f('0x2e')]:_0x2a529e[_0x3a9f('0x2c')];if(!_0x313e80[_0x3a9f('0x2d')][_0x3a9f('0x31')](_0x3a9f('0x32'))){_0x493315[_0x3a9f('0x1b')]=qs[_0x3a9f('0x1b')](_0x313e80[_0x3a9f('0x2d')][_0x3a9f('0x1b')]);_0x493315[_0x3a9f('0x1a')]=qs[_0x3a9f('0x1a')](_0x313e80[_0x3a9f('0x2d')][_0x3a9f('0x1a')]);}_0x493315[_0x3a9f('0x33')]=qs['sort'](_0x313e80['query']['sort']);_0x493315[_0x3a9f('0x34')]=qs[_0x3a9f('0x35')](_['pick'](_0x313e80['query'],_0x2a529e[_0x3a9f('0x35')]),_0x310bb4);if(_0x313e80[_0x3a9f('0x2d')]['filter']){_0x493315[_0x3a9f('0x34')]=_[_0x3a9f('0x36')](_0x493315[_0x3a9f('0x34')],{'$or':_[_0x3a9f('0x27')](_0x310bb4,function(_0x17a41b){if(_0x17a41b[_0x3a9f('0x2a')]!==_0x3a9f('0x37')){var _0x52d044={};_0x52d044[_0x17a41b[_0x3a9f('0x24')]]={'$like':'%'+_0x313e80[_0x3a9f('0x2d')][_0x3a9f('0x38')]+'%'};return _0x52d044;}})});}_0x493315=_[_0x3a9f('0x36')]({},_0x493315,_0x313e80['options']);var _0x4eb7a0={'where':_0x493315[_0x3a9f('0x34')]};return db['DeskField'][_0x3a9f('0x1d')](_0x4eb7a0)[_0x3a9f('0x39')](function(_0x44bc61){_0x1c1c18[_0x3a9f('0x1d')]=_0x44bc61;if(_0x313e80['query'][_0x3a9f('0x3a')]){_0x493315[_0x3a9f('0x3b')]=[{'all':!![]}];}return db[_0x3a9f('0x3c')][_0x3a9f('0x3d')](_0x493315);})[_0x3a9f('0x39')](function(_0x4d4d16){_0x1c1c18[_0x3a9f('0x3e')]=_0x4d4d16;return _0x1c1c18;})['then'](respondWithFilteredResult(_0x3aa580,_0x493315))[_0x3a9f('0x3f')](handleError(_0x3aa580,null));};exports[_0x3a9f('0x40')]=function(_0x55fc13,_0x851f1b){var _0x49c279={'raw':!![],'where':{'id':_0x55fc13[_0x3a9f('0x41')]['id']}},_0x1464d2={};_0x1464d2[_0x3a9f('0x2c')]=_[_0x3a9f('0x42')](db['DeskField'][_0x3a9f('0x28')]);_0x1464d2[_0x3a9f('0x2d')]=_['keys'](_0x55fc13[_0x3a9f('0x2d')]);_0x1464d2[_0x3a9f('0x35')]=_['intersection'](_0x1464d2[_0x3a9f('0x2c')],_0x1464d2[_0x3a9f('0x2d')]);_0x49c279[_0x3a9f('0x2e')]=_[_0x3a9f('0x2f')](_0x1464d2['model'],qs['fields'](_0x55fc13[_0x3a9f('0x2d')][_0x3a9f('0x30')]));_0x49c279[_0x3a9f('0x2e')]=_0x49c279['attributes'][_0x3a9f('0x43')]?_0x49c279[_0x3a9f('0x2e')]:_0x1464d2['model'];if(_0x55fc13['query'][_0x3a9f('0x3a')]){_0x49c279[_0x3a9f('0x3b')]=[{'all':!![]}];}_0x49c279=_[_0x3a9f('0x36')]({},_0x49c279,_0x55fc13['options']);return db[_0x3a9f('0x3c')][_0x3a9f('0x44')](_0x49c279)['then'](handleEntityNotFound(_0x851f1b,null))[_0x3a9f('0x39')](respondWithResult(_0x851f1b,null))['catch'](handleError(_0x851f1b,null));};exports[_0x3a9f('0x45')]=function(_0x12c00f,_0x4ab900){return db[_0x3a9f('0x3c')][_0x3a9f('0x45')](_0x12c00f[_0x3a9f('0x46')],{})['then'](respondWithResult(_0x4ab900,0xc9))[_0x3a9f('0x3f')](handleError(_0x4ab900,null));};exports['update']=function(_0x1d39bd,_0x1b2c23){if(_0x1d39bd[_0x3a9f('0x46')]['id']){delete _0x1d39bd[_0x3a9f('0x46')]['id'];}return db[_0x3a9f('0x3c')][_0x3a9f('0x44')]({'where':{'id':_0x1d39bd['params']['id']}})['then'](handleEntityNotFound(_0x1b2c23,null))[_0x3a9f('0x39')](saveUpdates(_0x1d39bd[_0x3a9f('0x46')],null))[_0x3a9f('0x39')](respondWithResult(_0x1b2c23,null))['catch'](handleError(_0x1b2c23,null));};exports['destroy']=function(_0x32596b,_0x3dd4a7){return db[_0x3a9f('0x3c')][_0x3a9f('0x44')]({'where':{'id':_0x32596b['params']['id']}})[_0x3a9f('0x39')](handleEntityNotFound(_0x3dd4a7,null))[_0x3a9f('0x39')](removeEntity(_0x3dd4a7,null))[_0x3a9f('0x3f')](handleError(_0x3dd4a7,null));};
\ No newline at end of file
index f0ecfba..ed8c14d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c86=['DeskField','idField','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x74700b,_0x14fb10){var _0x59db75=function(_0x4eded3){while(--_0x4eded3){_0x74700b['push'](_0x74700b['shift']());}};_0x59db75(++_0x14fb10);}(_0x4c86,0xb6));var _0x64c8=function(_0x3fa366,_0x13499d){_0x3fa366=_0x3fa366-0x0;var _0x46991c=_0x4c86[_0x3fa366];return _0x46991c;};'use strict';var _=require('lodash');var util=require(_0x64c8('0x0'));var logger=require(_0x64c8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x64c8('0x2'));var rp=require(_0x64c8('0x3'));var fs=require('fs');var path=require(_0x64c8('0x4'));var rimraf=require(_0x64c8('0x5'));var config=require(_0x64c8('0x6'));var attributes=require(_0x64c8('0x7'));module[_0x64c8('0x8')]=function(_0x3c8877,_0x7daf2e){return _0x3c8877[_0x64c8('0x9')](_0x64c8('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x64c8('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc0f=['bluebird','request-promise','path','rimraf','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','util','../../config/logger','api','moment'];(function(_0x5b2eaa,_0x194a55){var _0x58966c=function(_0x1f9be9){while(--_0x1f9be9){_0x5b2eaa['push'](_0x5b2eaa['shift']());}};_0x58966c(++_0x194a55);}(_0xcc0f,0x122));var _0xfcc0=function(_0x430d00,_0x46485c){_0x430d00=_0x430d00-0x0;var _0x37774b=_0xcc0f[_0x430d00];return _0x37774b;};'use strict';var _=require('lodash');var util=require(_0xfcc0('0x0'));var logger=require(_0xfcc0('0x1'))(_0xfcc0('0x2'));var moment=require(_0xfcc0('0x3'));var BPromise=require(_0xfcc0('0x4'));var rp=require(_0xfcc0('0x5'));var fs=require('fs');var path=require(_0xfcc0('0x6'));var rimraf=require(_0xfcc0('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xfcc0('0x8')]=function(_0x1e9a0e,_0x49f668){return _0x1e9a0e[_0xfcc0('0x9')](_0xfcc0('0xa'),attributes,{'tableName':_0xfcc0('0xb'),'paranoid':![],'indexes':[{'name':_0xfcc0('0xc'),'fields':[_0xfcc0('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index cacedfd..e1d06b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4236=['client','request','then','info','request\x20sent','debug','error','DeskField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x4236,0x13c));var _0x6423=function(_0x52788d,_0x4f2307){_0x52788d=_0x52788d-0x0;var _0x4ed07c=_0x4236[_0x52788d];return _0x4ed07c;};'use strict';var _=require(_0x6423('0x0'));var util=require(_0x6423('0x1'));var moment=require(_0x6423('0x2'));var BPromise=require(_0x6423('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6423('0x4'))['db'];var utils=require(_0x6423('0x5'));var logger=require(_0x6423('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6423('0x7'));var client=jayson[_0x6423('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20d720,_0x32a78f,_0x21145b){return new BPromise(function(_0x6aede2,_0x224c66){return client[_0x6423('0x9')](_0x20d720,_0x21145b)[_0x6423('0xa')](function(_0x5b34ca){logger[_0x6423('0xb')]('DeskField,\x20%s,\x20%s',_0x32a78f,_0x6423('0xc'));logger[_0x6423('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x32a78f,_0x6423('0xc'),JSON['stringify'](_0x5b34ca));if(_0x5b34ca[_0x6423('0xe')]){if(_0x5b34ca['error']['code']===0x1f4){logger['error'](_0x6423('0xf'),_0x32a78f,_0x5b34ca[_0x6423('0xe')][_0x6423('0x10')]);return _0x224c66(_0x5b34ca[_0x6423('0xe')][_0x6423('0x10')]);}logger['error'](_0x6423('0xf'),_0x32a78f,_0x5b34ca[_0x6423('0xe')][_0x6423('0x10')]);return _0x6aede2(_0x5b34ca[_0x6423('0xe')][_0x6423('0x10')]);}else{logger[_0x6423('0xb')](_0x6423('0xf'),_0x32a78f,_0x6423('0xc'));_0x6aede2(_0x5b34ca[_0x6423('0x11')][_0x6423('0x10')]);}})['catch'](function(_0x2ed60b){logger[_0x6423('0xe')](_0x6423('0xf'),_0x32a78f,_0x2ed60b);_0x224c66(_0x2ed60b);});});}
\ No newline at end of file
+var _0x3144=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','request\x20sent','code','error','message','result','catch','util','moment'];(function(_0x5ea3b1,_0x16189f){var _0x35d4b7=function(_0x3126cc){while(--_0x3126cc){_0x5ea3b1['push'](_0x5ea3b1['shift']());}};_0x35d4b7(++_0x16189f);}(_0x3144,0x15e));var _0x4314=function(_0x35ce8b,_0x2df0a2){_0x35ce8b=_0x35ce8b-0x0;var _0x3ef115=_0x3144[_0x35ce8b];return _0x3ef115;};'use strict';var _=require('lodash');var util=require(_0x4314('0x0'));var moment=require(_0x4314('0x1'));var BPromise=require(_0x4314('0x2'));var rs=require(_0x4314('0x3'));var fs=require('fs');var Redis=require(_0x4314('0x4'));var db=require(_0x4314('0x5'))['db'];var utils=require(_0x4314('0x6'));var logger=require(_0x4314('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4314('0x8'));var client=jayson[_0x4314('0x9')][_0x4314('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a54a5,_0x57b17a,_0x12db93){return new BPromise(function(_0x5b40e7,_0x251513){return client[_0x4314('0xb')](_0x3a54a5,_0x12db93)[_0x4314('0xc')](function(_0x1d6986){logger[_0x4314('0xd')](_0x4314('0xe'),_0x57b17a,'request\x20sent');logger[_0x4314('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x57b17a,_0x4314('0x10'),JSON['stringify'](_0x1d6986));if(_0x1d6986['error']){if(_0x1d6986['error'][_0x4314('0x11')]===0x1f4){logger[_0x4314('0x12')](_0x4314('0xe'),_0x57b17a,_0x1d6986[_0x4314('0x12')][_0x4314('0x13')]);return _0x251513(_0x1d6986['error']['message']);}logger[_0x4314('0x12')](_0x4314('0xe'),_0x57b17a,_0x1d6986[_0x4314('0x12')][_0x4314('0x13')]);return _0x5b40e7(_0x1d6986[_0x4314('0x12')]['message']);}else{logger[_0x4314('0xd')](_0x4314('0xe'),_0x57b17a,_0x4314('0x10'));_0x5b40e7(_0x1d6986[_0x4314('0x14')][_0x4314('0x13')]);}})[_0x4314('0x15')](function(_0x248fdb){logger['error']('DeskField,\x20%s,\x20%s',_0x57b17a,_0x248fdb);_0x251513(_0x248fdb);});});}
\ No newline at end of file
index 4e15f72..a9f7f1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eaf=['/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6eaf,0xf9));var _0xf6ea=function(_0x148ead,_0x31a41c){_0x148ead=_0x148ead-0x0;var _0x193eee=_0x6eaf[_0x148ead];return _0x193eee;};'use strict';var multer=require('multer');var util=require(_0xf6ea('0x0'));var path=require(_0xf6ea('0x1'));var timeout=require(_0xf6ea('0x2'));var express=require(_0xf6ea('0x3'));var router=express[_0xf6ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf6ea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf6ea('0x6'));var controller=require(_0xf6ea('0x7'));router[_0xf6ea('0x8')]('/',auth[_0xf6ea('0x9')](),controller[_0xf6ea('0xa')]);router[_0xf6ea('0x8')]('/:id',auth[_0xf6ea('0x9')](),controller['show']);router[_0xf6ea('0x8')](_0xf6ea('0xb'),auth['isAuthenticated'](),controller[_0xf6ea('0xc')]);router['get'](_0xf6ea('0xd'),auth[_0xf6ea('0x9')](),controller['getFields']);router[_0xf6ea('0xe')]('/',auth[_0xf6ea('0x9')](),controller[_0xf6ea('0xf')]);router[_0xf6ea('0xe')](_0xf6ea('0xb'),auth[_0xf6ea('0x9')](),controller[_0xf6ea('0x10')]);router[_0xf6ea('0x11')]('/:id',auth[_0xf6ea('0x9')](),controller['update']);router['delete']('/:id',auth[_0xf6ea('0x9')](),controller[_0xf6ea('0x12')]);module[_0xf6ea('0x13')]=router;
\ No newline at end of file
+var _0x010e=['/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x408a0f,_0x47f9c7){var _0x553652=function(_0x25a679){while(--_0x25a679){_0x408a0f['push'](_0x408a0f['shift']());}};_0x553652(++_0x47f9c7);}(_0x010e,0x177));var _0xe010=function(_0xe27078,_0x30f719){_0xe27078=_0xe27078-0x0;var _0x2f51a2=_0x010e[_0xe27078];return _0x2f51a2;};'use strict';var multer=require(_0xe010('0x0'));var util=require(_0xe010('0x1'));var path=require(_0xe010('0x2'));var timeout=require(_0xe010('0x3'));var express=require(_0xe010('0x4'));var router=express[_0xe010('0x5')]();var fs_extra=require(_0xe010('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe010('0x7'));var config=require(_0xe010('0x8'));var controller=require(_0xe010('0x9'));router[_0xe010('0xa')]('/',auth[_0xe010('0xb')](),controller['index']);router[_0xe010('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe010('0xc')]);router[_0xe010('0xa')](_0xe010('0xd'),auth[_0xe010('0xb')](),controller[_0xe010('0xe')]);router[_0xe010('0xa')](_0xe010('0xf'),auth['isAuthenticated'](),controller[_0xe010('0x10')]);router[_0xe010('0x11')]('/',auth[_0xe010('0xb')](),controller[_0xe010('0x12')]);router['post'](_0xe010('0xd'),auth[_0xe010('0xb')](),controller[_0xe010('0x13')]);router[_0xe010('0x14')](_0xe010('0x15'),auth[_0xe010('0xb')](),controller[_0xe010('0x16')]);router[_0xe010('0x17')](_0xe010('0x15'),auth[_0xe010('0xb')](),controller[_0xe010('0x18')]);module[_0xe010('0x19')]=router;
\ No newline at end of file
index 0b8256f..d66f3b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['sequelize','exports','STRING','BOOLEAN'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xed1f,0x170));var _0xfed1=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xed1f[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0xfed1('0x0'));module[_0xfed1('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfed1('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xfed1('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xfed1('0x2')]},'serverUrl':{'type':Sequelize[_0xfed1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfed1('0x2')]},'modernAuthentication':{'type':Sequelize[_0xfed1('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6f72=['exports','STRING','BOOLEAN'];(function(_0x4e6fb0,_0x32acef){var _0x1ea04f=function(_0x432e67){while(--_0x432e67){_0x4e6fb0['push'](_0x4e6fb0['shift']());}};_0x1ea04f(++_0x32acef);}(_0x6f72,0xae));var _0x26f7=function(_0x1f9f5b,_0x90f0f5){_0x1f9f5b=_0x1f9f5b-0x0;var _0x128a57=_0x6f72[_0x1f9f5b];return _0x128a57;};'use strict';var Sequelize=require('sequelize');module[_0x26f7('0x0')]={'name':{'type':Sequelize[_0x26f7('0x1')]},'username':{'type':Sequelize[_0x26f7('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x26f7('0x1')]},'tenantId':{'type':Sequelize[_0x26f7('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x26f7('0x1')]},'serverUrl':{'type':Sequelize[_0x26f7('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x26f7('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 0edb0df..708d9fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f52=['data5','data7','remoteUri','POST','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','error','name','send','index','map','Dynamics365Account','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','getSubjects','channel','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statuscode','subjectidname','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','modernAuthentication','CloudProvider'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f52,0xec));var _0x27f5=function(_0xc2c3c8,_0x3acde7){_0xc2c3c8=_0xc2c3c8-0x0;var _0x4aa805=_0x7f52[_0xc2c3c8];return _0x4aa805;};'use strict';var rp=require('request-promise');var util=require(_0x27f5('0x0'));var _=require(_0x27f5('0x1'));var qs=require(_0x27f5('0x2'));var logger=require('../../config/logger')(_0x27f5('0x3'));var db=require(_0x27f5('0x4'))['db'];var integrations=require(_0x27f5('0x5'));function respondWithResult(_0x2a4c0c,_0x521df0){_0x521df0=_0x521df0||0xc8;return function(_0x1ede67){if(_0x1ede67){return _0x2a4c0c[_0x27f5('0x6')](_0x521df0)['json'](_0x1ede67);}};}function respondWithFilteredResult(_0x14ffec,_0x436f94){return function(_0x3ba6c8){if(_0x3ba6c8){var _0x58c31d=typeof _0x436f94[_0x27f5('0x7')]===_0x27f5('0x8')&&typeof _0x436f94[_0x27f5('0x9')]==='undefined';var _0xcb5432=_0x3ba6c8[_0x27f5('0xa')];var _0x4cf1c4=_0x58c31d?0x0:_0x436f94[_0x27f5('0x7')];var _0x45d6be=_0x58c31d?_0x3ba6c8[_0x27f5('0xa')]:_0x436f94[_0x27f5('0x7')]+_0x436f94[_0x27f5('0x9')];var _0x24d9c5;if(_0x45d6be>=_0xcb5432){_0x45d6be=_0xcb5432;_0x24d9c5=0xc8;}else{_0x24d9c5=0xce;}_0x14ffec[_0x27f5('0x6')](_0x24d9c5);return _0x14ffec[_0x27f5('0xb')](_0x27f5('0xc'),_0x4cf1c4+'-'+_0x45d6be+'/'+_0xcb5432)[_0x27f5('0xd')](_0x3ba6c8);}return null;};}function saveUpdates(_0x43c01b){return function(_0x2899cb){if(_0x2899cb){return _0x2899cb[_0x27f5('0xe')](_0x43c01b)[_0x27f5('0xf')](function(_0x164ca3){return _0x164ca3;});}return null;};}function removeEntity(_0x3029d8){return function(_0x2ae36b){if(_0x2ae36b){return _0x2ae36b[_0x27f5('0x10')]()[_0x27f5('0xf')](function(){_0x3029d8[_0x27f5('0x6')](0xcc)[_0x27f5('0x11')]();});}};}function handleEntityNotFound(_0x1722d4){return function(_0x4c737f){if(!_0x4c737f){_0x1722d4['sendStatus'](0x194);}return _0x4c737f;};}function handleError(_0x54052d,_0x3043e1){_0x3043e1=_0x3043e1||0x1f4;return function(_0x2ac1bb){logger[_0x27f5('0x12')](_0x2ac1bb['stack']);if(_0x2ac1bb['name']){delete _0x2ac1bb[_0x27f5('0x13')];}_0x54052d[_0x27f5('0x6')](_0x3043e1)[_0x27f5('0x14')](_0x2ac1bb);};}exports[_0x27f5('0x15')]=function(_0x9358c5,_0x20ce1d){var _0x249b3a={},_0x5763d1={},_0x15037a={'count':0x0,'rows':[]};var _0xaf5d4a=_[_0x27f5('0x16')](db[_0x27f5('0x17')]['rawAttributes'],function(_0x369b6c){return{'name':_0x369b6c['fieldName'],'type':_0x369b6c[_0x27f5('0x18')][_0x27f5('0x19')]};});_0x5763d1[_0x27f5('0x1a')]=_[_0x27f5('0x16')](_0xaf5d4a,_0x27f5('0x13'));_0x5763d1[_0x27f5('0x1b')]=_[_0x27f5('0x1c')](_0x9358c5['query']);_0x5763d1[_0x27f5('0x1d')]=_[_0x27f5('0x1e')](_0x5763d1[_0x27f5('0x1a')],_0x5763d1[_0x27f5('0x1b')]);_0x249b3a[_0x27f5('0x1f')]=_['intersection'](_0x5763d1[_0x27f5('0x1a')],qs[_0x27f5('0x20')](_0x9358c5[_0x27f5('0x1b')][_0x27f5('0x20')]));_0x249b3a[_0x27f5('0x1f')]=_0x249b3a[_0x27f5('0x1f')][_0x27f5('0x21')]?_0x249b3a[_0x27f5('0x1f')]:_0x5763d1[_0x27f5('0x1a')];if(!_0x9358c5[_0x27f5('0x1b')][_0x27f5('0x22')]('nolimit')){_0x249b3a[_0x27f5('0x9')]=qs[_0x27f5('0x9')](_0x9358c5['query']['limit']);_0x249b3a['offset']=qs[_0x27f5('0x7')](_0x9358c5[_0x27f5('0x1b')][_0x27f5('0x7')]);}_0x249b3a[_0x27f5('0x23')]=qs['sort'](_0x9358c5[_0x27f5('0x1b')][_0x27f5('0x24')]);_0x249b3a[_0x27f5('0x25')]=qs[_0x27f5('0x1d')](_['pick'](_0x9358c5[_0x27f5('0x1b')],_0x5763d1[_0x27f5('0x1d')]),_0xaf5d4a);if(_0x9358c5[_0x27f5('0x1b')][_0x27f5('0x26')]){_0x249b3a[_0x27f5('0x25')]=_[_0x27f5('0x27')](_0x249b3a['where'],{'$or':_[_0x27f5('0x16')](_0xaf5d4a,function(_0xb5b4a5){if(_0xb5b4a5[_0x27f5('0x18')]!==_0x27f5('0x28')){var _0x89aa47={};_0x89aa47[_0xb5b4a5['name']]={'$like':'%'+_0x9358c5[_0x27f5('0x1b')][_0x27f5('0x26')]+'%'};return _0x89aa47;}})});}_0x249b3a=_[_0x27f5('0x27')]({},_0x249b3a,_0x9358c5[_0x27f5('0x29')]);var _0x497c83={'where':_0x249b3a[_0x27f5('0x25')]};return db[_0x27f5('0x17')][_0x27f5('0xa')](_0x497c83)[_0x27f5('0xf')](function(_0x48f169){_0x15037a[_0x27f5('0xa')]=_0x48f169;if(_0x9358c5[_0x27f5('0x1b')][_0x27f5('0x2a')]){_0x249b3a[_0x27f5('0x2b')]=[{'all':!![]}];}return db[_0x27f5('0x17')][_0x27f5('0x2c')](_0x249b3a);})[_0x27f5('0xf')](function(_0x167a76){_0x15037a['rows']=_0x167a76;return _0x15037a;})[_0x27f5('0xf')](respondWithFilteredResult(_0x20ce1d,_0x249b3a))[_0x27f5('0x2d')](handleError(_0x20ce1d,null));};exports[_0x27f5('0x2e')]=function(_0x41e5e0,_0x493408){var _0x11789f={'raw':![],'where':{'id':_0x41e5e0[_0x27f5('0x2f')]['id']}},_0x487883={};_0x487883[_0x27f5('0x1a')]=_[_0x27f5('0x1c')](db[_0x27f5('0x17')]['rawAttributes']);_0x487883[_0x27f5('0x1b')]=_[_0x27f5('0x1c')](_0x41e5e0[_0x27f5('0x1b')]);_0x487883[_0x27f5('0x1d')]=_['intersection'](_0x487883[_0x27f5('0x1a')],_0x487883[_0x27f5('0x1b')]);_0x11789f[_0x27f5('0x1f')]=_['intersection'](_0x487883[_0x27f5('0x1a')],qs[_0x27f5('0x20')](_0x41e5e0[_0x27f5('0x1b')][_0x27f5('0x20')]));_0x11789f[_0x27f5('0x1f')]=_0x11789f['attributes']['length']?_0x11789f['attributes']:_0x487883['model'];if(_0x41e5e0['query'][_0x27f5('0x2a')]){_0x11789f[_0x27f5('0x2b')]=[{'all':!![]}];}_0x11789f=_[_0x27f5('0x27')]({},_0x11789f,_0x41e5e0[_0x27f5('0x29')]);return db[_0x27f5('0x17')]['find'](_0x11789f)[_0x27f5('0xf')](handleEntityNotFound(_0x493408,null))[_0x27f5('0xf')](respondWithResult(_0x493408,null))['catch'](handleError(_0x493408,null));};exports[_0x27f5('0x30')]=function(_0x48f1b4,_0x3e258a){return db[_0x27f5('0x17')][_0x27f5('0x30')](_0x48f1b4[_0x27f5('0x31')],{})[_0x27f5('0xf')](respondWithResult(_0x3e258a,0xc9))[_0x27f5('0x2d')](handleError(_0x3e258a,null));};exports['update']=function(_0x1500c6,_0x26f29b){if(_0x1500c6[_0x27f5('0x31')]['id']){delete _0x1500c6['body']['id'];}return db[_0x27f5('0x17')][_0x27f5('0x32')]({'where':{'id':_0x1500c6[_0x27f5('0x2f')]['id']}})['then'](handleEntityNotFound(_0x26f29b,null))['then'](saveUpdates(_0x1500c6[_0x27f5('0x31')],null))[_0x27f5('0xf')](respondWithResult(_0x26f29b,null))['catch'](handleError(_0x26f29b,null));};exports[_0x27f5('0x10')]=function(_0x25ceb5,_0x1b8079){return db[_0x27f5('0x17')]['find']({'where':{'id':_0x25ceb5[_0x27f5('0x2f')]['id']}})[_0x27f5('0xf')](handleEntityNotFound(_0x1b8079,null))[_0x27f5('0xf')](removeEntity(_0x1b8079,null))[_0x27f5('0x2d')](handleError(_0x1b8079,null));};exports[_0x27f5('0x33')]=function(_0x468ac5,_0x368e87){var _0x337f04={};var _0x47d0f5={};var _0x365f02;var _0x34dfd9;return db['Dynamics365Account'][_0x27f5('0x34')]({'where':{'id':_0x468ac5[_0x27f5('0x2f')]['id']}})[_0x27f5('0xf')](handleEntityNotFound(_0x368e87,null))[_0x27f5('0xf')](function(_0x33f75a){if(_0x33f75a){_0x365f02=_0x33f75a;_0x47d0f5[_0x27f5('0x1a')]=_['keys'](db[_0x27f5('0x35')]['rawAttributes']);_0x47d0f5['query']=_[_0x27f5('0x1c')](_0x468ac5[_0x27f5('0x1b')]);_0x47d0f5[_0x27f5('0x1d')]=_[_0x27f5('0x1e')](_0x47d0f5[_0x27f5('0x1a')],_0x47d0f5['query']);_0x337f04[_0x27f5('0x1f')]=_[_0x27f5('0x1e')](_0x47d0f5[_0x27f5('0x1a')],qs[_0x27f5('0x20')](_0x468ac5[_0x27f5('0x1b')][_0x27f5('0x20')]));_0x337f04[_0x27f5('0x1f')]=_0x337f04['attributes'][_0x27f5('0x21')]?_0x337f04[_0x27f5('0x1f')]:_0x47d0f5[_0x27f5('0x1a')];_0x337f04[_0x27f5('0x23')]=qs[_0x27f5('0x24')](_0x468ac5['query'][_0x27f5('0x24')]);_0x337f04[_0x27f5('0x25')]=qs[_0x27f5('0x1d')](_[_0x27f5('0x36')](_0x468ac5[_0x27f5('0x1b')],_0x47d0f5[_0x27f5('0x1d')]));if(_0x468ac5[_0x27f5('0x1b')]['filter']){_0x337f04[_0x27f5('0x25')]=_[_0x27f5('0x27')](_0x337f04[_0x27f5('0x25')],{'$or':_[_0x27f5('0x16')](_0x337f04[_0x27f5('0x1f')],function(_0x36aaea){var _0x24db96={};_0x24db96[_0x36aaea]={'$like':'%'+_0x468ac5[_0x27f5('0x1b')][_0x27f5('0x26')]+'%'};return _0x24db96;})});}_0x337f04=_['merge']({},_0x337f04,_0x468ac5[_0x27f5('0x29')]);return _0x365f02['getConfigurations'](_0x337f04);}})[_0x27f5('0xf')](function(_0x30461e){if(_0x30461e){_0x34dfd9=_0x30461e[_0x27f5('0x21')];if(!_0x468ac5['query'][_0x27f5('0x22')]('nolimit')){_0x337f04['limit']=qs[_0x27f5('0x9')](_0x468ac5['query'][_0x27f5('0x9')]);_0x337f04['offset']=qs[_0x27f5('0x7')](_0x468ac5[_0x27f5('0x1b')]['offset']);}return _0x365f02['getConfigurations'](_0x337f04);}})['then'](function(_0x40118c){if(_0x40118c){return _0x40118c?{'count':_0x34dfd9,'rows':_0x40118c}:null;}})[_0x27f5('0xf')](respondWithResult(_0x368e87,null))[_0x27f5('0x2d')](handleError(_0x368e87,null));};exports[_0x27f5('0x37')]=function(_0x2a5375,_0x2b164d){if(_0x2a5375['body']['id']){delete _0x2a5375[_0x27f5('0x31')]['id'];}return db[_0x27f5('0x17')][_0x27f5('0x34')]({'where':{'id':_0x2a5375['params']['id']}})[_0x27f5('0xf')](handleEntityNotFound(_0x2b164d,null))['then'](function(_0x3a8b77){if(_0x3a8b77){_0x2a5375[_0x27f5('0x31')][_0x27f5('0x38')]=_0x3a8b77['id'];_0x2a5375['body']['Subjects']=integrations[_0x27f5('0x39')](_0x2a5375[_0x27f5('0x31')][_0x27f5('0x3a')],_0x2a5375[_0x27f5('0x31')][_0x27f5('0x18')]);_0x2a5375[_0x27f5('0x31')]['Descriptions']=integrations['getDescriptions'](_0x2a5375[_0x27f5('0x31')][_0x27f5('0x3a')],_0x2a5375[_0x27f5('0x31')][_0x27f5('0x18')]);return db['Dynamics365Configuration'][_0x27f5('0x30')](_0x2a5375[_0x27f5('0x31')],{'include':[{'model':db[_0x27f5('0x3b')],'as':'Subjects'},{'model':db[_0x27f5('0x3b')],'as':_0x27f5('0x3c')}]});}return null;})[_0x27f5('0xf')](respondWithResult(_0x2b164d,null))[_0x27f5('0x2d')](handleError(_0x2b164d,null));};function sanitizeRemoteUri(_0x198351){var _0x3547fc=_0x198351[_0x27f5('0x3d')](-0x1);if(_0x3547fc==='/')return _0x198351[_0x27f5('0x3e')](0x0,_0x198351[_0x27f5('0x3f')](_0x3547fc));return _0x198351;}function getWebApiUrl(_0x1655da){return util['format'](_0x27f5('0x40'),_0x1655da);}exports['getFields']=function(_0x899415,_0x39ac05){var _0x59efa7=_0x899415['query'][_0x27f5('0x41')];var _0x516ba3=_0x59efa7===_0x27f5('0x42')?_0x27f5('0x43'):_0x27f5('0x44');var _0x5dfd48='';var _0x559a3a='';var _0x5ee8d2='';var _0x5caa22='';var _0xa4c404='';var _0x113f16='';var _0x42e8e5='';var _0x478b5a='';var _0x4fe7ec=['title',_0x27f5('0x45'),_0x27f5('0x46'),_0x27f5('0x47'),_0x27f5('0x48'),_0x27f5('0x49'),_0x27f5('0x4a'),_0x27f5('0x4b'),_0x27f5('0x4c'),_0x27f5('0x4d')];var _0x4b26ab=[_0x27f5('0x4e'),_0x27f5('0x4f'),'actualserviceunits',_0x27f5('0x50'),'contactidname',_0x27f5('0x51'),_0x27f5('0x52'),_0x27f5('0x53'),_0x27f5('0x54'),_0x27f5('0x55'),_0x27f5('0x56'),_0x27f5('0x57'),_0x27f5('0x58'),_0x27f5('0x59'),_0x27f5('0x5a'),_0x27f5('0x5b'),_0x27f5('0x5c'),_0x27f5('0x5d'),_0x27f5('0x5e'),_0x27f5('0x5f'),'entityimage_timestamp','entityimage_url','escalatedon',_0x27f5('0x60'),_0x27f5('0x61'),_0x27f5('0x62'),_0x27f5('0x63'),_0x27f5('0x64'),_0x27f5('0x65'),_0x27f5('0x66'),_0x27f5('0x67'),'modifiedbyexternalpartyname',_0x27f5('0x68'),_0x27f5('0x69'),_0x27f5('0x6a'),_0x27f5('0x6b'),_0x27f5('0x6c'),_0x27f5('0x6d'),_0x27f5('0x6e'),_0x27f5('0x6f'),_0x27f5('0x70'),_0x27f5('0x71'),_0x27f5('0x72'),_0x27f5('0x73'),_0x27f5('0x74'),_0x27f5('0x75'),_0x27f5('0x76'),_0x27f5('0x77'),'primarycontactidyominame',_0x27f5('0x78'),_0x27f5('0x79'),_0x27f5('0x7a'),'resolveby',_0x27f5('0x7b'),'responseby',_0x27f5('0x7c'),_0x27f5('0x7d'),_0x27f5('0x7e'),_0x27f5('0x7f'),'slaname',_0x27f5('0x80'),'statecode',_0x27f5('0x81'),_0x27f5('0x82'),'ticketnumber','timezoneruleversionnumber',_0x27f5('0x83'),_0x27f5('0x84'),_0x27f5('0x85'),_0x27f5('0x86')];var _0x4d1b2f=_0x4fe7ec[_0x27f5('0x87')](_0x4b26ab);return db[_0x27f5('0x17')]['findOne']({'where':{'id':_0x899415[_0x27f5('0x2f')]['id']},'attributes':['id',_0x27f5('0x88'),_0x27f5('0x89'),'remoteUri',_0x27f5('0x8a'),_0x27f5('0x8b'),'clientSecret',_0x27f5('0x8c')],'include':[{'model':db[_0x27f5('0x8d')],'as':_0x27f5('0x8d'),'attributes':['id',_0x27f5('0x8e'),'data7']}]})[_0x27f5('0xf')](handleEntityNotFound(_0x39ac05,null))[_0x27f5('0xf')](function(_0x585a69){if(_0x585a69){if(_0x585a69[_0x27f5('0x8c')]){_0x585a69['access_token']=_0x585a69[_0x27f5('0x8d')]['data5'];_0x478b5a=sanitizeRemoteUri(_0x585a69[_0x27f5('0x8d')][_0x27f5('0x8f')]);_0x42e8e5=getWebApiUrl(_0x478b5a);return _0x585a69;}_0x478b5a=sanitizeRemoteUri(_0x585a69[_0x27f5('0x90')]);_0x42e8e5=getWebApiUrl(_0x478b5a);var _0x1c50b7={'method':_0x27f5('0x91'),'uri':'https://login.microsoftonline.com/'+_0x585a69[_0x27f5('0x8a')]+_0x27f5('0x92'),'form':{'client_id':_0x585a69['clientId'],'resource':_0x478b5a,'username':_0x585a69[_0x27f5('0x88')],'password':_0x585a69[_0x27f5('0x89')],'grant_type':'password','client_secret':_0x585a69[_0x27f5('0x93')]},'json':!![]};return rp(_0x1c50b7);}})[_0x27f5('0xf')](function(_0x472457){_0x113f16=_0x472457['access_token'];var _0x421f55={'method':_0x27f5('0x94'),'uri':encodeURI(_0x42e8e5+_0x27f5('0x95')+_0x516ba3+'\x27'),'headers':{'Authorization':_0x27f5('0x96')+_0x113f16,'If-None-Match':null,'OData-Version':_0x27f5('0x97')},'json':!![]};return rp(_0x421f55);})['then'](function(_0x294d18){var _0x10ef8c=_0x294d18['value'][0x0];var _0x469f02=_0x10ef8c[_0x27f5('0x98')];var _0x53d4cf={'method':'GET','uri':_0x42e8e5+_0x27f5('0x99')+_0x469f02+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x27f5('0x96')+_0x113f16,'If-None-Match':null,'OData-Version':_0x27f5('0x97')},'json':!![]};return rp(_0x53d4cf);})[_0x27f5('0xf')](function(_0x23796f){_0x5dfd48=_0x23796f;_0x559a3a=_0x5dfd48[_0x27f5('0x9a')];_0x559a3a=_[_0x27f5('0x9b')](_0x559a3a,function(_0x402432){return!_0x4d1b2f[_0x27f5('0x9c')](_0x402432[_0x27f5('0x9d')]);});var _0xf577ec=[];var _0x220cf2=[];_0x559a3a[_0x27f5('0x9e')](function(_0x4882bd){if(_0x4882bd[_0x27f5('0x9f')]){var _0x101464=_0x4882bd['@odata.type'][_0x27f5('0x3e')](_0x4882bd[_0x27f5('0x9f')][_0x27f5('0x3f')]('.')+0x1);if(_0x101464===_0x27f5('0xa0')){_0xf577ec[_0x27f5('0xa1')](getSelectList(_0x42e8e5,_0x59efa7,_0x220cf2,_0x5dfd48[_0x27f5('0x98')],_0x4882bd[_0x27f5('0x98')],_0x113f16));}}});return Promise[_0x27f5('0xa2')](_0xf577ec);})['then'](function(_0x3da809){_0x5ee8d2=_0x3da809[0x0];var _0x3fcac3=[];var _0x466a8e=[];_0x559a3a[_0x27f5('0x9e')](function(_0x27febb){if(!_[_0x27f5('0xa3')](_0x27febb[_0x27f5('0x9f')])){var _0x139fc1=_0x27febb['@odata.type'][_0x27f5('0x3e')](_0x27febb[_0x27f5('0x9f')][_0x27f5('0x3f')]('.')+0x1);if(_0x139fc1===_0x27f5('0xa4')){_0x3fcac3[_0x27f5('0xa1')](getBooleanList(_0x42e8e5,_0x59efa7,_0x466a8e,_0x5dfd48[_0x27f5('0x98')],_0x27febb[_0x27f5('0x98')],_0x113f16));}}});return Promise[_0x27f5('0xa2')](_0x3fcac3);})[_0x27f5('0xf')](function(_0x32fd0d){_0x5caa22=_0x32fd0d[0x0];var _0x206b75=[];var _0x5c1578=[];_0x559a3a['forEach'](function(_0x4c0035){if(_0x4c0035[_0x27f5('0x9f')]){var _0xb40dc3=_0x4c0035[_0x27f5('0x9f')][_0x27f5('0x3e')](_0x4c0035['@odata.type'][_0x27f5('0x3f')]('.')+0x1);if(_0xb40dc3===_0x27f5('0xa5')||_0xb40dc3===_0x27f5('0xa6')||_0xb40dc3===_0x27f5('0xa7')||_0xb40dc3===_0x27f5('0xa8')||_0xb40dc3===_0x27f5('0xa9')||_0xb40dc3==='DateTimeAttributeMetadata'||_0xb40dc3===_0x27f5('0xaa')||_0xb40dc3===_0x27f5('0xab')||_0xb40dc3===_0x27f5('0xac')||_0xb40dc3==='DecimalAttributeMetadata'){_0x206b75[_0x27f5('0xa1')](getInputList(_0x42e8e5,_0x59efa7,_0xb40dc3,_0x5c1578,_0x5dfd48[_0x27f5('0x98')],_0x4c0035[_0x27f5('0x98')],_0x113f16));}}});return Promise['all'](_0x206b75);})[_0x27f5('0xf')](function(_0x219792){_0xa4c404=_0x219792[0x0];var _0x105594=_0x5ee8d2[_0x27f5('0x87')](_0x5caa22)[_0x27f5('0x87')](_0xa4c404);var _0x10c9eb={'count':_0x105594[_0x27f5('0x21')],'rows':_0x105594};return _0x10c9eb;})[_0x27f5('0xf')](respondWithResult(_0x39ac05,null))[_0x27f5('0x2d')](function(_0x293977){var _0x5a0dc9=_0x899415[_0x27f5('0x1b')][_0x27f5('0xad')]?0x1f4:_0x293977[_0x27f5('0xae')]||0x1f4;logger[_0x27f5('0x12')](_0x293977['stack']);delete _0x293977[_0x27f5('0x13')];if(_0x5a0dc9===0x191){_0x5a0dc9=0x190;}_0x39ac05[_0x27f5('0x6')](_0x5a0dc9)[_0x27f5('0x14')](_0x899415['query'][_0x27f5('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0x293977[_0x27f5('0xae')]}:_0x293977);});};function getSelectList(_0x4e107f,_0x1b66e2,_0x523884,_0x258f07,_0xa6bd0c,_0x418acf){var _0x44e3a4={'method':_0x27f5('0x94'),'uri':_0x4e107f+_0x27f5('0x99')+_0x258f07+')/Attributes('+_0xa6bd0c+_0x27f5('0xaf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x27f5('0x96')+_0x418acf,'If-None-Match':null,'OData-Version':_0x27f5('0x97')},'json':!![]};return rp(_0x44e3a4)[_0x27f5('0xf')](function(_0x4a6e81){var _0x549a35=[];var _0x18ef6b=_0x4a6e81[_0x27f5('0xb0')]['Options'];_0x18ef6b[_0x27f5('0x9e')](function(_0x33c912){_0x549a35[_0x27f5('0xa1')]({'name':_0x33c912[_0x27f5('0xb1')][_0x27f5('0xb2')][_0x27f5('0xb1')],'value':String(_0x33c912[_0x27f5('0xb3')])});});var _0xa67ffe={'id':_0x1b66e2+'_'+_0x4a6e81[_0x27f5('0x9d')],'name':_0x4a6e81[_0x27f5('0xb4')]['UserLocalizedLabel'][_0x27f5('0xb1')],'custom':![],'options':_0x549a35};_0x523884[_0x27f5('0xa1')](_0xa67ffe);return _0x523884;});}function getBooleanList(_0x1bc845,_0x2a02ec,_0x586534,_0x5bac8f,_0x4218c3,_0x55f654){var _0x7da5a5={'method':_0x27f5('0x94'),'uri':_0x1bc845+_0x27f5('0x99')+_0x5bac8f+_0x27f5('0xb5')+_0x4218c3+_0x27f5('0xb6'),'headers':{'Authorization':_0x27f5('0x96')+_0x55f654,'If-None-Match':null,'OData-Version':_0x27f5('0x97')},'json':!![]};return rp(_0x7da5a5)['then'](function(_0x3f9782){var _0x39ebd2=[];_0x39ebd2[_0x27f5('0xa1')]({'name':_0x3f9782[_0x27f5('0xb0')][_0x27f5('0xb7')][_0x27f5('0xb1')][_0x27f5('0xb2')][_0x27f5('0xb1')],'value':_0x27f5('0xb8')},{'name':_0x3f9782[_0x27f5('0xb0')][_0x27f5('0xb9')]['Label'][_0x27f5('0xb2')][_0x27f5('0xb1')],'value':_0x27f5('0xba')});var _0x3c2726={'id':_0x2a02ec+'_'+_0x3f9782[_0x27f5('0x9d')],'name':_0x3f9782[_0x27f5('0xb4')][_0x27f5('0xb2')]['Label'],'custom':![],'options':_0x39ebd2};_0x586534[_0x27f5('0xa1')](_0x3c2726);return _0x586534;});}function getInputList(_0xb2a9de,_0x569176,_0x52f418,_0x598f6d,_0x301475,_0x1cd7ff,_0x39d285){var _0x4052ad={'method':_0x27f5('0x94'),'uri':_0xb2a9de+_0x27f5('0x99')+_0x301475+_0x27f5('0xb5')+_0x1cd7ff+_0x27f5('0xbb')+_0x52f418+_0x27f5('0xbc'),'headers':{'Authorization':_0x27f5('0x96')+_0x39d285,'If-None-Match':null,'OData-Version':_0x27f5('0x97')},'json':!![]};return rp(_0x4052ad)[_0x27f5('0xf')](function(_0x43846a){var _0x49575a={'id':_0x569176+'_'+_0x43846a['LogicalName'],'name':_0x43846a[_0x27f5('0xb4')][_0x27f5('0xb2')]?_0x43846a[_0x27f5('0xb4')]['UserLocalizedLabel']['Label']:_0x43846a[_0x27f5('0x9d')],'custom':![],'options':[]};_0x598f6d[_0x27f5('0xa1')](_0x49575a);return _0x598f6d;});}
\ No newline at end of file
+var _0x2c64=['Value','DisplayName','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption',')/Microsoft.Dynamics.CRM.','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','getConfigurations','findOne','Dynamics365Configuration','sort','AccountId','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','Subjects','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','overriddencreatedon','owneridname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','tenantId','clientId','GET','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','includes','LogicalName','@odata.type','push','MetadataId','all','isNil','BooleanAttributeMetadata','forEach','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label'];(function(_0xc27ab6,_0x496b5b){var _0x410eb9=function(_0x5ac33f){while(--_0x5ac33f){_0xc27ab6['push'](_0xc27ab6['shift']());}};_0x410eb9(++_0x496b5b);}(_0x2c64,0x181));var _0x42c6=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0x2c64[_0x4aa4e6];return _0x322588;};'use strict';var rp=require(_0x42c6('0x0'));var util=require(_0x42c6('0x1'));var _=require('lodash');var qs=require(_0x42c6('0x2'));var logger=require(_0x42c6('0x3'))(_0x42c6('0x4'));var db=require(_0x42c6('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x5a6d74,_0x427ee2){_0x427ee2=_0x427ee2||0xc8;return function(_0x41e211){if(_0x41e211){return _0x5a6d74[_0x42c6('0x6')](_0x427ee2)['json'](_0x41e211);}};}function respondWithFilteredResult(_0x553bd9,_0x58d2d0){return function(_0x1d7439){if(_0x1d7439){var _0x2c3d36=typeof _0x58d2d0[_0x42c6('0x7')]===_0x42c6('0x8')&&typeof _0x58d2d0[_0x42c6('0x9')]==='undefined';var _0x373994=_0x1d7439[_0x42c6('0xa')];var _0x27500d=_0x2c3d36?0x0:_0x58d2d0['offset'];var _0x235256=_0x2c3d36?_0x1d7439[_0x42c6('0xa')]:_0x58d2d0['offset']+_0x58d2d0[_0x42c6('0x9')];var _0x227a87;if(_0x235256>=_0x373994){_0x235256=_0x373994;_0x227a87=0xc8;}else{_0x227a87=0xce;}_0x553bd9[_0x42c6('0x6')](_0x227a87);return _0x553bd9[_0x42c6('0xb')](_0x42c6('0xc'),_0x27500d+'-'+_0x235256+'/'+_0x373994)[_0x42c6('0xd')](_0x1d7439);}return null;};}function saveUpdates(_0x14b490){return function(_0x4ff092){if(_0x4ff092){return _0x4ff092[_0x42c6('0xe')](_0x14b490)[_0x42c6('0xf')](function(_0x21f74a){return _0x21f74a;});}return null;};}function removeEntity(_0x43ebc5){return function(_0x3f1d22){if(_0x3f1d22){return _0x3f1d22[_0x42c6('0x10')]()[_0x42c6('0xf')](function(){_0x43ebc5['status'](0xcc)[_0x42c6('0x11')]();});}};}function handleEntityNotFound(_0x1a2863){return function(_0x189e46){if(!_0x189e46){_0x1a2863[_0x42c6('0x12')](0x194);}return _0x189e46;};}function handleError(_0x56eba5,_0x2f0946){_0x2f0946=_0x2f0946||0x1f4;return function(_0x4ee7e2){logger[_0x42c6('0x13')](_0x4ee7e2[_0x42c6('0x14')]);if(_0x4ee7e2[_0x42c6('0x15')]){delete _0x4ee7e2['name'];}_0x56eba5[_0x42c6('0x6')](_0x2f0946)[_0x42c6('0x16')](_0x4ee7e2);};}exports[_0x42c6('0x17')]=function(_0x3fce8d,_0x151a1e){var _0x12b285={},_0x2ac3e7={},_0x486e94={'count':0x0,'rows':[]};var _0x51aae3=_[_0x42c6('0x18')](db[_0x42c6('0x19')][_0x42c6('0x1a')],function(_0x192782){return{'name':_0x192782['fieldName'],'type':_0x192782['type'][_0x42c6('0x1b')]};});_0x2ac3e7[_0x42c6('0x1c')]=_['map'](_0x51aae3,_0x42c6('0x15'));_0x2ac3e7['query']=_[_0x42c6('0x1d')](_0x3fce8d[_0x42c6('0x1e')]);_0x2ac3e7[_0x42c6('0x1f')]=_[_0x42c6('0x20')](_0x2ac3e7[_0x42c6('0x1c')],_0x2ac3e7[_0x42c6('0x1e')]);_0x12b285[_0x42c6('0x21')]=_[_0x42c6('0x20')](_0x2ac3e7[_0x42c6('0x1c')],qs[_0x42c6('0x22')](_0x3fce8d[_0x42c6('0x1e')][_0x42c6('0x22')]));_0x12b285['attributes']=_0x12b285[_0x42c6('0x21')][_0x42c6('0x23')]?_0x12b285[_0x42c6('0x21')]:_0x2ac3e7[_0x42c6('0x1c')];if(!_0x3fce8d['query'][_0x42c6('0x24')](_0x42c6('0x25'))){_0x12b285[_0x42c6('0x9')]=qs['limit'](_0x3fce8d[_0x42c6('0x1e')]['limit']);_0x12b285[_0x42c6('0x7')]=qs[_0x42c6('0x7')](_0x3fce8d[_0x42c6('0x1e')][_0x42c6('0x7')]);}_0x12b285[_0x42c6('0x26')]=qs['sort'](_0x3fce8d['query']['sort']);_0x12b285[_0x42c6('0x27')]=qs[_0x42c6('0x1f')](_[_0x42c6('0x28')](_0x3fce8d[_0x42c6('0x1e')],_0x2ac3e7['filters']),_0x51aae3);if(_0x3fce8d[_0x42c6('0x1e')][_0x42c6('0x29')]){_0x12b285['where']=_[_0x42c6('0x2a')](_0x12b285['where'],{'$or':_[_0x42c6('0x18')](_0x51aae3,function(_0x482dc1){if(_0x482dc1[_0x42c6('0x2b')]!==_0x42c6('0x2c')){var _0x43e4cd={};_0x43e4cd[_0x482dc1[_0x42c6('0x15')]]={'$like':'%'+_0x3fce8d[_0x42c6('0x1e')][_0x42c6('0x29')]+'%'};return _0x43e4cd;}})});}_0x12b285=_[_0x42c6('0x2a')]({},_0x12b285,_0x3fce8d['options']);var _0x27bb6e={'where':_0x12b285[_0x42c6('0x27')]};return db[_0x42c6('0x19')][_0x42c6('0xa')](_0x27bb6e)[_0x42c6('0xf')](function(_0x898d52){_0x486e94[_0x42c6('0xa')]=_0x898d52;if(_0x3fce8d[_0x42c6('0x1e')][_0x42c6('0x2d')]){_0x12b285[_0x42c6('0x2e')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x42c6('0x2f')](_0x12b285);})[_0x42c6('0xf')](function(_0x55881d){_0x486e94[_0x42c6('0x30')]=_0x55881d;return _0x486e94;})[_0x42c6('0xf')](respondWithFilteredResult(_0x151a1e,_0x12b285))['catch'](handleError(_0x151a1e,null));};exports[_0x42c6('0x31')]=function(_0x2f9f42,_0x4bbc18){var _0x373355={'raw':![],'where':{'id':_0x2f9f42[_0x42c6('0x32')]['id']}},_0x479ce6={};_0x479ce6['model']=_[_0x42c6('0x1d')](db[_0x42c6('0x19')]['rawAttributes']);_0x479ce6[_0x42c6('0x1e')]=_[_0x42c6('0x1d')](_0x2f9f42[_0x42c6('0x1e')]);_0x479ce6['filters']=_[_0x42c6('0x20')](_0x479ce6[_0x42c6('0x1c')],_0x479ce6[_0x42c6('0x1e')]);_0x373355['attributes']=_[_0x42c6('0x20')](_0x479ce6[_0x42c6('0x1c')],qs[_0x42c6('0x22')](_0x2f9f42['query'][_0x42c6('0x22')]));_0x373355[_0x42c6('0x21')]=_0x373355[_0x42c6('0x21')][_0x42c6('0x23')]?_0x373355['attributes']:_0x479ce6[_0x42c6('0x1c')];if(_0x2f9f42[_0x42c6('0x1e')]['includeAll']){_0x373355[_0x42c6('0x2e')]=[{'all':!![]}];}_0x373355=_[_0x42c6('0x2a')]({},_0x373355,_0x2f9f42[_0x42c6('0x33')]);return db[_0x42c6('0x19')][_0x42c6('0x34')](_0x373355)[_0x42c6('0xf')](handleEntityNotFound(_0x4bbc18,null))[_0x42c6('0xf')](respondWithResult(_0x4bbc18,null))['catch'](handleError(_0x4bbc18,null));};exports[_0x42c6('0x35')]=function(_0x143f6e,_0x53ea24){return db[_0x42c6('0x19')][_0x42c6('0x35')](_0x143f6e['body'],{})[_0x42c6('0xf')](respondWithResult(_0x53ea24,0xc9))['catch'](handleError(_0x53ea24,null));};exports[_0x42c6('0xe')]=function(_0x489a67,_0x4e9654){if(_0x489a67[_0x42c6('0x36')]['id']){delete _0x489a67[_0x42c6('0x36')]['id'];}return db['Dynamics365Account'][_0x42c6('0x34')]({'where':{'id':_0x489a67[_0x42c6('0x32')]['id']}})[_0x42c6('0xf')](handleEntityNotFound(_0x4e9654,null))[_0x42c6('0xf')](saveUpdates(_0x489a67['body'],null))[_0x42c6('0xf')](respondWithResult(_0x4e9654,null))[_0x42c6('0x37')](handleError(_0x4e9654,null));};exports[_0x42c6('0x10')]=function(_0x57b77a,_0x2a2654){return db[_0x42c6('0x19')][_0x42c6('0x34')]({'where':{'id':_0x57b77a[_0x42c6('0x32')]['id']}})[_0x42c6('0xf')](handleEntityNotFound(_0x2a2654,null))[_0x42c6('0xf')](removeEntity(_0x2a2654,null))[_0x42c6('0x37')](handleError(_0x2a2654,null));};exports[_0x42c6('0x38')]=function(_0x2b5888,_0x500717){var _0x3cd12d={};var _0x575565={};var _0x4c3888;var _0x61bdeb;return db[_0x42c6('0x19')][_0x42c6('0x39')]({'where':{'id':_0x2b5888[_0x42c6('0x32')]['id']}})['then'](handleEntityNotFound(_0x500717,null))[_0x42c6('0xf')](function(_0x2466c3){if(_0x2466c3){_0x4c3888=_0x2466c3;_0x575565[_0x42c6('0x1c')]=_['keys'](db[_0x42c6('0x3a')][_0x42c6('0x1a')]);_0x575565[_0x42c6('0x1e')]=_[_0x42c6('0x1d')](_0x2b5888['query']);_0x575565[_0x42c6('0x1f')]=_[_0x42c6('0x20')](_0x575565['model'],_0x575565[_0x42c6('0x1e')]);_0x3cd12d[_0x42c6('0x21')]=_[_0x42c6('0x20')](_0x575565[_0x42c6('0x1c')],qs[_0x42c6('0x22')](_0x2b5888[_0x42c6('0x1e')]['fields']));_0x3cd12d['attributes']=_0x3cd12d[_0x42c6('0x21')][_0x42c6('0x23')]?_0x3cd12d[_0x42c6('0x21')]:_0x575565[_0x42c6('0x1c')];_0x3cd12d['order']=qs['sort'](_0x2b5888['query'][_0x42c6('0x3b')]);_0x3cd12d[_0x42c6('0x27')]=qs[_0x42c6('0x1f')](_[_0x42c6('0x28')](_0x2b5888[_0x42c6('0x1e')],_0x575565['filters']));if(_0x2b5888['query'][_0x42c6('0x29')]){_0x3cd12d['where']=_[_0x42c6('0x2a')](_0x3cd12d[_0x42c6('0x27')],{'$or':_[_0x42c6('0x18')](_0x3cd12d[_0x42c6('0x21')],function(_0x114a60){var _0x27caa8={};_0x27caa8[_0x114a60]={'$like':'%'+_0x2b5888[_0x42c6('0x1e')][_0x42c6('0x29')]+'%'};return _0x27caa8;})});}_0x3cd12d=_[_0x42c6('0x2a')]({},_0x3cd12d,_0x2b5888[_0x42c6('0x33')]);return _0x4c3888['getConfigurations'](_0x3cd12d);}})[_0x42c6('0xf')](function(_0x3b825a){if(_0x3b825a){_0x61bdeb=_0x3b825a[_0x42c6('0x23')];if(!_0x2b5888[_0x42c6('0x1e')]['hasOwnProperty']('nolimit')){_0x3cd12d[_0x42c6('0x9')]=qs[_0x42c6('0x9')](_0x2b5888[_0x42c6('0x1e')]['limit']);_0x3cd12d[_0x42c6('0x7')]=qs[_0x42c6('0x7')](_0x2b5888[_0x42c6('0x1e')][_0x42c6('0x7')]);}return _0x4c3888['getConfigurations'](_0x3cd12d);}})['then'](function(_0x20b95d){if(_0x20b95d){return _0x20b95d?{'count':_0x61bdeb,'rows':_0x20b95d}:null;}})[_0x42c6('0xf')](respondWithResult(_0x500717,null))[_0x42c6('0x37')](handleError(_0x500717,null));};exports['addConfiguration']=function(_0x7c4107,_0x3802ab){if(_0x7c4107[_0x42c6('0x36')]['id']){delete _0x7c4107[_0x42c6('0x36')]['id'];}return db[_0x42c6('0x19')]['findOne']({'where':{'id':_0x7c4107['params']['id']}})['then'](handleEntityNotFound(_0x3802ab,null))[_0x42c6('0xf')](function(_0x7be2ad){if(_0x7be2ad){_0x7c4107['body'][_0x42c6('0x3c')]=_0x7be2ad['id'];_0x7c4107[_0x42c6('0x36')]['Subjects']=integrations[_0x42c6('0x3d')](_0x7c4107[_0x42c6('0x36')]['channel'],_0x7c4107[_0x42c6('0x36')][_0x42c6('0x2b')]);_0x7c4107[_0x42c6('0x36')][_0x42c6('0x3e')]=integrations[_0x42c6('0x3f')](_0x7c4107[_0x42c6('0x36')][_0x42c6('0x40')],_0x7c4107[_0x42c6('0x36')][_0x42c6('0x2b')]);return db[_0x42c6('0x3a')][_0x42c6('0x35')](_0x7c4107[_0x42c6('0x36')],{'include':[{'model':db[_0x42c6('0x41')],'as':_0x42c6('0x42')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x42c6('0xf')](respondWithResult(_0x3802ab,null))[_0x42c6('0x37')](handleError(_0x3802ab,null));};function sanitizeRemoteUri(_0x5d2380){var _0x129465=_0x5d2380[_0x42c6('0x43')](-0x1);if(_0x129465==='/')return _0x5d2380[_0x42c6('0x44')](0x0,_0x5d2380[_0x42c6('0x45')](_0x129465));return _0x5d2380;}function getWebApiUrl(_0x255d9b){return util[_0x42c6('0x46')](_0x42c6('0x47'),_0x255d9b);}exports['getFields']=function(_0x11f76c,_0x3f3ed0){var _0x249f8e=_0x11f76c[_0x42c6('0x1e')]['ticketType'];var _0x357ce3=_0x249f8e===_0x42c6('0x48')?'Incident':_0x42c6('0x49');var _0x192576='';var _0x37f3e6='';var _0x37db8a='';var _0x4c4c21='';var _0xb71a35='';var _0x17a4ec='';var _0x5cd1c0='';var _0xba12f1='';var _0xfa8cb2=[_0x42c6('0x4a'),_0x42c6('0x4b'),_0x42c6('0x4c'),_0x42c6('0x4d'),_0x42c6('0x4e'),_0x42c6('0x4f'),_0x42c6('0x50'),_0x42c6('0x51'),_0x42c6('0x52'),'phonecall_activity_parties'];var _0x37f244=[_0x42c6('0x53'),_0x42c6('0x54'),_0x42c6('0x55'),_0x42c6('0x56'),_0x42c6('0x57'),_0x42c6('0x58'),'contractdetailidname',_0x42c6('0x59'),'createdbyexternalpartyname',_0x42c6('0x5a'),_0x42c6('0x5b'),_0x42c6('0x5c'),_0x42c6('0x5d'),'createdonbehalfbyname',_0x42c6('0x5e'),_0x42c6('0x5f'),_0x42c6('0x60'),_0x42c6('0x61'),_0x42c6('0x62'),_0x42c6('0x63'),'entityimage_timestamp',_0x42c6('0x64'),_0x42c6('0x65'),_0x42c6('0x66'),_0x42c6('0x67'),_0x42c6('0x68'),_0x42c6('0x69'),'influencescore',_0x42c6('0x6a'),_0x42c6('0x6b'),_0x42c6('0x6c'),_0x42c6('0x6d'),_0x42c6('0x6e'),_0x42c6('0x6f'),_0x42c6('0x70'),_0x42c6('0x71'),_0x42c6('0x72'),'modifiedonbehalfbyyominame',_0x42c6('0x73'),'msdyn_iotalertname',_0x42c6('0x74'),'onholdtime',_0x42c6('0x75'),_0x42c6('0x76'),'owneridtype','owneridyominame','parentcaseidname','primarycontactidname',_0x42c6('0x77'),_0x42c6('0x78'),_0x42c6('0x79'),'productserialnumber',_0x42c6('0x7a'),_0x42c6('0x7b'),_0x42c6('0x7c'),_0x42c6('0x7d'),_0x42c6('0x7e'),_0x42c6('0x7f'),'slainvokedidname',_0x42c6('0x80'),_0x42c6('0x81'),_0x42c6('0x82'),_0x42c6('0x83'),_0x42c6('0x84'),_0x42c6('0x85'),'timezoneruleversionnumber',_0x42c6('0x86'),_0x42c6('0x87'),'utcconversiontimezonecode',_0x42c6('0x88')];var _0x3e643b=_0xfa8cb2[_0x42c6('0x89')](_0x37f244);return db[_0x42c6('0x19')]['findOne']({'where':{'id':_0x11f76c[_0x42c6('0x32')]['id']},'attributes':['id',_0x42c6('0x8a'),_0x42c6('0x8b'),_0x42c6('0x8c'),'tenantId','clientId',_0x42c6('0x8d'),_0x42c6('0x8e')],'include':[{'model':db[_0x42c6('0x8f')],'as':'CloudProvider','attributes':['id',_0x42c6('0x90'),_0x42c6('0x91')]}]})[_0x42c6('0xf')](handleEntityNotFound(_0x3f3ed0,null))['then'](function(_0x3c960c){if(_0x3c960c){if(_0x3c960c[_0x42c6('0x8e')]){_0x3c960c[_0x42c6('0x92')]=_0x3c960c['CloudProvider'][_0x42c6('0x90')];_0xba12f1=sanitizeRemoteUri(_0x3c960c[_0x42c6('0x8f')][_0x42c6('0x91')]);_0x5cd1c0=getWebApiUrl(_0xba12f1);return _0x3c960c;}_0xba12f1=sanitizeRemoteUri(_0x3c960c[_0x42c6('0x8c')]);_0x5cd1c0=getWebApiUrl(_0xba12f1);var _0x8dbb15={'method':_0x42c6('0x93'),'uri':_0x42c6('0x94')+_0x3c960c[_0x42c6('0x95')]+'/oauth2/token','form':{'client_id':_0x3c960c[_0x42c6('0x96')],'resource':_0xba12f1,'username':_0x3c960c[_0x42c6('0x8a')],'password':_0x3c960c[_0x42c6('0x8b')],'grant_type':_0x42c6('0x8b'),'client_secret':_0x3c960c[_0x42c6('0x8d')]},'json':!![]};return rp(_0x8dbb15);}})['then'](function(_0xc8df01){_0x17a4ec=_0xc8df01['access_token'];var _0x1f27df={'method':_0x42c6('0x97'),'uri':encodeURI(_0x5cd1c0+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x357ce3+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x17a4ec,'If-None-Match':null,'OData-Version':_0x42c6('0x98')},'json':!![]};return rp(_0x1f27df);})[_0x42c6('0xf')](function(_0x29dbff){var _0x221410=_0x29dbff[_0x42c6('0x99')][0x0];var _0x2b3d02=_0x221410['MetadataId'];var _0x4edf40={'method':_0x42c6('0x97'),'uri':_0x5cd1c0+_0x42c6('0x9a')+_0x2b3d02+_0x42c6('0x9b'),'headers':{'Authorization':_0x42c6('0x9c')+_0x17a4ec,'If-None-Match':null,'OData-Version':_0x42c6('0x98')},'json':!![]};return rp(_0x4edf40);})[_0x42c6('0xf')](function(_0x14728a){_0x192576=_0x14728a;_0x37f3e6=_0x192576['Attributes'];_0x37f3e6=_[_0x42c6('0x9d')](_0x37f3e6,function(_0x1b1f49){return!_0x3e643b[_0x42c6('0x9e')](_0x1b1f49[_0x42c6('0x9f')]);});var _0x29b2e2=[];var _0xb0cddf=[];_0x37f3e6['forEach'](function(_0x31457c){if(_0x31457c[_0x42c6('0xa0')]){var _0x5af0cc=_0x31457c[_0x42c6('0xa0')][_0x42c6('0x44')](_0x31457c[_0x42c6('0xa0')]['lastIndexOf']('.')+0x1);if(_0x5af0cc==='PicklistAttributeMetadata'){_0x29b2e2[_0x42c6('0xa1')](getSelectList(_0x5cd1c0,_0x249f8e,_0xb0cddf,_0x192576[_0x42c6('0xa2')],_0x31457c[_0x42c6('0xa2')],_0x17a4ec));}}});return Promise[_0x42c6('0xa3')](_0x29b2e2);})[_0x42c6('0xf')](function(_0x2de488){_0x37db8a=_0x2de488[0x0];var _0x4f2329=[];var _0x16261d=[];_0x37f3e6['forEach'](function(_0x501bc2){if(!_[_0x42c6('0xa4')](_0x501bc2[_0x42c6('0xa0')])){var _0x3fb279=_0x501bc2[_0x42c6('0xa0')][_0x42c6('0x44')](_0x501bc2[_0x42c6('0xa0')]['lastIndexOf']('.')+0x1);if(_0x3fb279===_0x42c6('0xa5')){_0x4f2329[_0x42c6('0xa1')](getBooleanList(_0x5cd1c0,_0x249f8e,_0x16261d,_0x192576[_0x42c6('0xa2')],_0x501bc2[_0x42c6('0xa2')],_0x17a4ec));}}});return Promise[_0x42c6('0xa3')](_0x4f2329);})[_0x42c6('0xf')](function(_0x24d97d){_0x4c4c21=_0x24d97d[0x0];var _0x4a17d3=[];var _0x8ad618=[];_0x37f3e6[_0x42c6('0xa6')](function(_0x2c4707){if(_0x2c4707['@odata.type']){var _0x3657ef=_0x2c4707['@odata.type'][_0x42c6('0x44')](_0x2c4707['@odata.type']['lastIndexOf']('.')+0x1);if(_0x3657ef===_0x42c6('0xa7')||_0x3657ef===_0x42c6('0xa8')||_0x3657ef===_0x42c6('0xa9')||_0x3657ef===_0x42c6('0xaa')||_0x3657ef==='MemoAttributeMetadata'||_0x3657ef==='DateTimeAttributeMetadata'||_0x3657ef===_0x42c6('0xab')||_0x3657ef===_0x42c6('0xac')||_0x3657ef===_0x42c6('0xad')||_0x3657ef===_0x42c6('0xae')){_0x4a17d3['push'](getInputList(_0x5cd1c0,_0x249f8e,_0x3657ef,_0x8ad618,_0x192576[_0x42c6('0xa2')],_0x2c4707[_0x42c6('0xa2')],_0x17a4ec));}}});return Promise[_0x42c6('0xa3')](_0x4a17d3);})[_0x42c6('0xf')](function(_0x14072c){_0xb71a35=_0x14072c[0x0];var _0x327c71=_0x37db8a[_0x42c6('0x89')](_0x4c4c21)['concat'](_0xb71a35);var _0x4c6743={'count':_0x327c71[_0x42c6('0x23')],'rows':_0x327c71};return _0x4c6743;})[_0x42c6('0xf')](respondWithResult(_0x3f3ed0,null))[_0x42c6('0x37')](function(_0x399256){var _0xa479aa=_0x11f76c[_0x42c6('0x1e')][_0x42c6('0xaf')]?0x1f4:_0x399256[_0x42c6('0xb0')]||0x1f4;logger[_0x42c6('0x13')](_0x399256[_0x42c6('0x14')]);delete _0x399256[_0x42c6('0x15')];if(_0xa479aa===0x191){_0xa479aa=0x190;}_0x3f3ed0[_0x42c6('0x6')](_0xa479aa)['send'](_0x11f76c[_0x42c6('0x1e')][_0x42c6('0xaf')]?{'message':'Wrong\x20credentials','statusCode':_0x399256[_0x42c6('0xb0')]}:_0x399256);});};function getSelectList(_0x27b41c,_0x35a5ee,_0x15936f,_0x439bca,_0x41f9dc,_0xa67e27){var _0x3169f1={'method':_0x42c6('0x97'),'uri':_0x27b41c+'EntityDefinitions('+_0x439bca+')/Attributes('+_0x41f9dc+_0x42c6('0xb1')+_0x42c6('0xb2'),'headers':{'Authorization':'Bearer\x20'+_0xa67e27,'If-None-Match':null,'OData-Version':_0x42c6('0x98')},'json':!![]};return rp(_0x3169f1)[_0x42c6('0xf')](function(_0x37f30b){var _0x4db9d0=[];var _0x265da1=_0x37f30b[_0x42c6('0xb3')][_0x42c6('0xb4')];_0x265da1[_0x42c6('0xa6')](function(_0x535680){_0x4db9d0[_0x42c6('0xa1')]({'name':_0x535680[_0x42c6('0xb5')]['UserLocalizedLabel'][_0x42c6('0xb5')],'value':String(_0x535680[_0x42c6('0xb6')])});});var _0x5c8035={'id':_0x35a5ee+'_'+_0x37f30b['LogicalName'],'name':_0x37f30b[_0x42c6('0xb7')][_0x42c6('0xb8')][_0x42c6('0xb5')],'custom':![],'options':_0x4db9d0};_0x15936f[_0x42c6('0xa1')](_0x5c8035);return _0x15936f;});}function getBooleanList(_0x3d97a6,_0x18ea10,_0x57a6b8,_0x30a3a7,_0x2b2ce4,_0x158d7e){var _0x446b33={'method':'GET','uri':_0x3d97a6+_0x42c6('0x9a')+_0x30a3a7+_0x42c6('0xb9')+_0x2b2ce4+_0x42c6('0xba'),'headers':{'Authorization':'Bearer\x20'+_0x158d7e,'If-None-Match':null,'OData-Version':_0x42c6('0x98')},'json':!![]};return rp(_0x446b33)[_0x42c6('0xf')](function(_0x1293bc){var _0xa25e78=[];_0xa25e78[_0x42c6('0xa1')]({'name':_0x1293bc[_0x42c6('0xb3')][_0x42c6('0xbb')][_0x42c6('0xb5')]['UserLocalizedLabel'][_0x42c6('0xb5')],'value':'true'},{'name':_0x1293bc[_0x42c6('0xb3')]['FalseOption'][_0x42c6('0xb5')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x13d7a0={'id':_0x18ea10+'_'+_0x1293bc['LogicalName'],'name':_0x1293bc['DisplayName'][_0x42c6('0xb8')][_0x42c6('0xb5')],'custom':![],'options':_0xa25e78};_0x57a6b8[_0x42c6('0xa1')](_0x13d7a0);return _0x57a6b8;});}function getInputList(_0xc20be3,_0x6ec0de,_0xfd2315,_0x37e097,_0x553dc6,_0x2ee020,_0x12d262){var _0x33d37b={'method':_0x42c6('0x97'),'uri':_0xc20be3+_0x42c6('0x9a')+_0x553dc6+_0x42c6('0xb9')+_0x2ee020+_0x42c6('0xbc')+_0xfd2315+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x42c6('0x9c')+_0x12d262,'If-None-Match':null,'OData-Version':_0x42c6('0x98')},'json':!![]};return rp(_0x33d37b)[_0x42c6('0xf')](function(_0x22e248){var _0x10fce7={'id':_0x6ec0de+'_'+_0x22e248[_0x42c6('0x9f')],'name':_0x22e248['DisplayName'][_0x42c6('0xb8')]?_0x22e248[_0x42c6('0xb7')][_0x42c6('0xb8')]['Label']:_0x22e248[_0x42c6('0x9f')],'custom':![],'options':[]};_0x37e097[_0x42c6('0xa1')](_0x10fce7);return _0x37e097;});}
\ No newline at end of file
index 267f571..2bd46d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x5bd501,_0x1e6555){var _0x9737d6=function(_0x4bac4a){while(--_0x4bac4a){_0x5bd501['push'](_0x5bd501['shift']());}};_0x9737d6(++_0x1e6555);}(_0xe706,0xa3));var _0x6e70=function(_0x1575cf,_0x1190d4){_0x1575cf=_0x1575cf-0x0;var _0x2b7a4e=_0xe706[_0x1575cf];return _0x2b7a4e;};'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'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2a7f351..55670f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x318b=['findAll','raw','options','where','limit','include','map','attributes','model','GetDynamics365Account','ShowDynamics365Account','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','info','result','catch','Dynamics365Account'];(function(_0x42cc6e,_0x85b033){var _0x4f423c=function(_0xd39e93){while(--_0xd39e93){_0x42cc6e['push'](_0x42cc6e['shift']());}};_0x4f423c(++_0x85b033);}(_0x318b,0x124));var _0xb318=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x318b[_0x3b5ad9];return _0x611ae9;};'use strict';var _=require('lodash');var util=require(_0xb318('0x0'));var moment=require(_0xb318('0x1'));var BPromise=require(_0xb318('0x2'));var rs=require(_0xb318('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb318('0x4'))['db'];var utils=require(_0xb318('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb318('0x6'));var client=jayson[_0xb318('0x7')][_0xb318('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30130a,_0x203e6c,_0x56a933){return new BPromise(function(_0x279c2f,_0x1e30cd){return client[_0xb318('0x9')](_0x30130a,_0x56a933)[_0xb318('0xa')](function(_0x527002){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x203e6c,_0xb318('0xb'));logger[_0xb318('0xc')](_0xb318('0xd'),_0x203e6c,_0xb318('0xb'),JSON[_0xb318('0xe')](_0x527002));if(_0x527002[_0xb318('0xf')]){if(_0x527002[_0xb318('0xf')][_0xb318('0x10')]===0x1f4){logger[_0xb318('0xf')](_0xb318('0x11'),_0x203e6c,_0x527002['error'][_0xb318('0x12')]);return _0x1e30cd(_0x527002[_0xb318('0xf')]['message']);}logger['error'](_0xb318('0x11'),_0x203e6c,_0x527002[_0xb318('0xf')][_0xb318('0x12')]);return _0x279c2f(_0x527002['error'][_0xb318('0x12')]);}else{logger[_0xb318('0x13')](_0xb318('0x11'),_0x203e6c,_0xb318('0xb'));_0x279c2f(_0x527002[_0xb318('0x14')][_0xb318('0x12')]);}})[_0xb318('0x15')](function(_0x2340ba){logger['error'](_0xb318('0x11'),_0x203e6c,_0x2340ba);_0x1e30cd(_0x2340ba);});});}exports['GetDynamics365Account']=function(_0x1edc9d){var _0x1b5fc6=this;return new Promise(function(_0x368b7c,_0x2ec2ac){return db[_0xb318('0x16')][_0xb318('0x17')]({'raw':_0x1edc9d['options']?_0x1edc9d['options'][_0xb318('0x18')]===undefined?!![]:![]:!![],'where':_0x1edc9d[_0xb318('0x19')]?_0x1edc9d[_0xb318('0x19')][_0xb318('0x1a')]||null:null,'attributes':_0x1edc9d[_0xb318('0x19')]?_0x1edc9d[_0xb318('0x19')]['attributes']||null:null,'limit':_0x1edc9d[_0xb318('0x19')]?_0x1edc9d[_0xb318('0x19')][_0xb318('0x1b')]||null:null,'include':_0x1edc9d[_0xb318('0x19')]?_0x1edc9d[_0xb318('0x19')][_0xb318('0x1c')]?_[_0xb318('0x1d')](_0x1edc9d[_0xb318('0x19')]['include'],function(_0x5422c5){return{'model':db[_0x5422c5['model']],'as':_0x5422c5['as'],'attributes':_0x5422c5[_0xb318('0x1e')],'include':_0x5422c5[_0xb318('0x1c')]?_['map'](_0x5422c5[_0xb318('0x1c')],function(_0x350bcf){return{'model':db[_0x350bcf['model']],'as':_0x350bcf['as'],'attributes':_0x350bcf['attributes'],'include':_0x350bcf['include']?_[_0xb318('0x1d')](_0x350bcf[_0xb318('0x1c')],function(_0x45fccc){return{'model':db[_0x45fccc[_0xb318('0x1f')]],'as':_0x45fccc['as'],'attributes':_0x45fccc['attributes']};}):[]};}):[]};}):[]:[]})[_0xb318('0xa')](function(_0x11614a){logger[_0xb318('0x13')](_0xb318('0x20'),_0x1edc9d);logger[_0xb318('0xc')](_0xb318('0x20'),_0x1edc9d,JSON[_0xb318('0xe')](_0x11614a));_0x368b7c(_0x11614a);})[_0xb318('0x15')](function(_0x34b6e1){logger['error'](_0xb318('0x20'),_0x34b6e1[_0xb318('0x12')],_0x1edc9d);_0x2ec2ac(_0x1b5fc6[_0xb318('0xf')](0x1f4,_0x34b6e1[_0xb318('0x12')]));});});};exports[_0xb318('0x21')]=function(_0x307ed9){var _0x5d257e=this;return new Promise(function(_0x2ff359,_0x67f49b){return db['Dynamics365Account'][_0xb318('0x22')]({'raw':_0x307ed9['options']?_0x307ed9[_0xb318('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x307ed9[_0xb318('0x19')]?_0x307ed9[_0xb318('0x19')][_0xb318('0x1a')]||null:null,'attributes':_0x307ed9[_0xb318('0x19')]?_0x307ed9[_0xb318('0x19')][_0xb318('0x1e')]||null:null,'include':_0x307ed9[_0xb318('0x19')]?_0x307ed9[_0xb318('0x19')][_0xb318('0x1c')]?_[_0xb318('0x1d')](_0x307ed9['options'][_0xb318('0x1c')],function(_0x242c0a){return{'model':db[_0x242c0a[_0xb318('0x1f')]],'as':_0x242c0a['as'],'attributes':_0x242c0a[_0xb318('0x1e')],'include':_0x242c0a[_0xb318('0x1c')]?_[_0xb318('0x1d')](_0x242c0a[_0xb318('0x1c')],function(_0x3f594e){return{'model':db[_0x3f594e[_0xb318('0x1f')]],'as':_0x3f594e['as'],'attributes':_0x3f594e[_0xb318('0x1e')],'include':_0x3f594e['include']?_[_0xb318('0x1d')](_0x3f594e[_0xb318('0x1c')],function(_0x3ef512){return{'model':db[_0x3ef512[_0xb318('0x1f')]],'as':_0x3ef512['as'],'attributes':_0x3ef512[_0xb318('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb318('0xa')](function(_0x1f8bb0){logger[_0xb318('0x13')](_0xb318('0x21'),_0x307ed9);logger[_0xb318('0xc')](_0xb318('0x21'),_0x307ed9,JSON[_0xb318('0xe')](_0x1f8bb0));_0x2ff359(_0x1f8bb0);})[_0xb318('0x15')](function(_0x3a41bd){logger[_0xb318('0xf')](_0xb318('0x21'),_0x3a41bd[_0xb318('0x12')],_0x307ed9);_0x67f49b(_0x5d257e[_0xb318('0xf')](0x1f4,_0x3a41bd['message']));});});};
\ No newline at end of file
+var _0xd44e=['map','model','then','info','debug','find','raw','ShowDynamics365Account','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','catch','GetDynamics365Account','Dynamics365Account','options','attributes','include'];(function(_0x24a9e4,_0xa3a48a){var _0x3b3c17=function(_0x294405){while(--_0x294405){_0x24a9e4['push'](_0x24a9e4['shift']());}};_0x3b3c17(++_0xa3a48a);}(_0xd44e,0x68));var _0xed44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd44e[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xed44('0x0'));var moment=require(_0xed44('0x1'));var BPromise=require(_0xed44('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed44('0x3'));var db=require(_0xed44('0x4'))['db'];var utils=require(_0xed44('0x5'));var logger=require(_0xed44('0x6'))(_0xed44('0x7'));var config=require('../../config/environment');var jayson=require(_0xed44('0x8'));var client=jayson[_0xed44('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x180b46,_0x2d22d1,_0x1dc5e1){return new BPromise(function(_0x18bffd,_0x1f0502){return client[_0xed44('0xa')](_0x180b46,_0x1dc5e1)['then'](function(_0x3cd396){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x2d22d1,_0xed44('0xb'));logger['debug'](_0xed44('0xc'),_0x2d22d1,'request\x20sent',JSON[_0xed44('0xd')](_0x3cd396));if(_0x3cd396[_0xed44('0xe')]){if(_0x3cd396[_0xed44('0xe')][_0xed44('0xf')]===0x1f4){logger[_0xed44('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x2d22d1,_0x3cd396['error'][_0xed44('0x10')]);return _0x1f0502(_0x3cd396['error'][_0xed44('0x10')]);}logger['error'](_0xed44('0x11'),_0x2d22d1,_0x3cd396[_0xed44('0xe')][_0xed44('0x10')]);return _0x18bffd(_0x3cd396[_0xed44('0xe')][_0xed44('0x10')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x2d22d1,_0xed44('0xb'));_0x18bffd(_0x3cd396['result'][_0xed44('0x10')]);}})[_0xed44('0x12')](function(_0x1f65e6){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x2d22d1,_0x1f65e6);_0x1f0502(_0x1f65e6);});});}exports[_0xed44('0x13')]=function(_0x39542c){var _0x4174a9=this;return new Promise(function(_0x47ada2,_0x120c96){return db[_0xed44('0x14')]['findAll']({'raw':_0x39542c['options']?_0x39542c['options']['raw']===undefined?!![]:![]:!![],'where':_0x39542c[_0xed44('0x15')]?_0x39542c[_0xed44('0x15')]['where']||null:null,'attributes':_0x39542c[_0xed44('0x15')]?_0x39542c[_0xed44('0x15')][_0xed44('0x16')]||null:null,'limit':_0x39542c['options']?_0x39542c[_0xed44('0x15')]['limit']||null:null,'include':_0x39542c[_0xed44('0x15')]?_0x39542c['options'][_0xed44('0x17')]?_[_0xed44('0x18')](_0x39542c[_0xed44('0x15')][_0xed44('0x17')],function(_0x373a90){return{'model':db[_0x373a90[_0xed44('0x19')]],'as':_0x373a90['as'],'attributes':_0x373a90[_0xed44('0x16')],'include':_0x373a90[_0xed44('0x17')]?_[_0xed44('0x18')](_0x373a90[_0xed44('0x17')],function(_0x55e6ed){return{'model':db[_0x55e6ed[_0xed44('0x19')]],'as':_0x55e6ed['as'],'attributes':_0x55e6ed[_0xed44('0x16')],'include':_0x55e6ed[_0xed44('0x17')]?_[_0xed44('0x18')](_0x55e6ed[_0xed44('0x17')],function(_0x3a84c1){return{'model':db[_0x3a84c1[_0xed44('0x19')]],'as':_0x3a84c1['as'],'attributes':_0x3a84c1[_0xed44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xed44('0x1a')](function(_0x5bdece){logger[_0xed44('0x1b')](_0xed44('0x13'),_0x39542c);logger[_0xed44('0x1c')](_0xed44('0x13'),_0x39542c,JSON['stringify'](_0x5bdece));_0x47ada2(_0x5bdece);})[_0xed44('0x12')](function(_0x560a6e){logger[_0xed44('0xe')](_0xed44('0x13'),_0x560a6e[_0xed44('0x10')],_0x39542c);_0x120c96(_0x4174a9[_0xed44('0xe')](0x1f4,_0x560a6e[_0xed44('0x10')]));});});};exports['ShowDynamics365Account']=function(_0x5a3970){var _0x3e991c=this;return new Promise(function(_0x35ffb5,_0x1bf06d){return db[_0xed44('0x14')][_0xed44('0x1d')]({'raw':_0x5a3970[_0xed44('0x15')]?_0x5a3970['options'][_0xed44('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a3970['options']?_0x5a3970[_0xed44('0x15')]['where']||null:null,'attributes':_0x5a3970['options']?_0x5a3970[_0xed44('0x15')][_0xed44('0x16')]||null:null,'include':_0x5a3970[_0xed44('0x15')]?_0x5a3970[_0xed44('0x15')][_0xed44('0x17')]?_[_0xed44('0x18')](_0x5a3970[_0xed44('0x15')][_0xed44('0x17')],function(_0x519e38){return{'model':db[_0x519e38['model']],'as':_0x519e38['as'],'attributes':_0x519e38[_0xed44('0x16')],'include':_0x519e38['include']?_['map'](_0x519e38[_0xed44('0x17')],function(_0x112224){return{'model':db[_0x112224['model']],'as':_0x112224['as'],'attributes':_0x112224[_0xed44('0x16')],'include':_0x112224[_0xed44('0x17')]?_[_0xed44('0x18')](_0x112224[_0xed44('0x17')],function(_0x3e3a1b){return{'model':db[_0x3e3a1b[_0xed44('0x19')]],'as':_0x3e3a1b['as'],'attributes':_0x3e3a1b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xcfbeed){logger[_0xed44('0x1b')]('ShowDynamics365Account',_0x5a3970);logger[_0xed44('0x1c')](_0xed44('0x1f'),_0x5a3970,JSON[_0xed44('0xd')](_0xcfbeed));_0x35ffb5(_0xcfbeed);})[_0xed44('0x12')](function(_0x42afe3){logger['error'](_0xed44('0x1f'),_0x42afe3['message'],_0x5a3970);_0x1bf06d(_0x3e991c['error'](0x1f4,_0x42afe3[_0xed44('0x10')]));});});};
\ No newline at end of file
index 02b25b4..8eab93f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01b5=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','delete','/:id'];(function(_0xf3c843,_0x8ff24e){var _0x3191c6=function(_0x2f1ef7){while(--_0x2f1ef7){_0xf3c843['push'](_0xf3c843['shift']());}};_0x3191c6(++_0x8ff24e);}(_0x01b5,0xca));var _0x501b=function(_0x1093dc,_0xa31577){_0x1093dc=_0x1093dc-0x0;var _0x53bdb3=_0x01b5[_0x1093dc];return _0x53bdb3;};'use strict';var multer=require(_0x501b('0x0'));var util=require(_0x501b('0x1'));var path=require(_0x501b('0x2'));var timeout=require(_0x501b('0x3'));var express=require(_0x501b('0x4'));var router=express[_0x501b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x501b('0x6'));var interaction=require(_0x501b('0x7'));var config=require(_0x501b('0x8'));var controller=require(_0x501b('0x9'));router['get']('/',auth[_0x501b('0xa')](),controller[_0x501b('0xb')]);router[_0x501b('0xc')]('/:id',auth[_0x501b('0xa')](),controller[_0x501b('0xd')]);router[_0x501b('0xc')]('/:id/fields',auth[_0x501b('0xa')](),controller[_0x501b('0xe')]);router[_0x501b('0xc')](_0x501b('0xf'),auth[_0x501b('0xa')](),controller[_0x501b('0x10')]);router[_0x501b('0xc')](_0x501b('0x11'),auth[_0x501b('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x501b('0xa')](),controller[_0x501b('0x12')]);router[_0x501b('0x13')]('/:id',auth[_0x501b('0xa')](),controller[_0x501b('0x14')]);router[_0x501b('0x15')](_0x501b('0x16'),auth[_0x501b('0xa')](),controller[_0x501b('0x17')]);module[_0x501b('0x18')]=router;
\ No newline at end of file
+var _0x666b=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','/:id'];(function(_0x3442b1,_0x31e08e){var _0x18cba9=function(_0x1eddea){while(--_0x1eddea){_0x3442b1['push'](_0x3442b1['shift']());}};_0x18cba9(++_0x31e08e);}(_0x666b,0x107));var _0xb666=function(_0x87f0c0,_0x321bb0){_0x87f0c0=_0x87f0c0-0x0;var _0x1fd1b0=_0x666b[_0x87f0c0];return _0x1fd1b0;};'use strict';var multer=require(_0xb666('0x0'));var util=require(_0xb666('0x1'));var path=require(_0xb666('0x2'));var timeout=require(_0xb666('0x3'));var express=require(_0xb666('0x4'));var router=express[_0xb666('0x5')]();var fs_extra=require(_0xb666('0x6'));var auth=require(_0xb666('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb666('0x8'));router[_0xb666('0x9')]('/',auth[_0xb666('0xa')](),controller['index']);router[_0xb666('0x9')](_0xb666('0xb'),auth[_0xb666('0xa')](),controller[_0xb666('0xc')]);router['get'](_0xb666('0xd'),auth['isAuthenticated'](),controller[_0xb666('0xe')]);router['get'](_0xb666('0xf'),auth[_0xb666('0xa')](),controller[_0xb666('0x10')]);router[_0xb666('0x9')](_0xb666('0x11'),auth[_0xb666('0xa')](),controller[_0xb666('0x12')]);router[_0xb666('0x13')]('/',auth['isAuthenticated'](),controller[_0xb666('0x14')]);router[_0xb666('0x15')](_0xb666('0xb'),auth[_0xb666('0xa')](),controller[_0xb666('0x16')]);router[_0xb666('0x17')](_0xb666('0xb'),auth[_0xb666('0xa')](),controller[_0xb666('0x18')]);module['exports']=router;
\ No newline at end of file
index 1bf99b7..82fd205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x606b=['sequelize','exports','STRING','ENUM','incident','contact','nothing'];(function(_0x184cd5,_0x53175b){var _0x3e9506=function(_0x8bf4f8){while(--_0x8bf4f8){_0x184cd5['push'](_0x184cd5['shift']());}};_0x3e9506(++_0x53175b);}(_0x606b,0x126));var _0xb606=function(_0x43911d,_0x23284d){_0x43911d=_0x43911d-0x0;var _0x4c2e13=_0x606b[_0x43911d];return _0x4c2e13;};'use strict';var Sequelize=require(_0xb606('0x0'));module[_0xb606('0x1')]={'name':{'type':Sequelize[_0xb606('0x2')]},'description':{'type':Sequelize[_0xb606('0x2')]},'ticketType':{'type':Sequelize[_0xb606('0x3')](_0xb606('0x4'),'phonecall'),'defaultValue':_0xb606('0x4')},'moduleCreate':{'type':Sequelize[_0xb606('0x3')](_0xb606('0x5'),_0xb606('0x6')),'defaultValue':_0xb606('0x5'),'allowNull':![]}};
\ No newline at end of file
+var _0xcf18=['contact','sequelize','exports','STRING','ENUM','incident','phonecall','nothing'];(function(_0x5e6ae0,_0x484a29){var _0x5e25d2=function(_0x5ec374){while(--_0x5ec374){_0x5e6ae0['push'](_0x5e6ae0['shift']());}};_0x5e25d2(++_0x484a29);}(_0xcf18,0x131));var _0x8cf1=function(_0x2e9736,_0x159e11){_0x2e9736=_0x2e9736-0x0;var _0x37bdc7=_0xcf18[_0x2e9736];return _0x37bdc7;};'use strict';var Sequelize=require(_0x8cf1('0x0'));module[_0x8cf1('0x1')]={'name':{'type':Sequelize[_0x8cf1('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x8cf1('0x3')](_0x8cf1('0x4'),_0x8cf1('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x8cf1('0x3')]('contact',_0x8cf1('0x6')),'defaultValue':_0x8cf1('0x7'),'allowNull':![]}};
\ No newline at end of file
index 30e3dc2..c318f6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd50=['nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','Dynamics365Field','getSubjects'];(function(_0x12a9c9,_0x4b2e49){var _0x1beb21=function(_0xfa8d5d){while(--_0xfa8d5d){_0x12a9c9['push'](_0x12a9c9['shift']());}};_0x1beb21(++_0x4b2e49);}(_0xfd50,0x1ee));var _0x0fd5=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfd50[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x0fd5('0x0'));var rimraf=require(_0x0fd5('0x1'));var zipdir=require(_0x0fd5('0x2'));var jsonpatch=require(_0x0fd5('0x3'));var rp=require(_0x0fd5('0x4'));var moment=require(_0x0fd5('0x5'));var BPromise=require(_0x0fd5('0x6'));var Mustache=require(_0x0fd5('0x7'));var util=require(_0x0fd5('0x8'));var path=require(_0x0fd5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0fd5('0xa'));var fs=require('fs');var fs_extra=require(_0x0fd5('0xb'));var _=require(_0x0fd5('0xc'));var squel=require(_0x0fd5('0xd'));var crypto=require(_0x0fd5('0xe'));var jsforce=require(_0x0fd5('0xf'));var deskjs=require(_0x0fd5('0x10'));var toCsv=require(_0x0fd5('0x11'));var querystring=require(_0x0fd5('0x12'));var Papa=require('papaparse');var Redis=require(_0x0fd5('0x13'));var authService=require(_0x0fd5('0x14'));var qs=require(_0x0fd5('0x15'));var as=require(_0x0fd5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd5('0x17'))(_0x0fd5('0x18'));var utils=require(_0x0fd5('0x19'));var config=require(_0x0fd5('0x1a'));var licenseUtil=require(_0x0fd5('0x1b'));var db=require(_0x0fd5('0x1c'))['db'];function respondWithStatusCode(_0x489a2c,_0x568d2b){_0x568d2b=_0x568d2b||0xcc;return function(_0x5c21fd){if(_0x5c21fd){return _0x489a2c[_0x0fd5('0x1d')](_0x568d2b);}return _0x489a2c['status'](_0x568d2b)[_0x0fd5('0x1e')]();};}function respondWithResult(_0x3b82b0,_0x1edb1c){_0x1edb1c=_0x1edb1c||0xc8;return function(_0x3d1815){if(_0x3d1815){return _0x3b82b0[_0x0fd5('0x1f')](_0x1edb1c)['json'](_0x3d1815);}};}function respondWithFilteredResult(_0x3216ce,_0x500861){return function(_0x195ee4){if(_0x195ee4){var _0x35bab3=typeof _0x500861[_0x0fd5('0x20')]===_0x0fd5('0x21')&&typeof _0x500861[_0x0fd5('0x22')]===_0x0fd5('0x21');var _0x3eceb4=_0x195ee4[_0x0fd5('0x23')];var _0x2baa6d=_0x35bab3?0x0:_0x500861['offset'];var _0x6c12eb=_0x35bab3?_0x195ee4[_0x0fd5('0x23')]:_0x500861[_0x0fd5('0x20')]+_0x500861['limit'];var _0xb404df;if(_0x6c12eb>=_0x3eceb4){_0x6c12eb=_0x3eceb4;_0xb404df=0xc8;}else{_0xb404df=0xce;}_0x3216ce[_0x0fd5('0x1f')](_0xb404df);return _0x3216ce[_0x0fd5('0x24')](_0x0fd5('0x25'),_0x2baa6d+'-'+_0x6c12eb+'/'+_0x3eceb4)['json'](_0x195ee4);}return null;};}function patchUpdates(_0x30297c){return function(_0x4879e1){try{jsonpatch['apply'](_0x4879e1,_0x30297c,!![]);}catch(_0x24ffd2){return BPromise['reject'](_0x24ffd2);}return _0x4879e1['save']();};}function saveUpdates(_0x3960d0,_0x3e8d23){return function(_0x41fc1f){if(_0x41fc1f){return _0x41fc1f[_0x0fd5('0x26')](_0x3960d0)[_0x0fd5('0x27')](function(_0x508c03){return _0x508c03;});}return null;};}function removeEntity(_0xea574e,_0x4eb079){return function(_0x4dde83){if(_0x4dde83){return _0x4dde83['destroy']()[_0x0fd5('0x27')](function(){_0xea574e[_0x0fd5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36a355,_0x1f5014){return function(_0xac1a53){if(!_0xac1a53){_0x36a355['sendStatus'](0x194);}return _0xac1a53;};}function handleError(_0x9c4f89,_0x4719d8){_0x4719d8=_0x4719d8||0x1f4;return function(_0x1afe5f){logger[_0x0fd5('0x28')](_0x1afe5f[_0x0fd5('0x29')]);if(_0x1afe5f['name']){delete _0x1afe5f[_0x0fd5('0x2a')];}_0x9c4f89[_0x0fd5('0x1f')](_0x4719d8)[_0x0fd5('0x2b')](_0x1afe5f);};}exports['index']=function(_0x120aff,_0xeb7ac4){var _0x174ee9={},_0x52540a={},_0x343e10={'count':0x0,'rows':[]};var _0x49c59d=_['map'](db['Dynamics365Configuration'][_0x0fd5('0x2c')],function(_0x5ab267){return{'name':_0x5ab267[_0x0fd5('0x2d')],'type':_0x5ab267[_0x0fd5('0x2e')][_0x0fd5('0x2f')]};});_0x52540a[_0x0fd5('0x30')]=_[_0x0fd5('0x31')](_0x49c59d,_0x0fd5('0x2a'));_0x52540a['query']=_[_0x0fd5('0x32')](_0x120aff[_0x0fd5('0x33')]);_0x52540a[_0x0fd5('0x34')]=_['intersection'](_0x52540a[_0x0fd5('0x30')],_0x52540a[_0x0fd5('0x33')]);_0x174ee9[_0x0fd5('0x35')]=_[_0x0fd5('0x36')](_0x52540a['model'],qs[_0x0fd5('0x37')](_0x120aff[_0x0fd5('0x33')][_0x0fd5('0x37')]));_0x174ee9['attributes']=_0x174ee9[_0x0fd5('0x35')][_0x0fd5('0x38')]?_0x174ee9[_0x0fd5('0x35')]:_0x52540a['model'];if(!_0x120aff[_0x0fd5('0x33')][_0x0fd5('0x39')]('nolimit')){_0x174ee9[_0x0fd5('0x22')]=qs['limit'](_0x120aff[_0x0fd5('0x33')][_0x0fd5('0x22')]);_0x174ee9[_0x0fd5('0x20')]=qs['offset'](_0x120aff[_0x0fd5('0x33')][_0x0fd5('0x20')]);}_0x174ee9[_0x0fd5('0x3a')]=qs[_0x0fd5('0x3b')](_0x120aff[_0x0fd5('0x33')]['sort']);_0x174ee9[_0x0fd5('0x3c')]=qs[_0x0fd5('0x34')](_[_0x0fd5('0x3d')](_0x120aff[_0x0fd5('0x33')],_0x52540a[_0x0fd5('0x34')]),_0x49c59d);if(_0x120aff[_0x0fd5('0x33')][_0x0fd5('0x3e')]){_0x174ee9[_0x0fd5('0x3c')]=_[_0x0fd5('0x3f')](_0x174ee9[_0x0fd5('0x3c')],{'$or':_[_0x0fd5('0x31')](_0x49c59d,function(_0x6e523a){if(_0x6e523a['type']!=='VIRTUAL'){var _0x1f6c6d={};_0x1f6c6d[_0x6e523a[_0x0fd5('0x2a')]]={'$like':'%'+_0x120aff[_0x0fd5('0x33')][_0x0fd5('0x3e')]+'%'};return _0x1f6c6d;}})});}_0x174ee9=_['merge']({},_0x174ee9,_0x120aff[_0x0fd5('0x40')]);var _0x2a9eef={'where':_0x174ee9[_0x0fd5('0x3c')]};return db[_0x0fd5('0x41')]['count'](_0x2a9eef)[_0x0fd5('0x27')](function(_0x18ba15){_0x343e10[_0x0fd5('0x23')]=_0x18ba15;if(_0x120aff['query'][_0x0fd5('0x42')]){_0x174ee9[_0x0fd5('0x43')]=[{'all':!![]}];}return db[_0x0fd5('0x41')][_0x0fd5('0x44')](_0x174ee9);})[_0x0fd5('0x27')](function(_0x24c178){_0x343e10[_0x0fd5('0x45')]=_0x24c178;return _0x343e10;})[_0x0fd5('0x27')](respondWithFilteredResult(_0xeb7ac4,_0x174ee9))[_0x0fd5('0x46')](handleError(_0xeb7ac4,null));};exports[_0x0fd5('0x47')]=function(_0x25dadc,_0x4a105a){var _0x3fce5e={'raw':![],'where':{'id':_0x25dadc[_0x0fd5('0x48')]['id']}},_0x501e4e={};_0x501e4e[_0x0fd5('0x30')]=_[_0x0fd5('0x32')](db[_0x0fd5('0x41')]['rawAttributes']);_0x501e4e['query']=_[_0x0fd5('0x32')](_0x25dadc[_0x0fd5('0x33')]);_0x501e4e[_0x0fd5('0x34')]=_[_0x0fd5('0x36')](_0x501e4e[_0x0fd5('0x30')],_0x501e4e[_0x0fd5('0x33')]);_0x3fce5e['attributes']=_[_0x0fd5('0x36')](_0x501e4e['model'],qs[_0x0fd5('0x37')](_0x25dadc['query'][_0x0fd5('0x37')]));_0x3fce5e[_0x0fd5('0x35')]=_0x3fce5e[_0x0fd5('0x35')][_0x0fd5('0x38')]?_0x3fce5e[_0x0fd5('0x35')]:_0x501e4e[_0x0fd5('0x30')];if(_0x25dadc['query'][_0x0fd5('0x42')]){_0x3fce5e['include']=[{'all':!![]}];}_0x3fce5e=_[_0x0fd5('0x3f')]({},_0x3fce5e,_0x25dadc[_0x0fd5('0x40')]);return db[_0x0fd5('0x41')]['find'](_0x3fce5e)[_0x0fd5('0x27')](handleEntityNotFound(_0x4a105a,null))[_0x0fd5('0x27')](respondWithResult(_0x4a105a,null))['catch'](handleError(_0x4a105a,null));};exports[_0x0fd5('0x49')]=function(_0x46451d,_0x590b0f){return db[_0x0fd5('0x41')][_0x0fd5('0x49')](_0x46451d['body'],{})[_0x0fd5('0x27')](respondWithResult(_0x590b0f,0xc9))[_0x0fd5('0x46')](handleError(_0x590b0f,null));};exports['update']=function(_0x225848,_0x4f8928){if(_0x225848[_0x0fd5('0x4a')]['id']){delete _0x225848[_0x0fd5('0x4a')]['id'];}return db[_0x0fd5('0x41')][_0x0fd5('0x4b')]({'where':{'id':_0x225848[_0x0fd5('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f8928,null))[_0x0fd5('0x27')](saveUpdates(_0x225848['body'],null))[_0x0fd5('0x27')](respondWithResult(_0x4f8928,null))[_0x0fd5('0x46')](handleError(_0x4f8928,null));};exports['destroy']=function(_0x19d277,_0x146bb6){return db['Dynamics365Configuration'][_0x0fd5('0x4b')]({'where':{'id':_0x19d277[_0x0fd5('0x48')]['id']}})[_0x0fd5('0x27')](handleEntityNotFound(_0x146bb6,null))[_0x0fd5('0x27')](removeEntity(_0x146bb6,null))[_0x0fd5('0x46')](handleError(_0x146bb6,null));};exports[_0x0fd5('0x4c')]=function(_0x4c1f75,_0x3855bc,_0x4deb44){var _0x21409c={};var _0x4cfe27={};var _0x409667;var _0x27c779;return db['Dynamics365Configuration'][_0x0fd5('0x4d')]({'where':{'id':_0x4c1f75['params']['id']}})[_0x0fd5('0x27')](handleEntityNotFound(_0x3855bc,null))[_0x0fd5('0x27')](function(_0x53eb8f){if(_0x53eb8f){_0x409667=_0x53eb8f;_0x4cfe27['model']=_['keys'](db[_0x0fd5('0x4e')][_0x0fd5('0x2c')]);_0x4cfe27[_0x0fd5('0x33')]=_[_0x0fd5('0x32')](_0x4c1f75['query']);_0x4cfe27[_0x0fd5('0x34')]=_[_0x0fd5('0x36')](_0x4cfe27[_0x0fd5('0x30')],_0x4cfe27[_0x0fd5('0x33')]);_0x21409c[_0x0fd5('0x35')]=_[_0x0fd5('0x36')](_0x4cfe27['model'],qs[_0x0fd5('0x37')](_0x4c1f75['query'][_0x0fd5('0x37')]));_0x21409c[_0x0fd5('0x35')]=_0x21409c[_0x0fd5('0x35')]['length']?_0x21409c[_0x0fd5('0x35')]:_0x4cfe27['model'];_0x21409c[_0x0fd5('0x3a')]=qs[_0x0fd5('0x3b')](_0x4c1f75['query']['sort']);_0x21409c[_0x0fd5('0x3c')]=qs[_0x0fd5('0x34')](_[_0x0fd5('0x3d')](_0x4c1f75[_0x0fd5('0x33')],_0x4cfe27[_0x0fd5('0x34')]));if(_0x4c1f75[_0x0fd5('0x33')][_0x0fd5('0x3e')]){_0x21409c[_0x0fd5('0x3c')]=_[_0x0fd5('0x3f')](_0x21409c[_0x0fd5('0x3c')],{'$or':_[_0x0fd5('0x31')](_0x21409c[_0x0fd5('0x35')],function(_0x3b7624){var _0x5a4c65={};_0x5a4c65[_0x3b7624]={'$like':'%'+_0x4c1f75[_0x0fd5('0x33')][_0x0fd5('0x3e')]+'%'};return _0x5a4c65;})});}_0x21409c=_['merge']({},_0x21409c,_0x4c1f75[_0x0fd5('0x40')]);return _0x409667[_0x0fd5('0x4c')](_0x21409c);}})[_0x0fd5('0x27')](function(_0xe239d7){if(_0xe239d7){_0x27c779=_0xe239d7[_0x0fd5('0x38')];if(!_0x4c1f75[_0x0fd5('0x33')][_0x0fd5('0x39')]('nolimit')){_0x21409c['limit']=qs['limit'](_0x4c1f75[_0x0fd5('0x33')]['limit']);_0x21409c[_0x0fd5('0x20')]=qs[_0x0fd5('0x20')](_0x4c1f75['query'][_0x0fd5('0x20')]);}return _0x409667[_0x0fd5('0x4c')](_0x21409c);}})[_0x0fd5('0x27')](function(_0xbfcc74){if(_0xbfcc74){return _0xbfcc74?{'count':_0x27c779,'rows':_0xbfcc74}:null;}})[_0x0fd5('0x27')](respondWithResult(_0x3855bc,null))[_0x0fd5('0x46')](handleError(_0x3855bc,null));};exports[_0x0fd5('0x4f')]=function(_0x18fe18,_0x3a46f9,_0x1350d5){var _0x4f71b4={};var _0x17a7fe={};var _0x4ebfe2;var _0x830ed9;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x18fe18['params']['id']}})['then'](handleEntityNotFound(_0x3a46f9,null))[_0x0fd5('0x27')](function(_0x39939f){if(_0x39939f){_0x4ebfe2=_0x39939f;_0x17a7fe[_0x0fd5('0x30')]=_[_0x0fd5('0x32')](db[_0x0fd5('0x4e')][_0x0fd5('0x2c')]);_0x17a7fe['query']=_['keys'](_0x18fe18[_0x0fd5('0x33')]);_0x17a7fe[_0x0fd5('0x34')]=_['intersection'](_0x17a7fe[_0x0fd5('0x30')],_0x17a7fe[_0x0fd5('0x33')]);_0x4f71b4[_0x0fd5('0x35')]=_[_0x0fd5('0x36')](_0x17a7fe[_0x0fd5('0x30')],qs[_0x0fd5('0x37')](_0x18fe18['query'][_0x0fd5('0x37')]));_0x4f71b4[_0x0fd5('0x35')]=_0x4f71b4['attributes'][_0x0fd5('0x38')]?_0x4f71b4[_0x0fd5('0x35')]:_0x17a7fe[_0x0fd5('0x30')];_0x4f71b4[_0x0fd5('0x3a')]=qs[_0x0fd5('0x3b')](_0x18fe18[_0x0fd5('0x33')]['sort']);_0x4f71b4[_0x0fd5('0x3c')]=qs[_0x0fd5('0x34')](_['pick'](_0x18fe18[_0x0fd5('0x33')],_0x17a7fe['filters']));if(_0x18fe18[_0x0fd5('0x33')]['filter']){_0x4f71b4[_0x0fd5('0x3c')]=_['merge'](_0x4f71b4[_0x0fd5('0x3c')],{'$or':_['map'](_0x4f71b4[_0x0fd5('0x35')],function(_0x499d13){var _0x489ad2={};_0x489ad2[_0x499d13]={'$like':'%'+_0x18fe18[_0x0fd5('0x33')][_0x0fd5('0x3e')]+'%'};return _0x489ad2;})});}_0x4f71b4=_[_0x0fd5('0x3f')]({},_0x4f71b4,_0x18fe18[_0x0fd5('0x40')]);return _0x4ebfe2[_0x0fd5('0x4f')](_0x4f71b4);}})[_0x0fd5('0x27')](function(_0xc527b1){if(_0xc527b1){_0x830ed9=_0xc527b1[_0x0fd5('0x38')];if(!_0x18fe18['query'][_0x0fd5('0x39')](_0x0fd5('0x50'))){_0x4f71b4[_0x0fd5('0x22')]=qs[_0x0fd5('0x22')](_0x18fe18['query']['limit']);_0x4f71b4[_0x0fd5('0x20')]=qs[_0x0fd5('0x20')](_0x18fe18[_0x0fd5('0x33')]['offset']);}return _0x4ebfe2[_0x0fd5('0x4f')](_0x4f71b4);}})[_0x0fd5('0x27')](function(_0x18a9c2){if(_0x18a9c2){return _0x18a9c2?{'count':_0x830ed9,'rows':_0x18a9c2}:null;}})[_0x0fd5('0x27')](respondWithResult(_0x3a46f9,null))['catch'](handleError(_0x3a46f9,null));};exports[_0x0fd5('0x51')]=function(_0x554fae,_0x4636c3,_0x8aad07){var _0x1c08c0={};var _0x5a4dea={};var _0x208b58;var _0x2fa89e;return db['Dynamics365Configuration'][_0x0fd5('0x4d')]({'where':{'id':_0x554fae['params']['id']}})[_0x0fd5('0x27')](handleEntityNotFound(_0x4636c3,null))[_0x0fd5('0x27')](function(_0xe57c0e){if(_0xe57c0e){_0x208b58=_0xe57c0e;_0x5a4dea[_0x0fd5('0x30')]=_['keys'](db[_0x0fd5('0x4e')][_0x0fd5('0x2c')]);_0x5a4dea[_0x0fd5('0x33')]=_[_0x0fd5('0x32')](_0x554fae['query']);_0x5a4dea[_0x0fd5('0x34')]=_[_0x0fd5('0x36')](_0x5a4dea[_0x0fd5('0x30')],_0x5a4dea['query']);_0x1c08c0[_0x0fd5('0x35')]=_[_0x0fd5('0x36')](_0x5a4dea[_0x0fd5('0x30')],qs['fields'](_0x554fae[_0x0fd5('0x33')][_0x0fd5('0x37')]));_0x1c08c0[_0x0fd5('0x35')]=_0x1c08c0[_0x0fd5('0x35')][_0x0fd5('0x38')]?_0x1c08c0[_0x0fd5('0x35')]:_0x5a4dea[_0x0fd5('0x30')];_0x1c08c0[_0x0fd5('0x3a')]=qs['sort'](_0x554fae['query'][_0x0fd5('0x3b')]);_0x1c08c0['where']=qs[_0x0fd5('0x34')](_['pick'](_0x554fae[_0x0fd5('0x33')],_0x5a4dea[_0x0fd5('0x34')]));if(_0x554fae[_0x0fd5('0x33')][_0x0fd5('0x3e')]){_0x1c08c0[_0x0fd5('0x3c')]=_[_0x0fd5('0x3f')](_0x1c08c0[_0x0fd5('0x3c')],{'$or':_[_0x0fd5('0x31')](_0x1c08c0[_0x0fd5('0x35')],function(_0x5ddd70){var _0x8d8b59={};_0x8d8b59[_0x5ddd70]={'$like':'%'+_0x554fae[_0x0fd5('0x33')][_0x0fd5('0x3e')]+'%'};return _0x8d8b59;})});}_0x1c08c0=_[_0x0fd5('0x3f')]({},_0x1c08c0,_0x554fae[_0x0fd5('0x40')]);return _0x208b58['getDescriptions'](_0x1c08c0);}})['then'](function(_0x4c77f5){if(_0x4c77f5){_0x2fa89e=_0x4c77f5[_0x0fd5('0x38')];if(!_0x554fae[_0x0fd5('0x33')][_0x0fd5('0x39')](_0x0fd5('0x50'))){_0x1c08c0[_0x0fd5('0x22')]=qs['limit'](_0x554fae[_0x0fd5('0x33')][_0x0fd5('0x22')]);_0x1c08c0['offset']=qs[_0x0fd5('0x20')](_0x554fae[_0x0fd5('0x33')][_0x0fd5('0x20')]);}return _0x208b58[_0x0fd5('0x51')](_0x1c08c0);}})[_0x0fd5('0x27')](function(_0x4156d8){if(_0x4156d8){return _0x4156d8?{'count':_0x2fa89e,'rows':_0x4156d8}:null;}})['then'](respondWithResult(_0x4636c3,null))['catch'](handleError(_0x4636c3,null));};
\ No newline at end of file
+var _0xcf97=['reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','filters','catch','create','body','find','getFields','findOne','Dynamics365Field','rawAttributes','length','nolimit','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x5ddb15,_0x5e2822){var _0x229c4e=function(_0x1533a6){while(--_0x1533a6){_0x5ddb15['push'](_0x5ddb15['shift']());}};_0x229c4e(++_0x5e2822);}(_0xcf97,0xcd));var _0x7cf9=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0xcf97[_0x3c0dcc];return _0x1a224c;};'use strict';var emlformat=require(_0x7cf9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7cf9('0x1'));var rp=require(_0x7cf9('0x2'));var moment=require(_0x7cf9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7cf9('0x4'));var util=require(_0x7cf9('0x5'));var path=require(_0x7cf9('0x6'));var sox=require(_0x7cf9('0x7'));var csv=require(_0x7cf9('0x8'));var ejs=require(_0x7cf9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7cf9('0xa'));var crypto=require(_0x7cf9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7cf9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7cf9('0xd'));var Papa=require(_0x7cf9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7cf9('0xf'));var as=require(_0x7cf9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cf9('0x11'))(_0x7cf9('0x12'));var utils=require(_0x7cf9('0x13'));var config=require(_0x7cf9('0x14'));var licenseUtil=require(_0x7cf9('0x15'));var db=require(_0x7cf9('0x16'))['db'];function respondWithStatusCode(_0xf021ff,_0x3eda50){_0x3eda50=_0x3eda50||0xcc;return function(_0x38e260){if(_0x38e260){return _0xf021ff[_0x7cf9('0x17')](_0x3eda50);}return _0xf021ff[_0x7cf9('0x18')](_0x3eda50)[_0x7cf9('0x19')]();};}function respondWithResult(_0x131022,_0x504526){_0x504526=_0x504526||0xc8;return function(_0x18ed85){if(_0x18ed85){return _0x131022['status'](_0x504526)[_0x7cf9('0x1a')](_0x18ed85);}};}function respondWithFilteredResult(_0x3d8af0,_0x3c4a01){return function(_0x5915a1){if(_0x5915a1){var _0x33eedf=typeof _0x3c4a01[_0x7cf9('0x1b')]===_0x7cf9('0x1c')&&typeof _0x3c4a01[_0x7cf9('0x1d')]===_0x7cf9('0x1c');var _0x52984f=_0x5915a1[_0x7cf9('0x1e')];var _0x2bcf4d=_0x33eedf?0x0:_0x3c4a01[_0x7cf9('0x1b')];var _0x4f4fbc=_0x33eedf?_0x5915a1['count']:_0x3c4a01[_0x7cf9('0x1b')]+_0x3c4a01[_0x7cf9('0x1d')];var _0x295ad2;if(_0x4f4fbc>=_0x52984f){_0x4f4fbc=_0x52984f;_0x295ad2=0xc8;}else{_0x295ad2=0xce;}_0x3d8af0[_0x7cf9('0x18')](_0x295ad2);return _0x3d8af0['set'](_0x7cf9('0x1f'),_0x2bcf4d+'-'+_0x4f4fbc+'/'+_0x52984f)[_0x7cf9('0x1a')](_0x5915a1);}return null;};}function patchUpdates(_0x3f85a9){return function(_0x57d2ab){try{jsonpatch['apply'](_0x57d2ab,_0x3f85a9,!![]);}catch(_0x354964){return BPromise[_0x7cf9('0x20')](_0x354964);}return _0x57d2ab[_0x7cf9('0x21')]();};}function saveUpdates(_0x48e855,_0x47dd34){return function(_0x30dea9){if(_0x30dea9){return _0x30dea9[_0x7cf9('0x22')](_0x48e855)[_0x7cf9('0x23')](function(_0x483222){return _0x483222;});}return null;};}function removeEntity(_0x1bc3c8,_0x609b99){return function(_0x5f044d){if(_0x5f044d){return _0x5f044d[_0x7cf9('0x24')]()['then'](function(){_0x1bc3c8['status'](0xcc)[_0x7cf9('0x19')]();});}};}function handleEntityNotFound(_0x25d5f1,_0x3f2d26){return function(_0x41c1b1){if(!_0x41c1b1){_0x25d5f1[_0x7cf9('0x17')](0x194);}return _0x41c1b1;};}function handleError(_0x3a0027,_0x10d142){_0x10d142=_0x10d142||0x1f4;return function(_0x344e58){logger[_0x7cf9('0x25')](_0x344e58[_0x7cf9('0x26')]);if(_0x344e58[_0x7cf9('0x27')]){delete _0x344e58[_0x7cf9('0x27')];}_0x3a0027[_0x7cf9('0x18')](_0x10d142)[_0x7cf9('0x28')](_0x344e58);};}exports[_0x7cf9('0x29')]=function(_0x495678,_0x40efa9){var _0x330acc={},_0x3948ea={},_0x39d454={'count':0x0,'rows':[]};var _0x1293d1=_[_0x7cf9('0x2a')](db[_0x7cf9('0x2b')]['rawAttributes'],function(_0x413b6e){return{'name':_0x413b6e[_0x7cf9('0x2c')],'type':_0x413b6e['type']['key']};});_0x3948ea[_0x7cf9('0x2d')]=_[_0x7cf9('0x2a')](_0x1293d1,'name');_0x3948ea[_0x7cf9('0x2e')]=_[_0x7cf9('0x2f')](_0x495678[_0x7cf9('0x2e')]);_0x3948ea['filters']=_[_0x7cf9('0x30')](_0x3948ea[_0x7cf9('0x2d')],_0x3948ea[_0x7cf9('0x2e')]);_0x330acc['attributes']=_[_0x7cf9('0x30')](_0x3948ea['model'],qs[_0x7cf9('0x31')](_0x495678['query'][_0x7cf9('0x31')]));_0x330acc[_0x7cf9('0x32')]=_0x330acc[_0x7cf9('0x32')]['length']?_0x330acc[_0x7cf9('0x32')]:_0x3948ea[_0x7cf9('0x2d')];if(!_0x495678['query'][_0x7cf9('0x33')]('nolimit')){_0x330acc[_0x7cf9('0x1d')]=qs['limit'](_0x495678[_0x7cf9('0x2e')][_0x7cf9('0x1d')]);_0x330acc[_0x7cf9('0x1b')]=qs[_0x7cf9('0x1b')](_0x495678['query']['offset']);}_0x330acc[_0x7cf9('0x34')]=qs[_0x7cf9('0x35')](_0x495678[_0x7cf9('0x2e')][_0x7cf9('0x35')]);_0x330acc[_0x7cf9('0x36')]=qs['filters'](_[_0x7cf9('0x37')](_0x495678[_0x7cf9('0x2e')],_0x3948ea['filters']),_0x1293d1);if(_0x495678[_0x7cf9('0x2e')][_0x7cf9('0x38')]){_0x330acc[_0x7cf9('0x36')]=_[_0x7cf9('0x39')](_0x330acc[_0x7cf9('0x36')],{'$or':_[_0x7cf9('0x2a')](_0x1293d1,function(_0x3d0ffe){if(_0x3d0ffe[_0x7cf9('0x3a')]!==_0x7cf9('0x3b')){var _0x4fa5eb={};_0x4fa5eb[_0x3d0ffe['name']]={'$like':'%'+_0x495678[_0x7cf9('0x2e')][_0x7cf9('0x38')]+'%'};return _0x4fa5eb;}})});}_0x330acc=_[_0x7cf9('0x39')]({},_0x330acc,_0x495678[_0x7cf9('0x3c')]);var _0x184805={'where':_0x330acc[_0x7cf9('0x36')]};return db[_0x7cf9('0x2b')][_0x7cf9('0x1e')](_0x184805)[_0x7cf9('0x23')](function(_0x133c3c){_0x39d454['count']=_0x133c3c;if(_0x495678[_0x7cf9('0x2e')][_0x7cf9('0x3d')]){_0x330acc[_0x7cf9('0x3e')]=[{'all':!![]}];}return db[_0x7cf9('0x2b')][_0x7cf9('0x3f')](_0x330acc);})[_0x7cf9('0x23')](function(_0x3122f6){_0x39d454[_0x7cf9('0x40')]=_0x3122f6;return _0x39d454;})[_0x7cf9('0x23')](respondWithFilteredResult(_0x40efa9,_0x330acc))['catch'](handleError(_0x40efa9,null));};exports['show']=function(_0xa06056,_0xdd6669){var _0x4b295a={'raw':![],'where':{'id':_0xa06056[_0x7cf9('0x41')]['id']}},_0x2883ee={};_0x2883ee['model']=_[_0x7cf9('0x2f')](db['Dynamics365Configuration']['rawAttributes']);_0x2883ee[_0x7cf9('0x2e')]=_[_0x7cf9('0x2f')](_0xa06056[_0x7cf9('0x2e')]);_0x2883ee[_0x7cf9('0x42')]=_[_0x7cf9('0x30')](_0x2883ee[_0x7cf9('0x2d')],_0x2883ee[_0x7cf9('0x2e')]);_0x4b295a['attributes']=_[_0x7cf9('0x30')](_0x2883ee['model'],qs[_0x7cf9('0x31')](_0xa06056[_0x7cf9('0x2e')][_0x7cf9('0x31')]));_0x4b295a[_0x7cf9('0x32')]=_0x4b295a[_0x7cf9('0x32')]['length']?_0x4b295a[_0x7cf9('0x32')]:_0x2883ee['model'];if(_0xa06056[_0x7cf9('0x2e')]['includeAll']){_0x4b295a['include']=[{'all':!![]}];}_0x4b295a=_[_0x7cf9('0x39')]({},_0x4b295a,_0xa06056[_0x7cf9('0x3c')]);return db[_0x7cf9('0x2b')]['find'](_0x4b295a)[_0x7cf9('0x23')](handleEntityNotFound(_0xdd6669,null))[_0x7cf9('0x23')](respondWithResult(_0xdd6669,null))[_0x7cf9('0x43')](handleError(_0xdd6669,null));};exports[_0x7cf9('0x44')]=function(_0x281618,_0x29b7f6){return db[_0x7cf9('0x2b')][_0x7cf9('0x44')](_0x281618[_0x7cf9('0x45')],{})['then'](respondWithResult(_0x29b7f6,0xc9))[_0x7cf9('0x43')](handleError(_0x29b7f6,null));};exports['update']=function(_0x476819,_0x17241c){if(_0x476819[_0x7cf9('0x45')]['id']){delete _0x476819['body']['id'];}return db[_0x7cf9('0x2b')]['find']({'where':{'id':_0x476819[_0x7cf9('0x41')]['id']}})[_0x7cf9('0x23')](handleEntityNotFound(_0x17241c,null))[_0x7cf9('0x23')](saveUpdates(_0x476819[_0x7cf9('0x45')],null))[_0x7cf9('0x23')](respondWithResult(_0x17241c,null))[_0x7cf9('0x43')](handleError(_0x17241c,null));};exports['destroy']=function(_0x106661,_0x4b9823){return db[_0x7cf9('0x2b')][_0x7cf9('0x46')]({'where':{'id':_0x106661[_0x7cf9('0x41')]['id']}})[_0x7cf9('0x23')](handleEntityNotFound(_0x4b9823,null))[_0x7cf9('0x23')](removeEntity(_0x4b9823,null))[_0x7cf9('0x43')](handleError(_0x4b9823,null));};exports[_0x7cf9('0x47')]=function(_0x27783c,_0x3b8805,_0x182360){var _0x282de3={};var _0x4cdc72={};var _0x9d5e61;var _0x4c1d2b;return db[_0x7cf9('0x2b')][_0x7cf9('0x48')]({'where':{'id':_0x27783c[_0x7cf9('0x41')]['id']}})[_0x7cf9('0x23')](handleEntityNotFound(_0x3b8805,null))[_0x7cf9('0x23')](function(_0x3b5b9a){if(_0x3b5b9a){_0x9d5e61=_0x3b5b9a;_0x4cdc72[_0x7cf9('0x2d')]=_['keys'](db[_0x7cf9('0x49')][_0x7cf9('0x4a')]);_0x4cdc72[_0x7cf9('0x2e')]=_[_0x7cf9('0x2f')](_0x27783c[_0x7cf9('0x2e')]);_0x4cdc72[_0x7cf9('0x42')]=_['intersection'](_0x4cdc72['model'],_0x4cdc72[_0x7cf9('0x2e')]);_0x282de3[_0x7cf9('0x32')]=_['intersection'](_0x4cdc72[_0x7cf9('0x2d')],qs[_0x7cf9('0x31')](_0x27783c[_0x7cf9('0x2e')][_0x7cf9('0x31')]));_0x282de3[_0x7cf9('0x32')]=_0x282de3[_0x7cf9('0x32')]['length']?_0x282de3[_0x7cf9('0x32')]:_0x4cdc72[_0x7cf9('0x2d')];_0x282de3[_0x7cf9('0x34')]=qs[_0x7cf9('0x35')](_0x27783c['query'][_0x7cf9('0x35')]);_0x282de3[_0x7cf9('0x36')]=qs[_0x7cf9('0x42')](_[_0x7cf9('0x37')](_0x27783c[_0x7cf9('0x2e')],_0x4cdc72[_0x7cf9('0x42')]));if(_0x27783c[_0x7cf9('0x2e')][_0x7cf9('0x38')]){_0x282de3['where']=_[_0x7cf9('0x39')](_0x282de3[_0x7cf9('0x36')],{'$or':_['map'](_0x282de3['attributes'],function(_0x57dc36){var _0xb0737e={};_0xb0737e[_0x57dc36]={'$like':'%'+_0x27783c['query'][_0x7cf9('0x38')]+'%'};return _0xb0737e;})});}_0x282de3=_[_0x7cf9('0x39')]({},_0x282de3,_0x27783c[_0x7cf9('0x3c')]);return _0x9d5e61[_0x7cf9('0x47')](_0x282de3);}})['then'](function(_0x3e0b13){if(_0x3e0b13){_0x4c1d2b=_0x3e0b13[_0x7cf9('0x4b')];if(!_0x27783c[_0x7cf9('0x2e')]['hasOwnProperty'](_0x7cf9('0x4c'))){_0x282de3[_0x7cf9('0x1d')]=qs[_0x7cf9('0x1d')](_0x27783c[_0x7cf9('0x2e')]['limit']);_0x282de3['offset']=qs['offset'](_0x27783c['query'][_0x7cf9('0x1b')]);}return _0x9d5e61['getFields'](_0x282de3);}})[_0x7cf9('0x23')](function(_0x1dfd6c){if(_0x1dfd6c){return _0x1dfd6c?{'count':_0x4c1d2b,'rows':_0x1dfd6c}:null;}})['then'](respondWithResult(_0x3b8805,null))[_0x7cf9('0x43')](handleError(_0x3b8805,null));};exports[_0x7cf9('0x4d')]=function(_0x4be904,_0x4f0433,_0x26270c){var _0x13e872={};var _0x402c04={};var _0x3c5fa8;var _0x802130;return db[_0x7cf9('0x2b')]['findOne']({'where':{'id':_0x4be904[_0x7cf9('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f0433,null))[_0x7cf9('0x23')](function(_0x3a613c){if(_0x3a613c){_0x3c5fa8=_0x3a613c;_0x402c04['model']=_['keys'](db['Dynamics365Field'][_0x7cf9('0x4a')]);_0x402c04[_0x7cf9('0x2e')]=_[_0x7cf9('0x2f')](_0x4be904['query']);_0x402c04[_0x7cf9('0x42')]=_[_0x7cf9('0x30')](_0x402c04['model'],_0x402c04['query']);_0x13e872[_0x7cf9('0x32')]=_[_0x7cf9('0x30')](_0x402c04[_0x7cf9('0x2d')],qs[_0x7cf9('0x31')](_0x4be904[_0x7cf9('0x2e')][_0x7cf9('0x31')]));_0x13e872[_0x7cf9('0x32')]=_0x13e872[_0x7cf9('0x32')][_0x7cf9('0x4b')]?_0x13e872['attributes']:_0x402c04[_0x7cf9('0x2d')];_0x13e872['order']=qs['sort'](_0x4be904['query']['sort']);_0x13e872['where']=qs[_0x7cf9('0x42')](_[_0x7cf9('0x37')](_0x4be904[_0x7cf9('0x2e')],_0x402c04[_0x7cf9('0x42')]));if(_0x4be904[_0x7cf9('0x2e')][_0x7cf9('0x38')]){_0x13e872[_0x7cf9('0x36')]=_['merge'](_0x13e872['where'],{'$or':_[_0x7cf9('0x2a')](_0x13e872[_0x7cf9('0x32')],function(_0x21cde2){var _0x3ce02e={};_0x3ce02e[_0x21cde2]={'$like':'%'+_0x4be904['query'][_0x7cf9('0x38')]+'%'};return _0x3ce02e;})});}_0x13e872=_[_0x7cf9('0x39')]({},_0x13e872,_0x4be904[_0x7cf9('0x3c')]);return _0x3c5fa8['getSubjects'](_0x13e872);}})['then'](function(_0xeb0bc){if(_0xeb0bc){_0x802130=_0xeb0bc['length'];if(!_0x4be904[_0x7cf9('0x2e')][_0x7cf9('0x33')](_0x7cf9('0x4c'))){_0x13e872['limit']=qs[_0x7cf9('0x1d')](_0x4be904[_0x7cf9('0x2e')][_0x7cf9('0x1d')]);_0x13e872[_0x7cf9('0x1b')]=qs[_0x7cf9('0x1b')](_0x4be904[_0x7cf9('0x2e')][_0x7cf9('0x1b')]);}return _0x3c5fa8[_0x7cf9('0x4d')](_0x13e872);}})[_0x7cf9('0x23')](function(_0x2ad775){if(_0x2ad775){return _0x2ad775?{'count':_0x802130,'rows':_0x2ad775}:null;}})[_0x7cf9('0x23')](respondWithResult(_0x4f0433,null))[_0x7cf9('0x43')](handleError(_0x4f0433,null));};exports[_0x7cf9('0x4e')]=function(_0x41a8f9,_0x469e7f,_0x53c380){var _0x410043={};var _0x560459={};var _0x11aadf;var _0x22596a;return db[_0x7cf9('0x2b')]['findOne']({'where':{'id':_0x41a8f9[_0x7cf9('0x41')]['id']}})['then'](handleEntityNotFound(_0x469e7f,null))['then'](function(_0x48e8a2){if(_0x48e8a2){_0x11aadf=_0x48e8a2;_0x560459[_0x7cf9('0x2d')]=_[_0x7cf9('0x2f')](db['Dynamics365Field'][_0x7cf9('0x4a')]);_0x560459[_0x7cf9('0x2e')]=_[_0x7cf9('0x2f')](_0x41a8f9[_0x7cf9('0x2e')]);_0x560459[_0x7cf9('0x42')]=_[_0x7cf9('0x30')](_0x560459[_0x7cf9('0x2d')],_0x560459['query']);_0x410043[_0x7cf9('0x32')]=_['intersection'](_0x560459[_0x7cf9('0x2d')],qs['fields'](_0x41a8f9['query'][_0x7cf9('0x31')]));_0x410043['attributes']=_0x410043['attributes'][_0x7cf9('0x4b')]?_0x410043[_0x7cf9('0x32')]:_0x560459[_0x7cf9('0x2d')];_0x410043['order']=qs['sort'](_0x41a8f9[_0x7cf9('0x2e')][_0x7cf9('0x35')]);_0x410043[_0x7cf9('0x36')]=qs['filters'](_[_0x7cf9('0x37')](_0x41a8f9['query'],_0x560459['filters']));if(_0x41a8f9[_0x7cf9('0x2e')][_0x7cf9('0x38')]){_0x410043[_0x7cf9('0x36')]=_[_0x7cf9('0x39')](_0x410043[_0x7cf9('0x36')],{'$or':_['map'](_0x410043[_0x7cf9('0x32')],function(_0x594242){var _0x14a42f={};_0x14a42f[_0x594242]={'$like':'%'+_0x41a8f9[_0x7cf9('0x2e')][_0x7cf9('0x38')]+'%'};return _0x14a42f;})});}_0x410043=_['merge']({},_0x410043,_0x41a8f9[_0x7cf9('0x3c')]);return _0x11aadf[_0x7cf9('0x4e')](_0x410043);}})[_0x7cf9('0x23')](function(_0x32bcf4){if(_0x32bcf4){_0x22596a=_0x32bcf4[_0x7cf9('0x4b')];if(!_0x41a8f9['query']['hasOwnProperty'](_0x7cf9('0x4c'))){_0x410043[_0x7cf9('0x1d')]=qs[_0x7cf9('0x1d')](_0x41a8f9['query'][_0x7cf9('0x1d')]);_0x410043[_0x7cf9('0x1b')]=qs[_0x7cf9('0x1b')](_0x41a8f9[_0x7cf9('0x2e')][_0x7cf9('0x1b')]);}return _0x11aadf['getDescriptions'](_0x410043);}})['then'](function(_0x16a155){if(_0x16a155){return _0x16a155?{'count':_0x22596a,'rows':_0x16a155}:null;}})[_0x7cf9('0x23')](respondWithResult(_0x469e7f,null))[_0x7cf9('0x43')](handleError(_0x469e7f,null));};
\ No newline at end of file
index 43bf022..b1bed9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x48dc97,_0x498fd5){var _0x6c6356=function(_0x5cb652){while(--_0x5cb652){_0x48dc97['push'](_0x48dc97['shift']());}};_0x6c6356(++_0x498fd5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x00bb[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0x55ca,0x126));var _0xa55c=function(_0x240860,_0x20c04d){_0x240860=_0x240860-0x0;var _0x40e288=_0x55ca[_0x240860];return _0x40e288;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Dynamics365Configuration',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f06241..b6f96cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78cb=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x78cb,0xd7));var _0xb78c=function(_0x20de77,_0x59b18d){_0x20de77=_0x20de77-0x0;var _0x38b78e=_0x78cb[_0x20de77];return _0x38b78e;};'use strict';var _=require(_0xb78c('0x0'));var util=require(_0xb78c('0x1'));var moment=require(_0xb78c('0x2'));var BPromise=require(_0xb78c('0x3'));var rs=require(_0xb78c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb78c('0x5'))['db'];var utils=require(_0xb78c('0x6'));var logger=require(_0xb78c('0x7'))(_0xb78c('0x8'));var config=require(_0xb78c('0x9'));var jayson=require(_0xb78c('0xa'));var client=jayson[_0xb78c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x440982,_0xeb735f,_0x4d1df2){return new BPromise(function(_0x23ab72,_0x3c0f76){return client[_0xb78c('0xc')](_0x440982,_0x4d1df2)['then'](function(_0x58165b){logger[_0xb78c('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0xeb735f,_0xb78c('0xe'));logger[_0xb78c('0xf')](_0xb78c('0x10'),_0xeb735f,_0xb78c('0xe'),JSON[_0xb78c('0x11')](_0x58165b));if(_0x58165b[_0xb78c('0x12')]){if(_0x58165b['error']['code']===0x1f4){logger[_0xb78c('0x12')](_0xb78c('0x13'),_0xeb735f,_0x58165b[_0xb78c('0x12')][_0xb78c('0x14')]);return _0x3c0f76(_0x58165b[_0xb78c('0x12')][_0xb78c('0x14')]);}logger['error'](_0xb78c('0x13'),_0xeb735f,_0x58165b[_0xb78c('0x12')]['message']);return _0x23ab72(_0x58165b[_0xb78c('0x12')]['message']);}else{logger[_0xb78c('0xd')](_0xb78c('0x13'),_0xeb735f,'request\x20sent');_0x23ab72(_0x58165b[_0xb78c('0x15')][_0xb78c('0x14')]);}})[_0xb78c('0x16')](function(_0x2acd4e){logger['error'](_0xb78c('0x13'),_0xeb735f,_0x2acd4e);_0x3c0f76(_0x2acd4e);});});}
\ No newline at end of file
+var _0xa434=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','lodash','bluebird'];(function(_0x4e015b,_0x180f85){var _0x5d018b=function(_0xbbcd57){while(--_0xbbcd57){_0x4e015b['push'](_0x4e015b['shift']());}};_0x5d018b(++_0x180f85);}(_0xa434,0x1b7));var _0x4a43=function(_0x5ea94c,_0x19937b){_0x5ea94c=_0x5ea94c-0x0;var _0xededd7=_0xa434[_0x5ea94c];return _0xededd7;};'use strict';var _=require(_0x4a43('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4a43('0x1'));var rs=require(_0x4a43('0x2'));var fs=require('fs');var Redis=require(_0x4a43('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4a43('0x4'))(_0x4a43('0x5'));var config=require(_0x4a43('0x6'));var jayson=require(_0x4a43('0x7'));var client=jayson[_0x4a43('0x8')][_0x4a43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d5e62,_0x1013dc,_0x30adf8){return new BPromise(function(_0x193512,_0x27187c){return client[_0x4a43('0xa')](_0x1d5e62,_0x30adf8)['then'](function(_0x513a59){logger['info'](_0x4a43('0xb'),_0x1013dc,'request\x20sent');logger[_0x4a43('0xc')](_0x4a43('0xd'),_0x1013dc,'request\x20sent',JSON[_0x4a43('0xe')](_0x513a59));if(_0x513a59[_0x4a43('0xf')]){if(_0x513a59['error']['code']===0x1f4){logger[_0x4a43('0xf')](_0x4a43('0xb'),_0x1013dc,_0x513a59[_0x4a43('0xf')][_0x4a43('0x10')]);return _0x27187c(_0x513a59[_0x4a43('0xf')][_0x4a43('0x10')]);}logger[_0x4a43('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1013dc,_0x513a59[_0x4a43('0xf')][_0x4a43('0x10')]);return _0x193512(_0x513a59['error']['message']);}else{logger[_0x4a43('0x11')](_0x4a43('0xb'),_0x1013dc,_0x4a43('0x12'));_0x193512(_0x513a59[_0x4a43('0x13')][_0x4a43('0x10')]);}})[_0x4a43('0x14')](function(_0x107804){logger[_0x4a43('0xf')](_0x4a43('0xb'),_0x1013dc,_0x107804);_0x27187c(_0x107804);});});}
\ No newline at end of file
index 48474f9..b1c8a44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38ab=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','util'];(function(_0x1e4c55,_0x1415eb){var _0x511ab5=function(_0x2958cb){while(--_0x2958cb){_0x1e4c55['push'](_0x1e4c55['shift']());}};_0x511ab5(++_0x1415eb);}(_0x38ab,0x1a7));var _0xb38a=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x38ab[_0x335271];return _0xa9fff8;};'use strict';var multer=require(_0xb38a('0x0'));var util=require(_0xb38a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb38a('0x2'));var router=express['Router']();var fs_extra=require(_0xb38a('0x3'));var auth=require(_0xb38a('0x4'));var interaction=require(_0xb38a('0x5'));var config=require(_0xb38a('0x6'));var controller=require(_0xb38a('0x7'));router[_0xb38a('0x8')]('/',auth[_0xb38a('0x9')](),controller[_0xb38a('0xa')]);router[_0xb38a('0x8')](_0xb38a('0xb'),auth[_0xb38a('0x9')](),controller[_0xb38a('0xc')]);router['post']('/',auth[_0xb38a('0x9')](),controller[_0xb38a('0xd')]);router['put'](_0xb38a('0xb'),auth[_0xb38a('0x9')](),controller[_0xb38a('0xe')]);router['delete'](_0xb38a('0xb'),auth[_0xb38a('0x9')](),controller[_0xb38a('0xf')]);module[_0xb38a('0x10')]=router;
\ No newline at end of file
+var _0x502c=['../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x1191a5,_0x26ac7e){var _0x46c08e=function(_0x5c8341){while(--_0x5c8341){_0x1191a5['push'](_0x1191a5['shift']());}};_0x46c08e(++_0x26ac7e);}(_0x502c,0x1ab));var _0xc502=function(_0x172983,_0x57369f){_0x172983=_0x172983-0x0;var _0x471e28=_0x502c[_0x172983];return _0x471e28;};'use strict';var multer=require(_0xc502('0x0'));var util=require(_0xc502('0x1'));var path=require('path');var timeout=require(_0xc502('0x2'));var express=require(_0xc502('0x3'));var router=express[_0xc502('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc502('0x5'));var interaction=require(_0xc502('0x6'));var config=require('../../config/environment');var controller=require(_0xc502('0x7'));router[_0xc502('0x8')]('/',auth[_0xc502('0x9')](),controller[_0xc502('0xa')]);router[_0xc502('0x8')](_0xc502('0xb'),auth['isAuthenticated'](),controller[_0xc502('0xc')]);router[_0xc502('0xd')]('/',auth[_0xc502('0x9')](),controller['create']);router['put'](_0xc502('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc502('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc502('0xf')]=router;
\ No newline at end of file
index ab5f720..a617e6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1003=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x370c4d,_0x38ac8d){var _0x3d2648=function(_0x32b19c){while(--_0x32b19c){_0x370c4d['push'](_0x370c4d['shift']());}};_0x3d2648(++_0x38ac8d);}(_0x1003,0x183));var _0x3100=function(_0x52b2de,_0x3067af){_0x52b2de=_0x52b2de-0x0;var _0xa1e41e=_0x1003[_0x52b2de];return _0xa1e41e;};'use strict';var Sequelize=require(_0x3100('0x0'));module[_0x3100('0x1')]={'type':{'type':Sequelize[_0x3100('0x2')](_0x3100('0x3'),_0x3100('0x4'),_0x3100('0x5'),_0x3100('0x6'),_0x3100('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3100('0x8')]},'key':{'type':Sequelize[_0x3100('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x3100('0x3'),_0x3100('0x4'),_0x3100('0x5'))},'keyContent':{'type':Sequelize[_0x3100('0x8')]},'idField':{'type':Sequelize[_0x3100('0x8')]},'nameField':{'type':Sequelize[_0x3100('0x8')]},'customField':{'type':Sequelize[_0x3100('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3100('0x8')]}};
\ No newline at end of file
+var _0x0709=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x4cf0fb,_0x58b541){var _0x2e628f=function(_0x444340){while(--_0x444340){_0x4cf0fb['push'](_0x4cf0fb['shift']());}};_0x2e628f(++_0x58b541);}(_0x0709,0xc4));var _0x9070=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0x0709[_0x1ae491];return _0x4958a5;};'use strict';var Sequelize=require(_0x9070('0x0'));module[_0x9070('0x1')]={'type':{'type':Sequelize[_0x9070('0x2')](_0x9070('0x3'),_0x9070('0x4'),_0x9070('0x5'),_0x9070('0x6'),'picklist'),'defaultValue':_0x9070('0x3')},'content':{'type':Sequelize[_0x9070('0x7')]},'key':{'type':Sequelize[_0x9070('0x7')]},'keyType':{'type':Sequelize[_0x9070('0x2')](_0x9070('0x3'),_0x9070('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x9070('0x7')]},'idField':{'type':Sequelize[_0x9070('0x7')]},'nameField':{'type':Sequelize[_0x9070('0x7')]},'customField':{'type':Sequelize[_0x9070('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d535996..75fee12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f97=['request-promise','mustache','util','sox','to-csv','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','stack','name','send','index','map','Dynamics365Field','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir'];(function(_0xedcf2f,_0x144311){var _0x5d2c9e=function(_0x53dd10){while(--_0x53dd10){_0xedcf2f['push'](_0xedcf2f['shift']());}};_0x5d2c9e(++_0x144311);}(_0x0f97,0x189));var _0x70f9=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x0f97[_0x95411e];return _0x2c8718;};'use strict';var emlformat=require(_0x70f9('0x0'));var rimraf=require(_0x70f9('0x1'));var zipdir=require(_0x70f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x70f9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x70f9('0x4'));var util=require(_0x70f9('0x5'));var path=require('path');var sox=require(_0x70f9('0x6'));var csv=require(_0x70f9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70f9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x70f9('0x9'));var deskjs=require(_0x70f9('0xa'));var toCsv=require(_0x70f9('0x7'));var querystring=require(_0x70f9('0xb'));var Papa=require('papaparse');var Redis=require(_0x70f9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x70f9('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x70f9('0xe'));var logger=require(_0x70f9('0xf'))('api');var utils=require(_0x70f9('0x10'));var config=require(_0x70f9('0x11'));var licenseUtil=require(_0x70f9('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bbe23,_0x1a783b){_0x1a783b=_0x1a783b||0xcc;return function(_0x331f23){if(_0x331f23){return _0x4bbe23[_0x70f9('0x13')](_0x1a783b);}return _0x4bbe23[_0x70f9('0x14')](_0x1a783b)[_0x70f9('0x15')]();};}function respondWithResult(_0x238c2b,_0x299ff1){_0x299ff1=_0x299ff1||0xc8;return function(_0x57501b){if(_0x57501b){return _0x238c2b[_0x70f9('0x14')](_0x299ff1)['json'](_0x57501b);}};}function respondWithFilteredResult(_0x3c9911,_0x204c5a){return function(_0x472aa5){if(_0x472aa5){var _0x39a9f9=typeof _0x204c5a[_0x70f9('0x16')]==='undefined'&&typeof _0x204c5a[_0x70f9('0x17')]===_0x70f9('0x18');var _0x1d654e=_0x472aa5['count'];var _0x5b7a08=_0x39a9f9?0x0:_0x204c5a[_0x70f9('0x16')];var _0x275be8=_0x39a9f9?_0x472aa5[_0x70f9('0x19')]:_0x204c5a[_0x70f9('0x16')]+_0x204c5a[_0x70f9('0x17')];var _0x58b8d2;if(_0x275be8>=_0x1d654e){_0x275be8=_0x1d654e;_0x58b8d2=0xc8;}else{_0x58b8d2=0xce;}_0x3c9911[_0x70f9('0x14')](_0x58b8d2);return _0x3c9911['set'](_0x70f9('0x1a'),_0x5b7a08+'-'+_0x275be8+'/'+_0x1d654e)['json'](_0x472aa5);}return null;};}function patchUpdates(_0x3bf30e){return function(_0x2fe006){try{jsonpatch['apply'](_0x2fe006,_0x3bf30e,!![]);}catch(_0x430c6b){return BPromise[_0x70f9('0x1b')](_0x430c6b);}return _0x2fe006[_0x70f9('0x1c')]();};}function saveUpdates(_0x32b399,_0x4842b7){return function(_0x1b4d94){if(_0x1b4d94){return _0x1b4d94['update'](_0x32b399)[_0x70f9('0x1d')](function(_0x330735){return _0x330735;});}return null;};}function removeEntity(_0x54d76e,_0x149b02){return function(_0x1e266f){if(_0x1e266f){return _0x1e266f[_0x70f9('0x1e')]()[_0x70f9('0x1d')](function(){_0x54d76e[_0x70f9('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb7bd01,_0x4d5886){return function(_0x1235d2){if(!_0x1235d2){_0xb7bd01['sendStatus'](0x194);}return _0x1235d2;};}function handleError(_0x5d72bb,_0x31d132){_0x31d132=_0x31d132||0x1f4;return function(_0xe0a09b){logger['error'](_0xe0a09b[_0x70f9('0x1f')]);if(_0xe0a09b[_0x70f9('0x20')]){delete _0xe0a09b['name'];}_0x5d72bb[_0x70f9('0x14')](_0x31d132)[_0x70f9('0x21')](_0xe0a09b);};}exports[_0x70f9('0x22')]=function(_0xc808ac,_0x2644d3){var _0x45362b={},_0x47d21a={},_0x5c3a47={'count':0x0,'rows':[]};var _0x24bfc6=_[_0x70f9('0x23')](db[_0x70f9('0x24')]['rawAttributes'],function(_0x5e63eb){return{'name':_0x5e63eb[_0x70f9('0x25')],'type':_0x5e63eb[_0x70f9('0x26')]['key']};});_0x47d21a[_0x70f9('0x27')]=_[_0x70f9('0x23')](_0x24bfc6,_0x70f9('0x20'));_0x47d21a[_0x70f9('0x28')]=_[_0x70f9('0x29')](_0xc808ac[_0x70f9('0x28')]);_0x47d21a[_0x70f9('0x2a')]=_[_0x70f9('0x2b')](_0x47d21a[_0x70f9('0x27')],_0x47d21a[_0x70f9('0x28')]);_0x45362b[_0x70f9('0x2c')]=_[_0x70f9('0x2b')](_0x47d21a[_0x70f9('0x27')],qs[_0x70f9('0x2d')](_0xc808ac[_0x70f9('0x28')][_0x70f9('0x2d')]));_0x45362b[_0x70f9('0x2c')]=_0x45362b[_0x70f9('0x2c')][_0x70f9('0x2e')]?_0x45362b[_0x70f9('0x2c')]:_0x47d21a[_0x70f9('0x27')];if(!_0xc808ac[_0x70f9('0x28')][_0x70f9('0x2f')](_0x70f9('0x30'))){_0x45362b[_0x70f9('0x17')]=qs[_0x70f9('0x17')](_0xc808ac['query'][_0x70f9('0x17')]);_0x45362b['offset']=qs[_0x70f9('0x16')](_0xc808ac[_0x70f9('0x28')][_0x70f9('0x16')]);}_0x45362b[_0x70f9('0x31')]=qs['sort'](_0xc808ac[_0x70f9('0x28')][_0x70f9('0x32')]);_0x45362b['where']=qs[_0x70f9('0x2a')](_['pick'](_0xc808ac[_0x70f9('0x28')],_0x47d21a['filters']),_0x24bfc6);if(_0xc808ac['query']['filter']){_0x45362b['where']=_[_0x70f9('0x33')](_0x45362b[_0x70f9('0x34')],{'$or':_[_0x70f9('0x23')](_0x24bfc6,function(_0x550a85){if(_0x550a85['type']!==_0x70f9('0x35')){var _0x3e144d={};_0x3e144d[_0x550a85[_0x70f9('0x20')]]={'$like':'%'+_0xc808ac[_0x70f9('0x28')][_0x70f9('0x36')]+'%'};return _0x3e144d;}})});}_0x45362b=_['merge']({},_0x45362b,_0xc808ac[_0x70f9('0x37')]);var _0x4813e7={'where':_0x45362b['where']};return db[_0x70f9('0x24')][_0x70f9('0x19')](_0x4813e7)[_0x70f9('0x1d')](function(_0x179527){_0x5c3a47[_0x70f9('0x19')]=_0x179527;if(_0xc808ac[_0x70f9('0x28')][_0x70f9('0x38')]){_0x45362b['include']=[{'all':!![]}];}return db[_0x70f9('0x24')]['findAll'](_0x45362b);})[_0x70f9('0x1d')](function(_0xa24e3e){_0x5c3a47[_0x70f9('0x39')]=_0xa24e3e;return _0x5c3a47;})[_0x70f9('0x1d')](respondWithFilteredResult(_0x2644d3,_0x45362b))[_0x70f9('0x3a')](handleError(_0x2644d3,null));};exports[_0x70f9('0x3b')]=function(_0x16d1c7,_0x1e6b9c){var _0x1a87c6={'raw':!![],'where':{'id':_0x16d1c7[_0x70f9('0x3c')]['id']}},_0x34c75f={};_0x34c75f[_0x70f9('0x27')]=_[_0x70f9('0x29')](db[_0x70f9('0x24')][_0x70f9('0x3d')]);_0x34c75f['query']=_[_0x70f9('0x29')](_0x16d1c7[_0x70f9('0x28')]);_0x34c75f['filters']=_[_0x70f9('0x2b')](_0x34c75f[_0x70f9('0x27')],_0x34c75f[_0x70f9('0x28')]);_0x1a87c6[_0x70f9('0x2c')]=_[_0x70f9('0x2b')](_0x34c75f['model'],qs[_0x70f9('0x2d')](_0x16d1c7[_0x70f9('0x28')][_0x70f9('0x2d')]));_0x1a87c6['attributes']=_0x1a87c6[_0x70f9('0x2c')][_0x70f9('0x2e')]?_0x1a87c6[_0x70f9('0x2c')]:_0x34c75f[_0x70f9('0x27')];if(_0x16d1c7[_0x70f9('0x28')][_0x70f9('0x38')]){_0x1a87c6['include']=[{'all':!![]}];}_0x1a87c6=_[_0x70f9('0x33')]({},_0x1a87c6,_0x16d1c7[_0x70f9('0x37')]);return db[_0x70f9('0x24')][_0x70f9('0x3e')](_0x1a87c6)[_0x70f9('0x1d')](handleEntityNotFound(_0x1e6b9c,null))['then'](respondWithResult(_0x1e6b9c,null))['catch'](handleError(_0x1e6b9c,null));};exports[_0x70f9('0x3f')]=function(_0x53763b,_0xf9dda8){return db['Dynamics365Field']['create'](_0x53763b[_0x70f9('0x40')],{})[_0x70f9('0x1d')](respondWithResult(_0xf9dda8,0xc9))[_0x70f9('0x3a')](handleError(_0xf9dda8,null));};exports[_0x70f9('0x41')]=function(_0x2c67ed,_0x4e5c1c){if(_0x2c67ed[_0x70f9('0x40')]['id']){delete _0x2c67ed[_0x70f9('0x40')]['id'];}return db[_0x70f9('0x24')][_0x70f9('0x3e')]({'where':{'id':_0x2c67ed[_0x70f9('0x3c')]['id']}})[_0x70f9('0x1d')](handleEntityNotFound(_0x4e5c1c,null))['then'](saveUpdates(_0x2c67ed[_0x70f9('0x40')],null))[_0x70f9('0x1d')](respondWithResult(_0x4e5c1c,null))['catch'](handleError(_0x4e5c1c,null));};exports[_0x70f9('0x1e')]=function(_0x1c2dd6,_0x23871d){return db[_0x70f9('0x24')][_0x70f9('0x3e')]({'where':{'id':_0x1c2dd6[_0x70f9('0x3c')]['id']}})[_0x70f9('0x1d')](handleEntityNotFound(_0x23871d,null))[_0x70f9('0x1d')](removeEntity(_0x23871d,null))[_0x70f9('0x3a')](handleError(_0x23871d,null));};
\ No newline at end of file
+var _0x1686=['intersection','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filter','where','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','fields','length','options','find','create','update','body','eml-format','rimraf','zip-dir','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','undefined','count','set','apply','reject','then','destroy','error','stack','name','send','Dynamics365Field','rawAttributes','fieldName','model','map','query','keys','filters'];(function(_0x2d99a8,_0x5281c4){var _0x539224=function(_0x1e653c){while(--_0x1e653c){_0x2d99a8['push'](_0x2d99a8['shift']());}};_0x539224(++_0x5281c4);}(_0x1686,0x173));var _0x6168=function(_0x56b7f6,_0x15bb8e){_0x56b7f6=_0x56b7f6-0x0;var _0x4b479c=_0x1686[_0x56b7f6];return _0x4b479c;};'use strict';var emlformat=require(_0x6168('0x0'));var rimraf=require(_0x6168('0x1'));var zipdir=require(_0x6168('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6168('0x3'));var path=require('path');var sox=require(_0x6168('0x4'));var csv=require(_0x6168('0x5'));var ejs=require(_0x6168('0x6'));var fs=require('fs');var fs_extra=require(_0x6168('0x7'));var _=require(_0x6168('0x8'));var squel=require(_0x6168('0x9'));var crypto=require(_0x6168('0xa'));var jsforce=require(_0x6168('0xb'));var deskjs=require(_0x6168('0xc'));var toCsv=require(_0x6168('0x5'));var querystring=require(_0x6168('0xd'));var Papa=require(_0x6168('0xe'));var Redis=require(_0x6168('0xf'));var authService=require(_0x6168('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6168('0x11'));var logger=require('../../config/logger')(_0x6168('0x12'));var utils=require(_0x6168('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1864c8,_0x90ca3a){_0x90ca3a=_0x90ca3a||0xcc;return function(_0xf3c082){if(_0xf3c082){return _0x1864c8[_0x6168('0x14')](_0x90ca3a);}return _0x1864c8[_0x6168('0x15')](_0x90ca3a)[_0x6168('0x16')]();};}function respondWithResult(_0x9c619,_0x483ad2){_0x483ad2=_0x483ad2||0xc8;return function(_0x3e12f0){if(_0x3e12f0){return _0x9c619['status'](_0x483ad2)[_0x6168('0x17')](_0x3e12f0);}};}function respondWithFilteredResult(_0x136ce0,_0x3a28d0){return function(_0x1ebe98){if(_0x1ebe98){var _0x44957b=typeof _0x3a28d0['offset']==='undefined'&&typeof _0x3a28d0['limit']===_0x6168('0x18');var _0x4b3d06=_0x1ebe98['count'];var _0x322650=_0x44957b?0x0:_0x3a28d0['offset'];var _0x308ff1=_0x44957b?_0x1ebe98[_0x6168('0x19')]:_0x3a28d0['offset']+_0x3a28d0['limit'];var _0x50d68c;if(_0x308ff1>=_0x4b3d06){_0x308ff1=_0x4b3d06;_0x50d68c=0xc8;}else{_0x50d68c=0xce;}_0x136ce0[_0x6168('0x15')](_0x50d68c);return _0x136ce0[_0x6168('0x1a')]('Content-Range',_0x322650+'-'+_0x308ff1+'/'+_0x4b3d06)['json'](_0x1ebe98);}return null;};}function patchUpdates(_0x4eadaf){return function(_0x56cc05){try{jsonpatch[_0x6168('0x1b')](_0x56cc05,_0x4eadaf,!![]);}catch(_0x50f74a){return BPromise[_0x6168('0x1c')](_0x50f74a);}return _0x56cc05['save']();};}function saveUpdates(_0x19fec4,_0x268c61){return function(_0x31a3d8){if(_0x31a3d8){return _0x31a3d8['update'](_0x19fec4)[_0x6168('0x1d')](function(_0x50f35e){return _0x50f35e;});}return null;};}function removeEntity(_0x54628c,_0x2496b9){return function(_0x31f84d){if(_0x31f84d){return _0x31f84d[_0x6168('0x1e')]()[_0x6168('0x1d')](function(){_0x54628c[_0x6168('0x15')](0xcc)[_0x6168('0x16')]();});}};}function handleEntityNotFound(_0x58aad1,_0x4ced63){return function(_0x66bdf4){if(!_0x66bdf4){_0x58aad1[_0x6168('0x14')](0x194);}return _0x66bdf4;};}function handleError(_0x1628bd,_0x586f02){_0x586f02=_0x586f02||0x1f4;return function(_0x537d3f){logger[_0x6168('0x1f')](_0x537d3f[_0x6168('0x20')]);if(_0x537d3f[_0x6168('0x21')]){delete _0x537d3f[_0x6168('0x21')];}_0x1628bd['status'](_0x586f02)[_0x6168('0x22')](_0x537d3f);};}exports['index']=function(_0x378203,_0xa1da07){var _0x388ef4={},_0xd0c335={},_0x582540={'count':0x0,'rows':[]};var _0x1f8f8d=_['map'](db[_0x6168('0x23')][_0x6168('0x24')],function(_0x31f369){return{'name':_0x31f369[_0x6168('0x25')],'type':_0x31f369['type']['key']};});_0xd0c335[_0x6168('0x26')]=_[_0x6168('0x27')](_0x1f8f8d,_0x6168('0x21'));_0xd0c335[_0x6168('0x28')]=_[_0x6168('0x29')](_0x378203['query']);_0xd0c335[_0x6168('0x2a')]=_[_0x6168('0x2b')](_0xd0c335['model'],_0xd0c335['query']);_0x388ef4[_0x6168('0x2c')]=_[_0x6168('0x2b')](_0xd0c335[_0x6168('0x26')],qs['fields'](_0x378203[_0x6168('0x28')]['fields']));_0x388ef4[_0x6168('0x2c')]=_0x388ef4[_0x6168('0x2c')]['length']?_0x388ef4[_0x6168('0x2c')]:_0xd0c335[_0x6168('0x26')];if(!_0x378203[_0x6168('0x28')][_0x6168('0x2d')](_0x6168('0x2e'))){_0x388ef4[_0x6168('0x2f')]=qs['limit'](_0x378203[_0x6168('0x28')][_0x6168('0x2f')]);_0x388ef4['offset']=qs[_0x6168('0x30')](_0x378203['query'][_0x6168('0x30')]);}_0x388ef4[_0x6168('0x31')]=qs[_0x6168('0x32')](_0x378203[_0x6168('0x28')]['sort']);_0x388ef4['where']=qs[_0x6168('0x2a')](_['pick'](_0x378203[_0x6168('0x28')],_0xd0c335[_0x6168('0x2a')]),_0x1f8f8d);if(_0x378203[_0x6168('0x28')][_0x6168('0x33')]){_0x388ef4[_0x6168('0x34')]=_[_0x6168('0x35')](_0x388ef4[_0x6168('0x34')],{'$or':_['map'](_0x1f8f8d,function(_0x92559b){if(_0x92559b[_0x6168('0x36')]!==_0x6168('0x37')){var _0x2d29ba={};_0x2d29ba[_0x92559b[_0x6168('0x21')]]={'$like':'%'+_0x378203[_0x6168('0x28')][_0x6168('0x33')]+'%'};return _0x2d29ba;}})});}_0x388ef4=_[_0x6168('0x35')]({},_0x388ef4,_0x378203['options']);var _0x46fb87={'where':_0x388ef4[_0x6168('0x34')]};return db['Dynamics365Field'][_0x6168('0x19')](_0x46fb87)['then'](function(_0x1a108e){_0x582540['count']=_0x1a108e;if(_0x378203[_0x6168('0x28')][_0x6168('0x38')]){_0x388ef4[_0x6168('0x39')]=[{'all':!![]}];}return db[_0x6168('0x23')]['findAll'](_0x388ef4);})['then'](function(_0x2e26fc){_0x582540[_0x6168('0x3a')]=_0x2e26fc;return _0x582540;})['then'](respondWithFilteredResult(_0xa1da07,_0x388ef4))[_0x6168('0x3b')](handleError(_0xa1da07,null));};exports[_0x6168('0x3c')]=function(_0x2f57bb,_0x21f258){var _0x26d8b2={'raw':!![],'where':{'id':_0x2f57bb[_0x6168('0x3d')]['id']}},_0x2a95d3={};_0x2a95d3[_0x6168('0x26')]=_['keys'](db[_0x6168('0x23')][_0x6168('0x24')]);_0x2a95d3[_0x6168('0x28')]=_[_0x6168('0x29')](_0x2f57bb[_0x6168('0x28')]);_0x2a95d3[_0x6168('0x2a')]=_[_0x6168('0x2b')](_0x2a95d3['model'],_0x2a95d3[_0x6168('0x28')]);_0x26d8b2[_0x6168('0x2c')]=_[_0x6168('0x2b')](_0x2a95d3[_0x6168('0x26')],qs[_0x6168('0x3e')](_0x2f57bb['query'][_0x6168('0x3e')]));_0x26d8b2[_0x6168('0x2c')]=_0x26d8b2[_0x6168('0x2c')][_0x6168('0x3f')]?_0x26d8b2[_0x6168('0x2c')]:_0x2a95d3[_0x6168('0x26')];if(_0x2f57bb[_0x6168('0x28')]['includeAll']){_0x26d8b2[_0x6168('0x39')]=[{'all':!![]}];}_0x26d8b2=_[_0x6168('0x35')]({},_0x26d8b2,_0x2f57bb[_0x6168('0x40')]);return db[_0x6168('0x23')][_0x6168('0x41')](_0x26d8b2)[_0x6168('0x1d')](handleEntityNotFound(_0x21f258,null))[_0x6168('0x1d')](respondWithResult(_0x21f258,null))['catch'](handleError(_0x21f258,null));};exports[_0x6168('0x42')]=function(_0x43f047,_0x387071){return db['Dynamics365Field'][_0x6168('0x42')](_0x43f047['body'],{})['then'](respondWithResult(_0x387071,0xc9))[_0x6168('0x3b')](handleError(_0x387071,null));};exports[_0x6168('0x43')]=function(_0x101c4a,_0x3e6382){if(_0x101c4a[_0x6168('0x44')]['id']){delete _0x101c4a[_0x6168('0x44')]['id'];}return db[_0x6168('0x23')]['find']({'where':{'id':_0x101c4a[_0x6168('0x3d')]['id']}})[_0x6168('0x1d')](handleEntityNotFound(_0x3e6382,null))[_0x6168('0x1d')](saveUpdates(_0x101c4a['body'],null))[_0x6168('0x1d')](respondWithResult(_0x3e6382,null))['catch'](handleError(_0x3e6382,null));};exports['destroy']=function(_0xb29289,_0x238afe){return db[_0x6168('0x23')][_0x6168('0x41')]({'where':{'id':_0xb29289['params']['id']}})[_0x6168('0x1d')](handleEntityNotFound(_0x238afe,null))[_0x6168('0x1d')](removeEntity(_0x238afe,null))['catch'](handleError(_0x238afe,null));};
\ No newline at end of file
index 2fb01f6..dec80f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cc9=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xb13c42,_0x2c7136){var _0x340a16=function(_0x5bb10a){while(--_0x5bb10a){_0xb13c42['push'](_0xb13c42['shift']());}};_0x340a16(++_0x2c7136);}(_0x5cc9,0x9d));var _0x95cc=function(_0x29acab,_0xd7d793){_0x29acab=_0x29acab-0x0;var _0x3189f9=_0x5cc9[_0x29acab];return _0x3189f9;};'use strict';var _=require(_0x95cc('0x0'));var util=require(_0x95cc('0x1'));var logger=require('../../config/logger')(_0x95cc('0x2'));var moment=require(_0x95cc('0x3'));var BPromise=require(_0x95cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95cc('0x5'));var rimraf=require(_0x95cc('0x6'));var config=require(_0x95cc('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0x95cc('0x8')]=function(_0x334ba8,_0xcd3b44){return _0x334ba8[_0x95cc('0x9')](_0x95cc('0xa'),attributes,{'tableName':_0x95cc('0xb'),'paranoid':![],'indexes':[{'name':_0x95cc('0xc'),'fields':[_0x95cc('0xd'),_0x95cc('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd505=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3f2fea,_0x3c4ea8){var _0x69a4d5=function(_0x223109){while(--_0x223109){_0x3f2fea['push'](_0x3f2fea['shift']());}};_0x69a4d5(++_0x3c4ea8);}(_0xd505,0x91));var _0x5d50=function(_0x38890d,_0x22b7d0){_0x38890d=_0x38890d-0x0;var _0x57aec7=_0xd505[_0x38890d];return _0x57aec7;};'use strict';var _=require(_0x5d50('0x0'));var util=require(_0x5d50('0x1'));var logger=require(_0x5d50('0x2'))('api');var moment=require(_0x5d50('0x3'));var BPromise=require('bluebird');var rp=require(_0x5d50('0x4'));var fs=require('fs');var path=require(_0x5d50('0x5'));var rimraf=require(_0x5d50('0x6'));var config=require(_0x5d50('0x7'));var attributes=require(_0x5d50('0x8'));module['exports']=function(_0x3ac9e2,_0x505702){return _0x3ac9e2[_0x5d50('0x9')](_0x5d50('0xa'),attributes,{'tableName':_0x5d50('0xb'),'paranoid':![],'indexes':[{'name':_0x5d50('0xc'),'fields':[_0x5d50('0xd'),_0x5d50('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 73f3f58..2c02dc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea4c=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x63d9e0,_0x11185e){var _0x7eee62=function(_0x440892){while(--_0x440892){_0x63d9e0['push'](_0x63d9e0['shift']());}};_0x7eee62(++_0x11185e);}(_0xea4c,0xaf));var _0xcea4=function(_0x1af0cc,_0x502d68){_0x1af0cc=_0x1af0cc-0x0;var _0xc919b2=_0xea4c[_0x1af0cc];return _0xc919b2;};'use strict';var _=require(_0xcea4('0x0'));var util=require(_0xcea4('0x1'));var moment=require(_0xcea4('0x2'));var BPromise=require(_0xcea4('0x3'));var rs=require(_0xcea4('0x4'));var fs=require('fs');var Redis=require(_0xcea4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcea4('0x6'));var logger=require('../../config/logger')(_0xcea4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcea4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2108a0,_0x12e5c7,_0xd9848a){return new BPromise(function(_0x164e38,_0x537207){return client['request'](_0x2108a0,_0xd9848a)[_0xcea4('0x9')](function(_0x5027f2){logger[_0xcea4('0xa')](_0xcea4('0xb'),_0x12e5c7,_0xcea4('0xc'));logger[_0xcea4('0xd')](_0xcea4('0xe'),_0x12e5c7,_0xcea4('0xc'),JSON[_0xcea4('0xf')](_0x5027f2));if(_0x5027f2[_0xcea4('0x10')]){if(_0x5027f2['error'][_0xcea4('0x11')]===0x1f4){logger[_0xcea4('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x12e5c7,_0x5027f2[_0xcea4('0x10')]['message']);return _0x537207(_0x5027f2[_0xcea4('0x10')][_0xcea4('0x12')]);}logger[_0xcea4('0x10')](_0xcea4('0xb'),_0x12e5c7,_0x5027f2['error'][_0xcea4('0x12')]);return _0x164e38(_0x5027f2['error'][_0xcea4('0x12')]);}else{logger[_0xcea4('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x12e5c7,_0xcea4('0xc'));_0x164e38(_0x5027f2[_0xcea4('0x13')][_0xcea4('0x12')]);}})[_0xcea4('0x14')](function(_0x4b5abf){logger[_0xcea4('0x10')](_0xcea4('0xb'),_0x12e5c7,_0x4b5abf);_0x537207(_0x4b5abf);});});}
\ No newline at end of file
+var _0x30b0=['client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17004c,_0xb13fbf){var _0x33c0dd=function(_0x534d8e){while(--_0x534d8e){_0x17004c['push'](_0x17004c['shift']());}};_0x33c0dd(++_0xb13fbf);}(_0x30b0,0x17a));var _0x030b=function(_0x544e20,_0x2c441d){_0x544e20=_0x544e20-0x0;var _0x490720=_0x30b0[_0x544e20];return _0x490720;};'use strict';var _=require(_0x030b('0x0'));var util=require(_0x030b('0x1'));var moment=require(_0x030b('0x2'));var BPromise=require(_0x030b('0x3'));var rs=require(_0x030b('0x4'));var fs=require('fs');var Redis=require(_0x030b('0x5'));var db=require(_0x030b('0x6'))['db'];var utils=require(_0x030b('0x7'));var logger=require(_0x030b('0x8'))(_0x030b('0x9'));var config=require(_0x030b('0xa'));var jayson=require(_0x030b('0xb'));var client=jayson[_0x030b('0xc')][_0x030b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x211881,_0x4f8b9c,_0x2f13d7){return new BPromise(function(_0x3e086d,_0x13e9af){return client[_0x030b('0xe')](_0x211881,_0x2f13d7)[_0x030b('0xf')](function(_0x3a3ff5){logger[_0x030b('0x10')](_0x030b('0x11'),_0x4f8b9c,_0x030b('0x12'));logger[_0x030b('0x13')](_0x030b('0x14'),_0x4f8b9c,'request\x20sent',JSON['stringify'](_0x3a3ff5));if(_0x3a3ff5[_0x030b('0x15')]){if(_0x3a3ff5[_0x030b('0x15')][_0x030b('0x16')]===0x1f4){logger[_0x030b('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x4f8b9c,_0x3a3ff5[_0x030b('0x15')]['message']);return _0x13e9af(_0x3a3ff5['error'][_0x030b('0x17')]);}logger[_0x030b('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x4f8b9c,_0x3a3ff5[_0x030b('0x15')][_0x030b('0x17')]);return _0x3e086d(_0x3a3ff5[_0x030b('0x15')][_0x030b('0x17')]);}else{logger['info'](_0x030b('0x11'),_0x4f8b9c,'request\x20sent');_0x3e086d(_0x3a3ff5[_0x030b('0x18')]['message']);}})[_0x030b('0x19')](function(_0x186a45){logger[_0x030b('0x15')](_0x030b('0x11'),_0x4f8b9c,_0x186a45);_0x13e9af(_0x186a45);});});}
\ No newline at end of file
index 52e2e18..faaea44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa426=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x3d25f,_0xe7b551){var _0x43f7a3=function(_0x29a77a){while(--_0x29a77a){_0x3d25f['push'](_0x3d25f['shift']());}};_0x43f7a3(++_0xe7b551);}(_0xa426,0xf5));var _0x6a42=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xa426[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0x6a42('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6a42('0x1'));var express=require(_0x6a42('0x2'));var router=express[_0x6a42('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6a42('0x4'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x6a42('0x5')]('/',auth[_0x6a42('0x6')](),controller[_0x6a42('0x7')]);router['get'](_0x6a42('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x6a42('0x5')](_0x6a42('0x9'),auth[_0x6a42('0x6')](),controller[_0x6a42('0xa')]);router[_0x6a42('0x5')](_0x6a42('0xb'),auth[_0x6a42('0x6')](),controller[_0x6a42('0xc')]);router['post']('/',auth[_0x6a42('0x6')](),controller['create']);router[_0x6a42('0xd')](_0x6a42('0x9'),auth[_0x6a42('0x6')](),controller[_0x6a42('0xe')]);router[_0x6a42('0xf')](_0x6a42('0x8'),auth['isAuthenticated'](),controller[_0x6a42('0x10')]);router[_0x6a42('0x11')]('/:id',auth[_0x6a42('0x6')](),controller[_0x6a42('0x12')]);module[_0x6a42('0x13')]=router;
\ No newline at end of file
+var _0xe34e=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x3512cc,_0x4642cf){var _0x2cc149=function(_0x5afdbe){while(--_0x5afdbe){_0x3512cc['push'](_0x3512cc['shift']());}};_0x2cc149(++_0x4642cf);}(_0xe34e,0xe6));var _0xee34=function(_0x5c45c4,_0x3ba88e){_0x5c45c4=_0x5c45c4-0x0;var _0x48a070=_0xe34e[_0x5c45c4];return _0x48a070;};'use strict';var multer=require('multer');var util=require(_0xee34('0x0'));var path=require(_0xee34('0x1'));var timeout=require(_0xee34('0x2'));var express=require(_0xee34('0x3'));var router=express[_0xee34('0x4')]();var fs_extra=require(_0xee34('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xee34('0x6'));var config=require(_0xee34('0x7'));var controller=require(_0xee34('0x8'));router[_0xee34('0x9')]('/',auth[_0xee34('0xa')](),controller[_0xee34('0xb')]);router[_0xee34('0x9')](_0xee34('0xc'),auth[_0xee34('0xa')](),controller[_0xee34('0xd')]);router[_0xee34('0x9')](_0xee34('0xe'),auth[_0xee34('0xa')](),controller[_0xee34('0xf')]);router[_0xee34('0x9')]('/:id/fields',auth[_0xee34('0xa')](),controller['getFields']);router[_0xee34('0x10')]('/',auth[_0xee34('0xa')](),controller['create']);router[_0xee34('0x10')](_0xee34('0xe'),auth[_0xee34('0xa')](),controller['addConfiguration']);router[_0xee34('0x11')](_0xee34('0xc'),auth['isAuthenticated'](),controller[_0xee34('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee34('0x13')]);module['exports']=router;
\ No newline at end of file
index 92aa4e4..0855415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['sequelize','exports','STRING','username','remoteUri'];(function(_0x319b0c,_0xbeb58a){var _0x1e9dbe=function(_0x575213){while(--_0x575213){_0x319b0c['push'](_0x319b0c['shift']());}};_0x1e9dbe(++_0xbeb58a);}(_0x25e7,0x1d6));var _0x725e=function(_0x1b3e32,_0x49ad74){_0x1b3e32=_0x1b3e32-0x0;var _0x4796e3=_0x25e7[_0x1b3e32];return _0x4796e3;};'use strict';var Sequelize=require(_0x725e('0x0'));module[_0x725e('0x1')]={'name':{'type':Sequelize[_0x725e('0x2')]},'description':{'type':Sequelize[_0x725e('0x2')]},'username':{'type':Sequelize[_0x725e('0x2')],'unique':_0x725e('0x3')},'apiKey':{'type':Sequelize[_0x725e('0x2')]},'remoteUri':{'type':Sequelize[_0x725e('0x2')],'unique':_0x725e('0x4')},'serverUrl':{'type':Sequelize[_0x725e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x14a0=['username','exports','STRING'];(function(_0x54cca3,_0x3b297d){var _0x348fde=function(_0x1ecada){while(--_0x1ecada){_0x54cca3['push'](_0x54cca3['shift']());}};_0x348fde(++_0x3b297d);}(_0x14a0,0x8e));var _0x014a=function(_0x56a631,_0x171ebd){_0x56a631=_0x56a631-0x0;var _0x9462fb=_0x14a0[_0x56a631];return _0x9462fb;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'name':{'type':Sequelize[_0x014a('0x1')]},'description':{'type':Sequelize[_0x014a('0x1')]},'username':{'type':Sequelize[_0x014a('0x1')],'unique':_0x014a('0x2')},'apiKey':{'type':Sequelize[_0x014a('0x1')]},'remoteUri':{'type':Sequelize[_0x014a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index f10a7e8..84df397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc29b=['include','findAll','rows','catch','show','includeAll','find','create','body','params','getConfigurations','pick','hasOwnProperty','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','%s/%s','format','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','FreshdeskAccount'];(function(_0xe5b91a,_0x1b6dbe){var _0x4b28b1=function(_0x4dc6b7){while(--_0x4dc6b7){_0xe5b91a['push'](_0xe5b91a['shift']());}};_0x4b28b1(++_0x1b6dbe);}(_0xc29b,0x12d));var _0xbc29=function(_0x1ab5ab,_0xbba298){_0x1ab5ab=_0x1ab5ab-0x0;var _0x47b355=_0xc29b[_0x1ab5ab];return _0x47b355;};'use strict';var emlformat=require(_0xbc29('0x0'));var rimraf=require(_0xbc29('0x1'));var zipdir=require(_0xbc29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc29('0x3'));var moment=require(_0xbc29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc29('0x5'));var util=require(_0xbc29('0x6'));var path=require(_0xbc29('0x7'));var sox=require(_0xbc29('0x8'));var csv=require(_0xbc29('0x9'));var ejs=require(_0xbc29('0xa'));var fs=require('fs');var fs_extra=require(_0xbc29('0xb'));var _=require(_0xbc29('0xc'));var squel=require(_0xbc29('0xd'));var crypto=require(_0xbc29('0xe'));var jsforce=require(_0xbc29('0xf'));var deskjs=require(_0xbc29('0x10'));var toCsv=require(_0xbc29('0x9'));var querystring=require(_0xbc29('0x11'));var Papa=require(_0xbc29('0x12'));var Redis=require(_0xbc29('0x13'));var authService=require(_0xbc29('0x14'));var qs=require(_0xbc29('0x15'));var as=require(_0xbc29('0x16'));var hardwareService=require(_0xbc29('0x17'));var logger=require('../../config/logger')(_0xbc29('0x18'));var utils=require(_0xbc29('0x19'));var config=require(_0xbc29('0x1a'));var licenseUtil=require(_0xbc29('0x1b'));var db=require(_0xbc29('0x1c'))['db'];var integrations=require(_0xbc29('0x1d'));function respondWithStatusCode(_0x352c9e,_0x5e581f){_0x5e581f=_0x5e581f||0xcc;return function(_0x16d384){if(_0x16d384){return _0x352c9e[_0xbc29('0x1e')](_0x5e581f);}return _0x352c9e[_0xbc29('0x1f')](_0x5e581f)['end']();};}function respondWithResult(_0x483fbe,_0x1892fc){_0x1892fc=_0x1892fc||0xc8;return function(_0x56085f){if(_0x56085f){return _0x483fbe[_0xbc29('0x1f')](_0x1892fc)[_0xbc29('0x20')](_0x56085f);}};}function respondWithFilteredResult(_0x46eb03,_0x490030){return function(_0x3b31b1){if(_0x3b31b1){var _0x570a2f=typeof _0x490030[_0xbc29('0x21')]===_0xbc29('0x22')&&typeof _0x490030[_0xbc29('0x23')]===_0xbc29('0x22');var _0x2893de=_0x3b31b1[_0xbc29('0x24')];var _0x56b592=_0x570a2f?0x0:_0x490030[_0xbc29('0x21')];var _0xc4a1c1=_0x570a2f?_0x3b31b1['count']:_0x490030['offset']+_0x490030[_0xbc29('0x23')];var _0x4a2b1e;if(_0xc4a1c1>=_0x2893de){_0xc4a1c1=_0x2893de;_0x4a2b1e=0xc8;}else{_0x4a2b1e=0xce;}_0x46eb03['status'](_0x4a2b1e);return _0x46eb03[_0xbc29('0x25')](_0xbc29('0x26'),_0x56b592+'-'+_0xc4a1c1+'/'+_0x2893de)[_0xbc29('0x20')](_0x3b31b1);}return null;};}function patchUpdates(_0x371adc){return function(_0x110d45){try{jsonpatch[_0xbc29('0x27')](_0x110d45,_0x371adc,!![]);}catch(_0x4453f4){return BPromise[_0xbc29('0x28')](_0x4453f4);}return _0x110d45['save']();};}function saveUpdates(_0x115592,_0x35920d){return function(_0x1f7fd9){if(_0x1f7fd9){return _0x1f7fd9[_0xbc29('0x29')](_0x115592)[_0xbc29('0x2a')](function(_0x5c6f6d){return _0x5c6f6d;});}return null;};}function removeEntity(_0x24523f,_0x3ca9dc){return function(_0x3577fd){if(_0x3577fd){return _0x3577fd[_0xbc29('0x2b')]()['then'](function(){_0x24523f[_0xbc29('0x1f')](0xcc)[_0xbc29('0x2c')]();});}};}function handleEntityNotFound(_0x536bd2,_0xd3d9a5){return function(_0x35665f){if(!_0x35665f){_0x536bd2['sendStatus'](0x194);}return _0x35665f;};}function handleError(_0x4983b5,_0x2c7b63){_0x2c7b63=_0x2c7b63||0x1f4;return function(_0x50fc4e){logger['error'](_0x50fc4e[_0xbc29('0x2d')]);if(_0x50fc4e[_0xbc29('0x2e')]){delete _0x50fc4e[_0xbc29('0x2e')];}_0x4983b5['status'](_0x2c7b63)[_0xbc29('0x2f')](_0x50fc4e);};}exports[_0xbc29('0x30')]=function(_0x1e11b3,_0x2f23c2){var _0x1797c9={},_0x549cb5={},_0x55971f={'count':0x0,'rows':[]};var _0x2a621e=_[_0xbc29('0x31')](db['FreshdeskAccount'][_0xbc29('0x32')],function(_0x397152){return{'name':_0x397152[_0xbc29('0x33')],'type':_0x397152[_0xbc29('0x34')][_0xbc29('0x35')]};});_0x549cb5[_0xbc29('0x36')]=_['map'](_0x2a621e,_0xbc29('0x2e'));_0x549cb5[_0xbc29('0x37')]=_[_0xbc29('0x38')](_0x1e11b3[_0xbc29('0x37')]);_0x549cb5['filters']=_[_0xbc29('0x39')](_0x549cb5[_0xbc29('0x36')],_0x549cb5[_0xbc29('0x37')]);_0x1797c9['attributes']=_['intersection'](_0x549cb5[_0xbc29('0x36')],qs[_0xbc29('0x3a')](_0x1e11b3[_0xbc29('0x37')]['fields']));_0x1797c9[_0xbc29('0x3b')]=_0x1797c9[_0xbc29('0x3b')][_0xbc29('0x3c')]?_0x1797c9[_0xbc29('0x3b')]:_0x549cb5['model'];if(!_0x1e11b3['query']['hasOwnProperty'](_0xbc29('0x3d'))){_0x1797c9[_0xbc29('0x23')]=qs[_0xbc29('0x23')](_0x1e11b3['query']['limit']);_0x1797c9[_0xbc29('0x21')]=qs[_0xbc29('0x21')](_0x1e11b3['query']['offset']);}_0x1797c9[_0xbc29('0x3e')]=qs[_0xbc29('0x3f')](_0x1e11b3[_0xbc29('0x37')][_0xbc29('0x3f')]);_0x1797c9[_0xbc29('0x40')]=qs[_0xbc29('0x41')](_['pick'](_0x1e11b3['query'],_0x549cb5[_0xbc29('0x41')]),_0x2a621e);if(_0x1e11b3['query'][_0xbc29('0x42')]){_0x1797c9['where']=_[_0xbc29('0x43')](_0x1797c9[_0xbc29('0x40')],{'$or':_[_0xbc29('0x31')](_0x2a621e,function(_0xb9d7ee){if(_0xb9d7ee[_0xbc29('0x34')]!==_0xbc29('0x44')){var _0x3b38b6={};_0x3b38b6[_0xb9d7ee[_0xbc29('0x2e')]]={'$like':'%'+_0x1e11b3[_0xbc29('0x37')]['filter']+'%'};return _0x3b38b6;}})});}_0x1797c9=_[_0xbc29('0x43')]({},_0x1797c9,_0x1e11b3[_0xbc29('0x45')]);var _0xbbd730={'where':_0x1797c9[_0xbc29('0x40')]};return db[_0xbc29('0x46')]['count'](_0xbbd730)[_0xbc29('0x2a')](function(_0x243692){_0x55971f[_0xbc29('0x24')]=_0x243692;if(_0x1e11b3['query']['includeAll']){_0x1797c9[_0xbc29('0x47')]=[{'all':!![]}];}return db[_0xbc29('0x46')][_0xbc29('0x48')](_0x1797c9);})[_0xbc29('0x2a')](function(_0x13d540){_0x55971f[_0xbc29('0x49')]=_0x13d540;return _0x55971f;})[_0xbc29('0x2a')](respondWithFilteredResult(_0x2f23c2,_0x1797c9))[_0xbc29('0x4a')](handleError(_0x2f23c2,null));};exports[_0xbc29('0x4b')]=function(_0x3522f1,_0x86bad5){var _0x33508d={'raw':![],'where':{'id':_0x3522f1['params']['id']}},_0xa352a1={};_0xa352a1[_0xbc29('0x36')]=_['keys'](db[_0xbc29('0x46')][_0xbc29('0x32')]);_0xa352a1[_0xbc29('0x37')]=_[_0xbc29('0x38')](_0x3522f1['query']);_0xa352a1[_0xbc29('0x41')]=_[_0xbc29('0x39')](_0xa352a1[_0xbc29('0x36')],_0xa352a1[_0xbc29('0x37')]);_0x33508d[_0xbc29('0x3b')]=_['intersection'](_0xa352a1[_0xbc29('0x36')],qs[_0xbc29('0x3a')](_0x3522f1[_0xbc29('0x37')][_0xbc29('0x3a')]));_0x33508d[_0xbc29('0x3b')]=_0x33508d['attributes']['length']?_0x33508d[_0xbc29('0x3b')]:_0xa352a1[_0xbc29('0x36')];if(_0x3522f1[_0xbc29('0x37')][_0xbc29('0x4c')]){_0x33508d['include']=[{'all':!![]}];}_0x33508d=_[_0xbc29('0x43')]({},_0x33508d,_0x3522f1[_0xbc29('0x45')]);return db['FreshdeskAccount'][_0xbc29('0x4d')](_0x33508d)['then'](handleEntityNotFound(_0x86bad5,null))[_0xbc29('0x2a')](respondWithResult(_0x86bad5,null))['catch'](handleError(_0x86bad5,null));};exports[_0xbc29('0x4e')]=function(_0x2866b2,_0x2868b3){return db[_0xbc29('0x46')][_0xbc29('0x4e')](_0x2866b2['body'],{})[_0xbc29('0x2a')](respondWithResult(_0x2868b3,0xc9))['catch'](handleError(_0x2868b3,null));};exports['update']=function(_0x2ff594,_0x1fb819){if(_0x2ff594[_0xbc29('0x4f')]['id']){delete _0x2ff594[_0xbc29('0x4f')]['id'];}return db[_0xbc29('0x46')][_0xbc29('0x4d')]({'where':{'id':_0x2ff594[_0xbc29('0x50')]['id']}})[_0xbc29('0x2a')](handleEntityNotFound(_0x1fb819,null))['then'](saveUpdates(_0x2ff594[_0xbc29('0x4f')],null))[_0xbc29('0x2a')](respondWithResult(_0x1fb819,null))[_0xbc29('0x4a')](handleError(_0x1fb819,null));};exports['destroy']=function(_0x3f4323,_0x3f0ad3){return db['FreshdeskAccount'][_0xbc29('0x4d')]({'where':{'id':_0x3f4323[_0xbc29('0x50')]['id']}})[_0xbc29('0x2a')](handleEntityNotFound(_0x3f0ad3,null))[_0xbc29('0x2a')](removeEntity(_0x3f0ad3,null))['catch'](handleError(_0x3f0ad3,null));};exports[_0xbc29('0x51')]=function(_0x1b1cdc,_0x2451d4,_0x3ad005){var _0x5a0bf3={};var _0x30b7ac={};var _0x5c9972;var _0xbeb8f1;return db[_0xbc29('0x46')]['findOne']({'where':{'id':_0x1b1cdc[_0xbc29('0x50')]['id']}})[_0xbc29('0x2a')](handleEntityNotFound(_0x2451d4,null))['then'](function(_0x33d09f){if(_0x33d09f){_0x5c9972=_0x33d09f;_0x30b7ac[_0xbc29('0x36')]=_[_0xbc29('0x38')](db['FreshdeskConfiguration'][_0xbc29('0x32')]);_0x30b7ac[_0xbc29('0x37')]=_[_0xbc29('0x38')](_0x1b1cdc['query']);_0x30b7ac[_0xbc29('0x41')]=_[_0xbc29('0x39')](_0x30b7ac[_0xbc29('0x36')],_0x30b7ac[_0xbc29('0x37')]);_0x5a0bf3[_0xbc29('0x3b')]=_[_0xbc29('0x39')](_0x30b7ac[_0xbc29('0x36')],qs[_0xbc29('0x3a')](_0x1b1cdc[_0xbc29('0x37')]['fields']));_0x5a0bf3[_0xbc29('0x3b')]=_0x5a0bf3[_0xbc29('0x3b')][_0xbc29('0x3c')]?_0x5a0bf3[_0xbc29('0x3b')]:_0x30b7ac['model'];_0x5a0bf3[_0xbc29('0x3e')]=qs[_0xbc29('0x3f')](_0x1b1cdc['query'][_0xbc29('0x3f')]);_0x5a0bf3['where']=qs[_0xbc29('0x41')](_[_0xbc29('0x52')](_0x1b1cdc['query'],_0x30b7ac[_0xbc29('0x41')]));if(_0x1b1cdc[_0xbc29('0x37')][_0xbc29('0x42')]){_0x5a0bf3[_0xbc29('0x40')]=_[_0xbc29('0x43')](_0x5a0bf3[_0xbc29('0x40')],{'$or':_[_0xbc29('0x31')](_0x5a0bf3[_0xbc29('0x3b')],function(_0x5ca6e3){var _0x2e7b87={};_0x2e7b87[_0x5ca6e3]={'$like':'%'+_0x1b1cdc[_0xbc29('0x37')][_0xbc29('0x42')]+'%'};return _0x2e7b87;})});}_0x5a0bf3=_[_0xbc29('0x43')]({},_0x5a0bf3,_0x1b1cdc[_0xbc29('0x45')]);return _0x5c9972[_0xbc29('0x51')](_0x5a0bf3);}})[_0xbc29('0x2a')](function(_0x4d94ff){if(_0x4d94ff){_0xbeb8f1=_0x4d94ff['length'];if(!_0x1b1cdc[_0xbc29('0x37')][_0xbc29('0x53')](_0xbc29('0x3d'))){_0x5a0bf3[_0xbc29('0x23')]=qs[_0xbc29('0x23')](_0x1b1cdc[_0xbc29('0x37')]['limit']);_0x5a0bf3['offset']=qs['offset'](_0x1b1cdc[_0xbc29('0x37')][_0xbc29('0x21')]);}return _0x5c9972['getConfigurations'](_0x5a0bf3);}})[_0xbc29('0x2a')](function(_0x3868ec){if(_0x3868ec){return _0x3868ec?{'count':_0xbeb8f1,'rows':_0x3868ec}:null;}})[_0xbc29('0x2a')](respondWithResult(_0x2451d4,null))[_0xbc29('0x4a')](handleError(_0x2451d4,null));};exports[_0xbc29('0x54')]=function(_0x2eab23,_0x2954f0,_0x5cbc3c){if(_0x2eab23['body']['id']){delete _0x2eab23[_0xbc29('0x4f')]['id'];}return db[_0xbc29('0x46')][_0xbc29('0x55')]({'where':{'id':_0x2eab23['params']['id']}})[_0xbc29('0x2a')](handleEntityNotFound(_0x2954f0,null))[_0xbc29('0x2a')](function(_0x214900){if(_0x214900){_0x2eab23[_0xbc29('0x4f')]['AccountId']=_0x214900['id'];_0x2eab23[_0xbc29('0x4f')][_0xbc29('0x56')]=integrations[_0xbc29('0x57')](_0x2eab23[_0xbc29('0x4f')][_0xbc29('0x58')],_0x2eab23[_0xbc29('0x4f')][_0xbc29('0x34')]);_0x2eab23['body'][_0xbc29('0x59')]=integrations['getDescriptions'](_0x2eab23[_0xbc29('0x4f')][_0xbc29('0x58')],_0x2eab23[_0xbc29('0x4f')][_0xbc29('0x34')]);return db[_0xbc29('0x5a')][_0xbc29('0x4e')](_0x2eab23[_0xbc29('0x4f')],{'include':[{'model':db[_0xbc29('0x5b')],'as':_0xbc29('0x56')},{'model':db[_0xbc29('0x5b')],'as':_0xbc29('0x59')}]});}return null;})[_0xbc29('0x2a')](respondWithResult(_0x2954f0,null))[_0xbc29('0x4a')](handleError(_0x2954f0,null));};exports[_0xbc29('0x5c')]=function(_0x1dd872,_0x3ffe18,_0x223ba5){var _0x33c1a5='';return db[_0xbc29('0x46')][_0xbc29('0x55')]({'where':{'id':_0x1dd872[_0xbc29('0x50')]['id']},'attributes':['id',_0xbc29('0x5d'),_0xbc29('0x5e')]})[_0xbc29('0x2a')](handleEntityNotFound(_0x3ffe18,null))['then'](function(_0x3b3541){if(_0x3b3541){_0x33c1a5=_0x3b3541[_0xbc29('0x5d')];var _0x5ac5f4=_0x33c1a5['slice'](-0x1);if(_0x5ac5f4==='/'){_0x33c1a5=_0x33c1a5[_0xbc29('0x5f')](0x0,_0x33c1a5[_0xbc29('0x60')](_0x5ac5f4));}return rp({'method':_0xbc29('0x61'),'uri':util['format'](_0xbc29('0x62'),_0x33c1a5,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xbc29('0x63')]('Basic\x20%s',new Buffer(util[_0xbc29('0x63')]('%s:X',_0x3b3541[_0xbc29('0x5e')]))[_0xbc29('0x64')](_0xbc29('0x65')))},'json':!![]});}})[_0xbc29('0x2a')](function(_0x1fc164){if(_0x1fc164){var _0x2acd24=[_0xbc29('0x66'),_0xbc29('0x67'),_0xbc29('0x68'),_0xbc29('0x69'),_0xbc29('0x1f'),_0xbc29('0x6a'),_0xbc29('0x6b'),_0xbc29('0x6c'),_0xbc29('0x6d'),_0xbc29('0x6b'),_0xbc29('0x6e')];_[_0xbc29('0x6f')](_0x1fc164,function(_0x20a321){return _0x2acd24[_0xbc29('0x70')](_0x20a321[_0xbc29('0x2e')])||!_0x20a321[_0xbc29('0x71')]&&_0x20a321['type']!==_0xbc29('0x72')&&_0x20a321['type']!==_0xbc29('0x73');});return{'count':_0x1fc164[_0xbc29('0x3c')],'rows':_[_0xbc29('0x31')](_0x1fc164,function(_0x397bb7){return{'id':_0x397bb7[_0xbc29('0x2e')],'name':_0x397bb7[_0xbc29('0x74')],'custom':!_0x397bb7[_0xbc29('0x71')],'options':_0x397bb7[_0xbc29('0x75')]?_[_0xbc29('0x31')](_0x397bb7[_0xbc29('0x75')],function(_0x3f7b3f){return{'name':_[_0xbc29('0x76')](_0x3f7b3f),'value':_0x3f7b3f};}):[]};})};}})[_0xbc29('0x2a')](respondWithResult(_0x3ffe18,null))[_0xbc29('0x4a')](function(_0x55e3a4){var _0x49e0bd=_0x1dd872[_0xbc29('0x37')][_0xbc29('0x77')]?0x1f4:_0x55e3a4[_0xbc29('0x78')]||0x1f4;logger['error'](_0xbc29('0x79'),_0xbc29('0x5c'),_0x49e0bd,JSON[_0xbc29('0x7a')](_0x55e3a4));delete _0x55e3a4[_0xbc29('0x2e')];if(_0x49e0bd===0x191){_0x49e0bd=0x190;}_0x3ffe18[_0xbc29('0x1f')](_0x49e0bd)[_0xbc29('0x2f')](_0x1dd872['query'][_0xbc29('0x77')]?{'message':_0xbc29('0x7b'),'statusCode':_0x55e3a4[_0xbc29('0x78')]}:_0x55e3a4);});};
\ No newline at end of file
+var _0xbf82=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','offset','count','set','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','description','group','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring'];(function(_0x493316,_0x5dc491){var _0x24016a=function(_0x23e1bc){while(--_0x23e1bc){_0x493316['push'](_0x493316['shift']());}};_0x24016a(++_0x5dc491);}(_0xbf82,0x1cb));var _0x2bf8=function(_0x4f4f2e,_0x1c34f5){_0x4f4f2e=_0x4f4f2e-0x0;var _0x102ab1=_0xbf82[_0x4f4f2e];return _0x102ab1;};'use strict';var emlformat=require(_0x2bf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2bf8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2bf8('0x2'));var moment=require(_0x2bf8('0x3'));var BPromise=require(_0x2bf8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2bf8('0x5'));var sox=require(_0x2bf8('0x6'));var csv=require(_0x2bf8('0x7'));var ejs=require(_0x2bf8('0x8'));var fs=require('fs');var fs_extra=require(_0x2bf8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2bf8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2bf8('0xb'));var toCsv=require(_0x2bf8('0x7'));var querystring=require(_0x2bf8('0xc'));var Papa=require('papaparse');var Redis=require(_0x2bf8('0xd'));var authService=require(_0x2bf8('0xe'));var qs=require(_0x2bf8('0xf'));var as=require(_0x2bf8('0x10'));var hardwareService=require(_0x2bf8('0x11'));var logger=require(_0x2bf8('0x12'))(_0x2bf8('0x13'));var utils=require(_0x2bf8('0x14'));var config=require(_0x2bf8('0x15'));var licenseUtil=require(_0x2bf8('0x16'));var db=require(_0x2bf8('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2898a6,_0x5c02da){_0x5c02da=_0x5c02da||0xcc;return function(_0x204df2){if(_0x204df2){return _0x2898a6['sendStatus'](_0x5c02da);}return _0x2898a6['status'](_0x5c02da)[_0x2bf8('0x18')]();};}function respondWithResult(_0x16631e,_0xcfe46c){_0xcfe46c=_0xcfe46c||0xc8;return function(_0x1611e0){if(_0x1611e0){return _0x16631e[_0x2bf8('0x19')](_0xcfe46c)['json'](_0x1611e0);}};}function respondWithFilteredResult(_0x5302cd,_0x169260){return function(_0x3816ac){if(_0x3816ac){var _0x405e72=typeof _0x169260['offset']===_0x2bf8('0x1a')&&typeof _0x169260[_0x2bf8('0x1b')]===_0x2bf8('0x1a');var _0x1294d5=_0x3816ac['count'];var _0x5da512=_0x405e72?0x0:_0x169260[_0x2bf8('0x1c')];var _0x36600a=_0x405e72?_0x3816ac[_0x2bf8('0x1d')]:_0x169260[_0x2bf8('0x1c')]+_0x169260['limit'];var _0x1160df;if(_0x36600a>=_0x1294d5){_0x36600a=_0x1294d5;_0x1160df=0xc8;}else{_0x1160df=0xce;}_0x5302cd[_0x2bf8('0x19')](_0x1160df);return _0x5302cd[_0x2bf8('0x1e')](_0x2bf8('0x1f'),_0x5da512+'-'+_0x36600a+'/'+_0x1294d5)[_0x2bf8('0x20')](_0x3816ac);}return null;};}function patchUpdates(_0x42f58a){return function(_0x4ea3ae){try{jsonpatch['apply'](_0x4ea3ae,_0x42f58a,!![]);}catch(_0x117ca0){return BPromise[_0x2bf8('0x21')](_0x117ca0);}return _0x4ea3ae[_0x2bf8('0x22')]();};}function saveUpdates(_0x1490cd,_0x19baa7){return function(_0x3ee0c6){if(_0x3ee0c6){return _0x3ee0c6[_0x2bf8('0x23')](_0x1490cd)['then'](function(_0x210683){return _0x210683;});}return null;};}function removeEntity(_0x3991db,_0xe96c7){return function(_0x2d4dd7){if(_0x2d4dd7){return _0x2d4dd7['destroy']()[_0x2bf8('0x24')](function(){_0x3991db[_0x2bf8('0x19')](0xcc)[_0x2bf8('0x18')]();});}};}function handleEntityNotFound(_0x1c7560,_0x54cc71){return function(_0x48f31a){if(!_0x48f31a){_0x1c7560[_0x2bf8('0x25')](0x194);}return _0x48f31a;};}function handleError(_0x35c8c4,_0x4b2152){_0x4b2152=_0x4b2152||0x1f4;return function(_0x2a05c9){logger[_0x2bf8('0x26')](_0x2a05c9[_0x2bf8('0x27')]);if(_0x2a05c9[_0x2bf8('0x28')]){delete _0x2a05c9[_0x2bf8('0x28')];}_0x35c8c4[_0x2bf8('0x19')](_0x4b2152)[_0x2bf8('0x29')](_0x2a05c9);};}exports[_0x2bf8('0x2a')]=function(_0xfe7006,_0x1ae98e){var _0x5b5b50={},_0x5a1ab8={},_0x41ffb2={'count':0x0,'rows':[]};var _0x5d89c1=_['map'](db[_0x2bf8('0x2b')][_0x2bf8('0x2c')],function(_0x36cd07){return{'name':_0x36cd07[_0x2bf8('0x2d')],'type':_0x36cd07[_0x2bf8('0x2e')][_0x2bf8('0x2f')]};});_0x5a1ab8[_0x2bf8('0x30')]=_[_0x2bf8('0x31')](_0x5d89c1,'name');_0x5a1ab8[_0x2bf8('0x32')]=_[_0x2bf8('0x33')](_0xfe7006[_0x2bf8('0x32')]);_0x5a1ab8[_0x2bf8('0x34')]=_[_0x2bf8('0x35')](_0x5a1ab8[_0x2bf8('0x30')],_0x5a1ab8[_0x2bf8('0x32')]);_0x5b5b50[_0x2bf8('0x36')]=_[_0x2bf8('0x35')](_0x5a1ab8['model'],qs['fields'](_0xfe7006[_0x2bf8('0x32')]['fields']));_0x5b5b50[_0x2bf8('0x36')]=_0x5b5b50[_0x2bf8('0x36')][_0x2bf8('0x37')]?_0x5b5b50[_0x2bf8('0x36')]:_0x5a1ab8[_0x2bf8('0x30')];if(!_0xfe7006[_0x2bf8('0x32')][_0x2bf8('0x38')](_0x2bf8('0x39'))){_0x5b5b50[_0x2bf8('0x1b')]=qs[_0x2bf8('0x1b')](_0xfe7006[_0x2bf8('0x32')]['limit']);_0x5b5b50[_0x2bf8('0x1c')]=qs[_0x2bf8('0x1c')](_0xfe7006[_0x2bf8('0x32')]['offset']);}_0x5b5b50[_0x2bf8('0x3a')]=qs[_0x2bf8('0x3b')](_0xfe7006[_0x2bf8('0x32')][_0x2bf8('0x3b')]);_0x5b5b50[_0x2bf8('0x3c')]=qs['filters'](_[_0x2bf8('0x3d')](_0xfe7006[_0x2bf8('0x32')],_0x5a1ab8[_0x2bf8('0x34')]),_0x5d89c1);if(_0xfe7006[_0x2bf8('0x32')][_0x2bf8('0x3e')]){_0x5b5b50['where']=_[_0x2bf8('0x3f')](_0x5b5b50[_0x2bf8('0x3c')],{'$or':_[_0x2bf8('0x31')](_0x5d89c1,function(_0x31b6ec){if(_0x31b6ec['type']!==_0x2bf8('0x40')){var _0x9c6bb6={};_0x9c6bb6[_0x31b6ec[_0x2bf8('0x28')]]={'$like':'%'+_0xfe7006[_0x2bf8('0x32')][_0x2bf8('0x3e')]+'%'};return _0x9c6bb6;}})});}_0x5b5b50=_['merge']({},_0x5b5b50,_0xfe7006[_0x2bf8('0x41')]);var _0x4cfe5a={'where':_0x5b5b50[_0x2bf8('0x3c')]};return db[_0x2bf8('0x2b')][_0x2bf8('0x1d')](_0x4cfe5a)['then'](function(_0x28dbd5){_0x41ffb2['count']=_0x28dbd5;if(_0xfe7006[_0x2bf8('0x32')][_0x2bf8('0x42')]){_0x5b5b50[_0x2bf8('0x43')]=[{'all':!![]}];}return db[_0x2bf8('0x2b')][_0x2bf8('0x44')](_0x5b5b50);})['then'](function(_0x7c3ba3){_0x41ffb2[_0x2bf8('0x45')]=_0x7c3ba3;return _0x41ffb2;})[_0x2bf8('0x24')](respondWithFilteredResult(_0x1ae98e,_0x5b5b50))[_0x2bf8('0x46')](handleError(_0x1ae98e,null));};exports[_0x2bf8('0x47')]=function(_0x13dc5a,_0x3afae6){var _0x2a84b4={'raw':![],'where':{'id':_0x13dc5a[_0x2bf8('0x48')]['id']}},_0x4b6f85={};_0x4b6f85[_0x2bf8('0x30')]=_[_0x2bf8('0x33')](db[_0x2bf8('0x2b')][_0x2bf8('0x2c')]);_0x4b6f85[_0x2bf8('0x32')]=_[_0x2bf8('0x33')](_0x13dc5a[_0x2bf8('0x32')]);_0x4b6f85[_0x2bf8('0x34')]=_[_0x2bf8('0x35')](_0x4b6f85[_0x2bf8('0x30')],_0x4b6f85[_0x2bf8('0x32')]);_0x2a84b4[_0x2bf8('0x36')]=_[_0x2bf8('0x35')](_0x4b6f85[_0x2bf8('0x30')],qs[_0x2bf8('0x49')](_0x13dc5a[_0x2bf8('0x32')]['fields']));_0x2a84b4[_0x2bf8('0x36')]=_0x2a84b4[_0x2bf8('0x36')][_0x2bf8('0x37')]?_0x2a84b4[_0x2bf8('0x36')]:_0x4b6f85[_0x2bf8('0x30')];if(_0x13dc5a[_0x2bf8('0x32')]['includeAll']){_0x2a84b4['include']=[{'all':!![]}];}_0x2a84b4=_['merge']({},_0x2a84b4,_0x13dc5a['options']);return db[_0x2bf8('0x2b')][_0x2bf8('0x4a')](_0x2a84b4)[_0x2bf8('0x24')](handleEntityNotFound(_0x3afae6,null))['then'](respondWithResult(_0x3afae6,null))[_0x2bf8('0x46')](handleError(_0x3afae6,null));};exports[_0x2bf8('0x4b')]=function(_0x556ca0,_0x441030){return db[_0x2bf8('0x2b')][_0x2bf8('0x4b')](_0x556ca0[_0x2bf8('0x4c')],{})['then'](respondWithResult(_0x441030,0xc9))[_0x2bf8('0x46')](handleError(_0x441030,null));};exports['update']=function(_0x1443f2,_0x5789e5){if(_0x1443f2[_0x2bf8('0x4c')]['id']){delete _0x1443f2[_0x2bf8('0x4c')]['id'];}return db[_0x2bf8('0x2b')][_0x2bf8('0x4a')]({'where':{'id':_0x1443f2[_0x2bf8('0x48')]['id']}})[_0x2bf8('0x24')](handleEntityNotFound(_0x5789e5,null))[_0x2bf8('0x24')](saveUpdates(_0x1443f2['body'],null))[_0x2bf8('0x24')](respondWithResult(_0x5789e5,null))[_0x2bf8('0x46')](handleError(_0x5789e5,null));};exports[_0x2bf8('0x4d')]=function(_0x5d6b41,_0x944006){return db[_0x2bf8('0x2b')][_0x2bf8('0x4a')]({'where':{'id':_0x5d6b41[_0x2bf8('0x48')]['id']}})[_0x2bf8('0x24')](handleEntityNotFound(_0x944006,null))[_0x2bf8('0x24')](removeEntity(_0x944006,null))[_0x2bf8('0x46')](handleError(_0x944006,null));};exports['getConfigurations']=function(_0x567f08,_0xc628dc,_0x3401ef){var _0xd8f42b={};var _0xc059bb={};var _0x4ac6b8;var _0x481e6f;return db[_0x2bf8('0x2b')][_0x2bf8('0x4e')]({'where':{'id':_0x567f08[_0x2bf8('0x48')]['id']}})[_0x2bf8('0x24')](handleEntityNotFound(_0xc628dc,null))['then'](function(_0x411537){if(_0x411537){_0x4ac6b8=_0x411537;_0xc059bb[_0x2bf8('0x30')]=_[_0x2bf8('0x33')](db['FreshdeskConfiguration'][_0x2bf8('0x2c')]);_0xc059bb[_0x2bf8('0x32')]=_[_0x2bf8('0x33')](_0x567f08[_0x2bf8('0x32')]);_0xc059bb[_0x2bf8('0x34')]=_['intersection'](_0xc059bb[_0x2bf8('0x30')],_0xc059bb[_0x2bf8('0x32')]);_0xd8f42b[_0x2bf8('0x36')]=_[_0x2bf8('0x35')](_0xc059bb[_0x2bf8('0x30')],qs[_0x2bf8('0x49')](_0x567f08[_0x2bf8('0x32')][_0x2bf8('0x49')]));_0xd8f42b['attributes']=_0xd8f42b[_0x2bf8('0x36')][_0x2bf8('0x37')]?_0xd8f42b[_0x2bf8('0x36')]:_0xc059bb[_0x2bf8('0x30')];_0xd8f42b[_0x2bf8('0x3a')]=qs[_0x2bf8('0x3b')](_0x567f08[_0x2bf8('0x32')]['sort']);_0xd8f42b[_0x2bf8('0x3c')]=qs['filters'](_[_0x2bf8('0x3d')](_0x567f08[_0x2bf8('0x32')],_0xc059bb['filters']));if(_0x567f08[_0x2bf8('0x32')][_0x2bf8('0x3e')]){_0xd8f42b[_0x2bf8('0x3c')]=_['merge'](_0xd8f42b['where'],{'$or':_['map'](_0xd8f42b[_0x2bf8('0x36')],function(_0x5f19a0){var _0x9071b5={};_0x9071b5[_0x5f19a0]={'$like':'%'+_0x567f08[_0x2bf8('0x32')][_0x2bf8('0x3e')]+'%'};return _0x9071b5;})});}_0xd8f42b=_['merge']({},_0xd8f42b,_0x567f08[_0x2bf8('0x41')]);return _0x4ac6b8[_0x2bf8('0x4f')](_0xd8f42b);}})[_0x2bf8('0x24')](function(_0x4350db){if(_0x4350db){_0x481e6f=_0x4350db[_0x2bf8('0x37')];if(!_0x567f08[_0x2bf8('0x32')][_0x2bf8('0x38')]('nolimit')){_0xd8f42b[_0x2bf8('0x1b')]=qs[_0x2bf8('0x1b')](_0x567f08[_0x2bf8('0x32')]['limit']);_0xd8f42b[_0x2bf8('0x1c')]=qs[_0x2bf8('0x1c')](_0x567f08['query']['offset']);}return _0x4ac6b8[_0x2bf8('0x4f')](_0xd8f42b);}})['then'](function(_0x380367){if(_0x380367){return _0x380367?{'count':_0x481e6f,'rows':_0x380367}:null;}})['then'](respondWithResult(_0xc628dc,null))[_0x2bf8('0x46')](handleError(_0xc628dc,null));};exports[_0x2bf8('0x50')]=function(_0x591a94,_0x193a76,_0x570587){if(_0x591a94['body']['id']){delete _0x591a94[_0x2bf8('0x4c')]['id'];}return db[_0x2bf8('0x2b')][_0x2bf8('0x4e')]({'where':{'id':_0x591a94[_0x2bf8('0x48')]['id']}})['then'](handleEntityNotFound(_0x193a76,null))[_0x2bf8('0x24')](function(_0x365df5){if(_0x365df5){_0x591a94['body'][_0x2bf8('0x51')]=_0x365df5['id'];_0x591a94[_0x2bf8('0x4c')][_0x2bf8('0x52')]=integrations[_0x2bf8('0x53')](_0x591a94[_0x2bf8('0x4c')][_0x2bf8('0x54')],_0x591a94['body'][_0x2bf8('0x2e')]);_0x591a94[_0x2bf8('0x4c')][_0x2bf8('0x55')]=integrations[_0x2bf8('0x56')](_0x591a94[_0x2bf8('0x4c')][_0x2bf8('0x54')],_0x591a94[_0x2bf8('0x4c')][_0x2bf8('0x2e')]);return db['FreshdeskConfiguration'][_0x2bf8('0x4b')](_0x591a94[_0x2bf8('0x4c')],{'include':[{'model':db['FreshdeskField'],'as':_0x2bf8('0x52')},{'model':db[_0x2bf8('0x57')],'as':'Descriptions'}]});}return null;})[_0x2bf8('0x24')](respondWithResult(_0x193a76,null))['catch'](handleError(_0x193a76,null));};exports[_0x2bf8('0x58')]=function(_0x5d043f,_0x2c9bab,_0x2d0a82){var _0x59da26='';return db[_0x2bf8('0x2b')][_0x2bf8('0x4e')]({'where':{'id':_0x5d043f[_0x2bf8('0x48')]['id']},'attributes':['id',_0x2bf8('0x59'),_0x2bf8('0x5a')]})[_0x2bf8('0x24')](handleEntityNotFound(_0x2c9bab,null))[_0x2bf8('0x24')](function(_0x3e856b){if(_0x3e856b){_0x59da26=_0x3e856b[_0x2bf8('0x59')];var _0x58c312=_0x59da26[_0x2bf8('0x5b')](-0x1);if(_0x58c312==='/'){_0x59da26=_0x59da26[_0x2bf8('0x5c')](0x0,_0x59da26[_0x2bf8('0x5d')](_0x58c312));}return rp({'method':_0x2bf8('0x5e'),'uri':util[_0x2bf8('0x5f')]('%s/%s',_0x59da26,_0x2bf8('0x60')),'headers':{'Authorization':util[_0x2bf8('0x5f')]('Basic\x20%s',new Buffer(util[_0x2bf8('0x5f')](_0x2bf8('0x61'),_0x3e856b[_0x2bf8('0x5a')]))[_0x2bf8('0x62')](_0x2bf8('0x63')))},'json':!![]});}})['then'](function(_0x26209a){if(_0x26209a){var _0x3b56f3=[_0x2bf8('0x64'),_0x2bf8('0x65'),_0x2bf8('0x66'),_0x2bf8('0x67'),_0x2bf8('0x19'),'priority',_0x2bf8('0x68'),'source',_0x2bf8('0x69'),_0x2bf8('0x68'),'company'];_[_0x2bf8('0x6a')](_0x26209a,function(_0x35ed42){return _0x3b56f3[_0x2bf8('0x6b')](_0x35ed42[_0x2bf8('0x28')])||!_0x35ed42[_0x2bf8('0x6c')]&&_0x35ed42[_0x2bf8('0x2e')]!==_0x2bf8('0x6d')&&_0x35ed42[_0x2bf8('0x2e')]!==_0x2bf8('0x6e');});return{'count':_0x26209a['length'],'rows':_[_0x2bf8('0x31')](_0x26209a,function(_0x2c7923){return{'id':_0x2c7923[_0x2bf8('0x28')],'name':_0x2c7923[_0x2bf8('0x6f')],'custom':!_0x2c7923[_0x2bf8('0x6c')],'options':_0x2c7923[_0x2bf8('0x70')]?_['map'](_0x2c7923[_0x2bf8('0x70')],function(_0x6d74fa){return{'name':_[_0x2bf8('0x71')](_0x6d74fa),'value':_0x6d74fa};}):[]};})};}})[_0x2bf8('0x24')](respondWithResult(_0x2c9bab,null))[_0x2bf8('0x46')](function(_0x544533){var _0x38b53f=_0x5d043f['query'][_0x2bf8('0x72')]?0x1f4:_0x544533[_0x2bf8('0x73')]||0x1f4;logger[_0x2bf8('0x26')](_0x2bf8('0x74'),'getFields',_0x38b53f,JSON[_0x2bf8('0x75')](_0x544533));delete _0x544533[_0x2bf8('0x28')];if(_0x38b53f===0x191){_0x38b53f=0x190;}_0x2c9bab['status'](_0x38b53f)[_0x2bf8('0x29')](_0x5d043f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x544533[_0x2bf8('0x73')]}:_0x544533);});};
\ No newline at end of file
index a8d7e07..18157e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x953c=['define','FreshdeskAccount','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x953c,0xc2));var _0xc953=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x953c[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xc953('0x0'));var logger=require(_0xc953('0x1'))(_0xc953('0x2'));var moment=require(_0xc953('0x3'));var BPromise=require('bluebird');var rp=require(_0xc953('0x4'));var fs=require('fs');var path=require(_0xc953('0x5'));var rimraf=require(_0xc953('0x6'));var config=require(_0xc953('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xc953('0x8'));module[_0xc953('0x9')]=function(_0x1b2dea,_0x4d1535){return _0x1b2dea[_0xc953('0xa')](_0xc953('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe62d=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x490542,_0x66a1b1){var _0x321b03=function(_0xe23f2b){while(--_0xe23f2b){_0x490542['push'](_0x490542['shift']());}};_0x321b03(++_0x66a1b1);}(_0xe62d,0x1a5));var _0xde62=function(_0x403db1,_0x59018e){_0x403db1=_0x403db1-0x0;var _0x47c48f=_0xe62d[_0x403db1];return _0x47c48f;};'use strict';var _=require(_0xde62('0x0'));var util=require(_0xde62('0x1'));var logger=require(_0xde62('0x2'))(_0xde62('0x3'));var moment=require(_0xde62('0x4'));var BPromise=require(_0xde62('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xde62('0x6'));var attributes=require(_0xde62('0x7'));var integrations=require(_0xde62('0x8'));module[_0xde62('0x9')]=function(_0x22271,_0xd89073){return _0x22271[_0xde62('0xa')](_0xde62('0xb'),attributes,{'tableName':_0xde62('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8636ae1..ec0e3b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9169=['where','limit','map','include','model','attributes','debug','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0x9169,0x9c));var _0x9916=function(_0x4ccbee,_0x25b67c){_0x4ccbee=_0x4ccbee-0x0;var _0x33f651=_0x9169[_0x4ccbee];return _0x33f651;};'use strict';var _=require(_0x9916('0x0'));var util=require(_0x9916('0x1'));var moment=require(_0x9916('0x2'));var BPromise=require(_0x9916('0x3'));var rs=require(_0x9916('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9916('0x5'))['db'];var utils=require(_0x9916('0x6'));var logger=require(_0x9916('0x7'))(_0x9916('0x8'));var config=require(_0x9916('0x9'));var jayson=require(_0x9916('0xa'));var client=jayson[_0x9916('0xb')][_0x9916('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54d2c3,_0x37b888,_0x4aecd7){return new BPromise(function(_0x12c26c,_0x34cece){return client['request'](_0x54d2c3,_0x4aecd7)[_0x9916('0xd')](function(_0x5336df){logger[_0x9916('0xe')](_0x9916('0xf'),_0x37b888,'request\x20sent');logger['debug'](_0x9916('0x10'),_0x37b888,_0x9916('0x11'),JSON[_0x9916('0x12')](_0x5336df));if(_0x5336df[_0x9916('0x13')]){if(_0x5336df[_0x9916('0x13')][_0x9916('0x14')]===0x1f4){logger['error'](_0x9916('0xf'),_0x37b888,_0x5336df[_0x9916('0x13')][_0x9916('0x15')]);return _0x34cece(_0x5336df[_0x9916('0x13')]['message']);}logger[_0x9916('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x37b888,_0x5336df[_0x9916('0x13')]['message']);return _0x12c26c(_0x5336df[_0x9916('0x13')][_0x9916('0x15')]);}else{logger[_0x9916('0xe')](_0x9916('0xf'),_0x37b888,'request\x20sent');_0x12c26c(_0x5336df[_0x9916('0x16')][_0x9916('0x15')]);}})[_0x9916('0x17')](function(_0x3884a9){logger[_0x9916('0x13')](_0x9916('0xf'),_0x37b888,_0x3884a9);_0x34cece(_0x3884a9);});});}exports[_0x9916('0x18')]=function(_0x584f44){var _0x1cca7c=this;return new Promise(function(_0x53549c,_0x3a6273){return db[_0x9916('0x19')][_0x9916('0x1a')]({'raw':_0x584f44[_0x9916('0x1b')]?_0x584f44[_0x9916('0x1b')][_0x9916('0x1c')]===undefined?!![]:![]:!![],'where':_0x584f44[_0x9916('0x1b')]?_0x584f44[_0x9916('0x1b')][_0x9916('0x1d')]||null:null,'attributes':_0x584f44['options']?_0x584f44[_0x9916('0x1b')]['attributes']||null:null,'limit':_0x584f44[_0x9916('0x1b')]?_0x584f44[_0x9916('0x1b')][_0x9916('0x1e')]||null:null,'include':_0x584f44['options']?_0x584f44['options']['include']?_[_0x9916('0x1f')](_0x584f44[_0x9916('0x1b')][_0x9916('0x20')],function(_0x5d1962){return{'model':db[_0x5d1962[_0x9916('0x21')]],'as':_0x5d1962['as'],'attributes':_0x5d1962['attributes'],'include':_0x5d1962['include']?_[_0x9916('0x1f')](_0x5d1962['include'],function(_0x36f123){return{'model':db[_0x36f123[_0x9916('0x21')]],'as':_0x36f123['as'],'attributes':_0x36f123['attributes'],'include':_0x36f123[_0x9916('0x20')]?_['map'](_0x36f123['include'],function(_0x46b949){return{'model':db[_0x46b949[_0x9916('0x21')]],'as':_0x46b949['as'],'attributes':_0x46b949[_0x9916('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9916('0xd')](function(_0xe65de5){logger[_0x9916('0xe')](_0x9916('0x18'),_0x584f44);logger[_0x9916('0x23')](_0x9916('0x18'),_0x584f44,JSON[_0x9916('0x12')](_0xe65de5));_0x53549c(_0xe65de5);})[_0x9916('0x17')](function(_0x2869e6){logger['error'](_0x9916('0x18'),_0x2869e6[_0x9916('0x15')],_0x584f44);_0x3a6273(_0x1cca7c[_0x9916('0x13')](0x1f4,_0x2869e6[_0x9916('0x15')]));});});};exports[_0x9916('0x24')]=function(_0x4783a4){var _0x164ecf=this;return new Promise(function(_0x49b0e8,_0x5ec890){return db['FreshdeskAccount']['find']({'raw':_0x4783a4[_0x9916('0x1b')]?_0x4783a4[_0x9916('0x1b')][_0x9916('0x1c')]===undefined?!![]:![]:!![],'where':_0x4783a4['options']?_0x4783a4[_0x9916('0x1b')][_0x9916('0x1d')]||null:null,'attributes':_0x4783a4[_0x9916('0x1b')]?_0x4783a4[_0x9916('0x1b')][_0x9916('0x22')]||null:null,'include':_0x4783a4[_0x9916('0x1b')]?_0x4783a4['options'][_0x9916('0x20')]?_[_0x9916('0x1f')](_0x4783a4['options'][_0x9916('0x20')],function(_0x50f8a0){return{'model':db[_0x50f8a0['model']],'as':_0x50f8a0['as'],'attributes':_0x50f8a0[_0x9916('0x22')],'include':_0x50f8a0[_0x9916('0x20')]?_[_0x9916('0x1f')](_0x50f8a0['include'],function(_0x22a608){return{'model':db[_0x22a608[_0x9916('0x21')]],'as':_0x22a608['as'],'attributes':_0x22a608[_0x9916('0x22')],'include':_0x22a608[_0x9916('0x20')]?_[_0x9916('0x1f')](_0x22a608[_0x9916('0x20')],function(_0x3a6ec1){return{'model':db[_0x3a6ec1[_0x9916('0x21')]],'as':_0x3a6ec1['as'],'attributes':_0x3a6ec1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9916('0xd')](function(_0x4bc311){logger[_0x9916('0xe')](_0x9916('0x24'),_0x4783a4);logger['debug']('ShowFreshdeskAccount',_0x4783a4,JSON[_0x9916('0x12')](_0x4bc311));_0x49b0e8(_0x4bc311);})[_0x9916('0x17')](function(_0xe6de5){logger[_0x9916('0x13')](_0x9916('0x24'),_0xe6de5['message'],_0x4783a4);_0x5ec890(_0x164ecf[_0x9916('0x13')](0x1f4,_0xe6de5[_0x9916('0x15')]));});});};
\ No newline at end of file
+var _0x1b3d=['model','then','debug','catch','ShowFreshdeskAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x1ceec5,_0x4b32cc){var _0x4b588d=function(_0x3c79a2){while(--_0x3c79a2){_0x1ceec5['push'](_0x1ceec5['shift']());}};_0x4b588d(++_0x4b32cc);}(_0x1b3d,0xc5));var _0xd1b3=function(_0x364e4e,_0x44ef54){_0x364e4e=_0x364e4e-0x0;var _0x40f9dc=_0x1b3d[_0x364e4e];return _0x40f9dc;};'use strict';var _=require(_0xd1b3('0x0'));var util=require('util');var moment=require(_0xd1b3('0x1'));var BPromise=require(_0xd1b3('0x2'));var rs=require(_0xd1b3('0x3'));var fs=require('fs');var Redis=require(_0xd1b3('0x4'));var db=require(_0xd1b3('0x5'))['db'];var utils=require(_0xd1b3('0x6'));var logger=require(_0xd1b3('0x7'))('rpc');var config=require(_0xd1b3('0x8'));var jayson=require(_0xd1b3('0x9'));var client=jayson[_0xd1b3('0xa')][_0xd1b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44d118,_0x3d5fc7,_0x57298d){return new BPromise(function(_0x358004,_0x78f290){return client[_0xd1b3('0xc')](_0x44d118,_0x57298d)['then'](function(_0x4dbacd){logger[_0xd1b3('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x3d5fc7,_0xd1b3('0xe'));logger['debug'](_0xd1b3('0xf'),_0x3d5fc7,'request\x20sent',JSON[_0xd1b3('0x10')](_0x4dbacd));if(_0x4dbacd[_0xd1b3('0x11')]){if(_0x4dbacd['error'][_0xd1b3('0x12')]===0x1f4){logger[_0xd1b3('0x11')](_0xd1b3('0x13'),_0x3d5fc7,_0x4dbacd['error'][_0xd1b3('0x14')]);return _0x78f290(_0x4dbacd[_0xd1b3('0x11')][_0xd1b3('0x14')]);}logger[_0xd1b3('0x11')](_0xd1b3('0x13'),_0x3d5fc7,_0x4dbacd[_0xd1b3('0x11')]['message']);return _0x358004(_0x4dbacd[_0xd1b3('0x11')]['message']);}else{logger[_0xd1b3('0xd')](_0xd1b3('0x13'),_0x3d5fc7,_0xd1b3('0xe'));_0x358004(_0x4dbacd[_0xd1b3('0x15')]['message']);}})['catch'](function(_0x4e1b06){logger[_0xd1b3('0x11')](_0xd1b3('0x13'),_0x3d5fc7,_0x4e1b06);_0x78f290(_0x4e1b06);});});}exports[_0xd1b3('0x16')]=function(_0x197d84){var _0x53131d=this;return new Promise(function(_0x2edbfe,_0x52b5f3){return db[_0xd1b3('0x17')][_0xd1b3('0x18')]({'raw':_0x197d84[_0xd1b3('0x19')]?_0x197d84[_0xd1b3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x197d84['options']?_0x197d84[_0xd1b3('0x19')][_0xd1b3('0x1a')]||null:null,'attributes':_0x197d84['options']?_0x197d84[_0xd1b3('0x19')][_0xd1b3('0x1b')]||null:null,'limit':_0x197d84[_0xd1b3('0x19')]?_0x197d84[_0xd1b3('0x19')][_0xd1b3('0x1c')]||null:null,'include':_0x197d84['options']?_0x197d84[_0xd1b3('0x19')][_0xd1b3('0x1d')]?_[_0xd1b3('0x1e')](_0x197d84[_0xd1b3('0x19')][_0xd1b3('0x1d')],function(_0x4a6931){return{'model':db[_0x4a6931[_0xd1b3('0x1f')]],'as':_0x4a6931['as'],'attributes':_0x4a6931[_0xd1b3('0x1b')],'include':_0x4a6931['include']?_[_0xd1b3('0x1e')](_0x4a6931['include'],function(_0x279709){return{'model':db[_0x279709['model']],'as':_0x279709['as'],'attributes':_0x279709['attributes'],'include':_0x279709[_0xd1b3('0x1d')]?_[_0xd1b3('0x1e')](_0x279709[_0xd1b3('0x1d')],function(_0x12a459){return{'model':db[_0x12a459['model']],'as':_0x12a459['as'],'attributes':_0x12a459[_0xd1b3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd1b3('0x20')](function(_0x2ebb10){logger[_0xd1b3('0xd')](_0xd1b3('0x16'),_0x197d84);logger[_0xd1b3('0x21')](_0xd1b3('0x16'),_0x197d84,JSON[_0xd1b3('0x10')](_0x2ebb10));_0x2edbfe(_0x2ebb10);})[_0xd1b3('0x22')](function(_0x27f9ef){logger['error'](_0xd1b3('0x16'),_0x27f9ef[_0xd1b3('0x14')],_0x197d84);_0x52b5f3(_0x53131d[_0xd1b3('0x11')](0x1f4,_0x27f9ef[_0xd1b3('0x14')]));});});};exports[_0xd1b3('0x23')]=function(_0x13c553){var _0x452eaa=this;return new Promise(function(_0x472ff4,_0x22b2a9){return db['FreshdeskAccount'][_0xd1b3('0x24')]({'raw':_0x13c553['options']?_0x13c553[_0xd1b3('0x19')][_0xd1b3('0x25')]===undefined?!![]:![]:!![],'where':_0x13c553['options']?_0x13c553['options'][_0xd1b3('0x1a')]||null:null,'attributes':_0x13c553['options']?_0x13c553[_0xd1b3('0x19')]['attributes']||null:null,'include':_0x13c553['options']?_0x13c553[_0xd1b3('0x19')][_0xd1b3('0x1d')]?_[_0xd1b3('0x1e')](_0x13c553[_0xd1b3('0x19')][_0xd1b3('0x1d')],function(_0x2280d5){return{'model':db[_0x2280d5[_0xd1b3('0x1f')]],'as':_0x2280d5['as'],'attributes':_0x2280d5['attributes'],'include':_0x2280d5[_0xd1b3('0x1d')]?_[_0xd1b3('0x1e')](_0x2280d5['include'],function(_0xb5f793){return{'model':db[_0xb5f793[_0xd1b3('0x1f')]],'as':_0xb5f793['as'],'attributes':_0xb5f793[_0xd1b3('0x1b')],'include':_0xb5f793[_0xd1b3('0x1d')]?_[_0xd1b3('0x1e')](_0xb5f793[_0xd1b3('0x1d')],function(_0x32b26b){return{'model':db[_0x32b26b[_0xd1b3('0x1f')]],'as':_0x32b26b['as'],'attributes':_0x32b26b[_0xd1b3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd1b3('0x20')](function(_0x2a9ab8){logger[_0xd1b3('0xd')](_0xd1b3('0x23'),_0x13c553);logger[_0xd1b3('0x21')]('ShowFreshdeskAccount',_0x13c553,JSON[_0xd1b3('0x10')](_0x2a9ab8));_0x472ff4(_0x2a9ab8);})[_0xd1b3('0x22')](function(_0x421f5b){logger[_0xd1b3('0x11')](_0xd1b3('0x23'),_0x421f5b[_0xd1b3('0x14')],_0x13c553);_0x22b2a9(_0x452eaa['error'](0x1f4,_0x421f5b['message']));});});};
\ No newline at end of file
index 1784407..e5e5e20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb45=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','show','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x335d00,_0x46652f){var _0x422ec0=function(_0x5b7f54){while(--_0x5b7f54){_0x335d00['push'](_0x335d00['shift']());}};_0x422ec0(++_0x46652f);}(_0xcb45,0x1e1));var _0x5cb4=function(_0x1dd6fc,_0x13dcbf){_0x1dd6fc=_0x1dd6fc-0x0;var _0x1731c6=_0xcb45[_0x1dd6fc];return _0x1731c6;};'use strict';var multer=require(_0x5cb4('0x0'));var util=require('util');var path=require(_0x5cb4('0x1'));var timeout=require('connect-timeout');var express=require(_0x5cb4('0x2'));var router=express[_0x5cb4('0x3')]();var fs_extra=require(_0x5cb4('0x4'));var auth=require(_0x5cb4('0x5'));var interaction=require(_0x5cb4('0x6'));var config=require(_0x5cb4('0x7'));var controller=require(_0x5cb4('0x8'));router['get']('/',auth[_0x5cb4('0x9')](),controller[_0x5cb4('0xa')]);router[_0x5cb4('0xb')]('/:id',auth[_0x5cb4('0x9')](),controller[_0x5cb4('0xc')]);router['get']('/:id/fields',auth[_0x5cb4('0x9')](),controller[_0x5cb4('0xd')]);router['get']('/:id/subjects',auth[_0x5cb4('0x9')](),controller[_0x5cb4('0xe')]);router['get'](_0x5cb4('0xf'),auth['isAuthenticated'](),controller[_0x5cb4('0x10')]);router[_0x5cb4('0xb')]('/:id/tags',auth[_0x5cb4('0x9')](),controller[_0x5cb4('0x11')]);router[_0x5cb4('0x12')]('/',auth['isAuthenticated'](),controller[_0x5cb4('0x13')]);router[_0x5cb4('0x12')](_0x5cb4('0x14'),auth[_0x5cb4('0x9')](),controller['setTags']);router[_0x5cb4('0x15')](_0x5cb4('0x16'),auth[_0x5cb4('0x9')](),controller[_0x5cb4('0x17')]);router[_0x5cb4('0x18')](_0x5cb4('0x16'),auth[_0x5cb4('0x9')](),controller[_0x5cb4('0x19')]);module[_0x5cb4('0x1a')]=router;
\ No newline at end of file
+var _0x9d4c=['./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','update','delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1213a0,_0x5429f9){var _0x21fea1=function(_0x9d21d0){while(--_0x9d21d0){_0x1213a0['push'](_0x1213a0['shift']());}};_0x21fea1(++_0x5429f9);}(_0x9d4c,0xcc));var _0xc9d4=function(_0x1fa805,_0x33eb74){_0x1fa805=_0x1fa805-0x0;var _0x30958c=_0x9d4c[_0x1fa805];return _0x30958c;};'use strict';var multer=require('multer');var util=require(_0xc9d4('0x0'));var path=require('path');var timeout=require(_0xc9d4('0x1'));var express=require('express');var router=express[_0xc9d4('0x2')]();var fs_extra=require(_0xc9d4('0x3'));var auth=require(_0xc9d4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc9d4('0x5'));var controller=require(_0xc9d4('0x6'));router[_0xc9d4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc9d4('0x8'),auth[_0xc9d4('0x9')](),controller['show']);router[_0xc9d4('0x7')](_0xc9d4('0xa'),auth[_0xc9d4('0x9')](),controller['getFields']);router[_0xc9d4('0x7')](_0xc9d4('0xb'),auth[_0xc9d4('0x9')](),controller[_0xc9d4('0xc')]);router['get'](_0xc9d4('0xd'),auth[_0xc9d4('0x9')](),controller[_0xc9d4('0xe')]);router[_0xc9d4('0x7')]('/:id/tags',auth[_0xc9d4('0x9')](),controller[_0xc9d4('0xf')]);router[_0xc9d4('0x10')]('/',auth['isAuthenticated'](),controller[_0xc9d4('0x11')]);router[_0xc9d4('0x10')](_0xc9d4('0x12'),auth[_0xc9d4('0x9')](),controller['setTags']);router['put']('/:id',auth[_0xc9d4('0x9')](),controller[_0xc9d4('0x13')]);router[_0xc9d4('0x14')](_0xc9d4('0x8'),auth[_0xc9d4('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 6136649..c7b7642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9df=['STRING','sequelize','exports'];(function(_0x2a12dd,_0x41d2be){var _0x1aeb20=function(_0xea50f2){while(--_0xea50f2){_0x2a12dd['push'](_0x2a12dd['shift']());}};_0x1aeb20(++_0x41d2be);}(_0xf9df,0x166));var _0xff9d=function(_0x54ee24,_0x28d313){_0x54ee24=_0x54ee24-0x0;var _0x4cbd29=_0xf9df[_0x54ee24];return _0x4cbd29;};'use strict';var Sequelize=require(_0xff9d('0x0'));module[_0xff9d('0x1')]={'name':{'type':Sequelize[_0xff9d('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x30fb=['exports','STRING'];(function(_0x33dbe7,_0x2baac5){var _0x6a957f=function(_0x1d1135){while(--_0x1d1135){_0x33dbe7['push'](_0x33dbe7['shift']());}};_0x6a957f(++_0x2baac5);}(_0x30fb,0x1bc));var _0xb30f=function(_0x38c280,_0x38c8a6){_0x38c280=_0x38c280-0x0;var _0x527f69=_0x30fb[_0x38c280];return _0x527f69;};'use strict';var Sequelize=require('sequelize');module[_0xb30f('0x0')]={'name':{'type':Sequelize[_0xb30f('0x1')]},'description':{'type':Sequelize[_0xb30f('0x1')]}};
\ No newline at end of file
index 19878e7..a986984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf0=['show','params','includeAll','catch','create','body','find','getFields','findOne','FreshdeskField','pick','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','include','rows'];(function(_0x4c901d,_0x3733e4){var _0x4b7ae2=function(_0x685dfb){while(--_0x685dfb){_0x4c901d['push'](_0x4c901d['shift']());}};_0x4b7ae2(++_0x3733e4);}(_0xacf0,0x69));var _0x0acf=function(_0x3043e2,_0x2fa9ac){_0x3043e2=_0x3043e2-0x0;var _0x108d92=_0xacf0[_0x3043e2];return _0x108d92;};'use strict';var emlformat=require(_0x0acf('0x0'));var rimraf=require(_0x0acf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0acf('0x2'));var rp=require(_0x0acf('0x3'));var moment=require(_0x0acf('0x4'));var BPromise=require(_0x0acf('0x5'));var Mustache=require('mustache');var util=require(_0x0acf('0x6'));var path=require(_0x0acf('0x7'));var sox=require(_0x0acf('0x8'));var csv=require(_0x0acf('0x9'));var ejs=require(_0x0acf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0acf('0xb'));var squel=require(_0x0acf('0xc'));var crypto=require(_0x0acf('0xd'));var jsforce=require(_0x0acf('0xe'));var deskjs=require(_0x0acf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0acf('0x10'));var Papa=require(_0x0acf('0x11'));var Redis=require(_0x0acf('0x12'));var authService=require(_0x0acf('0x13'));var qs=require(_0x0acf('0x14'));var as=require(_0x0acf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0acf('0x16'))(_0x0acf('0x17'));var utils=require(_0x0acf('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0acf('0x19'));var db=require(_0x0acf('0x1a'))['db'];function respondWithStatusCode(_0x5ca468,_0x5a531f){_0x5a531f=_0x5a531f||0xcc;return function(_0x27bb3a){if(_0x27bb3a){return _0x5ca468['sendStatus'](_0x5a531f);}return _0x5ca468[_0x0acf('0x1b')](_0x5a531f)[_0x0acf('0x1c')]();};}function respondWithResult(_0x508665,_0x178ca5){_0x178ca5=_0x178ca5||0xc8;return function(_0x18edc4){if(_0x18edc4){return _0x508665[_0x0acf('0x1b')](_0x178ca5)['json'](_0x18edc4);}};}function respondWithFilteredResult(_0x25ca89,_0x11b7c5){return function(_0x5a8fc0){if(_0x5a8fc0){var _0x33db63=typeof _0x11b7c5[_0x0acf('0x1d')]==='undefined'&&typeof _0x11b7c5[_0x0acf('0x1e')]===_0x0acf('0x1f');var _0x3ce484=_0x5a8fc0[_0x0acf('0x20')];var _0x2a7e7e=_0x33db63?0x0:_0x11b7c5[_0x0acf('0x1d')];var _0x516040=_0x33db63?_0x5a8fc0[_0x0acf('0x20')]:_0x11b7c5[_0x0acf('0x1d')]+_0x11b7c5['limit'];var _0x1970cc;if(_0x516040>=_0x3ce484){_0x516040=_0x3ce484;_0x1970cc=0xc8;}else{_0x1970cc=0xce;}_0x25ca89[_0x0acf('0x1b')](_0x1970cc);return _0x25ca89[_0x0acf('0x21')](_0x0acf('0x22'),_0x2a7e7e+'-'+_0x516040+'/'+_0x3ce484)[_0x0acf('0x23')](_0x5a8fc0);}return null;};}function patchUpdates(_0x2a2684){return function(_0x116a5a){try{jsonpatch[_0x0acf('0x24')](_0x116a5a,_0x2a2684,!![]);}catch(_0x4e92a4){return BPromise[_0x0acf('0x25')](_0x4e92a4);}return _0x116a5a['save']();};}function saveUpdates(_0x45274a,_0x3cb0e3){return function(_0x2796a4){if(_0x2796a4){return _0x2796a4[_0x0acf('0x26')](_0x45274a)[_0x0acf('0x27')](function(_0x89fc5e){return _0x89fc5e;});}return null;};}function removeEntity(_0x1675d3,_0x5cd12c){return function(_0x336457){if(_0x336457){return _0x336457[_0x0acf('0x28')]()[_0x0acf('0x27')](function(){_0x1675d3[_0x0acf('0x1b')](0xcc)[_0x0acf('0x1c')]();});}};}function handleEntityNotFound(_0x356b0c,_0x3c1ce4){return function(_0x3e423){if(!_0x3e423){_0x356b0c[_0x0acf('0x29')](0x194);}return _0x3e423;};}function handleError(_0x3ee9b1,_0x19f81c){_0x19f81c=_0x19f81c||0x1f4;return function(_0x50eb0f){logger[_0x0acf('0x2a')](_0x50eb0f[_0x0acf('0x2b')]);if(_0x50eb0f[_0x0acf('0x2c')]){delete _0x50eb0f['name'];}_0x3ee9b1['status'](_0x19f81c)[_0x0acf('0x2d')](_0x50eb0f);};}exports[_0x0acf('0x2e')]=function(_0x29cdcd,_0x412f0e){var _0x5b4c92={},_0x48cfa5={},_0xd6c4d4={'count':0x0,'rows':[]};var _0x1319c3=_['map'](db[_0x0acf('0x2f')][_0x0acf('0x30')],function(_0x456eff){return{'name':_0x456eff[_0x0acf('0x31')],'type':_0x456eff['type'][_0x0acf('0x32')]};});_0x48cfa5[_0x0acf('0x33')]=_[_0x0acf('0x34')](_0x1319c3,_0x0acf('0x2c'));_0x48cfa5['query']=_[_0x0acf('0x35')](_0x29cdcd[_0x0acf('0x36')]);_0x48cfa5[_0x0acf('0x37')]=_[_0x0acf('0x38')](_0x48cfa5[_0x0acf('0x33')],_0x48cfa5[_0x0acf('0x36')]);_0x5b4c92['attributes']=_[_0x0acf('0x38')](_0x48cfa5[_0x0acf('0x33')],qs[_0x0acf('0x39')](_0x29cdcd[_0x0acf('0x36')][_0x0acf('0x39')]));_0x5b4c92[_0x0acf('0x3a')]=_0x5b4c92[_0x0acf('0x3a')][_0x0acf('0x3b')]?_0x5b4c92[_0x0acf('0x3a')]:_0x48cfa5[_0x0acf('0x33')];if(!_0x29cdcd[_0x0acf('0x36')][_0x0acf('0x3c')]('nolimit')){_0x5b4c92[_0x0acf('0x1e')]=qs[_0x0acf('0x1e')](_0x29cdcd[_0x0acf('0x36')]['limit']);_0x5b4c92['offset']=qs[_0x0acf('0x1d')](_0x29cdcd[_0x0acf('0x36')][_0x0acf('0x1d')]);}_0x5b4c92[_0x0acf('0x3d')]=qs['sort'](_0x29cdcd['query'][_0x0acf('0x3e')]);_0x5b4c92[_0x0acf('0x3f')]=qs['filters'](_['pick'](_0x29cdcd[_0x0acf('0x36')],_0x48cfa5[_0x0acf('0x37')]),_0x1319c3);if(_0x29cdcd[_0x0acf('0x36')][_0x0acf('0x40')]){_0x5b4c92[_0x0acf('0x3f')]=_[_0x0acf('0x41')](_0x5b4c92[_0x0acf('0x3f')],{'$or':_[_0x0acf('0x34')](_0x1319c3,function(_0x11ab48){if(_0x11ab48[_0x0acf('0x42')]!==_0x0acf('0x43')){var _0x529996={};_0x529996[_0x11ab48[_0x0acf('0x2c')]]={'$like':'%'+_0x29cdcd[_0x0acf('0x36')][_0x0acf('0x40')]+'%'};return _0x529996;}})});}_0x5b4c92=_[_0x0acf('0x41')]({},_0x5b4c92,_0x29cdcd[_0x0acf('0x44')]);var _0xab8590={'where':_0x5b4c92[_0x0acf('0x3f')]};return db[_0x0acf('0x2f')][_0x0acf('0x20')](_0xab8590)[_0x0acf('0x27')](function(_0x6ff9c5){_0xd6c4d4[_0x0acf('0x20')]=_0x6ff9c5;if(_0x29cdcd['query']['includeAll']){_0x5b4c92[_0x0acf('0x45')]=[{'all':!![]}];}return db[_0x0acf('0x2f')]['findAll'](_0x5b4c92);})[_0x0acf('0x27')](function(_0x1c9e9c){_0xd6c4d4[_0x0acf('0x46')]=_0x1c9e9c;return _0xd6c4d4;})[_0x0acf('0x27')](respondWithFilteredResult(_0x412f0e,_0x5b4c92))['catch'](handleError(_0x412f0e,null));};exports[_0x0acf('0x47')]=function(_0x7faf0b,_0x5a5e45){var _0x54ec37={'raw':![],'where':{'id':_0x7faf0b[_0x0acf('0x48')]['id']}},_0x229e03={};_0x229e03[_0x0acf('0x33')]=_['keys'](db[_0x0acf('0x2f')][_0x0acf('0x30')]);_0x229e03['query']=_['keys'](_0x7faf0b[_0x0acf('0x36')]);_0x229e03[_0x0acf('0x37')]=_[_0x0acf('0x38')](_0x229e03[_0x0acf('0x33')],_0x229e03[_0x0acf('0x36')]);_0x54ec37[_0x0acf('0x3a')]=_[_0x0acf('0x38')](_0x229e03['model'],qs['fields'](_0x7faf0b[_0x0acf('0x36')][_0x0acf('0x39')]));_0x54ec37['attributes']=_0x54ec37[_0x0acf('0x3a')][_0x0acf('0x3b')]?_0x54ec37['attributes']:_0x229e03['model'];if(_0x7faf0b[_0x0acf('0x36')][_0x0acf('0x49')]){_0x54ec37[_0x0acf('0x45')]=[{'all':!![]}];}_0x54ec37=_[_0x0acf('0x41')]({},_0x54ec37,_0x7faf0b[_0x0acf('0x44')]);return db[_0x0acf('0x2f')]['find'](_0x54ec37)[_0x0acf('0x27')](handleEntityNotFound(_0x5a5e45,null))[_0x0acf('0x27')](respondWithResult(_0x5a5e45,null))[_0x0acf('0x4a')](handleError(_0x5a5e45,null));};exports[_0x0acf('0x4b')]=function(_0x5349d4,_0xf86e60){return db[_0x0acf('0x2f')]['create'](_0x5349d4[_0x0acf('0x4c')],{})[_0x0acf('0x27')](respondWithResult(_0xf86e60,0xc9))[_0x0acf('0x4a')](handleError(_0xf86e60,null));};exports[_0x0acf('0x26')]=function(_0x57160c,_0x2778b3){if(_0x57160c['body']['id']){delete _0x57160c[_0x0acf('0x4c')]['id'];}return db[_0x0acf('0x2f')][_0x0acf('0x4d')]({'where':{'id':_0x57160c[_0x0acf('0x48')]['id']}})[_0x0acf('0x27')](handleEntityNotFound(_0x2778b3,null))[_0x0acf('0x27')](saveUpdates(_0x57160c[_0x0acf('0x4c')],null))[_0x0acf('0x27')](respondWithResult(_0x2778b3,null))[_0x0acf('0x4a')](handleError(_0x2778b3,null));};exports[_0x0acf('0x28')]=function(_0x46e8fc,_0x3e5c8c){return db[_0x0acf('0x2f')][_0x0acf('0x4d')]({'where':{'id':_0x46e8fc[_0x0acf('0x48')]['id']}})[_0x0acf('0x27')](handleEntityNotFound(_0x3e5c8c,null))['then'](removeEntity(_0x3e5c8c,null))[_0x0acf('0x4a')](handleError(_0x3e5c8c,null));};exports[_0x0acf('0x4e')]=function(_0x318931,_0x2a3da0,_0x2bacee){var _0x1c314e={};var _0x365fa9={};var _0x18ada8;var _0x4cdff3;return db['FreshdeskConfiguration'][_0x0acf('0x4f')]({'where':{'id':_0x318931['params']['id']}})[_0x0acf('0x27')](handleEntityNotFound(_0x2a3da0,null))['then'](function(_0x1ddb3d){if(_0x1ddb3d){_0x18ada8=_0x1ddb3d;_0x365fa9[_0x0acf('0x33')]=_[_0x0acf('0x35')](db[_0x0acf('0x50')]['rawAttributes']);_0x365fa9[_0x0acf('0x36')]=_[_0x0acf('0x35')](_0x318931['query']);_0x365fa9['filters']=_[_0x0acf('0x38')](_0x365fa9[_0x0acf('0x33')],_0x365fa9['query']);_0x1c314e['attributes']=_[_0x0acf('0x38')](_0x365fa9[_0x0acf('0x33')],qs[_0x0acf('0x39')](_0x318931['query'][_0x0acf('0x39')]));_0x1c314e[_0x0acf('0x3a')]=_0x1c314e['attributes']['length']?_0x1c314e[_0x0acf('0x3a')]:_0x365fa9[_0x0acf('0x33')];_0x1c314e[_0x0acf('0x3d')]=qs[_0x0acf('0x3e')](_0x318931[_0x0acf('0x36')][_0x0acf('0x3e')]);_0x1c314e['where']=qs[_0x0acf('0x37')](_[_0x0acf('0x51')](_0x318931[_0x0acf('0x36')],_0x365fa9['filters']));if(_0x318931[_0x0acf('0x36')][_0x0acf('0x40')]){_0x1c314e[_0x0acf('0x3f')]=_[_0x0acf('0x41')](_0x1c314e[_0x0acf('0x3f')],{'$or':_['map'](_0x1c314e[_0x0acf('0x3a')],function(_0x36d3a0){var _0x142d61={};_0x142d61[_0x36d3a0]={'$like':'%'+_0x318931[_0x0acf('0x36')]['filter']+'%'};return _0x142d61;})});}_0x1c314e=_[_0x0acf('0x41')]({},_0x1c314e,_0x318931[_0x0acf('0x44')]);return _0x18ada8['getFields'](_0x1c314e);}})['then'](function(_0x18d03d){if(_0x18d03d){_0x4cdff3=_0x18d03d[_0x0acf('0x3b')];if(!_0x318931['query']['hasOwnProperty']('nolimit')){_0x1c314e[_0x0acf('0x1e')]=qs[_0x0acf('0x1e')](_0x318931[_0x0acf('0x36')][_0x0acf('0x1e')]);_0x1c314e['offset']=qs['offset'](_0x318931[_0x0acf('0x36')]['offset']);}return _0x18ada8[_0x0acf('0x4e')](_0x1c314e);}})[_0x0acf('0x27')](function(_0x53f0aa){if(_0x53f0aa){return _0x53f0aa?{'count':_0x4cdff3,'rows':_0x53f0aa}:null;}})[_0x0acf('0x27')](respondWithResult(_0x2a3da0,null))[_0x0acf('0x4a')](handleError(_0x2a3da0,null));};exports[_0x0acf('0x52')]=function(_0x3ca51e,_0x3c96d7,_0x611b13){var _0x268e64={};var _0x4d3e1a={};var _0x583379;var _0x52ac23;return db['FreshdeskConfiguration'][_0x0acf('0x4f')]({'where':{'id':_0x3ca51e[_0x0acf('0x48')]['id']}})[_0x0acf('0x27')](handleEntityNotFound(_0x3c96d7,null))[_0x0acf('0x27')](function(_0x3ff687){if(_0x3ff687){_0x583379=_0x3ff687;_0x4d3e1a[_0x0acf('0x33')]=_[_0x0acf('0x35')](db['FreshdeskField']['rawAttributes']);_0x4d3e1a[_0x0acf('0x36')]=_[_0x0acf('0x35')](_0x3ca51e['query']);_0x4d3e1a['filters']=_[_0x0acf('0x38')](_0x4d3e1a['model'],_0x4d3e1a[_0x0acf('0x36')]);_0x268e64['attributes']=_['intersection'](_0x4d3e1a['model'],qs['fields'](_0x3ca51e[_0x0acf('0x36')][_0x0acf('0x39')]));_0x268e64['attributes']=_0x268e64[_0x0acf('0x3a')]['length']?_0x268e64[_0x0acf('0x3a')]:_0x4d3e1a['model'];_0x268e64[_0x0acf('0x3d')]=qs[_0x0acf('0x3e')](_0x3ca51e['query']['sort']);_0x268e64[_0x0acf('0x3f')]=qs[_0x0acf('0x37')](_[_0x0acf('0x51')](_0x3ca51e['query'],_0x4d3e1a['filters']));if(_0x3ca51e['query'][_0x0acf('0x40')]){_0x268e64[_0x0acf('0x3f')]=_['merge'](_0x268e64[_0x0acf('0x3f')],{'$or':_['map'](_0x268e64[_0x0acf('0x3a')],function(_0x1ca215){var _0x4b06a3={};_0x4b06a3[_0x1ca215]={'$like':'%'+_0x3ca51e[_0x0acf('0x36')][_0x0acf('0x40')]+'%'};return _0x4b06a3;})});}_0x268e64=_[_0x0acf('0x41')]({},_0x268e64,_0x3ca51e[_0x0acf('0x44')]);return _0x583379[_0x0acf('0x52')](_0x268e64);}})[_0x0acf('0x27')](function(_0x19bec9){if(_0x19bec9){_0x52ac23=_0x19bec9[_0x0acf('0x3b')];if(!_0x3ca51e[_0x0acf('0x36')][_0x0acf('0x3c')](_0x0acf('0x53'))){_0x268e64[_0x0acf('0x1e')]=qs[_0x0acf('0x1e')](_0x3ca51e[_0x0acf('0x36')][_0x0acf('0x1e')]);_0x268e64[_0x0acf('0x1d')]=qs['offset'](_0x3ca51e[_0x0acf('0x36')]['offset']);}return _0x583379['getSubjects'](_0x268e64);}})[_0x0acf('0x27')](function(_0x2b206b){if(_0x2b206b){return _0x2b206b?{'count':_0x52ac23,'rows':_0x2b206b}:null;}})[_0x0acf('0x27')](respondWithResult(_0x3c96d7,null))[_0x0acf('0x4a')](handleError(_0x3c96d7,null));};exports['getDescriptions']=function(_0x4025e3,_0x15eb6a,_0xe7468){var _0x13ae73={};var _0x1aa74e={};var _0x50b0df;var _0x147ee2;return db['FreshdeskConfiguration'][_0x0acf('0x4f')]({'where':{'id':_0x4025e3['params']['id']}})['then'](handleEntityNotFound(_0x15eb6a,null))[_0x0acf('0x27')](function(_0x40bbcc){if(_0x40bbcc){_0x50b0df=_0x40bbcc;_0x1aa74e[_0x0acf('0x33')]=_[_0x0acf('0x35')](db[_0x0acf('0x50')][_0x0acf('0x30')]);_0x1aa74e[_0x0acf('0x36')]=_['keys'](_0x4025e3[_0x0acf('0x36')]);_0x1aa74e[_0x0acf('0x37')]=_[_0x0acf('0x38')](_0x1aa74e[_0x0acf('0x33')],_0x1aa74e['query']);_0x13ae73[_0x0acf('0x3a')]=_[_0x0acf('0x38')](_0x1aa74e[_0x0acf('0x33')],qs['fields'](_0x4025e3[_0x0acf('0x36')][_0x0acf('0x39')]));_0x13ae73[_0x0acf('0x3a')]=_0x13ae73[_0x0acf('0x3a')][_0x0acf('0x3b')]?_0x13ae73['attributes']:_0x1aa74e[_0x0acf('0x33')];_0x13ae73[_0x0acf('0x3d')]=qs[_0x0acf('0x3e')](_0x4025e3[_0x0acf('0x36')][_0x0acf('0x3e')]);_0x13ae73[_0x0acf('0x3f')]=qs[_0x0acf('0x37')](_[_0x0acf('0x51')](_0x4025e3[_0x0acf('0x36')],_0x1aa74e[_0x0acf('0x37')]));if(_0x4025e3['query'][_0x0acf('0x40')]){_0x13ae73[_0x0acf('0x3f')]=_[_0x0acf('0x41')](_0x13ae73[_0x0acf('0x3f')],{'$or':_[_0x0acf('0x34')](_0x13ae73[_0x0acf('0x3a')],function(_0x2dc3cb){var _0x1e50dd={};_0x1e50dd[_0x2dc3cb]={'$like':'%'+_0x4025e3[_0x0acf('0x36')][_0x0acf('0x40')]+'%'};return _0x1e50dd;})});}_0x13ae73=_[_0x0acf('0x41')]({},_0x13ae73,_0x4025e3[_0x0acf('0x44')]);return _0x50b0df[_0x0acf('0x54')](_0x13ae73);}})[_0x0acf('0x27')](function(_0xaa8e0d){if(_0xaa8e0d){_0x147ee2=_0xaa8e0d['length'];if(!_0x4025e3[_0x0acf('0x36')]['hasOwnProperty']('nolimit')){_0x13ae73[_0x0acf('0x1e')]=qs[_0x0acf('0x1e')](_0x4025e3[_0x0acf('0x36')]['limit']);_0x13ae73[_0x0acf('0x1d')]=qs[_0x0acf('0x1d')](_0x4025e3[_0x0acf('0x36')][_0x0acf('0x1d')]);}return _0x50b0df[_0x0acf('0x54')](_0x13ae73);}})[_0x0acf('0x27')](function(_0x3bf8cd){if(_0x3bf8cd){return _0x3bf8cd?{'count':_0x147ee2,'rows':_0x3bf8cd}:null;}})[_0x0acf('0x27')](respondWithResult(_0x15eb6a,null))[_0x0acf('0x4a')](handleError(_0x15eb6a,null));};exports[_0x0acf('0x55')]=function(_0x375684,_0x5f4ddb,_0x2d1406){var _0x2ff54f={};var _0xf783ba={};var _0x5dd0fd;var _0x551ec1;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x375684['params']['id']}})['then'](handleEntityNotFound(_0x5f4ddb,null))['then'](function(_0x4a101e){if(_0x4a101e){_0x5dd0fd=_0x4a101e;_0xf783ba[_0x0acf('0x33')]=_['keys'](db[_0x0acf('0x56')][_0x0acf('0x30')]);_0xf783ba[_0x0acf('0x36')]=_['keys'](_0x375684[_0x0acf('0x36')]);_0xf783ba[_0x0acf('0x37')]=_[_0x0acf('0x38')](_0xf783ba[_0x0acf('0x33')],_0xf783ba[_0x0acf('0x36')]);_0x2ff54f[_0x0acf('0x3a')]=_['intersection'](_0xf783ba[_0x0acf('0x33')],qs['fields'](_0x375684[_0x0acf('0x36')][_0x0acf('0x39')]));_0x2ff54f[_0x0acf('0x3a')]=_0x2ff54f['attributes']['length']?_0x2ff54f[_0x0acf('0x3a')]:_0xf783ba[_0x0acf('0x33')];_0x2ff54f[_0x0acf('0x3d')]=qs['sort'](_0x375684['query']['sort']);_0x2ff54f[_0x0acf('0x3f')]=qs[_0x0acf('0x37')](_[_0x0acf('0x51')](_0x375684[_0x0acf('0x36')],_0xf783ba['filters']));if(_0x375684[_0x0acf('0x36')]['filter']){_0x2ff54f[_0x0acf('0x3f')]=_[_0x0acf('0x41')](_0x2ff54f['where'],{'$or':_['map'](_0x2ff54f[_0x0acf('0x3a')],function(_0x26b60f){var _0x540ce4={};_0x540ce4[_0x26b60f]={'$like':'%'+_0x375684['query']['filter']+'%'};return _0x540ce4;})});}_0x2ff54f=_[_0x0acf('0x41')]({},_0x2ff54f,_0x375684[_0x0acf('0x44')]);return _0x5dd0fd[_0x0acf('0x55')](_0x2ff54f);}})[_0x0acf('0x27')](function(_0x268588){if(_0x268588){_0x551ec1=_0x268588[_0x0acf('0x3b')];if(!_0x375684[_0x0acf('0x36')][_0x0acf('0x3c')](_0x0acf('0x53'))){_0x2ff54f[_0x0acf('0x1e')]=qs['limit'](_0x375684['query']['limit']);_0x2ff54f[_0x0acf('0x1d')]=qs[_0x0acf('0x1d')](_0x375684[_0x0acf('0x36')]['offset']);}return _0x5dd0fd[_0x0acf('0x55')](_0x2ff54f);}})[_0x0acf('0x27')](function(_0x2369af){if(_0x2369af){return _0x2369af?{'count':_0x551ec1,'rows':_0x2369af}:null;}})[_0x0acf('0x27')](respondWithResult(_0x5f4ddb,null))[_0x0acf('0x4a')](handleError(_0x5f4ddb,null));};exports['setTags']=function(_0x2d77df,_0x3fabd9,_0x515a1b){if(_0x2d77df[_0x0acf('0x4c')]['id']){delete _0x2d77df['body']['id'];}return db['FreshdeskConfiguration'][_0x0acf('0x4f')]({'where':{'id':_0x2d77df[_0x0acf('0x48')]['id']}})[_0x0acf('0x27')](handleEntityNotFound(_0x3fabd9,null))[_0x0acf('0x27')](function(_0x593daa){if(_0x593daa){return _0x593daa[_0x0acf('0x57')](_0x2d77df[_0x0acf('0x4c')]['ids']||[]);}return null;})[_0x0acf('0x27')](respondWithResult(_0x3fabd9,null))['catch'](handleError(_0x3fabd9,null));};
\ No newline at end of file
+var _0xebb6=['getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','options','find','catch','create','body','update','getFields','findOne','params','FreshdeskField','getSubjects','getDescriptions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xebb6,0x19e));var _0x6ebb=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xebb6[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ebb('0x0'));var zipdir=require(_0x6ebb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ebb('0x2'));var moment=require(_0x6ebb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ebb('0x4'));var path=require(_0x6ebb('0x5'));var sox=require(_0x6ebb('0x6'));var csv=require(_0x6ebb('0x7'));var ejs=require(_0x6ebb('0x8'));var fs=require('fs');var fs_extra=require(_0x6ebb('0x9'));var _=require(_0x6ebb('0xa'));var squel=require(_0x6ebb('0xb'));var crypto=require(_0x6ebb('0xc'));var jsforce=require(_0x6ebb('0xd'));var deskjs=require(_0x6ebb('0xe'));var toCsv=require(_0x6ebb('0x7'));var querystring=require('querystring');var Papa=require(_0x6ebb('0xf'));var Redis=require(_0x6ebb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6ebb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ebb('0x12'));var logger=require('../../config/logger')(_0x6ebb('0x13'));var utils=require(_0x6ebb('0x14'));var config=require(_0x6ebb('0x15'));var licenseUtil=require(_0x6ebb('0x16'));var db=require(_0x6ebb('0x17'))['db'];function respondWithStatusCode(_0x13cd97,_0x6a18b3){_0x6a18b3=_0x6a18b3||0xcc;return function(_0x33c29e){if(_0x33c29e){return _0x13cd97[_0x6ebb('0x18')](_0x6a18b3);}return _0x13cd97[_0x6ebb('0x19')](_0x6a18b3)[_0x6ebb('0x1a')]();};}function respondWithResult(_0x36104d,_0xfdd9dc){_0xfdd9dc=_0xfdd9dc||0xc8;return function(_0x53ede3){if(_0x53ede3){return _0x36104d[_0x6ebb('0x19')](_0xfdd9dc)[_0x6ebb('0x1b')](_0x53ede3);}};}function respondWithFilteredResult(_0x1d3e7c,_0x11f011){return function(_0x4a3488){if(_0x4a3488){var _0xa2ce1f=typeof _0x11f011[_0x6ebb('0x1c')]===_0x6ebb('0x1d')&&typeof _0x11f011['limit']==='undefined';var _0x56322e=_0x4a3488[_0x6ebb('0x1e')];var _0x81a7f4=_0xa2ce1f?0x0:_0x11f011[_0x6ebb('0x1c')];var _0x59fd9e=_0xa2ce1f?_0x4a3488[_0x6ebb('0x1e')]:_0x11f011['offset']+_0x11f011[_0x6ebb('0x1f')];var _0xecf428;if(_0x59fd9e>=_0x56322e){_0x59fd9e=_0x56322e;_0xecf428=0xc8;}else{_0xecf428=0xce;}_0x1d3e7c['status'](_0xecf428);return _0x1d3e7c[_0x6ebb('0x20')]('Content-Range',_0x81a7f4+'-'+_0x59fd9e+'/'+_0x56322e)[_0x6ebb('0x1b')](_0x4a3488);}return null;};}function patchUpdates(_0x9e625d){return function(_0x11edb8){try{jsonpatch[_0x6ebb('0x21')](_0x11edb8,_0x9e625d,!![]);}catch(_0x36da74){return BPromise[_0x6ebb('0x22')](_0x36da74);}return _0x11edb8[_0x6ebb('0x23')]();};}function saveUpdates(_0x2b4584,_0x367429){return function(_0x7f3815){if(_0x7f3815){return _0x7f3815['update'](_0x2b4584)[_0x6ebb('0x24')](function(_0x34de04){return _0x34de04;});}return null;};}function removeEntity(_0x297452,_0x152885){return function(_0x3bce2e){if(_0x3bce2e){return _0x3bce2e[_0x6ebb('0x25')]()[_0x6ebb('0x24')](function(){_0x297452['status'](0xcc)[_0x6ebb('0x1a')]();});}};}function handleEntityNotFound(_0xffb752,_0x59554c){return function(_0x93f1d2){if(!_0x93f1d2){_0xffb752[_0x6ebb('0x18')](0x194);}return _0x93f1d2;};}function handleError(_0x2b82c1,_0x1d8fc2){_0x1d8fc2=_0x1d8fc2||0x1f4;return function(_0x1a34ac){logger['error'](_0x1a34ac[_0x6ebb('0x26')]);if(_0x1a34ac[_0x6ebb('0x27')]){delete _0x1a34ac['name'];}_0x2b82c1[_0x6ebb('0x19')](_0x1d8fc2)[_0x6ebb('0x28')](_0x1a34ac);};}exports[_0x6ebb('0x29')]=function(_0x30fbaa,_0xb4ea16){var _0x565bb3={},_0x369004={},_0x46c2ca={'count':0x0,'rows':[]};var _0x5e94cc=_[_0x6ebb('0x2a')](db[_0x6ebb('0x2b')][_0x6ebb('0x2c')],function(_0x3d4a57){return{'name':_0x3d4a57[_0x6ebb('0x2d')],'type':_0x3d4a57['type'][_0x6ebb('0x2e')]};});_0x369004[_0x6ebb('0x2f')]=_[_0x6ebb('0x2a')](_0x5e94cc,_0x6ebb('0x27'));_0x369004['query']=_[_0x6ebb('0x30')](_0x30fbaa[_0x6ebb('0x31')]);_0x369004[_0x6ebb('0x32')]=_[_0x6ebb('0x33')](_0x369004[_0x6ebb('0x2f')],_0x369004[_0x6ebb('0x31')]);_0x565bb3[_0x6ebb('0x34')]=_[_0x6ebb('0x33')](_0x369004[_0x6ebb('0x2f')],qs[_0x6ebb('0x35')](_0x30fbaa[_0x6ebb('0x31')][_0x6ebb('0x35')]));_0x565bb3[_0x6ebb('0x34')]=_0x565bb3['attributes'][_0x6ebb('0x36')]?_0x565bb3[_0x6ebb('0x34')]:_0x369004[_0x6ebb('0x2f')];if(!_0x30fbaa['query'][_0x6ebb('0x37')](_0x6ebb('0x38'))){_0x565bb3[_0x6ebb('0x1f')]=qs[_0x6ebb('0x1f')](_0x30fbaa[_0x6ebb('0x31')]['limit']);_0x565bb3['offset']=qs[_0x6ebb('0x1c')](_0x30fbaa[_0x6ebb('0x31')][_0x6ebb('0x1c')]);}_0x565bb3[_0x6ebb('0x39')]=qs[_0x6ebb('0x3a')](_0x30fbaa[_0x6ebb('0x31')]['sort']);_0x565bb3[_0x6ebb('0x3b')]=qs[_0x6ebb('0x32')](_[_0x6ebb('0x3c')](_0x30fbaa['query'],_0x369004[_0x6ebb('0x32')]),_0x5e94cc);if(_0x30fbaa[_0x6ebb('0x31')]['filter']){_0x565bb3[_0x6ebb('0x3b')]=_[_0x6ebb('0x3d')](_0x565bb3['where'],{'$or':_[_0x6ebb('0x2a')](_0x5e94cc,function(_0x5f5713){if(_0x5f5713['type']!==_0x6ebb('0x3e')){var _0xc4f2c4={};_0xc4f2c4[_0x5f5713['name']]={'$like':'%'+_0x30fbaa[_0x6ebb('0x31')][_0x6ebb('0x3f')]+'%'};return _0xc4f2c4;}})});}_0x565bb3=_[_0x6ebb('0x3d')]({},_0x565bb3,_0x30fbaa['options']);var _0x29c0db={'where':_0x565bb3[_0x6ebb('0x3b')]};return db[_0x6ebb('0x2b')][_0x6ebb('0x1e')](_0x29c0db)['then'](function(_0x479110){_0x46c2ca[_0x6ebb('0x1e')]=_0x479110;if(_0x30fbaa[_0x6ebb('0x31')][_0x6ebb('0x40')]){_0x565bb3[_0x6ebb('0x41')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x565bb3);})['then'](function(_0x52544d){_0x46c2ca['rows']=_0x52544d;return _0x46c2ca;})['then'](respondWithFilteredResult(_0xb4ea16,_0x565bb3))['catch'](handleError(_0xb4ea16,null));};exports['show']=function(_0x4beb65,_0x51f034){var _0x7eb9aa={'raw':![],'where':{'id':_0x4beb65['params']['id']}},_0x5a4e01={};_0x5a4e01[_0x6ebb('0x2f')]=_[_0x6ebb('0x30')](db[_0x6ebb('0x2b')]['rawAttributes']);_0x5a4e01[_0x6ebb('0x31')]=_['keys'](_0x4beb65['query']);_0x5a4e01[_0x6ebb('0x32')]=_[_0x6ebb('0x33')](_0x5a4e01[_0x6ebb('0x2f')],_0x5a4e01[_0x6ebb('0x31')]);_0x7eb9aa[_0x6ebb('0x34')]=_[_0x6ebb('0x33')](_0x5a4e01[_0x6ebb('0x2f')],qs['fields'](_0x4beb65[_0x6ebb('0x31')][_0x6ebb('0x35')]));_0x7eb9aa[_0x6ebb('0x34')]=_0x7eb9aa[_0x6ebb('0x34')][_0x6ebb('0x36')]?_0x7eb9aa[_0x6ebb('0x34')]:_0x5a4e01[_0x6ebb('0x2f')];if(_0x4beb65['query'][_0x6ebb('0x40')]){_0x7eb9aa[_0x6ebb('0x41')]=[{'all':!![]}];}_0x7eb9aa=_[_0x6ebb('0x3d')]({},_0x7eb9aa,_0x4beb65[_0x6ebb('0x42')]);return db[_0x6ebb('0x2b')][_0x6ebb('0x43')](_0x7eb9aa)['then'](handleEntityNotFound(_0x51f034,null))['then'](respondWithResult(_0x51f034,null))[_0x6ebb('0x44')](handleError(_0x51f034,null));};exports[_0x6ebb('0x45')]=function(_0x464a8f,_0x52ac00){return db[_0x6ebb('0x2b')][_0x6ebb('0x45')](_0x464a8f[_0x6ebb('0x46')],{})[_0x6ebb('0x24')](respondWithResult(_0x52ac00,0xc9))[_0x6ebb('0x44')](handleError(_0x52ac00,null));};exports[_0x6ebb('0x47')]=function(_0x1abb4e,_0x27cb9a){if(_0x1abb4e['body']['id']){delete _0x1abb4e['body']['id'];}return db['FreshdeskConfiguration'][_0x6ebb('0x43')]({'where':{'id':_0x1abb4e['params']['id']}})['then'](handleEntityNotFound(_0x27cb9a,null))[_0x6ebb('0x24')](saveUpdates(_0x1abb4e[_0x6ebb('0x46')],null))['then'](respondWithResult(_0x27cb9a,null))[_0x6ebb('0x44')](handleError(_0x27cb9a,null));};exports['destroy']=function(_0x17b3e5,_0x2be982){return db[_0x6ebb('0x2b')][_0x6ebb('0x43')]({'where':{'id':_0x17b3e5['params']['id']}})[_0x6ebb('0x24')](handleEntityNotFound(_0x2be982,null))[_0x6ebb('0x24')](removeEntity(_0x2be982,null))[_0x6ebb('0x44')](handleError(_0x2be982,null));};exports[_0x6ebb('0x48')]=function(_0x4ef31b,_0x1f73fa,_0x3b809f){var _0x3e51a1={};var _0x55e1be={};var _0x2bc5e1;var _0x2a35e6;return db[_0x6ebb('0x2b')][_0x6ebb('0x49')]({'where':{'id':_0x4ef31b[_0x6ebb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f73fa,null))['then'](function(_0x1cad41){if(_0x1cad41){_0x2bc5e1=_0x1cad41;_0x55e1be[_0x6ebb('0x2f')]=_[_0x6ebb('0x30')](db[_0x6ebb('0x4b')]['rawAttributes']);_0x55e1be['query']=_['keys'](_0x4ef31b[_0x6ebb('0x31')]);_0x55e1be[_0x6ebb('0x32')]=_[_0x6ebb('0x33')](_0x55e1be[_0x6ebb('0x2f')],_0x55e1be[_0x6ebb('0x31')]);_0x3e51a1[_0x6ebb('0x34')]=_[_0x6ebb('0x33')](_0x55e1be['model'],qs['fields'](_0x4ef31b[_0x6ebb('0x31')]['fields']));_0x3e51a1[_0x6ebb('0x34')]=_0x3e51a1[_0x6ebb('0x34')]['length']?_0x3e51a1['attributes']:_0x55e1be[_0x6ebb('0x2f')];_0x3e51a1[_0x6ebb('0x39')]=qs[_0x6ebb('0x3a')](_0x4ef31b[_0x6ebb('0x31')]['sort']);_0x3e51a1[_0x6ebb('0x3b')]=qs[_0x6ebb('0x32')](_[_0x6ebb('0x3c')](_0x4ef31b[_0x6ebb('0x31')],_0x55e1be[_0x6ebb('0x32')]));if(_0x4ef31b['query'][_0x6ebb('0x3f')]){_0x3e51a1[_0x6ebb('0x3b')]=_[_0x6ebb('0x3d')](_0x3e51a1[_0x6ebb('0x3b')],{'$or':_[_0x6ebb('0x2a')](_0x3e51a1['attributes'],function(_0x4014b5){var _0x3463f6={};_0x3463f6[_0x4014b5]={'$like':'%'+_0x4ef31b[_0x6ebb('0x31')]['filter']+'%'};return _0x3463f6;})});}_0x3e51a1=_[_0x6ebb('0x3d')]({},_0x3e51a1,_0x4ef31b[_0x6ebb('0x42')]);return _0x2bc5e1[_0x6ebb('0x48')](_0x3e51a1);}})[_0x6ebb('0x24')](function(_0xd72ad3){if(_0xd72ad3){_0x2a35e6=_0xd72ad3[_0x6ebb('0x36')];if(!_0x4ef31b[_0x6ebb('0x31')][_0x6ebb('0x37')](_0x6ebb('0x38'))){_0x3e51a1['limit']=qs[_0x6ebb('0x1f')](_0x4ef31b[_0x6ebb('0x31')]['limit']);_0x3e51a1[_0x6ebb('0x1c')]=qs[_0x6ebb('0x1c')](_0x4ef31b[_0x6ebb('0x31')][_0x6ebb('0x1c')]);}return _0x2bc5e1[_0x6ebb('0x48')](_0x3e51a1);}})[_0x6ebb('0x24')](function(_0x49ec85){if(_0x49ec85){return _0x49ec85?{'count':_0x2a35e6,'rows':_0x49ec85}:null;}})['then'](respondWithResult(_0x1f73fa,null))[_0x6ebb('0x44')](handleError(_0x1f73fa,null));};exports[_0x6ebb('0x4c')]=function(_0xf241a6,_0x970ff6,_0x7f7720){var _0x3be69a={};var _0x4337f4={};var _0x25a432;var _0x110870;return db[_0x6ebb('0x2b')]['findOne']({'where':{'id':_0xf241a6[_0x6ebb('0x4a')]['id']}})[_0x6ebb('0x24')](handleEntityNotFound(_0x970ff6,null))['then'](function(_0x3fe286){if(_0x3fe286){_0x25a432=_0x3fe286;_0x4337f4[_0x6ebb('0x2f')]=_['keys'](db[_0x6ebb('0x4b')][_0x6ebb('0x2c')]);_0x4337f4[_0x6ebb('0x31')]=_['keys'](_0xf241a6[_0x6ebb('0x31')]);_0x4337f4[_0x6ebb('0x32')]=_[_0x6ebb('0x33')](_0x4337f4[_0x6ebb('0x2f')],_0x4337f4[_0x6ebb('0x31')]);_0x3be69a[_0x6ebb('0x34')]=_[_0x6ebb('0x33')](_0x4337f4['model'],qs[_0x6ebb('0x35')](_0xf241a6['query']['fields']));_0x3be69a[_0x6ebb('0x34')]=_0x3be69a[_0x6ebb('0x34')][_0x6ebb('0x36')]?_0x3be69a[_0x6ebb('0x34')]:_0x4337f4['model'];_0x3be69a['order']=qs[_0x6ebb('0x3a')](_0xf241a6['query'][_0x6ebb('0x3a')]);_0x3be69a[_0x6ebb('0x3b')]=qs[_0x6ebb('0x32')](_['pick'](_0xf241a6[_0x6ebb('0x31')],_0x4337f4[_0x6ebb('0x32')]));if(_0xf241a6['query'][_0x6ebb('0x3f')]){_0x3be69a[_0x6ebb('0x3b')]=_[_0x6ebb('0x3d')](_0x3be69a['where'],{'$or':_[_0x6ebb('0x2a')](_0x3be69a[_0x6ebb('0x34')],function(_0x393c8e){var _0x621c93={};_0x621c93[_0x393c8e]={'$like':'%'+_0xf241a6[_0x6ebb('0x31')]['filter']+'%'};return _0x621c93;})});}_0x3be69a=_[_0x6ebb('0x3d')]({},_0x3be69a,_0xf241a6[_0x6ebb('0x42')]);return _0x25a432[_0x6ebb('0x4c')](_0x3be69a);}})['then'](function(_0x3abb51){if(_0x3abb51){_0x110870=_0x3abb51['length'];if(!_0xf241a6[_0x6ebb('0x31')]['hasOwnProperty'](_0x6ebb('0x38'))){_0x3be69a['limit']=qs['limit'](_0xf241a6[_0x6ebb('0x31')][_0x6ebb('0x1f')]);_0x3be69a[_0x6ebb('0x1c')]=qs[_0x6ebb('0x1c')](_0xf241a6['query']['offset']);}return _0x25a432['getSubjects'](_0x3be69a);}})[_0x6ebb('0x24')](function(_0x236cd1){if(_0x236cd1){return _0x236cd1?{'count':_0x110870,'rows':_0x236cd1}:null;}})['then'](respondWithResult(_0x970ff6,null))[_0x6ebb('0x44')](handleError(_0x970ff6,null));};exports[_0x6ebb('0x4d')]=function(_0x3527b7,_0x1b73be,_0x4997d9){var _0x1c7fc4={};var _0x220eb5={};var _0x2c140f;var _0x45ea31;return db[_0x6ebb('0x2b')][_0x6ebb('0x49')]({'where':{'id':_0x3527b7[_0x6ebb('0x4a')]['id']}})[_0x6ebb('0x24')](handleEntityNotFound(_0x1b73be,null))['then'](function(_0x577533){if(_0x577533){_0x2c140f=_0x577533;_0x220eb5[_0x6ebb('0x2f')]=_[_0x6ebb('0x30')](db['FreshdeskField'][_0x6ebb('0x2c')]);_0x220eb5[_0x6ebb('0x31')]=_['keys'](_0x3527b7[_0x6ebb('0x31')]);_0x220eb5[_0x6ebb('0x32')]=_['intersection'](_0x220eb5[_0x6ebb('0x2f')],_0x220eb5['query']);_0x1c7fc4[_0x6ebb('0x34')]=_[_0x6ebb('0x33')](_0x220eb5['model'],qs[_0x6ebb('0x35')](_0x3527b7[_0x6ebb('0x31')][_0x6ebb('0x35')]));_0x1c7fc4[_0x6ebb('0x34')]=_0x1c7fc4[_0x6ebb('0x34')][_0x6ebb('0x36')]?_0x1c7fc4[_0x6ebb('0x34')]:_0x220eb5['model'];_0x1c7fc4[_0x6ebb('0x39')]=qs[_0x6ebb('0x3a')](_0x3527b7['query'][_0x6ebb('0x3a')]);_0x1c7fc4['where']=qs['filters'](_[_0x6ebb('0x3c')](_0x3527b7['query'],_0x220eb5[_0x6ebb('0x32')]));if(_0x3527b7['query'][_0x6ebb('0x3f')]){_0x1c7fc4[_0x6ebb('0x3b')]=_[_0x6ebb('0x3d')](_0x1c7fc4[_0x6ebb('0x3b')],{'$or':_[_0x6ebb('0x2a')](_0x1c7fc4[_0x6ebb('0x34')],function(_0x40147d){var _0x423178={};_0x423178[_0x40147d]={'$like':'%'+_0x3527b7[_0x6ebb('0x31')]['filter']+'%'};return _0x423178;})});}_0x1c7fc4=_[_0x6ebb('0x3d')]({},_0x1c7fc4,_0x3527b7['options']);return _0x2c140f[_0x6ebb('0x4d')](_0x1c7fc4);}})['then'](function(_0x261b5b){if(_0x261b5b){_0x45ea31=_0x261b5b[_0x6ebb('0x36')];if(!_0x3527b7[_0x6ebb('0x31')][_0x6ebb('0x37')]('nolimit')){_0x1c7fc4[_0x6ebb('0x1f')]=qs[_0x6ebb('0x1f')](_0x3527b7[_0x6ebb('0x31')]['limit']);_0x1c7fc4[_0x6ebb('0x1c')]=qs[_0x6ebb('0x1c')](_0x3527b7[_0x6ebb('0x31')][_0x6ebb('0x1c')]);}return _0x2c140f[_0x6ebb('0x4d')](_0x1c7fc4);}})[_0x6ebb('0x24')](function(_0x1dd666){if(_0x1dd666){return _0x1dd666?{'count':_0x45ea31,'rows':_0x1dd666}:null;}})['then'](respondWithResult(_0x1b73be,null))['catch'](handleError(_0x1b73be,null));};exports[_0x6ebb('0x4e')]=function(_0x93088d,_0x45ae76,_0x21f45a){var _0x10813b={};var _0x495c50={};var _0xebd353;var _0x206bef;return db[_0x6ebb('0x2b')][_0x6ebb('0x49')]({'where':{'id':_0x93088d[_0x6ebb('0x4a')]['id']}})[_0x6ebb('0x24')](handleEntityNotFound(_0x45ae76,null))[_0x6ebb('0x24')](function(_0x231402){if(_0x231402){_0xebd353=_0x231402;_0x495c50[_0x6ebb('0x2f')]=_[_0x6ebb('0x30')](db[_0x6ebb('0x4f')]['rawAttributes']);_0x495c50[_0x6ebb('0x31')]=_[_0x6ebb('0x30')](_0x93088d[_0x6ebb('0x31')]);_0x495c50[_0x6ebb('0x32')]=_[_0x6ebb('0x33')](_0x495c50[_0x6ebb('0x2f')],_0x495c50[_0x6ebb('0x31')]);_0x10813b[_0x6ebb('0x34')]=_[_0x6ebb('0x33')](_0x495c50[_0x6ebb('0x2f')],qs['fields'](_0x93088d['query'][_0x6ebb('0x35')]));_0x10813b['attributes']=_0x10813b[_0x6ebb('0x34')][_0x6ebb('0x36')]?_0x10813b[_0x6ebb('0x34')]:_0x495c50[_0x6ebb('0x2f')];_0x10813b[_0x6ebb('0x39')]=qs['sort'](_0x93088d[_0x6ebb('0x31')][_0x6ebb('0x3a')]);_0x10813b[_0x6ebb('0x3b')]=qs['filters'](_[_0x6ebb('0x3c')](_0x93088d[_0x6ebb('0x31')],_0x495c50['filters']));if(_0x93088d[_0x6ebb('0x31')][_0x6ebb('0x3f')]){_0x10813b[_0x6ebb('0x3b')]=_[_0x6ebb('0x3d')](_0x10813b[_0x6ebb('0x3b')],{'$or':_[_0x6ebb('0x2a')](_0x10813b[_0x6ebb('0x34')],function(_0x5303f9){var _0x1c8e24={};_0x1c8e24[_0x5303f9]={'$like':'%'+_0x93088d[_0x6ebb('0x31')][_0x6ebb('0x3f')]+'%'};return _0x1c8e24;})});}_0x10813b=_['merge']({},_0x10813b,_0x93088d[_0x6ebb('0x42')]);return _0xebd353[_0x6ebb('0x4e')](_0x10813b);}})['then'](function(_0x70b20e){if(_0x70b20e){_0x206bef=_0x70b20e[_0x6ebb('0x36')];if(!_0x93088d['query'][_0x6ebb('0x37')](_0x6ebb('0x38'))){_0x10813b['limit']=qs[_0x6ebb('0x1f')](_0x93088d[_0x6ebb('0x31')][_0x6ebb('0x1f')]);_0x10813b[_0x6ebb('0x1c')]=qs[_0x6ebb('0x1c')](_0x93088d[_0x6ebb('0x31')][_0x6ebb('0x1c')]);}return _0xebd353[_0x6ebb('0x4e')](_0x10813b);}})[_0x6ebb('0x24')](function(_0x122941){if(_0x122941){return _0x122941?{'count':_0x206bef,'rows':_0x122941}:null;}})[_0x6ebb('0x24')](respondWithResult(_0x45ae76,null))[_0x6ebb('0x44')](handleError(_0x45ae76,null));};exports[_0x6ebb('0x50')]=function(_0x331e4b,_0x570e5b,_0x54a787){if(_0x331e4b[_0x6ebb('0x46')]['id']){delete _0x331e4b['body']['id'];}return db[_0x6ebb('0x2b')][_0x6ebb('0x49')]({'where':{'id':_0x331e4b[_0x6ebb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x570e5b,null))[_0x6ebb('0x24')](function(_0x114ec0){if(_0x114ec0){return _0x114ec0[_0x6ebb('0x50')](_0x331e4b[_0x6ebb('0x46')][_0x6ebb('0x51')]||[]);}return null;})[_0x6ebb('0x24')](respondWithResult(_0x570e5b,null))[_0x6ebb('0x44')](handleError(_0x570e5b,null));};
\ No newline at end of file
index 9f00689..38b8fbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7908=['request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','moment','bluebird'];(function(_0x422d6a,_0x20d24f){var _0x3bff4b=function(_0x3789a8){while(--_0x3789a8){_0x422d6a['push'](_0x422d6a['shift']());}};_0x3bff4b(++_0x20d24f);}(_0x7908,0xad));var _0x8790=function(_0x2bd2d4,_0x46d9ca){_0x2bd2d4=_0x2bd2d4-0x0;var _0x44e9cd=_0x7908[_0x2bd2d4];return _0x44e9cd;};'use strict';var _=require(_0x8790('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8790('0x1'));var BPromise=require(_0x8790('0x2'));var rp=require(_0x8790('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8790('0x4'));var config=require(_0x8790('0x5'));var attributes=require(_0x8790('0x6'));module[_0x8790('0x7')]=function(_0x1e4ec0,_0x2a1990){return _0x1e4ec0[_0x8790('0x8')](_0x8790('0x9'),attributes,{'tableName':_0x8790('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe718=['moment','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger'];(function(_0x530ddb,_0x3008f8){var _0x4fa295=function(_0x552364){while(--_0x552364){_0x530ddb['push'](_0x530ddb['shift']());}};_0x4fa295(++_0x3008f8);}(_0xe718,0xc7));var _0x8e71=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0xe718[_0x580b15];return _0x1adb1b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8e71('0x0'))('api');var moment=require(_0x8e71('0x1'));var BPromise=require(_0x8e71('0x2'));var rp=require(_0x8e71('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e71('0x4'));var attributes=require(_0x8e71('0x5'));module[_0x8e71('0x6')]=function(_0xdafb1d,_0x4da1d0){return _0xdafb1d[_0x8e71('0x7')](_0x8e71('0x8'),attributes,{'tableName':_0x8e71('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d95570e..173718d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05ce=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x05ce,0x1a0));var _0xe05c=function(_0x1063f7,_0x5a24aa){_0x1063f7=_0x1063f7-0x0;var _0x14d3fa=_0x05ce[_0x1063f7];return _0x14d3fa;};'use strict';var _=require('lodash');var util=require(_0xe05c('0x0'));var moment=require(_0xe05c('0x1'));var BPromise=require(_0xe05c('0x2'));var rs=require(_0xe05c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe05c('0x4'))['db'];var utils=require(_0xe05c('0x5'));var logger=require(_0xe05c('0x6'))(_0xe05c('0x7'));var config=require(_0xe05c('0x8'));var jayson=require(_0xe05c('0x9'));var client=jayson[_0xe05c('0xa')][_0xe05c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc0d48e,_0x3f3a68,_0x38dd0d){return new BPromise(function(_0x1295b6,_0x344ff6){return client['request'](_0xc0d48e,_0x38dd0d)[_0xe05c('0xc')](function(_0x1df260){logger['info'](_0xe05c('0xd'),_0x3f3a68,_0xe05c('0xe'));logger[_0xe05c('0xf')](_0xe05c('0x10'),_0x3f3a68,'request\x20sent',JSON[_0xe05c('0x11')](_0x1df260));if(_0x1df260[_0xe05c('0x12')]){if(_0x1df260[_0xe05c('0x12')][_0xe05c('0x13')]===0x1f4){logger['error'](_0xe05c('0xd'),_0x3f3a68,_0x1df260[_0xe05c('0x12')][_0xe05c('0x14')]);return _0x344ff6(_0x1df260[_0xe05c('0x12')][_0xe05c('0x14')]);}logger[_0xe05c('0x12')](_0xe05c('0xd'),_0x3f3a68,_0x1df260[_0xe05c('0x12')][_0xe05c('0x14')]);return _0x1295b6(_0x1df260[_0xe05c('0x12')]['message']);}else{logger[_0xe05c('0x15')](_0xe05c('0xd'),_0x3f3a68,'request\x20sent');_0x1295b6(_0x1df260[_0xe05c('0x16')][_0xe05c('0x14')]);}})[_0xe05c('0x17')](function(_0x448678){logger['error'](_0xe05c('0xd'),_0x3f3a68,_0x448678);_0x344ff6(_0x448678);});});}
\ No newline at end of file
+var _0x231c=['code','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e40e9,_0x16cc7a){var _0x3d3cbc=function(_0x51019e){while(--_0x51019e){_0x1e40e9['push'](_0x1e40e9['shift']());}};_0x3d3cbc(++_0x16cc7a);}(_0x231c,0x16e));var _0xc231=function(_0x140536,_0x336212){_0x140536=_0x140536-0x0;var _0x738303=_0x231c[_0x140536];return _0x738303;};'use strict';var _=require(_0xc231('0x0'));var util=require(_0xc231('0x1'));var moment=require(_0xc231('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc231('0x3'));var db=require(_0xc231('0x4'))['db'];var utils=require(_0xc231('0x5'));var logger=require(_0xc231('0x6'))(_0xc231('0x7'));var config=require(_0xc231('0x8'));var jayson=require(_0xc231('0x9'));var client=jayson[_0xc231('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea12c,_0x520c9f,_0x44bd61){return new BPromise(function(_0xa7342f,_0x50e24e){return client[_0xc231('0xb')](_0x3ea12c,_0x44bd61)[_0xc231('0xc')](function(_0x4df7b4){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x520c9f,_0xc231('0xd'));logger[_0xc231('0xe')](_0xc231('0xf'),_0x520c9f,'request\x20sent',JSON[_0xc231('0x10')](_0x4df7b4));if(_0x4df7b4[_0xc231('0x11')]){if(_0x4df7b4[_0xc231('0x11')][_0xc231('0x12')]===0x1f4){logger[_0xc231('0x11')](_0xc231('0x13'),_0x520c9f,_0x4df7b4[_0xc231('0x11')]['message']);return _0x50e24e(_0x4df7b4[_0xc231('0x11')][_0xc231('0x14')]);}logger[_0xc231('0x11')](_0xc231('0x13'),_0x520c9f,_0x4df7b4[_0xc231('0x11')][_0xc231('0x14')]);return _0xa7342f(_0x4df7b4[_0xc231('0x11')][_0xc231('0x14')]);}else{logger[_0xc231('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x520c9f,_0xc231('0xd'));_0xa7342f(_0x4df7b4[_0xc231('0x16')][_0xc231('0x14')]);}})[_0xc231('0x17')](function(_0x26cb3d){logger[_0xc231('0x11')](_0xc231('0x13'),_0x520c9f,_0x26cb3d);_0x50e24e(_0x26cb3d);});});}
\ No newline at end of file
index a84e0c3..a7d9695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x075c=['/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x075c,0x11c));var _0xc075=function(_0x3fe9b0,_0x607038){_0x3fe9b0=_0x3fe9b0-0x0;var _0x53604e=_0x075c[_0x3fe9b0];return _0x53604e;};'use strict';var multer=require(_0xc075('0x0'));var util=require(_0xc075('0x1'));var path=require(_0xc075('0x2'));var timeout=require(_0xc075('0x3'));var express=require('express');var router=express[_0xc075('0x4')]();var fs_extra=require(_0xc075('0x5'));var auth=require(_0xc075('0x6'));var interaction=require(_0xc075('0x7'));var config=require(_0xc075('0x8'));var controller=require(_0xc075('0x9'));router[_0xc075('0xa')]('/',auth[_0xc075('0xb')](),controller[_0xc075('0xc')]);router[_0xc075('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc075('0xd')]);router[_0xc075('0xe')]('/',auth[_0xc075('0xb')](),controller[_0xc075('0xf')]);router['put'](_0xc075('0x10'),auth[_0xc075('0xb')](),controller[_0xc075('0x11')]);router[_0xc075('0x12')]('/:id',auth[_0xc075('0xb')](),controller[_0xc075('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x6ad9=['post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x6ad9,0x114));var _0x96ad=function(_0x5db1e2,_0x5d4e2b){_0x5db1e2=_0x5db1e2-0x0;var _0x62689b=_0x6ad9[_0x5db1e2];return _0x62689b;};'use strict';var multer=require(_0x96ad('0x0'));var util=require(_0x96ad('0x1'));var path=require(_0x96ad('0x2'));var timeout=require(_0x96ad('0x3'));var express=require('express');var router=express[_0x96ad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x96ad('0x5'));var interaction=require(_0x96ad('0x6'));var config=require(_0x96ad('0x7'));var controller=require(_0x96ad('0x8'));router['get']('/',auth[_0x96ad('0x9')](),controller[_0x96ad('0xa')]);router[_0x96ad('0xb')]('/:id',auth[_0x96ad('0x9')](),controller['show']);router[_0x96ad('0xc')]('/',auth[_0x96ad('0x9')](),controller[_0x96ad('0xd')]);router['put'](_0x96ad('0xe'),auth['isAuthenticated'](),controller[_0x96ad('0xf')]);router[_0x96ad('0x10')](_0x96ad('0xe'),auth[_0x96ad('0x9')](),controller['destroy']);module[_0x96ad('0x11')]=router;
\ No newline at end of file
index 3344da2..835032a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3527=['STRING','BOOLEAN','exports','string','variable','keyValue','picklist','ENUM','customVariable'];(function(_0x32a8be,_0x275743){var _0x458316=function(_0xffb95){while(--_0xffb95){_0x32a8be['push'](_0x32a8be['shift']());}};_0x458316(++_0x275743);}(_0x3527,0x1f1));var _0x7352=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0x3527[_0x31abee];return _0x3c1761;};'use strict';var Sequelize=require('sequelize');module[_0x7352('0x0')]={'type':{'type':Sequelize['ENUM'](_0x7352('0x1'),_0x7352('0x2'),'customVariable',_0x7352('0x3'),_0x7352('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7352('0x5')]('string',_0x7352('0x2'),_0x7352('0x6'))},'keyContent':{'type':Sequelize[_0x7352('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7352('0x7')]},'customField':{'type':Sequelize[_0x7352('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7352('0x7')]}};
\ No newline at end of file
+var _0x6f73=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3684b3,_0x4387f3){var _0x5bcb17=function(_0x291f82){while(--_0x291f82){_0x3684b3['push'](_0x3684b3['shift']());}};_0x5bcb17(++_0x4387f3);}(_0x6f73,0x9b));var _0x36f7=function(_0x2c7ba0,_0x1beeaa){_0x2c7ba0=_0x2c7ba0-0x0;var _0x6dca02=_0x6f73[_0x2c7ba0];return _0x6dca02;};'use strict';var Sequelize=require(_0x36f7('0x0'));module[_0x36f7('0x1')]={'type':{'type':Sequelize[_0x36f7('0x2')](_0x36f7('0x3'),_0x36f7('0x4'),_0x36f7('0x5'),_0x36f7('0x6'),'picklist'),'defaultValue':_0x36f7('0x3')},'content':{'type':Sequelize[_0x36f7('0x7')]},'key':{'type':Sequelize[_0x36f7('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x36f7('0x3'),'variable',_0x36f7('0x5'))},'keyContent':{'type':Sequelize[_0x36f7('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x36f7('0x7')]},'customField':{'type':Sequelize[_0x36f7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x36f7('0x7')]}};
\ No newline at end of file
index 938fcfe..046d1e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7794=['status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4e8fb5,_0x5bb89a){var _0x198b65=function(_0x2c6be8){while(--_0x2c6be8){_0x4e8fb5['push'](_0x4e8fb5['shift']());}};_0x198b65(++_0x5bb89a);}(_0x7794,0x7b));var _0x4779=function(_0x55525f,_0x177a78){_0x55525f=_0x55525f-0x0;var _0xce3bd6=_0x7794[_0x55525f];return _0xce3bd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4779('0x0'));var zipdir=require(_0x4779('0x1'));var jsonpatch=require(_0x4779('0x2'));var rp=require(_0x4779('0x3'));var moment=require('moment');var BPromise=require(_0x4779('0x4'));var Mustache=require(_0x4779('0x5'));var util=require('util');var path=require(_0x4779('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4779('0x7'));var _=require(_0x4779('0x8'));var squel=require('squel');var crypto=require(_0x4779('0x9'));var jsforce=require(_0x4779('0xa'));var deskjs=require(_0x4779('0xb'));var toCsv=require(_0x4779('0xc'));var querystring=require(_0x4779('0xd'));var Papa=require(_0x4779('0xe'));var Redis=require(_0x4779('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4779('0x10'));var as=require(_0x4779('0x11'));var hardwareService=require(_0x4779('0x12'));var logger=require(_0x4779('0x13'))(_0x4779('0x14'));var utils=require(_0x4779('0x15'));var config=require(_0x4779('0x16'));var licenseUtil=require(_0x4779('0x17'));var db=require(_0x4779('0x18'))['db'];function respondWithStatusCode(_0x13c989,_0x50e17e){_0x50e17e=_0x50e17e||0xcc;return function(_0x5b1219){if(_0x5b1219){return _0x13c989['sendStatus'](_0x50e17e);}return _0x13c989[_0x4779('0x19')](_0x50e17e)[_0x4779('0x1a')]();};}function respondWithResult(_0xb9a06f,_0xddf5cd){_0xddf5cd=_0xddf5cd||0xc8;return function(_0x4fe370){if(_0x4fe370){return _0xb9a06f[_0x4779('0x19')](_0xddf5cd)[_0x4779('0x1b')](_0x4fe370);}};}function respondWithFilteredResult(_0x4d71a0,_0x599deb){return function(_0x1dbbe1){if(_0x1dbbe1){var _0x2de2be=typeof _0x599deb[_0x4779('0x1c')]===_0x4779('0x1d')&&typeof _0x599deb['limit']==='undefined';var _0x445e0b=_0x1dbbe1[_0x4779('0x1e')];var _0x19fbb6=_0x2de2be?0x0:_0x599deb['offset'];var _0x3dbe70=_0x2de2be?_0x1dbbe1['count']:_0x599deb[_0x4779('0x1c')]+_0x599deb[_0x4779('0x1f')];var _0x478fa5;if(_0x3dbe70>=_0x445e0b){_0x3dbe70=_0x445e0b;_0x478fa5=0xc8;}else{_0x478fa5=0xce;}_0x4d71a0[_0x4779('0x19')](_0x478fa5);return _0x4d71a0['set'](_0x4779('0x20'),_0x19fbb6+'-'+_0x3dbe70+'/'+_0x445e0b)[_0x4779('0x1b')](_0x1dbbe1);}return null;};}function patchUpdates(_0x143ef6){return function(_0x298e25){try{jsonpatch[_0x4779('0x21')](_0x298e25,_0x143ef6,!![]);}catch(_0x1ce270){return BPromise['reject'](_0x1ce270);}return _0x298e25[_0x4779('0x22')]();};}function saveUpdates(_0x4f2158,_0x4ad246){return function(_0xd983f0){if(_0xd983f0){return _0xd983f0[_0x4779('0x23')](_0x4f2158)[_0x4779('0x24')](function(_0x2b7ab6){return _0x2b7ab6;});}return null;};}function removeEntity(_0x555cd6,_0x152887){return function(_0x29a39a){if(_0x29a39a){return _0x29a39a[_0x4779('0x25')]()['then'](function(){_0x555cd6[_0x4779('0x19')](0xcc)[_0x4779('0x1a')]();});}};}function handleEntityNotFound(_0x577b13,_0x1ce2d2){return function(_0x38af24){if(!_0x38af24){_0x577b13['sendStatus'](0x194);}return _0x38af24;};}function handleError(_0x20db7e,_0x277f55){_0x277f55=_0x277f55||0x1f4;return function(_0x211af1){logger[_0x4779('0x26')](_0x211af1[_0x4779('0x27')]);if(_0x211af1[_0x4779('0x28')]){delete _0x211af1[_0x4779('0x28')];}_0x20db7e[_0x4779('0x19')](_0x277f55)['send'](_0x211af1);};}exports[_0x4779('0x29')]=function(_0x1607a5,_0xb028f){var _0x28a261={},_0x8b4c42={},_0x40fb18={'count':0x0,'rows':[]};var _0x13ec28=_[_0x4779('0x2a')](db['FreshdeskField']['rawAttributes'],function(_0x179717){return{'name':_0x179717[_0x4779('0x2b')],'type':_0x179717[_0x4779('0x2c')][_0x4779('0x2d')]};});_0x8b4c42[_0x4779('0x2e')]=_['map'](_0x13ec28,_0x4779('0x28'));_0x8b4c42[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x1607a5[_0x4779('0x2f')]);_0x8b4c42['filters']=_['intersection'](_0x8b4c42[_0x4779('0x2e')],_0x8b4c42['query']);_0x28a261[_0x4779('0x31')]=_[_0x4779('0x32')](_0x8b4c42[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x33')]));_0x28a261[_0x4779('0x31')]=_0x28a261[_0x4779('0x31')][_0x4779('0x34')]?_0x28a261[_0x4779('0x31')]:_0x8b4c42[_0x4779('0x2e')];if(!_0x1607a5[_0x4779('0x2f')]['hasOwnProperty']('nolimit')){_0x28a261[_0x4779('0x1f')]=qs['limit'](_0x1607a5[_0x4779('0x2f')]['limit']);_0x28a261[_0x4779('0x1c')]=qs[_0x4779('0x1c')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x1c')]);}_0x28a261[_0x4779('0x35')]=qs['sort'](_0x1607a5['query'][_0x4779('0x36')]);_0x28a261[_0x4779('0x37')]=qs[_0x4779('0x38')](_[_0x4779('0x39')](_0x1607a5[_0x4779('0x2f')],_0x8b4c42[_0x4779('0x38')]),_0x13ec28);if(_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]){_0x28a261[_0x4779('0x37')]=_[_0x4779('0x3b')](_0x28a261[_0x4779('0x37')],{'$or':_[_0x4779('0x2a')](_0x13ec28,function(_0x88603f){if(_0x88603f[_0x4779('0x2c')]!==_0x4779('0x3c')){var _0x1a2c16={};_0x1a2c16[_0x88603f[_0x4779('0x28')]]={'$like':'%'+_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]+'%'};return _0x1a2c16;}})});}_0x28a261=_['merge']({},_0x28a261,_0x1607a5[_0x4779('0x3d')]);var _0x58ca36={'where':_0x28a261[_0x4779('0x37')]};return db[_0x4779('0x3e')][_0x4779('0x1e')](_0x58ca36)[_0x4779('0x24')](function(_0xc9873e){_0x40fb18[_0x4779('0x1e')]=_0xc9873e;if(_0x1607a5['query'][_0x4779('0x3f')]){_0x28a261['include']=[{'all':!![]}];}return db[_0x4779('0x3e')][_0x4779('0x40')](_0x28a261);})[_0x4779('0x24')](function(_0x3a3589){_0x40fb18[_0x4779('0x41')]=_0x3a3589;return _0x40fb18;})[_0x4779('0x24')](respondWithFilteredResult(_0xb028f,_0x28a261))['catch'](handleError(_0xb028f,null));};exports[_0x4779('0x42')]=function(_0x5cdc2b,_0x20abf7){var _0x3f1889={'raw':!![],'where':{'id':_0x5cdc2b['params']['id']}},_0x2e60ab={};_0x2e60ab[_0x4779('0x2e')]=_[_0x4779('0x30')](db[_0x4779('0x3e')][_0x4779('0x43')]);_0x2e60ab[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x5cdc2b[_0x4779('0x2f')]);_0x2e60ab[_0x4779('0x38')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],_0x2e60ab[_0x4779('0x2f')]);_0x3f1889[_0x4779('0x31')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x5cdc2b['query']['fields']));_0x3f1889[_0x4779('0x31')]=_0x3f1889[_0x4779('0x31')][_0x4779('0x34')]?_0x3f1889[_0x4779('0x31')]:_0x2e60ab[_0x4779('0x2e')];if(_0x5cdc2b[_0x4779('0x2f')][_0x4779('0x3f')]){_0x3f1889[_0x4779('0x44')]=[{'all':!![]}];}_0x3f1889=_['merge']({},_0x3f1889,_0x5cdc2b[_0x4779('0x3d')]);return db[_0x4779('0x3e')][_0x4779('0x45')](_0x3f1889)[_0x4779('0x24')](handleEntityNotFound(_0x20abf7,null))[_0x4779('0x24')](respondWithResult(_0x20abf7,null))[_0x4779('0x46')](handleError(_0x20abf7,null));};exports['create']=function(_0x7f419c,_0x39ecb5){return db[_0x4779('0x3e')][_0x4779('0x47')](_0x7f419c[_0x4779('0x48')],{})['then'](respondWithResult(_0x39ecb5,0xc9))[_0x4779('0x46')](handleError(_0x39ecb5,null));};exports[_0x4779('0x23')]=function(_0x3873d4,_0x4a1040){if(_0x3873d4[_0x4779('0x48')]['id']){delete _0x3873d4['body']['id'];}return db[_0x4779('0x3e')][_0x4779('0x45')]({'where':{'id':_0x3873d4[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a1040,null))[_0x4779('0x24')](saveUpdates(_0x3873d4['body'],null))[_0x4779('0x24')](respondWithResult(_0x4a1040,null))[_0x4779('0x46')](handleError(_0x4a1040,null));};exports[_0x4779('0x25')]=function(_0x58e14e,_0x5dfdb7){return db['FreshdeskField'][_0x4779('0x45')]({'where':{'id':_0x58e14e[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x5dfdb7,null))[_0x4779('0x24')](removeEntity(_0x5dfdb7,null))[_0x4779('0x46')](handleError(_0x5dfdb7,null));};
\ No newline at end of file
+var _0x6308=['path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util'];(function(_0x1e6059,_0x3b6730){var _0x59c48b=function(_0x100508){while(--_0x100508){_0x1e6059['push'](_0x1e6059['shift']());}};_0x59c48b(++_0x3b6730);}(_0x6308,0x1f2));var _0x8630=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x6308[_0x257642];return _0x3d813b;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8630('0x2'));var BPromise=require(_0x8630('0x3'));var Mustache=require(_0x8630('0x4'));var util=require(_0x8630('0x5'));var path=require(_0x8630('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8630('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8630('0x8'));var squel=require(_0x8630('0x9'));var crypto=require(_0x8630('0xa'));var jsforce=require(_0x8630('0xb'));var deskjs=require(_0x8630('0xc'));var toCsv=require(_0x8630('0xd'));var querystring=require('querystring');var Papa=require(_0x8630('0xe'));var Redis=require('ioredis');var authService=require(_0x8630('0xf'));var qs=require(_0x8630('0x10'));var as=require(_0x8630('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8630('0x12'))(_0x8630('0x13'));var utils=require(_0x8630('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8630('0x15'));var db=require(_0x8630('0x16'))['db'];function respondWithStatusCode(_0x5b6d75,_0x54073b){_0x54073b=_0x54073b||0xcc;return function(_0x303e3a){if(_0x303e3a){return _0x5b6d75[_0x8630('0x17')](_0x54073b);}return _0x5b6d75['status'](_0x54073b)[_0x8630('0x18')]();};}function respondWithResult(_0x4db686,_0xf31c17){_0xf31c17=_0xf31c17||0xc8;return function(_0x4cc542){if(_0x4cc542){return _0x4db686[_0x8630('0x19')](_0xf31c17)['json'](_0x4cc542);}};}function respondWithFilteredResult(_0x53f236,_0x29a42d){return function(_0x86c262){if(_0x86c262){var _0x49fce1=typeof _0x29a42d['offset']===_0x8630('0x1a')&&typeof _0x29a42d['limit']===_0x8630('0x1a');var _0x18a874=_0x86c262[_0x8630('0x1b')];var _0x20f462=_0x49fce1?0x0:_0x29a42d[_0x8630('0x1c')];var _0x1e9780=_0x49fce1?_0x86c262[_0x8630('0x1b')]:_0x29a42d[_0x8630('0x1c')]+_0x29a42d[_0x8630('0x1d')];var _0x5dd2e0;if(_0x1e9780>=_0x18a874){_0x1e9780=_0x18a874;_0x5dd2e0=0xc8;}else{_0x5dd2e0=0xce;}_0x53f236['status'](_0x5dd2e0);return _0x53f236[_0x8630('0x1e')](_0x8630('0x1f'),_0x20f462+'-'+_0x1e9780+'/'+_0x18a874)['json'](_0x86c262);}return null;};}function patchUpdates(_0x5cff5c){return function(_0x1325dc){try{jsonpatch[_0x8630('0x20')](_0x1325dc,_0x5cff5c,!![]);}catch(_0x1ac046){return BPromise['reject'](_0x1ac046);}return _0x1325dc['save']();};}function saveUpdates(_0xcc7454,_0x58c0b5){return function(_0x30fb4d){if(_0x30fb4d){return _0x30fb4d[_0x8630('0x21')](_0xcc7454)[_0x8630('0x22')](function(_0x469de3){return _0x469de3;});}return null;};}function removeEntity(_0x4c2851,_0x37c224){return function(_0xf24c11){if(_0xf24c11){return _0xf24c11[_0x8630('0x23')]()[_0x8630('0x22')](function(){_0x4c2851[_0x8630('0x19')](0xcc)[_0x8630('0x18')]();});}};}function handleEntityNotFound(_0x37b7aa,_0x5c0a22){return function(_0x5b2823){if(!_0x5b2823){_0x37b7aa[_0x8630('0x17')](0x194);}return _0x5b2823;};}function handleError(_0x41b79d,_0x439b33){_0x439b33=_0x439b33||0x1f4;return function(_0xf97e31){logger[_0x8630('0x24')](_0xf97e31[_0x8630('0x25')]);if(_0xf97e31[_0x8630('0x26')]){delete _0xf97e31[_0x8630('0x26')];}_0x41b79d[_0x8630('0x19')](_0x439b33)[_0x8630('0x27')](_0xf97e31);};}exports[_0x8630('0x28')]=function(_0x41f74c,_0xc18164){var _0x4285ee={},_0xbb1a58={},_0x190216={'count':0x0,'rows':[]};var _0x2d3f0b=_['map'](db[_0x8630('0x29')][_0x8630('0x2a')],function(_0x24d85d){return{'name':_0x24d85d[_0x8630('0x2b')],'type':_0x24d85d['type'][_0x8630('0x2c')]};});_0xbb1a58[_0x8630('0x2d')]=_[_0x8630('0x2e')](_0x2d3f0b,_0x8630('0x26'));_0xbb1a58[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x41f74c['query']);_0xbb1a58[_0x8630('0x31')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],_0xbb1a58['query']);_0x4285ee[_0x8630('0x33')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],qs[_0x8630('0x34')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x34')]));_0x4285ee['attributes']=_0x4285ee[_0x8630('0x33')][_0x8630('0x35')]?_0x4285ee[_0x8630('0x33')]:_0xbb1a58[_0x8630('0x2d')];if(!_0x41f74c[_0x8630('0x2f')][_0x8630('0x36')](_0x8630('0x37'))){_0x4285ee[_0x8630('0x1d')]=qs[_0x8630('0x1d')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1d')]);_0x4285ee[_0x8630('0x1c')]=qs[_0x8630('0x1c')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1c')]);}_0x4285ee[_0x8630('0x38')]=qs[_0x8630('0x39')](_0x41f74c['query'][_0x8630('0x39')]);_0x4285ee[_0x8630('0x3a')]=qs['filters'](_['pick'](_0x41f74c[_0x8630('0x2f')],_0xbb1a58[_0x8630('0x31')]),_0x2d3f0b);if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]){_0x4285ee[_0x8630('0x3a')]=_['merge'](_0x4285ee[_0x8630('0x3a')],{'$or':_[_0x8630('0x2e')](_0x2d3f0b,function(_0x38ee10){if(_0x38ee10[_0x8630('0x3c')]!=='VIRTUAL'){var _0xac2876={};_0xac2876[_0x38ee10[_0x8630('0x26')]]={'$like':'%'+_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]+'%'};return _0xac2876;}})});}_0x4285ee=_[_0x8630('0x3d')]({},_0x4285ee,_0x41f74c[_0x8630('0x3e')]);var _0x2fbb8c={'where':_0x4285ee['where']};return db[_0x8630('0x29')][_0x8630('0x1b')](_0x2fbb8c)[_0x8630('0x22')](function(_0xe3f392){_0x190216[_0x8630('0x1b')]=_0xe3f392;if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3f')]){_0x4285ee[_0x8630('0x40')]=[{'all':!![]}];}return db[_0x8630('0x29')][_0x8630('0x41')](_0x4285ee);})['then'](function(_0x358431){_0x190216['rows']=_0x358431;return _0x190216;})[_0x8630('0x22')](respondWithFilteredResult(_0xc18164,_0x4285ee))[_0x8630('0x42')](handleError(_0xc18164,null));};exports[_0x8630('0x43')]=function(_0x7c3dc5,_0x193bae){var _0x2f1fec={'raw':!![],'where':{'id':_0x7c3dc5[_0x8630('0x44')]['id']}},_0x5bcf39={};_0x5bcf39[_0x8630('0x2d')]=_[_0x8630('0x30')](db['FreshdeskField'][_0x8630('0x2a')]);_0x5bcf39[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x7c3dc5[_0x8630('0x2f')]);_0x5bcf39[_0x8630('0x31')]=_[_0x8630('0x32')](_0x5bcf39['model'],_0x5bcf39[_0x8630('0x2f')]);_0x2f1fec[_0x8630('0x33')]=_[_0x8630('0x32')](_0x5bcf39['model'],qs[_0x8630('0x34')](_0x7c3dc5[_0x8630('0x2f')]['fields']));_0x2f1fec[_0x8630('0x33')]=_0x2f1fec[_0x8630('0x33')][_0x8630('0x35')]?_0x2f1fec['attributes']:_0x5bcf39['model'];if(_0x7c3dc5[_0x8630('0x2f')]['includeAll']){_0x2f1fec['include']=[{'all':!![]}];}_0x2f1fec=_[_0x8630('0x3d')]({},_0x2f1fec,_0x7c3dc5['options']);return db[_0x8630('0x29')][_0x8630('0x45')](_0x2f1fec)['then'](handleEntityNotFound(_0x193bae,null))[_0x8630('0x22')](respondWithResult(_0x193bae,null))[_0x8630('0x42')](handleError(_0x193bae,null));};exports[_0x8630('0x46')]=function(_0x5d8149,_0x121e83){return db['FreshdeskField'][_0x8630('0x46')](_0x5d8149[_0x8630('0x47')],{})['then'](respondWithResult(_0x121e83,0xc9))[_0x8630('0x42')](handleError(_0x121e83,null));};exports[_0x8630('0x21')]=function(_0x3ff20b,_0x47aa03){if(_0x3ff20b[_0x8630('0x47')]['id']){delete _0x3ff20b[_0x8630('0x47')]['id'];}return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x3ff20b[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x47aa03,null))[_0x8630('0x22')](saveUpdates(_0x3ff20b[_0x8630('0x47')],null))[_0x8630('0x22')](respondWithResult(_0x47aa03,null))['catch'](handleError(_0x47aa03,null));};exports['destroy']=function(_0x1b8328,_0x13326d){return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x1b8328[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x13326d,null))[_0x8630('0x22')](removeEntity(_0x13326d,null))['catch'](handleError(_0x13326d,null));};
\ No newline at end of file
index f6ac21d..60af414 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d3c=['lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x815c86,_0x15bc19){var _0x2f9c62=function(_0x5bd734){while(--_0x5bd734){_0x815c86['push'](_0x815c86['shift']());}};_0x2f9c62(++_0x15bc19);}(_0x1d3c,0x1c7));var _0xc1d3=function(_0x1ca4c3,_0x554126){_0x1ca4c3=_0x1ca4c3-0x0;var _0x4426a6=_0x1d3c[_0x1ca4c3];return _0x4426a6;};'use strict';var _=require(_0xc1d3('0x0'));var util=require(_0xc1d3('0x1'));var logger=require(_0xc1d3('0x2'))(_0xc1d3('0x3'));var moment=require(_0xc1d3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc1d3('0x5'));var config=require(_0xc1d3('0x6'));var attributes=require(_0xc1d3('0x7'));module[_0xc1d3('0x8')]=function(_0x988216,_0x1bdff3){return _0x988216['define'](_0xc1d3('0x9'),attributes,{'tableName':_0xc1d3('0xa'),'paranoid':![],'indexes':[{'name':_0xc1d3('0xb'),'fields':[_0xc1d3('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfccc=['path','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','../../config/logger','bluebird','request-promise'];(function(_0x9c7e5e,_0xca405){var _0x48cec7=function(_0xe73c68){while(--_0xe73c68){_0x9c7e5e['push'](_0x9c7e5e['shift']());}};_0x48cec7(++_0xca405);}(_0xfccc,0xa4));var _0xcfcc=function(_0x282785,_0x2bd1e6){_0x282785=_0x282785-0x0;var _0x231bae=_0xfccc[_0x282785];return _0x231bae;};'use strict';var _=require(_0xcfcc('0x0'));var util=require('util');var logger=require(_0xcfcc('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcfcc('0x2'));var rp=require(_0xcfcc('0x3'));var fs=require('fs');var path=require(_0xcfcc('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcfcc('0x5'));module[_0xcfcc('0x6')]=function(_0x38ae1f,_0x12cc09){return _0x38ae1f[_0xcfcc('0x7')](_0xcfcc('0x8'),attributes,{'tableName':_0xcfcc('0x9'),'paranoid':![],'indexes':[{'name':_0xcfcc('0xa'),'fields':['idField',_0xcfcc('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9df98e3..7087f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cb5=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0cb5,0x1e2));var _0x50cb=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x0cb5[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x50cb('0x0'));var util=require(_0x50cb('0x1'));var moment=require(_0x50cb('0x2'));var BPromise=require('bluebird');var rs=require(_0x50cb('0x3'));var fs=require('fs');var Redis=require(_0x50cb('0x4'));var db=require(_0x50cb('0x5'))['db'];var utils=require(_0x50cb('0x6'));var logger=require(_0x50cb('0x7'))(_0x50cb('0x8'));var config=require(_0x50cb('0x9'));var jayson=require(_0x50cb('0xa'));var client=jayson[_0x50cb('0xb')][_0x50cb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x734136,_0x1f2bb5,_0x4102e7){return new BPromise(function(_0x351cb1,_0x972f5b){return client[_0x50cb('0xd')](_0x734136,_0x4102e7)['then'](function(_0x495665){logger[_0x50cb('0xe')](_0x50cb('0xf'),_0x1f2bb5,_0x50cb('0x10'));logger[_0x50cb('0x11')](_0x50cb('0x12'),_0x1f2bb5,_0x50cb('0x10'),JSON['stringify'](_0x495665));if(_0x495665[_0x50cb('0x13')]){if(_0x495665[_0x50cb('0x13')][_0x50cb('0x14')]===0x1f4){logger[_0x50cb('0x13')](_0x50cb('0xf'),_0x1f2bb5,_0x495665['error'][_0x50cb('0x15')]);return _0x972f5b(_0x495665[_0x50cb('0x13')][_0x50cb('0x15')]);}logger[_0x50cb('0x13')](_0x50cb('0xf'),_0x1f2bb5,_0x495665['error'][_0x50cb('0x15')]);return _0x351cb1(_0x495665[_0x50cb('0x13')][_0x50cb('0x15')]);}else{logger['info'](_0x50cb('0xf'),_0x1f2bb5,'request\x20sent');_0x351cb1(_0x495665[_0x50cb('0x16')][_0x50cb('0x15')]);}})[_0x50cb('0x17')](function(_0x40c9a1){logger[_0x50cb('0x13')](_0x50cb('0xf'),_0x1f2bb5,_0x40c9a1);_0x972f5b(_0x40c9a1);});});}
\ No newline at end of file
+var _0x6dd1=['message','FreshdeskField,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x15a30b,_0x5d6a07){var _0x1ef0b9=function(_0x47a68b){while(--_0x47a68b){_0x15a30b['push'](_0x15a30b['shift']());}};_0x1ef0b9(++_0x5d6a07);}(_0x6dd1,0x64));var _0x16dd=function(_0x4b7d07,_0xb1d61d){_0x4b7d07=_0x4b7d07-0x0;var _0x2a72ad=_0x6dd1[_0x4b7d07];return _0x2a72ad;};'use strict';var _=require(_0x16dd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x16dd('0x1'));var rs=require(_0x16dd('0x2'));var fs=require('fs');var Redis=require(_0x16dd('0x3'));var db=require(_0x16dd('0x4'))['db'];var utils=require(_0x16dd('0x5'));var logger=require(_0x16dd('0x6'))(_0x16dd('0x7'));var config=require(_0x16dd('0x8'));var jayson=require(_0x16dd('0x9'));var client=jayson[_0x16dd('0xa')][_0x16dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26be31,_0x5305f4,_0x4f75f2){return new BPromise(function(_0x543f69,_0x246b64){return client['request'](_0x26be31,_0x4f75f2)[_0x16dd('0xc')](function(_0x3124e9){logger[_0x16dd('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x5305f4,_0x16dd('0xe'));logger[_0x16dd('0xf')](_0x16dd('0x10'),_0x5305f4,_0x16dd('0xe'),JSON[_0x16dd('0x11')](_0x3124e9));if(_0x3124e9[_0x16dd('0x12')]){if(_0x3124e9[_0x16dd('0x12')][_0x16dd('0x13')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x5305f4,_0x3124e9[_0x16dd('0x12')]['message']);return _0x246b64(_0x3124e9[_0x16dd('0x12')][_0x16dd('0x14')]);}logger[_0x16dd('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x5305f4,_0x3124e9[_0x16dd('0x12')][_0x16dd('0x14')]);return _0x543f69(_0x3124e9[_0x16dd('0x12')][_0x16dd('0x14')]);}else{logger['info'](_0x16dd('0x15'),_0x5305f4,_0x16dd('0xe'));_0x543f69(_0x3124e9[_0x16dd('0x16')][_0x16dd('0x14')]);}})[_0x16dd('0x17')](function(_0x534ea2){logger[_0x16dd('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x5305f4,_0x534ea2);_0x246b64(_0x534ea2);});});}
\ No newline at end of file
index de90e07..5925376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x34b7,0x196));var _0x734b=function(_0x2c507b,_0x343d21){_0x2c507b=_0x2c507b-0x0;var _0x346f0d=_0x34b7[_0x2c507b];return _0x346f0d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x734b('0x7')]('/:id/fields',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0xd')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xd')](_0x734b('0xf'),auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0x11')](_0x734b('0xa'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0x13')]('/:id',auth[_0x734b('0x8')](),controller[_0x734b('0x14')]);module[_0x734b('0x15')]=router;
\ No newline at end of file
+var _0x2f68=['create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','post'];(function(_0x54f884,_0x1da16c){var _0x33585b=function(_0x1618c1){while(--_0x1618c1){_0x54f884['push'](_0x54f884['shift']());}};_0x33585b(++_0x1da16c);}(_0x2f68,0x9a));var _0x82f6=function(_0x3a756b,_0xdf6ea5){_0x3a756b=_0x3a756b-0x0;var _0x161438=_0x2f68[_0x3a756b];return _0x161438;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['getConfigurations']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),controller[_0x82f6('0xe')]);router[_0x82f6('0xd')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0xf')]);router[_0x82f6('0x10')]('/:id',auth[_0x82f6('0x8')](),controller[_0x82f6('0x11')]);router[_0x82f6('0x12')](_0x82f6('0x9'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x13')]);module[_0x82f6('0x14')]=router;
\ No newline at end of file
index 904034e..e8149c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['remoteUri','exports','STRING','username'];(function(_0x5f3a8d,_0x3a9f7a){var _0x7d2f7a=function(_0x5782e1){while(--_0x5782e1){_0x5f3a8d['push'](_0x5f3a8d['shift']());}};_0x7d2f7a(++_0x3a9f7a);}(_0x2032,0xd9));var _0x2203=function(_0x3a618e,_0x84a893){_0x3a618e=_0x3a618e-0x0;var _0x5af442=_0x2032[_0x3a618e];return _0x5af442;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2203('0x2')},'apiKey':{'type':Sequelize[_0x2203('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2203('0x3')},'serverUrl':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x2d1ca6,_0x37765f){var _0x4415d6=function(_0x4f1192){while(--_0x4f1192){_0x2d1ca6['push'](_0x2d1ca6['shift']());}};_0x4415d6(++_0x37765f);}(_0xe5af,0x9c));var _0xfe5a=function(_0x5219aa,_0x357da6){_0x5219aa=_0x5219aa-0x0;var _0x479261=_0xe5af[_0x5219aa];return _0x479261;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 74d78ad..5d34303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x498b=['username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','update','then','stack','name','index','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','FreshsalesAccount','findAll','show','params','options','find','catch','create','body','destroy','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','channel','Descriptions','getDescriptions','FreshsalesField'];(function(_0x213c65,_0x5377cd){var _0x28781c=function(_0x5bf34b){while(--_0x5bf34b){_0x213c65['push'](_0x213c65['shift']());}};_0x28781c(++_0x5377cd);}(_0x498b,0x14f));var _0xb498=function(_0x1c7850,_0x201d42){_0x1c7850=_0x1c7850-0x0;var _0x540a2=_0x498b[_0x1c7850];return _0x540a2;};'use strict';var emlformat=require(_0xb498('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb498('0x1'));var jsonpatch=require(_0xb498('0x2'));var rp=require(_0xb498('0x3'));var moment=require(_0xb498('0x4'));var BPromise=require(_0xb498('0x5'));var Mustache=require(_0xb498('0x6'));var util=require('util');var path=require(_0xb498('0x7'));var sox=require(_0xb498('0x8'));var csv=require('to-csv');var ejs=require(_0xb498('0x9'));var fs=require('fs');var fs_extra=require(_0xb498('0xa'));var _=require(_0xb498('0xb'));var squel=require('squel');var crypto=require(_0xb498('0xc'));var jsforce=require(_0xb498('0xd'));var deskjs=require(_0xb498('0xe'));var toCsv=require(_0xb498('0xf'));var querystring=require(_0xb498('0x10'));var Papa=require(_0xb498('0x11'));var Redis=require(_0xb498('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb498('0x13'));var as=require(_0xb498('0x14'));var hardwareService=require(_0xb498('0x15'));var logger=require(_0xb498('0x16'))(_0xb498('0x17'));var utils=require('../../config/utils');var config=require(_0xb498('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb498('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x500f1a,_0xf38472){_0xf38472=_0xf38472||0xcc;return function(_0x2947cf){if(_0x2947cf){return _0x500f1a[_0xb498('0x1a')](_0xf38472);}return _0x500f1a[_0xb498('0x1b')](_0xf38472)[_0xb498('0x1c')]();};}function respondWithResult(_0x47bd76,_0x148d73){_0x148d73=_0x148d73||0xc8;return function(_0x531215){if(_0x531215){return _0x47bd76[_0xb498('0x1b')](_0x148d73)['json'](_0x531215);}};}function respondWithFilteredResult(_0x15ba28,_0x27ff2c){return function(_0x3373e2){if(_0x3373e2){var _0x57f869=typeof _0x27ff2c[_0xb498('0x1d')]===_0xb498('0x1e')&&typeof _0x27ff2c[_0xb498('0x1f')]===_0xb498('0x1e');var _0x2b5f1c=_0x3373e2['count'];var _0x196cfc=_0x57f869?0x0:_0x27ff2c[_0xb498('0x1d')];var _0x442c76=_0x57f869?_0x3373e2['count']:_0x27ff2c[_0xb498('0x1d')]+_0x27ff2c['limit'];var _0x1a13b0;if(_0x442c76>=_0x2b5f1c){_0x442c76=_0x2b5f1c;_0x1a13b0=0xc8;}else{_0x1a13b0=0xce;}_0x15ba28['status'](_0x1a13b0);return _0x15ba28[_0xb498('0x20')]('Content-Range',_0x196cfc+'-'+_0x442c76+'/'+_0x2b5f1c)[_0xb498('0x21')](_0x3373e2);}return null;};}function patchUpdates(_0x31a19e){return function(_0x385ef1){try{jsonpatch[_0xb498('0x22')](_0x385ef1,_0x31a19e,!![]);}catch(_0x1c9f17){return BPromise[_0xb498('0x23')](_0x1c9f17);}return _0x385ef1[_0xb498('0x24')]();};}function saveUpdates(_0x380c4f,_0x468852){return function(_0x43ea){if(_0x43ea){return _0x43ea[_0xb498('0x25')](_0x380c4f)[_0xb498('0x26')](function(_0x7e5978){return _0x7e5978;});}return null;};}function removeEntity(_0x53fddc,_0x1e5ece){return function(_0xc0f069){if(_0xc0f069){return _0xc0f069['destroy']()['then'](function(){_0x53fddc['status'](0xcc)[_0xb498('0x1c')]();});}};}function handleEntityNotFound(_0x405c96,_0x2204d6){return function(_0x585d84){if(!_0x585d84){_0x405c96[_0xb498('0x1a')](0x194);}return _0x585d84;};}function handleError(_0x7676fa,_0x249103){_0x249103=_0x249103||0x1f4;return function(_0xfb6c10){logger['error'](_0xfb6c10[_0xb498('0x27')]);if(_0xfb6c10[_0xb498('0x28')]){delete _0xfb6c10[_0xb498('0x28')];}_0x7676fa[_0xb498('0x1b')](_0x249103)['send'](_0xfb6c10);};}exports[_0xb498('0x29')]=function(_0x50264a,_0x3cccb3){var _0x4a94d4={},_0x9bef31={},_0x136ffc={'count':0x0,'rows':[]};var _0xda4acd=_['map'](db['FreshsalesAccount'][_0xb498('0x2a')],function(_0x21ea87){return{'name':_0x21ea87['fieldName'],'type':_0x21ea87[_0xb498('0x2b')][_0xb498('0x2c')]};});_0x9bef31['model']=_[_0xb498('0x2d')](_0xda4acd,_0xb498('0x28'));_0x9bef31[_0xb498('0x2e')]=_[_0xb498('0x2f')](_0x50264a['query']);_0x9bef31[_0xb498('0x30')]=_[_0xb498('0x31')](_0x9bef31[_0xb498('0x32')],_0x9bef31['query']);_0x4a94d4[_0xb498('0x33')]=_[_0xb498('0x31')](_0x9bef31[_0xb498('0x32')],qs[_0xb498('0x34')](_0x50264a[_0xb498('0x2e')][_0xb498('0x34')]));_0x4a94d4[_0xb498('0x33')]=_0x4a94d4[_0xb498('0x33')][_0xb498('0x35')]?_0x4a94d4[_0xb498('0x33')]:_0x9bef31[_0xb498('0x32')];if(!_0x50264a[_0xb498('0x2e')][_0xb498('0x36')](_0xb498('0x37'))){_0x4a94d4[_0xb498('0x1f')]=qs[_0xb498('0x1f')](_0x50264a[_0xb498('0x2e')][_0xb498('0x1f')]);_0x4a94d4[_0xb498('0x1d')]=qs[_0xb498('0x1d')](_0x50264a[_0xb498('0x2e')][_0xb498('0x1d')]);}_0x4a94d4[_0xb498('0x38')]=qs[_0xb498('0x39')](_0x50264a[_0xb498('0x2e')][_0xb498('0x39')]);_0x4a94d4[_0xb498('0x3a')]=qs[_0xb498('0x30')](_[_0xb498('0x3b')](_0x50264a[_0xb498('0x2e')],_0x9bef31[_0xb498('0x30')]),_0xda4acd);if(_0x50264a[_0xb498('0x2e')][_0xb498('0x3c')]){_0x4a94d4['where']=_[_0xb498('0x3d')](_0x4a94d4[_0xb498('0x3a')],{'$or':_[_0xb498('0x2d')](_0xda4acd,function(_0x1e958a){if(_0x1e958a[_0xb498('0x2b')]!==_0xb498('0x3e')){var _0x19daaf={};_0x19daaf[_0x1e958a[_0xb498('0x28')]]={'$like':'%'+_0x50264a[_0xb498('0x2e')]['filter']+'%'};return _0x19daaf;}})});}_0x4a94d4=_[_0xb498('0x3d')]({},_0x4a94d4,_0x50264a['options']);var _0x3417a5={'where':_0x4a94d4[_0xb498('0x3a')]};return db['FreshsalesAccount']['count'](_0x3417a5)[_0xb498('0x26')](function(_0x194d68){_0x136ffc[_0xb498('0x3f')]=_0x194d68;if(_0x50264a['query'][_0xb498('0x40')]){_0x4a94d4[_0xb498('0x41')]=[{'all':!![]}];}return db[_0xb498('0x42')][_0xb498('0x43')](_0x4a94d4);})[_0xb498('0x26')](function(_0x24ad50){_0x136ffc['rows']=_0x24ad50;return _0x136ffc;})['then'](respondWithFilteredResult(_0x3cccb3,_0x4a94d4))['catch'](handleError(_0x3cccb3,null));};exports[_0xb498('0x44')]=function(_0x5f1235,_0x363876){var _0x1b6ed6={'raw':![],'where':{'id':_0x5f1235[_0xb498('0x45')]['id']}},_0xd0a30e={};_0xd0a30e[_0xb498('0x32')]=_['keys'](db[_0xb498('0x42')][_0xb498('0x2a')]);_0xd0a30e[_0xb498('0x2e')]=_[_0xb498('0x2f')](_0x5f1235[_0xb498('0x2e')]);_0xd0a30e['filters']=_[_0xb498('0x31')](_0xd0a30e[_0xb498('0x32')],_0xd0a30e[_0xb498('0x2e')]);_0x1b6ed6[_0xb498('0x33')]=_[_0xb498('0x31')](_0xd0a30e[_0xb498('0x32')],qs[_0xb498('0x34')](_0x5f1235['query']['fields']));_0x1b6ed6['attributes']=_0x1b6ed6[_0xb498('0x33')]['length']?_0x1b6ed6[_0xb498('0x33')]:_0xd0a30e[_0xb498('0x32')];if(_0x5f1235['query']['includeAll']){_0x1b6ed6[_0xb498('0x41')]=[{'all':!![]}];}_0x1b6ed6=_['merge']({},_0x1b6ed6,_0x5f1235[_0xb498('0x46')]);return db[_0xb498('0x42')][_0xb498('0x47')](_0x1b6ed6)[_0xb498('0x26')](handleEntityNotFound(_0x363876,null))[_0xb498('0x26')](respondWithResult(_0x363876,null))[_0xb498('0x48')](handleError(_0x363876,null));};exports[_0xb498('0x49')]=function(_0x244251,_0x5e4f59){return db[_0xb498('0x42')][_0xb498('0x49')](_0x244251[_0xb498('0x4a')],{})[_0xb498('0x26')](respondWithResult(_0x5e4f59,0xc9))[_0xb498('0x48')](handleError(_0x5e4f59,null));};exports['update']=function(_0x1b0517,_0x4c2f1c){if(_0x1b0517[_0xb498('0x4a')]['id']){delete _0x1b0517[_0xb498('0x4a')]['id'];}return db[_0xb498('0x42')][_0xb498('0x47')]({'where':{'id':_0x1b0517[_0xb498('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c2f1c,null))[_0xb498('0x26')](saveUpdates(_0x1b0517['body'],null))[_0xb498('0x26')](respondWithResult(_0x4c2f1c,null))[_0xb498('0x48')](handleError(_0x4c2f1c,null));};exports[_0xb498('0x4b')]=function(_0x31918a,_0x53313c){return db['FreshsalesAccount'][_0xb498('0x47')]({'where':{'id':_0x31918a['params']['id']}})[_0xb498('0x26')](handleEntityNotFound(_0x53313c,null))[_0xb498('0x26')](removeEntity(_0x53313c,null))[_0xb498('0x48')](handleError(_0x53313c,null));};exports['getConfigurations']=function(_0x1b48a1,_0x576097,_0x4fc343){var _0x13740a={};var _0x238b49={};var _0x486095;var _0x280d66;return db[_0xb498('0x42')][_0xb498('0x4c')]({'where':{'id':_0x1b48a1[_0xb498('0x45')]['id']}})[_0xb498('0x26')](handleEntityNotFound(_0x576097,null))[_0xb498('0x26')](function(_0x51217f){if(_0x51217f){_0x486095=_0x51217f;_0x238b49[_0xb498('0x32')]=_[_0xb498('0x2f')](db[_0xb498('0x4d')][_0xb498('0x2a')]);_0x238b49['query']=_[_0xb498('0x2f')](_0x1b48a1[_0xb498('0x2e')]);_0x238b49[_0xb498('0x30')]=_[_0xb498('0x31')](_0x238b49['model'],_0x238b49[_0xb498('0x2e')]);_0x13740a[_0xb498('0x33')]=_[_0xb498('0x31')](_0x238b49[_0xb498('0x32')],qs[_0xb498('0x34')](_0x1b48a1[_0xb498('0x2e')][_0xb498('0x34')]));_0x13740a['attributes']=_0x13740a[_0xb498('0x33')]['length']?_0x13740a[_0xb498('0x33')]:_0x238b49[_0xb498('0x32')];_0x13740a['order']=qs[_0xb498('0x39')](_0x1b48a1[_0xb498('0x2e')][_0xb498('0x39')]);_0x13740a[_0xb498('0x3a')]=qs[_0xb498('0x30')](_['pick'](_0x1b48a1['query'],_0x238b49[_0xb498('0x30')]));if(_0x1b48a1[_0xb498('0x2e')][_0xb498('0x3c')]){_0x13740a['where']=_[_0xb498('0x3d')](_0x13740a[_0xb498('0x3a')],{'$or':_[_0xb498('0x2d')](_0x13740a[_0xb498('0x33')],function(_0x3b504a){var _0x14f883={};_0x14f883[_0x3b504a]={'$like':'%'+_0x1b48a1[_0xb498('0x2e')]['filter']+'%'};return _0x14f883;})});}_0x13740a=_[_0xb498('0x3d')]({},_0x13740a,_0x1b48a1[_0xb498('0x46')]);return _0x486095[_0xb498('0x4e')](_0x13740a);}})[_0xb498('0x26')](function(_0x3fb273){if(_0x3fb273){_0x280d66=_0x3fb273[_0xb498('0x35')];if(!_0x1b48a1[_0xb498('0x2e')][_0xb498('0x36')](_0xb498('0x37'))){_0x13740a[_0xb498('0x1f')]=qs[_0xb498('0x1f')](_0x1b48a1[_0xb498('0x2e')][_0xb498('0x1f')]);_0x13740a[_0xb498('0x1d')]=qs[_0xb498('0x1d')](_0x1b48a1[_0xb498('0x2e')]['offset']);}return _0x486095[_0xb498('0x4e')](_0x13740a);}})[_0xb498('0x26')](function(_0x45c4e4){if(_0x45c4e4){return _0x45c4e4?{'count':_0x280d66,'rows':_0x45c4e4}:null;}})[_0xb498('0x26')](respondWithResult(_0x576097,null))['catch'](handleError(_0x576097,null));};exports[_0xb498('0x4f')]=function(_0xcbf14f,_0x3a562d,_0x2b39d5){if(_0xcbf14f[_0xb498('0x4a')]['id']){delete _0xcbf14f[_0xb498('0x4a')]['id'];}return db[_0xb498('0x42')][_0xb498('0x4c')]({'where':{'id':_0xcbf14f[_0xb498('0x45')]['id']}})[_0xb498('0x26')](handleEntityNotFound(_0x3a562d,null))[_0xb498('0x26')](function(_0x44eee7){if(_0x44eee7){_0xcbf14f['body'][_0xb498('0x50')]=_0x44eee7['id'];_0xcbf14f['body']['Subjects']=integrations['getSubjects'](_0xcbf14f[_0xb498('0x4a')][_0xb498('0x51')],_0xcbf14f[_0xb498('0x4a')][_0xb498('0x2b')]);_0xcbf14f[_0xb498('0x4a')][_0xb498('0x52')]=integrations[_0xb498('0x53')](_0xcbf14f[_0xb498('0x4a')][_0xb498('0x51')],_0xcbf14f[_0xb498('0x4a')]['type']);return db[_0xb498('0x4d')][_0xb498('0x49')](_0xcbf14f[_0xb498('0x4a')],{'include':[{'model':db[_0xb498('0x54')],'as':'Subjects'},{'model':db[_0xb498('0x54')],'as':_0xb498('0x52')}]});}return null;})[_0xb498('0x26')](respondWithResult(_0x3a562d,null))[_0xb498('0x48')](handleError(_0x3a562d,null));};exports['getFields']=function(_0x2c51f4,_0x287430,_0x5c8e3a){var _0x46e289='';var _0x56816c='';return db[_0xb498('0x42')][_0xb498('0x4c')]({'where':{'id':_0x2c51f4[_0xb498('0x45')]['id']},'attributes':['id',_0xb498('0x55'),_0xb498('0x56'),_0xb498('0x57')]})[_0xb498('0x26')](handleEntityNotFound(_0x287430,null))['then'](function(_0x49ae98){if(_0x49ae98){_0x56816c=_0x49ae98[_0xb498('0x55')];_0x46e289=_0x49ae98[_0xb498('0x56')];var _0x35c429=_0x49ae98[_0xb498('0x56')][_0xb498('0x58')](-0x1);if(_0x35c429==='/'){_0x46e289=_0x46e289[_0xb498('0x59')](0x0,_0x46e289[_0xb498('0x5a')](_0x35c429));}return rp({'method':_0xb498('0x5b'),'uri':util[_0xb498('0x5c')](_0xb498('0x5d'),_0x46e289,_0xb498('0x5e')),'headers':{'Authorization':_0xb498('0x5f')+_0x49ae98['apiKey']},'json':!![]});}})[_0xb498('0x26')](function(_0x1eb56f){if(_0x1eb56f){var _0x117625=_0x1eb56f[_0xb498('0x60')];var _0x4684a1=![];var _0x2507fc=null;for(_0x2507fc=0x0;_0x2507fc<_0x117625[_0xb498('0x35')];_0x2507fc++){if(_0x117625[_0x2507fc][_0xb498('0x61')]===_0x56816c){_0x4684a1=!![];}}if(_0x4684a1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb498('0x62')});}}})[_0xb498('0x26')](respondWithResult(_0x287430,null))[_0xb498('0x48')](function(_0x483f68){var _0x17e52f=_0x2c51f4[_0xb498('0x2e')][_0xb498('0x63')]?0x1f4:_0x483f68[_0xb498('0x64')]||0x1f4;logger[_0xb498('0x65')](_0xb498('0x66'),'getFields',_0x17e52f,JSON[_0xb498('0x67')](_0x483f68));delete _0x483f68[_0xb498('0x28')];if(_0x17e52f===0x191){_0x17e52f=0x190;}_0x287430[_0xb498('0x1b')](_0x17e52f)['send'](_0x2c51f4[_0xb498('0x2e')][_0xb498('0x63')]?{'message':_0xb498('0x68'),'statusCode':_0x483f68[_0xb498('0x64')]}:_0x483f68);});};
\ No newline at end of file
+var _0x87d7=['test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','findOne','keys','order','getConfigurations','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','FreshsalesConfiguration','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send'];(function(_0x552804,_0x3c3d1e){var _0x32be66=function(_0x14c213){while(--_0x14c213){_0x552804['push'](_0x552804['shift']());}};_0x32be66(++_0x3c3d1e);}(_0x87d7,0xd2));var _0x787d=function(_0x2f187d,_0x323eb5){_0x2f187d=_0x2f187d-0x0;var _0x14169d=_0x87d7[_0x2f187d];return _0x14169d;};'use strict';var emlformat=require(_0x787d('0x0'));var rimraf=require(_0x787d('0x1'));var zipdir=require(_0x787d('0x2'));var jsonpatch=require(_0x787d('0x3'));var rp=require(_0x787d('0x4'));var moment=require(_0x787d('0x5'));var BPromise=require(_0x787d('0x6'));var Mustache=require(_0x787d('0x7'));var util=require(_0x787d('0x8'));var path=require('path');var sox=require(_0x787d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x787d('0xa'));var _=require(_0x787d('0xb'));var squel=require('squel');var crypto=require(_0x787d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x787d('0xd'));var toCsv=require(_0x787d('0xe'));var querystring=require(_0x787d('0xf'));var Papa=require(_0x787d('0x10'));var Redis=require(_0x787d('0x11'));var authService=require(_0x787d('0x12'));var qs=require(_0x787d('0x13'));var as=require(_0x787d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x787d('0x15'))(_0x787d('0x16'));var utils=require(_0x787d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x787d('0x18'));var db=require(_0x787d('0x19'))['db'];var integrations=require(_0x787d('0x1a'));function respondWithStatusCode(_0x487fd2,_0x53b88f){_0x53b88f=_0x53b88f||0xcc;return function(_0xbd3824){if(_0xbd3824){return _0x487fd2[_0x787d('0x1b')](_0x53b88f);}return _0x487fd2[_0x787d('0x1c')](_0x53b88f)[_0x787d('0x1d')]();};}function respondWithResult(_0x401efa,_0x54f665){_0x54f665=_0x54f665||0xc8;return function(_0x2ff245){if(_0x2ff245){return _0x401efa[_0x787d('0x1c')](_0x54f665)[_0x787d('0x1e')](_0x2ff245);}};}function respondWithFilteredResult(_0x3e2b06,_0x553642){return function(_0x38fef5){if(_0x38fef5){var _0x5af974=typeof _0x553642[_0x787d('0x1f')]===_0x787d('0x20')&&typeof _0x553642[_0x787d('0x21')]===_0x787d('0x20');var _0xe5dec0=_0x38fef5[_0x787d('0x22')];var _0x14ba7d=_0x5af974?0x0:_0x553642[_0x787d('0x1f')];var _0x19daca=_0x5af974?_0x38fef5[_0x787d('0x22')]:_0x553642[_0x787d('0x1f')]+_0x553642[_0x787d('0x21')];var _0x405e36;if(_0x19daca>=_0xe5dec0){_0x19daca=_0xe5dec0;_0x405e36=0xc8;}else{_0x405e36=0xce;}_0x3e2b06['status'](_0x405e36);return _0x3e2b06['set'](_0x787d('0x23'),_0x14ba7d+'-'+_0x19daca+'/'+_0xe5dec0)['json'](_0x38fef5);}return null;};}function patchUpdates(_0x27ce22){return function(_0x308bfc){try{jsonpatch[_0x787d('0x24')](_0x308bfc,_0x27ce22,!![]);}catch(_0x5aee1e){return BPromise[_0x787d('0x25')](_0x5aee1e);}return _0x308bfc[_0x787d('0x26')]();};}function saveUpdates(_0x340528,_0x9d4016){return function(_0xb15921){if(_0xb15921){return _0xb15921[_0x787d('0x27')](_0x340528)[_0x787d('0x28')](function(_0x125b42){return _0x125b42;});}return null;};}function removeEntity(_0x34382c,_0x1ce577){return function(_0xf15d18){if(_0xf15d18){return _0xf15d18[_0x787d('0x29')]()['then'](function(){_0x34382c['status'](0xcc)[_0x787d('0x1d')]();});}};}function handleEntityNotFound(_0x9cc1e4,_0x1801af){return function(_0x4bab48){if(!_0x4bab48){_0x9cc1e4[_0x787d('0x1b')](0x194);}return _0x4bab48;};}function handleError(_0x580958,_0x40ed87){_0x40ed87=_0x40ed87||0x1f4;return function(_0x1eacae){logger['error'](_0x1eacae[_0x787d('0x2a')]);if(_0x1eacae[_0x787d('0x2b')]){delete _0x1eacae[_0x787d('0x2b')];}_0x580958[_0x787d('0x1c')](_0x40ed87)['send'](_0x1eacae);};}exports[_0x787d('0x2c')]=function(_0x4f8875,_0x48c929){var _0x12b63e={},_0x2d5385={},_0x522235={'count':0x0,'rows':[]};var _0x2bfbf7=_[_0x787d('0x2d')](db[_0x787d('0x2e')][_0x787d('0x2f')],function(_0xacdba1){return{'name':_0xacdba1[_0x787d('0x30')],'type':_0xacdba1[_0x787d('0x31')][_0x787d('0x32')]};});_0x2d5385[_0x787d('0x33')]=_[_0x787d('0x2d')](_0x2bfbf7,_0x787d('0x2b'));_0x2d5385[_0x787d('0x34')]=_['keys'](_0x4f8875['query']);_0x2d5385['filters']=_[_0x787d('0x35')](_0x2d5385[_0x787d('0x33')],_0x2d5385[_0x787d('0x34')]);_0x12b63e[_0x787d('0x36')]=_['intersection'](_0x2d5385['model'],qs[_0x787d('0x37')](_0x4f8875[_0x787d('0x34')]['fields']));_0x12b63e[_0x787d('0x36')]=_0x12b63e['attributes'][_0x787d('0x38')]?_0x12b63e[_0x787d('0x36')]:_0x2d5385[_0x787d('0x33')];if(!_0x4f8875[_0x787d('0x34')]['hasOwnProperty'](_0x787d('0x39'))){_0x12b63e[_0x787d('0x21')]=qs['limit'](_0x4f8875[_0x787d('0x34')][_0x787d('0x21')]);_0x12b63e[_0x787d('0x1f')]=qs['offset'](_0x4f8875[_0x787d('0x34')]['offset']);}_0x12b63e['order']=qs['sort'](_0x4f8875['query'][_0x787d('0x3a')]);_0x12b63e[_0x787d('0x3b')]=qs[_0x787d('0x3c')](_['pick'](_0x4f8875[_0x787d('0x34')],_0x2d5385[_0x787d('0x3c')]),_0x2bfbf7);if(_0x4f8875[_0x787d('0x34')][_0x787d('0x3d')]){_0x12b63e[_0x787d('0x3b')]=_[_0x787d('0x3e')](_0x12b63e[_0x787d('0x3b')],{'$or':_[_0x787d('0x2d')](_0x2bfbf7,function(_0x105768){if(_0x105768['type']!==_0x787d('0x3f')){var _0x28efa2={};_0x28efa2[_0x105768[_0x787d('0x2b')]]={'$like':'%'+_0x4f8875[_0x787d('0x34')]['filter']+'%'};return _0x28efa2;}})});}_0x12b63e=_[_0x787d('0x3e')]({},_0x12b63e,_0x4f8875[_0x787d('0x40')]);var _0x427ffe={'where':_0x12b63e[_0x787d('0x3b')]};return db[_0x787d('0x2e')][_0x787d('0x22')](_0x427ffe)[_0x787d('0x28')](function(_0x2ed23f){_0x522235[_0x787d('0x22')]=_0x2ed23f;if(_0x4f8875[_0x787d('0x34')][_0x787d('0x41')]){_0x12b63e[_0x787d('0x42')]=[{'all':!![]}];}return db[_0x787d('0x2e')]['findAll'](_0x12b63e);})[_0x787d('0x28')](function(_0x238093){_0x522235['rows']=_0x238093;return _0x522235;})[_0x787d('0x28')](respondWithFilteredResult(_0x48c929,_0x12b63e))[_0x787d('0x43')](handleError(_0x48c929,null));};exports['show']=function(_0x3b7a33,_0x52fb62){var _0x2a4952={'raw':![],'where':{'id':_0x3b7a33[_0x787d('0x44')]['id']}},_0x1f58d7={};_0x1f58d7['model']=_['keys'](db['FreshsalesAccount'][_0x787d('0x2f')]);_0x1f58d7[_0x787d('0x34')]=_['keys'](_0x3b7a33[_0x787d('0x34')]);_0x1f58d7[_0x787d('0x3c')]=_[_0x787d('0x35')](_0x1f58d7[_0x787d('0x33')],_0x1f58d7[_0x787d('0x34')]);_0x2a4952[_0x787d('0x36')]=_[_0x787d('0x35')](_0x1f58d7['model'],qs[_0x787d('0x37')](_0x3b7a33[_0x787d('0x34')][_0x787d('0x37')]));_0x2a4952[_0x787d('0x36')]=_0x2a4952[_0x787d('0x36')][_0x787d('0x38')]?_0x2a4952[_0x787d('0x36')]:_0x1f58d7['model'];if(_0x3b7a33['query'][_0x787d('0x41')]){_0x2a4952[_0x787d('0x42')]=[{'all':!![]}];}_0x2a4952=_['merge']({},_0x2a4952,_0x3b7a33['options']);return db['FreshsalesAccount'][_0x787d('0x45')](_0x2a4952)[_0x787d('0x28')](handleEntityNotFound(_0x52fb62,null))[_0x787d('0x28')](respondWithResult(_0x52fb62,null))[_0x787d('0x43')](handleError(_0x52fb62,null));};exports[_0x787d('0x46')]=function(_0x5cbc15,_0x48fa9a){return db[_0x787d('0x2e')]['create'](_0x5cbc15[_0x787d('0x47')],{})[_0x787d('0x28')](respondWithResult(_0x48fa9a,0xc9))[_0x787d('0x43')](handleError(_0x48fa9a,null));};exports[_0x787d('0x27')]=function(_0x59343f,_0x3994d7){if(_0x59343f[_0x787d('0x47')]['id']){delete _0x59343f[_0x787d('0x47')]['id'];}return db[_0x787d('0x2e')][_0x787d('0x45')]({'where':{'id':_0x59343f['params']['id']}})['then'](handleEntityNotFound(_0x3994d7,null))[_0x787d('0x28')](saveUpdates(_0x59343f[_0x787d('0x47')],null))['then'](respondWithResult(_0x3994d7,null))[_0x787d('0x43')](handleError(_0x3994d7,null));};exports[_0x787d('0x29')]=function(_0x750b0c,_0x6c646e){return db['FreshsalesAccount'][_0x787d('0x45')]({'where':{'id':_0x750b0c['params']['id']}})[_0x787d('0x28')](handleEntityNotFound(_0x6c646e,null))[_0x787d('0x28')](removeEntity(_0x6c646e,null))[_0x787d('0x43')](handleError(_0x6c646e,null));};exports['getConfigurations']=function(_0x552b50,_0x4e4834,_0x1c6c32){var _0x338a50={};var _0x1345a8={};var _0x24bc0f;var _0x51bad1;return db[_0x787d('0x2e')][_0x787d('0x48')]({'where':{'id':_0x552b50['params']['id']}})[_0x787d('0x28')](handleEntityNotFound(_0x4e4834,null))[_0x787d('0x28')](function(_0x2dfac7){if(_0x2dfac7){_0x24bc0f=_0x2dfac7;_0x1345a8[_0x787d('0x33')]=_['keys'](db['FreshsalesConfiguration'][_0x787d('0x2f')]);_0x1345a8[_0x787d('0x34')]=_[_0x787d('0x49')](_0x552b50[_0x787d('0x34')]);_0x1345a8[_0x787d('0x3c')]=_[_0x787d('0x35')](_0x1345a8[_0x787d('0x33')],_0x1345a8[_0x787d('0x34')]);_0x338a50[_0x787d('0x36')]=_[_0x787d('0x35')](_0x1345a8[_0x787d('0x33')],qs[_0x787d('0x37')](_0x552b50[_0x787d('0x34')][_0x787d('0x37')]));_0x338a50[_0x787d('0x36')]=_0x338a50[_0x787d('0x36')]['length']?_0x338a50[_0x787d('0x36')]:_0x1345a8[_0x787d('0x33')];_0x338a50[_0x787d('0x4a')]=qs['sort'](_0x552b50[_0x787d('0x34')][_0x787d('0x3a')]);_0x338a50[_0x787d('0x3b')]=qs['filters'](_['pick'](_0x552b50[_0x787d('0x34')],_0x1345a8[_0x787d('0x3c')]));if(_0x552b50[_0x787d('0x34')][_0x787d('0x3d')]){_0x338a50['where']=_['merge'](_0x338a50[_0x787d('0x3b')],{'$or':_[_0x787d('0x2d')](_0x338a50[_0x787d('0x36')],function(_0x19356b){var _0x14f3f7={};_0x14f3f7[_0x19356b]={'$like':'%'+_0x552b50['query'][_0x787d('0x3d')]+'%'};return _0x14f3f7;})});}_0x338a50=_[_0x787d('0x3e')]({},_0x338a50,_0x552b50[_0x787d('0x40')]);return _0x24bc0f[_0x787d('0x4b')](_0x338a50);}})[_0x787d('0x28')](function(_0x14095b){if(_0x14095b){_0x51bad1=_0x14095b[_0x787d('0x38')];if(!_0x552b50['query'][_0x787d('0x4c')](_0x787d('0x39'))){_0x338a50['limit']=qs['limit'](_0x552b50[_0x787d('0x34')][_0x787d('0x21')]);_0x338a50['offset']=qs[_0x787d('0x1f')](_0x552b50['query'][_0x787d('0x1f')]);}return _0x24bc0f[_0x787d('0x4b')](_0x338a50);}})[_0x787d('0x28')](function(_0x144370){if(_0x144370){return _0x144370?{'count':_0x51bad1,'rows':_0x144370}:null;}})['then'](respondWithResult(_0x4e4834,null))[_0x787d('0x43')](handleError(_0x4e4834,null));};exports[_0x787d('0x4d')]=function(_0x37c6db,_0x42616f,_0x235a73){if(_0x37c6db[_0x787d('0x47')]['id']){delete _0x37c6db['body']['id'];}return db[_0x787d('0x2e')][_0x787d('0x48')]({'where':{'id':_0x37c6db[_0x787d('0x44')]['id']}})[_0x787d('0x28')](handleEntityNotFound(_0x42616f,null))['then'](function(_0x5b1a1d){if(_0x5b1a1d){_0x37c6db[_0x787d('0x47')][_0x787d('0x4e')]=_0x5b1a1d['id'];_0x37c6db[_0x787d('0x47')]['Subjects']=integrations[_0x787d('0x4f')](_0x37c6db[_0x787d('0x47')][_0x787d('0x50')],_0x37c6db['body'][_0x787d('0x31')]);_0x37c6db[_0x787d('0x47')][_0x787d('0x51')]=integrations['getDescriptions'](_0x37c6db['body'][_0x787d('0x50')],_0x37c6db[_0x787d('0x47')][_0x787d('0x31')]);return db[_0x787d('0x52')][_0x787d('0x46')](_0x37c6db['body'],{'include':[{'model':db[_0x787d('0x53')],'as':_0x787d('0x54')},{'model':db[_0x787d('0x53')],'as':_0x787d('0x51')}]});}return null;})[_0x787d('0x28')](respondWithResult(_0x42616f,null))[_0x787d('0x43')](handleError(_0x42616f,null));};exports[_0x787d('0x55')]=function(_0x1d3d51,_0x313dd9,_0x32d716){var _0xaf6ecd='';var _0x255cde='';return db[_0x787d('0x2e')][_0x787d('0x48')]({'where':{'id':_0x1d3d51[_0x787d('0x44')]['id']},'attributes':['id',_0x787d('0x56'),_0x787d('0x57'),_0x787d('0x58')]})[_0x787d('0x28')](handleEntityNotFound(_0x313dd9,null))[_0x787d('0x28')](function(_0x46bcee){if(_0x46bcee){_0x255cde=_0x46bcee[_0x787d('0x56')];_0xaf6ecd=_0x46bcee[_0x787d('0x57')];var _0x10b038=_0x46bcee[_0x787d('0x57')][_0x787d('0x59')](-0x1);if(_0x10b038==='/'){_0xaf6ecd=_0xaf6ecd[_0x787d('0x5a')](0x0,_0xaf6ecd[_0x787d('0x5b')](_0x10b038));}return rp({'method':_0x787d('0x5c'),'uri':util[_0x787d('0x5d')]('%s%s',_0xaf6ecd,_0x787d('0x5e')),'headers':{'Authorization':_0x787d('0x5f')+_0x46bcee['apiKey']},'json':!![]});}})[_0x787d('0x28')](function(_0x1bfedb){if(_0x1bfedb){var _0x4401fa=_0x1bfedb['users'];var _0x463c18=![];var _0x158d26=null;for(_0x158d26=0x0;_0x158d26<_0x4401fa['length'];_0x158d26++){if(_0x4401fa[_0x158d26][_0x787d('0x60')]===_0x255cde){_0x463c18=!![];}}if(_0x463c18){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x787d('0x61')});}}})[_0x787d('0x28')](respondWithResult(_0x313dd9,null))[_0x787d('0x43')](function(_0x5d5566){var _0x40bb7a=_0x1d3d51[_0x787d('0x34')]['test']?0x1f4:_0x5d5566[_0x787d('0x62')]||0x1f4;logger['error'](_0x787d('0x63'),_0x787d('0x55'),_0x40bb7a,JSON[_0x787d('0x64')](_0x5d5566));delete _0x5d5566[_0x787d('0x2b')];if(_0x40bb7a===0x191){_0x40bb7a=0x190;}_0x313dd9[_0x787d('0x1c')](_0x40bb7a)[_0x787d('0x65')](_0x1d3d51[_0x787d('0x34')][_0x787d('0x66')]?{'message':_0x787d('0x67'),'statusCode':_0x5d5566[_0x787d('0x62')]}:_0x5d5566);});};
\ No newline at end of file
index 572b619..62b9666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x1fb4ff,_0x172d25){var _0x3f2d20=function(_0x358d44){while(--_0x358d44){_0x1fb4ff['push'](_0x1fb4ff['shift']());}};_0x3f2d20(++_0x172d25);}(_0xdb28,0x106));var _0x8db2=function(_0x339e12,_0x18b349){_0x339e12=_0x339e12-0x0;var _0x111355=_0xdb28[_0x339e12];return _0x111355;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x8db2('0x9'));module[_0x8db2('0xa')]=function(_0x5f42ee,_0x494b40){return _0x5f42ee[_0x8db2('0xb')](_0x8db2('0xc'),attributes,{'tableName':_0x8db2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66fa=['exports','define','FreshsalesAccount','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3962a3,_0x4a3813){var _0x5b5093=function(_0x1e011c){while(--_0x1e011c){_0x3962a3['push'](_0x3962a3['shift']());}};_0x5b5093(++_0x4a3813);}(_0x66fa,0x117));var _0xa66f=function(_0x4604e2,_0x4b9c){_0x4604e2=_0x4604e2-0x0;var _0x23b0f8=_0x66fa[_0x4604e2];return _0x23b0f8;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa66f('0x9')]=function(_0x20a150,_0x2f0b78){return _0x20a150[_0xa66f('0xa')](_0xa66f('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 29e4773..4cc7779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['find','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x25e7,0x1d6));var _0x725e=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x25e7[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});}exports[_0x725e('0x16')]=function(_0x397e33){var _0x268438=this;return new Promise(function(_0x2811e7,_0x528e7d){return db[_0x725e('0x17')][_0x725e('0x18')]({'raw':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1a')]===undefined?!![]:![]:!![],'where':_0x397e33[_0x725e('0x19')]?_0x397e33['options'][_0x725e('0x1b')]||null:null,'attributes':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1c')]||null:null,'limit':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1d')]||null:null,'include':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')]['include']?_[_0x725e('0x1e')](_0x397e33[_0x725e('0x19')][_0x725e('0x1f')],function(_0x3facae){return{'model':db[_0x3facae['model']],'as':_0x3facae['as'],'attributes':_0x3facae[_0x725e('0x1c')],'include':_0x3facae['include']?_['map'](_0x3facae['include'],function(_0x2aad7b){return{'model':db[_0x2aad7b[_0x725e('0x20')]],'as':_0x2aad7b['as'],'attributes':_0x2aad7b[_0x725e('0x1c')],'include':_0x2aad7b['include']?_[_0x725e('0x1e')](_0x2aad7b[_0x725e('0x1f')],function(_0x5a5bef){return{'model':db[_0x5a5bef[_0x725e('0x20')]],'as':_0x5a5bef['as'],'attributes':_0x5a5bef[_0x725e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x378ace){logger['info']('GetFreshsalesAccount',_0x397e33);logger[_0x725e('0x10')]('GetFreshsalesAccount',_0x397e33,JSON[_0x725e('0x21')](_0x378ace));_0x2811e7(_0x378ace);})['catch'](function(_0x4de2e0){logger[_0x725e('0x12')](_0x725e('0x16'),_0x4de2e0[_0x725e('0x13')],_0x397e33);_0x528e7d(_0x268438['error'](0x1f4,_0x4de2e0[_0x725e('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x85d29c){var _0x1ce9c8=this;return new Promise(function(_0x39932f,_0x28951f){return db[_0x725e('0x17')][_0x725e('0x22')]({'raw':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')][_0x725e('0x1a')]===undefined?!![]:![]:!![],'where':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')]['where']||null:null,'attributes':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')]['attributes']||null:null,'include':_0x85d29c[_0x725e('0x19')]?_0x85d29c['options'][_0x725e('0x1f')]?_['map'](_0x85d29c[_0x725e('0x19')][_0x725e('0x1f')],function(_0x1f2898){return{'model':db[_0x1f2898[_0x725e('0x20')]],'as':_0x1f2898['as'],'attributes':_0x1f2898[_0x725e('0x1c')],'include':_0x1f2898[_0x725e('0x1f')]?_['map'](_0x1f2898['include'],function(_0x35e5e7){return{'model':db[_0x35e5e7[_0x725e('0x20')]],'as':_0x35e5e7['as'],'attributes':_0x35e5e7[_0x725e('0x1c')],'include':_0x35e5e7['include']?_[_0x725e('0x1e')](_0x35e5e7['include'],function(_0x3ce327){return{'model':db[_0x3ce327[_0x725e('0x20')]],'as':_0x3ce327['as'],'attributes':_0x3ce327[_0x725e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x725e('0xc')](function(_0x4f15f3){logger['info'](_0x725e('0x23'),_0x85d29c);logger[_0x725e('0x10')](_0x725e('0x23'),_0x85d29c,JSON['stringify'](_0x4f15f3));_0x39932f(_0x4f15f3);})[_0x725e('0x15')](function(_0xec3b9d){logger[_0x725e('0x12')]('ShowFreshsalesAccount',_0xec3b9d[_0x725e('0x13')],_0x85d29c);_0x28951f(_0x1ce9c8['error'](0x1f4,_0xec3b9d[_0x725e('0x13')]));});});};
\ No newline at end of file
+var _0x3e24=['limit','map','include','model','debug','stringify','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','options','where','attributes'];(function(_0x57c4b3,_0x4064ab){var _0x212421=function(_0x2825a4){while(--_0x2825a4){_0x57c4b3['push'](_0x57c4b3['shift']());}};_0x212421(++_0x4064ab);}(_0x3e24,0x167));var _0x43e2=function(_0x468a75,_0xd34746){_0x468a75=_0x468a75-0x0;var _0x1cf284=_0x3e24[_0x468a75];return _0x1cf284;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});}exports[_0x43e2('0x15')]=function(_0x1b7cde){var _0x3ea010=this;return new Promise(function(_0x15ecb5,_0x3236b9){return db[_0x43e2('0x16')]['findAll']({'raw':_0x1b7cde[_0x43e2('0x17')]?_0x1b7cde[_0x43e2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1b7cde[_0x43e2('0x17')]?_0x1b7cde['options'][_0x43e2('0x18')]||null:null,'attributes':_0x1b7cde[_0x43e2('0x17')]?_0x1b7cde[_0x43e2('0x17')][_0x43e2('0x19')]||null:null,'limit':_0x1b7cde[_0x43e2('0x17')]?_0x1b7cde['options'][_0x43e2('0x1a')]||null:null,'include':_0x1b7cde[_0x43e2('0x17')]?_0x1b7cde[_0x43e2('0x17')]['include']?_[_0x43e2('0x1b')](_0x1b7cde[_0x43e2('0x17')][_0x43e2('0x1c')],function(_0x11b285){return{'model':db[_0x11b285['model']],'as':_0x11b285['as'],'attributes':_0x11b285[_0x43e2('0x19')],'include':_0x11b285[_0x43e2('0x1c')]?_[_0x43e2('0x1b')](_0x11b285[_0x43e2('0x1c')],function(_0x178223){return{'model':db[_0x178223[_0x43e2('0x1d')]],'as':_0x178223['as'],'attributes':_0x178223[_0x43e2('0x19')],'include':_0x178223[_0x43e2('0x1c')]?_[_0x43e2('0x1b')](_0x178223[_0x43e2('0x1c')],function(_0x1ea844){return{'model':db[_0x1ea844[_0x43e2('0x1d')]],'as':_0x1ea844['as'],'attributes':_0x1ea844['attributes']};}):[]};}):[]};}):[]:[]})[_0x43e2('0xc')](function(_0x2f2bd8){logger['info'](_0x43e2('0x15'),_0x1b7cde);logger[_0x43e2('0x1e')](_0x43e2('0x15'),_0x1b7cde,JSON[_0x43e2('0x1f')](_0x2f2bd8));_0x15ecb5(_0x2f2bd8);})[_0x43e2('0x14')](function(_0x5a896b){logger[_0x43e2('0x10')](_0x43e2('0x15'),_0x5a896b[_0x43e2('0x12')],_0x1b7cde);_0x3236b9(_0x3ea010[_0x43e2('0x10')](0x1f4,_0x5a896b[_0x43e2('0x12')]));});});};exports[_0x43e2('0x20')]=function(_0x53f797){var _0x51226b=this;return new Promise(function(_0xe09322,_0x1dcbc8){return db[_0x43e2('0x16')][_0x43e2('0x21')]({'raw':_0x53f797[_0x43e2('0x17')]?_0x53f797['options'][_0x43e2('0x22')]===undefined?!![]:![]:!![],'where':_0x53f797[_0x43e2('0x17')]?_0x53f797[_0x43e2('0x17')][_0x43e2('0x18')]||null:null,'attributes':_0x53f797[_0x43e2('0x17')]?_0x53f797[_0x43e2('0x17')][_0x43e2('0x19')]||null:null,'include':_0x53f797['options']?_0x53f797['options'][_0x43e2('0x1c')]?_[_0x43e2('0x1b')](_0x53f797['options'][_0x43e2('0x1c')],function(_0x34effb){return{'model':db[_0x34effb['model']],'as':_0x34effb['as'],'attributes':_0x34effb[_0x43e2('0x19')],'include':_0x34effb['include']?_['map'](_0x34effb['include'],function(_0x2bb489){return{'model':db[_0x2bb489['model']],'as':_0x2bb489['as'],'attributes':_0x2bb489[_0x43e2('0x19')],'include':_0x2bb489[_0x43e2('0x1c')]?_[_0x43e2('0x1b')](_0x2bb489[_0x43e2('0x1c')],function(_0x44670b){return{'model':db[_0x44670b[_0x43e2('0x1d')]],'as':_0x44670b['as'],'attributes':_0x44670b[_0x43e2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x43e2('0xc')](function(_0x1e9be1){logger[_0x43e2('0x13')](_0x43e2('0x20'),_0x53f797);logger[_0x43e2('0x1e')](_0x43e2('0x20'),_0x53f797,JSON[_0x43e2('0x1f')](_0x1e9be1));_0xe09322(_0x1e9be1);})[_0x43e2('0x14')](function(_0x40b39b){logger[_0x43e2('0x10')]('ShowFreshsalesAccount',_0x40b39b['message'],_0x53f797);_0x1dcbc8(_0x51226b['error'](0x1f4,_0x40b39b[_0x43e2('0x12')]));});});};
\ No newline at end of file
index 78b6422..4f4451f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe1a=['isAuthenticated','index','/:id/subjects','getSubjects','/:id/fields','getFields','post','create','/:id','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get'];(function(_0x50f902,_0x364a83){var _0x500d92=function(_0x103965){while(--_0x103965){_0x50f902['push'](_0x50f902['shift']());}};_0x500d92(++_0x364a83);}(_0xfe1a,0x9f));var _0xafe1=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xfe1a[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require(_0xafe1('0x0'));var path=require(_0xafe1('0x1'));var timeout=require('connect-timeout');var express=require(_0xafe1('0x2'));var router=express[_0xafe1('0x3')]();var fs_extra=require(_0xafe1('0x4'));var auth=require(_0xafe1('0x5'));var interaction=require(_0xafe1('0x6'));var config=require('../../config/environment');var controller=require(_0xafe1('0x7'));router[_0xafe1('0x8')]('/',auth[_0xafe1('0x9')](),controller[_0xafe1('0xa')]);router[_0xafe1('0x8')]('/:id',auth[_0xafe1('0x9')](),controller['show']);router[_0xafe1('0x8')](_0xafe1('0xb'),auth['isAuthenticated'](),controller[_0xafe1('0xc')]);router['get']('/:id/descriptions',auth[_0xafe1('0x9')](),controller['getDescriptions']);router[_0xafe1('0x8')](_0xafe1('0xd'),auth[_0xafe1('0x9')](),controller[_0xafe1('0xe')]);router[_0xafe1('0xf')]('/',auth[_0xafe1('0x9')](),controller[_0xafe1('0x10')]);router['put'](_0xafe1('0x11'),auth[_0xafe1('0x9')](),controller[_0xafe1('0x12')]);router[_0xafe1('0x13')](_0xafe1('0x11'),auth[_0xafe1('0x9')](),controller['destroy']);module[_0xafe1('0x14')]=router;
\ No newline at end of file
+var _0x5e6e=['../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','show','getSubjects','/:id/descriptions','/:id/fields','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xfa874a,_0x990e70){var _0x3ffce4=function(_0x583540){while(--_0x583540){_0xfa874a['push'](_0xfa874a['shift']());}};_0x3ffce4(++_0x990e70);}(_0x5e6e,0x16e));var _0xe5e6=function(_0x1fbe0a,_0x17224f){_0x1fbe0a=_0x1fbe0a-0x0;var _0x5a09bd=_0x5e6e[_0x1fbe0a];return _0x5a09bd;};'use strict';var multer=require(_0xe5e6('0x0'));var util=require(_0xe5e6('0x1'));var path=require(_0xe5e6('0x2'));var timeout=require(_0xe5e6('0x3'));var express=require('express');var router=express[_0xe5e6('0x4')]();var fs_extra=require(_0xe5e6('0x5'));var auth=require(_0xe5e6('0x6'));var interaction=require(_0xe5e6('0x7'));var config=require(_0xe5e6('0x8'));var controller=require(_0xe5e6('0x9'));router['get']('/',auth[_0xe5e6('0xa')](),controller[_0xe5e6('0xb')]);router[_0xe5e6('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xe5e6('0xd')]);router[_0xe5e6('0xc')]('/:id/subjects',auth[_0xe5e6('0xa')](),controller[_0xe5e6('0xe')]);router[_0xe5e6('0xc')](_0xe5e6('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0xe5e6('0x10'),auth[_0xe5e6('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe5e6('0x11')](_0xe5e6('0x12'),auth[_0xe5e6('0xa')](),controller[_0xe5e6('0x13')]);router[_0xe5e6('0x14')]('/:id',auth[_0xe5e6('0xa')](),controller['destroy']);module[_0xe5e6('0x15')]=router;
\ No newline at end of file
index 774b7e9..504726d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0953=['sequelize','exports','STRING'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0953,0xf6));var _0x3095=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x0953[_0x3a9661];return _0x5bb119;};'use strict';var Sequelize=require(_0x3095('0x0'));module[_0x3095('0x1')]={'name':{'type':Sequelize[_0x3095('0x2')]},'description':{'type':Sequelize[_0x3095('0x2')]}};
\ No newline at end of file
+var _0x185a=['STRING','exports'];(function(_0x3e25a3,_0x235d19){var _0x548435=function(_0x11cf88){while(--_0x11cf88){_0x3e25a3['push'](_0x3e25a3['shift']());}};_0x548435(++_0x235d19);}(_0x185a,0x8f));var _0xa185=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x185a[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xa185('0x0')]={'name':{'type':Sequelize[_0xa185('0x1')]},'description':{'type':Sequelize[_0xa185('0x1')]}};
\ No newline at end of file
index a19992c..c4bfe44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddb6=['body','params','getSubjects','findOne','FreshsalesField','order','pick','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','type','VIRTUAL','options','include','FreshsalesConfiguration','findAll','rows','catch','show','rawAttributes','length','find','create'];(function(_0x471f5f,_0x451986){var _0x3d8fa0=function(_0x5b5453){while(--_0x5b5453){_0x471f5f['push'](_0x471f5f['shift']());}};_0x3d8fa0(++_0x451986);}(_0xddb6,0xab));var _0x6ddb=function(_0x539079,_0x1899ed){_0x539079=_0x539079-0x0;var _0x46de67=_0xddb6[_0x539079];return _0x46de67;};'use strict';var emlformat=require(_0x6ddb('0x0'));var rimraf=require(_0x6ddb('0x1'));var zipdir=require(_0x6ddb('0x2'));var jsonpatch=require(_0x6ddb('0x3'));var rp=require('request-promise');var moment=require(_0x6ddb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6ddb('0x5'));var sox=require(_0x6ddb('0x6'));var csv=require('to-csv');var ejs=require(_0x6ddb('0x7'));var fs=require('fs');var fs_extra=require(_0x6ddb('0x8'));var _=require(_0x6ddb('0x9'));var squel=require(_0x6ddb('0xa'));var crypto=require(_0x6ddb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6ddb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6ddb('0xd'));var Papa=require('papaparse');var Redis=require(_0x6ddb('0xe'));var authService=require(_0x6ddb('0xf'));var qs=require(_0x6ddb('0x10'));var as=require(_0x6ddb('0x11'));var hardwareService=require(_0x6ddb('0x12'));var logger=require(_0x6ddb('0x13'))(_0x6ddb('0x14'));var utils=require('../../config/utils');var config=require(_0x6ddb('0x15'));var licenseUtil=require(_0x6ddb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4905a7,_0x1539d2){_0x1539d2=_0x1539d2||0xcc;return function(_0x25a88e){if(_0x25a88e){return _0x4905a7[_0x6ddb('0x17')](_0x1539d2);}return _0x4905a7['status'](_0x1539d2)[_0x6ddb('0x18')]();};}function respondWithResult(_0x1305cd,_0x3ffece){_0x3ffece=_0x3ffece||0xc8;return function(_0x22545f){if(_0x22545f){return _0x1305cd[_0x6ddb('0x19')](_0x3ffece)[_0x6ddb('0x1a')](_0x22545f);}};}function respondWithFilteredResult(_0x48bff9,_0x28a5ef){return function(_0x297897){if(_0x297897){var _0x12615c=typeof _0x28a5ef[_0x6ddb('0x1b')]===_0x6ddb('0x1c')&&typeof _0x28a5ef[_0x6ddb('0x1d')]===_0x6ddb('0x1c');var _0x4056e0=_0x297897[_0x6ddb('0x1e')];var _0x4e0520=_0x12615c?0x0:_0x28a5ef['offset'];var _0x4aa131=_0x12615c?_0x297897[_0x6ddb('0x1e')]:_0x28a5ef[_0x6ddb('0x1b')]+_0x28a5ef['limit'];var _0x408086;if(_0x4aa131>=_0x4056e0){_0x4aa131=_0x4056e0;_0x408086=0xc8;}else{_0x408086=0xce;}_0x48bff9[_0x6ddb('0x19')](_0x408086);return _0x48bff9[_0x6ddb('0x1f')](_0x6ddb('0x20'),_0x4e0520+'-'+_0x4aa131+'/'+_0x4056e0)[_0x6ddb('0x1a')](_0x297897);}return null;};}function patchUpdates(_0x60cd48){return function(_0x3dea74){try{jsonpatch[_0x6ddb('0x21')](_0x3dea74,_0x60cd48,!![]);}catch(_0x36f182){return BPromise['reject'](_0x36f182);}return _0x3dea74[_0x6ddb('0x22')]();};}function saveUpdates(_0x397aaa,_0x5257ca){return function(_0x2e95d8){if(_0x2e95d8){return _0x2e95d8[_0x6ddb('0x23')](_0x397aaa)[_0x6ddb('0x24')](function(_0x27e9fc){return _0x27e9fc;});}return null;};}function removeEntity(_0x460cad,_0x304ecf){return function(_0x4f3a8b){if(_0x4f3a8b){return _0x4f3a8b[_0x6ddb('0x25')]()[_0x6ddb('0x24')](function(){_0x460cad[_0x6ddb('0x19')](0xcc)[_0x6ddb('0x18')]();});}};}function handleEntityNotFound(_0xbfdddb,_0xb1e0f3){return function(_0x1896d3){if(!_0x1896d3){_0xbfdddb[_0x6ddb('0x17')](0x194);}return _0x1896d3;};}function handleError(_0x3af68e,_0x45baec){_0x45baec=_0x45baec||0x1f4;return function(_0x97f1e1){logger[_0x6ddb('0x26')](_0x97f1e1[_0x6ddb('0x27')]);if(_0x97f1e1['name']){delete _0x97f1e1[_0x6ddb('0x28')];}_0x3af68e[_0x6ddb('0x19')](_0x45baec)[_0x6ddb('0x29')](_0x97f1e1);};}exports[_0x6ddb('0x2a')]=function(_0x20273d,_0x26990f){var _0x2d022e={},_0x4d61c6={},_0x5858d2={'count':0x0,'rows':[]};var _0x46e3ee=_[_0x6ddb('0x2b')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x139a79){return{'name':_0x139a79[_0x6ddb('0x2c')],'type':_0x139a79['type'][_0x6ddb('0x2d')]};});_0x4d61c6['model']=_[_0x6ddb('0x2b')](_0x46e3ee,_0x6ddb('0x28'));_0x4d61c6[_0x6ddb('0x2e')]=_[_0x6ddb('0x2f')](_0x20273d[_0x6ddb('0x2e')]);_0x4d61c6['filters']=_['intersection'](_0x4d61c6[_0x6ddb('0x30')],_0x4d61c6['query']);_0x2d022e[_0x6ddb('0x31')]=_[_0x6ddb('0x32')](_0x4d61c6[_0x6ddb('0x30')],qs['fields'](_0x20273d['query'][_0x6ddb('0x33')]));_0x2d022e[_0x6ddb('0x31')]=_0x2d022e[_0x6ddb('0x31')]['length']?_0x2d022e['attributes']:_0x4d61c6[_0x6ddb('0x30')];if(!_0x20273d['query'][_0x6ddb('0x34')](_0x6ddb('0x35'))){_0x2d022e[_0x6ddb('0x1d')]=qs[_0x6ddb('0x1d')](_0x20273d[_0x6ddb('0x2e')][_0x6ddb('0x1d')]);_0x2d022e[_0x6ddb('0x1b')]=qs[_0x6ddb('0x1b')](_0x20273d[_0x6ddb('0x2e')][_0x6ddb('0x1b')]);}_0x2d022e['order']=qs['sort'](_0x20273d[_0x6ddb('0x2e')][_0x6ddb('0x36')]);_0x2d022e['where']=qs[_0x6ddb('0x37')](_['pick'](_0x20273d[_0x6ddb('0x2e')],_0x4d61c6[_0x6ddb('0x37')]),_0x46e3ee);if(_0x20273d[_0x6ddb('0x2e')][_0x6ddb('0x38')]){_0x2d022e[_0x6ddb('0x39')]=_[_0x6ddb('0x3a')](_0x2d022e[_0x6ddb('0x39')],{'$or':_[_0x6ddb('0x2b')](_0x46e3ee,function(_0x4b7b29){if(_0x4b7b29[_0x6ddb('0x3b')]!==_0x6ddb('0x3c')){var _0x23ae13={};_0x23ae13[_0x4b7b29['name']]={'$like':'%'+_0x20273d[_0x6ddb('0x2e')][_0x6ddb('0x38')]+'%'};return _0x23ae13;}})});}_0x2d022e=_[_0x6ddb('0x3a')]({},_0x2d022e,_0x20273d[_0x6ddb('0x3d')]);var _0x54d137={'where':_0x2d022e[_0x6ddb('0x39')]};return db['FreshsalesConfiguration']['count'](_0x54d137)[_0x6ddb('0x24')](function(_0x520b1a){_0x5858d2['count']=_0x520b1a;if(_0x20273d[_0x6ddb('0x2e')]['includeAll']){_0x2d022e[_0x6ddb('0x3e')]=[{'all':!![]}];}return db[_0x6ddb('0x3f')][_0x6ddb('0x40')](_0x2d022e);})[_0x6ddb('0x24')](function(_0x1b91fe){_0x5858d2[_0x6ddb('0x41')]=_0x1b91fe;return _0x5858d2;})[_0x6ddb('0x24')](respondWithFilteredResult(_0x26990f,_0x2d022e))[_0x6ddb('0x42')](handleError(_0x26990f,null));};exports[_0x6ddb('0x43')]=function(_0x1b9d52,_0x1c0e06){var _0x27fdb0={'raw':![],'where':{'id':_0x1b9d52['params']['id']}},_0x37e61a={};_0x37e61a[_0x6ddb('0x30')]=_[_0x6ddb('0x2f')](db['FreshsalesConfiguration'][_0x6ddb('0x44')]);_0x37e61a[_0x6ddb('0x2e')]=_[_0x6ddb('0x2f')](_0x1b9d52[_0x6ddb('0x2e')]);_0x37e61a['filters']=_[_0x6ddb('0x32')](_0x37e61a[_0x6ddb('0x30')],_0x37e61a['query']);_0x27fdb0[_0x6ddb('0x31')]=_[_0x6ddb('0x32')](_0x37e61a['model'],qs[_0x6ddb('0x33')](_0x1b9d52[_0x6ddb('0x2e')]['fields']));_0x27fdb0[_0x6ddb('0x31')]=_0x27fdb0[_0x6ddb('0x31')][_0x6ddb('0x45')]?_0x27fdb0[_0x6ddb('0x31')]:_0x37e61a['model'];if(_0x1b9d52['query']['includeAll']){_0x27fdb0[_0x6ddb('0x3e')]=[{'all':!![]}];}_0x27fdb0=_[_0x6ddb('0x3a')]({},_0x27fdb0,_0x1b9d52[_0x6ddb('0x3d')]);return db['FreshsalesConfiguration'][_0x6ddb('0x46')](_0x27fdb0)[_0x6ddb('0x24')](handleEntityNotFound(_0x1c0e06,null))['then'](respondWithResult(_0x1c0e06,null))['catch'](handleError(_0x1c0e06,null));};exports['create']=function(_0x841039,_0x5e44ee){return db['FreshsalesConfiguration'][_0x6ddb('0x47')](_0x841039['body'],{})[_0x6ddb('0x24')](respondWithResult(_0x5e44ee,0xc9))['catch'](handleError(_0x5e44ee,null));};exports[_0x6ddb('0x23')]=function(_0x26c03d,_0x54aae1){if(_0x26c03d[_0x6ddb('0x48')]['id']){delete _0x26c03d[_0x6ddb('0x48')]['id'];}return db[_0x6ddb('0x3f')][_0x6ddb('0x46')]({'where':{'id':_0x26c03d['params']['id']}})[_0x6ddb('0x24')](handleEntityNotFound(_0x54aae1,null))[_0x6ddb('0x24')](saveUpdates(_0x26c03d[_0x6ddb('0x48')],null))[_0x6ddb('0x24')](respondWithResult(_0x54aae1,null))[_0x6ddb('0x42')](handleError(_0x54aae1,null));};exports[_0x6ddb('0x25')]=function(_0x1adc86,_0x3ba763){return db['FreshsalesConfiguration'][_0x6ddb('0x46')]({'where':{'id':_0x1adc86[_0x6ddb('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ba763,null))['then'](removeEntity(_0x3ba763,null))[_0x6ddb('0x42')](handleError(_0x3ba763,null));};exports[_0x6ddb('0x4a')]=function(_0xdf3425,_0x4c8f64,_0x148837){var _0x353b31={};var _0x297437={};var _0x457bdf;var _0x10f643;return db[_0x6ddb('0x3f')][_0x6ddb('0x4b')]({'where':{'id':_0xdf3425[_0x6ddb('0x49')]['id']}})[_0x6ddb('0x24')](handleEntityNotFound(_0x4c8f64,null))[_0x6ddb('0x24')](function(_0x274ba8){if(_0x274ba8){_0x457bdf=_0x274ba8;_0x297437['model']=_[_0x6ddb('0x2f')](db[_0x6ddb('0x4c')]['rawAttributes']);_0x297437[_0x6ddb('0x2e')]=_['keys'](_0xdf3425['query']);_0x297437[_0x6ddb('0x37')]=_['intersection'](_0x297437[_0x6ddb('0x30')],_0x297437[_0x6ddb('0x2e')]);_0x353b31[_0x6ddb('0x31')]=_[_0x6ddb('0x32')](_0x297437[_0x6ddb('0x30')],qs['fields'](_0xdf3425[_0x6ddb('0x2e')][_0x6ddb('0x33')]));_0x353b31[_0x6ddb('0x31')]=_0x353b31[_0x6ddb('0x31')][_0x6ddb('0x45')]?_0x353b31['attributes']:_0x297437[_0x6ddb('0x30')];_0x353b31[_0x6ddb('0x4d')]=qs['sort'](_0xdf3425[_0x6ddb('0x2e')][_0x6ddb('0x36')]);_0x353b31[_0x6ddb('0x39')]=qs[_0x6ddb('0x37')](_[_0x6ddb('0x4e')](_0xdf3425[_0x6ddb('0x2e')],_0x297437[_0x6ddb('0x37')]));if(_0xdf3425['query'][_0x6ddb('0x38')]){_0x353b31['where']=_['merge'](_0x353b31[_0x6ddb('0x39')],{'$or':_['map'](_0x353b31['attributes'],function(_0x3a0d5d){var _0x33ba3c={};_0x33ba3c[_0x3a0d5d]={'$like':'%'+_0xdf3425[_0x6ddb('0x2e')][_0x6ddb('0x38')]+'%'};return _0x33ba3c;})});}_0x353b31=_[_0x6ddb('0x3a')]({},_0x353b31,_0xdf3425[_0x6ddb('0x3d')]);return _0x457bdf[_0x6ddb('0x4a')](_0x353b31);}})['then'](function(_0x20a69c){if(_0x20a69c){_0x10f643=_0x20a69c[_0x6ddb('0x45')];if(!_0xdf3425['query'][_0x6ddb('0x34')](_0x6ddb('0x35'))){_0x353b31[_0x6ddb('0x1d')]=qs['limit'](_0xdf3425[_0x6ddb('0x2e')][_0x6ddb('0x1d')]);_0x353b31[_0x6ddb('0x1b')]=qs[_0x6ddb('0x1b')](_0xdf3425[_0x6ddb('0x2e')]['offset']);}return _0x457bdf[_0x6ddb('0x4a')](_0x353b31);}})[_0x6ddb('0x24')](function(_0x5db5b3){if(_0x5db5b3){return _0x5db5b3?{'count':_0x10f643,'rows':_0x5db5b3}:null;}})['then'](respondWithResult(_0x4c8f64,null))[_0x6ddb('0x42')](handleError(_0x4c8f64,null));};exports[_0x6ddb('0x4f')]=function(_0x75f9f,_0x559499,_0x5f330a){var _0x797fc6={};var _0x34f6d3={};var _0x11b97f;var _0x58181c;return db[_0x6ddb('0x3f')][_0x6ddb('0x4b')]({'where':{'id':_0x75f9f[_0x6ddb('0x49')]['id']}})['then'](handleEntityNotFound(_0x559499,null))[_0x6ddb('0x24')](function(_0x2fa1a6){if(_0x2fa1a6){_0x11b97f=_0x2fa1a6;_0x34f6d3[_0x6ddb('0x30')]=_[_0x6ddb('0x2f')](db['FreshsalesField'][_0x6ddb('0x44')]);_0x34f6d3['query']=_['keys'](_0x75f9f[_0x6ddb('0x2e')]);_0x34f6d3[_0x6ddb('0x37')]=_['intersection'](_0x34f6d3[_0x6ddb('0x30')],_0x34f6d3[_0x6ddb('0x2e')]);_0x797fc6[_0x6ddb('0x31')]=_[_0x6ddb('0x32')](_0x34f6d3[_0x6ddb('0x30')],qs['fields'](_0x75f9f['query'][_0x6ddb('0x33')]));_0x797fc6[_0x6ddb('0x31')]=_0x797fc6[_0x6ddb('0x31')][_0x6ddb('0x45')]?_0x797fc6['attributes']:_0x34f6d3[_0x6ddb('0x30')];_0x797fc6['order']=qs[_0x6ddb('0x36')](_0x75f9f[_0x6ddb('0x2e')]['sort']);_0x797fc6['where']=qs[_0x6ddb('0x37')](_['pick'](_0x75f9f[_0x6ddb('0x2e')],_0x34f6d3[_0x6ddb('0x37')]));if(_0x75f9f[_0x6ddb('0x2e')][_0x6ddb('0x38')]){_0x797fc6[_0x6ddb('0x39')]=_['merge'](_0x797fc6[_0x6ddb('0x39')],{'$or':_[_0x6ddb('0x2b')](_0x797fc6['attributes'],function(_0x3569da){var _0xa5a514={};_0xa5a514[_0x3569da]={'$like':'%'+_0x75f9f[_0x6ddb('0x2e')]['filter']+'%'};return _0xa5a514;})});}_0x797fc6=_[_0x6ddb('0x3a')]({},_0x797fc6,_0x75f9f['options']);return _0x11b97f[_0x6ddb('0x4f')](_0x797fc6);}})[_0x6ddb('0x24')](function(_0x16e69b){if(_0x16e69b){_0x58181c=_0x16e69b[_0x6ddb('0x45')];if(!_0x75f9f[_0x6ddb('0x2e')][_0x6ddb('0x34')](_0x6ddb('0x35'))){_0x797fc6[_0x6ddb('0x1d')]=qs[_0x6ddb('0x1d')](_0x75f9f['query'][_0x6ddb('0x1d')]);_0x797fc6[_0x6ddb('0x1b')]=qs[_0x6ddb('0x1b')](_0x75f9f['query'][_0x6ddb('0x1b')]);}return _0x11b97f[_0x6ddb('0x4f')](_0x797fc6);}})['then'](function(_0x3e937e){if(_0x3e937e){return _0x3e937e?{'count':_0x58181c,'rows':_0x3e937e}:null;}})['then'](respondWithResult(_0x559499,null))['catch'](handleError(_0x559499,null));};exports[_0x6ddb('0x50')]=function(_0x410597,_0x24e791,_0x49b2d9){var _0x325b3a={};var _0x2de929={};var _0xf07411;var _0x523f47;return db[_0x6ddb('0x3f')]['findOne']({'where':{'id':_0x410597['params']['id']}})[_0x6ddb('0x24')](handleEntityNotFound(_0x24e791,null))[_0x6ddb('0x24')](function(_0x2f3424){if(_0x2f3424){_0xf07411=_0x2f3424;_0x2de929[_0x6ddb('0x30')]=_[_0x6ddb('0x2f')](db[_0x6ddb('0x4c')][_0x6ddb('0x44')]);_0x2de929[_0x6ddb('0x2e')]=_[_0x6ddb('0x2f')](_0x410597[_0x6ddb('0x2e')]);_0x2de929['filters']=_[_0x6ddb('0x32')](_0x2de929[_0x6ddb('0x30')],_0x2de929[_0x6ddb('0x2e')]);_0x325b3a['attributes']=_[_0x6ddb('0x32')](_0x2de929[_0x6ddb('0x30')],qs['fields'](_0x410597[_0x6ddb('0x2e')]['fields']));_0x325b3a[_0x6ddb('0x31')]=_0x325b3a[_0x6ddb('0x31')][_0x6ddb('0x45')]?_0x325b3a[_0x6ddb('0x31')]:_0x2de929[_0x6ddb('0x30')];_0x325b3a[_0x6ddb('0x4d')]=qs[_0x6ddb('0x36')](_0x410597[_0x6ddb('0x2e')][_0x6ddb('0x36')]);_0x325b3a[_0x6ddb('0x39')]=qs[_0x6ddb('0x37')](_['pick'](_0x410597[_0x6ddb('0x2e')],_0x2de929['filters']));if(_0x410597[_0x6ddb('0x2e')][_0x6ddb('0x38')]){_0x325b3a[_0x6ddb('0x39')]=_[_0x6ddb('0x3a')](_0x325b3a[_0x6ddb('0x39')],{'$or':_[_0x6ddb('0x2b')](_0x325b3a[_0x6ddb('0x31')],function(_0x151491){var _0x4a348a={};_0x4a348a[_0x151491]={'$like':'%'+_0x410597[_0x6ddb('0x2e')][_0x6ddb('0x38')]+'%'};return _0x4a348a;})});}_0x325b3a=_[_0x6ddb('0x3a')]({},_0x325b3a,_0x410597[_0x6ddb('0x3d')]);return _0xf07411[_0x6ddb('0x50')](_0x325b3a);}})[_0x6ddb('0x24')](function(_0x52588d){if(_0x52588d){_0x523f47=_0x52588d[_0x6ddb('0x45')];if(!_0x410597[_0x6ddb('0x2e')][_0x6ddb('0x34')](_0x6ddb('0x35'))){_0x325b3a['limit']=qs[_0x6ddb('0x1d')](_0x410597[_0x6ddb('0x2e')][_0x6ddb('0x1d')]);_0x325b3a[_0x6ddb('0x1b')]=qs[_0x6ddb('0x1b')](_0x410597[_0x6ddb('0x2e')][_0x6ddb('0x1b')]);}return _0xf07411[_0x6ddb('0x50')](_0x325b3a);}})[_0x6ddb('0x24')](function(_0x2cace2){if(_0x2cace2){return _0x2cace2?{'count':_0x523f47,'rows':_0x2cace2}:null;}})[_0x6ddb('0x24')](respondWithResult(_0x24e791,null))[_0x6ddb('0x42')](handleError(_0x24e791,null));};
\ No newline at end of file
+var _0x7d3e=['VIRTUAL','options','FreshsalesConfiguration','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','create','body','update','find','FreshsalesField','merge','getSubjects','getDescriptions','findOne','getFields','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../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','apply','then','destroy','error','stack','name','send','index','map','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0x7d3e,0xfd));var _0xe7d3=function(_0x351453,_0x34718d){_0x351453=_0x351453-0x0;var _0x37be69=_0x7d3e[_0x351453];return _0x37be69;};'use strict';var emlformat=require(_0xe7d3('0x0'));var rimraf=require(_0xe7d3('0x1'));var zipdir=require(_0xe7d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7d3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe7d3('0x4'));var util=require(_0xe7d3('0x5'));var path=require(_0xe7d3('0x6'));var sox=require('sox');var csv=require(_0xe7d3('0x7'));var ejs=require(_0xe7d3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7d3('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe7d3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe7d3('0x7'));var querystring=require(_0xe7d3('0xb'));var Papa=require('papaparse');var Redis=require(_0xe7d3('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe7d3('0xd'));var hardwareService=require(_0xe7d3('0xe'));var logger=require(_0xe7d3('0xf'))(_0xe7d3('0x10'));var utils=require(_0xe7d3('0x11'));var config=require(_0xe7d3('0x12'));var licenseUtil=require(_0xe7d3('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4176f6,_0x36fa7e){_0x36fa7e=_0x36fa7e||0xcc;return function(_0x3cee6b){if(_0x3cee6b){return _0x4176f6[_0xe7d3('0x14')](_0x36fa7e);}return _0x4176f6[_0xe7d3('0x15')](_0x36fa7e)[_0xe7d3('0x16')]();};}function respondWithResult(_0x2bd773,_0x5598cd){_0x5598cd=_0x5598cd||0xc8;return function(_0x1d7c92){if(_0x1d7c92){return _0x2bd773['status'](_0x5598cd)[_0xe7d3('0x17')](_0x1d7c92);}};}function respondWithFilteredResult(_0x2ec063,_0x25f784){return function(_0x327198){if(_0x327198){var _0x4789dd=typeof _0x25f784[_0xe7d3('0x18')]===_0xe7d3('0x19')&&typeof _0x25f784[_0xe7d3('0x1a')]===_0xe7d3('0x19');var _0x4a83a7=_0x327198[_0xe7d3('0x1b')];var _0x3a2355=_0x4789dd?0x0:_0x25f784[_0xe7d3('0x18')];var _0x3925cb=_0x4789dd?_0x327198['count']:_0x25f784['offset']+_0x25f784[_0xe7d3('0x1a')];var _0x15a8b0;if(_0x3925cb>=_0x4a83a7){_0x3925cb=_0x4a83a7;_0x15a8b0=0xc8;}else{_0x15a8b0=0xce;}_0x2ec063[_0xe7d3('0x15')](_0x15a8b0);return _0x2ec063[_0xe7d3('0x1c')](_0xe7d3('0x1d'),_0x3a2355+'-'+_0x3925cb+'/'+_0x4a83a7)[_0xe7d3('0x17')](_0x327198);}return null;};}function patchUpdates(_0x4979f4){return function(_0x357d51){try{jsonpatch[_0xe7d3('0x1e')](_0x357d51,_0x4979f4,!![]);}catch(_0x142e28){return BPromise['reject'](_0x142e28);}return _0x357d51['save']();};}function saveUpdates(_0x301ef7,_0x291b40){return function(_0x88c470){if(_0x88c470){return _0x88c470['update'](_0x301ef7)[_0xe7d3('0x1f')](function(_0x1b494a){return _0x1b494a;});}return null;};}function removeEntity(_0x405d3f,_0xf540db){return function(_0x4de3cb){if(_0x4de3cb){return _0x4de3cb[_0xe7d3('0x20')]()[_0xe7d3('0x1f')](function(){_0x405d3f[_0xe7d3('0x15')](0xcc)[_0xe7d3('0x16')]();});}};}function handleEntityNotFound(_0x5e1cc8,_0x1ae105){return function(_0x45592a){if(!_0x45592a){_0x5e1cc8[_0xe7d3('0x14')](0x194);}return _0x45592a;};}function handleError(_0x5ef0d2,_0x2298ab){_0x2298ab=_0x2298ab||0x1f4;return function(_0x3b387f){logger[_0xe7d3('0x21')](_0x3b387f[_0xe7d3('0x22')]);if(_0x3b387f[_0xe7d3('0x23')]){delete _0x3b387f['name'];}_0x5ef0d2['status'](_0x2298ab)[_0xe7d3('0x24')](_0x3b387f);};}exports[_0xe7d3('0x25')]=function(_0x3de48c,_0x464905){var _0x45265f={},_0xe25075={},_0x5049bb={'count':0x0,'rows':[]};var _0x2eff74=_[_0xe7d3('0x26')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x15e3ff){return{'name':_0x15e3ff['fieldName'],'type':_0x15e3ff['type'][_0xe7d3('0x27')]};});_0xe25075['model']=_['map'](_0x2eff74,'name');_0xe25075[_0xe7d3('0x28')]=_[_0xe7d3('0x29')](_0x3de48c['query']);_0xe25075[_0xe7d3('0x2a')]=_['intersection'](_0xe25075[_0xe7d3('0x2b')],_0xe25075['query']);_0x45265f[_0xe7d3('0x2c')]=_['intersection'](_0xe25075[_0xe7d3('0x2b')],qs[_0xe7d3('0x2d')](_0x3de48c[_0xe7d3('0x28')][_0xe7d3('0x2d')]));_0x45265f[_0xe7d3('0x2c')]=_0x45265f[_0xe7d3('0x2c')][_0xe7d3('0x2e')]?_0x45265f[_0xe7d3('0x2c')]:_0xe25075[_0xe7d3('0x2b')];if(!_0x3de48c[_0xe7d3('0x28')][_0xe7d3('0x2f')](_0xe7d3('0x30'))){_0x45265f[_0xe7d3('0x1a')]=qs[_0xe7d3('0x1a')](_0x3de48c[_0xe7d3('0x28')][_0xe7d3('0x1a')]);_0x45265f[_0xe7d3('0x18')]=qs[_0xe7d3('0x18')](_0x3de48c[_0xe7d3('0x28')][_0xe7d3('0x18')]);}_0x45265f[_0xe7d3('0x31')]=qs[_0xe7d3('0x32')](_0x3de48c[_0xe7d3('0x28')][_0xe7d3('0x32')]);_0x45265f[_0xe7d3('0x33')]=qs[_0xe7d3('0x2a')](_[_0xe7d3('0x34')](_0x3de48c[_0xe7d3('0x28')],_0xe25075[_0xe7d3('0x2a')]),_0x2eff74);if(_0x3de48c['query'][_0xe7d3('0x35')]){_0x45265f['where']=_['merge'](_0x45265f[_0xe7d3('0x33')],{'$or':_[_0xe7d3('0x26')](_0x2eff74,function(_0x489bee){if(_0x489bee[_0xe7d3('0x36')]!==_0xe7d3('0x37')){var _0x46eb3d={};_0x46eb3d[_0x489bee[_0xe7d3('0x23')]]={'$like':'%'+_0x3de48c[_0xe7d3('0x28')]['filter']+'%'};return _0x46eb3d;}})});}_0x45265f=_['merge']({},_0x45265f,_0x3de48c[_0xe7d3('0x38')]);var _0x2b0609={'where':_0x45265f[_0xe7d3('0x33')]};return db[_0xe7d3('0x39')][_0xe7d3('0x1b')](_0x2b0609)[_0xe7d3('0x1f')](function(_0x10ee18){_0x5049bb[_0xe7d3('0x1b')]=_0x10ee18;if(_0x3de48c[_0xe7d3('0x28')][_0xe7d3('0x3a')]){_0x45265f['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xe7d3('0x3b')](_0x45265f);})[_0xe7d3('0x1f')](function(_0x269e8d){_0x5049bb[_0xe7d3('0x3c')]=_0x269e8d;return _0x5049bb;})[_0xe7d3('0x1f')](respondWithFilteredResult(_0x464905,_0x45265f))[_0xe7d3('0x3d')](handleError(_0x464905,null));};exports[_0xe7d3('0x3e')]=function(_0xa55d1b,_0x1e6e3f){var _0x3f4911={'raw':![],'where':{'id':_0xa55d1b[_0xe7d3('0x3f')]['id']}},_0x10345a={};_0x10345a['model']=_['keys'](db['FreshsalesConfiguration'][_0xe7d3('0x40')]);_0x10345a[_0xe7d3('0x28')]=_[_0xe7d3('0x29')](_0xa55d1b[_0xe7d3('0x28')]);_0x10345a[_0xe7d3('0x2a')]=_[_0xe7d3('0x41')](_0x10345a[_0xe7d3('0x2b')],_0x10345a[_0xe7d3('0x28')]);_0x3f4911['attributes']=_[_0xe7d3('0x41')](_0x10345a[_0xe7d3('0x2b')],qs['fields'](_0xa55d1b[_0xe7d3('0x28')][_0xe7d3('0x2d')]));_0x3f4911[_0xe7d3('0x2c')]=_0x3f4911[_0xe7d3('0x2c')][_0xe7d3('0x2e')]?_0x3f4911[_0xe7d3('0x2c')]:_0x10345a[_0xe7d3('0x2b')];if(_0xa55d1b[_0xe7d3('0x28')][_0xe7d3('0x3a')]){_0x3f4911[_0xe7d3('0x42')]=[{'all':!![]}];}_0x3f4911=_['merge']({},_0x3f4911,_0xa55d1b[_0xe7d3('0x38')]);return db[_0xe7d3('0x39')]['find'](_0x3f4911)['then'](handleEntityNotFound(_0x1e6e3f,null))[_0xe7d3('0x1f')](respondWithResult(_0x1e6e3f,null))[_0xe7d3('0x3d')](handleError(_0x1e6e3f,null));};exports[_0xe7d3('0x43')]=function(_0x54280b,_0x28deb8){return db['FreshsalesConfiguration']['create'](_0x54280b[_0xe7d3('0x44')],{})[_0xe7d3('0x1f')](respondWithResult(_0x28deb8,0xc9))[_0xe7d3('0x3d')](handleError(_0x28deb8,null));};exports[_0xe7d3('0x45')]=function(_0x547b8c,_0x7df2d8){if(_0x547b8c['body']['id']){delete _0x547b8c['body']['id'];}return db[_0xe7d3('0x39')][_0xe7d3('0x46')]({'where':{'id':_0x547b8c[_0xe7d3('0x3f')]['id']}})[_0xe7d3('0x1f')](handleEntityNotFound(_0x7df2d8,null))['then'](saveUpdates(_0x547b8c[_0xe7d3('0x44')],null))[_0xe7d3('0x1f')](respondWithResult(_0x7df2d8,null))[_0xe7d3('0x3d')](handleError(_0x7df2d8,null));};exports[_0xe7d3('0x20')]=function(_0x140b96,_0x8a822d){return db[_0xe7d3('0x39')]['find']({'where':{'id':_0x140b96[_0xe7d3('0x3f')]['id']}})[_0xe7d3('0x1f')](handleEntityNotFound(_0x8a822d,null))[_0xe7d3('0x1f')](removeEntity(_0x8a822d,null))[_0xe7d3('0x3d')](handleError(_0x8a822d,null));};exports['getSubjects']=function(_0x628428,_0x550f09,_0x55d2d2){var _0x3b664d={};var _0x2be830={};var _0x538127;var _0x145708;return db[_0xe7d3('0x39')]['findOne']({'where':{'id':_0x628428['params']['id']}})[_0xe7d3('0x1f')](handleEntityNotFound(_0x550f09,null))[_0xe7d3('0x1f')](function(_0x483cfe){if(_0x483cfe){_0x538127=_0x483cfe;_0x2be830[_0xe7d3('0x2b')]=_[_0xe7d3('0x29')](db[_0xe7d3('0x47')][_0xe7d3('0x40')]);_0x2be830[_0xe7d3('0x28')]=_['keys'](_0x628428[_0xe7d3('0x28')]);_0x2be830[_0xe7d3('0x2a')]=_[_0xe7d3('0x41')](_0x2be830[_0xe7d3('0x2b')],_0x2be830[_0xe7d3('0x28')]);_0x3b664d[_0xe7d3('0x2c')]=_['intersection'](_0x2be830[_0xe7d3('0x2b')],qs[_0xe7d3('0x2d')](_0x628428[_0xe7d3('0x28')][_0xe7d3('0x2d')]));_0x3b664d[_0xe7d3('0x2c')]=_0x3b664d[_0xe7d3('0x2c')][_0xe7d3('0x2e')]?_0x3b664d[_0xe7d3('0x2c')]:_0x2be830[_0xe7d3('0x2b')];_0x3b664d[_0xe7d3('0x31')]=qs[_0xe7d3('0x32')](_0x628428[_0xe7d3('0x28')][_0xe7d3('0x32')]);_0x3b664d['where']=qs['filters'](_[_0xe7d3('0x34')](_0x628428[_0xe7d3('0x28')],_0x2be830[_0xe7d3('0x2a')]));if(_0x628428[_0xe7d3('0x28')][_0xe7d3('0x35')]){_0x3b664d[_0xe7d3('0x33')]=_['merge'](_0x3b664d[_0xe7d3('0x33')],{'$or':_[_0xe7d3('0x26')](_0x3b664d[_0xe7d3('0x2c')],function(_0x1245e5){var _0x209656={};_0x209656[_0x1245e5]={'$like':'%'+_0x628428[_0xe7d3('0x28')][_0xe7d3('0x35')]+'%'};return _0x209656;})});}_0x3b664d=_[_0xe7d3('0x48')]({},_0x3b664d,_0x628428[_0xe7d3('0x38')]);return _0x538127[_0xe7d3('0x49')](_0x3b664d);}})[_0xe7d3('0x1f')](function(_0x3e0357){if(_0x3e0357){_0x145708=_0x3e0357['length'];if(!_0x628428[_0xe7d3('0x28')][_0xe7d3('0x2f')](_0xe7d3('0x30'))){_0x3b664d[_0xe7d3('0x1a')]=qs[_0xe7d3('0x1a')](_0x628428[_0xe7d3('0x28')][_0xe7d3('0x1a')]);_0x3b664d[_0xe7d3('0x18')]=qs[_0xe7d3('0x18')](_0x628428[_0xe7d3('0x28')][_0xe7d3('0x18')]);}return _0x538127[_0xe7d3('0x49')](_0x3b664d);}})[_0xe7d3('0x1f')](function(_0x4fcd6c){if(_0x4fcd6c){return _0x4fcd6c?{'count':_0x145708,'rows':_0x4fcd6c}:null;}})[_0xe7d3('0x1f')](respondWithResult(_0x550f09,null))[_0xe7d3('0x3d')](handleError(_0x550f09,null));};exports[_0xe7d3('0x4a')]=function(_0x4518f6,_0x1975d8,_0x337ca5){var _0x4fc1a5={};var _0x141235={};var _0x21ba93;var _0x2e561e;return db[_0xe7d3('0x39')][_0xe7d3('0x4b')]({'where':{'id':_0x4518f6[_0xe7d3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1975d8,null))[_0xe7d3('0x1f')](function(_0x1ce7a9){if(_0x1ce7a9){_0x21ba93=_0x1ce7a9;_0x141235[_0xe7d3('0x2b')]=_[_0xe7d3('0x29')](db[_0xe7d3('0x47')][_0xe7d3('0x40')]);_0x141235[_0xe7d3('0x28')]=_[_0xe7d3('0x29')](_0x4518f6[_0xe7d3('0x28')]);_0x141235[_0xe7d3('0x2a')]=_[_0xe7d3('0x41')](_0x141235[_0xe7d3('0x2b')],_0x141235['query']);_0x4fc1a5[_0xe7d3('0x2c')]=_[_0xe7d3('0x41')](_0x141235[_0xe7d3('0x2b')],qs[_0xe7d3('0x2d')](_0x4518f6['query']['fields']));_0x4fc1a5[_0xe7d3('0x2c')]=_0x4fc1a5['attributes'][_0xe7d3('0x2e')]?_0x4fc1a5[_0xe7d3('0x2c')]:_0x141235[_0xe7d3('0x2b')];_0x4fc1a5[_0xe7d3('0x31')]=qs[_0xe7d3('0x32')](_0x4518f6[_0xe7d3('0x28')][_0xe7d3('0x32')]);_0x4fc1a5[_0xe7d3('0x33')]=qs[_0xe7d3('0x2a')](_[_0xe7d3('0x34')](_0x4518f6['query'],_0x141235['filters']));if(_0x4518f6[_0xe7d3('0x28')]['filter']){_0x4fc1a5['where']=_[_0xe7d3('0x48')](_0x4fc1a5[_0xe7d3('0x33')],{'$or':_['map'](_0x4fc1a5[_0xe7d3('0x2c')],function(_0x3dee93){var _0x418854={};_0x418854[_0x3dee93]={'$like':'%'+_0x4518f6['query'][_0xe7d3('0x35')]+'%'};return _0x418854;})});}_0x4fc1a5=_[_0xe7d3('0x48')]({},_0x4fc1a5,_0x4518f6[_0xe7d3('0x38')]);return _0x21ba93[_0xe7d3('0x4a')](_0x4fc1a5);}})['then'](function(_0x3019cd){if(_0x3019cd){_0x2e561e=_0x3019cd['length'];if(!_0x4518f6['query']['hasOwnProperty']('nolimit')){_0x4fc1a5[_0xe7d3('0x1a')]=qs[_0xe7d3('0x1a')](_0x4518f6[_0xe7d3('0x28')][_0xe7d3('0x1a')]);_0x4fc1a5[_0xe7d3('0x18')]=qs[_0xe7d3('0x18')](_0x4518f6[_0xe7d3('0x28')][_0xe7d3('0x18')]);}return _0x21ba93[_0xe7d3('0x4a')](_0x4fc1a5);}})[_0xe7d3('0x1f')](function(_0xadfb42){if(_0xadfb42){return _0xadfb42?{'count':_0x2e561e,'rows':_0xadfb42}:null;}})[_0xe7d3('0x1f')](respondWithResult(_0x1975d8,null))[_0xe7d3('0x3d')](handleError(_0x1975d8,null));};exports[_0xe7d3('0x4c')]=function(_0x120987,_0x9c21f1,_0x1c9420){var _0x3e9b72={};var _0x1f7947={};var _0x160188;var _0xb2b50e;return db['FreshsalesConfiguration'][_0xe7d3('0x4b')]({'where':{'id':_0x120987[_0xe7d3('0x3f')]['id']}})[_0xe7d3('0x1f')](handleEntityNotFound(_0x9c21f1,null))[_0xe7d3('0x1f')](function(_0x470a32){if(_0x470a32){_0x160188=_0x470a32;_0x1f7947[_0xe7d3('0x2b')]=_[_0xe7d3('0x29')](db[_0xe7d3('0x47')][_0xe7d3('0x40')]);_0x1f7947['query']=_[_0xe7d3('0x29')](_0x120987['query']);_0x1f7947['filters']=_[_0xe7d3('0x41')](_0x1f7947[_0xe7d3('0x2b')],_0x1f7947[_0xe7d3('0x28')]);_0x3e9b72[_0xe7d3('0x2c')]=_[_0xe7d3('0x41')](_0x1f7947[_0xe7d3('0x2b')],qs[_0xe7d3('0x2d')](_0x120987[_0xe7d3('0x28')][_0xe7d3('0x2d')]));_0x3e9b72[_0xe7d3('0x2c')]=_0x3e9b72['attributes'][_0xe7d3('0x2e')]?_0x3e9b72['attributes']:_0x1f7947[_0xe7d3('0x2b')];_0x3e9b72[_0xe7d3('0x31')]=qs[_0xe7d3('0x32')](_0x120987[_0xe7d3('0x28')][_0xe7d3('0x32')]);_0x3e9b72[_0xe7d3('0x33')]=qs[_0xe7d3('0x2a')](_[_0xe7d3('0x34')](_0x120987[_0xe7d3('0x28')],_0x1f7947[_0xe7d3('0x2a')]));if(_0x120987['query'][_0xe7d3('0x35')]){_0x3e9b72['where']=_[_0xe7d3('0x48')](_0x3e9b72[_0xe7d3('0x33')],{'$or':_['map'](_0x3e9b72[_0xe7d3('0x2c')],function(_0x2eba62){var _0x45f8e9={};_0x45f8e9[_0x2eba62]={'$like':'%'+_0x120987[_0xe7d3('0x28')]['filter']+'%'};return _0x45f8e9;})});}_0x3e9b72=_[_0xe7d3('0x48')]({},_0x3e9b72,_0x120987[_0xe7d3('0x38')]);return _0x160188[_0xe7d3('0x4c')](_0x3e9b72);}})[_0xe7d3('0x1f')](function(_0x3b36e9){if(_0x3b36e9){_0xb2b50e=_0x3b36e9[_0xe7d3('0x2e')];if(!_0x120987[_0xe7d3('0x28')][_0xe7d3('0x2f')](_0xe7d3('0x30'))){_0x3e9b72[_0xe7d3('0x1a')]=qs[_0xe7d3('0x1a')](_0x120987[_0xe7d3('0x28')][_0xe7d3('0x1a')]);_0x3e9b72[_0xe7d3('0x18')]=qs[_0xe7d3('0x18')](_0x120987['query'][_0xe7d3('0x18')]);}return _0x160188[_0xe7d3('0x4c')](_0x3e9b72);}})[_0xe7d3('0x1f')](function(_0x9d474d){if(_0x9d474d){return _0x9d474d?{'count':_0xb2b50e,'rows':_0x9d474d}:null;}})['then'](respondWithResult(_0x9c21f1,null))['catch'](handleError(_0x9c21f1,null));};
\ No newline at end of file
index daf4b81..f7ea0b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa23e=['moment','bluebird','path','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','util','api'];(function(_0x47e6e6,_0x6b1660){var _0x550872=function(_0x37b553){while(--_0x37b553){_0x47e6e6['push'](_0x47e6e6['shift']());}};_0x550872(++_0x6b1660);}(_0xa23e,0x179));var _0xea23=function(_0x3566c,_0x247f64){_0x3566c=_0x3566c-0x0;var _0xd47999=_0xa23e[_0x3566c];return _0xd47999;};'use strict';var _=require(_0xea23('0x0'));var util=require(_0xea23('0x1'));var logger=require('../../config/logger')(_0xea23('0x2'));var moment=require(_0xea23('0x3'));var BPromise=require(_0xea23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea23('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xea23('0x6'));module[_0xea23('0x7')]=function(_0x2d59ee,_0x320821){return _0x2d59ee[_0xea23('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0xea23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x614c=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','util','api'];(function(_0x55bc3e,_0x1dc880){var _0x2895f5=function(_0x27dfbc){while(--_0x27dfbc){_0x55bc3e['push'](_0x55bc3e['shift']());}};_0x2895f5(++_0x1dc880);}(_0x614c,0x139));var _0xc614=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x614c[_0x50007c];return _0x5c1ec7;};'use strict';var _=require('lodash');var util=require(_0xc614('0x0'));var logger=require('../../config/logger')(_0xc614('0x1'));var moment=require('moment');var BPromise=require(_0xc614('0x2'));var rp=require(_0xc614('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc614('0x4'));var config=require(_0xc614('0x5'));var attributes=require(_0xc614('0x6'));module[_0xc614('0x7')]=function(_0x32a888,_0x37bf14){return _0x32a888[_0xc614('0x8')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4cfa35b..d1f761b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85dc=['ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2780ea,_0x29543c){var _0x539f23=function(_0x2216e7){while(--_0x2216e7){_0x2780ea['push'](_0x2780ea['shift']());}};_0x539f23(++_0x29543c);}(_0x85dc,0x182));var _0xc85d=function(_0x5c2ded,_0xf1349){_0x5c2ded=_0x5c2ded-0x0;var _0x4f905f=_0x85dc[_0x5c2ded];return _0x4f905f;};'use strict';var _=require(_0xc85d('0x0'));var util=require(_0xc85d('0x1'));var moment=require(_0xc85d('0x2'));var BPromise=require(_0xc85d('0x3'));var rs=require(_0xc85d('0x4'));var fs=require('fs');var Redis=require(_0xc85d('0x5'));var db=require(_0xc85d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc85d('0x7'));var config=require(_0xc85d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc85d('0x9')][_0xc85d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110a7e,_0x5e557d,_0x41bf78){return new BPromise(function(_0x3d29f6,_0x326201){return client[_0xc85d('0xb')](_0x110a7e,_0x41bf78)[_0xc85d('0xc')](function(_0x478ac8){logger[_0xc85d('0xd')](_0xc85d('0xe'),_0x5e557d,_0xc85d('0xf'));logger['debug'](_0xc85d('0x10'),_0x5e557d,_0xc85d('0xf'),JSON[_0xc85d('0x11')](_0x478ac8));if(_0x478ac8['error']){if(_0x478ac8[_0xc85d('0x12')][_0xc85d('0x13')]===0x1f4){logger[_0xc85d('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5e557d,_0x478ac8[_0xc85d('0x12')][_0xc85d('0x14')]);return _0x326201(_0x478ac8[_0xc85d('0x12')]['message']);}logger['error'](_0xc85d('0xe'),_0x5e557d,_0x478ac8[_0xc85d('0x12')][_0xc85d('0x14')]);return _0x3d29f6(_0x478ac8[_0xc85d('0x12')][_0xc85d('0x14')]);}else{logger[_0xc85d('0xd')](_0xc85d('0xe'),_0x5e557d,'request\x20sent');_0x3d29f6(_0x478ac8[_0xc85d('0x15')][_0xc85d('0x14')]);}})[_0xc85d('0x16')](function(_0x1124f9){logger[_0xc85d('0x12')](_0xc85d('0xe'),_0x5e557d,_0x1124f9);_0x326201(_0x1124f9);});});}
\ No newline at end of file
+var _0x6879=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info'];(function(_0x2175b7,_0x23d8bc){var _0x4ccfc1=function(_0x421344){while(--_0x421344){_0x2175b7['push'](_0x2175b7['shift']());}};_0x4ccfc1(++_0x23d8bc);}(_0x6879,0x7f));var _0x9687=function(_0x38ad45,_0x959ca0){_0x38ad45=_0x38ad45-0x0;var _0x2fc07d=_0x6879[_0x38ad45];return _0x2fc07d;};'use strict';var _=require(_0x9687('0x0'));var util=require(_0x9687('0x1'));var moment=require('moment');var BPromise=require(_0x9687('0x2'));var rs=require(_0x9687('0x3'));var fs=require('fs');var Redis=require(_0x9687('0x4'));var db=require(_0x9687('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9687('0x6'))('rpc');var config=require(_0x9687('0x7'));var jayson=require(_0x9687('0x8'));var client=jayson[_0x9687('0x9')][_0x9687('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b51aa,_0x594c7a,_0x1d966f){return new BPromise(function(_0x194861,_0x4c5e0e){return client['request'](_0x5b51aa,_0x1d966f)[_0x9687('0xb')](function(_0x59ecc2){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x594c7a,_0x9687('0xc'));logger['debug'](_0x9687('0xd'),_0x594c7a,'request\x20sent',JSON[_0x9687('0xe')](_0x59ecc2));if(_0x59ecc2[_0x9687('0xf')]){if(_0x59ecc2['error'][_0x9687('0x10')]===0x1f4){logger[_0x9687('0xf')](_0x9687('0x11'),_0x594c7a,_0x59ecc2[_0x9687('0xf')]['message']);return _0x4c5e0e(_0x59ecc2[_0x9687('0xf')][_0x9687('0x12')]);}logger[_0x9687('0xf')](_0x9687('0x11'),_0x594c7a,_0x59ecc2[_0x9687('0xf')][_0x9687('0x12')]);return _0x194861(_0x59ecc2[_0x9687('0xf')][_0x9687('0x12')]);}else{logger[_0x9687('0x13')](_0x9687('0x11'),_0x594c7a,_0x9687('0xc'));_0x194861(_0x59ecc2[_0x9687('0x14')][_0x9687('0x12')]);}})['catch'](function(_0x209cdc){logger[_0x9687('0xf')](_0x9687('0x11'),_0x594c7a,_0x209cdc);_0x4c5e0e(_0x209cdc);});});}
\ No newline at end of file
index fab48dc..a8b1b26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87df=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x40e7c6,_0x508f4d){var _0x357e64=function(_0x417885){while(--_0x417885){_0x40e7c6['push'](_0x40e7c6['shift']());}};_0x357e64(++_0x508f4d);}(_0x87df,0x167));var _0xf87d=function(_0x32ed89,_0x11d953){_0x32ed89=_0x32ed89-0x0;var _0x262961=_0x87df[_0x32ed89];return _0x262961;};'use strict';var multer=require(_0xf87d('0x0'));var util=require(_0xf87d('0x1'));var path=require(_0xf87d('0x2'));var timeout=require(_0xf87d('0x3'));var express=require(_0xf87d('0x4'));var router=express[_0xf87d('0x5')]();var fs_extra=require(_0xf87d('0x6'));var auth=require(_0xf87d('0x7'));var interaction=require(_0xf87d('0x8'));var config=require(_0xf87d('0x9'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xf87d('0xa')](),controller[_0xf87d('0xb')]);router['get'](_0xf87d('0xc'),auth[_0xf87d('0xa')](),controller[_0xf87d('0xd')]);router[_0xf87d('0xe')]('/',auth[_0xf87d('0xa')](),controller[_0xf87d('0xf')]);router[_0xf87d('0x10')](_0xf87d('0xc'),auth[_0xf87d('0xa')](),controller[_0xf87d('0x11')]);router[_0xf87d('0x12')](_0xf87d('0xc'),auth[_0xf87d('0xa')](),controller[_0xf87d('0x13')]);module[_0xf87d('0x14')]=router;
\ No newline at end of file
+var _0xbf82=['multer','path','express','Router','fs-extra','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','post','create','/:id','update','delete','destroy','exports'];(function(_0x5dc443,_0x228c20){var _0x20f833=function(_0x525a8a){while(--_0x525a8a){_0x5dc443['push'](_0x5dc443['shift']());}};_0x20f833(++_0x228c20);}(_0xbf82,0x1cb));var _0x2bf8=function(_0x449e99,_0x2661bc){_0x449e99=_0x449e99-0x0;var _0x1d3e64=_0xbf82[_0x449e99];return _0x1d3e64;};'use strict';var multer=require(_0x2bf8('0x0'));var util=require('util');var path=require(_0x2bf8('0x1'));var timeout=require('connect-timeout');var express=require(_0x2bf8('0x2'));var router=express[_0x2bf8('0x3')]();var fs_extra=require(_0x2bf8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2bf8('0x5'));var controller=require(_0x2bf8('0x6'));router[_0x2bf8('0x7')]('/',auth[_0x2bf8('0x8')](),controller[_0x2bf8('0x9')]);router['get']('/:id',auth[_0x2bf8('0x8')](),controller['show']);router[_0x2bf8('0xa')]('/',auth[_0x2bf8('0x8')](),controller[_0x2bf8('0xb')]);router['put'](_0x2bf8('0xc'),auth[_0x2bf8('0x8')](),controller[_0x2bf8('0xd')]);router[_0x2bf8('0xe')](_0x2bf8('0xc'),auth[_0x2bf8('0x8')](),controller[_0x2bf8('0xf')]);module[_0x2bf8('0x10')]=router;
\ No newline at end of file
index 78dba33..a29c38b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa976=['ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x3f93af,_0x29297d){var _0x5ec4d6=function(_0x549252){while(--_0x549252){_0x3f93af['push'](_0x3f93af['shift']());}};_0x5ec4d6(++_0x29297d);}(_0xa976,0xcd));var _0x6a97=function(_0x2dad2b,_0x139d81){_0x2dad2b=_0x2dad2b-0x0;var _0x3e74cf=_0xa976[_0x2dad2b];return _0x3e74cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x6a97('0x0'),_0x6a97('0x1'),_0x6a97('0x2'),'keyValue',_0x6a97('0x3')),'defaultValue':_0x6a97('0x0')},'content':{'type':Sequelize[_0x6a97('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6a97('0x5')](_0x6a97('0x0'),'variable',_0x6a97('0x2'))},'keyContent':{'type':Sequelize[_0x6a97('0x4')]},'idField':{'type':Sequelize[_0x6a97('0x4')]},'nameField':{'type':Sequelize[_0x6a97('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a97('0x4')]}};
\ No newline at end of file
+var _0xc225=['ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x3c1e73,_0x4771d4){var _0x318dd9=function(_0x5ed966){while(--_0x5ed966){_0x3c1e73['push'](_0x3c1e73['shift']());}};_0x318dd9(++_0x4771d4);}(_0xc225,0xff));var _0x5c22=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xc225[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x5c22('0x0'));module['exports']={'type':{'type':Sequelize[_0x5c22('0x1')]('string',_0x5c22('0x2'),_0x5c22('0x3'),'keyValue',_0x5c22('0x4')),'defaultValue':_0x5c22('0x5')},'content':{'type':Sequelize[_0x5c22('0x6')]},'key':{'type':Sequelize[_0x5c22('0x6')]},'keyType':{'type':Sequelize[_0x5c22('0x1')](_0x5c22('0x5'),_0x5c22('0x2'),_0x5c22('0x3'))},'keyContent':{'type':Sequelize[_0x5c22('0x6')]},'idField':{'type':Sequelize[_0x5c22('0x6')]},'nameField':{'type':Sequelize[_0x5c22('0x6')]},'customField':{'type':Sequelize[_0x5c22('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c22('0x6')]}};
\ No newline at end of file
index 40da38d..60d9884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe7a=['set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x4010b9,_0x4ad342){var _0x5f51f2=function(_0x4ff6be){while(--_0x4ff6be){_0x4010b9['push'](_0x4010b9['shift']());}};_0x5f51f2(++_0x4ad342);}(_0xbe7a,0x116));var _0xabe7=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xbe7a[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0xabe7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabe7('0x1'));var jsonpatch=require(_0xabe7('0x2'));var rp=require(_0xabe7('0x3'));var moment=require(_0xabe7('0x4'));var BPromise=require(_0xabe7('0x5'));var Mustache=require(_0xabe7('0x6'));var util=require(_0xabe7('0x7'));var path=require(_0xabe7('0x8'));var sox=require(_0xabe7('0x9'));var csv=require(_0xabe7('0xa'));var ejs=require(_0xabe7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabe7('0xc'));var crypto=require(_0xabe7('0xd'));var jsforce=require(_0xabe7('0xe'));var deskjs=require(_0xabe7('0xf'));var toCsv=require(_0xabe7('0xa'));var querystring=require(_0xabe7('0x10'));var Papa=require(_0xabe7('0x11'));var Redis=require(_0xabe7('0x12'));var authService=require(_0xabe7('0x13'));var qs=require(_0xabe7('0x14'));var as=require(_0xabe7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabe7('0x16'))(_0xabe7('0x17'));var utils=require('../../config/utils');var config=require(_0xabe7('0x18'));var licenseUtil=require(_0xabe7('0x19'));var db=require(_0xabe7('0x1a'))['db'];function respondWithStatusCode(_0xbecf4c,_0x2a0a52){_0x2a0a52=_0x2a0a52||0xcc;return function(_0xa2a8cb){if(_0xa2a8cb){return _0xbecf4c[_0xabe7('0x1b')](_0x2a0a52);}return _0xbecf4c[_0xabe7('0x1c')](_0x2a0a52)[_0xabe7('0x1d')]();};}function respondWithResult(_0x3a2b2c,_0x20a88f){_0x20a88f=_0x20a88f||0xc8;return function(_0xa5a508){if(_0xa5a508){return _0x3a2b2c[_0xabe7('0x1c')](_0x20a88f)['json'](_0xa5a508);}};}function respondWithFilteredResult(_0x41b947,_0xf7aabe){return function(_0x46f66a){if(_0x46f66a){var _0x58f4fa=typeof _0xf7aabe[_0xabe7('0x1e')]===_0xabe7('0x1f')&&typeof _0xf7aabe[_0xabe7('0x20')]===_0xabe7('0x1f');var _0x1945b5=_0x46f66a['count'];var _0x53c6e1=_0x58f4fa?0x0:_0xf7aabe[_0xabe7('0x1e')];var _0x43026d=_0x58f4fa?_0x46f66a[_0xabe7('0x21')]:_0xf7aabe[_0xabe7('0x1e')]+_0xf7aabe[_0xabe7('0x20')];var _0x5b77bf;if(_0x43026d>=_0x1945b5){_0x43026d=_0x1945b5;_0x5b77bf=0xc8;}else{_0x5b77bf=0xce;}_0x41b947['status'](_0x5b77bf);return _0x41b947[_0xabe7('0x22')]('Content-Range',_0x53c6e1+'-'+_0x43026d+'/'+_0x1945b5)[_0xabe7('0x23')](_0x46f66a);}return null;};}function patchUpdates(_0x4e9fee){return function(_0x31ed74){try{jsonpatch[_0xabe7('0x24')](_0x31ed74,_0x4e9fee,!![]);}catch(_0x30b88a){return BPromise[_0xabe7('0x25')](_0x30b88a);}return _0x31ed74[_0xabe7('0x26')]();};}function saveUpdates(_0x3053a4,_0x7d1bb){return function(_0x4cc58b){if(_0x4cc58b){return _0x4cc58b[_0xabe7('0x27')](_0x3053a4)[_0xabe7('0x28')](function(_0x23b198){return _0x23b198;});}return null;};}function removeEntity(_0x4ae022,_0x105be5){return function(_0xb70ae6){if(_0xb70ae6){return _0xb70ae6[_0xabe7('0x29')]()[_0xabe7('0x28')](function(){_0x4ae022[_0xabe7('0x1c')](0xcc)[_0xabe7('0x1d')]();});}};}function handleEntityNotFound(_0x4805ba,_0x1f49f4){return function(_0x4c7875){if(!_0x4c7875){_0x4805ba['sendStatus'](0x194);}return _0x4c7875;};}function handleError(_0x144ae5,_0x2b4de7){_0x2b4de7=_0x2b4de7||0x1f4;return function(_0x23cadb){logger[_0xabe7('0x2a')](_0x23cadb[_0xabe7('0x2b')]);if(_0x23cadb['name']){delete _0x23cadb[_0xabe7('0x2c')];}_0x144ae5[_0xabe7('0x1c')](_0x2b4de7)[_0xabe7('0x2d')](_0x23cadb);};}exports[_0xabe7('0x2e')]=function(_0x3b70ba,_0x906b9d){var _0x92dc34={},_0x10c464={},_0x421cd8={'count':0x0,'rows':[]};var _0x5469c3=_[_0xabe7('0x2f')](db[_0xabe7('0x30')][_0xabe7('0x31')],function(_0x3f99cc){return{'name':_0x3f99cc[_0xabe7('0x32')],'type':_0x3f99cc[_0xabe7('0x33')][_0xabe7('0x34')]};});_0x10c464[_0xabe7('0x35')]=_[_0xabe7('0x2f')](_0x5469c3,_0xabe7('0x2c'));_0x10c464[_0xabe7('0x36')]=_[_0xabe7('0x37')](_0x3b70ba[_0xabe7('0x36')]);_0x10c464['filters']=_[_0xabe7('0x38')](_0x10c464['model'],_0x10c464[_0xabe7('0x36')]);_0x92dc34['attributes']=_[_0xabe7('0x38')](_0x10c464[_0xabe7('0x35')],qs[_0xabe7('0x39')](_0x3b70ba[_0xabe7('0x36')]['fields']));_0x92dc34[_0xabe7('0x3a')]=_0x92dc34['attributes']['length']?_0x92dc34[_0xabe7('0x3a')]:_0x10c464[_0xabe7('0x35')];if(!_0x3b70ba[_0xabe7('0x36')]['hasOwnProperty'](_0xabe7('0x3b'))){_0x92dc34[_0xabe7('0x20')]=qs['limit'](_0x3b70ba[_0xabe7('0x36')][_0xabe7('0x20')]);_0x92dc34[_0xabe7('0x1e')]=qs['offset'](_0x3b70ba[_0xabe7('0x36')]['offset']);}_0x92dc34['order']=qs[_0xabe7('0x3c')](_0x3b70ba[_0xabe7('0x36')]['sort']);_0x92dc34[_0xabe7('0x3d')]=qs[_0xabe7('0x3e')](_[_0xabe7('0x3f')](_0x3b70ba['query'],_0x10c464[_0xabe7('0x3e')]),_0x5469c3);if(_0x3b70ba[_0xabe7('0x36')][_0xabe7('0x40')]){_0x92dc34[_0xabe7('0x3d')]=_[_0xabe7('0x41')](_0x92dc34[_0xabe7('0x3d')],{'$or':_[_0xabe7('0x2f')](_0x5469c3,function(_0x23d5b6){if(_0x23d5b6[_0xabe7('0x33')]!==_0xabe7('0x42')){var _0x576408={};_0x576408[_0x23d5b6[_0xabe7('0x2c')]]={'$like':'%'+_0x3b70ba[_0xabe7('0x36')][_0xabe7('0x40')]+'%'};return _0x576408;}})});}_0x92dc34=_['merge']({},_0x92dc34,_0x3b70ba[_0xabe7('0x43')]);var _0xe80828={'where':_0x92dc34[_0xabe7('0x3d')]};return db[_0xabe7('0x30')][_0xabe7('0x21')](_0xe80828)['then'](function(_0x8c1a00){_0x421cd8['count']=_0x8c1a00;if(_0x3b70ba[_0xabe7('0x36')]['includeAll']){_0x92dc34[_0xabe7('0x44')]=[{'all':!![]}];}return db[_0xabe7('0x30')][_0xabe7('0x45')](_0x92dc34);})[_0xabe7('0x28')](function(_0x3dcec4){_0x421cd8[_0xabe7('0x46')]=_0x3dcec4;return _0x421cd8;})[_0xabe7('0x28')](respondWithFilteredResult(_0x906b9d,_0x92dc34))[_0xabe7('0x47')](handleError(_0x906b9d,null));};exports[_0xabe7('0x48')]=function(_0x1d258f,_0x51102f){var _0x50daa3={'raw':!![],'where':{'id':_0x1d258f[_0xabe7('0x49')]['id']}},_0x1d69bc={};_0x1d69bc[_0xabe7('0x35')]=_[_0xabe7('0x37')](db[_0xabe7('0x30')][_0xabe7('0x31')]);_0x1d69bc[_0xabe7('0x36')]=_[_0xabe7('0x37')](_0x1d258f[_0xabe7('0x36')]);_0x1d69bc[_0xabe7('0x3e')]=_[_0xabe7('0x38')](_0x1d69bc['model'],_0x1d69bc[_0xabe7('0x36')]);_0x50daa3[_0xabe7('0x3a')]=_['intersection'](_0x1d69bc[_0xabe7('0x35')],qs[_0xabe7('0x39')](_0x1d258f[_0xabe7('0x36')][_0xabe7('0x39')]));_0x50daa3[_0xabe7('0x3a')]=_0x50daa3['attributes'][_0xabe7('0x4a')]?_0x50daa3[_0xabe7('0x3a')]:_0x1d69bc[_0xabe7('0x35')];if(_0x1d258f[_0xabe7('0x36')]['includeAll']){_0x50daa3[_0xabe7('0x44')]=[{'all':!![]}];}_0x50daa3=_[_0xabe7('0x41')]({},_0x50daa3,_0x1d258f['options']);return db[_0xabe7('0x30')][_0xabe7('0x4b')](_0x50daa3)[_0xabe7('0x28')](handleEntityNotFound(_0x51102f,null))[_0xabe7('0x28')](respondWithResult(_0x51102f,null))[_0xabe7('0x47')](handleError(_0x51102f,null));};exports[_0xabe7('0x4c')]=function(_0x2a2b3e,_0x57b59b){return db[_0xabe7('0x30')]['create'](_0x2a2b3e[_0xabe7('0x4d')],{})[_0xabe7('0x28')](respondWithResult(_0x57b59b,0xc9))[_0xabe7('0x47')](handleError(_0x57b59b,null));};exports[_0xabe7('0x27')]=function(_0x50afe0,_0x35fcd3){if(_0x50afe0['body']['id']){delete _0x50afe0[_0xabe7('0x4d')]['id'];}return db['FreshsalesField'][_0xabe7('0x4b')]({'where':{'id':_0x50afe0[_0xabe7('0x49')]['id']}})[_0xabe7('0x28')](handleEntityNotFound(_0x35fcd3,null))[_0xabe7('0x28')](saveUpdates(_0x50afe0[_0xabe7('0x4d')],null))['then'](respondWithResult(_0x35fcd3,null))[_0xabe7('0x47')](handleError(_0x35fcd3,null));};exports[_0xabe7('0x29')]=function(_0x2ca8c1,_0x4e645d){return db[_0xabe7('0x30')][_0xabe7('0x4b')]({'where':{'id':_0x2ca8c1['params']['id']}})[_0xabe7('0x28')](handleEntityNotFound(_0x4e645d,null))[_0xabe7('0x28')](removeEntity(_0x4e645d,null))['catch'](handleError(_0x4e645d,null));};
\ No newline at end of file
+var _0xb941=['keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','filter','FreshsalesField','includeAll','findAll','catch','show','params','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','name','send','index','map','rawAttributes','fieldName','type','query'];(function(_0x39807f,_0x69fd0b){var _0x4bce9e=function(_0x55a00a){while(--_0x55a00a){_0x39807f['push'](_0x39807f['shift']());}};_0x4bce9e(++_0x69fd0b);}(_0xb941,0x172));var _0x1b94=function(_0x12f18f,_0x557c5d){_0x12f18f=_0x12f18f-0x0;var _0x25207e=_0xb941[_0x12f18f];return _0x25207e;};'use strict';var emlformat=require(_0x1b94('0x0'));var rimraf=require(_0x1b94('0x1'));var zipdir=require(_0x1b94('0x2'));var jsonpatch=require(_0x1b94('0x3'));var rp=require(_0x1b94('0x4'));var moment=require(_0x1b94('0x5'));var BPromise=require(_0x1b94('0x6'));var Mustache=require(_0x1b94('0x7'));var util=require('util');var path=require(_0x1b94('0x8'));var sox=require(_0x1b94('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b94('0xa'));var squel=require(_0x1b94('0xb'));var crypto=require('crypto');var jsforce=require(_0x1b94('0xc'));var deskjs=require(_0x1b94('0xd'));var toCsv=require(_0x1b94('0xe'));var querystring=require('querystring');var Papa=require(_0x1b94('0xf'));var Redis=require('ioredis');var authService=require(_0x1b94('0x10'));var qs=require(_0x1b94('0x11'));var as=require(_0x1b94('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b94('0x13'))('api');var utils=require(_0x1b94('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1b94('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x64d3c7,_0x36bea8){_0x36bea8=_0x36bea8||0xcc;return function(_0x174f3c){if(_0x174f3c){return _0x64d3c7[_0x1b94('0x16')](_0x36bea8);}return _0x64d3c7[_0x1b94('0x17')](_0x36bea8)[_0x1b94('0x18')]();};}function respondWithResult(_0x1915a7,_0x1e5b58){_0x1e5b58=_0x1e5b58||0xc8;return function(_0x59bb91){if(_0x59bb91){return _0x1915a7[_0x1b94('0x17')](_0x1e5b58)[_0x1b94('0x19')](_0x59bb91);}};}function respondWithFilteredResult(_0x441c60,_0x22b06a){return function(_0x43dfc2){if(_0x43dfc2){var _0x4f7f5d=typeof _0x22b06a['offset']===_0x1b94('0x1a')&&typeof _0x22b06a[_0x1b94('0x1b')]==='undefined';var _0x4d9d78=_0x43dfc2[_0x1b94('0x1c')];var _0xca2147=_0x4f7f5d?0x0:_0x22b06a['offset'];var _0x113caa=_0x4f7f5d?_0x43dfc2[_0x1b94('0x1c')]:_0x22b06a[_0x1b94('0x1d')]+_0x22b06a[_0x1b94('0x1b')];var _0x2f9a19;if(_0x113caa>=_0x4d9d78){_0x113caa=_0x4d9d78;_0x2f9a19=0xc8;}else{_0x2f9a19=0xce;}_0x441c60[_0x1b94('0x17')](_0x2f9a19);return _0x441c60[_0x1b94('0x1e')](_0x1b94('0x1f'),_0xca2147+'-'+_0x113caa+'/'+_0x4d9d78)['json'](_0x43dfc2);}return null;};}function patchUpdates(_0x398779){return function(_0x2f82e6){try{jsonpatch['apply'](_0x2f82e6,_0x398779,!![]);}catch(_0x1b899f){return BPromise[_0x1b94('0x20')](_0x1b899f);}return _0x2f82e6[_0x1b94('0x21')]();};}function saveUpdates(_0xf60bc4,_0xf9b945){return function(_0x2b267b){if(_0x2b267b){return _0x2b267b[_0x1b94('0x22')](_0xf60bc4)[_0x1b94('0x23')](function(_0x59b551){return _0x59b551;});}return null;};}function removeEntity(_0x310da1,_0x15f17f){return function(_0x5cf75a){if(_0x5cf75a){return _0x5cf75a['destroy']()['then'](function(){_0x310da1['status'](0xcc)[_0x1b94('0x18')]();});}};}function handleEntityNotFound(_0x2ce980,_0x3906f2){return function(_0x167ec1){if(!_0x167ec1){_0x2ce980[_0x1b94('0x16')](0x194);}return _0x167ec1;};}function handleError(_0x225953,_0x2a3e0b){_0x2a3e0b=_0x2a3e0b||0x1f4;return function(_0x50a9fe){logger['error'](_0x50a9fe['stack']);if(_0x50a9fe[_0x1b94('0x24')]){delete _0x50a9fe['name'];}_0x225953['status'](_0x2a3e0b)[_0x1b94('0x25')](_0x50a9fe);};}exports[_0x1b94('0x26')]=function(_0x30c217,_0x15a0ad){var _0x40d002={},_0x183449={},_0x400aa5={'count':0x0,'rows':[]};var _0x655332=_[_0x1b94('0x27')](db['FreshsalesField'][_0x1b94('0x28')],function(_0x44a0f9){return{'name':_0x44a0f9[_0x1b94('0x29')],'type':_0x44a0f9[_0x1b94('0x2a')]['key']};});_0x183449['model']=_[_0x1b94('0x27')](_0x655332,_0x1b94('0x24'));_0x183449[_0x1b94('0x2b')]=_[_0x1b94('0x2c')](_0x30c217[_0x1b94('0x2b')]);_0x183449[_0x1b94('0x2d')]=_['intersection'](_0x183449[_0x1b94('0x2e')],_0x183449[_0x1b94('0x2b')]);_0x40d002[_0x1b94('0x2f')]=_[_0x1b94('0x30')](_0x183449['model'],qs[_0x1b94('0x31')](_0x30c217[_0x1b94('0x2b')][_0x1b94('0x31')]));_0x40d002[_0x1b94('0x2f')]=_0x40d002[_0x1b94('0x2f')][_0x1b94('0x32')]?_0x40d002[_0x1b94('0x2f')]:_0x183449[_0x1b94('0x2e')];if(!_0x30c217[_0x1b94('0x2b')][_0x1b94('0x33')]('nolimit')){_0x40d002['limit']=qs[_0x1b94('0x1b')](_0x30c217[_0x1b94('0x2b')][_0x1b94('0x1b')]);_0x40d002['offset']=qs[_0x1b94('0x1d')](_0x30c217[_0x1b94('0x2b')]['offset']);}_0x40d002['order']=qs[_0x1b94('0x34')](_0x30c217['query'][_0x1b94('0x34')]);_0x40d002[_0x1b94('0x35')]=qs[_0x1b94('0x2d')](_[_0x1b94('0x36')](_0x30c217['query'],_0x183449[_0x1b94('0x2d')]),_0x655332);if(_0x30c217[_0x1b94('0x2b')]['filter']){_0x40d002[_0x1b94('0x35')]=_[_0x1b94('0x37')](_0x40d002[_0x1b94('0x35')],{'$or':_[_0x1b94('0x27')](_0x655332,function(_0x1b6365){if(_0x1b6365[_0x1b94('0x2a')]!=='VIRTUAL'){var _0x4ad2fb={};_0x4ad2fb[_0x1b6365[_0x1b94('0x24')]]={'$like':'%'+_0x30c217['query'][_0x1b94('0x38')]+'%'};return _0x4ad2fb;}})});}_0x40d002=_[_0x1b94('0x37')]({},_0x40d002,_0x30c217['options']);var _0x44debf={'where':_0x40d002[_0x1b94('0x35')]};return db[_0x1b94('0x39')][_0x1b94('0x1c')](_0x44debf)[_0x1b94('0x23')](function(_0x5523dd){_0x400aa5['count']=_0x5523dd;if(_0x30c217['query'][_0x1b94('0x3a')]){_0x40d002['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x1b94('0x3b')](_0x40d002);})['then'](function(_0x509694){_0x400aa5['rows']=_0x509694;return _0x400aa5;})[_0x1b94('0x23')](respondWithFilteredResult(_0x15a0ad,_0x40d002))[_0x1b94('0x3c')](handleError(_0x15a0ad,null));};exports[_0x1b94('0x3d')]=function(_0x4c0554,_0x4193cb){var _0x5b788e={'raw':!![],'where':{'id':_0x4c0554[_0x1b94('0x3e')]['id']}},_0x63b102={};_0x63b102['model']=_[_0x1b94('0x2c')](db[_0x1b94('0x39')][_0x1b94('0x28')]);_0x63b102['query']=_[_0x1b94('0x2c')](_0x4c0554[_0x1b94('0x2b')]);_0x63b102[_0x1b94('0x2d')]=_['intersection'](_0x63b102[_0x1b94('0x2e')],_0x63b102['query']);_0x5b788e[_0x1b94('0x2f')]=_['intersection'](_0x63b102[_0x1b94('0x2e')],qs[_0x1b94('0x31')](_0x4c0554[_0x1b94('0x2b')][_0x1b94('0x31')]));_0x5b788e[_0x1b94('0x2f')]=_0x5b788e[_0x1b94('0x2f')]['length']?_0x5b788e[_0x1b94('0x2f')]:_0x63b102[_0x1b94('0x2e')];if(_0x4c0554[_0x1b94('0x2b')][_0x1b94('0x3a')]){_0x5b788e[_0x1b94('0x3f')]=[{'all':!![]}];}_0x5b788e=_['merge']({},_0x5b788e,_0x4c0554[_0x1b94('0x40')]);return db[_0x1b94('0x39')][_0x1b94('0x41')](_0x5b788e)[_0x1b94('0x23')](handleEntityNotFound(_0x4193cb,null))['then'](respondWithResult(_0x4193cb,null))[_0x1b94('0x3c')](handleError(_0x4193cb,null));};exports['create']=function(_0x1637f0,_0x27a696){return db[_0x1b94('0x39')][_0x1b94('0x42')](_0x1637f0[_0x1b94('0x43')],{})[_0x1b94('0x23')](respondWithResult(_0x27a696,0xc9))[_0x1b94('0x3c')](handleError(_0x27a696,null));};exports[_0x1b94('0x22')]=function(_0x10da81,_0x3b7af7){if(_0x10da81['body']['id']){delete _0x10da81['body']['id'];}return db[_0x1b94('0x39')][_0x1b94('0x41')]({'where':{'id':_0x10da81[_0x1b94('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3b7af7,null))[_0x1b94('0x23')](saveUpdates(_0x10da81[_0x1b94('0x43')],null))[_0x1b94('0x23')](respondWithResult(_0x3b7af7,null))[_0x1b94('0x3c')](handleError(_0x3b7af7,null));};exports[_0x1b94('0x44')]=function(_0x5a99c8,_0x5cd925){return db['FreshsalesField'][_0x1b94('0x41')]({'where':{'id':_0x5a99c8[_0x1b94('0x3e')]['id']}})[_0x1b94('0x23')](handleEntityNotFound(_0x5cd925,null))[_0x1b94('0x23')](removeEntity(_0x5cd925,null))[_0x1b94('0x3c')](handleError(_0x5cd925,null));};
\ No newline at end of file
index 61e131c..aec6094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcac3=['int_freshsales_fields','freshsales_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x51f2c0,_0xb7c46e){var _0x34ffd5=function(_0x2238c0){while(--_0x2238c0){_0x51f2c0['push'](_0x51f2c0['shift']());}};_0x34ffd5(++_0xb7c46e);}(_0xcac3,0x193));var _0x3cac=function(_0x239875,_0x52a793){_0x239875=_0x239875-0x0;var _0x55a8d6=_0xcac3[_0x239875];return _0x55a8d6;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var logger=require(_0x3cac('0x1'))(_0x3cac('0x2'));var moment=require(_0x3cac('0x3'));var BPromise=require(_0x3cac('0x4'));var rp=require(_0x3cac('0x5'));var fs=require('fs');var path=require(_0x3cac('0x6'));var rimraf=require(_0x3cac('0x7'));var config=require(_0x3cac('0x8'));var attributes=require(_0x3cac('0x9'));module[_0x3cac('0xa')]=function(_0x2c5e16,_0x35c687){return _0x2c5e16[_0x3cac('0xb')](_0x3cac('0xc'),attributes,{'tableName':_0x3cac('0xd'),'paranoid':![],'indexes':[{'name':_0x3cac('0xe'),'fields':['idField',_0x3cac('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f2f=['bluebird','request-promise','path','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0xa9ff5d,_0x482f31){var _0x121731=function(_0x11ffb9){while(--_0x11ffb9){_0xa9ff5d['push'](_0xa9ff5d['shift']());}};_0x121731(++_0x482f31);}(_0x5f2f,0x73));var _0xf5f2=function(_0x46c1c3,_0x160261){_0x46c1c3=_0x46c1c3-0x0;var _0x57341b=_0x5f2f[_0x46c1c3];return _0x57341b;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xf5f2('0xc'),'fields':[_0xf5f2('0xd'),_0xf5f2('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e8ed215..a8af2c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb2=['request','then','info','request\x20sent','error','FreshsalesField,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x52d043,_0x2f44d9){var _0x50bb1c=function(_0x390200){while(--_0x390200){_0x52d043['push'](_0x52d043['shift']());}};_0x50bb1c(++_0x2f44d9);}(_0x2eb2,0x19f));var _0x22eb=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x2eb2[_0xbe200f];return _0x192597;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){return client[_0x22eb('0xa')](_0x2a9850,_0x396806)[_0x22eb('0xb')](function(_0xb9c8a4){logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'),JSON['stringify'](_0xb9c8a4));if(_0xb9c8a4[_0x22eb('0xe')]){if(_0xb9c8a4[_0x22eb('0xe')]['code']===0x1f4){logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);return _0x3375d6(_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);}logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4['error'][_0x22eb('0x10')]);return _0x33ddef(_0xb9c8a4['error'][_0x22eb('0x10')]);}else{logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,'request\x20sent');_0x33ddef(_0xb9c8a4['result'][_0x22eb('0x10')]);}})['catch'](function(_0x50176d){logger[_0x22eb('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x50176d);_0x3375d6(_0x50176d);});});}
\ No newline at end of file
+var _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1a7ba8,_0x532486){var _0x171458=function(_0x20d9c4){while(--_0x20d9c4){_0x1a7ba8['push'](_0x1a7ba8['shift']());}};_0x171458(++_0x532486);}(_0x90b1,0x1bb));var _0x190b=function(_0x1879a4,_0x581a4a){_0x1879a4=_0x1879a4-0x0;var _0x38e837=_0x90b1[_0x1879a4];return _0x38e837;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}
\ No newline at end of file
index 2327f1f..8531167 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3d865d,_0x3e04f8){var _0x49fda5=function(_0x1cefad){while(--_0x1cefad){_0x3d865d['push'](_0x3d865d['shift']());}};_0x49fda5(++_0x3e04f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4e82ea,_0x3748f2){var _0x35a285=function(_0x37be57){while(--_0x37be57){_0x4e82ea['push'](_0x4e82ea['shift']());}};_0x35a285(++_0x3748f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
index 9221c6e..21d9b9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2340=['ENUM','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2340,0x1e6));var _0x0234=function(_0x4f408a,_0x2f3dc3){_0x4f408a=_0x4f408a-0x0;var _0x223d2e=_0x2340[_0x4f408a];return _0x223d2e;};'use strict';var Sequelize=require(_0x0234('0x0'));module[_0x0234('0x1')]={'name':{'type':Sequelize[_0x0234('0x2')]},'description':{'type':Sequelize[_0x0234('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x0234('0x3')},'remoteUri':{'type':Sequelize[_0x0234('0x2')]},'password':{'type':Sequelize[_0x0234('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0234('0x2')]},'securityToken':{'type':Sequelize[_0x0234('0x2')]},'serverUrl':{'type':Sequelize[_0x0234('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0234('0x4')](_0x0234('0x5'),_0x0234('0x6')),'defaultValue':_0x0234('0x5')}};
\ No newline at end of file
+var _0x8294=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x1ec91b,_0x34e8e6){var _0x2cc94e=function(_0x5a2133){while(--_0x5a2133){_0x1ec91b['push'](_0x1ec91b['shift']());}};_0x2cc94e(++_0x34e8e6);}(_0x8294,0x1c6));var _0x4829=function(_0x15e90a,_0x3ca4fc){_0x15e90a=_0x15e90a-0x0;var _0x5cab19=_0x8294[_0x15e90a];return _0x5cab19;};'use strict';var Sequelize=require(_0x4829('0x0'));module[_0x4829('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4829('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4829('0x2')]},'password':{'type':Sequelize[_0x4829('0x2')]},'clientId':{'type':Sequelize[_0x4829('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x4829('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4829('0x3')](_0x4829('0x4'),_0x4829('0x5')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 1f6e213..d2169e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8053=['bluebird','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceAccount','rawAttributes','type','model','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','keys','length','merge','find','create','body','getConfigurations','SalesforceConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','true','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','request-promise','moment'];(function(_0x2263d6,_0x23ef72){var _0x392795=function(_0x555ceb){while(--_0x555ceb){_0x2263d6['push'](_0x2263d6['shift']());}};_0x392795(++_0x23ef72);}(_0x8053,0x1e1));var _0x3805=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0x8053[_0x18f152];return _0xa10b34;};'use strict';var emlformat=require(_0x3805('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3805('0x1'));var moment=require(_0x3805('0x2'));var BPromise=require(_0x3805('0x3'));var Mustache=require('mustache');var util=require(_0x3805('0x4'));var path=require(_0x3805('0x5'));var sox=require(_0x3805('0x6'));var csv=require('to-csv');var ejs=require(_0x3805('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3805('0x8'));var squel=require(_0x3805('0x9'));var crypto=require(_0x3805('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3805('0xb'));var querystring=require(_0x3805('0xc'));var Papa=require(_0x3805('0xd'));var Redis=require(_0x3805('0xe'));var authService=require(_0x3805('0xf'));var qs=require(_0x3805('0x10'));var as=require(_0x3805('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3805('0x12'));var utils=require(_0x3805('0x13'));var config=require(_0x3805('0x14'));var licenseUtil=require(_0x3805('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3805('0x16'));function respondWithStatusCode(_0x1a8058,_0x47cdd3){_0x47cdd3=_0x47cdd3||0xcc;return function(_0x501e74){if(_0x501e74){return _0x1a8058['sendStatus'](_0x47cdd3);}return _0x1a8058[_0x3805('0x17')](_0x47cdd3)[_0x3805('0x18')]();};}function respondWithResult(_0x52cc9d,_0x453770){_0x453770=_0x453770||0xc8;return function(_0x4e2978){if(_0x4e2978){return _0x52cc9d[_0x3805('0x17')](_0x453770)[_0x3805('0x19')](_0x4e2978);}};}function respondWithFilteredResult(_0x5e2aba,_0x18f9de){return function(_0x5d7071){if(_0x5d7071){var _0x4302ca=typeof _0x18f9de['offset']===_0x3805('0x1a')&&typeof _0x18f9de['limit']===_0x3805('0x1a');var _0xb6d005=_0x5d7071['count'];var _0x4cb4f3=_0x4302ca?0x0:_0x18f9de['offset'];var _0x3583e1=_0x4302ca?_0x5d7071['count']:_0x18f9de['offset']+_0x18f9de[_0x3805('0x1b')];var _0x1a51dc;if(_0x3583e1>=_0xb6d005){_0x3583e1=_0xb6d005;_0x1a51dc=0xc8;}else{_0x1a51dc=0xce;}_0x5e2aba[_0x3805('0x17')](_0x1a51dc);return _0x5e2aba[_0x3805('0x1c')](_0x3805('0x1d'),_0x4cb4f3+'-'+_0x3583e1+'/'+_0xb6d005)[_0x3805('0x19')](_0x5d7071);}return null;};}function patchUpdates(_0x19d1cc){return function(_0x331c00){try{jsonpatch[_0x3805('0x1e')](_0x331c00,_0x19d1cc,!![]);}catch(_0x1d34a8){return BPromise[_0x3805('0x1f')](_0x1d34a8);}return _0x331c00[_0x3805('0x20')]();};}function saveUpdates(_0x53f71d,_0x38fdb6){return function(_0x671875){if(_0x671875){return _0x671875[_0x3805('0x21')](_0x53f71d)[_0x3805('0x22')](function(_0x9c51a){return _0x9c51a;});}return null;};}function removeEntity(_0x4aed12,_0x4afeb2){return function(_0x49008a){if(_0x49008a){return _0x49008a[_0x3805('0x23')]()[_0x3805('0x22')](function(){_0x4aed12[_0x3805('0x17')](0xcc)[_0x3805('0x18')]();});}};}function handleEntityNotFound(_0x22dcbd,_0x1aca67){return function(_0x2fdc90){if(!_0x2fdc90){_0x22dcbd['sendStatus'](0x194);}return _0x2fdc90;};}function handleError(_0x29f607,_0x303fa8){_0x303fa8=_0x303fa8||0x1f4;return function(_0x46ddbd){logger[_0x3805('0x24')](_0x46ddbd['stack']);if(_0x46ddbd[_0x3805('0x25')]){delete _0x46ddbd[_0x3805('0x25')];}_0x29f607[_0x3805('0x17')](_0x303fa8)[_0x3805('0x26')](_0x46ddbd);};}exports[_0x3805('0x27')]=function(_0xc125cb,_0xa6cca3){var _0x5e701c={},_0xd94a65={},_0x4b9bc5={'count':0x0,'rows':[]};var _0x34659a=_[_0x3805('0x28')](db[_0x3805('0x29')][_0x3805('0x2a')],function(_0x4bc7ce){return{'name':_0x4bc7ce['fieldName'],'type':_0x4bc7ce[_0x3805('0x2b')]['key']};});_0xd94a65[_0x3805('0x2c')]=_[_0x3805('0x28')](_0x34659a,_0x3805('0x25'));_0xd94a65['query']=_['keys'](_0xc125cb['query']);_0xd94a65[_0x3805('0x2d')]=_['intersection'](_0xd94a65[_0x3805('0x2c')],_0xd94a65[_0x3805('0x2e')]);_0x5e701c['attributes']=_[_0x3805('0x2f')](_0xd94a65['model'],qs[_0x3805('0x30')](_0xc125cb[_0x3805('0x2e')][_0x3805('0x30')]));_0x5e701c[_0x3805('0x31')]=_0x5e701c[_0x3805('0x31')]['length']?_0x5e701c[_0x3805('0x31')]:_0xd94a65[_0x3805('0x2c')];if(!_0xc125cb[_0x3805('0x2e')][_0x3805('0x32')](_0x3805('0x33'))){_0x5e701c['limit']=qs[_0x3805('0x1b')](_0xc125cb[_0x3805('0x2e')][_0x3805('0x1b')]);_0x5e701c[_0x3805('0x34')]=qs['offset'](_0xc125cb[_0x3805('0x2e')][_0x3805('0x34')]);}_0x5e701c[_0x3805('0x35')]=qs[_0x3805('0x36')](_0xc125cb[_0x3805('0x2e')][_0x3805('0x36')]);_0x5e701c[_0x3805('0x37')]=qs[_0x3805('0x2d')](_[_0x3805('0x38')](_0xc125cb[_0x3805('0x2e')],_0xd94a65[_0x3805('0x2d')]),_0x34659a);if(_0xc125cb[_0x3805('0x2e')][_0x3805('0x39')]){_0x5e701c[_0x3805('0x37')]=_['merge'](_0x5e701c[_0x3805('0x37')],{'$or':_[_0x3805('0x28')](_0x34659a,function(_0x31712c){if(_0x31712c[_0x3805('0x2b')]!==_0x3805('0x3a')){var _0xd4010f={};_0xd4010f[_0x31712c[_0x3805('0x25')]]={'$like':'%'+_0xc125cb[_0x3805('0x2e')][_0x3805('0x39')]+'%'};return _0xd4010f;}})});}_0x5e701c=_['merge']({},_0x5e701c,_0xc125cb[_0x3805('0x3b')]);var _0x1f7ea6={'where':_0x5e701c[_0x3805('0x37')]};return db[_0x3805('0x29')]['count'](_0x1f7ea6)[_0x3805('0x22')](function(_0x1b1ae7){_0x4b9bc5[_0x3805('0x3c')]=_0x1b1ae7;if(_0xc125cb[_0x3805('0x2e')][_0x3805('0x3d')]){_0x5e701c[_0x3805('0x3e')]=[{'all':!![]}];}return db[_0x3805('0x29')][_0x3805('0x3f')](_0x5e701c);})[_0x3805('0x22')](function(_0x206d18){_0x4b9bc5[_0x3805('0x40')]=_0x206d18;return _0x4b9bc5;})['then'](respondWithFilteredResult(_0xa6cca3,_0x5e701c))[_0x3805('0x41')](handleError(_0xa6cca3,null));};exports['show']=function(_0xfcfef0,_0x12002c){var _0x37a601={'raw':![],'where':{'id':_0xfcfef0[_0x3805('0x42')]['id']}},_0xd907d0={};_0xd907d0[_0x3805('0x2c')]=_[_0x3805('0x43')](db['SalesforceAccount']['rawAttributes']);_0xd907d0['query']=_[_0x3805('0x43')](_0xfcfef0['query']);_0xd907d0['filters']=_[_0x3805('0x2f')](_0xd907d0[_0x3805('0x2c')],_0xd907d0[_0x3805('0x2e')]);_0x37a601['attributes']=_['intersection'](_0xd907d0[_0x3805('0x2c')],qs[_0x3805('0x30')](_0xfcfef0[_0x3805('0x2e')]['fields']));_0x37a601[_0x3805('0x31')]=_0x37a601[_0x3805('0x31')][_0x3805('0x44')]?_0x37a601[_0x3805('0x31')]:_0xd907d0['model'];if(_0xfcfef0['query']['includeAll']){_0x37a601[_0x3805('0x3e')]=[{'all':!![]}];}_0x37a601=_[_0x3805('0x45')]({},_0x37a601,_0xfcfef0[_0x3805('0x3b')]);return db['SalesforceAccount'][_0x3805('0x46')](_0x37a601)['then'](handleEntityNotFound(_0x12002c,null))[_0x3805('0x22')](respondWithResult(_0x12002c,null))[_0x3805('0x41')](handleError(_0x12002c,null));};exports[_0x3805('0x47')]=function(_0x3ea865,_0x36ab86){return db[_0x3805('0x29')][_0x3805('0x47')](_0x3ea865[_0x3805('0x48')],{})['then'](respondWithResult(_0x36ab86,0xc9))[_0x3805('0x41')](handleError(_0x36ab86,null));};exports[_0x3805('0x21')]=function(_0x5799fc,_0x196678){if(_0x5799fc[_0x3805('0x48')]['id']){delete _0x5799fc[_0x3805('0x48')]['id'];}return db['SalesforceAccount'][_0x3805('0x46')]({'where':{'id':_0x5799fc[_0x3805('0x42')]['id']}})[_0x3805('0x22')](handleEntityNotFound(_0x196678,null))[_0x3805('0x22')](saveUpdates(_0x5799fc['body'],null))['then'](respondWithResult(_0x196678,null))['catch'](handleError(_0x196678,null));};exports[_0x3805('0x23')]=function(_0x1432bb,_0x2a4849){return db[_0x3805('0x29')][_0x3805('0x46')]({'where':{'id':_0x1432bb['params']['id']}})[_0x3805('0x22')](handleEntityNotFound(_0x2a4849,null))[_0x3805('0x22')](removeEntity(_0x2a4849,null))[_0x3805('0x41')](handleError(_0x2a4849,null));};exports[_0x3805('0x49')]=function(_0x3070d2,_0x12aee6,_0x5ab0e3){var _0x14a92d={};var _0x430702={};var _0x5728ae;var _0x1a36f0;return db[_0x3805('0x29')]['findOne']({'where':{'id':_0x3070d2['params']['id']}})[_0x3805('0x22')](handleEntityNotFound(_0x12aee6,null))['then'](function(_0x1de877){if(_0x1de877){_0x5728ae=_0x1de877;_0x430702[_0x3805('0x2c')]=_[_0x3805('0x43')](db[_0x3805('0x4a')][_0x3805('0x2a')]);_0x430702[_0x3805('0x2e')]=_[_0x3805('0x43')](_0x3070d2[_0x3805('0x2e')]);_0x430702[_0x3805('0x2d')]=_[_0x3805('0x2f')](_0x430702['model'],_0x430702['query']);_0x14a92d[_0x3805('0x31')]=_[_0x3805('0x2f')](_0x430702[_0x3805('0x2c')],qs[_0x3805('0x30')](_0x3070d2[_0x3805('0x2e')]['fields']));_0x14a92d[_0x3805('0x31')]=_0x14a92d[_0x3805('0x31')][_0x3805('0x44')]?_0x14a92d[_0x3805('0x31')]:_0x430702[_0x3805('0x2c')];_0x14a92d['order']=qs['sort'](_0x3070d2[_0x3805('0x2e')]['sort']);_0x14a92d[_0x3805('0x37')]=qs[_0x3805('0x2d')](_['pick'](_0x3070d2[_0x3805('0x2e')],_0x430702['filters']));if(_0x3070d2['query'][_0x3805('0x39')]){_0x14a92d['where']=_[_0x3805('0x45')](_0x14a92d['where'],{'$or':_[_0x3805('0x28')](_0x14a92d[_0x3805('0x31')],function(_0x14f90d){var _0x5be737={};_0x5be737[_0x14f90d]={'$like':'%'+_0x3070d2[_0x3805('0x2e')][_0x3805('0x39')]+'%'};return _0x5be737;})});}_0x14a92d=_['merge']({},_0x14a92d,_0x3070d2[_0x3805('0x3b')]);return _0x5728ae[_0x3805('0x49')](_0x14a92d);}})['then'](function(_0x593dfb){if(_0x593dfb){_0x1a36f0=_0x593dfb[_0x3805('0x44')];if(!_0x3070d2[_0x3805('0x2e')][_0x3805('0x32')](_0x3805('0x33'))){_0x14a92d[_0x3805('0x1b')]=qs[_0x3805('0x1b')](_0x3070d2[_0x3805('0x2e')]['limit']);_0x14a92d[_0x3805('0x34')]=qs[_0x3805('0x34')](_0x3070d2['query'][_0x3805('0x34')]);}return _0x5728ae[_0x3805('0x49')](_0x14a92d);}})[_0x3805('0x22')](function(_0xda890b){if(_0xda890b){return _0xda890b?{'count':_0x1a36f0,'rows':_0xda890b}:null;}})[_0x3805('0x22')](respondWithResult(_0x12aee6,null))['catch'](handleError(_0x12aee6,null));};exports[_0x3805('0x4b')]=function(_0x5e6990,_0x49ddab,_0xfa71ba){if(_0x5e6990[_0x3805('0x48')]['id']){delete _0x5e6990['body']['id'];}return db[_0x3805('0x29')]['findOne']({'where':{'id':_0x5e6990[_0x3805('0x42')]['id']}})['then'](handleEntityNotFound(_0x49ddab,null))[_0x3805('0x22')](function(_0x57aa4b){if(_0x57aa4b){_0x5e6990[_0x3805('0x48')][_0x3805('0x4c')]=_0x57aa4b['id'];_0x5e6990[_0x3805('0x48')][_0x3805('0x4d')]=integrations['getSubjects'](_0x5e6990[_0x3805('0x48')]['channel'],_0x5e6990[_0x3805('0x48')][_0x3805('0x2b')]);_0x5e6990[_0x3805('0x48')][_0x3805('0x4e')]=integrations[_0x3805('0x4f')](_0x5e6990[_0x3805('0x48')][_0x3805('0x50')],_0x5e6990[_0x3805('0x48')][_0x3805('0x2b')]);return db[_0x3805('0x4a')][_0x3805('0x47')](_0x5e6990[_0x3805('0x48')],{'include':[{'model':db[_0x3805('0x51')],'as':'Subjects'},{'model':db[_0x3805('0x51')],'as':_0x3805('0x4e')}]});}return null;})['then'](respondWithResult(_0x49ddab,null))[_0x3805('0x41')](handleError(_0x49ddab,null));};exports[_0x3805('0x52')]=function(_0x1ccf6f,_0x2eafe7,_0x1397c0){var _0x54b6ca;var _0x2cd3fb='';var _0x2f7112=_0x3805('0x53');return db[_0x3805('0x29')]['findOne']({'where':{'id':_0x1ccf6f[_0x3805('0x42')]['id']},'attributes':['id',_0x3805('0x54'),_0x3805('0x55'),_0x3805('0x56'),'username',_0x3805('0x57'),_0x3805('0x58')]})[_0x3805('0x22')](handleEntityNotFound(_0x2eafe7,null))['then'](function(_0x317c7a){if(_0x317c7a){_0x2cd3fb=_0x317c7a[_0x3805('0x54')];var _0x2c2df1=_0x2cd3fb[_0x3805('0x59')](-0x1);if(_0x2c2df1==='/'){_0x2cd3fb=_0x2cd3fb[_0x3805('0x5a')](0x0,_0x2cd3fb[_0x3805('0x5b')](_0x2c2df1));}_0x54b6ca=new jsforce[(_0x3805('0x5c'))]({'oauth2':{'loginUrl':_0x2cd3fb,'clientId':_0x317c7a[_0x3805('0x55')],'clientSecret':_0x317c7a[_0x3805('0x56')]}});return _0x54b6ca[_0x3805('0x5d')](_0x317c7a['username'],_0x317c7a[_0x3805('0x57')][_0x3805('0x5e')](_0x317c7a['securityToken']));}})['then'](function(_0x423215){if(_0x423215){if(!_[_0x3805('0x5f')](_0x1ccf6f[_0x3805('0x2e')][_0x3805('0x60')])){_0x2f7112=_0x1ccf6f[_0x3805('0x2e')][_0x3805('0x60')];}return _0x54b6ca[_0x3805('0x61')](_0x2f7112)['describe']();}})['then'](function(_0x4ae1aa){var _0x2e1095=['OwnerId',_0x3805('0x62'),_0x3805('0x63'),_0x3805('0x64'),_0x3805('0x65'),'Description'];var _0x5c4a42=[_0x3805('0x66'),_0x3805('0x67'),'picklist',_0x3805('0x68'),_0x3805('0x69'),_0x3805('0x6a'),_0x3805('0x6b')];if(_0x4ae1aa){_[_0x3805('0x6c')](_0x4ae1aa[_0x3805('0x30')],function(_0x135c4b){return _0x2e1095[_0x3805('0x6d')](_0x135c4b['name'])||!_0x5c4a42[_0x3805('0x6d')](_0x135c4b[_0x3805('0x2b')]);});return{'count':_0x4ae1aa[_0x3805('0x30')][_0x3805('0x44')],'rows':_[_0x3805('0x28')](_0x4ae1aa[_0x3805('0x30')],function(_0x263642){return{'id':_0x263642[_0x3805('0x25')],'name':_0x263642[_0x3805('0x6e')],'custom':_0x263642[_0x3805('0x6f')],'options':_0x263642[_0x3805('0x70')]['length']>0x0?_[_0x3805('0x28')](_0x263642[_0x3805('0x70')],function(_0x1226f1){return{'name':_0x1226f1[_0x3805('0x6e')],'value':_0x1226f1[_0x3805('0x71')]};}):_0x263642[_0x3805('0x2b')]==_0x3805('0x68')?[{'name':'True','value':_0x3805('0x72')},{'name':_0x3805('0x73'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x2eafe7,null))[_0x3805('0x41')](function(_0x5adcc5){var _0x40fcab=_0x1ccf6f[_0x3805('0x2e')][_0x3805('0x74')]?0x1f4:_0x5adcc5['statusCode']||0x1f4;logger[_0x3805('0x24')](_0x3805('0x75'),_0x3805('0x52'),_0x40fcab,JSON[_0x3805('0x76')](_0x5adcc5));delete _0x5adcc5['name'];if(_0x40fcab===0x191){_0x40fcab=0x190;}_0x2eafe7[_0x3805('0x17')](_0x40fcab)['send'](_0x1ccf6f['query']['test']?{'message':_0x3805('0x77'),'statusCode':_0x5adcc5[_0x3805('0x78')]}:_0x5adcc5);});};
\ No newline at end of file
+var _0x242c=['getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','then','error','name','map','SalesforceAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','find','create','body','params','findOne','length','options','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','securityToken','slice','substring','lastIndexOf','Connection','username','password','concat','isNil','ticketType','sobject','describe','ActivityDate','IsRecurrence','Description','string','boolean','email','textarea','phone','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode'];(function(_0x3ad875,_0x29968c){var _0x26e041=function(_0x5a1f41){while(--_0x5a1f41){_0x3ad875['push'](_0x3ad875['shift']());}};_0x26e041(++_0x29968c);}(_0x242c,0x178));var _0xc242=function(_0x4058a4,_0x48ca8c){_0x4058a4=_0x4058a4-0x0;var _0x3bea24=_0x242c[_0x4058a4];return _0x3bea24;};'use strict';var emlformat=require(_0xc242('0x0'));var rimraf=require(_0xc242('0x1'));var zipdir=require(_0xc242('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc242('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc242('0x4'));var util=require(_0xc242('0x5'));var path=require(_0xc242('0x6'));var sox=require(_0xc242('0x7'));var csv=require(_0xc242('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc242('0x9'));var _=require(_0xc242('0xa'));var squel=require(_0xc242('0xb'));var crypto=require(_0xc242('0xc'));var jsforce=require(_0xc242('0xd'));var deskjs=require(_0xc242('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc242('0xf'));var Papa=require(_0xc242('0x10'));var Redis=require(_0xc242('0x11'));var authService=require(_0xc242('0x12'));var qs=require(_0xc242('0x13'));var as=require(_0xc242('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc242('0x15'))(_0xc242('0x16'));var utils=require(_0xc242('0x17'));var config=require(_0xc242('0x18'));var licenseUtil=require(_0xc242('0x19'));var db=require(_0xc242('0x1a'))['db'];var integrations=require(_0xc242('0x1b'));function respondWithStatusCode(_0x7735f7,_0x4b04f4){_0x4b04f4=_0x4b04f4||0xcc;return function(_0x43eb76){if(_0x43eb76){return _0x7735f7[_0xc242('0x1c')](_0x4b04f4);}return _0x7735f7[_0xc242('0x1d')](_0x4b04f4)[_0xc242('0x1e')]();};}function respondWithResult(_0x1c9384,_0x25bd70){_0x25bd70=_0x25bd70||0xc8;return function(_0xb1b18d){if(_0xb1b18d){return _0x1c9384[_0xc242('0x1d')](_0x25bd70)[_0xc242('0x1f')](_0xb1b18d);}};}function respondWithFilteredResult(_0x3c4a07,_0x5e154a){return function(_0x42c99a){if(_0x42c99a){var _0x2908c0=typeof _0x5e154a[_0xc242('0x20')]===_0xc242('0x21')&&typeof _0x5e154a['limit']===_0xc242('0x21');var _0x28b07b=_0x42c99a[_0xc242('0x22')];var _0x1a75f1=_0x2908c0?0x0:_0x5e154a['offset'];var _0x4373f5=_0x2908c0?_0x42c99a[_0xc242('0x22')]:_0x5e154a['offset']+_0x5e154a[_0xc242('0x23')];var _0x2c18dd;if(_0x4373f5>=_0x28b07b){_0x4373f5=_0x28b07b;_0x2c18dd=0xc8;}else{_0x2c18dd=0xce;}_0x3c4a07[_0xc242('0x1d')](_0x2c18dd);return _0x3c4a07[_0xc242('0x24')](_0xc242('0x25'),_0x1a75f1+'-'+_0x4373f5+'/'+_0x28b07b)[_0xc242('0x1f')](_0x42c99a);}return null;};}function patchUpdates(_0x4d810a){return function(_0x44c297){try{jsonpatch[_0xc242('0x26')](_0x44c297,_0x4d810a,!![]);}catch(_0x5b89dc){return BPromise['reject'](_0x5b89dc);}return _0x44c297[_0xc242('0x27')]();};}function saveUpdates(_0x4d3f85,_0x2ffb02){return function(_0xd3091b){if(_0xd3091b){return _0xd3091b['update'](_0x4d3f85)['then'](function(_0x57b836){return _0x57b836;});}return null;};}function removeEntity(_0xa1dbbb,_0x419c74){return function(_0x3de026){if(_0x3de026){return _0x3de026[_0xc242('0x28')]()[_0xc242('0x29')](function(){_0xa1dbbb[_0xc242('0x1d')](0xcc)[_0xc242('0x1e')]();});}};}function handleEntityNotFound(_0x31a3d9,_0x550c74){return function(_0xb2a06a){if(!_0xb2a06a){_0x31a3d9[_0xc242('0x1c')](0x194);}return _0xb2a06a;};}function handleError(_0x30a509,_0x131310){_0x131310=_0x131310||0x1f4;return function(_0x12e8b5){logger[_0xc242('0x2a')](_0x12e8b5['stack']);if(_0x12e8b5[_0xc242('0x2b')]){delete _0x12e8b5[_0xc242('0x2b')];}_0x30a509[_0xc242('0x1d')](_0x131310)['send'](_0x12e8b5);};}exports['index']=function(_0x14c745,_0x5b0cc3){var _0x51fab9={},_0x724cbd={},_0x2a4dd5={'count':0x0,'rows':[]};var _0x1b8c9a=_[_0xc242('0x2c')](db[_0xc242('0x2d')][_0xc242('0x2e')],function(_0x2249e7){return{'name':_0x2249e7['fieldName'],'type':_0x2249e7[_0xc242('0x2f')][_0xc242('0x30')]};});_0x724cbd[_0xc242('0x31')]=_[_0xc242('0x2c')](_0x1b8c9a,_0xc242('0x2b'));_0x724cbd[_0xc242('0x32')]=_[_0xc242('0x33')](_0x14c745[_0xc242('0x32')]);_0x724cbd[_0xc242('0x34')]=_[_0xc242('0x35')](_0x724cbd[_0xc242('0x31')],_0x724cbd[_0xc242('0x32')]);_0x51fab9[_0xc242('0x36')]=_[_0xc242('0x35')](_0x724cbd[_0xc242('0x31')],qs[_0xc242('0x37')](_0x14c745[_0xc242('0x32')][_0xc242('0x37')]));_0x51fab9[_0xc242('0x36')]=_0x51fab9[_0xc242('0x36')]['length']?_0x51fab9[_0xc242('0x36')]:_0x724cbd[_0xc242('0x31')];if(!_0x14c745[_0xc242('0x32')][_0xc242('0x38')](_0xc242('0x39'))){_0x51fab9[_0xc242('0x23')]=qs[_0xc242('0x23')](_0x14c745[_0xc242('0x32')][_0xc242('0x23')]);_0x51fab9[_0xc242('0x20')]=qs[_0xc242('0x20')](_0x14c745[_0xc242('0x32')]['offset']);}_0x51fab9[_0xc242('0x3a')]=qs[_0xc242('0x3b')](_0x14c745[_0xc242('0x32')][_0xc242('0x3b')]);_0x51fab9[_0xc242('0x3c')]=qs[_0xc242('0x34')](_[_0xc242('0x3d')](_0x14c745[_0xc242('0x32')],_0x724cbd[_0xc242('0x34')]),_0x1b8c9a);if(_0x14c745['query'][_0xc242('0x3e')]){_0x51fab9[_0xc242('0x3c')]=_[_0xc242('0x3f')](_0x51fab9[_0xc242('0x3c')],{'$or':_[_0xc242('0x2c')](_0x1b8c9a,function(_0x5e5967){if(_0x5e5967[_0xc242('0x2f')]!==_0xc242('0x40')){var _0x4eb00a={};_0x4eb00a[_0x5e5967[_0xc242('0x2b')]]={'$like':'%'+_0x14c745[_0xc242('0x32')][_0xc242('0x3e')]+'%'};return _0x4eb00a;}})});}_0x51fab9=_['merge']({},_0x51fab9,_0x14c745['options']);var _0x795ba1={'where':_0x51fab9['where']};return db[_0xc242('0x2d')][_0xc242('0x22')](_0x795ba1)[_0xc242('0x29')](function(_0x5ba6ae){_0x2a4dd5[_0xc242('0x22')]=_0x5ba6ae;if(_0x14c745[_0xc242('0x32')][_0xc242('0x41')]){_0x51fab9[_0xc242('0x42')]=[{'all':!![]}];}return db[_0xc242('0x2d')][_0xc242('0x43')](_0x51fab9);})[_0xc242('0x29')](function(_0x29b5bc){_0x2a4dd5['rows']=_0x29b5bc;return _0x2a4dd5;})[_0xc242('0x29')](respondWithFilteredResult(_0x5b0cc3,_0x51fab9))[_0xc242('0x44')](handleError(_0x5b0cc3,null));};exports[_0xc242('0x45')]=function(_0x7a3194,_0x374440){var _0x4b03c6={'raw':![],'where':{'id':_0x7a3194['params']['id']}},_0x245ea5={};_0x245ea5[_0xc242('0x31')]=_[_0xc242('0x33')](db[_0xc242('0x2d')][_0xc242('0x2e')]);_0x245ea5[_0xc242('0x32')]=_[_0xc242('0x33')](_0x7a3194[_0xc242('0x32')]);_0x245ea5[_0xc242('0x34')]=_['intersection'](_0x245ea5[_0xc242('0x31')],_0x245ea5['query']);_0x4b03c6[_0xc242('0x36')]=_[_0xc242('0x35')](_0x245ea5[_0xc242('0x31')],qs[_0xc242('0x37')](_0x7a3194[_0xc242('0x32')][_0xc242('0x37')]));_0x4b03c6[_0xc242('0x36')]=_0x4b03c6['attributes']['length']?_0x4b03c6[_0xc242('0x36')]:_0x245ea5['model'];if(_0x7a3194['query'][_0xc242('0x41')]){_0x4b03c6[_0xc242('0x42')]=[{'all':!![]}];}_0x4b03c6=_['merge']({},_0x4b03c6,_0x7a3194['options']);return db[_0xc242('0x2d')][_0xc242('0x46')](_0x4b03c6)[_0xc242('0x29')](handleEntityNotFound(_0x374440,null))[_0xc242('0x29')](respondWithResult(_0x374440,null))['catch'](handleError(_0x374440,null));};exports[_0xc242('0x47')]=function(_0x19e441,_0x275b77){return db[_0xc242('0x2d')][_0xc242('0x47')](_0x19e441[_0xc242('0x48')],{})[_0xc242('0x29')](respondWithResult(_0x275b77,0xc9))['catch'](handleError(_0x275b77,null));};exports['update']=function(_0x49732d,_0x44254b){if(_0x49732d[_0xc242('0x48')]['id']){delete _0x49732d[_0xc242('0x48')]['id'];}return db[_0xc242('0x2d')]['find']({'where':{'id':_0x49732d[_0xc242('0x49')]['id']}})['then'](handleEntityNotFound(_0x44254b,null))[_0xc242('0x29')](saveUpdates(_0x49732d['body'],null))[_0xc242('0x29')](respondWithResult(_0x44254b,null))[_0xc242('0x44')](handleError(_0x44254b,null));};exports['destroy']=function(_0x254fa9,_0x374c06){return db[_0xc242('0x2d')][_0xc242('0x46')]({'where':{'id':_0x254fa9['params']['id']}})[_0xc242('0x29')](handleEntityNotFound(_0x374c06,null))[_0xc242('0x29')](removeEntity(_0x374c06,null))[_0xc242('0x44')](handleError(_0x374c06,null));};exports['getConfigurations']=function(_0x175bb1,_0x6efaf1,_0x472889){var _0x412475={};var _0x3932ec={};var _0x14985b;var _0x5a10ed;return db[_0xc242('0x2d')][_0xc242('0x4a')]({'where':{'id':_0x175bb1[_0xc242('0x49')]['id']}})[_0xc242('0x29')](handleEntityNotFound(_0x6efaf1,null))[_0xc242('0x29')](function(_0x5f90a7){if(_0x5f90a7){_0x14985b=_0x5f90a7;_0x3932ec['model']=_[_0xc242('0x33')](db['SalesforceConfiguration'][_0xc242('0x2e')]);_0x3932ec[_0xc242('0x32')]=_[_0xc242('0x33')](_0x175bb1[_0xc242('0x32')]);_0x3932ec[_0xc242('0x34')]=_[_0xc242('0x35')](_0x3932ec['model'],_0x3932ec[_0xc242('0x32')]);_0x412475[_0xc242('0x36')]=_[_0xc242('0x35')](_0x3932ec[_0xc242('0x31')],qs[_0xc242('0x37')](_0x175bb1['query'][_0xc242('0x37')]));_0x412475[_0xc242('0x36')]=_0x412475[_0xc242('0x36')][_0xc242('0x4b')]?_0x412475[_0xc242('0x36')]:_0x3932ec[_0xc242('0x31')];_0x412475[_0xc242('0x3a')]=qs[_0xc242('0x3b')](_0x175bb1['query']['sort']);_0x412475[_0xc242('0x3c')]=qs[_0xc242('0x34')](_['pick'](_0x175bb1[_0xc242('0x32')],_0x3932ec[_0xc242('0x34')]));if(_0x175bb1[_0xc242('0x32')][_0xc242('0x3e')]){_0x412475[_0xc242('0x3c')]=_[_0xc242('0x3f')](_0x412475[_0xc242('0x3c')],{'$or':_['map'](_0x412475[_0xc242('0x36')],function(_0x3b9a2e){var _0x312721={};_0x312721[_0x3b9a2e]={'$like':'%'+_0x175bb1[_0xc242('0x32')][_0xc242('0x3e')]+'%'};return _0x312721;})});}_0x412475=_['merge']({},_0x412475,_0x175bb1[_0xc242('0x4c')]);return _0x14985b[_0xc242('0x4d')](_0x412475);}})[_0xc242('0x29')](function(_0x5d3a5f){if(_0x5d3a5f){_0x5a10ed=_0x5d3a5f['length'];if(!_0x175bb1[_0xc242('0x32')][_0xc242('0x38')](_0xc242('0x39'))){_0x412475[_0xc242('0x23')]=qs[_0xc242('0x23')](_0x175bb1[_0xc242('0x32')][_0xc242('0x23')]);_0x412475[_0xc242('0x20')]=qs[_0xc242('0x20')](_0x175bb1['query']['offset']);}return _0x14985b[_0xc242('0x4d')](_0x412475);}})[_0xc242('0x29')](function(_0x1247cb){if(_0x1247cb){return _0x1247cb?{'count':_0x5a10ed,'rows':_0x1247cb}:null;}})['then'](respondWithResult(_0x6efaf1,null))[_0xc242('0x44')](handleError(_0x6efaf1,null));};exports[_0xc242('0x4e')]=function(_0x4ddaf1,_0x3a5cba,_0x500216){if(_0x4ddaf1[_0xc242('0x48')]['id']){delete _0x4ddaf1[_0xc242('0x48')]['id'];}return db[_0xc242('0x2d')][_0xc242('0x4a')]({'where':{'id':_0x4ddaf1[_0xc242('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a5cba,null))[_0xc242('0x29')](function(_0x4d1015){if(_0x4d1015){_0x4ddaf1['body'][_0xc242('0x4f')]=_0x4d1015['id'];_0x4ddaf1[_0xc242('0x48')][_0xc242('0x50')]=integrations['getSubjects'](_0x4ddaf1['body'][_0xc242('0x51')],_0x4ddaf1[_0xc242('0x48')][_0xc242('0x2f')]);_0x4ddaf1[_0xc242('0x48')][_0xc242('0x52')]=integrations[_0xc242('0x53')](_0x4ddaf1['body'][_0xc242('0x51')],_0x4ddaf1[_0xc242('0x48')][_0xc242('0x2f')]);return db['SalesforceConfiguration'][_0xc242('0x47')](_0x4ddaf1[_0xc242('0x48')],{'include':[{'model':db[_0xc242('0x54')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xc242('0x29')](respondWithResult(_0x3a5cba,null))['catch'](handleError(_0x3a5cba,null));};exports['getFields']=function(_0x473c64,_0xc49c0e,_0xa3fb84){var _0x3d1923;var _0x14b218='';var _0x28bde0=_0xc242('0x55');return db[_0xc242('0x2d')][_0xc242('0x4a')]({'where':{'id':_0x473c64[_0xc242('0x49')]['id']},'attributes':['id',_0xc242('0x56'),_0xc242('0x57'),_0xc242('0x58'),'username','password',_0xc242('0x59')]})[_0xc242('0x29')](handleEntityNotFound(_0xc49c0e,null))[_0xc242('0x29')](function(_0x4b08e5){if(_0x4b08e5){_0x14b218=_0x4b08e5[_0xc242('0x56')];var _0x5c03c8=_0x14b218[_0xc242('0x5a')](-0x1);if(_0x5c03c8==='/'){_0x14b218=_0x14b218[_0xc242('0x5b')](0x0,_0x14b218[_0xc242('0x5c')](_0x5c03c8));}_0x3d1923=new jsforce[(_0xc242('0x5d'))]({'oauth2':{'loginUrl':_0x14b218,'clientId':_0x4b08e5[_0xc242('0x57')],'clientSecret':_0x4b08e5['clientSecret']}});return _0x3d1923['login'](_0x4b08e5[_0xc242('0x5e')],_0x4b08e5[_0xc242('0x5f')][_0xc242('0x60')](_0x4b08e5[_0xc242('0x59')]));}})[_0xc242('0x29')](function(_0x29dc97){if(_0x29dc97){if(!_[_0xc242('0x61')](_0x473c64['query'][_0xc242('0x62')])){_0x28bde0=_0x473c64[_0xc242('0x32')][_0xc242('0x62')];}return _0x3d1923[_0xc242('0x63')](_0x28bde0)[_0xc242('0x64')]();}})[_0xc242('0x29')](function(_0x40bf10){var _0x3dcc1c=['OwnerId',_0xc242('0x65'),'IsReminderSet',_0xc242('0x66'),'Subject',_0xc242('0x67')];var _0x19827e=[_0xc242('0x68'),'int','picklist',_0xc242('0x69'),_0xc242('0x6a'),_0xc242('0x6b'),_0xc242('0x6c')];if(_0x40bf10){_['remove'](_0x40bf10[_0xc242('0x37')],function(_0x17cd09){return _0x3dcc1c[_0xc242('0x6d')](_0x17cd09['name'])||!_0x19827e[_0xc242('0x6d')](_0x17cd09[_0xc242('0x2f')]);});return{'count':_0x40bf10['fields'][_0xc242('0x4b')],'rows':_[_0xc242('0x2c')](_0x40bf10[_0xc242('0x37')],function(_0x4c42c0){return{'id':_0x4c42c0[_0xc242('0x2b')],'name':_0x4c42c0[_0xc242('0x6e')],'custom':_0x4c42c0[_0xc242('0x6f')],'options':_0x4c42c0[_0xc242('0x70')][_0xc242('0x4b')]>0x0?_[_0xc242('0x2c')](_0x4c42c0[_0xc242('0x70')],function(_0x3c5e29){return{'name':_0x3c5e29['label'],'value':_0x3c5e29[_0xc242('0x71')]};}):_0x4c42c0['type']==_0xc242('0x69')?[{'name':_0xc242('0x72'),'value':_0xc242('0x73')},{'name':_0xc242('0x74'),'value':_0xc242('0x75')}]:[]};})};}})['then'](respondWithResult(_0xc49c0e,null))[_0xc242('0x44')](function(_0xc8eee){var _0x4b82e1=_0x473c64[_0xc242('0x32')][_0xc242('0x76')]?0x1f4:_0xc8eee[_0xc242('0x77')]||0x1f4;logger[_0xc242('0x2a')](_0xc242('0x78'),_0xc242('0x79'),_0x4b82e1,JSON[_0xc242('0x7a')](_0xc8eee));delete _0xc8eee[_0xc242('0x2b')];if(_0x4b82e1===0x191){_0x4b82e1=0x190;}_0xc49c0e[_0xc242('0x1d')](_0x4b82e1)['send'](_0x473c64[_0xc242('0x32')][_0xc242('0x76')]?{'message':_0xc242('0x7b'),'statusCode':_0xc8eee[_0xc242('0x77')]}:_0xc8eee);});};
\ No newline at end of file
index a69749b..6202437 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9831=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x181310,_0x245255){var _0x4eda7a=function(_0x4004f5){while(--_0x4004f5){_0x181310['push'](_0x181310['shift']());}};_0x4eda7a(++_0x245255);}(_0x9831,0xfc));var _0x1983=function(_0xeaba1e,_0x4ae84c){_0xeaba1e=_0xeaba1e-0x0;var _0x5ee9f6=_0x9831[_0xeaba1e];return _0x5ee9f6;};'use strict';var _=require(_0x1983('0x0'));var util=require(_0x1983('0x1'));var logger=require(_0x1983('0x2'))(_0x1983('0x3'));var moment=require(_0x1983('0x4'));var BPromise=require('bluebird');var rp=require(_0x1983('0x5'));var fs=require('fs');var path=require(_0x1983('0x6'));var rimraf=require(_0x1983('0x7'));var config=require(_0x1983('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x1983('0x9'));module[_0x1983('0xa')]=function(_0xf07948,_0x1e2428){return _0xf07948[_0x1983('0xb')](_0x1983('0xc'),attributes,{'tableName':_0x1983('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf3a=['int_salesforce_accounts','../../config/logger','moment','bluebird','request-promise','./intSalesforceAccount.attributes','define'];(function(_0x431f07,_0x48b9e5){var _0x80cbcd=function(_0x23122c){while(--_0x23122c){_0x431f07['push'](_0x431f07['shift']());}};_0x80cbcd(++_0x48b9e5);}(_0xaf3a,0xef));var _0xaaf3=function(_0x23a79e,_0x235f89){_0x23a79e=_0x23a79e-0x0;var _0x3dab57=_0xaf3a[_0x23a79e];return _0x3dab57;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaaf3('0x0'))('api');var moment=require(_0xaaf3('0x1'));var BPromise=require(_0xaaf3('0x2'));var rp=require(_0xaaf3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaaf3('0x4'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x87f74d,_0x492966){return _0x87f74d[_0xaaf3('0x5')]('SalesforceAccount',attributes,{'tableName':_0xaaf3('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c96d480..9398ead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0239=['map','ShowSalesforceAccount','SalesforceAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSalesforceAccount','options','raw','where','attributes','limit','include','model'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x0239,0x16c));var _0x9023=function(_0x4214af,_0x197efd){_0x4214af=_0x4214af-0x0;var _0x1f6b1e=_0x0239[_0x4214af];return _0x1f6b1e;};'use strict';var _=require(_0x9023('0x0'));var util=require(_0x9023('0x1'));var moment=require(_0x9023('0x2'));var BPromise=require('bluebird');var rs=require(_0x9023('0x3'));var fs=require('fs');var Redis=require(_0x9023('0x4'));var db=require(_0x9023('0x5'))['db'];var utils=require(_0x9023('0x6'));var logger=require(_0x9023('0x7'))(_0x9023('0x8'));var config=require('../../config/environment');var jayson=require(_0x9023('0x9'));var client=jayson['client'][_0x9023('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x396f15,_0x39365c,_0x2fd1bb){return new BPromise(function(_0x25c17b,_0x1f4ba3){return client[_0x9023('0xb')](_0x396f15,_0x2fd1bb)[_0x9023('0xc')](function(_0xe108fd){logger['info'](_0x9023('0xd'),_0x39365c,_0x9023('0xe'));logger[_0x9023('0xf')](_0x9023('0x10'),_0x39365c,'request\x20sent',JSON[_0x9023('0x11')](_0xe108fd));if(_0xe108fd[_0x9023('0x12')]){if(_0xe108fd['error'][_0x9023('0x13')]===0x1f4){logger[_0x9023('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x39365c,_0xe108fd[_0x9023('0x12')]['message']);return _0x1f4ba3(_0xe108fd[_0x9023('0x12')]['message']);}logger[_0x9023('0x12')](_0x9023('0xd'),_0x39365c,_0xe108fd[_0x9023('0x12')][_0x9023('0x14')]);return _0x25c17b(_0xe108fd[_0x9023('0x12')]['message']);}else{logger[_0x9023('0x15')](_0x9023('0xd'),_0x39365c,_0x9023('0xe'));_0x25c17b(_0xe108fd[_0x9023('0x16')]['message']);}})[_0x9023('0x17')](function(_0x143ca5){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x39365c,_0x143ca5);_0x1f4ba3(_0x143ca5);});});}exports[_0x9023('0x18')]=function(_0x1f2f12){var _0x5f0270=this;return new Promise(function(_0xfa5f6b,_0x25f69d){return db['SalesforceAccount']['findAll']({'raw':_0x1f2f12[_0x9023('0x19')]?_0x1f2f12['options'][_0x9023('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f2f12[_0x9023('0x19')]?_0x1f2f12[_0x9023('0x19')][_0x9023('0x1b')]||null:null,'attributes':_0x1f2f12[_0x9023('0x19')]?_0x1f2f12[_0x9023('0x19')][_0x9023('0x1c')]||null:null,'limit':_0x1f2f12['options']?_0x1f2f12[_0x9023('0x19')][_0x9023('0x1d')]||null:null,'include':_0x1f2f12[_0x9023('0x19')]?_0x1f2f12[_0x9023('0x19')][_0x9023('0x1e')]?_['map'](_0x1f2f12[_0x9023('0x19')]['include'],function(_0x5418c4){return{'model':db[_0x5418c4[_0x9023('0x1f')]],'as':_0x5418c4['as'],'attributes':_0x5418c4[_0x9023('0x1c')],'include':_0x5418c4['include']?_[_0x9023('0x20')](_0x5418c4[_0x9023('0x1e')],function(_0x4da1b6){return{'model':db[_0x4da1b6[_0x9023('0x1f')]],'as':_0x4da1b6['as'],'attributes':_0x4da1b6[_0x9023('0x1c')],'include':_0x4da1b6[_0x9023('0x1e')]?_['map'](_0x4da1b6['include'],function(_0x570363){return{'model':db[_0x570363[_0x9023('0x1f')]],'as':_0x570363['as'],'attributes':_0x570363[_0x9023('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x497c0b){logger[_0x9023('0x15')]('GetSalesforceAccount',_0x1f2f12);logger[_0x9023('0xf')](_0x9023('0x18'),_0x1f2f12,JSON[_0x9023('0x11')](_0x497c0b));_0xfa5f6b(_0x497c0b);})['catch'](function(_0x55cb6c){logger[_0x9023('0x12')]('GetSalesforceAccount',_0x55cb6c[_0x9023('0x14')],_0x1f2f12);_0x25f69d(_0x5f0270[_0x9023('0x12')](0x1f4,_0x55cb6c[_0x9023('0x14')]));});});};exports[_0x9023('0x21')]=function(_0x23d79f){var _0x7ecf06=this;return new Promise(function(_0x500ae2,_0x28783c){return db[_0x9023('0x22')][_0x9023('0x23')]({'raw':_0x23d79f[_0x9023('0x19')]?_0x23d79f[_0x9023('0x19')][_0x9023('0x1a')]===undefined?!![]:![]:!![],'where':_0x23d79f[_0x9023('0x19')]?_0x23d79f[_0x9023('0x19')][_0x9023('0x1b')]||null:null,'attributes':_0x23d79f[_0x9023('0x19')]?_0x23d79f[_0x9023('0x19')][_0x9023('0x1c')]||null:null,'include':_0x23d79f['options']?_0x23d79f[_0x9023('0x19')][_0x9023('0x1e')]?_[_0x9023('0x20')](_0x23d79f[_0x9023('0x19')][_0x9023('0x1e')],function(_0x22f5f1){return{'model':db[_0x22f5f1['model']],'as':_0x22f5f1['as'],'attributes':_0x22f5f1[_0x9023('0x1c')],'include':_0x22f5f1['include']?_['map'](_0x22f5f1['include'],function(_0x247565){return{'model':db[_0x247565[_0x9023('0x1f')]],'as':_0x247565['as'],'attributes':_0x247565['attributes'],'include':_0x247565['include']?_[_0x9023('0x20')](_0x247565[_0x9023('0x1e')],function(_0x3eebc3){return{'model':db[_0x3eebc3[_0x9023('0x1f')]],'as':_0x3eebc3['as'],'attributes':_0x3eebc3[_0x9023('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9023('0xc')](function(_0x4d3866){logger[_0x9023('0x15')](_0x9023('0x21'),_0x23d79f);logger['debug'](_0x9023('0x21'),_0x23d79f,JSON[_0x9023('0x11')](_0x4d3866));_0x500ae2(_0x4d3866);})[_0x9023('0x17')](function(_0x8fe7b0){logger['error']('ShowSalesforceAccount',_0x8fe7b0['message'],_0x23d79f);_0x28783c(_0x7ecf06[_0x9023('0x12')](0x1f4,_0x8fe7b0[_0x9023('0x14')]));});});};
\ No newline at end of file
+var _0xad21=['attributes','limit','include','map','model','GetSalesforceAccount','catch','ShowSalesforceAccount','SalesforceAccount','find','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','findAll','options','raw','where'];(function(_0xe72686,_0x191da6){var _0xaeee75=function(_0x83fe83){while(--_0x83fe83){_0xe72686['push'](_0xe72686['shift']());}};_0xaeee75(++_0x191da6);}(_0xad21,0x1c4));var _0x1ad2=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0xad21[_0x3ae2b2];return _0x1dbf00;};'use strict';var _=require(_0x1ad2('0x0'));var util=require('util');var moment=require(_0x1ad2('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ad2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ad2('0x3'))['db'];var utils=require(_0x1ad2('0x4'));var logger=require(_0x1ad2('0x5'))(_0x1ad2('0x6'));var config=require(_0x1ad2('0x7'));var jayson=require(_0x1ad2('0x8'));var client=jayson[_0x1ad2('0x9')][_0x1ad2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x346b52,_0x3bfce3,_0x1b7e95){return new BPromise(function(_0x2c9be8,_0x114baf){return client[_0x1ad2('0xb')](_0x346b52,_0x1b7e95)[_0x1ad2('0xc')](function(_0x7ef615){logger[_0x1ad2('0xd')](_0x1ad2('0xe'),_0x3bfce3,_0x1ad2('0xf'));logger[_0x1ad2('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3bfce3,'request\x20sent',JSON[_0x1ad2('0x11')](_0x7ef615));if(_0x7ef615[_0x1ad2('0x12')]){if(_0x7ef615['error']['code']===0x1f4){logger[_0x1ad2('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x3bfce3,_0x7ef615[_0x1ad2('0x12')][_0x1ad2('0x13')]);return _0x114baf(_0x7ef615[_0x1ad2('0x12')][_0x1ad2('0x13')]);}logger[_0x1ad2('0x12')](_0x1ad2('0xe'),_0x3bfce3,_0x7ef615['error']['message']);return _0x2c9be8(_0x7ef615[_0x1ad2('0x12')]['message']);}else{logger[_0x1ad2('0xd')](_0x1ad2('0xe'),_0x3bfce3,_0x1ad2('0xf'));_0x2c9be8(_0x7ef615['result']['message']);}})['catch'](function(_0x4a85b5){logger[_0x1ad2('0x12')](_0x1ad2('0xe'),_0x3bfce3,_0x4a85b5);_0x114baf(_0x4a85b5);});});}exports['GetSalesforceAccount']=function(_0x50631){var _0x48a242=this;return new Promise(function(_0x108e07,_0x509d57){return db['SalesforceAccount'][_0x1ad2('0x14')]({'raw':_0x50631[_0x1ad2('0x15')]?_0x50631[_0x1ad2('0x15')][_0x1ad2('0x16')]===undefined?!![]:![]:!![],'where':_0x50631[_0x1ad2('0x15')]?_0x50631[_0x1ad2('0x15')][_0x1ad2('0x17')]||null:null,'attributes':_0x50631[_0x1ad2('0x15')]?_0x50631[_0x1ad2('0x15')][_0x1ad2('0x18')]||null:null,'limit':_0x50631[_0x1ad2('0x15')]?_0x50631[_0x1ad2('0x15')][_0x1ad2('0x19')]||null:null,'include':_0x50631[_0x1ad2('0x15')]?_0x50631[_0x1ad2('0x15')][_0x1ad2('0x1a')]?_[_0x1ad2('0x1b')](_0x50631['options'][_0x1ad2('0x1a')],function(_0x524903){return{'model':db[_0x524903[_0x1ad2('0x1c')]],'as':_0x524903['as'],'attributes':_0x524903['attributes'],'include':_0x524903[_0x1ad2('0x1a')]?_[_0x1ad2('0x1b')](_0x524903['include'],function(_0x9cc9ff){return{'model':db[_0x9cc9ff[_0x1ad2('0x1c')]],'as':_0x9cc9ff['as'],'attributes':_0x9cc9ff[_0x1ad2('0x18')],'include':_0x9cc9ff[_0x1ad2('0x1a')]?_[_0x1ad2('0x1b')](_0x9cc9ff[_0x1ad2('0x1a')],function(_0x5b8368){return{'model':db[_0x5b8368[_0x1ad2('0x1c')]],'as':_0x5b8368['as'],'attributes':_0x5b8368[_0x1ad2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1ad2('0xc')](function(_0x475d57){logger['info'](_0x1ad2('0x1d'),_0x50631);logger[_0x1ad2('0x10')](_0x1ad2('0x1d'),_0x50631,JSON[_0x1ad2('0x11')](_0x475d57));_0x108e07(_0x475d57);})[_0x1ad2('0x1e')](function(_0x2dded7){logger[_0x1ad2('0x12')](_0x1ad2('0x1d'),_0x2dded7['message'],_0x50631);_0x509d57(_0x48a242[_0x1ad2('0x12')](0x1f4,_0x2dded7[_0x1ad2('0x13')]));});});};exports[_0x1ad2('0x1f')]=function(_0x454140){var _0x14905a=this;return new Promise(function(_0x686eb3,_0xbc86b8){return db[_0x1ad2('0x20')][_0x1ad2('0x21')]({'raw':_0x454140[_0x1ad2('0x15')]?_0x454140[_0x1ad2('0x15')][_0x1ad2('0x16')]===undefined?!![]:![]:!![],'where':_0x454140[_0x1ad2('0x15')]?_0x454140[_0x1ad2('0x15')][_0x1ad2('0x17')]||null:null,'attributes':_0x454140[_0x1ad2('0x15')]?_0x454140[_0x1ad2('0x15')][_0x1ad2('0x18')]||null:null,'include':_0x454140['options']?_0x454140[_0x1ad2('0x15')][_0x1ad2('0x1a')]?_[_0x1ad2('0x1b')](_0x454140[_0x1ad2('0x15')][_0x1ad2('0x1a')],function(_0x4d08a7){return{'model':db[_0x4d08a7[_0x1ad2('0x1c')]],'as':_0x4d08a7['as'],'attributes':_0x4d08a7['attributes'],'include':_0x4d08a7[_0x1ad2('0x1a')]?_[_0x1ad2('0x1b')](_0x4d08a7['include'],function(_0x1fbe68){return{'model':db[_0x1fbe68[_0x1ad2('0x1c')]],'as':_0x1fbe68['as'],'attributes':_0x1fbe68[_0x1ad2('0x18')],'include':_0x1fbe68[_0x1ad2('0x1a')]?_['map'](_0x1fbe68[_0x1ad2('0x1a')],function(_0x358510){return{'model':db[_0x358510[_0x1ad2('0x1c')]],'as':_0x358510['as'],'attributes':_0x358510['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ad2('0xc')](function(_0x33db35){logger[_0x1ad2('0xd')](_0x1ad2('0x1f'),_0x454140);logger[_0x1ad2('0x10')](_0x1ad2('0x1f'),_0x454140,JSON[_0x1ad2('0x11')](_0x33db35));_0x686eb3(_0x33db35);})['catch'](function(_0x40b17c){logger[_0x1ad2('0x12')](_0x1ad2('0x1f'),_0x40b17c[_0x1ad2('0x13')],_0x454140);_0xbc86b8(_0x14905a['error'](0x1f4,_0x40b17c[_0x1ad2('0x13')]));});});};
\ No newline at end of file
index 369b9da..d933a5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xdb28,0x106));var _0x8db2=function(_0x5abce8,_0x51abcf){_0x5abce8=_0x5abce8-0x0;var _0x334868=_0xdb28[_0x5abce8];return _0x334868;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router;
\ No newline at end of file
+var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x26f207,_0x16bbee){var _0x24caed=function(_0x15315e){while(--_0x15315e){_0x26f207['push'](_0x26f207['shift']());}};_0x24caed(++_0x16bbee);}(_0x5f2f,0x73));var _0xf5f2=function(_0x31734a,_0x5d52d6){_0x31734a=_0x31734a-0x0;var _0x3ed11b=_0x5f2f[_0x31734a];return _0x3ed11b;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router;
\ No newline at end of file
index c0ae761..3051406 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0796=['contact','nothing','lead','account','sequelize','exports','STRING','ENUM','Case','Task','contact_lead'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x0796,0x12d));var _0x6079=function(_0x332cc6,_0x514689){_0x332cc6=_0x332cc6-0x0;var _0x2c3c64=_0x0796[_0x332cc6];return _0x2c3c64;};'use strict';var Sequelize=require(_0x6079('0x0'));module[_0x6079('0x1')]={'name':{'type':Sequelize[_0x6079('0x2')]},'description':{'type':Sequelize[_0x6079('0x2')]},'ticketType':{'type':Sequelize[_0x6079('0x3')]('Task',_0x6079('0x4')),'defaultValue':_0x6079('0x5')},'moduleSearch':{'type':Sequelize[_0x6079('0x3')](_0x6079('0x6'),_0x6079('0x7'),'lead','account_contact_lead','account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x6079('0x8'),_0x6079('0x7'),_0x6079('0x9'),_0x6079('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x6079('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x6079('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x6079('0x2')]}};
\ No newline at end of file
+var _0x6005=['Case','ENUM','contact_lead','contact','account','nothing','lead','STRING','exports','Task'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x6005,0xee));var _0x5600=function(_0xa0ab78,_0x4e2391){_0xa0ab78=_0xa0ab78-0x0;var _0x1ce7c5=_0x6005[_0xa0ab78];return _0x1ce7c5;};'use strict';var Sequelize=require('sequelize');module[_0x5600('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x5600('0x1'),_0x5600('0x2')),'defaultValue':_0x5600('0x1')},'moduleSearch':{'type':Sequelize[_0x5600('0x3')](_0x5600('0x4'),_0x5600('0x5'),'lead','account_contact_lead',_0x5600('0x6')),'defaultValue':_0x5600('0x4')},'moduleCreate':{'type':Sequelize[_0x5600('0x3')](_0x5600('0x7'),_0x5600('0x5'),_0x5600('0x8'),'account'),'defaultValue':_0x5600('0x8')},'leadId':{'type':Sequelize[_0x5600('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0x5600('0x9')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x5600('0x9')]}};
\ No newline at end of file
index 653d17e..656c1ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc60d=['bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','Content-Range','reject','save','update','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','type','VIRTUAL','filter','options','then','include','rows','catch','show','params','fields','includeAll','find','create','body','destroy','SalesforceField','getFields','getSubjects','findOne','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x48ecb5,_0x4fe820){var _0x363672=function(_0x499a65){while(--_0x499a65){_0x48ecb5['push'](_0x48ecb5['shift']());}};_0x363672(++_0x4fe820);}(_0xc60d,0x1da));var _0xdc60=function(_0x275a90,_0xa0f3cc){_0x275a90=_0x275a90-0x0;var _0x17b092=_0xc60d[_0x275a90];return _0x17b092;};'use strict';var emlformat=require(_0xdc60('0x0'));var rimraf=require(_0xdc60('0x1'));var zipdir=require(_0xdc60('0x2'));var jsonpatch=require(_0xdc60('0x3'));var rp=require(_0xdc60('0x4'));var moment=require(_0xdc60('0x5'));var BPromise=require(_0xdc60('0x6'));var Mustache=require(_0xdc60('0x7'));var util=require(_0xdc60('0x8'));var path=require(_0xdc60('0x9'));var sox=require(_0xdc60('0xa'));var csv=require(_0xdc60('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc60('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdc60('0xd'));var jsforce=require(_0xdc60('0xe'));var deskjs=require(_0xdc60('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdc60('0x10'));var Papa=require(_0xdc60('0x11'));var Redis=require('ioredis');var authService=require(_0xdc60('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdc60('0x13'));var logger=require(_0xdc60('0x14'))('api');var utils=require(_0xdc60('0x15'));var config=require(_0xdc60('0x16'));var licenseUtil=require(_0xdc60('0x17'));var db=require(_0xdc60('0x18'))['db'];function respondWithStatusCode(_0x39b757,_0x1645d){_0x1645d=_0x1645d||0xcc;return function(_0x140c03){if(_0x140c03){return _0x39b757[_0xdc60('0x19')](_0x1645d);}return _0x39b757[_0xdc60('0x1a')](_0x1645d)[_0xdc60('0x1b')]();};}function respondWithResult(_0x3b001d,_0x4391d4){_0x4391d4=_0x4391d4||0xc8;return function(_0x2e16fa){if(_0x2e16fa){return _0x3b001d['status'](_0x4391d4)[_0xdc60('0x1c')](_0x2e16fa);}};}function respondWithFilteredResult(_0x5310bb,_0x2af39b){return function(_0xc9a185){if(_0xc9a185){var _0x1f453d=typeof _0x2af39b['offset']===_0xdc60('0x1d')&&typeof _0x2af39b[_0xdc60('0x1e')]==='undefined';var _0x3758f1=_0xc9a185['count'];var _0x2ba253=_0x1f453d?0x0:_0x2af39b['offset'];var _0xca8653=_0x1f453d?_0xc9a185['count']:_0x2af39b['offset']+_0x2af39b['limit'];var _0x1ba593;if(_0xca8653>=_0x3758f1){_0xca8653=_0x3758f1;_0x1ba593=0xc8;}else{_0x1ba593=0xce;}_0x5310bb['status'](_0x1ba593);return _0x5310bb['set'](_0xdc60('0x1f'),_0x2ba253+'-'+_0xca8653+'/'+_0x3758f1)[_0xdc60('0x1c')](_0xc9a185);}return null;};}function patchUpdates(_0x44a799){return function(_0x1b32cc){try{jsonpatch['apply'](_0x1b32cc,_0x44a799,!![]);}catch(_0x218d6a){return BPromise[_0xdc60('0x20')](_0x218d6a);}return _0x1b32cc[_0xdc60('0x21')]();};}function saveUpdates(_0x33e3f2,_0x39fff1){return function(_0xef1256){if(_0xef1256){return _0xef1256[_0xdc60('0x22')](_0x33e3f2)['then'](function(_0x49bf1f){return _0x49bf1f;});}return null;};}function removeEntity(_0x16f090,_0x27ae20){return function(_0x2ca715){if(_0x2ca715){return _0x2ca715['destroy']()['then'](function(){_0x16f090[_0xdc60('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eb4ce,_0x537e01){return function(_0x1eff68){if(!_0x1eff68){_0x3eb4ce[_0xdc60('0x19')](0x194);}return _0x1eff68;};}function handleError(_0x4c95bc,_0x34cc8f){_0x34cc8f=_0x34cc8f||0x1f4;return function(_0x3572c9){logger['error'](_0x3572c9[_0xdc60('0x23')]);if(_0x3572c9[_0xdc60('0x24')]){delete _0x3572c9[_0xdc60('0x24')];}_0x4c95bc[_0xdc60('0x1a')](_0x34cc8f)[_0xdc60('0x25')](_0x3572c9);};}exports[_0xdc60('0x26')]=function(_0x411401,_0x382e53){var _0x477c85={},_0x42cee5={},_0xe68a08={'count':0x0,'rows':[]};var _0x15ee69=_[_0xdc60('0x27')](db[_0xdc60('0x28')][_0xdc60('0x29')],function(_0x2e1e64){return{'name':_0x2e1e64[_0xdc60('0x2a')],'type':_0x2e1e64['type'][_0xdc60('0x2b')]};});_0x42cee5[_0xdc60('0x2c')]=_[_0xdc60('0x27')](_0x15ee69,_0xdc60('0x24'));_0x42cee5['query']=_[_0xdc60('0x2d')](_0x411401['query']);_0x42cee5[_0xdc60('0x2e')]=_[_0xdc60('0x2f')](_0x42cee5[_0xdc60('0x2c')],_0x42cee5[_0xdc60('0x30')]);_0x477c85[_0xdc60('0x31')]=_[_0xdc60('0x2f')](_0x42cee5['model'],qs['fields'](_0x411401['query']['fields']));_0x477c85[_0xdc60('0x31')]=_0x477c85[_0xdc60('0x31')][_0xdc60('0x32')]?_0x477c85['attributes']:_0x42cee5[_0xdc60('0x2c')];if(!_0x411401[_0xdc60('0x30')][_0xdc60('0x33')](_0xdc60('0x34'))){_0x477c85[_0xdc60('0x1e')]=qs[_0xdc60('0x1e')](_0x411401[_0xdc60('0x30')][_0xdc60('0x1e')]);_0x477c85[_0xdc60('0x35')]=qs[_0xdc60('0x35')](_0x411401[_0xdc60('0x30')][_0xdc60('0x35')]);}_0x477c85['order']=qs[_0xdc60('0x36')](_0x411401[_0xdc60('0x30')][_0xdc60('0x36')]);_0x477c85[_0xdc60('0x37')]=qs[_0xdc60('0x2e')](_[_0xdc60('0x38')](_0x411401[_0xdc60('0x30')],_0x42cee5[_0xdc60('0x2e')]),_0x15ee69);if(_0x411401[_0xdc60('0x30')]['filter']){_0x477c85[_0xdc60('0x37')]=_[_0xdc60('0x39')](_0x477c85['where'],{'$or':_[_0xdc60('0x27')](_0x15ee69,function(_0x2d32f5){if(_0x2d32f5[_0xdc60('0x3a')]!==_0xdc60('0x3b')){var _0x21e09d={};_0x21e09d[_0x2d32f5[_0xdc60('0x24')]]={'$like':'%'+_0x411401[_0xdc60('0x30')][_0xdc60('0x3c')]+'%'};return _0x21e09d;}})});}_0x477c85=_[_0xdc60('0x39')]({},_0x477c85,_0x411401[_0xdc60('0x3d')]);var _0x553ba9={'where':_0x477c85[_0xdc60('0x37')]};return db['SalesforceConfiguration']['count'](_0x553ba9)[_0xdc60('0x3e')](function(_0x46ac3a){_0xe68a08['count']=_0x46ac3a;if(_0x411401[_0xdc60('0x30')]['includeAll']){_0x477c85[_0xdc60('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x477c85);})[_0xdc60('0x3e')](function(_0x457968){_0xe68a08[_0xdc60('0x40')]=_0x457968;return _0xe68a08;})[_0xdc60('0x3e')](respondWithFilteredResult(_0x382e53,_0x477c85))[_0xdc60('0x41')](handleError(_0x382e53,null));};exports[_0xdc60('0x42')]=function(_0x2c53a6,_0x65dfb1){var _0x295ff9={'raw':![],'where':{'id':_0x2c53a6[_0xdc60('0x43')]['id']}},_0x4d36ab={};_0x4d36ab[_0xdc60('0x2c')]=_[_0xdc60('0x2d')](db['SalesforceConfiguration'][_0xdc60('0x29')]);_0x4d36ab[_0xdc60('0x30')]=_[_0xdc60('0x2d')](_0x2c53a6['query']);_0x4d36ab[_0xdc60('0x2e')]=_['intersection'](_0x4d36ab['model'],_0x4d36ab['query']);_0x295ff9[_0xdc60('0x31')]=_['intersection'](_0x4d36ab[_0xdc60('0x2c')],qs['fields'](_0x2c53a6[_0xdc60('0x30')][_0xdc60('0x44')]));_0x295ff9[_0xdc60('0x31')]=_0x295ff9['attributes'][_0xdc60('0x32')]?_0x295ff9[_0xdc60('0x31')]:_0x4d36ab['model'];if(_0x2c53a6['query'][_0xdc60('0x45')]){_0x295ff9[_0xdc60('0x3f')]=[{'all':!![]}];}_0x295ff9=_[_0xdc60('0x39')]({},_0x295ff9,_0x2c53a6[_0xdc60('0x3d')]);return db[_0xdc60('0x28')][_0xdc60('0x46')](_0x295ff9)[_0xdc60('0x3e')](handleEntityNotFound(_0x65dfb1,null))[_0xdc60('0x3e')](respondWithResult(_0x65dfb1,null))[_0xdc60('0x41')](handleError(_0x65dfb1,null));};exports[_0xdc60('0x47')]=function(_0x3016a9,_0x35c315){return db['SalesforceConfiguration'][_0xdc60('0x47')](_0x3016a9['body'],{})[_0xdc60('0x3e')](respondWithResult(_0x35c315,0xc9))[_0xdc60('0x41')](handleError(_0x35c315,null));};exports[_0xdc60('0x22')]=function(_0x1dae9d,_0x27b340){if(_0x1dae9d[_0xdc60('0x48')]['id']){delete _0x1dae9d['body']['id'];}return db[_0xdc60('0x28')][_0xdc60('0x46')]({'where':{'id':_0x1dae9d[_0xdc60('0x43')]['id']}})['then'](handleEntityNotFound(_0x27b340,null))[_0xdc60('0x3e')](saveUpdates(_0x1dae9d[_0xdc60('0x48')],null))[_0xdc60('0x3e')](respondWithResult(_0x27b340,null))[_0xdc60('0x41')](handleError(_0x27b340,null));};exports[_0xdc60('0x49')]=function(_0x579988,_0x19e322){return db[_0xdc60('0x28')][_0xdc60('0x46')]({'where':{'id':_0x579988[_0xdc60('0x43')]['id']}})[_0xdc60('0x3e')](handleEntityNotFound(_0x19e322,null))[_0xdc60('0x3e')](removeEntity(_0x19e322,null))[_0xdc60('0x41')](handleError(_0x19e322,null));};exports['getFields']=function(_0x227493,_0x36dae7,_0x1a56fb){var _0x558084={};var _0x5a44c7={};var _0x285d78;var _0x41fe84;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x227493[_0xdc60('0x43')]['id']}})[_0xdc60('0x3e')](handleEntityNotFound(_0x36dae7,null))[_0xdc60('0x3e')](function(_0x1becd2){if(_0x1becd2){_0x285d78=_0x1becd2;_0x5a44c7[_0xdc60('0x2c')]=_[_0xdc60('0x2d')](db[_0xdc60('0x4a')]['rawAttributes']);_0x5a44c7['query']=_[_0xdc60('0x2d')](_0x227493['query']);_0x5a44c7[_0xdc60('0x2e')]=_[_0xdc60('0x2f')](_0x5a44c7[_0xdc60('0x2c')],_0x5a44c7[_0xdc60('0x30')]);_0x558084[_0xdc60('0x31')]=_[_0xdc60('0x2f')](_0x5a44c7[_0xdc60('0x2c')],qs[_0xdc60('0x44')](_0x227493[_0xdc60('0x30')][_0xdc60('0x44')]));_0x558084[_0xdc60('0x31')]=_0x558084[_0xdc60('0x31')][_0xdc60('0x32')]?_0x558084[_0xdc60('0x31')]:_0x5a44c7[_0xdc60('0x2c')];_0x558084['order']=qs[_0xdc60('0x36')](_0x227493[_0xdc60('0x30')][_0xdc60('0x36')]);_0x558084[_0xdc60('0x37')]=qs[_0xdc60('0x2e')](_[_0xdc60('0x38')](_0x227493['query'],_0x5a44c7[_0xdc60('0x2e')]));if(_0x227493[_0xdc60('0x30')][_0xdc60('0x3c')]){_0x558084['where']=_[_0xdc60('0x39')](_0x558084[_0xdc60('0x37')],{'$or':_['map'](_0x558084[_0xdc60('0x31')],function(_0xfa3cfa){var _0x40fbc9={};_0x40fbc9[_0xfa3cfa]={'$like':'%'+_0x227493[_0xdc60('0x30')][_0xdc60('0x3c')]+'%'};return _0x40fbc9;})});}_0x558084=_['merge']({},_0x558084,_0x227493[_0xdc60('0x3d')]);return _0x285d78[_0xdc60('0x4b')](_0x558084);}})['then'](function(_0x1ca1b2){if(_0x1ca1b2){_0x41fe84=_0x1ca1b2[_0xdc60('0x32')];if(!_0x227493[_0xdc60('0x30')][_0xdc60('0x33')](_0xdc60('0x34'))){_0x558084[_0xdc60('0x1e')]=qs[_0xdc60('0x1e')](_0x227493[_0xdc60('0x30')][_0xdc60('0x1e')]);_0x558084[_0xdc60('0x35')]=qs[_0xdc60('0x35')](_0x227493[_0xdc60('0x30')][_0xdc60('0x35')]);}return _0x285d78['getFields'](_0x558084);}})[_0xdc60('0x3e')](function(_0x5434c4){if(_0x5434c4){return _0x5434c4?{'count':_0x41fe84,'rows':_0x5434c4}:null;}})[_0xdc60('0x3e')](respondWithResult(_0x36dae7,null))['catch'](handleError(_0x36dae7,null));};exports[_0xdc60('0x4c')]=function(_0xf1221d,_0x562013,_0x557f17){var _0x4d01b9={};var _0x2fdc2a={};var _0x5530e2;var _0x10ec6f;return db[_0xdc60('0x28')][_0xdc60('0x4d')]({'where':{'id':_0xf1221d[_0xdc60('0x43')]['id']}})[_0xdc60('0x3e')](handleEntityNotFound(_0x562013,null))[_0xdc60('0x3e')](function(_0x142dbe){if(_0x142dbe){_0x5530e2=_0x142dbe;_0x2fdc2a[_0xdc60('0x2c')]=_[_0xdc60('0x2d')](db[_0xdc60('0x4a')][_0xdc60('0x29')]);_0x2fdc2a[_0xdc60('0x30')]=_[_0xdc60('0x2d')](_0xf1221d[_0xdc60('0x30')]);_0x2fdc2a[_0xdc60('0x2e')]=_[_0xdc60('0x2f')](_0x2fdc2a[_0xdc60('0x2c')],_0x2fdc2a[_0xdc60('0x30')]);_0x4d01b9[_0xdc60('0x31')]=_[_0xdc60('0x2f')](_0x2fdc2a[_0xdc60('0x2c')],qs[_0xdc60('0x44')](_0xf1221d[_0xdc60('0x30')]['fields']));_0x4d01b9[_0xdc60('0x31')]=_0x4d01b9[_0xdc60('0x31')][_0xdc60('0x32')]?_0x4d01b9[_0xdc60('0x31')]:_0x2fdc2a[_0xdc60('0x2c')];_0x4d01b9[_0xdc60('0x4e')]=qs[_0xdc60('0x36')](_0xf1221d['query'][_0xdc60('0x36')]);_0x4d01b9[_0xdc60('0x37')]=qs['filters'](_[_0xdc60('0x38')](_0xf1221d[_0xdc60('0x30')],_0x2fdc2a['filters']));if(_0xf1221d[_0xdc60('0x30')]['filter']){_0x4d01b9[_0xdc60('0x37')]=_['merge'](_0x4d01b9[_0xdc60('0x37')],{'$or':_[_0xdc60('0x27')](_0x4d01b9[_0xdc60('0x31')],function(_0x59ef4e){var _0x24fa44={};_0x24fa44[_0x59ef4e]={'$like':'%'+_0xf1221d[_0xdc60('0x30')][_0xdc60('0x3c')]+'%'};return _0x24fa44;})});}_0x4d01b9=_[_0xdc60('0x39')]({},_0x4d01b9,_0xf1221d['options']);return _0x5530e2['getSubjects'](_0x4d01b9);}})[_0xdc60('0x3e')](function(_0x7648c){if(_0x7648c){_0x10ec6f=_0x7648c[_0xdc60('0x32')];if(!_0xf1221d[_0xdc60('0x30')]['hasOwnProperty']('nolimit')){_0x4d01b9[_0xdc60('0x1e')]=qs[_0xdc60('0x1e')](_0xf1221d[_0xdc60('0x30')][_0xdc60('0x1e')]);_0x4d01b9[_0xdc60('0x35')]=qs[_0xdc60('0x35')](_0xf1221d[_0xdc60('0x30')][_0xdc60('0x35')]);}return _0x5530e2[_0xdc60('0x4c')](_0x4d01b9);}})[_0xdc60('0x3e')](function(_0x59c743){if(_0x59c743){return _0x59c743?{'count':_0x10ec6f,'rows':_0x59c743}:null;}})[_0xdc60('0x3e')](respondWithResult(_0x562013,null))[_0xdc60('0x41')](handleError(_0x562013,null));};exports[_0xdc60('0x4f')]=function(_0x5bc0ac,_0x192fce,_0x5ee2ab){var _0x3f7a8f={};var _0x1246d3={};var _0x21e562;var _0x33cd22;return db[_0xdc60('0x28')][_0xdc60('0x4d')]({'where':{'id':_0x5bc0ac['params']['id']}})[_0xdc60('0x3e')](handleEntityNotFound(_0x192fce,null))['then'](function(_0x3ac13e){if(_0x3ac13e){_0x21e562=_0x3ac13e;_0x1246d3['model']=_[_0xdc60('0x2d')](db[_0xdc60('0x4a')]['rawAttributes']);_0x1246d3[_0xdc60('0x30')]=_[_0xdc60('0x2d')](_0x5bc0ac[_0xdc60('0x30')]);_0x1246d3[_0xdc60('0x2e')]=_['intersection'](_0x1246d3[_0xdc60('0x2c')],_0x1246d3[_0xdc60('0x30')]);_0x3f7a8f[_0xdc60('0x31')]=_['intersection'](_0x1246d3[_0xdc60('0x2c')],qs[_0xdc60('0x44')](_0x5bc0ac[_0xdc60('0x30')][_0xdc60('0x44')]));_0x3f7a8f[_0xdc60('0x31')]=_0x3f7a8f['attributes']['length']?_0x3f7a8f[_0xdc60('0x31')]:_0x1246d3[_0xdc60('0x2c')];_0x3f7a8f[_0xdc60('0x4e')]=qs[_0xdc60('0x36')](_0x5bc0ac['query']['sort']);_0x3f7a8f[_0xdc60('0x37')]=qs[_0xdc60('0x2e')](_[_0xdc60('0x38')](_0x5bc0ac[_0xdc60('0x30')],_0x1246d3[_0xdc60('0x2e')]));if(_0x5bc0ac[_0xdc60('0x30')]['filter']){_0x3f7a8f['where']=_[_0xdc60('0x39')](_0x3f7a8f[_0xdc60('0x37')],{'$or':_[_0xdc60('0x27')](_0x3f7a8f[_0xdc60('0x31')],function(_0x1c4bae){var _0x35588f={};_0x35588f[_0x1c4bae]={'$like':'%'+_0x5bc0ac[_0xdc60('0x30')]['filter']+'%'};return _0x35588f;})});}_0x3f7a8f=_['merge']({},_0x3f7a8f,_0x5bc0ac['options']);return _0x21e562[_0xdc60('0x4f')](_0x3f7a8f);}})[_0xdc60('0x3e')](function(_0x14e237){if(_0x14e237){_0x33cd22=_0x14e237[_0xdc60('0x32')];if(!_0x5bc0ac[_0xdc60('0x30')][_0xdc60('0x33')](_0xdc60('0x34'))){_0x3f7a8f['limit']=qs[_0xdc60('0x1e')](_0x5bc0ac['query'][_0xdc60('0x1e')]);_0x3f7a8f[_0xdc60('0x35')]=qs[_0xdc60('0x35')](_0x5bc0ac[_0xdc60('0x30')]['offset']);}return _0x21e562[_0xdc60('0x4f')](_0x3f7a8f);}})[_0xdc60('0x3e')](function(_0x5d053b){if(_0x5d053b){return _0x5d053b?{'count':_0x33cd22,'rows':_0x5d053b}:null;}})[_0xdc60('0x3e')](respondWithResult(_0x192fce,null))['catch'](handleError(_0x192fce,null));};
\ No newline at end of file
+var _0x9e42=['findAll','rows','catch','params','keys','find','create','body','getFields','findOne','SalesforceField','order','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0x9e42,0x157));var _0x29e4=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0x9e42[_0x45c981];return _0x4f62c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29e4('0x0'));var zipdir=require(_0x29e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29e4('0x2'));var moment=require(_0x29e4('0x3'));var BPromise=require(_0x29e4('0x4'));var Mustache=require(_0x29e4('0x5'));var util=require(_0x29e4('0x6'));var path=require(_0x29e4('0x7'));var sox=require(_0x29e4('0x8'));var csv=require(_0x29e4('0x9'));var ejs=require(_0x29e4('0xa'));var fs=require('fs');var fs_extra=require(_0x29e4('0xb'));var _=require(_0x29e4('0xc'));var squel=require(_0x29e4('0xd'));var crypto=require(_0x29e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x29e4('0xf'));var toCsv=require(_0x29e4('0x9'));var querystring=require(_0x29e4('0x10'));var Papa=require(_0x29e4('0x11'));var Redis=require('ioredis');var authService=require(_0x29e4('0x12'));var qs=require(_0x29e4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29e4('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x29e4('0x15'));var db=require(_0x29e4('0x16'))['db'];function respondWithStatusCode(_0x4e849d,_0x535cea){_0x535cea=_0x535cea||0xcc;return function(_0x1c5103){if(_0x1c5103){return _0x4e849d[_0x29e4('0x17')](_0x535cea);}return _0x4e849d[_0x29e4('0x18')](_0x535cea)['end']();};}function respondWithResult(_0x1fee85,_0x60965d){_0x60965d=_0x60965d||0xc8;return function(_0x1dd55a){if(_0x1dd55a){return _0x1fee85[_0x29e4('0x18')](_0x60965d)[_0x29e4('0x19')](_0x1dd55a);}};}function respondWithFilteredResult(_0x5a53d1,_0x19f66b){return function(_0x5c3ff9){if(_0x5c3ff9){var _0x137356=typeof _0x19f66b[_0x29e4('0x1a')]===_0x29e4('0x1b')&&typeof _0x19f66b['limit']==='undefined';var _0xb1a74b=_0x5c3ff9[_0x29e4('0x1c')];var _0x1191af=_0x137356?0x0:_0x19f66b['offset'];var _0x4adf8c=_0x137356?_0x5c3ff9['count']:_0x19f66b[_0x29e4('0x1a')]+_0x19f66b[_0x29e4('0x1d')];var _0x470293;if(_0x4adf8c>=_0xb1a74b){_0x4adf8c=_0xb1a74b;_0x470293=0xc8;}else{_0x470293=0xce;}_0x5a53d1[_0x29e4('0x18')](_0x470293);return _0x5a53d1[_0x29e4('0x1e')](_0x29e4('0x1f'),_0x1191af+'-'+_0x4adf8c+'/'+_0xb1a74b)[_0x29e4('0x19')](_0x5c3ff9);}return null;};}function patchUpdates(_0x1919b8){return function(_0x1edee1){try{jsonpatch[_0x29e4('0x20')](_0x1edee1,_0x1919b8,!![]);}catch(_0x1cdd1c){return BPromise[_0x29e4('0x21')](_0x1cdd1c);}return _0x1edee1[_0x29e4('0x22')]();};}function saveUpdates(_0x276be1,_0x1c8c82){return function(_0x346d59){if(_0x346d59){return _0x346d59[_0x29e4('0x23')](_0x276be1)[_0x29e4('0x24')](function(_0x1db74a){return _0x1db74a;});}return null;};}function removeEntity(_0x32ff33,_0x19b023){return function(_0xb1f507){if(_0xb1f507){return _0xb1f507[_0x29e4('0x25')]()[_0x29e4('0x24')](function(){_0x32ff33[_0x29e4('0x18')](0xcc)[_0x29e4('0x26')]();});}};}function handleEntityNotFound(_0x57011b,_0x19bdcd){return function(_0x21496d){if(!_0x21496d){_0x57011b['sendStatus'](0x194);}return _0x21496d;};}function handleError(_0x411730,_0x2cda53){_0x2cda53=_0x2cda53||0x1f4;return function(_0x556925){logger[_0x29e4('0x27')](_0x556925[_0x29e4('0x28')]);if(_0x556925[_0x29e4('0x29')]){delete _0x556925[_0x29e4('0x29')];}_0x411730['status'](_0x2cda53)[_0x29e4('0x2a')](_0x556925);};}exports[_0x29e4('0x2b')]=function(_0x277444,_0x363551){var _0x36a53a={},_0x323d47={},_0x18222f={'count':0x0,'rows':[]};var _0x2c4c36=_[_0x29e4('0x2c')](db[_0x29e4('0x2d')][_0x29e4('0x2e')],function(_0x1b5322){return{'name':_0x1b5322[_0x29e4('0x2f')],'type':_0x1b5322[_0x29e4('0x30')][_0x29e4('0x31')]};});_0x323d47[_0x29e4('0x32')]=_[_0x29e4('0x2c')](_0x2c4c36,_0x29e4('0x29'));_0x323d47[_0x29e4('0x33')]=_['keys'](_0x277444[_0x29e4('0x33')]);_0x323d47[_0x29e4('0x34')]=_[_0x29e4('0x35')](_0x323d47[_0x29e4('0x32')],_0x323d47[_0x29e4('0x33')]);_0x36a53a['attributes']=_[_0x29e4('0x35')](_0x323d47['model'],qs[_0x29e4('0x36')](_0x277444[_0x29e4('0x33')][_0x29e4('0x36')]));_0x36a53a[_0x29e4('0x37')]=_0x36a53a['attributes'][_0x29e4('0x38')]?_0x36a53a['attributes']:_0x323d47[_0x29e4('0x32')];if(!_0x277444[_0x29e4('0x33')][_0x29e4('0x39')]('nolimit')){_0x36a53a[_0x29e4('0x1d')]=qs[_0x29e4('0x1d')](_0x277444['query'][_0x29e4('0x1d')]);_0x36a53a[_0x29e4('0x1a')]=qs[_0x29e4('0x1a')](_0x277444[_0x29e4('0x33')][_0x29e4('0x1a')]);}_0x36a53a['order']=qs[_0x29e4('0x3a')](_0x277444[_0x29e4('0x33')][_0x29e4('0x3a')]);_0x36a53a[_0x29e4('0x3b')]=qs['filters'](_[_0x29e4('0x3c')](_0x277444[_0x29e4('0x33')],_0x323d47[_0x29e4('0x34')]),_0x2c4c36);if(_0x277444[_0x29e4('0x33')][_0x29e4('0x3d')]){_0x36a53a[_0x29e4('0x3b')]=_[_0x29e4('0x3e')](_0x36a53a[_0x29e4('0x3b')],{'$or':_[_0x29e4('0x2c')](_0x2c4c36,function(_0x1d00b6){if(_0x1d00b6[_0x29e4('0x30')]!==_0x29e4('0x3f')){var _0x38e1aa={};_0x38e1aa[_0x1d00b6['name']]={'$like':'%'+_0x277444['query']['filter']+'%'};return _0x38e1aa;}})});}_0x36a53a=_[_0x29e4('0x3e')]({},_0x36a53a,_0x277444[_0x29e4('0x40')]);var _0x4b6605={'where':_0x36a53a[_0x29e4('0x3b')]};return db[_0x29e4('0x2d')][_0x29e4('0x1c')](_0x4b6605)[_0x29e4('0x24')](function(_0x3cc1cd){_0x18222f[_0x29e4('0x1c')]=_0x3cc1cd;if(_0x277444[_0x29e4('0x33')][_0x29e4('0x41')]){_0x36a53a[_0x29e4('0x42')]=[{'all':!![]}];}return db[_0x29e4('0x2d')][_0x29e4('0x43')](_0x36a53a);})[_0x29e4('0x24')](function(_0x1e89ca){_0x18222f[_0x29e4('0x44')]=_0x1e89ca;return _0x18222f;})[_0x29e4('0x24')](respondWithFilteredResult(_0x363551,_0x36a53a))[_0x29e4('0x45')](handleError(_0x363551,null));};exports['show']=function(_0x39ff6b,_0x5db707){var _0x2d5ad2={'raw':![],'where':{'id':_0x39ff6b[_0x29e4('0x46')]['id']}},_0x4ecf86={};_0x4ecf86[_0x29e4('0x32')]=_[_0x29e4('0x47')](db['SalesforceConfiguration']['rawAttributes']);_0x4ecf86[_0x29e4('0x33')]=_[_0x29e4('0x47')](_0x39ff6b[_0x29e4('0x33')]);_0x4ecf86[_0x29e4('0x34')]=_[_0x29e4('0x35')](_0x4ecf86[_0x29e4('0x32')],_0x4ecf86['query']);_0x2d5ad2['attributes']=_[_0x29e4('0x35')](_0x4ecf86[_0x29e4('0x32')],qs[_0x29e4('0x36')](_0x39ff6b['query']['fields']));_0x2d5ad2['attributes']=_0x2d5ad2['attributes'][_0x29e4('0x38')]?_0x2d5ad2[_0x29e4('0x37')]:_0x4ecf86[_0x29e4('0x32')];if(_0x39ff6b[_0x29e4('0x33')]['includeAll']){_0x2d5ad2['include']=[{'all':!![]}];}_0x2d5ad2=_['merge']({},_0x2d5ad2,_0x39ff6b['options']);return db[_0x29e4('0x2d')][_0x29e4('0x48')](_0x2d5ad2)[_0x29e4('0x24')](handleEntityNotFound(_0x5db707,null))[_0x29e4('0x24')](respondWithResult(_0x5db707,null))[_0x29e4('0x45')](handleError(_0x5db707,null));};exports[_0x29e4('0x49')]=function(_0x3207e4,_0x526422){return db[_0x29e4('0x2d')][_0x29e4('0x49')](_0x3207e4[_0x29e4('0x4a')],{})[_0x29e4('0x24')](respondWithResult(_0x526422,0xc9))[_0x29e4('0x45')](handleError(_0x526422,null));};exports[_0x29e4('0x23')]=function(_0x21321e,_0x29b0d5){if(_0x21321e[_0x29e4('0x4a')]['id']){delete _0x21321e['body']['id'];}return db[_0x29e4('0x2d')][_0x29e4('0x48')]({'where':{'id':_0x21321e[_0x29e4('0x46')]['id']}})['then'](handleEntityNotFound(_0x29b0d5,null))[_0x29e4('0x24')](saveUpdates(_0x21321e[_0x29e4('0x4a')],null))[_0x29e4('0x24')](respondWithResult(_0x29b0d5,null))[_0x29e4('0x45')](handleError(_0x29b0d5,null));};exports[_0x29e4('0x25')]=function(_0x31339e,_0x55b2f5){return db[_0x29e4('0x2d')][_0x29e4('0x48')]({'where':{'id':_0x31339e['params']['id']}})[_0x29e4('0x24')](handleEntityNotFound(_0x55b2f5,null))['then'](removeEntity(_0x55b2f5,null))['catch'](handleError(_0x55b2f5,null));};exports[_0x29e4('0x4b')]=function(_0x5e94f6,_0x4bda9e,_0x575088){var _0x28578e={};var _0x4e414d={};var _0x5acee8;var _0x20c877;return db[_0x29e4('0x2d')][_0x29e4('0x4c')]({'where':{'id':_0x5e94f6[_0x29e4('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bda9e,null))[_0x29e4('0x24')](function(_0x4fec0b){if(_0x4fec0b){_0x5acee8=_0x4fec0b;_0x4e414d[_0x29e4('0x32')]=_[_0x29e4('0x47')](db[_0x29e4('0x4d')][_0x29e4('0x2e')]);_0x4e414d[_0x29e4('0x33')]=_[_0x29e4('0x47')](_0x5e94f6[_0x29e4('0x33')]);_0x4e414d['filters']=_[_0x29e4('0x35')](_0x4e414d[_0x29e4('0x32')],_0x4e414d[_0x29e4('0x33')]);_0x28578e[_0x29e4('0x37')]=_[_0x29e4('0x35')](_0x4e414d[_0x29e4('0x32')],qs[_0x29e4('0x36')](_0x5e94f6['query'][_0x29e4('0x36')]));_0x28578e['attributes']=_0x28578e[_0x29e4('0x37')][_0x29e4('0x38')]?_0x28578e[_0x29e4('0x37')]:_0x4e414d[_0x29e4('0x32')];_0x28578e[_0x29e4('0x4e')]=qs['sort'](_0x5e94f6['query'][_0x29e4('0x3a')]);_0x28578e['where']=qs[_0x29e4('0x34')](_['pick'](_0x5e94f6['query'],_0x4e414d['filters']));if(_0x5e94f6['query'][_0x29e4('0x3d')]){_0x28578e[_0x29e4('0x3b')]=_[_0x29e4('0x3e')](_0x28578e[_0x29e4('0x3b')],{'$or':_[_0x29e4('0x2c')](_0x28578e['attributes'],function(_0x50a6af){var _0x3d8a4a={};_0x3d8a4a[_0x50a6af]={'$like':'%'+_0x5e94f6['query']['filter']+'%'};return _0x3d8a4a;})});}_0x28578e=_[_0x29e4('0x3e')]({},_0x28578e,_0x5e94f6['options']);return _0x5acee8[_0x29e4('0x4b')](_0x28578e);}})['then'](function(_0x389fe9){if(_0x389fe9){_0x20c877=_0x389fe9['length'];if(!_0x5e94f6['query']['hasOwnProperty'](_0x29e4('0x4f'))){_0x28578e[_0x29e4('0x1d')]=qs[_0x29e4('0x1d')](_0x5e94f6[_0x29e4('0x33')][_0x29e4('0x1d')]);_0x28578e[_0x29e4('0x1a')]=qs[_0x29e4('0x1a')](_0x5e94f6['query'][_0x29e4('0x1a')]);}return _0x5acee8['getFields'](_0x28578e);}})['then'](function(_0x1de22f){if(_0x1de22f){return _0x1de22f?{'count':_0x20c877,'rows':_0x1de22f}:null;}})[_0x29e4('0x24')](respondWithResult(_0x4bda9e,null))[_0x29e4('0x45')](handleError(_0x4bda9e,null));};exports[_0x29e4('0x50')]=function(_0x3b0177,_0x836963,_0x43eb98){var _0x1f9255={};var _0x15dc5b={};var _0x24e14b;var _0x3ded43;return db[_0x29e4('0x2d')]['findOne']({'where':{'id':_0x3b0177[_0x29e4('0x46')]['id']}})['then'](handleEntityNotFound(_0x836963,null))['then'](function(_0x3c4ef8){if(_0x3c4ef8){_0x24e14b=_0x3c4ef8;_0x15dc5b[_0x29e4('0x32')]=_[_0x29e4('0x47')](db['SalesforceField'][_0x29e4('0x2e')]);_0x15dc5b[_0x29e4('0x33')]=_[_0x29e4('0x47')](_0x3b0177[_0x29e4('0x33')]);_0x15dc5b['filters']=_['intersection'](_0x15dc5b[_0x29e4('0x32')],_0x15dc5b[_0x29e4('0x33')]);_0x1f9255['attributes']=_[_0x29e4('0x35')](_0x15dc5b['model'],qs[_0x29e4('0x36')](_0x3b0177[_0x29e4('0x33')][_0x29e4('0x36')]));_0x1f9255[_0x29e4('0x37')]=_0x1f9255[_0x29e4('0x37')]['length']?_0x1f9255[_0x29e4('0x37')]:_0x15dc5b['model'];_0x1f9255[_0x29e4('0x4e')]=qs[_0x29e4('0x3a')](_0x3b0177['query'][_0x29e4('0x3a')]);_0x1f9255[_0x29e4('0x3b')]=qs[_0x29e4('0x34')](_['pick'](_0x3b0177[_0x29e4('0x33')],_0x15dc5b[_0x29e4('0x34')]));if(_0x3b0177[_0x29e4('0x33')][_0x29e4('0x3d')]){_0x1f9255[_0x29e4('0x3b')]=_['merge'](_0x1f9255[_0x29e4('0x3b')],{'$or':_[_0x29e4('0x2c')](_0x1f9255['attributes'],function(_0x6a49d2){var _0x237ffa={};_0x237ffa[_0x6a49d2]={'$like':'%'+_0x3b0177[_0x29e4('0x33')][_0x29e4('0x3d')]+'%'};return _0x237ffa;})});}_0x1f9255=_['merge']({},_0x1f9255,_0x3b0177['options']);return _0x24e14b[_0x29e4('0x50')](_0x1f9255);}})[_0x29e4('0x24')](function(_0x4d311b){if(_0x4d311b){_0x3ded43=_0x4d311b[_0x29e4('0x38')];if(!_0x3b0177[_0x29e4('0x33')][_0x29e4('0x39')](_0x29e4('0x4f'))){_0x1f9255[_0x29e4('0x1d')]=qs[_0x29e4('0x1d')](_0x3b0177['query'][_0x29e4('0x1d')]);_0x1f9255[_0x29e4('0x1a')]=qs['offset'](_0x3b0177[_0x29e4('0x33')][_0x29e4('0x1a')]);}return _0x24e14b[_0x29e4('0x50')](_0x1f9255);}})['then'](function(_0x1116ba){if(_0x1116ba){return _0x1116ba?{'count':_0x3ded43,'rows':_0x1116ba}:null;}})[_0x29e4('0x24')](respondWithResult(_0x836963,null))[_0x29e4('0x45')](handleError(_0x836963,null));};exports[_0x29e4('0x51')]=function(_0x56d0f5,_0x1017bd,_0x1ce8fa){var _0x42c5aa={};var _0x231d8a={};var _0x2a1352;var _0x16799d;return db[_0x29e4('0x2d')][_0x29e4('0x4c')]({'where':{'id':_0x56d0f5[_0x29e4('0x46')]['id']}})['then'](handleEntityNotFound(_0x1017bd,null))['then'](function(_0x52c5b6){if(_0x52c5b6){_0x2a1352=_0x52c5b6;_0x231d8a[_0x29e4('0x32')]=_[_0x29e4('0x47')](db['SalesforceField'][_0x29e4('0x2e')]);_0x231d8a[_0x29e4('0x33')]=_['keys'](_0x56d0f5[_0x29e4('0x33')]);_0x231d8a['filters']=_[_0x29e4('0x35')](_0x231d8a[_0x29e4('0x32')],_0x231d8a[_0x29e4('0x33')]);_0x42c5aa['attributes']=_[_0x29e4('0x35')](_0x231d8a['model'],qs[_0x29e4('0x36')](_0x56d0f5[_0x29e4('0x33')][_0x29e4('0x36')]));_0x42c5aa[_0x29e4('0x37')]=_0x42c5aa[_0x29e4('0x37')][_0x29e4('0x38')]?_0x42c5aa[_0x29e4('0x37')]:_0x231d8a[_0x29e4('0x32')];_0x42c5aa[_0x29e4('0x4e')]=qs[_0x29e4('0x3a')](_0x56d0f5[_0x29e4('0x33')]['sort']);_0x42c5aa[_0x29e4('0x3b')]=qs['filters'](_[_0x29e4('0x3c')](_0x56d0f5['query'],_0x231d8a[_0x29e4('0x34')]));if(_0x56d0f5[_0x29e4('0x33')][_0x29e4('0x3d')]){_0x42c5aa['where']=_[_0x29e4('0x3e')](_0x42c5aa['where'],{'$or':_[_0x29e4('0x2c')](_0x42c5aa[_0x29e4('0x37')],function(_0x39d20e){var _0x350971={};_0x350971[_0x39d20e]={'$like':'%'+_0x56d0f5[_0x29e4('0x33')][_0x29e4('0x3d')]+'%'};return _0x350971;})});}_0x42c5aa=_[_0x29e4('0x3e')]({},_0x42c5aa,_0x56d0f5[_0x29e4('0x40')]);return _0x2a1352[_0x29e4('0x51')](_0x42c5aa);}})[_0x29e4('0x24')](function(_0x272364){if(_0x272364){_0x16799d=_0x272364[_0x29e4('0x38')];if(!_0x56d0f5[_0x29e4('0x33')][_0x29e4('0x39')]('nolimit')){_0x42c5aa[_0x29e4('0x1d')]=qs[_0x29e4('0x1d')](_0x56d0f5[_0x29e4('0x33')][_0x29e4('0x1d')]);_0x42c5aa[_0x29e4('0x1a')]=qs[_0x29e4('0x1a')](_0x56d0f5[_0x29e4('0x33')][_0x29e4('0x1a')]);}return _0x2a1352['getDescriptions'](_0x42c5aa);}})[_0x29e4('0x24')](function(_0x55e666){if(_0x55e666){return _0x55e666?{'count':_0x16799d,'rows':_0x55e666}:null;}})[_0x29e4('0x24')](respondWithResult(_0x1017bd,null))[_0x29e4('0x45')](handleError(_0x1017bd,null));};
\ No newline at end of file
index 6c8f2f1..bcc32c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8503=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x31c256,_0x56d3b3){var _0x2f18ba=function(_0x5adc69){while(--_0x5adc69){_0x31c256['push'](_0x31c256['shift']());}};_0x2f18ba(++_0x56d3b3);}(_0x8503,0x1d4));var _0x3850=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x8503[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x3850('0x0'));var util=require(_0x3850('0x1'));var logger=require('../../config/logger')(_0x3850('0x2'));var moment=require(_0x3850('0x3'));var BPromise=require(_0x3850('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3850('0x5'));var rimraf=require(_0x3850('0x6'));var config=require(_0x3850('0x7'));var attributes=require(_0x3850('0x8'));module[_0x3850('0x9')]=function(_0x5c0a84,_0x4fb24e){return _0x5c0a84[_0x3850('0xa')](_0x3850('0xb'),attributes,{'tableName':_0x3850('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e61=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define'];(function(_0x36b463,_0x589170){var _0x58cfb2=function(_0x301ffa){while(--_0x301ffa){_0x36b463['push'](_0x36b463['shift']());}};_0x58cfb2(++_0x589170);}(_0x6e61,0x16e));var _0x16e6=function(_0x3a9e83,_0x3e40bb){_0x3a9e83=_0x3a9e83-0x0;var _0x1038cd=_0x6e61[_0x3a9e83];return _0x1038cd;};'use strict';var _=require(_0x16e6('0x0'));var util=require(_0x16e6('0x1'));var logger=require(_0x16e6('0x2'))(_0x16e6('0x3'));var moment=require('moment');var BPromise=require(_0x16e6('0x4'));var rp=require(_0x16e6('0x5'));var fs=require('fs');var path=require(_0x16e6('0x6'));var rimraf=require(_0x16e6('0x7'));var config=require(_0x16e6('0x8'));var attributes=require(_0x16e6('0x9'));module['exports']=function(_0x2a0900,_0x4291b1){return _0x2a0900[_0x16e6('0xa')](_0x16e6('0xb'),attributes,{'tableName':_0x16e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5bccaad..8b412e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63af=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x510d50,_0x284a40){var _0x5eead6=function(_0x589bbe){while(--_0x589bbe){_0x510d50['push'](_0x510d50['shift']());}};_0x5eead6(++_0x284a40);}(_0x63af,0x160));var _0xf63a=function(_0x176a3b,_0x1450b3){_0x176a3b=_0x176a3b-0x0;var _0x52641f=_0x63af[_0x176a3b];return _0x52641f;};'use strict';var _=require(_0xf63a('0x0'));var util=require(_0xf63a('0x1'));var moment=require(_0xf63a('0x2'));var BPromise=require(_0xf63a('0x3'));var rs=require(_0xf63a('0x4'));var fs=require('fs');var Redis=require(_0xf63a('0x5'));var db=require(_0xf63a('0x6'))['db'];var utils=require(_0xf63a('0x7'));var logger=require('../../config/logger')(_0xf63a('0x8'));var config=require('../../config/environment');var jayson=require(_0xf63a('0x9'));var client=jayson[_0xf63a('0xa')][_0xf63a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x967a03,_0x28754a,_0x2be0b5){return new BPromise(function(_0x53bbbe,_0x4d0d6b){return client['request'](_0x967a03,_0x2be0b5)[_0xf63a('0xc')](function(_0x2b1e18){logger[_0xf63a('0xd')](_0xf63a('0xe'),_0x28754a,_0xf63a('0xf'));logger[_0xf63a('0x10')](_0xf63a('0x11'),_0x28754a,_0xf63a('0xf'),JSON[_0xf63a('0x12')](_0x2b1e18));if(_0x2b1e18[_0xf63a('0x13')]){if(_0x2b1e18['error'][_0xf63a('0x14')]===0x1f4){logger[_0xf63a('0x13')](_0xf63a('0xe'),_0x28754a,_0x2b1e18[_0xf63a('0x13')][_0xf63a('0x15')]);return _0x4d0d6b(_0x2b1e18[_0xf63a('0x13')]['message']);}logger[_0xf63a('0x13')](_0xf63a('0xe'),_0x28754a,_0x2b1e18['error'][_0xf63a('0x15')]);return _0x53bbbe(_0x2b1e18[_0xf63a('0x13')]['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x28754a,'request\x20sent');_0x53bbbe(_0x2b1e18['result'][_0xf63a('0x15')]);}})[_0xf63a('0x16')](function(_0x5b4610){logger[_0xf63a('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x28754a,_0x5b4610);_0x4d0d6b(_0x5b4610);});});}
\ No newline at end of file
+var _0x414a=['util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0xda501a,_0x159d6a){var _0x44be3a=function(_0x5c1c5f){while(--_0x5c1c5f){_0xda501a['push'](_0xda501a['shift']());}};_0x44be3a(++_0x159d6a);}(_0x414a,0x1df));var _0xa414=function(_0x44be9a,_0xdd6dee){_0x44be9a=_0x44be9a-0x0;var _0xeb6e46=_0x414a[_0x44be9a];return _0xeb6e46;};'use strict';var _=require(_0xa414('0x0'));var util=require(_0xa414('0x1'));var moment=require(_0xa414('0x2'));var BPromise=require('bluebird');var rs=require(_0xa414('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa414('0x4'));var logger=require(_0xa414('0x5'))(_0xa414('0x6'));var config=require(_0xa414('0x7'));var jayson=require(_0xa414('0x8'));var client=jayson[_0xa414('0x9')][_0xa414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc56120,_0x4a3514,_0x14a747){return new BPromise(function(_0x521d40,_0x14883e){return client['request'](_0xc56120,_0x14a747)[_0xa414('0xb')](function(_0x58e363){logger['info'](_0xa414('0xc'),_0x4a3514,_0xa414('0xd'));logger['debug'](_0xa414('0xe'),_0x4a3514,_0xa414('0xd'),JSON[_0xa414('0xf')](_0x58e363));if(_0x58e363[_0xa414('0x10')]){if(_0x58e363[_0xa414('0x10')][_0xa414('0x11')]===0x1f4){logger['error'](_0xa414('0xc'),_0x4a3514,_0x58e363[_0xa414('0x10')][_0xa414('0x12')]);return _0x14883e(_0x58e363[_0xa414('0x10')][_0xa414('0x12')]);}logger[_0xa414('0x10')](_0xa414('0xc'),_0x4a3514,_0x58e363[_0xa414('0x10')]['message']);return _0x521d40(_0x58e363[_0xa414('0x10')][_0xa414('0x12')]);}else{logger['info'](_0xa414('0xc'),_0x4a3514,'request\x20sent');_0x521d40(_0x58e363[_0xa414('0x13')]['message']);}})['catch'](function(_0x3dd631){logger[_0xa414('0x10')](_0xa414('0xc'),_0x4a3514,_0x3dd631);_0x14883e(_0x3dd631);});});}
\ No newline at end of file
index 706cba7..ed5c16f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe946=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','/:id','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe946,0x14c));var _0x6e94=function(_0x18170b,_0xa0b3f6){_0x18170b=_0x18170b-0x0;var _0x166fa3=_0xe946[_0x18170b];return _0x166fa3;};'use strict';var multer=require('multer');var util=require(_0x6e94('0x0'));var path=require(_0x6e94('0x1'));var timeout=require(_0x6e94('0x2'));var express=require(_0x6e94('0x3'));var router=express[_0x6e94('0x4')]();var fs_extra=require(_0x6e94('0x5'));var auth=require(_0x6e94('0x6'));var interaction=require(_0x6e94('0x7'));var config=require('../../config/environment');var controller=require(_0x6e94('0x8'));router[_0x6e94('0x9')]('/',auth[_0x6e94('0xa')](),controller['index']);router[_0x6e94('0x9')](_0x6e94('0xb'),auth[_0x6e94('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6e94('0xc')]);router['put'](_0x6e94('0xb'),auth['isAuthenticated'](),controller[_0x6e94('0xd')]);router[_0x6e94('0xe')](_0x6e94('0xb'),auth[_0x6e94('0xa')](),controller[_0x6e94('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xf503=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','put'];(function(_0xe7c18e,_0x1f5fcc){var _0x28ad81=function(_0x344e23){while(--_0x344e23){_0xe7c18e['push'](_0xe7c18e['shift']());}};_0x28ad81(++_0x1f5fcc);}(_0xf503,0x18b));var _0x3f50=function(_0x272c31,_0x175190){_0x272c31=_0x272c31-0x0;var _0xbe4b6a=_0xf503[_0x272c31];return _0xbe4b6a;};'use strict';var multer=require(_0x3f50('0x0'));var util=require(_0x3f50('0x1'));var path=require('path');var timeout=require(_0x3f50('0x2'));var express=require(_0x3f50('0x3'));var router=express[_0x3f50('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3f50('0x5'));var config=require(_0x3f50('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x3f50('0x7')](),controller[_0x3f50('0x8')]);router['get'](_0x3f50('0x9'),auth[_0x3f50('0x7')](),controller[_0x3f50('0xa')]);router[_0x3f50('0xb')]('/',auth[_0x3f50('0x7')](),controller['create']);router[_0x3f50('0xc')](_0x3f50('0x9'),auth[_0x3f50('0x7')](),controller[_0x3f50('0xd')]);router[_0x3f50('0xe')](_0x3f50('0x9'),auth['isAuthenticated'](),controller[_0x3f50('0xf')]);module[_0x3f50('0x10')]=router;
\ No newline at end of file
index 1407085..6561bd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27e3=['customVariable','keyValue','picklist','string','STRING','sequelize','ENUM','variable'];(function(_0x5006c0,_0x401fb2){var _0x45d284=function(_0x201c25){while(--_0x201c25){_0x5006c0['push'](_0x5006c0['shift']());}};_0x45d284(++_0x401fb2);}(_0x27e3,0x7d));var _0x327e=function(_0x40da86,_0x9cbbf3){_0x40da86=_0x40da86-0x0;var _0x48dec6=_0x27e3[_0x40da86];return _0x48dec6;};'use strict';var Sequelize=require(_0x327e('0x0'));module['exports']={'type':{'type':Sequelize[_0x327e('0x1')]('string',_0x327e('0x2'),_0x327e('0x3'),_0x327e('0x4'),_0x327e('0x5')),'defaultValue':_0x327e('0x6')},'content':{'type':Sequelize[_0x327e('0x7')]},'key':{'type':Sequelize[_0x327e('0x7')]},'keyType':{'type':Sequelize[_0x327e('0x1')](_0x327e('0x6'),'variable',_0x327e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x327e('0x7')]},'variableName':{'type':Sequelize[_0x327e('0x7')]}};
\ No newline at end of file
+var _0x8f47=['variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize','string'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8f47,0x196));var _0x78f4=function(_0x2daea7,_0x41e7da){_0x2daea7=_0x2daea7-0x0;var _0x1f01bd=_0x8f47[_0x2daea7];return _0x1f01bd;};'use strict';var Sequelize=require(_0x78f4('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x78f4('0x1'),_0x78f4('0x2'),_0x78f4('0x3'),_0x78f4('0x4'),_0x78f4('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x78f4('0x6')]},'key':{'type':Sequelize[_0x78f4('0x6')]},'keyType':{'type':Sequelize[_0x78f4('0x7')]('string',_0x78f4('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x78f4('0x6')]},'idField':{'type':Sequelize[_0x78f4('0x6')]},'variableName':{'type':Sequelize[_0x78f4('0x6')]}};
\ No newline at end of file
index b01e4f8..7fb431d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa287=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SalesforceField','rawAttributes','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','count','includeAll','rows','params','include','find','catch','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x580504,_0x193b6f){var _0x524b2b=function(_0x128c99){while(--_0x128c99){_0x580504['push'](_0x580504['shift']());}};_0x524b2b(++_0x193b6f);}(_0xa287,0x1ae));var _0x7a28=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0xa287[_0x12833b];return _0x3acad3;};'use strict';var emlformat=require(_0x7a28('0x0'));var rimraf=require(_0x7a28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a28('0x2'));var rp=require(_0x7a28('0x3'));var moment=require(_0x7a28('0x4'));var BPromise=require(_0x7a28('0x5'));var Mustache=require(_0x7a28('0x6'));var util=require('util');var path=require(_0x7a28('0x7'));var sox=require('sox');var csv=require(_0x7a28('0x8'));var ejs=require(_0x7a28('0x9'));var fs=require('fs');var fs_extra=require(_0x7a28('0xa'));var _=require(_0x7a28('0xb'));var squel=require(_0x7a28('0xc'));var crypto=require(_0x7a28('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7a28('0xe'));var toCsv=require(_0x7a28('0x8'));var querystring=require(_0x7a28('0xf'));var Papa=require(_0x7a28('0x10'));var Redis=require(_0x7a28('0x11'));var authService=require(_0x7a28('0x12'));var qs=require(_0x7a28('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a28('0x14'));var logger=require(_0x7a28('0x15'))('api');var utils=require(_0x7a28('0x16'));var config=require(_0x7a28('0x17'));var licenseUtil=require(_0x7a28('0x18'));var db=require(_0x7a28('0x19'))['db'];function respondWithStatusCode(_0x54e53d,_0x3c7854){_0x3c7854=_0x3c7854||0xcc;return function(_0x56592b){if(_0x56592b){return _0x54e53d['sendStatus'](_0x3c7854);}return _0x54e53d[_0x7a28('0x1a')](_0x3c7854)[_0x7a28('0x1b')]();};}function respondWithResult(_0x21940d,_0x16545e){_0x16545e=_0x16545e||0xc8;return function(_0x106161){if(_0x106161){return _0x21940d[_0x7a28('0x1a')](_0x16545e)[_0x7a28('0x1c')](_0x106161);}};}function respondWithFilteredResult(_0x1c0be3,_0x553c55){return function(_0x3c372e){if(_0x3c372e){var _0x5cd2cd=typeof _0x553c55[_0x7a28('0x1d')]===_0x7a28('0x1e')&&typeof _0x553c55[_0x7a28('0x1f')]===_0x7a28('0x1e');var _0x34d1a1=_0x3c372e['count'];var _0x5d1531=_0x5cd2cd?0x0:_0x553c55[_0x7a28('0x1d')];var _0x301d43=_0x5cd2cd?_0x3c372e['count']:_0x553c55[_0x7a28('0x1d')]+_0x553c55[_0x7a28('0x1f')];var _0x3fe7c9;if(_0x301d43>=_0x34d1a1){_0x301d43=_0x34d1a1;_0x3fe7c9=0xc8;}else{_0x3fe7c9=0xce;}_0x1c0be3[_0x7a28('0x1a')](_0x3fe7c9);return _0x1c0be3[_0x7a28('0x20')](_0x7a28('0x21'),_0x5d1531+'-'+_0x301d43+'/'+_0x34d1a1)[_0x7a28('0x1c')](_0x3c372e);}return null;};}function patchUpdates(_0xf6080b){return function(_0x3658ec){try{jsonpatch[_0x7a28('0x22')](_0x3658ec,_0xf6080b,!![]);}catch(_0x1d26c1){return BPromise[_0x7a28('0x23')](_0x1d26c1);}return _0x3658ec[_0x7a28('0x24')]();};}function saveUpdates(_0x3a0f25,_0x48cb83){return function(_0x37c626){if(_0x37c626){return _0x37c626[_0x7a28('0x25')](_0x3a0f25)[_0x7a28('0x26')](function(_0x3a5efc){return _0x3a5efc;});}return null;};}function removeEntity(_0x1fad1a,_0x3dc692){return function(_0x5149c9){if(_0x5149c9){return _0x5149c9['destroy']()['then'](function(){_0x1fad1a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x145b61,_0xdd32e5){return function(_0x3ff0de){if(!_0x3ff0de){_0x145b61[_0x7a28('0x27')](0x194);}return _0x3ff0de;};}function handleError(_0x39a4c0,_0x33678a){_0x33678a=_0x33678a||0x1f4;return function(_0x5b8c1c){logger[_0x7a28('0x28')](_0x5b8c1c[_0x7a28('0x29')]);if(_0x5b8c1c[_0x7a28('0x2a')]){delete _0x5b8c1c['name'];}_0x39a4c0[_0x7a28('0x1a')](_0x33678a)[_0x7a28('0x2b')](_0x5b8c1c);};}exports[_0x7a28('0x2c')]=function(_0x951bd,_0x334919){var _0x410eb0={},_0x187951={},_0x1194f9={'count':0x0,'rows':[]};var _0x40eccc=_[_0x7a28('0x2d')](db[_0x7a28('0x2e')][_0x7a28('0x2f')],function(_0x51bfe2){return{'name':_0x51bfe2['fieldName'],'type':_0x51bfe2['type'][_0x7a28('0x30')]};});_0x187951['model']=_[_0x7a28('0x2d')](_0x40eccc,'name');_0x187951['query']=_['keys'](_0x951bd['query']);_0x187951[_0x7a28('0x31')]=_[_0x7a28('0x32')](_0x187951[_0x7a28('0x33')],_0x187951[_0x7a28('0x34')]);_0x410eb0[_0x7a28('0x35')]=_[_0x7a28('0x32')](_0x187951[_0x7a28('0x33')],qs[_0x7a28('0x36')](_0x951bd[_0x7a28('0x34')]['fields']));_0x410eb0[_0x7a28('0x35')]=_0x410eb0[_0x7a28('0x35')][_0x7a28('0x37')]?_0x410eb0['attributes']:_0x187951[_0x7a28('0x33')];if(!_0x951bd[_0x7a28('0x34')][_0x7a28('0x38')](_0x7a28('0x39'))){_0x410eb0[_0x7a28('0x1f')]=qs[_0x7a28('0x1f')](_0x951bd[_0x7a28('0x34')][_0x7a28('0x1f')]);_0x410eb0[_0x7a28('0x1d')]=qs['offset'](_0x951bd[_0x7a28('0x34')]['offset']);}_0x410eb0['order']=qs[_0x7a28('0x3a')](_0x951bd[_0x7a28('0x34')][_0x7a28('0x3a')]);_0x410eb0[_0x7a28('0x3b')]=qs[_0x7a28('0x31')](_[_0x7a28('0x3c')](_0x951bd[_0x7a28('0x34')],_0x187951['filters']),_0x40eccc);if(_0x951bd['query']['filter']){_0x410eb0[_0x7a28('0x3b')]=_['merge'](_0x410eb0[_0x7a28('0x3b')],{'$or':_[_0x7a28('0x2d')](_0x40eccc,function(_0x344cc0){if(_0x344cc0[_0x7a28('0x3d')]!==_0x7a28('0x3e')){var _0x434e85={};_0x434e85[_0x344cc0[_0x7a28('0x2a')]]={'$like':'%'+_0x951bd[_0x7a28('0x34')][_0x7a28('0x3f')]+'%'};return _0x434e85;}})});}_0x410eb0=_[_0x7a28('0x40')]({},_0x410eb0,_0x951bd[_0x7a28('0x41')]);var _0x1bcbef={'where':_0x410eb0[_0x7a28('0x3b')]};return db[_0x7a28('0x2e')][_0x7a28('0x42')](_0x1bcbef)[_0x7a28('0x26')](function(_0x312687){_0x1194f9[_0x7a28('0x42')]=_0x312687;if(_0x951bd['query'][_0x7a28('0x43')]){_0x410eb0['include']=[{'all':!![]}];}return db[_0x7a28('0x2e')]['findAll'](_0x410eb0);})['then'](function(_0x56c4e6){_0x1194f9[_0x7a28('0x44')]=_0x56c4e6;return _0x1194f9;})['then'](respondWithFilteredResult(_0x334919,_0x410eb0))['catch'](handleError(_0x334919,null));};exports['show']=function(_0x25d42f,_0x4db05a){var _0x58b512={'raw':!![],'where':{'id':_0x25d42f[_0x7a28('0x45')]['id']}},_0x5c71c7={};_0x5c71c7[_0x7a28('0x33')]=_['keys'](db[_0x7a28('0x2e')][_0x7a28('0x2f')]);_0x5c71c7[_0x7a28('0x34')]=_['keys'](_0x25d42f[_0x7a28('0x34')]);_0x5c71c7[_0x7a28('0x31')]=_['intersection'](_0x5c71c7[_0x7a28('0x33')],_0x5c71c7[_0x7a28('0x34')]);_0x58b512['attributes']=_['intersection'](_0x5c71c7['model'],qs[_0x7a28('0x36')](_0x25d42f[_0x7a28('0x34')][_0x7a28('0x36')]));_0x58b512[_0x7a28('0x35')]=_0x58b512[_0x7a28('0x35')][_0x7a28('0x37')]?_0x58b512[_0x7a28('0x35')]:_0x5c71c7[_0x7a28('0x33')];if(_0x25d42f['query'][_0x7a28('0x43')]){_0x58b512[_0x7a28('0x46')]=[{'all':!![]}];}_0x58b512=_[_0x7a28('0x40')]({},_0x58b512,_0x25d42f[_0x7a28('0x41')]);return db[_0x7a28('0x2e')][_0x7a28('0x47')](_0x58b512)[_0x7a28('0x26')](handleEntityNotFound(_0x4db05a,null))['then'](respondWithResult(_0x4db05a,null))[_0x7a28('0x48')](handleError(_0x4db05a,null));};exports['create']=function(_0xe075c,_0x296c65){return db['SalesforceField']['create'](_0xe075c['body'],{})[_0x7a28('0x26')](respondWithResult(_0x296c65,0xc9))[_0x7a28('0x48')](handleError(_0x296c65,null));};exports[_0x7a28('0x25')]=function(_0x4429d0,_0x41e9b1){if(_0x4429d0[_0x7a28('0x49')]['id']){delete _0x4429d0[_0x7a28('0x49')]['id'];}return db['SalesforceField'][_0x7a28('0x47')]({'where':{'id':_0x4429d0[_0x7a28('0x45')]['id']}})[_0x7a28('0x26')](handleEntityNotFound(_0x41e9b1,null))[_0x7a28('0x26')](saveUpdates(_0x4429d0[_0x7a28('0x49')],null))[_0x7a28('0x26')](respondWithResult(_0x41e9b1,null))['catch'](handleError(_0x41e9b1,null));};exports[_0x7a28('0x4a')]=function(_0x55db04,_0x3fc24c){return db[_0x7a28('0x2e')][_0x7a28('0x47')]({'where':{'id':_0x55db04['params']['id']}})[_0x7a28('0x26')](handleEntityNotFound(_0x3fc24c,null))[_0x7a28('0x26')](removeEntity(_0x3fc24c,null))[_0x7a28('0x48')](handleError(_0x3fc24c,null));};
\ No newline at end of file
+var _0xbe98=['save','then','destroy','name','map','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject'];(function(_0x201513,_0x1c7c97){var _0x485533=function(_0x415cbf){while(--_0x415cbf){_0x201513['push'](_0x201513['shift']());}};_0x485533(++_0x1c7c97);}(_0xbe98,0x199));var _0x8be9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbe98[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x8be9('0x0'));var rimraf=require(_0x8be9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8be9('0x2'));var rp=require('request-promise');var moment=require(_0x8be9('0x3'));var BPromise=require(_0x8be9('0x4'));var Mustache=require(_0x8be9('0x5'));var util=require(_0x8be9('0x6'));var path=require('path');var sox=require(_0x8be9('0x7'));var csv=require(_0x8be9('0x8'));var ejs=require(_0x8be9('0x9'));var fs=require('fs');var fs_extra=require(_0x8be9('0xa'));var _=require(_0x8be9('0xb'));var squel=require(_0x8be9('0xc'));var crypto=require(_0x8be9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8be9('0xe'));var toCsv=require(_0x8be9('0x8'));var querystring=require(_0x8be9('0xf'));var Papa=require(_0x8be9('0x10'));var Redis=require(_0x8be9('0x11'));var authService=require(_0x8be9('0x12'));var qs=require(_0x8be9('0x13'));var as=require(_0x8be9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8be9('0x15'));var utils=require(_0x8be9('0x16'));var config=require(_0x8be9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8be9('0x18'))['db'];function respondWithStatusCode(_0x2c87ea,_0x53d273){_0x53d273=_0x53d273||0xcc;return function(_0x3af370){if(_0x3af370){return _0x2c87ea[_0x8be9('0x19')](_0x53d273);}return _0x2c87ea[_0x8be9('0x1a')](_0x53d273)['end']();};}function respondWithResult(_0x4f4151,_0xc8dd24){_0xc8dd24=_0xc8dd24||0xc8;return function(_0x324bf4){if(_0x324bf4){return _0x4f4151[_0x8be9('0x1a')](_0xc8dd24)['json'](_0x324bf4);}};}function respondWithFilteredResult(_0x320a20,_0x228d14){return function(_0x410d80){if(_0x410d80){var _0xe0412c=typeof _0x228d14[_0x8be9('0x1b')]===_0x8be9('0x1c')&&typeof _0x228d14['limit']===_0x8be9('0x1c');var _0x302b32=_0x410d80[_0x8be9('0x1d')];var _0x310edb=_0xe0412c?0x0:_0x228d14[_0x8be9('0x1b')];var _0x5a5cf4=_0xe0412c?_0x410d80['count']:_0x228d14['offset']+_0x228d14[_0x8be9('0x1e')];var _0x922248;if(_0x5a5cf4>=_0x302b32){_0x5a5cf4=_0x302b32;_0x922248=0xc8;}else{_0x922248=0xce;}_0x320a20[_0x8be9('0x1a')](_0x922248);return _0x320a20['set'](_0x8be9('0x1f'),_0x310edb+'-'+_0x5a5cf4+'/'+_0x302b32)[_0x8be9('0x20')](_0x410d80);}return null;};}function patchUpdates(_0x3da645){return function(_0x2635b8){try{jsonpatch[_0x8be9('0x21')](_0x2635b8,_0x3da645,!![]);}catch(_0x18a280){return BPromise[_0x8be9('0x22')](_0x18a280);}return _0x2635b8[_0x8be9('0x23')]();};}function saveUpdates(_0x30b20d,_0x291846){return function(_0x43c003){if(_0x43c003){return _0x43c003['update'](_0x30b20d)[_0x8be9('0x24')](function(_0x522fec){return _0x522fec;});}return null;};}function removeEntity(_0x102e7b,_0x345558){return function(_0xeb28ac){if(_0xeb28ac){return _0xeb28ac[_0x8be9('0x25')]()['then'](function(){_0x102e7b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e89ff,_0x2bf13b){return function(_0x4247a2){if(!_0x4247a2){_0x5e89ff[_0x8be9('0x19')](0x194);}return _0x4247a2;};}function handleError(_0x21dd4d,_0x1db416){_0x1db416=_0x1db416||0x1f4;return function(_0x32c49b){logger['error'](_0x32c49b['stack']);if(_0x32c49b[_0x8be9('0x26')]){delete _0x32c49b['name'];}_0x21dd4d[_0x8be9('0x1a')](_0x1db416)['send'](_0x32c49b);};}exports['index']=function(_0x318748,_0x51c96d){var _0x23ba9e={},_0x49bd8e={},_0x2dd0b9={'count':0x0,'rows':[]};var _0x528ab0=_[_0x8be9('0x27')](db[_0x8be9('0x28')]['rawAttributes'],function(_0x482e18){return{'name':_0x482e18[_0x8be9('0x29')],'type':_0x482e18[_0x8be9('0x2a')][_0x8be9('0x2b')]};});_0x49bd8e[_0x8be9('0x2c')]=_[_0x8be9('0x27')](_0x528ab0,_0x8be9('0x26'));_0x49bd8e[_0x8be9('0x2d')]=_[_0x8be9('0x2e')](_0x318748[_0x8be9('0x2d')]);_0x49bd8e[_0x8be9('0x2f')]=_[_0x8be9('0x30')](_0x49bd8e[_0x8be9('0x2c')],_0x49bd8e[_0x8be9('0x2d')]);_0x23ba9e['attributes']=_[_0x8be9('0x30')](_0x49bd8e[_0x8be9('0x2c')],qs[_0x8be9('0x31')](_0x318748[_0x8be9('0x2d')][_0x8be9('0x31')]));_0x23ba9e[_0x8be9('0x32')]=_0x23ba9e[_0x8be9('0x32')][_0x8be9('0x33')]?_0x23ba9e['attributes']:_0x49bd8e[_0x8be9('0x2c')];if(!_0x318748[_0x8be9('0x2d')][_0x8be9('0x34')](_0x8be9('0x35'))){_0x23ba9e[_0x8be9('0x1e')]=qs['limit'](_0x318748[_0x8be9('0x2d')][_0x8be9('0x1e')]);_0x23ba9e[_0x8be9('0x1b')]=qs[_0x8be9('0x1b')](_0x318748[_0x8be9('0x2d')][_0x8be9('0x1b')]);}_0x23ba9e[_0x8be9('0x36')]=qs[_0x8be9('0x37')](_0x318748['query'][_0x8be9('0x37')]);_0x23ba9e[_0x8be9('0x38')]=qs[_0x8be9('0x2f')](_[_0x8be9('0x39')](_0x318748['query'],_0x49bd8e[_0x8be9('0x2f')]),_0x528ab0);if(_0x318748[_0x8be9('0x2d')][_0x8be9('0x3a')]){_0x23ba9e[_0x8be9('0x38')]=_[_0x8be9('0x3b')](_0x23ba9e[_0x8be9('0x38')],{'$or':_['map'](_0x528ab0,function(_0x533919){if(_0x533919[_0x8be9('0x2a')]!==_0x8be9('0x3c')){var _0x27f8e2={};_0x27f8e2[_0x533919[_0x8be9('0x26')]]={'$like':'%'+_0x318748[_0x8be9('0x2d')][_0x8be9('0x3a')]+'%'};return _0x27f8e2;}})});}_0x23ba9e=_[_0x8be9('0x3b')]({},_0x23ba9e,_0x318748[_0x8be9('0x3d')]);var _0x4fad36={'where':_0x23ba9e[_0x8be9('0x38')]};return db['SalesforceField'][_0x8be9('0x1d')](_0x4fad36)[_0x8be9('0x24')](function(_0x3c49b7){_0x2dd0b9['count']=_0x3c49b7;if(_0x318748[_0x8be9('0x2d')][_0x8be9('0x3e')]){_0x23ba9e[_0x8be9('0x3f')]=[{'all':!![]}];}return db['SalesforceField'][_0x8be9('0x40')](_0x23ba9e);})[_0x8be9('0x24')](function(_0x6a9860){_0x2dd0b9[_0x8be9('0x41')]=_0x6a9860;return _0x2dd0b9;})[_0x8be9('0x24')](respondWithFilteredResult(_0x51c96d,_0x23ba9e))[_0x8be9('0x42')](handleError(_0x51c96d,null));};exports[_0x8be9('0x43')]=function(_0x26def1,_0x457c36){var _0x14bd50={'raw':!![],'where':{'id':_0x26def1['params']['id']}},_0x271939={};_0x271939[_0x8be9('0x2c')]=_[_0x8be9('0x2e')](db[_0x8be9('0x28')][_0x8be9('0x44')]);_0x271939[_0x8be9('0x2d')]=_[_0x8be9('0x2e')](_0x26def1[_0x8be9('0x2d')]);_0x271939[_0x8be9('0x2f')]=_[_0x8be9('0x30')](_0x271939[_0x8be9('0x2c')],_0x271939[_0x8be9('0x2d')]);_0x14bd50[_0x8be9('0x32')]=_[_0x8be9('0x30')](_0x271939['model'],qs['fields'](_0x26def1[_0x8be9('0x2d')][_0x8be9('0x31')]));_0x14bd50[_0x8be9('0x32')]=_0x14bd50['attributes'][_0x8be9('0x33')]?_0x14bd50['attributes']:_0x271939[_0x8be9('0x2c')];if(_0x26def1[_0x8be9('0x2d')]['includeAll']){_0x14bd50[_0x8be9('0x3f')]=[{'all':!![]}];}_0x14bd50=_['merge']({},_0x14bd50,_0x26def1[_0x8be9('0x3d')]);return db[_0x8be9('0x28')][_0x8be9('0x45')](_0x14bd50)[_0x8be9('0x24')](handleEntityNotFound(_0x457c36,null))[_0x8be9('0x24')](respondWithResult(_0x457c36,null))['catch'](handleError(_0x457c36,null));};exports[_0x8be9('0x46')]=function(_0x258d3e,_0x21a273){return db[_0x8be9('0x28')]['create'](_0x258d3e[_0x8be9('0x47')],{})[_0x8be9('0x24')](respondWithResult(_0x21a273,0xc9))[_0x8be9('0x42')](handleError(_0x21a273,null));};exports[_0x8be9('0x48')]=function(_0x23bf68,_0xa22b0c){if(_0x23bf68[_0x8be9('0x47')]['id']){delete _0x23bf68['body']['id'];}return db['SalesforceField'][_0x8be9('0x45')]({'where':{'id':_0x23bf68[_0x8be9('0x49')]['id']}})[_0x8be9('0x24')](handleEntityNotFound(_0xa22b0c,null))[_0x8be9('0x24')](saveUpdates(_0x23bf68[_0x8be9('0x47')],null))[_0x8be9('0x24')](respondWithResult(_0xa22b0c,null))[_0x8be9('0x42')](handleError(_0xa22b0c,null));};exports['destroy']=function(_0x45fff9,_0x247a50){return db['SalesforceField'][_0x8be9('0x45')]({'where':{'id':_0x45fff9['params']['id']}})[_0x8be9('0x24')](handleEntityNotFound(_0x247a50,null))[_0x8be9('0x24')](removeEntity(_0x247a50,null))[_0x8be9('0x42')](handleError(_0x247a50,null));};
\ No newline at end of file
index 638461d..0fc7a4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5453=['int_salesforce_fields','salesforce_unique_index','FieldId','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x337a71,_0x22c791){var _0x571311=function(_0x3fd190){while(--_0x3fd190){_0x337a71['push'](_0x337a71['shift']());}};_0x571311(++_0x22c791);}(_0x5453,0x1bd));var _0x3545=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5453[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x3545('0x0'));var util=require('util');var logger=require(_0x3545('0x1'))('api');var moment=require(_0x3545('0x2'));var BPromise=require('bluebird');var rp=require(_0x3545('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3545('0x4'));var config=require(_0x3545('0x5'));var attributes=require(_0x3545('0x6'));module[_0x3545('0x7')]=function(_0x1cd2cb,_0x14547f){return _0x1cd2cb[_0x3545('0x8')](_0x3545('0x9'),attributes,{'tableName':_0x3545('0xa'),'paranoid':![],'indexes':[{'name':_0x3545('0xb'),'fields':['idField',_0x3545('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf75=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf75,0x9e));var _0x5af7=function(_0x2802a4,_0x4e5e17){_0x2802a4=_0x2802a4-0x0;var _0x6e8490=_0xaf75[_0x2802a4];return _0x6e8490;};'use strict';var _=require(_0x5af7('0x0'));var util=require(_0x5af7('0x1'));var logger=require(_0x5af7('0x2'))(_0x5af7('0x3'));var moment=require(_0x5af7('0x4'));var BPromise=require(_0x5af7('0x5'));var rp=require(_0x5af7('0x6'));var fs=require('fs');var path=require(_0x5af7('0x7'));var rimraf=require(_0x5af7('0x8'));var config=require('../../config/environment');var attributes=require(_0x5af7('0x9'));module[_0x5af7('0xa')]=function(_0x25cb5e,_0x21affb){return _0x25cb5e[_0x5af7('0xb')](_0x5af7('0xc'),attributes,{'tableName':_0x5af7('0xd'),'paranoid':![],'indexes':[{'name':_0x5af7('0xe'),'fields':['idField',_0x5af7('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 873c71e..5898d44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b75=['rpc','jayson/promise','client','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x25ab9e,_0x560026){var _0x3fd782=function(_0x3f5af7){while(--_0x3f5af7){_0x25ab9e['push'](_0x25ab9e['shift']());}};_0x3fd782(++_0x560026);}(_0x8b75,0xf7));var _0x58b7=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x8b75[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0x58b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58b7('0x1'));var db=require(_0x58b7('0x2'))['db'];var utils=require(_0x58b7('0x3'));var logger=require(_0x58b7('0x4'))(_0x58b7('0x5'));var config=require('../../config/environment');var jayson=require(_0x58b7('0x6'));var client=jayson[_0x58b7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8def93,_0x256f66,_0x3eff50){return new BPromise(function(_0x59f19d,_0x43e63e){return client['request'](_0x8def93,_0x3eff50)[_0x58b7('0x8')](function(_0x376cec){logger[_0x58b7('0x9')](_0x58b7('0xa'),_0x256f66,_0x58b7('0xb'));logger['debug'](_0x58b7('0xc'),_0x256f66,'request\x20sent',JSON['stringify'](_0x376cec));if(_0x376cec[_0x58b7('0xd')]){if(_0x376cec[_0x58b7('0xd')][_0x58b7('0xe')]===0x1f4){logger[_0x58b7('0xd')](_0x58b7('0xa'),_0x256f66,_0x376cec[_0x58b7('0xd')][_0x58b7('0xf')]);return _0x43e63e(_0x376cec[_0x58b7('0xd')][_0x58b7('0xf')]);}logger[_0x58b7('0xd')](_0x58b7('0xa'),_0x256f66,_0x376cec[_0x58b7('0xd')][_0x58b7('0xf')]);return _0x59f19d(_0x376cec['error']['message']);}else{logger[_0x58b7('0x9')]('SalesforceField,\x20%s,\x20%s',_0x256f66,'request\x20sent');_0x59f19d(_0x376cec[_0x58b7('0x10')]['message']);}})[_0x58b7('0x11')](function(_0x4c04b6){logger[_0x58b7('0xd')](_0x58b7('0xa'),_0x256f66,_0x4c04b6);_0x43e63e(_0x4c04b6);});});}
\ No newline at end of file
+var _0x0d03=['../../config/environment','jayson/promise','client','http','SalesforceField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xea665b,_0x1a4d9a){var _0x384219=function(_0x2f2f38){while(--_0x2f2f38){_0xea665b['push'](_0xea665b['shift']());}};_0x384219(++_0x1a4d9a);}(_0x0d03,0xdd));var _0x30d0=function(_0x2827d4,_0x52159f){_0x2827d4=_0x2827d4-0x0;var _0x15e9c7=_0x0d03[_0x2827d4];return _0x15e9c7;};'use strict';var _=require(_0x30d0('0x0'));var util=require(_0x30d0('0x1'));var moment=require(_0x30d0('0x2'));var BPromise=require(_0x30d0('0x3'));var rs=require(_0x30d0('0x4'));var fs=require('fs');var Redis=require(_0x30d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x30d0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x30d0('0x7'));var jayson=require(_0x30d0('0x8'));var client=jayson[_0x30d0('0x9')][_0x30d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x176db3,_0x5e9ff1,_0x2c0788){return new BPromise(function(_0xf7f89a,_0x5ed1f4){return client['request'](_0x176db3,_0x2c0788)['then'](function(_0x9bd99){logger['info'](_0x30d0('0xb'),_0x5e9ff1,'request\x20sent');logger[_0x30d0('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x5e9ff1,'request\x20sent',JSON[_0x30d0('0xd')](_0x9bd99));if(_0x9bd99[_0x30d0('0xe')]){if(_0x9bd99[_0x30d0('0xe')][_0x30d0('0xf')]===0x1f4){logger[_0x30d0('0xe')](_0x30d0('0xb'),_0x5e9ff1,_0x9bd99[_0x30d0('0xe')][_0x30d0('0x10')]);return _0x5ed1f4(_0x9bd99[_0x30d0('0xe')]['message']);}logger[_0x30d0('0xe')](_0x30d0('0xb'),_0x5e9ff1,_0x9bd99['error'][_0x30d0('0x10')]);return _0xf7f89a(_0x9bd99[_0x30d0('0xe')][_0x30d0('0x10')]);}else{logger['info'](_0x30d0('0xb'),_0x5e9ff1,_0x30d0('0x11'));_0xf7f89a(_0x9bd99[_0x30d0('0x12')][_0x30d0('0x10')]);}})['catch'](function(_0x3cb46f){logger[_0x30d0('0xe')](_0x30d0('0xb'),_0x5e9ff1,_0x3cb46f);_0x5ed1f4(_0x3cb46f);});});}
\ No newline at end of file
index 6b09aa3..fc1817d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cad=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x27a366,_0x176069){var _0x55a474=function(_0x511bc4){while(--_0x511bc4){_0x27a366['push'](_0x27a366['shift']());}};_0x55a474(++_0x176069);}(_0x5cad,0x8c));var _0xd5ca=function(_0x1cf9b6,_0x209cc3){_0x1cf9b6=_0x1cf9b6-0x0;var _0x27ff1c=_0x5cad[_0x1cf9b6];return _0x27ff1c;};'use strict';var multer=require(_0xd5ca('0x0'));var util=require(_0xd5ca('0x1'));var path=require(_0xd5ca('0x2'));var timeout=require(_0xd5ca('0x3'));var express=require(_0xd5ca('0x4'));var router=express[_0xd5ca('0x5')]();var fs_extra=require(_0xd5ca('0x6'));var auth=require(_0xd5ca('0x7'));var interaction=require(_0xd5ca('0x8'));var config=require(_0xd5ca('0x9'));var controller=require(_0xd5ca('0xa'));router[_0xd5ca('0xb')]('/',auth[_0xd5ca('0xc')](),controller[_0xd5ca('0xd')]);router[_0xd5ca('0xb')](_0xd5ca('0xe'),auth[_0xd5ca('0xc')](),controller[_0xd5ca('0xf')]);router[_0xd5ca('0xb')](_0xd5ca('0x10'),auth[_0xd5ca('0xc')](),controller['getConfigurations']);router[_0xd5ca('0xb')]('/:id/fields',auth[_0xd5ca('0xc')](),controller['getFields']);router[_0xd5ca('0x11')]('/',auth['isAuthenticated'](),controller[_0xd5ca('0x12')]);router[_0xd5ca('0x11')](_0xd5ca('0x10'),auth[_0xd5ca('0xc')](),controller[_0xd5ca('0x13')]);router[_0xd5ca('0x14')](_0xd5ca('0xe'),auth['isAuthenticated'](),controller[_0xd5ca('0x15')]);router[_0xd5ca('0x16')](_0xd5ca('0xe'),auth[_0xd5ca('0xc')](),controller['destroy']);module[_0xd5ca('0x17')]=router;
\ No newline at end of file
+var _0x31ff=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','update','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get'];(function(_0x1aad4e,_0x1ee8fb){var _0x2958d4=function(_0x2027c2){while(--_0x2027c2){_0x1aad4e['push'](_0x1aad4e['shift']());}};_0x2958d4(++_0x1ee8fb);}(_0x31ff,0xd3));var _0xf31f=function(_0x204ec9,_0x488c59){_0x204ec9=_0x204ec9-0x0;var _0x237f46=_0x31ff[_0x204ec9];return _0x237f46;};'use strict';var multer=require(_0xf31f('0x0'));var util=require(_0xf31f('0x1'));var path=require(_0xf31f('0x2'));var timeout=require(_0xf31f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf31f('0x4'));var auth=require(_0xf31f('0x5'));var interaction=require(_0xf31f('0x6'));var config=require('../../config/environment');var controller=require(_0xf31f('0x7'));router[_0xf31f('0x8')]('/',auth[_0xf31f('0x9')](),controller[_0xf31f('0xa')]);router[_0xf31f('0x8')](_0xf31f('0xb'),auth[_0xf31f('0x9')](),controller[_0xf31f('0xc')]);router[_0xf31f('0x8')](_0xf31f('0xd'),auth[_0xf31f('0x9')](),controller[_0xf31f('0xe')]);router[_0xf31f('0x8')](_0xf31f('0xf'),auth[_0xf31f('0x9')](),controller['getFields']);router['post']('/',auth[_0xf31f('0x9')](),controller[_0xf31f('0x10')]);router[_0xf31f('0x11')](_0xf31f('0xd'),auth[_0xf31f('0x9')](),controller[_0xf31f('0x12')]);router['put'](_0xf31f('0xb'),auth[_0xf31f('0x9')](),controller[_0xf31f('0x13')]);router['delete'](_0xf31f('0xb'),auth[_0xf31f('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 3c0b6d9..4c8595a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c9a=['STRING','sequelize'];(function(_0x16e609,_0x385557){var _0x1dfa4f=function(_0x41485b){while(--_0x41485b){_0x16e609['push'](_0x16e609['shift']());}};_0x1dfa4f(++_0x385557);}(_0x5c9a,0x10d));var _0xa5c9=function(_0x25cec5,_0x115d0c){_0x25cec5=_0x25cec5-0x0;var _0x19fba4=_0x5c9a[_0x25cec5];return _0x19fba4;};'use strict';var Sequelize=require(_0xa5c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xa5c9('0x1')]},'description':{'type':Sequelize[_0xa5c9('0x1')]},'username':{'type':Sequelize[_0xa5c9('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xa5c9('0x1')]},'email':{'type':Sequelize[_0xa5c9('0x1')]},'remoteUri':{'type':Sequelize[_0xa5c9('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa5c9('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x69a3=['username','sequelize','STRING'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x69a3,0x18a));var _0x369a=function(_0x285cc7,_0x54eab6){_0x285cc7=_0x285cc7-0x0;var _0x5cca72=_0x69a3[_0x285cc7];return _0x5cca72;};'use strict';var Sequelize=require(_0x369a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x369a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x369a('0x2')},'password':{'type':Sequelize[_0x369a('0x1')]},'email':{'type':Sequelize[_0x369a('0x1')]},'remoteUri':{'type':Sequelize[_0x369a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x369a('0x1')],'allowNull':![]}};
\ No newline at end of file
index 9e31bb0..d5f3550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf444=['VIRTUAL','filter','include','rows','catch','show','params','keys','includeAll','options','find','create','body','findOne','ServicenowConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','impact','active','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','statusCode','error','stack','send','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','path','sox','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','name','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','merge'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf444,0x144));var _0x4f44=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0xf444[_0x3c4f1f];return _0x19cb69;};'use strict';var emlformat=require(_0x4f44('0x0'));var rimraf=require(_0x4f44('0x1'));var zipdir=require(_0x4f44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4f44('0x3'));var sox=require(_0x4f44('0x4'));var csv=require(_0x4f44('0x5'));var ejs=require(_0x4f44('0x6'));var fs=require('fs');var fs_extra=require(_0x4f44('0x7'));var _=require('lodash');var squel=require(_0x4f44('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f44('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f44('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x4f44('0xb'));var as=require(_0x4f44('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f44('0xd'))(_0x4f44('0xe'));var utils=require(_0x4f44('0xf'));var config=require(_0x4f44('0x10'));var licenseUtil=require(_0x4f44('0x11'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4f44('0x12'));function respondWithStatusCode(_0x96b235,_0x4482d9){_0x4482d9=_0x4482d9||0xcc;return function(_0x39222a){if(_0x39222a){return _0x96b235[_0x4f44('0x13')](_0x4482d9);}return _0x96b235[_0x4f44('0x14')](_0x4482d9)[_0x4f44('0x15')]();};}function respondWithResult(_0x524883,_0x49be9b){_0x49be9b=_0x49be9b||0xc8;return function(_0xd48b56){if(_0xd48b56){return _0x524883[_0x4f44('0x14')](_0x49be9b)[_0x4f44('0x16')](_0xd48b56);}};}function respondWithFilteredResult(_0x4f81fc,_0x326c68){return function(_0x5b3b9f){if(_0x5b3b9f){var _0x51d526=typeof _0x326c68[_0x4f44('0x17')]===_0x4f44('0x18')&&typeof _0x326c68[_0x4f44('0x19')]==='undefined';var _0x314df9=_0x5b3b9f[_0x4f44('0x1a')];var _0x48de80=_0x51d526?0x0:_0x326c68[_0x4f44('0x17')];var _0x1e5ec0=_0x51d526?_0x5b3b9f['count']:_0x326c68[_0x4f44('0x17')]+_0x326c68['limit'];var _0x2bc1f1;if(_0x1e5ec0>=_0x314df9){_0x1e5ec0=_0x314df9;_0x2bc1f1=0xc8;}else{_0x2bc1f1=0xce;}_0x4f81fc[_0x4f44('0x14')](_0x2bc1f1);return _0x4f81fc[_0x4f44('0x1b')](_0x4f44('0x1c'),_0x48de80+'-'+_0x1e5ec0+'/'+_0x314df9)[_0x4f44('0x16')](_0x5b3b9f);}return null;};}function patchUpdates(_0x49d8c0){return function(_0x405e8c){try{jsonpatch['apply'](_0x405e8c,_0x49d8c0,!![]);}catch(_0x676571){return BPromise['reject'](_0x676571);}return _0x405e8c[_0x4f44('0x1d')]();};}function saveUpdates(_0x353364,_0xc9927f){return function(_0x3fce25){if(_0x3fce25){return _0x3fce25[_0x4f44('0x1e')](_0x353364)[_0x4f44('0x1f')](function(_0xb7acff){return _0xb7acff;});}return null;};}function removeEntity(_0x50aad6,_0x260f84){return function(_0x3d16af){if(_0x3d16af){return _0x3d16af[_0x4f44('0x20')]()['then'](function(){_0x50aad6[_0x4f44('0x14')](0xcc)[_0x4f44('0x15')]();});}};}function handleEntityNotFound(_0x28727d,_0x1cc286){return function(_0x4ecd5b){if(!_0x4ecd5b){_0x28727d[_0x4f44('0x13')](0x194);}return _0x4ecd5b;};}function handleError(_0x36eff0,_0x42ca36){_0x42ca36=_0x42ca36||0x1f4;return function(_0x23300d){logger['error'](_0x23300d['stack']);if(_0x23300d[_0x4f44('0x21')]){delete _0x23300d[_0x4f44('0x21')];}_0x36eff0['status'](_0x42ca36)['send'](_0x23300d);};}exports[_0x4f44('0x22')]=function(_0x32496b,_0x4f45ed){var _0x1ac742={},_0x4cf07b={},_0x3ccdea={'count':0x0,'rows':[]};var _0x19e349=_['map'](db[_0x4f44('0x23')][_0x4f44('0x24')],function(_0x1bd772){return{'name':_0x1bd772[_0x4f44('0x25')],'type':_0x1bd772[_0x4f44('0x26')][_0x4f44('0x27')]};});_0x4cf07b[_0x4f44('0x28')]=_[_0x4f44('0x29')](_0x19e349,'name');_0x4cf07b[_0x4f44('0x2a')]=_['keys'](_0x32496b['query']);_0x4cf07b['filters']=_[_0x4f44('0x2b')](_0x4cf07b[_0x4f44('0x28')],_0x4cf07b[_0x4f44('0x2a')]);_0x1ac742[_0x4f44('0x2c')]=_[_0x4f44('0x2b')](_0x4cf07b[_0x4f44('0x28')],qs[_0x4f44('0x2d')](_0x32496b['query'][_0x4f44('0x2d')]));_0x1ac742['attributes']=_0x1ac742[_0x4f44('0x2c')][_0x4f44('0x2e')]?_0x1ac742[_0x4f44('0x2c')]:_0x4cf07b[_0x4f44('0x28')];if(!_0x32496b[_0x4f44('0x2a')]['hasOwnProperty'](_0x4f44('0x2f'))){_0x1ac742[_0x4f44('0x19')]=qs[_0x4f44('0x19')](_0x32496b[_0x4f44('0x2a')][_0x4f44('0x19')]);_0x1ac742[_0x4f44('0x17')]=qs[_0x4f44('0x17')](_0x32496b[_0x4f44('0x2a')][_0x4f44('0x17')]);}_0x1ac742[_0x4f44('0x30')]=qs[_0x4f44('0x31')](_0x32496b[_0x4f44('0x2a')][_0x4f44('0x31')]);_0x1ac742[_0x4f44('0x32')]=qs['filters'](_[_0x4f44('0x33')](_0x32496b[_0x4f44('0x2a')],_0x4cf07b[_0x4f44('0x34')]),_0x19e349);if(_0x32496b['query']['filter']){_0x1ac742[_0x4f44('0x32')]=_[_0x4f44('0x35')](_0x1ac742[_0x4f44('0x32')],{'$or':_[_0x4f44('0x29')](_0x19e349,function(_0x49cb85){if(_0x49cb85[_0x4f44('0x26')]!==_0x4f44('0x36')){var _0x48186d={};_0x48186d[_0x49cb85['name']]={'$like':'%'+_0x32496b[_0x4f44('0x2a')][_0x4f44('0x37')]+'%'};return _0x48186d;}})});}_0x1ac742=_['merge']({},_0x1ac742,_0x32496b['options']);var _0x1da999={'where':_0x1ac742[_0x4f44('0x32')]};return db['ServicenowAccount']['count'](_0x1da999)[_0x4f44('0x1f')](function(_0x3e761e){_0x3ccdea[_0x4f44('0x1a')]=_0x3e761e;if(_0x32496b['query']['includeAll']){_0x1ac742[_0x4f44('0x38')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x1ac742);})[_0x4f44('0x1f')](function(_0x563ce5){_0x3ccdea[_0x4f44('0x39')]=_0x563ce5;return _0x3ccdea;})[_0x4f44('0x1f')](respondWithFilteredResult(_0x4f45ed,_0x1ac742))[_0x4f44('0x3a')](handleError(_0x4f45ed,null));};exports[_0x4f44('0x3b')]=function(_0x545385,_0xee5653){var _0x28b642={'raw':![],'where':{'id':_0x545385[_0x4f44('0x3c')]['id']}},_0x9e981b={};_0x9e981b[_0x4f44('0x28')]=_[_0x4f44('0x3d')](db[_0x4f44('0x23')][_0x4f44('0x24')]);_0x9e981b['query']=_['keys'](_0x545385[_0x4f44('0x2a')]);_0x9e981b[_0x4f44('0x34')]=_[_0x4f44('0x2b')](_0x9e981b[_0x4f44('0x28')],_0x9e981b[_0x4f44('0x2a')]);_0x28b642[_0x4f44('0x2c')]=_['intersection'](_0x9e981b['model'],qs[_0x4f44('0x2d')](_0x545385[_0x4f44('0x2a')]['fields']));_0x28b642[_0x4f44('0x2c')]=_0x28b642[_0x4f44('0x2c')]['length']?_0x28b642[_0x4f44('0x2c')]:_0x9e981b['model'];if(_0x545385[_0x4f44('0x2a')][_0x4f44('0x3e')]){_0x28b642['include']=[{'all':!![]}];}_0x28b642=_[_0x4f44('0x35')]({},_0x28b642,_0x545385[_0x4f44('0x3f')]);return db['ServicenowAccount'][_0x4f44('0x40')](_0x28b642)[_0x4f44('0x1f')](handleEntityNotFound(_0xee5653,null))[_0x4f44('0x1f')](respondWithResult(_0xee5653,null))[_0x4f44('0x3a')](handleError(_0xee5653,null));};exports[_0x4f44('0x41')]=function(_0x328ad6,_0x150c91){return db[_0x4f44('0x23')][_0x4f44('0x41')](_0x328ad6[_0x4f44('0x42')],{})[_0x4f44('0x1f')](respondWithResult(_0x150c91,0xc9))[_0x4f44('0x3a')](handleError(_0x150c91,null));};exports[_0x4f44('0x1e')]=function(_0x164a58,_0x2fe213){if(_0x164a58[_0x4f44('0x42')]['id']){delete _0x164a58[_0x4f44('0x42')]['id'];}return db[_0x4f44('0x23')][_0x4f44('0x40')]({'where':{'id':_0x164a58[_0x4f44('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2fe213,null))[_0x4f44('0x1f')](saveUpdates(_0x164a58[_0x4f44('0x42')],null))[_0x4f44('0x1f')](respondWithResult(_0x2fe213,null))[_0x4f44('0x3a')](handleError(_0x2fe213,null));};exports[_0x4f44('0x20')]=function(_0x151482,_0x34be5c){return db['ServicenowAccount'][_0x4f44('0x40')]({'where':{'id':_0x151482['params']['id']}})['then'](handleEntityNotFound(_0x34be5c,null))[_0x4f44('0x1f')](removeEntity(_0x34be5c,null))[_0x4f44('0x3a')](handleError(_0x34be5c,null));};exports['getConfigurations']=function(_0x5598c1,_0x2b957a,_0x528550){var _0x388579={};var _0x18c5ac={};var _0x4d7b2a;var _0x11b964;return db['ServicenowAccount'][_0x4f44('0x43')]({'where':{'id':_0x5598c1[_0x4f44('0x3c')]['id']}})[_0x4f44('0x1f')](handleEntityNotFound(_0x2b957a,null))[_0x4f44('0x1f')](function(_0x2829a1){if(_0x2829a1){_0x4d7b2a=_0x2829a1;_0x18c5ac['model']=_[_0x4f44('0x3d')](db[_0x4f44('0x44')][_0x4f44('0x24')]);_0x18c5ac[_0x4f44('0x2a')]=_[_0x4f44('0x3d')](_0x5598c1['query']);_0x18c5ac[_0x4f44('0x34')]=_['intersection'](_0x18c5ac['model'],_0x18c5ac[_0x4f44('0x2a')]);_0x388579[_0x4f44('0x2c')]=_[_0x4f44('0x2b')](_0x18c5ac[_0x4f44('0x28')],qs[_0x4f44('0x2d')](_0x5598c1[_0x4f44('0x2a')][_0x4f44('0x2d')]));_0x388579[_0x4f44('0x2c')]=_0x388579[_0x4f44('0x2c')]['length']?_0x388579['attributes']:_0x18c5ac[_0x4f44('0x28')];_0x388579[_0x4f44('0x30')]=qs[_0x4f44('0x31')](_0x5598c1[_0x4f44('0x2a')]['sort']);_0x388579[_0x4f44('0x32')]=qs[_0x4f44('0x34')](_[_0x4f44('0x33')](_0x5598c1[_0x4f44('0x2a')],_0x18c5ac[_0x4f44('0x34')]));if(_0x5598c1[_0x4f44('0x2a')][_0x4f44('0x37')]){_0x388579['where']=_[_0x4f44('0x35')](_0x388579[_0x4f44('0x32')],{'$or':_[_0x4f44('0x29')](_0x388579[_0x4f44('0x2c')],function(_0x167e5b){var _0x5b28e0={};_0x5b28e0[_0x167e5b]={'$like':'%'+_0x5598c1[_0x4f44('0x2a')][_0x4f44('0x37')]+'%'};return _0x5b28e0;})});}_0x388579=_[_0x4f44('0x35')]({},_0x388579,_0x5598c1['options']);return _0x4d7b2a[_0x4f44('0x45')](_0x388579);}})['then'](function(_0x551b53){if(_0x551b53){_0x11b964=_0x551b53[_0x4f44('0x2e')];if(!_0x5598c1['query'][_0x4f44('0x46')](_0x4f44('0x2f'))){_0x388579['limit']=qs[_0x4f44('0x19')](_0x5598c1[_0x4f44('0x2a')][_0x4f44('0x19')]);_0x388579[_0x4f44('0x17')]=qs[_0x4f44('0x17')](_0x5598c1[_0x4f44('0x2a')][_0x4f44('0x17')]);}return _0x4d7b2a['getConfigurations'](_0x388579);}})[_0x4f44('0x1f')](function(_0x5a0d6e){if(_0x5a0d6e){return _0x5a0d6e?{'count':_0x11b964,'rows':_0x5a0d6e}:null;}})[_0x4f44('0x1f')](respondWithResult(_0x2b957a,null))[_0x4f44('0x3a')](handleError(_0x2b957a,null));};exports[_0x4f44('0x47')]=function(_0x151a4f,_0x2e1fc5,_0x77dd7d){if(_0x151a4f[_0x4f44('0x42')]['id']){delete _0x151a4f[_0x4f44('0x42')]['id'];}return db[_0x4f44('0x23')][_0x4f44('0x43')]({'where':{'id':_0x151a4f['params']['id']}})['then'](handleEntityNotFound(_0x2e1fc5,null))[_0x4f44('0x1f')](function(_0x1e81ce){if(_0x1e81ce){_0x151a4f['body'][_0x4f44('0x48')]=_0x1e81ce['id'];_0x151a4f[_0x4f44('0x42')][_0x4f44('0x49')]=integrations[_0x4f44('0x4a')](_0x151a4f[_0x4f44('0x42')][_0x4f44('0x4b')],_0x151a4f[_0x4f44('0x42')][_0x4f44('0x26')]);_0x151a4f[_0x4f44('0x42')][_0x4f44('0x4c')]=integrations[_0x4f44('0x4d')](_0x151a4f[_0x4f44('0x42')][_0x4f44('0x4b')],_0x151a4f['body'][_0x4f44('0x26')]);return db[_0x4f44('0x44')][_0x4f44('0x41')](_0x151a4f[_0x4f44('0x42')],{'include':[{'model':db[_0x4f44('0x4e')],'as':_0x4f44('0x49')},{'model':db[_0x4f44('0x4e')],'as':_0x4f44('0x4c')}]});}return null;})[_0x4f44('0x1f')](respondWithResult(_0x2e1fc5,null))['catch'](handleError(_0x2e1fc5,null));};exports[_0x4f44('0x4f')]=function(_0xfa9f70,_0x182996,_0x3d909f){var _0x463c59=[_0x4f44('0x50'),_0x4f44('0x51'),_0x4f44('0x52'),_0x4f44('0x53'),_0x4f44('0x54'),_0x4f44('0x55'),_0x4f44('0x56'),_0x4f44('0x57'),_0x4f44('0x58')];var _0x6356a3=[_0x4f44('0x59'),_0x4f44('0x50'),_0x4f44('0x5a'),_0x4f44('0x5b'),_0x4f44('0x5c'),_0x4f44('0x5d'),'child_incidents',_0x4f44('0x51'),_0x4f44('0x5e'),'number',_0x4f44('0x5f'),_0x4f44('0x60'),_0x4f44('0x61'),_0x4f44('0x62'),'sys_created_on',_0x4f44('0x63'),_0x4f44('0x64'),_0x4f44('0x65'),'knowledge',_0x4f44('0x30'),_0x4f44('0x66'),_0x4f44('0x67'),'cmdb_ci','delivery_plan',_0x4f44('0x68'),_0x4f44('0x69'),'work_notes_list','business_service',_0x4f44('0x6a'),_0x4f44('0x6b'),_0x4f44('0x6c'),_0x4f44('0x6d'),_0x4f44('0x6e'),_0x4f44('0x6f'),_0x4f44('0x70'),'group_list',_0x4f44('0x71'),_0x4f44('0x72'),_0x4f44('0x73'),_0x4f44('0x74'),'approval_set',_0x4f44('0x53'),'work_notes',_0x4f44('0x75'),'close_code',_0x4f44('0x76'),_0x4f44('0x77'),_0x4f44('0x78'),_0x4f44('0x79'),_0x4f44('0x7a'),_0x4f44('0x7b'),'description',_0x4f44('0x7c'),'notify',_0x4f44('0x7d'),_0x4f44('0x7e'),_0x4f44('0x7f'),_0x4f44('0x80'),_0x4f44('0x81'),_0x4f44('0x82'),'contact_type',_0x4f44('0x83'),_0x4f44('0x56'),_0x4f44('0x84'),_0x4f44('0x85'),_0x4f44('0x86'),_0x4f44('0x87'),_0x4f44('0x88'),_0x4f44('0x89'),_0x4f44('0x57'),_0x4f44('0x8a'),_0x4f44('0x8b'),_0x4f44('0x8c'),_0x4f44('0x8d'),_0x4f44('0x8e'),_0x4f44('0x8f'),_0x4f44('0x90'),_0x4f44('0x91'),_0x4f44('0x92'),_0x4f44('0x93'),_0x4f44('0x94'),_0x4f44('0x95'),_0x4f44('0x58')];var _0x1cda1a='';var _0x31ff0b='';var _0xb1f990=[];var _0x563d4b='';var _0xd082bd='';var _0x20a075=[];var _0x62bf30='';var _0x3c9bf7='';var _0x415e0b={};var _0x795ce5='';return db[_0x4f44('0x23')][_0x4f44('0x43')]({'where':{'id':_0xfa9f70['params']['id']},'attributes':['id','username',_0x4f44('0x96'),_0x4f44('0x97'),'remoteUri',_0x4f44('0x98')]})[_0x4f44('0x1f')](handleEntityNotFound(_0x182996,null))[_0x4f44('0x1f')](function(_0x1836b9){if(_0x1836b9){_0x795ce5=_0x1836b9[_0x4f44('0x99')];var _0x490a1f=_0x795ce5[_0x4f44('0x9a')](-0x1);if(_0x490a1f==='/'){_0x795ce5=_0x795ce5['substring'](0x0,_0x795ce5[_0x4f44('0x9b')](_0x490a1f));}_0x3c9bf7=util[_0x4f44('0x9c')](_0x4f44('0x9d'),_0x795ce5);_0x62bf30=util['format']('%s/api/now/table/',_0x795ce5);_0x415e0b={'user':_0x1836b9[_0x4f44('0x9e')],'pass':_0x1836b9[_0x4f44('0x96')]};var _0x2c9e5c={'method':'GET','uri':_0x3c9bf7+_0x4f44('0x9f'),'auth':_0x415e0b,'json':!![]};return rp(_0x2c9e5c);}})[_0x4f44('0x1f')](function(_0x35e726){if(_0x35e726[_0x4f44('0xa0')][_0x4f44('0x2e')]>0x0){_0x1cda1a=_0x35e726[_0x4f44('0xa0')];}console[_0x4f44('0xa1')](_0x4f44('0xa2'),_0x1cda1a);_0x20a075=[];_0x31ff0b=Object[_0x4f44('0xa3')]([],_0x1cda1a);_[_0x4f44('0xa4')](_0x31ff0b,function(_0x948519){return!_0x463c59[_0x4f44('0xa5')](_0x948519[_0x4f44('0x21')]);});_0x31ff0b[_0x4f44('0xa6')](function(_0x41acde){var _0x1116aa=createFieldObject(_0x62bf30,_0x415e0b,_0x41acde[_0x4f44('0xa7')],_0x41acde[_0x4f44('0x21')],_0x41acde['label'],![]);_0x20a075['push'](_0x1116aa);});return Promise[_0x4f44('0xa8')](_0x20a075);})[_0x4f44('0x1f')](function(_0x3c0f3b){_0xb1f990=_0x3c0f3b;_0x563d4b=Object[_0x4f44('0xa3')]([],_0x1cda1a);console[_0x4f44('0xa1')](_0x4f44('0xa9'),_0x1cda1a);_['remove'](_0x563d4b,function(_0x2b0539){return _0x6356a3[_0x4f44('0xa5')](_0x2b0539[_0x4f44('0x21')]);});console[_0x4f44('0xa1')](_0x4f44('0xaa'),_0x563d4b);_0x20a075=[];_0x563d4b[_0x4f44('0xa6')](function(_0x560dca){var _0x10da01=createFieldObject(_0x62bf30,_0x415e0b,_0x560dca[_0x4f44('0xa7')],_0x560dca[_0x4f44('0x21')],_0x560dca['label'],!![]);_0x20a075[_0x4f44('0xab')](_0x10da01);});return Promise['all'](_0x20a075);})['then'](function(_0x3ae0f4){_0xd082bd=_0x3ae0f4;var _0x48283f=_0xb1f990[_0x4f44('0xac')](_0xd082bd);return{'count':_0x48283f[_0x4f44('0x2e')],'rows':_0x48283f};})['then'](respondWithResult(_0x182996,null))[_0x4f44('0x3a')](function(_0x2bb489){console[_0x4f44('0xa1')](_0x4f44('0xad')+_0x2bb489);var _0x5a5ac6=_0xfa9f70[_0x4f44('0x2a')][_0x4f44('0xae')]?0x1f4:_0x2bb489[_0x4f44('0xaf')]||0x1f4;logger[_0x4f44('0xb0')](_0x2bb489[_0x4f44('0xb1')]);delete _0x2bb489[_0x4f44('0x21')];if(_0x5a5ac6===0x191){_0x5a5ac6=0x190;}_0x182996[_0x4f44('0x14')](_0x5a5ac6)[_0x4f44('0xb2')](_0xfa9f70[_0x4f44('0x2a')][_0x4f44('0xae')]?{'message':_0x4f44('0xb3'),'statusCode':_0x2bb489['statusCode']}:_0x2bb489);});};function createFieldObject(_0x50979a,_0x4f1a07,_0x533a78,_0x3fc2b0,_0x1bb069,_0x270a4b){return new Promise(function(_0x46dc17,_0x308d8c){var _0x25d3d5={'id':_0x3fc2b0,'name':_0x1bb069,'custom':_0x270a4b};if(_0x533a78===_0x4f44('0xb4')){_0x25d3d5['options']=[{'name':_0x4f44('0xb5'),'value':_0x4f44('0xb6')},{'name':_0x4f44('0xb7'),'value':_0x4f44('0xb8')}];_0x46dc17(_0x25d3d5);}else{var _0x480995={'method':_0x4f44('0xb9'),'uri':_0x50979a+_0x4f44('0xba')+_0x3fc2b0,'auth':_0x4f1a07,'json':!![]};return rp(_0x480995)['then'](function(_0x746ddf){var _0x127750=[];if(_0x746ddf[_0x4f44('0xa0')][_0x4f44('0x2e')]>0x0){_0x746ddf[_0x4f44('0xa0')][_0x4f44('0xa6')](function(_0x4d3d09){if(_0x4d3d09[_0x4f44('0xbb')]===_0x4f44('0xb8')){var _0x271082={'name':_0x4d3d09['label'],'value':_0x4d3d09[_0x4f44('0xbc')]};_0x127750[_0x4f44('0xab')](_0x271082);}});}_0x25d3d5[_0x4f44('0x3f')]=_0x127750;if(_0x25d3d5[_0x4f44('0x3f')]['length']>0x0){_0x46dc17(_0x25d3d5);}else{if(_0x270a4b==![]){_0x46dc17();}else{_0x46dc17(_0x25d3d5);}}});}});}
\ No newline at end of file
+var _0xbae8=['upon_reject','sys_updated_on','number','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','opened_at','business_duration','reopened_time','resolved_at','caller_id','work_notes','short_description','close_code','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','notify','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','reassignment_count','assigned_to','comments','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','request-promise','bluebird','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','error','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','show','params','keys','find','create','catch','body','getConfigurations','ServicenowConfiguration','length','order','addConfiguration','AccountId','Subjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','knowledge','subcategory','severity','category','parent','watch_list'];(function(_0x2a5842,_0x3c5cbf){var _0x10210f=function(_0x414474){while(--_0x414474){_0x2a5842['push'](_0x2a5842['shift']());}};_0x10210f(++_0x3c5cbf);}(_0xbae8,0x10c));var _0x8bae=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0xbae8[_0x3be0c4];return _0x11af9f;};'use strict';var emlformat=require(_0x8bae('0x0'));var rimraf=require(_0x8bae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8bae('0x2'));var moment=require('moment');var BPromise=require(_0x8bae('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8bae('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bae('0x5'));var _=require(_0x8bae('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8bae('0x7'));var deskjs=require(_0x8bae('0x8'));var toCsv=require(_0x8bae('0x9'));var querystring=require(_0x8bae('0xa'));var Papa=require(_0x8bae('0xb'));var Redis=require(_0x8bae('0xc'));var authService=require(_0x8bae('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x8bae('0xe'));var hardwareService=require(_0x8bae('0xf'));var logger=require('../../config/logger')(_0x8bae('0x10'));var utils=require('../../config/utils');var config=require(_0x8bae('0x11'));var licenseUtil=require(_0x8bae('0x12'));var db=require(_0x8bae('0x13'))['db'];var integrations=require(_0x8bae('0x14'));function respondWithStatusCode(_0x345667,_0x5da198){_0x5da198=_0x5da198||0xcc;return function(_0x50a8d6){if(_0x50a8d6){return _0x345667['sendStatus'](_0x5da198);}return _0x345667[_0x8bae('0x15')](_0x5da198)[_0x8bae('0x16')]();};}function respondWithResult(_0x41f9e4,_0x5e4da8){_0x5e4da8=_0x5e4da8||0xc8;return function(_0x122879){if(_0x122879){return _0x41f9e4['status'](_0x5e4da8)[_0x8bae('0x17')](_0x122879);}};}function respondWithFilteredResult(_0x2b3e22,_0x1efde0){return function(_0x395886){if(_0x395886){var _0x3b0f59=typeof _0x1efde0['offset']===_0x8bae('0x18')&&typeof _0x1efde0[_0x8bae('0x19')]===_0x8bae('0x18');var _0x48260e=_0x395886[_0x8bae('0x1a')];var _0x3c2a6c=_0x3b0f59?0x0:_0x1efde0['offset'];var _0x1de1f6=_0x3b0f59?_0x395886[_0x8bae('0x1a')]:_0x1efde0[_0x8bae('0x1b')]+_0x1efde0[_0x8bae('0x19')];var _0x1e5cfa;if(_0x1de1f6>=_0x48260e){_0x1de1f6=_0x48260e;_0x1e5cfa=0xc8;}else{_0x1e5cfa=0xce;}_0x2b3e22['status'](_0x1e5cfa);return _0x2b3e22[_0x8bae('0x1c')](_0x8bae('0x1d'),_0x3c2a6c+'-'+_0x1de1f6+'/'+_0x48260e)[_0x8bae('0x17')](_0x395886);}return null;};}function patchUpdates(_0x53acd5){return function(_0x5005cf){try{jsonpatch[_0x8bae('0x1e')](_0x5005cf,_0x53acd5,!![]);}catch(_0x4172d4){return BPromise['reject'](_0x4172d4);}return _0x5005cf['save']();};}function saveUpdates(_0x10177c,_0x510a5f){return function(_0x50869d){if(_0x50869d){return _0x50869d[_0x8bae('0x1f')](_0x10177c)['then'](function(_0x1acd45){return _0x1acd45;});}return null;};}function removeEntity(_0x10c349,_0x3bee9e){return function(_0x45bf3a){if(_0x45bf3a){return _0x45bf3a[_0x8bae('0x20')]()[_0x8bae('0x21')](function(){_0x10c349[_0x8bae('0x15')](0xcc)[_0x8bae('0x16')]();});}};}function handleEntityNotFound(_0x3785a3,_0x1c42c1){return function(_0x371d1e){if(!_0x371d1e){_0x3785a3['sendStatus'](0x194);}return _0x371d1e;};}function handleError(_0x25b289,_0x2e2422){_0x2e2422=_0x2e2422||0x1f4;return function(_0x209b14){logger[_0x8bae('0x22')](_0x209b14[_0x8bae('0x23')]);if(_0x209b14[_0x8bae('0x24')]){delete _0x209b14[_0x8bae('0x24')];}_0x25b289[_0x8bae('0x15')](_0x2e2422)['send'](_0x209b14);};}exports[_0x8bae('0x25')]=function(_0x53c367,_0xc1aa43){var _0x3467fa={},_0x473693={},_0x4ac247={'count':0x0,'rows':[]};var _0x4c51fb=_[_0x8bae('0x26')](db[_0x8bae('0x27')][_0x8bae('0x28')],function(_0xe77a07){return{'name':_0xe77a07[_0x8bae('0x29')],'type':_0xe77a07[_0x8bae('0x2a')][_0x8bae('0x2b')]};});_0x473693[_0x8bae('0x2c')]=_['map'](_0x4c51fb,_0x8bae('0x24'));_0x473693['query']=_['keys'](_0x53c367[_0x8bae('0x2d')]);_0x473693[_0x8bae('0x2e')]=_[_0x8bae('0x2f')](_0x473693['model'],_0x473693[_0x8bae('0x2d')]);_0x3467fa[_0x8bae('0x30')]=_[_0x8bae('0x2f')](_0x473693[_0x8bae('0x2c')],qs[_0x8bae('0x31')](_0x53c367['query'][_0x8bae('0x31')]));_0x3467fa[_0x8bae('0x30')]=_0x3467fa[_0x8bae('0x30')]['length']?_0x3467fa[_0x8bae('0x30')]:_0x473693['model'];if(!_0x53c367[_0x8bae('0x2d')][_0x8bae('0x32')](_0x8bae('0x33'))){_0x3467fa[_0x8bae('0x19')]=qs[_0x8bae('0x19')](_0x53c367[_0x8bae('0x2d')][_0x8bae('0x19')]);_0x3467fa[_0x8bae('0x1b')]=qs[_0x8bae('0x1b')](_0x53c367['query'][_0x8bae('0x1b')]);}_0x3467fa['order']=qs[_0x8bae('0x34')](_0x53c367[_0x8bae('0x2d')][_0x8bae('0x34')]);_0x3467fa[_0x8bae('0x35')]=qs['filters'](_[_0x8bae('0x36')](_0x53c367[_0x8bae('0x2d')],_0x473693[_0x8bae('0x2e')]),_0x4c51fb);if(_0x53c367['query'][_0x8bae('0x37')]){_0x3467fa['where']=_[_0x8bae('0x38')](_0x3467fa[_0x8bae('0x35')],{'$or':_[_0x8bae('0x26')](_0x4c51fb,function(_0x167527){if(_0x167527[_0x8bae('0x2a')]!=='VIRTUAL'){var _0x4f4362={};_0x4f4362[_0x167527['name']]={'$like':'%'+_0x53c367[_0x8bae('0x2d')]['filter']+'%'};return _0x4f4362;}})});}_0x3467fa=_[_0x8bae('0x38')]({},_0x3467fa,_0x53c367[_0x8bae('0x39')]);var _0x2e5015={'where':_0x3467fa['where']};return db['ServicenowAccount'][_0x8bae('0x1a')](_0x2e5015)[_0x8bae('0x21')](function(_0x3c6838){_0x4ac247[_0x8bae('0x1a')]=_0x3c6838;if(_0x53c367[_0x8bae('0x2d')]['includeAll']){_0x3467fa[_0x8bae('0x3a')]=[{'all':!![]}];}return db[_0x8bae('0x27')]['findAll'](_0x3467fa);})['then'](function(_0xa3e536){_0x4ac247[_0x8bae('0x3b')]=_0xa3e536;return _0x4ac247;})[_0x8bae('0x21')](respondWithFilteredResult(_0xc1aa43,_0x3467fa))['catch'](handleError(_0xc1aa43,null));};exports[_0x8bae('0x3c')]=function(_0x26fcf5,_0x45b48b){var _0x3c018b={'raw':![],'where':{'id':_0x26fcf5[_0x8bae('0x3d')]['id']}},_0x18b60b={};_0x18b60b['model']=_[_0x8bae('0x3e')](db[_0x8bae('0x27')]['rawAttributes']);_0x18b60b['query']=_[_0x8bae('0x3e')](_0x26fcf5[_0x8bae('0x2d')]);_0x18b60b['filters']=_[_0x8bae('0x2f')](_0x18b60b[_0x8bae('0x2c')],_0x18b60b[_0x8bae('0x2d')]);_0x3c018b[_0x8bae('0x30')]=_[_0x8bae('0x2f')](_0x18b60b[_0x8bae('0x2c')],qs[_0x8bae('0x31')](_0x26fcf5[_0x8bae('0x2d')][_0x8bae('0x31')]));_0x3c018b['attributes']=_0x3c018b['attributes']['length']?_0x3c018b[_0x8bae('0x30')]:_0x18b60b[_0x8bae('0x2c')];if(_0x26fcf5[_0x8bae('0x2d')]['includeAll']){_0x3c018b['include']=[{'all':!![]}];}_0x3c018b=_[_0x8bae('0x38')]({},_0x3c018b,_0x26fcf5[_0x8bae('0x39')]);return db[_0x8bae('0x27')][_0x8bae('0x3f')](_0x3c018b)[_0x8bae('0x21')](handleEntityNotFound(_0x45b48b,null))[_0x8bae('0x21')](respondWithResult(_0x45b48b,null))['catch'](handleError(_0x45b48b,null));};exports['create']=function(_0x47d4b7,_0x16b2fe){return db[_0x8bae('0x27')][_0x8bae('0x40')](_0x47d4b7['body'],{})[_0x8bae('0x21')](respondWithResult(_0x16b2fe,0xc9))[_0x8bae('0x41')](handleError(_0x16b2fe,null));};exports[_0x8bae('0x1f')]=function(_0x2b0c00,_0x3a6525){if(_0x2b0c00[_0x8bae('0x42')]['id']){delete _0x2b0c00[_0x8bae('0x42')]['id'];}return db[_0x8bae('0x27')][_0x8bae('0x3f')]({'where':{'id':_0x2b0c00['params']['id']}})[_0x8bae('0x21')](handleEntityNotFound(_0x3a6525,null))[_0x8bae('0x21')](saveUpdates(_0x2b0c00['body'],null))[_0x8bae('0x21')](respondWithResult(_0x3a6525,null))[_0x8bae('0x41')](handleError(_0x3a6525,null));};exports[_0x8bae('0x20')]=function(_0x327056,_0x9b5938){return db['ServicenowAccount'][_0x8bae('0x3f')]({'where':{'id':_0x327056[_0x8bae('0x3d')]['id']}})['then'](handleEntityNotFound(_0x9b5938,null))[_0x8bae('0x21')](removeEntity(_0x9b5938,null))['catch'](handleError(_0x9b5938,null));};exports[_0x8bae('0x43')]=function(_0x5cfe39,_0x11bc29,_0x469cbe){var _0x278beb={};var _0x89b12f={};var _0x545f66;var _0x5b8735;return db[_0x8bae('0x27')]['findOne']({'where':{'id':_0x5cfe39[_0x8bae('0x3d')]['id']}})[_0x8bae('0x21')](handleEntityNotFound(_0x11bc29,null))[_0x8bae('0x21')](function(_0x39be1e){if(_0x39be1e){_0x545f66=_0x39be1e;_0x89b12f[_0x8bae('0x2c')]=_[_0x8bae('0x3e')](db[_0x8bae('0x44')]['rawAttributes']);_0x89b12f[_0x8bae('0x2d')]=_[_0x8bae('0x3e')](_0x5cfe39[_0x8bae('0x2d')]);_0x89b12f['filters']=_[_0x8bae('0x2f')](_0x89b12f[_0x8bae('0x2c')],_0x89b12f['query']);_0x278beb[_0x8bae('0x30')]=_[_0x8bae('0x2f')](_0x89b12f['model'],qs[_0x8bae('0x31')](_0x5cfe39['query'][_0x8bae('0x31')]));_0x278beb[_0x8bae('0x30')]=_0x278beb[_0x8bae('0x30')][_0x8bae('0x45')]?_0x278beb[_0x8bae('0x30')]:_0x89b12f[_0x8bae('0x2c')];_0x278beb[_0x8bae('0x46')]=qs[_0x8bae('0x34')](_0x5cfe39['query'][_0x8bae('0x34')]);_0x278beb['where']=qs[_0x8bae('0x2e')](_[_0x8bae('0x36')](_0x5cfe39[_0x8bae('0x2d')],_0x89b12f[_0x8bae('0x2e')]));if(_0x5cfe39['query'][_0x8bae('0x37')]){_0x278beb[_0x8bae('0x35')]=_[_0x8bae('0x38')](_0x278beb['where'],{'$or':_[_0x8bae('0x26')](_0x278beb[_0x8bae('0x30')],function(_0x3a7e15){var _0x516a07={};_0x516a07[_0x3a7e15]={'$like':'%'+_0x5cfe39['query'][_0x8bae('0x37')]+'%'};return _0x516a07;})});}_0x278beb=_[_0x8bae('0x38')]({},_0x278beb,_0x5cfe39[_0x8bae('0x39')]);return _0x545f66[_0x8bae('0x43')](_0x278beb);}})[_0x8bae('0x21')](function(_0xb028c3){if(_0xb028c3){_0x5b8735=_0xb028c3[_0x8bae('0x45')];if(!_0x5cfe39['query'][_0x8bae('0x32')](_0x8bae('0x33'))){_0x278beb[_0x8bae('0x19')]=qs['limit'](_0x5cfe39[_0x8bae('0x2d')][_0x8bae('0x19')]);_0x278beb['offset']=qs[_0x8bae('0x1b')](_0x5cfe39[_0x8bae('0x2d')][_0x8bae('0x1b')]);}return _0x545f66[_0x8bae('0x43')](_0x278beb);}})['then'](function(_0x24fb7d){if(_0x24fb7d){return _0x24fb7d?{'count':_0x5b8735,'rows':_0x24fb7d}:null;}})[_0x8bae('0x21')](respondWithResult(_0x11bc29,null))[_0x8bae('0x41')](handleError(_0x11bc29,null));};exports[_0x8bae('0x47')]=function(_0x435557,_0x297b3f,_0x1d7408){if(_0x435557[_0x8bae('0x42')]['id']){delete _0x435557[_0x8bae('0x42')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x435557[_0x8bae('0x3d')]['id']}})['then'](handleEntityNotFound(_0x297b3f,null))[_0x8bae('0x21')](function(_0x5d6d8d){if(_0x5d6d8d){_0x435557[_0x8bae('0x42')][_0x8bae('0x48')]=_0x5d6d8d['id'];_0x435557['body'][_0x8bae('0x49')]=integrations['getSubjects'](_0x435557[_0x8bae('0x42')][_0x8bae('0x4a')],_0x435557[_0x8bae('0x42')][_0x8bae('0x2a')]);_0x435557['body']['Descriptions']=integrations[_0x8bae('0x4b')](_0x435557['body'][_0x8bae('0x4a')],_0x435557[_0x8bae('0x42')][_0x8bae('0x2a')]);return db[_0x8bae('0x44')][_0x8bae('0x40')](_0x435557[_0x8bae('0x42')],{'include':[{'model':db[_0x8bae('0x4c')],'as':_0x8bae('0x49')},{'model':db[_0x8bae('0x4c')],'as':_0x8bae('0x4d')}]});}return null;})[_0x8bae('0x21')](respondWithResult(_0x297b3f,null))[_0x8bae('0x41')](handleError(_0x297b3f,null));};exports[_0x8bae('0x4e')]=function(_0xe4bf1e,_0x4bc969,_0x5d4dd5){var _0x1ee4c3=[_0x8bae('0x4f'),'hold_reason',_0x8bae('0x50'),_0x8bae('0x51'),'close_code','notify','incident_state',_0x8bae('0x52'),_0x8bae('0x53')];var _0x219a74=[_0x8bae('0x54'),'made_sla','caused_by',_0x8bae('0x55'),_0x8bae('0x56'),_0x8bae('0x57'),'child_incidents','hold_reason','approval_history',_0x8bae('0x58'),_0x8bae('0x59'),_0x8bae('0x5a'),_0x8bae('0x5b'),'user_input',_0x8bae('0x5c'),'sys_domain',_0x8bae('0x5d'),_0x8bae('0x5e'),_0x8bae('0x50'),'order',_0x8bae('0x5f'),_0x8bae('0x60'),_0x8bae('0x61'),_0x8bae('0x62'),_0x8bae('0x63'),_0x8bae('0x64'),_0x8bae('0x65'),_0x8bae('0x66'),_0x8bae('0x67'),_0x8bae('0x68'),'rfc',_0x8bae('0x69'),'expected_start',_0x8bae('0x6a'),_0x8bae('0x6b'),'group_list','work_end',_0x8bae('0x6c'),_0x8bae('0x6d'),_0x8bae('0x6e'),'approval_set',_0x8bae('0x51'),_0x8bae('0x6f'),_0x8bae('0x70'),_0x8bae('0x71'),_0x8bae('0x72'),_0x8bae('0x73'),'work_start',_0x8bae('0x74'),_0x8bae('0x75'),_0x8bae('0x76'),_0x8bae('0x77'),'calendar_duration',_0x8bae('0x78'),_0x8bae('0x79'),_0x8bae('0x7a'),_0x8bae('0x7b'),'follow_up',_0x8bae('0x7c'),_0x8bae('0x7d'),_0x8bae('0x7e'),_0x8bae('0x7f'),_0x8bae('0x80'),_0x8bae('0x81'),_0x8bae('0x82'),'company',_0x8bae('0x83'),'activity_due',_0x8bae('0x84'),_0x8bae('0x52'),_0x8bae('0x85'),'sla_due',_0x8bae('0x86'),'comments_and_work_notes',_0x8bae('0x87'),_0x8bae('0x88'),_0x8bae('0x89'),_0x8bae('0x8a'),_0x8bae('0x8b'),_0x8bae('0x8c'),_0x8bae('0x8d'),_0x8bae('0x8e'),_0x8bae('0x53')];var _0x34e4cb='';var _0x1721b3='';var _0x5c40c5=[];var _0x43f347='';var _0x44ac94='';var _0x4f8ba1=[];var _0x13939f='';var _0x202f89='';var _0x2af6a1={};var _0x575d6f='';return db[_0x8bae('0x27')]['findOne']({'where':{'id':_0xe4bf1e[_0x8bae('0x3d')]['id']},'attributes':['id',_0x8bae('0x8f'),_0x8bae('0x90'),_0x8bae('0x91'),'remoteUri','serverUrl']})[_0x8bae('0x21')](handleEntityNotFound(_0x4bc969,null))[_0x8bae('0x21')](function(_0x1535fd){if(_0x1535fd){_0x575d6f=_0x1535fd[_0x8bae('0x92')];var _0x190d5d=_0x575d6f[_0x8bae('0x93')](-0x1);if(_0x190d5d==='/'){_0x575d6f=_0x575d6f[_0x8bae('0x94')](0x0,_0x575d6f[_0x8bae('0x95')](_0x190d5d));}_0x202f89=util[_0x8bae('0x96')](_0x8bae('0x97'),_0x575d6f);_0x13939f=util[_0x8bae('0x96')](_0x8bae('0x98'),_0x575d6f);_0x2af6a1={'user':_0x1535fd[_0x8bae('0x8f')],'pass':_0x1535fd[_0x8bae('0x90')]};var _0x90287f={'method':_0x8bae('0x99'),'uri':_0x202f89+_0x8bae('0x9a'),'auth':_0x2af6a1,'json':!![]};return rp(_0x90287f);}})[_0x8bae('0x21')](function(_0x414f34){if(_0x414f34['result'][_0x8bae('0x45')]>0x0){_0x34e4cb=_0x414f34[_0x8bae('0x9b')];}console['log'](_0x8bae('0x9c'),_0x34e4cb);_0x4f8ba1=[];_0x1721b3=Object[_0x8bae('0x9d')]([],_0x34e4cb);_[_0x8bae('0x9e')](_0x1721b3,function(_0x560362){return!_0x1ee4c3[_0x8bae('0x9f')](_0x560362[_0x8bae('0x24')]);});_0x1721b3['forEach'](function(_0x599825){var _0x2c0f18=createFieldObject(_0x13939f,_0x2af6a1,_0x599825['internalType'],_0x599825[_0x8bae('0x24')],_0x599825['label'],![]);_0x4f8ba1[_0x8bae('0xa0')](_0x2c0f18);});return Promise[_0x8bae('0xa1')](_0x4f8ba1);})[_0x8bae('0x21')](function(_0x76a1e0){_0x5c40c5=_0x76a1e0;_0x43f347=Object[_0x8bae('0x9d')]([],_0x34e4cb);console[_0x8bae('0xa2')](_0x8bae('0xa3'),_0x34e4cb);_[_0x8bae('0x9e')](_0x43f347,function(_0x5a32e9){return _0x219a74[_0x8bae('0x9f')](_0x5a32e9[_0x8bae('0x24')]);});console[_0x8bae('0xa2')](_0x8bae('0xa4'),_0x43f347);_0x4f8ba1=[];_0x43f347['forEach'](function(_0x34154b){var _0xc91ecc=createFieldObject(_0x13939f,_0x2af6a1,_0x34154b['internalType'],_0x34154b['name'],_0x34154b[_0x8bae('0xa5')],!![]);_0x4f8ba1['push'](_0xc91ecc);});return Promise[_0x8bae('0xa1')](_0x4f8ba1);})['then'](function(_0x1fdb8){_0x44ac94=_0x1fdb8;var _0xe0b0c6=_0x5c40c5[_0x8bae('0xa6')](_0x44ac94);return{'count':_0xe0b0c6[_0x8bae('0x45')],'rows':_0xe0b0c6};})['then'](respondWithResult(_0x4bc969,null))[_0x8bae('0x41')](function(_0x367979){console[_0x8bae('0xa2')](_0x8bae('0xa7')+_0x367979);var _0x3a1a33=_0xe4bf1e[_0x8bae('0x2d')][_0x8bae('0xa8')]?0x1f4:_0x367979['statusCode']||0x1f4;logger[_0x8bae('0x22')](_0x367979[_0x8bae('0x23')]);delete _0x367979[_0x8bae('0x24')];if(_0x3a1a33===0x191){_0x3a1a33=0x190;}_0x4bc969[_0x8bae('0x15')](_0x3a1a33)['send'](_0xe4bf1e['query'][_0x8bae('0xa8')]?{'message':_0x8bae('0xa9'),'statusCode':_0x367979['statusCode']}:_0x367979);});};function createFieldObject(_0x3fba86,_0x17015d,_0x3a3e44,_0x335fd1,_0x390d8b,_0x2d765d){return new Promise(function(_0x5dc926,_0x4deb9f){var _0x15e5a2={'id':_0x335fd1,'name':_0x390d8b,'custom':_0x2d765d};if(_0x3a3e44===_0x8bae('0xaa')){_0x15e5a2[_0x8bae('0x39')]=[{'name':_0x8bae('0xab'),'value':_0x8bae('0xac')},{'name':_0x8bae('0xad'),'value':_0x8bae('0xae')}];_0x5dc926(_0x15e5a2);}else{var _0xec0fb={'method':_0x8bae('0x99'),'uri':_0x3fba86+_0x8bae('0xaf')+_0x335fd1,'auth':_0x17015d,'json':!![]};return rp(_0xec0fb)[_0x8bae('0x21')](function(_0x12d103){var _0x164b53=[];if(_0x12d103[_0x8bae('0x9b')][_0x8bae('0x45')]>0x0){_0x12d103[_0x8bae('0x9b')]['forEach'](function(_0xb46546){if(_0xb46546[_0x8bae('0xb0')]===_0x8bae('0xae')){var _0x370243={'name':_0xb46546[_0x8bae('0xa5')],'value':_0xb46546['value']};_0x164b53[_0x8bae('0xa0')](_0x370243);}});}_0x15e5a2[_0x8bae('0x39')]=_0x164b53;if(_0x15e5a2['options'][_0x8bae('0x45')]>0x0){_0x5dc926(_0x15e5a2);}else{if(_0x2d765d==![]){_0x5dc926();}else{_0x5dc926(_0x15e5a2);}}});}});}
\ No newline at end of file
index 19d91f8..78a0352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0xddca13,_0x4b1ce8){var _0x55f195=function(_0x53ae0f){while(--_0x53ae0f){_0xddca13['push'](_0xddca13['shift']());}};_0x55f195(++_0x4b1ce8);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2e49ae,_0x27bee9){_0x2e49ae=_0x2e49ae-0x0;var _0x4dec92=_0xbd51[_0x2e49ae];return _0x4dec92;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabce=['path','rimraf','../../config/environment','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0xabce,0x103));var _0xeabc=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xabce[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xeabc('0x8')]=function(_0x52a4d7,_0x229ba4){return _0x52a4d7['define'](_0xeabc('0x9'),attributes,{'tableName':_0xeabc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4944912..5d154d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf836=['code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','stringify','ShowServicenowAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x4c74fe,_0x27d3e3){var _0xf491a1=function(_0x305bbd){while(--_0x305bbd){_0x4c74fe['push'](_0x4c74fe['shift']());}};_0xf491a1(++_0x27d3e3);}(_0xf836,0x16f));var _0x6f83=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf836[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6f83('0x0'));var util=require(_0x6f83('0x1'));var moment=require(_0x6f83('0x2'));var BPromise=require(_0x6f83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f83('0x4'));var db=require(_0x6f83('0x5'))['db'];var utils=require(_0x6f83('0x6'));var logger=require(_0x6f83('0x7'))(_0x6f83('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6f83('0x9')][_0x6f83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48a1fa,_0xeef123,_0xc525aa){return new BPromise(function(_0x902c81,_0x2fa34c){return client[_0x6f83('0xb')](_0x48a1fa,_0xc525aa)[_0x6f83('0xc')](function(_0x2afda0){logger[_0x6f83('0xd')](_0x6f83('0xe'),_0xeef123,_0x6f83('0xf'));logger[_0x6f83('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xeef123,'request\x20sent',JSON['stringify'](_0x2afda0));if(_0x2afda0['error']){if(_0x2afda0[_0x6f83('0x11')][_0x6f83('0x12')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0xeef123,_0x2afda0['error'][_0x6f83('0x13')]);return _0x2fa34c(_0x2afda0[_0x6f83('0x11')]['message']);}logger[_0x6f83('0x11')](_0x6f83('0xe'),_0xeef123,_0x2afda0[_0x6f83('0x11')][_0x6f83('0x13')]);return _0x902c81(_0x2afda0[_0x6f83('0x11')][_0x6f83('0x13')]);}else{logger[_0x6f83('0xd')](_0x6f83('0xe'),_0xeef123,'request\x20sent');_0x902c81(_0x2afda0[_0x6f83('0x14')][_0x6f83('0x13')]);}})[_0x6f83('0x15')](function(_0x25c27c){logger[_0x6f83('0x11')](_0x6f83('0xe'),_0xeef123,_0x25c27c);_0x2fa34c(_0x25c27c);});});}exports[_0x6f83('0x16')]=function(_0x3fca39){var _0x261022=this;return new Promise(function(_0x238a36,_0x2fda79){return db[_0x6f83('0x17')][_0x6f83('0x18')]({'raw':_0x3fca39[_0x6f83('0x19')]?_0x3fca39[_0x6f83('0x19')][_0x6f83('0x1a')]===undefined?!![]:![]:!![],'where':_0x3fca39[_0x6f83('0x19')]?_0x3fca39[_0x6f83('0x19')][_0x6f83('0x1b')]||null:null,'attributes':_0x3fca39['options']?_0x3fca39[_0x6f83('0x19')][_0x6f83('0x1c')]||null:null,'limit':_0x3fca39[_0x6f83('0x19')]?_0x3fca39[_0x6f83('0x19')]['limit']||null:null,'include':_0x3fca39[_0x6f83('0x19')]?_0x3fca39['options'][_0x6f83('0x1d')]?_[_0x6f83('0x1e')](_0x3fca39[_0x6f83('0x19')][_0x6f83('0x1d')],function(_0x76c5f3){return{'model':db[_0x76c5f3['model']],'as':_0x76c5f3['as'],'attributes':_0x76c5f3['attributes'],'include':_0x76c5f3['include']?_[_0x6f83('0x1e')](_0x76c5f3[_0x6f83('0x1d')],function(_0x2856cb){return{'model':db[_0x2856cb[_0x6f83('0x1f')]],'as':_0x2856cb['as'],'attributes':_0x2856cb[_0x6f83('0x1c')],'include':_0x2856cb[_0x6f83('0x1d')]?_['map'](_0x2856cb[_0x6f83('0x1d')],function(_0x10d9cd){return{'model':db[_0x10d9cd[_0x6f83('0x1f')]],'as':_0x10d9cd['as'],'attributes':_0x10d9cd[_0x6f83('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6f83('0xc')](function(_0x4a9d37){logger[_0x6f83('0xd')](_0x6f83('0x16'),_0x3fca39);logger[_0x6f83('0x10')](_0x6f83('0x16'),_0x3fca39,JSON[_0x6f83('0x20')](_0x4a9d37));_0x238a36(_0x4a9d37);})[_0x6f83('0x15')](function(_0x796ae8){logger[_0x6f83('0x11')](_0x6f83('0x16'),_0x796ae8['message'],_0x3fca39);_0x2fda79(_0x261022['error'](0x1f4,_0x796ae8['message']));});});};exports[_0x6f83('0x21')]=function(_0x4c8cbe){var _0x13c06c=this;return new Promise(function(_0x6f10eb,_0x34f20f){return db[_0x6f83('0x17')][_0x6f83('0x22')]({'raw':_0x4c8cbe['options']?_0x4c8cbe[_0x6f83('0x19')][_0x6f83('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c8cbe[_0x6f83('0x19')]?_0x4c8cbe['options']['where']||null:null,'attributes':_0x4c8cbe[_0x6f83('0x19')]?_0x4c8cbe[_0x6f83('0x19')][_0x6f83('0x1c')]||null:null,'include':_0x4c8cbe['options']?_0x4c8cbe[_0x6f83('0x19')][_0x6f83('0x1d')]?_[_0x6f83('0x1e')](_0x4c8cbe['options'][_0x6f83('0x1d')],function(_0x38b2dd){return{'model':db[_0x38b2dd[_0x6f83('0x1f')]],'as':_0x38b2dd['as'],'attributes':_0x38b2dd[_0x6f83('0x1c')],'include':_0x38b2dd[_0x6f83('0x1d')]?_[_0x6f83('0x1e')](_0x38b2dd[_0x6f83('0x1d')],function(_0x214377){return{'model':db[_0x214377[_0x6f83('0x1f')]],'as':_0x214377['as'],'attributes':_0x214377[_0x6f83('0x1c')],'include':_0x214377[_0x6f83('0x1d')]?_['map'](_0x214377[_0x6f83('0x1d')],function(_0x40ccbc){return{'model':db[_0x40ccbc[_0x6f83('0x1f')]],'as':_0x40ccbc['as'],'attributes':_0x40ccbc[_0x6f83('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6f83('0xc')](function(_0x4de383){logger[_0x6f83('0xd')](_0x6f83('0x21'),_0x4c8cbe);logger[_0x6f83('0x10')](_0x6f83('0x21'),_0x4c8cbe,JSON[_0x6f83('0x20')](_0x4de383));_0x6f10eb(_0x4de383);})[_0x6f83('0x15')](function(_0x68862e){logger['error'](_0x6f83('0x21'),_0x68862e[_0x6f83('0x13')],_0x4c8cbe);_0x34f20f(_0x13c06c[_0x6f83('0x11')](0x1f4,_0x68862e[_0x6f83('0x13')]));});});};
\ No newline at end of file
+var _0x8b91=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','ServicenowAccount','findAll','options','where','attributes','limit','include','model','map','GetServicenowAccount','stringify','ShowServicenowAccount','find','lodash','util','moment','randomstring','../../config/utils'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x8b91,0x9b));var _0x18b9=function(_0x304375,_0x4e302c){_0x304375=_0x304375-0x0;var _0x451c65=_0x8b91[_0x304375];return _0x451c65;};'use strict';var _=require(_0x18b9('0x0'));var util=require(_0x18b9('0x1'));var moment=require(_0x18b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x18b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x18b9('0x4'));var logger=require(_0x18b9('0x5'))(_0x18b9('0x6'));var config=require('../../config/environment');var jayson=require(_0x18b9('0x7'));var client=jayson[_0x18b9('0x8')][_0x18b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x390fda,_0x4e79a2,_0x67f853){return new BPromise(function(_0x531207,_0x46df7f){return client[_0x18b9('0xa')](_0x390fda,_0x67f853)[_0x18b9('0xb')](function(_0x3493a8){logger[_0x18b9('0xc')](_0x18b9('0xd'),_0x4e79a2,_0x18b9('0xe'));logger[_0x18b9('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4e79a2,'request\x20sent',JSON['stringify'](_0x3493a8));if(_0x3493a8[_0x18b9('0x10')]){if(_0x3493a8['error']['code']===0x1f4){logger[_0x18b9('0x10')](_0x18b9('0xd'),_0x4e79a2,_0x3493a8[_0x18b9('0x10')][_0x18b9('0x11')]);return _0x46df7f(_0x3493a8['error']['message']);}logger[_0x18b9('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x4e79a2,_0x3493a8[_0x18b9('0x10')][_0x18b9('0x11')]);return _0x531207(_0x3493a8[_0x18b9('0x10')]['message']);}else{logger[_0x18b9('0xc')](_0x18b9('0xd'),_0x4e79a2,'request\x20sent');_0x531207(_0x3493a8['result'][_0x18b9('0x11')]);}})[_0x18b9('0x12')](function(_0x59922b){logger[_0x18b9('0x10')](_0x18b9('0xd'),_0x4e79a2,_0x59922b);_0x46df7f(_0x59922b);});});}exports['GetServicenowAccount']=function(_0x22c2cd){var _0x30396e=this;return new Promise(function(_0x394ae3,_0x37fb9f){return db[_0x18b9('0x13')][_0x18b9('0x14')]({'raw':_0x22c2cd['options']?_0x22c2cd[_0x18b9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x22c2cd[_0x18b9('0x15')]?_0x22c2cd[_0x18b9('0x15')][_0x18b9('0x16')]||null:null,'attributes':_0x22c2cd[_0x18b9('0x15')]?_0x22c2cd['options'][_0x18b9('0x17')]||null:null,'limit':_0x22c2cd[_0x18b9('0x15')]?_0x22c2cd['options'][_0x18b9('0x18')]||null:null,'include':_0x22c2cd[_0x18b9('0x15')]?_0x22c2cd['options'][_0x18b9('0x19')]?_['map'](_0x22c2cd['options'][_0x18b9('0x19')],function(_0x5634de){return{'model':db[_0x5634de[_0x18b9('0x1a')]],'as':_0x5634de['as'],'attributes':_0x5634de[_0x18b9('0x17')],'include':_0x5634de[_0x18b9('0x19')]?_[_0x18b9('0x1b')](_0x5634de[_0x18b9('0x19')],function(_0x120b82){return{'model':db[_0x120b82[_0x18b9('0x1a')]],'as':_0x120b82['as'],'attributes':_0x120b82['attributes'],'include':_0x120b82['include']?_[_0x18b9('0x1b')](_0x120b82['include'],function(_0x2d1b11){return{'model':db[_0x2d1b11[_0x18b9('0x1a')]],'as':_0x2d1b11['as'],'attributes':_0x2d1b11[_0x18b9('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b270e){logger[_0x18b9('0xc')](_0x18b9('0x1c'),_0x22c2cd);logger[_0x18b9('0xf')](_0x18b9('0x1c'),_0x22c2cd,JSON[_0x18b9('0x1d')](_0x1b270e));_0x394ae3(_0x1b270e);})[_0x18b9('0x12')](function(_0x3f8c26){logger[_0x18b9('0x10')](_0x18b9('0x1c'),_0x3f8c26[_0x18b9('0x11')],_0x22c2cd);_0x37fb9f(_0x30396e[_0x18b9('0x10')](0x1f4,_0x3f8c26[_0x18b9('0x11')]));});});};exports[_0x18b9('0x1e')]=function(_0x49e729){var _0x23830e=this;return new Promise(function(_0x1a614f,_0x1b26ec){return db[_0x18b9('0x13')][_0x18b9('0x1f')]({'raw':_0x49e729[_0x18b9('0x15')]?_0x49e729[_0x18b9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x49e729[_0x18b9('0x15')]?_0x49e729['options'][_0x18b9('0x16')]||null:null,'attributes':_0x49e729[_0x18b9('0x15')]?_0x49e729[_0x18b9('0x15')][_0x18b9('0x17')]||null:null,'include':_0x49e729[_0x18b9('0x15')]?_0x49e729[_0x18b9('0x15')][_0x18b9('0x19')]?_[_0x18b9('0x1b')](_0x49e729[_0x18b9('0x15')]['include'],function(_0x432e4){return{'model':db[_0x432e4[_0x18b9('0x1a')]],'as':_0x432e4['as'],'attributes':_0x432e4[_0x18b9('0x17')],'include':_0x432e4[_0x18b9('0x19')]?_['map'](_0x432e4[_0x18b9('0x19')],function(_0x23af92){return{'model':db[_0x23af92[_0x18b9('0x1a')]],'as':_0x23af92['as'],'attributes':_0x23af92['attributes'],'include':_0x23af92[_0x18b9('0x19')]?_[_0x18b9('0x1b')](_0x23af92[_0x18b9('0x19')],function(_0x80e5e0){return{'model':db[_0x80e5e0[_0x18b9('0x1a')]],'as':_0x80e5e0['as'],'attributes':_0x80e5e0[_0x18b9('0x17')]};}):[]};}):[]};}):[]:[]})[_0x18b9('0xb')](function(_0x3e3659){logger[_0x18b9('0xc')]('ShowServicenowAccount',_0x49e729);logger[_0x18b9('0xf')](_0x18b9('0x1e'),_0x49e729,JSON[_0x18b9('0x1d')](_0x3e3659));_0x1a614f(_0x3e3659);})[_0x18b9('0x12')](function(_0x3d9632){logger['error'](_0x18b9('0x1e'),_0x3d9632['message'],_0x49e729);_0x1b26ec(_0x23830e[_0x18b9('0x10')](0x1f4,_0x3d9632[_0x18b9('0x11')]));});});};
\ No newline at end of file
index c5e8ffa..e6f0914 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc7=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','/:id','isAuthenticated'];(function(_0x55a158,_0x4f7e36){var _0x5ea045=function(_0x1b1ef9){while(--_0x1b1ef9){_0x55a158['push'](_0x55a158['shift']());}};_0x5ea045(++_0x4f7e36);}(_0x4fc7,0x97));var _0x74fc=function(_0x3ee779,_0x28dacd){_0x3ee779=_0x3ee779-0x0;var _0x12d8db=_0x4fc7[_0x3ee779];return _0x12d8db;};'use strict';var multer=require('multer');var util=require(_0x74fc('0x0'));var path=require(_0x74fc('0x1'));var timeout=require('connect-timeout');var express=require(_0x74fc('0x2'));var router=express[_0x74fc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x74fc('0x4'));var interaction=require(_0x74fc('0x5'));var config=require('../../config/environment');var controller=require(_0x74fc('0x6'));router[_0x74fc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x74fc('0x7')](_0x74fc('0x8'),auth[_0x74fc('0x9')](),controller[_0x74fc('0xa')]);router[_0x74fc('0x7')](_0x74fc('0xb'),auth['isAuthenticated'](),controller[_0x74fc('0xc')]);router['get'](_0x74fc('0xd'),auth['isAuthenticated'](),controller[_0x74fc('0xe')]);router[_0x74fc('0x7')](_0x74fc('0xf'),auth['isAuthenticated'](),controller[_0x74fc('0x10')]);router[_0x74fc('0x11')]('/',auth[_0x74fc('0x9')](),controller[_0x74fc('0x12')]);router['put'](_0x74fc('0x8'),auth[_0x74fc('0x9')](),controller[_0x74fc('0x13')]);router[_0x74fc('0x14')](_0x74fc('0x8'),auth['isAuthenticated'](),controller[_0x74fc('0x15')]);module[_0x74fc('0x16')]=router;
\ No newline at end of file
+var _0x33c0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x33c0,0x19d));var _0x033c=function(_0x5317e2,_0x4bda50){_0x5317e2=_0x5317e2-0x0;var _0x10ee7e=_0x33c0[_0x5317e2];return _0x10ee7e;};'use strict';var multer=require(_0x033c('0x0'));var util=require(_0x033c('0x1'));var path=require(_0x033c('0x2'));var timeout=require(_0x033c('0x3'));var express=require(_0x033c('0x4'));var router=express[_0x033c('0x5')]();var fs_extra=require(_0x033c('0x6'));var auth=require(_0x033c('0x7'));var interaction=require(_0x033c('0x8'));var config=require(_0x033c('0x9'));var controller=require(_0x033c('0xa'));router[_0x033c('0xb')]('/',auth[_0x033c('0xc')](),controller[_0x033c('0xd')]);router[_0x033c('0xb')](_0x033c('0xe'),auth[_0x033c('0xc')](),controller['show']);router[_0x033c('0xb')](_0x033c('0xf'),auth[_0x033c('0xc')](),controller[_0x033c('0x10')]);router[_0x033c('0xb')](_0x033c('0x11'),auth[_0x033c('0xc')](),controller[_0x033c('0x12')]);router[_0x033c('0xb')](_0x033c('0x13'),auth[_0x033c('0xc')](),controller[_0x033c('0x14')]);router[_0x033c('0x15')]('/',auth[_0x033c('0xc')](),controller[_0x033c('0x16')]);router[_0x033c('0x17')](_0x033c('0xe'),auth[_0x033c('0xc')](),controller[_0x033c('0x18')]);router[_0x033c('0x19')]('/:id',auth[_0x033c('0xc')](),controller[_0x033c('0x1a')]);module[_0x033c('0x1b')]=router;
\ No newline at end of file
index 37b5e3e..b7e66d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd496=['sequelize','STRING'];(function(_0x5446f5,_0x1a8da4){var _0x4664cf=function(_0xc32a5d){while(--_0xc32a5d){_0x5446f5['push'](_0x5446f5['shift']());}};_0x4664cf(++_0x1a8da4);}(_0xd496,0x180));var _0x6d49=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xd496[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0x6d49('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d49('0x1')]},'description':{'type':Sequelize[_0x6d49('0x1')]}};
\ No newline at end of file
+var _0x8e96=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e96,0x1dc));var _0x68e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e96[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x68e9('0x0'));module[_0x68e9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x68e9('0x2')]}};
\ No newline at end of file
index e3cc272..30b26b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be6=['crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','ServicenowConfiguration','include','findAll','rows','show','includeAll','options','find','catch','create','body','destroy','params','getFields','findOne','ServicenowField','order','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash'];(function(_0x40ee58,_0x242a0f){var _0x332289=function(_0x3d1579){while(--_0x3d1579){_0x40ee58['push'](_0x40ee58['shift']());}};_0x332289(++_0x242a0f);}(_0x1be6,0x1db));var _0x61be=function(_0x54fd84,_0x30c427){_0x54fd84=_0x54fd84-0x0;var _0x19964d=_0x1be6[_0x54fd84];return _0x19964d;};'use strict';var emlformat=require(_0x61be('0x0'));var rimraf=require(_0x61be('0x1'));var zipdir=require(_0x61be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61be('0x3'));var moment=require('moment');var BPromise=require(_0x61be('0x4'));var Mustache=require(_0x61be('0x5'));var util=require('util');var path=require(_0x61be('0x6'));var sox=require(_0x61be('0x7'));var csv=require(_0x61be('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61be('0x9'));var _=require(_0x61be('0xa'));var squel=require('squel');var crypto=require(_0x61be('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x61be('0x8'));var querystring=require(_0x61be('0xc'));var Papa=require(_0x61be('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x61be('0xe'));var as=require(_0x61be('0xf'));var hardwareService=require(_0x61be('0x10'));var logger=require(_0x61be('0x11'))('api');var utils=require(_0x61be('0x12'));var config=require(_0x61be('0x13'));var licenseUtil=require(_0x61be('0x14'));var db=require(_0x61be('0x15'))['db'];function respondWithStatusCode(_0x4bccbc,_0x164706){_0x164706=_0x164706||0xcc;return function(_0x4efa18){if(_0x4efa18){return _0x4bccbc['sendStatus'](_0x164706);}return _0x4bccbc['status'](_0x164706)[_0x61be('0x16')]();};}function respondWithResult(_0x5743fd,_0x4e9d16){_0x4e9d16=_0x4e9d16||0xc8;return function(_0x3b87fb){if(_0x3b87fb){return _0x5743fd[_0x61be('0x17')](_0x4e9d16)[_0x61be('0x18')](_0x3b87fb);}};}function respondWithFilteredResult(_0x401c9c,_0xb6f9a9){return function(_0x594d7e){if(_0x594d7e){var _0x25d164=typeof _0xb6f9a9[_0x61be('0x19')]===_0x61be('0x1a')&&typeof _0xb6f9a9[_0x61be('0x1b')]===_0x61be('0x1a');var _0x3198ba=_0x594d7e[_0x61be('0x1c')];var _0x3344ea=_0x25d164?0x0:_0xb6f9a9['offset'];var _0x225ddf=_0x25d164?_0x594d7e[_0x61be('0x1c')]:_0xb6f9a9[_0x61be('0x19')]+_0xb6f9a9['limit'];var _0x313601;if(_0x225ddf>=_0x3198ba){_0x225ddf=_0x3198ba;_0x313601=0xc8;}else{_0x313601=0xce;}_0x401c9c[_0x61be('0x17')](_0x313601);return _0x401c9c[_0x61be('0x1d')]('Content-Range',_0x3344ea+'-'+_0x225ddf+'/'+_0x3198ba)[_0x61be('0x18')](_0x594d7e);}return null;};}function patchUpdates(_0x165e7b){return function(_0x3952f1){try{jsonpatch[_0x61be('0x1e')](_0x3952f1,_0x165e7b,!![]);}catch(_0x328712){return BPromise[_0x61be('0x1f')](_0x328712);}return _0x3952f1[_0x61be('0x20')]();};}function saveUpdates(_0xf4f9a4,_0x147cf4){return function(_0x171533){if(_0x171533){return _0x171533[_0x61be('0x21')](_0xf4f9a4)[_0x61be('0x22')](function(_0x9b8377){return _0x9b8377;});}return null;};}function removeEntity(_0x4b3218,_0x1a902d){return function(_0x4f48ab){if(_0x4f48ab){return _0x4f48ab['destroy']()[_0x61be('0x22')](function(){_0x4b3218[_0x61be('0x17')](0xcc)[_0x61be('0x16')]();});}};}function handleEntityNotFound(_0x5612ce,_0x76b0b9){return function(_0x45097b){if(!_0x45097b){_0x5612ce[_0x61be('0x23')](0x194);}return _0x45097b;};}function handleError(_0x208069,_0x2cfd94){_0x2cfd94=_0x2cfd94||0x1f4;return function(_0x48ce2b){logger[_0x61be('0x24')](_0x48ce2b[_0x61be('0x25')]);if(_0x48ce2b[_0x61be('0x26')]){delete _0x48ce2b['name'];}_0x208069[_0x61be('0x17')](_0x2cfd94)[_0x61be('0x27')](_0x48ce2b);};}exports[_0x61be('0x28')]=function(_0x58ab49,_0x5700ef){var _0x598733={},_0x200dab={},_0x490e1f={'count':0x0,'rows':[]};var _0x8a4ec0=_[_0x61be('0x29')](db['ServicenowConfiguration'][_0x61be('0x2a')],function(_0x248805){return{'name':_0x248805[_0x61be('0x2b')],'type':_0x248805[_0x61be('0x2c')][_0x61be('0x2d')]};});_0x200dab[_0x61be('0x2e')]=_[_0x61be('0x29')](_0x8a4ec0,_0x61be('0x26'));_0x200dab['query']=_[_0x61be('0x2f')](_0x58ab49[_0x61be('0x30')]);_0x200dab[_0x61be('0x31')]=_[_0x61be('0x32')](_0x200dab[_0x61be('0x2e')],_0x200dab[_0x61be('0x30')]);_0x598733['attributes']=_[_0x61be('0x32')](_0x200dab[_0x61be('0x2e')],qs[_0x61be('0x33')](_0x58ab49['query']['fields']));_0x598733[_0x61be('0x34')]=_0x598733[_0x61be('0x34')][_0x61be('0x35')]?_0x598733[_0x61be('0x34')]:_0x200dab['model'];if(!_0x58ab49[_0x61be('0x30')][_0x61be('0x36')]('nolimit')){_0x598733['limit']=qs[_0x61be('0x1b')](_0x58ab49[_0x61be('0x30')]['limit']);_0x598733['offset']=qs[_0x61be('0x19')](_0x58ab49[_0x61be('0x30')][_0x61be('0x19')]);}_0x598733['order']=qs[_0x61be('0x37')](_0x58ab49[_0x61be('0x30')][_0x61be('0x37')]);_0x598733[_0x61be('0x38')]=qs[_0x61be('0x31')](_[_0x61be('0x39')](_0x58ab49[_0x61be('0x30')],_0x200dab[_0x61be('0x31')]),_0x8a4ec0);if(_0x58ab49[_0x61be('0x30')][_0x61be('0x3a')]){_0x598733['where']=_[_0x61be('0x3b')](_0x598733['where'],{'$or':_['map'](_0x8a4ec0,function(_0x57dd29){if(_0x57dd29[_0x61be('0x2c')]!==_0x61be('0x3c')){var _0x44fbcf={};_0x44fbcf[_0x57dd29[_0x61be('0x26')]]={'$like':'%'+_0x58ab49['query'][_0x61be('0x3a')]+'%'};return _0x44fbcf;}})});}_0x598733=_['merge']({},_0x598733,_0x58ab49['options']);var _0x18cd65={'where':_0x598733[_0x61be('0x38')]};return db[_0x61be('0x3d')][_0x61be('0x1c')](_0x18cd65)[_0x61be('0x22')](function(_0x8243d3){_0x490e1f[_0x61be('0x1c')]=_0x8243d3;if(_0x58ab49['query']['includeAll']){_0x598733[_0x61be('0x3e')]=[{'all':!![]}];}return db[_0x61be('0x3d')][_0x61be('0x3f')](_0x598733);})[_0x61be('0x22')](function(_0x30b0c6){_0x490e1f[_0x61be('0x40')]=_0x30b0c6;return _0x490e1f;})[_0x61be('0x22')](respondWithFilteredResult(_0x5700ef,_0x598733))['catch'](handleError(_0x5700ef,null));};exports[_0x61be('0x41')]=function(_0x5a88b1,_0x3b5207){var _0x277c1e={'raw':![],'where':{'id':_0x5a88b1['params']['id']}},_0x3db23a={};_0x3db23a[_0x61be('0x2e')]=_[_0x61be('0x2f')](db[_0x61be('0x3d')][_0x61be('0x2a')]);_0x3db23a['query']=_[_0x61be('0x2f')](_0x5a88b1[_0x61be('0x30')]);_0x3db23a['filters']=_['intersection'](_0x3db23a[_0x61be('0x2e')],_0x3db23a[_0x61be('0x30')]);_0x277c1e['attributes']=_['intersection'](_0x3db23a['model'],qs[_0x61be('0x33')](_0x5a88b1[_0x61be('0x30')][_0x61be('0x33')]));_0x277c1e['attributes']=_0x277c1e[_0x61be('0x34')][_0x61be('0x35')]?_0x277c1e[_0x61be('0x34')]:_0x3db23a[_0x61be('0x2e')];if(_0x5a88b1[_0x61be('0x30')][_0x61be('0x42')]){_0x277c1e['include']=[{'all':!![]}];}_0x277c1e=_[_0x61be('0x3b')]({},_0x277c1e,_0x5a88b1[_0x61be('0x43')]);return db['ServicenowConfiguration'][_0x61be('0x44')](_0x277c1e)['then'](handleEntityNotFound(_0x3b5207,null))[_0x61be('0x22')](respondWithResult(_0x3b5207,null))[_0x61be('0x45')](handleError(_0x3b5207,null));};exports[_0x61be('0x46')]=function(_0x1a65b6,_0x48bd23){return db[_0x61be('0x3d')][_0x61be('0x46')](_0x1a65b6[_0x61be('0x47')],{})[_0x61be('0x22')](respondWithResult(_0x48bd23,0xc9))[_0x61be('0x45')](handleError(_0x48bd23,null));};exports['update']=function(_0x5724db,_0x1e9849){if(_0x5724db[_0x61be('0x47')]['id']){delete _0x5724db[_0x61be('0x47')]['id'];}return db[_0x61be('0x3d')]['find']({'where':{'id':_0x5724db['params']['id']}})[_0x61be('0x22')](handleEntityNotFound(_0x1e9849,null))[_0x61be('0x22')](saveUpdates(_0x5724db['body'],null))[_0x61be('0x22')](respondWithResult(_0x1e9849,null))['catch'](handleError(_0x1e9849,null));};exports[_0x61be('0x48')]=function(_0x5801b5,_0x176c28){return db[_0x61be('0x3d')][_0x61be('0x44')]({'where':{'id':_0x5801b5[_0x61be('0x49')]['id']}})[_0x61be('0x22')](handleEntityNotFound(_0x176c28,null))[_0x61be('0x22')](removeEntity(_0x176c28,null))[_0x61be('0x45')](handleError(_0x176c28,null));};exports[_0x61be('0x4a')]=function(_0xc8d60a,_0x21230f,_0x52ec06){var _0xcdfa22={};var _0xf3fd28={};var _0x1b2174;var _0x2d0fb7;return db[_0x61be('0x3d')][_0x61be('0x4b')]({'where':{'id':_0xc8d60a[_0x61be('0x49')]['id']}})[_0x61be('0x22')](handleEntityNotFound(_0x21230f,null))[_0x61be('0x22')](function(_0x4fbc02){if(_0x4fbc02){_0x1b2174=_0x4fbc02;_0xf3fd28[_0x61be('0x2e')]=_[_0x61be('0x2f')](db[_0x61be('0x4c')][_0x61be('0x2a')]);_0xf3fd28[_0x61be('0x30')]=_[_0x61be('0x2f')](_0xc8d60a['query']);_0xf3fd28['filters']=_[_0x61be('0x32')](_0xf3fd28['model'],_0xf3fd28[_0x61be('0x30')]);_0xcdfa22[_0x61be('0x34')]=_[_0x61be('0x32')](_0xf3fd28[_0x61be('0x2e')],qs[_0x61be('0x33')](_0xc8d60a[_0x61be('0x30')]['fields']));_0xcdfa22['attributes']=_0xcdfa22[_0x61be('0x34')]['length']?_0xcdfa22[_0x61be('0x34')]:_0xf3fd28[_0x61be('0x2e')];_0xcdfa22[_0x61be('0x4d')]=qs[_0x61be('0x37')](_0xc8d60a[_0x61be('0x30')]['sort']);_0xcdfa22[_0x61be('0x38')]=qs[_0x61be('0x31')](_[_0x61be('0x39')](_0xc8d60a[_0x61be('0x30')],_0xf3fd28[_0x61be('0x31')]));if(_0xc8d60a[_0x61be('0x30')]['filter']){_0xcdfa22[_0x61be('0x38')]=_[_0x61be('0x3b')](_0xcdfa22[_0x61be('0x38')],{'$or':_['map'](_0xcdfa22[_0x61be('0x34')],function(_0x28b29f){var _0x7fc4d2={};_0x7fc4d2[_0x28b29f]={'$like':'%'+_0xc8d60a[_0x61be('0x30')]['filter']+'%'};return _0x7fc4d2;})});}_0xcdfa22=_[_0x61be('0x3b')]({},_0xcdfa22,_0xc8d60a['options']);return _0x1b2174[_0x61be('0x4a')](_0xcdfa22);}})[_0x61be('0x22')](function(_0x3a899b){if(_0x3a899b){_0x2d0fb7=_0x3a899b[_0x61be('0x35')];if(!_0xc8d60a['query'][_0x61be('0x36')]('nolimit')){_0xcdfa22[_0x61be('0x1b')]=qs['limit'](_0xc8d60a['query'][_0x61be('0x1b')]);_0xcdfa22[_0x61be('0x19')]=qs[_0x61be('0x19')](_0xc8d60a[_0x61be('0x30')]['offset']);}return _0x1b2174[_0x61be('0x4a')](_0xcdfa22);}})[_0x61be('0x22')](function(_0x5eba97){if(_0x5eba97){return _0x5eba97?{'count':_0x2d0fb7,'rows':_0x5eba97}:null;}})[_0x61be('0x22')](respondWithResult(_0x21230f,null))['catch'](handleError(_0x21230f,null));};exports['getSubjects']=function(_0x1522f3,_0x3c9855,_0x5c06f2){var _0x1b9175={};var _0x8c0b4e={};var _0x519c6a;var _0x17c225;return db[_0x61be('0x3d')][_0x61be('0x4b')]({'where':{'id':_0x1522f3[_0x61be('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c9855,null))[_0x61be('0x22')](function(_0x214244){if(_0x214244){_0x519c6a=_0x214244;_0x8c0b4e[_0x61be('0x2e')]=_[_0x61be('0x2f')](db['ServicenowField'][_0x61be('0x2a')]);_0x8c0b4e[_0x61be('0x30')]=_[_0x61be('0x2f')](_0x1522f3[_0x61be('0x30')]);_0x8c0b4e[_0x61be('0x31')]=_[_0x61be('0x32')](_0x8c0b4e[_0x61be('0x2e')],_0x8c0b4e['query']);_0x1b9175['attributes']=_[_0x61be('0x32')](_0x8c0b4e['model'],qs[_0x61be('0x33')](_0x1522f3[_0x61be('0x30')]['fields']));_0x1b9175[_0x61be('0x34')]=_0x1b9175[_0x61be('0x34')][_0x61be('0x35')]?_0x1b9175[_0x61be('0x34')]:_0x8c0b4e[_0x61be('0x2e')];_0x1b9175[_0x61be('0x4d')]=qs['sort'](_0x1522f3[_0x61be('0x30')][_0x61be('0x37')]);_0x1b9175['where']=qs[_0x61be('0x31')](_[_0x61be('0x39')](_0x1522f3[_0x61be('0x30')],_0x8c0b4e[_0x61be('0x31')]));if(_0x1522f3[_0x61be('0x30')]['filter']){_0x1b9175[_0x61be('0x38')]=_['merge'](_0x1b9175[_0x61be('0x38')],{'$or':_['map'](_0x1b9175[_0x61be('0x34')],function(_0x56272a){var _0x18ec91={};_0x18ec91[_0x56272a]={'$like':'%'+_0x1522f3['query'][_0x61be('0x3a')]+'%'};return _0x18ec91;})});}_0x1b9175=_['merge']({},_0x1b9175,_0x1522f3['options']);return _0x519c6a[_0x61be('0x4e')](_0x1b9175);}})['then'](function(_0x438932){if(_0x438932){_0x17c225=_0x438932[_0x61be('0x35')];if(!_0x1522f3[_0x61be('0x30')][_0x61be('0x36')](_0x61be('0x4f'))){_0x1b9175[_0x61be('0x1b')]=qs[_0x61be('0x1b')](_0x1522f3[_0x61be('0x30')][_0x61be('0x1b')]);_0x1b9175[_0x61be('0x19')]=qs['offset'](_0x1522f3[_0x61be('0x30')][_0x61be('0x19')]);}return _0x519c6a[_0x61be('0x4e')](_0x1b9175);}})[_0x61be('0x22')](function(_0xa68236){if(_0xa68236){return _0xa68236?{'count':_0x17c225,'rows':_0xa68236}:null;}})[_0x61be('0x22')](respondWithResult(_0x3c9855,null))['catch'](handleError(_0x3c9855,null));};exports[_0x61be('0x50')]=function(_0x42aea4,_0xde3254,_0x4c3061){var _0x474209={};var _0x43ea07={};var _0x2005f1;var _0x44e8db;return db[_0x61be('0x3d')][_0x61be('0x4b')]({'where':{'id':_0x42aea4[_0x61be('0x49')]['id']}})['then'](handleEntityNotFound(_0xde3254,null))['then'](function(_0x1ac5f2){if(_0x1ac5f2){_0x2005f1=_0x1ac5f2;_0x43ea07['model']=_[_0x61be('0x2f')](db['ServicenowField'][_0x61be('0x2a')]);_0x43ea07[_0x61be('0x30')]=_['keys'](_0x42aea4[_0x61be('0x30')]);_0x43ea07[_0x61be('0x31')]=_[_0x61be('0x32')](_0x43ea07[_0x61be('0x2e')],_0x43ea07[_0x61be('0x30')]);_0x474209[_0x61be('0x34')]=_[_0x61be('0x32')](_0x43ea07[_0x61be('0x2e')],qs[_0x61be('0x33')](_0x42aea4['query'][_0x61be('0x33')]));_0x474209['attributes']=_0x474209['attributes'][_0x61be('0x35')]?_0x474209['attributes']:_0x43ea07[_0x61be('0x2e')];_0x474209[_0x61be('0x4d')]=qs[_0x61be('0x37')](_0x42aea4['query'][_0x61be('0x37')]);_0x474209['where']=qs[_0x61be('0x31')](_[_0x61be('0x39')](_0x42aea4[_0x61be('0x30')],_0x43ea07[_0x61be('0x31')]));if(_0x42aea4[_0x61be('0x30')]['filter']){_0x474209[_0x61be('0x38')]=_['merge'](_0x474209[_0x61be('0x38')],{'$or':_[_0x61be('0x29')](_0x474209[_0x61be('0x34')],function(_0x102272){var _0x4073ad={};_0x4073ad[_0x102272]={'$like':'%'+_0x42aea4['query'][_0x61be('0x3a')]+'%'};return _0x4073ad;})});}_0x474209=_[_0x61be('0x3b')]({},_0x474209,_0x42aea4[_0x61be('0x43')]);return _0x2005f1[_0x61be('0x50')](_0x474209);}})[_0x61be('0x22')](function(_0x4af5cb){if(_0x4af5cb){_0x44e8db=_0x4af5cb[_0x61be('0x35')];if(!_0x42aea4[_0x61be('0x30')][_0x61be('0x36')](_0x61be('0x4f'))){_0x474209[_0x61be('0x1b')]=qs['limit'](_0x42aea4['query'][_0x61be('0x1b')]);_0x474209['offset']=qs[_0x61be('0x19')](_0x42aea4[_0x61be('0x30')][_0x61be('0x19')]);}return _0x2005f1[_0x61be('0x50')](_0x474209);}})[_0x61be('0x22')](function(_0x4adca0){if(_0x4adca0){return _0x4adca0?{'count':_0x44e8db,'rows':_0x4adca0}:null;}})[_0x61be('0x22')](respondWithResult(_0xde3254,null))[_0x61be('0x45')](handleError(_0xde3254,null));};
\ No newline at end of file
+var _0xdc6c=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','ServicenowConfiguration','findAll','rows','catch','keys','create','body','find','params','findOne','ServicenowField','order','getFields','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4c17ea,_0x26db30){var _0xc6d47b=function(_0x4b6216){while(--_0x4b6216){_0x4c17ea['push'](_0x4c17ea['shift']());}};_0xc6d47b(++_0x26db30);}(_0xdc6c,0x188));var _0xcdc6=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xdc6c[_0x4aa4e6];return _0x322588;};'use strict';var emlformat=require(_0xcdc6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdc6('0x1'));var jsonpatch=require(_0xcdc6('0x2'));var rp=require(_0xcdc6('0x3'));var moment=require(_0xcdc6('0x4'));var BPromise=require(_0xcdc6('0x5'));var Mustache=require(_0xcdc6('0x6'));var util=require(_0xcdc6('0x7'));var path=require('path');var sox=require(_0xcdc6('0x8'));var csv=require(_0xcdc6('0x9'));var ejs=require(_0xcdc6('0xa'));var fs=require('fs');var fs_extra=require(_0xcdc6('0xb'));var _=require(_0xcdc6('0xc'));var squel=require(_0xcdc6('0xd'));var crypto=require(_0xcdc6('0xe'));var jsforce=require(_0xcdc6('0xf'));var deskjs=require(_0xcdc6('0x10'));var toCsv=require(_0xcdc6('0x9'));var querystring=require(_0xcdc6('0x11'));var Papa=require(_0xcdc6('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcdc6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdc6('0x14'))(_0xcdc6('0x15'));var utils=require('../../config/utils');var config=require(_0xcdc6('0x16'));var licenseUtil=require(_0xcdc6('0x17'));var db=require(_0xcdc6('0x18'))['db'];function respondWithStatusCode(_0x37e340,_0x2e273b){_0x2e273b=_0x2e273b||0xcc;return function(_0x5d066f){if(_0x5d066f){return _0x37e340[_0xcdc6('0x19')](_0x2e273b);}return _0x37e340[_0xcdc6('0x1a')](_0x2e273b)['end']();};}function respondWithResult(_0x4d3c95,_0x5616f1){_0x5616f1=_0x5616f1||0xc8;return function(_0x25fb54){if(_0x25fb54){return _0x4d3c95[_0xcdc6('0x1a')](_0x5616f1)[_0xcdc6('0x1b')](_0x25fb54);}};}function respondWithFilteredResult(_0x1efdf7,_0x2e9b11){return function(_0x27b666){if(_0x27b666){var _0xcea93c=typeof _0x2e9b11[_0xcdc6('0x1c')]==='undefined'&&typeof _0x2e9b11[_0xcdc6('0x1d')]===_0xcdc6('0x1e');var _0x597a2a=_0x27b666[_0xcdc6('0x1f')];var _0x5c6762=_0xcea93c?0x0:_0x2e9b11[_0xcdc6('0x1c')];var _0x3d3e26=_0xcea93c?_0x27b666[_0xcdc6('0x1f')]:_0x2e9b11[_0xcdc6('0x1c')]+_0x2e9b11[_0xcdc6('0x1d')];var _0x29f7b8;if(_0x3d3e26>=_0x597a2a){_0x3d3e26=_0x597a2a;_0x29f7b8=0xc8;}else{_0x29f7b8=0xce;}_0x1efdf7[_0xcdc6('0x1a')](_0x29f7b8);return _0x1efdf7[_0xcdc6('0x20')]('Content-Range',_0x5c6762+'-'+_0x3d3e26+'/'+_0x597a2a)[_0xcdc6('0x1b')](_0x27b666);}return null;};}function patchUpdates(_0x4b0ca8){return function(_0x1c415c){try{jsonpatch[_0xcdc6('0x21')](_0x1c415c,_0x4b0ca8,!![]);}catch(_0x5c4fc3){return BPromise[_0xcdc6('0x22')](_0x5c4fc3);}return _0x1c415c[_0xcdc6('0x23')]();};}function saveUpdates(_0x2a55d7,_0x14bdc0){return function(_0xb9b081){if(_0xb9b081){return _0xb9b081[_0xcdc6('0x24')](_0x2a55d7)['then'](function(_0x59d87c){return _0x59d87c;});}return null;};}function removeEntity(_0xc421a8,_0x1f129b){return function(_0x18dc3e){if(_0x18dc3e){return _0x18dc3e[_0xcdc6('0x25')]()[_0xcdc6('0x26')](function(){_0xc421a8[_0xcdc6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f3183,_0x1f5539){return function(_0x67d3a8){if(!_0x67d3a8){_0x4f3183[_0xcdc6('0x19')](0x194);}return _0x67d3a8;};}function handleError(_0x222d0e,_0x85b0){_0x85b0=_0x85b0||0x1f4;return function(_0x200927){logger[_0xcdc6('0x27')](_0x200927[_0xcdc6('0x28')]);if(_0x200927[_0xcdc6('0x29')]){delete _0x200927[_0xcdc6('0x29')];}_0x222d0e[_0xcdc6('0x1a')](_0x85b0)[_0xcdc6('0x2a')](_0x200927);};}exports['index']=function(_0x383afa,_0x4c6c51){var _0x3fd7f7={},_0x210bcd={},_0x118286={'count':0x0,'rows':[]};var _0x3c84c0=_[_0xcdc6('0x2b')](db['ServicenowConfiguration'][_0xcdc6('0x2c')],function(_0x1ddfb6){return{'name':_0x1ddfb6[_0xcdc6('0x2d')],'type':_0x1ddfb6[_0xcdc6('0x2e')][_0xcdc6('0x2f')]};});_0x210bcd[_0xcdc6('0x30')]=_[_0xcdc6('0x2b')](_0x3c84c0,_0xcdc6('0x29'));_0x210bcd[_0xcdc6('0x31')]=_['keys'](_0x383afa[_0xcdc6('0x31')]);_0x210bcd[_0xcdc6('0x32')]=_[_0xcdc6('0x33')](_0x210bcd['model'],_0x210bcd[_0xcdc6('0x31')]);_0x3fd7f7[_0xcdc6('0x34')]=_['intersection'](_0x210bcd[_0xcdc6('0x30')],qs[_0xcdc6('0x35')](_0x383afa[_0xcdc6('0x31')][_0xcdc6('0x35')]));_0x3fd7f7['attributes']=_0x3fd7f7[_0xcdc6('0x34')][_0xcdc6('0x36')]?_0x3fd7f7['attributes']:_0x210bcd[_0xcdc6('0x30')];if(!_0x383afa['query'][_0xcdc6('0x37')]('nolimit')){_0x3fd7f7['limit']=qs[_0xcdc6('0x1d')](_0x383afa[_0xcdc6('0x31')][_0xcdc6('0x1d')]);_0x3fd7f7[_0xcdc6('0x1c')]=qs[_0xcdc6('0x1c')](_0x383afa[_0xcdc6('0x31')]['offset']);}_0x3fd7f7['order']=qs[_0xcdc6('0x38')](_0x383afa[_0xcdc6('0x31')][_0xcdc6('0x38')]);_0x3fd7f7[_0xcdc6('0x39')]=qs['filters'](_[_0xcdc6('0x3a')](_0x383afa['query'],_0x210bcd[_0xcdc6('0x32')]),_0x3c84c0);if(_0x383afa['query'][_0xcdc6('0x3b')]){_0x3fd7f7[_0xcdc6('0x39')]=_[_0xcdc6('0x3c')](_0x3fd7f7[_0xcdc6('0x39')],{'$or':_[_0xcdc6('0x2b')](_0x3c84c0,function(_0x16a8b5){if(_0x16a8b5[_0xcdc6('0x2e')]!=='VIRTUAL'){var _0xbf6bee={};_0xbf6bee[_0x16a8b5[_0xcdc6('0x29')]]={'$like':'%'+_0x383afa[_0xcdc6('0x31')][_0xcdc6('0x3b')]+'%'};return _0xbf6bee;}})});}_0x3fd7f7=_['merge']({},_0x3fd7f7,_0x383afa[_0xcdc6('0x3d')]);var _0x23b7e7={'where':_0x3fd7f7['where']};return db['ServicenowConfiguration']['count'](_0x23b7e7)['then'](function(_0x29f4f3){_0x118286[_0xcdc6('0x1f')]=_0x29f4f3;if(_0x383afa[_0xcdc6('0x31')][_0xcdc6('0x3e')]){_0x3fd7f7[_0xcdc6('0x3f')]=[{'all':!![]}];}return db[_0xcdc6('0x40')][_0xcdc6('0x41')](_0x3fd7f7);})[_0xcdc6('0x26')](function(_0x3f5722){_0x118286[_0xcdc6('0x42')]=_0x3f5722;return _0x118286;})[_0xcdc6('0x26')](respondWithFilteredResult(_0x4c6c51,_0x3fd7f7))[_0xcdc6('0x43')](handleError(_0x4c6c51,null));};exports['show']=function(_0x2b60f3,_0x2626be){var _0x183042={'raw':![],'where':{'id':_0x2b60f3['params']['id']}},_0x261fa0={};_0x261fa0[_0xcdc6('0x30')]=_[_0xcdc6('0x44')](db[_0xcdc6('0x40')][_0xcdc6('0x2c')]);_0x261fa0[_0xcdc6('0x31')]=_[_0xcdc6('0x44')](_0x2b60f3[_0xcdc6('0x31')]);_0x261fa0[_0xcdc6('0x32')]=_[_0xcdc6('0x33')](_0x261fa0['model'],_0x261fa0[_0xcdc6('0x31')]);_0x183042[_0xcdc6('0x34')]=_[_0xcdc6('0x33')](_0x261fa0[_0xcdc6('0x30')],qs[_0xcdc6('0x35')](_0x2b60f3['query'][_0xcdc6('0x35')]));_0x183042[_0xcdc6('0x34')]=_0x183042['attributes'][_0xcdc6('0x36')]?_0x183042[_0xcdc6('0x34')]:_0x261fa0[_0xcdc6('0x30')];if(_0x2b60f3[_0xcdc6('0x31')][_0xcdc6('0x3e')]){_0x183042['include']=[{'all':!![]}];}_0x183042=_['merge']({},_0x183042,_0x2b60f3[_0xcdc6('0x3d')]);return db[_0xcdc6('0x40')]['find'](_0x183042)[_0xcdc6('0x26')](handleEntityNotFound(_0x2626be,null))[_0xcdc6('0x26')](respondWithResult(_0x2626be,null))[_0xcdc6('0x43')](handleError(_0x2626be,null));};exports['create']=function(_0x22787e,_0x7f7b4e){return db['ServicenowConfiguration'][_0xcdc6('0x45')](_0x22787e[_0xcdc6('0x46')],{})[_0xcdc6('0x26')](respondWithResult(_0x7f7b4e,0xc9))[_0xcdc6('0x43')](handleError(_0x7f7b4e,null));};exports[_0xcdc6('0x24')]=function(_0x1a6705,_0x2b8709){if(_0x1a6705['body']['id']){delete _0x1a6705['body']['id'];}return db[_0xcdc6('0x40')][_0xcdc6('0x47')]({'where':{'id':_0x1a6705[_0xcdc6('0x48')]['id']}})[_0xcdc6('0x26')](handleEntityNotFound(_0x2b8709,null))[_0xcdc6('0x26')](saveUpdates(_0x1a6705[_0xcdc6('0x46')],null))[_0xcdc6('0x26')](respondWithResult(_0x2b8709,null))[_0xcdc6('0x43')](handleError(_0x2b8709,null));};exports[_0xcdc6('0x25')]=function(_0x2c5534,_0xaf03e7){return db['ServicenowConfiguration'][_0xcdc6('0x47')]({'where':{'id':_0x2c5534[_0xcdc6('0x48')]['id']}})[_0xcdc6('0x26')](handleEntityNotFound(_0xaf03e7,null))[_0xcdc6('0x26')](removeEntity(_0xaf03e7,null))[_0xcdc6('0x43')](handleError(_0xaf03e7,null));};exports['getFields']=function(_0x4b1846,_0x5df2e6,_0x36edcd){var _0x2fe2f2={};var _0x335250={};var _0x974bdc;var _0x244b64;return db[_0xcdc6('0x40')][_0xcdc6('0x49')]({'where':{'id':_0x4b1846['params']['id']}})[_0xcdc6('0x26')](handleEntityNotFound(_0x5df2e6,null))[_0xcdc6('0x26')](function(_0x5c23cc){if(_0x5c23cc){_0x974bdc=_0x5c23cc;_0x335250[_0xcdc6('0x30')]=_['keys'](db[_0xcdc6('0x4a')][_0xcdc6('0x2c')]);_0x335250['query']=_[_0xcdc6('0x44')](_0x4b1846[_0xcdc6('0x31')]);_0x335250['filters']=_[_0xcdc6('0x33')](_0x335250['model'],_0x335250['query']);_0x2fe2f2[_0xcdc6('0x34')]=_[_0xcdc6('0x33')](_0x335250['model'],qs['fields'](_0x4b1846['query'][_0xcdc6('0x35')]));_0x2fe2f2[_0xcdc6('0x34')]=_0x2fe2f2[_0xcdc6('0x34')][_0xcdc6('0x36')]?_0x2fe2f2[_0xcdc6('0x34')]:_0x335250['model'];_0x2fe2f2[_0xcdc6('0x4b')]=qs[_0xcdc6('0x38')](_0x4b1846[_0xcdc6('0x31')][_0xcdc6('0x38')]);_0x2fe2f2[_0xcdc6('0x39')]=qs[_0xcdc6('0x32')](_[_0xcdc6('0x3a')](_0x4b1846[_0xcdc6('0x31')],_0x335250['filters']));if(_0x4b1846[_0xcdc6('0x31')][_0xcdc6('0x3b')]){_0x2fe2f2[_0xcdc6('0x39')]=_['merge'](_0x2fe2f2[_0xcdc6('0x39')],{'$or':_['map'](_0x2fe2f2[_0xcdc6('0x34')],function(_0x44253b){var _0x5b1a78={};_0x5b1a78[_0x44253b]={'$like':'%'+_0x4b1846[_0xcdc6('0x31')][_0xcdc6('0x3b')]+'%'};return _0x5b1a78;})});}_0x2fe2f2=_[_0xcdc6('0x3c')]({},_0x2fe2f2,_0x4b1846[_0xcdc6('0x3d')]);return _0x974bdc[_0xcdc6('0x4c')](_0x2fe2f2);}})[_0xcdc6('0x26')](function(_0x1b9403){if(_0x1b9403){_0x244b64=_0x1b9403[_0xcdc6('0x36')];if(!_0x4b1846[_0xcdc6('0x31')][_0xcdc6('0x37')](_0xcdc6('0x4d'))){_0x2fe2f2[_0xcdc6('0x1d')]=qs[_0xcdc6('0x1d')](_0x4b1846[_0xcdc6('0x31')][_0xcdc6('0x1d')]);_0x2fe2f2['offset']=qs['offset'](_0x4b1846[_0xcdc6('0x31')]['offset']);}return _0x974bdc[_0xcdc6('0x4c')](_0x2fe2f2);}})[_0xcdc6('0x26')](function(_0x32734a){if(_0x32734a){return _0x32734a?{'count':_0x244b64,'rows':_0x32734a}:null;}})[_0xcdc6('0x26')](respondWithResult(_0x5df2e6,null))['catch'](handleError(_0x5df2e6,null));};exports[_0xcdc6('0x4e')]=function(_0x5bc25f,_0x151a9d,_0x1de588){var _0x257b51={};var _0x41ae22={};var _0x5c617a;var _0x4c245b;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x5bc25f[_0xcdc6('0x48')]['id']}})[_0xcdc6('0x26')](handleEntityNotFound(_0x151a9d,null))[_0xcdc6('0x26')](function(_0xb6acc){if(_0xb6acc){_0x5c617a=_0xb6acc;_0x41ae22[_0xcdc6('0x30')]=_[_0xcdc6('0x44')](db['ServicenowField']['rawAttributes']);_0x41ae22[_0xcdc6('0x31')]=_[_0xcdc6('0x44')](_0x5bc25f[_0xcdc6('0x31')]);_0x41ae22[_0xcdc6('0x32')]=_['intersection'](_0x41ae22[_0xcdc6('0x30')],_0x41ae22['query']);_0x257b51[_0xcdc6('0x34')]=_[_0xcdc6('0x33')](_0x41ae22[_0xcdc6('0x30')],qs[_0xcdc6('0x35')](_0x5bc25f['query'][_0xcdc6('0x35')]));_0x257b51[_0xcdc6('0x34')]=_0x257b51[_0xcdc6('0x34')][_0xcdc6('0x36')]?_0x257b51['attributes']:_0x41ae22[_0xcdc6('0x30')];_0x257b51[_0xcdc6('0x4b')]=qs[_0xcdc6('0x38')](_0x5bc25f['query'][_0xcdc6('0x38')]);_0x257b51[_0xcdc6('0x39')]=qs[_0xcdc6('0x32')](_[_0xcdc6('0x3a')](_0x5bc25f['query'],_0x41ae22[_0xcdc6('0x32')]));if(_0x5bc25f[_0xcdc6('0x31')][_0xcdc6('0x3b')]){_0x257b51['where']=_['merge'](_0x257b51[_0xcdc6('0x39')],{'$or':_[_0xcdc6('0x2b')](_0x257b51['attributes'],function(_0x5a851e){var _0x5c4c6f={};_0x5c4c6f[_0x5a851e]={'$like':'%'+_0x5bc25f[_0xcdc6('0x31')][_0xcdc6('0x3b')]+'%'};return _0x5c4c6f;})});}_0x257b51=_['merge']({},_0x257b51,_0x5bc25f['options']);return _0x5c617a[_0xcdc6('0x4e')](_0x257b51);}})[_0xcdc6('0x26')](function(_0x200cdb){if(_0x200cdb){_0x4c245b=_0x200cdb[_0xcdc6('0x36')];if(!_0x5bc25f[_0xcdc6('0x31')][_0xcdc6('0x37')](_0xcdc6('0x4d'))){_0x257b51[_0xcdc6('0x1d')]=qs[_0xcdc6('0x1d')](_0x5bc25f[_0xcdc6('0x31')]['limit']);_0x257b51[_0xcdc6('0x1c')]=qs[_0xcdc6('0x1c')](_0x5bc25f[_0xcdc6('0x31')][_0xcdc6('0x1c')]);}return _0x5c617a['getSubjects'](_0x257b51);}})[_0xcdc6('0x26')](function(_0x290322){if(_0x290322){return _0x290322?{'count':_0x4c245b,'rows':_0x290322}:null;}})[_0xcdc6('0x26')](respondWithResult(_0x151a9d,null))[_0xcdc6('0x43')](handleError(_0x151a9d,null));};exports[_0xcdc6('0x4f')]=function(_0x11925b,_0x282668,_0x326874){var _0xa44162={};var _0x2b1d9f={};var _0x58e230;var _0x303d9c;return db[_0xcdc6('0x40')][_0xcdc6('0x49')]({'where':{'id':_0x11925b['params']['id']}})['then'](handleEntityNotFound(_0x282668,null))[_0xcdc6('0x26')](function(_0x43a52d){if(_0x43a52d){_0x58e230=_0x43a52d;_0x2b1d9f[_0xcdc6('0x30')]=_[_0xcdc6('0x44')](db['ServicenowField']['rawAttributes']);_0x2b1d9f[_0xcdc6('0x31')]=_['keys'](_0x11925b[_0xcdc6('0x31')]);_0x2b1d9f[_0xcdc6('0x32')]=_[_0xcdc6('0x33')](_0x2b1d9f['model'],_0x2b1d9f[_0xcdc6('0x31')]);_0xa44162['attributes']=_[_0xcdc6('0x33')](_0x2b1d9f[_0xcdc6('0x30')],qs['fields'](_0x11925b['query'][_0xcdc6('0x35')]));_0xa44162['attributes']=_0xa44162[_0xcdc6('0x34')][_0xcdc6('0x36')]?_0xa44162[_0xcdc6('0x34')]:_0x2b1d9f[_0xcdc6('0x30')];_0xa44162[_0xcdc6('0x4b')]=qs[_0xcdc6('0x38')](_0x11925b[_0xcdc6('0x31')][_0xcdc6('0x38')]);_0xa44162[_0xcdc6('0x39')]=qs['filters'](_[_0xcdc6('0x3a')](_0x11925b['query'],_0x2b1d9f['filters']));if(_0x11925b[_0xcdc6('0x31')][_0xcdc6('0x3b')]){_0xa44162[_0xcdc6('0x39')]=_['merge'](_0xa44162[_0xcdc6('0x39')],{'$or':_[_0xcdc6('0x2b')](_0xa44162['attributes'],function(_0x238aaf){var _0x3a8fed={};_0x3a8fed[_0x238aaf]={'$like':'%'+_0x11925b['query'][_0xcdc6('0x3b')]+'%'};return _0x3a8fed;})});}_0xa44162=_[_0xcdc6('0x3c')]({},_0xa44162,_0x11925b[_0xcdc6('0x3d')]);return _0x58e230[_0xcdc6('0x4f')](_0xa44162);}})[_0xcdc6('0x26')](function(_0x344163){if(_0x344163){_0x303d9c=_0x344163['length'];if(!_0x11925b[_0xcdc6('0x31')][_0xcdc6('0x37')](_0xcdc6('0x4d'))){_0xa44162[_0xcdc6('0x1d')]=qs['limit'](_0x11925b['query'][_0xcdc6('0x1d')]);_0xa44162[_0xcdc6('0x1c')]=qs[_0xcdc6('0x1c')](_0x11925b[_0xcdc6('0x31')]['offset']);}return _0x58e230['getDescriptions'](_0xa44162);}})[_0xcdc6('0x26')](function(_0x390f13){if(_0x390f13){return _0x390f13?{'count':_0x303d9c,'rows':_0x390f13}:null;}})['then'](respondWithResult(_0x282668,null))[_0xcdc6('0x43')](handleError(_0x282668,null));};
\ No newline at end of file
index f8b07f1..7074c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf4c=['moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x530586,_0x4f6ecd){_0x530586=_0x530586-0x0;var _0x569e7e=_0xaf4c[_0x530586];return _0x569e7e;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var logger=require(_0xcaf4('0x1'))('api');var moment=require(_0xcaf4('0x2'));var BPromise=require(_0xcaf4('0x3'));var rp=require(_0xcaf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var attributes=require(_0xcaf4('0x7'));module['exports']=function(_0x21ad95,_0x548527){return _0x21ad95[_0xcaf4('0x8')](_0xcaf4('0x9'),attributes,{'tableName':_0xcaf4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e1c=['ServicenowConfiguration','int_servicenow_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc6e1('0x1'));var moment=require(_0xc6e1('0x2'));var BPromise=require(_0xc6e1('0x3'));var rp=require(_0xc6e1('0x4'));var fs=require('fs');var path=require(_0xc6e1('0x5'));var rimraf=require(_0xc6e1('0x6'));var config=require(_0xc6e1('0x7'));var attributes=require(_0xc6e1('0x8'));module[_0xc6e1('0x9')]=function(_0x3e2d6c,_0x468a80){return _0x3e2d6c['define'](_0xc6e1('0xa'),attributes,{'tableName':_0xc6e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 47afa8f..2905469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa43b=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x19726f,_0x49e0eb){var _0x23c58c=function(_0x35f0ca){while(--_0x35f0ca){_0x19726f['push'](_0x19726f['shift']());}};_0x23c58c(++_0x49e0eb);}(_0xa43b,0x12e));var _0xba43=function(_0x5cd14e,_0x5e4977){_0x5cd14e=_0x5cd14e-0x0;var _0x1d95eb=_0xa43b[_0x5cd14e];return _0x1d95eb;};'use strict';var _=require(_0xba43('0x0'));var util=require(_0xba43('0x1'));var moment=require(_0xba43('0x2'));var BPromise=require(_0xba43('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba43('0x4'));var db=require(_0xba43('0x5'))['db'];var utils=require(_0xba43('0x6'));var logger=require(_0xba43('0x7'))(_0xba43('0x8'));var config=require('../../config/environment');var jayson=require(_0xba43('0x9'));var client=jayson[_0xba43('0xa')][_0xba43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f968b,_0x25c9e4,_0x49b0ac){return new BPromise(function(_0x398f08,_0x117695){return client['request'](_0x3f968b,_0x49b0ac)['then'](function(_0x2d38b4){logger[_0xba43('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x25c9e4,'request\x20sent');logger[_0xba43('0xd')](_0xba43('0xe'),_0x25c9e4,_0xba43('0xf'),JSON[_0xba43('0x10')](_0x2d38b4));if(_0x2d38b4[_0xba43('0x11')]){if(_0x2d38b4[_0xba43('0x11')][_0xba43('0x12')]===0x1f4){logger[_0xba43('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x25c9e4,_0x2d38b4['error'][_0xba43('0x13')]);return _0x117695(_0x2d38b4[_0xba43('0x11')][_0xba43('0x13')]);}logger[_0xba43('0x11')](_0xba43('0x14'),_0x25c9e4,_0x2d38b4['error'][_0xba43('0x13')]);return _0x398f08(_0x2d38b4[_0xba43('0x11')][_0xba43('0x13')]);}else{logger[_0xba43('0xc')](_0xba43('0x14'),_0x25c9e4,'request\x20sent');_0x398f08(_0x2d38b4[_0xba43('0x15')][_0xba43('0x13')]);}})['catch'](function(_0xd7cbe){logger[_0xba43('0x11')](_0xba43('0x14'),_0x25c9e4,_0xd7cbe);_0x117695(_0xd7cbe);});});}
\ No newline at end of file
+var _0x6797=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x439fbd,_0x22249b){var _0x4daa0d=function(_0x2dad7b){while(--_0x2dad7b){_0x439fbd['push'](_0x439fbd['shift']());}};_0x4daa0d(++_0x22249b);}(_0x6797,0x94));var _0x7679=function(_0x4a3143,_0x2e58ae){_0x4a3143=_0x4a3143-0x0;var _0x5f3e62=_0x6797[_0x4a3143];return _0x5f3e62;};'use strict';var _=require(_0x7679('0x0'));var util=require(_0x7679('0x1'));var moment=require(_0x7679('0x2'));var BPromise=require(_0x7679('0x3'));var rs=require(_0x7679('0x4'));var fs=require('fs');var Redis=require(_0x7679('0x5'));var db=require(_0x7679('0x6'))['db'];var utils=require(_0x7679('0x7'));var logger=require(_0x7679('0x8'))('rpc');var config=require(_0x7679('0x9'));var jayson=require(_0x7679('0xa'));var client=jayson['client'][_0x7679('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5326a8,_0x17cd0b,_0xa34325){return new BPromise(function(_0x423561,_0x52150b){return client[_0x7679('0xc')](_0x5326a8,_0xa34325)[_0x7679('0xd')](function(_0x47151a){logger[_0x7679('0xe')](_0x7679('0xf'),_0x17cd0b,_0x7679('0x10'));logger[_0x7679('0x11')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x17cd0b,_0x7679('0x10'),JSON[_0x7679('0x12')](_0x47151a));if(_0x47151a[_0x7679('0x13')]){if(_0x47151a[_0x7679('0x13')][_0x7679('0x14')]===0x1f4){logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x47151a[_0x7679('0x13')]['message']);return _0x52150b(_0x47151a[_0x7679('0x13')][_0x7679('0x15')]);}logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x47151a['error'][_0x7679('0x15')]);return _0x423561(_0x47151a[_0x7679('0x13')]['message']);}else{logger[_0x7679('0xe')](_0x7679('0xf'),_0x17cd0b,_0x7679('0x10'));_0x423561(_0x47151a[_0x7679('0x16')][_0x7679('0x15')]);}})[_0x7679('0x17')](function(_0x16eba5){logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x16eba5);_0x52150b(_0x16eba5);});});}
\ No newline at end of file
index 69f9ad6..f85a54f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4458=['index','/:id','show','create','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated'];(function(_0x392396,_0x43b16a){var _0x49beb4=function(_0x281e8c){while(--_0x281e8c){_0x392396['push'](_0x392396['shift']());}};_0x49beb4(++_0x43b16a);}(_0x4458,0x85));var _0x8445=function(_0x3915bd,_0x20ff38){_0x3915bd=_0x3915bd-0x0;var _0x35ad44=_0x4458[_0x3915bd];return _0x35ad44;};'use strict';var multer=require(_0x8445('0x0'));var util=require('util');var path=require(_0x8445('0x1'));var timeout=require('connect-timeout');var express=require(_0x8445('0x2'));var router=express[_0x8445('0x3')]();var fs_extra=require(_0x8445('0x4'));var auth=require(_0x8445('0x5'));var interaction=require(_0x8445('0x6'));var config=require(_0x8445('0x7'));var controller=require(_0x8445('0x8'));router[_0x8445('0x9')]('/',auth[_0x8445('0xa')](),controller[_0x8445('0xb')]);router[_0x8445('0x9')](_0x8445('0xc'),auth[_0x8445('0xa')](),controller[_0x8445('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8445('0xe')]);router[_0x8445('0xf')]('/:id',auth[_0x8445('0xa')](),controller[_0x8445('0x10')]);router['delete'](_0x8445('0xc'),auth[_0x8445('0xa')](),controller[_0x8445('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x7133=['util','path','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0xeb54bb,_0x2d8002){var _0x4d430f=function(_0x16bdd3){while(--_0x16bdd3){_0xeb54bb['push'](_0xeb54bb['shift']());}};_0x4d430f(++_0x2d8002);}(_0x7133,0x120));var _0x3713=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7133[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x3713('0x0'));var util=require(_0x3713('0x1'));var path=require(_0x3713('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3713('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3713('0x4'));var controller=require(_0x3713('0x5'));router[_0x3713('0x6')]('/',auth[_0x3713('0x7')](),controller[_0x3713('0x8')]);router['get']('/:id',auth[_0x3713('0x7')](),controller[_0x3713('0x9')]);router[_0x3713('0xa')]('/',auth['isAuthenticated'](),controller[_0x3713('0xb')]);router[_0x3713('0xc')](_0x3713('0xd'),auth[_0x3713('0x7')](),controller['update']);router[_0x3713('0xe')]('/:id',auth[_0x3713('0x7')](),controller[_0x3713('0xf')]);module[_0x3713('0x10')]=router;
\ No newline at end of file
index d706d51..8f83124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2469=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x476bf4,_0x5e8a43){var _0x2f170b=function(_0x2f0c5e){while(--_0x2f0c5e){_0x476bf4['push'](_0x476bf4['shift']());}};_0x2f170b(++_0x5e8a43);}(_0x2469,0x10d));var _0x9246=function(_0x28db84,_0x404d31){_0x28db84=_0x28db84-0x0;var _0x183110=_0x2469[_0x28db84];return _0x183110;};'use strict';var Sequelize=require(_0x9246('0x0'));module[_0x9246('0x1')]={'type':{'type':Sequelize[_0x9246('0x2')](_0x9246('0x3'),_0x9246('0x4'),_0x9246('0x5'),'keyValue',_0x9246('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9246('0x7')]},'key':{'type':Sequelize[_0x9246('0x7')]},'keyType':{'type':Sequelize[_0x9246('0x2')](_0x9246('0x3'),_0x9246('0x4'),_0x9246('0x5'))},'keyContent':{'type':Sequelize[_0x9246('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9246('0x7')]},'customField':{'type':Sequelize[_0x9246('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x447f=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3c8af1,_0xf0e67c){var _0x348685=function(_0x2e71e8){while(--_0x2e71e8){_0x3c8af1['push'](_0x3c8af1['shift']());}};_0x348685(++_0xf0e67c);}(_0x447f,0xac));var _0xf447=function(_0x479c97,_0x44057a){_0x479c97=_0x479c97-0x0;var _0x4c129c=_0x447f[_0x479c97];return _0x4c129c;};'use strict';var Sequelize=require('sequelize');module[_0xf447('0x0')]={'type':{'type':Sequelize[_0xf447('0x1')](_0xf447('0x2'),_0xf447('0x3'),_0xf447('0x4'),_0xf447('0x5'),_0xf447('0x6')),'defaultValue':_0xf447('0x2')},'content':{'type':Sequelize[_0xf447('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xf447('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf447('0x7')]},'nameField':{'type':Sequelize[_0xf447('0x7')]},'customField':{'type':Sequelize[_0xf447('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0846633..178cd5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb69=['includeAll','include','findAll','catch','show','create','body','find','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','destroy','then','name','send','index','map','ServicenowField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','options'];(function(_0x42eb9b,_0x22b87d){var _0x3ee074=function(_0x4e6f6f){while(--_0x4e6f6f){_0x42eb9b['push'](_0x42eb9b['shift']());}};_0x3ee074(++_0x22b87d);}(_0xcb69,0x125));var _0x9cb6=function(_0xe8eb26,_0x5bbc20){_0xe8eb26=_0xe8eb26-0x0;var _0x47f9bb=_0xcb69[_0xe8eb26];return _0x47f9bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9cb6('0x0'));var zipdir=require(_0x9cb6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cb6('0x2'));var moment=require(_0x9cb6('0x3'));var BPromise=require(_0x9cb6('0x4'));var Mustache=require(_0x9cb6('0x5'));var util=require(_0x9cb6('0x6'));var path=require(_0x9cb6('0x7'));var sox=require(_0x9cb6('0x8'));var csv=require(_0x9cb6('0x9'));var ejs=require(_0x9cb6('0xa'));var fs=require('fs');var fs_extra=require(_0x9cb6('0xb'));var _=require(_0x9cb6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9cb6('0xd'));var deskjs=require(_0x9cb6('0xe'));var toCsv=require(_0x9cb6('0x9'));var querystring=require('querystring');var Papa=require(_0x9cb6('0xf'));var Redis=require(_0x9cb6('0x10'));var authService=require(_0x9cb6('0x11'));var qs=require(_0x9cb6('0x12'));var as=require(_0x9cb6('0x13'));var hardwareService=require(_0x9cb6('0x14'));var logger=require(_0x9cb6('0x15'))(_0x9cb6('0x16'));var utils=require(_0x9cb6('0x17'));var config=require(_0x9cb6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9cb6('0x19'))['db'];function respondWithStatusCode(_0x44adc6,_0x28177e){_0x28177e=_0x28177e||0xcc;return function(_0xfd8a83){if(_0xfd8a83){return _0x44adc6[_0x9cb6('0x1a')](_0x28177e);}return _0x44adc6['status'](_0x28177e)[_0x9cb6('0x1b')]();};}function respondWithResult(_0x15d261,_0x362b11){_0x362b11=_0x362b11||0xc8;return function(_0x28291d){if(_0x28291d){return _0x15d261['status'](_0x362b11)[_0x9cb6('0x1c')](_0x28291d);}};}function respondWithFilteredResult(_0x4ab8c2,_0x5e1af8){return function(_0x24169a){if(_0x24169a){var _0x2bcd35=typeof _0x5e1af8[_0x9cb6('0x1d')]===_0x9cb6('0x1e')&&typeof _0x5e1af8[_0x9cb6('0x1f')]===_0x9cb6('0x1e');var _0x408b88=_0x24169a[_0x9cb6('0x20')];var _0x131ee9=_0x2bcd35?0x0:_0x5e1af8['offset'];var _0x4eec3b=_0x2bcd35?_0x24169a['count']:_0x5e1af8[_0x9cb6('0x1d')]+_0x5e1af8['limit'];var _0x3656ee;if(_0x4eec3b>=_0x408b88){_0x4eec3b=_0x408b88;_0x3656ee=0xc8;}else{_0x3656ee=0xce;}_0x4ab8c2[_0x9cb6('0x21')](_0x3656ee);return _0x4ab8c2[_0x9cb6('0x22')](_0x9cb6('0x23'),_0x131ee9+'-'+_0x4eec3b+'/'+_0x408b88)[_0x9cb6('0x1c')](_0x24169a);}return null;};}function patchUpdates(_0x317686){return function(_0x16a618){try{jsonpatch['apply'](_0x16a618,_0x317686,!![]);}catch(_0x302188){return BPromise['reject'](_0x302188);}return _0x16a618[_0x9cb6('0x24')]();};}function saveUpdates(_0x28f69e,_0x271105){return function(_0x2c6698){if(_0x2c6698){return _0x2c6698[_0x9cb6('0x25')](_0x28f69e)['then'](function(_0x2f7fde){return _0x2f7fde;});}return null;};}function removeEntity(_0x41a526,_0x47727e){return function(_0x38d0b2){if(_0x38d0b2){return _0x38d0b2[_0x9cb6('0x26')]()[_0x9cb6('0x27')](function(){_0x41a526[_0x9cb6('0x21')](0xcc)[_0x9cb6('0x1b')]();});}};}function handleEntityNotFound(_0x8c3d90,_0x4d1066){return function(_0x5034d0){if(!_0x5034d0){_0x8c3d90[_0x9cb6('0x1a')](0x194);}return _0x5034d0;};}function handleError(_0x5a8d75,_0x57b137){_0x57b137=_0x57b137||0x1f4;return function(_0x8a24f0){logger['error'](_0x8a24f0['stack']);if(_0x8a24f0['name']){delete _0x8a24f0[_0x9cb6('0x28')];}_0x5a8d75['status'](_0x57b137)[_0x9cb6('0x29')](_0x8a24f0);};}exports[_0x9cb6('0x2a')]=function(_0x3682a6,_0x1ed2f4){var _0x9a68e8={},_0x2c7bf1={},_0x383e12={'count':0x0,'rows':[]};var _0x571afa=_[_0x9cb6('0x2b')](db[_0x9cb6('0x2c')][_0x9cb6('0x2d')],function(_0x2763fc){return{'name':_0x2763fc[_0x9cb6('0x2e')],'type':_0x2763fc['type']['key']};});_0x2c7bf1[_0x9cb6('0x2f')]=_[_0x9cb6('0x2b')](_0x571afa,_0x9cb6('0x28'));_0x2c7bf1[_0x9cb6('0x30')]=_[_0x9cb6('0x31')](_0x3682a6[_0x9cb6('0x30')]);_0x2c7bf1[_0x9cb6('0x32')]=_[_0x9cb6('0x33')](_0x2c7bf1[_0x9cb6('0x2f')],_0x2c7bf1[_0x9cb6('0x30')]);_0x9a68e8[_0x9cb6('0x34')]=_['intersection'](_0x2c7bf1['model'],qs[_0x9cb6('0x35')](_0x3682a6[_0x9cb6('0x30')][_0x9cb6('0x35')]));_0x9a68e8[_0x9cb6('0x34')]=_0x9a68e8['attributes'][_0x9cb6('0x36')]?_0x9a68e8['attributes']:_0x2c7bf1[_0x9cb6('0x2f')];if(!_0x3682a6[_0x9cb6('0x30')][_0x9cb6('0x37')]('nolimit')){_0x9a68e8[_0x9cb6('0x1f')]=qs[_0x9cb6('0x1f')](_0x3682a6[_0x9cb6('0x30')][_0x9cb6('0x1f')]);_0x9a68e8[_0x9cb6('0x1d')]=qs[_0x9cb6('0x1d')](_0x3682a6['query'][_0x9cb6('0x1d')]);}_0x9a68e8[_0x9cb6('0x38')]=qs[_0x9cb6('0x39')](_0x3682a6[_0x9cb6('0x30')]['sort']);_0x9a68e8[_0x9cb6('0x3a')]=qs[_0x9cb6('0x32')](_['pick'](_0x3682a6[_0x9cb6('0x30')],_0x2c7bf1['filters']),_0x571afa);if(_0x3682a6[_0x9cb6('0x30')]['filter']){_0x9a68e8[_0x9cb6('0x3a')]=_[_0x9cb6('0x3b')](_0x9a68e8[_0x9cb6('0x3a')],{'$or':_[_0x9cb6('0x2b')](_0x571afa,function(_0x415033){if(_0x415033[_0x9cb6('0x3c')]!=='VIRTUAL'){var _0x3ac044={};_0x3ac044[_0x415033[_0x9cb6('0x28')]]={'$like':'%'+_0x3682a6[_0x9cb6('0x30')]['filter']+'%'};return _0x3ac044;}})});}_0x9a68e8=_['merge']({},_0x9a68e8,_0x3682a6[_0x9cb6('0x3d')]);var _0x6654ea={'where':_0x9a68e8[_0x9cb6('0x3a')]};return db['ServicenowField'][_0x9cb6('0x20')](_0x6654ea)[_0x9cb6('0x27')](function(_0x289c1b){_0x383e12[_0x9cb6('0x20')]=_0x289c1b;if(_0x3682a6[_0x9cb6('0x30')][_0x9cb6('0x3e')]){_0x9a68e8[_0x9cb6('0x3f')]=[{'all':!![]}];}return db['ServicenowField'][_0x9cb6('0x40')](_0x9a68e8);})[_0x9cb6('0x27')](function(_0x56eff6){_0x383e12['rows']=_0x56eff6;return _0x383e12;})[_0x9cb6('0x27')](respondWithFilteredResult(_0x1ed2f4,_0x9a68e8))[_0x9cb6('0x41')](handleError(_0x1ed2f4,null));};exports[_0x9cb6('0x42')]=function(_0x1c3f8b,_0x293a4e){var _0x3bbfd8={'raw':!![],'where':{'id':_0x1c3f8b['params']['id']}},_0x396897={};_0x396897[_0x9cb6('0x2f')]=_[_0x9cb6('0x31')](db[_0x9cb6('0x2c')][_0x9cb6('0x2d')]);_0x396897[_0x9cb6('0x30')]=_[_0x9cb6('0x31')](_0x1c3f8b[_0x9cb6('0x30')]);_0x396897[_0x9cb6('0x32')]=_[_0x9cb6('0x33')](_0x396897[_0x9cb6('0x2f')],_0x396897[_0x9cb6('0x30')]);_0x3bbfd8[_0x9cb6('0x34')]=_['intersection'](_0x396897[_0x9cb6('0x2f')],qs['fields'](_0x1c3f8b[_0x9cb6('0x30')]['fields']));_0x3bbfd8[_0x9cb6('0x34')]=_0x3bbfd8[_0x9cb6('0x34')]['length']?_0x3bbfd8[_0x9cb6('0x34')]:_0x396897[_0x9cb6('0x2f')];if(_0x1c3f8b[_0x9cb6('0x30')][_0x9cb6('0x3e')]){_0x3bbfd8[_0x9cb6('0x3f')]=[{'all':!![]}];}_0x3bbfd8=_['merge']({},_0x3bbfd8,_0x1c3f8b[_0x9cb6('0x3d')]);return db[_0x9cb6('0x2c')]['find'](_0x3bbfd8)[_0x9cb6('0x27')](handleEntityNotFound(_0x293a4e,null))[_0x9cb6('0x27')](respondWithResult(_0x293a4e,null))[_0x9cb6('0x41')](handleError(_0x293a4e,null));};exports[_0x9cb6('0x43')]=function(_0x566b09,_0x2097f9){return db[_0x9cb6('0x2c')][_0x9cb6('0x43')](_0x566b09[_0x9cb6('0x44')],{})['then'](respondWithResult(_0x2097f9,0xc9))['catch'](handleError(_0x2097f9,null));};exports[_0x9cb6('0x25')]=function(_0x2bd15f,_0x2daf42){if(_0x2bd15f['body']['id']){delete _0x2bd15f[_0x9cb6('0x44')]['id'];}return db[_0x9cb6('0x2c')]['find']({'where':{'id':_0x2bd15f['params']['id']}})[_0x9cb6('0x27')](handleEntityNotFound(_0x2daf42,null))[_0x9cb6('0x27')](saveUpdates(_0x2bd15f[_0x9cb6('0x44')],null))[_0x9cb6('0x27')](respondWithResult(_0x2daf42,null))['catch'](handleError(_0x2daf42,null));};exports['destroy']=function(_0x174ce6,_0x51781d){return db[_0x9cb6('0x2c')][_0x9cb6('0x45')]({'where':{'id':_0x174ce6[_0x9cb6('0x46')]['id']}})[_0x9cb6('0x27')](handleEntityNotFound(_0x51781d,null))[_0x9cb6('0x27')](removeEntity(_0x51781d,null))[_0x9cb6('0x41')](handleError(_0x51781d,null));};
\ No newline at end of file
+var _0x949e=['../../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','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x17f24f,_0x114fda){var _0x490f1f=function(_0x282fd8){while(--_0x282fd8){_0x17f24f['push'](_0x17f24f['shift']());}};_0x490f1f(++_0x114fda);}(_0x949e,0x85));var _0xe949=function(_0xdf108a,_0x26b93d){_0xdf108a=_0xdf108a-0x0;var _0x3015a1=_0x949e[_0xdf108a];return _0x3015a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe949('0x0'));var zipdir=require(_0xe949('0x1'));var jsonpatch=require(_0xe949('0x2'));var rp=require(_0xe949('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe949('0x4'));var path=require(_0xe949('0x5'));var sox=require(_0xe949('0x6'));var csv=require(_0xe949('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe949('0x8'));var _=require('lodash');var squel=require(_0xe949('0x9'));var crypto=require(_0xe949('0xa'));var jsforce=require(_0xe949('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe949('0x7'));var querystring=require(_0xe949('0xc'));var Papa=require(_0xe949('0xd'));var Redis=require(_0xe949('0xe'));var authService=require(_0xe949('0xf'));var qs=require(_0xe949('0x10'));var as=require(_0xe949('0x11'));var hardwareService=require(_0xe949('0x12'));var logger=require(_0xe949('0x13'))(_0xe949('0x14'));var utils=require(_0xe949('0x15'));var config=require(_0xe949('0x16'));var licenseUtil=require(_0xe949('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3171bb,_0x8a4c1c){_0x8a4c1c=_0x8a4c1c||0xcc;return function(_0x36652a){if(_0x36652a){return _0x3171bb[_0xe949('0x18')](_0x8a4c1c);}return _0x3171bb[_0xe949('0x19')](_0x8a4c1c)[_0xe949('0x1a')]();};}function respondWithResult(_0x2fc3cc,_0x558547){_0x558547=_0x558547||0xc8;return function(_0x2afe36){if(_0x2afe36){return _0x2fc3cc[_0xe949('0x19')](_0x558547)['json'](_0x2afe36);}};}function respondWithFilteredResult(_0x2c265f,_0x5c76e3){return function(_0xb628a8){if(_0xb628a8){var _0x2fb0a1=typeof _0x5c76e3[_0xe949('0x1b')]===_0xe949('0x1c')&&typeof _0x5c76e3[_0xe949('0x1d')]===_0xe949('0x1c');var _0x368af4=_0xb628a8[_0xe949('0x1e')];var _0x478d1e=_0x2fb0a1?0x0:_0x5c76e3[_0xe949('0x1b')];var _0x105db5=_0x2fb0a1?_0xb628a8['count']:_0x5c76e3[_0xe949('0x1b')]+_0x5c76e3[_0xe949('0x1d')];var _0x117766;if(_0x105db5>=_0x368af4){_0x105db5=_0x368af4;_0x117766=0xc8;}else{_0x117766=0xce;}_0x2c265f[_0xe949('0x19')](_0x117766);return _0x2c265f[_0xe949('0x1f')](_0xe949('0x20'),_0x478d1e+'-'+_0x105db5+'/'+_0x368af4)['json'](_0xb628a8);}return null;};}function patchUpdates(_0x51b9f5){return function(_0x528270){try{jsonpatch[_0xe949('0x21')](_0x528270,_0x51b9f5,!![]);}catch(_0x2af2d0){return BPromise[_0xe949('0x22')](_0x2af2d0);}return _0x528270['save']();};}function saveUpdates(_0x7b43c,_0x2861aa){return function(_0x6b0d5e){if(_0x6b0d5e){return _0x6b0d5e[_0xe949('0x23')](_0x7b43c)[_0xe949('0x24')](function(_0x40e3bd){return _0x40e3bd;});}return null;};}function removeEntity(_0x30855d,_0x22d1bd){return function(_0x2c80cd){if(_0x2c80cd){return _0x2c80cd[_0xe949('0x25')]()['then'](function(){_0x30855d[_0xe949('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1801dd,_0x4e706a){return function(_0x29109a){if(!_0x29109a){_0x1801dd[_0xe949('0x18')](0x194);}return _0x29109a;};}function handleError(_0x368fac,_0x5abfc7){_0x5abfc7=_0x5abfc7||0x1f4;return function(_0x3d7301){logger[_0xe949('0x26')](_0x3d7301['stack']);if(_0x3d7301[_0xe949('0x27')]){delete _0x3d7301['name'];}_0x368fac['status'](_0x5abfc7)[_0xe949('0x28')](_0x3d7301);};}exports[_0xe949('0x29')]=function(_0x54ee07,_0x17e1ea){var _0x3dcfc3={},_0x1fd022={},_0x4abae1={'count':0x0,'rows':[]};var _0x58316=_[_0xe949('0x2a')](db[_0xe949('0x2b')][_0xe949('0x2c')],function(_0x154696){return{'name':_0x154696[_0xe949('0x2d')],'type':_0x154696['type']['key']};});_0x1fd022[_0xe949('0x2e')]=_[_0xe949('0x2a')](_0x58316,_0xe949('0x27'));_0x1fd022[_0xe949('0x2f')]=_[_0xe949('0x30')](_0x54ee07[_0xe949('0x2f')]);_0x1fd022['filters']=_[_0xe949('0x31')](_0x1fd022['model'],_0x1fd022['query']);_0x3dcfc3[_0xe949('0x32')]=_['intersection'](_0x1fd022[_0xe949('0x2e')],qs[_0xe949('0x33')](_0x54ee07[_0xe949('0x2f')]['fields']));_0x3dcfc3[_0xe949('0x32')]=_0x3dcfc3[_0xe949('0x32')][_0xe949('0x34')]?_0x3dcfc3['attributes']:_0x1fd022[_0xe949('0x2e')];if(!_0x54ee07['query'][_0xe949('0x35')](_0xe949('0x36'))){_0x3dcfc3[_0xe949('0x1d')]=qs['limit'](_0x54ee07[_0xe949('0x2f')][_0xe949('0x1d')]);_0x3dcfc3[_0xe949('0x1b')]=qs[_0xe949('0x1b')](_0x54ee07['query'][_0xe949('0x1b')]);}_0x3dcfc3[_0xe949('0x37')]=qs['sort'](_0x54ee07[_0xe949('0x2f')][_0xe949('0x38')]);_0x3dcfc3[_0xe949('0x39')]=qs[_0xe949('0x3a')](_[_0xe949('0x3b')](_0x54ee07[_0xe949('0x2f')],_0x1fd022[_0xe949('0x3a')]),_0x58316);if(_0x54ee07[_0xe949('0x2f')][_0xe949('0x3c')]){_0x3dcfc3[_0xe949('0x39')]=_[_0xe949('0x3d')](_0x3dcfc3[_0xe949('0x39')],{'$or':_['map'](_0x58316,function(_0x36a982){if(_0x36a982[_0xe949('0x3e')]!=='VIRTUAL'){var _0xa31720={};_0xa31720[_0x36a982[_0xe949('0x27')]]={'$like':'%'+_0x54ee07[_0xe949('0x2f')][_0xe949('0x3c')]+'%'};return _0xa31720;}})});}_0x3dcfc3=_[_0xe949('0x3d')]({},_0x3dcfc3,_0x54ee07[_0xe949('0x3f')]);var _0x3b6b62={'where':_0x3dcfc3[_0xe949('0x39')]};return db[_0xe949('0x2b')][_0xe949('0x1e')](_0x3b6b62)['then'](function(_0xfeafcb){_0x4abae1[_0xe949('0x1e')]=_0xfeafcb;if(_0x54ee07[_0xe949('0x2f')][_0xe949('0x40')]){_0x3dcfc3['include']=[{'all':!![]}];}return db[_0xe949('0x2b')][_0xe949('0x41')](_0x3dcfc3);})['then'](function(_0x4c47a6){_0x4abae1[_0xe949('0x42')]=_0x4c47a6;return _0x4abae1;})['then'](respondWithFilteredResult(_0x17e1ea,_0x3dcfc3))[_0xe949('0x43')](handleError(_0x17e1ea,null));};exports[_0xe949('0x44')]=function(_0x147e9e,_0x3e132e){var _0x56f62f={'raw':!![],'where':{'id':_0x147e9e[_0xe949('0x45')]['id']}},_0x2a6576={};_0x2a6576[_0xe949('0x2e')]=_[_0xe949('0x30')](db[_0xe949('0x2b')][_0xe949('0x2c')]);_0x2a6576[_0xe949('0x2f')]=_[_0xe949('0x30')](_0x147e9e[_0xe949('0x2f')]);_0x2a6576['filters']=_[_0xe949('0x31')](_0x2a6576['model'],_0x2a6576[_0xe949('0x2f')]);_0x56f62f[_0xe949('0x32')]=_[_0xe949('0x31')](_0x2a6576[_0xe949('0x2e')],qs['fields'](_0x147e9e[_0xe949('0x2f')]['fields']));_0x56f62f[_0xe949('0x32')]=_0x56f62f[_0xe949('0x32')]['length']?_0x56f62f[_0xe949('0x32')]:_0x2a6576[_0xe949('0x2e')];if(_0x147e9e[_0xe949('0x2f')]['includeAll']){_0x56f62f[_0xe949('0x46')]=[{'all':!![]}];}_0x56f62f=_[_0xe949('0x3d')]({},_0x56f62f,_0x147e9e['options']);return db[_0xe949('0x2b')][_0xe949('0x47')](_0x56f62f)[_0xe949('0x24')](handleEntityNotFound(_0x3e132e,null))[_0xe949('0x24')](respondWithResult(_0x3e132e,null))[_0xe949('0x43')](handleError(_0x3e132e,null));};exports[_0xe949('0x48')]=function(_0x32c310,_0x124bd6){return db[_0xe949('0x2b')][_0xe949('0x48')](_0x32c310[_0xe949('0x49')],{})[_0xe949('0x24')](respondWithResult(_0x124bd6,0xc9))[_0xe949('0x43')](handleError(_0x124bd6,null));};exports[_0xe949('0x23')]=function(_0x130048,_0x5ec45c){if(_0x130048[_0xe949('0x49')]['id']){delete _0x130048[_0xe949('0x49')]['id'];}return db[_0xe949('0x2b')][_0xe949('0x47')]({'where':{'id':_0x130048[_0xe949('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ec45c,null))[_0xe949('0x24')](saveUpdates(_0x130048[_0xe949('0x49')],null))[_0xe949('0x24')](respondWithResult(_0x5ec45c,null))['catch'](handleError(_0x5ec45c,null));};exports[_0xe949('0x25')]=function(_0x18a6a9,_0x35312a){return db[_0xe949('0x2b')][_0xe949('0x47')]({'where':{'id':_0x18a6a9[_0xe949('0x45')]['id']}})[_0xe949('0x24')](handleEntityNotFound(_0x35312a,null))[_0xe949('0x24')](removeEntity(_0x35312a,null))[_0xe949('0x43')](handleError(_0x35312a,null));};
\ No newline at end of file
index cd4abdb..242e17e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf17e=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ServicenowField'];(function(_0x12d911,_0x2ee6dc){var _0x591d8c=function(_0x3010bd){while(--_0x3010bd){_0x12d911['push'](_0x12d911['shift']());}};_0x591d8c(++_0x2ee6dc);}(_0xf17e,0xb8));var _0xef17=function(_0x1614aa,_0x15f8c6){_0x1614aa=_0x1614aa-0x0;var _0x11e4bf=_0xf17e[_0x1614aa];return _0x11e4bf;};'use strict';var _=require(_0xef17('0x0'));var util=require(_0xef17('0x1'));var logger=require('../../config/logger')(_0xef17('0x2'));var moment=require(_0xef17('0x3'));var BPromise=require(_0xef17('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef17('0x5'));var rimraf=require(_0xef17('0x6'));var config=require(_0xef17('0x7'));var attributes=require('./intServicenowField.attributes');module[_0xef17('0x8')]=function(_0x5a7193,_0xfe9a4b){return _0x5a7193[_0xef17('0x9')](_0xef17('0xa'),attributes,{'tableName':_0xef17('0xb'),'paranoid':![],'indexes':[{'name':_0xef17('0xc'),'fields':[_0xef17('0xd'),_0xef17('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9303=['../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','lodash','moment','bluebird','path','rimraf'];(function(_0x1f18a4,_0x2e20ef){var _0x46b9ac=function(_0x51dc8a){while(--_0x51dc8a){_0x1f18a4['push'](_0x1f18a4['shift']());}};_0x46b9ac(++_0x2e20ef);}(_0x9303,0x119));var _0x3930=function(_0x1cb825,_0x909dc6){_0x1cb825=_0x1cb825-0x0;var _0x596088=_0x9303[_0x1cb825];return _0x596088;};'use strict';var _=require(_0x3930('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3930('0x1'));var BPromise=require(_0x3930('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3930('0x3'));var rimraf=require(_0x3930('0x4'));var config=require(_0x3930('0x5'));var attributes=require(_0x3930('0x6'));module[_0x3930('0x7')]=function(_0x1f044c,_0x196b48){return _0x1f044c[_0x3930('0x8')](_0x3930('0x9'),attributes,{'tableName':_0x3930('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 2e06ecd..6aef91d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xac4a,0x13f));var _0xaac4=function(_0x28ede4,_0x2aa734){_0x28ede4=_0x28ede4-0x0;var _0x5da017=_0xac4a[_0x28ede4];return _0x5da017;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
+var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x64c3a8,_0x1e0dcf){var _0x4da0b0=function(_0x354ad5){while(--_0x354ad5){_0x64c3a8['push'](_0x64c3a8['shift']());}};_0x4da0b0(++_0x1e0dcf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0xcb91[_0x4ec13d];return _0x3c3fa7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
index b3a9c1e..355fdc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x105b1f,_0x534168){var _0x3c5085=function(_0x30bf71){while(--_0x30bf71){_0x105b1f['push'](_0x105b1f['shift']());}};_0x3c5085(++_0x534168);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x16fdc6,_0x2d6034){var _0x5c2eaa=function(_0x519214){while(--_0x519214){_0x16fdc6['push'](_0x16fdc6['shift']());}};_0x5c2eaa(++_0x2d6034);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
index c753ee6..cdd563d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x31e6a0,_0x2f5234){var _0x21501c=function(_0x348a71){while(--_0x348a71){_0x31e6a0['push'](_0x31e6a0['shift']());}};_0x21501c(++_0x2f5234);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x351d91,_0x1af0f4){var _0x392deb=function(_0x17c853){while(--_0x17c853){_0x351d91['push'](_0x351d91['shift']());}};_0x392deb(++_0x1af0f4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 7e6bd09..fa8714c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bdb=['username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','stringify','Calls','values','module_fields','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_minutes','parent_type','parent_name','direction'];(function(_0x25205b,_0x463155){var _0x3d2536=function(_0x3b4010){while(--_0x3b4010){_0x25205b['push'](_0x25205b['shift']());}};_0x3d2536(++_0x463155);}(_0x2bdb,0x105));var _0xb2bd=function(_0x348fec,_0x486f87){_0x348fec=_0x348fec-0x0;var _0x5914c7=_0x2bdb[_0x348fec];return _0x5914c7;};'use strict';var emlformat=require(_0xb2bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb2bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2bd('0x2'));var moment=require(_0xb2bd('0x3'));var BPromise=require(_0xb2bd('0x4'));var Mustache=require('mustache');var util=require(_0xb2bd('0x5'));var path=require(_0xb2bd('0x6'));var sox=require(_0xb2bd('0x7'));var csv=require(_0xb2bd('0x8'));var ejs=require(_0xb2bd('0x9'));var fs=require('fs');var fs_extra=require(_0xb2bd('0xa'));var _=require(_0xb2bd('0xb'));var squel=require('squel');var crypto=require(_0xb2bd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb2bd('0xd'));var toCsv=require(_0xb2bd('0x8'));var querystring=require(_0xb2bd('0xe'));var Papa=require(_0xb2bd('0xf'));var Redis=require(_0xb2bd('0x10'));var authService=require(_0xb2bd('0x11'));var qs=require(_0xb2bd('0x12'));var as=require(_0xb2bd('0x13'));var hardwareService=require(_0xb2bd('0x14'));var logger=require('../../config/logger')(_0xb2bd('0x15'));var utils=require(_0xb2bd('0x16'));var config=require(_0xb2bd('0x17'));var licenseUtil=require(_0xb2bd('0x18'));var db=require(_0xb2bd('0x19'))['db'];var integrations=require(_0xb2bd('0x1a'));function respondWithStatusCode(_0x6d2212,_0x452cd6){_0x452cd6=_0x452cd6||0xcc;return function(_0x58425a){if(_0x58425a){return _0x6d2212[_0xb2bd('0x1b')](_0x452cd6);}return _0x6d2212['status'](_0x452cd6)[_0xb2bd('0x1c')]();};}function respondWithResult(_0x2adda1,_0x17e238){_0x17e238=_0x17e238||0xc8;return function(_0x259053){if(_0x259053){return _0x2adda1[_0xb2bd('0x1d')](_0x17e238)['json'](_0x259053);}};}function respondWithFilteredResult(_0x23c440,_0x315ecc){return function(_0x2091d2){if(_0x2091d2){var _0x991fe=typeof _0x315ecc['offset']===_0xb2bd('0x1e')&&typeof _0x315ecc[_0xb2bd('0x1f')]==='undefined';var _0x1ad53e=_0x2091d2[_0xb2bd('0x20')];var _0x387897=_0x991fe?0x0:_0x315ecc[_0xb2bd('0x21')];var _0x5d848d=_0x991fe?_0x2091d2[_0xb2bd('0x20')]:_0x315ecc[_0xb2bd('0x21')]+_0x315ecc['limit'];var _0xd89760;if(_0x5d848d>=_0x1ad53e){_0x5d848d=_0x1ad53e;_0xd89760=0xc8;}else{_0xd89760=0xce;}_0x23c440[_0xb2bd('0x1d')](_0xd89760);return _0x23c440['set']('Content-Range',_0x387897+'-'+_0x5d848d+'/'+_0x1ad53e)['json'](_0x2091d2);}return null;};}function patchUpdates(_0x31a69f){return function(_0x4dfda8){try{jsonpatch[_0xb2bd('0x22')](_0x4dfda8,_0x31a69f,!![]);}catch(_0x48fc57){return BPromise[_0xb2bd('0x23')](_0x48fc57);}return _0x4dfda8[_0xb2bd('0x24')]();};}function saveUpdates(_0x505c35,_0x246f71){return function(_0x5e55f1){if(_0x5e55f1){return _0x5e55f1[_0xb2bd('0x25')](_0x505c35)[_0xb2bd('0x26')](function(_0x2d281c){return _0x2d281c;});}return null;};}function removeEntity(_0x7517de,_0x5665ae){return function(_0x44635a){if(_0x44635a){return _0x44635a[_0xb2bd('0x27')]()[_0xb2bd('0x26')](function(){_0x7517de[_0xb2bd('0x1d')](0xcc)[_0xb2bd('0x1c')]();});}};}function handleEntityNotFound(_0x284da5,_0x5fd563){return function(_0x5bc22e){if(!_0x5bc22e){_0x284da5[_0xb2bd('0x1b')](0x194);}return _0x5bc22e;};}function handleError(_0x18859a,_0xdba731){_0xdba731=_0xdba731||0x1f4;return function(_0x38a954){logger[_0xb2bd('0x28')](_0x38a954[_0xb2bd('0x29')]);if(_0x38a954[_0xb2bd('0x2a')]){delete _0x38a954['name'];}_0x18859a[_0xb2bd('0x1d')](_0xdba731)['send'](_0x38a954);};}exports[_0xb2bd('0x2b')]=function(_0x5a7a7c,_0xbfae89){var _0x41ba8f={},_0x65211d={},_0x5628c3={'count':0x0,'rows':[]};var _0x321c13=_[_0xb2bd('0x2c')](db[_0xb2bd('0x2d')][_0xb2bd('0x2e')],function(_0x2976b6){return{'name':_0x2976b6[_0xb2bd('0x2f')],'type':_0x2976b6['type']['key']};});_0x65211d[_0xb2bd('0x30')]=_['map'](_0x321c13,_0xb2bd('0x2a'));_0x65211d[_0xb2bd('0x31')]=_[_0xb2bd('0x32')](_0x5a7a7c['query']);_0x65211d[_0xb2bd('0x33')]=_[_0xb2bd('0x34')](_0x65211d[_0xb2bd('0x30')],_0x65211d[_0xb2bd('0x31')]);_0x41ba8f[_0xb2bd('0x35')]=_[_0xb2bd('0x34')](_0x65211d[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x36')]));_0x41ba8f['attributes']=_0x41ba8f[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0x41ba8f[_0xb2bd('0x35')]:_0x65211d[_0xb2bd('0x30')];if(!_0x5a7a7c['query'][_0xb2bd('0x38')](_0xb2bd('0x39'))){_0x41ba8f[_0xb2bd('0x1f')]=qs[_0xb2bd('0x1f')](_0x5a7a7c[_0xb2bd('0x31')]['limit']);_0x41ba8f['offset']=qs[_0xb2bd('0x21')](_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x21')]);}_0x41ba8f[_0xb2bd('0x3a')]=qs[_0xb2bd('0x3b')](_0x5a7a7c['query'][_0xb2bd('0x3b')]);_0x41ba8f[_0xb2bd('0x3c')]=qs[_0xb2bd('0x33')](_[_0xb2bd('0x3d')](_0x5a7a7c[_0xb2bd('0x31')],_0x65211d[_0xb2bd('0x33')]),_0x321c13);if(_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x3e')]){_0x41ba8f[_0xb2bd('0x3c')]=_[_0xb2bd('0x3f')](_0x41ba8f[_0xb2bd('0x3c')],{'$or':_[_0xb2bd('0x2c')](_0x321c13,function(_0x368db7){if(_0x368db7['type']!==_0xb2bd('0x40')){var _0x2576c5={};_0x2576c5[_0x368db7[_0xb2bd('0x2a')]]={'$like':'%'+_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x3e')]+'%'};return _0x2576c5;}})});}_0x41ba8f=_[_0xb2bd('0x3f')]({},_0x41ba8f,_0x5a7a7c[_0xb2bd('0x41')]);var _0x3257a4={'where':_0x41ba8f['where']};return db['SugarcrmAccount'][_0xb2bd('0x20')](_0x3257a4)[_0xb2bd('0x26')](function(_0x555f4a){_0x5628c3[_0xb2bd('0x20')]=_0x555f4a;if(_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x42')]){_0x41ba8f[_0xb2bd('0x43')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xb2bd('0x44')](_0x41ba8f);})[_0xb2bd('0x26')](function(_0xa2a52){_0x5628c3['rows']=_0xa2a52;return _0x5628c3;})[_0xb2bd('0x26')](respondWithFilteredResult(_0xbfae89,_0x41ba8f))[_0xb2bd('0x45')](handleError(_0xbfae89,null));};exports['show']=function(_0xbbfd15,_0x5c316f){var _0x285599={'raw':![],'where':{'id':_0xbbfd15['params']['id']}},_0x4050a5={};_0x4050a5[_0xb2bd('0x30')]=_[_0xb2bd('0x32')](db[_0xb2bd('0x2d')][_0xb2bd('0x2e')]);_0x4050a5[_0xb2bd('0x31')]=_['keys'](_0xbbfd15[_0xb2bd('0x31')]);_0x4050a5[_0xb2bd('0x33')]=_[_0xb2bd('0x34')](_0x4050a5[_0xb2bd('0x30')],_0x4050a5[_0xb2bd('0x31')]);_0x285599[_0xb2bd('0x35')]=_[_0xb2bd('0x34')](_0x4050a5[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0xbbfd15[_0xb2bd('0x31')]['fields']));_0x285599[_0xb2bd('0x35')]=_0x285599[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0x285599[_0xb2bd('0x35')]:_0x4050a5[_0xb2bd('0x30')];if(_0xbbfd15['query'][_0xb2bd('0x42')]){_0x285599[_0xb2bd('0x43')]=[{'all':!![]}];}_0x285599=_['merge']({},_0x285599,_0xbbfd15[_0xb2bd('0x41')]);return db['SugarcrmAccount'][_0xb2bd('0x46')](_0x285599)[_0xb2bd('0x26')](handleEntityNotFound(_0x5c316f,null))[_0xb2bd('0x26')](respondWithResult(_0x5c316f,null))[_0xb2bd('0x45')](handleError(_0x5c316f,null));};exports[_0xb2bd('0x47')]=function(_0x4a35f4,_0x3cef0a){return db[_0xb2bd('0x2d')]['create'](_0x4a35f4[_0xb2bd('0x48')],{})['then'](respondWithResult(_0x3cef0a,0xc9))[_0xb2bd('0x45')](handleError(_0x3cef0a,null));};exports[_0xb2bd('0x25')]=function(_0x311ab8,_0x112f45){if(_0x311ab8[_0xb2bd('0x48')]['id']){delete _0x311ab8[_0xb2bd('0x48')]['id'];}return db[_0xb2bd('0x2d')][_0xb2bd('0x46')]({'where':{'id':_0x311ab8[_0xb2bd('0x49')]['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x112f45,null))[_0xb2bd('0x26')](saveUpdates(_0x311ab8[_0xb2bd('0x48')],null))[_0xb2bd('0x26')](respondWithResult(_0x112f45,null))[_0xb2bd('0x45')](handleError(_0x112f45,null));};exports[_0xb2bd('0x27')]=function(_0x5037d4,_0x49ebd0){return db[_0xb2bd('0x2d')]['find']({'where':{'id':_0x5037d4[_0xb2bd('0x49')]['id']}})['then'](handleEntityNotFound(_0x49ebd0,null))[_0xb2bd('0x26')](removeEntity(_0x49ebd0,null))[_0xb2bd('0x45')](handleError(_0x49ebd0,null));};exports[_0xb2bd('0x4a')]=function(_0x4b65a9,_0x5f56eb,_0x35d378){var _0xf8189a={};var _0x3a86d5={};var _0x322863;var _0x338789;return db['SugarcrmAccount'][_0xb2bd('0x4b')]({'where':{'id':_0x4b65a9[_0xb2bd('0x49')]['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x5f56eb,null))[_0xb2bd('0x26')](function(_0x49c180){if(_0x49c180){_0x322863=_0x49c180;_0x3a86d5[_0xb2bd('0x30')]=_['keys'](db[_0xb2bd('0x4c')][_0xb2bd('0x2e')]);_0x3a86d5['query']=_[_0xb2bd('0x32')](_0x4b65a9[_0xb2bd('0x31')]);_0x3a86d5[_0xb2bd('0x33')]=_['intersection'](_0x3a86d5[_0xb2bd('0x30')],_0x3a86d5[_0xb2bd('0x31')]);_0xf8189a['attributes']=_[_0xb2bd('0x34')](_0x3a86d5[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0x4b65a9['query']['fields']));_0xf8189a[_0xb2bd('0x35')]=_0xf8189a[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0xf8189a[_0xb2bd('0x35')]:_0x3a86d5[_0xb2bd('0x30')];_0xf8189a[_0xb2bd('0x3a')]=qs[_0xb2bd('0x3b')](_0x4b65a9[_0xb2bd('0x31')]['sort']);_0xf8189a[_0xb2bd('0x3c')]=qs['filters'](_[_0xb2bd('0x3d')](_0x4b65a9[_0xb2bd('0x31')],_0x3a86d5['filters']));if(_0x4b65a9['query'][_0xb2bd('0x3e')]){_0xf8189a[_0xb2bd('0x3c')]=_['merge'](_0xf8189a['where'],{'$or':_[_0xb2bd('0x2c')](_0xf8189a['attributes'],function(_0x54d42a){var _0x481e2e={};_0x481e2e[_0x54d42a]={'$like':'%'+_0x4b65a9[_0xb2bd('0x31')]['filter']+'%'};return _0x481e2e;})});}_0xf8189a=_[_0xb2bd('0x3f')]({},_0xf8189a,_0x4b65a9['options']);return _0x322863[_0xb2bd('0x4a')](_0xf8189a);}})[_0xb2bd('0x26')](function(_0x2a7b50){if(_0x2a7b50){_0x338789=_0x2a7b50[_0xb2bd('0x37')];if(!_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x38')](_0xb2bd('0x39'))){_0xf8189a['limit']=qs[_0xb2bd('0x1f')](_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x1f')]);_0xf8189a[_0xb2bd('0x21')]=qs['offset'](_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x21')]);}return _0x322863[_0xb2bd('0x4a')](_0xf8189a);}})[_0xb2bd('0x26')](function(_0xb4b5c3){if(_0xb4b5c3){return _0xb4b5c3?{'count':_0x338789,'rows':_0xb4b5c3}:null;}})[_0xb2bd('0x26')](respondWithResult(_0x5f56eb,null))['catch'](handleError(_0x5f56eb,null));};exports[_0xb2bd('0x4d')]=function(_0xb164b5,_0x4c3120,_0x2971bc){if(_0xb164b5[_0xb2bd('0x48')]['id']){delete _0xb164b5[_0xb2bd('0x48')]['id'];}return db[_0xb2bd('0x2d')]['findOne']({'where':{'id':_0xb164b5['params']['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x4c3120,null))[_0xb2bd('0x26')](function(_0x54d736){if(_0x54d736){_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x4e')]=_0x54d736['id'];_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x4f')]=integrations[_0xb2bd('0x50')](_0xb164b5['body'][_0xb2bd('0x51')],_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x52')]);_0xb164b5['body'][_0xb2bd('0x53')]=integrations['getDescriptions'](_0xb164b5['body'][_0xb2bd('0x51')],_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x52')]);return db[_0xb2bd('0x4c')]['create'](_0xb164b5[_0xb2bd('0x48')],{'include':[{'model':db['SugarcrmField'],'as':_0xb2bd('0x4f')},{'model':db[_0xb2bd('0x54')],'as':'Descriptions'}]});}return null;})[_0xb2bd('0x26')](respondWithResult(_0x4c3120,null))[_0xb2bd('0x45')](handleError(_0x4c3120,null));};exports[_0xb2bd('0x55')]=function(_0x2cbac2,_0x1d62e4,_0x6cb1d9){var _0x5c01f3='';var _0x2165c3=['id',_0xb2bd('0x2a'),_0xb2bd('0x56'),_0xb2bd('0x57'),'description',_0xb2bd('0x58'),'duration_hours',_0xb2bd('0x59'),'parent_id',_0xb2bd('0x5a'),_0xb2bd('0x5b'),_0xb2bd('0x5c')];return db[_0xb2bd('0x2d')][_0xb2bd('0x4b')]({'where':{'id':_0x2cbac2['params']['id']},'attributes':['id',_0xb2bd('0x5d'),_0xb2bd('0x5e'),_0xb2bd('0x5f')]})[_0xb2bd('0x26')](handleEntityNotFound(_0x1d62e4,null))[_0xb2bd('0x26')](function(_0x5d5f5e){if(_0x5d5f5e){_0x5c01f3=_0x5d5f5e['remoteUri'];var _0x1dba45=_0x5c01f3[_0xb2bd('0x60')](-0x1);if(_0x1dba45==='/'){_0x5c01f3=_0x5c01f3[_0xb2bd('0x61')](0x0,_0x5c01f3['lastIndexOf'](_0x1dba45));}return rp({'method':_0xb2bd('0x62'),'uri':util[_0xb2bd('0x63')](_0xb2bd('0x64'),_0x5c01f3,_0xb2bd('0x65')),'json':!![],'form':{'method':_0xb2bd('0x66'),'input_type':'JSON','response_type':_0xb2bd('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5d5f5e['username'],'password':_0x5d5f5e[_0xb2bd('0x5e')],'encryption':'PLAIN'},'application':_0xb2bd('0x68')})}});}})[_0xb2bd('0x26')](function(_0x2d910d){if(_0x2d910d&&_0x2d910d['name']!==_0xb2bd('0x69')&&_0x2d910d[_0xb2bd('0x2a')]!==_0xb2bd('0x6a')){return rp({'method':_0xb2bd('0x62'),'uri':util[_0xb2bd('0x63')](_0xb2bd('0x64'),_0x5c01f3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xb2bd('0x67'),'response_type':'JSON','rest_data':JSON[_0xb2bd('0x6b')]({'session':_0x2d910d['id'],'module_name':_0xb2bd('0x6c')})}})['then'](function(_0x343a3f){if(_0x343a3f){var _0xe6f688=_[_0xb2bd('0x6d')](_0x343a3f[_0xb2bd('0x6e')]);_['remove'](_0xe6f688,function(_0x2be7a6){return _0x2165c3['includes'](_0x2be7a6[_0xb2bd('0x2a')]);});return{'count':_0xe6f688['length'],'rows':_[_0xb2bd('0x2c')](_0xe6f688,function(_0x4f997d){return{'id':_0x4f997d[_0xb2bd('0x2a')],'name':_0x4f997d[_0xb2bd('0x6f')],'custom':_[_0xb2bd('0x70')](_0x4f997d[_0xb2bd('0x2a')],'_c')?!![]:![],'options':_0x4f997d['options']?_[_0xb2bd('0x2c')](_[_0xb2bd('0x6d')](_0x4f997d[_0xb2bd('0x41')]),function(_0x1120ee){return{'name':_0x1120ee[_0xb2bd('0x71')],'value':_0x1120ee['name']};}):[]};})};}})[_0xb2bd('0x26')](respondWithResult(_0x1d62e4,null))[_0xb2bd('0x45')](function(_0x3bcd58){var _0x355094=_0x2cbac2['query'][_0xb2bd('0x72')]?0x1f4:_0x3bcd58[_0xb2bd('0x73')]||0x1f4;logger['error'](_0xb2bd('0x74'),_0xb2bd('0x55'),_0x355094,JSON[_0xb2bd('0x6b')](_0x3bcd58));delete _0x3bcd58['name'];if(_0x355094===0x191){_0x355094=0x190;}_0x1d62e4[_0xb2bd('0x1d')](_0x355094)[_0xb2bd('0x75')](_0x2cbac2[_0xb2bd('0x31')][_0xb2bd('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x3bcd58['statusCode']}:_0x3bcd58);});}else{var _0x1517e7=0x1f4;_0x1d62e4['status'](_0x1517e7)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x755e=['slice','substring','POST','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','stringify','Calls','module_fields','remove','includes','endsWith','values','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','destroy','then','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','update','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri'];(function(_0x14365d,_0x4b8508){var _0x570459=function(_0x44f868){while(--_0x44f868){_0x14365d['push'](_0x14365d['shift']());}};_0x570459(++_0x4b8508);}(_0x755e,0x179));var _0xe755=function(_0x178b23,_0x1ab486){_0x178b23=_0x178b23-0x0;var _0x199850=_0x755e[_0x178b23];return _0x199850;};'use strict';var emlformat=require(_0xe755('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe755('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe755('0x2'));var moment=require(_0xe755('0x3'));var BPromise=require(_0xe755('0x4'));var Mustache=require(_0xe755('0x5'));var util=require(_0xe755('0x6'));var path=require(_0xe755('0x7'));var sox=require(_0xe755('0x8'));var csv=require('to-csv');var ejs=require(_0xe755('0x9'));var fs=require('fs');var fs_extra=require(_0xe755('0xa'));var _=require(_0xe755('0xb'));var squel=require(_0xe755('0xc'));var crypto=require(_0xe755('0xd'));var jsforce=require(_0xe755('0xe'));var deskjs=require(_0xe755('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe755('0x10'));var Redis=require(_0xe755('0x11'));var authService=require(_0xe755('0x12'));var qs=require(_0xe755('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe755('0x14'));var utils=require('../../config/utils');var config=require(_0xe755('0x15'));var licenseUtil=require(_0xe755('0x16'));var db=require(_0xe755('0x17'))['db'];var integrations=require(_0xe755('0x18'));function respondWithStatusCode(_0x22fcc8,_0x3a3886){_0x3a3886=_0x3a3886||0xcc;return function(_0xd354d5){if(_0xd354d5){return _0x22fcc8[_0xe755('0x19')](_0x3a3886);}return _0x22fcc8[_0xe755('0x1a')](_0x3a3886)[_0xe755('0x1b')]();};}function respondWithResult(_0x4a7ee9,_0xc74093){_0xc74093=_0xc74093||0xc8;return function(_0x19892f){if(_0x19892f){return _0x4a7ee9[_0xe755('0x1a')](_0xc74093)[_0xe755('0x1c')](_0x19892f);}};}function respondWithFilteredResult(_0x5c33f6,_0x5592b0){return function(_0x1e0cd9){if(_0x1e0cd9){var _0x48936e=typeof _0x5592b0['offset']===_0xe755('0x1d')&&typeof _0x5592b0[_0xe755('0x1e')]===_0xe755('0x1d');var _0x3f564d=_0x1e0cd9[_0xe755('0x1f')];var _0x5ca45e=_0x48936e?0x0:_0x5592b0[_0xe755('0x20')];var _0x2008ac=_0x48936e?_0x1e0cd9[_0xe755('0x1f')]:_0x5592b0[_0xe755('0x20')]+_0x5592b0[_0xe755('0x1e')];var _0x415f00;if(_0x2008ac>=_0x3f564d){_0x2008ac=_0x3f564d;_0x415f00=0xc8;}else{_0x415f00=0xce;}_0x5c33f6['status'](_0x415f00);return _0x5c33f6['set']('Content-Range',_0x5ca45e+'-'+_0x2008ac+'/'+_0x3f564d)['json'](_0x1e0cd9);}return null;};}function patchUpdates(_0x333de7){return function(_0x2e1082){try{jsonpatch[_0xe755('0x21')](_0x2e1082,_0x333de7,!![]);}catch(_0x6565f9){return BPromise[_0xe755('0x22')](_0x6565f9);}return _0x2e1082[_0xe755('0x23')]();};}function saveUpdates(_0x49a722,_0x80055e){return function(_0x40cdbb){if(_0x40cdbb){return _0x40cdbb['update'](_0x49a722)['then'](function(_0xe765d8){return _0xe765d8;});}return null;};}function removeEntity(_0x18bdb8,_0x13961c){return function(_0x54c2d4){if(_0x54c2d4){return _0x54c2d4[_0xe755('0x24')]()[_0xe755('0x25')](function(){_0x18bdb8['status'](0xcc)[_0xe755('0x1b')]();});}};}function handleEntityNotFound(_0x5e9b47,_0x16394f){return function(_0x4b98d8){if(!_0x4b98d8){_0x5e9b47[_0xe755('0x19')](0x194);}return _0x4b98d8;};}function handleError(_0xe4a789,_0x14b62a){_0x14b62a=_0x14b62a||0x1f4;return function(_0x43b159){logger['error'](_0x43b159[_0xe755('0x26')]);if(_0x43b159[_0xe755('0x27')]){delete _0x43b159[_0xe755('0x27')];}_0xe4a789[_0xe755('0x1a')](_0x14b62a)[_0xe755('0x28')](_0x43b159);};}exports[_0xe755('0x29')]=function(_0x173f38,_0x33a0fa){var _0xf0360={},_0x1ccf34={},_0x1e8ba1={'count':0x0,'rows':[]};var _0x384cb1=_['map'](db[_0xe755('0x2a')][_0xe755('0x2b')],function(_0xfece35){return{'name':_0xfece35[_0xe755('0x2c')],'type':_0xfece35['type'][_0xe755('0x2d')]};});_0x1ccf34['model']=_['map'](_0x384cb1,'name');_0x1ccf34[_0xe755('0x2e')]=_['keys'](_0x173f38[_0xe755('0x2e')]);_0x1ccf34['filters']=_['intersection'](_0x1ccf34[_0xe755('0x2f')],_0x1ccf34[_0xe755('0x2e')]);_0xf0360[_0xe755('0x30')]=_[_0xe755('0x31')](_0x1ccf34['model'],qs[_0xe755('0x32')](_0x173f38[_0xe755('0x2e')]['fields']));_0xf0360[_0xe755('0x30')]=_0xf0360[_0xe755('0x30')][_0xe755('0x33')]?_0xf0360['attributes']:_0x1ccf34[_0xe755('0x2f')];if(!_0x173f38['query'][_0xe755('0x34')](_0xe755('0x35'))){_0xf0360[_0xe755('0x1e')]=qs[_0xe755('0x1e')](_0x173f38['query'][_0xe755('0x1e')]);_0xf0360['offset']=qs[_0xe755('0x20')](_0x173f38[_0xe755('0x2e')][_0xe755('0x20')]);}_0xf0360[_0xe755('0x36')]=qs[_0xe755('0x37')](_0x173f38[_0xe755('0x2e')][_0xe755('0x37')]);_0xf0360[_0xe755('0x38')]=qs['filters'](_['pick'](_0x173f38[_0xe755('0x2e')],_0x1ccf34[_0xe755('0x39')]),_0x384cb1);if(_0x173f38[_0xe755('0x2e')][_0xe755('0x3a')]){_0xf0360[_0xe755('0x38')]=_[_0xe755('0x3b')](_0xf0360[_0xe755('0x38')],{'$or':_[_0xe755('0x3c')](_0x384cb1,function(_0x3474dc){if(_0x3474dc['type']!=='VIRTUAL'){var _0x403045={};_0x403045[_0x3474dc[_0xe755('0x27')]]={'$like':'%'+_0x173f38[_0xe755('0x2e')][_0xe755('0x3a')]+'%'};return _0x403045;}})});}_0xf0360=_[_0xe755('0x3b')]({},_0xf0360,_0x173f38['options']);var _0xba4057={'where':_0xf0360[_0xe755('0x38')]};return db['SugarcrmAccount'][_0xe755('0x1f')](_0xba4057)[_0xe755('0x25')](function(_0x2d5b07){_0x1e8ba1[_0xe755('0x1f')]=_0x2d5b07;if(_0x173f38[_0xe755('0x2e')][_0xe755('0x3d')]){_0xf0360['include']=[{'all':!![]}];}return db[_0xe755('0x2a')][_0xe755('0x3e')](_0xf0360);})[_0xe755('0x25')](function(_0xb7a37f){_0x1e8ba1[_0xe755('0x3f')]=_0xb7a37f;return _0x1e8ba1;})[_0xe755('0x25')](respondWithFilteredResult(_0x33a0fa,_0xf0360))[_0xe755('0x40')](handleError(_0x33a0fa,null));};exports[_0xe755('0x41')]=function(_0x48465e,_0x3187b7){var _0x3ccc17={'raw':![],'where':{'id':_0x48465e[_0xe755('0x42')]['id']}},_0x3cf518={};_0x3cf518['model']=_[_0xe755('0x43')](db[_0xe755('0x2a')][_0xe755('0x2b')]);_0x3cf518[_0xe755('0x2e')]=_[_0xe755('0x43')](_0x48465e[_0xe755('0x2e')]);_0x3cf518[_0xe755('0x39')]=_[_0xe755('0x31')](_0x3cf518[_0xe755('0x2f')],_0x3cf518[_0xe755('0x2e')]);_0x3ccc17[_0xe755('0x30')]=_['intersection'](_0x3cf518[_0xe755('0x2f')],qs['fields'](_0x48465e['query'][_0xe755('0x32')]));_0x3ccc17[_0xe755('0x30')]=_0x3ccc17[_0xe755('0x30')][_0xe755('0x33')]?_0x3ccc17[_0xe755('0x30')]:_0x3cf518[_0xe755('0x2f')];if(_0x48465e[_0xe755('0x2e')][_0xe755('0x3d')]){_0x3ccc17[_0xe755('0x44')]=[{'all':!![]}];}_0x3ccc17=_[_0xe755('0x3b')]({},_0x3ccc17,_0x48465e[_0xe755('0x45')]);return db['SugarcrmAccount'][_0xe755('0x46')](_0x3ccc17)[_0xe755('0x25')](handleEntityNotFound(_0x3187b7,null))[_0xe755('0x25')](respondWithResult(_0x3187b7,null))['catch'](handleError(_0x3187b7,null));};exports[_0xe755('0x47')]=function(_0x2bb0f9,_0x47d14e){return db['SugarcrmAccount'][_0xe755('0x47')](_0x2bb0f9[_0xe755('0x48')],{})['then'](respondWithResult(_0x47d14e,0xc9))['catch'](handleError(_0x47d14e,null));};exports[_0xe755('0x49')]=function(_0x2decfc,_0x228fea){if(_0x2decfc['body']['id']){delete _0x2decfc[_0xe755('0x48')]['id'];}return db[_0xe755('0x2a')][_0xe755('0x46')]({'where':{'id':_0x2decfc[_0xe755('0x42')]['id']}})[_0xe755('0x25')](handleEntityNotFound(_0x228fea,null))[_0xe755('0x25')](saveUpdates(_0x2decfc[_0xe755('0x48')],null))[_0xe755('0x25')](respondWithResult(_0x228fea,null))[_0xe755('0x40')](handleError(_0x228fea,null));};exports[_0xe755('0x24')]=function(_0x98c680,_0x4814cb){return db['SugarcrmAccount'][_0xe755('0x46')]({'where':{'id':_0x98c680[_0xe755('0x42')]['id']}})[_0xe755('0x25')](handleEntityNotFound(_0x4814cb,null))[_0xe755('0x25')](removeEntity(_0x4814cb,null))[_0xe755('0x40')](handleError(_0x4814cb,null));};exports[_0xe755('0x4a')]=function(_0x35dd76,_0x5ceedd,_0x122d8b){var _0x525286={};var _0x4920e4={};var _0x52c128;var _0xe6df88;return db[_0xe755('0x2a')][_0xe755('0x4b')]({'where':{'id':_0x35dd76[_0xe755('0x42')]['id']}})['then'](handleEntityNotFound(_0x5ceedd,null))[_0xe755('0x25')](function(_0x54eef0){if(_0x54eef0){_0x52c128=_0x54eef0;_0x4920e4[_0xe755('0x2f')]=_[_0xe755('0x43')](db['SugarcrmConfiguration'][_0xe755('0x2b')]);_0x4920e4[_0xe755('0x2e')]=_['keys'](_0x35dd76['query']);_0x4920e4[_0xe755('0x39')]=_[_0xe755('0x31')](_0x4920e4['model'],_0x4920e4[_0xe755('0x2e')]);_0x525286['attributes']=_[_0xe755('0x31')](_0x4920e4[_0xe755('0x2f')],qs[_0xe755('0x32')](_0x35dd76[_0xe755('0x2e')][_0xe755('0x32')]));_0x525286[_0xe755('0x30')]=_0x525286[_0xe755('0x30')][_0xe755('0x33')]?_0x525286[_0xe755('0x30')]:_0x4920e4[_0xe755('0x2f')];_0x525286[_0xe755('0x36')]=qs[_0xe755('0x37')](_0x35dd76['query'][_0xe755('0x37')]);_0x525286[_0xe755('0x38')]=qs[_0xe755('0x39')](_['pick'](_0x35dd76['query'],_0x4920e4[_0xe755('0x39')]));if(_0x35dd76[_0xe755('0x2e')][_0xe755('0x3a')]){_0x525286[_0xe755('0x38')]=_[_0xe755('0x3b')](_0x525286[_0xe755('0x38')],{'$or':_[_0xe755('0x3c')](_0x525286[_0xe755('0x30')],function(_0x1e01ff){var _0xf5f174={};_0xf5f174[_0x1e01ff]={'$like':'%'+_0x35dd76[_0xe755('0x2e')][_0xe755('0x3a')]+'%'};return _0xf5f174;})});}_0x525286=_[_0xe755('0x3b')]({},_0x525286,_0x35dd76[_0xe755('0x45')]);return _0x52c128[_0xe755('0x4a')](_0x525286);}})[_0xe755('0x25')](function(_0x4897b7){if(_0x4897b7){_0xe6df88=_0x4897b7[_0xe755('0x33')];if(!_0x35dd76[_0xe755('0x2e')][_0xe755('0x34')](_0xe755('0x35'))){_0x525286[_0xe755('0x1e')]=qs[_0xe755('0x1e')](_0x35dd76[_0xe755('0x2e')][_0xe755('0x1e')]);_0x525286['offset']=qs[_0xe755('0x20')](_0x35dd76[_0xe755('0x2e')][_0xe755('0x20')]);}return _0x52c128[_0xe755('0x4a')](_0x525286);}})[_0xe755('0x25')](function(_0x471ef5){if(_0x471ef5){return _0x471ef5?{'count':_0xe6df88,'rows':_0x471ef5}:null;}})['then'](respondWithResult(_0x5ceedd,null))[_0xe755('0x40')](handleError(_0x5ceedd,null));};exports['addConfiguration']=function(_0x689740,_0x55e580,_0x1b7b12){if(_0x689740[_0xe755('0x48')]['id']){delete _0x689740[_0xe755('0x48')]['id'];}return db['SugarcrmAccount'][_0xe755('0x4b')]({'where':{'id':_0x689740[_0xe755('0x42')]['id']}})['then'](handleEntityNotFound(_0x55e580,null))[_0xe755('0x25')](function(_0x2cc887){if(_0x2cc887){_0x689740[_0xe755('0x48')][_0xe755('0x4c')]=_0x2cc887['id'];_0x689740[_0xe755('0x48')][_0xe755('0x4d')]=integrations[_0xe755('0x4e')](_0x689740[_0xe755('0x48')][_0xe755('0x4f')],_0x689740[_0xe755('0x48')][_0xe755('0x50')]);_0x689740[_0xe755('0x48')][_0xe755('0x51')]=integrations[_0xe755('0x52')](_0x689740['body']['channel'],_0x689740[_0xe755('0x48')]['type']);return db[_0xe755('0x53')][_0xe755('0x47')](_0x689740[_0xe755('0x48')],{'include':[{'model':db[_0xe755('0x54')],'as':_0xe755('0x4d')},{'model':db[_0xe755('0x54')],'as':_0xe755('0x51')}]});}return null;})[_0xe755('0x25')](respondWithResult(_0x55e580,null))[_0xe755('0x40')](handleError(_0x55e580,null));};exports[_0xe755('0x55')]=function(_0x10dcf2,_0x4caf46,_0xfd3c02){var _0x4b75f3='';var _0x127fe7=['id',_0xe755('0x27'),_0xe755('0x56'),'created_by','description','date_start',_0xe755('0x57'),'duration_minutes',_0xe755('0x58'),_0xe755('0x59'),_0xe755('0x5a'),_0xe755('0x5b')];return db['SugarcrmAccount'][_0xe755('0x4b')]({'where':{'id':_0x10dcf2[_0xe755('0x42')]['id']},'attributes':['id',_0xe755('0x5c'),_0xe755('0x5d'),_0xe755('0x5e')]})['then'](handleEntityNotFound(_0x4caf46,null))[_0xe755('0x25')](function(_0x5ae484){if(_0x5ae484){_0x4b75f3=_0x5ae484[_0xe755('0x5e')];var _0x175418=_0x4b75f3[_0xe755('0x5f')](-0x1);if(_0x175418==='/'){_0x4b75f3=_0x4b75f3[_0xe755('0x60')](0x0,_0x4b75f3['lastIndexOf'](_0x175418));}return rp({'method':_0xe755('0x61'),'uri':util['format'](_0xe755('0x62'),_0x4b75f3,_0xe755('0x63')),'json':!![],'form':{'method':_0xe755('0x64'),'input_type':_0xe755('0x65'),'response_type':_0xe755('0x65'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5ae484['username'],'password':_0x5ae484['password'],'encryption':'PLAIN'},'application':_0xe755('0x66')})}});}})[_0xe755('0x25')](function(_0x227945){if(_0x227945&&_0x227945[_0xe755('0x27')]!==_0xe755('0x67')&&_0x227945[_0xe755('0x27')]!=='Password\x20Expired'){return rp({'method':_0xe755('0x61'),'uri':util[_0xe755('0x68')](_0xe755('0x62'),_0x4b75f3,_0xe755('0x63')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe755('0x69')]({'session':_0x227945['id'],'module_name':_0xe755('0x6a')})}})['then'](function(_0xf80bc4){if(_0xf80bc4){var _0x420807=_['values'](_0xf80bc4[_0xe755('0x6b')]);_[_0xe755('0x6c')](_0x420807,function(_0x4cee46){return _0x127fe7[_0xe755('0x6d')](_0x4cee46[_0xe755('0x27')]);});return{'count':_0x420807[_0xe755('0x33')],'rows':_['map'](_0x420807,function(_0x462aff){return{'id':_0x462aff['name'],'name':_0x462aff['label'],'custom':_[_0xe755('0x6e')](_0x462aff[_0xe755('0x27')],'_c')?!![]:![],'options':_0x462aff['options']?_[_0xe755('0x3c')](_[_0xe755('0x6f')](_0x462aff[_0xe755('0x45')]),function(_0x2033f2){return{'name':_0x2033f2[_0xe755('0x70')],'value':_0x2033f2[_0xe755('0x27')]};}):[]};})};}})[_0xe755('0x25')](respondWithResult(_0x4caf46,null))['catch'](function(_0x96b4a){var _0x2fe8d3=_0x10dcf2[_0xe755('0x2e')][_0xe755('0x71')]?0x1f4:_0x96b4a[_0xe755('0x72')]||0x1f4;logger[_0xe755('0x73')](_0xe755('0x74'),_0xe755('0x55'),_0x2fe8d3,JSON[_0xe755('0x69')](_0x96b4a));delete _0x96b4a[_0xe755('0x27')];if(_0x2fe8d3===0x191){_0x2fe8d3=0x190;}_0x4caf46[_0xe755('0x1a')](_0x2fe8d3)[_0xe755('0x28')](_0x10dcf2[_0xe755('0x2e')]['test']?{'message':_0xe755('0x75'),'statusCode':_0x96b4a[_0xe755('0x72')]}:_0x96b4a);});}else{var _0x1efe09=0x1f4;_0x4caf46['status'](_0x1efe09)[_0xe755('0x28')]({'message':_0xe755('0x75'),'statusCode':0x190});}});};
\ No newline at end of file
index 9548ab9..5b2b28a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d78=['define','SugarcrmAccount','api','bluebird','request-promise','path','rimraf','./intSugarcrmAccount.attributes','exports'];(function(_0x340977,_0x14bcaa){var _0x108ae4=function(_0x47006b){while(--_0x47006b){_0x340977['push'](_0x340977['shift']());}};_0x108ae4(++_0x14bcaa);}(_0x0d78,0x134));var _0x80d7=function(_0x5b9f44,_0x4f041e){_0x5b9f44=_0x5b9f44-0x0;var _0x3a5fee=_0x0d78[_0x5b9f44];return _0x3a5fee;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x80d7('0x0'));var moment=require('moment');var BPromise=require(_0x80d7('0x1'));var rp=require(_0x80d7('0x2'));var fs=require('fs');var path=require(_0x80d7('0x3'));var rimraf=require(_0x80d7('0x4'));var config=require('../../config/environment');var attributes=require(_0x80d7('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x80d7('0x6')]=function(_0xfcc3ba,_0x16768c){return _0xfcc3ba[_0x80d7('0x7')](_0x80d7('0x8'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0805=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','define'];(function(_0x377592,_0x2492c0){var _0x26df1c=function(_0x52e68e){while(--_0x52e68e){_0x377592['push'](_0x377592['shift']());}};_0x26df1c(++_0x2492c0);}(_0x0805,0x1c9));var _0x5080=function(_0x5a85d7,_0x531506){_0x5a85d7=_0x5a85d7-0x0;var _0x5a8204=_0x0805[_0x5a85d7];return _0x5a8204;};'use strict';var _=require(_0x5080('0x0'));var util=require(_0x5080('0x1'));var logger=require(_0x5080('0x2'))(_0x5080('0x3'));var moment=require(_0x5080('0x4'));var BPromise=require(_0x5080('0x5'));var rp=require(_0x5080('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5080('0x7'));var config=require(_0x5080('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x5080('0x9'));module['exports']=function(_0x1aaff8,_0x51526e){return _0x1aaff8[_0x5080('0xa')](_0x5080('0xb'),attributes,{'tableName':_0x5080('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6d17ab9..9312d48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3383=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','GetSugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowSugarcrmAccount','find','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0x3383,0x97));var _0x3338=function(_0xa4a892,_0x460580){_0xa4a892=_0xa4a892-0x0;var _0x591967=_0x3383[_0xa4a892];return _0x591967;};'use strict';var _=require(_0x3338('0x0'));var util=require(_0x3338('0x1'));var moment=require(_0x3338('0x2'));var BPromise=require('bluebird');var rs=require(_0x3338('0x3'));var fs=require('fs');var Redis=require(_0x3338('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3338('0x5'))(_0x3338('0x6'));var config=require(_0x3338('0x7'));var jayson=require(_0x3338('0x8'));var client=jayson[_0x3338('0x9')][_0x3338('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x370353,_0x9c16d6,_0x562bd8){return new BPromise(function(_0x1434e4,_0x9c10dd){return client[_0x3338('0xb')](_0x370353,_0x562bd8)[_0x3338('0xc')](function(_0x56ca99){logger[_0x3338('0xd')](_0x3338('0xe'),_0x9c16d6,_0x3338('0xf'));logger['debug'](_0x3338('0x10'),_0x9c16d6,_0x3338('0xf'),JSON[_0x3338('0x11')](_0x56ca99));if(_0x56ca99[_0x3338('0x12')]){if(_0x56ca99[_0x3338('0x12')]['code']===0x1f4){logger[_0x3338('0x12')](_0x3338('0xe'),_0x9c16d6,_0x56ca99[_0x3338('0x12')]['message']);return _0x9c10dd(_0x56ca99[_0x3338('0x12')]['message']);}logger[_0x3338('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x9c16d6,_0x56ca99[_0x3338('0x12')][_0x3338('0x13')]);return _0x1434e4(_0x56ca99[_0x3338('0x12')][_0x3338('0x13')]);}else{logger['info'](_0x3338('0xe'),_0x9c16d6,_0x3338('0xf'));_0x1434e4(_0x56ca99['result'][_0x3338('0x13')]);}})['catch'](function(_0x5d1dea){logger['error'](_0x3338('0xe'),_0x9c16d6,_0x5d1dea);_0x9c10dd(_0x5d1dea);});});}exports[_0x3338('0x14')]=function(_0x4b9336){var _0x2d0b78=this;return new Promise(function(_0x27f783,_0xec42ff){return db['SugarcrmAccount'][_0x3338('0x15')]({'raw':_0x4b9336['options']?_0x4b9336[_0x3338('0x16')][_0x3338('0x17')]===undefined?!![]:![]:!![],'where':_0x4b9336[_0x3338('0x16')]?_0x4b9336[_0x3338('0x16')]['where']||null:null,'attributes':_0x4b9336[_0x3338('0x16')]?_0x4b9336[_0x3338('0x16')][_0x3338('0x18')]||null:null,'limit':_0x4b9336['options']?_0x4b9336[_0x3338('0x16')][_0x3338('0x19')]||null:null,'include':_0x4b9336['options']?_0x4b9336[_0x3338('0x16')][_0x3338('0x1a')]?_[_0x3338('0x1b')](_0x4b9336['options'][_0x3338('0x1a')],function(_0x18f6dc){return{'model':db[_0x18f6dc['model']],'as':_0x18f6dc['as'],'attributes':_0x18f6dc[_0x3338('0x18')],'include':_0x18f6dc[_0x3338('0x1a')]?_[_0x3338('0x1b')](_0x18f6dc[_0x3338('0x1a')],function(_0x54e460){return{'model':db[_0x54e460[_0x3338('0x1c')]],'as':_0x54e460['as'],'attributes':_0x54e460[_0x3338('0x18')],'include':_0x54e460[_0x3338('0x1a')]?_[_0x3338('0x1b')](_0x54e460['include'],function(_0x18f4fc){return{'model':db[_0x18f4fc[_0x3338('0x1c')]],'as':_0x18f4fc['as'],'attributes':_0x18f4fc[_0x3338('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3338('0xc')](function(_0x4444ee){logger[_0x3338('0xd')](_0x3338('0x14'),_0x4b9336);logger[_0x3338('0x1d')](_0x3338('0x14'),_0x4b9336,JSON['stringify'](_0x4444ee));_0x27f783(_0x4444ee);})['catch'](function(_0x2e18dd){logger['error'](_0x3338('0x14'),_0x2e18dd[_0x3338('0x13')],_0x4b9336);_0xec42ff(_0x2d0b78[_0x3338('0x12')](0x1f4,_0x2e18dd['message']));});});};exports[_0x3338('0x1e')]=function(_0x13b69b){var _0x5174de=this;return new Promise(function(_0x150b4f,_0x28e393){return db['SugarcrmAccount'][_0x3338('0x1f')]({'raw':_0x13b69b[_0x3338('0x16')]?_0x13b69b[_0x3338('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x13b69b['options']?_0x13b69b['options']['where']||null:null,'attributes':_0x13b69b[_0x3338('0x16')]?_0x13b69b['options'][_0x3338('0x18')]||null:null,'include':_0x13b69b[_0x3338('0x16')]?_0x13b69b[_0x3338('0x16')][_0x3338('0x1a')]?_['map'](_0x13b69b[_0x3338('0x16')]['include'],function(_0x3da688){return{'model':db[_0x3da688['model']],'as':_0x3da688['as'],'attributes':_0x3da688[_0x3338('0x18')],'include':_0x3da688[_0x3338('0x1a')]?_[_0x3338('0x1b')](_0x3da688[_0x3338('0x1a')],function(_0x1de40e){return{'model':db[_0x1de40e[_0x3338('0x1c')]],'as':_0x1de40e['as'],'attributes':_0x1de40e[_0x3338('0x18')],'include':_0x1de40e[_0x3338('0x1a')]?_[_0x3338('0x1b')](_0x1de40e['include'],function(_0x430fc2){return{'model':db[_0x430fc2['model']],'as':_0x430fc2['as'],'attributes':_0x430fc2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f4447){logger[_0x3338('0xd')](_0x3338('0x1e'),_0x13b69b);logger[_0x3338('0x1d')](_0x3338('0x1e'),_0x13b69b,JSON[_0x3338('0x11')](_0x3f4447));_0x150b4f(_0x3f4447);})[_0x3338('0x20')](function(_0x4293c0){logger[_0x3338('0x12')](_0x3338('0x1e'),_0x4293c0[_0x3338('0x13')],_0x13b69b);_0x28e393(_0x5174de[_0x3338('0x12')](0x1f4,_0x4293c0[_0x3338('0x13')]));});});};
\ No newline at end of file
+var _0xa34f=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','attributes','limit','include','map','model','stringify','find','where','ShowSugarcrmAccount','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0xae3d86,_0x338849){var _0x38f5d8=function(_0x590121){while(--_0x590121){_0xae3d86['push'](_0xae3d86['shift']());}};_0x38f5d8(++_0x338849);}(_0xa34f,0x182));var _0xfa34=function(_0x392e8d,_0x3d05ca){_0x392e8d=_0x392e8d-0x0;var _0x40c881=_0xa34f[_0x392e8d];return _0x40c881;};'use strict';var _=require(_0xfa34('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa34('0x1'));var rs=require(_0xfa34('0x2'));var fs=require('fs');var Redis=require(_0xfa34('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa34('0x4'));var logger=require(_0xfa34('0x5'))('rpc');var config=require(_0xfa34('0x6'));var jayson=require(_0xfa34('0x7'));var client=jayson[_0xfa34('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa78f3,_0x2173b6,_0x388a4f){return new BPromise(function(_0x140b46,_0x5ab5fa){return client['request'](_0xa78f3,_0x388a4f)[_0xfa34('0x9')](function(_0x2117e8){logger[_0xfa34('0xa')](_0xfa34('0xb'),_0x2173b6,_0xfa34('0xc'));logger[_0xfa34('0xd')](_0xfa34('0xe'),_0x2173b6,_0xfa34('0xc'),JSON['stringify'](_0x2117e8));if(_0x2117e8[_0xfa34('0xf')]){if(_0x2117e8[_0xfa34('0xf')][_0xfa34('0x10')]===0x1f4){logger['error'](_0xfa34('0xb'),_0x2173b6,_0x2117e8[_0xfa34('0xf')]['message']);return _0x5ab5fa(_0x2117e8[_0xfa34('0xf')][_0xfa34('0x11')]);}logger[_0xfa34('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x2173b6,_0x2117e8['error'][_0xfa34('0x11')]);return _0x140b46(_0x2117e8[_0xfa34('0xf')]['message']);}else{logger[_0xfa34('0xa')](_0xfa34('0xb'),_0x2173b6,_0xfa34('0xc'));_0x140b46(_0x2117e8[_0xfa34('0x12')][_0xfa34('0x11')]);}})[_0xfa34('0x13')](function(_0x5f44dc){logger[_0xfa34('0xf')](_0xfa34('0xb'),_0x2173b6,_0x5f44dc);_0x5ab5fa(_0x5f44dc);});});}exports[_0xfa34('0x14')]=function(_0x1a85ac){var _0x403059=this;return new Promise(function(_0x68ad64,_0x4f4611){return db[_0xfa34('0x15')]['findAll']({'raw':_0x1a85ac[_0xfa34('0x16')]?_0x1a85ac[_0xfa34('0x16')][_0xfa34('0x17')]===undefined?!![]:![]:!![],'where':_0x1a85ac['options']?_0x1a85ac[_0xfa34('0x16')]['where']||null:null,'attributes':_0x1a85ac['options']?_0x1a85ac[_0xfa34('0x16')][_0xfa34('0x18')]||null:null,'limit':_0x1a85ac[_0xfa34('0x16')]?_0x1a85ac[_0xfa34('0x16')][_0xfa34('0x19')]||null:null,'include':_0x1a85ac[_0xfa34('0x16')]?_0x1a85ac['options'][_0xfa34('0x1a')]?_[_0xfa34('0x1b')](_0x1a85ac[_0xfa34('0x16')][_0xfa34('0x1a')],function(_0x52a495){return{'model':db[_0x52a495['model']],'as':_0x52a495['as'],'attributes':_0x52a495[_0xfa34('0x18')],'include':_0x52a495[_0xfa34('0x1a')]?_[_0xfa34('0x1b')](_0x52a495[_0xfa34('0x1a')],function(_0x1fe0eb){return{'model':db[_0x1fe0eb['model']],'as':_0x1fe0eb['as'],'attributes':_0x1fe0eb[_0xfa34('0x18')],'include':_0x1fe0eb[_0xfa34('0x1a')]?_[_0xfa34('0x1b')](_0x1fe0eb[_0xfa34('0x1a')],function(_0x193bfa){return{'model':db[_0x193bfa[_0xfa34('0x1c')]],'as':_0x193bfa['as'],'attributes':_0x193bfa[_0xfa34('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dfd2b){logger[_0xfa34('0xa')](_0xfa34('0x14'),_0x1a85ac);logger[_0xfa34('0xd')](_0xfa34('0x14'),_0x1a85ac,JSON[_0xfa34('0x1d')](_0x2dfd2b));_0x68ad64(_0x2dfd2b);})['catch'](function(_0x56b0ef){logger[_0xfa34('0xf')](_0xfa34('0x14'),_0x56b0ef[_0xfa34('0x11')],_0x1a85ac);_0x4f4611(_0x403059['error'](0x1f4,_0x56b0ef[_0xfa34('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x400a6d){var _0x260690=this;return new Promise(function(_0x4c2438,_0x4797e9){return db[_0xfa34('0x15')][_0xfa34('0x1e')]({'raw':_0x400a6d[_0xfa34('0x16')]?_0x400a6d[_0xfa34('0x16')][_0xfa34('0x17')]===undefined?!![]:![]:!![],'where':_0x400a6d[_0xfa34('0x16')]?_0x400a6d[_0xfa34('0x16')][_0xfa34('0x1f')]||null:null,'attributes':_0x400a6d['options']?_0x400a6d['options']['attributes']||null:null,'include':_0x400a6d[_0xfa34('0x16')]?_0x400a6d['options']['include']?_[_0xfa34('0x1b')](_0x400a6d['options'][_0xfa34('0x1a')],function(_0x41bb3b){return{'model':db[_0x41bb3b[_0xfa34('0x1c')]],'as':_0x41bb3b['as'],'attributes':_0x41bb3b[_0xfa34('0x18')],'include':_0x41bb3b['include']?_['map'](_0x41bb3b[_0xfa34('0x1a')],function(_0xb6f3a4){return{'model':db[_0xb6f3a4[_0xfa34('0x1c')]],'as':_0xb6f3a4['as'],'attributes':_0xb6f3a4[_0xfa34('0x18')],'include':_0xb6f3a4[_0xfa34('0x1a')]?_[_0xfa34('0x1b')](_0xb6f3a4[_0xfa34('0x1a')],function(_0x3a6a87){return{'model':db[_0x3a6a87[_0xfa34('0x1c')]],'as':_0x3a6a87['as'],'attributes':_0x3a6a87[_0xfa34('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfa34('0x9')](function(_0x2d066a){logger['info'](_0xfa34('0x20'),_0x400a6d);logger[_0xfa34('0xd')](_0xfa34('0x20'),_0x400a6d,JSON[_0xfa34('0x1d')](_0x2d066a));_0x4c2438(_0x2d066a);})[_0xfa34('0x13')](function(_0x3dbffb){logger[_0xfa34('0xf')]('ShowSugarcrmAccount',_0x3dbffb[_0xfa34('0x11')],_0x400a6d);_0x4797e9(_0x260690[_0xfa34('0xf')](0x1f4,_0x3dbffb[_0xfa34('0x11')]));});});};
\ No newline at end of file
index 254b1f8..ed9ed14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee08=['index','/:id','show','getSubjects','getDescriptions','post','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated'];(function(_0x31c213,_0x4fe647){var _0x5b83ba=function(_0x585f51){while(--_0x585f51){_0x31c213['push'](_0x31c213['shift']());}};_0x5b83ba(++_0x4fe647);}(_0xee08,0xb1));var _0x8ee0=function(_0x182d52,_0x5c4bc9){_0x182d52=_0x182d52-0x0;var _0x178a6f=_0xee08[_0x182d52];return _0x178a6f;};'use strict';var multer=require(_0x8ee0('0x0'));var util=require('util');var path=require(_0x8ee0('0x1'));var timeout=require(_0x8ee0('0x2'));var express=require(_0x8ee0('0x3'));var router=express[_0x8ee0('0x4')]();var fs_extra=require(_0x8ee0('0x5'));var auth=require(_0x8ee0('0x6'));var interaction=require(_0x8ee0('0x7'));var config=require(_0x8ee0('0x8'));var controller=require(_0x8ee0('0x9'));router[_0x8ee0('0xa')]('/',auth[_0x8ee0('0xb')](),controller[_0x8ee0('0xc')]);router[_0x8ee0('0xa')](_0x8ee0('0xd'),auth[_0x8ee0('0xb')](),controller[_0x8ee0('0xe')]);router[_0x8ee0('0xa')]('/:id/fields',auth[_0x8ee0('0xb')](),controller['getFields']);router[_0x8ee0('0xa')]('/:id/subjects',auth[_0x8ee0('0xb')](),controller[_0x8ee0('0xf')]);router[_0x8ee0('0xa')]('/:id/descriptions',auth[_0x8ee0('0xb')](),controller[_0x8ee0('0x10')]);router[_0x8ee0('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8ee0('0x12')](_0x8ee0('0xd'),auth[_0x8ee0('0xb')](),controller[_0x8ee0('0x13')]);router['delete'](_0x8ee0('0xd'),auth[_0x8ee0('0xb')](),controller[_0x8ee0('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x7ea6=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer'];(function(_0x1a7cab,_0x261e6a){var _0x12d0cf=function(_0xef75d){while(--_0xef75d){_0x1a7cab['push'](_0x1a7cab['shift']());}};_0x12d0cf(++_0x261e6a);}(_0x7ea6,0x72));var _0x67ea=function(_0x514725,_0x51abfb){_0x514725=_0x514725-0x0;var _0x26875a=_0x7ea6[_0x514725];return _0x26875a;};'use strict';var multer=require(_0x67ea('0x0'));var util=require(_0x67ea('0x1'));var path=require(_0x67ea('0x2'));var timeout=require(_0x67ea('0x3'));var express=require(_0x67ea('0x4'));var router=express[_0x67ea('0x5')]();var fs_extra=require(_0x67ea('0x6'));var auth=require(_0x67ea('0x7'));var interaction=require(_0x67ea('0x8'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x67ea('0x9')]);router[_0x67ea('0xa')](_0x67ea('0xb'),auth[_0x67ea('0xc')](),controller['show']);router['get'](_0x67ea('0xd'),auth['isAuthenticated'](),controller[_0x67ea('0xe')]);router[_0x67ea('0xa')](_0x67ea('0xf'),auth[_0x67ea('0xc')](),controller['getSubjects']);router[_0x67ea('0xa')](_0x67ea('0x10'),auth[_0x67ea('0xc')](),controller['getDescriptions']);router[_0x67ea('0x11')]('/',auth[_0x67ea('0xc')](),controller[_0x67ea('0x12')]);router[_0x67ea('0x13')](_0x67ea('0xb'),auth[_0x67ea('0xc')](),controller['update']);router[_0x67ea('0x14')](_0x67ea('0xb'),auth[_0x67ea('0xc')](),controller[_0x67ea('0x15')]);module[_0x67ea('0x16')]=router;
\ No newline at end of file
index f4a8375..5936643 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e21=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e21,0xbf));var _0x12e2=function(_0x34f7fa,_0x443e49){_0x34f7fa=_0x34f7fa-0x0;var _0x51ee53=_0x2e21[_0x34f7fa];return _0x51ee53;};'use strict';var Sequelize=require(_0x12e2('0x0'));module[_0x12e2('0x1')]={'name':{'type':Sequelize[_0x12e2('0x2')]},'description':{'type':Sequelize[_0x12e2('0x2')]}};
\ No newline at end of file
+var _0xa63f=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa63f,0x8d));var _0xfa63=function(_0x3f25db,_0x1d3686){_0x3f25db=_0x3f25db-0x0;var _0x54f29d=_0xa63f[_0x3f25db];return _0x54f29d;};'use strict';var Sequelize=require('sequelize');module[_0xfa63('0x0')]={'name':{'type':Sequelize[_0xfa63('0x1')]},'description':{'type':Sequelize[_0xfa63('0x1')]}};
\ No newline at end of file
index 9ff0668..48d504e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cdd=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','update','then','end','error','stack','name','index','SugarcrmConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','destroy','find','getFields','findOne','length','getSubjects','SugarcrmField','hasOwnProperty','nolimit','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x8cdd,0xe6));var _0xd8cd=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x8cdd[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0xd8cd('0x0'));var rimraf=require(_0xd8cd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8cd('0x2'));var rp=require(_0xd8cd('0x3'));var moment=require(_0xd8cd('0x4'));var BPromise=require(_0xd8cd('0x5'));var Mustache=require('mustache');var util=require(_0xd8cd('0x6'));var path=require(_0xd8cd('0x7'));var sox=require(_0xd8cd('0x8'));var csv=require(_0xd8cd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8cd('0xa'));var _=require(_0xd8cd('0xb'));var squel=require(_0xd8cd('0xc'));var crypto=require(_0xd8cd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd8cd('0xe'));var toCsv=require(_0xd8cd('0x9'));var querystring=require('querystring');var Papa=require(_0xd8cd('0xf'));var Redis=require(_0xd8cd('0x10'));var authService=require(_0xd8cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd8cd('0x12'));var hardwareService=require(_0xd8cd('0x13'));var logger=require(_0xd8cd('0x14'))(_0xd8cd('0x15'));var utils=require(_0xd8cd('0x16'));var config=require(_0xd8cd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd8cd('0x18'))['db'];function respondWithStatusCode(_0x1ebca8,_0x15760e){_0x15760e=_0x15760e||0xcc;return function(_0x25e495){if(_0x25e495){return _0x1ebca8[_0xd8cd('0x19')](_0x15760e);}return _0x1ebca8['status'](_0x15760e)['end']();};}function respondWithResult(_0x844780,_0x5742f1){_0x5742f1=_0x5742f1||0xc8;return function(_0x4119cb){if(_0x4119cb){return _0x844780[_0xd8cd('0x1a')](_0x5742f1)['json'](_0x4119cb);}};}function respondWithFilteredResult(_0x3e6087,_0x5c9e23){return function(_0x2c132d){if(_0x2c132d){var _0xa67e90=typeof _0x5c9e23[_0xd8cd('0x1b')]===_0xd8cd('0x1c')&&typeof _0x5c9e23['limit']==='undefined';var _0x18a9ea=_0x2c132d[_0xd8cd('0x1d')];var _0x9e0dda=_0xa67e90?0x0:_0x5c9e23[_0xd8cd('0x1b')];var _0x21e6b5=_0xa67e90?_0x2c132d[_0xd8cd('0x1d')]:_0x5c9e23[_0xd8cd('0x1b')]+_0x5c9e23['limit'];var _0x264e8b;if(_0x21e6b5>=_0x18a9ea){_0x21e6b5=_0x18a9ea;_0x264e8b=0xc8;}else{_0x264e8b=0xce;}_0x3e6087['status'](_0x264e8b);return _0x3e6087['set'](_0xd8cd('0x1e'),_0x9e0dda+'-'+_0x21e6b5+'/'+_0x18a9ea)[_0xd8cd('0x1f')](_0x2c132d);}return null;};}function patchUpdates(_0x34f71c){return function(_0x50fc46){try{jsonpatch[_0xd8cd('0x20')](_0x50fc46,_0x34f71c,!![]);}catch(_0x3aefa3){return BPromise[_0xd8cd('0x21')](_0x3aefa3);}return _0x50fc46['save']();};}function saveUpdates(_0x40b0f9,_0x16eedb){return function(_0x2f0960){if(_0x2f0960){return _0x2f0960[_0xd8cd('0x22')](_0x40b0f9)['then'](function(_0x1681c9){return _0x1681c9;});}return null;};}function removeEntity(_0x1bde7c,_0xee9e14){return function(_0x581873){if(_0x581873){return _0x581873['destroy']()[_0xd8cd('0x23')](function(){_0x1bde7c[_0xd8cd('0x1a')](0xcc)[_0xd8cd('0x24')]();});}};}function handleEntityNotFound(_0x274681,_0xec7b60){return function(_0x45417b){if(!_0x45417b){_0x274681[_0xd8cd('0x19')](0x194);}return _0x45417b;};}function handleError(_0x3ca629,_0x383dd4){_0x383dd4=_0x383dd4||0x1f4;return function(_0xf58cbe){logger[_0xd8cd('0x25')](_0xf58cbe[_0xd8cd('0x26')]);if(_0xf58cbe[_0xd8cd('0x27')]){delete _0xf58cbe[_0xd8cd('0x27')];}_0x3ca629[_0xd8cd('0x1a')](_0x383dd4)['send'](_0xf58cbe);};}exports[_0xd8cd('0x28')]=function(_0x2cfc64,_0x3a8569){var _0x13ec0b={},_0x19e70e={},_0x4334df={'count':0x0,'rows':[]};var _0x48965b=_['map'](db[_0xd8cd('0x29')][_0xd8cd('0x2a')],function(_0x11b63a){return{'name':_0x11b63a[_0xd8cd('0x2b')],'type':_0x11b63a[_0xd8cd('0x2c')]['key']};});_0x19e70e[_0xd8cd('0x2d')]=_[_0xd8cd('0x2e')](_0x48965b,'name');_0x19e70e[_0xd8cd('0x2f')]=_[_0xd8cd('0x30')](_0x2cfc64[_0xd8cd('0x2f')]);_0x19e70e[_0xd8cd('0x31')]=_['intersection'](_0x19e70e['model'],_0x19e70e[_0xd8cd('0x2f')]);_0x13ec0b[_0xd8cd('0x32')]=_[_0xd8cd('0x33')](_0x19e70e[_0xd8cd('0x2d')],qs[_0xd8cd('0x34')](_0x2cfc64[_0xd8cd('0x2f')][_0xd8cd('0x34')]));_0x13ec0b[_0xd8cd('0x32')]=_0x13ec0b[_0xd8cd('0x32')]['length']?_0x13ec0b[_0xd8cd('0x32')]:_0x19e70e[_0xd8cd('0x2d')];if(!_0x2cfc64['query']['hasOwnProperty']('nolimit')){_0x13ec0b[_0xd8cd('0x35')]=qs[_0xd8cd('0x35')](_0x2cfc64[_0xd8cd('0x2f')][_0xd8cd('0x35')]);_0x13ec0b['offset']=qs[_0xd8cd('0x1b')](_0x2cfc64['query'][_0xd8cd('0x1b')]);}_0x13ec0b[_0xd8cd('0x36')]=qs[_0xd8cd('0x37')](_0x2cfc64[_0xd8cd('0x2f')]['sort']);_0x13ec0b[_0xd8cd('0x38')]=qs['filters'](_[_0xd8cd('0x39')](_0x2cfc64[_0xd8cd('0x2f')],_0x19e70e[_0xd8cd('0x31')]),_0x48965b);if(_0x2cfc64[_0xd8cd('0x2f')][_0xd8cd('0x3a')]){_0x13ec0b['where']=_[_0xd8cd('0x3b')](_0x13ec0b['where'],{'$or':_['map'](_0x48965b,function(_0x10802e){if(_0x10802e['type']!==_0xd8cd('0x3c')){var _0x4cd15c={};_0x4cd15c[_0x10802e[_0xd8cd('0x27')]]={'$like':'%'+_0x2cfc64[_0xd8cd('0x2f')]['filter']+'%'};return _0x4cd15c;}})});}_0x13ec0b=_[_0xd8cd('0x3b')]({},_0x13ec0b,_0x2cfc64[_0xd8cd('0x3d')]);var _0x2b471b={'where':_0x13ec0b[_0xd8cd('0x38')]};return db['SugarcrmConfiguration']['count'](_0x2b471b)[_0xd8cd('0x23')](function(_0x1a5c4b){_0x4334df[_0xd8cd('0x1d')]=_0x1a5c4b;if(_0x2cfc64[_0xd8cd('0x2f')][_0xd8cd('0x3e')]){_0x13ec0b[_0xd8cd('0x3f')]=[{'all':!![]}];}return db[_0xd8cd('0x29')][_0xd8cd('0x40')](_0x13ec0b);})[_0xd8cd('0x23')](function(_0x3075f4){_0x4334df[_0xd8cd('0x41')]=_0x3075f4;return _0x4334df;})[_0xd8cd('0x23')](respondWithFilteredResult(_0x3a8569,_0x13ec0b))['catch'](handleError(_0x3a8569,null));};exports[_0xd8cd('0x42')]=function(_0x520140,_0x171f35){var _0x5a96d6={'raw':![],'where':{'id':_0x520140[_0xd8cd('0x43')]['id']}},_0x10428d={};_0x10428d[_0xd8cd('0x2d')]=_['keys'](db[_0xd8cd('0x29')][_0xd8cd('0x2a')]);_0x10428d[_0xd8cd('0x2f')]=_[_0xd8cd('0x30')](_0x520140[_0xd8cd('0x2f')]);_0x10428d[_0xd8cd('0x31')]=_[_0xd8cd('0x33')](_0x10428d[_0xd8cd('0x2d')],_0x10428d[_0xd8cd('0x2f')]);_0x5a96d6[_0xd8cd('0x32')]=_['intersection'](_0x10428d[_0xd8cd('0x2d')],qs[_0xd8cd('0x34')](_0x520140['query'][_0xd8cd('0x34')]));_0x5a96d6[_0xd8cd('0x32')]=_0x5a96d6[_0xd8cd('0x32')]['length']?_0x5a96d6[_0xd8cd('0x32')]:_0x10428d[_0xd8cd('0x2d')];if(_0x520140[_0xd8cd('0x2f')][_0xd8cd('0x3e')]){_0x5a96d6[_0xd8cd('0x3f')]=[{'all':!![]}];}_0x5a96d6=_[_0xd8cd('0x3b')]({},_0x5a96d6,_0x520140['options']);return db[_0xd8cd('0x29')]['find'](_0x5a96d6)['then'](handleEntityNotFound(_0x171f35,null))[_0xd8cd('0x23')](respondWithResult(_0x171f35,null))[_0xd8cd('0x44')](handleError(_0x171f35,null));};exports[_0xd8cd('0x45')]=function(_0x58ed6f,_0xb4b71){return db[_0xd8cd('0x29')][_0xd8cd('0x45')](_0x58ed6f['body'],{})['then'](respondWithResult(_0xb4b71,0xc9))[_0xd8cd('0x44')](handleError(_0xb4b71,null));};exports[_0xd8cd('0x22')]=function(_0x6a93ed,_0x441f20){if(_0x6a93ed[_0xd8cd('0x46')]['id']){delete _0x6a93ed[_0xd8cd('0x46')]['id'];}return db[_0xd8cd('0x29')]['find']({'where':{'id':_0x6a93ed[_0xd8cd('0x43')]['id']}})['then'](handleEntityNotFound(_0x441f20,null))[_0xd8cd('0x23')](saveUpdates(_0x6a93ed[_0xd8cd('0x46')],null))[_0xd8cd('0x23')](respondWithResult(_0x441f20,null))['catch'](handleError(_0x441f20,null));};exports[_0xd8cd('0x47')]=function(_0x4b3513,_0x22f366){return db[_0xd8cd('0x29')][_0xd8cd('0x48')]({'where':{'id':_0x4b3513[_0xd8cd('0x43')]['id']}})['then'](handleEntityNotFound(_0x22f366,null))[_0xd8cd('0x23')](removeEntity(_0x22f366,null))[_0xd8cd('0x44')](handleError(_0x22f366,null));};exports[_0xd8cd('0x49')]=function(_0x599e2b,_0x35b417,_0xbaa294){var _0x260f42={};var _0x3fc9a4={};var _0x455d3f;var _0x588cf5;return db[_0xd8cd('0x29')][_0xd8cd('0x4a')]({'where':{'id':_0x599e2b[_0xd8cd('0x43')]['id']}})[_0xd8cd('0x23')](handleEntityNotFound(_0x35b417,null))[_0xd8cd('0x23')](function(_0x5a4876){if(_0x5a4876){_0x455d3f=_0x5a4876;_0x3fc9a4[_0xd8cd('0x2d')]=_['keys'](db['SugarcrmField'][_0xd8cd('0x2a')]);_0x3fc9a4['query']=_[_0xd8cd('0x30')](_0x599e2b['query']);_0x3fc9a4[_0xd8cd('0x31')]=_[_0xd8cd('0x33')](_0x3fc9a4[_0xd8cd('0x2d')],_0x3fc9a4['query']);_0x260f42[_0xd8cd('0x32')]=_[_0xd8cd('0x33')](_0x3fc9a4[_0xd8cd('0x2d')],qs[_0xd8cd('0x34')](_0x599e2b['query']['fields']));_0x260f42['attributes']=_0x260f42[_0xd8cd('0x32')][_0xd8cd('0x4b')]?_0x260f42[_0xd8cd('0x32')]:_0x3fc9a4['model'];_0x260f42[_0xd8cd('0x36')]=qs['sort'](_0x599e2b[_0xd8cd('0x2f')]['sort']);_0x260f42['where']=qs[_0xd8cd('0x31')](_[_0xd8cd('0x39')](_0x599e2b[_0xd8cd('0x2f')],_0x3fc9a4[_0xd8cd('0x31')]));if(_0x599e2b[_0xd8cd('0x2f')]['filter']){_0x260f42['where']=_[_0xd8cd('0x3b')](_0x260f42['where'],{'$or':_[_0xd8cd('0x2e')](_0x260f42[_0xd8cd('0x32')],function(_0x1c0711){var _0x55a1b9={};_0x55a1b9[_0x1c0711]={'$like':'%'+_0x599e2b[_0xd8cd('0x2f')][_0xd8cd('0x3a')]+'%'};return _0x55a1b9;})});}_0x260f42=_[_0xd8cd('0x3b')]({},_0x260f42,_0x599e2b[_0xd8cd('0x3d')]);return _0x455d3f[_0xd8cd('0x49')](_0x260f42);}})[_0xd8cd('0x23')](function(_0x3e237e){if(_0x3e237e){_0x588cf5=_0x3e237e['length'];if(!_0x599e2b[_0xd8cd('0x2f')]['hasOwnProperty']('nolimit')){_0x260f42[_0xd8cd('0x35')]=qs[_0xd8cd('0x35')](_0x599e2b[_0xd8cd('0x2f')]['limit']);_0x260f42[_0xd8cd('0x1b')]=qs['offset'](_0x599e2b[_0xd8cd('0x2f')][_0xd8cd('0x1b')]);}return _0x455d3f[_0xd8cd('0x49')](_0x260f42);}})[_0xd8cd('0x23')](function(_0xaefbbc){if(_0xaefbbc){return _0xaefbbc?{'count':_0x588cf5,'rows':_0xaefbbc}:null;}})[_0xd8cd('0x23')](respondWithResult(_0x35b417,null))[_0xd8cd('0x44')](handleError(_0x35b417,null));};exports[_0xd8cd('0x4c')]=function(_0x16953d,_0x277049,_0x4a1848){var _0x55417b={};var _0x3cdea7={};var _0x36124c;var _0x3039a5;return db[_0xd8cd('0x29')][_0xd8cd('0x4a')]({'where':{'id':_0x16953d[_0xd8cd('0x43')]['id']}})[_0xd8cd('0x23')](handleEntityNotFound(_0x277049,null))[_0xd8cd('0x23')](function(_0x553264){if(_0x553264){_0x36124c=_0x553264;_0x3cdea7[_0xd8cd('0x2d')]=_['keys'](db[_0xd8cd('0x4d')][_0xd8cd('0x2a')]);_0x3cdea7[_0xd8cd('0x2f')]=_[_0xd8cd('0x30')](_0x16953d[_0xd8cd('0x2f')]);_0x3cdea7[_0xd8cd('0x31')]=_['intersection'](_0x3cdea7['model'],_0x3cdea7[_0xd8cd('0x2f')]);_0x55417b[_0xd8cd('0x32')]=_[_0xd8cd('0x33')](_0x3cdea7[_0xd8cd('0x2d')],qs[_0xd8cd('0x34')](_0x16953d[_0xd8cd('0x2f')][_0xd8cd('0x34')]));_0x55417b[_0xd8cd('0x32')]=_0x55417b[_0xd8cd('0x32')][_0xd8cd('0x4b')]?_0x55417b[_0xd8cd('0x32')]:_0x3cdea7['model'];_0x55417b[_0xd8cd('0x36')]=qs[_0xd8cd('0x37')](_0x16953d[_0xd8cd('0x2f')][_0xd8cd('0x37')]);_0x55417b['where']=qs['filters'](_[_0xd8cd('0x39')](_0x16953d[_0xd8cd('0x2f')],_0x3cdea7['filters']));if(_0x16953d[_0xd8cd('0x2f')][_0xd8cd('0x3a')]){_0x55417b[_0xd8cd('0x38')]=_['merge'](_0x55417b[_0xd8cd('0x38')],{'$or':_[_0xd8cd('0x2e')](_0x55417b[_0xd8cd('0x32')],function(_0xe19103){var _0x5d762c={};_0x5d762c[_0xe19103]={'$like':'%'+_0x16953d[_0xd8cd('0x2f')][_0xd8cd('0x3a')]+'%'};return _0x5d762c;})});}_0x55417b=_[_0xd8cd('0x3b')]({},_0x55417b,_0x16953d['options']);return _0x36124c['getSubjects'](_0x55417b);}})['then'](function(_0x4da7ef){if(_0x4da7ef){_0x3039a5=_0x4da7ef[_0xd8cd('0x4b')];if(!_0x16953d[_0xd8cd('0x2f')][_0xd8cd('0x4e')](_0xd8cd('0x4f'))){_0x55417b[_0xd8cd('0x35')]=qs['limit'](_0x16953d[_0xd8cd('0x2f')][_0xd8cd('0x35')]);_0x55417b[_0xd8cd('0x1b')]=qs[_0xd8cd('0x1b')](_0x16953d['query'][_0xd8cd('0x1b')]);}return _0x36124c[_0xd8cd('0x4c')](_0x55417b);}})['then'](function(_0x458eb1){if(_0x458eb1){return _0x458eb1?{'count':_0x3039a5,'rows':_0x458eb1}:null;}})[_0xd8cd('0x23')](respondWithResult(_0x277049,null))[_0xd8cd('0x44')](handleError(_0x277049,null));};exports['getDescriptions']=function(_0x423e7f,_0x10169d,_0x5ea868){var _0x588f5c={};var _0x38a2b2={};var _0x2dc3c3;var _0x217873;return db[_0xd8cd('0x29')][_0xd8cd('0x4a')]({'where':{'id':_0x423e7f['params']['id']}})[_0xd8cd('0x23')](handleEntityNotFound(_0x10169d,null))[_0xd8cd('0x23')](function(_0x4ad3ab){if(_0x4ad3ab){_0x2dc3c3=_0x4ad3ab;_0x38a2b2[_0xd8cd('0x2d')]=_[_0xd8cd('0x30')](db[_0xd8cd('0x4d')][_0xd8cd('0x2a')]);_0x38a2b2['query']=_[_0xd8cd('0x30')](_0x423e7f[_0xd8cd('0x2f')]);_0x38a2b2[_0xd8cd('0x31')]=_[_0xd8cd('0x33')](_0x38a2b2[_0xd8cd('0x2d')],_0x38a2b2['query']);_0x588f5c[_0xd8cd('0x32')]=_[_0xd8cd('0x33')](_0x38a2b2['model'],qs[_0xd8cd('0x34')](_0x423e7f[_0xd8cd('0x2f')]['fields']));_0x588f5c[_0xd8cd('0x32')]=_0x588f5c[_0xd8cd('0x32')][_0xd8cd('0x4b')]?_0x588f5c[_0xd8cd('0x32')]:_0x38a2b2[_0xd8cd('0x2d')];_0x588f5c['order']=qs[_0xd8cd('0x37')](_0x423e7f[_0xd8cd('0x2f')][_0xd8cd('0x37')]);_0x588f5c[_0xd8cd('0x38')]=qs[_0xd8cd('0x31')](_[_0xd8cd('0x39')](_0x423e7f[_0xd8cd('0x2f')],_0x38a2b2[_0xd8cd('0x31')]));if(_0x423e7f['query'][_0xd8cd('0x3a')]){_0x588f5c[_0xd8cd('0x38')]=_['merge'](_0x588f5c[_0xd8cd('0x38')],{'$or':_['map'](_0x588f5c[_0xd8cd('0x32')],function(_0x4309cd){var _0x3eae80={};_0x3eae80[_0x4309cd]={'$like':'%'+_0x423e7f[_0xd8cd('0x2f')][_0xd8cd('0x3a')]+'%'};return _0x3eae80;})});}_0x588f5c=_['merge']({},_0x588f5c,_0x423e7f[_0xd8cd('0x3d')]);return _0x2dc3c3[_0xd8cd('0x50')](_0x588f5c);}})[_0xd8cd('0x23')](function(_0x29c3be){if(_0x29c3be){_0x217873=_0x29c3be[_0xd8cd('0x4b')];if(!_0x423e7f[_0xd8cd('0x2f')]['hasOwnProperty'](_0xd8cd('0x4f'))){_0x588f5c['limit']=qs[_0xd8cd('0x35')](_0x423e7f['query'][_0xd8cd('0x35')]);_0x588f5c[_0xd8cd('0x1b')]=qs['offset'](_0x423e7f[_0xd8cd('0x2f')]['offset']);}return _0x2dc3c3['getDescriptions'](_0x588f5c);}})[_0xd8cd('0x23')](function(_0x14fbc1){if(_0x14fbc1){return _0x14fbc1?{'count':_0x217873,'rows':_0x14fbc1}:null;}})[_0xd8cd('0x23')](respondWithResult(_0x10169d,null))['catch'](handleError(_0x10169d,null));};
\ No newline at end of file
+var _0xa01c=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','getFields','SugarcrmField','rawAttributes','filter','findOne','getSubjects','pick','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','SugarcrmConfiguration','type','model','query','keys','filters','intersection'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0xa01c,0x106));var _0xca01=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa01c[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca01('0x1'));var rp=require(_0xca01('0x2'));var moment=require(_0xca01('0x3'));var BPromise=require(_0xca01('0x4'));var Mustache=require(_0xca01('0x5'));var util=require(_0xca01('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca01('0x7'));var fs=require('fs');var fs_extra=require(_0xca01('0x8'));var _=require(_0xca01('0x9'));var squel=require('squel');var crypto=require(_0xca01('0xa'));var jsforce=require(_0xca01('0xb'));var deskjs=require(_0xca01('0xc'));var toCsv=require(_0xca01('0xd'));var querystring=require(_0xca01('0xe'));var Papa=require(_0xca01('0xf'));var Redis=require(_0xca01('0x10'));var authService=require(_0xca01('0x11'));var qs=require(_0xca01('0x12'));var as=require(_0xca01('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca01('0x14'))('api');var utils=require(_0xca01('0x15'));var config=require(_0xca01('0x16'));var licenseUtil=require(_0xca01('0x17'));var db=require(_0xca01('0x18'))['db'];function respondWithStatusCode(_0x2e9ab3,_0x4d5bf5){_0x4d5bf5=_0x4d5bf5||0xcc;return function(_0x4f5f2e){if(_0x4f5f2e){return _0x2e9ab3[_0xca01('0x19')](_0x4d5bf5);}return _0x2e9ab3[_0xca01('0x1a')](_0x4d5bf5)['end']();};}function respondWithResult(_0x25ba02,_0x391129){_0x391129=_0x391129||0xc8;return function(_0x44f0cf){if(_0x44f0cf){return _0x25ba02[_0xca01('0x1a')](_0x391129)[_0xca01('0x1b')](_0x44f0cf);}};}function respondWithFilteredResult(_0x1e60d8,_0x55d72a){return function(_0x95fe01){if(_0x95fe01){var _0x42f770=typeof _0x55d72a[_0xca01('0x1c')]==='undefined'&&typeof _0x55d72a[_0xca01('0x1d')]==='undefined';var _0x4f41c9=_0x95fe01[_0xca01('0x1e')];var _0x3bc4bd=_0x42f770?0x0:_0x55d72a['offset'];var _0x112c9a=_0x42f770?_0x95fe01[_0xca01('0x1e')]:_0x55d72a[_0xca01('0x1c')]+_0x55d72a[_0xca01('0x1d')];var _0x412700;if(_0x112c9a>=_0x4f41c9){_0x112c9a=_0x4f41c9;_0x412700=0xc8;}else{_0x412700=0xce;}_0x1e60d8[_0xca01('0x1a')](_0x412700);return _0x1e60d8[_0xca01('0x1f')](_0xca01('0x20'),_0x3bc4bd+'-'+_0x112c9a+'/'+_0x4f41c9)[_0xca01('0x1b')](_0x95fe01);}return null;};}function patchUpdates(_0x4c8e9c){return function(_0x3139c1){try{jsonpatch['apply'](_0x3139c1,_0x4c8e9c,!![]);}catch(_0x43a0db){return BPromise[_0xca01('0x21')](_0x43a0db);}return _0x3139c1[_0xca01('0x22')]();};}function saveUpdates(_0x42132a,_0x4468ae){return function(_0x162c06){if(_0x162c06){return _0x162c06[_0xca01('0x23')](_0x42132a)[_0xca01('0x24')](function(_0x3c909a){return _0x3c909a;});}return null;};}function removeEntity(_0x58767b,_0x391316){return function(_0x22a26a){if(_0x22a26a){return _0x22a26a[_0xca01('0x25')]()[_0xca01('0x24')](function(){_0x58767b[_0xca01('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5d45,_0x94227c){return function(_0xbdf873){if(!_0xbdf873){_0x3e5d45[_0xca01('0x19')](0x194);}return _0xbdf873;};}function handleError(_0x5f1df1,_0x3321fd){_0x3321fd=_0x3321fd||0x1f4;return function(_0x1c43b5){logger[_0xca01('0x26')](_0x1c43b5[_0xca01('0x27')]);if(_0x1c43b5[_0xca01('0x28')]){delete _0x1c43b5['name'];}_0x5f1df1[_0xca01('0x1a')](_0x3321fd)[_0xca01('0x29')](_0x1c43b5);};}exports['index']=function(_0x5047eb,_0xdc97a2){var _0xb0eaed={},_0x39149f={},_0x3cbf1a={'count':0x0,'rows':[]};var _0x210b89=_[_0xca01('0x2a')](db[_0xca01('0x2b')]['rawAttributes'],function(_0x3e43bd){return{'name':_0x3e43bd['fieldName'],'type':_0x3e43bd[_0xca01('0x2c')]['key']};});_0x39149f[_0xca01('0x2d')]=_[_0xca01('0x2a')](_0x210b89,_0xca01('0x28'));_0x39149f[_0xca01('0x2e')]=_[_0xca01('0x2f')](_0x5047eb[_0xca01('0x2e')]);_0x39149f[_0xca01('0x30')]=_[_0xca01('0x31')](_0x39149f[_0xca01('0x2d')],_0x39149f[_0xca01('0x2e')]);_0xb0eaed['attributes']=_[_0xca01('0x31')](_0x39149f[_0xca01('0x2d')],qs[_0xca01('0x32')](_0x5047eb[_0xca01('0x2e')][_0xca01('0x32')]));_0xb0eaed[_0xca01('0x33')]=_0xb0eaed[_0xca01('0x33')][_0xca01('0x34')]?_0xb0eaed[_0xca01('0x33')]:_0x39149f[_0xca01('0x2d')];if(!_0x5047eb['query'][_0xca01('0x35')](_0xca01('0x36'))){_0xb0eaed[_0xca01('0x1d')]=qs[_0xca01('0x1d')](_0x5047eb[_0xca01('0x2e')]['limit']);_0xb0eaed['offset']=qs[_0xca01('0x1c')](_0x5047eb[_0xca01('0x2e')][_0xca01('0x1c')]);}_0xb0eaed[_0xca01('0x37')]=qs[_0xca01('0x38')](_0x5047eb[_0xca01('0x2e')][_0xca01('0x38')]);_0xb0eaed[_0xca01('0x39')]=qs['filters'](_['pick'](_0x5047eb[_0xca01('0x2e')],_0x39149f[_0xca01('0x30')]),_0x210b89);if(_0x5047eb[_0xca01('0x2e')]['filter']){_0xb0eaed[_0xca01('0x39')]=_[_0xca01('0x3a')](_0xb0eaed[_0xca01('0x39')],{'$or':_['map'](_0x210b89,function(_0x3aa72d){if(_0x3aa72d[_0xca01('0x2c')]!==_0xca01('0x3b')){var _0x2c18d6={};_0x2c18d6[_0x3aa72d[_0xca01('0x28')]]={'$like':'%'+_0x5047eb[_0xca01('0x2e')]['filter']+'%'};return _0x2c18d6;}})});}_0xb0eaed=_[_0xca01('0x3a')]({},_0xb0eaed,_0x5047eb['options']);var _0x30a907={'where':_0xb0eaed['where']};return db[_0xca01('0x2b')]['count'](_0x30a907)[_0xca01('0x24')](function(_0x500da4){_0x3cbf1a[_0xca01('0x1e')]=_0x500da4;if(_0x5047eb[_0xca01('0x2e')][_0xca01('0x3c')]){_0xb0eaed[_0xca01('0x3d')]=[{'all':!![]}];}return db[_0xca01('0x2b')][_0xca01('0x3e')](_0xb0eaed);})[_0xca01('0x24')](function(_0x3cf852){_0x3cbf1a['rows']=_0x3cf852;return _0x3cbf1a;})[_0xca01('0x24')](respondWithFilteredResult(_0xdc97a2,_0xb0eaed))[_0xca01('0x3f')](handleError(_0xdc97a2,null));};exports[_0xca01('0x40')]=function(_0x3c572e,_0x4a060e){var _0x358b29={'raw':![],'where':{'id':_0x3c572e[_0xca01('0x41')]['id']}},_0x1a44a0={};_0x1a44a0[_0xca01('0x2d')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x1a44a0['query']=_[_0xca01('0x2f')](_0x3c572e[_0xca01('0x2e')]);_0x1a44a0[_0xca01('0x30')]=_[_0xca01('0x31')](_0x1a44a0['model'],_0x1a44a0[_0xca01('0x2e')]);_0x358b29[_0xca01('0x33')]=_[_0xca01('0x31')](_0x1a44a0[_0xca01('0x2d')],qs[_0xca01('0x32')](_0x3c572e[_0xca01('0x2e')][_0xca01('0x32')]));_0x358b29['attributes']=_0x358b29[_0xca01('0x33')][_0xca01('0x34')]?_0x358b29[_0xca01('0x33')]:_0x1a44a0[_0xca01('0x2d')];if(_0x3c572e['query']['includeAll']){_0x358b29[_0xca01('0x3d')]=[{'all':!![]}];}_0x358b29=_[_0xca01('0x3a')]({},_0x358b29,_0x3c572e[_0xca01('0x42')]);return db[_0xca01('0x2b')]['find'](_0x358b29)['then'](handleEntityNotFound(_0x4a060e,null))[_0xca01('0x24')](respondWithResult(_0x4a060e,null))[_0xca01('0x3f')](handleError(_0x4a060e,null));};exports[_0xca01('0x43')]=function(_0x9e17b5,_0x4b57b2){return db['SugarcrmConfiguration']['create'](_0x9e17b5[_0xca01('0x44')],{})['then'](respondWithResult(_0x4b57b2,0xc9))[_0xca01('0x3f')](handleError(_0x4b57b2,null));};exports[_0xca01('0x23')]=function(_0x20d944,_0x28f502){if(_0x20d944[_0xca01('0x44')]['id']){delete _0x20d944[_0xca01('0x44')]['id'];}return db[_0xca01('0x2b')][_0xca01('0x45')]({'where':{'id':_0x20d944[_0xca01('0x41')]['id']}})[_0xca01('0x24')](handleEntityNotFound(_0x28f502,null))['then'](saveUpdates(_0x20d944[_0xca01('0x44')],null))[_0xca01('0x24')](respondWithResult(_0x28f502,null))[_0xca01('0x3f')](handleError(_0x28f502,null));};exports['destroy']=function(_0x456ecd,_0x58207a){return db['SugarcrmConfiguration'][_0xca01('0x45')]({'where':{'id':_0x456ecd[_0xca01('0x41')]['id']}})['then'](handleEntityNotFound(_0x58207a,null))[_0xca01('0x24')](removeEntity(_0x58207a,null))[_0xca01('0x3f')](handleError(_0x58207a,null));};exports[_0xca01('0x46')]=function(_0x100304,_0x2725a7,_0x4dcc79){var _0x1b3b94={};var _0x264e8b={};var _0x3011d0;var _0x518aa3;return db[_0xca01('0x2b')]['findOne']({'where':{'id':_0x100304[_0xca01('0x41')]['id']}})[_0xca01('0x24')](handleEntityNotFound(_0x2725a7,null))['then'](function(_0x3fe5c6){if(_0x3fe5c6){_0x3011d0=_0x3fe5c6;_0x264e8b[_0xca01('0x2d')]=_['keys'](db[_0xca01('0x47')][_0xca01('0x48')]);_0x264e8b[_0xca01('0x2e')]=_[_0xca01('0x2f')](_0x100304[_0xca01('0x2e')]);_0x264e8b['filters']=_[_0xca01('0x31')](_0x264e8b['model'],_0x264e8b[_0xca01('0x2e')]);_0x1b3b94['attributes']=_['intersection'](_0x264e8b['model'],qs[_0xca01('0x32')](_0x100304[_0xca01('0x2e')]['fields']));_0x1b3b94[_0xca01('0x33')]=_0x1b3b94[_0xca01('0x33')][_0xca01('0x34')]?_0x1b3b94[_0xca01('0x33')]:_0x264e8b['model'];_0x1b3b94['order']=qs[_0xca01('0x38')](_0x100304['query'][_0xca01('0x38')]);_0x1b3b94[_0xca01('0x39')]=qs['filters'](_['pick'](_0x100304['query'],_0x264e8b[_0xca01('0x30')]));if(_0x100304['query'][_0xca01('0x49')]){_0x1b3b94['where']=_['merge'](_0x1b3b94[_0xca01('0x39')],{'$or':_[_0xca01('0x2a')](_0x1b3b94['attributes'],function(_0x48a70c){var _0x43b98d={};_0x43b98d[_0x48a70c]={'$like':'%'+_0x100304[_0xca01('0x2e')][_0xca01('0x49')]+'%'};return _0x43b98d;})});}_0x1b3b94=_[_0xca01('0x3a')]({},_0x1b3b94,_0x100304[_0xca01('0x42')]);return _0x3011d0[_0xca01('0x46')](_0x1b3b94);}})[_0xca01('0x24')](function(_0x3ef9f0){if(_0x3ef9f0){_0x518aa3=_0x3ef9f0[_0xca01('0x34')];if(!_0x100304['query'][_0xca01('0x35')](_0xca01('0x36'))){_0x1b3b94[_0xca01('0x1d')]=qs[_0xca01('0x1d')](_0x100304[_0xca01('0x2e')][_0xca01('0x1d')]);_0x1b3b94[_0xca01('0x1c')]=qs[_0xca01('0x1c')](_0x100304[_0xca01('0x2e')]['offset']);}return _0x3011d0[_0xca01('0x46')](_0x1b3b94);}})[_0xca01('0x24')](function(_0x2c1a03){if(_0x2c1a03){return _0x2c1a03?{'count':_0x518aa3,'rows':_0x2c1a03}:null;}})['then'](respondWithResult(_0x2725a7,null))[_0xca01('0x3f')](handleError(_0x2725a7,null));};exports['getSubjects']=function(_0x2e1312,_0x2e9539,_0x5c43ea){var _0x30d917={};var _0x1ffdad={};var _0x3cb9cd;var _0x47ecc7;return db[_0xca01('0x2b')][_0xca01('0x4a')]({'where':{'id':_0x2e1312[_0xca01('0x41')]['id']}})[_0xca01('0x24')](handleEntityNotFound(_0x2e9539,null))[_0xca01('0x24')](function(_0x2cc625){if(_0x2cc625){_0x3cb9cd=_0x2cc625;_0x1ffdad[_0xca01('0x2d')]=_[_0xca01('0x2f')](db[_0xca01('0x47')][_0xca01('0x48')]);_0x1ffdad['query']=_[_0xca01('0x2f')](_0x2e1312['query']);_0x1ffdad[_0xca01('0x30')]=_[_0xca01('0x31')](_0x1ffdad[_0xca01('0x2d')],_0x1ffdad[_0xca01('0x2e')]);_0x30d917[_0xca01('0x33')]=_['intersection'](_0x1ffdad[_0xca01('0x2d')],qs['fields'](_0x2e1312[_0xca01('0x2e')][_0xca01('0x32')]));_0x30d917[_0xca01('0x33')]=_0x30d917['attributes'][_0xca01('0x34')]?_0x30d917[_0xca01('0x33')]:_0x1ffdad[_0xca01('0x2d')];_0x30d917[_0xca01('0x37')]=qs['sort'](_0x2e1312[_0xca01('0x2e')][_0xca01('0x38')]);_0x30d917[_0xca01('0x39')]=qs[_0xca01('0x30')](_['pick'](_0x2e1312[_0xca01('0x2e')],_0x1ffdad['filters']));if(_0x2e1312[_0xca01('0x2e')][_0xca01('0x49')]){_0x30d917[_0xca01('0x39')]=_[_0xca01('0x3a')](_0x30d917[_0xca01('0x39')],{'$or':_[_0xca01('0x2a')](_0x30d917[_0xca01('0x33')],function(_0x1fbdf2){var _0x54333d={};_0x54333d[_0x1fbdf2]={'$like':'%'+_0x2e1312[_0xca01('0x2e')][_0xca01('0x49')]+'%'};return _0x54333d;})});}_0x30d917=_['merge']({},_0x30d917,_0x2e1312['options']);return _0x3cb9cd[_0xca01('0x4b')](_0x30d917);}})[_0xca01('0x24')](function(_0x3b929b){if(_0x3b929b){_0x47ecc7=_0x3b929b[_0xca01('0x34')];if(!_0x2e1312['query'][_0xca01('0x35')](_0xca01('0x36'))){_0x30d917['limit']=qs[_0xca01('0x1d')](_0x2e1312[_0xca01('0x2e')]['limit']);_0x30d917[_0xca01('0x1c')]=qs[_0xca01('0x1c')](_0x2e1312['query']['offset']);}return _0x3cb9cd['getSubjects'](_0x30d917);}})[_0xca01('0x24')](function(_0x2d0ad4){if(_0x2d0ad4){return _0x2d0ad4?{'count':_0x47ecc7,'rows':_0x2d0ad4}:null;}})[_0xca01('0x24')](respondWithResult(_0x2e9539,null))[_0xca01('0x3f')](handleError(_0x2e9539,null));};exports['getDescriptions']=function(_0x1bdd71,_0x26872d,_0x4e958f){var _0x1752a9={};var _0xf5e925={};var _0x87398e;var _0xb11a5a;return db['SugarcrmConfiguration'][_0xca01('0x4a')]({'where':{'id':_0x1bdd71['params']['id']}})[_0xca01('0x24')](handleEntityNotFound(_0x26872d,null))['then'](function(_0x3a574b){if(_0x3a574b){_0x87398e=_0x3a574b;_0xf5e925[_0xca01('0x2d')]=_[_0xca01('0x2f')](db[_0xca01('0x47')][_0xca01('0x48')]);_0xf5e925[_0xca01('0x2e')]=_[_0xca01('0x2f')](_0x1bdd71['query']);_0xf5e925[_0xca01('0x30')]=_[_0xca01('0x31')](_0xf5e925[_0xca01('0x2d')],_0xf5e925['query']);_0x1752a9[_0xca01('0x33')]=_[_0xca01('0x31')](_0xf5e925[_0xca01('0x2d')],qs[_0xca01('0x32')](_0x1bdd71[_0xca01('0x2e')][_0xca01('0x32')]));_0x1752a9['attributes']=_0x1752a9[_0xca01('0x33')][_0xca01('0x34')]?_0x1752a9[_0xca01('0x33')]:_0xf5e925[_0xca01('0x2d')];_0x1752a9[_0xca01('0x37')]=qs[_0xca01('0x38')](_0x1bdd71[_0xca01('0x2e')]['sort']);_0x1752a9[_0xca01('0x39')]=qs['filters'](_[_0xca01('0x4c')](_0x1bdd71[_0xca01('0x2e')],_0xf5e925[_0xca01('0x30')]));if(_0x1bdd71['query']['filter']){_0x1752a9[_0xca01('0x39')]=_[_0xca01('0x3a')](_0x1752a9[_0xca01('0x39')],{'$or':_[_0xca01('0x2a')](_0x1752a9[_0xca01('0x33')],function(_0x199af6){var _0x3ff3ac={};_0x3ff3ac[_0x199af6]={'$like':'%'+_0x1bdd71[_0xca01('0x2e')][_0xca01('0x49')]+'%'};return _0x3ff3ac;})});}_0x1752a9=_['merge']({},_0x1752a9,_0x1bdd71[_0xca01('0x42')]);return _0x87398e[_0xca01('0x4d')](_0x1752a9);}})[_0xca01('0x24')](function(_0x429b02){if(_0x429b02){_0xb11a5a=_0x429b02['length'];if(!_0x1bdd71[_0xca01('0x2e')][_0xca01('0x35')](_0xca01('0x36'))){_0x1752a9[_0xca01('0x1d')]=qs[_0xca01('0x1d')](_0x1bdd71[_0xca01('0x2e')][_0xca01('0x1d')]);_0x1752a9[_0xca01('0x1c')]=qs[_0xca01('0x1c')](_0x1bdd71['query'][_0xca01('0x1c')]);}return _0x87398e['getDescriptions'](_0x1752a9);}})[_0xca01('0x24')](function(_0x311940){if(_0x311940){return _0x311940?{'count':_0xb11a5a,'rows':_0x311940}:null;}})[_0xca01('0x24')](respondWithResult(_0x26872d,null))[_0xca01('0x3f')](handleError(_0x26872d,null));};
\ No newline at end of file
index 4039c74..bedecc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51af=['define','int_sugarcrm_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes'];(function(_0x2a50fc,_0x792726){var _0x5aa6a2=function(_0x26ca83){while(--_0x26ca83){_0x2a50fc['push'](_0x2a50fc['shift']());}};_0x5aa6a2(++_0x792726);}(_0x51af,0x66));var _0xf51a=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x51af[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf51a('0x0'))(_0xf51a('0x1'));var moment=require(_0xf51a('0x2'));var BPromise=require(_0xf51a('0x3'));var rp=require(_0xf51a('0x4'));var fs=require('fs');var path=require(_0xf51a('0x5'));var rimraf=require(_0xf51a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf51a('0x7'));module['exports']=function(_0x5b646d,_0x269001){return _0x5b646d[_0xf51a('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xf51a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc436=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x510ef3,_0x485c87){var _0xea460f=function(_0xe36f5e){while(--_0xe36f5e){_0x510ef3['push'](_0x510ef3['shift']());}};_0xea460f(++_0x485c87);}(_0xc436,0x160));var _0x6c43=function(_0x5182bd,_0xff8120){_0x5182bd=_0x5182bd-0x0;var _0x3b902d=_0xc436[_0x5182bd];return _0x3b902d;};'use strict';var _=require(_0x6c43('0x0'));var util=require(_0x6c43('0x1'));var logger=require(_0x6c43('0x2'))(_0x6c43('0x3'));var moment=require(_0x6c43('0x4'));var BPromise=require(_0x6c43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6c43('0x6'));var attributes=require(_0x6c43('0x7'));module[_0x6c43('0x8')]=function(_0x3d9278,_0xd442ea){return _0x3d9278[_0x6c43('0x9')](_0x6c43('0xa'),attributes,{'tableName':_0x6c43('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d13f749..453fc75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf152=['request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0xf152,0x10b));var _0x2f15=function(_0x4ded50,_0x4a6af3){_0x4ded50=_0x4ded50-0x0;var _0xa92135=_0xf152[_0x4ded50];return _0xa92135;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f15('0x0'));var BPromise=require(_0x2f15('0x1'));var rs=require(_0x2f15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2f15('0x3'));var logger=require(_0x2f15('0x4'))(_0x2f15('0x5'));var config=require(_0x2f15('0x6'));var jayson=require(_0x2f15('0x7'));var client=jayson[_0x2f15('0x8')][_0x2f15('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e37d4,_0x54a7c5,_0xd4a9a3){return new BPromise(function(_0xc500a1,_0x2586e1){return client['request'](_0x3e37d4,_0xd4a9a3)[_0x2f15('0xa')](function(_0x1ce10a){logger[_0x2f15('0xb')](_0x2f15('0xc'),_0x54a7c5,_0x2f15('0xd'));logger[_0x2f15('0xe')](_0x2f15('0xf'),_0x54a7c5,_0x2f15('0xd'),JSON['stringify'](_0x1ce10a));if(_0x1ce10a[_0x2f15('0x10')]){if(_0x1ce10a[_0x2f15('0x10')][_0x2f15('0x11')]===0x1f4){logger[_0x2f15('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x54a7c5,_0x1ce10a[_0x2f15('0x10')][_0x2f15('0x12')]);return _0x2586e1(_0x1ce10a[_0x2f15('0x10')][_0x2f15('0x12')]);}logger[_0x2f15('0x10')](_0x2f15('0xc'),_0x54a7c5,_0x1ce10a[_0x2f15('0x10')]['message']);return _0xc500a1(_0x1ce10a[_0x2f15('0x10')][_0x2f15('0x12')]);}else{logger[_0x2f15('0xb')](_0x2f15('0xc'),_0x54a7c5,'request\x20sent');_0xc500a1(_0x1ce10a['result'][_0x2f15('0x12')]);}})[_0x2f15('0x13')](function(_0x4ee159){logger[_0x2f15('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x54a7c5,_0x4ee159);_0x2586e1(_0x4ee159);});});}
\ No newline at end of file
+var _0xbf6e=['code','error','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2b4319,_0x23e439){var _0x5afde5=function(_0xdcfb54){while(--_0xdcfb54){_0x2b4319['push'](_0x2b4319['shift']());}};_0x5afde5(++_0x23e439);}(_0xbf6e,0x17b));var _0xebf6=function(_0x4789cd,_0x1d18d6){_0x4789cd=_0x4789cd-0x0;var _0x39f810=_0xbf6e[_0x4789cd];return _0x39f810;};'use strict';var _=require(_0xebf6('0x0'));var util=require(_0xebf6('0x1'));var moment=require(_0xebf6('0x2'));var BPromise=require(_0xebf6('0x3'));var rs=require(_0xebf6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebf6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xebf6('0x6'))(_0xebf6('0x7'));var config=require(_0xebf6('0x8'));var jayson=require(_0xebf6('0x9'));var client=jayson[_0xebf6('0xa')][_0xebf6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e8741,_0x19b16b,_0x39857a){return new BPromise(function(_0x54b5f3,_0x47c2a1){return client['request'](_0x1e8741,_0x39857a)[_0xebf6('0xc')](function(_0x1fdd4e){logger['info'](_0xebf6('0xd'),_0x19b16b,'request\x20sent');logger['debug'](_0xebf6('0xe'),_0x19b16b,_0xebf6('0xf'),JSON[_0xebf6('0x10')](_0x1fdd4e));if(_0x1fdd4e['error']){if(_0x1fdd4e['error'][_0xebf6('0x11')]===0x1f4){logger[_0xebf6('0x12')](_0xebf6('0xd'),_0x19b16b,_0x1fdd4e[_0xebf6('0x12')]['message']);return _0x47c2a1(_0x1fdd4e[_0xebf6('0x12')][_0xebf6('0x13')]);}logger[_0xebf6('0x12')](_0xebf6('0xd'),_0x19b16b,_0x1fdd4e[_0xebf6('0x12')][_0xebf6('0x13')]);return _0x54b5f3(_0x1fdd4e[_0xebf6('0x12')][_0xebf6('0x13')]);}else{logger[_0xebf6('0x14')](_0xebf6('0xd'),_0x19b16b,_0xebf6('0xf'));_0x54b5f3(_0x1fdd4e['result'][_0xebf6('0x13')]);}})[_0xebf6('0x15')](function(_0x34b528){logger[_0xebf6('0x12')](_0xebf6('0xd'),_0x19b16b,_0x34b528);_0x47c2a1(_0x34b528);});});}
\ No newline at end of file
index c4de2e8..1367142 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3e7=['../../config/environment','./intSugarcrmField.controller','index','get','/:id','show','post','put','isAuthenticated','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xa3e7,0xee));var _0x7a3e=function(_0x2ffc5d,_0x564eba){_0x2ffc5d=_0x2ffc5d-0x0;var _0x57f0a=_0xa3e7[_0x2ffc5d];return _0x57f0a;};'use strict';var multer=require(_0x7a3e('0x0'));var util=require(_0x7a3e('0x1'));var path=require(_0x7a3e('0x2'));var timeout=require(_0x7a3e('0x3'));var express=require(_0x7a3e('0x4'));var router=express[_0x7a3e('0x5')]();var fs_extra=require(_0x7a3e('0x6'));var auth=require(_0x7a3e('0x7'));var interaction=require(_0x7a3e('0x8'));var config=require(_0x7a3e('0x9'));var controller=require(_0x7a3e('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a3e('0xb')]);router[_0x7a3e('0xc')](_0x7a3e('0xd'),auth['isAuthenticated'](),controller[_0x7a3e('0xe')]);router[_0x7a3e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7a3e('0x10')](_0x7a3e('0xd'),auth[_0x7a3e('0x11')](),controller['update']);router[_0x7a3e('0x12')](_0x7a3e('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0435=['isAuthenticated','show','post','/:id','update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x0435,0x18e));var _0x5043=function(_0x372594,_0x38c3ae){_0x372594=_0x372594-0x0;var _0x83765d=_0x0435[_0x372594];return _0x83765d;};'use strict';var multer=require(_0x5043('0x0'));var util=require('util');var path=require(_0x5043('0x1'));var timeout=require('connect-timeout');var express=require(_0x5043('0x2'));var router=express['Router']();var fs_extra=require(_0x5043('0x3'));var auth=require(_0x5043('0x4'));var interaction=require(_0x5043('0x5'));var config=require(_0x5043('0x6'));var controller=require(_0x5043('0x7'));router[_0x5043('0x8')]('/',auth['isAuthenticated'](),controller[_0x5043('0x9')]);router['get']('/:id',auth[_0x5043('0xa')](),controller[_0x5043('0xb')]);router[_0x5043('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5043('0xd'),auth[_0x5043('0xa')](),controller[_0x5043('0xe')]);router[_0x5043('0xf')](_0x5043('0xd'),auth['isAuthenticated'](),controller[_0x5043('0x10')]);module['exports']=router;
\ No newline at end of file
index 1f7e4b1..628a164 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x049c=['sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x25fe1f,_0x45f1c5){var _0x1e1d92=function(_0x5e1065){while(--_0x5e1065){_0x25fe1f['push'](_0x25fe1f['shift']());}};_0x1e1d92(++_0x45f1c5);}(_0x049c,0xaf));var _0xc049=function(_0x5d4ad0,_0x5823e1){_0x5d4ad0=_0x5d4ad0-0x0;var _0x454fde=_0x049c[_0x5d4ad0];return _0x454fde;};'use strict';var Sequelize=require(_0xc049('0x0'));module['exports']={'type':{'type':Sequelize[_0xc049('0x1')](_0xc049('0x2'),_0xc049('0x3'),_0xc049('0x4'),'keyValue',_0xc049('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc049('0x6')]},'keyType':{'type':Sequelize[_0xc049('0x1')](_0xc049('0x2'),_0xc049('0x3'),_0xc049('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc049('0x6')]},'nameField':{'type':Sequelize[_0xc049('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc049('0x6')]}};
\ No newline at end of file
+var _0x1ba2=['variable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x39bc9a,_0xde9de8){var _0x65088d=function(_0x562a8a){while(--_0x562a8a){_0x39bc9a['push'](_0x39bc9a['shift']());}};_0x65088d(++_0xde9de8);}(_0x1ba2,0x64));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x21ba('0x0'));module[_0x21ba('0x1')]={'type':{'type':Sequelize[_0x21ba('0x2')](_0x21ba('0x3'),_0x21ba('0x4'),'customVariable','keyValue',_0x21ba('0x5')),'defaultValue':_0x21ba('0x3')},'content':{'type':Sequelize[_0x21ba('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x21ba('0x3'),_0x21ba('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x21ba('0x6')]},'nameField':{'type':Sequelize[_0x21ba('0x6')]},'customField':{'type':Sequelize[_0x21ba('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x21ba('0x6')]}};
\ No newline at end of file
index 1dbaef4..e235469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54b6=['Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','model','keys','filters','query','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','set'];(function(_0x15fa77,_0x93eaff){var _0x1385ff=function(_0x165e02){while(--_0x165e02){_0x15fa77['push'](_0x15fa77['shift']());}};_0x1385ff(++_0x93eaff);}(_0x54b6,0x1bd));var _0x654b=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x54b6[_0x37c22c];return _0x119d79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x654b('0x0'));var zipdir=require(_0x654b('0x1'));var jsonpatch=require(_0x654b('0x2'));var rp=require(_0x654b('0x3'));var moment=require(_0x654b('0x4'));var BPromise=require(_0x654b('0x5'));var Mustache=require(_0x654b('0x6'));var util=require(_0x654b('0x7'));var path=require(_0x654b('0x8'));var sox=require(_0x654b('0x9'));var csv=require(_0x654b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x654b('0xb'));var _=require(_0x654b('0xc'));var squel=require(_0x654b('0xd'));var crypto=require(_0x654b('0xe'));var jsforce=require(_0x654b('0xf'));var deskjs=require(_0x654b('0x10'));var toCsv=require(_0x654b('0xa'));var querystring=require(_0x654b('0x11'));var Papa=require(_0x654b('0x12'));var Redis=require('ioredis');var authService=require(_0x654b('0x13'));var qs=require(_0x654b('0x14'));var as=require(_0x654b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x654b('0x16'))(_0x654b('0x17'));var utils=require(_0x654b('0x18'));var config=require(_0x654b('0x19'));var licenseUtil=require(_0x654b('0x1a'));var db=require(_0x654b('0x1b'))['db'];function respondWithStatusCode(_0xfd41e0,_0x428c41){_0x428c41=_0x428c41||0xcc;return function(_0x26106a){if(_0x26106a){return _0xfd41e0[_0x654b('0x1c')](_0x428c41);}return _0xfd41e0['status'](_0x428c41)['end']();};}function respondWithResult(_0x547345,_0x164c23){_0x164c23=_0x164c23||0xc8;return function(_0x4a10ec){if(_0x4a10ec){return _0x547345[_0x654b('0x1d')](_0x164c23)[_0x654b('0x1e')](_0x4a10ec);}};}function respondWithFilteredResult(_0x2c9638,_0x177b7b){return function(_0x53c692){if(_0x53c692){var _0x180ef0=typeof _0x177b7b[_0x654b('0x1f')]==='undefined'&&typeof _0x177b7b[_0x654b('0x20')]===_0x654b('0x21');var _0xf6633a=_0x53c692['count'];var _0x5341e0=_0x180ef0?0x0:_0x177b7b[_0x654b('0x1f')];var _0x4066f1=_0x180ef0?_0x53c692['count']:_0x177b7b[_0x654b('0x1f')]+_0x177b7b[_0x654b('0x20')];var _0x366011;if(_0x4066f1>=_0xf6633a){_0x4066f1=_0xf6633a;_0x366011=0xc8;}else{_0x366011=0xce;}_0x2c9638[_0x654b('0x1d')](_0x366011);return _0x2c9638[_0x654b('0x22')](_0x654b('0x23'),_0x5341e0+'-'+_0x4066f1+'/'+_0xf6633a)['json'](_0x53c692);}return null;};}function patchUpdates(_0x81dd0f){return function(_0x34c0a4){try{jsonpatch[_0x654b('0x24')](_0x34c0a4,_0x81dd0f,!![]);}catch(_0x824519){return BPromise[_0x654b('0x25')](_0x824519);}return _0x34c0a4['save']();};}function saveUpdates(_0x39aed1,_0x12a4a8){return function(_0xf4a450){if(_0xf4a450){return _0xf4a450[_0x654b('0x26')](_0x39aed1)[_0x654b('0x27')](function(_0x50f3cc){return _0x50f3cc;});}return null;};}function removeEntity(_0x2d1bba,_0x49d0f3){return function(_0x185ae6){if(_0x185ae6){return _0x185ae6[_0x654b('0x28')]()[_0x654b('0x27')](function(){_0x2d1bba['status'](0xcc)[_0x654b('0x29')]();});}};}function handleEntityNotFound(_0x5ef65e,_0x3523e7){return function(_0x4df64f){if(!_0x4df64f){_0x5ef65e[_0x654b('0x1c')](0x194);}return _0x4df64f;};}function handleError(_0x4a5c28,_0x561363){_0x561363=_0x561363||0x1f4;return function(_0x4dc8a8){logger[_0x654b('0x2a')](_0x4dc8a8[_0x654b('0x2b')]);if(_0x4dc8a8[_0x654b('0x2c')]){delete _0x4dc8a8['name'];}_0x4a5c28[_0x654b('0x1d')](_0x561363)[_0x654b('0x2d')](_0x4dc8a8);};}exports[_0x654b('0x2e')]=function(_0xacdfce,_0x184baf){var _0x1eb600={},_0x103be3={},_0x18c6f8={'count':0x0,'rows':[]};var _0x12dfd2=_[_0x654b('0x2f')](db[_0x654b('0x30')][_0x654b('0x31')],function(_0x27f6f2){return{'name':_0x27f6f2[_0x654b('0x32')],'type':_0x27f6f2[_0x654b('0x33')]['key']};});_0x103be3[_0x654b('0x34')]=_[_0x654b('0x2f')](_0x12dfd2,'name');_0x103be3['query']=_[_0x654b('0x35')](_0xacdfce['query']);_0x103be3[_0x654b('0x36')]=_['intersection'](_0x103be3[_0x654b('0x34')],_0x103be3[_0x654b('0x37')]);_0x1eb600['attributes']=_[_0x654b('0x38')](_0x103be3[_0x654b('0x34')],qs['fields'](_0xacdfce[_0x654b('0x37')]['fields']));_0x1eb600[_0x654b('0x39')]=_0x1eb600[_0x654b('0x39')][_0x654b('0x3a')]?_0x1eb600[_0x654b('0x39')]:_0x103be3[_0x654b('0x34')];if(!_0xacdfce[_0x654b('0x37')]['hasOwnProperty'](_0x654b('0x3b'))){_0x1eb600[_0x654b('0x20')]=qs[_0x654b('0x20')](_0xacdfce['query']['limit']);_0x1eb600['offset']=qs[_0x654b('0x1f')](_0xacdfce['query'][_0x654b('0x1f')]);}_0x1eb600[_0x654b('0x3c')]=qs['sort'](_0xacdfce['query'][_0x654b('0x3d')]);_0x1eb600[_0x654b('0x3e')]=qs[_0x654b('0x36')](_[_0x654b('0x3f')](_0xacdfce[_0x654b('0x37')],_0x103be3['filters']),_0x12dfd2);if(_0xacdfce['query'][_0x654b('0x40')]){_0x1eb600[_0x654b('0x3e')]=_[_0x654b('0x41')](_0x1eb600[_0x654b('0x3e')],{'$or':_[_0x654b('0x2f')](_0x12dfd2,function(_0x3f2851){if(_0x3f2851[_0x654b('0x33')]!==_0x654b('0x42')){var _0x5e50e7={};_0x5e50e7[_0x3f2851[_0x654b('0x2c')]]={'$like':'%'+_0xacdfce['query']['filter']+'%'};return _0x5e50e7;}})});}_0x1eb600=_[_0x654b('0x41')]({},_0x1eb600,_0xacdfce[_0x654b('0x43')]);var _0x5e5891={'where':_0x1eb600[_0x654b('0x3e')]};return db['SugarcrmField'][_0x654b('0x44')](_0x5e5891)[_0x654b('0x27')](function(_0x2d3de6){_0x18c6f8[_0x654b('0x44')]=_0x2d3de6;if(_0xacdfce[_0x654b('0x37')]['includeAll']){_0x1eb600[_0x654b('0x45')]=[{'all':!![]}];}return db['SugarcrmField'][_0x654b('0x46')](_0x1eb600);})[_0x654b('0x27')](function(_0x22efbb){_0x18c6f8[_0x654b('0x47')]=_0x22efbb;return _0x18c6f8;})[_0x654b('0x27')](respondWithFilteredResult(_0x184baf,_0x1eb600))[_0x654b('0x48')](handleError(_0x184baf,null));};exports[_0x654b('0x49')]=function(_0x58faf7,_0x248a8f){var _0x2fe66f={'raw':!![],'where':{'id':_0x58faf7['params']['id']}},_0x1b9ac0={};_0x1b9ac0[_0x654b('0x34')]=_[_0x654b('0x35')](db['SugarcrmField'][_0x654b('0x31')]);_0x1b9ac0[_0x654b('0x37')]=_[_0x654b('0x35')](_0x58faf7['query']);_0x1b9ac0[_0x654b('0x36')]=_[_0x654b('0x38')](_0x1b9ac0[_0x654b('0x34')],_0x1b9ac0[_0x654b('0x37')]);_0x2fe66f[_0x654b('0x39')]=_[_0x654b('0x38')](_0x1b9ac0[_0x654b('0x34')],qs[_0x654b('0x4a')](_0x58faf7['query'][_0x654b('0x4a')]));_0x2fe66f[_0x654b('0x39')]=_0x2fe66f[_0x654b('0x39')]['length']?_0x2fe66f['attributes']:_0x1b9ac0[_0x654b('0x34')];if(_0x58faf7[_0x654b('0x37')][_0x654b('0x4b')]){_0x2fe66f[_0x654b('0x45')]=[{'all':!![]}];}_0x2fe66f=_[_0x654b('0x41')]({},_0x2fe66f,_0x58faf7[_0x654b('0x43')]);return db[_0x654b('0x30')][_0x654b('0x4c')](_0x2fe66f)[_0x654b('0x27')](handleEntityNotFound(_0x248a8f,null))[_0x654b('0x27')](respondWithResult(_0x248a8f,null))[_0x654b('0x48')](handleError(_0x248a8f,null));};exports['create']=function(_0x130104,_0xbd5195){return db[_0x654b('0x30')][_0x654b('0x4d')](_0x130104['body'],{})['then'](respondWithResult(_0xbd5195,0xc9))[_0x654b('0x48')](handleError(_0xbd5195,null));};exports[_0x654b('0x26')]=function(_0x113358,_0x18083b){if(_0x113358[_0x654b('0x4e')]['id']){delete _0x113358[_0x654b('0x4e')]['id'];}return db[_0x654b('0x30')]['find']({'where':{'id':_0x113358['params']['id']}})[_0x654b('0x27')](handleEntityNotFound(_0x18083b,null))['then'](saveUpdates(_0x113358[_0x654b('0x4e')],null))['then'](respondWithResult(_0x18083b,null))[_0x654b('0x48')](handleError(_0x18083b,null));};exports[_0x654b('0x28')]=function(_0x2707e8,_0x395857){return db[_0x654b('0x30')][_0x654b('0x4c')]({'where':{'id':_0x2707e8[_0x654b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x395857,null))[_0x654b('0x27')](removeEntity(_0x395857,null))['catch'](handleError(_0x395857,null));};
\ No newline at end of file
+var _0x58cb=['fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmField'];(function(_0x4e0909,_0x5cbc6d){var _0x79ffa4=function(_0x25d30a){while(--_0x25d30a){_0x4e0909['push'](_0x4e0909['shift']());}};_0x79ffa4(++_0x5cbc6d);}(_0x58cb,0xfe));var _0xb58c=function(_0x7462bc,_0x385f28){_0x7462bc=_0x7462bc-0x0;var _0x5b764c=_0x58cb[_0x7462bc];return _0x5b764c;};'use strict';var emlformat=require(_0xb58c('0x0'));var rimraf=require(_0xb58c('0x1'));var zipdir=require(_0xb58c('0x2'));var jsonpatch=require(_0xb58c('0x3'));var rp=require('request-promise');var moment=require(_0xb58c('0x4'));var BPromise=require(_0xb58c('0x5'));var Mustache=require(_0xb58c('0x6'));var util=require('util');var path=require(_0xb58c('0x7'));var sox=require(_0xb58c('0x8'));var csv=require(_0xb58c('0x9'));var ejs=require(_0xb58c('0xa'));var fs=require('fs');var fs_extra=require(_0xb58c('0xb'));var _=require(_0xb58c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb58c('0xd'));var deskjs=require(_0xb58c('0xe'));var toCsv=require(_0xb58c('0x9'));var querystring=require(_0xb58c('0xf'));var Papa=require(_0xb58c('0x10'));var Redis=require(_0xb58c('0x11'));var authService=require(_0xb58c('0x12'));var qs=require(_0xb58c('0x13'));var as=require(_0xb58c('0x14'));var hardwareService=require(_0xb58c('0x15'));var logger=require(_0xb58c('0x16'))(_0xb58c('0x17'));var utils=require(_0xb58c('0x18'));var config=require(_0xb58c('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c3e44,_0x48b7cd){_0x48b7cd=_0x48b7cd||0xcc;return function(_0x170201){if(_0x170201){return _0x5c3e44[_0xb58c('0x1a')](_0x48b7cd);}return _0x5c3e44[_0xb58c('0x1b')](_0x48b7cd)[_0xb58c('0x1c')]();};}function respondWithResult(_0xe68aab,_0x236e05){_0x236e05=_0x236e05||0xc8;return function(_0x3b38f8){if(_0x3b38f8){return _0xe68aab[_0xb58c('0x1b')](_0x236e05)[_0xb58c('0x1d')](_0x3b38f8);}};}function respondWithFilteredResult(_0x4ceee5,_0x3741e6){return function(_0x3637f5){if(_0x3637f5){var _0x51ab52=typeof _0x3741e6['offset']===_0xb58c('0x1e')&&typeof _0x3741e6[_0xb58c('0x1f')]==='undefined';var _0x4f7252=_0x3637f5[_0xb58c('0x20')];var _0x32be13=_0x51ab52?0x0:_0x3741e6[_0xb58c('0x21')];var _0x42af46=_0x51ab52?_0x3637f5['count']:_0x3741e6[_0xb58c('0x21')]+_0x3741e6['limit'];var _0x52930f;if(_0x42af46>=_0x4f7252){_0x42af46=_0x4f7252;_0x52930f=0xc8;}else{_0x52930f=0xce;}_0x4ceee5[_0xb58c('0x1b')](_0x52930f);return _0x4ceee5[_0xb58c('0x22')]('Content-Range',_0x32be13+'-'+_0x42af46+'/'+_0x4f7252)[_0xb58c('0x1d')](_0x3637f5);}return null;};}function patchUpdates(_0x4f7ed1){return function(_0x523046){try{jsonpatch['apply'](_0x523046,_0x4f7ed1,!![]);}catch(_0x45a4aa){return BPromise[_0xb58c('0x23')](_0x45a4aa);}return _0x523046[_0xb58c('0x24')]();};}function saveUpdates(_0x45b86c,_0x223f22){return function(_0xb6b579){if(_0xb6b579){return _0xb6b579[_0xb58c('0x25')](_0x45b86c)[_0xb58c('0x26')](function(_0x200439){return _0x200439;});}return null;};}function removeEntity(_0x2a0382,_0x13024e){return function(_0x462fa4){if(_0x462fa4){return _0x462fa4[_0xb58c('0x27')]()[_0xb58c('0x26')](function(){_0x2a0382['status'](0xcc)[_0xb58c('0x1c')]();});}};}function handleEntityNotFound(_0x476134,_0x17c57b){return function(_0x1014c6){if(!_0x1014c6){_0x476134[_0xb58c('0x1a')](0x194);}return _0x1014c6;};}function handleError(_0x117f97,_0xe82173){_0xe82173=_0xe82173||0x1f4;return function(_0x35faa0){logger[_0xb58c('0x28')](_0x35faa0[_0xb58c('0x29')]);if(_0x35faa0[_0xb58c('0x2a')]){delete _0x35faa0[_0xb58c('0x2a')];}_0x117f97[_0xb58c('0x1b')](_0xe82173)[_0xb58c('0x2b')](_0x35faa0);};}exports[_0xb58c('0x2c')]=function(_0x15cf11,_0x5cfcde){var _0x3d3794={},_0x1b2889={},_0x2e01ee={'count':0x0,'rows':[]};var _0x2de9fc=_['map'](db[_0xb58c('0x2d')]['rawAttributes'],function(_0x93eb29){return{'name':_0x93eb29[_0xb58c('0x2e')],'type':_0x93eb29[_0xb58c('0x2f')]['key']};});_0x1b2889[_0xb58c('0x30')]=_[_0xb58c('0x31')](_0x2de9fc,_0xb58c('0x2a'));_0x1b2889[_0xb58c('0x32')]=_[_0xb58c('0x33')](_0x15cf11[_0xb58c('0x32')]);_0x1b2889['filters']=_[_0xb58c('0x34')](_0x1b2889[_0xb58c('0x30')],_0x1b2889[_0xb58c('0x32')]);_0x3d3794[_0xb58c('0x35')]=_[_0xb58c('0x34')](_0x1b2889[_0xb58c('0x30')],qs['fields'](_0x15cf11[_0xb58c('0x32')][_0xb58c('0x36')]));_0x3d3794[_0xb58c('0x35')]=_0x3d3794[_0xb58c('0x35')][_0xb58c('0x37')]?_0x3d3794[_0xb58c('0x35')]:_0x1b2889['model'];if(!_0x15cf11['query'][_0xb58c('0x38')](_0xb58c('0x39'))){_0x3d3794[_0xb58c('0x1f')]=qs[_0xb58c('0x1f')](_0x15cf11[_0xb58c('0x32')][_0xb58c('0x1f')]);_0x3d3794['offset']=qs[_0xb58c('0x21')](_0x15cf11['query'][_0xb58c('0x21')]);}_0x3d3794[_0xb58c('0x3a')]=qs[_0xb58c('0x3b')](_0x15cf11[_0xb58c('0x32')][_0xb58c('0x3b')]);_0x3d3794[_0xb58c('0x3c')]=qs[_0xb58c('0x3d')](_['pick'](_0x15cf11['query'],_0x1b2889[_0xb58c('0x3d')]),_0x2de9fc);if(_0x15cf11[_0xb58c('0x32')][_0xb58c('0x3e')]){_0x3d3794[_0xb58c('0x3c')]=_[_0xb58c('0x3f')](_0x3d3794['where'],{'$or':_['map'](_0x2de9fc,function(_0x4cdbab){if(_0x4cdbab[_0xb58c('0x2f')]!==_0xb58c('0x40')){var _0x25a0b8={};_0x25a0b8[_0x4cdbab['name']]={'$like':'%'+_0x15cf11[_0xb58c('0x32')]['filter']+'%'};return _0x25a0b8;}})});}_0x3d3794=_[_0xb58c('0x3f')]({},_0x3d3794,_0x15cf11[_0xb58c('0x41')]);var _0x277815={'where':_0x3d3794[_0xb58c('0x3c')]};return db['SugarcrmField']['count'](_0x277815)[_0xb58c('0x26')](function(_0xb75c9a){_0x2e01ee['count']=_0xb75c9a;if(_0x15cf11[_0xb58c('0x32')][_0xb58c('0x42')]){_0x3d3794[_0xb58c('0x43')]=[{'all':!![]}];}return db[_0xb58c('0x2d')]['findAll'](_0x3d3794);})['then'](function(_0x18d2c4){_0x2e01ee['rows']=_0x18d2c4;return _0x2e01ee;})[_0xb58c('0x26')](respondWithFilteredResult(_0x5cfcde,_0x3d3794))[_0xb58c('0x44')](handleError(_0x5cfcde,null));};exports[_0xb58c('0x45')]=function(_0x59a629,_0x21d2a8){var _0x39483e={'raw':!![],'where':{'id':_0x59a629[_0xb58c('0x46')]['id']}},_0x5e8ad5={};_0x5e8ad5[_0xb58c('0x30')]=_[_0xb58c('0x33')](db[_0xb58c('0x2d')][_0xb58c('0x47')]);_0x5e8ad5[_0xb58c('0x32')]=_[_0xb58c('0x33')](_0x59a629[_0xb58c('0x32')]);_0x5e8ad5[_0xb58c('0x3d')]=_[_0xb58c('0x34')](_0x5e8ad5[_0xb58c('0x30')],_0x5e8ad5[_0xb58c('0x32')]);_0x39483e[_0xb58c('0x35')]=_[_0xb58c('0x34')](_0x5e8ad5[_0xb58c('0x30')],qs[_0xb58c('0x36')](_0x59a629['query']['fields']));_0x39483e[_0xb58c('0x35')]=_0x39483e[_0xb58c('0x35')][_0xb58c('0x37')]?_0x39483e[_0xb58c('0x35')]:_0x5e8ad5[_0xb58c('0x30')];if(_0x59a629[_0xb58c('0x32')][_0xb58c('0x42')]){_0x39483e[_0xb58c('0x43')]=[{'all':!![]}];}_0x39483e=_[_0xb58c('0x3f')]({},_0x39483e,_0x59a629[_0xb58c('0x41')]);return db[_0xb58c('0x2d')]['find'](_0x39483e)[_0xb58c('0x26')](handleEntityNotFound(_0x21d2a8,null))['then'](respondWithResult(_0x21d2a8,null))[_0xb58c('0x44')](handleError(_0x21d2a8,null));};exports[_0xb58c('0x48')]=function(_0x2de559,_0x199db2){return db['SugarcrmField'][_0xb58c('0x48')](_0x2de559[_0xb58c('0x49')],{})[_0xb58c('0x26')](respondWithResult(_0x199db2,0xc9))[_0xb58c('0x44')](handleError(_0x199db2,null));};exports[_0xb58c('0x25')]=function(_0x439aef,_0xc89936){if(_0x439aef[_0xb58c('0x49')]['id']){delete _0x439aef[_0xb58c('0x49')]['id'];}return db['SugarcrmField'][_0xb58c('0x4a')]({'where':{'id':_0x439aef['params']['id']}})[_0xb58c('0x26')](handleEntityNotFound(_0xc89936,null))[_0xb58c('0x26')](saveUpdates(_0x439aef[_0xb58c('0x49')],null))[_0xb58c('0x26')](respondWithResult(_0xc89936,null))['catch'](handleError(_0xc89936,null));};exports[_0xb58c('0x27')]=function(_0x24d119,_0x2013ba){return db[_0xb58c('0x2d')][_0xb58c('0x4a')]({'where':{'id':_0x24d119[_0xb58c('0x46')]['id']}})[_0xb58c('0x26')](handleEntityNotFound(_0x2013ba,null))[_0xb58c('0x26')](removeEntity(_0x2013ba,null))[_0xb58c('0x44')](handleError(_0x2013ba,null));};
\ No newline at end of file
index af77a72..7308e1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacbb=['bluebird','path','../../config/environment','exports','sugarcrm_unique_index','lodash','util','../../config/logger','api','moment'];(function(_0x5dbb78,_0x5be91f){var _0x1ecdf5=function(_0x8c25df){while(--_0x8c25df){_0x5dbb78['push'](_0x5dbb78['shift']());}};_0x1ecdf5(++_0x5be91f);}(_0xacbb,0x127));var _0xbacb=function(_0x3d146a,_0x4694c3){_0x3d146a=_0x3d146a-0x0;var _0x625e32=_0xacbb[_0x3d146a];return _0x625e32;};'use strict';var _=require(_0xbacb('0x0'));var util=require(_0xbacb('0x1'));var logger=require(_0xbacb('0x2'))(_0xbacb('0x3'));var moment=require(_0xbacb('0x4'));var BPromise=require(_0xbacb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbacb('0x6'));var rimraf=require('rimraf');var config=require(_0xbacb('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0xbacb('0x8')]=function(_0x52ca10,_0x10b6ba){return _0x52ca10['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xbacb('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa82f=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x16b55f,_0x301c6c){var _0x391c2f=function(_0x4f1941){while(--_0x4f1941){_0x16b55f['push'](_0x16b55f['shift']());}};_0x391c2f(++_0x301c6c);}(_0xa82f,0x114));var _0xfa82=function(_0x1dbbde,_0xfe128b){_0x1dbbde=_0x1dbbde-0x0;var _0x455165=_0xa82f[_0x1dbbde];return _0x455165;};'use strict';var _=require(_0xfa82('0x0'));var util=require(_0xfa82('0x1'));var logger=require(_0xfa82('0x2'))(_0xfa82('0x3'));var moment=require('moment');var BPromise=require(_0xfa82('0x4'));var rp=require(_0xfa82('0x5'));var fs=require('fs');var path=require(_0xfa82('0x6'));var rimraf=require(_0xfa82('0x7'));var config=require(_0xfa82('0x8'));var attributes=require(_0xfa82('0x9'));module['exports']=function(_0x2e8134,_0x4bd2c0){return _0x2e8134[_0xfa82('0xa')](_0xfa82('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xfa82('0xc'),'fields':[_0xfa82('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 30787e3..70cf7f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd6c=['message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xbac44a,_0x2b8a8d){var _0x14acc2=function(_0x45b583){while(--_0x45b583){_0xbac44a['push'](_0xbac44a['shift']());}};_0x14acc2(++_0x2b8a8d);}(_0xbd6c,0x19d));var _0xcbd6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbd6c[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xcbd6('0x0'));var util=require(_0xcbd6('0x1'));var moment=require(_0xcbd6('0x2'));var BPromise=require(_0xcbd6('0x3'));var rs=require(_0xcbd6('0x4'));var fs=require('fs');var Redis=require(_0xcbd6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbd6('0x6'));var logger=require(_0xcbd6('0x7'))(_0xcbd6('0x8'));var config=require(_0xcbd6('0x9'));var jayson=require(_0xcbd6('0xa'));var client=jayson['client'][_0xcbd6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b3de4,_0x5504fa,_0x5606d3){return new BPromise(function(_0x69fa3e,_0x53de76){return client['request'](_0x1b3de4,_0x5606d3)[_0xcbd6('0xc')](function(_0x90383b){logger['info'](_0xcbd6('0xd'),_0x5504fa,'request\x20sent');logger[_0xcbd6('0xe')](_0xcbd6('0xf'),_0x5504fa,'request\x20sent',JSON[_0xcbd6('0x10')](_0x90383b));if(_0x90383b[_0xcbd6('0x11')]){if(_0x90383b[_0xcbd6('0x11')][_0xcbd6('0x12')]===0x1f4){logger[_0xcbd6('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x5504fa,_0x90383b[_0xcbd6('0x11')][_0xcbd6('0x13')]);return _0x53de76(_0x90383b[_0xcbd6('0x11')]['message']);}logger[_0xcbd6('0x11')](_0xcbd6('0xd'),_0x5504fa,_0x90383b['error'][_0xcbd6('0x13')]);return _0x69fa3e(_0x90383b[_0xcbd6('0x11')][_0xcbd6('0x13')]);}else{logger[_0xcbd6('0x14')](_0xcbd6('0xd'),_0x5504fa,_0xcbd6('0x15'));_0x69fa3e(_0x90383b[_0xcbd6('0x16')][_0xcbd6('0x13')]);}})[_0xcbd6('0x17')](function(_0xdb9a77){logger[_0xcbd6('0x11')](_0xcbd6('0xd'),_0x5504fa,_0xdb9a77);_0x53de76(_0xdb9a77);});});}
\ No newline at end of file
+var _0x0df2=['message','info','result','catch','SugarcrmField,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x41cbed,_0x5a7074){var _0x6b00fb=function(_0x463151){while(--_0x463151){_0x41cbed['push'](_0x41cbed['shift']());}};_0x6b00fb(++_0x5a7074);}(_0x0df2,0xcb));var _0x20df=function(_0x2dfa69,_0x5c0938){_0x2dfa69=_0x2dfa69-0x0;var _0x1823e2=_0x0df2[_0x2dfa69];return _0x1823e2;};'use strict';var _=require(_0x20df('0x0'));var util=require('util');var moment=require(_0x20df('0x1'));var BPromise=require(_0x20df('0x2'));var rs=require(_0x20df('0x3'));var fs=require('fs');var Redis=require(_0x20df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20df('0x5'));var logger=require(_0x20df('0x6'))(_0x20df('0x7'));var config=require(_0x20df('0x8'));var jayson=require(_0x20df('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42bf1c,_0x5b0fd5,_0x33a383){return new BPromise(function(_0x10adee,_0x4a8bda){return client[_0x20df('0xa')](_0x42bf1c,_0x33a383)[_0x20df('0xb')](function(_0x43225d){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x5b0fd5,_0x20df('0xc'));logger[_0x20df('0xd')](_0x20df('0xe'),_0x5b0fd5,_0x20df('0xc'),JSON[_0x20df('0xf')](_0x43225d));if(_0x43225d[_0x20df('0x10')]){if(_0x43225d[_0x20df('0x10')]['code']===0x1f4){logger[_0x20df('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x5b0fd5,_0x43225d[_0x20df('0x10')][_0x20df('0x11')]);return _0x4a8bda(_0x43225d[_0x20df('0x10')][_0x20df('0x11')]);}logger[_0x20df('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x5b0fd5,_0x43225d[_0x20df('0x10')][_0x20df('0x11')]);return _0x10adee(_0x43225d[_0x20df('0x10')][_0x20df('0x11')]);}else{logger[_0x20df('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x5b0fd5,_0x20df('0xc'));_0x10adee(_0x43225d[_0x20df('0x13')]['message']);}})[_0x20df('0x14')](function(_0x8ee4b1){logger['error'](_0x20df('0x15'),_0x5b0fd5,_0x8ee4b1);_0x4a8bda(_0x8ee4b1);});});}
\ No newline at end of file
index f5c3f09..b7ab544 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98e1=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0x98e1,0x160));var _0x198e=function(_0x5a6863,_0x156282){_0x5a6863=_0x5a6863-0x0;var _0x17b19e=_0x98e1[_0x5a6863];return _0x17b19e;};'use strict';var multer=require('multer');var util=require(_0x198e('0x0'));var path=require(_0x198e('0x1'));var timeout=require(_0x198e('0x2'));var express=require(_0x198e('0x3'));var router=express['Router']();var fs_extra=require(_0x198e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x198e('0x5'));var controller=require(_0x198e('0x6'));router[_0x198e('0x7')]('/',auth[_0x198e('0x8')](),controller['index']);router['get'](_0x198e('0x9'),auth['isAuthenticated'](),controller[_0x198e('0xa')]);router['get'](_0x198e('0xb'),auth[_0x198e('0x8')](),controller[_0x198e('0xc')]);router[_0x198e('0x7')](_0x198e('0xd'),auth[_0x198e('0x8')](),controller[_0x198e('0xe')]);router[_0x198e('0xf')]('/',auth[_0x198e('0x8')](),controller['create']);router[_0x198e('0xf')](_0x198e('0xb'),auth['isAuthenticated'](),controller[_0x198e('0x10')]);router['put'](_0x198e('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x198e('0x8')](),controller[_0x198e('0x11')]);module[_0x198e('0x12')]=router;
\ No newline at end of file
+var _0x1eaa=['connect-timeout','express','fs-extra','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','/:id','update','delete','exports','multer'];(function(_0x9be86d,_0x2ba56a){var _0x239f44=function(_0x4e9921){while(--_0x4e9921){_0x9be86d['push'](_0x9be86d['shift']());}};_0x239f44(++_0x2ba56a);}(_0x1eaa,0x1c7));var _0xa1ea=function(_0x779e96,_0x12508f){_0x779e96=_0x779e96-0x0;var _0x3ce41e=_0x1eaa[_0x779e96];return _0x3ce41e;};'use strict';var multer=require(_0xa1ea('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa1ea('0x1'));var express=require(_0xa1ea('0x2'));var router=express['Router']();var fs_extra=require(_0xa1ea('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa1ea('0x4'));var controller=require(_0xa1ea('0x5'));router['get']('/',auth[_0xa1ea('0x6')](),controller[_0xa1ea('0x7')]);router[_0xa1ea('0x8')]('/:id',auth[_0xa1ea('0x6')](),controller['show']);router['get'](_0xa1ea('0x9'),auth[_0xa1ea('0x6')](),controller[_0xa1ea('0xa')]);router[_0xa1ea('0x8')](_0xa1ea('0xb'),auth[_0xa1ea('0x6')](),controller[_0xa1ea('0xc')]);router['post']('/',auth[_0xa1ea('0x6')](),controller['create']);router['post'](_0xa1ea('0x9'),auth['isAuthenticated'](),controller[_0xa1ea('0xd')]);router[_0xa1ea('0xe')](_0xa1ea('0xf'),auth[_0xa1ea('0x6')](),controller[_0xa1ea('0x10')]);router[_0xa1ea('0x11')](_0xa1ea('0xf'),auth[_0xa1ea('0x6')](),controller['destroy']);module[_0xa1ea('0x12')]=router;
\ No newline at end of file
index ab9ce1e..58fbf48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4620=['sequelize','exports','STRING','HelpDesk'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x4620,0x138));var _0x0462=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x4620[_0x44b3bd];return _0x1efc4a;};'use strict';var Sequelize=require(_0x0462('0x0'));module[_0x0462('0x1')]={'name':{'type':Sequelize[_0x0462('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0462('0x2')]},'username':{'type':Sequelize[_0x0462('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0462('0x2')],'allowNull':![],'defaultValue':_0x0462('0x3')},'remoteUri':{'type':Sequelize[_0x0462('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0462('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x2589=['STRING','HelpDesk','sequelize','exports'];(function(_0x118189,_0x2f6ef0){var _0x44f3e9=function(_0x103823){while(--_0x103823){_0x118189['push'](_0x118189['shift']());}};_0x44f3e9(++_0x2f6ef0);}(_0x2589,0x14a));var _0x9258=function(_0x345232,_0x88a652){_0x345232=_0x345232-0x0;var _0x5db5d1=_0x2589[_0x345232];return _0x5db5d1;};'use strict';var Sequelize=require(_0x9258('0x0'));module[_0x9258('0x1')]={'name':{'type':Sequelize[_0x9258('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9258('0x2')]},'username':{'type':Sequelize[_0x9258('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9258('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9258('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x9258('0x2')],'allowNull':![]}};
\ No newline at end of file
index a90f9d1..ab027f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf17=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','findOne','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','result','token','describe','autogenerated','owner','includes','editable','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','destroy','then','error','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','map','query','filters','intersection','model'];(function(_0x2deed4,_0x2793e8){var _0xfb91f4=function(_0x31cb98){while(--_0x31cb98){_0x2deed4['push'](_0x2deed4['shift']());}};_0xfb91f4(++_0x2793e8);}(_0xcf17,0x193));var _0x7cf1=function(_0x2b3a37,_0x5f0075){_0x2b3a37=_0x2b3a37-0x0;var _0x52adff=_0xcf17[_0x2b3a37];return _0x52adff;};'use strict';var emlformat=require(_0x7cf1('0x0'));var rimraf=require(_0x7cf1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7cf1('0x2'));var moment=require(_0x7cf1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7cf1('0x4'));var util=require(_0x7cf1('0x5'));var path=require(_0x7cf1('0x6'));var sox=require(_0x7cf1('0x7'));var csv=require(_0x7cf1('0x8'));var ejs=require(_0x7cf1('0x9'));var fs=require('fs');var fs_extra=require(_0x7cf1('0xa'));var _=require('lodash');var squel=require(_0x7cf1('0xb'));var crypto=require('crypto');var jsforce=require(_0x7cf1('0xc'));var deskjs=require(_0x7cf1('0xd'));var toCsv=require(_0x7cf1('0x8'));var querystring=require('querystring');var Papa=require(_0x7cf1('0xe'));var Redis=require(_0x7cf1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7cf1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7cf1('0x11'));var config=require(_0x7cf1('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7cf1('0x13'))['db'];var integrations=require(_0x7cf1('0x14'));function respondWithStatusCode(_0x1950fe,_0x5c77f1){_0x5c77f1=_0x5c77f1||0xcc;return function(_0x24c745){if(_0x24c745){return _0x1950fe[_0x7cf1('0x15')](_0x5c77f1);}return _0x1950fe[_0x7cf1('0x16')](_0x5c77f1)[_0x7cf1('0x17')]();};}function respondWithResult(_0x51f2b9,_0x4725cb){_0x4725cb=_0x4725cb||0xc8;return function(_0x4aae69){if(_0x4aae69){return _0x51f2b9[_0x7cf1('0x16')](_0x4725cb)['json'](_0x4aae69);}};}function respondWithFilteredResult(_0x2c1aa8,_0x117e7e){return function(_0x54a29f){if(_0x54a29f){var _0x50cf6d=typeof _0x117e7e['offset']===_0x7cf1('0x18')&&typeof _0x117e7e[_0x7cf1('0x19')]===_0x7cf1('0x18');var _0x2cd991=_0x54a29f[_0x7cf1('0x1a')];var _0x4448e2=_0x50cf6d?0x0:_0x117e7e[_0x7cf1('0x1b')];var _0x56d20c=_0x50cf6d?_0x54a29f[_0x7cf1('0x1a')]:_0x117e7e['offset']+_0x117e7e[_0x7cf1('0x19')];var _0x162644;if(_0x56d20c>=_0x2cd991){_0x56d20c=_0x2cd991;_0x162644=0xc8;}else{_0x162644=0xce;}_0x2c1aa8[_0x7cf1('0x16')](_0x162644);return _0x2c1aa8['set'](_0x7cf1('0x1c'),_0x4448e2+'-'+_0x56d20c+'/'+_0x2cd991)[_0x7cf1('0x1d')](_0x54a29f);}return null;};}function patchUpdates(_0x1a1a69){return function(_0x3fde63){try{jsonpatch[_0x7cf1('0x1e')](_0x3fde63,_0x1a1a69,!![]);}catch(_0x2e15ba){return BPromise['reject'](_0x2e15ba);}return _0x3fde63[_0x7cf1('0x1f')]();};}function saveUpdates(_0x5d5231,_0x217108){return function(_0x35c459){if(_0x35c459){return _0x35c459[_0x7cf1('0x20')](_0x5d5231)['then'](function(_0x77875f){return _0x77875f;});}return null;};}function removeEntity(_0x2fa36b,_0x40f788){return function(_0x2a04d1){if(_0x2a04d1){return _0x2a04d1[_0x7cf1('0x21')]()[_0x7cf1('0x22')](function(){_0x2fa36b[_0x7cf1('0x16')](0xcc)[_0x7cf1('0x17')]();});}};}function handleEntityNotFound(_0x541756,_0x4c5295){return function(_0x2a653f){if(!_0x2a653f){_0x541756['sendStatus'](0x194);}return _0x2a653f;};}function handleError(_0x4ead96,_0x3964bf){_0x3964bf=_0x3964bf||0x1f4;return function(_0x4831a6){logger[_0x7cf1('0x23')](_0x4831a6['stack']);if(_0x4831a6[_0x7cf1('0x24')]){delete _0x4831a6[_0x7cf1('0x24')];}_0x4ead96['status'](_0x3964bf)[_0x7cf1('0x25')](_0x4831a6);};}exports[_0x7cf1('0x26')]=function(_0xb955ee,_0x2334f0){var _0x3f72cf={},_0x56a7bf={},_0x1eddd1={'count':0x0,'rows':[]};var _0x58d8f3=_['map'](db[_0x7cf1('0x27')][_0x7cf1('0x28')],function(_0x26e0ac){return{'name':_0x26e0ac[_0x7cf1('0x29')],'type':_0x26e0ac[_0x7cf1('0x2a')][_0x7cf1('0x2b')]};});_0x56a7bf['model']=_[_0x7cf1('0x2c')](_0x58d8f3,_0x7cf1('0x24'));_0x56a7bf[_0x7cf1('0x2d')]=_['keys'](_0xb955ee[_0x7cf1('0x2d')]);_0x56a7bf[_0x7cf1('0x2e')]=_[_0x7cf1('0x2f')](_0x56a7bf[_0x7cf1('0x30')],_0x56a7bf[_0x7cf1('0x2d')]);_0x3f72cf['attributes']=_['intersection'](_0x56a7bf[_0x7cf1('0x30')],qs['fields'](_0xb955ee[_0x7cf1('0x2d')][_0x7cf1('0x31')]));_0x3f72cf[_0x7cf1('0x32')]=_0x3f72cf[_0x7cf1('0x32')][_0x7cf1('0x33')]?_0x3f72cf[_0x7cf1('0x32')]:_0x56a7bf['model'];if(!_0xb955ee[_0x7cf1('0x2d')][_0x7cf1('0x34')](_0x7cf1('0x35'))){_0x3f72cf[_0x7cf1('0x19')]=qs[_0x7cf1('0x19')](_0xb955ee[_0x7cf1('0x2d')][_0x7cf1('0x19')]);_0x3f72cf[_0x7cf1('0x1b')]=qs['offset'](_0xb955ee['query'][_0x7cf1('0x1b')]);}_0x3f72cf[_0x7cf1('0x36')]=qs[_0x7cf1('0x37')](_0xb955ee[_0x7cf1('0x2d')][_0x7cf1('0x37')]);_0x3f72cf[_0x7cf1('0x38')]=qs[_0x7cf1('0x2e')](_[_0x7cf1('0x39')](_0xb955ee[_0x7cf1('0x2d')],_0x56a7bf['filters']),_0x58d8f3);if(_0xb955ee['query']['filter']){_0x3f72cf[_0x7cf1('0x38')]=_['merge'](_0x3f72cf['where'],{'$or':_['map'](_0x58d8f3,function(_0x247a3e){if(_0x247a3e[_0x7cf1('0x2a')]!=='VIRTUAL'){var _0x192efd={};_0x192efd[_0x247a3e[_0x7cf1('0x24')]]={'$like':'%'+_0xb955ee[_0x7cf1('0x2d')][_0x7cf1('0x3a')]+'%'};return _0x192efd;}})});}_0x3f72cf=_[_0x7cf1('0x3b')]({},_0x3f72cf,_0xb955ee['options']);var _0x40bafe={'where':_0x3f72cf[_0x7cf1('0x38')]};return db[_0x7cf1('0x27')][_0x7cf1('0x1a')](_0x40bafe)['then'](function(_0x3d0bd4){_0x1eddd1['count']=_0x3d0bd4;if(_0xb955ee[_0x7cf1('0x2d')]['includeAll']){_0x3f72cf[_0x7cf1('0x3c')]=[{'all':!![]}];}return db['VtigerAccount'][_0x7cf1('0x3d')](_0x3f72cf);})[_0x7cf1('0x22')](function(_0x454869){_0x1eddd1[_0x7cf1('0x3e')]=_0x454869;return _0x1eddd1;})['then'](respondWithFilteredResult(_0x2334f0,_0x3f72cf))[_0x7cf1('0x3f')](handleError(_0x2334f0,null));};exports[_0x7cf1('0x40')]=function(_0xb06d77,_0xaaaff8){var _0x184610={'raw':![],'where':{'id':_0xb06d77['params']['id']}},_0x203cb1={};_0x203cb1[_0x7cf1('0x30')]=_[_0x7cf1('0x41')](db[_0x7cf1('0x27')]['rawAttributes']);_0x203cb1[_0x7cf1('0x2d')]=_['keys'](_0xb06d77[_0x7cf1('0x2d')]);_0x203cb1[_0x7cf1('0x2e')]=_[_0x7cf1('0x2f')](_0x203cb1[_0x7cf1('0x30')],_0x203cb1['query']);_0x184610[_0x7cf1('0x32')]=_['intersection'](_0x203cb1[_0x7cf1('0x30')],qs['fields'](_0xb06d77[_0x7cf1('0x2d')]['fields']));_0x184610[_0x7cf1('0x32')]=_0x184610[_0x7cf1('0x32')][_0x7cf1('0x33')]?_0x184610['attributes']:_0x203cb1['model'];if(_0xb06d77[_0x7cf1('0x2d')][_0x7cf1('0x42')]){_0x184610['include']=[{'all':!![]}];}_0x184610=_['merge']({},_0x184610,_0xb06d77['options']);return db[_0x7cf1('0x27')][_0x7cf1('0x43')](_0x184610)[_0x7cf1('0x22')](handleEntityNotFound(_0xaaaff8,null))[_0x7cf1('0x22')](respondWithResult(_0xaaaff8,null))[_0x7cf1('0x3f')](handleError(_0xaaaff8,null));};exports[_0x7cf1('0x44')]=function(_0x2ac4c9,_0x5c73ee){return db[_0x7cf1('0x27')][_0x7cf1('0x44')](_0x2ac4c9['body'],{})[_0x7cf1('0x22')](respondWithResult(_0x5c73ee,0xc9))['catch'](handleError(_0x5c73ee,null));};exports[_0x7cf1('0x20')]=function(_0x17d70e,_0x11ab3b){if(_0x17d70e[_0x7cf1('0x45')]['id']){delete _0x17d70e[_0x7cf1('0x45')]['id'];}return db['VtigerAccount'][_0x7cf1('0x43')]({'where':{'id':_0x17d70e[_0x7cf1('0x46')]['id']}})[_0x7cf1('0x22')](handleEntityNotFound(_0x11ab3b,null))['then'](saveUpdates(_0x17d70e['body'],null))['then'](respondWithResult(_0x11ab3b,null))['catch'](handleError(_0x11ab3b,null));};exports['destroy']=function(_0x15842d,_0x4c2786){return db['VtigerAccount'][_0x7cf1('0x43')]({'where':{'id':_0x15842d[_0x7cf1('0x46')]['id']}})[_0x7cf1('0x22')](handleEntityNotFound(_0x4c2786,null))[_0x7cf1('0x22')](removeEntity(_0x4c2786,null))[_0x7cf1('0x3f')](handleError(_0x4c2786,null));};exports['getConfigurations']=function(_0x45d0f3,_0x18f1f9,_0x555f04){var _0xdbe106={};var _0x3f1d2b={};var _0x260069;var _0x216f09;return db['VtigerAccount'][_0x7cf1('0x47')]({'where':{'id':_0x45d0f3[_0x7cf1('0x46')]['id']}})[_0x7cf1('0x22')](handleEntityNotFound(_0x18f1f9,null))[_0x7cf1('0x22')](function(_0x9ecb08){if(_0x9ecb08){_0x260069=_0x9ecb08;_0x3f1d2b[_0x7cf1('0x30')]=_['keys'](db['VtigerConfiguration'][_0x7cf1('0x28')]);_0x3f1d2b['query']=_[_0x7cf1('0x41')](_0x45d0f3['query']);_0x3f1d2b[_0x7cf1('0x2e')]=_[_0x7cf1('0x2f')](_0x3f1d2b[_0x7cf1('0x30')],_0x3f1d2b[_0x7cf1('0x2d')]);_0xdbe106[_0x7cf1('0x32')]=_[_0x7cf1('0x2f')](_0x3f1d2b[_0x7cf1('0x30')],qs[_0x7cf1('0x31')](_0x45d0f3[_0x7cf1('0x2d')][_0x7cf1('0x31')]));_0xdbe106[_0x7cf1('0x32')]=_0xdbe106['attributes']['length']?_0xdbe106[_0x7cf1('0x32')]:_0x3f1d2b['model'];_0xdbe106['order']=qs[_0x7cf1('0x37')](_0x45d0f3[_0x7cf1('0x2d')][_0x7cf1('0x37')]);_0xdbe106[_0x7cf1('0x38')]=qs[_0x7cf1('0x2e')](_[_0x7cf1('0x39')](_0x45d0f3[_0x7cf1('0x2d')],_0x3f1d2b['filters']));if(_0x45d0f3[_0x7cf1('0x2d')]['filter']){_0xdbe106[_0x7cf1('0x38')]=_['merge'](_0xdbe106[_0x7cf1('0x38')],{'$or':_['map'](_0xdbe106[_0x7cf1('0x32')],function(_0x91c963){var _0x4333b6={};_0x4333b6[_0x91c963]={'$like':'%'+_0x45d0f3[_0x7cf1('0x2d')]['filter']+'%'};return _0x4333b6;})});}_0xdbe106=_[_0x7cf1('0x3b')]({},_0xdbe106,_0x45d0f3['options']);return _0x260069[_0x7cf1('0x48')](_0xdbe106);}})[_0x7cf1('0x22')](function(_0x52fc3e){if(_0x52fc3e){_0x216f09=_0x52fc3e[_0x7cf1('0x33')];if(!_0x45d0f3[_0x7cf1('0x2d')][_0x7cf1('0x34')](_0x7cf1('0x35'))){_0xdbe106['limit']=qs[_0x7cf1('0x19')](_0x45d0f3[_0x7cf1('0x2d')][_0x7cf1('0x19')]);_0xdbe106[_0x7cf1('0x1b')]=qs['offset'](_0x45d0f3[_0x7cf1('0x2d')][_0x7cf1('0x1b')]);}return _0x260069['getConfigurations'](_0xdbe106);}})['then'](function(_0x17984b){if(_0x17984b){return _0x17984b?{'count':_0x216f09,'rows':_0x17984b}:null;}})[_0x7cf1('0x22')](respondWithResult(_0x18f1f9,null))[_0x7cf1('0x3f')](handleError(_0x18f1f9,null));};exports['addConfiguration']=function(_0xa6db94,_0x1f9eb5,_0x7600f1){if(_0xa6db94[_0x7cf1('0x45')]['id']){delete _0xa6db94['body']['id'];}return db[_0x7cf1('0x27')][_0x7cf1('0x47')]({'where':{'id':_0xa6db94[_0x7cf1('0x46')]['id']}})[_0x7cf1('0x22')](handleEntityNotFound(_0x1f9eb5,null))[_0x7cf1('0x22')](function(_0x4f27de){if(_0x4f27de){_0xa6db94[_0x7cf1('0x45')]['AccountId']=_0x4f27de['id'];_0xa6db94[_0x7cf1('0x45')][_0x7cf1('0x49')]=integrations[_0x7cf1('0x4a')](_0xa6db94[_0x7cf1('0x45')][_0x7cf1('0x4b')],_0xa6db94[_0x7cf1('0x45')][_0x7cf1('0x2a')]);_0xa6db94[_0x7cf1('0x45')][_0x7cf1('0x4c')]=integrations[_0x7cf1('0x4d')](_0xa6db94[_0x7cf1('0x45')]['channel'],_0xa6db94['body'][_0x7cf1('0x2a')]);return db[_0x7cf1('0x4e')][_0x7cf1('0x44')](_0xa6db94[_0x7cf1('0x45')],{'include':[{'model':db[_0x7cf1('0x4f')],'as':_0x7cf1('0x49')},{'model':db[_0x7cf1('0x4f')],'as':_0x7cf1('0x4c')}]});}return null;})[_0x7cf1('0x22')](respondWithResult(_0x1f9eb5,null))[_0x7cf1('0x3f')](handleError(_0x1f9eb5,null));};var md5=require('md5');exports[_0x7cf1('0x50')]=function(_0x3bf9e6,_0x379e32,_0x3a0274){var _0x1713bd=null;var _0x4fc192=null;var _0x5ba191=null;var _0x14f23c=null;var _0x521aa0='';return db[_0x7cf1('0x27')]['findOne']({'where':{'id':_0x3bf9e6['params']['id']},'attributes':['id','name',_0x7cf1('0x51'),_0x7cf1('0x52'),_0x7cf1('0x53'),'remoteUri',_0x7cf1('0x54'),'accessKey']})['then'](handleEntityNotFound(_0x379e32,null))[_0x7cf1('0x22')](function(_0x4fa9ad){if(_0x4fa9ad){_0x1713bd=_0x4fa9ad[_0x7cf1('0x51')];_0x4fc192=_0x4fa9ad[_0x7cf1('0x55')];_0x5ba191=_0x4fa9ad[_0x7cf1('0x53')];_0x521aa0=_0x4fa9ad[_0x7cf1('0x56')];var _0x119ccd=_0x521aa0[_0x7cf1('0x57')](-0x1);if(_0x119ccd==='/'){_0x521aa0=_0x521aa0[_0x7cf1('0x58')](0x0,_0x521aa0[_0x7cf1('0x59')](_0x119ccd));}_0x14f23c=util[_0x7cf1('0x5a')]('%s/webservice.php',_0x521aa0);var _0x4c032a={'method':_0x7cf1('0x5b'),'uri':_0x14f23c,'qs':{'operation':_0x7cf1('0x5c'),'username':_0x4fa9ad[_0x7cf1('0x51')]},'json':!![]};return rp(_0x4c032a);}})[_0x7cf1('0x22')](function(_0x1861d3){if(_0x1861d3[_0x7cf1('0x5d')]){var _0x34d1c8={'method':_0x7cf1('0x5e'),'uri':_0x14f23c,'form':{'operation':_0x7cf1('0x5f'),'username':_0x1713bd,'accessKey':md5(_0x1861d3[_0x7cf1('0x60')][_0x7cf1('0x61')]+_0x4fc192)},'json':!![]};return rp(_0x34d1c8);}})['then'](function(_0x19d2e3){if(_0x19d2e3['success']){var _0x3403de={'method':'GET','uri':_0x14f23c,'qs':{'operation':_0x7cf1('0x62'),'username':_0x1713bd,'sessionName':_0x19d2e3[_0x7cf1('0x60')]['sessionName'],'elementType':_0x5ba191},'json':!![]};return rp(_0x3403de);}})['then'](function(_0x1ee4f2){if(_0x1ee4f2[_0x7cf1('0x5d')]){var _0x5616d3=[_0x7cf1('0x63'),'reference',_0x7cf1('0x64')];_['remove'](_0x1ee4f2[_0x7cf1('0x60')][_0x7cf1('0x31')],function(_0x12931f){return _0x5616d3[_0x7cf1('0x65')](_0x12931f[_0x7cf1('0x2a')][_0x7cf1('0x24')]);});_['remove'](_0x1ee4f2['result'][_0x7cf1('0x31')],function(_0x10de3d){return _0x10de3d[_0x7cf1('0x66')]==='false';});return{'count':_0x1ee4f2[_0x7cf1('0x60')][_0x7cf1('0x31')][_0x7cf1('0x33')],'rows':_[_0x7cf1('0x2c')](_0x1ee4f2[_0x7cf1('0x60')][_0x7cf1('0x31')],function(_0x5831e2){return{'id':_0x5831e2['name'],'name':_0x5831e2['label'],'custom':_['startsWith'](_0x5831e2[_0x7cf1('0x24')],_0x7cf1('0x67'))?!![]:![],'options':_0x5831e2['type'][_0x7cf1('0x24')]===_0x7cf1('0x68')&&_0x5831e2[_0x7cf1('0x2a')][_0x7cf1('0x69')]['length']>0x0?_[_0x7cf1('0x2c')](_0x5831e2[_0x7cf1('0x2a')][_0x7cf1('0x69')],function(_0x4df0d2){return{'name':_0x4df0d2['label'],'value':_0x4df0d2[_0x7cf1('0x6a')]};}):[]};})};}})['then'](respondWithResult(_0x379e32,null))['catch'](function(_0xabafd){console[_0x7cf1('0x6b')](_0x7cf1('0x6c')+_0xabafd);var _0x3b8927=_0x3bf9e6[_0x7cf1('0x2d')][_0x7cf1('0x6d')]?0x1f4:_0xabafd['statusCode']||0x1f4;logger[_0x7cf1('0x23')](_0x7cf1('0x6e'),'getFields',_0x3b8927,JSON['stringify'](_0xabafd));delete _0xabafd[_0x7cf1('0x24')];if(_0x3b8927===0x191){_0x3b8927=0x190;}_0x379e32['status'](_0x3b8927)[_0x7cf1('0x25')](_0x3bf9e6['query']['test']?{'message':_0x7cf1('0x6f'),'statusCode':_0xabafd[_0x7cf1('0x70')]}:_0xabafd);});};
\ No newline at end of file
+var _0x5754=['to-csv','ejs','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','findOne','VtigerConfiguration','order','getConfigurations','hasOwnProperty','getSubjects','Descriptions','getDescriptions','channel','Subjects','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','describe','sessionName','reference','owner','remove','includes','startsWith','cf_','picklist','picklistValues','label','value','vTiger\x20error:\x20','test','getFields','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox'];(function(_0x1ddf3a,_0x4f0cbc){var _0xcb6401=function(_0x9c1dce){while(--_0x9c1dce){_0x1ddf3a['push'](_0x1ddf3a['shift']());}};_0xcb6401(++_0x4f0cbc);}(_0x5754,0xdd));var _0x4575=function(_0x17a7be,_0x14a035){_0x17a7be=_0x17a7be-0x0;var _0x577ad6=_0x5754[_0x17a7be];return _0x577ad6;};'use strict';var emlformat=require(_0x4575('0x0'));var rimraf=require(_0x4575('0x1'));var zipdir=require(_0x4575('0x2'));var jsonpatch=require(_0x4575('0x3'));var rp=require(_0x4575('0x4'));var moment=require('moment');var BPromise=require(_0x4575('0x5'));var Mustache=require(_0x4575('0x6'));var util=require(_0x4575('0x7'));var path=require('path');var sox=require(_0x4575('0x8'));var csv=require(_0x4575('0x9'));var ejs=require(_0x4575('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4575('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4575('0xc'));var deskjs=require(_0x4575('0xd'));var toCsv=require(_0x4575('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4575('0xe'));var qs=require(_0x4575('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4575('0x10'));var logger=require(_0x4575('0x11'))(_0x4575('0x12'));var utils=require('../../config/utils');var config=require(_0x4575('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4575('0x14'))['db'];var integrations=require(_0x4575('0x15'));function respondWithStatusCode(_0x31573e,_0x42c793){_0x42c793=_0x42c793||0xcc;return function(_0x23d129){if(_0x23d129){return _0x31573e[_0x4575('0x16')](_0x42c793);}return _0x31573e[_0x4575('0x17')](_0x42c793)[_0x4575('0x18')]();};}function respondWithResult(_0x5d4328,_0x5c6782){_0x5c6782=_0x5c6782||0xc8;return function(_0x307281){if(_0x307281){return _0x5d4328['status'](_0x5c6782)[_0x4575('0x19')](_0x307281);}};}function respondWithFilteredResult(_0x2bfaa7,_0x215d99){return function(_0x7e2ebd){if(_0x7e2ebd){var _0x37bf63=typeof _0x215d99[_0x4575('0x1a')]===_0x4575('0x1b')&&typeof _0x215d99[_0x4575('0x1c')]===_0x4575('0x1b');var _0x152082=_0x7e2ebd[_0x4575('0x1d')];var _0x2e617e=_0x37bf63?0x0:_0x215d99['offset'];var _0x12c9b2=_0x37bf63?_0x7e2ebd[_0x4575('0x1d')]:_0x215d99[_0x4575('0x1a')]+_0x215d99[_0x4575('0x1c')];var _0x8b5b18;if(_0x12c9b2>=_0x152082){_0x12c9b2=_0x152082;_0x8b5b18=0xc8;}else{_0x8b5b18=0xce;}_0x2bfaa7[_0x4575('0x17')](_0x8b5b18);return _0x2bfaa7[_0x4575('0x1e')](_0x4575('0x1f'),_0x2e617e+'-'+_0x12c9b2+'/'+_0x152082)[_0x4575('0x19')](_0x7e2ebd);}return null;};}function patchUpdates(_0x113f16){return function(_0x51e38d){try{jsonpatch[_0x4575('0x20')](_0x51e38d,_0x113f16,!![]);}catch(_0x546367){return BPromise['reject'](_0x546367);}return _0x51e38d['save']();};}function saveUpdates(_0x33b98c,_0x267ccc){return function(_0x5bac40){if(_0x5bac40){return _0x5bac40[_0x4575('0x21')](_0x33b98c)[_0x4575('0x22')](function(_0x446b97){return _0x446b97;});}return null;};}function removeEntity(_0xe3f18e,_0xcb35a3){return function(_0xab3a28){if(_0xab3a28){return _0xab3a28[_0x4575('0x23')]()[_0x4575('0x22')](function(){_0xe3f18e['status'](0xcc)[_0x4575('0x18')]();});}};}function handleEntityNotFound(_0x476e6a,_0x1545a4){return function(_0x3ee03c){if(!_0x3ee03c){_0x476e6a[_0x4575('0x16')](0x194);}return _0x3ee03c;};}function handleError(_0x565848,_0x4c468c){_0x4c468c=_0x4c468c||0x1f4;return function(_0x506c31){logger[_0x4575('0x24')](_0x506c31[_0x4575('0x25')]);if(_0x506c31[_0x4575('0x26')]){delete _0x506c31[_0x4575('0x26')];}_0x565848['status'](_0x4c468c)[_0x4575('0x27')](_0x506c31);};}exports[_0x4575('0x28')]=function(_0x34febb,_0x83a178){var _0x139bbf={},_0xe2e1a2={},_0x4f9e85={'count':0x0,'rows':[]};var _0x23acf2=_[_0x4575('0x29')](db[_0x4575('0x2a')][_0x4575('0x2b')],function(_0xddda5e){return{'name':_0xddda5e[_0x4575('0x2c')],'type':_0xddda5e[_0x4575('0x2d')][_0x4575('0x2e')]};});_0xe2e1a2[_0x4575('0x2f')]=_[_0x4575('0x29')](_0x23acf2,_0x4575('0x26'));_0xe2e1a2[_0x4575('0x30')]=_[_0x4575('0x31')](_0x34febb[_0x4575('0x30')]);_0xe2e1a2[_0x4575('0x32')]=_[_0x4575('0x33')](_0xe2e1a2['model'],_0xe2e1a2[_0x4575('0x30')]);_0x139bbf[_0x4575('0x34')]=_['intersection'](_0xe2e1a2[_0x4575('0x2f')],qs[_0x4575('0x35')](_0x34febb[_0x4575('0x30')][_0x4575('0x35')]));_0x139bbf[_0x4575('0x34')]=_0x139bbf[_0x4575('0x34')][_0x4575('0x36')]?_0x139bbf[_0x4575('0x34')]:_0xe2e1a2[_0x4575('0x2f')];if(!_0x34febb[_0x4575('0x30')]['hasOwnProperty'](_0x4575('0x37'))){_0x139bbf[_0x4575('0x1c')]=qs['limit'](_0x34febb[_0x4575('0x30')][_0x4575('0x1c')]);_0x139bbf['offset']=qs['offset'](_0x34febb[_0x4575('0x30')][_0x4575('0x1a')]);}_0x139bbf['order']=qs[_0x4575('0x38')](_0x34febb[_0x4575('0x30')]['sort']);_0x139bbf[_0x4575('0x39')]=qs[_0x4575('0x32')](_[_0x4575('0x3a')](_0x34febb[_0x4575('0x30')],_0xe2e1a2['filters']),_0x23acf2);if(_0x34febb[_0x4575('0x30')][_0x4575('0x3b')]){_0x139bbf[_0x4575('0x39')]=_['merge'](_0x139bbf[_0x4575('0x39')],{'$or':_[_0x4575('0x29')](_0x23acf2,function(_0x220035){if(_0x220035['type']!==_0x4575('0x3c')){var _0x3ca591={};_0x3ca591[_0x220035[_0x4575('0x26')]]={'$like':'%'+_0x34febb['query'][_0x4575('0x3b')]+'%'};return _0x3ca591;}})});}_0x139bbf=_['merge']({},_0x139bbf,_0x34febb[_0x4575('0x3d')]);var _0x24a757={'where':_0x139bbf[_0x4575('0x39')]};return db[_0x4575('0x2a')][_0x4575('0x1d')](_0x24a757)[_0x4575('0x22')](function(_0x1e096d){_0x4f9e85[_0x4575('0x1d')]=_0x1e096d;if(_0x34febb[_0x4575('0x30')][_0x4575('0x3e')]){_0x139bbf[_0x4575('0x3f')]=[{'all':!![]}];}return db[_0x4575('0x2a')][_0x4575('0x40')](_0x139bbf);})[_0x4575('0x22')](function(_0xe3b7c){_0x4f9e85[_0x4575('0x41')]=_0xe3b7c;return _0x4f9e85;})[_0x4575('0x22')](respondWithFilteredResult(_0x83a178,_0x139bbf))[_0x4575('0x42')](handleError(_0x83a178,null));};exports[_0x4575('0x43')]=function(_0x297362,_0x65149c){var _0x317a37={'raw':![],'where':{'id':_0x297362['params']['id']}},_0x40556c={};_0x40556c[_0x4575('0x2f')]=_['keys'](db[_0x4575('0x2a')][_0x4575('0x2b')]);_0x40556c['query']=_[_0x4575('0x31')](_0x297362[_0x4575('0x30')]);_0x40556c[_0x4575('0x32')]=_[_0x4575('0x33')](_0x40556c[_0x4575('0x2f')],_0x40556c[_0x4575('0x30')]);_0x317a37[_0x4575('0x34')]=_[_0x4575('0x33')](_0x40556c['model'],qs['fields'](_0x297362[_0x4575('0x30')][_0x4575('0x35')]));_0x317a37['attributes']=_0x317a37[_0x4575('0x34')]['length']?_0x317a37[_0x4575('0x34')]:_0x40556c[_0x4575('0x2f')];if(_0x297362['query'][_0x4575('0x3e')]){_0x317a37[_0x4575('0x3f')]=[{'all':!![]}];}_0x317a37=_['merge']({},_0x317a37,_0x297362[_0x4575('0x3d')]);return db['VtigerAccount'][_0x4575('0x44')](_0x317a37)['then'](handleEntityNotFound(_0x65149c,null))[_0x4575('0x22')](respondWithResult(_0x65149c,null))[_0x4575('0x42')](handleError(_0x65149c,null));};exports['create']=function(_0x524b72,_0x3e889b){return db['VtigerAccount'][_0x4575('0x45')](_0x524b72[_0x4575('0x46')],{})['then'](respondWithResult(_0x3e889b,0xc9))[_0x4575('0x42')](handleError(_0x3e889b,null));};exports[_0x4575('0x21')]=function(_0x5e6d90,_0x131066){if(_0x5e6d90['body']['id']){delete _0x5e6d90[_0x4575('0x46')]['id'];}return db[_0x4575('0x2a')][_0x4575('0x44')]({'where':{'id':_0x5e6d90[_0x4575('0x47')]['id']}})[_0x4575('0x22')](handleEntityNotFound(_0x131066,null))[_0x4575('0x22')](saveUpdates(_0x5e6d90[_0x4575('0x46')],null))[_0x4575('0x22')](respondWithResult(_0x131066,null))[_0x4575('0x42')](handleError(_0x131066,null));};exports[_0x4575('0x23')]=function(_0x26bcf7,_0x53a2e1){return db['VtigerAccount'][_0x4575('0x44')]({'where':{'id':_0x26bcf7[_0x4575('0x47')]['id']}})[_0x4575('0x22')](handleEntityNotFound(_0x53a2e1,null))['then'](removeEntity(_0x53a2e1,null))[_0x4575('0x42')](handleError(_0x53a2e1,null));};exports['getConfigurations']=function(_0x4acc6f,_0x3a92d3,_0x2ec9e1){var _0xe5a09b={};var _0x57652a={};var _0x123240;var _0x70ccd8;return db[_0x4575('0x2a')][_0x4575('0x48')]({'where':{'id':_0x4acc6f[_0x4575('0x47')]['id']}})[_0x4575('0x22')](handleEntityNotFound(_0x3a92d3,null))['then'](function(_0x814f8b){if(_0x814f8b){_0x123240=_0x814f8b;_0x57652a[_0x4575('0x2f')]=_[_0x4575('0x31')](db[_0x4575('0x49')][_0x4575('0x2b')]);_0x57652a['query']=_['keys'](_0x4acc6f[_0x4575('0x30')]);_0x57652a[_0x4575('0x32')]=_[_0x4575('0x33')](_0x57652a[_0x4575('0x2f')],_0x57652a[_0x4575('0x30')]);_0xe5a09b[_0x4575('0x34')]=_['intersection'](_0x57652a[_0x4575('0x2f')],qs['fields'](_0x4acc6f[_0x4575('0x30')][_0x4575('0x35')]));_0xe5a09b[_0x4575('0x34')]=_0xe5a09b['attributes'][_0x4575('0x36')]?_0xe5a09b[_0x4575('0x34')]:_0x57652a['model'];_0xe5a09b[_0x4575('0x4a')]=qs['sort'](_0x4acc6f['query'][_0x4575('0x38')]);_0xe5a09b[_0x4575('0x39')]=qs[_0x4575('0x32')](_[_0x4575('0x3a')](_0x4acc6f[_0x4575('0x30')],_0x57652a['filters']));if(_0x4acc6f[_0x4575('0x30')]['filter']){_0xe5a09b['where']=_['merge'](_0xe5a09b[_0x4575('0x39')],{'$or':_[_0x4575('0x29')](_0xe5a09b['attributes'],function(_0x6543d8){var _0x39868a={};_0x39868a[_0x6543d8]={'$like':'%'+_0x4acc6f[_0x4575('0x30')][_0x4575('0x3b')]+'%'};return _0x39868a;})});}_0xe5a09b=_['merge']({},_0xe5a09b,_0x4acc6f[_0x4575('0x3d')]);return _0x123240[_0x4575('0x4b')](_0xe5a09b);}})[_0x4575('0x22')](function(_0x44001d){if(_0x44001d){_0x70ccd8=_0x44001d['length'];if(!_0x4acc6f[_0x4575('0x30')][_0x4575('0x4c')](_0x4575('0x37'))){_0xe5a09b['limit']=qs[_0x4575('0x1c')](_0x4acc6f[_0x4575('0x30')]['limit']);_0xe5a09b[_0x4575('0x1a')]=qs[_0x4575('0x1a')](_0x4acc6f[_0x4575('0x30')][_0x4575('0x1a')]);}return _0x123240[_0x4575('0x4b')](_0xe5a09b);}})['then'](function(_0x3bd243){if(_0x3bd243){return _0x3bd243?{'count':_0x70ccd8,'rows':_0x3bd243}:null;}})[_0x4575('0x22')](respondWithResult(_0x3a92d3,null))['catch'](handleError(_0x3a92d3,null));};exports['addConfiguration']=function(_0x4e5350,_0x19a0de,_0x330b2a){if(_0x4e5350[_0x4575('0x46')]['id']){delete _0x4e5350[_0x4575('0x46')]['id'];}return db[_0x4575('0x2a')][_0x4575('0x48')]({'where':{'id':_0x4e5350[_0x4575('0x47')]['id']}})[_0x4575('0x22')](handleEntityNotFound(_0x19a0de,null))[_0x4575('0x22')](function(_0x52a05b){if(_0x52a05b){_0x4e5350[_0x4575('0x46')]['AccountId']=_0x52a05b['id'];_0x4e5350[_0x4575('0x46')]['Subjects']=integrations[_0x4575('0x4d')](_0x4e5350[_0x4575('0x46')]['channel'],_0x4e5350[_0x4575('0x46')][_0x4575('0x2d')]);_0x4e5350[_0x4575('0x46')][_0x4575('0x4e')]=integrations[_0x4575('0x4f')](_0x4e5350[_0x4575('0x46')][_0x4575('0x50')],_0x4e5350[_0x4575('0x46')][_0x4575('0x2d')]);return db['VtigerConfiguration'][_0x4575('0x45')](_0x4e5350[_0x4575('0x46')],{'include':[{'model':db['VtigerField'],'as':_0x4575('0x51')},{'model':db['VtigerField'],'as':_0x4575('0x4e')}]});}return null;})['then'](respondWithResult(_0x19a0de,null))['catch'](handleError(_0x19a0de,null));};var md5=require('md5');exports['getFields']=function(_0x12029e,_0x46a0b7,_0x13193e){var _0x1cf0d9=null;var _0x1170c4=null;var _0x520a83=null;var _0x232235=null;var _0x34fed7='';return db[_0x4575('0x2a')][_0x4575('0x48')]({'where':{'id':_0x12029e[_0x4575('0x47')]['id']},'attributes':['id','name',_0x4575('0x52'),'description',_0x4575('0x53'),_0x4575('0x54'),_0x4575('0x55'),_0x4575('0x56')]})[_0x4575('0x22')](handleEntityNotFound(_0x46a0b7,null))['then'](function(_0x54cc7d){if(_0x54cc7d){_0x1cf0d9=_0x54cc7d[_0x4575('0x52')];_0x1170c4=_0x54cc7d[_0x4575('0x56')];_0x520a83=_0x54cc7d['moduleName'];_0x34fed7=_0x54cc7d[_0x4575('0x54')];var _0x40a416=_0x34fed7[_0x4575('0x57')](-0x1);if(_0x40a416==='/'){_0x34fed7=_0x34fed7[_0x4575('0x58')](0x0,_0x34fed7[_0x4575('0x59')](_0x40a416));}_0x232235=util[_0x4575('0x5a')](_0x4575('0x5b'),_0x34fed7);var _0x37162a={'method':_0x4575('0x5c'),'uri':_0x232235,'qs':{'operation':'getchallenge','username':_0x54cc7d['username']},'json':!![]};return rp(_0x37162a);}})[_0x4575('0x22')](function(_0x442efe){if(_0x442efe[_0x4575('0x5d')]){var _0x36108a={'method':_0x4575('0x5e'),'uri':_0x232235,'form':{'operation':_0x4575('0x5f'),'username':_0x1cf0d9,'accessKey':md5(_0x442efe[_0x4575('0x60')][_0x4575('0x61')]+_0x1170c4)},'json':!![]};return rp(_0x36108a);}})[_0x4575('0x22')](function(_0x40e678){if(_0x40e678[_0x4575('0x5d')]){var _0x3a7104={'method':_0x4575('0x5c'),'uri':_0x232235,'qs':{'operation':_0x4575('0x62'),'username':_0x1cf0d9,'sessionName':_0x40e678[_0x4575('0x60')][_0x4575('0x63')],'elementType':_0x520a83},'json':!![]};return rp(_0x3a7104);}})['then'](function(_0x887788){if(_0x887788[_0x4575('0x5d')]){var _0x6744dc=['autogenerated',_0x4575('0x64'),_0x4575('0x65')];_[_0x4575('0x66')](_0x887788[_0x4575('0x60')][_0x4575('0x35')],function(_0x294030){return _0x6744dc[_0x4575('0x67')](_0x294030['type'][_0x4575('0x26')]);});_['remove'](_0x887788[_0x4575('0x60')][_0x4575('0x35')],function(_0x1d6bf5){return _0x1d6bf5['editable']==='false';});return{'count':_0x887788[_0x4575('0x60')]['fields'][_0x4575('0x36')],'rows':_['map'](_0x887788[_0x4575('0x60')]['fields'],function(_0x4a7bb8){return{'id':_0x4a7bb8['name'],'name':_0x4a7bb8['label'],'custom':_[_0x4575('0x68')](_0x4a7bb8['name'],_0x4575('0x69'))?!![]:![],'options':_0x4a7bb8['type'][_0x4575('0x26')]===_0x4575('0x6a')&&_0x4a7bb8[_0x4575('0x2d')][_0x4575('0x6b')][_0x4575('0x36')]>0x0?_[_0x4575('0x29')](_0x4a7bb8[_0x4575('0x2d')][_0x4575('0x6b')],function(_0x2dd928){return{'name':_0x2dd928[_0x4575('0x6c')],'value':_0x2dd928[_0x4575('0x6d')]};}):[]};})};}})[_0x4575('0x22')](respondWithResult(_0x46a0b7,null))[_0x4575('0x42')](function(_0x29e8c0){console['log'](_0x4575('0x6e')+_0x29e8c0);var _0x4383a3=_0x12029e[_0x4575('0x30')][_0x4575('0x6f')]?0x1f4:_0x29e8c0['statusCode']||0x1f4;logger[_0x4575('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x4575('0x70'),_0x4383a3,JSON[_0x4575('0x71')](_0x29e8c0));delete _0x29e8c0['name'];if(_0x4383a3===0x191){_0x4383a3=0x190;}_0x46a0b7[_0x4575('0x17')](_0x4383a3)[_0x4575('0x27')](_0x12029e[_0x4575('0x30')][_0x4575('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x29e8c0[_0x4575('0x72')]}:_0x29e8c0);});};
\ No newline at end of file
index 82df832..8662523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd178=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x525872,_0x12267b){var _0x545a24=function(_0x22022a){while(--_0x22022a){_0x525872['push'](_0x525872['shift']());}};_0x545a24(++_0x12267b);}(_0xd178,0x68));var _0x8d17=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xd178[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x8d17('0x0'));var util=require('util');var logger=require(_0x8d17('0x1'))(_0x8d17('0x2'));var moment=require(_0x8d17('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d17('0x4'));var rimraf=require(_0x8d17('0x5'));var config=require(_0x8d17('0x6'));var attributes=require(_0x8d17('0x7'));var integrations=require(_0x8d17('0x8'));module[_0x8d17('0x9')]=function(_0x300bb1,_0x55d35c){return _0x300bb1[_0x8d17('0xa')](_0x8d17('0xb'),attributes,{'tableName':_0x8d17('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3464=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3464,0xdb));var _0x4346=function(_0x1a3bff,_0x3f2d94){_0x1a3bff=_0x1a3bff-0x0;var _0x90c899=_0x3464[_0x1a3bff];return _0x90c899;};'use strict';var _=require(_0x4346('0x0'));var util=require(_0x4346('0x1'));var logger=require(_0x4346('0x2'))(_0x4346('0x3'));var moment=require(_0x4346('0x4'));var BPromise=require(_0x4346('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4346('0x6'));var rimraf=require(_0x4346('0x7'));var config=require(_0x4346('0x8'));var attributes=require(_0x4346('0x9'));var integrations=require(_0x4346('0xa'));module[_0x4346('0xb')]=function(_0x694272,_0x309676){return _0x694272[_0x4346('0xc')](_0x4346('0xd'),attributes,{'tableName':_0x4346('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 54879c4..bb9ae4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0565=['request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','GetVtigerAccount','options','raw','where','attributes','limit','map','model','include','debug','catch','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x415f5a,_0x4277e9){var _0x5a79d6=function(_0x2d8f55){while(--_0x2d8f55){_0x415f5a['push'](_0x415f5a['shift']());}};_0x5a79d6(++_0x4277e9);}(_0x0565,0xf2));var _0x5056=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x0565[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});}exports[_0x5056('0x17')]=function(_0x4056ce){var _0x51b21e=this;return new Promise(function(_0x9ea88,_0x56537e){return db['VtigerAccount']['findAll']({'raw':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1b')]||null:null,'limit':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1c')]||null:null,'include':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')]['include']?_[_0x5056('0x1d')](_0x4056ce[_0x5056('0x18')]['include'],function(_0x4a64be){return{'model':db[_0x4a64be[_0x5056('0x1e')]],'as':_0x4a64be['as'],'attributes':_0x4a64be[_0x5056('0x1b')],'include':_0x4a64be[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x4a64be['include'],function(_0x267048){return{'model':db[_0x267048[_0x5056('0x1e')]],'as':_0x267048['as'],'attributes':_0x267048['attributes'],'include':_0x267048[_0x5056('0x1f')]?_['map'](_0x267048[_0x5056('0x1f')],function(_0x39d539){return{'model':db[_0x39d539[_0x5056('0x1e')]],'as':_0x39d539['as'],'attributes':_0x39d539[_0x5056('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x50f2a8){logger[_0x5056('0xf')](_0x5056('0x17'),_0x4056ce);logger[_0x5056('0x20')](_0x5056('0x17'),_0x4056ce,JSON['stringify'](_0x50f2a8));_0x9ea88(_0x50f2a8);})[_0x5056('0x21')](function(_0x5b0270){logger[_0x5056('0x16')]('GetVtigerAccount',_0x5b0270['message'],_0x4056ce);_0x56537e(_0x51b21e['error'](0x1f4,_0x5b0270[_0x5056('0x15')]));});});};exports[_0x5056('0x22')]=function(_0x482939){var _0x27f4be=this;return new Promise(function(_0x2c5728,_0x9e2986){return db[_0x5056('0x23')][_0x5056('0x24')]({'raw':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x482939['options']?_0x482939['options'][_0x5056('0x1b')]||null:null,'include':_0x482939[_0x5056('0x18')]?_0x482939['options'][_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x482939['options'][_0x5056('0x1f')],function(_0x378b33){return{'model':db[_0x378b33[_0x5056('0x1e')]],'as':_0x378b33['as'],'attributes':_0x378b33[_0x5056('0x1b')],'include':_0x378b33[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x378b33[_0x5056('0x1f')],function(_0x2f1d27){return{'model':db[_0x2f1d27[_0x5056('0x1e')]],'as':_0x2f1d27['as'],'attributes':_0x2f1d27[_0x5056('0x1b')],'include':_0x2f1d27[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x2f1d27[_0x5056('0x1f')],function(_0x3d7d78){return{'model':db[_0x3d7d78[_0x5056('0x1e')]],'as':_0x3d7d78['as'],'attributes':_0x3d7d78['attributes']};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x483d1e){logger[_0x5056('0xf')](_0x5056('0x22'),_0x482939);logger[_0x5056('0x20')](_0x5056('0x22'),_0x482939,JSON['stringify'](_0x483d1e));_0x2c5728(_0x483d1e);})[_0x5056('0x21')](function(_0x32fecc){logger['error'](_0x5056('0x22'),_0x32fecc['message'],_0x482939);_0x9e2986(_0x27f4be[_0x5056('0x16')](0x1f4,_0x32fecc[_0x5056('0x15')]));});});};
\ No newline at end of file
+var _0x2f68=['info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','include','map','model','ShowVtigerAccount','find','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x38c481,_0x1c3b1e){var _0x383160=function(_0x248a5b){while(--_0x248a5b){_0x38c481['push'](_0x38c481['shift']());}};_0x383160(++_0x1c3b1e);}(_0x2f68,0x9a));var _0x82f6=function(_0x4d6e2e,_0x5ea5bc){_0x4d6e2e=_0x4d6e2e-0x0;var _0x2335bc=_0x2f68[_0x4d6e2e];return _0x2335bc;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});}exports[_0x82f6('0x15')]=function(_0xcbc95f){var _0x4072f0=this;return new Promise(function(_0x2bfd57,_0x1c79f9){return db[_0x82f6('0x16')][_0x82f6('0x17')]({'raw':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['where']||null:null,'attributes':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'limit':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f['options'][_0x82f6('0x1a')]||null:null,'include':_0xcbc95f['options']?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x1b')]?_['map'](_0xcbc95f['options'][_0x82f6('0x1b')],function(_0x1d96d5){return{'model':db[_0x1d96d5['model']],'as':_0x1d96d5['as'],'attributes':_0x1d96d5['attributes'],'include':_0x1d96d5[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1d96d5['include'],function(_0xfd8b68){return{'model':db[_0xfd8b68[_0x82f6('0x1d')]],'as':_0xfd8b68['as'],'attributes':_0xfd8b68['attributes'],'include':_0xfd8b68['include']?_[_0x82f6('0x1c')](_0xfd8b68['include'],function(_0x469b6b){return{'model':db[_0x469b6b[_0x82f6('0x1d')]],'as':_0x469b6b['as'],'attributes':_0x469b6b['attributes']};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x15c9b7){logger[_0x82f6('0xb')](_0x82f6('0x15'),_0xcbc95f);logger['debug'](_0x82f6('0x15'),_0xcbc95f,JSON[_0x82f6('0x10')](_0x15c9b7));_0x2bfd57(_0x15c9b7);})[_0x82f6('0x14')](function(_0x400137){logger[_0x82f6('0x11')](_0x82f6('0x15'),_0x400137[_0x82f6('0x12')],_0xcbc95f);_0x1c79f9(_0x4072f0[_0x82f6('0x11')](0x1f4,_0x400137[_0x82f6('0x12')]));});});};exports[_0x82f6('0x1e')]=function(_0x3c9419){var _0x20d1c5=this;return new Promise(function(_0x6ce179,_0x91117b){return db['VtigerAccount'][_0x82f6('0x1f')]({'raw':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x20')]||null:null,'attributes':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'include':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x3c9419[_0x82f6('0x18')][_0x82f6('0x1b')],function(_0x1e028a){return{'model':db[_0x1e028a[_0x82f6('0x1d')]],'as':_0x1e028a['as'],'attributes':_0x1e028a['attributes'],'include':_0x1e028a[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1e028a[_0x82f6('0x1b')],function(_0x276451){return{'model':db[_0x276451[_0x82f6('0x1d')]],'as':_0x276451['as'],'attributes':_0x276451[_0x82f6('0x19')],'include':_0x276451[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x276451[_0x82f6('0x1b')],function(_0x30c6f8){return{'model':db[_0x30c6f8[_0x82f6('0x1d')]],'as':_0x30c6f8['as'],'attributes':_0x30c6f8[_0x82f6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x34665a){logger['info'](_0x82f6('0x1e'),_0x3c9419);logger['debug']('ShowVtigerAccount',_0x3c9419,JSON[_0x82f6('0x10')](_0x34665a));_0x6ce179(_0x34665a);})[_0x82f6('0x14')](function(_0x5e8828){logger[_0x82f6('0x11')](_0x82f6('0x1e'),_0x5e8828[_0x82f6('0x12')],_0x3c9419);_0x91117b(_0x20d1c5['error'](0x1f4,_0x5e8828[_0x82f6('0x12')]));});});};
\ No newline at end of file
index 20d5e90..c3b0a21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8603=['get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x115c5a,_0x405a8c){var _0x37914a=function(_0x457f4a){while(--_0x457f4a){_0x115c5a['push'](_0x115c5a['shift']());}};_0x37914a(++_0x405a8c);}(_0x8603,0xc0));var _0x3860=function(_0x30d719,_0x22729b){_0x30d719=_0x30d719-0x0;var _0x21358e=_0x8603[_0x30d719];return _0x21358e;};'use strict';var multer=require(_0x3860('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3860('0x1'));var express=require(_0x3860('0x2'));var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./intVtigerConfiguration.controller');router[_0x3860('0x6')]('/',auth[_0x3860('0x7')](),controller['index']);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x7')](),controller[_0x3860('0x9')]);router[_0x3860('0x6')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller[_0x3860('0xb')]);router[_0x3860('0x6')](_0x3860('0xc'),auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['get'](_0x3860('0xe'),auth[_0x3860('0x7')](),controller[_0x3860('0xf')]);router[_0x3860('0x10')]('/',auth[_0x3860('0x7')](),controller[_0x3860('0x11')]);router['put']('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0x12')]);router[_0x3860('0x13')](_0x3860('0x8'),auth[_0x3860('0x7')](),controller[_0x3860('0x14')]);module[_0x3860('0x15')]=router;
\ No newline at end of file
+var _0xc705=['/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get'];(function(_0xf93076,_0x1acb30){var _0x33d1da=function(_0x29e6bf){while(--_0x29e6bf){_0xf93076['push'](_0xf93076['shift']());}};_0x33d1da(++_0x1acb30);}(_0xc705,0x1ae));var _0x5c70=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0xc705[_0x1678c8];return _0x387aa9;};'use strict';var multer=require(_0x5c70('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5c70('0x1'));var express=require(_0x5c70('0x2'));var router=express[_0x5c70('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c70('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5c70('0x5'));var controller=require(_0x5c70('0x6'));router['get']('/',auth[_0x5c70('0x7')](),controller[_0x5c70('0x8')]);router[_0x5c70('0x9')](_0x5c70('0xa'),auth[_0x5c70('0x7')](),controller[_0x5c70('0xb')]);router[_0x5c70('0x9')]('/:id/fields',auth[_0x5c70('0x7')](),controller['getFields']);router[_0x5c70('0x9')](_0x5c70('0xc'),auth['isAuthenticated'](),controller[_0x5c70('0xd')]);router[_0x5c70('0x9')](_0x5c70('0xe'),auth[_0x5c70('0x7')](),controller[_0x5c70('0xf')]);router['post']('/',auth[_0x5c70('0x7')](),controller[_0x5c70('0x10')]);router[_0x5c70('0x11')](_0x5c70('0xa'),auth[_0x5c70('0x7')](),controller[_0x5c70('0x12')]);router[_0x5c70('0x13')](_0x5c70('0xa'),auth[_0x5c70('0x7')](),controller[_0x5c70('0x14')]);module[_0x5c70('0x15')]=router;
\ No newline at end of file
index 6a64db7..f05ca07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17f5=['STRING','sequelize','exports'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x17f5,0x1c6));var _0x517f=function(_0x4ac12c,_0x28ec7f){_0x4ac12c=_0x4ac12c-0x0;var _0x4b4476=_0x17f5[_0x4ac12c];return _0x4b4476;};'use strict';var Sequelize=require(_0x517f('0x0'));module[_0x517f('0x1')]={'name':{'type':Sequelize[_0x517f('0x2')]},'description':{'type':Sequelize[_0x517f('0x2')]}};
\ No newline at end of file
+var _0xfcce=['exports','STRING'];(function(_0x9a3d47,_0x1953a0){var _0xf60b78=function(_0x31575d){while(--_0x31575d){_0x9a3d47['push'](_0x9a3d47['shift']());}};_0xf60b78(++_0x1953a0);}(_0xfcce,0x1b6));var _0xefcc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfcce[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xefcc('0x0')]={'name':{'type':Sequelize[_0xefcc('0x1')]},'description':{'type':Sequelize[_0xefcc('0x1')]}};
\ No newline at end of file
index 4fbcd5b..3090e25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbef6=['keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','params','find','catch','create','body','VtigerField','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','map','query'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbef6,0x1b0));var _0x6bef=function(_0x26e93d,_0x22644f){_0x26e93d=_0x26e93d-0x0;var _0x4c6107=_0xbef6[_0x26e93d];return _0x4c6107;};'use strict';var emlformat=require(_0x6bef('0x0'));var rimraf=require(_0x6bef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6bef('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6bef('0x3'));var Mustache=require('mustache');var util=require(_0x6bef('0x4'));var path=require(_0x6bef('0x5'));var sox=require('sox');var csv=require(_0x6bef('0x6'));var ejs=require(_0x6bef('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6bef('0x8'));var squel=require(_0x6bef('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6bef('0xa'));var toCsv=require(_0x6bef('0x6'));var querystring=require(_0x6bef('0xb'));var Papa=require(_0x6bef('0xc'));var Redis=require(_0x6bef('0xd'));var authService=require(_0x6bef('0xe'));var qs=require(_0x6bef('0xf'));var as=require(_0x6bef('0x10'));var hardwareService=require(_0x6bef('0x11'));var logger=require(_0x6bef('0x12'))(_0x6bef('0x13'));var utils=require(_0x6bef('0x14'));var config=require(_0x6bef('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6bef('0x16'))['db'];function respondWithStatusCode(_0x43e108,_0x1e9aca){_0x1e9aca=_0x1e9aca||0xcc;return function(_0x20bbd8){if(_0x20bbd8){return _0x43e108[_0x6bef('0x17')](_0x1e9aca);}return _0x43e108[_0x6bef('0x18')](_0x1e9aca)[_0x6bef('0x19')]();};}function respondWithResult(_0x309173,_0x1dbea2){_0x1dbea2=_0x1dbea2||0xc8;return function(_0x25ecfe){if(_0x25ecfe){return _0x309173[_0x6bef('0x18')](_0x1dbea2)[_0x6bef('0x1a')](_0x25ecfe);}};}function respondWithFilteredResult(_0x42d9f7,_0x5a6385){return function(_0x209f03){if(_0x209f03){var _0x518f5d=typeof _0x5a6385[_0x6bef('0x1b')]===_0x6bef('0x1c')&&typeof _0x5a6385[_0x6bef('0x1d')]===_0x6bef('0x1c');var _0x30d400=_0x209f03['count'];var _0x1eae62=_0x518f5d?0x0:_0x5a6385[_0x6bef('0x1b')];var _0x470fb4=_0x518f5d?_0x209f03['count']:_0x5a6385[_0x6bef('0x1b')]+_0x5a6385[_0x6bef('0x1d')];var _0x3fe9a6;if(_0x470fb4>=_0x30d400){_0x470fb4=_0x30d400;_0x3fe9a6=0xc8;}else{_0x3fe9a6=0xce;}_0x42d9f7[_0x6bef('0x18')](_0x3fe9a6);return _0x42d9f7[_0x6bef('0x1e')](_0x6bef('0x1f'),_0x1eae62+'-'+_0x470fb4+'/'+_0x30d400)[_0x6bef('0x1a')](_0x209f03);}return null;};}function patchUpdates(_0x81015c){return function(_0xc9761f){try{jsonpatch['apply'](_0xc9761f,_0x81015c,!![]);}catch(_0x54cf62){return BPromise[_0x6bef('0x20')](_0x54cf62);}return _0xc9761f[_0x6bef('0x21')]();};}function saveUpdates(_0x2241eb,_0x1d3d08){return function(_0x217065){if(_0x217065){return _0x217065[_0x6bef('0x22')](_0x2241eb)[_0x6bef('0x23')](function(_0x5d70e3){return _0x5d70e3;});}return null;};}function removeEntity(_0x43e140,_0x236b59){return function(_0x21e05a){if(_0x21e05a){return _0x21e05a[_0x6bef('0x24')]()[_0x6bef('0x23')](function(){_0x43e140['status'](0xcc)[_0x6bef('0x19')]();});}};}function handleEntityNotFound(_0x8b1ed,_0x40760e){return function(_0x25d82e){if(!_0x25d82e){_0x8b1ed[_0x6bef('0x17')](0x194);}return _0x25d82e;};}function handleError(_0x39ba1c,_0xb1266c){_0xb1266c=_0xb1266c||0x1f4;return function(_0x5dbfd3){logger[_0x6bef('0x25')](_0x5dbfd3[_0x6bef('0x26')]);if(_0x5dbfd3[_0x6bef('0x27')]){delete _0x5dbfd3[_0x6bef('0x27')];}_0x39ba1c[_0x6bef('0x18')](_0xb1266c)[_0x6bef('0x28')](_0x5dbfd3);};}exports[_0x6bef('0x29')]=function(_0x5155f8,_0x55906f){var _0x14ab05={},_0x38394f={},_0x1a12b0={'count':0x0,'rows':[]};var _0x1209a5=_['map'](db[_0x6bef('0x2a')][_0x6bef('0x2b')],function(_0x1d2f1c){return{'name':_0x1d2f1c[_0x6bef('0x2c')],'type':_0x1d2f1c[_0x6bef('0x2d')]['key']};});_0x38394f['model']=_[_0x6bef('0x2e')](_0x1209a5,_0x6bef('0x27'));_0x38394f[_0x6bef('0x2f')]=_[_0x6bef('0x30')](_0x5155f8[_0x6bef('0x2f')]);_0x38394f['filters']=_[_0x6bef('0x31')](_0x38394f[_0x6bef('0x32')],_0x38394f[_0x6bef('0x2f')]);_0x14ab05[_0x6bef('0x33')]=_[_0x6bef('0x31')](_0x38394f[_0x6bef('0x32')],qs[_0x6bef('0x34')](_0x5155f8['query']['fields']));_0x14ab05[_0x6bef('0x33')]=_0x14ab05[_0x6bef('0x33')][_0x6bef('0x35')]?_0x14ab05['attributes']:_0x38394f[_0x6bef('0x32')];if(!_0x5155f8[_0x6bef('0x2f')][_0x6bef('0x36')](_0x6bef('0x37'))){_0x14ab05['limit']=qs[_0x6bef('0x1d')](_0x5155f8[_0x6bef('0x2f')]['limit']);_0x14ab05['offset']=qs['offset'](_0x5155f8[_0x6bef('0x2f')][_0x6bef('0x1b')]);}_0x14ab05[_0x6bef('0x38')]=qs[_0x6bef('0x39')](_0x5155f8[_0x6bef('0x2f')]['sort']);_0x14ab05[_0x6bef('0x3a')]=qs[_0x6bef('0x3b')](_[_0x6bef('0x3c')](_0x5155f8[_0x6bef('0x2f')],_0x38394f['filters']),_0x1209a5);if(_0x5155f8['query'][_0x6bef('0x3d')]){_0x14ab05['where']=_['merge'](_0x14ab05[_0x6bef('0x3a')],{'$or':_[_0x6bef('0x2e')](_0x1209a5,function(_0x137ddb){if(_0x137ddb[_0x6bef('0x2d')]!==_0x6bef('0x3e')){var _0x297dc7={};_0x297dc7[_0x137ddb[_0x6bef('0x27')]]={'$like':'%'+_0x5155f8[_0x6bef('0x2f')][_0x6bef('0x3d')]+'%'};return _0x297dc7;}})});}_0x14ab05=_[_0x6bef('0x3f')]({},_0x14ab05,_0x5155f8[_0x6bef('0x40')]);var _0x2d448d={'where':_0x14ab05[_0x6bef('0x3a')]};return db[_0x6bef('0x2a')][_0x6bef('0x41')](_0x2d448d)[_0x6bef('0x23')](function(_0x26b9ee){_0x1a12b0[_0x6bef('0x41')]=_0x26b9ee;if(_0x5155f8[_0x6bef('0x2f')][_0x6bef('0x42')]){_0x14ab05[_0x6bef('0x43')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x6bef('0x44')](_0x14ab05);})['then'](function(_0x1054e3){_0x1a12b0[_0x6bef('0x45')]=_0x1054e3;return _0x1a12b0;})['then'](respondWithFilteredResult(_0x55906f,_0x14ab05))['catch'](handleError(_0x55906f,null));};exports['show']=function(_0x2f4f63,_0x1dedfc){var _0x893d3a={'raw':![],'where':{'id':_0x2f4f63[_0x6bef('0x46')]['id']}},_0x2bc3de={};_0x2bc3de['model']=_['keys'](db[_0x6bef('0x2a')][_0x6bef('0x2b')]);_0x2bc3de[_0x6bef('0x2f')]=_[_0x6bef('0x30')](_0x2f4f63['query']);_0x2bc3de[_0x6bef('0x3b')]=_[_0x6bef('0x31')](_0x2bc3de[_0x6bef('0x32')],_0x2bc3de[_0x6bef('0x2f')]);_0x893d3a['attributes']=_['intersection'](_0x2bc3de[_0x6bef('0x32')],qs['fields'](_0x2f4f63['query']['fields']));_0x893d3a[_0x6bef('0x33')]=_0x893d3a[_0x6bef('0x33')]['length']?_0x893d3a[_0x6bef('0x33')]:_0x2bc3de[_0x6bef('0x32')];if(_0x2f4f63['query'][_0x6bef('0x42')]){_0x893d3a['include']=[{'all':!![]}];}_0x893d3a=_[_0x6bef('0x3f')]({},_0x893d3a,_0x2f4f63[_0x6bef('0x40')]);return db[_0x6bef('0x2a')][_0x6bef('0x47')](_0x893d3a)[_0x6bef('0x23')](handleEntityNotFound(_0x1dedfc,null))['then'](respondWithResult(_0x1dedfc,null))[_0x6bef('0x48')](handleError(_0x1dedfc,null));};exports[_0x6bef('0x49')]=function(_0x45e83c,_0x495d51){return db[_0x6bef('0x2a')][_0x6bef('0x49')](_0x45e83c[_0x6bef('0x4a')],{})[_0x6bef('0x23')](respondWithResult(_0x495d51,0xc9))['catch'](handleError(_0x495d51,null));};exports[_0x6bef('0x22')]=function(_0x4e8e75,_0x1cc74d){if(_0x4e8e75[_0x6bef('0x4a')]['id']){delete _0x4e8e75['body']['id'];}return db[_0x6bef('0x2a')][_0x6bef('0x47')]({'where':{'id':_0x4e8e75[_0x6bef('0x46')]['id']}})[_0x6bef('0x23')](handleEntityNotFound(_0x1cc74d,null))['then'](saveUpdates(_0x4e8e75[_0x6bef('0x4a')],null))[_0x6bef('0x23')](respondWithResult(_0x1cc74d,null))[_0x6bef('0x48')](handleError(_0x1cc74d,null));};exports['destroy']=function(_0x51aca6,_0x217e9a){return db[_0x6bef('0x2a')][_0x6bef('0x47')]({'where':{'id':_0x51aca6['params']['id']}})['then'](handleEntityNotFound(_0x217e9a,null))[_0x6bef('0x23')](removeEntity(_0x217e9a,null))['catch'](handleError(_0x217e9a,null));};exports['getFields']=function(_0x34d9bc,_0x1843d2,_0x39796d){var _0x3351e5={};var _0x433558={};var _0x2788ef;var _0x39d1b1;return db[_0x6bef('0x2a')]['findOne']({'where':{'id':_0x34d9bc['params']['id']}})[_0x6bef('0x23')](handleEntityNotFound(_0x1843d2,null))[_0x6bef('0x23')](function(_0x44541c){if(_0x44541c){_0x2788ef=_0x44541c;_0x433558['model']=_[_0x6bef('0x30')](db[_0x6bef('0x4b')][_0x6bef('0x2b')]);_0x433558[_0x6bef('0x2f')]=_['keys'](_0x34d9bc[_0x6bef('0x2f')]);_0x433558[_0x6bef('0x3b')]=_[_0x6bef('0x31')](_0x433558['model'],_0x433558[_0x6bef('0x2f')]);_0x3351e5['attributes']=_[_0x6bef('0x31')](_0x433558[_0x6bef('0x32')],qs[_0x6bef('0x34')](_0x34d9bc[_0x6bef('0x2f')][_0x6bef('0x34')]));_0x3351e5[_0x6bef('0x33')]=_0x3351e5[_0x6bef('0x33')][_0x6bef('0x35')]?_0x3351e5[_0x6bef('0x33')]:_0x433558[_0x6bef('0x32')];_0x3351e5[_0x6bef('0x38')]=qs[_0x6bef('0x39')](_0x34d9bc[_0x6bef('0x2f')][_0x6bef('0x39')]);_0x3351e5[_0x6bef('0x3a')]=qs['filters'](_[_0x6bef('0x3c')](_0x34d9bc['query'],_0x433558[_0x6bef('0x3b')]));if(_0x34d9bc[_0x6bef('0x2f')][_0x6bef('0x3d')]){_0x3351e5[_0x6bef('0x3a')]=_['merge'](_0x3351e5[_0x6bef('0x3a')],{'$or':_[_0x6bef('0x2e')](_0x3351e5[_0x6bef('0x33')],function(_0x1bcf0a){var _0x1ca774={};_0x1ca774[_0x1bcf0a]={'$like':'%'+_0x34d9bc[_0x6bef('0x2f')]['filter']+'%'};return _0x1ca774;})});}_0x3351e5=_[_0x6bef('0x3f')]({},_0x3351e5,_0x34d9bc[_0x6bef('0x40')]);return _0x2788ef['getFields'](_0x3351e5);}})[_0x6bef('0x23')](function(_0x32997c){if(_0x32997c){_0x39d1b1=_0x32997c[_0x6bef('0x35')];if(!_0x34d9bc['query'][_0x6bef('0x36')](_0x6bef('0x37'))){_0x3351e5[_0x6bef('0x1d')]=qs['limit'](_0x34d9bc[_0x6bef('0x2f')][_0x6bef('0x1d')]);_0x3351e5['offset']=qs[_0x6bef('0x1b')](_0x34d9bc['query'][_0x6bef('0x1b')]);}return _0x2788ef[_0x6bef('0x4c')](_0x3351e5);}})['then'](function(_0x5e28ac){if(_0x5e28ac){return _0x5e28ac?{'count':_0x39d1b1,'rows':_0x5e28ac}:null;}})[_0x6bef('0x23')](respondWithResult(_0x1843d2,null))[_0x6bef('0x48')](handleError(_0x1843d2,null));};exports[_0x6bef('0x4d')]=function(_0x52b377,_0x551e,_0x46e8bc){var _0x217cf3={};var _0x13224e={};var _0x7695f0;var _0x196400;return db[_0x6bef('0x2a')][_0x6bef('0x4e')]({'where':{'id':_0x52b377[_0x6bef('0x46')]['id']}})[_0x6bef('0x23')](handleEntityNotFound(_0x551e,null))[_0x6bef('0x23')](function(_0x2291ee){if(_0x2291ee){_0x7695f0=_0x2291ee;_0x13224e[_0x6bef('0x32')]=_[_0x6bef('0x30')](db['VtigerField'][_0x6bef('0x2b')]);_0x13224e[_0x6bef('0x2f')]=_[_0x6bef('0x30')](_0x52b377[_0x6bef('0x2f')]);_0x13224e[_0x6bef('0x3b')]=_[_0x6bef('0x31')](_0x13224e[_0x6bef('0x32')],_0x13224e['query']);_0x217cf3[_0x6bef('0x33')]=_['intersection'](_0x13224e[_0x6bef('0x32')],qs['fields'](_0x52b377[_0x6bef('0x2f')][_0x6bef('0x34')]));_0x217cf3[_0x6bef('0x33')]=_0x217cf3[_0x6bef('0x33')][_0x6bef('0x35')]?_0x217cf3[_0x6bef('0x33')]:_0x13224e['model'];_0x217cf3[_0x6bef('0x38')]=qs[_0x6bef('0x39')](_0x52b377[_0x6bef('0x2f')][_0x6bef('0x39')]);_0x217cf3['where']=qs[_0x6bef('0x3b')](_[_0x6bef('0x3c')](_0x52b377[_0x6bef('0x2f')],_0x13224e['filters']));if(_0x52b377['query']['filter']){_0x217cf3[_0x6bef('0x3a')]=_[_0x6bef('0x3f')](_0x217cf3[_0x6bef('0x3a')],{'$or':_[_0x6bef('0x2e')](_0x217cf3[_0x6bef('0x33')],function(_0x5584f3){var _0x33ccd8={};_0x33ccd8[_0x5584f3]={'$like':'%'+_0x52b377[_0x6bef('0x2f')]['filter']+'%'};return _0x33ccd8;})});}_0x217cf3=_[_0x6bef('0x3f')]({},_0x217cf3,_0x52b377[_0x6bef('0x40')]);return _0x7695f0['getSubjects'](_0x217cf3);}})[_0x6bef('0x23')](function(_0x4622c){if(_0x4622c){_0x196400=_0x4622c[_0x6bef('0x35')];if(!_0x52b377['query'][_0x6bef('0x36')](_0x6bef('0x37'))){_0x217cf3[_0x6bef('0x1d')]=qs[_0x6bef('0x1d')](_0x52b377[_0x6bef('0x2f')][_0x6bef('0x1d')]);_0x217cf3[_0x6bef('0x1b')]=qs[_0x6bef('0x1b')](_0x52b377['query'][_0x6bef('0x1b')]);}return _0x7695f0[_0x6bef('0x4d')](_0x217cf3);}})[_0x6bef('0x23')](function(_0x11a41){if(_0x11a41){return _0x11a41?{'count':_0x196400,'rows':_0x11a41}:null;}})['then'](respondWithResult(_0x551e,null))[_0x6bef('0x48')](handleError(_0x551e,null));};exports[_0x6bef('0x4f')]=function(_0x166eeb,_0x195aa2,_0x44f24a){var _0x2f8eaa={};var _0x437966={};var _0x3ea973;var _0x5b6290;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x166eeb[_0x6bef('0x46')]['id']}})[_0x6bef('0x23')](handleEntityNotFound(_0x195aa2,null))[_0x6bef('0x23')](function(_0x188992){if(_0x188992){_0x3ea973=_0x188992;_0x437966['model']=_[_0x6bef('0x30')](db['VtigerField'][_0x6bef('0x2b')]);_0x437966[_0x6bef('0x2f')]=_[_0x6bef('0x30')](_0x166eeb[_0x6bef('0x2f')]);_0x437966[_0x6bef('0x3b')]=_[_0x6bef('0x31')](_0x437966['model'],_0x437966[_0x6bef('0x2f')]);_0x2f8eaa['attributes']=_[_0x6bef('0x31')](_0x437966[_0x6bef('0x32')],qs[_0x6bef('0x34')](_0x166eeb[_0x6bef('0x2f')][_0x6bef('0x34')]));_0x2f8eaa[_0x6bef('0x33')]=_0x2f8eaa['attributes'][_0x6bef('0x35')]?_0x2f8eaa['attributes']:_0x437966[_0x6bef('0x32')];_0x2f8eaa['order']=qs[_0x6bef('0x39')](_0x166eeb[_0x6bef('0x2f')][_0x6bef('0x39')]);_0x2f8eaa[_0x6bef('0x3a')]=qs[_0x6bef('0x3b')](_[_0x6bef('0x3c')](_0x166eeb[_0x6bef('0x2f')],_0x437966[_0x6bef('0x3b')]));if(_0x166eeb[_0x6bef('0x2f')][_0x6bef('0x3d')]){_0x2f8eaa[_0x6bef('0x3a')]=_[_0x6bef('0x3f')](_0x2f8eaa[_0x6bef('0x3a')],{'$or':_[_0x6bef('0x2e')](_0x2f8eaa['attributes'],function(_0x27e101){var _0x53083d={};_0x53083d[_0x27e101]={'$like':'%'+_0x166eeb[_0x6bef('0x2f')][_0x6bef('0x3d')]+'%'};return _0x53083d;})});}_0x2f8eaa=_[_0x6bef('0x3f')]({},_0x2f8eaa,_0x166eeb[_0x6bef('0x40')]);return _0x3ea973[_0x6bef('0x4f')](_0x2f8eaa);}})[_0x6bef('0x23')](function(_0x422e8a){if(_0x422e8a){_0x5b6290=_0x422e8a[_0x6bef('0x35')];if(!_0x166eeb[_0x6bef('0x2f')][_0x6bef('0x36')]('nolimit')){_0x2f8eaa['limit']=qs[_0x6bef('0x1d')](_0x166eeb[_0x6bef('0x2f')][_0x6bef('0x1d')]);_0x2f8eaa[_0x6bef('0x1b')]=qs[_0x6bef('0x1b')](_0x166eeb['query'][_0x6bef('0x1b')]);}return _0x3ea973[_0x6bef('0x4f')](_0x2f8eaa);}})[_0x6bef('0x23')](function(_0x15c162){if(_0x15c162){return _0x15c162?{'count':_0x5b6290,'rows':_0x15c162}:null;}})['then'](respondWithResult(_0x195aa2,null))['catch'](handleError(_0x195aa2,null));};
\ No newline at end of file
+var _0xb51e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','stack','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','then','includeAll','include','VtigerConfiguration','findAll','rows','catch','params','length','options','find','create','body','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb51e,0xda));var _0xeb51=function(_0x5499ce,_0x3908fe){_0x5499ce=_0x5499ce-0x0;var _0xb9a0c2=_0xb51e[_0x5499ce];return _0xb9a0c2;};'use strict';var emlformat=require(_0xeb51('0x0'));var rimraf=require(_0xeb51('0x1'));var zipdir=require(_0xeb51('0x2'));var jsonpatch=require(_0xeb51('0x3'));var rp=require(_0xeb51('0x4'));var moment=require(_0xeb51('0x5'));var BPromise=require(_0xeb51('0x6'));var Mustache=require(_0xeb51('0x7'));var util=require('util');var path=require(_0xeb51('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeb51('0x9'));var fs=require('fs');var fs_extra=require(_0xeb51('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeb51('0xb'));var jsforce=require(_0xeb51('0xc'));var deskjs=require(_0xeb51('0xd'));var toCsv=require(_0xeb51('0xe'));var querystring=require(_0xeb51('0xf'));var Papa=require(_0xeb51('0x10'));var Redis=require(_0xeb51('0x11'));var authService=require(_0xeb51('0x12'));var qs=require(_0xeb51('0x13'));var as=require(_0xeb51('0x14'));var hardwareService=require(_0xeb51('0x15'));var logger=require(_0xeb51('0x16'))(_0xeb51('0x17'));var utils=require(_0xeb51('0x18'));var config=require(_0xeb51('0x19'));var licenseUtil=require(_0xeb51('0x1a'));var db=require(_0xeb51('0x1b'))['db'];function respondWithStatusCode(_0x5880f2,_0x5440a8){_0x5440a8=_0x5440a8||0xcc;return function(_0x348be0){if(_0x348be0){return _0x5880f2[_0xeb51('0x1c')](_0x5440a8);}return _0x5880f2[_0xeb51('0x1d')](_0x5440a8)[_0xeb51('0x1e')]();};}function respondWithResult(_0x3ad052,_0x2bc063){_0x2bc063=_0x2bc063||0xc8;return function(_0x136d60){if(_0x136d60){return _0x3ad052['status'](_0x2bc063)[_0xeb51('0x1f')](_0x136d60);}};}function respondWithFilteredResult(_0x31c798,_0x273bbf){return function(_0xea90a2){if(_0xea90a2){var _0x3436ca=typeof _0x273bbf[_0xeb51('0x20')]===_0xeb51('0x21')&&typeof _0x273bbf['limit']===_0xeb51('0x21');var _0x193e52=_0xea90a2['count'];var _0x795f92=_0x3436ca?0x0:_0x273bbf['offset'];var _0x2ee874=_0x3436ca?_0xea90a2[_0xeb51('0x22')]:_0x273bbf['offset']+_0x273bbf[_0xeb51('0x23')];var _0x274aea;if(_0x2ee874>=_0x193e52){_0x2ee874=_0x193e52;_0x274aea=0xc8;}else{_0x274aea=0xce;}_0x31c798[_0xeb51('0x1d')](_0x274aea);return _0x31c798[_0xeb51('0x24')](_0xeb51('0x25'),_0x795f92+'-'+_0x2ee874+'/'+_0x193e52)[_0xeb51('0x1f')](_0xea90a2);}return null;};}function patchUpdates(_0x11be25){return function(_0xc607f9){try{jsonpatch[_0xeb51('0x26')](_0xc607f9,_0x11be25,!![]);}catch(_0x276ca3){return BPromise[_0xeb51('0x27')](_0x276ca3);}return _0xc607f9['save']();};}function saveUpdates(_0x5af39c,_0x3a38d9){return function(_0x210955){if(_0x210955){return _0x210955[_0xeb51('0x28')](_0x5af39c)['then'](function(_0x143574){return _0x143574;});}return null;};}function removeEntity(_0x3a117d,_0x21c580){return function(_0x51e425){if(_0x51e425){return _0x51e425[_0xeb51('0x29')]()['then'](function(){_0x3a117d[_0xeb51('0x1d')](0xcc)[_0xeb51('0x1e')]();});}};}function handleEntityNotFound(_0x4ebc50,_0x2170a5){return function(_0xab6fa2){if(!_0xab6fa2){_0x4ebc50[_0xeb51('0x1c')](0x194);}return _0xab6fa2;};}function handleError(_0x1d3189,_0x4f8f8c){_0x4f8f8c=_0x4f8f8c||0x1f4;return function(_0x41fc9d){logger['error'](_0x41fc9d[_0xeb51('0x2a')]);if(_0x41fc9d['name']){delete _0x41fc9d[_0xeb51('0x2b')];}_0x1d3189[_0xeb51('0x1d')](_0x4f8f8c)['send'](_0x41fc9d);};}exports['index']=function(_0x385ea7,_0x339ca2){var _0x41385e={},_0x49dbbb={},_0x35921e={'count':0x0,'rows':[]};var _0x46fefd=_[_0xeb51('0x2c')](db['VtigerConfiguration'][_0xeb51('0x2d')],function(_0x71b8ad){return{'name':_0x71b8ad['fieldName'],'type':_0x71b8ad[_0xeb51('0x2e')][_0xeb51('0x2f')]};});_0x49dbbb[_0xeb51('0x30')]=_[_0xeb51('0x2c')](_0x46fefd,_0xeb51('0x2b'));_0x49dbbb[_0xeb51('0x31')]=_[_0xeb51('0x32')](_0x385ea7['query']);_0x49dbbb[_0xeb51('0x33')]=_[_0xeb51('0x34')](_0x49dbbb[_0xeb51('0x30')],_0x49dbbb['query']);_0x41385e['attributes']=_['intersection'](_0x49dbbb[_0xeb51('0x30')],qs[_0xeb51('0x35')](_0x385ea7[_0xeb51('0x31')]['fields']));_0x41385e[_0xeb51('0x36')]=_0x41385e[_0xeb51('0x36')]['length']?_0x41385e[_0xeb51('0x36')]:_0x49dbbb[_0xeb51('0x30')];if(!_0x385ea7[_0xeb51('0x31')][_0xeb51('0x37')](_0xeb51('0x38'))){_0x41385e['limit']=qs['limit'](_0x385ea7[_0xeb51('0x31')][_0xeb51('0x23')]);_0x41385e[_0xeb51('0x20')]=qs[_0xeb51('0x20')](_0x385ea7[_0xeb51('0x31')][_0xeb51('0x20')]);}_0x41385e[_0xeb51('0x39')]=qs['sort'](_0x385ea7[_0xeb51('0x31')][_0xeb51('0x3a')]);_0x41385e[_0xeb51('0x3b')]=qs[_0xeb51('0x33')](_['pick'](_0x385ea7[_0xeb51('0x31')],_0x49dbbb[_0xeb51('0x33')]),_0x46fefd);if(_0x385ea7[_0xeb51('0x31')][_0xeb51('0x3c')]){_0x41385e['where']=_[_0xeb51('0x3d')](_0x41385e[_0xeb51('0x3b')],{'$or':_[_0xeb51('0x2c')](_0x46fefd,function(_0x5be9aa){if(_0x5be9aa[_0xeb51('0x2e')]!=='VIRTUAL'){var _0x40a62d={};_0x40a62d[_0x5be9aa[_0xeb51('0x2b')]]={'$like':'%'+_0x385ea7[_0xeb51('0x31')][_0xeb51('0x3c')]+'%'};return _0x40a62d;}})});}_0x41385e=_[_0xeb51('0x3d')]({},_0x41385e,_0x385ea7['options']);var _0xc96fd9={'where':_0x41385e[_0xeb51('0x3b')]};return db['VtigerConfiguration'][_0xeb51('0x22')](_0xc96fd9)[_0xeb51('0x3e')](function(_0x5eea0f){_0x35921e[_0xeb51('0x22')]=_0x5eea0f;if(_0x385ea7['query'][_0xeb51('0x3f')]){_0x41385e[_0xeb51('0x40')]=[{'all':!![]}];}return db[_0xeb51('0x41')][_0xeb51('0x42')](_0x41385e);})[_0xeb51('0x3e')](function(_0x34afcb){_0x35921e[_0xeb51('0x43')]=_0x34afcb;return _0x35921e;})[_0xeb51('0x3e')](respondWithFilteredResult(_0x339ca2,_0x41385e))[_0xeb51('0x44')](handleError(_0x339ca2,null));};exports['show']=function(_0x539eab,_0x406f05){var _0x3388c4={'raw':![],'where':{'id':_0x539eab[_0xeb51('0x45')]['id']}},_0x1bd086={};_0x1bd086[_0xeb51('0x30')]=_[_0xeb51('0x32')](db[_0xeb51('0x41')][_0xeb51('0x2d')]);_0x1bd086[_0xeb51('0x31')]=_[_0xeb51('0x32')](_0x539eab[_0xeb51('0x31')]);_0x1bd086['filters']=_[_0xeb51('0x34')](_0x1bd086[_0xeb51('0x30')],_0x1bd086['query']);_0x3388c4['attributes']=_[_0xeb51('0x34')](_0x1bd086[_0xeb51('0x30')],qs['fields'](_0x539eab[_0xeb51('0x31')][_0xeb51('0x35')]));_0x3388c4[_0xeb51('0x36')]=_0x3388c4['attributes'][_0xeb51('0x46')]?_0x3388c4['attributes']:_0x1bd086['model'];if(_0x539eab[_0xeb51('0x31')][_0xeb51('0x3f')]){_0x3388c4['include']=[{'all':!![]}];}_0x3388c4=_['merge']({},_0x3388c4,_0x539eab[_0xeb51('0x47')]);return db[_0xeb51('0x41')][_0xeb51('0x48')](_0x3388c4)[_0xeb51('0x3e')](handleEntityNotFound(_0x406f05,null))['then'](respondWithResult(_0x406f05,null))['catch'](handleError(_0x406f05,null));};exports[_0xeb51('0x49')]=function(_0x490f22,_0x33d8b9){return db[_0xeb51('0x41')][_0xeb51('0x49')](_0x490f22[_0xeb51('0x4a')],{})[_0xeb51('0x3e')](respondWithResult(_0x33d8b9,0xc9))[_0xeb51('0x44')](handleError(_0x33d8b9,null));};exports[_0xeb51('0x28')]=function(_0x3f7343,_0xdcba2d){if(_0x3f7343[_0xeb51('0x4a')]['id']){delete _0x3f7343[_0xeb51('0x4a')]['id'];}return db[_0xeb51('0x41')]['find']({'where':{'id':_0x3f7343[_0xeb51('0x45')]['id']}})[_0xeb51('0x3e')](handleEntityNotFound(_0xdcba2d,null))[_0xeb51('0x3e')](saveUpdates(_0x3f7343[_0xeb51('0x4a')],null))[_0xeb51('0x3e')](respondWithResult(_0xdcba2d,null))['catch'](handleError(_0xdcba2d,null));};exports['destroy']=function(_0x1ad14a,_0xc2593f){return db[_0xeb51('0x41')]['find']({'where':{'id':_0x1ad14a[_0xeb51('0x45')]['id']}})[_0xeb51('0x3e')](handleEntityNotFound(_0xc2593f,null))[_0xeb51('0x3e')](removeEntity(_0xc2593f,null))[_0xeb51('0x44')](handleError(_0xc2593f,null));};exports[_0xeb51('0x4b')]=function(_0x540b37,_0x5793df,_0x1a9f24){var _0x34f165={};var _0x27b9a4={};var _0x20b537;var _0xfea8db;return db[_0xeb51('0x41')][_0xeb51('0x4c')]({'where':{'id':_0x540b37[_0xeb51('0x45')]['id']}})[_0xeb51('0x3e')](handleEntityNotFound(_0x5793df,null))['then'](function(_0x2577ad){if(_0x2577ad){_0x20b537=_0x2577ad;_0x27b9a4[_0xeb51('0x30')]=_[_0xeb51('0x32')](db[_0xeb51('0x4d')]['rawAttributes']);_0x27b9a4[_0xeb51('0x31')]=_[_0xeb51('0x32')](_0x540b37['query']);_0x27b9a4[_0xeb51('0x33')]=_['intersection'](_0x27b9a4[_0xeb51('0x30')],_0x27b9a4[_0xeb51('0x31')]);_0x34f165['attributes']=_[_0xeb51('0x34')](_0x27b9a4[_0xeb51('0x30')],qs[_0xeb51('0x35')](_0x540b37[_0xeb51('0x31')][_0xeb51('0x35')]));_0x34f165[_0xeb51('0x36')]=_0x34f165[_0xeb51('0x36')][_0xeb51('0x46')]?_0x34f165[_0xeb51('0x36')]:_0x27b9a4[_0xeb51('0x30')];_0x34f165['order']=qs[_0xeb51('0x3a')](_0x540b37['query'][_0xeb51('0x3a')]);_0x34f165[_0xeb51('0x3b')]=qs[_0xeb51('0x33')](_[_0xeb51('0x4e')](_0x540b37[_0xeb51('0x31')],_0x27b9a4[_0xeb51('0x33')]));if(_0x540b37[_0xeb51('0x31')]['filter']){_0x34f165[_0xeb51('0x3b')]=_[_0xeb51('0x3d')](_0x34f165[_0xeb51('0x3b')],{'$or':_[_0xeb51('0x2c')](_0x34f165[_0xeb51('0x36')],function(_0x22a78a){var _0xb4da39={};_0xb4da39[_0x22a78a]={'$like':'%'+_0x540b37[_0xeb51('0x31')][_0xeb51('0x3c')]+'%'};return _0xb4da39;})});}_0x34f165=_[_0xeb51('0x3d')]({},_0x34f165,_0x540b37[_0xeb51('0x47')]);return _0x20b537[_0xeb51('0x4b')](_0x34f165);}})[_0xeb51('0x3e')](function(_0x5f145a){if(_0x5f145a){_0xfea8db=_0x5f145a[_0xeb51('0x46')];if(!_0x540b37[_0xeb51('0x31')][_0xeb51('0x37')](_0xeb51('0x38'))){_0x34f165[_0xeb51('0x23')]=qs[_0xeb51('0x23')](_0x540b37[_0xeb51('0x31')]['limit']);_0x34f165[_0xeb51('0x20')]=qs['offset'](_0x540b37['query'][_0xeb51('0x20')]);}return _0x20b537[_0xeb51('0x4b')](_0x34f165);}})[_0xeb51('0x3e')](function(_0x109c07){if(_0x109c07){return _0x109c07?{'count':_0xfea8db,'rows':_0x109c07}:null;}})['then'](respondWithResult(_0x5793df,null))['catch'](handleError(_0x5793df,null));};exports[_0xeb51('0x4f')]=function(_0x218964,_0x35e509,_0x3b111d){var _0x4f81e8={};var _0x1b5af6={};var _0x3eaaa7;var _0xf865bb;return db[_0xeb51('0x41')]['findOne']({'where':{'id':_0x218964['params']['id']}})['then'](handleEntityNotFound(_0x35e509,null))[_0xeb51('0x3e')](function(_0x2220e3){if(_0x2220e3){_0x3eaaa7=_0x2220e3;_0x1b5af6[_0xeb51('0x30')]=_[_0xeb51('0x32')](db[_0xeb51('0x4d')][_0xeb51('0x2d')]);_0x1b5af6[_0xeb51('0x31')]=_[_0xeb51('0x32')](_0x218964['query']);_0x1b5af6[_0xeb51('0x33')]=_['intersection'](_0x1b5af6[_0xeb51('0x30')],_0x1b5af6[_0xeb51('0x31')]);_0x4f81e8[_0xeb51('0x36')]=_[_0xeb51('0x34')](_0x1b5af6['model'],qs[_0xeb51('0x35')](_0x218964[_0xeb51('0x31')][_0xeb51('0x35')]));_0x4f81e8[_0xeb51('0x36')]=_0x4f81e8[_0xeb51('0x36')][_0xeb51('0x46')]?_0x4f81e8[_0xeb51('0x36')]:_0x1b5af6[_0xeb51('0x30')];_0x4f81e8[_0xeb51('0x39')]=qs[_0xeb51('0x3a')](_0x218964[_0xeb51('0x31')]['sort']);_0x4f81e8[_0xeb51('0x3b')]=qs[_0xeb51('0x33')](_[_0xeb51('0x4e')](_0x218964[_0xeb51('0x31')],_0x1b5af6[_0xeb51('0x33')]));if(_0x218964[_0xeb51('0x31')]['filter']){_0x4f81e8[_0xeb51('0x3b')]=_[_0xeb51('0x3d')](_0x4f81e8['where'],{'$or':_[_0xeb51('0x2c')](_0x4f81e8['attributes'],function(_0x420bbc){var _0x470129={};_0x470129[_0x420bbc]={'$like':'%'+_0x218964[_0xeb51('0x31')]['filter']+'%'};return _0x470129;})});}_0x4f81e8=_[_0xeb51('0x3d')]({},_0x4f81e8,_0x218964[_0xeb51('0x47')]);return _0x3eaaa7[_0xeb51('0x4f')](_0x4f81e8);}})[_0xeb51('0x3e')](function(_0x21e1cf){if(_0x21e1cf){_0xf865bb=_0x21e1cf[_0xeb51('0x46')];if(!_0x218964[_0xeb51('0x31')][_0xeb51('0x37')](_0xeb51('0x38'))){_0x4f81e8[_0xeb51('0x23')]=qs[_0xeb51('0x23')](_0x218964[_0xeb51('0x31')][_0xeb51('0x23')]);_0x4f81e8[_0xeb51('0x20')]=qs['offset'](_0x218964[_0xeb51('0x31')]['offset']);}return _0x3eaaa7[_0xeb51('0x4f')](_0x4f81e8);}})['then'](function(_0x339c58){if(_0x339c58){return _0x339c58?{'count':_0xf865bb,'rows':_0x339c58}:null;}})['then'](respondWithResult(_0x35e509,null))[_0xeb51('0x44')](handleError(_0x35e509,null));};exports['getDescriptions']=function(_0x30afbc,_0x302247,_0x48be40){var _0x16eab1={};var _0x4f5b86={};var _0x3ac2c4;var _0x2ba765;return db[_0xeb51('0x41')]['findOne']({'where':{'id':_0x30afbc['params']['id']}})[_0xeb51('0x3e')](handleEntityNotFound(_0x302247,null))[_0xeb51('0x3e')](function(_0x5d2690){if(_0x5d2690){_0x3ac2c4=_0x5d2690;_0x4f5b86['model']=_[_0xeb51('0x32')](db[_0xeb51('0x4d')][_0xeb51('0x2d')]);_0x4f5b86['query']=_[_0xeb51('0x32')](_0x30afbc[_0xeb51('0x31')]);_0x4f5b86[_0xeb51('0x33')]=_['intersection'](_0x4f5b86['model'],_0x4f5b86[_0xeb51('0x31')]);_0x16eab1[_0xeb51('0x36')]=_[_0xeb51('0x34')](_0x4f5b86[_0xeb51('0x30')],qs[_0xeb51('0x35')](_0x30afbc[_0xeb51('0x31')][_0xeb51('0x35')]));_0x16eab1['attributes']=_0x16eab1[_0xeb51('0x36')][_0xeb51('0x46')]?_0x16eab1['attributes']:_0x4f5b86[_0xeb51('0x30')];_0x16eab1['order']=qs[_0xeb51('0x3a')](_0x30afbc[_0xeb51('0x31')][_0xeb51('0x3a')]);_0x16eab1[_0xeb51('0x3b')]=qs[_0xeb51('0x33')](_[_0xeb51('0x4e')](_0x30afbc[_0xeb51('0x31')],_0x4f5b86['filters']));if(_0x30afbc[_0xeb51('0x31')][_0xeb51('0x3c')]){_0x16eab1[_0xeb51('0x3b')]=_[_0xeb51('0x3d')](_0x16eab1[_0xeb51('0x3b')],{'$or':_[_0xeb51('0x2c')](_0x16eab1['attributes'],function(_0x49bb84){var _0x3761a2={};_0x3761a2[_0x49bb84]={'$like':'%'+_0x30afbc[_0xeb51('0x31')][_0xeb51('0x3c')]+'%'};return _0x3761a2;})});}_0x16eab1=_[_0xeb51('0x3d')]({},_0x16eab1,_0x30afbc[_0xeb51('0x47')]);return _0x3ac2c4[_0xeb51('0x50')](_0x16eab1);}})[_0xeb51('0x3e')](function(_0x29bea5){if(_0x29bea5){_0x2ba765=_0x29bea5[_0xeb51('0x46')];if(!_0x30afbc['query'][_0xeb51('0x37')](_0xeb51('0x38'))){_0x16eab1['limit']=qs[_0xeb51('0x23')](_0x30afbc[_0xeb51('0x31')][_0xeb51('0x23')]);_0x16eab1[_0xeb51('0x20')]=qs[_0xeb51('0x20')](_0x30afbc[_0xeb51('0x31')][_0xeb51('0x20')]);}return _0x3ac2c4[_0xeb51('0x50')](_0x16eab1);}})['then'](function(_0x49428f){if(_0x49428f){return _0x49428f?{'count':_0x2ba765,'rows':_0x49428f}:null;}})[_0xeb51('0x3e')](respondWithResult(_0x302247,null))[_0xeb51('0x44')](handleError(_0x302247,null));};
\ No newline at end of file
index dbf3b95..1aac3ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92cc=['exports','int_vtiger_configurations','lodash','api','moment','bluebird','path','./intVtigerConfiguration.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x92cc,0xb2));var _0xc92c=function(_0x42c7f1,_0x316d19){_0x42c7f1=_0x42c7f1-0x0;var _0x498784=_0x92cc[_0x42c7f1];return _0x498784;};'use strict';var _=require(_0xc92c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc92c('0x1'));var moment=require(_0xc92c('0x2'));var BPromise=require(_0xc92c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc92c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc92c('0x5'));module[_0xc92c('0x6')]=function(_0xad63e2,_0x2cf67e){return _0xad63e2['define']('VtigerConfiguration',attributes,{'tableName':_0xc92c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3877=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','int_vtiger_configurations','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x14f438,_0x274f28){var _0x40d656=function(_0x304232){while(--_0x304232){_0x14f438['push'](_0x14f438['shift']());}};_0x40d656(++_0x274f28);}(_0x3877,0x19c));var _0x7387=function(_0x3b3729,_0x2e71a5){_0x3b3729=_0x3b3729-0x0;var _0x1ed778=_0x3877[_0x3b3729];return _0x1ed778;};'use strict';var _=require('lodash');var util=require(_0x7387('0x0'));var logger=require(_0x7387('0x1'))('api');var moment=require(_0x7387('0x2'));var BPromise=require(_0x7387('0x3'));var rp=require(_0x7387('0x4'));var fs=require('fs');var path=require(_0x7387('0x5'));var rimraf=require(_0x7387('0x6'));var config=require(_0x7387('0x7'));var attributes=require(_0x7387('0x8'));module['exports']=function(_0x32e59c,_0x15f92b){return _0x32e59c[_0x7387('0x9')]('VtigerConfiguration',attributes,{'tableName':_0x7387('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bb661e0..8046a19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa671=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','moment','bluebird'];(function(_0x4c7e8e,_0x3c5035){var _0x503c3f=function(_0x5a0659){while(--_0x5a0659){_0x4c7e8e['push'](_0x4c7e8e['shift']());}};_0x503c3f(++_0x3c5035);}(_0xa671,0x140));var _0x1a67=function(_0x385567,_0x40550f){_0x385567=_0x385567-0x0;var _0x49cf95=_0xa671[_0x385567];return _0x49cf95;};'use strict';var _=require(_0x1a67('0x0'));var util=require('util');var moment=require(_0x1a67('0x1'));var BPromise=require(_0x1a67('0x2'));var rs=require(_0x1a67('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a67('0x4'))['db'];var utils=require(_0x1a67('0x5'));var logger=require(_0x1a67('0x6'))(_0x1a67('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1a67('0x8')][_0x1a67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fca15,_0x29bea6,_0x4c6832){return new BPromise(function(_0x4c605e,_0x38906d){return client[_0x1a67('0xa')](_0x4fca15,_0x4c6832)['then'](function(_0x1cf0b0){logger[_0x1a67('0xb')](_0x1a67('0xc'),_0x29bea6,_0x1a67('0xd'));logger[_0x1a67('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x29bea6,_0x1a67('0xd'),JSON[_0x1a67('0xf')](_0x1cf0b0));if(_0x1cf0b0[_0x1a67('0x10')]){if(_0x1cf0b0[_0x1a67('0x10')][_0x1a67('0x11')]===0x1f4){logger[_0x1a67('0x10')](_0x1a67('0xc'),_0x29bea6,_0x1cf0b0[_0x1a67('0x10')][_0x1a67('0x12')]);return _0x38906d(_0x1cf0b0[_0x1a67('0x10')][_0x1a67('0x12')]);}logger['error'](_0x1a67('0xc'),_0x29bea6,_0x1cf0b0['error'][_0x1a67('0x12')]);return _0x4c605e(_0x1cf0b0[_0x1a67('0x10')]['message']);}else{logger[_0x1a67('0xb')](_0x1a67('0xc'),_0x29bea6,_0x1a67('0xd'));_0x4c605e(_0x1cf0b0['result'][_0x1a67('0x12')]);}})['catch'](function(_0x267a10){logger['error'](_0x1a67('0xc'),_0x29bea6,_0x267a10);_0x38906d(_0x267a10);});});}
\ No newline at end of file
+var _0xc574=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x491a4d,_0x245c8b){var _0x5ac467=function(_0x277794){while(--_0x277794){_0x491a4d['push'](_0x491a4d['shift']());}};_0x5ac467(++_0x245c8b);}(_0xc574,0x121));var _0x4c57=function(_0x15f86a,_0x35c870){_0x15f86a=_0x15f86a-0x0;var _0x58bf82=_0xc574[_0x15f86a];return _0x58bf82;};'use strict';var _=require(_0x4c57('0x0'));var util=require(_0x4c57('0x1'));var moment=require(_0x4c57('0x2'));var BPromise=require(_0x4c57('0x3'));var rs=require(_0x4c57('0x4'));var fs=require('fs');var Redis=require(_0x4c57('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c57('0x6'));var logger=require(_0x4c57('0x7'))(_0x4c57('0x8'));var config=require(_0x4c57('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4c57('0xa')][_0x4c57('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x142f70,_0x1bf335,_0x513a7d){return new BPromise(function(_0x47bd41,_0x1ae74d){return client['request'](_0x142f70,_0x513a7d)['then'](function(_0x25caea){logger[_0x4c57('0xc')](_0x4c57('0xd'),_0x1bf335,_0x4c57('0xe'));logger[_0x4c57('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1bf335,_0x4c57('0xe'),JSON[_0x4c57('0x10')](_0x25caea));if(_0x25caea[_0x4c57('0x11')]){if(_0x25caea[_0x4c57('0x11')][_0x4c57('0x12')]===0x1f4){logger[_0x4c57('0x11')](_0x4c57('0xd'),_0x1bf335,_0x25caea[_0x4c57('0x11')][_0x4c57('0x13')]);return _0x1ae74d(_0x25caea[_0x4c57('0x11')][_0x4c57('0x13')]);}logger[_0x4c57('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x1bf335,_0x25caea[_0x4c57('0x11')]['message']);return _0x47bd41(_0x25caea['error'][_0x4c57('0x13')]);}else{logger['info'](_0x4c57('0xd'),_0x1bf335,'request\x20sent');_0x47bd41(_0x25caea[_0x4c57('0x14')][_0x4c57('0x13')]);}})[_0x4c57('0x15')](function(_0x46e785){logger[_0x4c57('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x1bf335,_0x46e785);_0x1ae74d(_0x46e785);});});}
\ No newline at end of file
index d00373f..6408677 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd62c=['./intVtigerField.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x56a482,_0x13b215){var _0x4159b1=function(_0x5cde4e){while(--_0x5cde4e){_0x56a482['push'](_0x56a482['shift']());}};_0x4159b1(++_0x13b215);}(_0xd62c,0x175));var _0xcd62=function(_0xd898af,_0x1d9f42){_0xd898af=_0xd898af-0x0;var _0x3f90ce=_0xd62c[_0xd898af];return _0x3f90ce;};'use strict';var multer=require('multer');var util=require(_0xcd62('0x0'));var path=require(_0xcd62('0x1'));var timeout=require(_0xcd62('0x2'));var express=require(_0xcd62('0x3'));var router=express['Router']();var fs_extra=require(_0xcd62('0x4'));var auth=require(_0xcd62('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcd62('0x6'));var controller=require(_0xcd62('0x7'));router['get']('/',auth[_0xcd62('0x8')](),controller[_0xcd62('0x9')]);router[_0xcd62('0xa')]('/:id',auth[_0xcd62('0x8')](),controller['show']);router[_0xcd62('0xb')]('/',auth[_0xcd62('0x8')](),controller[_0xcd62('0xc')]);router[_0xcd62('0xd')](_0xcd62('0xe'),auth[_0xcd62('0x8')](),controller[_0xcd62('0xf')]);router[_0xcd62('0x10')](_0xcd62('0xe'),auth[_0xcd62('0x8')](),controller[_0xcd62('0x11')]);module[_0xcd62('0x12')]=router;
\ No newline at end of file
+var _0xd8e9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','util'];(function(_0x24f3d1,_0x425d0e){var _0x155ee9=function(_0xbc9404){while(--_0xbc9404){_0x24f3d1['push'](_0x24f3d1['shift']());}};_0x155ee9(++_0x425d0e);}(_0xd8e9,0x11c));var _0x9d8e=function(_0x1d360d,_0x385418){_0x1d360d=_0x1d360d-0x0;var _0x126381=_0xd8e9[_0x1d360d];return _0x126381;};'use strict';var multer=require('multer');var util=require(_0x9d8e('0x0'));var path=require('path');var timeout=require(_0x9d8e('0x1'));var express=require(_0x9d8e('0x2'));var router=express[_0x9d8e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9d8e('0x4'));var interaction=require(_0x9d8e('0x5'));var config=require(_0x9d8e('0x6'));var controller=require(_0x9d8e('0x7'));router['get']('/',auth[_0x9d8e('0x8')](),controller[_0x9d8e('0x9')]);router[_0x9d8e('0xa')](_0x9d8e('0xb'),auth[_0x9d8e('0x8')](),controller[_0x9d8e('0xc')]);router[_0x9d8e('0xd')]('/',auth[_0x9d8e('0x8')](),controller[_0x9d8e('0xe')]);router[_0x9d8e('0xf')](_0x9d8e('0xb'),auth['isAuthenticated'](),controller[_0x9d8e('0x10')]);router['delete']('/:id',auth[_0x9d8e('0x8')](),controller[_0x9d8e('0x11')]);module[_0x9d8e('0x12')]=router;
\ No newline at end of file
index d0b9226..411edc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x223d=['customVariable','sequelize','exports','ENUM','string','variable','picklist','STRING'];(function(_0x3e4a61,_0x2b25f3){var _0x594a46=function(_0x581695){while(--_0x581695){_0x3e4a61['push'](_0x3e4a61['shift']());}};_0x594a46(++_0x2b25f3);}(_0x223d,0x1e9));var _0xd223=function(_0x393234,_0x3cc681){_0x393234=_0x393234-0x0;var _0x5a6428=_0x223d[_0x393234];return _0x5a6428;};'use strict';var Sequelize=require(_0xd223('0x0'));module[_0xd223('0x1')]={'type':{'type':Sequelize[_0xd223('0x2')](_0xd223('0x3'),_0xd223('0x4'),'customVariable','keyValue',_0xd223('0x5')),'defaultValue':_0xd223('0x3')},'content':{'type':Sequelize[_0xd223('0x6')]},'key':{'type':Sequelize[_0xd223('0x6')]},'keyType':{'type':Sequelize[_0xd223('0x2')]('string',_0xd223('0x4'),_0xd223('0x7'))},'keyContent':{'type':Sequelize[_0xd223('0x6')]},'idField':{'type':Sequelize[_0xd223('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x981d=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','string'];(function(_0x4381e7,_0x40314e){var _0x528bb9=function(_0x138524){while(--_0x138524){_0x4381e7['push'](_0x4381e7['shift']());}};_0x528bb9(++_0x40314e);}(_0x981d,0x1bf));var _0xd981=function(_0x47cf89,_0x4edbf0){_0x47cf89=_0x47cf89-0x0;var _0x404c43=_0x981d[_0x47cf89];return _0x404c43;};'use strict';var Sequelize=require(_0xd981('0x0'));module[_0xd981('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd981('0x2'),_0xd981('0x3'),'customVariable',_0xd981('0x4'),_0xd981('0x5')),'defaultValue':_0xd981('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd981('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd981('0x2'),_0xd981('0x3'),_0xd981('0x7'))},'keyContent':{'type':Sequelize[_0xd981('0x6')]},'idField':{'type':Sequelize[_0xd981('0x6')]},'nameField':{'type':Sequelize[_0xd981('0x6')]},'customField':{'type':Sequelize[_0xd981('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd981('0x6')]}};
\ No newline at end of file
index 4001b6e..1342b32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1c6=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x18323f,_0x669841){var _0x3229da=function(_0x36163b){while(--_0x36163b){_0x18323f['push'](_0x18323f['shift']());}};_0x3229da(++_0x669841);}(_0xf1c6,0x174));var _0x6f1c=function(_0x25b7bd,_0x58a63c){_0x25b7bd=_0x25b7bd-0x0;var _0x2bafb5=_0xf1c6[_0x25b7bd];return _0x2bafb5;};'use strict';var emlformat=require(_0x6f1c('0x0'));var rimraf=require(_0x6f1c('0x1'));var zipdir=require(_0x6f1c('0x2'));var jsonpatch=require(_0x6f1c('0x3'));var rp=require(_0x6f1c('0x4'));var moment=require(_0x6f1c('0x5'));var BPromise=require(_0x6f1c('0x6'));var Mustache=require(_0x6f1c('0x7'));var util=require(_0x6f1c('0x8'));var path=require(_0x6f1c('0x9'));var sox=require('sox');var csv=require(_0x6f1c('0xa'));var ejs=require(_0x6f1c('0xb'));var fs=require('fs');var fs_extra=require(_0x6f1c('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f1c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6f1c('0xe'));var toCsv=require(_0x6f1c('0xa'));var querystring=require(_0x6f1c('0xf'));var Papa=require(_0x6f1c('0x10'));var Redis=require(_0x6f1c('0x11'));var authService=require(_0x6f1c('0x12'));var qs=require(_0x6f1c('0x13'));var as=require(_0x6f1c('0x14'));var hardwareService=require(_0x6f1c('0x15'));var logger=require(_0x6f1c('0x16'))(_0x6f1c('0x17'));var utils=require(_0x6f1c('0x18'));var config=require(_0x6f1c('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc20efa,_0x50ecf9){_0x50ecf9=_0x50ecf9||0xcc;return function(_0x4e10ca){if(_0x4e10ca){return _0xc20efa[_0x6f1c('0x1a')](_0x50ecf9);}return _0xc20efa['status'](_0x50ecf9)[_0x6f1c('0x1b')]();};}function respondWithResult(_0x5f1918,_0xfa9784){_0xfa9784=_0xfa9784||0xc8;return function(_0x4fc7b0){if(_0x4fc7b0){return _0x5f1918[_0x6f1c('0x1c')](_0xfa9784)[_0x6f1c('0x1d')](_0x4fc7b0);}};}function respondWithFilteredResult(_0x393f85,_0x368373){return function(_0x31393a){if(_0x31393a){var _0x425c52=typeof _0x368373[_0x6f1c('0x1e')]===_0x6f1c('0x1f')&&typeof _0x368373[_0x6f1c('0x20')]===_0x6f1c('0x1f');var _0x4d0679=_0x31393a[_0x6f1c('0x21')];var _0x212def=_0x425c52?0x0:_0x368373['offset'];var _0x428049=_0x425c52?_0x31393a['count']:_0x368373[_0x6f1c('0x1e')]+_0x368373[_0x6f1c('0x20')];var _0x18157d;if(_0x428049>=_0x4d0679){_0x428049=_0x4d0679;_0x18157d=0xc8;}else{_0x18157d=0xce;}_0x393f85[_0x6f1c('0x1c')](_0x18157d);return _0x393f85[_0x6f1c('0x22')](_0x6f1c('0x23'),_0x212def+'-'+_0x428049+'/'+_0x4d0679)[_0x6f1c('0x1d')](_0x31393a);}return null;};}function patchUpdates(_0x4a1c9a){return function(_0x22d086){try{jsonpatch['apply'](_0x22d086,_0x4a1c9a,!![]);}catch(_0x4124d0){return BPromise[_0x6f1c('0x24')](_0x4124d0);}return _0x22d086[_0x6f1c('0x25')]();};}function saveUpdates(_0x8f837f,_0x4f0995){return function(_0x315523){if(_0x315523){return _0x315523[_0x6f1c('0x26')](_0x8f837f)[_0x6f1c('0x27')](function(_0x13266f){return _0x13266f;});}return null;};}function removeEntity(_0x3b85cb,_0x55ed64){return function(_0x4bd302){if(_0x4bd302){return _0x4bd302[_0x6f1c('0x28')]()[_0x6f1c('0x27')](function(){_0x3b85cb[_0x6f1c('0x1c')](0xcc)[_0x6f1c('0x1b')]();});}};}function handleEntityNotFound(_0x2f1412,_0x357bad){return function(_0x2ae8ca){if(!_0x2ae8ca){_0x2f1412[_0x6f1c('0x1a')](0x194);}return _0x2ae8ca;};}function handleError(_0x1d5fd7,_0x3c55bf){_0x3c55bf=_0x3c55bf||0x1f4;return function(_0x45ca6a){logger[_0x6f1c('0x29')](_0x45ca6a[_0x6f1c('0x2a')]);if(_0x45ca6a[_0x6f1c('0x2b')]){delete _0x45ca6a[_0x6f1c('0x2b')];}_0x1d5fd7[_0x6f1c('0x1c')](_0x3c55bf)[_0x6f1c('0x2c')](_0x45ca6a);};}exports[_0x6f1c('0x2d')]=function(_0x16bc13,_0x657928){var _0x4802ff={},_0x55ea56={},_0x42cf44={'count':0x0,'rows':[]};var _0x560bfc=_[_0x6f1c('0x2e')](db[_0x6f1c('0x2f')][_0x6f1c('0x30')],function(_0x381fa7){return{'name':_0x381fa7[_0x6f1c('0x31')],'type':_0x381fa7[_0x6f1c('0x32')][_0x6f1c('0x33')]};});_0x55ea56[_0x6f1c('0x34')]=_[_0x6f1c('0x2e')](_0x560bfc,_0x6f1c('0x2b'));_0x55ea56[_0x6f1c('0x35')]=_[_0x6f1c('0x36')](_0x16bc13[_0x6f1c('0x35')]);_0x55ea56[_0x6f1c('0x37')]=_[_0x6f1c('0x38')](_0x55ea56[_0x6f1c('0x34')],_0x55ea56[_0x6f1c('0x35')]);_0x4802ff[_0x6f1c('0x39')]=_[_0x6f1c('0x38')](_0x55ea56['model'],qs[_0x6f1c('0x3a')](_0x16bc13['query']['fields']));_0x4802ff[_0x6f1c('0x39')]=_0x4802ff[_0x6f1c('0x39')][_0x6f1c('0x3b')]?_0x4802ff[_0x6f1c('0x39')]:_0x55ea56[_0x6f1c('0x34')];if(!_0x16bc13['query'][_0x6f1c('0x3c')]('nolimit')){_0x4802ff[_0x6f1c('0x20')]=qs[_0x6f1c('0x20')](_0x16bc13['query'][_0x6f1c('0x20')]);_0x4802ff[_0x6f1c('0x1e')]=qs['offset'](_0x16bc13[_0x6f1c('0x35')][_0x6f1c('0x1e')]);}_0x4802ff[_0x6f1c('0x3d')]=qs[_0x6f1c('0x3e')](_0x16bc13[_0x6f1c('0x35')][_0x6f1c('0x3e')]);_0x4802ff[_0x6f1c('0x3f')]=qs[_0x6f1c('0x37')](_['pick'](_0x16bc13[_0x6f1c('0x35')],_0x55ea56[_0x6f1c('0x37')]),_0x560bfc);if(_0x16bc13[_0x6f1c('0x35')][_0x6f1c('0x40')]){_0x4802ff['where']=_[_0x6f1c('0x41')](_0x4802ff[_0x6f1c('0x3f')],{'$or':_[_0x6f1c('0x2e')](_0x560bfc,function(_0x4812f8){if(_0x4812f8[_0x6f1c('0x32')]!==_0x6f1c('0x42')){var _0x43a6b4={};_0x43a6b4[_0x4812f8[_0x6f1c('0x2b')]]={'$like':'%'+_0x16bc13[_0x6f1c('0x35')][_0x6f1c('0x40')]+'%'};return _0x43a6b4;}})});}_0x4802ff=_['merge']({},_0x4802ff,_0x16bc13[_0x6f1c('0x43')]);var _0x421b81={'where':_0x4802ff[_0x6f1c('0x3f')]};return db['VtigerField'][_0x6f1c('0x21')](_0x421b81)['then'](function(_0x226a2a){_0x42cf44[_0x6f1c('0x21')]=_0x226a2a;if(_0x16bc13['query'][_0x6f1c('0x44')]){_0x4802ff[_0x6f1c('0x45')]=[{'all':!![]}];}return db[_0x6f1c('0x2f')][_0x6f1c('0x46')](_0x4802ff);})[_0x6f1c('0x27')](function(_0x2ca344){_0x42cf44['rows']=_0x2ca344;return _0x42cf44;})[_0x6f1c('0x27')](respondWithFilteredResult(_0x657928,_0x4802ff))[_0x6f1c('0x47')](handleError(_0x657928,null));};exports[_0x6f1c('0x48')]=function(_0x4125ff,_0x36daf8){var _0x4dd308={'raw':!![],'where':{'id':_0x4125ff[_0x6f1c('0x49')]['id']}},_0x53a83e={};_0x53a83e['model']=_[_0x6f1c('0x36')](db[_0x6f1c('0x2f')][_0x6f1c('0x30')]);_0x53a83e[_0x6f1c('0x35')]=_['keys'](_0x4125ff[_0x6f1c('0x35')]);_0x53a83e[_0x6f1c('0x37')]=_['intersection'](_0x53a83e[_0x6f1c('0x34')],_0x53a83e['query']);_0x4dd308[_0x6f1c('0x39')]=_[_0x6f1c('0x38')](_0x53a83e[_0x6f1c('0x34')],qs['fields'](_0x4125ff[_0x6f1c('0x35')][_0x6f1c('0x3a')]));_0x4dd308['attributes']=_0x4dd308[_0x6f1c('0x39')][_0x6f1c('0x3b')]?_0x4dd308[_0x6f1c('0x39')]:_0x53a83e['model'];if(_0x4125ff[_0x6f1c('0x35')]['includeAll']){_0x4dd308[_0x6f1c('0x45')]=[{'all':!![]}];}_0x4dd308=_[_0x6f1c('0x41')]({},_0x4dd308,_0x4125ff[_0x6f1c('0x43')]);return db[_0x6f1c('0x2f')]['find'](_0x4dd308)[_0x6f1c('0x27')](handleEntityNotFound(_0x36daf8,null))['then'](respondWithResult(_0x36daf8,null))[_0x6f1c('0x47')](handleError(_0x36daf8,null));};exports['create']=function(_0x1863f8,_0x5ec9fe){return db['VtigerField'][_0x6f1c('0x4a')](_0x1863f8[_0x6f1c('0x4b')],{})[_0x6f1c('0x27')](respondWithResult(_0x5ec9fe,0xc9))[_0x6f1c('0x47')](handleError(_0x5ec9fe,null));};exports['update']=function(_0x39f01f,_0x29cef6){if(_0x39f01f[_0x6f1c('0x4b')]['id']){delete _0x39f01f[_0x6f1c('0x4b')]['id'];}return db[_0x6f1c('0x2f')][_0x6f1c('0x4c')]({'where':{'id':_0x39f01f['params']['id']}})[_0x6f1c('0x27')](handleEntityNotFound(_0x29cef6,null))['then'](saveUpdates(_0x39f01f[_0x6f1c('0x4b')],null))[_0x6f1c('0x27')](respondWithResult(_0x29cef6,null))['catch'](handleError(_0x29cef6,null));};exports['destroy']=function(_0x23a307,_0x28a945){return db[_0x6f1c('0x2f')]['find']({'where':{'id':_0x23a307['params']['id']}})[_0x6f1c('0x27')](handleEntityNotFound(_0x28a945,null))[_0x6f1c('0x27')](removeEntity(_0x28a945,null))['catch'](handleError(_0x28a945,null));};
\ No newline at end of file
+var _0x9434=['model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','fields','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','sendStatus','send','map','VtigerField','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection'];(function(_0x51d284,_0x511172){var _0x1cb64a=function(_0x20a452){while(--_0x20a452){_0x51d284['push'](_0x51d284['shift']());}};_0x1cb64a(++_0x511172);}(_0x9434,0x1da));var _0x4943=function(_0x49d843,_0x5b1a3f){_0x49d843=_0x49d843-0x0;var _0xc15971=_0x9434[_0x49d843];return _0xc15971;};'use strict';var emlformat=require(_0x4943('0x0'));var rimraf=require(_0x4943('0x1'));var zipdir=require(_0x4943('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4943('0x3'));var moment=require(_0x4943('0x4'));var BPromise=require(_0x4943('0x5'));var Mustache=require(_0x4943('0x6'));var util=require(_0x4943('0x7'));var path=require(_0x4943('0x8'));var sox=require(_0x4943('0x9'));var csv=require('to-csv');var ejs=require(_0x4943('0xa'));var fs=require('fs');var fs_extra=require(_0x4943('0xb'));var _=require(_0x4943('0xc'));var squel=require(_0x4943('0xd'));var crypto=require('crypto');var jsforce=require(_0x4943('0xe'));var deskjs=require(_0x4943('0xf'));var toCsv=require(_0x4943('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4943('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4943('0x12'));var hardwareService=require(_0x4943('0x13'));var logger=require(_0x4943('0x14'))('api');var utils=require(_0x4943('0x15'));var config=require(_0x4943('0x16'));var licenseUtil=require(_0x4943('0x17'));var db=require(_0x4943('0x18'))['db'];function respondWithStatusCode(_0x263522,_0x4ffab0){_0x4ffab0=_0x4ffab0||0xcc;return function(_0x1be850){if(_0x1be850){return _0x263522['sendStatus'](_0x4ffab0);}return _0x263522[_0x4943('0x19')](_0x4ffab0)[_0x4943('0x1a')]();};}function respondWithResult(_0x3565f4,_0x3f4338){_0x3f4338=_0x3f4338||0xc8;return function(_0x340675){if(_0x340675){return _0x3565f4['status'](_0x3f4338)[_0x4943('0x1b')](_0x340675);}};}function respondWithFilteredResult(_0x557ddc,_0x23e716){return function(_0x5142df){if(_0x5142df){var _0x51b5e5=typeof _0x23e716['offset']==='undefined'&&typeof _0x23e716[_0x4943('0x1c')]===_0x4943('0x1d');var _0xde2083=_0x5142df[_0x4943('0x1e')];var _0x4ec927=_0x51b5e5?0x0:_0x23e716[_0x4943('0x1f')];var _0x1bc24e=_0x51b5e5?_0x5142df[_0x4943('0x1e')]:_0x23e716[_0x4943('0x1f')]+_0x23e716['limit'];var _0x68721b;if(_0x1bc24e>=_0xde2083){_0x1bc24e=_0xde2083;_0x68721b=0xc8;}else{_0x68721b=0xce;}_0x557ddc[_0x4943('0x19')](_0x68721b);return _0x557ddc[_0x4943('0x20')]('Content-Range',_0x4ec927+'-'+_0x1bc24e+'/'+_0xde2083)[_0x4943('0x1b')](_0x5142df);}return null;};}function patchUpdates(_0x14e01b){return function(_0xacc951){try{jsonpatch[_0x4943('0x21')](_0xacc951,_0x14e01b,!![]);}catch(_0xb01353){return BPromise[_0x4943('0x22')](_0xb01353);}return _0xacc951[_0x4943('0x23')]();};}function saveUpdates(_0x373c20,_0x370db8){return function(_0x33e1af){if(_0x33e1af){return _0x33e1af[_0x4943('0x24')](_0x373c20)[_0x4943('0x25')](function(_0x45f74a){return _0x45f74a;});}return null;};}function removeEntity(_0x54f61b,_0x1a7b6f){return function(_0x4b8702){if(_0x4b8702){return _0x4b8702['destroy']()[_0x4943('0x25')](function(){_0x54f61b['status'](0xcc)[_0x4943('0x1a')]();});}};}function handleEntityNotFound(_0x5f33a1,_0x37befa){return function(_0x4a8f4b){if(!_0x4a8f4b){_0x5f33a1[_0x4943('0x26')](0x194);}return _0x4a8f4b;};}function handleError(_0x28d772,_0x3e305e){_0x3e305e=_0x3e305e||0x1f4;return function(_0x2c5c3a){logger['error'](_0x2c5c3a['stack']);if(_0x2c5c3a['name']){delete _0x2c5c3a['name'];}_0x28d772[_0x4943('0x19')](_0x3e305e)[_0x4943('0x27')](_0x2c5c3a);};}exports['index']=function(_0x5d4ede,_0xfeb2f8){var _0x22ab4d={},_0x454840={},_0x37510c={'count':0x0,'rows':[]};var _0x4f5c44=_[_0x4943('0x28')](db[_0x4943('0x29')][_0x4943('0x2a')],function(_0x4cf547){return{'name':_0x4cf547[_0x4943('0x2b')],'type':_0x4cf547[_0x4943('0x2c')][_0x4943('0x2d')]};});_0x454840['model']=_['map'](_0x4f5c44,_0x4943('0x2e'));_0x454840[_0x4943('0x2f')]=_[_0x4943('0x30')](_0x5d4ede[_0x4943('0x2f')]);_0x454840[_0x4943('0x31')]=_[_0x4943('0x32')](_0x454840[_0x4943('0x33')],_0x454840[_0x4943('0x2f')]);_0x22ab4d[_0x4943('0x34')]=_[_0x4943('0x32')](_0x454840[_0x4943('0x33')],qs['fields'](_0x5d4ede['query']['fields']));_0x22ab4d['attributes']=_0x22ab4d[_0x4943('0x34')][_0x4943('0x35')]?_0x22ab4d[_0x4943('0x34')]:_0x454840[_0x4943('0x33')];if(!_0x5d4ede[_0x4943('0x2f')][_0x4943('0x36')]('nolimit')){_0x22ab4d['limit']=qs['limit'](_0x5d4ede[_0x4943('0x2f')][_0x4943('0x1c')]);_0x22ab4d[_0x4943('0x1f')]=qs[_0x4943('0x1f')](_0x5d4ede[_0x4943('0x2f')][_0x4943('0x1f')]);}_0x22ab4d[_0x4943('0x37')]=qs[_0x4943('0x38')](_0x5d4ede['query'][_0x4943('0x38')]);_0x22ab4d[_0x4943('0x39')]=qs[_0x4943('0x31')](_[_0x4943('0x3a')](_0x5d4ede[_0x4943('0x2f')],_0x454840[_0x4943('0x31')]),_0x4f5c44);if(_0x5d4ede[_0x4943('0x2f')][_0x4943('0x3b')]){_0x22ab4d[_0x4943('0x39')]=_['merge'](_0x22ab4d[_0x4943('0x39')],{'$or':_[_0x4943('0x28')](_0x4f5c44,function(_0x3ddb3c){if(_0x3ddb3c[_0x4943('0x2c')]!==_0x4943('0x3c')){var _0x27f024={};_0x27f024[_0x3ddb3c['name']]={'$like':'%'+_0x5d4ede[_0x4943('0x2f')][_0x4943('0x3b')]+'%'};return _0x27f024;}})});}_0x22ab4d=_[_0x4943('0x3d')]({},_0x22ab4d,_0x5d4ede['options']);var _0x3cc419={'where':_0x22ab4d['where']};return db[_0x4943('0x29')]['count'](_0x3cc419)[_0x4943('0x25')](function(_0x43374c){_0x37510c[_0x4943('0x1e')]=_0x43374c;if(_0x5d4ede[_0x4943('0x2f')]['includeAll']){_0x22ab4d[_0x4943('0x3e')]=[{'all':!![]}];}return db[_0x4943('0x29')][_0x4943('0x3f')](_0x22ab4d);})[_0x4943('0x25')](function(_0x2c6956){_0x37510c[_0x4943('0x40')]=_0x2c6956;return _0x37510c;})['then'](respondWithFilteredResult(_0xfeb2f8,_0x22ab4d))[_0x4943('0x41')](handleError(_0xfeb2f8,null));};exports[_0x4943('0x42')]=function(_0x5dc2c0,_0x2aae7d){var _0x1dac65={'raw':!![],'where':{'id':_0x5dc2c0[_0x4943('0x43')]['id']}},_0x3ce1da={};_0x3ce1da['model']=_[_0x4943('0x30')](db[_0x4943('0x29')][_0x4943('0x2a')]);_0x3ce1da[_0x4943('0x2f')]=_['keys'](_0x5dc2c0[_0x4943('0x2f')]);_0x3ce1da[_0x4943('0x31')]=_[_0x4943('0x32')](_0x3ce1da['model'],_0x3ce1da['query']);_0x1dac65[_0x4943('0x34')]=_[_0x4943('0x32')](_0x3ce1da[_0x4943('0x33')],qs['fields'](_0x5dc2c0['query'][_0x4943('0x44')]));_0x1dac65['attributes']=_0x1dac65[_0x4943('0x34')][_0x4943('0x35')]?_0x1dac65['attributes']:_0x3ce1da[_0x4943('0x33')];if(_0x5dc2c0[_0x4943('0x2f')][_0x4943('0x45')]){_0x1dac65['include']=[{'all':!![]}];}_0x1dac65=_[_0x4943('0x3d')]({},_0x1dac65,_0x5dc2c0[_0x4943('0x46')]);return db['VtigerField'][_0x4943('0x47')](_0x1dac65)[_0x4943('0x25')](handleEntityNotFound(_0x2aae7d,null))[_0x4943('0x25')](respondWithResult(_0x2aae7d,null))[_0x4943('0x41')](handleError(_0x2aae7d,null));};exports[_0x4943('0x48')]=function(_0x334e7d,_0x39b310){return db[_0x4943('0x29')][_0x4943('0x48')](_0x334e7d[_0x4943('0x49')],{})['then'](respondWithResult(_0x39b310,0xc9))['catch'](handleError(_0x39b310,null));};exports[_0x4943('0x24')]=function(_0x3ab5a1,_0x43e860){if(_0x3ab5a1[_0x4943('0x49')]['id']){delete _0x3ab5a1[_0x4943('0x49')]['id'];}return db[_0x4943('0x29')][_0x4943('0x47')]({'where':{'id':_0x3ab5a1[_0x4943('0x43')]['id']}})['then'](handleEntityNotFound(_0x43e860,null))['then'](saveUpdates(_0x3ab5a1[_0x4943('0x49')],null))[_0x4943('0x25')](respondWithResult(_0x43e860,null))[_0x4943('0x41')](handleError(_0x43e860,null));};exports[_0x4943('0x4a')]=function(_0x44aeea,_0x8bd7cf){return db[_0x4943('0x29')][_0x4943('0x47')]({'where':{'id':_0x44aeea[_0x4943('0x43')]['id']}})['then'](handleEntityNotFound(_0x8bd7cf,null))[_0x4943('0x25')](removeEntity(_0x8bd7cf,null))[_0x4943('0x41')](handleError(_0x8bd7cf,null));};
\ No newline at end of file
index ae4ec1b..0eca4de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b03=['util','../../config/logger','moment','bluebird','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash'];(function(_0x39ca1a,_0x57b00c){var _0x361802=function(_0x31a54a){while(--_0x31a54a){_0x39ca1a['push'](_0x39ca1a['shift']());}};_0x361802(++_0x57b00c);}(_0x7b03,0xd1));var _0x37b0=function(_0x4383e9,_0xa4b307){_0x4383e9=_0x4383e9-0x0;var _0x355405=_0x7b03[_0x4383e9];return _0x355405;};'use strict';var _=require(_0x37b0('0x0'));var util=require(_0x37b0('0x1'));var logger=require(_0x37b0('0x2'))('api');var moment=require(_0x37b0('0x3'));var BPromise=require(_0x37b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37b0('0x5'));var rimraf=require(_0x37b0('0x6'));var config=require('../../config/environment');var attributes=require(_0x37b0('0x7'));module[_0x37b0('0x8')]=function(_0x3d5683,_0x1534fa){return _0x3d5683[_0x37b0('0x9')](_0x37b0('0xa'),attributes,{'tableName':_0x37b0('0xb'),'paranoid':![],'indexes':[{'name':_0x37b0('0xc'),'fields':['idField',_0x37b0('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x55d7=['vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x55d7,0x84));var _0x755d=function(_0x58f678,_0x18b3cc){_0x58f678=_0x58f678-0x0;var _0x238aef=_0x55d7[_0x58f678];return _0x238aef;};'use strict';var _=require(_0x755d('0x0'));var util=require(_0x755d('0x1'));var logger=require(_0x755d('0x2'))(_0x755d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x755d('0x4'));var fs=require('fs');var path=require(_0x755d('0x5'));var rimraf=require(_0x755d('0x6'));var config=require(_0x755d('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x2bce2e,_0x56c078){return _0x2bce2e[_0x755d('0x8')](_0x755d('0x9'),attributes,{'tableName':_0x755d('0xa'),'paranoid':![],'indexes':[{'name':_0x755d('0xb'),'fields':['idField',_0x755d('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a2bcd31..e62cb01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2608=['rpc','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x47882e,_0x118306){var _0x276e4a=function(_0x48b951){while(--_0x48b951){_0x47882e['push'](_0x47882e['shift']());}};_0x276e4a(++_0x118306);}(_0x2608,0x1c8));var _0x8260=function(_0x19d507,_0x1f647a){_0x19d507=_0x19d507-0x0;var _0x5bb48a=_0x2608[_0x19d507];return _0x5bb48a;};'use strict';var _=require(_0x8260('0x0'));var util=require('util');var moment=require(_0x8260('0x1'));var BPromise=require(_0x8260('0x2'));var rs=require(_0x8260('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8260('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8260('0x5'))(_0x8260('0x6'));var config=require('../../config/environment');var jayson=require(_0x8260('0x7'));var client=jayson[_0x8260('0x8')][_0x8260('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2541e7,_0x3504cd,_0x45954d){return new BPromise(function(_0x491e4b,_0x52dbb6){return client['request'](_0x2541e7,_0x45954d)[_0x8260('0xa')](function(_0x54e5b9){logger[_0x8260('0xb')](_0x8260('0xc'),_0x3504cd,_0x8260('0xd'));logger[_0x8260('0xe')](_0x8260('0xf'),_0x3504cd,_0x8260('0xd'),JSON[_0x8260('0x10')](_0x54e5b9));if(_0x54e5b9[_0x8260('0x11')]){if(_0x54e5b9[_0x8260('0x11')][_0x8260('0x12')]===0x1f4){logger[_0x8260('0x11')]('VtigerField,\x20%s,\x20%s',_0x3504cd,_0x54e5b9['error'][_0x8260('0x13')]);return _0x52dbb6(_0x54e5b9[_0x8260('0x11')][_0x8260('0x13')]);}logger[_0x8260('0x11')](_0x8260('0xc'),_0x3504cd,_0x54e5b9[_0x8260('0x11')][_0x8260('0x13')]);return _0x491e4b(_0x54e5b9['error']['message']);}else{logger[_0x8260('0xb')]('VtigerField,\x20%s,\x20%s',_0x3504cd,'request\x20sent');_0x491e4b(_0x54e5b9[_0x8260('0x14')][_0x8260('0x13')]);}})[_0x8260('0x15')](function(_0x21b4e5){logger[_0x8260('0x11')](_0x8260('0xc'),_0x3504cd,_0x21b4e5);_0x52dbb6(_0x21b4e5);});});}
\ No newline at end of file
+var _0x27af=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','bluebird'];(function(_0x351e10,_0x393a7a){var _0x5c7ff9=function(_0x3ae837){while(--_0x3ae837){_0x351e10['push'](_0x351e10['shift']());}};_0x5c7ff9(++_0x393a7a);}(_0x27af,0x173));var _0xf27a=function(_0x125b06,_0x4d4ff4){_0x125b06=_0x125b06-0x0;var _0x3cc44b=_0x27af[_0x125b06];return _0x3cc44b;};'use strict';var _=require(_0xf27a('0x0'));var util=require(_0xf27a('0x1'));var moment=require('moment');var BPromise=require(_0xf27a('0x2'));var rs=require(_0xf27a('0x3'));var fs=require('fs');var Redis=require(_0xf27a('0x4'));var db=require(_0xf27a('0x5'))['db'];var utils=require(_0xf27a('0x6'));var logger=require(_0xf27a('0x7'))(_0xf27a('0x8'));var config=require(_0xf27a('0x9'));var jayson=require(_0xf27a('0xa'));var client=jayson[_0xf27a('0xb')][_0xf27a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24f1a3,_0x38a99a,_0x268560){return new BPromise(function(_0x195dd2,_0x23772a){return client[_0xf27a('0xd')](_0x24f1a3,_0x268560)['then'](function(_0x174153){logger[_0xf27a('0xe')](_0xf27a('0xf'),_0x38a99a,_0xf27a('0x10'));logger[_0xf27a('0x11')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x38a99a,_0xf27a('0x10'),JSON['stringify'](_0x174153));if(_0x174153[_0xf27a('0x12')]){if(_0x174153['error'][_0xf27a('0x13')]===0x1f4){logger[_0xf27a('0x12')](_0xf27a('0xf'),_0x38a99a,_0x174153[_0xf27a('0x12')][_0xf27a('0x14')]);return _0x23772a(_0x174153['error'][_0xf27a('0x14')]);}logger['error'](_0xf27a('0xf'),_0x38a99a,_0x174153[_0xf27a('0x12')][_0xf27a('0x14')]);return _0x195dd2(_0x174153[_0xf27a('0x12')][_0xf27a('0x14')]);}else{logger['info'](_0xf27a('0xf'),_0x38a99a,_0xf27a('0x10'));_0x195dd2(_0x174153['result']['message']);}})[_0xf27a('0x15')](function(_0x6762eb){logger[_0xf27a('0x12')](_0xf27a('0xf'),_0x38a99a,_0x6762eb);_0x23772a(_0x6762eb);});});}
\ No newline at end of file
index 00901fa..f73d908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4815=['index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x15134b,_0x4c8646){var _0x506724=function(_0x46c6e1){while(--_0x46c6e1){_0x15134b['push'](_0x15134b['shift']());}};_0x506724(++_0x4c8646);}(_0x4815,0x1f1));var _0x5481=function(_0x1eac83,_0x306e81){_0x1eac83=_0x1eac83-0x0;var _0x26ff80=_0x4815[_0x1eac83];return _0x26ff80;};'use strict';var multer=require(_0x5481('0x0'));var util=require('util');var path=require(_0x5481('0x1'));var timeout=require(_0x5481('0x2'));var express=require(_0x5481('0x3'));var router=express['Router']();var fs_extra=require(_0x5481('0x4'));var auth=require(_0x5481('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5481('0x6'));var controller=require(_0x5481('0x7'));router[_0x5481('0x8')]('/',auth['isAuthenticated'](),controller[_0x5481('0x9')]);router['get'](_0x5481('0xa'),auth['isAuthenticated'](),controller[_0x5481('0xb')]);router[_0x5481('0x8')](_0x5481('0xc'),auth[_0x5481('0xd')](),controller[_0x5481('0xe')]);router[_0x5481('0x8')](_0x5481('0xf'),auth[_0x5481('0xd')](),controller[_0x5481('0x10')]);router[_0x5481('0x11')]('/',auth[_0x5481('0xd')](),controller[_0x5481('0x12')]);router[_0x5481('0x11')](_0x5481('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x5481('0xa'),auth[_0x5481('0xd')](),controller[_0x5481('0x13')]);router[_0x5481('0x14')](_0x5481('0xa'),auth[_0x5481('0xd')](),controller[_0x5481('0x15')]);module[_0x5481('0x16')]=router;
\ No newline at end of file
+var _0x2e6d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','destroy','exports','multer'];(function(_0x5e5d5e,_0x4ccaa9){var _0x170d49=function(_0x47b76d){while(--_0x47b76d){_0x5e5d5e['push'](_0x5e5d5e['shift']());}};_0x170d49(++_0x4ccaa9);}(_0x2e6d,0x12b));var _0xd2e6=function(_0x1e0f46,_0xde5b2){_0x1e0f46=_0x1e0f46-0x0;var _0x33ee9b=_0x2e6d[_0x1e0f46];return _0x33ee9b;};'use strict';var multer=require(_0xd2e6('0x0'));var util=require(_0xd2e6('0x1'));var path=require(_0xd2e6('0x2'));var timeout=require(_0xd2e6('0x3'));var express=require(_0xd2e6('0x4'));var router=express[_0xd2e6('0x5')]();var fs_extra=require(_0xd2e6('0x6'));var auth=require(_0xd2e6('0x7'));var interaction=require(_0xd2e6('0x8'));var config=require(_0xd2e6('0x9'));var controller=require(_0xd2e6('0xa'));router[_0xd2e6('0xb')]('/',auth[_0xd2e6('0xc')](),controller[_0xd2e6('0xd')]);router[_0xd2e6('0xb')]('/:id',auth[_0xd2e6('0xc')](),controller[_0xd2e6('0xe')]);router[_0xd2e6('0xb')](_0xd2e6('0xf'),auth[_0xd2e6('0xc')](),controller['getConfigurations']);router[_0xd2e6('0xb')](_0xd2e6('0x10'),auth[_0xd2e6('0xc')](),controller[_0xd2e6('0x11')]);router[_0xd2e6('0x12')]('/',auth[_0xd2e6('0xc')](),controller[_0xd2e6('0x13')]);router[_0xd2e6('0x12')]('/:id/configurations',auth[_0xd2e6('0xc')](),controller[_0xd2e6('0x14')]);router['put'](_0xd2e6('0x15'),auth['isAuthenticated'](),controller[_0xd2e6('0x16')]);router['delete'](_0xd2e6('0x15'),auth[_0xd2e6('0xc')](),controller[_0xd2e6('0x17')]);module[_0xd2e6('0x18')]=router;
\ No newline at end of file
index 33f8904..426c849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x12e9fe,_0x69b722){var _0x39ff19=function(_0x4169cb){while(--_0x4169cb){_0x12e9fe['push'](_0x12e9fe['shift']());}};_0x39ff19(++_0x69b722);}(_0x687b,0x14a));var _0xb687=function(_0x1b79f5,_0x1cf93a){_0x1b79f5=_0x1b79f5-0x0;var _0x26a6f1=_0x687b[_0x1b79f5];return _0x26a6f1;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')]},'description':{'type':Sequelize[_0xb687('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xb687('0x2')]},'token':{'type':Sequelize[_0xb687('0x2')]},'remoteUri':{'type':Sequelize[_0xb687('0x2')],'unique':_0xb687('0x3')},'authType':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5'),_0xb687('0x6')),'defaultValue':_0xb687('0x5')},'serverUrl':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb687('0x4')]('integrationTab',_0xb687('0x7')),'defaultValue':_0xb687('0x8')}};
\ No newline at end of file
+var _0xbb67=['integrationTab','newTab','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0x13998e,_0x2840c9){var _0x1fad59=function(_0x2626ce){while(--_0x2626ce){_0x13998e['push'](_0x13998e['shift']());}};_0x1fad59(++_0x2840c9);}(_0xbb67,0x161));var _0x7bb6=function(_0x30cd2f,_0x4afc86){_0x30cd2f=_0x30cd2f-0x0;var _0xe424c=_0xbb67[_0x30cd2f];return _0xe424c;};'use strict';var Sequelize=require('sequelize');module[_0x7bb6('0x0')]={'name':{'type':Sequelize[_0x7bb6('0x1')]},'description':{'type':Sequelize[_0x7bb6('0x1')]},'username':{'type':Sequelize[_0x7bb6('0x1')],'unique':_0x7bb6('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x7bb6('0x1')]},'remoteUri':{'type':Sequelize[_0x7bb6('0x1')],'unique':_0x7bb6('0x3')},'authType':{'type':Sequelize[_0x7bb6('0x4')](_0x7bb6('0x5'),_0x7bb6('0x6')),'defaultValue':_0x7bb6('0x5')},'serverUrl':{'type':Sequelize[_0x7bb6('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7bb6('0x7'),_0x7bb6('0x8')),'defaultValue':_0x7bb6('0x7')}};
\ No newline at end of file
index 75c83a5..5f730ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','rawAttributes','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','ticket_fields','Basic\x20%s','%s:%s','password','headers','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','ZendeskAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x3ef813,_0x46ec30){var _0x5a6126=function(_0x2cc22c){while(--_0x2cc22c){_0x3ef813['push'](_0x3ef813['shift']());}};_0x5a6126(++_0x46ec30);}(_0xb10b,0x12a));var _0xbb10=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0xb10b[_0x13187a];return _0x65b85f;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];var integrations=require(_0xbb10('0x18'));function respondWithStatusCode(_0x285009,_0x193a27){_0x193a27=_0x193a27||0xcc;return function(_0x442548){if(_0x442548){return _0x285009[_0xbb10('0x19')](_0x193a27);}return _0x285009['status'](_0x193a27)[_0xbb10('0x1a')]();};}function respondWithResult(_0x42d7e4,_0x45b9d6){_0x45b9d6=_0x45b9d6||0xc8;return function(_0x17fd46){if(_0x17fd46){return _0x42d7e4[_0xbb10('0x1b')](_0x45b9d6)[_0xbb10('0x1c')](_0x17fd46);}};}function respondWithFilteredResult(_0x24a57b,_0x36b5e8){return function(_0x3e26f4){if(_0x3e26f4){var _0x2b184e=typeof _0x36b5e8['offset']===_0xbb10('0x1d')&&typeof _0x36b5e8[_0xbb10('0x1e')]===_0xbb10('0x1d');var _0x42db98=_0x3e26f4[_0xbb10('0x1f')];var _0x1682a4=_0x2b184e?0x0:_0x36b5e8[_0xbb10('0x20')];var _0x30efc6=_0x2b184e?_0x3e26f4[_0xbb10('0x1f')]:_0x36b5e8[_0xbb10('0x20')]+_0x36b5e8['limit'];var _0x5ff0cf;if(_0x30efc6>=_0x42db98){_0x30efc6=_0x42db98;_0x5ff0cf=0xc8;}else{_0x5ff0cf=0xce;}_0x24a57b[_0xbb10('0x1b')](_0x5ff0cf);return _0x24a57b[_0xbb10('0x21')](_0xbb10('0x22'),_0x1682a4+'-'+_0x30efc6+'/'+_0x42db98)[_0xbb10('0x1c')](_0x3e26f4);}return null;};}function patchUpdates(_0x44e563){return function(_0x4deb49){try{jsonpatch[_0xbb10('0x23')](_0x4deb49,_0x44e563,!![]);}catch(_0x12ef77){return BPromise['reject'](_0x12ef77);}return _0x4deb49['save']();};}function saveUpdates(_0x8e2b97,_0x311abe){return function(_0x2e911d){if(_0x2e911d){return _0x2e911d[_0xbb10('0x24')](_0x8e2b97)[_0xbb10('0x25')](function(_0x1824b7){return _0x1824b7;});}return null;};}function removeEntity(_0x407cb4,_0x436104){return function(_0x7f2377){if(_0x7f2377){return _0x7f2377[_0xbb10('0x26')]()[_0xbb10('0x25')](function(){_0x407cb4[_0xbb10('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x19')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x27')](_0x2fdde9[_0xbb10('0x28')]);if(_0x2fdde9[_0xbb10('0x29')]){delete _0x2fdde9[_0xbb10('0x29')];}_0x2c89b9[_0xbb10('0x1b')](_0x4e25ff)[_0xbb10('0x2a')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2b')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2c')][_0xbb10('0x2d')]};});_0x2e0249[_0xbb10('0x2e')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x2e0249[_0xbb10('0x2e')],_0x2e0249[_0xbb10('0x2f')]);_0xfc3595[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x2e0249[_0xbb10('0x2e')],qs['fields'](_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x34')]));_0xfc3595[_0xbb10('0x33')]=_0xfc3595[_0xbb10('0x33')][_0xbb10('0x35')]?_0xfc3595[_0xbb10('0x33')]:_0x2e0249[_0xbb10('0x2e')];if(!_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x36')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x20')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x37')]=qs[_0xbb10('0x38')](_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x38')]);_0xfc3595[_0xbb10('0x39')]=qs[_0xbb10('0x31')](_['pick'](_0x3796c7[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x31')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3a')](_0xfc3595[_0xbb10('0x39')],{'$or':_[_0xbb10('0x3b')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2c')]!==_0xbb10('0x3c')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x3d')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3a')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3e')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x39')]};return db[_0xbb10('0x2b')]['count'](_0x4f1cdd)[_0xbb10('0x25')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1f')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x3f')]){_0xfc3595[_0xbb10('0x40')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xbb10('0x41')](_0xfc3595);})[_0xbb10('0x25')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x42')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x43')](handleError(_0x21ac54,null));};exports[_0xbb10('0x44')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x45')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2b')]['rawAttributes']);_0x351484[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x23dc18['query']);_0x351484[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x351484[_0xbb10('0x2e')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x351484[_0xbb10('0x2e')],qs[_0xbb10('0x34')](_0x23dc18[_0xbb10('0x2f')][_0xbb10('0x34')]));_0x5e2cfa[_0xbb10('0x33')]=_0x5e2cfa[_0xbb10('0x33')][_0xbb10('0x35')]?_0x5e2cfa[_0xbb10('0x33')]:_0x351484[_0xbb10('0x2e')];if(_0x23dc18[_0xbb10('0x2f')]['includeAll']){_0x5e2cfa[_0xbb10('0x40')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3a')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2b')][_0xbb10('0x46')](_0x5e2cfa)[_0xbb10('0x25')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x25')](respondWithResult(_0x403beb,null))[_0xbb10('0x43')](handleError(_0x403beb,null));};exports[_0xbb10('0x47')]=function(_0x3e06b0,_0x5be85e){return db['ZendeskAccount'][_0xbb10('0x47')](_0x3e06b0[_0xbb10('0x48')],{})[_0xbb10('0x25')](respondWithResult(_0x5be85e,0xc9))['catch'](handleError(_0x5be85e,null));};exports['update']=function(_0x3cd6f3,_0x34cf4e){if(_0x3cd6f3[_0xbb10('0x48')]['id']){delete _0x3cd6f3[_0xbb10('0x48')]['id'];}return db[_0xbb10('0x2b')][_0xbb10('0x46')]({'where':{'id':_0x3cd6f3[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x34cf4e,null))[_0xbb10('0x25')](saveUpdates(_0x3cd6f3[_0xbb10('0x48')],null))['then'](respondWithResult(_0x34cf4e,null))['catch'](handleError(_0x34cf4e,null));};exports[_0xbb10('0x26')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x2b')][_0xbb10('0x46')]({'where':{'id':_0x467dba[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x36ab7d,null))[_0xbb10('0x25')](removeEntity(_0x36ab7d,null))[_0xbb10('0x43')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x49')]=function(_0x19ca3e,_0x20e18a,_0x61e689){var _0x2e6fd9={};var _0x1d15f4={};var _0x547a7a;var _0x124052;return db['ZendeskAccount'][_0xbb10('0x4a')]({'where':{'id':_0x19ca3e[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x20e18a,null))[_0xbb10('0x25')](function(_0x26e66e){if(_0x26e66e){_0x547a7a=_0x26e66e;_0x1d15f4[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x4b')][_0xbb10('0x4c')]);_0x1d15f4[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x19ca3e[_0xbb10('0x2f')]);_0x1d15f4[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x1d15f4[_0xbb10('0x2e')],_0x1d15f4['query']);_0x2e6fd9[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x1d15f4[_0xbb10('0x2e')],qs[_0xbb10('0x34')](_0x19ca3e[_0xbb10('0x2f')][_0xbb10('0x34')]));_0x2e6fd9['attributes']=_0x2e6fd9[_0xbb10('0x33')][_0xbb10('0x35')]?_0x2e6fd9[_0xbb10('0x33')]:_0x1d15f4[_0xbb10('0x2e')];_0x2e6fd9[_0xbb10('0x37')]=qs[_0xbb10('0x38')](_0x19ca3e[_0xbb10('0x2f')][_0xbb10('0x38')]);_0x2e6fd9[_0xbb10('0x39')]=qs[_0xbb10('0x31')](_[_0xbb10('0x4d')](_0x19ca3e[_0xbb10('0x2f')],_0x1d15f4[_0xbb10('0x31')]));if(_0x19ca3e['query']['filter']){_0x2e6fd9[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x2e6fd9[_0xbb10('0x39')],{'$or':_[_0xbb10('0x3b')](_0x2e6fd9['attributes'],function(_0x506498){var _0x79411e={};_0x79411e[_0x506498]={'$like':'%'+_0x19ca3e[_0xbb10('0x2f')][_0xbb10('0x3d')]+'%'};return _0x79411e;})});}_0x2e6fd9=_[_0xbb10('0x3a')]({},_0x2e6fd9,_0x19ca3e[_0xbb10('0x3e')]);return _0x547a7a[_0xbb10('0x49')](_0x2e6fd9);}})[_0xbb10('0x25')](function(_0x4a5fb9){if(_0x4a5fb9){_0x124052=_0x4a5fb9[_0xbb10('0x35')];if(!_0x19ca3e[_0xbb10('0x2f')]['hasOwnProperty']('nolimit')){_0x2e6fd9['limit']=qs[_0xbb10('0x1e')](_0x19ca3e[_0xbb10('0x2f')][_0xbb10('0x1e')]);_0x2e6fd9['offset']=qs['offset'](_0x19ca3e['query'][_0xbb10('0x20')]);}return _0x547a7a[_0xbb10('0x49')](_0x2e6fd9);}})[_0xbb10('0x25')](function(_0x4e9fbd){if(_0x4e9fbd){return _0x4e9fbd?{'count':_0x124052,'rows':_0x4e9fbd}:null;}})[_0xbb10('0x25')](respondWithResult(_0x20e18a,null))[_0xbb10('0x43')](handleError(_0x20e18a,null));};exports['addConfiguration']=function(_0x4a560c,_0x27d7b9,_0x308896){if(_0x4a560c[_0xbb10('0x48')]['id']){delete _0x4a560c[_0xbb10('0x48')]['id'];}return db['ZendeskAccount'][_0xbb10('0x4a')]({'where':{'id':_0x4a560c[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x27d7b9,null))['then'](function(_0x402a01){if(_0x402a01){_0x4a560c[_0xbb10('0x48')][_0xbb10('0x4e')]=_0x402a01['id'];_0x4a560c['body'][_0xbb10('0x4f')]=integrations[_0xbb10('0x50')](_0x4a560c[_0xbb10('0x48')][_0xbb10('0x51')],_0x4a560c['body'][_0xbb10('0x2c')]);_0x4a560c[_0xbb10('0x48')][_0xbb10('0x52')]=integrations[_0xbb10('0x53')](_0x4a560c['body'][_0xbb10('0x51')],_0x4a560c[_0xbb10('0x48')][_0xbb10('0x2c')]);return db[_0xbb10('0x4b')][_0xbb10('0x47')](_0x4a560c[_0xbb10('0x48')],{'include':[{'model':db[_0xbb10('0x54')],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xbb10('0x25')](respondWithResult(_0x27d7b9,null))[_0xbb10('0x43')](handleError(_0x27d7b9,null));};exports[_0xbb10('0x55')]=function(_0x5c9afc,_0x5cd089,_0x46f462){var _0x1b11c0='';return db[_0xbb10('0x2b')][_0xbb10('0x4a')]({'where':{'id':_0x5c9afc[_0xbb10('0x45')]['id']},'attributes':['id',_0xbb10('0x56'),'password',_0xbb10('0x57'),_0xbb10('0x58'),_0xbb10('0x59')]})[_0xbb10('0x25')](handleEntityNotFound(_0x5cd089,null))[_0xbb10('0x25')](function(_0x5bfc68){if(_0x5bfc68){_0x1b11c0=_0x5bfc68['remoteUri'];var _0x5ad6ad=_0x1b11c0[_0xbb10('0x5a')](-0x1);if(_0x5ad6ad==='/'){_0x1b11c0=_0x1b11c0[_0xbb10('0x5b')](0x0,_0x1b11c0[_0xbb10('0x5c')](_0x5ad6ad));}var _0x21459e={'method':_0xbb10('0x5d'),'uri':util[_0xbb10('0x5e')]('%s/%s',_0x1b11c0,_0xbb10('0x5f')),'json':!![]};switch(_0x5bfc68['authType']){case'password':_0x21459e['headers']={'Authorization':util[_0xbb10('0x5e')](_0xbb10('0x60'),new Buffer(util[_0xbb10('0x5e')](_0xbb10('0x61'),_0x5bfc68['username'],_0x5bfc68[_0xbb10('0x62')]))['toString']('base64'))};break;case _0xbb10('0x57'):_0x21459e[_0xbb10('0x63')]={'Authorization':util[_0xbb10('0x5e')](_0xbb10('0x60'),new Buffer(util[_0xbb10('0x5e')]('%s/token:%s',_0x5bfc68[_0xbb10('0x56')],_0x5bfc68[_0xbb10('0x57')]))[_0xbb10('0x64')](_0xbb10('0x65')))};break;default:throw new db[(_0xbb10('0x66'))][(_0xbb10('0x67'))](_0xbb10('0x68'));}return rp(_0x21459e);}})['then'](function(_0x387b10){if(_0x387b10){var _0x1f648a=[_0xbb10('0x69'),_0xbb10('0x6a'),_0xbb10('0x6b'),_0xbb10('0x6c')];_[_0xbb10('0x6d')](_0x387b10[_0xbb10('0x5f')],function(_0x5a4429){return _0x1f648a[_0xbb10('0x6e')](_0x5a4429[_0xbb10('0x2c')]);});return{'count':_0x387b10[_0xbb10('0x5f')]['length'],'rows':_['map'](_0x387b10['ticket_fields'],function(_0x23286d){return{'id':_0x23286d['id'],'name':_0x23286d['position']>0x7?_0x23286d['title']:_0x23286d[_0xbb10('0x2c')],'custom':_0x23286d[_0xbb10('0x6f')]>0x7?!![]:![],'options':_0x23286d[_0xbb10('0x70')]?_0x23286d[_0xbb10('0x70')]:_0x23286d[_0xbb10('0x71')]?_0x23286d[_0xbb10('0x71')]:[]};})};}})[_0xbb10('0x25')](respondWithResult(_0x5cd089,null))[_0xbb10('0x43')](function(_0x188b97){var _0x5206e1=_0x5c9afc[_0xbb10('0x2f')][_0xbb10('0x72')]?0x1f4:_0x188b97[_0xbb10('0x73')]||0x1f4;logger[_0xbb10('0x27')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5206e1,JSON[_0xbb10('0x74')](_0x188b97));delete _0x188b97[_0xbb10('0x29')];if(_0x5206e1===0x191){_0x5206e1=0x190;}_0x5cd089[_0xbb10('0x1b')](_0x5206e1)[_0xbb10('0x2a')](_0x5c9afc['query'][_0xbb10('0x72')]?{'message':_0xbb10('0x75'),'statusCode':_0x188b97[_0xbb10('0x73')]}:_0x188b97);});};
\ No newline at end of file
+var _0xda3f=['description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','getFields','stringify','send','test','statusCode','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskAccount','includeAll','include','params','length','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','options','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','username','password','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xda3f,0xec));var _0xfda3=function(_0x172df3,_0x258701){_0x172df3=_0x172df3-0x0;var _0x331738=_0xda3f[_0x172df3];return _0x331738;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x583125,_0x5d7d5b){_0x5d7d5b=_0x5d7d5b||0xcc;return function(_0x3fd031){if(_0x3fd031){return _0x583125[_0xfda3('0x17')](_0x5d7d5b);}return _0x583125['status'](_0x5d7d5b)['end']();};}function respondWithResult(_0x587e9b,_0x227d72){_0x227d72=_0x227d72||0xc8;return function(_0x477fc0){if(_0x477fc0){return _0x587e9b['status'](_0x227d72)['json'](_0x477fc0);}};}function respondWithFilteredResult(_0x533365,_0x80ea80){return function(_0x474707){if(_0x474707){var _0x249dc6=typeof _0x80ea80[_0xfda3('0x18')]===_0xfda3('0x19')&&typeof _0x80ea80[_0xfda3('0x1a')]===_0xfda3('0x19');var _0x93c8ef=_0x474707[_0xfda3('0x1b')];var _0xc62ae6=_0x249dc6?0x0:_0x80ea80['offset'];var _0x15ddb9=_0x249dc6?_0x474707[_0xfda3('0x1b')]:_0x80ea80[_0xfda3('0x18')]+_0x80ea80[_0xfda3('0x1a')];var _0x59a887;if(_0x15ddb9>=_0x93c8ef){_0x15ddb9=_0x93c8ef;_0x59a887=0xc8;}else{_0x59a887=0xce;}_0x533365[_0xfda3('0x1c')](_0x59a887);return _0x533365[_0xfda3('0x1d')](_0xfda3('0x1e'),_0xc62ae6+'-'+_0x15ddb9+'/'+_0x93c8ef)['json'](_0x474707);}return null;};}function patchUpdates(_0x5ad52a){return function(_0xa0449d){try{jsonpatch[_0xfda3('0x1f')](_0xa0449d,_0x5ad52a,!![]);}catch(_0x4ea9f5){return BPromise['reject'](_0x4ea9f5);}return _0xa0449d[_0xfda3('0x20')]();};}function saveUpdates(_0xef2535,_0x1e15a8){return function(_0x2c0ae9){if(_0x2c0ae9){return _0x2c0ae9[_0xfda3('0x21')](_0xef2535)[_0xfda3('0x22')](function(_0x2677f6){return _0x2677f6;});}return null;};}function removeEntity(_0xc6fb9a,_0x16eaa6){return function(_0x5499f5){if(_0x5499f5){return _0x5499f5[_0xfda3('0x23')]()[_0xfda3('0x22')](function(){_0xc6fb9a[_0xfda3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45a977,_0x39e246){return function(_0x172cfb){if(!_0x172cfb){_0x45a977[_0xfda3('0x17')](0x194);}return _0x172cfb;};}function handleError(_0x1cb831,_0xad9f7b){_0xad9f7b=_0xad9f7b||0x1f4;return function(_0x514d2a){logger[_0xfda3('0x24')](_0x514d2a[_0xfda3('0x25')]);if(_0x514d2a[_0xfda3('0x26')]){delete _0x514d2a[_0xfda3('0x26')];}_0x1cb831[_0xfda3('0x1c')](_0xad9f7b)['send'](_0x514d2a);};}exports[_0xfda3('0x27')]=function(_0x4101b1,_0x301509){var _0x474992={},_0xe21ec6={},_0x3cfeb2={'count':0x0,'rows':[]};var _0x26e544=_['map'](db['ZendeskAccount'][_0xfda3('0x28')],function(_0x4fd277){return{'name':_0x4fd277['fieldName'],'type':_0x4fd277[_0xfda3('0x29')][_0xfda3('0x2a')]};});_0xe21ec6[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x26e544,_0xfda3('0x26'));_0xe21ec6[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x4101b1[_0xfda3('0x2d')]);_0xe21ec6[_0xfda3('0x2f')]=_['intersection'](_0xe21ec6[_0xfda3('0x2b')],_0xe21ec6[_0xfda3('0x2d')]);_0x474992[_0xfda3('0x30')]=_[_0xfda3('0x31')](_0xe21ec6[_0xfda3('0x2b')],qs[_0xfda3('0x32')](_0x4101b1[_0xfda3('0x2d')][_0xfda3('0x32')]));_0x474992[_0xfda3('0x30')]=_0x474992['attributes']['length']?_0x474992[_0xfda3('0x30')]:_0xe21ec6[_0xfda3('0x2b')];if(!_0x4101b1['query'][_0xfda3('0x33')](_0xfda3('0x34'))){_0x474992[_0xfda3('0x1a')]=qs['limit'](_0x4101b1[_0xfda3('0x2d')][_0xfda3('0x1a')]);_0x474992[_0xfda3('0x18')]=qs[_0xfda3('0x18')](_0x4101b1[_0xfda3('0x2d')]['offset']);}_0x474992[_0xfda3('0x35')]=qs[_0xfda3('0x36')](_0x4101b1[_0xfda3('0x2d')]['sort']);_0x474992[_0xfda3('0x37')]=qs['filters'](_[_0xfda3('0x38')](_0x4101b1[_0xfda3('0x2d')],_0xe21ec6[_0xfda3('0x2f')]),_0x26e544);if(_0x4101b1[_0xfda3('0x2d')][_0xfda3('0x39')]){_0x474992[_0xfda3('0x37')]=_[_0xfda3('0x3a')](_0x474992[_0xfda3('0x37')],{'$or':_['map'](_0x26e544,function(_0x24c7ad){if(_0x24c7ad[_0xfda3('0x29')]!==_0xfda3('0x3b')){var _0x8ed2ba={};_0x8ed2ba[_0x24c7ad['name']]={'$like':'%'+_0x4101b1[_0xfda3('0x2d')][_0xfda3('0x39')]+'%'};return _0x8ed2ba;}})});}_0x474992=_[_0xfda3('0x3a')]({},_0x474992,_0x4101b1['options']);var _0x5ac61e={'where':_0x474992[_0xfda3('0x37')]};return db[_0xfda3('0x3c')][_0xfda3('0x1b')](_0x5ac61e)[_0xfda3('0x22')](function(_0x2b415d){_0x3cfeb2[_0xfda3('0x1b')]=_0x2b415d;if(_0x4101b1[_0xfda3('0x2d')][_0xfda3('0x3d')]){_0x474992[_0xfda3('0x3e')]=[{'all':!![]}];}return db[_0xfda3('0x3c')]['findAll'](_0x474992);})[_0xfda3('0x22')](function(_0x22b848){_0x3cfeb2['rows']=_0x22b848;return _0x3cfeb2;})[_0xfda3('0x22')](respondWithFilteredResult(_0x301509,_0x474992))['catch'](handleError(_0x301509,null));};exports['show']=function(_0x4e6886,_0x2208bc){var _0x107fb1={'raw':![],'where':{'id':_0x4e6886[_0xfda3('0x3f')]['id']}},_0x260977={};_0x260977['model']=_[_0xfda3('0x2e')](db[_0xfda3('0x3c')][_0xfda3('0x28')]);_0x260977[_0xfda3('0x2d')]=_['keys'](_0x4e6886[_0xfda3('0x2d')]);_0x260977[_0xfda3('0x2f')]=_[_0xfda3('0x31')](_0x260977['model'],_0x260977['query']);_0x107fb1[_0xfda3('0x30')]=_[_0xfda3('0x31')](_0x260977[_0xfda3('0x2b')],qs[_0xfda3('0x32')](_0x4e6886[_0xfda3('0x2d')][_0xfda3('0x32')]));_0x107fb1[_0xfda3('0x30')]=_0x107fb1[_0xfda3('0x30')][_0xfda3('0x40')]?_0x107fb1[_0xfda3('0x30')]:_0x260977[_0xfda3('0x2b')];if(_0x4e6886[_0xfda3('0x2d')][_0xfda3('0x3d')]){_0x107fb1[_0xfda3('0x3e')]=[{'all':!![]}];}_0x107fb1=_['merge']({},_0x107fb1,_0x4e6886['options']);return db[_0xfda3('0x3c')][_0xfda3('0x41')](_0x107fb1)[_0xfda3('0x22')](handleEntityNotFound(_0x2208bc,null))[_0xfda3('0x22')](respondWithResult(_0x2208bc,null))[_0xfda3('0x42')](handleError(_0x2208bc,null));};exports[_0xfda3('0x43')]=function(_0x192133,_0x125f5a){return db[_0xfda3('0x3c')][_0xfda3('0x43')](_0x192133['body'],{})[_0xfda3('0x22')](respondWithResult(_0x125f5a,0xc9))[_0xfda3('0x42')](handleError(_0x125f5a,null));};exports[_0xfda3('0x21')]=function(_0x36aa3a,_0x26496a){if(_0x36aa3a['body']['id']){delete _0x36aa3a[_0xfda3('0x44')]['id'];}return db[_0xfda3('0x3c')][_0xfda3('0x41')]({'where':{'id':_0x36aa3a['params']['id']}})[_0xfda3('0x22')](handleEntityNotFound(_0x26496a,null))[_0xfda3('0x22')](saveUpdates(_0x36aa3a[_0xfda3('0x44')],null))['then'](respondWithResult(_0x26496a,null))[_0xfda3('0x42')](handleError(_0x26496a,null));};exports[_0xfda3('0x23')]=function(_0x2f54eb,_0x2f6e62){return db[_0xfda3('0x3c')]['find']({'where':{'id':_0x2f54eb[_0xfda3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2f6e62,null))[_0xfda3('0x22')](removeEntity(_0x2f6e62,null))['catch'](handleError(_0x2f6e62,null));};exports[_0xfda3('0x45')]=function(_0x6447,_0x322b66,_0x26ffee){var _0x574f02={};var _0x244c24={};var _0x3b430d;var _0x2f2c32;return db[_0xfda3('0x3c')][_0xfda3('0x46')]({'where':{'id':_0x6447[_0xfda3('0x3f')]['id']}})[_0xfda3('0x22')](handleEntityNotFound(_0x322b66,null))['then'](function(_0x4b1410){if(_0x4b1410){_0x3b430d=_0x4b1410;_0x244c24[_0xfda3('0x2b')]=_[_0xfda3('0x2e')](db[_0xfda3('0x47')]['rawAttributes']);_0x244c24['query']=_[_0xfda3('0x2e')](_0x6447[_0xfda3('0x2d')]);_0x244c24[_0xfda3('0x2f')]=_[_0xfda3('0x31')](_0x244c24[_0xfda3('0x2b')],_0x244c24['query']);_0x574f02[_0xfda3('0x30')]=_[_0xfda3('0x31')](_0x244c24[_0xfda3('0x2b')],qs[_0xfda3('0x32')](_0x6447[_0xfda3('0x2d')][_0xfda3('0x32')]));_0x574f02[_0xfda3('0x30')]=_0x574f02[_0xfda3('0x30')][_0xfda3('0x40')]?_0x574f02[_0xfda3('0x30')]:_0x244c24[_0xfda3('0x2b')];_0x574f02[_0xfda3('0x35')]=qs['sort'](_0x6447[_0xfda3('0x2d')][_0xfda3('0x36')]);_0x574f02[_0xfda3('0x37')]=qs[_0xfda3('0x2f')](_[_0xfda3('0x38')](_0x6447[_0xfda3('0x2d')],_0x244c24[_0xfda3('0x2f')]));if(_0x6447['query']['filter']){_0x574f02[_0xfda3('0x37')]=_[_0xfda3('0x3a')](_0x574f02['where'],{'$or':_[_0xfda3('0x2c')](_0x574f02[_0xfda3('0x30')],function(_0x2a5efe){var _0x38dbc7={};_0x38dbc7[_0x2a5efe]={'$like':'%'+_0x6447['query']['filter']+'%'};return _0x38dbc7;})});}_0x574f02=_[_0xfda3('0x3a')]({},_0x574f02,_0x6447[_0xfda3('0x48')]);return _0x3b430d[_0xfda3('0x45')](_0x574f02);}})['then'](function(_0x23fd20){if(_0x23fd20){_0x2f2c32=_0x23fd20['length'];if(!_0x6447[_0xfda3('0x2d')][_0xfda3('0x33')](_0xfda3('0x34'))){_0x574f02[_0xfda3('0x1a')]=qs[_0xfda3('0x1a')](_0x6447[_0xfda3('0x2d')]['limit']);_0x574f02[_0xfda3('0x18')]=qs[_0xfda3('0x18')](_0x6447[_0xfda3('0x2d')][_0xfda3('0x18')]);}return _0x3b430d[_0xfda3('0x45')](_0x574f02);}})['then'](function(_0x5e9309){if(_0x5e9309){return _0x5e9309?{'count':_0x2f2c32,'rows':_0x5e9309}:null;}})[_0xfda3('0x22')](respondWithResult(_0x322b66,null))[_0xfda3('0x42')](handleError(_0x322b66,null));};exports['addConfiguration']=function(_0x550822,_0x512d7b,_0x248174){if(_0x550822[_0xfda3('0x44')]['id']){delete _0x550822['body']['id'];}return db[_0xfda3('0x3c')][_0xfda3('0x46')]({'where':{'id':_0x550822[_0xfda3('0x3f')]['id']}})[_0xfda3('0x22')](handleEntityNotFound(_0x512d7b,null))['then'](function(_0x1cd818){if(_0x1cd818){_0x550822[_0xfda3('0x44')][_0xfda3('0x49')]=_0x1cd818['id'];_0x550822[_0xfda3('0x44')][_0xfda3('0x4a')]=integrations[_0xfda3('0x4b')](_0x550822['body']['channel'],_0x550822[_0xfda3('0x44')]['type']);_0x550822[_0xfda3('0x44')][_0xfda3('0x4c')]=integrations[_0xfda3('0x4d')](_0x550822[_0xfda3('0x44')][_0xfda3('0x4e')],_0x550822[_0xfda3('0x44')][_0xfda3('0x29')]);return db[_0xfda3('0x47')][_0xfda3('0x43')](_0x550822[_0xfda3('0x44')],{'include':[{'model':db['ZendeskField'],'as':_0xfda3('0x4a')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xfda3('0x22')](respondWithResult(_0x512d7b,null))[_0xfda3('0x42')](handleError(_0x512d7b,null));};exports['getFields']=function(_0xa3b2e0,_0x26e1f5,_0x42e387){var _0x589c7a='';return db[_0xfda3('0x3c')][_0xfda3('0x46')]({'where':{'id':_0xa3b2e0[_0xfda3('0x3f')]['id']},'attributes':['id',_0xfda3('0x4f'),_0xfda3('0x50'),'token','authType','remoteUri']})[_0xfda3('0x22')](handleEntityNotFound(_0x26e1f5,null))[_0xfda3('0x22')](function(_0x4768dc){if(_0x4768dc){_0x589c7a=_0x4768dc[_0xfda3('0x51')];var _0x4407e8=_0x589c7a[_0xfda3('0x52')](-0x1);if(_0x4407e8==='/'){_0x589c7a=_0x589c7a['substring'](0x0,_0x589c7a[_0xfda3('0x53')](_0x4407e8));}var _0x6c5e9d={'method':_0xfda3('0x54'),'uri':util[_0xfda3('0x55')]('%s/%s',_0x589c7a,_0xfda3('0x56')),'json':!![]};switch(_0x4768dc['authType']){case _0xfda3('0x50'):_0x6c5e9d[_0xfda3('0x57')]={'Authorization':util[_0xfda3('0x55')](_0xfda3('0x58'),new Buffer(util[_0xfda3('0x55')](_0xfda3('0x59'),_0x4768dc[_0xfda3('0x4f')],_0x4768dc['password']))[_0xfda3('0x5a')](_0xfda3('0x5b')))};break;case _0xfda3('0x5c'):_0x6c5e9d[_0xfda3('0x57')]={'Authorization':util[_0xfda3('0x55')](_0xfda3('0x58'),new Buffer(util['format'](_0xfda3('0x5d'),_0x4768dc[_0xfda3('0x4f')],_0x4768dc[_0xfda3('0x5c')]))[_0xfda3('0x5a')](_0xfda3('0x5b')))};break;default:throw new db['Sequelize'][(_0xfda3('0x5e'))](_0xfda3('0x5f'));}return rp(_0x6c5e9d);}})[_0xfda3('0x22')](function(_0x42a092){if(_0x42a092){var _0xcb7ff4=[_0xfda3('0x60'),_0xfda3('0x61'),_0xfda3('0x62'),_0xfda3('0x63')];_[_0xfda3('0x64')](_0x42a092['ticket_fields'],function(_0x1c0e07){return _0xcb7ff4[_0xfda3('0x65')](_0x1c0e07[_0xfda3('0x29')]);});return{'count':_0x42a092[_0xfda3('0x56')][_0xfda3('0x40')],'rows':_['map'](_0x42a092['ticket_fields'],function(_0x232cd2){return{'id':_0x232cd2['id'],'name':_0x232cd2[_0xfda3('0x66')]>0x7?_0x232cd2[_0xfda3('0x67')]:_0x232cd2[_0xfda3('0x29')],'custom':_0x232cd2[_0xfda3('0x66')]>0x7?!![]:![],'options':_0x232cd2[_0xfda3('0x68')]?_0x232cd2[_0xfda3('0x68')]:_0x232cd2[_0xfda3('0x69')]?_0x232cd2[_0xfda3('0x69')]:[]};})};}})[_0xfda3('0x22')](respondWithResult(_0x26e1f5,null))[_0xfda3('0x42')](function(_0x593270){var _0x1ee8f4=_0xa3b2e0['query']['test']?0x1f4:_0x593270['statusCode']||0x1f4;logger[_0xfda3('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xfda3('0x6a'),_0x1ee8f4,JSON[_0xfda3('0x6b')](_0x593270));delete _0x593270['name'];if(_0x1ee8f4===0x191){_0x1ee8f4=0x190;}_0x26e1f5[_0xfda3('0x1c')](_0x1ee8f4)[_0xfda3('0x6c')](_0xa3b2e0['query'][_0xfda3('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x593270[_0xfda3('0x6e')]}:_0x593270);});};
\ No newline at end of file
index 5f8e103..237d1f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8e2=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports'];(function(_0x1d64ce,_0x59b1f2){var _0x5d1c0e=function(_0x1e0b59){while(--_0x1e0b59){_0x1d64ce['push'](_0x1d64ce['shift']());}};_0x5d1c0e(++_0x59b1f2);}(_0xa8e2,0x1e4));var _0x2a8e=function(_0x170b42,_0x15af03){_0x170b42=_0x170b42-0x0;var _0x3f1649=_0xa8e2[_0x170b42];return _0x3f1649;};'use strict';var _=require(_0x2a8e('0x0'));var util=require(_0x2a8e('0x1'));var logger=require(_0x2a8e('0x2'))(_0x2a8e('0x3'));var moment=require('moment');var BPromise=require(_0x2a8e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a8e('0x5'));var rimraf=require(_0x2a8e('0x6'));var config=require(_0x2a8e('0x7'));var attributes=require(_0x2a8e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x2a8e('0x9')]=function(_0x2f2426,_0x373710){return _0x2f2426[_0x2a8e('0xa')](_0x2a8e('0xb'),attributes,{'tableName':_0x2a8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c98=['api','moment','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c98,0x1ab));var _0x85c9=function(_0x4a81e5,_0x2ea101){_0x4a81e5=_0x4a81e5-0x0;var _0x237fc8=_0x5c98[_0x4a81e5];return _0x237fc8;};'use strict';var _=require('lodash');var util=require(_0x85c9('0x0'));var logger=require(_0x85c9('0x1'))(_0x85c9('0x2'));var moment=require(_0x85c9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x85c9('0x4'));var rimraf=require('rimraf');var config=require(_0x85c9('0x5'));var attributes=require(_0x85c9('0x6'));var integrations=require(_0x85c9('0x7'));module[_0x85c9('0x8')]=function(_0x569f0f,_0x2f5e30){return _0x569f0f[_0x85c9('0x9')]('ZendeskAccount',attributes,{'tableName':_0x85c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3e24526..44920b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5d3=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','request','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','model','GetZendeskAccount','ShowZendeskAccount','find','map','then','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5d3,0x175));var _0x3c5d=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0xc5d3[_0x3be2e2];return _0x53b9c5;};'use strict';var _=require(_0x3c5d('0x0'));var util=require(_0x3c5d('0x1'));var moment=require(_0x3c5d('0x2'));var BPromise=require(_0x3c5d('0x3'));var rs=require(_0x3c5d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c5d('0x5'))['db'];var utils=require(_0x3c5d('0x6'));var logger=require(_0x3c5d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3c5d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e96bf,_0xc5bb8a,_0x4adb7b){return new BPromise(function(_0x4b759a,_0x466f82){return client[_0x3c5d('0x9')](_0x4e96bf,_0x4adb7b)['then'](function(_0x220061){logger[_0x3c5d('0xa')](_0x3c5d('0xb'),_0xc5bb8a,'request\x20sent');logger[_0x3c5d('0xc')](_0x3c5d('0xd'),_0xc5bb8a,_0x3c5d('0xe'),JSON[_0x3c5d('0xf')](_0x220061));if(_0x220061[_0x3c5d('0x10')]){if(_0x220061['error'][_0x3c5d('0x11')]===0x1f4){logger[_0x3c5d('0x10')](_0x3c5d('0xb'),_0xc5bb8a,_0x220061[_0x3c5d('0x10')]['message']);return _0x466f82(_0x220061[_0x3c5d('0x10')][_0x3c5d('0x12')]);}logger['error'](_0x3c5d('0xb'),_0xc5bb8a,_0x220061[_0x3c5d('0x10')][_0x3c5d('0x12')]);return _0x4b759a(_0x220061[_0x3c5d('0x10')][_0x3c5d('0x12')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0xc5bb8a,_0x3c5d('0xe'));_0x4b759a(_0x220061['result'][_0x3c5d('0x12')]);}})[_0x3c5d('0x13')](function(_0x3969a6){logger[_0x3c5d('0x10')](_0x3c5d('0xb'),_0xc5bb8a,_0x3969a6);_0x466f82(_0x3969a6);});});}exports['GetZendeskAccount']=function(_0x4e3dab){var _0x114a0b=this;return new Promise(function(_0x4a1440,_0x3471b6){return db[_0x3c5d('0x14')][_0x3c5d('0x15')]({'raw':_0x4e3dab[_0x3c5d('0x16')]?_0x4e3dab[_0x3c5d('0x16')][_0x3c5d('0x17')]===undefined?!![]:![]:!![],'where':_0x4e3dab[_0x3c5d('0x16')]?_0x4e3dab[_0x3c5d('0x16')][_0x3c5d('0x18')]||null:null,'attributes':_0x4e3dab['options']?_0x4e3dab[_0x3c5d('0x16')][_0x3c5d('0x19')]||null:null,'limit':_0x4e3dab[_0x3c5d('0x16')]?_0x4e3dab['options'][_0x3c5d('0x1a')]||null:null,'include':_0x4e3dab[_0x3c5d('0x16')]?_0x4e3dab['options'][_0x3c5d('0x1b')]?_['map'](_0x4e3dab[_0x3c5d('0x16')]['include'],function(_0x3701ba){return{'model':db[_0x3701ba['model']],'as':_0x3701ba['as'],'attributes':_0x3701ba[_0x3c5d('0x19')],'include':_0x3701ba[_0x3c5d('0x1b')]?_['map'](_0x3701ba[_0x3c5d('0x1b')],function(_0x31f5df){return{'model':db[_0x31f5df[_0x3c5d('0x1c')]],'as':_0x31f5df['as'],'attributes':_0x31f5df[_0x3c5d('0x19')],'include':_0x31f5df[_0x3c5d('0x1b')]?_['map'](_0x31f5df[_0x3c5d('0x1b')],function(_0x3548eb){return{'model':db[_0x3548eb['model']],'as':_0x3548eb['as'],'attributes':_0x3548eb[_0x3c5d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x308201){logger['info'](_0x3c5d('0x1d'),_0x4e3dab);logger[_0x3c5d('0xc')]('GetZendeskAccount',_0x4e3dab,JSON['stringify'](_0x308201));_0x4a1440(_0x308201);})[_0x3c5d('0x13')](function(_0xba07c8){logger[_0x3c5d('0x10')]('GetZendeskAccount',_0xba07c8[_0x3c5d('0x12')],_0x4e3dab);_0x3471b6(_0x114a0b[_0x3c5d('0x10')](0x1f4,_0xba07c8[_0x3c5d('0x12')]));});});};exports[_0x3c5d('0x1e')]=function(_0x1b1bf2){var _0x45a72d=this;return new Promise(function(_0x479761,_0x122dc6){return db[_0x3c5d('0x14')][_0x3c5d('0x1f')]({'raw':_0x1b1bf2['options']?_0x1b1bf2['options'][_0x3c5d('0x17')]===undefined?!![]:![]:!![],'where':_0x1b1bf2['options']?_0x1b1bf2['options'][_0x3c5d('0x18')]||null:null,'attributes':_0x1b1bf2[_0x3c5d('0x16')]?_0x1b1bf2['options'][_0x3c5d('0x19')]||null:null,'include':_0x1b1bf2[_0x3c5d('0x16')]?_0x1b1bf2[_0x3c5d('0x16')][_0x3c5d('0x1b')]?_[_0x3c5d('0x20')](_0x1b1bf2[_0x3c5d('0x16')]['include'],function(_0x2347a1){return{'model':db[_0x2347a1['model']],'as':_0x2347a1['as'],'attributes':_0x2347a1[_0x3c5d('0x19')],'include':_0x2347a1[_0x3c5d('0x1b')]?_[_0x3c5d('0x20')](_0x2347a1[_0x3c5d('0x1b')],function(_0x492b39){return{'model':db[_0x492b39[_0x3c5d('0x1c')]],'as':_0x492b39['as'],'attributes':_0x492b39['attributes'],'include':_0x492b39['include']?_[_0x3c5d('0x20')](_0x492b39[_0x3c5d('0x1b')],function(_0x533f01){return{'model':db[_0x533f01[_0x3c5d('0x1c')]],'as':_0x533f01['as'],'attributes':_0x533f01['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c5d('0x21')](function(_0x297bf1){logger[_0x3c5d('0xa')](_0x3c5d('0x1e'),_0x1b1bf2);logger[_0x3c5d('0xc')](_0x3c5d('0x1e'),_0x1b1bf2,JSON[_0x3c5d('0xf')](_0x297bf1));_0x479761(_0x297bf1);})[_0x3c5d('0x13')](function(_0x43da6e){logger[_0x3c5d('0x10')](_0x3c5d('0x1e'),_0x43da6e[_0x3c5d('0x12')],_0x1b1bf2);_0x122dc6(_0x45a72d[_0x3c5d('0x10')](0x1f4,_0x43da6e[_0x3c5d('0x12')]));});});};
\ No newline at end of file
+var _0x94c6=['lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','GetZendeskAccount','findAll','options','raw','where','attributes','include','map','model','ShowZendeskAccount','ZendeskAccount','find'];(function(_0x5f1443,_0x325999){var _0x5e1e5d=function(_0x2cde91){while(--_0x2cde91){_0x5f1443['push'](_0x5f1443['shift']());}};_0x5e1e5d(++_0x325999);}(_0x94c6,0x14a));var _0x694c=function(_0x381428,_0x21a340){_0x381428=_0x381428-0x0;var _0x424a01=_0x94c6[_0x381428];return _0x424a01;};'use strict';var _=require(_0x694c('0x0'));var util=require(_0x694c('0x1'));var moment=require(_0x694c('0x2'));var BPromise=require(_0x694c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x694c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x694c('0x5'))('rpc');var config=require(_0x694c('0x6'));var jayson=require(_0x694c('0x7'));var client=jayson[_0x694c('0x8')][_0x694c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18aeae,_0x43ffdd,_0x1bc990){return new BPromise(function(_0x596ebc,_0x358813){return client[_0x694c('0xa')](_0x18aeae,_0x1bc990)[_0x694c('0xb')](function(_0x1dee1a){logger[_0x694c('0xc')](_0x694c('0xd'),_0x43ffdd,'request\x20sent');logger[_0x694c('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x43ffdd,'request\x20sent',JSON[_0x694c('0xf')](_0x1dee1a));if(_0x1dee1a[_0x694c('0x10')]){if(_0x1dee1a[_0x694c('0x10')][_0x694c('0x11')]===0x1f4){logger[_0x694c('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x43ffdd,_0x1dee1a[_0x694c('0x10')][_0x694c('0x12')]);return _0x358813(_0x1dee1a[_0x694c('0x10')][_0x694c('0x12')]);}logger['error'](_0x694c('0xd'),_0x43ffdd,_0x1dee1a[_0x694c('0x10')][_0x694c('0x12')]);return _0x596ebc(_0x1dee1a['error']['message']);}else{logger[_0x694c('0xc')](_0x694c('0xd'),_0x43ffdd,_0x694c('0x13'));_0x596ebc(_0x1dee1a['result'][_0x694c('0x12')]);}})[_0x694c('0x14')](function(_0x3474b1){logger['error'](_0x694c('0xd'),_0x43ffdd,_0x3474b1);_0x358813(_0x3474b1);});});}exports[_0x694c('0x15')]=function(_0x5429a5){var _0xefe456=this;return new Promise(function(_0x59d3a0,_0x18b3d0){return db['ZendeskAccount'][_0x694c('0x16')]({'raw':_0x5429a5[_0x694c('0x17')]?_0x5429a5[_0x694c('0x17')][_0x694c('0x18')]===undefined?!![]:![]:!![],'where':_0x5429a5['options']?_0x5429a5[_0x694c('0x17')][_0x694c('0x19')]||null:null,'attributes':_0x5429a5[_0x694c('0x17')]?_0x5429a5[_0x694c('0x17')][_0x694c('0x1a')]||null:null,'limit':_0x5429a5[_0x694c('0x17')]?_0x5429a5[_0x694c('0x17')]['limit']||null:null,'include':_0x5429a5[_0x694c('0x17')]?_0x5429a5[_0x694c('0x17')][_0x694c('0x1b')]?_[_0x694c('0x1c')](_0x5429a5[_0x694c('0x17')][_0x694c('0x1b')],function(_0x24c3ca){return{'model':db[_0x24c3ca[_0x694c('0x1d')]],'as':_0x24c3ca['as'],'attributes':_0x24c3ca[_0x694c('0x1a')],'include':_0x24c3ca[_0x694c('0x1b')]?_[_0x694c('0x1c')](_0x24c3ca[_0x694c('0x1b')],function(_0x2e6cb2){return{'model':db[_0x2e6cb2[_0x694c('0x1d')]],'as':_0x2e6cb2['as'],'attributes':_0x2e6cb2['attributes'],'include':_0x2e6cb2['include']?_['map'](_0x2e6cb2[_0x694c('0x1b')],function(_0x54bfb2){return{'model':db[_0x54bfb2[_0x694c('0x1d')]],'as':_0x54bfb2['as'],'attributes':_0x54bfb2[_0x694c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4202a8){logger[_0x694c('0xc')]('GetZendeskAccount',_0x5429a5);logger['debug'](_0x694c('0x15'),_0x5429a5,JSON[_0x694c('0xf')](_0x4202a8));_0x59d3a0(_0x4202a8);})[_0x694c('0x14')](function(_0x5a08d3){logger['error'](_0x694c('0x15'),_0x5a08d3['message'],_0x5429a5);_0x18b3d0(_0xefe456[_0x694c('0x10')](0x1f4,_0x5a08d3[_0x694c('0x12')]));});});};exports[_0x694c('0x1e')]=function(_0x3712f2){var _0x27c86b=this;return new Promise(function(_0x569e99,_0x585360){return db[_0x694c('0x1f')][_0x694c('0x20')]({'raw':_0x3712f2[_0x694c('0x17')]?_0x3712f2[_0x694c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3712f2[_0x694c('0x17')]?_0x3712f2['options'][_0x694c('0x19')]||null:null,'attributes':_0x3712f2[_0x694c('0x17')]?_0x3712f2[_0x694c('0x17')][_0x694c('0x1a')]||null:null,'include':_0x3712f2[_0x694c('0x17')]?_0x3712f2['options'][_0x694c('0x1b')]?_[_0x694c('0x1c')](_0x3712f2[_0x694c('0x17')][_0x694c('0x1b')],function(_0x109101){return{'model':db[_0x109101[_0x694c('0x1d')]],'as':_0x109101['as'],'attributes':_0x109101[_0x694c('0x1a')],'include':_0x109101[_0x694c('0x1b')]?_[_0x694c('0x1c')](_0x109101['include'],function(_0x10dc86){return{'model':db[_0x10dc86[_0x694c('0x1d')]],'as':_0x10dc86['as'],'attributes':_0x10dc86[_0x694c('0x1a')],'include':_0x10dc86[_0x694c('0x1b')]?_[_0x694c('0x1c')](_0x10dc86[_0x694c('0x1b')],function(_0xe814ef){return{'model':db[_0xe814ef[_0x694c('0x1d')]],'as':_0xe814ef['as'],'attributes':_0xe814ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x694c('0xb')](function(_0x3022a7){logger['info'](_0x694c('0x1e'),_0x3712f2);logger[_0x694c('0xe')](_0x694c('0x1e'),_0x3712f2,JSON[_0x694c('0xf')](_0x3022a7));_0x569e99(_0x3022a7);})[_0x694c('0x14')](function(_0x4e01b6){logger[_0x694c('0x10')](_0x694c('0x1e'),_0x4e01b6[_0x694c('0x12')],_0x3712f2);_0x585360(_0x27c86b['error'](0x1f4,_0x4e01b6[_0x694c('0x12')]));});});};
\ No newline at end of file
index cd9f637..0770763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0x4483,0x1a3));var _0x3448=function(_0x2c7fa6,_0x10d7e){_0x2c7fa6=_0x2c7fa6-0x0;var _0x4a6622=_0x4483[_0x2c7fa6];return _0x4a6622;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router;
\ No newline at end of file
+var _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x38bc51,_0x3e2a6c){var _0x492b1a=function(_0x552a00){while(--_0x552a00){_0x38bc51['push'](_0x38bc51['shift']());}};_0x492b1a(++_0x3e2a6c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xcb91[_0x452968];return _0xb6f9ae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router;
\ No newline at end of file
index e015935..840605a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c1c=['sequelize','exports','STRING'];(function(_0x4664a7,_0x18136f){var _0xa40489=function(_0x5c0ed0){while(--_0x5c0ed0){_0x4664a7['push'](_0x4664a7['shift']());}};_0xa40489(++_0x18136f);}(_0x2c1c,0xb1));var _0xc2c1=function(_0x20713e,_0x44f710){_0x20713e=_0x20713e-0x0;var _0x7d998b=_0x2c1c[_0x20713e];return _0x7d998b;};'use strict';var Sequelize=require(_0xc2c1('0x0'));module[_0xc2c1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc2c1('0x2')]}};
\ No newline at end of file
+var _0xa370=['exports','sequelize'];(function(_0x5d52ba,_0x49fce7){var _0x3ee632=function(_0x4c8683){while(--_0x4c8683){_0x5d52ba['push'](_0x5d52ba['shift']());}};_0x3ee632(++_0x49fce7);}(_0xa370,0x137));var _0x0a37=function(_0x4b4c68,_0x14d416){_0x4b4c68=_0x4b4c68-0x0;var _0x1686e6=_0xa370[_0x4b4c68];return _0x1686e6;};'use strict';var Sequelize=require(_0x0a37('0x0'));module[_0x0a37('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index c7cf695..30cf5b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038f=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','include','find','create','body','params','destroy','getFields','findOne','getSubjects','getDescriptions','ZendeskField','Tag','getTags','setTags','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','crypto'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x038f,0x14a));var _0xf038=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x038f[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0xf038('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf038('0x1'));var jsonpatch=require(_0xf038('0x2'));var rp=require('request-promise');var moment=require(_0xf038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf038('0x4'));var util=require(_0xf038('0x5'));var path=require(_0xf038('0x6'));var sox=require(_0xf038('0x7'));var csv=require('to-csv');var ejs=require(_0xf038('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf038('0x9'));var jsforce=require(_0xf038('0xa'));var deskjs=require(_0xf038('0xb'));var toCsv=require(_0xf038('0xc'));var querystring=require(_0xf038('0xd'));var Papa=require(_0xf038('0xe'));var Redis=require(_0xf038('0xf'));var authService=require(_0xf038('0x10'));var qs=require(_0xf038('0x11'));var as=require(_0xf038('0x12'));var hardwareService=require(_0xf038('0x13'));var logger=require(_0xf038('0x14'))(_0xf038('0x15'));var utils=require('../../config/utils');var config=require(_0xf038('0x16'));var licenseUtil=require(_0xf038('0x17'));var db=require(_0xf038('0x18'))['db'];function respondWithStatusCode(_0x4209b5,_0x268110){_0x268110=_0x268110||0xcc;return function(_0x3c14c8){if(_0x3c14c8){return _0x4209b5[_0xf038('0x19')](_0x268110);}return _0x4209b5[_0xf038('0x1a')](_0x268110)[_0xf038('0x1b')]();};}function respondWithResult(_0x18a135,_0x2ffbde){_0x2ffbde=_0x2ffbde||0xc8;return function(_0xaeb055){if(_0xaeb055){return _0x18a135[_0xf038('0x1a')](_0x2ffbde)[_0xf038('0x1c')](_0xaeb055);}};}function respondWithFilteredResult(_0x196b52,_0x176ee9){return function(_0x4a3975){if(_0x4a3975){var _0x21ef98=typeof _0x176ee9[_0xf038('0x1d')]===_0xf038('0x1e')&&typeof _0x176ee9[_0xf038('0x1f')]===_0xf038('0x1e');var _0x26d1b0=_0x4a3975['count'];var _0x1db265=_0x21ef98?0x0:_0x176ee9[_0xf038('0x1d')];var _0x420aea=_0x21ef98?_0x4a3975[_0xf038('0x20')]:_0x176ee9[_0xf038('0x1d')]+_0x176ee9['limit'];var _0x6e5d7b;if(_0x420aea>=_0x26d1b0){_0x420aea=_0x26d1b0;_0x6e5d7b=0xc8;}else{_0x6e5d7b=0xce;}_0x196b52['status'](_0x6e5d7b);return _0x196b52[_0xf038('0x21')](_0xf038('0x22'),_0x1db265+'-'+_0x420aea+'/'+_0x26d1b0)[_0xf038('0x1c')](_0x4a3975);}return null;};}function patchUpdates(_0x2b6bee){return function(_0x1e8662){try{jsonpatch[_0xf038('0x23')](_0x1e8662,_0x2b6bee,!![]);}catch(_0x10da4c){return BPromise[_0xf038('0x24')](_0x10da4c);}return _0x1e8662[_0xf038('0x25')]();};}function saveUpdates(_0x8cc95c,_0x110caa){return function(_0x50c39d){if(_0x50c39d){return _0x50c39d[_0xf038('0x26')](_0x8cc95c)['then'](function(_0x27aef8){return _0x27aef8;});}return null;};}function removeEntity(_0x3b90a7,_0x19cea4){return function(_0x4210f8){if(_0x4210f8){return _0x4210f8['destroy']()[_0xf038('0x27')](function(){_0x3b90a7['status'](0xcc)[_0xf038('0x1b')]();});}};}function handleEntityNotFound(_0x40cb53,_0x2a86f7){return function(_0x371549){if(!_0x371549){_0x40cb53[_0xf038('0x19')](0x194);}return _0x371549;};}function handleError(_0x342c5a,_0x58f81c){_0x58f81c=_0x58f81c||0x1f4;return function(_0x7e0d3f){logger[_0xf038('0x28')](_0x7e0d3f[_0xf038('0x29')]);if(_0x7e0d3f[_0xf038('0x2a')]){delete _0x7e0d3f[_0xf038('0x2a')];}_0x342c5a[_0xf038('0x1a')](_0x58f81c)[_0xf038('0x2b')](_0x7e0d3f);};}exports[_0xf038('0x2c')]=function(_0x274f04,_0x23dab6){var _0x32ee01={},_0x3badc3={},_0x12caa0={'count':0x0,'rows':[]};var _0x5cc369=_[_0xf038('0x2d')](db[_0xf038('0x2e')][_0xf038('0x2f')],function(_0x1a3e43){return{'name':_0x1a3e43['fieldName'],'type':_0x1a3e43[_0xf038('0x30')][_0xf038('0x31')]};});_0x3badc3[_0xf038('0x32')]=_[_0xf038('0x2d')](_0x5cc369,_0xf038('0x2a'));_0x3badc3[_0xf038('0x33')]=_[_0xf038('0x34')](_0x274f04['query']);_0x3badc3[_0xf038('0x35')]=_[_0xf038('0x36')](_0x3badc3[_0xf038('0x32')],_0x3badc3[_0xf038('0x33')]);_0x32ee01[_0xf038('0x37')]=_['intersection'](_0x3badc3[_0xf038('0x32')],qs['fields'](_0x274f04[_0xf038('0x33')][_0xf038('0x38')]));_0x32ee01[_0xf038('0x37')]=_0x32ee01[_0xf038('0x37')][_0xf038('0x39')]?_0x32ee01[_0xf038('0x37')]:_0x3badc3[_0xf038('0x32')];if(!_0x274f04[_0xf038('0x33')][_0xf038('0x3a')](_0xf038('0x3b'))){_0x32ee01[_0xf038('0x1f')]=qs['limit'](_0x274f04[_0xf038('0x33')][_0xf038('0x1f')]);_0x32ee01[_0xf038('0x1d')]=qs[_0xf038('0x1d')](_0x274f04[_0xf038('0x33')][_0xf038('0x1d')]);}_0x32ee01[_0xf038('0x3c')]=qs['sort'](_0x274f04[_0xf038('0x33')][_0xf038('0x3d')]);_0x32ee01[_0xf038('0x3e')]=qs[_0xf038('0x35')](_[_0xf038('0x3f')](_0x274f04[_0xf038('0x33')],_0x3badc3[_0xf038('0x35')]),_0x5cc369);if(_0x274f04['query'][_0xf038('0x40')]){_0x32ee01[_0xf038('0x3e')]=_[_0xf038('0x41')](_0x32ee01[_0xf038('0x3e')],{'$or':_[_0xf038('0x2d')](_0x5cc369,function(_0x1105d2){if(_0x1105d2[_0xf038('0x30')]!=='VIRTUAL'){var _0x4f376b={};_0x4f376b[_0x1105d2['name']]={'$like':'%'+_0x274f04['query'][_0xf038('0x40')]+'%'};return _0x4f376b;}})});}_0x32ee01=_[_0xf038('0x41')]({},_0x32ee01,_0x274f04[_0xf038('0x42')]);var _0x2ce387={'where':_0x32ee01[_0xf038('0x3e')]};return db[_0xf038('0x2e')][_0xf038('0x20')](_0x2ce387)[_0xf038('0x27')](function(_0x2e5e9f){_0x12caa0['count']=_0x2e5e9f;if(_0x274f04['query']['includeAll']){_0x32ee01['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xf038('0x43')](_0x32ee01);})[_0xf038('0x27')](function(_0x24c0fd){_0x12caa0[_0xf038('0x44')]=_0x24c0fd;return _0x12caa0;})[_0xf038('0x27')](respondWithFilteredResult(_0x23dab6,_0x32ee01))[_0xf038('0x45')](handleError(_0x23dab6,null));};exports[_0xf038('0x46')]=function(_0x59f067,_0x52d714){var _0x533b0d={'raw':![],'where':{'id':_0x59f067['params']['id']}},_0x256428={};_0x256428[_0xf038('0x32')]=_[_0xf038('0x34')](db[_0xf038('0x2e')][_0xf038('0x2f')]);_0x256428[_0xf038('0x33')]=_[_0xf038('0x34')](_0x59f067[_0xf038('0x33')]);_0x256428[_0xf038('0x35')]=_[_0xf038('0x36')](_0x256428[_0xf038('0x32')],_0x256428[_0xf038('0x33')]);_0x533b0d[_0xf038('0x37')]=_[_0xf038('0x36')](_0x256428[_0xf038('0x32')],qs['fields'](_0x59f067['query'][_0xf038('0x38')]));_0x533b0d[_0xf038('0x37')]=_0x533b0d[_0xf038('0x37')]['length']?_0x533b0d['attributes']:_0x256428[_0xf038('0x32')];if(_0x59f067[_0xf038('0x33')]['includeAll']){_0x533b0d[_0xf038('0x47')]=[{'all':!![]}];}_0x533b0d=_[_0xf038('0x41')]({},_0x533b0d,_0x59f067[_0xf038('0x42')]);return db[_0xf038('0x2e')][_0xf038('0x48')](_0x533b0d)['then'](handleEntityNotFound(_0x52d714,null))[_0xf038('0x27')](respondWithResult(_0x52d714,null))[_0xf038('0x45')](handleError(_0x52d714,null));};exports[_0xf038('0x49')]=function(_0x2e02ce,_0x4856c6){return db[_0xf038('0x2e')]['create'](_0x2e02ce[_0xf038('0x4a')],{})[_0xf038('0x27')](respondWithResult(_0x4856c6,0xc9))[_0xf038('0x45')](handleError(_0x4856c6,null));};exports[_0xf038('0x26')]=function(_0x1735a3,_0x59dd1b){if(_0x1735a3['body']['id']){delete _0x1735a3[_0xf038('0x4a')]['id'];}return db['ZendeskConfiguration'][_0xf038('0x48')]({'where':{'id':_0x1735a3[_0xf038('0x4b')]['id']}})[_0xf038('0x27')](handleEntityNotFound(_0x59dd1b,null))[_0xf038('0x27')](saveUpdates(_0x1735a3['body'],null))[_0xf038('0x27')](respondWithResult(_0x59dd1b,null))['catch'](handleError(_0x59dd1b,null));};exports[_0xf038('0x4c')]=function(_0x25154d,_0x2cb51f){return db['ZendeskConfiguration'][_0xf038('0x48')]({'where':{'id':_0x25154d[_0xf038('0x4b')]['id']}})[_0xf038('0x27')](handleEntityNotFound(_0x2cb51f,null))[_0xf038('0x27')](removeEntity(_0x2cb51f,null))['catch'](handleError(_0x2cb51f,null));};exports[_0xf038('0x4d')]=function(_0x3be448,_0x4674e8,_0x5ac07b){var _0x143641={};var _0x2ee7cd={};var _0x4488e5;var _0x277439;return db[_0xf038('0x2e')][_0xf038('0x4e')]({'where':{'id':_0x3be448[_0xf038('0x4b')]['id']}})[_0xf038('0x27')](handleEntityNotFound(_0x4674e8,null))[_0xf038('0x27')](function(_0x3dba85){if(_0x3dba85){_0x4488e5=_0x3dba85;_0x2ee7cd[_0xf038('0x32')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x2ee7cd['query']=_[_0xf038('0x34')](_0x3be448[_0xf038('0x33')]);_0x2ee7cd[_0xf038('0x35')]=_[_0xf038('0x36')](_0x2ee7cd[_0xf038('0x32')],_0x2ee7cd[_0xf038('0x33')]);_0x143641[_0xf038('0x37')]=_[_0xf038('0x36')](_0x2ee7cd[_0xf038('0x32')],qs['fields'](_0x3be448['query'][_0xf038('0x38')]));_0x143641[_0xf038('0x37')]=_0x143641[_0xf038('0x37')][_0xf038('0x39')]?_0x143641['attributes']:_0x2ee7cd['model'];_0x143641[_0xf038('0x3c')]=qs[_0xf038('0x3d')](_0x3be448[_0xf038('0x33')][_0xf038('0x3d')]);_0x143641[_0xf038('0x3e')]=qs[_0xf038('0x35')](_['pick'](_0x3be448['query'],_0x2ee7cd[_0xf038('0x35')]));if(_0x3be448[_0xf038('0x33')]['filter']){_0x143641[_0xf038('0x3e')]=_[_0xf038('0x41')](_0x143641[_0xf038('0x3e')],{'$or':_['map'](_0x143641[_0xf038('0x37')],function(_0xd0ca78){var _0x212fcd={};_0x212fcd[_0xd0ca78]={'$like':'%'+_0x3be448['query'][_0xf038('0x40')]+'%'};return _0x212fcd;})});}_0x143641=_[_0xf038('0x41')]({},_0x143641,_0x3be448[_0xf038('0x42')]);return _0x4488e5[_0xf038('0x4d')](_0x143641);}})[_0xf038('0x27')](function(_0x287a04){if(_0x287a04){_0x277439=_0x287a04[_0xf038('0x39')];if(!_0x3be448[_0xf038('0x33')][_0xf038('0x3a')](_0xf038('0x3b'))){_0x143641[_0xf038('0x1f')]=qs[_0xf038('0x1f')](_0x3be448[_0xf038('0x33')][_0xf038('0x1f')]);_0x143641[_0xf038('0x1d')]=qs[_0xf038('0x1d')](_0x3be448[_0xf038('0x33')]['offset']);}return _0x4488e5[_0xf038('0x4d')](_0x143641);}})['then'](function(_0xc4b7c6){if(_0xc4b7c6){return _0xc4b7c6?{'count':_0x277439,'rows':_0xc4b7c6}:null;}})[_0xf038('0x27')](respondWithResult(_0x4674e8,null))['catch'](handleError(_0x4674e8,null));};exports[_0xf038('0x4f')]=function(_0x3e8ff2,_0x547e0e,_0x5cf90d){var _0x238d75={};var _0x35bb52={};var _0x31633f;var _0x52d031;return db[_0xf038('0x2e')]['findOne']({'where':{'id':_0x3e8ff2[_0xf038('0x4b')]['id']}})['then'](handleEntityNotFound(_0x547e0e,null))[_0xf038('0x27')](function(_0xa6ff58){if(_0xa6ff58){_0x31633f=_0xa6ff58;_0x35bb52['model']=_[_0xf038('0x34')](db['ZendeskField']['rawAttributes']);_0x35bb52[_0xf038('0x33')]=_['keys'](_0x3e8ff2[_0xf038('0x33')]);_0x35bb52[_0xf038('0x35')]=_['intersection'](_0x35bb52[_0xf038('0x32')],_0x35bb52[_0xf038('0x33')]);_0x238d75[_0xf038('0x37')]=_['intersection'](_0x35bb52[_0xf038('0x32')],qs[_0xf038('0x38')](_0x3e8ff2['query'][_0xf038('0x38')]));_0x238d75[_0xf038('0x37')]=_0x238d75[_0xf038('0x37')][_0xf038('0x39')]?_0x238d75[_0xf038('0x37')]:_0x35bb52[_0xf038('0x32')];_0x238d75[_0xf038('0x3c')]=qs[_0xf038('0x3d')](_0x3e8ff2[_0xf038('0x33')][_0xf038('0x3d')]);_0x238d75[_0xf038('0x3e')]=qs[_0xf038('0x35')](_[_0xf038('0x3f')](_0x3e8ff2[_0xf038('0x33')],_0x35bb52['filters']));if(_0x3e8ff2[_0xf038('0x33')]['filter']){_0x238d75[_0xf038('0x3e')]=_['merge'](_0x238d75[_0xf038('0x3e')],{'$or':_['map'](_0x238d75[_0xf038('0x37')],function(_0x3537f5){var _0x3db21d={};_0x3db21d[_0x3537f5]={'$like':'%'+_0x3e8ff2[_0xf038('0x33')][_0xf038('0x40')]+'%'};return _0x3db21d;})});}_0x238d75=_[_0xf038('0x41')]({},_0x238d75,_0x3e8ff2[_0xf038('0x42')]);return _0x31633f[_0xf038('0x4f')](_0x238d75);}})[_0xf038('0x27')](function(_0x3635f3){if(_0x3635f3){_0x52d031=_0x3635f3['length'];if(!_0x3e8ff2[_0xf038('0x33')][_0xf038('0x3a')]('nolimit')){_0x238d75[_0xf038('0x1f')]=qs[_0xf038('0x1f')](_0x3e8ff2[_0xf038('0x33')]['limit']);_0x238d75['offset']=qs[_0xf038('0x1d')](_0x3e8ff2[_0xf038('0x33')][_0xf038('0x1d')]);}return _0x31633f[_0xf038('0x4f')](_0x238d75);}})[_0xf038('0x27')](function(_0x516145){if(_0x516145){return _0x516145?{'count':_0x52d031,'rows':_0x516145}:null;}})[_0xf038('0x27')](respondWithResult(_0x547e0e,null))[_0xf038('0x45')](handleError(_0x547e0e,null));};exports[_0xf038('0x50')]=function(_0x14fecc,_0x2204a5,_0x6b27ec){var _0x1c1b0d={};var _0x469553={};var _0x5a26a7;var _0x2f2e3a;return db['ZendeskConfiguration'][_0xf038('0x4e')]({'where':{'id':_0x14fecc[_0xf038('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2204a5,null))[_0xf038('0x27')](function(_0x363a35){if(_0x363a35){_0x5a26a7=_0x363a35;_0x469553['model']=_[_0xf038('0x34')](db[_0xf038('0x51')][_0xf038('0x2f')]);_0x469553['query']=_[_0xf038('0x34')](_0x14fecc['query']);_0x469553['filters']=_['intersection'](_0x469553[_0xf038('0x32')],_0x469553[_0xf038('0x33')]);_0x1c1b0d[_0xf038('0x37')]=_[_0xf038('0x36')](_0x469553[_0xf038('0x32')],qs['fields'](_0x14fecc['query'][_0xf038('0x38')]));_0x1c1b0d['attributes']=_0x1c1b0d[_0xf038('0x37')][_0xf038('0x39')]?_0x1c1b0d[_0xf038('0x37')]:_0x469553[_0xf038('0x32')];_0x1c1b0d['order']=qs['sort'](_0x14fecc[_0xf038('0x33')][_0xf038('0x3d')]);_0x1c1b0d[_0xf038('0x3e')]=qs['filters'](_['pick'](_0x14fecc[_0xf038('0x33')],_0x469553[_0xf038('0x35')]));if(_0x14fecc[_0xf038('0x33')][_0xf038('0x40')]){_0x1c1b0d[_0xf038('0x3e')]=_[_0xf038('0x41')](_0x1c1b0d[_0xf038('0x3e')],{'$or':_['map'](_0x1c1b0d[_0xf038('0x37')],function(_0x55c119){var _0x5a0aaa={};_0x5a0aaa[_0x55c119]={'$like':'%'+_0x14fecc['query']['filter']+'%'};return _0x5a0aaa;})});}_0x1c1b0d=_[_0xf038('0x41')]({},_0x1c1b0d,_0x14fecc[_0xf038('0x42')]);return _0x5a26a7[_0xf038('0x50')](_0x1c1b0d);}})[_0xf038('0x27')](function(_0x45495b){if(_0x45495b){_0x2f2e3a=_0x45495b[_0xf038('0x39')];if(!_0x14fecc[_0xf038('0x33')][_0xf038('0x3a')](_0xf038('0x3b'))){_0x1c1b0d[_0xf038('0x1f')]=qs[_0xf038('0x1f')](_0x14fecc[_0xf038('0x33')][_0xf038('0x1f')]);_0x1c1b0d['offset']=qs['offset'](_0x14fecc[_0xf038('0x33')][_0xf038('0x1d')]);}return _0x5a26a7[_0xf038('0x50')](_0x1c1b0d);}})[_0xf038('0x27')](function(_0x51f9ca){if(_0x51f9ca){return _0x51f9ca?{'count':_0x2f2e3a,'rows':_0x51f9ca}:null;}})['then'](respondWithResult(_0x2204a5,null))['catch'](handleError(_0x2204a5,null));};exports['getTags']=function(_0x12f46f,_0x59aba2,_0x1ec309){var _0x4bc8c1={};var _0xaf3fdb={};var _0x740f80;var _0xa4c816;return db[_0xf038('0x2e')][_0xf038('0x4e')]({'where':{'id':_0x12f46f[_0xf038('0x4b')]['id']}})['then'](handleEntityNotFound(_0x59aba2,null))[_0xf038('0x27')](function(_0x51af66){if(_0x51af66){_0x740f80=_0x51af66;_0xaf3fdb['model']=_[_0xf038('0x34')](db[_0xf038('0x52')][_0xf038('0x2f')]);_0xaf3fdb[_0xf038('0x33')]=_[_0xf038('0x34')](_0x12f46f[_0xf038('0x33')]);_0xaf3fdb['filters']=_[_0xf038('0x36')](_0xaf3fdb[_0xf038('0x32')],_0xaf3fdb[_0xf038('0x33')]);_0x4bc8c1[_0xf038('0x37')]=_[_0xf038('0x36')](_0xaf3fdb[_0xf038('0x32')],qs[_0xf038('0x38')](_0x12f46f[_0xf038('0x33')][_0xf038('0x38')]));_0x4bc8c1[_0xf038('0x37')]=_0x4bc8c1[_0xf038('0x37')]['length']?_0x4bc8c1[_0xf038('0x37')]:_0xaf3fdb[_0xf038('0x32')];_0x4bc8c1['order']=qs[_0xf038('0x3d')](_0x12f46f['query']['sort']);_0x4bc8c1[_0xf038('0x3e')]=qs[_0xf038('0x35')](_[_0xf038('0x3f')](_0x12f46f[_0xf038('0x33')],_0xaf3fdb[_0xf038('0x35')]));if(_0x12f46f[_0xf038('0x33')][_0xf038('0x40')]){_0x4bc8c1[_0xf038('0x3e')]=_[_0xf038('0x41')](_0x4bc8c1[_0xf038('0x3e')],{'$or':_[_0xf038('0x2d')](_0x4bc8c1[_0xf038('0x37')],function(_0x97ef00){var _0x56ce17={};_0x56ce17[_0x97ef00]={'$like':'%'+_0x12f46f[_0xf038('0x33')][_0xf038('0x40')]+'%'};return _0x56ce17;})});}_0x4bc8c1=_[_0xf038('0x41')]({},_0x4bc8c1,_0x12f46f['options']);return _0x740f80[_0xf038('0x53')](_0x4bc8c1);}})[_0xf038('0x27')](function(_0xb90d8f){if(_0xb90d8f){_0xa4c816=_0xb90d8f[_0xf038('0x39')];if(!_0x12f46f[_0xf038('0x33')]['hasOwnProperty']('nolimit')){_0x4bc8c1[_0xf038('0x1f')]=qs[_0xf038('0x1f')](_0x12f46f[_0xf038('0x33')]['limit']);_0x4bc8c1[_0xf038('0x1d')]=qs[_0xf038('0x1d')](_0x12f46f[_0xf038('0x33')][_0xf038('0x1d')]);}return _0x740f80[_0xf038('0x53')](_0x4bc8c1);}})['then'](function(_0x29175f){if(_0x29175f){return _0x29175f?{'count':_0xa4c816,'rows':_0x29175f}:null;}})['then'](respondWithResult(_0x59aba2,null))[_0xf038('0x45')](handleError(_0x59aba2,null));};exports['setTags']=function(_0xf0cebe,_0x18d729,_0x3a0c5f){if(_0xf0cebe[_0xf038('0x4a')]['id']){delete _0xf0cebe[_0xf038('0x4a')]['id'];}return db[_0xf038('0x2e')]['findOne']({'where':{'id':_0xf0cebe['params']['id']}})['then'](handleEntityNotFound(_0x18d729,null))[_0xf038('0x27')](function(_0x494db5){if(_0x494db5){return _0x494db5[_0xf038('0x54')](_0xf0cebe['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x18d729,null))[_0xf038('0x45')](handleError(_0x18d729,null));};
\ No newline at end of file
+var _0x94a0=['findOne','ZendeskField','length','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','index','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','include','findAll','rows','catch','show','includeAll','find','create','body','params','getFields'];(function(_0x6b5368,_0x4eda8a){var _0x28563f=function(_0x4ec58d){while(--_0x4ec58d){_0x6b5368['push'](_0x6b5368['shift']());}};_0x28563f(++_0x4eda8a);}(_0x94a0,0x105));var _0x094a=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0x94a0[_0x2ff762];return _0x158b02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x094a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x094a('0x1'));var moment=require('moment');var BPromise=require(_0x094a('0x2'));var Mustache=require(_0x094a('0x3'));var util=require(_0x094a('0x4'));var path=require(_0x094a('0x5'));var sox=require('sox');var csv=require(_0x094a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x094a('0x7'));var squel=require(_0x094a('0x8'));var crypto=require(_0x094a('0x9'));var jsforce=require(_0x094a('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x094a('0x6'));var querystring=require(_0x094a('0xb'));var Papa=require(_0x094a('0xc'));var Redis=require(_0x094a('0xd'));var authService=require(_0x094a('0xe'));var qs=require(_0x094a('0xf'));var as=require(_0x094a('0x10'));var hardwareService=require(_0x094a('0x11'));var logger=require(_0x094a('0x12'))(_0x094a('0x13'));var utils=require(_0x094a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x094a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c377,_0x412d95){_0x412d95=_0x412d95||0xcc;return function(_0x4d2e3f){if(_0x4d2e3f){return _0x45c377[_0x094a('0x16')](_0x412d95);}return _0x45c377['status'](_0x412d95)[_0x094a('0x17')]();};}function respondWithResult(_0x4e4e5c,_0x4e4e3a){_0x4e4e3a=_0x4e4e3a||0xc8;return function(_0x219ba8){if(_0x219ba8){return _0x4e4e5c[_0x094a('0x18')](_0x4e4e3a)['json'](_0x219ba8);}};}function respondWithFilteredResult(_0x55efae,_0x46c06d){return function(_0x3e8215){if(_0x3e8215){var _0x3858e2=typeof _0x46c06d[_0x094a('0x19')]===_0x094a('0x1a')&&typeof _0x46c06d['limit']===_0x094a('0x1a');var _0x5a12c8=_0x3e8215['count'];var _0x4e92c4=_0x3858e2?0x0:_0x46c06d[_0x094a('0x19')];var _0x52f4da=_0x3858e2?_0x3e8215[_0x094a('0x1b')]:_0x46c06d[_0x094a('0x19')]+_0x46c06d[_0x094a('0x1c')];var _0x32a7be;if(_0x52f4da>=_0x5a12c8){_0x52f4da=_0x5a12c8;_0x32a7be=0xc8;}else{_0x32a7be=0xce;}_0x55efae[_0x094a('0x18')](_0x32a7be);return _0x55efae[_0x094a('0x1d')](_0x094a('0x1e'),_0x4e92c4+'-'+_0x52f4da+'/'+_0x5a12c8)[_0x094a('0x1f')](_0x3e8215);}return null;};}function patchUpdates(_0x1c6d7d){return function(_0x4945ff){try{jsonpatch[_0x094a('0x20')](_0x4945ff,_0x1c6d7d,!![]);}catch(_0x375b74){return BPromise[_0x094a('0x21')](_0x375b74);}return _0x4945ff[_0x094a('0x22')]();};}function saveUpdates(_0x28f4fa,_0x4ed760){return function(_0x4ee6aa){if(_0x4ee6aa){return _0x4ee6aa[_0x094a('0x23')](_0x28f4fa)['then'](function(_0x1624d5){return _0x1624d5;});}return null;};}function removeEntity(_0x150a76,_0x3a92bd){return function(_0x527576){if(_0x527576){return _0x527576[_0x094a('0x24')]()['then'](function(){_0x150a76[_0x094a('0x18')](0xcc)[_0x094a('0x17')]();});}};}function handleEntityNotFound(_0x2bfbf9,_0x2110a4){return function(_0x2d55c3){if(!_0x2d55c3){_0x2bfbf9[_0x094a('0x16')](0x194);}return _0x2d55c3;};}function handleError(_0x5e6fc9,_0x3c036f){_0x3c036f=_0x3c036f||0x1f4;return function(_0x452dcc){logger['error'](_0x452dcc[_0x094a('0x25')]);if(_0x452dcc['name']){delete _0x452dcc['name'];}_0x5e6fc9['status'](_0x3c036f)['send'](_0x452dcc);};}exports[_0x094a('0x26')]=function(_0x5a401c,_0xfe85c5){var _0x389b8b={},_0x215524={},_0x41b1ad={'count':0x0,'rows':[]};var _0x5dc040=_['map'](db[_0x094a('0x27')][_0x094a('0x28')],function(_0x39515b){return{'name':_0x39515b[_0x094a('0x29')],'type':_0x39515b[_0x094a('0x2a')][_0x094a('0x2b')]};});_0x215524[_0x094a('0x2c')]=_[_0x094a('0x2d')](_0x5dc040,_0x094a('0x2e'));_0x215524[_0x094a('0x2f')]=_[_0x094a('0x30')](_0x5a401c['query']);_0x215524[_0x094a('0x31')]=_[_0x094a('0x32')](_0x215524[_0x094a('0x2c')],_0x215524[_0x094a('0x2f')]);_0x389b8b[_0x094a('0x33')]=_['intersection'](_0x215524[_0x094a('0x2c')],qs['fields'](_0x5a401c['query'][_0x094a('0x34')]));_0x389b8b[_0x094a('0x33')]=_0x389b8b[_0x094a('0x33')]['length']?_0x389b8b[_0x094a('0x33')]:_0x215524[_0x094a('0x2c')];if(!_0x5a401c[_0x094a('0x2f')][_0x094a('0x35')](_0x094a('0x36'))){_0x389b8b[_0x094a('0x1c')]=qs[_0x094a('0x1c')](_0x5a401c['query'][_0x094a('0x1c')]);_0x389b8b[_0x094a('0x19')]=qs[_0x094a('0x19')](_0x5a401c[_0x094a('0x2f')][_0x094a('0x19')]);}_0x389b8b[_0x094a('0x37')]=qs[_0x094a('0x38')](_0x5a401c[_0x094a('0x2f')][_0x094a('0x38')]);_0x389b8b['where']=qs[_0x094a('0x31')](_[_0x094a('0x39')](_0x5a401c['query'],_0x215524['filters']),_0x5dc040);if(_0x5a401c[_0x094a('0x2f')][_0x094a('0x3a')]){_0x389b8b[_0x094a('0x3b')]=_[_0x094a('0x3c')](_0x389b8b[_0x094a('0x3b')],{'$or':_[_0x094a('0x2d')](_0x5dc040,function(_0xf64540){if(_0xf64540['type']!==_0x094a('0x3d')){var _0x52e2ab={};_0x52e2ab[_0xf64540['name']]={'$like':'%'+_0x5a401c['query'][_0x094a('0x3a')]+'%'};return _0x52e2ab;}})});}_0x389b8b=_[_0x094a('0x3c')]({},_0x389b8b,_0x5a401c[_0x094a('0x3e')]);var _0x4de7c3={'where':_0x389b8b[_0x094a('0x3b')]};return db['ZendeskConfiguration']['count'](_0x4de7c3)[_0x094a('0x3f')](function(_0x5d7ff3){_0x41b1ad[_0x094a('0x1b')]=_0x5d7ff3;if(_0x5a401c['query']['includeAll']){_0x389b8b[_0x094a('0x40')]=[{'all':!![]}];}return db[_0x094a('0x27')][_0x094a('0x41')](_0x389b8b);})[_0x094a('0x3f')](function(_0x3ed02f){_0x41b1ad[_0x094a('0x42')]=_0x3ed02f;return _0x41b1ad;})[_0x094a('0x3f')](respondWithFilteredResult(_0xfe85c5,_0x389b8b))[_0x094a('0x43')](handleError(_0xfe85c5,null));};exports[_0x094a('0x44')]=function(_0x3fecc3,_0x130f61){var _0x1a6720={'raw':![],'where':{'id':_0x3fecc3['params']['id']}},_0x3fff4d={};_0x3fff4d[_0x094a('0x2c')]=_[_0x094a('0x30')](db[_0x094a('0x27')][_0x094a('0x28')]);_0x3fff4d[_0x094a('0x2f')]=_['keys'](_0x3fecc3[_0x094a('0x2f')]);_0x3fff4d[_0x094a('0x31')]=_[_0x094a('0x32')](_0x3fff4d[_0x094a('0x2c')],_0x3fff4d[_0x094a('0x2f')]);_0x1a6720['attributes']=_[_0x094a('0x32')](_0x3fff4d[_0x094a('0x2c')],qs['fields'](_0x3fecc3['query'][_0x094a('0x34')]));_0x1a6720[_0x094a('0x33')]=_0x1a6720[_0x094a('0x33')]['length']?_0x1a6720['attributes']:_0x3fff4d[_0x094a('0x2c')];if(_0x3fecc3[_0x094a('0x2f')][_0x094a('0x45')]){_0x1a6720[_0x094a('0x40')]=[{'all':!![]}];}_0x1a6720=_['merge']({},_0x1a6720,_0x3fecc3[_0x094a('0x3e')]);return db[_0x094a('0x27')][_0x094a('0x46')](_0x1a6720)[_0x094a('0x3f')](handleEntityNotFound(_0x130f61,null))['then'](respondWithResult(_0x130f61,null))[_0x094a('0x43')](handleError(_0x130f61,null));};exports[_0x094a('0x47')]=function(_0x1eda8c,_0x3e9b33){return db['ZendeskConfiguration'][_0x094a('0x47')](_0x1eda8c[_0x094a('0x48')],{})[_0x094a('0x3f')](respondWithResult(_0x3e9b33,0xc9))['catch'](handleError(_0x3e9b33,null));};exports[_0x094a('0x23')]=function(_0x2a559f,_0x1c2429){if(_0x2a559f[_0x094a('0x48')]['id']){delete _0x2a559f[_0x094a('0x48')]['id'];}return db[_0x094a('0x27')][_0x094a('0x46')]({'where':{'id':_0x2a559f[_0x094a('0x49')]['id']}})[_0x094a('0x3f')](handleEntityNotFound(_0x1c2429,null))[_0x094a('0x3f')](saveUpdates(_0x2a559f[_0x094a('0x48')],null))['then'](respondWithResult(_0x1c2429,null))['catch'](handleError(_0x1c2429,null));};exports[_0x094a('0x24')]=function(_0x3796bd,_0x1aab23){return db[_0x094a('0x27')][_0x094a('0x46')]({'where':{'id':_0x3796bd[_0x094a('0x49')]['id']}})[_0x094a('0x3f')](handleEntityNotFound(_0x1aab23,null))[_0x094a('0x3f')](removeEntity(_0x1aab23,null))[_0x094a('0x43')](handleError(_0x1aab23,null));};exports[_0x094a('0x4a')]=function(_0x4645d3,_0x40f13c,_0x2c6e93){var _0x284978={};var _0x3d688b={};var _0x3cf9da;var _0x3a864b;return db['ZendeskConfiguration'][_0x094a('0x4b')]({'where':{'id':_0x4645d3[_0x094a('0x49')]['id']}})[_0x094a('0x3f')](handleEntityNotFound(_0x40f13c,null))[_0x094a('0x3f')](function(_0x2b9f27){if(_0x2b9f27){_0x3cf9da=_0x2b9f27;_0x3d688b[_0x094a('0x2c')]=_[_0x094a('0x30')](db[_0x094a('0x4c')]['rawAttributes']);_0x3d688b['query']=_['keys'](_0x4645d3[_0x094a('0x2f')]);_0x3d688b[_0x094a('0x31')]=_[_0x094a('0x32')](_0x3d688b[_0x094a('0x2c')],_0x3d688b[_0x094a('0x2f')]);_0x284978[_0x094a('0x33')]=_[_0x094a('0x32')](_0x3d688b[_0x094a('0x2c')],qs[_0x094a('0x34')](_0x4645d3['query'][_0x094a('0x34')]));_0x284978[_0x094a('0x33')]=_0x284978[_0x094a('0x33')][_0x094a('0x4d')]?_0x284978[_0x094a('0x33')]:_0x3d688b['model'];_0x284978[_0x094a('0x37')]=qs[_0x094a('0x38')](_0x4645d3['query'][_0x094a('0x38')]);_0x284978[_0x094a('0x3b')]=qs['filters'](_[_0x094a('0x39')](_0x4645d3[_0x094a('0x2f')],_0x3d688b[_0x094a('0x31')]));if(_0x4645d3[_0x094a('0x2f')][_0x094a('0x3a')]){_0x284978[_0x094a('0x3b')]=_[_0x094a('0x3c')](_0x284978[_0x094a('0x3b')],{'$or':_[_0x094a('0x2d')](_0x284978['attributes'],function(_0x7c5e8b){var _0x15c645={};_0x15c645[_0x7c5e8b]={'$like':'%'+_0x4645d3[_0x094a('0x2f')]['filter']+'%'};return _0x15c645;})});}_0x284978=_[_0x094a('0x3c')]({},_0x284978,_0x4645d3[_0x094a('0x3e')]);return _0x3cf9da['getFields'](_0x284978);}})[_0x094a('0x3f')](function(_0x3b63e0){if(_0x3b63e0){_0x3a864b=_0x3b63e0[_0x094a('0x4d')];if(!_0x4645d3[_0x094a('0x2f')][_0x094a('0x35')](_0x094a('0x36'))){_0x284978['limit']=qs[_0x094a('0x1c')](_0x4645d3['query']['limit']);_0x284978['offset']=qs['offset'](_0x4645d3[_0x094a('0x2f')][_0x094a('0x19')]);}return _0x3cf9da['getFields'](_0x284978);}})[_0x094a('0x3f')](function(_0x2943b5){if(_0x2943b5){return _0x2943b5?{'count':_0x3a864b,'rows':_0x2943b5}:null;}})[_0x094a('0x3f')](respondWithResult(_0x40f13c,null))[_0x094a('0x43')](handleError(_0x40f13c,null));};exports[_0x094a('0x4e')]=function(_0x4effcb,_0x294902,_0x18b5dd){var _0x9a642a={};var _0xbb8851={};var _0x3bd665;var _0x3967bb;return db['ZendeskConfiguration'][_0x094a('0x4b')]({'where':{'id':_0x4effcb['params']['id']}})['then'](handleEntityNotFound(_0x294902,null))[_0x094a('0x3f')](function(_0x41467a){if(_0x41467a){_0x3bd665=_0x41467a;_0xbb8851[_0x094a('0x2c')]=_['keys'](db['ZendeskField'][_0x094a('0x28')]);_0xbb8851[_0x094a('0x2f')]=_[_0x094a('0x30')](_0x4effcb['query']);_0xbb8851[_0x094a('0x31')]=_[_0x094a('0x32')](_0xbb8851[_0x094a('0x2c')],_0xbb8851['query']);_0x9a642a[_0x094a('0x33')]=_[_0x094a('0x32')](_0xbb8851[_0x094a('0x2c')],qs[_0x094a('0x34')](_0x4effcb[_0x094a('0x2f')]['fields']));_0x9a642a[_0x094a('0x33')]=_0x9a642a['attributes'][_0x094a('0x4d')]?_0x9a642a['attributes']:_0xbb8851[_0x094a('0x2c')];_0x9a642a[_0x094a('0x37')]=qs[_0x094a('0x38')](_0x4effcb[_0x094a('0x2f')]['sort']);_0x9a642a[_0x094a('0x3b')]=qs[_0x094a('0x31')](_[_0x094a('0x39')](_0x4effcb[_0x094a('0x2f')],_0xbb8851[_0x094a('0x31')]));if(_0x4effcb['query'][_0x094a('0x3a')]){_0x9a642a[_0x094a('0x3b')]=_['merge'](_0x9a642a[_0x094a('0x3b')],{'$or':_[_0x094a('0x2d')](_0x9a642a[_0x094a('0x33')],function(_0x4a7b14){var _0x336ebc={};_0x336ebc[_0x4a7b14]={'$like':'%'+_0x4effcb[_0x094a('0x2f')]['filter']+'%'};return _0x336ebc;})});}_0x9a642a=_[_0x094a('0x3c')]({},_0x9a642a,_0x4effcb[_0x094a('0x3e')]);return _0x3bd665['getSubjects'](_0x9a642a);}})[_0x094a('0x3f')](function(_0x517798){if(_0x517798){_0x3967bb=_0x517798[_0x094a('0x4d')];if(!_0x4effcb[_0x094a('0x2f')]['hasOwnProperty'](_0x094a('0x36'))){_0x9a642a[_0x094a('0x1c')]=qs['limit'](_0x4effcb[_0x094a('0x2f')][_0x094a('0x1c')]);_0x9a642a[_0x094a('0x19')]=qs[_0x094a('0x19')](_0x4effcb[_0x094a('0x2f')][_0x094a('0x19')]);}return _0x3bd665['getSubjects'](_0x9a642a);}})[_0x094a('0x3f')](function(_0x314bf4){if(_0x314bf4){return _0x314bf4?{'count':_0x3967bb,'rows':_0x314bf4}:null;}})[_0x094a('0x3f')](respondWithResult(_0x294902,null))['catch'](handleError(_0x294902,null));};exports[_0x094a('0x4f')]=function(_0x5bd9f3,_0x1bfa27,_0x53b94a){var _0x41a000={};var _0x4d3c08={};var _0x14051c;var _0x2cc941;return db[_0x094a('0x27')][_0x094a('0x4b')]({'where':{'id':_0x5bd9f3[_0x094a('0x49')]['id']}})[_0x094a('0x3f')](handleEntityNotFound(_0x1bfa27,null))[_0x094a('0x3f')](function(_0x1eea7a){if(_0x1eea7a){_0x14051c=_0x1eea7a;_0x4d3c08[_0x094a('0x2c')]=_['keys'](db[_0x094a('0x4c')][_0x094a('0x28')]);_0x4d3c08[_0x094a('0x2f')]=_[_0x094a('0x30')](_0x5bd9f3['query']);_0x4d3c08[_0x094a('0x31')]=_[_0x094a('0x32')](_0x4d3c08[_0x094a('0x2c')],_0x4d3c08[_0x094a('0x2f')]);_0x41a000[_0x094a('0x33')]=_[_0x094a('0x32')](_0x4d3c08[_0x094a('0x2c')],qs['fields'](_0x5bd9f3['query'][_0x094a('0x34')]));_0x41a000[_0x094a('0x33')]=_0x41a000[_0x094a('0x33')][_0x094a('0x4d')]?_0x41a000[_0x094a('0x33')]:_0x4d3c08[_0x094a('0x2c')];_0x41a000['order']=qs[_0x094a('0x38')](_0x5bd9f3[_0x094a('0x2f')][_0x094a('0x38')]);_0x41a000[_0x094a('0x3b')]=qs[_0x094a('0x31')](_[_0x094a('0x39')](_0x5bd9f3['query'],_0x4d3c08[_0x094a('0x31')]));if(_0x5bd9f3[_0x094a('0x2f')][_0x094a('0x3a')]){_0x41a000[_0x094a('0x3b')]=_[_0x094a('0x3c')](_0x41a000[_0x094a('0x3b')],{'$or':_['map'](_0x41a000[_0x094a('0x33')],function(_0x12bf01){var _0x202e56={};_0x202e56[_0x12bf01]={'$like':'%'+_0x5bd9f3[_0x094a('0x2f')][_0x094a('0x3a')]+'%'};return _0x202e56;})});}_0x41a000=_['merge']({},_0x41a000,_0x5bd9f3[_0x094a('0x3e')]);return _0x14051c[_0x094a('0x4f')](_0x41a000);}})[_0x094a('0x3f')](function(_0x48de94){if(_0x48de94){_0x2cc941=_0x48de94[_0x094a('0x4d')];if(!_0x5bd9f3[_0x094a('0x2f')]['hasOwnProperty'](_0x094a('0x36'))){_0x41a000[_0x094a('0x1c')]=qs[_0x094a('0x1c')](_0x5bd9f3[_0x094a('0x2f')][_0x094a('0x1c')]);_0x41a000[_0x094a('0x19')]=qs[_0x094a('0x19')](_0x5bd9f3[_0x094a('0x2f')][_0x094a('0x19')]);}return _0x14051c[_0x094a('0x4f')](_0x41a000);}})[_0x094a('0x3f')](function(_0x445e2d){if(_0x445e2d){return _0x445e2d?{'count':_0x2cc941,'rows':_0x445e2d}:null;}})['then'](respondWithResult(_0x1bfa27,null))[_0x094a('0x43')](handleError(_0x1bfa27,null));};exports[_0x094a('0x50')]=function(_0xe4e594,_0x5b3e0a,_0xddab6f){var _0x4d56f9={};var _0x15bf4e={};var _0x34df65;var _0x2f2ef1;return db['ZendeskConfiguration'][_0x094a('0x4b')]({'where':{'id':_0xe4e594['params']['id']}})[_0x094a('0x3f')](handleEntityNotFound(_0x5b3e0a,null))[_0x094a('0x3f')](function(_0xa252f4){if(_0xa252f4){_0x34df65=_0xa252f4;_0x15bf4e[_0x094a('0x2c')]=_['keys'](db[_0x094a('0x51')]['rawAttributes']);_0x15bf4e['query']=_['keys'](_0xe4e594[_0x094a('0x2f')]);_0x15bf4e[_0x094a('0x31')]=_[_0x094a('0x32')](_0x15bf4e['model'],_0x15bf4e[_0x094a('0x2f')]);_0x4d56f9[_0x094a('0x33')]=_[_0x094a('0x32')](_0x15bf4e[_0x094a('0x2c')],qs[_0x094a('0x34')](_0xe4e594[_0x094a('0x2f')][_0x094a('0x34')]));_0x4d56f9[_0x094a('0x33')]=_0x4d56f9[_0x094a('0x33')][_0x094a('0x4d')]?_0x4d56f9[_0x094a('0x33')]:_0x15bf4e['model'];_0x4d56f9[_0x094a('0x37')]=qs[_0x094a('0x38')](_0xe4e594[_0x094a('0x2f')][_0x094a('0x38')]);_0x4d56f9['where']=qs['filters'](_[_0x094a('0x39')](_0xe4e594[_0x094a('0x2f')],_0x15bf4e['filters']));if(_0xe4e594['query']['filter']){_0x4d56f9['where']=_[_0x094a('0x3c')](_0x4d56f9[_0x094a('0x3b')],{'$or':_[_0x094a('0x2d')](_0x4d56f9[_0x094a('0x33')],function(_0x558937){var _0x2928d0={};_0x2928d0[_0x558937]={'$like':'%'+_0xe4e594[_0x094a('0x2f')][_0x094a('0x3a')]+'%'};return _0x2928d0;})});}_0x4d56f9=_[_0x094a('0x3c')]({},_0x4d56f9,_0xe4e594[_0x094a('0x3e')]);return _0x34df65[_0x094a('0x50')](_0x4d56f9);}})[_0x094a('0x3f')](function(_0x3a6287){if(_0x3a6287){_0x2f2ef1=_0x3a6287['length'];if(!_0xe4e594['query'][_0x094a('0x35')](_0x094a('0x36'))){_0x4d56f9[_0x094a('0x1c')]=qs[_0x094a('0x1c')](_0xe4e594[_0x094a('0x2f')][_0x094a('0x1c')]);_0x4d56f9['offset']=qs[_0x094a('0x19')](_0xe4e594[_0x094a('0x2f')][_0x094a('0x19')]);}return _0x34df65[_0x094a('0x50')](_0x4d56f9);}})[_0x094a('0x3f')](function(_0x31a6ad){if(_0x31a6ad){return _0x31a6ad?{'count':_0x2f2ef1,'rows':_0x31a6ad}:null;}})[_0x094a('0x3f')](respondWithResult(_0x5b3e0a,null))[_0x094a('0x43')](handleError(_0x5b3e0a,null));};exports[_0x094a('0x52')]=function(_0x59d9a5,_0x44723b,_0x540a37){if(_0x59d9a5['body']['id']){delete _0x59d9a5[_0x094a('0x48')]['id'];}return db[_0x094a('0x27')]['findOne']({'where':{'id':_0x59d9a5[_0x094a('0x49')]['id']}})[_0x094a('0x3f')](handleEntityNotFound(_0x44723b,null))[_0x094a('0x3f')](function(_0x13c0d4){if(_0x13c0d4){return _0x13c0d4[_0x094a('0x52')](_0x59d9a5[_0x094a('0x48')][_0x094a('0x53')]||[]);}return null;})[_0x094a('0x3f')](respondWithResult(_0x44723b,null))[_0x094a('0x43')](handleError(_0x44723b,null));};
\ No newline at end of file
index 36c65ab..eb5b336 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['request-promise','path','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','../../config/logger','api','moment','bluebird'];(function(_0x20acdb,_0x210c8e){var _0x383b0d=function(_0x5d0919){while(--_0x5d0919){_0x20acdb['push'](_0x20acdb['shift']());}};_0x383b0d(++_0x210c8e);}(_0x34b7,0x196));var _0x734b=function(_0x48d776,_0xb7dfa1){_0x48d776=_0x48d776-0x0;var _0x4973d7=_0x34b7[_0x48d776];return _0x4973d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x734b('0x0'))(_0x734b('0x1'));var moment=require(_0x734b('0x2'));var BPromise=require(_0x734b('0x3'));var rp=require(_0x734b('0x4'));var fs=require('fs');var path=require(_0x734b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x734b('0x6'));module[_0x734b('0x7')]=function(_0x2f3128,_0x34fd70){return _0x2f3128[_0x734b('0x8')](_0x734b('0x9'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x58a4=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x5eb56c,_0x5bcf89){var _0x7ce5=function(_0x52c842){while(--_0x52c842){_0x5eb56c['push'](_0x5eb56c['shift']());}};_0x7ce5(++_0x5bcf89);}(_0x58a4,0xbf));var _0x458a=function(_0x58eb93,_0x3b8263){_0x58eb93=_0x58eb93-0x0;var _0xc0d5c0=_0x58a4[_0x58eb93];return _0xc0d5c0;};'use strict';var _=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var logger=require(_0x458a('0x2'))(_0x458a('0x3'));var moment=require(_0x458a('0x4'));var BPromise=require(_0x458a('0x5'));var rp=require(_0x458a('0x6'));var fs=require('fs');var path=require(_0x458a('0x7'));var rimraf=require(_0x458a('0x8'));var config=require(_0x458a('0x9'));var attributes=require(_0x458a('0xa'));module[_0x458a('0xb')]=function(_0x2f5d44,_0x57de3c){return _0x2f5d44['define'](_0x458a('0xc'),attributes,{'tableName':_0x458a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9c461c1..ed7b069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6088=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x4c03ea,_0x3465be){var _0x7a6922=function(_0xd50354){while(--_0xd50354){_0x4c03ea['push'](_0x4c03ea['shift']());}};_0x7a6922(++_0x3465be);}(_0x6088,0x110));var _0x8608=function(_0x2e5386,_0x26bbcc){_0x2e5386=_0x2e5386-0x0;var _0x1ea520=_0x6088[_0x2e5386];return _0x1ea520;};'use strict';var _=require(_0x8608('0x0'));var util=require(_0x8608('0x1'));var moment=require(_0x8608('0x2'));var BPromise=require(_0x8608('0x3'));var rs=require(_0x8608('0x4'));var fs=require('fs');var Redis=require(_0x8608('0x5'));var db=require(_0x8608('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8608('0x7'));var config=require(_0x8608('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8608('0x9')][_0x8608('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b7c31,_0xdf1fc3,_0x41498f){return new BPromise(function(_0x4ec5a9,_0x391612){return client[_0x8608('0xb')](_0x2b7c31,_0x41498f)[_0x8608('0xc')](function(_0x2f1f81){logger[_0x8608('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0xdf1fc3,_0x8608('0xe'));logger[_0x8608('0xf')](_0x8608('0x10'),_0xdf1fc3,_0x8608('0xe'),JSON[_0x8608('0x11')](_0x2f1f81));if(_0x2f1f81[_0x8608('0x12')]){if(_0x2f1f81['error'][_0x8608('0x13')]===0x1f4){logger['error'](_0x8608('0x14'),_0xdf1fc3,_0x2f1f81[_0x8608('0x12')][_0x8608('0x15')]);return _0x391612(_0x2f1f81[_0x8608('0x12')][_0x8608('0x15')]);}logger[_0x8608('0x12')](_0x8608('0x14'),_0xdf1fc3,_0x2f1f81[_0x8608('0x12')][_0x8608('0x15')]);return _0x4ec5a9(_0x2f1f81[_0x8608('0x12')][_0x8608('0x15')]);}else{logger[_0x8608('0xd')](_0x8608('0x14'),_0xdf1fc3,_0x8608('0xe'));_0x4ec5a9(_0x2f1f81[_0x8608('0x16')][_0x8608('0x15')]);}})[_0x8608('0x17')](function(_0x385893){logger[_0x8608('0x12')](_0x8608('0x14'),_0xdf1fc3,_0x385893);_0x391612(_0x385893);});});}
\ No newline at end of file
+var _0xa87d=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x1189e6,_0x335e1c){var _0x545ae9=function(_0x84b11b){while(--_0x84b11b){_0x1189e6['push'](_0x1189e6['shift']());}};_0x545ae9(++_0x335e1c);}(_0xa87d,0xdc));var _0xda87=function(_0x15f476,_0x22b7e0){_0x15f476=_0x15f476-0x0;var _0x73f28c=_0xa87d[_0x15f476];return _0x73f28c;};'use strict';var _=require(_0xda87('0x0'));var util=require(_0xda87('0x1'));var moment=require('moment');var BPromise=require(_0xda87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda87('0x3'));var db=require(_0xda87('0x4'))['db'];var utils=require(_0xda87('0x5'));var logger=require(_0xda87('0x6'))(_0xda87('0x7'));var config=require(_0xda87('0x8'));var jayson=require(_0xda87('0x9'));var client=jayson[_0xda87('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32b5cc,_0x13f675,_0x336b10){return new BPromise(function(_0x2907fa,_0xd638ee){return client[_0xda87('0xb')](_0x32b5cc,_0x336b10)[_0xda87('0xc')](function(_0x21a22f){logger[_0xda87('0xd')](_0xda87('0xe'),_0x13f675,_0xda87('0xf'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x13f675,_0xda87('0xf'),JSON[_0xda87('0x10')](_0x21a22f));if(_0x21a22f[_0xda87('0x11')]){if(_0x21a22f[_0xda87('0x11')][_0xda87('0x12')]===0x1f4){logger[_0xda87('0x11')](_0xda87('0xe'),_0x13f675,_0x21a22f[_0xda87('0x11')][_0xda87('0x13')]);return _0xd638ee(_0x21a22f[_0xda87('0x11')][_0xda87('0x13')]);}logger[_0xda87('0x11')](_0xda87('0xe'),_0x13f675,_0x21a22f[_0xda87('0x11')][_0xda87('0x13')]);return _0x2907fa(_0x21a22f[_0xda87('0x11')]['message']);}else{logger[_0xda87('0xd')](_0xda87('0xe'),_0x13f675,_0xda87('0xf'));_0x2907fa(_0x21a22f[_0xda87('0x14')]['message']);}})[_0xda87('0x15')](function(_0x22f8cc){logger[_0xda87('0x11')](_0xda87('0xe'),_0x13f675,_0x22f8cc);_0xd638ee(_0x22f8cc);});});}
\ No newline at end of file
index a807915..1838e40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ede=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5dbd83,_0x1697b7){var _0x1c42af=function(_0x32b54d){while(--_0x32b54d){_0x5dbd83['push'](_0x5dbd83['shift']());}};_0x1c42af(++_0x1697b7);}(_0x0ede,0x116));var _0xe0ed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0ede[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xe0ed('0x0'));var util=require(_0xe0ed('0x1'));var path=require(_0xe0ed('0x2'));var timeout=require(_0xe0ed('0x3'));var express=require(_0xe0ed('0x4'));var router=express[_0xe0ed('0x5')]();var fs_extra=require(_0xe0ed('0x6'));var auth=require(_0xe0ed('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe0ed('0x8'));var controller=require('./intZendeskField.controller');router[_0xe0ed('0x9')]('/',auth[_0xe0ed('0xa')](),controller[_0xe0ed('0xb')]);router[_0xe0ed('0x9')](_0xe0ed('0xc'),auth[_0xe0ed('0xa')](),controller['show']);router[_0xe0ed('0xd')]('/',auth[_0xe0ed('0xa')](),controller[_0xe0ed('0xe')]);router[_0xe0ed('0xf')](_0xe0ed('0xc'),auth['isAuthenticated'](),controller[_0xe0ed('0x10')]);router[_0xe0ed('0x11')](_0xe0ed('0xc'),auth['isAuthenticated'](),controller[_0xe0ed('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xadf8=['get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZendeskField.controller'];(function(_0xa8aaab,_0xf35d8f){var _0x5a351d=function(_0x4730fb){while(--_0x4730fb){_0xa8aaab['push'](_0xa8aaab['shift']());}};_0x5a351d(++_0xf35d8f);}(_0xadf8,0x76));var _0x8adf=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0xadf8[_0x5311e8];return _0x582ad8;};'use strict';var multer=require('multer');var util=require(_0x8adf('0x0'));var path=require(_0x8adf('0x1'));var timeout=require(_0x8adf('0x2'));var express=require(_0x8adf('0x3'));var router=express[_0x8adf('0x4')]();var fs_extra=require(_0x8adf('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8adf('0x6'));var controller=require(_0x8adf('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8adf('0x8')](_0x8adf('0x9'),auth[_0x8adf('0xa')](),controller[_0x8adf('0xb')]);router['post']('/',auth[_0x8adf('0xa')](),controller[_0x8adf('0xc')]);router[_0x8adf('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x8adf('0xe')]);router[_0x8adf('0xf')](_0x8adf('0x9'),auth[_0x8adf('0xa')](),controller[_0x8adf('0x10')]);module[_0x8adf('0x11')]=router;
\ No newline at end of file
index 2254bf6..72bdca7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ccd=['exports','string','variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize'];(function(_0x325c54,_0x107fc7){var _0x4be579=function(_0x341850){while(--_0x341850){_0x325c54['push'](_0x325c54['shift']());}};_0x4be579(++_0x107fc7);}(_0x5ccd,0x116));var _0xd5cc=function(_0x3971fa,_0x5a3d4e){_0x3971fa=_0x3971fa-0x0;var _0x3c140c=_0x5ccd[_0x3971fa];return _0x3c140c;};'use strict';var Sequelize=require(_0xd5cc('0x0'));module[_0xd5cc('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd5cc('0x2'),_0xd5cc('0x3'),'customVariable','keyValue',_0xd5cc('0x4')),'defaultValue':_0xd5cc('0x2')},'content':{'type':Sequelize[_0xd5cc('0x5')]},'key':{'type':Sequelize[_0xd5cc('0x5')]},'keyType':{'type':Sequelize[_0xd5cc('0x6')]('string',_0xd5cc('0x3'),_0xd5cc('0x7'))},'keyContent':{'type':Sequelize[_0xd5cc('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd5cc('0x5')]},'customField':{'type':Sequelize[_0xd5cc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd5cc('0x5')]}};
\ No newline at end of file
+var _0x89ef=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x122172,_0x279c00){var _0x114738=function(_0x501f17){while(--_0x501f17){_0x122172['push'](_0x122172['shift']());}};_0x114738(++_0x279c00);}(_0x89ef,0xfa));var _0xf89e=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x89ef[_0x8e8ca7];return _0x561381;};'use strict';var Sequelize=require(_0xf89e('0x0'));module[_0xf89e('0x1')]={'type':{'type':Sequelize[_0xf89e('0x2')](_0xf89e('0x3'),_0xf89e('0x4'),_0xf89e('0x5'),_0xf89e('0x6'),_0xf89e('0x7')),'defaultValue':_0xf89e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf89e('0x8')]},'keyType':{'type':Sequelize[_0xf89e('0x2')]('string',_0xf89e('0x4'),_0xf89e('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf89e('0x8')]},'nameField':{'type':Sequelize[_0xf89e('0x8')]},'customField':{'type':Sequelize[_0xf89e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf89e('0x8')]}};
\ No newline at end of file
index 08f6de3..fc4234d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc84=['length','find','create','body','destroy','eml-format','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','catch','show','params'];(function(_0x24828c,_0xca8f6d){var _0x3daaa9=function(_0x27f766){while(--_0x27f766){_0x24828c['push'](_0x24828c['shift']());}};_0x3daaa9(++_0xca8f6d);}(_0xfc84,0xdd));var _0x4fc8=function(_0x5d1df7,_0x1864fd){_0x5d1df7=_0x5d1df7-0x0;var _0x3f9c7b=_0xfc84[_0x5d1df7];return _0x3f9c7b;};'use strict';var emlformat=require(_0x4fc8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4fc8('0x1'));var moment=require(_0x4fc8('0x2'));var BPromise=require(_0x4fc8('0x3'));var Mustache=require(_0x4fc8('0x4'));var util=require(_0x4fc8('0x5'));var path=require(_0x4fc8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4fc8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4fc8('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4fc8('0x9'));var deskjs=require(_0x4fc8('0xa'));var toCsv=require(_0x4fc8('0xb'));var querystring=require(_0x4fc8('0xc'));var Papa=require(_0x4fc8('0xd'));var Redis=require(_0x4fc8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4fc8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fc8('0x10'));var logger=require(_0x4fc8('0x11'))(_0x4fc8('0x12'));var utils=require(_0x4fc8('0x13'));var config=require(_0x4fc8('0x14'));var licenseUtil=require(_0x4fc8('0x15'));var db=require(_0x4fc8('0x16'))['db'];function respondWithStatusCode(_0xc1c63d,_0x1d0cbc){_0x1d0cbc=_0x1d0cbc||0xcc;return function(_0x364e24){if(_0x364e24){return _0xc1c63d['sendStatus'](_0x1d0cbc);}return _0xc1c63d['status'](_0x1d0cbc)[_0x4fc8('0x17')]();};}function respondWithResult(_0x372ff8,_0x202640){_0x202640=_0x202640||0xc8;return function(_0x43d57e){if(_0x43d57e){return _0x372ff8[_0x4fc8('0x18')](_0x202640)[_0x4fc8('0x19')](_0x43d57e);}};}function respondWithFilteredResult(_0x3df3fc,_0x1bf649){return function(_0x786887){if(_0x786887){var _0x3daf2e=typeof _0x1bf649[_0x4fc8('0x1a')]===_0x4fc8('0x1b')&&typeof _0x1bf649[_0x4fc8('0x1c')]===_0x4fc8('0x1b');var _0x2fdbdc=_0x786887[_0x4fc8('0x1d')];var _0x30e80e=_0x3daf2e?0x0:_0x1bf649[_0x4fc8('0x1a')];var _0x489074=_0x3daf2e?_0x786887[_0x4fc8('0x1d')]:_0x1bf649[_0x4fc8('0x1a')]+_0x1bf649[_0x4fc8('0x1c')];var _0x465d2d;if(_0x489074>=_0x2fdbdc){_0x489074=_0x2fdbdc;_0x465d2d=0xc8;}else{_0x465d2d=0xce;}_0x3df3fc[_0x4fc8('0x18')](_0x465d2d);return _0x3df3fc[_0x4fc8('0x1e')](_0x4fc8('0x1f'),_0x30e80e+'-'+_0x489074+'/'+_0x2fdbdc)[_0x4fc8('0x19')](_0x786887);}return null;};}function patchUpdates(_0x49d496){return function(_0x16a228){try{jsonpatch[_0x4fc8('0x20')](_0x16a228,_0x49d496,!![]);}catch(_0x3a120e){return BPromise[_0x4fc8('0x21')](_0x3a120e);}return _0x16a228[_0x4fc8('0x22')]();};}function saveUpdates(_0x242bd6,_0x34daaf){return function(_0x50172f){if(_0x50172f){return _0x50172f[_0x4fc8('0x23')](_0x242bd6)[_0x4fc8('0x24')](function(_0x3d1e7b){return _0x3d1e7b;});}return null;};}function removeEntity(_0x333d49,_0x244c74){return function(_0x50dc73){if(_0x50dc73){return _0x50dc73['destroy']()[_0x4fc8('0x24')](function(){_0x333d49[_0x4fc8('0x18')](0xcc)[_0x4fc8('0x17')]();});}};}function handleEntityNotFound(_0x39dc73,_0x491404){return function(_0x33c610){if(!_0x33c610){_0x39dc73['sendStatus'](0x194);}return _0x33c610;};}function handleError(_0x5bc802,_0x40827f){_0x40827f=_0x40827f||0x1f4;return function(_0x30b6ff){logger['error'](_0x30b6ff['stack']);if(_0x30b6ff[_0x4fc8('0x25')]){delete _0x30b6ff[_0x4fc8('0x25')];}_0x5bc802[_0x4fc8('0x18')](_0x40827f)[_0x4fc8('0x26')](_0x30b6ff);};}exports[_0x4fc8('0x27')]=function(_0x5b403c,_0x396117){var _0x4629c8={},_0x3f0035={},_0x199b13={'count':0x0,'rows':[]};var _0x5a8b8f=_[_0x4fc8('0x28')](db[_0x4fc8('0x29')][_0x4fc8('0x2a')],function(_0x177a67){return{'name':_0x177a67[_0x4fc8('0x2b')],'type':_0x177a67[_0x4fc8('0x2c')][_0x4fc8('0x2d')]};});_0x3f0035[_0x4fc8('0x2e')]=_[_0x4fc8('0x28')](_0x5a8b8f,'name');_0x3f0035['query']=_[_0x4fc8('0x2f')](_0x5b403c[_0x4fc8('0x30')]);_0x3f0035[_0x4fc8('0x31')]=_[_0x4fc8('0x32')](_0x3f0035[_0x4fc8('0x2e')],_0x3f0035[_0x4fc8('0x30')]);_0x4629c8[_0x4fc8('0x33')]=_['intersection'](_0x3f0035[_0x4fc8('0x2e')],qs[_0x4fc8('0x34')](_0x5b403c[_0x4fc8('0x30')]['fields']));_0x4629c8[_0x4fc8('0x33')]=_0x4629c8[_0x4fc8('0x33')]['length']?_0x4629c8[_0x4fc8('0x33')]:_0x3f0035[_0x4fc8('0x2e')];if(!_0x5b403c['query'][_0x4fc8('0x35')](_0x4fc8('0x36'))){_0x4629c8[_0x4fc8('0x1c')]=qs[_0x4fc8('0x1c')](_0x5b403c['query'][_0x4fc8('0x1c')]);_0x4629c8[_0x4fc8('0x1a')]=qs['offset'](_0x5b403c[_0x4fc8('0x30')][_0x4fc8('0x1a')]);}_0x4629c8[_0x4fc8('0x37')]=qs[_0x4fc8('0x38')](_0x5b403c[_0x4fc8('0x30')]['sort']);_0x4629c8[_0x4fc8('0x39')]=qs[_0x4fc8('0x31')](_[_0x4fc8('0x3a')](_0x5b403c['query'],_0x3f0035[_0x4fc8('0x31')]),_0x5a8b8f);if(_0x5b403c[_0x4fc8('0x30')]['filter']){_0x4629c8[_0x4fc8('0x39')]=_[_0x4fc8('0x3b')](_0x4629c8[_0x4fc8('0x39')],{'$or':_[_0x4fc8('0x28')](_0x5a8b8f,function(_0x3bbc8d){if(_0x3bbc8d[_0x4fc8('0x2c')]!==_0x4fc8('0x3c')){var _0x17a018={};_0x17a018[_0x3bbc8d['name']]={'$like':'%'+_0x5b403c[_0x4fc8('0x30')][_0x4fc8('0x3d')]+'%'};return _0x17a018;}})});}_0x4629c8=_[_0x4fc8('0x3b')]({},_0x4629c8,_0x5b403c[_0x4fc8('0x3e')]);var _0x50253e={'where':_0x4629c8[_0x4fc8('0x39')]};return db['ZendeskField'][_0x4fc8('0x1d')](_0x50253e)[_0x4fc8('0x24')](function(_0x455853){_0x199b13[_0x4fc8('0x1d')]=_0x455853;if(_0x5b403c['query']['includeAll']){_0x4629c8[_0x4fc8('0x3f')]=[{'all':!![]}];}return db[_0x4fc8('0x29')]['findAll'](_0x4629c8);})[_0x4fc8('0x24')](function(_0x2afb5c){_0x199b13['rows']=_0x2afb5c;return _0x199b13;})[_0x4fc8('0x24')](respondWithFilteredResult(_0x396117,_0x4629c8))[_0x4fc8('0x40')](handleError(_0x396117,null));};exports[_0x4fc8('0x41')]=function(_0x2d9a3e,_0x24b032){var _0x3bbb81={'raw':!![],'where':{'id':_0x2d9a3e[_0x4fc8('0x42')]['id']}},_0x3e426f={};_0x3e426f[_0x4fc8('0x2e')]=_[_0x4fc8('0x2f')](db[_0x4fc8('0x29')]['rawAttributes']);_0x3e426f['query']=_[_0x4fc8('0x2f')](_0x2d9a3e['query']);_0x3e426f[_0x4fc8('0x31')]=_[_0x4fc8('0x32')](_0x3e426f[_0x4fc8('0x2e')],_0x3e426f[_0x4fc8('0x30')]);_0x3bbb81[_0x4fc8('0x33')]=_['intersection'](_0x3e426f[_0x4fc8('0x2e')],qs[_0x4fc8('0x34')](_0x2d9a3e['query'][_0x4fc8('0x34')]));_0x3bbb81['attributes']=_0x3bbb81[_0x4fc8('0x33')][_0x4fc8('0x43')]?_0x3bbb81[_0x4fc8('0x33')]:_0x3e426f[_0x4fc8('0x2e')];if(_0x2d9a3e[_0x4fc8('0x30')]['includeAll']){_0x3bbb81[_0x4fc8('0x3f')]=[{'all':!![]}];}_0x3bbb81=_[_0x4fc8('0x3b')]({},_0x3bbb81,_0x2d9a3e[_0x4fc8('0x3e')]);return db[_0x4fc8('0x29')][_0x4fc8('0x44')](_0x3bbb81)['then'](handleEntityNotFound(_0x24b032,null))[_0x4fc8('0x24')](respondWithResult(_0x24b032,null))[_0x4fc8('0x40')](handleError(_0x24b032,null));};exports[_0x4fc8('0x45')]=function(_0x167419,_0x4cdb0b){return db[_0x4fc8('0x29')]['create'](_0x167419['body'],{})[_0x4fc8('0x24')](respondWithResult(_0x4cdb0b,0xc9))[_0x4fc8('0x40')](handleError(_0x4cdb0b,null));};exports['update']=function(_0x1c7caa,_0x5a1fcb){if(_0x1c7caa[_0x4fc8('0x46')]['id']){delete _0x1c7caa[_0x4fc8('0x46')]['id'];}return db[_0x4fc8('0x29')][_0x4fc8('0x44')]({'where':{'id':_0x1c7caa[_0x4fc8('0x42')]['id']}})[_0x4fc8('0x24')](handleEntityNotFound(_0x5a1fcb,null))[_0x4fc8('0x24')](saveUpdates(_0x1c7caa['body'],null))['then'](respondWithResult(_0x5a1fcb,null))['catch'](handleError(_0x5a1fcb,null));};exports[_0x4fc8('0x47')]=function(_0x3ef165,_0xdfc3e6){return db[_0x4fc8('0x29')][_0x4fc8('0x44')]({'where':{'id':_0x3ef165['params']['id']}})['then'](handleEntityNotFound(_0xdfc3e6,null))[_0x4fc8('0x24')](removeEntity(_0xdfc3e6,null))[_0x4fc8('0x40')](handleError(_0xdfc3e6,null));};
\ No newline at end of file
+var _0xa450=['../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskField','findAll','catch','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','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','../../config/license/util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa450,0x16d));var _0x0a45=function(_0x3651c1,_0x551f20){_0x3651c1=_0x3651c1-0x0;var _0x8a521c=_0xa450[_0x3651c1];return _0x8a521c;};'use strict';var emlformat=require(_0x0a45('0x0'));var rimraf=require(_0x0a45('0x1'));var zipdir=require(_0x0a45('0x2'));var jsonpatch=require(_0x0a45('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0a45('0x4'));var Mustache=require(_0x0a45('0x5'));var util=require('util');var path=require(_0x0a45('0x6'));var sox=require(_0x0a45('0x7'));var csv=require('to-csv');var ejs=require(_0x0a45('0x8'));var fs=require('fs');var fs_extra=require(_0x0a45('0x9'));var _=require(_0x0a45('0xa'));var squel=require('squel');var crypto=require(_0x0a45('0xb'));var jsforce=require(_0x0a45('0xc'));var deskjs=require(_0x0a45('0xd'));var toCsv=require(_0x0a45('0xe'));var querystring=require('querystring');var Papa=require(_0x0a45('0xf'));var Redis=require(_0x0a45('0x10'));var authService=require(_0x0a45('0x11'));var qs=require(_0x0a45('0x12'));var as=require(_0x0a45('0x13'));var hardwareService=require(_0x0a45('0x14'));var logger=require('../../config/logger')(_0x0a45('0x15'));var utils=require(_0x0a45('0x16'));var config=require(_0x0a45('0x17'));var licenseUtil=require(_0x0a45('0x18'));var db=require(_0x0a45('0x19'))['db'];function respondWithStatusCode(_0x122006,_0x3a1870){_0x3a1870=_0x3a1870||0xcc;return function(_0x3ab822){if(_0x3ab822){return _0x122006[_0x0a45('0x1a')](_0x3a1870);}return _0x122006['status'](_0x3a1870)['end']();};}function respondWithResult(_0x4b207f,_0x93d625){_0x93d625=_0x93d625||0xc8;return function(_0x5dbb4c){if(_0x5dbb4c){return _0x4b207f[_0x0a45('0x1b')](_0x93d625)[_0x0a45('0x1c')](_0x5dbb4c);}};}function respondWithFilteredResult(_0x41ef44,_0x2a2738){return function(_0x9ab1db){if(_0x9ab1db){var _0xdd7e86=typeof _0x2a2738['offset']===_0x0a45('0x1d')&&typeof _0x2a2738[_0x0a45('0x1e')]===_0x0a45('0x1d');var _0x29ad73=_0x9ab1db[_0x0a45('0x1f')];var _0x511f3f=_0xdd7e86?0x0:_0x2a2738[_0x0a45('0x20')];var _0x1cd02e=_0xdd7e86?_0x9ab1db[_0x0a45('0x1f')]:_0x2a2738[_0x0a45('0x20')]+_0x2a2738[_0x0a45('0x1e')];var _0x1530a4;if(_0x1cd02e>=_0x29ad73){_0x1cd02e=_0x29ad73;_0x1530a4=0xc8;}else{_0x1530a4=0xce;}_0x41ef44[_0x0a45('0x1b')](_0x1530a4);return _0x41ef44[_0x0a45('0x21')](_0x0a45('0x22'),_0x511f3f+'-'+_0x1cd02e+'/'+_0x29ad73)[_0x0a45('0x1c')](_0x9ab1db);}return null;};}function patchUpdates(_0x365451){return function(_0x134516){try{jsonpatch[_0x0a45('0x23')](_0x134516,_0x365451,!![]);}catch(_0x11d3bd){return BPromise[_0x0a45('0x24')](_0x11d3bd);}return _0x134516[_0x0a45('0x25')]();};}function saveUpdates(_0x228912,_0x7c7b0b){return function(_0x4684ec){if(_0x4684ec){return _0x4684ec['update'](_0x228912)[_0x0a45('0x26')](function(_0x4981ba){return _0x4981ba;});}return null;};}function removeEntity(_0x5d8640,_0x37ae4e){return function(_0x39a3e9){if(_0x39a3e9){return _0x39a3e9[_0x0a45('0x27')]()[_0x0a45('0x26')](function(){_0x5d8640[_0x0a45('0x1b')](0xcc)[_0x0a45('0x28')]();});}};}function handleEntityNotFound(_0x3fba21,_0x449980){return function(_0x5a0405){if(!_0x5a0405){_0x3fba21['sendStatus'](0x194);}return _0x5a0405;};}function handleError(_0x51f75c,_0x5e25c5){_0x5e25c5=_0x5e25c5||0x1f4;return function(_0x5cc5dd){logger[_0x0a45('0x29')](_0x5cc5dd[_0x0a45('0x2a')]);if(_0x5cc5dd[_0x0a45('0x2b')]){delete _0x5cc5dd[_0x0a45('0x2b')];}_0x51f75c['status'](_0x5e25c5)[_0x0a45('0x2c')](_0x5cc5dd);};}exports[_0x0a45('0x2d')]=function(_0x1bbbc2,_0x3fb0b4){var _0x2be88f={},_0x4da69a={},_0x126de4={'count':0x0,'rows':[]};var _0x383f2f=_[_0x0a45('0x2e')](db['ZendeskField'][_0x0a45('0x2f')],function(_0x5926b4){return{'name':_0x5926b4[_0x0a45('0x30')],'type':_0x5926b4[_0x0a45('0x31')][_0x0a45('0x32')]};});_0x4da69a[_0x0a45('0x33')]=_[_0x0a45('0x2e')](_0x383f2f,_0x0a45('0x2b'));_0x4da69a[_0x0a45('0x34')]=_[_0x0a45('0x35')](_0x1bbbc2[_0x0a45('0x34')]);_0x4da69a[_0x0a45('0x36')]=_[_0x0a45('0x37')](_0x4da69a[_0x0a45('0x33')],_0x4da69a[_0x0a45('0x34')]);_0x2be88f[_0x0a45('0x38')]=_[_0x0a45('0x37')](_0x4da69a['model'],qs[_0x0a45('0x39')](_0x1bbbc2[_0x0a45('0x34')][_0x0a45('0x39')]));_0x2be88f[_0x0a45('0x38')]=_0x2be88f[_0x0a45('0x38')][_0x0a45('0x3a')]?_0x2be88f[_0x0a45('0x38')]:_0x4da69a[_0x0a45('0x33')];if(!_0x1bbbc2[_0x0a45('0x34')][_0x0a45('0x3b')](_0x0a45('0x3c'))){_0x2be88f['limit']=qs[_0x0a45('0x1e')](_0x1bbbc2[_0x0a45('0x34')][_0x0a45('0x1e')]);_0x2be88f['offset']=qs['offset'](_0x1bbbc2[_0x0a45('0x34')][_0x0a45('0x20')]);}_0x2be88f['order']=qs[_0x0a45('0x3d')](_0x1bbbc2[_0x0a45('0x34')][_0x0a45('0x3d')]);_0x2be88f[_0x0a45('0x3e')]=qs[_0x0a45('0x36')](_[_0x0a45('0x3f')](_0x1bbbc2[_0x0a45('0x34')],_0x4da69a[_0x0a45('0x36')]),_0x383f2f);if(_0x1bbbc2[_0x0a45('0x34')][_0x0a45('0x40')]){_0x2be88f[_0x0a45('0x3e')]=_[_0x0a45('0x41')](_0x2be88f[_0x0a45('0x3e')],{'$or':_[_0x0a45('0x2e')](_0x383f2f,function(_0x14a96c){if(_0x14a96c[_0x0a45('0x31')]!==_0x0a45('0x42')){var _0x391e6d={};_0x391e6d[_0x14a96c[_0x0a45('0x2b')]]={'$like':'%'+_0x1bbbc2[_0x0a45('0x34')][_0x0a45('0x40')]+'%'};return _0x391e6d;}})});}_0x2be88f=_[_0x0a45('0x41')]({},_0x2be88f,_0x1bbbc2[_0x0a45('0x43')]);var _0x16a3bf={'where':_0x2be88f[_0x0a45('0x3e')]};return db['ZendeskField'][_0x0a45('0x1f')](_0x16a3bf)['then'](function(_0x106314){_0x126de4['count']=_0x106314;if(_0x1bbbc2[_0x0a45('0x34')][_0x0a45('0x44')]){_0x2be88f[_0x0a45('0x45')]=[{'all':!![]}];}return db[_0x0a45('0x46')][_0x0a45('0x47')](_0x2be88f);})['then'](function(_0x49aa53){_0x126de4['rows']=_0x49aa53;return _0x126de4;})[_0x0a45('0x26')](respondWithFilteredResult(_0x3fb0b4,_0x2be88f))[_0x0a45('0x48')](handleError(_0x3fb0b4,null));};exports['show']=function(_0x5b8596,_0x40d5ea){var _0x289268={'raw':!![],'where':{'id':_0x5b8596['params']['id']}},_0x28f226={};_0x28f226[_0x0a45('0x33')]=_[_0x0a45('0x35')](db['ZendeskField'][_0x0a45('0x2f')]);_0x28f226[_0x0a45('0x34')]=_[_0x0a45('0x35')](_0x5b8596[_0x0a45('0x34')]);_0x28f226[_0x0a45('0x36')]=_[_0x0a45('0x37')](_0x28f226[_0x0a45('0x33')],_0x28f226[_0x0a45('0x34')]);_0x289268['attributes']=_[_0x0a45('0x37')](_0x28f226[_0x0a45('0x33')],qs[_0x0a45('0x39')](_0x5b8596['query'][_0x0a45('0x39')]));_0x289268['attributes']=_0x289268[_0x0a45('0x38')][_0x0a45('0x3a')]?_0x289268[_0x0a45('0x38')]:_0x28f226[_0x0a45('0x33')];if(_0x5b8596[_0x0a45('0x34')]['includeAll']){_0x289268['include']=[{'all':!![]}];}_0x289268=_['merge']({},_0x289268,_0x5b8596['options']);return db[_0x0a45('0x46')][_0x0a45('0x49')](_0x289268)[_0x0a45('0x26')](handleEntityNotFound(_0x40d5ea,null))[_0x0a45('0x26')](respondWithResult(_0x40d5ea,null))[_0x0a45('0x48')](handleError(_0x40d5ea,null));};exports[_0x0a45('0x4a')]=function(_0x34379e,_0x33ad70){return db[_0x0a45('0x46')][_0x0a45('0x4a')](_0x34379e[_0x0a45('0x4b')],{})['then'](respondWithResult(_0x33ad70,0xc9))[_0x0a45('0x48')](handleError(_0x33ad70,null));};exports[_0x0a45('0x4c')]=function(_0x4215c9,_0xcb1739){if(_0x4215c9[_0x0a45('0x4b')]['id']){delete _0x4215c9['body']['id'];}return db[_0x0a45('0x46')][_0x0a45('0x49')]({'where':{'id':_0x4215c9[_0x0a45('0x4d')]['id']}})[_0x0a45('0x26')](handleEntityNotFound(_0xcb1739,null))['then'](saveUpdates(_0x4215c9[_0x0a45('0x4b')],null))[_0x0a45('0x26')](respondWithResult(_0xcb1739,null))[_0x0a45('0x48')](handleError(_0xcb1739,null));};exports[_0x0a45('0x27')]=function(_0x585817,_0x2aa884){return db[_0x0a45('0x46')][_0x0a45('0x49')]({'where':{'id':_0x585817[_0x0a45('0x4d')]['id']}})[_0x0a45('0x26')](handleEntityNotFound(_0x2aa884,null))[_0x0a45('0x26')](removeEntity(_0x2aa884,null))['catch'](handleError(_0x2aa884,null));};
\ No newline at end of file
index 3e5f408..456fe1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9db=['define','int_zendesk_fields','zendesk_unique_index','idField','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskField.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf9db,0x1e4));var _0xbf9d=function(_0x42d51b,_0x11a915){_0x42d51b=_0x42d51b-0x0;var _0x5d1c5f=_0xf9db[_0x42d51b];return _0x5d1c5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf9d('0x0'))(_0xbf9d('0x1'));var moment=require(_0xbf9d('0x2'));var BPromise=require(_0xbf9d('0x3'));var rp=require(_0xbf9d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf9d('0x5'));var config=require('../../config/environment');var attributes=require(_0xbf9d('0x6'));module[_0xbf9d('0x7')]=function(_0x1132be,_0x2b4db0){return _0x1132be[_0xbf9d('0x8')]('ZendeskField',attributes,{'tableName':_0xbf9d('0x9'),'paranoid':![],'indexes':[{'name':_0xbf9d('0xa'),'fields':[_0xbf9d('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e9f=['api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util'];(function(_0x16d6a9,_0x5346dc){var _0x3654fb=function(_0x175fae){while(--_0x175fae){_0x16d6a9['push'](_0x16d6a9['shift']());}};_0x3654fb(++_0x5346dc);}(_0x1e9f,0x1db));var _0xf1e9=function(_0x5aaa23,_0x51e461){_0x5aaa23=_0x5aaa23-0x0;var _0x21936a=_0x1e9f[_0x5aaa23];return _0x21936a;};'use strict';var _=require('lodash');var util=require(_0xf1e9('0x0'));var logger=require('../../config/logger')(_0xf1e9('0x1'));var moment=require('moment');var BPromise=require(_0xf1e9('0x2'));var rp=require(_0xf1e9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1e9('0x4'));var config=require(_0xf1e9('0x5'));var attributes=require(_0xf1e9('0x6'));module[_0xf1e9('0x7')]=function(_0x8d232c,_0x32ab87){return _0x8d232c[_0xf1e9('0x8')](_0xf1e9('0x9'),attributes,{'tableName':_0xf1e9('0xa'),'paranoid':![],'indexes':[{'name':_0xf1e9('0xb'),'fields':[_0xf1e9('0xc'),_0xf1e9('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 27e17cf..6b423e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3c9=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util'];(function(_0x2c1c86,_0xb5268b){var _0x127659=function(_0x598cbe){while(--_0x598cbe){_0x2c1c86['push'](_0x2c1c86['shift']());}};_0x127659(++_0xb5268b);}(_0xd3c9,0x185));var _0x9d3c=function(_0xbef764,_0x195d4a){_0xbef764=_0xbef764-0x0;var _0x431b5a=_0xd3c9[_0xbef764];return _0x431b5a;};'use strict';var _=require(_0x9d3c('0x0'));var util=require(_0x9d3c('0x1'));var moment=require(_0x9d3c('0x2'));var BPromise=require(_0x9d3c('0x3'));var rs=require(_0x9d3c('0x4'));var fs=require('fs');var Redis=require(_0x9d3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d3c('0x6'));var logger=require(_0x9d3c('0x7'))(_0x9d3c('0x8'));var config=require(_0x9d3c('0x9'));var jayson=require(_0x9d3c('0xa'));var client=jayson[_0x9d3c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x521859,_0x16cd62,_0xc13f83){return new BPromise(function(_0x1e2a0d,_0xc4d0da){return client[_0x9d3c('0xc')](_0x521859,_0xc13f83)[_0x9d3c('0xd')](function(_0x3d7e7a){logger[_0x9d3c('0xe')](_0x9d3c('0xf'),_0x16cd62,_0x9d3c('0x10'));logger['debug'](_0x9d3c('0x11'),_0x16cd62,_0x9d3c('0x10'),JSON['stringify'](_0x3d7e7a));if(_0x3d7e7a['error']){if(_0x3d7e7a['error'][_0x9d3c('0x12')]===0x1f4){logger[_0x9d3c('0x13')]('ZendeskField,\x20%s,\x20%s',_0x16cd62,_0x3d7e7a[_0x9d3c('0x13')]['message']);return _0xc4d0da(_0x3d7e7a[_0x9d3c('0x13')][_0x9d3c('0x14')]);}logger[_0x9d3c('0x13')](_0x9d3c('0xf'),_0x16cd62,_0x3d7e7a['error'][_0x9d3c('0x14')]);return _0x1e2a0d(_0x3d7e7a['error'][_0x9d3c('0x14')]);}else{logger[_0x9d3c('0xe')](_0x9d3c('0xf'),_0x16cd62,_0x9d3c('0x10'));_0x1e2a0d(_0x3d7e7a[_0x9d3c('0x15')]['message']);}})[_0x9d3c('0x16')](function(_0x4ce328){logger[_0x9d3c('0x13')](_0x9d3c('0xf'),_0x16cd62,_0x4ce328);_0xc4d0da(_0x4ce328);});});}
\ No newline at end of file
+var _0xf043=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info'];(function(_0x5fb9da,_0x1ac0d0){var _0x528081=function(_0x24793f){while(--_0x24793f){_0x5fb9da['push'](_0x5fb9da['shift']());}};_0x528081(++_0x1ac0d0);}(_0xf043,0x167));var _0x3f04=function(_0x2bcfc1,_0x22e47b){_0x2bcfc1=_0x2bcfc1-0x0;var _0x380ab4=_0xf043[_0x2bcfc1];return _0x380ab4;};'use strict';var _=require('lodash');var util=require(_0x3f04('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f04('0x1'));var db=require(_0x3f04('0x2'))['db'];var utils=require(_0x3f04('0x3'));var logger=require(_0x3f04('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f04('0x5')][_0x3f04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4b14f0,_0x145853,_0x179a1c){return new BPromise(function(_0x1d7505,_0x3b0703){return client[_0x3f04('0x7')](_0x4b14f0,_0x179a1c)['then'](function(_0x34ae77){logger[_0x3f04('0x8')](_0x3f04('0x9'),_0x145853,_0x3f04('0xa'));logger[_0x3f04('0xb')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x145853,_0x3f04('0xa'),JSON['stringify'](_0x34ae77));if(_0x34ae77[_0x3f04('0xc')]){if(_0x34ae77[_0x3f04('0xc')][_0x3f04('0xd')]===0x1f4){logger[_0x3f04('0xc')](_0x3f04('0x9'),_0x145853,_0x34ae77[_0x3f04('0xc')]['message']);return _0x3b0703(_0x34ae77[_0x3f04('0xc')][_0x3f04('0xe')]);}logger[_0x3f04('0xc')](_0x3f04('0x9'),_0x145853,_0x34ae77[_0x3f04('0xc')][_0x3f04('0xe')]);return _0x1d7505(_0x34ae77[_0x3f04('0xc')][_0x3f04('0xe')]);}else{logger['info'](_0x3f04('0x9'),_0x145853,_0x3f04('0xa'));_0x1d7505(_0x34ae77[_0x3f04('0xf')][_0x3f04('0xe')]);}})['catch'](function(_0x396a0d){logger['error'](_0x3f04('0x9'),_0x145853,_0x396a0d);_0x3b0703(_0x396a0d);});});}
\ No newline at end of file
index e690dcd..18d9d78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc433=['index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated'];(function(_0x4643b7,_0x574ca9){var _0x4808e0=function(_0x64c256){while(--_0x64c256){_0x4643b7['push'](_0x4643b7['shift']());}};_0x4808e0(++_0x574ca9);}(_0xc433,0x1b1));var _0x3c43=function(_0x27ceb7,_0x3e2666){_0x27ceb7=_0x27ceb7-0x0;var _0x456a8b=_0xc433[_0x27ceb7];return _0x456a8b;};'use strict';var multer=require(_0x3c43('0x0'));var util=require('util');var path=require(_0x3c43('0x1'));var timeout=require(_0x3c43('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3c43('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3c43('0x4'));var config=require('../../config/environment');var controller=require(_0x3c43('0x5'));router['get']('/',auth[_0x3c43('0x6')](),controller[_0x3c43('0x7')]);router[_0x3c43('0x8')]('/:id',auth[_0x3c43('0x6')](),controller[_0x3c43('0x9')]);router[_0x3c43('0x8')](_0x3c43('0xa'),auth[_0x3c43('0x6')](),controller[_0x3c43('0xb')]);router[_0x3c43('0x8')](_0x3c43('0xc'),auth[_0x3c43('0x6')](),controller[_0x3c43('0xd')]);router[_0x3c43('0xe')]('/',auth[_0x3c43('0x6')](),controller[_0x3c43('0xf')]);router['post'](_0x3c43('0xa'),auth[_0x3c43('0x6')](),controller[_0x3c43('0x10')]);router[_0x3c43('0x11')](_0x3c43('0x12'),auth[_0x3c43('0x6')](),controller['update']);router[_0x3c43('0x13')](_0x3c43('0x12'),auth[_0x3c43('0x6')](),controller[_0x3c43('0x14')]);module[_0x3c43('0x15')]=router;
\ No newline at end of file
+var _0x7ad3=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','create','post','addConfiguration','put'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x7ad3,0x108));var _0x37ad=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0x7ad3[_0x10e983];return _0x324138;};'use strict';var multer=require(_0x37ad('0x0'));var util=require(_0x37ad('0x1'));var path=require(_0x37ad('0x2'));var timeout=require(_0x37ad('0x3'));var express=require('express');var router=express[_0x37ad('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x37ad('0x5'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x37ad('0x6')](),controller[_0x37ad('0x7')]);router[_0x37ad('0x8')](_0x37ad('0x9'),auth[_0x37ad('0x6')](),controller[_0x37ad('0xa')]);router[_0x37ad('0x8')](_0x37ad('0xb'),auth[_0x37ad('0x6')](),controller['getConfigurations']);router[_0x37ad('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x37ad('0x6')](),controller[_0x37ad('0xc')]);router[_0x37ad('0xd')](_0x37ad('0xb'),auth[_0x37ad('0x6')](),controller[_0x37ad('0xe')]);router[_0x37ad('0xf')](_0x37ad('0x9'),auth[_0x37ad('0x6')](),controller[_0x37ad('0x10')]);router[_0x37ad('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x37ad('0x12')]);module[_0x37ad('0x13')]=router;
\ No newline at end of file
index c9dc4ce..cc081cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ba=['sequelize','exports','STRING'];(function(_0x908eb6,_0x59199b){var _0x511a09=function(_0x376c8b){while(--_0x376c8b){_0x908eb6['push'](_0x908eb6['shift']());}};_0x511a09(++_0x59199b);}(_0x17ba,0xab));var _0xa17b=function(_0x347b98,_0x4b6fd0){_0x347b98=_0x347b98-0x0;var _0x2d5de9=_0x17ba[_0x347b98];return _0x2d5de9;};'use strict';var Sequelize=require(_0xa17b('0x0'));module[_0xa17b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa17b('0x2')]},'host':{'type':Sequelize[_0xa17b('0x2')]},'zone':{'type':Sequelize[_0xa17b('0x2')]},'clientId':{'type':Sequelize[_0xa17b('0x2')]},'clientSecret':{'type':Sequelize[_0xa17b('0x2')]},'serverUrl':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xa17b('0x2')]},'refreshToken':{'type':Sequelize[_0xa17b('0x2')]}};
\ No newline at end of file
+var _0x9c44=['STRING'];(function(_0x4e38fd,_0x13d776){var _0x2fe8b7=function(_0x22127a){while(--_0x22127a){_0x4e38fd['push'](_0x4e38fd['shift']());}};_0x2fe8b7(++_0x13d776);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')]},'description':{'type':Sequelize[_0x49c4('0x0')]},'host':{'type':Sequelize[_0x49c4('0x0')]},'zone':{'type':Sequelize[_0x49c4('0x0')]},'clientId':{'type':Sequelize[_0x49c4('0x0')]},'clientSecret':{'type':Sequelize[_0x49c4('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x49c4('0x0')]}};
\ No newline at end of file
index 5d1fa22..632fec7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc77d=['../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','error','name','send','index','ZohoAccount','rawAttributes','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','then','includeAll','include','show','params','find','catch','create','body','update','destroy','getConfigurations','findOne','ZohoConfiguration','pick','addConfiguration','Subjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','access_token','host','clientId','clientSecret','code','com','serverUrl','slice','substring','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x136e11,_0x2f39f7){var _0x469ad9=function(_0x361c3d){while(--_0x361c3d){_0x136e11['push'](_0x136e11['shift']());}};_0x469ad9(++_0x2f39f7);}(_0xc77d,0x1e3));var _0xdc77=function(_0x536609,_0x58d4bb){_0x536609=_0x536609-0x0;var _0x3d34fd=_0xc77d[_0x536609];return _0x3d34fd;};'use strict';var emlformat=require(_0xdc77('0x0'));var rimraf=require(_0xdc77('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdc77('0x2'));var moment=require(_0xdc77('0x3'));var BPromise=require(_0xdc77('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdc77('0x5'));var csv=require(_0xdc77('0x6'));var ejs=require(_0xdc77('0x7'));var fs=require('fs');var fs_extra=require(_0xdc77('0x8'));var _=require(_0xdc77('0x9'));var squel=require(_0xdc77('0xa'));var crypto=require(_0xdc77('0xb'));var jsforce=require(_0xdc77('0xc'));var deskjs=require(_0xdc77('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdc77('0xe'));var Papa=require(_0xdc77('0xf'));var Redis=require(_0xdc77('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdc77('0x11'));var as=require(_0xdc77('0x12'));var hardwareService=require(_0xdc77('0x13'));var logger=require('../../config/logger')(_0xdc77('0x14'));var utils=require(_0xdc77('0x15'));var config=require(_0xdc77('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc77('0x17'))['db'];var integrations=require(_0xdc77('0x18'));function respondWithStatusCode(_0x597b4b,_0x5eed87){_0x5eed87=_0x5eed87||0xcc;return function(_0x2710b1){if(_0x2710b1){return _0x597b4b[_0xdc77('0x19')](_0x5eed87);}return _0x597b4b['status'](_0x5eed87)[_0xdc77('0x1a')]();};}function respondWithResult(_0x5d909d,_0x481f5b){_0x481f5b=_0x481f5b||0xc8;return function(_0x23187d){if(_0x23187d){return _0x5d909d[_0xdc77('0x1b')](_0x481f5b)[_0xdc77('0x1c')](_0x23187d);}};}function respondWithFilteredResult(_0x1e8063,_0x375c73){return function(_0x6030b9){if(_0x6030b9){var _0x433f8c=typeof _0x375c73[_0xdc77('0x1d')]===_0xdc77('0x1e')&&typeof _0x375c73[_0xdc77('0x1f')]==='undefined';var _0x2bcb2a=_0x6030b9['count'];var _0x24f103=_0x433f8c?0x0:_0x375c73[_0xdc77('0x1d')];var _0x1eb330=_0x433f8c?_0x6030b9['count']:_0x375c73['offset']+_0x375c73[_0xdc77('0x1f')];var _0x5f145d;if(_0x1eb330>=_0x2bcb2a){_0x1eb330=_0x2bcb2a;_0x5f145d=0xc8;}else{_0x5f145d=0xce;}_0x1e8063[_0xdc77('0x1b')](_0x5f145d);return _0x1e8063[_0xdc77('0x20')](_0xdc77('0x21'),_0x24f103+'-'+_0x1eb330+'/'+_0x2bcb2a)[_0xdc77('0x1c')](_0x6030b9);}return null;};}function patchUpdates(_0x520aa3){return function(_0x3bc2d0){try{jsonpatch['apply'](_0x3bc2d0,_0x520aa3,!![]);}catch(_0x517769){return BPromise[_0xdc77('0x22')](_0x517769);}return _0x3bc2d0[_0xdc77('0x23')]();};}function saveUpdates(_0x24d169,_0x5ba63a){return function(_0x25869b){if(_0x25869b){return _0x25869b['update'](_0x24d169)['then'](function(_0x22b77b){return _0x22b77b;});}return null;};}function removeEntity(_0x36b275,_0x2ecb9b){return function(_0x5f0807){if(_0x5f0807){return _0x5f0807['destroy']()['then'](function(){_0x36b275['status'](0xcc)[_0xdc77('0x1a')]();});}};}function handleEntityNotFound(_0x3dd8b2,_0x3946bf){return function(_0x5267fb){if(!_0x5267fb){_0x3dd8b2[_0xdc77('0x19')](0x194);}return _0x5267fb;};}function handleError(_0x9214fd,_0x1e358b){_0x1e358b=_0x1e358b||0x1f4;return function(_0x569607){logger[_0xdc77('0x24')](_0x569607['stack']);if(_0x569607['name']){delete _0x569607[_0xdc77('0x25')];}_0x9214fd['status'](_0x1e358b)[_0xdc77('0x26')](_0x569607);};}exports[_0xdc77('0x27')]=function(_0x37134d,_0x1acb8b){var _0x41a9ab={},_0x225a15={},_0x14fd81={'count':0x0,'rows':[]};var _0x1486f1=_['map'](db[_0xdc77('0x28')][_0xdc77('0x29')],function(_0x2af082){return{'name':_0x2af082['fieldName'],'type':_0x2af082[_0xdc77('0x2a')][_0xdc77('0x2b')]};});_0x225a15['model']=_[_0xdc77('0x2c')](_0x1486f1,_0xdc77('0x25'));_0x225a15[_0xdc77('0x2d')]=_[_0xdc77('0x2e')](_0x37134d[_0xdc77('0x2d')]);_0x225a15[_0xdc77('0x2f')]=_['intersection'](_0x225a15[_0xdc77('0x30')],_0x225a15['query']);_0x41a9ab['attributes']=_[_0xdc77('0x31')](_0x225a15['model'],qs[_0xdc77('0x32')](_0x37134d[_0xdc77('0x2d')][_0xdc77('0x32')]));_0x41a9ab['attributes']=_0x41a9ab[_0xdc77('0x33')][_0xdc77('0x34')]?_0x41a9ab[_0xdc77('0x33')]:_0x225a15[_0xdc77('0x30')];if(!_0x37134d[_0xdc77('0x2d')][_0xdc77('0x35')](_0xdc77('0x36'))){_0x41a9ab[_0xdc77('0x1f')]=qs[_0xdc77('0x1f')](_0x37134d['query'][_0xdc77('0x1f')]);_0x41a9ab[_0xdc77('0x1d')]=qs[_0xdc77('0x1d')](_0x37134d[_0xdc77('0x2d')][_0xdc77('0x1d')]);}_0x41a9ab[_0xdc77('0x37')]=qs[_0xdc77('0x38')](_0x37134d[_0xdc77('0x2d')][_0xdc77('0x38')]);_0x41a9ab[_0xdc77('0x39')]=qs[_0xdc77('0x2f')](_['pick'](_0x37134d[_0xdc77('0x2d')],_0x225a15['filters']),_0x1486f1);if(_0x37134d['query'][_0xdc77('0x3a')]){_0x41a9ab[_0xdc77('0x39')]=_[_0xdc77('0x3b')](_0x41a9ab['where'],{'$or':_[_0xdc77('0x2c')](_0x1486f1,function(_0xa422e3){if(_0xa422e3[_0xdc77('0x2a')]!==_0xdc77('0x3c')){var _0x54bd9f={};_0x54bd9f[_0xa422e3['name']]={'$like':'%'+_0x37134d['query'][_0xdc77('0x3a')]+'%'};return _0x54bd9f;}})});}_0x41a9ab=_[_0xdc77('0x3b')]({},_0x41a9ab,_0x37134d[_0xdc77('0x3d')]);var _0x559502={'where':_0x41a9ab[_0xdc77('0x39')]};return db[_0xdc77('0x28')][_0xdc77('0x3e')](_0x559502)[_0xdc77('0x3f')](function(_0x1e1a29){_0x14fd81[_0xdc77('0x3e')]=_0x1e1a29;if(_0x37134d[_0xdc77('0x2d')][_0xdc77('0x40')]){_0x41a9ab[_0xdc77('0x41')]=[{'all':!![]}];}return db[_0xdc77('0x28')]['findAll'](_0x41a9ab);})['then'](function(_0x1e287a){_0x14fd81['rows']=_0x1e287a;return _0x14fd81;})['then'](respondWithFilteredResult(_0x1acb8b,_0x41a9ab))['catch'](handleError(_0x1acb8b,null));};exports[_0xdc77('0x42')]=function(_0x5a71c3,_0x45fcc1){var _0x17b403={'raw':![],'where':{'id':_0x5a71c3[_0xdc77('0x43')]['id']}},_0x3ec523={};_0x3ec523[_0xdc77('0x30')]=_[_0xdc77('0x2e')](db[_0xdc77('0x28')][_0xdc77('0x29')]);_0x3ec523[_0xdc77('0x2d')]=_[_0xdc77('0x2e')](_0x5a71c3[_0xdc77('0x2d')]);_0x3ec523[_0xdc77('0x2f')]=_[_0xdc77('0x31')](_0x3ec523['model'],_0x3ec523['query']);_0x17b403['attributes']=_[_0xdc77('0x31')](_0x3ec523['model'],qs['fields'](_0x5a71c3[_0xdc77('0x2d')][_0xdc77('0x32')]));_0x17b403[_0xdc77('0x33')]=_0x17b403['attributes'][_0xdc77('0x34')]?_0x17b403['attributes']:_0x3ec523[_0xdc77('0x30')];if(_0x5a71c3[_0xdc77('0x2d')][_0xdc77('0x40')]){_0x17b403[_0xdc77('0x41')]=[{'all':!![]}];}_0x17b403=_[_0xdc77('0x3b')]({},_0x17b403,_0x5a71c3[_0xdc77('0x3d')]);return db[_0xdc77('0x28')][_0xdc77('0x44')](_0x17b403)[_0xdc77('0x3f')](handleEntityNotFound(_0x45fcc1,null))[_0xdc77('0x3f')](respondWithResult(_0x45fcc1,null))[_0xdc77('0x45')](handleError(_0x45fcc1,null));};exports[_0xdc77('0x46')]=function(_0x418da6,_0x34dc3d){return db[_0xdc77('0x28')][_0xdc77('0x46')](_0x418da6[_0xdc77('0x47')],{})[_0xdc77('0x3f')](respondWithResult(_0x34dc3d,0xc9))['catch'](handleError(_0x34dc3d,null));};exports[_0xdc77('0x48')]=function(_0x5553c9,_0x39b410){if(_0x5553c9[_0xdc77('0x47')]['id']){delete _0x5553c9[_0xdc77('0x47')]['id'];}return db[_0xdc77('0x28')][_0xdc77('0x44')]({'where':{'id':_0x5553c9[_0xdc77('0x43')]['id']}})['then'](handleEntityNotFound(_0x39b410,null))[_0xdc77('0x3f')](saveUpdates(_0x5553c9[_0xdc77('0x47')],null))['then'](respondWithResult(_0x39b410,null))['catch'](handleError(_0x39b410,null));};exports[_0xdc77('0x49')]=function(_0x4cc5ed,_0x275321){return db[_0xdc77('0x28')]['find']({'where':{'id':_0x4cc5ed[_0xdc77('0x43')]['id']}})[_0xdc77('0x3f')](handleEntityNotFound(_0x275321,null))[_0xdc77('0x3f')](removeEntity(_0x275321,null))['catch'](handleError(_0x275321,null));};exports[_0xdc77('0x4a')]=function(_0x4c6300,_0x580bd7,_0x3daa84){var _0x5afc20={};var _0x596d1d={};var _0x23d340;var _0x5ba919;return db['ZohoAccount'][_0xdc77('0x4b')]({'where':{'id':_0x4c6300['params']['id']}})[_0xdc77('0x3f')](handleEntityNotFound(_0x580bd7,null))[_0xdc77('0x3f')](function(_0x31394a){if(_0x31394a){_0x23d340=_0x31394a;_0x596d1d[_0xdc77('0x30')]=_[_0xdc77('0x2e')](db[_0xdc77('0x4c')][_0xdc77('0x29')]);_0x596d1d[_0xdc77('0x2d')]=_[_0xdc77('0x2e')](_0x4c6300[_0xdc77('0x2d')]);_0x596d1d[_0xdc77('0x2f')]=_['intersection'](_0x596d1d[_0xdc77('0x30')],_0x596d1d[_0xdc77('0x2d')]);_0x5afc20[_0xdc77('0x33')]=_[_0xdc77('0x31')](_0x596d1d['model'],qs[_0xdc77('0x32')](_0x4c6300[_0xdc77('0x2d')][_0xdc77('0x32')]));_0x5afc20[_0xdc77('0x33')]=_0x5afc20[_0xdc77('0x33')][_0xdc77('0x34')]?_0x5afc20[_0xdc77('0x33')]:_0x596d1d[_0xdc77('0x30')];_0x5afc20[_0xdc77('0x37')]=qs[_0xdc77('0x38')](_0x4c6300[_0xdc77('0x2d')][_0xdc77('0x38')]);_0x5afc20[_0xdc77('0x39')]=qs[_0xdc77('0x2f')](_[_0xdc77('0x4d')](_0x4c6300[_0xdc77('0x2d')],_0x596d1d[_0xdc77('0x2f')]));if(_0x4c6300[_0xdc77('0x2d')]['filter']){_0x5afc20['where']=_['merge'](_0x5afc20['where'],{'$or':_['map'](_0x5afc20['attributes'],function(_0x11df20){var _0x5c6b1e={};_0x5c6b1e[_0x11df20]={'$like':'%'+_0x4c6300['query']['filter']+'%'};return _0x5c6b1e;})});}_0x5afc20=_[_0xdc77('0x3b')]({},_0x5afc20,_0x4c6300[_0xdc77('0x3d')]);return _0x23d340['getConfigurations'](_0x5afc20);}})[_0xdc77('0x3f')](function(_0x22bff9){if(_0x22bff9){_0x5ba919=_0x22bff9['length'];if(!_0x4c6300[_0xdc77('0x2d')][_0xdc77('0x35')]('nolimit')){_0x5afc20[_0xdc77('0x1f')]=qs[_0xdc77('0x1f')](_0x4c6300['query'][_0xdc77('0x1f')]);_0x5afc20[_0xdc77('0x1d')]=qs[_0xdc77('0x1d')](_0x4c6300[_0xdc77('0x2d')][_0xdc77('0x1d')]);}return _0x23d340['getConfigurations'](_0x5afc20);}})[_0xdc77('0x3f')](function(_0x47f0a3){if(_0x47f0a3){return _0x47f0a3?{'count':_0x5ba919,'rows':_0x47f0a3}:null;}})[_0xdc77('0x3f')](respondWithResult(_0x580bd7,null))[_0xdc77('0x45')](handleError(_0x580bd7,null));};exports[_0xdc77('0x4e')]=function(_0x4502fa,_0x8736d5,_0x2699fa){if(_0x4502fa[_0xdc77('0x47')]['id']){delete _0x4502fa[_0xdc77('0x47')]['id'];}return db[_0xdc77('0x28')][_0xdc77('0x4b')]({'where':{'id':_0x4502fa[_0xdc77('0x43')]['id']}})['then'](handleEntityNotFound(_0x8736d5,null))[_0xdc77('0x3f')](function(_0x1c7987){if(_0x1c7987){_0x4502fa['body']['AccountId']=_0x1c7987['id'];_0x4502fa[_0xdc77('0x47')][_0xdc77('0x4f')]=integrations['getSubjects'](_0x4502fa['body'][_0xdc77('0x50')],_0x4502fa['body'][_0xdc77('0x2a')]);_0x4502fa[_0xdc77('0x47')][_0xdc77('0x51')]=integrations['getDescriptions'](_0x4502fa[_0xdc77('0x47')][_0xdc77('0x50')],_0x4502fa[_0xdc77('0x47')][_0xdc77('0x2a')]);return db[_0xdc77('0x4c')][_0xdc77('0x46')](_0x4502fa[_0xdc77('0x47')],{'include':[{'model':db[_0xdc77('0x52')],'as':_0xdc77('0x4f')},{'model':db[_0xdc77('0x52')],'as':_0xdc77('0x51')}]});}return null;})['then'](respondWithResult(_0x8736d5,null))[_0xdc77('0x45')](handleError(_0x8736d5,null));};function getAccessToken(_0x327f35){return new Promise(function(_0x3c27ef,_0x27c6a9){var _0x41ed05;switch(_0x327f35[_0xdc77('0x53')]){case'US':_0x41ed05=_0xdc77('0x54');break;case'AU':_0x41ed05=_0xdc77('0x55');break;case'EU':_0x41ed05=_0xdc77('0x56');break;case'IN':_0x41ed05='https://accounts.zoho.in';break;case'CN':_0x41ed05=_0xdc77('0x57');break;default:_0x41ed05=_0xdc77('0x56');break;}var _0x32923b={'method':_0xdc77('0x58'),'uri':_0x41ed05+_0xdc77('0x59'),'qs':{'refresh_token':_0x327f35[_0xdc77('0x5a')],'client_id':_0x327f35['clientId'],'client_secret':_0x327f35['clientSecret'],'grant_type':_0xdc77('0x5b')},'json':!![]};return rp(_0x32923b)[_0xdc77('0x3f')](function(_0x4996f1){if(_0x4996f1['access_token']){_0x3c27ef(_0x4996f1[_0xdc77('0x5c')]);}else{_0x27c6a9('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x670519){_0x27c6a9(_0x670519);});});}exports['getFields']=function(_0x453478,_0xdc08a,_0x5e4c1a){var _0x57065d,_0x1004fc,_0x5ac219,_0x2fe14f,_0x1de914;return db['ZohoAccount'][_0xdc77('0x4b')]({'where':{'id':_0x453478['params']['id']},'attributes':['id',_0xdc77('0x5d'),_0xdc77('0x53'),_0xdc77('0x5e'),_0xdc77('0x5f'),'serverUrl',_0xdc77('0x60'),'refreshToken']})[_0xdc77('0x3f')](handleEntityNotFound(_0xdc08a,null))[_0xdc77('0x3f')](function(_0xcdd245){_0x1de914=_0xcdd245;_0x57065d=_0x1de914[_0xdc77('0x5d')];_0x1004fc=_0x57065d==='zoho.eu'?'eu':_0xdc77('0x61');_0x5ac219=_0x1de914[_0xdc77('0x62')];var _0x199892=_0x5ac219[_0xdc77('0x63')](-0x1);if(_0x199892==='/'||_0x199892==='\x5c'||_0x199892===':'){_0x5ac219=_0x5ac219[_0xdc77('0x64')](0x0,_0x5ac219['lastIndexOf'](_0x199892));}if(!_0x1de914[_0xdc77('0x5a')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1de914);})[_0xdc77('0x3f')](function(_0x14cc3c){if(_0x14cc3c){return rp({'method':'GET','uri':util[_0xdc77('0x65')](_0xdc77('0x66'),_0x1004fc),'qs':{'module':_0xdc77('0x67')},'headers':{'Authorization':_0xdc77('0x68')+_0x14cc3c},'json':!![]});}})[_0xdc77('0x3f')](function(_0x1475c0){if(_0x1475c0){if(_0x1475c0[_0xdc77('0x69')]&&_0x1475c0[_0xdc77('0x69')][_0xdc77('0x24')]){throw new Error(_0x1475c0[_0xdc77('0x69')]['error'][_0xdc77('0x6a')]);}var _0x725481=[];var _0xaab7bf=[];var _0xbe2d9d=[_0xdc77('0x6b'),_0xdc77('0x6c'),_0xdc77('0x6d'),'WhoId',_0xdc77('0x6e'),_0xdc77('0x6f'),_0xdc77('0x70'),_0xdc77('0x71')];_0xaab7bf=_[_0xdc77('0x72')](_0x1475c0[_0xdc77('0x32')],function(_0xa21f9f){return _0xbe2d9d[_0xdc77('0x73')](_0xa21f9f['api_name']);});for(var _0x37e26c=0x0;_0x37e26c<_0xaab7bf[_0xdc77('0x34')];_0x37e26c++){if(_0xaab7bf[_0x37e26c]['system_mandatory']===![]){_0x725481[_0xdc77('0x74')]({'id':_0xaab7bf[_0x37e26c]['id'],'name':_0xaab7bf[_0x37e26c][_0xdc77('0x75')],'custom':_0xaab7bf[_0x37e26c][_0xdc77('0x76')],'options':_0xaab7bf[_0x37e26c][_0xdc77('0x77')]==='picklist'&&_0xaab7bf[_0x37e26c]['pick_list_values'][_0xdc77('0x34')]>-0x1?_[_0xdc77('0x2c')](_0xaab7bf[_0x37e26c][_0xdc77('0x78')],function(_0x271864){return{'name':_0x271864,'value':_0x271864};}):[]});}}return{'count':_0x725481[_0xdc77('0x34')],'rows':_0x725481};}else{return{'count':0x0,'rows':[]};}})[_0xdc77('0x3f')](respondWithResult(_0xdc08a,null))[_0xdc77('0x45')](function(_0x27ed45){var _0x20609c=_0x453478[_0xdc77('0x2d')][_0xdc77('0x79')]?0x1f4:_0x27ed45[_0xdc77('0x7a')]||0x1f4;logger[_0xdc77('0x24')](_0xdc77('0x7b'),'getFields',_0x20609c,JSON[_0xdc77('0x7c')](_0x27ed45));delete _0x27ed45[_0xdc77('0x25')];if(_0x20609c===0x191){_0x20609c=0x190;}_0xdc08a[_0xdc77('0x1b')](_0x20609c)['send'](_0x453478[_0xdc77('0x2d')][_0xdc77('0x79')]?{'message':_0xdc77('0x7d'),'statusCode':_0x27ed45[_0xdc77('0x7a')]}:_0x27ed45);});};
\ No newline at end of file
+var _0xf489=['options','includeAll','include','findAll','catch','show','params','keys','create','body','find','findOne','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','zoho.eu','com','slice','substring','lastIndexOf','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','message','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZohoAccount','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge'];(function(_0x5784e6,_0xd4acb7){var _0x43c849=function(_0x10f365){while(--_0x10f365){_0x5784e6['push'](_0x5784e6['shift']());}};_0x43c849(++_0xd4acb7);}(_0xf489,0x1d5));var _0x9f48=function(_0x2168cd,_0x1982a9){_0x2168cd=_0x2168cd-0x0;var _0x41351d=_0xf489[_0x2168cd];return _0x41351d;};'use strict';var emlformat=require(_0x9f48('0x0'));var rimraf=require(_0x9f48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f48('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f48('0x3'));var Mustache=require('mustache');var util=require(_0x9f48('0x4'));var path=require('path');var sox=require(_0x9f48('0x5'));var csv=require('to-csv');var ejs=require(_0x9f48('0x6'));var fs=require('fs');var fs_extra=require(_0x9f48('0x7'));var _=require(_0x9f48('0x8'));var squel=require(_0x9f48('0x9'));var crypto=require(_0x9f48('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9f48('0xb'));var toCsv=require(_0x9f48('0xc'));var querystring=require('querystring');var Papa=require(_0x9f48('0xd'));var Redis=require(_0x9f48('0xe'));var authService=require(_0x9f48('0xf'));var qs=require(_0x9f48('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f48('0x11'));var logger=require(_0x9f48('0x12'))(_0x9f48('0x13'));var utils=require(_0x9f48('0x14'));var config=require(_0x9f48('0x15'));var licenseUtil=require(_0x9f48('0x16'));var db=require(_0x9f48('0x17'))['db'];var integrations=require(_0x9f48('0x18'));function respondWithStatusCode(_0x1c1150,_0x1fe2b9){_0x1fe2b9=_0x1fe2b9||0xcc;return function(_0x4953a7){if(_0x4953a7){return _0x1c1150[_0x9f48('0x19')](_0x1fe2b9);}return _0x1c1150[_0x9f48('0x1a')](_0x1fe2b9)[_0x9f48('0x1b')]();};}function respondWithResult(_0x32764d,_0x183b57){_0x183b57=_0x183b57||0xc8;return function(_0x56e1b4){if(_0x56e1b4){return _0x32764d[_0x9f48('0x1a')](_0x183b57)['json'](_0x56e1b4);}};}function respondWithFilteredResult(_0x18386e,_0x474f77){return function(_0xb545b1){if(_0xb545b1){var _0x246a20=typeof _0x474f77['offset']==='undefined'&&typeof _0x474f77[_0x9f48('0x1c')]==='undefined';var _0x42af3c=_0xb545b1[_0x9f48('0x1d')];var _0x964588=_0x246a20?0x0:_0x474f77[_0x9f48('0x1e')];var _0x4f96ac=_0x246a20?_0xb545b1['count']:_0x474f77['offset']+_0x474f77[_0x9f48('0x1c')];var _0x462923;if(_0x4f96ac>=_0x42af3c){_0x4f96ac=_0x42af3c;_0x462923=0xc8;}else{_0x462923=0xce;}_0x18386e['status'](_0x462923);return _0x18386e[_0x9f48('0x1f')](_0x9f48('0x20'),_0x964588+'-'+_0x4f96ac+'/'+_0x42af3c)['json'](_0xb545b1);}return null;};}function patchUpdates(_0x5aa28e){return function(_0x363dc9){try{jsonpatch[_0x9f48('0x21')](_0x363dc9,_0x5aa28e,!![]);}catch(_0x10c83c){return BPromise[_0x9f48('0x22')](_0x10c83c);}return _0x363dc9['save']();};}function saveUpdates(_0x5b3222,_0x44f887){return function(_0x486ba1){if(_0x486ba1){return _0x486ba1[_0x9f48('0x23')](_0x5b3222)[_0x9f48('0x24')](function(_0x54a480){return _0x54a480;});}return null;};}function removeEntity(_0xbfd19,_0x3b295b){return function(_0x347c2c){if(_0x347c2c){return _0x347c2c[_0x9f48('0x25')]()['then'](function(){_0xbfd19[_0x9f48('0x1a')](0xcc)[_0x9f48('0x1b')]();});}};}function handleEntityNotFound(_0x7f1f03,_0x9fac1c){return function(_0x41e29c){if(!_0x41e29c){_0x7f1f03[_0x9f48('0x19')](0x194);}return _0x41e29c;};}function handleError(_0x4f12ad,_0x2a927f){_0x2a927f=_0x2a927f||0x1f4;return function(_0x1e64e2){logger[_0x9f48('0x26')](_0x1e64e2[_0x9f48('0x27')]);if(_0x1e64e2[_0x9f48('0x28')]){delete _0x1e64e2[_0x9f48('0x28')];}_0x4f12ad[_0x9f48('0x1a')](_0x2a927f)[_0x9f48('0x29')](_0x1e64e2);};}exports[_0x9f48('0x2a')]=function(_0x4aab7f,_0x59bc40){var _0x17835c={},_0x546550={},_0x3177d3={'count':0x0,'rows':[]};var _0x4c3b1a=_['map'](db[_0x9f48('0x2b')][_0x9f48('0x2c')],function(_0x5bf934){return{'name':_0x5bf934['fieldName'],'type':_0x5bf934[_0x9f48('0x2d')][_0x9f48('0x2e')]};});_0x546550[_0x9f48('0x2f')]=_['map'](_0x4c3b1a,'name');_0x546550[_0x9f48('0x30')]=_['keys'](_0x4aab7f[_0x9f48('0x30')]);_0x546550[_0x9f48('0x31')]=_[_0x9f48('0x32')](_0x546550[_0x9f48('0x2f')],_0x546550[_0x9f48('0x30')]);_0x17835c['attributes']=_[_0x9f48('0x32')](_0x546550['model'],qs[_0x9f48('0x33')](_0x4aab7f[_0x9f48('0x30')]['fields']));_0x17835c[_0x9f48('0x34')]=_0x17835c[_0x9f48('0x34')][_0x9f48('0x35')]?_0x17835c[_0x9f48('0x34')]:_0x546550[_0x9f48('0x2f')];if(!_0x4aab7f[_0x9f48('0x30')]['hasOwnProperty'](_0x9f48('0x36'))){_0x17835c[_0x9f48('0x1c')]=qs[_0x9f48('0x1c')](_0x4aab7f[_0x9f48('0x30')][_0x9f48('0x1c')]);_0x17835c[_0x9f48('0x1e')]=qs[_0x9f48('0x1e')](_0x4aab7f[_0x9f48('0x30')][_0x9f48('0x1e')]);}_0x17835c[_0x9f48('0x37')]=qs[_0x9f48('0x38')](_0x4aab7f[_0x9f48('0x30')][_0x9f48('0x38')]);_0x17835c[_0x9f48('0x39')]=qs[_0x9f48('0x31')](_[_0x9f48('0x3a')](_0x4aab7f['query'],_0x546550[_0x9f48('0x31')]),_0x4c3b1a);if(_0x4aab7f[_0x9f48('0x30')]['filter']){_0x17835c[_0x9f48('0x39')]=_['merge'](_0x17835c[_0x9f48('0x39')],{'$or':_[_0x9f48('0x3b')](_0x4c3b1a,function(_0x4c1286){if(_0x4c1286[_0x9f48('0x2d')]!==_0x9f48('0x3c')){var _0x43e2c5={};_0x43e2c5[_0x4c1286[_0x9f48('0x28')]]={'$like':'%'+_0x4aab7f[_0x9f48('0x30')][_0x9f48('0x3d')]+'%'};return _0x43e2c5;}})});}_0x17835c=_[_0x9f48('0x3e')]({},_0x17835c,_0x4aab7f[_0x9f48('0x3f')]);var _0x5c3781={'where':_0x17835c[_0x9f48('0x39')]};return db[_0x9f48('0x2b')][_0x9f48('0x1d')](_0x5c3781)['then'](function(_0x417bfd){_0x3177d3['count']=_0x417bfd;if(_0x4aab7f[_0x9f48('0x30')][_0x9f48('0x40')]){_0x17835c[_0x9f48('0x41')]=[{'all':!![]}];}return db[_0x9f48('0x2b')][_0x9f48('0x42')](_0x17835c);})['then'](function(_0x331fa6){_0x3177d3['rows']=_0x331fa6;return _0x3177d3;})[_0x9f48('0x24')](respondWithFilteredResult(_0x59bc40,_0x17835c))[_0x9f48('0x43')](handleError(_0x59bc40,null));};exports[_0x9f48('0x44')]=function(_0x4bc61e,_0x3174ec){var _0x4a5485={'raw':![],'where':{'id':_0x4bc61e[_0x9f48('0x45')]['id']}},_0x2235c5={};_0x2235c5['model']=_[_0x9f48('0x46')](db[_0x9f48('0x2b')][_0x9f48('0x2c')]);_0x2235c5[_0x9f48('0x30')]=_[_0x9f48('0x46')](_0x4bc61e[_0x9f48('0x30')]);_0x2235c5[_0x9f48('0x31')]=_[_0x9f48('0x32')](_0x2235c5[_0x9f48('0x2f')],_0x2235c5[_0x9f48('0x30')]);_0x4a5485[_0x9f48('0x34')]=_['intersection'](_0x2235c5[_0x9f48('0x2f')],qs['fields'](_0x4bc61e[_0x9f48('0x30')][_0x9f48('0x33')]));_0x4a5485[_0x9f48('0x34')]=_0x4a5485['attributes'][_0x9f48('0x35')]?_0x4a5485[_0x9f48('0x34')]:_0x2235c5[_0x9f48('0x2f')];if(_0x4bc61e[_0x9f48('0x30')][_0x9f48('0x40')]){_0x4a5485['include']=[{'all':!![]}];}_0x4a5485=_['merge']({},_0x4a5485,_0x4bc61e[_0x9f48('0x3f')]);return db['ZohoAccount']['find'](_0x4a5485)[_0x9f48('0x24')](handleEntityNotFound(_0x3174ec,null))[_0x9f48('0x24')](respondWithResult(_0x3174ec,null))[_0x9f48('0x43')](handleError(_0x3174ec,null));};exports['create']=function(_0x4ad285,_0x3c8530){return db['ZohoAccount'][_0x9f48('0x47')](_0x4ad285['body'],{})[_0x9f48('0x24')](respondWithResult(_0x3c8530,0xc9))[_0x9f48('0x43')](handleError(_0x3c8530,null));};exports[_0x9f48('0x23')]=function(_0x2986fe,_0x5e3bc9){if(_0x2986fe[_0x9f48('0x48')]['id']){delete _0x2986fe[_0x9f48('0x48')]['id'];}return db[_0x9f48('0x2b')][_0x9f48('0x49')]({'where':{'id':_0x2986fe[_0x9f48('0x45')]['id']}})[_0x9f48('0x24')](handleEntityNotFound(_0x5e3bc9,null))['then'](saveUpdates(_0x2986fe[_0x9f48('0x48')],null))['then'](respondWithResult(_0x5e3bc9,null))[_0x9f48('0x43')](handleError(_0x5e3bc9,null));};exports[_0x9f48('0x25')]=function(_0x803956,_0x1987b1){return db[_0x9f48('0x2b')][_0x9f48('0x49')]({'where':{'id':_0x803956[_0x9f48('0x45')]['id']}})[_0x9f48('0x24')](handleEntityNotFound(_0x1987b1,null))[_0x9f48('0x24')](removeEntity(_0x1987b1,null))['catch'](handleError(_0x1987b1,null));};exports['getConfigurations']=function(_0x219432,_0x5e78ed,_0x31bb9f){var _0x343aa1={};var _0x3970d9={};var _0x5bde20;var _0x346c39;return db[_0x9f48('0x2b')][_0x9f48('0x4a')]({'where':{'id':_0x219432[_0x9f48('0x45')]['id']}})[_0x9f48('0x24')](handleEntityNotFound(_0x5e78ed,null))[_0x9f48('0x24')](function(_0x30df1a){if(_0x30df1a){_0x5bde20=_0x30df1a;_0x3970d9[_0x9f48('0x2f')]=_['keys'](db['ZohoConfiguration'][_0x9f48('0x2c')]);_0x3970d9[_0x9f48('0x30')]=_['keys'](_0x219432['query']);_0x3970d9['filters']=_[_0x9f48('0x32')](_0x3970d9[_0x9f48('0x2f')],_0x3970d9[_0x9f48('0x30')]);_0x343aa1[_0x9f48('0x34')]=_[_0x9f48('0x32')](_0x3970d9['model'],qs[_0x9f48('0x33')](_0x219432[_0x9f48('0x30')][_0x9f48('0x33')]));_0x343aa1['attributes']=_0x343aa1[_0x9f48('0x34')]['length']?_0x343aa1['attributes']:_0x3970d9['model'];_0x343aa1[_0x9f48('0x37')]=qs['sort'](_0x219432['query']['sort']);_0x343aa1[_0x9f48('0x39')]=qs['filters'](_[_0x9f48('0x3a')](_0x219432[_0x9f48('0x30')],_0x3970d9[_0x9f48('0x31')]));if(_0x219432['query']['filter']){_0x343aa1[_0x9f48('0x39')]=_['merge'](_0x343aa1[_0x9f48('0x39')],{'$or':_[_0x9f48('0x3b')](_0x343aa1[_0x9f48('0x34')],function(_0x14ea34){var _0x22cf3e={};_0x22cf3e[_0x14ea34]={'$like':'%'+_0x219432[_0x9f48('0x30')][_0x9f48('0x3d')]+'%'};return _0x22cf3e;})});}_0x343aa1=_[_0x9f48('0x3e')]({},_0x343aa1,_0x219432[_0x9f48('0x3f')]);return _0x5bde20[_0x9f48('0x4b')](_0x343aa1);}})[_0x9f48('0x24')](function(_0x4463f7){if(_0x4463f7){_0x346c39=_0x4463f7['length'];if(!_0x219432[_0x9f48('0x30')][_0x9f48('0x4c')]('nolimit')){_0x343aa1['limit']=qs['limit'](_0x219432[_0x9f48('0x30')][_0x9f48('0x1c')]);_0x343aa1['offset']=qs[_0x9f48('0x1e')](_0x219432[_0x9f48('0x30')][_0x9f48('0x1e')]);}return _0x5bde20['getConfigurations'](_0x343aa1);}})[_0x9f48('0x24')](function(_0x14c6af){if(_0x14c6af){return _0x14c6af?{'count':_0x346c39,'rows':_0x14c6af}:null;}})[_0x9f48('0x24')](respondWithResult(_0x5e78ed,null))[_0x9f48('0x43')](handleError(_0x5e78ed,null));};exports[_0x9f48('0x4d')]=function(_0x4ac74c,_0x253dc8,_0xca271e){if(_0x4ac74c[_0x9f48('0x48')]['id']){delete _0x4ac74c[_0x9f48('0x48')]['id'];}return db['ZohoAccount'][_0x9f48('0x4a')]({'where':{'id':_0x4ac74c['params']['id']}})[_0x9f48('0x24')](handleEntityNotFound(_0x253dc8,null))[_0x9f48('0x24')](function(_0x4ff2f1){if(_0x4ff2f1){_0x4ac74c[_0x9f48('0x48')][_0x9f48('0x4e')]=_0x4ff2f1['id'];_0x4ac74c[_0x9f48('0x48')][_0x9f48('0x4f')]=integrations[_0x9f48('0x50')](_0x4ac74c['body']['channel'],_0x4ac74c[_0x9f48('0x48')][_0x9f48('0x2d')]);_0x4ac74c['body'][_0x9f48('0x51')]=integrations['getDescriptions'](_0x4ac74c[_0x9f48('0x48')][_0x9f48('0x52')],_0x4ac74c[_0x9f48('0x48')][_0x9f48('0x2d')]);return db[_0x9f48('0x53')]['create'](_0x4ac74c['body'],{'include':[{'model':db['ZohoField'],'as':_0x9f48('0x4f')},{'model':db[_0x9f48('0x54')],'as':_0x9f48('0x51')}]});}return null;})['then'](respondWithResult(_0x253dc8,null))['catch'](handleError(_0x253dc8,null));};function getAccessToken(_0x3af11b){return new Promise(function(_0x251bf2,_0x2f3576){var _0x3c0646;switch(_0x3af11b[_0x9f48('0x55')]){case'US':_0x3c0646=_0x9f48('0x56');break;case'AU':_0x3c0646=_0x9f48('0x57');break;case'EU':_0x3c0646=_0x9f48('0x58');break;case'IN':_0x3c0646=_0x9f48('0x59');break;case'CN':_0x3c0646=_0x9f48('0x5a');break;default:_0x3c0646=_0x9f48('0x58');break;}var _0x5eeb43={'method':_0x9f48('0x5b'),'uri':_0x3c0646+_0x9f48('0x5c'),'qs':{'refresh_token':_0x3af11b['refreshToken'],'client_id':_0x3af11b[_0x9f48('0x5d')],'client_secret':_0x3af11b[_0x9f48('0x5e')],'grant_type':_0x9f48('0x5f')},'json':!![]};return rp(_0x5eeb43)[_0x9f48('0x24')](function(_0x128a19){if(_0x128a19[_0x9f48('0x60')]){_0x251bf2(_0x128a19[_0x9f48('0x60')]);}else{_0x2f3576(_0x9f48('0x61'));}})[_0x9f48('0x43')](function(_0x22b9a8){_0x2f3576(_0x22b9a8);});});}exports[_0x9f48('0x62')]=function(_0x376994,_0x3e1c8e,_0x4fb07b){var _0x20bf74,_0x4f291e,_0x290e46,_0x184dda,_0xe3f280;return db['ZohoAccount'][_0x9f48('0x4a')]({'where':{'id':_0x376994[_0x9f48('0x45')]['id']},'attributes':['id',_0x9f48('0x63'),_0x9f48('0x55'),'clientId','clientSecret','serverUrl',_0x9f48('0x64'),'refreshToken']})[_0x9f48('0x24')](handleEntityNotFound(_0x3e1c8e,null))[_0x9f48('0x24')](function(_0x430bab){_0xe3f280=_0x430bab;_0x20bf74=_0xe3f280[_0x9f48('0x63')];_0x4f291e=_0x20bf74===_0x9f48('0x65')?'eu':_0x9f48('0x66');_0x290e46=_0xe3f280['serverUrl'];var _0x5d886e=_0x290e46[_0x9f48('0x67')](-0x1);if(_0x5d886e==='/'||_0x5d886e==='\x5c'||_0x5d886e===':'){_0x290e46=_0x290e46[_0x9f48('0x68')](0x0,_0x290e46[_0x9f48('0x69')](_0x5d886e));}if(!_0xe3f280[_0x9f48('0x6a')]){throw new Error(_0x9f48('0x6b'));}return getAccessToken(_0xe3f280);})[_0x9f48('0x24')](function(_0x23dd1){if(_0x23dd1){return rp({'method':_0x9f48('0x6c'),'uri':util['format'](_0x9f48('0x6d'),_0x4f291e),'qs':{'module':_0x9f48('0x6e')},'headers':{'Authorization':_0x9f48('0x6f')+_0x23dd1},'json':!![]});}})[_0x9f48('0x24')](function(_0x38e108){if(_0x38e108){if(_0x38e108['response']&&_0x38e108['response'][_0x9f48('0x26')]){throw new Error(_0x38e108['response'][_0x9f48('0x26')][_0x9f48('0x70')]);}var _0x10c204=[];var _0xea15e7=[];var _0x2f89ae=[_0x9f48('0x71'),_0x9f48('0x72'),'Description',_0x9f48('0x73'),_0x9f48('0x74'),_0x9f48('0x75'),_0x9f48('0x76'),_0x9f48('0x77')];_0xea15e7=_[_0x9f48('0x78')](_0x38e108[_0x9f48('0x33')],function(_0x5ee727){return _0x2f89ae[_0x9f48('0x79')](_0x5ee727[_0x9f48('0x7a')]);});for(var _0x4d5629=0x0;_0x4d5629<_0xea15e7[_0x9f48('0x35')];_0x4d5629++){if(_0xea15e7[_0x4d5629][_0x9f48('0x7b')]===![]){_0x10c204[_0x9f48('0x7c')]({'id':_0xea15e7[_0x4d5629]['id'],'name':_0xea15e7[_0x4d5629]['display_label'],'custom':_0xea15e7[_0x4d5629][_0x9f48('0x7d')],'options':_0xea15e7[_0x4d5629][_0x9f48('0x7e')]===_0x9f48('0x7f')&&_0xea15e7[_0x4d5629]['pick_list_values'][_0x9f48('0x35')]>-0x1?_[_0x9f48('0x3b')](_0xea15e7[_0x4d5629][_0x9f48('0x80')],function(_0x212951){return{'name':_0x212951,'value':_0x212951};}):[]});}}return{'count':_0x10c204[_0x9f48('0x35')],'rows':_0x10c204};}else{return{'count':0x0,'rows':[]};}})[_0x9f48('0x24')](respondWithResult(_0x3e1c8e,null))[_0x9f48('0x43')](function(_0x1bafd4){var _0x127f1=_0x376994[_0x9f48('0x30')][_0x9f48('0x81')]?0x1f4:_0x1bafd4['statusCode']||0x1f4;logger[_0x9f48('0x26')](_0x9f48('0x82'),_0x9f48('0x62'),_0x127f1,JSON[_0x9f48('0x83')](_0x1bafd4));delete _0x1bafd4[_0x9f48('0x28')];if(_0x127f1===0x191){_0x127f1=0x190;}_0x3e1c8e[_0x9f48('0x1a')](_0x127f1)[_0x9f48('0x29')](_0x376994['query'][_0x9f48('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x1bafd4[_0x9f48('0x84')]}:_0x1bafd4);});};
\ No newline at end of file
index cb9e0e4..12445c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ced=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','code','slice','lastIndexOf','zone','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','refreshToken','refresh_token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','host','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','parse','info','error','catch','lodash'];(function(_0x928d48,_0x16c75a){var _0x4f63d2=function(_0x3105e5){while(--_0x3105e5){_0x928d48['push'](_0x928d48['shift']());}};_0x4f63d2(++_0x16c75a);}(_0x6ced,0x1e3));var _0xd6ce=function(_0xc6f17f,_0x13f305){_0xc6f17f=_0xc6f17f-0x0;var _0x2dcc4d=_0x6ced[_0xc6f17f];return _0x2dcc4d;};'use strict';var _=require(_0xd6ce('0x0'));var util=require(_0xd6ce('0x1'));var logger=require(_0xd6ce('0x2'))('api');var moment=require(_0xd6ce('0x3'));var BPromise=require(_0xd6ce('0x4'));var rp=require(_0xd6ce('0x5'));var fs=require('fs');var path=require(_0xd6ce('0x6'));var rimraf=require('rimraf');var config=require(_0xd6ce('0x7'));var attributes=require(_0xd6ce('0x8'));var integrations=require(_0xd6ce('0x9'));module[_0xd6ce('0xa')]=function(_0x427ef7,_0x2f3656){return _0x427ef7[_0xd6ce('0xb')](_0xd6ce('0xc'),attributes,{'tableName':_0xd6ce('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2355a4,_0x2ee2ac,_0xa28ac8){if(_0x2355a4[_0xd6ce('0xe')]('zone')||_0x2355a4[_0xd6ce('0xe')](_0xd6ce('0xf'))||_0x2355a4[_0xd6ce('0xe')](_0xd6ce('0x10'))||_0x2355a4['changed']('clientSecret')||_0x2355a4[_0xd6ce('0xe')](_0xd6ce('0x11'))||_0x2355a4[_0xd6ce('0xe')]('host')){var _0x54c493,_0x2026e8;_0x54c493=_0x2355a4['serverUrl'];var _0x4e7b4c=_0x54c493[_0xd6ce('0x12')](-0x1);if(_0x4e7b4c==='/'||_0x4e7b4c==='\x5c'||_0x4e7b4c===':'){_0x54c493=_0x54c493['substring'](0x0,_0x54c493[_0xd6ce('0x13')](_0x4e7b4c));}switch(_0x2355a4[_0xd6ce('0x14')]){case'US':_0x2026e8='https://accounts.zoho.com';break;case'AU':_0x2026e8='https://accounts.zoho.com.au';break;case'IN':_0x2026e8=_0xd6ce('0x15');break;case'CN':_0x2026e8='https://accounts.zoho.com.cn';break;default:_0x2026e8=_0xd6ce('0x16');break;}var _0x28f682={'method':_0xd6ce('0x17'),'uri':_0x2026e8+_0xd6ce('0x18'),'form':{'grant_type':_0xd6ce('0x19'),'client_id':_0x2355a4[_0xd6ce('0x10')],'client_secret':_0x2355a4[_0xd6ce('0x1a')],'redirect_uri':_0x2355a4[_0xd6ce('0xf')],'code':_0x2355a4['code']},'headers':{'Content-Type':_0xd6ce('0x1b')}};return rp(_0x28f682)[_0xd6ce('0x1c')](function(_0x2bcc95){var _0x1d5067=JSON['parse'](_0x2bcc95);if(_0x1d5067['refresh_token']){_0x2355a4[_0xd6ce('0x1d')]=_0x1d5067[_0xd6ce('0x1e')];logger['info'](util['format'](_0xd6ce('0x1f'),_0x2355a4[_0xd6ce('0x20')],_0x2355a4['id']));}else{logger['error'](util[_0xd6ce('0x21')](_0xd6ce('0x22'),_0x2355a4[_0xd6ce('0x20')],_0x2355a4['id']),util['inspect'](_0x1d5067,{'showHidden':![],'depth':null}));}return _0xa28ac8(null,_0x2ee2ac);})['catch'](function(_0x4c9433){logger['error'](util[_0xd6ce('0x21')](_0xd6ce('0x22'),_0x2355a4[_0xd6ce('0x20')],_0x2355a4['id']),util[_0xd6ce('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xa28ac8(_0x4c9433);});}else{return _0xa28ac8(null,_0x2ee2ac);}},'beforeUpdate':function(_0x1aa54b,_0x40cc73,_0x2a4d52){if(_0x1aa54b[_0xd6ce('0xe')](_0xd6ce('0x14'))||_0x1aa54b[_0xd6ce('0xe')]('serverUrl')||_0x1aa54b[_0xd6ce('0xe')](_0xd6ce('0x10'))||_0x1aa54b[_0xd6ce('0xe')](_0xd6ce('0x1a'))||_0x1aa54b[_0xd6ce('0xe')]('code')||_0x1aa54b[_0xd6ce('0xe')](_0xd6ce('0x24'))){var _0x145d69,_0x1e215d;_0x145d69=_0x1aa54b[_0xd6ce('0xf')];var _0x2bcae1=_0x145d69[_0xd6ce('0x12')](-0x1);if(_0x2bcae1==='/'||_0x2bcae1==='\x5c'||_0x2bcae1===':'){_0x145d69=_0x145d69[_0xd6ce('0x25')](0x0,_0x145d69[_0xd6ce('0x13')](_0x2bcae1));}switch(_0x1aa54b[_0xd6ce('0x14')]){case'US':_0x1e215d=_0xd6ce('0x26');break;case'AU':_0x1e215d=_0xd6ce('0x27');break;case'IN':_0x1e215d=_0xd6ce('0x15');break;case'CN':_0x1e215d='https://accounts.zoho.com.cn';break;default:_0x1e215d=_0xd6ce('0x16');break;}var _0x28d4de={'method':_0xd6ce('0x17'),'uri':_0x1e215d+_0xd6ce('0x18'),'form':{'grant_type':_0xd6ce('0x19'),'client_id':_0x1aa54b[_0xd6ce('0x10')],'client_secret':_0x1aa54b[_0xd6ce('0x1a')],'redirect_uri':_0x1aa54b[_0xd6ce('0xf')],'code':_0x1aa54b[_0xd6ce('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x28d4de)[_0xd6ce('0x1c')](function(_0x15e2f9){var _0x250718=JSON[_0xd6ce('0x28')](_0x15e2f9);if(_0x250718[_0xd6ce('0x1e')]){_0x1aa54b['refreshToken']=_0x250718['refresh_token'];logger[_0xd6ce('0x29')](util[_0xd6ce('0x21')](_0xd6ce('0x1f'),_0x1aa54b['name'],_0x1aa54b['id']));}else{logger[_0xd6ce('0x2a')](util[_0xd6ce('0x21')](_0xd6ce('0x22'),_0x1aa54b[_0xd6ce('0x20')],_0x1aa54b['id']),util[_0xd6ce('0x23')](_0x250718,{'showHidden':![],'depth':null}));}return _0x2a4d52(null,_0x40cc73);})[_0xd6ce('0x2b')](function(_0xe0a19){logger[_0xd6ce('0x2a')](util['format'](_0xd6ce('0x22'),_0x1aa54b[_0xd6ce('0x20')],_0x1aa54b['id']),util[_0xd6ce('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x2a4d52(_0xe0a19);});}else{return _0x2a4d52(null,_0x40cc73);}}}});};
\ No newline at end of file
+var _0x5554=['request-promise','path','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','clientSecret','code','host','serverUrl','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','application/x-www-form-urlencoded','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','format','slice','substring','https://accounts.zoho.eu','authorization_code','clientId','then','refreshToken','util','../../config/logger','bluebird'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x5554,0x72));var _0x4555=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x5554[_0x5037ab];return _0x512adb;};'use strict';var _=require('lodash');var util=require(_0x4555('0x0'));var logger=require(_0x4555('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4555('0x2'));var rp=require(_0x4555('0x3'));var fs=require('fs');var path=require(_0x4555('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x4555('0x5'));module['exports']=function(_0x432874,_0x534cce){return _0x432874[_0x4555('0x6')](_0x4555('0x7'),attributes,{'tableName':_0x4555('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xadcb29,_0x6698cb,_0x191d95){if(_0xadcb29[_0x4555('0x9')]('zone')||_0xadcb29[_0x4555('0x9')]('serverUrl')||_0xadcb29[_0x4555('0x9')]('clientId')||_0xadcb29[_0x4555('0x9')](_0x4555('0xa'))||_0xadcb29[_0x4555('0x9')](_0x4555('0xb'))||_0xadcb29[_0x4555('0x9')](_0x4555('0xc'))){var _0x51f34c,_0x52126e;_0x51f34c=_0xadcb29[_0x4555('0xd')];var _0x457dd3=_0x51f34c['slice'](-0x1);if(_0x457dd3==='/'||_0x457dd3==='\x5c'||_0x457dd3===':'){_0x51f34c=_0x51f34c['substring'](0x0,_0x51f34c[_0x4555('0xe')](_0x457dd3));}switch(_0xadcb29[_0x4555('0xf')]){case'US':_0x52126e=_0x4555('0x10');break;case'AU':_0x52126e='https://accounts.zoho.com.au';break;case'IN':_0x52126e=_0x4555('0x11');break;case'CN':_0x52126e=_0x4555('0x12');break;default:_0x52126e='https://accounts.zoho.eu';break;}var _0x16d363={'method':_0x4555('0x13'),'uri':_0x52126e+_0x4555('0x14'),'form':{'grant_type':'authorization_code','client_id':_0xadcb29['clientId'],'client_secret':_0xadcb29['clientSecret'],'redirect_uri':_0xadcb29[_0x4555('0xd')],'code':_0xadcb29[_0x4555('0xb')]},'headers':{'Content-Type':_0x4555('0x15')}};return rp(_0x16d363)['then'](function(_0x4db1dc){var _0x27b19a=JSON[_0x4555('0x16')](_0x4db1dc);if(_0x27b19a[_0x4555('0x17')]){_0xadcb29['refreshToken']=_0x27b19a['refresh_token'];logger[_0x4555('0x18')](util['format'](_0x4555('0x19'),_0xadcb29[_0x4555('0x1a')],_0xadcb29['id']));}else{logger['error'](util['format'](_0x4555('0x1b'),_0xadcb29[_0x4555('0x1a')],_0xadcb29['id']),util[_0x4555('0x1c')](_0x27b19a,{'showHidden':![],'depth':null}));}return _0x191d95(null,_0x6698cb);})[_0x4555('0x1d')](function(_0x2c6f8d){logger[_0x4555('0x1e')](util[_0x4555('0x1f')](_0x4555('0x1b'),_0xadcb29[_0x4555('0x1a')],_0xadcb29['id']),util[_0x4555('0x1c')](parsedResult,{'showHidden':![],'depth':null}));return _0x191d95(_0x2c6f8d);});}else{return _0x191d95(null,_0x6698cb);}},'beforeUpdate':function(_0xe53d54,_0x348e2e,_0x133bb1){if(_0xe53d54[_0x4555('0x9')](_0x4555('0xf'))||_0xe53d54[_0x4555('0x9')](_0x4555('0xd'))||_0xe53d54[_0x4555('0x9')]('clientId')||_0xe53d54[_0x4555('0x9')](_0x4555('0xa'))||_0xe53d54[_0x4555('0x9')](_0x4555('0xb'))||_0xe53d54[_0x4555('0x9')](_0x4555('0xc'))){var _0x523bbb,_0x41ddfa;_0x523bbb=_0xe53d54[_0x4555('0xd')];var _0x9f342b=_0x523bbb[_0x4555('0x20')](-0x1);if(_0x9f342b==='/'||_0x9f342b==='\x5c'||_0x9f342b===':'){_0x523bbb=_0x523bbb[_0x4555('0x21')](0x0,_0x523bbb[_0x4555('0xe')](_0x9f342b));}switch(_0xe53d54[_0x4555('0xf')]){case'US':_0x41ddfa=_0x4555('0x10');break;case'AU':_0x41ddfa='https://accounts.zoho.com.au';break;case'IN':_0x41ddfa=_0x4555('0x11');break;case'CN':_0x41ddfa=_0x4555('0x12');break;default:_0x41ddfa=_0x4555('0x22');break;}var _0x5ab890={'method':'POST','uri':_0x41ddfa+_0x4555('0x14'),'form':{'grant_type':_0x4555('0x23'),'client_id':_0xe53d54[_0x4555('0x24')],'client_secret':_0xe53d54[_0x4555('0xa')],'redirect_uri':_0xe53d54[_0x4555('0xd')],'code':_0xe53d54['code']},'headers':{'Content-Type':_0x4555('0x15')}};return rp(_0x5ab890)[_0x4555('0x25')](function(_0x3ea942){var _0x26021c=JSON['parse'](_0x3ea942);if(_0x26021c['refresh_token']){_0xe53d54[_0x4555('0x26')]=_0x26021c['refresh_token'];logger[_0x4555('0x18')](util[_0x4555('0x1f')](_0x4555('0x19'),_0xe53d54[_0x4555('0x1a')],_0xe53d54['id']));}else{logger[_0x4555('0x1e')](util['format'](_0x4555('0x1b'),_0xe53d54[_0x4555('0x1a')],_0xe53d54['id']),util[_0x4555('0x1c')](_0x26021c,{'showHidden':![],'depth':null}));}return _0x133bb1(null,_0x348e2e);})['catch'](function(_0x15e720){logger[_0x4555('0x1e')](util[_0x4555('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xe53d54[_0x4555('0x1a')],_0xe53d54['id']),util[_0x4555('0x1c')](parsedResult,{'showHidden':![],'depth':null}));return _0x133bb1(_0x15e720);});}else{return _0x133bb1(null,_0x348e2e);}}}});};
\ No newline at end of file
index 8f4d1fc..f7e8730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaebd=['GetZohoAccount','findAll','options','raw','attributes','include','map','model','debug','ShowZohoAccount','ZohoAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ZohoAccount,\x20%s,\x20%s','catch'];(function(_0x2155f3,_0x199170){var _0x582835=function(_0x4c1eeb){while(--_0x4c1eeb){_0x2155f3['push'](_0x2155f3['shift']());}};_0x582835(++_0x199170);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x163513,_0x500220){_0x163513=_0x163513-0x0;var _0x1439c7=_0xaebd[_0x163513];return _0x1439c7;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea090,_0x3f7ba1,_0x52c717){return new BPromise(function(_0x550bd9,_0x1b9d37){return client[_0xdaeb('0xb')](_0x3ea090,_0x52c717)[_0xdaeb('0xc')](function(_0x5e0ae9){logger[_0xdaeb('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x3f7ba1,_0xdaeb('0xe'));logger['debug'](_0xdaeb('0xf'),_0x3f7ba1,'request\x20sent',JSON[_0xdaeb('0x10')](_0x5e0ae9));if(_0x5e0ae9[_0xdaeb('0x11')]){if(_0x5e0ae9['error']['code']===0x1f4){logger[_0xdaeb('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);return _0x1b9d37(_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);}logger[_0xdaeb('0x11')](_0xdaeb('0x13'),_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')]['message']);return _0x550bd9(_0x5e0ae9['error'][_0xdaeb('0x12')]);}else{logger[_0xdaeb('0xd')](_0xdaeb('0x13'),_0x3f7ba1,_0xdaeb('0xe'));_0x550bd9(_0x5e0ae9['result']['message']);}})[_0xdaeb('0x14')](function(_0x4dd803){logger['error'](_0xdaeb('0x13'),_0x3f7ba1,_0x4dd803);_0x1b9d37(_0x4dd803);});});}exports[_0xdaeb('0x15')]=function(_0x1b5243){var _0x1fe84e=this;return new Promise(function(_0x2d8f11,_0x36f9ac){return db['ZohoAccount'][_0xdaeb('0x16')]({'raw':_0x1b5243['options']?_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x18')]===undefined?!![]:![]:!![],'where':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243['options']['where']||null:null,'attributes':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x19')]||null:null,'limit':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243[_0xdaeb('0x17')]['limit']||null:null,'include':_0x1b5243['options']?_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x1a')]?_[_0xdaeb('0x1b')](_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x1a')],function(_0x55c825){return{'model':db[_0x55c825[_0xdaeb('0x1c')]],'as':_0x55c825['as'],'attributes':_0x55c825['attributes'],'include':_0x55c825[_0xdaeb('0x1a')]?_[_0xdaeb('0x1b')](_0x55c825[_0xdaeb('0x1a')],function(_0x3b0770){return{'model':db[_0x3b0770[_0xdaeb('0x1c')]],'as':_0x3b0770['as'],'attributes':_0x3b0770['attributes'],'include':_0x3b0770[_0xdaeb('0x1a')]?_[_0xdaeb('0x1b')](_0x3b0770[_0xdaeb('0x1a')],function(_0x4eb719){return{'model':db[_0x4eb719['model']],'as':_0x4eb719['as'],'attributes':_0x4eb719[_0xdaeb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5045f8){logger[_0xdaeb('0xd')](_0xdaeb('0x15'),_0x1b5243);logger[_0xdaeb('0x1d')]('GetZohoAccount',_0x1b5243,JSON['stringify'](_0x5045f8));_0x2d8f11(_0x5045f8);})[_0xdaeb('0x14')](function(_0x440022){logger[_0xdaeb('0x11')]('GetZohoAccount',_0x440022[_0xdaeb('0x12')],_0x1b5243);_0x36f9ac(_0x1fe84e['error'](0x1f4,_0x440022['message']));});});};exports[_0xdaeb('0x1e')]=function(_0x21f6cf){var _0x2fb019=this;return new Promise(function(_0x28c15c,_0x3276c2){return db[_0xdaeb('0x1f')][_0xdaeb('0x20')]({'raw':_0x21f6cf['options']?_0x21f6cf[_0xdaeb('0x17')][_0xdaeb('0x18')]===undefined?!![]:![]:!![],'where':_0x21f6cf[_0xdaeb('0x17')]?_0x21f6cf[_0xdaeb('0x17')][_0xdaeb('0x21')]||null:null,'attributes':_0x21f6cf['options']?_0x21f6cf[_0xdaeb('0x17')][_0xdaeb('0x19')]||null:null,'include':_0x21f6cf['options']?_0x21f6cf[_0xdaeb('0x17')][_0xdaeb('0x1a')]?_[_0xdaeb('0x1b')](_0x21f6cf[_0xdaeb('0x17')][_0xdaeb('0x1a')],function(_0x1628b8){return{'model':db[_0x1628b8[_0xdaeb('0x1c')]],'as':_0x1628b8['as'],'attributes':_0x1628b8[_0xdaeb('0x19')],'include':_0x1628b8[_0xdaeb('0x1a')]?_[_0xdaeb('0x1b')](_0x1628b8['include'],function(_0x53b6c4){return{'model':db[_0x53b6c4[_0xdaeb('0x1c')]],'as':_0x53b6c4['as'],'attributes':_0x53b6c4['attributes'],'include':_0x53b6c4[_0xdaeb('0x1a')]?_[_0xdaeb('0x1b')](_0x53b6c4[_0xdaeb('0x1a')],function(_0x331624){return{'model':db[_0x331624[_0xdaeb('0x1c')]],'as':_0x331624['as'],'attributes':_0x331624[_0xdaeb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f4dcb){logger[_0xdaeb('0xd')](_0xdaeb('0x1e'),_0x21f6cf);logger['debug'](_0xdaeb('0x1e'),_0x21f6cf,JSON[_0xdaeb('0x10')](_0x1f4dcb));_0x28c15c(_0x1f4dcb);})[_0xdaeb('0x14')](function(_0x104c90){logger[_0xdaeb('0x11')](_0xdaeb('0x1e'),_0x104c90[_0xdaeb('0x12')],_0x21f6cf);_0x3276c2(_0x2fb019['error'](0x1f4,_0x104c90[_0xdaeb('0x12')]));});});};
\ No newline at end of file
+var _0x0137=['model','ShowZohoAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','attributes','limit','include','map'];(function(_0x1595e2,_0x5ba2c2){var _0x28898a=function(_0x617368){while(--_0x617368){_0x1595e2['push'](_0x1595e2['shift']());}};_0x28898a(++_0x5ba2c2);}(_0x0137,0x1d8));var _0x7013=function(_0x1cd037,_0x4d368f){_0x1cd037=_0x1cd037-0x0;var _0x51f3b8=_0x0137[_0x1cd037];return _0x51f3b8;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var moment=require(_0x7013('0x2'));var BPromise=require(_0x7013('0x3'));var rs=require(_0x7013('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7013('0x5'))['db'];var utils=require(_0x7013('0x6'));var logger=require(_0x7013('0x7'))(_0x7013('0x8'));var config=require(_0x7013('0x9'));var jayson=require(_0x7013('0xa'));var client=jayson['client'][_0x7013('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346a4d,_0x4e2460,_0x16c0c8){return new BPromise(function(_0x16dae3,_0x1b748c){return client['request'](_0x346a4d,_0x16c0c8)[_0x7013('0xc')](function(_0x551b8a){logger[_0x7013('0xd')](_0x7013('0xe'),_0x4e2460,'request\x20sent');logger[_0x7013('0xf')](_0x7013('0x10'),_0x4e2460,_0x7013('0x11'),JSON[_0x7013('0x12')](_0x551b8a));if(_0x551b8a[_0x7013('0x13')]){if(_0x551b8a[_0x7013('0x13')]['code']===0x1f4){logger[_0x7013('0x13')](_0x7013('0xe'),_0x4e2460,_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);return _0x1b748c(_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);}logger[_0x7013('0x13')](_0x7013('0xe'),_0x4e2460,_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);return _0x16dae3(_0x551b8a[_0x7013('0x13')]['message']);}else{logger['info'](_0x7013('0xe'),_0x4e2460,_0x7013('0x11'));_0x16dae3(_0x551b8a[_0x7013('0x15')][_0x7013('0x14')]);}})[_0x7013('0x16')](function(_0x48614e){logger['error'](_0x7013('0xe'),_0x4e2460,_0x48614e);_0x1b748c(_0x48614e);});});}exports[_0x7013('0x17')]=function(_0x161a19){var _0x1b68b0=this;return new Promise(function(_0x363cbc,_0x4eee5e){return db[_0x7013('0x18')][_0x7013('0x19')]({'raw':_0x161a19['options']?_0x161a19['options'][_0x7013('0x1a')]===undefined?!![]:![]:!![],'where':_0x161a19[_0x7013('0x1b')]?_0x161a19[_0x7013('0x1b')]['where']||null:null,'attributes':_0x161a19[_0x7013('0x1b')]?_0x161a19['options'][_0x7013('0x1c')]||null:null,'limit':_0x161a19[_0x7013('0x1b')]?_0x161a19[_0x7013('0x1b')][_0x7013('0x1d')]||null:null,'include':_0x161a19[_0x7013('0x1b')]?_0x161a19[_0x7013('0x1b')][_0x7013('0x1e')]?_[_0x7013('0x1f')](_0x161a19[_0x7013('0x1b')][_0x7013('0x1e')],function(_0x2e6e3d){return{'model':db[_0x2e6e3d[_0x7013('0x20')]],'as':_0x2e6e3d['as'],'attributes':_0x2e6e3d[_0x7013('0x1c')],'include':_0x2e6e3d[_0x7013('0x1e')]?_[_0x7013('0x1f')](_0x2e6e3d[_0x7013('0x1e')],function(_0x1c11bf){return{'model':db[_0x1c11bf[_0x7013('0x20')]],'as':_0x1c11bf['as'],'attributes':_0x1c11bf[_0x7013('0x1c')],'include':_0x1c11bf[_0x7013('0x1e')]?_[_0x7013('0x1f')](_0x1c11bf['include'],function(_0x270e78){return{'model':db[_0x270e78[_0x7013('0x20')]],'as':_0x270e78['as'],'attributes':_0x270e78[_0x7013('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15c3eb){logger['info'](_0x7013('0x17'),_0x161a19);logger[_0x7013('0xf')]('GetZohoAccount',_0x161a19,JSON[_0x7013('0x12')](_0x15c3eb));_0x363cbc(_0x15c3eb);})['catch'](function(_0xeb8cd5){logger[_0x7013('0x13')](_0x7013('0x17'),_0xeb8cd5['message'],_0x161a19);_0x4eee5e(_0x1b68b0[_0x7013('0x13')](0x1f4,_0xeb8cd5[_0x7013('0x14')]));});});};exports[_0x7013('0x21')]=function(_0xe8090){var _0x5ef79c=this;return new Promise(function(_0x44ab0b,_0x4764df){return db[_0x7013('0x18')][_0x7013('0x22')]({'raw':_0xe8090['options']?_0xe8090['options'][_0x7013('0x1a')]===undefined?!![]:![]:!![],'where':_0xe8090[_0x7013('0x1b')]?_0xe8090['options'][_0x7013('0x23')]||null:null,'attributes':_0xe8090[_0x7013('0x1b')]?_0xe8090[_0x7013('0x1b')][_0x7013('0x1c')]||null:null,'include':_0xe8090[_0x7013('0x1b')]?_0xe8090[_0x7013('0x1b')]['include']?_['map'](_0xe8090[_0x7013('0x1b')][_0x7013('0x1e')],function(_0x15ed20){return{'model':db[_0x15ed20[_0x7013('0x20')]],'as':_0x15ed20['as'],'attributes':_0x15ed20[_0x7013('0x1c')],'include':_0x15ed20['include']?_[_0x7013('0x1f')](_0x15ed20['include'],function(_0x53e2ff){return{'model':db[_0x53e2ff['model']],'as':_0x53e2ff['as'],'attributes':_0x53e2ff['attributes'],'include':_0x53e2ff[_0x7013('0x1e')]?_['map'](_0x53e2ff[_0x7013('0x1e')],function(_0x56a133){return{'model':db[_0x56a133[_0x7013('0x20')]],'as':_0x56a133['as'],'attributes':_0x56a133[_0x7013('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7013('0xc')](function(_0x4bfa50){logger[_0x7013('0xd')](_0x7013('0x21'),_0xe8090);logger[_0x7013('0xf')](_0x7013('0x21'),_0xe8090,JSON[_0x7013('0x12')](_0x4bfa50));_0x44ab0b(_0x4bfa50);})[_0x7013('0x16')](function(_0x36dc43){logger[_0x7013('0x13')](_0x7013('0x21'),_0x36dc43['message'],_0xe8090);_0x4764df(_0x5ef79c['error'](0x1f4,_0x36dc43[_0x7013('0x14')]));});});};
\ No newline at end of file
index 1658ea6..b65a328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7691=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','index','/:id','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4b4846,_0x36ef2e){var _0x38567d=function(_0x2693c5){while(--_0x2693c5){_0x4b4846['push'](_0x4b4846['shift']());}};_0x38567d(++_0x36ef2e);}(_0x7691,0xbf));var _0x1769=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7691[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1769('0x0'));var util=require('util');var path=require(_0x1769('0x1'));var timeout=require(_0x1769('0x2'));var express=require(_0x1769('0x3'));var router=express[_0x1769('0x4')]();var fs_extra=require(_0x1769('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1769('0x6'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x1769('0x7')]('/',auth['isAuthenticated'](),controller[_0x1769('0x8')]);router[_0x1769('0x7')](_0x1769('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1769('0x7')](_0x1769('0xa'),auth[_0x1769('0xb')](),controller[_0x1769('0xc')]);router[_0x1769('0x7')](_0x1769('0xd'),auth[_0x1769('0xb')](),controller[_0x1769('0xe')]);router[_0x1769('0x7')](_0x1769('0xf'),auth['isAuthenticated'](),controller[_0x1769('0x10')]);router[_0x1769('0x11')]('/',auth[_0x1769('0xb')](),controller[_0x1769('0x12')]);router[_0x1769('0x13')](_0x1769('0x9'),auth[_0x1769('0xb')](),controller[_0x1769('0x14')]);router[_0x1769('0x15')](_0x1769('0x9'),auth[_0x1769('0xb')](),controller[_0x1769('0x16')]);module[_0x1769('0x17')]=router;
\ No newline at end of file
+var _0x0d9a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','destroy','exports','multer','util','path'];(function(_0x3c6cd5,_0x46bbfd){var _0x3b46d8=function(_0x30772e){while(--_0x30772e){_0x3c6cd5['push'](_0x3c6cd5['shift']());}};_0x3b46d8(++_0x46bbfd);}(_0x0d9a,0x1a6));var _0xa0d9=function(_0x4194bc,_0x3c6c5c){_0x4194bc=_0x4194bc-0x0;var _0x4036ee=_0x0d9a[_0x4194bc];return _0x4036ee;};'use strict';var multer=require(_0xa0d9('0x0'));var util=require(_0xa0d9('0x1'));var path=require(_0xa0d9('0x2'));var timeout=require(_0xa0d9('0x3'));var express=require(_0xa0d9('0x4'));var router=express[_0xa0d9('0x5')]();var fs_extra=require(_0xa0d9('0x6'));var auth=require(_0xa0d9('0x7'));var interaction=require(_0xa0d9('0x8'));var config=require(_0xa0d9('0x9'));var controller=require(_0xa0d9('0xa'));router['get']('/',auth[_0xa0d9('0xb')](),controller['index']);router[_0xa0d9('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa0d9('0xc')](_0xa0d9('0xd'),auth['isAuthenticated'](),controller[_0xa0d9('0xe')]);router['get'](_0xa0d9('0xf'),auth['isAuthenticated'](),controller[_0xa0d9('0x10')]);router[_0xa0d9('0xc')](_0xa0d9('0x11'),auth[_0xa0d9('0xb')](),controller[_0xa0d9('0x12')]);router[_0xa0d9('0x13')]('/',auth[_0xa0d9('0xb')](),controller[_0xa0d9('0x14')]);router['put'](_0xa0d9('0x15'),auth['isAuthenticated'](),controller[_0xa0d9('0x16')]);router['delete'](_0xa0d9('0x15'),auth[_0xa0d9('0xb')](),controller[_0xa0d9('0x17')]);module[_0xa0d9('0x18')]=router;
\ No newline at end of file
index 0b9ba65..7f41754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a53=['ENUM','lead','contact','contact_lead','sequelize','STRING'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x1a53,0x10c));var _0x31a5=function(_0x5102af,_0xc9997c){_0x5102af=_0x5102af-0x0;var _0x281d51=_0x1a53[_0x5102af];return _0x281d51;};'use strict';var Sequelize=require(_0x31a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x31a5('0x1')]},'moduleCreate':{'type':Sequelize[_0x31a5('0x2')](_0x31a5('0x3'),_0x31a5('0x4'),'nothing'),'defaultValue':_0x31a5('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x31a5('0x5'),_0x31a5('0x4'),_0x31a5('0x3')),'defaultValue':_0x31a5('0x5')},'description':{'type':Sequelize[_0x31a5('0x1')]}};
\ No newline at end of file
+var _0x8af3=['sequelize','exports','ENUM','lead','contact','nothing','contact_lead','STRING'];(function(_0xc66893,_0x475422){var _0x150fec=function(_0x138596){while(--_0x138596){_0xc66893['push'](_0xc66893['shift']());}};_0x150fec(++_0x475422);}(_0x8af3,0x140));var _0x38af=function(_0x2f316b,_0x31f698){_0x2f316b=_0x2f316b-0x0;var _0x426798=_0x8af3[_0x2f316b];return _0x426798;};'use strict';var Sequelize=require(_0x38af('0x0'));module[_0x38af('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x38af('0x2')](_0x38af('0x3'),_0x38af('0x4'),_0x38af('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0x38af('0x6'),'contact',_0x38af('0x3')),'defaultValue':_0x38af('0x6')},'description':{'type':Sequelize[_0x38af('0x7')]}};
\ No newline at end of file
index 7ba2907..0ce886c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb52c=['zip-dir','request-promise','moment','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','include','catch','show','keys','includeAll','create','body','params','destroy','getFields','findOne','ZohoField','sort','getSubjects','pick','getDescriptions','eml-format'];(function(_0x56ee15,_0x1effd1){var _0x94991f=function(_0x5018fa){while(--_0x5018fa){_0x56ee15['push'](_0x56ee15['shift']());}};_0x94991f(++_0x1effd1);}(_0xb52c,0xef));var _0xcb52=function(_0xdd165f,_0xe26723){_0xdd165f=_0xdd165f-0x0;var _0x5e6bb1=_0xb52c[_0xdd165f];return _0x5e6bb1;};'use strict';var emlformat=require(_0xcb52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb52('0x2'));var moment=require(_0xcb52('0x3'));var BPromise=require(_0xcb52('0x4'));var Mustache=require(_0xcb52('0x5'));var util=require(_0xcb52('0x6'));var path=require(_0xcb52('0x7'));var sox=require(_0xcb52('0x8'));var csv=require(_0xcb52('0x9'));var ejs=require(_0xcb52('0xa'));var fs=require('fs');var fs_extra=require(_0xcb52('0xb'));var _=require(_0xcb52('0xc'));var squel=require(_0xcb52('0xd'));var crypto=require('crypto');var jsforce=require(_0xcb52('0xe'));var deskjs=require(_0xcb52('0xf'));var toCsv=require(_0xcb52('0x9'));var querystring=require(_0xcb52('0x10'));var Papa=require('papaparse');var Redis=require(_0xcb52('0x11'));var authService=require(_0xcb52('0x12'));var qs=require(_0xcb52('0x13'));var as=require(_0xcb52('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb52('0x15'))(_0xcb52('0x16'));var utils=require(_0xcb52('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcb52('0x18'));var db=require(_0xcb52('0x19'))['db'];function respondWithStatusCode(_0x1137c9,_0x2ce8c0){_0x2ce8c0=_0x2ce8c0||0xcc;return function(_0x5a180e){if(_0x5a180e){return _0x1137c9[_0xcb52('0x1a')](_0x2ce8c0);}return _0x1137c9[_0xcb52('0x1b')](_0x2ce8c0)[_0xcb52('0x1c')]();};}function respondWithResult(_0x240725,_0xbbbed2){_0xbbbed2=_0xbbbed2||0xc8;return function(_0xd7a6f){if(_0xd7a6f){return _0x240725['status'](_0xbbbed2)[_0xcb52('0x1d')](_0xd7a6f);}};}function respondWithFilteredResult(_0xd607e8,_0x37ad07){return function(_0x3a540e){if(_0x3a540e){var _0x48802c=typeof _0x37ad07[_0xcb52('0x1e')]===_0xcb52('0x1f')&&typeof _0x37ad07[_0xcb52('0x20')]===_0xcb52('0x1f');var _0x3860bb=_0x3a540e[_0xcb52('0x21')];var _0x21c784=_0x48802c?0x0:_0x37ad07[_0xcb52('0x1e')];var _0x471235=_0x48802c?_0x3a540e[_0xcb52('0x21')]:_0x37ad07['offset']+_0x37ad07[_0xcb52('0x20')];var _0x153734;if(_0x471235>=_0x3860bb){_0x471235=_0x3860bb;_0x153734=0xc8;}else{_0x153734=0xce;}_0xd607e8[_0xcb52('0x1b')](_0x153734);return _0xd607e8['set'](_0xcb52('0x22'),_0x21c784+'-'+_0x471235+'/'+_0x3860bb)['json'](_0x3a540e);}return null;};}function patchUpdates(_0x4b7137){return function(_0x101244){try{jsonpatch[_0xcb52('0x23')](_0x101244,_0x4b7137,!![]);}catch(_0x5c08b2){return BPromise['reject'](_0x5c08b2);}return _0x101244[_0xcb52('0x24')]();};}function saveUpdates(_0xb3de44,_0x1051bf){return function(_0x3b5411){if(_0x3b5411){return _0x3b5411[_0xcb52('0x25')](_0xb3de44)[_0xcb52('0x26')](function(_0x36b84e){return _0x36b84e;});}return null;};}function removeEntity(_0x122dcb,_0x545901){return function(_0x19b3d4){if(_0x19b3d4){return _0x19b3d4['destroy']()[_0xcb52('0x26')](function(){_0x122dcb[_0xcb52('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x547401,_0x1ea1f4){return function(_0x2831f7){if(!_0x2831f7){_0x547401[_0xcb52('0x1a')](0x194);}return _0x2831f7;};}function handleError(_0x343653,_0x12d2bb){_0x12d2bb=_0x12d2bb||0x1f4;return function(_0x5a25d3){logger[_0xcb52('0x27')](_0x5a25d3[_0xcb52('0x28')]);if(_0x5a25d3[_0xcb52('0x29')]){delete _0x5a25d3[_0xcb52('0x29')];}_0x343653[_0xcb52('0x1b')](_0x12d2bb)[_0xcb52('0x2a')](_0x5a25d3);};}exports[_0xcb52('0x2b')]=function(_0x119b25,_0x10360f){var _0x1e3b9a={},_0x12db26={},_0x37403a={'count':0x0,'rows':[]};var _0x4c3104=_[_0xcb52('0x2c')](db[_0xcb52('0x2d')][_0xcb52('0x2e')],function(_0x5137f5){return{'name':_0x5137f5['fieldName'],'type':_0x5137f5[_0xcb52('0x2f')][_0xcb52('0x30')]};});_0x12db26[_0xcb52('0x31')]=_[_0xcb52('0x2c')](_0x4c3104,_0xcb52('0x29'));_0x12db26[_0xcb52('0x32')]=_['keys'](_0x119b25[_0xcb52('0x32')]);_0x12db26[_0xcb52('0x33')]=_[_0xcb52('0x34')](_0x12db26[_0xcb52('0x31')],_0x12db26[_0xcb52('0x32')]);_0x1e3b9a[_0xcb52('0x35')]=_[_0xcb52('0x34')](_0x12db26[_0xcb52('0x31')],qs[_0xcb52('0x36')](_0x119b25[_0xcb52('0x32')][_0xcb52('0x36')]));_0x1e3b9a[_0xcb52('0x35')]=_0x1e3b9a[_0xcb52('0x35')][_0xcb52('0x37')]?_0x1e3b9a[_0xcb52('0x35')]:_0x12db26[_0xcb52('0x31')];if(!_0x119b25[_0xcb52('0x32')][_0xcb52('0x38')](_0xcb52('0x39'))){_0x1e3b9a[_0xcb52('0x20')]=qs['limit'](_0x119b25[_0xcb52('0x32')][_0xcb52('0x20')]);_0x1e3b9a['offset']=qs['offset'](_0x119b25[_0xcb52('0x32')][_0xcb52('0x1e')]);}_0x1e3b9a[_0xcb52('0x3a')]=qs['sort'](_0x119b25['query']['sort']);_0x1e3b9a[_0xcb52('0x3b')]=qs[_0xcb52('0x33')](_['pick'](_0x119b25['query'],_0x12db26[_0xcb52('0x33')]),_0x4c3104);if(_0x119b25[_0xcb52('0x32')][_0xcb52('0x3c')]){_0x1e3b9a[_0xcb52('0x3b')]=_[_0xcb52('0x3d')](_0x1e3b9a['where'],{'$or':_[_0xcb52('0x2c')](_0x4c3104,function(_0x1da7e8){if(_0x1da7e8['type']!==_0xcb52('0x3e')){var _0x26535b={};_0x26535b[_0x1da7e8['name']]={'$like':'%'+_0x119b25[_0xcb52('0x32')][_0xcb52('0x3c')]+'%'};return _0x26535b;}})});}_0x1e3b9a=_['merge']({},_0x1e3b9a,_0x119b25[_0xcb52('0x3f')]);var _0x492bf6={'where':_0x1e3b9a[_0xcb52('0x3b')]};return db[_0xcb52('0x2d')][_0xcb52('0x21')](_0x492bf6)[_0xcb52('0x26')](function(_0x57a670){_0x37403a[_0xcb52('0x21')]=_0x57a670;if(_0x119b25[_0xcb52('0x32')]['includeAll']){_0x1e3b9a[_0xcb52('0x40')]=[{'all':!![]}];}return db[_0xcb52('0x2d')]['findAll'](_0x1e3b9a);})['then'](function(_0x439837){_0x37403a['rows']=_0x439837;return _0x37403a;})[_0xcb52('0x26')](respondWithFilteredResult(_0x10360f,_0x1e3b9a))[_0xcb52('0x41')](handleError(_0x10360f,null));};exports[_0xcb52('0x42')]=function(_0x474492,_0x1a99e5){var _0x4960ce={'raw':![],'where':{'id':_0x474492['params']['id']}},_0x516bc1={};_0x516bc1['model']=_[_0xcb52('0x43')](db['ZohoConfiguration']['rawAttributes']);_0x516bc1[_0xcb52('0x32')]=_[_0xcb52('0x43')](_0x474492[_0xcb52('0x32')]);_0x516bc1[_0xcb52('0x33')]=_[_0xcb52('0x34')](_0x516bc1[_0xcb52('0x31')],_0x516bc1[_0xcb52('0x32')]);_0x4960ce[_0xcb52('0x35')]=_[_0xcb52('0x34')](_0x516bc1[_0xcb52('0x31')],qs['fields'](_0x474492[_0xcb52('0x32')][_0xcb52('0x36')]));_0x4960ce[_0xcb52('0x35')]=_0x4960ce['attributes']['length']?_0x4960ce[_0xcb52('0x35')]:_0x516bc1[_0xcb52('0x31')];if(_0x474492[_0xcb52('0x32')][_0xcb52('0x44')]){_0x4960ce[_0xcb52('0x40')]=[{'all':!![]}];}_0x4960ce=_[_0xcb52('0x3d')]({},_0x4960ce,_0x474492[_0xcb52('0x3f')]);return db['ZohoConfiguration']['find'](_0x4960ce)['then'](handleEntityNotFound(_0x1a99e5,null))[_0xcb52('0x26')](respondWithResult(_0x1a99e5,null))[_0xcb52('0x41')](handleError(_0x1a99e5,null));};exports['create']=function(_0xe73559,_0x38634f){return db[_0xcb52('0x2d')][_0xcb52('0x45')](_0xe73559[_0xcb52('0x46')],{})[_0xcb52('0x26')](respondWithResult(_0x38634f,0xc9))['catch'](handleError(_0x38634f,null));};exports[_0xcb52('0x25')]=function(_0xc6952c,_0x166ae4){if(_0xc6952c[_0xcb52('0x46')]['id']){delete _0xc6952c[_0xcb52('0x46')]['id'];}return db[_0xcb52('0x2d')]['find']({'where':{'id':_0xc6952c[_0xcb52('0x47')]['id']}})['then'](handleEntityNotFound(_0x166ae4,null))[_0xcb52('0x26')](saveUpdates(_0xc6952c['body'],null))['then'](respondWithResult(_0x166ae4,null))['catch'](handleError(_0x166ae4,null));};exports[_0xcb52('0x48')]=function(_0x2c7d44,_0xa56d4d){return db[_0xcb52('0x2d')]['find']({'where':{'id':_0x2c7d44[_0xcb52('0x47')]['id']}})[_0xcb52('0x26')](handleEntityNotFound(_0xa56d4d,null))[_0xcb52('0x26')](removeEntity(_0xa56d4d,null))[_0xcb52('0x41')](handleError(_0xa56d4d,null));};exports[_0xcb52('0x49')]=function(_0x3b4e88,_0x318d0a,_0x351b18){var _0x5ceb8a={};var _0x391bd9={};var _0x37d59b;var _0x5b2410;return db[_0xcb52('0x2d')][_0xcb52('0x4a')]({'where':{'id':_0x3b4e88[_0xcb52('0x47')]['id']}})[_0xcb52('0x26')](handleEntityNotFound(_0x318d0a,null))[_0xcb52('0x26')](function(_0x132189){if(_0x132189){_0x37d59b=_0x132189;_0x391bd9[_0xcb52('0x31')]=_['keys'](db[_0xcb52('0x4b')][_0xcb52('0x2e')]);_0x391bd9[_0xcb52('0x32')]=_[_0xcb52('0x43')](_0x3b4e88[_0xcb52('0x32')]);_0x391bd9['filters']=_[_0xcb52('0x34')](_0x391bd9[_0xcb52('0x31')],_0x391bd9[_0xcb52('0x32')]);_0x5ceb8a['attributes']=_[_0xcb52('0x34')](_0x391bd9['model'],qs[_0xcb52('0x36')](_0x3b4e88[_0xcb52('0x32')][_0xcb52('0x36')]));_0x5ceb8a[_0xcb52('0x35')]=_0x5ceb8a[_0xcb52('0x35')][_0xcb52('0x37')]?_0x5ceb8a[_0xcb52('0x35')]:_0x391bd9['model'];_0x5ceb8a['order']=qs[_0xcb52('0x4c')](_0x3b4e88[_0xcb52('0x32')][_0xcb52('0x4c')]);_0x5ceb8a[_0xcb52('0x3b')]=qs[_0xcb52('0x33')](_['pick'](_0x3b4e88[_0xcb52('0x32')],_0x391bd9[_0xcb52('0x33')]));if(_0x3b4e88[_0xcb52('0x32')][_0xcb52('0x3c')]){_0x5ceb8a[_0xcb52('0x3b')]=_[_0xcb52('0x3d')](_0x5ceb8a[_0xcb52('0x3b')],{'$or':_[_0xcb52('0x2c')](_0x5ceb8a['attributes'],function(_0x238c4d){var _0x205ffb={};_0x205ffb[_0x238c4d]={'$like':'%'+_0x3b4e88[_0xcb52('0x32')][_0xcb52('0x3c')]+'%'};return _0x205ffb;})});}_0x5ceb8a=_[_0xcb52('0x3d')]({},_0x5ceb8a,_0x3b4e88['options']);return _0x37d59b['getFields'](_0x5ceb8a);}})['then'](function(_0x55ce8a){if(_0x55ce8a){_0x5b2410=_0x55ce8a[_0xcb52('0x37')];if(!_0x3b4e88[_0xcb52('0x32')][_0xcb52('0x38')](_0xcb52('0x39'))){_0x5ceb8a[_0xcb52('0x20')]=qs[_0xcb52('0x20')](_0x3b4e88[_0xcb52('0x32')][_0xcb52('0x20')]);_0x5ceb8a[_0xcb52('0x1e')]=qs[_0xcb52('0x1e')](_0x3b4e88[_0xcb52('0x32')]['offset']);}return _0x37d59b[_0xcb52('0x49')](_0x5ceb8a);}})['then'](function(_0x23b98d){if(_0x23b98d){return _0x23b98d?{'count':_0x5b2410,'rows':_0x23b98d}:null;}})[_0xcb52('0x26')](respondWithResult(_0x318d0a,null))['catch'](handleError(_0x318d0a,null));};exports[_0xcb52('0x4d')]=function(_0x9e3f15,_0xc4f04b,_0x452acb){var _0x5a9f76={};var _0x2327bf={};var _0x3b5b3c;var _0x3e412e;return db[_0xcb52('0x2d')]['findOne']({'where':{'id':_0x9e3f15['params']['id']}})[_0xcb52('0x26')](handleEntityNotFound(_0xc4f04b,null))['then'](function(_0x57e791){if(_0x57e791){_0x3b5b3c=_0x57e791;_0x2327bf[_0xcb52('0x31')]=_[_0xcb52('0x43')](db[_0xcb52('0x4b')][_0xcb52('0x2e')]);_0x2327bf[_0xcb52('0x32')]=_[_0xcb52('0x43')](_0x9e3f15['query']);_0x2327bf[_0xcb52('0x33')]=_[_0xcb52('0x34')](_0x2327bf[_0xcb52('0x31')],_0x2327bf['query']);_0x5a9f76[_0xcb52('0x35')]=_[_0xcb52('0x34')](_0x2327bf[_0xcb52('0x31')],qs[_0xcb52('0x36')](_0x9e3f15[_0xcb52('0x32')][_0xcb52('0x36')]));_0x5a9f76[_0xcb52('0x35')]=_0x5a9f76[_0xcb52('0x35')][_0xcb52('0x37')]?_0x5a9f76['attributes']:_0x2327bf['model'];_0x5a9f76['order']=qs['sort'](_0x9e3f15['query'][_0xcb52('0x4c')]);_0x5a9f76[_0xcb52('0x3b')]=qs[_0xcb52('0x33')](_[_0xcb52('0x4e')](_0x9e3f15['query'],_0x2327bf[_0xcb52('0x33')]));if(_0x9e3f15[_0xcb52('0x32')][_0xcb52('0x3c')]){_0x5a9f76[_0xcb52('0x3b')]=_['merge'](_0x5a9f76[_0xcb52('0x3b')],{'$or':_[_0xcb52('0x2c')](_0x5a9f76[_0xcb52('0x35')],function(_0x103a9b){var _0x1ff3f8={};_0x1ff3f8[_0x103a9b]={'$like':'%'+_0x9e3f15['query'][_0xcb52('0x3c')]+'%'};return _0x1ff3f8;})});}_0x5a9f76=_[_0xcb52('0x3d')]({},_0x5a9f76,_0x9e3f15[_0xcb52('0x3f')]);return _0x3b5b3c[_0xcb52('0x4d')](_0x5a9f76);}})[_0xcb52('0x26')](function(_0x5dcfc5){if(_0x5dcfc5){_0x3e412e=_0x5dcfc5['length'];if(!_0x9e3f15[_0xcb52('0x32')][_0xcb52('0x38')]('nolimit')){_0x5a9f76[_0xcb52('0x20')]=qs[_0xcb52('0x20')](_0x9e3f15[_0xcb52('0x32')][_0xcb52('0x20')]);_0x5a9f76['offset']=qs[_0xcb52('0x1e')](_0x9e3f15[_0xcb52('0x32')]['offset']);}return _0x3b5b3c['getSubjects'](_0x5a9f76);}})['then'](function(_0x24c136){if(_0x24c136){return _0x24c136?{'count':_0x3e412e,'rows':_0x24c136}:null;}})[_0xcb52('0x26')](respondWithResult(_0xc4f04b,null))[_0xcb52('0x41')](handleError(_0xc4f04b,null));};exports[_0xcb52('0x4f')]=function(_0x3bc30a,_0x3f8db8,_0x13231d){var _0x3eb11a={};var _0x4e8979={};var _0x50aca0;var _0x5c790d;return db[_0xcb52('0x2d')][_0xcb52('0x4a')]({'where':{'id':_0x3bc30a[_0xcb52('0x47')]['id']}})[_0xcb52('0x26')](handleEntityNotFound(_0x3f8db8,null))[_0xcb52('0x26')](function(_0x5b50e4){if(_0x5b50e4){_0x50aca0=_0x5b50e4;_0x4e8979[_0xcb52('0x31')]=_[_0xcb52('0x43')](db['ZohoField'][_0xcb52('0x2e')]);_0x4e8979[_0xcb52('0x32')]=_['keys'](_0x3bc30a['query']);_0x4e8979[_0xcb52('0x33')]=_['intersection'](_0x4e8979['model'],_0x4e8979[_0xcb52('0x32')]);_0x3eb11a[_0xcb52('0x35')]=_[_0xcb52('0x34')](_0x4e8979['model'],qs[_0xcb52('0x36')](_0x3bc30a[_0xcb52('0x32')]['fields']));_0x3eb11a[_0xcb52('0x35')]=_0x3eb11a[_0xcb52('0x35')][_0xcb52('0x37')]?_0x3eb11a['attributes']:_0x4e8979[_0xcb52('0x31')];_0x3eb11a[_0xcb52('0x3a')]=qs[_0xcb52('0x4c')](_0x3bc30a[_0xcb52('0x32')][_0xcb52('0x4c')]);_0x3eb11a[_0xcb52('0x3b')]=qs[_0xcb52('0x33')](_[_0xcb52('0x4e')](_0x3bc30a[_0xcb52('0x32')],_0x4e8979['filters']));if(_0x3bc30a[_0xcb52('0x32')][_0xcb52('0x3c')]){_0x3eb11a[_0xcb52('0x3b')]=_[_0xcb52('0x3d')](_0x3eb11a[_0xcb52('0x3b')],{'$or':_['map'](_0x3eb11a[_0xcb52('0x35')],function(_0x4b8abe){var _0x49955c={};_0x49955c[_0x4b8abe]={'$like':'%'+_0x3bc30a[_0xcb52('0x32')]['filter']+'%'};return _0x49955c;})});}_0x3eb11a=_['merge']({},_0x3eb11a,_0x3bc30a[_0xcb52('0x3f')]);return _0x50aca0[_0xcb52('0x4f')](_0x3eb11a);}})[_0xcb52('0x26')](function(_0x3fc066){if(_0x3fc066){_0x5c790d=_0x3fc066[_0xcb52('0x37')];if(!_0x3bc30a[_0xcb52('0x32')]['hasOwnProperty'](_0xcb52('0x39'))){_0x3eb11a[_0xcb52('0x20')]=qs['limit'](_0x3bc30a[_0xcb52('0x32')]['limit']);_0x3eb11a[_0xcb52('0x1e')]=qs[_0xcb52('0x1e')](_0x3bc30a[_0xcb52('0x32')][_0xcb52('0x1e')]);}return _0x50aca0[_0xcb52('0x4f')](_0x3eb11a);}})['then'](function(_0x39be35){if(_0x39be35){return _0x39be35?{'count':_0x5c790d,'rows':_0x39be35}:null;}})[_0xcb52('0x26')](respondWithResult(_0x3f8db8,null))[_0xcb52('0x41')](handleError(_0x3f8db8,null));};
\ No newline at end of file
+var _0x98b7=['limit','set','apply','reject','save','destroy','then','stack','name','ZohoConfiguration','fieldName','key','model','map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body','update','getFields','findOne','pick','getSubjects','getDescriptions','ZohoField','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x12f841,_0x4ddda6){var _0x368f98=function(_0x9e2a0){while(--_0x9e2a0){_0x12f841['push'](_0x12f841['shift']());}};_0x368f98(++_0x4ddda6);}(_0x98b7,0x170));var _0x798b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x98b7[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x798b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x798b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x798b('0x2'));var moment=require(_0x798b('0x3'));var BPromise=require(_0x798b('0x4'));var Mustache=require(_0x798b('0x5'));var util=require(_0x798b('0x6'));var path=require(_0x798b('0x7'));var sox=require(_0x798b('0x8'));var csv=require(_0x798b('0x9'));var ejs=require(_0x798b('0xa'));var fs=require('fs');var fs_extra=require(_0x798b('0xb'));var _=require('lodash');var squel=require(_0x798b('0xc'));var crypto=require(_0x798b('0xd'));var jsforce=require(_0x798b('0xe'));var deskjs=require(_0x798b('0xf'));var toCsv=require(_0x798b('0x9'));var querystring=require('querystring');var Papa=require(_0x798b('0x10'));var Redis=require(_0x798b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x798b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x798b('0x13'));var logger=require('../../config/logger')(_0x798b('0x14'));var utils=require(_0x798b('0x15'));var config=require(_0x798b('0x16'));var licenseUtil=require(_0x798b('0x17'));var db=require(_0x798b('0x18'))['db'];function respondWithStatusCode(_0x5dcd89,_0x4cd34a){_0x4cd34a=_0x4cd34a||0xcc;return function(_0x4b5cfe){if(_0x4b5cfe){return _0x5dcd89[_0x798b('0x19')](_0x4cd34a);}return _0x5dcd89[_0x798b('0x1a')](_0x4cd34a)[_0x798b('0x1b')]();};}function respondWithResult(_0x41f90a,_0x2ea0da){_0x2ea0da=_0x2ea0da||0xc8;return function(_0x5e1f33){if(_0x5e1f33){return _0x41f90a[_0x798b('0x1a')](_0x2ea0da)[_0x798b('0x1c')](_0x5e1f33);}};}function respondWithFilteredResult(_0x44883b,_0xea9728){return function(_0x3e9eca){if(_0x3e9eca){var _0x5f13cd=typeof _0xea9728[_0x798b('0x1d')]===_0x798b('0x1e')&&typeof _0xea9728['limit']===_0x798b('0x1e');var _0x44464e=_0x3e9eca[_0x798b('0x1f')];var _0xdcbd55=_0x5f13cd?0x0:_0xea9728[_0x798b('0x1d')];var _0x2c85bd=_0x5f13cd?_0x3e9eca[_0x798b('0x1f')]:_0xea9728[_0x798b('0x1d')]+_0xea9728[_0x798b('0x20')];var _0x47f95a;if(_0x2c85bd>=_0x44464e){_0x2c85bd=_0x44464e;_0x47f95a=0xc8;}else{_0x47f95a=0xce;}_0x44883b[_0x798b('0x1a')](_0x47f95a);return _0x44883b[_0x798b('0x21')]('Content-Range',_0xdcbd55+'-'+_0x2c85bd+'/'+_0x44464e)[_0x798b('0x1c')](_0x3e9eca);}return null;};}function patchUpdates(_0x1010fe){return function(_0x4fbfd4){try{jsonpatch[_0x798b('0x22')](_0x4fbfd4,_0x1010fe,!![]);}catch(_0x29f0fa){return BPromise[_0x798b('0x23')](_0x29f0fa);}return _0x4fbfd4[_0x798b('0x24')]();};}function saveUpdates(_0x46311e,_0x332c61){return function(_0x2bb5da){if(_0x2bb5da){return _0x2bb5da['update'](_0x46311e)['then'](function(_0x1c8f93){return _0x1c8f93;});}return null;};}function removeEntity(_0x337a73,_0x558207){return function(_0x2afb02){if(_0x2afb02){return _0x2afb02[_0x798b('0x25')]()[_0x798b('0x26')](function(){_0x337a73[_0x798b('0x1a')](0xcc)[_0x798b('0x1b')]();});}};}function handleEntityNotFound(_0x348e85,_0x3c5d80){return function(_0x8329d6){if(!_0x8329d6){_0x348e85[_0x798b('0x19')](0x194);}return _0x8329d6;};}function handleError(_0xd7a16a,_0x52c4e9){_0x52c4e9=_0x52c4e9||0x1f4;return function(_0x55ca9e){logger['error'](_0x55ca9e[_0x798b('0x27')]);if(_0x55ca9e[_0x798b('0x28')]){delete _0x55ca9e[_0x798b('0x28')];}_0xd7a16a[_0x798b('0x1a')](_0x52c4e9)['send'](_0x55ca9e);};}exports['index']=function(_0xee8655,_0x2f2cf6){var _0x3b3fe7={},_0x5981f={},_0x313b1b={'count':0x0,'rows':[]};var _0x2e0c18=_['map'](db[_0x798b('0x29')]['rawAttributes'],function(_0x134777){return{'name':_0x134777[_0x798b('0x2a')],'type':_0x134777['type'][_0x798b('0x2b')]};});_0x5981f[_0x798b('0x2c')]=_[_0x798b('0x2d')](_0x2e0c18,'name');_0x5981f[_0x798b('0x2e')]=_[_0x798b('0x2f')](_0xee8655[_0x798b('0x2e')]);_0x5981f[_0x798b('0x30')]=_['intersection'](_0x5981f[_0x798b('0x2c')],_0x5981f['query']);_0x3b3fe7[_0x798b('0x31')]=_[_0x798b('0x32')](_0x5981f[_0x798b('0x2c')],qs['fields'](_0xee8655[_0x798b('0x2e')]['fields']));_0x3b3fe7[_0x798b('0x31')]=_0x3b3fe7[_0x798b('0x31')][_0x798b('0x33')]?_0x3b3fe7[_0x798b('0x31')]:_0x5981f['model'];if(!_0xee8655[_0x798b('0x2e')][_0x798b('0x34')](_0x798b('0x35'))){_0x3b3fe7['limit']=qs[_0x798b('0x20')](_0xee8655[_0x798b('0x2e')][_0x798b('0x20')]);_0x3b3fe7[_0x798b('0x1d')]=qs[_0x798b('0x1d')](_0xee8655['query'][_0x798b('0x1d')]);}_0x3b3fe7[_0x798b('0x36')]=qs[_0x798b('0x37')](_0xee8655[_0x798b('0x2e')][_0x798b('0x37')]);_0x3b3fe7[_0x798b('0x38')]=qs[_0x798b('0x30')](_['pick'](_0xee8655['query'],_0x5981f[_0x798b('0x30')]),_0x2e0c18);if(_0xee8655['query'][_0x798b('0x39')]){_0x3b3fe7[_0x798b('0x38')]=_[_0x798b('0x3a')](_0x3b3fe7[_0x798b('0x38')],{'$or':_[_0x798b('0x2d')](_0x2e0c18,function(_0x3bc0da){if(_0x3bc0da[_0x798b('0x3b')]!=='VIRTUAL'){var _0x237d1b={};_0x237d1b[_0x3bc0da[_0x798b('0x28')]]={'$like':'%'+_0xee8655[_0x798b('0x2e')][_0x798b('0x39')]+'%'};return _0x237d1b;}})});}_0x3b3fe7=_[_0x798b('0x3a')]({},_0x3b3fe7,_0xee8655[_0x798b('0x3c')]);var _0x41f18e={'where':_0x3b3fe7[_0x798b('0x38')]};return db[_0x798b('0x29')][_0x798b('0x1f')](_0x41f18e)[_0x798b('0x26')](function(_0x42be48){_0x313b1b[_0x798b('0x1f')]=_0x42be48;if(_0xee8655['query']['includeAll']){_0x3b3fe7[_0x798b('0x3d')]=[{'all':!![]}];}return db[_0x798b('0x29')][_0x798b('0x3e')](_0x3b3fe7);})[_0x798b('0x26')](function(_0x49ce17){_0x313b1b[_0x798b('0x3f')]=_0x49ce17;return _0x313b1b;})['then'](respondWithFilteredResult(_0x2f2cf6,_0x3b3fe7))[_0x798b('0x40')](handleError(_0x2f2cf6,null));};exports[_0x798b('0x41')]=function(_0x3da8da,_0x1cc49f){var _0x279174={'raw':![],'where':{'id':_0x3da8da[_0x798b('0x42')]['id']}},_0x35e6f6={};_0x35e6f6[_0x798b('0x2c')]=_[_0x798b('0x2f')](db['ZohoConfiguration'][_0x798b('0x43')]);_0x35e6f6['query']=_[_0x798b('0x2f')](_0x3da8da[_0x798b('0x2e')]);_0x35e6f6[_0x798b('0x30')]=_[_0x798b('0x32')](_0x35e6f6[_0x798b('0x2c')],_0x35e6f6['query']);_0x279174[_0x798b('0x31')]=_[_0x798b('0x32')](_0x35e6f6[_0x798b('0x2c')],qs[_0x798b('0x44')](_0x3da8da[_0x798b('0x2e')][_0x798b('0x44')]));_0x279174['attributes']=_0x279174[_0x798b('0x31')][_0x798b('0x33')]?_0x279174[_0x798b('0x31')]:_0x35e6f6[_0x798b('0x2c')];if(_0x3da8da[_0x798b('0x2e')][_0x798b('0x45')]){_0x279174[_0x798b('0x3d')]=[{'all':!![]}];}_0x279174=_[_0x798b('0x3a')]({},_0x279174,_0x3da8da[_0x798b('0x3c')]);return db[_0x798b('0x29')][_0x798b('0x46')](_0x279174)[_0x798b('0x26')](handleEntityNotFound(_0x1cc49f,null))[_0x798b('0x26')](respondWithResult(_0x1cc49f,null))[_0x798b('0x40')](handleError(_0x1cc49f,null));};exports['create']=function(_0x1b5b7c,_0x5107f1){return db[_0x798b('0x29')][_0x798b('0x47')](_0x1b5b7c[_0x798b('0x48')],{})[_0x798b('0x26')](respondWithResult(_0x5107f1,0xc9))[_0x798b('0x40')](handleError(_0x5107f1,null));};exports[_0x798b('0x49')]=function(_0x3de768,_0x573f85){if(_0x3de768[_0x798b('0x48')]['id']){delete _0x3de768[_0x798b('0x48')]['id'];}return db['ZohoConfiguration'][_0x798b('0x46')]({'where':{'id':_0x3de768[_0x798b('0x42')]['id']}})['then'](handleEntityNotFound(_0x573f85,null))[_0x798b('0x26')](saveUpdates(_0x3de768[_0x798b('0x48')],null))[_0x798b('0x26')](respondWithResult(_0x573f85,null))[_0x798b('0x40')](handleError(_0x573f85,null));};exports[_0x798b('0x25')]=function(_0x359688,_0x5be0a8){return db['ZohoConfiguration'][_0x798b('0x46')]({'where':{'id':_0x359688[_0x798b('0x42')]['id']}})[_0x798b('0x26')](handleEntityNotFound(_0x5be0a8,null))[_0x798b('0x26')](removeEntity(_0x5be0a8,null))[_0x798b('0x40')](handleError(_0x5be0a8,null));};exports[_0x798b('0x4a')]=function(_0x562ebf,_0x3f5bcc,_0x1400ff){var _0x2f4ce3={};var _0x59ec68={};var _0x1edf9b;var _0x31d42c;return db[_0x798b('0x29')][_0x798b('0x4b')]({'where':{'id':_0x562ebf['params']['id']}})[_0x798b('0x26')](handleEntityNotFound(_0x3f5bcc,null))[_0x798b('0x26')](function(_0x574587){if(_0x574587){_0x1edf9b=_0x574587;_0x59ec68[_0x798b('0x2c')]=_[_0x798b('0x2f')](db['ZohoField'][_0x798b('0x43')]);_0x59ec68['query']=_['keys'](_0x562ebf['query']);_0x59ec68['filters']=_[_0x798b('0x32')](_0x59ec68[_0x798b('0x2c')],_0x59ec68[_0x798b('0x2e')]);_0x2f4ce3['attributes']=_['intersection'](_0x59ec68[_0x798b('0x2c')],qs[_0x798b('0x44')](_0x562ebf[_0x798b('0x2e')][_0x798b('0x44')]));_0x2f4ce3[_0x798b('0x31')]=_0x2f4ce3[_0x798b('0x31')][_0x798b('0x33')]?_0x2f4ce3['attributes']:_0x59ec68[_0x798b('0x2c')];_0x2f4ce3[_0x798b('0x36')]=qs[_0x798b('0x37')](_0x562ebf['query'][_0x798b('0x37')]);_0x2f4ce3['where']=qs[_0x798b('0x30')](_['pick'](_0x562ebf[_0x798b('0x2e')],_0x59ec68[_0x798b('0x30')]));if(_0x562ebf[_0x798b('0x2e')]['filter']){_0x2f4ce3[_0x798b('0x38')]=_[_0x798b('0x3a')](_0x2f4ce3['where'],{'$or':_[_0x798b('0x2d')](_0x2f4ce3['attributes'],function(_0x5ad59a){var _0x59516f={};_0x59516f[_0x5ad59a]={'$like':'%'+_0x562ebf['query'][_0x798b('0x39')]+'%'};return _0x59516f;})});}_0x2f4ce3=_['merge']({},_0x2f4ce3,_0x562ebf[_0x798b('0x3c')]);return _0x1edf9b[_0x798b('0x4a')](_0x2f4ce3);}})[_0x798b('0x26')](function(_0x4a9bbc){if(_0x4a9bbc){_0x31d42c=_0x4a9bbc['length'];if(!_0x562ebf[_0x798b('0x2e')][_0x798b('0x34')](_0x798b('0x35'))){_0x2f4ce3['limit']=qs[_0x798b('0x20')](_0x562ebf[_0x798b('0x2e')][_0x798b('0x20')]);_0x2f4ce3[_0x798b('0x1d')]=qs[_0x798b('0x1d')](_0x562ebf[_0x798b('0x2e')][_0x798b('0x1d')]);}return _0x1edf9b[_0x798b('0x4a')](_0x2f4ce3);}})[_0x798b('0x26')](function(_0x59c791){if(_0x59c791){return _0x59c791?{'count':_0x31d42c,'rows':_0x59c791}:null;}})[_0x798b('0x26')](respondWithResult(_0x3f5bcc,null))[_0x798b('0x40')](handleError(_0x3f5bcc,null));};exports['getSubjects']=function(_0x38fc8b,_0x30174f,_0x782211){var _0x29c78b={};var _0x42c2ae={};var _0x5bb2df;var _0x25f1ad;return db[_0x798b('0x29')][_0x798b('0x4b')]({'where':{'id':_0x38fc8b[_0x798b('0x42')]['id']}})[_0x798b('0x26')](handleEntityNotFound(_0x30174f,null))[_0x798b('0x26')](function(_0x3ae7b6){if(_0x3ae7b6){_0x5bb2df=_0x3ae7b6;_0x42c2ae[_0x798b('0x2c')]=_['keys'](db['ZohoField']['rawAttributes']);_0x42c2ae[_0x798b('0x2e')]=_[_0x798b('0x2f')](_0x38fc8b[_0x798b('0x2e')]);_0x42c2ae['filters']=_[_0x798b('0x32')](_0x42c2ae[_0x798b('0x2c')],_0x42c2ae[_0x798b('0x2e')]);_0x29c78b['attributes']=_[_0x798b('0x32')](_0x42c2ae['model'],qs[_0x798b('0x44')](_0x38fc8b[_0x798b('0x2e')]['fields']));_0x29c78b[_0x798b('0x31')]=_0x29c78b[_0x798b('0x31')]['length']?_0x29c78b[_0x798b('0x31')]:_0x42c2ae['model'];_0x29c78b['order']=qs[_0x798b('0x37')](_0x38fc8b[_0x798b('0x2e')][_0x798b('0x37')]);_0x29c78b[_0x798b('0x38')]=qs[_0x798b('0x30')](_[_0x798b('0x4c')](_0x38fc8b[_0x798b('0x2e')],_0x42c2ae[_0x798b('0x30')]));if(_0x38fc8b[_0x798b('0x2e')]['filter']){_0x29c78b[_0x798b('0x38')]=_[_0x798b('0x3a')](_0x29c78b[_0x798b('0x38')],{'$or':_[_0x798b('0x2d')](_0x29c78b[_0x798b('0x31')],function(_0x5962cb){var _0x572cbd={};_0x572cbd[_0x5962cb]={'$like':'%'+_0x38fc8b['query'][_0x798b('0x39')]+'%'};return _0x572cbd;})});}_0x29c78b=_[_0x798b('0x3a')]({},_0x29c78b,_0x38fc8b[_0x798b('0x3c')]);return _0x5bb2df[_0x798b('0x4d')](_0x29c78b);}})['then'](function(_0x5c6e9e){if(_0x5c6e9e){_0x25f1ad=_0x5c6e9e[_0x798b('0x33')];if(!_0x38fc8b[_0x798b('0x2e')][_0x798b('0x34')]('nolimit')){_0x29c78b['limit']=qs[_0x798b('0x20')](_0x38fc8b[_0x798b('0x2e')]['limit']);_0x29c78b[_0x798b('0x1d')]=qs[_0x798b('0x1d')](_0x38fc8b[_0x798b('0x2e')][_0x798b('0x1d')]);}return _0x5bb2df[_0x798b('0x4d')](_0x29c78b);}})[_0x798b('0x26')](function(_0x2f3f16){if(_0x2f3f16){return _0x2f3f16?{'count':_0x25f1ad,'rows':_0x2f3f16}:null;}})[_0x798b('0x26')](respondWithResult(_0x30174f,null))['catch'](handleError(_0x30174f,null));};exports[_0x798b('0x4e')]=function(_0x41f28a,_0x39e1fc,_0x1e60eb){var _0x56345c={};var _0x3d88fe={};var _0x1a820c;var _0x22759f;return db[_0x798b('0x29')][_0x798b('0x4b')]({'where':{'id':_0x41f28a['params']['id']}})['then'](handleEntityNotFound(_0x39e1fc,null))[_0x798b('0x26')](function(_0x5b9833){if(_0x5b9833){_0x1a820c=_0x5b9833;_0x3d88fe['model']=_[_0x798b('0x2f')](db[_0x798b('0x4f')][_0x798b('0x43')]);_0x3d88fe['query']=_[_0x798b('0x2f')](_0x41f28a[_0x798b('0x2e')]);_0x3d88fe[_0x798b('0x30')]=_[_0x798b('0x32')](_0x3d88fe[_0x798b('0x2c')],_0x3d88fe['query']);_0x56345c[_0x798b('0x31')]=_[_0x798b('0x32')](_0x3d88fe['model'],qs[_0x798b('0x44')](_0x41f28a['query'][_0x798b('0x44')]));_0x56345c[_0x798b('0x31')]=_0x56345c[_0x798b('0x31')][_0x798b('0x33')]?_0x56345c[_0x798b('0x31')]:_0x3d88fe[_0x798b('0x2c')];_0x56345c[_0x798b('0x36')]=qs[_0x798b('0x37')](_0x41f28a['query']['sort']);_0x56345c[_0x798b('0x38')]=qs[_0x798b('0x30')](_[_0x798b('0x4c')](_0x41f28a[_0x798b('0x2e')],_0x3d88fe[_0x798b('0x30')]));if(_0x41f28a[_0x798b('0x2e')][_0x798b('0x39')]){_0x56345c['where']=_[_0x798b('0x3a')](_0x56345c[_0x798b('0x38')],{'$or':_[_0x798b('0x2d')](_0x56345c['attributes'],function(_0x1f79f3){var _0x124d27={};_0x124d27[_0x1f79f3]={'$like':'%'+_0x41f28a['query'][_0x798b('0x39')]+'%'};return _0x124d27;})});}_0x56345c=_[_0x798b('0x3a')]({},_0x56345c,_0x41f28a[_0x798b('0x3c')]);return _0x1a820c[_0x798b('0x4e')](_0x56345c);}})[_0x798b('0x26')](function(_0x4aad79){if(_0x4aad79){_0x22759f=_0x4aad79['length'];if(!_0x41f28a[_0x798b('0x2e')][_0x798b('0x34')](_0x798b('0x35'))){_0x56345c[_0x798b('0x20')]=qs[_0x798b('0x20')](_0x41f28a[_0x798b('0x2e')][_0x798b('0x20')]);_0x56345c[_0x798b('0x1d')]=qs['offset'](_0x41f28a['query'][_0x798b('0x1d')]);}return _0x1a820c[_0x798b('0x4e')](_0x56345c);}})['then'](function(_0x906af6){if(_0x906af6){return _0x906af6?{'count':_0x22759f,'rows':_0x906af6}:null;}})[_0x798b('0x26')](respondWithResult(_0x39e1fc,null))[_0x798b('0x40')](handleError(_0x39e1fc,null));};
\ No newline at end of file
index 2686068..0bf140e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9ac=['api','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports','ZohoConfiguration','util','../../config/logger'];(function(_0x18e3ff,_0x3dc48f){var _0xfaf336=function(_0x1f6e44){while(--_0x1f6e44){_0x18e3ff['push'](_0x18e3ff['shift']());}};_0xfaf336(++_0x3dc48f);}(_0xe9ac,0x18e));var _0xce9a=function(_0x42786e,_0x57a56c){_0x42786e=_0x42786e-0x0;var _0x1217d2=_0xe9ac[_0x42786e];return _0x1217d2;};'use strict';var _=require('lodash');var util=require(_0xce9a('0x0'));var logger=require(_0xce9a('0x1'))(_0xce9a('0x2'));var moment=require('moment');var BPromise=require(_0xce9a('0x3'));var rp=require(_0xce9a('0x4'));var fs=require('fs');var path=require(_0xce9a('0x5'));var rimraf=require(_0xce9a('0x6'));var config=require('../../config/environment');var attributes=require(_0xce9a('0x7'));module[_0xce9a('0x8')]=function(_0x151f51,_0x17c123){return _0x151f51['define'](_0xce9a('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f0e=['moment','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x4b256a,_0x154505){var _0x14ca6f=function(_0x3c9f41){while(--_0x3c9f41){_0x4b256a['push'](_0x4b256a['shift']());}};_0x14ca6f(++_0x154505);}(_0x9f0e,0x10e));var _0xe9f0=function(_0x479d04,_0x150969){_0x479d04=_0x479d04-0x0;var _0x287112=_0x9f0e[_0x479d04];return _0x287112;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var logger=require(_0xe9f0('0x2'))('api');var moment=require(_0xe9f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xe9f0('0x4'));var fs=require('fs');var path=require(_0xe9f0('0x5'));var rimraf=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var attributes=require(_0xe9f0('0x8'));module[_0xe9f0('0x9')]=function(_0x251cde,_0x5e981e){return _0x251cde[_0xe9f0('0xa')](_0xe9f0('0xb'),attributes,{'tableName':_0xe9f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3ea9208..8d4e424 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdff1=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','stringify','code','error','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5b32f5,_0x409b08){var _0x17f5b0=function(_0x5724b7){while(--_0x5724b7){_0x5b32f5['push'](_0x5b32f5['shift']());}};_0x17f5b0(++_0x409b08);}(_0xdff1,0x1b2));var _0x1dff=function(_0x4492c4,_0x52f566){_0x4492c4=_0x4492c4-0x0;var _0x3c9002=_0xdff1[_0x4492c4];return _0x3c9002;};'use strict';var _=require(_0x1dff('0x0'));var util=require(_0x1dff('0x1'));var moment=require(_0x1dff('0x2'));var BPromise=require(_0x1dff('0x3'));var rs=require(_0x1dff('0x4'));var fs=require('fs');var Redis=require(_0x1dff('0x5'));var db=require(_0x1dff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dff('0x7'))(_0x1dff('0x8'));var config=require(_0x1dff('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1dff('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2824d2,_0x1499b2,_0x45bf40){return new BPromise(function(_0x3f61b9,_0x1ea287){return client[_0x1dff('0xb')](_0x2824d2,_0x45bf40)['then'](function(_0x4074af){logger[_0x1dff('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x1499b2,_0x1dff('0xd'));logger[_0x1dff('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1499b2,'request\x20sent',JSON[_0x1dff('0xf')](_0x4074af));if(_0x4074af['error']){if(_0x4074af['error'][_0x1dff('0x10')]===0x1f4){logger[_0x1dff('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x1499b2,_0x4074af[_0x1dff('0x11')]['message']);return _0x1ea287(_0x4074af[_0x1dff('0x11')][_0x1dff('0x12')]);}logger[_0x1dff('0x11')](_0x1dff('0x13'),_0x1499b2,_0x4074af[_0x1dff('0x11')][_0x1dff('0x12')]);return _0x3f61b9(_0x4074af[_0x1dff('0x11')]['message']);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x1499b2,_0x1dff('0xd'));_0x3f61b9(_0x4074af[_0x1dff('0x14')][_0x1dff('0x12')]);}})[_0x1dff('0x15')](function(_0x2d56ad){logger[_0x1dff('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x1499b2,_0x2d56ad);_0x1ea287(_0x2d56ad);});});}
\ No newline at end of file
+var _0xdda6=['bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','util','moment'];(function(_0x338969,_0x5d6fdc){var _0x1ea91e=function(_0x15256a){while(--_0x15256a){_0x338969['push'](_0x338969['shift']());}};_0x1ea91e(++_0x5d6fdc);}(_0xdda6,0x7b));var _0x6dda=function(_0x294c1c,_0x567301){_0x294c1c=_0x294c1c-0x0;var _0x1e7943=_0xdda6[_0x294c1c];return _0x1e7943;};'use strict';var _=require(_0x6dda('0x0'));var util=require(_0x6dda('0x1'));var moment=require(_0x6dda('0x2'));var BPromise=require(_0x6dda('0x3'));var rs=require(_0x6dda('0x4'));var fs=require('fs');var Redis=require(_0x6dda('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6dda('0x6'))('rpc');var config=require(_0x6dda('0x7'));var jayson=require(_0x6dda('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51194f,_0x3c8744,_0x341987){return new BPromise(function(_0x1d53c1,_0x26b9dd){return client['request'](_0x51194f,_0x341987)[_0x6dda('0x9')](function(_0x24eac9){logger[_0x6dda('0xa')](_0x6dda('0xb'),_0x3c8744,_0x6dda('0xc'));logger['debug'](_0x6dda('0xd'),_0x3c8744,_0x6dda('0xc'),JSON['stringify'](_0x24eac9));if(_0x24eac9['error']){if(_0x24eac9['error'][_0x6dda('0xe')]===0x1f4){logger[_0x6dda('0xf')](_0x6dda('0xb'),_0x3c8744,_0x24eac9[_0x6dda('0xf')][_0x6dda('0x10')]);return _0x26b9dd(_0x24eac9['error']['message']);}logger['error'](_0x6dda('0xb'),_0x3c8744,_0x24eac9[_0x6dda('0xf')][_0x6dda('0x10')]);return _0x1d53c1(_0x24eac9[_0x6dda('0xf')][_0x6dda('0x10')]);}else{logger['info'](_0x6dda('0xb'),_0x3c8744,_0x6dda('0xc'));_0x1d53c1(_0x24eac9['result'][_0x6dda('0x10')]);}})[_0x6dda('0x11')](function(_0x22f195){logger[_0x6dda('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x3c8744,_0x22f195);_0x26b9dd(_0x22f195);});});}
\ No newline at end of file
index 635852e..64995af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0032=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x57f33a,_0xb043fe){var _0x4a3f4c=function(_0x53fab4){while(--_0x53fab4){_0x57f33a['push'](_0x57f33a['shift']());}};_0x4a3f4c(++_0xb043fe);}(_0x0032,0x126));var _0x2003=function(_0x306c7a,_0x4d5ac8){_0x306c7a=_0x306c7a-0x0;var _0x4f8956=_0x0032[_0x306c7a];return _0x4f8956;};'use strict';var multer=require('multer');var util=require(_0x2003('0x0'));var path=require(_0x2003('0x1'));var timeout=require(_0x2003('0x2'));var express=require(_0x2003('0x3'));var router=express[_0x2003('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2003('0x5'));var interaction=require(_0x2003('0x6'));var config=require(_0x2003('0x7'));var controller=require(_0x2003('0x8'));router[_0x2003('0x9')]('/',auth['isAuthenticated'](),controller[_0x2003('0xa')]);router[_0x2003('0x9')](_0x2003('0xb'),auth[_0x2003('0xc')](),controller[_0x2003('0xd')]);router[_0x2003('0xe')]('/',auth[_0x2003('0xc')](),controller[_0x2003('0xf')]);router[_0x2003('0x10')](_0x2003('0xb'),auth[_0x2003('0xc')](),controller[_0x2003('0x11')]);router[_0x2003('0x12')](_0x2003('0xb'),auth[_0x2003('0xc')](),controller[_0x2003('0x13')]);module[_0x2003('0x14')]=router;
\ No newline at end of file
+var _0xdac8=['get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x3b0ca4,_0x32b0c9){var _0x3f8a8b=function(_0x4ee1db){while(--_0x4ee1db){_0x3b0ca4['push'](_0x3b0ca4['shift']());}};_0x3f8a8b(++_0x32b0c9);}(_0xdac8,0x82));var _0x8dac=function(_0x27f2bb,_0x241224){_0x27f2bb=_0x27f2bb-0x0;var _0x45aec4=_0xdac8[_0x27f2bb];return _0x45aec4;};'use strict';var multer=require(_0x8dac('0x0'));var util=require('util');var path=require(_0x8dac('0x1'));var timeout=require(_0x8dac('0x2'));var express=require(_0x8dac('0x3'));var router=express[_0x8dac('0x4')]();var fs_extra=require(_0x8dac('0x5'));var auth=require(_0x8dac('0x6'));var interaction=require(_0x8dac('0x7'));var config=require(_0x8dac('0x8'));var controller=require(_0x8dac('0x9'));router[_0x8dac('0xa')]('/',auth[_0x8dac('0xb')](),controller[_0x8dac('0xc')]);router[_0x8dac('0xa')](_0x8dac('0xd'),auth['isAuthenticated'](),controller[_0x8dac('0xe')]);router[_0x8dac('0xf')]('/',auth[_0x8dac('0xb')](),controller[_0x8dac('0x10')]);router[_0x8dac('0x11')](_0x8dac('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8dac('0x12')](_0x8dac('0xd'),auth[_0x8dac('0xb')](),controller['destroy']);module[_0x8dac('0x13')]=router;
\ No newline at end of file
index 24ff5b2..3a0a2c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x252a=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x29bdb3,_0x5c5afd){var _0x226a50=function(_0x45e99f){while(--_0x45e99f){_0x29bdb3['push'](_0x29bdb3['shift']());}};_0x226a50(++_0x5c5afd);}(_0x252a,0xd7));var _0xa252=function(_0x2d73cb,_0x37a647){_0x2d73cb=_0x2d73cb-0x0;var _0x395d3c=_0x252a[_0x2d73cb];return _0x395d3c;};'use strict';var Sequelize=require(_0xa252('0x0'));module[_0xa252('0x1')]={'type':{'type':Sequelize[_0xa252('0x2')](_0xa252('0x3'),_0xa252('0x4'),_0xa252('0x5'),_0xa252('0x6'),_0xa252('0x7')),'defaultValue':_0xa252('0x3')},'content':{'type':Sequelize[_0xa252('0x8')]},'key':{'type':Sequelize[_0xa252('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xa252('0x3'),_0xa252('0x4'),_0xa252('0x5'))},'keyContent':{'type':Sequelize[_0xa252('0x8')]},'idField':{'type':Sequelize[_0xa252('0x8')]},'nameField':{'type':Sequelize[_0xa252('0x8')]},'customField':{'type':Sequelize[_0xa252('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa252('0x8')]}};
\ No newline at end of file
+var _0x6200=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x561520,_0x226be2){var _0x58383c=function(_0xfd0e66){while(--_0xfd0e66){_0x561520['push'](_0x561520['shift']());}};_0x58383c(++_0x226be2);}(_0x6200,0x13b));var _0x0620=function(_0x189475,_0x27839e){_0x189475=_0x189475-0x0;var _0x5cb5f8=_0x6200[_0x189475];return _0x5cb5f8;};'use strict';var Sequelize=require(_0x0620('0x0'));module[_0x0620('0x1')]={'type':{'type':Sequelize[_0x0620('0x2')](_0x0620('0x3'),_0x0620('0x4'),_0x0620('0x5'),_0x0620('0x6'),_0x0620('0x7')),'defaultValue':_0x0620('0x3')},'content':{'type':Sequelize[_0x0620('0x8')]},'key':{'type':Sequelize[_0x0620('0x8')]},'keyType':{'type':Sequelize[_0x0620('0x2')](_0x0620('0x3'),_0x0620('0x4'),_0x0620('0x5'))},'keyContent':{'type':Sequelize[_0x0620('0x8')]},'idField':{'type':Sequelize[_0x0620('0x8')]},'nameField':{'type':Sequelize[_0x0620('0x8')]},'customField':{'type':Sequelize[_0x0620('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1eb1a81..0c4eac4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bb7=['stack','name','send','ZohoField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','includeAll','find','create','body','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x8fb035,_0x217b6d){var _0x3a678d=function(_0x29d401){while(--_0x29d401){_0x8fb035['push'](_0x8fb035['shift']());}};_0x3a678d(++_0x217b6d);}(_0x3bb7,0x157));var _0x73bb=function(_0x514835,_0x95fcdf){_0x514835=_0x514835-0x0;var _0x44c151=_0x3bb7[_0x514835];return _0x44c151;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x73bb('0x0'));var jsonpatch=require(_0x73bb('0x1'));var rp=require('request-promise');var moment=require(_0x73bb('0x2'));var BPromise=require(_0x73bb('0x3'));var Mustache=require(_0x73bb('0x4'));var util=require('util');var path=require(_0x73bb('0x5'));var sox=require(_0x73bb('0x6'));var csv=require('to-csv');var ejs=require(_0x73bb('0x7'));var fs=require('fs');var fs_extra=require(_0x73bb('0x8'));var _=require('lodash');var squel=require(_0x73bb('0x9'));var crypto=require(_0x73bb('0xa'));var jsforce=require(_0x73bb('0xb'));var deskjs=require(_0x73bb('0xc'));var toCsv=require(_0x73bb('0xd'));var querystring=require(_0x73bb('0xe'));var Papa=require(_0x73bb('0xf'));var Redis=require('ioredis');var authService=require(_0x73bb('0x10'));var qs=require(_0x73bb('0x11'));var as=require(_0x73bb('0x12'));var hardwareService=require(_0x73bb('0x13'));var logger=require(_0x73bb('0x14'))(_0x73bb('0x15'));var utils=require(_0x73bb('0x16'));var config=require(_0x73bb('0x17'));var licenseUtil=require(_0x73bb('0x18'));var db=require(_0x73bb('0x19'))['db'];function respondWithStatusCode(_0x1acdf1,_0x48bfc0){_0x48bfc0=_0x48bfc0||0xcc;return function(_0x41032d){if(_0x41032d){return _0x1acdf1[_0x73bb('0x1a')](_0x48bfc0);}return _0x1acdf1[_0x73bb('0x1b')](_0x48bfc0)[_0x73bb('0x1c')]();};}function respondWithResult(_0x547832,_0x4064fc){_0x4064fc=_0x4064fc||0xc8;return function(_0x16bc9e){if(_0x16bc9e){return _0x547832[_0x73bb('0x1b')](_0x4064fc)[_0x73bb('0x1d')](_0x16bc9e);}};}function respondWithFilteredResult(_0x16dc54,_0x2bb2d4){return function(_0x256df3){if(_0x256df3){var _0x35ee10=typeof _0x2bb2d4[_0x73bb('0x1e')]===_0x73bb('0x1f')&&typeof _0x2bb2d4[_0x73bb('0x20')]==='undefined';var _0x20a38c=_0x256df3[_0x73bb('0x21')];var _0x5b4b92=_0x35ee10?0x0:_0x2bb2d4['offset'];var _0x234d74=_0x35ee10?_0x256df3[_0x73bb('0x21')]:_0x2bb2d4[_0x73bb('0x1e')]+_0x2bb2d4[_0x73bb('0x20')];var _0xa6aa3e;if(_0x234d74>=_0x20a38c){_0x234d74=_0x20a38c;_0xa6aa3e=0xc8;}else{_0xa6aa3e=0xce;}_0x16dc54[_0x73bb('0x1b')](_0xa6aa3e);return _0x16dc54[_0x73bb('0x22')](_0x73bb('0x23'),_0x5b4b92+'-'+_0x234d74+'/'+_0x20a38c)[_0x73bb('0x1d')](_0x256df3);}return null;};}function patchUpdates(_0x3f6d3d){return function(_0x1c3e40){try{jsonpatch[_0x73bb('0x24')](_0x1c3e40,_0x3f6d3d,!![]);}catch(_0x1a468e){return BPromise[_0x73bb('0x25')](_0x1a468e);}return _0x1c3e40['save']();};}function saveUpdates(_0x851548,_0x5e6af4){return function(_0x240132){if(_0x240132){return _0x240132[_0x73bb('0x26')](_0x851548)[_0x73bb('0x27')](function(_0x443749){return _0x443749;});}return null;};}function removeEntity(_0x358bfb,_0x3dce5b){return function(_0x3b1791){if(_0x3b1791){return _0x3b1791[_0x73bb('0x28')]()[_0x73bb('0x27')](function(){_0x358bfb[_0x73bb('0x1b')](0xcc)[_0x73bb('0x1c')]();});}};}function handleEntityNotFound(_0x1c573e,_0x10af89){return function(_0x5b4d3b){if(!_0x5b4d3b){_0x1c573e['sendStatus'](0x194);}return _0x5b4d3b;};}function handleError(_0x1eaa07,_0x164f3b){_0x164f3b=_0x164f3b||0x1f4;return function(_0xa288e9){logger[_0x73bb('0x29')](_0xa288e9[_0x73bb('0x2a')]);if(_0xa288e9[_0x73bb('0x2b')]){delete _0xa288e9[_0x73bb('0x2b')];}_0x1eaa07['status'](_0x164f3b)[_0x73bb('0x2c')](_0xa288e9);};}exports['index']=function(_0x15b053,_0xbdab8b){var _0x5b72ba={},_0x56270b={},_0x5cb1f5={'count':0x0,'rows':[]};var _0x3c6356=_['map'](db[_0x73bb('0x2d')][_0x73bb('0x2e')],function(_0x4714b4){return{'name':_0x4714b4[_0x73bb('0x2f')],'type':_0x4714b4['type'][_0x73bb('0x30')]};});_0x56270b[_0x73bb('0x31')]=_[_0x73bb('0x32')](_0x3c6356,_0x73bb('0x2b'));_0x56270b[_0x73bb('0x33')]=_[_0x73bb('0x34')](_0x15b053['query']);_0x56270b[_0x73bb('0x35')]=_['intersection'](_0x56270b[_0x73bb('0x31')],_0x56270b[_0x73bb('0x33')]);_0x5b72ba[_0x73bb('0x36')]=_[_0x73bb('0x37')](_0x56270b[_0x73bb('0x31')],qs[_0x73bb('0x38')](_0x15b053[_0x73bb('0x33')][_0x73bb('0x38')]));_0x5b72ba[_0x73bb('0x36')]=_0x5b72ba[_0x73bb('0x36')][_0x73bb('0x39')]?_0x5b72ba[_0x73bb('0x36')]:_0x56270b['model'];if(!_0x15b053[_0x73bb('0x33')][_0x73bb('0x3a')](_0x73bb('0x3b'))){_0x5b72ba['limit']=qs['limit'](_0x15b053[_0x73bb('0x33')][_0x73bb('0x20')]);_0x5b72ba[_0x73bb('0x1e')]=qs[_0x73bb('0x1e')](_0x15b053[_0x73bb('0x33')][_0x73bb('0x1e')]);}_0x5b72ba[_0x73bb('0x3c')]=qs[_0x73bb('0x3d')](_0x15b053['query'][_0x73bb('0x3d')]);_0x5b72ba[_0x73bb('0x3e')]=qs['filters'](_[_0x73bb('0x3f')](_0x15b053[_0x73bb('0x33')],_0x56270b[_0x73bb('0x35')]),_0x3c6356);if(_0x15b053[_0x73bb('0x33')]['filter']){_0x5b72ba[_0x73bb('0x3e')]=_[_0x73bb('0x40')](_0x5b72ba[_0x73bb('0x3e')],{'$or':_[_0x73bb('0x32')](_0x3c6356,function(_0x2d4a1b){if(_0x2d4a1b['type']!==_0x73bb('0x41')){var _0xc01c7f={};_0xc01c7f[_0x2d4a1b[_0x73bb('0x2b')]]={'$like':'%'+_0x15b053[_0x73bb('0x33')][_0x73bb('0x42')]+'%'};return _0xc01c7f;}})});}_0x5b72ba=_[_0x73bb('0x40')]({},_0x5b72ba,_0x15b053[_0x73bb('0x43')]);var _0x322582={'where':_0x5b72ba[_0x73bb('0x3e')]};return db[_0x73bb('0x2d')][_0x73bb('0x21')](_0x322582)[_0x73bb('0x27')](function(_0x64c78b){_0x5cb1f5[_0x73bb('0x21')]=_0x64c78b;if(_0x15b053[_0x73bb('0x33')]['includeAll']){_0x5b72ba[_0x73bb('0x44')]=[{'all':!![]}];}return db[_0x73bb('0x2d')][_0x73bb('0x45')](_0x5b72ba);})[_0x73bb('0x27')](function(_0xf8f9a7){_0x5cb1f5['rows']=_0xf8f9a7;return _0x5cb1f5;})[_0x73bb('0x27')](respondWithFilteredResult(_0xbdab8b,_0x5b72ba))[_0x73bb('0x46')](handleError(_0xbdab8b,null));};exports[_0x73bb('0x47')]=function(_0x3b4b43,_0x163eef){var _0x224eef={'raw':!![],'where':{'id':_0x3b4b43[_0x73bb('0x48')]['id']}},_0x243dec={};_0x243dec['model']=_['keys'](db['ZohoField'][_0x73bb('0x2e')]);_0x243dec[_0x73bb('0x33')]=_[_0x73bb('0x34')](_0x3b4b43[_0x73bb('0x33')]);_0x243dec[_0x73bb('0x35')]=_[_0x73bb('0x37')](_0x243dec['model'],_0x243dec[_0x73bb('0x33')]);_0x224eef[_0x73bb('0x36')]=_[_0x73bb('0x37')](_0x243dec[_0x73bb('0x31')],qs['fields'](_0x3b4b43[_0x73bb('0x33')][_0x73bb('0x38')]));_0x224eef['attributes']=_0x224eef[_0x73bb('0x36')][_0x73bb('0x39')]?_0x224eef[_0x73bb('0x36')]:_0x243dec[_0x73bb('0x31')];if(_0x3b4b43['query'][_0x73bb('0x49')]){_0x224eef['include']=[{'all':!![]}];}_0x224eef=_[_0x73bb('0x40')]({},_0x224eef,_0x3b4b43['options']);return db[_0x73bb('0x2d')][_0x73bb('0x4a')](_0x224eef)['then'](handleEntityNotFound(_0x163eef,null))['then'](respondWithResult(_0x163eef,null))[_0x73bb('0x46')](handleError(_0x163eef,null));};exports['create']=function(_0x3b5ad6,_0x543f33){return db[_0x73bb('0x2d')][_0x73bb('0x4b')](_0x3b5ad6[_0x73bb('0x4c')],{})[_0x73bb('0x27')](respondWithResult(_0x543f33,0xc9))[_0x73bb('0x46')](handleError(_0x543f33,null));};exports[_0x73bb('0x26')]=function(_0x5daa5b,_0x2b3028){if(_0x5daa5b[_0x73bb('0x4c')]['id']){delete _0x5daa5b[_0x73bb('0x4c')]['id'];}return db[_0x73bb('0x2d')]['find']({'where':{'id':_0x5daa5b[_0x73bb('0x48')]['id']}})[_0x73bb('0x27')](handleEntityNotFound(_0x2b3028,null))[_0x73bb('0x27')](saveUpdates(_0x5daa5b['body'],null))[_0x73bb('0x27')](respondWithResult(_0x2b3028,null))[_0x73bb('0x46')](handleError(_0x2b3028,null));};exports['destroy']=function(_0x2ba301,_0x2d9197){return db[_0x73bb('0x2d')][_0x73bb('0x4a')]({'where':{'id':_0x2ba301[_0x73bb('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d9197,null))[_0x73bb('0x27')](removeEntity(_0x2d9197,null))[_0x73bb('0x46')](handleError(_0x2d9197,null));};
\ No newline at end of file
+var _0xde25=['ZohoField','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','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','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map'];(function(_0x57f9cc,_0xcac1c0){var _0x3395a7=function(_0x6cc95b){while(--_0x6cc95b){_0x57f9cc['push'](_0x57f9cc['shift']());}};_0x3395a7(++_0xcac1c0);}(_0xde25,0x104));var _0x5de2=function(_0x4a000f,_0x451ee9){_0x4a000f=_0x4a000f-0x0;var _0x760128=_0xde25[_0x4a000f];return _0x760128;};'use strict';var emlformat=require(_0x5de2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5de2('0x1'));var jsonpatch=require(_0x5de2('0x2'));var rp=require(_0x5de2('0x3'));var moment=require(_0x5de2('0x4'));var BPromise=require(_0x5de2('0x5'));var Mustache=require('mustache');var util=require(_0x5de2('0x6'));var path=require(_0x5de2('0x7'));var sox=require(_0x5de2('0x8'));var csv=require('to-csv');var ejs=require(_0x5de2('0x9'));var fs=require('fs');var fs_extra=require(_0x5de2('0xa'));var _=require('lodash');var squel=require(_0x5de2('0xb'));var crypto=require(_0x5de2('0xc'));var jsforce=require(_0x5de2('0xd'));var deskjs=require(_0x5de2('0xe'));var toCsv=require(_0x5de2('0xf'));var querystring=require(_0x5de2('0x10'));var Papa=require('papaparse');var Redis=require(_0x5de2('0x11'));var authService=require(_0x5de2('0x12'));var qs=require(_0x5de2('0x13'));var as=require(_0x5de2('0x14'));var hardwareService=require(_0x5de2('0x15'));var logger=require(_0x5de2('0x16'))(_0x5de2('0x17'));var utils=require(_0x5de2('0x18'));var config=require(_0x5de2('0x19'));var licenseUtil=require(_0x5de2('0x1a'));var db=require(_0x5de2('0x1b'))['db'];function respondWithStatusCode(_0x58bfbd,_0x6c5de3){_0x6c5de3=_0x6c5de3||0xcc;return function(_0x2c7eda){if(_0x2c7eda){return _0x58bfbd[_0x5de2('0x1c')](_0x6c5de3);}return _0x58bfbd[_0x5de2('0x1d')](_0x6c5de3)['end']();};}function respondWithResult(_0x80d69c,_0x57a1a3){_0x57a1a3=_0x57a1a3||0xc8;return function(_0x47966c){if(_0x47966c){return _0x80d69c['status'](_0x57a1a3)[_0x5de2('0x1e')](_0x47966c);}};}function respondWithFilteredResult(_0x449ce5,_0x4fd670){return function(_0xf66d43){if(_0xf66d43){var _0xabfc1d=typeof _0x4fd670[_0x5de2('0x1f')]===_0x5de2('0x20')&&typeof _0x4fd670[_0x5de2('0x21')]===_0x5de2('0x20');var _0x29101e=_0xf66d43[_0x5de2('0x22')];var _0x9da57e=_0xabfc1d?0x0:_0x4fd670[_0x5de2('0x1f')];var _0x206cae=_0xabfc1d?_0xf66d43['count']:_0x4fd670[_0x5de2('0x1f')]+_0x4fd670[_0x5de2('0x21')];var _0xb54f2b;if(_0x206cae>=_0x29101e){_0x206cae=_0x29101e;_0xb54f2b=0xc8;}else{_0xb54f2b=0xce;}_0x449ce5['status'](_0xb54f2b);return _0x449ce5['set'](_0x5de2('0x23'),_0x9da57e+'-'+_0x206cae+'/'+_0x29101e)[_0x5de2('0x1e')](_0xf66d43);}return null;};}function patchUpdates(_0x348ce0){return function(_0x20b793){try{jsonpatch[_0x5de2('0x24')](_0x20b793,_0x348ce0,!![]);}catch(_0x29de00){return BPromise[_0x5de2('0x25')](_0x29de00);}return _0x20b793[_0x5de2('0x26')]();};}function saveUpdates(_0x4661a1,_0x3504d4){return function(_0x6dd901){if(_0x6dd901){return _0x6dd901[_0x5de2('0x27')](_0x4661a1)[_0x5de2('0x28')](function(_0xb989aa){return _0xb989aa;});}return null;};}function removeEntity(_0x42481c,_0x3a4cfa){return function(_0x27e99b){if(_0x27e99b){return _0x27e99b[_0x5de2('0x29')]()[_0x5de2('0x28')](function(){_0x42481c[_0x5de2('0x1d')](0xcc)[_0x5de2('0x2a')]();});}};}function handleEntityNotFound(_0x5ab839,_0x4a4a1d){return function(_0x1be7a3){if(!_0x1be7a3){_0x5ab839[_0x5de2('0x1c')](0x194);}return _0x1be7a3;};}function handleError(_0x395fc2,_0x570403){_0x570403=_0x570403||0x1f4;return function(_0x552c1e){logger[_0x5de2('0x2b')](_0x552c1e[_0x5de2('0x2c')]);if(_0x552c1e[_0x5de2('0x2d')]){delete _0x552c1e['name'];}_0x395fc2['status'](_0x570403)[_0x5de2('0x2e')](_0x552c1e);};}exports['index']=function(_0x257a13,_0x5cae66){var _0x5b6e9c={},_0x1080f5={},_0x27b220={'count':0x0,'rows':[]};var _0x1bb756=_[_0x5de2('0x2f')](db[_0x5de2('0x30')][_0x5de2('0x31')],function(_0x2190b6){return{'name':_0x2190b6[_0x5de2('0x32')],'type':_0x2190b6[_0x5de2('0x33')]['key']};});_0x1080f5[_0x5de2('0x34')]=_[_0x5de2('0x2f')](_0x1bb756,_0x5de2('0x2d'));_0x1080f5['query']=_[_0x5de2('0x35')](_0x257a13['query']);_0x1080f5[_0x5de2('0x36')]=_[_0x5de2('0x37')](_0x1080f5[_0x5de2('0x34')],_0x1080f5[_0x5de2('0x38')]);_0x5b6e9c[_0x5de2('0x39')]=_[_0x5de2('0x37')](_0x1080f5[_0x5de2('0x34')],qs[_0x5de2('0x3a')](_0x257a13[_0x5de2('0x38')][_0x5de2('0x3a')]));_0x5b6e9c['attributes']=_0x5b6e9c[_0x5de2('0x39')][_0x5de2('0x3b')]?_0x5b6e9c['attributes']:_0x1080f5[_0x5de2('0x34')];if(!_0x257a13['query']['hasOwnProperty'](_0x5de2('0x3c'))){_0x5b6e9c[_0x5de2('0x21')]=qs[_0x5de2('0x21')](_0x257a13[_0x5de2('0x38')][_0x5de2('0x21')]);_0x5b6e9c[_0x5de2('0x1f')]=qs[_0x5de2('0x1f')](_0x257a13[_0x5de2('0x38')]['offset']);}_0x5b6e9c[_0x5de2('0x3d')]=qs[_0x5de2('0x3e')](_0x257a13[_0x5de2('0x38')][_0x5de2('0x3e')]);_0x5b6e9c[_0x5de2('0x3f')]=qs['filters'](_['pick'](_0x257a13[_0x5de2('0x38')],_0x1080f5[_0x5de2('0x36')]),_0x1bb756);if(_0x257a13[_0x5de2('0x38')]['filter']){_0x5b6e9c['where']=_['merge'](_0x5b6e9c[_0x5de2('0x3f')],{'$or':_[_0x5de2('0x2f')](_0x1bb756,function(_0x1eb781){if(_0x1eb781['type']!==_0x5de2('0x40')){var _0x1afd5c={};_0x1afd5c[_0x1eb781[_0x5de2('0x2d')]]={'$like':'%'+_0x257a13[_0x5de2('0x38')][_0x5de2('0x41')]+'%'};return _0x1afd5c;}})});}_0x5b6e9c=_[_0x5de2('0x42')]({},_0x5b6e9c,_0x257a13[_0x5de2('0x43')]);var _0x4427d7={'where':_0x5b6e9c['where']};return db[_0x5de2('0x30')][_0x5de2('0x22')](_0x4427d7)[_0x5de2('0x28')](function(_0x3a82c4){_0x27b220[_0x5de2('0x22')]=_0x3a82c4;if(_0x257a13[_0x5de2('0x38')]['includeAll']){_0x5b6e9c[_0x5de2('0x44')]=[{'all':!![]}];}return db[_0x5de2('0x30')][_0x5de2('0x45')](_0x5b6e9c);})[_0x5de2('0x28')](function(_0x3f1e5a){_0x27b220[_0x5de2('0x46')]=_0x3f1e5a;return _0x27b220;})[_0x5de2('0x28')](respondWithFilteredResult(_0x5cae66,_0x5b6e9c))[_0x5de2('0x47')](handleError(_0x5cae66,null));};exports[_0x5de2('0x48')]=function(_0xbc0372,_0x50969f){var _0x433ef8={'raw':!![],'where':{'id':_0xbc0372[_0x5de2('0x49')]['id']}},_0x24532e={};_0x24532e['model']=_['keys'](db['ZohoField'][_0x5de2('0x31')]);_0x24532e[_0x5de2('0x38')]=_[_0x5de2('0x35')](_0xbc0372[_0x5de2('0x38')]);_0x24532e[_0x5de2('0x36')]=_['intersection'](_0x24532e[_0x5de2('0x34')],_0x24532e['query']);_0x433ef8['attributes']=_[_0x5de2('0x37')](_0x24532e[_0x5de2('0x34')],qs['fields'](_0xbc0372[_0x5de2('0x38')]['fields']));_0x433ef8[_0x5de2('0x39')]=_0x433ef8[_0x5de2('0x39')][_0x5de2('0x3b')]?_0x433ef8[_0x5de2('0x39')]:_0x24532e[_0x5de2('0x34')];if(_0xbc0372[_0x5de2('0x38')]['includeAll']){_0x433ef8['include']=[{'all':!![]}];}_0x433ef8=_[_0x5de2('0x42')]({},_0x433ef8,_0xbc0372[_0x5de2('0x43')]);return db[_0x5de2('0x30')][_0x5de2('0x4a')](_0x433ef8)[_0x5de2('0x28')](handleEntityNotFound(_0x50969f,null))[_0x5de2('0x28')](respondWithResult(_0x50969f,null))[_0x5de2('0x47')](handleError(_0x50969f,null));};exports['create']=function(_0x3d4917,_0x9ac9){return db[_0x5de2('0x30')][_0x5de2('0x4b')](_0x3d4917[_0x5de2('0x4c')],{})[_0x5de2('0x28')](respondWithResult(_0x9ac9,0xc9))[_0x5de2('0x47')](handleError(_0x9ac9,null));};exports[_0x5de2('0x27')]=function(_0x2031ee,_0x296f06){if(_0x2031ee['body']['id']){delete _0x2031ee['body']['id'];}return db[_0x5de2('0x30')]['find']({'where':{'id':_0x2031ee[_0x5de2('0x49')]['id']}})[_0x5de2('0x28')](handleEntityNotFound(_0x296f06,null))[_0x5de2('0x28')](saveUpdates(_0x2031ee[_0x5de2('0x4c')],null))['then'](respondWithResult(_0x296f06,null))['catch'](handleError(_0x296f06,null));};exports[_0x5de2('0x29')]=function(_0x387619,_0x582094){return db[_0x5de2('0x30')]['find']({'where':{'id':_0x387619[_0x5de2('0x49')]['id']}})['then'](handleEntityNotFound(_0x582094,null))[_0x5de2('0x28')](removeEntity(_0x582094,null))[_0x5de2('0x47')](handleError(_0x582094,null));};
\ No newline at end of file
index 74b45f6..0e56e0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x230f57,_0x8049af){var _0x50224f=function(_0x28c642){while(--_0x28c642){_0x230f57['push'](_0x230f57['shift']());}};_0x50224f(++_0x8049af);}(_0x187d,0x93));var _0xd187=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x187d[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xd'),_0xd187('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6343=['../../config/logger','api','rimraf','../../config/environment','exports','define','ZohoField','idField','FieldId'];(function(_0x2976bb,_0x5c5add){var _0x26c340=function(_0x2a3d59){while(--_0x2a3d59){_0x2976bb['push'](_0x2976bb['shift']());}};_0x26c340(++_0x5c5add);}(_0x6343,0x168));var _0x3634=function(_0x2e2283,_0x18f18c){_0x2e2283=_0x2e2283-0x0;var _0x52e7da=_0x6343[_0x2e2283];return _0x52e7da;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3634('0x0'))(_0x3634('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var attributes=require('./intZohoField.attributes');module[_0x3634('0x4')]=function(_0x388c18,_0x4bb496){return _0x388c18[_0x3634('0x5')](_0x3634('0x6'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x3634('0x7'),_0x3634('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index bc802f0..7325b2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6518=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x6518,0x99));var _0x8651=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x6518[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x8651('0x0'));var util=require(_0x8651('0x1'));var moment=require(_0x8651('0x2'));var BPromise=require(_0x8651('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8651('0x4'));var db=require(_0x8651('0x5'))['db'];var utils=require(_0x8651('0x6'));var logger=require('../../config/logger')(_0x8651('0x7'));var config=require(_0x8651('0x8'));var jayson=require(_0x8651('0x9'));var client=jayson['client'][_0x8651('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x132dc4,_0x1ac190,_0x5f0d10){return new BPromise(function(_0x4a3d19,_0x44dc1c){return client[_0x8651('0xb')](_0x132dc4,_0x5f0d10)[_0x8651('0xc')](function(_0xd63401){logger[_0x8651('0xd')](_0x8651('0xe'),_0x1ac190,_0x8651('0xf'));logger['debug'](_0x8651('0x10'),_0x1ac190,_0x8651('0xf'),JSON[_0x8651('0x11')](_0xd63401));if(_0xd63401[_0x8651('0x12')]){if(_0xd63401[_0x8651('0x12')]['code']===0x1f4){logger[_0x8651('0x12')](_0x8651('0xe'),_0x1ac190,_0xd63401[_0x8651('0x12')]['message']);return _0x44dc1c(_0xd63401['error'][_0x8651('0x13')]);}logger['error'](_0x8651('0xe'),_0x1ac190,_0xd63401[_0x8651('0x12')][_0x8651('0x13')]);return _0x4a3d19(_0xd63401[_0x8651('0x12')][_0x8651('0x13')]);}else{logger[_0x8651('0xd')](_0x8651('0xe'),_0x1ac190,_0x8651('0xf'));_0x4a3d19(_0xd63401[_0x8651('0x14')][_0x8651('0x13')]);}})[_0x8651('0x15')](function(_0x1a4f80){logger[_0x8651('0x12')](_0x8651('0xe'),_0x1ac190,_0x1a4f80);_0x44dc1c(_0x1a4f80);});});}
\ No newline at end of file
+var _0x4700=['code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4ae5bb,_0x485f23){var _0x20df53=function(_0x5e4083){while(--_0x5e4083){_0x4ae5bb['push'](_0x4ae5bb['shift']());}};_0x20df53(++_0x485f23);}(_0x4700,0x10d));var _0x0470=function(_0x2ca302,_0x544c63){_0x2ca302=_0x2ca302-0x0;var _0x16c79d=_0x4700[_0x2ca302];return _0x16c79d;};'use strict';var _=require(_0x0470('0x0'));var util=require('util');var moment=require(_0x0470('0x1'));var BPromise=require(_0x0470('0x2'));var rs=require(_0x0470('0x3'));var fs=require('fs');var Redis=require(_0x0470('0x4'));var db=require(_0x0470('0x5'))['db'];var utils=require(_0x0470('0x6'));var logger=require(_0x0470('0x7'))(_0x0470('0x8'));var config=require('../../config/environment');var jayson=require(_0x0470('0x9'));var client=jayson['client'][_0x0470('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x230aa9,_0x193a8e,_0x19d91b){return new BPromise(function(_0x416feb,_0x271ab1){return client['request'](_0x230aa9,_0x19d91b)['then'](function(_0x28034b){logger['info'](_0x0470('0xb'),_0x193a8e,'request\x20sent');logger[_0x0470('0xc')](_0x0470('0xd'),_0x193a8e,_0x0470('0xe'),JSON[_0x0470('0xf')](_0x28034b));if(_0x28034b[_0x0470('0x10')]){if(_0x28034b[_0x0470('0x10')][_0x0470('0x11')]===0x1f4){logger[_0x0470('0x10')]('ZohoField,\x20%s,\x20%s',_0x193a8e,_0x28034b[_0x0470('0x10')][_0x0470('0x12')]);return _0x271ab1(_0x28034b[_0x0470('0x10')][_0x0470('0x12')]);}logger['error'](_0x0470('0xb'),_0x193a8e,_0x28034b[_0x0470('0x10')]['message']);return _0x416feb(_0x28034b[_0x0470('0x10')][_0x0470('0x12')]);}else{logger[_0x0470('0x13')](_0x0470('0xb'),_0x193a8e,_0x0470('0xe'));_0x416feb(_0x28034b[_0x0470('0x14')][_0x0470('0x12')]);}})[_0x0470('0x15')](function(_0x3b3074){logger[_0x0470('0x10')]('ZohoField,\x20%s,\x20%s',_0x193a8e,_0x3b3074);_0x271ab1(_0x3b3074);});});}
\ No newline at end of file
index ebcee53..5e962b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4f85e6,_0x1938b7){var _0x4c4c15=function(_0x4552e7){while(--_0x4552e7){_0x4f85e6['push'](_0x4f85e6['shift']());}};_0x4c4c15(++_0x1938b7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x307f55,_0x4910aa){var _0x3b13d0=function(_0x348d60){while(--_0x348d60){_0x307f55['push'](_0x307f55['shift']());}};_0x3b13d0(++_0x4910aa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index a838f4c..69f4e90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33d0=['unique_name_and_version','INTEGER','state','sequelize','STRING'];(function(_0x526a96,_0x4655de){var _0x3bf235=function(_0x1dc8c9){while(--_0x1dc8c9){_0x526a96['push'](_0x526a96['shift']());}};_0x3bf235(++_0x4655de);}(_0x33d0,0x99));var _0x033d=function(_0x2cb860,_0x2ab949){_0x2cb860=_0x2cb860-0x0;var _0x35c787=_0x33d0[_0x2cb860];return _0x35c787;};'use strict';var Sequelize=require(_0x033d('0x0'));module['exports']={'name':{'type':Sequelize[_0x033d('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x033d('0x2')},'main':{'type':Sequelize[_0x033d('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x033d('0x1')]},'type':{'type':Sequelize[_0x033d('0x1')]},'size':{'type':Sequelize[_0x033d('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x033d('0x1')]},'state':{'type':Sequelize[_0x033d('0x1')],'unique':_0x033d('0x4')},'description':{'type':Sequelize[_0x033d('0x1')]},'title':{'type':Sequelize[_0x033d('0x1')]},'remoteUri':{'type':Sequelize[_0x033d('0x1')]},'link':{'type':Sequelize[_0x033d('0x1')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xfc81=['unique_name_and_version','INTEGER','BOOLEAN','state','exports','STRING'];(function(_0x127ba9,_0x2cc04d){var _0x29e63d=function(_0xa1f975){while(--_0xa1f975){_0x127ba9['push'](_0x127ba9['shift']());}};_0x29e63d(++_0x2cc04d);}(_0xfc81,0x88));var _0x1fc8=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0xfc81[_0x20118a];return _0x538b5f;};'use strict';var Sequelize=require('sequelize');module[_0x1fc8('0x0')]={'name':{'type':Sequelize[_0x1fc8('0x1')],'allowNull':![],'unique':_0x1fc8('0x2')},'version':{'type':Sequelize[_0x1fc8('0x1')],'allowNull':![],'unique':_0x1fc8('0x2')},'main':{'type':Sequelize[_0x1fc8('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x1fc8('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1fc8('0x1')]},'size':{'type':Sequelize[_0x1fc8('0x3')]},'active':{'type':Sequelize[_0x1fc8('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x1fc8('0x1')]},'logo':{'type':Sequelize[_0x1fc8('0x1')]},'state':{'type':Sequelize[_0x1fc8('0x1')],'unique':_0x1fc8('0x5')},'description':{'type':Sequelize[_0x1fc8('0x1')]},'title':{'type':Sequelize[_0x1fc8('0x1')]},'remoteUri':{'type':Sequelize[_0x1fc8('0x1')]},'link':{'type':Sequelize[_0x1fc8('0x1')],'defaultValue':'#'}};
\ No newline at end of file
index f4f70f4..90c424c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit'];(function(_0x527890,_0x40c9da){var _0xc656b8=function(_0x5c6811){while(--_0x5c6811){_0x527890['push'](_0x527890['shift']());}};_0xc656b8(++_0x40c9da);}(_0x7880,0x1f4));var _0x0788=function(_0x3230ab,_0x46eac4){_0x3230ab=_0x3230ab-0x0;var _0x486975=_0x7880[_0x3230ab];return _0x486975;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['Integration'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};
\ No newline at end of file
+var _0x71ab=['query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','Integration','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key'];(function(_0x31f7c5,_0x3bf428){var _0x19fabc=function(_0x268080){while(--_0x268080){_0x31f7c5['push'](_0x31f7c5['shift']());}};_0x19fabc(++_0x3bf428);}(_0x71ab,0x64));var _0xb71a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x71ab[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['Integration']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['Integration']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['Integration'][_0xb71a('0x47')](_0x1f29b7[_0xb71a('0x48')],{})[_0xb71a('0x24')](respondWithResult(_0x365bed,0xc9))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports['update']=function(_0x48fbde,_0x23b4c0){if(_0x48fbde[_0xb71a('0x48')]['id']){delete _0x48fbde[_0xb71a('0x48')]['id'];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'id':_0x48fbde[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x23b4c0,null))[_0xb71a('0x24')](saveUpdates(_0x48fbde[_0xb71a('0x48')],null))[_0xb71a('0x24')](respondWithResult(_0x23b4c0,null))['catch'](handleError(_0x23b4c0,null));};exports[_0xb71a('0x25')]=function(_0x2ce711,_0x500196){return db[_0xb71a('0x3f')]['find']({'where':{'id':_0x2ce711[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x500196,null))[_0xb71a('0x24')](removeEntity(_0x500196,null))[_0xb71a('0x42')](handleError(_0x500196,null));};
\ No newline at end of file
index fe45b83..9c355a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2e7=['exports','integrations','api','moment','request-promise','rimraf','../../config/environment','./integration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2e7,0x11a));var _0x7b2e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb2e7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7b2e('0x0'));var moment=require(_0x7b2e('0x1'));var BPromise=require('bluebird');var rp=require(_0x7b2e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b2e('0x3'));var config=require(_0x7b2e('0x4'));var attributes=require(_0x7b2e('0x5'));module[_0x7b2e('0x6')]=function(_0x1c91d4,_0x49a034){return _0x1c91d4['define']('Integration',attributes,{'tableName':_0x7b2e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6db3=['rimraf','./integration.attributes','exports','api','moment','bluebird','request-promise'];(function(_0x5bc251,_0x5c4317){var _0x318d40=function(_0x3c9e1f){while(--_0x3c9e1f){_0x5bc251['push'](_0x5bc251['shift']());}};_0x318d40(++_0x5c4317);}(_0x6db3,0x1e6));var _0x36db=function(_0x1058ed,_0x109d8d){_0x1058ed=_0x1058ed-0x0;var _0x4e4661=_0x6db3[_0x1058ed];return _0x4e4661;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x36db('0x0'));var moment=require(_0x36db('0x1'));var BPromise=require(_0x36db('0x2'));var rp=require(_0x36db('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36db('0x4'));var config=require('../../config/environment');var attributes=require(_0x36db('0x5'));module[_0x36db('0x6')]=function(_0x9bd503,_0x4abb68){return _0x9bd503['define']('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d06cc9d..228acd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x1bafc4,_0x37d142){var _0x3169a6=function(_0x2709b2){while(--_0x2709b2){_0x1bafc4['push'](_0x1bafc4['shift']());}};_0x3169a6(++_0x37d142);}(_0xba34,0x119));var _0x4ba3=function(_0x48baa7,_0x44576e){_0x48baa7=_0x48baa7-0x0;var _0x42af21=_0xba34[_0x48baa7];return _0x42af21;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});}
\ No newline at end of file
+var _0x6d38=['request','then','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xa0216b,_0x941488){var _0xcb483=function(_0x5717e3){while(--_0x5717e3){_0xa0216b['push'](_0xa0216b['shift']());}};_0xcb483(++_0x941488);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6d38[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});}
\ No newline at end of file
index 8010319..215ad2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0xf1c736,_0x4cfdf5){var _0x1d73bd=function(_0x10fffb){while(--_0x10fffb){_0xf1c736['push'](_0xf1c736['shift']());}};_0x1d73bd(++_0x4cfdf5);}(_0x2542,0x169));var _0x2254=function(_0x4aeaee,_0x23ea6b){_0x4aeaee=_0x4aeaee-0x0;var _0x2a5ebe=_0x2542[_0x4aeaee];return _0x2a5ebe;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router;
\ No newline at end of file
+var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x5bf6e5,_0x43062d){var _0x429dbb=function(_0x44a789){while(--_0x44a789){_0x5bf6e5['push'](_0x5bf6e5['shift']());}};_0x429dbb(++_0x43062d);}(_0x7880,0x1f4));var _0x0788=function(_0x5023cb,_0x5ae9a6){_0x5023cb=_0x5023cb-0x0;var _0x52c5d6=_0x7880[_0x5023cb];return _0x52c5d6;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router;
\ No newline at end of file
index 2e9c1fb..0272433 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8327=['RECEIVED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x26456c,_0x496417){var _0x2494c7=function(_0xfdfad){while(--_0xfdfad){_0x26456c['push'](_0x26456c['shift']());}};_0x2494c7(++_0x496417);}(_0x8327,0x123));var _0x7832=function(_0x4226c4,_0x4897da){_0x4226c4=_0x4226c4-0x0;var _0x31fde0=_0x8327[_0x4226c4];return _0x31fde0;};'use strict';var Sequelize=require(_0x7832('0x0'));module[_0x7832('0x1')]={'integration':{'type':Sequelize[_0x7832('0x2')]},'eventChannel':{'type':Sequelize[_0x7832('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x7832('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x7832('0x2')]},'uniqueid':{'type':Sequelize[_0x7832('0x2')]},'calleridnum':{'type':Sequelize[_0x7832('0x2')]},'calleridname':{'type':Sequelize[_0x7832('0x2')]},'queue':{'type':Sequelize[_0x7832('0x2')]},'interface':{'type':Sequelize[_0x7832('0x2')]},'membername':{'type':Sequelize[_0x7832('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x7832('0x3')]},'holdtime':{'type':Sequelize[_0x7832('0x4')]},'agentcomplete':{'type':Sequelize[_0x7832('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x7832('0x4')]},'agentacw':{'type':Sequelize[_0x7832('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7832('0x4')]},'reason':{'type':Sequelize[_0x7832('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x7832('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7832('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x7832('0x2')]},'channel':{'type':Sequelize[_0x7832('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7832('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7832('0x2')]},'connectedlinename':{'type':Sequelize[_0x7832('0x2')]},'language':{'type':Sequelize[_0x7832('0x2')]},'accountcode':{'type':Sequelize[_0x7832('0x2')]},'context':{'type':Sequelize[_0x7832('0x2')]},'exten':{'type':Sequelize[_0x7832('0x2')]},'priority':{'type':Sequelize[_0x7832('0x2')]},'destchannel':{'type':Sequelize[_0x7832('0x2')]},'destchannelstate':{'type':Sequelize[_0x7832('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x7832('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7832('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7832('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7832('0x2')]},'destcontext':{'type':Sequelize[_0x7832('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7832('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x7832('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x7832('0x2')]},'from':{'type':Sequelize[_0x7832('0x2')]},'to':{'type':Sequelize[_0x7832('0x2')]},'cc':{'type':Sequelize[_0x7832('0x2')]},'attachment':{'type':Sequelize[_0x7832('0x6')]},'html':{'type':Sequelize[_0x7832('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x7832('0x7')](_0x7832('0x8'),'SENDING',_0x7832('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x7832('0x2')]},'appdata':{'type':Sequelize[_0x7832('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xcad3=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x251c55,_0x315c4f){var _0x2f8000=function(_0x5747cc){while(--_0x5747cc){_0x251c55['push'](_0x251c55['shift']());}};_0x2f8000(++_0x315c4f);}(_0xcad3,0x13a));var _0x3cad=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0xcad3[_0x5976f8];return _0x179715;};'use strict';var Sequelize=require('sequelize');module[_0x3cad('0x0')]={'integration':{'type':Sequelize[_0x3cad('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x3cad('0x1')]},'ticketId':{'type':Sequelize[_0x3cad('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3cad('0x1')]},'calleridnum':{'type':Sequelize[_0x3cad('0x1')]},'calleridname':{'type':Sequelize[_0x3cad('0x1')]},'queue':{'type':Sequelize[_0x3cad('0x1')]},'interface':{'type':Sequelize[_0x3cad('0x1')]},'membername':{'type':Sequelize[_0x3cad('0x1')]},'agentcalledAt':{'type':Sequelize[_0x3cad('0x2')]},'agentconnectAt':{'type':Sequelize[_0x3cad('0x2')]},'holdtime':{'type':Sequelize[_0x3cad('0x3')]},'agentcomplete':{'type':Sequelize[_0x3cad('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3cad('0x2')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x3cad('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3cad('0x3')]},'reason':{'type':Sequelize[_0x3cad('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3cad('0x2')]},'agentdump':{'type':Sequelize[_0x3cad('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3cad('0x2')]},'lastevent':{'type':Sequelize[_0x3cad('0x1')]},'channel':{'type':Sequelize[_0x3cad('0x1')]},'channelstate':{'type':Sequelize[_0x3cad('0x3')]},'channelstatedesc':{'type':Sequelize[_0x3cad('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3cad('0x1')]},'connectedlinename':{'type':Sequelize[_0x3cad('0x1')]},'language':{'type':Sequelize[_0x3cad('0x1')]},'accountcode':{'type':Sequelize[_0x3cad('0x1')]},'context':{'type':Sequelize[_0x3cad('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x3cad('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x3cad('0x1')]},'destcalleridnum':{'type':Sequelize[_0x3cad('0x1')]},'destcalleridname':{'type':Sequelize[_0x3cad('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x3cad('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3cad('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x3cad('0x1')]},'destcontext':{'type':Sequelize[_0x3cad('0x1')]},'destexten':{'type':Sequelize[_0x3cad('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x3cad('0x1')]},'messageId':{'type':Sequelize[_0x3cad('0x1')]},'inReplyTo':{'type':Sequelize[_0x3cad('0x1')]},'subject':{'type':Sequelize[_0x3cad('0x1')]},'from':{'type':Sequelize[_0x3cad('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x3cad('0x1')]},'attachment':{'type':Sequelize[_0x3cad('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x3cad('0x5')]},'status':{'type':Sequelize[_0x3cad('0x6')](_0x3cad('0x7'),_0x3cad('0x8'),_0x3cad('0x9'),_0x3cad('0xa'))},'url':{'type':Sequelize[_0x3cad('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x3cad('0x1')]},'projectId':{'type':Sequelize[_0x3cad('0x3')]}};
\ No newline at end of file
index 09b62d9..813a13e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fcd=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','params','fields','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x2fcd,0xdc));var _0xd2fc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2fcd[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd2fc('0x0'));var zipdir=require(_0xd2fc('0x1'));var jsonpatch=require(_0xd2fc('0x2'));var rp=require(_0xd2fc('0x3'));var moment=require(_0xd2fc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd2fc('0x5'));var util=require(_0xd2fc('0x6'));var path=require('path');var sox=require(_0xd2fc('0x7'));var csv=require(_0xd2fc('0x8'));var ejs=require(_0xd2fc('0x9'));var fs=require('fs');var fs_extra=require(_0xd2fc('0xa'));var _=require('lodash');var squel=require(_0xd2fc('0xb'));var crypto=require(_0xd2fc('0xc'));var jsforce=require(_0xd2fc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd2fc('0x8'));var querystring=require(_0xd2fc('0xe'));var Papa=require(_0xd2fc('0xf'));var Redis=require(_0xd2fc('0x10'));var authService=require(_0xd2fc('0x11'));var qs=require(_0xd2fc('0x12'));var as=require(_0xd2fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2fc('0x14'))('api');var utils=require(_0xd2fc('0x15'));var config=require(_0xd2fc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2fc('0x17'))['db'];function respondWithStatusCode(_0x284756,_0x108e39){_0x108e39=_0x108e39||0xcc;return function(_0x332017){if(_0x332017){return _0x284756[_0xd2fc('0x18')](_0x108e39);}return _0x284756[_0xd2fc('0x19')](_0x108e39)['end']();};}function respondWithResult(_0x9e31f4,_0x176604){_0x176604=_0x176604||0xc8;return function(_0x372a2a){if(_0x372a2a){return _0x9e31f4[_0xd2fc('0x19')](_0x176604)[_0xd2fc('0x1a')](_0x372a2a);}};}function respondWithFilteredResult(_0x549be7,_0x288c75){return function(_0x5506ac){if(_0x5506ac){var _0x634f17=typeof _0x288c75[_0xd2fc('0x1b')]===_0xd2fc('0x1c')&&typeof _0x288c75[_0xd2fc('0x1d')]===_0xd2fc('0x1c');var _0xe0b4d5=_0x5506ac['count'];var _0x2e18b0=_0x634f17?0x0:_0x288c75[_0xd2fc('0x1b')];var _0x53d772=_0x634f17?_0x5506ac['count']:_0x288c75['offset']+_0x288c75[_0xd2fc('0x1d')];var _0x12292b;if(_0x53d772>=_0xe0b4d5){_0x53d772=_0xe0b4d5;_0x12292b=0xc8;}else{_0x12292b=0xce;}_0x549be7[_0xd2fc('0x19')](_0x12292b);return _0x549be7[_0xd2fc('0x1e')]('Content-Range',_0x2e18b0+'-'+_0x53d772+'/'+_0xe0b4d5)[_0xd2fc('0x1a')](_0x5506ac);}return null;};}function patchUpdates(_0x109b34){return function(_0x3d8425){try{jsonpatch[_0xd2fc('0x1f')](_0x3d8425,_0x109b34,!![]);}catch(_0x624a12){return BPromise[_0xd2fc('0x20')](_0x624a12);}return _0x3d8425[_0xd2fc('0x21')]();};}function saveUpdates(_0x435640,_0x55f4bd){return function(_0x4a3853){if(_0x4a3853){return _0x4a3853[_0xd2fc('0x22')](_0x435640)['then'](function(_0x24f211){return _0x24f211;});}return null;};}function removeEntity(_0x33bdb9,_0x60098c){return function(_0x3173c5){if(_0x3173c5){return _0x3173c5[_0xd2fc('0x23')]()[_0xd2fc('0x24')](function(){_0x33bdb9['status'](0xcc)[_0xd2fc('0x25')]();});}};}function handleEntityNotFound(_0x20545d,_0x578d62){return function(_0xcb3013){if(!_0xcb3013){_0x20545d[_0xd2fc('0x18')](0x194);}return _0xcb3013;};}function handleError(_0x1afe26,_0xd99f25){_0xd99f25=_0xd99f25||0x1f4;return function(_0x449ec0){logger[_0xd2fc('0x26')](_0x449ec0[_0xd2fc('0x27')]);if(_0x449ec0['name']){delete _0x449ec0[_0xd2fc('0x28')];}_0x1afe26['status'](_0xd99f25)[_0xd2fc('0x29')](_0x449ec0);};}exports[_0xd2fc('0x2a')]=function(_0x149b0d,_0x5d87c4){var _0x39b89a={},_0x3c244f={},_0x311e24={'count':0x0,'rows':[]};var _0x1d228b=_[_0xd2fc('0x2b')](db[_0xd2fc('0x2c')][_0xd2fc('0x2d')],function(_0x1d286f){return{'name':_0x1d286f[_0xd2fc('0x2e')],'type':_0x1d286f['type'][_0xd2fc('0x2f')]};});_0x3c244f['model']=_['map'](_0x1d228b,_0xd2fc('0x28'));_0x3c244f[_0xd2fc('0x30')]=_[_0xd2fc('0x31')](_0x149b0d[_0xd2fc('0x30')]);_0x3c244f[_0xd2fc('0x32')]=_[_0xd2fc('0x33')](_0x3c244f['model'],_0x3c244f[_0xd2fc('0x30')]);_0x39b89a['attributes']=_[_0xd2fc('0x33')](_0x3c244f[_0xd2fc('0x34')],qs['fields'](_0x149b0d[_0xd2fc('0x30')]['fields']));_0x39b89a['attributes']=_0x39b89a[_0xd2fc('0x35')]['length']?_0x39b89a['attributes']:_0x3c244f['model'];if(!_0x149b0d['query'][_0xd2fc('0x36')](_0xd2fc('0x37'))){_0x39b89a['limit']=qs[_0xd2fc('0x1d')](_0x149b0d[_0xd2fc('0x30')][_0xd2fc('0x1d')]);_0x39b89a[_0xd2fc('0x1b')]=qs[_0xd2fc('0x1b')](_0x149b0d['query'][_0xd2fc('0x1b')]);}_0x39b89a[_0xd2fc('0x38')]=qs[_0xd2fc('0x39')](_0x149b0d['query'][_0xd2fc('0x39')]);_0x39b89a[_0xd2fc('0x3a')]=qs[_0xd2fc('0x32')](_[_0xd2fc('0x3b')](_0x149b0d['query'],_0x3c244f[_0xd2fc('0x32')]),_0x1d228b);if(_0x149b0d[_0xd2fc('0x30')][_0xd2fc('0x3c')]){_0x39b89a[_0xd2fc('0x3a')]=_['merge'](_0x39b89a['where'],{'$or':_[_0xd2fc('0x2b')](_0x1d228b,function(_0x1373b8){if(_0x1373b8[_0xd2fc('0x3d')]!==_0xd2fc('0x3e')){var _0x51ca21={};_0x51ca21[_0x1373b8[_0xd2fc('0x28')]]={'$like':'%'+_0x149b0d['query']['filter']+'%'};return _0x51ca21;}})});}_0x39b89a=_[_0xd2fc('0x3f')]({},_0x39b89a,_0x149b0d[_0xd2fc('0x40')]);var _0x1871ea={'where':_0x39b89a[_0xd2fc('0x3a')]};return db['IntegrationReport'][_0xd2fc('0x41')](_0x1871ea)[_0xd2fc('0x24')](function(_0x46a0e0){_0x311e24[_0xd2fc('0x41')]=_0x46a0e0;if(_0x149b0d[_0xd2fc('0x30')][_0xd2fc('0x42')]){_0x39b89a[_0xd2fc('0x43')]=[{'all':!![]}];}return db[_0xd2fc('0x2c')][_0xd2fc('0x44')](_0x39b89a);})[_0xd2fc('0x24')](function(_0x4f7a1b){_0x311e24['rows']=_0x4f7a1b;return _0x311e24;})[_0xd2fc('0x24')](respondWithFilteredResult(_0x5d87c4,_0x39b89a))[_0xd2fc('0x45')](handleError(_0x5d87c4,null));};exports['show']=function(_0x5a0c53,_0x5e2d31){var _0x5297d2={'raw':![],'where':{'id':_0x5a0c53[_0xd2fc('0x46')]['id']}},_0x439cc4={};_0x439cc4[_0xd2fc('0x34')]=_[_0xd2fc('0x31')](db[_0xd2fc('0x2c')][_0xd2fc('0x2d')]);_0x439cc4[_0xd2fc('0x30')]=_[_0xd2fc('0x31')](_0x5a0c53['query']);_0x439cc4[_0xd2fc('0x32')]=_[_0xd2fc('0x33')](_0x439cc4[_0xd2fc('0x34')],_0x439cc4['query']);_0x5297d2[_0xd2fc('0x35')]=_[_0xd2fc('0x33')](_0x439cc4[_0xd2fc('0x34')],qs[_0xd2fc('0x47')](_0x5a0c53[_0xd2fc('0x30')][_0xd2fc('0x47')]));_0x5297d2[_0xd2fc('0x35')]=_0x5297d2[_0xd2fc('0x35')][_0xd2fc('0x48')]?_0x5297d2[_0xd2fc('0x35')]:_0x439cc4[_0xd2fc('0x34')];if(_0x5a0c53[_0xd2fc('0x30')]['includeAll']){_0x5297d2[_0xd2fc('0x43')]=[{'all':!![]}];}_0x5297d2=_[_0xd2fc('0x3f')]({},_0x5297d2,_0x5a0c53[_0xd2fc('0x40')]);return db[_0xd2fc('0x2c')][_0xd2fc('0x49')](_0x5297d2)[_0xd2fc('0x24')](handleEntityNotFound(_0x5e2d31,null))['then'](respondWithResult(_0x5e2d31,null))['catch'](handleError(_0x5e2d31,null));};exports['create']=function(_0x55b11b,_0x277576){return db[_0xd2fc('0x2c')][_0xd2fc('0x4a')](_0x55b11b['body'],{})['then'](respondWithResult(_0x277576,0xc9))[_0xd2fc('0x45')](handleError(_0x277576,null));};exports[_0xd2fc('0x22')]=function(_0x4a7364,_0x140ea9){if(_0x4a7364[_0xd2fc('0x4b')]['id']){delete _0x4a7364[_0xd2fc('0x4b')]['id'];}return db[_0xd2fc('0x2c')]['find']({'where':{'id':_0x4a7364[_0xd2fc('0x46')]['id']}})['then'](handleEntityNotFound(_0x140ea9,null))['then'](saveUpdates(_0x4a7364[_0xd2fc('0x4b')],null))['then'](respondWithResult(_0x140ea9,null))[_0xd2fc('0x45')](handleError(_0x140ea9,null));};exports[_0xd2fc('0x23')]=function(_0x1d7ad7,_0x252022){return db[_0xd2fc('0x2c')][_0xd2fc('0x49')]({'where':{'id':_0x1d7ad7[_0xd2fc('0x46')]['id']}})['then'](handleEntityNotFound(_0x252022,null))['then'](removeEntity(_0x252022,null))[_0xd2fc('0x45')](handleError(_0x252022,null));};exports[_0xd2fc('0x4c')]=function(_0x318b8c,_0x58aabd){return db['IntegrationReport'][_0xd2fc('0x4c')]()[_0xd2fc('0x24')](respondWithResult(_0x58aabd,null))[_0xd2fc('0x45')](handleError(_0x58aabd,null));};
\ No newline at end of file
+var _0xef3d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','stack','name','send','index','map','IntegrationReport','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x2aa785,_0x541b5b){var _0x1dc83c=function(_0x18e93a){while(--_0x18e93a){_0x2aa785['push'](_0x2aa785['shift']());}};_0x1dc83c(++_0x541b5b);}(_0xef3d,0x11f));var _0xdef3=function(_0x33efe7,_0x5b428a){_0x33efe7=_0x33efe7-0x0;var _0x402f82=_0xef3d[_0x33efe7];return _0x402f82;};'use strict';var emlformat=require(_0xdef3('0x0'));var rimraf=require(_0xdef3('0x1'));var zipdir=require(_0xdef3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdef3('0x3'));var moment=require(_0xdef3('0x4'));var BPromise=require(_0xdef3('0x5'));var Mustache=require(_0xdef3('0x6'));var util=require(_0xdef3('0x7'));var path=require(_0xdef3('0x8'));var sox=require(_0xdef3('0x9'));var csv=require(_0xdef3('0xa'));var ejs=require(_0xdef3('0xb'));var fs=require('fs');var fs_extra=require(_0xdef3('0xc'));var _=require('lodash');var squel=require(_0xdef3('0xd'));var crypto=require(_0xdef3('0xe'));var jsforce=require(_0xdef3('0xf'));var deskjs=require(_0xdef3('0x10'));var toCsv=require(_0xdef3('0xa'));var querystring=require('querystring');var Papa=require(_0xdef3('0x11'));var Redis=require(_0xdef3('0x12'));var authService=require(_0xdef3('0x13'));var qs=require(_0xdef3('0x14'));var as=require(_0xdef3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdef3('0x16'))(_0xdef3('0x17'));var utils=require(_0xdef3('0x18'));var config=require(_0xdef3('0x19'));var licenseUtil=require(_0xdef3('0x1a'));var db=require(_0xdef3('0x1b'))['db'];function respondWithStatusCode(_0x2ff92f,_0x16907f){_0x16907f=_0x16907f||0xcc;return function(_0xd15e1b){if(_0xd15e1b){return _0x2ff92f[_0xdef3('0x1c')](_0x16907f);}return _0x2ff92f[_0xdef3('0x1d')](_0x16907f)[_0xdef3('0x1e')]();};}function respondWithResult(_0x12d96d,_0x1d6c00){_0x1d6c00=_0x1d6c00||0xc8;return function(_0x50c0f1){if(_0x50c0f1){return _0x12d96d[_0xdef3('0x1d')](_0x1d6c00)[_0xdef3('0x1f')](_0x50c0f1);}};}function respondWithFilteredResult(_0x5edc45,_0x4aa981){return function(_0x55c925){if(_0x55c925){var _0x28ff2e=typeof _0x4aa981[_0xdef3('0x20')]===_0xdef3('0x21')&&typeof _0x4aa981[_0xdef3('0x22')]===_0xdef3('0x21');var _0x299e25=_0x55c925[_0xdef3('0x23')];var _0x410e38=_0x28ff2e?0x0:_0x4aa981['offset'];var _0x8e699a=_0x28ff2e?_0x55c925['count']:_0x4aa981['offset']+_0x4aa981[_0xdef3('0x22')];var _0x5df9cf;if(_0x8e699a>=_0x299e25){_0x8e699a=_0x299e25;_0x5df9cf=0xc8;}else{_0x5df9cf=0xce;}_0x5edc45[_0xdef3('0x1d')](_0x5df9cf);return _0x5edc45['set']('Content-Range',_0x410e38+'-'+_0x8e699a+'/'+_0x299e25)[_0xdef3('0x1f')](_0x55c925);}return null;};}function patchUpdates(_0x455fbc){return function(_0x7910cc){try{jsonpatch[_0xdef3('0x24')](_0x7910cc,_0x455fbc,!![]);}catch(_0x272fd8){return BPromise[_0xdef3('0x25')](_0x272fd8);}return _0x7910cc['save']();};}function saveUpdates(_0x4e139f,_0x3bc024){return function(_0x2f88da){if(_0x2f88da){return _0x2f88da[_0xdef3('0x26')](_0x4e139f)[_0xdef3('0x27')](function(_0x2e9ad7){return _0x2e9ad7;});}return null;};}function removeEntity(_0x154c66,_0x352675){return function(_0x414ef3){if(_0x414ef3){return _0x414ef3[_0xdef3('0x28')]()['then'](function(){_0x154c66[_0xdef3('0x1d')](0xcc)[_0xdef3('0x1e')]();});}};}function handleEntityNotFound(_0x1e3b5a,_0x1a4b7e){return function(_0x3b8d7a){if(!_0x3b8d7a){_0x1e3b5a[_0xdef3('0x1c')](0x194);}return _0x3b8d7a;};}function handleError(_0x45f2fd,_0x19fbfd){_0x19fbfd=_0x19fbfd||0x1f4;return function(_0xd09f08){logger['error'](_0xd09f08[_0xdef3('0x29')]);if(_0xd09f08[_0xdef3('0x2a')]){delete _0xd09f08[_0xdef3('0x2a')];}_0x45f2fd[_0xdef3('0x1d')](_0x19fbfd)[_0xdef3('0x2b')](_0xd09f08);};}exports[_0xdef3('0x2c')]=function(_0x52cb3d,_0x284b2e){var _0x21d337={},_0x158965={},_0x29ab41={'count':0x0,'rows':[]};var _0x40cd67=_[_0xdef3('0x2d')](db[_0xdef3('0x2e')]['rawAttributes'],function(_0xba4934){return{'name':_0xba4934['fieldName'],'type':_0xba4934['type'][_0xdef3('0x2f')]};});_0x158965[_0xdef3('0x30')]=_['map'](_0x40cd67,_0xdef3('0x2a'));_0x158965[_0xdef3('0x31')]=_[_0xdef3('0x32')](_0x52cb3d[_0xdef3('0x31')]);_0x158965[_0xdef3('0x33')]=_[_0xdef3('0x34')](_0x158965['model'],_0x158965['query']);_0x21d337[_0xdef3('0x35')]=_[_0xdef3('0x34')](_0x158965['model'],qs[_0xdef3('0x36')](_0x52cb3d[_0xdef3('0x31')][_0xdef3('0x36')]));_0x21d337[_0xdef3('0x35')]=_0x21d337['attributes'][_0xdef3('0x37')]?_0x21d337[_0xdef3('0x35')]:_0x158965['model'];if(!_0x52cb3d[_0xdef3('0x31')][_0xdef3('0x38')](_0xdef3('0x39'))){_0x21d337[_0xdef3('0x22')]=qs[_0xdef3('0x22')](_0x52cb3d[_0xdef3('0x31')]['limit']);_0x21d337[_0xdef3('0x20')]=qs[_0xdef3('0x20')](_0x52cb3d[_0xdef3('0x31')][_0xdef3('0x20')]);}_0x21d337['order']=qs['sort'](_0x52cb3d['query'][_0xdef3('0x3a')]);_0x21d337[_0xdef3('0x3b')]=qs[_0xdef3('0x33')](_['pick'](_0x52cb3d['query'],_0x158965[_0xdef3('0x33')]),_0x40cd67);if(_0x52cb3d['query'][_0xdef3('0x3c')]){_0x21d337['where']=_['merge'](_0x21d337[_0xdef3('0x3b')],{'$or':_[_0xdef3('0x2d')](_0x40cd67,function(_0x587a66){if(_0x587a66[_0xdef3('0x3d')]!==_0xdef3('0x3e')){var _0x22a51e={};_0x22a51e[_0x587a66['name']]={'$like':'%'+_0x52cb3d[_0xdef3('0x31')]['filter']+'%'};return _0x22a51e;}})});}_0x21d337=_[_0xdef3('0x3f')]({},_0x21d337,_0x52cb3d[_0xdef3('0x40')]);var _0x1f417f={'where':_0x21d337['where']};return db['IntegrationReport'][_0xdef3('0x23')](_0x1f417f)['then'](function(_0x1d3750){_0x29ab41['count']=_0x1d3750;if(_0x52cb3d['query']['includeAll']){_0x21d337[_0xdef3('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0xdef3('0x42')](_0x21d337);})[_0xdef3('0x27')](function(_0x157052){_0x29ab41[_0xdef3('0x43')]=_0x157052;return _0x29ab41;})[_0xdef3('0x27')](respondWithFilteredResult(_0x284b2e,_0x21d337))[_0xdef3('0x44')](handleError(_0x284b2e,null));};exports[_0xdef3('0x45')]=function(_0x513fe0,_0x514116){var _0x180183={'raw':![],'where':{'id':_0x513fe0['params']['id']}},_0x2ae5d3={};_0x2ae5d3['model']=_[_0xdef3('0x32')](db['IntegrationReport']['rawAttributes']);_0x2ae5d3['query']=_[_0xdef3('0x32')](_0x513fe0[_0xdef3('0x31')]);_0x2ae5d3['filters']=_['intersection'](_0x2ae5d3['model'],_0x2ae5d3[_0xdef3('0x31')]);_0x180183['attributes']=_[_0xdef3('0x34')](_0x2ae5d3[_0xdef3('0x30')],qs[_0xdef3('0x36')](_0x513fe0['query'][_0xdef3('0x36')]));_0x180183[_0xdef3('0x35')]=_0x180183[_0xdef3('0x35')]['length']?_0x180183['attributes']:_0x2ae5d3[_0xdef3('0x30')];if(_0x513fe0[_0xdef3('0x31')][_0xdef3('0x46')]){_0x180183['include']=[{'all':!![]}];}_0x180183=_['merge']({},_0x180183,_0x513fe0[_0xdef3('0x40')]);return db['IntegrationReport'][_0xdef3('0x47')](_0x180183)['then'](handleEntityNotFound(_0x514116,null))[_0xdef3('0x27')](respondWithResult(_0x514116,null))['catch'](handleError(_0x514116,null));};exports[_0xdef3('0x48')]=function(_0x1f574d,_0x2365e5){return db['IntegrationReport'][_0xdef3('0x48')](_0x1f574d[_0xdef3('0x49')],{})[_0xdef3('0x27')](respondWithResult(_0x2365e5,0xc9))[_0xdef3('0x44')](handleError(_0x2365e5,null));};exports[_0xdef3('0x26')]=function(_0x32490d,_0x552c64){if(_0x32490d[_0xdef3('0x49')]['id']){delete _0x32490d[_0xdef3('0x49')]['id'];}return db[_0xdef3('0x2e')][_0xdef3('0x47')]({'where':{'id':_0x32490d[_0xdef3('0x4a')]['id']}})[_0xdef3('0x27')](handleEntityNotFound(_0x552c64,null))['then'](saveUpdates(_0x32490d[_0xdef3('0x49')],null))[_0xdef3('0x27')](respondWithResult(_0x552c64,null))[_0xdef3('0x44')](handleError(_0x552c64,null));};exports[_0xdef3('0x28')]=function(_0x29aacc,_0x23bec8){return db['IntegrationReport'][_0xdef3('0x47')]({'where':{'id':_0x29aacc[_0xdef3('0x4a')]['id']}})[_0xdef3('0x27')](handleEntityNotFound(_0x23bec8,null))[_0xdef3('0x27')](removeEntity(_0x23bec8,null))[_0xdef3('0x44')](handleError(_0x23bec8,null));};exports[_0xdef3('0x4b')]=function(_0x9b1440,_0x325717){return db[_0xdef3('0x2e')]['describe']()['then'](respondWithResult(_0x325717,null))['catch'](handleError(_0x325717,null));};
\ No newline at end of file
index e20c5ed..9dc863a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','IntegrationReport','report_integration','lodash','util'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xee54,0x184));var _0x4ee5=function(_0xce8279,_0x52a866){_0xce8279=_0xce8279-0x0;var _0x240c1e=_0xee54[_0xce8279];return _0x240c1e;};'use strict';var _=require(_0x4ee5('0x0'));var util=require(_0x4ee5('0x1'));var logger=require(_0x4ee5('0x2'))('api');var moment=require(_0x4ee5('0x3'));var BPromise=require(_0x4ee5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ee5('0x5'));var rimraf=require(_0x4ee5('0x6'));var config=require(_0x4ee5('0x7'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x321ae9,_0x20dd70){return _0x321ae9['define'](_0x4ee5('0x8'),attributes,{'tableName':_0x4ee5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x28e4=['./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2f9d73,_0x538b17){var _0x2ed3a9=function(_0xa10717){while(--_0xa10717){_0x2f9d73['push'](_0x2f9d73['shift']());}};_0x2ed3a9(++_0x538b17);}(_0x28e4,0xc5));var _0x428e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28e4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x428e('0x0'));var logger=require(_0x428e('0x1'))(_0x428e('0x2'));var moment=require('moment');var BPromise=require(_0x428e('0x3'));var rp=require(_0x428e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x428e('0x5'));var config=require(_0x428e('0x6'));var attributes=require(_0x428e('0x7'));module[_0x428e('0x8')]=function(_0x57f8e8,_0x1cffb0){return _0x57f8e8[_0x428e('0x9')](_0x428e('0xa'),attributes,{'tableName':_0x428e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 77e0258..f534f2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x687b,0x14a));var _0xb687=function(_0x2bc78d,_0x31a288){_0x2bc78d=_0x2bc78d-0x0;var _0x5d96c9=_0x687b[_0x2bc78d];return _0x5d96c9;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});}
\ No newline at end of file
+var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x2fe8f3,_0x268efc){var _0x5ee4e3=function(_0x1857a4){while(--_0x1857a4){_0x2fe8f3['push'](_0x2fe8f3['shift']());}};_0x5ee4e3(++_0x268efc);}(_0xba34,0x119));var _0x4ba3=function(_0x23d2a0,_0xf8c3a5){_0x23d2a0=_0x23d2a0-0x0;var _0x2238e7=_0xba34[_0x23d2a0];return _0x2238e7;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});}
\ No newline at end of file
index e5aa149..ea407cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9485=['index','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated'];(function(_0x2daa3f,_0x416c89){var _0x11bbbf=function(_0x9f19ab){while(--_0x9f19ab){_0x2daa3f['push'](_0x2daa3f['shift']());}};_0x11bbbf(++_0x416c89);}(_0x9485,0x8b));var _0x5948=function(_0x29f7f8,_0x38641a){_0x29f7f8=_0x29f7f8-0x0;var _0x53fc04=_0x9485[_0x29f7f8];return _0x53fc04;};'use strict';var multer=require(_0x5948('0x0'));var util=require(_0x5948('0x1'));var path=require(_0x5948('0x2'));var timeout=require(_0x5948('0x3'));var express=require('express');var router=express[_0x5948('0x4')]();var fs_extra=require(_0x5948('0x5'));var auth=require(_0x5948('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5948('0x7'));var controller=require(_0x5948('0x8'));router[_0x5948('0x9')]('/',auth[_0x5948('0xa')](),controller[_0x5948('0xb')]);router[_0x5948('0x9')]('/:id',auth[_0x5948('0xa')](),controller['show']);router[_0x5948('0x9')](_0x5948('0xc'),auth['isAuthenticated'](),controller[_0x5948('0xd')]);router[_0x5948('0xe')]('/',auth['isAuthenticated'](),controller[_0x5948('0xf')]);router[_0x5948('0xe')](_0x5948('0xc'),auth[_0x5948('0xa')](),controller[_0x5948('0x10')]);router[_0x5948('0xe')](_0x5948('0x11'),auth[_0x5948('0xa')](),controller[_0x5948('0x12')]);router[_0x5948('0x13')](_0x5948('0x14'),auth['isAuthenticated'](),controller[_0x5948('0x15')]);router[_0x5948('0x16')](_0x5948('0x14'),auth[_0x5948('0xa')](),controller[_0x5948('0x17')]);module[_0x5948('0x18')]=router;
\ No newline at end of file
+var _0x42b0=['create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id','/:id/sub_intervals','getIntervals'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x42b0,0xbc));var _0x042b=function(_0x339948,_0x1e07fe){_0x339948=_0x339948-0x0;var _0x3fe9cc=_0x42b0[_0x339948];return _0x3fe9cc;};'use strict';var multer=require(_0x042b('0x0'));var util=require(_0x042b('0x1'));var path=require('path');var timeout=require(_0x042b('0x2'));var express=require('express');var router=express[_0x042b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x042b('0x4'));var config=require(_0x042b('0x5'));var controller=require(_0x042b('0x6'));router[_0x042b('0x7')]('/',auth[_0x042b('0x8')](),controller['index']);router['get'](_0x042b('0x9'),auth[_0x042b('0x8')](),controller['show']);router['get'](_0x042b('0xa'),auth['isAuthenticated'](),controller[_0x042b('0xb')]);router['post']('/',auth[_0x042b('0x8')](),controller[_0x042b('0xc')]);router[_0x042b('0xd')](_0x042b('0xa'),auth[_0x042b('0x8')](),controller[_0x042b('0xe')]);router[_0x042b('0xd')](_0x042b('0xf'),auth[_0x042b('0x8')](),controller[_0x042b('0x10')]);router[_0x042b('0x11')](_0x042b('0x9'),auth[_0x042b('0x8')](),controller['update']);router[_0x042b('0x12')]('/:id',auth[_0x042b('0x8')](),controller['destroy']);module[_0x042b('0x13')]=router;
\ No newline at end of file
index afa6d09..19ecfbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f48=['sequelize','STRING'];(function(_0x19b349,_0x97fb66){var _0x103515=function(_0x772c1d){while(--_0x772c1d){_0x19b349['push'](_0x19b349['shift']());}};_0x103515(++_0x97fb66);}(_0x2f48,0x17e));var _0x82f4=function(_0x97a9f9,_0x1b6074){_0x97a9f9=_0x97a9f9-0x0;var _0x57949b=_0x2f48[_0x97a9f9];return _0x57949b;};'use strict';var Sequelize=require(_0x82f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x82f4('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x82f4('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x7289=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7289,0x68));var _0x9728=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7289[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x9728('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9728('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 0d37c3a..6848d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c09=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Intervals','UserProfileResource','end','name','send','index','map','Interval','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','hasOwnProperty','nolimit','addIntervals','sequelize','IntervalId','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus'];(function(_0x3ad2be,_0x36fe53){var _0xefbd6a=function(_0x358fb9){while(--_0x358fb9){_0x3ad2be['push'](_0x3ad2be['shift']());}};_0xefbd6a(++_0x36fe53);}(_0x6c09,0x19f));var _0x96c0=function(_0x261771,_0x2b84ad){_0x261771=_0x261771-0x0;var _0x172e55=_0x6c09[_0x261771];return _0x172e55;};'use strict';var emlformat=require(_0x96c0('0x0'));var rimraf=require(_0x96c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96c0('0x2'));var rp=require(_0x96c0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96c0('0x4'));var util=require(_0x96c0('0x5'));var path=require(_0x96c0('0x6'));var sox=require(_0x96c0('0x7'));var csv=require('to-csv');var ejs=require(_0x96c0('0x8'));var fs=require('fs');var fs_extra=require(_0x96c0('0x9'));var _=require(_0x96c0('0xa'));var squel=require(_0x96c0('0xb'));var crypto=require('crypto');var jsforce=require(_0x96c0('0xc'));var deskjs=require(_0x96c0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96c0('0xe'));var Redis=require(_0x96c0('0xf'));var authService=require(_0x96c0('0x10'));var qs=require(_0x96c0('0x11'));var as=require(_0x96c0('0x12'));var hardwareService=require(_0x96c0('0x13'));var logger=require(_0x96c0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x96c0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x96c0('0x16'))['db'];var extensions=require(_0x96c0('0x17'));function respondWithStatusCode(_0x5d7f0a,_0x39a5c1){_0x39a5c1=_0x39a5c1||0xcc;return function(_0x3d12b9){if(_0x3d12b9){return _0x5d7f0a[_0x96c0('0x18')](_0x39a5c1);}return _0x5d7f0a[_0x96c0('0x19')](_0x39a5c1)['end']();};}function respondWithResult(_0x28d66d,_0x3da297){_0x3da297=_0x3da297||0xc8;return function(_0x59f8b7){if(_0x59f8b7){return _0x28d66d[_0x96c0('0x19')](_0x3da297)[_0x96c0('0x1a')](_0x59f8b7);}};}function respondWithFilteredResult(_0x6de673,_0x5bed94){return function(_0x9d4a36){if(_0x9d4a36){var _0x2d4084=typeof _0x5bed94[_0x96c0('0x1b')]===_0x96c0('0x1c')&&typeof _0x5bed94[_0x96c0('0x1d')]===_0x96c0('0x1c');var _0x5659ad=_0x9d4a36[_0x96c0('0x1e')];var _0x549429=_0x2d4084?0x0:_0x5bed94[_0x96c0('0x1b')];var _0x2a04a7=_0x2d4084?_0x9d4a36[_0x96c0('0x1e')]:_0x5bed94[_0x96c0('0x1b')]+_0x5bed94[_0x96c0('0x1d')];var _0x25ee1a;if(_0x2a04a7>=_0x5659ad){_0x2a04a7=_0x5659ad;_0x25ee1a=0xc8;}else{_0x25ee1a=0xce;}_0x6de673[_0x96c0('0x19')](_0x25ee1a);return _0x6de673[_0x96c0('0x1f')](_0x96c0('0x20'),_0x549429+'-'+_0x2a04a7+'/'+_0x5659ad)[_0x96c0('0x1a')](_0x9d4a36);}return null;};}function patchUpdates(_0x3337bd){return function(_0x298c75){try{jsonpatch[_0x96c0('0x21')](_0x298c75,_0x3337bd,!![]);}catch(_0x12239a){return BPromise[_0x96c0('0x22')](_0x12239a);}return _0x298c75[_0x96c0('0x23')]();};}function saveUpdates(_0x44cf9e,_0x36a1f5){return function(_0x313443){if(_0x313443){return _0x313443[_0x96c0('0x24')](_0x44cf9e)[_0x96c0('0x25')](function(_0x109401){return _0x109401;});}return null;};}function removeEntity(_0x40ea2f,_0x312893){return function(_0x541631){if(_0x541631){return _0x541631[_0x96c0('0x26')]()[_0x96c0('0x25')](function(){var _0x2f8987=_0x541631['get']({'plain':!![]});var _0x316e9=_0x96c0('0x27');return db[_0x96c0('0x28')][_0x96c0('0x26')]({'where':{'type':_0x316e9,'resourceId':_0x2f8987['id']}})[_0x96c0('0x25')](function(){return _0x541631;});})[_0x96c0('0x25')](function(){_0x40ea2f[_0x96c0('0x19')](0xcc)[_0x96c0('0x29')]();});}};}function handleEntityNotFound(_0x29d054,_0x105e32){return function(_0x2b55ac){if(!_0x2b55ac){_0x29d054['sendStatus'](0x194);}return _0x2b55ac;};}function handleError(_0x4e3817,_0x538d1e){_0x538d1e=_0x538d1e||0x1f4;return function(_0xa71add){logger['error'](_0xa71add['stack']);if(_0xa71add[_0x96c0('0x2a')]){delete _0xa71add[_0x96c0('0x2a')];}_0x4e3817[_0x96c0('0x19')](_0x538d1e)[_0x96c0('0x2b')](_0xa71add);};}exports[_0x96c0('0x2c')]=function(_0xf8a86a,_0x4a1e32){var _0xdc09e7={},_0x3cb7eb={},_0xc2a2ef={'count':0x0,'rows':[]};var _0x322a43=_[_0x96c0('0x2d')](db[_0x96c0('0x2e')]['rawAttributes'],function(_0x1b7894){return{'name':_0x1b7894[_0x96c0('0x2f')],'type':_0x1b7894[_0x96c0('0x30')][_0x96c0('0x31')]};});_0x3cb7eb[_0x96c0('0x32')]=_['map'](_0x322a43,_0x96c0('0x2a'));_0x3cb7eb[_0x96c0('0x33')]=_[_0x96c0('0x34')](_0xf8a86a[_0x96c0('0x33')]);_0x3cb7eb[_0x96c0('0x35')]=_[_0x96c0('0x36')](_0x3cb7eb[_0x96c0('0x32')],_0x3cb7eb[_0x96c0('0x33')]);_0xdc09e7[_0x96c0('0x37')]=_[_0x96c0('0x36')](_0x3cb7eb[_0x96c0('0x32')],qs['fields'](_0xf8a86a[_0x96c0('0x33')][_0x96c0('0x38')]));_0xdc09e7[_0x96c0('0x37')]=_0xdc09e7[_0x96c0('0x37')][_0x96c0('0x39')]?_0xdc09e7['attributes']:_0x3cb7eb[_0x96c0('0x32')];if(!_0xf8a86a['query']['hasOwnProperty']('nolimit')){_0xdc09e7[_0x96c0('0x1d')]=qs[_0x96c0('0x1d')](_0xf8a86a[_0x96c0('0x33')][_0x96c0('0x1d')]);_0xdc09e7[_0x96c0('0x1b')]=qs[_0x96c0('0x1b')](_0xf8a86a['query'][_0x96c0('0x1b')]);}_0xdc09e7['order']=qs[_0x96c0('0x3a')](_0xf8a86a[_0x96c0('0x33')][_0x96c0('0x3a')]);_0xdc09e7[_0x96c0('0x3b')]=qs[_0x96c0('0x35')](_[_0x96c0('0x3c')](_0xf8a86a[_0x96c0('0x33')],_0x3cb7eb[_0x96c0('0x35')]),_0x322a43);if(_0xf8a86a[_0x96c0('0x33')]['filter']){_0xdc09e7['where']=_[_0x96c0('0x3d')](_0xdc09e7[_0x96c0('0x3b')],{'$or':_[_0x96c0('0x2d')](_0x322a43,function(_0x22699f){if(_0x22699f['type']!=='VIRTUAL'){var _0x3095ea={};_0x3095ea[_0x22699f['name']]={'$like':'%'+_0xf8a86a[_0x96c0('0x33')][_0x96c0('0x3e')]+'%'};return _0x3095ea;}})});}_0xdc09e7=_['merge']({},_0xdc09e7,_0xf8a86a[_0x96c0('0x3f')]);var _0x108812={'where':_0xdc09e7['where']};return db['Interval'][_0x96c0('0x1e')](_0x108812)['then'](function(_0x1bd80e){_0xc2a2ef[_0x96c0('0x1e')]=_0x1bd80e;if(_0xf8a86a[_0x96c0('0x33')][_0x96c0('0x40')]){_0xdc09e7[_0x96c0('0x41')]=[{'all':!![]}];}return db[_0x96c0('0x2e')][_0x96c0('0x42')](_0xdc09e7);})['then'](function(_0x5e1e10){_0xc2a2ef[_0x96c0('0x43')]=_0x5e1e10;return _0xc2a2ef;})[_0x96c0('0x25')](respondWithFilteredResult(_0x4a1e32,_0xdc09e7))[_0x96c0('0x44')](handleError(_0x4a1e32,null));};exports[_0x96c0('0x45')]=function(_0x52b87a,_0x5b199c){var _0x3d24de={'raw':!![],'where':{'id':_0x52b87a[_0x96c0('0x46')]['id']}},_0x2561a6={};_0x2561a6['model']=_[_0x96c0('0x34')](db[_0x96c0('0x2e')][_0x96c0('0x47')]);_0x2561a6[_0x96c0('0x33')]=_[_0x96c0('0x34')](_0x52b87a[_0x96c0('0x33')]);_0x2561a6[_0x96c0('0x35')]=_['intersection'](_0x2561a6[_0x96c0('0x32')],_0x2561a6[_0x96c0('0x33')]);_0x3d24de[_0x96c0('0x37')]=_[_0x96c0('0x36')](_0x2561a6[_0x96c0('0x32')],qs['fields'](_0x52b87a[_0x96c0('0x33')][_0x96c0('0x38')]));_0x3d24de['attributes']=_0x3d24de[_0x96c0('0x37')][_0x96c0('0x39')]?_0x3d24de['attributes']:_0x2561a6[_0x96c0('0x32')];if(_0x52b87a[_0x96c0('0x33')]['includeAll']){_0x3d24de['include']=[{'all':!![]}];}_0x3d24de=_['merge']({},_0x3d24de,_0x52b87a[_0x96c0('0x3f')]);return db['Interval']['find'](_0x3d24de)[_0x96c0('0x25')](handleEntityNotFound(_0x5b199c,null))[_0x96c0('0x25')](respondWithResult(_0x5b199c,null))[_0x96c0('0x44')](handleError(_0x5b199c,null));};exports['create']=function(_0xe3107b,_0x5b8c7c){return db[_0x96c0('0x2e')][_0x96c0('0x48')](_0xe3107b[_0x96c0('0x49')],{})[_0x96c0('0x25')](function(_0x1eedce){var _0x1e389e=_0xe3107b['user'][_0x96c0('0x4a')]({'plain':!![]});if(!_0x1e389e)throw new Error(_0x96c0('0x4b'));if(_0x1e389e[_0x96c0('0x4c')]==='user'){var _0x24808d=_0x1eedce['get']({'plain':!![]});var _0xada92=_0x96c0('0x27');return db[_0x96c0('0x4d')][_0x96c0('0x4e')]({'where':{'name':_0xada92,'userProfileId':_0x1e389e[_0x96c0('0x4f')]},'raw':!![]})[_0x96c0('0x25')](function(_0x44ab7b){if(_0x44ab7b&&_0x44ab7b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x24808d[_0x96c0('0x2a')],'resourceId':_0x24808d['id'],'type':_0x44ab7b[_0x96c0('0x2a')],'sectionId':_0x44ab7b['id']},{})[_0x96c0('0x25')](function(){return _0x1eedce;});}else{return _0x1eedce;}})[_0x96c0('0x44')](function(_0x86af49){logger['error'](_0x96c0('0x50'),_0x86af49);throw _0x86af49;});}return _0x1eedce;})['then'](respondWithResult(_0x5b8c7c,0xc9))[_0x96c0('0x44')](handleError(_0x5b8c7c,null));};exports[_0x96c0('0x24')]=function(_0x192c00,_0x49932d){if(_0x192c00[_0x96c0('0x49')]['id']){delete _0x192c00[_0x96c0('0x49')]['id'];}return db['Interval'][_0x96c0('0x4e')]({'where':{'id':_0x192c00[_0x96c0('0x46')]['id']}})[_0x96c0('0x25')](handleEntityNotFound(_0x49932d,null))['then'](saveUpdates(_0x192c00[_0x96c0('0x49')],null))['then'](respondWithResult(_0x49932d,null))['catch'](handleError(_0x49932d,null));};exports[_0x96c0('0x26')]=function(_0x48808c,_0x584005){return db[_0x96c0('0x2e')][_0x96c0('0x4e')]({'where':{'id':_0x48808c[_0x96c0('0x46')]['id']}})[_0x96c0('0x25')](handleEntityNotFound(_0x584005,null))[_0x96c0('0x25')](removeEntity(_0x584005,null))[_0x96c0('0x44')](handleError(_0x584005,null));};exports[_0x96c0('0x51')]=function(_0x8a4a5,_0x13cc79,_0x50e9fe){if(_0x8a4a5[_0x96c0('0x49')]['id']){delete _0x8a4a5[_0x96c0('0x49')]['id'];}return db[_0x96c0('0x2e')][_0x96c0('0x4e')]({'where':{'id':_0x8a4a5[_0x96c0('0x46')]['id']}})[_0x96c0('0x25')](handleEntityNotFound(_0x13cc79,null))[_0x96c0('0x25')](function(_0x24c8bb){if(_0x24c8bb){_0x8a4a5[_0x96c0('0x49')]['IntervalId']=_0x24c8bb['id'];return db['Interval'][_0x96c0('0x48')](_0x8a4a5[_0x96c0('0x49')]);}})[_0x96c0('0x25')](respondWithResult(_0x13cc79,null))[_0x96c0('0x44')](handleError(_0x13cc79,null));};exports[_0x96c0('0x52')]=function(_0x3a424b,_0x4b2622,_0x2e5805){var _0x20fe62={};var _0x5f11c8={};var _0x1da97e;var _0x250872;return db[_0x96c0('0x2e')]['findOne']({'where':{'id':_0x3a424b[_0x96c0('0x46')]['id']}})[_0x96c0('0x25')](handleEntityNotFound(_0x4b2622,null))[_0x96c0('0x25')](function(_0x23316e){if(_0x23316e){_0x1da97e=_0x23316e;_0x5f11c8[_0x96c0('0x32')]=_[_0x96c0('0x34')](db[_0x96c0('0x2e')][_0x96c0('0x47')]);_0x5f11c8[_0x96c0('0x33')]=_[_0x96c0('0x34')](_0x3a424b['query']);_0x5f11c8[_0x96c0('0x35')]=_[_0x96c0('0x36')](_0x5f11c8['model'],_0x5f11c8['query']);_0x20fe62[_0x96c0('0x37')]=_[_0x96c0('0x36')](_0x5f11c8[_0x96c0('0x32')],qs[_0x96c0('0x38')](_0x3a424b['query']['fields']));_0x20fe62[_0x96c0('0x37')]=_0x20fe62[_0x96c0('0x37')][_0x96c0('0x39')]?_0x20fe62[_0x96c0('0x37')]:_0x5f11c8[_0x96c0('0x32')];_0x20fe62['order']=qs[_0x96c0('0x3a')](_0x3a424b['query'][_0x96c0('0x3a')]);_0x20fe62[_0x96c0('0x3b')]=qs['filters'](_['pick'](_0x3a424b[_0x96c0('0x33')],_0x5f11c8['filters']));if(_0x3a424b[_0x96c0('0x33')][_0x96c0('0x3e')]){_0x20fe62['where']=_[_0x96c0('0x3d')](_0x20fe62[_0x96c0('0x3b')],{'$or':_[_0x96c0('0x2d')](_0x20fe62['attributes'],function(_0x2c5720){var _0x126c52={};_0x126c52[_0x2c5720]={'$like':'%'+_0x3a424b[_0x96c0('0x33')][_0x96c0('0x3e')]+'%'};return _0x126c52;})});}_0x20fe62=_[_0x96c0('0x3d')]({},_0x20fe62,_0x3a424b['options']);return _0x1da97e['getIntervals'](_0x20fe62);}})[_0x96c0('0x25')](function(_0x4df69e){if(_0x4df69e){_0x250872=_0x4df69e[_0x96c0('0x39')];if(!_0x3a424b[_0x96c0('0x33')][_0x96c0('0x53')](_0x96c0('0x54'))){_0x20fe62[_0x96c0('0x1d')]=qs[_0x96c0('0x1d')](_0x3a424b[_0x96c0('0x33')][_0x96c0('0x1d')]);_0x20fe62[_0x96c0('0x1b')]=qs[_0x96c0('0x1b')](_0x3a424b[_0x96c0('0x33')][_0x96c0('0x1b')]);}return _0x1da97e[_0x96c0('0x52')](_0x20fe62);}})['then'](function(_0xa5a8f0){if(_0xa5a8f0){return _0xa5a8f0?{'count':_0x250872,'rows':_0xa5a8f0}:null;}})[_0x96c0('0x25')](respondWithResult(_0x4b2622,null))['catch'](handleError(_0x4b2622,null));};exports[_0x96c0('0x55')]=function(_0x114466,_0x305bbe,_0x4a6317){return db[_0x96c0('0x2e')]['findOne']({'where':{'id':_0x114466[_0x96c0('0x46')]['id']}})[_0x96c0('0x25')](handleEntityNotFound(_0x305bbe,null))[_0x96c0('0x25')](function(_0x16538b){if(_0x16538b){return db[_0x96c0('0x56')]['transaction'](function(_0x5f556a){return db[_0x96c0('0x2e')][_0x96c0('0x26')]({'where':{'IntervalId':_0x114466[_0x96c0('0x46')]['id']},'transaction':_0x5f556a})[_0x96c0('0x25')](function(_0x5ad5ae){var _0x5b767c=_['map'](_0x114466[_0x96c0('0x49')],function(_0x5132a5){delete _0x5132a5['id'];_0x5132a5[_0x96c0('0x57')]=_0x114466[_0x96c0('0x46')]['id'];return _0x5132a5;});return db[_0x96c0('0x2e')]['bulkCreate'](_0x5b767c,{'transaction':_0x5f556a});});})['then'](function(){return db[_0x96c0('0x2e')][_0x96c0('0x42')]({'where':{'IntervalId':_0x114466['params']['id']}});});}})[_0x96c0('0x25')](respondWithResult(_0x305bbe,null))[_0x96c0('0x44')](handleError(_0x305bbe,null));};
\ No newline at end of file
+var _0x55c2=['sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','then','get','Intervals','UserProfileResource','stack','name','send','map','Interval','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals'];(function(_0x3d800f,_0x1a64f3){var _0x1b20c0=function(_0x573307){while(--_0x573307){_0x3d800f['push'](_0x3d800f['shift']());}};_0x1b20c0(++_0x1a64f3);}(_0x55c2,0x107));var _0x255c=function(_0x57f802,_0x51b159){_0x57f802=_0x57f802-0x0;var _0x324c9b=_0x55c2[_0x57f802];return _0x324c9b;};'use strict';var emlformat=require(_0x255c('0x0'));var rimraf=require(_0x255c('0x1'));var zipdir=require(_0x255c('0x2'));var jsonpatch=require(_0x255c('0x3'));var rp=require(_0x255c('0x4'));var moment=require(_0x255c('0x5'));var BPromise=require(_0x255c('0x6'));var Mustache=require('mustache');var util=require(_0x255c('0x7'));var path=require(_0x255c('0x8'));var sox=require(_0x255c('0x9'));var csv=require(_0x255c('0xa'));var ejs=require(_0x255c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x255c('0xc'));var squel=require('squel');var crypto=require(_0x255c('0xd'));var jsforce=require(_0x255c('0xe'));var deskjs=require(_0x255c('0xf'));var toCsv=require(_0x255c('0xa'));var querystring=require('querystring');var Papa=require(_0x255c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x255c('0x11'));var hardwareService=require(_0x255c('0x12'));var logger=require(_0x255c('0x13'))(_0x255c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x255c('0x15'))['db'];var extensions=require(_0x255c('0x16'));function respondWithStatusCode(_0x163e72,_0x5395ef){_0x5395ef=_0x5395ef||0xcc;return function(_0x1fa587){if(_0x1fa587){return _0x163e72[_0x255c('0x17')](_0x5395ef);}return _0x163e72[_0x255c('0x18')](_0x5395ef)[_0x255c('0x19')]();};}function respondWithResult(_0x44bb5f,_0x1bc5db){_0x1bc5db=_0x1bc5db||0xc8;return function(_0x3d96b8){if(_0x3d96b8){return _0x44bb5f[_0x255c('0x18')](_0x1bc5db)[_0x255c('0x1a')](_0x3d96b8);}};}function respondWithFilteredResult(_0x58273c,_0x46a9cf){return function(_0x476e05){if(_0x476e05){var _0x2d235e=typeof _0x46a9cf[_0x255c('0x1b')]===_0x255c('0x1c')&&typeof _0x46a9cf[_0x255c('0x1d')]===_0x255c('0x1c');var _0x1877d1=_0x476e05[_0x255c('0x1e')];var _0x28731b=_0x2d235e?0x0:_0x46a9cf[_0x255c('0x1b')];var _0x58206a=_0x2d235e?_0x476e05[_0x255c('0x1e')]:_0x46a9cf[_0x255c('0x1b')]+_0x46a9cf['limit'];var _0x14662b;if(_0x58206a>=_0x1877d1){_0x58206a=_0x1877d1;_0x14662b=0xc8;}else{_0x14662b=0xce;}_0x58273c[_0x255c('0x18')](_0x14662b);return _0x58273c['set']('Content-Range',_0x28731b+'-'+_0x58206a+'/'+_0x1877d1)[_0x255c('0x1a')](_0x476e05);}return null;};}function patchUpdates(_0x3e4820){return function(_0xe4a095){try{jsonpatch[_0x255c('0x1f')](_0xe4a095,_0x3e4820,!![]);}catch(_0x34c0a8){return BPromise['reject'](_0x34c0a8);}return _0xe4a095[_0x255c('0x20')]();};}function saveUpdates(_0x58589d,_0x4c9520){return function(_0x3d9829){if(_0x3d9829){return _0x3d9829['update'](_0x58589d)[_0x255c('0x21')](function(_0x55871c){return _0x55871c;});}return null;};}function removeEntity(_0x49529c,_0x2f73b1){return function(_0x46fc07){if(_0x46fc07){return _0x46fc07['destroy']()[_0x255c('0x21')](function(){var _0x2f211c=_0x46fc07[_0x255c('0x22')]({'plain':!![]});var _0x401159=_0x255c('0x23');return db[_0x255c('0x24')]['destroy']({'where':{'type':_0x401159,'resourceId':_0x2f211c['id']}})[_0x255c('0x21')](function(){return _0x46fc07;});})[_0x255c('0x21')](function(){_0x49529c[_0x255c('0x18')](0xcc)[_0x255c('0x19')]();});}};}function handleEntityNotFound(_0xdcf2a7,_0x4a7a20){return function(_0x264953){if(!_0x264953){_0xdcf2a7['sendStatus'](0x194);}return _0x264953;};}function handleError(_0x27f9a8,_0x59ad22){_0x59ad22=_0x59ad22||0x1f4;return function(_0xdf6c7f){logger['error'](_0xdf6c7f[_0x255c('0x25')]);if(_0xdf6c7f['name']){delete _0xdf6c7f[_0x255c('0x26')];}_0x27f9a8['status'](_0x59ad22)[_0x255c('0x27')](_0xdf6c7f);};}exports['index']=function(_0x281cf5,_0x55403b){var _0x1a68db={},_0x136653={},_0x3b89c8={'count':0x0,'rows':[]};var _0x5010b3=_[_0x255c('0x28')](db[_0x255c('0x29')][_0x255c('0x2a')],function(_0x38627e){return{'name':_0x38627e[_0x255c('0x2b')],'type':_0x38627e[_0x255c('0x2c')]['key']};});_0x136653[_0x255c('0x2d')]=_['map'](_0x5010b3,'name');_0x136653[_0x255c('0x2e')]=_[_0x255c('0x2f')](_0x281cf5[_0x255c('0x2e')]);_0x136653[_0x255c('0x30')]=_[_0x255c('0x31')](_0x136653[_0x255c('0x2d')],_0x136653[_0x255c('0x2e')]);_0x1a68db[_0x255c('0x32')]=_[_0x255c('0x31')](_0x136653[_0x255c('0x2d')],qs[_0x255c('0x33')](_0x281cf5[_0x255c('0x2e')][_0x255c('0x33')]));_0x1a68db['attributes']=_0x1a68db[_0x255c('0x32')][_0x255c('0x34')]?_0x1a68db[_0x255c('0x32')]:_0x136653['model'];if(!_0x281cf5[_0x255c('0x2e')]['hasOwnProperty'](_0x255c('0x35'))){_0x1a68db['limit']=qs[_0x255c('0x1d')](_0x281cf5[_0x255c('0x2e')]['limit']);_0x1a68db[_0x255c('0x1b')]=qs[_0x255c('0x1b')](_0x281cf5['query'][_0x255c('0x1b')]);}_0x1a68db[_0x255c('0x36')]=qs[_0x255c('0x37')](_0x281cf5['query'][_0x255c('0x37')]);_0x1a68db[_0x255c('0x38')]=qs['filters'](_[_0x255c('0x39')](_0x281cf5['query'],_0x136653[_0x255c('0x30')]),_0x5010b3);if(_0x281cf5[_0x255c('0x2e')][_0x255c('0x3a')]){_0x1a68db[_0x255c('0x38')]=_[_0x255c('0x3b')](_0x1a68db[_0x255c('0x38')],{'$or':_[_0x255c('0x28')](_0x5010b3,function(_0xfe46f4){if(_0xfe46f4[_0x255c('0x2c')]!==_0x255c('0x3c')){var _0x257976={};_0x257976[_0xfe46f4[_0x255c('0x26')]]={'$like':'%'+_0x281cf5['query'][_0x255c('0x3a')]+'%'};return _0x257976;}})});}_0x1a68db=_[_0x255c('0x3b')]({},_0x1a68db,_0x281cf5['options']);var _0x254c4e={'where':_0x1a68db[_0x255c('0x38')]};return db[_0x255c('0x29')][_0x255c('0x1e')](_0x254c4e)[_0x255c('0x21')](function(_0x42f01e){_0x3b89c8[_0x255c('0x1e')]=_0x42f01e;if(_0x281cf5['query'][_0x255c('0x3d')]){_0x1a68db[_0x255c('0x3e')]=[{'all':!![]}];}return db[_0x255c('0x29')][_0x255c('0x3f')](_0x1a68db);})[_0x255c('0x21')](function(_0x501e91){_0x3b89c8[_0x255c('0x40')]=_0x501e91;return _0x3b89c8;})['then'](respondWithFilteredResult(_0x55403b,_0x1a68db))[_0x255c('0x41')](handleError(_0x55403b,null));};exports['show']=function(_0x5269da,_0x260328){var _0x547368={'raw':!![],'where':{'id':_0x5269da[_0x255c('0x42')]['id']}},_0x392423={};_0x392423['model']=_[_0x255c('0x2f')](db[_0x255c('0x29')][_0x255c('0x2a')]);_0x392423[_0x255c('0x2e')]=_[_0x255c('0x2f')](_0x5269da[_0x255c('0x2e')]);_0x392423[_0x255c('0x30')]=_[_0x255c('0x31')](_0x392423['model'],_0x392423[_0x255c('0x2e')]);_0x547368[_0x255c('0x32')]=_['intersection'](_0x392423[_0x255c('0x2d')],qs[_0x255c('0x33')](_0x5269da['query'][_0x255c('0x33')]));_0x547368['attributes']=_0x547368[_0x255c('0x32')][_0x255c('0x34')]?_0x547368[_0x255c('0x32')]:_0x392423[_0x255c('0x2d')];if(_0x5269da[_0x255c('0x2e')][_0x255c('0x3d')]){_0x547368[_0x255c('0x3e')]=[{'all':!![]}];}_0x547368=_[_0x255c('0x3b')]({},_0x547368,_0x5269da[_0x255c('0x43')]);return db[_0x255c('0x29')][_0x255c('0x44')](_0x547368)[_0x255c('0x21')](handleEntityNotFound(_0x260328,null))[_0x255c('0x21')](respondWithResult(_0x260328,null))['catch'](handleError(_0x260328,null));};exports['create']=function(_0x5d9670,_0x1c551c){return db[_0x255c('0x29')][_0x255c('0x45')](_0x5d9670[_0x255c('0x46')],{})[_0x255c('0x21')](function(_0x21d0f9){var _0x4c082e=_0x5d9670[_0x255c('0x47')][_0x255c('0x22')]({'plain':!![]});if(!_0x4c082e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c082e[_0x255c('0x48')]===_0x255c('0x47')){var _0x20c3f9=_0x21d0f9[_0x255c('0x22')]({'plain':!![]});var _0x3a408c='Intervals';return db[_0x255c('0x49')][_0x255c('0x44')]({'where':{'name':_0x3a408c,'userProfileId':_0x4c082e[_0x255c('0x4a')]},'raw':!![]})[_0x255c('0x21')](function(_0x39e9dd){if(_0x39e9dd&&_0x39e9dd[_0x255c('0x4b')]===0x0){return db[_0x255c('0x24')][_0x255c('0x45')]({'name':_0x20c3f9[_0x255c('0x26')],'resourceId':_0x20c3f9['id'],'type':_0x39e9dd[_0x255c('0x26')],'sectionId':_0x39e9dd['id']},{})['then'](function(){return _0x21d0f9;});}else{return _0x21d0f9;}})[_0x255c('0x41')](function(_0x313ea3){logger[_0x255c('0x4c')](_0x255c('0x4d'),_0x313ea3);throw _0x313ea3;});}return _0x21d0f9;})[_0x255c('0x21')](respondWithResult(_0x1c551c,0xc9))[_0x255c('0x41')](handleError(_0x1c551c,null));};exports[_0x255c('0x4e')]=function(_0x47f37e,_0x527f1c){if(_0x47f37e[_0x255c('0x46')]['id']){delete _0x47f37e[_0x255c('0x46')]['id'];}return db[_0x255c('0x29')][_0x255c('0x44')]({'where':{'id':_0x47f37e[_0x255c('0x42')]['id']}})[_0x255c('0x21')](handleEntityNotFound(_0x527f1c,null))[_0x255c('0x21')](saveUpdates(_0x47f37e[_0x255c('0x46')],null))[_0x255c('0x21')](respondWithResult(_0x527f1c,null))[_0x255c('0x41')](handleError(_0x527f1c,null));};exports['destroy']=function(_0x516ccf,_0x22a562){return db[_0x255c('0x29')][_0x255c('0x44')]({'where':{'id':_0x516ccf['params']['id']}})[_0x255c('0x21')](handleEntityNotFound(_0x22a562,null))[_0x255c('0x21')](removeEntity(_0x22a562,null))['catch'](handleError(_0x22a562,null));};exports[_0x255c('0x4f')]=function(_0x217d4f,_0x210c00,_0x1c0f07){if(_0x217d4f[_0x255c('0x46')]['id']){delete _0x217d4f[_0x255c('0x46')]['id'];}return db['Interval']['find']({'where':{'id':_0x217d4f['params']['id']}})[_0x255c('0x21')](handleEntityNotFound(_0x210c00,null))['then'](function(_0x4ddb40){if(_0x4ddb40){_0x217d4f['body'][_0x255c('0x50')]=_0x4ddb40['id'];return db['Interval'][_0x255c('0x45')](_0x217d4f[_0x255c('0x46')]);}})['then'](respondWithResult(_0x210c00,null))['catch'](handleError(_0x210c00,null));};exports[_0x255c('0x51')]=function(_0x1e263,_0x208343,_0x4f2911){var _0x3ea2ea={};var _0x4d6064={};var _0x2a2845;var _0x37fa52;return db[_0x255c('0x29')][_0x255c('0x52')]({'where':{'id':_0x1e263[_0x255c('0x42')]['id']}})[_0x255c('0x21')](handleEntityNotFound(_0x208343,null))['then'](function(_0x1e48ff){if(_0x1e48ff){_0x2a2845=_0x1e48ff;_0x4d6064[_0x255c('0x2d')]=_[_0x255c('0x2f')](db[_0x255c('0x29')]['rawAttributes']);_0x4d6064[_0x255c('0x2e')]=_['keys'](_0x1e263['query']);_0x4d6064[_0x255c('0x30')]=_[_0x255c('0x31')](_0x4d6064['model'],_0x4d6064[_0x255c('0x2e')]);_0x3ea2ea['attributes']=_[_0x255c('0x31')](_0x4d6064[_0x255c('0x2d')],qs['fields'](_0x1e263['query'][_0x255c('0x33')]));_0x3ea2ea[_0x255c('0x32')]=_0x3ea2ea[_0x255c('0x32')]['length']?_0x3ea2ea[_0x255c('0x32')]:_0x4d6064[_0x255c('0x2d')];_0x3ea2ea[_0x255c('0x36')]=qs[_0x255c('0x37')](_0x1e263[_0x255c('0x2e')][_0x255c('0x37')]);_0x3ea2ea[_0x255c('0x38')]=qs[_0x255c('0x30')](_['pick'](_0x1e263[_0x255c('0x2e')],_0x4d6064[_0x255c('0x30')]));if(_0x1e263[_0x255c('0x2e')][_0x255c('0x3a')]){_0x3ea2ea[_0x255c('0x38')]=_[_0x255c('0x3b')](_0x3ea2ea['where'],{'$or':_['map'](_0x3ea2ea[_0x255c('0x32')],function(_0x4c0a89){var _0x571c5d={};_0x571c5d[_0x4c0a89]={'$like':'%'+_0x1e263[_0x255c('0x2e')][_0x255c('0x3a')]+'%'};return _0x571c5d;})});}_0x3ea2ea=_['merge']({},_0x3ea2ea,_0x1e263[_0x255c('0x43')]);return _0x2a2845[_0x255c('0x51')](_0x3ea2ea);}})[_0x255c('0x21')](function(_0x242048){if(_0x242048){_0x37fa52=_0x242048['length'];if(!_0x1e263['query'][_0x255c('0x53')](_0x255c('0x35'))){_0x3ea2ea[_0x255c('0x1d')]=qs[_0x255c('0x1d')](_0x1e263[_0x255c('0x2e')]['limit']);_0x3ea2ea[_0x255c('0x1b')]=qs['offset'](_0x1e263[_0x255c('0x2e')][_0x255c('0x1b')]);}return _0x2a2845[_0x255c('0x51')](_0x3ea2ea);}})[_0x255c('0x21')](function(_0x14cca1){if(_0x14cca1){return _0x14cca1?{'count':_0x37fa52,'rows':_0x14cca1}:null;}})[_0x255c('0x21')](respondWithResult(_0x208343,null))[_0x255c('0x41')](handleError(_0x208343,null));};exports[_0x255c('0x54')]=function(_0x143f8d,_0x13e7f3,_0x13c5fc){return db[_0x255c('0x29')][_0x255c('0x52')]({'where':{'id':_0x143f8d[_0x255c('0x42')]['id']}})['then'](handleEntityNotFound(_0x13e7f3,null))[_0x255c('0x21')](function(_0x2678b6){if(_0x2678b6){return db[_0x255c('0x55')][_0x255c('0x56')](function(_0x58e8c0){return db[_0x255c('0x29')]['destroy']({'where':{'IntervalId':_0x143f8d[_0x255c('0x42')]['id']},'transaction':_0x58e8c0})[_0x255c('0x21')](function(_0x56eb96){var _0x3287bc=_[_0x255c('0x28')](_0x143f8d[_0x255c('0x46')],function(_0x5e8c5f){delete _0x5e8c5f['id'];_0x5e8c5f[_0x255c('0x50')]=_0x143f8d[_0x255c('0x42')]['id'];return _0x5e8c5f;});return db['Interval']['bulkCreate'](_0x3287bc,{'transaction':_0x58e8c0});});})[_0x255c('0x21')](function(){return db['Interval'][_0x255c('0x3f')]({'where':{'IntervalId':_0x143f8d['params']['id']}});});}})[_0x255c('0x21')](respondWithResult(_0x13e7f3,null))[_0x255c('0x41')](handleError(_0x13e7f3,null));};
\ No newline at end of file
index 27bef28..260f3b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7241=['../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./interval.attributes'];(function(_0x5c45c7,_0x564388){var _0x42bb17=function(_0x30f0f4){while(--_0x30f0f4){_0x5c45c7['push'](_0x5c45c7['shift']());}};_0x42bb17(++_0x564388);}(_0x7241,0x1d4));var _0x1724=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x7241[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var util=require(_0x1724('0x0'));var logger=require(_0x1724('0x1'))(_0x1724('0x2'));var moment=require('moment');var BPromise=require(_0x1724('0x3'));var rp=require(_0x1724('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1724('0x5'));var config=require(_0x1724('0x6'));var attributes=require(_0x1724('0x7'));var extensions=require(_0x1724('0x8'));module[_0x1724('0x9')]=function(_0x3b6c74,_0x5e0f0d){return _0x3b6c74[_0x1724('0xa')](_0x1724('0xb'),attributes,{'tableName':_0x1724('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x23b160,_0x2b3fad){extensions[_0x1724('0xd')](_0x3b6c74,_0x23b160);},'afterBulkCreate':function(_0x39b84c,_0x28d70d,_0x348248){_0x348248();extensions[_0x1724('0xd')](_0x3b6c74,_0x39b84c[0x0]);},'afterUpdate':function(_0x40317c,_0x3a78ea){extensions[_0x1724('0xd')](_0x3b6c74,_0x40317c);},'afterDestroy':function(_0x36af6c,_0x53225a){extensions[_0x1724('0xd')](_0x3b6c74,_0x36af6c);}}});};
\ No newline at end of file
+var _0xbd42=['exports','define','Interval','tools_intervals','rewrite','util','../../config/logger','api','bluebird','./interval.attributes','../../components/extensions/rewrite'];(function(_0x3bcb53,_0x4d27c5){var _0x3182da=function(_0x33467f){while(--_0x33467f){_0x3bcb53['push'](_0x3bcb53['shift']());}};_0x3182da(++_0x4d27c5);}(_0xbd42,0xaa));var _0x2bd4=function(_0x3fe90c,_0x231b20){_0x3fe90c=_0x3fe90c-0x0;var _0x12c302=_0xbd42[_0x3fe90c];return _0x12c302;};'use strict';var _=require('lodash');var util=require(_0x2bd4('0x0'));var logger=require(_0x2bd4('0x1'))(_0x2bd4('0x2'));var moment=require('moment');var BPromise=require(_0x2bd4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2bd4('0x4'));var extensions=require(_0x2bd4('0x5'));module[_0x2bd4('0x6')]=function(_0x460bcf,_0x6a8b75){return _0x460bcf[_0x2bd4('0x7')](_0x2bd4('0x8'),attributes,{'tableName':_0x2bd4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x20dc69,_0x8f7b0d){extensions[_0x2bd4('0xa')](_0x460bcf,_0x20dc69);},'afterBulkCreate':function(_0x3068e7,_0x5c0d6c,_0x47f4bc){_0x47f4bc();extensions[_0x2bd4('0xa')](_0x460bcf,_0x3068e7[0x0]);},'afterUpdate':function(_0x17e02e,_0x558e6c){extensions[_0x2bd4('0xa')](_0x460bcf,_0x17e02e);},'afterDestroy':function(_0x8453a3,_0xe909fd){extensions[_0x2bd4('0xa')](_0x460bcf,_0x8453a3);}}});};
\ No newline at end of file
index af8ab40..3aef000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
index bda07c7..ec3c6b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x4e0d0a,_0x27f3e1){var _0x358661=function(_0x47aa88){while(--_0x47aa88){_0x4e0d0a['push'](_0x4e0d0a['shift']());}};_0x358661(++_0x27f3e1);}(_0x2ef3,0xba));var _0x32ef=function(_0x1c05e5,_0x2e64cf){_0x1c05e5=_0x1c05e5-0x0;var _0x229087=_0x2ef3[_0x1c05e5];return _0x229087;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router;
\ No newline at end of file
+var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x7b0516,_0x1c58b6){var _0x175826=function(_0x5d255d){while(--_0x5d255d){_0x7b0516['push'](_0x7b0516['shift']());}};_0x175826(++_0x1c58b6);}(_0xadb5,0xad));var _0x5adb=function(_0x10337a,_0x4381cc){_0x10337a=_0x10337a-0x0;var _0x49f3d7=_0xadb5[_0x10337a];return _0x49f3d7;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
index 07459dd..e57c1e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee16=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','Bug','fields','email','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','statusCode','json','error'];(function(_0x2a516,_0x3aa0df){var _0x55399e=function(_0xc1015a){while(--_0xc1015a){_0x2a516['push'](_0x2a516['shift']());}};_0x55399e(++_0x3aa0df);}(_0xee16,0x1bc));var _0x6ee1=function(_0x32f05c,_0x273aef){_0x32f05c=_0x32f05c-0x0;var _0x4307ed=_0xee16[_0x32f05c];return _0x4307ed;};'use strict';var BPromise=require(_0x6ee1('0x0'));var https=require(_0x6ee1('0x1'));var logger=require(_0x6ee1('0x2'))(_0x6ee1('0x3'));var USERNAME=_0x6ee1('0x4');var PASSWORD=_0x6ee1('0x5');function openIssue(_0x15b95b,_0x2a1da3){var _0x2ae752={'fields':{'project':{'key':_0x15b95b[_0x6ee1('0x6')]||_0x6ee1('0x7')},'summary':(_0x15b95b['summary']||_0x6ee1('0x8'))+_0x6ee1('0x9')+_0x15b95b['ip'],'description':_0x15b95b[_0x6ee1('0xa')]||JSON[_0x6ee1('0xb')](_0x15b95b),'issuetype':{'name':_0x15b95b['issuetype']||_0x6ee1('0xc')}}};_0x2ae752[_0x6ee1('0xd')]['customfield_11500']=_0x15b95b[_0x6ee1('0xe')];_0x2ae752[_0x6ee1('0xd')]['customfield_11501']=_0x15b95b['oldToken'];_0x2ae752[_0x6ee1('0xd')][_0x6ee1('0xf')]=_0x15b95b[_0x6ee1('0x10')];_0x2ae752[_0x6ee1('0xd')][_0x6ee1('0x11')]=_0x15b95b[_0x6ee1('0x12')];_0x2ae752[_0x6ee1('0xd')][_0x6ee1('0x13')]=_0x15b95b[_0x6ee1('0x14')];_0x2ae752['fields'][_0x6ee1('0x15')]=_0x15b95b['ip'];var _0x58eb10={'host':_0x6ee1('0x16'),'port':0x1bb,'path':_0x6ee1('0x17'),'method':_0x6ee1('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x6ee1('0x19'),'Authorization':_0x6ee1('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x6ee1('0x1b')](_0x6ee1('0x1c'))}};var _0x300ff6=JSON[_0x6ee1('0xb')](_0x2ae752);var _0x4d9a46=https[_0x6ee1('0x1d')](_0x58eb10,function(_0x3ce293){_0x3ce293[_0x6ee1('0x1e')](_0x6ee1('0x1f'));var _0x3b7925='';_0x3ce293['on'](_0x6ee1('0x20'),function(_0x4592e2){_0x3b7925+=_0x4592e2;});_0x3ce293['on']('end',function(){if(_0x2a1da3){return _0x2a1da3['status'](_0x3ce293[_0x6ee1('0x21')])[_0x6ee1('0x22')](JSON['parse'](_0x3b7925));}});});_0x4d9a46['on'](_0x6ee1('0x23'),function(_0x156e87){if(_0x2a1da3){return _0x2a1da3['status'](0x1f4)['json']({'errors':[{'message':_0x6ee1('0x24'),'type':_0x6ee1('0x25')}]});}});_0x4d9a46[_0x6ee1('0x26')](_0x300ff6);_0x4d9a46[_0x6ee1('0x27')]();}exports[_0x6ee1('0x28')]=openIssue;exports[_0x6ee1('0x29')]=function(_0x1c259a,_0x13b537){_0x1c259a[_0x6ee1('0x2a')]['ip']=_0x1c259a[_0x6ee1('0x2b')][_0x6ee1('0x2c')]||_0x1c259a[_0x6ee1('0x2d')]['remoteAddress']||_0x1c259a[_0x6ee1('0x2e')][_0x6ee1('0x2f')]||_0x1c259a[_0x6ee1('0x2d')]['socket']['remoteAddress'];return openIssue(_0x1c259a[_0x6ee1('0x2a')],_0x13b537);};
\ No newline at end of file
+var _0xf313=['parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','../../config/logger','api','support','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','newToken','name','reason','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','json'];(function(_0x224ad9,_0x5d97a7){var _0x532997=function(_0x323951){while(--_0x323951){_0x224ad9['push'](_0x224ad9['shift']());}};_0x532997(++_0x5d97a7);}(_0xf313,0x138));var _0x3f31=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf313[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require(_0x3f31('0x0'));var https=require('https');var logger=require(_0x3f31('0x1'))(_0x3f31('0x2'));var USERNAME=_0x3f31('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x3fc88b,_0x29d7bb){var _0x4116de={'fields':{'project':{'key':_0x3fc88b[_0x3f31('0x4')]||_0x3f31('0x5')},'summary':(_0x3fc88b[_0x3f31('0x6')]||'Report')+_0x3f31('0x7')+_0x3fc88b['ip'],'description':_0x3fc88b[_0x3f31('0x8')]||JSON[_0x3f31('0x9')](_0x3fc88b),'issuetype':{'name':_0x3fc88b[_0x3f31('0xa')]||_0x3f31('0xb')}}};_0x4116de[_0x3f31('0xc')][_0x3f31('0xd')]=_0x3fc88b[_0x3f31('0xe')];_0x4116de[_0x3f31('0xc')][_0x3f31('0xf')]=_0x3fc88b[_0x3f31('0x10')];_0x4116de[_0x3f31('0xc')]['customfield_11502']=_0x3fc88b[_0x3f31('0x11')];_0x4116de['fields']['customfield_11503']=_0x3fc88b[_0x3f31('0x12')];_0x4116de['fields']['customfield_11504']=_0x3fc88b[_0x3f31('0x13')];_0x4116de['fields']['customfield_10102']=_0x3fc88b['ip'];var _0x7c14b1={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3f31('0x14'),'method':_0x3f31('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x3f31('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x3f31('0x17')](_0x3f31('0x18'))}};var _0xa6e8ec=JSON['stringify'](_0x4116de);var _0x23da61=https[_0x3f31('0x19')](_0x7c14b1,function(_0x5184cd){_0x5184cd[_0x3f31('0x1a')](_0x3f31('0x1b'));var _0xc8bcc2='';_0x5184cd['on'](_0x3f31('0x1c'),function(_0x1812ca){_0xc8bcc2+=_0x1812ca;});_0x5184cd['on'](_0x3f31('0x1d'),function(){if(_0x29d7bb){return _0x29d7bb[_0x3f31('0x1e')](_0x5184cd['statusCode'])[_0x3f31('0x1f')](JSON[_0x3f31('0x20')](_0xc8bcc2));}});});_0x23da61['on']('error',function(_0x278dfc){if(_0x29d7bb){return _0x29d7bb[_0x3f31('0x1e')](0x1f4)['json']({'errors':[{'message':_0x3f31('0x21'),'type':_0x3f31('0x22')}]});}});_0x23da61['write'](_0xa6e8ec);_0x23da61['end']();}exports[_0x3f31('0x23')]=openIssue;exports[_0x3f31('0x24')]=function(_0x4d9726,_0x1f094f){_0x4d9726[_0x3f31('0x25')]['ip']=_0x4d9726[_0x3f31('0x26')][_0x3f31('0x27')]||_0x4d9726[_0x3f31('0x28')]['remoteAddress']||_0x4d9726[_0x3f31('0x29')][_0x3f31('0x2a')]||_0x4d9726[_0x3f31('0x28')]['socket'][_0x3f31('0x2a')];return openIssue(_0x4d9726[_0x3f31('0x25')],_0x1f094f);};
\ No newline at end of file
index 15ede31..af0ea7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x3d4a2b,_0xca71a8){var _0x5c55c6=function(_0x46c01a){while(--_0x46c01a){_0x3d4a2b['push'](_0x3d4a2b['shift']());}};_0x5c55c6(++_0xca71a8);}(_0xa8a8,0xec));var _0x8a8a=function(_0x12cb40,_0x41b076){_0x12cb40=_0x12cb40-0x0;var _0x1c0502=_0xa8a8[_0x12cb40];return _0x1c0502;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8a8a('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x13')]);router[_0x8a8a('0x14')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x15')]);module[_0x8a8a('0x16')]=router;
\ No newline at end of file
+var _0x702d=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x702d,0x147));var _0xd702=function(_0x41f15b,_0x5086f3){_0x41f15b=_0x41f15b-0x0;var _0x21ffee=_0x702d[_0x41f15b];return _0x21ffee;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var fs_extra=require(_0xd702('0x5'));var auth=require(_0xd702('0x6'));var interaction=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var controller=require('./jscriptyAnswerReport.controller');router[_0xd702('0x9')]('/',auth['isAuthenticated'](),controller[_0xd702('0xa')]);router[_0xd702('0x9')](_0xd702('0xb'),auth['isAuthenticated'](),controller[_0xd702('0xc')]);router['get'](_0xd702('0xd'),auth[_0xd702('0xe')](),controller[_0xd702('0xf')]);router[_0xd702('0x10')]('/',auth[_0xd702('0xe')](),controller[_0xd702('0x11')]);router[_0xd702('0x12')](_0xd702('0xd'),auth[_0xd702('0xe')](),controller[_0xd702('0x13')]);router['delete']('/:id',auth[_0xd702('0xe')](),controller[_0xd702('0x14')]);module[_0xd702('0x15')]=router;
\ No newline at end of file
index 44a8a39..7cbcf16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0x48a045,_0x4c3bc6){_0x48a045=_0x48a045-0x0;var _0x25230d=_0x7a54[_0x48a045];return _0x25230d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x3ca06c,_0xa55791){_0x3ca06c=_0x3ca06c-0x0;var _0x5b236e=_0x7a54[_0x3ca06c];return _0x5b236e;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index 6a1d46e..10c7ce6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbb1=['reject','save','update','then','destroy','end','error','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','request-promise','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbb1,0x105));var _0x1dbb=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xdbb1[_0x1e7b16];return _0x37fadc;};'use strict';var emlformat=require(_0x1dbb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1dbb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1dbb('0x2'));var util=require('util');var path=require(_0x1dbb('0x3'));var sox=require(_0x1dbb('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dbb('0x5'));var _=require(_0x1dbb('0x6'));var squel=require(_0x1dbb('0x7'));var crypto=require(_0x1dbb('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x1dbb('0x9'));var toCsv=require(_0x1dbb('0xa'));var querystring=require('querystring');var Papa=require(_0x1dbb('0xb'));var Redis=require(_0x1dbb('0xc'));var authService=require(_0x1dbb('0xd'));var qs=require(_0x1dbb('0xe'));var as=require(_0x1dbb('0xf'));var hardwareService=require(_0x1dbb('0x10'));var logger=require(_0x1dbb('0x11'))(_0x1dbb('0x12'));var utils=require(_0x1dbb('0x13'));var config=require(_0x1dbb('0x14'));var licenseUtil=require(_0x1dbb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x425fef,_0x28c292){_0x28c292=_0x28c292||0xcc;return function(_0x332380){if(_0x332380){return _0x425fef[_0x1dbb('0x16')](_0x28c292);}return _0x425fef['status'](_0x28c292)['end']();};}function respondWithResult(_0x1d87b9,_0x175864){_0x175864=_0x175864||0xc8;return function(_0xf5f7ed){if(_0xf5f7ed){return _0x1d87b9[_0x1dbb('0x17')](_0x175864)[_0x1dbb('0x18')](_0xf5f7ed);}};}function respondWithFilteredResult(_0x539721,_0x15dc51){return function(_0x188515){if(_0x188515){var _0x409bee=typeof _0x15dc51['offset']===_0x1dbb('0x19')&&typeof _0x15dc51[_0x1dbb('0x1a')]==='undefined';var _0x2c2aa8=_0x188515[_0x1dbb('0x1b')];var _0x98b8d2=_0x409bee?0x0:_0x15dc51[_0x1dbb('0x1c')];var _0xb21bc5=_0x409bee?_0x188515[_0x1dbb('0x1b')]:_0x15dc51[_0x1dbb('0x1c')]+_0x15dc51[_0x1dbb('0x1a')];var _0x58aa43;if(_0xb21bc5>=_0x2c2aa8){_0xb21bc5=_0x2c2aa8;_0x58aa43=0xc8;}else{_0x58aa43=0xce;}_0x539721['status'](_0x58aa43);return _0x539721['set'](_0x1dbb('0x1d'),_0x98b8d2+'-'+_0xb21bc5+'/'+_0x2c2aa8)[_0x1dbb('0x18')](_0x188515);}return null;};}function patchUpdates(_0x570896){return function(_0x21e48c){try{jsonpatch[_0x1dbb('0x1e')](_0x21e48c,_0x570896,!![]);}catch(_0x23e6b2){return BPromise[_0x1dbb('0x1f')](_0x23e6b2);}return _0x21e48c[_0x1dbb('0x20')]();};}function saveUpdates(_0x3ddd80,_0x330f45){return function(_0x4b206d){if(_0x4b206d){return _0x4b206d[_0x1dbb('0x21')](_0x3ddd80)[_0x1dbb('0x22')](function(_0x2a2458){return _0x2a2458;});}return null;};}function removeEntity(_0x2d1b0c,_0x2c0993){return function(_0x429253){if(_0x429253){return _0x429253[_0x1dbb('0x23')]()[_0x1dbb('0x22')](function(){_0x2d1b0c[_0x1dbb('0x17')](0xcc)[_0x1dbb('0x24')]();});}};}function handleEntityNotFound(_0x18f188,_0x57a9f0){return function(_0x44eff7){if(!_0x44eff7){_0x18f188['sendStatus'](0x194);}return _0x44eff7;};}function handleError(_0x276818,_0x4cd836){_0x4cd836=_0x4cd836||0x1f4;return function(_0x72cfed){logger[_0x1dbb('0x25')](_0x72cfed[_0x1dbb('0x26')]);if(_0x72cfed[_0x1dbb('0x27')]){delete _0x72cfed[_0x1dbb('0x27')];}_0x276818[_0x1dbb('0x17')](_0x4cd836)['send'](_0x72cfed);};}exports[_0x1dbb('0x28')]=function(_0x410979,_0x2c2b99){var _0x4c0a9d={},_0x5557ad={},_0x12bbba={'count':0x0,'rows':[]};var _0x5df55e=_['map'](db[_0x1dbb('0x29')][_0x1dbb('0x2a')],function(_0x4511b3){return{'name':_0x4511b3[_0x1dbb('0x2b')],'type':_0x4511b3[_0x1dbb('0x2c')][_0x1dbb('0x2d')]};});_0x5557ad[_0x1dbb('0x2e')]=_[_0x1dbb('0x2f')](_0x5df55e,_0x1dbb('0x27'));_0x5557ad['query']=_['keys'](_0x410979[_0x1dbb('0x30')]);_0x5557ad[_0x1dbb('0x31')]=_[_0x1dbb('0x32')](_0x5557ad['model'],_0x5557ad['query']);_0x4c0a9d[_0x1dbb('0x33')]=_[_0x1dbb('0x32')](_0x5557ad[_0x1dbb('0x2e')],qs['fields'](_0x410979['query'][_0x1dbb('0x34')]));_0x4c0a9d[_0x1dbb('0x33')]=_0x4c0a9d['attributes'][_0x1dbb('0x35')]?_0x4c0a9d[_0x1dbb('0x33')]:_0x5557ad[_0x1dbb('0x2e')];if(!_0x410979[_0x1dbb('0x30')]['hasOwnProperty'](_0x1dbb('0x36'))){_0x4c0a9d[_0x1dbb('0x1a')]=qs[_0x1dbb('0x1a')](_0x410979[_0x1dbb('0x30')][_0x1dbb('0x1a')]);_0x4c0a9d[_0x1dbb('0x1c')]=qs['offset'](_0x410979[_0x1dbb('0x30')][_0x1dbb('0x1c')]);}_0x4c0a9d['order']=qs[_0x1dbb('0x37')](_0x410979[_0x1dbb('0x30')][_0x1dbb('0x37')]);_0x4c0a9d[_0x1dbb('0x38')]=qs[_0x1dbb('0x31')](_['pick'](_0x410979[_0x1dbb('0x30')],_0x5557ad[_0x1dbb('0x31')]),_0x5df55e);if(_0x410979[_0x1dbb('0x30')][_0x1dbb('0x39')]){_0x4c0a9d[_0x1dbb('0x38')]=_[_0x1dbb('0x3a')](_0x4c0a9d['where'],{'$or':_[_0x1dbb('0x2f')](_0x5df55e,function(_0x429151){if(_0x429151['type']!==_0x1dbb('0x3b')){var _0x41a81b={};_0x41a81b[_0x429151[_0x1dbb('0x27')]]={'$like':'%'+_0x410979[_0x1dbb('0x30')][_0x1dbb('0x39')]+'%'};return _0x41a81b;}})});}_0x4c0a9d=_[_0x1dbb('0x3a')]({},_0x4c0a9d,_0x410979[_0x1dbb('0x3c')]);var _0x2356e6={'where':_0x4c0a9d[_0x1dbb('0x38')]};return db[_0x1dbb('0x29')][_0x1dbb('0x1b')](_0x2356e6)[_0x1dbb('0x22')](function(_0x2a74a3){_0x12bbba['count']=_0x2a74a3;if(_0x410979[_0x1dbb('0x30')][_0x1dbb('0x3d')]){_0x4c0a9d[_0x1dbb('0x3e')]=[{'all':!![]}];}return db[_0x1dbb('0x29')][_0x1dbb('0x3f')](_0x4c0a9d);})[_0x1dbb('0x22')](function(_0x414609){_0x12bbba[_0x1dbb('0x40')]=_0x414609;return _0x12bbba;})[_0x1dbb('0x22')](respondWithFilteredResult(_0x2c2b99,_0x4c0a9d))[_0x1dbb('0x41')](handleError(_0x2c2b99,null));};exports[_0x1dbb('0x42')]=function(_0x23b7d0,_0x139cb4){var _0x504b80={'raw':!![],'where':{'id':_0x23b7d0[_0x1dbb('0x43')]['id']}},_0x148c2f={};_0x148c2f[_0x1dbb('0x2e')]=_[_0x1dbb('0x44')](db['JscriptyAnswerReport'][_0x1dbb('0x2a')]);_0x148c2f[_0x1dbb('0x30')]=_[_0x1dbb('0x44')](_0x23b7d0[_0x1dbb('0x30')]);_0x148c2f[_0x1dbb('0x31')]=_[_0x1dbb('0x32')](_0x148c2f[_0x1dbb('0x2e')],_0x148c2f[_0x1dbb('0x30')]);_0x504b80['attributes']=_[_0x1dbb('0x32')](_0x148c2f[_0x1dbb('0x2e')],qs[_0x1dbb('0x34')](_0x23b7d0[_0x1dbb('0x30')][_0x1dbb('0x34')]));_0x504b80[_0x1dbb('0x33')]=_0x504b80['attributes'][_0x1dbb('0x35')]?_0x504b80['attributes']:_0x148c2f[_0x1dbb('0x2e')];if(_0x23b7d0[_0x1dbb('0x30')]['includeAll']){_0x504b80[_0x1dbb('0x3e')]=[{'all':!![]}];}_0x504b80=_[_0x1dbb('0x3a')]({},_0x504b80,_0x23b7d0[_0x1dbb('0x3c')]);return db[_0x1dbb('0x29')][_0x1dbb('0x45')](_0x504b80)['then'](handleEntityNotFound(_0x139cb4,null))[_0x1dbb('0x22')](respondWithResult(_0x139cb4,null))[_0x1dbb('0x41')](handleError(_0x139cb4,null));};exports[_0x1dbb('0x46')]=function(_0x436b78,_0x19700d){return db['JscriptyAnswerReport'][_0x1dbb('0x46')](_0x436b78['body'],{})['then'](respondWithResult(_0x19700d,0xc9))[_0x1dbb('0x41')](handleError(_0x19700d,null));};exports['update']=function(_0x33969b,_0xb47fb7){if(_0x33969b[_0x1dbb('0x47')]['id']){delete _0x33969b[_0x1dbb('0x47')]['id'];}return db[_0x1dbb('0x29')][_0x1dbb('0x45')]({'where':{'id':_0x33969b['params']['id']}})[_0x1dbb('0x22')](handleEntityNotFound(_0xb47fb7,null))[_0x1dbb('0x22')](saveUpdates(_0x33969b[_0x1dbb('0x47')],null))[_0x1dbb('0x22')](respondWithResult(_0xb47fb7,null))[_0x1dbb('0x41')](handleError(_0xb47fb7,null));};exports[_0x1dbb('0x23')]=function(_0x512408,_0x47fe1e){return db[_0x1dbb('0x29')]['find']({'where':{'id':_0x512408[_0x1dbb('0x43')]['id']}})[_0x1dbb('0x22')](handleEntityNotFound(_0x47fe1e,null))[_0x1dbb('0x22')](removeEntity(_0x47fe1e,null))['catch'](handleError(_0x47fe1e,null));};exports[_0x1dbb('0x48')]=function(_0x2e4af6,_0x1dd2ba){return db[_0x1dbb('0x29')]['describe']()[_0x1dbb('0x22')](respondWithResult(_0x1dd2ba,null))[_0x1dbb('0x41')](handleError(_0x1dd2ba,null));};
\ No newline at end of file
+var _0xfc76=['send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','end','error','stack','name'];(function(_0x1f3104,_0x2dd911){var _0x164598=function(_0x4a4373){while(--_0x4a4373){_0x1f3104['push'](_0x1f3104['shift']());}};_0x164598(++_0x2dd911);}(_0xfc76,0xb5));var _0x6fc7=function(_0x1a001d,_0x433c89){_0x1a001d=_0x1a001d-0x0;var _0x5438f5=_0xfc76[_0x1a001d];return _0x5438f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fc7('0x0'));var zipdir=require(_0x6fc7('0x1'));var jsonpatch=require(_0x6fc7('0x2'));var rp=require(_0x6fc7('0x3'));var moment=require(_0x6fc7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6fc7('0x5'));var util=require(_0x6fc7('0x6'));var path=require('path');var sox=require(_0x6fc7('0x7'));var csv=require('to-csv');var ejs=require(_0x6fc7('0x8'));var fs=require('fs');var fs_extra=require(_0x6fc7('0x9'));var _=require(_0x6fc7('0xa'));var squel=require('squel');var crypto=require(_0x6fc7('0xb'));var jsforce=require(_0x6fc7('0xc'));var deskjs=require(_0x6fc7('0xd'));var toCsv=require(_0x6fc7('0xe'));var querystring=require(_0x6fc7('0xf'));var Papa=require(_0x6fc7('0x10'));var Redis=require('ioredis');var authService=require(_0x6fc7('0x11'));var qs=require(_0x6fc7('0x12'));var as=require(_0x6fc7('0x13'));var hardwareService=require(_0x6fc7('0x14'));var logger=require(_0x6fc7('0x15'))(_0x6fc7('0x16'));var utils=require('../../config/utils');var config=require(_0x6fc7('0x17'));var licenseUtil=require(_0x6fc7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x433adc,_0x2c32b8){_0x2c32b8=_0x2c32b8||0xcc;return function(_0x5f438d){if(_0x5f438d){return _0x433adc[_0x6fc7('0x19')](_0x2c32b8);}return _0x433adc[_0x6fc7('0x1a')](_0x2c32b8)['end']();};}function respondWithResult(_0x44d8e0,_0x3c107f){_0x3c107f=_0x3c107f||0xc8;return function(_0x10a482){if(_0x10a482){return _0x44d8e0['status'](_0x3c107f)['json'](_0x10a482);}};}function respondWithFilteredResult(_0xbb4a3e,_0x45d585){return function(_0x499bcc){if(_0x499bcc){var _0x2b0122=typeof _0x45d585[_0x6fc7('0x1b')]===_0x6fc7('0x1c')&&typeof _0x45d585[_0x6fc7('0x1d')]==='undefined';var _0x816704=_0x499bcc[_0x6fc7('0x1e')];var _0x280c69=_0x2b0122?0x0:_0x45d585[_0x6fc7('0x1b')];var _0x12be21=_0x2b0122?_0x499bcc[_0x6fc7('0x1e')]:_0x45d585['offset']+_0x45d585[_0x6fc7('0x1d')];var _0x124893;if(_0x12be21>=_0x816704){_0x12be21=_0x816704;_0x124893=0xc8;}else{_0x124893=0xce;}_0xbb4a3e[_0x6fc7('0x1a')](_0x124893);return _0xbb4a3e[_0x6fc7('0x1f')](_0x6fc7('0x20'),_0x280c69+'-'+_0x12be21+'/'+_0x816704)['json'](_0x499bcc);}return null;};}function patchUpdates(_0x277f9e){return function(_0x2427a){try{jsonpatch['apply'](_0x2427a,_0x277f9e,!![]);}catch(_0x17b9e3){return BPromise['reject'](_0x17b9e3);}return _0x2427a[_0x6fc7('0x21')]();};}function saveUpdates(_0x4f583c,_0x11b359){return function(_0xdb5974){if(_0xdb5974){return _0xdb5974[_0x6fc7('0x22')](_0x4f583c)['then'](function(_0x45e53e){return _0x45e53e;});}return null;};}function removeEntity(_0x4a4cdf,_0x2dd21a){return function(_0xdd4827){if(_0xdd4827){return _0xdd4827[_0x6fc7('0x23')]()[_0x6fc7('0x24')](function(){_0x4a4cdf[_0x6fc7('0x1a')](0xcc)[_0x6fc7('0x25')]();});}};}function handleEntityNotFound(_0x190680,_0x817221){return function(_0x2b6b55){if(!_0x2b6b55){_0x190680[_0x6fc7('0x19')](0x194);}return _0x2b6b55;};}function handleError(_0xaa2687,_0x426872){_0x426872=_0x426872||0x1f4;return function(_0x4612d4){logger[_0x6fc7('0x26')](_0x4612d4[_0x6fc7('0x27')]);if(_0x4612d4['name']){delete _0x4612d4[_0x6fc7('0x28')];}_0xaa2687[_0x6fc7('0x1a')](_0x426872)[_0x6fc7('0x29')](_0x4612d4);};}exports[_0x6fc7('0x2a')]=function(_0x5c1fd3,_0xfff989){var _0x30e579={},_0xa93a4f={},_0x2aa91c={'count':0x0,'rows':[]};var _0x34bf7f=_[_0x6fc7('0x2b')](db[_0x6fc7('0x2c')][_0x6fc7('0x2d')],function(_0x59a70e){return{'name':_0x59a70e['fieldName'],'type':_0x59a70e[_0x6fc7('0x2e')][_0x6fc7('0x2f')]};});_0xa93a4f[_0x6fc7('0x30')]=_[_0x6fc7('0x2b')](_0x34bf7f,_0x6fc7('0x28'));_0xa93a4f[_0x6fc7('0x31')]=_['keys'](_0x5c1fd3[_0x6fc7('0x31')]);_0xa93a4f[_0x6fc7('0x32')]=_[_0x6fc7('0x33')](_0xa93a4f[_0x6fc7('0x30')],_0xa93a4f['query']);_0x30e579['attributes']=_['intersection'](_0xa93a4f[_0x6fc7('0x30')],qs[_0x6fc7('0x34')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x34')]));_0x30e579[_0x6fc7('0x35')]=_0x30e579[_0x6fc7('0x35')][_0x6fc7('0x36')]?_0x30e579[_0x6fc7('0x35')]:_0xa93a4f[_0x6fc7('0x30')];if(!_0x5c1fd3['query'][_0x6fc7('0x37')]('nolimit')){_0x30e579[_0x6fc7('0x1d')]=qs[_0x6fc7('0x1d')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x1d')]);_0x30e579['offset']=qs[_0x6fc7('0x1b')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x1b')]);}_0x30e579[_0x6fc7('0x38')]=qs['sort'](_0x5c1fd3[_0x6fc7('0x31')]['sort']);_0x30e579[_0x6fc7('0x39')]=qs['filters'](_['pick'](_0x5c1fd3['query'],_0xa93a4f[_0x6fc7('0x32')]),_0x34bf7f);if(_0x5c1fd3['query'][_0x6fc7('0x3a')]){_0x30e579[_0x6fc7('0x39')]=_[_0x6fc7('0x3b')](_0x30e579[_0x6fc7('0x39')],{'$or':_[_0x6fc7('0x2b')](_0x34bf7f,function(_0xc1fbf7){if(_0xc1fbf7[_0x6fc7('0x2e')]!==_0x6fc7('0x3c')){var _0x18e6f7={};_0x18e6f7[_0xc1fbf7[_0x6fc7('0x28')]]={'$like':'%'+_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x3a')]+'%'};return _0x18e6f7;}})});}_0x30e579=_[_0x6fc7('0x3b')]({},_0x30e579,_0x5c1fd3[_0x6fc7('0x3d')]);var _0x3ac76e={'where':_0x30e579[_0x6fc7('0x39')]};return db[_0x6fc7('0x2c')][_0x6fc7('0x1e')](_0x3ac76e)['then'](function(_0x490f2e){_0x2aa91c[_0x6fc7('0x1e')]=_0x490f2e;if(_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x3e')]){_0x30e579[_0x6fc7('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6fc7('0x40')](_0x30e579);})[_0x6fc7('0x24')](function(_0x27f6dc){_0x2aa91c[_0x6fc7('0x41')]=_0x27f6dc;return _0x2aa91c;})[_0x6fc7('0x24')](respondWithFilteredResult(_0xfff989,_0x30e579))[_0x6fc7('0x42')](handleError(_0xfff989,null));};exports[_0x6fc7('0x43')]=function(_0x4754da,_0x1e33cd){var _0x2d8ca4={'raw':!![],'where':{'id':_0x4754da[_0x6fc7('0x44')]['id']}},_0x20bc07={};_0x20bc07['model']=_[_0x6fc7('0x45')](db[_0x6fc7('0x2c')]['rawAttributes']);_0x20bc07[_0x6fc7('0x31')]=_[_0x6fc7('0x45')](_0x4754da[_0x6fc7('0x31')]);_0x20bc07[_0x6fc7('0x32')]=_[_0x6fc7('0x33')](_0x20bc07[_0x6fc7('0x30')],_0x20bc07[_0x6fc7('0x31')]);_0x2d8ca4[_0x6fc7('0x35')]=_[_0x6fc7('0x33')](_0x20bc07[_0x6fc7('0x30')],qs['fields'](_0x4754da[_0x6fc7('0x31')][_0x6fc7('0x34')]));_0x2d8ca4['attributes']=_0x2d8ca4['attributes'][_0x6fc7('0x36')]?_0x2d8ca4[_0x6fc7('0x35')]:_0x20bc07[_0x6fc7('0x30')];if(_0x4754da['query'][_0x6fc7('0x3e')]){_0x2d8ca4[_0x6fc7('0x3f')]=[{'all':!![]}];}_0x2d8ca4=_['merge']({},_0x2d8ca4,_0x4754da[_0x6fc7('0x3d')]);return db[_0x6fc7('0x2c')][_0x6fc7('0x46')](_0x2d8ca4)[_0x6fc7('0x24')](handleEntityNotFound(_0x1e33cd,null))[_0x6fc7('0x24')](respondWithResult(_0x1e33cd,null))[_0x6fc7('0x42')](handleError(_0x1e33cd,null));};exports[_0x6fc7('0x47')]=function(_0xb6cf9b,_0x357d7a){return db[_0x6fc7('0x2c')][_0x6fc7('0x47')](_0xb6cf9b['body'],{})['then'](respondWithResult(_0x357d7a,0xc9))['catch'](handleError(_0x357d7a,null));};exports['update']=function(_0x22a0c5,_0x5d4d40){if(_0x22a0c5[_0x6fc7('0x48')]['id']){delete _0x22a0c5[_0x6fc7('0x48')]['id'];}return db[_0x6fc7('0x2c')][_0x6fc7('0x46')]({'where':{'id':_0x22a0c5[_0x6fc7('0x44')]['id']}})[_0x6fc7('0x24')](handleEntityNotFound(_0x5d4d40,null))['then'](saveUpdates(_0x22a0c5[_0x6fc7('0x48')],null))[_0x6fc7('0x24')](respondWithResult(_0x5d4d40,null))['catch'](handleError(_0x5d4d40,null));};exports[_0x6fc7('0x23')]=function(_0x24bf3e,_0x3b2506){return db[_0x6fc7('0x2c')][_0x6fc7('0x46')]({'where':{'id':_0x24bf3e[_0x6fc7('0x44')]['id']}})[_0x6fc7('0x24')](handleEntityNotFound(_0x3b2506,null))[_0x6fc7('0x24')](removeEntity(_0x3b2506,null))[_0x6fc7('0x42')](handleError(_0x3b2506,null));};exports[_0x6fc7('0x49')]=function(_0x4ced40,_0x4684bd){return db[_0x6fc7('0x2c')][_0x6fc7('0x49')]()['then'](respondWithResult(_0x4684bd,null))[_0x6fc7('0x42')](handleError(_0x4684bd,null));};
\ No newline at end of file
index 3d782b3..7eee0ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e5d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers'];(function(_0x27a2d9,_0x4ea94f){var _0x482aed=function(_0x15346e){while(--_0x15346e){_0x27a2d9['push'](_0x27a2d9['shift']());}};_0x482aed(++_0x4ea94f);}(_0x1e5d,0xe0));var _0xd1e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e5d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1e5('0x0'));var util=require(_0xd1e5('0x1'));var logger=require(_0xd1e5('0x2'))(_0xd1e5('0x3'));var moment=require(_0xd1e5('0x4'));var BPromise=require(_0xd1e5('0x5'));var rp=require(_0xd1e5('0x6'));var fs=require('fs');var path=require(_0xd1e5('0x7'));var rimraf=require(_0xd1e5('0x8'));var config=require(_0xd1e5('0x9'));var attributes=require(_0xd1e5('0xa'));module[_0xd1e5('0xb')]=function(_0x302be9,_0x618782){return _0x302be9[_0xd1e5('0xc')]('JscriptyAnswerReport',attributes,{'tableName':_0xd1e5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4784=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x183059,_0x550af5){var _0xb82178=function(_0x4a0693){while(--_0x4a0693){_0x183059['push'](_0x183059['shift']());}};_0xb82178(++_0x550af5);}(_0x4784,0x1ee));var _0x4478=function(_0x2bf986,_0x180621){_0x2bf986=_0x2bf986-0x0;var _0x41aea9=_0x4784[_0x2bf986];return _0x41aea9;};'use strict';var _=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var logger=require(_0x4478('0x2'))(_0x4478('0x3'));var moment=require('moment');var BPromise=require(_0x4478('0x4'));var rp=require(_0x4478('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4478('0x6'));var config=require(_0x4478('0x7'));var attributes=require(_0x4478('0x8'));module[_0x4478('0x9')]=function(_0x29fe81,_0x1b194c){return _0x29fe81[_0x4478('0xa')](_0x4478('0xb'),attributes,{'tableName':_0x4478('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8540c1b..5365567 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ef=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xc4ef,0x7b));var _0xfc4e=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xc4ef[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xfc4e('0x0'));var util=require(_0xfc4e('0x1'));var moment=require(_0xfc4e('0x2'));var BPromise=require(_0xfc4e('0x3'));var rs=require(_0xfc4e('0x4'));var fs=require('fs');var Redis=require(_0xfc4e('0x5'));var db=require(_0xfc4e('0x6'))['db'];var utils=require(_0xfc4e('0x7'));var logger=require('../../config/logger')(_0xfc4e('0x8'));var config=require(_0xfc4e('0x9'));var jayson=require(_0xfc4e('0xa'));var client=jayson[_0xfc4e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48b7ce,_0x130af5,_0x13f5e0){return new BPromise(function(_0x3f1eac,_0x1af8b2){return client[_0xfc4e('0xc')](_0x48b7ce,_0x13f5e0)[_0xfc4e('0xd')](function(_0x3d646c){logger[_0xfc4e('0xe')](_0xfc4e('0xf'),_0x130af5,_0xfc4e('0x10'));logger[_0xfc4e('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x130af5,'request\x20sent',JSON[_0xfc4e('0x12')](_0x3d646c));if(_0x3d646c[_0xfc4e('0x13')]){if(_0x3d646c[_0xfc4e('0x13')][_0xfc4e('0x14')]===0x1f4){logger[_0xfc4e('0x13')](_0xfc4e('0xf'),_0x130af5,_0x3d646c[_0xfc4e('0x13')]['message']);return _0x1af8b2(_0x3d646c[_0xfc4e('0x13')][_0xfc4e('0x15')]);}logger['error'](_0xfc4e('0xf'),_0x130af5,_0x3d646c[_0xfc4e('0x13')][_0xfc4e('0x15')]);return _0x3f1eac(_0x3d646c['error'][_0xfc4e('0x15')]);}else{logger[_0xfc4e('0xe')](_0xfc4e('0xf'),_0x130af5,_0xfc4e('0x10'));_0x3f1eac(_0x3d646c[_0xfc4e('0x16')][_0xfc4e('0x15')]);}})[_0xfc4e('0x17')](function(_0x5abec3){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x130af5,_0x5abec3);_0x1af8b2(_0x5abec3);});});}
\ No newline at end of file
+var _0x3c19=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment'];(function(_0xb60ae4,_0x48b458){var _0x53d530=function(_0x5c0743){while(--_0x5c0743){_0xb60ae4['push'](_0xb60ae4['shift']());}};_0x53d530(++_0x48b458);}(_0x3c19,0xb5));var _0x93c1=function(_0x5a89bf,_0x24a8c1){_0x5a89bf=_0x5a89bf-0x0;var _0x572b3c=_0x3c19[_0x5a89bf];return _0x572b3c;};'use strict';var _=require(_0x93c1('0x0'));var util=require(_0x93c1('0x1'));var moment=require(_0x93c1('0x2'));var BPromise=require(_0x93c1('0x3'));var rs=require(_0x93c1('0x4'));var fs=require('fs');var Redis=require(_0x93c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x93c1('0x6'));var logger=require(_0x93c1('0x7'))(_0x93c1('0x8'));var config=require(_0x93c1('0x9'));var jayson=require(_0x93c1('0xa'));var client=jayson['client'][_0x93c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e80c3,_0x5a6c3b,_0x488527){return new BPromise(function(_0x21f661,_0x2d6d9d){return client['request'](_0x4e80c3,_0x488527)[_0x93c1('0xc')](function(_0x173a8f){logger[_0x93c1('0xd')](_0x93c1('0xe'),_0x5a6c3b,'request\x20sent');logger[_0x93c1('0xf')](_0x93c1('0x10'),_0x5a6c3b,_0x93c1('0x11'),JSON[_0x93c1('0x12')](_0x173a8f));if(_0x173a8f['error']){if(_0x173a8f[_0x93c1('0x13')][_0x93c1('0x14')]===0x1f4){logger[_0x93c1('0x13')](_0x93c1('0xe'),_0x5a6c3b,_0x173a8f['error'][_0x93c1('0x15')]);return _0x2d6d9d(_0x173a8f[_0x93c1('0x13')][_0x93c1('0x15')]);}logger[_0x93c1('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5a6c3b,_0x173a8f[_0x93c1('0x13')][_0x93c1('0x15')]);return _0x21f661(_0x173a8f['error'][_0x93c1('0x15')]);}else{logger[_0x93c1('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5a6c3b,'request\x20sent');_0x21f661(_0x173a8f[_0x93c1('0x16')][_0x93c1('0x15')]);}})['catch'](function(_0x42ed75){logger['error'](_0x93c1('0xe'),_0x5a6c3b,_0x42ed75);_0x2d6d9d(_0x42ed75);});});}
\ No newline at end of file
index 55384bf..4645c98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe46a=['../../config/environment','./jscriptyProject.controller','get','index','/:id','show','/:id/sessions','isAuthenticated','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7c273c,_0x8acb68){var _0xaad96d=function(_0x4e4763){while(--_0x4e4763){_0x7c273c['push'](_0x7c273c['shift']());}};_0xaad96d(++_0x8acb68);}(_0xe46a,0xc8));var _0xae46=function(_0x15faa3,_0x91b6d5){_0x15faa3=_0x15faa3-0x0;var _0x2e3ca5=_0xe46a[_0x15faa3];return _0x2e3ca5;};'use strict';var multer=require(_0xae46('0x0'));var util=require('util');var path=require(_0xae46('0x1'));var timeout=require(_0xae46('0x2'));var express=require(_0xae46('0x3'));var router=express[_0xae46('0x4')]();var fs_extra=require(_0xae46('0x5'));var auth=require(_0xae46('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae46('0x7'));var controller=require(_0xae46('0x8'));router[_0xae46('0x9')]('/',auth['isAuthenticated'](),controller[_0xae46('0xa')]);router[_0xae46('0x9')](_0xae46('0xb'),auth['isAuthenticated'](),controller[_0xae46('0xc')]);router['get'](_0xae46('0xd'),auth[_0xae46('0xe')](),controller['getSessions']);router['get']('/:id/answers',auth[_0xae46('0xe')](),controller['getAnswers']);router[_0xae46('0x9')](_0xae46('0xf'),auth[_0xae46('0xe')](),timeout(_0xae46('0x10')),controller[_0xae46('0x11')]);router[_0xae46('0x12')]('/',auth[_0xae46('0xe')](),controller[_0xae46('0x13')]);router[_0xae46('0x12')](_0xae46('0x14'),auth[_0xae46('0xe')](),controller[_0xae46('0x15')]);router['put']('/:id',auth[_0xae46('0xe')](),controller['update']);router[_0xae46('0x16')]('/:id',auth[_0xae46('0xe')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf5d1=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','getSummary','post','create','/:id/clone','clone','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5d1,0x15d));var _0x1f5d=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0xf5d1[_0x441563];return _0x2369ec;};'use strict';var multer=require(_0x1f5d('0x0'));var util=require(_0x1f5d('0x1'));var path=require(_0x1f5d('0x2'));var timeout=require(_0x1f5d('0x3'));var express=require(_0x1f5d('0x4'));var router=express[_0x1f5d('0x5')]();var fs_extra=require(_0x1f5d('0x6'));var auth=require(_0x1f5d('0x7'));var interaction=require(_0x1f5d('0x8'));var config=require(_0x1f5d('0x9'));var controller=require(_0x1f5d('0xa'));router[_0x1f5d('0xb')]('/',auth[_0x1f5d('0xc')](),controller[_0x1f5d('0xd')]);router[_0x1f5d('0xb')](_0x1f5d('0xe'),auth[_0x1f5d('0xc')](),controller[_0x1f5d('0xf')]);router[_0x1f5d('0xb')](_0x1f5d('0x10'),auth['isAuthenticated'](),controller[_0x1f5d('0x11')]);router['get'](_0x1f5d('0x12'),auth[_0x1f5d('0xc')](),controller[_0x1f5d('0x13')]);router[_0x1f5d('0xb')]('/:id/summary',auth[_0x1f5d('0xc')](),timeout('30s'),controller[_0x1f5d('0x14')]);router[_0x1f5d('0x15')]('/',auth[_0x1f5d('0xc')](),controller[_0x1f5d('0x16')]);router['post'](_0x1f5d('0x17'),auth[_0x1f5d('0xc')](),controller[_0x1f5d('0x18')]);router[_0x1f5d('0x19')](_0x1f5d('0xe'),auth[_0x1f5d('0xc')](),controller[_0x1f5d('0x1a')]);router[_0x1f5d('0x1b')](_0x1f5d('0xe'),auth[_0x1f5d('0xc')](),controller['destroy']);module[_0x1f5d('0x1c')]=router;
\ No newline at end of file
index b910b64..940c361 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36eb=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','lodash','exports','STRING','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format'];(function(_0x50e642,_0x4c16c7){var _0x336581=function(_0x422a5e){while(--_0x422a5e){_0x50e642['push'](_0x50e642['shift']());}};_0x336581(++_0x4c16c7);}(_0x36eb,0x1c5));var _0xb36e=function(_0x38441f,_0x32c8fc){_0x38441f=_0x38441f-0x0;var _0x58fd3e=_0x36eb[_0x38441f];return _0x58fd3e;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb36e('0x0'));var util=require('util');module[_0xb36e('0x1')]={'name':{'type':Sequelize[_0xb36e('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xb36e('0x2')]},'formData':{'type':Sequelize[_0xb36e('0x3')](_0xb36e('0x4')),'set':function(_0x1b90e1){if(_[_0xb36e('0x5')](_0x1b90e1)){this[_0xb36e('0x6')]('formData',JSON[_0xb36e('0x7')](_0x1b90e1));}else if(_[_0xb36e('0x8')](_0x1b90e1)){this[_0xb36e('0x6')](_0xb36e('0x9'),_0x1b90e1);}else{this['setDataValue']('formData',util[_0xb36e('0xa')](_0xb36e('0xb'),this[_0xb36e('0xc')](_0xb36e('0xd'))||'',this[_0xb36e('0xc')](_0xb36e('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb36e('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x217c=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','STRING','name','TEXT','isObjectLike','setDataValue'];(function(_0x325e59,_0x1dbdbc){var _0x3a44ed=function(_0xdf97df){while(--_0xdf97df){_0x325e59['push'](_0x325e59['shift']());}};_0x3a44ed(++_0x1dbdbc);}(_0x217c,0x143));var _0xc217=function(_0x4baa44,_0x202720){_0x4baa44=_0x4baa44-0x0;var _0xccec5f=_0x217c[_0x4baa44];return _0xccec5f;};'use strict';var Sequelize=require(_0xc217('0x0'));var _=require(_0xc217('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xc217('0x2')],'unique':_0xc217('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xc217('0x4')]('long'),'set':function(_0x2ae155){if(_[_0xc217('0x5')](_0x2ae155)){this['setDataValue']('formData',JSON['stringify'](_0x2ae155));}else if(_['isString'](_0x2ae155)){this[_0xc217('0x6')]('formData',_0x2ae155);}else{this[_0xc217('0x6')]('formData',util[_0xc217('0x7')](_0xc217('0x8'),this[_0xc217('0x9')](_0xc217('0x3'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc217('0xa')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc217('0xa')],'defaultValue':![]}};
\ No newline at end of file
index 3e44849..d447cbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3da6=['stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','length','order','sort','where','filters','filter','merge','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','user','autoAssociation','error','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','JscriptySessionReport','hasOwnProperty','nolimit','ProjectId','getAnswers','JscriptyAnswerReport','pick','fromCharCode','apply','toString','indexOf','replace','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','push','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource'];(function(_0x10b631,_0x2b9e18){var _0x111838=function(_0x42fc89){while(--_0x42fc89){_0x10b631['push'](_0x10b631['shift']());}};_0x111838(++_0x2b9e18);}(_0x3da6,0xc1));var _0x63da=function(_0x3017b8,_0x24f192){_0x3017b8=_0x3017b8-0x0;var _0x53410f=_0x3da6[_0x3017b8];return _0x53410f;};'use strict';var emlformat=require(_0x63da('0x0'));var rimraf=require(_0x63da('0x1'));var zipdir=require(_0x63da('0x2'));var jsonpatch=require(_0x63da('0x3'));var rp=require(_0x63da('0x4'));var moment=require(_0x63da('0x5'));var BPromise=require(_0x63da('0x6'));var Mustache=require('mustache');var util=require(_0x63da('0x7'));var path=require(_0x63da('0x8'));var sox=require('sox');var csv=require(_0x63da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63da('0xa'));var _=require('lodash');var squel=require(_0x63da('0xb'));var crypto=require(_0x63da('0xc'));var jsforce=require(_0x63da('0xd'));var deskjs=require(_0x63da('0xe'));var toCsv=require('to-csv');var querystring=require(_0x63da('0xf'));var Papa=require(_0x63da('0x10'));var Redis=require('ioredis');var authService=require(_0x63da('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x63da('0x12'));var hardwareService=require(_0x63da('0x13'));var logger=require(_0x63da('0x14'))(_0x63da('0x15'));var utils=require(_0x63da('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x63da('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22b0aa,_0x1a228a){_0x1a228a=_0x1a228a||0xcc;return function(_0x30d1bd){if(_0x30d1bd){return _0x22b0aa[_0x63da('0x18')](_0x1a228a);}return _0x22b0aa[_0x63da('0x19')](_0x1a228a)[_0x63da('0x1a')]();};}function respondWithResult(_0x40c5cf,_0x2ad591){_0x2ad591=_0x2ad591||0xc8;return function(_0x37ce36){if(_0x37ce36){return _0x40c5cf[_0x63da('0x19')](_0x2ad591)[_0x63da('0x1b')](_0x37ce36);}};}function respondWithFilteredResult(_0x2173bd,_0x2be621){return function(_0x4e6084){if(_0x4e6084){var _0x48ac11=typeof _0x2be621[_0x63da('0x1c')]==='undefined'&&typeof _0x2be621[_0x63da('0x1d')]===_0x63da('0x1e');var _0x329ef4=_0x4e6084[_0x63da('0x1f')];var _0xaf41cb=_0x48ac11?0x0:_0x2be621['offset'];var _0x8ce2aa=_0x48ac11?_0x4e6084['count']:_0x2be621['offset']+_0x2be621[_0x63da('0x1d')];var _0x4a4cca;if(_0x8ce2aa>=_0x329ef4){_0x8ce2aa=_0x329ef4;_0x4a4cca=0xc8;}else{_0x4a4cca=0xce;}_0x2173bd[_0x63da('0x19')](_0x4a4cca);return _0x2173bd[_0x63da('0x20')](_0x63da('0x21'),_0xaf41cb+'-'+_0x8ce2aa+'/'+_0x329ef4)['json'](_0x4e6084);}return null;};}function patchUpdates(_0xdeeb40){return function(_0x112193){try{jsonpatch['apply'](_0x112193,_0xdeeb40,!![]);}catch(_0x30d5ef){return BPromise[_0x63da('0x22')](_0x30d5ef);}return _0x112193[_0x63da('0x23')]();};}function saveUpdates(_0x24ae30,_0x1e777b){return function(_0x33e5c6){if(_0x33e5c6){return _0x33e5c6[_0x63da('0x24')](_0x24ae30)[_0x63da('0x25')](function(_0x430b35){return _0x430b35;});}return null;};}function removeEntity(_0x524c08,_0x55df4a){return function(_0xef0017){if(_0xef0017){return _0xef0017[_0x63da('0x26')]()[_0x63da('0x25')](function(){var _0x45a021=_0xef0017[_0x63da('0x27')]({'plain':!![]});var _0x716174='Projects';return db[_0x63da('0x28')][_0x63da('0x26')]({'where':{'type':_0x716174,'resourceId':_0x45a021['id']}})[_0x63da('0x25')](function(){return _0xef0017;});})[_0x63da('0x25')](function(){_0x524c08['status'](0xcc)[_0x63da('0x1a')]();});}};}function handleEntityNotFound(_0x274b71,_0x441337){return function(_0x3505b0){if(!_0x3505b0){_0x274b71[_0x63da('0x18')](0x194);}return _0x3505b0;};}function handleError(_0x21cb98,_0x3e2655){_0x3e2655=_0x3e2655||0x1f4;return function(_0x4b5e64){logger['error'](_0x4b5e64[_0x63da('0x29')]);if(_0x4b5e64[_0x63da('0x2a')]){delete _0x4b5e64[_0x63da('0x2a')];}_0x21cb98[_0x63da('0x19')](_0x3e2655)[_0x63da('0x2b')](_0x4b5e64);};}exports[_0x63da('0x2c')]=function(_0x21530d,_0x152655){var _0x56fcda={},_0x59c9ef={},_0x3fb195={'count':0x0,'rows':[]};var _0x56e957=_[_0x63da('0x2d')](db[_0x63da('0x2e')][_0x63da('0x2f')],function(_0x10332b){return{'name':_0x10332b[_0x63da('0x30')],'type':_0x10332b[_0x63da('0x31')][_0x63da('0x32')]};});_0x59c9ef[_0x63da('0x33')]=_['map'](_0x56e957,'name');_0x59c9ef['query']=_[_0x63da('0x34')](_0x21530d['query']);_0x59c9ef['filters']=_[_0x63da('0x35')](_0x59c9ef[_0x63da('0x33')],_0x59c9ef[_0x63da('0x36')]);_0x56fcda[_0x63da('0x37')]=_[_0x63da('0x35')](_0x59c9ef['model'],qs['fields'](_0x21530d[_0x63da('0x36')]['fields']));_0x56fcda[_0x63da('0x37')]=_0x56fcda[_0x63da('0x37')][_0x63da('0x38')]?_0x56fcda[_0x63da('0x37')]:_0x59c9ef[_0x63da('0x33')];if(!_0x21530d['query']['hasOwnProperty']('nolimit')){_0x56fcda[_0x63da('0x1d')]=qs[_0x63da('0x1d')](_0x21530d[_0x63da('0x36')][_0x63da('0x1d')]);_0x56fcda['offset']=qs['offset'](_0x21530d[_0x63da('0x36')][_0x63da('0x1c')]);}_0x56fcda[_0x63da('0x39')]=qs[_0x63da('0x3a')](_0x21530d[_0x63da('0x36')][_0x63da('0x3a')]);_0x56fcda[_0x63da('0x3b')]=qs['filters'](_['pick'](_0x21530d[_0x63da('0x36')],_0x59c9ef[_0x63da('0x3c')]),_0x56e957);if(_0x21530d[_0x63da('0x36')][_0x63da('0x3d')]){_0x56fcda[_0x63da('0x3b')]=_[_0x63da('0x3e')](_0x56fcda['where'],{'$or':_['map'](_0x56e957,function(_0x4bd485){if(_0x4bd485[_0x63da('0x31')]!=='VIRTUAL'){var _0xf439c6={};_0xf439c6[_0x4bd485['name']]={'$like':'%'+_0x21530d[_0x63da('0x36')][_0x63da('0x3d')]+'%'};return _0xf439c6;}})});}_0x56fcda=_['merge']({},_0x56fcda,_0x21530d[_0x63da('0x3f')]);var _0x5b08c8={'where':_0x56fcda[_0x63da('0x3b')]};return db['JscriptyProject']['count'](_0x5b08c8)[_0x63da('0x25')](function(_0x5341af){_0x3fb195[_0x63da('0x1f')]=_0x5341af;if(_0x21530d['query']['includeAll']){_0x56fcda['include']=[{'all':!![]}];}return db[_0x63da('0x2e')][_0x63da('0x40')](_0x56fcda);})['then'](function(_0x5b999c){_0x3fb195[_0x63da('0x41')]=_0x5b999c;return _0x3fb195;})[_0x63da('0x25')](respondWithFilteredResult(_0x152655,_0x56fcda))[_0x63da('0x42')](handleError(_0x152655,null));};exports[_0x63da('0x43')]=function(_0x1dd93c,_0x296e03){var _0x1441e8={'raw':![],'where':{'id':_0x1dd93c[_0x63da('0x44')]['id']}},_0x2498eb={};_0x2498eb[_0x63da('0x33')]=_[_0x63da('0x34')](db[_0x63da('0x2e')]['rawAttributes']);_0x2498eb['query']=_['keys'](_0x1dd93c[_0x63da('0x36')]);_0x2498eb['filters']=_[_0x63da('0x35')](_0x2498eb[_0x63da('0x33')],_0x2498eb[_0x63da('0x36')]);_0x1441e8[_0x63da('0x37')]=_[_0x63da('0x35')](_0x2498eb[_0x63da('0x33')],qs[_0x63da('0x45')](_0x1dd93c[_0x63da('0x36')]['fields']));_0x1441e8['attributes']=_0x1441e8['attributes'][_0x63da('0x38')]?_0x1441e8[_0x63da('0x37')]:_0x2498eb[_0x63da('0x33')];if(_0x1dd93c['query'][_0x63da('0x46')]){_0x1441e8[_0x63da('0x47')]=[{'all':!![]}];}_0x1441e8=_[_0x63da('0x3e')]({},_0x1441e8,_0x1dd93c[_0x63da('0x3f')]);return db[_0x63da('0x2e')][_0x63da('0x48')](_0x1441e8)['then'](handleEntityNotFound(_0x296e03,null))[_0x63da('0x25')](respondWithResult(_0x296e03,null))[_0x63da('0x42')](handleError(_0x296e03,null));};exports['create']=function(_0x1be74e,_0x239657){return db[_0x63da('0x2e')][_0x63da('0x49')](_0x1be74e[_0x63da('0x4a')],{})[_0x63da('0x25')](function(_0x4fadcc){var _0x8bb803=_0x1be74e['user'][_0x63da('0x27')]({'plain':!![]});if(!_0x8bb803)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8bb803['role']===_0x63da('0x4b')){var _0x18e42f=_0x4fadcc['get']({'plain':!![]});var _0x207b8e='Projects';return db['UserProfileSection'][_0x63da('0x48')]({'where':{'name':_0x207b8e,'userProfileId':_0x8bb803['userProfileId']},'raw':!![]})['then'](function(_0x40d3cf){if(_0x40d3cf&&_0x40d3cf[_0x63da('0x4c')]===0x0){return db[_0x63da('0x28')][_0x63da('0x49')]({'name':_0x18e42f[_0x63da('0x2a')],'resourceId':_0x18e42f['id'],'type':_0x40d3cf[_0x63da('0x2a')],'sectionId':_0x40d3cf['id']},{})[_0x63da('0x25')](function(){return _0x4fadcc;});}else{return _0x4fadcc;}})[_0x63da('0x42')](function(_0x3024c8){logger[_0x63da('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3024c8);throw _0x3024c8;});}return _0x4fadcc;})[_0x63da('0x25')](respondWithResult(_0x239657,0xc9))[_0x63da('0x42')](handleError(_0x239657,null));};exports[_0x63da('0x4e')]=function(_0xb7eaf6,_0x157532){var _0x37c6d7={'where':{'id':_0xb7eaf6[_0x63da('0x44')]['id']}},_0xd6b1b2={};_0xd6b1b2[_0x63da('0x33')]=_[_0x63da('0x34')](db['JscriptyProject'][_0x63da('0x2f')]);_0x37c6d7[_0x63da('0x37')]=_['intersection'](_0xd6b1b2[_0x63da('0x33')],qs[_0x63da('0x45')](_0xb7eaf6[_0x63da('0x36')][_0x63da('0x45')]));_0x37c6d7[_0x63da('0x37')]=_0x37c6d7[_0x63da('0x37')][_0x63da('0x38')]?_0x37c6d7[_0x63da('0x37')]:_0xd6b1b2[_0x63da('0x33')];if(_0xb7eaf6['query'][_0x63da('0x46')]){_0x37c6d7[_0x63da('0x47')]=[{'all':!![]}];}_0x37c6d7=_[_0x63da('0x3e')]({},_0x37c6d7,_0xb7eaf6[_0x63da('0x3f')]);return db[_0x63da('0x2e')][_0x63da('0x48')](_0x37c6d7)[_0x63da('0x25')](handleEntityNotFound(_0x157532,null))[_0x63da('0x25')](function(_0x4d0471){if(_0x4d0471){var _0x93a6a3=_0x4d0471[_0x63da('0x27')]({'plain':!![]});_0x93a6a3=qs[_0x63da('0x4f')](_0x93a6a3,['id',_0x63da('0x50'),_0x63da('0x51')]);_0xb7eaf6['body']=_[_0x63da('0x4f')](_0xb7eaf6['body'],['id',_0x63da('0x50'),_0x63da('0x51')]);return db[_0x63da('0x2e')][_0x63da('0x49')](_[_0x63da('0x3e')](_0x93a6a3,_0xb7eaf6['body']),{'include':_0xb7eaf6[_0x63da('0x36')][_0x63da('0x46')]?[{'all':!![]}]:undefined})[_0x63da('0x25')](function(_0x21ec09){var _0x4977e6=_0xb7eaf6[_0x63da('0x4b')][_0x63da('0x27')]({'plain':!![]});if(!_0x4977e6)throw new Error(_0x63da('0x52'));if(_0x4977e6['role']===_0x63da('0x4b')){var _0x2872fe=_0x21ec09['get']({'plain':!![]});var _0x2f89d3=_0x63da('0x53');return db['UserProfileSection'][_0x63da('0x48')]({'where':{'name':_0x2f89d3,'userProfileId':_0x4977e6[_0x63da('0x54')]},'raw':!![]})[_0x63da('0x25')](function(_0x46de56){if(_0x46de56&&_0x46de56[_0x63da('0x4c')]===0x0){return db['UserProfileResource'][_0x63da('0x49')]({'name':_0x2872fe[_0x63da('0x2a')],'resourceId':_0x2872fe['id'],'type':_0x46de56[_0x63da('0x2a')],'sectionId':_0x46de56['id']},{})[_0x63da('0x25')](function(){return _0x21ec09;});}else{return _0x21ec09;}})[_0x63da('0x42')](function(_0xcb92b7){logger[_0x63da('0x4d')](_0x63da('0x55'),_0xcb92b7);throw _0xcb92b7;});}return _0x21ec09;});}})[_0x63da('0x25')](respondWithResult(_0x157532,0xc9))[_0x63da('0x42')](handleError(_0x157532,null));};exports[_0x63da('0x24')]=function(_0x3aee30,_0x5e7743){if(_0x3aee30[_0x63da('0x4a')]['id']){delete _0x3aee30['body']['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x3aee30[_0x63da('0x44')]['id']}})[_0x63da('0x25')](handleEntityNotFound(_0x5e7743,null))[_0x63da('0x25')](saveUpdates(_0x3aee30[_0x63da('0x4a')],null))[_0x63da('0x25')](respondWithResult(_0x5e7743,null))[_0x63da('0x42')](handleError(_0x5e7743,null));};exports['destroy']=function(_0x3d2cb4,_0x5589a1){return db[_0x63da('0x2e')]['find']({'where':{'id':_0x3d2cb4['params']['id']}})[_0x63da('0x25')](handleEntityNotFound(_0x5589a1,null))[_0x63da('0x25')](removeEntity(_0x5589a1,null))[_0x63da('0x42')](handleError(_0x5589a1,null));};exports['getSessions']=function(_0x7f0839,_0x45adc2,_0x4158c2){var _0x7d2375={'raw':!![],'where':{}};var _0x1ceef1={};var _0x3e4e10={'count':0x0,'rows':[]};return db[_0x63da('0x2e')][_0x63da('0x56')]({'where':{'id':_0x7f0839[_0x63da('0x44')]['id']}})[_0x63da('0x25')](handleEntityNotFound(_0x45adc2,null))[_0x63da('0x25')](function(_0x433346){if(_0x433346){_0x1ceef1['model']=_[_0x63da('0x34')](db[_0x63da('0x57')][_0x63da('0x2f')]);_0x1ceef1[_0x63da('0x36')]=_[_0x63da('0x34')](_0x7f0839[_0x63da('0x36')]);_0x1ceef1[_0x63da('0x3c')]=_[_0x63da('0x35')](_0x1ceef1[_0x63da('0x33')],_0x1ceef1[_0x63da('0x36')]);_0x7d2375['attributes']=_['intersection'](_0x1ceef1[_0x63da('0x33')],qs[_0x63da('0x45')](_0x7f0839[_0x63da('0x36')][_0x63da('0x45')]));_0x7d2375[_0x63da('0x37')]=_0x7d2375[_0x63da('0x37')][_0x63da('0x38')]?_0x7d2375['attributes']:_0x1ceef1[_0x63da('0x33')];if(!_0x7f0839['query'][_0x63da('0x58')](_0x63da('0x59'))){_0x7d2375[_0x63da('0x1d')]=qs[_0x63da('0x1d')](_0x7f0839[_0x63da('0x36')]['limit']);_0x7d2375['offset']=qs[_0x63da('0x1c')](_0x7f0839[_0x63da('0x36')]['offset']);}_0x7d2375[_0x63da('0x39')]=qs['sort'](_0x7f0839[_0x63da('0x36')][_0x63da('0x3a')]);_0x7d2375[_0x63da('0x3b')]=qs[_0x63da('0x3c')](_['pick'](_0x7f0839['query'],_0x1ceef1['filters']));_0x7d2375[_0x63da('0x3b')][_0x63da('0x5a')]=_0x433346['id'];if(_0x7f0839[_0x63da('0x36')][_0x63da('0x3d')]){_0x7d2375[_0x63da('0x3b')]=_['merge'](_0x7d2375[_0x63da('0x3b')],{'$or':_[_0x63da('0x2d')](_0x7d2375[_0x63da('0x37')],function(_0x27e88a){var _0x448a91={};_0x448a91[_0x27e88a]={'$like':'%'+_0x7f0839[_0x63da('0x36')]['filter']+'%'};return _0x448a91;})});}_0x7d2375=_[_0x63da('0x3e')]({},_0x7d2375,_0x7f0839[_0x63da('0x3f')]);return db[_0x63da('0x57')][_0x63da('0x1f')]({'where':_0x7d2375['where']})['then'](function(_0x5be69b){_0x3e4e10[_0x63da('0x1f')]=_0x5be69b;if(_0x7f0839['query'][_0x63da('0x46')]){_0x7d2375[_0x63da('0x47')]=[{'all':!![]}];}return db[_0x63da('0x57')][_0x63da('0x40')](_0x7d2375);})[_0x63da('0x25')](function(_0x4957f5){_0x3e4e10[_0x63da('0x41')]=_0x4957f5;return _0x3e4e10;});}})[_0x63da('0x25')](respondWithFilteredResult(_0x45adc2,_0x7d2375))[_0x63da('0x42')](handleError(_0x45adc2,null));};exports[_0x63da('0x5b')]=function(_0x3e5fa8,_0x2bbaaa,_0x2dc708){var _0x13a969={'raw':!![],'where':{}};var _0x8b19c6={};var _0x86380d={'count':0x0,'rows':[]};return db[_0x63da('0x2e')][_0x63da('0x56')]({'where':{'id':_0x3e5fa8[_0x63da('0x44')]['id']}})[_0x63da('0x25')](handleEntityNotFound(_0x2bbaaa,null))[_0x63da('0x25')](function(_0x460cc2){if(_0x460cc2){_0x8b19c6[_0x63da('0x33')]=_[_0x63da('0x34')](db[_0x63da('0x5c')][_0x63da('0x2f')]);_0x8b19c6[_0x63da('0x36')]=_['keys'](_0x3e5fa8[_0x63da('0x36')]);_0x8b19c6[_0x63da('0x3c')]=_[_0x63da('0x35')](_0x8b19c6[_0x63da('0x33')],_0x8b19c6['query']);_0x13a969['attributes']=_[_0x63da('0x35')](_0x8b19c6[_0x63da('0x33')],qs[_0x63da('0x45')](_0x3e5fa8[_0x63da('0x36')]['fields']));_0x13a969[_0x63da('0x37')]=_0x13a969[_0x63da('0x37')]['length']?_0x13a969['attributes']:_0x8b19c6['model'];if(!_0x3e5fa8[_0x63da('0x36')][_0x63da('0x58')](_0x63da('0x59'))){_0x13a969[_0x63da('0x1d')]=qs[_0x63da('0x1d')](_0x3e5fa8[_0x63da('0x36')][_0x63da('0x1d')]);_0x13a969['offset']=qs[_0x63da('0x1c')](_0x3e5fa8[_0x63da('0x36')][_0x63da('0x1c')]);}_0x13a969[_0x63da('0x39')]=qs['sort'](_0x3e5fa8[_0x63da('0x36')][_0x63da('0x3a')]);_0x13a969[_0x63da('0x3b')]=qs[_0x63da('0x3c')](_[_0x63da('0x5d')](_0x3e5fa8[_0x63da('0x36')],_0x8b19c6[_0x63da('0x3c')]));_0x13a969[_0x63da('0x3b')]['ProjectId']=_0x460cc2['id'];if(_0x3e5fa8['query'][_0x63da('0x3d')]){_0x13a969[_0x63da('0x3b')]=_[_0x63da('0x3e')](_0x13a969[_0x63da('0x3b')],{'$or':_[_0x63da('0x2d')](_0x13a969[_0x63da('0x37')],function(_0x1e5753){var _0x4c261f={};_0x4c261f[_0x1e5753]={'$like':'%'+_0x3e5fa8[_0x63da('0x36')][_0x63da('0x3d')]+'%'};return _0x4c261f;})});}_0x13a969=_['merge']({},_0x13a969,_0x3e5fa8[_0x63da('0x3f')]);return db[_0x63da('0x5c')][_0x63da('0x1f')]({'where':_0x13a969['where']})[_0x63da('0x25')](function(_0x44e016){_0x86380d[_0x63da('0x1f')]=_0x44e016;if(_0x3e5fa8[_0x63da('0x36')][_0x63da('0x46')]){_0x13a969[_0x63da('0x47')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x13a969);})['then'](function(_0x5bbc4e){_0x86380d['rows']=_0x5bbc4e;return _0x86380d;});}})[_0x63da('0x25')](respondWithFilteredResult(_0x2bbaaa,_0x13a969))[_0x63da('0x42')](handleError(_0x2bbaaa,null));};function char(_0x319f68){return'number'===typeof _0x319f68?String[_0x63da('0x5e')][_0x63da('0x5f')](null,arguments):_0x319f68;}function needsEncapsulation(_0x262d8e){return!!_0x262d8e&&(_0x262d8e[_0x63da('0x60')]()[_0x63da('0x61')](char(0xd))>=0x0||_0x262d8e[_0x63da('0x60')]()[_0x63da('0x61')](char(0xa))>=0x0||_0x262d8e['toString']()[_0x63da('0x61')](char(0x2c))>=0x0||_0x262d8e['toString']()[_0x63da('0x61')](char(0x22))>=0x0);}function encapsulate(_0x1a3f6d){var _0x3f682c=char(0x22),_0x3028e8='\x5c'+char(0x22),_0xce573=_0x1a3f6d[_0x63da('0x60')]()[_0x63da('0x62')](new RegExp(_0x3f682c,'g'),_0x3028e8);return _0x3f682c+_0xce573+_0x3f682c;}exports['getSummary']=function(_0x34873c,_0x5b1336,_0x2b4d6f){var _0x899641,_0x5e88b0;var _0x469785={'where':{'ProjectId':_0x34873c[_0x63da('0x44')]['id']}};if(_0x34873c[_0x63da('0x36')][_0x63da('0x63')]){_0x469785[_0x63da('0x3b')][_0x63da('0x64')]=JSON['parse'](_0x34873c[_0x63da('0x36')][_0x63da('0x63')]);}return db['JscriptySessionReport'][_0x63da('0x40')](_0x469785)[_0x63da('0x25')](handleEntityNotFound(_0x5b1336,null))[_0x63da('0x25')](function(_0x2fe65b){if(_0x2fe65b){_0x899641=_0x2fe65b;return db[_0x63da('0x65')][_0x63da('0x40')]({'where':{'SessionId':{'$in':_['map'](_0x899641,'id')},'ProjectId':_0x34873c['params']['id']},'order':_0x63da('0x66')});}})['then'](handleEntityNotFound(_0x5b1336,null))[_0x63da('0x25')](function(_0x171746){if(_0x171746){_0x5e88b0=_0x171746;var _0x24021f={};for(var _0x4e4f1e=0x0,_0x46a5e2=_0x5e88b0[_0x63da('0x38')];_0x4e4f1e<_0x46a5e2;_0x4e4f1e++){if(!_0x24021f[_0x63da('0x58')](_0x5e88b0[_0x4e4f1e][_0x63da('0x67')])){_0x24021f[_0x5e88b0[_0x4e4f1e][_0x63da('0x67')]]=needsEncapsulation(_0x5e88b0[_0x4e4f1e][_0x63da('0x68')])?encapsulate(_0x5e88b0[_0x4e4f1e][_0x63da('0x68')]):_0x5e88b0[_0x4e4f1e][_0x63da('0x68')];}}var _0x2020dd=[],_0x33734f={};for(var _0x2501fe=0x0,_0x254f9b=_0x899641[_0x63da('0x38')];_0x2501fe<_0x254f9b;_0x2501fe++){_0x33734f={'ProjectId':_0x34873c['params']['id'],'SessionId':_0x899641[_0x2501fe]['id'],'StartTime':moment(_0x899641[_0x2501fe][_0x63da('0x64')])[_0x63da('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x24ff4a=0x0,_0x289923=_0x5e88b0[_0x63da('0x38')];_0x24ff4a<_0x289923;_0x24ff4a++){if(_0x5e88b0[_0x24ff4a][_0x63da('0x6a')]==_0x899641[_0x2501fe]['id']&&_0x24021f[_0x63da('0x58')](_0x5e88b0[_0x24ff4a][_0x63da('0x67')])){_0x33734f[_0x24021f[_0x5e88b0[_0x24ff4a][_0x63da('0x67')]]]=_0x5e88b0[_0x24ff4a][_0x63da('0x6b')];}}for(var _0x245658 in _0x24021f){if(!_0x33734f[_0x63da('0x58')](_0x24021f[_0x245658])){_0x33734f[_0x24021f[_0x245658]]=null;}}_0x2020dd[_0x63da('0x6c')](_0x33734f);}return _0x2020dd;}})['then'](function(_0x481d3f){if(!_['isEmpty'](_0x481d3f)){var _0x54adc4=toCsv(_0x481d3f);var _0x3286e5=Date['now']();fs[_0x63da('0x6d')](util[_0x63da('0x69')](_0x63da('0x6e'),_0x34873c[_0x63da('0x44')]['id'],_0x3286e5),_0x54adc4);_0x5b1336['setHeader']('Content-disposition',_0x63da('0x6f')+util[_0x63da('0x69')](_0x63da('0x70'),_0x34873c[_0x63da('0x44')]['id'],_0x3286e5));_0x5b1336[_0x63da('0x71')](_0x63da('0x72'),_0x63da('0x73'));return _0x5b1336[_0x63da('0x74')](util[_0x63da('0x69')](_0x63da('0x6e'),_0x34873c['params']['id'],_0x3286e5));}else{return _0x5b1336[_0x63da('0x18')](0xcc);}})[_0x63da('0x42')](handleError(_0x5b1336,null));};
\ No newline at end of file
+var _0x9189=['json','apply','reject','then','destroy','get','Projects','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','JscriptyProject','show','params','keys','include','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','autoAssociation','update','getSessions','findOne','JscriptySessionReport','nolimit','ProjectId','rows','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','findAll','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x9189,0x1b0));var _0x9918=function(_0x37b91c,_0x306657){_0x37b91c=_0x37b91c-0x0;var _0x5757dd=_0x9189[_0x37b91c];return _0x5757dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9918('0x0'));var jsonpatch=require(_0x9918('0x1'));var rp=require(_0x9918('0x2'));var moment=require(_0x9918('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9918('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9918('0x5'));var csv=require(_0x9918('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9918('0x7'));var _=require(_0x9918('0x8'));var squel=require(_0x9918('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9918('0x6'));var querystring=require(_0x9918('0xa'));var Papa=require('papaparse');var Redis=require(_0x9918('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x9918('0xc'));var as=require(_0x9918('0xd'));var hardwareService=require(_0x9918('0xe'));var logger=require(_0x9918('0xf'))(_0x9918('0x10'));var utils=require(_0x9918('0x11'));var config=require(_0x9918('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9918('0x13'))['db'];function respondWithStatusCode(_0x1a8f69,_0x548f67){_0x548f67=_0x548f67||0xcc;return function(_0x511a2c){if(_0x511a2c){return _0x1a8f69[_0x9918('0x14')](_0x548f67);}return _0x1a8f69['status'](_0x548f67)['end']();};}function respondWithResult(_0x15ff69,_0x38f36a){_0x38f36a=_0x38f36a||0xc8;return function(_0x53e3e9){if(_0x53e3e9){return _0x15ff69[_0x9918('0x15')](_0x38f36a)['json'](_0x53e3e9);}};}function respondWithFilteredResult(_0x131708,_0x27fbe7){return function(_0x2a2347){if(_0x2a2347){var _0x420db0=typeof _0x27fbe7[_0x9918('0x16')]===_0x9918('0x17')&&typeof _0x27fbe7[_0x9918('0x18')]===_0x9918('0x17');var _0x3f4011=_0x2a2347[_0x9918('0x19')];var _0x45f368=_0x420db0?0x0:_0x27fbe7[_0x9918('0x16')];var _0x1a9452=_0x420db0?_0x2a2347[_0x9918('0x19')]:_0x27fbe7[_0x9918('0x16')]+_0x27fbe7[_0x9918('0x18')];var _0x2f5b89;if(_0x1a9452>=_0x3f4011){_0x1a9452=_0x3f4011;_0x2f5b89=0xc8;}else{_0x2f5b89=0xce;}_0x131708[_0x9918('0x15')](_0x2f5b89);return _0x131708[_0x9918('0x1a')](_0x9918('0x1b'),_0x45f368+'-'+_0x1a9452+'/'+_0x3f4011)[_0x9918('0x1c')](_0x2a2347);}return null;};}function patchUpdates(_0x20be15){return function(_0x1af6cf){try{jsonpatch[_0x9918('0x1d')](_0x1af6cf,_0x20be15,!![]);}catch(_0x3858f3){return BPromise[_0x9918('0x1e')](_0x3858f3);}return _0x1af6cf['save']();};}function saveUpdates(_0x2dc468,_0x1f0bca){return function(_0x24ff02){if(_0x24ff02){return _0x24ff02['update'](_0x2dc468)[_0x9918('0x1f')](function(_0x2367f3){return _0x2367f3;});}return null;};}function removeEntity(_0x44893d,_0x4562aa){return function(_0x44691e){if(_0x44691e){return _0x44691e[_0x9918('0x20')]()[_0x9918('0x1f')](function(){var _0x216cc1=_0x44691e[_0x9918('0x21')]({'plain':!![]});var _0x143a5b=_0x9918('0x22');return db[_0x9918('0x23')][_0x9918('0x20')]({'where':{'type':_0x143a5b,'resourceId':_0x216cc1['id']}})['then'](function(){return _0x44691e;});})[_0x9918('0x1f')](function(){_0x44893d[_0x9918('0x15')](0xcc)[_0x9918('0x24')]();});}};}function handleEntityNotFound(_0x46526f,_0x1f8549){return function(_0x4e0c9b){if(!_0x4e0c9b){_0x46526f[_0x9918('0x14')](0x194);}return _0x4e0c9b;};}function handleError(_0xbf2888,_0x58f5af){_0x58f5af=_0x58f5af||0x1f4;return function(_0x5ac401){logger[_0x9918('0x25')](_0x5ac401['stack']);if(_0x5ac401['name']){delete _0x5ac401[_0x9918('0x26')];}_0xbf2888['status'](_0x58f5af)[_0x9918('0x27')](_0x5ac401);};}exports[_0x9918('0x28')]=function(_0x5db8c9,_0x4baa13){var _0x321f6d={},_0xa6409e={},_0x1eacfa={'count':0x0,'rows':[]};var _0x7405e5=_[_0x9918('0x29')](db['JscriptyProject'][_0x9918('0x2a')],function(_0x29d5b5){return{'name':_0x29d5b5[_0x9918('0x2b')],'type':_0x29d5b5[_0x9918('0x2c')][_0x9918('0x2d')]};});_0xa6409e['model']=_[_0x9918('0x29')](_0x7405e5,'name');_0xa6409e[_0x9918('0x2e')]=_['keys'](_0x5db8c9[_0x9918('0x2e')]);_0xa6409e[_0x9918('0x2f')]=_[_0x9918('0x30')](_0xa6409e[_0x9918('0x31')],_0xa6409e[_0x9918('0x2e')]);_0x321f6d[_0x9918('0x32')]=_[_0x9918('0x30')](_0xa6409e[_0x9918('0x31')],qs[_0x9918('0x33')](_0x5db8c9['query'][_0x9918('0x33')]));_0x321f6d[_0x9918('0x32')]=_0x321f6d[_0x9918('0x32')][_0x9918('0x34')]?_0x321f6d[_0x9918('0x32')]:_0xa6409e[_0x9918('0x31')];if(!_0x5db8c9[_0x9918('0x2e')][_0x9918('0x35')]('nolimit')){_0x321f6d['limit']=qs[_0x9918('0x18')](_0x5db8c9[_0x9918('0x2e')][_0x9918('0x18')]);_0x321f6d[_0x9918('0x16')]=qs['offset'](_0x5db8c9[_0x9918('0x2e')]['offset']);}_0x321f6d[_0x9918('0x36')]=qs[_0x9918('0x37')](_0x5db8c9[_0x9918('0x2e')][_0x9918('0x37')]);_0x321f6d['where']=qs['filters'](_[_0x9918('0x38')](_0x5db8c9[_0x9918('0x2e')],_0xa6409e['filters']),_0x7405e5);if(_0x5db8c9[_0x9918('0x2e')][_0x9918('0x39')]){_0x321f6d[_0x9918('0x3a')]=_[_0x9918('0x3b')](_0x321f6d[_0x9918('0x3a')],{'$or':_['map'](_0x7405e5,function(_0x4646d8){if(_0x4646d8[_0x9918('0x2c')]!==_0x9918('0x3c')){var _0x24b640={};_0x24b640[_0x4646d8[_0x9918('0x26')]]={'$like':'%'+_0x5db8c9[_0x9918('0x2e')]['filter']+'%'};return _0x24b640;}})});}_0x321f6d=_[_0x9918('0x3b')]({},_0x321f6d,_0x5db8c9[_0x9918('0x3d')]);var _0x373627={'where':_0x321f6d[_0x9918('0x3a')]};return db['JscriptyProject'][_0x9918('0x19')](_0x373627)[_0x9918('0x1f')](function(_0x39100e){_0x1eacfa[_0x9918('0x19')]=_0x39100e;if(_0x5db8c9['query'][_0x9918('0x3e')]){_0x321f6d['include']=[{'all':!![]}];}return db[_0x9918('0x3f')]['findAll'](_0x321f6d);})[_0x9918('0x1f')](function(_0x33c787){_0x1eacfa['rows']=_0x33c787;return _0x1eacfa;})[_0x9918('0x1f')](respondWithFilteredResult(_0x4baa13,_0x321f6d))['catch'](handleError(_0x4baa13,null));};exports[_0x9918('0x40')]=function(_0x336236,_0x379812){var _0x28b191={'raw':![],'where':{'id':_0x336236[_0x9918('0x41')]['id']}},_0x27c0f3={};_0x27c0f3['model']=_[_0x9918('0x42')](db[_0x9918('0x3f')]['rawAttributes']);_0x27c0f3[_0x9918('0x2e')]=_[_0x9918('0x42')](_0x336236[_0x9918('0x2e')]);_0x27c0f3[_0x9918('0x2f')]=_[_0x9918('0x30')](_0x27c0f3['model'],_0x27c0f3[_0x9918('0x2e')]);_0x28b191[_0x9918('0x32')]=_[_0x9918('0x30')](_0x27c0f3[_0x9918('0x31')],qs[_0x9918('0x33')](_0x336236[_0x9918('0x2e')][_0x9918('0x33')]));_0x28b191[_0x9918('0x32')]=_0x28b191['attributes'][_0x9918('0x34')]?_0x28b191[_0x9918('0x32')]:_0x27c0f3['model'];if(_0x336236['query']['includeAll']){_0x28b191[_0x9918('0x43')]=[{'all':!![]}];}_0x28b191=_[_0x9918('0x3b')]({},_0x28b191,_0x336236[_0x9918('0x3d')]);return db['JscriptyProject'][_0x9918('0x44')](_0x28b191)['then'](handleEntityNotFound(_0x379812,null))['then'](respondWithResult(_0x379812,null))[_0x9918('0x45')](handleError(_0x379812,null));};exports['create']=function(_0x5ca79e,_0x7f211a){return db['JscriptyProject']['create'](_0x5ca79e[_0x9918('0x46')],{})[_0x9918('0x1f')](function(_0x33d12a){var _0x53459d=_0x5ca79e['user']['get']({'plain':!![]});if(!_0x53459d)throw new Error(_0x9918('0x47'));if(_0x53459d[_0x9918('0x48')]===_0x9918('0x49')){var _0x3a1106=_0x33d12a[_0x9918('0x21')]({'plain':!![]});var _0x6861a3=_0x9918('0x22');return db[_0x9918('0x4a')][_0x9918('0x44')]({'where':{'name':_0x6861a3,'userProfileId':_0x53459d[_0x9918('0x4b')]},'raw':!![]})[_0x9918('0x1f')](function(_0x3b07fb){if(_0x3b07fb&&_0x3b07fb['autoAssociation']===0x0){return db[_0x9918('0x23')][_0x9918('0x4c')]({'name':_0x3a1106[_0x9918('0x26')],'resourceId':_0x3a1106['id'],'type':_0x3b07fb['name'],'sectionId':_0x3b07fb['id']},{})[_0x9918('0x1f')](function(){return _0x33d12a;});}else{return _0x33d12a;}})[_0x9918('0x45')](function(_0x458c00){logger[_0x9918('0x25')](_0x9918('0x4d'),_0x458c00);throw _0x458c00;});}return _0x33d12a;})[_0x9918('0x1f')](respondWithResult(_0x7f211a,0xc9))[_0x9918('0x45')](handleError(_0x7f211a,null));};exports['clone']=function(_0x567430,_0x30cde2){var _0x313e2f={'where':{'id':_0x567430[_0x9918('0x41')]['id']}},_0x4ee8dd={};_0x4ee8dd[_0x9918('0x31')]=_[_0x9918('0x42')](db['JscriptyProject'][_0x9918('0x2a')]);_0x313e2f[_0x9918('0x32')]=_[_0x9918('0x30')](_0x4ee8dd[_0x9918('0x31')],qs['fields'](_0x567430[_0x9918('0x2e')][_0x9918('0x33')]));_0x313e2f[_0x9918('0x32')]=_0x313e2f[_0x9918('0x32')][_0x9918('0x34')]?_0x313e2f[_0x9918('0x32')]:_0x4ee8dd[_0x9918('0x31')];if(_0x567430[_0x9918('0x2e')][_0x9918('0x3e')]){_0x313e2f[_0x9918('0x43')]=[{'all':!![]}];}_0x313e2f=_[_0x9918('0x3b')]({},_0x313e2f,_0x567430[_0x9918('0x3d')]);return db[_0x9918('0x3f')]['find'](_0x313e2f)['then'](handleEntityNotFound(_0x30cde2,null))[_0x9918('0x1f')](function(_0x5ee320){if(_0x5ee320){var _0x96a5a0=_0x5ee320[_0x9918('0x21')]({'plain':!![]});_0x96a5a0=qs[_0x9918('0x4e')](_0x96a5a0,['id',_0x9918('0x4f'),'updatedAt']);_0x567430[_0x9918('0x46')]=_[_0x9918('0x4e')](_0x567430[_0x9918('0x46')],['id','createdAt',_0x9918('0x50')]);return db['JscriptyProject'][_0x9918('0x4c')](_['merge'](_0x96a5a0,_0x567430['body']),{'include':_0x567430[_0x9918('0x2e')][_0x9918('0x3e')]?[{'all':!![]}]:undefined})[_0x9918('0x1f')](function(_0x2be017){var _0x3ee1db=_0x567430[_0x9918('0x49')][_0x9918('0x21')]({'plain':!![]});if(!_0x3ee1db)throw new Error(_0x9918('0x47'));if(_0x3ee1db[_0x9918('0x48')]===_0x9918('0x49')){var _0x22c45e=_0x2be017[_0x9918('0x21')]({'plain':!![]});var _0x563ad4=_0x9918('0x22');return db['UserProfileSection'][_0x9918('0x44')]({'where':{'name':_0x563ad4,'userProfileId':_0x3ee1db[_0x9918('0x4b')]},'raw':!![]})['then'](function(_0x3836a7){if(_0x3836a7&&_0x3836a7[_0x9918('0x51')]===0x0){return db[_0x9918('0x23')][_0x9918('0x4c')]({'name':_0x22c45e[_0x9918('0x26')],'resourceId':_0x22c45e['id'],'type':_0x3836a7[_0x9918('0x26')],'sectionId':_0x3836a7['id']},{})['then'](function(){return _0x2be017;});}else{return _0x2be017;}})['catch'](function(_0x2fb912){logger[_0x9918('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fb912);throw _0x2fb912;});}return _0x2be017;});}})[_0x9918('0x1f')](respondWithResult(_0x30cde2,0xc9))['catch'](handleError(_0x30cde2,null));};exports[_0x9918('0x52')]=function(_0x31f4eb,_0x5ba7d2){if(_0x31f4eb[_0x9918('0x46')]['id']){delete _0x31f4eb['body']['id'];}return db[_0x9918('0x3f')][_0x9918('0x44')]({'where':{'id':_0x31f4eb[_0x9918('0x41')]['id']}})[_0x9918('0x1f')](handleEntityNotFound(_0x5ba7d2,null))[_0x9918('0x1f')](saveUpdates(_0x31f4eb[_0x9918('0x46')],null))[_0x9918('0x1f')](respondWithResult(_0x5ba7d2,null))['catch'](handleError(_0x5ba7d2,null));};exports[_0x9918('0x20')]=function(_0x2a5fff,_0x23e780){return db[_0x9918('0x3f')][_0x9918('0x44')]({'where':{'id':_0x2a5fff[_0x9918('0x41')]['id']}})[_0x9918('0x1f')](handleEntityNotFound(_0x23e780,null))[_0x9918('0x1f')](removeEntity(_0x23e780,null))[_0x9918('0x45')](handleError(_0x23e780,null));};exports[_0x9918('0x53')]=function(_0x574115,_0x11e6e0,_0x29055a){var _0x12272b={'raw':!![],'where':{}};var _0x336794={};var _0x430589={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x9918('0x54')]({'where':{'id':_0x574115['params']['id']}})[_0x9918('0x1f')](handleEntityNotFound(_0x11e6e0,null))[_0x9918('0x1f')](function(_0x3f1dbd){if(_0x3f1dbd){_0x336794['model']=_[_0x9918('0x42')](db[_0x9918('0x55')]['rawAttributes']);_0x336794['query']=_[_0x9918('0x42')](_0x574115['query']);_0x336794[_0x9918('0x2f')]=_[_0x9918('0x30')](_0x336794[_0x9918('0x31')],_0x336794[_0x9918('0x2e')]);_0x12272b['attributes']=_['intersection'](_0x336794['model'],qs[_0x9918('0x33')](_0x574115[_0x9918('0x2e')]['fields']));_0x12272b[_0x9918('0x32')]=_0x12272b[_0x9918('0x32')][_0x9918('0x34')]?_0x12272b[_0x9918('0x32')]:_0x336794['model'];if(!_0x574115[_0x9918('0x2e')]['hasOwnProperty'](_0x9918('0x56'))){_0x12272b['limit']=qs[_0x9918('0x18')](_0x574115[_0x9918('0x2e')]['limit']);_0x12272b[_0x9918('0x16')]=qs[_0x9918('0x16')](_0x574115[_0x9918('0x2e')]['offset']);}_0x12272b['order']=qs[_0x9918('0x37')](_0x574115[_0x9918('0x2e')][_0x9918('0x37')]);_0x12272b[_0x9918('0x3a')]=qs[_0x9918('0x2f')](_[_0x9918('0x38')](_0x574115[_0x9918('0x2e')],_0x336794[_0x9918('0x2f')]));_0x12272b[_0x9918('0x3a')][_0x9918('0x57')]=_0x3f1dbd['id'];if(_0x574115['query'][_0x9918('0x39')]){_0x12272b[_0x9918('0x3a')]=_[_0x9918('0x3b')](_0x12272b[_0x9918('0x3a')],{'$or':_['map'](_0x12272b[_0x9918('0x32')],function(_0x4bf6a4){var _0x239b60={};_0x239b60[_0x4bf6a4]={'$like':'%'+_0x574115[_0x9918('0x2e')][_0x9918('0x39')]+'%'};return _0x239b60;})});}_0x12272b=_[_0x9918('0x3b')]({},_0x12272b,_0x574115['options']);return db[_0x9918('0x55')][_0x9918('0x19')]({'where':_0x12272b[_0x9918('0x3a')]})[_0x9918('0x1f')](function(_0x245872){_0x430589['count']=_0x245872;if(_0x574115[_0x9918('0x2e')][_0x9918('0x3e')]){_0x12272b[_0x9918('0x43')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x12272b);})[_0x9918('0x1f')](function(_0x227048){_0x430589[_0x9918('0x58')]=_0x227048;return _0x430589;});}})[_0x9918('0x1f')](respondWithFilteredResult(_0x11e6e0,_0x12272b))[_0x9918('0x45')](handleError(_0x11e6e0,null));};exports['getAnswers']=function(_0x16c3d6,_0x1cf37d,_0x4c8b80){var _0xc7267b={'raw':!![],'where':{}};var _0x43a03e={};var _0x7991b={'count':0x0,'rows':[]};return db[_0x9918('0x3f')]['findOne']({'where':{'id':_0x16c3d6[_0x9918('0x41')]['id']}})['then'](handleEntityNotFound(_0x1cf37d,null))[_0x9918('0x1f')](function(_0x508791){if(_0x508791){_0x43a03e[_0x9918('0x31')]=_['keys'](db['JscriptyAnswerReport'][_0x9918('0x2a')]);_0x43a03e[_0x9918('0x2e')]=_[_0x9918('0x42')](_0x16c3d6['query']);_0x43a03e[_0x9918('0x2f')]=_[_0x9918('0x30')](_0x43a03e[_0x9918('0x31')],_0x43a03e[_0x9918('0x2e')]);_0xc7267b[_0x9918('0x32')]=_[_0x9918('0x30')](_0x43a03e[_0x9918('0x31')],qs[_0x9918('0x33')](_0x16c3d6[_0x9918('0x2e')]['fields']));_0xc7267b[_0x9918('0x32')]=_0xc7267b[_0x9918('0x32')][_0x9918('0x34')]?_0xc7267b[_0x9918('0x32')]:_0x43a03e[_0x9918('0x31')];if(!_0x16c3d6[_0x9918('0x2e')][_0x9918('0x35')](_0x9918('0x56'))){_0xc7267b[_0x9918('0x18')]=qs[_0x9918('0x18')](_0x16c3d6['query'][_0x9918('0x18')]);_0xc7267b['offset']=qs[_0x9918('0x16')](_0x16c3d6[_0x9918('0x2e')][_0x9918('0x16')]);}_0xc7267b[_0x9918('0x36')]=qs['sort'](_0x16c3d6[_0x9918('0x2e')][_0x9918('0x37')]);_0xc7267b[_0x9918('0x3a')]=qs[_0x9918('0x2f')](_['pick'](_0x16c3d6[_0x9918('0x2e')],_0x43a03e['filters']));_0xc7267b[_0x9918('0x3a')][_0x9918('0x57')]=_0x508791['id'];if(_0x16c3d6['query']['filter']){_0xc7267b[_0x9918('0x3a')]=_[_0x9918('0x3b')](_0xc7267b[_0x9918('0x3a')],{'$or':_[_0x9918('0x29')](_0xc7267b[_0x9918('0x32')],function(_0x1a3aba){var _0x3e2d09={};_0x3e2d09[_0x1a3aba]={'$like':'%'+_0x16c3d6[_0x9918('0x2e')][_0x9918('0x39')]+'%'};return _0x3e2d09;})});}_0xc7267b=_[_0x9918('0x3b')]({},_0xc7267b,_0x16c3d6['options']);return db[_0x9918('0x59')][_0x9918('0x19')]({'where':_0xc7267b['where']})[_0x9918('0x1f')](function(_0x4ab2dc){_0x7991b['count']=_0x4ab2dc;if(_0x16c3d6[_0x9918('0x2e')][_0x9918('0x3e')]){_0xc7267b[_0x9918('0x43')]=[{'all':!![]}];}return db[_0x9918('0x59')]['findAll'](_0xc7267b);})[_0x9918('0x1f')](function(_0x4a1066){_0x7991b[_0x9918('0x58')]=_0x4a1066;return _0x7991b;});}})[_0x9918('0x1f')](respondWithFilteredResult(_0x1cf37d,_0xc7267b))[_0x9918('0x45')](handleError(_0x1cf37d,null));};function char(_0x2af703){return _0x9918('0x5a')===typeof _0x2af703?String[_0x9918('0x5b')][_0x9918('0x1d')](null,arguments):_0x2af703;}function needsEncapsulation(_0x2faa18){return!!_0x2faa18&&(_0x2faa18[_0x9918('0x5c')]()[_0x9918('0x5d')](char(0xd))>=0x0||_0x2faa18[_0x9918('0x5c')]()['indexOf'](char(0xa))>=0x0||_0x2faa18[_0x9918('0x5c')]()[_0x9918('0x5d')](char(0x2c))>=0x0||_0x2faa18[_0x9918('0x5c')]()[_0x9918('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x1aa80e){var _0x42b5a6=char(0x22),_0x450c70='\x5c'+char(0x22),_0xeea7f6=_0x1aa80e[_0x9918('0x5c')]()[_0x9918('0x5e')](new RegExp(_0x42b5a6,'g'),_0x450c70);return _0x42b5a6+_0xeea7f6+_0x42b5a6;}exports[_0x9918('0x5f')]=function(_0x50d199,_0x1a4b46,_0x3037cb){var _0x470d41,_0x579ee8;var _0x45de2f={'where':{'ProjectId':_0x50d199[_0x9918('0x41')]['id']}};if(_0x50d199[_0x9918('0x2e')][_0x9918('0x60')]){_0x45de2f[_0x9918('0x3a')][_0x9918('0x61')]=JSON[_0x9918('0x62')](_0x50d199['query'][_0x9918('0x60')]);}return db[_0x9918('0x55')][_0x9918('0x63')](_0x45de2f)[_0x9918('0x1f')](handleEntityNotFound(_0x1a4b46,null))[_0x9918('0x1f')](function(_0x59768e){if(_0x59768e){_0x470d41=_0x59768e;return db['JscriptyQuestionReport'][_0x9918('0x63')]({'where':{'SessionId':{'$in':_[_0x9918('0x29')](_0x470d41,'id')},'ProjectId':_0x50d199[_0x9918('0x41')]['id']},'order':_0x9918('0x64')});}})[_0x9918('0x1f')](handleEntityNotFound(_0x1a4b46,null))[_0x9918('0x1f')](function(_0x4f562d){if(_0x4f562d){_0x579ee8=_0x4f562d;var _0x38395f={};for(var _0x391ef6=0x0,_0x327018=_0x579ee8['length'];_0x391ef6<_0x327018;_0x391ef6++){if(!_0x38395f[_0x9918('0x35')](_0x579ee8[_0x391ef6][_0x9918('0x65')])){_0x38395f[_0x579ee8[_0x391ef6][_0x9918('0x65')]]=needsEncapsulation(_0x579ee8[_0x391ef6][_0x9918('0x66')])?encapsulate(_0x579ee8[_0x391ef6][_0x9918('0x66')]):_0x579ee8[_0x391ef6]['question'];}}var _0x48b06a=[],_0x376180={};for(var _0x16e834=0x0,_0x307ce2=_0x470d41[_0x9918('0x34')];_0x16e834<_0x307ce2;_0x16e834++){_0x376180={'ProjectId':_0x50d199[_0x9918('0x41')]['id'],'SessionId':_0x470d41[_0x16e834]['id'],'StartTime':moment(_0x470d41[_0x16e834][_0x9918('0x61')])[_0x9918('0x67')](_0x9918('0x68'))};for(var _0x49cbe5=0x0,_0x72becb=_0x579ee8['length'];_0x49cbe5<_0x72becb;_0x49cbe5++){if(_0x579ee8[_0x49cbe5][_0x9918('0x69')]==_0x470d41[_0x16e834]['id']&&_0x38395f['hasOwnProperty'](_0x579ee8[_0x49cbe5][_0x9918('0x65')])){_0x376180[_0x38395f[_0x579ee8[_0x49cbe5][_0x9918('0x65')]]]=_0x579ee8[_0x49cbe5][_0x9918('0x6a')];}}for(var _0xdee1a8 in _0x38395f){if(!_0x376180['hasOwnProperty'](_0x38395f[_0xdee1a8])){_0x376180[_0x38395f[_0xdee1a8]]=null;}}_0x48b06a['push'](_0x376180);}return _0x48b06a;}})[_0x9918('0x1f')](function(_0x49a69c){if(!_['isEmpty'](_0x49a69c)){var _0x5ac2d4=toCsv(_0x49a69c);var _0x141d04=Date['now']();fs[_0x9918('0x6b')](util[_0x9918('0x67')](_0x9918('0x6c'),_0x50d199[_0x9918('0x41')]['id'],_0x141d04),_0x5ac2d4);_0x1a4b46[_0x9918('0x6d')](_0x9918('0x6e'),'attachment;\x20filename='+util[_0x9918('0x67')](_0x9918('0x6f'),_0x50d199[_0x9918('0x41')]['id'],_0x141d04));_0x1a4b46['setHeader'](_0x9918('0x70'),_0x9918('0x71'));return _0x1a4b46[_0x9918('0x72')](util[_0x9918('0x67')](_0x9918('0x6c'),_0x50d199[_0x9918('0x41')]['id'],_0x141d04));}else{return _0x1a4b46['sendStatus'](0xcc);}})[_0x9918('0x45')](handleError(_0x1a4b46,null));};
\ No newline at end of file
index e4fae6d..2bd502b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea31=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash'];(function(_0x54d8c0,_0x33133b){var _0x219725=function(_0x2f9fcd){while(--_0x2f9fcd){_0x54d8c0['push'](_0x54d8c0['shift']());}};_0x219725(++_0x33133b);}(_0xea31,0x6b));var _0x1ea3=function(_0x1fe985,_0x464949){_0x1fe985=_0x1fe985-0x0;var _0x3c1a9b=_0xea31[_0x1fe985];return _0x3c1a9b;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var logger=require(_0x1ea3('0x1'))(_0x1ea3('0x2'));var moment=require(_0x1ea3('0x3'));var BPromise=require(_0x1ea3('0x4'));var rp=require(_0x1ea3('0x5'));var fs=require('fs');var path=require(_0x1ea3('0x6'));var rimraf=require(_0x1ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ea3('0x8'));module[_0x1ea3('0x9')]=function(_0x6810da,_0x27c695){return _0x6810da[_0x1ea3('0xa')]('JscriptyProject',attributes,{'tableName':_0x1ea3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf006=['bluebird','path','./jscriptyProject.attributes','exports','define','jscripty_projects','../../config/logger','api'];(function(_0x6fc237,_0x38d418){var _0xbccea0=function(_0x47a5e4){while(--_0x47a5e4){_0x6fc237['push'](_0x6fc237['shift']());}};_0xbccea0(++_0x38d418);}(_0xf006,0x146));var _0x6f00=function(_0x1a1abd,_0x178e81){_0x1a1abd=_0x1a1abd-0x0;var _0x666ad9=_0xf006[_0x1a1abd];return _0x666ad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('JscriptyProject',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b535901..ae4035b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x555f58,_0x449260){var _0x38a126=function(_0x4066df){while(--_0x4066df){_0x555f58['push'](_0x555f58['shift']());}};_0x38a126(++_0x449260);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2d6330,_0x3f4c69){_0x2d6330=_0x2d6330-0x0;var _0x456441=_0xf4eb[_0x2d6330];return _0x456441;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
+var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0xaa88,0x137));var _0x8aa8=function(_0x3a19d4,_0x3f19a4){_0x3a19d4=_0x3a19d4-0x0;var _0x5b858b=_0xaa88[_0x3a19d4];return _0x5b858b;};'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')]('JscriptyProject,\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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}
\ No newline at end of file
index c7d7fe4..3a32d22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa496=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','update','delete','/:id','exports'];(function(_0x48e949,_0x1fd4cd){var _0x3c8d56=function(_0x262353){while(--_0x262353){_0x48e949['push'](_0x48e949['shift']());}};_0x3c8d56(++_0x1fd4cd);}(_0xa496,0xa0));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6a49('0x0'));var util=require('util');var path=require(_0x6a49('0x1'));var timeout=require(_0x6a49('0x2'));var express=require(_0x6a49('0x3'));var router=express['Router']();var fs_extra=require(_0x6a49('0x4'));var auth=require(_0x6a49('0x5'));var interaction=require(_0x6a49('0x6'));var config=require(_0x6a49('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x6a49('0x8')]('/',auth[_0x6a49('0x9')](),controller[_0x6a49('0xa')]);router[_0x6a49('0x8')](_0x6a49('0xb'),auth[_0x6a49('0x9')](),controller[_0x6a49('0xc')]);router[_0x6a49('0x8')]('/:id',auth[_0x6a49('0x9')](),controller['show']);router[_0x6a49('0xd')]('/',auth[_0x6a49('0x9')](),controller[_0x6a49('0xe')]);router[_0x6a49('0xf')]('/:id',auth[_0x6a49('0x9')](),controller[_0x6a49('0x10')]);router[_0x6a49('0x11')](_0x6a49('0x12'),auth[_0x6a49('0x9')](),controller['destroy']);module[_0x6a49('0x13')]=router;
\ No newline at end of file
+var _0x5c99=['create','put','/:id','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','show','post'];(function(_0x34dd0e,_0x1f965b){var _0x7ac476=function(_0x5dd593){while(--_0x5dd593){_0x34dd0e['push'](_0x34dd0e['shift']());}};_0x7ac476(++_0x1f965b);}(_0x5c99,0x123));var _0x95c9=function(_0x4e4e83,_0x2f29a7){_0x4e4e83=_0x4e4e83-0x0;var _0x4cbeb6=_0x5c99[_0x4e4e83];return _0x4cbeb6;};'use strict';var multer=require('multer');var util=require(_0x95c9('0x0'));var path=require(_0x95c9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x95c9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x95c9('0x3'));var interaction=require(_0x95c9('0x4'));var config=require(_0x95c9('0x5'));var controller=require(_0x95c9('0x6'));router[_0x95c9('0x7')]('/',auth[_0x95c9('0x8')](),controller[_0x95c9('0x9')]);router[_0x95c9('0x7')](_0x95c9('0xa'),auth[_0x95c9('0x8')](),controller['describe']);router[_0x95c9('0x7')]('/:id',auth[_0x95c9('0x8')](),controller[_0x95c9('0xb')]);router[_0x95c9('0xc')]('/',auth[_0x95c9('0x8')](),controller[_0x95c9('0xd')]);router[_0x95c9('0xe')](_0x95c9('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x95c9('0x10')](_0x95c9('0xf'),auth[_0x95c9('0x8')](),controller[_0x95c9('0x11')]);module[_0x95c9('0x12')]=router;
\ No newline at end of file
index baf0568..4565fa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7a54,0x106));var _0x47a5=function(_0x2ba44f,_0x21fd0c){_0x2ba44f=_0x2ba44f-0x0;var _0x3fdd7b=_0x7a54[_0x2ba44f];return _0x3fdd7b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x332fd0,_0x5c3992){_0x332fd0=_0x332fd0-0x0;var _0x4e694c=_0x7a54[_0x332fd0];return _0x4e694c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index 0508feb..d4f024f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffc8=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','then','include','findAll','rows','show','params','JscriptyQuestionReport','keys','includeAll','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x17371c,_0x1a1e9c){var _0x422265=function(_0x7b77ad){while(--_0x7b77ad){_0x17371c['push'](_0x17371c['shift']());}};_0x422265(++_0x1a1e9c);}(_0xffc8,0x17d));var _0x8ffc=function(_0x185a5c,_0x7f9215){_0x185a5c=_0x185a5c-0x0;var _0x24c01d=_0xffc8[_0x185a5c];return _0x24c01d;};'use strict';var emlformat=require(_0x8ffc('0x0'));var rimraf=require(_0x8ffc('0x1'));var zipdir=require(_0x8ffc('0x2'));var jsonpatch=require(_0x8ffc('0x3'));var rp=require('request-promise');var moment=require(_0x8ffc('0x4'));var BPromise=require(_0x8ffc('0x5'));var Mustache=require(_0x8ffc('0x6'));var util=require('util');var path=require(_0x8ffc('0x7'));var sox=require(_0x8ffc('0x8'));var csv=require(_0x8ffc('0x9'));var ejs=require(_0x8ffc('0xa'));var fs=require('fs');var fs_extra=require(_0x8ffc('0xb'));var _=require(_0x8ffc('0xc'));var squel=require(_0x8ffc('0xd'));var crypto=require('crypto');var jsforce=require(_0x8ffc('0xe'));var deskjs=require(_0x8ffc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8ffc('0x10'));var Papa=require(_0x8ffc('0x11'));var Redis=require(_0x8ffc('0x12'));var authService=require(_0x8ffc('0x13'));var qs=require(_0x8ffc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ffc('0x15'));var logger=require(_0x8ffc('0x16'))(_0x8ffc('0x17'));var utils=require(_0x8ffc('0x18'));var config=require(_0x8ffc('0x19'));var licenseUtil=require(_0x8ffc('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d7a99,_0x30ffef){_0x30ffef=_0x30ffef||0xcc;return function(_0x26f66d){if(_0x26f66d){return _0x2d7a99[_0x8ffc('0x1b')](_0x30ffef);}return _0x2d7a99[_0x8ffc('0x1c')](_0x30ffef)[_0x8ffc('0x1d')]();};}function respondWithResult(_0x45857c,_0x42a4c0){_0x42a4c0=_0x42a4c0||0xc8;return function(_0x2a22f5){if(_0x2a22f5){return _0x45857c[_0x8ffc('0x1c')](_0x42a4c0)[_0x8ffc('0x1e')](_0x2a22f5);}};}function respondWithFilteredResult(_0x243099,_0x1b5cee){return function(_0x51603a){if(_0x51603a){var _0x35cf41=typeof _0x1b5cee[_0x8ffc('0x1f')]===_0x8ffc('0x20')&&typeof _0x1b5cee[_0x8ffc('0x21')]===_0x8ffc('0x20');var _0x5a7e31=_0x51603a['count'];var _0x222402=_0x35cf41?0x0:_0x1b5cee[_0x8ffc('0x1f')];var _0x33e02a=_0x35cf41?_0x51603a[_0x8ffc('0x22')]:_0x1b5cee[_0x8ffc('0x1f')]+_0x1b5cee[_0x8ffc('0x21')];var _0x13beed;if(_0x33e02a>=_0x5a7e31){_0x33e02a=_0x5a7e31;_0x13beed=0xc8;}else{_0x13beed=0xce;}_0x243099['status'](_0x13beed);return _0x243099[_0x8ffc('0x23')]('Content-Range',_0x222402+'-'+_0x33e02a+'/'+_0x5a7e31)[_0x8ffc('0x1e')](_0x51603a);}return null;};}function patchUpdates(_0x3c4104){return function(_0x421e68){try{jsonpatch['apply'](_0x421e68,_0x3c4104,!![]);}catch(_0x52c63f){return BPromise[_0x8ffc('0x24')](_0x52c63f);}return _0x421e68['save']();};}function saveUpdates(_0x16abc9,_0xea6b96){return function(_0xa6e2cb){if(_0xa6e2cb){return _0xa6e2cb[_0x8ffc('0x25')](_0x16abc9)['then'](function(_0xbd4c8a){return _0xbd4c8a;});}return null;};}function removeEntity(_0x1c56cc,_0x5e3c8f){return function(_0x31511e){if(_0x31511e){return _0x31511e[_0x8ffc('0x26')]()['then'](function(){_0x1c56cc[_0x8ffc('0x1c')](0xcc)[_0x8ffc('0x1d')]();});}};}function handleEntityNotFound(_0x3ea5a9,_0x4e57c9){return function(_0x4ca04b){if(!_0x4ca04b){_0x3ea5a9[_0x8ffc('0x1b')](0x194);}return _0x4ca04b;};}function handleError(_0x8ef917,_0xdf7097){_0xdf7097=_0xdf7097||0x1f4;return function(_0x1a29e3){logger[_0x8ffc('0x27')](_0x1a29e3[_0x8ffc('0x28')]);if(_0x1a29e3[_0x8ffc('0x29')]){delete _0x1a29e3[_0x8ffc('0x29')];}_0x8ef917['status'](_0xdf7097)[_0x8ffc('0x2a')](_0x1a29e3);};}exports[_0x8ffc('0x2b')]=function(_0x35b4e9,_0x4dae54){var _0x276edc={},_0x4fea2c={},_0x5d3d2a={'count':0x0,'rows':[]};var _0x3b36ca=_['map'](db['JscriptyQuestionReport'][_0x8ffc('0x2c')],function(_0x5590ae){return{'name':_0x5590ae[_0x8ffc('0x2d')],'type':_0x5590ae[_0x8ffc('0x2e')][_0x8ffc('0x2f')]};});_0x4fea2c[_0x8ffc('0x30')]=_[_0x8ffc('0x31')](_0x3b36ca,'name');_0x4fea2c['query']=_['keys'](_0x35b4e9[_0x8ffc('0x32')]);_0x4fea2c[_0x8ffc('0x33')]=_[_0x8ffc('0x34')](_0x4fea2c[_0x8ffc('0x30')],_0x4fea2c[_0x8ffc('0x32')]);_0x276edc[_0x8ffc('0x35')]=_[_0x8ffc('0x34')](_0x4fea2c[_0x8ffc('0x30')],qs[_0x8ffc('0x36')](_0x35b4e9[_0x8ffc('0x32')][_0x8ffc('0x36')]));_0x276edc['attributes']=_0x276edc[_0x8ffc('0x35')][_0x8ffc('0x37')]?_0x276edc[_0x8ffc('0x35')]:_0x4fea2c['model'];if(!_0x35b4e9[_0x8ffc('0x32')][_0x8ffc('0x38')]('nolimit')){_0x276edc['limit']=qs[_0x8ffc('0x21')](_0x35b4e9[_0x8ffc('0x32')]['limit']);_0x276edc[_0x8ffc('0x1f')]=qs[_0x8ffc('0x1f')](_0x35b4e9[_0x8ffc('0x32')][_0x8ffc('0x1f')]);}_0x276edc[_0x8ffc('0x39')]=qs[_0x8ffc('0x3a')](_0x35b4e9[_0x8ffc('0x32')][_0x8ffc('0x3a')]);_0x276edc[_0x8ffc('0x3b')]=qs[_0x8ffc('0x33')](_[_0x8ffc('0x3c')](_0x35b4e9[_0x8ffc('0x32')],_0x4fea2c[_0x8ffc('0x33')]),_0x3b36ca);if(_0x35b4e9[_0x8ffc('0x32')]['filter']){_0x276edc[_0x8ffc('0x3b')]=_[_0x8ffc('0x3d')](_0x276edc['where'],{'$or':_[_0x8ffc('0x31')](_0x3b36ca,function(_0x1c57e3){if(_0x1c57e3[_0x8ffc('0x2e')]!==_0x8ffc('0x3e')){var _0x4d420e={};_0x4d420e[_0x1c57e3[_0x8ffc('0x29')]]={'$like':'%'+_0x35b4e9['query'][_0x8ffc('0x3f')]+'%'};return _0x4d420e;}})});}_0x276edc=_['merge']({},_0x276edc,_0x35b4e9[_0x8ffc('0x40')]);var _0x18c65d={'where':_0x276edc[_0x8ffc('0x3b')]};return db['JscriptyQuestionReport'][_0x8ffc('0x22')](_0x18c65d)[_0x8ffc('0x41')](function(_0x707c06){_0x5d3d2a['count']=_0x707c06;if(_0x35b4e9['query']['includeAll']){_0x276edc[_0x8ffc('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8ffc('0x43')](_0x276edc);})['then'](function(_0xd6a816){_0x5d3d2a[_0x8ffc('0x44')]=_0xd6a816;return _0x5d3d2a;})['then'](respondWithFilteredResult(_0x4dae54,_0x276edc))['catch'](handleError(_0x4dae54,null));};exports[_0x8ffc('0x45')]=function(_0x1eb85a,_0x369095){var _0x8887be={'raw':!![],'where':{'id':_0x1eb85a[_0x8ffc('0x46')]['id']}},_0x209836={};_0x209836[_0x8ffc('0x30')]=_['keys'](db[_0x8ffc('0x47')][_0x8ffc('0x2c')]);_0x209836[_0x8ffc('0x32')]=_[_0x8ffc('0x48')](_0x1eb85a[_0x8ffc('0x32')]);_0x209836[_0x8ffc('0x33')]=_['intersection'](_0x209836['model'],_0x209836[_0x8ffc('0x32')]);_0x8887be[_0x8ffc('0x35')]=_[_0x8ffc('0x34')](_0x209836['model'],qs[_0x8ffc('0x36')](_0x1eb85a[_0x8ffc('0x32')][_0x8ffc('0x36')]));_0x8887be['attributes']=_0x8887be[_0x8ffc('0x35')][_0x8ffc('0x37')]?_0x8887be[_0x8ffc('0x35')]:_0x209836['model'];if(_0x1eb85a[_0x8ffc('0x32')][_0x8ffc('0x49')]){_0x8887be['include']=[{'all':!![]}];}_0x8887be=_[_0x8ffc('0x3d')]({},_0x8887be,_0x1eb85a[_0x8ffc('0x40')]);return db[_0x8ffc('0x47')][_0x8ffc('0x4a')](_0x8887be)[_0x8ffc('0x41')](handleEntityNotFound(_0x369095,null))[_0x8ffc('0x41')](respondWithResult(_0x369095,null))['catch'](handleError(_0x369095,null));};exports[_0x8ffc('0x4b')]=function(_0x335349,_0x52e39b){return db[_0x8ffc('0x47')][_0x8ffc('0x4b')](_0x335349[_0x8ffc('0x4c')],{})[_0x8ffc('0x41')](respondWithResult(_0x52e39b,0xc9))['catch'](handleError(_0x52e39b,null));};exports[_0x8ffc('0x25')]=function(_0x43eb60,_0x3994f4){if(_0x43eb60[_0x8ffc('0x4c')]['id']){delete _0x43eb60[_0x8ffc('0x4c')]['id'];}return db[_0x8ffc('0x47')][_0x8ffc('0x4a')]({'where':{'id':_0x43eb60['params']['id']}})[_0x8ffc('0x41')](handleEntityNotFound(_0x3994f4,null))[_0x8ffc('0x41')](saveUpdates(_0x43eb60[_0x8ffc('0x4c')],null))[_0x8ffc('0x41')](respondWithResult(_0x3994f4,null))[_0x8ffc('0x4d')](handleError(_0x3994f4,null));};exports['destroy']=function(_0x2e1043,_0x5ef989){return db[_0x8ffc('0x47')][_0x8ffc('0x4a')]({'where':{'id':_0x2e1043[_0x8ffc('0x46')]['id']}})[_0x8ffc('0x41')](handleEntityNotFound(_0x5ef989,null))[_0x8ffc('0x41')](removeEntity(_0x5ef989,null))[_0x8ffc('0x4d')](handleError(_0x5ef989,null));};exports[_0x8ffc('0x4e')]=function(_0x4d61d5,_0x10ad4d){return db['JscriptyQuestionReport'][_0x8ffc('0x4e')]()['then'](respondWithResult(_0x10ad4d,null))[_0x8ffc('0x4d')](handleError(_0x10ad4d,null));};
\ No newline at end of file
+var _0x7e74=['lodash','squel','crypto','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','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','error','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','options','includeAll','findAll','catch','show','params','include','merge','create','body','find','describe','eml-format','rimraf','moment','util','path','to-csv'];(function(_0x489ce1,_0x2ed92f){var _0x438f60=function(_0x1bc167){while(--_0x1bc167){_0x489ce1['push'](_0x489ce1['shift']());}};_0x438f60(++_0x2ed92f);}(_0x7e74,0x1d6));var _0x47e7=function(_0xfc907c,_0x14f279){_0xfc907c=_0xfc907c-0x0;var _0x25d836=_0x7e74[_0xfc907c];return _0x25d836;};'use strict';var emlformat=require(_0x47e7('0x0'));var rimraf=require(_0x47e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x47e7('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47e7('0x3'));var path=require(_0x47e7('0x4'));var sox=require('sox');var csv=require(_0x47e7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x47e7('0x6'));var squel=require(_0x47e7('0x7'));var crypto=require(_0x47e7('0x8'));var jsforce=require(_0x47e7('0x9'));var deskjs=require(_0x47e7('0xa'));var toCsv=require(_0x47e7('0x5'));var querystring=require('querystring');var Papa=require(_0x47e7('0xb'));var Redis=require('ioredis');var authService=require(_0x47e7('0xc'));var qs=require(_0x47e7('0xd'));var as=require(_0x47e7('0xe'));var hardwareService=require(_0x47e7('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x47e7('0x10'));var config=require(_0x47e7('0x11'));var licenseUtil=require(_0x47e7('0x12'));var db=require(_0x47e7('0x13'))['db'];function respondWithStatusCode(_0x346378,_0x13550e){_0x13550e=_0x13550e||0xcc;return function(_0x2d359a){if(_0x2d359a){return _0x346378[_0x47e7('0x14')](_0x13550e);}return _0x346378['status'](_0x13550e)[_0x47e7('0x15')]();};}function respondWithResult(_0x4c8331,_0x480cc0){_0x480cc0=_0x480cc0||0xc8;return function(_0x5d74e6){if(_0x5d74e6){return _0x4c8331[_0x47e7('0x16')](_0x480cc0)['json'](_0x5d74e6);}};}function respondWithFilteredResult(_0x490e7c,_0x4a9a46){return function(_0x2b16af){if(_0x2b16af){var _0x2be203=typeof _0x4a9a46[_0x47e7('0x17')]===_0x47e7('0x18')&&typeof _0x4a9a46[_0x47e7('0x19')]===_0x47e7('0x18');var _0x161290=_0x2b16af['count'];var _0x1d6452=_0x2be203?0x0:_0x4a9a46[_0x47e7('0x17')];var _0x4b0ec6=_0x2be203?_0x2b16af[_0x47e7('0x1a')]:_0x4a9a46['offset']+_0x4a9a46[_0x47e7('0x19')];var _0x3969b8;if(_0x4b0ec6>=_0x161290){_0x4b0ec6=_0x161290;_0x3969b8=0xc8;}else{_0x3969b8=0xce;}_0x490e7c[_0x47e7('0x16')](_0x3969b8);return _0x490e7c[_0x47e7('0x1b')](_0x47e7('0x1c'),_0x1d6452+'-'+_0x4b0ec6+'/'+_0x161290)[_0x47e7('0x1d')](_0x2b16af);}return null;};}function patchUpdates(_0x14de90){return function(_0x25dc89){try{jsonpatch[_0x47e7('0x1e')](_0x25dc89,_0x14de90,!![]);}catch(_0x56036c){return BPromise['reject'](_0x56036c);}return _0x25dc89['save']();};}function saveUpdates(_0x257e96,_0x23d1f9){return function(_0x7f84d4){if(_0x7f84d4){return _0x7f84d4[_0x47e7('0x1f')](_0x257e96)[_0x47e7('0x20')](function(_0x4f94ec){return _0x4f94ec;});}return null;};}function removeEntity(_0x31478d,_0x16b767){return function(_0x5368da){if(_0x5368da){return _0x5368da[_0x47e7('0x21')]()[_0x47e7('0x20')](function(){_0x31478d[_0x47e7('0x16')](0xcc)[_0x47e7('0x15')]();});}};}function handleEntityNotFound(_0x39f036,_0x1360d3){return function(_0x1f40ee){if(!_0x1f40ee){_0x39f036['sendStatus'](0x194);}return _0x1f40ee;};}function handleError(_0x1964a1,_0x47e9c5){_0x47e9c5=_0x47e9c5||0x1f4;return function(_0x2bcb8c){logger[_0x47e7('0x22')](_0x2bcb8c['stack']);if(_0x2bcb8c[_0x47e7('0x23')]){delete _0x2bcb8c[_0x47e7('0x23')];}_0x1964a1[_0x47e7('0x16')](_0x47e9c5)[_0x47e7('0x24')](_0x2bcb8c);};}exports['index']=function(_0x31c1a7,_0x3d69b7){var _0x26fb7f={},_0x2df602={},_0x234dbd={'count':0x0,'rows':[]};var _0x32c4ee=_[_0x47e7('0x25')](db[_0x47e7('0x26')][_0x47e7('0x27')],function(_0x5226c6){return{'name':_0x5226c6[_0x47e7('0x28')],'type':_0x5226c6[_0x47e7('0x29')][_0x47e7('0x2a')]};});_0x2df602[_0x47e7('0x2b')]=_[_0x47e7('0x25')](_0x32c4ee,'name');_0x2df602[_0x47e7('0x2c')]=_[_0x47e7('0x2d')](_0x31c1a7[_0x47e7('0x2c')]);_0x2df602[_0x47e7('0x2e')]=_[_0x47e7('0x2f')](_0x2df602[_0x47e7('0x2b')],_0x2df602[_0x47e7('0x2c')]);_0x26fb7f['attributes']=_[_0x47e7('0x2f')](_0x2df602[_0x47e7('0x2b')],qs[_0x47e7('0x30')](_0x31c1a7[_0x47e7('0x2c')][_0x47e7('0x30')]));_0x26fb7f['attributes']=_0x26fb7f[_0x47e7('0x31')][_0x47e7('0x32')]?_0x26fb7f[_0x47e7('0x31')]:_0x2df602[_0x47e7('0x2b')];if(!_0x31c1a7[_0x47e7('0x2c')]['hasOwnProperty'](_0x47e7('0x33'))){_0x26fb7f['limit']=qs[_0x47e7('0x19')](_0x31c1a7['query'][_0x47e7('0x19')]);_0x26fb7f['offset']=qs[_0x47e7('0x17')](_0x31c1a7[_0x47e7('0x2c')][_0x47e7('0x17')]);}_0x26fb7f[_0x47e7('0x34')]=qs[_0x47e7('0x35')](_0x31c1a7[_0x47e7('0x2c')]['sort']);_0x26fb7f['where']=qs[_0x47e7('0x2e')](_['pick'](_0x31c1a7[_0x47e7('0x2c')],_0x2df602[_0x47e7('0x2e')]),_0x32c4ee);if(_0x31c1a7['query']['filter']){_0x26fb7f[_0x47e7('0x36')]=_['merge'](_0x26fb7f[_0x47e7('0x36')],{'$or':_[_0x47e7('0x25')](_0x32c4ee,function(_0x37029a){if(_0x37029a[_0x47e7('0x29')]!=='VIRTUAL'){var _0x3cb400={};_0x3cb400[_0x37029a[_0x47e7('0x23')]]={'$like':'%'+_0x31c1a7['query'][_0x47e7('0x37')]+'%'};return _0x3cb400;}})});}_0x26fb7f=_['merge']({},_0x26fb7f,_0x31c1a7[_0x47e7('0x38')]);var _0x2d0b36={'where':_0x26fb7f[_0x47e7('0x36')]};return db[_0x47e7('0x26')][_0x47e7('0x1a')](_0x2d0b36)[_0x47e7('0x20')](function(_0x35b4c4){_0x234dbd[_0x47e7('0x1a')]=_0x35b4c4;if(_0x31c1a7['query'][_0x47e7('0x39')]){_0x26fb7f['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x47e7('0x3a')](_0x26fb7f);})[_0x47e7('0x20')](function(_0x444b22){_0x234dbd['rows']=_0x444b22;return _0x234dbd;})[_0x47e7('0x20')](respondWithFilteredResult(_0x3d69b7,_0x26fb7f))[_0x47e7('0x3b')](handleError(_0x3d69b7,null));};exports[_0x47e7('0x3c')]=function(_0x32bf5a,_0x6b2f62){var _0x3eb65b={'raw':!![],'where':{'id':_0x32bf5a[_0x47e7('0x3d')]['id']}},_0x436c8d={};_0x436c8d[_0x47e7('0x2b')]=_[_0x47e7('0x2d')](db[_0x47e7('0x26')][_0x47e7('0x27')]);_0x436c8d[_0x47e7('0x2c')]=_['keys'](_0x32bf5a[_0x47e7('0x2c')]);_0x436c8d[_0x47e7('0x2e')]=_[_0x47e7('0x2f')](_0x436c8d[_0x47e7('0x2b')],_0x436c8d[_0x47e7('0x2c')]);_0x3eb65b[_0x47e7('0x31')]=_[_0x47e7('0x2f')](_0x436c8d[_0x47e7('0x2b')],qs[_0x47e7('0x30')](_0x32bf5a[_0x47e7('0x2c')]['fields']));_0x3eb65b[_0x47e7('0x31')]=_0x3eb65b[_0x47e7('0x31')][_0x47e7('0x32')]?_0x3eb65b[_0x47e7('0x31')]:_0x436c8d[_0x47e7('0x2b')];if(_0x32bf5a[_0x47e7('0x2c')][_0x47e7('0x39')]){_0x3eb65b[_0x47e7('0x3e')]=[{'all':!![]}];}_0x3eb65b=_[_0x47e7('0x3f')]({},_0x3eb65b,_0x32bf5a[_0x47e7('0x38')]);return db['JscriptyQuestionReport']['find'](_0x3eb65b)[_0x47e7('0x20')](handleEntityNotFound(_0x6b2f62,null))[_0x47e7('0x20')](respondWithResult(_0x6b2f62,null))['catch'](handleError(_0x6b2f62,null));};exports[_0x47e7('0x40')]=function(_0x1d0ef8,_0x59bd9b){return db[_0x47e7('0x26')][_0x47e7('0x40')](_0x1d0ef8['body'],{})[_0x47e7('0x20')](respondWithResult(_0x59bd9b,0xc9))[_0x47e7('0x3b')](handleError(_0x59bd9b,null));};exports['update']=function(_0x106955,_0x497d8e){if(_0x106955['body']['id']){delete _0x106955[_0x47e7('0x41')]['id'];}return db[_0x47e7('0x26')][_0x47e7('0x42')]({'where':{'id':_0x106955[_0x47e7('0x3d')]['id']}})[_0x47e7('0x20')](handleEntityNotFound(_0x497d8e,null))['then'](saveUpdates(_0x106955[_0x47e7('0x41')],null))[_0x47e7('0x20')](respondWithResult(_0x497d8e,null))[_0x47e7('0x3b')](handleError(_0x497d8e,null));};exports[_0x47e7('0x21')]=function(_0xa22374,_0x2600a7){return db[_0x47e7('0x26')]['find']({'where':{'id':_0xa22374[_0x47e7('0x3d')]['id']}})[_0x47e7('0x20')](handleEntityNotFound(_0x2600a7,null))[_0x47e7('0x20')](removeEntity(_0x2600a7,null))[_0x47e7('0x3b')](handleError(_0x2600a7,null));};exports[_0x47e7('0x43')]=function(_0x26ad5f,_0x1ce922){return db[_0x47e7('0x26')][_0x47e7('0x43')]()[_0x47e7('0x20')](respondWithResult(_0x1ce922,null))['catch'](handleError(_0x1ce922,null));};
\ No newline at end of file
index 4e94348..b9babeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7838=['../../config/logger','api','bluebird','request-promise','path','exports','define','lodash','util'];(function(_0x41cd34,_0x32cd0c){var _0x1273e8=function(_0x34f4f6){while(--_0x34f4f6){_0x41cd34['push'](_0x41cd34['shift']());}};_0x1273e8(++_0x32cd0c);}(_0x7838,0xbb));var _0x8783=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x7838[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x8783('0x0'));var util=require(_0x8783('0x1'));var logger=require(_0x8783('0x2'))(_0x8783('0x3'));var moment=require('moment');var BPromise=require(_0x8783('0x4'));var rp=require(_0x8783('0x5'));var fs=require('fs');var path=require(_0x8783('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0x8783('0x7')]=function(_0x451d70,_0x118ae8){return _0x451d70[_0x8783('0x8')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b41=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','../../config/logger','api'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x9b41,0x15d));var _0x19b4=function(_0x30c45,_0x4592f3){_0x30c45=_0x30c45-0x0;var _0x255a24=_0x9b41[_0x30c45];return _0x255a24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x19b4('0x0'))(_0x19b4('0x1'));var moment=require(_0x19b4('0x2'));var BPromise=require(_0x19b4('0x3'));var rp=require(_0x19b4('0x4'));var fs=require('fs');var path=require(_0x19b4('0x5'));var rimraf=require(_0x19b4('0x6'));var config=require(_0x19b4('0x7'));var attributes=require(_0x19b4('0x8'));module[_0x19b4('0x9')]=function(_0x24f892,_0x5681be){return _0x24f892[_0x19b4('0xa')](_0x19b4('0xb'),attributes,{'tableName':_0x19b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f024ae..d11f81c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x475f=['rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3897e2,_0x179bed){var _0xfa1257=function(_0x4ddb09){while(--_0x4ddb09){_0x3897e2['push'](_0x3897e2['shift']());}};_0xfa1257(++_0x179bed);}(_0x475f,0x15f));var _0xf475=function(_0x37dc3e,_0x45926d){_0x37dc3e=_0x37dc3e-0x0;var _0x2e8656=_0x475f[_0x37dc3e];return _0x2e8656;};'use strict';var _=require('lodash');var util=require(_0xf475('0x0'));var moment=require(_0xf475('0x1'));var BPromise=require(_0xf475('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf475('0x3'))['db'];var utils=require(_0xf475('0x4'));var logger=require(_0xf475('0x5'))(_0xf475('0x6'));var config=require(_0xf475('0x7'));var jayson=require(_0xf475('0x8'));var client=jayson[_0xf475('0x9')][_0xf475('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1de9,_0x88a79a,_0x43371d){return new BPromise(function(_0x13dbb,_0x32ff5d){return client[_0xf475('0xb')](_0x5f1de9,_0x43371d)['then'](function(_0xe2facc){logger[_0xf475('0xc')](_0xf475('0xd'),_0x88a79a,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x88a79a,'request\x20sent',JSON[_0xf475('0xe')](_0xe2facc));if(_0xe2facc[_0xf475('0xf')]){if(_0xe2facc[_0xf475('0xf')][_0xf475('0x10')]===0x1f4){logger[_0xf475('0xf')](_0xf475('0xd'),_0x88a79a,_0xe2facc[_0xf475('0xf')][_0xf475('0x11')]);return _0x32ff5d(_0xe2facc[_0xf475('0xf')][_0xf475('0x11')]);}logger[_0xf475('0xf')](_0xf475('0xd'),_0x88a79a,_0xe2facc[_0xf475('0xf')]['message']);return _0x13dbb(_0xe2facc[_0xf475('0xf')][_0xf475('0x11')]);}else{logger[_0xf475('0xc')](_0xf475('0xd'),_0x88a79a,_0xf475('0x12'));_0x13dbb(_0xe2facc[_0xf475('0x13')][_0xf475('0x11')]);}})[_0xf475('0x14')](function(_0x15efec){logger[_0xf475('0xf')](_0xf475('0xd'),_0x88a79a,_0x15efec);_0x32ff5d(_0x15efec);});});}
\ No newline at end of file
+var _0x846e=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x3ef5bb,_0x27e3ac){var _0x59d620=function(_0x46cd45){while(--_0x46cd45){_0x3ef5bb['push'](_0x3ef5bb['shift']());}};_0x59d620(++_0x27e3ac);}(_0x846e,0x1a6));var _0xe846=function(_0x2b3465,_0x5275da){_0x2b3465=_0x2b3465-0x0;var _0x3edd93=_0x846e[_0x2b3465];return _0x3edd93;};'use strict';var _=require(_0xe846('0x0'));var util=require(_0xe846('0x1'));var moment=require(_0xe846('0x2'));var BPromise=require('bluebird');var rs=require(_0xe846('0x3'));var fs=require('fs');var Redis=require(_0xe846('0x4'));var db=require(_0xe846('0x5'))['db'];var utils=require(_0xe846('0x6'));var logger=require(_0xe846('0x7'))(_0xe846('0x8'));var config=require(_0xe846('0x9'));var jayson=require(_0xe846('0xa'));var client=jayson[_0xe846('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dfe35,_0x30f585,_0x19d9f8){return new BPromise(function(_0x236a7b,_0xc3d2e8){return client[_0xe846('0xc')](_0x5dfe35,_0x19d9f8)['then'](function(_0x2b942d){logger[_0xe846('0xd')](_0xe846('0xe'),_0x30f585,_0xe846('0xf'));logger[_0xe846('0x10')](_0xe846('0x11'),_0x30f585,_0xe846('0xf'),JSON[_0xe846('0x12')](_0x2b942d));if(_0x2b942d['error']){if(_0x2b942d['error'][_0xe846('0x13')]===0x1f4){logger['error'](_0xe846('0xe'),_0x30f585,_0x2b942d[_0xe846('0x14')][_0xe846('0x15')]);return _0xc3d2e8(_0x2b942d[_0xe846('0x14')][_0xe846('0x15')]);}logger[_0xe846('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x30f585,_0x2b942d[_0xe846('0x14')]['message']);return _0x236a7b(_0x2b942d['error'][_0xe846('0x15')]);}else{logger[_0xe846('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x30f585,_0xe846('0xf'));_0x236a7b(_0x2b942d['result'][_0xe846('0x15')]);}})[_0xe846('0x16')](function(_0x39c679){logger[_0xe846('0x14')](_0xe846('0xe'),_0x30f585,_0x39c679);_0xc3d2e8(_0x39c679);});});}
\ No newline at end of file
index a11ca4c..33188dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa852=['describe','show','getQuestions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0xa852,0x1bb));var _0x2a85=function(_0x152e8b,_0x390500){_0x152e8b=_0x152e8b-0x0;var _0x49e612=_0xa852[_0x152e8b];return _0x49e612;};'use strict';var multer=require(_0x2a85('0x0'));var util=require(_0x2a85('0x1'));var path=require(_0x2a85('0x2'));var timeout=require(_0x2a85('0x3'));var express=require(_0x2a85('0x4'));var router=express[_0x2a85('0x5')]();var fs_extra=require(_0x2a85('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2a85('0x7'));var config=require('../../config/environment');var controller=require(_0x2a85('0x8'));router[_0x2a85('0x9')]('/',auth[_0x2a85('0xa')](),controller[_0x2a85('0xb')]);router[_0x2a85('0x9')](_0x2a85('0xc'),auth[_0x2a85('0xa')](),controller[_0x2a85('0xd')]);router[_0x2a85('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2a85('0xe')]);router[_0x2a85('0x9')]('/:id/questions',auth['isAuthenticated'](),controller[_0x2a85('0xf')]);router[_0x2a85('0x10')]('/',auth[_0x2a85('0xa')](),controller[_0x2a85('0x11')]);router[_0x2a85('0x12')](_0x2a85('0x13'),auth[_0x2a85('0xa')](),controller[_0x2a85('0x14')]);router[_0x2a85('0x15')](_0x2a85('0x13'),auth[_0x2a85('0xa')](),controller[_0x2a85('0x16')]);module[_0x2a85('0x17')]=router;
\ No newline at end of file
+var _0xe731=['../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','/:id','show','/:id/questions','isAuthenticated','post','create','update','delete','multer','connect-timeout','express','fs-extra'];(function(_0x5e7699,_0x34c7cf){var _0x139ad2=function(_0x56de51){while(--_0x56de51){_0x5e7699['push'](_0x5e7699['shift']());}};_0x139ad2(++_0x34c7cf);}(_0xe731,0x84));var _0x1e73=function(_0x400423,_0x30ca9b){_0x400423=_0x400423-0x0;var _0x317780=_0xe731[_0x400423];return _0x317780;};'use strict';var multer=require(_0x1e73('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1e73('0x1'));var express=require(_0x1e73('0x2'));var router=express['Router']();var fs_extra=require(_0x1e73('0x3'));var auth=require(_0x1e73('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1e73('0x5'));var controller=require(_0x1e73('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1e73('0x7')](_0x1e73('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x1e73('0x9'),auth['isAuthenticated'](),controller[_0x1e73('0xa')]);router[_0x1e73('0x7')](_0x1e73('0xb'),auth[_0x1e73('0xc')](),controller['getQuestions']);router[_0x1e73('0xd')]('/',auth[_0x1e73('0xc')](),controller[_0x1e73('0xe')]);router['put'](_0x1e73('0x9'),auth['isAuthenticated'](),controller[_0x1e73('0xf')]);router[_0x1e73('0x10')]('/:id',auth[_0x1e73('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index d0fd320..c659186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd16d=['format','STRING','BOOLEAN','sequelize','exports','setDataValue'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xd16d,0x123));var _0xdd16=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd16d[_0xfae23b];return _0x200640;};'use strict';var moment=require('moment');var Sequelize=require(_0xdd16('0x0'));module[_0xdd16('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0xa5bb4c){this[_0xdd16('0x2')]('starttime',_0xa5bb4c);this['setDataValue']('endtime',moment()[_0xdd16('0x3')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xdd16('0x4')]},'projectname':{'type':Sequelize[_0xdd16('0x4')]},'queue':{'type':Sequelize[_0xdd16('0x4')]},'uniqueid':{'type':Sequelize[_0xdd16('0x4')]},'calleridname':{'type':Sequelize[_0xdd16('0x4')]},'calleridnum':{'type':Sequelize[_0xdd16('0x4')]},'completed':{'type':Sequelize[_0xdd16('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0x753e=['moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x753e,0x18c));var _0xe753=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x753e[_0x47aa64];return _0x549c7a;};'use strict';var moment=require(_0xe753('0x0'));var Sequelize=require(_0xe753('0x1'));module[_0xe753('0x2')]={'starttime':{'type':Sequelize[_0xe753('0x3')],'set':function(_0x39e96a){this[_0xe753('0x4')](_0xe753('0x5'),_0x39e96a);this[_0xe753('0x4')](_0xe753('0x6'),moment()[_0xe753('0x7')](_0xe753('0x8')));}},'endtime':{'type':Sequelize[_0xe753('0x3')]},'membername':{'type':Sequelize[_0xe753('0x9')]},'projectname':{'type':Sequelize[_0xe753('0x9')]},'queue':{'type':Sequelize[_0xe753('0x9')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe753('0x9')]},'calleridnum':{'type':Sequelize[_0xe753('0x9')]},'completed':{'type':Sequelize[_0xe753('0xa')],'defaultValue':![]}};
\ No newline at end of file
index f96afdd..b179c5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x778f=['includeAll','include','findAll','rows','catch','show','params','create','body','destroy','find','describe','getQuestions','JscriptyQuestionReport','pick','SessionId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','then','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options'];(function(_0x2cb2d0,_0x4f6dde){var _0x403abb=function(_0x481716){while(--_0x481716){_0x2cb2d0['push'](_0x2cb2d0['shift']());}};_0x403abb(++_0x4f6dde);}(_0x778f,0x1ea));var _0xf778=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x778f[_0x1a7846];return _0x48049;};'use strict';var emlformat=require(_0xf778('0x0'));var rimraf=require(_0xf778('0x1'));var zipdir=require(_0xf778('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf778('0x3'));var moment=require(_0xf778('0x4'));var BPromise=require(_0xf778('0x5'));var Mustache=require(_0xf778('0x6'));var util=require(_0xf778('0x7'));var path=require(_0xf778('0x8'));var sox=require('sox');var csv=require(_0xf778('0x9'));var ejs=require(_0xf778('0xa'));var fs=require('fs');var fs_extra=require(_0xf778('0xb'));var _=require(_0xf778('0xc'));var squel=require(_0xf778('0xd'));var crypto=require(_0xf778('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf778('0xf'));var toCsv=require(_0xf778('0x9'));var querystring=require(_0xf778('0x10'));var Papa=require(_0xf778('0x11'));var Redis=require(_0xf778('0x12'));var authService=require(_0xf778('0x13'));var qs=require(_0xf778('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf778('0x15'))('api');var utils=require(_0xf778('0x16'));var config=require(_0xf778('0x17'));var licenseUtil=require(_0xf778('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d0904,_0x5038c7){_0x5038c7=_0x5038c7||0xcc;return function(_0x2fb90b){if(_0x2fb90b){return _0x3d0904[_0xf778('0x19')](_0x5038c7);}return _0x3d0904[_0xf778('0x1a')](_0x5038c7)[_0xf778('0x1b')]();};}function respondWithResult(_0x20db36,_0x58f549){_0x58f549=_0x58f549||0xc8;return function(_0x2c8bcf){if(_0x2c8bcf){return _0x20db36[_0xf778('0x1a')](_0x58f549)[_0xf778('0x1c')](_0x2c8bcf);}};}function respondWithFilteredResult(_0x576832,_0x3e8985){return function(_0x142373){if(_0x142373){var _0x6309a4=typeof _0x3e8985[_0xf778('0x1d')]==='undefined'&&typeof _0x3e8985[_0xf778('0x1e')]===_0xf778('0x1f');var _0x42fb4b=_0x142373[_0xf778('0x20')];var _0xb8269e=_0x6309a4?0x0:_0x3e8985[_0xf778('0x1d')];var _0x51f430=_0x6309a4?_0x142373['count']:_0x3e8985[_0xf778('0x1d')]+_0x3e8985[_0xf778('0x1e')];var _0x444328;if(_0x51f430>=_0x42fb4b){_0x51f430=_0x42fb4b;_0x444328=0xc8;}else{_0x444328=0xce;}_0x576832['status'](_0x444328);return _0x576832['set']('Content-Range',_0xb8269e+'-'+_0x51f430+'/'+_0x42fb4b)['json'](_0x142373);}return null;};}function patchUpdates(_0x24a5f0){return function(_0x57f5ae){try{jsonpatch['apply'](_0x57f5ae,_0x24a5f0,!![]);}catch(_0xbfa2c3){return BPromise[_0xf778('0x21')](_0xbfa2c3);}return _0x57f5ae[_0xf778('0x22')]();};}function saveUpdates(_0x543bda,_0x311a03){return function(_0x59d13a){if(_0x59d13a){return _0x59d13a[_0xf778('0x23')](_0x543bda)[_0xf778('0x24')](function(_0x32eb83){return _0x32eb83;});}return null;};}function removeEntity(_0x587cc6,_0x3c31d){return function(_0x27966b){if(_0x27966b){return _0x27966b['destroy']()[_0xf778('0x24')](function(){_0x587cc6[_0xf778('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb725,_0x50ba07){return function(_0x20581b){if(!_0x20581b){_0x4bb725[_0xf778('0x19')](0x194);}return _0x20581b;};}function handleError(_0x2013f8,_0x258f4e){_0x258f4e=_0x258f4e||0x1f4;return function(_0x25bbc8){logger['error'](_0x25bbc8[_0xf778('0x25')]);if(_0x25bbc8[_0xf778('0x26')]){delete _0x25bbc8['name'];}_0x2013f8[_0xf778('0x1a')](_0x258f4e)[_0xf778('0x27')](_0x25bbc8);};}exports[_0xf778('0x28')]=function(_0x3f14ac,_0x4b50d2){var _0x3a3e0d={},_0x5d9df5={},_0x311970={'count':0x0,'rows':[]};var _0x52144f=_[_0xf778('0x29')](db[_0xf778('0x2a')][_0xf778('0x2b')],function(_0x5669c7){return{'name':_0x5669c7[_0xf778('0x2c')],'type':_0x5669c7['type'][_0xf778('0x2d')]};});_0x5d9df5['model']=_['map'](_0x52144f,'name');_0x5d9df5[_0xf778('0x2e')]=_[_0xf778('0x2f')](_0x3f14ac['query']);_0x5d9df5[_0xf778('0x30')]=_[_0xf778('0x31')](_0x5d9df5['model'],_0x5d9df5[_0xf778('0x2e')]);_0x3a3e0d['attributes']=_[_0xf778('0x31')](_0x5d9df5[_0xf778('0x32')],qs[_0xf778('0x33')](_0x3f14ac[_0xf778('0x2e')][_0xf778('0x33')]));_0x3a3e0d['attributes']=_0x3a3e0d[_0xf778('0x34')][_0xf778('0x35')]?_0x3a3e0d['attributes']:_0x5d9df5[_0xf778('0x32')];if(!_0x3f14ac[_0xf778('0x2e')][_0xf778('0x36')](_0xf778('0x37'))){_0x3a3e0d[_0xf778('0x1e')]=qs['limit'](_0x3f14ac[_0xf778('0x2e')][_0xf778('0x1e')]);_0x3a3e0d[_0xf778('0x1d')]=qs[_0xf778('0x1d')](_0x3f14ac[_0xf778('0x2e')][_0xf778('0x1d')]);}_0x3a3e0d[_0xf778('0x38')]=qs[_0xf778('0x39')](_0x3f14ac[_0xf778('0x2e')][_0xf778('0x39')]);_0x3a3e0d[_0xf778('0x3a')]=qs[_0xf778('0x30')](_['pick'](_0x3f14ac[_0xf778('0x2e')],_0x5d9df5[_0xf778('0x30')]),_0x52144f);if(_0x3f14ac['query'][_0xf778('0x3b')]){_0x3a3e0d[_0xf778('0x3a')]=_[_0xf778('0x3c')](_0x3a3e0d[_0xf778('0x3a')],{'$or':_[_0xf778('0x29')](_0x52144f,function(_0x5dd1c7){if(_0x5dd1c7[_0xf778('0x3d')]!=='VIRTUAL'){var _0x3007e7={};_0x3007e7[_0x5dd1c7[_0xf778('0x26')]]={'$like':'%'+_0x3f14ac[_0xf778('0x2e')][_0xf778('0x3b')]+'%'};return _0x3007e7;}})});}_0x3a3e0d=_[_0xf778('0x3c')]({},_0x3a3e0d,_0x3f14ac[_0xf778('0x3e')]);var _0x188400={'where':_0x3a3e0d[_0xf778('0x3a')]};return db[_0xf778('0x2a')][_0xf778('0x20')](_0x188400)[_0xf778('0x24')](function(_0x87435c){_0x311970[_0xf778('0x20')]=_0x87435c;if(_0x3f14ac[_0xf778('0x2e')][_0xf778('0x3f')]){_0x3a3e0d[_0xf778('0x40')]=[{'all':!![]}];}return db[_0xf778('0x2a')][_0xf778('0x41')](_0x3a3e0d);})[_0xf778('0x24')](function(_0x2481f3){_0x311970[_0xf778('0x42')]=_0x2481f3;return _0x311970;})[_0xf778('0x24')](respondWithFilteredResult(_0x4b50d2,_0x3a3e0d))[_0xf778('0x43')](handleError(_0x4b50d2,null));};exports[_0xf778('0x44')]=function(_0x4c20cb,_0x130140){var _0x523a75={'raw':!![],'where':{'id':_0x4c20cb[_0xf778('0x45')]['id']}},_0x193f6c={};_0x193f6c[_0xf778('0x32')]=_[_0xf778('0x2f')](db[_0xf778('0x2a')][_0xf778('0x2b')]);_0x193f6c[_0xf778('0x2e')]=_[_0xf778('0x2f')](_0x4c20cb[_0xf778('0x2e')]);_0x193f6c['filters']=_[_0xf778('0x31')](_0x193f6c[_0xf778('0x32')],_0x193f6c[_0xf778('0x2e')]);_0x523a75['attributes']=_['intersection'](_0x193f6c[_0xf778('0x32')],qs[_0xf778('0x33')](_0x4c20cb['query']['fields']));_0x523a75[_0xf778('0x34')]=_0x523a75[_0xf778('0x34')]['length']?_0x523a75['attributes']:_0x193f6c['model'];if(_0x4c20cb[_0xf778('0x2e')]['includeAll']){_0x523a75[_0xf778('0x40')]=[{'all':!![]}];}_0x523a75=_[_0xf778('0x3c')]({},_0x523a75,_0x4c20cb[_0xf778('0x3e')]);return db[_0xf778('0x2a')]['find'](_0x523a75)[_0xf778('0x24')](handleEntityNotFound(_0x130140,null))[_0xf778('0x24')](respondWithResult(_0x130140,null))[_0xf778('0x43')](handleError(_0x130140,null));};exports[_0xf778('0x46')]=function(_0xd5b35,_0x13f235){return db[_0xf778('0x2a')][_0xf778('0x46')](_0xd5b35[_0xf778('0x47')],{})[_0xf778('0x24')](respondWithResult(_0x13f235,0xc9))[_0xf778('0x43')](handleError(_0x13f235,null));};exports[_0xf778('0x23')]=function(_0x1b7751,_0x44b704){if(_0x1b7751[_0xf778('0x47')]['id']){delete _0x1b7751[_0xf778('0x47')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x1b7751[_0xf778('0x45')]['id']}})[_0xf778('0x24')](handleEntityNotFound(_0x44b704,null))[_0xf778('0x24')](saveUpdates(_0x1b7751[_0xf778('0x47')],null))[_0xf778('0x24')](respondWithResult(_0x44b704,null))[_0xf778('0x43')](handleError(_0x44b704,null));};exports[_0xf778('0x48')]=function(_0x4bda53,_0x112633){return db['JscriptySessionReport'][_0xf778('0x49')]({'where':{'id':_0x4bda53[_0xf778('0x45')]['id']}})[_0xf778('0x24')](handleEntityNotFound(_0x112633,null))['then'](removeEntity(_0x112633,null))[_0xf778('0x43')](handleError(_0x112633,null));};exports[_0xf778('0x4a')]=function(_0x2c734a,_0x31d547){return db[_0xf778('0x2a')][_0xf778('0x4a')]()['then'](respondWithResult(_0x31d547,null))[_0xf778('0x43')](handleError(_0x31d547,null));};exports[_0xf778('0x4b')]=function(_0x23d8eb,_0x4f3aa9,_0xc90f2f){var _0x2b8305={'raw':!![],'where':{}};var _0x1a1317={};var _0x4d953b={'count':0x0,'rows':[]};return db[_0xf778('0x2a')]['findOne']({'where':{'id':_0x23d8eb['params']['id']}})['then'](handleEntityNotFound(_0x4f3aa9,null))[_0xf778('0x24')](function(_0x3c185b){if(_0x3c185b){_0x1a1317[_0xf778('0x32')]=_[_0xf778('0x2f')](db[_0xf778('0x4c')][_0xf778('0x2b')]);_0x1a1317[_0xf778('0x2e')]=_[_0xf778('0x2f')](_0x23d8eb['query']);_0x1a1317[_0xf778('0x30')]=_[_0xf778('0x31')](_0x1a1317[_0xf778('0x32')],_0x1a1317[_0xf778('0x2e')]);_0x2b8305[_0xf778('0x34')]=_[_0xf778('0x31')](_0x1a1317[_0xf778('0x32')],qs['fields'](_0x23d8eb['query']['fields']));_0x2b8305[_0xf778('0x34')]=_0x2b8305[_0xf778('0x34')][_0xf778('0x35')]?_0x2b8305[_0xf778('0x34')]:_0x1a1317['model'];if(!_0x23d8eb[_0xf778('0x2e')][_0xf778('0x36')](_0xf778('0x37'))){_0x2b8305[_0xf778('0x1e')]=qs['limit'](_0x23d8eb[_0xf778('0x2e')]['limit']);_0x2b8305['offset']=qs['offset'](_0x23d8eb[_0xf778('0x2e')][_0xf778('0x1d')]);}_0x2b8305['order']=qs[_0xf778('0x39')](_0x23d8eb[_0xf778('0x2e')][_0xf778('0x39')]);_0x2b8305[_0xf778('0x3a')]=qs[_0xf778('0x30')](_[_0xf778('0x4d')](_0x23d8eb[_0xf778('0x2e')],_0x1a1317[_0xf778('0x30')]));_0x2b8305['where'][_0xf778('0x4e')]=_0x3c185b['id'];if(_0x23d8eb['query'][_0xf778('0x3b')]){_0x2b8305[_0xf778('0x3a')]=_['merge'](_0x2b8305[_0xf778('0x3a')],{'$or':_[_0xf778('0x29')](_0x2b8305[_0xf778('0x34')],function(_0x1466d4){var _0xa20934={};_0xa20934[_0x1466d4]={'$like':'%'+_0x23d8eb[_0xf778('0x2e')]['filter']+'%'};return _0xa20934;})});}_0x2b8305=_[_0xf778('0x3c')]({},_0x2b8305,_0x23d8eb[_0xf778('0x3e')]);return db[_0xf778('0x4c')][_0xf778('0x20')]({'where':_0x2b8305[_0xf778('0x3a')]})[_0xf778('0x24')](function(_0x5254e7){_0x4d953b[_0xf778('0x20')]=_0x5254e7;if(_0x23d8eb[_0xf778('0x2e')][_0xf778('0x3f')]){_0x2b8305[_0xf778('0x40')]=[{'all':!![]}];}return db[_0xf778('0x4c')][_0xf778('0x41')](_0x2b8305);})[_0xf778('0x24')](function(_0x4a648d){_0x4d953b[_0xf778('0x42')]=_0x4a648d;return _0x4d953b;});}})[_0xf778('0x24')](respondWithFilteredResult(_0x4f3aa9,_0x2b8305))[_0xf778('0x43')](handleError(_0x4f3aa9,null));};
\ No newline at end of file
+var _0xa094=['rows','catch','show','rawAttributes','find','create','body','params','getQuestions','findOne','hasOwnProperty','SessionId','JscriptyQuestionReport','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','reject','save','update','then','destroy','stack','name','send','index','JscriptySessionReport','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0xa094,0x1e2));var _0x4a09=function(_0x523c1f,_0x1fb73b){_0x523c1f=_0x523c1f-0x0;var _0x293fcd=_0xa094[_0x523c1f];return _0x293fcd;};'use strict';var emlformat=require(_0x4a09('0x0'));var rimraf=require(_0x4a09('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a09('0x2'));var rp=require(_0x4a09('0x3'));var moment=require(_0x4a09('0x4'));var BPromise=require(_0x4a09('0x5'));var Mustache=require(_0x4a09('0x6'));var util=require(_0x4a09('0x7'));var path=require(_0x4a09('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4a09('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a09('0xa'));var squel=require(_0x4a09('0xb'));var crypto=require('crypto');var jsforce=require(_0x4a09('0xc'));var deskjs=require(_0x4a09('0xd'));var toCsv=require(_0x4a09('0xe'));var querystring=require('querystring');var Papa=require(_0x4a09('0xf'));var Redis=require(_0x4a09('0x10'));var authService=require(_0x4a09('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4a09('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a09('0x13'))(_0x4a09('0x14'));var utils=require('../../config/utils');var config=require(_0x4a09('0x15'));var licenseUtil=require(_0x4a09('0x16'));var db=require(_0x4a09('0x17'))['db'];function respondWithStatusCode(_0x306259,_0x21314a){_0x21314a=_0x21314a||0xcc;return function(_0x38211d){if(_0x38211d){return _0x306259['sendStatus'](_0x21314a);}return _0x306259[_0x4a09('0x18')](_0x21314a)[_0x4a09('0x19')]();};}function respondWithResult(_0x479adc,_0x2d98fe){_0x2d98fe=_0x2d98fe||0xc8;return function(_0x1e4dd2){if(_0x1e4dd2){return _0x479adc[_0x4a09('0x18')](_0x2d98fe)[_0x4a09('0x1a')](_0x1e4dd2);}};}function respondWithFilteredResult(_0x24c222,_0x317d05){return function(_0x34435a){if(_0x34435a){var _0x11804d=typeof _0x317d05[_0x4a09('0x1b')]==='undefined'&&typeof _0x317d05[_0x4a09('0x1c')]===_0x4a09('0x1d');var _0x430523=_0x34435a['count'];var _0x13481b=_0x11804d?0x0:_0x317d05[_0x4a09('0x1b')];var _0xd34dc2=_0x11804d?_0x34435a[_0x4a09('0x1e')]:_0x317d05[_0x4a09('0x1b')]+_0x317d05[_0x4a09('0x1c')];var _0x1e930c;if(_0xd34dc2>=_0x430523){_0xd34dc2=_0x430523;_0x1e930c=0xc8;}else{_0x1e930c=0xce;}_0x24c222['status'](_0x1e930c);return _0x24c222['set']('Content-Range',_0x13481b+'-'+_0xd34dc2+'/'+_0x430523)[_0x4a09('0x1a')](_0x34435a);}return null;};}function patchUpdates(_0x1700c8){return function(_0xd66b51){try{jsonpatch['apply'](_0xd66b51,_0x1700c8,!![]);}catch(_0x25a34b){return BPromise[_0x4a09('0x1f')](_0x25a34b);}return _0xd66b51[_0x4a09('0x20')]();};}function saveUpdates(_0x49eb86,_0x21d2f9){return function(_0x1156a1){if(_0x1156a1){return _0x1156a1[_0x4a09('0x21')](_0x49eb86)[_0x4a09('0x22')](function(_0x399ce4){return _0x399ce4;});}return null;};}function removeEntity(_0xb201dd,_0x4d71ce){return function(_0x4a33f9){if(_0x4a33f9){return _0x4a33f9[_0x4a09('0x23')]()[_0x4a09('0x22')](function(){_0xb201dd['status'](0xcc)[_0x4a09('0x19')]();});}};}function handleEntityNotFound(_0x41e3dc,_0x4d6d5d){return function(_0x2aa877){if(!_0x2aa877){_0x41e3dc['sendStatus'](0x194);}return _0x2aa877;};}function handleError(_0x19e647,_0x1f026c){_0x1f026c=_0x1f026c||0x1f4;return function(_0x2f9da9){logger['error'](_0x2f9da9[_0x4a09('0x24')]);if(_0x2f9da9[_0x4a09('0x25')]){delete _0x2f9da9[_0x4a09('0x25')];}_0x19e647[_0x4a09('0x18')](_0x1f026c)[_0x4a09('0x26')](_0x2f9da9);};}exports[_0x4a09('0x27')]=function(_0x4651ec,_0xcf3737){var _0x386631={},_0x2dabc3={},_0xb18dbe={'count':0x0,'rows':[]};var _0x161bcb=_['map'](db[_0x4a09('0x28')]['rawAttributes'],function(_0x3b3292){return{'name':_0x3b3292[_0x4a09('0x29')],'type':_0x3b3292[_0x4a09('0x2a')][_0x4a09('0x2b')]};});_0x2dabc3[_0x4a09('0x2c')]=_[_0x4a09('0x2d')](_0x161bcb,_0x4a09('0x25'));_0x2dabc3[_0x4a09('0x2e')]=_[_0x4a09('0x2f')](_0x4651ec[_0x4a09('0x2e')]);_0x2dabc3[_0x4a09('0x30')]=_[_0x4a09('0x31')](_0x2dabc3[_0x4a09('0x2c')],_0x2dabc3['query']);_0x386631['attributes']=_[_0x4a09('0x31')](_0x2dabc3[_0x4a09('0x2c')],qs['fields'](_0x4651ec[_0x4a09('0x2e')][_0x4a09('0x32')]));_0x386631[_0x4a09('0x33')]=_0x386631[_0x4a09('0x33')][_0x4a09('0x34')]?_0x386631[_0x4a09('0x33')]:_0x2dabc3['model'];if(!_0x4651ec[_0x4a09('0x2e')]['hasOwnProperty'](_0x4a09('0x35'))){_0x386631['limit']=qs['limit'](_0x4651ec[_0x4a09('0x2e')][_0x4a09('0x1c')]);_0x386631['offset']=qs[_0x4a09('0x1b')](_0x4651ec[_0x4a09('0x2e')][_0x4a09('0x1b')]);}_0x386631[_0x4a09('0x36')]=qs['sort'](_0x4651ec[_0x4a09('0x2e')][_0x4a09('0x37')]);_0x386631[_0x4a09('0x38')]=qs['filters'](_[_0x4a09('0x39')](_0x4651ec['query'],_0x2dabc3['filters']),_0x161bcb);if(_0x4651ec[_0x4a09('0x2e')][_0x4a09('0x3a')]){_0x386631[_0x4a09('0x38')]=_[_0x4a09('0x3b')](_0x386631[_0x4a09('0x38')],{'$or':_[_0x4a09('0x2d')](_0x161bcb,function(_0x5334f8){if(_0x5334f8[_0x4a09('0x2a')]!==_0x4a09('0x3c')){var _0x15ecb9={};_0x15ecb9[_0x5334f8[_0x4a09('0x25')]]={'$like':'%'+_0x4651ec[_0x4a09('0x2e')][_0x4a09('0x3a')]+'%'};return _0x15ecb9;}})});}_0x386631=_['merge']({},_0x386631,_0x4651ec[_0x4a09('0x3d')]);var _0x4ec06d={'where':_0x386631['where']};return db[_0x4a09('0x28')]['count'](_0x4ec06d)[_0x4a09('0x22')](function(_0x21accb){_0xb18dbe[_0x4a09('0x1e')]=_0x21accb;if(_0x4651ec[_0x4a09('0x2e')][_0x4a09('0x3e')]){_0x386631[_0x4a09('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x386631);})[_0x4a09('0x22')](function(_0x56c581){_0xb18dbe[_0x4a09('0x40')]=_0x56c581;return _0xb18dbe;})[_0x4a09('0x22')](respondWithFilteredResult(_0xcf3737,_0x386631))[_0x4a09('0x41')](handleError(_0xcf3737,null));};exports[_0x4a09('0x42')]=function(_0x381ed4,_0xae044c){var _0x5ab1d6={'raw':!![],'where':{'id':_0x381ed4['params']['id']}},_0x157ee5={};_0x157ee5[_0x4a09('0x2c')]=_[_0x4a09('0x2f')](db['JscriptySessionReport'][_0x4a09('0x43')]);_0x157ee5[_0x4a09('0x2e')]=_[_0x4a09('0x2f')](_0x381ed4['query']);_0x157ee5['filters']=_[_0x4a09('0x31')](_0x157ee5[_0x4a09('0x2c')],_0x157ee5[_0x4a09('0x2e')]);_0x5ab1d6['attributes']=_[_0x4a09('0x31')](_0x157ee5[_0x4a09('0x2c')],qs[_0x4a09('0x32')](_0x381ed4[_0x4a09('0x2e')][_0x4a09('0x32')]));_0x5ab1d6['attributes']=_0x5ab1d6[_0x4a09('0x33')][_0x4a09('0x34')]?_0x5ab1d6['attributes']:_0x157ee5[_0x4a09('0x2c')];if(_0x381ed4['query']['includeAll']){_0x5ab1d6[_0x4a09('0x3f')]=[{'all':!![]}];}_0x5ab1d6=_[_0x4a09('0x3b')]({},_0x5ab1d6,_0x381ed4[_0x4a09('0x3d')]);return db['JscriptySessionReport'][_0x4a09('0x44')](_0x5ab1d6)[_0x4a09('0x22')](handleEntityNotFound(_0xae044c,null))['then'](respondWithResult(_0xae044c,null))[_0x4a09('0x41')](handleError(_0xae044c,null));};exports[_0x4a09('0x45')]=function(_0xe2a89e,_0x448fbc){return db['JscriptySessionReport'][_0x4a09('0x45')](_0xe2a89e[_0x4a09('0x46')],{})[_0x4a09('0x22')](respondWithResult(_0x448fbc,0xc9))[_0x4a09('0x41')](handleError(_0x448fbc,null));};exports[_0x4a09('0x21')]=function(_0x2a7669,_0x17a6ff){if(_0x2a7669[_0x4a09('0x46')]['id']){delete _0x2a7669[_0x4a09('0x46')]['id'];}return db[_0x4a09('0x28')]['find']({'where':{'id':_0x2a7669[_0x4a09('0x47')]['id']}})[_0x4a09('0x22')](handleEntityNotFound(_0x17a6ff,null))[_0x4a09('0x22')](saveUpdates(_0x2a7669[_0x4a09('0x46')],null))[_0x4a09('0x22')](respondWithResult(_0x17a6ff,null))[_0x4a09('0x41')](handleError(_0x17a6ff,null));};exports[_0x4a09('0x23')]=function(_0x21e265,_0x3f0b38){return db[_0x4a09('0x28')][_0x4a09('0x44')]({'where':{'id':_0x21e265[_0x4a09('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f0b38,null))[_0x4a09('0x22')](removeEntity(_0x3f0b38,null))[_0x4a09('0x41')](handleError(_0x3f0b38,null));};exports['describe']=function(_0xe96510,_0x1e6cdc){return db['JscriptySessionReport']['describe']()[_0x4a09('0x22')](respondWithResult(_0x1e6cdc,null))['catch'](handleError(_0x1e6cdc,null));};exports[_0x4a09('0x48')]=function(_0x524f60,_0x4784d4,_0x7eb26e){var _0xdc0fa9={'raw':!![],'where':{}};var _0x157e23={};var _0x5f5dac={'count':0x0,'rows':[]};return db[_0x4a09('0x28')][_0x4a09('0x49')]({'where':{'id':_0x524f60['params']['id']}})[_0x4a09('0x22')](handleEntityNotFound(_0x4784d4,null))['then'](function(_0x45f773){if(_0x45f773){_0x157e23[_0x4a09('0x2c')]=_[_0x4a09('0x2f')](db['JscriptyQuestionReport'][_0x4a09('0x43')]);_0x157e23[_0x4a09('0x2e')]=_[_0x4a09('0x2f')](_0x524f60[_0x4a09('0x2e')]);_0x157e23[_0x4a09('0x30')]=_[_0x4a09('0x31')](_0x157e23[_0x4a09('0x2c')],_0x157e23[_0x4a09('0x2e')]);_0xdc0fa9[_0x4a09('0x33')]=_[_0x4a09('0x31')](_0x157e23['model'],qs[_0x4a09('0x32')](_0x524f60['query']['fields']));_0xdc0fa9[_0x4a09('0x33')]=_0xdc0fa9[_0x4a09('0x33')][_0x4a09('0x34')]?_0xdc0fa9[_0x4a09('0x33')]:_0x157e23['model'];if(!_0x524f60[_0x4a09('0x2e')][_0x4a09('0x4a')](_0x4a09('0x35'))){_0xdc0fa9['limit']=qs[_0x4a09('0x1c')](_0x524f60[_0x4a09('0x2e')][_0x4a09('0x1c')]);_0xdc0fa9['offset']=qs[_0x4a09('0x1b')](_0x524f60['query'][_0x4a09('0x1b')]);}_0xdc0fa9['order']=qs[_0x4a09('0x37')](_0x524f60[_0x4a09('0x2e')][_0x4a09('0x37')]);_0xdc0fa9[_0x4a09('0x38')]=qs[_0x4a09('0x30')](_[_0x4a09('0x39')](_0x524f60['query'],_0x157e23['filters']));_0xdc0fa9[_0x4a09('0x38')][_0x4a09('0x4b')]=_0x45f773['id'];if(_0x524f60[_0x4a09('0x2e')][_0x4a09('0x3a')]){_0xdc0fa9[_0x4a09('0x38')]=_[_0x4a09('0x3b')](_0xdc0fa9['where'],{'$or':_['map'](_0xdc0fa9['attributes'],function(_0x59d764){var _0x2f150d={};_0x2f150d[_0x59d764]={'$like':'%'+_0x524f60[_0x4a09('0x2e')][_0x4a09('0x3a')]+'%'};return _0x2f150d;})});}_0xdc0fa9=_[_0x4a09('0x3b')]({},_0xdc0fa9,_0x524f60[_0x4a09('0x3d')]);return db['JscriptyQuestionReport'][_0x4a09('0x1e')]({'where':_0xdc0fa9[_0x4a09('0x38')]})[_0x4a09('0x22')](function(_0x508ce2){_0x5f5dac['count']=_0x508ce2;if(_0x524f60['query'][_0x4a09('0x3e')]){_0xdc0fa9[_0x4a09('0x3f')]=[{'all':!![]}];}return db[_0x4a09('0x4c')][_0x4a09('0x4d')](_0xdc0fa9);})[_0x4a09('0x22')](function(_0x54944a){_0x5f5dac[_0x4a09('0x40')]=_0x54944a;return _0x5f5dac;});}})['then'](respondWithFilteredResult(_0x4784d4,_0xdc0fa9))[_0x4a09('0x41')](handleError(_0x4784d4,null));};
\ No newline at end of file
index 01891e5..18a08f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7278=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x36a4e9,_0x3a280c){var _0x5dee77=function(_0x35cda4){while(--_0x35cda4){_0x36a4e9['push'](_0x36a4e9['shift']());}};_0x5dee77(++_0x3a280c);}(_0x7278,0x161));var _0x8727=function(_0x2c02e8,_0x282e31){_0x2c02e8=_0x2c02e8-0x0;var _0x22ef9f=_0x7278[_0x2c02e8];return _0x22ef9f;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['define','JscriptySessionReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x2454b9,_0x2f2be5){var _0x1d8100=function(_0x2e2f6e){while(--_0x2e2f6e){_0x2454b9['push'](_0x2454b9['shift']());}};_0x1d8100(++_0x2f2be5);}(_0x814b,0x1a2));var _0xb814=function(_0x38a155,_0x2aa026){_0x38a155=_0x38a155-0x0;var _0x269403=_0x814b[_0x38a155];return _0x269403;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a613609..f0eae01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6455=['client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x28a068,_0x536950){var _0x1e21d8=function(_0x2a8f0c){while(--_0x2a8f0c){_0x28a068['push'](_0x28a068['shift']());}};_0x1e21d8(++_0x536950);}(_0x6455,0x97));var _0x5645=function(_0x470dd1,_0x5ae1ea){_0x470dd1=_0x470dd1-0x0;var _0x53ae78=_0x6455[_0x470dd1];return _0x53ae78;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d672,_0xa14a06,_0x278d86){return new BPromise(function(_0x518a28,_0x5f4037){return client[_0x5645('0xc')](_0x37d672,_0x278d86)[_0x5645('0xd')](function(_0x38c07a){logger[_0x5645('0xe')](_0x5645('0xf'),_0xa14a06,_0x5645('0x10'));logger['debug'](_0x5645('0x11'),_0xa14a06,_0x5645('0x10'),JSON[_0x5645('0x12')](_0x38c07a));if(_0x38c07a[_0x5645('0x13')]){if(_0x38c07a['error'][_0x5645('0x14')]===0x1f4){logger['error'](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);return _0x5f4037(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')]['message']);return _0x518a28(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}else{logger[_0x5645('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0xa14a06,'request\x20sent');_0x518a28(_0x38c07a[_0x5645('0x16')][_0x5645('0x15')]);}})['catch'](function(_0x35e0c7){logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x35e0c7);_0x5f4037(_0x35e0c7);});});}
\ No newline at end of file
+var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c524c,_0x9a7c3f){var _0x55a955=function(_0x35c021){while(--_0x35c021){_0x2c524c['push'](_0x2c524c['shift']());}};_0x55a955(++_0x9a7c3f);}(_0x1623,0xab));var _0x3162=function(_0x3f2211,_0x5d8cac){_0x3f2211=_0x3f2211-0x0;var _0x3eb63a=_0x1623[_0x3f2211];return _0x3eb63a;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}
\ No newline at end of file
index dff8832..422360b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe209=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','Router'];(function(_0x2e4335,_0x2b3a89){var _0x1061f2=function(_0x7afd39){while(--_0x7afd39){_0x2e4335['push'](_0x2e4335['shift']());}};_0x1061f2(++_0x2b3a89);}(_0xe209,0x8d));var _0x9e20=function(_0x1d1455,_0x190f45){_0x1d1455=_0x1d1455-0x0;var _0xea6daa=_0xe209[_0x1d1455];return _0xea6daa;};'use strict';var multer=require(_0x9e20('0x0'));var util=require(_0x9e20('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e20('0x2')]();var fs_extra=require(_0x9e20('0x3'));var auth=require(_0x9e20('0x4'));var interaction=require(_0x9e20('0x5'));var config=require(_0x9e20('0x6'));var controller=require(_0x9e20('0x7'));router[_0x9e20('0x8')]('/',controller['index']);router[_0x9e20('0x9')](_0x9e20('0xa'),auth[_0x9e20('0xb')](),controller[_0x9e20('0xc')]);router['get'](_0x9e20('0xd'),auth[_0x9e20('0xb')](),controller[_0x9e20('0xe')]);module[_0x9e20('0xf')]=router;
\ No newline at end of file
+var _0x40e8=['../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','exports','path','express','Router'];(function(_0x49f5e8,_0x2ee007){var _0x4fa732=function(_0x3117fe){while(--_0x3117fe){_0x49f5e8['push'](_0x49f5e8['shift']());}};_0x4fa732(++_0x2ee007);}(_0x40e8,0xb1));var _0x840e=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x40e8[_0x1f7201];return _0x289fd2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x840e('0x0'));var timeout=require('connect-timeout');var express=require(_0x840e('0x1'));var router=express[_0x840e('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x840e('0x3'));var config=require(_0x840e('0x4'));var controller=require(_0x840e('0x5'));router[_0x840e('0x6')]('/',controller[_0x840e('0x7')]);router[_0x840e('0x8')](_0x840e('0x9'),auth['isAuthenticated'](),controller[_0x840e('0xa')]);router[_0x840e('0x6')](_0x840e('0xb'),auth[_0x840e('0xc')](),controller[_0x840e('0xd')]);module[_0x840e('0xe')]=router;
\ No newline at end of file
index be72399..d7df3a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe51e=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x4f4779,_0x2283a7){var _0x4543f0=function(_0x5e5950){while(--_0x5e5950){_0x4f4779['push'](_0x4f4779['shift']());}};_0x4543f0(++_0x2283a7);}(_0xe51e,0x116));var _0xee51=function(_0x38ee64,_0x24564b){_0x38ee64=_0x38ee64-0x0;var _0x2e4661=_0xe51e[_0x38ee64];return _0x2e4661;};'use strict';var Sequelize=require(_0xee51('0x0'));module[_0xee51('0x1')]={'license':{'type':Sequelize[_0xee51('0x2')]},'data1':{'type':Sequelize[_0xee51('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xee51('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb8c0=['INTEGER','sequelize','STRING'];(function(_0x2053aa,_0x3df40e){var _0x30f5bb=function(_0x1b3f36){while(--_0x1b3f36){_0x2053aa['push'](_0x2053aa['shift']());}};_0x30f5bb(++_0x3df40e);}(_0xb8c0,0x148));var _0x0b8c=function(_0x2e23e4,_0x1b31f4){_0x2e23e4=_0x2e23e4-0x0;var _0x5cc4ad=_0xb8c0[_0x2e23e4];return _0x5cc4ad;};'use strict';var Sequelize=require(_0x0b8c('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x0b8c('0x1')]},'data2':{'type':Sequelize[_0x0b8c('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x0b8c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 6fc00c1..b7b7110 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb09=['to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','keys','rawAttributes','query','intersection','model','attributes','fields','length','merge','options','getLicense','catch','body','License','find','params','key','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xfb09,0x19d));var _0x9fb0=function(_0x3e0c95,_0x4a6b61){_0x3e0c95=_0x3e0c95-0x0;var _0x5e9bb2=_0xfb09[_0x3e0c95];return _0x5e9bb2;};'use strict';var emlformat=require(_0x9fb0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9fb0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9fb0('0x2'));var BPromise=require(_0x9fb0('0x3'));var Mustache=require(_0x9fb0('0x4'));var util=require('util');var path=require(_0x9fb0('0x5'));var sox=require(_0x9fb0('0x6'));var csv=require('to-csv');var ejs=require(_0x9fb0('0x7'));var fs=require('fs');var fs_extra=require(_0x9fb0('0x8'));var _=require('lodash');var squel=require(_0x9fb0('0x9'));var crypto=require(_0x9fb0('0xa'));var jsforce=require(_0x9fb0('0xb'));var deskjs=require(_0x9fb0('0xc'));var toCsv=require(_0x9fb0('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9fb0('0xe'));var authService=require(_0x9fb0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9fb0('0x10'));var hardwareService=require(_0x9fb0('0x11'));var logger=require(_0x9fb0('0x12'))(_0x9fb0('0x13'));var utils=require(_0x9fb0('0x14'));var config=require(_0x9fb0('0x15'));var licenseUtil=require(_0x9fb0('0x16'));var db=require(_0x9fb0('0x17'))['db'];function respondWithStatusCode(_0x5eed91,_0x584449){_0x584449=_0x584449||0xcc;return function(_0x349429){if(_0x349429){return _0x5eed91[_0x9fb0('0x18')](_0x584449);}return _0x5eed91['status'](_0x584449)['end']();};}function respondWithResult(_0x51e5b0,_0x2b7b69){_0x2b7b69=_0x2b7b69||0xc8;return function(_0x1a4ad0){if(_0x1a4ad0){return _0x51e5b0[_0x9fb0('0x19')](_0x2b7b69)[_0x9fb0('0x1a')](_0x1a4ad0);}};}function respondWithFilteredResult(_0x8e098b,_0xb17a47){return function(_0x4b9712){if(_0x4b9712){var _0x136746=typeof _0xb17a47[_0x9fb0('0x1b')]==='undefined'&&typeof _0xb17a47[_0x9fb0('0x1c')]===_0x9fb0('0x1d');var _0x2fd4bf=_0x4b9712['count'];var _0x374d2e=_0x136746?0x0:_0xb17a47[_0x9fb0('0x1b')];var _0x8a38fe=_0x136746?_0x4b9712['count']:_0xb17a47[_0x9fb0('0x1b')]+_0xb17a47[_0x9fb0('0x1c')];var _0x53cecf;if(_0x8a38fe>=_0x2fd4bf){_0x8a38fe=_0x2fd4bf;_0x53cecf=0xc8;}else{_0x53cecf=0xce;}_0x8e098b[_0x9fb0('0x19')](_0x53cecf);return _0x8e098b[_0x9fb0('0x1e')](_0x9fb0('0x1f'),_0x374d2e+'-'+_0x8a38fe+'/'+_0x2fd4bf)[_0x9fb0('0x1a')](_0x4b9712);}return null;};}function patchUpdates(_0x3e5df2){return function(_0x8bc75e){try{jsonpatch[_0x9fb0('0x20')](_0x8bc75e,_0x3e5df2,!![]);}catch(_0x1b9b31){return BPromise['reject'](_0x1b9b31);}return _0x8bc75e[_0x9fb0('0x21')]();};}function saveUpdates(_0x51689f,_0x7aef8d){return function(_0x2f77d4){if(_0x2f77d4){return _0x2f77d4[_0x9fb0('0x22')](_0x51689f)[_0x9fb0('0x23')](function(_0x1bfc90){return _0x1bfc90;});}return null;};}function removeEntity(_0x41aea8,_0x39bda3){return function(_0x1d082d){if(_0x1d082d){return _0x1d082d[_0x9fb0('0x24')]()[_0x9fb0('0x23')](function(){_0x41aea8[_0x9fb0('0x19')](0xcc)[_0x9fb0('0x25')]();});}};}function handleEntityNotFound(_0x449812,_0x2e9eb8){return function(_0x457757){if(!_0x457757){_0x449812[_0x9fb0('0x18')](0x194);}return _0x457757;};}function handleError(_0x473f3d,_0x47d53f){_0x47d53f=_0x47d53f||0x1f4;return function(_0x5f1693){logger[_0x9fb0('0x26')](_0x5f1693[_0x9fb0('0x27')]);if(_0x5f1693[_0x9fb0('0x28')]){delete _0x5f1693[_0x9fb0('0x28')];}_0x473f3d[_0x9fb0('0x19')](_0x47d53f)[_0x9fb0('0x29')](_0x5f1693);};}var utilLicense=require(_0x9fb0('0x16'));exports[_0x9fb0('0x2a')]=function(_0x867cdf,_0x2fb0bf){var _0x2dd210={'raw':!![],'where':{'id':0x1}},_0x57bbee={};_0x57bbee['model']=_[_0x9fb0('0x2b')](db['License'][_0x9fb0('0x2c')]);_0x57bbee['query']=_[_0x9fb0('0x2b')](_0x867cdf[_0x9fb0('0x2d')]);_0x57bbee['filters']=_[_0x9fb0('0x2e')](_0x57bbee[_0x9fb0('0x2f')],_0x57bbee[_0x9fb0('0x2d')]);_0x2dd210[_0x9fb0('0x30')]=_[_0x9fb0('0x2e')](_0x57bbee[_0x9fb0('0x2f')],qs['fields'](_0x867cdf[_0x9fb0('0x2d')][_0x9fb0('0x31')]));_0x2dd210[_0x9fb0('0x30')]=_0x2dd210[_0x9fb0('0x30')][_0x9fb0('0x32')]?_0x2dd210[_0x9fb0('0x30')]:_0x57bbee[_0x9fb0('0x2f')];_0x2dd210=_[_0x9fb0('0x33')]({},_0x2dd210,_0x867cdf[_0x9fb0('0x34')]);return utilLicense[_0x9fb0('0x35')](_0x2dd210)[_0x9fb0('0x23')](respondWithResult(_0x2fb0bf,null))[_0x9fb0('0x36')](handleError(_0x2fb0bf,null));};exports[_0x9fb0('0x22')]=function(_0x1c0fbb,_0x10634a){if(_0x1c0fbb[_0x9fb0('0x37')]['id']){delete _0x1c0fbb[_0x9fb0('0x37')]['id'];}return db[_0x9fb0('0x38')][_0x9fb0('0x39')]({'where':{'id':_0x1c0fbb[_0x9fb0('0x3a')]['id']}})[_0x9fb0('0x23')](handleEntityNotFound(_0x10634a,null))[_0x9fb0('0x23')](function(_0x52c15b){var _0x2f2da8=_0x52c15b['get']({'plain':!![]});return utilLicense['checkLicense'](_0x2f2da8,_0x1c0fbb[_0x9fb0('0x37')][_0x9fb0('0x3b')]);})[_0x9fb0('0x23')](function(_0xf03ed){if(!_0xf03ed['demo']){return saveUpdates(_0x1c0fbb[_0x9fb0('0x37')],null);}return _0xf03ed;})[_0x9fb0('0x23')](respondWithResult(_0x10634a,null))['catch'](handleError(_0x10634a,null));};exports[_0x9fb0('0x3c')]=function(_0x425b59,_0x3fd0a7){var _0x730d5a=_0x9fb0('0x3d');var _0x340d3b=path[_0x9fb0('0x3e')](_0x9fb0('0x3f'),_0x9fb0('0x40'),_0x9fb0('0x41'),_0x730d5a);_0x3fd0a7[_0x9fb0('0x42')]('Content-disposition',_0x9fb0('0x43')+_0x730d5a);_0x3fd0a7[_0x9fb0('0x1e')](_0x9fb0('0x44'),_0x9fb0('0x45'));_0x3fd0a7[_0x9fb0('0x46')](_0x340d3b);};
\ No newline at end of file
+var _0xfa0d=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','model','keys','License','query','filters','intersection','fields','attributes','options','then','body','find','params','key','demo','license-info.log','join','log','xcally','setHeader','attachment;\x20filename=','set','Content-Type','eml-format','rimraf','zip-dir','mustache','path','to-csv','ejs','lodash','squel'];(function(_0x4229a3,_0x5d486f){var _0x43b446=function(_0x7a3d35){while(--_0x7a3d35){_0x4229a3['push'](_0x4229a3['shift']());}};_0x43b446(++_0x5d486f);}(_0xfa0d,0xf7));var _0xdfa0=function(_0x192925,_0x362836){_0x192925=_0x192925-0x0;var _0x13ef65=_0xfa0d[_0x192925];return _0x13ef65;};'use strict';var emlformat=require(_0xdfa0('0x0'));var rimraf=require(_0xdfa0('0x1'));var zipdir=require(_0xdfa0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdfa0('0x3'));var util=require('util');var path=require(_0xdfa0('0x4'));var sox=require('sox');var csv=require(_0xdfa0('0x5'));var ejs=require(_0xdfa0('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfa0('0x7'));var squel=require(_0xdfa0('0x8'));var crypto=require('crypto');var jsforce=require(_0xdfa0('0x9'));var deskjs=require(_0xdfa0('0xa'));var toCsv=require(_0xdfa0('0x5'));var querystring=require(_0xdfa0('0xb'));var Papa=require(_0xdfa0('0xc'));var Redis=require(_0xdfa0('0xd'));var authService=require(_0xdfa0('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfa0('0xf'));var logger=require(_0xdfa0('0x10'))(_0xdfa0('0x11'));var utils=require(_0xdfa0('0x12'));var config=require(_0xdfa0('0x13'));var licenseUtil=require(_0xdfa0('0x14'));var db=require(_0xdfa0('0x15'))['db'];function respondWithStatusCode(_0x28961e,_0x442177){_0x442177=_0x442177||0xcc;return function(_0x324749){if(_0x324749){return _0x28961e[_0xdfa0('0x16')](_0x442177);}return _0x28961e['status'](_0x442177)[_0xdfa0('0x17')]();};}function respondWithResult(_0x429b57,_0x5bbac8){_0x5bbac8=_0x5bbac8||0xc8;return function(_0x5bf78b){if(_0x5bf78b){return _0x429b57[_0xdfa0('0x18')](_0x5bbac8)[_0xdfa0('0x19')](_0x5bf78b);}};}function respondWithFilteredResult(_0x28e88b,_0x5a8c8f){return function(_0x568c29){if(_0x568c29){var _0x5f0c71=typeof _0x5a8c8f[_0xdfa0('0x1a')]===_0xdfa0('0x1b')&&typeof _0x5a8c8f[_0xdfa0('0x1c')]===_0xdfa0('0x1b');var _0x5e3a17=_0x568c29[_0xdfa0('0x1d')];var _0x253b46=_0x5f0c71?0x0:_0x5a8c8f[_0xdfa0('0x1a')];var _0x4ebc20=_0x5f0c71?_0x568c29[_0xdfa0('0x1d')]:_0x5a8c8f[_0xdfa0('0x1a')]+_0x5a8c8f[_0xdfa0('0x1c')];var _0x2f06ad;if(_0x4ebc20>=_0x5e3a17){_0x4ebc20=_0x5e3a17;_0x2f06ad=0xc8;}else{_0x2f06ad=0xce;}_0x28e88b['status'](_0x2f06ad);return _0x28e88b['set'](_0xdfa0('0x1e'),_0x253b46+'-'+_0x4ebc20+'/'+_0x5e3a17)[_0xdfa0('0x19')](_0x568c29);}return null;};}function patchUpdates(_0x2acd62){return function(_0x2a8ecd){try{jsonpatch[_0xdfa0('0x1f')](_0x2a8ecd,_0x2acd62,!![]);}catch(_0x225ef7){return BPromise[_0xdfa0('0x20')](_0x225ef7);}return _0x2a8ecd[_0xdfa0('0x21')]();};}function saveUpdates(_0x587607,_0x3865e4){return function(_0x1bafa8){if(_0x1bafa8){return _0x1bafa8[_0xdfa0('0x22')](_0x587607)['then'](function(_0x4200b3){return _0x4200b3;});}return null;};}function removeEntity(_0x4e4adb,_0x3caaa2){return function(_0x471000){if(_0x471000){return _0x471000[_0xdfa0('0x23')]()['then'](function(){_0x4e4adb[_0xdfa0('0x18')](0xcc)[_0xdfa0('0x17')]();});}};}function handleEntityNotFound(_0x1f32a6,_0x5d966e){return function(_0x521566){if(!_0x521566){_0x1f32a6[_0xdfa0('0x16')](0x194);}return _0x521566;};}function handleError(_0x2d350a,_0x2701b2){_0x2701b2=_0x2701b2||0x1f4;return function(_0x5df04a){logger[_0xdfa0('0x24')](_0x5df04a[_0xdfa0('0x25')]);if(_0x5df04a['name']){delete _0x5df04a[_0xdfa0('0x26')];}_0x2d350a[_0xdfa0('0x18')](_0x2701b2)[_0xdfa0('0x27')](_0x5df04a);};}var utilLicense=require(_0xdfa0('0x14'));exports[_0xdfa0('0x28')]=function(_0x522afc,_0x537d3e){var _0x28da78={'raw':!![],'where':{'id':0x1}},_0x4791e6={};_0x4791e6[_0xdfa0('0x29')]=_[_0xdfa0('0x2a')](db[_0xdfa0('0x2b')]['rawAttributes']);_0x4791e6[_0xdfa0('0x2c')]=_[_0xdfa0('0x2a')](_0x522afc[_0xdfa0('0x2c')]);_0x4791e6[_0xdfa0('0x2d')]=_['intersection'](_0x4791e6[_0xdfa0('0x29')],_0x4791e6[_0xdfa0('0x2c')]);_0x28da78['attributes']=_[_0xdfa0('0x2e')](_0x4791e6[_0xdfa0('0x29')],qs[_0xdfa0('0x2f')](_0x522afc[_0xdfa0('0x2c')][_0xdfa0('0x2f')]));_0x28da78[_0xdfa0('0x30')]=_0x28da78[_0xdfa0('0x30')]['length']?_0x28da78[_0xdfa0('0x30')]:_0x4791e6[_0xdfa0('0x29')];_0x28da78=_['merge']({},_0x28da78,_0x522afc[_0xdfa0('0x31')]);return utilLicense['getLicense'](_0x28da78)[_0xdfa0('0x32')](respondWithResult(_0x537d3e,null))['catch'](handleError(_0x537d3e,null));};exports[_0xdfa0('0x22')]=function(_0x2d893e,_0x2eefc0){if(_0x2d893e[_0xdfa0('0x33')]['id']){delete _0x2d893e['body']['id'];}return db['License'][_0xdfa0('0x34')]({'where':{'id':_0x2d893e[_0xdfa0('0x35')]['id']}})[_0xdfa0('0x32')](handleEntityNotFound(_0x2eefc0,null))['then'](function(_0x35b5b1){var _0x1dc61d=_0x35b5b1['get']({'plain':!![]});return utilLicense['checkLicense'](_0x1dc61d,_0x2d893e[_0xdfa0('0x33')][_0xdfa0('0x36')]);})['then'](function(_0x1914e9){if(!_0x1914e9[_0xdfa0('0x37')]){return saveUpdates(_0x2d893e[_0xdfa0('0x33')],null);}return _0x1914e9;})[_0xdfa0('0x32')](respondWithResult(_0x2eefc0,null))['catch'](handleError(_0x2eefc0,null));};exports['downloadLogFile']=function(_0x5ca667,_0x1d0e26){var _0x987507=_0xdfa0('0x38');var _0x2eadd5=path[_0xdfa0('0x39')]('/var',_0xdfa0('0x3a'),_0xdfa0('0x3b'),_0x987507);_0x1d0e26[_0xdfa0('0x3c')]('Content-disposition',_0xdfa0('0x3d')+_0x987507);_0x1d0e26[_0xdfa0('0x3e')](_0xdfa0('0x3f'),'text/plain');_0x1d0e26['download'](_0x2eadd5);};
\ No newline at end of file
index 4d37a6a..9e74012 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8f9=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','define','License','license'];(function(_0xe94aa4,_0x19d1f2){var _0x58adc1=function(_0x28631e){while(--_0x28631e){_0xe94aa4['push'](_0xe94aa4['shift']());}};_0x58adc1(++_0x19d1f2);}(_0xd8f9,0x82));var _0x9d8f=function(_0x172f88,_0x44962c){_0x172f88=_0x172f88-0x0;var _0xd44986=_0xd8f9[_0x172f88];return _0xd44986;};'use strict';var _=require(_0x9d8f('0x0'));var util=require(_0x9d8f('0x1'));var logger=require('../../config/logger')(_0x9d8f('0x2'));var moment=require(_0x9d8f('0x3'));var BPromise=require(_0x9d8f('0x4'));var rp=require(_0x9d8f('0x5'));var fs=require('fs');var path=require(_0x9d8f('0x6'));var rimraf=require(_0x9d8f('0x7'));var config=require(_0x9d8f('0x8'));var attributes=require(_0x9d8f('0x9'));module['exports']=function(_0x49197a,_0x128555){return _0x49197a[_0x9d8f('0xa')](_0x9d8f('0xb'),attributes,{'tableName':_0x9d8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5a5=['define','license','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x2dc466,_0x66ee18){var _0x2f813d=function(_0x5cef7f){while(--_0x5cef7f){_0x2dc466['push'](_0x2dc466['shift']());}};_0x2f813d(++_0x66ee18);}(_0xe5a5,0x160));var _0x5e5a=function(_0x1a0a05,_0x1c5480){_0x1a0a05=_0x1a0a05-0x0;var _0x474423=_0xe5a5[_0x1a0a05];return _0x474423;};'use strict';var _=require(_0x5e5a('0x0'));var util=require(_0x5e5a('0x1'));var logger=require(_0x5e5a('0x2'))(_0x5e5a('0x3'));var moment=require(_0x5e5a('0x4'));var BPromise=require(_0x5e5a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e5a('0x6'));var rimraf=require('rimraf');var config=require(_0x5e5a('0x7'));var attributes=require('./license.attributes');module['exports']=function(_0xab8e0,_0x11b040){return _0xab8e0[_0x5e5a('0x8')]('License',attributes,{'tableName':_0x5e5a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8025f0b..e7c047d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c24=['then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4d603f,_0xbe5814){var _0x3a279a=function(_0x4d4d68){while(--_0x4d4d68){_0x4d603f['push'](_0x4d603f['shift']());}};_0x3a279a(++_0xbe5814);}(_0x4c24,0x1c1));var _0x44c2=function(_0x57e378,_0x37d835){_0x57e378=_0x57e378-0x0;var _0x22b621=_0x4c24[_0x57e378];return _0x22b621;};'use strict';var _=require(_0x44c2('0x0'));var util=require(_0x44c2('0x1'));var moment=require('moment');var BPromise=require(_0x44c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44c2('0x3'));var db=require(_0x44c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x44c2('0x5'))(_0x44c2('0x6'));var config=require(_0x44c2('0x7'));var jayson=require(_0x44c2('0x8'));var client=jayson[_0x44c2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b0ed4,_0x304337,_0x6942f8){return new BPromise(function(_0x365cb2,_0x2bc634){return client[_0x44c2('0xa')](_0x4b0ed4,_0x6942f8)[_0x44c2('0xb')](function(_0x2716ef){logger[_0x44c2('0xc')]('License,\x20%s,\x20%s',_0x304337,_0x44c2('0xd'));logger[_0x44c2('0xe')](_0x44c2('0xf'),_0x304337,_0x44c2('0xd'),JSON[_0x44c2('0x10')](_0x2716ef));if(_0x2716ef[_0x44c2('0x11')]){if(_0x2716ef['error'][_0x44c2('0x12')]===0x1f4){logger[_0x44c2('0x11')](_0x44c2('0x13'),_0x304337,_0x2716ef[_0x44c2('0x11')][_0x44c2('0x14')]);return _0x2bc634(_0x2716ef[_0x44c2('0x11')][_0x44c2('0x14')]);}logger[_0x44c2('0x11')](_0x44c2('0x13'),_0x304337,_0x2716ef[_0x44c2('0x11')][_0x44c2('0x14')]);return _0x365cb2(_0x2716ef[_0x44c2('0x11')]['message']);}else{logger[_0x44c2('0xc')](_0x44c2('0x13'),_0x304337,_0x44c2('0xd'));_0x365cb2(_0x2716ef[_0x44c2('0x15')]['message']);}})[_0x44c2('0x16')](function(_0x54c5f0){logger[_0x44c2('0x11')](_0x44c2('0x13'),_0x304337,_0x54c5f0);_0x2bc634(_0x54c5f0);});});}
\ No newline at end of file
+var _0xda0f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x1afcc2,_0x196a28){var _0x59b453=function(_0x48ffb1){while(--_0x48ffb1){_0x1afcc2['push'](_0x1afcc2['shift']());}};_0x59b453(++_0x196a28);}(_0xda0f,0x1ef));var _0xfda0=function(_0x1e2a97,_0x156023){_0x1e2a97=_0x1e2a97-0x0;var _0xd6dcf0=_0xda0f[_0x1e2a97];return _0xd6dcf0;};'use strict';var _=require(_0xfda0('0x0'));var util=require(_0xfda0('0x1'));var moment=require(_0xfda0('0x2'));var BPromise=require('bluebird');var rs=require(_0xfda0('0x3'));var fs=require('fs');var Redis=require(_0xfda0('0x4'));var db=require(_0xfda0('0x5'))['db'];var utils=require(_0xfda0('0x6'));var logger=require(_0xfda0('0x7'))(_0xfda0('0x8'));var config=require('../../config/environment');var jayson=require(_0xfda0('0x9'));var client=jayson[_0xfda0('0xa')][_0xfda0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x317494,_0x5863d3,_0x31edce){return new BPromise(function(_0x3524c5,_0x3f5fd8){return client[_0xfda0('0xc')](_0x317494,_0x31edce)['then'](function(_0x4d2616){logger[_0xfda0('0xd')](_0xfda0('0xe'),_0x5863d3,_0xfda0('0xf'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x5863d3,_0xfda0('0xf'),JSON[_0xfda0('0x10')](_0x4d2616));if(_0x4d2616[_0xfda0('0x11')]){if(_0x4d2616[_0xfda0('0x11')]['code']===0x1f4){logger[_0xfda0('0x11')](_0xfda0('0xe'),_0x5863d3,_0x4d2616[_0xfda0('0x11')][_0xfda0('0x12')]);return _0x3f5fd8(_0x4d2616[_0xfda0('0x11')][_0xfda0('0x12')]);}logger['error'](_0xfda0('0xe'),_0x5863d3,_0x4d2616['error'][_0xfda0('0x12')]);return _0x3524c5(_0x4d2616[_0xfda0('0x11')][_0xfda0('0x12')]);}else{logger[_0xfda0('0xd')](_0xfda0('0xe'),_0x5863d3,'request\x20sent');_0x3524c5(_0x4d2616['result'][_0xfda0('0x12')]);}})[_0xfda0('0x13')](function(_0x62478a){logger['error'](_0xfda0('0xe'),_0x5863d3,_0x62478a);_0x3f5fd8(_0x62478a);});});}
\ No newline at end of file
index e7fac38..440d45e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6e9=['describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','addDisposition','post','addAnswer','addImap','addSmtp','/:id/interactions','/:id/applications','addApplications','/:id/send','send','/:id/users','addAgents','removeDispositions','delete','removeAnswers','removeImap','/:id/out_servers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./mailAccount.controller','get','index','/describe','isAuthenticated'];(function(_0x55c66a,_0x21d453){var _0x415442=function(_0x1e69e8){while(--_0x1e69e8){_0x55c66a['push'](_0x55c66a['shift']());}};_0x415442(++_0x21d453);}(_0xf6e9,0x84));var _0x9f6e=function(_0xa25a80,_0x41387f){_0xa25a80=_0xa25a80-0x0;var _0x313ef9=_0xf6e9[_0xa25a80];return _0x313ef9;};'use strict';var multer=require(_0x9f6e('0x0'));var util=require(_0x9f6e('0x1'));var path=require(_0x9f6e('0x2'));var timeout=require(_0x9f6e('0x3'));var express=require('express');var router=express[_0x9f6e('0x4')]();var fs_extra=require(_0x9f6e('0x5'));var auth=require(_0x9f6e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f6e('0x7'));router[_0x9f6e('0x8')]('/',auth['isAuthenticated'](),controller[_0x9f6e('0x9')]);router[_0x9f6e('0x8')](_0x9f6e('0xa'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0xc')]);router[_0x9f6e('0x8')](_0x9f6e('0xd'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0xe')]);router['get'](_0x9f6e('0xf'),auth[_0x9f6e('0xb')](),controller['getDispositions']);router['get'](_0x9f6e('0x10'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x11')]);router[_0x9f6e('0x8')](_0x9f6e('0x12'),auth[_0x9f6e('0xb')](),controller['getImap']);router[_0x9f6e('0x8')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x9f6e('0x13')]);router[_0x9f6e('0x8')]('/:id/interactions',auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x14')]);router[_0x9f6e('0x8')]('/:id/applications',auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x15')]);router[_0x9f6e('0x8')](_0x9f6e('0x16'),auth['isAuthenticated'](),controller[_0x9f6e('0x17')]);router[_0x9f6e('0x8')](_0x9f6e('0x18'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x19')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x9f6e('0x1a')]);router['post'](_0x9f6e('0xf'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x1b')]);router[_0x9f6e('0x1c')](_0x9f6e('0x10'),auth['isAuthenticated'](),controller[_0x9f6e('0x1d')]);router[_0x9f6e('0x1c')]('/',auth[_0x9f6e('0xb')](),controller['create']);router[_0x9f6e('0x1c')](_0x9f6e('0x12'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x1e')]);router[_0x9f6e('0x1c')]('/:id/out_servers',auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x1f')]);router['post'](_0x9f6e('0x20'),auth[_0x9f6e('0xb')](),controller['addInteraction']);router[_0x9f6e('0x1c')](_0x9f6e('0x21'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x22')]);router[_0x9f6e('0x1c')](_0x9f6e('0x23'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x24')]);router[_0x9f6e('0x1c')](_0x9f6e('0x25'),auth['isAuthenticated'](),controller[_0x9f6e('0x26')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x9f6e('0xf'),auth['isAuthenticated'](),controller[_0x9f6e('0x27')]);router[_0x9f6e('0x28')](_0x9f6e('0x10'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x29')]);router[_0x9f6e('0x28')](_0x9f6e('0x12'),auth['isAuthenticated'](),controller[_0x9f6e('0x2a')]);router[_0x9f6e('0x28')](_0x9f6e('0x2b'),auth[_0x9f6e('0xb')](),controller[_0x9f6e('0x2c')]);router[_0x9f6e('0x28')](_0x9f6e('0xd'),auth['isAuthenticated'](),controller[_0x9f6e('0x2d')]);router['delete'](_0x9f6e('0x25'),auth['isAuthenticated'](),controller[_0x9f6e('0x2e')]);module[_0x9f6e('0x2f')]=router;
\ No newline at end of file
+var _0x2358=['put','update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','addDisposition','post','addAnswer','create','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2358,0x1c1));var _0x8235=function(_0x4a0c82,_0x25323c){_0x4a0c82=_0x4a0c82-0x0;var _0x5aae13=_0x2358[_0x4a0c82];return _0x5aae13;};'use strict';var multer=require(_0x8235('0x0'));var util=require('util');var path=require(_0x8235('0x1'));var timeout=require(_0x8235('0x2'));var express=require(_0x8235('0x3'));var router=express[_0x8235('0x4')]();var fs_extra=require(_0x8235('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8235('0x6'));router[_0x8235('0x7')]('/',auth['isAuthenticated'](),controller[_0x8235('0x8')]);router[_0x8235('0x7')](_0x8235('0x9'),auth[_0x8235('0xa')](),controller[_0x8235('0xb')]);router[_0x8235('0x7')](_0x8235('0xc'),auth['isAuthenticated'](),controller[_0x8235('0xd')]);router[_0x8235('0x7')]('/:id/dispositions',auth[_0x8235('0xa')](),controller['getDispositions']);router[_0x8235('0x7')](_0x8235('0xe'),auth[_0x8235('0xa')](),controller[_0x8235('0xf')]);router[_0x8235('0x7')](_0x8235('0x10'),auth[_0x8235('0xa')](),controller['getImap']);router[_0x8235('0x7')](_0x8235('0x11'),auth[_0x8235('0xa')](),controller['getSmtp']);router[_0x8235('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x8235('0x12')]);router[_0x8235('0x7')](_0x8235('0x13'),auth[_0x8235('0xa')](),controller[_0x8235('0x14')]);router[_0x8235('0x7')](_0x8235('0x15'),auth['isAuthenticated'](),controller[_0x8235('0x16')]);router['get']('/:id/verify',auth['isAuthenticated'](),controller['verifySmtp']);router[_0x8235('0x7')](_0x8235('0x17'),auth[_0x8235('0xa')](),controller[_0x8235('0x18')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8235('0x19')]);router[_0x8235('0x1a')](_0x8235('0xe'),auth[_0x8235('0xa')](),controller[_0x8235('0x1b')]);router[_0x8235('0x1a')]('/',auth['isAuthenticated'](),controller[_0x8235('0x1c')]);router[_0x8235('0x1a')]('/:id/in_servers',auth[_0x8235('0xa')](),controller['addImap']);router[_0x8235('0x1a')]('/:id/out_servers',auth[_0x8235('0xa')](),controller[_0x8235('0x1d')]);router[_0x8235('0x1a')](_0x8235('0x1e'),auth['isAuthenticated'](),controller[_0x8235('0x1f')]);router[_0x8235('0x1a')]('/:id/applications',auth[_0x8235('0xa')](),controller[_0x8235('0x20')]);router['post'](_0x8235('0x21'),auth[_0x8235('0xa')](),controller[_0x8235('0x22')]);router[_0x8235('0x1a')](_0x8235('0x17'),auth[_0x8235('0xa')](),controller['addAgents']);router[_0x8235('0x23')](_0x8235('0xc'),auth['isAuthenticated'](),controller[_0x8235('0x24')]);router[_0x8235('0x25')]('/:id/dispositions',auth[_0x8235('0xa')](),controller['removeDispositions']);router[_0x8235('0x25')](_0x8235('0xe'),auth[_0x8235('0xa')](),controller[_0x8235('0x26')]);router[_0x8235('0x25')](_0x8235('0x10'),auth[_0x8235('0xa')](),controller[_0x8235('0x27')]);router['delete'](_0x8235('0x11'),auth[_0x8235('0xa')](),controller[_0x8235('0x28')]);router[_0x8235('0x25')]('/:id',auth['isAuthenticated'](),controller[_0x8235('0x29')]);router[_0x8235('0x25')](_0x8235('0x17'),auth['isAuthenticated'](),controller[_0x8235('0x2a')]);module[_0x8235('0x2b')]=router;
\ No newline at end of file
index 17eb299..db62559 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bc6=['gmail','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM'];(function(_0x39a74f,_0x2168a4){var _0x2c7525=function(_0x3f84ba){while(--_0x3f84ba){_0x39a74f['push'](_0x39a74f['shift']());}};_0x2c7525(++_0x2168a4);}(_0x1bc6,0x191));var _0x61bc=function(_0x4e4748,_0x52d3d8){_0x4e4748=_0x4e4748-0x0;var _0x15d39a=_0x1bc6[_0x4e4748];return _0x15d39a;};'use strict';var Sequelize=require(_0x61bc('0x0'));module[_0x61bc('0x1')]={'description':{'type':Sequelize[_0x61bc('0x2')]},'name':{'type':Sequelize[_0x61bc('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x61bc('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x61bc('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x61bc('0x4')]},'markAsUnread':{'type':Sequelize[_0x61bc('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x61bc('0x2')],'allowNull':![],'defaultValue':_0x61bc('0x5')},'fontSize':{'type':Sequelize[_0x61bc('0x6')](0x2)[_0x61bc('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x61bc('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x61bc('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x61bc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x61bc('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x61bc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x61bc('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x61bc('0x3')],'defaultValue':![],'comment':_0x61bc('0x8'),'set':function(_0x57bb07){if(!_0x57bb07)this[_0x61bc('0x9')](_0x61bc('0xa'),null);this[_0x61bc('0x9')](_0x61bc('0xb'),_0x57bb07);}},'provider':{'type':Sequelize[_0x61bc('0xc')](_0x61bc('0xd'),'hotmail','yahoo',_0x61bc('0xe')),'defaultValue':null,'get':function(){if(!this[_0x61bc('0xf')](_0x61bc('0x10')))return _0x61bc('0x11');return this['getDataValue'](_0x61bc('0x10'));},'set':function(_0x2f68e9){if(_0x2f68e9===_0x61bc('0x11'))_0x2f68e9=null;return this[_0x61bc('0x9')](_0x61bc('0x10'),_0x2f68e9);}}};
\ No newline at end of file
+var _0xe0e9=['sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','hotmail','yahoo','outlook365','getDataValue','provider','custom'];(function(_0x12e75a,_0x269578){var _0x11650d=function(_0x2d89dc){while(--_0x2d89dc){_0x12e75a['push'](_0x12e75a['shift']());}};_0x11650d(++_0x269578);}(_0xe0e9,0xcc));var _0x9e0e=function(_0x3aa91b,_0xd53465){_0x3aa91b=_0x3aa91b-0x0;var _0x4ae2cd=_0xe0e9[_0x3aa91b];return _0x4ae2cd;};'use strict';var Sequelize=require(_0x9e0e('0x0'));module[_0x9e0e('0x1')]={'description':{'type':Sequelize[_0x9e0e('0x2')]},'name':{'type':Sequelize[_0x9e0e('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9e0e('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9e0e('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x9e0e('0x4')]},'markAsUnread':{'type':Sequelize[_0x9e0e('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9e0e('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x9e0e('0x5')](0x2)[_0x9e0e('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9e0e('0x7');}},'notificationSound':{'type':Sequelize[_0x9e0e('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9e0e('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9e0e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9e0e('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9e0e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9e0e('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9e0e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e0e('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x9e0e('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x9e0e('0x3')],'defaultValue':![],'comment':_0x9e0e('0x9'),'set':function(_0x5c4a40){if(!_0x5c4a40)this[_0x9e0e('0xa')]('mandatoryDispositionPauseId',null);this[_0x9e0e('0xa')]('mandatoryDisposition',_0x5c4a40);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x9e0e('0xb'),_0x9e0e('0xc'),_0x9e0e('0xd')),'defaultValue':null,'get':function(){if(!this[_0x9e0e('0xe')](_0x9e0e('0xf')))return _0x9e0e('0x10');return this['getDataValue'](_0x9e0e('0xf'));},'set':function(_0x1ea0bf){if(_0x1ea0bf===_0x9e0e('0x10'))_0x1ea0bf=null;return this[_0x9e0e('0xa')](_0x9e0e('0xf'),_0x1ea0bf);}}};
\ No newline at end of file
index 6e4e3ed..6e8b6b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee23=['addInteraction','MailInteraction','omit','CmContact','Contact','User','fullname','internal','Tag','color','tag','addApplications','sequelize','Transaction','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','service','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','CloudProvider','OAuth2','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','emit','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','../../components/parsers/qs','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','Imap','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','includeAll','findAll','rows','show','MailServerIn','MailServerOut','include','find','body','CloudProviderId','modernAuthentication','describe','addDisposition','params','MailAccountId','Disposition','create','findOne','options','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','custom','provider','email','ListId','isNil','active','description','user','username','pass','password','host','port','authentication','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addImap','setImap','setSmtp'];(function(_0x4cabaf,_0x3b8fdd){var _0x15ca15=function(_0x58ce3e){while(--_0x58ce3e){_0x4cabaf['push'](_0x4cabaf['shift']());}};_0x15ca15(++_0x3b8fdd);}(_0xee23,0x1a0));var _0x3ee2=function(_0x5eeb37,_0x208c8e){_0x5eeb37=_0x5eeb37-0x0;var _0x2e8cd7=_0xee23[_0x5eeb37];return _0x2e8cd7;};'use strict';var moment=require(_0x3ee2('0x0'));var BPromise=require('bluebird');var util=require(_0x3ee2('0x1'));var path=require(_0x3ee2('0x2'));var _=require(_0x3ee2('0x3'));var juice=require(_0x3ee2('0x4'));var Redis=require('ioredis');var qs=require(_0x3ee2('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x3ee2('0x6'));var db=require('../../mysqldb')['db'];config[_0x3ee2('0x7')]=_[_0x3ee2('0x8')](config[_0x3ee2('0x7')],{'host':_0x3ee2('0x9'),'port':0x18eb});var socket=require(_0x3ee2('0xa'))(new Redis(config[_0x3ee2('0x7')]));require(_0x3ee2('0xb'))[_0x3ee2('0xc')](socket);var jayson=require(_0x3ee2('0xd'));var client=jayson['client'][_0x3ee2('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x5b7a1b,_0x49b483,_0x165e43,_0xb4879f){return new BPromise(function(_0x2bbd94,_0x8b8da6){var _0xfedd5d=_0xb4879f||client;return _0xfedd5d[_0x3ee2('0xf')](_0x5b7a1b,_0x165e43)[_0x3ee2('0x10')](function(_0x184376){logger[_0x3ee2('0x11')](_0x3ee2('0x12'),_0x49b483,_0x3ee2('0x13'));logger[_0x3ee2('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x49b483,_0x3ee2('0x13'),JSON['stringify'](_0x184376));if(_0x184376['error']){if(_0x184376[_0x3ee2('0x15')][_0x3ee2('0x16')]===0x1f4){logger[_0x3ee2('0x15')](_0x3ee2('0x12'),_0x49b483,_0x184376[_0x3ee2('0x15')]['message']);return _0x8b8da6(_0x184376[_0x3ee2('0x15')][_0x3ee2('0x17')]);}logger[_0x3ee2('0x15')](_0x3ee2('0x12'),_0x49b483,_0x184376[_0x3ee2('0x15')][_0x3ee2('0x17')]);return _0x2bbd94(_0x184376['error'][_0x3ee2('0x17')]);}else{logger[_0x3ee2('0x11')](_0x3ee2('0x12'),_0x49b483,_0x3ee2('0x13'));_0x2bbd94(_0x184376[_0x3ee2('0x18')][_0x3ee2('0x17')]);}})[_0x3ee2('0x19')](function(_0x29f9e1){logger[_0x3ee2('0x15')](_0x3ee2('0x12'),_0x49b483,_0x29f9e1);_0x8b8da6(_0x29f9e1);});});}function respondWithStatusCode(_0x5647cb,_0x51f860){_0x51f860=_0x51f860||0xcc;return function(_0x363aad){if(_0x363aad){return _0x5647cb[_0x3ee2('0x1a')](_0x51f860);}return _0x5647cb[_0x3ee2('0x1b')](_0x51f860)[_0x3ee2('0x1c')]();};}function respondWithResult(_0x3b4ffd,_0x1af600){_0x1af600=_0x1af600||0xc8;return function(_0x15ee24){if(_0x15ee24){return _0x3b4ffd[_0x3ee2('0x1b')](_0x1af600)[_0x3ee2('0x1d')](_0x15ee24);}};}function respondWithFilteredResult(_0x559650,_0x5c3d0e){return function(_0x2edace){if(_0x2edace){var _0x5987a7=typeof _0x5c3d0e[_0x3ee2('0x1e')]==='undefined'&&typeof _0x5c3d0e[_0x3ee2('0x1f')]===_0x3ee2('0x20');var _0x1b5ad4=_0x2edace[_0x3ee2('0x21')];var _0x42ff45=_0x5987a7?0x0:_0x5c3d0e[_0x3ee2('0x1e')];var _0x758b20=_0x5987a7?_0x2edace[_0x3ee2('0x21')]:_0x5c3d0e[_0x3ee2('0x1e')]+_0x5c3d0e[_0x3ee2('0x1f')];var _0x2edc7e;if(_0x758b20>=_0x1b5ad4){_0x758b20=_0x1b5ad4;_0x2edc7e=0xc8;}else{_0x2edc7e=0xce;}_0x559650[_0x3ee2('0x1b')](_0x2edc7e);return _0x559650['set'](_0x3ee2('0x22'),_0x42ff45+'-'+_0x758b20+'/'+_0x1b5ad4)['json'](_0x2edace);}return null;};}function saveUpdates(_0x317236){return function(_0xefbb12){if(_0xefbb12){return _0xefbb12[_0x3ee2('0x23')](_0x317236)[_0x3ee2('0x10')](function(_0x45675e){return _0x45675e;});}return null;};}function removeEntity(_0x3e5113){return function(_0x18f1ee){if(_0x18f1ee){return _0x18f1ee[_0x3ee2('0x24')]()[_0x3ee2('0x10')](function(){var _0x4e7cf9=_0x18f1ee[_0x3ee2('0x25')]({'plain':!![]});var _0x1925bc=_0x3ee2('0x26');return db[_0x3ee2('0x27')][_0x3ee2('0x24')]({'where':{'type':_0x1925bc,'resourceId':_0x4e7cf9['id']}})['then'](function(){return _0x18f1ee;});})[_0x3ee2('0x10')](function(){_0x3e5113[_0x3ee2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bcf32){return function(_0x49a85d){if(!_0x49a85d){_0x1bcf32['sendStatus'](0x194);}return _0x49a85d;};}function handleError(_0x4d5761,_0x388c53){_0x388c53=_0x388c53||0x1f4;return function(_0x4735d3){logger[_0x3ee2('0x15')](_0x4735d3[_0x3ee2('0x28')]);if(_0x4735d3[_0x3ee2('0x29')]){delete _0x4735d3[_0x3ee2('0x29')];}_0x4d5761[_0x3ee2('0x1b')](_0x388c53)[_0x3ee2('0x2a')](_0x4735d3);};}exports['index']=function(_0x73d673,_0x2d1363){var _0x248933={'include':[{'model':db['MailServerIn'],'as':_0x3ee2('0x2b')},{'model':db['MailServerOut'],'as':_0x3ee2('0x2c')},{'model':db[_0x3ee2('0x2d')],'as':_0x3ee2('0x2e')}]},_0x110189={},_0x1f8f19={'count':0x0,'rows':[]};var _0x534fec=_['map'](db[_0x3ee2('0x2f')][_0x3ee2('0x30')],function(_0x328ebb){return{'name':_0x328ebb[_0x3ee2('0x31')],'type':_0x328ebb[_0x3ee2('0x32')][_0x3ee2('0x33')]};});_0x110189['model']=_['map'](_0x534fec,_0x3ee2('0x29'));_0x110189[_0x3ee2('0x34')]=_[_0x3ee2('0x35')](_0x73d673['query']);_0x110189[_0x3ee2('0x36')]=_[_0x3ee2('0x37')](_0x110189[_0x3ee2('0x38')],_0x110189[_0x3ee2('0x34')]);_0x248933['attributes']=_[_0x3ee2('0x37')](_0x110189['model'],qs['fields'](_0x73d673['query'][_0x3ee2('0x39')]));_0x248933['attributes']=_0x248933[_0x3ee2('0x3a')][_0x3ee2('0x3b')]?_0x248933[_0x3ee2('0x3a')]:_0x110189['model'];if(!_0x73d673[_0x3ee2('0x34')][_0x3ee2('0x3c')](_0x3ee2('0x3d'))){_0x248933[_0x3ee2('0x1f')]=qs[_0x3ee2('0x1f')](_0x73d673[_0x3ee2('0x34')][_0x3ee2('0x1f')]);_0x248933['offset']=qs[_0x3ee2('0x1e')](_0x73d673[_0x3ee2('0x34')][_0x3ee2('0x1e')]);}_0x248933[_0x3ee2('0x3e')]=qs[_0x3ee2('0x3f')](_0x73d673[_0x3ee2('0x34')][_0x3ee2('0x3f')]);_0x248933['where']=qs[_0x3ee2('0x36')](_[_0x3ee2('0x40')](_0x73d673['query'],_0x110189['filters']),_0x534fec);if(_0x73d673['query'][_0x3ee2('0x41')]){_0x248933[_0x3ee2('0x42')]=_[_0x3ee2('0x43')](_0x248933['where'],{'$or':_[_0x3ee2('0x44')](_0x534fec,function(_0x3e3390){if(_0x3e3390[_0x3ee2('0x32')]!==_0x3ee2('0x45')){var _0x505af1={};_0x505af1[_0x3e3390[_0x3ee2('0x29')]]={'$like':'%'+_0x73d673[_0x3ee2('0x34')][_0x3ee2('0x41')]+'%'};return _0x505af1;}})});}_0x248933=_['merge']({},_0x248933,_0x73d673['options']);var _0x238c86={'where':_0x248933[_0x3ee2('0x42')]};return db[_0x3ee2('0x2f')][_0x3ee2('0x21')](_0x238c86)['then'](function(_0x390e4e){_0x1f8f19[_0x3ee2('0x21')]=_0x390e4e;if(_0x73d673['query'][_0x3ee2('0x46')]){_0x248933['include']=[{'all':!![]}];}return db[_0x3ee2('0x2f')][_0x3ee2('0x47')](_0x248933);})['then'](function(_0x3beeba){_0x1f8f19[_0x3ee2('0x48')]=_0x3beeba;return _0x1f8f19;})[_0x3ee2('0x10')](respondWithFilteredResult(_0x2d1363,_0x248933))[_0x3ee2('0x19')](handleError(_0x2d1363,null));};exports[_0x3ee2('0x49')]=function(_0x5256c3,_0x28e7cc){var _0x44fc00={'raw':![],'where':{'id':_0x5256c3['params']['id']},'include':[{'model':db[_0x3ee2('0x4a')],'as':'Imap'},{'model':db[_0x3ee2('0x4b')],'as':_0x3ee2('0x2c')},{'model':db[_0x3ee2('0x2d')],'as':_0x3ee2('0x2e')}]},_0x1ee25e={};_0x1ee25e[_0x3ee2('0x38')]=_[_0x3ee2('0x35')](db[_0x3ee2('0x2f')][_0x3ee2('0x30')]);_0x1ee25e['query']=_['keys'](_0x5256c3['query']);_0x1ee25e[_0x3ee2('0x36')]=_[_0x3ee2('0x37')](_0x1ee25e[_0x3ee2('0x38')],_0x1ee25e['query']);_0x44fc00['attributes']=_['intersection'](_0x1ee25e[_0x3ee2('0x38')],qs[_0x3ee2('0x39')](_0x5256c3['query']['fields']));_0x44fc00[_0x3ee2('0x3a')]=_0x44fc00[_0x3ee2('0x3a')][_0x3ee2('0x3b')]?_0x44fc00[_0x3ee2('0x3a')]:_0x1ee25e[_0x3ee2('0x38')];if(_0x5256c3['query']['includeAll']){_0x44fc00[_0x3ee2('0x4c')]=[{'all':!![]}];}_0x44fc00=_[_0x3ee2('0x43')]({},_0x44fc00,_0x5256c3['options']);return db['MailAccount'][_0x3ee2('0x4d')](_0x44fc00)[_0x3ee2('0x10')](handleEntityNotFound(_0x28e7cc,null))['then'](respondWithResult(_0x28e7cc,null))[_0x3ee2('0x19')](handleError(_0x28e7cc,null));};exports[_0x3ee2('0x23')]=function(_0x46e8e8,_0x2820c7){if(_0x46e8e8[_0x3ee2('0x4e')]['id']){delete _0x46e8e8[_0x3ee2('0x4e')]['id'];}if(_0x46e8e8[_0x3ee2('0x4e')]['Imap']){if(!_0x46e8e8[_0x3ee2('0x4e')][_0x3ee2('0x2b')]['modernAuthentication']){_0x46e8e8[_0x3ee2('0x4e')][_0x3ee2('0x2b')][_0x3ee2('0x4f')]=null;}}if(_0x46e8e8[_0x3ee2('0x4e')][_0x3ee2('0x2c')]){if(!_0x46e8e8['body']['Smtp'][_0x3ee2('0x50')]){_0x46e8e8['body'][_0x3ee2('0x2c')][_0x3ee2('0x4f')]=null;}}return db['MailAccount']['find']({'where':{'id':_0x46e8e8['params']['id']},'include':[{'model':db[_0x3ee2('0x4a')],'as':_0x3ee2('0x2b')},{'model':db[_0x3ee2('0x4b')],'as':_0x3ee2('0x2c')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x3ee2('0x10')](handleEntityNotFound(_0x2820c7,null))[_0x3ee2('0x10')](saveUpdates(_0x46e8e8[_0x3ee2('0x4e')],null))[_0x3ee2('0x10')](function(_0x1cbf69){if(_0x1cbf69&&_0x46e8e8[_0x3ee2('0x4e')][_0x3ee2('0x2b')]){return db[_0x3ee2('0x4a')][_0x3ee2('0x23')](_0x46e8e8[_0x3ee2('0x4e')][_0x3ee2('0x2b')],{'where':{'MailAccountId':_0x1cbf69['id']}})[_0x3ee2('0x10')](function(){return _0x1cbf69;});}return _0x1cbf69;})[_0x3ee2('0x10')](function(_0x537740){if(_0x537740&&_0x46e8e8[_0x3ee2('0x4e')][_0x3ee2('0x2c')]){return db[_0x3ee2('0x4b')]['update'](_0x46e8e8['body'][_0x3ee2('0x2c')],{'where':{'MailAccountId':_0x537740['id']}})[_0x3ee2('0x10')](function(){return _0x537740;});}return _0x537740;})[_0x3ee2('0x10')](respondWithResult(_0x2820c7,null))[_0x3ee2('0x19')](handleError(_0x2820c7,null));};exports[_0x3ee2('0x51')]=function(_0x35485d,_0x443128){return db[_0x3ee2('0x2f')][_0x3ee2('0x51')]()[_0x3ee2('0x10')](respondWithResult(_0x443128,null))[_0x3ee2('0x19')](handleError(_0x443128,null));};exports[_0x3ee2('0x52')]=function(_0x586427,_0x32b558){if(_0x586427[_0x3ee2('0x4e')]['id']){delete _0x586427['body']['id'];}return db[_0x3ee2('0x2f')][_0x3ee2('0x4d')]({'where':{'id':_0x586427[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x32b558,null))['then'](function(_0x17a8d2){if(_0x17a8d2){_0x586427[_0x3ee2('0x4e')][_0x3ee2('0x54')]=_0x17a8d2['id'];return db[_0x3ee2('0x55')][_0x3ee2('0x56')](_0x586427[_0x3ee2('0x4e')]);}})[_0x3ee2('0x10')](respondWithResult(_0x32b558,null))[_0x3ee2('0x19')](handleError(_0x32b558,null));};exports['getDispositions']=function(_0xb302df,_0x4a6ef3){var _0x4e4c1d={'raw':![],'where':{}};var _0x4df5e4={};var _0x1e4934={'count':0x0,'rows':[]};return db[_0x3ee2('0x2f')][_0x3ee2('0x57')]({'where':{'id':_0xb302df[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x4a6ef3,null))[_0x3ee2('0x10')](function(_0xfa990a){if(_0xfa990a){_0x4df5e4[_0x3ee2('0x38')]=_[_0x3ee2('0x35')](db[_0x3ee2('0x55')][_0x3ee2('0x30')]);_0x4df5e4[_0x3ee2('0x34')]=_[_0x3ee2('0x35')](_0xb302df[_0x3ee2('0x34')]);_0x4df5e4[_0x3ee2('0x36')]=_[_0x3ee2('0x37')](_0x4df5e4[_0x3ee2('0x38')],_0x4df5e4['query']);_0x4e4c1d[_0x3ee2('0x3a')]=_[_0x3ee2('0x37')](_0x4df5e4[_0x3ee2('0x38')],qs[_0x3ee2('0x39')](_0xb302df[_0x3ee2('0x34')][_0x3ee2('0x39')]));_0x4e4c1d[_0x3ee2('0x3a')]=_0x4e4c1d[_0x3ee2('0x3a')][_0x3ee2('0x3b')]?_0x4e4c1d[_0x3ee2('0x3a')]:_0x4df5e4[_0x3ee2('0x38')];if(!_0xb302df[_0x3ee2('0x34')][_0x3ee2('0x3c')]('nolimit')){_0x4e4c1d[_0x3ee2('0x1f')]=qs[_0x3ee2('0x1f')](_0xb302df[_0x3ee2('0x34')]['limit']);_0x4e4c1d['offset']=qs['offset'](_0xb302df[_0x3ee2('0x34')][_0x3ee2('0x1e')]);}_0x4e4c1d[_0x3ee2('0x3e')]=qs[_0x3ee2('0x3f')](_0xb302df['query']['sort']);_0x4e4c1d[_0x3ee2('0x42')]=qs[_0x3ee2('0x36')](_[_0x3ee2('0x40')](_0xb302df[_0x3ee2('0x34')],_0x4df5e4[_0x3ee2('0x36')]));_0x4e4c1d[_0x3ee2('0x42')]['MailAccountId']=_0xfa990a['id'];if(_0xb302df['query'][_0x3ee2('0x41')]){_0x4e4c1d['where']=_[_0x3ee2('0x43')](_0x4e4c1d[_0x3ee2('0x42')],{'$or':_[_0x3ee2('0x44')](_0x4e4c1d[_0x3ee2('0x3a')],function(_0x208820){var _0x4040ce={};_0x4040ce[_0x208820]={'$like':'%'+_0xb302df[_0x3ee2('0x34')][_0x3ee2('0x41')]+'%'};return _0x4040ce;})});}_0x4e4c1d=_[_0x3ee2('0x43')]({},_0x4e4c1d,_0xb302df[_0x3ee2('0x58')]);return db[_0x3ee2('0x55')][_0x3ee2('0x21')]({'where':_0x4e4c1d[_0x3ee2('0x42')]})[_0x3ee2('0x10')](function(_0x4f7b75){_0x1e4934[_0x3ee2('0x21')]=_0x4f7b75;if(_0xb302df[_0x3ee2('0x34')][_0x3ee2('0x46')]){_0x4e4c1d[_0x3ee2('0x4c')]=[{'all':!![]}];}return db[_0x3ee2('0x55')][_0x3ee2('0x47')](_0x4e4c1d);})[_0x3ee2('0x10')](function(_0x313403){_0x1e4934[_0x3ee2('0x48')]=_0x313403;return _0x1e4934;});}})[_0x3ee2('0x10')](respondWithFilteredResult(_0x4a6ef3,_0x4e4c1d))['catch'](handleError(_0x4a6ef3,null));};exports[_0x3ee2('0x59')]=function(_0x2e9201,_0xe6897e){return db[_0x3ee2('0x2f')][_0x3ee2('0x4d')]({'where':{'id':_0x2e9201[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0xe6897e,null))['then'](function(_0x5c0229){if(_0x5c0229){return _0x5c0229[_0x3ee2('0x59')](_0x2e9201[_0x3ee2('0x34')][_0x3ee2('0x5a')]);}})[_0x3ee2('0x10')](respondWithStatusCode(_0xe6897e,null))[_0x3ee2('0x19')](handleError(_0xe6897e,null));};exports['addAnswer']=function(_0x3ad5cb,_0x4e827d){if(_0x3ad5cb[_0x3ee2('0x4e')]['id']){delete _0x3ad5cb['body']['id'];}return db[_0x3ee2('0x2f')][_0x3ee2('0x4d')]({'where':{'id':_0x3ad5cb[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x4e827d,null))[_0x3ee2('0x10')](function(_0x24a7f8){if(_0x24a7f8){_0x3ad5cb[_0x3ee2('0x4e')][_0x3ee2('0x54')]=_0x24a7f8['id'];return db[_0x3ee2('0x5b')][_0x3ee2('0x56')](_0x3ad5cb[_0x3ee2('0x4e')]);}})[_0x3ee2('0x10')](respondWithResult(_0x4e827d,null))[_0x3ee2('0x19')](handleError(_0x4e827d,null));};exports[_0x3ee2('0x5c')]=function(_0x5da197,_0x3c43a3){var _0x285bab={'raw':![],'where':{}};var _0x35d95e={};var _0x14fc40={'count':0x0,'rows':[]};return db['MailAccount'][_0x3ee2('0x57')]({'where':{'id':_0x5da197[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x3c43a3,null))[_0x3ee2('0x10')](function(_0x5519df){if(_0x5519df){_0x35d95e[_0x3ee2('0x38')]=_['keys'](db[_0x3ee2('0x5b')][_0x3ee2('0x30')]);_0x35d95e[_0x3ee2('0x34')]=_['keys'](_0x5da197['query']);_0x35d95e[_0x3ee2('0x36')]=_[_0x3ee2('0x37')](_0x35d95e[_0x3ee2('0x38')],_0x35d95e[_0x3ee2('0x34')]);_0x285bab[_0x3ee2('0x3a')]=_[_0x3ee2('0x37')](_0x35d95e[_0x3ee2('0x38')],qs[_0x3ee2('0x39')](_0x5da197[_0x3ee2('0x34')][_0x3ee2('0x39')]));_0x285bab['attributes']=_0x285bab[_0x3ee2('0x3a')][_0x3ee2('0x3b')]?_0x285bab[_0x3ee2('0x3a')]:_0x35d95e['model'];if(!_0x5da197[_0x3ee2('0x34')][_0x3ee2('0x3c')](_0x3ee2('0x3d'))){_0x285bab[_0x3ee2('0x1f')]=qs[_0x3ee2('0x1f')](_0x5da197[_0x3ee2('0x34')][_0x3ee2('0x1f')]);_0x285bab[_0x3ee2('0x1e')]=qs['offset'](_0x5da197['query']['offset']);}_0x285bab[_0x3ee2('0x3e')]=qs['sort'](_0x5da197[_0x3ee2('0x34')][_0x3ee2('0x3f')]);_0x285bab[_0x3ee2('0x42')]=qs[_0x3ee2('0x36')](_['pick'](_0x5da197[_0x3ee2('0x34')],_0x35d95e[_0x3ee2('0x36')]));_0x285bab[_0x3ee2('0x42')][_0x3ee2('0x54')]=_0x5519df['id'];if(_0x5da197[_0x3ee2('0x34')][_0x3ee2('0x41')]){_0x285bab['where']=_['merge'](_0x285bab[_0x3ee2('0x42')],{'$or':_['map'](_0x285bab[_0x3ee2('0x3a')],function(_0x5f1fda){var _0x246775={};_0x246775[_0x5f1fda]={'$like':'%'+_0x5da197[_0x3ee2('0x34')][_0x3ee2('0x41')]+'%'};return _0x246775;})});}_0x285bab=_[_0x3ee2('0x43')]({},_0x285bab,_0x5da197[_0x3ee2('0x58')]);return db['CannedAnswer'][_0x3ee2('0x21')]({'where':_0x285bab['where']})[_0x3ee2('0x10')](function(_0x9125a5){_0x14fc40['count']=_0x9125a5;if(_0x5da197['query'][_0x3ee2('0x46')]){_0x285bab['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x3ee2('0x47')](_0x285bab);})[_0x3ee2('0x10')](function(_0x2c68b2){_0x14fc40['rows']=_0x2c68b2;return _0x14fc40;});}})[_0x3ee2('0x10')](respondWithFilteredResult(_0x3c43a3,_0x285bab))[_0x3ee2('0x19')](handleError(_0x3c43a3,null));};exports[_0x3ee2('0x5d')]=function(_0x2828bb,_0x14bff6){return db[_0x3ee2('0x2f')][_0x3ee2('0x4d')]({'where':{'id':_0x2828bb[_0x3ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x14bff6,null))[_0x3ee2('0x10')](function(_0x4d6740){if(_0x4d6740){return _0x4d6740[_0x3ee2('0x5d')](_0x2828bb['query'][_0x3ee2('0x5a')]);}})['then'](respondWithStatusCode(_0x14bff6,null))[_0x3ee2('0x19')](handleError(_0x14bff6,null));};exports['create']=function(_0x318386,_0xb4c69d){var _0x9efc39={'name':_0x318386['body'][_0x3ee2('0x29')],'key':_0x318386[_0x3ee2('0x4e')]['key'],'provider':_0x318386[_0x3ee2('0x4e')]['provider']===_0x3ee2('0x5e')?null:_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x5f')],'email':_0x318386['body'][_0x3ee2('0x60')],'ListId':_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x61')],'active':!_[_0x3ee2('0x62')](_0x318386['body'][_0x3ee2('0x63')])?_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x63')]:!![],'description':_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x64')]||null,'Imap':{},'Smtp':{}};if(_0x9efc39[_0x3ee2('0x5f')]){_0x9efc39['Imap'][_0x3ee2('0x65')]=_0x9efc39[_0x3ee2('0x2c')][_0x3ee2('0x65')]=_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x66')];_0x9efc39[_0x3ee2('0x2b')]['password']=_0x9efc39['Smtp'][_0x3ee2('0x67')]=_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x68')];if(_0x318386[_0x3ee2('0x4e')]['modernAuthentication']){_0x9efc39[_0x3ee2('0x2b')][_0x3ee2('0x50')]=_0x9efc39[_0x3ee2('0x2c')][_0x3ee2('0x50')]=!![];_0x9efc39[_0x3ee2('0x2b')]['CloudProviderId']=_0x9efc39[_0x3ee2('0x2c')]['CloudProviderId']=_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x4f')];_0x9efc39[_0x3ee2('0x2b')][_0x3ee2('0x68')]=_0x9efc39[_0x3ee2('0x2c')][_0x3ee2('0x67')]=null;}else{_0x9efc39[_0x3ee2('0x2b')]['CloudProviderId']=_0x9efc39[_0x3ee2('0x2c')][_0x3ee2('0x4f')]=null;}_0x9efc39[_0x3ee2('0x2b')]['service']=_0x9efc39[_0x3ee2('0x2c')]['service']=null;_0x9efc39[_0x3ee2('0x2b')][_0x3ee2('0x69')]=_0x9efc39[_0x3ee2('0x2c')]['host']=null;_0x9efc39[_0x3ee2('0x2b')][_0x3ee2('0x6a')]=_0x9efc39[_0x3ee2('0x2c')][_0x3ee2('0x6a')]=null;}else{if(_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x6b')]){_0x9efc39[_0x3ee2('0x2b')]['user']=_0x9efc39[_0x3ee2('0x2c')][_0x3ee2('0x65')]=_0x318386['body'][_0x3ee2('0x66')];_0x9efc39[_0x3ee2('0x2b')][_0x3ee2('0x68')]=_0x9efc39[_0x3ee2('0x2c')][_0x3ee2('0x67')]=_0x318386[_0x3ee2('0x4e')]['password'];}else{_0x9efc39['Imap'][_0x3ee2('0x6b')]=_0x9efc39[_0x3ee2('0x2c')]['authentication']=![];_0x9efc39[_0x3ee2('0x2b')][_0x3ee2('0x65')]=_0x9efc39[_0x3ee2('0x2c')]['user']=null;_0x9efc39['Imap'][_0x3ee2('0x68')]=_0x9efc39[_0x3ee2('0x2c')][_0x3ee2('0x67')]=null;}_0x9efc39['Imap'][_0x3ee2('0x69')]=_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x2b')][_0x3ee2('0x69')];_0x9efc39[_0x3ee2('0x2b')][_0x3ee2('0x6a')]=_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x2b')][_0x3ee2('0x6a')];_0x9efc39[_0x3ee2('0x2c')]['host']=_0x318386[_0x3ee2('0x4e')][_0x3ee2('0x2c')]['host'];_0x9efc39[_0x3ee2('0x2c')]['port']=_0x318386[_0x3ee2('0x4e')]['Smtp'][_0x3ee2('0x6a')];}return db[_0x3ee2('0x2f')][_0x3ee2('0x56')](_0x9efc39,{'include':[{'model':db['MailServerOut'],'as':_0x3ee2('0x2c')},{'model':db['MailServerIn'],'as':_0x3ee2('0x2b')}]})['then'](function(_0x5a053a){var _0x5c6a74=_0x318386[_0x3ee2('0x65')]['get']({'plain':!![]});if(!_0x5c6a74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c6a74[_0x3ee2('0x6c')]==='user'){var _0x5a38ed=_0x5a053a['get']({'plain':!![]});return db[_0x3ee2('0x6d')][_0x3ee2('0x4d')]({'where':{'name':_0x3ee2('0x26'),'userProfileId':_0x5c6a74[_0x3ee2('0x6e')]},'raw':!![]})[_0x3ee2('0x10')](function(_0x9cdadc){if(_0x9cdadc&&_0x9cdadc['autoAssociation']===0x0){return db['UserProfileResource'][_0x3ee2('0x56')]({'name':_0x5a38ed[_0x3ee2('0x29')],'resourceId':_0x5a38ed['id'],'type':_0x9cdadc[_0x3ee2('0x29')],'sectionId':_0x9cdadc['id']},{})[_0x3ee2('0x10')](function(){return _0x5a053a;});}else{return _0x5a053a;}})[_0x3ee2('0x19')](function(_0x2bc817){logger[_0x3ee2('0x15')](_0x3ee2('0x6f'),_0x2bc817);throw _0x2bc817;});}return _0x5a053a;})[_0x3ee2('0x10')](respondWithResult(_0xb4c69d,0xc9))['catch'](handleError(_0xb4c69d,null));};exports['getImap']=function(_0x13d8e0,_0x2d7ff5){return db['MailAccount']['findOne']({'where':{'id':_0x13d8e0[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x2d7ff5,null))[_0x3ee2('0x10')](function(_0x31451f){if(_0x31451f){return _0x31451f['getImap']();}return null;})[_0x3ee2('0x10')](respondWithResult(_0x2d7ff5,null))[_0x3ee2('0x19')](handleError(_0x2d7ff5,null));};exports[_0x3ee2('0x70')]=function(_0xc33cd5,_0x24771a){if(_0xc33cd5[_0x3ee2('0x4e')]['id']){delete _0xc33cd5[_0x3ee2('0x4e')]['id'];}return db[_0x3ee2('0x2f')][_0x3ee2('0x4d')]({'where':{'id':_0xc33cd5[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x24771a,null))[_0x3ee2('0x10')](function(_0x2d801f){if(_0x2d801f){_0xc33cd5[_0x3ee2('0x4e')][_0x3ee2('0x54')]=_0x2d801f['id'];return db['MailServerIn'][_0x3ee2('0x56')](_0xc33cd5[_0x3ee2('0x4e')]);}})['then'](respondWithResult(_0x24771a,null))[_0x3ee2('0x19')](handleError(_0x24771a,null));};exports['removeImap']=function(_0x5b41c9,_0x453051){return db[_0x3ee2('0x2f')]['findOne']({'where':{'id':_0x5b41c9['params']['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x453051,null))[_0x3ee2('0x10')](function(_0x3f6cf4){if(_0x3f6cf4){return _0x3f6cf4[_0x3ee2('0x71')](null);}return null;})['then'](respondWithStatusCode(_0x453051,null))[_0x3ee2('0x19')](handleError(_0x453051,null));};exports['getSmtp']=function(_0x155fb7,_0x48f553){return db['MailAccount']['findOne']({'where':{'id':_0x155fb7[_0x3ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x48f553,null))[_0x3ee2('0x10')](function(_0xc8053e){if(_0xc8053e){return _0xc8053e['getSmtp']();}return null;})['then'](respondWithResult(_0x48f553,null))[_0x3ee2('0x19')](handleError(_0x48f553,null));};exports['addSmtp']=function(_0x2a4c1f,_0x22a063){if(_0x2a4c1f['body']['id']){delete _0x2a4c1f[_0x3ee2('0x4e')]['id'];}return db['MailAccount'][_0x3ee2('0x4d')]({'where':{'id':_0x2a4c1f['params']['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x22a063,null))[_0x3ee2('0x10')](function(_0x4c7de7){if(_0x4c7de7){_0x2a4c1f[_0x3ee2('0x4e')]['MailAccountId']=_0x4c7de7['id'];return db[_0x3ee2('0x4b')][_0x3ee2('0x56')](_0x2a4c1f[_0x3ee2('0x4e')]);}})['then'](respondWithResult(_0x22a063,null))[_0x3ee2('0x19')](handleError(_0x22a063,null));};exports['removeSmtp']=function(_0x1d1dcc,_0x421351){return db[_0x3ee2('0x2f')]['findOne']({'where':{'id':_0x1d1dcc[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x421351,null))['then'](function(_0x5f3b8d){if(_0x5f3b8d){return _0x5f3b8d[_0x3ee2('0x72')](null);}return null;})[_0x3ee2('0x10')](respondWithStatusCode(_0x421351,null))[_0x3ee2('0x19')](handleError(_0x421351,null));};exports[_0x3ee2('0x73')]=function(_0x350928,_0x62a701){return db[_0x3ee2('0x74')]['find']({'where':{'id':_0x350928['params']['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x62a701,null))['then'](function(_0x3c5195){if(_0x3c5195){return _0x3c5195[_0x3ee2('0x73')](_0x350928[_0x3ee2('0x4e')][_0x3ee2('0x5a')],_[_0x3ee2('0x75')](_0x350928[_0x3ee2('0x4e')],[_0x3ee2('0x5a'),'id'])||{});}})[_0x3ee2('0x10')](respondWithResult(_0x62a701,null))['catch'](handleError(_0x62a701,null));};exports['getInteractions']=function(_0x2b1844,_0x15d836){var _0x516cb4={'raw':![],'where':{}};var _0x2a3f9e={};var _0x20eec0={'count':0x0,'rows':[]};return db['MailAccount'][_0x3ee2('0x57')]({'where':{'id':_0x2b1844[_0x3ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x15d836,null))[_0x3ee2('0x10')](function(_0x40f093){if(_0x40f093){_0x2a3f9e[_0x3ee2('0x38')]=_['keys'](db[_0x3ee2('0x74')]['rawAttributes']);_0x2a3f9e[_0x3ee2('0x34')]=_[_0x3ee2('0x35')](_0x2b1844[_0x3ee2('0x34')]);_0x2a3f9e[_0x3ee2('0x36')]=_[_0x3ee2('0x37')](_0x2a3f9e['model'],_0x2a3f9e['query']);_0x516cb4[_0x3ee2('0x3a')]=_['intersection'](_0x2a3f9e[_0x3ee2('0x38')],qs[_0x3ee2('0x39')](_0x2b1844['query']['fields']));_0x516cb4['attributes']=_0x516cb4[_0x3ee2('0x3a')][_0x3ee2('0x3b')]?_0x516cb4[_0x3ee2('0x3a')]:_0x2a3f9e['model'];if(!_0x2b1844['query'][_0x3ee2('0x3c')](_0x3ee2('0x3d'))){_0x516cb4['limit']=qs[_0x3ee2('0x1f')](_0x2b1844[_0x3ee2('0x34')][_0x3ee2('0x1f')]);_0x516cb4[_0x3ee2('0x1e')]=qs[_0x3ee2('0x1e')](_0x2b1844[_0x3ee2('0x34')][_0x3ee2('0x1e')]);}_0x516cb4['order']=qs[_0x3ee2('0x3f')](_0x2b1844[_0x3ee2('0x34')][_0x3ee2('0x3f')]);_0x516cb4[_0x3ee2('0x42')]=qs[_0x3ee2('0x36')](_[_0x3ee2('0x40')](_0x2b1844[_0x3ee2('0x34')],_0x2a3f9e[_0x3ee2('0x36')]));_0x516cb4['where']['MailAccountId']=_0x40f093['id'];if(_0x2b1844[_0x3ee2('0x34')][_0x3ee2('0x41')]){_0x516cb4[_0x3ee2('0x42')]=_[_0x3ee2('0x43')](_0x516cb4[_0x3ee2('0x42')],{'$or':_[_0x3ee2('0x44')](_0x516cb4[_0x3ee2('0x3a')],function(_0x334477){var _0xc23902={};_0xc23902[_0x334477]={'$like':'%'+_0x2b1844['query']['filter']+'%'};return _0xc23902;})});}_0x516cb4=_['merge']({},_0x516cb4,_0x2b1844[_0x3ee2('0x58')]);return db[_0x3ee2('0x74')][_0x3ee2('0x21')]({'where':_0x516cb4['where']})[_0x3ee2('0x10')](function(_0x111153){_0x20eec0['count']=_0x111153;if(_0x2b1844[_0x3ee2('0x34')][_0x3ee2('0x46')]){_0x516cb4['include']=[{'model':db[_0x3ee2('0x76')],'as':_0x3ee2('0x77'),'required':![]},{'model':db[_0x3ee2('0x78')],'as':'Owner','attributes':[_0x3ee2('0x29'),_0x3ee2('0x79'),_0x3ee2('0x7a')],'required':![]},{'model':db[_0x3ee2('0x7b')],'as':'Tags','attributes':['id',_0x3ee2('0x29'),_0x3ee2('0x7c')],'where':_0x2b1844[_0x3ee2('0x34')][_0x3ee2('0x7d')]?{'id':_0x2b1844[_0x3ee2('0x34')][_0x3ee2('0x7d')]}:undefined,'required':_0x2b1844[_0x3ee2('0x34')][_0x3ee2('0x7d')]?!![]:![]}];}return db[_0x3ee2('0x74')][_0x3ee2('0x47')](_0x516cb4);})['then'](function(_0x29927b){_0x20eec0['rows']=_0x29927b;return _0x20eec0;});}})[_0x3ee2('0x10')](respondWithFilteredResult(_0x15d836,_0x516cb4))[_0x3ee2('0x19')](handleError(_0x15d836,null));};exports[_0x3ee2('0x7e')]=function addApplications(_0x47a710,_0x3cb649){var _0x109c82=_0x47a710['params']['id'];var _0x573911=_0x47a710['body'];var _0xd9b83f=0xc8;var _0x1bbbc3=null;return db[_0x3ee2('0x7f')]['transaction']({'isolationLevel':db[_0x3ee2('0x7f')][_0x3ee2('0x80')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4e7a8c){return db['MailAccount']['findOne']({'where':{'id':_0x109c82},'transaction':_0x4e7a8c})[_0x3ee2('0x10')](function(_0x38731f){if(_0x38731f){return db[_0x3ee2('0x81')][_0x3ee2('0x24')]({'where':{'MailAccountId':_0x109c82},'transaction':_0x4e7a8c})[_0x3ee2('0x10')](function(){var _0xb247ca=_[_0x3ee2('0x44')](_0x573911,function(_0x2b8e60){_0x2b8e60[_0x3ee2('0x54')]=_0x109c82;return _0x2b8e60;});return db[_0x3ee2('0x81')]['bulkCreate'](_0xb247ca,{'transaction':_0x4e7a8c});});}else{_0xd9b83f=0x194;_0x1bbbc3=[];}});})[_0x3ee2('0x10')](function(){if(_0xd9b83f!==0x194){return db['MailApplication'][_0x3ee2('0x82')]({'where':{'MailAccountId':_0x109c82},'order':_0x3ee2('0x83')})[_0x3ee2('0x10')](function(_0x1c7848){_0x1bbbc3=_0x1c7848;});}})['catch'](function(_0x6cde80){_0xd9b83f=0x1f4;logger[_0x3ee2('0x15')](_0x6cde80[_0x3ee2('0x28')]);if(_0x6cde80[_0x3ee2('0x29')]){delete _0x6cde80['name'];}_0x1bbbc3=_0x6cde80;})[_0x3ee2('0x84')](function(){if(_0x1bbbc3===null){_0x3cb649[_0x3ee2('0x1a')](_0xd9b83f);}else{if(_0xd9b83f===0x1f4){_0x3cb649[_0x3ee2('0x1b')](_0xd9b83f)[_0x3ee2('0x2a')](_0x1bbbc3);}else{_0x3cb649['status'](_0xd9b83f)[_0x3ee2('0x1d')](_0x1bbbc3);}}});};exports[_0x3ee2('0x85')]=function(_0x19cdcc,_0x1ecc1f){var _0x5601d4={};var _0x3c58ca={};var _0x44d4d9;var _0x2185f0;return db[_0x3ee2('0x2f')][_0x3ee2('0x57')]({'where':{'id':_0x19cdcc[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x1ecc1f,null))[_0x3ee2('0x10')](function(_0x24f268){if(_0x24f268){_0x44d4d9=_0x24f268;_0x3c58ca[_0x3ee2('0x38')]=_['keys'](db['MailApplication'][_0x3ee2('0x30')]);_0x3c58ca['query']=_['keys'](_0x19cdcc['query']);_0x3c58ca[_0x3ee2('0x36')]=_[_0x3ee2('0x37')](_0x3c58ca[_0x3ee2('0x38')],_0x3c58ca[_0x3ee2('0x34')]);_0x5601d4[_0x3ee2('0x3a')]=_[_0x3ee2('0x37')](_0x3c58ca[_0x3ee2('0x38')],qs[_0x3ee2('0x39')](_0x19cdcc[_0x3ee2('0x34')][_0x3ee2('0x39')]));_0x5601d4[_0x3ee2('0x3a')]=_0x5601d4[_0x3ee2('0x3a')][_0x3ee2('0x3b')]?_0x5601d4['attributes']:_0x3c58ca[_0x3ee2('0x38')];_0x5601d4[_0x3ee2('0x3e')]=qs[_0x3ee2('0x3f')](_0x19cdcc[_0x3ee2('0x34')][_0x3ee2('0x3f')]);_0x5601d4[_0x3ee2('0x42')]=qs['filters'](_['pick'](_0x19cdcc['query'],_0x3c58ca[_0x3ee2('0x36')]));if(_0x19cdcc[_0x3ee2('0x34')][_0x3ee2('0x41')]){_0x5601d4[_0x3ee2('0x42')]=_[_0x3ee2('0x43')](_0x5601d4[_0x3ee2('0x42')],{'$or':_['map'](_0x5601d4[_0x3ee2('0x3a')],function(_0x24c6a5){var _0x4bc25b={};_0x4bc25b[_0x24c6a5]={'$like':'%'+_0x19cdcc[_0x3ee2('0x34')][_0x3ee2('0x41')]+'%'};return _0x4bc25b;})});}_0x5601d4=_[_0x3ee2('0x43')]({},_0x5601d4,_0x19cdcc['options']);return _0x44d4d9['getApplications'](_0x5601d4);}})[_0x3ee2('0x10')](function(_0x5c072b){if(_0x5c072b){_0x2185f0=_0x5c072b['length'];if(!_0x19cdcc[_0x3ee2('0x34')][_0x3ee2('0x3c')](_0x3ee2('0x3d'))){_0x5601d4[_0x3ee2('0x1f')]=qs['limit'](_0x19cdcc['query'][_0x3ee2('0x1f')]);_0x5601d4[_0x3ee2('0x1e')]=qs[_0x3ee2('0x1e')](_0x19cdcc[_0x3ee2('0x34')][_0x3ee2('0x1e')]);}return _0x44d4d9['getApplications'](_0x5601d4);}})[_0x3ee2('0x10')](function(_0x23531e){if(_0x23531e){return _0x23531e?{'count':_0x2185f0,'rows':_0x23531e}:null;}})[_0x3ee2('0x10')](respondWithResult(_0x1ecc1f,null))[_0x3ee2('0x19')](handleError(_0x1ecc1f,null));};exports[_0x3ee2('0x86')]=function(_0x3513bf,_0x18359b){var _0x4962bb={'raw':!![],'where':{}};var _0x4370f0={};var _0x3a709f={'count':0x0,'rows':[]};return db['MailAccount'][_0x3ee2('0x57')]({'where':{'id':_0x3513bf[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x18359b,null))[_0x3ee2('0x10')](function(_0x5c3cb9){if(_0x5c3cb9){_0x4370f0['model']=_[_0x3ee2('0x35')](db['MailMessage'][_0x3ee2('0x30')]);_0x4370f0[_0x3ee2('0x34')]=_['keys'](_0x3513bf[_0x3ee2('0x34')]);_0x4370f0[_0x3ee2('0x36')]=_[_0x3ee2('0x37')](_0x4370f0[_0x3ee2('0x38')],_0x4370f0[_0x3ee2('0x34')]);_0x4962bb[_0x3ee2('0x3a')]=_[_0x3ee2('0x37')](_0x4370f0[_0x3ee2('0x38')],qs[_0x3ee2('0x39')](_0x3513bf['query']['fields']));_0x4962bb[_0x3ee2('0x3a')]=_0x4962bb[_0x3ee2('0x3a')][_0x3ee2('0x3b')]?_0x4962bb[_0x3ee2('0x3a')]:_0x4370f0[_0x3ee2('0x38')];if(!_0x3513bf['query'][_0x3ee2('0x3c')]('nolimit')){_0x4962bb['limit']=qs[_0x3ee2('0x1f')](_0x3513bf[_0x3ee2('0x34')][_0x3ee2('0x1f')]);_0x4962bb[_0x3ee2('0x1e')]=qs[_0x3ee2('0x1e')](_0x3513bf[_0x3ee2('0x34')][_0x3ee2('0x1e')]);}_0x4962bb[_0x3ee2('0x3e')]=qs[_0x3ee2('0x3f')](_0x3513bf[_0x3ee2('0x34')][_0x3ee2('0x3f')]);_0x4962bb['where']=qs[_0x3ee2('0x36')](_[_0x3ee2('0x40')](_0x3513bf['query'],_0x4370f0[_0x3ee2('0x36')]));_0x4962bb[_0x3ee2('0x42')][_0x3ee2('0x54')]=_0x5c3cb9['id'];if(_0x3513bf[_0x3ee2('0x34')]['filter']){_0x4962bb[_0x3ee2('0x42')]=_[_0x3ee2('0x43')](_0x4962bb[_0x3ee2('0x42')],{'$or':_['map'](_0x4962bb['attributes'],function(_0x2cc047){var _0xb4838e={};_0xb4838e[_0x2cc047]={'$like':'%'+_0x3513bf['query'][_0x3ee2('0x41')]+'%'};return _0xb4838e;})});}if(_0x3513bf[_0x3ee2('0x34')][_0x3ee2('0x87')]){var _0x1690e6=_0x3513bf[_0x3ee2('0x34')][_0x3ee2('0x87')][_0x3ee2('0x88')](',');var _0x5e5dbe={};_0x5e5dbe[_0x1690e6[0x0]]={'$gte':moment(_0x1690e6[0x1])[_0x3ee2('0x89')](_0x3ee2('0x8a'))};_0x4962bb[_0x3ee2('0x42')]=_[_0x3ee2('0x43')](_0x4962bb[_0x3ee2('0x42')],_0x5e5dbe);}_0x4962bb=_['merge']({},_0x4962bb,_0x3513bf['options']);return db['MailMessage'][_0x3ee2('0x21')]({'where':_0x4962bb[_0x3ee2('0x42')]})[_0x3ee2('0x10')](function(_0x552745){_0x3a709f[_0x3ee2('0x21')]=_0x552745;if(_0x3513bf[_0x3ee2('0x34')][_0x3ee2('0x46')]){_0x4962bb['include']=[{'all':!![]}];}return db[_0x3ee2('0x8b')][_0x3ee2('0x47')](_0x4962bb);})['then'](function(_0x197382){if(_0x3513bf[_0x3ee2('0x34')][_0x3ee2('0x8c')]===_0x3ee2('0x8d')){for(var _0x5e08fd=0x0;_0x5e08fd<_0x197382[_0x3ee2('0x3b')];_0x5e08fd++){_0x197382[_0x5e08fd][_0x3ee2('0x4e')]=juice(_0x197382[_0x5e08fd][_0x3ee2('0x4e')]);}}_0x3a709f['rows']=_0x197382;return _0x3a709f;});}})[_0x3ee2('0x10')](respondWithFilteredResult(_0x18359b,_0x4962bb))[_0x3ee2('0x19')](handleError(_0x18359b,null));};exports[_0x3ee2('0x2a')]=function(_0x1c9e5b,_0x4cfb05){var _0x3157d0,_0x182395={},_0x2a5111;if(_0x1c9e5b[_0x3ee2('0x4e')]['to']){_0x2a5111=_0x1c9e5b['body']['to'][_0x3ee2('0x88')](',')[0x0];}return db[_0x3ee2('0x2f')]['find']({'where':{'id':_0x1c9e5b[_0x3ee2('0x53')]['id']},'include':[{'model':db[_0x3ee2('0x8e')],'as':_0x3ee2('0x8f'),'include':[{'model':db[_0x3ee2('0x76')],'as':_0x3ee2('0x90'),'where':{'email':_0x2a5111},'limit':0x1,'order':[[_0x3ee2('0x91'),_0x3ee2('0x92')]]}]},{'model':db['MailServerOut'],'as':_0x3ee2('0x2c'),'raw':!![]}]})[_0x3ee2('0x10')](handleEntityNotFound(_0x4cfb05,null))[_0x3ee2('0x10')](function(_0x5647dc){if(_0x5647dc){_0x3157d0=_0x5647dc;if(_0x5647dc['Smtp']){if(_[_0x3ee2('0x62')](_0x1c9e5b[_0x3ee2('0x4e')][_0x3ee2('0x93')])){_0x1c9e5b[_0x3ee2('0x4e')][_0x3ee2('0x93')]=util[_0x3ee2('0x89')](_0x3ee2('0x94'),_0x5647dc[_0x3ee2('0x29')],_0x5647dc[_0x3ee2('0x60')]||_0x5647dc[_0x3ee2('0x2c')][_0x3ee2('0x65')]);}if(_0x1c9e5b[_0x3ee2('0x4e')][_0x3ee2('0x95')]&&_0x1c9e5b[_0x3ee2('0x4e')][_0x3ee2('0x95')][_0x3ee2('0x3b')]){for(var _0x3a3e84=0x0;_0x3a3e84<_0x1c9e5b['body'][_0x3ee2('0x95')]['length'];_0x3a3e84+=0x1){_0x1c9e5b['body'][_0x3ee2('0x95')][_0x3a3e84]={'filename':_0x1c9e5b[_0x3ee2('0x4e')][_0x3ee2('0x95')][_0x3a3e84][_0x3ee2('0x29')],'path':path[_0x3ee2('0x96')](config[_0x3ee2('0x97')],'server/files/attachments',_0x1c9e5b[_0x3ee2('0x4e')][_0x3ee2('0x95')][_0x3a3e84][_0x3ee2('0x98')])};}}var _0x5e701b={'tls':{'rejectUnauthorized':![]}};if(_[_0x3ee2('0x62')](_0x5647dc['Smtp'][_0x3ee2('0x99')])){if(_0x5647dc[_0x3ee2('0x2c')][_0x3ee2('0x6b')]){_0x5e701b[_0x3ee2('0x9a')]={'user':_0x5647dc[_0x3ee2('0x2c')][_0x3ee2('0x65')],'pass':_0x5647dc['Smtp']['pass']};}_0x5e701b['host']=_0x5647dc[_0x3ee2('0x2c')][_0x3ee2('0x69')];_0x5e701b[_0x3ee2('0x6a')]=_0x5647dc[_0x3ee2('0x2c')][_0x3ee2('0x6a')];_0x5e701b[_0x3ee2('0x9b')]=_0x5647dc[_0x3ee2('0x2c')][_0x3ee2('0x9b')];}else{_0x5e701b[_0x3ee2('0x99')]=_0x5647dc[_0x3ee2('0x2c')]['service'];_0x5e701b['auth']={'user':_0x5647dc[_0x3ee2('0x2c')][_0x3ee2('0x65')],'pass':_0x5647dc[_0x3ee2('0x2c')][_0x3ee2('0x67')]};}return respondWithRpcPromise(_0x3ee2('0x9c'),_0x3ee2('0x9d'),{'account':_0x5e701b,'message':_0x1c9e5b[_0x3ee2('0x4e')]});}else{throw new Error(_0x3ee2('0x9e'));}}})[_0x3ee2('0x10')](function(_0x3ccfea){if(_0x3ccfea){_0x182395=_0x3ccfea;if(_0x3157d0[_0x3ee2('0x8f')]){if(_0x3157d0['List'][_0x3ee2('0x90')][_0x3ee2('0x3b')]){return _0x3157d0[_0x3ee2('0x8f')][_0x3ee2('0x90')][0x0];}else{return db[_0x3ee2('0x76')][_0x3ee2('0x56')](_[_0x3ee2('0x8')](_0x1c9e5b[_0x3ee2('0x4e')],{'firstName':_0x1c9e5b['body']['to'],'email':_0x1c9e5b[_0x3ee2('0x4e')]['to'],'phone':_0x1c9e5b[_0x3ee2('0x4e')]['to'],'ListId':_0x3157d0[_0x3ee2('0x61')]}));}}else{throw new Error(_0x3ee2('0x9e'));}}})[_0x3ee2('0x10')](function(_0x14ba66){if(_0x14ba66){var _0x227893={'UserId':_0x1c9e5b[_0x3ee2('0x65')]['id'],'ContactId':_0x14ba66['id'],'MailAccountId':_0x3157d0['id'],'inReplyTo':_0x182395[_0x3ee2('0x9f')],'to':_0x1c9e5b[_0x3ee2('0x4e')]['from'],'cc':_0x1c9e5b[_0x3ee2('0x4e')]['cc'],'subject':_0x1c9e5b[_0x3ee2('0x4e')]['subject'],'attach':_0x1c9e5b['body'][_0x3ee2('0xa0')],'firstMsgDirection':_0x3ee2('0xa1'),'lastMsgAt':moment()[_0x3ee2('0x89')](_0x3ee2('0x8a')),'lastMsgDirection':_0x3ee2('0xa1'),'Messages':[_[_0x3ee2('0x43')](_0x1c9e5b['body'],{'messageId':_0x182395[_0x3ee2('0x9f')],'sentAt':moment()[_0x3ee2('0x89')](_0x3ee2('0x8a')),'read':!![],'MailAccountId':_0x3157d0['id'],'UserId':_0x1c9e5b[_0x3ee2('0x65')]['id'],'ContactId':_0x14ba66['id']})]};if(_0x1c9e5b['body'][_0x3ee2('0xa2')]){_0x227893=_[_0x3ee2('0x43')](_0x227893,_0x1c9e5b['body'][_0x3ee2('0xa2')]);}return db['MailInteraction'][_0x3ee2('0x56')](_0x227893,{'include':[{'model':db[_0x3ee2('0x8b')],'as':_0x3ee2('0xa3')}]});}})[_0x3ee2('0x10')](respondWithResult(_0x4cfb05,null))[_0x3ee2('0x19')](handleError(_0x4cfb05,null));};exports[_0x3ee2('0xa4')]=function(_0x2e12a1,_0x1cd763){return db[_0x3ee2('0x2f')][_0x3ee2('0x4d')]({'where':{'id':_0x2e12a1[_0x3ee2('0x53')]['id']},'include':[{'model':db[_0x3ee2('0x4b')],'as':_0x3ee2('0x2c'),'raw':!![],'include':[{'model':db[_0x3ee2('0xa5')],'as':_0x3ee2('0xa5'),'raw':!![]}]}]})[_0x3ee2('0x10')](handleEntityNotFound(_0x1cd763,null))[_0x3ee2('0x10')](function(_0x30ffd4){if(!_0x30ffd4[_0x3ee2('0x2c')])return;var _0xa062b0={'id':_0x30ffd4['id'],'tls':{'rejectUnauthorized':![]}};if(_0x30ffd4['provider']!==_0x3ee2('0x5e')){_0xa062b0[_0x3ee2('0x99')]=_0x30ffd4[_0x3ee2('0x5f')];}else{_0xa062b0['host']=_0x30ffd4[_0x3ee2('0x2c')][_0x3ee2('0x69')];_0xa062b0[_0x3ee2('0x6a')]=_0x30ffd4[_0x3ee2('0x2c')]['port'];_0xa062b0[_0x3ee2('0x9b')]=_0x30ffd4['Smtp'][_0x3ee2('0x9b')];}if(_0x30ffd4[_0x3ee2('0x2c')][_0x3ee2('0x6b')]){if(_0x30ffd4['Smtp'][_0x3ee2('0x50')]){_0xa062b0[_0x3ee2('0x9a')]={'type':_0x3ee2('0xa6'),'user':_0x30ffd4[_0x3ee2('0x2c')][_0x3ee2('0x65')],'accessToken':_0x30ffd4['Smtp'][_0x3ee2('0xa5')]['data5']};}else{_0xa062b0['auth']={'user':_0x30ffd4[_0x3ee2('0x2c')][_0x3ee2('0x65')],'pass':_0x30ffd4[_0x3ee2('0x2c')]['pass']};}}return respondWithRpcPromise(_0x3ee2('0xa7'),_0x3ee2('0xa4'),{'account':_0xa062b0});})[_0x3ee2('0x10')](respondWithResult(_0x1cd763,null))[_0x3ee2('0x19')](handleError(_0x1cd763,null));};exports['destroy']=function(_0x1d5554,_0x527a2e){return db[_0x3ee2('0x2f')][_0x3ee2('0x4d')]({'where':{'id':_0x1d5554[_0x3ee2('0x53')]['id']}})['then'](handleEntityNotFound(_0x527a2e,null))[_0x3ee2('0x10')](function(_0x1653b8){if(_0x1653b8&&_0x1653b8[_0x3ee2('0x99')]){throw new db[(_0x3ee2('0xa8'))][(_0x3ee2('0xa9'))](_0x3ee2('0xaa'));}return _0x1653b8;})[_0x3ee2('0x10')](removeEntity(_0x527a2e,null))['catch'](handleError(_0x527a2e,null));};exports[_0x3ee2('0xab')]=function(_0x262cac,_0x25638c){return db[_0x3ee2('0x2f')][_0x3ee2('0x4d')]({'where':{'id':_0x262cac[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x25638c,null))[_0x3ee2('0x10')](function(_0x5cb5d6){if(_0x5cb5d6){return _0x5cb5d6[_0x3ee2('0xab')](_0x262cac['body'][_0x3ee2('0x5a')],_[_0x3ee2('0x75')](_0x262cac['body'],[_0x3ee2('0x5a'),'id'])||{})[_0x3ee2('0xac')](function(_0xff114c){for(var _0x3e619c=0x0;_0x3e619c<_0x262cac[_0x3ee2('0x4e')][_0x3ee2('0x5a')]['length'];_0x3e619c+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x262cac['body'][_0x3ee2('0x5a')][_0x3e619c]),'MailAccountId':Number(_0x262cac['params']['id'])});}return _0xff114c;});}})[_0x3ee2('0x10')](respondWithResult(_0x25638c,null))['catch'](handleError(_0x25638c,null));};exports[_0x3ee2('0xad')]=function(_0x383ad1,_0x260270){return db[_0x3ee2('0x2f')]['find']({'where':{'id':_0x383ad1['params']['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x260270,null))[_0x3ee2('0x10')](function(_0x368bed){if(_0x368bed){return _0x368bed[_0x3ee2('0xad')](_0x383ad1['query'][_0x3ee2('0x5a')])[_0x3ee2('0x10')](function(){if(_['isArray'](_0x383ad1[_0x3ee2('0x34')][_0x3ee2('0x5a')])){for(var _0x5610f1=0x0;_0x5610f1<_0x383ad1[_0x3ee2('0x34')]['ids'][_0x3ee2('0x3b')];_0x5610f1+=0x1){socket[_0x3ee2('0xae')](_0x3ee2('0xaf'),{'UserId':Number(_0x383ad1['query'][_0x3ee2('0x5a')][_0x5610f1]),'MailAccountId':Number(_0x383ad1[_0x3ee2('0x53')]['id'])});}}else{socket['emit'](_0x3ee2('0xaf'),{'UserId':Number(_0x383ad1['query'][_0x3ee2('0x5a')]),'MailAccountId':Number(_0x383ad1['params']['id'])});}});}})[_0x3ee2('0x10')](respondWithStatusCode(_0x260270,null))[_0x3ee2('0x19')](handleError(_0x260270,null));};exports[_0x3ee2('0xb0')]=function(_0x291ade,_0x47fce9){var _0x1d7ecd={};var _0x22ba2d={};var _0x12b93b;var _0x3bc8f9;return db[_0x3ee2('0x2f')]['findOne']({'where':{'id':_0x291ade[_0x3ee2('0x53')]['id']}})[_0x3ee2('0x10')](handleEntityNotFound(_0x47fce9,null))[_0x3ee2('0x10')](function(_0x8120a3){if(_0x8120a3){_0x12b93b=_0x8120a3;_0x22ba2d[_0x3ee2('0x38')]=_[_0x3ee2('0x35')](db[_0x3ee2('0x78')][_0x3ee2('0x30')]);_0x22ba2d[_0x3ee2('0x34')]=_[_0x3ee2('0x35')](_0x291ade[_0x3ee2('0x34')]);_0x22ba2d[_0x3ee2('0x36')]=_[_0x3ee2('0x37')](_0x22ba2d[_0x3ee2('0x38')],_0x22ba2d[_0x3ee2('0x34')]);_0x1d7ecd['attributes']=_[_0x3ee2('0x37')](_0x22ba2d['model'],qs['fields'](_0x291ade[_0x3ee2('0x34')]['fields']));_0x1d7ecd[_0x3ee2('0x3a')]=_0x1d7ecd['attributes'][_0x3ee2('0x3b')]?_0x1d7ecd[_0x3ee2('0x3a')]:_0x22ba2d['model'];_0x1d7ecd['order']=qs[_0x3ee2('0x3f')](_0x291ade[_0x3ee2('0x34')][_0x3ee2('0x3f')]);_0x1d7ecd[_0x3ee2('0x42')]=qs[_0x3ee2('0x36')](_[_0x3ee2('0x40')](_0x291ade[_0x3ee2('0x34')],_0x22ba2d['filters']));if(_0x291ade[_0x3ee2('0x34')][_0x3ee2('0x41')]){_0x1d7ecd[_0x3ee2('0x42')]=_[_0x3ee2('0x43')](_0x1d7ecd[_0x3ee2('0x42')],{'$or':_[_0x3ee2('0x44')](_0x1d7ecd[_0x3ee2('0x3a')],function(_0x1fae82){var _0x4a1d2a={};_0x4a1d2a[_0x1fae82]={'$like':'%'+_0x291ade['query'][_0x3ee2('0x41')]+'%'};return _0x4a1d2a;})});}_0x1d7ecd=_[_0x3ee2('0x43')]({},_0x1d7ecd,_0x291ade[_0x3ee2('0x58')]);return _0x12b93b[_0x3ee2('0xb0')](_0x1d7ecd);}})[_0x3ee2('0x10')](function(_0x4af607){if(_0x4af607){_0x3bc8f9=_0x4af607[_0x3ee2('0x3b')];if(!_0x291ade[_0x3ee2('0x34')][_0x3ee2('0x3c')](_0x3ee2('0x3d'))){_0x1d7ecd[_0x3ee2('0x1f')]=qs['limit'](_0x291ade[_0x3ee2('0x34')]['limit']);_0x1d7ecd['offset']=qs['offset'](_0x291ade[_0x3ee2('0x34')]['offset']);}return _0x12b93b[_0x3ee2('0xb0')](_0x1d7ecd);}})['then'](function(_0x366778){if(_0x366778){return _0x366778?{'count':_0x3bc8f9,'rows':_0x366778}:null;}})[_0x3ee2('0x10')](respondWithResult(_0x47fce9,null))[_0x3ee2('0x19')](handleError(_0x47fce9,null));};
\ No newline at end of file
+var _0x0bd1=['role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getMessages','MailMessage','$gte','split','inlineCss','true','CmList','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','List','List\x20not\x20found','Contacts','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','User','moment','bluebird','util','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailAccount.socket','register','jayson/promise','client','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','update','get','UserProfileResource','destroy','name','send','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','body','provider','custom','params','MailServerOut','Mail\x20Account\x20not\x20found','describe','Disposition','create','getDispositions','findOne','MailAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x9be9be,_0x47c635){var _0x3088d4=function(_0x4403a0){while(--_0x4403a0){_0x9be9be['push'](_0x9be9be['shift']());}};_0x3088d4(++_0x47c635);}(_0x0bd1,0x1dc));var _0x10bd=function(_0x4e0c31,_0x208e9f){_0x4e0c31=_0x4e0c31-0x0;var _0x3fd7df=_0x0bd1[_0x4e0c31];return _0x3fd7df;};'use strict';var moment=require(_0x10bd('0x0'));var BPromise=require(_0x10bd('0x1'));var util=require(_0x10bd('0x2'));var path=require(_0x10bd('0x3'));var _=require(_0x10bd('0x4'));var juice=require(_0x10bd('0x5'));var Redis=require('ioredis');var qs=require(_0x10bd('0x6'));var logger=require(_0x10bd('0x7'))(_0x10bd('0x8'));var config=require(_0x10bd('0x9'));var db=require(_0x10bd('0xa'))['db'];config['redis']=_[_0x10bd('0xb')](config[_0x10bd('0xc')],{'host':_0x10bd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10bd('0xc')]));require(_0x10bd('0xe'))[_0x10bd('0xf')](socket);var jayson=require(_0x10bd('0x10'));var client=jayson[_0x10bd('0x11')]['http']({'port':0x232b});function respondWithRpcPromise(_0x28fefb,_0x41c6c9,_0x4916d6,_0x22c294){return new BPromise(function(_0x1fcf6d,_0xfeae1a){var _0x5c17bd=_0x22c294||client;return _0x5c17bd[_0x10bd('0x12')](_0x28fefb,_0x4916d6)[_0x10bd('0x13')](function(_0x482462){logger['info'](_0x10bd('0x14'),_0x41c6c9,_0x10bd('0x15'));logger[_0x10bd('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x41c6c9,_0x10bd('0x15'),JSON[_0x10bd('0x17')](_0x482462));if(_0x482462[_0x10bd('0x18')]){if(_0x482462[_0x10bd('0x18')][_0x10bd('0x19')]===0x1f4){logger[_0x10bd('0x18')]('MailAccount,\x20%s,\x20%s',_0x41c6c9,_0x482462[_0x10bd('0x18')][_0x10bd('0x1a')]);return _0xfeae1a(_0x482462[_0x10bd('0x18')][_0x10bd('0x1a')]);}logger[_0x10bd('0x18')](_0x10bd('0x14'),_0x41c6c9,_0x482462['error'][_0x10bd('0x1a')]);return _0x1fcf6d(_0x482462[_0x10bd('0x18')]['message']);}else{logger[_0x10bd('0x1b')]('MailAccount,\x20%s,\x20%s',_0x41c6c9,'request\x20sent');_0x1fcf6d(_0x482462[_0x10bd('0x1c')][_0x10bd('0x1a')]);}})[_0x10bd('0x1d')](function(_0x513d16){logger[_0x10bd('0x18')]('MailAccount,\x20%s,\x20%s',_0x41c6c9,_0x513d16);_0xfeae1a(_0x513d16);});});}function respondWithStatusCode(_0x2b4c83,_0x450bba){_0x450bba=_0x450bba||0xcc;return function(_0xd8fca5){if(_0xd8fca5){return _0x2b4c83[_0x10bd('0x1e')](_0x450bba);}return _0x2b4c83[_0x10bd('0x1f')](_0x450bba)[_0x10bd('0x20')]();};}function respondWithResult(_0x1f9ebd,_0x3bae34){_0x3bae34=_0x3bae34||0xc8;return function(_0x4b6dab){if(_0x4b6dab){return _0x1f9ebd[_0x10bd('0x1f')](_0x3bae34)['json'](_0x4b6dab);}};}function respondWithFilteredResult(_0x68565b,_0x1aedf8){return function(_0xbf2fd1){if(_0xbf2fd1){var _0x2299f0=typeof _0x1aedf8['offset']==='undefined'&&typeof _0x1aedf8[_0x10bd('0x21')]===_0x10bd('0x22');var _0x1e3823=_0xbf2fd1[_0x10bd('0x23')];var _0x5cb90c=_0x2299f0?0x0:_0x1aedf8[_0x10bd('0x24')];var _0x428de4=_0x2299f0?_0xbf2fd1[_0x10bd('0x23')]:_0x1aedf8[_0x10bd('0x24')]+_0x1aedf8[_0x10bd('0x21')];var _0x45ee4b;if(_0x428de4>=_0x1e3823){_0x428de4=_0x1e3823;_0x45ee4b=0xc8;}else{_0x45ee4b=0xce;}_0x68565b['status'](_0x45ee4b);return _0x68565b[_0x10bd('0x25')](_0x10bd('0x26'),_0x5cb90c+'-'+_0x428de4+'/'+_0x1e3823)[_0x10bd('0x27')](_0xbf2fd1);}return null;};}function saveUpdates(_0xfe2931){return function(_0x14fae8){if(_0x14fae8){return _0x14fae8[_0x10bd('0x28')](_0xfe2931)[_0x10bd('0x13')](function(_0xb0dc97){return _0xb0dc97;});}return null;};}function removeEntity(_0x5aba58){return function(_0x1681bb){if(_0x1681bb){return _0x1681bb['destroy']()[_0x10bd('0x13')](function(){var _0xd1ea98=_0x1681bb[_0x10bd('0x29')]({'plain':!![]});var _0x544624='MailAccounts';return db[_0x10bd('0x2a')][_0x10bd('0x2b')]({'where':{'type':_0x544624,'resourceId':_0xd1ea98['id']}})[_0x10bd('0x13')](function(){return _0x1681bb;});})[_0x10bd('0x13')](function(){_0x5aba58['status'](0xcc)[_0x10bd('0x20')]();});}};}function handleEntityNotFound(_0x170c9c){return function(_0x4bdeed){if(!_0x4bdeed){_0x170c9c[_0x10bd('0x1e')](0x194);}return _0x4bdeed;};}function handleError(_0x4d5c8c,_0x2d7025){_0x2d7025=_0x2d7025||0x1f4;return function(_0xe066aa){logger[_0x10bd('0x18')](_0xe066aa['stack']);if(_0xe066aa['name']){delete _0xe066aa[_0x10bd('0x2c')];}_0x4d5c8c[_0x10bd('0x1f')](_0x2d7025)[_0x10bd('0x2d')](_0xe066aa);};}function getImapHost(_0x304248){switch(_0x304248){case'gmail':return'imap.gmail.com';case _0x10bd('0x2e'):return'imap.mail.yahoo.com';case _0x10bd('0x2f'):return _0x10bd('0x30');case _0x10bd('0x31'):return _0x10bd('0x32');}throw new Error(_0x10bd('0x33'),_0x304248);}function getSmtpHost(_0x73c8e5){switch(_0x73c8e5){case _0x10bd('0x34'):return'smtp.gmail.com';case _0x10bd('0x2e'):return _0x10bd('0x35');case'hotmail':return _0x10bd('0x36');case _0x10bd('0x31'):return _0x10bd('0x37');}throw new Error(_0x10bd('0x33'),_0x73c8e5);}function getAuthenticationOptions(_0x42658f,_0x330149){var _0x3dbea7={};var _0xa39d6e={};if(_0x42658f){_0x3dbea7[_0x10bd('0x38')]=_0xa39d6e[_0x10bd('0x38')]=_0x330149[_0x10bd('0x39')];_0x3dbea7[_0x10bd('0x3a')]=_0xa39d6e[_0x10bd('0x3b')]=_0x330149[_0x10bd('0x3a')];if(_0x330149[_0x10bd('0x3c')]){_0x3dbea7[_0x10bd('0x3c')]=_0xa39d6e[_0x10bd('0x3c')]=!![];_0x3dbea7['CloudProviderId']=_0xa39d6e['CloudProviderId']=_0x330149[_0x10bd('0x3d')];_0x3dbea7['password']=_0xa39d6e[_0x10bd('0x3b')]=null;}else{_0x3dbea7[_0x10bd('0x3d')]=_0xa39d6e[_0x10bd('0x3d')]=null;}_0x3dbea7[_0x10bd('0x3e')]=getImapHost(_0x42658f);_0x3dbea7[_0x10bd('0x3f')]=0x3e1;_0xa39d6e[_0x10bd('0x3e')]=getSmtpHost(_0x42658f);_0xa39d6e[_0x10bd('0x3f')]=0x24b;_0xa39d6e[_0x10bd('0x40')]=![];_0x3dbea7[_0x10bd('0x41')]=_0xa39d6e[_0x10bd('0x41')]=null;}else{if(_0x330149['authentication']){_0x3dbea7[_0x10bd('0x38')]=_0xa39d6e[_0x10bd('0x38')]=_0x330149[_0x10bd('0x39')];_0x3dbea7[_0x10bd('0x3a')]=_0xa39d6e['pass']=_0x330149[_0x10bd('0x3a')];}else{_0x3dbea7[_0x10bd('0x42')]=_0xa39d6e[_0x10bd('0x42')]=![];_0x3dbea7['user']=_0xa39d6e['user']=null;_0x3dbea7[_0x10bd('0x3a')]=_0xa39d6e['pass']=null;}_0x3dbea7['host']=_0x330149[_0x10bd('0x43')]['host'];_0x3dbea7[_0x10bd('0x3f')]=_0x330149[_0x10bd('0x43')][_0x10bd('0x3f')];_0xa39d6e[_0x10bd('0x3e')]=_0x330149[_0x10bd('0x44')][_0x10bd('0x3e')];_0xa39d6e[_0x10bd('0x3f')]=_0x330149[_0x10bd('0x44')]['port'];}return{'Imap':_0x3dbea7,'Smtp':_0xa39d6e};}exports['index']=function(_0x1f3a8e,_0x4c3d51){var _0x310f6d={'include':[{'model':db[_0x10bd('0x45')],'as':_0x10bd('0x43')},{'model':db['MailServerOut'],'as':_0x10bd('0x44')},{'model':db[_0x10bd('0x46')],'as':_0x10bd('0x47')}]},_0x29ac71={},_0x53c386={'count':0x0,'rows':[]};var _0x3843cb=_[_0x10bd('0x48')](db[_0x10bd('0x49')][_0x10bd('0x4a')],function(_0x4eec38){return{'name':_0x4eec38['fieldName'],'type':_0x4eec38[_0x10bd('0x4b')][_0x10bd('0x4c')]};});_0x29ac71[_0x10bd('0x4d')]=_[_0x10bd('0x48')](_0x3843cb,'name');_0x29ac71[_0x10bd('0x4e')]=_[_0x10bd('0x4f')](_0x1f3a8e[_0x10bd('0x4e')]);_0x29ac71['filters']=_[_0x10bd('0x50')](_0x29ac71[_0x10bd('0x4d')],_0x29ac71['query']);_0x310f6d[_0x10bd('0x51')]=_[_0x10bd('0x50')](_0x29ac71[_0x10bd('0x4d')],qs[_0x10bd('0x52')](_0x1f3a8e['query'][_0x10bd('0x52')]));_0x310f6d[_0x10bd('0x51')]=_0x310f6d['attributes'][_0x10bd('0x53')]?_0x310f6d['attributes']:_0x29ac71[_0x10bd('0x4d')];if(!_0x1f3a8e[_0x10bd('0x4e')][_0x10bd('0x54')](_0x10bd('0x55'))){_0x310f6d[_0x10bd('0x21')]=qs[_0x10bd('0x21')](_0x1f3a8e[_0x10bd('0x4e')][_0x10bd('0x21')]);_0x310f6d['offset']=qs[_0x10bd('0x24')](_0x1f3a8e[_0x10bd('0x4e')][_0x10bd('0x24')]);}_0x310f6d[_0x10bd('0x56')]=qs[_0x10bd('0x57')](_0x1f3a8e[_0x10bd('0x4e')][_0x10bd('0x57')]);_0x310f6d[_0x10bd('0x58')]=qs[_0x10bd('0x59')](_[_0x10bd('0x5a')](_0x1f3a8e[_0x10bd('0x4e')],_0x29ac71['filters']),_0x3843cb);if(_0x1f3a8e[_0x10bd('0x4e')][_0x10bd('0x5b')]){_0x310f6d['where']=_[_0x10bd('0x5c')](_0x310f6d[_0x10bd('0x58')],{'$or':_[_0x10bd('0x48')](_0x3843cb,function(_0x11fece){if(_0x11fece[_0x10bd('0x4b')]!==_0x10bd('0x5d')){var _0xaef588={};_0xaef588[_0x11fece[_0x10bd('0x2c')]]={'$like':'%'+_0x1f3a8e[_0x10bd('0x4e')]['filter']+'%'};return _0xaef588;}})});}_0x310f6d=_[_0x10bd('0x5c')]({},_0x310f6d,_0x1f3a8e[_0x10bd('0x5e')]);var _0x61106={'where':_0x310f6d[_0x10bd('0x58')]};return db[_0x10bd('0x49')][_0x10bd('0x23')](_0x61106)[_0x10bd('0x13')](function(_0x3caa51){_0x53c386[_0x10bd('0x23')]=_0x3caa51;if(_0x1f3a8e[_0x10bd('0x4e')][_0x10bd('0x5f')]){_0x310f6d[_0x10bd('0x60')]=[{'all':!![]}];}return db[_0x10bd('0x49')][_0x10bd('0x61')](_0x310f6d);})[_0x10bd('0x13')](function(_0x3d80b2){_0x53c386[_0x10bd('0x62')]=_0x3d80b2;return _0x53c386;})[_0x10bd('0x13')](respondWithFilteredResult(_0x4c3d51,_0x310f6d))[_0x10bd('0x1d')](handleError(_0x4c3d51,null));};exports['show']=function(_0x348259,_0x1567e5){var _0x88fc34={'raw':![],'where':{'id':_0x348259['params']['id']},'include':[{'model':db[_0x10bd('0x45')],'as':_0x10bd('0x43')},{'model':db['MailServerOut'],'as':_0x10bd('0x44')},{'model':db[_0x10bd('0x46')],'as':'mandatoryDispositionPause'}]},_0x4094b7={};_0x4094b7[_0x10bd('0x4d')]=_['keys'](db[_0x10bd('0x49')]['rawAttributes']);_0x4094b7[_0x10bd('0x4e')]=_[_0x10bd('0x4f')](_0x348259[_0x10bd('0x4e')]);_0x4094b7['filters']=_[_0x10bd('0x50')](_0x4094b7['model'],_0x4094b7[_0x10bd('0x4e')]);_0x88fc34['attributes']=_[_0x10bd('0x50')](_0x4094b7[_0x10bd('0x4d')],qs[_0x10bd('0x52')](_0x348259[_0x10bd('0x4e')]['fields']));_0x88fc34['attributes']=_0x88fc34[_0x10bd('0x51')][_0x10bd('0x53')]?_0x88fc34[_0x10bd('0x51')]:_0x4094b7[_0x10bd('0x4d')];if(_0x348259['query'][_0x10bd('0x5f')]){_0x88fc34['include']=[{'all':!![]}];}_0x88fc34=_[_0x10bd('0x5c')]({},_0x88fc34,_0x348259[_0x10bd('0x5e')]);return db[_0x10bd('0x49')][_0x10bd('0x63')](_0x88fc34)[_0x10bd('0x13')](handleEntityNotFound(_0x1567e5,null))[_0x10bd('0x13')](respondWithResult(_0x1567e5,null))[_0x10bd('0x1d')](handleError(_0x1567e5,null));};exports[_0x10bd('0x28')]=function(_0x272d2e,_0x5b7d2c){if(_0x272d2e[_0x10bd('0x64')]['id']){delete _0x272d2e[_0x10bd('0x64')]['id'];}var _0x5c0f79=_0x272d2e[_0x10bd('0x64')][_0x10bd('0x65')]===_0x10bd('0x66')?null:_0x272d2e[_0x10bd('0x64')][_0x10bd('0x65')];var _0x34af82=_0x272d2e[_0x10bd('0x64')]['Imap']||{};var _0x115ba9=_0x272d2e[_0x10bd('0x64')]['Smtp']||{};if(_0x5c0f79){_0x34af82[_0x10bd('0x3e')]=getImapHost(_0x5c0f79);_0x34af82['port']=0x3e1;_0x115ba9[_0x10bd('0x3e')]=getSmtpHost(_0x5c0f79);_0x115ba9['port']=0x24b;_0x115ba9[_0x10bd('0x40')]=![];}if(_0x115ba9['modernAuthentication']){_0x115ba9[_0x10bd('0x40')]=![];}else{_0x115ba9[_0x10bd('0x3d')]=null;}if(!_0x34af82[_0x10bd('0x3c')])_0x34af82['CloudProviderId']=null;_0x272d2e[_0x10bd('0x64')]['Imap']=_0x34af82;_0x272d2e[_0x10bd('0x64')][_0x10bd('0x44')]=_0x115ba9;return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x272d2e[_0x10bd('0x67')]['id']},'include':[{'model':db[_0x10bd('0x45')],'as':_0x10bd('0x43')},{'model':db[_0x10bd('0x68')],'as':_0x10bd('0x44')},{'model':db['Pause'],'as':_0x10bd('0x47')}]})[_0x10bd('0x13')](handleEntityNotFound(_0x5b7d2c,null))[_0x10bd('0x13')](function(_0x336e6e){if(!_0x336e6e)throw new Error(_0x10bd('0x69'));if(_0x336e6e[_0x10bd('0x41')])delete _0x272d2e['body'][_0x10bd('0x43')];return _0x336e6e;})[_0x10bd('0x13')](saveUpdates(_0x272d2e[_0x10bd('0x64')],null))[_0x10bd('0x13')](function(_0x463a1e){if(!_0x272d2e[_0x10bd('0x64')][_0x10bd('0x43')])return _0x463a1e;return db[_0x10bd('0x45')][_0x10bd('0x28')](_0x272d2e[_0x10bd('0x64')]['Imap'],{'where':{'MailAccountId':_0x463a1e['id']}})[_0x10bd('0x13')](function(){return _0x463a1e;});})[_0x10bd('0x13')](function(_0x22759c){if(!_0x272d2e[_0x10bd('0x64')]['Smtp'])return _0x22759c;return db[_0x10bd('0x68')]['update'](_0x272d2e[_0x10bd('0x64')][_0x10bd('0x44')],{'where':{'MailAccountId':_0x22759c['id']}})[_0x10bd('0x13')](function(){return _0x22759c;});})[_0x10bd('0x13')](respondWithResult(_0x5b7d2c,null))[_0x10bd('0x1d')](handleError(_0x5b7d2c,null));};exports[_0x10bd('0x6a')]=function(_0x4a8d9e,_0xdc74e1){return db[_0x10bd('0x49')][_0x10bd('0x6a')]()[_0x10bd('0x13')](respondWithResult(_0xdc74e1,null))['catch'](handleError(_0xdc74e1,null));};exports['addDisposition']=function(_0x325332,_0xcee0f8){if(_0x325332['body']['id']){delete _0x325332['body']['id'];}return db[_0x10bd('0x49')]['find']({'where':{'id':_0x325332[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0xcee0f8,null))[_0x10bd('0x13')](function(_0x139b76){if(_0x139b76){_0x325332[_0x10bd('0x64')]['MailAccountId']=_0x139b76['id'];return db[_0x10bd('0x6b')][_0x10bd('0x6c')](_0x325332[_0x10bd('0x64')]);}})['then'](respondWithResult(_0xcee0f8,null))['catch'](handleError(_0xcee0f8,null));};exports[_0x10bd('0x6d')]=function(_0x1f3313,_0x3b125d){var _0x24ab62={'raw':![],'where':{}};var _0x57aa8a={};var _0x4fd02e={'count':0x0,'rows':[]};return db[_0x10bd('0x49')][_0x10bd('0x6e')]({'where':{'id':_0x1f3313[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x3b125d,null))[_0x10bd('0x13')](function(_0x2edcec){if(_0x2edcec){_0x57aa8a[_0x10bd('0x4d')]=_['keys'](db[_0x10bd('0x6b')][_0x10bd('0x4a')]);_0x57aa8a[_0x10bd('0x4e')]=_[_0x10bd('0x4f')](_0x1f3313[_0x10bd('0x4e')]);_0x57aa8a[_0x10bd('0x59')]=_[_0x10bd('0x50')](_0x57aa8a[_0x10bd('0x4d')],_0x57aa8a[_0x10bd('0x4e')]);_0x24ab62['attributes']=_['intersection'](_0x57aa8a[_0x10bd('0x4d')],qs['fields'](_0x1f3313[_0x10bd('0x4e')]['fields']));_0x24ab62['attributes']=_0x24ab62['attributes'][_0x10bd('0x53')]?_0x24ab62['attributes']:_0x57aa8a['model'];if(!_0x1f3313[_0x10bd('0x4e')][_0x10bd('0x54')]('nolimit')){_0x24ab62[_0x10bd('0x21')]=qs['limit'](_0x1f3313[_0x10bd('0x4e')][_0x10bd('0x21')]);_0x24ab62[_0x10bd('0x24')]=qs[_0x10bd('0x24')](_0x1f3313['query'][_0x10bd('0x24')]);}_0x24ab62[_0x10bd('0x56')]=qs[_0x10bd('0x57')](_0x1f3313['query']['sort']);_0x24ab62[_0x10bd('0x58')]=qs[_0x10bd('0x59')](_[_0x10bd('0x5a')](_0x1f3313[_0x10bd('0x4e')],_0x57aa8a['filters']));_0x24ab62['where'][_0x10bd('0x6f')]=_0x2edcec['id'];if(_0x1f3313[_0x10bd('0x4e')]['filter']){_0x24ab62[_0x10bd('0x58')]=_[_0x10bd('0x5c')](_0x24ab62[_0x10bd('0x58')],{'$or':_[_0x10bd('0x48')](_0x24ab62[_0x10bd('0x51')],function(_0xb78865){var _0x4bb94a={};_0x4bb94a[_0xb78865]={'$like':'%'+_0x1f3313[_0x10bd('0x4e')][_0x10bd('0x5b')]+'%'};return _0x4bb94a;})});}_0x24ab62=_['merge']({},_0x24ab62,_0x1f3313[_0x10bd('0x5e')]);return db[_0x10bd('0x6b')]['count']({'where':_0x24ab62['where']})[_0x10bd('0x13')](function(_0x1c9cf5){_0x4fd02e['count']=_0x1c9cf5;if(_0x1f3313['query'][_0x10bd('0x5f')]){_0x24ab62[_0x10bd('0x60')]=[{'all':!![]}];}return db[_0x10bd('0x6b')]['findAll'](_0x24ab62);})['then'](function(_0x582f16){_0x4fd02e['rows']=_0x582f16;return _0x4fd02e;});}})[_0x10bd('0x13')](respondWithFilteredResult(_0x3b125d,_0x24ab62))[_0x10bd('0x1d')](handleError(_0x3b125d,null));};exports[_0x10bd('0x70')]=function(_0x2cc68e,_0x9afa9){return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x2cc68e[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x9afa9,null))[_0x10bd('0x13')](function(_0x43e1e4){if(_0x43e1e4){return _0x43e1e4[_0x10bd('0x70')](_0x2cc68e[_0x10bd('0x4e')]['ids']);}})[_0x10bd('0x13')](respondWithStatusCode(_0x9afa9,null))[_0x10bd('0x1d')](handleError(_0x9afa9,null));};exports[_0x10bd('0x71')]=function(_0x4cc149,_0x12368d){if(_0x4cc149[_0x10bd('0x64')]['id']){delete _0x4cc149['body']['id'];}return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x4cc149[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x12368d,null))['then'](function(_0x410a5d){if(_0x410a5d){_0x4cc149[_0x10bd('0x64')][_0x10bd('0x6f')]=_0x410a5d['id'];return db[_0x10bd('0x72')][_0x10bd('0x6c')](_0x4cc149[_0x10bd('0x64')]);}})[_0x10bd('0x13')](respondWithResult(_0x12368d,null))[_0x10bd('0x1d')](handleError(_0x12368d,null));};exports[_0x10bd('0x73')]=function(_0x480f50,_0x502575){var _0x3b0678={'raw':![],'where':{}};var _0x5bcab9={};var _0x265498={'count':0x0,'rows':[]};return db['MailAccount'][_0x10bd('0x6e')]({'where':{'id':_0x480f50['params']['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x502575,null))[_0x10bd('0x13')](function(_0x3891f3){if(_0x3891f3){_0x5bcab9[_0x10bd('0x4d')]=_[_0x10bd('0x4f')](db[_0x10bd('0x72')][_0x10bd('0x4a')]);_0x5bcab9[_0x10bd('0x4e')]=_[_0x10bd('0x4f')](_0x480f50[_0x10bd('0x4e')]);_0x5bcab9['filters']=_['intersection'](_0x5bcab9['model'],_0x5bcab9[_0x10bd('0x4e')]);_0x3b0678[_0x10bd('0x51')]=_[_0x10bd('0x50')](_0x5bcab9[_0x10bd('0x4d')],qs[_0x10bd('0x52')](_0x480f50[_0x10bd('0x4e')][_0x10bd('0x52')]));_0x3b0678['attributes']=_0x3b0678[_0x10bd('0x51')][_0x10bd('0x53')]?_0x3b0678[_0x10bd('0x51')]:_0x5bcab9[_0x10bd('0x4d')];if(!_0x480f50[_0x10bd('0x4e')][_0x10bd('0x54')](_0x10bd('0x55'))){_0x3b0678[_0x10bd('0x21')]=qs[_0x10bd('0x21')](_0x480f50[_0x10bd('0x4e')][_0x10bd('0x21')]);_0x3b0678[_0x10bd('0x24')]=qs[_0x10bd('0x24')](_0x480f50['query'][_0x10bd('0x24')]);}_0x3b0678[_0x10bd('0x56')]=qs[_0x10bd('0x57')](_0x480f50[_0x10bd('0x4e')][_0x10bd('0x57')]);_0x3b0678[_0x10bd('0x58')]=qs[_0x10bd('0x59')](_[_0x10bd('0x5a')](_0x480f50[_0x10bd('0x4e')],_0x5bcab9[_0x10bd('0x59')]));_0x3b0678['where'][_0x10bd('0x6f')]=_0x3891f3['id'];if(_0x480f50[_0x10bd('0x4e')][_0x10bd('0x5b')]){_0x3b0678['where']=_[_0x10bd('0x5c')](_0x3b0678[_0x10bd('0x58')],{'$or':_[_0x10bd('0x48')](_0x3b0678['attributes'],function(_0x9523e0){var _0x194f2f={};_0x194f2f[_0x9523e0]={'$like':'%'+_0x480f50[_0x10bd('0x4e')]['filter']+'%'};return _0x194f2f;})});}_0x3b0678=_[_0x10bd('0x5c')]({},_0x3b0678,_0x480f50['options']);return db[_0x10bd('0x72')][_0x10bd('0x23')]({'where':_0x3b0678[_0x10bd('0x58')]})['then'](function(_0x3ace69){_0x265498[_0x10bd('0x23')]=_0x3ace69;if(_0x480f50['query'][_0x10bd('0x5f')]){_0x3b0678['include']=[{'all':!![]}];}return db[_0x10bd('0x72')]['findAll'](_0x3b0678);})[_0x10bd('0x13')](function(_0x1eea11){_0x265498[_0x10bd('0x62')]=_0x1eea11;return _0x265498;});}})[_0x10bd('0x13')](respondWithFilteredResult(_0x502575,_0x3b0678))[_0x10bd('0x1d')](handleError(_0x502575,null));};exports[_0x10bd('0x74')]=function(_0x1f9fe4,_0x1c49c8){return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x1f9fe4['params']['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x1c49c8,null))[_0x10bd('0x13')](function(_0x330051){if(_0x330051){return _0x330051[_0x10bd('0x74')](_0x1f9fe4[_0x10bd('0x4e')][_0x10bd('0x75')]);}})[_0x10bd('0x13')](respondWithStatusCode(_0x1c49c8,null))['catch'](handleError(_0x1c49c8,null));};exports[_0x10bd('0x6c')]=function(_0xb56f15,_0x18a1c4){var _0x20e541={'name':_0xb56f15[_0x10bd('0x64')][_0x10bd('0x2c')],'key':_0xb56f15[_0x10bd('0x64')][_0x10bd('0x4c')],'provider':_0xb56f15[_0x10bd('0x64')][_0x10bd('0x65')]===_0x10bd('0x66')?null:_0xb56f15[_0x10bd('0x64')][_0x10bd('0x65')],'email':_0xb56f15[_0x10bd('0x64')][_0x10bd('0x76')],'ListId':_0xb56f15[_0x10bd('0x64')][_0x10bd('0x77')],'active':!_[_0x10bd('0x78')](_0xb56f15[_0x10bd('0x64')][_0x10bd('0x79')])?_0xb56f15[_0x10bd('0x64')]['active']:!![],'description':_0xb56f15[_0x10bd('0x64')][_0x10bd('0x7a')]||null};var _0xf53703=getAuthenticationOptions(_0x20e541[_0x10bd('0x65')],_0xb56f15['body']);_0x20e541[_0x10bd('0x43')]=_0xf53703[_0x10bd('0x43')];_0x20e541['Smtp']=_0xf53703[_0x10bd('0x44')];return db[_0x10bd('0x49')][_0x10bd('0x6c')](_0x20e541,{'include':[{'model':db[_0x10bd('0x68')],'as':_0x10bd('0x44')},{'model':db[_0x10bd('0x45')],'as':_0x10bd('0x43')}]})[_0x10bd('0x13')](function(_0x2f7171){var _0x35d57d=_0xb56f15[_0x10bd('0x38')]['get']({'plain':!![]});if(!_0x35d57d)throw new Error(_0x10bd('0x7b'));if(_0x35d57d[_0x10bd('0x7c')]===_0x10bd('0x38')){var _0x567d36=_0x2f7171[_0x10bd('0x29')]({'plain':!![]});return db[_0x10bd('0x7d')]['find']({'where':{'name':_0x10bd('0x7e'),'userProfileId':_0x35d57d[_0x10bd('0x7f')]},'raw':!![]})['then'](function(_0x39459c){if(_0x39459c&&_0x39459c[_0x10bd('0x80')]===0x0){return db[_0x10bd('0x2a')][_0x10bd('0x6c')]({'name':_0x567d36[_0x10bd('0x2c')],'resourceId':_0x567d36['id'],'type':_0x39459c[_0x10bd('0x2c')],'sectionId':_0x39459c['id']},{})[_0x10bd('0x13')](function(){return _0x2f7171;});}else{return _0x2f7171;}})[_0x10bd('0x1d')](function(_0x18e0e7){logger[_0x10bd('0x18')](_0x10bd('0x81'),_0x18e0e7);throw _0x18e0e7;});}return _0x2f7171;})[_0x10bd('0x13')](respondWithResult(_0x18a1c4,0xc9))[_0x10bd('0x1d')](handleError(_0x18a1c4,null));};exports[_0x10bd('0x82')]=function(_0x424eff,_0x3d878e){return db['MailAccount'][_0x10bd('0x6e')]({'where':{'id':_0x424eff['params']['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x3d878e,null))[_0x10bd('0x13')](function(_0x2d57b8){if(_0x2d57b8){return _0x2d57b8['getImap']();}return null;})[_0x10bd('0x13')](respondWithResult(_0x3d878e,null))[_0x10bd('0x1d')](handleError(_0x3d878e,null));};exports[_0x10bd('0x83')]=function(_0x5d7594,_0x1d1518){if(_0x5d7594[_0x10bd('0x64')]['id']){delete _0x5d7594[_0x10bd('0x64')]['id'];}return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x5d7594[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x1d1518,null))['then'](function(_0x3c6b6e){if(_0x3c6b6e){_0x5d7594[_0x10bd('0x64')][_0x10bd('0x6f')]=_0x3c6b6e['id'];return db[_0x10bd('0x45')]['create'](_0x5d7594[_0x10bd('0x64')]);}})[_0x10bd('0x13')](respondWithResult(_0x1d1518,null))[_0x10bd('0x1d')](handleError(_0x1d1518,null));};exports['removeImap']=function(_0x5c52ff,_0x543d80){return db[_0x10bd('0x49')]['findOne']({'where':{'id':_0x5c52ff[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x543d80,null))['then'](function(_0x4b78e5){if(_0x4b78e5){return _0x4b78e5[_0x10bd('0x84')](null);}return null;})[_0x10bd('0x13')](respondWithStatusCode(_0x543d80,null))[_0x10bd('0x1d')](handleError(_0x543d80,null));};exports[_0x10bd('0x85')]=function(_0x494915,_0x16e52f){return db[_0x10bd('0x49')][_0x10bd('0x6e')]({'where':{'id':_0x494915[_0x10bd('0x67')]['id']}})['then'](handleEntityNotFound(_0x16e52f,null))[_0x10bd('0x13')](function(_0x407e11){if(_0x407e11){return _0x407e11[_0x10bd('0x85')]();}return null;})[_0x10bd('0x13')](respondWithResult(_0x16e52f,null))[_0x10bd('0x1d')](handleError(_0x16e52f,null));};exports['addSmtp']=function(_0x201ed8,_0x400397){if(_0x201ed8[_0x10bd('0x64')]['id']){delete _0x201ed8[_0x10bd('0x64')]['id'];}return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x201ed8[_0x10bd('0x67')]['id']}})['then'](handleEntityNotFound(_0x400397,null))['then'](function(_0x4aef83){if(_0x4aef83){_0x201ed8[_0x10bd('0x64')][_0x10bd('0x6f')]=_0x4aef83['id'];return db[_0x10bd('0x68')][_0x10bd('0x6c')](_0x201ed8[_0x10bd('0x64')]);}})[_0x10bd('0x13')](respondWithResult(_0x400397,null))[_0x10bd('0x1d')](handleError(_0x400397,null));};exports[_0x10bd('0x86')]=function(_0x584ba8,_0xf22f2c){return db[_0x10bd('0x49')][_0x10bd('0x6e')]({'where':{'id':_0x584ba8[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0xf22f2c,null))[_0x10bd('0x13')](function(_0x44c664){if(_0x44c664){return _0x44c664[_0x10bd('0x87')](null);}return null;})[_0x10bd('0x13')](respondWithStatusCode(_0xf22f2c,null))[_0x10bd('0x1d')](handleError(_0xf22f2c,null));};exports[_0x10bd('0x88')]=function(_0x481aa0,_0x37b165){return db[_0x10bd('0x89')]['find']({'where':{'id':_0x481aa0[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x37b165,null))[_0x10bd('0x13')](function(_0x12e307){if(_0x12e307){return _0x12e307[_0x10bd('0x88')](_0x481aa0['body'][_0x10bd('0x75')],_[_0x10bd('0x8a')](_0x481aa0['body'],[_0x10bd('0x75'),'id'])||{});}})[_0x10bd('0x13')](respondWithResult(_0x37b165,null))['catch'](handleError(_0x37b165,null));};exports[_0x10bd('0x8b')]=function(_0x3a1f60,_0x40d12d){var _0x4d0e38={'raw':![],'where':{}};var _0x1775fb={};var _0x2d61fc={'count':0x0,'rows':[]};return db['MailAccount'][_0x10bd('0x6e')]({'where':{'id':_0x3a1f60['params']['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x40d12d,null))['then'](function(_0x4c053c){if(_0x4c053c){_0x1775fb[_0x10bd('0x4d')]=_['keys'](db['MailInteraction'][_0x10bd('0x4a')]);_0x1775fb[_0x10bd('0x4e')]=_[_0x10bd('0x4f')](_0x3a1f60[_0x10bd('0x4e')]);_0x1775fb['filters']=_[_0x10bd('0x50')](_0x1775fb[_0x10bd('0x4d')],_0x1775fb[_0x10bd('0x4e')]);_0x4d0e38[_0x10bd('0x51')]=_[_0x10bd('0x50')](_0x1775fb[_0x10bd('0x4d')],qs[_0x10bd('0x52')](_0x3a1f60[_0x10bd('0x4e')][_0x10bd('0x52')]));_0x4d0e38[_0x10bd('0x51')]=_0x4d0e38[_0x10bd('0x51')][_0x10bd('0x53')]?_0x4d0e38['attributes']:_0x1775fb['model'];if(!_0x3a1f60[_0x10bd('0x4e')][_0x10bd('0x54')](_0x10bd('0x55'))){_0x4d0e38[_0x10bd('0x21')]=qs[_0x10bd('0x21')](_0x3a1f60['query'][_0x10bd('0x21')]);_0x4d0e38['offset']=qs[_0x10bd('0x24')](_0x3a1f60[_0x10bd('0x4e')][_0x10bd('0x24')]);}_0x4d0e38[_0x10bd('0x56')]=qs[_0x10bd('0x57')](_0x3a1f60['query'][_0x10bd('0x57')]);_0x4d0e38[_0x10bd('0x58')]=qs[_0x10bd('0x59')](_[_0x10bd('0x5a')](_0x3a1f60[_0x10bd('0x4e')],_0x1775fb['filters']));_0x4d0e38[_0x10bd('0x58')][_0x10bd('0x6f')]=_0x4c053c['id'];if(_0x3a1f60['query'][_0x10bd('0x5b')]){_0x4d0e38['where']=_[_0x10bd('0x5c')](_0x4d0e38['where'],{'$or':_[_0x10bd('0x48')](_0x4d0e38['attributes'],function(_0x4a4a01){var _0x56360f={};_0x56360f[_0x4a4a01]={'$like':'%'+_0x3a1f60[_0x10bd('0x4e')][_0x10bd('0x5b')]+'%'};return _0x56360f;})});}_0x4d0e38=_[_0x10bd('0x5c')]({},_0x4d0e38,_0x3a1f60['options']);return db['MailInteraction'][_0x10bd('0x23')]({'where':_0x4d0e38['where']})[_0x10bd('0x13')](function(_0x393d34){_0x2d61fc[_0x10bd('0x23')]=_0x393d34;if(_0x3a1f60[_0x10bd('0x4e')][_0x10bd('0x5f')]){_0x4d0e38[_0x10bd('0x60')]=[{'model':db[_0x10bd('0x8c')],'as':_0x10bd('0x8d'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x10bd('0x2c'),_0x10bd('0x8e'),_0x10bd('0x8f')],'required':![]},{'model':db[_0x10bd('0x90')],'as':_0x10bd('0x91'),'attributes':['id','name','color'],'where':_0x3a1f60['query'][_0x10bd('0x92')]?{'id':_0x3a1f60[_0x10bd('0x4e')]['tag']}:undefined,'required':_0x3a1f60['query']['tag']?!![]:![]}];}return db[_0x10bd('0x89')][_0x10bd('0x61')](_0x4d0e38);})[_0x10bd('0x13')](function(_0x277a0b){_0x2d61fc['rows']=_0x277a0b;return _0x2d61fc;});}})[_0x10bd('0x13')](respondWithFilteredResult(_0x40d12d,_0x4d0e38))[_0x10bd('0x1d')](handleError(_0x40d12d,null));};exports[_0x10bd('0x93')]=function addApplications(_0x786dc2,_0x568298){var _0xf97d36=_0x786dc2[_0x10bd('0x67')]['id'];var _0xd365d6=_0x786dc2['body'];var _0xec8f39=0xc8;var _0x3b0632=null;return db[_0x10bd('0x94')][_0x10bd('0x95')]({'isolationLevel':db['sequelize'][_0x10bd('0x96')][_0x10bd('0x97')][_0x10bd('0x98')]},function(_0x1128b2){return db[_0x10bd('0x49')][_0x10bd('0x6e')]({'where':{'id':_0xf97d36},'transaction':_0x1128b2})[_0x10bd('0x13')](function(_0x4c6b7a){if(_0x4c6b7a){return db[_0x10bd('0x99')]['destroy']({'where':{'MailAccountId':_0xf97d36},'transaction':_0x1128b2})['then'](function(){var _0x4b8411=_[_0x10bd('0x48')](_0xd365d6,function(_0x43978b){_0x43978b['MailAccountId']=_0xf97d36;return _0x43978b;});return db[_0x10bd('0x99')][_0x10bd('0x9a')](_0x4b8411,{'transaction':_0x1128b2});});}else{_0xec8f39=0x194;_0x3b0632=[];}});})['then'](function(){if(_0xec8f39!==0x194){return db[_0x10bd('0x99')][_0x10bd('0x9b')]({'where':{'MailAccountId':_0xf97d36},'order':_0x10bd('0x9c')})[_0x10bd('0x13')](function(_0x4235c1){_0x3b0632=_0x4235c1;});}})['catch'](function(_0x7dac4){_0xec8f39=0x1f4;logger[_0x10bd('0x18')](_0x7dac4[_0x10bd('0x9d')]);if(_0x7dac4['name']){delete _0x7dac4[_0x10bd('0x2c')];}_0x3b0632=_0x7dac4;})[_0x10bd('0x9e')](function(){if(_0x3b0632===null){_0x568298['sendStatus'](_0xec8f39);}else{if(_0xec8f39===0x1f4){_0x568298['status'](_0xec8f39)[_0x10bd('0x2d')](_0x3b0632);}else{_0x568298['status'](_0xec8f39)[_0x10bd('0x27')](_0x3b0632);}}});};exports[_0x10bd('0x9f')]=function(_0x297ad6,_0x889503){var _0x335e73={};var _0x967342={};var _0x3615a5;var _0x17b720;return db['MailAccount']['findOne']({'where':{'id':_0x297ad6['params']['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x889503,null))[_0x10bd('0x13')](function(_0x8ac305){if(_0x8ac305){_0x3615a5=_0x8ac305;_0x967342[_0x10bd('0x4d')]=_[_0x10bd('0x4f')](db[_0x10bd('0x99')][_0x10bd('0x4a')]);_0x967342[_0x10bd('0x4e')]=_[_0x10bd('0x4f')](_0x297ad6[_0x10bd('0x4e')]);_0x967342[_0x10bd('0x59')]=_['intersection'](_0x967342['model'],_0x967342[_0x10bd('0x4e')]);_0x335e73[_0x10bd('0x51')]=_[_0x10bd('0x50')](_0x967342[_0x10bd('0x4d')],qs[_0x10bd('0x52')](_0x297ad6[_0x10bd('0x4e')][_0x10bd('0x52')]));_0x335e73['attributes']=_0x335e73[_0x10bd('0x51')][_0x10bd('0x53')]?_0x335e73[_0x10bd('0x51')]:_0x967342['model'];_0x335e73[_0x10bd('0x56')]=qs[_0x10bd('0x57')](_0x297ad6[_0x10bd('0x4e')]['sort']);_0x335e73[_0x10bd('0x58')]=qs['filters'](_[_0x10bd('0x5a')](_0x297ad6[_0x10bd('0x4e')],_0x967342['filters']));if(_0x297ad6[_0x10bd('0x4e')][_0x10bd('0x5b')]){_0x335e73[_0x10bd('0x58')]=_[_0x10bd('0x5c')](_0x335e73[_0x10bd('0x58')],{'$or':_[_0x10bd('0x48')](_0x335e73[_0x10bd('0x51')],function(_0x1ea006){var _0x2e48e5={};_0x2e48e5[_0x1ea006]={'$like':'%'+_0x297ad6[_0x10bd('0x4e')][_0x10bd('0x5b')]+'%'};return _0x2e48e5;})});}_0x335e73=_[_0x10bd('0x5c')]({},_0x335e73,_0x297ad6['options']);return _0x3615a5[_0x10bd('0x9f')](_0x335e73);}})[_0x10bd('0x13')](function(_0x231ecf){if(_0x231ecf){_0x17b720=_0x231ecf[_0x10bd('0x53')];if(!_0x297ad6['query'][_0x10bd('0x54')](_0x10bd('0x55'))){_0x335e73[_0x10bd('0x21')]=qs[_0x10bd('0x21')](_0x297ad6[_0x10bd('0x4e')][_0x10bd('0x21')]);_0x335e73[_0x10bd('0x24')]=qs[_0x10bd('0x24')](_0x297ad6[_0x10bd('0x4e')][_0x10bd('0x24')]);}return _0x3615a5[_0x10bd('0x9f')](_0x335e73);}})[_0x10bd('0x13')](function(_0x199247){if(_0x199247){return _0x199247?{'count':_0x17b720,'rows':_0x199247}:null;}})['then'](respondWithResult(_0x889503,null))[_0x10bd('0x1d')](handleError(_0x889503,null));};exports[_0x10bd('0xa0')]=function(_0x2cc6e5,_0x30efee){var _0x1308f3={'raw':!![],'where':{}};var _0x49fe6c={};var _0x55eacb={'count':0x0,'rows':[]};return db[_0x10bd('0x49')]['findOne']({'where':{'id':_0x2cc6e5[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x30efee,null))[_0x10bd('0x13')](function(_0x55c1af){if(_0x55c1af){_0x49fe6c[_0x10bd('0x4d')]=_['keys'](db[_0x10bd('0xa1')]['rawAttributes']);_0x49fe6c[_0x10bd('0x4e')]=_[_0x10bd('0x4f')](_0x2cc6e5[_0x10bd('0x4e')]);_0x49fe6c[_0x10bd('0x59')]=_[_0x10bd('0x50')](_0x49fe6c['model'],_0x49fe6c[_0x10bd('0x4e')]);_0x1308f3[_0x10bd('0x51')]=_[_0x10bd('0x50')](_0x49fe6c['model'],qs[_0x10bd('0x52')](_0x2cc6e5[_0x10bd('0x4e')][_0x10bd('0x52')]));_0x1308f3[_0x10bd('0x51')]=_0x1308f3[_0x10bd('0x51')]['length']?_0x1308f3[_0x10bd('0x51')]:_0x49fe6c[_0x10bd('0x4d')];if(!_0x2cc6e5[_0x10bd('0x4e')]['hasOwnProperty']('nolimit')){_0x1308f3['limit']=qs[_0x10bd('0x21')](_0x2cc6e5[_0x10bd('0x4e')][_0x10bd('0x21')]);_0x1308f3['offset']=qs[_0x10bd('0x24')](_0x2cc6e5[_0x10bd('0x4e')][_0x10bd('0x24')]);}_0x1308f3[_0x10bd('0x56')]=qs[_0x10bd('0x57')](_0x2cc6e5['query'][_0x10bd('0x57')]);_0x1308f3[_0x10bd('0x58')]=qs[_0x10bd('0x59')](_['pick'](_0x2cc6e5[_0x10bd('0x4e')],_0x49fe6c[_0x10bd('0x59')]));_0x1308f3['where'][_0x10bd('0x6f')]=_0x55c1af['id'];if(_0x2cc6e5[_0x10bd('0x4e')][_0x10bd('0x5b')]){_0x1308f3['where']=_[_0x10bd('0x5c')](_0x1308f3[_0x10bd('0x58')],{'$or':_[_0x10bd('0x48')](_0x1308f3['attributes'],function(_0x1c6434){var _0x34145a={};_0x34145a[_0x1c6434]={'$like':'%'+_0x2cc6e5[_0x10bd('0x4e')][_0x10bd('0x5b')]+'%'};return _0x34145a;})});}if(_0x2cc6e5[_0x10bd('0x4e')][_0x10bd('0xa2')]){var _0x42aed2=_0x2cc6e5['query'][_0x10bd('0xa2')][_0x10bd('0xa3')](',');var _0x30be8e={};_0x30be8e[_0x42aed2[0x0]]={'$gte':moment(_0x42aed2[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1308f3[_0x10bd('0x58')]=_[_0x10bd('0x5c')](_0x1308f3[_0x10bd('0x58')],_0x30be8e);}_0x1308f3=_[_0x10bd('0x5c')]({},_0x1308f3,_0x2cc6e5[_0x10bd('0x5e')]);return db[_0x10bd('0xa1')][_0x10bd('0x23')]({'where':_0x1308f3[_0x10bd('0x58')]})['then'](function(_0x55886c){_0x55eacb[_0x10bd('0x23')]=_0x55886c;if(_0x2cc6e5[_0x10bd('0x4e')][_0x10bd('0x5f')]){_0x1308f3[_0x10bd('0x60')]=[{'all':!![]}];}return db[_0x10bd('0xa1')][_0x10bd('0x61')](_0x1308f3);})[_0x10bd('0x13')](function(_0x28c53f){if(_0x2cc6e5[_0x10bd('0x4e')][_0x10bd('0xa4')]===_0x10bd('0xa5')){for(var _0x5b0371=0x0;_0x5b0371<_0x28c53f['length'];_0x5b0371++){_0x28c53f[_0x5b0371][_0x10bd('0x64')]=juice(_0x28c53f[_0x5b0371][_0x10bd('0x64')]);}}_0x55eacb[_0x10bd('0x62')]=_0x28c53f;return _0x55eacb;});}})[_0x10bd('0x13')](respondWithFilteredResult(_0x30efee,_0x1308f3))[_0x10bd('0x1d')](handleError(_0x30efee,null));};exports[_0x10bd('0x2d')]=function(_0x29a271,_0x36d880){var _0x5820ef,_0x2f228a={},_0x31198b;if(_0x29a271[_0x10bd('0x64')]['to']){_0x31198b=_0x29a271[_0x10bd('0x64')]['to'][_0x10bd('0xa3')](',')[0x0];}return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x29a271[_0x10bd('0x67')]['id']},'include':[{'model':db[_0x10bd('0xa6')],'as':'List','include':[{'model':db[_0x10bd('0x8c')],'as':'Contacts','where':{'email':_0x31198b},'limit':0x1,'order':[['updatedAt',_0x10bd('0xa7')]]}]},{'model':db[_0x10bd('0x68')],'as':_0x10bd('0x44'),'raw':!![],'include':[{'model':db[_0x10bd('0xa8')],'as':'CloudProvider','raw':!![]}]}]})[_0x10bd('0x13')](handleEntityNotFound(_0x36d880,null))['then'](function(_0x4de123){if(!_0x4de123)return;_0x5820ef=_0x4de123;if(!_0x4de123[_0x10bd('0x44')])throw new Error(_0x10bd('0xa9'));if(_[_0x10bd('0x78')](_0x29a271['body'][_0x10bd('0xaa')])){_0x29a271[_0x10bd('0x64')][_0x10bd('0xaa')]=util[_0x10bd('0xab')]('%s\x20<%s>',_0x4de123[_0x10bd('0x2c')],_0x4de123[_0x10bd('0x76')]||_0x4de123['Smtp']['user']);}if(_0x29a271[_0x10bd('0x64')]['attachments']&&_0x29a271['body'][_0x10bd('0xac')]['length']){for(var _0xc61ae0=0x0;_0xc61ae0<_0x29a271[_0x10bd('0x64')][_0x10bd('0xac')]['length'];_0xc61ae0+=0x1){_0x29a271['body'][_0x10bd('0xac')][_0xc61ae0]={'filename':_0x29a271['body'][_0x10bd('0xac')][_0xc61ae0][_0x10bd('0x2c')],'path':path['join'](config[_0x10bd('0xad')],_0x10bd('0xae'),_0x29a271[_0x10bd('0x64')][_0x10bd('0xac')][_0xc61ae0][_0x10bd('0xaf')])};}}var _0x1554e6=_0x4de123[_0x10bd('0xb0')]();return respondWithRpcPromise(_0x10bd('0xb1'),'sendMail',{'account':_0x1554e6,'message':_0x29a271['body']});})[_0x10bd('0x13')](function(_0x4d6f70){if(!_0x4d6f70)return;_0x2f228a=_0x4d6f70;if(!_0x5820ef[_0x10bd('0xb2')])throw new Error(_0x10bd('0xb3'));if(_0x5820ef[_0x10bd('0xb2')]['Contacts']['length'])return _0x5820ef[_0x10bd('0xb2')][_0x10bd('0xb4')][0x0];return db['CmContact'][_0x10bd('0x6c')](_['defaults'](_0x29a271[_0x10bd('0x64')],{'firstName':_0x29a271[_0x10bd('0x64')]['to'],'email':_0x29a271['body']['to'],'phone':_0x29a271[_0x10bd('0x64')]['to'],'ListId':_0x5820ef['ListId']}));})[_0x10bd('0x13')](function(_0x3467a1){if(!_0x3467a1)return;var _0xf35c72={'UserId':_0x29a271[_0x10bd('0x38')]['id'],'ContactId':_0x3467a1['id'],'MailAccountId':_0x5820ef['id'],'inReplyTo':_0x2f228a[_0x10bd('0xb5')],'to':_0x29a271[_0x10bd('0x64')][_0x10bd('0xaa')],'cc':_0x29a271[_0x10bd('0x64')]['cc'],'subject':_0x29a271['body'][_0x10bd('0xb6')],'attach':_0x29a271[_0x10bd('0x64')][_0x10bd('0xb7')],'firstMsgDirection':_0x10bd('0xb8'),'lastMsgAt':moment()[_0x10bd('0xab')](_0x10bd('0xb9')),'lastMsgDirection':_0x10bd('0xb8'),'Messages':[_[_0x10bd('0x5c')](_0x29a271['body'],{'messageId':_0x2f228a[_0x10bd('0xb5')],'sentAt':moment()[_0x10bd('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5820ef['id'],'UserId':_0x29a271[_0x10bd('0x38')]['id'],'ContactId':_0x3467a1['id']})]};if(_0x29a271[_0x10bd('0x64')][_0x10bd('0xba')]){_0xf35c72=_[_0x10bd('0x5c')](_0xf35c72,_0x29a271[_0x10bd('0x64')][_0x10bd('0xba')]);}return db['MailInteraction'][_0x10bd('0x6c')](_0xf35c72,{'include':[{'model':db[_0x10bd('0xa1')],'as':'Messages'}]});})[_0x10bd('0x13')](respondWithResult(_0x36d880,null))['catch'](handleError(_0x36d880,null));};exports[_0x10bd('0xbb')]=function(_0x1fdc83,_0x379bed){return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x1fdc83[_0x10bd('0x67')]['id']},'include':[{'model':db[_0x10bd('0x68')],'as':_0x10bd('0x44'),'raw':!![],'include':[{'model':db[_0x10bd('0xa8')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x379bed,null))[_0x10bd('0x13')](function(_0x56519e){if(!_0x56519e[_0x10bd('0x44')])return;var _0x3030fd=_0x56519e[_0x10bd('0xb0')]();return respondWithRpcPromise('VerifySmtp',_0x10bd('0xbb'),{'account':_0x3030fd});})[_0x10bd('0x13')](respondWithResult(_0x379bed,null))[_0x10bd('0x1d')](handleError(_0x379bed,null));};exports[_0x10bd('0x2b')]=function(_0x2aa202,_0x1a133c){return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x2aa202['params']['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x1a133c,null))['then'](function(_0xb13fa7){if(_0xb13fa7&&_0xb13fa7['service']){throw new db[(_0x10bd('0xbc'))][(_0x10bd('0xbd'))](_0x10bd('0xbe'));}return _0xb13fa7;})['then'](removeEntity(_0x1a133c,null))[_0x10bd('0x1d')](handleError(_0x1a133c,null));};exports[_0x10bd('0xbf')]=function(_0x30827f,_0x90a087){return db['MailAccount'][_0x10bd('0x63')]({'where':{'id':_0x30827f[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x90a087,null))[_0x10bd('0x13')](function(_0xc0c362){if(_0xc0c362){return _0xc0c362[_0x10bd('0xbf')](_0x30827f[_0x10bd('0x64')][_0x10bd('0x75')],_[_0x10bd('0x8a')](_0x30827f['body'],[_0x10bd('0x75'),'id'])||{})[_0x10bd('0xc0')](function(_0x5b7036){for(var _0x85a795=0x0;_0x85a795<_0x30827f[_0x10bd('0x64')][_0x10bd('0x75')]['length'];_0x85a795+=0x1){socket['emit'](_0x10bd('0xc1'),{'UserId':Number(_0x30827f[_0x10bd('0x64')][_0x10bd('0x75')][_0x85a795]),'MailAccountId':Number(_0x30827f['params']['id'])});}return _0x5b7036;});}})['then'](respondWithResult(_0x90a087,null))['catch'](handleError(_0x90a087,null));};exports['removeAgents']=function(_0x507a55,_0x1c2fcb){return db[_0x10bd('0x49')][_0x10bd('0x63')]({'where':{'id':_0x507a55[_0x10bd('0x67')]['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x1c2fcb,null))[_0x10bd('0x13')](function(_0x13a2b8){if(_0x13a2b8){return _0x13a2b8[_0x10bd('0xc2')](_0x507a55[_0x10bd('0x4e')]['ids'])['then'](function(){if(_[_0x10bd('0xc3')](_0x507a55[_0x10bd('0x4e')][_0x10bd('0x75')])){for(var _0x1d005d=0x0;_0x1d005d<_0x507a55[_0x10bd('0x4e')][_0x10bd('0x75')][_0x10bd('0x53')];_0x1d005d+=0x1){socket[_0x10bd('0xc4')](_0x10bd('0xc5'),{'UserId':Number(_0x507a55['query'][_0x10bd('0x75')][_0x1d005d]),'MailAccountId':Number(_0x507a55[_0x10bd('0x67')]['id'])});}}else{socket[_0x10bd('0xc4')](_0x10bd('0xc5'),{'UserId':Number(_0x507a55['query'][_0x10bd('0x75')]),'MailAccountId':Number(_0x507a55[_0x10bd('0x67')]['id'])});}});}})[_0x10bd('0x13')](respondWithStatusCode(_0x1c2fcb,null))[_0x10bd('0x1d')](handleError(_0x1c2fcb,null));};exports[_0x10bd('0xc6')]=function(_0x303852,_0x2debab){var _0x966ab8={};var _0x263cbe={};var _0x31d494;var _0x298389;return db[_0x10bd('0x49')][_0x10bd('0x6e')]({'where':{'id':_0x303852['params']['id']}})[_0x10bd('0x13')](handleEntityNotFound(_0x2debab,null))['then'](function(_0x2d22f5){if(_0x2d22f5){_0x31d494=_0x2d22f5;_0x263cbe[_0x10bd('0x4d')]=_['keys'](db[_0x10bd('0xc7')][_0x10bd('0x4a')]);_0x263cbe[_0x10bd('0x4e')]=_['keys'](_0x303852[_0x10bd('0x4e')]);_0x263cbe[_0x10bd('0x59')]=_['intersection'](_0x263cbe[_0x10bd('0x4d')],_0x263cbe[_0x10bd('0x4e')]);_0x966ab8['attributes']=_[_0x10bd('0x50')](_0x263cbe[_0x10bd('0x4d')],qs[_0x10bd('0x52')](_0x303852[_0x10bd('0x4e')]['fields']));_0x966ab8[_0x10bd('0x51')]=_0x966ab8['attributes'][_0x10bd('0x53')]?_0x966ab8[_0x10bd('0x51')]:_0x263cbe[_0x10bd('0x4d')];_0x966ab8[_0x10bd('0x56')]=qs['sort'](_0x303852[_0x10bd('0x4e')]['sort']);_0x966ab8[_0x10bd('0x58')]=qs[_0x10bd('0x59')](_['pick'](_0x303852['query'],_0x263cbe[_0x10bd('0x59')]));if(_0x303852[_0x10bd('0x4e')]['filter']){_0x966ab8[_0x10bd('0x58')]=_[_0x10bd('0x5c')](_0x966ab8['where'],{'$or':_[_0x10bd('0x48')](_0x966ab8[_0x10bd('0x51')],function(_0x22aa41){var _0x8caeb7={};_0x8caeb7[_0x22aa41]={'$like':'%'+_0x303852['query'][_0x10bd('0x5b')]+'%'};return _0x8caeb7;})});}_0x966ab8=_[_0x10bd('0x5c')]({},_0x966ab8,_0x303852[_0x10bd('0x5e')]);return _0x31d494[_0x10bd('0xc6')](_0x966ab8);}})[_0x10bd('0x13')](function(_0x5da1be){if(_0x5da1be){_0x298389=_0x5da1be[_0x10bd('0x53')];if(!_0x303852['query'][_0x10bd('0x54')](_0x10bd('0x55'))){_0x966ab8[_0x10bd('0x21')]=qs[_0x10bd('0x21')](_0x303852[_0x10bd('0x4e')][_0x10bd('0x21')]);_0x966ab8[_0x10bd('0x24')]=qs[_0x10bd('0x24')](_0x303852[_0x10bd('0x4e')][_0x10bd('0x24')]);}return _0x31d494[_0x10bd('0xc6')](_0x966ab8);}})[_0x10bd('0x13')](function(_0xf02eea){if(_0xf02eea){return _0xf02eea?{'count':_0x298389,'rows':_0xf02eea}:null;}})[_0x10bd('0x13')](respondWithResult(_0x2debab,null))['catch'](handleError(_0x2debab,null));};
\ No newline at end of file
index 7db9c4e..bc9a2a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd43e=['events','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd43e,0x88));var _0xed43=function(_0x4b3680,_0x4026b6){_0x4b3680=_0x4b3680-0x0;var _0x14ec1b=_0xd43e[_0x4b3680];return _0x14ec1b;};'use strict';var EventEmitter=require(_0xed43('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xed43('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xed43('0x2')](0x0);var events={'afterCreate':_0xed43('0x3'),'afterUpdate':_0xed43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5749a9){return function(_0x2c4a41,_0x2c6a4b,_0x269f36){MailAccountEvents[_0xed43('0x5')](_0x5749a9+':'+_0x2c4a41['id'],_0x2c4a41);MailAccountEvents['emit'](_0x5749a9,_0x2c4a41);_0x269f36(null);};}for(var e in events){if(events[_0xed43('0x6')](e)){var event=events[e];MailAccount[_0xed43('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
+var _0xd819=['exports','../../mysqldb','MailAccount','setMaxListeners','save','remove','emit','hook'];(function(_0x4828b1,_0x5c8cf3){var _0x1fec1b=function(_0x3f2e5a){while(--_0x3f2e5a){_0x4828b1['push'](_0x4828b1['shift']());}};_0x1fec1b(++_0x5c8cf3);}(_0xd819,0x181));var _0x9d81=function(_0x4dbbdc,_0x1eb315){_0x4dbbdc=_0x4dbbdc-0x0;var _0x3b4842=_0xd819[_0x4dbbdc];return _0x3b4842;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x9d81('0x0'))['db'][_0x9d81('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9d81('0x2')](0x0);var events={'afterCreate':_0x9d81('0x3'),'afterUpdate':'update','afterDestroy':_0x9d81('0x4')};function emitEvent(_0x5591a5){return function(_0x301265,_0x53ff09,_0x382cc1){MailAccountEvents[_0x9d81('0x5')](_0x5591a5+':'+_0x301265['id'],_0x301265);MailAccountEvents[_0x9d81('0x5')](_0x5591a5,_0x301265);_0x382cc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x9d81('0x6')](e,emitEvent(event));}}module[_0x9d81('0x7')]=MailAccountEvents;
\ No newline at end of file
index e135cbb..69fe6fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bda=['path','rimraf','../../config/environment','exports','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2449bd,_0x36465e){var _0x5c69bb=function(_0x3b45d1){while(--_0x3b45d1){_0x2449bd['push'](_0x2449bd['shift']());}};_0x5c69bb(++_0x36465e);}(_0x6bda,0xaf));var _0xa6bd=function(_0x415089,_0x1ce08a){_0x415089=_0x415089-0x0;var _0xecc30f=_0x6bda[_0x415089];return _0xecc30f;};'use strict';var _=require(_0xa6bd('0x0'));var util=require(_0xa6bd('0x1'));var logger=require(_0xa6bd('0x2'))(_0xa6bd('0x3'));var moment=require(_0xa6bd('0x4'));var BPromise=require(_0xa6bd('0x5'));var rp=require(_0xa6bd('0x6'));var fs=require('fs');var path=require(_0xa6bd('0x7'));var rimraf=require(_0xa6bd('0x8'));var config=require(_0xa6bd('0x9'));var attributes=require('./mailAccount.attributes');module[_0xa6bd('0xa')]=function(_0x4857cc,_0x43aabe){return _0x4857cc['define'](_0xa6bd('0xb'),attributes,{'tableName':_0xa6bd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8853=['provider','service','host','port','Smtp','secure','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','CloudProvider','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts'];(function(_0x5b2d6d,_0xd8a7e5){var _0x73c3d3=function(_0x2917e7){while(--_0x2917e7){_0x5b2d6d['push'](_0x5b2d6d['shift']());}};_0x73c3d3(++_0xd8a7e5);}(_0x8853,0xd8));var _0x3885=function(_0x5ccd8e,_0x3f0762){_0x5ccd8e=_0x5ccd8e-0x0;var _0x4f1f4c=_0x8853[_0x5ccd8e];return _0x4f1f4c;};'use strict';var attributes=require(_0x3885('0x0'));module[_0x3885('0x1')]=function(_0x150e6c){return _0x150e6c[_0x3885('0x2')](_0x3885('0x3'),attributes,{'tableName':_0x3885('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2b5665=this;var _0xa21979={'id':_0x2b5665['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2b5665[_0x3885('0x5')]!=='custom'){_0xa21979[_0x3885('0x6')]=_0x2b5665[_0x3885('0x5')];}else{_0xa21979[_0x3885('0x7')]=_0x2b5665['Smtp']['host'];_0xa21979[_0x3885('0x8')]=_0x2b5665[_0x3885('0x9')][_0x3885('0x8')];_0xa21979[_0x3885('0xa')]=_0x2b5665[_0x3885('0x9')][_0x3885('0xa')];}if(_0x2b5665[_0x3885('0x9')]['authentication']){if(_0x2b5665[_0x3885('0x9')]['modernAuthentication']){if(!_0x2b5665[_0x3885('0x9')]['CloudProvider'])throw new Error(_0x3885('0xb'));_0xa21979[_0x3885('0xc')]={'type':_0x3885('0xd'),'user':_0x2b5665['Smtp'][_0x3885('0xe')],'accessToken':_0x2b5665[_0x3885('0x9')][_0x3885('0xf')]['data5']};}else{_0xa21979[_0x3885('0xc')]={'user':_0x2b5665[_0x3885('0x9')][_0x3885('0xe')],'pass':_0x2b5665[_0x3885('0x9')][_0x3885('0x10')]};}}return _0xa21979;}}});};
\ No newline at end of file
index a809ce3..b8193ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7046=['MailApplication','Applications','Smtp','get','account','omit','applications','list','orderBy','asc','autoclose','push','close','Contacts','length','defaults','contact','messageId','generate','subject','attach','format','MailInteraction','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','create','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailAccount.socket','register','request','info','debug','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','MailAccount','options','where','attributes','limit','map','include','model','then','GetMailAccount','catch','ShowMailAccount','find','raw','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List'];(function(_0x1c00dc,_0x32330e){var _0x12a4d7=function(_0x48cef1){while(--_0x48cef1){_0x1c00dc['push'](_0x1c00dc['shift']());}};_0x12a4d7(++_0x32330e);}(_0x7046,0x102));var _0x6704=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7046[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require('bluebird');var rs=require(_0x6704('0x3'));var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6704('0x6'))(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232c});config[_0x6704('0xc')]=_['defaults'](config[_0x6704('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6704('0xd'))(new Redis(config[_0x6704('0xc')]));require(_0x6704('0xe'))[_0x6704('0xf')](socket);function respondWithRpcPromise(_0x291869,_0x5ee387,_0x1ecce8){return new BPromise(function(_0x395894,_0x46e663){return client[_0x6704('0x10')](_0x291869,_0x1ecce8)['then'](function(_0x22ffec){logger[_0x6704('0x11')]('MailAccount,\x20%s,\x20%s',_0x5ee387,'request\x20sent');logger[_0x6704('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5ee387,_0x6704('0x13'),JSON[_0x6704('0x14')](_0x22ffec));if(_0x22ffec[_0x6704('0x15')]){if(_0x22ffec['error'][_0x6704('0x16')]===0x1f4){logger[_0x6704('0x15')](_0x6704('0x17'),_0x5ee387,_0x22ffec[_0x6704('0x15')]['message']);return _0x46e663(_0x22ffec[_0x6704('0x15')][_0x6704('0x18')]);}logger[_0x6704('0x15')]('MailAccount,\x20%s,\x20%s',_0x5ee387,_0x22ffec[_0x6704('0x15')][_0x6704('0x18')]);return _0x395894(_0x22ffec['error'][_0x6704('0x18')]);}else{logger[_0x6704('0x11')](_0x6704('0x17'),_0x5ee387,_0x6704('0x13'));_0x395894(_0x22ffec[_0x6704('0x19')][_0x6704('0x18')]);}})['catch'](function(_0xfcf5e5){logger[_0x6704('0x15')](_0x6704('0x17'),_0x5ee387,_0xfcf5e5);_0x46e663(_0xfcf5e5);});});}exports['GetMailAccount']=function(_0x1ba9d4){var _0x23b9a8=this;return new Promise(function(_0x14155c,_0x14a672){return db[_0x6704('0x1a')]['findAll']({'raw':_0x1ba9d4[_0x6704('0x1b')]?_0x1ba9d4[_0x6704('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1ba9d4[_0x6704('0x1b')]?_0x1ba9d4[_0x6704('0x1b')][_0x6704('0x1c')]||null:null,'attributes':_0x1ba9d4['options']?_0x1ba9d4['options'][_0x6704('0x1d')]||null:null,'limit':_0x1ba9d4['options']?_0x1ba9d4[_0x6704('0x1b')][_0x6704('0x1e')]||null:null,'include':_0x1ba9d4['options']?_0x1ba9d4['options']['include']?_[_0x6704('0x1f')](_0x1ba9d4['options'][_0x6704('0x20')],function(_0x1349df){return{'model':db[_0x1349df['model']],'as':_0x1349df['as'],'attributes':_0x1349df['attributes'],'include':_0x1349df[_0x6704('0x20')]?_[_0x6704('0x1f')](_0x1349df['include'],function(_0xffe3bd){return{'model':db[_0xffe3bd[_0x6704('0x21')]],'as':_0xffe3bd['as'],'attributes':_0xffe3bd[_0x6704('0x1d')],'include':_0xffe3bd[_0x6704('0x20')]?_['map'](_0xffe3bd[_0x6704('0x20')],function(_0x3e139c){return{'model':db[_0x3e139c['model']],'as':_0x3e139c['as'],'attributes':_0x3e139c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6704('0x22')](function(_0x264ffe){logger[_0x6704('0x11')](_0x6704('0x23'),_0x1ba9d4);logger['debug']('GetMailAccount',_0x1ba9d4,JSON[_0x6704('0x14')](_0x264ffe));_0x14155c(_0x264ffe);})[_0x6704('0x24')](function(_0xcd5276){logger[_0x6704('0x15')]('GetMailAccount',_0xcd5276['message'],_0x1ba9d4);_0x14a672(_0x23b9a8[_0x6704('0x15')](0x1f4,_0xcd5276['message']));});});};exports[_0x6704('0x25')]=function(_0x263bcb){var _0x25b990=this;return new Promise(function(_0x2bfe67,_0x17587b){return db['MailAccount'][_0x6704('0x26')]({'raw':_0x263bcb[_0x6704('0x1b')]?_0x263bcb['options'][_0x6704('0x27')]===undefined?!![]:![]:!![],'where':_0x263bcb[_0x6704('0x1b')]?_0x263bcb[_0x6704('0x1b')][_0x6704('0x1c')]||null:null,'attributes':_0x263bcb[_0x6704('0x1b')]?_0x263bcb['options'][_0x6704('0x1d')]||null:null,'include':_0x263bcb[_0x6704('0x1b')]?_0x263bcb[_0x6704('0x1b')][_0x6704('0x20')]?_[_0x6704('0x1f')](_0x263bcb[_0x6704('0x1b')]['include'],function(_0x5718d6){return{'model':db[_0x5718d6[_0x6704('0x21')]],'as':_0x5718d6['as'],'attributes':_0x5718d6[_0x6704('0x1d')],'include':_0x5718d6[_0x6704('0x20')]?_['map'](_0x5718d6[_0x6704('0x20')],function(_0x220423){return{'model':db[_0x220423['model']],'as':_0x220423['as'],'attributes':_0x220423[_0x6704('0x1d')],'include':_0x220423[_0x6704('0x20')]?_['map'](_0x220423[_0x6704('0x20')],function(_0x55212a){return{'model':db[_0x55212a[_0x6704('0x21')]],'as':_0x55212a['as'],'attributes':_0x55212a['attributes']};}):[]};}):[]};}):[]:[]})[_0x6704('0x22')](function(_0x61b189){logger[_0x6704('0x11')](_0x6704('0x25'),_0x263bcb);logger[_0x6704('0x12')](_0x6704('0x25'),_0x263bcb,JSON[_0x6704('0x14')](_0x61b189));_0x2bfe67(_0x61b189);})[_0x6704('0x24')](function(_0x17e527){logger[_0x6704('0x15')]('ShowMailAccount',_0x17e527[_0x6704('0x18')],_0x263bcb);_0x17587b(_0x25b990[_0x6704('0x15')](0x1f4,_0x17e527[_0x6704('0x18')]));});});};exports[_0x6704('0x28')]=function(_0x4a604e){var _0xf5ed9d=this;return new Promise(function(_0x5592eb,_0x5becd9){var _0x413c45={'body':_0x4a604e['body'],'channel':_0x6704('0x29')};var _0x20ed4f=_[_0x6704('0x2a')](_[_0x6704('0x2b')](db[_0x6704('0x2c')][_0x6704('0x2d')]),[_0x6704('0x2e'),_0x6704('0x2f'),'CompanyId',_0x6704('0x30')]);var _0x2aba82=![];if(_0x4a604e[_0x6704('0x31')]['id']){delete _0x4a604e[_0x6704('0x31')]['id'];}if(_[_0x6704('0x32')](_0x4a604e[_0x6704('0x31')][_0x6704('0x33')])){return _0x5becd9(_0xf5ed9d[_0x6704('0x15')](0x1f4,_0x6704('0x34')));}if(_[_0x6704('0x32')](_0x4a604e['body'][_0x6704('0x31')])||_0x4a604e['body'][_0x6704('0x31')]===''){return _0x5becd9(_0xf5ed9d[_0x6704('0x15')](0x1f4,_0x6704('0x35')));}if(_['isNil'](_0x4a604e[_0x6704('0x31')][_0x6704('0x36')])){return _0x5becd9(_0xf5ed9d[_0x6704('0x15')](0x1f4,_0x6704('0x37')+_0x20ed4f));}if(!_[_0x6704('0x38')](_0x20ed4f,_0x4a604e[_0x6704('0x31')][_0x6704('0x36')])){return _0x5becd9(_0xf5ed9d[_0x6704('0x15')](0x1f4,_0x6704('0x39')+_0x20ed4f));}var _0x438819={};_0x438819[_0x4a604e[_0x6704('0x31')][_0x6704('0x36')]]=_0x4a604e[_0x6704('0x31')][_0x6704('0x33')];return db[_0x6704('0x1a')][_0x6704('0x26')]({'where':{'id':_0x4a604e['account']['id']},'include':[{'model':db[_0x6704('0x3a')],'as':_0x6704('0x3b'),'include':[{'model':db[_0x6704('0x2c')],'as':'Contacts','where':_0x438819,'limit':0x1,'order':[[_0x6704('0x2f'),'DESC']]}]},{'model':db[_0x6704('0x3c')],'as':_0x6704('0x3d')},{'model':db['MailServerOut'],'as':_0x6704('0x3e')}]})[_0x6704('0x22')](function(_0x438163){if(_0x438163&&_0x438163[_0x6704('0x3b')]){var _0x2e6ae3=_0x438163[_0x6704('0x3f')]({'plain':!![]});_0x413c45[_0x6704('0x40')]=_[_0x6704('0x41')](_0x2e6ae3,[_0x6704('0x3d'),_0x6704('0x3b')]);_0x413c45[_0x6704('0x42')]=_0x2e6ae3[_0x6704('0x3d')];_0x413c45[_0x6704('0x43')]=_0x2e6ae3['List'];_0x413c45[_0x6704('0x42')]=_[_0x6704('0x44')](_0x413c45[_0x6704('0x42')],['priority'],[_0x6704('0x45')]);if(_0x413c45[_0x6704('0x40')]&&_0x413c45[_0x6704('0x40')][_0x6704('0x46')]){_0x413c45[_0x6704('0x42')][_0x6704('0x47')]({'id':0x0,'priority':_0x413c45[_0x6704('0x42')]['length']+0x1,'app':_0x6704('0x48'),'appdata':_0x6704('0x46'),'interval':'*,*,*,*'});}if(_0x413c45[_0x6704('0x40')]['Applications']){delete _0x413c45[_0x6704('0x40')][_0x6704('0x3d')];}if(_0x413c45[_0x6704('0x40')][_0x6704('0x3b')]){delete _0x413c45[_0x6704('0x40')][_0x6704('0x3b')];}if(_0x2e6ae3[_0x6704('0x3b')][_0x6704('0x49')][_0x6704('0x4a')]){return _0x2e6ae3[_0x6704('0x3b')][_0x6704('0x49')][0x0];}var _0x50f6f7=_[_0x6704('0x4b')](_0x4a604e[_0x6704('0x31')],{'firstName':_0x4a604e['body'][_0x6704('0x33')],'ListId':_0x2e6ae3[_0x6704('0x30')]});_0x50f6f7[_0x4a604e[_0x6704('0x31')][_0x6704('0x36')]]=_0x4a604e[_0x6704('0x31')]['from'];return db[_0x6704('0x2c')]['create'](_0x50f6f7);}else{throw new Error('List\x20not\x20found');}})[_0x6704('0x22')](function(_0x2facef){_0x413c45[_0x6704('0x4c')]=_0x2facef;if(_0x2facef){if(!_0x4a604e['body']['message'][_0x6704('0x4d')]){_0x4a604e['body'][_0x6704('0x18')][_0x6704('0x4d')]=rs[_0x6704('0x4e')]()+'\x20'+_0x4a604e[_0x6704('0x31')]['message'][_0x6704('0x33')];}var _0x39d6bc={'ContactId':_0x2facef['id'],'MailAccountId':_0x4a604e[_0x6704('0x40')]['id'],'inReplyTo':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x4d')],'to':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x33')],'cc':_0x4a604e[_0x6704('0x31')]['message']['cc'],'subject':_0x4a604e[_0x6704('0x31')]['message'][_0x6704('0x4f')],'attach':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x50')],'lastMsgAt':moment()[_0x6704('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x6704('0x52')][_0x6704('0x26')]({'where':{'closed':![],'MailAccountId':_0x4a604e[_0x6704('0x40')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x6704('0x4d')],'where':{'messageId':_0x4a604e[_0x6704('0x31')]['message'][_0x6704('0x53')]}}]})['then'](function(_0x3baff0){if(_0x3baff0){return[_0x3baff0,![]];}return db[_0x6704('0x52')]['create'](_0x39d6bc)[_0x6704('0x22')](function(_0x5e3526){return[_0x5e3526,!![]];});});}else{throw new Error(_0x6704('0x54'));}})[_0x6704('0x55')](function(_0x1edfa0,_0x2a8435){if(_0x1edfa0){_0x2aba82=_0x2a8435;if(!_0x2a8435){return _0x1edfa0[_0x6704('0x56')]({'inReplyTo':_0x4a604e[_0x6704('0x31')]['message'][_0x6704('0x4d')],'to':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x33')],'cc':_0x4a604e['body'][_0x6704('0x18')]['cc'],'subject':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x4f')],'attach':_0x1edfa0['attach']?_0x1edfa0[_0x6704('0x50')]:_0x4a604e[_0x6704('0x31')][_0x6704('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0x6704('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x1edfa0;}}})[_0x6704('0x22')](function(_0x301905){_0x413c45[_0x6704('0x57')]=_0x301905['get']({'plain':!![]});_0x413c45[_0x6704('0x57')][_0x6704('0x58')]=_0x2aba82;return db[_0x6704('0x59')][_0x6704('0x5a')]({'body':_0x4a604e[_0x6704('0x31')]['body'],'MailAccountId':_0x4a604e[_0x6704('0x40')]['id'],'MailInteractionId':_0x301905['id'],'direction':'in','ContactId':_0x413c45[_0x6704('0x4c')]['id'],'messageId':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x4d')],'from':_0x4a604e[_0x6704('0x31')]['message']['from'],'to':_0x4a604e['body'][_0x6704('0x18')]['to'],'cc':_0x4a604e[_0x6704('0x31')]['message']['cc'],'subject':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x4f')],'attach':_0x4a604e['body'][_0x6704('0x18')][_0x6704('0x50')],'Attachments':_0x4a604e['body'][_0x6704('0x18')][_0x6704('0x5b')],'originTo':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x5c')],'originCc':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x5d')],'bcc':_0x4a604e[_0x6704('0x31')]['message'][_0x6704('0x5e')],'ChatWebsiteId':_0x4a604e[_0x6704('0x31')][_0x6704('0x18')][_0x6704('0x5f')]||null,'originChannel':_0x4a604e[_0x6704('0x31')]['message'][_0x6704('0x60')]||'Email','ChatOfflineMessageId':_0x4a604e[_0x6704('0x31')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0x6704('0x61')}]});})[_0x6704('0x22')](function(_0x19a45a){_0x413c45['message']=_0x19a45a;if(_0x413c45[_0x6704('0x57')][_0x6704('0x62')]){return db[_0x6704('0x63')]['find']({'attributes':['id',_0x6704('0x64')],'where':{'id':_0x413c45[_0x6704('0x57')][_0x6704('0x62')]}})['then'](function(_0x48f9ac){if(_0x48f9ac){_0x413c45['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x6704('0x65'),'appdata':_0x48f9ac[_0x6704('0x64')]+','+(_0x413c45[_0x6704('0x40')][_0x6704('0x66')]||0xa),'interval':_0x6704('0x67')});}return respondWithRpcPromise('Start',_0x6704('0x68'),_0x413c45);});}return respondWithRpcPromise(_0x6704('0x69'),_0x6704('0x68'),_0x413c45);})[_0x6704('0x22')](function(_0x513e3b){_0x5592eb(_0x513e3b);})[_0x6704('0x24')](function(_0x376038){_0x5becd9(_0xf5ed9d['error'](0x1f4,_0x376038[_0x6704('0x18')]));});});};
\ No newline at end of file
+var _0x5f66=['../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','where','limit','include','map','model','attributes','stringify','find','smtp','smtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','CloudProvider','get','omit','getSmtpOptions','list','applications','orderBy','priority','autoclose','push','close','defaults','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','MailMessage','create','attachments','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','UserId','name','unshift','agent','*,*,*,*','startRouting','Start','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var BPromise=require('bluebird');var rs=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var db=require(_0x65f6('0x3'))['db'];var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x6'));var client=jayson['client'][_0x65f6('0x7')]({'port':0x232c});config[_0x65f6('0x8')]=_['defaults'](config['redis'],{'host':_0x65f6('0x9'),'port':0x18eb});var socket=require(_0x65f6('0xa'))(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0xb'))[_0x65f6('0xc')](socket);function respondWithRpcPromise(_0x14f4c7,_0x48d85c,_0x5123ee){return new BPromise(function(_0x18fea1,_0x2f6d5b){return client[_0x65f6('0xd')](_0x14f4c7,_0x5123ee)[_0x65f6('0xe')](function(_0x50d26d){logger[_0x65f6('0xf')]('MailAccount,\x20%s,\x20%s',_0x48d85c,'request\x20sent');logger[_0x65f6('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x48d85c,_0x65f6('0x11'),JSON['stringify'](_0x50d26d));if(_0x50d26d[_0x65f6('0x12')]){if(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x13')]===0x1f4){logger[_0x65f6('0x12')](_0x65f6('0x14'),_0x48d85c,_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);return _0x2f6d5b(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);}logger[_0x65f6('0x12')]('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x50d26d[_0x65f6('0x12')]['message']);return _0x18fea1(_0x50d26d['error'][_0x65f6('0x15')]);}else{logger[_0x65f6('0xf')](_0x65f6('0x14'),_0x48d85c,_0x65f6('0x11'));_0x18fea1(_0x50d26d[_0x65f6('0x16')][_0x65f6('0x15')]);}})[_0x65f6('0x17')](function(_0x18380e){logger['error']('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x18380e);_0x2f6d5b(_0x18380e);});});}exports[_0x65f6('0x18')]=function(_0x5b4055){var _0x4c81f3=this;return new Promise(function(_0x5c5b91,_0x365159){return db[_0x65f6('0x19')]['findAll']({'raw':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1c')]||null:null,'attributes':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')]['attributes']||null:null,'limit':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1d')]||null:null,'include':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x5b4055[_0x65f6('0x1a')]['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x20')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x21')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x20')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes'],'include':_0x29abdb[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x29abdb['include'],function(_0x325cb4){return{'model':db[_0x325cb4[_0x65f6('0x20')]],'as':_0x325cb4['as'],'attributes':_0x325cb4[_0x65f6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac04b){logger['info'](_0x65f6('0x18'),_0x5b4055);logger[_0x65f6('0x10')](_0x65f6('0x18'),_0x5b4055,JSON[_0x65f6('0x22')](_0x4ac04b));_0x5c5b91(_0x4ac04b);})[_0x65f6('0x17')](function(_0x14a387){logger[_0x65f6('0x12')]('GetMailAccount',_0x14a387['message'],_0x5b4055);_0x365159(_0x4c81f3[_0x65f6('0x12')](0x1f4,_0x14a387[_0x65f6('0x15')]));});});};exports['ShowMailAccount']=function(_0x4e50c0){var _0x10b368=this;return new Promise(function(_0x1ce43c,_0x11fe3b){return db[_0x65f6('0x19')][_0x65f6('0x23')]({'raw':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0['options'][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')]['where']||null:null,'attributes':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x21')]||null:null,'include':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')]?_['map'](_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x20')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1e')]?_['map'](_0x4f3e22[_0x65f6('0x1e')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x21')],'include':_0x24f7fd[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x24f7fd['include'],function(_0x582c7e){return{'model':db[_0x582c7e[_0x65f6('0x20')]],'as':_0x582c7e['as'],'attributes':_0x582c7e['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xe')](function(_0x4e6653){if(_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x24')]===!![])_0x4e6653['setDataValue'](_0x65f6('0x25'),_0x4e6653['getSmtpOptions']());logger['info'](_0x65f6('0x26'),_0x4e50c0);logger[_0x65f6('0x10')](_0x65f6('0x26'),_0x4e50c0,JSON[_0x65f6('0x22')](_0x4e6653));_0x1ce43c(_0x4e6653);})[_0x65f6('0x17')](function(_0x28845a){logger[_0x65f6('0x12')](_0x65f6('0x26'),_0x28845a['message'],_0x4e50c0);_0x11fe3b(_0x10b368[_0x65f6('0x12')](0x1f4,_0x28845a['message']));});});};exports[_0x65f6('0x27')]=function(_0xa4394a){var _0x4ba7db=this;return new Promise(function(_0x2ea7f7,_0x5ef5c2){var _0x32148f={'body':_0xa4394a[_0x65f6('0x28')],'channel':_0x65f6('0x29')};var _0x3fb1c6=_[_0x65f6('0x2a')](_[_0x65f6('0x2b')](db[_0x65f6('0x2c')][_0x65f6('0x2d')]),[_0x65f6('0x2e'),'updatedAt',_0x65f6('0x2f'),_0x65f6('0x30')]);var _0x377ae5=![];if(_0xa4394a[_0x65f6('0x28')]['id']){delete _0xa4394a[_0x65f6('0x28')]['id'];}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x65f6('0x33')));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')])||_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')]===''){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fb1c6));}if(!_[_0x65f6('0x35')](_0x3fb1c6,_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db['error'](0x1f4,_0x65f6('0x36')+_0x3fb1c6));}var _0x3386a2={};_0x3386a2[_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')]]=_0xa4394a['body'][_0x65f6('0x32')];return db['MailAccount'][_0x65f6('0x23')]({'where':{'id':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0x65f6('0x38'),'include':[{'model':db['CmContact'],'as':_0x65f6('0x39'),'where':_0x3386a2,'limit':0x1,'order':[[_0x65f6('0x3a'),_0x65f6('0x3b')]]}]},{'model':db[_0x65f6('0x3c')],'as':_0x65f6('0x3d')},{'model':db[_0x65f6('0x3e')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x65f6('0x3f')}]}]})[_0x65f6('0xe')](function(_0x3b647a){if(_0x3b647a&&_0x3b647a[_0x65f6('0x38')]){var _0x3b907c=_0x3b647a[_0x65f6('0x40')]({'plain':!![]});_0x32148f[_0x65f6('0x37')]=_[_0x65f6('0x41')](_0x3b907c,[_0x65f6('0x3d'),'List']);_0x32148f[_0x65f6('0x37')][_0x65f6('0x25')]=_0x3b647a[_0x65f6('0x42')]();_0x32148f['applications']=_0x3b907c[_0x65f6('0x3d')];_0x32148f[_0x65f6('0x43')]=_0x3b907c['List'];_0x32148f[_0x65f6('0x44')]=_[_0x65f6('0x45')](_0x32148f['applications'],[_0x65f6('0x46')],['asc']);if(_0x32148f[_0x65f6('0x37')]&&_0x32148f[_0x65f6('0x37')][_0x65f6('0x47')]){_0x32148f['applications'][_0x65f6('0x48')]({'id':0x0,'priority':_0x32148f[_0x65f6('0x44')]['length']+0x1,'app':_0x65f6('0x49'),'appdata':_0x65f6('0x47'),'interval':'*,*,*,*'});}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')];}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x38')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x38')];}if(_0x3b907c['List']['Contacts']['length']){return _0x3b907c[_0x65f6('0x38')][_0x65f6('0x39')][0x0];}var _0x111a8a=_[_0x65f6('0x4a')](_0xa4394a['body'],{'firstName':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')],'ListId':_0x3b907c[_0x65f6('0x30')]});_0x111a8a[_0xa4394a['body'][_0x65f6('0x34')]]=_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')];return db['CmContact']['create'](_0x111a8a);}else{throw new Error(_0x65f6('0x4b'));}})[_0x65f6('0xe')](function(_0x4125cb){_0x32148f[_0x65f6('0x4c')]=_0x4125cb;if(_0x4125cb){if(!_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]){_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]=rs[_0x65f6('0x4e')]()+'\x20'+_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')];}var _0x5ba9c6={'ContactId':_0x4125cb['id'],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a[_0x65f6('0x28')]['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x50')],'lastMsgAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x65f6('0x52')][_0x65f6('0x23')]({'where':{'closed':![],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':_0x65f6('0x53'),'attributes':[_0x65f6('0x4d')],'where':{'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x54')]}}]})[_0x65f6('0xe')](function(_0x5e4759){if(_0x5e4759){return[_0x5e4759,![]];}return db['MailInteraction']['create'](_0x5ba9c6)[_0x65f6('0xe')](function(_0x367d95){return[_0x367d95,!![]];});});}else{throw new Error(_0x65f6('0x55'));}})[_0x65f6('0x56')](function(_0xab6f0,_0x304cf9){if(_0xab6f0){_0x377ae5=_0x304cf9;if(!_0x304cf9){return _0xab6f0['update']({'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a['body'][_0x65f6('0x15')]['cc'],'subject':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x4f')],'attach':_0xab6f0[_0x65f6('0x50')]?_0xab6f0[_0x65f6('0x50')]:_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'substatus':null,'substatusAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x65f6('0x57')),'lastMsgDirection':'in'});}else{return _0xab6f0;}}})[_0x65f6('0xe')](function(_0x4a9524){_0x32148f[_0x65f6('0x58')]=_0x4a9524['get']({'plain':!![]});_0x32148f[_0x65f6('0x58')]['created']=_0x377ae5;return db[_0x65f6('0x59')][_0x65f6('0x5a')]({'body':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'MailInteractionId':_0x4a9524['id'],'direction':'in','ContactId':_0x32148f[_0x65f6('0x4c')]['id'],'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')],'from':_0xa4394a['body']['message'][_0x65f6('0x32')],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['to'],'cc':_0xa4394a['body']['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'Attachments':_0xa4394a['body']['message'][_0x65f6('0x5b')],'originTo':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x5c')],'originCc':_0xa4394a['body'][_0x65f6('0x15')][_0x65f6('0x5d')],'bcc':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['bcc'],'ChatWebsiteId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x5e')]||null,'originChannel':_0xa4394a['body']['message'][_0x65f6('0x5f')]||'Email','ChatOfflineMessageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x60')]||null},{'include':[{'model':db[_0x65f6('0x61')],'as':'Attachments'}]});})['then'](function(_0x56f7f1){_0x32148f[_0x65f6('0x15')]=_0x56f7f1;if(_0x32148f[_0x65f6('0x58')][_0x65f6('0x62')]){return db['User'][_0x65f6('0x23')]({'attributes':['id',_0x65f6('0x63')],'where':{'id':_0x32148f[_0x65f6('0x58')]['UserId']}})[_0x65f6('0xe')](function(_0x15809e){if(_0x15809e){_0x32148f['applications'][_0x65f6('0x64')]({'id':0x0,'priority':0x0,'app':_0x65f6('0x65'),'appdata':_0x15809e['name']+','+(_0x32148f[_0x65f6('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0x65f6('0x66')});}return respondWithRpcPromise('Start',_0x65f6('0x67'),_0x32148f);});}return respondWithRpcPromise(_0x65f6('0x68'),'startRouting',_0x32148f);})[_0x65f6('0xe')](function(_0x442e25){_0x2ea7f7(_0x442e25);})[_0x65f6('0x17')](function(_0x299b85){_0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x299b85[_0x65f6('0x15')]));});});};
\ No newline at end of file
index e74b55e..1712625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8374=['register','length','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x223f33,_0x284714){var _0x58f784=function(_0x35ba53){while(--_0x35ba53){_0x223f33['push'](_0x223f33['shift']());}};_0x58f784(++_0x284714);}(_0x8374,0x174));var _0x4837=function(_0x3ec3aa,_0x175d94){_0x3ec3aa=_0x3ec3aa-0x0;var _0x688907=_0x8374[_0x3ec3aa];return _0x688907;};'use strict';var MailAccountEvents=require(_0x4837('0x0'));var events=[_0x4837('0x1'),_0x4837('0x2'),_0x4837('0x3')];function createListener(_0x1ef84f,_0x3e4e90){return function(_0x395198){_0x3e4e90[_0x4837('0x4')](_0x1ef84f,_0x395198);};}function removeListener(_0x149f91,_0x386e70){return function(){MailAccountEvents[_0x4837('0x5')](_0x149f91,_0x386e70);};}exports[_0x4837('0x6')]=function(_0x2bd5a7){for(var _0x425c07=0x0,_0x4e0e60=events[_0x4837('0x7')];_0x425c07<_0x4e0e60;_0x425c07++){var _0x560c37=events[_0x425c07];var _0x408c14=createListener(_0x4837('0x8')+_0x560c37,_0x2bd5a7);MailAccountEvents['on'](_0x560c37,_0x408c14);}};
\ No newline at end of file
+var _0x9053=['emit','removeListener','register','length','mailAccount:','save'];(function(_0x44999c,_0x3f9801){var _0x488426=function(_0x5e8209){while(--_0x5e8209){_0x44999c['push'](_0x44999c['shift']());}};_0x488426(++_0x3f9801);}(_0x9053,0x161));var _0x3905=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x9053[_0x11a55c];return _0x26c390;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x3905('0x0'),'remove','update'];function createListener(_0x175436,_0x386cb8){return function(_0x55aa8b){_0x386cb8[_0x3905('0x1')](_0x175436,_0x55aa8b);};}function removeListener(_0x56fc79,_0x5691a6){return function(){MailAccountEvents[_0x3905('0x2')](_0x56fc79,_0x5691a6);};}exports[_0x3905('0x3')]=function(_0x2925cf){for(var _0x95ec97=0x0,_0x1a27fd=events[_0x3905('0x4')];_0x95ec97<_0x1a27fd;_0x95ec97++){var _0x4c4cdf=events[_0x95ec97];var _0x23b3ef=createListener(_0x3905('0x5')+_0x4c4cdf,_0x2925cf);MailAccountEvents['on'](_0x4c4cdf,_0x23b3ef);}};
\ No newline at end of file
index 7df6440..7dca282 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6034=['/:id','show','put','isAuthenticated','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get'];(function(_0x228b34,_0x135290){var _0x440281=function(_0x52337e){while(--_0x52337e){_0x228b34['push'](_0x228b34['shift']());}};_0x440281(++_0x135290);}(_0x6034,0xd6));var _0x4603=function(_0x3b1a85,_0x3d0c10){_0x3b1a85=_0x3b1a85-0x0;var _0x4f3acd=_0x6034[_0x3b1a85];return _0x4f3acd;};'use strict';var multer=require(_0x4603('0x0'));var util=require(_0x4603('0x1'));var path=require(_0x4603('0x2'));var timeout=require(_0x4603('0x3'));var express=require(_0x4603('0x4'));var router=express['Router']();var fs_extra=require(_0x4603('0x5'));var auth=require(_0x4603('0x6'));var interaction=require(_0x4603('0x7'));var config=require('../../config/environment');var controller=require(_0x4603('0x8'));router[_0x4603('0x9')](_0x4603('0xa'),auth['isAuthenticated'](),controller[_0x4603('0xb')]);router[_0x4603('0xc')](_0x4603('0xa'),auth[_0x4603('0xd')](),controller[_0x4603('0xe')]);router['delete'](_0x4603('0xa'),auth[_0x4603('0xd')](),controller[_0x4603('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xbb14=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','util','path','express'];(function(_0x39b1b0,_0x2b40f8){var _0x39406c=function(_0x11f758){while(--_0x11f758){_0x39b1b0['push'](_0x39b1b0['shift']());}};_0x39406c(++_0x2b40f8);}(_0xbb14,0xcd));var _0x4bb1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbb14[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x4bb1('0x0'));var path=require(_0x4bb1('0x1'));var timeout=require('connect-timeout');var express=require(_0x4bb1('0x2'));var router=express[_0x4bb1('0x3')]();var fs_extra=require(_0x4bb1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4bb1('0x5'));var config=require(_0x4bb1('0x6'));var controller=require(_0x4bb1('0x7'));router[_0x4bb1('0x8')](_0x4bb1('0x9'),auth[_0x4bb1('0xa')](),controller[_0x4bb1('0xb')]);router[_0x4bb1('0xc')](_0x4bb1('0x9'),auth[_0x4bb1('0xa')](),controller[_0x4bb1('0xd')]);router['delete'](_0x4bb1('0x9'),auth[_0x4bb1('0xa')](),controller[_0x4bb1('0xe')]);module[_0x4bb1('0xf')]=router;
\ No newline at end of file
index 4f0e59f..5579c08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa049=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0xa049,0xa9));var _0x9a04=function(_0x4d8fe1,_0x3ed474){_0x4d8fe1=_0x4d8fe1-0x0;var _0x46685e=_0xa049[_0x4d8fe1];return _0x46685e;};'use strict';var Sequelize=require(_0x9a04('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9a04('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9a04('0x2')],'allowNull':![],'defaultValue':_0x9a04('0x3')},'appdata':{'type':Sequelize[_0x9a04('0x4')]()},'description':{'type':Sequelize[_0x9a04('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9a04('0x5')}};
\ No newline at end of file
+var _0x87a2=['noop','TEXT','*,*,*,*','STRING'];(function(_0x29dd79,_0x57ddb6){var _0x3a3a12=function(_0x37b999){while(--_0x37b999){_0x29dd79['push'](_0x29dd79['shift']());}};_0x3a3a12(++_0x57ddb6);}(_0x87a2,0x1f3));var _0x287a=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0x87a2[_0x49c68e];return _0x33032b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x287a('0x0')],'allowNull':![],'defaultValue':_0x287a('0x1')},'appdata':{'type':Sequelize[_0x287a('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x287a('0x0')],'defaultValue':_0x287a('0x3')}};
\ No newline at end of file
index c8f322a..eacff65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0xaf0e6b,_0xdf6ac3){var _0x5b90e9=function(_0xc77b87){while(--_0xc77b87){_0xaf0e6b['push'](_0xaf0e6b['shift']());}};_0x5b90e9(++_0xdf6ac3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));};
\ No newline at end of file
+var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0xaa88[_0x2d8434];return _0x26b9e4;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));};
\ No newline at end of file
index 22d64aa..ddbe16a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc306=['bluebird','path','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4_unicode_ci','util','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc306,0x13c));var _0x6c30=function(_0x319d4,_0xfff48f){_0x319d4=_0x319d4-0x0;var _0x5b6e0d=_0xc306[_0x319d4];return _0x5b6e0d;};'use strict';var _=require('lodash');var util=require(_0x6c30('0x0'));var logger=require('../../config/logger')(_0x6c30('0x1'));var moment=require(_0x6c30('0x2'));var BPromise=require(_0x6c30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c30('0x4'));var rimraf=require('rimraf');var config=require(_0x6c30('0x5'));var attributes=require(_0x6c30('0x6'));module[_0x6c30('0x7')]=function(_0x59ce8b,_0xf4ebd8){return _0x59ce8b[_0x6c30('0x8')]('MailApplication',attributes,{'tableName':_0x6c30('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6c30('0xa')});};
\ No newline at end of file
+var _0x1e5f=['mail_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication'];(function(_0xbc82c3,_0x2da883){var _0x98db26=function(_0x2c65d4){while(--_0x2c65d4){_0xbc82c3['push'](_0xbc82c3['shift']());}};_0x98db26(++_0x2da883);}(_0x1e5f,0x13a));var _0xf1e5=function(_0x561049,_0x330926){_0x561049=_0x561049-0x0;var _0x52f109=_0x1e5f[_0x561049];return _0x52f109;};'use strict';var _=require(_0xf1e5('0x0'));var util=require('util');var logger=require(_0xf1e5('0x1'))(_0xf1e5('0x2'));var moment=require(_0xf1e5('0x3'));var BPromise=require(_0xf1e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1e5('0x5'));var rimraf=require(_0xf1e5('0x6'));var config=require(_0xf1e5('0x7'));var attributes=require(_0xf1e5('0x8'));module['exports']=function(_0xe43bc4,_0x3fc33a){return _0xe43bc4[_0xf1e5('0x9')](_0xf1e5('0xa'),attributes,{'tableName':_0xf1e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf1e5('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 7d88205..4cb21ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb4f=['message','result','catch','MailApplication','body','options','raw','where','attributes','limit','then','UpdateMailApplication','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xcb4f,0x1cd));var _0xfcb4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xcb4f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xfcb4('0x0'));var util=require('util');var moment=require(_0xfcb4('0x1'));var BPromise=require(_0xfcb4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcb4('0x3'));var db=require(_0xfcb4('0x4'))['db'];var utils=require(_0xfcb4('0x5'));var logger=require(_0xfcb4('0x6'))(_0xfcb4('0x7'));var config=require(_0xfcb4('0x8'));var jayson=require(_0xfcb4('0x9'));var client=jayson[_0xfcb4('0xa')][_0xfcb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f1b06,_0x261851,_0x20f335){return new BPromise(function(_0x1155b4,_0x4e0957){return client['request'](_0x1f1b06,_0x20f335)['then'](function(_0x104542){logger[_0xfcb4('0xc')](_0xfcb4('0xd'),_0x261851,_0xfcb4('0xe'));logger[_0xfcb4('0xf')](_0xfcb4('0x10'),_0x261851,_0xfcb4('0xe'),JSON['stringify'](_0x104542));if(_0x104542[_0xfcb4('0x11')]){if(_0x104542['error'][_0xfcb4('0x12')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x261851,_0x104542[_0xfcb4('0x11')][_0xfcb4('0x13')]);return _0x4e0957(_0x104542['error'][_0xfcb4('0x13')]);}logger[_0xfcb4('0x11')](_0xfcb4('0xd'),_0x261851,_0x104542[_0xfcb4('0x11')]['message']);return _0x1155b4(_0x104542['error'][_0xfcb4('0x13')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x261851,_0xfcb4('0xe'));_0x1155b4(_0x104542[_0xfcb4('0x14')][_0xfcb4('0x13')]);}})[_0xfcb4('0x15')](function(_0x4f134d){logger['error']('MailApplication,\x20%s,\x20%s',_0x261851,_0x4f134d);_0x4e0957(_0x4f134d);});});}exports['UpdateMailApplication']=function(_0xc32f79){var _0x36412e=this;return new Promise(function(_0x222d0b,_0x4eeb0d){return db[_0xfcb4('0x16')]['update'](_0xc32f79[_0xfcb4('0x17')],{'raw':_0xc32f79[_0xfcb4('0x18')]?_0xc32f79['options'][_0xfcb4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc32f79[_0xfcb4('0x18')]?_0xc32f79[_0xfcb4('0x18')][_0xfcb4('0x1a')]||null:null,'attributes':_0xc32f79[_0xfcb4('0x18')]?_0xc32f79[_0xfcb4('0x18')][_0xfcb4('0x1b')]||null:null,'limit':_0xc32f79[_0xfcb4('0x18')]?_0xc32f79[_0xfcb4('0x18')][_0xfcb4('0x1c')]||null:null})[_0xfcb4('0x1d')](function(_0x58da87){logger['info'](_0xfcb4('0x1e'),_0xc32f79);logger[_0xfcb4('0xf')](_0xfcb4('0x1e'),_0xc32f79,JSON[_0xfcb4('0x1f')](_0x58da87));_0x222d0b(_0x58da87);})[_0xfcb4('0x15')](function(_0x4fb286){logger[_0xfcb4('0x11')](_0xfcb4('0x1e'),_0x4fb286['message'],_0xc32f79);_0x4eeb0d(_0x36412e[_0xfcb4('0x11')](0x1f4,_0x4fb286[_0xfcb4('0x13')]));});});};
\ No newline at end of file
+var _0xbbc3=['MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','MailApplication','body','options','raw','where','attributes','limit','debug','UpdateMailApplication','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2ab09a,_0x334b83){var _0x5ae614=function(_0x8fd02d){while(--_0x8fd02d){_0x2ab09a['push'](_0x2ab09a['shift']());}};_0x5ae614(++_0x334b83);}(_0xbbc3,0xa9));var _0x3bbc=function(_0x598943,_0x56b6a8){_0x598943=_0x598943-0x0;var _0x30b021=_0xbbc3[_0x598943];return _0x30b021;};'use strict';var _=require(_0x3bbc('0x0'));var util=require('util');var moment=require(_0x3bbc('0x1'));var BPromise=require('bluebird');var rs=require(_0x3bbc('0x2'));var fs=require('fs');var Redis=require(_0x3bbc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bbc('0x4'));var logger=require(_0x3bbc('0x5'))(_0x3bbc('0x6'));var config=require(_0x3bbc('0x7'));var jayson=require(_0x3bbc('0x8'));var client=jayson['client'][_0x3bbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32b742,_0x160762,_0x15fab9){return new BPromise(function(_0x2b7b7,_0x1b244a){return client[_0x3bbc('0xa')](_0x32b742,_0x15fab9)['then'](function(_0x4e0845){logger['info'](_0x3bbc('0xb'),_0x160762,'request\x20sent');logger['debug'](_0x3bbc('0xc'),_0x160762,_0x3bbc('0xd'),JSON[_0x3bbc('0xe')](_0x4e0845));if(_0x4e0845[_0x3bbc('0xf')]){if(_0x4e0845[_0x3bbc('0xf')][_0x3bbc('0x10')]===0x1f4){logger['error'](_0x3bbc('0xb'),_0x160762,_0x4e0845[_0x3bbc('0xf')][_0x3bbc('0x11')]);return _0x1b244a(_0x4e0845[_0x3bbc('0xf')][_0x3bbc('0x11')]);}logger[_0x3bbc('0xf')](_0x3bbc('0xb'),_0x160762,_0x4e0845[_0x3bbc('0xf')]['message']);return _0x2b7b7(_0x4e0845[_0x3bbc('0xf')][_0x3bbc('0x11')]);}else{logger[_0x3bbc('0x12')](_0x3bbc('0xb'),_0x160762,_0x3bbc('0xd'));_0x2b7b7(_0x4e0845[_0x3bbc('0x13')][_0x3bbc('0x11')]);}})['catch'](function(_0x482c4d){logger['error'](_0x3bbc('0xb'),_0x160762,_0x482c4d);_0x1b244a(_0x482c4d);});});}exports['UpdateMailApplication']=function(_0x304ba1){var _0x45f068=this;return new Promise(function(_0x2b9544,_0x4d9ef1){return db[_0x3bbc('0x14')]['update'](_0x304ba1[_0x3bbc('0x15')],{'raw':_0x304ba1[_0x3bbc('0x16')]?_0x304ba1[_0x3bbc('0x16')][_0x3bbc('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x304ba1[_0x3bbc('0x16')]?_0x304ba1[_0x3bbc('0x16')][_0x3bbc('0x18')]||null:null,'attributes':_0x304ba1['options']?_0x304ba1['options'][_0x3bbc('0x19')]||null:null,'limit':_0x304ba1[_0x3bbc('0x16')]?_0x304ba1[_0x3bbc('0x16')][_0x3bbc('0x1a')]||null:null})['then'](function(_0x2894b9){logger['info']('UpdateMailApplication',_0x304ba1);logger[_0x3bbc('0x1b')](_0x3bbc('0x1c'),_0x304ba1,JSON[_0x3bbc('0xe')](_0x2894b9));_0x2b9544(_0x2894b9);})[_0x3bbc('0x1d')](function(_0x45bf47){logger[_0x3bbc('0xf')](_0x3bbc('0x1c'),_0x45bf47['message'],_0x304ba1);_0x4d9ef1(_0x45f068[_0x3bbc('0xf')](0x1f4,_0x45bf47[_0x3bbc('0x11')]));});});};
\ No newline at end of file
index e2812b9..128494e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03fe=['/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','tracked','mailinteraction:addtags','addTags','put','mail','mailinteraction:update','update','delete','destroy','/:id/tags','removeTags','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0x211e57,_0x4737ec){var _0x5bd307=function(_0x32daec){while(--_0x32daec){_0x211e57['push'](_0x211e57['shift']());}};_0x5bd307(++_0x4737ec);}(_0x03fe,0x173));var _0xe03f=function(_0x2e7cd1,_0x55737b){_0x2e7cd1=_0x2e7cd1-0x0;var _0x2866f2=_0x03fe[_0x2e7cd1];return _0x2866f2;};'use strict';var express=require(_0xe03f('0x0'));var router=express[_0xe03f('0x1')]();var auth=require(_0xe03f('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xe03f('0x3'));router[_0xe03f('0x4')]('/',auth[_0xe03f('0x5')](),controller[_0xe03f('0x6')]);router[_0xe03f('0x4')](_0xe03f('0x7'),auth[_0xe03f('0x5')](),controller[_0xe03f('0x8')]);router[_0xe03f('0x4')](_0xe03f('0x9'),auth[_0xe03f('0x5')](),controller[_0xe03f('0xa')]);router[_0xe03f('0x4')](_0xe03f('0xb'),auth[_0xe03f('0x5')](),controller[_0xe03f('0xc')]);router[_0xe03f('0x4')]('/:id/download',auth[_0xe03f('0x5')](),controller['download']);router[_0xe03f('0xd')]('/',auth[_0xe03f('0x5')](),controller[_0xe03f('0xe')]);router[_0xe03f('0xd')](_0xe03f('0xb'),auth['isAuthenticated'](),controller[_0xe03f('0xf')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xe03f('0x10')]('mail',_0xe03f('0x11')),controller[_0xe03f('0x12')]);router[_0xe03f('0x13')]('/:id',auth['isAuthenticated'](),interaction[_0xe03f('0x10')](_0xe03f('0x14'),_0xe03f('0x15')),controller[_0xe03f('0x16')]);router[_0xe03f('0x17')](_0xe03f('0x9'),auth[_0xe03f('0x5')](),interaction[_0xe03f('0x10')](_0xe03f('0x14'),'mailinteraction:destroy'),controller[_0xe03f('0x18')]);router['delete'](_0xe03f('0x19'),auth[_0xe03f('0x5')](),controller[_0xe03f('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x656c=['addMessage','/:id/tags','tracked','mail','addTags','put','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','/:id','/:id/messages','getMessages','download','post','create'];(function(_0x1f3e93,_0x3ef136){var _0x423d34=function(_0x188b1e){while(--_0x188b1e){_0x1f3e93['push'](_0x1f3e93['shift']());}};_0x423d34(++_0x3ef136);}(_0x656c,0x151));var _0xc656=function(_0x36e537,_0x4794d5){_0x36e537=_0x36e537-0x0;var _0x573045=_0x656c[_0x36e537];return _0x573045;};'use strict';var express=require(_0xc656('0x0'));var router=express[_0xc656('0x1')]();var auth=require(_0xc656('0x2'));var interaction=require(_0xc656('0x3'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0xc656('0x4')](),controller[_0xc656('0x5')]);router['get'](_0xc656('0x6'),auth[_0xc656('0x4')](),controller['describe']);router['get'](_0xc656('0x7'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc656('0x8'),auth['isAuthenticated'](),controller[_0xc656('0x9')]);router['get']('/:id/download',auth[_0xc656('0x4')](),controller[_0xc656('0xa')]);router[_0xc656('0xb')]('/',auth['isAuthenticated'](),controller[_0xc656('0xc')]);router['post']('/:id/messages',auth[_0xc656('0x4')](),controller[_0xc656('0xd')]);router[_0xc656('0xb')](_0xc656('0xe'),auth[_0xc656('0x4')](),interaction[_0xc656('0xf')](_0xc656('0x10'),'mailinteraction:addtags'),controller[_0xc656('0x11')]);router[_0xc656('0x12')](_0xc656('0x7'),auth[_0xc656('0x4')](),interaction[_0xc656('0xf')]('mail','mailinteraction:update'),controller[_0xc656('0x13')]);router[_0xc656('0x14')](_0xc656('0x7'),auth[_0xc656('0x4')](),interaction[_0xc656('0xf')](_0xc656('0x10'),_0xc656('0x15')),controller[_0xc656('0x16')]);router[_0xc656('0x14')](_0xc656('0xe'),auth[_0xc656('0x4')](),controller[_0xc656('0x17')]);module[_0xc656('0x18')]=router;
\ No newline at end of file
index db6cd19..fb3e31e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8512=['ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','long','TEXT'];(function(_0x54813d,_0x101c1f){var _0x561eea=function(_0x1faa0a){while(--_0x1faa0a){_0x54813d['push'](_0x54813d['shift']());}};_0x561eea(++_0x101c1f);}(_0x8512,0x70));var _0x2851=function(_0x7f9015,_0x245013){_0x7f9015=_0x7f9015-0x0;var _0xdbb9d3=_0x8512[_0x7f9015];return _0xdbb9d3;};'use strict';var Sequelize=require(_0x2851('0x0'));var iconv=require(_0x2851('0x1'));module[_0x2851('0x2')]={'closed':{'type':Sequelize[_0x2851('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2851('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2851('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2851('0x5')]},'note':{'type':Sequelize[_0x2851('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x2851('0x6'))},'subject':{'type':Sequelize[_0x2851('0x7')]()},'attach':{'type':Sequelize[_0x2851('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x2851('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2851('0x8')]('in',_0x2851('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2851('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2851('0x8')]('in',_0x2851('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xfd99=['TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x317573,_0x4ab138){var _0x564d8b=function(_0x55cec5){while(--_0x55cec5){_0x317573['push'](_0x317573['shift']());}};_0x564d8b(++_0x4ab138);}(_0xfd99,0x11a));var _0x9fd9=function(_0x5b0147,_0x5786d1){_0x5b0147=_0x5b0147-0x0;var _0x3615d6=_0xfd99[_0x5b0147];return _0x3615d6;};'use strict';var Sequelize=require(_0x9fd9('0x0'));var iconv=require(_0x9fd9('0x1'));module[_0x9fd9('0x2')]={'closed':{'type':Sequelize[_0x9fd9('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9fd9('0x4')]},'disposition':{'type':Sequelize[_0x9fd9('0x5')]},'secondDisposition':{'type':Sequelize[_0x9fd9('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9fd9('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x9fd9('0x6')]('long')},'subject':{'type':Sequelize[_0x9fd9('0x6')]()},'attach':{'type':Sequelize[_0x9fd9('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9fd9('0x4')]},'substatus':{'type':Sequelize[_0x9fd9('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x9fd9('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9fd9('0x7')]('in',_0x9fd9('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9fd9('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9fd9('0x7')]('in',_0x9fd9('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 11ac958..77d1e34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f1c=['json','offset','undefined','limit','count','set','Content-Range','update','then','end','error','stack','name','fullname','TagIds','split','Tags','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','catch','waiting','talking','unmanaged','total','UserId','closed','answered','index','map','MailInteraction','rawAttributes','fieldName','type','key','query','filters','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','select','field','color','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','find','buildExpression','start','keys','some','compact','isEmpty','where','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','\x20IS\x20NULL','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\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','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','enableEmailPreview','all','params','intersection','options','create','body','describe','addMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','true','rows','addTags','mailInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','transcript-%d-%s.zip','attachments','Attachments','Messages','subject','createdAt','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','sendStatus','eml-format','moment','path','lodash','squel','juice','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','status'];(function(_0x40c381,_0x32b874){var _0x2df3f2=function(_0x22b9b6){while(--_0x22b9b6){_0x40c381['push'](_0x40c381['shift']());}};_0x2df3f2(++_0x32b874);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x7fea40,_0xf2dd5e){_0x7fea40=_0x7fea40-0x0;var _0x4bdb29=_0x3f1c[_0x7fea40];return _0x4bdb29;};'use strict';var emlformat=require(_0xc3f1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xc3f1('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xc3f1('0x2'));var fs=require('fs');var _=require(_0xc3f1('0x3'));var squel=require(_0xc3f1('0x4'));var juice=require(_0xc3f1('0x5'));var Redis=require(_0xc3f1('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0xc3f1('0x7'));var logger=require('../../config/logger')(_0xc3f1('0x8'));var config=require(_0xc3f1('0x9'));var db=require(_0xc3f1('0xa'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xc3f1('0xb')](config['redis'],{'host':_0xc3f1('0xc'),'port':0x18eb});var socket=require(_0xc3f1('0xd'))(new Redis(config[_0xc3f1('0xe')]));require(_0xc3f1('0xf'))['register'](socket);function respondWithStatusCode(_0x63129a,_0x54ff40){_0x54ff40=_0x54ff40||0xcc;return function(_0x3fb521){if(_0x3fb521){return _0x63129a['sendStatus'](_0x54ff40);}return _0x63129a[_0xc3f1('0x10')](_0x54ff40)['end']();};}function respondWithResult(_0x54b60d,_0x23bb14){_0x23bb14=_0x23bb14||0xc8;return function(_0x103df5){if(_0x103df5){return _0x54b60d[_0xc3f1('0x10')](_0x23bb14)[_0xc3f1('0x11')](_0x103df5);}};}function respondWithFilteredResult(_0x36aac1,_0x3769f1){return function(_0x5bbfb3){if(_0x5bbfb3){var _0x5dbe5c=typeof _0x3769f1[_0xc3f1('0x12')]===_0xc3f1('0x13')&&typeof _0x3769f1[_0xc3f1('0x14')]===_0xc3f1('0x13');var _0x4e8f05=_0x5bbfb3[_0xc3f1('0x15')];var _0xee643=_0x5dbe5c?0x0:_0x3769f1[_0xc3f1('0x12')];var _0x46b599=_0x5dbe5c?_0x5bbfb3['count']:_0x3769f1[_0xc3f1('0x12')]+_0x3769f1['limit'];var _0x462599;if(_0x46b599>=_0x4e8f05){_0x46b599=_0x4e8f05;_0x462599=0xc8;}else{_0x462599=0xce;}_0x36aac1[_0xc3f1('0x10')](_0x462599);return _0x36aac1[_0xc3f1('0x16')](_0xc3f1('0x17'),_0xee643+'-'+_0x46b599+'/'+_0x4e8f05)['json'](_0x5bbfb3);}return null;};}function saveUpdates(_0x10da7e){return function(_0x1796c4){if(_0x1796c4){return _0x1796c4[_0xc3f1('0x18')](_0x10da7e)[_0xc3f1('0x19')](function(_0x27a37c){return _0x27a37c;});}return null;};}function removeEntity(_0x4d0412){return function(_0x68d412){if(_0x68d412){return _0x68d412['destroy']()['then'](function(){_0x4d0412[_0xc3f1('0x10')](0xcc)[_0xc3f1('0x1a')]();});}};}function handleEntityNotFound(_0x21a97a){return function(_0x1522fd){if(!_0x1522fd){_0x21a97a['sendStatus'](0x194);}return _0x1522fd;};}function handleError(_0x44d774,_0x2df1a4){_0x2df1a4=_0x2df1a4||0x1f4;return function(_0xb27830){logger[_0xc3f1('0x1b')](_0xb27830[_0xc3f1('0x1c')]);if(_0xb27830[_0xc3f1('0x1d')]){delete _0xb27830[_0xc3f1('0x1d')];}_0x44d774[_0xc3f1('0x10')](_0x2df1a4)['send'](_0xb27830);};}function getInteractionUsers(_0x47a68d,_0x294f2b){return new BPromise(function(_0x2ec032,_0x3b1eb9){try{if(_0x294f2b[_0x47a68d['id']]){_0x47a68d['Users']=_['map'](_0x294f2b[_0x47a68d['id']],function(_0x188f46){return{'id':_0x188f46['id'],'fullname':_0x188f46[_0xc3f1('0x1e')]};});}}catch(_0x1cf63f){_0x3b1eb9(_0x1cf63f);}_0x2ec032(_0x47a68d);});}function getInteractionTags(_0x4dd154,_0x5354a3){return new BPromise(function(_0x136e7a,_0x2ce433){try{if(_0x4dd154['TagIds']){_0x4dd154['Tags']=[];_0x4dd154[_0xc3f1('0x1f')][_0xc3f1('0x20')](',')['forEach'](function(_0x2d6cc4){_0x4dd154[_0xc3f1('0x21')][_0xc3f1('0x22')](_0x5354a3[_0x2d6cc4]);});}delete _0x4dd154[_0xc3f1('0x1f')];}catch(_0x4103ef){_0x2ce433(_0x4103ef);}_0x136e7a(_0x4dd154);});}function getLastMessageText(_0x2792c7){return new BPromise(function(_0xc31b5a,_0x481a48){return db[_0xc3f1('0x23')][_0xc3f1('0x24')]({'where':{'$and':[{'MailInteractionId':_0x2792c7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xc3f1('0x25')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xc3f1('0x26')],'order':_0xc3f1('0x27'),'raw':!![]})['then'](function(_0xf65574){if(_0xf65574&&_0xf65574['plainBody']){_0x2792c7[_0xc3f1('0x28')]=_['trimStart'](_0xf65574['plainBody']);}_0xc31b5a(_0x2792c7);})[_0xc3f1('0x29')](function(_0x851b2a){_0x481a48(_0x851b2a);});});}function updateMailInteraction(_0x56b0e5,_0x33f4cb,_0xb85b6f,_0x55867c){return new BPromise(function(_0x6d1029,_0x5ad6c8){return getInteractionUsers(_0x56b0e5,_0xb85b6f)[_0xc3f1('0x19')](function(_0x51cd40){return getInteractionTags(_0x51cd40,_0x33f4cb);})[_0xc3f1('0x19')](function(_0xe4cf39){return getStateInteraction(_0xe4cf39);})[_0xc3f1('0x19')](function(_0x588977){if(_0x55867c){_0x6d1029(getLastMessageText(_0x588977));}else{_0x6d1029(_0x588977);}})[_0xc3f1('0x29')](function(_0x374271){_0x5ad6c8(_0x374271);});});}function getStateInteraction(_0x552abe){return new BPromise(function(_0x11aac3){_0x552abe[_0xc3f1('0x2a')]=0x0;_0x552abe[_0xc3f1('0x2b')]=0x0;_0x552abe['answered']=0x0;_0x552abe[_0xc3f1('0x2c')]=0x0;_0x552abe[_0xc3f1('0x2d')]=0x0;if(!_0x552abe['closed']&&!_0x552abe[_0xc3f1('0x2e')]){_0x552abe[_0xc3f1('0x2a')]+=0x1;}if(!_0x552abe['closed']&&_0x552abe[_0xc3f1('0x2e')]){_0x552abe[_0xc3f1('0x2b')]+=0x1;if(_0x552abe[_0xc3f1('0x2a')]){_0x552abe[_0xc3f1('0x2a')]-=0x1;}}if(_0x552abe[_0xc3f1('0x2f')]&&_0x552abe[_0xc3f1('0x2e')]){_0x552abe[_0xc3f1('0x30')]+=0x1;if(_0x552abe[_0xc3f1('0x2b')]){_0x552abe[_0xc3f1('0x2b')]-=0x1;}}if(_0x552abe[_0xc3f1('0x2f')]&&!_0x552abe[_0xc3f1('0x2e')]){_0x552abe['unmanaged']+=0x1;if(_0x552abe[_0xc3f1('0x2a')]){_0x552abe['waiting']-=0x1;}}_0x552abe['total']+=0x1;_0x11aac3(_0x552abe);});}exports[_0xc3f1('0x31')]=function(_0x4420ce,_0x168598){var _0x576bae={},_0x154f1d={},_0x1a5a9a={'count':0x0,'rows':[]};var _0x3153e8=_[_0xc3f1('0x32')](db[_0xc3f1('0x33')][_0xc3f1('0x34')],function(_0x4eda7b){return{'name':_0x4eda7b[_0xc3f1('0x35')],'type':_0x4eda7b[_0xc3f1('0x36')][_0xc3f1('0x37')]};});_0x154f1d['model']=_['map'](_0x3153e8,_0xc3f1('0x1d'));_0x154f1d[_0xc3f1('0x38')]=_['keys'](_0x4420ce[_0xc3f1('0x38')]);_0x154f1d[_0xc3f1('0x39')]=_['intersection'](_0x154f1d['model'],_0x154f1d['query']);_0x576bae['attributes']=_['intersection'](_0x154f1d[_0xc3f1('0x3a')],qs[_0xc3f1('0x3b')](_0x4420ce[_0xc3f1('0x38')][_0xc3f1('0x3b')]));_0x576bae['attributes']=_0x576bae['attributes'][_0xc3f1('0x3c')]?_0x576bae[_0xc3f1('0x3d')]:_0x154f1d[_0xc3f1('0x3a')];if(!_0x4420ce[_0xc3f1('0x38')][_0xc3f1('0x3e')](_0xc3f1('0x3f'))){_0x576bae[_0xc3f1('0x14')]=qs[_0xc3f1('0x14')](_0x4420ce[_0xc3f1('0x38')]['limit']);_0x576bae[_0xc3f1('0x12')]=qs[_0xc3f1('0x12')](_0x4420ce['query'][_0xc3f1('0x12')]);}_0x576bae[_0xc3f1('0x40')]=qs[_0xc3f1('0x41')](_0x4420ce[_0xc3f1('0x38')]['sort']);_0x576bae['where']=qs['filters'](_['pick'](_0x4420ce[_0xc3f1('0x38')],_0x154f1d[_0xc3f1('0x39')]),_0x3153e8);var _0x5819bf=[];var _0x25f803=squel[_0xc3f1('0x42')]()[_0xc3f1('0x43')]('id')[_0xc3f1('0x43')](_0xc3f1('0x1d'))[_0xc3f1('0x43')](_0xc3f1('0x44'))['from'](_0xc3f1('0x45'));var _0x415059=squel['select']()[_0xc3f1('0x43')](_0xc3f1('0x46'))[_0xc3f1('0x43')]('u.fullname')[_0xc3f1('0x43')](_0xc3f1('0x47'))['from'](_0xc3f1('0x48'),'ui')[_0xc3f1('0x49')](_0xc3f1('0x4a'),'u',_0xc3f1('0x4b'));var _0x162bc1=squel[_0xc3f1('0x42')]()[_0xc3f1('0x4c')](_0xc3f1('0x4d'),'i')[_0xc3f1('0x49')]('cm_contacts','c',_0xc3f1('0x4e'))['left_join'](_0xc3f1('0x4a'),'o',_0xc3f1('0x4f'))[_0xc3f1('0x49')](_0xc3f1('0x50'),'a',_0xc3f1('0x51'))[_0xc3f1('0x49')](_0xc3f1('0x52'),'me','me.MailInteractionId\x20=\x20i.id')[_0xc3f1('0x49')](_0xc3f1('0x53'),'it','it.MailInteractionId\x20=\x20i.id')[_0xc3f1('0x49')](_0xc3f1('0x45'),'t',_0xc3f1('0x54'));var _0x4125ab=squel[_0xc3f1('0x55')]();var _0x5327ba=[];var _0x1f3054=squel[_0xc3f1('0x55')]();var _0x45a265;if(_0x4420ce[_0xc3f1('0x38')][_0xc3f1('0x56')]){_0x45a265=as[_0xc3f1('0x57')](_0x4420ce['query'][_0xc3f1('0x56')]);var _0x4fd9c7=_0x45a265['sqlOperator'];for(var _0x43c71c=0x0;_0x43c71c<_0x45a265[_0xc3f1('0x58')][_0xc3f1('0x3c')];_0x43c71c++){var _0x1618b6=_0x45a265[_0xc3f1('0x58')][_0x43c71c];var _0x195060='i';var _0x4d2d65=_['find'](_0x3153e8,[_0xc3f1('0x1d'),_0x1618b6[_0xc3f1('0x43')]]);if(!_0x4d2d65){switch(_0x1618b6['field']){case _0xc3f1('0x59'):if(_0x1618b6[_0xc3f1('0x5a')]==0x1){_0x162bc1['having']('`'+_0x1618b6[_0xc3f1('0x43')]+'`\x20=\x200');}else{_0x162bc1['having']('`'+_0x1618b6[_0xc3f1('0x43')]+_0xc3f1('0x5b'));}break;case _0xc3f1('0x5c'):if(_0x1618b6[_0xc3f1('0x5d')]===_0xc3f1('0x5e')){if(_0x1618b6['value'][_0xc3f1('0x20')]('\x20')[_0xc3f1('0x3c')]>0x1){_0x4125ab[_0x4fd9c7](_0xc3f1('0x5f'),qs['getFullTextValue'](_0x1618b6['value']),null);}else{var _0x37d483='%'+_0x1618b6['value']+'%';_0x4125ab[_0x4fd9c7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x37d483,_0x37d483,_0x37d483);}}else{_0x4d2d65=_['find'](_0x3153e8,[_0xc3f1('0x1d'),_0xc3f1('0x60')]);_0x1618b6[_0xc3f1('0x43')]=_0xc3f1('0x60');_0x4e25a5=as['buildExpression'](_0x195060,_0x4d2d65[_0xc3f1('0x36')],_0x1618b6);_0x4125ab[_0x4fd9c7](_0x4e25a5[_0xc3f1('0x61')],_0x4e25a5[_0xc3f1('0x5a')]['start'],_0x4e25a5['value'][_0xc3f1('0x1a')]);}break;case _0xc3f1('0x62'):var _0x487a17=_0x1618b6['value'][_0xc3f1('0x20')](',')[_0xc3f1('0x32')](function(_0x526ec7){return Number(_0x526ec7);});_0x487a17[_0xc3f1('0x63')](function(_0x4650ea){_0x1f3054['or'](_0xc3f1('0x64'),'%,'+_0x4650ea+',%');});_0x5327ba=_['union'](_0x5327ba,_0x487a17);break;case _0xc3f1('0x65'):if(_0x1618b6[_0xc3f1('0x5d')]===_0xc3f1('0x5e')){_0x4125ab[_0x4fd9c7]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1618b6[_0xc3f1('0x5a')]+'%',null);}else{_0x4d2d65=_[_0xc3f1('0x66')](_0x3153e8,[_0xc3f1('0x1d'),'UserId']);_0x1618b6[_0xc3f1('0x43')]=_0xc3f1('0x2e');_0x4e25a5=as[_0xc3f1('0x67')](_0x195060,_0x4d2d65[_0xc3f1('0x36')],_0x1618b6);_0x4125ab[_0x4fd9c7](_0x4e25a5[_0xc3f1('0x61')],_0x4e25a5[_0xc3f1('0x5a')][_0xc3f1('0x68')],_0x4e25a5[_0xc3f1('0x5a')][_0xc3f1('0x1a')]);}break;case'plainBody':_0x4e25a5=as[_0xc3f1('0x67')]('me',null,_0x1618b6);_0x4125ab[_0x4fd9c7](_0x4e25a5[_0xc3f1('0x61')],_0x4e25a5[_0xc3f1('0x5a')]['start'],_0x4e25a5[_0xc3f1('0x5a')][_0xc3f1('0x1a')]);break;}}else{var _0x4e25a5=as['buildExpression'](_0x195060,_0x4d2d65[_0xc3f1('0x36')],_0x1618b6);_0x4125ab[_0x4fd9c7](_0x4e25a5[_0xc3f1('0x61')],_0x4e25a5[_0xc3f1('0x5a')][_0xc3f1('0x68')],_0x4e25a5[_0xc3f1('0x5a')][_0xc3f1('0x1a')]);}}}else{var _0x4aba64=_(_0x4420ce[_0xc3f1('0x38')])[_0xc3f1('0x69')]()[_0xc3f1('0x32')](function(_0xa485d0){return _[_0xc3f1('0x6a')](_0x3153e8,[_0xc3f1('0x1d'),_0xa485d0])?_0xa485d0:undefined;})[_0xc3f1('0x6b')]()[_0xc3f1('0x5a')]();if(!_[_0xc3f1('0x6c')](_0x4aba64)){_0x4aba64['forEach'](function(_0x2e06ed){if(_0x2e06ed==='MailAccountId'){_0x162bc1[_0xc3f1('0x6d')](_0xc3f1('0x6e'),[][_0xc3f1('0x6f')](_0x4420ce['query'][_0x2e06ed]));}else if(_0x2e06ed==='createdAt'){var _0x2e9595=JSON[_0xc3f1('0x70')](_0x4420ce[_0xc3f1('0x38')][_0x2e06ed])[_0xc3f1('0x71')];var _0x3b2832=JSON[_0xc3f1('0x70')](_0x4420ce[_0xc3f1('0x38')][_0x2e06ed])[_0xc3f1('0x72')];_0x162bc1[_0xc3f1('0x6d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e9595,_0x3b2832);}else{if(_0x4420ce[_0xc3f1('0x38')][_0x2e06ed]==='null'){_0x162bc1[_0xc3f1('0x6d')]('i.'+_0x2e06ed+_0xc3f1('0x73'));}else{_0x162bc1['where']('i.'+_0x2e06ed+'\x20=\x20?',_0x4420ce['query'][_0x2e06ed]);}}});}if(_0x4420ce[_0xc3f1('0x38')][_0xc3f1('0x74')]){if(_0x4420ce['query'][_0xc3f1('0x74')]==0x1){_0x162bc1[_0xc3f1('0x75')]('`unreadMessages`\x20=\x200');}else{_0x162bc1[_0xc3f1('0x75')](_0xc3f1('0x76'));}}if(_0x4420ce[_0xc3f1('0x38')][_0xc3f1('0x77')]){_0x5327ba=_[_0xc3f1('0x78')](_0x4420ce['query'][_0xc3f1('0x77')])?_0x4420ce[_0xc3f1('0x38')]['tag']:new Array(_0x4420ce[_0xc3f1('0x38')][_0xc3f1('0x77')]);_0x5327ba[_0xc3f1('0x63')](function(_0x16a1c1){_0x1f3054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x16a1c1+',%');});}if(_0x4420ce[_0xc3f1('0x38')][_0xc3f1('0x79')]){var _0x47eac1=_0x4420ce[_0xc3f1('0x38')]['filter'][_0xc3f1('0x7a')]('\x5c','\x5c\x5c')[_0xc3f1('0x7a')](/'/g,'\x27\x27');if(qs[_0xc3f1('0x7b')](_0x47eac1)){_0x4125ab['or'](_0xc3f1('0x7c'),_0x47eac1+'%');}else if(qs['isEmail'](_0x47eac1)){_0x4125ab['or'](_0xc3f1('0x7d'),_0x47eac1+'%');}else{_0x4125ab['or'](_0xc3f1('0x7e'),qs[_0xc3f1('0x7f')](_0x47eac1))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x47eac1));}}}_0x162bc1[_0xc3f1('0x6d')](_0x4125ab);_0x162bc1[_0xc3f1('0x80')]('i.id');var _0x20b334={'type':db[_0xc3f1('0x81')][_0xc3f1('0x82')][_0xc3f1('0x83')],'raw':!![]};var _0x4bf7fb=_0x162bc1[_0xc3f1('0x84')]();_0x4bf7fb[_0xc3f1('0x43')](_0xc3f1('0x85'));_0x4bf7fb[_0xc3f1('0x43')](_0xc3f1('0x86'),_0xc3f1('0x59'));if(_0x576bae[_0xc3f1('0x40')]){_0x576bae[_0xc3f1('0x40')][_0xc3f1('0x63')](function(_0x1c1e54){var _0x3df0a1=_0x1c1e54[0x0]==='contactName'?_0x1c1e54[0x0]:'i.'+_0x1c1e54[0x0];_0x162bc1[_0xc3f1('0x40')](_0x3df0a1,_0x1c1e54[0x1]===_0xc3f1('0x87')?![]:!![]);});}if(!_[_0xc3f1('0x6c')](_0x5327ba)){_0x162bc1['having'](_0x1f3054);_0x4bf7fb[_0xc3f1('0x6d')](_0xc3f1('0x88'),_0x5327ba);}BPromise[_0xc3f1('0x89')]()['then'](function(){if(!_0x45a265){if(_0x4420ce[_0xc3f1('0x38')]['MailAccountId'])return;_0x4bf7fb[_0xc3f1('0x6d')](_0xc3f1('0x8a'));_0x162bc1['where'](_0xc3f1('0x8a'));return;}if(_0x4420ce[_0xc3f1('0x8b')][_0xc3f1('0x8c')]!==_0xc3f1('0x8d'))return;return _0x4420ce['user'][_0xc3f1('0x8e')]({'attributes':['id'],'raw':!![]})[_0xc3f1('0x19')](function(_0x2ee348){if(_[_0xc3f1('0x6c')](_0x2ee348)){_0x4bf7fb[_0xc3f1('0x6d')]('i.MailAccountId\x20IS\x20NULL');_0x162bc1[_0xc3f1('0x6d')](_0xc3f1('0x8f'));}else{_0x4bf7fb['where'](_0xc3f1('0x6e'),_['map'](_0x2ee348,'id'));_0x162bc1['where'](_0xc3f1('0x6e'),_[_0xc3f1('0x32')](_0x2ee348,'id'));}});})[_0xc3f1('0x19')](function(){if(_0x4420ce[_0xc3f1('0x8b')][_0xc3f1('0x8c')]==='agent'&&!_0x45a265&&!_0x4420ce[_0xc3f1('0x38')]['MailAccountId'])return[];return db[_0xc3f1('0x90')][_0xc3f1('0x38')](_0x4bf7fb[_0xc3f1('0x91')](),_0x20b334);})[_0xc3f1('0x19')](function(_0xb9266a){_0x1a5a9a['count']=_0xb9266a[_0xc3f1('0x3c')];if(_0x1a5a9a['count']===0x0)return[];return db[_0xc3f1('0x90')][_0xc3f1('0x38')](_0x25f803[_0xc3f1('0x91')](),_0x20b334)[_0xc3f1('0x19')](function(_0x3727f2){_0x5819bf=_[_0xc3f1('0x92')](_0x3727f2,'id');_0x20b334=_[_0xc3f1('0x93')](_0x20b334,{'model':db[_0xc3f1('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4420ce[_0xc3f1('0x38')][_0xc3f1('0x3b')]){_0x576bae[_0xc3f1('0x3d')]['forEach'](function(_0x30023e){_0x162bc1[_0xc3f1('0x43')]('i.'+_0x30023e);});}else{_0x162bc1[_0xc3f1('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc3f1('0x59'));_0x162bc1[_0xc3f1('0x43')]('a.key',_0xc3f1('0x94'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0x95'),'Account.mandatoryDisposition');_0x162bc1['field'](_0xc3f1('0x96'),_0xc3f1('0x97'));_0x162bc1['field']('i.id');_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0x98'));_0x162bc1['field'](_0xc3f1('0x99'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0x9a'));_0x162bc1['field']('i.closedAt');_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0x9b'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0x9c'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0x9d'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0x9e'));_0x162bc1[_0xc3f1('0x43')]('i.disposition');_0x162bc1[_0xc3f1('0x43')]('i.secondDisposition');_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0x9f'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xa0'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xa1'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xa2'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xa3'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xa4'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xa5'),'Contact.firstName');_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xa6'),'Contact.lastName');_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xa7'),_0xc3f1('0xa8'));_0x162bc1[_0xc3f1('0x43')]('c.phone',_0xc3f1('0xa9'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xaa'),_0xc3f1('0xab'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xac'),_0xc3f1('0xad'));_0x162bc1['field'](_0xc3f1('0xae'),_0xc3f1('0xaf'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xb0'),_0xc3f1('0xb1'));_0x162bc1[_0xc3f1('0x43')](_0xc3f1('0xb2'),'TagIds');}if(_0x576bae[_0xc3f1('0x14')])_0x162bc1[_0xc3f1('0x14')](_0x576bae[_0xc3f1('0x14')]);if(_0x576bae[_0xc3f1('0x12')])_0x162bc1[_0xc3f1('0x12')](_0x576bae[_0xc3f1('0x12')]);return db[_0xc3f1('0x90')][_0xc3f1('0x38')](_0x162bc1[_0xc3f1('0x91')](),_0x20b334);})['then'](function(_0x8f90f3){if(_0x8f90f3[_0xc3f1('0x3c')]>0x0)_0x415059[_0xc3f1('0x6d')](_0xc3f1('0xb3'),_[_0xc3f1('0x32')](_0x8f90f3,'id'));return db[_0xc3f1('0x90')][_0xc3f1('0x38')](_0x415059['toString'](),_0x20b334)[_0xc3f1('0x19')](function(_0x2b6445){var _0x861111=_['groupBy'](_0x2b6445,_0xc3f1('0xb4'));var _0x1e1528=[];return db['Setting']['findOne']({'attributes':[_0xc3f1('0xb5')],'raw':!![]})[_0xc3f1('0x19')](function(_0x16f628){var _0x4cc9d3=_0x16f628[_0xc3f1('0xb5')];_0x8f90f3[_0xc3f1('0x63')](function(_0xdcf2de){_0x1e1528['push'](updateMailInteraction(_0xdcf2de,_0x5819bf,_0x861111,_0x4cc9d3));});return BPromise[_0xc3f1('0xb6')](_0x1e1528);});});});})[_0xc3f1('0x19')](function(_0x1d48f7){_0x1a5a9a['rows']=_0x1d48f7;return _0x1a5a9a;})[_0xc3f1('0x19')](respondWithFilteredResult(_0x168598,_0x576bae))[_0xc3f1('0x29')](handleError(_0x168598,null));};exports['show']=function(_0x493380,_0x5f1869){var _0x3069f0={'raw':![],'where':{'id':_0x493380[_0xc3f1('0xb7')]['id']}},_0x541d67={};_0x541d67[_0xc3f1('0x3a')]=_[_0xc3f1('0x69')](db[_0xc3f1('0x33')][_0xc3f1('0x34')]);_0x541d67[_0xc3f1('0x38')]=_[_0xc3f1('0x69')](_0x493380[_0xc3f1('0x38')]);_0x541d67[_0xc3f1('0x39')]=_['intersection'](_0x541d67[_0xc3f1('0x3a')],_0x541d67['query']);_0x3069f0['attributes']=_[_0xc3f1('0xb8')](_0x541d67[_0xc3f1('0x3a')],qs[_0xc3f1('0x3b')](_0x493380['query'][_0xc3f1('0x3b')]));_0x3069f0[_0xc3f1('0x3d')]=_0x3069f0[_0xc3f1('0x3d')][_0xc3f1('0x3c')]?_0x3069f0[_0xc3f1('0x3d')]:_0x541d67['model'];if(_0x493380[_0xc3f1('0x38')]['includeAll']){_0x3069f0['include']=[{'all':!![]}];}_0x3069f0=_[_0xc3f1('0x93')]({},_0x3069f0,_0x493380[_0xc3f1('0xb9')]);return db[_0xc3f1('0x33')][_0xc3f1('0x66')](_0x3069f0)['then'](handleEntityNotFound(_0x5f1869,null))[_0xc3f1('0x19')](respondWithResult(_0x5f1869,null))[_0xc3f1('0x29')](handleError(_0x5f1869,null));};exports[_0xc3f1('0xba')]=function(_0x30316f,_0xe4a57f){return db[_0xc3f1('0x33')][_0xc3f1('0xba')](_0x30316f[_0xc3f1('0xbb')],{})['then'](respondWithResult(_0xe4a57f,0xc9))[_0xc3f1('0x29')](handleError(_0xe4a57f,null));};exports[_0xc3f1('0x18')]=function(_0x7783b5,_0x3b9175){if(_0x7783b5[_0xc3f1('0xbb')]['id']){delete _0x7783b5['body']['id'];}return db[_0xc3f1('0x33')]['find']({'where':{'id':_0x7783b5[_0xc3f1('0xb7')]['id']}})['then'](handleEntityNotFound(_0x3b9175,null))[_0xc3f1('0x19')](saveUpdates(_0x7783b5[_0xc3f1('0xbb')],null))[_0xc3f1('0x19')](respondWithResult(_0x3b9175,null))[_0xc3f1('0x29')](handleError(_0x3b9175,null));};exports['destroy']=function(_0x12a58c,_0x2ca987){return db[_0xc3f1('0x33')][_0xc3f1('0x66')]({'where':{'id':_0x12a58c[_0xc3f1('0xb7')]['id']}})[_0xc3f1('0x19')](handleEntityNotFound(_0x2ca987,null))[_0xc3f1('0x19')](removeEntity(_0x2ca987,null))['catch'](handleError(_0x2ca987,null));};exports['describe']=function(_0x427b40,_0x14a501){return db[_0xc3f1('0x33')][_0xc3f1('0xbc')]()[_0xc3f1('0x19')](respondWithResult(_0x14a501,null))[_0xc3f1('0x29')](handleError(_0x14a501,null));};exports['addMessage']=function(_0x27b71e,_0x30e4e7){return db[_0xc3f1('0x23')][_0xc3f1('0x66')]({'where':{'id':_0x27b71e[_0xc3f1('0xb7')]['id']}})[_0xc3f1('0x19')](handleEntityNotFound(_0x30e4e7,null))['then'](function(_0x20a708){if(_0x20a708){return _0x20a708[_0xc3f1('0xbd')](_0x27b71e[_0xc3f1('0xbb')][_0xc3f1('0xbe')],_[_0xc3f1('0xbf')](_0x27b71e[_0xc3f1('0xbb')],['ids','id'])||{});}})[_0xc3f1('0x19')](respondWithResult(_0x30e4e7,null))['catch'](handleError(_0x30e4e7,null));};exports[_0xc3f1('0xc0')]=function(_0x1cd037,_0x274288){var _0x355bfc={'raw':![],'where':{}};var _0x293992={};var _0x397296={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x1cd037[_0xc3f1('0xb7')]['id']}})['then'](handleEntityNotFound(_0x274288,null))[_0xc3f1('0x19')](function(_0x353c86){if(_0x353c86){_0x293992['model']=_['keys'](db[_0xc3f1('0x23')][_0xc3f1('0x34')]);_0x293992[_0xc3f1('0x38')]=_[_0xc3f1('0x69')](_0x1cd037[_0xc3f1('0x38')]);_0x293992[_0xc3f1('0x39')]=_['intersection'](_0x293992[_0xc3f1('0x3a')],_0x293992['query']);_0x355bfc[_0xc3f1('0x3d')]=_[_0xc3f1('0xb8')](_0x293992[_0xc3f1('0x3a')],qs['fields'](_0x1cd037[_0xc3f1('0x38')][_0xc3f1('0x3b')]));_0x355bfc['attributes']=_0x355bfc[_0xc3f1('0x3d')][_0xc3f1('0x3c')]?_0x355bfc[_0xc3f1('0x3d')]:_0x293992[_0xc3f1('0x3a')];if(!_0x1cd037[_0xc3f1('0x38')]['hasOwnProperty'](_0xc3f1('0x3f'))){_0x355bfc[_0xc3f1('0x14')]=qs[_0xc3f1('0x14')](_0x1cd037['query']['limit']);_0x355bfc[_0xc3f1('0x12')]=qs[_0xc3f1('0x12')](_0x1cd037[_0xc3f1('0x38')][_0xc3f1('0x12')]);}_0x355bfc[_0xc3f1('0x40')]=qs[_0xc3f1('0x41')](_0x1cd037[_0xc3f1('0x38')][_0xc3f1('0x41')]);_0x355bfc[_0xc3f1('0x6d')]=qs['filters'](_['pick'](_0x1cd037['query'],_0x293992['filters']));_0x355bfc[_0xc3f1('0x6d')][_0xc3f1('0xb4')]=_0x353c86['id'];if(_0x1cd037[_0xc3f1('0x38')]['filter']){_0x355bfc[_0xc3f1('0x6d')]=_['merge'](_0x355bfc[_0xc3f1('0x6d')],{'$or':_['map'](_0x355bfc[_0xc3f1('0x3d')],function(_0x53af4){var _0x5b5b4f={};_0x5b5b4f[_0x53af4]={'$like':'%'+_0x1cd037[_0xc3f1('0x38')]['filter']+'%'};return _0x5b5b4f;})});}if(_0x1cd037[_0xc3f1('0x38')][_0xc3f1('0x71')]){var _0x160905=_0x1cd037[_0xc3f1('0x38')][_0xc3f1('0x71')][_0xc3f1('0x20')](',');var _0x1d6583={};_0x1d6583[_0x160905[0x0]]={'$gte':moment(_0x160905[0x1])[_0xc3f1('0xc1')](_0xc3f1('0xc2'))};_0x355bfc[_0xc3f1('0x6d')]=_[_0xc3f1('0x93')](_0x355bfc[_0xc3f1('0x6d')],_0x1d6583);}_0x355bfc=_[_0xc3f1('0x93')]({},_0x355bfc,_0x1cd037[_0xc3f1('0xb9')]);return db['MailMessage'][_0xc3f1('0x15')]({'where':_0x355bfc['where']})['then'](function(_0xbee2a0){_0x397296[_0xc3f1('0x15')]=_0xbee2a0;if(_0x1cd037[_0xc3f1('0x38')]['includeAll']){_0x355bfc[_0xc3f1('0xc3')]=[{'all':!![]}];}return db[_0xc3f1('0x23')]['findAll'](_0x355bfc);})['then'](function(_0x39a6c6){if(_0x1cd037[_0xc3f1('0x38')]['inlineCss']===_0xc3f1('0xc4')){for(var _0x4506b1=0x0;_0x4506b1<_0x39a6c6[_0xc3f1('0x3c')];_0x4506b1++){_0x39a6c6[_0x4506b1][_0xc3f1('0xbb')]=juice(_0x39a6c6[_0x4506b1][_0xc3f1('0xbb')]);}}_0x397296[_0xc3f1('0xc5')]=_0x39a6c6;return _0x397296;});}})[_0xc3f1('0x19')](respondWithFilteredResult(_0x274288,_0x355bfc))[_0xc3f1('0x29')](handleError(_0x274288,null));};exports[_0xc3f1('0xc6')]=function(_0x132c8c,_0x48c686){return db[_0xc3f1('0x33')][_0xc3f1('0x66')]({'where':{'id':_0x132c8c[_0xc3f1('0xb7')]['id']}})[_0xc3f1('0x19')](handleEntityNotFound(_0x48c686,null))[_0xc3f1('0x19')](function(_0x556b06){if(_0x556b06){return _0x556b06['setTags'](_0x132c8c[_0xc3f1('0xbb')]['ids'],_[_0xc3f1('0xbf')](_0x132c8c[_0xc3f1('0xbb')],[_0xc3f1('0xbe'),'id'])||{})['spread'](function(){return db[_0xc3f1('0x62')]['findAll']({'attributes':['id',_0xc3f1('0x1d'),_0xc3f1('0x44')],'where':{'id':_0x132c8c['body'][_0xc3f1('0xbe')]}});})['then'](function(_0x34aba0){socket['emit'](_0xc3f1('0xc7'),{'id':Number(_0x132c8c[_0xc3f1('0xb7')]['id']),'tags':_0x34aba0||[]});return{'id':Number(_0x132c8c[_0xc3f1('0xb7')]['id']),'tags':_0x34aba0||[]};});}})[_0xc3f1('0x19')](respondWithResult(_0x48c686,null))[_0xc3f1('0x29')](handleError(_0x48c686,null));};exports[_0xc3f1('0xc8')]=function(_0x5c4d06,_0x23b46f){return db['MailInteraction'][_0xc3f1('0x66')]({'where':{'id':_0x5c4d06['params']['id']}})['then'](handleEntityNotFound(_0x23b46f,null))[_0xc3f1('0x19')](function(_0x28d8e4){if(_0x28d8e4){return _0x28d8e4['removeTags'](_0x5c4d06[_0xc3f1('0x38')][_0xc3f1('0xbe')]);}})[_0xc3f1('0x19')](respondWithStatusCode(_0x23b46f,null))[_0xc3f1('0x29')](handleError(_0x23b46f,null));};exports[_0xc3f1('0xc9')]=function(_0x281dcc,_0xac23ab){var _0x241d91=moment()[_0xc3f1('0xca')]()[_0xc3f1('0x91')]();var _0x540476=path['join'](config[_0xc3f1('0xcb')],_0xc3f1('0xcc'),'files',_0xc3f1('0xcd'));var _0x59b902=path[_0xc3f1('0xce')](config[_0xc3f1('0xcb')],_0xc3f1('0xcc'),_0xc3f1('0xcf'),'attachments');var _0x1694cd=path[_0xc3f1('0xce')](_0x540476,_0x241d91);var _0x34f748=util['format'](_0xc3f1('0xd0'),_0x281dcc[_0xc3f1('0xb7')]['id'],_0x241d91);var _0xeaac49=path['join'](_0x540476,_0x34f748);var _0x24d2ce=[];if(_0x281dcc['query'][_0xc3f1('0xd1')]){_0x24d2ce[_0xc3f1('0x22')]({'model':db['Attachment'],'as':_0xc3f1('0xd2'),'raw':!![]});}var _0x216583=[{'model':db[_0xc3f1('0x23')],'as':_0xc3f1('0xd3'),'attributes':['id',_0xc3f1('0xbb'),'from','to','cc','bcc',_0xc3f1('0xd4'),_0xc3f1('0xd5')],'where':{'secret':![]},'order':qs[_0xc3f1('0x41')]('id'),'include':_0x24d2ce}];return db[_0xc3f1('0x33')][_0xc3f1('0x66')]({'where':{'id':_0x281dcc[_0xc3f1('0xb7')]['id']},'include':_0x216583})[_0xc3f1('0x19')](handleEntityNotFound(_0xac23ab,null))['then'](function(_0x3341fe){if(_0x3341fe&&_0x3341fe[_0xc3f1('0xd3')]){var _0x259ab7=_0x3341fe[_0xc3f1('0xd6')]({'plain':!![]});fs[_0xc3f1('0xd7')](_0x1694cd);return BPromise[_0xc3f1('0xd8')](_0x259ab7[_0xc3f1('0xd3')],function(_0x11b262,_0x13b307){var _0x3212ae={'from':_0x11b262[_0xc3f1('0x4c')],'to':_0x11b262['to'],'subject':_0x11b262['subject'],'html':htmlEntities[_0xc3f1('0xd9')](_0x11b262['body']),'headers':{'Date':moment(_0x11b262[_0xc3f1('0xd5')])[_0xc3f1('0xc1')](_0xc3f1('0xda'))},'attachments':[]};if(_0x11b262['cc']){_0x3212ae[_0xc3f1('0xdb')]['Cc']=_0x11b262['cc'];}if(_0x11b262[_0xc3f1('0xdc')]){_0x3212ae['headers'][_0xc3f1('0xdd')]=_0x11b262[_0xc3f1('0xdc')];}return new BPromise(function(_0x157994,_0x260f90){if(_0x11b262['Attachments']){for(var _0x53e6b9=0x0;_0x53e6b9<_0x11b262[_0xc3f1('0xd2')]['length'];_0x53e6b9++){var _0x1d6697=_0x11b262['Attachments'][_0x53e6b9];var _0xd42612=path[_0xc3f1('0xce')](_0x59b902,_0x1d6697[_0xc3f1('0xde')]);if(fs[_0xc3f1('0xdf')](_0xd42612)){_0x3212ae[_0xc3f1('0xd1')][_0xc3f1('0x22')]({'name':_0x1d6697[_0xc3f1('0x1d')],'contentType':_0x1d6697[_0xc3f1('0x36')],'data':fs[_0xc3f1('0xe0')](_0xd42612)});}}}emlformat[_0xc3f1('0xe1')](_0x3212ae,function(_0x31c04f,_0x49ddec){if(_0x31c04f)return _0x260f90(_0x31c04f);fs[_0xc3f1('0xe2')](path[_0xc3f1('0xce')](_0x1694cd,util[_0xc3f1('0xc1')](_0xc3f1('0xe3'),_0x13b307)),_0x49ddec);return _0x157994(_0x49ddec);});});})[_0xc3f1('0x19')](function(){return new BPromise(function(_0x2ea431,_0x117a60){zipdir(_0x1694cd,{'saveTo':_0xeaac49},function(_0x3d7b54,_0xc29373){if(_0x3d7b54)return _0x117a60(_0x3d7b54);return _0x2ea431(_0xc29373);});})['then'](function(){return new BPromise(function(_0x525db7,_0x1969c6){rimraf(_0x1694cd,function(_0xd42746){if(_0xd42746)_0x1969c6(_0xd42746);return _0x525db7();});});})[_0xc3f1('0x19')](function(){return _0xac23ab[_0xc3f1('0xc9')](_0xeaac49,_0x34f748,function(_0x1e1eef){if(!_0x1e1eef)fs['unlinkSync'](_0xeaac49);});});});}else{return _0xac23ab[_0xc3f1('0xe4')](0xc8);}})[_0xc3f1('0x29')](handleError(_0xac23ab,null));};
\ No newline at end of file
+var _0xf981=['juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','json','update','then','destroy','error','stack','Users','fullname','TagIds','forEach','Tags','push','MailMessage','out','-id','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','closed','UserId','unmanaged','total','map','MailInteraction','fieldName','type','key','name','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','having','`\x20=\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','unreadMessages','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\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.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.to','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','show','params','rawAttributes','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','MailInteractionId','$gte','findAll','inlineCss','true','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','root','server','files','attachments','join','format','transcript-%d-%s.zip','Attachments','bcc','subject','get','Messages','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf981,0xe6));var _0x1f98=function(_0x189dd9,_0x5bd0a6){_0x189dd9=_0x189dd9-0x0;var _0x5631c5=_0xf981[_0x189dd9];return _0x5631c5;};'use strict';var emlformat=require(_0x1f98('0x0'));var rimraf=require(_0x1f98('0x1'));var zipdir=require(_0x1f98('0x2'));var moment=require(_0x1f98('0x3'));var BPromise=require(_0x1f98('0x4'));var util=require(_0x1f98('0x5'));var path=require(_0x1f98('0x6'));var fs=require('fs');var _=require(_0x1f98('0x7'));var squel=require('squel');var juice=require(_0x1f98('0x8'));var Redis=require(_0x1f98('0x9'));var qs=require(_0x1f98('0xa'));var as=require(_0x1f98('0xb'));var logger=require(_0x1f98('0xc'))('api');var config=require('../../config/environment');var db=require(_0x1f98('0xd'))['db'];var htmlEntities=require('html-entities');config[_0x1f98('0xe')]=_[_0x1f98('0xf')](config[_0x1f98('0xe')],{'host':_0x1f98('0x10'),'port':0x18eb});var socket=require(_0x1f98('0x11'))(new Redis(config['redis']));require(_0x1f98('0x12'))[_0x1f98('0x13')](socket);function respondWithStatusCode(_0x358d08,_0x1b79bf){_0x1b79bf=_0x1b79bf||0xcc;return function(_0x505bed){if(_0x505bed){return _0x358d08[_0x1f98('0x14')](_0x1b79bf);}return _0x358d08['status'](_0x1b79bf)[_0x1f98('0x15')]();};}function respondWithResult(_0x4dddb4,_0x47322b){_0x47322b=_0x47322b||0xc8;return function(_0x4d14ae){if(_0x4d14ae){return _0x4dddb4['status'](_0x47322b)['json'](_0x4d14ae);}};}function respondWithFilteredResult(_0x14a938,_0x2626aa){return function(_0x2e599d){if(_0x2e599d){var _0x2d9c83=typeof _0x2626aa[_0x1f98('0x16')]===_0x1f98('0x17')&&typeof _0x2626aa[_0x1f98('0x18')]==='undefined';var _0x1a21cd=_0x2e599d['count'];var _0x2fc335=_0x2d9c83?0x0:_0x2626aa['offset'];var _0x4534d7=_0x2d9c83?_0x2e599d[_0x1f98('0x19')]:_0x2626aa[_0x1f98('0x16')]+_0x2626aa[_0x1f98('0x18')];var _0x262841;if(_0x4534d7>=_0x1a21cd){_0x4534d7=_0x1a21cd;_0x262841=0xc8;}else{_0x262841=0xce;}_0x14a938[_0x1f98('0x1a')](_0x262841);return _0x14a938[_0x1f98('0x1b')]('Content-Range',_0x2fc335+'-'+_0x4534d7+'/'+_0x1a21cd)[_0x1f98('0x1c')](_0x2e599d);}return null;};}function saveUpdates(_0x5cbad8){return function(_0x319c4b){if(_0x319c4b){return _0x319c4b[_0x1f98('0x1d')](_0x5cbad8)[_0x1f98('0x1e')](function(_0x180ed3){return _0x180ed3;});}return null;};}function removeEntity(_0x3c8b4e){return function(_0x108848){if(_0x108848){return _0x108848[_0x1f98('0x1f')]()[_0x1f98('0x1e')](function(){_0x3c8b4e[_0x1f98('0x1a')](0xcc)[_0x1f98('0x15')]();});}};}function handleEntityNotFound(_0x4e5576){return function(_0x49aaa3){if(!_0x49aaa3){_0x4e5576[_0x1f98('0x14')](0x194);}return _0x49aaa3;};}function handleError(_0x431958,_0x46582d){_0x46582d=_0x46582d||0x1f4;return function(_0x56feb8){logger[_0x1f98('0x20')](_0x56feb8[_0x1f98('0x21')]);if(_0x56feb8['name']){delete _0x56feb8['name'];}_0x431958[_0x1f98('0x1a')](_0x46582d)['send'](_0x56feb8);};}function getInteractionUsers(_0x20bf86,_0x5a6f37){return new BPromise(function(_0x488497,_0x48a5dc){try{if(_0x5a6f37[_0x20bf86['id']]){_0x20bf86[_0x1f98('0x22')]=_['map'](_0x5a6f37[_0x20bf86['id']],function(_0xc158ba){return{'id':_0xc158ba['id'],'fullname':_0xc158ba[_0x1f98('0x23')]};});}}catch(_0x3ba8a2){_0x48a5dc(_0x3ba8a2);}_0x488497(_0x20bf86);});}function getInteractionTags(_0x1ce5cd,_0x15a0c1){return new BPromise(function(_0x3e1c19,_0x401606){try{if(_0x1ce5cd[_0x1f98('0x24')]){_0x1ce5cd['Tags']=[];_0x1ce5cd[_0x1f98('0x24')]['split'](',')[_0x1f98('0x25')](function(_0x2ba60e){_0x1ce5cd[_0x1f98('0x26')][_0x1f98('0x27')](_0x15a0c1[_0x2ba60e]);});}delete _0x1ce5cd['TagIds'];}catch(_0x4c39c1){_0x401606(_0x4c39c1);}_0x3e1c19(_0x1ce5cd);});}function getLastMessageText(_0x30a98b){return new BPromise(function(_0x23ad11,_0x2df3fb){return db[_0x1f98('0x28')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x30a98b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x1f98('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x1f98('0x2a'),'raw':!![]})['then'](function(_0x599a42){if(_0x599a42&&_0x599a42[_0x1f98('0x2b')]){_0x30a98b[_0x1f98('0x2c')]=_[_0x1f98('0x2d')](_0x599a42[_0x1f98('0x2b')]);}_0x23ad11(_0x30a98b);})[_0x1f98('0x2e')](function(_0xb24ee6){_0x2df3fb(_0xb24ee6);});});}function updateMailInteraction(_0x52fae2,_0x36f2fe,_0x20dddd,_0x4277a9){return new BPromise(function(_0x7823c1,_0x1f157f){return getInteractionUsers(_0x52fae2,_0x20dddd)[_0x1f98('0x1e')](function(_0x247b6a){return getInteractionTags(_0x247b6a,_0x36f2fe);})[_0x1f98('0x1e')](function(_0x2737cb){return getStateInteraction(_0x2737cb);})[_0x1f98('0x1e')](function(_0x17571e){if(_0x4277a9){_0x7823c1(getLastMessageText(_0x17571e));}else{_0x7823c1(_0x17571e);}})[_0x1f98('0x2e')](function(_0x1d434d){_0x1f157f(_0x1d434d);});});}function getStateInteraction(_0x3faf84){return new BPromise(function(_0x274c94){_0x3faf84[_0x1f98('0x2f')]=0x0;_0x3faf84[_0x1f98('0x30')]=0x0;_0x3faf84[_0x1f98('0x31')]=0x0;_0x3faf84['unmanaged']=0x0;_0x3faf84['total']=0x0;if(!_0x3faf84[_0x1f98('0x32')]&&!_0x3faf84['UserId']){_0x3faf84[_0x1f98('0x2f')]+=0x1;}if(!_0x3faf84['closed']&&_0x3faf84[_0x1f98('0x33')]){_0x3faf84[_0x1f98('0x30')]+=0x1;if(_0x3faf84[_0x1f98('0x2f')]){_0x3faf84[_0x1f98('0x2f')]-=0x1;}}if(_0x3faf84[_0x1f98('0x32')]&&_0x3faf84[_0x1f98('0x33')]){_0x3faf84['answered']+=0x1;if(_0x3faf84[_0x1f98('0x30')]){_0x3faf84['talking']-=0x1;}}if(_0x3faf84['closed']&&!_0x3faf84[_0x1f98('0x33')]){_0x3faf84[_0x1f98('0x34')]+=0x1;if(_0x3faf84[_0x1f98('0x2f')]){_0x3faf84[_0x1f98('0x2f')]-=0x1;}}_0x3faf84[_0x1f98('0x35')]+=0x1;_0x274c94(_0x3faf84);});}exports['index']=function(_0x21436f,_0x331d90){var _0x30a0b4={},_0xc3bec4={},_0x20c959={'count':0x0,'rows':[]};var _0x34d2e2=_[_0x1f98('0x36')](db[_0x1f98('0x37')]['rawAttributes'],function(_0x119b71){return{'name':_0x119b71[_0x1f98('0x38')],'type':_0x119b71[_0x1f98('0x39')][_0x1f98('0x3a')]};});_0xc3bec4['model']=_['map'](_0x34d2e2,_0x1f98('0x3b'));_0xc3bec4['query']=_[_0x1f98('0x3c')](_0x21436f[_0x1f98('0x3d')]);_0xc3bec4[_0x1f98('0x3e')]=_[_0x1f98('0x3f')](_0xc3bec4['model'],_0xc3bec4['query']);_0x30a0b4['attributes']=_[_0x1f98('0x3f')](_0xc3bec4[_0x1f98('0x40')],qs[_0x1f98('0x41')](_0x21436f[_0x1f98('0x3d')][_0x1f98('0x41')]));_0x30a0b4['attributes']=_0x30a0b4[_0x1f98('0x42')][_0x1f98('0x43')]?_0x30a0b4[_0x1f98('0x42')]:_0xc3bec4[_0x1f98('0x40')];if(!_0x21436f[_0x1f98('0x3d')]['hasOwnProperty'](_0x1f98('0x44'))){_0x30a0b4[_0x1f98('0x18')]=qs[_0x1f98('0x18')](_0x21436f[_0x1f98('0x3d')]['limit']);_0x30a0b4['offset']=qs[_0x1f98('0x16')](_0x21436f[_0x1f98('0x3d')][_0x1f98('0x16')]);}_0x30a0b4[_0x1f98('0x45')]=qs[_0x1f98('0x46')](_0x21436f[_0x1f98('0x3d')]['sort']);_0x30a0b4[_0x1f98('0x47')]=qs[_0x1f98('0x3e')](_[_0x1f98('0x48')](_0x21436f[_0x1f98('0x3d')],_0xc3bec4['filters']),_0x34d2e2);var _0x7c6342=[];var _0x42e526=squel[_0x1f98('0x49')]()['field']('id')[_0x1f98('0x4a')](_0x1f98('0x3b'))[_0x1f98('0x4a')](_0x1f98('0x4b'))[_0x1f98('0x4c')](_0x1f98('0x4d'));var _0x5a2c15=squel[_0x1f98('0x49')]()[_0x1f98('0x4a')]('u.id')[_0x1f98('0x4a')](_0x1f98('0x4e'))[_0x1f98('0x4a')](_0x1f98('0x4f'))['from']('user_has_mail_interactions','ui')[_0x1f98('0x50')](_0x1f98('0x51'),'u',_0x1f98('0x52'));var _0xbecf98=squel[_0x1f98('0x49')]()[_0x1f98('0x4c')]('mail_interactions','i')['left_join'](_0x1f98('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1f98('0x50')](_0x1f98('0x51'),'o','o.id\x20=\x20i.UserId')[_0x1f98('0x50')](_0x1f98('0x54'),'a',_0x1f98('0x55'))['left_join'](_0x1f98('0x56'),'me',_0x1f98('0x57'))[_0x1f98('0x50')](_0x1f98('0x58'),'it','it.MailInteractionId\x20=\x20i.id')[_0x1f98('0x50')]('tools_tags','t',_0x1f98('0x59'));var _0x52303b=squel[_0x1f98('0x5a')]();var _0x82183a=[];var _0x2714b=squel[_0x1f98('0x5a')]();var _0x1bb8ac;if(_0x21436f['query']['search']){_0x1bb8ac=as[_0x1f98('0x5b')](_0x21436f['query'][_0x1f98('0x5c')]);var _0x5dde3b=_0x1bb8ac[_0x1f98('0x5d')];for(var _0xb09e02=0x0;_0xb09e02<_0x1bb8ac[_0x1f98('0x5e')][_0x1f98('0x43')];_0xb09e02++){var _0x1fc4d6=_0x1bb8ac[_0x1f98('0x5e')][_0xb09e02];var _0x27aeda='i';var _0x1a8f36=_[_0x1f98('0x5f')](_0x34d2e2,[_0x1f98('0x3b'),_0x1fc4d6[_0x1f98('0x4a')]]);if(!_0x1a8f36){switch(_0x1fc4d6[_0x1f98('0x4a')]){case'unreadMessages':if(_0x1fc4d6['value']==0x1){_0xbecf98[_0x1f98('0x60')]('`'+_0x1fc4d6['field']+_0x1f98('0x61'));}else{_0xbecf98[_0x1f98('0x60')]('`'+_0x1fc4d6['field']+'`\x20>\x200');}break;case _0x1f98('0x62'):if(_0x1fc4d6[_0x1f98('0x63')]==='$substring'){if(_0x1fc4d6['value'][_0x1f98('0x64')]('\x20')['length']>0x1){_0x52303b[_0x5dde3b](_0x1f98('0x65'),qs[_0x1f98('0x66')](_0x1fc4d6['value']),null);}else{var _0x3e2f92='%'+_0x1fc4d6[_0x1f98('0x67')]+'%';_0x52303b[_0x5dde3b](_0x1f98('0x68'),_0x3e2f92,_0x3e2f92,_0x3e2f92);}}else{_0x1a8f36=_[_0x1f98('0x5f')](_0x34d2e2,['name',_0x1f98('0x69')]);_0x1fc4d6[_0x1f98('0x4a')]=_0x1f98('0x69');_0x26d28c=as[_0x1f98('0x6a')](_0x27aeda,_0x1a8f36[_0x1f98('0x39')],_0x1fc4d6);_0x52303b[_0x5dde3b](_0x26d28c[_0x1f98('0x6b')],_0x26d28c['value']['start'],_0x26d28c['value']['end']);}break;case _0x1f98('0x6c'):var _0x12a34f=_0x1fc4d6[_0x1f98('0x67')]['split'](',')[_0x1f98('0x36')](function(_0x1e4e9c){return Number(_0x1e4e9c);});_0x12a34f['forEach'](function(_0x4ab0a5){_0x2714b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4ab0a5+',%');});_0x82183a=_[_0x1f98('0x6d')](_0x82183a,_0x12a34f);break;case _0x1f98('0x6e'):if(_0x1fc4d6[_0x1f98('0x63')]===_0x1f98('0x6f')){_0x52303b[_0x5dde3b](_0x1f98('0x70'),'%'+_0x1fc4d6['value']+'%',null);}else{_0x1a8f36=_[_0x1f98('0x5f')](_0x34d2e2,['name','UserId']);_0x1fc4d6[_0x1f98('0x4a')]=_0x1f98('0x33');_0x26d28c=as[_0x1f98('0x6a')](_0x27aeda,_0x1a8f36[_0x1f98('0x39')],_0x1fc4d6);_0x52303b[_0x5dde3b](_0x26d28c[_0x1f98('0x6b')],_0x26d28c[_0x1f98('0x67')]['start'],_0x26d28c[_0x1f98('0x67')][_0x1f98('0x15')]);}break;case _0x1f98('0x2b'):_0x26d28c=as[_0x1f98('0x6a')]('me',null,_0x1fc4d6);_0x52303b[_0x5dde3b](_0x26d28c[_0x1f98('0x6b')],_0x26d28c[_0x1f98('0x67')][_0x1f98('0x71')],_0x26d28c[_0x1f98('0x67')][_0x1f98('0x15')]);break;}}else{var _0x26d28c=as[_0x1f98('0x6a')](_0x27aeda,_0x1a8f36[_0x1f98('0x39')],_0x1fc4d6);_0x52303b[_0x5dde3b](_0x26d28c[_0x1f98('0x6b')],_0x26d28c[_0x1f98('0x67')][_0x1f98('0x71')],_0x26d28c[_0x1f98('0x67')][_0x1f98('0x15')]);}}}else{var _0x5f1b99=_(_0x21436f[_0x1f98('0x3d')])[_0x1f98('0x3c')]()[_0x1f98('0x36')](function(_0x582ac8){return _[_0x1f98('0x72')](_0x34d2e2,[_0x1f98('0x3b'),_0x582ac8])?_0x582ac8:undefined;})[_0x1f98('0x73')]()[_0x1f98('0x67')]();if(!_[_0x1f98('0x74')](_0x5f1b99)){_0x5f1b99[_0x1f98('0x25')](function(_0x14cccb){if(_0x14cccb===_0x1f98('0x75')){_0xbecf98[_0x1f98('0x47')](_0x1f98('0x76'),[][_0x1f98('0x77')](_0x21436f[_0x1f98('0x3d')][_0x14cccb]));}else if(_0x14cccb===_0x1f98('0x78')){var _0x2aaf57=JSON[_0x1f98('0x79')](_0x21436f['query'][_0x14cccb])['$gte'];var _0x44cfcd=JSON[_0x1f98('0x79')](_0x21436f['query'][_0x14cccb])[_0x1f98('0x7a')];_0xbecf98[_0x1f98('0x47')](_0x1f98('0x7b'),_0x2aaf57,_0x44cfcd);}else{if(_0x21436f[_0x1f98('0x3d')][_0x14cccb]===_0x1f98('0x7c')){_0xbecf98[_0x1f98('0x47')]('i.'+_0x14cccb+_0x1f98('0x7d'));}else{_0xbecf98[_0x1f98('0x47')]('i.'+_0x14cccb+_0x1f98('0x7e'),_0x21436f[_0x1f98('0x3d')][_0x14cccb]);}}});}if(_0x21436f['query'][_0x1f98('0x7f')]){if(_0x21436f[_0x1f98('0x3d')]['read']==0x1){_0xbecf98[_0x1f98('0x60')](_0x1f98('0x80'));}else{_0xbecf98[_0x1f98('0x60')](_0x1f98('0x81'));}}if(_0x21436f['query'][_0x1f98('0x82')]){_0x82183a=_[_0x1f98('0x83')](_0x21436f[_0x1f98('0x3d')]['tag'])?_0x21436f[_0x1f98('0x3d')][_0x1f98('0x82')]:new Array(_0x21436f[_0x1f98('0x3d')][_0x1f98('0x82')]);_0x82183a[_0x1f98('0x25')](function(_0x22e73b){_0x2714b['or'](_0x1f98('0x84'),'%,'+_0x22e73b+',%');});}if(_0x21436f[_0x1f98('0x3d')]['filter']){var _0x285186=_0x21436f['query'][_0x1f98('0x85')]['replace']('\x5c','\x5c\x5c')[_0x1f98('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x285186)){_0x52303b['or']('i.id\x20LIKE\x20?',_0x285186+'%');}else if(qs[_0x1f98('0x87')](_0x285186)){_0x52303b['or'](_0x1f98('0x88'),_0x285186+'%');}else{_0x52303b['or'](_0x1f98('0x89'),qs[_0x1f98('0x66')](_0x285186))['or'](_0x1f98('0x8a'),qs['getFullTextValue'](_0x285186));}}}_0xbecf98['where'](_0x52303b);_0xbecf98[_0x1f98('0x8b')]('i.id');var _0x2b9b17={'type':db[_0x1f98('0x8c')][_0x1f98('0x8d')][_0x1f98('0x8e')],'raw':!![]};var _0x46ab89=_0xbecf98[_0x1f98('0x8f')]();_0x46ab89[_0x1f98('0x4a')]('i.id');_0x46ab89[_0x1f98('0x4a')](_0x1f98('0x90'),'unreadMessages');if(_0x30a0b4[_0x1f98('0x45')]){_0x30a0b4[_0x1f98('0x45')][_0x1f98('0x25')](function(_0x4e4672){var _0x79c21c=_0x4e4672[0x0]===_0x1f98('0x91')?_0x4e4672[0x0]:'i.'+_0x4e4672[0x0];_0xbecf98['order'](_0x79c21c,_0x4e4672[0x1]===_0x1f98('0x92')?![]:!![]);});}if(!_[_0x1f98('0x74')](_0x82183a)){_0xbecf98[_0x1f98('0x60')](_0x2714b);_0x46ab89['where'](_0x1f98('0x93'),_0x82183a);}BPromise[_0x1f98('0x94')]()[_0x1f98('0x1e')](function(){if(!_0x1bb8ac){if(_0x21436f[_0x1f98('0x3d')][_0x1f98('0x75')])return;_0x46ab89[_0x1f98('0x47')](_0x1f98('0x95'));_0xbecf98[_0x1f98('0x47')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x21436f[_0x1f98('0x96')][_0x1f98('0x97')]!==_0x1f98('0x98'))return;return _0x21436f[_0x1f98('0x96')][_0x1f98('0x99')]({'attributes':['id'],'raw':!![]})[_0x1f98('0x1e')](function(_0x5f16f3){if(_['isEmpty'](_0x5f16f3)){_0x46ab89[_0x1f98('0x47')]('i.MailAccountId\x20IS\x20NULL');_0xbecf98[_0x1f98('0x47')](_0x1f98('0x9a'));}else{_0x46ab89['where'](_0x1f98('0x76'),_['map'](_0x5f16f3,'id'));_0xbecf98['where'](_0x1f98('0x76'),_[_0x1f98('0x36')](_0x5f16f3,'id'));}});})[_0x1f98('0x1e')](function(){if(_0x21436f[_0x1f98('0x96')][_0x1f98('0x97')]===_0x1f98('0x98')&&!_0x1bb8ac&&!_0x21436f[_0x1f98('0x3d')][_0x1f98('0x75')])return[];return db[_0x1f98('0x9b')]['query'](_0x46ab89[_0x1f98('0x9c')](),_0x2b9b17);})[_0x1f98('0x1e')](function(_0x5d8d5d){_0x20c959[_0x1f98('0x19')]=_0x5d8d5d[_0x1f98('0x43')];if(_0x20c959[_0x1f98('0x19')]===0x0)return[];return db[_0x1f98('0x9b')][_0x1f98('0x3d')](_0x42e526['toString'](),_0x2b9b17)[_0x1f98('0x1e')](function(_0x4065e8){_0x7c6342=_[_0x1f98('0x9d')](_0x4065e8,'id');_0x2b9b17=_[_0x1f98('0x9e')](_0x2b9b17,{'model':db[_0x1f98('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x21436f['query'][_0x1f98('0x41')]){_0x30a0b4[_0x1f98('0x42')][_0x1f98('0x25')](function(_0x1247df){_0xbecf98['field']('i.'+_0x1247df);});}else{_0xbecf98['field'](_0x1f98('0x90'),_0x1f98('0x9f'));_0xbecf98[_0x1f98('0x4a')]('a.key','Account.key');_0xbecf98[_0x1f98('0x4a')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xa0'),_0x1f98('0x91'));_0xbecf98['field']('i.id');_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xa1'));_0xbecf98[_0x1f98('0x4a')]('i.updatedAt');_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xa2'));_0xbecf98['field'](_0x1f98('0xa3'));_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xa4'));_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xa5'));_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xa6'));_0xbecf98['field'](_0x1f98('0xa7'));_0xbecf98[_0x1f98('0x4a')]('i.disposition');_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xa8'));_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xa9'));_0xbecf98['field']('i.substatus');_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xaa'));_0xbecf98[_0x1f98('0x4a')]('i.ContactId');_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xab'));_0xbecf98['field'](_0x1f98('0xac'));_0xbecf98['field']('c.firstName',_0x1f98('0xad'));_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xae'),_0x1f98('0xaf'));_0xbecf98['field']('c.email','Contact.email');_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xb0'),_0x1f98('0xb1'));_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xb2'),'Contact.mobile');_0xbecf98['field']('c.fax','Contact.fax');_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xb3'),_0x1f98('0xb4'));_0xbecf98[_0x1f98('0x4a')](_0x1f98('0xb5'),_0x1f98('0xb6'));_0xbecf98['field'](_0x1f98('0xb7'),'TagIds');}if(_0x30a0b4[_0x1f98('0x18')])_0xbecf98[_0x1f98('0x18')](_0x30a0b4['limit']);if(_0x30a0b4[_0x1f98('0x16')])_0xbecf98[_0x1f98('0x16')](_0x30a0b4['offset']);return db['sequelize'][_0x1f98('0x3d')](_0xbecf98[_0x1f98('0x9c')](),_0x2b9b17);})['then'](function(_0x2c8918){if(_0x2c8918['length']>0x0)_0x5a2c15['where'](_0x1f98('0xb8'),_[_0x1f98('0x36')](_0x2c8918,'id'));return db[_0x1f98('0x9b')]['query'](_0x5a2c15['toString'](),_0x2b9b17)[_0x1f98('0x1e')](function(_0x3316f8){var _0x3bc58e=_[_0x1f98('0xb9')](_0x3316f8,'MailInteractionId');var _0x335c26=[];return db[_0x1f98('0xba')]['findOne']({'attributes':[_0x1f98('0xbb')],'raw':!![]})[_0x1f98('0x1e')](function(_0x217b67){var _0x2b360b=_0x217b67[_0x1f98('0xbb')];_0x2c8918[_0x1f98('0x25')](function(_0x3cc0b4){_0x335c26[_0x1f98('0x27')](updateMailInteraction(_0x3cc0b4,_0x7c6342,_0x3bc58e,_0x2b360b));});return BPromise['all'](_0x335c26);});});});})[_0x1f98('0x1e')](function(_0x284124){_0x20c959['rows']=_0x284124;return _0x20c959;})[_0x1f98('0x1e')](respondWithFilteredResult(_0x331d90,_0x30a0b4))[_0x1f98('0x2e')](handleError(_0x331d90,null));};exports[_0x1f98('0xbc')]=function(_0x187d57,_0x2afe3e){var _0x54ecad={'raw':![],'where':{'id':_0x187d57[_0x1f98('0xbd')]['id']}},_0x45229a={};_0x45229a[_0x1f98('0x40')]=_[_0x1f98('0x3c')](db[_0x1f98('0x37')][_0x1f98('0xbe')]);_0x45229a[_0x1f98('0x3d')]=_['keys'](_0x187d57[_0x1f98('0x3d')]);_0x45229a[_0x1f98('0x3e')]=_['intersection'](_0x45229a[_0x1f98('0x40')],_0x45229a['query']);_0x54ecad[_0x1f98('0x42')]=_['intersection'](_0x45229a[_0x1f98('0x40')],qs['fields'](_0x187d57[_0x1f98('0x3d')][_0x1f98('0x41')]));_0x54ecad[_0x1f98('0x42')]=_0x54ecad['attributes']['length']?_0x54ecad['attributes']:_0x45229a[_0x1f98('0x40')];if(_0x187d57['query'][_0x1f98('0xbf')]){_0x54ecad[_0x1f98('0xc0')]=[{'all':!![]}];}_0x54ecad=_[_0x1f98('0x9e')]({},_0x54ecad,_0x187d57[_0x1f98('0xc1')]);return db[_0x1f98('0x37')][_0x1f98('0x5f')](_0x54ecad)['then'](handleEntityNotFound(_0x2afe3e,null))[_0x1f98('0x1e')](respondWithResult(_0x2afe3e,null))[_0x1f98('0x2e')](handleError(_0x2afe3e,null));};exports[_0x1f98('0xc2')]=function(_0x7e8069,_0x33dcb6){return db[_0x1f98('0x37')][_0x1f98('0xc2')](_0x7e8069['body'],{})[_0x1f98('0x1e')](respondWithResult(_0x33dcb6,0xc9))['catch'](handleError(_0x33dcb6,null));};exports[_0x1f98('0x1d')]=function(_0x3dc384,_0x374271){if(_0x3dc384[_0x1f98('0xc3')]['id']){delete _0x3dc384[_0x1f98('0xc3')]['id'];}return db[_0x1f98('0x37')][_0x1f98('0x5f')]({'where':{'id':_0x3dc384[_0x1f98('0xbd')]['id']}})['then'](handleEntityNotFound(_0x374271,null))[_0x1f98('0x1e')](saveUpdates(_0x3dc384[_0x1f98('0xc3')],null))[_0x1f98('0x1e')](respondWithResult(_0x374271,null))[_0x1f98('0x2e')](handleError(_0x374271,null));};exports[_0x1f98('0x1f')]=function(_0x420aed,_0x36f3cf){return db[_0x1f98('0x37')][_0x1f98('0x5f')]({'where':{'id':_0x420aed['params']['id']}})[_0x1f98('0x1e')](handleEntityNotFound(_0x36f3cf,null))[_0x1f98('0x1e')](removeEntity(_0x36f3cf,null))['catch'](handleError(_0x36f3cf,null));};exports[_0x1f98('0xc4')]=function(_0x5844b8,_0x2916da){return db[_0x1f98('0x37')][_0x1f98('0xc4')]()[_0x1f98('0x1e')](respondWithResult(_0x2916da,null))['catch'](handleError(_0x2916da,null));};exports['addMessage']=function(_0x483c16,_0x48d406){return db[_0x1f98('0x28')]['find']({'where':{'id':_0x483c16[_0x1f98('0xbd')]['id']}})[_0x1f98('0x1e')](handleEntityNotFound(_0x48d406,null))[_0x1f98('0x1e')](function(_0x360a9b){if(_0x360a9b){return _0x360a9b[_0x1f98('0xc5')](_0x483c16[_0x1f98('0xc3')][_0x1f98('0xc6')],_[_0x1f98('0xc7')](_0x483c16[_0x1f98('0xc3')],[_0x1f98('0xc6'),'id'])||{});}})[_0x1f98('0x1e')](respondWithResult(_0x48d406,null))[_0x1f98('0x2e')](handleError(_0x48d406,null));};exports[_0x1f98('0xc8')]=function(_0x18575e,_0x2a75ba){var _0x26c9aa={'raw':![],'where':{}};var _0xbfd96f={};var _0x566b19={'count':0x0,'rows':[]};return db['MailInteraction'][_0x1f98('0xc9')]({'where':{'id':_0x18575e[_0x1f98('0xbd')]['id']}})['then'](handleEntityNotFound(_0x2a75ba,null))[_0x1f98('0x1e')](function(_0x1b2461){if(_0x1b2461){_0xbfd96f[_0x1f98('0x40')]=_[_0x1f98('0x3c')](db[_0x1f98('0x28')][_0x1f98('0xbe')]);_0xbfd96f[_0x1f98('0x3d')]=_['keys'](_0x18575e[_0x1f98('0x3d')]);_0xbfd96f[_0x1f98('0x3e')]=_[_0x1f98('0x3f')](_0xbfd96f[_0x1f98('0x40')],_0xbfd96f[_0x1f98('0x3d')]);_0x26c9aa['attributes']=_[_0x1f98('0x3f')](_0xbfd96f[_0x1f98('0x40')],qs['fields'](_0x18575e[_0x1f98('0x3d')][_0x1f98('0x41')]));_0x26c9aa[_0x1f98('0x42')]=_0x26c9aa[_0x1f98('0x42')][_0x1f98('0x43')]?_0x26c9aa[_0x1f98('0x42')]:_0xbfd96f[_0x1f98('0x40')];if(!_0x18575e['query'][_0x1f98('0xca')](_0x1f98('0x44'))){_0x26c9aa[_0x1f98('0x18')]=qs[_0x1f98('0x18')](_0x18575e[_0x1f98('0x3d')]['limit']);_0x26c9aa[_0x1f98('0x16')]=qs['offset'](_0x18575e[_0x1f98('0x3d')][_0x1f98('0x16')]);}_0x26c9aa[_0x1f98('0x45')]=qs['sort'](_0x18575e[_0x1f98('0x3d')][_0x1f98('0x46')]);_0x26c9aa[_0x1f98('0x47')]=qs[_0x1f98('0x3e')](_[_0x1f98('0x48')](_0x18575e[_0x1f98('0x3d')],_0xbfd96f['filters']));_0x26c9aa[_0x1f98('0x47')][_0x1f98('0xcb')]=_0x1b2461['id'];if(_0x18575e[_0x1f98('0x3d')]['filter']){_0x26c9aa['where']=_[_0x1f98('0x9e')](_0x26c9aa[_0x1f98('0x47')],{'$or':_[_0x1f98('0x36')](_0x26c9aa[_0x1f98('0x42')],function(_0x4f1bdc){var _0x1961d2={};_0x1961d2[_0x4f1bdc]={'$like':'%'+_0x18575e[_0x1f98('0x3d')][_0x1f98('0x85')]+'%'};return _0x1961d2;})});}if(_0x18575e['query'][_0x1f98('0xcc')]){var _0x21b96a=_0x18575e[_0x1f98('0x3d')][_0x1f98('0xcc')][_0x1f98('0x64')](',');var _0x37dee3={};_0x37dee3[_0x21b96a[0x0]]={'$gte':moment(_0x21b96a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x26c9aa[_0x1f98('0x47')]=_[_0x1f98('0x9e')](_0x26c9aa[_0x1f98('0x47')],_0x37dee3);}_0x26c9aa=_[_0x1f98('0x9e')]({},_0x26c9aa,_0x18575e['options']);return db[_0x1f98('0x28')][_0x1f98('0x19')]({'where':_0x26c9aa['where']})[_0x1f98('0x1e')](function(_0x10a883){_0x566b19[_0x1f98('0x19')]=_0x10a883;if(_0x18575e[_0x1f98('0x3d')]['includeAll']){_0x26c9aa[_0x1f98('0xc0')]=[{'all':!![]}];}return db['MailMessage'][_0x1f98('0xcd')](_0x26c9aa);})[_0x1f98('0x1e')](function(_0x47280e){if(_0x18575e[_0x1f98('0x3d')][_0x1f98('0xce')]===_0x1f98('0xcf')){for(var _0x3e9afa=0x0;_0x3e9afa<_0x47280e[_0x1f98('0x43')];_0x3e9afa++){_0x47280e[_0x3e9afa][_0x1f98('0xc3')]=juice(_0x47280e[_0x3e9afa][_0x1f98('0xc3')]);}}_0x566b19[_0x1f98('0xd0')]=_0x47280e;return _0x566b19;});}})[_0x1f98('0x1e')](respondWithFilteredResult(_0x2a75ba,_0x26c9aa))[_0x1f98('0x2e')](handleError(_0x2a75ba,null));};exports[_0x1f98('0xd1')]=function(_0x535b63,_0x15fc40){return db['MailInteraction']['find']({'where':{'id':_0x535b63[_0x1f98('0xbd')]['id']}})[_0x1f98('0x1e')](handleEntityNotFound(_0x15fc40,null))[_0x1f98('0x1e')](function(_0x4820b1){if(_0x4820b1){return _0x4820b1[_0x1f98('0xd2')](_0x535b63[_0x1f98('0xc3')][_0x1f98('0xc6')],_[_0x1f98('0xc7')](_0x535b63[_0x1f98('0xc3')],['ids','id'])||{})[_0x1f98('0xd3')](function(){return db[_0x1f98('0x6c')][_0x1f98('0xcd')]({'attributes':['id',_0x1f98('0x3b'),_0x1f98('0x4b')],'where':{'id':_0x535b63['body'][_0x1f98('0xc6')]}});})[_0x1f98('0x1e')](function(_0x39a1ca){socket[_0x1f98('0xd4')](_0x1f98('0xd5'),{'id':Number(_0x535b63[_0x1f98('0xbd')]['id']),'tags':_0x39a1ca||[]});return{'id':Number(_0x535b63[_0x1f98('0xbd')]['id']),'tags':_0x39a1ca||[]};});}})[_0x1f98('0x1e')](respondWithResult(_0x15fc40,null))[_0x1f98('0x2e')](handleError(_0x15fc40,null));};exports[_0x1f98('0xd6')]=function(_0x23a506,_0x14122c){return db[_0x1f98('0x37')]['find']({'where':{'id':_0x23a506[_0x1f98('0xbd')]['id']}})[_0x1f98('0x1e')](handleEntityNotFound(_0x14122c,null))[_0x1f98('0x1e')](function(_0x1dda31){if(_0x1dda31){return _0x1dda31['removeTags'](_0x23a506[_0x1f98('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x14122c,null))[_0x1f98('0x2e')](handleError(_0x14122c,null));};exports[_0x1f98('0xd7')]=function(_0x31e766,_0x982864){var _0x39d287=moment()[_0x1f98('0xd8')]()[_0x1f98('0x9c')]();var _0x120f08=path['join'](config[_0x1f98('0xd9')],_0x1f98('0xda'),'files','tmp');var _0x24fb2b=path['join'](config[_0x1f98('0xd9')],_0x1f98('0xda'),_0x1f98('0xdb'),_0x1f98('0xdc'));var _0x3720bf=path[_0x1f98('0xdd')](_0x120f08,_0x39d287);var _0x4d1add=util[_0x1f98('0xde')](_0x1f98('0xdf'),_0x31e766['params']['id'],_0x39d287);var _0x29733a=path[_0x1f98('0xdd')](_0x120f08,_0x4d1add);var _0x418b3f=[];if(_0x31e766[_0x1f98('0x3d')][_0x1f98('0xdc')]){_0x418b3f['push']({'model':db['Attachment'],'as':_0x1f98('0xe0'),'raw':!![]});}var _0x12c200=[{'model':db[_0x1f98('0x28')],'as':'Messages','attributes':['id',_0x1f98('0xc3'),'from','to','cc',_0x1f98('0xe1'),_0x1f98('0xe2'),_0x1f98('0x78')],'where':{'secret':![]},'order':qs[_0x1f98('0x46')]('id'),'include':_0x418b3f}];return db[_0x1f98('0x37')][_0x1f98('0x5f')]({'where':{'id':_0x31e766[_0x1f98('0xbd')]['id']},'include':_0x12c200})[_0x1f98('0x1e')](handleEntityNotFound(_0x982864,null))[_0x1f98('0x1e')](function(_0x7dfb76){if(_0x7dfb76&&_0x7dfb76['Messages']){var _0x339710=_0x7dfb76[_0x1f98('0xe3')]({'plain':!![]});fs['mkdirSync'](_0x3720bf);return BPromise['each'](_0x339710[_0x1f98('0xe4')],function(_0x53c8f9,_0x3f65e7){var _0x3c9aba={'from':_0x53c8f9[_0x1f98('0x4c')],'to':_0x53c8f9['to'],'subject':_0x53c8f9[_0x1f98('0xe2')],'html':htmlEntities['decode'](_0x53c8f9[_0x1f98('0xc3')]),'headers':{'Date':moment(_0x53c8f9[_0x1f98('0x78')])[_0x1f98('0xde')](_0x1f98('0xe5'))},'attachments':[]};if(_0x53c8f9['cc']){_0x3c9aba[_0x1f98('0xe6')]['Cc']=_0x53c8f9['cc'];}if(_0x53c8f9[_0x1f98('0xe1')]){_0x3c9aba['headers']['Bcc']=_0x53c8f9[_0x1f98('0xe1')];}return new BPromise(function(_0xfa82d1,_0x10113e){if(_0x53c8f9[_0x1f98('0xe0')]){for(var _0x1a5002=0x0;_0x1a5002<_0x53c8f9[_0x1f98('0xe0')]['length'];_0x1a5002++){var _0x29f57f=_0x53c8f9[_0x1f98('0xe0')][_0x1a5002];var _0x247195=path['join'](_0x24fb2b,_0x29f57f[_0x1f98('0xe7')]);if(fs[_0x1f98('0xe8')](_0x247195)){_0x3c9aba[_0x1f98('0xdc')][_0x1f98('0x27')]({'name':_0x29f57f[_0x1f98('0x3b')],'contentType':_0x29f57f[_0x1f98('0x39')],'data':fs[_0x1f98('0xe9')](_0x247195)});}}}emlformat[_0x1f98('0xea')](_0x3c9aba,function(_0x110080,_0x434752){if(_0x110080)return _0x10113e(_0x110080);fs[_0x1f98('0xeb')](path[_0x1f98('0xdd')](_0x3720bf,util[_0x1f98('0xde')](_0x1f98('0xec'),_0x3f65e7)),_0x434752);return _0xfa82d1(_0x434752);});});})[_0x1f98('0x1e')](function(){return new BPromise(function(_0x33ad09,_0x226f39){zipdir(_0x3720bf,{'saveTo':_0x29733a},function(_0x4d4a9b,_0x3cba1b){if(_0x4d4a9b)return _0x226f39(_0x4d4a9b);return _0x33ad09(_0x3cba1b);});})[_0x1f98('0x1e')](function(){return new BPromise(function(_0x51efaf,_0x1405ef){rimraf(_0x3720bf,function(_0x467ab9){if(_0x467ab9)_0x1405ef(_0x467ab9);return _0x51efaf();});});})['then'](function(){return _0x982864[_0x1f98('0xd7')](_0x29733a,_0x4d1add,function(_0x317391){if(!_0x317391)fs[_0x1f98('0xed')](_0x29733a);});});});}else{return _0x982864[_0x1f98('0x14')](0xc8);}})[_0x1f98('0x2e')](handleError(_0x982864,null));};
\ No newline at end of file
index bd261fd..c7bb0b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x076c=['update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save'];(function(_0x11b041,_0x344a2e){var _0x27fc28=function(_0x53789c){while(--_0x53789c){_0x11b041['push'](_0x11b041['shift']());}};_0x27fc28(++_0x344a2e);}(_0x076c,0x93));var _0xc076=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x076c[_0x4b1032];return _0x5a1d55;};'use strict';var EventEmitter=require(_0xc076('0x0'));var MailInteraction=require(_0xc076('0x1'))['db'][_0xc076('0x2')];var MailMessage=require(_0xc076('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc076('0x3')](0x0);var events={'afterCreate':_0xc076('0x4'),'afterUpdate':_0xc076('0x5'),'afterDestroy':_0xc076('0x6')};function emitEvent(_0x2ac660){return function(_0x391b13,_0x5a3d12,_0x1ce46c){_0x391b13[_0xc076('0x7')]({'attributes':['id'],'raw':!![]})[_0xc076('0x8')](function(_0x5c1569){_0x391b13[_0xc076('0x9')](_0xc076('0xa'),_0x5c1569[_0xc076('0xb')](function(_0x378f85){return{'id':_0x378f85['id']};}));return MailMessage[_0xc076('0xc')]({'where':{'MailInteractionId':_0x391b13['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc076('0x8')](function(_0x3e1d7e){_0x391b13['setDataValue']('unreadMessages',_0x3e1d7e[_0xc076('0xd')]);MailInteractionEvents[_0xc076('0xe')](_0x2ac660+':'+_0x391b13['id'],_0x391b13);MailInteractionEvents[_0xc076('0xe')](_0x2ac660,_0x391b13);_0x1ce46c(null);})[_0xc076('0xf')](_0x1ce46c(null));};}for(var e in events){if(events[_0xc076('0x10')](e)){var event=events[e];MailInteraction[_0xc076('0x11')](e,emitEvent(event));}}module[_0xc076('0x12')]=MailInteractionEvents;
\ No newline at end of file
+var _0x9a7d=['events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','emit','hasOwnProperty','exports'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x9a7d,0xff));var _0xd9a7=function(_0x265f52,_0x2d59d1){_0x265f52=_0x265f52-0x0;var _0x108c85=_0x9a7d[_0x265f52];return _0x108c85;};'use strict';var EventEmitter=require(_0xd9a7('0x0'));var MailInteraction=require(_0xd9a7('0x1'))['db'][_0xd9a7('0x2')];var MailMessage=require(_0xd9a7('0x1'))['db'][_0xd9a7('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd9a7('0x4')](0x0);var events={'afterCreate':_0xd9a7('0x5'),'afterUpdate':_0xd9a7('0x6'),'afterDestroy':_0xd9a7('0x7')};function emitEvent(_0x36a173){return function(_0x5af3bf,_0x5b8511,_0x35fdc1){_0x5af3bf['getUsers']({'attributes':['id'],'raw':!![]})[_0xd9a7('0x8')](function(_0xa15b0){_0x5af3bf[_0xd9a7('0x9')]('Users',_0xa15b0[_0xd9a7('0xa')](function(_0x57a60e){return{'id':_0x57a60e['id']};}));return MailMessage[_0xd9a7('0xb')]({'where':{'MailInteractionId':_0x5af3bf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd9a7('0x8')](function(_0xe0009c){_0x5af3bf[_0xd9a7('0x9')]('unreadMessages',_0xe0009c['length']);MailInteractionEvents[_0xd9a7('0xc')](_0x36a173+':'+_0x5af3bf['id'],_0x5af3bf);MailInteractionEvents[_0xd9a7('0xc')](_0x36a173,_0x5af3bf);_0x35fdc1(null);})['catch'](_0x35fdc1(null));};}for(var e in events){if(events[_0xd9a7('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xd9a7('0xe')]=MailInteractionEvents;
\ No newline at end of file
index 35d89ad..75bdeec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8732=['catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','exports','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update'];(function(_0x37aaa2,_0x21bab8){var _0x5efafa=function(_0x31f159){while(--_0x31f159){_0x37aaa2['push'](_0x37aaa2['shift']());}};_0x5efafa(++_0x21bab8);}(_0x8732,0x7a));var _0x2873=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0x8732[_0x58fbb0];return _0x1783d2;};'use strict';var _=require('lodash');var util=require(_0x2873('0x0'));var logger=require(_0x2873('0x1'))(_0x2873('0x2'));var moment=require(_0x2873('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2873('0x4'));var rimraf=require(_0x2873('0x5'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0x2873('0x6')]=function(_0x18a9e3,_0x2438f9){return _0x18a9e3['define'](_0x2873('0x7'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x2873('0x8'),'fields':[_0x2873('0x9'),'to'],'type':_0x2873('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x59c898,_0x19b125,_0x3173f1){if(_0x59c898[_0x2873('0xb')]){_0x59c898[_0x2873('0xc')]=moment()[_0x2873('0xd')](_0x2873('0xe'));}if(_0x59c898[_0x2873('0xf')]){_0x59c898[_0x2873('0x10')]=moment()[_0x2873('0xd')](_0x2873('0xe'));}_0x3173f1(null,_0x19b125);},'beforeUpdate':function(_0x18ad3d,_0x13886e,_0x59d292){if(_0x18ad3d[_0x2873('0x11')](_0x2873('0xb'))){_0x18ad3d[_0x2873('0xc')]=_0x18ad3d[_0x2873('0xb')]?moment()[_0x2873('0xd')](_0x2873('0xe')):null;}if(_0x18ad3d['changed'](_0x2873('0xf'))){_0x18ad3d[_0x2873('0x10')]=moment()[_0x2873('0xd')](_0x2873('0xe'));_0x18ad3d['substatus']=null;_0x18ad3d[_0x2873('0xc')]=null;}_0x59d292(null,_0x18ad3d);},'afterUpdate':function(_0x22cb75,_0x4e504c,_0xaec6b3){var _0x37d295=_0x18a9e3[_0x2873('0x12')];var _0x59e67e=_0x22cb75[_0x2873('0x13')]({'plain':!![]});if(_0x59e67e[_0x2873('0xf')]){return _0x37d295[_0x2873('0x14')][_0x2873('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x59e67e['id']}})['then'](function(){_0xaec6b3();})[_0x2873('0x16')](function(_0x280b67){_0xaec6b3(_0x280b67);});}else{_0xaec6b3();}}},'charset':'utf8mb4','collate':_0x2873('0x17')});};
\ No newline at end of file
+var _0x0304=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatusAt','substatus','models','get','update','then','catch'];(function(_0x12a28e,_0x26cc74){var _0x31c1f6=function(_0x3aa8f2){while(--_0x3aa8f2){_0x12a28e['push'](_0x12a28e['shift']());}};_0x31c1f6(++_0x26cc74);}(_0x0304,0x12b));var _0x4030=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x0304[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x4030('0x0'));var util=require(_0x4030('0x1'));var logger=require(_0x4030('0x2'))(_0x4030('0x3'));var moment=require(_0x4030('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4030('0x5'));var rimraf=require(_0x4030('0x6'));var config=require(_0x4030('0x7'));var attributes=require(_0x4030('0x8'));module[_0x4030('0x9')]=function(_0x314ba0,_0x5b8bf1){return _0x314ba0[_0x4030('0xa')]('MailInteraction',attributes,{'tableName':_0x4030('0xb'),'paranoid':![],'indexes':[{'name':_0x4030('0xc'),'fields':['subject','to'],'type':_0x4030('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xcdc866,_0x1969b7,_0x63cd30){if(_0xcdc866['substatus']){_0xcdc866['substatusAt']=moment()[_0x4030('0xe')](_0x4030('0xf'));}if(_0xcdc866[_0x4030('0x10')]){_0xcdc866[_0x4030('0x11')]=moment()[_0x4030('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x63cd30(null,_0x1969b7);},'beforeUpdate':function(_0x24aa35,_0x40adcb,_0x1d6551){if(_0x24aa35['changed']('substatus')){_0x24aa35[_0x4030('0x12')]=_0x24aa35[_0x4030('0x13')]?moment()[_0x4030('0xe')](_0x4030('0xf')):null;}if(_0x24aa35['changed'](_0x4030('0x10'))){_0x24aa35[_0x4030('0x11')]=moment()[_0x4030('0xe')](_0x4030('0xf'));_0x24aa35[_0x4030('0x13')]=null;_0x24aa35[_0x4030('0x12')]=null;}_0x1d6551(null,_0x24aa35);},'afterUpdate':function(_0x235dc7,_0x5f446f,_0x597399){var _0xcf6bc4=_0x314ba0[_0x4030('0x14')];var _0x33af5d=_0x235dc7[_0x4030('0x15')]({'plain':!![]});if(_0x33af5d[_0x4030('0x10')]){return _0xcf6bc4['MailMessage'][_0x4030('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x33af5d['id']}})[_0x4030('0x17')](function(){_0x597399();})[_0x4030('0x18')](function(_0x5c9f49){_0x597399(_0x5c9f49);});}else{_0x597399();}}},'charset':_0x4030('0x19'),'collate':_0x4030('0x1a')});};
\ No newline at end of file
index be8d4f1..6e63213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e63=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateMailInteraction','MailInteraction','update','options','where','attributes','limit','debug','AddTagsToMailInteraction','find','ids','omit','body','AddTags','util','moment','bluebird'];(function(_0x5ed0ba,_0x310c1e){var _0xbb7929=function(_0x64eef8){while(--_0x64eef8){_0x5ed0ba['push'](_0x5ed0ba['shift']());}};_0xbb7929(++_0x310c1e);}(_0x2e63,0x14d));var _0x32e6=function(_0x13b9b5,_0x298e69){_0x13b9b5=_0x13b9b5-0x0;var _0x154263=_0x2e63[_0x13b9b5];return _0x154263;};'use strict';var _=require('lodash');var util=require(_0x32e6('0x0'));var moment=require(_0x32e6('0x1'));var BPromise=require(_0x32e6('0x2'));var rs=require(_0x32e6('0x3'));var fs=require('fs');var Redis=require(_0x32e6('0x4'));var db=require(_0x32e6('0x5'))['db'];var utils=require(_0x32e6('0x6'));var logger=require('../../config/logger')(_0x32e6('0x7'));var config=require(_0x32e6('0x8'));var jayson=require(_0x32e6('0x9'));var client=jayson[_0x32e6('0xa')][_0x32e6('0xb')]({'port':0x232a});config[_0x32e6('0xc')]=_[_0x32e6('0xd')](config[_0x32e6('0xc')],{'host':_0x32e6('0xe'),'port':0x18eb});var socket=require(_0x32e6('0xf'))(new Redis(config[_0x32e6('0xc')]));require(_0x32e6('0x10'))['register'](socket);function respondWithRpcPromise(_0x115a3e,_0x7ddc4c,_0x443c32){return new BPromise(function(_0x93c2d9,_0xbc08a){return client['request'](_0x115a3e,_0x443c32)[_0x32e6('0x11')](function(_0x13ad7b){logger[_0x32e6('0x12')](_0x32e6('0x13'),_0x7ddc4c,'request\x20sent');logger['debug'](_0x32e6('0x14'),_0x7ddc4c,'request\x20sent',JSON[_0x32e6('0x15')](_0x13ad7b));if(_0x13ad7b['error']){if(_0x13ad7b[_0x32e6('0x16')][_0x32e6('0x17')]===0x1f4){logger[_0x32e6('0x16')](_0x32e6('0x13'),_0x7ddc4c,_0x13ad7b[_0x32e6('0x16')][_0x32e6('0x18')]);return _0xbc08a(_0x13ad7b[_0x32e6('0x16')][_0x32e6('0x18')]);}logger[_0x32e6('0x16')](_0x32e6('0x13'),_0x7ddc4c,_0x13ad7b[_0x32e6('0x16')][_0x32e6('0x18')]);return _0x93c2d9(_0x13ad7b[_0x32e6('0x16')]['message']);}else{logger[_0x32e6('0x12')](_0x32e6('0x13'),_0x7ddc4c,_0x32e6('0x19'));_0x93c2d9(_0x13ad7b[_0x32e6('0x1a')][_0x32e6('0x18')]);}})[_0x32e6('0x1b')](function(_0x491369){logger[_0x32e6('0x16')](_0x32e6('0x13'),_0x7ddc4c,_0x491369);_0xbc08a(_0x491369);});});}exports[_0x32e6('0x1c')]=function(_0xe787e0){var _0x1198bf=this;return new Promise(function(_0x35db79,_0x2318e2){return db[_0x32e6('0x1d')][_0x32e6('0x1e')](_0xe787e0['body'],{'raw':_0xe787e0[_0x32e6('0x1f')]?_0xe787e0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe787e0['options']?_0xe787e0['options'][_0x32e6('0x20')]||null:null,'attributes':_0xe787e0[_0x32e6('0x1f')]?_0xe787e0[_0x32e6('0x1f')][_0x32e6('0x21')]||null:null,'limit':_0xe787e0[_0x32e6('0x1f')]?_0xe787e0[_0x32e6('0x1f')][_0x32e6('0x22')]||null:null})[_0x32e6('0x11')](function(_0x3c3cfe){logger[_0x32e6('0x12')](_0x32e6('0x1c'),_0xe787e0);logger[_0x32e6('0x23')](_0x32e6('0x1c'),_0xe787e0,JSON[_0x32e6('0x15')](_0x3c3cfe));_0x35db79(_0x3c3cfe);})['catch'](function(_0x2d4a3a){logger[_0x32e6('0x16')](_0x32e6('0x1c'),_0x2d4a3a[_0x32e6('0x18')],_0xe787e0);_0x2318e2(_0x1198bf[_0x32e6('0x16')](0x1f4,_0x2d4a3a[_0x32e6('0x18')]));});});};exports[_0x32e6('0x24')]=function(_0x4d9b38){return new Promise(function(_0x872f35,_0xf3a90e){return db[_0x32e6('0x1d')][_0x32e6('0x25')]({'where':_0x4d9b38[_0x32e6('0x1f')]?_0x4d9b38['options'][_0x32e6('0x20')]||null:null})[_0x32e6('0x11')](function(_0x18908c){if(_0x18908c){return _0x18908c['addTags'](_0x4d9b38['body'][_0x32e6('0x26')],_[_0x32e6('0x27')](_0x4d9b38[_0x32e6('0x28')],[_0x32e6('0x26'),'id'])||{});}})['spread'](function(_0x2dc815){logger[_0x32e6('0x12')](_0x32e6('0x29'),_0x4d9b38);logger[_0x32e6('0x23')]('AddTags',_0x4d9b38,JSON[_0x32e6('0x15')](_0x2dc815));_0x872f35(_0x2dc815);})['catch'](function(_0x464ed3){logger['error'](_0x32e6('0x29'),_0x464ed3[_0x32e6('0x18')],_0x4d9b38);_0xf3a90e(_this[_0x32e6('0x16')](0x1f4,_0x464ed3['message']));});});};
\ No newline at end of file
+var _0xdc68=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailInteraction','update','options','attributes','AddTagsToMailInteraction','MailInteraction','find','where','then','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis'];(function(_0x38b3bb,_0x4bbee4){var _0xc066d7=function(_0x29f89e){while(--_0x29f89e){_0x38b3bb['push'](_0x38b3bb['shift']());}};_0xc066d7(++_0x4bbee4);}(_0xdc68,0x16d));var _0x8dc6=function(_0x5288f9,_0x1320eb){_0x5288f9=_0x5288f9-0x0;var _0x4b17ae=_0xdc68[_0x5288f9];return _0x4b17ae;};'use strict';var _=require(_0x8dc6('0x0'));var util=require(_0x8dc6('0x1'));var moment=require(_0x8dc6('0x2'));var BPromise=require('bluebird');var rs=require(_0x8dc6('0x3'));var fs=require('fs');var Redis=require(_0x8dc6('0x4'));var db=require(_0x8dc6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8dc6('0x6'))(_0x8dc6('0x7'));var config=require(_0x8dc6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8dc6('0x9')]['http']({'port':0x232a});config['redis']=_[_0x8dc6('0xa')](config[_0x8dc6('0xb')],{'host':_0x8dc6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dc6('0xb')]));require('./mailInteraction.socket')[_0x8dc6('0xd')](socket);function respondWithRpcPromise(_0xd410d1,_0x1cc4f5,_0x11ed99){return new BPromise(function(_0x2eba3f,_0x306ec3){return client[_0x8dc6('0xe')](_0xd410d1,_0x11ed99)['then'](function(_0x194195){logger[_0x8dc6('0xf')](_0x8dc6('0x10'),_0x1cc4f5,_0x8dc6('0x11'));logger[_0x8dc6('0x12')](_0x8dc6('0x13'),_0x1cc4f5,_0x8dc6('0x11'),JSON[_0x8dc6('0x14')](_0x194195));if(_0x194195['error']){if(_0x194195['error']['code']===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x1cc4f5,_0x194195[_0x8dc6('0x15')]['message']);return _0x306ec3(_0x194195['error'][_0x8dc6('0x16')]);}logger[_0x8dc6('0x15')](_0x8dc6('0x10'),_0x1cc4f5,_0x194195[_0x8dc6('0x15')]['message']);return _0x2eba3f(_0x194195[_0x8dc6('0x15')]['message']);}else{logger[_0x8dc6('0xf')](_0x8dc6('0x10'),_0x1cc4f5,_0x8dc6('0x11'));_0x2eba3f(_0x194195['result'][_0x8dc6('0x16')]);}})[_0x8dc6('0x17')](function(_0x2c9e35){logger['error'](_0x8dc6('0x10'),_0x1cc4f5,_0x2c9e35);_0x306ec3(_0x2c9e35);});});}exports[_0x8dc6('0x18')]=function(_0x10e02d){var _0x38d16d=this;return new Promise(function(_0x175208,_0x2a52e0){return db['MailInteraction'][_0x8dc6('0x19')](_0x10e02d['body'],{'raw':_0x10e02d['options']?_0x10e02d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10e02d[_0x8dc6('0x1a')]?_0x10e02d[_0x8dc6('0x1a')]['where']||null:null,'attributes':_0x10e02d[_0x8dc6('0x1a')]?_0x10e02d[_0x8dc6('0x1a')][_0x8dc6('0x1b')]||null:null,'limit':_0x10e02d['options']?_0x10e02d[_0x8dc6('0x1a')]['limit']||null:null})['then'](function(_0x23ab22){logger[_0x8dc6('0xf')](_0x8dc6('0x18'),_0x10e02d);logger[_0x8dc6('0x12')](_0x8dc6('0x18'),_0x10e02d,JSON['stringify'](_0x23ab22));_0x175208(_0x23ab22);})[_0x8dc6('0x17')](function(_0x2575a4){logger[_0x8dc6('0x15')](_0x8dc6('0x18'),_0x2575a4[_0x8dc6('0x16')],_0x10e02d);_0x2a52e0(_0x38d16d[_0x8dc6('0x15')](0x1f4,_0x2575a4[_0x8dc6('0x16')]));});});};exports[_0x8dc6('0x1c')]=function(_0x48615a){return new Promise(function(_0xde938c,_0x3a0401){return db[_0x8dc6('0x1d')][_0x8dc6('0x1e')]({'where':_0x48615a['options']?_0x48615a['options'][_0x8dc6('0x1f')]||null:null})[_0x8dc6('0x20')](function(_0x39fd8f){if(_0x39fd8f){return _0x39fd8f['addTags'](_0x48615a[_0x8dc6('0x21')][_0x8dc6('0x22')],_['omit'](_0x48615a[_0x8dc6('0x21')],[_0x8dc6('0x22'),'id'])||{});}})[_0x8dc6('0x23')](function(_0x4faee0){logger[_0x8dc6('0xf')]('AddTags',_0x48615a);logger[_0x8dc6('0x12')](_0x8dc6('0x24'),_0x48615a,JSON[_0x8dc6('0x14')](_0x4faee0));_0xde938c(_0x4faee0);})[_0x8dc6('0x17')](function(_0x4b1917){logger['error'](_0x8dc6('0x24'),_0x4b1917[_0x8dc6('0x16')],_0x48615a);_0x3a0401(_this[_0x8dc6('0x15')](0x1f4,_0x4b1917['message']));});});};
\ No newline at end of file
index 6457d08..bce9535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb925=['emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','remove','update'];(function(_0x2403a3,_0x493058){var _0x5ecb7a=function(_0x16afe9){while(--_0x16afe9){_0x2403a3['push'](_0x2403a3['shift']());}};_0x5ecb7a(++_0x493058);}(_0xb925,0x14d));var _0x5b92=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0xb925[_0x456b57];return _0x18f49f;};'use strict';var MailInteractionEvents=require(_0x5b92('0x0'));var events=['save',_0x5b92('0x1'),_0x5b92('0x2')];function createListener(_0xee5402,_0x47a5fe){return function(_0x5a0607){_0x47a5fe[_0x5b92('0x3')](_0xee5402,_0x5a0607);};}function removeListener(_0x317632,_0x45a672){return function(){MailInteractionEvents[_0x5b92('0x4')](_0x317632,_0x45a672);};}exports[_0x5b92('0x5')]=function(_0x5d7f46){for(var _0x1d8ce1=0x0,_0x356c9a=events[_0x5b92('0x6')];_0x1d8ce1<_0x356c9a;_0x1d8ce1++){var _0x10ebc8=events[_0x1d8ce1];var _0x3cbb99=createListener(_0x5b92('0x7')+_0x10ebc8,_0x5d7f46);MailInteractionEvents['on'](_0x10ebc8,_0x3cbb99);}};
\ No newline at end of file
+var _0x2ed7=['mailInteraction:','save','update','removeListener','length'];(function(_0xb9336b,_0x4f72a6){var _0x33d081=function(_0x25c16a){while(--_0x25c16a){_0xb9336b['push'](_0xb9336b['shift']());}};_0x33d081(++_0x4f72a6);}(_0x2ed7,0x105));var _0x72ed=function(_0x1627c0,_0x58f53f){_0x1627c0=_0x1627c0-0x0;var _0x36eaff=_0x2ed7[_0x1627c0];return _0x36eaff;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x72ed('0x0'),'remove',_0x72ed('0x1')];function createListener(_0x2bce87,_0x1e6e95){return function(_0x5431fe){_0x1e6e95['emit'](_0x2bce87,_0x5431fe);};}function removeListener(_0x3e4339,_0x20c0df){return function(){MailInteractionEvents[_0x72ed('0x2')](_0x3e4339,_0x20c0df);};}exports['register']=function(_0x57e7aa){for(var _0x53d69c=0x0,_0x2c55b0=events[_0x72ed('0x3')];_0x53d69c<_0x2c55b0;_0x53d69c++){var _0x531dc3=events[_0x53d69c];var _0x394593=createListener(_0x72ed('0x4')+_0x531dc3,_0x57e7aa);MailInteractionEvents['on'](_0x531dc3,_0x394593);}};
\ No newline at end of file
index 92b355e..7b548bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa204=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','reject'];(function(_0xd66857,_0x21381a){var _0x57e930=function(_0x4f20b2){while(--_0x4f20b2){_0xd66857['push'](_0xd66857['shift']());}};_0x57e930(++_0x21381a);}(_0xa204,0x152));var _0x4a20=function(_0x4b59e7,_0x499f1e){_0x4b59e7=_0x4b59e7-0x0;var _0x5688ee=_0xa204[_0x4b59e7];return _0x5688ee;};'use strict';var multer=require(_0x4a20('0x0'));var util=require(_0x4a20('0x1'));var path=require('path');var timeout=require(_0x4a20('0x2'));var express=require(_0x4a20('0x3'));var router=express[_0x4a20('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4a20('0x5'));var interaction=require(_0x4a20('0x6'));var config=require(_0x4a20('0x7'));var controller=require(_0x4a20('0x8'));router[_0x4a20('0x9')]('/',auth[_0x4a20('0xa')](),controller[_0x4a20('0xb')]);router[_0x4a20('0x9')]('/describe',auth[_0x4a20('0xa')](),controller[_0x4a20('0xc')]);router[_0x4a20('0x9')](_0x4a20('0xd'),auth['isAuthenticated'](),controller[_0x4a20('0xe')]);router[_0x4a20('0x9')](_0x4a20('0xf'),auth[_0x4a20('0xa')](),controller[_0x4a20('0x10')]);router[_0x4a20('0x11')]('/',auth[_0x4a20('0xa')](),interaction[_0x4a20('0x12')](_0x4a20('0x13'),_0x4a20('0x14')),controller['create']);router[_0x4a20('0x15')](_0x4a20('0xd'),auth['isAuthenticated'](),controller[_0x4a20('0x16')]);router[_0x4a20('0x15')](_0x4a20('0x17'),auth['isAuthenticated'](),controller[_0x4a20('0x18')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x4a20('0x19')]);router['delete'](_0x4a20('0xd'),auth['isAuthenticated'](),controller[_0x4a20('0x1a')]);module[_0x4a20('0x1b')]=router;
\ No newline at end of file
+var _0xfecd=['download','post','tracked','mail','create','/:id','update','put','/:id/accept','accept','reject','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x38b7f2,_0x3c12ca){var _0x284466=function(_0xb69551){while(--_0xb69551){_0x38b7f2['push'](_0x38b7f2['shift']());}};_0x284466(++_0x3c12ca);}(_0xfecd,0x107));var _0xdfec=function(_0x3966c7,_0x3ba255){_0x3966c7=_0x3966c7-0x0;var _0x4779ff=_0xfecd[_0x3966c7];return _0x4779ff;};'use strict';var multer=require(_0xdfec('0x0'));var util=require('util');var path=require(_0xdfec('0x1'));var timeout=require(_0xdfec('0x2'));var express=require('express');var router=express[_0xdfec('0x3')]();var fs_extra=require(_0xdfec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdfec('0x5'));var config=require('../../config/environment');var controller=require(_0xdfec('0x6'));router[_0xdfec('0x7')]('/',auth[_0xdfec('0x8')](),controller['index']);router[_0xdfec('0x7')](_0xdfec('0x9'),auth[_0xdfec('0x8')](),controller[_0xdfec('0xa')]);router[_0xdfec('0x7')]('/:id',auth[_0xdfec('0x8')](),controller[_0xdfec('0xb')]);router[_0xdfec('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xdfec('0xc')]);router[_0xdfec('0xd')]('/',auth['isAuthenticated'](),interaction[_0xdfec('0xe')](_0xdfec('0xf'),'mailmessage:create'),controller[_0xdfec('0x10')]);router['put'](_0xdfec('0x11'),auth[_0xdfec('0x8')](),controller[_0xdfec('0x12')]);router[_0xdfec('0x13')](_0xdfec('0x14'),auth[_0xdfec('0x8')](),controller[_0xdfec('0x15')]);router[_0xdfec('0x13')]('/:id/reject',auth[_0xdfec('0x8')](),controller[_0xdfec('0x16')]);router['delete'](_0xdfec('0x11'),auth['isAuthenticated'](),controller[_0xdfec('0x17')]);module[_0xdfec('0x18')]=router;
\ No newline at end of file
index ab71f87..371f0bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x027c=['medium','BOOLEAN','ENUM','out','STRING','INTEGER','Chat','Email','sequelize','lodash','exports','TEXT','long'];(function(_0x344128,_0x9b9e88){var _0x693fae=function(_0x3e2b2e){while(--_0x3e2b2e){_0x344128['push'](_0x344128['shift']());}};_0x693fae(++_0x9b9e88);}(_0x027c,0x1dc));var _0xc027=function(_0x225e34,_0xd9274){_0x225e34=_0x225e34-0x0;var _0x30a46f=_0x027c[_0x225e34];return _0x30a46f;};'use strict';var Sequelize=require(_0xc027('0x0'));var _=require(_0xc027('0x1'));module[_0xc027('0x2')]={'body':{'type':Sequelize[_0xc027('0x3')](_0xc027('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xc027('0x3')](_0xc027('0x5'))},'read':{'type':Sequelize[_0xc027('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc027('0x7')]('in',_0xc027('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xc027('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xc027('0x3')](_0xc027('0x4'))},'cc':{'type':Sequelize[_0xc027('0x3')](_0xc027('0x4'))},'bcc':{'type':Sequelize[_0xc027('0x3')](_0xc027('0x4'))},'subject':{'type':Sequelize[_0xc027('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xc027('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xc027('0x3')](_0xc027('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0xc027('0x4'))},'originChannel':{'type':Sequelize[_0xc027('0x7')]('Email',_0xc027('0xb')),'defaultValue':_0xc027('0xc'),'allowNull':![]}};
\ No newline at end of file
+var _0x1c70=['ENUM','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x1c70,0xe3));var _0x01c7=function(_0x25fc41,_0x250864){_0x25fc41=_0x25fc41-0x0;var _0x1371d1=_0x1c70[_0x25fc41];return _0x1371d1;};'use strict';var Sequelize=require(_0x01c7('0x0'));var _=require(_0x01c7('0x1'));module[_0x01c7('0x2')]={'body':{'type':Sequelize[_0x01c7('0x3')](_0x01c7('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x01c7('0x3')](_0x01c7('0x5'))},'read':{'type':Sequelize[_0x01c7('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x01c7('0x7')),'defaultValue':_0x01c7('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x01c7('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT'](_0x01c7('0x4'))},'bcc':{'type':Sequelize[_0x01c7('0x3')](_0x01c7('0x4'))},'subject':{'type':Sequelize[_0x01c7('0x3')]},'sentAt':{'type':Sequelize[_0x01c7('0x9')]},'attach':{'type':Sequelize[_0x01c7('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x01c7('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0x01c7('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0x01c7('0x4'))},'originChannel':{'type':Sequelize[_0x01c7('0xb')](_0x01c7('0xc'),_0x01c7('0xd')),'defaultValue':_0x01c7('0xc'),'allowNull':![]}};
\ No newline at end of file
index 6231ddd..dd92f72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3926=['destroy','end','name','send','index','MailMessage','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','show','params','rawAttributes','keys','includeAll','body','find','describe','create','direction','out','secret','split','findOne','MailAccountId','List','Contacts','updatedAt','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','format','accept','mail','readAt','UserId','agent','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','channel','event','fromString','EventManager','acceptmessage','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','contact','interface','SIP/%s','motionChannel','reject','rejectmessage','download','unix','server','files','tmp','from','bcc','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','writeFileSync','unlinkSync','eml-format','moment','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','offset','limit','count','set','Content-Range','json','update'];(function(_0x546895,_0xb414da){var _0x3b5a09=function(_0x1da01c){while(--_0x1da01c){_0x546895['push'](_0x546895['shift']());}};_0x3b5a09(++_0xb414da);}(_0x3926,0x1b4));var _0x6392=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x3926[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0x6392('0x0'));var moment=require(_0x6392('0x1'));var BPromise=require('bluebird');var util=require(_0x6392('0x2'));var path=require(_0x6392('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x6392('0x4'));var htmlToText=require(_0x6392('0x5'));var qs=require(_0x6392('0x6'));var logger=require(_0x6392('0x7'))(_0x6392('0x8'));var interaction_log=require(_0x6392('0x7'))(_0x6392('0x9'));var config=require(_0x6392('0xa'));var db=require(_0x6392('0xb'))['db'];config[_0x6392('0xc')]=_[_0x6392('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6392('0xc')]));var htmlEntities=require('html-entities');require(_0x6392('0xe'))[_0x6392('0xf')](socket);var jayson=require(_0x6392('0x10'));var client=jayson[_0x6392('0x11')][_0x6392('0x12')]({'port':0x232c});var client9003=jayson[_0x6392('0x11')][_0x6392('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x6392('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x41f0a7,_0x5b4d5b,_0x5f250d,_0x2c5ca6){return new BPromise(function(_0x5a846a,_0xfd8a00){var _0x582e23=_0x2c5ca6||client;return _0x582e23[_0x6392('0x13')](_0x41f0a7,_0x5f250d)['then'](function(_0x33032a){logger[_0x6392('0x14')](_0x6392('0x15'),_0x5b4d5b,_0x6392('0x16'));logger[_0x6392('0x17')](_0x6392('0x18'),_0x5b4d5b,'request\x20sent',JSON[_0x6392('0x19')](_0x33032a));if(_0x33032a[_0x6392('0x1a')]){if(_0x33032a[_0x6392('0x1a')]['code']===0x1f4){logger['error'](_0x6392('0x15'),_0x5b4d5b,_0x33032a[_0x6392('0x1a')]['message']);return _0xfd8a00(_0x33032a[_0x6392('0x1a')][_0x6392('0x1b')]);}logger['error'](_0x6392('0x15'),_0x5b4d5b,_0x33032a[_0x6392('0x1a')][_0x6392('0x1b')]);return _0x5a846a(_0x33032a[_0x6392('0x1a')]['message']);}else{logger[_0x6392('0x14')]('MailMessage,\x20%s,\x20%s',_0x5b4d5b,_0x6392('0x16'));_0x5a846a(_0x33032a[_0x6392('0x1c')][_0x6392('0x1b')]);}})[_0x6392('0x1d')](function(_0x199217){logger['error'](_0x6392('0x15'),_0x5b4d5b,_0x199217);_0xfd8a00(_0x199217);});});}function respondWithResult(_0x2b17fb,_0xdee328){_0xdee328=_0xdee328||0xc8;return function(_0x38111a){if(_0x38111a){return _0x2b17fb[_0x6392('0x1e')](_0xdee328)['json'](_0x38111a);}};}function respondWithFilteredResult(_0x44eccb,_0x76e475){return function(_0x4d046e){if(_0x4d046e){var _0x22d317=typeof _0x76e475[_0x6392('0x1f')]==='undefined'&&typeof _0x76e475[_0x6392('0x20')]==='undefined';var _0x2755b0=_0x4d046e[_0x6392('0x21')];var _0x26f36b=_0x22d317?0x0:_0x76e475[_0x6392('0x1f')];var _0xc2ddb8=_0x22d317?_0x4d046e[_0x6392('0x21')]:_0x76e475[_0x6392('0x1f')]+_0x76e475['limit'];var _0x54e0aa;if(_0xc2ddb8>=_0x2755b0){_0xc2ddb8=_0x2755b0;_0x54e0aa=0xc8;}else{_0x54e0aa=0xce;}_0x44eccb[_0x6392('0x1e')](_0x54e0aa);return _0x44eccb[_0x6392('0x22')](_0x6392('0x23'),_0x26f36b+'-'+_0xc2ddb8+'/'+_0x2755b0)[_0x6392('0x24')](_0x4d046e);}return null;};}function saveUpdates(_0xa27500){return function(_0x995950){if(_0x995950){return _0x995950[_0x6392('0x25')](_0xa27500)['then'](function(_0x3a0ab){return _0x3a0ab;});}return null;};}function removeEntity(_0x2a98b3){return function(_0xda5c06){if(_0xda5c06){return _0xda5c06[_0x6392('0x26')]()['then'](function(){_0x2a98b3[_0x6392('0x1e')](0xcc)[_0x6392('0x27')]();});}};}function handleEntityNotFound(_0x431bbe){return function(_0x9c5580){if(!_0x9c5580){_0x431bbe['sendStatus'](0x194);}return _0x9c5580;};}function handleError(_0x214564,_0x53a3f0){_0x53a3f0=_0x53a3f0||0x1f4;return function(_0xa0d1bb){logger[_0x6392('0x1a')](_0xa0d1bb['stack']);if(_0xa0d1bb[_0x6392('0x28')]){delete _0xa0d1bb['name'];}_0x214564[_0x6392('0x1e')](_0x53a3f0)[_0x6392('0x29')](_0xa0d1bb);};}exports[_0x6392('0x2a')]=function(_0x596300,_0x1853b0){var _0x30b5c7={},_0x3f3857={},_0x59885d={'count':0x0,'rows':[]};var _0xe5ef53=_['map'](db[_0x6392('0x2b')]['rawAttributes'],function(_0x2072c5){return{'name':_0x2072c5[_0x6392('0x2c')],'type':_0x2072c5[_0x6392('0x2d')][_0x6392('0x2e')]};});_0x3f3857[_0x6392('0x2f')]=_[_0x6392('0x30')](_0xe5ef53,'name');_0x3f3857[_0x6392('0x31')]=_['keys'](_0x596300['query']);_0x3f3857[_0x6392('0x32')]=_[_0x6392('0x33')](_0x3f3857[_0x6392('0x2f')],_0x3f3857[_0x6392('0x31')]);_0x30b5c7[_0x6392('0x34')]=_[_0x6392('0x33')](_0x3f3857[_0x6392('0x2f')],qs[_0x6392('0x35')](_0x596300[_0x6392('0x31')][_0x6392('0x35')]));_0x30b5c7[_0x6392('0x34')]=_0x30b5c7['attributes'][_0x6392('0x36')]?_0x30b5c7['attributes']:_0x3f3857[_0x6392('0x2f')];if(!_0x596300[_0x6392('0x31')][_0x6392('0x37')](_0x6392('0x38'))){_0x30b5c7[_0x6392('0x20')]=qs['limit'](_0x596300[_0x6392('0x31')]['limit']);_0x30b5c7['offset']=qs[_0x6392('0x1f')](_0x596300['query'][_0x6392('0x1f')]);}_0x30b5c7[_0x6392('0x39')]=qs[_0x6392('0x3a')](_0x596300['query'][_0x6392('0x3a')]);_0x30b5c7[_0x6392('0x3b')]=qs[_0x6392('0x32')](_[_0x6392('0x3c')](_0x596300[_0x6392('0x31')],_0x3f3857[_0x6392('0x32')]),_0xe5ef53);if(_0x596300[_0x6392('0x31')][_0x6392('0x3d')]){_0x30b5c7['where']=_[_0x6392('0x3e')](_0x30b5c7[_0x6392('0x3b')],{'$or':_['map'](_0xe5ef53,function(_0x52852d){if(_0x52852d[_0x6392('0x2d')]!==_0x6392('0x3f')){var _0x47a7a9={};_0x47a7a9[_0x52852d[_0x6392('0x28')]]={'$like':'%'+_0x596300[_0x6392('0x31')]['filter']+'%'};return _0x47a7a9;}})});}_0x30b5c7=_[_0x6392('0x3e')]({},_0x30b5c7,_0x596300[_0x6392('0x40')]);var _0x56021d={'where':_0x30b5c7[_0x6392('0x3b')]};return db[_0x6392('0x2b')][_0x6392('0x21')](_0x56021d)[_0x6392('0x41')](function(_0x599e33){_0x59885d[_0x6392('0x21')]=_0x599e33;if(_0x596300[_0x6392('0x31')]['includeAll']){_0x30b5c7[_0x6392('0x42')]=[{'all':!![]}];}return db[_0x6392('0x2b')]['findAll'](_0x30b5c7);})[_0x6392('0x41')](function(_0x5b7e36){_0x59885d['rows']=_0x5b7e36;return _0x59885d;})[_0x6392('0x41')](respondWithFilteredResult(_0x1853b0,_0x30b5c7))[_0x6392('0x1d')](handleError(_0x1853b0,null));};exports[_0x6392('0x43')]=function(_0x390a75,_0x7e6575){var _0x137939={'raw':!![],'where':{'id':_0x390a75[_0x6392('0x44')]['id']}},_0x2d7efc={};_0x2d7efc[_0x6392('0x2f')]=_['keys'](db[_0x6392('0x2b')][_0x6392('0x45')]);_0x2d7efc['query']=_[_0x6392('0x46')](_0x390a75[_0x6392('0x31')]);_0x2d7efc[_0x6392('0x32')]=_[_0x6392('0x33')](_0x2d7efc[_0x6392('0x2f')],_0x2d7efc[_0x6392('0x31')]);_0x137939[_0x6392('0x34')]=_[_0x6392('0x33')](_0x2d7efc['model'],qs[_0x6392('0x35')](_0x390a75['query']['fields']));_0x137939['attributes']=_0x137939[_0x6392('0x34')][_0x6392('0x36')]?_0x137939[_0x6392('0x34')]:_0x2d7efc[_0x6392('0x2f')];if(_0x390a75[_0x6392('0x31')][_0x6392('0x47')]){_0x137939[_0x6392('0x42')]=[{'all':!![]}];}_0x137939=_[_0x6392('0x3e')]({},_0x137939,_0x390a75[_0x6392('0x40')]);return db[_0x6392('0x2b')]['find'](_0x137939)[_0x6392('0x41')](handleEntityNotFound(_0x7e6575,null))[_0x6392('0x41')](respondWithResult(_0x7e6575,null))[_0x6392('0x1d')](handleError(_0x7e6575,null));};exports[_0x6392('0x25')]=function(_0x28906f,_0x2dfbef){if(_0x28906f[_0x6392('0x48')]['id']){delete _0x28906f[_0x6392('0x48')]['id'];}return db[_0x6392('0x2b')]['find']({'where':{'id':_0x28906f[_0x6392('0x44')]['id']}})[_0x6392('0x41')](handleEntityNotFound(_0x2dfbef,null))['then'](saveUpdates(_0x28906f[_0x6392('0x48')],null))[_0x6392('0x41')](respondWithResult(_0x2dfbef,null))[_0x6392('0x1d')](handleError(_0x2dfbef,null));};exports[_0x6392('0x26')]=function(_0x1a7aa5,_0x34b24b){return db['MailMessage'][_0x6392('0x49')]({'where':{'id':_0x1a7aa5[_0x6392('0x44')]['id']}})[_0x6392('0x41')](handleEntityNotFound(_0x34b24b,null))[_0x6392('0x41')](removeEntity(_0x34b24b,null))[_0x6392('0x1d')](handleError(_0x34b24b,null));};exports[_0x6392('0x4a')]=function(_0x165d3a,_0x187688){return db[_0x6392('0x2b')]['describe']()[_0x6392('0x41')](respondWithResult(_0x187688,null))['catch'](handleError(_0x187688,null));};exports[_0x6392('0x4b')]=function(_0xe1bb07,_0x2fb2cb){return db[_0x6392('0x2b')]['create'](_0xe1bb07['body'])['then'](function(_0x2bb0a5){if(_0x2bb0a5){if(_0x2bb0a5[_0x6392('0x4c')]===_0x6392('0x4d')&&!_0x2bb0a5[_0x6392('0x4e')]){var _0x325a1e,_0x4fc407,_0x173896;if(_0xe1bb07[_0x6392('0x48')]['to']){_0x4fc407=_0xe1bb07[_0x6392('0x48')]['to'][_0x6392('0x4f')](',')[0x0];}return db['MailAccount'][_0x6392('0x50')]({'where':{'id':_0x2bb0a5[_0x6392('0x51')]},'include':[{'model':db['CmList'],'as':_0x6392('0x52'),'include':[{'model':db['CmContact'],'as':_0x6392('0x53'),'where':{'email':_0x4fc407},'limit':0x1,'order':[[_0x6392('0x54'),'DESC']]}]},{'model':db[_0x6392('0x55')],'as':'Smtp','raw':!![]}]})[_0x6392('0x41')](function(_0x486109){_0x325a1e=_0x486109;if(_0x325a1e&&_0x325a1e['Smtp']){var _0x37abf9={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x325a1e[_0x6392('0x56')][_0x6392('0x57')])){_0x37abf9[_0x6392('0x58')]=_0x325a1e[_0x6392('0x56')][_0x6392('0x58')];_0x37abf9[_0x6392('0x59')]=_0x325a1e[_0x6392('0x56')]['port'];_0x37abf9[_0x6392('0x5a')]=_0x325a1e[_0x6392('0x56')][_0x6392('0x5a')];if(_0x325a1e[_0x6392('0x56')][_0x6392('0x5b')]){_0x37abf9[_0x6392('0x5c')]={'user':_0x325a1e[_0x6392('0x56')][_0x6392('0x5d')],'pass':_0x325a1e[_0x6392('0x56')][_0x6392('0x5e')]};}}else{_0x37abf9[_0x6392('0x57')]=_0x325a1e[_0x6392('0x56')][_0x6392('0x57')];_0x37abf9['auth']={'user':_0x325a1e[_0x6392('0x56')]['user'],'pass':_0x325a1e[_0x6392('0x56')][_0x6392('0x5e')]};_0x37abf9[_0x6392('0x5a')]=_0x325a1e[_0x6392('0x56')]['secure'];}if(_0xe1bb07['body']['attachments']&&_0xe1bb07[_0x6392('0x48')]['attachments'][_0x6392('0x36')]){for(var _0xbddc95=0x0;_0xbddc95<_0xe1bb07[_0x6392('0x48')][_0x6392('0x5f')][_0x6392('0x36')];_0xbddc95+=0x1){_0xe1bb07['body']['attachments'][_0xbddc95]={'filename':_0xe1bb07[_0x6392('0x48')]['attachments'][_0xbddc95][_0x6392('0x28')],'path':path[_0x6392('0x60')](config[_0x6392('0x61')],_0x6392('0x62'),_0xe1bb07[_0x6392('0x48')]['attachments'][_0xbddc95][_0x6392('0x63')])};}}_0x173896={'account':_0x37abf9,'message':_0xe1bb07[_0x6392('0x48')]};return;}})[_0x6392('0x41')](function(){if(_0x325a1e[_0x6392('0x52')]){if(_0x325a1e[_0x6392('0x52')][_0x6392('0x53')]['length']){return _0x325a1e[_0x6392('0x52')][_0x6392('0x53')][0x0];}else{return db['CmContact'][_0x6392('0x4b')](_['defaults'](_0xe1bb07[_0x6392('0x48')],{'firstName':_0xe1bb07[_0x6392('0x48')]['to'],'email':_0xe1bb07[_0x6392('0x48')]['to'],'phone':_0xe1bb07[_0x6392('0x48')]['to'],'ListId':_0x325a1e[_0x6392('0x64')]}));}}else{throw new Error(_0x6392('0x65'));}})[_0x6392('0x41')](function(){if(_0x173896){return respondWithRpcPromise(_0x6392('0x66'),'sendMail',_0x173896,client9003)[_0x6392('0x41')](function(_0x25e784){return _0x2bb0a5['update']({'read':!![],'messageId':_0x25e784['messageId'],'sentAt':moment()[_0x6392('0x67')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6392('0x1d')](function(_0x1430b0){logger[_0x6392('0x1a')]('%s',JSON['stringify'](_0x1430b0));return _0x2bb0a5;});}return _0x2bb0a5;});}return _0x2bb0a5;}})[_0x6392('0x41')](respondWithResult(_0x2fb2cb,0xc9))[_0x6392('0x1d')](handleError(_0x2fb2cb,null));};exports[_0x6392('0x68')]=function(_0x4fa01b,_0x41ff9a){var _0x54f500={'agent':{},'channel':_0x6392('0x69')};if(_0x4fa01b[_0x6392('0x48')]['id']){delete _0x4fa01b[_0x6392('0x48')]['id'];}_0x4fa01b[_0x6392('0x48')]['read']=!![];_0x4fa01b[_0x6392('0x48')][_0x6392('0x6a')]=moment()[_0x6392('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x4fa01b[_0x6392('0x48')][_0x6392('0x6b')]=_0x4fa01b[_0x6392('0x48')][_0x6392('0x6b')]||_0x4fa01b['user']['id'];_0x54f500[_0x6392('0x6c')]['id']=_0x4fa01b[_0x6392('0x48')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x4fa01b['params']['id'],'UserId':null}})[_0x6392('0x41')](handleEntityNotFound(_0x41ff9a,null))[_0x6392('0x41')](saveUpdates(_0x4fa01b[_0x6392('0x48')],null))[_0x6392('0x41')](function(_0x3176be){if(_0x3176be){_0x54f500[_0x6392('0x1b')]=_0x3176be['get']({'plain':!![]});return db['MailInteraction'][_0x6392('0x49')]({'where':{'id':_0x3176be[_0x6392('0x6d')]}});}return null;})[_0x6392('0x41')](handleEntityNotFound(_0x41ff9a,null))[_0x6392('0x41')](function(_0x277321){if(_0x277321){return _0x277321[_0x6392('0x25')]({'UserId':_0x4fa01b[_0x6392('0x48')]['UserId'],'read1stAt':_[_0x6392('0x6e')](_0x277321[_0x6392('0x6f')])?moment()[_0x6392('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6392('0x41')](function(_0x30edd7){if(_0x30edd7){_0x54f500[_0x6392('0x70')]=_0x30edd7['get']({'plain':!![]});interaction_log[_0x6392('0x14')](_0x6392('0x71'),_0x4fa01b[_0x6392('0x5d')]['id'],_0x4fa01b[_0x6392('0x5d')][_0x6392('0x28')],_0x4fa01b[_0x6392('0x5d')][_0x6392('0x72')],_0x54f500[_0x6392('0x70')]['id'],_0x4fa01b[_0x6392('0x48')]?JSON[_0x6392('0x19')](_0x4fa01b[_0x6392('0x48')]):'null');return respondWithRpcPromise(_0x6392('0x73'),'acceptMessage',_0x54f500);}return null;})['then'](function(_0x2d6045){var _0xe89523=_0x6392('0x74')+_0x2d6045[_0x6392('0x1b')][_0x6392('0x75')];return db[_0x6392('0x76')]['query'](_0xe89523,{'type':db['Sequelize'][_0x6392('0x77')][_0x6392('0x78')],'raw':!![]})[_0x6392('0x41')](function(_0x3a96d1){return _0x3a96d1;});})['then'](function(_0x10e2a4){if(_0x10e2a4){_0x54f500['message']['contact']=_0x10e2a4[0x0];if(!_0x4fa01b[_0x6392('0x48')][_0x6392('0x6b')])return;return db[_0x6392('0x79')][_0x6392('0x49')]({'where':{'id':_0x4fa01b[_0x6392('0x48')][_0x6392('0x6b')],'role':'agent'},'attributes':['id','name',_0x6392('0x7a'),_0x6392('0x7b'),_0x6392('0x7c')],'raw':!![]});}return null;})[_0x6392('0x41')](function(_0x42bddd){if(!_0x42bddd)return null;_0x54f500[_0x6392('0x1b')]['agent']=_0x42bddd;return _0x54f500;})[_0x6392('0x41')](function(_0x4ffc65){if(_0x4ffc65){if(_0x4fa01b['body'][_0x6392('0x7d')]){_0x54f500[_0x6392('0x1b')]['interface']=util[_0x6392('0x67')]('SIP/%s',_0x4fa01b[_0x6392('0x5d')][_0x6392('0x28')]);_0x54f500[_0x6392('0x1b')][_0x6392('0x7e')]=_0x54f500[_0x6392('0x7e')];_0x54f500['message']['motionChannel']=_0x54f500[_0x6392('0x7e')];_0x54f500[_0x6392('0x1b')][_0x6392('0x7f')]=_0x6392('0x68');_0x54f500[_0x6392('0x1b')][_0x6392('0x48')]=htmlToText[_0x6392('0x80')](_0x54f500[_0x6392('0x1b')][_0x6392('0x48')]);return respondWithRpcPromise('EventManager',_0x6392('0x81'),{'event':_0x6392('0x82'),'message':_0x54f500[_0x6392('0x1b')]},client9002)[_0x6392('0x41')](function(){return _0x54f500;});}return _0x54f500;}return null;})[_0x6392('0x41')](respondWithResult(_0x41ff9a,null))['catch'](handleError(_0x41ff9a,null));};exports['reject']=function(_0x473cab,_0x4bae50){var _0x2e2f3a={'agent':{},'channel':'mail'};if(_0x473cab[_0x6392('0x48')]['id']){delete _0x473cab[_0x6392('0x48')]['id'];}_0x473cab[_0x6392('0x48')][_0x6392('0x6b')]=_0x473cab[_0x6392('0x48')]['UserId']||_0x473cab[_0x6392('0x5d')]['id'];_0x2e2f3a['agent']['id']=_0x473cab[_0x6392('0x48')][_0x6392('0x6b')];return db[_0x6392('0x2b')][_0x6392('0x49')]({'where':{'id':_0x473cab[_0x6392('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4bae50,null))[_0x6392('0x41')](function(_0x4a9d88){if(_0x4a9d88){_0x2e2f3a[_0x6392('0x1b')]=_0x4a9d88[_0x6392('0x83')]({'plain':!![]});return db['MailInteraction'][_0x6392('0x49')]({'where':{'id':_0x4a9d88[_0x6392('0x6d')]}});}return null;})[_0x6392('0x41')](handleEntityNotFound(_0x4bae50,null))['then'](function(_0x10eb3d){if(_0x10eb3d){_0x2e2f3a[_0x6392('0x70')]=_0x10eb3d[_0x6392('0x83')]({'plain':!![]});interaction_log[_0x6392('0x14')](_0x6392('0x84'),_0x473cab['user']['id'],_0x473cab[_0x6392('0x5d')][_0x6392('0x28')],_0x473cab[_0x6392('0x5d')][_0x6392('0x72')],_0x2e2f3a[_0x6392('0x70')]['id'],_0x473cab[_0x6392('0x48')]?JSON['stringify'](_0x473cab[_0x6392('0x48')]):_0x6392('0x85'));return respondWithRpcPromise(_0x6392('0x86'),_0x6392('0x87'),_0x2e2f3a);}return null;})[_0x6392('0x41')](function(_0x1ad140){var _0x5b652c=_0x6392('0x74')+_0x1ad140[_0x6392('0x1b')]['ContactId'];return db[_0x6392('0x76')]['query'](_0x5b652c,{'type':db[_0x6392('0x88')][_0x6392('0x77')]['SELECT'],'raw':!![]})[_0x6392('0x41')](function(_0x4abab4){return _0x4abab4;});})[_0x6392('0x41')](function(_0x41a2d5){if(_0x41a2d5){_0x2e2f3a[_0x6392('0x1b')][_0x6392('0x89')]=_0x41a2d5[0x0];if(!_0x473cab['body']['UserId'])return;return db[_0x6392('0x79')][_0x6392('0x49')]({'where':{'id':_0x473cab['body'][_0x6392('0x6b')],'role':_0x6392('0x6c')},'attributes':['id',_0x6392('0x28'),'fullname',_0x6392('0x7b'),_0x6392('0x7c')],'raw':!![]});}return null;})[_0x6392('0x41')](function(_0x220131){if(!_0x220131)return null;_0x2e2f3a[_0x6392('0x1b')][_0x6392('0x6c')]=_0x220131;return _0x2e2f3a;})[_0x6392('0x41')](function(_0x1cbb99){if(_0x1cbb99){_0x1cbb99[_0x6392('0x1b')][_0x6392('0x8a')]=util[_0x6392('0x67')](_0x6392('0x8b'),_0x473cab[_0x6392('0x5d')][_0x6392('0x28')]);_0x1cbb99[_0x6392('0x1b')][_0x6392('0x7e')]=_0x2e2f3a['channel'];_0x1cbb99[_0x6392('0x1b')][_0x6392('0x8c')]=_0x2e2f3a[_0x6392('0x7e')];_0x1cbb99[_0x6392('0x1b')][_0x6392('0x7f')]=_0x6392('0x8d');_0x1cbb99[_0x6392('0x1b')]['body']=htmlToText[_0x6392('0x80')](_0x2e2f3a[_0x6392('0x1b')][_0x6392('0x48')]);respondWithRpcPromise(_0x6392('0x81'),'EventManager',{'event':_0x6392('0x8e'),'message':_0x1cbb99[_0x6392('0x1b')]},client9002);return _0x2e2f3a;}return null;})[_0x6392('0x41')](respondWithResult(_0x4bae50,null))[_0x6392('0x1d')](handleError(_0x4bae50,null));};exports[_0x6392('0x8f')]=function(_0x277fe3,_0x3f85d6){var _0x3337c7=moment()[_0x6392('0x90')]()['toString']();var _0x46270e=path[_0x6392('0x60')](config['root'],_0x6392('0x91'),_0x6392('0x92'),_0x6392('0x93'));var _0x480fea=path[_0x6392('0x60')](config['root'],_0x6392('0x91'),'files',_0x6392('0x5f'));var _0x5f16ef=util[_0x6392('0x67')]('message-%s.eml',_0x3337c7);return db['MailMessage']['find']({'where':{'id':_0x277fe3[_0x6392('0x44')]['id']},'attributes':['id',_0x6392('0x48'),_0x6392('0x94'),'to','cc',_0x6392('0x95'),_0x6392('0x96'),_0x6392('0x97')],'include':_0x277fe3[_0x6392('0x31')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x6392('0x41')](handleEntityNotFound(_0x3f85d6,null))[_0x6392('0x41')](function(_0x4214ff){if(_0x4214ff){var _0x38dbec=_0x4214ff;var _0x226d58={'from':_0x38dbec[_0x6392('0x94')],'to':_0x38dbec['to'],'subject':_0x38dbec[_0x6392('0x96')],'html':htmlEntities['decode'](_0x38dbec[_0x6392('0x48')]),'headers':{'Date':moment(_0x38dbec[_0x6392('0x97')])[_0x6392('0x67')](_0x6392('0x98'))},'attachments':[]};if(_0x4214ff['cc']){_0x226d58['headers']['Cc']=_0x4214ff['cc'];}if(_0x4214ff[_0x6392('0x95')]){_0x226d58[_0x6392('0x99')]['Bcc']=_0x4214ff[_0x6392('0x95')];}return new BPromise(function(_0x433290,_0xdbf463){if(_0x4214ff[_0x6392('0x9a')]){for(var _0x133658=0x0;_0x133658<_0x4214ff[_0x6392('0x9a')][_0x6392('0x36')];_0x133658++){var _0x4a20fa=_0x4214ff[_0x6392('0x9a')][_0x133658];var _0x228d78=path[_0x6392('0x60')](_0x480fea,_0x4a20fa[_0x6392('0x63')]);if(fs[_0x6392('0x9b')](_0x228d78)){_0x226d58[_0x6392('0x5f')]['push']({'name':_0x4a20fa[_0x6392('0x28')],'contentType':_0x4a20fa[_0x6392('0x2d')],'data':fs['readFileSync'](_0x228d78)});}}}emlformat['build'](_0x226d58,function(_0x4dd350,_0x3b0ae5){if(_0x4dd350)return _0xdbf463(_0x4dd350);fs[_0x6392('0x9c')](path['join'](_0x46270e,_0x5f16ef),_0x3b0ae5);return _0x433290(_0x3b0ae5);});});}})['then'](function(_0x12e6d9){if(_0x12e6d9){return _0x3f85d6[_0x6392('0x8f')](path[_0x6392('0x60')](_0x46270e,_0x5f16ef),_0x5f16ef,function(_0x50cbf6){if(!_0x50cbf6)fs[_0x6392('0x9d')](path['join'](_0x46270e,_0x5f16ef));});}})[_0x6392('0x1d')](handleError(_0x3f85d6,null));};
\ No newline at end of file
+var _0x8202=['send','index','map','MailMessage','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','options','include','findAll','rows','show','rawAttributes','includeAll','find','body','params','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','Contacts','CmContact','defaults','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','MailInteractionId','interaction','null','AcceptMessage','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','reject','MailInteraction','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','User','download','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','api','../../config/logger','mail-interactions','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','name'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8202,0x1ab));var _0x2820=function(_0xa416bf,_0x53d77a){_0xa416bf=_0xa416bf-0x0;var _0x1d4bc5=_0x8202[_0xa416bf];return _0x1d4bc5;};'use strict';var emlformat=require(_0x2820('0x0'));var moment=require(_0x2820('0x1'));var BPromise=require(_0x2820('0x2'));var util=require(_0x2820('0x3'));var path=require(_0x2820('0x4'));var fs=require('fs');var _=require(_0x2820('0x5'));var Redis=require(_0x2820('0x6'));var htmlToText=require(_0x2820('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x2820('0x8'));var interaction_log=require(_0x2820('0x9'))(_0x2820('0xa'));var config=require('../../config/environment');var db=require(_0x2820('0xb'))['db'];config[_0x2820('0xc')]=_['defaults'](config[_0x2820('0xc')],{'host':_0x2820('0xd'),'port':0x18eb});var socket=require(_0x2820('0xe'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0x2820('0xf'))[_0x2820('0x10')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2820('0x11')]({'port':0x232c});var client9003=jayson[_0x2820('0x12')][_0x2820('0x11')]({'port':0x232b});var client9002=jayson[_0x2820('0x12')][_0x2820('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x563ec5,_0x27aa99,_0x5d83f5,_0x4583f7){return new BPromise(function(_0x7136d9,_0x41190c){var _0x288dd0=_0x4583f7||client;return _0x288dd0[_0x2820('0x13')](_0x563ec5,_0x5d83f5)[_0x2820('0x14')](function(_0x4b516f){logger[_0x2820('0x15')](_0x2820('0x16'),_0x27aa99,_0x2820('0x17'));logger[_0x2820('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x27aa99,'request\x20sent',JSON[_0x2820('0x19')](_0x4b516f));if(_0x4b516f['error']){if(_0x4b516f['error'][_0x2820('0x1a')]===0x1f4){logger[_0x2820('0x1b')]('MailMessage,\x20%s,\x20%s',_0x27aa99,_0x4b516f['error'][_0x2820('0x1c')]);return _0x41190c(_0x4b516f[_0x2820('0x1b')][_0x2820('0x1c')]);}logger['error'](_0x2820('0x16'),_0x27aa99,_0x4b516f[_0x2820('0x1b')][_0x2820('0x1c')]);return _0x7136d9(_0x4b516f[_0x2820('0x1b')][_0x2820('0x1c')]);}else{logger[_0x2820('0x15')](_0x2820('0x16'),_0x27aa99,_0x2820('0x17'));_0x7136d9(_0x4b516f[_0x2820('0x1d')][_0x2820('0x1c')]);}})[_0x2820('0x1e')](function(_0x595dc0){logger[_0x2820('0x1b')](_0x2820('0x16'),_0x27aa99,_0x595dc0);_0x41190c(_0x595dc0);});});}function respondWithResult(_0x3dc34c,_0x4f4efe){_0x4f4efe=_0x4f4efe||0xc8;return function(_0x2836cc){if(_0x2836cc){return _0x3dc34c[_0x2820('0x1f')](_0x4f4efe)[_0x2820('0x20')](_0x2836cc);}};}function respondWithFilteredResult(_0x55c93f,_0xd660d0){return function(_0x2eabeb){if(_0x2eabeb){var _0x11eff3=typeof _0xd660d0[_0x2820('0x21')]===_0x2820('0x22')&&typeof _0xd660d0[_0x2820('0x23')]==='undefined';var _0x45020d=_0x2eabeb[_0x2820('0x24')];var _0x2396b8=_0x11eff3?0x0:_0xd660d0[_0x2820('0x21')];var _0x2b5b87=_0x11eff3?_0x2eabeb[_0x2820('0x24')]:_0xd660d0[_0x2820('0x21')]+_0xd660d0[_0x2820('0x23')];var _0xed860d;if(_0x2b5b87>=_0x45020d){_0x2b5b87=_0x45020d;_0xed860d=0xc8;}else{_0xed860d=0xce;}_0x55c93f[_0x2820('0x1f')](_0xed860d);return _0x55c93f[_0x2820('0x25')](_0x2820('0x26'),_0x2396b8+'-'+_0x2b5b87+'/'+_0x45020d)[_0x2820('0x20')](_0x2eabeb);}return null;};}function saveUpdates(_0x131335){return function(_0x2dccd5){if(_0x2dccd5){return _0x2dccd5[_0x2820('0x27')](_0x131335)[_0x2820('0x14')](function(_0x4be03c){return _0x4be03c;});}return null;};}function removeEntity(_0x45c409){return function(_0x1b31e4){if(_0x1b31e4){return _0x1b31e4[_0x2820('0x28')]()['then'](function(){_0x45c409[_0x2820('0x1f')](0xcc)[_0x2820('0x29')]();});}};}function handleEntityNotFound(_0x255e42){return function(_0x264476){if(!_0x264476){_0x255e42[_0x2820('0x2a')](0x194);}return _0x264476;};}function handleError(_0x3d58e5,_0x14bf81){_0x14bf81=_0x14bf81||0x1f4;return function(_0x4d525e){logger[_0x2820('0x1b')](_0x4d525e['stack']);if(_0x4d525e[_0x2820('0x2b')]){delete _0x4d525e[_0x2820('0x2b')];}_0x3d58e5[_0x2820('0x1f')](_0x14bf81)[_0x2820('0x2c')](_0x4d525e);};}exports[_0x2820('0x2d')]=function(_0x5582f5,_0x19bd82){var _0x4d7361={},_0x4d5da9={},_0x3058fd={'count':0x0,'rows':[]};var _0x42cff1=_[_0x2820('0x2e')](db[_0x2820('0x2f')]['rawAttributes'],function(_0x1f0686){return{'name':_0x1f0686[_0x2820('0x30')],'type':_0x1f0686[_0x2820('0x31')]['key']};});_0x4d5da9[_0x2820('0x32')]=_[_0x2820('0x2e')](_0x42cff1,_0x2820('0x2b'));_0x4d5da9['query']=_[_0x2820('0x33')](_0x5582f5[_0x2820('0x34')]);_0x4d5da9[_0x2820('0x35')]=_['intersection'](_0x4d5da9['model'],_0x4d5da9[_0x2820('0x34')]);_0x4d7361[_0x2820('0x36')]=_[_0x2820('0x37')](_0x4d5da9[_0x2820('0x32')],qs[_0x2820('0x38')](_0x5582f5[_0x2820('0x34')][_0x2820('0x38')]));_0x4d7361[_0x2820('0x36')]=_0x4d7361[_0x2820('0x36')][_0x2820('0x39')]?_0x4d7361[_0x2820('0x36')]:_0x4d5da9[_0x2820('0x32')];if(!_0x5582f5['query'][_0x2820('0x3a')]('nolimit')){_0x4d7361[_0x2820('0x23')]=qs[_0x2820('0x23')](_0x5582f5[_0x2820('0x34')]['limit']);_0x4d7361[_0x2820('0x21')]=qs[_0x2820('0x21')](_0x5582f5[_0x2820('0x34')][_0x2820('0x21')]);}_0x4d7361[_0x2820('0x3b')]=qs[_0x2820('0x3c')](_0x5582f5[_0x2820('0x34')][_0x2820('0x3c')]);_0x4d7361[_0x2820('0x3d')]=qs[_0x2820('0x35')](_[_0x2820('0x3e')](_0x5582f5[_0x2820('0x34')],_0x4d5da9[_0x2820('0x35')]),_0x42cff1);if(_0x5582f5[_0x2820('0x34')]['filter']){_0x4d7361[_0x2820('0x3d')]=_[_0x2820('0x3f')](_0x4d7361['where'],{'$or':_[_0x2820('0x2e')](_0x42cff1,function(_0x8d7fc8){if(_0x8d7fc8[_0x2820('0x31')]!=='VIRTUAL'){var _0x3b8a7c={};_0x3b8a7c[_0x8d7fc8[_0x2820('0x2b')]]={'$like':'%'+_0x5582f5[_0x2820('0x34')]['filter']+'%'};return _0x3b8a7c;}})});}_0x4d7361=_['merge']({},_0x4d7361,_0x5582f5[_0x2820('0x40')]);var _0x8271a={'where':_0x4d7361[_0x2820('0x3d')]};return db[_0x2820('0x2f')]['count'](_0x8271a)['then'](function(_0x2b249b){_0x3058fd[_0x2820('0x24')]=_0x2b249b;if(_0x5582f5[_0x2820('0x34')]['includeAll']){_0x4d7361[_0x2820('0x41')]=[{'all':!![]}];}return db[_0x2820('0x2f')][_0x2820('0x42')](_0x4d7361);})['then'](function(_0x40e82e){_0x3058fd[_0x2820('0x43')]=_0x40e82e;return _0x3058fd;})['then'](respondWithFilteredResult(_0x19bd82,_0x4d7361))['catch'](handleError(_0x19bd82,null));};exports[_0x2820('0x44')]=function(_0x167a30,_0x13c5cc){var _0xa83af8={'raw':!![],'where':{'id':_0x167a30['params']['id']}},_0x1314f5={};_0x1314f5[_0x2820('0x32')]=_[_0x2820('0x33')](db[_0x2820('0x2f')][_0x2820('0x45')]);_0x1314f5[_0x2820('0x34')]=_[_0x2820('0x33')](_0x167a30[_0x2820('0x34')]);_0x1314f5[_0x2820('0x35')]=_[_0x2820('0x37')](_0x1314f5['model'],_0x1314f5['query']);_0xa83af8['attributes']=_[_0x2820('0x37')](_0x1314f5[_0x2820('0x32')],qs[_0x2820('0x38')](_0x167a30[_0x2820('0x34')][_0x2820('0x38')]));_0xa83af8['attributes']=_0xa83af8[_0x2820('0x36')][_0x2820('0x39')]?_0xa83af8[_0x2820('0x36')]:_0x1314f5['model'];if(_0x167a30[_0x2820('0x34')][_0x2820('0x46')]){_0xa83af8[_0x2820('0x41')]=[{'all':!![]}];}_0xa83af8=_[_0x2820('0x3f')]({},_0xa83af8,_0x167a30[_0x2820('0x40')]);return db['MailMessage'][_0x2820('0x47')](_0xa83af8)[_0x2820('0x14')](handleEntityNotFound(_0x13c5cc,null))['then'](respondWithResult(_0x13c5cc,null))[_0x2820('0x1e')](handleError(_0x13c5cc,null));};exports[_0x2820('0x27')]=function(_0xc8f2c4,_0x209bd7){if(_0xc8f2c4[_0x2820('0x48')]['id']){delete _0xc8f2c4[_0x2820('0x48')]['id'];}return db[_0x2820('0x2f')][_0x2820('0x47')]({'where':{'id':_0xc8f2c4[_0x2820('0x49')]['id']}})['then'](handleEntityNotFound(_0x209bd7,null))[_0x2820('0x14')](saveUpdates(_0xc8f2c4[_0x2820('0x48')],null))['then'](respondWithResult(_0x209bd7,null))[_0x2820('0x1e')](handleError(_0x209bd7,null));};exports[_0x2820('0x28')]=function(_0x148a0d,_0x2e47b7){return db['MailMessage'][_0x2820('0x47')]({'where':{'id':_0x148a0d[_0x2820('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e47b7,null))[_0x2820('0x14')](removeEntity(_0x2e47b7,null))[_0x2820('0x1e')](handleError(_0x2e47b7,null));};exports['describe']=function(_0x2151e9,_0x8c8ef0){return db['MailMessage']['describe']()[_0x2820('0x14')](respondWithResult(_0x8c8ef0,null))['catch'](handleError(_0x8c8ef0,null));};exports[_0x2820('0x4a')]=function(_0x1d05bd,_0x51d022){return db[_0x2820('0x2f')][_0x2820('0x4a')](_0x1d05bd[_0x2820('0x48')])[_0x2820('0x14')](function(_0x1fdad2){if(_0x1fdad2){if(_0x1fdad2[_0x2820('0x4b')]===_0x2820('0x4c')&&!_0x1fdad2[_0x2820('0x4d')]){var _0x3600ee,_0x5909ce,_0xf3e913;if(_0x1d05bd[_0x2820('0x48')]['to']){_0x5909ce=_0x1d05bd['body']['to'][_0x2820('0x4e')](',')[0x0];}return db[_0x2820('0x4f')]['findOne']({'where':{'id':_0x1fdad2[_0x2820('0x50')]},'include':[{'model':db[_0x2820('0x51')],'as':_0x2820('0x52'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x5909ce},'limit':0x1,'order':[[_0x2820('0x53'),_0x2820('0x54')]]}]},{'model':db['MailServerOut'],'as':_0x2820('0x55'),'raw':!![],'include':[{'model':db[_0x2820('0x56')],'as':_0x2820('0x56'),'raw':!![]}]}]})[_0x2820('0x14')](function(_0x3989bc){_0x3600ee=_0x3989bc;if(!_0x3600ee||!_0x3600ee[_0x2820('0x55')])return;var _0x38046d=_0x3600ee[_0x2820('0x57')]();if(_0x1d05bd[_0x2820('0x48')][_0x2820('0x58')]&&_0x1d05bd[_0x2820('0x48')]['attachments'][_0x2820('0x39')]){for(var _0x7e7f98=0x0;_0x7e7f98<_0x1d05bd[_0x2820('0x48')]['attachments'][_0x2820('0x39')];_0x7e7f98+=0x1){_0x1d05bd[_0x2820('0x48')][_0x2820('0x58')][_0x7e7f98]={'filename':_0x1d05bd['body'][_0x2820('0x58')][_0x7e7f98][_0x2820('0x2b')],'path':path['join'](config[_0x2820('0x59')],_0x2820('0x5a'),_0x1d05bd['body'][_0x2820('0x58')][_0x7e7f98][_0x2820('0x5b')])};}}_0xf3e913={'account':_0x38046d,'message':_0x1d05bd[_0x2820('0x48')]};return;})[_0x2820('0x14')](function(){if(_0x3600ee['List']){if(_0x3600ee[_0x2820('0x52')][_0x2820('0x5c')][_0x2820('0x39')]){return _0x3600ee[_0x2820('0x52')][_0x2820('0x5c')][0x0];}else{return db[_0x2820('0x5d')]['create'](_[_0x2820('0x5e')](_0x1d05bd[_0x2820('0x48')],{'firstName':_0x1d05bd[_0x2820('0x48')]['to'],'email':_0x1d05bd[_0x2820('0x48')]['to'],'phone':_0x1d05bd[_0x2820('0x48')]['to'],'ListId':_0x3600ee[_0x2820('0x5f')]}));}}else{throw new Error(_0x2820('0x60'));}})[_0x2820('0x14')](function(){if(_0xf3e913){return respondWithRpcPromise(_0x2820('0x61'),'sendMail',_0xf3e913,client9003)[_0x2820('0x14')](function(_0x467ca9){return _0x1fdad2['update']({'read':!![],'messageId':_0x467ca9[_0x2820('0x62')],'sentAt':moment()[_0x2820('0x63')](_0x2820('0x64'))});})[_0x2820('0x1e')](function(_0x3edc0f){logger['error']('%s',JSON['stringify'](_0x3edc0f));return _0x1fdad2;});}return _0x1fdad2;});}return _0x1fdad2;}})[_0x2820('0x14')](respondWithResult(_0x51d022,0xc9))[_0x2820('0x1e')](handleError(_0x51d022,null));};exports[_0x2820('0x65')]=function(_0x31c251,_0x212aff){var _0x1ba98f={'agent':{},'channel':_0x2820('0x66')};if(_0x31c251[_0x2820('0x48')]['id']){delete _0x31c251[_0x2820('0x48')]['id'];}_0x31c251[_0x2820('0x48')][_0x2820('0x67')]=!![];_0x31c251[_0x2820('0x48')][_0x2820('0x68')]=moment()['format'](_0x2820('0x64'));_0x31c251[_0x2820('0x48')][_0x2820('0x69')]=_0x31c251['body'][_0x2820('0x69')]||_0x31c251[_0x2820('0x6a')]['id'];_0x1ba98f[_0x2820('0x6b')]['id']=_0x31c251['body'][_0x2820('0x69')];return db[_0x2820('0x2f')][_0x2820('0x47')]({'where':{'id':_0x31c251['params']['id'],'UserId':null}})[_0x2820('0x14')](handleEntityNotFound(_0x212aff,null))[_0x2820('0x14')](saveUpdates(_0x31c251['body'],null))[_0x2820('0x14')](function(_0x4ca7e){if(_0x4ca7e){_0x1ba98f[_0x2820('0x1c')]=_0x4ca7e[_0x2820('0x6c')]({'plain':!![]});return db['MailInteraction'][_0x2820('0x47')]({'where':{'id':_0x4ca7e[_0x2820('0x6d')]}});}return null;})[_0x2820('0x14')](handleEntityNotFound(_0x212aff,null))['then'](function(_0x541341){if(_0x541341){return _0x541341['update']({'UserId':_0x31c251[_0x2820('0x48')][_0x2820('0x69')],'read1stAt':_['isNil'](_0x541341['read1stAt'])?moment()[_0x2820('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2820('0x14')](function(_0x1f3aa9){if(_0x1f3aa9){_0x1ba98f[_0x2820('0x6e')]=_0x1f3aa9[_0x2820('0x6c')]({'plain':!![]});interaction_log[_0x2820('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31c251[_0x2820('0x6a')]['id'],_0x31c251['user'][_0x2820('0x2b')],_0x31c251[_0x2820('0x6a')]['role'],_0x1ba98f[_0x2820('0x6e')]['id'],_0x31c251[_0x2820('0x48')]?JSON[_0x2820('0x19')](_0x31c251[_0x2820('0x48')]):_0x2820('0x6f'));return respondWithRpcPromise(_0x2820('0x70'),'acceptMessage',_0x1ba98f);}return null;})[_0x2820('0x14')](function(_0x32036c){var _0x378c63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x32036c['message']['ContactId'];return db[_0x2820('0x71')][_0x2820('0x34')](_0x378c63,{'type':db[_0x2820('0x72')][_0x2820('0x73')]['SELECT'],'raw':!![]})[_0x2820('0x14')](function(_0x4ab1ca){return _0x4ab1ca;});})['then'](function(_0x13727f){if(_0x13727f){_0x1ba98f[_0x2820('0x1c')][_0x2820('0x74')]=_0x13727f[0x0];if(!_0x31c251['body'][_0x2820('0x69')])return;return db['User'][_0x2820('0x47')]({'where':{'id':_0x31c251[_0x2820('0x48')][_0x2820('0x69')],'role':_0x2820('0x6b')},'attributes':['id','name',_0x2820('0x75'),_0x2820('0x76'),_0x2820('0x77')],'raw':!![]});}return null;})['then'](function(_0x48e60f){if(!_0x48e60f)return null;_0x1ba98f[_0x2820('0x1c')][_0x2820('0x6b')]=_0x48e60f;return _0x1ba98f;})[_0x2820('0x14')](function(_0x4abdd1){if(_0x4abdd1){if(_0x31c251[_0x2820('0x48')][_0x2820('0x78')]){_0x1ba98f['message'][_0x2820('0x79')]=util[_0x2820('0x63')](_0x2820('0x7a'),_0x31c251[_0x2820('0x6a')][_0x2820('0x2b')]);_0x1ba98f[_0x2820('0x1c')][_0x2820('0x7b')]=_0x1ba98f[_0x2820('0x7b')];_0x1ba98f['message']['motionChannel']=_0x1ba98f[_0x2820('0x7b')];_0x1ba98f['message'][_0x2820('0x7c')]=_0x2820('0x65');_0x1ba98f['message'][_0x2820('0x48')]=htmlToText[_0x2820('0x7d')](_0x1ba98f[_0x2820('0x1c')][_0x2820('0x48')]);return respondWithRpcPromise(_0x2820('0x7e'),_0x2820('0x7e'),{'event':'acceptmessage','message':_0x1ba98f[_0x2820('0x1c')]},client9002)[_0x2820('0x14')](function(){return _0x1ba98f;});}return _0x1ba98f;}return null;})['then'](respondWithResult(_0x212aff,null))[_0x2820('0x1e')](handleError(_0x212aff,null));};exports[_0x2820('0x7f')]=function(_0x57e696,_0x46f503){var _0x41e0b9={'agent':{},'channel':_0x2820('0x66')};if(_0x57e696[_0x2820('0x48')]['id']){delete _0x57e696['body']['id'];}_0x57e696['body'][_0x2820('0x69')]=_0x57e696[_0x2820('0x48')][_0x2820('0x69')]||_0x57e696['user']['id'];_0x41e0b9[_0x2820('0x6b')]['id']=_0x57e696[_0x2820('0x48')][_0x2820('0x69')];return db['MailMessage'][_0x2820('0x47')]({'where':{'id':_0x57e696[_0x2820('0x49')]['id'],'UserId':null}})[_0x2820('0x14')](handleEntityNotFound(_0x46f503,null))[_0x2820('0x14')](function(_0x423ac5){if(_0x423ac5){_0x41e0b9[_0x2820('0x1c')]=_0x423ac5[_0x2820('0x6c')]({'plain':!![]});return db[_0x2820('0x80')][_0x2820('0x47')]({'where':{'id':_0x423ac5[_0x2820('0x6d')]}});}return null;})[_0x2820('0x14')](handleEntityNotFound(_0x46f503,null))[_0x2820('0x14')](function(_0x31b92f){if(_0x31b92f){_0x41e0b9[_0x2820('0x6e')]=_0x31b92f[_0x2820('0x6c')]({'plain':!![]});interaction_log[_0x2820('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x57e696[_0x2820('0x6a')]['id'],_0x57e696[_0x2820('0x6a')]['name'],_0x57e696['user'][_0x2820('0x81')],_0x41e0b9['interaction']['id'],_0x57e696['body']?JSON[_0x2820('0x19')](_0x57e696['body']):_0x2820('0x6f'));return respondWithRpcPromise('RejectMessage',_0x2820('0x82'),_0x41e0b9);}return null;})['then'](function(_0x39dacb){var _0x59e196=_0x2820('0x83')+_0x39dacb[_0x2820('0x1c')]['ContactId'];return db[_0x2820('0x71')]['query'](_0x59e196,{'type':db[_0x2820('0x72')][_0x2820('0x73')][_0x2820('0x84')],'raw':!![]})['then'](function(_0x434176){return _0x434176;});})['then'](function(_0x15c1b8){if(_0x15c1b8){_0x41e0b9[_0x2820('0x1c')][_0x2820('0x74')]=_0x15c1b8[0x0];if(!_0x57e696[_0x2820('0x48')]['UserId'])return;return db[_0x2820('0x85')][_0x2820('0x47')]({'where':{'id':_0x57e696['body'][_0x2820('0x69')],'role':_0x2820('0x6b')},'attributes':['id',_0x2820('0x2b'),_0x2820('0x75'),_0x2820('0x76'),'internal'],'raw':!![]});}return null;})[_0x2820('0x14')](function(_0x33f83d){if(!_0x33f83d)return null;_0x41e0b9[_0x2820('0x1c')][_0x2820('0x6b')]=_0x33f83d;return _0x41e0b9;})[_0x2820('0x14')](function(_0x2900fa){if(_0x2900fa){_0x2900fa[_0x2820('0x1c')][_0x2820('0x79')]=util['format'](_0x2820('0x7a'),_0x57e696[_0x2820('0x6a')][_0x2820('0x2b')]);_0x2900fa[_0x2820('0x1c')][_0x2820('0x7b')]=_0x41e0b9['channel'];_0x2900fa[_0x2820('0x1c')]['motionChannel']=_0x41e0b9[_0x2820('0x7b')];_0x2900fa[_0x2820('0x1c')][_0x2820('0x7c')]='reject';_0x2900fa['message'][_0x2820('0x48')]=htmlToText[_0x2820('0x7d')](_0x41e0b9['message']['body']);respondWithRpcPromise(_0x2820('0x7e'),_0x2820('0x7e'),{'event':'rejectmessage','message':_0x2900fa['message']},client9002);return _0x41e0b9;}return null;})[_0x2820('0x14')](respondWithResult(_0x46f503,null))['catch'](handleError(_0x46f503,null));};exports[_0x2820('0x86')]=function(_0x163fe4,_0x4c3b89){var _0x493202=moment()[_0x2820('0x87')]()[_0x2820('0x88')]();var _0x4e556c=path[_0x2820('0x89')](config[_0x2820('0x59')],_0x2820('0x8a'),_0x2820('0x8b'),_0x2820('0x8c'));var _0x4300d9=path['join'](config['root'],'server',_0x2820('0x8b'),'attachments');var _0x1229e2=util[_0x2820('0x63')](_0x2820('0x8d'),_0x493202);return db['MailMessage'][_0x2820('0x47')]({'where':{'id':_0x163fe4[_0x2820('0x49')]['id']},'attributes':['id',_0x2820('0x48'),_0x2820('0x8e'),'to','cc',_0x2820('0x8f'),_0x2820('0x90'),_0x2820('0x91')],'include':_0x163fe4['query'][_0x2820('0x58')]?[{'model':db[_0x2820('0x92')],'as':_0x2820('0x93')}]:undefined})['then'](handleEntityNotFound(_0x4c3b89,null))['then'](function(_0x501db2){if(_0x501db2){var _0x48be42=_0x501db2;var _0x207fd4={'from':_0x48be42[_0x2820('0x8e')],'to':_0x48be42['to'],'subject':_0x48be42['subject'],'html':htmlEntities[_0x2820('0x94')](_0x48be42[_0x2820('0x48')]),'headers':{'Date':moment(_0x48be42[_0x2820('0x91')])[_0x2820('0x63')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x501db2['cc']){_0x207fd4[_0x2820('0x95')]['Cc']=_0x501db2['cc'];}if(_0x501db2[_0x2820('0x8f')]){_0x207fd4[_0x2820('0x95')][_0x2820('0x96')]=_0x501db2[_0x2820('0x8f')];}return new BPromise(function(_0x11823a,_0x1920f0){if(_0x501db2[_0x2820('0x93')]){for(var _0x569d30=0x0;_0x569d30<_0x501db2[_0x2820('0x93')][_0x2820('0x39')];_0x569d30++){var _0x3fe09f=_0x501db2[_0x2820('0x93')][_0x569d30];var _0x5dd32c=path['join'](_0x4300d9,_0x3fe09f[_0x2820('0x5b')]);if(fs[_0x2820('0x97')](_0x5dd32c)){_0x207fd4['attachments'][_0x2820('0x98')]({'name':_0x3fe09f[_0x2820('0x2b')],'contentType':_0x3fe09f[_0x2820('0x31')],'data':fs[_0x2820('0x99')](_0x5dd32c)});}}}emlformat[_0x2820('0x9a')](_0x207fd4,function(_0x2eaf01,_0x2b0454){if(_0x2eaf01)return _0x1920f0(_0x2eaf01);fs[_0x2820('0x9b')](path[_0x2820('0x89')](_0x4e556c,_0x1229e2),_0x2b0454);return _0x11823a(_0x2b0454);});});}})[_0x2820('0x14')](function(_0x53b126){if(_0x53b126){return _0x4c3b89[_0x2820('0x86')](path[_0x2820('0x89')](_0x4e556c,_0x1229e2),_0x1229e2,function(_0x40f345){if(!_0x40f345)fs[_0x2820('0x9c')](path[_0x2820('0x89')](_0x4e556c,_0x1229e2));});}})['catch'](handleError(_0x4c3b89,null));};
\ No newline at end of file
index 2f7aa4a..2a49812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4953=['update','remove','emit','hasOwnProperty','hook','exports','MailMessage','setMaxListeners','save'];(function(_0x12f983,_0x16aa2f){var _0xd7b80e=function(_0x577c6a){while(--_0x577c6a){_0x12f983['push'](_0x12f983['shift']());}};_0xd7b80e(++_0x16aa2f);}(_0x4953,0x189));var _0x3495=function(_0x3f6eb9,_0x5be659){_0x3f6eb9=_0x3f6eb9-0x0;var _0x20bfcf=_0x4953[_0x3f6eb9];return _0x20bfcf;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x3495('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x3495('0x1')](0x0);var events={'afterCreate':_0x3495('0x2'),'afterUpdate':_0x3495('0x3'),'afterDestroy':_0x3495('0x4')};function emitEvent(_0x4fa215){return function(_0x4dfaa8,_0x47130b,_0x1ff92a){MailMessageEvents[_0x3495('0x5')](_0x4fa215+':'+_0x4dfaa8['id'],_0x4dfaa8);MailMessageEvents[_0x3495('0x5')](_0x4fa215,_0x4dfaa8);_0x1ff92a(null);};}for(var e in events){if(events[_0x3495('0x6')](e)){var event=events[e];MailMessage[_0x3495('0x7')](e,emitEvent(event));}}module[_0x3495('0x8')]=MailMessageEvents;
\ No newline at end of file
+var _0x1980=['exports','../../mysqldb','save','emit','hasOwnProperty','hook'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x1980,0x67));var _0x0198=function(_0x297c8a,_0x329ab3){_0x297c8a=_0x297c8a-0x0;var _0x384669=_0x1980[_0x297c8a];return _0x384669;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x0198('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0198('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x55f214){return function(_0x5ec735,_0x9d9a59,_0x503eac){MailMessageEvents['emit'](_0x55f214+':'+_0x5ec735['id'],_0x5ec735);MailMessageEvents[_0x0198('0x2')](_0x55f214,_0x5ec735);_0x503eac(null);};}for(var e in events){if(events[_0x0198('0x3')](e)){var event=events[e];MailMessage[_0x0198('0x4')](e,emitEvent(event));}}module[_0x0198('0x5')]=MailMessageEvents;
\ No newline at end of file
index 7e76410..56bdcf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc6d=['MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','html-to-text','path','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','fromString','models','get','direction','toLowerCase','secret','UserId'];(function(_0x3bc3b4,_0x5acff4){var _0x4c546b=function(_0x158717){while(--_0x158717){_0x3bc3b4['push'](_0x3bc3b4['shift']());}};_0x4c546b(++_0x5acff4);}(_0xbc6d,0x1ba));var _0xdbc6=function(_0x18d50f,_0x124aff){_0x18d50f=_0x18d50f-0x0;var _0x8ce385=_0xbc6d[_0x18d50f];return _0x8ce385;};'use strict';var _=require(_0xdbc6('0x0'));var util=require(_0xdbc6('0x1'));var logger=require('../../config/logger')(_0xdbc6('0x2'));var moment=require(_0xdbc6('0x3'));var BPromise=require(_0xdbc6('0x4'));var rp=require('request-promise');var htmlToText=require(_0xdbc6('0x5'));var fs=require('fs');var path=require(_0xdbc6('0x6'));var rimraf=require('rimraf');var config=require(_0xdbc6('0x7'));var attributes=require('./mailMessage.attributes');module[_0xdbc6('0x8')]=function(_0x30719b,_0x480758){return _0x30719b[_0xdbc6('0x9')](_0xdbc6('0xa'),attributes,{'tableName':_0xdbc6('0xb'),'paranoid':![],'indexes':[{'name':_0xdbc6('0xc'),'fields':[_0xdbc6('0xc')]},{'name':_0xdbc6('0xd'),'fields':[_0xdbc6('0xe'),_0xdbc6('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1e2124,_0x5b2902,_0x5aa46c){if(_0x1e2124['body']){_0x1e2124[_0xdbc6('0xe')]=htmlToText[_0xdbc6('0x10')](_0x1e2124['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5aa46c(null,_0x5b2902);},'afterCreate':function(_0xfd1296,_0x35865b,_0x4b7c03){var _0x1d54fb=_0x30719b[_0xdbc6('0x11')];var _0x1f66b1=_0xfd1296[_0xdbc6('0x12')]({'plain':!![]});if(_0x1f66b1[_0xdbc6('0x13')][_0xdbc6('0x14')]()==='in'||_0x1f66b1[_0xdbc6('0x13')]['toLowerCase']()==='out'&&!_0x1f66b1[_0xdbc6('0x15')]&&!_['isNil'](_0x1f66b1[_0xdbc6('0x16')])){_0x1d54fb[_0xdbc6('0x17')][_0xdbc6('0x18')]({'where':{'id':_0x1f66b1[_0xdbc6('0x19')]}})['then'](function(_0x56bcf8){if(_0x56bcf8){_0x56bcf8[_0xdbc6('0x1a')]({'lastMsgAt':_0x1f66b1[_0xdbc6('0x1b')],'lastMsgDirection':_0x1f66b1['direction'][_0xdbc6('0x14')]()});}})[_0xdbc6('0x1c')](function(_0x1b95f3){console[_0xdbc6('0x1d')](_0x1b95f3);});}_0x4b7c03();}},'charset':_0xdbc6('0x1e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8080=['../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','exports','define','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','secret','MailInteraction','findOne','update','createdAt','error','utf8mb4_unicode_ci','util'];(function(_0x28bfdc,_0x50fd27){var _0x25bf45=function(_0x17f94a){while(--_0x17f94a){_0x28bfdc['push'](_0x28bfdc['shift']());}};_0x25bf45(++_0x50fd27);}(_0x8080,0x86));var _0x0808=function(_0x70d3b5,_0x4bbd30){_0x70d3b5=_0x70d3b5-0x0;var _0x4f96d6=_0x8080[_0x70d3b5];return _0x4f96d6;};'use strict';var _=require('lodash');var util=require(_0x0808('0x0'));var logger=require(_0x0808('0x1'))(_0x0808('0x2'));var moment=require(_0x0808('0x3'));var BPromise=require(_0x0808('0x4'));var rp=require(_0x0808('0x5'));var htmlToText=require(_0x0808('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0808('0x7'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x0808('0x8')]=function(_0x5050a2,_0x4798d2){return _0x5050a2[_0x0808('0x9')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x0808('0xa'),'fields':[_0x0808('0xa')]},{'name':_0x0808('0xb'),'fields':[_0x0808('0xc'),'subject'],'type':_0x0808('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x278f1b,_0x38dc38,_0x344c07){if(_0x278f1b[_0x0808('0xe')]){_0x278f1b[_0x0808('0xc')]=htmlToText[_0x0808('0xf')](_0x278f1b['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x344c07(null,_0x38dc38);},'afterCreate':function(_0x17e51b,_0x21c2c5,_0x35ed2c){var _0x568f6a=_0x5050a2[_0x0808('0x10')];var _0xba7a3c=_0x17e51b[_0x0808('0x11')]({'plain':!![]});if(_0xba7a3c[_0x0808('0x12')][_0x0808('0x13')]()==='in'||_0xba7a3c[_0x0808('0x12')][_0x0808('0x13')]()==='out'&&!_0xba7a3c[_0x0808('0x14')]&&!_['isNil'](_0xba7a3c['UserId'])){_0x568f6a[_0x0808('0x15')][_0x0808('0x16')]({'where':{'id':_0xba7a3c['MailInteractionId']}})['then'](function(_0x147cd5){if(_0x147cd5){_0x147cd5[_0x0808('0x17')]({'lastMsgAt':_0xba7a3c[_0x0808('0x18')],'lastMsgDirection':_0xba7a3c[_0x0808('0x12')][_0x0808('0x13')]()});}})['catch'](function(_0x126efd){console[_0x0808('0x19')](_0x126efd);});}_0x35ed2c();}},'charset':'utf8mb4','collate':_0x0808('0x1a')});};
\ No newline at end of file
index 5e515ed..0189df3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['message','info','result','catch','CreateMailMessage','MailMessage','body','options','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0x4fc2,0x111));var _0x24fc=function(_0x342993,_0x43f554){_0x342993=_0x342993-0x0;var _0x366ce=_0x4fc2[_0x342993];return _0x366ce;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});config['redis']=_[_0x24fc('0xb')](config[_0x24fc('0xc')],{'host':_0x24fc('0xd'),'port':0x18eb});var socket=require(_0x24fc('0xe'))(new Redis(config[_0x24fc('0xc')]));require(_0x24fc('0xf'))['register'](socket);function respondWithRpcPromise(_0x44caca,_0x1819a5,_0x1a4462){return new BPromise(function(_0x133438,_0x24998d){return client[_0x24fc('0x10')](_0x44caca,_0x1a4462)[_0x24fc('0x11')](function(_0x9a1673){logger['info'](_0x24fc('0x12'),_0x1819a5,_0x24fc('0x13'));logger['debug'](_0x24fc('0x14'),_0x1819a5,_0x24fc('0x13'),JSON[_0x24fc('0x15')](_0x9a1673));if(_0x9a1673[_0x24fc('0x16')]){if(_0x9a1673[_0x24fc('0x16')][_0x24fc('0x17')]===0x1f4){logger['error'](_0x24fc('0x12'),_0x1819a5,_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);return _0x24998d(_0x9a1673[_0x24fc('0x16')]['message']);}logger[_0x24fc('0x16')]('MailMessage,\x20%s,\x20%s',_0x1819a5,_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);return _0x133438(_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);}else{logger[_0x24fc('0x19')]('MailMessage,\x20%s,\x20%s',_0x1819a5,_0x24fc('0x13'));_0x133438(_0x9a1673[_0x24fc('0x1a')][_0x24fc('0x18')]);}})[_0x24fc('0x1b')](function(_0x4c5a43){logger[_0x24fc('0x16')](_0x24fc('0x12'),_0x1819a5,_0x4c5a43);_0x24998d(_0x4c5a43);});});}exports[_0x24fc('0x1c')]=function(_0x5b0516){var _0x32a57d=this;return new Promise(function(_0x36a771,_0xbf1d6b){return db[_0x24fc('0x1d')]['create'](_0x5b0516[_0x24fc('0x1e')],{'raw':_0x5b0516['options']?_0x5b0516[_0x24fc('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x24fc('0x11')](function(_0x44c121){logger[_0x24fc('0x19')]('CreateMailMessage',_0x5b0516);logger[_0x24fc('0x20')]('CreateMailMessage',_0x5b0516,JSON[_0x24fc('0x15')](_0x44c121));_0x36a771(_0x44c121);})[_0x24fc('0x1b')](function(_0x36a9b4){logger[_0x24fc('0x16')](_0x24fc('0x1c'),_0x36a9b4[_0x24fc('0x18')],_0x5b0516);_0xbf1d6b(_0x32a57d[_0x24fc('0x16')](0x1f4,_0x36a9b4[_0x24fc('0x18')]));});});};
\ No newline at end of file
+var _0x9f0e=['MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x171446,_0x341df4){var _0x309220=function(_0x1b4e2d){while(--_0x1b4e2d){_0x171446['push'](_0x171446['shift']());}};_0x309220(++_0x341df4);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1fccbd,_0x10d74e){_0x1fccbd=_0x1fccbd-0x0;var _0xa591db=_0x9f0e[_0x1fccbd];return _0xa591db;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe9f0('0xa')]=_[_0xe9f0('0xb')](config[_0xe9f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config[_0xe9f0('0xa')]));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0xa523c0,_0x240932,_0x807322){return new BPromise(function(_0x3724f4,_0x6acfb){return client['request'](_0xa523c0,_0x807322)[_0xe9f0('0xf')](function(_0x329ecd){logger[_0xe9f0('0x10')]('MailMessage,\x20%s,\x20%s',_0x240932,_0xe9f0('0x11'));logger['debug'](_0xe9f0('0x12'),_0x240932,_0xe9f0('0x11'),JSON[_0xe9f0('0x13')](_0x329ecd));if(_0x329ecd[_0xe9f0('0x14')]){if(_0x329ecd['error'][_0xe9f0('0x15')]===0x1f4){logger['error'](_0xe9f0('0x16'),_0x240932,_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);return _0x6acfb(_0x329ecd['error'][_0xe9f0('0x17')]);}logger[_0xe9f0('0x14')](_0xe9f0('0x16'),_0x240932,_0x329ecd['error'][_0xe9f0('0x17')]);return _0x3724f4(_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);}else{logger[_0xe9f0('0x10')](_0xe9f0('0x16'),_0x240932,_0xe9f0('0x11'));_0x3724f4(_0x329ecd[_0xe9f0('0x18')]['message']);}})[_0xe9f0('0x19')](function(_0x19e090){logger[_0xe9f0('0x14')]('MailMessage,\x20%s,\x20%s',_0x240932,_0x19e090);_0x6acfb(_0x19e090);});});}exports[_0xe9f0('0x1a')]=function(_0x30b8c7){var _0x1698cf=this;return new Promise(function(_0x43f399,_0x5ba788){return db[_0xe9f0('0x1b')][_0xe9f0('0x1c')](_0x30b8c7['body'],{'raw':_0x30b8c7['options']?_0x30b8c7['options'][_0xe9f0('0x1d')]===undefined?!![]:![]:!![]})[_0xe9f0('0xf')](function(_0x1211ae){logger[_0xe9f0('0x10')](_0xe9f0('0x1a'),_0x30b8c7);logger['debug'](_0xe9f0('0x1a'),_0x30b8c7,JSON[_0xe9f0('0x13')](_0x1211ae));_0x43f399(_0x1211ae);})[_0xe9f0('0x19')](function(_0x10801b){logger[_0xe9f0('0x14')](_0xe9f0('0x1a'),_0x10801b[_0xe9f0('0x17')],_0x30b8c7);_0x5ba788(_0x1698cf[_0xe9f0('0x14')](0x1f4,_0x10801b[_0xe9f0('0x17')]));});});};
\ No newline at end of file
index 8a873b8..03772bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfd0=['update','emit','removeListener','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x1295da,_0xd85fdd){var _0x48a24b=function(_0x4b33d1){while(--_0x4b33d1){_0x1295da['push'](_0x1295da['shift']());}};_0x48a24b(++_0xd85fdd);}(_0xdfd0,0x13d));var _0x0dfd=function(_0x49a3da,_0x56b87b){_0x49a3da=_0x49a3da-0x0;var _0x1de68f=_0xdfd0[_0x49a3da];return _0x1de68f;};'use strict';var MailMessageEvents=require(_0x0dfd('0x0'));var events=[_0x0dfd('0x1'),_0x0dfd('0x2'),_0x0dfd('0x3')];function createListener(_0x2c221f,_0x2de894){return function(_0x49c182){_0x2de894[_0x0dfd('0x4')](_0x2c221f,_0x49c182);};}function removeListener(_0x5eb8f8,_0xd238ab){return function(){MailMessageEvents[_0x0dfd('0x5')](_0x5eb8f8,_0xd238ab);};}exports['register']=function(_0x1241ee){for(var _0xd8073a=0x0,_0x3edb4c=events[_0x0dfd('0x6')];_0xd8073a<_0x3edb4c;_0xd8073a++){var _0x599039=events[_0xd8073a];var _0x46450a=createListener(_0x0dfd('0x7')+_0x599039,_0x1241ee);MailMessageEvents['on'](_0x599039,_0x46450a);}};
\ No newline at end of file
+var _0x7c6b=['mailMessage:','./mailMessage.events','save','remove','removeListener','register','length'];(function(_0x2ccf3b,_0x4b0e75){var _0x40c065=function(_0x393442){while(--_0x393442){_0x2ccf3b['push'](_0x2ccf3b['shift']());}};_0x40c065(++_0x4b0e75);}(_0x7c6b,0x9b));var _0xb7c6=function(_0x3c85b3,_0x4236c6){_0x3c85b3=_0x3c85b3-0x0;var _0x50df37=_0x7c6b[_0x3c85b3];return _0x50df37;};'use strict';var MailMessageEvents=require(_0xb7c6('0x0'));var events=[_0xb7c6('0x1'),_0xb7c6('0x2'),'update'];function createListener(_0x23f167,_0x17b131){return function(_0x2569de){_0x17b131['emit'](_0x23f167,_0x2569de);};}function removeListener(_0x443ecc,_0x64cd21){return function(){MailMessageEvents[_0xb7c6('0x3')](_0x443ecc,_0x64cd21);};}exports[_0xb7c6('0x4')]=function(_0x509c1e){for(var _0x475e4b=0x0,_0x207840=events[_0xb7c6('0x5')];_0x475e4b<_0x207840;_0x475e4b++){var _0x3103c9=events[_0x475e4b];var _0x311e29=createListener(_0xb7c6('0x6')+_0x3103c9,_0x509c1e);MailMessageEvents['on'](_0x3103c9,_0x311e29);}};
\ No newline at end of file
index 932f6f7..d1120e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfae2=['getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xfae2,0x87));var _0x2fae=function(_0x5d180a,_0x403fba){_0x5d180a=_0x5d180a-0x0;var _0x3089eb=_0xfae2[_0x5d180a];return _0x3089eb;};'use strict';var multer=require('multer');var util=require(_0x2fae('0x0'));var path=require(_0x2fae('0x1'));var timeout=require(_0x2fae('0x2'));var express=require(_0x2fae('0x3'));var router=express[_0x2fae('0x4')]();var fs_extra=require(_0x2fae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2fae('0x6'));var config=require('../../config/environment');var controller=require(_0x2fae('0x7'));router[_0x2fae('0x8')]('/',auth['isAuthenticated'](),controller[_0x2fae('0x9')]);router[_0x2fae('0x8')](_0x2fae('0xa'),auth[_0x2fae('0xb')](),controller[_0x2fae('0xc')]);router['get'](_0x2fae('0xd'),auth['isAuthenticated'](),controller[_0x2fae('0xe')]);router[_0x2fae('0x8')]('/:id/members',auth[_0x2fae('0xb')](),controller[_0x2fae('0xf')]);router[_0x2fae('0x8')]('/:id/teams',auth[_0x2fae('0xb')](),controller[_0x2fae('0x10')]);router['get'](_0x2fae('0x11'),auth[_0x2fae('0xb')](),controller[_0x2fae('0x12')]);router[_0x2fae('0x13')]('/',auth[_0x2fae('0xb')](),controller[_0x2fae('0x14')]);router[_0x2fae('0x13')](_0x2fae('0x15'),auth[_0x2fae('0xb')](),controller[_0x2fae('0x16')]);router[_0x2fae('0x13')](_0x2fae('0x11'),auth[_0x2fae('0xb')](),controller[_0x2fae('0x17')]);router[_0x2fae('0x18')](_0x2fae('0xd'),auth[_0x2fae('0xb')](),controller[_0x2fae('0x19')]);router[_0x2fae('0x1a')](_0x2fae('0xd'),auth[_0x2fae('0xb')](),controller[_0x2fae('0x1b')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x2fae('0x11'),auth['isAuthenticated'](),controller[_0x2fae('0x1c')]);module[_0x2fae('0x1d')]=router;
\ No newline at end of file
+var _0x50e9=['getAgents','create','post','addTeams','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x54f641,_0x740df4){var _0x44ca17=function(_0x240f30){while(--_0x240f30){_0x54f641['push'](_0x54f641['shift']());}};_0x44ca17(++_0x740df4);}(_0x50e9,0x7d));var _0x950e=function(_0x33338f,_0x5bbf06){_0x33338f=_0x33338f-0x0;var _0x2842c6=_0x50e9[_0x33338f];return _0x2842c6;};'use strict';var multer=require(_0x950e('0x0'));var util=require(_0x950e('0x1'));var path=require('path');var timeout=require(_0x950e('0x2'));var express=require(_0x950e('0x3'));var router=express[_0x950e('0x4')]();var fs_extra=require(_0x950e('0x5'));var auth=require(_0x950e('0x6'));var interaction=require(_0x950e('0x7'));var config=require(_0x950e('0x8'));var controller=require(_0x950e('0x9'));router[_0x950e('0xa')]('/',auth[_0x950e('0xb')](),controller['index']);router['get'](_0x950e('0xc'),auth[_0x950e('0xb')](),controller[_0x950e('0xd')]);router[_0x950e('0xa')](_0x950e('0xe'),auth[_0x950e('0xb')](),controller[_0x950e('0xf')]);router['get'](_0x950e('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0x950e('0xa')](_0x950e('0x11'),auth[_0x950e('0xb')](),controller[_0x950e('0x12')]);router['get'](_0x950e('0x13'),auth[_0x950e('0xb')](),controller[_0x950e('0x14')]);router['post']('/',auth[_0x950e('0xb')](),controller[_0x950e('0x15')]);router[_0x950e('0x16')]('/:id/teams',auth[_0x950e('0xb')](),controller[_0x950e('0x17')]);router['post'](_0x950e('0x13'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x950e('0xe'),auth['isAuthenticated'](),controller[_0x950e('0x18')]);router['delete']('/:id',auth[_0x950e('0xb')](),controller['destroy']);router[_0x950e('0x19')](_0x950e('0x11'),auth['isAuthenticated'](),controller[_0x950e('0x1a')]);router['delete'](_0x950e('0x13'),auth['isAuthenticated'](),controller[_0x950e('0x1b')]);module[_0x950e('0x1c')]=router;
\ No newline at end of file
index a22021d..b49d842 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7665=['beepall','roundrobin','sequelize','exports','STRING'];(function(_0x119dfe,_0x31aef1){var _0x57687c=function(_0x508c1c){while(--_0x508c1c){_0x119dfe['push'](_0x119dfe['shift']());}};_0x57687c(++_0x31aef1);}(_0x7665,0xa7));var _0x5766=function(_0xf55ca2,_0x1723ff){_0xf55ca2=_0xf55ca2-0x0;var _0x85aaf=_0x7665[_0xf55ca2];return _0x85aaf;};'use strict';var Sequelize=require(_0x5766('0x0'));module[_0x5766('0x1')]={'name':{'type':Sequelize[_0x5766('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5766('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x5766('0x3'),_0x5766('0x4'))}};
\ No newline at end of file
+var _0x9dc1=['INTEGER','beepall','sequelize','exports','STRING'];(function(_0x40d289,_0x349382){var _0x314cca=function(_0x303417){while(--_0x303417){_0x40d289['push'](_0x40d289['shift']());}};_0x314cca(++_0x349382);}(_0x9dc1,0x138));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x19dc('0x0'));module[_0x19dc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x19dc('0x2')]},'timeout':{'type':Sequelize[_0x19dc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x19dc('0x4'),'roundrobin')}};
\ No newline at end of file
index bcb8056..9dfbaeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x072f=['findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','all','value','removeAgents','emit','userMailQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','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','defaults','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','MailQueues','error','stack','index','MailQueue','fieldName','key','model','map','name','query','keys','intersection','attributes','fields','length','order','where','filters','filter','VIRTUAL','merge','includeAll','include','rows','show','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','get','UserMailQueue','hasOwnProperty','nolimit','sort','pick','MailQueueId','UserId','updatedAt','count','format','%s/%s','SIP','mailPause','getTeams','findOne','Team','addTeams','ids','findAll','User','flatMap','Agents','sequelize','transaction','each'];(function(_0x581960,_0x1232ff){var _0x4ee892=function(_0x2a920d){while(--_0x2a920d){_0x581960['push'](_0x581960['shift']());}};_0x4ee892(++_0x1232ff);}(_0x072f,0x1a7));var _0xf072=function(_0x9271a3,_0x5c9dc4){_0x9271a3=_0x9271a3-0x0;var _0x1fceee=_0x072f[_0x9271a3];return _0x1fceee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf072('0x0'));var zipdir=require(_0xf072('0x1'));var jsonpatch=require(_0xf072('0x2'));var rp=require(_0xf072('0x3'));var moment=require(_0xf072('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf072('0x5'));var path=require(_0xf072('0x6'));var sox=require(_0xf072('0x7'));var csv=require('to-csv');var ejs=require(_0xf072('0x8'));var fs=require('fs');var fs_extra=require(_0xf072('0x9'));var _=require(_0xf072('0xa'));var squel=require(_0xf072('0xb'));var crypto=require(_0xf072('0xc'));var jsforce=require(_0xf072('0xd'));var deskjs=require(_0xf072('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf072('0xf'));var Papa=require(_0xf072('0x10'));var Redis=require(_0xf072('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf072('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf072('0x13'));var logger=require(_0xf072('0x14'))('api');var utils=require(_0xf072('0x15'));var config=require(_0xf072('0x16'));var licenseUtil=require(_0xf072('0x17'));var db=require(_0xf072('0x18'))['db'];config['redis']=_[_0xf072('0x19')](config[_0xf072('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf072('0x1b'))(new Redis(config['redis']));require(_0xf072('0x1c'))[_0xf072('0x1d')](socket);function respondWithStatusCode(_0x4cf5c9,_0x3949a4){_0x3949a4=_0x3949a4||0xcc;return function(_0x4d7705){if(_0x4d7705){return _0x4cf5c9[_0xf072('0x1e')](_0x3949a4);}return _0x4cf5c9[_0xf072('0x1f')](_0x3949a4)[_0xf072('0x20')]();};}function respondWithResult(_0x288680,_0x38fd50){_0x38fd50=_0x38fd50||0xc8;return function(_0x1c9309){if(_0x1c9309){return _0x288680[_0xf072('0x1f')](_0x38fd50)['json'](_0x1c9309);}};}function respondWithFilteredResult(_0x1ba2ba,_0x4f3d58){return function(_0x551b68){if(_0x551b68){var _0x1bdac8=typeof _0x4f3d58[_0xf072('0x21')]==='undefined'&&typeof _0x4f3d58['limit']===_0xf072('0x22');var _0x2178a3=_0x551b68['count'];var _0x197af5=_0x1bdac8?0x0:_0x4f3d58['offset'];var _0x44724f=_0x1bdac8?_0x551b68['count']:_0x4f3d58['offset']+_0x4f3d58[_0xf072('0x23')];var _0x59c03e;if(_0x44724f>=_0x2178a3){_0x44724f=_0x2178a3;_0x59c03e=0xc8;}else{_0x59c03e=0xce;}_0x1ba2ba[_0xf072('0x1f')](_0x59c03e);return _0x1ba2ba[_0xf072('0x24')](_0xf072('0x25'),_0x197af5+'-'+_0x44724f+'/'+_0x2178a3)[_0xf072('0x26')](_0x551b68);}return null;};}function patchUpdates(_0x2b12b3){return function(_0x5ce568){try{jsonpatch[_0xf072('0x27')](_0x5ce568,_0x2b12b3,!![]);}catch(_0x524e40){return BPromise[_0xf072('0x28')](_0x524e40);}return _0x5ce568[_0xf072('0x29')]();};}function saveUpdates(_0x533264,_0x50d9a7){return function(_0x2d693e){if(_0x2d693e){return _0x2d693e[_0xf072('0x2a')](_0x533264)[_0xf072('0x2b')](function(_0x1ac8ab){return _0x1ac8ab;});}return null;};}function removeEntity(_0x479c77,_0x379261){return function(_0x2c2eb6){if(_0x2c2eb6){return _0x2c2eb6[_0xf072('0x2c')]()[_0xf072('0x2b')](function(){var _0x124482=_0x2c2eb6['get']({'plain':!![]});var _0x30ae99=_0xf072('0x2d');return db['UserProfileResource'][_0xf072('0x2c')]({'where':{'type':_0x30ae99,'resourceId':_0x124482['id']}})['then'](function(){return _0x2c2eb6;});})[_0xf072('0x2b')](function(){_0x479c77[_0xf072('0x1f')](0xcc)[_0xf072('0x20')]();});}};}function handleEntityNotFound(_0x795c80,_0x1b24de){return function(_0x29ef25){if(!_0x29ef25){_0x795c80[_0xf072('0x1e')](0x194);}return _0x29ef25;};}function handleError(_0x257a75,_0x57b698){_0x57b698=_0x57b698||0x1f4;return function(_0x171a83){logger[_0xf072('0x2e')](_0x171a83[_0xf072('0x2f')]);if(_0x171a83['name']){delete _0x171a83['name'];}_0x257a75[_0xf072('0x1f')](_0x57b698)['send'](_0x171a83);};}exports[_0xf072('0x30')]=function(_0x5cd03f,_0x355a7e){var _0xadd541={},_0x28890e={},_0x11cbff={'count':0x0,'rows':[]};var _0x4ba352=_['map'](db[_0xf072('0x31')]['rawAttributes'],function(_0x2fefbe){return{'name':_0x2fefbe[_0xf072('0x32')],'type':_0x2fefbe['type'][_0xf072('0x33')]};});_0x28890e[_0xf072('0x34')]=_[_0xf072('0x35')](_0x4ba352,_0xf072('0x36'));_0x28890e[_0xf072('0x37')]=_[_0xf072('0x38')](_0x5cd03f['query']);_0x28890e['filters']=_[_0xf072('0x39')](_0x28890e['model'],_0x28890e['query']);_0xadd541[_0xf072('0x3a')]=_[_0xf072('0x39')](_0x28890e[_0xf072('0x34')],qs[_0xf072('0x3b')](_0x5cd03f[_0xf072('0x37')][_0xf072('0x3b')]));_0xadd541['attributes']=_0xadd541[_0xf072('0x3a')][_0xf072('0x3c')]?_0xadd541[_0xf072('0x3a')]:_0x28890e['model'];if(!_0x5cd03f[_0xf072('0x37')]['hasOwnProperty']('nolimit')){_0xadd541[_0xf072('0x23')]=qs['limit'](_0x5cd03f[_0xf072('0x37')]['limit']);_0xadd541[_0xf072('0x21')]=qs[_0xf072('0x21')](_0x5cd03f[_0xf072('0x37')]['offset']);}_0xadd541[_0xf072('0x3d')]=qs['sort'](_0x5cd03f[_0xf072('0x37')]['sort']);_0xadd541[_0xf072('0x3e')]=qs[_0xf072('0x3f')](_['pick'](_0x5cd03f[_0xf072('0x37')],_0x28890e['filters']),_0x4ba352);if(_0x5cd03f[_0xf072('0x37')][_0xf072('0x40')]){_0xadd541[_0xf072('0x3e')]=_['merge'](_0xadd541[_0xf072('0x3e')],{'$or':_[_0xf072('0x35')](_0x4ba352,function(_0x36129c){if(_0x36129c['type']!==_0xf072('0x41')){var _0x455374={};_0x455374[_0x36129c[_0xf072('0x36')]]={'$like':'%'+_0x5cd03f['query'][_0xf072('0x40')]+'%'};return _0x455374;}})});}_0xadd541=_[_0xf072('0x42')]({},_0xadd541,_0x5cd03f['options']);var _0x3bdcfa={'where':_0xadd541[_0xf072('0x3e')]};return db['MailQueue']['count'](_0x3bdcfa)[_0xf072('0x2b')](function(_0x54cf1a){_0x11cbff['count']=_0x54cf1a;if(_0x5cd03f[_0xf072('0x37')][_0xf072('0x43')]){_0xadd541[_0xf072('0x44')]=[{'all':!![]}];}return db[_0xf072('0x31')]['findAll'](_0xadd541);})[_0xf072('0x2b')](function(_0x18c13d){_0x11cbff[_0xf072('0x45')]=_0x18c13d;return _0x11cbff;})['then'](respondWithFilteredResult(_0x355a7e,_0xadd541))['catch'](handleError(_0x355a7e,null));};exports[_0xf072('0x46')]=function(_0x263f9,_0x50a04b){var _0xc1965d={'raw':!![],'where':{'id':_0x263f9['params']['id']}},_0x23ae8a={};_0x23ae8a[_0xf072('0x34')]=_[_0xf072('0x38')](db[_0xf072('0x31')][_0xf072('0x47')]);_0x23ae8a[_0xf072('0x37')]=_[_0xf072('0x38')](_0x263f9[_0xf072('0x37')]);_0x23ae8a['filters']=_[_0xf072('0x39')](_0x23ae8a['model'],_0x23ae8a['query']);_0xc1965d['attributes']=_[_0xf072('0x39')](_0x23ae8a[_0xf072('0x34')],qs[_0xf072('0x3b')](_0x263f9[_0xf072('0x37')]['fields']));_0xc1965d[_0xf072('0x3a')]=_0xc1965d['attributes'][_0xf072('0x3c')]?_0xc1965d[_0xf072('0x3a')]:_0x23ae8a['model'];if(_0x263f9[_0xf072('0x37')][_0xf072('0x43')]){_0xc1965d[_0xf072('0x44')]=[{'all':!![]}];}_0xc1965d=_['merge']({},_0xc1965d,_0x263f9[_0xf072('0x48')]);return db[_0xf072('0x31')][_0xf072('0x49')](_0xc1965d)[_0xf072('0x2b')](handleEntityNotFound(_0x50a04b,null))[_0xf072('0x2b')](respondWithResult(_0x50a04b,null))[_0xf072('0x4a')](handleError(_0x50a04b,null));};exports[_0xf072('0x4b')]=function(_0x1f55eb,_0x297da6){return db[_0xf072('0x31')]['create'](_0x1f55eb[_0xf072('0x4c')],{})['then'](function(_0x2b0b10){var _0x59b822=_0x1f55eb[_0xf072('0x4d')]['get']({'plain':!![]});if(!_0x59b822)throw new Error(_0xf072('0x4e'));if(_0x59b822[_0xf072('0x4f')]===_0xf072('0x4d')){var _0x318b67=_0x2b0b10['get']({'plain':!![]});var _0x1371b2=_0xf072('0x2d');return db['UserProfileSection'][_0xf072('0x49')]({'where':{'name':_0x1371b2,'userProfileId':_0x59b822['userProfileId']},'raw':!![]})[_0xf072('0x2b')](function(_0x59eb8f){if(_0x59eb8f&&_0x59eb8f['autoAssociation']===0x0){return db['UserProfileResource'][_0xf072('0x4b')]({'name':_0x318b67[_0xf072('0x36')],'resourceId':_0x318b67['id'],'type':_0x59eb8f[_0xf072('0x36')],'sectionId':_0x59eb8f['id']},{})[_0xf072('0x2b')](function(){return _0x2b0b10;});}else{return _0x2b0b10;}})[_0xf072('0x4a')](function(_0x111a1e){logger['error'](_0xf072('0x50'),_0x111a1e);throw _0x111a1e;});}return _0x2b0b10;})[_0xf072('0x2b')](respondWithResult(_0x297da6,0xc9))[_0xf072('0x4a')](handleError(_0x297da6,null));};exports[_0xf072('0x2a')]=function(_0x56b4b7,_0x51a43c){if(_0x56b4b7[_0xf072('0x4c')]['id']){delete _0x56b4b7[_0xf072('0x4c')]['id'];}return db[_0xf072('0x31')]['find']({'where':{'id':_0x56b4b7[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x51a43c,null))[_0xf072('0x2b')](saveUpdates(_0x56b4b7[_0xf072('0x4c')],null))[_0xf072('0x2b')](respondWithResult(_0x51a43c,null))[_0xf072('0x4a')](handleError(_0x51a43c,null));};exports[_0xf072('0x2c')]=function(_0x59fa26,_0x236438){return db['MailQueue'][_0xf072('0x49')]({'where':{'id':_0x59fa26[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x236438,null))[_0xf072('0x2b')](removeEntity(_0x236438,null))[_0xf072('0x4a')](handleError(_0x236438,null));};exports[_0xf072('0x52')]=function(_0x16f89e,_0x12cb59){return db['MailQueue'][_0xf072('0x52')]()['then'](respondWithResult(_0x12cb59,null))['catch'](handleError(_0x12cb59,null));};exports['getMembers']=function(_0x2befa7,_0xb774d1,_0xaa3880){var _0x37f4b2={'raw':!![],'where':{}},_0x2f8bac={},_0x424427;return db[_0xf072('0x31')]['findOne']({'where':{'id':_0x2befa7[_0xf072('0x51')]['id']}})['then'](handleEntityNotFound(_0xb774d1,null))['then'](function(_0x2d5bc7){if(_0x2d5bc7){_0x424427=_0x2d5bc7[_0xf072('0x53')]({'plain':!![]});_0x2f8bac[_0xf072('0x34')]=_[_0xf072('0x38')](db[_0xf072('0x54')]['rawAttributes']);_0x2f8bac[_0xf072('0x37')]=_[_0xf072('0x38')](_0x2befa7[_0xf072('0x37')]);_0x2f8bac[_0xf072('0x3f')]=_['intersection'](_0x2f8bac[_0xf072('0x34')],_0x2f8bac[_0xf072('0x37')]);_0x37f4b2[_0xf072('0x3a')]=_[_0xf072('0x39')](_0x2f8bac[_0xf072('0x34')],qs[_0xf072('0x3b')](_0x2befa7['query']['fields']));_0x37f4b2[_0xf072('0x3a')]=_0x37f4b2[_0xf072('0x3a')][_0xf072('0x3c')]?_0x37f4b2[_0xf072('0x3a')]:_0x2f8bac[_0xf072('0x34')];if(!_0x2befa7[_0xf072('0x37')][_0xf072('0x55')](_0xf072('0x56'))){_0x37f4b2[_0xf072('0x23')]=qs[_0xf072('0x23')](_0x2befa7[_0xf072('0x37')][_0xf072('0x23')]);_0x37f4b2['offset']=qs[_0xf072('0x21')](_0x2befa7['query'][_0xf072('0x21')]);}_0x37f4b2[_0xf072('0x3d')]=qs[_0xf072('0x57')](_0x2befa7[_0xf072('0x37')]['sort']);_0x37f4b2[_0xf072('0x3e')]=qs[_0xf072('0x3f')](_[_0xf072('0x58')](_0x2befa7[_0xf072('0x37')],_0x2f8bac[_0xf072('0x3f')]));_0x37f4b2[_0xf072('0x3e')][_0xf072('0x59')]=_0x2d5bc7['id'];if(_0x2befa7['query'][_0xf072('0x40')]){_0x37f4b2['where']=_['merge'](_0x37f4b2['where'],{'$or':_['map'](_0x37f4b2[_0xf072('0x3a')],function(_0x5e95dc){var _0x1df584={};_0x1df584[_0x5e95dc]={'$like':'%'+_0x2befa7[_0xf072('0x37')]['filter']+'%'};return _0x1df584;})});}_0x37f4b2=_[_0xf072('0x42')]({},_0x37f4b2,_0x2befa7[_0xf072('0x48')]);return db[_0xf072('0x54')]['findAll'](_0x37f4b2);}})[_0xf072('0x2b')](function(_0x2f7de8){if(_0x2f7de8){return db['User']['findAndCountAll']({'where':{'id':_[_0xf072('0x35')](_0x2f7de8,_0xf072('0x5a')),'role':'agent'},'attributes':['id',_0xf072('0x36'),'mailPause',_0xf072('0x5b'),'createdAt']});}})[_0xf072('0x2b')](function(_0x4bb16b){if(_0x4bb16b){return{'count':_0x4bb16b[_0xf072('0x5c')],'rows':_[_0xf072('0x35')](_0x4bb16b[_0xf072('0x45')],function(_0x222790){return{'membername':_0x222790['name'],'UserId':_0x222790['id'],'queue_name':_0x424427[_0xf072('0x36')],'MailQueueId':_0x424427['id'],'interface':util[_0xf072('0x5d')](_0xf072('0x5e'),_0xf072('0x5f'),_0x222790[_0xf072('0x36')]),'penalty':0x0,'paused':_0x222790[_0xf072('0x60')],'createdAt':_0x222790['createdAt'],'updatedAt':_0x222790[_0xf072('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf072('0x2b')](respondWithFilteredResult(_0xb774d1,_0x37f4b2))[_0xf072('0x4a')](handleError(_0xb774d1,null));};exports[_0xf072('0x61')]=function(_0x10b026,_0x2ed98e,_0x36c9bd){var _0x424700={};var _0x570867={};var _0x53b7d8;var _0x43b3fc;return db['MailQueue'][_0xf072('0x62')]({'where':{'id':_0x10b026['params']['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x2ed98e,null))['then'](function(_0x4dc05e){if(_0x4dc05e){_0x53b7d8=_0x4dc05e;_0x570867[_0xf072('0x34')]=_[_0xf072('0x38')](db[_0xf072('0x63')][_0xf072('0x47')]);_0x570867[_0xf072('0x37')]=_[_0xf072('0x38')](_0x10b026[_0xf072('0x37')]);_0x570867[_0xf072('0x3f')]=_['intersection'](_0x570867[_0xf072('0x34')],_0x570867[_0xf072('0x37')]);_0x424700[_0xf072('0x3a')]=_['intersection'](_0x570867[_0xf072('0x34')],qs['fields'](_0x10b026[_0xf072('0x37')][_0xf072('0x3b')]));_0x424700[_0xf072('0x3a')]=_0x424700[_0xf072('0x3a')][_0xf072('0x3c')]?_0x424700[_0xf072('0x3a')]:_0x570867[_0xf072('0x34')];_0x424700[_0xf072('0x3d')]=qs[_0xf072('0x57')](_0x10b026[_0xf072('0x37')]['sort']);_0x424700[_0xf072('0x3e')]=qs[_0xf072('0x3f')](_[_0xf072('0x58')](_0x10b026[_0xf072('0x37')],_0x570867['filters']));if(_0x10b026[_0xf072('0x37')][_0xf072('0x40')]){_0x424700['where']=_[_0xf072('0x42')](_0x424700['where'],{'$or':_[_0xf072('0x35')](_0x424700['attributes'],function(_0x1a714c){var _0x4fabb0={};_0x4fabb0[_0x1a714c]={'$like':'%'+_0x10b026[_0xf072('0x37')][_0xf072('0x40')]+'%'};return _0x4fabb0;})});}_0x424700=_['merge']({},_0x424700,_0x10b026[_0xf072('0x48')]);return _0x53b7d8[_0xf072('0x61')](_0x424700);}})[_0xf072('0x2b')](function(_0xe86e1e){if(_0xe86e1e){_0x43b3fc=_0xe86e1e['length'];if(!_0x10b026[_0xf072('0x37')]['hasOwnProperty'](_0xf072('0x56'))){_0x424700[_0xf072('0x23')]=qs['limit'](_0x10b026[_0xf072('0x37')]['limit']);_0x424700[_0xf072('0x21')]=qs['offset'](_0x10b026[_0xf072('0x37')][_0xf072('0x21')]);}return _0x53b7d8[_0xf072('0x61')](_0x424700);}})['then'](function(_0x2b542e){if(_0x2b542e){return _0x2b542e?{'count':_0x43b3fc,'rows':_0x2b542e}:null;}})[_0xf072('0x2b')](respondWithResult(_0x2ed98e,null))[_0xf072('0x4a')](handleError(_0x2ed98e,null));};exports[_0xf072('0x64')]=function(_0x180cb5,_0x2b1d0f,_0x3f98ed){var _0x1198c7=_0x180cb5[_0xf072('0x4c')][_0xf072('0x65')];return db[_0xf072('0x63')][_0xf072('0x66')]({'where':{'id':_0x1198c7},'attributes':['id'],'include':[{'model':db[_0xf072('0x67')],'as':'Agents','attributes':['id',_0xf072('0x36'),'online','voicePause','interface'],'raw':!![]}]})['then'](function(_0x6dcbed){if(_0x6dcbed){var _0x16e76c=_[_0xf072('0x68')](_0x6dcbed,function(_0x49f5e0){var _0x2f28e4=_0x49f5e0['get']({'plain':!![]});return _0x2f28e4[_0xf072('0x69')];});return db['MailQueue']['find']({'where':{'id':_0x180cb5[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](function(_0x25e6a2){return db[_0xf072('0x6a')][_0xf072('0x6b')](function(_0x476948){return _0x25e6a2[_0xf072('0x64')](_0x1198c7,{'transaction':_0x476948})[_0xf072('0x2b')](function(){return BPromise[_0xf072('0x6c')](_0x16e76c,function(_0x4da3da){return db[_0xf072('0x54')][_0xf072('0x6d')]({'where':{'UserId':_0x4da3da['id'],'MailQueueId':_0x180cb5[_0xf072('0x51')]['id']},'transaction':_0x476948});});})[_0xf072('0x2b')](function(){_0x16e76c[_0xf072('0x6e')](function(_0xd34886){socket['emit'](_0xf072('0x6f'),{'UserId':_0xd34886['id'],'MailQueueId':_0x25e6a2['id']});});});});});}})[_0xf072('0x2b')](respondWithStatusCode(_0x2b1d0f,null))['catch'](handleError(_0x2b1d0f,null));};exports[_0xf072('0x70')]=function(_0x2cb96f,_0x461b5,_0x100ce0){return db[_0xf072('0x63')][_0xf072('0x66')]({'where':{'id':_0x2cb96f[_0xf072('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf072('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf072('0x2b')](handleEntityNotFound(_0x461b5,null))[_0xf072('0x2b')](function(_0x32e516){var _0x42d305=_['map'](_0x32e516,'id');var _0x2ddcaf=[];var _0x11ab02=[];var _0x486221=squel[_0xf072('0x71')]();_0x486221[_0xf072('0x72')](_0xf072('0x73'))[_0xf072('0x74')](_0xf072('0x75'),'tq')['join']('user_has_teams','ut',_0xf072('0x76'))[_0xf072('0x3e')]('MailQueueId\x20=\x20?',_0x2cb96f['params']['id']);for(var _0x3febb1=0x0;_0x3febb1<_0x32e516[_0xf072('0x3c')];_0x3febb1+=0x1){let _0x293a74=_0x32e516[_0x3febb1];for(var _0x4c760c=0x0;_0x4c760c<_0x293a74[_0xf072('0x69')]['length'];_0x4c760c+=0x1){let _0x285dbd=_0x293a74[_0xf072('0x69')][_0x4c760c];var _0x164101=_0x486221['clone']();_0x164101[_0xf072('0x3e')](_0xf072('0x77'),_0x285dbd['id']);_0x11ab02[_0xf072('0x78')](db[_0xf072('0x6a')][_0xf072('0x37')](_0x164101[_0xf072('0x79')](),{'type':db[_0xf072('0x6a')][_0xf072('0x7a')][_0xf072('0x7b')]})[_0xf072('0x2b')](function(_0x54c44d){if(_0x54c44d[_0xf072('0x3c')]===0x1){return _0x285dbd['id'];}else{var _0xdfa554=_['every'](_[_0xf072('0x35')](_0x54c44d,'TeamId'),function(_0x51c860){return _['includes'](_0x42d305,_0x51c860);});if(_0xdfa554){return _0x285dbd['id'];}}}));}}return BPromise[_0xf072('0x7c')](_0x11ab02)['then'](function(_0x4c2fa5){_0x2ddcaf=_(_0x2ddcaf)['union'](_0x4c2fa5)['compact']()[_0xf072('0x7d')]();return db[_0xf072('0x31')][_0xf072('0x49')]({'where':{'id':_0x2cb96f[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](function(_0x3f347a){return db[_0xf072('0x6a')]['transaction'](function(_0x1f0312){return _0x3f347a[_0xf072('0x70')](_0x2cb96f[_0xf072('0x37')][_0xf072('0x65')],{'transaction':_0x1f0312})[_0xf072('0x2b')](function(){if(!_['isEmpty'](_0x2ddcaf)){return _0x3f347a[_0xf072('0x7e')](_0x2ddcaf,{'transaction':_0x1f0312});}})[_0xf072('0x2b')](function(){_0x2ddcaf[_0xf072('0x6e')](function(_0x49cb0c){socket[_0xf072('0x7f')](_0xf072('0x80'),{'UserId':_0x49cb0c,'MailQueueId':_0x3f347a['id']});});});});});});})[_0xf072('0x2b')](respondWithStatusCode(_0x461b5,null))[_0xf072('0x4a')](handleError(_0x461b5,null));};exports['addAgents']=function(_0x3dce36,_0x2df4ca,_0x424fd7){return db[_0xf072('0x31')]['find']({'where':{'id':_0x3dce36[_0xf072('0x51')]['id']}})['then'](handleEntityNotFound(_0x2df4ca,null))[_0xf072('0x2b')](function(_0x285d58){if(_0x285d58){return _0x285d58[_0xf072('0x81')](_0x3dce36[_0xf072('0x4c')]['ids'],_[_0xf072('0x82')](_0x3dce36[_0xf072('0x4c')],[_0xf072('0x65'),'id'])||{})['spread'](function(_0x31edbe){for(var _0x5f5819=0x0;_0x5f5819<_0x3dce36[_0xf072('0x4c')][_0xf072('0x65')][_0xf072('0x3c')];_0x5f5819+=0x1){socket[_0xf072('0x7f')](_0xf072('0x6f'),{'UserId':Number(_0x3dce36[_0xf072('0x4c')][_0xf072('0x65')][_0x5f5819]),'MailQueueId':Number(_0x3dce36[_0xf072('0x51')]['id'])});}return _0x31edbe;});}})[_0xf072('0x2b')](respondWithResult(_0x2df4ca,null))[_0xf072('0x4a')](handleError(_0x2df4ca,null));};exports[_0xf072('0x7e')]=function(_0x5a73cc,_0x4b82c9,_0x49b0c0){return db[_0xf072('0x31')][_0xf072('0x49')]({'where':{'id':_0x5a73cc['params']['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x4b82c9,null))['then'](function(_0x15f807){if(_0x15f807){return _0x15f807[_0xf072('0x7e')](_0x5a73cc[_0xf072('0x37')]['ids'])['then'](function(){if(_[_0xf072('0x83')](_0x5a73cc[_0xf072('0x37')][_0xf072('0x65')])){for(var _0x347938=0x0;_0x347938<_0x5a73cc[_0xf072('0x37')][_0xf072('0x65')][_0xf072('0x3c')];_0x347938+=0x1){socket['emit'](_0xf072('0x80'),{'UserId':Number(_0x5a73cc[_0xf072('0x37')][_0xf072('0x65')][_0x347938]),'MailQueueId':Number(_0x5a73cc[_0xf072('0x51')]['id'])});}}else{socket[_0xf072('0x7f')](_0xf072('0x80'),{'UserId':Number(_0x5a73cc['query'][_0xf072('0x65')]),'MailQueueId':Number(_0x5a73cc[_0xf072('0x51')]['id'])});}});}})[_0xf072('0x2b')](respondWithStatusCode(_0x4b82c9,null))['catch'](handleError(_0x4b82c9,null));};exports[_0xf072('0x84')]=function(_0x443096,_0x2d1228,_0x123c7f){var _0x153c30={};var _0x1a6673={};var _0x1d53f3;var _0xcd6225;return db[_0xf072('0x31')][_0xf072('0x62')]({'where':{'id':_0x443096[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x2d1228,null))[_0xf072('0x2b')](function(_0x82a35){if(_0x82a35){_0x1d53f3=_0x82a35;_0x1a6673[_0xf072('0x34')]=_[_0xf072('0x38')](db[_0xf072('0x67')]['rawAttributes']);_0x1a6673[_0xf072('0x37')]=_[_0xf072('0x38')](_0x443096[_0xf072('0x37')]);_0x1a6673[_0xf072('0x3f')]=_[_0xf072('0x39')](_0x1a6673['model'],_0x1a6673[_0xf072('0x37')]);_0x153c30[_0xf072('0x3a')]=_['intersection'](_0x1a6673[_0xf072('0x34')],qs[_0xf072('0x3b')](_0x443096['query'][_0xf072('0x3b')]));_0x153c30[_0xf072('0x3a')]=_0x153c30[_0xf072('0x3a')]['length']?_0x153c30['attributes']:_0x1a6673[_0xf072('0x34')];_0x153c30[_0xf072('0x3d')]=qs[_0xf072('0x57')](_0x443096[_0xf072('0x37')][_0xf072('0x57')]);_0x153c30['where']=qs['filters'](_[_0xf072('0x58')](_0x443096[_0xf072('0x37')],_0x1a6673['filters']));if(_0x443096[_0xf072('0x37')]['filter']){_0x153c30[_0xf072('0x3e')]=_[_0xf072('0x42')](_0x153c30['where'],{'$or':_['map'](_0x153c30['attributes'],function(_0x47f4e4){var _0xbb6fb={};_0xbb6fb[_0x47f4e4]={'$like':'%'+_0x443096['query'][_0xf072('0x40')]+'%'};return _0xbb6fb;})});}_0x153c30=_[_0xf072('0x42')]({},_0x153c30,_0x443096[_0xf072('0x48')]);return _0x1d53f3['getAgents'](_0x153c30);}})[_0xf072('0x2b')](function(_0x8fd3c0){if(_0x8fd3c0){_0xcd6225=_0x8fd3c0[_0xf072('0x3c')];if(!_0x443096[_0xf072('0x37')][_0xf072('0x55')](_0xf072('0x56'))){_0x153c30['limit']=qs['limit'](_0x443096['query']['limit']);_0x153c30[_0xf072('0x21')]=qs['offset'](_0x443096[_0xf072('0x37')]['offset']);}return _0x1d53f3[_0xf072('0x84')](_0x153c30);}})[_0xf072('0x2b')](function(_0x5c4303){if(_0x5c4303){return _0x5c4303?{'count':_0xcd6225,'rows':_0x5c4303}:null;}})['then'](respondWithResult(_0x2d1228,null))[_0xf072('0x4a')](handleError(_0x2d1228,null));};
\ No newline at end of file
+var _0x0897=['sort','where','filters','pick','merge','filter','MailQueue','include','findAll','rows','catch','params','includeAll','options','find','create','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserMailQueue','fields','order','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','createdAt','%s/%s','SIP','updatedAt','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','get','MailQueues','UserProfileResource','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit'];(function(_0x493478,_0x37f97b){var _0x558cb1=function(_0x33fe1c){while(--_0x33fe1c){_0x493478['push'](_0x493478['shift']());}};_0x558cb1(++_0x37f97b);}(_0x0897,0x167));var _0x7089=function(_0x6e0fda,_0x349218){_0x6e0fda=_0x6e0fda-0x0;var _0x54932d=_0x0897[_0x6e0fda];return _0x54932d;};'use strict';var emlformat=require(_0x7089('0x0'));var rimraf=require(_0x7089('0x1'));var zipdir=require(_0x7089('0x2'));var jsonpatch=require(_0x7089('0x3'));var rp=require('request-promise');var moment=require(_0x7089('0x4'));var BPromise=require(_0x7089('0x5'));var Mustache=require('mustache');var util=require(_0x7089('0x6'));var path=require(_0x7089('0x7'));var sox=require(_0x7089('0x8'));var csv=require(_0x7089('0x9'));var ejs=require(_0x7089('0xa'));var fs=require('fs');var fs_extra=require(_0x7089('0xb'));var _=require(_0x7089('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7089('0xd'));var deskjs=require(_0x7089('0xe'));var toCsv=require(_0x7089('0x9'));var querystring=require(_0x7089('0xf'));var Papa=require(_0x7089('0x10'));var Redis=require(_0x7089('0x11'));var authService=require(_0x7089('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7089('0x13'));var hardwareService=require(_0x7089('0x14'));var logger=require(_0x7089('0x15'))(_0x7089('0x16'));var utils=require(_0x7089('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7089('0x18'));var db=require(_0x7089('0x19'))['db'];config['redis']=_['defaults'](config[_0x7089('0x1a')],{'host':_0x7089('0x1b'),'port':0x18eb});var socket=require(_0x7089('0x1c'))(new Redis(config[_0x7089('0x1a')]));require(_0x7089('0x1d'))['register'](socket);function respondWithStatusCode(_0x343b55,_0x2b8f35){_0x2b8f35=_0x2b8f35||0xcc;return function(_0x591cb0){if(_0x591cb0){return _0x343b55['sendStatus'](_0x2b8f35);}return _0x343b55[_0x7089('0x1e')](_0x2b8f35)['end']();};}function respondWithResult(_0x5fed6c,_0x3b5eaf){_0x3b5eaf=_0x3b5eaf||0xc8;return function(_0x8358c5){if(_0x8358c5){return _0x5fed6c['status'](_0x3b5eaf)[_0x7089('0x1f')](_0x8358c5);}};}function respondWithFilteredResult(_0x3e30af,_0x203dc3){return function(_0x1a6da2){if(_0x1a6da2){var _0x343c0c=typeof _0x203dc3[_0x7089('0x20')]==='undefined'&&typeof _0x203dc3[_0x7089('0x21')]===_0x7089('0x22');var _0x1d82c7=_0x1a6da2[_0x7089('0x23')];var _0x3f56dd=_0x343c0c?0x0:_0x203dc3[_0x7089('0x20')];var _0x4ffbd4=_0x343c0c?_0x1a6da2[_0x7089('0x23')]:_0x203dc3[_0x7089('0x20')]+_0x203dc3[_0x7089('0x21')];var _0x3b7ff9;if(_0x4ffbd4>=_0x1d82c7){_0x4ffbd4=_0x1d82c7;_0x3b7ff9=0xc8;}else{_0x3b7ff9=0xce;}_0x3e30af[_0x7089('0x1e')](_0x3b7ff9);return _0x3e30af['set'](_0x7089('0x24'),_0x3f56dd+'-'+_0x4ffbd4+'/'+_0x1d82c7)['json'](_0x1a6da2);}return null;};}function patchUpdates(_0x1db2ec){return function(_0x5e9687){try{jsonpatch[_0x7089('0x25')](_0x5e9687,_0x1db2ec,!![]);}catch(_0x48739b){return BPromise[_0x7089('0x26')](_0x48739b);}return _0x5e9687['save']();};}function saveUpdates(_0x1bec7c,_0x574b1d){return function(_0x58c6a0){if(_0x58c6a0){return _0x58c6a0[_0x7089('0x27')](_0x1bec7c)[_0x7089('0x28')](function(_0x37790c){return _0x37790c;});}return null;};}function removeEntity(_0x47d782,_0x176e82){return function(_0xef8b0a){if(_0xef8b0a){return _0xef8b0a['destroy']()[_0x7089('0x28')](function(){var _0x385518=_0xef8b0a[_0x7089('0x29')]({'plain':!![]});var _0x2fb530=_0x7089('0x2a');return db[_0x7089('0x2b')][_0x7089('0x2c')]({'where':{'type':_0x2fb530,'resourceId':_0x385518['id']}})[_0x7089('0x28')](function(){return _0xef8b0a;});})[_0x7089('0x28')](function(){_0x47d782[_0x7089('0x1e')](0xcc)[_0x7089('0x2d')]();});}};}function handleEntityNotFound(_0x300f4e,_0x20f088){return function(_0xa963ed){if(!_0xa963ed){_0x300f4e[_0x7089('0x2e')](0x194);}return _0xa963ed;};}function handleError(_0x13f5f9,_0x27a31e){_0x27a31e=_0x27a31e||0x1f4;return function(_0x431811){logger[_0x7089('0x2f')](_0x431811[_0x7089('0x30')]);if(_0x431811[_0x7089('0x31')]){delete _0x431811[_0x7089('0x31')];}_0x13f5f9[_0x7089('0x1e')](_0x27a31e)['send'](_0x431811);};}exports[_0x7089('0x32')]=function(_0x55a6ff,_0x360f7a){var _0x140cbe={},_0x2288a6={},_0x3bf63a={'count':0x0,'rows':[]};var _0x371c05=_[_0x7089('0x33')](db['MailQueue'][_0x7089('0x34')],function(_0xa702eb){return{'name':_0xa702eb[_0x7089('0x35')],'type':_0xa702eb[_0x7089('0x36')][_0x7089('0x37')]};});_0x2288a6[_0x7089('0x38')]=_[_0x7089('0x33')](_0x371c05,_0x7089('0x31'));_0x2288a6[_0x7089('0x39')]=_[_0x7089('0x3a')](_0x55a6ff['query']);_0x2288a6['filters']=_[_0x7089('0x3b')](_0x2288a6['model'],_0x2288a6['query']);_0x140cbe[_0x7089('0x3c')]=_[_0x7089('0x3b')](_0x2288a6['model'],qs['fields'](_0x55a6ff[_0x7089('0x39')]['fields']));_0x140cbe[_0x7089('0x3c')]=_0x140cbe[_0x7089('0x3c')][_0x7089('0x3d')]?_0x140cbe[_0x7089('0x3c')]:_0x2288a6[_0x7089('0x38')];if(!_0x55a6ff[_0x7089('0x39')][_0x7089('0x3e')](_0x7089('0x3f'))){_0x140cbe['limit']=qs[_0x7089('0x21')](_0x55a6ff[_0x7089('0x39')][_0x7089('0x21')]);_0x140cbe['offset']=qs[_0x7089('0x20')](_0x55a6ff['query'][_0x7089('0x20')]);}_0x140cbe['order']=qs[_0x7089('0x40')](_0x55a6ff[_0x7089('0x39')][_0x7089('0x40')]);_0x140cbe[_0x7089('0x41')]=qs[_0x7089('0x42')](_[_0x7089('0x43')](_0x55a6ff[_0x7089('0x39')],_0x2288a6[_0x7089('0x42')]),_0x371c05);if(_0x55a6ff[_0x7089('0x39')]['filter']){_0x140cbe[_0x7089('0x41')]=_[_0x7089('0x44')](_0x140cbe[_0x7089('0x41')],{'$or':_[_0x7089('0x33')](_0x371c05,function(_0x43ed2f){if(_0x43ed2f[_0x7089('0x36')]!=='VIRTUAL'){var _0x5623a3={};_0x5623a3[_0x43ed2f[_0x7089('0x31')]]={'$like':'%'+_0x55a6ff['query'][_0x7089('0x45')]+'%'};return _0x5623a3;}})});}_0x140cbe=_[_0x7089('0x44')]({},_0x140cbe,_0x55a6ff['options']);var _0x32a5c3={'where':_0x140cbe[_0x7089('0x41')]};return db[_0x7089('0x46')][_0x7089('0x23')](_0x32a5c3)[_0x7089('0x28')](function(_0x126c0b){_0x3bf63a[_0x7089('0x23')]=_0x126c0b;if(_0x55a6ff['query']['includeAll']){_0x140cbe[_0x7089('0x47')]=[{'all':!![]}];}return db['MailQueue'][_0x7089('0x48')](_0x140cbe);})[_0x7089('0x28')](function(_0x509642){_0x3bf63a[_0x7089('0x49')]=_0x509642;return _0x3bf63a;})[_0x7089('0x28')](respondWithFilteredResult(_0x360f7a,_0x140cbe))[_0x7089('0x4a')](handleError(_0x360f7a,null));};exports['show']=function(_0x4f571b,_0x58d975){var _0xc312ce={'raw':!![],'where':{'id':_0x4f571b[_0x7089('0x4b')]['id']}},_0x1b5938={};_0x1b5938[_0x7089('0x38')]=_[_0x7089('0x3a')](db[_0x7089('0x46')][_0x7089('0x34')]);_0x1b5938[_0x7089('0x39')]=_['keys'](_0x4f571b[_0x7089('0x39')]);_0x1b5938['filters']=_[_0x7089('0x3b')](_0x1b5938['model'],_0x1b5938['query']);_0xc312ce[_0x7089('0x3c')]=_[_0x7089('0x3b')](_0x1b5938[_0x7089('0x38')],qs['fields'](_0x4f571b['query']['fields']));_0xc312ce[_0x7089('0x3c')]=_0xc312ce['attributes']['length']?_0xc312ce['attributes']:_0x1b5938[_0x7089('0x38')];if(_0x4f571b[_0x7089('0x39')][_0x7089('0x4c')]){_0xc312ce[_0x7089('0x47')]=[{'all':!![]}];}_0xc312ce=_[_0x7089('0x44')]({},_0xc312ce,_0x4f571b[_0x7089('0x4d')]);return db[_0x7089('0x46')][_0x7089('0x4e')](_0xc312ce)[_0x7089('0x28')](handleEntityNotFound(_0x58d975,null))[_0x7089('0x28')](respondWithResult(_0x58d975,null))[_0x7089('0x4a')](handleError(_0x58d975,null));};exports[_0x7089('0x4f')]=function(_0x16714d,_0x4b26a7){return db[_0x7089('0x46')][_0x7089('0x4f')](_0x16714d['body'],{})['then'](function(_0x19f35d){var _0x1e4f4e=_0x16714d[_0x7089('0x50')][_0x7089('0x29')]({'plain':!![]});if(!_0x1e4f4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e4f4e[_0x7089('0x51')]===_0x7089('0x50')){var _0x1bbd0a=_0x19f35d[_0x7089('0x29')]({'plain':!![]});var _0x1e21b4='MailQueues';return db['UserProfileSection'][_0x7089('0x4e')]({'where':{'name':_0x1e21b4,'userProfileId':_0x1e4f4e[_0x7089('0x52')]},'raw':!![]})[_0x7089('0x28')](function(_0x3b01e0){if(_0x3b01e0&&_0x3b01e0['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1bbd0a['name'],'resourceId':_0x1bbd0a['id'],'type':_0x3b01e0[_0x7089('0x31')],'sectionId':_0x3b01e0['id']},{})[_0x7089('0x28')](function(){return _0x19f35d;});}else{return _0x19f35d;}})[_0x7089('0x4a')](function(_0x2ccc41){logger['error'](_0x7089('0x53'),_0x2ccc41);throw _0x2ccc41;});}return _0x19f35d;})[_0x7089('0x28')](respondWithResult(_0x4b26a7,0xc9))['catch'](handleError(_0x4b26a7,null));};exports[_0x7089('0x27')]=function(_0x349974,_0x440aa3){if(_0x349974[_0x7089('0x54')]['id']){delete _0x349974[_0x7089('0x54')]['id'];}return db[_0x7089('0x46')][_0x7089('0x4e')]({'where':{'id':_0x349974[_0x7089('0x4b')]['id']}})[_0x7089('0x28')](handleEntityNotFound(_0x440aa3,null))['then'](saveUpdates(_0x349974['body'],null))[_0x7089('0x28')](respondWithResult(_0x440aa3,null))['catch'](handleError(_0x440aa3,null));};exports['destroy']=function(_0x800aa4,_0x4ac608){return db[_0x7089('0x46')][_0x7089('0x4e')]({'where':{'id':_0x800aa4[_0x7089('0x4b')]['id']}})[_0x7089('0x28')](handleEntityNotFound(_0x4ac608,null))[_0x7089('0x28')](removeEntity(_0x4ac608,null))[_0x7089('0x4a')](handleError(_0x4ac608,null));};exports[_0x7089('0x55')]=function(_0x128a32,_0x1c3590){return db['MailQueue'][_0x7089('0x55')]()['then'](respondWithResult(_0x1c3590,null))['catch'](handleError(_0x1c3590,null));};exports[_0x7089('0x56')]=function(_0x1d0e59,_0x30e67d,_0x3c5159){var _0x29b115={'raw':!![],'where':{}},_0x561318={},_0x2c4ded;return db[_0x7089('0x46')]['findOne']({'where':{'id':_0x1d0e59[_0x7089('0x4b')]['id']}})[_0x7089('0x28')](handleEntityNotFound(_0x30e67d,null))[_0x7089('0x28')](function(_0x1de1f3){if(_0x1de1f3){_0x2c4ded=_0x1de1f3[_0x7089('0x29')]({'plain':!![]});_0x561318[_0x7089('0x38')]=_[_0x7089('0x3a')](db[_0x7089('0x57')]['rawAttributes']);_0x561318[_0x7089('0x39')]=_[_0x7089('0x3a')](_0x1d0e59['query']);_0x561318[_0x7089('0x42')]=_[_0x7089('0x3b')](_0x561318[_0x7089('0x38')],_0x561318[_0x7089('0x39')]);_0x29b115['attributes']=_[_0x7089('0x3b')](_0x561318['model'],qs[_0x7089('0x58')](_0x1d0e59[_0x7089('0x39')][_0x7089('0x58')]));_0x29b115[_0x7089('0x3c')]=_0x29b115['attributes']['length']?_0x29b115[_0x7089('0x3c')]:_0x561318[_0x7089('0x38')];if(!_0x1d0e59[_0x7089('0x39')][_0x7089('0x3e')](_0x7089('0x3f'))){_0x29b115[_0x7089('0x21')]=qs[_0x7089('0x21')](_0x1d0e59[_0x7089('0x39')][_0x7089('0x21')]);_0x29b115['offset']=qs[_0x7089('0x20')](_0x1d0e59[_0x7089('0x39')][_0x7089('0x20')]);}_0x29b115[_0x7089('0x59')]=qs[_0x7089('0x40')](_0x1d0e59['query'][_0x7089('0x40')]);_0x29b115['where']=qs[_0x7089('0x42')](_[_0x7089('0x43')](_0x1d0e59[_0x7089('0x39')],_0x561318[_0x7089('0x42')]));_0x29b115[_0x7089('0x41')][_0x7089('0x5a')]=_0x1de1f3['id'];if(_0x1d0e59[_0x7089('0x39')][_0x7089('0x45')]){_0x29b115[_0x7089('0x41')]=_[_0x7089('0x44')](_0x29b115['where'],{'$or':_[_0x7089('0x33')](_0x29b115[_0x7089('0x3c')],function(_0x3f7541){var _0x4496b8={};_0x4496b8[_0x3f7541]={'$like':'%'+_0x1d0e59[_0x7089('0x39')][_0x7089('0x45')]+'%'};return _0x4496b8;})});}_0x29b115=_['merge']({},_0x29b115,_0x1d0e59[_0x7089('0x4d')]);return db[_0x7089('0x57')][_0x7089('0x48')](_0x29b115);}})['then'](function(_0x5629e7){if(_0x5629e7){return db[_0x7089('0x5b')][_0x7089('0x5c')]({'where':{'id':_[_0x7089('0x33')](_0x5629e7,_0x7089('0x5d')),'role':_0x7089('0x5e')},'attributes':['id',_0x7089('0x31'),_0x7089('0x5f'),'updatedAt',_0x7089('0x60')]});}})[_0x7089('0x28')](function(_0x1ba375){if(_0x1ba375){return{'count':_0x1ba375[_0x7089('0x23')],'rows':_[_0x7089('0x33')](_0x1ba375[_0x7089('0x49')],function(_0x4fd6c0){return{'membername':_0x4fd6c0[_0x7089('0x31')],'UserId':_0x4fd6c0['id'],'queue_name':_0x2c4ded[_0x7089('0x31')],'MailQueueId':_0x2c4ded['id'],'interface':util['format'](_0x7089('0x61'),_0x7089('0x62'),_0x4fd6c0[_0x7089('0x31')]),'penalty':0x0,'paused':_0x4fd6c0['mailPause'],'createdAt':_0x4fd6c0['createdAt'],'updatedAt':_0x4fd6c0[_0x7089('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x30e67d,_0x29b115))[_0x7089('0x4a')](handleError(_0x30e67d,null));};exports['getTeams']=function(_0x26094e,_0x14a912,_0x305e9e){var _0xb13acf={};var _0x58946d={};var _0x420c3f;var _0x83f970;return db['MailQueue'][_0x7089('0x64')]({'where':{'id':_0x26094e['params']['id']}})[_0x7089('0x28')](handleEntityNotFound(_0x14a912,null))[_0x7089('0x28')](function(_0x1b27bf){if(_0x1b27bf){_0x420c3f=_0x1b27bf;_0x58946d[_0x7089('0x38')]=_[_0x7089('0x3a')](db[_0x7089('0x65')][_0x7089('0x34')]);_0x58946d[_0x7089('0x39')]=_[_0x7089('0x3a')](_0x26094e[_0x7089('0x39')]);_0x58946d[_0x7089('0x42')]=_[_0x7089('0x3b')](_0x58946d[_0x7089('0x38')],_0x58946d[_0x7089('0x39')]);_0xb13acf[_0x7089('0x3c')]=_[_0x7089('0x3b')](_0x58946d['model'],qs[_0x7089('0x58')](_0x26094e['query']['fields']));_0xb13acf[_0x7089('0x3c')]=_0xb13acf[_0x7089('0x3c')][_0x7089('0x3d')]?_0xb13acf[_0x7089('0x3c')]:_0x58946d[_0x7089('0x38')];_0xb13acf[_0x7089('0x59')]=qs[_0x7089('0x40')](_0x26094e[_0x7089('0x39')][_0x7089('0x40')]);_0xb13acf[_0x7089('0x41')]=qs[_0x7089('0x42')](_['pick'](_0x26094e[_0x7089('0x39')],_0x58946d[_0x7089('0x42')]));if(_0x26094e[_0x7089('0x39')][_0x7089('0x45')]){_0xb13acf[_0x7089('0x41')]=_[_0x7089('0x44')](_0xb13acf['where'],{'$or':_['map'](_0xb13acf['attributes'],function(_0x126ed6){var _0x2387ea={};_0x2387ea[_0x126ed6]={'$like':'%'+_0x26094e[_0x7089('0x39')]['filter']+'%'};return _0x2387ea;})});}_0xb13acf=_[_0x7089('0x44')]({},_0xb13acf,_0x26094e[_0x7089('0x4d')]);return _0x420c3f[_0x7089('0x66')](_0xb13acf);}})[_0x7089('0x28')](function(_0x52c095){if(_0x52c095){_0x83f970=_0x52c095[_0x7089('0x3d')];if(!_0x26094e[_0x7089('0x39')][_0x7089('0x3e')](_0x7089('0x3f'))){_0xb13acf[_0x7089('0x21')]=qs[_0x7089('0x21')](_0x26094e[_0x7089('0x39')][_0x7089('0x21')]);_0xb13acf['offset']=qs[_0x7089('0x20')](_0x26094e[_0x7089('0x39')][_0x7089('0x20')]);}return _0x420c3f['getTeams'](_0xb13acf);}})[_0x7089('0x28')](function(_0x14a641){if(_0x14a641){return _0x14a641?{'count':_0x83f970,'rows':_0x14a641}:null;}})[_0x7089('0x28')](respondWithResult(_0x14a912,null))[_0x7089('0x4a')](handleError(_0x14a912,null));};exports[_0x7089('0x67')]=function(_0x34e086,_0x5dc589,_0x45d22e){var _0x1ac1af=_0x34e086['body'][_0x7089('0x68')];return db[_0x7089('0x65')]['findAll']({'where':{'id':_0x1ac1af},'attributes':['id'],'include':[{'model':db[_0x7089('0x5b')],'as':_0x7089('0x69'),'attributes':['id',_0x7089('0x31'),_0x7089('0x6a'),_0x7089('0x6b'),_0x7089('0x6c')],'raw':!![]}]})[_0x7089('0x28')](function(_0x58899d){if(_0x58899d){var _0x38739c=_[_0x7089('0x6d')](_0x58899d,function(_0x279fda){var _0x1ef832=_0x279fda[_0x7089('0x29')]({'plain':!![]});return _0x1ef832['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x34e086[_0x7089('0x4b')]['id']}})[_0x7089('0x28')](function(_0x180485){return db['sequelize'][_0x7089('0x6e')](function(_0x9b319c){return _0x180485[_0x7089('0x67')](_0x1ac1af,{'transaction':_0x9b319c})['then'](function(){return BPromise['each'](_0x38739c,function(_0x32498e){return db[_0x7089('0x57')][_0x7089('0x6f')]({'where':{'UserId':_0x32498e['id'],'MailQueueId':_0x34e086['params']['id']},'transaction':_0x9b319c});});})[_0x7089('0x28')](function(){_0x38739c[_0x7089('0x70')](function(_0x5d0e43){socket[_0x7089('0x71')](_0x7089('0x72'),{'UserId':_0x5d0e43['id'],'MailQueueId':_0x180485['id']});});});});});}})[_0x7089('0x28')](respondWithStatusCode(_0x5dc589,null))['catch'](handleError(_0x5dc589,null));};exports[_0x7089('0x73')]=function(_0x7ecbae,_0x299ddb,_0x3acdbf){return db[_0x7089('0x65')][_0x7089('0x48')]({'where':{'id':_0x7ecbae[_0x7089('0x39')][_0x7089('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7089('0x69'),'attributes':['id'],'raw':!![]}]})[_0x7089('0x28')](handleEntityNotFound(_0x299ddb,null))[_0x7089('0x28')](function(_0x4e572c){var _0x550da0=_[_0x7089('0x33')](_0x4e572c,'id');var _0x532fbc=[];var _0x4f8216=[];var _0x3a4c8e=squel[_0x7089('0x74')]();_0x3a4c8e[_0x7089('0x75')](_0x7089('0x76'))['from']('team_has_mail_queues','tq')[_0x7089('0x77')](_0x7089('0x78'),'ut',_0x7089('0x79'))[_0x7089('0x41')]('MailQueueId\x20=\x20?',_0x7ecbae[_0x7089('0x4b')]['id']);for(var _0xfd1be7=0x0;_0xfd1be7<_0x4e572c[_0x7089('0x3d')];_0xfd1be7+=0x1){let _0x30ff85=_0x4e572c[_0xfd1be7];for(var _0x397134=0x0;_0x397134<_0x30ff85[_0x7089('0x69')][_0x7089('0x3d')];_0x397134+=0x1){let _0x5780d7=_0x30ff85[_0x7089('0x69')][_0x397134];var _0x3d3f34=_0x3a4c8e[_0x7089('0x7a')]();_0x3d3f34[_0x7089('0x41')]('ut.UserId\x20=\x20?',_0x5780d7['id']);_0x4f8216[_0x7089('0x7b')](db[_0x7089('0x7c')][_0x7089('0x39')](_0x3d3f34[_0x7089('0x7d')](),{'type':db[_0x7089('0x7c')][_0x7089('0x7e')][_0x7089('0x7f')]})[_0x7089('0x28')](function(_0x27cd66){if(_0x27cd66['length']===0x1){return _0x5780d7['id'];}else{var _0x4f331e=_[_0x7089('0x80')](_[_0x7089('0x33')](_0x27cd66,'TeamId'),function(_0x3fad88){return _[_0x7089('0x81')](_0x550da0,_0x3fad88);});if(_0x4f331e){return _0x5780d7['id'];}}}));}}return BPromise[_0x7089('0x82')](_0x4f8216)[_0x7089('0x28')](function(_0x3630e6){_0x532fbc=_(_0x532fbc)[_0x7089('0x83')](_0x3630e6)[_0x7089('0x84')]()[_0x7089('0x85')]();return db[_0x7089('0x46')][_0x7089('0x4e')]({'where':{'id':_0x7ecbae[_0x7089('0x4b')]['id']}})[_0x7089('0x28')](function(_0x33e09d){return db[_0x7089('0x7c')][_0x7089('0x6e')](function(_0x33cb9f){return _0x33e09d[_0x7089('0x73')](_0x7ecbae[_0x7089('0x39')][_0x7089('0x68')],{'transaction':_0x33cb9f})['then'](function(){if(!_[_0x7089('0x86')](_0x532fbc)){return _0x33e09d['removeAgents'](_0x532fbc,{'transaction':_0x33cb9f});}})[_0x7089('0x28')](function(){_0x532fbc[_0x7089('0x70')](function(_0x4de311){socket[_0x7089('0x71')](_0x7089('0x87'),{'UserId':_0x4de311,'MailQueueId':_0x33e09d['id']});});});});});});})[_0x7089('0x28')](respondWithStatusCode(_0x299ddb,null))[_0x7089('0x4a')](handleError(_0x299ddb,null));};exports[_0x7089('0x88')]=function(_0x12ec53,_0x271b0e,_0x35faae){return db[_0x7089('0x46')][_0x7089('0x4e')]({'where':{'id':_0x12ec53[_0x7089('0x4b')]['id']}})[_0x7089('0x28')](handleEntityNotFound(_0x271b0e,null))[_0x7089('0x28')](function(_0x2f84aa){if(_0x2f84aa){return _0x2f84aa[_0x7089('0x88')](_0x12ec53[_0x7089('0x54')][_0x7089('0x68')],_['omit'](_0x12ec53[_0x7089('0x54')],[_0x7089('0x68'),'id'])||{})[_0x7089('0x89')](function(_0x515e10){for(var _0x1a9389=0x0;_0x1a9389<_0x12ec53[_0x7089('0x54')][_0x7089('0x68')]['length'];_0x1a9389+=0x1){socket['emit'](_0x7089('0x72'),{'UserId':Number(_0x12ec53[_0x7089('0x54')]['ids'][_0x1a9389]),'MailQueueId':Number(_0x12ec53[_0x7089('0x4b')]['id'])});}return _0x515e10;});}})['then'](respondWithResult(_0x271b0e,null))[_0x7089('0x4a')](handleError(_0x271b0e,null));};exports[_0x7089('0x8a')]=function(_0x15a959,_0x2e0ddb,_0x30b776){return db[_0x7089('0x46')][_0x7089('0x4e')]({'where':{'id':_0x15a959['params']['id']}})[_0x7089('0x28')](handleEntityNotFound(_0x2e0ddb,null))[_0x7089('0x28')](function(_0x87f662){if(_0x87f662){return _0x87f662[_0x7089('0x8a')](_0x15a959[_0x7089('0x39')]['ids'])[_0x7089('0x28')](function(){if(_[_0x7089('0x8b')](_0x15a959[_0x7089('0x39')][_0x7089('0x68')])){for(var _0x11610d=0x0;_0x11610d<_0x15a959[_0x7089('0x39')][_0x7089('0x68')]['length'];_0x11610d+=0x1){socket[_0x7089('0x71')](_0x7089('0x87'),{'UserId':Number(_0x15a959[_0x7089('0x39')][_0x7089('0x68')][_0x11610d]),'MailQueueId':Number(_0x15a959['params']['id'])});}}else{socket[_0x7089('0x71')](_0x7089('0x87'),{'UserId':Number(_0x15a959['query'][_0x7089('0x68')]),'MailQueueId':Number(_0x15a959[_0x7089('0x4b')]['id'])});}});}})[_0x7089('0x28')](respondWithStatusCode(_0x2e0ddb,null))[_0x7089('0x4a')](handleError(_0x2e0ddb,null));};exports[_0x7089('0x8c')]=function(_0x2b3845,_0x5ec2e6,_0x5f52da){var _0x55e3d6={};var _0x43dd0c={};var _0x230b1f;var _0x2bbb04;return db[_0x7089('0x46')]['findOne']({'where':{'id':_0x2b3845[_0x7089('0x4b')]['id']}})[_0x7089('0x28')](handleEntityNotFound(_0x5ec2e6,null))[_0x7089('0x28')](function(_0x339385){if(_0x339385){_0x230b1f=_0x339385;_0x43dd0c[_0x7089('0x38')]=_['keys'](db['User'][_0x7089('0x34')]);_0x43dd0c[_0x7089('0x39')]=_['keys'](_0x2b3845['query']);_0x43dd0c[_0x7089('0x42')]=_['intersection'](_0x43dd0c[_0x7089('0x38')],_0x43dd0c[_0x7089('0x39')]);_0x55e3d6[_0x7089('0x3c')]=_[_0x7089('0x3b')](_0x43dd0c[_0x7089('0x38')],qs[_0x7089('0x58')](_0x2b3845[_0x7089('0x39')][_0x7089('0x58')]));_0x55e3d6['attributes']=_0x55e3d6[_0x7089('0x3c')][_0x7089('0x3d')]?_0x55e3d6[_0x7089('0x3c')]:_0x43dd0c[_0x7089('0x38')];_0x55e3d6[_0x7089('0x59')]=qs[_0x7089('0x40')](_0x2b3845[_0x7089('0x39')]['sort']);_0x55e3d6[_0x7089('0x41')]=qs[_0x7089('0x42')](_[_0x7089('0x43')](_0x2b3845[_0x7089('0x39')],_0x43dd0c[_0x7089('0x42')]));if(_0x2b3845[_0x7089('0x39')][_0x7089('0x45')]){_0x55e3d6[_0x7089('0x41')]=_['merge'](_0x55e3d6[_0x7089('0x41')],{'$or':_[_0x7089('0x33')](_0x55e3d6['attributes'],function(_0x3245f1){var _0x7d5945={};_0x7d5945[_0x3245f1]={'$like':'%'+_0x2b3845[_0x7089('0x39')][_0x7089('0x45')]+'%'};return _0x7d5945;})});}_0x55e3d6=_[_0x7089('0x44')]({},_0x55e3d6,_0x2b3845[_0x7089('0x4d')]);return _0x230b1f[_0x7089('0x8c')](_0x55e3d6);}})['then'](function(_0x5c31c2){if(_0x5c31c2){_0x2bbb04=_0x5c31c2[_0x7089('0x3d')];if(!_0x2b3845['query'][_0x7089('0x3e')](_0x7089('0x3f'))){_0x55e3d6[_0x7089('0x21')]=qs[_0x7089('0x21')](_0x2b3845[_0x7089('0x39')][_0x7089('0x21')]);_0x55e3d6[_0x7089('0x20')]=qs[_0x7089('0x20')](_0x2b3845[_0x7089('0x39')][_0x7089('0x20')]);}return _0x230b1f['getAgents'](_0x55e3d6);}})[_0x7089('0x28')](function(_0x596129){if(_0x596129){return _0x596129?{'count':_0x2bbb04,'rows':_0x596129}:null;}})[_0x7089('0x28')](respondWithResult(_0x5ec2e6,null))[_0x7089('0x4a')](handleError(_0x5ec2e6,null));};
\ No newline at end of file
index 920bd67..192d9be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a3a=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x208883,_0x5be968){var _0x531830=function(_0x4c07ea){while(--_0x4c07ea){_0x208883['push'](_0x208883['shift']());}};_0x531830(++_0x5be968);}(_0x4a3a,0x192));var _0xa4a3=function(_0x15ef65,_0xb6dc90){_0x15ef65=_0x15ef65-0x0;var _0x282735=_0x4a3a[_0x15ef65];return _0x282735;};'use strict';var EventEmitter=require(_0xa4a3('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa4a3('0x1')](0x0);var events={'afterCreate':_0xa4a3('0x2'),'afterUpdate':_0xa4a3('0x3'),'afterDestroy':_0xa4a3('0x4')};function emitEvent(_0x4fbeeb){return function(_0x4a381c,_0x24124d,_0x3a571b){MailQueueEvents[_0xa4a3('0x5')](_0x4fbeeb+':'+_0x4a381c['id'],_0x4a381c);MailQueueEvents['emit'](_0x4fbeeb,_0x4a381c);_0x3a571b(null);};}for(var e in events){if(events[_0xa4a3('0x6')](e)){var event=events[e];MailQueue[_0xa4a3('0x7')](e,emitEvent(event));}}module[_0xa4a3('0x8')]=MailQueueEvents;
\ No newline at end of file
+var _0x0b9a=['emit','hasOwnProperty','hook','exports','events','MailQueue','remove'];(function(_0x528637,_0x23a48b){var _0x42e105=function(_0x23cc28){while(--_0x23cc28){_0x528637['push'](_0x528637['shift']());}};_0x42e105(++_0x23a48b);}(_0x0b9a,0x1ee));var _0xa0b9=function(_0x2ea183,_0x3cff11){_0x2ea183=_0x2ea183-0x0;var _0x47c16c=_0x0b9a[_0x2ea183];return _0x47c16c;};'use strict';var EventEmitter=require(_0xa0b9('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xa0b9('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa0b9('0x2')};function emitEvent(_0x1b0da7){return function(_0x310a2a,_0x5f4cda,_0x14e74e){MailQueueEvents['emit'](_0x1b0da7+':'+_0x310a2a['id'],_0x310a2a);MailQueueEvents[_0xa0b9('0x3')](_0x1b0da7,_0x310a2a);_0x14e74e(null);};}for(var e in events){if(events[_0xa0b9('0x4')](e)){var event=events[e];MailQueue[_0xa0b9('0x5')](e,emitEvent(event));}}module[_0xa0b9('0x6')]=MailQueueEvents;
\ No newline at end of file
index 3eaea68..7b3fb70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3aa=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util'];(function(_0xe45c3a,_0x183904){var _0x1bc5e8=function(_0x1c084b){while(--_0x1c084b){_0xe45c3a['push'](_0xe45c3a['shift']());}};_0x1bc5e8(++_0x183904);}(_0xd3aa,0xa6));var _0xad3a=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd3aa[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xad3a('0x0'));var util=require(_0xad3a('0x1'));var logger=require('../../config/logger')(_0xad3a('0x2'));var moment=require('moment');var BPromise=require(_0xad3a('0x3'));var rp=require(_0xad3a('0x4'));var fs=require('fs');var path=require(_0xad3a('0x5'));var rimraf=require(_0xad3a('0x6'));var config=require(_0xad3a('0x7'));var attributes=require(_0xad3a('0x8'));module['exports']=function(_0x30b28d,_0x1e0233){return _0x30b28d[_0xad3a('0x9')](_0xad3a('0xa'),attributes,{'tableName':_0xad3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf0c=['./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0xaf0c,0x113));var _0xcaf0=function(_0x2cd8a4,_0x51fb40){_0x2cd8a4=_0x2cd8a4-0x0;var _0x375630=_0xaf0c[_0x2cd8a4];return _0x375630;};'use strict';var _=require(_0xcaf0('0x0'));var util=require(_0xcaf0('0x1'));var logger=require(_0xcaf0('0x2'))(_0xcaf0('0x3'));var moment=require(_0xcaf0('0x4'));var BPromise=require(_0xcaf0('0x5'));var rp=require(_0xcaf0('0x6'));var fs=require('fs');var path=require(_0xcaf0('0x7'));var rimraf=require(_0xcaf0('0x8'));var config=require(_0xcaf0('0x9'));var attributes=require(_0xcaf0('0xa'));module[_0xcaf0('0xb')]=function(_0x46d780,_0x21d05c){return _0x46d780[_0xcaf0('0xc')](_0xcaf0('0xd'),attributes,{'tableName':_0xcaf0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 170b53e..1b3e401 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1fa=['GetMailQueue','MailQueue','findAll','options','raw','where','limit','map','include','model','attributes','catch','ShowMailQueue','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x5c2bef,_0x16806e){var _0xd60cc1=function(_0x40e74a){while(--_0x40e74a){_0x5c2bef['push'](_0x5c2bef['shift']());}};_0xd60cc1(++_0x16806e);}(_0xc1fa,0xe5));var _0xac1f=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xc1fa[_0x58c20f];return _0x3b0318;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac1f('0x0'));var BPromise=require(_0xac1f('0x1'));var rs=require(_0xac1f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xac1f('0x4'))(_0xac1f('0x5'));var config=require('../../config/environment');var jayson=require(_0xac1f('0x6'));var client=jayson['client'][_0xac1f('0x7')]({'port':0x232a});config[_0xac1f('0x8')]=_['defaults'](config[_0xac1f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xac1f('0x9'))(new Redis(config[_0xac1f('0x8')]));require(_0xac1f('0xa'))[_0xac1f('0xb')](socket);function respondWithRpcPromise(_0x49ebdd,_0x226d82,_0x34a9e8){return new BPromise(function(_0x258eee,_0xa4c8a6){return client['request'](_0x49ebdd,_0x34a9e8)[_0xac1f('0xc')](function(_0x498cd1){logger[_0xac1f('0xd')](_0xac1f('0xe'),_0x226d82,'request\x20sent');logger[_0xac1f('0xf')](_0xac1f('0x10'),_0x226d82,'request\x20sent',JSON[_0xac1f('0x11')](_0x498cd1));if(_0x498cd1[_0xac1f('0x12')]){if(_0x498cd1[_0xac1f('0x12')][_0xac1f('0x13')]===0x1f4){logger[_0xac1f('0x12')](_0xac1f('0xe'),_0x226d82,_0x498cd1[_0xac1f('0x12')][_0xac1f('0x14')]);return _0xa4c8a6(_0x498cd1[_0xac1f('0x12')]['message']);}logger[_0xac1f('0x12')]('MailQueue,\x20%s,\x20%s',_0x226d82,_0x498cd1[_0xac1f('0x12')][_0xac1f('0x14')]);return _0x258eee(_0x498cd1[_0xac1f('0x12')][_0xac1f('0x14')]);}else{logger[_0xac1f('0xd')](_0xac1f('0xe'),_0x226d82,_0xac1f('0x15'));_0x258eee(_0x498cd1[_0xac1f('0x16')][_0xac1f('0x14')]);}})['catch'](function(_0x5e3d47){logger[_0xac1f('0x12')](_0xac1f('0xe'),_0x226d82,_0x5e3d47);_0xa4c8a6(_0x5e3d47);});});}exports[_0xac1f('0x17')]=function(_0xd7496){var _0x3e9852=this;return new Promise(function(_0x4473ad,_0xc83c32){return db[_0xac1f('0x18')][_0xac1f('0x19')]({'raw':_0xd7496[_0xac1f('0x1a')]?_0xd7496['options'][_0xac1f('0x1b')]===undefined?!![]:![]:!![],'where':_0xd7496[_0xac1f('0x1a')]?_0xd7496['options'][_0xac1f('0x1c')]||null:null,'attributes':_0xd7496[_0xac1f('0x1a')]?_0xd7496[_0xac1f('0x1a')]['attributes']||null:null,'limit':_0xd7496[_0xac1f('0x1a')]?_0xd7496[_0xac1f('0x1a')][_0xac1f('0x1d')]||null:null,'include':_0xd7496[_0xac1f('0x1a')]?_0xd7496[_0xac1f('0x1a')]['include']?_[_0xac1f('0x1e')](_0xd7496[_0xac1f('0x1a')][_0xac1f('0x1f')],function(_0x328257){return{'model':db[_0x328257['model']],'as':_0x328257['as'],'attributes':_0x328257['attributes'],'include':_0x328257[_0xac1f('0x1f')]?_[_0xac1f('0x1e')](_0x328257[_0xac1f('0x1f')],function(_0x3bd36c){return{'model':db[_0x3bd36c[_0xac1f('0x20')]],'as':_0x3bd36c['as'],'attributes':_0x3bd36c[_0xac1f('0x21')],'include':_0x3bd36c[_0xac1f('0x1f')]?_[_0xac1f('0x1e')](_0x3bd36c[_0xac1f('0x1f')],function(_0x5678d7){return{'model':db[_0x5678d7[_0xac1f('0x20')]],'as':_0x5678d7['as'],'attributes':_0x5678d7[_0xac1f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xac1f('0xc')](function(_0x2f62f8){logger[_0xac1f('0xd')](_0xac1f('0x17'),_0xd7496);logger[_0xac1f('0xf')](_0xac1f('0x17'),_0xd7496,JSON[_0xac1f('0x11')](_0x2f62f8));_0x4473ad(_0x2f62f8);})[_0xac1f('0x22')](function(_0x2be7cd){logger[_0xac1f('0x12')](_0xac1f('0x17'),_0x2be7cd[_0xac1f('0x14')],_0xd7496);_0xc83c32(_0x3e9852[_0xac1f('0x12')](0x1f4,_0x2be7cd['message']));});});};exports[_0xac1f('0x23')]=function(_0x1aee37){var _0x4aa442=this;return new Promise(function(_0x4d2a6b,_0x405373){return db[_0xac1f('0x18')]['find']({'raw':_0x1aee37['options']?_0x1aee37[_0xac1f('0x1a')][_0xac1f('0x1b')]===undefined?!![]:![]:!![],'where':_0x1aee37['options']?_0x1aee37['options'][_0xac1f('0x1c')]||null:null,'attributes':_0x1aee37[_0xac1f('0x1a')]?_0x1aee37[_0xac1f('0x1a')][_0xac1f('0x21')]||null:null,'include':_0x1aee37[_0xac1f('0x1a')]?_0x1aee37[_0xac1f('0x1a')][_0xac1f('0x1f')]?_[_0xac1f('0x1e')](_0x1aee37[_0xac1f('0x1a')][_0xac1f('0x1f')],function(_0x5de49f){return{'model':db[_0x5de49f[_0xac1f('0x20')]],'as':_0x5de49f['as'],'attributes':_0x5de49f[_0xac1f('0x21')],'include':_0x5de49f[_0xac1f('0x1f')]?_[_0xac1f('0x1e')](_0x5de49f['include'],function(_0x5517be){return{'model':db[_0x5517be[_0xac1f('0x20')]],'as':_0x5517be['as'],'attributes':_0x5517be[_0xac1f('0x21')],'include':_0x5517be[_0xac1f('0x1f')]?_['map'](_0x5517be[_0xac1f('0x1f')],function(_0x2d7b86){return{'model':db[_0x2d7b86[_0xac1f('0x20')]],'as':_0x2d7b86['as'],'attributes':_0x2d7b86[_0xac1f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5366a0){logger[_0xac1f('0xd')](_0xac1f('0x23'),_0x1aee37);logger[_0xac1f('0xf')](_0xac1f('0x23'),_0x1aee37,JSON[_0xac1f('0x11')](_0x5366a0));_0x4d2a6b(_0x5366a0);})[_0xac1f('0x22')](function(_0x2c1093){logger['error'](_0xac1f('0x23'),_0x2c1093[_0xac1f('0x14')],_0x1aee37);_0x405373(_0x4aa442[_0xac1f('0x12')](0x1f4,_0x2c1093[_0xac1f('0x14')]));});});};
\ No newline at end of file
+var _0x5024=['stringify','error','code','message','info','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowMailQueue','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0x5024,0x88));var _0x4502=function(_0x2e36e4,_0x353d60){_0x2e36e4=_0x2e36e4-0x0;var _0x2dc2d9=_0x5024[_0x2e36e4];return _0x2dc2d9;};'use strict';var _=require(_0x4502('0x0'));var util=require(_0x4502('0x1'));var moment=require(_0x4502('0x2'));var BPromise=require(_0x4502('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4502('0x4'))['db'];var utils=require(_0x4502('0x5'));var logger=require('../../config/logger')(_0x4502('0x6'));var config=require(_0x4502('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4502('0x8')]({'port':0x232a});config[_0x4502('0x9')]=_[_0x4502('0xa')](config[_0x4502('0x9')],{'host':_0x4502('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4502('0x9')]));require(_0x4502('0xc'))[_0x4502('0xd')](socket);function respondWithRpcPromise(_0x38ae49,_0x25618e,_0x3c203c){return new BPromise(function(_0x15c284,_0x2b12c5){return client[_0x4502('0xe')](_0x38ae49,_0x3c203c)[_0x4502('0xf')](function(_0x3dc445){logger['info'](_0x4502('0x10'),_0x25618e,_0x4502('0x11'));logger[_0x4502('0x12')](_0x4502('0x13'),_0x25618e,'request\x20sent',JSON[_0x4502('0x14')](_0x3dc445));if(_0x3dc445[_0x4502('0x15')]){if(_0x3dc445[_0x4502('0x15')][_0x4502('0x16')]===0x1f4){logger[_0x4502('0x15')](_0x4502('0x10'),_0x25618e,_0x3dc445[_0x4502('0x15')][_0x4502('0x17')]);return _0x2b12c5(_0x3dc445['error'][_0x4502('0x17')]);}logger[_0x4502('0x15')](_0x4502('0x10'),_0x25618e,_0x3dc445[_0x4502('0x15')][_0x4502('0x17')]);return _0x15c284(_0x3dc445[_0x4502('0x15')][_0x4502('0x17')]);}else{logger[_0x4502('0x18')](_0x4502('0x10'),_0x25618e,_0x4502('0x11'));_0x15c284(_0x3dc445['result'][_0x4502('0x17')]);}})[_0x4502('0x19')](function(_0x16316){logger[_0x4502('0x15')](_0x4502('0x10'),_0x25618e,_0x16316);_0x2b12c5(_0x16316);});});}exports[_0x4502('0x1a')]=function(_0x1b2c25){var _0x593bad=this;return new Promise(function(_0x5e40f5,_0x4c39a4){return db[_0x4502('0x1b')][_0x4502('0x1c')]({'raw':_0x1b2c25[_0x4502('0x1d')]?_0x1b2c25[_0x4502('0x1d')][_0x4502('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b2c25[_0x4502('0x1d')]?_0x1b2c25[_0x4502('0x1d')][_0x4502('0x1f')]||null:null,'attributes':_0x1b2c25[_0x4502('0x1d')]?_0x1b2c25[_0x4502('0x1d')][_0x4502('0x20')]||null:null,'limit':_0x1b2c25[_0x4502('0x1d')]?_0x1b2c25[_0x4502('0x1d')][_0x4502('0x21')]||null:null,'include':_0x1b2c25['options']?_0x1b2c25[_0x4502('0x1d')][_0x4502('0x22')]?_[_0x4502('0x23')](_0x1b2c25[_0x4502('0x1d')][_0x4502('0x22')],function(_0x4a1d97){return{'model':db[_0x4a1d97[_0x4502('0x24')]],'as':_0x4a1d97['as'],'attributes':_0x4a1d97[_0x4502('0x20')],'include':_0x4a1d97['include']?_[_0x4502('0x23')](_0x4a1d97[_0x4502('0x22')],function(_0x9bf565){return{'model':db[_0x9bf565[_0x4502('0x24')]],'as':_0x9bf565['as'],'attributes':_0x9bf565['attributes'],'include':_0x9bf565[_0x4502('0x22')]?_[_0x4502('0x23')](_0x9bf565[_0x4502('0x22')],function(_0x737e1f){return{'model':db[_0x737e1f[_0x4502('0x24')]],'as':_0x737e1f['as'],'attributes':_0x737e1f[_0x4502('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4502('0xf')](function(_0xb60e09){logger[_0x4502('0x18')](_0x4502('0x1a'),_0x1b2c25);logger['debug'](_0x4502('0x1a'),_0x1b2c25,JSON[_0x4502('0x14')](_0xb60e09));_0x5e40f5(_0xb60e09);})[_0x4502('0x19')](function(_0xde1a85){logger[_0x4502('0x15')](_0x4502('0x1a'),_0xde1a85[_0x4502('0x17')],_0x1b2c25);_0x4c39a4(_0x593bad[_0x4502('0x15')](0x1f4,_0xde1a85['message']));});});};exports['ShowMailQueue']=function(_0x12b663){var _0x135267=this;return new Promise(function(_0x20321c,_0x1b91a8){return db['MailQueue'][_0x4502('0x25')]({'raw':_0x12b663[_0x4502('0x1d')]?_0x12b663[_0x4502('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x12b663[_0x4502('0x1d')]?_0x12b663[_0x4502('0x1d')][_0x4502('0x1f')]||null:null,'attributes':_0x12b663[_0x4502('0x1d')]?_0x12b663[_0x4502('0x1d')][_0x4502('0x20')]||null:null,'include':_0x12b663['options']?_0x12b663[_0x4502('0x1d')][_0x4502('0x22')]?_[_0x4502('0x23')](_0x12b663[_0x4502('0x1d')][_0x4502('0x22')],function(_0x4ff3e1){return{'model':db[_0x4ff3e1[_0x4502('0x24')]],'as':_0x4ff3e1['as'],'attributes':_0x4ff3e1[_0x4502('0x20')],'include':_0x4ff3e1[_0x4502('0x22')]?_[_0x4502('0x23')](_0x4ff3e1[_0x4502('0x22')],function(_0xdd005a){return{'model':db[_0xdd005a[_0x4502('0x24')]],'as':_0xdd005a['as'],'attributes':_0xdd005a[_0x4502('0x20')],'include':_0xdd005a[_0x4502('0x22')]?_[_0x4502('0x23')](_0xdd005a[_0x4502('0x22')],function(_0x3f89de){return{'model':db[_0x3f89de['model']],'as':_0x3f89de['as'],'attributes':_0x3f89de[_0x4502('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4502('0xf')](function(_0x42f339){logger[_0x4502('0x18')](_0x4502('0x26'),_0x12b663);logger[_0x4502('0x12')](_0x4502('0x26'),_0x12b663,JSON[_0x4502('0x14')](_0x42f339));_0x20321c(_0x42f339);})[_0x4502('0x19')](function(_0x25416e){logger[_0x4502('0x15')]('ShowMailQueue',_0x25416e[_0x4502('0x17')],_0x12b663);_0x1b91a8(_0x135267[_0x4502('0x15')](0x1f4,_0x25416e['message']));});});};
\ No newline at end of file
index 688b6b7..3d42947 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d55=['removeListener','register','length','mailQueue:','./mailQueue.events','remove','update','emit'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x9d55,0xac));var _0x59d5=function(_0x20b194,_0x1087d1){_0x20b194=_0x20b194-0x0;var _0x4b812e=_0x9d55[_0x20b194];return _0x4b812e;};'use strict';var MailQueueEvents=require(_0x59d5('0x0'));var events=['save',_0x59d5('0x1'),_0x59d5('0x2')];function createListener(_0x44fb99,_0x2be847){return function(_0x1222c6){_0x2be847[_0x59d5('0x3')](_0x44fb99,_0x1222c6);};}function removeListener(_0x1578e1,_0x23db43){return function(){MailQueueEvents[_0x59d5('0x4')](_0x1578e1,_0x23db43);};}exports[_0x59d5('0x5')]=function(_0x4cef4f){for(var _0x4f06e1=0x0,_0x498b8b=events[_0x59d5('0x6')];_0x4f06e1<_0x498b8b;_0x4f06e1++){var _0x103ced=events[_0x4f06e1];var _0x182d37=createListener(_0x59d5('0x7')+_0x103ced,_0x4cef4f);MailQueueEvents['on'](_0x103ced,_0x182d37);}};
\ No newline at end of file
+var _0x3437=['update','emit','register','length','mailQueue:','save','remove'];(function(_0x113d06,_0x3f52fe){var _0x210c50=function(_0x4aa153){while(--_0x4aa153){_0x113d06['push'](_0x113d06['shift']());}};_0x210c50(++_0x3f52fe);}(_0x3437,0x19b));var _0x7343=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3437[_0x19e35c];return _0x3e1fe8;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x7343('0x0'),_0x7343('0x1'),_0x7343('0x2')];function createListener(_0x28731f,_0x209fa1){return function(_0x4c4902){_0x209fa1[_0x7343('0x3')](_0x28731f,_0x4c4902);};}function removeListener(_0x308378,_0x463592){return function(){MailQueueEvents['removeListener'](_0x308378,_0x463592);};}exports[_0x7343('0x4')]=function(_0x326e46){for(var _0x8d601b=0x0,_0x4dddd4=events[_0x7343('0x5')];_0x8d601b<_0x4dddd4;_0x8d601b++){var _0x185be5=events[_0x8d601b];var _0xcd591=createListener(_0x7343('0x6')+_0x185be5,_0x326e46);MailQueueEvents['on'](_0x185be5,_0xcd591);}};
\ No newline at end of file
index 8a4efec..30cb0b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78c0=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x3ffb48,_0x133d2d){var _0x55ed4c=function(_0x290d0e){while(--_0x290d0e){_0x3ffb48['push'](_0x3ffb48['shift']());}};_0x55ed4c(++_0x133d2d);}(_0x78c0,0xd9));var _0x078c=function(_0x4d0fdb,_0x3f7b79){_0x4d0fdb=_0x4d0fdb-0x0;var _0x26f1dc=_0x78c0[_0x4d0fdb];return _0x26f1dc;};'use strict';var multer=require(_0x078c('0x0'));var util=require(_0x078c('0x1'));var path=require(_0x078c('0x2'));var timeout=require('connect-timeout');var express=require(_0x078c('0x3'));var router=express[_0x078c('0x4')]();var fs_extra=require(_0x078c('0x5'));var auth=require(_0x078c('0x6'));var interaction=require(_0x078c('0x7'));var config=require(_0x078c('0x8'));var controller=require(_0x078c('0x9'));router[_0x078c('0xa')]('/',auth[_0x078c('0xb')](),controller['index']);router[_0x078c('0xa')](_0x078c('0xc'),auth[_0x078c('0xb')](),controller[_0x078c('0xd')]);router[_0x078c('0xa')](_0x078c('0xe'),auth[_0x078c('0xb')](),controller[_0x078c('0xf')]);router[_0x078c('0x10')]('/',auth[_0x078c('0xb')](),controller[_0x078c('0x11')]);router[_0x078c('0x12')]('/:id',auth[_0x078c('0xb')](),controller[_0x078c('0x13')]);router[_0x078c('0x14')]('/:id',auth[_0x078c('0xb')](),controller[_0x078c('0x15')]);module[_0x078c('0x16')]=router;
\ No newline at end of file
+var _0x2b69=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','update'];(function(_0x189d12,_0x17aafc){var _0x39b0ad=function(_0x21a7de){while(--_0x21a7de){_0x189d12['push'](_0x189d12['shift']());}};_0x39b0ad(++_0x17aafc);}(_0x2b69,0x1ba));var _0x92b6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2b69[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x92b6('0x0'));var util=require(_0x92b6('0x1'));var path=require(_0x92b6('0x2'));var timeout=require('connect-timeout');var express=require(_0x92b6('0x3'));var router=express[_0x92b6('0x4')]();var fs_extra=require(_0x92b6('0x5'));var auth=require(_0x92b6('0x6'));var interaction=require(_0x92b6('0x7'));var config=require('../../config/environment');var controller=require(_0x92b6('0x8'));router[_0x92b6('0x9')]('/',auth[_0x92b6('0xa')](),controller[_0x92b6('0xb')]);router[_0x92b6('0x9')](_0x92b6('0xc'),auth[_0x92b6('0xa')](),controller[_0x92b6('0xd')]);router[_0x92b6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x92b6('0xe')]);router[_0x92b6('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x92b6('0x10'),auth[_0x92b6('0xa')](),controller[_0x92b6('0x11')]);router['delete'](_0x92b6('0x10'),auth[_0x92b6('0xa')](),controller[_0x92b6('0x12')]);module[_0x92b6('0x13')]=router;
\ No newline at end of file
index ead4c85..99a7eb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f90=['sequelize','STRING','DATE'];(function(_0x3f09a9,_0x2a1758){var _0x854a6d=function(_0x3eff89){while(--_0x3eff89){_0x3f09a9['push'](_0x3f09a9['shift']());}};_0x854a6d(++_0x2a1758);}(_0x7f90,0x1c5));var _0x07f9=function(_0x3f32e4,_0x4681c7){_0x3f32e4=_0x3f32e4-0x0;var _0x18fbef=_0x7f90[_0x3f32e4];return _0x18fbef;};'use strict';var moment=require('moment');var Sequelize=require(_0x07f9('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x07f9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x07f9('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x07f9('0x2')]},'reason':{'type':Sequelize[_0x07f9('0x1')]}};
\ No newline at end of file
+var _0xbdb0=['exports','STRING','DATE','moment','sequelize'];(function(_0x13cc47,_0x10999e){var _0x45137f=function(_0x479462){while(--_0x479462){_0x13cc47['push'](_0x13cc47['shift']());}};_0x45137f(++_0x10999e);}(_0xbdb0,0x189));var _0x0bdb=function(_0x35b195,_0x8893d5){_0x35b195=_0x35b195-0x0;var _0x2433bf=_0xbdb0[_0x35b195];return _0x2433bf;};'use strict';var moment=require(_0x0bdb('0x0'));var Sequelize=require(_0x0bdb('0x1'));module[_0x0bdb('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0bdb('0x3')]},'joinAt':{'type':Sequelize[_0x0bdb('0x4')]},'leaveAt':{'type':Sequelize[_0x0bdb('0x4')]},'acceptAt':{'type':Sequelize[_0x0bdb('0x4')]},'exitAt':{'type':Sequelize[_0x0bdb('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 04521be..71640af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','MailQueueReport','rawAttributes','type'];(function(_0x59a40c,_0x35999f){var _0x3cf340=function(_0x3d2c47){while(--_0x3d2c47){_0x59a40c['push'](_0x59a40c['shift']());}};_0x3cf340(++_0x35999f);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['MailQueueReport'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':!![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['MailQueueReport']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['MailQueueReport'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));};
\ No newline at end of file
+var _0x7708=['map','MailQueueReport','rawAttributes','key','model','keys','intersection','query','attributes','fields','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','apply','save','update','then','destroy','error','stack','name','send','index'];(function(_0x14b1de,_0x25af0e){var _0xda7d38=function(_0x93ac2a){while(--_0x93ac2a){_0x14b1de['push'](_0x14b1de['shift']());}};_0xda7d38(++_0x25af0e);}(_0x7708,0x188));var _0x8770=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0x7708[_0x13524d];return _0x9918b4;};'use strict';var emlformat=require(_0x8770('0x0'));var rimraf=require(_0x8770('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8770('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8770('0x3'));var path=require(_0x8770('0x4'));var sox=require('sox');var csv=require(_0x8770('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8770('0x6'));var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0x5'));var querystring=require('querystring');var Papa=require(_0x8770('0xc'));var Redis=require(_0x8770('0xd'));var authService=require(_0x8770('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8770('0xf'));var hardwareService=require(_0x8770('0x10'));var logger=require(_0x8770('0x11'))(_0x8770('0x12'));var utils=require('../../config/utils');var config=require(_0x8770('0x13'));var licenseUtil=require(_0x8770('0x14'));var db=require(_0x8770('0x15'))['db'];function respondWithStatusCode(_0x51efbc,_0xb52d60){_0xb52d60=_0xb52d60||0xcc;return function(_0x455a65){if(_0x455a65){return _0x51efbc[_0x8770('0x16')](_0xb52d60);}return _0x51efbc[_0x8770('0x17')](_0xb52d60)[_0x8770('0x18')]();};}function respondWithResult(_0x12a06f,_0x1ce41d){_0x1ce41d=_0x1ce41d||0xc8;return function(_0x12439f){if(_0x12439f){return _0x12a06f['status'](_0x1ce41d)[_0x8770('0x19')](_0x12439f);}};}function respondWithFilteredResult(_0x106a20,_0x5dd4e7){return function(_0x2f7918){if(_0x2f7918){var _0x52254f=typeof _0x5dd4e7[_0x8770('0x1a')]==='undefined'&&typeof _0x5dd4e7['limit']==='undefined';var _0x155e83=_0x2f7918[_0x8770('0x1b')];var _0x17b634=_0x52254f?0x0:_0x5dd4e7[_0x8770('0x1a')];var _0x4b0691=_0x52254f?_0x2f7918['count']:_0x5dd4e7[_0x8770('0x1a')]+_0x5dd4e7[_0x8770('0x1c')];var _0x26cbcd;if(_0x4b0691>=_0x155e83){_0x4b0691=_0x155e83;_0x26cbcd=0xc8;}else{_0x26cbcd=0xce;}_0x106a20[_0x8770('0x17')](_0x26cbcd);return _0x106a20[_0x8770('0x1d')]('Content-Range',_0x17b634+'-'+_0x4b0691+'/'+_0x155e83)[_0x8770('0x19')](_0x2f7918);}return null;};}function patchUpdates(_0x1234dd){return function(_0x384b1e){try{jsonpatch[_0x8770('0x1e')](_0x384b1e,_0x1234dd,!![]);}catch(_0x582048){return BPromise['reject'](_0x582048);}return _0x384b1e[_0x8770('0x1f')]();};}function saveUpdates(_0x348e2f,_0x443716){return function(_0x2918a7){if(_0x2918a7){return _0x2918a7[_0x8770('0x20')](_0x348e2f)[_0x8770('0x21')](function(_0x5819dc){return _0x5819dc;});}return null;};}function removeEntity(_0x468fc0,_0x23ad66){return function(_0x4274dd){if(_0x4274dd){return _0x4274dd[_0x8770('0x22')]()['then'](function(){_0x468fc0[_0x8770('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b4755,_0x453804){return function(_0x473d31){if(!_0x473d31){_0x7b4755[_0x8770('0x16')](0x194);}return _0x473d31;};}function handleError(_0x1538b2,_0x2cd084){_0x2cd084=_0x2cd084||0x1f4;return function(_0x293f53){logger[_0x8770('0x23')](_0x293f53[_0x8770('0x24')]);if(_0x293f53[_0x8770('0x25')]){delete _0x293f53['name'];}_0x1538b2[_0x8770('0x17')](_0x2cd084)[_0x8770('0x26')](_0x293f53);};}exports[_0x8770('0x27')]=function(_0x5c7bd,_0x246128){var _0x200a82={},_0x5ae7b8={},_0x4b284b={'count':0x0,'rows':[]};var _0x37974d=_[_0x8770('0x28')](db[_0x8770('0x29')][_0x8770('0x2a')],function(_0x23f4b0){return{'name':_0x23f4b0['fieldName'],'type':_0x23f4b0['type'][_0x8770('0x2b')]};});_0x5ae7b8[_0x8770('0x2c')]=_[_0x8770('0x28')](_0x37974d,_0x8770('0x25'));_0x5ae7b8['query']=_[_0x8770('0x2d')](_0x5c7bd['query']);_0x5ae7b8['filters']=_[_0x8770('0x2e')](_0x5ae7b8['model'],_0x5ae7b8[_0x8770('0x2f')]);_0x200a82[_0x8770('0x30')]=_[_0x8770('0x2e')](_0x5ae7b8[_0x8770('0x2c')],qs[_0x8770('0x31')](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x31')]));_0x200a82[_0x8770('0x30')]=_0x200a82[_0x8770('0x30')]['length']?_0x200a82[_0x8770('0x30')]:_0x5ae7b8[_0x8770('0x2c')];if(!_0x5c7bd[_0x8770('0x2f')]['hasOwnProperty']('nolimit')){_0x200a82[_0x8770('0x1c')]=qs[_0x8770('0x1c')](_0x5c7bd[_0x8770('0x2f')]['limit']);_0x200a82[_0x8770('0x1a')]=qs['offset'](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x1a')]);}_0x200a82[_0x8770('0x32')]=qs[_0x8770('0x33')](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x33')]);_0x200a82[_0x8770('0x34')]=qs[_0x8770('0x35')](_[_0x8770('0x36')](_0x5c7bd[_0x8770('0x2f')],_0x5ae7b8['filters']),_0x37974d);if(_0x5c7bd[_0x8770('0x2f')][_0x8770('0x37')]){_0x200a82[_0x8770('0x34')]=_['merge'](_0x200a82[_0x8770('0x34')],{'$or':_[_0x8770('0x28')](_0x37974d,function(_0x27f91c){if(_0x27f91c[_0x8770('0x38')]!==_0x8770('0x39')){var _0x3a50db={};_0x3a50db[_0x27f91c['name']]={'$like':'%'+_0x5c7bd[_0x8770('0x2f')]['filter']+'%'};return _0x3a50db;}})});}_0x200a82=_[_0x8770('0x3a')]({},_0x200a82,_0x5c7bd['options']);var _0x41134a={'where':_0x200a82[_0x8770('0x34')]};return db[_0x8770('0x29')]['count'](_0x41134a)[_0x8770('0x21')](function(_0x3f35ac){_0x4b284b[_0x8770('0x1b')]=_0x3f35ac;if(_0x5c7bd[_0x8770('0x2f')][_0x8770('0x3b')]){_0x200a82[_0x8770('0x3c')]=[{'all':!![]}];}return db['MailQueueReport'][_0x8770('0x3d')](_0x200a82);})['then'](function(_0x4bcfc7){_0x4b284b[_0x8770('0x3e')]=_0x4bcfc7;return _0x4b284b;})[_0x8770('0x21')](respondWithFilteredResult(_0x246128,_0x200a82))[_0x8770('0x3f')](handleError(_0x246128,null));};exports[_0x8770('0x40')]=function(_0x3a51b5,_0x4b4477){var _0x35b182={'raw':!![],'where':{'id':_0x3a51b5['params']['id']}},_0x26ae1b={};_0x26ae1b[_0x8770('0x2c')]=_['keys'](db[_0x8770('0x29')][_0x8770('0x2a')]);_0x26ae1b[_0x8770('0x2f')]=_[_0x8770('0x2d')](_0x3a51b5[_0x8770('0x2f')]);_0x26ae1b[_0x8770('0x35')]=_[_0x8770('0x2e')](_0x26ae1b[_0x8770('0x2c')],_0x26ae1b[_0x8770('0x2f')]);_0x35b182[_0x8770('0x30')]=_[_0x8770('0x2e')](_0x26ae1b['model'],qs[_0x8770('0x31')](_0x3a51b5[_0x8770('0x2f')][_0x8770('0x31')]));_0x35b182[_0x8770('0x30')]=_0x35b182[_0x8770('0x30')][_0x8770('0x41')]?_0x35b182['attributes']:_0x26ae1b[_0x8770('0x2c')];if(_0x3a51b5[_0x8770('0x2f')][_0x8770('0x3b')]){_0x35b182[_0x8770('0x3c')]=[{'all':!![]}];}_0x35b182=_[_0x8770('0x3a')]({},_0x35b182,_0x3a51b5[_0x8770('0x42')]);return db[_0x8770('0x29')][_0x8770('0x43')](_0x35b182)['then'](handleEntityNotFound(_0x4b4477,null))[_0x8770('0x21')](respondWithResult(_0x4b4477,null))[_0x8770('0x3f')](handleError(_0x4b4477,null));};exports[_0x8770('0x44')]=function(_0xaeaf3b,_0x454496){return db['MailQueueReport']['create'](_0xaeaf3b[_0x8770('0x45')],{})['then'](respondWithResult(_0x454496,0xc9))[_0x8770('0x3f')](handleError(_0x454496,null));};exports['update']=function(_0x4f9e0b,_0x3805d8){if(_0x4f9e0b[_0x8770('0x45')]['id']){delete _0x4f9e0b[_0x8770('0x45')]['id'];}return db[_0x8770('0x29')]['find']({'where':{'id':_0x4f9e0b[_0x8770('0x46')]['id']}})[_0x8770('0x21')](handleEntityNotFound(_0x3805d8,null))['then'](saveUpdates(_0x4f9e0b['body'],null))[_0x8770('0x21')](respondWithResult(_0x3805d8,null))[_0x8770('0x3f')](handleError(_0x3805d8,null));};exports[_0x8770('0x22')]=function(_0x4f5cb8,_0x1584dc){return db['MailQueueReport'][_0x8770('0x43')]({'where':{'id':_0x4f5cb8[_0x8770('0x46')]['id']}})[_0x8770('0x21')](handleEntityNotFound(_0x1584dc,null))['then'](removeEntity(_0x1584dc,null))[_0x8770('0x3f')](handleError(_0x1584dc,null));};exports['describe']=function(_0x5aae53,_0x4cfacb){return db[_0x8770('0x29')][_0x8770('0x47')]()[_0x8770('0x21')](respondWithResult(_0x4cfacb,null))[_0x8770('0x3f')](handleError(_0x4cfacb,null));};
\ No newline at end of file
index 4cb405f..b199032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a55=['lodash','../../config/logger','api','bluebird','path','./mailQueueReport.attributes','define','report_mail_queue','uniqueid'];(function(_0x1622e0,_0x4bfea4){var _0x2da7d5=function(_0x4ad7bc){while(--_0x4ad7bc){_0x1622e0['push'](_0x1622e0['shift']());}};_0x2da7d5(++_0x4bfea4);}(_0x7a55,0xea));var _0x57a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7a55[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57a5('0x0'));var util=require('util');var logger=require(_0x57a5('0x1'))(_0x57a5('0x2'));var moment=require('moment');var BPromise=require(_0x57a5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57a5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x57a5('0x5'));module['exports']=function(_0x4c85c1,_0x2e962d){return _0x4c85c1[_0x57a5('0x6')]('MailQueueReport',attributes,{'tableName':_0x57a5('0x7'),'paranoid':![],'indexes':[{'name':_0x57a5('0x8'),'fields':[_0x57a5('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x866e=['path','rimraf','../../config/environment','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x41e572,_0x6ce85b){var _0x2f1651=function(_0x163634){while(--_0x163634){_0x41e572['push'](_0x41e572['shift']());}};_0x2f1651(++_0x6ce85b);}(_0x866e,0xaf));var _0xe866=function(_0x126810,_0x1e38ca){_0x126810=_0x126810-0x0;var _0x21b5c5=_0x866e[_0x126810];return _0x21b5c5;};'use strict';var _=require(_0xe866('0x0'));var util=require(_0xe866('0x1'));var logger=require(_0xe866('0x2'))(_0xe866('0x3'));var moment=require(_0xe866('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe866('0x5'));var rimraf=require(_0xe866('0x6'));var config=require(_0xe866('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0xe866('0x8')]=function(_0x148b3c,_0x460921){return _0x148b3c['define'](_0xe866('0x9'),attributes,{'tableName':_0xe866('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe866('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index fac301f..58f939e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x266faf,_0x500681){var _0xbed2d0=function(_0x272c34){while(--_0x272c34){_0x266faf['push'](_0x266faf['shift']());}};_0xbed2d0(++_0x500681);}(_0x326f,0xd1));var _0xf326=function(_0x1f8bec,_0x572444){_0x1f8bec=_0x1f8bec-0x0;var _0x28e227=_0x326f[_0x1f8bec];return _0x28e227;};'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')]('MailQueueReport,\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')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});};
\ No newline at end of file
+var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x47fe41,_0x2b0d53){var _0x3aaa16=function(_0x65f12d){while(--_0x65f12d){_0x47fe41['push'](_0x47fe41['shift']());}};_0x3aaa16(++_0x2b0d53);}(_0xadb5,0xad));var _0x5adb=function(_0x16500d,_0x3fb238){_0x16500d=_0x16500d-0x0;var _0x1b1d7c=_0xadb5[_0x16500d];return _0x1b1d7c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});};
\ No newline at end of file
index cb6f557..1503ad2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xd3a823,_0x4ad32e){var _0x54b98a=function(_0x4657eb){while(--_0x4657eb){_0xd3a823['push'](_0xd3a823['shift']());}};_0x54b98a(++_0x4ad32e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x445d20,_0x39643f){var _0x26e5f2=function(_0x1f1e53){while(--_0x1f1e53){_0x445d20['push'](_0x445d20['shift']());}};_0x26e5f2(++_0x39643f);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index a4c6ddc..d0c693d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92b3=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x19dc5b,_0x4f17ec){var _0x2f4043=function(_0x2e5159){while(--_0x2e5159){_0x19dc5b['push'](_0x19dc5b['shift']());}};_0x2f4043(++_0x4f17ec);}(_0x92b3,0xa8));var _0x392b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x92b3[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x392b('0x0'));module['exports']={'description':{'type':Sequelize[_0x392b('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x392b('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x392b('0x1')]},'password':{'type':Sequelize[_0x392b('0x1')]},'port':{'type':Sequelize[_0x392b('0x3')]},'tls':{'type':Sequelize[_0x392b('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x392b('0x4')},'connTimeout':{'type':Sequelize[_0x392b('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x392b('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x392b('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x72a7=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x72a7,0xad));var _0x772a=function(_0x51baa6,_0xa7d5b1){_0x51baa6=_0x51baa6-0x0;var _0x2e54e5=_0x72a7[_0x51baa6];return _0x2e54e5;};'use strict';var Sequelize=require(_0x772a('0x0'));module['exports']={'description':{'type':Sequelize[_0x772a('0x1')]},'host':{'type':Sequelize[_0x772a('0x1')]},'authentication':{'type':Sequelize[_0x772a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x772a('0x1')]},'password':{'type':Sequelize[_0x772a('0x1')]},'port':{'type':Sequelize[_0x772a('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x772a('0x1')],'defaultValue':_0x772a('0x4')},'connTimeout':{'type':Sequelize[_0x772a('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x772a('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x772a('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index d84540f..b03ead2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x965e=['request-promise','rimraf','../../config/environment','./mailServerIn.attributes','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x10a8d8,_0x28f292){var _0x3b2b79=function(_0x55a3fe){while(--_0x55a3fe){_0x10a8d8['push'](_0x10a8d8['shift']());}};_0x3b2b79(++_0x28f292);}(_0x965e,0x162));var _0xe965=function(_0x39686e,_0x3d83bb){_0x39686e=_0x39686e-0x0;var _0x1b765e=_0x965e[_0x39686e];return _0x1b765e;};'use strict';var _=require(_0xe965('0x0'));var util=require(_0xe965('0x1'));var logger=require(_0xe965('0x2'))(_0xe965('0x3'));var moment=require(_0xe965('0x4'));var BPromise=require(_0xe965('0x5'));var rp=require(_0xe965('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe965('0x7'));var config=require(_0xe965('0x8'));var attributes=require(_0xe965('0x9'));module['exports']=function(_0x10d2b9,_0x40d9df){return _0x10d2b9['define'](_0xe965('0xa'),attributes,{'tableName':_0xe965('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2cb=['request-promise','path','../../config/environment','define','MailServerIn','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x52e7f9,_0x301bf8){var _0x277f4b=function(_0x1de2aa){while(--_0x1de2aa){_0x52e7f9['push'](_0x52e7f9['shift']());}};_0x277f4b(++_0x301bf8);}(_0xc2cb,0x7e));var _0xbc2c=function(_0x5645ad,_0x580ea3){_0x5645ad=_0x5645ad-0x0;var _0x17d292=_0xc2cb[_0x5645ad];return _0x17d292;};'use strict';var _=require(_0xbc2c('0x0'));var util=require(_0xbc2c('0x1'));var logger=require(_0xbc2c('0x2'))(_0xbc2c('0x3'));var moment=require(_0xbc2c('0x4'));var BPromise=require(_0xbc2c('0x5'));var rp=require(_0xbc2c('0x6'));var fs=require('fs');var path=require(_0xbc2c('0x7'));var rimraf=require('rimraf');var config=require(_0xbc2c('0x8'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x44581a,_0x2d1286){return _0x44581a[_0xbc2c('0x9')](_0xbc2c('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ac43241..66006ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10d8=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','map','include','model','lodash','util'];(function(_0x23efe6,_0x737a9e){var _0x360532=function(_0x1991a4){while(--_0x1991a4){_0x23efe6['push'](_0x23efe6['shift']());}};_0x360532(++_0x737a9e);}(_0x10d8,0xee));var _0x810d=function(_0x21d38c,_0x47e6aa){_0x21d38c=_0x21d38c-0x0;var _0x1469a6=_0x10d8[_0x21d38c];return _0x1469a6;};'use strict';var _=require(_0x810d('0x0'));var util=require(_0x810d('0x1'));var moment=require(_0x810d('0x2'));var BPromise=require('bluebird');var rs=require(_0x810d('0x3'));var fs=require('fs');var Redis=require(_0x810d('0x4'));var db=require(_0x810d('0x5'))['db'];var utils=require(_0x810d('0x6'));var logger=require(_0x810d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x810d('0x8'));var client=jayson[_0x810d('0x9')][_0x810d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a4786,_0x18af64,_0x3740af){return new BPromise(function(_0x3b0e88,_0x4efe33){return client['request'](_0x3a4786,_0x3740af)['then'](function(_0x485919){logger[_0x810d('0xb')](_0x810d('0xc'),_0x18af64,_0x810d('0xd'));logger[_0x810d('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x18af64,_0x810d('0xd'),JSON[_0x810d('0xf')](_0x485919));if(_0x485919[_0x810d('0x10')]){if(_0x485919[_0x810d('0x10')]['code']===0x1f4){logger[_0x810d('0x10')]('MailServerIn,\x20%s,\x20%s',_0x18af64,_0x485919['error'][_0x810d('0x11')]);return _0x4efe33(_0x485919['error'][_0x810d('0x11')]);}logger[_0x810d('0x10')]('MailServerIn,\x20%s,\x20%s',_0x18af64,_0x485919[_0x810d('0x10')][_0x810d('0x11')]);return _0x3b0e88(_0x485919[_0x810d('0x10')][_0x810d('0x11')]);}else{logger[_0x810d('0xb')]('MailServerIn,\x20%s,\x20%s',_0x18af64,'request\x20sent');_0x3b0e88(_0x485919[_0x810d('0x12')]['message']);}})[_0x810d('0x13')](function(_0x290563){logger[_0x810d('0x10')](_0x810d('0xc'),_0x18af64,_0x290563);_0x4efe33(_0x290563);});});}exports[_0x810d('0x14')]=function(_0x20c982){var _0x576238=this;return new Promise(function(_0x2756ff,_0x1276ba){return db[_0x810d('0x15')][_0x810d('0x16')]({'raw':_0x20c982['options']?_0x20c982[_0x810d('0x17')][_0x810d('0x18')]===undefined?!![]:![]:!![],'where':_0x20c982[_0x810d('0x17')]?_0x20c982[_0x810d('0x17')]['where']||null:null,'attributes':_0x20c982[_0x810d('0x17')]?_0x20c982[_0x810d('0x17')][_0x810d('0x19')]||null:null,'limit':_0x20c982[_0x810d('0x17')]?_0x20c982[_0x810d('0x17')][_0x810d('0x1a')]||null:null,'include':_0x20c982[_0x810d('0x17')]?_0x20c982[_0x810d('0x17')]['include']?_[_0x810d('0x1b')](_0x20c982[_0x810d('0x17')][_0x810d('0x1c')],function(_0x44c779){return{'model':db[_0x44c779[_0x810d('0x1d')]],'as':_0x44c779['as'],'attributes':_0x44c779[_0x810d('0x19')],'include':_0x44c779[_0x810d('0x1c')]?_['map'](_0x44c779[_0x810d('0x1c')],function(_0x314652){return{'model':db[_0x314652['model']],'as':_0x314652['as'],'attributes':_0x314652['attributes'],'include':_0x314652[_0x810d('0x1c')]?_[_0x810d('0x1b')](_0x314652['include'],function(_0x666f4f){return{'model':db[_0x666f4f[_0x810d('0x1d')]],'as':_0x666f4f['as'],'attributes':_0x666f4f[_0x810d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x263bfb){logger['info'](_0x810d('0x14'),_0x20c982);logger[_0x810d('0xe')]('GetMailServerIn',_0x20c982,JSON[_0x810d('0xf')](_0x263bfb));_0x2756ff(_0x263bfb);})['catch'](function(_0x12a6d8){logger['error'](_0x810d('0x14'),_0x12a6d8[_0x810d('0x11')],_0x20c982);_0x1276ba(_0x576238[_0x810d('0x10')](0x1f4,_0x12a6d8[_0x810d('0x11')]));});});};
\ No newline at end of file
+var _0x9e68=['model','attributes','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','limit','include','map'];(function(_0x546f36,_0x571767){var _0x46853e=function(_0xca817d){while(--_0xca817d){_0x546f36['push'](_0x546f36['shift']());}};_0x46853e(++_0x571767);}(_0x9e68,0x16b));var _0x89e6=function(_0x10c402,_0x15cf99){_0x10c402=_0x10c402-0x0;var _0x2eff43=_0x9e68[_0x10c402];return _0x2eff43;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x89e6('0x0'));var rs=require(_0x89e6('0x1'));var fs=require('fs');var Redis=require(_0x89e6('0x2'));var db=require(_0x89e6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x89e6('0x4'))('rpc');var config=require(_0x89e6('0x5'));var jayson=require(_0x89e6('0x6'));var client=jayson[_0x89e6('0x7')][_0x89e6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3785f6,_0x2a2d4e,_0x36b2f4){return new BPromise(function(_0x516150,_0x21518b){return client['request'](_0x3785f6,_0x36b2f4)[_0x89e6('0x9')](function(_0x41f404){logger[_0x89e6('0xa')](_0x89e6('0xb'),_0x2a2d4e,_0x89e6('0xc'));logger[_0x89e6('0xd')](_0x89e6('0xe'),_0x2a2d4e,_0x89e6('0xc'),JSON['stringify'](_0x41f404));if(_0x41f404[_0x89e6('0xf')]){if(_0x41f404['error']['code']===0x1f4){logger[_0x89e6('0xf')](_0x89e6('0xb'),_0x2a2d4e,_0x41f404[_0x89e6('0xf')]['message']);return _0x21518b(_0x41f404[_0x89e6('0xf')][_0x89e6('0x10')]);}logger[_0x89e6('0xf')](_0x89e6('0xb'),_0x2a2d4e,_0x41f404['error'][_0x89e6('0x10')]);return _0x516150(_0x41f404[_0x89e6('0xf')][_0x89e6('0x10')]);}else{logger[_0x89e6('0xa')](_0x89e6('0xb'),_0x2a2d4e,_0x89e6('0xc'));_0x516150(_0x41f404[_0x89e6('0x11')]['message']);}})[_0x89e6('0x12')](function(_0x32d8e2){logger[_0x89e6('0xf')](_0x89e6('0xb'),_0x2a2d4e,_0x32d8e2);_0x21518b(_0x32d8e2);});});}exports[_0x89e6('0x13')]=function(_0x5bee66){var _0x7f823c=this;return new Promise(function(_0x546517,_0x43c1a6){return db[_0x89e6('0x14')]['findAll']({'raw':_0x5bee66[_0x89e6('0x15')]?_0x5bee66['options'][_0x89e6('0x16')]===undefined?!![]:![]:!![],'where':_0x5bee66[_0x89e6('0x15')]?_0x5bee66[_0x89e6('0x15')][_0x89e6('0x17')]||null:null,'attributes':_0x5bee66[_0x89e6('0x15')]?_0x5bee66[_0x89e6('0x15')]['attributes']||null:null,'limit':_0x5bee66[_0x89e6('0x15')]?_0x5bee66[_0x89e6('0x15')][_0x89e6('0x18')]||null:null,'include':_0x5bee66[_0x89e6('0x15')]?_0x5bee66['options'][_0x89e6('0x19')]?_[_0x89e6('0x1a')](_0x5bee66[_0x89e6('0x15')][_0x89e6('0x19')],function(_0x5593bf){return{'model':db[_0x5593bf[_0x89e6('0x1b')]],'as':_0x5593bf['as'],'attributes':_0x5593bf[_0x89e6('0x1c')],'include':_0x5593bf[_0x89e6('0x19')]?_['map'](_0x5593bf[_0x89e6('0x19')],function(_0x13268f){return{'model':db[_0x13268f['model']],'as':_0x13268f['as'],'attributes':_0x13268f[_0x89e6('0x1c')],'include':_0x13268f[_0x89e6('0x19')]?_[_0x89e6('0x1a')](_0x13268f['include'],function(_0xaac3bf){return{'model':db[_0xaac3bf['model']],'as':_0xaac3bf['as'],'attributes':_0xaac3bf[_0x89e6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x89e6('0x9')](function(_0x395c5b){logger[_0x89e6('0xa')]('GetMailServerIn',_0x5bee66);logger[_0x89e6('0xd')](_0x89e6('0x13'),_0x5bee66,JSON[_0x89e6('0x1d')](_0x395c5b));_0x546517(_0x395c5b);})['catch'](function(_0x3a58a9){logger[_0x89e6('0xf')](_0x89e6('0x13'),_0x3a58a9[_0x89e6('0x10')],_0x5bee66);_0x43c1a6(_0x7f823c[_0x89e6('0xf')](0x1f4,_0x3a58a9[_0x89e6('0x10')]));});});};
\ No newline at end of file
index 7e90b30..fdf7d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x2cea09,_0x52b4ee){_0x2cea09=_0x2cea09-0x0;var _0x5c705b=_0x7a54[_0x2cea09];return _0x5c705b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index 2e0ca3a..940d7a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x49331c,_0x5a0f4d){var _0x200932=function(_0x4e231c){while(--_0x4e231c){_0x49331c['push'](_0x49331c['shift']());}};_0x200932(++_0x5a0f4d);}(_0xb58b,0x1f1));var _0xbb58=function(_0x26863a,_0x448799){_0x26863a=_0x26863a-0x0;var _0x59feda=_0xb58b[_0x26863a];return _0x59feda;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'description':{'type':Sequelize[_0xbb58('0x1')]},'host':{'type':Sequelize[_0xbb58('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xbb58('0x1')]},'port':{'type':Sequelize[_0xbb58('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xbb58('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xbb58('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3266=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x448b0a,_0x363015){var _0x3fd631=function(_0x5b6058){while(--_0x5b6058){_0x448b0a['push'](_0x448b0a['shift']());}};_0x3fd631(++_0x363015);}(_0x3266,0x6a));var _0x6326=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x3266[_0x3070dc];return _0x431489;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'description':{'type':Sequelize[_0x6326('0x2')]},'host':{'type':Sequelize[_0x6326('0x2')]},'user':{'type':Sequelize[_0x6326('0x2')]},'pass':{'type':Sequelize[_0x6326('0x2')]},'port':{'type':Sequelize[_0x6326('0x3')]},'secure':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x6326('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 65f9652..78020e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25c5=['MailServerOut','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','rawAttributes','filters','includeAll','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','name','send','map'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x25c5,0xf8));var _0x525c=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x25c5[_0x5756f8];return _0x3bb749;};'use strict';var emlformat=require(_0x525c('0x0'));var rimraf=require(_0x525c('0x1'));var zipdir=require(_0x525c('0x2'));var jsonpatch=require(_0x525c('0x3'));var rp=require('request-promise');var moment=require(_0x525c('0x4'));var BPromise=require(_0x525c('0x5'));var Mustache=require(_0x525c('0x6'));var util=require(_0x525c('0x7'));var path=require(_0x525c('0x8'));var sox=require('sox');var csv=require(_0x525c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x525c('0xa'));var squel=require('squel');var crypto=require(_0x525c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x525c('0x9'));var querystring=require('querystring');var Papa=require(_0x525c('0xc'));var Redis=require(_0x525c('0xd'));var authService=require(_0x525c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x525c('0xf'));var hardwareService=require(_0x525c('0x10'));var logger=require('../../config/logger')(_0x525c('0x11'));var utils=require(_0x525c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x525c('0x13'));var db=require(_0x525c('0x14'))['db'];function respondWithStatusCode(_0x5bf8a4,_0x497e16){_0x497e16=_0x497e16||0xcc;return function(_0xa613bb){if(_0xa613bb){return _0x5bf8a4[_0x525c('0x15')](_0x497e16);}return _0x5bf8a4['status'](_0x497e16)[_0x525c('0x16')]();};}function respondWithResult(_0x3d15f0,_0x4697a9){_0x4697a9=_0x4697a9||0xc8;return function(_0x57df54){if(_0x57df54){return _0x3d15f0['status'](_0x4697a9)[_0x525c('0x17')](_0x57df54);}};}function respondWithFilteredResult(_0x5c7d05,_0x4634aa){return function(_0x1cd805){if(_0x1cd805){var _0x209035=typeof _0x4634aa[_0x525c('0x18')]===_0x525c('0x19')&&typeof _0x4634aa[_0x525c('0x1a')]===_0x525c('0x19');var _0x495bdf=_0x1cd805[_0x525c('0x1b')];var _0x2a7fa3=_0x209035?0x0:_0x4634aa[_0x525c('0x18')];var _0x513d5a=_0x209035?_0x1cd805[_0x525c('0x1b')]:_0x4634aa['offset']+_0x4634aa[_0x525c('0x1a')];var _0x2200f8;if(_0x513d5a>=_0x495bdf){_0x513d5a=_0x495bdf;_0x2200f8=0xc8;}else{_0x2200f8=0xce;}_0x5c7d05[_0x525c('0x1c')](_0x2200f8);return _0x5c7d05[_0x525c('0x1d')](_0x525c('0x1e'),_0x2a7fa3+'-'+_0x513d5a+'/'+_0x495bdf)[_0x525c('0x17')](_0x1cd805);}return null;};}function patchUpdates(_0x1eebff){return function(_0xfb6819){try{jsonpatch[_0x525c('0x1f')](_0xfb6819,_0x1eebff,!![]);}catch(_0x3f7421){return BPromise['reject'](_0x3f7421);}return _0xfb6819[_0x525c('0x20')]();};}function saveUpdates(_0x23815d,_0x4a55ba){return function(_0x3e096a){if(_0x3e096a){return _0x3e096a[_0x525c('0x21')](_0x23815d)[_0x525c('0x22')](function(_0xc574b9){return _0xc574b9;});}return null;};}function removeEntity(_0x11c05b,_0x502330){return function(_0x239d1f){if(_0x239d1f){return _0x239d1f[_0x525c('0x23')]()['then'](function(){_0x11c05b[_0x525c('0x1c')](0xcc)[_0x525c('0x16')]();});}};}function handleEntityNotFound(_0x82da36,_0x110b71){return function(_0x3bc5ae){if(!_0x3bc5ae){_0x82da36[_0x525c('0x15')](0x194);}return _0x3bc5ae;};}function handleError(_0x1d2fc0,_0x2566b7){_0x2566b7=_0x2566b7||0x1f4;return function(_0x3176a1){logger[_0x525c('0x24')](_0x3176a1['stack']);if(_0x3176a1[_0x525c('0x25')]){delete _0x3176a1[_0x525c('0x25')];}_0x1d2fc0[_0x525c('0x1c')](_0x2566b7)[_0x525c('0x26')](_0x3176a1);};}exports['index']=function(_0x4f56f3,_0x37a61f){var _0x4ca825={},_0x396210={},_0x355606={'count':0x0,'rows':[]};var _0x716f8=_[_0x525c('0x27')](db[_0x525c('0x28')]['rawAttributes'],function(_0x2498ec){return{'name':_0x2498ec[_0x525c('0x29')],'type':_0x2498ec['type'][_0x525c('0x2a')]};});_0x396210['model']=_[_0x525c('0x27')](_0x716f8,_0x525c('0x25'));_0x396210[_0x525c('0x2b')]=_[_0x525c('0x2c')](_0x4f56f3[_0x525c('0x2b')]);_0x396210['filters']=_[_0x525c('0x2d')](_0x396210[_0x525c('0x2e')],_0x396210[_0x525c('0x2b')]);_0x4ca825[_0x525c('0x2f')]=_[_0x525c('0x2d')](_0x396210[_0x525c('0x2e')],qs[_0x525c('0x30')](_0x4f56f3[_0x525c('0x2b')][_0x525c('0x30')]));_0x4ca825[_0x525c('0x2f')]=_0x4ca825[_0x525c('0x2f')][_0x525c('0x31')]?_0x4ca825[_0x525c('0x2f')]:_0x396210[_0x525c('0x2e')];if(!_0x4f56f3[_0x525c('0x2b')]['hasOwnProperty'](_0x525c('0x32'))){_0x4ca825[_0x525c('0x1a')]=qs[_0x525c('0x1a')](_0x4f56f3[_0x525c('0x2b')][_0x525c('0x1a')]);_0x4ca825[_0x525c('0x18')]=qs[_0x525c('0x18')](_0x4f56f3[_0x525c('0x2b')][_0x525c('0x18')]);}_0x4ca825[_0x525c('0x33')]=qs[_0x525c('0x34')](_0x4f56f3[_0x525c('0x2b')][_0x525c('0x34')]);_0x4ca825[_0x525c('0x35')]=qs['filters'](_[_0x525c('0x36')](_0x4f56f3[_0x525c('0x2b')],_0x396210['filters']),_0x716f8);if(_0x4f56f3[_0x525c('0x2b')][_0x525c('0x37')]){_0x4ca825[_0x525c('0x35')]=_[_0x525c('0x38')](_0x4ca825[_0x525c('0x35')],{'$or':_[_0x525c('0x27')](_0x716f8,function(_0x4230b5){if(_0x4230b5[_0x525c('0x39')]!==_0x525c('0x3a')){var _0x2cea60={};_0x2cea60[_0x4230b5[_0x525c('0x25')]]={'$like':'%'+_0x4f56f3['query'][_0x525c('0x37')]+'%'};return _0x2cea60;}})});}_0x4ca825=_[_0x525c('0x38')]({},_0x4ca825,_0x4f56f3[_0x525c('0x3b')]);var _0xbb0972={'where':_0x4ca825[_0x525c('0x35')]};return db[_0x525c('0x28')][_0x525c('0x1b')](_0xbb0972)[_0x525c('0x22')](function(_0x5825c5){_0x355606['count']=_0x5825c5;if(_0x4f56f3['query']['includeAll']){_0x4ca825[_0x525c('0x3c')]=[{'all':!![]}];}return db[_0x525c('0x28')][_0x525c('0x3d')](_0x4ca825);})[_0x525c('0x22')](function(_0x5f019f){_0x355606[_0x525c('0x3e')]=_0x5f019f;return _0x355606;})['then'](respondWithFilteredResult(_0x37a61f,_0x4ca825))['catch'](handleError(_0x37a61f,null));};exports[_0x525c('0x3f')]=function(_0x23a8ea,_0x116313){var _0x151699={'raw':!![],'where':{'id':_0x23a8ea['params']['id']}},_0x4833d9={};_0x4833d9[_0x525c('0x2e')]=_[_0x525c('0x2c')](db[_0x525c('0x28')][_0x525c('0x40')]);_0x4833d9[_0x525c('0x2b')]=_[_0x525c('0x2c')](_0x23a8ea[_0x525c('0x2b')]);_0x4833d9[_0x525c('0x41')]=_['intersection'](_0x4833d9[_0x525c('0x2e')],_0x4833d9[_0x525c('0x2b')]);_0x151699[_0x525c('0x2f')]=_[_0x525c('0x2d')](_0x4833d9[_0x525c('0x2e')],qs[_0x525c('0x30')](_0x23a8ea[_0x525c('0x2b')]['fields']));_0x151699[_0x525c('0x2f')]=_0x151699['attributes'][_0x525c('0x31')]?_0x151699[_0x525c('0x2f')]:_0x4833d9[_0x525c('0x2e')];if(_0x23a8ea['query'][_0x525c('0x42')]){_0x151699[_0x525c('0x3c')]=[{'all':!![]}];}_0x151699=_[_0x525c('0x38')]({},_0x151699,_0x23a8ea[_0x525c('0x3b')]);return db[_0x525c('0x28')][_0x525c('0x43')](_0x151699)[_0x525c('0x22')](handleEntityNotFound(_0x116313,null))[_0x525c('0x22')](respondWithResult(_0x116313,null))[_0x525c('0x44')](handleError(_0x116313,null));};exports[_0x525c('0x45')]=function(_0x10a7ea,_0x24a55e){return db[_0x525c('0x28')][_0x525c('0x45')](_0x10a7ea[_0x525c('0x46')],{})[_0x525c('0x22')](respondWithResult(_0x24a55e,0xc9))[_0x525c('0x44')](handleError(_0x24a55e,null));};exports[_0x525c('0x21')]=function(_0x30450c,_0x4479ce){if(_0x30450c['body']['id']){delete _0x30450c[_0x525c('0x46')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x30450c[_0x525c('0x47')]['id']}})[_0x525c('0x22')](handleEntityNotFound(_0x4479ce,null))[_0x525c('0x22')](saveUpdates(_0x30450c['body'],null))[_0x525c('0x22')](respondWithResult(_0x4479ce,null))[_0x525c('0x44')](handleError(_0x4479ce,null));};exports[_0x525c('0x23')]=function(_0x2ab76b,_0x5236e8){return db[_0x525c('0x28')][_0x525c('0x43')]({'where':{'id':_0x2ab76b[_0x525c('0x47')]['id']}})[_0x525c('0x22')](handleEntityNotFound(_0x5236e8,null))['then'](removeEntity(_0x5236e8,null))[_0x525c('0x44')](handleError(_0x5236e8,null));};
\ No newline at end of file
+var _0xdfd2=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','MailServerOut','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','status','error','name','send','index','map','model','query'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0xdfd2,0x1f0));var _0x2dfd=function(_0x3bcb2c,_0x5df50a){_0x3bcb2c=_0x3bcb2c-0x0;var _0xf4fc62=_0xdfd2[_0x3bcb2c];return _0xf4fc62;};'use strict';var emlformat=require(_0x2dfd('0x0'));var rimraf=require(_0x2dfd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2dfd('0x2'));var rp=require(_0x2dfd('0x3'));var moment=require(_0x2dfd('0x4'));var BPromise=require(_0x2dfd('0x5'));var Mustache=require(_0x2dfd('0x6'));var util=require('util');var path=require(_0x2dfd('0x7'));var sox=require(_0x2dfd('0x8'));var csv=require(_0x2dfd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2dfd('0xa'));var _=require(_0x2dfd('0xb'));var squel=require(_0x2dfd('0xc'));var crypto=require(_0x2dfd('0xd'));var jsforce=require(_0x2dfd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2dfd('0x9'));var querystring=require(_0x2dfd('0xf'));var Papa=require(_0x2dfd('0x10'));var Redis=require(_0x2dfd('0x11'));var authService=require(_0x2dfd('0x12'));var qs=require(_0x2dfd('0x13'));var as=require(_0x2dfd('0x14'));var hardwareService=require(_0x2dfd('0x15'));var logger=require(_0x2dfd('0x16'))(_0x2dfd('0x17'));var utils=require(_0x2dfd('0x18'));var config=require(_0x2dfd('0x19'));var licenseUtil=require(_0x2dfd('0x1a'));var db=require(_0x2dfd('0x1b'))['db'];function respondWithStatusCode(_0x557ff7,_0xfa1b6){_0xfa1b6=_0xfa1b6||0xcc;return function(_0xc9fbc8){if(_0xc9fbc8){return _0x557ff7[_0x2dfd('0x1c')](_0xfa1b6);}return _0x557ff7['status'](_0xfa1b6)[_0x2dfd('0x1d')]();};}function respondWithResult(_0x5a7c3a,_0xc2ad35){_0xc2ad35=_0xc2ad35||0xc8;return function(_0x3301db){if(_0x3301db){return _0x5a7c3a['status'](_0xc2ad35)['json'](_0x3301db);}};}function respondWithFilteredResult(_0xfb2ac3,_0x49f43d){return function(_0x234fe6){if(_0x234fe6){var _0x389fb3=typeof _0x49f43d[_0x2dfd('0x1e')]===_0x2dfd('0x1f')&&typeof _0x49f43d[_0x2dfd('0x20')]===_0x2dfd('0x1f');var _0x7727e8=_0x234fe6[_0x2dfd('0x21')];var _0x1622b9=_0x389fb3?0x0:_0x49f43d[_0x2dfd('0x1e')];var _0x16e35a=_0x389fb3?_0x234fe6[_0x2dfd('0x21')]:_0x49f43d['offset']+_0x49f43d['limit'];var _0x322bb1;if(_0x16e35a>=_0x7727e8){_0x16e35a=_0x7727e8;_0x322bb1=0xc8;}else{_0x322bb1=0xce;}_0xfb2ac3['status'](_0x322bb1);return _0xfb2ac3[_0x2dfd('0x22')](_0x2dfd('0x23'),_0x1622b9+'-'+_0x16e35a+'/'+_0x7727e8)[_0x2dfd('0x24')](_0x234fe6);}return null;};}function patchUpdates(_0xa65328){return function(_0x915f7e){try{jsonpatch[_0x2dfd('0x25')](_0x915f7e,_0xa65328,!![]);}catch(_0x56b443){return BPromise[_0x2dfd('0x26')](_0x56b443);}return _0x915f7e['save']();};}function saveUpdates(_0x27802a,_0x4adbc3){return function(_0x1ac4bd){if(_0x1ac4bd){return _0x1ac4bd[_0x2dfd('0x27')](_0x27802a)[_0x2dfd('0x28')](function(_0x1e51d7){return _0x1e51d7;});}return null;};}function removeEntity(_0x4476ed,_0x2f166a){return function(_0x5e181a){if(_0x5e181a){return _0x5e181a[_0x2dfd('0x29')]()[_0x2dfd('0x28')](function(){_0x4476ed[_0x2dfd('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfd38a2,_0x24fb98){return function(_0xc95412){if(!_0xc95412){_0xfd38a2[_0x2dfd('0x1c')](0x194);}return _0xc95412;};}function handleError(_0x33f6fc,_0x5b2dd0){_0x5b2dd0=_0x5b2dd0||0x1f4;return function(_0xdcf581){logger[_0x2dfd('0x2b')](_0xdcf581['stack']);if(_0xdcf581[_0x2dfd('0x2c')]){delete _0xdcf581['name'];}_0x33f6fc[_0x2dfd('0x2a')](_0x5b2dd0)[_0x2dfd('0x2d')](_0xdcf581);};}exports[_0x2dfd('0x2e')]=function(_0x476fec,_0x21c282){var _0x5b9dd6={},_0x4c7267={},_0x4da99d={'count':0x0,'rows':[]};var _0x3b6943=_[_0x2dfd('0x2f')](db['MailServerOut']['rawAttributes'],function(_0xe51ed8){return{'name':_0xe51ed8['fieldName'],'type':_0xe51ed8['type']['key']};});_0x4c7267[_0x2dfd('0x30')]=_[_0x2dfd('0x2f')](_0x3b6943,_0x2dfd('0x2c'));_0x4c7267[_0x2dfd('0x31')]=_[_0x2dfd('0x32')](_0x476fec[_0x2dfd('0x31')]);_0x4c7267[_0x2dfd('0x33')]=_['intersection'](_0x4c7267[_0x2dfd('0x30')],_0x4c7267[_0x2dfd('0x31')]);_0x5b9dd6[_0x2dfd('0x34')]=_[_0x2dfd('0x35')](_0x4c7267[_0x2dfd('0x30')],qs[_0x2dfd('0x36')](_0x476fec[_0x2dfd('0x31')][_0x2dfd('0x36')]));_0x5b9dd6[_0x2dfd('0x34')]=_0x5b9dd6[_0x2dfd('0x34')][_0x2dfd('0x37')]?_0x5b9dd6['attributes']:_0x4c7267[_0x2dfd('0x30')];if(!_0x476fec[_0x2dfd('0x31')][_0x2dfd('0x38')](_0x2dfd('0x39'))){_0x5b9dd6['limit']=qs['limit'](_0x476fec[_0x2dfd('0x31')][_0x2dfd('0x20')]);_0x5b9dd6[_0x2dfd('0x1e')]=qs[_0x2dfd('0x1e')](_0x476fec['query']['offset']);}_0x5b9dd6[_0x2dfd('0x3a')]=qs['sort'](_0x476fec[_0x2dfd('0x31')][_0x2dfd('0x3b')]);_0x5b9dd6[_0x2dfd('0x3c')]=qs[_0x2dfd('0x33')](_['pick'](_0x476fec[_0x2dfd('0x31')],_0x4c7267[_0x2dfd('0x33')]),_0x3b6943);if(_0x476fec[_0x2dfd('0x31')][_0x2dfd('0x3d')]){_0x5b9dd6[_0x2dfd('0x3c')]=_[_0x2dfd('0x3e')](_0x5b9dd6[_0x2dfd('0x3c')],{'$or':_[_0x2dfd('0x2f')](_0x3b6943,function(_0x5d9413){if(_0x5d9413[_0x2dfd('0x3f')]!==_0x2dfd('0x40')){var _0x1d6603={};_0x1d6603[_0x5d9413['name']]={'$like':'%'+_0x476fec[_0x2dfd('0x31')][_0x2dfd('0x3d')]+'%'};return _0x1d6603;}})});}_0x5b9dd6=_[_0x2dfd('0x3e')]({},_0x5b9dd6,_0x476fec[_0x2dfd('0x41')]);var _0x21fc4c={'where':_0x5b9dd6[_0x2dfd('0x3c')]};return db[_0x2dfd('0x42')][_0x2dfd('0x21')](_0x21fc4c)[_0x2dfd('0x28')](function(_0x40de23){_0x4da99d['count']=_0x40de23;if(_0x476fec[_0x2dfd('0x31')][_0x2dfd('0x43')]){_0x5b9dd6[_0x2dfd('0x44')]=[{'all':!![]}];}return db[_0x2dfd('0x42')][_0x2dfd('0x45')](_0x5b9dd6);})[_0x2dfd('0x28')](function(_0x5790f6){_0x4da99d[_0x2dfd('0x46')]=_0x5790f6;return _0x4da99d;})['then'](respondWithFilteredResult(_0x21c282,_0x5b9dd6))[_0x2dfd('0x47')](handleError(_0x21c282,null));};exports[_0x2dfd('0x48')]=function(_0x1f6004,_0x544831){var _0x51bef4={'raw':!![],'where':{'id':_0x1f6004['params']['id']}},_0x29ab3c={};_0x29ab3c[_0x2dfd('0x30')]=_['keys'](db[_0x2dfd('0x42')][_0x2dfd('0x49')]);_0x29ab3c[_0x2dfd('0x31')]=_['keys'](_0x1f6004[_0x2dfd('0x31')]);_0x29ab3c[_0x2dfd('0x33')]=_[_0x2dfd('0x35')](_0x29ab3c['model'],_0x29ab3c['query']);_0x51bef4[_0x2dfd('0x34')]=_[_0x2dfd('0x35')](_0x29ab3c[_0x2dfd('0x30')],qs[_0x2dfd('0x36')](_0x1f6004[_0x2dfd('0x31')]['fields']));_0x51bef4[_0x2dfd('0x34')]=_0x51bef4[_0x2dfd('0x34')][_0x2dfd('0x37')]?_0x51bef4[_0x2dfd('0x34')]:_0x29ab3c[_0x2dfd('0x30')];if(_0x1f6004['query'][_0x2dfd('0x43')]){_0x51bef4[_0x2dfd('0x44')]=[{'all':!![]}];}_0x51bef4=_['merge']({},_0x51bef4,_0x1f6004[_0x2dfd('0x41')]);return db[_0x2dfd('0x42')][_0x2dfd('0x4a')](_0x51bef4)[_0x2dfd('0x28')](handleEntityNotFound(_0x544831,null))[_0x2dfd('0x28')](respondWithResult(_0x544831,null))[_0x2dfd('0x47')](handleError(_0x544831,null));};exports[_0x2dfd('0x4b')]=function(_0x513d1d,_0x53d1e4){return db['MailServerOut']['create'](_0x513d1d[_0x2dfd('0x4c')],{})[_0x2dfd('0x28')](respondWithResult(_0x53d1e4,0xc9))[_0x2dfd('0x47')](handleError(_0x53d1e4,null));};exports[_0x2dfd('0x27')]=function(_0xea870a,_0x4c183a){if(_0xea870a[_0x2dfd('0x4c')]['id']){delete _0xea870a[_0x2dfd('0x4c')]['id'];}return db['MailServerOut'][_0x2dfd('0x4a')]({'where':{'id':_0xea870a['params']['id']}})[_0x2dfd('0x28')](handleEntityNotFound(_0x4c183a,null))['then'](saveUpdates(_0xea870a[_0x2dfd('0x4c')],null))[_0x2dfd('0x28')](respondWithResult(_0x4c183a,null))['catch'](handleError(_0x4c183a,null));};exports['destroy']=function(_0x2e95ee,_0x3a5c89){return db[_0x2dfd('0x42')]['find']({'where':{'id':_0x2e95ee[_0x2dfd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3a5c89,null))[_0x2dfd('0x28')](removeEntity(_0x3a5c89,null))[_0x2dfd('0x47')](handleError(_0x3a5c89,null));};
\ No newline at end of file
index c904771..cfb2a87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x450a=['./mailServerOut.attributes','mail_servers_out','lodash','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x450a,0xba));var _0xa450=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x450a[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xa450('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa450('0x1'));var BPromise=require('bluebird');var rp=require(_0xa450('0x2'));var fs=require('fs');var path=require(_0xa450('0x3'));var rimraf=require(_0xa450('0x4'));var config=require(_0xa450('0x5'));var attributes=require(_0xa450('0x6'));module['exports']=function(_0x4320ac,_0x556b49){return _0x4320ac['define']('MailServerOut',attributes,{'tableName':_0xa450('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5443=['util','../../config/logger','moment','bluebird','request-promise','path','./mailServerOut.attributes','exports','mail_servers_out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5443,0x1ef));var _0x3544=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5443[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x3544('0x0'));var logger=require(_0x3544('0x1'))('api');var moment=require(_0x3544('0x2'));var BPromise=require(_0x3544('0x3'));var rp=require(_0x3544('0x4'));var fs=require('fs');var path=require(_0x3544('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3544('0x6'));module[_0x3544('0x7')]=function(_0x559a32,_0x44f3fc){return _0x559a32['define']('MailServerOut',attributes,{'tableName':_0x3544('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4157e87..4394837 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1b68d9,_0x56f89b){var _0x27ff43=function(_0x264e6f){while(--_0x264e6f){_0x1b68d9['push'](_0x1b68d9['shift']());}};_0x27ff43(++_0x56f89b);}(_0x1261,0x144));var _0x1126=function(_0x1d2b66,_0x256c6e){_0x1d2b66=_0x1d2b66-0x0;var _0x445a66=_0x1261[_0x1d2b66];return _0x445a66;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3ad12c,_0x2527c0){var _0x4dda5c=function(_0x1a1a94){while(--_0x1a1a94){_0x3ad12c['push'](_0x3ad12c['shift']());}};_0x4dda5c(++_0x2527c0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
index 95fc325..384ef74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39e9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','exports'];(function(_0x587c8c,_0x21cf1f){var _0x47b937=function(_0x1a66e9){while(--_0x1a66e9){_0x587c8c['push'](_0x587c8c['shift']());}};_0x47b937(++_0x21cf1f);}(_0x39e9,0xf7));var _0x939e=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x39e9[_0x56f7e2];return _0x36240b;};'use strict';var multer=require('multer');var util=require(_0x939e('0x0'));var path=require(_0x939e('0x1'));var timeout=require(_0x939e('0x2'));var express=require(_0x939e('0x3'));var router=express[_0x939e('0x4')]();var fs_extra=require(_0x939e('0x5'));var auth=require(_0x939e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x939e('0x7'));var controller=require(_0x939e('0x8'));router[_0x939e('0x9')]('/',auth[_0x939e('0xa')](),controller[_0x939e('0xb')]);router[_0x939e('0x9')](_0x939e('0xc'),auth['isAuthenticated'](),controller[_0x939e('0xd')]);router['get'](_0x939e('0xe'),auth[_0x939e('0xa')](),controller['show']);router[_0x939e('0xf')]('/',auth[_0x939e('0xa')](),controller['create']);router[_0x939e('0x10')](_0x939e('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x939e('0x11')](_0x939e('0xe'),auth[_0x939e('0xa')](),controller['destroy']);module[_0x939e('0x12')]=router;
\ No newline at end of file
+var _0xe384=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe384,0xc0));var _0x4e38=function(_0x44b585,_0x5623a9){_0x44b585=_0x44b585-0x0;var _0x133e43=_0xe384[_0x44b585];return _0x133e43;};'use strict';var multer=require(_0x4e38('0x0'));var util=require('util');var path=require(_0x4e38('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4e38('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x4e38('0x3'));var controller=require('./mailSubstatus.controller');router[_0x4e38('0x4')]('/',auth[_0x4e38('0x5')](),controller[_0x4e38('0x6')]);router[_0x4e38('0x4')](_0x4e38('0x7'),auth[_0x4e38('0x5')](),controller[_0x4e38('0x8')]);router[_0x4e38('0x4')](_0x4e38('0x9'),auth['isAuthenticated'](),controller[_0x4e38('0xa')]);router[_0x4e38('0xb')]('/',auth[_0x4e38('0x5')](),controller[_0x4e38('0xc')]);router[_0x4e38('0xd')](_0x4e38('0x9'),auth[_0x4e38('0x5')](),controller[_0x4e38('0xe')]);router[_0x4e38('0xf')]('/:id',auth[_0x4e38('0x5')](),controller[_0x4e38('0x10')]);module[_0x4e38('0x11')]=router;
\ No newline at end of file
index 49d879b..383ec6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236d=['sequelize','exports','name'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd236('0x0'));module[_0xd236('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd236('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb091=['exports','STRING','name'];(function(_0x4fa3b3,_0x3c7487){var _0x3a37f8=function(_0x5334db){while(--_0x5334db){_0x4fa3b3['push'](_0x4fa3b3['shift']());}};_0x3a37f8(++_0x3c7487);}(_0xb091,0x16e));var _0x1b09=function(_0x20bf45,_0x438a4e){_0x20bf45=_0x20bf45-0x0;var _0x16f712=_0xb091[_0x20bf45];return _0x16f712;};'use strict';var Sequelize=require('sequelize');module[_0x1b09('0x0')]={'name':{'type':Sequelize[_0x1b09('0x1')],'unique':_0x1b09('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1b09('0x1')]}};
\ No newline at end of file
index c28a825..4846505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e7e=['bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','MailSubstatus','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','include','findAll','rows','catch','params','rawAttributes','length','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7e7e,0xde));var _0xe7e7=function(_0x39f724,_0x4d2609){_0x39f724=_0x39f724-0x0;var _0x55e498=_0x7e7e[_0x39f724];return _0x55e498;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7e7('0x0'));var zipdir=require(_0xe7e7('0x1'));var jsonpatch=require(_0xe7e7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe7e7('0x3'));var Mustache=require('mustache');var util=require(_0xe7e7('0x4'));var path=require(_0xe7e7('0x5'));var sox=require(_0xe7e7('0x6'));var csv=require('to-csv');var ejs=require(_0xe7e7('0x7'));var fs=require('fs');var fs_extra=require(_0xe7e7('0x8'));var _=require(_0xe7e7('0x9'));var squel=require('squel');var crypto=require(_0xe7e7('0xa'));var jsforce=require(_0xe7e7('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe7e7('0xc'));var Papa=require(_0xe7e7('0xd'));var Redis=require(_0xe7e7('0xe'));var authService=require(_0xe7e7('0xf'));var qs=require(_0xe7e7('0x10'));var as=require(_0xe7e7('0x11'));var hardwareService=require(_0xe7e7('0x12'));var logger=require('../../config/logger')(_0xe7e7('0x13'));var utils=require(_0xe7e7('0x14'));var config=require(_0xe7e7('0x15'));var licenseUtil=require(_0xe7e7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x936392,_0x14e039){_0x14e039=_0x14e039||0xcc;return function(_0x115b26){if(_0x115b26){return _0x936392[_0xe7e7('0x17')](_0x14e039);}return _0x936392['status'](_0x14e039)[_0xe7e7('0x18')]();};}function respondWithResult(_0x29312f,_0x20b730){_0x20b730=_0x20b730||0xc8;return function(_0x4f8d96){if(_0x4f8d96){return _0x29312f[_0xe7e7('0x19')](_0x20b730)[_0xe7e7('0x1a')](_0x4f8d96);}};}function respondWithFilteredResult(_0x51ccb1,_0x5c9eb3){return function(_0x5a413d){if(_0x5a413d){var _0x468318=typeof _0x5c9eb3[_0xe7e7('0x1b')]===_0xe7e7('0x1c')&&typeof _0x5c9eb3[_0xe7e7('0x1d')]===_0xe7e7('0x1c');var _0x249725=_0x5a413d[_0xe7e7('0x1e')];var _0xf73f73=_0x468318?0x0:_0x5c9eb3[_0xe7e7('0x1b')];var _0x25d661=_0x468318?_0x5a413d[_0xe7e7('0x1e')]:_0x5c9eb3['offset']+_0x5c9eb3['limit'];var _0x5c2cc5;if(_0x25d661>=_0x249725){_0x25d661=_0x249725;_0x5c2cc5=0xc8;}else{_0x5c2cc5=0xce;}_0x51ccb1[_0xe7e7('0x19')](_0x5c2cc5);return _0x51ccb1[_0xe7e7('0x1f')](_0xe7e7('0x20'),_0xf73f73+'-'+_0x25d661+'/'+_0x249725)[_0xe7e7('0x1a')](_0x5a413d);}return null;};}function patchUpdates(_0x5d4faf){return function(_0x464ee0){try{jsonpatch[_0xe7e7('0x21')](_0x464ee0,_0x5d4faf,!![]);}catch(_0x2b5aad){return BPromise[_0xe7e7('0x22')](_0x2b5aad);}return _0x464ee0['save']();};}function saveUpdates(_0xdd54ac,_0x2e8e95){return function(_0x28fd68){if(_0x28fd68){return _0x28fd68[_0xe7e7('0x23')](_0xdd54ac)[_0xe7e7('0x24')](function(_0x15ac25){return _0x15ac25;});}return null;};}function removeEntity(_0x47cfa6,_0x1a33a5){return function(_0x234311){if(_0x234311){return _0x234311[_0xe7e7('0x25')]()[_0xe7e7('0x24')](function(){_0x47cfa6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4057d3,_0x17dc63){return function(_0x3ee963){if(!_0x3ee963){_0x4057d3[_0xe7e7('0x17')](0x194);}return _0x3ee963;};}function handleError(_0x34a5bb,_0x3e1469){_0x3e1469=_0x3e1469||0x1f4;return function(_0x3e6863){logger[_0xe7e7('0x26')](_0x3e6863['stack']);if(_0x3e6863[_0xe7e7('0x27')]){delete _0x3e6863['name'];}_0x34a5bb[_0xe7e7('0x19')](_0x3e1469)[_0xe7e7('0x28')](_0x3e6863);};}exports[_0xe7e7('0x29')]=function(_0x33046c,_0x2a7c61){var _0x31d60b={},_0x52b84c={},_0x4cce29={'count':0x0,'rows':[]};var _0x51d4ee=_[_0xe7e7('0x2a')](db[_0xe7e7('0x2b')]['rawAttributes'],function(_0x2b9cec){return{'name':_0x2b9cec[_0xe7e7('0x2c')],'type':_0x2b9cec[_0xe7e7('0x2d')][_0xe7e7('0x2e')]};});_0x52b84c[_0xe7e7('0x2f')]=_[_0xe7e7('0x2a')](_0x51d4ee,_0xe7e7('0x27'));_0x52b84c[_0xe7e7('0x30')]=_[_0xe7e7('0x31')](_0x33046c['query']);_0x52b84c[_0xe7e7('0x32')]=_['intersection'](_0x52b84c[_0xe7e7('0x2f')],_0x52b84c[_0xe7e7('0x30')]);_0x31d60b[_0xe7e7('0x33')]=_[_0xe7e7('0x34')](_0x52b84c[_0xe7e7('0x2f')],qs[_0xe7e7('0x35')](_0x33046c[_0xe7e7('0x30')]['fields']));_0x31d60b['attributes']=_0x31d60b[_0xe7e7('0x33')]['length']?_0x31d60b[_0xe7e7('0x33')]:_0x52b84c[_0xe7e7('0x2f')];if(!_0x33046c[_0xe7e7('0x30')][_0xe7e7('0x36')](_0xe7e7('0x37'))){_0x31d60b[_0xe7e7('0x1d')]=qs['limit'](_0x33046c[_0xe7e7('0x30')][_0xe7e7('0x1d')]);_0x31d60b[_0xe7e7('0x1b')]=qs[_0xe7e7('0x1b')](_0x33046c[_0xe7e7('0x30')][_0xe7e7('0x1b')]);}_0x31d60b[_0xe7e7('0x38')]=qs[_0xe7e7('0x39')](_0x33046c[_0xe7e7('0x30')][_0xe7e7('0x39')]);_0x31d60b['where']=qs[_0xe7e7('0x32')](_[_0xe7e7('0x3a')](_0x33046c[_0xe7e7('0x30')],_0x52b84c[_0xe7e7('0x32')]),_0x51d4ee);if(_0x33046c[_0xe7e7('0x30')][_0xe7e7('0x3b')]){_0x31d60b['where']=_[_0xe7e7('0x3c')](_0x31d60b[_0xe7e7('0x3d')],{'$or':_[_0xe7e7('0x2a')](_0x51d4ee,function(_0x55e62c){if(_0x55e62c[_0xe7e7('0x2d')]!=='VIRTUAL'){var _0x36f5bc={};_0x36f5bc[_0x55e62c[_0xe7e7('0x27')]]={'$like':'%'+_0x33046c[_0xe7e7('0x30')]['filter']+'%'};return _0x36f5bc;}})});}_0x31d60b=_[_0xe7e7('0x3c')]({},_0x31d60b,_0x33046c[_0xe7e7('0x3e')]);var _0x4521b={'where':_0x31d60b[_0xe7e7('0x3d')]};return db['MailSubstatus'][_0xe7e7('0x1e')](_0x4521b)[_0xe7e7('0x24')](function(_0x936cfa){_0x4cce29[_0xe7e7('0x1e')]=_0x936cfa;if(_0x33046c[_0xe7e7('0x30')]['includeAll']){_0x31d60b[_0xe7e7('0x3f')]=[{'all':!![]}];}return db[_0xe7e7('0x2b')][_0xe7e7('0x40')](_0x31d60b);})[_0xe7e7('0x24')](function(_0x4ff6b7){_0x4cce29[_0xe7e7('0x41')]=_0x4ff6b7;return _0x4cce29;})[_0xe7e7('0x24')](respondWithFilteredResult(_0x2a7c61,_0x31d60b))[_0xe7e7('0x42')](handleError(_0x2a7c61,null));};exports['show']=function(_0xe05ba9,_0x3d42d9){var _0xfbd580={'raw':!![],'where':{'id':_0xe05ba9[_0xe7e7('0x43')]['id']}},_0x1728a2={};_0x1728a2[_0xe7e7('0x2f')]=_[_0xe7e7('0x31')](db['MailSubstatus'][_0xe7e7('0x44')]);_0x1728a2['query']=_['keys'](_0xe05ba9[_0xe7e7('0x30')]);_0x1728a2['filters']=_[_0xe7e7('0x34')](_0x1728a2[_0xe7e7('0x2f')],_0x1728a2[_0xe7e7('0x30')]);_0xfbd580[_0xe7e7('0x33')]=_[_0xe7e7('0x34')](_0x1728a2[_0xe7e7('0x2f')],qs[_0xe7e7('0x35')](_0xe05ba9['query'][_0xe7e7('0x35')]));_0xfbd580[_0xe7e7('0x33')]=_0xfbd580['attributes'][_0xe7e7('0x45')]?_0xfbd580[_0xe7e7('0x33')]:_0x1728a2[_0xe7e7('0x2f')];if(_0xe05ba9[_0xe7e7('0x30')][_0xe7e7('0x46')]){_0xfbd580[_0xe7e7('0x3f')]=[{'all':!![]}];}_0xfbd580=_[_0xe7e7('0x3c')]({},_0xfbd580,_0xe05ba9[_0xe7e7('0x3e')]);return db[_0xe7e7('0x2b')][_0xe7e7('0x47')](_0xfbd580)[_0xe7e7('0x24')](handleEntityNotFound(_0x3d42d9,null))[_0xe7e7('0x24')](respondWithResult(_0x3d42d9,null))[_0xe7e7('0x42')](handleError(_0x3d42d9,null));};exports[_0xe7e7('0x48')]=function(_0x144383,_0x3a9d3d){return db[_0xe7e7('0x2b')][_0xe7e7('0x48')](_0x144383['body'],{})['then'](respondWithResult(_0x3a9d3d,0xc9))[_0xe7e7('0x42')](handleError(_0x3a9d3d,null));};exports[_0xe7e7('0x23')]=function(_0x3ccff0,_0x57dacd){if(_0x3ccff0[_0xe7e7('0x49')]['id']){delete _0x3ccff0['body']['id'];}return db[_0xe7e7('0x2b')][_0xe7e7('0x47')]({'where':{'id':_0x3ccff0[_0xe7e7('0x43')]['id']}})[_0xe7e7('0x24')](handleEntityNotFound(_0x57dacd,null))[_0xe7e7('0x24')](saveUpdates(_0x3ccff0[_0xe7e7('0x49')],null))[_0xe7e7('0x24')](respondWithResult(_0x57dacd,null))[_0xe7e7('0x42')](handleError(_0x57dacd,null));};exports[_0xe7e7('0x25')]=function(_0x5afc4e,_0x2fbe24){return db[_0xe7e7('0x2b')][_0xe7e7('0x47')]({'where':{'id':_0x5afc4e[_0xe7e7('0x43')]['id']}})[_0xe7e7('0x24')](handleEntityNotFound(_0x2fbe24,null))[_0xe7e7('0x24')](removeEntity(_0x2fbe24,null))[_0xe7e7('0x42')](handleError(_0x2fbe24,null));};exports[_0xe7e7('0x4a')]=function(_0x5da6ab,_0x407f04){return db[_0xe7e7('0x2b')][_0xe7e7('0x4a')]()[_0xe7e7('0x24')](respondWithResult(_0x407f04,null))[_0xe7e7('0x42')](handleError(_0x407f04,null));};
\ No newline at end of file
+var _0x50a5=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','MailSubstatus','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x25bf55,_0x49338a){var _0x587f77=function(_0x19a423){while(--_0x19a423){_0x25bf55['push'](_0x25bf55['shift']());}};_0x587f77(++_0x49338a);}(_0x50a5,0x112));var _0x550a=function(_0x3202d8,_0x51ea66){_0x3202d8=_0x3202d8-0x0;var _0x4615f4=_0x50a5[_0x3202d8];return _0x4615f4;};'use strict';var emlformat=require(_0x550a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x550a('0x1'));var rp=require(_0x550a('0x2'));var moment=require('moment');var BPromise=require(_0x550a('0x3'));var Mustache=require(_0x550a('0x4'));var util=require(_0x550a('0x5'));var path=require('path');var sox=require(_0x550a('0x6'));var csv=require(_0x550a('0x7'));var ejs=require(_0x550a('0x8'));var fs=require('fs');var fs_extra=require(_0x550a('0x9'));var _=require(_0x550a('0xa'));var squel=require('squel');var crypto=require(_0x550a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x550a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x550a('0xd'));var as=require(_0x550a('0xe'));var hardwareService=require(_0x550a('0xf'));var logger=require(_0x550a('0x10'))('api');var utils=require(_0x550a('0x11'));var config=require(_0x550a('0x12'));var licenseUtil=require(_0x550a('0x13'));var db=require(_0x550a('0x14'))['db'];function respondWithStatusCode(_0x4f87a1,_0x5734e3){_0x5734e3=_0x5734e3||0xcc;return function(_0x14230d){if(_0x14230d){return _0x4f87a1['sendStatus'](_0x5734e3);}return _0x4f87a1[_0x550a('0x15')](_0x5734e3)[_0x550a('0x16')]();};}function respondWithResult(_0x28a355,_0x5d45e5){_0x5d45e5=_0x5d45e5||0xc8;return function(_0x175ea5){if(_0x175ea5){return _0x28a355[_0x550a('0x15')](_0x5d45e5)[_0x550a('0x17')](_0x175ea5);}};}function respondWithFilteredResult(_0x2cefed,_0x1ff9da){return function(_0x2e3ce8){if(_0x2e3ce8){var _0xca37d8=typeof _0x1ff9da[_0x550a('0x18')]===_0x550a('0x19')&&typeof _0x1ff9da[_0x550a('0x1a')]==='undefined';var _0x2add38=_0x2e3ce8['count'];var _0x1816df=_0xca37d8?0x0:_0x1ff9da['offset'];var _0x49634c=_0xca37d8?_0x2e3ce8[_0x550a('0x1b')]:_0x1ff9da[_0x550a('0x18')]+_0x1ff9da[_0x550a('0x1a')];var _0x1d4755;if(_0x49634c>=_0x2add38){_0x49634c=_0x2add38;_0x1d4755=0xc8;}else{_0x1d4755=0xce;}_0x2cefed[_0x550a('0x15')](_0x1d4755);return _0x2cefed[_0x550a('0x1c')](_0x550a('0x1d'),_0x1816df+'-'+_0x49634c+'/'+_0x2add38)[_0x550a('0x17')](_0x2e3ce8);}return null;};}function patchUpdates(_0x3a7887){return function(_0xf9f8f2){try{jsonpatch[_0x550a('0x1e')](_0xf9f8f2,_0x3a7887,!![]);}catch(_0x59c77c){return BPromise[_0x550a('0x1f')](_0x59c77c);}return _0xf9f8f2[_0x550a('0x20')]();};}function saveUpdates(_0x32aad0,_0x26c574){return function(_0x42ab82){if(_0x42ab82){return _0x42ab82['update'](_0x32aad0)[_0x550a('0x21')](function(_0x588e96){return _0x588e96;});}return null;};}function removeEntity(_0x12dc10,_0x379673){return function(_0x4d35bc){if(_0x4d35bc){return _0x4d35bc[_0x550a('0x22')]()[_0x550a('0x21')](function(){_0x12dc10['status'](0xcc)[_0x550a('0x16')]();});}};}function handleEntityNotFound(_0x204c1,_0x4b147a){return function(_0x1aaaba){if(!_0x1aaaba){_0x204c1[_0x550a('0x23')](0x194);}return _0x1aaaba;};}function handleError(_0x2416f2,_0x3f33d6){_0x3f33d6=_0x3f33d6||0x1f4;return function(_0x2a18aa){logger[_0x550a('0x24')](_0x2a18aa['stack']);if(_0x2a18aa[_0x550a('0x25')]){delete _0x2a18aa['name'];}_0x2416f2[_0x550a('0x15')](_0x3f33d6)[_0x550a('0x26')](_0x2a18aa);};}exports[_0x550a('0x27')]=function(_0x53fe7e,_0x4b05f1){var _0x31e9fe={},_0x36c95d={},_0x17a30a={'count':0x0,'rows':[]};var _0x151da1=_[_0x550a('0x28')](db['MailSubstatus'][_0x550a('0x29')],function(_0x2e34f3){return{'name':_0x2e34f3[_0x550a('0x2a')],'type':_0x2e34f3['type']['key']};});_0x36c95d['model']=_[_0x550a('0x28')](_0x151da1,_0x550a('0x25'));_0x36c95d['query']=_['keys'](_0x53fe7e[_0x550a('0x2b')]);_0x36c95d[_0x550a('0x2c')]=_[_0x550a('0x2d')](_0x36c95d[_0x550a('0x2e')],_0x36c95d[_0x550a('0x2b')]);_0x31e9fe[_0x550a('0x2f')]=_[_0x550a('0x2d')](_0x36c95d[_0x550a('0x2e')],qs[_0x550a('0x30')](_0x53fe7e[_0x550a('0x2b')]['fields']));_0x31e9fe[_0x550a('0x2f')]=_0x31e9fe['attributes'][_0x550a('0x31')]?_0x31e9fe[_0x550a('0x2f')]:_0x36c95d[_0x550a('0x2e')];if(!_0x53fe7e['query'][_0x550a('0x32')](_0x550a('0x33'))){_0x31e9fe[_0x550a('0x1a')]=qs[_0x550a('0x1a')](_0x53fe7e[_0x550a('0x2b')][_0x550a('0x1a')]);_0x31e9fe[_0x550a('0x18')]=qs[_0x550a('0x18')](_0x53fe7e[_0x550a('0x2b')]['offset']);}_0x31e9fe[_0x550a('0x34')]=qs[_0x550a('0x35')](_0x53fe7e[_0x550a('0x2b')][_0x550a('0x35')]);_0x31e9fe['where']=qs[_0x550a('0x2c')](_[_0x550a('0x36')](_0x53fe7e[_0x550a('0x2b')],_0x36c95d['filters']),_0x151da1);if(_0x53fe7e[_0x550a('0x2b')][_0x550a('0x37')]){_0x31e9fe[_0x550a('0x38')]=_[_0x550a('0x39')](_0x31e9fe[_0x550a('0x38')],{'$or':_[_0x550a('0x28')](_0x151da1,function(_0x5efdea){if(_0x5efdea[_0x550a('0x3a')]!==_0x550a('0x3b')){var _0x1a9385={};_0x1a9385[_0x5efdea[_0x550a('0x25')]]={'$like':'%'+_0x53fe7e[_0x550a('0x2b')][_0x550a('0x37')]+'%'};return _0x1a9385;}})});}_0x31e9fe=_[_0x550a('0x39')]({},_0x31e9fe,_0x53fe7e[_0x550a('0x3c')]);var _0x288f34={'where':_0x31e9fe['where']};return db[_0x550a('0x3d')][_0x550a('0x1b')](_0x288f34)[_0x550a('0x21')](function(_0x3847dc){_0x17a30a[_0x550a('0x1b')]=_0x3847dc;if(_0x53fe7e[_0x550a('0x2b')][_0x550a('0x3e')]){_0x31e9fe[_0x550a('0x3f')]=[{'all':!![]}];}return db['MailSubstatus'][_0x550a('0x40')](_0x31e9fe);})[_0x550a('0x21')](function(_0x45d873){_0x17a30a[_0x550a('0x41')]=_0x45d873;return _0x17a30a;})[_0x550a('0x21')](respondWithFilteredResult(_0x4b05f1,_0x31e9fe))[_0x550a('0x42')](handleError(_0x4b05f1,null));};exports['show']=function(_0x48d13c,_0x1fb710){var _0x26580e={'raw':!![],'where':{'id':_0x48d13c[_0x550a('0x43')]['id']}},_0x554fe5={};_0x554fe5[_0x550a('0x2e')]=_[_0x550a('0x44')](db['MailSubstatus'][_0x550a('0x29')]);_0x554fe5['query']=_[_0x550a('0x44')](_0x48d13c[_0x550a('0x2b')]);_0x554fe5[_0x550a('0x2c')]=_[_0x550a('0x2d')](_0x554fe5[_0x550a('0x2e')],_0x554fe5[_0x550a('0x2b')]);_0x26580e[_0x550a('0x2f')]=_['intersection'](_0x554fe5[_0x550a('0x2e')],qs[_0x550a('0x30')](_0x48d13c[_0x550a('0x2b')][_0x550a('0x30')]));_0x26580e[_0x550a('0x2f')]=_0x26580e[_0x550a('0x2f')][_0x550a('0x31')]?_0x26580e[_0x550a('0x2f')]:_0x554fe5[_0x550a('0x2e')];if(_0x48d13c[_0x550a('0x2b')][_0x550a('0x3e')]){_0x26580e['include']=[{'all':!![]}];}_0x26580e=_[_0x550a('0x39')]({},_0x26580e,_0x48d13c[_0x550a('0x3c')]);return db[_0x550a('0x3d')][_0x550a('0x45')](_0x26580e)[_0x550a('0x21')](handleEntityNotFound(_0x1fb710,null))[_0x550a('0x21')](respondWithResult(_0x1fb710,null))[_0x550a('0x42')](handleError(_0x1fb710,null));};exports[_0x550a('0x46')]=function(_0x534cf6,_0x5a008f){return db[_0x550a('0x3d')][_0x550a('0x46')](_0x534cf6[_0x550a('0x47')],{})['then'](respondWithResult(_0x5a008f,0xc9))[_0x550a('0x42')](handleError(_0x5a008f,null));};exports[_0x550a('0x48')]=function(_0x29c4bc,_0x4cea16){if(_0x29c4bc[_0x550a('0x47')]['id']){delete _0x29c4bc[_0x550a('0x47')]['id'];}return db[_0x550a('0x3d')][_0x550a('0x45')]({'where':{'id':_0x29c4bc[_0x550a('0x43')]['id']}})[_0x550a('0x21')](handleEntityNotFound(_0x4cea16,null))[_0x550a('0x21')](saveUpdates(_0x29c4bc[_0x550a('0x47')],null))[_0x550a('0x21')](respondWithResult(_0x4cea16,null))['catch'](handleError(_0x4cea16,null));};exports[_0x550a('0x22')]=function(_0xb7cef6,_0x1bcc5c){return db[_0x550a('0x3d')][_0x550a('0x45')]({'where':{'id':_0xb7cef6[_0x550a('0x43')]['id']}})[_0x550a('0x21')](handleEntityNotFound(_0x1bcc5c,null))[_0x550a('0x21')](removeEntity(_0x1bcc5c,null))[_0x550a('0x42')](handleError(_0x1bcc5c,null));};exports['describe']=function(_0x2d46ac,_0x36781d){return db[_0x550a('0x3d')]['describe']()[_0x550a('0x21')](respondWithResult(_0x36781d,null))['catch'](handleError(_0x36781d,null));};
\ No newline at end of file
index 4c72411..606a212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd359=['setMaxListeners','update','emit','hasOwnProperty','events','../../mysqldb','MailSubstatus'];(function(_0x4687d1,_0x4e73bb){var _0x4b1fa1=function(_0x2eec0c){while(--_0x2eec0c){_0x4687d1['push'](_0x4687d1['shift']());}};_0x4b1fa1(++_0x4e73bb);}(_0xd359,0x1c4));var _0x9d35=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd359[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x9d35('0x0'));var MailSubstatus=require(_0x9d35('0x1'))['db'][_0x9d35('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x9d35('0x3')](0x0);var events={'afterUpdate':_0x9d35('0x4')};function emitEvent(_0x7133df){return function(_0x3a0323,_0x1abf7b,_0x227591){MailSubstatusEvents['emit'](_0x7133df+':'+_0x3a0323['id'],_0x3a0323);MailSubstatusEvents[_0x9d35('0x5')](_0x7133df,_0x3a0323);_0x227591(null);};}for(var e in events){if(events[_0x9d35('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents;
\ No newline at end of file
+var _0xd39c=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x24164a,_0x2d9166){var _0x514e1e=function(_0xa18e83){while(--_0xa18e83){_0x24164a['push'](_0x24164a['shift']());}};_0x514e1e(++_0x2d9166);}(_0xd39c,0xcb));var _0xcd39=function(_0x2dee58,_0x4ece2f){_0x2dee58=_0x2dee58-0x0;var _0x100f46=_0xd39c[_0x2dee58];return _0x100f46;};'use strict';var EventEmitter=require(_0xcd39('0x0'));var MailSubstatus=require(_0xcd39('0x1'))['db'][_0xcd39('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xcd39('0x3')](0x0);var events={'afterUpdate':_0xcd39('0x4')};function emitEvent(_0x4399c7){return function(_0x327014,_0xeac66d,_0x1cb26f){MailSubstatusEvents[_0xcd39('0x5')](_0x4399c7+':'+_0x327014['id'],_0x327014);MailSubstatusEvents[_0xcd39('0x5')](_0x4399c7,_0x327014);_0x1cb26f(null);};}for(var e in events){if(events[_0xcd39('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents;
\ No newline at end of file
index 18c6306..2bf30ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ed7=['./mailSubstatus.attributes','models','define','MailSubstatus','mail_substatuses','mailSubstatus','catch'];(function(_0x6a6bf8,_0x458248){var _0x247657=function(_0x51b6cc){while(--_0x51b6cc){_0x6a6bf8['push'](_0x6a6bf8['shift']());}};_0x247657(++_0x458248);}(_0x3ed7,0xaf));var _0x73ed=function(_0xbbf49b,_0x1d339d){_0xbbf49b=_0xbbf49b-0x0;var _0x400117=_0x3ed7[_0xbbf49b];return _0x400117;};'use strict';var attributes=require(_0x73ed('0x0'));module['exports']=function(_0x228333){var _0x1f13bb=_0x228333[_0x73ed('0x1')];return _0x228333[_0x73ed('0x2')](_0x73ed('0x3'),attributes,{'tableName':_0x73ed('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3ca925,_0x5847cf,_0x23ab07){return _0x1f13bb['Condition']['update']({'value':_0x3ca925['name']},{'where':{'field':_0x73ed('0x5'),'value':_0x3ca925['_previousDataValues']['name']}})['then'](function(){_0x23ab07();})[_0x73ed('0x6')](function(_0xe5bded){_0x23ab07(_0xe5bded);});}}});};
\ No newline at end of file
+var _0x42a6=['name','then','catch','./mailSubstatus.attributes','models','define','mail_substatuses','update','_previousDataValues'];(function(_0x2539e1,_0x4051d9){var _0x488479=function(_0x4cc301){while(--_0x4cc301){_0x2539e1['push'](_0x2539e1['shift']());}};_0x488479(++_0x4051d9);}(_0x42a6,0xb7));var _0x642a=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x42a6[_0x3ae2b2];return _0x1dbf00;};'use strict';var attributes=require(_0x642a('0x0'));module['exports']=function(_0x88c8d9){var _0x15604d=_0x88c8d9[_0x642a('0x1')];return _0x88c8d9[_0x642a('0x2')]('MailSubstatus',attributes,{'tableName':_0x642a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4e09a7,_0x44b568,_0x4b96e6){return _0x15604d['Condition'][_0x642a('0x4')]({'value':_0x4e09a7['name']},{'where':{'field':'mailSubstatus','value':_0x4e09a7[_0x642a('0x5')][_0x642a('0x6')]}})[_0x642a('0x7')](function(){_0x4b96e6();})[_0x642a('0x8')](function(_0x912188){_0x4b96e6(_0x912188);});}}});};
\ No newline at end of file
index d77d410..d6ea93d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7de=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c3736,_0x34662d){var _0x2a3fd6=function(_0x20c5f2){while(--_0x20c5f2){_0x1c3736['push'](_0x1c3736['shift']());}};_0x2a3fd6(++_0x34662d);}(_0xe7de,0x165));var _0xee7d=function(_0x2a9e15,_0x31eb11){_0x2a9e15=_0x2a9e15-0x0;var _0xdce62f=_0xe7de[_0x2a9e15];return _0xdce62f;};'use strict';var _=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var moment=require(_0xee7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee7d('0x3'));var db=require(_0xee7d('0x4'))['db'];var utils=require(_0xee7d('0x5'));var logger=require(_0xee7d('0x6'))(_0xee7d('0x7'));var config=require(_0xee7d('0x8'));var jayson=require(_0xee7d('0x9'));var client=jayson[_0xee7d('0xa')][_0xee7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28d5b6,_0xe926ab,_0x2e172d){return new BPromise(function(_0x1c0584,_0x941d94){return client['request'](_0x28d5b6,_0x2e172d)[_0xee7d('0xc')](function(_0x32c4fa){logger[_0xee7d('0xd')](_0xee7d('0xe'),_0xe926ab,_0xee7d('0xf'));logger[_0xee7d('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0xe926ab,_0xee7d('0xf'),JSON['stringify'](_0x32c4fa));if(_0x32c4fa[_0xee7d('0x11')]){if(_0x32c4fa[_0xee7d('0x11')][_0xee7d('0x12')]===0x1f4){logger[_0xee7d('0x11')](_0xee7d('0xe'),_0xe926ab,_0x32c4fa[_0xee7d('0x11')][_0xee7d('0x13')]);return _0x941d94(_0x32c4fa[_0xee7d('0x11')][_0xee7d('0x13')]);}logger[_0xee7d('0x11')](_0xee7d('0xe'),_0xe926ab,_0x32c4fa['error']['message']);return _0x1c0584(_0x32c4fa[_0xee7d('0x11')][_0xee7d('0x13')]);}else{logger[_0xee7d('0xd')](_0xee7d('0xe'),_0xe926ab,_0xee7d('0xf'));_0x1c0584(_0x32c4fa[_0xee7d('0x14')]['message']);}})[_0xee7d('0x15')](function(_0x2bcd81){logger[_0xee7d('0x11')](_0xee7d('0xe'),_0xe926ab,_0x2bcd81);_0x941d94(_0x2bcd81);});});}
\ No newline at end of file
+var _0x7a40=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','result','catch','lodash','util','ioredis'];(function(_0x17bfca,_0x2df213){var _0x4ae104=function(_0x2419b3){while(--_0x2419b3){_0x17bfca['push'](_0x17bfca['shift']());}};_0x4ae104(++_0x2df213);}(_0x7a40,0x19b));var _0x07a4=function(_0x91582a,_0x4c98c3){_0x91582a=_0x91582a-0x0;var _0x1f7c23=_0x7a40[_0x91582a];return _0x1f7c23;};'use strict';var _=require(_0x07a4('0x0'));var util=require(_0x07a4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07a4('0x2'));var db=require(_0x07a4('0x3'))['db'];var utils=require(_0x07a4('0x4'));var logger=require('../../config/logger')(_0x07a4('0x5'));var config=require(_0x07a4('0x6'));var jayson=require(_0x07a4('0x7'));var client=jayson[_0x07a4('0x8')][_0x07a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e1044,_0x190ecd,_0x3d1bba){return new BPromise(function(_0x6e0eab,_0x52c78f){return client[_0x07a4('0xa')](_0x2e1044,_0x3d1bba)[_0x07a4('0xb')](function(_0x33ac61){logger[_0x07a4('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x190ecd,_0x07a4('0xd'));logger[_0x07a4('0xe')](_0x07a4('0xf'),_0x190ecd,_0x07a4('0xd'),JSON[_0x07a4('0x10')](_0x33ac61));if(_0x33ac61[_0x07a4('0x11')]){if(_0x33ac61['error'][_0x07a4('0x12')]===0x1f4){logger[_0x07a4('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x190ecd,_0x33ac61['error'][_0x07a4('0x13')]);return _0x52c78f(_0x33ac61['error'][_0x07a4('0x13')]);}logger[_0x07a4('0x11')](_0x07a4('0x14'),_0x190ecd,_0x33ac61['error']['message']);return _0x6e0eab(_0x33ac61[_0x07a4('0x11')][_0x07a4('0x13')]);}else{logger[_0x07a4('0xc')](_0x07a4('0x14'),_0x190ecd,_0x07a4('0xd'));_0x6e0eab(_0x33ac61[_0x07a4('0x15')][_0x07a4('0x13')]);}})[_0x07a4('0x16')](function(_0x51344a){logger[_0x07a4('0x11')](_0x07a4('0x14'),_0x190ecd,_0x51344a);_0x52c78f(_0x51344a);});});}
\ No newline at end of file
index 8790061..d66e29e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77b0=['/describe','describe','show','post','create','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get'];(function(_0x1a9bca,_0x28b4e4){var _0x8e9e86=function(_0x3526d5){while(--_0x3526d5){_0x1a9bca['push'](_0x1a9bca['shift']());}};_0x8e9e86(++_0x28b4e4);}(_0x77b0,0x13d));var _0x077b=function(_0xffac07,_0x2b0282){_0xffac07=_0xffac07-0x0;var _0x14b56a=_0x77b0[_0xffac07];return _0x14b56a;};'use strict';var multer=require(_0x077b('0x0'));var util=require('util');var path=require(_0x077b('0x1'));var timeout=require(_0x077b('0x2'));var express=require(_0x077b('0x3'));var router=express[_0x077b('0x4')]();var fs_extra=require(_0x077b('0x5'));var auth=require(_0x077b('0x6'));var interaction=require(_0x077b('0x7'));var config=require(_0x077b('0x8'));var controller=require(_0x077b('0x9'));router['get']('/',auth[_0x077b('0xa')](),controller[_0x077b('0xb')]);router[_0x077b('0xc')](_0x077b('0xd'),auth['isAuthenticated'](),controller[_0x077b('0xe')]);router[_0x077b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x077b('0xf')]);router[_0x077b('0x10')]('/',auth[_0x077b('0xa')](),controller[_0x077b('0x11')]);router['put'](_0x077b('0x12'),auth[_0x077b('0xa')](),controller[_0x077b('0x13')]);router[_0x077b('0x14')](_0x077b('0x12'),auth[_0x077b('0xa')](),controller['destroy']);module[_0x077b('0x15')]=router;
\ No newline at end of file
+var _0xab9d=['put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create'];(function(_0x21e889,_0x3ec8c3){var _0xec22ba=function(_0x5780a6){while(--_0x5780a6){_0x21e889['push'](_0x21e889['shift']());}};_0xec22ba(++_0x3ec8c3);}(_0xab9d,0x193));var _0xdab9=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xab9d[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xdab9('0x0'));var util=require(_0xdab9('0x1'));var path=require(_0xdab9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdab9('0x3')]();var fs_extra=require(_0xdab9('0x4'));var auth=require(_0xdab9('0x5'));var interaction=require(_0xdab9('0x6'));var config=require('../../config/environment');var controller=require(_0xdab9('0x7'));router[_0xdab9('0x8')]('/',auth[_0xdab9('0x9')](),controller[_0xdab9('0xa')]);router[_0xdab9('0x8')](_0xdab9('0xb'),auth['isAuthenticated'](),controller[_0xdab9('0xc')]);router[_0xdab9('0x8')](_0xdab9('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xdab9('0x9')](),controller[_0xdab9('0xe')]);router[_0xdab9('0xf')](_0xdab9('0xd'),auth[_0xdab9('0x9')](),controller[_0xdab9('0x10')]);router[_0xdab9('0x11')](_0xdab9('0xd'),auth[_0xdab9('0x9')](),controller['destroy']);module[_0xdab9('0x12')]=router;
\ No newline at end of file
index 2b71b2c..8c3d7fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0xeef94c,_0x1db3f7){var _0x447522=function(_0x16d3d5){while(--_0x16d3d5){_0xeef94c['push'](_0xeef94c['shift']());}};_0x447522(++_0x1db3f7);}(_0x34e8,0x12c));var _0x834e=function(_0x5cb76c,_0x49eeda){_0x5cb76c=_0x5cb76c-0x0;var _0x3679d0=_0x34e8[_0x5cb76c];return _0x3679d0;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x53971a,_0xc7db60){var _0x447c20=function(_0x2a69eb){while(--_0x2a69eb){_0x53971a['push'](_0x53971a['shift']());}};_0x447c20(++_0xc7db60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
index aaef49f..203590d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f39=['find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','pick','filters','filter','VIRTUAL','merge','options','where','MailTransferReport','includeAll','include','findAll','rows','catch','show','params','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f39,0x14a));var _0x99f3=function(_0x16bb36,_0x28b697){_0x16bb36=_0x16bb36-0x0;var _0x25e873=_0x9f39[_0x16bb36];return _0x25e873;};'use strict';var emlformat=require(_0x99f3('0x0'));var rimraf=require(_0x99f3('0x1'));var zipdir=require(_0x99f3('0x2'));var jsonpatch=require(_0x99f3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x99f3('0x4'));var Mustache=require(_0x99f3('0x5'));var util=require('util');var path=require(_0x99f3('0x6'));var sox=require(_0x99f3('0x7'));var csv=require(_0x99f3('0x8'));var ejs=require(_0x99f3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x99f3('0xa'));var squel=require(_0x99f3('0xb'));var crypto=require(_0x99f3('0xc'));var jsforce=require(_0x99f3('0xd'));var deskjs=require(_0x99f3('0xe'));var toCsv=require(_0x99f3('0x8'));var querystring=require(_0x99f3('0xf'));var Papa=require(_0x99f3('0x10'));var Redis=require(_0x99f3('0x11'));var authService=require(_0x99f3('0x12'));var qs=require(_0x99f3('0x13'));var as=require(_0x99f3('0x14'));var hardwareService=require(_0x99f3('0x15'));var logger=require(_0x99f3('0x16'))(_0x99f3('0x17'));var utils=require(_0x99f3('0x18'));var config=require(_0x99f3('0x19'));var licenseUtil=require(_0x99f3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50243e,_0x1a50ca){_0x1a50ca=_0x1a50ca||0xcc;return function(_0x3c02bf){if(_0x3c02bf){return _0x50243e[_0x99f3('0x1b')](_0x1a50ca);}return _0x50243e[_0x99f3('0x1c')](_0x1a50ca)[_0x99f3('0x1d')]();};}function respondWithResult(_0x3b4ea6,_0x15e666){_0x15e666=_0x15e666||0xc8;return function(_0x4bbc28){if(_0x4bbc28){return _0x3b4ea6[_0x99f3('0x1c')](_0x15e666)[_0x99f3('0x1e')](_0x4bbc28);}};}function respondWithFilteredResult(_0x43c4e9,_0x32e6f0){return function(_0x201b17){if(_0x201b17){var _0x2c44de=typeof _0x32e6f0[_0x99f3('0x1f')]===_0x99f3('0x20')&&typeof _0x32e6f0['limit']==='undefined';var _0x3814a1=_0x201b17[_0x99f3('0x21')];var _0x4a1dea=_0x2c44de?0x0:_0x32e6f0[_0x99f3('0x1f')];var _0x56ead1=_0x2c44de?_0x201b17['count']:_0x32e6f0[_0x99f3('0x1f')]+_0x32e6f0[_0x99f3('0x22')];var _0x29072c;if(_0x56ead1>=_0x3814a1){_0x56ead1=_0x3814a1;_0x29072c=0xc8;}else{_0x29072c=0xce;}_0x43c4e9['status'](_0x29072c);return _0x43c4e9[_0x99f3('0x23')](_0x99f3('0x24'),_0x4a1dea+'-'+_0x56ead1+'/'+_0x3814a1)[_0x99f3('0x1e')](_0x201b17);}return null;};}function patchUpdates(_0x1fabeb){return function(_0x585c6c){try{jsonpatch['apply'](_0x585c6c,_0x1fabeb,!![]);}catch(_0x3dab1d){return BPromise[_0x99f3('0x25')](_0x3dab1d);}return _0x585c6c[_0x99f3('0x26')]();};}function saveUpdates(_0x468858,_0x2d59ba){return function(_0x4d0a5d){if(_0x4d0a5d){return _0x4d0a5d['update'](_0x468858)[_0x99f3('0x27')](function(_0x18ed63){return _0x18ed63;});}return null;};}function removeEntity(_0x1cf317,_0x1c61c3){return function(_0xc0e0dc){if(_0xc0e0dc){return _0xc0e0dc['destroy']()['then'](function(){_0x1cf317['status'](0xcc)[_0x99f3('0x1d')]();});}};}function handleEntityNotFound(_0x550ca9,_0x5d3e89){return function(_0x1e445e){if(!_0x1e445e){_0x550ca9[_0x99f3('0x1b')](0x194);}return _0x1e445e;};}function handleError(_0x2c0a8f,_0x2121e9){_0x2121e9=_0x2121e9||0x1f4;return function(_0x1d790e){logger[_0x99f3('0x28')](_0x1d790e[_0x99f3('0x29')]);if(_0x1d790e['name']){delete _0x1d790e[_0x99f3('0x2a')];}_0x2c0a8f[_0x99f3('0x1c')](_0x2121e9)[_0x99f3('0x2b')](_0x1d790e);};}exports[_0x99f3('0x2c')]=function(_0x9ec17a,_0xeca28d){var _0xa025ca={},_0x5f47bb={},_0x1151e3={'count':0x0,'rows':[]};var _0x24c544=_[_0x99f3('0x2d')](db['MailTransferReport'][_0x99f3('0x2e')],function(_0x31a9cd){return{'name':_0x31a9cd[_0x99f3('0x2f')],'type':_0x31a9cd[_0x99f3('0x30')][_0x99f3('0x31')]};});_0x5f47bb['model']=_[_0x99f3('0x2d')](_0x24c544,'name');_0x5f47bb[_0x99f3('0x32')]=_[_0x99f3('0x33')](_0x9ec17a[_0x99f3('0x32')]);_0x5f47bb['filters']=_[_0x99f3('0x34')](_0x5f47bb[_0x99f3('0x35')],_0x5f47bb[_0x99f3('0x32')]);_0xa025ca[_0x99f3('0x36')]=_[_0x99f3('0x34')](_0x5f47bb['model'],qs[_0x99f3('0x37')](_0x9ec17a[_0x99f3('0x32')]['fields']));_0xa025ca[_0x99f3('0x36')]=_0xa025ca['attributes']['length']?_0xa025ca[_0x99f3('0x36')]:_0x5f47bb[_0x99f3('0x35')];if(!_0x9ec17a[_0x99f3('0x32')][_0x99f3('0x38')](_0x99f3('0x39'))){_0xa025ca[_0x99f3('0x22')]=qs['limit'](_0x9ec17a['query'][_0x99f3('0x22')]);_0xa025ca['offset']=qs[_0x99f3('0x1f')](_0x9ec17a[_0x99f3('0x32')][_0x99f3('0x1f')]);}_0xa025ca[_0x99f3('0x3a')]=qs['sort'](_0x9ec17a[_0x99f3('0x32')]['sort']);_0xa025ca['where']=qs['filters'](_[_0x99f3('0x3b')](_0x9ec17a[_0x99f3('0x32')],_0x5f47bb[_0x99f3('0x3c')]),_0x24c544);if(_0x9ec17a['query'][_0x99f3('0x3d')]){_0xa025ca['where']=_['merge'](_0xa025ca['where'],{'$or':_[_0x99f3('0x2d')](_0x24c544,function(_0x800eae){if(_0x800eae[_0x99f3('0x30')]!==_0x99f3('0x3e')){var _0x11f0d2={};_0x11f0d2[_0x800eae['name']]={'$like':'%'+_0x9ec17a[_0x99f3('0x32')][_0x99f3('0x3d')]+'%'};return _0x11f0d2;}})});}_0xa025ca=_[_0x99f3('0x3f')]({},_0xa025ca,_0x9ec17a[_0x99f3('0x40')]);var _0x40baa2={'where':_0xa025ca[_0x99f3('0x41')]};return db[_0x99f3('0x42')][_0x99f3('0x21')](_0x40baa2)[_0x99f3('0x27')](function(_0x388345){_0x1151e3[_0x99f3('0x21')]=_0x388345;if(_0x9ec17a[_0x99f3('0x32')][_0x99f3('0x43')]){_0xa025ca[_0x99f3('0x44')]=[{'all':!![]}];}return db[_0x99f3('0x42')][_0x99f3('0x45')](_0xa025ca);})[_0x99f3('0x27')](function(_0x563eed){_0x1151e3[_0x99f3('0x46')]=_0x563eed;return _0x1151e3;})[_0x99f3('0x27')](respondWithFilteredResult(_0xeca28d,_0xa025ca))[_0x99f3('0x47')](handleError(_0xeca28d,null));};exports[_0x99f3('0x48')]=function(_0x170fde,_0x3d8166){var _0x2acb44={'raw':!![],'where':{'id':_0x170fde[_0x99f3('0x49')]['id']}},_0x951dce={};_0x951dce[_0x99f3('0x35')]=_[_0x99f3('0x33')](db[_0x99f3('0x42')][_0x99f3('0x2e')]);_0x951dce[_0x99f3('0x32')]=_[_0x99f3('0x33')](_0x170fde[_0x99f3('0x32')]);_0x951dce['filters']=_[_0x99f3('0x34')](_0x951dce[_0x99f3('0x35')],_0x951dce[_0x99f3('0x32')]);_0x2acb44['attributes']=_[_0x99f3('0x34')](_0x951dce['model'],qs[_0x99f3('0x37')](_0x170fde[_0x99f3('0x32')]['fields']));_0x2acb44[_0x99f3('0x36')]=_0x2acb44[_0x99f3('0x36')][_0x99f3('0x4a')]?_0x2acb44[_0x99f3('0x36')]:_0x951dce['model'];if(_0x170fde[_0x99f3('0x32')]['includeAll']){_0x2acb44['include']=[{'all':!![]}];}_0x2acb44=_['merge']({},_0x2acb44,_0x170fde[_0x99f3('0x40')]);return db[_0x99f3('0x42')][_0x99f3('0x4b')](_0x2acb44)[_0x99f3('0x27')](handleEntityNotFound(_0x3d8166,null))[_0x99f3('0x27')](respondWithResult(_0x3d8166,null))[_0x99f3('0x47')](handleError(_0x3d8166,null));};exports[_0x99f3('0x4c')]=function(_0x3caa16,_0x45622d){return db[_0x99f3('0x42')][_0x99f3('0x4c')](_0x3caa16[_0x99f3('0x4d')],{})[_0x99f3('0x27')](respondWithResult(_0x45622d,0xc9))['catch'](handleError(_0x45622d,null));};exports[_0x99f3('0x4e')]=function(_0x486902,_0x1ff68a){if(_0x486902[_0x99f3('0x4d')]['id']){delete _0x486902[_0x99f3('0x4d')]['id'];}return db[_0x99f3('0x42')][_0x99f3('0x4b')]({'where':{'id':_0x486902['params']['id']}})[_0x99f3('0x27')](handleEntityNotFound(_0x1ff68a,null))[_0x99f3('0x27')](saveUpdates(_0x486902['body'],null))['then'](respondWithResult(_0x1ff68a,null))['catch'](handleError(_0x1ff68a,null));};exports[_0x99f3('0x4f')]=function(_0x51acdb,_0x40396d){return db['MailTransferReport'][_0x99f3('0x4b')]({'where':{'id':_0x51acdb[_0x99f3('0x49')]['id']}})['then'](handleEntityNotFound(_0x40396d,null))[_0x99f3('0x27')](removeEntity(_0x40396d,null))['catch'](handleError(_0x40396d,null));};exports['describe']=function(_0x47b317,_0x20d0e2){return db[_0x99f3('0x42')][_0x99f3('0x50')]()[_0x99f3('0x27')](respondWithResult(_0x20d0e2,null))[_0x99f3('0x47')](handleError(_0x20d0e2,null));};
\ No newline at end of file
+var _0x6fb6=['attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','MailTransferReport','rawAttributes','fieldName','model','keys','query','filters','intersection'];(function(_0x51ead1,_0x1347a6){var _0x406c3e=function(_0xfbe428){while(--_0xfbe428){_0x51ead1['push'](_0x51ead1['shift']());}};_0x406c3e(++_0x1347a6);}(_0x6fb6,0xf8));var _0x66fb=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x6fb6[_0x3a6efd];return _0x487b9a;};'use strict';var emlformat=require(_0x66fb('0x0'));var rimraf=require(_0x66fb('0x1'));var zipdir=require(_0x66fb('0x2'));var jsonpatch=require(_0x66fb('0x3'));var rp=require(_0x66fb('0x4'));var moment=require('moment');var BPromise=require(_0x66fb('0x5'));var Mustache=require('mustache');var util=require(_0x66fb('0x6'));var path=require('path');var sox=require(_0x66fb('0x7'));var csv=require('to-csv');var ejs=require(_0x66fb('0x8'));var fs=require('fs');var fs_extra=require(_0x66fb('0x9'));var _=require(_0x66fb('0xa'));var squel=require(_0x66fb('0xb'));var crypto=require(_0x66fb('0xc'));var jsforce=require(_0x66fb('0xd'));var deskjs=require(_0x66fb('0xe'));var toCsv=require(_0x66fb('0xf'));var querystring=require(_0x66fb('0x10'));var Papa=require('papaparse');var Redis=require(_0x66fb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x66fb('0x12'));var as=require(_0x66fb('0x13'));var hardwareService=require(_0x66fb('0x14'));var logger=require('../../config/logger')(_0x66fb('0x15'));var utils=require(_0x66fb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x66fb('0x17'));var db=require(_0x66fb('0x18'))['db'];function respondWithStatusCode(_0x24a64e,_0x2dbd19){_0x2dbd19=_0x2dbd19||0xcc;return function(_0x5abd87){if(_0x5abd87){return _0x24a64e[_0x66fb('0x19')](_0x2dbd19);}return _0x24a64e[_0x66fb('0x1a')](_0x2dbd19)[_0x66fb('0x1b')]();};}function respondWithResult(_0x565ae2,_0x39cb3c){_0x39cb3c=_0x39cb3c||0xc8;return function(_0x31c758){if(_0x31c758){return _0x565ae2[_0x66fb('0x1a')](_0x39cb3c)['json'](_0x31c758);}};}function respondWithFilteredResult(_0x4d226b,_0x46305b){return function(_0x115a50){if(_0x115a50){var _0x2f39ad=typeof _0x46305b['offset']===_0x66fb('0x1c')&&typeof _0x46305b[_0x66fb('0x1d')]===_0x66fb('0x1c');var _0x112fd3=_0x115a50[_0x66fb('0x1e')];var _0x47b9a8=_0x2f39ad?0x0:_0x46305b[_0x66fb('0x1f')];var _0xa7dc65=_0x2f39ad?_0x115a50[_0x66fb('0x1e')]:_0x46305b['offset']+_0x46305b[_0x66fb('0x1d')];var _0x4ee384;if(_0xa7dc65>=_0x112fd3){_0xa7dc65=_0x112fd3;_0x4ee384=0xc8;}else{_0x4ee384=0xce;}_0x4d226b[_0x66fb('0x1a')](_0x4ee384);return _0x4d226b[_0x66fb('0x20')](_0x66fb('0x21'),_0x47b9a8+'-'+_0xa7dc65+'/'+_0x112fd3)[_0x66fb('0x22')](_0x115a50);}return null;};}function patchUpdates(_0x1582ac){return function(_0x28f7d2){try{jsonpatch[_0x66fb('0x23')](_0x28f7d2,_0x1582ac,!![]);}catch(_0x536959){return BPromise[_0x66fb('0x24')](_0x536959);}return _0x28f7d2[_0x66fb('0x25')]();};}function saveUpdates(_0x240682,_0x59b0c8){return function(_0x4c604a){if(_0x4c604a){return _0x4c604a[_0x66fb('0x26')](_0x240682)[_0x66fb('0x27')](function(_0x465ed3){return _0x465ed3;});}return null;};}function removeEntity(_0x263345,_0x164089){return function(_0xf34bb6){if(_0xf34bb6){return _0xf34bb6[_0x66fb('0x28')]()[_0x66fb('0x27')](function(){_0x263345[_0x66fb('0x1a')](0xcc)[_0x66fb('0x1b')]();});}};}function handleEntityNotFound(_0xb5d6cb,_0x16862d){return function(_0x2fc37e){if(!_0x2fc37e){_0xb5d6cb[_0x66fb('0x19')](0x194);}return _0x2fc37e;};}function handleError(_0x21014e,_0x4193b7){_0x4193b7=_0x4193b7||0x1f4;return function(_0x69205e){logger['error'](_0x69205e[_0x66fb('0x29')]);if(_0x69205e[_0x66fb('0x2a')]){delete _0x69205e[_0x66fb('0x2a')];}_0x21014e[_0x66fb('0x1a')](_0x4193b7)['send'](_0x69205e);};}exports['index']=function(_0x31b5cd,_0x75afc0){var _0x4d56b5={},_0x5ad7af={},_0x11d151={'count':0x0,'rows':[]};var _0x1d33a8=_[_0x66fb('0x2b')](db[_0x66fb('0x2c')][_0x66fb('0x2d')],function(_0x2a4390){return{'name':_0x2a4390[_0x66fb('0x2e')],'type':_0x2a4390['type']['key']};});_0x5ad7af[_0x66fb('0x2f')]=_['map'](_0x1d33a8,_0x66fb('0x2a'));_0x5ad7af['query']=_[_0x66fb('0x30')](_0x31b5cd[_0x66fb('0x31')]);_0x5ad7af[_0x66fb('0x32')]=_[_0x66fb('0x33')](_0x5ad7af[_0x66fb('0x2f')],_0x5ad7af[_0x66fb('0x31')]);_0x4d56b5[_0x66fb('0x34')]=_[_0x66fb('0x33')](_0x5ad7af[_0x66fb('0x2f')],qs[_0x66fb('0x35')](_0x31b5cd[_0x66fb('0x31')][_0x66fb('0x35')]));_0x4d56b5[_0x66fb('0x34')]=_0x4d56b5[_0x66fb('0x34')][_0x66fb('0x36')]?_0x4d56b5[_0x66fb('0x34')]:_0x5ad7af['model'];if(!_0x31b5cd[_0x66fb('0x31')]['hasOwnProperty'](_0x66fb('0x37'))){_0x4d56b5[_0x66fb('0x1d')]=qs[_0x66fb('0x1d')](_0x31b5cd[_0x66fb('0x31')][_0x66fb('0x1d')]);_0x4d56b5[_0x66fb('0x1f')]=qs[_0x66fb('0x1f')](_0x31b5cd[_0x66fb('0x31')][_0x66fb('0x1f')]);}_0x4d56b5[_0x66fb('0x38')]=qs[_0x66fb('0x39')](_0x31b5cd['query']['sort']);_0x4d56b5[_0x66fb('0x3a')]=qs[_0x66fb('0x32')](_[_0x66fb('0x3b')](_0x31b5cd['query'],_0x5ad7af[_0x66fb('0x32')]),_0x1d33a8);if(_0x31b5cd[_0x66fb('0x31')][_0x66fb('0x3c')]){_0x4d56b5[_0x66fb('0x3a')]=_[_0x66fb('0x3d')](_0x4d56b5[_0x66fb('0x3a')],{'$or':_[_0x66fb('0x2b')](_0x1d33a8,function(_0x9963d7){if(_0x9963d7[_0x66fb('0x3e')]!==_0x66fb('0x3f')){var _0x1ba272={};_0x1ba272[_0x9963d7[_0x66fb('0x2a')]]={'$like':'%'+_0x31b5cd[_0x66fb('0x31')][_0x66fb('0x3c')]+'%'};return _0x1ba272;}})});}_0x4d56b5=_['merge']({},_0x4d56b5,_0x31b5cd['options']);var _0xa13296={'where':_0x4d56b5[_0x66fb('0x3a')]};return db[_0x66fb('0x2c')][_0x66fb('0x1e')](_0xa13296)['then'](function(_0x1eda22){_0x11d151[_0x66fb('0x1e')]=_0x1eda22;if(_0x31b5cd[_0x66fb('0x31')][_0x66fb('0x40')]){_0x4d56b5['include']=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x4d56b5);})[_0x66fb('0x27')](function(_0x1de176){_0x11d151[_0x66fb('0x41')]=_0x1de176;return _0x11d151;})[_0x66fb('0x27')](respondWithFilteredResult(_0x75afc0,_0x4d56b5))[_0x66fb('0x42')](handleError(_0x75afc0,null));};exports[_0x66fb('0x43')]=function(_0x5abf57,_0xaed9e7){var _0x43961e={'raw':!![],'where':{'id':_0x5abf57[_0x66fb('0x44')]['id']}},_0x238803={};_0x238803[_0x66fb('0x2f')]=_[_0x66fb('0x30')](db[_0x66fb('0x2c')]['rawAttributes']);_0x238803[_0x66fb('0x31')]=_['keys'](_0x5abf57[_0x66fb('0x31')]);_0x238803['filters']=_['intersection'](_0x238803[_0x66fb('0x2f')],_0x238803['query']);_0x43961e[_0x66fb('0x34')]=_[_0x66fb('0x33')](_0x238803[_0x66fb('0x2f')],qs[_0x66fb('0x35')](_0x5abf57[_0x66fb('0x31')][_0x66fb('0x35')]));_0x43961e[_0x66fb('0x34')]=_0x43961e['attributes'][_0x66fb('0x36')]?_0x43961e[_0x66fb('0x34')]:_0x238803['model'];if(_0x5abf57['query'][_0x66fb('0x40')]){_0x43961e[_0x66fb('0x45')]=[{'all':!![]}];}_0x43961e=_[_0x66fb('0x3d')]({},_0x43961e,_0x5abf57[_0x66fb('0x46')]);return db[_0x66fb('0x2c')][_0x66fb('0x47')](_0x43961e)[_0x66fb('0x27')](handleEntityNotFound(_0xaed9e7,null))[_0x66fb('0x27')](respondWithResult(_0xaed9e7,null))[_0x66fb('0x42')](handleError(_0xaed9e7,null));};exports[_0x66fb('0x48')]=function(_0x1a7239,_0x45df2c){return db['MailTransferReport']['create'](_0x1a7239[_0x66fb('0x49')],{})['then'](respondWithResult(_0x45df2c,0xc9))[_0x66fb('0x42')](handleError(_0x45df2c,null));};exports['update']=function(_0x3672fc,_0x3296c6){if(_0x3672fc[_0x66fb('0x49')]['id']){delete _0x3672fc[_0x66fb('0x49')]['id'];}return db['MailTransferReport'][_0x66fb('0x47')]({'where':{'id':_0x3672fc[_0x66fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x3296c6,null))[_0x66fb('0x27')](saveUpdates(_0x3672fc[_0x66fb('0x49')],null))[_0x66fb('0x27')](respondWithResult(_0x3296c6,null))[_0x66fb('0x42')](handleError(_0x3296c6,null));};exports['destroy']=function(_0x2ed916,_0x5f4499){return db[_0x66fb('0x2c')]['find']({'where':{'id':_0x2ed916['params']['id']}})[_0x66fb('0x27')](handleEntityNotFound(_0x5f4499,null))[_0x66fb('0x27')](removeEntity(_0x5f4499,null))[_0x66fb('0x42')](handleError(_0x5f4499,null));};exports['describe']=function(_0x40e9a9,_0x3d9da7){return db[_0x66fb('0x2c')][_0x66fb('0x4a')]()[_0x66fb('0x27')](respondWithResult(_0x3d9da7,null))[_0x66fb('0x42')](handleError(_0x3d9da7,null));};
\ No newline at end of file
index e1875ad..4b37bed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2070=['moment','request-promise','path','../../config/environment','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api'];(function(_0x5c3844,_0x44e362){var _0x1fad33=function(_0xfb510e){while(--_0xfb510e){_0x5c3844['push'](_0x5c3844['shift']());}};_0x1fad33(++_0x44e362);}(_0x2070,0x1a2));var _0x0207=function(_0x3dac76,_0x5ba896){_0x3dac76=_0x3dac76-0x0;var _0x123a61=_0x2070[_0x3dac76];return _0x123a61;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0207('0x0'))(_0x0207('0x1'));var moment=require(_0x0207('0x2'));var BPromise=require('bluebird');var rp=require(_0x0207('0x3'));var fs=require('fs');var path=require(_0x0207('0x4'));var rimraf=require('rimraf');var config=require(_0x0207('0x5'));var attributes=require(_0x0207('0x6'));module['exports']=function(_0x5573e8,_0x5cf734){return _0x5573e8['define'](_0x0207('0x7'),attributes,{'tableName':_0x0207('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0207('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb661=['moment','bluebird','request-promise','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x508538,_0x5e07c4){var _0x32d5c0=function(_0x190c57){while(--_0x190c57){_0x508538['push'](_0x508538['shift']());}};_0x32d5c0(++_0x5e07c4);}(_0xb661,0x1d0));var _0x1b66=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xb661[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x1b66('0x0'));var util=require(_0x1b66('0x1'));var logger=require(_0x1b66('0x2'))(_0x1b66('0x3'));var moment=require(_0x1b66('0x4'));var BPromise=require(_0x1b66('0x5'));var rp=require(_0x1b66('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0x1b66('0x7')]=function(_0x1c8498,_0x4ada4c){return _0x1c8498[_0x1b66('0x8')](_0x1b66('0x9'),attributes,{'tableName':_0x1b66('0xa'),'paranoid':![],'indexes':[{'name':_0x1b66('0xb'),'fields':[_0x1b66('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 4015c9f..3ad5b7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd191=['then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','MailTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x5aa950,_0x34ea31){var _0x22d9fe=function(_0x3cfdb9){while(--_0x3cfdb9){_0x5aa950['push'](_0x5aa950['shift']());}};_0x22d9fe(++_0x34ea31);}(_0xd191,0x1ad));var _0x1d19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd191[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1d19('0x0'));var util=require(_0x1d19('0x1'));var moment=require(_0x1d19('0x2'));var BPromise=require(_0x1d19('0x3'));var rs=require(_0x1d19('0x4'));var fs=require('fs');var Redis=require(_0x1d19('0x5'));var db=require(_0x1d19('0x6'))['db'];var utils=require(_0x1d19('0x7'));var logger=require('../../config/logger')(_0x1d19('0x8'));var config=require('../../config/environment');var jayson=require(_0x1d19('0x9'));var client=jayson[_0x1d19('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5127f0,_0x385f80,_0x22c523){return new BPromise(function(_0x375fe2,_0x40f925){return client[_0x1d19('0xb')](_0x5127f0,_0x22c523)[_0x1d19('0xc')](function(_0x39aaf6){logger[_0x1d19('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x385f80,_0x1d19('0xe'));logger[_0x1d19('0xf')](_0x1d19('0x10'),_0x385f80,_0x1d19('0xe'),JSON['stringify'](_0x39aaf6));if(_0x39aaf6[_0x1d19('0x11')]){if(_0x39aaf6[_0x1d19('0x11')]['code']===0x1f4){logger[_0x1d19('0x11')](_0x1d19('0x12'),_0x385f80,_0x39aaf6[_0x1d19('0x11')][_0x1d19('0x13')]);return _0x40f925(_0x39aaf6['error'][_0x1d19('0x13')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x385f80,_0x39aaf6[_0x1d19('0x11')][_0x1d19('0x13')]);return _0x375fe2(_0x39aaf6[_0x1d19('0x11')][_0x1d19('0x13')]);}else{logger[_0x1d19('0xd')](_0x1d19('0x12'),_0x385f80,_0x1d19('0xe'));_0x375fe2(_0x39aaf6[_0x1d19('0x14')][_0x1d19('0x13')]);}})['catch'](function(_0x171031){logger[_0x1d19('0x11')](_0x1d19('0x12'),_0x385f80,_0x171031);_0x40f925(_0x171031);});});}
\ No newline at end of file
+var _0x4e3f=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','error','code','message','MailTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5d72d1,_0x49a1ae){var _0x40347e=function(_0x9d24ee){while(--_0x9d24ee){_0x5d72d1['push'](_0x5d72d1['shift']());}};_0x40347e(++_0x49a1ae);}(_0x4e3f,0x10a));var _0xf4e3=function(_0x57eecb,_0x257002){_0x57eecb=_0x57eecb-0x0;var _0x36d291=_0x4e3f[_0x57eecb];return _0x36d291;};'use strict';var _=require(_0xf4e3('0x0'));var util=require(_0xf4e3('0x1'));var moment=require(_0xf4e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf4e3('0x3'));var fs=require('fs');var Redis=require(_0xf4e3('0x4'));var db=require(_0xf4e3('0x5'))['db'];var utils=require(_0xf4e3('0x6'));var logger=require(_0xf4e3('0x7'))(_0xf4e3('0x8'));var config=require(_0xf4e3('0x9'));var jayson=require(_0xf4e3('0xa'));var client=jayson['client'][_0xf4e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41aaff,_0x5337e7,_0x1a6339){return new BPromise(function(_0x18aa99,_0x5c4624){return client[_0xf4e3('0xc')](_0x41aaff,_0x1a6339)['then'](function(_0x351c26){logger[_0xf4e3('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x5337e7,_0xf4e3('0xe'));logger[_0xf4e3('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x5337e7,_0xf4e3('0xe'),JSON['stringify'](_0x351c26));if(_0x351c26[_0xf4e3('0x10')]){if(_0x351c26[_0xf4e3('0x10')][_0xf4e3('0x11')]===0x1f4){logger[_0xf4e3('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x5337e7,_0x351c26[_0xf4e3('0x10')][_0xf4e3('0x12')]);return _0x5c4624(_0x351c26[_0xf4e3('0x10')]['message']);}logger[_0xf4e3('0x10')](_0xf4e3('0x13'),_0x5337e7,_0x351c26[_0xf4e3('0x10')][_0xf4e3('0x12')]);return _0x18aa99(_0x351c26[_0xf4e3('0x10')][_0xf4e3('0x12')]);}else{logger[_0xf4e3('0xd')](_0xf4e3('0x13'),_0x5337e7,_0xf4e3('0xe'));_0x18aa99(_0x351c26['result'][_0xf4e3('0x12')]);}})[_0xf4e3('0x14')](function(_0x2952f6){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x5337e7,_0x2952f6);_0x5c4624(_0x2952f6);});});}
\ No newline at end of file
index 64045e2..9a119ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb823=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x2d1955,_0x30b60f){var _0x1d0ede=function(_0x5aa5ab){while(--_0x5aa5ab){_0x2d1955['push'](_0x2d1955['shift']());}};_0x1d0ede(++_0x30b60f);}(_0xb823,0x1e8));var _0x3b82=function(_0x1c79a7,_0x38220e){_0x1c79a7=_0x1c79a7-0x0;var _0x4de69f=_0xb823[_0x1c79a7];return _0x4de69f;};'use strict';var multer=require(_0x3b82('0x0'));var util=require(_0x3b82('0x1'));var path=require(_0x3b82('0x2'));var timeout=require(_0x3b82('0x3'));var express=require(_0x3b82('0x4'));var router=express[_0x3b82('0x5')]();var fs_extra=require(_0x3b82('0x6'));var auth=require(_0x3b82('0x7'));var interaction=require(_0x3b82('0x8'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x3b82('0x9')]('/',auth['isAuthenticated'](),controller[_0x3b82('0xa')]);router['get'](_0x3b82('0xb'),auth[_0x3b82('0xc')](),controller[_0x3b82('0xd')]);router[_0x3b82('0x9')](_0x3b82('0xe'),auth['isAuthenticated'](),controller[_0x3b82('0xf')]);router[_0x3b82('0x10')]('/',auth[_0x3b82('0xc')](),controller[_0x3b82('0x11')]);router[_0x3b82('0x12')](_0x3b82('0xe'),auth[_0x3b82('0xc')](),controller[_0x3b82('0x13')]);router[_0x3b82('0x14')](_0x3b82('0xe'),auth[_0x3b82('0xc')](),controller[_0x3b82('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xd812=['connect-timeout','express','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','multer','util'];(function(_0x5a0a9a,_0xb6658b){var _0x501f2f=function(_0x2c4e2a){while(--_0x2c4e2a){_0x5a0a9a['push'](_0x5a0a9a['shift']());}};_0x501f2f(++_0xb6658b);}(_0xd812,0xec));var _0x2d81=function(_0x225b4e,_0x179ee4){_0x225b4e=_0x225b4e-0x0;var _0x24237a=_0xd812[_0x225b4e];return _0x24237a;};'use strict';var multer=require(_0x2d81('0x0'));var util=require(_0x2d81('0x1'));var path=require('path');var timeout=require(_0x2d81('0x2'));var express=require(_0x2d81('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2d81('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2d81('0x5'));var controller=require(_0x2d81('0x6'));router[_0x2d81('0x7')]('/',auth[_0x2d81('0x8')](),controller[_0x2d81('0x9')]);router[_0x2d81('0x7')](_0x2d81('0xa'),auth['isAuthenticated'](),controller[_0x2d81('0xb')]);router[_0x2d81('0x7')](_0x2d81('0xc'),auth[_0x2d81('0x8')](),controller[_0x2d81('0xd')]);router[_0x2d81('0xe')]('/',auth['isAuthenticated'](),controller[_0x2d81('0xf')]);router[_0x2d81('0x10')](_0x2d81('0xc'),auth[_0x2d81('0x8')](),controller['update']);router['delete'](_0x2d81('0xc'),auth[_0x2d81('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 42be94f..5e07a06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44f2=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x29a8b6,_0x4d9576){var _0x270b0c=function(_0x439060){while(--_0x439060){_0x29a8b6['push'](_0x29a8b6['shift']());}};_0x270b0c(++_0x4d9576);}(_0x44f2,0x12a));var _0x244f=function(_0x182baf,_0x1375fb){_0x182baf=_0x182baf-0x0;var _0x4d10f1=_0x44f2[_0x182baf];return _0x4d10f1;};'use strict';var Sequelize=require(_0x244f('0x0'));var moment=require(_0x244f('0x1'));module[_0x244f('0x2')]={'channel':{'type':Sequelize[_0x244f('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x244f('0x3')]},'type':{'type':Sequelize[_0x244f('0x3')],'defaultValue':_0x244f('0x4'),'comment':_0x244f('0x5')},'duration':{'type':Sequelize[_0x244f('0x6')]},'enterAt':{'type':Sequelize[_0x244f('0x7')]},'exitAt':{'type':Sequelize[_0x244f('0x7')],'set':function(_0x1c2aa4){var _0x43f7a6=moment(_0x1c2aa4);var _0x519fab=moment(this[_0x244f('0x8')](_0x244f('0x9')));var _0xb9f149=_0x43f7a6[_0x244f('0xa')](_0x519fab,_0x244f('0xb'));this[_0x244f('0xc')](_0x244f('0xd'),_0x1c2aa4);this[_0x244f('0xc')](_0x244f('0xe'),_0xb9f149>=0x0?_0xb9f149:null);}},'data1':{'type':Sequelize[_0x244f('0x3')],'comment':_0x244f('0xf')},'data2':{'type':Sequelize['STRING'],'comment':_0x244f('0x10')},'data3':{'type':Sequelize[_0x244f('0x3')],'comment':_0x244f('0x11')},'data4':{'type':Sequelize[_0x244f('0x3')],'comment':_0x244f('0x12')},'data5':{'type':Sequelize['STRING'],'comment':_0x244f('0x13')},'role':{'type':Sequelize[_0x244f('0x3')]},'internal':{'type':Sequelize[_0x244f('0x6')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa828=['getDataValue','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x13f3a0,_0x1eeeab){var _0x30e9de=function(_0x422092){while(--_0x422092){_0x13f3a0['push'](_0x13f3a0['shift']());}};_0x30e9de(++_0x1eeeab);}(_0xa828,0x7c));var _0x8a82=function(_0x386303,_0x3f0501){_0x386303=_0x386303-0x0;var _0x2ae474=_0xa828[_0x386303];return _0x2ae474;};'use strict';var Sequelize=require(_0x8a82('0x0'));var moment=require(_0x8a82('0x1'));module['exports']={'channel':{'type':Sequelize[_0x8a82('0x2')]},'membername':{'type':Sequelize[_0x8a82('0x2')]},'interface':{'type':Sequelize[_0x8a82('0x2')]},'type':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x8a82('0x3')},'duration':{'type':Sequelize[_0x8a82('0x4')]},'enterAt':{'type':Sequelize[_0x8a82('0x5')]},'exitAt':{'type':Sequelize[_0x8a82('0x5')],'set':function(_0x197a92){var _0x1e84c9=moment(_0x197a92);var _0x34adcd=moment(this[_0x8a82('0x6')]('enterAt'));var _0x67659d=_0x1e84c9['diff'](_0x34adcd,_0x8a82('0x7'));this[_0x8a82('0x8')](_0x8a82('0x9'),_0x197a92);this[_0x8a82('0x8')]('duration',_0x67659d>=0x0?_0x67659d:null);}},'data1':{'type':Sequelize[_0x8a82('0x2')],'comment':_0x8a82('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0x8a82('0xb')},'data3':{'type':Sequelize[_0x8a82('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x8a82('0x2')],'comment':_0x8a82('0xc')},'data5':{'type':Sequelize[_0x8a82('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x8a82('0x4')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2a284a1..3ef03bb 100644 (file)
@@ -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','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x55ca,0x126));var _0xa55c=function(_0x158a01,_0x50bcb8){_0x158a01=_0x158a01-0x0;var _0x94b215=_0x55ca[_0x158a01];return _0x94b215;};'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['MemberReport'][_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 _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','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x55ca,0x126));var _0xa55c=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x55ca[_0x1e06f1];return _0x34f77e;};'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['MemberReport'][_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
index d4bfa58..fe94bbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1707=['./memberReport.attributes','exports','define','report_member','membername','interface','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3740da,_0x62dd9c){var _0x336885=function(_0xcaf8c1){while(--_0xcaf8c1){_0x3740da['push'](_0x3740da['shift']());}};_0x336885(++_0x62dd9c);}(_0x1707,0x11e));var _0x7170=function(_0x4d306f,_0x383f34){_0x4d306f=_0x4d306f-0x0;var _0x503b86=_0x1707[_0x4d306f];return _0x503b86;};'use strict';var _=require(_0x7170('0x0'));var util=require('util');var logger=require(_0x7170('0x1'))(_0x7170('0x2'));var moment=require(_0x7170('0x3'));var BPromise=require(_0x7170('0x4'));var rp=require(_0x7170('0x5'));var fs=require('fs');var path=require(_0x7170('0x6'));var rimraf=require('rimraf');var config=require(_0x7170('0x7'));var attributes=require(_0x7170('0x8'));module[_0x7170('0x9')]=function(_0x31eee9,_0x985397){return _0x31eee9[_0x7170('0xa')]('MemberReport',attributes,{'tableName':_0x7170('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x7170('0xc'),_0x7170('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4ff=['exports','MemberReport','membername_interface','membername','interface','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x51ecea,_0x4bc24c){var _0x8423b0=function(_0x4381be){while(--_0x4381be){_0x51ecea['push'](_0x51ecea['shift']());}};_0x8423b0(++_0x4bc24c);}(_0xd4ff,0x18b));var _0xfd4f=function(_0x2246a6,_0x267b42){_0x2246a6=_0x2246a6-0x0;var _0x138e0c=_0xd4ff[_0x2246a6];return _0x138e0c;};'use strict';var _=require(_0xfd4f('0x0'));var util=require(_0xfd4f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfd4f('0x2'));var BPromise=require(_0xfd4f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd4f('0x4'));var rimraf=require(_0xfd4f('0x5'));var config=require(_0xfd4f('0x6'));var attributes=require(_0xfd4f('0x7'));module[_0xfd4f('0x8')]=function(_0x126751,_0x49404b){return _0x126751['define'](_0xfd4f('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xfd4f('0xa'),'fields':[_0xfd4f('0xb'),_0xfd4f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index e1941ed..2a8f082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd43e=['jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','findAll','options','attributes','limit','include','map','model','CreateMemberReport','MemberReport','create','body','raw','UpdateMemberReport','update','where','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0xd43e,0x88));var _0xed43=function(_0x319e3a,_0x3101b1){_0x319e3a=_0x319e3a-0x0;var _0x1b0a60=_0xd43e[_0x319e3a];return _0x1b0a60;};'use strict';var _=require(_0xed43('0x0'));var util=require('util');var moment=require(_0xed43('0x1'));var BPromise=require(_0xed43('0x2'));var rs=require(_0xed43('0x3'));var fs=require('fs');var Redis=require(_0xed43('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed43('0x5'))(_0xed43('0x6'));var config=require(_0xed43('0x7'));var jayson=require(_0xed43('0x8'));var client=jayson['client'][_0xed43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x463645,_0x4875eb,_0x4c3697){return new BPromise(function(_0x58b2b0,_0x3d603f){return client[_0xed43('0xa')](_0x463645,_0x4c3697)[_0xed43('0xb')](function(_0xd39ac0){logger[_0xed43('0xc')]('MemberReport,\x20%s,\x20%s',_0x4875eb,_0xed43('0xd'));logger[_0xed43('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x4875eb,_0xed43('0xd'),JSON[_0xed43('0xf')](_0xd39ac0));if(_0xd39ac0[_0xed43('0x10')]){if(_0xd39ac0['error']['code']===0x1f4){logger[_0xed43('0x10')](_0xed43('0x11'),_0x4875eb,_0xd39ac0['error'][_0xed43('0x12')]);return _0x3d603f(_0xd39ac0[_0xed43('0x10')][_0xed43('0x12')]);}logger[_0xed43('0x10')](_0xed43('0x11'),_0x4875eb,_0xd39ac0[_0xed43('0x10')]['message']);return _0x58b2b0(_0xd39ac0[_0xed43('0x10')]['message']);}else{logger[_0xed43('0xc')]('MemberReport,\x20%s,\x20%s',_0x4875eb,_0xed43('0xd'));_0x58b2b0(_0xd39ac0['result']['message']);}})[_0xed43('0x13')](function(_0x572df2){logger[_0xed43('0x10')](_0xed43('0x11'),_0x4875eb,_0x572df2);_0x3d603f(_0x572df2);});});}exports[_0xed43('0x14')]=function(_0x5f5093){var _0x15d67a=this;return new Promise(function(_0xa8a443,_0x4b001c){return db['MemberReport'][_0xed43('0x15')]({'raw':_0x5f5093[_0xed43('0x16')]?_0x5f5093[_0xed43('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5f5093[_0xed43('0x16')]?_0x5f5093[_0xed43('0x16')]['where']||null:null,'attributes':_0x5f5093[_0xed43('0x16')]?_0x5f5093[_0xed43('0x16')][_0xed43('0x17')]||null:null,'limit':_0x5f5093['options']?_0x5f5093['options'][_0xed43('0x18')]||null:null,'include':_0x5f5093[_0xed43('0x16')]?_0x5f5093[_0xed43('0x16')][_0xed43('0x19')]?_[_0xed43('0x1a')](_0x5f5093[_0xed43('0x16')]['include'],function(_0x414c7a){return{'model':db[_0x414c7a[_0xed43('0x1b')]],'as':_0x414c7a['as'],'attributes':_0x414c7a[_0xed43('0x17')],'include':_0x414c7a['include']?_[_0xed43('0x1a')](_0x414c7a[_0xed43('0x19')],function(_0x28a908){return{'model':db[_0x28a908[_0xed43('0x1b')]],'as':_0x28a908['as'],'attributes':_0x28a908['attributes'],'include':_0x28a908[_0xed43('0x19')]?_['map'](_0x28a908[_0xed43('0x19')],function(_0xed8706){return{'model':db[_0xed8706[_0xed43('0x1b')]],'as':_0xed8706['as'],'attributes':_0xed8706[_0xed43('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf22ed1){logger['info']('GetMemberReport',_0x5f5093);logger[_0xed43('0xe')]('GetMemberReport',_0x5f5093,JSON['stringify'](_0xf22ed1));_0xa8a443(_0xf22ed1);})[_0xed43('0x13')](function(_0x139750){logger[_0xed43('0x10')](_0xed43('0x14'),_0x139750[_0xed43('0x12')],_0x5f5093);_0x4b001c(_0x15d67a['error'](0x1f4,_0x139750[_0xed43('0x12')]));});});};exports[_0xed43('0x1c')]=function(_0x3a6e3b){var _0x313b8e=this;return new Promise(function(_0x1e64ae,_0x5ba949){return db[_0xed43('0x1d')][_0xed43('0x1e')](_0x3a6e3b[_0xed43('0x1f')],{'raw':_0x3a6e3b['options']?_0x3a6e3b[_0xed43('0x16')][_0xed43('0x20')]===undefined?!![]:![]:!![]})[_0xed43('0xb')](function(_0x458105){logger[_0xed43('0xc')](_0xed43('0x1c'),_0x3a6e3b);logger[_0xed43('0xe')](_0xed43('0x1c'),_0x3a6e3b,JSON['stringify'](_0x458105));_0x1e64ae(_0x458105);})['catch'](function(_0xc1f46d){logger['error'](_0xed43('0x1c'),_0xc1f46d[_0xed43('0x12')],_0x3a6e3b);_0x5ba949(_0x313b8e['error'](0x1f4,_0xc1f46d[_0xed43('0x12')]));});});};exports[_0xed43('0x21')]=function(_0x235890){var _0x4bb3e=this;return new Promise(function(_0x2168b7,_0x2de365){return db[_0xed43('0x1d')][_0xed43('0x22')](_0x235890['body'],{'raw':_0x235890['options']?_0x235890[_0xed43('0x16')][_0xed43('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235890[_0xed43('0x16')]?_0x235890[_0xed43('0x16')][_0xed43('0x23')]||null:null,'attributes':_0x235890['options']?_0x235890[_0xed43('0x16')]['attributes']||null:null,'limit':_0x235890[_0xed43('0x16')]?_0x235890[_0xed43('0x16')][_0xed43('0x18')]||null:null})['then'](function(_0x3044f3){logger[_0xed43('0xc')]('UpdateMemberReport',_0x235890);logger[_0xed43('0xe')](_0xed43('0x21'),_0x235890,JSON['stringify'](_0x3044f3));_0x2168b7(_0x3044f3);})[_0xed43('0x13')](function(_0x4e0693){logger[_0xed43('0x10')](_0xed43('0x21'),_0x4e0693['message'],_0x235890);_0x2de365(_0x4bb3e[_0xed43('0x10')](0x1f4,_0x4e0693[_0xed43('0x12')]));});});};
\ No newline at end of file
+var _0x1354=['http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','findAll','options','where','limit','include','map','model','attributes','then','GetMemberReport','debug','stringify','catch','CreateMemberReport','MemberReport','create','body','raw','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x475200,_0x2f2ac2){var _0x1aec39=function(_0xdde485){while(--_0xdde485){_0x475200['push'](_0x475200['shift']());}};_0x1aec39(++_0x2f2ac2);}(_0x1354,0x95));var _0x4135=function(_0x1f4ddf,_0x4ef2f8){_0x1f4ddf=_0x1f4ddf-0x0;var _0x169fea=_0x1354[_0x1f4ddf];return _0x169fea;};'use strict';var _=require(_0x4135('0x0'));var util=require(_0x4135('0x1'));var moment=require(_0x4135('0x2'));var BPromise=require(_0x4135('0x3'));var rs=require(_0x4135('0x4'));var fs=require('fs');var Redis=require(_0x4135('0x5'));var db=require(_0x4135('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4135('0x7'))(_0x4135('0x8'));var config=require(_0x4135('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4135('0xa')][_0x4135('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e355d,_0x419ad4,_0x1dcce0){return new BPromise(function(_0x3e7ae3,_0x50ef3f){return client[_0x4135('0xc')](_0x5e355d,_0x1dcce0)['then'](function(_0x365d9b){logger[_0x4135('0xd')](_0x4135('0xe'),_0x419ad4,_0x4135('0xf'));logger['debug'](_0x4135('0x10'),_0x419ad4,'request\x20sent',JSON['stringify'](_0x365d9b));if(_0x365d9b[_0x4135('0x11')]){if(_0x365d9b[_0x4135('0x11')][_0x4135('0x12')]===0x1f4){logger['error'](_0x4135('0xe'),_0x419ad4,_0x365d9b[_0x4135('0x11')][_0x4135('0x13')]);return _0x50ef3f(_0x365d9b[_0x4135('0x11')][_0x4135('0x13')]);}logger[_0x4135('0x11')]('MemberReport,\x20%s,\x20%s',_0x419ad4,_0x365d9b['error'][_0x4135('0x13')]);return _0x3e7ae3(_0x365d9b[_0x4135('0x11')][_0x4135('0x13')]);}else{logger[_0x4135('0xd')]('MemberReport,\x20%s,\x20%s',_0x419ad4,_0x4135('0xf'));_0x3e7ae3(_0x365d9b[_0x4135('0x14')]['message']);}})['catch'](function(_0x32b4db){logger['error'](_0x4135('0xe'),_0x419ad4,_0x32b4db);_0x50ef3f(_0x32b4db);});});}exports['GetMemberReport']=function(_0x53f54e){var _0x5b9586=this;return new Promise(function(_0x53f5a7,_0x2bb752){return db['MemberReport'][_0x4135('0x15')]({'raw':_0x53f54e[_0x4135('0x16')]?_0x53f54e[_0x4135('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x53f54e[_0x4135('0x16')]?_0x53f54e[_0x4135('0x16')][_0x4135('0x17')]||null:null,'attributes':_0x53f54e['options']?_0x53f54e[_0x4135('0x16')]['attributes']||null:null,'limit':_0x53f54e[_0x4135('0x16')]?_0x53f54e[_0x4135('0x16')][_0x4135('0x18')]||null:null,'include':_0x53f54e[_0x4135('0x16')]?_0x53f54e['options'][_0x4135('0x19')]?_[_0x4135('0x1a')](_0x53f54e[_0x4135('0x16')][_0x4135('0x19')],function(_0x83a794){return{'model':db[_0x83a794[_0x4135('0x1b')]],'as':_0x83a794['as'],'attributes':_0x83a794[_0x4135('0x1c')],'include':_0x83a794[_0x4135('0x19')]?_[_0x4135('0x1a')](_0x83a794[_0x4135('0x19')],function(_0x12a9fd){return{'model':db[_0x12a9fd[_0x4135('0x1b')]],'as':_0x12a9fd['as'],'attributes':_0x12a9fd[_0x4135('0x1c')],'include':_0x12a9fd[_0x4135('0x19')]?_['map'](_0x12a9fd[_0x4135('0x19')],function(_0x3e40bc){return{'model':db[_0x3e40bc[_0x4135('0x1b')]],'as':_0x3e40bc['as'],'attributes':_0x3e40bc[_0x4135('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4135('0x1d')](function(_0x3d2dcf){logger['info'](_0x4135('0x1e'),_0x53f54e);logger[_0x4135('0x1f')](_0x4135('0x1e'),_0x53f54e,JSON[_0x4135('0x20')](_0x3d2dcf));_0x53f5a7(_0x3d2dcf);})[_0x4135('0x21')](function(_0x511fce){logger[_0x4135('0x11')](_0x4135('0x1e'),_0x511fce['message'],_0x53f54e);_0x2bb752(_0x5b9586[_0x4135('0x11')](0x1f4,_0x511fce['message']));});});};exports[_0x4135('0x22')]=function(_0x256f25){var _0x25a672=this;return new Promise(function(_0x29821d,_0x5d2a94){return db[_0x4135('0x23')][_0x4135('0x24')](_0x256f25[_0x4135('0x25')],{'raw':_0x256f25[_0x4135('0x16')]?_0x256f25[_0x4135('0x16')][_0x4135('0x26')]===undefined?!![]:![]:!![]})['then'](function(_0x44b3b6){logger[_0x4135('0xd')]('CreateMemberReport',_0x256f25);logger[_0x4135('0x1f')]('CreateMemberReport',_0x256f25,JSON[_0x4135('0x20')](_0x44b3b6));_0x29821d(_0x44b3b6);})[_0x4135('0x21')](function(_0x5f14cb){logger['error'](_0x4135('0x22'),_0x5f14cb[_0x4135('0x13')],_0x256f25);_0x5d2a94(_0x25a672[_0x4135('0x11')](0x1f4,_0x5f14cb['message']));});});};exports[_0x4135('0x27')]=function(_0x2f97ec){var _0x3226ad=this;return new Promise(function(_0x547718,_0x2cf591){return db[_0x4135('0x23')]['update'](_0x2f97ec[_0x4135('0x25')],{'raw':_0x2f97ec[_0x4135('0x16')]?_0x2f97ec['options'][_0x4135('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f97ec['options']?_0x2f97ec[_0x4135('0x16')][_0x4135('0x17')]||null:null,'attributes':_0x2f97ec[_0x4135('0x16')]?_0x2f97ec[_0x4135('0x16')][_0x4135('0x1c')]||null:null,'limit':_0x2f97ec[_0x4135('0x16')]?_0x2f97ec['options'][_0x4135('0x18')]||null:null})[_0x4135('0x1d')](function(_0x51a888){logger[_0x4135('0xd')]('UpdateMemberReport',_0x2f97ec);logger[_0x4135('0x1f')](_0x4135('0x27'),_0x2f97ec,JSON[_0x4135('0x20')](_0x51a888));_0x547718(_0x51a888);})[_0x4135('0x21')](function(_0x244b52){logger[_0x4135('0x11')](_0x4135('0x27'),_0x244b52[_0x4135('0x13')],_0x2f97ec);_0x2cf591(_0x3226ad[_0x4135('0x11')](0x1f4,_0x244b52[_0x4135('0x13')]));});});};
\ No newline at end of file
index d4be3af..7103ae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf367=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xf367,0x1ac));var _0x7f36=function(_0x1741ff,_0x2a6643){_0x1741ff=_0x1741ff-0x0;var _0x5e3a75=_0xf367[_0x1741ff];return _0x5e3a75;};'use strict';var multer=require(_0x7f36('0x0'));var util=require(_0x7f36('0x1'));var path=require(_0x7f36('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f36('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7f36('0x4'));var interaction=require(_0x7f36('0x5'));var config=require(_0x7f36('0x6'));var controller=require(_0x7f36('0x7'));router[_0x7f36('0x8')]('/',controller[_0x7f36('0x9')]);module[_0x7f36('0xa')]=router;
\ No newline at end of file
+var _0xd84d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','multer','path','connect-timeout'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd84d,0x69));var _0xdd84=function(_0x215a07,_0x34670c){_0x215a07=_0x215a07-0x0;var _0x3dbf94=_0xd84d[_0x215a07];return _0x3dbf94;};'use strict';var multer=require(_0xdd84('0x0'));var util=require('util');var path=require(_0xdd84('0x1'));var timeout=require(_0xdd84('0x2'));var express=require(_0xdd84('0x3'));var router=express[_0xdd84('0x4')]();var fs_extra=require(_0xdd84('0x5'));var auth=require(_0xdd84('0x6'));var interaction=require(_0xdd84('0x7'));var config=require(_0xdd84('0x8'));var controller=require('./migration.controller');router[_0xdd84('0x9')]('/',controller[_0xdd84('0xa')]);module[_0xdd84('0xb')]=router;
\ No newline at end of file
index 069ae98..9e964bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x485b=['version','sequelize','exports','STRING'];(function(_0x1ef5ab,_0x3edd2c){var _0x49b930=function(_0x57c0e1){while(--_0x57c0e1){_0x1ef5ab['push'](_0x1ef5ab['shift']());}};_0x49b930(++_0x3edd2c);}(_0x485b,0xb9));var _0xb485=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x485b[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0xb485('0x0'));module[_0xb485('0x1')]={'version':{'type':Sequelize[_0xb485('0x2')],'unique':_0xb485('0x3')}};
\ No newline at end of file
+var _0x70b7=['STRING','version','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70b7,0x119));var _0x770b=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x70b7[_0x5e4563];return _0x8d1bf5;};'use strict';var Sequelize=require('sequelize');module[_0x770b('0x0')]={'version':{'type':Sequelize[_0x770b('0x1')],'unique':_0x770b('0x2')}};
\ No newline at end of file
index cc93e77..7972670 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5889=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','options','includeAll','include','findAll','rows','catch','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Migration','rawAttributes','key','model','query','intersection','attributes'];(function(_0x57931a,_0x4510ae){var _0x2bc51f=function(_0x301804){while(--_0x301804){_0x57931a['push'](_0x57931a['shift']());}};_0x2bc51f(++_0x4510ae);}(_0x5889,0x95));var _0x9588=function(_0x3be7de,_0x298c7a){_0x3be7de=_0x3be7de-0x0;var _0x4f876d=_0x5889[_0x3be7de];return _0x4f876d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9588('0x0'));var zipdir=require(_0x9588('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9588('0x2'));var BPromise=require(_0x9588('0x3'));var Mustache=require('mustache');var util=require(_0x9588('0x4'));var path=require(_0x9588('0x5'));var sox=require(_0x9588('0x6'));var csv=require(_0x9588('0x7'));var ejs=require(_0x9588('0x8'));var fs=require('fs');var fs_extra=require(_0x9588('0x9'));var _=require(_0x9588('0xa'));var squel=require(_0x9588('0xb'));var crypto=require('crypto');var jsforce=require(_0x9588('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9588('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9588('0xd'));var qs=require(_0x9588('0xe'));var as=require(_0x9588('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9588('0x10'));var utils=require(_0x9588('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x9588('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a7c95,_0x5b08fe){_0x5b08fe=_0x5b08fe||0xcc;return function(_0x2be6f){if(_0x2be6f){return _0x3a7c95[_0x9588('0x13')](_0x5b08fe);}return _0x3a7c95[_0x9588('0x14')](_0x5b08fe)[_0x9588('0x15')]();};}function respondWithResult(_0x4d0cfa,_0x177727){_0x177727=_0x177727||0xc8;return function(_0x309fc8){if(_0x309fc8){return _0x4d0cfa[_0x9588('0x14')](_0x177727)[_0x9588('0x16')](_0x309fc8);}};}function respondWithFilteredResult(_0x274fa4,_0x8e9868){return function(_0x3719c5){if(_0x3719c5){var _0x337968=typeof _0x8e9868[_0x9588('0x17')]==='undefined'&&typeof _0x8e9868[_0x9588('0x18')]===_0x9588('0x19');var _0x4e91bb=_0x3719c5[_0x9588('0x1a')];var _0x20d0b5=_0x337968?0x0:_0x8e9868[_0x9588('0x17')];var _0x1f2041=_0x337968?_0x3719c5[_0x9588('0x1a')]:_0x8e9868['offset']+_0x8e9868[_0x9588('0x18')];var _0x14a978;if(_0x1f2041>=_0x4e91bb){_0x1f2041=_0x4e91bb;_0x14a978=0xc8;}else{_0x14a978=0xce;}_0x274fa4[_0x9588('0x14')](_0x14a978);return _0x274fa4[_0x9588('0x1b')](_0x9588('0x1c'),_0x20d0b5+'-'+_0x1f2041+'/'+_0x4e91bb)[_0x9588('0x16')](_0x3719c5);}return null;};}function patchUpdates(_0x49834c){return function(_0x388801){try{jsonpatch[_0x9588('0x1d')](_0x388801,_0x49834c,!![]);}catch(_0x356d39){return BPromise[_0x9588('0x1e')](_0x356d39);}return _0x388801[_0x9588('0x1f')]();};}function saveUpdates(_0x189b42,_0x298c28){return function(_0xd7e648){if(_0xd7e648){return _0xd7e648[_0x9588('0x20')](_0x189b42)[_0x9588('0x21')](function(_0xb01b94){return _0xb01b94;});}return null;};}function removeEntity(_0x17001a,_0x219a7b){return function(_0x49d830){if(_0x49d830){return _0x49d830[_0x9588('0x22')]()['then'](function(){_0x17001a[_0x9588('0x14')](0xcc)[_0x9588('0x15')]();});}};}function handleEntityNotFound(_0x2ee407,_0x2d0e48){return function(_0x5a1d13){if(!_0x5a1d13){_0x2ee407[_0x9588('0x13')](0x194);}return _0x5a1d13;};}function handleError(_0x3b4956,_0x3c2204){_0x3c2204=_0x3c2204||0x1f4;return function(_0x9efb46){logger[_0x9588('0x23')](_0x9efb46[_0x9588('0x24')]);if(_0x9efb46[_0x9588('0x25')]){delete _0x9efb46[_0x9588('0x25')];}_0x3b4956[_0x9588('0x14')](_0x3c2204)['send'](_0x9efb46);};}exports[_0x9588('0x26')]=function(_0x5777b1,_0xbdb408){var _0x3cf22c={},_0x4ad4a9={},_0x542e86={'count':0x0,'rows':[]};var _0x22ebeb=_['map'](db[_0x9588('0x27')][_0x9588('0x28')],function(_0x32fd82){return{'name':_0x32fd82['fieldName'],'type':_0x32fd82['type'][_0x9588('0x29')]};});_0x4ad4a9[_0x9588('0x2a')]=_['map'](_0x22ebeb,_0x9588('0x25'));_0x4ad4a9['query']=_['keys'](_0x5777b1[_0x9588('0x2b')]);_0x4ad4a9['filters']=_[_0x9588('0x2c')](_0x4ad4a9[_0x9588('0x2a')],_0x4ad4a9[_0x9588('0x2b')]);_0x3cf22c[_0x9588('0x2d')]=_[_0x9588('0x2c')](_0x4ad4a9[_0x9588('0x2a')],qs[_0x9588('0x2e')](_0x5777b1['query']['fields']));_0x3cf22c['attributes']=_0x3cf22c[_0x9588('0x2d')][_0x9588('0x2f')]?_0x3cf22c[_0x9588('0x2d')]:_0x4ad4a9[_0x9588('0x2a')];if(!_0x5777b1[_0x9588('0x2b')][_0x9588('0x30')](_0x9588('0x31'))){_0x3cf22c[_0x9588('0x18')]=qs[_0x9588('0x18')](_0x5777b1['query']['limit']);_0x3cf22c[_0x9588('0x17')]=qs[_0x9588('0x17')](_0x5777b1['query'][_0x9588('0x17')]);}_0x3cf22c[_0x9588('0x32')]=qs[_0x9588('0x33')](_0x5777b1[_0x9588('0x2b')][_0x9588('0x33')]);_0x3cf22c[_0x9588('0x34')]=qs['filters'](_[_0x9588('0x35')](_0x5777b1[_0x9588('0x2b')],_0x4ad4a9[_0x9588('0x36')]),_0x22ebeb);if(_0x5777b1[_0x9588('0x2b')][_0x9588('0x37')]){_0x3cf22c['where']=_[_0x9588('0x38')](_0x3cf22c[_0x9588('0x34')],{'$or':_[_0x9588('0x39')](_0x22ebeb,function(_0x235940){if(_0x235940[_0x9588('0x3a')]!=='VIRTUAL'){var _0xd93c9a={};_0xd93c9a[_0x235940[_0x9588('0x25')]]={'$like':'%'+_0x5777b1[_0x9588('0x2b')][_0x9588('0x37')]+'%'};return _0xd93c9a;}})});}_0x3cf22c=_[_0x9588('0x38')]({},_0x3cf22c,_0x5777b1[_0x9588('0x3b')]);var _0x287609={'where':_0x3cf22c[_0x9588('0x34')]};return db[_0x9588('0x27')][_0x9588('0x1a')](_0x287609)[_0x9588('0x21')](function(_0x50ab35){_0x542e86[_0x9588('0x1a')]=_0x50ab35;if(_0x5777b1[_0x9588('0x2b')][_0x9588('0x3c')]){_0x3cf22c[_0x9588('0x3d')]=[{'all':!![]}];}return db['Migration'][_0x9588('0x3e')](_0x3cf22c);})[_0x9588('0x21')](function(_0x467fff){_0x542e86[_0x9588('0x3f')]=_0x467fff;return _0x542e86;})[_0x9588('0x21')](respondWithFilteredResult(_0xbdb408,_0x3cf22c))[_0x9588('0x40')](handleError(_0xbdb408,null));};
\ No newline at end of file
+var _0xa0f5=['nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xa0f5,0x164));var _0x5a0f=function(_0x1a1562,_0x16dc3e){_0x1a1562=_0x1a1562-0x0;var _0x3f3b9c=_0xa0f5[_0x1a1562];return _0x3f3b9c;};'use strict';var emlformat=require(_0x5a0f('0x0'));var rimraf=require(_0x5a0f('0x1'));var zipdir=require(_0x5a0f('0x2'));var jsonpatch=require(_0x5a0f('0x3'));var rp=require(_0x5a0f('0x4'));var moment=require(_0x5a0f('0x5'));var BPromise=require(_0x5a0f('0x6'));var Mustache=require(_0x5a0f('0x7'));var util=require(_0x5a0f('0x8'));var path=require(_0x5a0f('0x9'));var sox=require(_0x5a0f('0xa'));var csv=require(_0x5a0f('0xb'));var ejs=require(_0x5a0f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a0f('0xd'));var squel=require(_0x5a0f('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5a0f('0xf'));var Papa=require(_0x5a0f('0x10'));var Redis=require(_0x5a0f('0x11'));var authService=require(_0x5a0f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5a0f('0x13'));var hardwareService=require(_0x5a0f('0x14'));var logger=require('../../config/logger')(_0x5a0f('0x15'));var utils=require(_0x5a0f('0x16'));var config=require(_0x5a0f('0x17'));var licenseUtil=require(_0x5a0f('0x18'));var db=require(_0x5a0f('0x19'))['db'];function respondWithStatusCode(_0x32a7c4,_0x4f5052){_0x4f5052=_0x4f5052||0xcc;return function(_0x2e9e09){if(_0x2e9e09){return _0x32a7c4[_0x5a0f('0x1a')](_0x4f5052);}return _0x32a7c4[_0x5a0f('0x1b')](_0x4f5052)[_0x5a0f('0x1c')]();};}function respondWithResult(_0x4b0f54,_0x34e267){_0x34e267=_0x34e267||0xc8;return function(_0x105611){if(_0x105611){return _0x4b0f54[_0x5a0f('0x1b')](_0x34e267)[_0x5a0f('0x1d')](_0x105611);}};}function respondWithFilteredResult(_0xda83a9,_0x28118d){return function(_0x4246b6){if(_0x4246b6){var _0x351d87=typeof _0x28118d[_0x5a0f('0x1e')]===_0x5a0f('0x1f')&&typeof _0x28118d[_0x5a0f('0x20')]===_0x5a0f('0x1f');var _0x52042c=_0x4246b6[_0x5a0f('0x21')];var _0x5049e5=_0x351d87?0x0:_0x28118d[_0x5a0f('0x1e')];var _0x3cf21a=_0x351d87?_0x4246b6['count']:_0x28118d[_0x5a0f('0x1e')]+_0x28118d[_0x5a0f('0x20')];var _0x1817e4;if(_0x3cf21a>=_0x52042c){_0x3cf21a=_0x52042c;_0x1817e4=0xc8;}else{_0x1817e4=0xce;}_0xda83a9[_0x5a0f('0x1b')](_0x1817e4);return _0xda83a9[_0x5a0f('0x22')]('Content-Range',_0x5049e5+'-'+_0x3cf21a+'/'+_0x52042c)[_0x5a0f('0x1d')](_0x4246b6);}return null;};}function patchUpdates(_0x4c9ec5){return function(_0x334347){try{jsonpatch[_0x5a0f('0x23')](_0x334347,_0x4c9ec5,!![]);}catch(_0xc54ce5){return BPromise[_0x5a0f('0x24')](_0xc54ce5);}return _0x334347[_0x5a0f('0x25')]();};}function saveUpdates(_0x56a2cb,_0x1829f0){return function(_0x48fe1f){if(_0x48fe1f){return _0x48fe1f[_0x5a0f('0x26')](_0x56a2cb)[_0x5a0f('0x27')](function(_0xc825ac){return _0xc825ac;});}return null;};}function removeEntity(_0x9413b0,_0x29947c){return function(_0x10b848){if(_0x10b848){return _0x10b848['destroy']()[_0x5a0f('0x27')](function(){_0x9413b0['status'](0xcc)[_0x5a0f('0x1c')]();});}};}function handleEntityNotFound(_0x4fe323,_0x35f567){return function(_0x5803be){if(!_0x5803be){_0x4fe323[_0x5a0f('0x1a')](0x194);}return _0x5803be;};}function handleError(_0x56ca9b,_0x3db2e2){_0x3db2e2=_0x3db2e2||0x1f4;return function(_0x12ead6){logger[_0x5a0f('0x28')](_0x12ead6[_0x5a0f('0x29')]);if(_0x12ead6[_0x5a0f('0x2a')]){delete _0x12ead6[_0x5a0f('0x2a')];}_0x56ca9b[_0x5a0f('0x1b')](_0x3db2e2)[_0x5a0f('0x2b')](_0x12ead6);};}exports[_0x5a0f('0x2c')]=function(_0x325a18,_0x53e514){var _0x3db105={},_0x29fb74={},_0xc36b99={'count':0x0,'rows':[]};var _0x288f75=_[_0x5a0f('0x2d')](db[_0x5a0f('0x2e')][_0x5a0f('0x2f')],function(_0x5b0f34){return{'name':_0x5b0f34[_0x5a0f('0x30')],'type':_0x5b0f34[_0x5a0f('0x31')]['key']};});_0x29fb74[_0x5a0f('0x32')]=_[_0x5a0f('0x2d')](_0x288f75,_0x5a0f('0x2a'));_0x29fb74[_0x5a0f('0x33')]=_['keys'](_0x325a18['query']);_0x29fb74[_0x5a0f('0x34')]=_['intersection'](_0x29fb74[_0x5a0f('0x32')],_0x29fb74['query']);_0x3db105[_0x5a0f('0x35')]=_[_0x5a0f('0x36')](_0x29fb74['model'],qs[_0x5a0f('0x37')](_0x325a18[_0x5a0f('0x33')][_0x5a0f('0x37')]));_0x3db105[_0x5a0f('0x35')]=_0x3db105[_0x5a0f('0x35')][_0x5a0f('0x38')]?_0x3db105[_0x5a0f('0x35')]:_0x29fb74[_0x5a0f('0x32')];if(!_0x325a18[_0x5a0f('0x33')][_0x5a0f('0x39')](_0x5a0f('0x3a'))){_0x3db105['limit']=qs[_0x5a0f('0x20')](_0x325a18['query'][_0x5a0f('0x20')]);_0x3db105[_0x5a0f('0x1e')]=qs[_0x5a0f('0x1e')](_0x325a18[_0x5a0f('0x33')][_0x5a0f('0x1e')]);}_0x3db105['order']=qs[_0x5a0f('0x3b')](_0x325a18['query']['sort']);_0x3db105[_0x5a0f('0x3c')]=qs[_0x5a0f('0x34')](_['pick'](_0x325a18[_0x5a0f('0x33')],_0x29fb74[_0x5a0f('0x34')]),_0x288f75);if(_0x325a18[_0x5a0f('0x33')]['filter']){_0x3db105[_0x5a0f('0x3c')]=_['merge'](_0x3db105[_0x5a0f('0x3c')],{'$or':_[_0x5a0f('0x2d')](_0x288f75,function(_0x312882){if(_0x312882['type']!==_0x5a0f('0x3d')){var _0x4ab2ff={};_0x4ab2ff[_0x312882[_0x5a0f('0x2a')]]={'$like':'%'+_0x325a18['query'][_0x5a0f('0x3e')]+'%'};return _0x4ab2ff;}})});}_0x3db105=_[_0x5a0f('0x3f')]({},_0x3db105,_0x325a18[_0x5a0f('0x40')]);var _0x4e2f75={'where':_0x3db105[_0x5a0f('0x3c')]};return db[_0x5a0f('0x2e')][_0x5a0f('0x21')](_0x4e2f75)[_0x5a0f('0x27')](function(_0x3a5f66){_0xc36b99[_0x5a0f('0x21')]=_0x3a5f66;if(_0x325a18['query'][_0x5a0f('0x41')]){_0x3db105[_0x5a0f('0x42')]=[{'all':!![]}];}return db[_0x5a0f('0x2e')][_0x5a0f('0x43')](_0x3db105);})[_0x5a0f('0x27')](function(_0xf7d452){_0xc36b99[_0x5a0f('0x44')]=_0xf7d452;return _0xc36b99;})['then'](respondWithFilteredResult(_0x53e514,_0x3db105))['catch'](handleError(_0x53e514,null));};
\ No newline at end of file
index 00a0fd9..c41b0e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x572b=['./migration.attributes','exports','define','Migration','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4bf8b6,_0x2baec7){var _0x4e7375=function(_0xf80783){while(--_0xf80783){_0x4bf8b6['push'](_0x4bf8b6['shift']());}};_0x4e7375(++_0x2baec7);}(_0x572b,0x9e));var _0xb572=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x572b[_0x163040];return _0x364667;};'use strict';var _=require(_0xb572('0x0'));var util=require('util');var logger=require(_0xb572('0x1'))(_0xb572('0x2'));var moment=require(_0xb572('0x3'));var BPromise=require(_0xb572('0x4'));var rp=require(_0xb572('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb572('0x6'));var config=require('../../config/environment');var attributes=require(_0xb572('0x7'));module[_0xb572('0x8')]=function(_0x365ea6,_0x472b76){return _0x365ea6[_0xb572('0x9')](_0xb572('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x545a=['migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x545a,0x12d));var _0xa545=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x545a[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xa545('0x0'));var util=require('util');var logger=require(_0xa545('0x1'))(_0xa545('0x2'));var moment=require(_0xa545('0x3'));var BPromise=require(_0xa545('0x4'));var rp=require(_0xa545('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa545('0x6'));var config=require(_0xa545('0x7'));var attributes=require(_0xa545('0x8'));module[_0xa545('0x9')]=function(_0x5590b8,_0x5871e5){return _0x5590b8[_0xa545('0xa')]('Migration',attributes,{'tableName':_0xa545('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4a86d75..f4bed0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3750=['then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3ddb4e,_0x5d9ecf){var _0x16202e=function(_0x505a25){while(--_0x505a25){_0x3ddb4e['push'](_0x3ddb4e['shift']());}};_0x16202e(++_0x5d9ecf);}(_0x3750,0xbb));var _0x0375=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0x3750[_0x41cfd4];return _0x190f48;};'use strict';var _=require(_0x0375('0x0'));var util=require(_0x0375('0x1'));var moment=require(_0x0375('0x2'));var BPromise=require(_0x0375('0x3'));var rs=require(_0x0375('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0375('0x5'))['db'];var utils=require(_0x0375('0x6'));var logger=require('../../config/logger')(_0x0375('0x7'));var config=require(_0x0375('0x8'));var jayson=require(_0x0375('0x9'));var client=jayson[_0x0375('0xa')][_0x0375('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43ba53,_0x4ccebd,_0x2fe0f9){return new BPromise(function(_0x42c111,_0x698f18){return client[_0x0375('0xc')](_0x43ba53,_0x2fe0f9)[_0x0375('0xd')](function(_0x15fd3d){logger['info'](_0x0375('0xe'),_0x4ccebd,_0x0375('0xf'));logger[_0x0375('0x10')](_0x0375('0x11'),_0x4ccebd,_0x0375('0xf'),JSON[_0x0375('0x12')](_0x15fd3d));if(_0x15fd3d[_0x0375('0x13')]){if(_0x15fd3d[_0x0375('0x13')][_0x0375('0x14')]===0x1f4){logger[_0x0375('0x13')](_0x0375('0xe'),_0x4ccebd,_0x15fd3d[_0x0375('0x13')]['message']);return _0x698f18(_0x15fd3d[_0x0375('0x13')]['message']);}logger[_0x0375('0x13')]('Migration,\x20%s,\x20%s',_0x4ccebd,_0x15fd3d[_0x0375('0x13')]['message']);return _0x42c111(_0x15fd3d[_0x0375('0x13')][_0x0375('0x15')]);}else{logger[_0x0375('0x16')](_0x0375('0xe'),_0x4ccebd,_0x0375('0xf'));_0x42c111(_0x15fd3d[_0x0375('0x17')][_0x0375('0x15')]);}})[_0x0375('0x18')](function(_0x378022){logger['error']('Migration,\x20%s,\x20%s',_0x4ccebd,_0x378022);_0x698f18(_0x378022);});});}
\ No newline at end of file
+var _0x8a1b=['Migration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x5d081f,_0x93a120){var _0x5a67ef=function(_0x38b796){while(--_0x38b796){_0x5d081f['push'](_0x5d081f['shift']());}};_0x5a67ef(++_0x93a120);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x4fe498,_0x151db7){_0x4fe498=_0x4fe498-0x0;var _0x53973e=_0x8a1b[_0x4fe498];return _0x53973e;};'use strict';var _=require(_0xb8a1('0x0'));var util=require(_0xb8a1('0x1'));var moment=require('moment');var BPromise=require(_0xb8a1('0x2'));var rs=require(_0xb8a1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8a1('0x4'));var logger=require(_0xb8a1('0x5'))(_0xb8a1('0x6'));var config=require(_0xb8a1('0x7'));var jayson=require(_0xb8a1('0x8'));var client=jayson['client'][_0xb8a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x444ef7,_0x1e8118,_0x3f34e5){return new BPromise(function(_0x2370d3,_0x546519){return client[_0xb8a1('0xa')](_0x444ef7,_0x3f34e5)['then'](function(_0x4e398a){logger[_0xb8a1('0xb')](_0xb8a1('0xc'),_0x1e8118,'request\x20sent');logger[_0xb8a1('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x1e8118,_0xb8a1('0xe'),JSON[_0xb8a1('0xf')](_0x4e398a));if(_0x4e398a[_0xb8a1('0x10')]){if(_0x4e398a[_0xb8a1('0x10')]['code']===0x1f4){logger[_0xb8a1('0x10')](_0xb8a1('0xc'),_0x1e8118,_0x4e398a[_0xb8a1('0x10')][_0xb8a1('0x11')]);return _0x546519(_0x4e398a['error'][_0xb8a1('0x11')]);}logger[_0xb8a1('0x10')](_0xb8a1('0xc'),_0x1e8118,_0x4e398a[_0xb8a1('0x10')][_0xb8a1('0x11')]);return _0x2370d3(_0x4e398a[_0xb8a1('0x10')][_0xb8a1('0x11')]);}else{logger[_0xb8a1('0xb')](_0xb8a1('0xc'),_0x1e8118,_0xb8a1('0xe'));_0x2370d3(_0x4e398a[_0xb8a1('0x12')]['message']);}})[_0xb8a1('0x13')](function(_0x3fed21){logger[_0xb8a1('0x10')](_0xb8a1('0xc'),_0x1e8118,_0x3fed21);_0x546519(_0x3fed21);});});}
\ No newline at end of file
index d22683e..f2a81a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eec=['create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x4c127d,_0x948d7b){var _0x3330b2=function(_0x452ccf){while(--_0x452ccf){_0x4c127d['push'](_0x4c127d['shift']());}};_0x3330b2(++_0x948d7b);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc6ee('0x0'));var util=require(_0xc6ee('0x1'));var path=require(_0xc6ee('0x2'));var timeout=require(_0xc6ee('0x3'));var express=require('express');var router=express[_0xc6ee('0x4')]();var fs_extra=require(_0xc6ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6ee('0x6'));var config=require(_0xc6ee('0x7'));var controller=require(_0xc6ee('0x8'));router[_0xc6ee('0x9')]('/',auth[_0xc6ee('0xa')](),controller[_0xc6ee('0xb')]);router[_0xc6ee('0x9')](_0xc6ee('0xc'),auth[_0xc6ee('0xa')](),controller['show']);router['post']('/',auth[_0xc6ee('0xa')](),controller[_0xc6ee('0xd')]);router['put'](_0xc6ee('0xc'),auth['isAuthenticated'](),controller[_0xc6ee('0xe')]);router[_0xc6ee('0xf')](_0xc6ee('0xc'),auth[_0xc6ee('0xa')](),controller['destroy']);module[_0xc6ee('0x10')]=router;
\ No newline at end of file
+var _0x41ec=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','util'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x41ec,0x143));var _0xc41e=function(_0x232d5c,_0x49302c){_0x232d5c=_0x232d5c-0x0;var _0x124f52=_0x41ec[_0x232d5c];return _0x124f52;};'use strict';var multer=require('multer');var util=require(_0xc41e('0x0'));var path=require('path');var timeout=require(_0xc41e('0x1'));var express=require(_0xc41e('0x2'));var router=express['Router']();var fs_extra=require(_0xc41e('0x3'));var auth=require(_0xc41e('0x4'));var interaction=require(_0xc41e('0x5'));var config=require(_0xc41e('0x6'));var controller=require(_0xc41e('0x7'));router[_0xc41e('0x8')]('/',auth[_0xc41e('0x9')](),controller[_0xc41e('0xa')]);router[_0xc41e('0x8')](_0xc41e('0xb'),auth[_0xc41e('0x9')](),controller['show']);router[_0xc41e('0xc')]('/',auth[_0xc41e('0x9')](),controller[_0xc41e('0xd')]);router[_0xc41e('0xe')](_0xc41e('0xb'),auth[_0xc41e('0x9')](),controller[_0xc41e('0xf')]);router[_0xc41e('0x10')](_0xc41e('0xb'),auth[_0xc41e('0x9')](),controller[_0xc41e('0x11')]);module['exports']=router;
\ No newline at end of file
index 72519b4..bd075f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa38f=['ENUM','localnet','externip','stun','turn','STRING','sequelize'];(function(_0x16ac69,_0x1ae811){var _0x1c98f5=function(_0x18a188){while(--_0x18a188){_0x16ac69['push'](_0x16ac69['shift']());}};_0x1c98f5(++_0x1ae811);}(_0xa38f,0x109));var _0xfa38=function(_0x4438ce,_0x404f57){_0x4438ce=_0x4438ce-0x0;var _0x674fea=_0xa38f[_0x4438ce];return _0x674fea;};'use strict';var Sequelize=require(_0xfa38('0x0'));module['exports']={'type':{'type':Sequelize[_0xfa38('0x1')](_0xfa38('0x2'),_0xfa38('0x3'),_0xfa38('0x4'),_0xfa38('0x5'))},'value':{'type':Sequelize[_0xfa38('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfa38('0x6')]}};
\ No newline at end of file
+var _0xdfd7=['localnet','externip','stun','turn','STRING','ENUM'];(function(_0x3f8b3b,_0x5b0ff5){var _0x524545=function(_0x221e0a){while(--_0x221e0a){_0x3f8b3b['push'](_0x3f8b3b['shift']());}};_0x524545(++_0x5b0ff5);}(_0xdfd7,0x9b));var _0x7dfd=function(_0x3024f7,_0xb451b7){_0x3024f7=_0x3024f7-0x0;var _0x4cf1ea=_0xdfd7[_0x3024f7];return _0x4cf1ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x7dfd('0x0')](_0x7dfd('0x1'),_0x7dfd('0x2'),_0x7dfd('0x3'),_0x7dfd('0x4'))},'value':{'type':Sequelize[_0x7dfd('0x5')]},'username':{'type':Sequelize[_0x7dfd('0x5')]},'password':{'type':Sequelize[_0x7dfd('0x5')]}};
\ No newline at end of file
index 1da31c0..9e536b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23f2=['find','create','sequelize','transaction','body','findAll','toUpperCase','STUN','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','root','server/files/templates/turn_multiple.ejs','readFileSync','server/files/templates/network.ejs','toLowerCase','chan_sip.so','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','show','params','includeAll','include'];(function(_0x2673c1,_0x489c00){var _0x46bde=function(_0x3c7b08){while(--_0x3c7b08){_0x2673c1['push'](_0x2673c1['shift']());}};_0x46bde(++_0x489c00);}(_0x23f2,0x1ce));var _0x223f=function(_0x363b4e,_0x2a880e){_0x363b4e=_0x363b4e-0x0;var _0x194f6c=_0x23f2[_0x363b4e];return _0x194f6c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x223f('0x0'));var zipdir=require(_0x223f('0x1'));var jsonpatch=require(_0x223f('0x2'));var rp=require(_0x223f('0x3'));var moment=require('moment');var BPromise=require(_0x223f('0x4'));var Mustache=require(_0x223f('0x5'));var util=require(_0x223f('0x6'));var path=require(_0x223f('0x7'));var sox=require(_0x223f('0x8'));var csv=require(_0x223f('0x9'));var ejs=require(_0x223f('0xa'));var fs=require('fs');var fs_extra=require(_0x223f('0xb'));var _=require('lodash');var squel=require(_0x223f('0xc'));var crypto=require(_0x223f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x223f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x223f('0xf'));var Papa=require('papaparse');var Redis=require(_0x223f('0x10'));var authService=require(_0x223f('0x11'));var qs=require(_0x223f('0x12'));var as=require(_0x223f('0x13'));var hardwareService=require(_0x223f('0x14'));var logger=require(_0x223f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x223f('0x16'));var licenseUtil=require(_0x223f('0x17'));var db=require(_0x223f('0x18'))['db'];var jayson=require(_0x223f('0x19'));var client=jayson['client'][_0x223f('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1bd58a,_0x12fb36,_0x5bdb9b,_0x545207){return new BPromise(function(_0x5a1e8b,_0x15391d){var _0x12542a=_0x545207||client;return _0x12542a['request'](_0x1bd58a,_0x5bdb9b)['then'](function(_0x360565){logger[_0x223f('0x1b')](_0x223f('0x1c'),_0x12fb36,_0x223f('0x1d'));logger[_0x223f('0x1e')](_0x223f('0x1f'),_0x12fb36,_0x223f('0x1d'),JSON[_0x223f('0x20')](_0x360565));if(_0x360565[_0x223f('0x21')]){if(_0x360565[_0x223f('0x21')][_0x223f('0x22')]===0x1f4){logger[_0x223f('0x21')](_0x223f('0x1c'),_0x12fb36,_0x360565[_0x223f('0x21')][_0x223f('0x23')]);return _0x15391d(_0x360565[_0x223f('0x21')][_0x223f('0x23')]);}logger[_0x223f('0x21')](_0x223f('0x1c'),_0x12fb36,_0x360565[_0x223f('0x21')]['message']);return _0x5a1e8b(_0x360565[_0x223f('0x21')][_0x223f('0x23')]);}else{logger[_0x223f('0x1b')](_0x223f('0x1c'),_0x12fb36,_0x223f('0x1d'));_0x5a1e8b(_0x360565[_0x223f('0x24')]['message']);}})[_0x223f('0x25')](function(_0x4e36bd){logger[_0x223f('0x21')](_0x223f('0x1c'),_0x12fb36,_0x4e36bd);_0x15391d(_0x4e36bd);});});}function respondWithStatusCode(_0x5e3bdb,_0x132b94){_0x132b94=_0x132b94||0xcc;return function(_0x827ebc){if(_0x827ebc){return _0x5e3bdb[_0x223f('0x26')](_0x132b94);}return _0x5e3bdb[_0x223f('0x27')](_0x132b94)[_0x223f('0x28')]();};}function respondWithResult(_0x4c6e7b,_0x20cbd0){_0x20cbd0=_0x20cbd0||0xc8;return function(_0x545afb){if(_0x545afb){return _0x4c6e7b['status'](_0x20cbd0)[_0x223f('0x29')](_0x545afb);}};}function respondWithFilteredResult(_0x3fc8f5,_0x22c250){return function(_0x4285e1){if(_0x4285e1){var _0x41666b=typeof _0x22c250['offset']===_0x223f('0x2a')&&typeof _0x22c250['limit']==='undefined';var _0x1683fd=_0x4285e1[_0x223f('0x2b')];var _0x5433c6=_0x41666b?0x0:_0x22c250[_0x223f('0x2c')];var _0x15a45f=_0x41666b?_0x4285e1['count']:_0x22c250[_0x223f('0x2c')]+_0x22c250[_0x223f('0x2d')];var _0x1a629e;if(_0x15a45f>=_0x1683fd){_0x15a45f=_0x1683fd;_0x1a629e=0xc8;}else{_0x1a629e=0xce;}_0x3fc8f5[_0x223f('0x27')](_0x1a629e);return _0x3fc8f5[_0x223f('0x2e')]('Content-Range',_0x5433c6+'-'+_0x15a45f+'/'+_0x1683fd)['json'](_0x4285e1);}return null;};}function patchUpdates(_0x121a66){return function(_0x44ef3d){try{jsonpatch[_0x223f('0x2f')](_0x44ef3d,_0x121a66,!![]);}catch(_0x2b09ec){return BPromise[_0x223f('0x30')](_0x2b09ec);}return _0x44ef3d[_0x223f('0x31')]();};}function saveUpdates(_0x5ee3bd,_0x238e1c){return function(_0x5ebefb){if(_0x5ebefb){return _0x5ebefb[_0x223f('0x32')](_0x5ee3bd)[_0x223f('0x33')](function(_0x590635){return _0x590635;});}return null;};}function removeEntity(_0x5cfe63,_0x3449c6){return function(_0x29754e){if(_0x29754e){return _0x29754e[_0x223f('0x34')]()[_0x223f('0x33')](function(){_0x5cfe63[_0x223f('0x27')](0xcc)[_0x223f('0x28')]();});}};}function handleEntityNotFound(_0x4f478b,_0x356418){return function(_0xa41ea5){if(!_0xa41ea5){_0x4f478b['sendStatus'](0x194);}return _0xa41ea5;};}function handleError(_0x2f68cb,_0x54e438){_0x54e438=_0x54e438||0x1f4;return function(_0x36919a){logger[_0x223f('0x21')](_0x36919a[_0x223f('0x35')]);if(_0x36919a[_0x223f('0x36')]){delete _0x36919a[_0x223f('0x36')];}_0x2f68cb[_0x223f('0x27')](_0x54e438)[_0x223f('0x37')](_0x36919a);};}exports[_0x223f('0x38')]=function(_0x1d8212,_0x5611aa){var _0x306996={},_0xb4e5ee={},_0xd6e1f0={'count':0x0,'rows':[]};var _0x5600ee=_[_0x223f('0x39')](db[_0x223f('0x3a')][_0x223f('0x3b')],function(_0x306a98){return{'name':_0x306a98[_0x223f('0x3c')],'type':_0x306a98['type']['key']};});_0xb4e5ee[_0x223f('0x3d')]=_[_0x223f('0x39')](_0x5600ee,'name');_0xb4e5ee['query']=_[_0x223f('0x3e')](_0x1d8212[_0x223f('0x3f')]);_0xb4e5ee[_0x223f('0x40')]=_[_0x223f('0x41')](_0xb4e5ee[_0x223f('0x3d')],_0xb4e5ee['query']);_0x306996['attributes']=_[_0x223f('0x41')](_0xb4e5ee[_0x223f('0x3d')],qs[_0x223f('0x42')](_0x1d8212[_0x223f('0x3f')][_0x223f('0x42')]));_0x306996[_0x223f('0x43')]=_0x306996['attributes'][_0x223f('0x44')]?_0x306996[_0x223f('0x43')]:_0xb4e5ee[_0x223f('0x3d')];if(!_0x1d8212[_0x223f('0x3f')][_0x223f('0x45')]('nolimit')){_0x306996[_0x223f('0x2d')]=qs[_0x223f('0x2d')](_0x1d8212[_0x223f('0x3f')][_0x223f('0x2d')]);_0x306996['offset']=qs[_0x223f('0x2c')](_0x1d8212[_0x223f('0x3f')][_0x223f('0x2c')]);}_0x306996[_0x223f('0x46')]=qs[_0x223f('0x47')](_0x1d8212[_0x223f('0x3f')][_0x223f('0x47')]);_0x306996[_0x223f('0x48')]=qs['filters'](_[_0x223f('0x49')](_0x1d8212[_0x223f('0x3f')],_0xb4e5ee[_0x223f('0x40')]),_0x5600ee);if(_0x1d8212['query'][_0x223f('0x4a')]){_0x306996[_0x223f('0x48')]=_[_0x223f('0x4b')](_0x306996[_0x223f('0x48')],{'$or':_[_0x223f('0x39')](_0x5600ee,function(_0x33421e){if(_0x33421e[_0x223f('0x4c')]!==_0x223f('0x4d')){var _0x5e11a8={};_0x5e11a8[_0x33421e[_0x223f('0x36')]]={'$like':'%'+_0x1d8212[_0x223f('0x3f')][_0x223f('0x4a')]+'%'};return _0x5e11a8;}})});}_0x306996=_[_0x223f('0x4b')]({},_0x306996,_0x1d8212[_0x223f('0x4e')]);var _0x5592c1={'where':_0x306996[_0x223f('0x48')]};return db[_0x223f('0x3a')][_0x223f('0x2b')](_0x5592c1)[_0x223f('0x33')](function(_0x1f6f42){_0xd6e1f0[_0x223f('0x2b')]=_0x1f6f42;if(_0x1d8212[_0x223f('0x3f')]['includeAll']){_0x306996['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x306996);})[_0x223f('0x33')](function(_0x2b75ae){_0xd6e1f0['rows']=_0x2b75ae;return _0xd6e1f0;})[_0x223f('0x33')](respondWithFilteredResult(_0x5611aa,_0x306996))[_0x223f('0x25')](handleError(_0x5611aa,null));};exports[_0x223f('0x4f')]=function(_0x2c28b9,_0x9db143){var _0x591636={'raw':!![],'where':{'id':_0x2c28b9[_0x223f('0x50')]['id']}},_0x3b9e33={};_0x3b9e33[_0x223f('0x3d')]=_[_0x223f('0x3e')](db[_0x223f('0x3a')]['rawAttributes']);_0x3b9e33[_0x223f('0x3f')]=_[_0x223f('0x3e')](_0x2c28b9[_0x223f('0x3f')]);_0x3b9e33['filters']=_['intersection'](_0x3b9e33[_0x223f('0x3d')],_0x3b9e33['query']);_0x591636[_0x223f('0x43')]=_[_0x223f('0x41')](_0x3b9e33['model'],qs[_0x223f('0x42')](_0x2c28b9[_0x223f('0x3f')][_0x223f('0x42')]));_0x591636['attributes']=_0x591636[_0x223f('0x43')]['length']?_0x591636[_0x223f('0x43')]:_0x3b9e33[_0x223f('0x3d')];if(_0x2c28b9[_0x223f('0x3f')][_0x223f('0x51')]){_0x591636[_0x223f('0x52')]=[{'all':!![]}];}_0x591636=_[_0x223f('0x4b')]({},_0x591636,_0x2c28b9[_0x223f('0x4e')]);return db[_0x223f('0x3a')][_0x223f('0x53')](_0x591636)[_0x223f('0x33')](handleEntityNotFound(_0x9db143,null))[_0x223f('0x33')](respondWithResult(_0x9db143,null))[_0x223f('0x25')](handleError(_0x9db143,null));};exports[_0x223f('0x54')]=function(_0x607534,_0xe62739,_0x44a723){var _0x18b282;return db[_0x223f('0x55')][_0x223f('0x56')](function(_0x4c476b){return db[_0x223f('0x3a')]['create'](_0x607534[_0x223f('0x57')],{'raw':!![]})[_0x223f('0x33')](function(_0x43b2c1){_0x18b282=_0x43b2c1;return db[_0x223f('0x3a')][_0x223f('0x58')]({'where':{'type':_0x607534[_0x223f('0x57')]['type']},'raw':!![]});})['then'](function(_0x327e24){if(_0x18b282[_0x223f('0x4c')][_0x223f('0x59')]()==_0x223f('0x5a')){var _0x445ca3=fs['readFileSync'](path['join'](config['root'],_0x223f('0x5b')),_0x223f('0x5c'));var _0x5a5208=ejs[_0x223f('0x5d')](_0x445ca3,{'networks':_0x327e24||[]});fs[_0x223f('0x5e')](_0x223f('0x5f'),_0x5a5208);return respondWithRpcPromise(_0x223f('0x60'),_0x223f('0x54'),{'module':_0x223f('0x61')});}else if(_0x18b282['type'][_0x223f('0x59')]()==_0x223f('0x62')){var _0x3aa96f=fs['readFileSync'](path[_0x223f('0x63')](config[_0x223f('0x64')],_0x223f('0x65')),'utf8');var _0x1d7eea=ejs['render'](_0x3aa96f,{'networks':_0x327e24||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x1d7eea);return respondWithRpcPromise(_0x223f('0x60'),'create',{'module':_0x223f('0x61')});}else{var _0x12d843=fs[_0x223f('0x66')](path[_0x223f('0x63')](config[_0x223f('0x64')],_0x223f('0x67')),'utf8');var _0x48548f=ejs[_0x223f('0x5d')](_0x12d843,{'networks':_0x327e24||[]});fs[_0x223f('0x5e')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x607534['body']['type'][_0x223f('0x68')]()),_0x48548f);return respondWithRpcPromise(_0x223f('0x60'),_0x223f('0x54'),{'module':_0x223f('0x69')});}return null;})[_0x223f('0x33')](function(){return _0x18b282;});})[_0x223f('0x33')](respondWithResult(_0xe62739,0xc9))[_0x223f('0x25')](handleError(_0xe62739,null));};exports[_0x223f('0x32')]=function(_0x1738c9,_0x424adb,_0x344983){var _0x3c447d;return db[_0x223f('0x55')]['transaction'](function(_0x58306f){return db['Network']['find']({'where':{'id':_0x1738c9['params']['id']}})[_0x223f('0x33')](handleEntityNotFound(_0x424adb,null))[_0x223f('0x33')](saveUpdates(_0x1738c9[_0x223f('0x57')],null))[_0x223f('0x33')](function(_0x558bb3){if(_0x558bb3){_0x3c447d=_0x558bb3;return db[_0x223f('0x3a')][_0x223f('0x58')]({'where':{'type':_0x3c447d[_0x223f('0x4c')]},'raw':!![]});}return null;})[_0x223f('0x33')](function(_0x1fcda9){if(_0x3c447d[_0x223f('0x4c')][_0x223f('0x59')]()==_0x223f('0x5a')){var _0x1e52cd=fs[_0x223f('0x66')](path[_0x223f('0x63')](config[_0x223f('0x64')],'server/files/templates/stun_multiple.ejs'),_0x223f('0x5c'));var _0x43c139=ejs[_0x223f('0x5d')](_0x1e52cd,{'networks':_0x1fcda9||[]});fs[_0x223f('0x5e')](_0x223f('0x5f'),_0x43c139);return respondWithRpcPromise('Reload','update',{'module':_0x223f('0x61')});}else if(_0x3c447d[_0x223f('0x4c')][_0x223f('0x59')]()==_0x223f('0x62')){var _0xa012bd=fs[_0x223f('0x66')](path[_0x223f('0x63')](config[_0x223f('0x64')],_0x223f('0x65')),'utf8');var _0x91c500=ejs[_0x223f('0x5d')](_0xa012bd,{'networks':_0x1fcda9||[]});fs['writeFileSync'](_0x223f('0x6a'),_0x91c500);return respondWithRpcPromise('Reload','update',{'module':_0x223f('0x61')});}else{var _0x953f0f=fs[_0x223f('0x66')](path['join'](config[_0x223f('0x64')],_0x223f('0x67')),_0x223f('0x5c'));var _0x240877=ejs[_0x223f('0x5d')](_0x953f0f,{'networks':_0x1fcda9||[]});fs[_0x223f('0x5e')](util[_0x223f('0x6b')](_0x223f('0x6c'),_0x1738c9[_0x223f('0x57')][_0x223f('0x4c')]['toLowerCase']()),_0x240877);return respondWithRpcPromise(_0x223f('0x60'),_0x223f('0x32'),{'module':_0x223f('0x69')});}return null;})['then'](function(_0xa73c36){if(_0xa73c36){return _0x3c447d;}return null;});})[_0x223f('0x33')](respondWithResult(_0x424adb,null))[_0x223f('0x25')](handleError(_0x424adb,null));};exports[_0x223f('0x34')]=function(_0x5add3e,_0x4497b6,_0x369f83){var _0x20123e;return db['Network'][_0x223f('0x53')]({'where':{'id':_0x5add3e[_0x223f('0x50')]['id']}})[_0x223f('0x33')](function(_0x4db1ab){_0x20123e=_0x4db1ab;return _0x4db1ab;})[_0x223f('0x33')](handleEntityNotFound(_0x4497b6,null))[_0x223f('0x33')](removeEntity(_0x4497b6,null))['then'](function(){if(_0x20123e){return db['Network'][_0x223f('0x58')]({'where':{'type':_0x20123e[_0x223f('0x4c')]},'raw':!![]});}})[_0x223f('0x33')](function(_0x95b9a1){if(_0x20123e[_0x223f('0x4c')]['toUpperCase']()==_0x223f('0x5a')){var _0x4f3e5a=fs['readFileSync'](path[_0x223f('0x63')](config['root'],_0x223f('0x5b')),_0x223f('0x5c'));var _0x4c3b85=ejs[_0x223f('0x5d')](_0x4f3e5a,{'networks':_0x95b9a1||[]});fs[_0x223f('0x5e')]('/etc/asterisk/stun_xcally.conf',_0x4c3b85);return respondWithRpcPromise(_0x223f('0x60'),'destroy',{'module':_0x223f('0x61')});}else if(_0x20123e[_0x223f('0x4c')][_0x223f('0x59')]()=='TURN'){var _0x51d77c=fs[_0x223f('0x66')](path[_0x223f('0x63')](config[_0x223f('0x64')],_0x223f('0x65')),'utf8');var _0xfa489a=ejs[_0x223f('0x5d')](_0x51d77c,{'networks':_0x95b9a1||[]});fs[_0x223f('0x5e')](_0x223f('0x6a'),_0xfa489a);return respondWithRpcPromise(_0x223f('0x60'),_0x223f('0x34'),{'module':_0x223f('0x61')});}else{var _0x2497c1=fs[_0x223f('0x66')](path['join'](config[_0x223f('0x64')],_0x223f('0x67')),_0x223f('0x5c'));var _0x3066d4=ejs[_0x223f('0x5d')](_0x2497c1,{'networks':_0x95b9a1||[]});fs[_0x223f('0x5e')](util['format'](_0x223f('0x6c'),_0x5add3e[_0x223f('0x57')]['type'][_0x223f('0x68')]()),_0x3066d4);return respondWithRpcPromise(_0x223f('0x60'),'destroy',{'module':_0x223f('0x69')});}return null;})[_0x223f('0x25')](handleError(_0x4497b6,null));};
\ No newline at end of file
+var _0x7688=['server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','root','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','toLowerCase','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','Network,\x20%s,\x20%s','message','info','result','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','name','send','map','Network','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','options','find','create','sequelize','transaction','body','STUN','readFileSync','join'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x7688,0x152));var _0x8768=function(_0xe4be37,_0x55bc80){_0xe4be37=_0xe4be37-0x0;var _0x57b6b1=_0x7688[_0xe4be37];return _0x57b6b1;};'use strict';var emlformat=require(_0x8768('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8768('0x1'));var jsonpatch=require(_0x8768('0x2'));var rp=require('request-promise');var moment=require(_0x8768('0x3'));var BPromise=require(_0x8768('0x4'));var Mustache=require(_0x8768('0x5'));var util=require(_0x8768('0x6'));var path=require(_0x8768('0x7'));var sox=require(_0x8768('0x8'));var csv=require(_0x8768('0x9'));var ejs=require(_0x8768('0xa'));var fs=require('fs');var fs_extra=require(_0x8768('0xb'));var _=require(_0x8768('0xc'));var squel=require('squel');var crypto=require(_0x8768('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8768('0x9'));var querystring=require(_0x8768('0xe'));var Papa=require(_0x8768('0xf'));var Redis=require(_0x8768('0x10'));var authService=require(_0x8768('0x11'));var qs=require(_0x8768('0x12'));var as=require(_0x8768('0x13'));var hardwareService=require(_0x8768('0x14'));var logger=require(_0x8768('0x15'))(_0x8768('0x16'));var utils=require('../../config/utils');var config=require(_0x8768('0x17'));var licenseUtil=require(_0x8768('0x18'));var db=require(_0x8768('0x19'))['db'];var jayson=require(_0x8768('0x1a'));var client=jayson['client'][_0x8768('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1f0932,_0x5869bd,_0x29a28f,_0x558e65){return new BPromise(function(_0xc8dc46,_0x4b3e5f){var _0x21595c=_0x558e65||client;return _0x21595c[_0x8768('0x1c')](_0x1f0932,_0x29a28f)[_0x8768('0x1d')](function(_0x4d2364){logger['info']('Network,\x20%s,\x20%s',_0x5869bd,_0x8768('0x1e'));logger[_0x8768('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0x5869bd,_0x8768('0x1e'),JSON[_0x8768('0x20')](_0x4d2364));if(_0x4d2364[_0x8768('0x21')]){if(_0x4d2364[_0x8768('0x21')]['code']===0x1f4){logger[_0x8768('0x21')](_0x8768('0x22'),_0x5869bd,_0x4d2364[_0x8768('0x21')][_0x8768('0x23')]);return _0x4b3e5f(_0x4d2364['error'][_0x8768('0x23')]);}logger[_0x8768('0x21')](_0x8768('0x22'),_0x5869bd,_0x4d2364[_0x8768('0x21')][_0x8768('0x23')]);return _0xc8dc46(_0x4d2364[_0x8768('0x21')][_0x8768('0x23')]);}else{logger[_0x8768('0x24')](_0x8768('0x22'),_0x5869bd,'request\x20sent');_0xc8dc46(_0x4d2364[_0x8768('0x25')][_0x8768('0x23')]);}})['catch'](function(_0x60ac62){logger[_0x8768('0x21')](_0x8768('0x22'),_0x5869bd,_0x60ac62);_0x4b3e5f(_0x60ac62);});});}function respondWithStatusCode(_0x161ecc,_0x381d62){_0x381d62=_0x381d62||0xcc;return function(_0x47b1dd){if(_0x47b1dd){return _0x161ecc[_0x8768('0x26')](_0x381d62);}return _0x161ecc[_0x8768('0x27')](_0x381d62)[_0x8768('0x28')]();};}function respondWithResult(_0x2aa17f,_0x3f7591){_0x3f7591=_0x3f7591||0xc8;return function(_0x46e069){if(_0x46e069){return _0x2aa17f[_0x8768('0x27')](_0x3f7591)['json'](_0x46e069);}};}function respondWithFilteredResult(_0xeafaa3,_0x254f8b){return function(_0x469e0b){if(_0x469e0b){var _0x517ef0=typeof _0x254f8b[_0x8768('0x29')]===_0x8768('0x2a')&&typeof _0x254f8b[_0x8768('0x2b')]===_0x8768('0x2a');var _0x2ac02c=_0x469e0b['count'];var _0x224bb6=_0x517ef0?0x0:_0x254f8b['offset'];var _0x3f2280=_0x517ef0?_0x469e0b[_0x8768('0x2c')]:_0x254f8b[_0x8768('0x29')]+_0x254f8b[_0x8768('0x2b')];var _0x42563f;if(_0x3f2280>=_0x2ac02c){_0x3f2280=_0x2ac02c;_0x42563f=0xc8;}else{_0x42563f=0xce;}_0xeafaa3[_0x8768('0x27')](_0x42563f);return _0xeafaa3[_0x8768('0x2d')]('Content-Range',_0x224bb6+'-'+_0x3f2280+'/'+_0x2ac02c)[_0x8768('0x2e')](_0x469e0b);}return null;};}function patchUpdates(_0x6d86a6){return function(_0x23938c){try{jsonpatch[_0x8768('0x2f')](_0x23938c,_0x6d86a6,!![]);}catch(_0x5350bf){return BPromise[_0x8768('0x30')](_0x5350bf);}return _0x23938c[_0x8768('0x31')]();};}function saveUpdates(_0x3e6915,_0x3e02ae){return function(_0x206549){if(_0x206549){return _0x206549[_0x8768('0x32')](_0x3e6915)[_0x8768('0x1d')](function(_0x50683e){return _0x50683e;});}return null;};}function removeEntity(_0x1e1ea3,_0x5d6553){return function(_0x37cbc6){if(_0x37cbc6){return _0x37cbc6[_0x8768('0x33')]()[_0x8768('0x1d')](function(){_0x1e1ea3[_0x8768('0x27')](0xcc)[_0x8768('0x28')]();});}};}function handleEntityNotFound(_0x216b12,_0x245103){return function(_0x52df41){if(!_0x52df41){_0x216b12['sendStatus'](0x194);}return _0x52df41;};}function handleError(_0x9ee5e9,_0x4a59a8){_0x4a59a8=_0x4a59a8||0x1f4;return function(_0x36c967){logger[_0x8768('0x21')](_0x36c967[_0x8768('0x34')]);if(_0x36c967[_0x8768('0x35')]){delete _0x36c967[_0x8768('0x35')];}_0x9ee5e9[_0x8768('0x27')](_0x4a59a8)[_0x8768('0x36')](_0x36c967);};}exports['index']=function(_0x48fdea,_0xb98134){var _0x5f51cf={},_0x57f524={},_0x7f2cb9={'count':0x0,'rows':[]};var _0x4baa71=_[_0x8768('0x37')](db[_0x8768('0x38')][_0x8768('0x39')],function(_0x2e935c){return{'name':_0x2e935c['fieldName'],'type':_0x2e935c[_0x8768('0x3a')][_0x8768('0x3b')]};});_0x57f524[_0x8768('0x3c')]=_[_0x8768('0x37')](_0x4baa71,_0x8768('0x35'));_0x57f524[_0x8768('0x3d')]=_[_0x8768('0x3e')](_0x48fdea[_0x8768('0x3d')]);_0x57f524['filters']=_[_0x8768('0x3f')](_0x57f524[_0x8768('0x3c')],_0x57f524[_0x8768('0x3d')]);_0x5f51cf[_0x8768('0x40')]=_[_0x8768('0x3f')](_0x57f524[_0x8768('0x3c')],qs['fields'](_0x48fdea[_0x8768('0x3d')][_0x8768('0x41')]));_0x5f51cf['attributes']=_0x5f51cf[_0x8768('0x40')][_0x8768('0x42')]?_0x5f51cf[_0x8768('0x40')]:_0x57f524['model'];if(!_0x48fdea[_0x8768('0x3d')]['hasOwnProperty'](_0x8768('0x43'))){_0x5f51cf[_0x8768('0x2b')]=qs[_0x8768('0x2b')](_0x48fdea[_0x8768('0x3d')]['limit']);_0x5f51cf[_0x8768('0x29')]=qs[_0x8768('0x29')](_0x48fdea[_0x8768('0x3d')][_0x8768('0x29')]);}_0x5f51cf[_0x8768('0x44')]=qs[_0x8768('0x45')](_0x48fdea[_0x8768('0x3d')][_0x8768('0x45')]);_0x5f51cf[_0x8768('0x46')]=qs[_0x8768('0x47')](_[_0x8768('0x48')](_0x48fdea[_0x8768('0x3d')],_0x57f524['filters']),_0x4baa71);if(_0x48fdea[_0x8768('0x3d')][_0x8768('0x49')]){_0x5f51cf['where']=_[_0x8768('0x4a')](_0x5f51cf[_0x8768('0x46')],{'$or':_['map'](_0x4baa71,function(_0x15f5a4){if(_0x15f5a4[_0x8768('0x3a')]!==_0x8768('0x4b')){var _0x3d9c88={};_0x3d9c88[_0x15f5a4[_0x8768('0x35')]]={'$like':'%'+_0x48fdea[_0x8768('0x3d')][_0x8768('0x49')]+'%'};return _0x3d9c88;}})});}_0x5f51cf=_[_0x8768('0x4a')]({},_0x5f51cf,_0x48fdea['options']);var _0x35d87b={'where':_0x5f51cf[_0x8768('0x46')]};return db[_0x8768('0x38')][_0x8768('0x2c')](_0x35d87b)[_0x8768('0x1d')](function(_0x48bde0){_0x7f2cb9[_0x8768('0x2c')]=_0x48bde0;if(_0x48fdea[_0x8768('0x3d')][_0x8768('0x4c')]){_0x5f51cf[_0x8768('0x4d')]=[{'all':!![]}];}return db[_0x8768('0x38')][_0x8768('0x4e')](_0x5f51cf);})[_0x8768('0x1d')](function(_0x4df69c){_0x7f2cb9['rows']=_0x4df69c;return _0x7f2cb9;})[_0x8768('0x1d')](respondWithFilteredResult(_0xb98134,_0x5f51cf))[_0x8768('0x4f')](handleError(_0xb98134,null));};exports['show']=function(_0x3d4681,_0x192048){var _0x1b5d97={'raw':!![],'where':{'id':_0x3d4681[_0x8768('0x50')]['id']}},_0x2595b2={};_0x2595b2[_0x8768('0x3c')]=_[_0x8768('0x3e')](db['Network']['rawAttributes']);_0x2595b2[_0x8768('0x3d')]=_['keys'](_0x3d4681[_0x8768('0x3d')]);_0x2595b2[_0x8768('0x47')]=_['intersection'](_0x2595b2[_0x8768('0x3c')],_0x2595b2[_0x8768('0x3d')]);_0x1b5d97[_0x8768('0x40')]=_[_0x8768('0x3f')](_0x2595b2[_0x8768('0x3c')],qs[_0x8768('0x41')](_0x3d4681[_0x8768('0x3d')][_0x8768('0x41')]));_0x1b5d97[_0x8768('0x40')]=_0x1b5d97['attributes'][_0x8768('0x42')]?_0x1b5d97[_0x8768('0x40')]:_0x2595b2['model'];if(_0x3d4681[_0x8768('0x3d')]['includeAll']){_0x1b5d97[_0x8768('0x4d')]=[{'all':!![]}];}_0x1b5d97=_[_0x8768('0x4a')]({},_0x1b5d97,_0x3d4681[_0x8768('0x51')]);return db[_0x8768('0x38')][_0x8768('0x52')](_0x1b5d97)['then'](handleEntityNotFound(_0x192048,null))[_0x8768('0x1d')](respondWithResult(_0x192048,null))[_0x8768('0x4f')](handleError(_0x192048,null));};exports[_0x8768('0x53')]=function(_0x3104a2,_0x2d9823,_0x27af35){var _0x4c6d97;return db[_0x8768('0x54')][_0x8768('0x55')](function(_0x3d7a2d){return db['Network']['create'](_0x3104a2[_0x8768('0x56')],{'raw':!![]})[_0x8768('0x1d')](function(_0x31dd2e){_0x4c6d97=_0x31dd2e;return db[_0x8768('0x38')][_0x8768('0x4e')]({'where':{'type':_0x3104a2[_0x8768('0x56')][_0x8768('0x3a')]},'raw':!![]});})[_0x8768('0x1d')](function(_0x2f13c4){if(_0x4c6d97[_0x8768('0x3a')]['toUpperCase']()==_0x8768('0x57')){var _0x3b0990=fs[_0x8768('0x58')](path[_0x8768('0x59')](config['root'],_0x8768('0x5a')),_0x8768('0x5b'));var _0x1186aa=ejs['render'](_0x3b0990,{'networks':_0x2f13c4||[]});fs[_0x8768('0x5c')](_0x8768('0x5d'),_0x1186aa);return respondWithRpcPromise(_0x8768('0x5e'),'create',{'module':_0x8768('0x5f')});}else if(_0x4c6d97['type'][_0x8768('0x60')]()==_0x8768('0x61')){var _0x30ccfb=fs[_0x8768('0x58')](path[_0x8768('0x59')](config[_0x8768('0x62')],_0x8768('0x63')),'utf8');var _0x2dbdc4=ejs[_0x8768('0x64')](_0x30ccfb,{'networks':_0x2f13c4||[]});fs['writeFileSync'](_0x8768('0x65'),_0x2dbdc4);return respondWithRpcPromise(_0x8768('0x5e'),_0x8768('0x53'),{'module':'res_stun_monitor.so'});}else{var _0x45c387=fs[_0x8768('0x58')](path[_0x8768('0x59')](config[_0x8768('0x62')],_0x8768('0x66')),_0x8768('0x5b'));var _0x44b6da=ejs[_0x8768('0x64')](_0x45c387,{'networks':_0x2f13c4||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x3104a2[_0x8768('0x56')][_0x8768('0x3a')][_0x8768('0x67')]()),_0x44b6da);return respondWithRpcPromise('Reload',_0x8768('0x53'),{'module':'chan_sip.so'});}return null;})[_0x8768('0x1d')](function(){return _0x4c6d97;});})[_0x8768('0x1d')](respondWithResult(_0x2d9823,0xc9))[_0x8768('0x4f')](handleError(_0x2d9823,null));};exports[_0x8768('0x32')]=function(_0x3f551a,_0x12a3d2,_0x25d862){var _0x280737;return db['sequelize'][_0x8768('0x55')](function(_0x455913){return db[_0x8768('0x38')]['find']({'where':{'id':_0x3f551a[_0x8768('0x50')]['id']}})[_0x8768('0x1d')](handleEntityNotFound(_0x12a3d2,null))['then'](saveUpdates(_0x3f551a[_0x8768('0x56')],null))[_0x8768('0x1d')](function(_0x2cefcd){if(_0x2cefcd){_0x280737=_0x2cefcd;return db[_0x8768('0x38')]['findAll']({'where':{'type':_0x280737[_0x8768('0x3a')]},'raw':!![]});}return null;})['then'](function(_0x2b7edd){if(_0x280737['type']['toUpperCase']()=='STUN'){var _0x3bcb8b=fs[_0x8768('0x58')](path[_0x8768('0x59')](config[_0x8768('0x62')],_0x8768('0x5a')),_0x8768('0x5b'));var _0x56967a=ejs['render'](_0x3bcb8b,{'networks':_0x2b7edd||[]});fs[_0x8768('0x5c')](_0x8768('0x5d'),_0x56967a);return respondWithRpcPromise(_0x8768('0x5e'),_0x8768('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x280737[_0x8768('0x3a')][_0x8768('0x60')]()=='TURN'){var _0x85f394=fs[_0x8768('0x58')](path[_0x8768('0x59')](config[_0x8768('0x62')],_0x8768('0x63')),'utf8');var _0x18dfea=ejs[_0x8768('0x64')](_0x85f394,{'networks':_0x2b7edd||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x18dfea);return respondWithRpcPromise(_0x8768('0x5e'),'update',{'module':_0x8768('0x5f')});}else{var _0x1361f8=fs['readFileSync'](path[_0x8768('0x59')](config[_0x8768('0x62')],_0x8768('0x66')),_0x8768('0x5b'));var _0x4d35ab=ejs[_0x8768('0x64')](_0x1361f8,{'networks':_0x2b7edd||[]});fs['writeFileSync'](util[_0x8768('0x68')](_0x8768('0x69'),_0x3f551a['body'][_0x8768('0x3a')][_0x8768('0x67')]()),_0x4d35ab);return respondWithRpcPromise('Reload','update',{'module':_0x8768('0x6a')});}return null;})[_0x8768('0x1d')](function(_0x6243e9){if(_0x6243e9){return _0x280737;}return null;});})[_0x8768('0x1d')](respondWithResult(_0x12a3d2,null))[_0x8768('0x4f')](handleError(_0x12a3d2,null));};exports['destroy']=function(_0xb0180a,_0x2af345,_0x1e918b){var _0x585c80;return db[_0x8768('0x38')][_0x8768('0x52')]({'where':{'id':_0xb0180a['params']['id']}})[_0x8768('0x1d')](function(_0xfc9005){_0x585c80=_0xfc9005;return _0xfc9005;})[_0x8768('0x1d')](handleEntityNotFound(_0x2af345,null))[_0x8768('0x1d')](removeEntity(_0x2af345,null))['then'](function(){if(_0x585c80){return db[_0x8768('0x38')][_0x8768('0x4e')]({'where':{'type':_0x585c80['type']},'raw':!![]});}})[_0x8768('0x1d')](function(_0xde8931){if(_0x585c80[_0x8768('0x3a')][_0x8768('0x60')]()==_0x8768('0x57')){var _0x52ba2e=fs[_0x8768('0x58')](path[_0x8768('0x59')](config[_0x8768('0x62')],'server/files/templates/stun_multiple.ejs'),_0x8768('0x5b'));var _0x29d0ae=ejs['render'](_0x52ba2e,{'networks':_0xde8931||[]});fs['writeFileSync'](_0x8768('0x5d'),_0x29d0ae);return respondWithRpcPromise(_0x8768('0x5e'),'destroy',{'module':_0x8768('0x5f')});}else if(_0x585c80['type'][_0x8768('0x60')]()==_0x8768('0x61')){var _0x33ef6f=fs[_0x8768('0x58')](path['join'](config[_0x8768('0x62')],'server/files/templates/turn_multiple.ejs'),_0x8768('0x5b'));var _0x323d6e=ejs[_0x8768('0x64')](_0x33ef6f,{'networks':_0xde8931||[]});fs[_0x8768('0x5c')](_0x8768('0x65'),_0x323d6e);return respondWithRpcPromise('Reload','destroy',{'module':_0x8768('0x5f')});}else{var _0x511224=fs[_0x8768('0x58')](path['join'](config['root'],'server/files/templates/network.ejs'),_0x8768('0x5b'));var _0x32d71e=ejs[_0x8768('0x64')](_0x511224,{'networks':_0xde8931||[]});fs[_0x8768('0x5c')](util[_0x8768('0x68')]('/etc/asterisk/sip_xcally_%s.conf',_0xb0180a[_0x8768('0x56')][_0x8768('0x3a')][_0x8768('0x67')]()),_0x32d71e);return respondWithRpcPromise(_0x8768('0x5e'),'destroy',{'module':_0x8768('0x6a')});}return null;})[_0x8768('0x4f')](handleError(_0x2af345,null));};
\ No newline at end of file
index 64c3a3e..0f65a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1152=['moment','bluebird','request-promise','path','../../config/environment','exports','lodash','util','../../config/logger','api'];(function(_0x6aa676,_0x3f646a){var _0x2deb60=function(_0x174b1e){while(--_0x174b1e){_0x6aa676['push'](_0x6aa676['shift']());}};_0x2deb60(++_0x3f646a);}(_0x1152,0x182));var _0x2115=function(_0x5e28c2,_0x1e48ab){_0x5e28c2=_0x5e28c2-0x0;var _0x1a8cc6=_0x1152[_0x5e28c2];return _0x1a8cc6;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var logger=require(_0x2115('0x2'))(_0x2115('0x3'));var moment=require(_0x2115('0x4'));var BPromise=require(_0x2115('0x5'));var rp=require(_0x2115('0x6'));var fs=require('fs');var path=require(_0x2115('0x7'));var rimraf=require('rimraf');var config=require(_0x2115('0x8'));var attributes=require('./network.attributes');module[_0x2115('0x9')]=function(_0x241dcb,_0x51a3cf){return _0x241dcb['define']('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cc8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','Network','network','lodash','util','../../config/logger'];(function(_0xc7950c,_0x4d5e1a){var _0x3d3166=function(_0x2d2e83){while(--_0x2d2e83){_0xc7950c['push'](_0xc7950c['shift']());}};_0x3d3166(++_0x4d5e1a);}(_0x8cc8,0x177));var _0x88cc=function(_0x1dc40a,_0x18cc73){_0x1dc40a=_0x1dc40a-0x0;var _0x2d0109=_0x8cc8[_0x1dc40a];return _0x2d0109;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var logger=require(_0x88cc('0x2'))(_0x88cc('0x3'));var moment=require(_0x88cc('0x4'));var BPromise=require(_0x88cc('0x5'));var rp=require(_0x88cc('0x6'));var fs=require('fs');var path=require(_0x88cc('0x7'));var rimraf=require(_0x88cc('0x8'));var config=require(_0x88cc('0x9'));var attributes=require(_0x88cc('0xa'));module[_0x88cc('0xb')]=function(_0x1683f9,_0x525362){return _0x1683f9['define'](_0x88cc('0xc'),attributes,{'tableName':_0x88cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d08835a..60c30f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Network,\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(_0x5ea02a,_0x3e9680){_0x5ea02a=_0x5ea02a-0x0;var _0x34168c=_0x7a54[_0x5ea02a];return _0x34168c;};'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')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31fd5d,_0x4e3d30){var _0x4990c1=function(_0x179176){while(--_0x179176){_0x31fd5d['push'](_0x31fd5d['shift']());}};_0x4990c1(++_0x4e3d30);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
index 560efbb..257551d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8536=['send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getApplications','getInteractions','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/users'];(function(_0x4b8863,_0x516e99){var _0x1d8d48=function(_0x5cfff2){while(--_0x5cfff2){_0x4b8863['push'](_0x4b8863['shift']());}};_0x1d8d48(++_0x516e99);}(_0x8536,0x6b));var _0x6853=function(_0x1b8100,_0x2401c6){_0x1b8100=_0x1b8100-0x0;var _0x128417=_0x8536[_0x1b8100];return _0x128417;};'use strict';var multer=require('multer');var util=require(_0x6853('0x0'));var path=require(_0x6853('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6853('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6853('0x3'));var interaction=require(_0x6853('0x4'));var config=require('../../config/environment');var controller=require(_0x6853('0x5'));router[_0x6853('0x6')]('/',auth[_0x6853('0x7')](),controller[_0x6853('0x8')]);router['get']('/describe',auth[_0x6853('0x7')](),controller[_0x6853('0x9')]);router[_0x6853('0x6')](_0x6853('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x6853('0x6')](_0x6853('0xb'),auth['isAuthenticated'](),controller[_0x6853('0xc')]);router[_0x6853('0x6')]('/:id/canned_answers',auth[_0x6853('0x7')](),controller['getAnswers']);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0x6853('0xd')]);router['get']('/:id/interactions',auth[_0x6853('0x7')](),controller[_0x6853('0xe')]);router[_0x6853('0x6')]('/:id/users',auth[_0x6853('0x7')](),controller[_0x6853('0xf')]);router[_0x6853('0x10')]('/',auth[_0x6853('0x7')](),controller['create']);router['post'](_0x6853('0xb'),auth['isAuthenticated'](),controller[_0x6853('0x11')]);router[_0x6853('0x10')](_0x6853('0x12'),auth[_0x6853('0x7')](),controller[_0x6853('0x13')]);router[_0x6853('0x10')](_0x6853('0x14'),controller[_0x6853('0x15')]);router[_0x6853('0x10')](_0x6853('0x16'),auth['isAuthenticated'](),controller[_0x6853('0x17')]);router['post'](_0x6853('0x18'),auth[_0x6853('0x7')](),controller['addAgents']);router[_0x6853('0x10')]('/:id/send',auth[_0x6853('0x7')](),controller[_0x6853('0x19')]);router[_0x6853('0x1a')](_0x6853('0xa'),auth['isAuthenticated'](),controller[_0x6853('0x1b')]);router[_0x6853('0x1c')](_0x6853('0xa'),auth[_0x6853('0x7')](),controller[_0x6853('0x1d')]);router[_0x6853('0x1c')](_0x6853('0xb'),auth[_0x6853('0x7')](),controller[_0x6853('0x1e')]);router[_0x6853('0x1c')]('/:id/canned_answers',auth[_0x6853('0x7')](),controller[_0x6853('0x1f')]);router['delete'](_0x6853('0x18'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x6853('0x20')]=router;
\ No newline at end of file
+var _0x2fff=['index','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','/:id/dispositions','addDisposition','post','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x223da2,_0x3df833){var _0x305646=function(_0x14165e){while(--_0x14165e){_0x223da2['push'](_0x223da2['shift']());}};_0x305646(++_0x3df833);}(_0x2fff,0x1e2));var _0xf2ff=function(_0x335545,_0x2d0258){_0x335545=_0x335545-0x0;var _0x2d6293=_0x2fff[_0x335545];return _0x2d6293;};'use strict';var multer=require('multer');var util=require(_0xf2ff('0x0'));var path=require(_0xf2ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xf2ff('0x2'));var router=express['Router']();var fs_extra=require(_0xf2ff('0x3'));var auth=require(_0xf2ff('0x4'));var interaction=require(_0xf2ff('0x5'));var config=require(_0xf2ff('0x6'));var controller=require('./openchannelAccount.controller');router[_0xf2ff('0x7')]('/',auth['isAuthenticated'](),controller[_0xf2ff('0x8')]);router['get'](_0xf2ff('0x9'),auth[_0xf2ff('0xa')](),controller[_0xf2ff('0xb')]);router['get'](_0xf2ff('0xc'),auth[_0xf2ff('0xa')](),controller[_0xf2ff('0xd')]);router['get']('/:id/dispositions',auth[_0xf2ff('0xa')](),controller[_0xf2ff('0xe')]);router['get'](_0xf2ff('0xf'),auth[_0xf2ff('0xa')](),controller['getAnswers']);router[_0xf2ff('0x7')](_0xf2ff('0x10'),auth[_0xf2ff('0xa')](),controller[_0xf2ff('0x11')]);router['get'](_0xf2ff('0x12'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xf2ff('0x7')](_0xf2ff('0x13'),auth['isAuthenticated'](),controller[_0xf2ff('0x14')]);router['post']('/',auth[_0xf2ff('0xa')](),controller['create']);router['post'](_0xf2ff('0x15'),auth['isAuthenticated'](),controller[_0xf2ff('0x16')]);router['post'](_0xf2ff('0xf'),auth[_0xf2ff('0xa')](),controller['addAnswer']);router[_0xf2ff('0x17')](_0xf2ff('0x18'),controller[_0xf2ff('0x19')]);router[_0xf2ff('0x17')](_0xf2ff('0x10'),auth[_0xf2ff('0xa')](),controller[_0xf2ff('0x1a')]);router[_0xf2ff('0x17')](_0xf2ff('0x13'),auth['isAuthenticated'](),controller[_0xf2ff('0x1b')]);router[_0xf2ff('0x17')](_0xf2ff('0x1c'),auth[_0xf2ff('0xa')](),controller[_0xf2ff('0x1d')]);router[_0xf2ff('0x1e')](_0xf2ff('0xc'),auth[_0xf2ff('0xa')](),controller['update']);router[_0xf2ff('0x1f')]('/:id',auth[_0xf2ff('0xa')](),controller[_0xf2ff('0x20')]);router['delete']('/:id/dispositions',auth[_0xf2ff('0xa')](),controller[_0xf2ff('0x21')]);router['delete'](_0xf2ff('0xf'),auth[_0xf2ff('0xa')](),controller[_0xf2ff('0x22')]);router[_0xf2ff('0x1f')](_0xf2ff('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 70955f0..77f1c27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd94a=['STRING','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name'];(function(_0x3276a3,_0x2591b7){var _0x4da06b=function(_0xeb84fe){while(--_0xeb84fe){_0x3276a3['push'](_0x3276a3['shift']());}};_0x4da06b(++_0x2591b7);}(_0xd94a,0x143));var _0xad94=function(_0x400789,_0xd81bcd){_0x400789=_0x400789-0x0;var _0x36bb5f=_0xd94a[_0x400789];return _0x36bb5f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xad94('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xad94('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xad94('0x2')],'defaultValue':function(){return rs[_0xad94('0x3')]();}},'replyUri':{'type':Sequelize[_0xad94('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xad94('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xad94('0x4')],'defaultValue':function(){return _0xad94('0x5');}},'notificationSound':{'type':Sequelize[_0xad94('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xad94('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xad94('0x2')]},'queueTransfer':{'type':Sequelize[_0xad94('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xad94('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xad94('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xad94('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xad94('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xad94('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xad94('0x6')],'defaultValue':![],'comment':_0xad94('0x9'),'set':function(_0x599056){if(!_0x599056)this[_0xad94('0xa')](_0xad94('0xb'),null);this[_0xad94('0xa')](_0xad94('0xc'),_0x599056);}}};
\ No newline at end of file
+var _0x8c88=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x475c49,_0x4a23b2){var _0x395926=function(_0x3e3b4c){while(--_0x3e3b4c){_0x475c49['push'](_0x475c49['shift']());}};_0x395926(++_0x4a23b2);}(_0x8c88,0xa2));var _0x88c8=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8c88[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x88c8('0x0')]={'name':{'type':Sequelize[_0x88c8('0x1')],'unique':_0x88c8('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x88c8('0x1')]},'token':{'type':Sequelize[_0x88c8('0x1')],'defaultValue':function(){return rs[_0x88c8('0x3')]();}},'replyUri':{'type':Sequelize[_0x88c8('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x88c8('0x4')],'defaultValue':function(){return _0x88c8('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x88c8('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x88c8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x88c8('0x1')]},'queueTransfer':{'type':Sequelize[_0x88c8('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x88c8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x88c8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x88c8('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x88c8('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x88c8('0x6')],'defaultValue':![],'comment':_0x88c8('0x9'),'set':function(_0x1cd104){if(!_0x1cd104)this[_0x88c8('0xa')](_0x88c8('0xb'),null);this['setDataValue'](_0x88c8('0xc'),_0x1cd104);}}};
\ No newline at end of file
index 8fdd026..8fd50d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x620f=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','OpenchannelAccounts','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','order','rows','removeDispositions','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','OpenchannelApplication','account','applications','list','orderBy','priority','Applications','Contacts','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','close','OpenchannelMessage','UserId','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','getInteractions','User','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','body\x20is\x20mandatory\x20and\x20not\x20empty','out','dataValues','Messages','push','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2a34b4,_0x427e00){var _0x333fa0=function(_0x5de36e){while(--_0x5de36e){_0x2a34b4['push'](_0x2a34b4['shift']());}};_0x333fa0(++_0x427e00);}(_0x620f,0xa9));var _0xf620=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x620f[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xf620('0x0'));var rimraf=require(_0xf620('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf620('0x2'));var rp=require(_0xf620('0x3'));var moment=require(_0xf620('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf620('0x5'));var util=require(_0xf620('0x6'));var path=require('path');var sox=require(_0xf620('0x7'));var csv=require(_0xf620('0x8'));var ejs=require(_0xf620('0x9'));var fs=require('fs');var fs_extra=require(_0xf620('0xa'));var _=require(_0xf620('0xb'));var squel=require(_0xf620('0xc'));var crypto=require(_0xf620('0xd'));var jsforce=require(_0xf620('0xe'));var deskjs=require(_0xf620('0xf'));var toCsv=require(_0xf620('0x8'));var querystring=require('querystring');var Papa=require(_0xf620('0x10'));var Redis=require(_0xf620('0x11'));var authService=require(_0xf620('0x12'));var qs=require(_0xf620('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf620('0x14'));var logger=require(_0xf620('0x15'))(_0xf620('0x16'));var utils=require(_0xf620('0x17'));var config=require(_0xf620('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf620('0x19'))['db'];config['redis']=_[_0xf620('0x1a')](config[_0xf620('0x1b')],{'host':_0xf620('0x1c'),'port':0x18eb});var socket=require(_0xf620('0x1d'))(new Redis(config[_0xf620('0x1b')]));require(_0xf620('0x1e'))['register'](socket);var jayson=require(_0xf620('0x1f'));var client=jayson[_0xf620('0x20')][_0xf620('0x21')]({'port':0x232c});var client9002=jayson[_0xf620('0x20')][_0xf620('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xa159f2,_0xbc1366,_0x42ecc3,_0x524b8b){return new BPromise(function(_0x5b7157,_0x35a4bd){var _0x5be3ea=_0x524b8b||client;return _0x5be3ea[_0xf620('0x22')](_0xa159f2,_0x42ecc3)[_0xf620('0x23')](function(_0x284bab){logger['info'](_0xf620('0x24'),_0xbc1366,_0xf620('0x25'));logger['debug'](_0xf620('0x26'),_0xbc1366,'request\x20sent',JSON[_0xf620('0x27')](_0x284bab));if(_0x284bab[_0xf620('0x28')]){if(_0x284bab[_0xf620('0x28')][_0xf620('0x29')]===0x1f4){logger['error'](_0xf620('0x24'),_0xbc1366,_0x284bab[_0xf620('0x28')]['message']);return _0x35a4bd(_0x284bab[_0xf620('0x28')]['message']);}logger[_0xf620('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0xbc1366,_0x284bab[_0xf620('0x28')][_0xf620('0x2a')]);return _0x5b7157(_0x284bab[_0xf620('0x28')][_0xf620('0x2a')]);}else{logger[_0xf620('0x2b')](_0xf620('0x24'),_0xbc1366,_0xf620('0x25'));_0x5b7157(_0x284bab[_0xf620('0x2c')]['message']);}})[_0xf620('0x2d')](function(_0x5e690d){logger[_0xf620('0x28')](_0xf620('0x24'),_0xbc1366,_0x5e690d);_0x35a4bd(_0x5e690d);});});}function respondWithStatusCode(_0x315bef,_0x384cbc){_0x384cbc=_0x384cbc||0xcc;return function(_0x559cf4){if(_0x559cf4){return _0x315bef[_0xf620('0x2e')](_0x384cbc);}return _0x315bef[_0xf620('0x2f')](_0x384cbc)[_0xf620('0x30')]();};}function respondWithResult(_0x1b4f91,_0x2f9954){_0x2f9954=_0x2f9954||0xc8;return function(_0x217235){if(_0x217235){return _0x1b4f91[_0xf620('0x2f')](_0x2f9954)[_0xf620('0x31')](_0x217235);}};}function respondWithFilteredResult(_0xbb349c,_0x409ec6){return function(_0x584505){if(_0x584505){var _0x3c01c3=typeof _0x409ec6[_0xf620('0x32')]==='undefined'&&typeof _0x409ec6[_0xf620('0x33')]===_0xf620('0x34');var _0x19ee0a=_0x584505[_0xf620('0x35')];var _0x37ef92=_0x3c01c3?0x0:_0x409ec6['offset'];var _0x468644=_0x3c01c3?_0x584505[_0xf620('0x35')]:_0x409ec6[_0xf620('0x32')]+_0x409ec6[_0xf620('0x33')];var _0x5ac646;if(_0x468644>=_0x19ee0a){_0x468644=_0x19ee0a;_0x5ac646=0xc8;}else{_0x5ac646=0xce;}_0xbb349c[_0xf620('0x2f')](_0x5ac646);return _0xbb349c[_0xf620('0x36')](_0xf620('0x37'),_0x37ef92+'-'+_0x468644+'/'+_0x19ee0a)[_0xf620('0x31')](_0x584505);}return null;};}function patchUpdates(_0x5d767c){return function(_0x1ba75e){try{jsonpatch['apply'](_0x1ba75e,_0x5d767c,!![]);}catch(_0x34b63d){return BPromise[_0xf620('0x38')](_0x34b63d);}return _0x1ba75e[_0xf620('0x39')]();};}function saveUpdates(_0x1e20fc,_0x45f605){return function(_0x479193){if(_0x479193){return _0x479193[_0xf620('0x3a')](_0x1e20fc)['then'](function(_0x404f9f){return _0x404f9f;});}return null;};}function removeEntity(_0x3886f2,_0x26c682){return function(_0x429294){if(_0x429294){return _0x429294[_0xf620('0x3b')]()[_0xf620('0x23')](function(){var _0x27a1fd=_0x429294['get']({'plain':!![]});var _0x446d68=_0xf620('0x3c');return db['UserProfileResource'][_0xf620('0x3b')]({'where':{'type':_0x446d68,'resourceId':_0x27a1fd['id']}})['then'](function(){return _0x429294;});})[_0xf620('0x23')](function(){_0x3886f2[_0xf620('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb93c,_0x19f529){return function(_0x262613){if(!_0x262613){_0x4bb93c['sendStatus'](0x194);}return _0x262613;};}function handleError(_0x5d987b,_0x38afbf){_0x38afbf=_0x38afbf||0x1f4;return function(_0x71aa1f){logger[_0xf620('0x28')](_0x71aa1f['stack']);if(_0x71aa1f[_0xf620('0x3d')]){delete _0x71aa1f[_0xf620('0x3d')];}_0x5d987b[_0xf620('0x2f')](_0x38afbf)['send'](_0x71aa1f);};}exports[_0xf620('0x3e')]=function(_0x2b15f6,_0x422ccc){var _0x2c7841={'include':[{'model':db[_0xf620('0x3f')],'as':_0xf620('0x40')}]},_0x3a5443={},_0x26a77b={'count':0x0,'rows':[]};var _0x59e24c=_[_0xf620('0x41')](db[_0xf620('0x42')][_0xf620('0x43')],function(_0x231c77){return{'name':_0x231c77[_0xf620('0x44')],'type':_0x231c77[_0xf620('0x45')][_0xf620('0x46')]};});_0x3a5443['model']=_['map'](_0x59e24c,'name');_0x3a5443[_0xf620('0x47')]=_[_0xf620('0x48')](_0x2b15f6[_0xf620('0x47')]);_0x3a5443[_0xf620('0x49')]=_['intersection'](_0x3a5443[_0xf620('0x4a')],_0x3a5443[_0xf620('0x47')]);_0x2c7841[_0xf620('0x4b')]=_[_0xf620('0x4c')](_0x3a5443[_0xf620('0x4a')],qs[_0xf620('0x4d')](_0x2b15f6[_0xf620('0x47')]['fields']));_0x2c7841[_0xf620('0x4b')]=_0x2c7841['attributes'][_0xf620('0x4e')]?_0x2c7841[_0xf620('0x4b')]:_0x3a5443[_0xf620('0x4a')];if(!_0x2b15f6[_0xf620('0x47')][_0xf620('0x4f')](_0xf620('0x50'))){_0x2c7841[_0xf620('0x33')]=qs[_0xf620('0x33')](_0x2b15f6[_0xf620('0x47')][_0xf620('0x33')]);_0x2c7841[_0xf620('0x32')]=qs[_0xf620('0x32')](_0x2b15f6['query'][_0xf620('0x32')]);}_0x2c7841['order']=qs[_0xf620('0x51')](_0x2b15f6[_0xf620('0x47')][_0xf620('0x51')]);_0x2c7841[_0xf620('0x52')]=qs[_0xf620('0x49')](_[_0xf620('0x53')](_0x2b15f6[_0xf620('0x47')],_0x3a5443[_0xf620('0x49')]),_0x59e24c);if(_0x2b15f6[_0xf620('0x47')][_0xf620('0x54')]){_0x2c7841[_0xf620('0x52')]=_[_0xf620('0x55')](_0x2c7841['where'],{'$or':_[_0xf620('0x41')](_0x59e24c,function(_0x1032c9){if(_0x1032c9['type']!==_0xf620('0x56')){var _0x765dd2={};_0x765dd2[_0x1032c9[_0xf620('0x3d')]]={'$like':'%'+_0x2b15f6[_0xf620('0x47')][_0xf620('0x54')]+'%'};return _0x765dd2;}})});}_0x2c7841=_['merge']({},_0x2c7841,_0x2b15f6[_0xf620('0x57')]);var _0xe0af62={'where':_0x2c7841[_0xf620('0x52')]};return db['OpenchannelAccount'][_0xf620('0x35')](_0xe0af62)['then'](function(_0x129b54){_0x26a77b[_0xf620('0x35')]=_0x129b54;if(_0x2b15f6[_0xf620('0x47')][_0xf620('0x58')]){_0x2c7841[_0xf620('0x59')]=[{'all':!![]}];}return db[_0xf620('0x42')][_0xf620('0x5a')](_0x2c7841);})[_0xf620('0x23')](function(_0x193831){_0x26a77b['rows']=_0x193831;return _0x26a77b;})['then'](respondWithFilteredResult(_0x422ccc,_0x2c7841))[_0xf620('0x2d')](handleError(_0x422ccc,null));};exports[_0xf620('0x5b')]=function(_0x3a733a,_0x7397f){var _0x25db40={'raw':![],'where':{'id':_0x3a733a[_0xf620('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x48c9e8={};_0x48c9e8[_0xf620('0x4a')]=_[_0xf620('0x48')](db['OpenchannelAccount']['rawAttributes']);_0x48c9e8['query']=_[_0xf620('0x48')](_0x3a733a[_0xf620('0x47')]);_0x48c9e8[_0xf620('0x49')]=_['intersection'](_0x48c9e8[_0xf620('0x4a')],_0x48c9e8[_0xf620('0x47')]);_0x25db40[_0xf620('0x4b')]=_[_0xf620('0x4c')](_0x48c9e8[_0xf620('0x4a')],qs[_0xf620('0x4d')](_0x3a733a[_0xf620('0x47')]['fields']));_0x25db40[_0xf620('0x4b')]=_0x25db40[_0xf620('0x4b')][_0xf620('0x4e')]?_0x25db40['attributes']:_0x48c9e8[_0xf620('0x4a')];if(_0x3a733a[_0xf620('0x47')]['includeAll']){_0x25db40['include']=[{'all':!![]}];}_0x25db40=_[_0xf620('0x55')]({},_0x25db40,_0x3a733a['options']);return db[_0xf620('0x42')][_0xf620('0x5d')](_0x25db40)['then'](handleEntityNotFound(_0x7397f,null))[_0xf620('0x23')](respondWithResult(_0x7397f,null))[_0xf620('0x2d')](handleError(_0x7397f,null));};exports[_0xf620('0x5e')]=function(_0x435c77,_0xe32623){return db['OpenchannelAccount'][_0xf620('0x5e')](_0x435c77['body'],{})['then'](function(_0x32b669){var _0x5c16ef=_0x435c77[_0xf620('0x5f')][_0xf620('0x60')]({'plain':!![]});if(!_0x5c16ef)throw new Error(_0xf620('0x61'));if(_0x5c16ef[_0xf620('0x62')]===_0xf620('0x5f')){var _0x316c9d=_0x32b669[_0xf620('0x60')]({'plain':!![]});var _0xff30e4=_0xf620('0x3c');return db['UserProfileSection'][_0xf620('0x5d')]({'where':{'name':_0xff30e4,'userProfileId':_0x5c16ef[_0xf620('0x63')]},'raw':!![]})[_0xf620('0x23')](function(_0x21e7e2){if(_0x21e7e2&&_0x21e7e2['autoAssociation']===0x0){return db['UserProfileResource'][_0xf620('0x5e')]({'name':_0x316c9d[_0xf620('0x3d')],'resourceId':_0x316c9d['id'],'type':_0x21e7e2[_0xf620('0x3d')],'sectionId':_0x21e7e2['id']},{})[_0xf620('0x23')](function(){return _0x32b669;});}else{return _0x32b669;}})[_0xf620('0x2d')](function(_0x218c0f){logger['error'](_0xf620('0x64'),_0x218c0f);throw _0x218c0f;});}return _0x32b669;})['then'](respondWithResult(_0xe32623,0xc9))[_0xf620('0x2d')](handleError(_0xe32623,null));};exports[_0xf620('0x3a')]=function(_0x46681e,_0x204af4){if(_0x46681e['body']['id']){delete _0x46681e[_0xf620('0x65')]['id'];}return db[_0xf620('0x42')]['find']({'where':{'id':_0x46681e[_0xf620('0x5c')]['id']},'include':[{'model':db[_0xf620('0x3f')],'as':_0xf620('0x40')}]})[_0xf620('0x23')](handleEntityNotFound(_0x204af4,null))[_0xf620('0x23')](saveUpdates(_0x46681e[_0xf620('0x65')],null))[_0xf620('0x23')](respondWithResult(_0x204af4,null))[_0xf620('0x2d')](handleError(_0x204af4,null));};exports['destroy']=function(_0x5a8730,_0x1f65fb){return db[_0xf620('0x42')]['find']({'where':{'id':_0x5a8730[_0xf620('0x5c')]['id']}})[_0xf620('0x23')](handleEntityNotFound(_0x1f65fb,null))[_0xf620('0x23')](removeEntity(_0x1f65fb,null))[_0xf620('0x2d')](handleError(_0x1f65fb,null));};exports[_0xf620('0x66')]=function(_0x2b5661,_0x1a1166){return db[_0xf620('0x42')][_0xf620('0x66')]()[_0xf620('0x23')](respondWithResult(_0x1a1166,null))[_0xf620('0x2d')](handleError(_0x1a1166,null));};exports[_0xf620('0x67')]=function(_0x1b3c59,_0x278db7,_0x35755b){if(_0x1b3c59['body']['id']){delete _0x1b3c59[_0xf620('0x65')]['id'];}return db[_0xf620('0x42')][_0xf620('0x5d')]({'where':{'id':_0x1b3c59[_0xf620('0x5c')]['id']}})[_0xf620('0x23')](handleEntityNotFound(_0x278db7,null))['then'](function(_0x9bc827){if(_0x9bc827){_0x1b3c59['body'][_0xf620('0x68')]=_0x9bc827['id'];return db[_0xf620('0x69')][_0xf620('0x5e')](_0x1b3c59['body']);}})[_0xf620('0x23')](respondWithResult(_0x278db7,null))['catch'](handleError(_0x278db7,null));};exports[_0xf620('0x6a')]=function(_0x3d7aad,_0x46b65b,_0x285b3d){var _0x35f1c9={'raw':![],'where':{}};var _0x1691aa={};var _0xdfc872={'count':0x0,'rows':[]};return db[_0xf620('0x42')][_0xf620('0x6b')]({'where':{'id':_0x3d7aad[_0xf620('0x5c')]['id']}})['then'](handleEntityNotFound(_0x46b65b,null))[_0xf620('0x23')](function(_0x3a222e){if(_0x3a222e){_0x1691aa[_0xf620('0x4a')]=_[_0xf620('0x48')](db[_0xf620('0x69')][_0xf620('0x43')]);_0x1691aa[_0xf620('0x47')]=_['keys'](_0x3d7aad[_0xf620('0x47')]);_0x1691aa[_0xf620('0x49')]=_[_0xf620('0x4c')](_0x1691aa[_0xf620('0x4a')],_0x1691aa[_0xf620('0x47')]);_0x35f1c9[_0xf620('0x4b')]=_[_0xf620('0x4c')](_0x1691aa[_0xf620('0x4a')],qs[_0xf620('0x4d')](_0x3d7aad[_0xf620('0x47')][_0xf620('0x4d')]));_0x35f1c9[_0xf620('0x4b')]=_0x35f1c9[_0xf620('0x4b')][_0xf620('0x4e')]?_0x35f1c9[_0xf620('0x4b')]:_0x1691aa['model'];if(!_0x3d7aad[_0xf620('0x47')][_0xf620('0x4f')]('nolimit')){_0x35f1c9[_0xf620('0x33')]=qs[_0xf620('0x33')](_0x3d7aad['query'][_0xf620('0x33')]);_0x35f1c9[_0xf620('0x32')]=qs[_0xf620('0x32')](_0x3d7aad[_0xf620('0x47')][_0xf620('0x32')]);}_0x35f1c9[_0xf620('0x6c')]=qs[_0xf620('0x51')](_0x3d7aad['query'][_0xf620('0x51')]);_0x35f1c9['where']=qs['filters'](_[_0xf620('0x53')](_0x3d7aad['query'],_0x1691aa['filters']));_0x35f1c9['where'][_0xf620('0x68')]=_0x3a222e['id'];if(_0x3d7aad[_0xf620('0x47')][_0xf620('0x54')]){_0x35f1c9[_0xf620('0x52')]=_[_0xf620('0x55')](_0x35f1c9[_0xf620('0x52')],{'$or':_[_0xf620('0x41')](_0x35f1c9[_0xf620('0x4b')],function(_0x331007){var _0x5bfc40={};_0x5bfc40[_0x331007]={'$like':'%'+_0x3d7aad[_0xf620('0x47')][_0xf620('0x54')]+'%'};return _0x5bfc40;})});}_0x35f1c9=_[_0xf620('0x55')]({},_0x35f1c9,_0x3d7aad[_0xf620('0x57')]);return db[_0xf620('0x69')][_0xf620('0x35')]({'where':_0x35f1c9[_0xf620('0x52')]})[_0xf620('0x23')](function(_0x5799d3){_0xdfc872[_0xf620('0x35')]=_0x5799d3;if(_0x3d7aad[_0xf620('0x47')]['includeAll']){_0x35f1c9[_0xf620('0x59')]=[{'all':!![]}];}return db[_0xf620('0x69')]['findAll'](_0x35f1c9);})[_0xf620('0x23')](function(_0x109ae4){_0xdfc872[_0xf620('0x6d')]=_0x109ae4;return _0xdfc872;});}})[_0xf620('0x23')](respondWithFilteredResult(_0x46b65b,_0x35f1c9))[_0xf620('0x2d')](handleError(_0x46b65b,null));};exports[_0xf620('0x6e')]=function(_0x15546e,_0x369166,_0x5cd0d8){return db[_0xf620('0x42')]['find']({'where':{'id':_0x15546e['params']['id']}})['then'](handleEntityNotFound(_0x369166,null))['then'](function(_0x1f6c7a){if(_0x1f6c7a){return _0x1f6c7a[_0xf620('0x6e')](_0x15546e[_0xf620('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x369166,null))['catch'](handleError(_0x369166,null));};exports['addAnswer']=function(_0x34f495,_0x4426e3,_0x1477cc){if(_0x34f495[_0xf620('0x65')]['id']){delete _0x34f495['body']['id'];}return db[_0xf620('0x42')]['find']({'where':{'id':_0x34f495['params']['id']}})[_0xf620('0x23')](handleEntityNotFound(_0x4426e3,null))[_0xf620('0x23')](function(_0x582369){if(_0x582369){_0x34f495[_0xf620('0x65')][_0xf620('0x68')]=_0x582369['id'];return db['CannedAnswer'][_0xf620('0x5e')](_0x34f495[_0xf620('0x65')]);}})[_0xf620('0x23')](respondWithResult(_0x4426e3,null))[_0xf620('0x2d')](handleError(_0x4426e3,null));};exports['getAnswers']=function(_0x1eddb3,_0x27bff6,_0x1be5f2){var _0x54461a={'raw':![],'where':{}};var _0x3ee728={};var _0x455638={'count':0x0,'rows':[]};return db[_0xf620('0x42')][_0xf620('0x6b')]({'where':{'id':_0x1eddb3[_0xf620('0x5c')]['id']}})[_0xf620('0x23')](handleEntityNotFound(_0x27bff6,null))['then'](function(_0x566187){if(_0x566187){_0x3ee728[_0xf620('0x4a')]=_[_0xf620('0x48')](db['CannedAnswer']['rawAttributes']);_0x3ee728['query']=_['keys'](_0x1eddb3[_0xf620('0x47')]);_0x3ee728['filters']=_['intersection'](_0x3ee728['model'],_0x3ee728[_0xf620('0x47')]);_0x54461a[_0xf620('0x4b')]=_['intersection'](_0x3ee728['model'],qs[_0xf620('0x4d')](_0x1eddb3['query'][_0xf620('0x4d')]));_0x54461a[_0xf620('0x4b')]=_0x54461a['attributes'][_0xf620('0x4e')]?_0x54461a[_0xf620('0x4b')]:_0x3ee728['model'];if(!_0x1eddb3[_0xf620('0x47')][_0xf620('0x4f')](_0xf620('0x50'))){_0x54461a[_0xf620('0x33')]=qs[_0xf620('0x33')](_0x1eddb3[_0xf620('0x47')][_0xf620('0x33')]);_0x54461a[_0xf620('0x32')]=qs[_0xf620('0x32')](_0x1eddb3[_0xf620('0x47')][_0xf620('0x32')]);}_0x54461a[_0xf620('0x6c')]=qs[_0xf620('0x51')](_0x1eddb3[_0xf620('0x47')][_0xf620('0x51')]);_0x54461a[_0xf620('0x52')]=qs[_0xf620('0x49')](_[_0xf620('0x53')](_0x1eddb3[_0xf620('0x47')],_0x3ee728[_0xf620('0x49')]));_0x54461a[_0xf620('0x52')]['OpenchannelAccountId']=_0x566187['id'];if(_0x1eddb3[_0xf620('0x47')]['filter']){_0x54461a['where']=_['merge'](_0x54461a['where'],{'$or':_[_0xf620('0x41')](_0x54461a[_0xf620('0x4b')],function(_0x3c9be6){var _0x31027e={};_0x31027e[_0x3c9be6]={'$like':'%'+_0x1eddb3[_0xf620('0x47')][_0xf620('0x54')]+'%'};return _0x31027e;})});}_0x54461a=_['merge']({},_0x54461a,_0x1eddb3[_0xf620('0x57')]);return db[_0xf620('0x6f')]['count']({'where':_0x54461a[_0xf620('0x52')]})['then'](function(_0x3e747a){_0x455638['count']=_0x3e747a;if(_0x1eddb3['query']['includeAll']){_0x54461a['include']=[{'all':!![]}];}return db[_0xf620('0x6f')][_0xf620('0x5a')](_0x54461a);})['then'](function(_0x1027cc){_0x455638[_0xf620('0x6d')]=_0x1027cc;return _0x455638;});}})[_0xf620('0x23')](respondWithFilteredResult(_0x27bff6,_0x54461a))[_0xf620('0x2d')](handleError(_0x27bff6,null));};exports[_0xf620('0x70')]=function(_0x32266a,_0xb98b36,_0x46dbe9){return db[_0xf620('0x42')][_0xf620('0x5d')]({'where':{'id':_0x32266a[_0xf620('0x5c')]['id']}})['then'](handleEntityNotFound(_0xb98b36,null))[_0xf620('0x23')](function(_0x57b2fc){if(_0x57b2fc){return _0x57b2fc[_0xf620('0x70')](_0x32266a[_0xf620('0x47')][_0xf620('0x71')]);}})['then'](respondWithStatusCode(_0xb98b36,null))[_0xf620('0x2d')](handleError(_0xb98b36,null));};exports[_0xf620('0x72')]=function(_0x101145,_0x561c1c,_0x4052f5){var _0x53eea6={'body':_0x101145[_0xf620('0x65')],'channel':_0xf620('0x73')};var _0x31ee09=[];var _0x555bf4=[];var _0x5c7520={};var _0x591169=![];return db[_0xf620('0x74')][_0xf620('0x66')]()[_0xf620('0x23')](function(_0x362a78){if(!_0x362a78){throw new db[(_0xf620('0x75'))]['ValidationError'](_0xf620('0x76'));}_0x31ee09=_[_0xf620('0x77')](_['keys'](_0x362a78),[_0xf620('0x78'),'updatedAt']);_0x555bf4=_[_0xf620('0x77')](_['keys'](_0x362a78),[_0xf620('0x78'),_0xf620('0x79'),'CompanyId',_0xf620('0x7a')]);if(_0x101145['body']['id']){delete _0x101145['body']['id'];}if(_[_0xf620('0x7b')](_0x101145[_0xf620('0x65')]['from'])){throw new db[(_0xf620('0x75'))]['ValidationError'](_0xf620('0x7c'));}if(_['isNil'](_0x101145[_0xf620('0x65')][_0xf620('0x65')])||_0x101145[_0xf620('0x65')]['body']===''){throw new db[(_0xf620('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf620('0x7b')](_0x101145[_0xf620('0x65')][_0xf620('0x7d')])){throw new db[(_0xf620('0x75'))][(_0xf620('0x7e'))](_0xf620('0x7f')+_0x555bf4);}if(!_['includes'](_0x555bf4,_0x101145['body'][_0xf620('0x7d')])){throw new db[(_0xf620('0x75'))]['ValidationError'](_0xf620('0x80')+_0x555bf4);}_0x5c7520[_0x101145[_0xf620('0x65')][_0xf620('0x7d')]]=_0x101145[_0xf620('0x65')][_0xf620('0x81')];})[_0xf620('0x23')](function(){return db[_0xf620('0x42')]['find']({'where':{'id':_0x101145['params']['id']},'include':[{'model':db[_0xf620('0x82')],'as':_0xf620('0x83'),'include':[{'model':db[_0xf620('0x74')],'as':'Contacts','where':_0x5c7520,'limit':0x1,'order':[[_0xf620('0x79'),_0xf620('0x84')]]}]},{'model':db[_0xf620('0x85')],'as':'Applications'}]});})[_0xf620('0x23')](handleEntityNotFound(_0x561c1c,null))[_0xf620('0x23')](function(_0x1f2970){if(_0x1f2970&&_0x1f2970[_0xf620('0x83')]){_0x53eea6[_0xf620('0x86')]=_0x1f2970;_0x53eea6[_0xf620('0x87')]=_0x1f2970['Applications'];_0x53eea6[_0xf620('0x88')]=_0x1f2970[_0xf620('0x83')];_0x53eea6[_0xf620('0x87')]=_[_0xf620('0x89')](_0x53eea6[_0xf620('0x87')],[_0xf620('0x8a')],['asc']);if(_0x53eea6[_0xf620('0x86')][_0xf620('0x8b')]){delete _0x53eea6['account'][_0xf620('0x8b')];}if(_0x53eea6[_0xf620('0x86')]['List']&&_0x53eea6[_0xf620('0x86')][_0xf620('0x83')][_0xf620('0x8c')][_0xf620('0x4e')]){return _0x53eea6[_0xf620('0x86')]['List'][_0xf620('0x8c')][0x0];}var _0x3b1c2c=_[_0xf620('0x1a')](_0x101145['body'],{'firstName':_0x101145[_0xf620('0x65')][_0xf620('0x81')],'ListId':_0x1f2970['ListId']});_0x3b1c2c[_0x101145[_0xf620('0x65')][_0xf620('0x7d')]]=_0x101145['body'][_0xf620('0x81')];return db['CmContact'][_0xf620('0x5e')](_0x3b1c2c,{'fields':_0x31ee09,'raw':!![]});}})[_0xf620('0x23')](handleEntityNotFound(_0x561c1c,null))[_0xf620('0x23')](function(_0x3ba430){_0x53eea6['contact']=_0x3ba430;if(_0x3ba430){var _0x53fb1f={'ContactId':_0x3ba430['id'],'OpenchannelAccountId':_0x101145['params']['id'],'from':(_0x3ba430[_0xf620('0x8d')]||'')+'\x20'+(_0x3ba430[_0xf620('0x8e')]||'')};var _0x2f8be3={'OpenchannelAccountId':_0x101145[_0xf620('0x5c')]['id'],'closed':![]};if(_0x101145['body']['threadId']){_0x2f8be3[_0xf620('0x8f')]=_0x101145[_0xf620('0x65')]['threadId'];return db[_0xf620('0x90')][_0xf620('0x5d')]({'where':_0x2f8be3})[_0xf620('0x23')](function(_0x160c0d){if(_0x160c0d){return[_0x160c0d,![]];}_0x53fb1f[_0xf620('0x8f')]=_0x101145['body'][_0xf620('0x8f')];_0x53fb1f[_0xf620('0x91')]=_0x101145[_0xf620('0x65')][_0xf620('0x91')];return db[_0xf620('0x90')]['create'](_0x53fb1f)[_0xf620('0x23')](function(_0x2f3e33){return[_0x2f3e33,!![]];});});}else{_0x2f8be3[_0xf620('0x8f')]=null;}_0x2f8be3[_0xf620('0x92')]=_0x3ba430['id'];return db[_0xf620('0x90')][_0xf620('0x5d')]({'where':_0x2f8be3})[_0xf620('0x23')](function(_0x3e6a4b){if(_0x3e6a4b){return[_0x3e6a4b,![]];}return db['OpenchannelInteraction'][_0xf620('0x5e')](_0x53fb1f)[_0xf620('0x23')](function(_0x22948c){return[_0x22948c,!![]];});});}})[_0xf620('0x93')](function(_0x42ec92,_0x5e35a1){if(_0x42ec92){_0x591169=_0x5e35a1;if(!_0x5e35a1){var _0x3f08fb={'from':(_0x53eea6[_0xf620('0x94')]['firstName']||'')+'\x20'+(_0x53eea6[_0xf620('0x94')][_0xf620('0x8e')]||'')};if(_0x101145['body'][_0xf620('0x8f')]&&_0x101145[_0xf620('0x65')][_0xf620('0x95')]&&_0x101145['body'][_0xf620('0x8f')]!=_0x101145[_0xf620('0x65')][_0xf620('0x95')]){_0x3f08fb[_0xf620('0x8f')]=_0x101145[_0xf620('0x65')][_0xf620('0x95')];}return _0x42ec92[_0xf620('0x3a')](_0x3f08fb);}else{return _0x42ec92;}}})[_0xf620('0x23')](function(_0x270fd0){_0x53eea6['interaction']=_0x270fd0[_0xf620('0x60')]({'plain':!![]});_0x53eea6[_0xf620('0x96')]['created']=_0x591169;if(_0x53eea6[_0xf620('0x96')][_0xf620('0x97')]){if(_0x53eea6[_0xf620('0x86')]['autoclose']){_0x53eea6[_0xf620('0x87')]['push']({'id':0x0,'priority':_0x53eea6[_0xf620('0x87')]['length']+0x1,'app':_0xf620('0x98'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xf620('0x99')][_0xf620('0x5e')]({'body':_0x101145[_0xf620('0x65')][_0xf620('0x65')],'OpenchannelAccountId':_0x101145[_0xf620('0x5c')]['id'],'OpenchannelInteractionId':_0x270fd0['id'],'direction':'in','ContactId':_0x53eea6['contact']['id'],'AttachmentId':_0x101145['body']['AttachmentId']});})[_0xf620('0x23')](function(_0x2687c9){_0x53eea6[_0xf620('0x2a')]=_0x2687c9;if(_0x53eea6[_0xf620('0x96')]['UserId']){return db['User'][_0xf620('0x5d')]({'attributes':['id',_0xf620('0x3d')],'where':{'id':_0x53eea6[_0xf620('0x96')][_0xf620('0x9a')]}})[_0xf620('0x23')](function(_0x4d3de3){if(_0x4d3de3){_0x53eea6[_0xf620('0x87')][_0xf620('0x9b')]({'id':0x0,'priority':0x0,'app':_0xf620('0x9c'),'appdata':_0x4d3de3['name']+','+(_0x53eea6['account']['waitForTheAssignedAgent']||0xa),'interval':_0xf620('0x9d')});_0x53eea6[_0xf620('0x9e')]=![];}return respondWithRpcPromise(_0xf620('0x9f'),_0xf620('0xa0'),_0x53eea6);});}return respondWithRpcPromise(_0xf620('0x9f'),_0xf620('0xa0'),_0x53eea6);})[_0xf620('0x23')](function(_0x1a1582){respondWithRpcPromise(_0xf620('0xa1'),'EventManager',{'event':_0xf620('0x72'),'message':_0x1a1582},client9002);return _0x1a1582;})['then'](respondWithResult(_0x561c1c,null))[_0xf620('0x2d')](handleError(_0x561c1c,null));};exports['addApplications']=function(_0x1c521b,_0x129d7a){var _0x31b5d5=_0x1c521b[_0xf620('0x5c')]['id'];var _0x37a960=_0x1c521b['body'];var _0x16f6a4=0xc8;var _0x4096bd=null;return db[_0xf620('0xa2')]['transaction']({'isolationLevel':db[_0xf620('0xa2')][_0xf620('0xa3')][_0xf620('0xa4')][_0xf620('0xa5')]},function(_0x1d8386){return db['OpenchannelAccount'][_0xf620('0x6b')]({'where':{'id':_0x31b5d5},'transaction':_0x1d8386})[_0xf620('0x23')](function(_0x33516a){if(_0x33516a){return db['OpenchannelApplication'][_0xf620('0x3b')]({'where':{'OpenchannelAccountId':_0x31b5d5},'transaction':_0x1d8386})['then'](function(){var _0x967de9=_[_0xf620('0x41')](_0x37a960,function(_0x1587de){_0x1587de[_0xf620('0x68')]=_0x31b5d5;return _0x1587de;});return db['OpenchannelApplication']['bulkCreate'](_0x967de9,{'transaction':_0x1d8386});});}else{_0x16f6a4=0x194;_0x4096bd=[];}});})[_0xf620('0x23')](function(){if(_0x16f6a4!==0x194){return db['OpenchannelApplication'][_0xf620('0xa6')]({'where':{'OpenchannelAccountId':_0x31b5d5},'order':_0xf620('0x8a')})['then'](function(_0x226352){_0x4096bd=_0x226352;});}})['catch'](function(_0x989da1){_0x16f6a4=0x1f4;logger[_0xf620('0x28')](_0x989da1['stack']);if(_0x989da1[_0xf620('0x3d')]){delete _0x989da1[_0xf620('0x3d')];}_0x4096bd=_0x989da1;})[_0xf620('0xa7')](function(){if(_0x4096bd===null){_0x129d7a[_0xf620('0x2e')](_0x16f6a4);}else{if(_0x16f6a4===0x1f4){_0x129d7a['status'](_0x16f6a4)['send'](_0x4096bd);}else{_0x129d7a[_0xf620('0x2f')](_0x16f6a4)['json'](_0x4096bd);}}});};exports[_0xf620('0xa8')]=function(_0xfe26a1,_0x638527,_0x184c3d){var _0x1bc566={};var _0x5155ec={};var _0xc05653;var _0x22b583;return db[_0xf620('0x42')]['findOne']({'where':{'id':_0xfe26a1['params']['id']}})['then'](handleEntityNotFound(_0x638527,null))[_0xf620('0x23')](function(_0x5cf890){if(_0x5cf890){_0xc05653=_0x5cf890;_0x5155ec['model']=_[_0xf620('0x48')](db[_0xf620('0x85')]['rawAttributes']);_0x5155ec[_0xf620('0x47')]=_['keys'](_0xfe26a1[_0xf620('0x47')]);_0x5155ec[_0xf620('0x49')]=_[_0xf620('0x4c')](_0x5155ec['model'],_0x5155ec['query']);_0x1bc566['attributes']=_['intersection'](_0x5155ec[_0xf620('0x4a')],qs[_0xf620('0x4d')](_0xfe26a1[_0xf620('0x47')][_0xf620('0x4d')]));_0x1bc566[_0xf620('0x4b')]=_0x1bc566[_0xf620('0x4b')][_0xf620('0x4e')]?_0x1bc566[_0xf620('0x4b')]:_0x5155ec[_0xf620('0x4a')];_0x1bc566[_0xf620('0x6c')]=qs[_0xf620('0x51')](_0xfe26a1[_0xf620('0x47')][_0xf620('0x51')]);_0x1bc566['where']=qs[_0xf620('0x49')](_['pick'](_0xfe26a1['query'],_0x5155ec[_0xf620('0x49')]));if(_0xfe26a1[_0xf620('0x47')][_0xf620('0x54')]){_0x1bc566['where']=_[_0xf620('0x55')](_0x1bc566[_0xf620('0x52')],{'$or':_[_0xf620('0x41')](_0x1bc566[_0xf620('0x4b')],function(_0x50a99a){var _0x465b03={};_0x465b03[_0x50a99a]={'$like':'%'+_0xfe26a1[_0xf620('0x47')][_0xf620('0x54')]+'%'};return _0x465b03;})});}_0x1bc566=_[_0xf620('0x55')]({},_0x1bc566,_0xfe26a1[_0xf620('0x57')]);return _0xc05653[_0xf620('0xa8')](_0x1bc566);}})[_0xf620('0x23')](function(_0xb0b2cd){if(_0xb0b2cd){_0x22b583=_0xb0b2cd[_0xf620('0x4e')];if(!_0xfe26a1[_0xf620('0x47')][_0xf620('0x4f')](_0xf620('0x50'))){_0x1bc566['limit']=qs[_0xf620('0x33')](_0xfe26a1[_0xf620('0x47')][_0xf620('0x33')]);_0x1bc566[_0xf620('0x32')]=qs['offset'](_0xfe26a1['query'][_0xf620('0x32')]);}return _0xc05653[_0xf620('0xa8')](_0x1bc566);}})['then'](function(_0xa97c99){if(_0xa97c99){return _0xa97c99?{'count':_0x22b583,'rows':_0xa97c99}:null;}})['then'](respondWithResult(_0x638527,null))[_0xf620('0x2d')](handleError(_0x638527,null));};exports[_0xf620('0xa9')]=function(_0x331c60,_0x2d5f83,_0x5d5254){var _0x57b6f3={'raw':![],'where':{}};var _0x245c99={};var _0x2cdd39={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x331c60['params']['id']}})[_0xf620('0x23')](handleEntityNotFound(_0x2d5f83,null))[_0xf620('0x23')](function(_0x2ef121){if(_0x2ef121){_0x245c99[_0xf620('0x4a')]=_[_0xf620('0x48')](db[_0xf620('0x90')][_0xf620('0x43')]);_0x245c99['query']=_[_0xf620('0x48')](_0x331c60[_0xf620('0x47')]);_0x245c99[_0xf620('0x49')]=_[_0xf620('0x4c')](_0x245c99[_0xf620('0x4a')],_0x245c99[_0xf620('0x47')]);_0x57b6f3[_0xf620('0x4b')]=_[_0xf620('0x4c')](_0x245c99[_0xf620('0x4a')],qs[_0xf620('0x4d')](_0x331c60[_0xf620('0x47')]['fields']));_0x57b6f3['attributes']=_0x57b6f3['attributes'][_0xf620('0x4e')]?_0x57b6f3['attributes']:_0x245c99[_0xf620('0x4a')];if(!_0x331c60['query']['hasOwnProperty'](_0xf620('0x50'))){_0x57b6f3['limit']=qs['limit'](_0x331c60[_0xf620('0x47')]['limit']);_0x57b6f3[_0xf620('0x32')]=qs[_0xf620('0x32')](_0x331c60[_0xf620('0x47')][_0xf620('0x32')]);}_0x57b6f3['order']=qs[_0xf620('0x51')](_0x331c60['query'][_0xf620('0x51')]);_0x57b6f3[_0xf620('0x52')]=qs[_0xf620('0x49')](_[_0xf620('0x53')](_0x331c60[_0xf620('0x47')],_0x245c99['filters']));_0x57b6f3[_0xf620('0x52')][_0xf620('0x68')]=_0x2ef121['id'];if(_0x331c60['query']['filter']){_0x57b6f3[_0xf620('0x52')]=_['merge'](_0x57b6f3[_0xf620('0x52')],{'$or':_[_0xf620('0x41')](_0x57b6f3['attributes'],function(_0x9a298a){var _0x2abf19={};_0x2abf19[_0x9a298a]={'$like':'%'+_0x331c60[_0xf620('0x47')][_0xf620('0x54')]+'%'};return _0x2abf19;})});}_0x57b6f3=_[_0xf620('0x55')]({},_0x57b6f3,_0x331c60['options']);return db['OpenchannelInteraction'][_0xf620('0x35')]({'where':_0x57b6f3[_0xf620('0x52')]})[_0xf620('0x23')](function(_0x11268b){_0x2cdd39['count']=_0x11268b;if(_0x331c60['query'][_0xf620('0x58')]){_0x57b6f3[_0xf620('0x59')]=[{'model':db[_0xf620('0x74')],'as':'Contact','required':![]},{'model':db[_0xf620('0xaa')],'as':_0xf620('0xab'),'attributes':['name',_0xf620('0xac'),'internal'],'required':![]},{'model':db[_0xf620('0xad')],'as':_0xf620('0xae'),'attributes':['id','name',_0xf620('0xaf')],'where':_0x331c60[_0xf620('0x47')]['tag']?{'id':_0x331c60[_0xf620('0x47')][_0xf620('0xb0')]}:undefined,'required':_0x331c60[_0xf620('0x47')][_0xf620('0xb0')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xf620('0x5a')](_0x57b6f3);})[_0xf620('0x23')](function(_0x5a5e21){_0x2cdd39['rows']=_0x5a5e21;return _0x2cdd39;});}})[_0xf620('0x23')](respondWithFilteredResult(_0x2d5f83,_0x57b6f3))[_0xf620('0x2d')](handleError(_0x2d5f83,null));};exports[_0xf620('0xb1')]=function(_0x19c0f6,_0x222781,_0x2dca2e){return db['OpenchannelAccount'][_0xf620('0x5d')]({'where':{'id':_0x19c0f6[_0xf620('0x5c')]['id']}})['then'](handleEntityNotFound(_0x222781,null))['then'](function(_0x423e65){if(_0x423e65){return _0x423e65[_0xf620('0xb1')](_0x19c0f6[_0xf620('0x65')][_0xf620('0x71')],_[_0xf620('0xb2')](_0x19c0f6[_0xf620('0x65')],['ids','id'])||{})[_0xf620('0x93')](function(_0x3d82d5){for(var _0x3ab88f=0x0;_0x3ab88f<_0x19c0f6[_0xf620('0x65')][_0xf620('0x71')][_0xf620('0x4e')];_0x3ab88f+=0x1){socket[_0xf620('0xb3')](_0xf620('0xb4'),{'UserId':Number(_0x19c0f6[_0xf620('0x65')]['ids'][_0x3ab88f]),'OpenchannelAccountId':Number(_0x19c0f6[_0xf620('0x5c')]['id'])});}return _0x3d82d5;});}})[_0xf620('0x23')](respondWithResult(_0x222781,null))['catch'](handleError(_0x222781,null));};exports[_0xf620('0xb5')]=function(_0x1bd98e,_0x156ef6,_0x236a56){return db[_0xf620('0x42')]['find']({'where':{'id':_0x1bd98e[_0xf620('0x5c')]['id']}})['then'](handleEntityNotFound(_0x156ef6,null))['then'](function(_0x1db627){if(_0x1db627){return _0x1db627[_0xf620('0xb5')](_0x1bd98e[_0xf620('0x47')][_0xf620('0x71')])[_0xf620('0x23')](function(){if(_[_0xf620('0xb6')](_0x1bd98e[_0xf620('0x47')][_0xf620('0x71')])){for(var _0x578d21=0x0;_0x578d21<_0x1bd98e[_0xf620('0x47')][_0xf620('0x71')][_0xf620('0x4e')];_0x578d21+=0x1){socket[_0xf620('0xb3')](_0xf620('0xb7'),{'UserId':Number(_0x1bd98e[_0xf620('0x47')][_0xf620('0x71')][_0x578d21]),'OpenchannelAccountId':Number(_0x1bd98e[_0xf620('0x5c')]['id'])});}}else{socket[_0xf620('0xb3')](_0xf620('0xb7'),{'UserId':Number(_0x1bd98e[_0xf620('0x47')][_0xf620('0x71')]),'OpenchannelAccountId':Number(_0x1bd98e['params']['id'])});}});}})[_0xf620('0x23')](respondWithStatusCode(_0x156ef6,null))[_0xf620('0x2d')](handleError(_0x156ef6,null));};exports['getAgents']=function(_0xcfc2,_0x4745cf,_0x48d0f7){var _0x5b827f={};var _0x5cb796={};var _0x569d87;var _0x2735bf;return db[_0xf620('0x42')][_0xf620('0x6b')]({'where':{'id':_0xcfc2['params']['id']}})['then'](handleEntityNotFound(_0x4745cf,null))[_0xf620('0x23')](function(_0x2b30f9){if(_0x2b30f9){_0x569d87=_0x2b30f9;_0x5cb796[_0xf620('0x4a')]=_[_0xf620('0x48')](db[_0xf620('0xaa')][_0xf620('0x43')]);_0x5cb796[_0xf620('0x47')]=_['keys'](_0xcfc2[_0xf620('0x47')]);_0x5cb796['filters']=_[_0xf620('0x4c')](_0x5cb796['model'],_0x5cb796[_0xf620('0x47')]);_0x5b827f[_0xf620('0x4b')]=_[_0xf620('0x4c')](_0x5cb796[_0xf620('0x4a')],qs[_0xf620('0x4d')](_0xcfc2[_0xf620('0x47')]['fields']));_0x5b827f[_0xf620('0x4b')]=_0x5b827f[_0xf620('0x4b')][_0xf620('0x4e')]?_0x5b827f['attributes']:_0x5cb796[_0xf620('0x4a')];_0x5b827f[_0xf620('0x6c')]=qs[_0xf620('0x51')](_0xcfc2[_0xf620('0x47')]['sort']);_0x5b827f[_0xf620('0x52')]=qs[_0xf620('0x49')](_['pick'](_0xcfc2[_0xf620('0x47')],_0x5cb796[_0xf620('0x49')]));if(_0xcfc2[_0xf620('0x47')][_0xf620('0x54')]){_0x5b827f[_0xf620('0x52')]=_[_0xf620('0x55')](_0x5b827f['where'],{'$or':_[_0xf620('0x41')](_0x5b827f[_0xf620('0x4b')],function(_0x201462){var _0x207186={};_0x207186[_0x201462]={'$like':'%'+_0xcfc2[_0xf620('0x47')][_0xf620('0x54')]+'%'};return _0x207186;})});}_0x5b827f=_[_0xf620('0x55')]({},_0x5b827f,_0xcfc2['options']);return _0x569d87['getAgents'](_0x5b827f);}})[_0xf620('0x23')](function(_0x3c8212){if(_0x3c8212){_0x2735bf=_0x3c8212[_0xf620('0x4e')];if(!_0xcfc2[_0xf620('0x47')][_0xf620('0x4f')](_0xf620('0x50'))){_0x5b827f['limit']=qs['limit'](_0xcfc2['query'][_0xf620('0x33')]);_0x5b827f[_0xf620('0x32')]=qs[_0xf620('0x32')](_0xcfc2[_0xf620('0x47')][_0xf620('0x32')]);}return _0x569d87['getAgents'](_0x5b827f);}})[_0xf620('0x23')](function(_0x243276){if(_0x243276){return _0x243276?{'count':_0x2735bf,'rows':_0x243276}:null;}})[_0xf620('0x23')](respondWithResult(_0x4745cf,null))['catch'](handleError(_0x4745cf,null));};exports['send']=function(_0x284e17,_0x2e2a04,_0x403863){var _0x27d932,_0x5f45d1,_0x1ee554;if(_[_0xf620('0x7b')](_0x284e17['body']['body'])||_0x284e17['body'][_0xf620('0x65')]===''){throw new db['Sequelize'][(_0xf620('0x7e'))](_0xf620('0xb8'));}if(_[_0xf620('0x7b')](_0x284e17[_0xf620('0x65')]['to'])){}_0x27d932=_0x284e17[_0xf620('0x65')]['to'];return db[_0xf620('0x42')][_0xf620('0x6b')]({'where':{'id':_0x284e17[_0xf620('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2e2a04,null))[_0xf620('0x23')](function(_0x4dc0ed){if(_0x4dc0ed){return db['OpenchannelAccount'][_0xf620('0x5d')]({'where':{'id':_0x4dc0ed['id']},'include':[{'model':db[_0xf620('0x82')],'as':_0xf620('0x83'),'include':[{'model':db[_0xf620('0x74')],'as':'Contacts','where':{[_0x4dc0ed[_0xf620('0x7d')]]:_0x27d932},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xf620('0x23')](handleEntityNotFound(_0x2e2a04,null))[_0xf620('0x23')](function(_0x4a6391){if(_0x4a6391&&_0x4a6391[_0xf620('0x83')]){_0x5f45d1=_0x4a6391['get']({'plain':!![]});if(_0x5f45d1[_0xf620('0x83')]&&_0x5f45d1[_0xf620('0x83')]['Contacts']['length']){return _0x5f45d1['List'][_0xf620('0x8c')][0x0];}return db[_0xf620('0x74')][_0xf620('0x5e')](_['defaults'](_0x284e17['body'],{'firstName':_0x27d932,[_0x4a6391[_0xf620('0x7d')]]:_0x27d932,'phone':_0x27d932,'ListId':_0x5f45d1['ListId']}));}})['then'](handleEntityNotFound(_0x2e2a04,null))['then'](function(_0x4afd24){if(_0x4afd24){_0x1ee554=_0x4afd24;return db[_0xf620('0x90')][_0xf620('0x5d')]({'where':{'ContactId':_0x1ee554['id'],'closed':![],'OpenchannelAccountId':_0x5f45d1['id']}})['then'](function(_0x1ea8e1){if(_0x1ea8e1){return[_0x1ea8e1,![]];}return db[_0xf620('0x90')][_0xf620('0x5e')]({'UserId':_0x284e17[_0xf620('0x5f')]['id'],'ContactId':_0x1ee554['id'],'OpenchannelAccountId':_0x5f45d1['id'],'lastMsgDirection':_0xf620('0xb9'),'Messages':[_[_0xf620('0x55')](_0x284e17[_0xf620('0x65')],{'read':![],'body':_0x284e17[_0xf620('0x65')][_0xf620('0x65')],'OpenchannelAccountId':_0x5f45d1['id'],'UserId':_0x284e17['user']['id'],'ContactId':_0x1ee554['id']})]},{'include':[{'model':db[_0xf620('0x99')],'as':'Messages'}]})[_0xf620('0x23')](function(_0x5e36f9){return[_0x5e36f9,!![]];});});}})['spread'](function(_0x1b3bb3,_0x2cf68a){if(_0x2cf68a){return _0x1b3bb3;}return db['OpenchannelMessage'][_0xf620('0x5e')](_[_0xf620('0x55')](_0x284e17[_0xf620('0x65')],{'read':![],'body':_0x284e17['body']['body'],'OpenchannelAccountId':_0x5f45d1['id'],'OpenchannelInteractionId':_0x1b3bb3['id'],'UserId':_0x284e17['user']['id'],'ContactId':_0x1ee554['id']}))[_0xf620('0x23')](function(_0x46dff5){_0x1b3bb3[_0xf620('0xba')]['Messages']=[];_0x1b3bb3[_0xf620('0xba')][_0xf620('0xbb')][_0xf620('0xbc')](_0x46dff5['dataValues']);return _0x1b3bb3;});});}})[_0xf620('0x23')](respondWithResult(_0x2e2a04,null))[_0xf620('0x2d')](handleError(_0x2e2a04,null));};
\ No newline at end of file
+var _0x9018=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','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','Contacts','DESC','OpenchannelApplication','List','account','applications','Applications','list','contact','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','update','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','send','getApplications','getInteractions','Contact','fullname','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','client','http','request','then','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','save','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0x9018,0x1d1));var _0x8901=function(_0x3d06fb,_0x3ea04a){_0x3d06fb=_0x3d06fb-0x0;var _0x4b62f5=_0x9018[_0x3d06fb];return _0x4b62f5;};'use strict';var emlformat=require(_0x8901('0x0'));var rimraf=require(_0x8901('0x1'));var zipdir=require(_0x8901('0x2'));var jsonpatch=require(_0x8901('0x3'));var rp=require(_0x8901('0x4'));var moment=require(_0x8901('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8901('0x6'));var util=require('util');var path=require(_0x8901('0x7'));var sox=require('sox');var csv=require(_0x8901('0x8'));var ejs=require(_0x8901('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8901('0xa'));var squel=require('squel');var crypto=require(_0x8901('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8901('0x8'));var querystring=require(_0x8901('0xc'));var Papa=require('papaparse');var Redis=require(_0x8901('0xd'));var authService=require(_0x8901('0xe'));var qs=require(_0x8901('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8901('0x10'));var logger=require(_0x8901('0x11'))(_0x8901('0x12'));var utils=require(_0x8901('0x13'));var config=require(_0x8901('0x14'));var licenseUtil=require(_0x8901('0x15'));var db=require(_0x8901('0x16'))['db'];config[_0x8901('0x17')]=_[_0x8901('0x18')](config[_0x8901('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8901('0x19'))(new Redis(config['redis']));require(_0x8901('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8901('0x1b')][_0x8901('0x1c')]({'port':0x232c});var client9002=jayson[_0x8901('0x1b')][_0x8901('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1550e7,_0xeb2356,_0x53fe01,_0x640eae){return new BPromise(function(_0x1f9df0,_0x439d4c){var _0x405530=_0x640eae||client;return _0x405530[_0x8901('0x1d')](_0x1550e7,_0x53fe01)[_0x8901('0x1e')](function(_0xc552d3){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0xeb2356,_0x8901('0x1f'));logger['debug'](_0x8901('0x20'),_0xeb2356,_0x8901('0x1f'),JSON[_0x8901('0x21')](_0xc552d3));if(_0xc552d3['error']){if(_0xc552d3[_0x8901('0x22')]['code']===0x1f4){logger[_0x8901('0x22')](_0x8901('0x23'),_0xeb2356,_0xc552d3[_0x8901('0x22')][_0x8901('0x24')]);return _0x439d4c(_0xc552d3[_0x8901('0x22')][_0x8901('0x24')]);}logger[_0x8901('0x22')](_0x8901('0x23'),_0xeb2356,_0xc552d3[_0x8901('0x22')][_0x8901('0x24')]);return _0x1f9df0(_0xc552d3['error'][_0x8901('0x24')]);}else{logger['info'](_0x8901('0x23'),_0xeb2356,_0x8901('0x1f'));_0x1f9df0(_0xc552d3[_0x8901('0x25')][_0x8901('0x24')]);}})[_0x8901('0x26')](function(_0x1da030){logger[_0x8901('0x22')](_0x8901('0x23'),_0xeb2356,_0x1da030);_0x439d4c(_0x1da030);});});}function respondWithStatusCode(_0x340c11,_0x20c736){_0x20c736=_0x20c736||0xcc;return function(_0x170999){if(_0x170999){return _0x340c11[_0x8901('0x27')](_0x20c736);}return _0x340c11[_0x8901('0x28')](_0x20c736)[_0x8901('0x29')]();};}function respondWithResult(_0x536648,_0x471629){_0x471629=_0x471629||0xc8;return function(_0x36bda5){if(_0x36bda5){return _0x536648[_0x8901('0x28')](_0x471629)['json'](_0x36bda5);}};}function respondWithFilteredResult(_0x5ebbc5,_0x5f3222){return function(_0x5733a6){if(_0x5733a6){var _0x1614e4=typeof _0x5f3222[_0x8901('0x2a')]===_0x8901('0x2b')&&typeof _0x5f3222[_0x8901('0x2c')]===_0x8901('0x2b');var _0x4cf893=_0x5733a6[_0x8901('0x2d')];var _0xcd9117=_0x1614e4?0x0:_0x5f3222[_0x8901('0x2a')];var _0x16a6e4=_0x1614e4?_0x5733a6[_0x8901('0x2d')]:_0x5f3222['offset']+_0x5f3222[_0x8901('0x2c')];var _0x31d81f;if(_0x16a6e4>=_0x4cf893){_0x16a6e4=_0x4cf893;_0x31d81f=0xc8;}else{_0x31d81f=0xce;}_0x5ebbc5['status'](_0x31d81f);return _0x5ebbc5[_0x8901('0x2e')]('Content-Range',_0xcd9117+'-'+_0x16a6e4+'/'+_0x4cf893)[_0x8901('0x2f')](_0x5733a6);}return null;};}function patchUpdates(_0x4cb2eb){return function(_0x4fa25d){try{jsonpatch['apply'](_0x4fa25d,_0x4cb2eb,!![]);}catch(_0x1f5b9f){return BPromise['reject'](_0x1f5b9f);}return _0x4fa25d[_0x8901('0x30')]();};}function saveUpdates(_0x55fe27,_0x38e03e){return function(_0x686794){if(_0x686794){return _0x686794['update'](_0x55fe27)[_0x8901('0x1e')](function(_0x152dde){return _0x152dde;});}return null;};}function removeEntity(_0x572792,_0x2d2fe4){return function(_0xed3dc){if(_0xed3dc){return _0xed3dc[_0x8901('0x31')]()['then'](function(){var _0x11ae79=_0xed3dc[_0x8901('0x32')]({'plain':!![]});var _0x1107fd=_0x8901('0x33');return db[_0x8901('0x34')][_0x8901('0x31')]({'where':{'type':_0x1107fd,'resourceId':_0x11ae79['id']}})['then'](function(){return _0xed3dc;});})[_0x8901('0x1e')](function(){_0x572792[_0x8901('0x28')](0xcc)[_0x8901('0x29')]();});}};}function handleEntityNotFound(_0x6a1263,_0x2a5821){return function(_0x5ccab2){if(!_0x5ccab2){_0x6a1263[_0x8901('0x27')](0x194);}return _0x5ccab2;};}function handleError(_0x3b2b82,_0x656303){_0x656303=_0x656303||0x1f4;return function(_0x23ebf3){logger[_0x8901('0x22')](_0x23ebf3[_0x8901('0x35')]);if(_0x23ebf3[_0x8901('0x36')]){delete _0x23ebf3[_0x8901('0x36')];}_0x3b2b82[_0x8901('0x28')](_0x656303)['send'](_0x23ebf3);};}exports[_0x8901('0x37')]=function(_0x1e12d0,_0x14e20a){var _0x1edbdc={'include':[{'model':db[_0x8901('0x38')],'as':_0x8901('0x39')}]},_0x441562={},_0x6de281={'count':0x0,'rows':[]};var _0x23a32d=_[_0x8901('0x3a')](db[_0x8901('0x3b')][_0x8901('0x3c')],function(_0x2ee9f7){return{'name':_0x2ee9f7[_0x8901('0x3d')],'type':_0x2ee9f7[_0x8901('0x3e')][_0x8901('0x3f')]};});_0x441562[_0x8901('0x40')]=_[_0x8901('0x3a')](_0x23a32d,_0x8901('0x36'));_0x441562[_0x8901('0x41')]=_[_0x8901('0x42')](_0x1e12d0[_0x8901('0x41')]);_0x441562[_0x8901('0x43')]=_[_0x8901('0x44')](_0x441562[_0x8901('0x40')],_0x441562[_0x8901('0x41')]);_0x1edbdc[_0x8901('0x45')]=_[_0x8901('0x44')](_0x441562['model'],qs['fields'](_0x1e12d0['query'][_0x8901('0x46')]));_0x1edbdc[_0x8901('0x45')]=_0x1edbdc[_0x8901('0x45')][_0x8901('0x47')]?_0x1edbdc['attributes']:_0x441562[_0x8901('0x40')];if(!_0x1e12d0[_0x8901('0x41')][_0x8901('0x48')](_0x8901('0x49'))){_0x1edbdc[_0x8901('0x2c')]=qs[_0x8901('0x2c')](_0x1e12d0[_0x8901('0x41')][_0x8901('0x2c')]);_0x1edbdc[_0x8901('0x2a')]=qs[_0x8901('0x2a')](_0x1e12d0[_0x8901('0x41')]['offset']);}_0x1edbdc[_0x8901('0x4a')]=qs[_0x8901('0x4b')](_0x1e12d0['query'][_0x8901('0x4b')]);_0x1edbdc[_0x8901('0x4c')]=qs[_0x8901('0x43')](_[_0x8901('0x4d')](_0x1e12d0[_0x8901('0x41')],_0x441562['filters']),_0x23a32d);if(_0x1e12d0[_0x8901('0x41')]['filter']){_0x1edbdc['where']=_[_0x8901('0x4e')](_0x1edbdc['where'],{'$or':_[_0x8901('0x3a')](_0x23a32d,function(_0x1c0270){if(_0x1c0270[_0x8901('0x3e')]!==_0x8901('0x4f')){var _0x52e7ac={};_0x52e7ac[_0x1c0270['name']]={'$like':'%'+_0x1e12d0[_0x8901('0x41')][_0x8901('0x50')]+'%'};return _0x52e7ac;}})});}_0x1edbdc=_['merge']({},_0x1edbdc,_0x1e12d0[_0x8901('0x51')]);var _0x3a12f0={'where':_0x1edbdc[_0x8901('0x4c')]};return db[_0x8901('0x3b')]['count'](_0x3a12f0)['then'](function(_0x276a3f){_0x6de281[_0x8901('0x2d')]=_0x276a3f;if(_0x1e12d0[_0x8901('0x41')][_0x8901('0x52')]){_0x1edbdc[_0x8901('0x53')]=[{'all':!![]}];}return db[_0x8901('0x3b')][_0x8901('0x54')](_0x1edbdc);})[_0x8901('0x1e')](function(_0x4fc3c9){_0x6de281[_0x8901('0x55')]=_0x4fc3c9;return _0x6de281;})[_0x8901('0x1e')](respondWithFilteredResult(_0x14e20a,_0x1edbdc))['catch'](handleError(_0x14e20a,null));};exports['show']=function(_0x34b105,_0x24b116){var _0xd32dfd={'raw':![],'where':{'id':_0x34b105[_0x8901('0x56')]['id']},'include':[{'model':db[_0x8901('0x38')],'as':_0x8901('0x39')}]},_0x11c35c={};_0x11c35c[_0x8901('0x40')]=_['keys'](db[_0x8901('0x3b')]['rawAttributes']);_0x11c35c['query']=_[_0x8901('0x42')](_0x34b105['query']);_0x11c35c[_0x8901('0x43')]=_[_0x8901('0x44')](_0x11c35c['model'],_0x11c35c[_0x8901('0x41')]);_0xd32dfd[_0x8901('0x45')]=_[_0x8901('0x44')](_0x11c35c[_0x8901('0x40')],qs[_0x8901('0x46')](_0x34b105[_0x8901('0x41')]['fields']));_0xd32dfd['attributes']=_0xd32dfd['attributes'][_0x8901('0x47')]?_0xd32dfd[_0x8901('0x45')]:_0x11c35c['model'];if(_0x34b105[_0x8901('0x41')][_0x8901('0x52')]){_0xd32dfd[_0x8901('0x53')]=[{'all':!![]}];}_0xd32dfd=_[_0x8901('0x4e')]({},_0xd32dfd,_0x34b105[_0x8901('0x51')]);return db['OpenchannelAccount'][_0x8901('0x57')](_0xd32dfd)[_0x8901('0x1e')](handleEntityNotFound(_0x24b116,null))['then'](respondWithResult(_0x24b116,null))[_0x8901('0x26')](handleError(_0x24b116,null));};exports[_0x8901('0x58')]=function(_0x433f8d,_0x47b8bc){return db[_0x8901('0x3b')][_0x8901('0x58')](_0x433f8d['body'],{})[_0x8901('0x1e')](function(_0x3f4e2a){var _0x4b961b=_0x433f8d[_0x8901('0x59')]['get']({'plain':!![]});if(!_0x4b961b)throw new Error(_0x8901('0x5a'));if(_0x4b961b[_0x8901('0x5b')]===_0x8901('0x59')){var _0x5d1eee=_0x3f4e2a[_0x8901('0x32')]({'plain':!![]});var _0x2b962a='OpenchannelAccounts';return db[_0x8901('0x5c')][_0x8901('0x57')]({'where':{'name':_0x2b962a,'userProfileId':_0x4b961b[_0x8901('0x5d')]},'raw':!![]})[_0x8901('0x1e')](function(_0x3b5c49){if(_0x3b5c49&&_0x3b5c49[_0x8901('0x5e')]===0x0){return db[_0x8901('0x34')][_0x8901('0x58')]({'name':_0x5d1eee[_0x8901('0x36')],'resourceId':_0x5d1eee['id'],'type':_0x3b5c49[_0x8901('0x36')],'sectionId':_0x3b5c49['id']},{})['then'](function(){return _0x3f4e2a;});}else{return _0x3f4e2a;}})['catch'](function(_0x3c3091){logger[_0x8901('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c3091);throw _0x3c3091;});}return _0x3f4e2a;})[_0x8901('0x1e')](respondWithResult(_0x47b8bc,0xc9))[_0x8901('0x26')](handleError(_0x47b8bc,null));};exports['update']=function(_0x407a75,_0x263b91){if(_0x407a75[_0x8901('0x5f')]['id']){delete _0x407a75['body']['id'];}return db[_0x8901('0x3b')][_0x8901('0x57')]({'where':{'id':_0x407a75[_0x8901('0x56')]['id']},'include':[{'model':db[_0x8901('0x38')],'as':_0x8901('0x39')}]})['then'](handleEntityNotFound(_0x263b91,null))[_0x8901('0x1e')](saveUpdates(_0x407a75['body'],null))[_0x8901('0x1e')](respondWithResult(_0x263b91,null))[_0x8901('0x26')](handleError(_0x263b91,null));};exports[_0x8901('0x31')]=function(_0x267b3f,_0x4739c4){return db[_0x8901('0x3b')][_0x8901('0x57')]({'where':{'id':_0x267b3f[_0x8901('0x56')]['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x4739c4,null))[_0x8901('0x1e')](removeEntity(_0x4739c4,null))[_0x8901('0x26')](handleError(_0x4739c4,null));};exports[_0x8901('0x60')]=function(_0x2ff534,_0x41a241){return db['OpenchannelAccount'][_0x8901('0x60')]()[_0x8901('0x1e')](respondWithResult(_0x41a241,null))[_0x8901('0x26')](handleError(_0x41a241,null));};exports[_0x8901('0x61')]=function(_0x13610b,_0x376b74,_0x85da28){if(_0x13610b[_0x8901('0x5f')]['id']){delete _0x13610b[_0x8901('0x5f')]['id'];}return db[_0x8901('0x3b')][_0x8901('0x57')]({'where':{'id':_0x13610b[_0x8901('0x56')]['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x376b74,null))[_0x8901('0x1e')](function(_0x229cf8){if(_0x229cf8){_0x13610b[_0x8901('0x5f')][_0x8901('0x62')]=_0x229cf8['id'];return db['Disposition']['create'](_0x13610b[_0x8901('0x5f')]);}})[_0x8901('0x1e')](respondWithResult(_0x376b74,null))[_0x8901('0x26')](handleError(_0x376b74,null));};exports[_0x8901('0x63')]=function(_0x5c7e62,_0x4e78f1,_0x36436f){var _0x32a4d3={'raw':![],'where':{}};var _0x1cc449={};var _0x4e32d3={'count':0x0,'rows':[]};return db[_0x8901('0x3b')][_0x8901('0x64')]({'where':{'id':_0x5c7e62['params']['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x4e78f1,null))['then'](function(_0x27b75f){if(_0x27b75f){_0x1cc449[_0x8901('0x40')]=_[_0x8901('0x42')](db[_0x8901('0x65')][_0x8901('0x3c')]);_0x1cc449[_0x8901('0x41')]=_[_0x8901('0x42')](_0x5c7e62['query']);_0x1cc449[_0x8901('0x43')]=_['intersection'](_0x1cc449[_0x8901('0x40')],_0x1cc449[_0x8901('0x41')]);_0x32a4d3[_0x8901('0x45')]=_[_0x8901('0x44')](_0x1cc449[_0x8901('0x40')],qs[_0x8901('0x46')](_0x5c7e62[_0x8901('0x41')][_0x8901('0x46')]));_0x32a4d3['attributes']=_0x32a4d3['attributes']['length']?_0x32a4d3[_0x8901('0x45')]:_0x1cc449[_0x8901('0x40')];if(!_0x5c7e62[_0x8901('0x41')][_0x8901('0x48')](_0x8901('0x49'))){_0x32a4d3[_0x8901('0x2c')]=qs[_0x8901('0x2c')](_0x5c7e62['query'][_0x8901('0x2c')]);_0x32a4d3[_0x8901('0x2a')]=qs[_0x8901('0x2a')](_0x5c7e62[_0x8901('0x41')][_0x8901('0x2a')]);}_0x32a4d3['order']=qs[_0x8901('0x4b')](_0x5c7e62[_0x8901('0x41')]['sort']);_0x32a4d3['where']=qs[_0x8901('0x43')](_[_0x8901('0x4d')](_0x5c7e62['query'],_0x1cc449['filters']));_0x32a4d3[_0x8901('0x4c')][_0x8901('0x62')]=_0x27b75f['id'];if(_0x5c7e62[_0x8901('0x41')][_0x8901('0x50')]){_0x32a4d3[_0x8901('0x4c')]=_[_0x8901('0x4e')](_0x32a4d3[_0x8901('0x4c')],{'$or':_[_0x8901('0x3a')](_0x32a4d3[_0x8901('0x45')],function(_0x2bea3e){var _0x5ad28a={};_0x5ad28a[_0x2bea3e]={'$like':'%'+_0x5c7e62[_0x8901('0x41')][_0x8901('0x50')]+'%'};return _0x5ad28a;})});}_0x32a4d3=_[_0x8901('0x4e')]({},_0x32a4d3,_0x5c7e62[_0x8901('0x51')]);return db[_0x8901('0x65')]['count']({'where':_0x32a4d3[_0x8901('0x4c')]})['then'](function(_0x376da6){_0x4e32d3[_0x8901('0x2d')]=_0x376da6;if(_0x5c7e62[_0x8901('0x41')][_0x8901('0x52')]){_0x32a4d3[_0x8901('0x53')]=[{'all':!![]}];}return db[_0x8901('0x65')]['findAll'](_0x32a4d3);})[_0x8901('0x1e')](function(_0x19d5ab){_0x4e32d3[_0x8901('0x55')]=_0x19d5ab;return _0x4e32d3;});}})['then'](respondWithFilteredResult(_0x4e78f1,_0x32a4d3))[_0x8901('0x26')](handleError(_0x4e78f1,null));};exports['removeDispositions']=function(_0x386269,_0x939911,_0x55dcfc){return db['OpenchannelAccount']['find']({'where':{'id':_0x386269[_0x8901('0x56')]['id']}})['then'](handleEntityNotFound(_0x939911,null))['then'](function(_0x4407b2){if(_0x4407b2){return _0x4407b2[_0x8901('0x66')](_0x386269[_0x8901('0x41')][_0x8901('0x67')]);}})[_0x8901('0x1e')](respondWithStatusCode(_0x939911,null))[_0x8901('0x26')](handleError(_0x939911,null));};exports[_0x8901('0x68')]=function(_0x3a8a19,_0x19a05e,_0x2f3713){if(_0x3a8a19[_0x8901('0x5f')]['id']){delete _0x3a8a19['body']['id'];}return db[_0x8901('0x3b')]['find']({'where':{'id':_0x3a8a19[_0x8901('0x56')]['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x19a05e,null))[_0x8901('0x1e')](function(_0x15f5bc){if(_0x15f5bc){_0x3a8a19[_0x8901('0x5f')][_0x8901('0x62')]=_0x15f5bc['id'];return db[_0x8901('0x69')]['create'](_0x3a8a19[_0x8901('0x5f')]);}})[_0x8901('0x1e')](respondWithResult(_0x19a05e,null))['catch'](handleError(_0x19a05e,null));};exports[_0x8901('0x6a')]=function(_0x40838c,_0x310142,_0x268a47){var _0x24c8ae={'raw':![],'where':{}};var _0x3aeae8={};var _0x29b0f4={'count':0x0,'rows':[]};return db[_0x8901('0x3b')][_0x8901('0x64')]({'where':{'id':_0x40838c['params']['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x310142,null))['then'](function(_0x383421){if(_0x383421){_0x3aeae8[_0x8901('0x40')]=_['keys'](db[_0x8901('0x69')][_0x8901('0x3c')]);_0x3aeae8[_0x8901('0x41')]=_[_0x8901('0x42')](_0x40838c[_0x8901('0x41')]);_0x3aeae8[_0x8901('0x43')]=_[_0x8901('0x44')](_0x3aeae8[_0x8901('0x40')],_0x3aeae8[_0x8901('0x41')]);_0x24c8ae[_0x8901('0x45')]=_['intersection'](_0x3aeae8[_0x8901('0x40')],qs[_0x8901('0x46')](_0x40838c[_0x8901('0x41')][_0x8901('0x46')]));_0x24c8ae[_0x8901('0x45')]=_0x24c8ae[_0x8901('0x45')][_0x8901('0x47')]?_0x24c8ae['attributes']:_0x3aeae8['model'];if(!_0x40838c[_0x8901('0x41')][_0x8901('0x48')]('nolimit')){_0x24c8ae[_0x8901('0x2c')]=qs[_0x8901('0x2c')](_0x40838c[_0x8901('0x41')][_0x8901('0x2c')]);_0x24c8ae[_0x8901('0x2a')]=qs[_0x8901('0x2a')](_0x40838c['query'][_0x8901('0x2a')]);}_0x24c8ae[_0x8901('0x4a')]=qs[_0x8901('0x4b')](_0x40838c[_0x8901('0x41')][_0x8901('0x4b')]);_0x24c8ae['where']=qs[_0x8901('0x43')](_[_0x8901('0x4d')](_0x40838c[_0x8901('0x41')],_0x3aeae8[_0x8901('0x43')]));_0x24c8ae[_0x8901('0x4c')][_0x8901('0x62')]=_0x383421['id'];if(_0x40838c['query'][_0x8901('0x50')]){_0x24c8ae['where']=_['merge'](_0x24c8ae[_0x8901('0x4c')],{'$or':_[_0x8901('0x3a')](_0x24c8ae[_0x8901('0x45')],function(_0x166fd4){var _0x54ee0b={};_0x54ee0b[_0x166fd4]={'$like':'%'+_0x40838c[_0x8901('0x41')][_0x8901('0x50')]+'%'};return _0x54ee0b;})});}_0x24c8ae=_[_0x8901('0x4e')]({},_0x24c8ae,_0x40838c[_0x8901('0x51')]);return db[_0x8901('0x69')][_0x8901('0x2d')]({'where':_0x24c8ae[_0x8901('0x4c')]})[_0x8901('0x1e')](function(_0x40c64a){_0x29b0f4[_0x8901('0x2d')]=_0x40c64a;if(_0x40838c[_0x8901('0x41')][_0x8901('0x52')]){_0x24c8ae[_0x8901('0x53')]=[{'all':!![]}];}return db[_0x8901('0x69')][_0x8901('0x54')](_0x24c8ae);})[_0x8901('0x1e')](function(_0x3cf9c0){_0x29b0f4[_0x8901('0x55')]=_0x3cf9c0;return _0x29b0f4;});}})[_0x8901('0x1e')](respondWithFilteredResult(_0x310142,_0x24c8ae))[_0x8901('0x26')](handleError(_0x310142,null));};exports[_0x8901('0x6b')]=function(_0x3b8fc9,_0x71cdb5,_0x162554){return db[_0x8901('0x3b')][_0x8901('0x57')]({'where':{'id':_0x3b8fc9[_0x8901('0x56')]['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x71cdb5,null))['then'](function(_0x4bfed8){if(_0x4bfed8){return _0x4bfed8[_0x8901('0x6b')](_0x3b8fc9[_0x8901('0x41')][_0x8901('0x67')]);}})[_0x8901('0x1e')](respondWithStatusCode(_0x71cdb5,null))[_0x8901('0x26')](handleError(_0x71cdb5,null));};exports['notify']=function(_0x4f68d2,_0x138421,_0x1ca191){var _0x1887de={'body':_0x4f68d2[_0x8901('0x5f')],'channel':_0x8901('0x6c')};var _0x2b77a3=[];var _0x2fd33b=[];var _0x1e61d3={};var _0x138cb7=![];return db[_0x8901('0x6d')][_0x8901('0x60')]()[_0x8901('0x1e')](function(_0x2bc8da){if(!_0x2bc8da){throw new db['Sequelize'][(_0x8901('0x6e'))](_0x8901('0x6f'));}_0x2b77a3=_['difference'](_[_0x8901('0x42')](_0x2bc8da),[_0x8901('0x70'),_0x8901('0x71')]);_0x2fd33b=_[_0x8901('0x72')](_[_0x8901('0x42')](_0x2bc8da),[_0x8901('0x70'),_0x8901('0x71'),_0x8901('0x73'),_0x8901('0x74')]);if(_0x4f68d2[_0x8901('0x5f')]['id']){delete _0x4f68d2['body']['id'];}if(_[_0x8901('0x75')](_0x4f68d2['body'][_0x8901('0x76')])){throw new db['Sequelize']['ValidationError'](_0x8901('0x77'));}if(_[_0x8901('0x75')](_0x4f68d2['body'][_0x8901('0x5f')])||_0x4f68d2['body'][_0x8901('0x5f')]===''){throw new db[(_0x8901('0x78'))][(_0x8901('0x6e'))](_0x8901('0x79'));}if(_['isNil'](_0x4f68d2['body'][_0x8901('0x7a')])){throw new db[(_0x8901('0x78'))][(_0x8901('0x6e'))](_0x8901('0x7b')+_0x2fd33b);}if(!_[_0x8901('0x7c')](_0x2fd33b,_0x4f68d2['body'][_0x8901('0x7a')])){throw new db['Sequelize'][(_0x8901('0x6e'))](_0x8901('0x7d')+_0x2fd33b);}_0x1e61d3[_0x4f68d2['body'][_0x8901('0x7a')]]=_0x4f68d2[_0x8901('0x5f')]['from'];})['then'](function(){return db[_0x8901('0x3b')][_0x8901('0x57')]({'where':{'id':_0x4f68d2[_0x8901('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8901('0x6d')],'as':_0x8901('0x7e'),'where':_0x1e61d3,'limit':0x1,'order':[[_0x8901('0x71'),_0x8901('0x7f')]]}]},{'model':db[_0x8901('0x80')],'as':'Applications'}]});})[_0x8901('0x1e')](handleEntityNotFound(_0x138421,null))['then'](function(_0x8a2c2){if(_0x8a2c2&&_0x8a2c2[_0x8901('0x81')]){_0x1887de[_0x8901('0x82')]=_0x8a2c2;_0x1887de[_0x8901('0x83')]=_0x8a2c2[_0x8901('0x84')];_0x1887de[_0x8901('0x85')]=_0x8a2c2[_0x8901('0x81')];_0x1887de['applications']=_['orderBy'](_0x1887de[_0x8901('0x83')],['priority'],['asc']);if(_0x1887de[_0x8901('0x82')]['Applications']){delete _0x1887de[_0x8901('0x82')][_0x8901('0x84')];}if(_0x1887de[_0x8901('0x82')][_0x8901('0x81')]&&_0x1887de[_0x8901('0x82')][_0x8901('0x81')]['Contacts'][_0x8901('0x47')]){return _0x1887de[_0x8901('0x82')][_0x8901('0x81')][_0x8901('0x7e')][0x0];}var _0x3667d1=_[_0x8901('0x18')](_0x4f68d2[_0x8901('0x5f')],{'firstName':_0x4f68d2[_0x8901('0x5f')][_0x8901('0x76')],'ListId':_0x8a2c2['ListId']});_0x3667d1[_0x4f68d2['body'][_0x8901('0x7a')]]=_0x4f68d2[_0x8901('0x5f')][_0x8901('0x76')];return db[_0x8901('0x6d')][_0x8901('0x58')](_0x3667d1,{'fields':_0x2b77a3,'raw':!![]});}})[_0x8901('0x1e')](handleEntityNotFound(_0x138421,null))['then'](function(_0x1a4b70){_0x1887de[_0x8901('0x86')]=_0x1a4b70;if(_0x1a4b70){var _0x40486c={'ContactId':_0x1a4b70['id'],'OpenchannelAccountId':_0x4f68d2[_0x8901('0x56')]['id'],'from':(_0x1a4b70['firstName']||'')+'\x20'+(_0x1a4b70['lastName']||'')};var _0x5d7ad5={'OpenchannelAccountId':_0x4f68d2[_0x8901('0x56')]['id'],'closed':![]};if(_0x4f68d2[_0x8901('0x5f')][_0x8901('0x87')]){_0x5d7ad5[_0x8901('0x87')]=_0x4f68d2['body'][_0x8901('0x87')];return db[_0x8901('0x88')][_0x8901('0x57')]({'where':_0x5d7ad5})['then'](function(_0x56e565){if(_0x56e565){return[_0x56e565,![]];}_0x40486c[_0x8901('0x87')]=_0x4f68d2[_0x8901('0x5f')]['threadId'];_0x40486c[_0x8901('0x89')]=_0x4f68d2['body'][_0x8901('0x89')];return db[_0x8901('0x88')]['create'](_0x40486c)[_0x8901('0x1e')](function(_0x5eafdf){return[_0x5eafdf,!![]];});});}else{_0x5d7ad5[_0x8901('0x87')]=null;}_0x5d7ad5[_0x8901('0x8a')]=_0x1a4b70['id'];return db[_0x8901('0x88')]['find']({'where':_0x5d7ad5})[_0x8901('0x1e')](function(_0x2915b2){if(_0x2915b2){return[_0x2915b2,![]];}return db[_0x8901('0x88')][_0x8901('0x58')](_0x40486c)[_0x8901('0x1e')](function(_0x415a28){return[_0x415a28,!![]];});});}})[_0x8901('0x8b')](function(_0x51d447,_0x1637d2){if(_0x51d447){_0x138cb7=_0x1637d2;if(!_0x1637d2){var _0x5ef3ff={'from':(_0x1887de[_0x8901('0x86')][_0x8901('0x8c')]||'')+'\x20'+(_0x1887de[_0x8901('0x86')]['lastName']||'')};if(_0x4f68d2[_0x8901('0x5f')][_0x8901('0x87')]&&_0x4f68d2['body'][_0x8901('0x8d')]&&_0x4f68d2['body'][_0x8901('0x87')]!=_0x4f68d2[_0x8901('0x5f')]['messageId']){_0x5ef3ff[_0x8901('0x87')]=_0x4f68d2[_0x8901('0x5f')][_0x8901('0x8d')];}return _0x51d447[_0x8901('0x8e')](_0x5ef3ff);}else{return _0x51d447;}}})[_0x8901('0x1e')](function(_0x3efc38){_0x1887de[_0x8901('0x8f')]=_0x3efc38[_0x8901('0x32')]({'plain':!![]});_0x1887de[_0x8901('0x8f')]['created']=_0x138cb7;if(_0x1887de['interaction'][_0x8901('0x90')]){if(_0x1887de['account']['autoclose']){_0x1887de[_0x8901('0x83')][_0x8901('0x91')]({'id':0x0,'priority':_0x1887de['applications']['length']+0x1,'app':_0x8901('0x92'),'appdata':_0x8901('0x93'),'interval':_0x8901('0x94')});}}return db[_0x8901('0x95')][_0x8901('0x58')]({'body':_0x4f68d2['body']['body'],'OpenchannelAccountId':_0x4f68d2[_0x8901('0x56')]['id'],'OpenchannelInteractionId':_0x3efc38['id'],'direction':'in','ContactId':_0x1887de[_0x8901('0x86')]['id'],'AttachmentId':_0x4f68d2[_0x8901('0x5f')]['AttachmentId']});})['then'](function(_0x40bf27){_0x1887de[_0x8901('0x24')]=_0x40bf27;if(_0x1887de['interaction'][_0x8901('0x96')]){return db[_0x8901('0x97')][_0x8901('0x57')]({'attributes':['id','name'],'where':{'id':_0x1887de[_0x8901('0x8f')][_0x8901('0x96')]}})[_0x8901('0x1e')](function(_0x2dc351){if(_0x2dc351){_0x1887de[_0x8901('0x83')][_0x8901('0x98')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2dc351['name']+','+(_0x1887de[_0x8901('0x82')][_0x8901('0x99')]||0xa),'interval':_0x8901('0x94')});_0x1887de[_0x8901('0x9a')]=![];}return respondWithRpcPromise(_0x8901('0x9b'),_0x8901('0x9c'),_0x1887de);});}return respondWithRpcPromise('Start',_0x8901('0x9c'),_0x1887de);})['then'](function(_0x3db68d){respondWithRpcPromise(_0x8901('0x9d'),'EventManager',{'event':'notify','message':_0x3db68d},client9002);return _0x3db68d;})[_0x8901('0x1e')](respondWithResult(_0x138421,null))[_0x8901('0x26')](handleError(_0x138421,null));};exports[_0x8901('0x9e')]=function(_0x31aa49,_0x1ed5e4){var _0x38d355=_0x31aa49[_0x8901('0x56')]['id'];var _0x138b7f=_0x31aa49[_0x8901('0x5f')];var _0x151f73=0xc8;var _0x43d181=null;return db[_0x8901('0x9f')]['transaction']({'isolationLevel':db[_0x8901('0x9f')]['Transaction'][_0x8901('0xa0')][_0x8901('0xa1')]},function(_0x1a5941){return db['OpenchannelAccount'][_0x8901('0x64')]({'where':{'id':_0x38d355},'transaction':_0x1a5941})[_0x8901('0x1e')](function(_0x483c65){if(_0x483c65){return db[_0x8901('0x80')]['destroy']({'where':{'OpenchannelAccountId':_0x38d355},'transaction':_0x1a5941})[_0x8901('0x1e')](function(){var _0x536665=_[_0x8901('0x3a')](_0x138b7f,function(_0x52c049){_0x52c049[_0x8901('0x62')]=_0x38d355;return _0x52c049;});return db[_0x8901('0x80')][_0x8901('0xa2')](_0x536665,{'transaction':_0x1a5941});});}else{_0x151f73=0x194;_0x43d181=[];}});})['then'](function(){if(_0x151f73!==0x194){return db[_0x8901('0x80')][_0x8901('0xa3')]({'where':{'OpenchannelAccountId':_0x38d355},'order':_0x8901('0xa4')})[_0x8901('0x1e')](function(_0x4e0d43){_0x43d181=_0x4e0d43;});}})[_0x8901('0x26')](function(_0x5970eb){_0x151f73=0x1f4;logger['error'](_0x5970eb[_0x8901('0x35')]);if(_0x5970eb[_0x8901('0x36')]){delete _0x5970eb[_0x8901('0x36')];}_0x43d181=_0x5970eb;})[_0x8901('0xa5')](function(){if(_0x43d181===null){_0x1ed5e4['sendStatus'](_0x151f73);}else{if(_0x151f73===0x1f4){_0x1ed5e4['status'](_0x151f73)[_0x8901('0xa6')](_0x43d181);}else{_0x1ed5e4['status'](_0x151f73)[_0x8901('0x2f')](_0x43d181);}}});};exports['getApplications']=function(_0x5480a1,_0x5bfae5,_0x537542){var _0x1125ed={};var _0x276c1={};var _0x292e79;var _0x2558bb;return db[_0x8901('0x3b')]['findOne']({'where':{'id':_0x5480a1[_0x8901('0x56')]['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x5bfae5,null))[_0x8901('0x1e')](function(_0x583189){if(_0x583189){_0x292e79=_0x583189;_0x276c1[_0x8901('0x40')]=_['keys'](db[_0x8901('0x80')][_0x8901('0x3c')]);_0x276c1[_0x8901('0x41')]=_['keys'](_0x5480a1[_0x8901('0x41')]);_0x276c1[_0x8901('0x43')]=_['intersection'](_0x276c1['model'],_0x276c1[_0x8901('0x41')]);_0x1125ed[_0x8901('0x45')]=_[_0x8901('0x44')](_0x276c1[_0x8901('0x40')],qs[_0x8901('0x46')](_0x5480a1[_0x8901('0x41')][_0x8901('0x46')]));_0x1125ed[_0x8901('0x45')]=_0x1125ed[_0x8901('0x45')][_0x8901('0x47')]?_0x1125ed[_0x8901('0x45')]:_0x276c1[_0x8901('0x40')];_0x1125ed[_0x8901('0x4a')]=qs[_0x8901('0x4b')](_0x5480a1[_0x8901('0x41')][_0x8901('0x4b')]);_0x1125ed[_0x8901('0x4c')]=qs[_0x8901('0x43')](_['pick'](_0x5480a1[_0x8901('0x41')],_0x276c1[_0x8901('0x43')]));if(_0x5480a1[_0x8901('0x41')][_0x8901('0x50')]){_0x1125ed[_0x8901('0x4c')]=_[_0x8901('0x4e')](_0x1125ed[_0x8901('0x4c')],{'$or':_[_0x8901('0x3a')](_0x1125ed[_0x8901('0x45')],function(_0xcfa557){var _0x186031={};_0x186031[_0xcfa557]={'$like':'%'+_0x5480a1[_0x8901('0x41')][_0x8901('0x50')]+'%'};return _0x186031;})});}_0x1125ed=_[_0x8901('0x4e')]({},_0x1125ed,_0x5480a1[_0x8901('0x51')]);return _0x292e79[_0x8901('0xa7')](_0x1125ed);}})['then'](function(_0x5be3ec){if(_0x5be3ec){_0x2558bb=_0x5be3ec[_0x8901('0x47')];if(!_0x5480a1[_0x8901('0x41')][_0x8901('0x48')]('nolimit')){_0x1125ed['limit']=qs[_0x8901('0x2c')](_0x5480a1['query'][_0x8901('0x2c')]);_0x1125ed[_0x8901('0x2a')]=qs[_0x8901('0x2a')](_0x5480a1[_0x8901('0x41')][_0x8901('0x2a')]);}return _0x292e79[_0x8901('0xa7')](_0x1125ed);}})[_0x8901('0x1e')](function(_0x3b7c4f){if(_0x3b7c4f){return _0x3b7c4f?{'count':_0x2558bb,'rows':_0x3b7c4f}:null;}})[_0x8901('0x1e')](respondWithResult(_0x5bfae5,null))[_0x8901('0x26')](handleError(_0x5bfae5,null));};exports[_0x8901('0xa8')]=function(_0x4d3a17,_0x20a623,_0x54473a){var _0x467d2e={'raw':![],'where':{}};var _0x69ee92={};var _0xcb13f0={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4d3a17[_0x8901('0x56')]['id']}})['then'](handleEntityNotFound(_0x20a623,null))['then'](function(_0x2e791c){if(_0x2e791c){_0x69ee92['model']=_[_0x8901('0x42')](db[_0x8901('0x88')][_0x8901('0x3c')]);_0x69ee92[_0x8901('0x41')]=_[_0x8901('0x42')](_0x4d3a17[_0x8901('0x41')]);_0x69ee92[_0x8901('0x43')]=_[_0x8901('0x44')](_0x69ee92[_0x8901('0x40')],_0x69ee92['query']);_0x467d2e[_0x8901('0x45')]=_[_0x8901('0x44')](_0x69ee92[_0x8901('0x40')],qs['fields'](_0x4d3a17[_0x8901('0x41')][_0x8901('0x46')]));_0x467d2e[_0x8901('0x45')]=_0x467d2e['attributes'][_0x8901('0x47')]?_0x467d2e[_0x8901('0x45')]:_0x69ee92[_0x8901('0x40')];if(!_0x4d3a17[_0x8901('0x41')]['hasOwnProperty'](_0x8901('0x49'))){_0x467d2e['limit']=qs[_0x8901('0x2c')](_0x4d3a17[_0x8901('0x41')]['limit']);_0x467d2e[_0x8901('0x2a')]=qs[_0x8901('0x2a')](_0x4d3a17[_0x8901('0x41')][_0x8901('0x2a')]);}_0x467d2e[_0x8901('0x4a')]=qs[_0x8901('0x4b')](_0x4d3a17[_0x8901('0x41')]['sort']);_0x467d2e[_0x8901('0x4c')]=qs[_0x8901('0x43')](_[_0x8901('0x4d')](_0x4d3a17['query'],_0x69ee92[_0x8901('0x43')]));_0x467d2e[_0x8901('0x4c')][_0x8901('0x62')]=_0x2e791c['id'];if(_0x4d3a17[_0x8901('0x41')][_0x8901('0x50')]){_0x467d2e[_0x8901('0x4c')]=_[_0x8901('0x4e')](_0x467d2e[_0x8901('0x4c')],{'$or':_[_0x8901('0x3a')](_0x467d2e['attributes'],function(_0x6c1d1f){var _0x3ead62={};_0x3ead62[_0x6c1d1f]={'$like':'%'+_0x4d3a17['query'][_0x8901('0x50')]+'%'};return _0x3ead62;})});}_0x467d2e=_[_0x8901('0x4e')]({},_0x467d2e,_0x4d3a17[_0x8901('0x51')]);return db[_0x8901('0x88')][_0x8901('0x2d')]({'where':_0x467d2e[_0x8901('0x4c')]})[_0x8901('0x1e')](function(_0x3d6e97){_0xcb13f0[_0x8901('0x2d')]=_0x3d6e97;if(_0x4d3a17['query'][_0x8901('0x52')]){_0x467d2e[_0x8901('0x53')]=[{'model':db['CmContact'],'as':_0x8901('0xa9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8901('0x36'),_0x8901('0xaa'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x8901('0xab'),'attributes':['id','name',_0x8901('0xac')],'where':_0x4d3a17[_0x8901('0x41')][_0x8901('0xad')]?{'id':_0x4d3a17[_0x8901('0x41')]['tag']}:undefined,'required':_0x4d3a17['query'][_0x8901('0xad')]?!![]:![]}];}return db[_0x8901('0x88')][_0x8901('0x54')](_0x467d2e);})[_0x8901('0x1e')](function(_0x5849cd){_0xcb13f0['rows']=_0x5849cd;return _0xcb13f0;});}})[_0x8901('0x1e')](respondWithFilteredResult(_0x20a623,_0x467d2e))[_0x8901('0x26')](handleError(_0x20a623,null));};exports[_0x8901('0xae')]=function(_0x404664,_0x2f9cb3,_0x4fef4c){return db['OpenchannelAccount'][_0x8901('0x57')]({'where':{'id':_0x404664[_0x8901('0x56')]['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x2f9cb3,null))['then'](function(_0x3ce8e6){if(_0x3ce8e6){return _0x3ce8e6['addAgents'](_0x404664[_0x8901('0x5f')]['ids'],_[_0x8901('0xaf')](_0x404664[_0x8901('0x5f')],[_0x8901('0x67'),'id'])||{})[_0x8901('0x8b')](function(_0x1db2cb){for(var _0xa00b0b=0x0;_0xa00b0b<_0x404664[_0x8901('0x5f')][_0x8901('0x67')][_0x8901('0x47')];_0xa00b0b+=0x1){socket[_0x8901('0xb0')](_0x8901('0xb1'),{'UserId':Number(_0x404664[_0x8901('0x5f')][_0x8901('0x67')][_0xa00b0b]),'OpenchannelAccountId':Number(_0x404664['params']['id'])});}return _0x1db2cb;});}})[_0x8901('0x1e')](respondWithResult(_0x2f9cb3,null))['catch'](handleError(_0x2f9cb3,null));};exports[_0x8901('0xb2')]=function(_0x214dfe,_0xa8f348,_0xc2513c){return db[_0x8901('0x3b')][_0x8901('0x57')]({'where':{'id':_0x214dfe[_0x8901('0x56')]['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0xa8f348,null))[_0x8901('0x1e')](function(_0x3b3dc7){if(_0x3b3dc7){return _0x3b3dc7[_0x8901('0xb2')](_0x214dfe['query'][_0x8901('0x67')])[_0x8901('0x1e')](function(){if(_[_0x8901('0xb3')](_0x214dfe[_0x8901('0x41')][_0x8901('0x67')])){for(var _0x4e1946=0x0;_0x4e1946<_0x214dfe['query']['ids'][_0x8901('0x47')];_0x4e1946+=0x1){socket[_0x8901('0xb0')](_0x8901('0xb4'),{'UserId':Number(_0x214dfe['query']['ids'][_0x4e1946]),'OpenchannelAccountId':Number(_0x214dfe[_0x8901('0x56')]['id'])});}}else{socket['emit'](_0x8901('0xb4'),{'UserId':Number(_0x214dfe[_0x8901('0x41')][_0x8901('0x67')]),'OpenchannelAccountId':Number(_0x214dfe[_0x8901('0x56')]['id'])});}});}})[_0x8901('0x1e')](respondWithStatusCode(_0xa8f348,null))[_0x8901('0x26')](handleError(_0xa8f348,null));};exports[_0x8901('0xb5')]=function(_0x5360f2,_0x3f14fe,_0x175cdf){var _0x344741={};var _0x3b206f={};var _0x217bf3;var _0x4bad48;return db[_0x8901('0x3b')][_0x8901('0x64')]({'where':{'id':_0x5360f2[_0x8901('0x56')]['id']}})['then'](handleEntityNotFound(_0x3f14fe,null))['then'](function(_0x18969c){if(_0x18969c){_0x217bf3=_0x18969c;_0x3b206f['model']=_[_0x8901('0x42')](db[_0x8901('0x97')]['rawAttributes']);_0x3b206f['query']=_[_0x8901('0x42')](_0x5360f2[_0x8901('0x41')]);_0x3b206f[_0x8901('0x43')]=_['intersection'](_0x3b206f[_0x8901('0x40')],_0x3b206f[_0x8901('0x41')]);_0x344741[_0x8901('0x45')]=_['intersection'](_0x3b206f[_0x8901('0x40')],qs[_0x8901('0x46')](_0x5360f2['query'][_0x8901('0x46')]));_0x344741[_0x8901('0x45')]=_0x344741['attributes'][_0x8901('0x47')]?_0x344741[_0x8901('0x45')]:_0x3b206f[_0x8901('0x40')];_0x344741[_0x8901('0x4a')]=qs[_0x8901('0x4b')](_0x5360f2[_0x8901('0x41')]['sort']);_0x344741['where']=qs[_0x8901('0x43')](_['pick'](_0x5360f2[_0x8901('0x41')],_0x3b206f[_0x8901('0x43')]));if(_0x5360f2[_0x8901('0x41')]['filter']){_0x344741[_0x8901('0x4c')]=_['merge'](_0x344741[_0x8901('0x4c')],{'$or':_[_0x8901('0x3a')](_0x344741[_0x8901('0x45')],function(_0x14a853){var _0xeb2c29={};_0xeb2c29[_0x14a853]={'$like':'%'+_0x5360f2[_0x8901('0x41')]['filter']+'%'};return _0xeb2c29;})});}_0x344741=_[_0x8901('0x4e')]({},_0x344741,_0x5360f2['options']);return _0x217bf3[_0x8901('0xb5')](_0x344741);}})[_0x8901('0x1e')](function(_0x51ff37){if(_0x51ff37){_0x4bad48=_0x51ff37[_0x8901('0x47')];if(!_0x5360f2[_0x8901('0x41')][_0x8901('0x48')](_0x8901('0x49'))){_0x344741[_0x8901('0x2c')]=qs[_0x8901('0x2c')](_0x5360f2[_0x8901('0x41')][_0x8901('0x2c')]);_0x344741[_0x8901('0x2a')]=qs[_0x8901('0x2a')](_0x5360f2[_0x8901('0x41')]['offset']);}return _0x217bf3['getAgents'](_0x344741);}})[_0x8901('0x1e')](function(_0x497337){if(_0x497337){return _0x497337?{'count':_0x4bad48,'rows':_0x497337}:null;}})['then'](respondWithResult(_0x3f14fe,null))[_0x8901('0x26')](handleError(_0x3f14fe,null));};exports[_0x8901('0xa6')]=function(_0x4c8467,_0x4f01bd,_0x55da6f){var _0x416bf9,_0x13fe59,_0x137351;if(_[_0x8901('0x75')](_0x4c8467[_0x8901('0x5f')][_0x8901('0x5f')])||_0x4c8467[_0x8901('0x5f')][_0x8901('0x5f')]===''){throw new db['Sequelize'][(_0x8901('0x6e'))](_0x8901('0x79'));}if(_[_0x8901('0x75')](_0x4c8467[_0x8901('0x5f')]['to'])){}_0x416bf9=_0x4c8467['body']['to'];return db['OpenchannelAccount'][_0x8901('0x64')]({'where':{'id':_0x4c8467['params']['id']}})[_0x8901('0x1e')](handleEntityNotFound(_0x4f01bd,null))['then'](function(_0x39c8b1){if(_0x39c8b1){return db[_0x8901('0x3b')][_0x8901('0x57')]({'where':{'id':_0x39c8b1['id']},'include':[{'model':db[_0x8901('0xb6')],'as':_0x8901('0x81'),'include':[{'model':db[_0x8901('0x6d')],'as':_0x8901('0x7e'),'where':{[_0x39c8b1[_0x8901('0x7a')]]:_0x416bf9},'limit':0x1,'order':[[_0x8901('0x71'),_0x8901('0x7f')]]}]}]})[_0x8901('0x1e')](handleEntityNotFound(_0x4f01bd,null))[_0x8901('0x1e')](function(_0x35efeb){if(_0x35efeb&&_0x35efeb[_0x8901('0x81')]){_0x13fe59=_0x35efeb[_0x8901('0x32')]({'plain':!![]});if(_0x13fe59['List']&&_0x13fe59[_0x8901('0x81')][_0x8901('0x7e')][_0x8901('0x47')]){return _0x13fe59[_0x8901('0x81')][_0x8901('0x7e')][0x0];}return db[_0x8901('0x6d')]['create'](_[_0x8901('0x18')](_0x4c8467['body'],{'firstName':_0x416bf9,[_0x35efeb[_0x8901('0x7a')]]:_0x416bf9,'phone':_0x416bf9,'ListId':_0x13fe59[_0x8901('0x74')]}));}})[_0x8901('0x1e')](handleEntityNotFound(_0x4f01bd,null))[_0x8901('0x1e')](function(_0x18ffbd){if(_0x18ffbd){_0x137351=_0x18ffbd;return db[_0x8901('0x88')]['find']({'where':{'ContactId':_0x137351['id'],'closed':![],'OpenchannelAccountId':_0x13fe59['id']}})[_0x8901('0x1e')](function(_0x470b41){if(_0x470b41){return[_0x470b41,![]];}return db[_0x8901('0x88')][_0x8901('0x58')]({'UserId':_0x4c8467[_0x8901('0x59')]['id'],'ContactId':_0x137351['id'],'OpenchannelAccountId':_0x13fe59['id'],'lastMsgDirection':'out','Messages':[_[_0x8901('0x4e')](_0x4c8467[_0x8901('0x5f')],{'read':![],'body':_0x4c8467[_0x8901('0x5f')]['body'],'OpenchannelAccountId':_0x13fe59['id'],'UserId':_0x4c8467[_0x8901('0x59')]['id'],'ContactId':_0x137351['id']})]},{'include':[{'model':db[_0x8901('0x95')],'as':'Messages'}]})[_0x8901('0x1e')](function(_0x503385){return[_0x503385,!![]];});});}})[_0x8901('0x8b')](function(_0x4ae40a,_0x3b2fb0){if(_0x3b2fb0){return _0x4ae40a;}return db[_0x8901('0x95')][_0x8901('0x58')](_[_0x8901('0x4e')](_0x4c8467[_0x8901('0x5f')],{'read':![],'body':_0x4c8467[_0x8901('0x5f')][_0x8901('0x5f')],'OpenchannelAccountId':_0x13fe59['id'],'OpenchannelInteractionId':_0x4ae40a['id'],'UserId':_0x4c8467['user']['id'],'ContactId':_0x137351['id']}))[_0x8901('0x1e')](function(_0x2c3b73){_0x4ae40a[_0x8901('0xb7')]['Messages']=[];_0x4ae40a[_0x8901('0xb7')]['Messages'][_0x8901('0x91')](_0x2c3b73[_0x8901('0xb7')]);return _0x4ae40a;});});}})['then'](respondWithResult(_0x4f01bd,null))[_0x8901('0x26')](handleError(_0x4f01bd,null));};
\ No newline at end of file
index 72878e8..4a1d461 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb5=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x0bb5,0x148));var _0x50bb=function(_0x49ec16,_0x28b456){_0x49ec16=_0x49ec16-0x0;var _0x1422b2=_0x0bb5[_0x49ec16];return _0x1422b2;};'use strict';var EventEmitter=require(_0x50bb('0x0'));var OpenchannelAccount=require(_0x50bb('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50bb('0x2'),'afterUpdate':_0x50bb('0x3'),'afterDestroy':_0x50bb('0x4')};function emitEvent(_0x117e36){return function(_0x29c72b,_0xfdc9d4,_0x451b4c){OpenchannelAccountEvents[_0x50bb('0x5')](_0x117e36+':'+_0x29c72b['id'],_0x29c72b);OpenchannelAccountEvents['emit'](_0x117e36,_0x29c72b);_0x451b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x50bb('0x6')](e,emitEvent(event));}}module[_0x50bb('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xac4a=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hook','events'];(function(_0x50ec4c,_0x496883){var _0xd72333=function(_0x5bbb80){while(--_0x5bbb80){_0x50ec4c['push'](_0x50ec4c['shift']());}};_0xd72333(++_0x496883);}(_0xac4a,0x13f));var _0xaac4=function(_0x10fc8f,_0x3733c0){_0x10fc8f=_0x10fc8f-0x0;var _0x254a67=_0xac4a[_0x10fc8f];return _0x254a67;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var OpenchannelAccount=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){OpenchannelAccountEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);OpenchannelAccountEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index 1d9fb2f..c677bc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xda5ef9,_0x1fcf66){var _0x5bacd8=function(_0x2288fa){while(--_0x2288fa){_0xda5ef9['push'](_0xda5ef9['shift']());}};_0x5bacd8(++_0x1fcf66);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x20714d,_0x166a4f){var _0x2929c5=function(_0x509308){while(--_0x509308){_0x20714d['push'](_0x20714d['shift']());}};_0x2929c5(++_0x166a4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8d52367..899b195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d25=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','redis','defaults','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x23f434,_0x370883){var _0x3d3fab=function(_0xc849a9){while(--_0xc849a9){_0x23f434['push'](_0x23f434['shift']());}};_0x3d3fab(++_0x370883);}(_0x7d25,0x8a));var _0x57d2=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x7d25[_0x20ef64];return _0x3707d8;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});config[_0x57d2('0x8')]=_[_0x57d2('0x9')](config[_0x57d2('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57d2('0x8')]));require('./openchannelAccount.socket')[_0x57d2('0xa')](socket);function respondWithRpcPromise(_0x5153c2,_0xa04872,_0x485438){return new BPromise(function(_0x429301,_0x1a86db){return client[_0x57d2('0xb')](_0x5153c2,_0x485438)[_0x57d2('0xc')](function(_0x2e8e12){logger[_0x57d2('0xd')](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));logger[_0x57d2('0x10')](_0x57d2('0x11'),_0xa04872,_0x57d2('0xf'),JSON[_0x57d2('0x12')](_0x2e8e12));if(_0x2e8e12[_0x57d2('0x13')]){if(_0x2e8e12[_0x57d2('0x13')][_0x57d2('0x14')]===0x1f4){logger[_0x57d2('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x1a86db(_0x2e8e12[_0x57d2('0x13')]['message']);}logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x429301(_0x2e8e12['error'][_0x57d2('0x15')]);}else{logger['info'](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));_0x429301(_0x2e8e12[_0x57d2('0x16')]['message']);}})['catch'](function(_0xbaeda8){logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0xbaeda8);_0x1a86db(_0xbaeda8);});});}
\ No newline at end of file
+var _0xcecc=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0xaeaf5e,_0x340ec7){var _0x46a767=function(_0x1c5840){while(--_0x1c5840){_0xaeaf5e['push'](_0xaeaf5e['shift']());}};_0x46a767(++_0x340ec7);}(_0xcecc,0x186));var _0xccec=function(_0x2d145b,_0xb094d4){_0x2d145b=_0x2d145b-0x0;var _0x1f8798=_0xcecc[_0x2d145b];return _0x1f8798;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var moment=require(_0xccec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccec('0x2'));var db=require(_0xccec('0x3'))['db'];var utils=require(_0xccec('0x4'));var logger=require(_0xccec('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xccec('0x6'));var client=jayson['client'][_0xccec('0x7')]({'port':0x232a});config[_0xccec('0x8')]=_[_0xccec('0x9')](config['redis'],{'host':_0xccec('0xa'),'port':0x18eb});var socket=require(_0xccec('0xb'))(new Redis(config['redis']));require(_0xccec('0xc'))[_0xccec('0xd')](socket);function respondWithRpcPromise(_0x45ba32,_0x108788,_0x4a936c){return new BPromise(function(_0x49ad58,_0x5d94a5){return client[_0xccec('0xe')](_0x45ba32,_0x4a936c)[_0xccec('0xf')](function(_0x547e6e){logger[_0xccec('0x10')](_0xccec('0x11'),_0x108788,_0xccec('0x12'));logger['debug'](_0xccec('0x13'),_0x108788,_0xccec('0x12'),JSON[_0xccec('0x14')](_0x547e6e));if(_0x547e6e[_0xccec('0x15')]){if(_0x547e6e[_0xccec('0x15')]['code']===0x1f4){logger[_0xccec('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x108788,_0x547e6e['error']['message']);return _0x5d94a5(_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);}logger[_0xccec('0x15')](_0xccec('0x11'),_0x108788,_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);return _0x49ad58(_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);}else{logger[_0xccec('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x108788,'request\x20sent');_0x49ad58(_0x547e6e['result'][_0xccec('0x16')]);}})['catch'](function(_0x76b9fd){logger[_0xccec('0x15')](_0xccec('0x11'),_0x108788,_0x76b9fd);_0x5d94a5(_0x76b9fd);});});}
\ No newline at end of file
index 523ffd1..971826a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbed7=['removeListener','register','./openchannelAccount.events','save','remove','update','emit'];(function(_0x115344,_0x308943){var _0x53c605=function(_0x18674e){while(--_0x18674e){_0x115344['push'](_0x115344['shift']());}};_0x53c605(++_0x308943);}(_0xbed7,0x14b));var _0x7bed=function(_0x404a57,_0x1ae6a1){_0x404a57=_0x404a57-0x0;var _0x53a46d=_0xbed7[_0x404a57];return _0x53a46d;};'use strict';var OpenchannelAccountEvents=require(_0x7bed('0x0'));var events=[_0x7bed('0x1'),_0x7bed('0x2'),_0x7bed('0x3')];function createListener(_0x3c9a9f,_0x47b9cb){return function(_0x44da5a){_0x47b9cb[_0x7bed('0x4')](_0x3c9a9f,_0x44da5a);};}function removeListener(_0x1da710,_0x18c2c7){return function(){OpenchannelAccountEvents[_0x7bed('0x5')](_0x1da710,_0x18c2c7);};}exports[_0x7bed('0x6')]=function(_0x41c148){for(var _0x3aa0e9=0x0,_0x38a818=events['length'];_0x3aa0e9<_0x38a818;_0x3aa0e9++){var _0x27434d=events[_0x3aa0e9];var _0x27f7d9=createListener('openchannelAccount:'+_0x27434d,_0x41c148);OpenchannelAccountEvents['on'](_0x27434d,_0x27f7d9);}};
\ No newline at end of file
+var _0xfc65=['emit','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x51aa13,_0x4a1dba){var _0x19877f=function(_0x13b7cd){while(--_0x13b7cd){_0x51aa13['push'](_0x51aa13['shift']());}};_0x19877f(++_0x4a1dba);}(_0xfc65,0x1b4));var _0x5fc6=function(_0x118740,_0x18a399){_0x118740=_0x118740-0x0;var _0x21aac5=_0xfc65[_0x118740];return _0x21aac5;};'use strict';var OpenchannelAccountEvents=require(_0x5fc6('0x0'));var events=[_0x5fc6('0x1'),_0x5fc6('0x2'),_0x5fc6('0x3')];function createListener(_0x43bdce,_0x280cbb){return function(_0x355810){_0x280cbb[_0x5fc6('0x4')](_0x43bdce,_0x355810);};}function removeListener(_0xe1ad23,_0x4e09e0){return function(){OpenchannelAccountEvents['removeListener'](_0xe1ad23,_0x4e09e0);};}exports[_0x5fc6('0x5')]=function(_0x2e1c2b){for(var _0x3e9bf3=0x0,_0x26d89e=events[_0x5fc6('0x6')];_0x3e9bf3<_0x26d89e;_0x3e9bf3++){var _0x5c93f7=events[_0x3e9bf3];var _0x5a47c1=createListener(_0x5fc6('0x7')+_0x5c93f7,_0x2e1c2b);OpenchannelAccountEvents['on'](_0x5c93f7,_0x5a47c1);}};
\ No newline at end of file
index bca04b5..5a0c155 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3bb=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x5683c7,_0x15bfb3){var _0x1755ff=function(_0x397be4){while(--_0x397be4){_0x5683c7['push'](_0x5683c7['shift']());}};_0x1755ff(++_0x15bfb3);}(_0xa3bb,0x6c));var _0xba3b=function(_0x2720ea,_0x3f5692){_0x2720ea=_0x2720ea-0x0;var _0x166de2=_0xa3bb[_0x2720ea];return _0x166de2;};'use strict';var multer=require(_0xba3b('0x0'));var util=require(_0xba3b('0x1'));var path=require(_0xba3b('0x2'));var timeout=require(_0xba3b('0x3'));var express=require(_0xba3b('0x4'));var router=express[_0xba3b('0x5')]();var fs_extra=require(_0xba3b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xba3b('0x7'));var config=require(_0xba3b('0x8'));var controller=require('./openchannelApplication.controller');router[_0xba3b('0x9')]('/',auth['isAuthenticated'](),controller[_0xba3b('0xa')]);router[_0xba3b('0x9')](_0xba3b('0xb'),auth[_0xba3b('0xc')](),controller[_0xba3b('0xd')]);router[_0xba3b('0xe')]('/',auth[_0xba3b('0xc')](),controller[_0xba3b('0xf')]);router[_0xba3b('0x10')]('/:id',auth[_0xba3b('0xc')](),controller[_0xba3b('0x11')]);router[_0xba3b('0x12')](_0xba3b('0xb'),auth['isAuthenticated'](),controller[_0xba3b('0x13')]);module[_0xba3b('0x14')]=router;
\ No newline at end of file
+var _0x1e46=['put','/:id','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','post','create'];(function(_0x2e9bb7,_0x8a9fa6){var _0x5e7067=function(_0x271f65){while(--_0x271f65){_0x2e9bb7['push'](_0x2e9bb7['shift']());}};_0x5e7067(++_0x8a9fa6);}(_0x1e46,0x136));var _0x61e4=function(_0x559a6c,_0x19a486){_0x559a6c=_0x559a6c-0x0;var _0x57bf23=_0x1e46[_0x559a6c];return _0x57bf23;};'use strict';var multer=require('multer');var util=require(_0x61e4('0x0'));var path=require(_0x61e4('0x1'));var timeout=require(_0x61e4('0x2'));var express=require(_0x61e4('0x3'));var router=express['Router']();var fs_extra=require(_0x61e4('0x4'));var auth=require(_0x61e4('0x5'));var interaction=require(_0x61e4('0x6'));var config=require(_0x61e4('0x7'));var controller=require(_0x61e4('0x8'));router[_0x61e4('0x9')]('/',auth[_0x61e4('0xa')](),controller[_0x61e4('0xb')]);router[_0x61e4('0x9')]('/:id',auth[_0x61e4('0xa')](),controller['show']);router[_0x61e4('0xc')]('/',auth[_0x61e4('0xa')](),controller[_0x61e4('0xd')]);router[_0x61e4('0xe')](_0x61e4('0xf'),auth[_0x61e4('0xa')](),controller['update']);router[_0x61e4('0x10')]('/:id',auth[_0x61e4('0xa')](),controller['destroy']);module[_0x61e4('0x11')]=router;
\ No newline at end of file
index 82bbc32..1404498 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0f6=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xd0f6,0x1c3));var _0x6d0f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd0f6[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x6d0f('0x0'));module[_0x6d0f('0x1')]={'priority':{'type':Sequelize[_0x6d0f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6d0f('0x3')],'allowNull':![],'defaultValue':_0x6d0f('0x4')},'appdata':{'type':Sequelize[_0x6d0f('0x5')]()},'description':{'type':Sequelize[_0x6d0f('0x3')]},'interval':{'type':Sequelize[_0x6d0f('0x3')],'defaultValue':_0x6d0f('0x6')}};
\ No newline at end of file
+var _0x4ad2=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x384676,_0x562eb0){var _0x2f3462=function(_0x29c7c6){while(--_0x29c7c6){_0x384676['push'](_0x384676['shift']());}};_0x2f3462(++_0x562eb0);}(_0x4ad2,0x9d));var _0x24ad=function(_0x18d95a,_0x4a9f57){_0x18d95a=_0x18d95a-0x0;var _0x5b1b16=_0x4ad2[_0x18d95a];return _0x5b1b16;};'use strict';var Sequelize=require(_0x24ad('0x0'));module[_0x24ad('0x1')]={'priority':{'type':Sequelize[_0x24ad('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x24ad('0x3')],'allowNull':![],'defaultValue':_0x24ad('0x4')},'appdata':{'type':Sequelize[_0x24ad('0x5')]()},'description':{'type':Sequelize[_0x24ad('0x3')]},'interval':{'type':Sequelize[_0x24ad('0x3')],'defaultValue':_0x24ad('0x6')}};
\ No newline at end of file
index ba29578..6906f0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e3e=['path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','OpenchannelApplication','includeAll','include','findAll','rows','keys','intersection','length','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x5b2549,_0x4ca1a4){var _0x2099cc=function(_0x5a9f32){while(--_0x5a9f32){_0x5b2549['push'](_0x5b2549['shift']());}};_0x2099cc(++_0x4ca1a4);}(_0x9e3e,0xd7));var _0xe9e3=function(_0x31fb52,_0xded904){_0x31fb52=_0x31fb52-0x0;var _0x3fc244=_0x9e3e[_0x31fb52];return _0x3fc244;};'use strict';var emlformat=require(_0xe9e3('0x0'));var rimraf=require(_0xe9e3('0x1'));var zipdir=require(_0xe9e3('0x2'));var jsonpatch=require(_0xe9e3('0x3'));var rp=require(_0xe9e3('0x4'));var moment=require(_0xe9e3('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9e3('0x6'));var path=require(_0xe9e3('0x7'));var sox=require(_0xe9e3('0x8'));var csv=require(_0xe9e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9e3('0xa'));var _=require(_0xe9e3('0xb'));var squel=require(_0xe9e3('0xc'));var crypto=require('crypto');var jsforce=require(_0xe9e3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe9e3('0x9'));var querystring=require(_0xe9e3('0xe'));var Papa=require(_0xe9e3('0xf'));var Redis=require(_0xe9e3('0x10'));var authService=require(_0xe9e3('0x11'));var qs=require(_0xe9e3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9e3('0x13'));var logger=require('../../config/logger')(_0xe9e3('0x14'));var utils=require(_0xe9e3('0x15'));var config=require(_0xe9e3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9e3('0x17'))['db'];function respondWithStatusCode(_0x26d402,_0x2fea3e){_0x2fea3e=_0x2fea3e||0xcc;return function(_0x4fdbb4){if(_0x4fdbb4){return _0x26d402[_0xe9e3('0x18')](_0x2fea3e);}return _0x26d402[_0xe9e3('0x19')](_0x2fea3e)[_0xe9e3('0x1a')]();};}function respondWithResult(_0x3dece1,_0xa7f72f){_0xa7f72f=_0xa7f72f||0xc8;return function(_0x56b127){if(_0x56b127){return _0x3dece1[_0xe9e3('0x19')](_0xa7f72f)[_0xe9e3('0x1b')](_0x56b127);}};}function respondWithFilteredResult(_0x3806e6,_0x555236){return function(_0x2a239c){if(_0x2a239c){var _0xa226fa=typeof _0x555236[_0xe9e3('0x1c')]==='undefined'&&typeof _0x555236[_0xe9e3('0x1d')]===_0xe9e3('0x1e');var _0x298fb5=_0x2a239c[_0xe9e3('0x1f')];var _0x21ab3d=_0xa226fa?0x0:_0x555236[_0xe9e3('0x1c')];var _0x3a7486=_0xa226fa?_0x2a239c[_0xe9e3('0x1f')]:_0x555236['offset']+_0x555236[_0xe9e3('0x1d')];var _0x486794;if(_0x3a7486>=_0x298fb5){_0x3a7486=_0x298fb5;_0x486794=0xc8;}else{_0x486794=0xce;}_0x3806e6[_0xe9e3('0x19')](_0x486794);return _0x3806e6['set']('Content-Range',_0x21ab3d+'-'+_0x3a7486+'/'+_0x298fb5)[_0xe9e3('0x1b')](_0x2a239c);}return null;};}function patchUpdates(_0x388671){return function(_0x492314){try{jsonpatch[_0xe9e3('0x20')](_0x492314,_0x388671,!![]);}catch(_0x4d94e8){return BPromise[_0xe9e3('0x21')](_0x4d94e8);}return _0x492314[_0xe9e3('0x22')]();};}function saveUpdates(_0x125164,_0x1d5d61){return function(_0x157ba1){if(_0x157ba1){return _0x157ba1[_0xe9e3('0x23')](_0x125164)[_0xe9e3('0x24')](function(_0x4ccf28){return _0x4ccf28;});}return null;};}function removeEntity(_0x114b12,_0x3f8595){return function(_0x1b8643){if(_0x1b8643){return _0x1b8643[_0xe9e3('0x25')]()['then'](function(){_0x114b12[_0xe9e3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c0634,_0x18f8be){return function(_0x5bc592){if(!_0x5bc592){_0x5c0634[_0xe9e3('0x18')](0x194);}return _0x5bc592;};}function handleError(_0x4e2fdb,_0x4c9560){_0x4c9560=_0x4c9560||0x1f4;return function(_0x2f5030){logger[_0xe9e3('0x26')](_0x2f5030[_0xe9e3('0x27')]);if(_0x2f5030[_0xe9e3('0x28')]){delete _0x2f5030[_0xe9e3('0x28')];}_0x4e2fdb[_0xe9e3('0x19')](_0x4c9560)[_0xe9e3('0x29')](_0x2f5030);};}exports['index']=function(_0x3689bf,_0x52afa7){var _0x42035d={},_0x3a8bb3={},_0x3c27b6={'count':0x0,'rows':[]};var _0x246630=_[_0xe9e3('0x2a')](db['OpenchannelApplication'][_0xe9e3('0x2b')],function(_0x483bab){return{'name':_0x483bab[_0xe9e3('0x2c')],'type':_0x483bab[_0xe9e3('0x2d')][_0xe9e3('0x2e')]};});_0x3a8bb3[_0xe9e3('0x2f')]=_[_0xe9e3('0x2a')](_0x246630,_0xe9e3('0x28'));_0x3a8bb3[_0xe9e3('0x30')]=_['keys'](_0x3689bf['query']);_0x3a8bb3[_0xe9e3('0x31')]=_['intersection'](_0x3a8bb3[_0xe9e3('0x2f')],_0x3a8bb3[_0xe9e3('0x30')]);_0x42035d[_0xe9e3('0x32')]=_['intersection'](_0x3a8bb3[_0xe9e3('0x2f')],qs[_0xe9e3('0x33')](_0x3689bf[_0xe9e3('0x30')][_0xe9e3('0x33')]));_0x42035d[_0xe9e3('0x32')]=_0x42035d[_0xe9e3('0x32')]['length']?_0x42035d[_0xe9e3('0x32')]:_0x3a8bb3[_0xe9e3('0x2f')];if(!_0x3689bf['query'][_0xe9e3('0x34')](_0xe9e3('0x35'))){_0x42035d[_0xe9e3('0x1d')]=qs[_0xe9e3('0x1d')](_0x3689bf[_0xe9e3('0x30')][_0xe9e3('0x1d')]);_0x42035d[_0xe9e3('0x1c')]=qs['offset'](_0x3689bf[_0xe9e3('0x30')][_0xe9e3('0x1c')]);}_0x42035d[_0xe9e3('0x36')]=qs[_0xe9e3('0x37')](_0x3689bf[_0xe9e3('0x30')][_0xe9e3('0x37')]);_0x42035d[_0xe9e3('0x38')]=qs['filters'](_[_0xe9e3('0x39')](_0x3689bf[_0xe9e3('0x30')],_0x3a8bb3['filters']),_0x246630);if(_0x3689bf[_0xe9e3('0x30')]['filter']){_0x42035d[_0xe9e3('0x38')]=_[_0xe9e3('0x3a')](_0x42035d[_0xe9e3('0x38')],{'$or':_[_0xe9e3('0x2a')](_0x246630,function(_0x5dfa7d){if(_0x5dfa7d[_0xe9e3('0x2d')]!=='VIRTUAL'){var _0x383e9c={};_0x383e9c[_0x5dfa7d[_0xe9e3('0x28')]]={'$like':'%'+_0x3689bf['query'][_0xe9e3('0x3b')]+'%'};return _0x383e9c;}})});}_0x42035d=_[_0xe9e3('0x3a')]({},_0x42035d,_0x3689bf[_0xe9e3('0x3c')]);var _0x9e1d62={'where':_0x42035d[_0xe9e3('0x38')]};return db[_0xe9e3('0x3d')][_0xe9e3('0x1f')](_0x9e1d62)['then'](function(_0x47061d){_0x3c27b6[_0xe9e3('0x1f')]=_0x47061d;if(_0x3689bf[_0xe9e3('0x30')][_0xe9e3('0x3e')]){_0x42035d[_0xe9e3('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xe9e3('0x40')](_0x42035d);})[_0xe9e3('0x24')](function(_0xc6cf26){_0x3c27b6[_0xe9e3('0x41')]=_0xc6cf26;return _0x3c27b6;})[_0xe9e3('0x24')](respondWithFilteredResult(_0x52afa7,_0x42035d))['catch'](handleError(_0x52afa7,null));};exports['show']=function(_0x107241,_0x18d6d3){var _0x33794e={'raw':!![],'where':{'id':_0x107241['params']['id']}},_0xf72d50={};_0xf72d50['model']=_[_0xe9e3('0x42')](db[_0xe9e3('0x3d')][_0xe9e3('0x2b')]);_0xf72d50[_0xe9e3('0x30')]=_[_0xe9e3('0x42')](_0x107241[_0xe9e3('0x30')]);_0xf72d50['filters']=_[_0xe9e3('0x43')](_0xf72d50[_0xe9e3('0x2f')],_0xf72d50['query']);_0x33794e[_0xe9e3('0x32')]=_['intersection'](_0xf72d50[_0xe9e3('0x2f')],qs['fields'](_0x107241[_0xe9e3('0x30')][_0xe9e3('0x33')]));_0x33794e[_0xe9e3('0x32')]=_0x33794e[_0xe9e3('0x32')][_0xe9e3('0x44')]?_0x33794e['attributes']:_0xf72d50[_0xe9e3('0x2f')];if(_0x107241['query']['includeAll']){_0x33794e[_0xe9e3('0x3f')]=[{'all':!![]}];}_0x33794e=_[_0xe9e3('0x3a')]({},_0x33794e,_0x107241[_0xe9e3('0x3c')]);return db['OpenchannelApplication'][_0xe9e3('0x45')](_0x33794e)[_0xe9e3('0x24')](handleEntityNotFound(_0x18d6d3,null))[_0xe9e3('0x24')](respondWithResult(_0x18d6d3,null))['catch'](handleError(_0x18d6d3,null));};exports[_0xe9e3('0x46')]=function(_0x3eb952,_0x216a28){return db[_0xe9e3('0x3d')][_0xe9e3('0x46')](_0x3eb952[_0xe9e3('0x47')],{})[_0xe9e3('0x24')](respondWithResult(_0x216a28,0xc9))[_0xe9e3('0x48')](handleError(_0x216a28,null));};exports[_0xe9e3('0x23')]=function(_0x14b4bc,_0x118869){if(_0x14b4bc[_0xe9e3('0x47')]['id']){delete _0x14b4bc[_0xe9e3('0x47')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x14b4bc[_0xe9e3('0x49')]['id']}})[_0xe9e3('0x24')](handleEntityNotFound(_0x118869,null))[_0xe9e3('0x24')](saveUpdates(_0x14b4bc[_0xe9e3('0x47')],null))[_0xe9e3('0x24')](respondWithResult(_0x118869,null))['catch'](handleError(_0x118869,null));};exports[_0xe9e3('0x25')]=function(_0x132921,_0x2c56db){return db[_0xe9e3('0x3d')][_0xe9e3('0x45')]({'where':{'id':_0x132921['params']['id']}})[_0xe9e3('0x24')](handleEntityNotFound(_0x2c56db,null))['then'](removeEntity(_0x2c56db,null))['catch'](handleError(_0x2c56db,null));};
\ No newline at end of file
+var _0xc7db=['catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','json','update','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc7db,0x1a9));var _0xbc7d=function(_0x131096,_0x5019c){_0x131096=_0x131096-0x0;var _0x3bcdd5=_0xc7db[_0x131096];return _0x3bcdd5;};'use strict';var emlformat=require(_0xbc7d('0x0'));var rimraf=require(_0xbc7d('0x1'));var zipdir=require(_0xbc7d('0x2'));var jsonpatch=require(_0xbc7d('0x3'));var rp=require(_0xbc7d('0x4'));var moment=require(_0xbc7d('0x5'));var BPromise=require(_0xbc7d('0x6'));var Mustache=require('mustache');var util=require(_0xbc7d('0x7'));var path=require('path');var sox=require(_0xbc7d('0x8'));var csv=require('to-csv');var ejs=require(_0xbc7d('0x9'));var fs=require('fs');var fs_extra=require(_0xbc7d('0xa'));var _=require(_0xbc7d('0xb'));var squel=require(_0xbc7d('0xc'));var crypto=require(_0xbc7d('0xd'));var jsforce=require(_0xbc7d('0xe'));var deskjs=require(_0xbc7d('0xf'));var toCsv=require(_0xbc7d('0x10'));var querystring=require('querystring');var Papa=require(_0xbc7d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbc7d('0x12'));var as=require(_0xbc7d('0x13'));var hardwareService=require(_0xbc7d('0x14'));var logger=require('../../config/logger')(_0xbc7d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbc7d('0x16'));var db=require(_0xbc7d('0x17'))['db'];function respondWithStatusCode(_0x3f90ac,_0x45b398){_0x45b398=_0x45b398||0xcc;return function(_0x2bb323){if(_0x2bb323){return _0x3f90ac['sendStatus'](_0x45b398);}return _0x3f90ac[_0xbc7d('0x18')](_0x45b398)[_0xbc7d('0x19')]();};}function respondWithResult(_0x4bd954,_0x31dcba){_0x31dcba=_0x31dcba||0xc8;return function(_0x10636b){if(_0x10636b){return _0x4bd954[_0xbc7d('0x18')](_0x31dcba)['json'](_0x10636b);}};}function respondWithFilteredResult(_0x4085e6,_0x139038){return function(_0x3c3f7b){if(_0x3c3f7b){var _0x46ad5f=typeof _0x139038['offset']==='undefined'&&typeof _0x139038[_0xbc7d('0x1a')]===_0xbc7d('0x1b');var _0x28cf00=_0x3c3f7b[_0xbc7d('0x1c')];var _0x30a063=_0x46ad5f?0x0:_0x139038[_0xbc7d('0x1d')];var _0x15402e=_0x46ad5f?_0x3c3f7b['count']:_0x139038['offset']+_0x139038[_0xbc7d('0x1a')];var _0x520a9e;if(_0x15402e>=_0x28cf00){_0x15402e=_0x28cf00;_0x520a9e=0xc8;}else{_0x520a9e=0xce;}_0x4085e6[_0xbc7d('0x18')](_0x520a9e);return _0x4085e6['set']('Content-Range',_0x30a063+'-'+_0x15402e+'/'+_0x28cf00)[_0xbc7d('0x1e')](_0x3c3f7b);}return null;};}function patchUpdates(_0x3658bd){return function(_0x40034c){try{jsonpatch['apply'](_0x40034c,_0x3658bd,!![]);}catch(_0xc9d7ff){return BPromise['reject'](_0xc9d7ff);}return _0x40034c['save']();};}function saveUpdates(_0x4228a5,_0x277622){return function(_0xfc3f3d){if(_0xfc3f3d){return _0xfc3f3d[_0xbc7d('0x1f')](_0x4228a5)[_0xbc7d('0x20')](function(_0x3a3840){return _0x3a3840;});}return null;};}function removeEntity(_0x3f0b36,_0x22ed96){return function(_0x5dec7d){if(_0x5dec7d){return _0x5dec7d[_0xbc7d('0x21')]()[_0xbc7d('0x20')](function(){_0x3f0b36[_0xbc7d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc431,_0x3a07e8){return function(_0x1dd121){if(!_0x1dd121){_0x3cc431[_0xbc7d('0x22')](0x194);}return _0x1dd121;};}function handleError(_0x2bcf58,_0x4b427e){_0x4b427e=_0x4b427e||0x1f4;return function(_0x46fab8){logger[_0xbc7d('0x23')](_0x46fab8[_0xbc7d('0x24')]);if(_0x46fab8['name']){delete _0x46fab8[_0xbc7d('0x25')];}_0x2bcf58[_0xbc7d('0x18')](_0x4b427e)[_0xbc7d('0x26')](_0x46fab8);};}exports[_0xbc7d('0x27')]=function(_0x4ab28d,_0x25d54e){var _0x3dd00a={},_0x3d9e4e={},_0x31a099={'count':0x0,'rows':[]};var _0x2a01e1=_['map'](db[_0xbc7d('0x28')][_0xbc7d('0x29')],function(_0x28ab3d){return{'name':_0x28ab3d[_0xbc7d('0x2a')],'type':_0x28ab3d[_0xbc7d('0x2b')][_0xbc7d('0x2c')]};});_0x3d9e4e['model']=_[_0xbc7d('0x2d')](_0x2a01e1,'name');_0x3d9e4e['query']=_[_0xbc7d('0x2e')](_0x4ab28d[_0xbc7d('0x2f')]);_0x3d9e4e[_0xbc7d('0x30')]=_[_0xbc7d('0x31')](_0x3d9e4e[_0xbc7d('0x32')],_0x3d9e4e[_0xbc7d('0x2f')]);_0x3dd00a[_0xbc7d('0x33')]=_[_0xbc7d('0x31')](_0x3d9e4e[_0xbc7d('0x32')],qs[_0xbc7d('0x34')](_0x4ab28d[_0xbc7d('0x2f')][_0xbc7d('0x34')]));_0x3dd00a['attributes']=_0x3dd00a['attributes']['length']?_0x3dd00a[_0xbc7d('0x33')]:_0x3d9e4e[_0xbc7d('0x32')];if(!_0x4ab28d[_0xbc7d('0x2f')][_0xbc7d('0x35')](_0xbc7d('0x36'))){_0x3dd00a[_0xbc7d('0x1a')]=qs[_0xbc7d('0x1a')](_0x4ab28d[_0xbc7d('0x2f')][_0xbc7d('0x1a')]);_0x3dd00a[_0xbc7d('0x1d')]=qs[_0xbc7d('0x1d')](_0x4ab28d[_0xbc7d('0x2f')][_0xbc7d('0x1d')]);}_0x3dd00a[_0xbc7d('0x37')]=qs['sort'](_0x4ab28d[_0xbc7d('0x2f')]['sort']);_0x3dd00a['where']=qs[_0xbc7d('0x30')](_[_0xbc7d('0x38')](_0x4ab28d[_0xbc7d('0x2f')],_0x3d9e4e['filters']),_0x2a01e1);if(_0x4ab28d[_0xbc7d('0x2f')]['filter']){_0x3dd00a[_0xbc7d('0x39')]=_[_0xbc7d('0x3a')](_0x3dd00a['where'],{'$or':_['map'](_0x2a01e1,function(_0x11a420){if(_0x11a420[_0xbc7d('0x2b')]!==_0xbc7d('0x3b')){var _0x6570c2={};_0x6570c2[_0x11a420[_0xbc7d('0x25')]]={'$like':'%'+_0x4ab28d[_0xbc7d('0x2f')][_0xbc7d('0x3c')]+'%'};return _0x6570c2;}})});}_0x3dd00a=_[_0xbc7d('0x3a')]({},_0x3dd00a,_0x4ab28d[_0xbc7d('0x3d')]);var _0x573314={'where':_0x3dd00a['where']};return db['OpenchannelApplication'][_0xbc7d('0x1c')](_0x573314)['then'](function(_0x26a1db){_0x31a099[_0xbc7d('0x1c')]=_0x26a1db;if(_0x4ab28d[_0xbc7d('0x2f')][_0xbc7d('0x3e')]){_0x3dd00a[_0xbc7d('0x3f')]=[{'all':!![]}];}return db[_0xbc7d('0x28')][_0xbc7d('0x40')](_0x3dd00a);})[_0xbc7d('0x20')](function(_0x50c995){_0x31a099['rows']=_0x50c995;return _0x31a099;})[_0xbc7d('0x20')](respondWithFilteredResult(_0x25d54e,_0x3dd00a))[_0xbc7d('0x41')](handleError(_0x25d54e,null));};exports['show']=function(_0xa45b03,_0x207298){var _0x3ea276={'raw':!![],'where':{'id':_0xa45b03[_0xbc7d('0x42')]['id']}},_0x2cdd75={};_0x2cdd75[_0xbc7d('0x32')]=_[_0xbc7d('0x2e')](db[_0xbc7d('0x28')][_0xbc7d('0x29')]);_0x2cdd75[_0xbc7d('0x2f')]=_[_0xbc7d('0x2e')](_0xa45b03['query']);_0x2cdd75[_0xbc7d('0x30')]=_['intersection'](_0x2cdd75[_0xbc7d('0x32')],_0x2cdd75[_0xbc7d('0x2f')]);_0x3ea276['attributes']=_['intersection'](_0x2cdd75[_0xbc7d('0x32')],qs['fields'](_0xa45b03[_0xbc7d('0x2f')]['fields']));_0x3ea276[_0xbc7d('0x33')]=_0x3ea276[_0xbc7d('0x33')]['length']?_0x3ea276[_0xbc7d('0x33')]:_0x2cdd75[_0xbc7d('0x32')];if(_0xa45b03[_0xbc7d('0x2f')][_0xbc7d('0x3e')]){_0x3ea276[_0xbc7d('0x3f')]=[{'all':!![]}];}_0x3ea276=_[_0xbc7d('0x3a')]({},_0x3ea276,_0xa45b03['options']);return db['OpenchannelApplication'][_0xbc7d('0x43')](_0x3ea276)[_0xbc7d('0x20')](handleEntityNotFound(_0x207298,null))[_0xbc7d('0x20')](respondWithResult(_0x207298,null))[_0xbc7d('0x41')](handleError(_0x207298,null));};exports['create']=function(_0xf91802,_0x330e60){return db[_0xbc7d('0x28')][_0xbc7d('0x44')](_0xf91802[_0xbc7d('0x45')],{})[_0xbc7d('0x20')](respondWithResult(_0x330e60,0xc9))[_0xbc7d('0x41')](handleError(_0x330e60,null));};exports[_0xbc7d('0x1f')]=function(_0x122179,_0x1727f7){if(_0x122179[_0xbc7d('0x45')]['id']){delete _0x122179[_0xbc7d('0x45')]['id'];}return db['OpenchannelApplication'][_0xbc7d('0x43')]({'where':{'id':_0x122179[_0xbc7d('0x42')]['id']}})[_0xbc7d('0x20')](handleEntityNotFound(_0x1727f7,null))[_0xbc7d('0x20')](saveUpdates(_0x122179[_0xbc7d('0x45')],null))[_0xbc7d('0x20')](respondWithResult(_0x1727f7,null))[_0xbc7d('0x41')](handleError(_0x1727f7,null));};exports[_0xbc7d('0x21')]=function(_0x3acba7,_0x356c02){return db['OpenchannelApplication'][_0xbc7d('0x43')]({'where':{'id':_0x3acba7['params']['id']}})[_0xbc7d('0x20')](handleEntityNotFound(_0x356c02,null))[_0xbc7d('0x20')](removeEntity(_0x356c02,null))[_0xbc7d('0x41')](handleError(_0x356c02,null));};
\ No newline at end of file
index fdba118..dc1d5e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff08=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define'];(function(_0x3c546b,_0x40b3f5){var _0x2d2682=function(_0x3c971b){while(--_0x3c971b){_0x3c546b['push'](_0x3c546b['shift']());}};_0x2d2682(++_0x40b3f5);}(_0xff08,0x8f));var _0x8ff0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xff08[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8ff0('0x0'));var util=require(_0x8ff0('0x1'));var logger=require(_0x8ff0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8ff0('0x3'));var rp=require(_0x8ff0('0x4'));var fs=require('fs');var path=require(_0x8ff0('0x5'));var rimraf=require(_0x8ff0('0x6'));var config=require(_0x8ff0('0x7'));var attributes=require(_0x8ff0('0x8'));module[_0x8ff0('0x9')]=function(_0x47d8f0,_0x275910){return _0x47d8f0[_0x8ff0('0xa')]('OpenchannelApplication',attributes,{'tableName':_0x8ff0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ff0('0xc'),'collate':_0x8ff0('0xd')});};
\ No newline at end of file
+var _0x6948=['utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','rimraf','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x44d56e,_0x1286d5){var _0x2ba0ef=function(_0x3994b8){while(--_0x3994b8){_0x44d56e['push'](_0x44d56e['shift']());}};_0x2ba0ef(++_0x1286d5);}(_0x6948,0x7a));var _0x8694=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6948[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8694('0x0'));var util=require('util');var logger=require(_0x8694('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8694('0x2'));var rp=require(_0x8694('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8694('0x4'));var config=require('../../config/environment');var attributes=require(_0x8694('0x5'));module['exports']=function(_0x4592cd,_0x4b60ca){return _0x4592cd[_0x8694('0x6')](_0x8694('0x7'),attributes,{'tableName':_0x8694('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8694('0x9'),'collate':_0x8694('0xa')});};
\ No newline at end of file
index 9b1d451..72f243c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4125=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','info','debug','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2540db,_0x9b7318){var _0xbf6e9f=function(_0x5be1c6){while(--_0x5be1c6){_0x2540db['push'](_0x2540db['shift']());}};_0xbf6e9f(++_0x9b7318);}(_0x4125,0xfa));var _0x5412=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x4125[_0x1780f8];return _0x33a410;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5412('0x0'));var BPromise=require('bluebird');var rs=require(_0x5412('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5412('0x2'))['db'];var utils=require(_0x5412('0x3'));var logger=require(_0x5412('0x4'))(_0x5412('0x5'));var config=require(_0x5412('0x6'));var jayson=require(_0x5412('0x7'));var client=jayson['client'][_0x5412('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1368ad,_0x414728,_0x26ad96){return new BPromise(function(_0x1529ec,_0x562f5e){return client[_0x5412('0x9')](_0x1368ad,_0x26ad96)[_0x5412('0xa')](function(_0x1fcc0c){logger['info'](_0x5412('0xb'),_0x414728,_0x5412('0xc'));logger['debug'](_0x5412('0xd'),_0x414728,'request\x20sent',JSON[_0x5412('0xe')](_0x1fcc0c));if(_0x1fcc0c[_0x5412('0xf')]){if(_0x1fcc0c[_0x5412('0xf')]['code']===0x1f4){logger['error'](_0x5412('0xb'),_0x414728,_0x1fcc0c[_0x5412('0xf')]['message']);return _0x562f5e(_0x1fcc0c['error']['message']);}logger[_0x5412('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x414728,_0x1fcc0c['error'][_0x5412('0x10')]);return _0x1529ec(_0x1fcc0c[_0x5412('0xf')][_0x5412('0x10')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x414728,'request\x20sent');_0x1529ec(_0x1fcc0c[_0x5412('0x11')][_0x5412('0x10')]);}})['catch'](function(_0x57f91f){logger[_0x5412('0xf')](_0x5412('0xb'),_0x414728,_0x57f91f);_0x562f5e(_0x57f91f);});});}exports[_0x5412('0x12')]=function(_0x58f196){var _0x340d72=this;return new Promise(function(_0x37eb23,_0xfff87d){return db[_0x5412('0x13')][_0x5412('0x14')](_0x58f196['body'],{'raw':_0x58f196[_0x5412('0x15')]?_0x58f196[_0x5412('0x15')][_0x5412('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58f196[_0x5412('0x15')]?_0x58f196[_0x5412('0x15')][_0x5412('0x17')]||null:null,'attributes':_0x58f196[_0x5412('0x15')]?_0x58f196['options'][_0x5412('0x18')]||null:null,'limit':_0x58f196[_0x5412('0x15')]?_0x58f196[_0x5412('0x15')][_0x5412('0x19')]||null:null})['then'](function(_0x1474f3){logger[_0x5412('0x1a')](_0x5412('0x12'),_0x58f196);logger[_0x5412('0x1b')]('UpdateOpenchannelApplication',_0x58f196,JSON[_0x5412('0xe')](_0x1474f3));_0x37eb23(_0x1474f3);})[_0x5412('0x1c')](function(_0x93cd33){logger[_0x5412('0xf')](_0x5412('0x12'),_0x93cd33['message'],_0x58f196);_0xfff87d(_0x340d72[_0x5412('0xf')](0x1f4,_0x93cd33[_0x5412('0x10')]));});});};
\ No newline at end of file
+var _0xb5f0=['body','options','raw','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xb5f0,0x113));var _0x0b5f=function(_0x4418c1,_0x36950f){_0x4418c1=_0x4418c1-0x0;var _0x287fee=_0xb5f0[_0x4418c1];return _0x287fee;};'use strict';var _=require(_0x0b5f('0x0'));var util=require(_0x0b5f('0x1'));var moment=require(_0x0b5f('0x2'));var BPromise=require(_0x0b5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b5f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b5f('0x5'));var logger=require('../../config/logger')(_0x0b5f('0x6'));var config=require(_0x0b5f('0x7'));var jayson=require(_0x0b5f('0x8'));var client=jayson[_0x0b5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e14d1,_0x10ad03,_0x2f4005){return new BPromise(function(_0x49f762,_0x1bb270){return client[_0x0b5f('0xa')](_0x1e14d1,_0x2f4005)[_0x0b5f('0xb')](function(_0x37e298){logger[_0x0b5f('0xc')](_0x0b5f('0xd'),_0x10ad03,_0x0b5f('0xe'));logger[_0x0b5f('0xf')](_0x0b5f('0x10'),_0x10ad03,_0x0b5f('0xe'),JSON[_0x0b5f('0x11')](_0x37e298));if(_0x37e298[_0x0b5f('0x12')]){if(_0x37e298[_0x0b5f('0x12')][_0x0b5f('0x13')]===0x1f4){logger[_0x0b5f('0x12')](_0x0b5f('0xd'),_0x10ad03,_0x37e298[_0x0b5f('0x12')][_0x0b5f('0x14')]);return _0x1bb270(_0x37e298[_0x0b5f('0x12')][_0x0b5f('0x14')]);}logger[_0x0b5f('0x12')](_0x0b5f('0xd'),_0x10ad03,_0x37e298['error']['message']);return _0x49f762(_0x37e298[_0x0b5f('0x12')][_0x0b5f('0x14')]);}else{logger[_0x0b5f('0xc')](_0x0b5f('0xd'),_0x10ad03,'request\x20sent');_0x49f762(_0x37e298[_0x0b5f('0x15')][_0x0b5f('0x14')]);}})[_0x0b5f('0x16')](function(_0x115423){logger[_0x0b5f('0x12')](_0x0b5f('0xd'),_0x10ad03,_0x115423);_0x1bb270(_0x115423);});});}exports[_0x0b5f('0x17')]=function(_0x2d27f3){var _0x135ce8=this;return new Promise(function(_0x217631,_0x1416a3){return db[_0x0b5f('0x18')]['update'](_0x2d27f3[_0x0b5f('0x19')],{'raw':_0x2d27f3[_0x0b5f('0x1a')]?_0x2d27f3[_0x0b5f('0x1a')][_0x0b5f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d27f3[_0x0b5f('0x1a')]?_0x2d27f3[_0x0b5f('0x1a')]['where']||null:null,'attributes':_0x2d27f3[_0x0b5f('0x1a')]?_0x2d27f3['options'][_0x0b5f('0x1c')]||null:null,'limit':_0x2d27f3['options']?_0x2d27f3[_0x0b5f('0x1a')][_0x0b5f('0x1d')]||null:null})[_0x0b5f('0xb')](function(_0x31961a){logger[_0x0b5f('0xc')](_0x0b5f('0x17'),_0x2d27f3);logger['debug'](_0x0b5f('0x17'),_0x2d27f3,JSON['stringify'](_0x31961a));_0x217631(_0x31961a);})['catch'](function(_0x55d24b){logger[_0x0b5f('0x12')](_0x0b5f('0x17'),_0x55d24b[_0x0b5f('0x14')],_0x2d27f3);_0x1416a3(_0x135ce8['error'](0x1f4,_0x55d24b[_0x0b5f('0x14')]));});});};
\ No newline at end of file
index 24a7397..52a0bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecf5=['openchannel','openchannelinteraction:update','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','/:id'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0xecf5,0x17e));var _0x5ecf=function(_0x55abee,_0xea927a){_0x55abee=_0x55abee-0x0;var _0x21f30c=_0xecf5[_0x55abee];return _0x21f30c;};'use strict';var multer=require(_0x5ecf('0x0'));var util=require(_0x5ecf('0x1'));var path=require(_0x5ecf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5ecf('0x3')]();var fs_extra=require(_0x5ecf('0x4'));var auth=require(_0x5ecf('0x5'));var interaction=require(_0x5ecf('0x6'));var config=require(_0x5ecf('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x5ecf('0x8')]('/',auth[_0x5ecf('0x9')](),controller[_0x5ecf('0xa')]);router['get'](_0x5ecf('0xb'),auth[_0x5ecf('0x9')](),controller['describe']);router['get']('/:id',auth[_0x5ecf('0x9')](),controller[_0x5ecf('0xc')]);router[_0x5ecf('0x8')](_0x5ecf('0xd'),auth[_0x5ecf('0x9')](),controller[_0x5ecf('0xe')]);router[_0x5ecf('0x8')](_0x5ecf('0xf'),auth[_0x5ecf('0x9')](),controller[_0x5ecf('0x10')]);router[_0x5ecf('0x11')]('/',auth[_0x5ecf('0x9')](),controller['create']);router['post'](_0x5ecf('0xd'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x5ecf('0x12'),auth[_0x5ecf('0x9')](),interaction[_0x5ecf('0x13')]('openchannel',_0x5ecf('0x14')),controller[_0x5ecf('0x15')]);router[_0x5ecf('0x16')](_0x5ecf('0x17'),auth[_0x5ecf('0x9')](),interaction[_0x5ecf('0x13')](_0x5ecf('0x18'),_0x5ecf('0x19')),controller[_0x5ecf('0x1a')]);router['delete'](_0x5ecf('0x17'),auth[_0x5ecf('0x9')](),interaction[_0x5ecf('0x13')]('openchannel','openchannelinteraction:destroy'),controller[_0x5ecf('0x1b')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x5ecf('0x1c')]=router;
\ No newline at end of file
+var _0x1eeb=['/:id','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','show','/:id/messages','/:id/download','download','post','create','tracked','openchannel','put'];(function(_0x4736b1,_0x2517d3){var _0x34e3ca=function(_0x8c27ff){while(--_0x8c27ff){_0x4736b1['push'](_0x4736b1['shift']());}};_0x34e3ca(++_0x2517d3);}(_0x1eeb,0x100));var _0xb1ee=function(_0x240a64,_0x3ade01){_0x240a64=_0x240a64-0x0;var _0x135877=_0x1eeb[_0x240a64];return _0x135877;};'use strict';var multer=require(_0xb1ee('0x0'));var util=require(_0xb1ee('0x1'));var path=require(_0xb1ee('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1ee('0x3'));var router=express[_0xb1ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb1ee('0x5'));var interaction=require(_0xb1ee('0x6'));var config=require(_0xb1ee('0x7'));var controller=require(_0xb1ee('0x8'));router[_0xb1ee('0x9')]('/',auth['isAuthenticated'](),controller[_0xb1ee('0xa')]);router[_0xb1ee('0x9')](_0xb1ee('0xb'),auth[_0xb1ee('0xc')](),controller[_0xb1ee('0xd')]);router[_0xb1ee('0x9')]('/:id',auth[_0xb1ee('0xc')](),controller[_0xb1ee('0xe')]);router[_0xb1ee('0x9')](_0xb1ee('0xf'),auth[_0xb1ee('0xc')](),controller['getMessages']);router[_0xb1ee('0x9')](_0xb1ee('0x10'),auth['isAuthenticated'](),controller[_0xb1ee('0x11')]);router[_0xb1ee('0x12')]('/',auth[_0xb1ee('0xc')](),controller[_0xb1ee('0x13')]);router[_0xb1ee('0x12')](_0xb1ee('0xf'),auth[_0xb1ee('0xc')](),controller['addMessage']);router[_0xb1ee('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xb1ee('0x14')](_0xb1ee('0x15'),'openchannelinteraction:addtags'),controller['addTags']);router[_0xb1ee('0x16')](_0xb1ee('0x17'),auth[_0xb1ee('0xc')](),interaction[_0xb1ee('0x14')](_0xb1ee('0x15'),_0xb1ee('0x18')),controller['update']);router[_0xb1ee('0x19')](_0xb1ee('0x17'),auth[_0xb1ee('0xc')](),interaction[_0xb1ee('0x14')](_0xb1ee('0x15'),_0xb1ee('0x1a')),controller[_0xb1ee('0x1b')]);router[_0xb1ee('0x19')](_0xb1ee('0x1c'),auth['isAuthenticated'](),controller[_0xb1ee('0x1d')]);module[_0xb1ee('0x1e')]=router;
\ No newline at end of file
index 4382162..da47904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95f2=['exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0x95f2,0xdf));var _0x295f=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x95f2[_0x119705];return _0x2affc2;};'use strict';var Sequelize=require(_0x295f('0x0'));module[_0x295f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x295f('0x2')]},'disposition':{'type':Sequelize[_0x295f('0x3')]},'secondDisposition':{'type':Sequelize[_0x295f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x295f('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x295f('0x3')]},'externalUrl':{'type':Sequelize[_0x295f('0x3')]},'lastMsgAt':{'type':Sequelize[_0x295f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x295f('0x4')]('in',_0x295f('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x295f('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x295f('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc73e=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xc73e,0x1e9));var _0xec73=function(_0x23041e,_0x61306c){_0x23041e=_0x23041e-0x0;var _0x3c6e6b=_0xc73e[_0x23041e];return _0x3c6e6b;};'use strict';var Sequelize=require(_0xec73('0x0'));module[_0xec73('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xec73('0x2')]},'disposition':{'type':Sequelize[_0xec73('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xec73('0x2')]},'threadId':{'type':Sequelize[_0xec73('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xec73('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xec73('0x4')]('in',_0xec73('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xec73('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 42ba365..d0f0a5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3bb=['user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','body','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','parse','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','findAll','addTags','spread','Tag','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','format','User','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','fullname','get','mkdirSync','Openchannel','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','basename','pipe','createWriteStream','out','renderFile','views','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','Users','map','Tags','forEach','push','TagIds','then','catch','waiting','talking','answered','unmanaged','total','closed','UserId','OpenchannelInteraction','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId'];(function(_0x31e398,_0x3a694e){var _0x487cf4=function(_0x634baa){while(--_0x634baa){_0x31e398['push'](_0x31e398['shift']());}};_0x487cf4(++_0x3a694e);}(_0xd3bb,0x99));var _0xbd3b=function(_0x23034b,_0x49a41f){_0x23034b=_0x23034b-0x0;var _0x5adbe6=_0xd3bb[_0x23034b];return _0x5adbe6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd3b('0x0'));var zipdir=require(_0xbd3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbd3b('0x2'));var BPromise=require(_0xbd3b('0x3'));var Mustache=require(_0xbd3b('0x4'));var util=require('util');var path=require(_0xbd3b('0x5'));var sox=require(_0xbd3b('0x6'));var csv=require(_0xbd3b('0x7'));var ejs=require(_0xbd3b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd3b('0x9'));var squel=require(_0xbd3b('0xa'));var crypto=require(_0xbd3b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbd3b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbd3b('0xd'));var Papa=require(_0xbd3b('0xe'));var Redis=require('ioredis');var authService=require(_0xbd3b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbd3b('0x10'));var hardwareService=require(_0xbd3b('0x11'));var logger=require(_0xbd3b('0x12'))(_0xbd3b('0x13'));var utils=require(_0xbd3b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd3b('0x15'));var db=require(_0xbd3b('0x16'))['db'];config['redis']=_[_0xbd3b('0x17')](config[_0xbd3b('0x18')],{'host':_0xbd3b('0x19'),'port':0x18eb});var socket=require(_0xbd3b('0x1a'))(new Redis(config[_0xbd3b('0x18')]));require('./openchannelInteraction.socket')[_0xbd3b('0x1b')](socket);function respondWithStatusCode(_0x2b8923,_0x32fe5e){_0x32fe5e=_0x32fe5e||0xcc;return function(_0x2ccffa){if(_0x2ccffa){return _0x2b8923[_0xbd3b('0x1c')](_0x32fe5e);}return _0x2b8923[_0xbd3b('0x1d')](_0x32fe5e)[_0xbd3b('0x1e')]();};}function respondWithResult(_0x39708e,_0x28a3c8){_0x28a3c8=_0x28a3c8||0xc8;return function(_0x59eb78){if(_0x59eb78){return _0x39708e['status'](_0x28a3c8)[_0xbd3b('0x1f')](_0x59eb78);}};}function respondWithFilteredResult(_0x3d75f7,_0x44a2d0){return function(_0x126b60){if(_0x126b60){var _0x368f21=typeof _0x44a2d0[_0xbd3b('0x20')]==='undefined'&&typeof _0x44a2d0[_0xbd3b('0x21')]===_0xbd3b('0x22');var _0x2b34c4=_0x126b60[_0xbd3b('0x23')];var _0x49b35d=_0x368f21?0x0:_0x44a2d0[_0xbd3b('0x20')];var _0x1676aa=_0x368f21?_0x126b60[_0xbd3b('0x23')]:_0x44a2d0[_0xbd3b('0x20')]+_0x44a2d0[_0xbd3b('0x21')];var _0x1aece0;if(_0x1676aa>=_0x2b34c4){_0x1676aa=_0x2b34c4;_0x1aece0=0xc8;}else{_0x1aece0=0xce;}_0x3d75f7[_0xbd3b('0x1d')](_0x1aece0);return _0x3d75f7[_0xbd3b('0x24')](_0xbd3b('0x25'),_0x49b35d+'-'+_0x1676aa+'/'+_0x2b34c4)[_0xbd3b('0x1f')](_0x126b60);}return null;};}function patchUpdates(_0xfacc36){return function(_0x3c9dfb){try{jsonpatch[_0xbd3b('0x26')](_0x3c9dfb,_0xfacc36,!![]);}catch(_0x320ddb){return BPromise[_0xbd3b('0x27')](_0x320ddb);}return _0x3c9dfb[_0xbd3b('0x28')]();};}function saveUpdates(_0xea8da5,_0x346609){return function(_0x3c71c3){if(_0x3c71c3){return _0x3c71c3[_0xbd3b('0x29')](_0xea8da5)['then'](function(_0x275b27){return _0x275b27;});}return null;};}function removeEntity(_0x370bae,_0x18e5de){return function(_0x35b64d){if(_0x35b64d){return _0x35b64d[_0xbd3b('0x2a')]()['then'](function(){_0x370bae['status'](0xcc)[_0xbd3b('0x1e')]();});}};}function handleEntityNotFound(_0x127270,_0x20e6e2){return function(_0x11f06b){if(!_0x11f06b){_0x127270[_0xbd3b('0x1c')](0x194);}return _0x11f06b;};}function handleError(_0x6f6038,_0xa6edb7){_0xa6edb7=_0xa6edb7||0x1f4;return function(_0x20f8c4){logger[_0xbd3b('0x2b')](_0x20f8c4[_0xbd3b('0x2c')]);if(_0x20f8c4[_0xbd3b('0x2d')]){delete _0x20f8c4[_0xbd3b('0x2d')];}_0x6f6038['status'](_0xa6edb7)['send'](_0x20f8c4);};}function getInteractionUsers(_0x133c8b,_0xa68caa){return new BPromise(function(_0x11ab45,_0x5c1464){try{if(_0xa68caa[_0x133c8b['id']]){_0x133c8b[_0xbd3b('0x2e')]=_[_0xbd3b('0x2f')](_0xa68caa[_0x133c8b['id']],function(_0x19adbc){return{'id':_0x19adbc['id'],'fullname':_0x19adbc['fullname']};});}}catch(_0x536d71){_0x5c1464(_0x536d71);}_0x11ab45(_0x133c8b);});}function getInteractionTags(_0x286d3d,_0x2ecffe){return new BPromise(function(_0x49afef,_0xadac7f){try{if(_0x286d3d['TagIds']){_0x286d3d[_0xbd3b('0x30')]=[];_0x286d3d['TagIds']['split'](',')[_0xbd3b('0x31')](function(_0x5abf67){_0x286d3d[_0xbd3b('0x30')][_0xbd3b('0x32')](_0x2ecffe[_0x5abf67]);});}delete _0x286d3d[_0xbd3b('0x33')];}catch(_0x29e8ba){_0xadac7f(_0x29e8ba);}_0x49afef(_0x286d3d);});}function updateOpenchannelInteraction(_0x83cb69,_0x4196fb,_0x5e8b72){return new BPromise(function(_0x273933,_0x21d7eb){return getInteractionUsers(_0x83cb69,_0x5e8b72)[_0xbd3b('0x34')](function(_0x86fd5f){return getInteractionTags(_0x86fd5f,_0x4196fb);})[_0xbd3b('0x34')](function(_0x5064d8){return getStateInteraction(_0x5064d8);})['then'](function(_0x99a504){_0x273933(_0x99a504);})[_0xbd3b('0x35')](function(_0x5d875e){_0x21d7eb(_0x5d875e);});});}function getStateInteraction(_0x536272){return new BPromise(function(_0xa71768){_0x536272[_0xbd3b('0x36')]=0x0;_0x536272[_0xbd3b('0x37')]=0x0;_0x536272[_0xbd3b('0x38')]=0x0;_0x536272[_0xbd3b('0x39')]=0x0;_0x536272[_0xbd3b('0x3a')]=0x0;if(!_0x536272[_0xbd3b('0x3b')]&&!_0x536272[_0xbd3b('0x3c')]){_0x536272[_0xbd3b('0x36')]+=0x1;}if(!_0x536272['closed']&&_0x536272[_0xbd3b('0x3c')]){_0x536272[_0xbd3b('0x37')]+=0x1;if(_0x536272[_0xbd3b('0x36')]){_0x536272[_0xbd3b('0x36')]-=0x1;}}if(_0x536272[_0xbd3b('0x3b')]&&_0x536272[_0xbd3b('0x3c')]){_0x536272[_0xbd3b('0x38')]+=0x1;if(_0x536272[_0xbd3b('0x37')]){_0x536272['talking']-=0x1;}}if(_0x536272[_0xbd3b('0x3b')]&&!_0x536272[_0xbd3b('0x3c')]){_0x536272[_0xbd3b('0x39')]+=0x1;if(_0x536272[_0xbd3b('0x36')]){_0x536272[_0xbd3b('0x36')]-=0x1;}}_0x536272[_0xbd3b('0x3a')]+=0x1;_0xa71768(_0x536272);});}exports['index']=function(_0x53ad79,_0x40d70c){var _0x492e55={},_0x23aa70={},_0x144517={'count':0x0,'rows':[]};var _0x700510=_[_0xbd3b('0x2f')](db[_0xbd3b('0x3d')][_0xbd3b('0x3e')],function(_0x2babdd){return{'name':_0x2babdd[_0xbd3b('0x3f')],'type':_0x2babdd[_0xbd3b('0x40')]['key']};});_0x23aa70['model']=_[_0xbd3b('0x2f')](_0x700510,_0xbd3b('0x2d'));_0x23aa70[_0xbd3b('0x41')]=_[_0xbd3b('0x42')](_0x53ad79['query']);_0x23aa70[_0xbd3b('0x43')]=_[_0xbd3b('0x44')](_0x23aa70[_0xbd3b('0x45')],_0x23aa70[_0xbd3b('0x41')]);_0x492e55[_0xbd3b('0x46')]=_[_0xbd3b('0x44')](_0x23aa70['model'],qs[_0xbd3b('0x47')](_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x47')]));_0x492e55[_0xbd3b('0x46')]=_0x492e55[_0xbd3b('0x46')][_0xbd3b('0x48')]?_0x492e55[_0xbd3b('0x46')]:_0x23aa70[_0xbd3b('0x45')];if(!_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x49')](_0xbd3b('0x4a'))){_0x492e55[_0xbd3b('0x21')]=qs[_0xbd3b('0x21')](_0x53ad79['query']['limit']);_0x492e55[_0xbd3b('0x20')]=qs[_0xbd3b('0x20')](_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x20')]);}_0x492e55[_0xbd3b('0x4b')]=qs['sort'](_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x4c')]);_0x492e55[_0xbd3b('0x4d')]=qs[_0xbd3b('0x43')](_[_0xbd3b('0x4e')](_0x53ad79['query'],_0x23aa70[_0xbd3b('0x43')]),_0x700510);var _0x3e90b0=[];var _0xf8acf0=squel[_0xbd3b('0x4f')]()['field']('id')[_0xbd3b('0x50')](_0xbd3b('0x2d'))[_0xbd3b('0x50')](_0xbd3b('0x51'))['from'](_0xbd3b('0x52'));var _0x26c5b8=squel[_0xbd3b('0x4f')]()[_0xbd3b('0x50')](_0xbd3b('0x53'))[_0xbd3b('0x50')](_0xbd3b('0x54'))[_0xbd3b('0x50')](_0xbd3b('0x55'))['from'](_0xbd3b('0x56'),'ui')[_0xbd3b('0x57')](_0xbd3b('0x58'),'u',_0xbd3b('0x59'));var _0x41cd1a=squel[_0xbd3b('0x4f')]()[_0xbd3b('0x5a')](_0xbd3b('0x5b'),'i')[_0xbd3b('0x57')](_0xbd3b('0x5c'),'c',_0xbd3b('0x5d'))[_0xbd3b('0x57')](_0xbd3b('0x58'),'o',_0xbd3b('0x5e'))[_0xbd3b('0x57')](_0xbd3b('0x5f'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xbd3b('0x57')]('openchannel_messages','me',_0xbd3b('0x60'))['left_join']('openchannel_interaction_has_tags','it',_0xbd3b('0x61'))['left_join'](_0xbd3b('0x52'),'t',_0xbd3b('0x62'));var _0x360a70=squel['expr']();var _0xa19f55=[];var _0x442d38=squel[_0xbd3b('0x63')]();var _0x4e1e81;if(_0x53ad79['query'][_0xbd3b('0x64')]){_0x4e1e81=as['parseSearch'](_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x64')]);var _0x20e191=_0x4e1e81['sqlOperator'];for(var _0x234445=0x0;_0x234445<_0x4e1e81[_0xbd3b('0x65')][_0xbd3b('0x48')];_0x234445++){var _0x103560=_0x4e1e81[_0xbd3b('0x65')][_0x234445];var _0x3ab20c='i';var _0x36607f=_[_0xbd3b('0x66')](_0x700510,[_0xbd3b('0x2d'),_0x103560['field']]);if(!_0x36607f){switch(_0x103560[_0xbd3b('0x50')]){case _0xbd3b('0x67'):if(_0x103560[_0xbd3b('0x68')]==0x1){_0x41cd1a[_0xbd3b('0x69')]('`'+_0x103560[_0xbd3b('0x50')]+_0xbd3b('0x6a'));}else{_0x41cd1a[_0xbd3b('0x69')]('`'+_0x103560[_0xbd3b('0x50')]+_0xbd3b('0x6b'));}break;case _0xbd3b('0x6c'):if(_0x103560[_0xbd3b('0x6d')]===_0xbd3b('0x6e')){if(_0x103560[_0xbd3b('0x68')][_0xbd3b('0x6f')]('\x20')[_0xbd3b('0x48')]>0x1){_0x360a70[_0x20e191](_0xbd3b('0x70'),qs[_0xbd3b('0x71')](_0x103560[_0xbd3b('0x68')]),null);}else{var _0x30121c='%'+_0x103560[_0xbd3b('0x68')]+'%';_0x360a70[_0x20e191]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x30121c,_0x30121c,_0x30121c);}}else{_0x36607f=_[_0xbd3b('0x66')](_0x700510,[_0xbd3b('0x2d'),'ContactId']);_0x103560[_0xbd3b('0x50')]='ContactId';_0x2df5e1=as[_0xbd3b('0x72')](_0x3ab20c,_0x36607f['type'],_0x103560);_0x360a70[_0x20e191](_0x2df5e1[_0xbd3b('0x73')],_0x2df5e1[_0xbd3b('0x68')][_0xbd3b('0x74')],_0x2df5e1['value'][_0xbd3b('0x1e')]);}break;case'Tag':var _0x40af13=_0x103560[_0xbd3b('0x68')][_0xbd3b('0x6f')](',')['map'](function(_0x41fa87){return Number(_0x41fa87);});_0x40af13['forEach'](function(_0xfc678b){_0x442d38['or'](_0xbd3b('0x75'),'%,'+_0xfc678b+',%');});_0xa19f55=_['union'](_0xa19f55,_0x40af13);break;case'User':if(_0x103560[_0xbd3b('0x6d')]===_0xbd3b('0x6e')){_0x360a70[_0x20e191]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x103560[_0xbd3b('0x68')]+'%',null);}else{_0x36607f=_['find'](_0x700510,[_0xbd3b('0x2d'),_0xbd3b('0x3c')]);_0x103560['field']='UserId';_0x2df5e1=as[_0xbd3b('0x72')](_0x3ab20c,_0x36607f[_0xbd3b('0x40')],_0x103560);_0x360a70[_0x20e191](_0x2df5e1[_0xbd3b('0x73')],_0x2df5e1[_0xbd3b('0x68')][_0xbd3b('0x74')],_0x2df5e1[_0xbd3b('0x68')][_0xbd3b('0x1e')]);}break;case _0xbd3b('0x76'):_0x2df5e1=as[_0xbd3b('0x72')]('me',null,_0x103560);_0x360a70[_0x20e191](_0x2df5e1[_0xbd3b('0x73')],_0x2df5e1[_0xbd3b('0x68')][_0xbd3b('0x74')],_0x2df5e1[_0xbd3b('0x68')]['end']);break;}}else{var _0x2df5e1=as['buildExpression'](_0x3ab20c,_0x36607f[_0xbd3b('0x40')],_0x103560);_0x360a70[_0x20e191](_0x2df5e1[_0xbd3b('0x73')],_0x2df5e1['value'][_0xbd3b('0x74')],_0x2df5e1[_0xbd3b('0x68')]['end']);}}}else{var _0x5d8713=_(_0x53ad79['query'])[_0xbd3b('0x42')]()[_0xbd3b('0x2f')](function(_0x21700b){return _[_0xbd3b('0x77')](_0x700510,[_0xbd3b('0x2d'),_0x21700b])?_0x21700b:undefined;})[_0xbd3b('0x78')]()[_0xbd3b('0x68')]();if(!_['isEmpty'](_0x5d8713)){_0x5d8713[_0xbd3b('0x31')](function(_0x18be9e){if(_0x18be9e===_0xbd3b('0x79')){_0x41cd1a[_0xbd3b('0x4d')](_0xbd3b('0x7a'),[][_0xbd3b('0x7b')](_0x53ad79[_0xbd3b('0x41')][_0x18be9e]));}else if(_0x18be9e==='createdAt'){var _0x2fe6ba=JSON['parse'](_0x53ad79['query'][_0x18be9e])[_0xbd3b('0x7c')];var _0x1fc1d3=JSON[_0xbd3b('0x7d')](_0x53ad79['query'][_0x18be9e])['$lte'];_0x41cd1a[_0xbd3b('0x4d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2fe6ba,_0x1fc1d3);}else{if(_0x53ad79[_0xbd3b('0x41')][_0x18be9e]===_0xbd3b('0x7e')){_0x41cd1a[_0xbd3b('0x4d')]('i.'+_0x18be9e+'\x20IS\x20NULL');}else{_0x41cd1a[_0xbd3b('0x4d')]('i.'+_0x18be9e+_0xbd3b('0x7f'),_0x53ad79[_0xbd3b('0x41')][_0x18be9e]);}}});}if(_0x53ad79[_0xbd3b('0x41')]['read']){if(_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x80')]==0x1){_0x41cd1a[_0xbd3b('0x69')](_0xbd3b('0x81'));}else{_0x41cd1a[_0xbd3b('0x69')](_0xbd3b('0x82'));}}if(_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x83')]){_0xa19f55=_[_0xbd3b('0x84')](_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x83')])?_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x83')]:new Array(_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x83')]);_0xa19f55[_0xbd3b('0x31')](function(_0x5a5ed8){_0x442d38['or'](_0xbd3b('0x75'),'%,'+_0x5a5ed8+',%');});}if(_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x85')]){var _0x168f1c=_0x53ad79[_0xbd3b('0x41')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xbd3b('0x86')](_0x168f1c)){_0x360a70['or'](_0xbd3b('0x87'),_0x168f1c+'%');}else{_0x360a70['or'](_0xbd3b('0x88'),qs[_0xbd3b('0x71')](_0x168f1c))['or'](_0xbd3b('0x89'),_0x168f1c+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x168f1c+'%');}}}_0x41cd1a['where'](_0x360a70);_0x41cd1a[_0xbd3b('0x8a')](_0xbd3b('0x8b'));var _0xd4c010={'type':db[_0xbd3b('0x8c')]['QueryTypes'][_0xbd3b('0x8d')],'raw':!![]};var _0x1c833a=_0x41cd1a[_0xbd3b('0x8e')]();_0x1c833a['field'](_0xbd3b('0x8b'));_0x1c833a[_0xbd3b('0x50')](_0xbd3b('0x8f'),'unreadMessages');if(_0x492e55[_0xbd3b('0x4b')]){_0x492e55[_0xbd3b('0x4b')][_0xbd3b('0x31')](function(_0x401168){var _0x2b05e7=_0x401168[0x0]===_0xbd3b('0x90')?_0x401168[0x0]:'i.'+_0x401168[0x0];_0x41cd1a[_0xbd3b('0x4b')](_0x2b05e7,_0x401168[0x1]===_0xbd3b('0x91')?![]:!![]);});}if(!_[_0xbd3b('0x92')](_0xa19f55)){_0x41cd1a['having'](_0x442d38);_0x1c833a[_0xbd3b('0x4d')](_0xbd3b('0x93'),_0xa19f55);}BPromise[_0xbd3b('0x94')]()[_0xbd3b('0x34')](function(){if(!_0x4e1e81){if(_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x79')])return;_0x1c833a[_0xbd3b('0x4d')](_0xbd3b('0x95'));_0x41cd1a['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x53ad79[_0xbd3b('0x96')][_0xbd3b('0x97')]!==_0xbd3b('0x98'))return;return _0x53ad79['user'][_0xbd3b('0x99')]({'attributes':['id'],'raw':!![]})[_0xbd3b('0x34')](function(_0x12c515){if(_['isEmpty'](_0x12c515)){_0x1c833a[_0xbd3b('0x4d')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x41cd1a['where'](_0xbd3b('0x9a'));}else{_0x1c833a[_0xbd3b('0x4d')](_0xbd3b('0x7a'),_[_0xbd3b('0x2f')](_0x12c515,'id'));_0x41cd1a[_0xbd3b('0x4d')](_0xbd3b('0x7a'),_[_0xbd3b('0x2f')](_0x12c515,'id'));}});})[_0xbd3b('0x34')](function(){if(_0x53ad79['user'][_0xbd3b('0x97')]==='agent'&&!_0x4e1e81&&!_0x53ad79['query'][_0xbd3b('0x79')])return[];return db['sequelize'][_0xbd3b('0x41')](_0x1c833a['toString'](),_0xd4c010);})['then'](function(_0x379b71){_0x144517[_0xbd3b('0x23')]=_0x379b71[_0xbd3b('0x48')];if(_0x144517['count']===0x0)return[];return db[_0xbd3b('0x9b')]['query'](_0xf8acf0[_0xbd3b('0x9c')](),_0xd4c010)[_0xbd3b('0x34')](function(_0x53384f){_0x3e90b0=_[_0xbd3b('0x9d')](_0x53384f,'id');_0xd4c010=_[_0xbd3b('0x9e')](_0xd4c010,{'model':db[_0xbd3b('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53ad79[_0xbd3b('0x41')][_0xbd3b('0x47')]){_0x492e55['attributes'][_0xbd3b('0x31')](function(_0x5c5b1a){_0x41cd1a[_0xbd3b('0x50')]('i.'+_0x5c5b1a);});}else{_0x41cd1a[_0xbd3b('0x50')](_0xbd3b('0x8f'),_0xbd3b('0x67'));_0x41cd1a[_0xbd3b('0x50')]('a.key',_0xbd3b('0x9f'));_0x41cd1a[_0xbd3b('0x50')]('a.mandatoryDisposition',_0xbd3b('0xa0'));_0x41cd1a[_0xbd3b('0x50')](_0xbd3b('0xa1'),_0xbd3b('0x90'));_0x41cd1a[_0xbd3b('0x50')](_0xbd3b('0xa2'));_0x41cd1a['field'](_0xbd3b('0xa3'),_0xbd3b('0xa4'));_0x41cd1a[_0xbd3b('0x50')](_0xbd3b('0xa5'),'Contact.lastName');_0x41cd1a[_0xbd3b('0x50')]('c.email','Contact.email');_0x41cd1a[_0xbd3b('0x50')](_0xbd3b('0xa6'),_0xbd3b('0xa7'));_0x41cd1a['field'](_0xbd3b('0xa8'),'Contact.mobile');_0x41cd1a[_0xbd3b('0x50')](_0xbd3b('0xa9'),_0xbd3b('0xaa'));_0x41cd1a[_0xbd3b('0x50')](_0xbd3b('0xab'),_0xbd3b('0xac'));_0x41cd1a[_0xbd3b('0x50')](_0xbd3b('0xad'),'Owner.internal');_0x41cd1a['field'](_0xbd3b('0xae'),'TagIds');}if(_0x492e55[_0xbd3b('0x21')])_0x41cd1a['limit'](_0x492e55[_0xbd3b('0x21')]);if(_0x492e55[_0xbd3b('0x20')])_0x41cd1a[_0xbd3b('0x20')](_0x492e55['offset']);return db[_0xbd3b('0x9b')][_0xbd3b('0x41')](_0x41cd1a['toString'](),_0xd4c010);})[_0xbd3b('0x34')](function(_0x2e207f){if(_0x2e207f['length']>0x0)_0x26c5b8[_0xbd3b('0x4d')](_0xbd3b('0xaf'),_[_0xbd3b('0x2f')](_0x2e207f,'id'));return db[_0xbd3b('0x9b')][_0xbd3b('0x41')](_0x26c5b8['toString'](),_0xd4c010)[_0xbd3b('0x34')](function(_0x497522){var _0x5ad0f8=_[_0xbd3b('0xb0')](_0x497522,_0xbd3b('0xb1'));var _0x5a3ed7=[];_0x2e207f['forEach'](function(_0x40d472){_0x5a3ed7[_0xbd3b('0x32')](updateOpenchannelInteraction(_0x40d472,_0x3e90b0,_0x5ad0f8));});return BPromise[_0xbd3b('0xb2')](_0x5a3ed7);});});})['then'](function(_0x644154){_0x144517[_0xbd3b('0xb3')]=_0x644154;return _0x144517;})['then'](respondWithFilteredResult(_0x40d70c,_0x492e55))[_0xbd3b('0x35')](handleError(_0x40d70c,null));};exports[_0xbd3b('0xb4')]=function(_0x1e71ec,_0x2fe4fd){var _0x42baa6={};if(_0x1e71ec[_0xbd3b('0x41')][_0xbd3b('0x40')]&&_0x1e71ec[_0xbd3b('0x41')][_0xbd3b('0x40')]===_0xbd3b('0x5a')){_0x42baa6[_0xbd3b('0x5a')]=_0x1e71ec[_0xbd3b('0xb5')]['id'];}else{_0x42baa6['id']=_0x1e71ec[_0xbd3b('0xb5')]['id'];}var _0x4eb809={'raw':![],'where':_0x42baa6},_0x44ce05={};_0x44ce05[_0xbd3b('0x45')]=_[_0xbd3b('0x42')](db[_0xbd3b('0x3d')]['rawAttributes']);_0x44ce05['query']=_[_0xbd3b('0x42')](_0x1e71ec[_0xbd3b('0x41')]);_0x44ce05[_0xbd3b('0x43')]=_[_0xbd3b('0x44')](_0x44ce05['model'],_0x44ce05['query']);_0x4eb809[_0xbd3b('0x46')]=_[_0xbd3b('0x44')](_0x44ce05[_0xbd3b('0x45')],qs[_0xbd3b('0x47')](_0x1e71ec[_0xbd3b('0x41')][_0xbd3b('0x47')]));_0x4eb809[_0xbd3b('0x46')]=_0x4eb809[_0xbd3b('0x46')]['length']?_0x4eb809[_0xbd3b('0x46')]:_0x44ce05[_0xbd3b('0x45')];if(_0x1e71ec[_0xbd3b('0x41')][_0xbd3b('0xb6')]){_0x4eb809[_0xbd3b('0xb7')]=[{'all':!![]}];}_0x4eb809=_[_0xbd3b('0x9e')]({},_0x4eb809,_0x1e71ec[_0xbd3b('0xb8')]);return db['OpenchannelInteraction'][_0xbd3b('0x66')](_0x4eb809)[_0xbd3b('0x34')](handleEntityNotFound(_0x2fe4fd,null))[_0xbd3b('0x34')](respondWithResult(_0x2fe4fd,null))[_0xbd3b('0x35')](handleError(_0x2fe4fd,null));};exports['create']=function(_0x922195,_0x4cf91c){return db[_0xbd3b('0x3d')][_0xbd3b('0xb9')](_0x922195[_0xbd3b('0x76')],{})[_0xbd3b('0x34')](respondWithResult(_0x4cf91c,0xc9))[_0xbd3b('0x35')](handleError(_0x4cf91c,null));};exports['update']=function(_0x73cb82,_0xdf82e0){if(_0x73cb82[_0xbd3b('0x76')]['id']){delete _0x73cb82[_0xbd3b('0x76')]['id'];}return db[_0xbd3b('0x3d')][_0xbd3b('0x66')]({'where':{'id':_0x73cb82[_0xbd3b('0xb5')]['id']}})['then'](handleEntityNotFound(_0xdf82e0,null))['then'](saveUpdates(_0x73cb82['body'],null))['then'](respondWithResult(_0xdf82e0,null))[_0xbd3b('0x35')](handleError(_0xdf82e0,null));};exports[_0xbd3b('0x2a')]=function(_0x609c53,_0x4d7200){return db[_0xbd3b('0x3d')][_0xbd3b('0x66')]({'where':{'id':_0x609c53[_0xbd3b('0xb5')]['id']}})[_0xbd3b('0x34')](handleEntityNotFound(_0x4d7200,null))[_0xbd3b('0x34')](removeEntity(_0x4d7200,null))['catch'](handleError(_0x4d7200,null));};exports[_0xbd3b('0xba')]=function(_0x4ba1b6,_0x273e8b){return db['OpenchannelInteraction'][_0xbd3b('0xba')]()[_0xbd3b('0x34')](respondWithResult(_0x273e8b,null))['catch'](handleError(_0x273e8b,null));};exports[_0xbd3b('0xbb')]=function(_0x3f3660,_0x24a4df,_0x279fd5){return db[_0xbd3b('0xbc')][_0xbd3b('0x66')]({'where':{'id':_0x3f3660[_0xbd3b('0xb5')]['id']}})[_0xbd3b('0x34')](handleEntityNotFound(_0x24a4df,null))['then'](function(_0x54eae1){if(_0x54eae1){return _0x54eae1[_0xbd3b('0xbb')](_0x3f3660['body'][_0xbd3b('0xbd')],_[_0xbd3b('0xbe')](_0x3f3660[_0xbd3b('0x76')],[_0xbd3b('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x24a4df,null))[_0xbd3b('0x35')](handleError(_0x24a4df,null));};exports[_0xbd3b('0xbf')]=function(_0x2630be,_0x4b4dc2,_0x4ce204){var _0xb1076e={'raw':![],'where':{}};var _0x47fcdd={};var _0x4114e1={'count':0x0,'rows':[]};return db[_0xbd3b('0x3d')][_0xbd3b('0xc0')]({'where':{'id':_0x2630be[_0xbd3b('0xb5')]['id']}})[_0xbd3b('0x34')](handleEntityNotFound(_0x4b4dc2,null))[_0xbd3b('0x34')](function(_0x5b58b8){if(_0x5b58b8){_0x47fcdd[_0xbd3b('0x45')]=_[_0xbd3b('0x42')](db[_0xbd3b('0xbc')][_0xbd3b('0x3e')]);_0x47fcdd['query']=_[_0xbd3b('0x42')](_0x2630be[_0xbd3b('0x41')]);_0x47fcdd[_0xbd3b('0x43')]=_[_0xbd3b('0x44')](_0x47fcdd[_0xbd3b('0x45')],_0x47fcdd[_0xbd3b('0x41')]);_0xb1076e[_0xbd3b('0x46')]=_[_0xbd3b('0x44')](_0x47fcdd[_0xbd3b('0x45')],qs['fields'](_0x2630be['query'][_0xbd3b('0x47')]));_0xb1076e['attributes']=_0xb1076e[_0xbd3b('0x46')][_0xbd3b('0x48')]?_0xb1076e['attributes']:_0x47fcdd[_0xbd3b('0x45')];if(!_0x2630be[_0xbd3b('0x41')]['hasOwnProperty'](_0xbd3b('0x4a'))){_0xb1076e[_0xbd3b('0x21')]=qs[_0xbd3b('0x21')](_0x2630be[_0xbd3b('0x41')][_0xbd3b('0x21')]);_0xb1076e[_0xbd3b('0x20')]=qs[_0xbd3b('0x20')](_0x2630be[_0xbd3b('0x41')][_0xbd3b('0x20')]);}_0xb1076e[_0xbd3b('0x4b')]=qs[_0xbd3b('0x4c')](_0x2630be[_0xbd3b('0x41')][_0xbd3b('0x4c')]);_0xb1076e[_0xbd3b('0x4d')]=qs[_0xbd3b('0x43')](_[_0xbd3b('0x4e')](_0x2630be[_0xbd3b('0x41')],_0x47fcdd['filters']));_0xb1076e[_0xbd3b('0x4d')][_0xbd3b('0xb1')]=_0x5b58b8['id'];if(_0x2630be['query']['filter']){_0xb1076e['where']=_[_0xbd3b('0x9e')](_0xb1076e[_0xbd3b('0x4d')],{'$or':_[_0xbd3b('0x2f')](_0xb1076e[_0xbd3b('0x46')],function(_0x233207){var _0x4d9d7c={};_0x4d9d7c[_0x233207]={'$like':'%'+_0x2630be[_0xbd3b('0x41')]['filter']+'%'};return _0x4d9d7c;})});}if(_0x2630be[_0xbd3b('0x41')][_0xbd3b('0x7c')]){var _0x2e0ec7=_0x2630be[_0xbd3b('0x41')][_0xbd3b('0x7c')][_0xbd3b('0x6f')](',');var _0x508ebb={};_0x508ebb[_0x2e0ec7[0x0]]={'$gte':moment(_0x2e0ec7[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xb1076e[_0xbd3b('0x4d')]=_[_0xbd3b('0x9e')](_0xb1076e[_0xbd3b('0x4d')],_0x508ebb);}_0xb1076e=_['merge']({},_0xb1076e,_0x2630be['options']);return db[_0xbd3b('0xbc')]['count']({'where':_0xb1076e[_0xbd3b('0x4d')]})['then'](function(_0x41c0b4){_0x4114e1[_0xbd3b('0x23')]=_0x41c0b4;if(_0x2630be[_0xbd3b('0x41')][_0xbd3b('0xb6')]){_0xb1076e[_0xbd3b('0xb7')]=[{'all':!![]}];}return db[_0xbd3b('0xbc')][_0xbd3b('0xc1')](_0xb1076e);})[_0xbd3b('0x34')](function(_0x234f98){_0x4114e1[_0xbd3b('0xb3')]=_0x234f98;return _0x4114e1;});}})['then'](respondWithFilteredResult(_0x4b4dc2,_0xb1076e))[_0xbd3b('0x35')](handleError(_0x4b4dc2,null));};exports[_0xbd3b('0xc2')]=function(_0x52cb02,_0x23a865,_0x5f4f93){return db[_0xbd3b('0x3d')]['find']({'where':{'id':_0x52cb02['params']['id']}})[_0xbd3b('0x34')](handleEntityNotFound(_0x23a865,null))['then'](function(_0x87bab1){if(_0x87bab1){return _0x87bab1['setTags'](_0x52cb02[_0xbd3b('0x76')][_0xbd3b('0xbd')],_[_0xbd3b('0xbe')](_0x52cb02['body'],[_0xbd3b('0xbd'),'id'])||{})[_0xbd3b('0xc3')](function(){return db[_0xbd3b('0xc4')]['findAll']({'attributes':['id',_0xbd3b('0x2d'),'color'],'where':{'id':_0x52cb02['body']['ids']}});})[_0xbd3b('0x34')](function(_0x2f96d5){socket[_0xbd3b('0xc5')]('openchannelInteractionTags:save',{'id':Number(_0x52cb02[_0xbd3b('0xb5')]['id']),'tags':_0x2f96d5||[]});return{'id':Number(_0x52cb02['params']['id']),'tags':_0x2f96d5||[]};});}})[_0xbd3b('0x34')](respondWithResult(_0x23a865,null))['catch'](handleError(_0x23a865,null));};exports[_0xbd3b('0xc6')]=function(_0x5034e2,_0x516776,_0x292cbc){return db[_0xbd3b('0x3d')][_0xbd3b('0x66')]({'where':{'id':_0x5034e2[_0xbd3b('0xb5')]['id']}})[_0xbd3b('0x34')](handleEntityNotFound(_0x516776,null))[_0xbd3b('0x34')](function(_0xa1fb3a){if(_0xa1fb3a){return _0xa1fb3a[_0xbd3b('0xc6')](_0x5034e2[_0xbd3b('0x41')]['ids']);}})[_0xbd3b('0x34')](respondWithStatusCode(_0x516776,null))[_0xbd3b('0x35')](handleError(_0x516776,null));};exports[_0xbd3b('0xc7')]=function(_0x3eb89d,_0x1e97c9){var _0x3a1f21=moment()[_0xbd3b('0xc8')]()[_0xbd3b('0x9c')]();var _0x42cfe3=path[_0xbd3b('0xc9')](config[_0xbd3b('0xca')],_0xbd3b('0xcb'),_0xbd3b('0xcc'),_0xbd3b('0xcd'));var _0x81cc31=path['join'](config[_0xbd3b('0xca')],_0xbd3b('0xcb'),_0xbd3b('0xcc'),_0xbd3b('0xce'));var _0x272fed=path[_0xbd3b('0xc9')](_0x42cfe3,_0x3a1f21);var _0xf760ee=util[_0xbd3b('0xcf')]('transcript-%d-%s.zip',_0x3eb89d['params']['id'],_0x3a1f21);var _0x2d0da2=path[_0xbd3b('0xc9')](_0x42cfe3,_0xf760ee);var _0x5640cf=[];_0x5640cf[_0xbd3b('0x32')]({'model':db[_0xbd3b('0xd0')],'as':_0xbd3b('0xd0'),'attributes':['id','fullname'],'raw':!![]});_0x5640cf[_0xbd3b('0x32')]({'model':db[_0xbd3b('0xd1')],'as':_0xbd3b('0x6c'),'attributes':['id',_0xbd3b('0xd2'),_0xbd3b('0xd3')],'raw':!![]});if(_0x3eb89d[_0xbd3b('0x41')][_0xbd3b('0xce')]){_0x5640cf[_0xbd3b('0x32')]({'model':db['Attachment'],'as':_0xbd3b('0xd4'),'raw':!![]});}var _0x551fe0=[{'model':db[_0xbd3b('0xbc')],'as':_0xbd3b('0xd5'),'attributes':['id',_0xbd3b('0x76'),_0xbd3b('0xd6'),_0xbd3b('0xd7'),_0xbd3b('0xd8'),_0xbd3b('0x80')],'include':_0x5640cf}];_0x551fe0['push']({'model':db[_0xbd3b('0xd9')],'as':_0xbd3b('0xda'),'attributes':['id',_0xbd3b('0x2d')]});_0x551fe0[_0xbd3b('0x32')]({'model':db[_0xbd3b('0xd0')],'as':_0xbd3b('0xdb'),'attributes':['id',_0xbd3b('0xdc')]});return db[_0xbd3b('0x3d')][_0xbd3b('0x66')]({'where':{'id':_0x3eb89d[_0xbd3b('0xb5')]['id']},'include':_0x551fe0})[_0xbd3b('0x34')](handleEntityNotFound(_0x1e97c9,null))['then'](function(_0x96dd31){if(_0x96dd31){var _0x5eea7e=_0x96dd31[_0xbd3b('0xdd')]({'plain':!![]});fs[_0xbd3b('0xde')](_0x272fed);var _0x5f3953={'channel':_0xbd3b('0xdf'),'account':_0x5eea7e['Account'][_0xbd3b('0x2d')],'agent':_0x5eea7e['Owner']?_0x5eea7e['Owner'][_0xbd3b('0xdc')]:'N.A.','createdAt':moment(_0x5eea7e[_0xbd3b('0xd6')])[_0xbd3b('0xcf')](_0xbd3b('0xe0'))[_0xbd3b('0x9c')](),'closedAt':_0x5eea7e[_0xbd3b('0x3b')]?moment(_0x5eea7e['closedAt'])[_0xbd3b('0xcf')](_0xbd3b('0xe0'))[_0xbd3b('0x9c')]():'','disposition':_0x5eea7e[_0xbd3b('0xe1')],'visibility':_0x5eea7e[_0xbd3b('0xe2')]?_0xbd3b('0xe3'):'Private','messages':_(_0x5eea7e[_0xbd3b('0xd5')])[_0xbd3b('0x85')]({'secret':![]})['map'](function(_0x3c7be1){if(_0x3c7be1[_0xbd3b('0xd4')]){var _0x48d2b1=path[_0xbd3b('0xc9')](_0x81cc31,_0x3c7be1[_0xbd3b('0xd4')][_0xbd3b('0xe4')]);if(fs['existsSync'](_0x48d2b1)){fs['createReadStream'](_0x48d2b1)[_0xbd3b('0xe5')](fs[_0xbd3b('0xe6')](path[_0xbd3b('0xc9')](_0x272fed,_0x3c7be1[_0xbd3b('0xd4')]['basename'])));}}return{'date':moment(_0x3c7be1[_0xbd3b('0xd6')])[_0xbd3b('0xcf')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbd3b('0x9c')](),'sender':_0x3c7be1['direction']===_0xbd3b('0xe7')?_0x3c7be1['User']?_0x3c7be1['User'][_0xbd3b('0xdc')]:'System':_0x3c7be1[_0xbd3b('0x6c')]['firstName']+(_0x3c7be1[_0xbd3b('0x6c')]['lastName']?'\x20'+_0x3c7be1[_0xbd3b('0x6c')]['lastName']:''),'body':_0x3c7be1[_0xbd3b('0xd4')]?_0x3c7be1[_0xbd3b('0xd4')][_0xbd3b('0xe4')]:_0x3c7be1[_0xbd3b('0x76')],'direction':_0x3c7be1[_0xbd3b('0xd7')]==='out'?'A':'C','secret':_0x3c7be1[_0xbd3b('0xd8')],'read':_0x3c7be1[_0xbd3b('0x80')],'attachment':_0x3c7be1['Attachment']};})[_0xbd3b('0x68')]()};return ejs[_0xbd3b('0xe8')](path[_0xbd3b('0xc9')](config[_0xbd3b('0xca')],_0xbd3b('0xcb'),_0xbd3b('0xe9'),'downloadInteraction.ejs'),{'interaction':_0x5f3953})[_0xbd3b('0x34')](function(_0x4875d6){var _0x210ecd=path[_0xbd3b('0xc9')](_0x272fed,_0xbd3b('0xea')+_0x5eea7e['id']+'-'+_0x3a1f21+'.pdf');var _0x3e7812={'path':_0x210ecd,'channel':'Openchannel','interactionId':_0x5eea7e['id']};return pdf[_0xbd3b('0xeb')](_0x4875d6,_0x3e7812);})[_0xbd3b('0x34')](function(){return new BPromise(function(_0x2b41c4,_0x43b1de){zipdir(_0x272fed,{'saveTo':_0x2d0da2},function(_0x562b75,_0x5b5294){if(_0x562b75)return _0x43b1de(_0x562b75);return _0x2b41c4(_0x5b5294);});})[_0xbd3b('0x34')](function(){return new BPromise(function(_0x58d0ca,_0x217dd2){rimraf(_0x272fed,function(_0x111b33){if(_0x111b33)_0x217dd2(_0x111b33);return _0x58d0ca();});});})[_0xbd3b('0x34')](function(){return _0x1e97c9[_0xbd3b('0xc7')](_0x2d0da2,_0xf760ee,function(_0x4c74ab){if(_0x4c74ab){console[_0xbd3b('0xec')](_0xbd3b('0xed'),_0x4c74ab);}else{fs[_0xbd3b('0xee')](_0x2d0da2);}});});});}else{return _0x1e97c9[_0xbd3b('0x1c')](0xc8);}})[_0xbd3b('0x35')](handleError(_0x1e97c9,null));};
\ No newline at end of file
+var _0xf043=['direction','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','log','err','unlinkSync','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','send','Users','map','TagIds','split','forEach','Tags','waiting','talking','answered','total','closed','UserId','unmanaged','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','body','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','catch','show','params','includeAll','include','merge','create','update','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','nolimit','filter','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Account','get','mkdirSync','Owner','N.A.','closedAt','disposition','threadId','Public','Private','createReadStream','pipe'];(function(_0x1212cf,_0x34fcd8){var _0x443478=function(_0x407adb){while(--_0x407adb){_0x1212cf['push'](_0x1212cf['shift']());}};_0x443478(++_0x34fcd8);}(_0xf043,0x100));var _0x3f04=function(_0x324fe7,_0x56b02a){_0x324fe7=_0x324fe7-0x0;var _0x14e946=_0xf043[_0x324fe7];return _0x14e946;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3f04('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3f04('0x1'));var Mustache=require(_0x3f04('0x2'));var util=require(_0x3f04('0x3'));var path=require(_0x3f04('0x4'));var sox=require('sox');var csv=require(_0x3f04('0x5'));var ejs=require(_0x3f04('0x6'));var fs=require('fs');var fs_extra=require(_0x3f04('0x7'));var _=require(_0x3f04('0x8'));var squel=require(_0x3f04('0x9'));var crypto=require(_0x3f04('0xa'));var jsforce=require(_0x3f04('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f04('0xc'));var Papa=require(_0x3f04('0xd'));var Redis=require(_0x3f04('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3f04('0xf'));var as=require(_0x3f04('0x10'));var pdf=require(_0x3f04('0x11'));var hardwareService=require(_0x3f04('0x12'));var logger=require(_0x3f04('0x13'))(_0x3f04('0x14'));var utils=require(_0x3f04('0x15'));var config=require(_0x3f04('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f04('0x17'))['db'];config[_0x3f04('0x18')]=_['defaults'](config[_0x3f04('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f04('0x19'))(new Redis(config['redis']));require(_0x3f04('0x1a'))[_0x3f04('0x1b')](socket);function respondWithStatusCode(_0x2bf62a,_0xc03601){_0xc03601=_0xc03601||0xcc;return function(_0x4ce74e){if(_0x4ce74e){return _0x2bf62a[_0x3f04('0x1c')](_0xc03601);}return _0x2bf62a['status'](_0xc03601)[_0x3f04('0x1d')]();};}function respondWithResult(_0x30745e,_0x92779a){_0x92779a=_0x92779a||0xc8;return function(_0x451905){if(_0x451905){return _0x30745e[_0x3f04('0x1e')](_0x92779a)[_0x3f04('0x1f')](_0x451905);}};}function respondWithFilteredResult(_0x30cf5c,_0x4ae995){return function(_0x455ec1){if(_0x455ec1){var _0x43b15d=typeof _0x4ae995[_0x3f04('0x20')]==='undefined'&&typeof _0x4ae995[_0x3f04('0x21')]===_0x3f04('0x22');var _0x56105e=_0x455ec1[_0x3f04('0x23')];var _0xe66f83=_0x43b15d?0x0:_0x4ae995[_0x3f04('0x20')];var _0x38d8b3=_0x43b15d?_0x455ec1[_0x3f04('0x23')]:_0x4ae995[_0x3f04('0x20')]+_0x4ae995[_0x3f04('0x21')];var _0x324be2;if(_0x38d8b3>=_0x56105e){_0x38d8b3=_0x56105e;_0x324be2=0xc8;}else{_0x324be2=0xce;}_0x30cf5c['status'](_0x324be2);return _0x30cf5c['set'](_0x3f04('0x24'),_0xe66f83+'-'+_0x38d8b3+'/'+_0x56105e)[_0x3f04('0x1f')](_0x455ec1);}return null;};}function patchUpdates(_0x3b544b){return function(_0x2f206a){try{jsonpatch[_0x3f04('0x25')](_0x2f206a,_0x3b544b,!![]);}catch(_0xc310bf){return BPromise[_0x3f04('0x26')](_0xc310bf);}return _0x2f206a[_0x3f04('0x27')]();};}function saveUpdates(_0x486c9a,_0x1d5f61){return function(_0x3a948f){if(_0x3a948f){return _0x3a948f['update'](_0x486c9a)[_0x3f04('0x28')](function(_0x5b445e){return _0x5b445e;});}return null;};}function removeEntity(_0x5ba6c7,_0x47b55e){return function(_0x125b4f){if(_0x125b4f){return _0x125b4f['destroy']()['then'](function(){_0x5ba6c7[_0x3f04('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2455c2,_0xd01bfd){return function(_0x43c426){if(!_0x43c426){_0x2455c2[_0x3f04('0x1c')](0x194);}return _0x43c426;};}function handleError(_0x2bfe4a,_0x44f201){_0x44f201=_0x44f201||0x1f4;return function(_0x316460){logger[_0x3f04('0x29')](_0x316460[_0x3f04('0x2a')]);if(_0x316460['name']){delete _0x316460[_0x3f04('0x2b')];}_0x2bfe4a[_0x3f04('0x1e')](_0x44f201)[_0x3f04('0x2c')](_0x316460);};}function getInteractionUsers(_0x18236b,_0x47e7ae){return new BPromise(function(_0x2b2ec4,_0x32c584){try{if(_0x47e7ae[_0x18236b['id']]){_0x18236b[_0x3f04('0x2d')]=_[_0x3f04('0x2e')](_0x47e7ae[_0x18236b['id']],function(_0x339560){return{'id':_0x339560['id'],'fullname':_0x339560['fullname']};});}}catch(_0x13535e){_0x32c584(_0x13535e);}_0x2b2ec4(_0x18236b);});}function getInteractionTags(_0x171f29,_0xe1d201){return new BPromise(function(_0x5e35ec,_0x52f24c){try{if(_0x171f29['TagIds']){_0x171f29['Tags']=[];_0x171f29[_0x3f04('0x2f')][_0x3f04('0x30')](',')[_0x3f04('0x31')](function(_0x2c6f0d){_0x171f29[_0x3f04('0x32')]['push'](_0xe1d201[_0x2c6f0d]);});}delete _0x171f29[_0x3f04('0x2f')];}catch(_0x2f6b0c){_0x52f24c(_0x2f6b0c);}_0x5e35ec(_0x171f29);});}function updateOpenchannelInteraction(_0x3ab11b,_0x36d713,_0x7cdf8f){return new BPromise(function(_0x268063,_0x450004){return getInteractionUsers(_0x3ab11b,_0x7cdf8f)[_0x3f04('0x28')](function(_0x5cd16f){return getInteractionTags(_0x5cd16f,_0x36d713);})[_0x3f04('0x28')](function(_0x13ff59){return getStateInteraction(_0x13ff59);})[_0x3f04('0x28')](function(_0x4eb8fb){_0x268063(_0x4eb8fb);})['catch'](function(_0x2d2224){_0x450004(_0x2d2224);});});}function getStateInteraction(_0x16db9f){return new BPromise(function(_0x4801ae){_0x16db9f[_0x3f04('0x33')]=0x0;_0x16db9f[_0x3f04('0x34')]=0x0;_0x16db9f[_0x3f04('0x35')]=0x0;_0x16db9f['unmanaged']=0x0;_0x16db9f[_0x3f04('0x36')]=0x0;if(!_0x16db9f[_0x3f04('0x37')]&&!_0x16db9f['UserId']){_0x16db9f['waiting']+=0x1;}if(!_0x16db9f['closed']&&_0x16db9f[_0x3f04('0x38')]){_0x16db9f[_0x3f04('0x34')]+=0x1;if(_0x16db9f['waiting']){_0x16db9f['waiting']-=0x1;}}if(_0x16db9f['closed']&&_0x16db9f[_0x3f04('0x38')]){_0x16db9f[_0x3f04('0x35')]+=0x1;if(_0x16db9f['talking']){_0x16db9f['talking']-=0x1;}}if(_0x16db9f['closed']&&!_0x16db9f[_0x3f04('0x38')]){_0x16db9f[_0x3f04('0x39')]+=0x1;if(_0x16db9f[_0x3f04('0x33')]){_0x16db9f[_0x3f04('0x33')]-=0x1;}}_0x16db9f['total']+=0x1;_0x4801ae(_0x16db9f);});}exports[_0x3f04('0x3a')]=function(_0x1709ab,_0x5c3098){var _0x3b29e9={},_0xf29c7b={},_0x53d0a8={'count':0x0,'rows':[]};var _0x141611=_[_0x3f04('0x2e')](db[_0x3f04('0x3b')][_0x3f04('0x3c')],function(_0x1536fa){return{'name':_0x1536fa[_0x3f04('0x3d')],'type':_0x1536fa[_0x3f04('0x3e')][_0x3f04('0x3f')]};});_0xf29c7b['model']=_[_0x3f04('0x2e')](_0x141611,_0x3f04('0x2b'));_0xf29c7b[_0x3f04('0x40')]=_[_0x3f04('0x41')](_0x1709ab[_0x3f04('0x40')]);_0xf29c7b[_0x3f04('0x42')]=_[_0x3f04('0x43')](_0xf29c7b[_0x3f04('0x44')],_0xf29c7b['query']);_0x3b29e9[_0x3f04('0x45')]=_[_0x3f04('0x43')](_0xf29c7b[_0x3f04('0x44')],qs['fields'](_0x1709ab['query'][_0x3f04('0x46')]));_0x3b29e9[_0x3f04('0x45')]=_0x3b29e9['attributes'][_0x3f04('0x47')]?_0x3b29e9[_0x3f04('0x45')]:_0xf29c7b[_0x3f04('0x44')];if(!_0x1709ab[_0x3f04('0x40')]['hasOwnProperty']('nolimit')){_0x3b29e9[_0x3f04('0x21')]=qs[_0x3f04('0x21')](_0x1709ab[_0x3f04('0x40')][_0x3f04('0x21')]);_0x3b29e9[_0x3f04('0x20')]=qs[_0x3f04('0x20')](_0x1709ab['query']['offset']);}_0x3b29e9[_0x3f04('0x48')]=qs[_0x3f04('0x49')](_0x1709ab[_0x3f04('0x40')][_0x3f04('0x49')]);_0x3b29e9[_0x3f04('0x4a')]=qs[_0x3f04('0x42')](_[_0x3f04('0x4b')](_0x1709ab[_0x3f04('0x40')],_0xf29c7b['filters']),_0x141611);var _0x2d681c=[];var _0x1090c9=squel[_0x3f04('0x4c')]()[_0x3f04('0x4d')]('id')[_0x3f04('0x4d')]('name')[_0x3f04('0x4d')]('color')[_0x3f04('0x4e')](_0x3f04('0x4f'));var _0x2b61c5=squel[_0x3f04('0x4c')]()[_0x3f04('0x4d')]('u.id')[_0x3f04('0x4d')](_0x3f04('0x50'))[_0x3f04('0x4d')](_0x3f04('0x51'))[_0x3f04('0x4e')]('user_has_openchannel_interactions','ui')[_0x3f04('0x52')](_0x3f04('0x53'),'u',_0x3f04('0x54'));var _0x538086=squel[_0x3f04('0x4c')]()[_0x3f04('0x4e')]('openchannel_interactions','i')['left_join']('cm_contacts','c',_0x3f04('0x55'))[_0x3f04('0x52')](_0x3f04('0x53'),'o',_0x3f04('0x56'))[_0x3f04('0x52')](_0x3f04('0x57'),'a',_0x3f04('0x58'))[_0x3f04('0x52')](_0x3f04('0x59'),'me',_0x3f04('0x5a'))[_0x3f04('0x52')]('openchannel_interaction_has_tags','it',_0x3f04('0x5b'))[_0x3f04('0x52')](_0x3f04('0x4f'),'t','t.id\x20=\x20it.TagId');var _0x9378aa=squel[_0x3f04('0x5c')]();var _0x7afbe5=[];var _0x51f3b1=squel[_0x3f04('0x5c')]();var _0x99d76f;if(_0x1709ab[_0x3f04('0x40')][_0x3f04('0x5d')]){_0x99d76f=as[_0x3f04('0x5e')](_0x1709ab[_0x3f04('0x40')]['search']);var _0x360288=_0x99d76f['sqlOperator'];for(var _0x3e8ca6=0x0;_0x3e8ca6<_0x99d76f['conditions'][_0x3f04('0x47')];_0x3e8ca6++){var _0x4ee506=_0x99d76f[_0x3f04('0x5f')][_0x3e8ca6];var _0x5956c5='i';var _0x5c520b=_[_0x3f04('0x60')](_0x141611,['name',_0x4ee506[_0x3f04('0x4d')]]);if(!_0x5c520b){switch(_0x4ee506[_0x3f04('0x4d')]){case'unreadMessages':if(_0x4ee506[_0x3f04('0x61')]==0x1){_0x538086[_0x3f04('0x62')]('`'+_0x4ee506[_0x3f04('0x4d')]+_0x3f04('0x63'));}else{_0x538086[_0x3f04('0x62')]('`'+_0x4ee506['field']+'`\x20>\x200');}break;case'Contact':if(_0x4ee506['operator']===_0x3f04('0x64')){if(_0x4ee506[_0x3f04('0x61')]['split']('\x20')[_0x3f04('0x47')]>0x1){_0x9378aa[_0x360288](_0x3f04('0x65'),qs['getFullTextValue'](_0x4ee506[_0x3f04('0x61')]),null);}else{var _0x4b50b5='%'+_0x4ee506[_0x3f04('0x61')]+'%';_0x9378aa[_0x360288](_0x3f04('0x66'),_0x4b50b5,_0x4b50b5,_0x4b50b5);}}else{_0x5c520b=_['find'](_0x141611,[_0x3f04('0x2b'),_0x3f04('0x67')]);_0x4ee506[_0x3f04('0x4d')]=_0x3f04('0x67');_0x5b25e4=as[_0x3f04('0x68')](_0x5956c5,_0x5c520b[_0x3f04('0x3e')],_0x4ee506);_0x9378aa[_0x360288](_0x5b25e4[_0x3f04('0x69')],_0x5b25e4[_0x3f04('0x61')][_0x3f04('0x6a')],_0x5b25e4[_0x3f04('0x61')]['end']);}break;case _0x3f04('0x6b'):var _0x2cd707=_0x4ee506[_0x3f04('0x61')]['split'](',')['map'](function(_0x4ad625){return Number(_0x4ad625);});_0x2cd707['forEach'](function(_0x5a960e){_0x51f3b1['or'](_0x3f04('0x6c'),'%,'+_0x5a960e+',%');});_0x7afbe5=_[_0x3f04('0x6d')](_0x7afbe5,_0x2cd707);break;case _0x3f04('0x6e'):if(_0x4ee506['operator']==='$substring'){_0x9378aa[_0x360288]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4ee506[_0x3f04('0x61')]+'%',null);}else{_0x5c520b=_[_0x3f04('0x60')](_0x141611,[_0x3f04('0x2b'),'UserId']);_0x4ee506['field']='UserId';_0x5b25e4=as[_0x3f04('0x68')](_0x5956c5,_0x5c520b[_0x3f04('0x3e')],_0x4ee506);_0x9378aa[_0x360288](_0x5b25e4[_0x3f04('0x69')],_0x5b25e4[_0x3f04('0x61')]['start'],_0x5b25e4[_0x3f04('0x61')]['end']);}break;case _0x3f04('0x6f'):_0x5b25e4=as['buildExpression']('me',null,_0x4ee506);_0x9378aa[_0x360288](_0x5b25e4['text'],_0x5b25e4[_0x3f04('0x61')][_0x3f04('0x6a')],_0x5b25e4[_0x3f04('0x61')]['end']);break;}}else{var _0x5b25e4=as[_0x3f04('0x68')](_0x5956c5,_0x5c520b[_0x3f04('0x3e')],_0x4ee506);_0x9378aa[_0x360288](_0x5b25e4[_0x3f04('0x69')],_0x5b25e4[_0x3f04('0x61')][_0x3f04('0x6a')],_0x5b25e4[_0x3f04('0x61')][_0x3f04('0x1d')]);}}}else{var _0x2ab2ed=_(_0x1709ab[_0x3f04('0x40')])['keys']()[_0x3f04('0x2e')](function(_0x47fef6){return _[_0x3f04('0x70')](_0x141611,['name',_0x47fef6])?_0x47fef6:undefined;})[_0x3f04('0x71')]()[_0x3f04('0x61')]();if(!_[_0x3f04('0x72')](_0x2ab2ed)){_0x2ab2ed['forEach'](function(_0x3d5c6a){if(_0x3d5c6a==='OpenchannelAccountId'){_0x538086['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x3f04('0x73')](_0x1709ab[_0x3f04('0x40')][_0x3d5c6a]));}else if(_0x3d5c6a===_0x3f04('0x74')){var _0x2fc2e5=JSON[_0x3f04('0x75')](_0x1709ab[_0x3f04('0x40')][_0x3d5c6a])[_0x3f04('0x76')];var _0x1a8b94=JSON[_0x3f04('0x75')](_0x1709ab[_0x3f04('0x40')][_0x3d5c6a])[_0x3f04('0x77')];_0x538086[_0x3f04('0x4a')](_0x3f04('0x78'),_0x2fc2e5,_0x1a8b94);}else{if(_0x1709ab['query'][_0x3d5c6a]===_0x3f04('0x79')){_0x538086[_0x3f04('0x4a')]('i.'+_0x3d5c6a+_0x3f04('0x7a'));}else{_0x538086[_0x3f04('0x4a')]('i.'+_0x3d5c6a+'\x20=\x20?',_0x1709ab[_0x3f04('0x40')][_0x3d5c6a]);}}});}if(_0x1709ab[_0x3f04('0x40')][_0x3f04('0x7b')]){if(_0x1709ab[_0x3f04('0x40')][_0x3f04('0x7b')]==0x1){_0x538086[_0x3f04('0x62')]('`unreadMessages`\x20=\x200');}else{_0x538086[_0x3f04('0x62')](_0x3f04('0x7c'));}}if(_0x1709ab['query'][_0x3f04('0x7d')]){_0x7afbe5=_[_0x3f04('0x7e')](_0x1709ab[_0x3f04('0x40')][_0x3f04('0x7d')])?_0x1709ab[_0x3f04('0x40')]['tag']:new Array(_0x1709ab[_0x3f04('0x40')][_0x3f04('0x7d')]);_0x7afbe5['forEach'](function(_0x26afdd){_0x51f3b1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26afdd+',%');});}if(_0x1709ab[_0x3f04('0x40')]['filter']){var _0x154565=_0x1709ab[_0x3f04('0x40')]['filter']['replace']('\x5c','\x5c\x5c')[_0x3f04('0x7f')](/'/g,'\x27\x27');if(qs[_0x3f04('0x80')](_0x154565)){_0x9378aa['or']('i.id\x20LIKE\x20?',_0x154565+'%');}else{_0x9378aa['or'](_0x3f04('0x81'),qs[_0x3f04('0x82')](_0x154565))['or'](_0x3f04('0x83'),_0x154565+'%')['or'](_0x3f04('0x84'),_0x154565+'%');}}}_0x538086[_0x3f04('0x4a')](_0x9378aa);_0x538086[_0x3f04('0x85')](_0x3f04('0x86'));var _0x2a6a18={'type':db['Sequelize'][_0x3f04('0x87')][_0x3f04('0x88')],'raw':!![]};var _0x1fa642=_0x538086[_0x3f04('0x89')]();_0x1fa642[_0x3f04('0x4d')](_0x3f04('0x86'));_0x1fa642[_0x3f04('0x4d')](_0x3f04('0x8a'),_0x3f04('0x8b'));if(_0x3b29e9[_0x3f04('0x48')]){_0x3b29e9['order']['forEach'](function(_0x4f617a){var _0x2af0bb=_0x4f617a[0x0]===_0x3f04('0x8c')?_0x4f617a[0x0]:'i.'+_0x4f617a[0x0];_0x538086[_0x3f04('0x48')](_0x2af0bb,_0x4f617a[0x1]===_0x3f04('0x8d')?![]:!![]);});}if(!_[_0x3f04('0x72')](_0x7afbe5)){_0x538086['having'](_0x51f3b1);_0x1fa642['where']('t.id\x20IN\x20?',_0x7afbe5);}BPromise['resolve']()[_0x3f04('0x28')](function(){if(!_0x99d76f){if(_0x1709ab['query'][_0x3f04('0x8e')])return;_0x1fa642['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x538086[_0x3f04('0x4a')](_0x3f04('0x8f'));return;}if(_0x1709ab[_0x3f04('0x90')][_0x3f04('0x91')]!==_0x3f04('0x92'))return;return _0x1709ab[_0x3f04('0x90')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x3f04('0x28')](function(_0x2c0517){if(_[_0x3f04('0x72')](_0x2c0517)){_0x1fa642['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x538086[_0x3f04('0x4a')](_0x3f04('0x93'));}else{_0x1fa642[_0x3f04('0x4a')](_0x3f04('0x94'),_['map'](_0x2c0517,'id'));_0x538086['where'](_0x3f04('0x94'),_[_0x3f04('0x2e')](_0x2c0517,'id'));}});})[_0x3f04('0x28')](function(){if(_0x1709ab['user'][_0x3f04('0x91')]===_0x3f04('0x92')&&!_0x99d76f&&!_0x1709ab[_0x3f04('0x40')][_0x3f04('0x8e')])return[];return db['sequelize'][_0x3f04('0x40')](_0x1fa642[_0x3f04('0x95')](),_0x2a6a18);})[_0x3f04('0x28')](function(_0x40ae4c){_0x53d0a8[_0x3f04('0x23')]=_0x40ae4c[_0x3f04('0x47')];if(_0x53d0a8['count']===0x0)return[];return db[_0x3f04('0x96')]['query'](_0x1090c9['toString'](),_0x2a6a18)[_0x3f04('0x28')](function(_0x582777){_0x2d681c=_['keyBy'](_0x582777,'id');_0x2a6a18=_['merge'](_0x2a6a18,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1709ab[_0x3f04('0x40')][_0x3f04('0x46')]){_0x3b29e9['attributes'][_0x3f04('0x31')](function(_0x1f384f){_0x538086[_0x3f04('0x4d')]('i.'+_0x1f384f);});}else{_0x538086[_0x3f04('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3f04('0x8b'));_0x538086[_0x3f04('0x4d')](_0x3f04('0x97'),_0x3f04('0x98'));_0x538086[_0x3f04('0x4d')](_0x3f04('0x99'),_0x3f04('0x9a'));_0x538086[_0x3f04('0x4d')](_0x3f04('0x9b'),'contactName');_0x538086['field'](_0x3f04('0x9c'));_0x538086[_0x3f04('0x4d')](_0x3f04('0x9d'),_0x3f04('0x9e'));_0x538086[_0x3f04('0x4d')]('c.lastName',_0x3f04('0x9f'));_0x538086[_0x3f04('0x4d')](_0x3f04('0xa0'),_0x3f04('0xa1'));_0x538086[_0x3f04('0x4d')](_0x3f04('0xa2'),_0x3f04('0xa3'));_0x538086['field'](_0x3f04('0xa4'),'Contact.mobile');_0x538086[_0x3f04('0x4d')](_0x3f04('0xa5'),'Contact.fax');_0x538086[_0x3f04('0x4d')](_0x3f04('0xa6'),_0x3f04('0xa7'));_0x538086[_0x3f04('0x4d')]('o.internal',_0x3f04('0xa8'));_0x538086[_0x3f04('0x4d')](_0x3f04('0xa9'),'TagIds');}if(_0x3b29e9[_0x3f04('0x21')])_0x538086[_0x3f04('0x21')](_0x3b29e9[_0x3f04('0x21')]);if(_0x3b29e9['offset'])_0x538086[_0x3f04('0x20')](_0x3b29e9[_0x3f04('0x20')]);return db[_0x3f04('0x96')]['query'](_0x538086[_0x3f04('0x95')](),_0x2a6a18);})[_0x3f04('0x28')](function(_0x3798ce){if(_0x3798ce[_0x3f04('0x47')]>0x0)_0x2b61c5[_0x3f04('0x4a')](_0x3f04('0xaa'),_[_0x3f04('0x2e')](_0x3798ce,'id'));return db[_0x3f04('0x96')][_0x3f04('0x40')](_0x2b61c5[_0x3f04('0x95')](),_0x2a6a18)[_0x3f04('0x28')](function(_0x264b36){var _0x49598f=_[_0x3f04('0xab')](_0x264b36,_0x3f04('0xac'));var _0x2f013d=[];_0x3798ce['forEach'](function(_0x121021){_0x2f013d[_0x3f04('0xad')](updateOpenchannelInteraction(_0x121021,_0x2d681c,_0x49598f));});return BPromise['all'](_0x2f013d);});});})['then'](function(_0x576fc8){_0x53d0a8['rows']=_0x576fc8;return _0x53d0a8;})['then'](respondWithFilteredResult(_0x5c3098,_0x3b29e9))[_0x3f04('0xae')](handleError(_0x5c3098,null));};exports[_0x3f04('0xaf')]=function(_0x5b72b2,_0xed07dd){var _0xb1bc82={};if(_0x5b72b2[_0x3f04('0x40')]['type']&&_0x5b72b2[_0x3f04('0x40')][_0x3f04('0x3e')]===_0x3f04('0x4e')){_0xb1bc82[_0x3f04('0x4e')]=_0x5b72b2[_0x3f04('0xb0')]['id'];}else{_0xb1bc82['id']=_0x5b72b2[_0x3f04('0xb0')]['id'];}var _0x3111ea={'raw':![],'where':_0xb1bc82},_0xca4084={};_0xca4084[_0x3f04('0x44')]=_[_0x3f04('0x41')](db[_0x3f04('0x3b')][_0x3f04('0x3c')]);_0xca4084[_0x3f04('0x40')]=_['keys'](_0x5b72b2[_0x3f04('0x40')]);_0xca4084[_0x3f04('0x42')]=_['intersection'](_0xca4084[_0x3f04('0x44')],_0xca4084[_0x3f04('0x40')]);_0x3111ea[_0x3f04('0x45')]=_['intersection'](_0xca4084[_0x3f04('0x44')],qs[_0x3f04('0x46')](_0x5b72b2[_0x3f04('0x40')][_0x3f04('0x46')]));_0x3111ea[_0x3f04('0x45')]=_0x3111ea[_0x3f04('0x45')][_0x3f04('0x47')]?_0x3111ea[_0x3f04('0x45')]:_0xca4084[_0x3f04('0x44')];if(_0x5b72b2[_0x3f04('0x40')][_0x3f04('0xb1')]){_0x3111ea[_0x3f04('0xb2')]=[{'all':!![]}];}_0x3111ea=_[_0x3f04('0xb3')]({},_0x3111ea,_0x5b72b2['options']);return db['OpenchannelInteraction'][_0x3f04('0x60')](_0x3111ea)[_0x3f04('0x28')](handleEntityNotFound(_0xed07dd,null))[_0x3f04('0x28')](respondWithResult(_0xed07dd,null))['catch'](handleError(_0xed07dd,null));};exports[_0x3f04('0xb4')]=function(_0x169ec6,_0x5633b9){return db[_0x3f04('0x3b')]['create'](_0x169ec6[_0x3f04('0x6f')],{})[_0x3f04('0x28')](respondWithResult(_0x5633b9,0xc9))['catch'](handleError(_0x5633b9,null));};exports[_0x3f04('0xb5')]=function(_0x2b5419,_0x20bbf2){if(_0x2b5419[_0x3f04('0x6f')]['id']){delete _0x2b5419[_0x3f04('0x6f')]['id'];}return db[_0x3f04('0x3b')][_0x3f04('0x60')]({'where':{'id':_0x2b5419[_0x3f04('0xb0')]['id']}})[_0x3f04('0x28')](handleEntityNotFound(_0x20bbf2,null))[_0x3f04('0x28')](saveUpdates(_0x2b5419[_0x3f04('0x6f')],null))[_0x3f04('0x28')](respondWithResult(_0x20bbf2,null))[_0x3f04('0xae')](handleError(_0x20bbf2,null));};exports['destroy']=function(_0x2f5775,_0x2cfe9c){return db[_0x3f04('0x3b')][_0x3f04('0x60')]({'where':{'id':_0x2f5775[_0x3f04('0xb0')]['id']}})[_0x3f04('0x28')](handleEntityNotFound(_0x2cfe9c,null))['then'](removeEntity(_0x2cfe9c,null))[_0x3f04('0xae')](handleError(_0x2cfe9c,null));};exports['describe']=function(_0x1f4605,_0x49c7f8){return db['OpenchannelInteraction'][_0x3f04('0xb6')]()['then'](respondWithResult(_0x49c7f8,null))[_0x3f04('0xae')](handleError(_0x49c7f8,null));};exports['addMessage']=function(_0x231b54,_0x3ae683,_0x14d709){return db['OpenchannelMessage'][_0x3f04('0x60')]({'where':{'id':_0x231b54['params']['id']}})['then'](handleEntityNotFound(_0x3ae683,null))['then'](function(_0x3f2529){if(_0x3f2529){return _0x3f2529[_0x3f04('0xb7')](_0x231b54[_0x3f04('0x6f')][_0x3f04('0xb8')],_[_0x3f04('0xb9')](_0x231b54['body'],['ids','id'])||{});}})[_0x3f04('0x28')](respondWithResult(_0x3ae683,null))[_0x3f04('0xae')](handleError(_0x3ae683,null));};exports[_0x3f04('0xba')]=function(_0x280fcd,_0x1896e5,_0x324f18){var _0x2ae4f8={'raw':![],'where':{}};var _0x299449={};var _0x5d7905={'count':0x0,'rows':[]};return db[_0x3f04('0x3b')][_0x3f04('0xbb')]({'where':{'id':_0x280fcd['params']['id']}})[_0x3f04('0x28')](handleEntityNotFound(_0x1896e5,null))[_0x3f04('0x28')](function(_0x22e001){if(_0x22e001){_0x299449[_0x3f04('0x44')]=_['keys'](db[_0x3f04('0xbc')]['rawAttributes']);_0x299449[_0x3f04('0x40')]=_[_0x3f04('0x41')](_0x280fcd[_0x3f04('0x40')]);_0x299449[_0x3f04('0x42')]=_['intersection'](_0x299449[_0x3f04('0x44')],_0x299449[_0x3f04('0x40')]);_0x2ae4f8[_0x3f04('0x45')]=_[_0x3f04('0x43')](_0x299449[_0x3f04('0x44')],qs[_0x3f04('0x46')](_0x280fcd[_0x3f04('0x40')]['fields']));_0x2ae4f8[_0x3f04('0x45')]=_0x2ae4f8[_0x3f04('0x45')]['length']?_0x2ae4f8[_0x3f04('0x45')]:_0x299449['model'];if(!_0x280fcd['query']['hasOwnProperty'](_0x3f04('0xbd'))){_0x2ae4f8['limit']=qs[_0x3f04('0x21')](_0x280fcd['query']['limit']);_0x2ae4f8[_0x3f04('0x20')]=qs[_0x3f04('0x20')](_0x280fcd['query'][_0x3f04('0x20')]);}_0x2ae4f8[_0x3f04('0x48')]=qs[_0x3f04('0x49')](_0x280fcd[_0x3f04('0x40')][_0x3f04('0x49')]);_0x2ae4f8[_0x3f04('0x4a')]=qs['filters'](_[_0x3f04('0x4b')](_0x280fcd[_0x3f04('0x40')],_0x299449[_0x3f04('0x42')]));_0x2ae4f8['where'][_0x3f04('0xac')]=_0x22e001['id'];if(_0x280fcd['query'][_0x3f04('0xbe')]){_0x2ae4f8[_0x3f04('0x4a')]=_['merge'](_0x2ae4f8[_0x3f04('0x4a')],{'$or':_[_0x3f04('0x2e')](_0x2ae4f8['attributes'],function(_0x10ae4f){var _0x23398d={};_0x23398d[_0x10ae4f]={'$like':'%'+_0x280fcd[_0x3f04('0x40')]['filter']+'%'};return _0x23398d;})});}if(_0x280fcd[_0x3f04('0x40')][_0x3f04('0x76')]){var _0x10d420=_0x280fcd[_0x3f04('0x40')][_0x3f04('0x76')][_0x3f04('0x30')](',');var _0x549d99={};_0x549d99[_0x10d420[0x0]]={'$gte':moment(_0x10d420[0x1])[_0x3f04('0xbf')](_0x3f04('0xc0'))};_0x2ae4f8[_0x3f04('0x4a')]=_[_0x3f04('0xb3')](_0x2ae4f8[_0x3f04('0x4a')],_0x549d99);}_0x2ae4f8=_[_0x3f04('0xb3')]({},_0x2ae4f8,_0x280fcd[_0x3f04('0xc1')]);return db[_0x3f04('0xbc')][_0x3f04('0x23')]({'where':_0x2ae4f8['where']})[_0x3f04('0x28')](function(_0x6976fd){_0x5d7905[_0x3f04('0x23')]=_0x6976fd;if(_0x280fcd[_0x3f04('0x40')][_0x3f04('0xb1')]){_0x2ae4f8[_0x3f04('0xb2')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x3f04('0xc2')](_0x2ae4f8);})[_0x3f04('0x28')](function(_0x1c5cfb){_0x5d7905[_0x3f04('0xc3')]=_0x1c5cfb;return _0x5d7905;});}})['then'](respondWithFilteredResult(_0x1896e5,_0x2ae4f8))[_0x3f04('0xae')](handleError(_0x1896e5,null));};exports[_0x3f04('0xc4')]=function(_0x42afe0,_0x4e9b9e,_0x31c871){return db[_0x3f04('0x3b')][_0x3f04('0x60')]({'where':{'id':_0x42afe0[_0x3f04('0xb0')]['id']}})[_0x3f04('0x28')](handleEntityNotFound(_0x4e9b9e,null))['then'](function(_0x4a0cdd){if(_0x4a0cdd){return _0x4a0cdd['setTags'](_0x42afe0[_0x3f04('0x6f')][_0x3f04('0xb8')],_[_0x3f04('0xb9')](_0x42afe0['body'],[_0x3f04('0xb8'),'id'])||{})[_0x3f04('0xc5')](function(){return db[_0x3f04('0x6b')][_0x3f04('0xc2')]({'attributes':['id',_0x3f04('0x2b'),_0x3f04('0xc6')],'where':{'id':_0x42afe0[_0x3f04('0x6f')]['ids']}});})[_0x3f04('0x28')](function(_0x16e554){socket[_0x3f04('0xc7')](_0x3f04('0xc8'),{'id':Number(_0x42afe0[_0x3f04('0xb0')]['id']),'tags':_0x16e554||[]});return{'id':Number(_0x42afe0[_0x3f04('0xb0')]['id']),'tags':_0x16e554||[]};});}})[_0x3f04('0x28')](respondWithResult(_0x4e9b9e,null))[_0x3f04('0xae')](handleError(_0x4e9b9e,null));};exports[_0x3f04('0xc9')]=function(_0x187db6,_0x599268,_0x1c919c){return db[_0x3f04('0x3b')]['find']({'where':{'id':_0x187db6[_0x3f04('0xb0')]['id']}})[_0x3f04('0x28')](handleEntityNotFound(_0x599268,null))[_0x3f04('0x28')](function(_0x359033){if(_0x359033){return _0x359033['removeTags'](_0x187db6[_0x3f04('0x40')][_0x3f04('0xb8')]);}})[_0x3f04('0x28')](respondWithStatusCode(_0x599268,null))[_0x3f04('0xae')](handleError(_0x599268,null));};exports[_0x3f04('0xca')]=function(_0x424fdc,_0x486e9f){var _0x308d2a=moment()['unix']()['toString']();var _0x3e13c8=path[_0x3f04('0xcb')](config['root'],_0x3f04('0xcc'),_0x3f04('0xcd'),_0x3f04('0xce'));var _0x5b3319=path['join'](config[_0x3f04('0xcf')],_0x3f04('0xcc'),_0x3f04('0xcd'),_0x3f04('0xd0'));var _0x21fd9d=path['join'](_0x3e13c8,_0x308d2a);var _0x40205e=util[_0x3f04('0xbf')]('transcript-%d-%s.zip',_0x424fdc['params']['id'],_0x308d2a);var _0x1c09a7=path[_0x3f04('0xcb')](_0x3e13c8,_0x40205e);var _0x3aaa3e=[];_0x3aaa3e[_0x3f04('0xad')]({'model':db['User'],'as':_0x3f04('0x6e'),'attributes':['id',_0x3f04('0xd1')],'raw':!![]});_0x3aaa3e[_0x3f04('0xad')]({'model':db[_0x3f04('0xd2')],'as':_0x3f04('0xd3'),'attributes':['id',_0x3f04('0xd4'),_0x3f04('0xd5')],'raw':!![]});if(_0x424fdc[_0x3f04('0x40')][_0x3f04('0xd0')]){_0x3aaa3e['push']({'model':db[_0x3f04('0xd6')],'as':_0x3f04('0xd6'),'raw':!![]});}var _0x325fe4=[{'model':db[_0x3f04('0xbc')],'as':_0x3f04('0xd7'),'attributes':['id','body',_0x3f04('0x74'),'direction',_0x3f04('0xd8'),_0x3f04('0x7b')],'include':_0x3aaa3e}];_0x325fe4[_0x3f04('0xad')]({'model':db[_0x3f04('0xd9')],'as':_0x3f04('0xda'),'attributes':['id','name']});_0x325fe4['push']({'model':db[_0x3f04('0x6e')],'as':'Owner','attributes':['id',_0x3f04('0xd1')]});return db[_0x3f04('0x3b')][_0x3f04('0x60')]({'where':{'id':_0x424fdc[_0x3f04('0xb0')]['id']},'include':_0x325fe4})[_0x3f04('0x28')](handleEntityNotFound(_0x486e9f,null))[_0x3f04('0x28')](function(_0x467b69){if(_0x467b69){var _0xe48e53=_0x467b69[_0x3f04('0xdb')]({'plain':!![]});fs[_0x3f04('0xdc')](_0x21fd9d);var _0x191ff1={'channel':'Openchannel','account':_0xe48e53['Account'][_0x3f04('0x2b')],'agent':_0xe48e53['Owner']?_0xe48e53[_0x3f04('0xdd')][_0x3f04('0xd1')]:_0x3f04('0xde'),'createdAt':moment(_0xe48e53[_0x3f04('0x74')])[_0x3f04('0xbf')](_0x3f04('0xc0'))[_0x3f04('0x95')](),'closedAt':_0xe48e53[_0x3f04('0x37')]?moment(_0xe48e53[_0x3f04('0xdf')])[_0x3f04('0xbf')](_0x3f04('0xc0'))[_0x3f04('0x95')]():'','disposition':_0xe48e53[_0x3f04('0xe0')],'visibility':_0xe48e53[_0x3f04('0xe1')]?_0x3f04('0xe2'):_0x3f04('0xe3'),'messages':_(_0xe48e53[_0x3f04('0xd7')])[_0x3f04('0xbe')]({'secret':![]})[_0x3f04('0x2e')](function(_0x3fdc5d){if(_0x3fdc5d[_0x3f04('0xd6')]){var _0x39ef1f=path['join'](_0x5b3319,_0x3fdc5d[_0x3f04('0xd6')]['basename']);if(fs['existsSync'](_0x39ef1f)){fs[_0x3f04('0xe4')](_0x39ef1f)[_0x3f04('0xe5')](fs['createWriteStream'](path[_0x3f04('0xcb')](_0x21fd9d,_0x3fdc5d[_0x3f04('0xd6')]['basename'])));}}return{'date':moment(_0x3fdc5d['createdAt'])['format'](_0x3f04('0xc0'))[_0x3f04('0x95')](),'sender':_0x3fdc5d[_0x3f04('0xe6')]===_0x3f04('0xe7')?_0x3fdc5d['User']?_0x3fdc5d[_0x3f04('0x6e')][_0x3f04('0xd1')]:_0x3f04('0xe8'):_0x3fdc5d[_0x3f04('0xd3')][_0x3f04('0xd4')]+(_0x3fdc5d[_0x3f04('0xd3')][_0x3f04('0xd5')]?'\x20'+_0x3fdc5d[_0x3f04('0xd3')][_0x3f04('0xd5')]:''),'body':_0x3fdc5d[_0x3f04('0xd6')]?_0x3fdc5d['Attachment']['basename']:_0x3fdc5d[_0x3f04('0x6f')],'direction':_0x3fdc5d[_0x3f04('0xe6')]==='out'?'A':'C','secret':_0x3fdc5d['secret'],'read':_0x3fdc5d['read'],'attachment':_0x3fdc5d[_0x3f04('0xd6')]};})[_0x3f04('0x61')]()};return ejs[_0x3f04('0xe9')](path[_0x3f04('0xcb')](config[_0x3f04('0xcf')],_0x3f04('0xcc'),_0x3f04('0xea'),_0x3f04('0xeb')),{'interaction':_0x191ff1})[_0x3f04('0x28')](function(_0x2520ca){var _0x5022e0=path[_0x3f04('0xcb')](_0x21fd9d,_0x3f04('0xec')+_0xe48e53['id']+'-'+_0x308d2a+_0x3f04('0xed'));var _0x7f5e7f={'path':_0x5022e0,'channel':_0x3f04('0xee'),'interactionId':_0xe48e53['id']};return pdf[_0x3f04('0xef')](_0x2520ca,_0x7f5e7f);})[_0x3f04('0x28')](function(){return new BPromise(function(_0x4e2ebe,_0x59390b){zipdir(_0x21fd9d,{'saveTo':_0x1c09a7},function(_0x44ee39,_0x159eec){if(_0x44ee39)return _0x59390b(_0x44ee39);return _0x4e2ebe(_0x159eec);});})[_0x3f04('0x28')](function(){return new BPromise(function(_0x30cd8c,_0x572c90){rimraf(_0x21fd9d,function(_0x2fe17b){if(_0x2fe17b)_0x572c90(_0x2fe17b);return _0x30cd8c();});});})[_0x3f04('0x28')](function(){return _0x486e9f['download'](_0x1c09a7,_0x40205e,function(_0x4c7901){if(_0x4c7901){console[_0x3f04('0xf0')](_0x3f04('0xf1'),_0x4c7901);}else{fs[_0x3f04('0xf2')](_0x1c09a7);}});});});}else{return _0x486e9f[_0x3f04('0x1c')](0xc8);}})['catch'](handleError(_0x486e9f,null));};
\ No newline at end of file
index 8b2a4d3..89d3046 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74e6=['getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','save','update'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x74e6,0x1a4));var _0x674e=function(_0x23d600,_0x157789){_0x23d600=_0x23d600-0x0;var _0x472f81=_0x74e6[_0x23d600];return _0x472f81;};'use strict';var EventEmitter=require(_0x674e('0x0'));var OpenchannelInteraction=require(_0x674e('0x1'))['db'][_0x674e('0x2')];var OpenchannelMessage=require(_0x674e('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x674e('0x3'),'afterUpdate':_0x674e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x30ec48){return function(_0x460211,_0x1445d8,_0x588a1a){_0x460211[_0x674e('0x5')]({'attributes':['id'],'raw':!![]})[_0x674e('0x6')](function(_0x35d50e){_0x460211['setDataValue']('Users',_0x35d50e[_0x674e('0x7')](function(_0x505eea){return{'id':_0x505eea['id']};}));return OpenchannelMessage[_0x674e('0x8')]({'where':{'OpenchannelInteractionId':_0x460211['id'],'direction':'in','read':![]},'raw':!![]});})[_0x674e('0x6')](function(_0x5a1973){_0x460211[_0x674e('0x9')](_0x674e('0xa'),_0x5a1973[_0x674e('0xb')]);OpenchannelInteractionEvents[_0x674e('0xc')](_0x30ec48+':'+_0x460211['id'],_0x460211);OpenchannelInteractionEvents[_0x674e('0xc')](_0x30ec48,_0x460211);_0x588a1a(null);})[_0x674e('0xd')](_0x588a1a(null));};}for(var e in events){if(events[_0x674e('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x674e('0xf')](e,emitEvent(event));}}module[_0x674e('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x8ea6=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','Users','map','findAll','then','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1fb157,_0x544507){var _0x16a041=function(_0x4e3f41){while(--_0x4e3f41){_0x1fb157['push'](_0x1fb157['shift']());}};_0x16a041(++_0x544507);}(_0x8ea6,0x9e));var _0x68ea=function(_0x486fb5,_0x579a95){_0x486fb5=_0x486fb5-0x0;var _0x46bf65=_0x8ea6[_0x486fb5];return _0x46bf65;};'use strict';var EventEmitter=require(_0x68ea('0x0'));var OpenchannelInteraction=require(_0x68ea('0x1'))['db'][_0x68ea('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x68ea('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x68ea('0x4')](0x0);var events={'afterCreate':_0x68ea('0x5'),'afterUpdate':_0x68ea('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1de9b7){return function(_0x9d9ebb,_0x1c1a5,_0x5d37a5){_0x9d9ebb[_0x68ea('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5e32fc){_0x9d9ebb['setDataValue'](_0x68ea('0x8'),_0x5e32fc[_0x68ea('0x9')](function(_0x57062a){return{'id':_0x57062a['id']};}));return OpenchannelMessage[_0x68ea('0xa')]({'where':{'OpenchannelInteractionId':_0x9d9ebb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x68ea('0xb')](function(_0x6287a8){_0x9d9ebb['setDataValue']('unreadMessages',_0x6287a8['length']);OpenchannelInteractionEvents['emit'](_0x1de9b7+':'+_0x9d9ebb['id'],_0x9d9ebb);OpenchannelInteractionEvents[_0x68ea('0xc')](_0x1de9b7,_0x9d9ebb);_0x5d37a5(null);})[_0x68ea('0xd')](_0x5d37a5(null));};}for(var e in events){if(events[_0x68ea('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x68ea('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index 2139040..8c5b6c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cb3=['YYYY-MM-DD\x20HH:mm:ss','util','moment','request-promise','path','exports','define','utf8mb4_unicode_ci','changed','closed','closedAt'];(function(_0x3f6c83,_0x1ac4d3){var _0x1cd6ad=function(_0x11cce8){while(--_0x11cce8){_0x3f6c83['push'](_0x3f6c83['shift']());}};_0x1cd6ad(++_0x1ac4d3);}(_0x3cb3,0x177));var _0x33cb=function(_0x2442e2,_0x3f3b5c){_0x2442e2=_0x2442e2-0x0;var _0x5454cd=_0x3cb3[_0x2442e2];return _0x5454cd;};'use strict';var _=require('lodash');var util=require(_0x33cb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x33cb('0x1'));var BPromise=require('bluebird');var rp=require(_0x33cb('0x2'));var fs=require('fs');var path=require(_0x33cb('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x33cb('0x4')]=function(_0x388ba2,_0x3365fb){return _0x388ba2[_0x33cb('0x5')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x33cb('0x6'),'hooks':{'beforeUpdate':function(_0x1078ba,_0x37c69f,_0x44e40f){if(_0x1078ba[_0x33cb('0x7')](_0x33cb('0x8'))){_0x1078ba[_0x33cb('0x9')]=moment()['format'](_0x33cb('0xa'));}_0x44e40f(null,_0x1078ba);}}});};
\ No newline at end of file
+var _0xaeb7=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format'];(function(_0x4db83f,_0x14b0bf){var _0x263fff=function(_0x305c0e){while(--_0x305c0e){_0x4db83f['push'](_0x4db83f['shift']());}};_0x263fff(++_0x14b0bf);}(_0xaeb7,0xd2));var _0x7aeb=function(_0x1871a1,_0x1fa60c){_0x1871a1=_0x1871a1-0x0;var _0x3c3a2c=_0xaeb7[_0x1871a1];return _0x3c3a2c;};'use strict';var _=require(_0x7aeb('0x0'));var util=require('util');var logger=require(_0x7aeb('0x1'))(_0x7aeb('0x2'));var moment=require('moment');var BPromise=require(_0x7aeb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7aeb('0x4'));var rimraf=require(_0x7aeb('0x5'));var config=require(_0x7aeb('0x6'));var attributes=require(_0x7aeb('0x7'));module['exports']=function(_0x1fe06b,_0x69eb0f){return _0x1fe06b['define'](_0x7aeb('0x8'),attributes,{'tableName':_0x7aeb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7aeb('0xa'),'collate':_0x7aeb('0xb'),'hooks':{'beforeUpdate':function(_0x2d8b18,_0x5dbe14,_0x5d26c4){if(_0x2d8b18[_0x7aeb('0xc')]('closed')){_0x2d8b18[_0x7aeb('0xd')]=moment()[_0x7aeb('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5d26c4(null,_0x2d8b18);}}});};
\ No newline at end of file
index 13f005d..4aee04f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x853a=['./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','OpenchannelInteraction','update','body','options','where','attributes','limit','UpdateOpenchannelInteraction','catch','AddTagsToOpenchannelInteraction','addTags','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5d4698,_0x47f8e1){var _0x4ca1a2=function(_0x1e4e23){while(--_0x1e4e23){_0x5d4698['push'](_0x5d4698['shift']());}};_0x4ca1a2(++_0x47f8e1);}(_0x853a,0x1cf));var _0xa853=function(_0x27fe26,_0x3b8ca7){_0x27fe26=_0x27fe26-0x0;var _0x4fcb35=_0x853a[_0x27fe26];return _0x4fcb35;};'use strict';var _=require(_0xa853('0x0'));var util=require(_0xa853('0x1'));var moment=require('moment');var BPromise=require(_0xa853('0x2'));var rs=require(_0xa853('0x3'));var fs=require('fs');var Redis=require(_0xa853('0x4'));var db=require(_0xa853('0x5'))['db'];var utils=require(_0xa853('0x6'));var logger=require(_0xa853('0x7'))(_0xa853('0x8'));var config=require(_0xa853('0x9'));var jayson=require(_0xa853('0xa'));var client=jayson[_0xa853('0xb')][_0xa853('0xc')]({'port':0x232a});config[_0xa853('0xd')]=_[_0xa853('0xe')](config[_0xa853('0xd')],{'host':_0xa853('0xf'),'port':0x18eb});var socket=require(_0xa853('0x10'))(new Redis(config[_0xa853('0xd')]));require(_0xa853('0x11'))['register'](socket);function respondWithRpcPromise(_0x31d0e8,_0x5caf88,_0x5bd70f){return new BPromise(function(_0x10beaf,_0x51ac8c){return client[_0xa853('0x12')](_0x31d0e8,_0x5bd70f)['then'](function(_0x45134e){logger[_0xa853('0x13')](_0xa853('0x14'),_0x5caf88,_0xa853('0x15'));logger[_0xa853('0x16')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x5caf88,'request\x20sent',JSON[_0xa853('0x17')](_0x45134e));if(_0x45134e['error']){if(_0x45134e[_0xa853('0x18')][_0xa853('0x19')]===0x1f4){logger[_0xa853('0x18')](_0xa853('0x14'),_0x5caf88,_0x45134e[_0xa853('0x18')][_0xa853('0x1a')]);return _0x51ac8c(_0x45134e[_0xa853('0x18')][_0xa853('0x1a')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x5caf88,_0x45134e['error'][_0xa853('0x1a')]);return _0x10beaf(_0x45134e[_0xa853('0x18')]['message']);}else{logger[_0xa853('0x13')](_0xa853('0x14'),_0x5caf88,_0xa853('0x15'));_0x10beaf(_0x45134e['result'][_0xa853('0x1a')]);}})['catch'](function(_0x2720ed){logger[_0xa853('0x18')](_0xa853('0x14'),_0x5caf88,_0x2720ed);_0x51ac8c(_0x2720ed);});});}exports['UpdateOpenchannelInteraction']=function(_0x43a306){var _0x2af3a4=this;return new Promise(function(_0x13f60e,_0x5ddc1d){return db[_0xa853('0x1b')][_0xa853('0x1c')](_0x43a306[_0xa853('0x1d')],{'raw':_0x43a306[_0xa853('0x1e')]?_0x43a306[_0xa853('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43a306[_0xa853('0x1e')]?_0x43a306[_0xa853('0x1e')][_0xa853('0x1f')]||null:null,'attributes':_0x43a306['options']?_0x43a306[_0xa853('0x1e')][_0xa853('0x20')]||null:null,'limit':_0x43a306['options']?_0x43a306[_0xa853('0x1e')][_0xa853('0x21')]||null:null})['then'](function(_0x52c034){logger[_0xa853('0x13')](_0xa853('0x22'),_0x43a306);logger[_0xa853('0x16')](_0xa853('0x22'),_0x43a306,JSON['stringify'](_0x52c034));_0x13f60e(_0x52c034);})[_0xa853('0x23')](function(_0x247495){logger[_0xa853('0x18')](_0xa853('0x22'),_0x247495[_0xa853('0x1a')],_0x43a306);_0x5ddc1d(_0x2af3a4['error'](0x1f4,_0x247495['message']));});});};exports[_0xa853('0x24')]=function(_0x59a141){return new Promise(function(_0x18d6ea,_0x40650b){return db[_0xa853('0x1b')]['find']({'where':_0x59a141[_0xa853('0x1e')]?_0x59a141[_0xa853('0x1e')][_0xa853('0x1f')]||null:null})['then'](function(_0x13ac17){if(_0x13ac17){return _0x13ac17[_0xa853('0x25')](_0x59a141[_0xa853('0x1d')][_0xa853('0x26')],_['omit'](_0x59a141['body'],['ids','id'])||{});}})['spread'](function(_0x2251e7){logger[_0xa853('0x13')](_0xa853('0x27'),_0x59a141);logger[_0xa853('0x16')]('AddTags',_0x59a141,JSON['stringify'](_0x2251e7));_0x18d6ea(_0x2251e7);})[_0xa853('0x23')](function(_0x3f8796){logger[_0xa853('0x18')]('AddTags',_0x3f8796[_0xa853('0x1a')],_0x59a141);_0x40650b(_this[_0xa853('0x18')](0x1f4,_0x3f8796[_0xa853('0x1a')]));});});};
\ No newline at end of file
+var _0x983d=['limit','then','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','update','body','options','raw','where'];(function(_0x52e1f8,_0x67bb87){var _0xb6684d=function(_0x33bfad){while(--_0x33bfad){_0x52e1f8['push'](_0x52e1f8['shift']());}};_0xb6684d(++_0x67bb87);}(_0x983d,0x197));var _0xd983=function(_0x5bf0d9,_0x26dfb4){_0x5bf0d9=_0x5bf0d9-0x0;var _0x2058e7=_0x983d[_0x5bf0d9];return _0x2058e7;};'use strict';var _=require(_0xd983('0x0'));var util=require(_0xd983('0x1'));var moment=require(_0xd983('0x2'));var BPromise=require(_0xd983('0x3'));var rs=require(_0xd983('0x4'));var fs=require('fs');var Redis=require(_0xd983('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd983('0x6'))(_0xd983('0x7'));var config=require(_0xd983('0x8'));var jayson=require(_0xd983('0x9'));var client=jayson[_0xd983('0xa')][_0xd983('0xb')]({'port':0x232a});config[_0xd983('0xc')]=_[_0xd983('0xd')](config[_0xd983('0xc')],{'host':_0xd983('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd983('0xc')]));require(_0xd983('0xf'))[_0xd983('0x10')](socket);function respondWithRpcPromise(_0x31e630,_0x1e8a7a,_0x1d18b1){return new BPromise(function(_0x3f99dd,_0x3226d2){return client[_0xd983('0x11')](_0x31e630,_0x1d18b1)['then'](function(_0x3da47a){logger[_0xd983('0x12')](_0xd983('0x13'),_0x1e8a7a,_0xd983('0x14'));logger['debug'](_0xd983('0x15'),_0x1e8a7a,_0xd983('0x14'),JSON[_0xd983('0x16')](_0x3da47a));if(_0x3da47a[_0xd983('0x17')]){if(_0x3da47a[_0xd983('0x17')][_0xd983('0x18')]===0x1f4){logger[_0xd983('0x17')](_0xd983('0x13'),_0x1e8a7a,_0x3da47a[_0xd983('0x17')]['message']);return _0x3226d2(_0x3da47a['error'][_0xd983('0x19')]);}logger['error'](_0xd983('0x13'),_0x1e8a7a,_0x3da47a[_0xd983('0x17')][_0xd983('0x19')]);return _0x3f99dd(_0x3da47a[_0xd983('0x17')][_0xd983('0x19')]);}else{logger[_0xd983('0x12')](_0xd983('0x13'),_0x1e8a7a,_0xd983('0x14'));_0x3f99dd(_0x3da47a['result'][_0xd983('0x19')]);}})[_0xd983('0x1a')](function(_0x139bf8){logger[_0xd983('0x17')](_0xd983('0x13'),_0x1e8a7a,_0x139bf8);_0x3226d2(_0x139bf8);});});}exports[_0xd983('0x1b')]=function(_0xee5616){var _0x4f41ba=this;return new Promise(function(_0x1b3f21,_0x4d9df8){return db['OpenchannelInteraction'][_0xd983('0x1c')](_0xee5616[_0xd983('0x1d')],{'raw':_0xee5616[_0xd983('0x1e')]?_0xee5616[_0xd983('0x1e')][_0xd983('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xee5616[_0xd983('0x1e')]?_0xee5616['options'][_0xd983('0x20')]||null:null,'attributes':_0xee5616[_0xd983('0x1e')]?_0xee5616[_0xd983('0x1e')]['attributes']||null:null,'limit':_0xee5616[_0xd983('0x1e')]?_0xee5616[_0xd983('0x1e')][_0xd983('0x21')]||null:null})[_0xd983('0x22')](function(_0x1d869e){logger[_0xd983('0x12')](_0xd983('0x1b'),_0xee5616);logger[_0xd983('0x23')](_0xd983('0x1b'),_0xee5616,JSON[_0xd983('0x16')](_0x1d869e));_0x1b3f21(_0x1d869e);})[_0xd983('0x1a')](function(_0x4256bd){logger[_0xd983('0x17')](_0xd983('0x1b'),_0x4256bd[_0xd983('0x19')],_0xee5616);_0x4d9df8(_0x4f41ba[_0xd983('0x17')](0x1f4,_0x4256bd[_0xd983('0x19')]));});});};exports[_0xd983('0x24')]=function(_0x4932f1){return new Promise(function(_0x692291,_0x37d72f){return db[_0xd983('0x25')][_0xd983('0x26')]({'where':_0x4932f1[_0xd983('0x1e')]?_0x4932f1['options']['where']||null:null})[_0xd983('0x22')](function(_0x1ef8c7){if(_0x1ef8c7){return _0x1ef8c7[_0xd983('0x27')](_0x4932f1[_0xd983('0x1d')][_0xd983('0x28')],_[_0xd983('0x29')](_0x4932f1[_0xd983('0x1d')],[_0xd983('0x28'),'id'])||{});}})[_0xd983('0x2a')](function(_0x29932f){logger[_0xd983('0x12')](_0xd983('0x2b'),_0x4932f1);logger[_0xd983('0x23')](_0xd983('0x2b'),_0x4932f1,JSON['stringify'](_0x29932f));_0x692291(_0x29932f);})[_0xd983('0x1a')](function(_0x1b8fe8){logger[_0xd983('0x17')](_0xd983('0x2b'),_0x1b8fe8[_0xd983('0x19')],_0x4932f1);_0x37d72f(_this[_0xd983('0x17')](0x1f4,_0x1b8fe8['message']));});});};
\ No newline at end of file
index d5a65e6..d4e36ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90e4=['length','openchannelInteraction:','./openchannelInteraction.events','remove','emit','removeListener','register'];(function(_0x41e44f,_0x277a85){var _0x353324=function(_0x4f5261){while(--_0x4f5261){_0x41e44f['push'](_0x41e44f['shift']());}};_0x353324(++_0x277a85);}(_0x90e4,0x1ad));var _0x490e=function(_0x20c205,_0x39bc5e){_0x20c205=_0x20c205-0x0;var _0x3d6cf2=_0x90e4[_0x20c205];return _0x3d6cf2;};'use strict';var OpenchannelInteractionEvents=require(_0x490e('0x0'));var events=['save',_0x490e('0x1'),'update'];function createListener(_0xa79b65,_0x33b9b1){return function(_0x4620ca){_0x33b9b1[_0x490e('0x2')](_0xa79b65,_0x4620ca);};}function removeListener(_0x518be2,_0x57116e){return function(){OpenchannelInteractionEvents[_0x490e('0x3')](_0x518be2,_0x57116e);};}exports[_0x490e('0x4')]=function(_0x210e1f){for(var _0xbde2a4=0x0,_0x1614da=events[_0x490e('0x5')];_0xbde2a4<_0x1614da;_0xbde2a4++){var _0x1a8b47=events[_0xbde2a4];var _0x346930=createListener(_0x490e('0x6')+_0x1a8b47,_0x210e1f);OpenchannelInteractionEvents['on'](_0x1a8b47,_0x346930);}};
\ No newline at end of file
+var _0x7408=['emit','register','length','openchannelInteraction:','save','remove'];(function(_0x1ef726,_0x16fdea){var _0x4c3c66=function(_0x1bf2de){while(--_0x1bf2de){_0x1ef726['push'](_0x1ef726['shift']());}};_0x4c3c66(++_0x16fdea);}(_0x7408,0x94));var _0x8740=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x7408[_0x342baa];return _0x1208f3;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x8740('0x0'),_0x8740('0x1'),'update'];function createListener(_0x21af91,_0x1e775f){return function(_0x3fbc65){_0x1e775f[_0x8740('0x2')](_0x21af91,_0x3fbc65);};}function removeListener(_0x2dc2b8,_0x4250f1){return function(){OpenchannelInteractionEvents['removeListener'](_0x2dc2b8,_0x4250f1);};}exports[_0x8740('0x3')]=function(_0x283b1b){for(var _0xa84942=0x0,_0x5cd20e=events[_0x8740('0x4')];_0xa84942<_0x5cd20e;_0xa84942++){var _0x511c3a=events[_0xa84942];var _0x588702=createListener(_0x8740('0x5')+_0x511c3a,_0x283b1b);OpenchannelInteractionEvents['on'](_0x511c3a,_0x588702);}};
\ No newline at end of file
index 8020bea..093a1c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x1efa36,_0x444000){var _0x2b05d8=function(_0x2c7db8){while(--_0x2c7db8){_0x1efa36['push'](_0x1efa36['shift']());}};_0x2b05d8(++_0x444000);}(_0xe706,0xa3));var _0x6e70=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0xe706[_0x334651];return _0x29657c;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router;
\ No newline at end of file
+var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x5c0ca4,_0x191abb){var _0x597047=function(_0x3a4dd4){while(--_0x3a4dd4){_0x5c0ca4['push'](_0x5c0ca4['shift']());}};_0x597047(++_0x191abb);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
index c11f209..3a6cde5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d25=['exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4364b6,_0x36c856){var _0x17f417=function(_0x46129c){while(--_0x46129c){_0x4364b6['push'](_0x4364b6['shift']());}};_0x17f417(++_0x36c856);}(_0x7d25,0x8a));var _0x57d2=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x7d25[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'body':{'type':Sequelize[_0x57d2('0x1')](_0x57d2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x57d2('0x4')]('in',_0x57d2('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x09df=['DATE','STRING','sequelize','exports','medium','ENUM'];(function(_0x32e2eb,_0x3347b7){var _0x2418ce=function(_0x13ed52){while(--_0x13ed52){_0x32e2eb['push'](_0x32e2eb['shift']());}};_0x2418ce(++_0x3347b7);}(_0x09df,0x164));var _0xf09d=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x09df[_0x3cc9d9];return _0x1a425d;};'use strict';var Sequelize=require(_0xf09d('0x0'));module[_0xf09d('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf09d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf09d('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xf09d('0x4')]},'providerName':{'type':Sequelize[_0xf09d('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 68dd16a..511530a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e9c=['QueryTypes','SIP/%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','./openchannelMessage.socket','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','limit','count','set','Content-Range','apply','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','OpenchannelMessage','includeAll','include','rows','show','keys','create','body','find','params','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','format','channel','motionChannel','event','EventManager','acceptmessage','reject','RejectMessage','rejectMessage'];(function(_0x1eaa74,_0xcbbafc){var _0x2fd0e0=function(_0x14eafa){while(--_0x14eafa){_0x1eaa74['push'](_0x1eaa74['shift']());}};_0x2fd0e0(++_0xcbbafc);}(_0x5e9c,0x17c));var _0xc5e9=function(_0x496748,_0x168ef6){_0x496748=_0x496748-0x0;var _0x5ab420=_0x5e9c[_0x496748];return _0x5ab420;};'use strict';var emlformat=require(_0xc5e9('0x0'));var rimraf=require(_0xc5e9('0x1'));var zipdir=require(_0xc5e9('0x2'));var jsonpatch=require(_0xc5e9('0x3'));var rp=require('request-promise');var moment=require(_0xc5e9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc5e9('0x5'));var util=require(_0xc5e9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc5e9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5e9('0x8'));var _=require(_0xc5e9('0x9'));var squel=require(_0xc5e9('0xa'));var crypto=require(_0xc5e9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc5e9('0xc'));var toCsv=require(_0xc5e9('0x7'));var querystring=require(_0xc5e9('0xd'));var Papa=require('papaparse');var Redis=require(_0xc5e9('0xe'));var authService=require(_0xc5e9('0xf'));var qs=require(_0xc5e9('0x10'));var as=require(_0xc5e9('0x11'));var hardwareService=require(_0xc5e9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc5e9('0x13'));var config=require(_0xc5e9('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc5e9('0x15')]=_[_0xc5e9('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc5e9('0x17'))['register'](socket);var jayson=require(_0xc5e9('0x18'));var client=jayson[_0xc5e9('0x19')]['http']({'port':0x232c});var client9002=jayson[_0xc5e9('0x19')][_0xc5e9('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x51c3e2,_0x266f0a,_0x4965f6,_0x583548){return new BPromise(function(_0x1b8e40,_0x32010f){var _0x42e431=_0x583548||client;return _0x42e431[_0xc5e9('0x1b')](_0x51c3e2,_0x4965f6)[_0xc5e9('0x1c')](function(_0x29b35e){logger[_0xc5e9('0x1d')](_0xc5e9('0x1e'),_0x266f0a,_0xc5e9('0x1f'));logger[_0xc5e9('0x20')](_0xc5e9('0x21'),_0x266f0a,'request\x20sent',JSON[_0xc5e9('0x22')](_0x29b35e));if(_0x29b35e[_0xc5e9('0x23')]){if(_0x29b35e[_0xc5e9('0x23')][_0xc5e9('0x24')]===0x1f4){logger[_0xc5e9('0x23')](_0xc5e9('0x1e'),_0x266f0a,_0x29b35e[_0xc5e9('0x23')][_0xc5e9('0x25')]);return _0x32010f(_0x29b35e[_0xc5e9('0x23')][_0xc5e9('0x25')]);}logger[_0xc5e9('0x23')](_0xc5e9('0x1e'),_0x266f0a,_0x29b35e['error'][_0xc5e9('0x25')]);return _0x1b8e40(_0x29b35e[_0xc5e9('0x23')][_0xc5e9('0x25')]);}else{logger[_0xc5e9('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x266f0a,_0xc5e9('0x1f'));_0x1b8e40(_0x29b35e['result'][_0xc5e9('0x25')]);}})[_0xc5e9('0x26')](function(_0x365375){logger[_0xc5e9('0x23')](_0xc5e9('0x1e'),_0x266f0a,_0x365375);_0x32010f(_0x365375);});});}function respondWithStatusCode(_0x3f1e5c,_0x5d1a49){_0x5d1a49=_0x5d1a49||0xcc;return function(_0x3981a7){if(_0x3981a7){return _0x3f1e5c['sendStatus'](_0x5d1a49);}return _0x3f1e5c[_0xc5e9('0x27')](_0x5d1a49)['end']();};}function respondWithResult(_0xa01bb8,_0x493f08){_0x493f08=_0x493f08||0xc8;return function(_0x17db45){if(_0x17db45){return _0xa01bb8[_0xc5e9('0x27')](_0x493f08)[_0xc5e9('0x28')](_0x17db45);}};}function respondWithFilteredResult(_0x3c4c3e,_0x3348c3){return function(_0x1aace9){if(_0x1aace9){var _0x12b677=typeof _0x3348c3[_0xc5e9('0x29')]==='undefined'&&typeof _0x3348c3[_0xc5e9('0x2a')]==='undefined';var _0x4b4942=_0x1aace9[_0xc5e9('0x2b')];var _0x740597=_0x12b677?0x0:_0x3348c3['offset'];var _0x57b113=_0x12b677?_0x1aace9['count']:_0x3348c3[_0xc5e9('0x29')]+_0x3348c3['limit'];var _0x4b6369;if(_0x57b113>=_0x4b4942){_0x57b113=_0x4b4942;_0x4b6369=0xc8;}else{_0x4b6369=0xce;}_0x3c4c3e[_0xc5e9('0x27')](_0x4b6369);return _0x3c4c3e[_0xc5e9('0x2c')](_0xc5e9('0x2d'),_0x740597+'-'+_0x57b113+'/'+_0x4b4942)['json'](_0x1aace9);}return null;};}function patchUpdates(_0x2d3f3c){return function(_0x3bda43){try{jsonpatch[_0xc5e9('0x2e')](_0x3bda43,_0x2d3f3c,!![]);}catch(_0x44a374){return BPromise['reject'](_0x44a374);}return _0x3bda43['save']();};}function saveUpdates(_0x6e0a78,_0x2b847c){return function(_0x2d5fd5){if(_0x2d5fd5){return _0x2d5fd5[_0xc5e9('0x2f')](_0x6e0a78)[_0xc5e9('0x1c')](function(_0x454844){return _0x454844;});}return null;};}function removeEntity(_0x25c9b7,_0x4fc61a){return function(_0x2dc347){if(_0x2dc347){return _0x2dc347[_0xc5e9('0x30')]()[_0xc5e9('0x1c')](function(){_0x25c9b7['status'](0xcc)[_0xc5e9('0x31')]();});}};}function handleEntityNotFound(_0xd509f4,_0x3275be){return function(_0x2733b1){if(!_0x2733b1){_0xd509f4[_0xc5e9('0x32')](0x194);}return _0x2733b1;};}function handleError(_0x12cd90,_0x40a949){_0x40a949=_0x40a949||0x1f4;return function(_0x35f86d){logger['error'](_0x35f86d[_0xc5e9('0x33')]);if(_0x35f86d[_0xc5e9('0x34')]){delete _0x35f86d[_0xc5e9('0x34')];}_0x12cd90[_0xc5e9('0x27')](_0x40a949)[_0xc5e9('0x35')](_0x35f86d);};}exports[_0xc5e9('0x36')]=function(_0xa868eb,_0x3af8d0){var _0x5826e8={},_0x282ba8={},_0x1d501d={'count':0x0,'rows':[]};var _0x24faf7=_[_0xc5e9('0x37')](db['OpenchannelMessage'][_0xc5e9('0x38')],function(_0x5a2544){return{'name':_0x5a2544['fieldName'],'type':_0x5a2544['type']['key']};});_0x282ba8['model']=_[_0xc5e9('0x37')](_0x24faf7,_0xc5e9('0x34'));_0x282ba8[_0xc5e9('0x39')]=_['keys'](_0xa868eb[_0xc5e9('0x39')]);_0x282ba8[_0xc5e9('0x3a')]=_[_0xc5e9('0x3b')](_0x282ba8['model'],_0x282ba8[_0xc5e9('0x39')]);_0x5826e8['attributes']=_[_0xc5e9('0x3b')](_0x282ba8[_0xc5e9('0x3c')],qs[_0xc5e9('0x3d')](_0xa868eb[_0xc5e9('0x39')][_0xc5e9('0x3d')]));_0x5826e8[_0xc5e9('0x3e')]=_0x5826e8[_0xc5e9('0x3e')][_0xc5e9('0x3f')]?_0x5826e8[_0xc5e9('0x3e')]:_0x282ba8['model'];if(!_0xa868eb[_0xc5e9('0x39')][_0xc5e9('0x40')](_0xc5e9('0x41'))){_0x5826e8['limit']=qs['limit'](_0xa868eb[_0xc5e9('0x39')][_0xc5e9('0x2a')]);_0x5826e8[_0xc5e9('0x29')]=qs[_0xc5e9('0x29')](_0xa868eb[_0xc5e9('0x39')][_0xc5e9('0x29')]);}_0x5826e8['order']=qs[_0xc5e9('0x42')](_0xa868eb[_0xc5e9('0x39')][_0xc5e9('0x42')]);_0x5826e8['where']=qs[_0xc5e9('0x3a')](_[_0xc5e9('0x43')](_0xa868eb['query'],_0x282ba8[_0xc5e9('0x3a')]),_0x24faf7);if(_0xa868eb[_0xc5e9('0x39')][_0xc5e9('0x44')]){_0x5826e8[_0xc5e9('0x45')]=_[_0xc5e9('0x46')](_0x5826e8[_0xc5e9('0x45')],{'$or':_[_0xc5e9('0x37')](_0x24faf7,function(_0x4b1fa3){if(_0x4b1fa3[_0xc5e9('0x47')]!=='VIRTUAL'){var _0x4fd683={};_0x4fd683[_0x4b1fa3[_0xc5e9('0x34')]]={'$like':'%'+_0xa868eb[_0xc5e9('0x39')][_0xc5e9('0x44')]+'%'};return _0x4fd683;}})});}_0x5826e8=_['merge']({},_0x5826e8,_0xa868eb[_0xc5e9('0x48')]);var _0x29e224={'where':_0x5826e8[_0xc5e9('0x45')]};return db[_0xc5e9('0x49')]['count'](_0x29e224)[_0xc5e9('0x1c')](function(_0x5c280c){_0x1d501d[_0xc5e9('0x2b')]=_0x5c280c;if(_0xa868eb[_0xc5e9('0x39')][_0xc5e9('0x4a')]){_0x5826e8[_0xc5e9('0x4b')]=[{'all':!![]}];}return db[_0xc5e9('0x49')]['findAll'](_0x5826e8);})[_0xc5e9('0x1c')](function(_0x238482){_0x1d501d[_0xc5e9('0x4c')]=_0x238482;return _0x1d501d;})['then'](respondWithFilteredResult(_0x3af8d0,_0x5826e8))[_0xc5e9('0x26')](handleError(_0x3af8d0,null));};exports[_0xc5e9('0x4d')]=function(_0xb2ddb7,_0x5032ff){var _0x32c3eb={'raw':!![],'where':{'id':_0xb2ddb7['params']['id']}},_0x2ff032={};_0x2ff032['model']=_[_0xc5e9('0x4e')](db[_0xc5e9('0x49')]['rawAttributes']);_0x2ff032[_0xc5e9('0x39')]=_[_0xc5e9('0x4e')](_0xb2ddb7[_0xc5e9('0x39')]);_0x2ff032['filters']=_[_0xc5e9('0x3b')](_0x2ff032[_0xc5e9('0x3c')],_0x2ff032[_0xc5e9('0x39')]);_0x32c3eb['attributes']=_[_0xc5e9('0x3b')](_0x2ff032['model'],qs[_0xc5e9('0x3d')](_0xb2ddb7[_0xc5e9('0x39')][_0xc5e9('0x3d')]));_0x32c3eb['attributes']=_0x32c3eb['attributes'][_0xc5e9('0x3f')]?_0x32c3eb[_0xc5e9('0x3e')]:_0x2ff032['model'];if(_0xb2ddb7[_0xc5e9('0x39')][_0xc5e9('0x4a')]){_0x32c3eb[_0xc5e9('0x4b')]=[{'all':!![]}];}_0x32c3eb=_[_0xc5e9('0x46')]({},_0x32c3eb,_0xb2ddb7['options']);return db[_0xc5e9('0x49')]['find'](_0x32c3eb)[_0xc5e9('0x1c')](handleEntityNotFound(_0x5032ff,null))['then'](respondWithResult(_0x5032ff,null))['catch'](handleError(_0x5032ff,null));};exports[_0xc5e9('0x4f')]=function(_0x3100f1,_0x2acc79){return db[_0xc5e9('0x49')][_0xc5e9('0x4f')](_0x3100f1[_0xc5e9('0x50')],{})[_0xc5e9('0x1c')](respondWithResult(_0x2acc79,0xc9))[_0xc5e9('0x26')](handleError(_0x2acc79,null));};exports['update']=function(_0x384cb4,_0x57dd4c){if(_0x384cb4[_0xc5e9('0x50')]['id']){delete _0x384cb4[_0xc5e9('0x50')]['id'];}return db['OpenchannelMessage'][_0xc5e9('0x51')]({'where':{'id':_0x384cb4[_0xc5e9('0x52')]['id']}})[_0xc5e9('0x1c')](handleEntityNotFound(_0x57dd4c,null))[_0xc5e9('0x1c')](saveUpdates(_0x384cb4[_0xc5e9('0x50')],null))[_0xc5e9('0x1c')](respondWithResult(_0x57dd4c,null))[_0xc5e9('0x26')](handleError(_0x57dd4c,null));};exports['destroy']=function(_0xcace18,_0x1bde93){return db[_0xc5e9('0x49')][_0xc5e9('0x51')]({'where':{'id':_0xcace18[_0xc5e9('0x52')]['id']}})[_0xc5e9('0x1c')](handleEntityNotFound(_0x1bde93,null))['then'](removeEntity(_0x1bde93,null))[_0xc5e9('0x26')](handleError(_0x1bde93,null));};exports[_0xc5e9('0x53')]=function(_0x1635f4,_0x31041d){return db[_0xc5e9('0x49')]['describe']()['then'](respondWithResult(_0x31041d,null))[_0xc5e9('0x26')](handleError(_0x31041d,null));};var interaction_log=require(_0xc5e9('0x54'))(_0xc5e9('0x55'));exports[_0xc5e9('0x56')]=function(_0x28ea7c,_0x6ddeee,_0x20144b){var _0x373722={'agent':{},'channel':_0xc5e9('0x57')};if(_0x28ea7c[_0xc5e9('0x50')]['id']){delete _0x28ea7c[_0xc5e9('0x50')]['id'];}_0x28ea7c[_0xc5e9('0x50')][_0xc5e9('0x58')]=!![];_0x28ea7c['body']['readAt']=moment()['format'](_0xc5e9('0x59'));_0x28ea7c[_0xc5e9('0x50')][_0xc5e9('0x5a')]=_0x28ea7c[_0xc5e9('0x50')]['UserId']||_0x28ea7c[_0xc5e9('0x5b')]['id'];_0x373722['agent']['id']=_0x28ea7c[_0xc5e9('0x50')]['UserId'];return db[_0xc5e9('0x49')][_0xc5e9('0x51')]({'where':{'id':_0x28ea7c[_0xc5e9('0x52')]['id'],'UserId':null}})[_0xc5e9('0x1c')](handleEntityNotFound(_0x6ddeee,null))[_0xc5e9('0x1c')](saveUpdates(_0x28ea7c[_0xc5e9('0x50')],null))['then'](function(_0x3443c6){if(_0x3443c6){_0x373722[_0xc5e9('0x25')]=_0x3443c6[_0xc5e9('0x5c')]({'plain':!![]});return db[_0xc5e9('0x5d')]['find']({'where':{'id':_0x3443c6[_0xc5e9('0x5e')]}});}return null;})[_0xc5e9('0x1c')](handleEntityNotFound(_0x6ddeee,null))[_0xc5e9('0x1c')](function(_0x17e632){if(_0x17e632){return _0x17e632['update']({'UserId':_0x28ea7c['body'][_0xc5e9('0x5a')],'read1stAt':_[_0xc5e9('0x5f')](_0x17e632[_0xc5e9('0x60')])?moment()['format'](_0xc5e9('0x59')):undefined});}return null;})[_0xc5e9('0x1c')](function(_0x1f2b4c){if(_0x1f2b4c){_0x373722[_0xc5e9('0x61')]=_0x1f2b4c[_0xc5e9('0x5c')]({'plain':!![]});interaction_log[_0xc5e9('0x1d')](_0xc5e9('0x62'),_0x28ea7c[_0xc5e9('0x5b')]['id'],_0x28ea7c[_0xc5e9('0x5b')][_0xc5e9('0x34')],_0x28ea7c['user'][_0xc5e9('0x63')],_0x373722[_0xc5e9('0x61')]['id'],_0x28ea7c[_0xc5e9('0x50')]?JSON[_0xc5e9('0x22')](_0x28ea7c[_0xc5e9('0x50')]):_0xc5e9('0x64'));return respondWithRpcPromise(_0xc5e9('0x65'),'acceptMessage',_0x373722);}return null;})[_0xc5e9('0x1c')](function(_0xac4651){var _0x213224=_0xc5e9('0x66')+_0xac4651['message'][_0xc5e9('0x67')];return db[_0xc5e9('0x68')][_0xc5e9('0x39')](_0x213224,{'type':db[_0xc5e9('0x69')]['QueryTypes'][_0xc5e9('0x6a')],'raw':!![]})[_0xc5e9('0x1c')](function(_0x1af3fd){return _0x1af3fd;});})[_0xc5e9('0x1c')](function(_0x3c9fa7){if(_0x3c9fa7){_0x373722[_0xc5e9('0x25')][_0xc5e9('0x6b')]=_0x3c9fa7[0x0];if(!_0x28ea7c[_0xc5e9('0x50')][_0xc5e9('0x5a')])return;return db[_0xc5e9('0x6c')][_0xc5e9('0x51')]({'where':{'id':_0x28ea7c[_0xc5e9('0x50')][_0xc5e9('0x5a')],'role':_0xc5e9('0x6d')},'attributes':['id',_0xc5e9('0x34'),_0xc5e9('0x6e'),_0xc5e9('0x6f'),_0xc5e9('0x70')],'raw':!![]});}return null;})[_0xc5e9('0x1c')](function(_0x671cc){if(!_0x671cc)return null;_0x373722[_0xc5e9('0x25')]['agent']=_0x671cc;return _0x373722;})['then'](function(_0xf01a59){if(_0xf01a59){if(_0x28ea7c[_0xc5e9('0x50')][_0xc5e9('0x71')]){_0x373722[_0xc5e9('0x25')][_0xc5e9('0x72')]=util[_0xc5e9('0x73')]('SIP/%s',_0x28ea7c[_0xc5e9('0x5b')]['name']);_0x373722[_0xc5e9('0x25')][_0xc5e9('0x74')]=_0x373722['channel'];_0x373722[_0xc5e9('0x25')][_0xc5e9('0x75')]=_0x373722[_0xc5e9('0x74')];_0x373722[_0xc5e9('0x25')][_0xc5e9('0x76')]='accept';return respondWithRpcPromise('EventManager',_0xc5e9('0x77'),{'event':_0xc5e9('0x78'),'message':_0x373722[_0xc5e9('0x25')]},client9002)[_0xc5e9('0x1c')](function(){return _0x373722;});}return _0x373722;}return null;})[_0xc5e9('0x1c')](respondWithResult(_0x6ddeee,null))[_0xc5e9('0x26')](handleError(_0x6ddeee,null));};var interaction_log=require(_0xc5e9('0x54'))('openchannel-interactions');exports[_0xc5e9('0x79')]=function(_0xcb9db,_0x1f08b8,_0x40bf89){var _0x400abe={'agent':{},'channel':_0xc5e9('0x57')};if(_0xcb9db['body']['id']){delete _0xcb9db[_0xc5e9('0x50')]['id'];}_0xcb9db[_0xc5e9('0x50')][_0xc5e9('0x5a')]=_0xcb9db[_0xc5e9('0x50')][_0xc5e9('0x5a')]||_0xcb9db[_0xc5e9('0x5b')]['id'];_0x400abe[_0xc5e9('0x6d')]['id']=_0xcb9db[_0xc5e9('0x50')][_0xc5e9('0x5a')];return db[_0xc5e9('0x49')][_0xc5e9('0x51')]({'where':{'id':_0xcb9db['params']['id'],'UserId':null}})[_0xc5e9('0x1c')](handleEntityNotFound(_0x1f08b8,null))[_0xc5e9('0x1c')](function(_0x334292){if(_0x334292){_0x400abe[_0xc5e9('0x25')]=_0x334292[_0xc5e9('0x5c')]({'plain':!![]});return db[_0xc5e9('0x5d')][_0xc5e9('0x51')]({'where':{'id':_0x334292[_0xc5e9('0x5e')]}});}return null;})[_0xc5e9('0x1c')](handleEntityNotFound(_0x1f08b8,null))[_0xc5e9('0x1c')](function(_0x2ffbbe){if(_0x2ffbbe){_0x400abe['interaction']=_0x2ffbbe['get']({'plain':!![]});interaction_log[_0xc5e9('0x1d')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xcb9db[_0xc5e9('0x5b')]['id'],_0xcb9db[_0xc5e9('0x5b')]['name'],_0xcb9db[_0xc5e9('0x5b')][_0xc5e9('0x63')],_0x400abe[_0xc5e9('0x61')]['id'],_0xcb9db[_0xc5e9('0x50')]?JSON['stringify'](_0xcb9db['body']):_0xc5e9('0x64'));return respondWithRpcPromise(_0xc5e9('0x7a'),_0xc5e9('0x7b'),_0x400abe);}return null;})[_0xc5e9('0x1c')](function(_0x5ced24){var _0x3177e6=_0xc5e9('0x66')+_0x5ced24[_0xc5e9('0x25')][_0xc5e9('0x67')];return db[_0xc5e9('0x68')]['query'](_0x3177e6,{'type':db['Sequelize'][_0xc5e9('0x7c')][_0xc5e9('0x6a')],'raw':!![]})[_0xc5e9('0x1c')](function(_0x375f46){return _0x375f46;});})[_0xc5e9('0x1c')](function(_0x2d7567){if(_0x2d7567){_0x400abe[_0xc5e9('0x25')][_0xc5e9('0x6b')]=_0x2d7567[0x0];if(!_0xcb9db[_0xc5e9('0x50')][_0xc5e9('0x5a')])return;return db[_0xc5e9('0x6c')][_0xc5e9('0x51')]({'where':{'id':_0xcb9db['body'][_0xc5e9('0x5a')],'role':_0xc5e9('0x6d')},'attributes':['id',_0xc5e9('0x34'),_0xc5e9('0x6e'),_0xc5e9('0x6f'),_0xc5e9('0x70')],'raw':!![]});}return null;})[_0xc5e9('0x1c')](function(_0x2981d9){if(!_0x2981d9)return null;_0x400abe[_0xc5e9('0x25')][_0xc5e9('0x6d')]=_0x2981d9;return _0x400abe;})[_0xc5e9('0x1c')](function(_0x5d9d7a){if(_0x5d9d7a){_0x5d9d7a[_0xc5e9('0x25')][_0xc5e9('0x72')]=util[_0xc5e9('0x73')](_0xc5e9('0x7d'),_0xcb9db['user'][_0xc5e9('0x34')]);_0x5d9d7a[_0xc5e9('0x25')][_0xc5e9('0x74')]=_0x400abe[_0xc5e9('0x74')];_0x5d9d7a[_0xc5e9('0x25')][_0xc5e9('0x75')]=_0x400abe[_0xc5e9('0x74')];_0x5d9d7a['message']['event']=_0xc5e9('0x79');respondWithRpcPromise(_0xc5e9('0x77'),_0xc5e9('0x77'),{'event':'rejectmessage','message':_0x5d9d7a[_0xc5e9('0x25')]},client9002);return _0x400abe;}return null;})[_0xc5e9('0x1c')](respondWithResult(_0x1f08b8,null))[_0xc5e9('0x26')](handleError(_0x1f08b8,null));};
\ No newline at end of file
+var _0xef3c=['AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','SELECT','email','internal','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','./openchannelMessage.socket','register','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','code','error','message','info','request\x20sent','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','show','params','fields','find','create','body','update','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null'];(function(_0x2e5959,_0x142c30){var _0x2ac042=function(_0x5a4bd4){while(--_0x5a4bd4){_0x2e5959['push'](_0x2e5959['shift']());}};_0x2ac042(++_0x142c30);}(_0xef3c,0x1b1));var _0xcef3=function(_0x2dd59a,_0x21c899){_0x2dd59a=_0x2dd59a-0x0;var _0x53f9b3=_0xef3c[_0x2dd59a];return _0x53f9b3;};'use strict';var emlformat=require(_0xcef3('0x0'));var rimraf=require(_0xcef3('0x1'));var zipdir=require(_0xcef3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcef3('0x3'));var moment=require(_0xcef3('0x4'));var BPromise=require(_0xcef3('0x5'));var Mustache=require(_0xcef3('0x6'));var util=require(_0xcef3('0x7'));var path=require(_0xcef3('0x8'));var sox=require(_0xcef3('0x9'));var csv=require('to-csv');var ejs=require(_0xcef3('0xa'));var fs=require('fs');var fs_extra=require(_0xcef3('0xb'));var _=require(_0xcef3('0xc'));var squel=require('squel');var crypto=require(_0xcef3('0xd'));var jsforce=require(_0xcef3('0xe'));var deskjs=require(_0xcef3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcef3('0x10'));var Redis=require(_0xcef3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcef3('0x12'));var as=require(_0xcef3('0x13'));var hardwareService=require(_0xcef3('0x14'));var logger=require(_0xcef3('0x15'))(_0xcef3('0x16'));var utils=require(_0xcef3('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcef3('0x18'))['db'];config[_0xcef3('0x19')]=_[_0xcef3('0x1a')](config[_0xcef3('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcef3('0x1b'))[_0xcef3('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcef3('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xcef3('0x1d')][_0xcef3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x13212d,_0x43f78d,_0x58e649,_0x93f682){return new BPromise(function(_0x4dc0cb,_0x1c8683){var _0x58502f=_0x93f682||client;return _0x58502f[_0xcef3('0x1f')](_0x13212d,_0x58e649)[_0xcef3('0x20')](function(_0x88b714){logger['info'](_0xcef3('0x21'),_0x43f78d,'request\x20sent');logger['debug'](_0xcef3('0x22'),_0x43f78d,'request\x20sent',JSON['stringify'](_0x88b714));if(_0x88b714['error']){if(_0x88b714['error'][_0xcef3('0x23')]===0x1f4){logger[_0xcef3('0x24')](_0xcef3('0x21'),_0x43f78d,_0x88b714['error'][_0xcef3('0x25')]);return _0x1c8683(_0x88b714[_0xcef3('0x24')][_0xcef3('0x25')]);}logger[_0xcef3('0x24')](_0xcef3('0x21'),_0x43f78d,_0x88b714[_0xcef3('0x24')]['message']);return _0x4dc0cb(_0x88b714[_0xcef3('0x24')][_0xcef3('0x25')]);}else{logger[_0xcef3('0x26')](_0xcef3('0x21'),_0x43f78d,_0xcef3('0x27'));_0x4dc0cb(_0x88b714[_0xcef3('0x28')][_0xcef3('0x25')]);}})[_0xcef3('0x29')](function(_0x316cb0){logger[_0xcef3('0x24')](_0xcef3('0x21'),_0x43f78d,_0x316cb0);_0x1c8683(_0x316cb0);});});}function respondWithStatusCode(_0x5a2400,_0x373838){_0x373838=_0x373838||0xcc;return function(_0x44ecd5){if(_0x44ecd5){return _0x5a2400[_0xcef3('0x2a')](_0x373838);}return _0x5a2400[_0xcef3('0x2b')](_0x373838)[_0xcef3('0x2c')]();};}function respondWithResult(_0x237c6b,_0x4d46d0){_0x4d46d0=_0x4d46d0||0xc8;return function(_0x38d60a){if(_0x38d60a){return _0x237c6b[_0xcef3('0x2b')](_0x4d46d0)[_0xcef3('0x2d')](_0x38d60a);}};}function respondWithFilteredResult(_0x17c07b,_0x6dbdf3){return function(_0x2ca83c){if(_0x2ca83c){var _0x25063e=typeof _0x6dbdf3['offset']===_0xcef3('0x2e')&&typeof _0x6dbdf3[_0xcef3('0x2f')]===_0xcef3('0x2e');var _0x1b30b1=_0x2ca83c[_0xcef3('0x30')];var _0xb00b7=_0x25063e?0x0:_0x6dbdf3[_0xcef3('0x31')];var _0x43dfd0=_0x25063e?_0x2ca83c[_0xcef3('0x30')]:_0x6dbdf3[_0xcef3('0x31')]+_0x6dbdf3[_0xcef3('0x2f')];var _0x4938fd;if(_0x43dfd0>=_0x1b30b1){_0x43dfd0=_0x1b30b1;_0x4938fd=0xc8;}else{_0x4938fd=0xce;}_0x17c07b[_0xcef3('0x2b')](_0x4938fd);return _0x17c07b['set'](_0xcef3('0x32'),_0xb00b7+'-'+_0x43dfd0+'/'+_0x1b30b1)[_0xcef3('0x2d')](_0x2ca83c);}return null;};}function patchUpdates(_0xd95f88){return function(_0x67b07d){try{jsonpatch[_0xcef3('0x33')](_0x67b07d,_0xd95f88,!![]);}catch(_0x3adfbd){return BPromise[_0xcef3('0x34')](_0x3adfbd);}return _0x67b07d[_0xcef3('0x35')]();};}function saveUpdates(_0x3010f9,_0x205a68){return function(_0x1ce583){if(_0x1ce583){return _0x1ce583['update'](_0x3010f9)['then'](function(_0x458189){return _0x458189;});}return null;};}function removeEntity(_0x3f620a,_0x1cf287){return function(_0x1bcb45){if(_0x1bcb45){return _0x1bcb45[_0xcef3('0x36')]()[_0xcef3('0x20')](function(){_0x3f620a[_0xcef3('0x2b')](0xcc)[_0xcef3('0x2c')]();});}};}function handleEntityNotFound(_0x364386,_0x4291db){return function(_0xd3962){if(!_0xd3962){_0x364386[_0xcef3('0x2a')](0x194);}return _0xd3962;};}function handleError(_0x582de3,_0x111102){_0x111102=_0x111102||0x1f4;return function(_0x2de75b){logger[_0xcef3('0x24')](_0x2de75b['stack']);if(_0x2de75b['name']){delete _0x2de75b[_0xcef3('0x37')];}_0x582de3[_0xcef3('0x2b')](_0x111102)[_0xcef3('0x38')](_0x2de75b);};}exports[_0xcef3('0x39')]=function(_0x5dfe99,_0x5407dc){var _0x2bf157={},_0x1007e4={},_0x55edb6={'count':0x0,'rows':[]};var _0x4251dd=_['map'](db[_0xcef3('0x3a')][_0xcef3('0x3b')],function(_0x2b3d95){return{'name':_0x2b3d95[_0xcef3('0x3c')],'type':_0x2b3d95[_0xcef3('0x3d')][_0xcef3('0x3e')]};});_0x1007e4[_0xcef3('0x3f')]=_['map'](_0x4251dd,'name');_0x1007e4[_0xcef3('0x40')]=_[_0xcef3('0x41')](_0x5dfe99['query']);_0x1007e4[_0xcef3('0x42')]=_[_0xcef3('0x43')](_0x1007e4[_0xcef3('0x3f')],_0x1007e4[_0xcef3('0x40')]);_0x2bf157[_0xcef3('0x44')]=_[_0xcef3('0x43')](_0x1007e4[_0xcef3('0x3f')],qs['fields'](_0x5dfe99[_0xcef3('0x40')]['fields']));_0x2bf157['attributes']=_0x2bf157[_0xcef3('0x44')][_0xcef3('0x45')]?_0x2bf157[_0xcef3('0x44')]:_0x1007e4[_0xcef3('0x3f')];if(!_0x5dfe99[_0xcef3('0x40')][_0xcef3('0x46')](_0xcef3('0x47'))){_0x2bf157['limit']=qs[_0xcef3('0x2f')](_0x5dfe99['query'][_0xcef3('0x2f')]);_0x2bf157[_0xcef3('0x31')]=qs[_0xcef3('0x31')](_0x5dfe99['query'][_0xcef3('0x31')]);}_0x2bf157[_0xcef3('0x48')]=qs[_0xcef3('0x49')](_0x5dfe99[_0xcef3('0x40')][_0xcef3('0x49')]);_0x2bf157['where']=qs[_0xcef3('0x42')](_['pick'](_0x5dfe99[_0xcef3('0x40')],_0x1007e4[_0xcef3('0x42')]),_0x4251dd);if(_0x5dfe99['query'][_0xcef3('0x4a')]){_0x2bf157[_0xcef3('0x4b')]=_[_0xcef3('0x4c')](_0x2bf157[_0xcef3('0x4b')],{'$or':_[_0xcef3('0x4d')](_0x4251dd,function(_0x3dc03){if(_0x3dc03['type']!==_0xcef3('0x4e')){var _0x2fed68={};_0x2fed68[_0x3dc03[_0xcef3('0x37')]]={'$like':'%'+_0x5dfe99['query'][_0xcef3('0x4a')]+'%'};return _0x2fed68;}})});}_0x2bf157=_[_0xcef3('0x4c')]({},_0x2bf157,_0x5dfe99[_0xcef3('0x4f')]);var _0x1195be={'where':_0x2bf157[_0xcef3('0x4b')]};return db[_0xcef3('0x3a')]['count'](_0x1195be)[_0xcef3('0x20')](function(_0x66617e){_0x55edb6['count']=_0x66617e;if(_0x5dfe99['query'][_0xcef3('0x50')]){_0x2bf157[_0xcef3('0x51')]=[{'all':!![]}];}return db[_0xcef3('0x3a')][_0xcef3('0x52')](_0x2bf157);})['then'](function(_0x105684){_0x55edb6['rows']=_0x105684;return _0x55edb6;})[_0xcef3('0x20')](respondWithFilteredResult(_0x5407dc,_0x2bf157))[_0xcef3('0x29')](handleError(_0x5407dc,null));};exports[_0xcef3('0x53')]=function(_0x35eb8c,_0x3c054f){var _0x5df608={'raw':!![],'where':{'id':_0x35eb8c[_0xcef3('0x54')]['id']}},_0x3b03c4={};_0x3b03c4[_0xcef3('0x3f')]=_['keys'](db[_0xcef3('0x3a')][_0xcef3('0x3b')]);_0x3b03c4[_0xcef3('0x40')]=_[_0xcef3('0x41')](_0x35eb8c[_0xcef3('0x40')]);_0x3b03c4['filters']=_['intersection'](_0x3b03c4[_0xcef3('0x3f')],_0x3b03c4[_0xcef3('0x40')]);_0x5df608[_0xcef3('0x44')]=_[_0xcef3('0x43')](_0x3b03c4[_0xcef3('0x3f')],qs[_0xcef3('0x55')](_0x35eb8c[_0xcef3('0x40')]['fields']));_0x5df608[_0xcef3('0x44')]=_0x5df608['attributes'][_0xcef3('0x45')]?_0x5df608[_0xcef3('0x44')]:_0x3b03c4[_0xcef3('0x3f')];if(_0x35eb8c['query']['includeAll']){_0x5df608[_0xcef3('0x51')]=[{'all':!![]}];}_0x5df608=_['merge']({},_0x5df608,_0x35eb8c[_0xcef3('0x4f')]);return db[_0xcef3('0x3a')][_0xcef3('0x56')](_0x5df608)[_0xcef3('0x20')](handleEntityNotFound(_0x3c054f,null))[_0xcef3('0x20')](respondWithResult(_0x3c054f,null))['catch'](handleError(_0x3c054f,null));};exports[_0xcef3('0x57')]=function(_0x4ab293,_0x570206){return db[_0xcef3('0x3a')][_0xcef3('0x57')](_0x4ab293[_0xcef3('0x58')],{})[_0xcef3('0x20')](respondWithResult(_0x570206,0xc9))[_0xcef3('0x29')](handleError(_0x570206,null));};exports[_0xcef3('0x59')]=function(_0x49936b,_0x39596b){if(_0x49936b[_0xcef3('0x58')]['id']){delete _0x49936b[_0xcef3('0x58')]['id'];}return db[_0xcef3('0x3a')][_0xcef3('0x56')]({'where':{'id':_0x49936b['params']['id']}})[_0xcef3('0x20')](handleEntityNotFound(_0x39596b,null))[_0xcef3('0x20')](saveUpdates(_0x49936b[_0xcef3('0x58')],null))[_0xcef3('0x20')](respondWithResult(_0x39596b,null))[_0xcef3('0x29')](handleError(_0x39596b,null));};exports[_0xcef3('0x36')]=function(_0x4fa9cd,_0x5d93ae){return db['OpenchannelMessage'][_0xcef3('0x56')]({'where':{'id':_0x4fa9cd[_0xcef3('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d93ae,null))['then'](removeEntity(_0x5d93ae,null))[_0xcef3('0x29')](handleError(_0x5d93ae,null));};exports[_0xcef3('0x5a')]=function(_0x1d42b1,_0x1849c7){return db[_0xcef3('0x3a')][_0xcef3('0x5a')]()[_0xcef3('0x20')](respondWithResult(_0x1849c7,null))['catch'](handleError(_0x1849c7,null));};var interaction_log=require(_0xcef3('0x15'))(_0xcef3('0x5b'));exports['accept']=function(_0x4fff19,_0x22c8d6,_0x8b948d){var _0x2c16cc={'agent':{},'channel':_0xcef3('0x5c')};if(_0x4fff19['body']['id']){delete _0x4fff19[_0xcef3('0x58')]['id'];}_0x4fff19[_0xcef3('0x58')][_0xcef3('0x5d')]=!![];_0x4fff19[_0xcef3('0x58')][_0xcef3('0x5e')]=moment()[_0xcef3('0x5f')](_0xcef3('0x60'));_0x4fff19[_0xcef3('0x58')][_0xcef3('0x61')]=_0x4fff19[_0xcef3('0x58')]['UserId']||_0x4fff19[_0xcef3('0x62')]['id'];_0x2c16cc[_0xcef3('0x63')]['id']=_0x4fff19['body'][_0xcef3('0x61')];return db['OpenchannelMessage'][_0xcef3('0x56')]({'where':{'id':_0x4fff19[_0xcef3('0x54')]['id'],'UserId':null}})[_0xcef3('0x20')](handleEntityNotFound(_0x22c8d6,null))[_0xcef3('0x20')](saveUpdates(_0x4fff19[_0xcef3('0x58')],null))[_0xcef3('0x20')](function(_0x5a3b1c){if(_0x5a3b1c){_0x2c16cc['message']=_0x5a3b1c['get']({'plain':!![]});return db[_0xcef3('0x64')][_0xcef3('0x56')]({'where':{'id':_0x5a3b1c[_0xcef3('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x22c8d6,null))[_0xcef3('0x20')](function(_0x167417){if(_0x167417){return _0x167417[_0xcef3('0x59')]({'UserId':_0x4fff19[_0xcef3('0x58')][_0xcef3('0x61')],'read1stAt':_[_0xcef3('0x66')](_0x167417['read1stAt'])?moment()[_0xcef3('0x5f')](_0xcef3('0x60')):undefined});}return null;})[_0xcef3('0x20')](function(_0x555cea){if(_0x555cea){_0x2c16cc[_0xcef3('0x67')]=_0x555cea[_0xcef3('0x68')]({'plain':!![]});interaction_log[_0xcef3('0x26')](_0xcef3('0x69'),_0x4fff19[_0xcef3('0x62')]['id'],_0x4fff19[_0xcef3('0x62')][_0xcef3('0x37')],_0x4fff19[_0xcef3('0x62')]['role'],_0x2c16cc[_0xcef3('0x67')]['id'],_0x4fff19[_0xcef3('0x58')]?JSON['stringify'](_0x4fff19[_0xcef3('0x58')]):_0xcef3('0x6a'));return respondWithRpcPromise(_0xcef3('0x6b'),_0xcef3('0x6c'),_0x2c16cc);}return null;})[_0xcef3('0x20')](function(_0x5d6051){var _0x297aaa=_0xcef3('0x6d')+_0x5d6051['message'][_0xcef3('0x6e')];return db[_0xcef3('0x6f')][_0xcef3('0x40')](_0x297aaa,{'type':db[_0xcef3('0x70')][_0xcef3('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x4e5c6f){return _0x4e5c6f;});})[_0xcef3('0x20')](function(_0x400a1c){if(_0x400a1c){_0x2c16cc[_0xcef3('0x25')][_0xcef3('0x72')]=_0x400a1c[0x0];if(!_0x4fff19[_0xcef3('0x58')][_0xcef3('0x61')])return;return db[_0xcef3('0x73')][_0xcef3('0x56')]({'where':{'id':_0x4fff19[_0xcef3('0x58')][_0xcef3('0x61')],'role':'agent'},'attributes':['id',_0xcef3('0x37'),_0xcef3('0x74'),'email','internal'],'raw':!![]});}return null;})[_0xcef3('0x20')](function(_0x14c000){if(!_0x14c000)return null;_0x2c16cc[_0xcef3('0x25')][_0xcef3('0x63')]=_0x14c000;return _0x2c16cc;})[_0xcef3('0x20')](function(_0x2fa78d){if(_0x2fa78d){if(_0x4fff19[_0xcef3('0x58')][_0xcef3('0x75')]){_0x2c16cc['message'][_0xcef3('0x76')]=util['format']('SIP/%s',_0x4fff19['user'][_0xcef3('0x37')]);_0x2c16cc[_0xcef3('0x25')][_0xcef3('0x77')]=_0x2c16cc[_0xcef3('0x77')];_0x2c16cc[_0xcef3('0x25')][_0xcef3('0x78')]=_0x2c16cc[_0xcef3('0x77')];_0x2c16cc[_0xcef3('0x25')][_0xcef3('0x79')]=_0xcef3('0x7a');return respondWithRpcPromise(_0xcef3('0x7b'),_0xcef3('0x7b'),{'event':_0xcef3('0x7c'),'message':_0x2c16cc[_0xcef3('0x25')]},client9002)[_0xcef3('0x20')](function(){return _0x2c16cc;});}return _0x2c16cc;}return null;})['then'](respondWithResult(_0x22c8d6,null))['catch'](handleError(_0x22c8d6,null));};var interaction_log=require(_0xcef3('0x15'))(_0xcef3('0x5b'));exports[_0xcef3('0x34')]=function(_0x222ae9,_0x352044,_0x41452e){var _0x2e7087={'agent':{},'channel':_0xcef3('0x5c')};if(_0x222ae9[_0xcef3('0x58')]['id']){delete _0x222ae9[_0xcef3('0x58')]['id'];}_0x222ae9[_0xcef3('0x58')][_0xcef3('0x61')]=_0x222ae9['body'][_0xcef3('0x61')]||_0x222ae9[_0xcef3('0x62')]['id'];_0x2e7087[_0xcef3('0x63')]['id']=_0x222ae9['body'][_0xcef3('0x61')];return db[_0xcef3('0x3a')]['find']({'where':{'id':_0x222ae9[_0xcef3('0x54')]['id'],'UserId':null}})[_0xcef3('0x20')](handleEntityNotFound(_0x352044,null))[_0xcef3('0x20')](function(_0x2a6581){if(_0x2a6581){_0x2e7087[_0xcef3('0x25')]=_0x2a6581[_0xcef3('0x68')]({'plain':!![]});return db[_0xcef3('0x64')][_0xcef3('0x56')]({'where':{'id':_0x2a6581[_0xcef3('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x352044,null))['then'](function(_0x1642e3){if(_0x1642e3){_0x2e7087[_0xcef3('0x67')]=_0x1642e3[_0xcef3('0x68')]({'plain':!![]});interaction_log[_0xcef3('0x26')](_0xcef3('0x7d'),_0x222ae9[_0xcef3('0x62')]['id'],_0x222ae9[_0xcef3('0x62')]['name'],_0x222ae9[_0xcef3('0x62')][_0xcef3('0x7e')],_0x2e7087[_0xcef3('0x67')]['id'],_0x222ae9[_0xcef3('0x58')]?JSON[_0xcef3('0x7f')](_0x222ae9['body']):_0xcef3('0x6a'));return respondWithRpcPromise(_0xcef3('0x80'),_0xcef3('0x81'),_0x2e7087);}return null;})['then'](function(_0x5c5d9a){var _0x345f90=_0xcef3('0x6d')+_0x5c5d9a[_0xcef3('0x25')][_0xcef3('0x6e')];return db['sequelize'][_0xcef3('0x40')](_0x345f90,{'type':db['Sequelize']['QueryTypes'][_0xcef3('0x82')],'raw':!![]})[_0xcef3('0x20')](function(_0x51254c){return _0x51254c;});})[_0xcef3('0x20')](function(_0xbc0888){if(_0xbc0888){_0x2e7087[_0xcef3('0x25')][_0xcef3('0x72')]=_0xbc0888[0x0];if(!_0x222ae9[_0xcef3('0x58')][_0xcef3('0x61')])return;return db[_0xcef3('0x73')]['find']({'where':{'id':_0x222ae9[_0xcef3('0x58')][_0xcef3('0x61')],'role':_0xcef3('0x63')},'attributes':['id','name',_0xcef3('0x74'),_0xcef3('0x83'),_0xcef3('0x84')],'raw':!![]});}return null;})[_0xcef3('0x20')](function(_0x536b12){if(!_0x536b12)return null;_0x2e7087[_0xcef3('0x25')][_0xcef3('0x63')]=_0x536b12;return _0x2e7087;})['then'](function(_0x51162a){if(_0x51162a){_0x51162a[_0xcef3('0x25')][_0xcef3('0x76')]=util[_0xcef3('0x5f')](_0xcef3('0x85'),_0x222ae9[_0xcef3('0x62')][_0xcef3('0x37')]);_0x51162a[_0xcef3('0x25')][_0xcef3('0x77')]=_0x2e7087[_0xcef3('0x77')];_0x51162a[_0xcef3('0x25')][_0xcef3('0x78')]=_0x2e7087[_0xcef3('0x77')];_0x51162a['message'][_0xcef3('0x79')]='reject';respondWithRpcPromise(_0xcef3('0x7b'),_0xcef3('0x7b'),{'event':_0xcef3('0x86'),'message':_0x51162a[_0xcef3('0x25')]},client9002);return _0x2e7087;}return null;})[_0xcef3('0x20')](respondWithResult(_0x352044,null))[_0xcef3('0x29')](handleError(_0x352044,null));};
\ No newline at end of file
index 36bddc2..b5c41c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0bd=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x3ca196,_0x350166){var _0x2e3274=function(_0x54596d){while(--_0x54596d){_0x3ca196['push'](_0x3ca196['shift']());}};_0x2e3274(++_0x350166);}(_0xe0bd,0x10e));var _0xde0b=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0xe0bd[_0x120123];return _0x3bec4c;};'use strict';var EventEmitter=require(_0xde0b('0x0'));var OpenchannelMessage=require(_0xde0b('0x1'))['db'][_0xde0b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xde0b('0x3')](0x0);var events={'afterCreate':_0xde0b('0x4'),'afterUpdate':_0xde0b('0x5'),'afterDestroy':_0xde0b('0x6')};function emitEvent(_0x387a43){return function(_0xc08f0,_0xa58bdf,_0x4d25cf){OpenchannelMessageEvents[_0xde0b('0x7')](_0x387a43+':'+_0xc08f0['id'],_0xc08f0);OpenchannelMessageEvents[_0xde0b('0x7')](_0x387a43,_0xc08f0);_0x4d25cf(null);};}for(var e in events){if(events[_0xde0b('0x8')](e)){var event=events[e];OpenchannelMessage[_0xde0b('0x9')](e,emitEvent(event));}}module[_0xde0b('0xa')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x09b1=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x496a1d,_0x35ffc5){var _0x362f1c=function(_0x22a1d6){while(--_0x22a1d6){_0x496a1d['push'](_0x496a1d['shift']());}};_0x362f1c(++_0x35ffc5);}(_0x09b1,0x17c));var _0x109b=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x09b1[_0x565ed7];return _0x183ad7;};'use strict';var EventEmitter=require(_0x109b('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x109b('0x1')](0x0);var events={'afterCreate':_0x109b('0x2'),'afterUpdate':_0x109b('0x3'),'afterDestroy':_0x109b('0x4')};function emitEvent(_0x41a7bc){return function(_0x3e2740,_0x530f9d,_0x596f1a){OpenchannelMessageEvents[_0x109b('0x5')](_0x41a7bc+':'+_0x3e2740['id'],_0x3e2740);OpenchannelMessageEvents[_0x109b('0x5')](_0x41a7bc,_0x3e2740);_0x596f1a(null);};}for(var e in events){if(events[_0x109b('0x6')](e)){var event=events[e];OpenchannelMessage[_0x109b('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index 5468930..38b43d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','replyUri','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','util','../../config/logger','api','moment','bluebird','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','UserId'];(function(_0x7d918d,_0x1fe2fa){var _0x4489b2=function(_0x13a433){while(--_0x13a433){_0x7d918d['push'](_0x7d918d['shift']());}};_0x4489b2(++_0x1fe2fa);}(_0xda2d,0x102));var _0xdda2=function(_0x17ace5,_0x11a736){_0x17ace5=_0x17ace5-0x0;var _0x44a983=_0xda2d[_0x17ace5];return _0x44a983;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[{'name':_0xdda2('0xb'),'fields':[_0xdda2('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a774e,_0x22c6e5,_0x4df6b8){var _0x1c11b2=_0x39f6c9[_0xdda2('0xd')];var _0x42d990=_0x1a774e[_0xdda2('0xe')]({'plain':!![]});if(_0x42d990[_0xdda2('0xf')][_0xdda2('0x10')]()==='in'||_0x42d990[_0xdda2('0xf')][_0xdda2('0x10')]()==='out'&&!_0x42d990['secret']&&!_['isNil'](_0x42d990[_0xdda2('0x11')])){_0x1c11b2[_0xdda2('0x12')][_0xdda2('0x13')]({'where':{'id':_0x42d990[_0xdda2('0x14')]}})[_0xdda2('0x15')](function(_0x475222){if(_0x475222){_0x475222[_0xdda2('0x16')]({'lastMsgAt':_0x42d990['createdAt'],'lastMsgDirection':_0x42d990[_0xdda2('0xf')]['toLowerCase']()});}})[_0xdda2('0x17')](function(_0xb6b01e){console[_0xdda2('0x18')](_0xb6b01e);});}if(_0x42d990[_0xdda2('0xf')]===_0xdda2('0x19')&&!_0x42d990['secret']){var _0x55d674;_0x1c11b2[_0xdda2('0x1a')]['describe']()[_0xdda2('0x15')](function(_0x1a3b35){return _0x1c11b2[_0xdda2('0x1b')][_0xdda2('0x1c')]({'where':{'id':_0x42d990[_0xdda2('0x1d')]},'include':[{'model':_0x1c11b2[_0xdda2('0x12')],'as':_0xdda2('0x1e'),'where':{'id':_0x42d990[_0xdda2('0x14')]},'limit':0x1,'include':[{'model':_0x1c11b2[_0xdda2('0x1a')],'as':_0xdda2('0x1f'),'attributes':_[_0xdda2('0x20')](_0x1a3b35)}]}]});})[_0xdda2('0x15')](function(_0x4eed30){_0x55d674=_0x4eed30[_0xdda2('0xe')]({'plain':!![]});if(_0x55d674&&_0x55d674['replyUri']){logger[_0xdda2('0x21')](_0xdda2('0x22'),_0xdda2('0x23'),util['format'](_0xdda2('0x24'),_0x42d990['id'],_0x55d674['replyUri']));if(_0x55d674[_0xdda2('0x1e')]&&_0x55d674[_0xdda2('0x1e')]['length']){_0x42d990[_0xdda2('0x25')]=_[_0xdda2('0x26')](_0x55d674[_0xdda2('0x1e')][0x0],_0xdda2('0x1f'));_0x42d990[_0xdda2('0x1f')]=_0x55d674['Interactions'][0x0][_0xdda2('0x1f')];}var _0x22c6e5={'method':_0xdda2('0x27'),'uri':encodeURI(_0x55d674[_0xdda2('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x22c6e5['method']){case'GET':_0x22c6e5['qs']=_0x42d990;break;case _0xdda2('0x27'):_0x22c6e5[_0xdda2('0xc')]=_0x42d990;break;}return rp(_0x22c6e5)[_0xdda2('0x15')](function(_0x5e9e74){logger[_0xdda2('0x21')](_0xdda2('0x22'),_0xdda2('0x23'),util[_0xdda2('0x29')](_0xdda2('0x2a'),_0x42d990['id'],_0x55d674[_0xdda2('0x28')]));if(_0x5e9e74['body'][_0xdda2('0x2b')]&&_0x5e9e74[_0xdda2('0xc')]['threadId']!=_0x42d990[_0xdda2('0x25')][_0xdda2('0x2b')]){return _0x1c11b2[_0xdda2('0x12')][_0xdda2('0x16')]({'threadId':_0x5e9e74['body'][_0xdda2('0x2b')]},{'logging':!![],'where':{'id':_0x42d990[_0xdda2('0x25')]['id']}});}else{return;}})['then'](function(){return _0x1a774e[_0xdda2('0x16')]({'read':!![]});})['catch'](function(_0x2b8cd6){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xdda2('0x2c')](_0x2b8cd6,{'showHidden':![],'depth':null}));_0x4df6b8();});}else{_0x4df6b8();}})['finally'](function(){_0x4df6b8();});}else{_0x4df6b8();}}},'charset':_0xdda2('0x2d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x087b=['threadId','OpenchannelInteraction','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','out','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s'];(function(_0x2fb493,_0x5b931a){var _0x1c11a3=function(_0x32a47d){while(--_0x32a47d){_0x2fb493['push'](_0x2fb493['shift']());}};_0x1c11a3(++_0x5b931a);}(_0x087b,0x11a));var _0xb087=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x087b[_0x45f951];return _0x24756c;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb087('0x2'));var BPromise=require('bluebird');var rp=require(_0xb087('0x3'));var fs=require('fs');var path=require(_0xb087('0x4'));var rimraf=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var attributes=require(_0xb087('0x7'));module[_0xb087('0x8')]=function(_0x40156d,_0x17d6e8){return _0x40156d[_0xb087('0x9')](_0xb087('0xa'),attributes,{'tableName':_0xb087('0xb'),'paranoid':![],'indexes':[{'name':_0xb087('0xc'),'fields':[_0xb087('0xd')],'type':_0xb087('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f14bc,_0x23cdd7,_0x379041){var _0x583d25=_0x40156d[_0xb087('0xf')];var _0x108451=_0x2f14bc[_0xb087('0x10')]({'plain':!![]});if(_0x108451[_0xb087('0x11')][_0xb087('0x12')]()==='in'||_0x108451[_0xb087('0x11')][_0xb087('0x12')]()==='out'&&!_0x108451[_0xb087('0x13')]&&!_[_0xb087('0x14')](_0x108451[_0xb087('0x15')])){_0x583d25['OpenchannelInteraction'][_0xb087('0x16')]({'where':{'id':_0x108451[_0xb087('0x17')]}})[_0xb087('0x18')](function(_0x46410b){if(_0x46410b){_0x46410b[_0xb087('0x19')]({'lastMsgAt':_0x108451[_0xb087('0x1a')],'lastMsgDirection':_0x108451[_0xb087('0x11')][_0xb087('0x12')]()});}})[_0xb087('0x1b')](function(_0x16d0b7){console['error'](_0x16d0b7);});}if(_0x108451[_0xb087('0x11')]===_0xb087('0x1c')&&!_0x108451['secret']){var _0xcc4426;_0x583d25[_0xb087('0x1d')][_0xb087('0x1e')]()['then'](function(_0x330005){return _0x583d25[_0xb087('0x1f')][_0xb087('0x20')]({'where':{'id':_0x108451[_0xb087('0x21')]},'include':[{'model':_0x583d25['OpenchannelInteraction'],'as':_0xb087('0x22'),'where':{'id':_0x108451[_0xb087('0x17')]},'limit':0x1,'include':[{'model':_0x583d25[_0xb087('0x1d')],'as':_0xb087('0x23'),'attributes':_['keys'](_0x330005)}]}]});})['then'](function(_0x5ea3dc){_0xcc4426=_0x5ea3dc['get']({'plain':!![]});if(_0xcc4426&&_0xcc4426[_0xb087('0x24')]){logger[_0xb087('0x25')](_0xb087('0x26'),_0xb087('0x27'),util[_0xb087('0x28')](_0xb087('0x29'),_0x108451['id'],_0xcc4426[_0xb087('0x24')]));if(_0xcc4426['Interactions']&&_0xcc4426[_0xb087('0x22')][_0xb087('0x2a')]){_0x108451[_0xb087('0x2b')]=_[_0xb087('0x2c')](_0xcc4426[_0xb087('0x22')][0x0],'Contact');_0x108451[_0xb087('0x23')]=_0xcc4426[_0xb087('0x22')][0x0]['Contact'];}var _0x23cdd7={'method':'POST','uri':encodeURI(_0xcc4426['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x23cdd7['method']){case _0xb087('0x2d'):_0x23cdd7['qs']=_0x108451;break;case _0xb087('0x2e'):_0x23cdd7[_0xb087('0xd')]=_0x108451;break;}return rp(_0x23cdd7)[_0xb087('0x18')](function(_0xd9ec66){logger[_0xb087('0x25')](_0xb087('0x26'),_0xb087('0x27'),util[_0xb087('0x28')](_0xb087('0x2f'),_0x108451['id'],_0xcc4426[_0xb087('0x24')]));if(_0xd9ec66[_0xb087('0xd')][_0xb087('0x30')]&&_0xd9ec66[_0xb087('0xd')]['threadId']!=_0x108451[_0xb087('0x2b')][_0xb087('0x30')]){return _0x583d25[_0xb087('0x31')][_0xb087('0x19')]({'threadId':_0xd9ec66[_0xb087('0xd')][_0xb087('0x30')]},{'logging':!![],'where':{'id':_0x108451[_0xb087('0x2b')]['id']}});}else{return;}})[_0xb087('0x18')](function(){return _0x2f14bc['update']({'read':!![]});})['catch'](function(_0x3f9311){logger[_0xb087('0x32')]('OpenchannelMessage,\x20%s,\x20%s',_0xb087('0x27'),util[_0xb087('0x33')](_0x3f9311,{'showHidden':![],'depth':null}));_0x379041();});}else{_0x379041();}})[_0xb087('0x34')](function(){_0x379041();});}else{_0x379041();}}},'charset':_0xb087('0x35'),'collate':_0xb087('0x36')});};
\ No newline at end of file
index 59c130f..89bffb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x3242f8,_0x452998){var _0x47e17f=function(_0x4caf30){while(--_0x4caf30){_0x3242f8['push'](_0x3242f8['shift']());}};_0x47e17f(++_0x452998);}(_0xdb28,0x106));var _0x8db2=function(_0x2d446c,_0x2d288d){_0x2d446c=_0x2d446c-0x0;var _0x1d13b2=_0xdb28[_0x2d446c];return _0x1d13b2;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});};
\ No newline at end of file
+var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3acde8,_0x3a589d){var _0x155b53=function(_0x5ae4d1){while(--_0x5ae4d1){_0x3acde8['push'](_0x3acde8['shift']());}};_0x155b53(++_0x3a589d);}(_0xadb5,0xad));var _0x5adb=function(_0x6065a4,_0x1e7a94){_0x6065a4=_0x6065a4-0x0;var _0x16d63d=_0xadb5[_0x6065a4];return _0x16d63d;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});};
\ No newline at end of file
index 9b327e7..d05437d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e83=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x3573a1,_0x4add0d){var _0x25c2ac=function(_0x4b8290){while(--_0x4b8290){_0x3573a1['push'](_0x3573a1['shift']());}};_0x25c2ac(++_0x4add0d);}(_0x5e83,0x111));var _0x35e8=function(_0x25fa32,_0x2c9294){_0x25fa32=_0x25fa32-0x0;var _0x3b45c3=_0x5e83[_0x25fa32];return _0x3b45c3;};'use strict';var OpenchannelMessageEvents=require(_0x35e8('0x0'));var events=[_0x35e8('0x1'),_0x35e8('0x2'),_0x35e8('0x3')];function createListener(_0x3598e2,_0x298ffa){return function(_0x409e15){_0x298ffa[_0x35e8('0x4')](_0x3598e2,_0x409e15);};}function removeListener(_0x3ef747,_0x44f489){return function(){OpenchannelMessageEvents[_0x35e8('0x5')](_0x3ef747,_0x44f489);};}exports['register']=function(_0x42e18c){for(var _0x28b7ef=0x0,_0x3abbb8=events[_0x35e8('0x6')];_0x28b7ef<_0x3abbb8;_0x28b7ef++){var _0x319664=events[_0x28b7ef];var _0x23f916=createListener(_0x35e8('0x7')+_0x319664,_0x42e18c);OpenchannelMessageEvents['on'](_0x319664,_0x23f916);}};
\ No newline at end of file
+var _0x2afe=['update','emit','removeListener','register','length','./openchannelMessage.events','remove'];(function(_0x54056e,_0x4b4870){var _0x5143cc=function(_0x109bef){while(--_0x109bef){_0x54056e['push'](_0x54056e['shift']());}};_0x5143cc(++_0x4b4870);}(_0x2afe,0xbb));var _0xe2af=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2afe[_0x397e5f];return _0x5302b8;};'use strict';var OpenchannelMessageEvents=require(_0xe2af('0x0'));var events=['save',_0xe2af('0x1'),_0xe2af('0x2')];function createListener(_0x1da223,_0x5b424e){return function(_0x13344f){_0x5b424e[_0xe2af('0x3')](_0x1da223,_0x13344f);};}function removeListener(_0x2ea386,_0x179deb){return function(){OpenchannelMessageEvents[_0xe2af('0x4')](_0x2ea386,_0x179deb);};}exports[_0xe2af('0x5')]=function(_0x29e003){for(var _0x1f2786=0x0,_0x2c1e5f=events[_0xe2af('0x6')];_0x1f2786<_0x2c1e5f;_0x1f2786++){var _0x15d03a=events[_0x1f2786];var _0x150485=createListener('openchannelMessage:'+_0x15d03a,_0x29e003);OpenchannelMessageEvents['on'](_0x15d03a,_0x150485);}};
\ No newline at end of file
index 46e2735..29b8eae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc1e=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x39d25e,_0x1c9b83){var _0x1b21d0=function(_0x1abca7){while(--_0x1abca7){_0x39d25e['push'](_0x39d25e['shift']());}};_0x1b21d0(++_0x1c9b83);}(_0xfc1e,0xa8));var _0xefc1=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0xfc1e[_0x2d6197];return _0x4d0e75;};'use strict';var multer=require(_0xefc1('0x0'));var util=require(_0xefc1('0x1'));var path=require(_0xefc1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xefc1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xefc1('0x4'));var config=require(_0xefc1('0x5'));var controller=require(_0xefc1('0x6'));router['get']('/',auth[_0xefc1('0x7')](),controller[_0xefc1('0x8')]);router[_0xefc1('0x9')](_0xefc1('0xa'),auth[_0xefc1('0x7')](),controller[_0xefc1('0xb')]);router[_0xefc1('0x9')](_0xefc1('0xc'),auth[_0xefc1('0x7')](),controller[_0xefc1('0xd')]);router[_0xefc1('0x9')](_0xefc1('0xe'),auth[_0xefc1('0x7')](),controller[_0xefc1('0xf')]);router[_0xefc1('0x9')](_0xefc1('0x10'),auth[_0xefc1('0x7')](),controller[_0xefc1('0x11')]);router[_0xefc1('0x9')](_0xefc1('0x12'),auth[_0xefc1('0x7')](),controller[_0xefc1('0x13')]);router[_0xefc1('0x14')]('/',auth['isAuthenticated'](),controller[_0xefc1('0x15')]);router[_0xefc1('0x14')](_0xefc1('0x10'),auth[_0xefc1('0x7')](),controller[_0xefc1('0x16')]);router[_0xefc1('0x14')]('/:id/users',auth[_0xefc1('0x7')](),controller[_0xefc1('0x17')]);router[_0xefc1('0x18')](_0xefc1('0xc'),auth[_0xefc1('0x7')](),controller[_0xefc1('0x19')]);router[_0xefc1('0x1a')](_0xefc1('0xc'),auth[_0xefc1('0x7')](),controller[_0xefc1('0x1b')]);router[_0xefc1('0x1a')](_0xefc1('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xefc1('0x1a')](_0xefc1('0x12'),auth[_0xefc1('0x7')](),controller[_0xefc1('0x1c')]);module[_0xefc1('0x1d')]=router;
\ No newline at end of file
+var _0x5a1d=['/:id/members','isAuthenticated','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','/:id','update','delete','destroy','/:id/users','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','show'];(function(_0x402baa,_0x713d8d){var _0x11fcaa=function(_0x598088){while(--_0x598088){_0x402baa['push'](_0x402baa['shift']());}};_0x11fcaa(++_0x713d8d);}(_0x5a1d,0xbf));var _0xd5a1=function(_0x19e7b8,_0x5e4e79){_0x19e7b8=_0x19e7b8-0x0;var _0x487831=_0x5a1d[_0x19e7b8];return _0x487831;};'use strict';var multer=require(_0xd5a1('0x0'));var util=require(_0xd5a1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd5a1('0x2'));var router=express[_0xd5a1('0x3')]();var fs_extra=require(_0xd5a1('0x4'));var auth=require(_0xd5a1('0x5'));var interaction=require(_0xd5a1('0x6'));var config=require(_0xd5a1('0x7'));var controller=require(_0xd5a1('0x8'));router[_0xd5a1('0x9')]('/',auth['isAuthenticated'](),controller[_0xd5a1('0xa')]);router[_0xd5a1('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd5a1('0xb')]);router[_0xd5a1('0x9')](_0xd5a1('0xc'),auth[_0xd5a1('0xd')](),controller[_0xd5a1('0xe')]);router[_0xd5a1('0x9')](_0xd5a1('0xf'),auth[_0xd5a1('0xd')](),controller[_0xd5a1('0x10')]);router['get']('/:id/users',auth[_0xd5a1('0xd')](),controller[_0xd5a1('0x11')]);router[_0xd5a1('0x12')]('/',auth[_0xd5a1('0xd')](),controller['create']);router[_0xd5a1('0x12')](_0xd5a1('0xf'),auth[_0xd5a1('0xd')](),controller[_0xd5a1('0x13')]);router[_0xd5a1('0x12')]('/:id/users',auth[_0xd5a1('0xd')](),controller[_0xd5a1('0x14')]);router[_0xd5a1('0x15')](_0xd5a1('0x16'),auth[_0xd5a1('0xd')](),controller[_0xd5a1('0x17')]);router[_0xd5a1('0x18')]('/:id',auth[_0xd5a1('0xd')](),controller[_0xd5a1('0x19')]);router[_0xd5a1('0x18')]('/:id/teams',auth[_0xd5a1('0xd')](),controller['removeTeams']);router[_0xd5a1('0x18')](_0xd5a1('0x1a'),auth[_0xd5a1('0xd')](),controller[_0xd5a1('0x1b')]);module[_0xd5a1('0x1c')]=router;
\ No newline at end of file
index 846aacd..baed0b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa15=['exports','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x84fb2c,_0x2bc73a){var _0x3f8d3b=function(_0x3d706a){while(--_0x3d706a){_0x84fb2c['push'](_0x84fb2c['shift']());}};_0x3f8d3b(++_0x2bc73a);}(_0xaa15,0xbc));var _0x5aa1=function(_0x49079d,_0x1715c5){_0x49079d=_0x49079d-0x0;var _0x476827=_0xaa15[_0x49079d];return _0x476827;};'use strict';var Sequelize=require(_0x5aa1('0x0'));module[_0x5aa1('0x1')]={'name':{'type':Sequelize[_0x5aa1('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5aa1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5aa1('0x4')]('rrmemory',_0x5aa1('0x5'),_0x5aa1('0x6'))}};
\ No newline at end of file
+var _0x6fc4=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x421325,_0x34d9e9){var _0x222358=function(_0x1d71f9){while(--_0x1d71f9){_0x421325['push'](_0x421325['shift']());}};_0x222358(++_0x34d9e9);}(_0x6fc4,0xe8));var _0x46fc=function(_0x3d27a,_0x31311d){_0x3d27a=_0x3d27a-0x0;var _0x314fd7=_0x6fc4[_0x3d27a];return _0x314fd7;};'use strict';var Sequelize=require('sequelize');module[_0x46fc('0x0')]={'name':{'type':Sequelize[_0x46fc('0x1')],'unique':_0x46fc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x46fc('0x1')]},'timeout':{'type':Sequelize[_0x46fc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x46fc('0x4')](_0x46fc('0x5'),_0x46fc('0x6'),_0x46fc('0x7'))}};
\ No newline at end of file
index 1c6f95d..cc5b83e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21b4=['show','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','openchannelPause','getTeams','Team','addTeams','ids','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','SELECT','TeamId','includes','all','compact','value','find','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelQueue','includeAll','include','findAll','rows','catch'];(function(_0x9b6a52,_0x3cb0ab){var _0x5c5c6f=function(_0x439987){while(--_0x439987){_0x9b6a52['push'](_0x9b6a52['shift']());}};_0x5c5c6f(++_0x3cb0ab);}(_0x21b4,0x1e4));var _0x421b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21b4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x421b('0x0'));var rimraf=require(_0x421b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x421b('0x2'));var rp=require(_0x421b('0x3'));var moment=require(_0x421b('0x4'));var BPromise=require(_0x421b('0x5'));var Mustache=require(_0x421b('0x6'));var util=require('util');var path=require(_0x421b('0x7'));var sox=require(_0x421b('0x8'));var csv=require(_0x421b('0x9'));var ejs=require(_0x421b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x421b('0xb'));var squel=require(_0x421b('0xc'));var crypto=require(_0x421b('0xd'));var jsforce=require(_0x421b('0xe'));var deskjs=require(_0x421b('0xf'));var toCsv=require(_0x421b('0x9'));var querystring=require(_0x421b('0x10'));var Papa=require(_0x421b('0x11'));var Redis=require(_0x421b('0x12'));var authService=require(_0x421b('0x13'));var qs=require(_0x421b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x421b('0x15'));var logger=require(_0x421b('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x421b('0x17'));var db=require(_0x421b('0x18'))['db'];config[_0x421b('0x19')]=_['defaults'](config[_0x421b('0x19')],{'host':_0x421b('0x1a'),'port':0x18eb});var socket=require(_0x421b('0x1b'))(new Redis(config[_0x421b('0x19')]));require(_0x421b('0x1c'))[_0x421b('0x1d')](socket);function respondWithStatusCode(_0x1154c2,_0x5751c4){_0x5751c4=_0x5751c4||0xcc;return function(_0x570580){if(_0x570580){return _0x1154c2['sendStatus'](_0x5751c4);}return _0x1154c2[_0x421b('0x1e')](_0x5751c4)['end']();};}function respondWithResult(_0x237714,_0x223987){_0x223987=_0x223987||0xc8;return function(_0x418798){if(_0x418798){return _0x237714[_0x421b('0x1e')](_0x223987)[_0x421b('0x1f')](_0x418798);}};}function respondWithFilteredResult(_0x41daae,_0x495118){return function(_0x40d696){if(_0x40d696){var _0x2cbc5d=typeof _0x495118[_0x421b('0x20')]===_0x421b('0x21')&&typeof _0x495118[_0x421b('0x22')]===_0x421b('0x21');var _0x5791cb=_0x40d696[_0x421b('0x23')];var _0x5f0827=_0x2cbc5d?0x0:_0x495118['offset'];var _0x4dcb7e=_0x2cbc5d?_0x40d696['count']:_0x495118[_0x421b('0x20')]+_0x495118[_0x421b('0x22')];var _0x46f78f;if(_0x4dcb7e>=_0x5791cb){_0x4dcb7e=_0x5791cb;_0x46f78f=0xc8;}else{_0x46f78f=0xce;}_0x41daae[_0x421b('0x1e')](_0x46f78f);return _0x41daae[_0x421b('0x24')](_0x421b('0x25'),_0x5f0827+'-'+_0x4dcb7e+'/'+_0x5791cb)['json'](_0x40d696);}return null;};}function patchUpdates(_0x11aac2){return function(_0x9a9ac8){try{jsonpatch['apply'](_0x9a9ac8,_0x11aac2,!![]);}catch(_0x1e1b18){return BPromise[_0x421b('0x26')](_0x1e1b18);}return _0x9a9ac8[_0x421b('0x27')]();};}function saveUpdates(_0x408c2b,_0x2131ae){return function(_0x1deba6){if(_0x1deba6){return _0x1deba6[_0x421b('0x28')](_0x408c2b)[_0x421b('0x29')](function(_0x466feb){return _0x466feb;});}return null;};}function removeEntity(_0x54e8f1,_0x4c2c86){return function(_0x5d64ea){if(_0x5d64ea){return _0x5d64ea[_0x421b('0x2a')]()[_0x421b('0x29')](function(){var _0x4b37cd=_0x5d64ea[_0x421b('0x2b')]({'plain':!![]});var _0x43ccf7=_0x421b('0x2c');return db[_0x421b('0x2d')]['destroy']({'where':{'type':_0x43ccf7,'resourceId':_0x4b37cd['id']}})[_0x421b('0x29')](function(){return _0x5d64ea;});})[_0x421b('0x29')](function(){_0x54e8f1[_0x421b('0x1e')](0xcc)[_0x421b('0x2e')]();});}};}function handleEntityNotFound(_0x398497,_0x3ec39f){return function(_0x5a5be1){if(!_0x5a5be1){_0x398497['sendStatus'](0x194);}return _0x5a5be1;};}function handleError(_0x2db0fa,_0x20de4a){_0x20de4a=_0x20de4a||0x1f4;return function(_0x4ef2ab){logger[_0x421b('0x2f')](_0x4ef2ab['stack']);if(_0x4ef2ab['name']){delete _0x4ef2ab[_0x421b('0x30')];}_0x2db0fa[_0x421b('0x1e')](_0x20de4a)[_0x421b('0x31')](_0x4ef2ab);};}exports['index']=function(_0x3d6e98,_0x108849){var _0x2f19b9={},_0x9d5d75={},_0x7939f0={'count':0x0,'rows':[]};var _0x437b83=_[_0x421b('0x32')](db['OpenchannelQueue'][_0x421b('0x33')],function(_0x5a41df){return{'name':_0x5a41df['fieldName'],'type':_0x5a41df[_0x421b('0x34')][_0x421b('0x35')]};});_0x9d5d75['model']=_[_0x421b('0x32')](_0x437b83,_0x421b('0x30'));_0x9d5d75[_0x421b('0x36')]=_[_0x421b('0x37')](_0x3d6e98[_0x421b('0x36')]);_0x9d5d75[_0x421b('0x38')]=_[_0x421b('0x39')](_0x9d5d75[_0x421b('0x3a')],_0x9d5d75['query']);_0x2f19b9[_0x421b('0x3b')]=_[_0x421b('0x39')](_0x9d5d75[_0x421b('0x3a')],qs[_0x421b('0x3c')](_0x3d6e98[_0x421b('0x36')][_0x421b('0x3c')]));_0x2f19b9[_0x421b('0x3b')]=_0x2f19b9[_0x421b('0x3b')][_0x421b('0x3d')]?_0x2f19b9[_0x421b('0x3b')]:_0x9d5d75[_0x421b('0x3a')];if(!_0x3d6e98['query'][_0x421b('0x3e')]('nolimit')){_0x2f19b9['limit']=qs[_0x421b('0x22')](_0x3d6e98[_0x421b('0x36')]['limit']);_0x2f19b9[_0x421b('0x20')]=qs[_0x421b('0x20')](_0x3d6e98['query'][_0x421b('0x20')]);}_0x2f19b9[_0x421b('0x3f')]=qs[_0x421b('0x40')](_0x3d6e98[_0x421b('0x36')][_0x421b('0x40')]);_0x2f19b9[_0x421b('0x41')]=qs[_0x421b('0x38')](_[_0x421b('0x42')](_0x3d6e98[_0x421b('0x36')],_0x9d5d75[_0x421b('0x38')]),_0x437b83);if(_0x3d6e98['query'][_0x421b('0x43')]){_0x2f19b9[_0x421b('0x41')]=_[_0x421b('0x44')](_0x2f19b9['where'],{'$or':_[_0x421b('0x32')](_0x437b83,function(_0x45c83c){if(_0x45c83c['type']!==_0x421b('0x45')){var _0x31e1ed={};_0x31e1ed[_0x45c83c[_0x421b('0x30')]]={'$like':'%'+_0x3d6e98[_0x421b('0x36')][_0x421b('0x43')]+'%'};return _0x31e1ed;}})});}_0x2f19b9=_[_0x421b('0x44')]({},_0x2f19b9,_0x3d6e98['options']);var _0x201247={'where':_0x2f19b9['where']};return db[_0x421b('0x46')][_0x421b('0x23')](_0x201247)['then'](function(_0x230e60){_0x7939f0[_0x421b('0x23')]=_0x230e60;if(_0x3d6e98[_0x421b('0x36')][_0x421b('0x47')]){_0x2f19b9[_0x421b('0x48')]=[{'all':!![]}];}return db[_0x421b('0x46')][_0x421b('0x49')](_0x2f19b9);})['then'](function(_0x54f950){_0x7939f0[_0x421b('0x4a')]=_0x54f950;return _0x7939f0;})[_0x421b('0x29')](respondWithFilteredResult(_0x108849,_0x2f19b9))[_0x421b('0x4b')](handleError(_0x108849,null));};exports[_0x421b('0x4c')]=function(_0x7dea32,_0x27730d){var _0x34490d={'raw':!![],'where':{'id':_0x7dea32['params']['id']}},_0x4cbe31={};_0x4cbe31[_0x421b('0x3a')]=_[_0x421b('0x37')](db[_0x421b('0x46')]['rawAttributes']);_0x4cbe31[_0x421b('0x36')]=_[_0x421b('0x37')](_0x7dea32['query']);_0x4cbe31[_0x421b('0x38')]=_[_0x421b('0x39')](_0x4cbe31[_0x421b('0x3a')],_0x4cbe31[_0x421b('0x36')]);_0x34490d['attributes']=_[_0x421b('0x39')](_0x4cbe31['model'],qs[_0x421b('0x3c')](_0x7dea32[_0x421b('0x36')][_0x421b('0x3c')]));_0x34490d[_0x421b('0x3b')]=_0x34490d[_0x421b('0x3b')][_0x421b('0x3d')]?_0x34490d[_0x421b('0x3b')]:_0x4cbe31[_0x421b('0x3a')];if(_0x7dea32[_0x421b('0x36')][_0x421b('0x47')]){_0x34490d[_0x421b('0x48')]=[{'all':!![]}];}_0x34490d=_[_0x421b('0x44')]({},_0x34490d,_0x7dea32[_0x421b('0x4d')]);return db[_0x421b('0x46')]['find'](_0x34490d)[_0x421b('0x29')](handleEntityNotFound(_0x27730d,null))['then'](respondWithResult(_0x27730d,null))[_0x421b('0x4b')](handleError(_0x27730d,null));};exports[_0x421b('0x4e')]=function(_0x2eb4de,_0x157ff8){return db[_0x421b('0x46')][_0x421b('0x4e')](_0x2eb4de[_0x421b('0x4f')],{})[_0x421b('0x29')](function(_0x1a3d76){var _0x7b59b3=_0x2eb4de[_0x421b('0x50')][_0x421b('0x2b')]({'plain':!![]});if(!_0x7b59b3)throw new Error(_0x421b('0x51'));if(_0x7b59b3[_0x421b('0x52')]===_0x421b('0x50')){var _0x57f5c1=_0x1a3d76['get']({'plain':!![]});var _0x562e15='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x562e15,'userProfileId':_0x7b59b3[_0x421b('0x53')]},'raw':!![]})[_0x421b('0x29')](function(_0x1c9cd8){if(_0x1c9cd8&&_0x1c9cd8['autoAssociation']===0x0){return db[_0x421b('0x2d')][_0x421b('0x4e')]({'name':_0x57f5c1[_0x421b('0x30')],'resourceId':_0x57f5c1['id'],'type':_0x1c9cd8[_0x421b('0x30')],'sectionId':_0x1c9cd8['id']},{})[_0x421b('0x29')](function(){return _0x1a3d76;});}else{return _0x1a3d76;}})[_0x421b('0x4b')](function(_0x592e0d){logger[_0x421b('0x2f')](_0x421b('0x54'),_0x592e0d);throw _0x592e0d;});}return _0x1a3d76;})[_0x421b('0x29')](respondWithResult(_0x157ff8,0xc9))[_0x421b('0x4b')](handleError(_0x157ff8,null));};exports[_0x421b('0x28')]=function(_0x439429,_0x897e84){if(_0x439429[_0x421b('0x4f')]['id']){delete _0x439429[_0x421b('0x4f')]['id'];}return db[_0x421b('0x46')]['find']({'where':{'id':_0x439429[_0x421b('0x55')]['id']}})[_0x421b('0x29')](handleEntityNotFound(_0x897e84,null))[_0x421b('0x29')](saveUpdates(_0x439429[_0x421b('0x4f')],null))[_0x421b('0x29')](respondWithResult(_0x897e84,null))[_0x421b('0x4b')](handleError(_0x897e84,null));};exports[_0x421b('0x2a')]=function(_0x57cb39,_0x174b1f){return db['OpenchannelQueue']['find']({'where':{'id':_0x57cb39['params']['id']}})[_0x421b('0x29')](handleEntityNotFound(_0x174b1f,null))[_0x421b('0x29')](removeEntity(_0x174b1f,null))[_0x421b('0x4b')](handleError(_0x174b1f,null));};exports[_0x421b('0x56')]=function(_0x1ea6b4,_0x1f7b04){return db['OpenchannelQueue'][_0x421b('0x56')]()[_0x421b('0x29')](respondWithResult(_0x1f7b04,null))[_0x421b('0x4b')](handleError(_0x1f7b04,null));};exports['getMembers']=function(_0xee7cf6,_0x1a0394,_0x5252ea){var _0x42cf1b={'raw':!![],'where':{}},_0x473a3d={},_0x583265;return db[_0x421b('0x46')][_0x421b('0x57')]({'where':{'id':_0xee7cf6[_0x421b('0x55')]['id']}})[_0x421b('0x29')](handleEntityNotFound(_0x1a0394,null))[_0x421b('0x29')](function(_0x4a1468){if(_0x4a1468){_0x583265=_0x4a1468[_0x421b('0x2b')]({'plain':!![]});_0x473a3d['model']=_[_0x421b('0x37')](db[_0x421b('0x58')]['rawAttributes']);_0x473a3d['query']=_['keys'](_0xee7cf6[_0x421b('0x36')]);_0x473a3d['filters']=_['intersection'](_0x473a3d[_0x421b('0x3a')],_0x473a3d[_0x421b('0x36')]);_0x42cf1b[_0x421b('0x3b')]=_[_0x421b('0x39')](_0x473a3d[_0x421b('0x3a')],qs[_0x421b('0x3c')](_0xee7cf6[_0x421b('0x36')]['fields']));_0x42cf1b[_0x421b('0x3b')]=_0x42cf1b[_0x421b('0x3b')][_0x421b('0x3d')]?_0x42cf1b[_0x421b('0x3b')]:_0x473a3d[_0x421b('0x3a')];if(!_0xee7cf6[_0x421b('0x36')][_0x421b('0x3e')](_0x421b('0x59'))){_0x42cf1b['limit']=qs[_0x421b('0x22')](_0xee7cf6['query'][_0x421b('0x22')]);_0x42cf1b[_0x421b('0x20')]=qs[_0x421b('0x20')](_0xee7cf6['query'][_0x421b('0x20')]);}_0x42cf1b[_0x421b('0x3f')]=qs[_0x421b('0x40')](_0xee7cf6[_0x421b('0x36')][_0x421b('0x40')]);_0x42cf1b[_0x421b('0x41')]=qs['filters'](_[_0x421b('0x42')](_0xee7cf6[_0x421b('0x36')],_0x473a3d[_0x421b('0x38')]));_0x42cf1b[_0x421b('0x41')][_0x421b('0x5a')]=_0x4a1468['id'];if(_0xee7cf6[_0x421b('0x36')][_0x421b('0x43')]){_0x42cf1b[_0x421b('0x41')]=_['merge'](_0x42cf1b[_0x421b('0x41')],{'$or':_[_0x421b('0x32')](_0x42cf1b[_0x421b('0x3b')],function(_0x35a8ae){var _0xc5a188={};_0xc5a188[_0x35a8ae]={'$like':'%'+_0xee7cf6[_0x421b('0x36')]['filter']+'%'};return _0xc5a188;})});}_0x42cf1b=_[_0x421b('0x44')]({},_0x42cf1b,_0xee7cf6['options']);return db[_0x421b('0x58')][_0x421b('0x49')](_0x42cf1b);}})[_0x421b('0x29')](function(_0x49baf5){if(_0x49baf5){return db[_0x421b('0x5b')][_0x421b('0x5c')]({'where':{'id':_[_0x421b('0x32')](_0x49baf5,_0x421b('0x5d')),'role':_0x421b('0x5e')},'attributes':['id',_0x421b('0x30'),'openchannelPause',_0x421b('0x5f'),'createdAt']});}})['then'](function(_0x205ba0){if(_0x205ba0){return{'count':_0x205ba0[_0x421b('0x23')],'rows':_['map'](_0x205ba0[_0x421b('0x4a')],function(_0x17d988){return{'membername':_0x17d988['name'],'UserId':_0x17d988['id'],'queue_name':_0x583265[_0x421b('0x30')],'OpenchannelQueueId':_0x583265['id'],'interface':util[_0x421b('0x60')](_0x421b('0x61'),'SIP',_0x17d988['name']),'penalty':0x0,'paused':_0x17d988[_0x421b('0x62')],'createdAt':_0x17d988['createdAt'],'updatedAt':_0x17d988['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x421b('0x29')](respondWithFilteredResult(_0x1a0394,_0x42cf1b))[_0x421b('0x4b')](handleError(_0x1a0394,null));};exports[_0x421b('0x63')]=function(_0x46f083,_0xb4fa9d,_0x22e545){var _0x466568={};var _0xa2a560={};var _0x1c2995;var _0x1b99de;return db['OpenchannelQueue'][_0x421b('0x57')]({'where':{'id':_0x46f083[_0x421b('0x55')]['id']}})['then'](handleEntityNotFound(_0xb4fa9d,null))['then'](function(_0x2d1192){if(_0x2d1192){_0x1c2995=_0x2d1192;_0xa2a560[_0x421b('0x3a')]=_[_0x421b('0x37')](db[_0x421b('0x64')][_0x421b('0x33')]);_0xa2a560[_0x421b('0x36')]=_[_0x421b('0x37')](_0x46f083[_0x421b('0x36')]);_0xa2a560[_0x421b('0x38')]=_[_0x421b('0x39')](_0xa2a560['model'],_0xa2a560['query']);_0x466568['attributes']=_[_0x421b('0x39')](_0xa2a560['model'],qs[_0x421b('0x3c')](_0x46f083[_0x421b('0x36')][_0x421b('0x3c')]));_0x466568[_0x421b('0x3b')]=_0x466568['attributes'][_0x421b('0x3d')]?_0x466568[_0x421b('0x3b')]:_0xa2a560[_0x421b('0x3a')];_0x466568['order']=qs[_0x421b('0x40')](_0x46f083[_0x421b('0x36')][_0x421b('0x40')]);_0x466568['where']=qs['filters'](_[_0x421b('0x42')](_0x46f083[_0x421b('0x36')],_0xa2a560[_0x421b('0x38')]));if(_0x46f083['query'][_0x421b('0x43')]){_0x466568[_0x421b('0x41')]=_['merge'](_0x466568[_0x421b('0x41')],{'$or':_[_0x421b('0x32')](_0x466568[_0x421b('0x3b')],function(_0xd442dd){var _0x1b0484={};_0x1b0484[_0xd442dd]={'$like':'%'+_0x46f083[_0x421b('0x36')][_0x421b('0x43')]+'%'};return _0x1b0484;})});}_0x466568=_['merge']({},_0x466568,_0x46f083[_0x421b('0x4d')]);return _0x1c2995[_0x421b('0x63')](_0x466568);}})['then'](function(_0xd7d3f2){if(_0xd7d3f2){_0x1b99de=_0xd7d3f2[_0x421b('0x3d')];if(!_0x46f083[_0x421b('0x36')][_0x421b('0x3e')](_0x421b('0x59'))){_0x466568[_0x421b('0x22')]=qs['limit'](_0x46f083[_0x421b('0x36')][_0x421b('0x22')]);_0x466568[_0x421b('0x20')]=qs['offset'](_0x46f083[_0x421b('0x36')]['offset']);}return _0x1c2995[_0x421b('0x63')](_0x466568);}})['then'](function(_0x1f27cb){if(_0x1f27cb){return _0x1f27cb?{'count':_0x1b99de,'rows':_0x1f27cb}:null;}})[_0x421b('0x29')](respondWithResult(_0xb4fa9d,null))[_0x421b('0x4b')](handleError(_0xb4fa9d,null));};exports[_0x421b('0x65')]=function(_0x241a9e,_0x2489b7,_0x1cad37){var _0x1aa289=_0x241a9e['body'][_0x421b('0x66')];return db[_0x421b('0x64')]['findAll']({'where':{'id':_0x1aa289},'attributes':['id'],'include':[{'model':db[_0x421b('0x5b')],'as':'Agents','attributes':['id',_0x421b('0x30'),'online','voicePause',_0x421b('0x67')],'raw':!![]}]})[_0x421b('0x29')](function(_0x4ac802){if(_0x4ac802){var _0x1cd2f7=_[_0x421b('0x68')](_0x4ac802,function(_0x320c6f){var _0x3260a8=_0x320c6f[_0x421b('0x2b')]({'plain':!![]});return _0x3260a8[_0x421b('0x69')];});return db[_0x421b('0x46')]['find']({'where':{'id':_0x241a9e[_0x421b('0x55')]['id']}})[_0x421b('0x29')](function(_0x3b760e){return db['sequelize'][_0x421b('0x6a')](function(_0x43e5dc){return _0x3b760e['addTeams'](_0x1aa289,{'transaction':_0x43e5dc})['then'](function(){return BPromise[_0x421b('0x6b')](_0x1cd2f7,function(_0x317476){return db[_0x421b('0x58')][_0x421b('0x6c')]({'where':{'UserId':_0x317476['id'],'OpenchannelQueueId':_0x241a9e['params']['id']},'transaction':_0x43e5dc});});})[_0x421b('0x29')](function(){_0x1cd2f7[_0x421b('0x6d')](function(_0x4be7e2){socket[_0x421b('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x4be7e2['id'],'OpenchannelQueueId':_0x3b760e['id']});});});});});}})[_0x421b('0x29')](respondWithStatusCode(_0x2489b7,null))[_0x421b('0x4b')](handleError(_0x2489b7,null));};exports[_0x421b('0x6f')]=function(_0xb4f4a2,_0x288a63,_0x4c5d0c){return db[_0x421b('0x64')][_0x421b('0x49')]({'where':{'id':_0xb4f4a2['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x421b('0x5b')],'as':_0x421b('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x288a63,null))[_0x421b('0x29')](function(_0x224d73){var _0x139ec0=_['map'](_0x224d73,'id');var _0x10c801=[];var _0x12f75a=[];var _0x4bf897=squel[_0x421b('0x70')]();_0x4bf897[_0x421b('0x71')](_0x421b('0x72'))[_0x421b('0x73')](_0x421b('0x74'),'tq')[_0x421b('0x75')](_0x421b('0x76'),'ut',_0x421b('0x77'))[_0x421b('0x41')](_0x421b('0x78'),_0xb4f4a2['params']['id']);for(var _0x7c5e46=0x0;_0x7c5e46<_0x224d73['length'];_0x7c5e46+=0x1){let _0x2fbb39=_0x224d73[_0x7c5e46];for(var _0x25acd0=0x0;_0x25acd0<_0x2fbb39[_0x421b('0x69')][_0x421b('0x3d')];_0x25acd0+=0x1){let _0x1bdda8=_0x2fbb39[_0x421b('0x69')][_0x25acd0];var _0x2070f4=_0x4bf897[_0x421b('0x79')]();_0x2070f4[_0x421b('0x41')](_0x421b('0x7a'),_0x1bdda8['id']);_0x12f75a['push'](db[_0x421b('0x7b')][_0x421b('0x36')](_0x2070f4[_0x421b('0x7c')](),{'type':db[_0x421b('0x7b')]['QueryTypes'][_0x421b('0x7d')]})[_0x421b('0x29')](function(_0x23552c){if(_0x23552c[_0x421b('0x3d')]===0x1){return _0x1bdda8['id'];}else{var _0x26b6fc=_['every'](_[_0x421b('0x32')](_0x23552c,_0x421b('0x7e')),function(_0x3f3f28){return _[_0x421b('0x7f')](_0x139ec0,_0x3f3f28);});if(_0x26b6fc){return _0x1bdda8['id'];}}}));}}return BPromise[_0x421b('0x80')](_0x12f75a)['then'](function(_0x19d697){_0x10c801=_(_0x10c801)['union'](_0x19d697)[_0x421b('0x81')]()[_0x421b('0x82')]();return db[_0x421b('0x46')][_0x421b('0x83')]({'where':{'id':_0xb4f4a2['params']['id']}})[_0x421b('0x29')](function(_0x19b39d){return db[_0x421b('0x7b')][_0x421b('0x6a')](function(_0x50a399){return _0x19b39d[_0x421b('0x6f')](_0xb4f4a2[_0x421b('0x36')][_0x421b('0x66')],{'transaction':_0x50a399})[_0x421b('0x29')](function(){if(!_[_0x421b('0x84')](_0x10c801)){return _0x19b39d['removeAgents'](_0x10c801,{'transaction':_0x50a399});}})[_0x421b('0x29')](function(){_0x10c801[_0x421b('0x6d')](function(_0x1b534b){socket[_0x421b('0x6e')](_0x421b('0x85'),{'UserId':_0x1b534b,'OpenchannelQueueId':_0x19b39d['id']});});});});});});})['then'](respondWithStatusCode(_0x288a63,null))[_0x421b('0x4b')](handleError(_0x288a63,null));};exports['addAgents']=function(_0xe5de6e,_0x188aea,_0x2ca5be){return db[_0x421b('0x46')][_0x421b('0x83')]({'where':{'id':_0xe5de6e[_0x421b('0x55')]['id']}})[_0x421b('0x29')](handleEntityNotFound(_0x188aea,null))[_0x421b('0x29')](function(_0x2a0b3f){if(_0x2a0b3f){return _0x2a0b3f[_0x421b('0x86')](_0xe5de6e[_0x421b('0x4f')][_0x421b('0x66')],_[_0x421b('0x87')](_0xe5de6e[_0x421b('0x4f')],['ids','id'])||{})[_0x421b('0x88')](function(_0x187ea3){for(var _0x4f65f7=0x0;_0x4f65f7<_0xe5de6e[_0x421b('0x4f')]['ids'][_0x421b('0x3d')];_0x4f65f7+=0x1){socket[_0x421b('0x6e')](_0x421b('0x89'),{'UserId':Number(_0xe5de6e[_0x421b('0x4f')][_0x421b('0x66')][_0x4f65f7]),'OpenchannelQueueId':Number(_0xe5de6e['params']['id'])});}return _0x187ea3;});}})['then'](respondWithResult(_0x188aea,null))[_0x421b('0x4b')](handleError(_0x188aea,null));};exports[_0x421b('0x8a')]=function(_0x3fd354,_0x59ffef,_0x4690b6){return db[_0x421b('0x46')]['find']({'where':{'id':_0x3fd354[_0x421b('0x55')]['id']}})[_0x421b('0x29')](handleEntityNotFound(_0x59ffef,null))[_0x421b('0x29')](function(_0x169922){if(_0x169922){return _0x169922[_0x421b('0x8a')](_0x3fd354[_0x421b('0x36')][_0x421b('0x66')])[_0x421b('0x29')](function(){if(_['isArray'](_0x3fd354[_0x421b('0x36')][_0x421b('0x66')])){for(var _0x55e351=0x0;_0x55e351<_0x3fd354[_0x421b('0x36')][_0x421b('0x66')][_0x421b('0x3d')];_0x55e351+=0x1){socket[_0x421b('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x3fd354[_0x421b('0x36')][_0x421b('0x66')][_0x55e351]),'OpenchannelQueueId':Number(_0x3fd354[_0x421b('0x55')]['id'])});}}else{socket[_0x421b('0x6e')](_0x421b('0x85'),{'UserId':Number(_0x3fd354[_0x421b('0x36')]['ids']),'OpenchannelQueueId':Number(_0x3fd354['params']['id'])});}});}})[_0x421b('0x29')](respondWithStatusCode(_0x59ffef,null))[_0x421b('0x4b')](handleError(_0x59ffef,null));};exports[_0x421b('0x8b')]=function(_0xecd20a,_0x4e7b28,_0x22a882){var _0x493971={};var _0x382dc9={};var _0x1c5d36;var _0x2211c1;return db[_0x421b('0x46')][_0x421b('0x57')]({'where':{'id':_0xecd20a[_0x421b('0x55')]['id']}})[_0x421b('0x29')](handleEntityNotFound(_0x4e7b28,null))['then'](function(_0x283e05){if(_0x283e05){_0x1c5d36=_0x283e05;_0x382dc9['model']=_[_0x421b('0x37')](db[_0x421b('0x5b')][_0x421b('0x33')]);_0x382dc9[_0x421b('0x36')]=_[_0x421b('0x37')](_0xecd20a[_0x421b('0x36')]);_0x382dc9[_0x421b('0x38')]=_['intersection'](_0x382dc9[_0x421b('0x3a')],_0x382dc9[_0x421b('0x36')]);_0x493971[_0x421b('0x3b')]=_['intersection'](_0x382dc9[_0x421b('0x3a')],qs['fields'](_0xecd20a[_0x421b('0x36')][_0x421b('0x3c')]));_0x493971[_0x421b('0x3b')]=_0x493971[_0x421b('0x3b')]['length']?_0x493971[_0x421b('0x3b')]:_0x382dc9[_0x421b('0x3a')];_0x493971['order']=qs[_0x421b('0x40')](_0xecd20a[_0x421b('0x36')][_0x421b('0x40')]);_0x493971[_0x421b('0x41')]=qs['filters'](_[_0x421b('0x42')](_0xecd20a[_0x421b('0x36')],_0x382dc9[_0x421b('0x38')]));if(_0xecd20a[_0x421b('0x36')][_0x421b('0x43')]){_0x493971[_0x421b('0x41')]=_[_0x421b('0x44')](_0x493971[_0x421b('0x41')],{'$or':_['map'](_0x493971[_0x421b('0x3b')],function(_0x35ae3d){var _0x32b61d={};_0x32b61d[_0x35ae3d]={'$like':'%'+_0xecd20a[_0x421b('0x36')]['filter']+'%'};return _0x32b61d;})});}_0x493971=_['merge']({},_0x493971,_0xecd20a['options']);return _0x1c5d36['getAgents'](_0x493971);}})['then'](function(_0x5c5e7b){if(_0x5c5e7b){_0x2211c1=_0x5c5e7b[_0x421b('0x3d')];if(!_0xecd20a[_0x421b('0x36')]['hasOwnProperty'](_0x421b('0x59'))){_0x493971[_0x421b('0x22')]=qs[_0x421b('0x22')](_0xecd20a['query'][_0x421b('0x22')]);_0x493971[_0x421b('0x20')]=qs[_0x421b('0x20')](_0xecd20a[_0x421b('0x36')]['offset']);}return _0x1c5d36[_0x421b('0x8b')](_0x493971);}})[_0x421b('0x29')](function(_0xadcb9f){if(_0xadcb9f){return _0xadcb9f?{'count':_0x2211c1,'rows':_0xadcb9f}:null;}})[_0x421b('0x29')](respondWithResult(_0x4e7b28,null))[_0x421b('0x4b')](handleError(_0x4e7b28,null));};
\ No newline at end of file
+var _0xd291=['findOne','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','OpenchannelQueue','includeAll','include','findAll','catch','show','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','UserOpenchannelQueue','OpenchannelQueueId','User','agent','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','interface','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents'];(function(_0x3aee37,_0x2d4734){var _0x5981e3=function(_0x2b0628){while(--_0x2b0628){_0x3aee37['push'](_0x3aee37['shift']());}};_0x5981e3(++_0x2d4734);}(_0xd291,0x8e));var _0x1d29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd291[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d29('0x0'));var zipdir=require(_0x1d29('0x1'));var jsonpatch=require(_0x1d29('0x2'));var rp=require('request-promise');var moment=require(_0x1d29('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1d29('0x4'));var util=require('util');var path=require(_0x1d29('0x5'));var sox=require(_0x1d29('0x6'));var csv=require('to-csv');var ejs=require(_0x1d29('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d29('0x8'));var squel=require(_0x1d29('0x9'));var crypto=require('crypto');var jsforce=require(_0x1d29('0xa'));var deskjs=require(_0x1d29('0xb'));var toCsv=require(_0x1d29('0xc'));var querystring=require(_0x1d29('0xd'));var Papa=require(_0x1d29('0xe'));var Redis=require('ioredis');var authService=require(_0x1d29('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1d29('0x10'));var hardwareService=require(_0x1d29('0x11'));var logger=require('../../config/logger')(_0x1d29('0x12'));var utils=require(_0x1d29('0x13'));var config=require(_0x1d29('0x14'));var licenseUtil=require(_0x1d29('0x15'));var db=require(_0x1d29('0x16'))['db'];config[_0x1d29('0x17')]=_[_0x1d29('0x18')](config[_0x1d29('0x17')],{'host':_0x1d29('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d29('0x17')]));require(_0x1d29('0x1a'))['register'](socket);function respondWithStatusCode(_0x5dd8ca,_0x46d074){_0x46d074=_0x46d074||0xcc;return function(_0x2a46d1){if(_0x2a46d1){return _0x5dd8ca[_0x1d29('0x1b')](_0x46d074);}return _0x5dd8ca[_0x1d29('0x1c')](_0x46d074)[_0x1d29('0x1d')]();};}function respondWithResult(_0x56127e,_0xee1e0b){_0xee1e0b=_0xee1e0b||0xc8;return function(_0x522142){if(_0x522142){return _0x56127e[_0x1d29('0x1c')](_0xee1e0b)[_0x1d29('0x1e')](_0x522142);}};}function respondWithFilteredResult(_0xcd9161,_0x36af7e){return function(_0x25c41a){if(_0x25c41a){var _0x343267=typeof _0x36af7e[_0x1d29('0x1f')]===_0x1d29('0x20')&&typeof _0x36af7e['limit']===_0x1d29('0x20');var _0x348421=_0x25c41a[_0x1d29('0x21')];var _0xc052d9=_0x343267?0x0:_0x36af7e[_0x1d29('0x1f')];var _0x4e5718=_0x343267?_0x25c41a[_0x1d29('0x21')]:_0x36af7e[_0x1d29('0x1f')]+_0x36af7e[_0x1d29('0x22')];var _0x53e15f;if(_0x4e5718>=_0x348421){_0x4e5718=_0x348421;_0x53e15f=0xc8;}else{_0x53e15f=0xce;}_0xcd9161[_0x1d29('0x1c')](_0x53e15f);return _0xcd9161[_0x1d29('0x23')](_0x1d29('0x24'),_0xc052d9+'-'+_0x4e5718+'/'+_0x348421)[_0x1d29('0x1e')](_0x25c41a);}return null;};}function patchUpdates(_0x12f3b5){return function(_0x33407f){try{jsonpatch['apply'](_0x33407f,_0x12f3b5,!![]);}catch(_0x4a3895){return BPromise[_0x1d29('0x25')](_0x4a3895);}return _0x33407f[_0x1d29('0x26')]();};}function saveUpdates(_0x38668b,_0x10c732){return function(_0x14ea22){if(_0x14ea22){return _0x14ea22[_0x1d29('0x27')](_0x38668b)['then'](function(_0x164a2b){return _0x164a2b;});}return null;};}function removeEntity(_0x41379b,_0x5af75c){return function(_0x373ddc){if(_0x373ddc){return _0x373ddc[_0x1d29('0x28')]()[_0x1d29('0x29')](function(){var _0x47e6ac=_0x373ddc[_0x1d29('0x2a')]({'plain':!![]});var _0x454f99=_0x1d29('0x2b');return db[_0x1d29('0x2c')][_0x1d29('0x28')]({'where':{'type':_0x454f99,'resourceId':_0x47e6ac['id']}})[_0x1d29('0x29')](function(){return _0x373ddc;});})[_0x1d29('0x29')](function(){_0x41379b[_0x1d29('0x1c')](0xcc)[_0x1d29('0x1d')]();});}};}function handleEntityNotFound(_0x1fb91b,_0x49d9da){return function(_0x415252){if(!_0x415252){_0x1fb91b[_0x1d29('0x1b')](0x194);}return _0x415252;};}function handleError(_0x59787a,_0x17bae6){_0x17bae6=_0x17bae6||0x1f4;return function(_0x427282){logger[_0x1d29('0x2d')](_0x427282[_0x1d29('0x2e')]);if(_0x427282['name']){delete _0x427282[_0x1d29('0x2f')];}_0x59787a[_0x1d29('0x1c')](_0x17bae6)[_0x1d29('0x30')](_0x427282);};}exports[_0x1d29('0x31')]=function(_0x498753,_0x2716e9){var _0x5c84e8={},_0x24030b={},_0x5442f4={'count':0x0,'rows':[]};var _0x445598=_[_0x1d29('0x32')](db['OpenchannelQueue'][_0x1d29('0x33')],function(_0x59ee15){return{'name':_0x59ee15[_0x1d29('0x34')],'type':_0x59ee15[_0x1d29('0x35')][_0x1d29('0x36')]};});_0x24030b[_0x1d29('0x37')]=_[_0x1d29('0x32')](_0x445598,'name');_0x24030b[_0x1d29('0x38')]=_[_0x1d29('0x39')](_0x498753['query']);_0x24030b['filters']=_['intersection'](_0x24030b[_0x1d29('0x37')],_0x24030b[_0x1d29('0x38')]);_0x5c84e8['attributes']=_[_0x1d29('0x3a')](_0x24030b[_0x1d29('0x37')],qs[_0x1d29('0x3b')](_0x498753[_0x1d29('0x38')][_0x1d29('0x3b')]));_0x5c84e8[_0x1d29('0x3c')]=_0x5c84e8[_0x1d29('0x3c')][_0x1d29('0x3d')]?_0x5c84e8[_0x1d29('0x3c')]:_0x24030b['model'];if(!_0x498753[_0x1d29('0x38')][_0x1d29('0x3e')](_0x1d29('0x3f'))){_0x5c84e8[_0x1d29('0x22')]=qs[_0x1d29('0x22')](_0x498753[_0x1d29('0x38')]['limit']);_0x5c84e8[_0x1d29('0x1f')]=qs[_0x1d29('0x1f')](_0x498753[_0x1d29('0x38')][_0x1d29('0x1f')]);}_0x5c84e8[_0x1d29('0x40')]=qs[_0x1d29('0x41')](_0x498753['query']['sort']);_0x5c84e8[_0x1d29('0x42')]=qs[_0x1d29('0x43')](_[_0x1d29('0x44')](_0x498753[_0x1d29('0x38')],_0x24030b[_0x1d29('0x43')]),_0x445598);if(_0x498753[_0x1d29('0x38')]['filter']){_0x5c84e8['where']=_[_0x1d29('0x45')](_0x5c84e8['where'],{'$or':_['map'](_0x445598,function(_0x2bc8dd){if(_0x2bc8dd[_0x1d29('0x35')]!==_0x1d29('0x46')){var _0x165334={};_0x165334[_0x2bc8dd[_0x1d29('0x2f')]]={'$like':'%'+_0x498753[_0x1d29('0x38')][_0x1d29('0x47')]+'%'};return _0x165334;}})});}_0x5c84e8=_[_0x1d29('0x45')]({},_0x5c84e8,_0x498753[_0x1d29('0x48')]);var _0x497f50={'where':_0x5c84e8[_0x1d29('0x42')]};return db[_0x1d29('0x49')][_0x1d29('0x21')](_0x497f50)[_0x1d29('0x29')](function(_0x287bb){_0x5442f4['count']=_0x287bb;if(_0x498753[_0x1d29('0x38')][_0x1d29('0x4a')]){_0x5c84e8[_0x1d29('0x4b')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x1d29('0x4c')](_0x5c84e8);})[_0x1d29('0x29')](function(_0x4cd9e6){_0x5442f4['rows']=_0x4cd9e6;return _0x5442f4;})['then'](respondWithFilteredResult(_0x2716e9,_0x5c84e8))[_0x1d29('0x4d')](handleError(_0x2716e9,null));};exports[_0x1d29('0x4e')]=function(_0x45b2ea,_0x4da704){var _0x4d8878={'raw':!![],'where':{'id':_0x45b2ea['params']['id']}},_0x13f471={};_0x13f471[_0x1d29('0x37')]=_['keys'](db['OpenchannelQueue'][_0x1d29('0x33')]);_0x13f471[_0x1d29('0x38')]=_[_0x1d29('0x39')](_0x45b2ea[_0x1d29('0x38')]);_0x13f471[_0x1d29('0x43')]=_[_0x1d29('0x3a')](_0x13f471[_0x1d29('0x37')],_0x13f471[_0x1d29('0x38')]);_0x4d8878[_0x1d29('0x3c')]=_[_0x1d29('0x3a')](_0x13f471['model'],qs[_0x1d29('0x3b')](_0x45b2ea[_0x1d29('0x38')][_0x1d29('0x3b')]));_0x4d8878[_0x1d29('0x3c')]=_0x4d8878[_0x1d29('0x3c')][_0x1d29('0x3d')]?_0x4d8878[_0x1d29('0x3c')]:_0x13f471[_0x1d29('0x37')];if(_0x45b2ea[_0x1d29('0x38')]['includeAll']){_0x4d8878[_0x1d29('0x4b')]=[{'all':!![]}];}_0x4d8878=_[_0x1d29('0x45')]({},_0x4d8878,_0x45b2ea[_0x1d29('0x48')]);return db[_0x1d29('0x49')][_0x1d29('0x4f')](_0x4d8878)['then'](handleEntityNotFound(_0x4da704,null))[_0x1d29('0x29')](respondWithResult(_0x4da704,null))[_0x1d29('0x4d')](handleError(_0x4da704,null));};exports['create']=function(_0x2cb7e9,_0x150789){return db[_0x1d29('0x49')]['create'](_0x2cb7e9[_0x1d29('0x50')],{})[_0x1d29('0x29')](function(_0x1c8ac0){var _0x2a03d2=_0x2cb7e9[_0x1d29('0x51')][_0x1d29('0x2a')]({'plain':!![]});if(!_0x2a03d2)throw new Error(_0x1d29('0x52'));if(_0x2a03d2[_0x1d29('0x53')]===_0x1d29('0x51')){var _0x2c22ca=_0x1c8ac0[_0x1d29('0x2a')]({'plain':!![]});var _0x5488a9=_0x1d29('0x2b');return db['UserProfileSection'][_0x1d29('0x4f')]({'where':{'name':_0x5488a9,'userProfileId':_0x2a03d2[_0x1d29('0x54')]},'raw':!![]})['then'](function(_0x4b549a){if(_0x4b549a&&_0x4b549a[_0x1d29('0x55')]===0x0){return db[_0x1d29('0x2c')][_0x1d29('0x56')]({'name':_0x2c22ca[_0x1d29('0x2f')],'resourceId':_0x2c22ca['id'],'type':_0x4b549a[_0x1d29('0x2f')],'sectionId':_0x4b549a['id']},{})[_0x1d29('0x29')](function(){return _0x1c8ac0;});}else{return _0x1c8ac0;}})['catch'](function(_0x2fec96){logger[_0x1d29('0x2d')](_0x1d29('0x57'),_0x2fec96);throw _0x2fec96;});}return _0x1c8ac0;})[_0x1d29('0x29')](respondWithResult(_0x150789,0xc9))[_0x1d29('0x4d')](handleError(_0x150789,null));};exports['update']=function(_0x2c4c14,_0x405f1f){if(_0x2c4c14[_0x1d29('0x50')]['id']){delete _0x2c4c14[_0x1d29('0x50')]['id'];}return db[_0x1d29('0x49')][_0x1d29('0x4f')]({'where':{'id':_0x2c4c14['params']['id']}})['then'](handleEntityNotFound(_0x405f1f,null))[_0x1d29('0x29')](saveUpdates(_0x2c4c14['body'],null))[_0x1d29('0x29')](respondWithResult(_0x405f1f,null))[_0x1d29('0x4d')](handleError(_0x405f1f,null));};exports[_0x1d29('0x28')]=function(_0x28d8ee,_0x157869){return db[_0x1d29('0x49')][_0x1d29('0x4f')]({'where':{'id':_0x28d8ee['params']['id']}})[_0x1d29('0x29')](handleEntityNotFound(_0x157869,null))[_0x1d29('0x29')](removeEntity(_0x157869,null))['catch'](handleError(_0x157869,null));};exports[_0x1d29('0x58')]=function(_0x1b49ee,_0x5cc089){return db['OpenchannelQueue'][_0x1d29('0x58')]()[_0x1d29('0x29')](respondWithResult(_0x5cc089,null))[_0x1d29('0x4d')](handleError(_0x5cc089,null));};exports[_0x1d29('0x59')]=function(_0x4eb365,_0x3a109e,_0xc82425){var _0x4fc018={'raw':!![],'where':{}},_0x129082={},_0xb60b63;return db[_0x1d29('0x49')]['findOne']({'where':{'id':_0x4eb365[_0x1d29('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a109e,null))[_0x1d29('0x29')](function(_0x12d5db){if(_0x12d5db){_0xb60b63=_0x12d5db[_0x1d29('0x2a')]({'plain':!![]});_0x129082[_0x1d29('0x37')]=_[_0x1d29('0x39')](db[_0x1d29('0x5b')][_0x1d29('0x33')]);_0x129082[_0x1d29('0x38')]=_['keys'](_0x4eb365[_0x1d29('0x38')]);_0x129082['filters']=_[_0x1d29('0x3a')](_0x129082[_0x1d29('0x37')],_0x129082[_0x1d29('0x38')]);_0x4fc018[_0x1d29('0x3c')]=_['intersection'](_0x129082[_0x1d29('0x37')],qs[_0x1d29('0x3b')](_0x4eb365[_0x1d29('0x38')][_0x1d29('0x3b')]));_0x4fc018[_0x1d29('0x3c')]=_0x4fc018[_0x1d29('0x3c')][_0x1d29('0x3d')]?_0x4fc018[_0x1d29('0x3c')]:_0x129082[_0x1d29('0x37')];if(!_0x4eb365['query'][_0x1d29('0x3e')]('nolimit')){_0x4fc018[_0x1d29('0x22')]=qs[_0x1d29('0x22')](_0x4eb365['query'][_0x1d29('0x22')]);_0x4fc018[_0x1d29('0x1f')]=qs[_0x1d29('0x1f')](_0x4eb365[_0x1d29('0x38')][_0x1d29('0x1f')]);}_0x4fc018[_0x1d29('0x40')]=qs['sort'](_0x4eb365[_0x1d29('0x38')][_0x1d29('0x41')]);_0x4fc018['where']=qs['filters'](_[_0x1d29('0x44')](_0x4eb365['query'],_0x129082['filters']));_0x4fc018[_0x1d29('0x42')][_0x1d29('0x5c')]=_0x12d5db['id'];if(_0x4eb365[_0x1d29('0x38')]['filter']){_0x4fc018[_0x1d29('0x42')]=_['merge'](_0x4fc018['where'],{'$or':_[_0x1d29('0x32')](_0x4fc018[_0x1d29('0x3c')],function(_0xeec0){var _0x24dcf3={};_0x24dcf3[_0xeec0]={'$like':'%'+_0x4eb365['query']['filter']+'%'};return _0x24dcf3;})});}_0x4fc018=_['merge']({},_0x4fc018,_0x4eb365[_0x1d29('0x48')]);return db[_0x1d29('0x5b')][_0x1d29('0x4c')](_0x4fc018);}})[_0x1d29('0x29')](function(_0x4f3872){if(_0x4f3872){return db[_0x1d29('0x5d')]['findAndCountAll']({'where':{'id':_[_0x1d29('0x32')](_0x4f3872,'UserId'),'role':_0x1d29('0x5e')},'attributes':['id','name','openchannelPause',_0x1d29('0x5f'),'createdAt']});}})[_0x1d29('0x29')](function(_0x3ef145){if(_0x3ef145){return{'count':_0x3ef145[_0x1d29('0x21')],'rows':_[_0x1d29('0x32')](_0x3ef145[_0x1d29('0x60')],function(_0xee236f){return{'membername':_0xee236f['name'],'UserId':_0xee236f['id'],'queue_name':_0xb60b63[_0x1d29('0x2f')],'OpenchannelQueueId':_0xb60b63['id'],'interface':util[_0x1d29('0x61')](_0x1d29('0x62'),_0x1d29('0x63'),_0xee236f['name']),'penalty':0x0,'paused':_0xee236f['openchannelPause'],'createdAt':_0xee236f[_0x1d29('0x64')],'updatedAt':_0xee236f[_0x1d29('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1d29('0x29')](respondWithFilteredResult(_0x3a109e,_0x4fc018))[_0x1d29('0x4d')](handleError(_0x3a109e,null));};exports[_0x1d29('0x65')]=function(_0x40aa9a,_0x160c41,_0xe96637){var _0x51c3f7={};var _0x8682c1={};var _0x3e857e;var _0x1203d7;return db[_0x1d29('0x49')]['findOne']({'where':{'id':_0x40aa9a[_0x1d29('0x5a')]['id']}})[_0x1d29('0x29')](handleEntityNotFound(_0x160c41,null))[_0x1d29('0x29')](function(_0x220178){if(_0x220178){_0x3e857e=_0x220178;_0x8682c1['model']=_[_0x1d29('0x39')](db[_0x1d29('0x66')]['rawAttributes']);_0x8682c1[_0x1d29('0x38')]=_[_0x1d29('0x39')](_0x40aa9a[_0x1d29('0x38')]);_0x8682c1[_0x1d29('0x43')]=_['intersection'](_0x8682c1[_0x1d29('0x37')],_0x8682c1[_0x1d29('0x38')]);_0x51c3f7[_0x1d29('0x3c')]=_['intersection'](_0x8682c1[_0x1d29('0x37')],qs[_0x1d29('0x3b')](_0x40aa9a[_0x1d29('0x38')][_0x1d29('0x3b')]));_0x51c3f7['attributes']=_0x51c3f7[_0x1d29('0x3c')]['length']?_0x51c3f7[_0x1d29('0x3c')]:_0x8682c1[_0x1d29('0x37')];_0x51c3f7[_0x1d29('0x40')]=qs[_0x1d29('0x41')](_0x40aa9a['query'][_0x1d29('0x41')]);_0x51c3f7[_0x1d29('0x42')]=qs[_0x1d29('0x43')](_[_0x1d29('0x44')](_0x40aa9a[_0x1d29('0x38')],_0x8682c1['filters']));if(_0x40aa9a[_0x1d29('0x38')][_0x1d29('0x47')]){_0x51c3f7[_0x1d29('0x42')]=_[_0x1d29('0x45')](_0x51c3f7[_0x1d29('0x42')],{'$or':_[_0x1d29('0x32')](_0x51c3f7[_0x1d29('0x3c')],function(_0x3a7b19){var _0x21a9d5={};_0x21a9d5[_0x3a7b19]={'$like':'%'+_0x40aa9a['query'][_0x1d29('0x47')]+'%'};return _0x21a9d5;})});}_0x51c3f7=_[_0x1d29('0x45')]({},_0x51c3f7,_0x40aa9a[_0x1d29('0x48')]);return _0x3e857e[_0x1d29('0x65')](_0x51c3f7);}})[_0x1d29('0x29')](function(_0x34388c){if(_0x34388c){_0x1203d7=_0x34388c['length'];if(!_0x40aa9a[_0x1d29('0x38')][_0x1d29('0x3e')]('nolimit')){_0x51c3f7['limit']=qs[_0x1d29('0x22')](_0x40aa9a[_0x1d29('0x38')][_0x1d29('0x22')]);_0x51c3f7[_0x1d29('0x1f')]=qs['offset'](_0x40aa9a[_0x1d29('0x38')][_0x1d29('0x1f')]);}return _0x3e857e[_0x1d29('0x65')](_0x51c3f7);}})[_0x1d29('0x29')](function(_0xa6367d){if(_0xa6367d){return _0xa6367d?{'count':_0x1203d7,'rows':_0xa6367d}:null;}})[_0x1d29('0x29')](respondWithResult(_0x160c41,null))[_0x1d29('0x4d')](handleError(_0x160c41,null));};exports[_0x1d29('0x67')]=function(_0x59d220,_0x1785aa,_0x479198){var _0x29ebdb=_0x59d220[_0x1d29('0x50')][_0x1d29('0x68')];return db[_0x1d29('0x66')][_0x1d29('0x4c')]({'where':{'id':_0x29ebdb},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1d29('0x69'),'attributes':['id',_0x1d29('0x2f'),_0x1d29('0x6a'),'voicePause',_0x1d29('0x6b')],'raw':!![]}]})[_0x1d29('0x29')](function(_0x2659a8){if(_0x2659a8){var _0x21ba00=_['flatMap'](_0x2659a8,function(_0xcdf931){var _0x2c4ec7=_0xcdf931['get']({'plain':!![]});return _0x2c4ec7['Agents'];});return db['OpenchannelQueue']['find']({'where':{'id':_0x59d220['params']['id']}})['then'](function(_0x126cb1){return db[_0x1d29('0x6c')]['transaction'](function(_0x517f85){return _0x126cb1['addTeams'](_0x29ebdb,{'transaction':_0x517f85})[_0x1d29('0x29')](function(){return BPromise[_0x1d29('0x6d')](_0x21ba00,function(_0x39966f){return db[_0x1d29('0x5b')][_0x1d29('0x6e')]({'where':{'UserId':_0x39966f['id'],'OpenchannelQueueId':_0x59d220[_0x1d29('0x5a')]['id']},'transaction':_0x517f85});});})['then'](function(){_0x21ba00[_0x1d29('0x6f')](function(_0x154a2e){socket[_0x1d29('0x70')](_0x1d29('0x71'),{'UserId':_0x154a2e['id'],'OpenchannelQueueId':_0x126cb1['id']});});});});});}})[_0x1d29('0x29')](respondWithStatusCode(_0x1785aa,null))[_0x1d29('0x4d')](handleError(_0x1785aa,null));};exports['removeTeams']=function(_0x5df8ff,_0x96568a,_0x25fae1){return db[_0x1d29('0x66')][_0x1d29('0x4c')]({'where':{'id':_0x5df8ff[_0x1d29('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1d29('0x69'),'attributes':['id'],'raw':!![]}]})[_0x1d29('0x29')](handleEntityNotFound(_0x96568a,null))['then'](function(_0x13633b){var _0x23c7c0=_[_0x1d29('0x32')](_0x13633b,'id');var _0x4e980c=[];var _0x2d0f4b=[];var _0x2a20e6=squel[_0x1d29('0x72')]();_0x2a20e6['field'](_0x1d29('0x73'))[_0x1d29('0x74')]('team_has_openchannel_queues','tq')[_0x1d29('0x75')](_0x1d29('0x76'),'ut',_0x1d29('0x77'))['where'](_0x1d29('0x78'),_0x5df8ff['params']['id']);for(var _0x4ceb74=0x0;_0x4ceb74<_0x13633b[_0x1d29('0x3d')];_0x4ceb74+=0x1){let _0x455145=_0x13633b[_0x4ceb74];for(var _0x2bf0a1=0x0;_0x2bf0a1<_0x455145['Agents'][_0x1d29('0x3d')];_0x2bf0a1+=0x1){let _0x23592f=_0x455145[_0x1d29('0x69')][_0x2bf0a1];var _0x371cf3=_0x2a20e6[_0x1d29('0x79')]();_0x371cf3[_0x1d29('0x42')](_0x1d29('0x7a'),_0x23592f['id']);_0x2d0f4b[_0x1d29('0x7b')](db[_0x1d29('0x6c')][_0x1d29('0x38')](_0x371cf3[_0x1d29('0x7c')](),{'type':db[_0x1d29('0x6c')][_0x1d29('0x7d')][_0x1d29('0x7e')]})[_0x1d29('0x29')](function(_0x5a80a0){if(_0x5a80a0['length']===0x1){return _0x23592f['id'];}else{var _0x2e4948=_[_0x1d29('0x7f')](_[_0x1d29('0x32')](_0x5a80a0,_0x1d29('0x80')),function(_0x5973d1){return _['includes'](_0x23c7c0,_0x5973d1);});if(_0x2e4948){return _0x23592f['id'];}}}));}}return BPromise[_0x1d29('0x81')](_0x2d0f4b)[_0x1d29('0x29')](function(_0x294b60){_0x4e980c=_(_0x4e980c)['union'](_0x294b60)[_0x1d29('0x82')]()[_0x1d29('0x83')]();return db['OpenchannelQueue'][_0x1d29('0x4f')]({'where':{'id':_0x5df8ff[_0x1d29('0x5a')]['id']}})[_0x1d29('0x29')](function(_0x3ca09f){return db['sequelize'][_0x1d29('0x84')](function(_0x57c5aa){return _0x3ca09f['removeTeams'](_0x5df8ff['query']['ids'],{'transaction':_0x57c5aa})['then'](function(){if(!_[_0x1d29('0x85')](_0x4e980c)){return _0x3ca09f[_0x1d29('0x86')](_0x4e980c,{'transaction':_0x57c5aa});}})[_0x1d29('0x29')](function(){_0x4e980c[_0x1d29('0x6f')](function(_0x120012){socket[_0x1d29('0x70')](_0x1d29('0x87'),{'UserId':_0x120012,'OpenchannelQueueId':_0x3ca09f['id']});});});});});});})[_0x1d29('0x29')](respondWithStatusCode(_0x96568a,null))[_0x1d29('0x4d')](handleError(_0x96568a,null));};exports[_0x1d29('0x88')]=function(_0x5be89e,_0x554bf0,_0x82f77b){return db['OpenchannelQueue']['find']({'where':{'id':_0x5be89e['params']['id']}})[_0x1d29('0x29')](handleEntityNotFound(_0x554bf0,null))[_0x1d29('0x29')](function(_0x849b24){if(_0x849b24){return _0x849b24[_0x1d29('0x88')](_0x5be89e[_0x1d29('0x50')]['ids'],_['omit'](_0x5be89e[_0x1d29('0x50')],['ids','id'])||{})[_0x1d29('0x89')](function(_0x590a1b){for(var _0x397d2d=0x0;_0x397d2d<_0x5be89e[_0x1d29('0x50')][_0x1d29('0x68')][_0x1d29('0x3d')];_0x397d2d+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x5be89e['body'][_0x1d29('0x68')][_0x397d2d]),'OpenchannelQueueId':Number(_0x5be89e['params']['id'])});}return _0x590a1b;});}})['then'](respondWithResult(_0x554bf0,null))[_0x1d29('0x4d')](handleError(_0x554bf0,null));};exports[_0x1d29('0x86')]=function(_0x194386,_0x5adbf6,_0x1526ee){return db[_0x1d29('0x49')][_0x1d29('0x4f')]({'where':{'id':_0x194386[_0x1d29('0x5a')]['id']}})[_0x1d29('0x29')](handleEntityNotFound(_0x5adbf6,null))['then'](function(_0xa6706c){if(_0xa6706c){return _0xa6706c[_0x1d29('0x86')](_0x194386['query']['ids'])[_0x1d29('0x29')](function(){if(_[_0x1d29('0x8a')](_0x194386[_0x1d29('0x38')]['ids'])){for(var _0x52eb1e=0x0;_0x52eb1e<_0x194386[_0x1d29('0x38')]['ids'][_0x1d29('0x3d')];_0x52eb1e+=0x1){socket[_0x1d29('0x70')](_0x1d29('0x87'),{'UserId':Number(_0x194386[_0x1d29('0x38')][_0x1d29('0x68')][_0x52eb1e]),'OpenchannelQueueId':Number(_0x194386[_0x1d29('0x5a')]['id'])});}}else{socket[_0x1d29('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x194386[_0x1d29('0x38')]['ids']),'OpenchannelQueueId':Number(_0x194386[_0x1d29('0x5a')]['id'])});}});}})[_0x1d29('0x29')](respondWithStatusCode(_0x5adbf6,null))[_0x1d29('0x4d')](handleError(_0x5adbf6,null));};exports[_0x1d29('0x8b')]=function(_0x43ac22,_0x3f4eaa,_0x107f99){var _0x33cc2c={};var _0x41d1b1={};var _0x1be51f;var _0x121549;return db[_0x1d29('0x49')][_0x1d29('0x8c')]({'where':{'id':_0x43ac22['params']['id']}})[_0x1d29('0x29')](handleEntityNotFound(_0x3f4eaa,null))[_0x1d29('0x29')](function(_0x4cf9ba){if(_0x4cf9ba){_0x1be51f=_0x4cf9ba;_0x41d1b1[_0x1d29('0x37')]=_['keys'](db[_0x1d29('0x5d')][_0x1d29('0x33')]);_0x41d1b1[_0x1d29('0x38')]=_[_0x1d29('0x39')](_0x43ac22[_0x1d29('0x38')]);_0x41d1b1[_0x1d29('0x43')]=_[_0x1d29('0x3a')](_0x41d1b1[_0x1d29('0x37')],_0x41d1b1['query']);_0x33cc2c[_0x1d29('0x3c')]=_[_0x1d29('0x3a')](_0x41d1b1[_0x1d29('0x37')],qs[_0x1d29('0x3b')](_0x43ac22['query'][_0x1d29('0x3b')]));_0x33cc2c[_0x1d29('0x3c')]=_0x33cc2c[_0x1d29('0x3c')][_0x1d29('0x3d')]?_0x33cc2c['attributes']:_0x41d1b1[_0x1d29('0x37')];_0x33cc2c[_0x1d29('0x40')]=qs[_0x1d29('0x41')](_0x43ac22[_0x1d29('0x38')][_0x1d29('0x41')]);_0x33cc2c[_0x1d29('0x42')]=qs[_0x1d29('0x43')](_[_0x1d29('0x44')](_0x43ac22['query'],_0x41d1b1[_0x1d29('0x43')]));if(_0x43ac22[_0x1d29('0x38')][_0x1d29('0x47')]){_0x33cc2c[_0x1d29('0x42')]=_[_0x1d29('0x45')](_0x33cc2c['where'],{'$or':_[_0x1d29('0x32')](_0x33cc2c[_0x1d29('0x3c')],function(_0x307b32){var _0x13f045={};_0x13f045[_0x307b32]={'$like':'%'+_0x43ac22[_0x1d29('0x38')][_0x1d29('0x47')]+'%'};return _0x13f045;})});}_0x33cc2c=_[_0x1d29('0x45')]({},_0x33cc2c,_0x43ac22[_0x1d29('0x48')]);return _0x1be51f[_0x1d29('0x8b')](_0x33cc2c);}})[_0x1d29('0x29')](function(_0x4d8dbc){if(_0x4d8dbc){_0x121549=_0x4d8dbc['length'];if(!_0x43ac22[_0x1d29('0x38')]['hasOwnProperty'](_0x1d29('0x3f'))){_0x33cc2c[_0x1d29('0x22')]=qs[_0x1d29('0x22')](_0x43ac22[_0x1d29('0x38')][_0x1d29('0x22')]);_0x33cc2c[_0x1d29('0x1f')]=qs[_0x1d29('0x1f')](_0x43ac22[_0x1d29('0x38')]['offset']);}return _0x1be51f[_0x1d29('0x8b')](_0x33cc2c);}})[_0x1d29('0x29')](function(_0x453435){if(_0x453435){return _0x453435?{'count':_0x121549,'rows':_0x453435}:null;}})[_0x1d29('0x29')](respondWithResult(_0x3f4eaa,null))['catch'](handleError(_0x3f4eaa,null));};
\ No newline at end of file
index 01bdb10..9277219 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb663=['events','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2516dd,_0x22485c){var _0x5e4657=function(_0x549584){while(--_0x549584){_0x2516dd['push'](_0x2516dd['shift']());}};_0x5e4657(++_0x22485c);}(_0xb663,0x1ef));var _0x3b66=function(_0x3ecc30,_0x75412b){_0x3ecc30=_0x3ecc30-0x0;var _0x2682bc=_0xb663[_0x3ecc30];return _0x2682bc;};'use strict';var EventEmitter=require(_0x3b66('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x3b66('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3b66('0x2')](0x0);var events={'afterCreate':_0x3b66('0x3'),'afterUpdate':_0x3b66('0x4'),'afterDestroy':_0x3b66('0x5')};function emitEvent(_0x214a5f){return function(_0x3761ed,_0x112d01,_0x254959){OpenchannelQueueEvents[_0x3b66('0x6')](_0x214a5f+':'+_0x3761ed['id'],_0x3761ed);OpenchannelQueueEvents[_0x3b66('0x6')](_0x214a5f,_0x3761ed);_0x254959(null);};}for(var e in events){if(events[_0x3b66('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x3b66('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x52b1=['hook','exports','events','OpenchannelQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x39db8f,_0x51bf7b){var _0x5f0af6=function(_0x1cd443){while(--_0x1cd443){_0x39db8f['push'](_0x39db8f['shift']());}};_0x5f0af6(++_0x51bf7b);}(_0x52b1,0x9b));var _0x152b=function(_0xfd2451,_0x81ba11){_0xfd2451=_0xfd2451-0x0;var _0x515a6f=_0x52b1[_0xfd2451];return _0x515a6f;};'use strict';var EventEmitter=require(_0x152b('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x152b('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x152b('0x2'),'afterUpdate':_0x152b('0x3'),'afterDestroy':_0x152b('0x4')};function emitEvent(_0x1e619d){return function(_0x4c3797,_0x3913b3,_0x51fffb){OpenchannelQueueEvents[_0x152b('0x5')](_0x1e619d+':'+_0x4c3797['id'],_0x4c3797);OpenchannelQueueEvents[_0x152b('0x5')](_0x1e619d,_0x4c3797);_0x51fffb(null);};}for(var e in events){if(events[_0x152b('0x6')](e)){var event=events[e];OpenchannelQueue[_0x152b('0x7')](e,emitEvent(event));}}module[_0x152b('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
index e52d6d4..8cfdd86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e17=['exports','define','OpenchannelQueue','openchannel_queues','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x2fef7c,_0x1e72c9){var _0x3a6212=function(_0x5f27a7){while(--_0x5f27a7){_0x2fef7c['push'](_0x2fef7c['shift']());}};_0x3a6212(++_0x1e72c9);}(_0x0e17,0x94));var _0x70e1=function(_0x76f11,_0x5552a6){_0x76f11=_0x76f11-0x0;var _0x9d69c1=_0x0e17[_0x76f11];return _0x9d69c1;};'use strict';var _=require('lodash');var util=require(_0x70e1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x70e1('0x1'));var BPromise=require(_0x70e1('0x2'));var rp=require(_0x70e1('0x3'));var fs=require('fs');var path=require(_0x70e1('0x4'));var rimraf=require(_0x70e1('0x5'));var config=require(_0x70e1('0x6'));var attributes=require(_0x70e1('0x7'));module[_0x70e1('0x8')]=function(_0xcc3f9c,_0x8c1dd9){return _0xcc3f9c[_0x70e1('0x9')](_0x70e1('0xa'),attributes,{'tableName':_0x70e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda35=['./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x28f87f,_0x301a84){var _0x286526=function(_0x1c5717){while(--_0x1c5717){_0x28f87f['push'](_0x28f87f['shift']());}};_0x286526(++_0x301a84);}(_0xda35,0x1f2));var _0x5da3=function(_0x353598,_0x33e234){_0x353598=_0x353598-0x0;var _0x4cf82e=_0xda35[_0x353598];return _0x4cf82e;};'use strict';var _=require(_0x5da3('0x0'));var util=require(_0x5da3('0x1'));var logger=require(_0x5da3('0x2'))(_0x5da3('0x3'));var moment=require(_0x5da3('0x4'));var BPromise=require(_0x5da3('0x5'));var rp=require(_0x5da3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5da3('0x7'));var config=require(_0x5da3('0x8'));var attributes=require(_0x5da3('0x9'));module['exports']=function(_0x58778e,_0x30c434){return _0x58778e[_0x5da3('0xa')](_0x5da3('0xb'),attributes,{'tableName':_0x5da3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26b7a09..6cfcd6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9df0=['findAll','options','limit','include','map','model','stringify','ShowOpenchannelQueue','OpenchannelQueue','find','raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetOpenchannelQueue'];(function(_0x475828,_0x47dfbe){var _0x344b6a=function(_0x5e7714){while(--_0x5e7714){_0x475828['push'](_0x475828['shift']());}};_0x344b6a(++_0x47dfbe);}(_0x9df0,0x1da));var _0x09df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9df0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x09df('0x0'));var moment=require(_0x09df('0x1'));var BPromise=require(_0x09df('0x2'));var rs=require(_0x09df('0x3'));var fs=require('fs');var Redis=require(_0x09df('0x4'));var db=require(_0x09df('0x5'))['db'];var utils=require(_0x09df('0x6'));var logger=require(_0x09df('0x7'))(_0x09df('0x8'));var config=require('../../config/environment');var jayson=require(_0x09df('0x9'));var client=jayson[_0x09df('0xa')][_0x09df('0xb')]({'port':0x232a});config[_0x09df('0xc')]=_[_0x09df('0xd')](config[_0x09df('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x09df('0xe'))(new Redis(config[_0x09df('0xc')]));require(_0x09df('0xf'))[_0x09df('0x10')](socket);function respondWithRpcPromise(_0x13e2b2,_0x4d329f,_0x294fe9){return new BPromise(function(_0x2972b2,_0xc61dad){return client[_0x09df('0x11')](_0x13e2b2,_0x294fe9)[_0x09df('0x12')](function(_0x49e666){logger['info'](_0x09df('0x13'),_0x4d329f,_0x09df('0x14'));logger[_0x09df('0x15')](_0x09df('0x16'),_0x4d329f,'request\x20sent',JSON['stringify'](_0x49e666));if(_0x49e666[_0x09df('0x17')]){if(_0x49e666[_0x09df('0x17')][_0x09df('0x18')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4d329f,_0x49e666[_0x09df('0x17')][_0x09df('0x19')]);return _0xc61dad(_0x49e666[_0x09df('0x17')][_0x09df('0x19')]);}logger[_0x09df('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x4d329f,_0x49e666[_0x09df('0x17')]['message']);return _0x2972b2(_0x49e666[_0x09df('0x17')][_0x09df('0x19')]);}else{logger[_0x09df('0x1a')](_0x09df('0x13'),_0x4d329f,'request\x20sent');_0x2972b2(_0x49e666[_0x09df('0x1b')][_0x09df('0x19')]);}})[_0x09df('0x1c')](function(_0x25766d){logger[_0x09df('0x17')](_0x09df('0x13'),_0x4d329f,_0x25766d);_0xc61dad(_0x25766d);});});}exports[_0x09df('0x1d')]=function(_0x4b0ece){var _0x53efd1=this;return new Promise(function(_0x13b6bb,_0x1c718c){return db['OpenchannelQueue'][_0x09df('0x1e')]({'raw':_0x4b0ece[_0x09df('0x1f')]?_0x4b0ece['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b0ece[_0x09df('0x1f')]?_0x4b0ece[_0x09df('0x1f')]['where']||null:null,'attributes':_0x4b0ece['options']?_0x4b0ece[_0x09df('0x1f')]['attributes']||null:null,'limit':_0x4b0ece[_0x09df('0x1f')]?_0x4b0ece[_0x09df('0x1f')][_0x09df('0x20')]||null:null,'include':_0x4b0ece[_0x09df('0x1f')]?_0x4b0ece[_0x09df('0x1f')][_0x09df('0x21')]?_[_0x09df('0x22')](_0x4b0ece[_0x09df('0x1f')]['include'],function(_0x975f60){return{'model':db[_0x975f60['model']],'as':_0x975f60['as'],'attributes':_0x975f60['attributes'],'include':_0x975f60['include']?_[_0x09df('0x22')](_0x975f60[_0x09df('0x21')],function(_0x40606b){return{'model':db[_0x40606b[_0x09df('0x23')]],'as':_0x40606b['as'],'attributes':_0x40606b['attributes'],'include':_0x40606b[_0x09df('0x21')]?_[_0x09df('0x22')](_0x40606b[_0x09df('0x21')],function(_0x1d2d93){return{'model':db[_0x1d2d93[_0x09df('0x23')]],'as':_0x1d2d93['as'],'attributes':_0x1d2d93['attributes']};}):[]};}):[]};}):[]:[]})[_0x09df('0x12')](function(_0x34201c){logger[_0x09df('0x1a')](_0x09df('0x1d'),_0x4b0ece);logger['debug'](_0x09df('0x1d'),_0x4b0ece,JSON[_0x09df('0x24')](_0x34201c));_0x13b6bb(_0x34201c);})['catch'](function(_0x476c1e){logger[_0x09df('0x17')]('GetOpenchannelQueue',_0x476c1e[_0x09df('0x19')],_0x4b0ece);_0x1c718c(_0x53efd1[_0x09df('0x17')](0x1f4,_0x476c1e[_0x09df('0x19')]));});});};exports[_0x09df('0x25')]=function(_0x22ba89){var _0x296ab3=this;return new Promise(function(_0x31091e,_0x26eadb){return db[_0x09df('0x26')][_0x09df('0x27')]({'raw':_0x22ba89[_0x09df('0x1f')]?_0x22ba89[_0x09df('0x1f')][_0x09df('0x28')]===undefined?!![]:![]:!![],'where':_0x22ba89[_0x09df('0x1f')]?_0x22ba89[_0x09df('0x1f')][_0x09df('0x29')]||null:null,'attributes':_0x22ba89[_0x09df('0x1f')]?_0x22ba89[_0x09df('0x1f')]['attributes']||null:null,'include':_0x22ba89[_0x09df('0x1f')]?_0x22ba89['options'][_0x09df('0x21')]?_[_0x09df('0x22')](_0x22ba89['options'][_0x09df('0x21')],function(_0x1fc6bc){return{'model':db[_0x1fc6bc[_0x09df('0x23')]],'as':_0x1fc6bc['as'],'attributes':_0x1fc6bc['attributes'],'include':_0x1fc6bc[_0x09df('0x21')]?_[_0x09df('0x22')](_0x1fc6bc[_0x09df('0x21')],function(_0x2620db){return{'model':db[_0x2620db['model']],'as':_0x2620db['as'],'attributes':_0x2620db['attributes'],'include':_0x2620db['include']?_[_0x09df('0x22')](_0x2620db[_0x09df('0x21')],function(_0x20aae6){return{'model':db[_0x20aae6[_0x09df('0x23')]],'as':_0x20aae6['as'],'attributes':_0x20aae6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a42c5){logger['info']('ShowOpenchannelQueue',_0x22ba89);logger[_0x09df('0x15')](_0x09df('0x25'),_0x22ba89,JSON['stringify'](_0x3a42c5));_0x31091e(_0x3a42c5);})[_0x09df('0x1c')](function(_0x49f7fa){logger[_0x09df('0x17')](_0x09df('0x25'),_0x49f7fa['message'],_0x22ba89);_0x26eadb(_0x296ab3[_0x09df('0x17')](0x1f4,_0x49f7fa['message']));});});};
\ No newline at end of file
+var _0x0ae6=['./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','map','GetOpenchannelQueue','ShowOpenchannelQueue','debug','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x0ae6,0x1bc));var _0x60ae=function(_0xd42b21,_0x44d66a){_0xd42b21=_0xd42b21-0x0;var _0x273072=_0x0ae6[_0xd42b21];return _0x273072;};'use strict';var _=require('lodash');var util=require(_0x60ae('0x0'));var moment=require(_0x60ae('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60ae('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x60ae('0x3'));var logger=require(_0x60ae('0x4'))(_0x60ae('0x5'));var config=require('../../config/environment');var jayson=require(_0x60ae('0x6'));var client=jayson['client'][_0x60ae('0x7')]({'port':0x232a});config[_0x60ae('0x8')]=_[_0x60ae('0x9')](config[_0x60ae('0x8')],{'host':_0x60ae('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x60ae('0x8')]));require(_0x60ae('0xb'))['register'](socket);function respondWithRpcPromise(_0xb22c56,_0x4ed625,_0x44a337){return new BPromise(function(_0x51de75,_0x1a7140){return client[_0x60ae('0xc')](_0xb22c56,_0x44a337)[_0x60ae('0xd')](function(_0x433801){logger[_0x60ae('0xe')](_0x60ae('0xf'),_0x4ed625,_0x60ae('0x10'));logger['debug'](_0x60ae('0x11'),_0x4ed625,_0x60ae('0x10'),JSON[_0x60ae('0x12')](_0x433801));if(_0x433801[_0x60ae('0x13')]){if(_0x433801['error'][_0x60ae('0x14')]===0x1f4){logger[_0x60ae('0x13')](_0x60ae('0xf'),_0x4ed625,_0x433801[_0x60ae('0x13')]['message']);return _0x1a7140(_0x433801['error'][_0x60ae('0x15')]);}logger[_0x60ae('0x13')](_0x60ae('0xf'),_0x4ed625,_0x433801[_0x60ae('0x13')][_0x60ae('0x15')]);return _0x51de75(_0x433801['error']['message']);}else{logger[_0x60ae('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x4ed625,'request\x20sent');_0x51de75(_0x433801['result'][_0x60ae('0x15')]);}})[_0x60ae('0x16')](function(_0x57c07f){logger['error'](_0x60ae('0xf'),_0x4ed625,_0x57c07f);_0x1a7140(_0x57c07f);});});}exports['GetOpenchannelQueue']=function(_0x2260a4){var _0x16f18b=this;return new Promise(function(_0x19a2e6,_0x3696a9){return db[_0x60ae('0x17')][_0x60ae('0x18')]({'raw':_0x2260a4['options']?_0x2260a4[_0x60ae('0x19')][_0x60ae('0x1a')]===undefined?!![]:![]:!![],'where':_0x2260a4[_0x60ae('0x19')]?_0x2260a4[_0x60ae('0x19')][_0x60ae('0x1b')]||null:null,'attributes':_0x2260a4[_0x60ae('0x19')]?_0x2260a4['options'][_0x60ae('0x1c')]||null:null,'limit':_0x2260a4['options']?_0x2260a4['options']['limit']||null:null,'include':_0x2260a4[_0x60ae('0x19')]?_0x2260a4[_0x60ae('0x19')]['include']?_['map'](_0x2260a4[_0x60ae('0x19')][_0x60ae('0x1d')],function(_0x4ad4da){return{'model':db[_0x4ad4da[_0x60ae('0x1e')]],'as':_0x4ad4da['as'],'attributes':_0x4ad4da['attributes'],'include':_0x4ad4da[_0x60ae('0x1d')]?_[_0x60ae('0x1f')](_0x4ad4da[_0x60ae('0x1d')],function(_0x312671){return{'model':db[_0x312671[_0x60ae('0x1e')]],'as':_0x312671['as'],'attributes':_0x312671['attributes'],'include':_0x312671[_0x60ae('0x1d')]?_[_0x60ae('0x1f')](_0x312671['include'],function(_0x36b6e5){return{'model':db[_0x36b6e5[_0x60ae('0x1e')]],'as':_0x36b6e5['as'],'attributes':_0x36b6e5[_0x60ae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x60ae('0xd')](function(_0x457831){logger['info'](_0x60ae('0x20'),_0x2260a4);logger['debug'](_0x60ae('0x20'),_0x2260a4,JSON[_0x60ae('0x12')](_0x457831));_0x19a2e6(_0x457831);})['catch'](function(_0x35de33){logger[_0x60ae('0x13')](_0x60ae('0x20'),_0x35de33['message'],_0x2260a4);_0x3696a9(_0x16f18b[_0x60ae('0x13')](0x1f4,_0x35de33[_0x60ae('0x15')]));});});};exports[_0x60ae('0x21')]=function(_0x161b64){var _0x49c01b=this;return new Promise(function(_0x569aab,_0x435378){return db[_0x60ae('0x17')]['find']({'raw':_0x161b64[_0x60ae('0x19')]?_0x161b64[_0x60ae('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x161b64[_0x60ae('0x19')]?_0x161b64[_0x60ae('0x19')][_0x60ae('0x1b')]||null:null,'attributes':_0x161b64[_0x60ae('0x19')]?_0x161b64[_0x60ae('0x19')]['attributes']||null:null,'include':_0x161b64[_0x60ae('0x19')]?_0x161b64['options'][_0x60ae('0x1d')]?_[_0x60ae('0x1f')](_0x161b64['options']['include'],function(_0x6dbe39){return{'model':db[_0x6dbe39[_0x60ae('0x1e')]],'as':_0x6dbe39['as'],'attributes':_0x6dbe39[_0x60ae('0x1c')],'include':_0x6dbe39[_0x60ae('0x1d')]?_['map'](_0x6dbe39[_0x60ae('0x1d')],function(_0x3aa267){return{'model':db[_0x3aa267[_0x60ae('0x1e')]],'as':_0x3aa267['as'],'attributes':_0x3aa267[_0x60ae('0x1c')],'include':_0x3aa267[_0x60ae('0x1d')]?_[_0x60ae('0x1f')](_0x3aa267[_0x60ae('0x1d')],function(_0x5ce9d4){return{'model':db[_0x5ce9d4[_0x60ae('0x1e')]],'as':_0x5ce9d4['as'],'attributes':_0x5ce9d4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x26ce9b){logger['info'](_0x60ae('0x21'),_0x161b64);logger[_0x60ae('0x22')](_0x60ae('0x21'),_0x161b64,JSON['stringify'](_0x26ce9b));_0x569aab(_0x26ce9b);})[_0x60ae('0x16')](function(_0x38387a){logger[_0x60ae('0x13')](_0x60ae('0x21'),_0x38387a['message'],_0x161b64);_0x435378(_0x49c01b['error'](0x1f4,_0x38387a['message']));});});};
\ No newline at end of file
index b65b5ac..cb35336 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7839=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x22de09,_0x3db597){var _0x4a13dc=function(_0x2b02eb){while(--_0x2b02eb){_0x22de09['push'](_0x22de09['shift']());}};_0x4a13dc(++_0x3db597);}(_0x7839,0x112));var _0x9783=function(_0x2676ed,_0x58f18a){_0x2676ed=_0x2676ed-0x0;var _0x541d9d=_0x7839[_0x2676ed];return _0x541d9d;};'use strict';var OpenchannelQueueEvents=require(_0x9783('0x0'));var events=[_0x9783('0x1'),_0x9783('0x2'),_0x9783('0x3')];function createListener(_0x396080,_0x1a61e2){return function(_0x28dc43){_0x1a61e2[_0x9783('0x4')](_0x396080,_0x28dc43);};}function removeListener(_0x5069fb,_0x29145e){return function(){OpenchannelQueueEvents[_0x9783('0x5')](_0x5069fb,_0x29145e);};}exports[_0x9783('0x6')]=function(_0x1a2db1){for(var _0x268dee=0x0,_0x5293b3=events[_0x9783('0x7')];_0x268dee<_0x5293b3;_0x268dee++){var _0x45b766=events[_0x268dee];var _0x5465db=createListener(_0x9783('0x8')+_0x45b766,_0x1a2db1);OpenchannelQueueEvents['on'](_0x45b766,_0x5465db);}};
\ No newline at end of file
+var _0xee24=['removeListener','register','./openchannelQueue.events','remove','emit'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xee24,0x14c));var _0x4ee2=function(_0x5d8cd3,_0x1638dd){_0x5d8cd3=_0x5d8cd3-0x0;var _0x804d64=_0xee24[_0x5d8cd3];return _0x804d64;};'use strict';var OpenchannelQueueEvents=require(_0x4ee2('0x0'));var events=['save',_0x4ee2('0x1'),'update'];function createListener(_0x5bc84f,_0xb2c36c){return function(_0x1cf8d9){_0xb2c36c[_0x4ee2('0x2')](_0x5bc84f,_0x1cf8d9);};}function removeListener(_0x393681,_0x38d763){return function(){OpenchannelQueueEvents[_0x4ee2('0x3')](_0x393681,_0x38d763);};}exports[_0x4ee2('0x4')]=function(_0x2161f6){for(var _0x304888=0x0,_0x2b7b27=events['length'];_0x304888<_0x2b7b27;_0x304888++){var _0x1c49f1=events[_0x304888];var _0x4d2763=createListener('openchannelQueue:'+_0x1c49f1,_0x2161f6);OpenchannelQueueEvents['on'](_0x1c49f1,_0x4d2763);}};
\ No newline at end of file
index 6d89e98..cff8d1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd95=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','delete','destroy','exports','multer'];(function(_0x1ce575,_0xbcf48f){var _0x20118a=function(_0x2a44e4){while(--_0x2a44e4){_0x1ce575['push'](_0x1ce575['shift']());}};_0x20118a(++_0xbcf48f);}(_0xfd95,0x1b4));var _0x5fd9=function(_0x1b8725,_0xcef39c){_0x1b8725=_0x1b8725-0x0;var _0x22d133=_0xfd95[_0x1b8725];return _0x22d133;};'use strict';var multer=require(_0x5fd9('0x0'));var util=require(_0x5fd9('0x1'));var path=require('path');var timeout=require(_0x5fd9('0x2'));var express=require(_0x5fd9('0x3'));var router=express[_0x5fd9('0x4')]();var fs_extra=require(_0x5fd9('0x5'));var auth=require(_0x5fd9('0x6'));var interaction=require(_0x5fd9('0x7'));var config=require(_0x5fd9('0x8'));var controller=require(_0x5fd9('0x9'));router[_0x5fd9('0xa')]('/',auth[_0x5fd9('0xb')](),controller[_0x5fd9('0xc')]);router[_0x5fd9('0xa')](_0x5fd9('0xd'),auth[_0x5fd9('0xb')](),controller['describe']);router[_0x5fd9('0xa')](_0x5fd9('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x5fd9('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5fd9('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x5fd9('0x10')](_0x5fd9('0xe'),auth['isAuthenticated'](),controller[_0x5fd9('0x11')]);module[_0x5fd9('0x12')]=router;
\ No newline at end of file
+var _0x57b0=['exports','multer','util','connect-timeout','express','Router','fs-extra','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','delete','destroy'];(function(_0x22651a,_0x131ee8){var _0x518710=function(_0x48c657){while(--_0x48c657){_0x22651a['push'](_0x22651a['shift']());}};_0x518710(++_0x131ee8);}(_0x57b0,0x144));var _0x057b=function(_0x433292,_0x5d4f93){_0x433292=_0x433292-0x0;var _0x10a755=_0x57b0[_0x433292];return _0x10a755;};'use strict';var multer=require(_0x057b('0x0'));var util=require(_0x057b('0x1'));var path=require('path');var timeout=require(_0x057b('0x2'));var express=require(_0x057b('0x3'));var router=express[_0x057b('0x4')]();var fs_extra=require(_0x057b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x057b('0x6'));router[_0x057b('0x7')]('/',auth['isAuthenticated'](),controller[_0x057b('0x8')]);router['get'](_0x057b('0x9'),auth[_0x057b('0xa')](),controller[_0x057b('0xb')]);router['get'](_0x057b('0xc'),auth['isAuthenticated'](),controller[_0x057b('0xd')]);router['post']('/',auth[_0x057b('0xa')](),controller[_0x057b('0xe')]);router[_0x057b('0xf')](_0x057b('0xc'),auth[_0x057b('0xa')](),controller['update']);router[_0x057b('0x10')](_0x057b('0xc'),auth['isAuthenticated'](),controller[_0x057b('0x11')]);module[_0x057b('0x12')]=router;
\ No newline at end of file
index 0ddcbbb..04eb4c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf59=['moment','sequelize','exports','STRING','DATE'];(function(_0xb41123,_0x503175){var _0x110766=function(_0x34043d){while(--_0x34043d){_0xb41123['push'](_0xb41123['shift']());}};_0x110766(++_0x503175);}(_0xaf59,0xdc));var _0x9af5=function(_0x5712f8,_0x17156b){_0x5712f8=_0x5712f8-0x0;var _0x14a364=_0xaf59[_0x5712f8];return _0x14a364;};'use strict';var moment=require(_0x9af5('0x0'));var Sequelize=require(_0x9af5('0x1'));module[_0x9af5('0x2')]={'uniqueid':{'type':Sequelize[_0x9af5('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9af5('0x4')]},'leaveAt':{'type':Sequelize[_0x9af5('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9af5('0x4')]},'reason':{'type':Sequelize[_0x9af5('0x3')]}};
\ No newline at end of file
+var _0x8c52=['STRING','DATE','moment','exports'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x8c52,0x7e));var _0x28c5=function(_0x41bbd7,_0x3041f8){_0x41bbd7=_0x41bbd7-0x0;var _0x116b13=_0x8c52[_0x41bbd7];return _0x116b13;};'use strict';var moment=require(_0x28c5('0x0'));var Sequelize=require('sequelize');module[_0x28c5('0x1')]={'uniqueid':{'type':Sequelize[_0x28c5('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x28c5('0x2')]},'joinAt':{'type':Sequelize[_0x28c5('0x3')]},'leaveAt':{'type':Sequelize[_0x28c5('0x3')]},'acceptAt':{'type':Sequelize[_0x28c5('0x3')]},'exitAt':{'type':Sequelize[_0x28c5('0x3')]},'reason':{'type':Sequelize[_0x28c5('0x2')]}};
\ No newline at end of file
index 73d6be6..8a28032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2de1=['options','includeAll','rows','show','params','include','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','error','name','send','index','OpenchannelQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge'];(function(_0xf4a734,_0x1a4fe7){var _0x10ee33=function(_0x365a59){while(--_0x365a59){_0xf4a734['push'](_0xf4a734['shift']());}};_0x10ee33(++_0x1a4fe7);}(_0x2de1,0x1ee));var _0x12de=function(_0x20173a,_0x6a256){_0x20173a=_0x20173a-0x0;var _0x3064bd=_0x2de1[_0x20173a];return _0x3064bd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x12de('0x0'));var jsonpatch=require(_0x12de('0x1'));var rp=require(_0x12de('0x2'));var moment=require(_0x12de('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x12de('0x4'));var path=require(_0x12de('0x5'));var sox=require('sox');var csv=require(_0x12de('0x6'));var ejs=require(_0x12de('0x7'));var fs=require('fs');var fs_extra=require(_0x12de('0x8'));var _=require(_0x12de('0x9'));var squel=require('squel');var crypto=require(_0x12de('0xa'));var jsforce=require(_0x12de('0xb'));var deskjs=require(_0x12de('0xc'));var toCsv=require('to-csv');var querystring=require(_0x12de('0xd'));var Papa=require('papaparse');var Redis=require(_0x12de('0xe'));var authService=require(_0x12de('0xf'));var qs=require(_0x12de('0x10'));var as=require(_0x12de('0x11'));var hardwareService=require(_0x12de('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x12de('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dc49d,_0x5eafaa){_0x5eafaa=_0x5eafaa||0xcc;return function(_0x3cf3b8){if(_0x3cf3b8){return _0x4dc49d[_0x12de('0x14')](_0x5eafaa);}return _0x4dc49d[_0x12de('0x15')](_0x5eafaa)['end']();};}function respondWithResult(_0x4b7bdb,_0xbcc4fd){_0xbcc4fd=_0xbcc4fd||0xc8;return function(_0x1dd2dc){if(_0x1dd2dc){return _0x4b7bdb[_0x12de('0x15')](_0xbcc4fd)[_0x12de('0x16')](_0x1dd2dc);}};}function respondWithFilteredResult(_0x550e8b,_0x1216a2){return function(_0x231a96){if(_0x231a96){var _0x41a0f8=typeof _0x1216a2['offset']===_0x12de('0x17')&&typeof _0x1216a2['limit']===_0x12de('0x17');var _0x320679=_0x231a96[_0x12de('0x18')];var _0x422595=_0x41a0f8?0x0:_0x1216a2[_0x12de('0x19')];var _0x22233e=_0x41a0f8?_0x231a96[_0x12de('0x18')]:_0x1216a2[_0x12de('0x19')]+_0x1216a2[_0x12de('0x1a')];var _0x42ee36;if(_0x22233e>=_0x320679){_0x22233e=_0x320679;_0x42ee36=0xc8;}else{_0x42ee36=0xce;}_0x550e8b[_0x12de('0x15')](_0x42ee36);return _0x550e8b[_0x12de('0x1b')](_0x12de('0x1c'),_0x422595+'-'+_0x22233e+'/'+_0x320679)['json'](_0x231a96);}return null;};}function patchUpdates(_0x23f123){return function(_0x10d2f7){try{jsonpatch[_0x12de('0x1d')](_0x10d2f7,_0x23f123,!![]);}catch(_0x5defe7){return BPromise[_0x12de('0x1e')](_0x5defe7);}return _0x10d2f7[_0x12de('0x1f')]();};}function saveUpdates(_0x4157bd,_0x3baada){return function(_0x2f0192){if(_0x2f0192){return _0x2f0192['update'](_0x4157bd)[_0x12de('0x20')](function(_0x5b8b63){return _0x5b8b63;});}return null;};}function removeEntity(_0x7db218,_0x10d2e0){return function(_0x1e37ba){if(_0x1e37ba){return _0x1e37ba['destroy']()[_0x12de('0x20')](function(){_0x7db218['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b532f,_0x4021c1){return function(_0x1f959c){if(!_0x1f959c){_0x4b532f[_0x12de('0x14')](0x194);}return _0x1f959c;};}function handleError(_0x457e0e,_0x249d7c){_0x249d7c=_0x249d7c||0x1f4;return function(_0x396eb0){logger[_0x12de('0x21')](_0x396eb0['stack']);if(_0x396eb0[_0x12de('0x22')]){delete _0x396eb0[_0x12de('0x22')];}_0x457e0e['status'](_0x249d7c)[_0x12de('0x23')](_0x396eb0);};}exports[_0x12de('0x24')]=function(_0x391803,_0x234954){var _0x560cbb={},_0x5758de={},_0x5d0ed2={'count':0x0,'rows':[]};var _0x455c66=_['map'](db[_0x12de('0x25')][_0x12de('0x26')],function(_0x584cc9){return{'name':_0x584cc9[_0x12de('0x27')],'type':_0x584cc9[_0x12de('0x28')]['key']};});_0x5758de['model']=_['map'](_0x455c66,_0x12de('0x22'));_0x5758de[_0x12de('0x29')]=_[_0x12de('0x2a')](_0x391803[_0x12de('0x29')]);_0x5758de[_0x12de('0x2b')]=_['intersection'](_0x5758de['model'],_0x5758de[_0x12de('0x29')]);_0x560cbb['attributes']=_[_0x12de('0x2c')](_0x5758de[_0x12de('0x2d')],qs[_0x12de('0x2e')](_0x391803[_0x12de('0x29')][_0x12de('0x2e')]));_0x560cbb[_0x12de('0x2f')]=_0x560cbb[_0x12de('0x2f')][_0x12de('0x30')]?_0x560cbb['attributes']:_0x5758de['model'];if(!_0x391803['query'][_0x12de('0x31')](_0x12de('0x32'))){_0x560cbb[_0x12de('0x1a')]=qs['limit'](_0x391803[_0x12de('0x29')][_0x12de('0x1a')]);_0x560cbb[_0x12de('0x19')]=qs[_0x12de('0x19')](_0x391803[_0x12de('0x29')][_0x12de('0x19')]);}_0x560cbb[_0x12de('0x33')]=qs[_0x12de('0x34')](_0x391803[_0x12de('0x29')]['sort']);_0x560cbb[_0x12de('0x35')]=qs['filters'](_[_0x12de('0x36')](_0x391803[_0x12de('0x29')],_0x5758de[_0x12de('0x2b')]),_0x455c66);if(_0x391803[_0x12de('0x29')][_0x12de('0x37')]){_0x560cbb[_0x12de('0x35')]=_['merge'](_0x560cbb[_0x12de('0x35')],{'$or':_[_0x12de('0x38')](_0x455c66,function(_0x16215c){if(_0x16215c[_0x12de('0x28')]!=='VIRTUAL'){var _0x480414={};_0x480414[_0x16215c[_0x12de('0x22')]]={'$like':'%'+_0x391803[_0x12de('0x29')]['filter']+'%'};return _0x480414;}})});}_0x560cbb=_[_0x12de('0x39')]({},_0x560cbb,_0x391803[_0x12de('0x3a')]);var _0x40983e={'where':_0x560cbb[_0x12de('0x35')]};return db['OpenchannelQueueReport'][_0x12de('0x18')](_0x40983e)[_0x12de('0x20')](function(_0x7b62c3){_0x5d0ed2['count']=_0x7b62c3;if(_0x391803[_0x12de('0x29')][_0x12de('0x3b')]){_0x560cbb['include']=[{'all':!![]}];}return db[_0x12de('0x25')]['findAll'](_0x560cbb);})[_0x12de('0x20')](function(_0xc694d5){_0x5d0ed2[_0x12de('0x3c')]=_0xc694d5;return _0x5d0ed2;})['then'](respondWithFilteredResult(_0x234954,_0x560cbb))['catch'](handleError(_0x234954,null));};exports[_0x12de('0x3d')]=function(_0xc2b645,_0x555484){var _0xc377fb={'raw':!![],'where':{'id':_0xc2b645[_0x12de('0x3e')]['id']}},_0x594819={};_0x594819[_0x12de('0x2d')]=_['keys'](db[_0x12de('0x25')]['rawAttributes']);_0x594819[_0x12de('0x29')]=_[_0x12de('0x2a')](_0xc2b645[_0x12de('0x29')]);_0x594819['filters']=_[_0x12de('0x2c')](_0x594819[_0x12de('0x2d')],_0x594819[_0x12de('0x29')]);_0xc377fb[_0x12de('0x2f')]=_[_0x12de('0x2c')](_0x594819['model'],qs[_0x12de('0x2e')](_0xc2b645['query'][_0x12de('0x2e')]));_0xc377fb[_0x12de('0x2f')]=_0xc377fb[_0x12de('0x2f')][_0x12de('0x30')]?_0xc377fb[_0x12de('0x2f')]:_0x594819['model'];if(_0xc2b645[_0x12de('0x29')]['includeAll']){_0xc377fb[_0x12de('0x3f')]=[{'all':!![]}];}_0xc377fb=_[_0x12de('0x39')]({},_0xc377fb,_0xc2b645[_0x12de('0x3a')]);return db['OpenchannelQueueReport'][_0x12de('0x40')](_0xc377fb)[_0x12de('0x20')](handleEntityNotFound(_0x555484,null))[_0x12de('0x20')](respondWithResult(_0x555484,null))[_0x12de('0x41')](handleError(_0x555484,null));};exports['create']=function(_0x7ef9c9,_0x2c9ee2){return db[_0x12de('0x25')][_0x12de('0x42')](_0x7ef9c9['body'],{})[_0x12de('0x20')](respondWithResult(_0x2c9ee2,0xc9))['catch'](handleError(_0x2c9ee2,null));};exports['update']=function(_0x4f9a10,_0x11f4c6){if(_0x4f9a10[_0x12de('0x43')]['id']){delete _0x4f9a10[_0x12de('0x43')]['id'];}return db[_0x12de('0x25')][_0x12de('0x40')]({'where':{'id':_0x4f9a10['params']['id']}})[_0x12de('0x20')](handleEntityNotFound(_0x11f4c6,null))[_0x12de('0x20')](saveUpdates(_0x4f9a10[_0x12de('0x43')],null))[_0x12de('0x20')](respondWithResult(_0x11f4c6,null))['catch'](handleError(_0x11f4c6,null));};exports['destroy']=function(_0x343cd8,_0x3dbfe0){return db[_0x12de('0x25')][_0x12de('0x40')]({'where':{'id':_0x343cd8[_0x12de('0x3e')]['id']}})[_0x12de('0x20')](handleEntityNotFound(_0x3dbfe0,null))[_0x12de('0x20')](removeEntity(_0x3dbfe0,null))['catch'](handleError(_0x3dbfe0,null));};exports['describe']=function(_0x3f2ec2,_0x51c00c){return db['OpenchannelQueueReport'][_0x12de('0x44')]()[_0x12de('0x20')](respondWithResult(_0x51c00c,null))[_0x12de('0x41')](handleError(_0x51c00c,null));};
\ No newline at end of file
+var _0xf3a0=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0x24033a,_0x448762){var _0x22816e=function(_0x15d930){while(--_0x15d930){_0x24033a['push'](_0x24033a['shift']());}};_0x22816e(++_0x448762);}(_0xf3a0,0x133));var _0x0f3a=function(_0x588783,_0x550af0){_0x588783=_0x588783-0x0;var _0x146ed6=_0xf3a0[_0x588783];return _0x146ed6;};'use strict';var emlformat=require(_0x0f3a('0x0'));var rimraf=require(_0x0f3a('0x1'));var zipdir=require(_0x0f3a('0x2'));var jsonpatch=require(_0x0f3a('0x3'));var rp=require(_0x0f3a('0x4'));var moment=require(_0x0f3a('0x5'));var BPromise=require(_0x0f3a('0x6'));var Mustache=require(_0x0f3a('0x7'));var util=require(_0x0f3a('0x8'));var path=require(_0x0f3a('0x9'));var sox=require(_0x0f3a('0xa'));var csv=require('to-csv');var ejs=require(_0x0f3a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0f3a('0xc'));var crypto=require(_0x0f3a('0xd'));var jsforce=require(_0x0f3a('0xe'));var deskjs=require(_0x0f3a('0xf'));var toCsv=require(_0x0f3a('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0f3a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f3a('0x12'));var hardwareService=require(_0x0f3a('0x13'));var logger=require('../../config/logger')(_0x0f3a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0f3a('0x15'));var db=require(_0x0f3a('0x16'))['db'];function respondWithStatusCode(_0x465c56,_0x330182){_0x330182=_0x330182||0xcc;return function(_0x282c9c){if(_0x282c9c){return _0x465c56[_0x0f3a('0x17')](_0x330182);}return _0x465c56['status'](_0x330182)[_0x0f3a('0x18')]();};}function respondWithResult(_0x8aabc3,_0x887082){_0x887082=_0x887082||0xc8;return function(_0x66d290){if(_0x66d290){return _0x8aabc3['status'](_0x887082)[_0x0f3a('0x19')](_0x66d290);}};}function respondWithFilteredResult(_0x4583cb,_0x133c58){return function(_0x57180a){if(_0x57180a){var _0x2c4e06=typeof _0x133c58['offset']===_0x0f3a('0x1a')&&typeof _0x133c58[_0x0f3a('0x1b')]===_0x0f3a('0x1a');var _0x25d2a5=_0x57180a['count'];var _0x5a9ccc=_0x2c4e06?0x0:_0x133c58[_0x0f3a('0x1c')];var _0x179bd0=_0x2c4e06?_0x57180a[_0x0f3a('0x1d')]:_0x133c58[_0x0f3a('0x1c')]+_0x133c58[_0x0f3a('0x1b')];var _0x375269;if(_0x179bd0>=_0x25d2a5){_0x179bd0=_0x25d2a5;_0x375269=0xc8;}else{_0x375269=0xce;}_0x4583cb[_0x0f3a('0x1e')](_0x375269);return _0x4583cb[_0x0f3a('0x1f')](_0x0f3a('0x20'),_0x5a9ccc+'-'+_0x179bd0+'/'+_0x25d2a5)[_0x0f3a('0x19')](_0x57180a);}return null;};}function patchUpdates(_0x5ce840){return function(_0x1495ed){try{jsonpatch[_0x0f3a('0x21')](_0x1495ed,_0x5ce840,!![]);}catch(_0x1c8649){return BPromise[_0x0f3a('0x22')](_0x1c8649);}return _0x1495ed[_0x0f3a('0x23')]();};}function saveUpdates(_0x3a05b9,_0x1a0b1f){return function(_0x26c936){if(_0x26c936){return _0x26c936[_0x0f3a('0x24')](_0x3a05b9)[_0x0f3a('0x25')](function(_0x71f8aa){return _0x71f8aa;});}return null;};}function removeEntity(_0x464709,_0x4f07eb){return function(_0xff2608){if(_0xff2608){return _0xff2608[_0x0f3a('0x26')]()['then'](function(){_0x464709[_0x0f3a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2e39,_0x396e5d){return function(_0x2f0910){if(!_0x2f0910){_0x5c2e39[_0x0f3a('0x17')](0x194);}return _0x2f0910;};}function handleError(_0x55f345,_0x3e4d80){_0x3e4d80=_0x3e4d80||0x1f4;return function(_0x2afe7e){logger['error'](_0x2afe7e[_0x0f3a('0x27')]);if(_0x2afe7e['name']){delete _0x2afe7e[_0x0f3a('0x28')];}_0x55f345[_0x0f3a('0x1e')](_0x3e4d80)[_0x0f3a('0x29')](_0x2afe7e);};}exports[_0x0f3a('0x2a')]=function(_0x4b271e,_0x3974a1){var _0x38ff2d={},_0x5a5e8c={},_0x46b077={'count':0x0,'rows':[]};var _0x1707da=_[_0x0f3a('0x2b')](db[_0x0f3a('0x2c')][_0x0f3a('0x2d')],function(_0x4f6dbc){return{'name':_0x4f6dbc[_0x0f3a('0x2e')],'type':_0x4f6dbc[_0x0f3a('0x2f')][_0x0f3a('0x30')]};});_0x5a5e8c[_0x0f3a('0x31')]=_[_0x0f3a('0x2b')](_0x1707da,_0x0f3a('0x28'));_0x5a5e8c[_0x0f3a('0x32')]=_[_0x0f3a('0x33')](_0x4b271e['query']);_0x5a5e8c[_0x0f3a('0x34')]=_[_0x0f3a('0x35')](_0x5a5e8c[_0x0f3a('0x31')],_0x5a5e8c[_0x0f3a('0x32')]);_0x38ff2d[_0x0f3a('0x36')]=_[_0x0f3a('0x35')](_0x5a5e8c['model'],qs[_0x0f3a('0x37')](_0x4b271e[_0x0f3a('0x32')]['fields']));_0x38ff2d[_0x0f3a('0x36')]=_0x38ff2d[_0x0f3a('0x36')][_0x0f3a('0x38')]?_0x38ff2d[_0x0f3a('0x36')]:_0x5a5e8c[_0x0f3a('0x31')];if(!_0x4b271e[_0x0f3a('0x32')][_0x0f3a('0x39')](_0x0f3a('0x3a'))){_0x38ff2d[_0x0f3a('0x1b')]=qs[_0x0f3a('0x1b')](_0x4b271e[_0x0f3a('0x32')][_0x0f3a('0x1b')]);_0x38ff2d[_0x0f3a('0x1c')]=qs[_0x0f3a('0x1c')](_0x4b271e['query'][_0x0f3a('0x1c')]);}_0x38ff2d['order']=qs[_0x0f3a('0x3b')](_0x4b271e[_0x0f3a('0x32')][_0x0f3a('0x3b')]);_0x38ff2d[_0x0f3a('0x3c')]=qs[_0x0f3a('0x34')](_[_0x0f3a('0x3d')](_0x4b271e[_0x0f3a('0x32')],_0x5a5e8c['filters']),_0x1707da);if(_0x4b271e['query'][_0x0f3a('0x3e')]){_0x38ff2d[_0x0f3a('0x3c')]=_['merge'](_0x38ff2d[_0x0f3a('0x3c')],{'$or':_[_0x0f3a('0x2b')](_0x1707da,function(_0x106b16){if(_0x106b16[_0x0f3a('0x2f')]!=='VIRTUAL'){var _0x3abd66={};_0x3abd66[_0x106b16[_0x0f3a('0x28')]]={'$like':'%'+_0x4b271e[_0x0f3a('0x32')]['filter']+'%'};return _0x3abd66;}})});}_0x38ff2d=_[_0x0f3a('0x3f')]({},_0x38ff2d,_0x4b271e[_0x0f3a('0x40')]);var _0x5e6cce={'where':_0x38ff2d[_0x0f3a('0x3c')]};return db['OpenchannelQueueReport'][_0x0f3a('0x1d')](_0x5e6cce)['then'](function(_0x33ffce){_0x46b077['count']=_0x33ffce;if(_0x4b271e[_0x0f3a('0x32')]['includeAll']){_0x38ff2d[_0x0f3a('0x41')]=[{'all':!![]}];}return db[_0x0f3a('0x2c')][_0x0f3a('0x42')](_0x38ff2d);})[_0x0f3a('0x25')](function(_0x1e5535){_0x46b077[_0x0f3a('0x43')]=_0x1e5535;return _0x46b077;})[_0x0f3a('0x25')](respondWithFilteredResult(_0x3974a1,_0x38ff2d))[_0x0f3a('0x44')](handleError(_0x3974a1,null));};exports[_0x0f3a('0x45')]=function(_0x52809e,_0x51c82b){var _0x3dac01={'raw':!![],'where':{'id':_0x52809e[_0x0f3a('0x46')]['id']}},_0x424bab={};_0x424bab[_0x0f3a('0x31')]=_[_0x0f3a('0x33')](db[_0x0f3a('0x2c')][_0x0f3a('0x2d')]);_0x424bab[_0x0f3a('0x32')]=_['keys'](_0x52809e[_0x0f3a('0x32')]);_0x424bab[_0x0f3a('0x34')]=_[_0x0f3a('0x35')](_0x424bab[_0x0f3a('0x31')],_0x424bab[_0x0f3a('0x32')]);_0x3dac01['attributes']=_[_0x0f3a('0x35')](_0x424bab[_0x0f3a('0x31')],qs[_0x0f3a('0x37')](_0x52809e[_0x0f3a('0x32')][_0x0f3a('0x37')]));_0x3dac01[_0x0f3a('0x36')]=_0x3dac01[_0x0f3a('0x36')][_0x0f3a('0x38')]?_0x3dac01[_0x0f3a('0x36')]:_0x424bab['model'];if(_0x52809e['query'][_0x0f3a('0x47')]){_0x3dac01['include']=[{'all':!![]}];}_0x3dac01=_[_0x0f3a('0x3f')]({},_0x3dac01,_0x52809e[_0x0f3a('0x40')]);return db[_0x0f3a('0x2c')][_0x0f3a('0x48')](_0x3dac01)['then'](handleEntityNotFound(_0x51c82b,null))[_0x0f3a('0x25')](respondWithResult(_0x51c82b,null))[_0x0f3a('0x44')](handleError(_0x51c82b,null));};exports['create']=function(_0x437b55,_0x51186f){return db[_0x0f3a('0x2c')][_0x0f3a('0x49')](_0x437b55[_0x0f3a('0x4a')],{})[_0x0f3a('0x25')](respondWithResult(_0x51186f,0xc9))['catch'](handleError(_0x51186f,null));};exports[_0x0f3a('0x24')]=function(_0x255406,_0x2c633a){if(_0x255406[_0x0f3a('0x4a')]['id']){delete _0x255406[_0x0f3a('0x4a')]['id'];}return db['OpenchannelQueueReport'][_0x0f3a('0x48')]({'where':{'id':_0x255406[_0x0f3a('0x46')]['id']}})[_0x0f3a('0x25')](handleEntityNotFound(_0x2c633a,null))[_0x0f3a('0x25')](saveUpdates(_0x255406[_0x0f3a('0x4a')],null))[_0x0f3a('0x25')](respondWithResult(_0x2c633a,null))[_0x0f3a('0x44')](handleError(_0x2c633a,null));};exports[_0x0f3a('0x26')]=function(_0x357a96,_0x5d5d0f){return db[_0x0f3a('0x2c')][_0x0f3a('0x48')]({'where':{'id':_0x357a96[_0x0f3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d5d0f,null))['then'](removeEntity(_0x5d5d0f,null))[_0x0f3a('0x44')](handleError(_0x5d5d0f,null));};exports[_0x0f3a('0x4b')]=function(_0x1c6490,_0x47effe){return db[_0x0f3a('0x2c')]['describe']()[_0x0f3a('0x25')](respondWithResult(_0x47effe,null))['catch'](handleError(_0x47effe,null));};
\ No newline at end of file
index c74eced..7295fe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x814b,0x1a2));var _0xb814=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x814b[_0x1e05c1];return _0x15f1ca;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x37ce0a,_0x1ce54a){var _0x473280=function(_0x5b9ea6){while(--_0x5b9ea6){_0x37ce0a['push'](_0x37ce0a['shift']());}};_0x473280(++_0x1ce54a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 8e34afe..82b6b31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30a=['body','debug','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','options','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','CreateOpenchannelQueueReport','create'];(function(_0x182e24,_0x576435){var _0xe623ee=function(_0x4717da){while(--_0x4717da){_0x182e24['push'](_0x182e24['shift']());}};_0xe623ee(++_0x576435);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}exports[_0xaa30('0x15')]=function(_0x540e36){var _0x54fa49=this;return new Promise(function(_0x53f9fd,_0x23ad3b){return db['OpenchannelQueueReport'][_0xaa30('0x16')](_0x540e36[_0xaa30('0x17')],{'raw':_0x540e36['options']?_0x540e36['options']['raw']===undefined?!![]:![]:!![]})[_0xaa30('0xc')](function(_0x3e4f1d){logger[_0xaa30('0xd')](_0xaa30('0x15'),_0x540e36);logger[_0xaa30('0x18')]('CreateOpenchannelQueueReport',_0x540e36,JSON[_0xaa30('0x10')](_0x3e4f1d));_0x53f9fd(_0x3e4f1d);})[_0xaa30('0x19')](function(_0x2e16e7){logger[_0xaa30('0x11')](_0xaa30('0x15'),_0x2e16e7['message'],_0x540e36);_0x23ad3b(_0x54fa49[_0xaa30('0x11')](0x1f4,_0x2e16e7[_0xaa30('0x13')]));});});};exports[_0xaa30('0x1a')]=function(_0x326f84){var _0x57d1ca=this;return new Promise(function(_0x14d7fa,_0x1be54c){return db[_0xaa30('0x1b')][_0xaa30('0x1c')](_0x326f84[_0xaa30('0x17')],{'raw':_0x326f84[_0xaa30('0x1d')]?_0x326f84['options'][_0xaa30('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x326f84[_0xaa30('0x1d')]?_0x326f84['options'][_0xaa30('0x1f')]||null:null,'attributes':_0x326f84['options']?_0x326f84[_0xaa30('0x1d')][_0xaa30('0x20')]||null:null,'limit':_0x326f84[_0xaa30('0x1d')]?_0x326f84[_0xaa30('0x1d')][_0xaa30('0x21')]||null:null})[_0xaa30('0xc')](function(_0x6ff09a){logger[_0xaa30('0xd')](_0xaa30('0x1a'),_0x326f84);logger[_0xaa30('0x18')](_0xaa30('0x1a'),_0x326f84,JSON[_0xaa30('0x10')](_0x6ff09a));_0x14d7fa(_0x6ff09a);})[_0xaa30('0x19')](function(_0x46abb9){logger[_0xaa30('0x11')](_0xaa30('0x1a'),_0x46abb9[_0xaa30('0x13')],_0x326f84);_0x1be54c(_0x57d1ca[_0xaa30('0x11')](0x1f4,_0x46abb9['message']));});});};
\ No newline at end of file
+var _0xdc91=['stringify','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x3773ed,_0x5d5f6c){var _0x46d395=function(_0x27177c){while(--_0x27177c){_0x3773ed['push'](_0x3773ed['shift']());}};_0x46d395(++_0x5d5f6c);}(_0xdc91,0x8b));var _0x1dc9=function(_0x743228,_0x57a0bd){_0x743228=_0x743228-0x0;var _0x4150d8=_0xdc91[_0x743228];return _0x4150d8;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});}exports[_0x1dc9('0x15')]=function(_0x197bcd){var _0x335590=this;return new Promise(function(_0x1e845a,_0x2442d0){return db[_0x1dc9('0x16')][_0x1dc9('0x17')](_0x197bcd[_0x1dc9('0x18')],{'raw':_0x197bcd[_0x1dc9('0x19')]?_0x197bcd[_0x1dc9('0x19')][_0x1dc9('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x49bd5b){logger[_0x1dc9('0xc')]('CreateOpenchannelQueueReport',_0x197bcd);logger['debug']('CreateOpenchannelQueueReport',_0x197bcd,JSON[_0x1dc9('0x10')](_0x49bd5b));_0x1e845a(_0x49bd5b);})[_0x1dc9('0x14')](function(_0x277499){logger[_0x1dc9('0x11')](_0x1dc9('0x15'),_0x277499[_0x1dc9('0x13')],_0x197bcd);_0x2442d0(_0x335590[_0x1dc9('0x11')](0x1f4,_0x277499['message']));});});};exports[_0x1dc9('0x1b')]=function(_0x2a4740){var _0x14181d=this;return new Promise(function(_0x4c6e65,_0x39f3f7){return db[_0x1dc9('0x16')][_0x1dc9('0x1c')](_0x2a4740[_0x1dc9('0x18')],{'raw':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')]['where']||null:null,'attributes':_0x2a4740['options']?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1d')]||null:null,'limit':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1e')]||null:null})[_0x1dc9('0xb')](function(_0x10123d){logger[_0x1dc9('0xc')](_0x1dc9('0x1b'),_0x2a4740);logger['debug'](_0x1dc9('0x1b'),_0x2a4740,JSON[_0x1dc9('0x10')](_0x10123d));_0x4c6e65(_0x10123d);})[_0x1dc9('0x14')](function(_0x2d75bc){logger[_0x1dc9('0x11')](_0x1dc9('0x1b'),_0x2d75bc['message'],_0x2a4740);_0x39f3f7(_0x14181d['error'](0x1f4,_0x2d75bc[_0x1dc9('0x13')]));});});};
\ No newline at end of file
index 9bec2ed..2b68010 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3740=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x5ab971,_0x7d14d2){var _0x2bff4c=function(_0x362be1){while(--_0x362be1){_0x5ab971['push'](_0x5ab971['shift']());}};_0x2bff4c(++_0x7d14d2);}(_0x3740,0x13f));var _0x0374=function(_0x50a448,_0x3d1a4d){_0x50a448=_0x50a448-0x0;var _0x5da8c6=_0x3740[_0x50a448];return _0x5da8c6;};'use strict';var multer=require(_0x0374('0x0'));var util=require(_0x0374('0x1'));var path=require('path');var timeout=require(_0x0374('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0374('0x3'));var auth=require(_0x0374('0x4'));var interaction=require(_0x0374('0x5'));var config=require(_0x0374('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x0374('0x7')]('/',auth[_0x0374('0x8')](),controller['index']);router['get'](_0x0374('0x9'),auth[_0x0374('0x8')](),controller[_0x0374('0xa')]);router['get'](_0x0374('0xb'),auth['isAuthenticated'](),controller[_0x0374('0xc')]);router[_0x0374('0xd')]('/',auth['isAuthenticated'](),controller[_0x0374('0xe')]);router[_0x0374('0xf')](_0x0374('0xb'),auth[_0x0374('0x8')](),controller[_0x0374('0x10')]);router['delete']('/:id',auth[_0x0374('0x8')](),controller[_0x0374('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xb807=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports'];(function(_0x2e6676,_0x16ea98){var _0x233fd5=function(_0x26bacf){while(--_0x26bacf){_0x2e6676['push'](_0x2e6676['shift']());}};_0x233fd5(++_0x16ea98);}(_0xb807,0xab));var _0x7b80=function(_0x50278a,_0x2a68e0){_0x50278a=_0x50278a-0x0;var _0xda665c=_0xb807[_0x50278a];return _0xda665c;};'use strict';var multer=require(_0x7b80('0x0'));var util=require(_0x7b80('0x1'));var path=require(_0x7b80('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b80('0x3'));var router=express[_0x7b80('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7b80('0x5'));var interaction=require(_0x7b80('0x6'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x7b80('0x7')]('/',auth[_0x7b80('0x8')](),controller[_0x7b80('0x9')]);router[_0x7b80('0x7')](_0x7b80('0xa'),auth[_0x7b80('0x8')](),controller[_0x7b80('0xb')]);router[_0x7b80('0x7')](_0x7b80('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7b80('0xd')]('/',auth['isAuthenticated'](),controller[_0x7b80('0xe')]);router[_0x7b80('0xf')](_0x7b80('0xc'),auth[_0x7b80('0x8')](),controller[_0x7b80('0x10')]);router['delete'](_0x7b80('0xc'),auth['isAuthenticated'](),controller[_0x7b80('0x11')]);module[_0x7b80('0x12')]=router;
\ No newline at end of file
index 880d38b..f378f80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0x9bde,0xe1));var _0xe9bd=function(_0x50d7dc,_0x2d7c3d){_0x50d7dc=_0x50d7dc-0x0;var _0x5bd04e=_0x9bde[_0x50d7dc];return _0x5bd04e;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x56caf0,_0x49e8a5){var _0x21eb58=function(_0x16f200){while(--_0x16f200){_0x56caf0['push'](_0x56caf0['shift']());}};_0x21eb58(++_0x49e8a5);}(_0x70e0,0x17b));var _0x070e=function(_0x5877b9,_0x45c19f){_0x5877b9=_0x5877b9-0x0;var _0x23a100=_0x70e0[_0x5877b9];return _0x23a100;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index d56a62a..3a742a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ae=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','set','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','count','include','findAll','rows','show','params','intersection','includeAll','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0xa9ae,0xd3));var _0xea9a=function(_0x15174e,_0x5130dc){_0x15174e=_0x15174e-0x0;var _0x43845f=_0xa9ae[_0x15174e];return _0x43845f;};'use strict';var emlformat=require(_0xea9a('0x0'));var rimraf=require(_0xea9a('0x1'));var zipdir=require(_0xea9a('0x2'));var jsonpatch=require(_0xea9a('0x3'));var rp=require(_0xea9a('0x4'));var moment=require('moment');var BPromise=require(_0xea9a('0x5'));var Mustache=require(_0xea9a('0x6'));var util=require(_0xea9a('0x7'));var path=require(_0xea9a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xea9a('0x9'));var fs=require('fs');var fs_extra=require(_0xea9a('0xa'));var _=require('lodash');var squel=require(_0xea9a('0xb'));var crypto=require('crypto');var jsforce=require(_0xea9a('0xc'));var deskjs=require(_0xea9a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xea9a('0xe'));var Papa=require(_0xea9a('0xf'));var Redis=require(_0xea9a('0x10'));var authService=require(_0xea9a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xea9a('0x12'));var hardwareService=require(_0xea9a('0x13'));var logger=require(_0xea9a('0x14'))(_0xea9a('0x15'));var utils=require(_0xea9a('0x16'));var config=require(_0xea9a('0x17'));var licenseUtil=require(_0xea9a('0x18'));var db=require(_0xea9a('0x19'))['db'];function respondWithStatusCode(_0x10f968,_0x47c004){_0x47c004=_0x47c004||0xcc;return function(_0x3715ca){if(_0x3715ca){return _0x10f968['sendStatus'](_0x47c004);}return _0x10f968['status'](_0x47c004)[_0xea9a('0x1a')]();};}function respondWithResult(_0x230641,_0x4697e9){_0x4697e9=_0x4697e9||0xc8;return function(_0x5845a4){if(_0x5845a4){return _0x230641[_0xea9a('0x1b')](_0x4697e9)[_0xea9a('0x1c')](_0x5845a4);}};}function respondWithFilteredResult(_0xa92686,_0x4d611e){return function(_0x31bb15){if(_0x31bb15){var _0x5d3111=typeof _0x4d611e[_0xea9a('0x1d')]==='undefined'&&typeof _0x4d611e['limit']===_0xea9a('0x1e');var _0xbed80e=_0x31bb15['count'];var _0x8484dd=_0x5d3111?0x0:_0x4d611e[_0xea9a('0x1d')];var _0x5655df=_0x5d3111?_0x31bb15['count']:_0x4d611e['offset']+_0x4d611e['limit'];var _0x1f91e8;if(_0x5655df>=_0xbed80e){_0x5655df=_0xbed80e;_0x1f91e8=0xc8;}else{_0x1f91e8=0xce;}_0xa92686[_0xea9a('0x1b')](_0x1f91e8);return _0xa92686[_0xea9a('0x1f')](_0xea9a('0x20'),_0x8484dd+'-'+_0x5655df+'/'+_0xbed80e)['json'](_0x31bb15);}return null;};}function patchUpdates(_0x598b2a){return function(_0x1d2004){try{jsonpatch['apply'](_0x1d2004,_0x598b2a,!![]);}catch(_0x54687e){return BPromise[_0xea9a('0x21')](_0x54687e);}return _0x1d2004['save']();};}function saveUpdates(_0x3e0d49,_0x341fc3){return function(_0x411289){if(_0x411289){return _0x411289[_0xea9a('0x22')](_0x3e0d49)[_0xea9a('0x23')](function(_0x5ee8d1){return _0x5ee8d1;});}return null;};}function removeEntity(_0x80eb06,_0x4024b0){return function(_0x6ba7f6){if(_0x6ba7f6){return _0x6ba7f6[_0xea9a('0x24')]()['then'](function(){_0x80eb06[_0xea9a('0x1b')](0xcc)[_0xea9a('0x1a')]();});}};}function handleEntityNotFound(_0x1f471a,_0xb23b16){return function(_0x2c39ee){if(!_0x2c39ee){_0x1f471a[_0xea9a('0x25')](0x194);}return _0x2c39ee;};}function handleError(_0x5c4d8a,_0x4ca3db){_0x4ca3db=_0x4ca3db||0x1f4;return function(_0x3dc831){logger[_0xea9a('0x26')](_0x3dc831['stack']);if(_0x3dc831[_0xea9a('0x27')]){delete _0x3dc831['name'];}_0x5c4d8a[_0xea9a('0x1b')](_0x4ca3db)[_0xea9a('0x28')](_0x3dc831);};}exports[_0xea9a('0x29')]=function(_0x71fae8,_0x4c9b50){var _0x3a443f={},_0x2f87b3={},_0x3eb485={'count':0x0,'rows':[]};var _0x95fde2=_[_0xea9a('0x2a')](db['OpenchannelTransferReport'][_0xea9a('0x2b')],function(_0x4bbbb8){return{'name':_0x4bbbb8[_0xea9a('0x2c')],'type':_0x4bbbb8[_0xea9a('0x2d')]['key']};});_0x2f87b3[_0xea9a('0x2e')]=_['map'](_0x95fde2,'name');_0x2f87b3[_0xea9a('0x2f')]=_[_0xea9a('0x30')](_0x71fae8[_0xea9a('0x2f')]);_0x2f87b3[_0xea9a('0x31')]=_['intersection'](_0x2f87b3[_0xea9a('0x2e')],_0x2f87b3['query']);_0x3a443f[_0xea9a('0x32')]=_['intersection'](_0x2f87b3['model'],qs[_0xea9a('0x33')](_0x71fae8[_0xea9a('0x2f')]['fields']));_0x3a443f[_0xea9a('0x32')]=_0x3a443f[_0xea9a('0x32')][_0xea9a('0x34')]?_0x3a443f[_0xea9a('0x32')]:_0x2f87b3[_0xea9a('0x2e')];if(!_0x71fae8[_0xea9a('0x2f')][_0xea9a('0x35')](_0xea9a('0x36'))){_0x3a443f[_0xea9a('0x37')]=qs['limit'](_0x71fae8['query'][_0xea9a('0x37')]);_0x3a443f[_0xea9a('0x1d')]=qs['offset'](_0x71fae8[_0xea9a('0x2f')][_0xea9a('0x1d')]);}_0x3a443f[_0xea9a('0x38')]=qs['sort'](_0x71fae8[_0xea9a('0x2f')][_0xea9a('0x39')]);_0x3a443f[_0xea9a('0x3a')]=qs[_0xea9a('0x31')](_[_0xea9a('0x3b')](_0x71fae8[_0xea9a('0x2f')],_0x2f87b3[_0xea9a('0x31')]),_0x95fde2);if(_0x71fae8[_0xea9a('0x2f')][_0xea9a('0x3c')]){_0x3a443f[_0xea9a('0x3a')]=_[_0xea9a('0x3d')](_0x3a443f[_0xea9a('0x3a')],{'$or':_[_0xea9a('0x2a')](_0x95fde2,function(_0x1d6721){if(_0x1d6721[_0xea9a('0x2d')]!==_0xea9a('0x3e')){var _0x447455={};_0x447455[_0x1d6721[_0xea9a('0x27')]]={'$like':'%'+_0x71fae8['query'][_0xea9a('0x3c')]+'%'};return _0x447455;}})});}_0x3a443f=_[_0xea9a('0x3d')]({},_0x3a443f,_0x71fae8[_0xea9a('0x3f')]);var _0x4de875={'where':_0x3a443f[_0xea9a('0x3a')]};return db[_0xea9a('0x40')][_0xea9a('0x41')](_0x4de875)[_0xea9a('0x23')](function(_0x408771){_0x3eb485[_0xea9a('0x41')]=_0x408771;if(_0x71fae8['query']['includeAll']){_0x3a443f[_0xea9a('0x42')]=[{'all':!![]}];}return db[_0xea9a('0x40')][_0xea9a('0x43')](_0x3a443f);})[_0xea9a('0x23')](function(_0x2cf4ed){_0x3eb485[_0xea9a('0x44')]=_0x2cf4ed;return _0x3eb485;})[_0xea9a('0x23')](respondWithFilteredResult(_0x4c9b50,_0x3a443f))['catch'](handleError(_0x4c9b50,null));};exports[_0xea9a('0x45')]=function(_0xf9e674,_0x21b0b7){var _0x161a70={'raw':!![],'where':{'id':_0xf9e674[_0xea9a('0x46')]['id']}},_0x411d7d={};_0x411d7d[_0xea9a('0x2e')]=_[_0xea9a('0x30')](db[_0xea9a('0x40')]['rawAttributes']);_0x411d7d[_0xea9a('0x2f')]=_[_0xea9a('0x30')](_0xf9e674[_0xea9a('0x2f')]);_0x411d7d[_0xea9a('0x31')]=_[_0xea9a('0x47')](_0x411d7d[_0xea9a('0x2e')],_0x411d7d[_0xea9a('0x2f')]);_0x161a70[_0xea9a('0x32')]=_[_0xea9a('0x47')](_0x411d7d['model'],qs['fields'](_0xf9e674[_0xea9a('0x2f')]['fields']));_0x161a70['attributes']=_0x161a70[_0xea9a('0x32')][_0xea9a('0x34')]?_0x161a70['attributes']:_0x411d7d[_0xea9a('0x2e')];if(_0xf9e674[_0xea9a('0x2f')][_0xea9a('0x48')]){_0x161a70['include']=[{'all':!![]}];}_0x161a70=_[_0xea9a('0x3d')]({},_0x161a70,_0xf9e674[_0xea9a('0x3f')]);return db[_0xea9a('0x40')][_0xea9a('0x49')](_0x161a70)[_0xea9a('0x23')](handleEntityNotFound(_0x21b0b7,null))[_0xea9a('0x23')](respondWithResult(_0x21b0b7,null))[_0xea9a('0x4a')](handleError(_0x21b0b7,null));};exports['create']=function(_0x50af0d,_0x2f5915){return db['OpenchannelTransferReport']['create'](_0x50af0d['body'],{})['then'](respondWithResult(_0x2f5915,0xc9))[_0xea9a('0x4a')](handleError(_0x2f5915,null));};exports[_0xea9a('0x22')]=function(_0x1be7d7,_0x182388){if(_0x1be7d7[_0xea9a('0x4b')]['id']){delete _0x1be7d7[_0xea9a('0x4b')]['id'];}return db[_0xea9a('0x40')]['find']({'where':{'id':_0x1be7d7['params']['id']}})['then'](handleEntityNotFound(_0x182388,null))[_0xea9a('0x23')](saveUpdates(_0x1be7d7[_0xea9a('0x4b')],null))['then'](respondWithResult(_0x182388,null))[_0xea9a('0x4a')](handleError(_0x182388,null));};exports[_0xea9a('0x24')]=function(_0xa8547e,_0x19adf8){return db[_0xea9a('0x40')]['find']({'where':{'id':_0xa8547e[_0xea9a('0x46')]['id']}})['then'](handleEntityNotFound(_0x19adf8,null))[_0xea9a('0x23')](removeEntity(_0x19adf8,null))[_0xea9a('0x4a')](handleError(_0x19adf8,null));};exports[_0xea9a('0x4c')]=function(_0x1990ba,_0x11345d){return db[_0xea9a('0x40')][_0xea9a('0x4c')]()['then'](respondWithResult(_0x11345d,null))[_0xea9a('0x4a')](handleError(_0x11345d,null));};
\ No newline at end of file
+var _0x6c4a=['options','OpenchannelTransferReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0xfae0eb,_0x5c603d){var _0x1b0bdf=function(_0x2f49b6){while(--_0x2f49b6){_0xfae0eb['push'](_0xfae0eb['shift']());}};_0x1b0bdf(++_0x5c603d);}(_0x6c4a,0xb5));var _0xa6c4=function(_0x1a990c,_0x570ceb){_0x1a990c=_0x1a990c-0x0;var _0x4f1eee=_0x6c4a[_0x1a990c];return _0x4f1eee;};'use strict';var emlformat=require(_0xa6c4('0x0'));var rimraf=require(_0xa6c4('0x1'));var zipdir=require(_0xa6c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6c4('0x3'));var moment=require(_0xa6c4('0x4'));var BPromise=require(_0xa6c4('0x5'));var Mustache=require(_0xa6c4('0x6'));var util=require(_0xa6c4('0x7'));var path=require(_0xa6c4('0x8'));var sox=require(_0xa6c4('0x9'));var csv=require(_0xa6c4('0xa'));var ejs=require(_0xa6c4('0xb'));var fs=require('fs');var fs_extra=require(_0xa6c4('0xc'));var _=require(_0xa6c4('0xd'));var squel=require('squel');var crypto=require(_0xa6c4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa6c4('0xf'));var toCsv=require(_0xa6c4('0xa'));var querystring=require(_0xa6c4('0x10'));var Papa=require(_0xa6c4('0x11'));var Redis=require(_0xa6c4('0x12'));var authService=require(_0xa6c4('0x13'));var qs=require(_0xa6c4('0x14'));var as=require(_0xa6c4('0x15'));var hardwareService=require(_0xa6c4('0x16'));var logger=require(_0xa6c4('0x17'))(_0xa6c4('0x18'));var utils=require(_0xa6c4('0x19'));var config=require(_0xa6c4('0x1a'));var licenseUtil=require(_0xa6c4('0x1b'));var db=require(_0xa6c4('0x1c'))['db'];function respondWithStatusCode(_0x2540a9,_0x4aa402){_0x4aa402=_0x4aa402||0xcc;return function(_0x53c23c){if(_0x53c23c){return _0x2540a9[_0xa6c4('0x1d')](_0x4aa402);}return _0x2540a9['status'](_0x4aa402)[_0xa6c4('0x1e')]();};}function respondWithResult(_0x571758,_0x3fe6dc){_0x3fe6dc=_0x3fe6dc||0xc8;return function(_0x3e9b4f){if(_0x3e9b4f){return _0x571758[_0xa6c4('0x1f')](_0x3fe6dc)[_0xa6c4('0x20')](_0x3e9b4f);}};}function respondWithFilteredResult(_0x222d7d,_0x3605c1){return function(_0x1aeed9){if(_0x1aeed9){var _0x48ceab=typeof _0x3605c1[_0xa6c4('0x21')]===_0xa6c4('0x22')&&typeof _0x3605c1[_0xa6c4('0x23')]===_0xa6c4('0x22');var _0x3cf0e2=_0x1aeed9['count'];var _0x36b7a0=_0x48ceab?0x0:_0x3605c1[_0xa6c4('0x21')];var _0x140db3=_0x48ceab?_0x1aeed9[_0xa6c4('0x24')]:_0x3605c1[_0xa6c4('0x21')]+_0x3605c1['limit'];var _0x1f96f4;if(_0x140db3>=_0x3cf0e2){_0x140db3=_0x3cf0e2;_0x1f96f4=0xc8;}else{_0x1f96f4=0xce;}_0x222d7d[_0xa6c4('0x1f')](_0x1f96f4);return _0x222d7d[_0xa6c4('0x25')](_0xa6c4('0x26'),_0x36b7a0+'-'+_0x140db3+'/'+_0x3cf0e2)['json'](_0x1aeed9);}return null;};}function patchUpdates(_0x149fe2){return function(_0x13e9e5){try{jsonpatch[_0xa6c4('0x27')](_0x13e9e5,_0x149fe2,!![]);}catch(_0x3955d3){return BPromise[_0xa6c4('0x28')](_0x3955d3);}return _0x13e9e5[_0xa6c4('0x29')]();};}function saveUpdates(_0x50d641,_0x23bd70){return function(_0x187cd4){if(_0x187cd4){return _0x187cd4[_0xa6c4('0x2a')](_0x50d641)[_0xa6c4('0x2b')](function(_0x305813){return _0x305813;});}return null;};}function removeEntity(_0x13fd33,_0x38d529){return function(_0x2ab0e4){if(_0x2ab0e4){return _0x2ab0e4[_0xa6c4('0x2c')]()[_0xa6c4('0x2b')](function(){_0x13fd33['status'](0xcc)[_0xa6c4('0x1e')]();});}};}function handleEntityNotFound(_0x3a2288,_0x24cf96){return function(_0x525342){if(!_0x525342){_0x3a2288[_0xa6c4('0x1d')](0x194);}return _0x525342;};}function handleError(_0x3fc82d,_0x1a5c89){_0x1a5c89=_0x1a5c89||0x1f4;return function(_0x42116d){logger[_0xa6c4('0x2d')](_0x42116d[_0xa6c4('0x2e')]);if(_0x42116d['name']){delete _0x42116d[_0xa6c4('0x2f')];}_0x3fc82d[_0xa6c4('0x1f')](_0x1a5c89)[_0xa6c4('0x30')](_0x42116d);};}exports[_0xa6c4('0x31')]=function(_0x37c31a,_0x4465e1){var _0x329cbc={},_0x1adda2={},_0x2f7280={'count':0x0,'rows':[]};var _0x50b9d5=_[_0xa6c4('0x32')](db['OpenchannelTransferReport'][_0xa6c4('0x33')],function(_0x55af6b){return{'name':_0x55af6b[_0xa6c4('0x34')],'type':_0x55af6b[_0xa6c4('0x35')][_0xa6c4('0x36')]};});_0x1adda2['model']=_[_0xa6c4('0x32')](_0x50b9d5,_0xa6c4('0x2f'));_0x1adda2[_0xa6c4('0x37')]=_['keys'](_0x37c31a[_0xa6c4('0x37')]);_0x1adda2['filters']=_[_0xa6c4('0x38')](_0x1adda2[_0xa6c4('0x39')],_0x1adda2[_0xa6c4('0x37')]);_0x329cbc[_0xa6c4('0x3a')]=_[_0xa6c4('0x38')](_0x1adda2[_0xa6c4('0x39')],qs[_0xa6c4('0x3b')](_0x37c31a['query'][_0xa6c4('0x3b')]));_0x329cbc[_0xa6c4('0x3a')]=_0x329cbc[_0xa6c4('0x3a')][_0xa6c4('0x3c')]?_0x329cbc[_0xa6c4('0x3a')]:_0x1adda2[_0xa6c4('0x39')];if(!_0x37c31a[_0xa6c4('0x37')][_0xa6c4('0x3d')](_0xa6c4('0x3e'))){_0x329cbc[_0xa6c4('0x23')]=qs[_0xa6c4('0x23')](_0x37c31a[_0xa6c4('0x37')]['limit']);_0x329cbc['offset']=qs[_0xa6c4('0x21')](_0x37c31a[_0xa6c4('0x37')][_0xa6c4('0x21')]);}_0x329cbc[_0xa6c4('0x3f')]=qs['sort'](_0x37c31a[_0xa6c4('0x37')][_0xa6c4('0x40')]);_0x329cbc[_0xa6c4('0x41')]=qs[_0xa6c4('0x42')](_[_0xa6c4('0x43')](_0x37c31a[_0xa6c4('0x37')],_0x1adda2[_0xa6c4('0x42')]),_0x50b9d5);if(_0x37c31a[_0xa6c4('0x37')][_0xa6c4('0x44')]){_0x329cbc[_0xa6c4('0x41')]=_[_0xa6c4('0x45')](_0x329cbc[_0xa6c4('0x41')],{'$or':_[_0xa6c4('0x32')](_0x50b9d5,function(_0x23dbff){if(_0x23dbff[_0xa6c4('0x35')]!==_0xa6c4('0x46')){var _0x223f5f={};_0x223f5f[_0x23dbff[_0xa6c4('0x2f')]]={'$like':'%'+_0x37c31a[_0xa6c4('0x37')][_0xa6c4('0x44')]+'%'};return _0x223f5f;}})});}_0x329cbc=_[_0xa6c4('0x45')]({},_0x329cbc,_0x37c31a[_0xa6c4('0x47')]);var _0x442b1a={'where':_0x329cbc[_0xa6c4('0x41')]};return db[_0xa6c4('0x48')][_0xa6c4('0x24')](_0x442b1a)[_0xa6c4('0x2b')](function(_0x465b99){_0x2f7280[_0xa6c4('0x24')]=_0x465b99;if(_0x37c31a[_0xa6c4('0x37')]['includeAll']){_0x329cbc[_0xa6c4('0x49')]=[{'all':!![]}];}return db[_0xa6c4('0x48')][_0xa6c4('0x4a')](_0x329cbc);})[_0xa6c4('0x2b')](function(_0x577f0d){_0x2f7280[_0xa6c4('0x4b')]=_0x577f0d;return _0x2f7280;})[_0xa6c4('0x2b')](respondWithFilteredResult(_0x4465e1,_0x329cbc))[_0xa6c4('0x4c')](handleError(_0x4465e1,null));};exports[_0xa6c4('0x4d')]=function(_0x13cdab,_0x510c95){var _0x511264={'raw':!![],'where':{'id':_0x13cdab[_0xa6c4('0x4e')]['id']}},_0x4fef04={};_0x4fef04['model']=_['keys'](db[_0xa6c4('0x48')][_0xa6c4('0x33')]);_0x4fef04[_0xa6c4('0x37')]=_['keys'](_0x13cdab[_0xa6c4('0x37')]);_0x4fef04[_0xa6c4('0x42')]=_[_0xa6c4('0x38')](_0x4fef04[_0xa6c4('0x39')],_0x4fef04['query']);_0x511264[_0xa6c4('0x3a')]=_['intersection'](_0x4fef04[_0xa6c4('0x39')],qs[_0xa6c4('0x3b')](_0x13cdab[_0xa6c4('0x37')][_0xa6c4('0x3b')]));_0x511264[_0xa6c4('0x3a')]=_0x511264[_0xa6c4('0x3a')][_0xa6c4('0x3c')]?_0x511264[_0xa6c4('0x3a')]:_0x4fef04[_0xa6c4('0x39')];if(_0x13cdab[_0xa6c4('0x37')][_0xa6c4('0x4f')]){_0x511264[_0xa6c4('0x49')]=[{'all':!![]}];}_0x511264=_[_0xa6c4('0x45')]({},_0x511264,_0x13cdab['options']);return db[_0xa6c4('0x48')][_0xa6c4('0x50')](_0x511264)[_0xa6c4('0x2b')](handleEntityNotFound(_0x510c95,null))[_0xa6c4('0x2b')](respondWithResult(_0x510c95,null))[_0xa6c4('0x4c')](handleError(_0x510c95,null));};exports[_0xa6c4('0x51')]=function(_0x54feaa,_0x5f2ad6){return db[_0xa6c4('0x48')]['create'](_0x54feaa[_0xa6c4('0x52')],{})[_0xa6c4('0x2b')](respondWithResult(_0x5f2ad6,0xc9))['catch'](handleError(_0x5f2ad6,null));};exports[_0xa6c4('0x2a')]=function(_0x1ec86c,_0x4adc45){if(_0x1ec86c[_0xa6c4('0x52')]['id']){delete _0x1ec86c[_0xa6c4('0x52')]['id'];}return db[_0xa6c4('0x48')][_0xa6c4('0x50')]({'where':{'id':_0x1ec86c['params']['id']}})[_0xa6c4('0x2b')](handleEntityNotFound(_0x4adc45,null))[_0xa6c4('0x2b')](saveUpdates(_0x1ec86c['body'],null))['then'](respondWithResult(_0x4adc45,null))['catch'](handleError(_0x4adc45,null));};exports[_0xa6c4('0x2c')]=function(_0x35357e,_0x3ff5a4){return db[_0xa6c4('0x48')][_0xa6c4('0x50')]({'where':{'id':_0x35357e[_0xa6c4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3ff5a4,null))[_0xa6c4('0x2b')](removeEntity(_0x3ff5a4,null))[_0xa6c4('0x4c')](handleError(_0x3ff5a4,null));};exports[_0xa6c4('0x53')]=function(_0x2552be,_0x4b7417){return db[_0xa6c4('0x48')][_0xa6c4('0x53')]()[_0xa6c4('0x2b')](respondWithResult(_0x4b7417,null))[_0xa6c4('0x4c')](handleError(_0x4b7417,null));};
\ No newline at end of file
index c221995..489a2af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92aa=['../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3709e5,_0x4b5b5a){var _0x618a4d=function(_0x2374f6){while(--_0x2374f6){_0x3709e5['push'](_0x3709e5['shift']());}};_0x618a4d(++_0x4b5b5a);}(_0x92aa,0x87));var _0xa92a=function(_0xc5ef81,_0x122611){_0xc5ef81=_0xc5ef81-0x0;var _0x2c46cb=_0x92aa[_0xc5ef81];return _0x2c46cb;};'use strict';var _=require(_0xa92a('0x0'));var util=require(_0xa92a('0x1'));var logger=require(_0xa92a('0x2'))(_0xa92a('0x3'));var moment=require(_0xa92a('0x4'));var BPromise=require(_0xa92a('0x5'));var rp=require(_0xa92a('0x6'));var fs=require('fs');var path=require(_0xa92a('0x7'));var rimraf=require(_0xa92a('0x8'));var config=require(_0xa92a('0x9'));var attributes=require(_0xa92a('0xa'));module[_0xa92a('0xb')]=function(_0x7577a8,_0x164ffa){return _0x7577a8[_0xa92a('0xc')](_0xa92a('0xd'),attributes,{'tableName':_0xa92a('0xe'),'paranoid':![],'indexes':[{'name':_0xa92a('0xf'),'fields':[_0xa92a('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc07b=['exports','define','OpenchannelTransferReport','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x31c926,_0x392f9d){var _0x1ea235=function(_0x2307a8){while(--_0x2307a8){_0x31c926['push'](_0x31c926['shift']());}};_0x1ea235(++_0x392f9d);}(_0xc07b,0x1e5));var _0xbc07=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xc07b[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0xbc07('0x0'));var logger=require('../../config/logger')(_0xbc07('0x1'));var moment=require(_0xbc07('0x2'));var BPromise=require(_0xbc07('0x3'));var rp=require(_0xbc07('0x4'));var fs=require('fs');var path=require(_0xbc07('0x5'));var rimraf=require(_0xbc07('0x6'));var config=require(_0xbc07('0x7'));var attributes=require(_0xbc07('0x8'));module[_0xbc07('0x9')]=function(_0xc50697,_0x310e69){return _0xc50697[_0xbc07('0xa')](_0xbc07('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbc07('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 72195c0..1b4f141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3148=['then','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x242a99,_0x4e7de5){var _0x3387bc=function(_0x173286){while(--_0x173286){_0x242a99['push'](_0x242a99['shift']());}};_0x3387bc(++_0x4e7de5);}(_0x3148,0x1d3));var _0x8314=function(_0x35f78d,_0x91ac69){_0x35f78d=_0x35f78d-0x0;var _0x2e6772=_0x3148[_0x35f78d];return _0x2e6772;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var moment=require('moment');var BPromise=require(_0x8314('0x2'));var rs=require(_0x8314('0x3'));var fs=require('fs');var Redis=require(_0x8314('0x4'));var db=require(_0x8314('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8314('0x6'))(_0x8314('0x7'));var config=require(_0x8314('0x8'));var jayson=require(_0x8314('0x9'));var client=jayson[_0x8314('0xa')][_0x8314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd913,_0x4dd36d,_0x837c1f){return new BPromise(function(_0x4df2b0,_0x35b464){return client[_0x8314('0xc')](_0x1bd913,_0x837c1f)[_0x8314('0xd')](function(_0x357031){logger[_0x8314('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4dd36d,'request\x20sent');logger[_0x8314('0xf')](_0x8314('0x10'),_0x4dd36d,_0x8314('0x11'),JSON[_0x8314('0x12')](_0x357031));if(_0x357031['error']){if(_0x357031[_0x8314('0x13')][_0x8314('0x14')]===0x1f4){logger['error'](_0x8314('0x15'),_0x4dd36d,_0x357031['error']['message']);return _0x35b464(_0x357031[_0x8314('0x13')][_0x8314('0x16')]);}logger[_0x8314('0x13')](_0x8314('0x15'),_0x4dd36d,_0x357031['error'][_0x8314('0x16')]);return _0x4df2b0(_0x357031[_0x8314('0x13')][_0x8314('0x16')]);}else{logger[_0x8314('0xe')](_0x8314('0x15'),_0x4dd36d,_0x8314('0x11'));_0x4df2b0(_0x357031['result']['message']);}})[_0x8314('0x17')](function(_0xf0ad31){logger[_0x8314('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4dd36d,_0xf0ad31);_0x35b464(_0xf0ad31);});});}
\ No newline at end of file
+var _0xf8b2=['code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x26ddb4,_0x10db98){var _0x5eaab7=function(_0x692531){while(--_0x692531){_0x26ddb4['push'](_0x26ddb4['shift']());}};_0x5eaab7(++_0x10db98);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x7f53f,_0x3aaa){_0x7f53f=_0x7f53f-0x0;var _0x17ec85=_0xf8b2[_0x7f53f];return _0x17ec85;};'use strict';var _=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var moment=require(_0x2f8b('0x2'));var BPromise=require(_0x2f8b('0x3'));var rs=require(_0x2f8b('0x4'));var fs=require('fs');var Redis=require(_0x2f8b('0x5'));var db=require(_0x2f8b('0x6'))['db'];var utils=require(_0x2f8b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f8b('0x8'));var jayson=require(_0x2f8b('0x9'));var client=jayson[_0x2f8b('0xa')][_0x2f8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b0511,_0x2cc1e9,_0x449c86){return new BPromise(function(_0x24bd39,_0x366bac){return client['request'](_0x3b0511,_0x449c86)[_0x2f8b('0xc')](function(_0xb352e8){logger[_0x2f8b('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));logger[_0x2f8b('0xf')](_0x2f8b('0x10'),_0x2cc1e9,'request\x20sent',JSON['stringify'](_0xb352e8));if(_0xb352e8[_0x2f8b('0x11')]){if(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x12')]===0x1f4){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8['error'][_0x2f8b('0x14')]);return _0x366bac(_0xb352e8['error'][_0x2f8b('0x14')]);}logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);return _0x24bd39(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);}else{logger[_0x2f8b('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));_0x24bd39(_0xb352e8[_0x2f8b('0x15')][_0x2f8b('0x14')]);}})[_0x2f8b('0x16')](function(_0xa79a7){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xa79a7);_0x366bac(_0xa79a7);});});}
\ No newline at end of file
index 111559d..34cd06e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3db=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x1f66d6,_0x3b2975){var _0x1c46a6=function(_0x4015aa){while(--_0x4015aa){_0x1f66d6['push'](_0x1f66d6['shift']());}};_0x1c46a6(++_0x3b2975);}(_0xe3db,0xc8));var _0xbe3d=function(_0x368ab5,_0x7757f8){_0x368ab5=_0x368ab5-0x0;var _0x1d8fd3=_0xe3db[_0x368ab5];return _0x1d8fd3;};'use strict';var multer=require(_0xbe3d('0x0'));var util=require(_0xbe3d('0x1'));var path=require('path');var timeout=require(_0xbe3d('0x2'));var express=require(_0xbe3d('0x3'));var router=express[_0xbe3d('0x4')]();var fs_extra=require(_0xbe3d('0x5'));var auth=require(_0xbe3d('0x6'));var interaction=require(_0xbe3d('0x7'));var config=require(_0xbe3d('0x8'));var controller=require(_0xbe3d('0x9'));router[_0xbe3d('0xa')]('/',auth[_0xbe3d('0xb')](),controller[_0xbe3d('0xc')]);router['get'](_0xbe3d('0xd'),auth[_0xbe3d('0xb')](),controller[_0xbe3d('0xe')]);router[_0xbe3d('0xf')]('/',auth['isAuthenticated'](),controller[_0xbe3d('0x10')]);router[_0xbe3d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbe3d('0x12')]);router[_0xbe3d('0x13')](_0xbe3d('0xd'),auth[_0xbe3d('0xb')](),controller[_0xbe3d('0x14')]);module[_0xbe3d('0x15')]=router;
\ No newline at end of file
+var _0x433e=['../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3132a3,_0x2db29f){var _0x5a0e4e=function(_0x5b3f4c){while(--_0x5b3f4c){_0x3132a3['push'](_0x3132a3['shift']());}};_0x5a0e4e(++_0x2db29f);}(_0x433e,0xbf));var _0xe433=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x433e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe433('0x0'));var util=require(_0xe433('0x1'));var path=require(_0xe433('0x2'));var timeout=require(_0xe433('0x3'));var express=require(_0xe433('0x4'));var router=express[_0xe433('0x5')]();var fs_extra=require(_0xe433('0x6'));var auth=require(_0xe433('0x7'));var interaction=require(_0xe433('0x8'));var config=require(_0xe433('0x9'));var controller=require(_0xe433('0xa'));router[_0xe433('0xb')]('/',auth[_0xe433('0xc')](),controller[_0xe433('0xd')]);router[_0xe433('0xb')](_0xe433('0xe'),auth[_0xe433('0xc')](),controller[_0xe433('0xf')]);router[_0xe433('0x10')]('/',auth[_0xe433('0xc')](),controller['create']);router[_0xe433('0x11')](_0xe433('0xe'),auth[_0xe433('0xc')](),controller['update']);router[_0xe433('0x12')]('/:id',auth[_0xe433('0xc')](),controller['destroy']);module[_0xe433('0x13')]=router;
\ No newline at end of file
index bc84f5a..79b50e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6a2=['STRING','name','exports'];(function(_0x433d2e,_0x47f0d9){var _0x3bf94a=function(_0x92b7e7){while(--_0x92b7e7){_0x433d2e['push'](_0x433d2e['shift']());}};_0x3bf94a(++_0x47f0d9);}(_0xe6a2,0x71));var _0x2e6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6a2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x2e6a('0x0')]={'name':{'type':Sequelize[_0x2e6a('0x1')],'unique':_0x2e6a('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa556=['name','exports','STRING'];(function(_0x151f07,_0x417419){var _0x289cbb=function(_0x3cb566){while(--_0x3cb566){_0x151f07['push'](_0x151f07['shift']());}};_0x289cbb(++_0x417419);}(_0xa556,0x145));var _0x6a55=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xa556[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require('sequelize');module[_0x6a55('0x0')]={'name':{'type':Sequelize[_0x6a55('0x1')],'unique':_0x6a55('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6a55('0x1')]}};
\ No newline at end of file
index d942496..72eeb65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb370=['lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Pauses','error','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra'];(function(_0x318cad,_0x391cac){var _0x4a7922=function(_0x285f27){while(--_0x285f27){_0x318cad['push'](_0x318cad['shift']());}};_0x4a7922(++_0x391cac);}(_0xb370,0x194));var _0x0b37=function(_0x41325b,_0x448d15){_0x41325b=_0x41325b-0x0;var _0x599f81=_0xb370[_0x41325b];return _0x599f81;};'use strict';var emlformat=require(_0x0b37('0x0'));var rimraf=require(_0x0b37('0x1'));var zipdir=require(_0x0b37('0x2'));var jsonpatch=require(_0x0b37('0x3'));var rp=require(_0x0b37('0x4'));var moment=require(_0x0b37('0x5'));var BPromise=require(_0x0b37('0x6'));var Mustache=require(_0x0b37('0x7'));var util=require(_0x0b37('0x8'));var path=require(_0x0b37('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b37('0xa'));var _=require(_0x0b37('0xb'));var squel=require(_0x0b37('0xc'));var crypto=require(_0x0b37('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0b37('0xe'));var toCsv=require(_0x0b37('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0b37('0x10'));var authService=require(_0x0b37('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0b37('0x12'));var hardwareService=require(_0x0b37('0x13'));var logger=require(_0x0b37('0x14'))(_0x0b37('0x15'));var utils=require(_0x0b37('0x16'));var config=require(_0x0b37('0x17'));var licenseUtil=require(_0x0b37('0x18'));var db=require(_0x0b37('0x19'))['db'];function respondWithStatusCode(_0x9eb8d8,_0x5b253a){_0x5b253a=_0x5b253a||0xcc;return function(_0xa2df77){if(_0xa2df77){return _0x9eb8d8[_0x0b37('0x1a')](_0x5b253a);}return _0x9eb8d8[_0x0b37('0x1b')](_0x5b253a)[_0x0b37('0x1c')]();};}function respondWithResult(_0x57ba1e,_0xd2eddc){_0xd2eddc=_0xd2eddc||0xc8;return function(_0x52a78e){if(_0x52a78e){return _0x57ba1e[_0x0b37('0x1b')](_0xd2eddc)[_0x0b37('0x1d')](_0x52a78e);}};}function respondWithFilteredResult(_0x1141dd,_0x486c40){return function(_0x29b7a0){if(_0x29b7a0){var _0x473d28=typeof _0x486c40[_0x0b37('0x1e')]===_0x0b37('0x1f')&&typeof _0x486c40[_0x0b37('0x20')]==='undefined';var _0x56a2dc=_0x29b7a0['count'];var _0x25f9e5=_0x473d28?0x0:_0x486c40['offset'];var _0x480d6a=_0x473d28?_0x29b7a0[_0x0b37('0x21')]:_0x486c40[_0x0b37('0x1e')]+_0x486c40[_0x0b37('0x20')];var _0x530a64;if(_0x480d6a>=_0x56a2dc){_0x480d6a=_0x56a2dc;_0x530a64=0xc8;}else{_0x530a64=0xce;}_0x1141dd[_0x0b37('0x1b')](_0x530a64);return _0x1141dd[_0x0b37('0x22')](_0x0b37('0x23'),_0x25f9e5+'-'+_0x480d6a+'/'+_0x56a2dc)[_0x0b37('0x1d')](_0x29b7a0);}return null;};}function patchUpdates(_0x3bf7b7){return function(_0xb576ad){try{jsonpatch[_0x0b37('0x24')](_0xb576ad,_0x3bf7b7,!![]);}catch(_0x35e802){return BPromise['reject'](_0x35e802);}return _0xb576ad['save']();};}function saveUpdates(_0x42bdf5,_0x210087){return function(_0x4d666e){if(_0x4d666e){return _0x4d666e[_0x0b37('0x25')](_0x42bdf5)[_0x0b37('0x26')](function(_0x2a4689){return _0x2a4689;});}return null;};}function removeEntity(_0x12a98e,_0x5dd5b7){return function(_0x29ce8b){if(_0x29ce8b){return _0x29ce8b[_0x0b37('0x27')]()[_0x0b37('0x26')](function(){var _0x4fd86c=_0x29ce8b[_0x0b37('0x28')]({'plain':!![]});var _0x13bcea=_0x0b37('0x29');return db['UserProfileResource'][_0x0b37('0x27')]({'where':{'type':_0x13bcea,'resourceId':_0x4fd86c['id']}})[_0x0b37('0x26')](function(){return _0x29ce8b;});})['then'](function(){_0x12a98e[_0x0b37('0x1b')](0xcc)[_0x0b37('0x1c')]();});}};}function handleEntityNotFound(_0xd6ce63,_0x8c789f){return function(_0x115abc){if(!_0x115abc){_0xd6ce63[_0x0b37('0x1a')](0x194);}return _0x115abc;};}function handleError(_0x2bf225,_0x1a4a60){_0x1a4a60=_0x1a4a60||0x1f4;return function(_0x13464e){logger[_0x0b37('0x2a')](_0x13464e['stack']);if(_0x13464e[_0x0b37('0x2b')]){delete _0x13464e[_0x0b37('0x2b')];}_0x2bf225[_0x0b37('0x1b')](_0x1a4a60)[_0x0b37('0x2c')](_0x13464e);};}exports[_0x0b37('0x2d')]=function(_0x5bc09d,_0x3d764c){var _0x99ceda={},_0x5aa5ba={},_0x441721={'count':0x0,'rows':[]};var _0x4d08d2=_[_0x0b37('0x2e')](db[_0x0b37('0x2f')][_0x0b37('0x30')],function(_0x290aa5){return{'name':_0x290aa5[_0x0b37('0x31')],'type':_0x290aa5[_0x0b37('0x32')][_0x0b37('0x33')]};});_0x5aa5ba['model']=_[_0x0b37('0x2e')](_0x4d08d2,_0x0b37('0x2b'));_0x5aa5ba[_0x0b37('0x34')]=_[_0x0b37('0x35')](_0x5bc09d[_0x0b37('0x34')]);_0x5aa5ba['filters']=_['intersection'](_0x5aa5ba[_0x0b37('0x36')],_0x5aa5ba[_0x0b37('0x34')]);_0x99ceda[_0x0b37('0x37')]=_[_0x0b37('0x38')](_0x5aa5ba['model'],qs[_0x0b37('0x39')](_0x5bc09d[_0x0b37('0x34')][_0x0b37('0x39')]));_0x99ceda[_0x0b37('0x37')]=_0x99ceda[_0x0b37('0x37')][_0x0b37('0x3a')]?_0x99ceda[_0x0b37('0x37')]:_0x5aa5ba[_0x0b37('0x36')];if(!_0x5bc09d[_0x0b37('0x34')]['hasOwnProperty']('nolimit')){_0x99ceda[_0x0b37('0x20')]=qs[_0x0b37('0x20')](_0x5bc09d['query']['limit']);_0x99ceda[_0x0b37('0x1e')]=qs[_0x0b37('0x1e')](_0x5bc09d[_0x0b37('0x34')][_0x0b37('0x1e')]);}_0x99ceda['order']=qs['sort'](_0x5bc09d['query'][_0x0b37('0x3b')]);_0x99ceda['where']=qs['filters'](_[_0x0b37('0x3c')](_0x5bc09d['query'],_0x5aa5ba['filters']),_0x4d08d2);if(_0x5bc09d[_0x0b37('0x34')][_0x0b37('0x3d')]){_0x99ceda[_0x0b37('0x3e')]=_[_0x0b37('0x3f')](_0x99ceda[_0x0b37('0x3e')],{'$or':_[_0x0b37('0x2e')](_0x4d08d2,function(_0x49cbdc){if(_0x49cbdc[_0x0b37('0x32')]!=='VIRTUAL'){var _0x1cceeb={};_0x1cceeb[_0x49cbdc[_0x0b37('0x2b')]]={'$like':'%'+_0x5bc09d[_0x0b37('0x34')]['filter']+'%'};return _0x1cceeb;}})});}_0x99ceda=_[_0x0b37('0x3f')]({},_0x99ceda,_0x5bc09d[_0x0b37('0x40')]);var _0x2f1896={'where':_0x99ceda[_0x0b37('0x3e')]};return db[_0x0b37('0x2f')][_0x0b37('0x21')](_0x2f1896)['then'](function(_0xb087bc){_0x441721['count']=_0xb087bc;if(_0x5bc09d[_0x0b37('0x34')][_0x0b37('0x41')]){_0x99ceda[_0x0b37('0x42')]=[{'all':!![]}];}return db[_0x0b37('0x2f')][_0x0b37('0x43')](_0x99ceda);})[_0x0b37('0x26')](function(_0xc38862){_0x441721[_0x0b37('0x44')]=_0xc38862;return _0x441721;})[_0x0b37('0x26')](respondWithFilteredResult(_0x3d764c,_0x99ceda))[_0x0b37('0x45')](handleError(_0x3d764c,null));};exports['show']=function(_0x553946,_0x2fe57e){var _0x1bd1a0={'raw':!![],'where':{'id':_0x553946[_0x0b37('0x46')]['id']}},_0x12f718={};_0x12f718[_0x0b37('0x36')]=_[_0x0b37('0x35')](db[_0x0b37('0x2f')][_0x0b37('0x30')]);_0x12f718[_0x0b37('0x34')]=_['keys'](_0x553946[_0x0b37('0x34')]);_0x12f718[_0x0b37('0x47')]=_[_0x0b37('0x38')](_0x12f718[_0x0b37('0x36')],_0x12f718[_0x0b37('0x34')]);_0x1bd1a0[_0x0b37('0x37')]=_[_0x0b37('0x38')](_0x12f718['model'],qs[_0x0b37('0x39')](_0x553946[_0x0b37('0x34')][_0x0b37('0x39')]));_0x1bd1a0['attributes']=_0x1bd1a0['attributes'][_0x0b37('0x3a')]?_0x1bd1a0['attributes']:_0x12f718[_0x0b37('0x36')];if(_0x553946[_0x0b37('0x34')][_0x0b37('0x41')]){_0x1bd1a0['include']=[{'all':!![]}];}_0x1bd1a0=_[_0x0b37('0x3f')]({},_0x1bd1a0,_0x553946[_0x0b37('0x40')]);return db['Pause'][_0x0b37('0x48')](_0x1bd1a0)[_0x0b37('0x26')](handleEntityNotFound(_0x2fe57e,null))[_0x0b37('0x26')](respondWithResult(_0x2fe57e,null))[_0x0b37('0x45')](handleError(_0x2fe57e,null));};exports[_0x0b37('0x49')]=function(_0x458f2f,_0x4351d2){return db[_0x0b37('0x2f')][_0x0b37('0x49')](_0x458f2f[_0x0b37('0x4a')],{})[_0x0b37('0x26')](function(_0x1b32e4){var _0x20bab8=_0x458f2f[_0x0b37('0x4b')][_0x0b37('0x28')]({'plain':!![]});if(!_0x20bab8)throw new Error(_0x0b37('0x4c'));if(_0x20bab8[_0x0b37('0x4d')]==='user'){var _0x3855fc=_0x1b32e4[_0x0b37('0x28')]({'plain':!![]});var _0x203ecc='Pauses';return db[_0x0b37('0x4e')][_0x0b37('0x48')]({'where':{'name':_0x203ecc,'userProfileId':_0x20bab8[_0x0b37('0x4f')]},'raw':!![]})[_0x0b37('0x26')](function(_0x12de2e){if(_0x12de2e&&_0x12de2e[_0x0b37('0x50')]===0x0){return db[_0x0b37('0x51')]['create']({'name':_0x3855fc['name'],'resourceId':_0x3855fc['id'],'type':_0x12de2e[_0x0b37('0x2b')],'sectionId':_0x12de2e['id']},{})['then'](function(){return _0x1b32e4;});}else{return _0x1b32e4;}})['catch'](function(_0x1f8c58){logger['error'](_0x0b37('0x52'),_0x1f8c58);throw _0x1f8c58;});}return _0x1b32e4;})[_0x0b37('0x26')](respondWithResult(_0x4351d2,0xc9))['catch'](handleError(_0x4351d2,null));};exports[_0x0b37('0x25')]=function(_0x56e5b6,_0x6777a6){if(_0x56e5b6[_0x0b37('0x4a')]['id']){delete _0x56e5b6['body']['id'];}return db[_0x0b37('0x2f')][_0x0b37('0x48')]({'where':{'id':_0x56e5b6[_0x0b37('0x46')]['id']}})[_0x0b37('0x26')](handleEntityNotFound(_0x6777a6,null))[_0x0b37('0x26')](saveUpdates(_0x56e5b6[_0x0b37('0x4a')],null))[_0x0b37('0x26')](respondWithResult(_0x6777a6,null))[_0x0b37('0x45')](handleError(_0x6777a6,null));};exports[_0x0b37('0x27')]=function(_0x3e1d20,_0x319181){return db[_0x0b37('0x2f')]['find']({'where':{'id':_0x3e1d20[_0x0b37('0x46')]['id']}})['then'](handleEntityNotFound(_0x319181,null))['then'](removeEntity(_0x319181,null))[_0x0b37('0x45')](handleError(_0x319181,null));};
\ No newline at end of file
+var _0x409a=['lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','get','UserProfileResource','end','error','stack','send','index','Pause','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','merge','include','rows','catch','params','includeAll','options','find','create','body','user','Pauses','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x409a,0x17b));var _0xa409=function(_0x58346f,_0x3f5397){_0x58346f=_0x58346f-0x0;var _0x47893b=_0x409a[_0x58346f];return _0x47893b;};'use strict';var emlformat=require(_0xa409('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa409('0x1'));var rp=require(_0xa409('0x2'));var moment=require(_0xa409('0x3'));var BPromise=require(_0xa409('0x4'));var Mustache=require(_0xa409('0x5'));var util=require(_0xa409('0x6'));var path=require(_0xa409('0x7'));var sox=require(_0xa409('0x8'));var csv=require(_0xa409('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa409('0xa'));var _=require(_0xa409('0xb'));var squel=require(_0xa409('0xc'));var crypto=require('crypto');var jsforce=require(_0xa409('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa409('0xe'));var authService=require(_0xa409('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa409('0x10'));var hardwareService=require(_0xa409('0x11'));var logger=require(_0xa409('0x12'))('api');var utils=require(_0xa409('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa409('0x14'));var db=require(_0xa409('0x15'))['db'];function respondWithStatusCode(_0x2bd7d6,_0x4096ff){_0x4096ff=_0x4096ff||0xcc;return function(_0xcca074){if(_0xcca074){return _0x2bd7d6[_0xa409('0x16')](_0x4096ff);}return _0x2bd7d6[_0xa409('0x17')](_0x4096ff)['end']();};}function respondWithResult(_0x4c5c00,_0x34ad24){_0x34ad24=_0x34ad24||0xc8;return function(_0x5a6653){if(_0x5a6653){return _0x4c5c00[_0xa409('0x17')](_0x34ad24)[_0xa409('0x18')](_0x5a6653);}};}function respondWithFilteredResult(_0x4e0a0a,_0x316102){return function(_0x3761d9){if(_0x3761d9){var _0x2205c0=typeof _0x316102['offset']===_0xa409('0x19')&&typeof _0x316102[_0xa409('0x1a')]==='undefined';var _0x1914b8=_0x3761d9[_0xa409('0x1b')];var _0x47b36b=_0x2205c0?0x0:_0x316102[_0xa409('0x1c')];var _0x41b2f0=_0x2205c0?_0x3761d9[_0xa409('0x1b')]:_0x316102[_0xa409('0x1c')]+_0x316102[_0xa409('0x1a')];var _0x8ada60;if(_0x41b2f0>=_0x1914b8){_0x41b2f0=_0x1914b8;_0x8ada60=0xc8;}else{_0x8ada60=0xce;}_0x4e0a0a[_0xa409('0x17')](_0x8ada60);return _0x4e0a0a['set'](_0xa409('0x1d'),_0x47b36b+'-'+_0x41b2f0+'/'+_0x1914b8)['json'](_0x3761d9);}return null;};}function patchUpdates(_0x5ce96b){return function(_0x46dc46){try{jsonpatch[_0xa409('0x1e')](_0x46dc46,_0x5ce96b,!![]);}catch(_0x347551){return BPromise['reject'](_0x347551);}return _0x46dc46[_0xa409('0x1f')]();};}function saveUpdates(_0x13a38f,_0x4927d3){return function(_0x3bfb92){if(_0x3bfb92){return _0x3bfb92['update'](_0x13a38f)[_0xa409('0x20')](function(_0x542034){return _0x542034;});}return null;};}function removeEntity(_0x420780,_0x27d05d){return function(_0x5c0316){if(_0x5c0316){return _0x5c0316[_0xa409('0x21')]()['then'](function(){var _0x2b45a0=_0x5c0316[_0xa409('0x22')]({'plain':!![]});var _0x1823dd='Pauses';return db[_0xa409('0x23')]['destroy']({'where':{'type':_0x1823dd,'resourceId':_0x2b45a0['id']}})['then'](function(){return _0x5c0316;});})[_0xa409('0x20')](function(){_0x420780[_0xa409('0x17')](0xcc)[_0xa409('0x24')]();});}};}function handleEntityNotFound(_0x235e08,_0x406a73){return function(_0x3b7a74){if(!_0x3b7a74){_0x235e08[_0xa409('0x16')](0x194);}return _0x3b7a74;};}function handleError(_0x325e17,_0x5ae381){_0x5ae381=_0x5ae381||0x1f4;return function(_0x555fd2){logger[_0xa409('0x25')](_0x555fd2[_0xa409('0x26')]);if(_0x555fd2['name']){delete _0x555fd2['name'];}_0x325e17[_0xa409('0x17')](_0x5ae381)[_0xa409('0x27')](_0x555fd2);};}exports[_0xa409('0x28')]=function(_0x50ab6d,_0x54e127){var _0x9795d9={},_0x1a82d8={},_0x4e7e99={'count':0x0,'rows':[]};var _0x370258=_['map'](db[_0xa409('0x29')][_0xa409('0x2a')],function(_0xdd452){return{'name':_0xdd452[_0xa409('0x2b')],'type':_0xdd452[_0xa409('0x2c')][_0xa409('0x2d')]};});_0x1a82d8[_0xa409('0x2e')]=_['map'](_0x370258,_0xa409('0x2f'));_0x1a82d8[_0xa409('0x30')]=_[_0xa409('0x31')](_0x50ab6d['query']);_0x1a82d8[_0xa409('0x32')]=_[_0xa409('0x33')](_0x1a82d8['model'],_0x1a82d8[_0xa409('0x30')]);_0x9795d9['attributes']=_[_0xa409('0x33')](_0x1a82d8[_0xa409('0x2e')],qs[_0xa409('0x34')](_0x50ab6d[_0xa409('0x30')]['fields']));_0x9795d9[_0xa409('0x35')]=_0x9795d9[_0xa409('0x35')][_0xa409('0x36')]?_0x9795d9[_0xa409('0x35')]:_0x1a82d8[_0xa409('0x2e')];if(!_0x50ab6d[_0xa409('0x30')][_0xa409('0x37')](_0xa409('0x38'))){_0x9795d9[_0xa409('0x1a')]=qs[_0xa409('0x1a')](_0x50ab6d[_0xa409('0x30')]['limit']);_0x9795d9[_0xa409('0x1c')]=qs[_0xa409('0x1c')](_0x50ab6d[_0xa409('0x30')][_0xa409('0x1c')]);}_0x9795d9[_0xa409('0x39')]=qs[_0xa409('0x3a')](_0x50ab6d[_0xa409('0x30')][_0xa409('0x3a')]);_0x9795d9[_0xa409('0x3b')]=qs[_0xa409('0x32')](_[_0xa409('0x3c')](_0x50ab6d['query'],_0x1a82d8[_0xa409('0x32')]),_0x370258);if(_0x50ab6d[_0xa409('0x30')]['filter']){_0x9795d9[_0xa409('0x3b')]=_['merge'](_0x9795d9[_0xa409('0x3b')],{'$or':_[_0xa409('0x3d')](_0x370258,function(_0x34d7f1){if(_0x34d7f1[_0xa409('0x2c')]!=='VIRTUAL'){var _0x5d66bb={};_0x5d66bb[_0x34d7f1[_0xa409('0x2f')]]={'$like':'%'+_0x50ab6d[_0xa409('0x30')][_0xa409('0x3e')]+'%'};return _0x5d66bb;}})});}_0x9795d9=_[_0xa409('0x3f')]({},_0x9795d9,_0x50ab6d['options']);var _0x239d33={'where':_0x9795d9['where']};return db[_0xa409('0x29')]['count'](_0x239d33)[_0xa409('0x20')](function(_0x1ec698){_0x4e7e99[_0xa409('0x1b')]=_0x1ec698;if(_0x50ab6d[_0xa409('0x30')]['includeAll']){_0x9795d9[_0xa409('0x40')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x9795d9);})[_0xa409('0x20')](function(_0xc0cf44){_0x4e7e99[_0xa409('0x41')]=_0xc0cf44;return _0x4e7e99;})[_0xa409('0x20')](respondWithFilteredResult(_0x54e127,_0x9795d9))[_0xa409('0x42')](handleError(_0x54e127,null));};exports['show']=function(_0x454baf,_0x1d0684){var _0x40fe49={'raw':!![],'where':{'id':_0x454baf[_0xa409('0x43')]['id']}},_0x1070a4={};_0x1070a4[_0xa409('0x2e')]=_['keys'](db[_0xa409('0x29')][_0xa409('0x2a')]);_0x1070a4[_0xa409('0x30')]=_[_0xa409('0x31')](_0x454baf[_0xa409('0x30')]);_0x1070a4[_0xa409('0x32')]=_['intersection'](_0x1070a4[_0xa409('0x2e')],_0x1070a4[_0xa409('0x30')]);_0x40fe49[_0xa409('0x35')]=_[_0xa409('0x33')](_0x1070a4[_0xa409('0x2e')],qs[_0xa409('0x34')](_0x454baf[_0xa409('0x30')][_0xa409('0x34')]));_0x40fe49['attributes']=_0x40fe49[_0xa409('0x35')]['length']?_0x40fe49[_0xa409('0x35')]:_0x1070a4[_0xa409('0x2e')];if(_0x454baf[_0xa409('0x30')][_0xa409('0x44')]){_0x40fe49['include']=[{'all':!![]}];}_0x40fe49=_[_0xa409('0x3f')]({},_0x40fe49,_0x454baf[_0xa409('0x45')]);return db[_0xa409('0x29')][_0xa409('0x46')](_0x40fe49)[_0xa409('0x20')](handleEntityNotFound(_0x1d0684,null))[_0xa409('0x20')](respondWithResult(_0x1d0684,null))[_0xa409('0x42')](handleError(_0x1d0684,null));};exports[_0xa409('0x47')]=function(_0x2d913b,_0x942818){return db[_0xa409('0x29')][_0xa409('0x47')](_0x2d913b[_0xa409('0x48')],{})[_0xa409('0x20')](function(_0x197d29){var _0x12b178=_0x2d913b[_0xa409('0x49')]['get']({'plain':!![]});if(!_0x12b178)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12b178['role']===_0xa409('0x49')){var _0x36f631=_0x197d29[_0xa409('0x22')]({'plain':!![]});var _0xef72=_0xa409('0x4a');return db['UserProfileSection'][_0xa409('0x46')]({'where':{'name':_0xef72,'userProfileId':_0x12b178[_0xa409('0x4b')]},'raw':!![]})[_0xa409('0x20')](function(_0x5c716c){if(_0x5c716c&&_0x5c716c[_0xa409('0x4c')]===0x0){return db[_0xa409('0x23')][_0xa409('0x47')]({'name':_0x36f631[_0xa409('0x2f')],'resourceId':_0x36f631['id'],'type':_0x5c716c[_0xa409('0x2f')],'sectionId':_0x5c716c['id']},{})['then'](function(){return _0x197d29;});}else{return _0x197d29;}})[_0xa409('0x42')](function(_0x7f8cb1){logger[_0xa409('0x25')](_0xa409('0x4d'),_0x7f8cb1);throw _0x7f8cb1;});}return _0x197d29;})[_0xa409('0x20')](respondWithResult(_0x942818,0xc9))[_0xa409('0x42')](handleError(_0x942818,null));};exports['update']=function(_0x42b242,_0x1b7516){if(_0x42b242[_0xa409('0x48')]['id']){delete _0x42b242[_0xa409('0x48')]['id'];}return db[_0xa409('0x29')][_0xa409('0x46')]({'where':{'id':_0x42b242['params']['id']}})[_0xa409('0x20')](handleEntityNotFound(_0x1b7516,null))[_0xa409('0x20')](saveUpdates(_0x42b242[_0xa409('0x48')],null))['then'](respondWithResult(_0x1b7516,null))[_0xa409('0x42')](handleError(_0x1b7516,null));};exports[_0xa409('0x21')]=function(_0x5e4954,_0x6b4f9a){return db[_0xa409('0x29')][_0xa409('0x46')]({'where':{'id':_0x5e4954['params']['id']}})[_0xa409('0x20')](handleEntityNotFound(_0x6b4f9a,null))[_0xa409('0x20')](removeEntity(_0x6b4f9a,null))[_0xa409('0x42')](handleError(_0x6b4f9a,null));};
\ No newline at end of file
index eddf138..24d800d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3f2443,_0x50ed59){var _0x234d61=function(_0x1ecd06){while(--_0x1ecd06){_0x3f2443['push'](_0x3f2443['shift']());}};_0x234d61(++_0x50ed59);}(_0x1cb9,0x14e));var _0x91cb=function(_0x365777,_0x4e8382){_0x365777=_0x365777-0x0;var _0x1395a1=_0x1cb9[_0x365777];return _0x1395a1;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index db01214..e6cfd4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4ebc31,_0x251a42){var _0x1bc9aa=function(_0x4080ed){while(--_0x4080ed){_0x4ebc31['push'](_0x4ebc31['shift']());}};_0x1bc9aa(++_0x251a42);}(_0x7a54,0x106));var _0x47a5=function(_0x474cd4,_0x1c2704){_0x474cd4=_0x474cd4-0x0;var _0x5efa90=_0x7a54[_0x474cd4];return _0x5efa90;};'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')]('Pause,\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);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3a4d27,_0x53357e){var _0x2cf8a4=function(_0x144d7f){while(--_0x144d7f){_0x3a4d27['push'](_0x3a4d27['shift']());}};_0x2cf8a4(++_0x53357e);}(_0x7a54,0x106));var _0x47a5=function(_0x34328d,_0x3f2c74){_0x34328d=_0x34328d-0x0;var _0x593a2a=_0x7a54[_0x34328d];return _0x593a2a;};'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')]('Pause,\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);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
index 3f5cd52..6bfd50f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec56=['isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0x21c53d,_0xb90669){var _0x27912d=function(_0x24550c){while(--_0x24550c){_0x21c53d['push'](_0x21c53d['shift']());}};_0x27912d(++_0xb90669);}(_0xec56,0x1bd));var _0x6ec5=function(_0x194cf7,_0x172d1a){_0x194cf7=_0x194cf7-0x0;var _0x4cc20b=_0xec56[_0x194cf7];return _0x4cc20b;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router[_0x6ec5('0x9')]('/:id/download',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);var upload=multer({'storage':multer[_0x6ec5('0x11')]({'destination':function(_0x1964ae,_0x143b09,_0x181e79){_0x181e79(null,path[_0x6ec5('0x12')](config['root'],_0x6ec5('0x13')));},'filename':function(_0x1d7180,_0x2b1f61,_0xb04ab6){_0x2b1f61[_0x6ec5('0x14')]=_0x2b1f61[_0x6ec5('0x14')][_0x6ec5('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb04ab6(null,util[_0x6ec5('0x16')]('%s-%s%s',path[_0x6ec5('0x17')](_0x2b1f61['originalname'],path[_0x6ec5('0x18')](_0x2b1f61[_0x6ec5('0x14')])),Date[_0x6ec5('0x19')](),path[_0x6ec5('0x18')](_0x2b1f61[_0x6ec5('0x14')])));}})});router['post']('/',upload[_0x6ec5('0x1a')](_0x6ec5('0x1b')),controller[_0x6ec5('0x1c')]);router[_0x6ec5('0x1d')](_0x6ec5('0xc'),controller[_0x6ec5('0x1e')]);router[_0x6ec5('0x1f')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x20')]);router[_0x6ec5('0x21')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x21')]);module[_0x6ec5('0x22')]=router;
\ No newline at end of file
+var _0xa8a8=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','single','file','upload','post','put','update','delete','multer','util'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xa8a8,0xec));var _0x8a8a=function(_0x18c46e,_0x2e1a6b){_0x18c46e=_0x18c46e-0x0;var _0x5111c5=_0xa8a8[_0x18c46e];return _0x5111c5;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth[_0x8a8a('0xb')](),controller['show']);router['get'](_0x8a8a('0x10'),auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);var upload=multer({'storage':multer[_0x8a8a('0x12')]({'destination':function(_0x532621,_0x118380,_0x76b586){_0x76b586(null,path[_0x8a8a('0x13')](config['root'],_0x8a8a('0x14')));},'filename':function(_0x42fab7,_0x330796,_0x234481){_0x330796['originalname']=_0x330796[_0x8a8a('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x234481(null,util[_0x8a8a('0x16')](_0x8a8a('0x17'),path[_0x8a8a('0x18')](_0x330796[_0x8a8a('0x15')],path[_0x8a8a('0x19')](_0x330796[_0x8a8a('0x15')])),Date[_0x8a8a('0x1a')](),path['extname'](_0x330796[_0x8a8a('0x15')])));}})});router['post']('/',upload[_0x8a8a('0x1b')](_0x8a8a('0x1c')),controller[_0x8a8a('0x1d')]);router[_0x8a8a('0x1e')](_0x8a8a('0xd'),controller['webhookPost']);router[_0x8a8a('0x1f')](_0x8a8a('0xf'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x20')]);router[_0x8a8a('0x21')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['delete']);module['exports']=router;
\ No newline at end of file
index f184241..bbbcfbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebed=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html'];(function(_0x349625,_0x45853e){var _0x54f744=function(_0x156c26){while(--_0x156c26){_0x349625['push'](_0x349625['shift']());}};_0x54f744(++_0x45853e);}(_0xebed,0x10f));var _0xdebe=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xebed[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0xdebe('0x0'));module['exports']={'name':{'type':Sequelize[_0xdebe('0x1')]},'type':{'type':Sequelize[_0xdebe('0x2')](_0xdebe('0x3'),_0xdebe('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xdebe('0x5')]},'path':{'type':Sequelize[_0xdebe('0x1')],'comment':_0xdebe('0x6')},'active':{'type':Sequelize[_0xdebe('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM']('adminOnly','agentOnly',_0xdebe('0x8'),_0xdebe('0x9')),'defaultValue':_0xdebe('0x8'),'comment':_0xdebe('0xa')},'icon':{'type':Sequelize[_0xdebe('0x1')]},'adminUrl':{'type':Sequelize[_0xdebe('0x1')]},'agentUrl':{'type':Sequelize[_0xdebe('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xdebe('0x1')]}};
\ No newline at end of file
+var _0xe964=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script'];(function(_0x546b92,_0x4e3ade){var _0x49faa4=function(_0x3e2bb3){while(--_0x3e2bb3){_0x546b92['push'](_0x546b92['shift']());}};_0x49faa4(++_0x4e3ade);}(_0xe964,0x9f));var _0x4e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe964[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4e96('0x0'));module[_0x4e96('0x1')]={'name':{'type':Sequelize[_0x4e96('0x2')]},'type':{'type':Sequelize[_0x4e96('0x3')](_0x4e96('0x4'),_0x4e96('0x5'))},'description':{'type':Sequelize[_0x4e96('0x6')]},'version':{'type':Sequelize[_0x4e96('0x6')]},'path':{'type':Sequelize[_0x4e96('0x2')],'comment':_0x4e96('0x7')},'active':{'type':Sequelize[_0x4e96('0x8')],'defaultValue':0x0,'comment':_0x4e96('0x9')},'sidebar':{'type':Sequelize[_0x4e96('0x3')](_0x4e96('0xa'),_0x4e96('0xb'),_0x4e96('0xc'),_0x4e96('0xd')),'defaultValue':_0x4e96('0xc'),'comment':_0x4e96('0xe')},'icon':{'type':Sequelize[_0x4e96('0x2')]},'adminUrl':{'type':Sequelize[_0x4e96('0x2')]},'agentUrl':{'type':Sequelize[_0x4e96('0x2')]},'scriptName':{'type':Sequelize[_0x4e96('0x2')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5618bac..491e6a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21d7=['resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','download','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','Plugin','includeAll','include','rows','catch','show','params','find','join','format','createWriteStream','zip','code','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','server/files/plugins','dirname','node_modules/**/*','basename','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','lstatSync','isFile','isDirectory','Invalid\x20plugin\x20structure','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','version','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','script','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','delete'];(function(_0x1c926d,_0x44911a){var _0x28a2b4=function(_0xb61acb){while(--_0xb61acb){_0x1c926d['push'](_0x1c926d['shift']());}};_0x28a2b4(++_0x44911a);}(_0x21d7,0x172));var _0x721d=function(_0x257d84,_0x8eaaea){_0x257d84=_0x257d84-0x0;var _0x3d1ba2=_0x21d7[_0x257d84];return _0x3d1ba2;};'use strict';var emlformat=require(_0x721d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x721d('0x1'));var jsonpatch=require(_0x721d('0x2'));var rp=require('request-promise');var moment=require(_0x721d('0x3'));var BPromise=require(_0x721d('0x4'));var Mustache=require(_0x721d('0x5'));var util=require('util');var path=require(_0x721d('0x6'));var sox=require(_0x721d('0x7'));var csv=require('to-csv');var ejs=require(_0x721d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x721d('0x9'));var squel=require(_0x721d('0xa'));var crypto=require(_0x721d('0xb'));var jsforce=require(_0x721d('0xc'));var deskjs=require(_0x721d('0xd'));var toCsv=require(_0x721d('0xe'));var querystring=require(_0x721d('0xf'));var Papa=require(_0x721d('0x10'));var extract=require(_0x721d('0x11'));var rimraf=require(_0x721d('0x12'));var archiver=require(_0x721d('0x13'));var Redis=require(_0x721d('0x14'));var authService=require(_0x721d('0x15'));var qs=require(_0x721d('0x16'));var as=require(_0x721d('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x721d('0x18'))(_0x721d('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x721d('0x1a'));var db=require(_0x721d('0x1b'))['db'];config[_0x721d('0x1c')]=_['defaults'](config[_0x721d('0x1c')],{'host':_0x721d('0x1d'),'port':0x18eb});var socket=require(_0x721d('0x1e'))(new Redis(config[_0x721d('0x1c')]));require(_0x721d('0x1f'))[_0x721d('0x20')](socket);function respondWithStatusCode(_0x258f10,_0x248ae7){_0x248ae7=_0x248ae7||0xcc;return function(_0x56dfb8){if(_0x56dfb8){return _0x258f10[_0x721d('0x21')](_0x248ae7);}return _0x258f10[_0x721d('0x22')](_0x248ae7)[_0x721d('0x23')]();};}function respondWithResult(_0x15af73,_0x3c594a){_0x3c594a=_0x3c594a||0xc8;return function(_0x597322){if(_0x597322){return _0x15af73['status'](_0x3c594a)['json'](_0x597322);}};}function respondWithFilteredResult(_0x5b4422,_0x2300e1){return function(_0xd9c608){if(_0xd9c608){var _0x206b55=typeof _0x2300e1['offset']==='undefined'&&typeof _0x2300e1['limit']===_0x721d('0x24');var _0x235c4a=_0xd9c608['count'];var _0x31fc05=_0x206b55?0x0:_0x2300e1[_0x721d('0x25')];var _0xe6a3a2=_0x206b55?_0xd9c608[_0x721d('0x26')]:_0x2300e1['offset']+_0x2300e1['limit'];var _0x30c50d;if(_0xe6a3a2>=_0x235c4a){_0xe6a3a2=_0x235c4a;_0x30c50d=0xc8;}else{_0x30c50d=0xce;}_0x5b4422[_0x721d('0x22')](_0x30c50d);return _0x5b4422[_0x721d('0x27')](_0x721d('0x28'),_0x31fc05+'-'+_0xe6a3a2+'/'+_0x235c4a)[_0x721d('0x29')](_0xd9c608);}return null;};}function patchUpdates(_0x40e021){return function(_0xe55520){try{jsonpatch[_0x721d('0x2a')](_0xe55520,_0x40e021,!![]);}catch(_0x5bdc39){return BPromise[_0x721d('0x2b')](_0x5bdc39);}return _0xe55520[_0x721d('0x2c')]();};}function saveUpdates(_0xfa1201,_0x469ecb){return function(_0x2d85f3){if(_0x2d85f3){return _0x2d85f3[_0x721d('0x2d')](_0xfa1201)['then'](function(_0x2810bb){return _0x2810bb;});}return null;};}function removeEntity(_0x201de1,_0x54e1f3){return function(_0x56b20a){if(_0x56b20a){return _0x56b20a[_0x721d('0x2e')]()[_0x721d('0x2f')](function(){var _0x345cac=_0x56b20a['get']({'plain':!![]});var _0x285696='Plugins';return db[_0x721d('0x30')]['destroy']({'where':{'type':_0x285696,'resourceId':_0x345cac['id']}})[_0x721d('0x2f')](function(){return _0x56b20a;});})[_0x721d('0x2f')](function(){_0x201de1[_0x721d('0x22')](0xcc)[_0x721d('0x23')]();});}};}function handleEntityNotFound(_0x2ed9e0,_0x12a2e3){return function(_0x28b1db){if(!_0x28b1db){_0x2ed9e0[_0x721d('0x21')](0x194);}return _0x28b1db;};}function handleError(_0x3ac06c,_0x63851d){_0x63851d=_0x63851d||0x1f4;return function(_0x2c22f1){logger[_0x721d('0x31')](_0x2c22f1[_0x721d('0x32')]);if(_0x2c22f1[_0x721d('0x33')]){delete _0x2c22f1[_0x721d('0x33')];}_0x3ac06c[_0x721d('0x22')](_0x63851d)['send'](_0x2c22f1);};}exports[_0x721d('0x34')]=function(_0x22fa83,_0x2e58b0){var _0x229eba={},_0x12b2ab={},_0x7c57e7={'count':0x0,'rows':[]};var _0x55a06d=_[_0x721d('0x35')](db['Plugin'][_0x721d('0x36')],function(_0x14940b){return{'name':_0x14940b[_0x721d('0x37')],'type':_0x14940b[_0x721d('0x38')]['key']};});_0x12b2ab[_0x721d('0x39')]=_[_0x721d('0x35')](_0x55a06d,'name');_0x12b2ab[_0x721d('0x3a')]=_[_0x721d('0x3b')](_0x22fa83[_0x721d('0x3a')]);_0x12b2ab[_0x721d('0x3c')]=_[_0x721d('0x3d')](_0x12b2ab[_0x721d('0x39')],_0x12b2ab[_0x721d('0x3a')]);_0x229eba[_0x721d('0x3e')]=_[_0x721d('0x3d')](_0x12b2ab[_0x721d('0x39')],qs[_0x721d('0x3f')](_0x22fa83['query'][_0x721d('0x3f')]));_0x229eba[_0x721d('0x3e')]=_0x229eba['attributes'][_0x721d('0x40')]?_0x229eba[_0x721d('0x3e')]:_0x12b2ab[_0x721d('0x39')];if(!_0x22fa83['query']['hasOwnProperty'](_0x721d('0x41'))){_0x229eba[_0x721d('0x42')]=qs[_0x721d('0x42')](_0x22fa83[_0x721d('0x3a')][_0x721d('0x42')]);_0x229eba[_0x721d('0x25')]=qs[_0x721d('0x25')](_0x22fa83[_0x721d('0x3a')][_0x721d('0x25')]);}_0x229eba[_0x721d('0x43')]=qs[_0x721d('0x44')](_0x22fa83[_0x721d('0x3a')]['sort']);_0x229eba[_0x721d('0x45')]=qs['filters'](_[_0x721d('0x46')](_0x22fa83[_0x721d('0x3a')],_0x12b2ab[_0x721d('0x3c')]),_0x55a06d);if(_0x22fa83[_0x721d('0x3a')][_0x721d('0x47')]){_0x229eba['where']=_[_0x721d('0x48')](_0x229eba[_0x721d('0x45')],{'$or':_[_0x721d('0x35')](_0x55a06d,function(_0x4b2926){if(_0x4b2926[_0x721d('0x38')]!=='VIRTUAL'){var _0x51f503={};_0x51f503[_0x4b2926[_0x721d('0x33')]]={'$like':'%'+_0x22fa83[_0x721d('0x3a')][_0x721d('0x47')]+'%'};return _0x51f503;}})});}_0x229eba=_[_0x721d('0x48')]({},_0x229eba,_0x22fa83[_0x721d('0x49')]);var _0x103646={'where':_0x229eba[_0x721d('0x45')]};return db[_0x721d('0x4a')][_0x721d('0x26')](_0x103646)[_0x721d('0x2f')](function(_0x523d2e){_0x7c57e7[_0x721d('0x26')]=_0x523d2e;if(_0x22fa83[_0x721d('0x3a')][_0x721d('0x4b')]){_0x229eba[_0x721d('0x4c')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x229eba);})[_0x721d('0x2f')](function(_0x166121){_0x7c57e7[_0x721d('0x4d')]=_0x166121;return _0x7c57e7;})[_0x721d('0x2f')](respondWithFilteredResult(_0x2e58b0,_0x229eba))[_0x721d('0x4e')](handleError(_0x2e58b0,null));};exports[_0x721d('0x4f')]=function(_0x83a15c,_0x1244f2){var _0x4fbc8f={'raw':!![],'where':{'id':_0x83a15c[_0x721d('0x50')]['id']}},_0x1d7773={};_0x1d7773['model']=_[_0x721d('0x3b')](db[_0x721d('0x4a')][_0x721d('0x36')]);_0x1d7773[_0x721d('0x3a')]=_[_0x721d('0x3b')](_0x83a15c[_0x721d('0x3a')]);_0x1d7773[_0x721d('0x3c')]=_[_0x721d('0x3d')](_0x1d7773[_0x721d('0x39')],_0x1d7773[_0x721d('0x3a')]);_0x4fbc8f[_0x721d('0x3e')]=_[_0x721d('0x3d')](_0x1d7773['model'],qs['fields'](_0x83a15c[_0x721d('0x3a')][_0x721d('0x3f')]));_0x4fbc8f['attributes']=_0x4fbc8f[_0x721d('0x3e')][_0x721d('0x40')]?_0x4fbc8f[_0x721d('0x3e')]:_0x1d7773[_0x721d('0x39')];if(_0x83a15c[_0x721d('0x3a')][_0x721d('0x4b')]){_0x4fbc8f['include']=[{'all':!![]}];}_0x4fbc8f=_[_0x721d('0x48')]({},_0x4fbc8f,_0x83a15c[_0x721d('0x49')]);return db[_0x721d('0x4a')][_0x721d('0x51')](_0x4fbc8f)[_0x721d('0x2f')](handleEntityNotFound(_0x1244f2,null))[_0x721d('0x2f')](respondWithResult(_0x1244f2,null))[_0x721d('0x4e')](handleError(_0x1244f2,null));};exports['download']=function(_0x8c0bbe,_0x35d845,_0x4f0dca){return db[_0x721d('0x4a')][_0x721d('0x51')]({'where':{'id':_0x8c0bbe[_0x721d('0x50')]['id']},'attributes':[_0x721d('0x33'),_0x721d('0x6')],'raw':!![]})[_0x721d('0x2f')](handleEntityNotFound(_0x35d845,null))[_0x721d('0x2f')](function(_0x515e6d){if(_0x515e6d){var _0x483633=path[_0x721d('0x52')](config['root'],'server/files/plugins',util[_0x721d('0x53')]('%s.zip',path['basename'](_0x515e6d[_0x721d('0x6')])));var _0x48db17=fs[_0x721d('0x54')](_0x483633);var _0x9798de=archiver(_0x721d('0x55'),{'zlib':{'level':0x9}});_0x9798de['on']('warning',function(_0x42f089){if(_0x42f089[_0x721d('0x56')]==='ENOENT'){logger['error'](_0x42f089);}else{throw new db['Sequelize'][(_0x721d('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x9798de['on'](_0x721d('0x31'),function(_0x5cbfa2){throw new db[(_0x721d('0x58'))][(_0x721d('0x57'))](_0x721d('0x59'));});_0x9798de[_0x721d('0x5a')](_0x48db17);_0x9798de[_0x721d('0x5b')](_0x721d('0x5c'),{'cwd':path['join'](config[_0x721d('0x5d')],_0x721d('0x5e'),path[_0x721d('0x5f')](_0x515e6d[_0x721d('0x6')])),'ignore':[path[_0x721d('0x52')](path['basename'](_0x515e6d['path']),_0x721d('0x60')),path[_0x721d('0x52')](path[_0x721d('0x61')](_0x515e6d[_0x721d('0x6')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x48db17['on'](_0x721d('0x62'),function(){if(!fs[_0x721d('0x63')](_0x483633)){throw new db[(_0x721d('0x58'))]['Error'](_0x721d('0x64'));}return _0x35d845['download'](_0x483633,util[_0x721d('0x53')](_0x721d('0x65'),path[_0x721d('0x61')](_0x515e6d[_0x721d('0x6')])),function(_0x3cb062){if(_0x3cb062){throw new db['Sequelize']['Error'](_0x721d('0x66'));}fs['unlinkSync'](_0x483633);logger[_0x721d('0x67')](_0x721d('0x68'));logger['info'](_0x721d('0x69'));});});}return null;})[_0x721d('0x4e')](handleError(_0x35d845,null));};exports[_0x721d('0x6a')]=function(_0x131406,_0x38a08d,_0xac0ca9){var _0x413f09=path[_0x721d('0x61')](_0x131406[_0x721d('0x6b')][_0x721d('0x6c')],path[_0x721d('0x6d')](_0x131406['file']['filename']));var _0x42a1e4=path[_0x721d('0x52')](config[_0x721d('0x5d')],_0x721d('0x5e'),_0x131406['file'][_0x721d('0x6c')]);var _0xa4c13d=path[_0x721d('0x52')](config[_0x721d('0x5d')],_0x721d('0x5e'),_0x413f09);logger['info'](_0x721d('0x6e'),_0x42a1e4);logger[_0x721d('0x67')](_0x721d('0x6f'),_0xa4c13d);try{fs[_0x721d('0x70')](_0x42a1e4,parseInt(_0x721d('0x71'),0x8));extract(_0x42a1e4,{'dir':_0xa4c13d},function(_0x1897cd){if(_0x1897cd){logger[_0x721d('0x31')](_0x1897cd);handleError(_0x1897cd,!![]);};var _0x1b5c97=fs[_0x721d('0x72')](_0xa4c13d);if(_0x1b5c97[_0x721d('0x40')]>0x1){removeReferences(_0x42a1e4,_0xa4c13d);logger[_0x721d('0x31')]('Invalid\x20plugin\x20structure');return _0xac0ca9(new Error('Invalid\x20plugin\x20structure'));}var _0x8b1104=fs[_0x721d('0x73')](path[_0x721d('0x52')](_0xa4c13d,_0x1b5c97[0x0]));if(_0x8b1104[_0x721d('0x74')]()){removeReferences(_0x42a1e4,_0xa4c13d);logger[_0x721d('0x31')]('Invalid\x20plugin\x20structure');return _0xac0ca9(new Error('Invalid\x20plugin\x20structure'));}if(_0x8b1104[_0x721d('0x75')]()){var _0x542cd0=fs['readdirSync'](path[_0x721d('0x52')](_0xa4c13d,_0x1b5c97[0x0]));if(_0x542cd0[_0x721d('0x40')]===0x0){removeReferences(_0x42a1e4,_0xa4c13d);logger['error']('Invalid\x20plugin\x20structure');return _0xac0ca9(new Error(_0x721d('0x76')));}var _0x29448b=_0x542cd0[_0x721d('0x77')](function(_0x315b41){return _0x315b41===_0x721d('0x78');});if(!_0x29448b){return _0xac0ca9(new Error(_0x721d('0x79')));}var _0x55d455=fs[_0x721d('0x7a')](path[_0x721d('0x52')](_0xa4c13d,_0x1b5c97[0x0],'manifest.json'));var _0x1e22a7=JSON[_0x721d('0x7b')](_0x55d455);if(_0x721d('0x24')==typeof _0x1e22a7[_0x721d('0x33')]){return _0xac0ca9(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x1e22a7[_0x721d('0x38')]){return _0xac0ca9(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x721d('0x24')==typeof _0x1e22a7[_0x721d('0x7c')]){return _0xac0ca9(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x721d('0x24')==typeof _0x1e22a7['parameters']){return _0xac0ca9(new Error(_0x721d('0x7d')));}if(_0x1e22a7[_0x721d('0x38')]===_0x721d('0x7e')){if(_0x721d('0x24')==typeof _0x1e22a7['parameters'][_0x721d('0x7f')]){return _0xac0ca9(new Error(_0x721d('0x80')));}if(_0x721d('0x24')==typeof _0x1e22a7[_0x721d('0x81')][_0x721d('0x7f')][_0x721d('0x82')]&&_0x721d('0x24')==typeof _0x1e22a7[_0x721d('0x81')]['views'][_0x721d('0x83')]){return _0xac0ca9(new Error(_0x721d('0x84')));}}else if(_0x1e22a7[_0x721d('0x38')]==='script'){if(_0x721d('0x24')==typeof _0x1e22a7['parameters'][_0x721d('0x85')]){return _0xac0ca9(new Error(_0x721d('0x86')));}if('undefined'==typeof _0x1e22a7[_0x721d('0x81')][_0x721d('0x87')]){return _0xac0ca9(new Error(_0x721d('0x88')));}}else{return _0xac0ca9(new Error(_0x721d('0x89')));}var _0xbb9284=_0x1e22a7[_0x721d('0x33')];var _0x57668b=_0x1e22a7[_0x721d('0x8a')];var _0x149000=_0x1e22a7[_0x721d('0x38')];var _0x49708d=_0x1e22a7[_0x721d('0x8b')]?_0x1e22a7['sidebar']:'always';var _0x1932f9=_0x1e22a7[_0x721d('0x8c')]?_0x1e22a7[_0x721d('0x8c')]:_0x721d('0x8d');var _0xba1b97='';var _0x20774a='';var _0x415814='';var _0x4efe06='';var _0x3ddb68=_0x1e22a7[_0x721d('0x7c')];if(_0x149000==='html'){if(_0x721d('0x24')!=typeof _0x1e22a7['parameters'][_0x721d('0x7f')][_0x721d('0x82')]){var _0x38ba29=_0x1e22a7[_0x721d('0x81')][_0x721d('0x7f')][_0x721d('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x38ba29)){_0xba1b97=path[_0x721d('0x52')](_0x721d('0x8e'),_0x413f09,_0x1b5c97[0x0],_0x38ba29);}else{_0xba1b97=_0x38ba29;}}else{logger[_0x721d('0x67')](_0x721d('0x8f'));}if(_0x721d('0x24')!=typeof _0x1e22a7['parameters'][_0x721d('0x7f')][_0x721d('0x83')]){var _0x8998eb=_0x1e22a7[_0x721d('0x81')][_0x721d('0x7f')][_0x721d('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x721d('0x90')](_0x8998eb)){_0x20774a=path[_0x721d('0x52')](_0x721d('0x8e'),_0x413f09,_0x1b5c97[0x0],_0x8998eb);}else{_0x20774a=_0x8998eb;}}else{logger[_0x721d('0x67')](_0x721d('0x91'));}}else if(_0x149000===_0x721d('0x92')){_0x415814=_0x1e22a7[_0x721d('0x81')][_0x721d('0x85')];_0x4efe06=_0x1e22a7[_0x721d('0x81')][_0x721d('0x87')];if(_0x721d('0x24')!=typeof _0x1e22a7[_0x721d('0x81')][_0x721d('0x7f')]){if('undefined'!=typeof _0x1e22a7['parameters'][_0x721d('0x7f')][_0x721d('0x82')]){var _0x38ba29=_0x1e22a7[_0x721d('0x81')][_0x721d('0x7f')][_0x721d('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x721d('0x90')](_0x38ba29)){_0xba1b97=path[_0x721d('0x52')]('plugins',_0x413f09,_0x1b5c97[0x0],_0x38ba29);}else{_0xba1b97=_0x38ba29;}}if('undefined'!=typeof _0x1e22a7[_0x721d('0x81')][_0x721d('0x7f')][_0x721d('0x83')]){var _0x8998eb=_0x1e22a7[_0x721d('0x81')][_0x721d('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x721d('0x90')](_0x8998eb)){_0x20774a=path[_0x721d('0x52')](_0x721d('0x8e'),_0x413f09,_0x1b5c97[0x0],_0x8998eb);}else{_0x20774a=_0x8998eb;}}}}var _0x3f8520={'name':_0xbb9284,'description':_0x57668b,'path':path[_0x721d('0x52')](_0x413f09,_0x1b5c97[0x0]),'type':_0x149000,'sidebar':_0x49708d,'icon':_0x1932f9,'adminUrl':_0xba1b97,'agentUrl':_0x20774a,'scriptName':_0x415814,'scriptPath':_0x4efe06,'version':_0x3ddb68};removeReferences(_0x42a1e4,null);return db[_0x721d('0x4a')][_0x721d('0x93')](_0x3f8520)['then'](function(_0x3007c3){var _0x2a2c10={'role':_0x131406['body'][_0x721d('0x94')],'userProfileId':_0x131406[_0x721d('0x95')][_0x721d('0x96')]};if(!_0x2a2c10)throw new Error(_0x721d('0x97'));if(_0x2a2c10[_0x721d('0x94')]==='user'){var _0x565a4a=_0x3007c3[_0x721d('0x98')]({'plain':!![]});return db[_0x721d('0x99')][_0x721d('0x51')]({'where':{'name':_0x721d('0x9a'),'userProfileId':_0x2a2c10[_0x721d('0x96')]},'raw':!![]})['then'](function(_0x4bf446){if(_0x4bf446&&_0x4bf446[_0x721d('0x9b')]===0x0){return db[_0x721d('0x30')][_0x721d('0x93')]({'name':_0x565a4a[_0x721d('0x33')],'resourceId':_0x565a4a['id'],'type':_0x4bf446[_0x721d('0x33')],'sectionId':_0x4bf446['id']},{})[_0x721d('0x2f')](function(){return _0x3007c3;});}else{return _0x3007c3;}})[_0x721d('0x4e')](function(_0x1e30e7){logger[_0x721d('0x31')](_0x721d('0x9c'),_0x1e30e7);throw _0x1e30e7;});}return _0x3007c3;})[_0x721d('0x2f')](respondWithResult(_0x38a08d,null))['catch'](handleError(_0x38a08d,null));}});}catch(_0x46abff){_0x38a08d[_0x721d('0x22')](0x1f4)[_0x721d('0x9d')](_0x46abff);}};function removeReferences(_0x3f9a13,_0x1c89b5){try{if(_0x3f9a13){fs[_0x721d('0x9e')](_0x3f9a13);logger['info'](_0x721d('0x9f'));}if(_0x1c89b5){rimraf(_0x1c89b5,function(){});logger[_0x721d('0x67')]('Extracted\x20folder\x20removed');}}catch(_0x562389){logger[_0x721d('0x31')](_0x562389);}}exports[_0x721d('0x2d')]=function(_0x255844,_0x1bc4f5,_0x3ad895){return db['Plugin']['find']({'where':{'id':_0x255844['params']['id']}})[_0x721d('0x2f')](handleEntityNotFound(_0x1bc4f5,null))[_0x721d('0x2f')](saveUpdates(_0x255844['body'],null))['then'](respondWithResult(_0x1bc4f5,null))['catch'](handleError(_0x1bc4f5,null));};exports[_0x721d('0xa0')]=function(_0x2e3f16,_0x440665,_0x2e6a53){return db[_0x721d('0x4a')][_0x721d('0x51')]({'where':{'id':_0x2e3f16['params']['id']}})[_0x721d('0x2f')](function(_0xb45f8a){if(_0xb45f8a){return _0xb45f8a[_0x721d('0x2e')]();}})[_0x721d('0x2f')](function(_0x41421e){rimraf(path['join'](config[_0x721d('0x5d')],_0x721d('0x5e'),path[_0x721d('0x5f')](_0x41421e[_0x721d('0x6')])),function(){});return _0x41421e;})[_0x721d('0x2f')](handleEntityNotFound(_0x440665,null))[_0x721d('0x2f')](respondWithStatusCode(_0x440665,null))['catch'](handleError(_0x440665,null));};exports['webhookGet']=function(_0x3b7a7d,_0xda4b63,_0x40b62e){return BPromise[_0x721d('0xa1')]()[_0x721d('0x2f')](function(){if(!_0x3b7a7d['query'][_0x721d('0x6')]){throw new Error(_0x721d('0xa2'));}if(!_0x3b7a7d[_0x721d('0x3a')][_0x721d('0xa3')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x236bbb=_0x3b7a7d[_0x721d('0x3a')][_0x721d('0xa4')]?_0x3b7a7d[_0x721d('0x3a')][_0x721d('0xa4')]+':'+_0x3b7a7d['query']['port']:_0x721d('0xa5')+_0x3b7a7d[_0x721d('0x3a')][_0x721d('0xa3')];var _0x32c2c1=_0x3b7a7d[_0x721d('0x3a')]['json']?_0x3b7a7d[_0x721d('0x3a')][_0x721d('0x29')]:!![];var _0x472d7f=_0x3b7a7d[_0x721d('0x3a')][_0x721d('0xa6')]?_0x3b7a7d[_0x721d('0x3a')][_0x721d('0xa6')]:null;var _0x292702={'method':_0x3b7a7d[_0x721d('0xa7')],'uri':util[_0x721d('0x53')](_0x721d('0xa8'),_0x236bbb,_0x3b7a7d[_0x721d('0x3a')]['path']),'json':_0x32c2c1,'resolveWithFullResponse':!![],'encoding':_0x472d7f,'qs':_0x3b7a7d[_0x721d('0x3a')]};if(_0x3b7a7d['headers']){_0x292702[_0x721d('0xa9')]=_0x3b7a7d[_0x721d('0xa9')];if(_0x292702[_0x721d('0xa9')]['content-length']){delete _0x292702[_0x721d('0xa9')][_0x721d('0xaa')];}}if(_0x292702[_0x721d('0xa9')][_0x721d('0xab')]){delete _0x292702[_0x721d('0xa9')][_0x721d('0xab')];}return rp(_0x292702);})['then'](function(_0x192981){if(_0x192981){_0xda4b63[_0x721d('0x27')](_0x192981[_0x721d('0xa9')]);logger['info'](_0x192981['body']);if(_[_0x721d('0xac')](_0x3b7a7d[_0x721d('0x3a')][_0x721d('0x6')],_0x721d('0xad'))&&_0x192981[_0x721d('0xae')]==0x1f4){return _0xda4b63[_0x721d('0x21')](_0x192981[_0x721d('0xae')]);}else{return _0xda4b63['status'](_0x192981[_0x721d('0xae')])[_0x721d('0x9d')](_0x192981[_0x721d('0x95')]);}}else{return _0xda4b63[_0x721d('0x21')](0xc8);}})[_0x721d('0x4e')](handleError(_0xda4b63,null));};exports[_0x721d('0xaf')]=function(_0x237bc4,_0x11359d,_0x187b07){return BPromise[_0x721d('0xa1')]()[_0x721d('0x2f')](function(){if(!_0x237bc4[_0x721d('0x3a')][_0x721d('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x237bc4[_0x721d('0x3a')]['port']){throw new Error(_0x721d('0xb0'));}var _0x44dcb7=_0x237bc4[_0x721d('0x3a')][_0x721d('0xa4')]?_0x237bc4[_0x721d('0x3a')][_0x721d('0xa4')]+':'+_0x237bc4[_0x721d('0x3a')][_0x721d('0xa3')]:_0x721d('0xa5')+_0x237bc4[_0x721d('0x3a')][_0x721d('0xa3')];var _0x8b4d13=_0x237bc4[_0x721d('0x3a')][_0x721d('0x29')]?_0x237bc4[_0x721d('0x3a')][_0x721d('0x29')]:!![];var _0x1f4835=_0x237bc4[_0x721d('0x3a')][_0x721d('0xa6')]?_0x237bc4[_0x721d('0x3a')][_0x721d('0xa6')]:null;var _0x2a99dd={'method':_0x237bc4[_0x721d('0xa7')],'uri':util[_0x721d('0x53')](_0x721d('0xa8'),_0x44dcb7,_0x237bc4[_0x721d('0x3a')][_0x721d('0x6')]),'json':_0x8b4d13,'resolveWithFullResponse':!![],'encoding':_0x1f4835,'body':_0x237bc4['body']};if(_0x237bc4[_0x721d('0xa9')]){_0x2a99dd[_0x721d('0xa9')]=_0x237bc4[_0x721d('0xa9')];if(_0x2a99dd[_0x721d('0xa9')][_0x721d('0xaa')]){delete _0x2a99dd['headers'][_0x721d('0xaa')];}}if(_0x2a99dd[_0x721d('0xa9')][_0x721d('0xab')]){delete _0x2a99dd[_0x721d('0xa9')][_0x721d('0xab')];}return rp(_0x2a99dd);})[_0x721d('0x2f')](function(_0x3fff18){if(_0x3fff18){_0x11359d['set'](_0x3fff18[_0x721d('0xa9')]);logger[_0x721d('0x67')](_0x3fff18[_0x721d('0x95')]);return _0x11359d['status'](_0x3fff18[_0x721d('0xae')])[_0x721d('0x9d')](_0x3fff18['body']);}else{return _0x11359d['sendStatus'](0xc8);}})[_0x721d('0x4e')](handleError(_0x11359d,null));};
\ No newline at end of file
+var _0xb832=['sendStatus','stack','name','send','index','map','Plugin','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','findAll','catch','show','rawAttributes','length','includeAll','find','params','join','root','format','%s.zip','basename','createWriteStream','zip','warning','code','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','server/files/plugins','dirname','attachments/**/*','finalize','close','existsSync','Error','Plugin\x20not\x20found','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','filename','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','parameters','html','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','script','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','content-length','content-type','set','endsWith','download','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Plugins'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0xb832,0x1cd));var _0x2b83=function(_0x2b8fab,_0x258404){_0x2b8fab=_0x2b8fab-0x0;var _0x539ddc=_0xb832[_0x2b8fab];return _0x539ddc;};'use strict';var emlformat=require(_0x2b83('0x0'));var rimraf=require(_0x2b83('0x1'));var zipdir=require(_0x2b83('0x2'));var jsonpatch=require(_0x2b83('0x3'));var rp=require(_0x2b83('0x4'));var moment=require('moment');var BPromise=require(_0x2b83('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2b83('0x6'));var sox=require(_0x2b83('0x7'));var csv=require(_0x2b83('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b83('0x9'));var _=require(_0x2b83('0xa'));var squel=require(_0x2b83('0xb'));var crypto=require(_0x2b83('0xc'));var jsforce=require(_0x2b83('0xd'));var deskjs=require(_0x2b83('0xe'));var toCsv=require(_0x2b83('0x8'));var querystring=require(_0x2b83('0xf'));var Papa=require(_0x2b83('0x10'));var extract=require(_0x2b83('0x11'));var rimraf=require(_0x2b83('0x1'));var archiver=require(_0x2b83('0x12'));var Redis=require(_0x2b83('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2b83('0x14'));var hardwareService=require(_0x2b83('0x15'));var logger=require(_0x2b83('0x16'))(_0x2b83('0x17'));var utils=require(_0x2b83('0x18'));var config=require(_0x2b83('0x19'));var licenseUtil=require(_0x2b83('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2b83('0x1b')](config[_0x2b83('0x1c')],{'host':_0x2b83('0x1d'),'port':0x18eb});var socket=require(_0x2b83('0x1e'))(new Redis(config[_0x2b83('0x1c')]));require(_0x2b83('0x1f'))[_0x2b83('0x20')](socket);function respondWithStatusCode(_0x308cf6,_0x4bfa98){_0x4bfa98=_0x4bfa98||0xcc;return function(_0x4be89b){if(_0x4be89b){return _0x308cf6['sendStatus'](_0x4bfa98);}return _0x308cf6[_0x2b83('0x21')](_0x4bfa98)[_0x2b83('0x22')]();};}function respondWithResult(_0x773add,_0x2c1aa7){_0x2c1aa7=_0x2c1aa7||0xc8;return function(_0x2ed3cc){if(_0x2ed3cc){return _0x773add[_0x2b83('0x21')](_0x2c1aa7)['json'](_0x2ed3cc);}};}function respondWithFilteredResult(_0x3373d9,_0x3e0cd4){return function(_0x2881aa){if(_0x2881aa){var _0x49609f=typeof _0x3e0cd4[_0x2b83('0x23')]===_0x2b83('0x24')&&typeof _0x3e0cd4[_0x2b83('0x25')]===_0x2b83('0x24');var _0x44a002=_0x2881aa[_0x2b83('0x26')];var _0x1008cd=_0x49609f?0x0:_0x3e0cd4[_0x2b83('0x23')];var _0x1d6df2=_0x49609f?_0x2881aa[_0x2b83('0x26')]:_0x3e0cd4['offset']+_0x3e0cd4['limit'];var _0x5b0e2b;if(_0x1d6df2>=_0x44a002){_0x1d6df2=_0x44a002;_0x5b0e2b=0xc8;}else{_0x5b0e2b=0xce;}_0x3373d9['status'](_0x5b0e2b);return _0x3373d9['set'](_0x2b83('0x27'),_0x1008cd+'-'+_0x1d6df2+'/'+_0x44a002)[_0x2b83('0x28')](_0x2881aa);}return null;};}function patchUpdates(_0x3884ea){return function(_0x6707e7){try{jsonpatch[_0x2b83('0x29')](_0x6707e7,_0x3884ea,!![]);}catch(_0x1fad90){return BPromise[_0x2b83('0x2a')](_0x1fad90);}return _0x6707e7[_0x2b83('0x2b')]();};}function saveUpdates(_0x45fdb8,_0x1af668){return function(_0x32ee64){if(_0x32ee64){return _0x32ee64[_0x2b83('0x2c')](_0x45fdb8)[_0x2b83('0x2d')](function(_0x3e0a6e){return _0x3e0a6e;});}return null;};}function removeEntity(_0x59a197,_0x1f3e9f){return function(_0x18305d){if(_0x18305d){return _0x18305d[_0x2b83('0x2e')]()[_0x2b83('0x2d')](function(){var _0xd7ca9f=_0x18305d[_0x2b83('0x2f')]({'plain':!![]});var _0x2664d8=_0x2b83('0x30');return db['UserProfileResource'][_0x2b83('0x2e')]({'where':{'type':_0x2664d8,'resourceId':_0xd7ca9f['id']}})[_0x2b83('0x2d')](function(){return _0x18305d;});})[_0x2b83('0x2d')](function(){_0x59a197['status'](0xcc)[_0x2b83('0x22')]();});}};}function handleEntityNotFound(_0x8a5a18,_0x16c1d6){return function(_0x34e292){if(!_0x34e292){_0x8a5a18[_0x2b83('0x31')](0x194);}return _0x34e292;};}function handleError(_0xe40a4a,_0x1a500b){_0x1a500b=_0x1a500b||0x1f4;return function(_0x3b2bdb){logger['error'](_0x3b2bdb[_0x2b83('0x32')]);if(_0x3b2bdb[_0x2b83('0x33')]){delete _0x3b2bdb[_0x2b83('0x33')];}_0xe40a4a[_0x2b83('0x21')](_0x1a500b)[_0x2b83('0x34')](_0x3b2bdb);};}exports[_0x2b83('0x35')]=function(_0x5117a5,_0x118c49){var _0x3e299={},_0x3d5a1e={},_0x4693a9={'count':0x0,'rows':[]};var _0x41a510=_[_0x2b83('0x36')](db[_0x2b83('0x37')]['rawAttributes'],function(_0xe1f015){return{'name':_0xe1f015['fieldName'],'type':_0xe1f015[_0x2b83('0x38')][_0x2b83('0x39')]};});_0x3d5a1e[_0x2b83('0x3a')]=_[_0x2b83('0x36')](_0x41a510,_0x2b83('0x33'));_0x3d5a1e[_0x2b83('0x3b')]=_[_0x2b83('0x3c')](_0x5117a5[_0x2b83('0x3b')]);_0x3d5a1e['filters']=_[_0x2b83('0x3d')](_0x3d5a1e[_0x2b83('0x3a')],_0x3d5a1e[_0x2b83('0x3b')]);_0x3e299['attributes']=_[_0x2b83('0x3d')](_0x3d5a1e[_0x2b83('0x3a')],qs[_0x2b83('0x3e')](_0x5117a5['query'][_0x2b83('0x3e')]));_0x3e299['attributes']=_0x3e299[_0x2b83('0x3f')]['length']?_0x3e299['attributes']:_0x3d5a1e[_0x2b83('0x3a')];if(!_0x5117a5[_0x2b83('0x3b')]['hasOwnProperty'](_0x2b83('0x40'))){_0x3e299['limit']=qs[_0x2b83('0x25')](_0x5117a5[_0x2b83('0x3b')][_0x2b83('0x25')]);_0x3e299[_0x2b83('0x23')]=qs[_0x2b83('0x23')](_0x5117a5[_0x2b83('0x3b')]['offset']);}_0x3e299[_0x2b83('0x41')]=qs[_0x2b83('0x42')](_0x5117a5[_0x2b83('0x3b')][_0x2b83('0x42')]);_0x3e299[_0x2b83('0x43')]=qs[_0x2b83('0x44')](_[_0x2b83('0x45')](_0x5117a5[_0x2b83('0x3b')],_0x3d5a1e[_0x2b83('0x44')]),_0x41a510);if(_0x5117a5[_0x2b83('0x3b')][_0x2b83('0x46')]){_0x3e299[_0x2b83('0x43')]=_['merge'](_0x3e299[_0x2b83('0x43')],{'$or':_[_0x2b83('0x36')](_0x41a510,function(_0x32d1f4){if(_0x32d1f4['type']!==_0x2b83('0x47')){var _0x5f3625={};_0x5f3625[_0x32d1f4[_0x2b83('0x33')]]={'$like':'%'+_0x5117a5[_0x2b83('0x3b')][_0x2b83('0x46')]+'%'};return _0x5f3625;}})});}_0x3e299=_['merge']({},_0x3e299,_0x5117a5[_0x2b83('0x48')]);var _0x4d7076={'where':_0x3e299[_0x2b83('0x43')]};return db[_0x2b83('0x37')][_0x2b83('0x26')](_0x4d7076)[_0x2b83('0x2d')](function(_0x21d651){_0x4693a9[_0x2b83('0x26')]=_0x21d651;if(_0x5117a5['query']['includeAll']){_0x3e299['include']=[{'all':!![]}];}return db['Plugin'][_0x2b83('0x49')](_0x3e299);})[_0x2b83('0x2d')](function(_0x574e2a){_0x4693a9['rows']=_0x574e2a;return _0x4693a9;})[_0x2b83('0x2d')](respondWithFilteredResult(_0x118c49,_0x3e299))[_0x2b83('0x4a')](handleError(_0x118c49,null));};exports[_0x2b83('0x4b')]=function(_0x278df0,_0x55b455){var _0x2ce8c6={'raw':!![],'where':{'id':_0x278df0['params']['id']}},_0x55b033={};_0x55b033[_0x2b83('0x3a')]=_['keys'](db['Plugin'][_0x2b83('0x4c')]);_0x55b033[_0x2b83('0x3b')]=_[_0x2b83('0x3c')](_0x278df0[_0x2b83('0x3b')]);_0x55b033[_0x2b83('0x44')]=_[_0x2b83('0x3d')](_0x55b033[_0x2b83('0x3a')],_0x55b033[_0x2b83('0x3b')]);_0x2ce8c6[_0x2b83('0x3f')]=_[_0x2b83('0x3d')](_0x55b033['model'],qs[_0x2b83('0x3e')](_0x278df0[_0x2b83('0x3b')][_0x2b83('0x3e')]));_0x2ce8c6[_0x2b83('0x3f')]=_0x2ce8c6[_0x2b83('0x3f')][_0x2b83('0x4d')]?_0x2ce8c6[_0x2b83('0x3f')]:_0x55b033[_0x2b83('0x3a')];if(_0x278df0[_0x2b83('0x3b')][_0x2b83('0x4e')]){_0x2ce8c6['include']=[{'all':!![]}];}_0x2ce8c6=_['merge']({},_0x2ce8c6,_0x278df0[_0x2b83('0x48')]);return db['Plugin'][_0x2b83('0x4f')](_0x2ce8c6)['then'](handleEntityNotFound(_0x55b455,null))['then'](respondWithResult(_0x55b455,null))[_0x2b83('0x4a')](handleError(_0x55b455,null));};exports['download']=function(_0x6d630d,_0x3fe758,_0x5d3c1a){return db[_0x2b83('0x37')][_0x2b83('0x4f')]({'where':{'id':_0x6d630d[_0x2b83('0x50')]['id']},'attributes':[_0x2b83('0x33'),_0x2b83('0x6')],'raw':!![]})[_0x2b83('0x2d')](handleEntityNotFound(_0x3fe758,null))[_0x2b83('0x2d')](function(_0x2a7289){if(_0x2a7289){var _0x446acd=path[_0x2b83('0x51')](config[_0x2b83('0x52')],'server/files/plugins',util[_0x2b83('0x53')](_0x2b83('0x54'),path[_0x2b83('0x55')](_0x2a7289[_0x2b83('0x6')])));var _0x13b43e=fs[_0x2b83('0x56')](_0x446acd);var _0x5d39ea=archiver(_0x2b83('0x57'),{'zlib':{'level':0x9}});_0x5d39ea['on'](_0x2b83('0x58'),function(_0x3755b7){if(_0x3755b7[_0x2b83('0x59')]==='ENOENT'){logger[_0x2b83('0x5a')](_0x3755b7);}else{throw new db[(_0x2b83('0x5b'))]['Error'](_0x2b83('0x5c'));}});_0x5d39ea['on']('error',function(_0x3adfaa){throw new db[(_0x2b83('0x5b'))]['Error'](_0x2b83('0x5c'));});_0x5d39ea['pipe'](_0x13b43e);_0x5d39ea['glob'](_0x2b83('0x5d'),{'cwd':path[_0x2b83('0x51')](config['root'],_0x2b83('0x5e'),path[_0x2b83('0x5f')](_0x2a7289[_0x2b83('0x6')])),'ignore':[path[_0x2b83('0x51')](path[_0x2b83('0x55')](_0x2a7289['path']),'node_modules/**/*'),path['join'](path[_0x2b83('0x55')](_0x2a7289[_0x2b83('0x6')]),_0x2b83('0x60'))],'nodir':!![]})[_0x2b83('0x61')]();_0x13b43e['on'](_0x2b83('0x62'),function(){if(!fs[_0x2b83('0x63')](_0x446acd)){throw new db[(_0x2b83('0x5b'))][(_0x2b83('0x64'))](_0x2b83('0x65'));}return _0x3fe758['download'](_0x446acd,util[_0x2b83('0x53')]('%s.zip',path[_0x2b83('0x55')](_0x2a7289[_0x2b83('0x6')])),function(_0x411161){if(_0x411161){throw new db[(_0x2b83('0x5b'))][(_0x2b83('0x64'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x2b83('0x66')](_0x446acd);logger['info'](_0x2b83('0x67'));logger[_0x2b83('0x68')](_0x2b83('0x69'));});});}return null;})[_0x2b83('0x4a')](handleError(_0x3fe758,null));};exports[_0x2b83('0x6a')]=function(_0x2c1432,_0xb9e605,_0x3d2bea){var _0x350d61=path[_0x2b83('0x55')](_0x2c1432['file'][_0x2b83('0x6b')],path['extname'](_0x2c1432[_0x2b83('0x6c')][_0x2b83('0x6b')]));var _0x570ad3=path[_0x2b83('0x51')](config[_0x2b83('0x52')],'server/files/plugins',_0x2c1432[_0x2b83('0x6c')][_0x2b83('0x6b')]);var _0x3c96d6=path['join'](config[_0x2b83('0x52')],_0x2b83('0x5e'),_0x350d61);logger[_0x2b83('0x68')](_0x2b83('0x6d'),_0x570ad3);logger[_0x2b83('0x68')](_0x2b83('0x6e'),_0x3c96d6);try{fs['chmodSync'](_0x570ad3,parseInt(_0x2b83('0x6f'),0x8));extract(_0x570ad3,{'dir':_0x3c96d6},function(_0x283b28){if(_0x283b28){logger[_0x2b83('0x5a')](_0x283b28);handleError(_0x283b28,!![]);};var _0x1b60d6=fs[_0x2b83('0x70')](_0x3c96d6);if(_0x1b60d6[_0x2b83('0x4d')]>0x1){removeReferences(_0x570ad3,_0x3c96d6);logger[_0x2b83('0x5a')](_0x2b83('0x71'));return _0x3d2bea(new Error(_0x2b83('0x71')));}var _0x469586=fs[_0x2b83('0x72')](path[_0x2b83('0x51')](_0x3c96d6,_0x1b60d6[0x0]));if(_0x469586[_0x2b83('0x73')]()){removeReferences(_0x570ad3,_0x3c96d6);logger[_0x2b83('0x5a')](_0x2b83('0x71'));return _0x3d2bea(new Error(_0x2b83('0x71')));}if(_0x469586[_0x2b83('0x74')]()){var _0xa811a6=fs[_0x2b83('0x70')](path['join'](_0x3c96d6,_0x1b60d6[0x0]));if(_0xa811a6[_0x2b83('0x4d')]===0x0){removeReferences(_0x570ad3,_0x3c96d6);logger[_0x2b83('0x5a')](_0x2b83('0x71'));return _0x3d2bea(new Error(_0x2b83('0x71')));}var _0x1850b8=_0xa811a6[_0x2b83('0x75')](function(_0x3fcb59){return _0x3fcb59===_0x2b83('0x76');});if(!_0x1850b8){return _0x3d2bea(new Error(_0x2b83('0x77')));}var _0x4e1bdc=fs[_0x2b83('0x78')](path[_0x2b83('0x51')](_0x3c96d6,_0x1b60d6[0x0],_0x2b83('0x76')));var _0x5e1c78=JSON[_0x2b83('0x79')](_0x4e1bdc);if(_0x2b83('0x24')==typeof _0x5e1c78[_0x2b83('0x33')]){return _0x3d2bea(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x2b83('0x24')==typeof _0x5e1c78[_0x2b83('0x38')]){return _0x3d2bea(new Error(_0x2b83('0x7a')));}if('undefined'==typeof _0x5e1c78['version']){return _0x3d2bea(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x2b83('0x24')==typeof _0x5e1c78[_0x2b83('0x7b')]){return _0x3d2bea(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x5e1c78['type']===_0x2b83('0x7c')){if('undefined'==typeof _0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x7d')]){return _0x3d2bea(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x2b83('0x24')==typeof _0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x7d')][_0x2b83('0x7e')]&&_0x2b83('0x24')==typeof _0x5e1c78['parameters']['views']['agent']){return _0x3d2bea(new Error(_0x2b83('0x7f')));}}else if(_0x5e1c78[_0x2b83('0x38')]==='script'){if(_0x2b83('0x24')==typeof _0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x80')]){return _0x3d2bea(new Error(_0x2b83('0x81')));}if(_0x2b83('0x24')==typeof _0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x82')]){return _0x3d2bea(new Error(_0x2b83('0x83')));}}else{return _0x3d2bea(new Error(_0x2b83('0x84')));}var _0xb14b12=_0x5e1c78[_0x2b83('0x33')];var _0x45ccf9=_0x5e1c78[_0x2b83('0x85')];var _0x4afe54=_0x5e1c78[_0x2b83('0x38')];var _0x3b44eb=_0x5e1c78[_0x2b83('0x86')]?_0x5e1c78[_0x2b83('0x86')]:_0x2b83('0x87');var _0x2704be=_0x5e1c78[_0x2b83('0x88')]?_0x5e1c78['icon']:_0x2b83('0x89');var _0x253a8e='';var _0x5cbbe4='';var _0x55eee9='';var _0x36ff2a='';var _0x3ce6a9=_0x5e1c78['version'];if(_0x4afe54===_0x2b83('0x7c')){if(_0x2b83('0x24')!=typeof _0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x7d')][_0x2b83('0x7e')]){var _0x260cd8=_0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x7d')][_0x2b83('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x2b83('0x8a')](_0x260cd8)){_0x253a8e=path[_0x2b83('0x51')](_0x2b83('0x8b'),_0x350d61,_0x1b60d6[0x0],_0x260cd8);}else{_0x253a8e=_0x260cd8;}}else{logger[_0x2b83('0x68')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x2b83('0x24')!=typeof _0x5e1c78[_0x2b83('0x7b')]['views'][_0x2b83('0x8c')]){var _0xca37f7=_0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x7d')][_0x2b83('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x2b83('0x8a')](_0xca37f7)){_0x5cbbe4=path[_0x2b83('0x51')]('plugins',_0x350d61,_0x1b60d6[0x0],_0xca37f7);}else{_0x5cbbe4=_0xca37f7;}}else{logger[_0x2b83('0x68')](_0x2b83('0x8d'));}}else if(_0x4afe54===_0x2b83('0x8e')){_0x55eee9=_0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x80')];_0x36ff2a=_0x5e1c78[_0x2b83('0x7b')]['scriptPath'];if(_0x2b83('0x24')!=typeof _0x5e1c78['parameters'][_0x2b83('0x7d')]){if(_0x2b83('0x24')!=typeof _0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x7d')][_0x2b83('0x7e')]){var _0x260cd8=_0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x7d')][_0x2b83('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x2b83('0x8a')](_0x260cd8)){_0x253a8e=path[_0x2b83('0x51')](_0x2b83('0x8b'),_0x350d61,_0x1b60d6[0x0],_0x260cd8);}else{_0x253a8e=_0x260cd8;}}if(_0x2b83('0x24')!=typeof _0x5e1c78[_0x2b83('0x7b')][_0x2b83('0x7d')][_0x2b83('0x8c')]){var _0xca37f7=_0x5e1c78['parameters'][_0x2b83('0x7d')][_0x2b83('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x2b83('0x8a')](_0xca37f7)){_0x5cbbe4=path['join'](_0x2b83('0x8b'),_0x350d61,_0x1b60d6[0x0],_0xca37f7);}else{_0x5cbbe4=_0xca37f7;}}}}var _0xed2291={'name':_0xb14b12,'description':_0x45ccf9,'path':path[_0x2b83('0x51')](_0x350d61,_0x1b60d6[0x0]),'type':_0x4afe54,'sidebar':_0x3b44eb,'icon':_0x2704be,'adminUrl':_0x253a8e,'agentUrl':_0x5cbbe4,'scriptName':_0x55eee9,'scriptPath':_0x36ff2a,'version':_0x3ce6a9};removeReferences(_0x570ad3,null);return db[_0x2b83('0x37')]['create'](_0xed2291)['then'](function(_0x33c3d8){var _0x4664b7={'role':_0x2c1432[_0x2b83('0x8f')]['role'],'userProfileId':_0x2c1432['body'][_0x2b83('0x90')]};if(!_0x4664b7)throw new Error(_0x2b83('0x91'));if(_0x4664b7[_0x2b83('0x92')]===_0x2b83('0x93')){var _0x24c525=_0x33c3d8['get']({'plain':!![]});return db[_0x2b83('0x94')][_0x2b83('0x4f')]({'where':{'name':_0x2b83('0x30'),'userProfileId':_0x4664b7[_0x2b83('0x90')]},'raw':!![]})['then'](function(_0x1ff411){if(_0x1ff411&&_0x1ff411[_0x2b83('0x95')]===0x0){return db['UserProfileResource'][_0x2b83('0x96')]({'name':_0x24c525[_0x2b83('0x33')],'resourceId':_0x24c525['id'],'type':_0x1ff411[_0x2b83('0x33')],'sectionId':_0x1ff411['id']},{})[_0x2b83('0x2d')](function(){return _0x33c3d8;});}else{return _0x33c3d8;}})[_0x2b83('0x4a')](function(_0x17ef51){logger[_0x2b83('0x5a')](_0x2b83('0x97'),_0x17ef51);throw _0x17ef51;});}return _0x33c3d8;})[_0x2b83('0x2d')](respondWithResult(_0xb9e605,null))[_0x2b83('0x4a')](handleError(_0xb9e605,null));}});}catch(_0x166ebc){_0xb9e605[_0x2b83('0x21')](0x1f4)['send'](_0x166ebc);}};function removeReferences(_0x7d49d5,_0x39c0ee){try{if(_0x7d49d5){fs['unlinkSync'](_0x7d49d5);logger[_0x2b83('0x68')]('Zip\x20archive\x20removed');}if(_0x39c0ee){rimraf(_0x39c0ee,function(){});logger[_0x2b83('0x68')](_0x2b83('0x98'));}}catch(_0x18c23c){logger[_0x2b83('0x5a')](_0x18c23c);}}exports[_0x2b83('0x2c')]=function(_0x527699,_0x48d9f4,_0x2e799f){return db['Plugin']['find']({'where':{'id':_0x527699[_0x2b83('0x50')]['id']}})[_0x2b83('0x2d')](handleEntityNotFound(_0x48d9f4,null))[_0x2b83('0x2d')](saveUpdates(_0x527699['body'],null))[_0x2b83('0x2d')](respondWithResult(_0x48d9f4,null))['catch'](handleError(_0x48d9f4,null));};exports[_0x2b83('0x99')]=function(_0x5add00,_0x15ff27,_0x20fd9f){return db[_0x2b83('0x37')][_0x2b83('0x4f')]({'where':{'id':_0x5add00[_0x2b83('0x50')]['id']}})[_0x2b83('0x2d')](function(_0x697369){if(_0x697369){return _0x697369[_0x2b83('0x2e')]();}})[_0x2b83('0x2d')](function(_0x29c1af){rimraf(path[_0x2b83('0x51')](config[_0x2b83('0x52')],_0x2b83('0x5e'),path[_0x2b83('0x5f')](_0x29c1af[_0x2b83('0x6')])),function(){});return _0x29c1af;})[_0x2b83('0x2d')](handleEntityNotFound(_0x15ff27,null))[_0x2b83('0x2d')](respondWithStatusCode(_0x15ff27,null))[_0x2b83('0x4a')](handleError(_0x15ff27,null));};exports[_0x2b83('0x9a')]=function(_0x213a5b,_0x2bf85d,_0x18a5ec){return BPromise[_0x2b83('0x9b')]()[_0x2b83('0x2d')](function(){if(!_0x213a5b[_0x2b83('0x3b')]['path']){throw new Error(_0x2b83('0x9c'));}if(!_0x213a5b['query'][_0x2b83('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1500d7=_0x213a5b[_0x2b83('0x3b')]['hostname']?_0x213a5b[_0x2b83('0x3b')][_0x2b83('0x9e')]+':'+_0x213a5b[_0x2b83('0x3b')][_0x2b83('0x9d')]:_0x2b83('0x9f')+_0x213a5b['query'][_0x2b83('0x9d')];var _0xc55d00=_0x213a5b[_0x2b83('0x3b')][_0x2b83('0x28')]?_0x213a5b['query'][_0x2b83('0x28')]:!![];var _0x49ecb9=_0x213a5b[_0x2b83('0x3b')][_0x2b83('0xa0')]?_0x213a5b[_0x2b83('0x3b')]['encoding']:null;var _0x10a749={'method':_0x213a5b[_0x2b83('0xa1')],'uri':util['format']('%s%s',_0x1500d7,_0x213a5b[_0x2b83('0x3b')][_0x2b83('0x6')]),'json':_0xc55d00,'resolveWithFullResponse':!![],'encoding':_0x49ecb9,'qs':_0x213a5b['query']};if(_0x213a5b['headers']){_0x10a749[_0x2b83('0xa2')]=_0x213a5b[_0x2b83('0xa2')];if(_0x10a749['headers'][_0x2b83('0xa3')]){delete _0x10a749[_0x2b83('0xa2')]['content-length'];}}if(_0x10a749[_0x2b83('0xa2')][_0x2b83('0xa4')]){delete _0x10a749['headers'][_0x2b83('0xa4')];}return rp(_0x10a749);})['then'](function(_0x231f9b){if(_0x231f9b){_0x2bf85d[_0x2b83('0xa5')](_0x231f9b[_0x2b83('0xa2')]);logger[_0x2b83('0x68')](_0x231f9b[_0x2b83('0x8f')]);if(_[_0x2b83('0xa6')](_0x213a5b[_0x2b83('0x3b')][_0x2b83('0x6')],_0x2b83('0xa7'))&&_0x231f9b[_0x2b83('0xa8')]==0x1f4){return _0x2bf85d[_0x2b83('0x31')](_0x231f9b['statusCode']);}else{return _0x2bf85d[_0x2b83('0x21')](_0x231f9b[_0x2b83('0xa8')])[_0x2b83('0x34')](_0x231f9b[_0x2b83('0x8f')]);}}else{return _0x2bf85d[_0x2b83('0x31')](0xc8);}})[_0x2b83('0x4a')](handleError(_0x2bf85d,null));};exports[_0x2b83('0xa9')]=function(_0x1cad94,_0x595150,_0x3fcbe3){return BPromise[_0x2b83('0x9b')]()[_0x2b83('0x2d')](function(){if(!_0x1cad94[_0x2b83('0x3b')][_0x2b83('0x6')]){throw new Error(_0x2b83('0x9c'));}if(!_0x1cad94[_0x2b83('0x3b')][_0x2b83('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x17f5ca=_0x1cad94[_0x2b83('0x3b')][_0x2b83('0x9e')]?_0x1cad94[_0x2b83('0x3b')][_0x2b83('0x9e')]+':'+_0x1cad94[_0x2b83('0x3b')][_0x2b83('0x9d')]:_0x2b83('0x9f')+_0x1cad94['query'][_0x2b83('0x9d')];var _0x416d24=_0x1cad94['query'][_0x2b83('0x28')]?_0x1cad94[_0x2b83('0x3b')][_0x2b83('0x28')]:!![];var _0x574b82=_0x1cad94['query'][_0x2b83('0xa0')]?_0x1cad94[_0x2b83('0x3b')]['encoding']:null;var _0x56e21c={'method':_0x1cad94[_0x2b83('0xa1')],'uri':util['format']('%s%s',_0x17f5ca,_0x1cad94['query'][_0x2b83('0x6')]),'json':_0x416d24,'resolveWithFullResponse':!![],'encoding':_0x574b82,'body':_0x1cad94[_0x2b83('0x8f')]};if(_0x1cad94[_0x2b83('0xa2')]){_0x56e21c[_0x2b83('0xa2')]=_0x1cad94[_0x2b83('0xa2')];if(_0x56e21c[_0x2b83('0xa2')]['content-length']){delete _0x56e21c[_0x2b83('0xa2')][_0x2b83('0xa3')];}}if(_0x56e21c[_0x2b83('0xa2')]['content-type']){delete _0x56e21c[_0x2b83('0xa2')][_0x2b83('0xa4')];}return rp(_0x56e21c);})[_0x2b83('0x2d')](function(_0x4de378){if(_0x4de378){_0x595150[_0x2b83('0xa5')](_0x4de378[_0x2b83('0xa2')]);logger[_0x2b83('0x68')](_0x4de378[_0x2b83('0x8f')]);return _0x595150[_0x2b83('0x21')](_0x4de378[_0x2b83('0xa8')])[_0x2b83('0x34')](_0x4de378[_0x2b83('0x8f')]);}else{return _0x595150[_0x2b83('0x31')](0xc8);}})[_0x2b83('0x4a')](handleError(_0x595150,null));};
\ No newline at end of file
index 4e4013d..b694644 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaee6=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0xaee6,0x187));var _0x6aee=function(_0x33370a,_0x2d4e21){_0x33370a=_0x33370a-0x0;var _0x39cab2=_0xaee6[_0x33370a];return _0x39cab2;};'use strict';var EventEmitter=require(_0x6aee('0x0'));var Plugin=require(_0x6aee('0x1'))['db'][_0x6aee('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6aee('0x3')](0x0);var events={'afterCreate':_0x6aee('0x4'),'afterUpdate':_0x6aee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46980d){return function(_0x3f11af,_0x1e23ba,_0x5e83b4){PluginEvents[_0x6aee('0x6')](_0x46980d+':'+_0x3f11af['id'],_0x3f11af);PluginEvents[_0x6aee('0x6')](_0x46980d,_0x3f11af);_0x5e83b4(null);};}for(var e in events){if(events[_0x6aee('0x7')](e)){var event=events[e];Plugin[_0x6aee('0x8')](e,emitEvent(event));}}module[_0x6aee('0x9')]=PluginEvents;
\ No newline at end of file
+var _0x07d7=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x50b35d,_0x154364){var _0x50be88=function(_0x37b49e){while(--_0x37b49e){_0x50b35d['push'](_0x50b35d['shift']());}};_0x50be88(++_0x154364);}(_0x07d7,0x85));var _0x707d=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x07d7[_0x1b6563];return _0xdea7b8;};'use strict';var EventEmitter=require(_0x707d('0x0'));var Plugin=require(_0x707d('0x1'))['db'][_0x707d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x707d('0x3')](0x0);var events={'afterCreate':_0x707d('0x4'),'afterUpdate':_0x707d('0x5'),'afterDestroy':_0x707d('0x6')};function emitEvent(_0x3d6fed){return function(_0x38c520,_0x2a5ddd,_0x3b44c7){PluginEvents[_0x707d('0x7')](_0x3d6fed+':'+_0x38c520['id'],_0x38c520);PluginEvents[_0x707d('0x7')](_0x3d6fed,_0x38c520);_0x3b44c7(null);};}for(var e in events){if(events[_0x707d('0x8')](e)){var event=events[e];Plugin[_0x707d('0x9')](e,emitEvent(event));}}module[_0x707d('0xa')]=PluginEvents;
\ No newline at end of file
index 2a2f9e2..65bc6e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafb4=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','plugins'];(function(_0x36284b,_0x2b7436){var _0x23c34a=function(_0x14f579){while(--_0x14f579){_0x36284b['push'](_0x36284b['shift']());}};_0x23c34a(++_0x2b7436);}(_0xafb4,0x78));var _0x4afb=function(_0x5b2a97,_0x4d6912){_0x5b2a97=_0x5b2a97-0x0;var _0x176646=_0xafb4[_0x5b2a97];return _0x176646;};'use strict';var _=require(_0x4afb('0x0'));var util=require(_0x4afb('0x1'));var logger=require('../../config/logger')(_0x4afb('0x2'));var moment=require(_0x4afb('0x3'));var BPromise=require(_0x4afb('0x4'));var rp=require(_0x4afb('0x5'));var fs=require('fs');var path=require(_0x4afb('0x6'));var rimraf=require('rimraf');var config=require(_0x4afb('0x7'));var attributes=require(_0x4afb('0x8'));module['exports']=function(_0x5923c4,_0x9c3c30){return _0x5923c4['define']('Plugin',attributes,{'tableName':_0x4afb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x23d3=['define','Plugin','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./plugin.attributes'];(function(_0x454b0b,_0x5a4ad6){var _0x594286=function(_0x32247e){while(--_0x32247e){_0x454b0b['push'](_0x454b0b['shift']());}};_0x594286(++_0x5a4ad6);}(_0x23d3,0x158));var _0x323d=function(_0x52c3b6,_0x4d3e1e){_0x52c3b6=_0x52c3b6-0x0;var _0x563903=_0x23d3[_0x52c3b6];return _0x563903;};'use strict';var _=require('lodash');var util=require(_0x323d('0x0'));var logger=require(_0x323d('0x1'))(_0x323d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x323d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x323d('0x4'));var config=require(_0x323d('0x5'));var attributes=require(_0x323d('0x6'));module['exports']=function(_0x4efdd9,_0x298d45){return _0x4efdd9[_0x323d('0x7')](_0x323d('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ef0fc2..b533810 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72a0=['then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','./plugin.socket','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw'];(function(_0x25421d,_0xe414e8){var _0x53db46=function(_0x4229d9){while(--_0x4229d9){_0x25421d['push'](_0x25421d['shift']());}};_0x53db46(++_0xe414e8);}(_0x72a0,0x194));var _0x072a=function(_0x371a86,_0x53a38f){_0x371a86=_0x371a86-0x0;var _0x5271e4=_0x72a0[_0x371a86];return _0x5271e4;};'use strict';var _=require(_0x072a('0x0'));var util=require(_0x072a('0x1'));var moment=require(_0x072a('0x2'));var BPromise=require(_0x072a('0x3'));var rs=require(_0x072a('0x4'));var fs=require('fs');var Redis=require(_0x072a('0x5'));var db=require(_0x072a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x072a('0x7'))('rpc');var config=require(_0x072a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x072a('0x9')]['http']({'port':0x232a});config[_0x072a('0xa')]=_[_0x072a('0xb')](config[_0x072a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x072a('0xc'))(new Redis(config[_0x072a('0xa')]));require(_0x072a('0xd'))['register'](socket);function respondWithRpcPromise(_0x1b428a,_0x5d14fb,_0x1789a9){return new BPromise(function(_0x23ca86,_0x20450b){return client['request'](_0x1b428a,_0x1789a9)['then'](function(_0x4be0af){logger['info'](_0x072a('0xe'),_0x5d14fb,'request\x20sent');logger[_0x072a('0xf')](_0x072a('0x10'),_0x5d14fb,_0x072a('0x11'),JSON[_0x072a('0x12')](_0x4be0af));if(_0x4be0af[_0x072a('0x13')]){if(_0x4be0af['error'][_0x072a('0x14')]===0x1f4){logger[_0x072a('0x13')](_0x072a('0xe'),_0x5d14fb,_0x4be0af[_0x072a('0x13')][_0x072a('0x15')]);return _0x20450b(_0x4be0af['error'][_0x072a('0x15')]);}logger[_0x072a('0x13')](_0x072a('0xe'),_0x5d14fb,_0x4be0af[_0x072a('0x13')][_0x072a('0x15')]);return _0x23ca86(_0x4be0af[_0x072a('0x13')][_0x072a('0x15')]);}else{logger['info'](_0x072a('0xe'),_0x5d14fb,'request\x20sent');_0x23ca86(_0x4be0af[_0x072a('0x16')][_0x072a('0x15')]);}})[_0x072a('0x17')](function(_0x47a90a){logger[_0x072a('0x13')](_0x072a('0xe'),_0x5d14fb,_0x47a90a);_0x20450b(_0x47a90a);});});}exports[_0x072a('0x18')]=function(_0x49df14){var _0x255b31=this;return new Promise(function(_0x2dae25,_0x58b855){return db[_0x072a('0x19')][_0x072a('0x1a')](_0x49df14[_0x072a('0x1b')],{'raw':_0x49df14[_0x072a('0x1c')]?_0x49df14[_0x072a('0x1c')][_0x072a('0x1d')]===undefined?!![]:![]:!![]})[_0x072a('0x1e')](function(_0x84587b){logger['info']('CreatePlugin',_0x49df14);logger[_0x072a('0xf')](_0x072a('0x18'),_0x49df14,JSON['stringify'](_0x84587b));_0x2dae25(_0x84587b);})[_0x072a('0x17')](function(_0x29a50c){logger[_0x072a('0x13')](_0x072a('0x18'),_0x29a50c['message'],_0x49df14);_0x58b855(_0x255b31[_0x072a('0x13')](0x1f4,_0x29a50c[_0x072a('0x15')]));});});};
\ No newline at end of file
+var _0x7f23=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','Plugin','options','raw','then'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x7f23,0x1ef));var _0x37f2=function(_0x186d31,_0x17aae2){_0x186d31=_0x186d31-0x0;var _0x3d7b40=_0x7f23[_0x186d31];return _0x3d7b40;};'use strict';var _=require(_0x37f2('0x0'));var util=require(_0x37f2('0x1'));var moment=require(_0x37f2('0x2'));var BPromise=require(_0x37f2('0x3'));var rs=require(_0x37f2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37f2('0x5'))['db'];var utils=require(_0x37f2('0x6'));var logger=require(_0x37f2('0x7'))(_0x37f2('0x8'));var config=require(_0x37f2('0x9'));var jayson=require(_0x37f2('0xa'));var client=jayson['client'][_0x37f2('0xb')]({'port':0x232a});config[_0x37f2('0xc')]=_['defaults'](config['redis'],{'host':_0x37f2('0xd'),'port':0x18eb});var socket=require(_0x37f2('0xe'))(new Redis(config['redis']));require(_0x37f2('0xf'))[_0x37f2('0x10')](socket);function respondWithRpcPromise(_0x497c07,_0x164f2c,_0x2225f7){return new BPromise(function(_0x16d049,_0x31d7ce){return client[_0x37f2('0x11')](_0x497c07,_0x2225f7)['then'](function(_0x2226fd){logger[_0x37f2('0x12')](_0x37f2('0x13'),_0x164f2c,'request\x20sent');logger[_0x37f2('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x164f2c,_0x37f2('0x15'),JSON[_0x37f2('0x16')](_0x2226fd));if(_0x2226fd[_0x37f2('0x17')]){if(_0x2226fd[_0x37f2('0x17')][_0x37f2('0x18')]===0x1f4){logger[_0x37f2('0x17')](_0x37f2('0x13'),_0x164f2c,_0x2226fd[_0x37f2('0x17')][_0x37f2('0x19')]);return _0x31d7ce(_0x2226fd[_0x37f2('0x17')]['message']);}logger['error'](_0x37f2('0x13'),_0x164f2c,_0x2226fd[_0x37f2('0x17')][_0x37f2('0x19')]);return _0x16d049(_0x2226fd[_0x37f2('0x17')][_0x37f2('0x19')]);}else{logger[_0x37f2('0x12')](_0x37f2('0x13'),_0x164f2c,_0x37f2('0x15'));_0x16d049(_0x2226fd[_0x37f2('0x1a')]['message']);}})[_0x37f2('0x1b')](function(_0x58aded){logger[_0x37f2('0x17')](_0x37f2('0x13'),_0x164f2c,_0x58aded);_0x31d7ce(_0x58aded);});});}exports[_0x37f2('0x1c')]=function(_0x56be8b){var _0x4550d3=this;return new Promise(function(_0x76f22d,_0x23c590){return db[_0x37f2('0x1d')]['create'](_0x56be8b['body'],{'raw':_0x56be8b['options']?_0x56be8b[_0x37f2('0x1e')][_0x37f2('0x1f')]===undefined?!![]:![]:!![]})[_0x37f2('0x20')](function(_0x4ec9b2){logger[_0x37f2('0x12')](_0x37f2('0x1c'),_0x56be8b);logger['debug']('CreatePlugin',_0x56be8b,JSON[_0x37f2('0x16')](_0x4ec9b2));_0x76f22d(_0x4ec9b2);})[_0x37f2('0x1b')](function(_0x211d6b){logger[_0x37f2('0x17')](_0x37f2('0x1c'),_0x211d6b['message'],_0x56be8b);_0x23c590(_0x4550d3[_0x37f2('0x17')](0x1f4,_0x211d6b[_0x37f2('0x19')]));});});};
\ No newline at end of file
index 5c422a2..899c019 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x695a=['./plugin.events','save','update','removeListener','register','length','plugin:'];(function(_0x1eeab3,_0x524828){var _0x29b93a=function(_0x5e1682){while(--_0x5e1682){_0x1eeab3['push'](_0x1eeab3['shift']());}};_0x29b93a(++_0x524828);}(_0x695a,0x17a));var _0xa695=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x695a[_0x397e5f];return _0x5302b8;};'use strict';var PluginEvents=require(_0xa695('0x0'));var events=[_0xa695('0x1'),'remove',_0xa695('0x2')];function createListener(_0x5ae274,_0x2e1dfe){return function(_0xa5a1aa){_0x2e1dfe['emit'](_0x5ae274,_0xa5a1aa);};}function removeListener(_0x4067cb,_0x1badb3){return function(){PluginEvents[_0xa695('0x3')](_0x4067cb,_0x1badb3);};}exports[_0xa695('0x4')]=function(_0x20ad77){for(var _0x315503=0x0,_0x158037=events[_0xa695('0x5')];_0x315503<_0x158037;_0x315503++){var _0x49ed13=events[_0x315503];var _0x196c9e=createListener(_0xa695('0x6')+_0x49ed13,_0x20ad77);PluginEvents['on'](_0x49ed13,_0x196c9e);}};
\ No newline at end of file
+var _0x86d9=['length','plugin:','./plugin.events','remove','update','emit'];(function(_0x4d31dc,_0x256804){var _0x47e8dc=function(_0x26ed94){while(--_0x26ed94){_0x4d31dc['push'](_0x4d31dc['shift']());}};_0x47e8dc(++_0x256804);}(_0x86d9,0x116));var _0x986d=function(_0x1139b1,_0x2faefb){_0x1139b1=_0x1139b1-0x0;var _0x3e738b=_0x86d9[_0x1139b1];return _0x3e738b;};'use strict';var PluginEvents=require(_0x986d('0x0'));var events=['save',_0x986d('0x1'),_0x986d('0x2')];function createListener(_0x422a88,_0x38dca1){return function(_0x55fbb5){_0x38dca1[_0x986d('0x3')](_0x422a88,_0x55fbb5);};}function removeListener(_0x54c48c,_0x441ea5){return function(){PluginEvents['removeListener'](_0x54c48c,_0x441ea5);};}exports['register']=function(_0xc9cfc2){for(var _0x39bd6c=0x0,_0x3743f9=events[_0x986d('0x4')];_0x39bd6c<_0x3743f9;_0x39bd6c++){var _0x1b13f4=events[_0x39bd6c];var _0x57adc6=createListener(_0x986d('0x5')+_0x1b13f4,_0xc9cfc2);PluginEvents['on'](_0x1b13f4,_0x57adc6);}};
\ No newline at end of file
index b07a537..1296a1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x3aee34,_0xdcdfe4){var _0x469ec0=function(_0x138e4d){while(--_0x138e4d){_0x3aee34['push'](_0x3aee34['shift']());}};_0x469ec0(++_0xdcdfe4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
+var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x229d64,_0x361e3c){var _0x2d5406=function(_0xd36cc1){while(--_0xd36cc1){_0x229d64['push'](_0x229d64['shift']());}};_0x2d5406(++_0x361e3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
index 1e8af8c..2421cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['stack','name','send','npm\x20install','info','index','list','express','then','describe','catch','create','body','script','join','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','bluebird','status','json'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4dcc72,_0x4b992c){_0x4dcc72=_0x4dcc72-0x0;var _0x4f2b71=_0xb43b[_0x4dcc72];return _0x4f2b71;};'use strict';var _=require(_0xbb43('0x0'));var pm2=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var path=require(_0xbb43('0x3'));var exec=require(_0xbb43('0x4'))['exec'];var BPromise=require(_0xbb43('0x5'));function handleEntityNotFound(_0x41aff6,_0x351254){return function(_0x16432a){if(!_0x16432a){_0x41aff6['sendStatus'](0x194);;}return _0x16432a;};}function respondWithResult(_0x491fb9,_0x378df5){_0x378df5=_0x378df5||0xc8;return function(_0x553520){if(_0x553520){return _0x491fb9[_0xbb43('0x6')](_0x378df5)[_0xbb43('0x7')](_0x553520);}return null;};}function handleError(_0x2a2f11,_0x29ae1a){_0x29ae1a=_0x29ae1a||0x1f4;return function(_0x364718){logger['error'](_0x364718[_0xbb43('0x8')]);if(_0x364718[_0xbb43('0x9')]){delete _0x364718['name'];}_0x2a2f11[_0xbb43('0x6')](_0x29ae1a)[_0xbb43('0xa')](_0x364718);};}function execChildProcess(){return new BPromise(function(_0xd37cdf,_0x5e3611){exec(_0xbb43('0xb'),function(_0x2bef86,_0x480cc2,_0x36a473){logger[_0xbb43('0xc')](_0x480cc2);logger['info'](_0x36a473);if(_0x2bef86){logger['error'](_0x2bef86);return _0x5e3611(_0x2bef86);}return _0xd37cdf(_0x480cc2);});});}exports[_0xbb43('0xd')]=function(_0x4a3714,_0x593d0b){return pm2[_0xbb43('0xe')]()['then'](function(_0x68d45d){if(_0x68d45d){var _0x43021d=_['reject'](_0x68d45d,function(_0x4a6e18){return _0x4a6e18['name']===_0xbb43('0xf')||_0x4a6e18[_0xbb43('0x9')]==='motion2';});return{'rows':_0x43021d,'count':_0x43021d['length']};}return null;})[_0xbb43('0x10')](respondWithResult(_0x593d0b,null))['catch'](handleError(_0x593d0b,null));};exports['show']=function(_0x2b0797,_0x8242ab){return pm2[_0xbb43('0x11')](_0x2b0797['params']['id'])[_0xbb43('0x10')](respondWithResult(_0x8242ab,null))['then'](handleEntityNotFound(_0x8242ab,null))[_0xbb43('0x12')](handleError(_0x8242ab,null));};exports[_0xbb43('0x13')]=function(_0x4dfc54,_0x5d765b){if(_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')]&&_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x15')]){var _0x5bcce7=path[_0xbb43('0x16')](__dirname,'../../files/plugins',_0x4dfc54[_0xbb43('0x14')]['script']);var _0x2f5e31=process['cwd']();process[_0xbb43('0x17')](path[_0xbb43('0x18')](_0x5bcce7));return execChildProcess()['then'](function(_0x1d0768){process['chdir'](_0x2f5e31);return pm2[_0xbb43('0x19')]({'name':_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')],'script':_0x5bcce7});})['then'](function(_0x53f0d5){pm2['dump']();return _0x53f0d5[0x0];})[_0xbb43('0x10')](respondWithResult(_0x5d765b,0xc9))[_0xbb43('0x12')](handleError(_0x5d765b,null));}else{return _0x5d765b['status'](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x1a')});}};exports[_0xbb43('0x1b')]=function(_0x3874fb,_0x4ed43f){if(_0x3874fb['body']['id']){delete _0x3874fb[_0xbb43('0x14')]['id'];}var _0x42800f={'online':_0xbb43('0x1c'),'stopped':_0xbb43('0x1d')};if(_0x42800f[_0xbb43('0x1e')](_0x3874fb[_0xbb43('0x14')][_0xbb43('0x6')])){return pm2[_0x42800f[_0x3874fb[_0xbb43('0x14')]['status']]](_0x3874fb[_0xbb43('0x1f')]['id'])['then'](respondWithResult(_0x4ed43f,0xc8))[_0xbb43('0x12')](handleError(_0x4ed43f,null));}else{return _0x4ed43f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x20')});}};exports['destroy']=function(_0x157d62,_0x547a6f){if(_0x157d62['body']['id']){delete _0x157d62['body']['id'];}if(_0x157d62[_0xbb43('0x1f')]['id']){return pm2['delete'](_0x157d62[_0xbb43('0x1f')]['id'])[_0xbb43('0x10')](function(_0xc577ac){pm2['dump']();return _0xc577ac[0x0];})[_0xbb43('0x10')](respondWithResult(_0x547a6f,null))[_0xbb43('0x12')](handleError(_0x547a6f,null));}else{return _0x547a6f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x21')});}};
\ No newline at end of file
+var _0x7072=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','sendStatus','status','json','name','send','npm\x20install','info','error','list','then','reject','express','length','catch','show','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump'];(function(_0x40e009,_0x2ccfac){var _0x1d4f86=function(_0x3df16a){while(--_0x3df16a){_0x40e009['push'](_0x40e009['shift']());}};_0x1d4f86(++_0x2ccfac);}(_0x7072,0x138));var _0x2707=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x7072[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var pm2=require(_0x2707('0x0'));var logger=require(_0x2707('0x1'))(_0x2707('0x2'));var path=require(_0x2707('0x3'));var exec=require(_0x2707('0x4'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0xfdfa7a,_0x5f3c1c){return function(_0xd36287){if(!_0xd36287){_0xfdfa7a[_0x2707('0x5')](0x194);;}return _0xd36287;};}function respondWithResult(_0x1e86f2,_0x194132){_0x194132=_0x194132||0xc8;return function(_0x2fd8ff){if(_0x2fd8ff){return _0x1e86f2[_0x2707('0x6')](_0x194132)[_0x2707('0x7')](_0x2fd8ff);}return null;};}function handleError(_0x745cfd,_0x4062b6){_0x4062b6=_0x4062b6||0x1f4;return function(_0x2820ef){logger['error'](_0x2820ef['stack']);if(_0x2820ef[_0x2707('0x8')]){delete _0x2820ef[_0x2707('0x8')];}_0x745cfd[_0x2707('0x6')](_0x4062b6)[_0x2707('0x9')](_0x2820ef);};}function execChildProcess(){return new BPromise(function(_0x30090e,_0x2e1a46){exec(_0x2707('0xa'),function(_0x19881c,_0x115535,_0x478717){logger[_0x2707('0xb')](_0x115535);logger[_0x2707('0xb')](_0x478717);if(_0x19881c){logger[_0x2707('0xc')](_0x19881c);return _0x2e1a46(_0x19881c);}return _0x30090e(_0x115535);});});}exports['index']=function(_0x44c1d7,_0x590152){return pm2[_0x2707('0xd')]()[_0x2707('0xe')](function(_0xfe975c){if(_0xfe975c){var _0x3a67f2=_[_0x2707('0xf')](_0xfe975c,function(_0x4e52a3){return _0x4e52a3[_0x2707('0x8')]===_0x2707('0x10')||_0x4e52a3[_0x2707('0x8')]==='motion2';});return{'rows':_0x3a67f2,'count':_0x3a67f2[_0x2707('0x11')]};}return null;})[_0x2707('0xe')](respondWithResult(_0x590152,null))[_0x2707('0x12')](handleError(_0x590152,null));};exports[_0x2707('0x13')]=function(_0x7ed037,_0x27a3ea){return pm2['describe'](_0x7ed037[_0x2707('0x14')]['id'])[_0x2707('0xe')](respondWithResult(_0x27a3ea,null))[_0x2707('0xe')](handleEntityNotFound(_0x27a3ea,null))['catch'](handleError(_0x27a3ea,null));};exports['create']=function(_0x58a4ee,_0x1da4a6){if(_0x58a4ee[_0x2707('0x15')][_0x2707('0x8')]&&_0x58a4ee[_0x2707('0x15')][_0x2707('0x16')]){var _0x3c2935=path[_0x2707('0x17')](__dirname,_0x2707('0x18'),_0x58a4ee[_0x2707('0x15')][_0x2707('0x16')]);var _0x37c475=process[_0x2707('0x19')]();process[_0x2707('0x1a')](path[_0x2707('0x1b')](_0x3c2935));return execChildProcess()['then'](function(_0x1acf22){process[_0x2707('0x1a')](_0x37c475);return pm2[_0x2707('0x1c')]({'name':_0x58a4ee[_0x2707('0x15')][_0x2707('0x8')],'script':_0x3c2935});})[_0x2707('0xe')](function(_0x4831ed){pm2[_0x2707('0x1d')]();return _0x4831ed[0x0];})[_0x2707('0xe')](respondWithResult(_0x1da4a6,0xc9))[_0x2707('0x12')](handleError(_0x1da4a6,null));}else{return _0x1da4a6[_0x2707('0x6')](0x1f4)[_0x2707('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2707('0x1e')]=function(_0x4ca05d,_0x29dad2){if(_0x4ca05d[_0x2707('0x15')]['id']){delete _0x4ca05d[_0x2707('0x15')]['id'];}var _0x57da26={'online':_0x2707('0x1f'),'stopped':_0x2707('0x20')};if(_0x57da26[_0x2707('0x21')](_0x4ca05d['body'][_0x2707('0x6')])){return pm2[_0x57da26[_0x4ca05d[_0x2707('0x15')]['status']]](_0x4ca05d[_0x2707('0x14')]['id'])['then'](respondWithResult(_0x29dad2,0xc8))['catch'](handleError(_0x29dad2,null));}else{return _0x29dad2[_0x2707('0x6')](0x1f4)['send']({'message':_0x2707('0x22')});}};exports[_0x2707('0x23')]=function(_0x417a97,_0x36b2e9){if(_0x417a97['body']['id']){delete _0x417a97[_0x2707('0x15')]['id'];}if(_0x417a97[_0x2707('0x14')]['id']){return pm2[_0x2707('0x24')](_0x417a97[_0x2707('0x14')]['id'])[_0x2707('0xe')](function(_0x341e14){pm2[_0x2707('0x1d')]();return _0x341e14[0x0];})[_0x2707('0xe')](respondWithResult(_0x36b2e9,null))[_0x2707('0x12')](handleError(_0x36b2e9,null));}else{return _0x36b2e9['status'](0x1f4)[_0x2707('0x9')]({'message':_0x2707('0x25')});}};
\ No newline at end of file
index 2c0b8cf..3c24713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ea4=['express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','/queues','getQueues','exports'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0x0ea4,0x154));var _0x40ea=function(_0x11d20e,_0x359da9){_0x11d20e=_0x11d20e-0x0;var _0x1262b3=_0x0ea4[_0x11d20e];return _0x1262b3;};'use strict';var express=require(_0x40ea('0x0'));var router=express[_0x40ea('0x1')]();var auth=require(_0x40ea('0x2'));var controller=require(_0x40ea('0x3'));router[_0x40ea('0x4')](_0x40ea('0x5'),auth[_0x40ea('0x6')](),controller['getAgents']);router['get'](_0x40ea('0x7'),auth[_0x40ea('0x6')](),controller[_0x40ea('0x8')]);module[_0x40ea('0x9')]=router;
\ No newline at end of file
+var _0xbd0a=['isAuthenticated','get','/queues','express','Router','../../components/auth/service'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0xbd0a,0x11d));var _0xabd0=function(_0x558495,_0x3e7c5e){_0x558495=_0x558495-0x0;var _0x110063=_0xbd0a[_0x558495];return _0x110063;};'use strict';var express=require(_0xabd0('0x0'));var router=express[_0xabd0('0x1')]();var auth=require(_0xabd0('0x2'));var controller=require('./realtime.controller');router['get']('/agents',auth[_0xabd0('0x3')](),controller['getAgents']);router[_0xabd0('0x4')](_0xabd0('0x5'),auth['isAuthenticated'](),controller['getQueues']);module['exports']=router;
\ No newline at end of file
index ed47dde..763ae1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','fieldName','key','query','role','getOptions','raw','user','userProfileId','agent','nolimit','sort','UserProfile','getResources','rows','omit','globalStatus','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','fax','channel','includes','Invalid\x20channel','QueueCampaigns','Queues','type','findAndCountAll','all','util','lodash','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','limit','count','status','set','Content-Range','error','stack','send','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','loggedInDb','talking','find','pick','filter','queue','name','length','some','connectedlinenum','internal','toString','busy','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','unknown','unavailable','ringing','isNil','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','idle','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','faxPause','chatCapacity','mailCapacity'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x46ed,0x168));var _0xd46e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x46ed[_0x599f41];return _0x2e4d58;};'use strict';var util=require(_0xd46e('0x0'));var _=require(_0xd46e('0x1'));var jayson=require('jayson/promise');var qs=require(_0xd46e('0x2'));var logger=require(_0xd46e('0x3'))(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xd46e('0x5')][_0xd46e('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0xd46e('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x1926d9,_0x160bcf){return function(_0x25cf78){if(_0x25cf78){var _0x45e680=typeof _0x160bcf[_0xd46e('0x7')]===_0xd46e('0x8')&&typeof _0x160bcf[_0xd46e('0x9')]===_0xd46e('0x8');var _0x19e4f4=_0x25cf78[_0xd46e('0xa')];var _0x59c88d=_0x45e680?0x0:_0x160bcf[_0xd46e('0x7')];var _0x81235b=_0x45e680?_0x25cf78['count']:_0x160bcf[_0xd46e('0x7')]+_0x160bcf[_0xd46e('0x9')];var _0x3a4397;if(_0x81235b>=_0x19e4f4){_0x81235b=_0x19e4f4;_0x3a4397=0xc8;}else{_0x3a4397=0xce;}_0x1926d9[_0xd46e('0xb')](_0x3a4397);return _0x1926d9[_0xd46e('0xc')](_0xd46e('0xd'),_0x59c88d+'-'+_0x81235b+'/'+_0x19e4f4)['json'](_0x25cf78);}return null;};}function handleError(_0x24c54b,_0x5bc1da){_0x5bc1da=_0x5bc1da||0x1f4;return function(_0x48550b){logger[_0xd46e('0xe')](_0x48550b[_0xd46e('0xf')]);if(_0x48550b['name']){delete _0x48550b['name'];}_0x24c54b[_0xd46e('0xb')](_0x5bc1da)[_0xd46e('0x10')](_0x48550b);};}function getRealtimeAgents(){return new Promise(function(_0x1e9aae,_0x3fdf88){return amiClient['request'](_0xd46e('0x11'),{})[_0xd46e('0x12')](function(_0x417402){if(_0x417402[_0xd46e('0xe')])throw new Error(_0xd46e('0x13'));var _0x47fa8f=_0x417402[_0xd46e('0x14')];return routingClient[_0xd46e('0x15')](_0xd46e('0x11'),{})['then'](function(_0x5ddd04){if(_0x5ddd04[_0xd46e('0xe')])throw new Error(_0xd46e('0x16'));var _0x488690=_0x5ddd04['result'];return _0x1e9aae(_[_0xd46e('0x17')]({},_0x47fa8f,_0x488690));});})[_0xd46e('0x18')](function(_0x362885){_0x3fdf88(_0x362885);});});}function getRealtimeQueues(_0x2273c5,_0x409010){return new Promise(function(_0x312d6f,_0x3b5fa4){var _0x327b7e=_0x409010===_0xd46e('0x19')?amiClient:routingClient;return _0x327b7e[_0xd46e('0x15')](_[_0xd46e('0x1a')](_0x409010)+'Queues',_0x2273c5)[_0xd46e('0x12')](function(_0x1c83fa){if(_0x1c83fa[_0xd46e('0xe')])throw new Error(util[_0xd46e('0x1b')](_0xd46e('0x1c'),_0x409010));return _0x312d6f(_0x1c83fa[_0xd46e('0x14')]);})[_0xd46e('0x18')](function(_0x8a1be){_0x3b5fa4(_0x8a1be);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x62dea5,_0x4cf899){return amiClient[_0xd46e('0x15')]('VoiceQueuesChannels',{})['then'](function(_0x371054){if(_0x371054[_0xd46e('0xe')])throw new Error(_0xd46e('0x1d'));return _0x62dea5(_0x371054[_0xd46e('0x14')]);})[_0xd46e('0x18')](function(_0x180851){_0x4cf899(_0x180851);});});}function initializeQueues(_0x1740d1,_0x4dab6a,_0x45d789,_0x3c301a){var _0xddbce9=[_0xd46e('0x1e'),_0xd46e('0x1f'),_0xd46e('0x20'),'talking',_0xd46e('0x21')];if(_0x45d789===_0xd46e('0x19')&&_0x3c301a===_0xd46e('0x22')){_0xddbce9[_0xd46e('0x23')](_0xd46e('0x24'),_0xd46e('0x25'),_0xd46e('0x26'),_0xd46e('0x27'),_0xd46e('0x28'),_0xd46e('0x29'),_0xd46e('0x2a'),_0xd46e('0x2b'),_0xd46e('0x2c'),'erlangCallToSecond',_0xd46e('0x2d'),_0xd46e('0x2e'),_0xd46e('0x2f'),_0xd46e('0x30'),'dialPredictiveIntervalMinThreshold',_0xd46e('0x31'),_0xd46e('0x32'),'predictiveIntervalAnsweredCalls',_0xd46e('0x33'),_0xd46e('0x34'),'predictiveIntervalAvgHoldtime',_0xd46e('0x35'));}return _0x1740d1[_0xd46e('0x36')](function(_0x1016e2){var _0x4b5e50=_0x1016e2['get']({'plain':!![]});_0x4b5e50[_0xd46e('0x37')]=[];_0x4b5e50[_0xd46e('0x21')]=0x0;_0x4b5e50[_0xd46e('0x38')]=0x0;_0x4b5e50[_0xd46e('0x1e')]=0x0;_0x4b5e50[_0xd46e('0x1f')]=0x0;_0x4b5e50[_0xd46e('0x20')]=0x0;if(_0x45d789===_0xd46e('0x19')){_0x4b5e50[_0xd46e('0x39')]=0x0;_0x4b5e50['busy']=0x0;if(_0x3c301a===_0xd46e('0x22')){_0x4b5e50[_0xd46e('0x24')]=0x0;_0x4b5e50[_0xd46e('0x25')]=0x0;}}var _0x83aec1=_[_0xd46e('0x3a')](_0x4dab6a,['id',_0x4b5e50['id']]);if(_0x83aec1)_[_0xd46e('0x17')](_0x4b5e50,_[_0xd46e('0x3b')](_0x83aec1,_0xddbce9));return _0x4b5e50;});}function updateAgentVoiceStatus(_0x5158e6,_0x163dd0,_0x357212){var _0x59bf31=_[_0xd46e('0x3c')](_0x357212,[_0xd46e('0x3d'),_0x163dd0[_0xd46e('0x3e')]]);if(_0x59bf31[_0xd46e('0x3f')]===0x0)return _0x5158e6['busy']=!![];if(_[_0xd46e('0x40')](_0x59bf31,[_0xd46e('0x41'),_0x5158e6[_0xd46e('0x42')][_0xd46e('0x43')]()]))return _0x5158e6[_0xd46e('0x39')]=!![];if(!_0x5158e6[_0xd46e('0x39')])return _0x5158e6[_0xd46e('0x44')]=!![];}function getVoiceQueueAgents(_0x411318,_0x56e8d2,_0x232e6f,_0x40aa87){var _0xc83ea1=_[_0xd46e('0x3a')](_0x56e8d2,['id',_0x411318['id']]);if(!_0xc83ea1)return _0x411318;return _0xc83ea1[_0xd46e('0x45')]({'raw':!![]})['then'](function(_0x964c66){for(var _0x53e680=0x0;_0x53e680<_0x964c66['length'];_0x53e680++){var _0x4c325f=_['find'](_0x232e6f,['id',_0x964c66[_0x53e680][_0xd46e('0x46')]]);if(!_0x4c325f){_0x4c325f={'id':_0x964c66[_0x53e680]['UserId'],'name':_0x964c66[_0x53e680][_0xd46e('0x46')],'accountcode':'','online':![]};}var _0x40720e={'id':_0x4c325f['id'],'name':_0x4c325f['name'],'internal':_0x4c325f[_0xd46e('0x47')],'online':Boolean(_0x4c325f[_0xd46e('0x48')]),'paused':Boolean(_0x964c66[_0x53e680][_0xd46e('0x21')])};if(_0x4c325f[_0xd46e('0x49')]===_0xd46e('0x39'))updateAgentVoiceStatus(_0x40720e,_0x411318,_0x40aa87);if(_0x40720e[_0xd46e('0x48')])_0x411318[_0xd46e('0x38')]++;if(_0x40720e[_0xd46e('0x44')])_0x411318[_0xd46e('0x44')]++;if(_0x40720e[_0xd46e('0x21')]&&!_0x40720e[_0xd46e('0x44')]&&!_0x40720e['talking'])_0x411318['paused']++;_0x411318['agents'][_0xd46e('0x23')](_0x40720e);}return _0x411318;});}function getQueueAgents(_0x4e1d94,_0x168d35,_0x272f5f){var _0x3fdf67=_0xd46e('0x4a')+_[_0xd46e('0x1a')](_0x272f5f)+_0xd46e('0x4b');var _0x20b238=_0x272f5f+_0xd46e('0x4c');return db[_0x3fdf67]['findAll']({'where':{[_[_0xd46e('0x1a')](_0x272f5f)+'QueueId']:_0x4e1d94['id']},'raw':!![]})[_0xd46e('0x12')](function(_0x196e51){for(var _0x41a983=0x0;_0x41a983<_0x196e51[_0xd46e('0x3f')];_0x41a983++){var _0x45e53a=_['find'](_0x168d35,['id',_0x196e51[_0x41a983][_0xd46e('0x46')]]);if(!_0x45e53a){_0x45e53a={'id':_0x196e51[_0x41a983][_0xd46e('0x46')],'name':_0x196e51[_0x41a983][_0xd46e('0x46')],'online':![],['pauseField']:![]};}var _0xac268d={'id':_0x45e53a['id'],'name':_0x45e53a[_0xd46e('0x3e')],'online':Boolean(_0x45e53a['online']),'paused':Boolean(_0x45e53a[_0x20b238])};if(_0xac268d[_0xd46e('0x48')])_0x4e1d94[_0xd46e('0x38')]++;_0x4e1d94[_0xd46e('0x37')][_0xd46e('0x23')](_0xac268d);}return _0x4e1d94;});}function isIdle(_0x324b0e){return _0x324b0e==='idle'||_0x324b0e===_0xd46e('0x4d')||_0x324b0e===_0xd46e('0x4e')||_0x324b0e===_0xd46e('0x4f')||_[_0xd46e('0x50')](_0x324b0e);}function isAgentPaused(_0x17a0c7,_0x3ed12f){var _0x433204=[_0x17a0c7[_0xd46e('0x51')],_0x17a0c7['faxPause'],_0x17a0c7[_0xd46e('0x52')],_0x17a0c7[_0xd46e('0x53')],_0x17a0c7[_0xd46e('0x54')],_0x17a0c7[_0xd46e('0x55')],_0x17a0c7[_0xd46e('0x56')]];if(!_0x3ed12f)return _['every'](_0x433204);var _0x4ae314=_[_0xd46e('0x3c')](_0x433204);return _0x4ae314[_0xd46e('0x3f')]>0x0&&_0x4ae314[_0xd46e('0x3f')]<_0x433204['length']?!![]:![];}function isAgentIdle(_0x479711){if(_0x479711[_0xd46e('0x49')]!==_0xd46e('0x57')&&_0x479711['voicePause']){_0x479711[_0xd46e('0x49')]=_0xd46e('0x58');return![];}return _[_0xd46e('0x59')]([_0x479711[_0xd46e('0x5a')],_0x479711[_0xd46e('0x5b')],_0x479711[_0xd46e('0x5c')],_0x479711[_0xd46e('0x5d')],_0x479711[_0xd46e('0x5e')],_0x479711['voiceStatus'],_0x479711[_0xd46e('0x5f')]],isIdle);}function getAgentStatus(_0x259a1d){var _0x1c7f92=_0xd46e('0x4d');if(isAgentPaused(_0x259a1d))_0x1c7f92='pause';else if(isAgentPaused(_0x259a1d,!![]))_0x1c7f92='*pause';else if(isAgentIdle(_0x259a1d))_0x1c7f92=_0xd46e('0x57');else _0x1c7f92='busy';return _0x1c7f92;}exports[_0xd46e('0x60')]=function(_0x2af20b,_0x393cb9){var _0x31f7eb={'count':0x0,'rows':[]},_0x5a7870={},_0x38dfa7,_0x492329,_0x2afb57=[_0xd46e('0x61'),'online',_0xd46e('0x62'),_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x63'),_0xd46e('0x42'),_0xd46e('0x65'),_0xd46e('0x51'),_0xd46e('0x53'),_0xd46e('0x52'),_0xd46e('0x54'),_0xd46e('0x56'),_0xd46e('0x66'),_0xd46e('0x55'),_0xd46e('0x67'),'openchannelCapacity',_0xd46e('0x68'),_0xd46e('0x69'),_0xd46e('0x6a'),_0xd46e('0x6b'),'chatCurrentCapacity',_0xd46e('0x6c'),_0xd46e('0x6d'),_0xd46e('0x6e'),_0xd46e('0x6f'),'faxCurrentCapacity',_0xd46e('0x5a'),_0xd46e('0x5d'),'mailStatus','smsStatus',_0xd46e('0x5f'),_0xd46e('0x5b'),_0xd46e('0x49'),'chatStatusTime','openchannelStatusTime',_0xd46e('0x70'),_0xd46e('0x71'),_0xd46e('0x72'),_0xd46e('0x73'),_0xd46e('0x74'),_0xd46e('0x3d'),_0xd46e('0x75'),_0xd46e('0x76'),_0xd46e('0x77'),_0xd46e('0x78'),_0xd46e('0x79')],_0x354739=[_0xd46e('0x51'),_0xd46e('0x53'),_0xd46e('0x52'),_0xd46e('0x54'),_0xd46e('0x56'),'faxPause',_0xd46e('0x55'),_0xd46e('0x48')];Promise[_0xd46e('0x7a')]()['then'](function(){var _0x41b97c=_[_0xd46e('0x36')](db['User'][_0xd46e('0x7b')],function(_0x2c86fe){return{'name':_0x2c86fe[_0xd46e('0x7c')],'type':_0x2c86fe['type'][_0xd46e('0x7d')]};});_0x2af20b[_0xd46e('0x7e')][_0xd46e('0x7f')]='agent';_0x2af20b[_0xd46e('0x7e')]['online']=!![];_0x5a7870=qs[_0xd46e('0x80')](_0x41b97c,_0x2af20b);_0x5a7870[_0xd46e('0x81')]=!![];if(_0x2af20b[_0xd46e('0x82')]['role']===_0xd46e('0x82')){var _0x3edadc={'params':{'id':_0x2af20b[_0xd46e('0x82')][_0xd46e('0x83')]},'query':{'section':_0xd46e('0x11'),'role':_0xd46e('0x84'),'online':!![],'nolimit':_0x2af20b[_0xd46e('0x7e')][_0xd46e('0x85')],'sort':_0x2af20b[_0xd46e('0x7e')][_0xd46e('0x86')],'filter':_0x2af20b[_0xd46e('0x7e')][_0xd46e('0x3c')],'raw':!![]}};return db[_0xd46e('0x87')][_0xd46e('0x88')](_0x3edadc);}return db['User']['findAndCountAll'](_0x5a7870);})[_0xd46e('0x12')](function(_0x3e0ed5){_0x31f7eb[_0xd46e('0xa')]=_0x3e0ed5[_0xd46e('0xa')];_0x38dfa7=_0x3e0ed5[_0xd46e('0x89')];return getRealtimeAgents();})['then'](function(_0x1ed069){_0x492329=_0x1ed069[_0xd46e('0x89')];return _0x38dfa7[_0xd46e('0x36')](function(_0x7fa262){var _0x539db2=_[_0xd46e('0x3a')](_0x492329,['id',_0x7fa262['id']]);if(_0x539db2)_[_0xd46e('0x17')](_0x7fa262,_['pick'](_[_0xd46e('0x8a')](_0x539db2,_0x354739),_0x2afb57));_0x7fa262[_0xd46e('0x8b')]=getAgentStatus(_0x7fa262);return _0x7fa262;});})['then'](function(_0x38e4f8){if(_0x2af20b[_0xd46e('0x7e')]['globalStatusFilter']){var _0x44ba36=_['filter'](_0x38e4f8,[_0xd46e('0x8b'),_0x2af20b[_0xd46e('0x7e')]['globalStatusFilter']]);if(_0x2af20b['query'][_0xd46e('0x8c')]){_0x44ba36=_[_0xd46e('0x3c')](_0x44ba36,[_0xd46e('0x64'),_0x2af20b[_0xd46e('0x7e')]['pauseTypeFilter']]);}}_0x31f7eb[_0xd46e('0x89')]=_0x44ba36||_0x38e4f8;return _0x31f7eb;})[_0xd46e('0x12')](respondWithFilteredResult(_0x393cb9,_0x5a7870))['catch'](handleError(_0x393cb9,null));};exports[_0xd46e('0x8d')]=function(_0x2a2c4f,_0x2d2af0){var _0x1d8e42=[_0xd46e('0x8e'),_0xd46e('0x8f'),_0xd46e('0x90'),_0xd46e('0x91'),_0xd46e('0x92'),'whatsapp',_0xd46e('0x19')];var _0x1c1bae={'count':0x0,'rows':[]},_0x5ce170={},_0x39fe4d,_0x3ba83f,_0x1a28c1,_0x323044,_0x36fb44;Promise[_0xd46e('0x7a')]()['then'](function(){if(_0x2a2c4f['query'][_0xd46e('0x93')]){if(!_[_0xd46e('0x94')](_0x1d8e42,_0x2a2c4f['query']['channel']['toLowerCase']()))throw new Error(_0xd46e('0x95'));_0x39fe4d=_0x2a2c4f[_0xd46e('0x7e')][_0xd46e('0x93')]['toLowerCase']();}var _0x1b3cd8=_[_0xd46e('0x1a')](_0x39fe4d)+_0xd46e('0x4b');var _0x5186c9=_['map'](db[_0x1b3cd8]['rawAttributes'],function(_0x5c0740){return{'name':_0x5c0740[_0xd46e('0x7c')],'type':_0x5c0740['type'][_0xd46e('0x7d')]};});_0x5ce170=qs['getOptions'](_0x5186c9,_0x2a2c4f);if(_0x2a2c4f['user'][_0xd46e('0x7f')]===_0xd46e('0x82')){var _0x3df2c2={'params':{'id':_0x2a2c4f[_0xd46e('0x82')][_0xd46e('0x83')]},'query':{'section':_0x39fe4d===_0xd46e('0x19')&&_0x2a2c4f['query']['type']===_0xd46e('0x22')?_0xd46e('0x96'):_[_0xd46e('0x1a')](_0x39fe4d)+_0xd46e('0x97'),'type':_0x2a2c4f['query'][_0xd46e('0x98')],'nolimit':!![],'sort':_0xd46e('0x3e'),'filter':_0x2a2c4f['query'][_0xd46e('0x3c')]}};return db['UserProfile'][_0xd46e('0x88')](_0x3df2c2);}return db[_0x1b3cd8][_0xd46e('0x99')](_0x5ce170);})['then'](function(_0x59fb83){_0x1c1bae[_0xd46e('0xa')]=_0x59fb83[_0xd46e('0xa')];_0x3ba83f=_0x59fb83[_0xd46e('0x89')];return getRealtimeQueues(_0x2a2c4f,_0x39fe4d);})['then'](function(_0x24230c){_0x323044=_0x24230c[_0xd46e('0x89')];return getRealtimeAgents();})[_0xd46e('0x12')](function(_0x36edb9){_0x1a28c1=_0x36edb9[_0xd46e('0x89')];if(_0x39fe4d!=_0xd46e('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0xd46e('0x12')](function(_0x14b07a){_0x36fb44=_0x14b07a?_0x14b07a[_0xd46e('0x89')]:[];return initializeQueues(_0x3ba83f,_0x323044,_0x39fe4d,_0x2a2c4f[_0xd46e('0x7e')][_0xd46e('0x98')]);})[_0xd46e('0x12')](function(_0x3c476d){var _0x1b2a6d=_0x3c476d[_0xd46e('0x36')](function(_0x1aa930){if(_0x39fe4d===_0xd46e('0x19'))return getVoiceQueueAgents(_0x1aa930,_0x3ba83f,_0x1a28c1,_0x36fb44);else return getQueueAgents(_0x1aa930,_0x1a28c1,_0x39fe4d);});return Promise[_0xd46e('0x9a')](_0x1b2a6d);})['then'](function(_0x3c9713){_0x1c1bae['rows']=_0x3c9713;return _0x1c1bae;})[_0xd46e('0x12')](respondWithFilteredResult(_0x2d2af0,_0x5ce170))[_0xd46e('0x18')](handleError(_0x2d2af0,null));};
\ No newline at end of file
+var _0x1e68=['chatPause','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','idle','pause','chatStatus','mailStatus','whatsappStatus','*pause','mail','sms','fax','whatsapp','includes','toLowerCase','isArray','findOne','getAgents','all','flatten','uniq','value','lastLoginAt','lastPauseAt','pauseType','address','smsPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','whatsappCurrentCapacity','openchannelStatus','smsStatus','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','query','sort','resolve','channel','globalQueueFilter','rawAttributes','fieldName','type','key','agent','getOptions','raw','isEmpty','where','user','nolimit','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','role','userProfileId','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','http','client','offset','undefined','limit','count','set','Content-Range','json','stack','name','status','send','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','voice','startCase','Queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','paused','outbound','push','pTalking','originated','message','dialActive','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedIn','waiting','busy','find','pick','queue','internal','toString','talking','getMembers','UserId','online','voiceStatus','User','Queue','Pause','findAll','QueueId','length','loggedInDb','unknown','unavailable','ringing','isNil'];(function(_0x3050b5,_0x182c6a){var _0x37cceb=function(_0x49b797){while(--_0x49b797){_0x3050b5['push'](_0x3050b5['shift']());}};_0x37cceb(++_0x182c6a);}(_0x1e68,0xeb));var _0x81e6=function(_0x5a8ca0,_0x145ad1){_0x5a8ca0=_0x5a8ca0-0x0;var _0x23b212=_0x1e68[_0x5a8ca0];return _0x23b212;};'use strict';var util=require(_0x81e6('0x0'));var _=require(_0x81e6('0x1'));var jayson=require(_0x81e6('0x2'));var qs=require(_0x81e6('0x3'));var logger=require(_0x81e6('0x4'))('api');var db=require(_0x81e6('0x5'))['db'];var amiClient=jayson['client'][_0x81e6('0x6')]({'port':0x232a});var routingClient=jayson[_0x81e6('0x7')][_0x81e6('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x442983,_0x1db881){return function(_0xb25c84){if(_0xb25c84){var _0x5c0d6b=typeof _0x1db881[_0x81e6('0x8')]===_0x81e6('0x9')&&typeof _0x1db881[_0x81e6('0xa')]===_0x81e6('0x9');var _0x281805=_0xb25c84[_0x81e6('0xb')];var _0x398969=_0x5c0d6b?0x0:_0x1db881[_0x81e6('0x8')];var _0x3e03f5=_0x5c0d6b?_0xb25c84['count']:_0x1db881[_0x81e6('0x8')]+_0x1db881[_0x81e6('0xa')];var _0x3404ac;if(_0x3e03f5>=_0x281805){_0x3e03f5=_0x281805;_0x3404ac=0xc8;}else{_0x3404ac=0xce;}_0x442983['status'](_0x3404ac);return _0x442983[_0x81e6('0xc')](_0x81e6('0xd'),_0x398969+'-'+_0x3e03f5+'/'+_0x281805)[_0x81e6('0xe')](_0xb25c84);}return null;};}function handleError(_0x32e98b,_0x3cca5c){_0x3cca5c=_0x3cca5c||0x1f4;return function(_0x54760e){logger['error'](_0x54760e[_0x81e6('0xf')]);if(_0x54760e['name']){delete _0x54760e[_0x81e6('0x10')];}_0x32e98b[_0x81e6('0x11')](_0x3cca5c)[_0x81e6('0x12')](_0x54760e);};}function getRealtimeAgents(){return new Promise(function(_0xdffc67,_0xaea68a){return amiClient[_0x81e6('0x13')](_0x81e6('0x14'),{})[_0x81e6('0x15')](function(_0x46aa79){if(_0x46aa79[_0x81e6('0x16')])throw new Error(_0x81e6('0x17'));var _0x11ea9c=_0x46aa79[_0x81e6('0x18')];return routingClient[_0x81e6('0x13')](_0x81e6('0x14'),{})[_0x81e6('0x15')](function(_0x50052b){if(_0x50052b[_0x81e6('0x16')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x5cbaa0=_0x50052b[_0x81e6('0x18')];return _0xdffc67(_[_0x81e6('0x19')]({},_0x11ea9c,_0x5cbaa0));});})[_0x81e6('0x1a')](function(_0x99d5b3){_0xaea68a(_0x99d5b3);});});}function getRealtimeQueues(_0x39d63a,_0x52ea82){return new Promise(function(_0x303fba,_0x405229){var _0x53b87a=_0x52ea82===_0x81e6('0x1b')?amiClient:routingClient;return _0x53b87a[_0x81e6('0x13')](_[_0x81e6('0x1c')](_0x52ea82)+_0x81e6('0x1d'),_0x39d63a)['then'](function(_0x2802c3){if(_0x2802c3[_0x81e6('0x16')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x52ea82));return _0x303fba(_0x2802c3[_0x81e6('0x18')]);})[_0x81e6('0x1a')](function(_0x199589){_0x405229(_0x199589);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x170add,_0x44dad9){return amiClient['request'](_0x81e6('0x1e'),{})[_0x81e6('0x15')](function(_0x5153b4){if(_0x5153b4[_0x81e6('0x16')])throw new Error(_0x81e6('0x1f'));return _0x170add(_0x5153b4[_0x81e6('0x18')]);})[_0x81e6('0x1a')](function(_0x325790){_0x44dad9(_0x325790);});});}function initializeQueues(_0x405248,_0x32e949,_0x2066a6,_0x2361ee){var _0x85be4b=['loggedIn',_0x81e6('0x20'),'waiting','talking',_0x81e6('0x21')];if(_0x2066a6===_0x81e6('0x1b')&&_0x2361ee===_0x81e6('0x22')){_0x85be4b[_0x81e6('0x23')](_0x81e6('0x24'),_0x81e6('0x25'),_0x81e6('0x26'),_0x81e6('0x27'),'dialMethod','Trunk',_0x81e6('0x28'),'startProgressive',_0x81e6('0x29'),_0x81e6('0x2a'),_0x81e6('0x2b'),_0x81e6('0x2c'),'dialPredictiveInterval',_0x81e6('0x2d'),_0x81e6('0x2e'),_0x81e6('0x2f'),_0x81e6('0x30'),_0x81e6('0x31'),'predictiveIntervalDroppedCallsTimeout',_0x81e6('0x32'),'predictiveIntervalAvgHoldtime',_0x81e6('0x33'));}return _0x405248[_0x81e6('0x34')](function(_0x419194){var _0x3917ed=_0x419194[_0x81e6('0x35')]({'plain':!![]});_0x3917ed[_0x81e6('0x36')]=[];_0x3917ed[_0x81e6('0x21')]=0x0;_0x3917ed['loggedInDb']=0x0;_0x3917ed[_0x81e6('0x37')]=0x0;_0x3917ed[_0x81e6('0x20')]=0x0;_0x3917ed[_0x81e6('0x38')]=0x0;if(_0x2066a6==='voice'){_0x3917ed['talking']=0x0;_0x3917ed[_0x81e6('0x39')]=0x0;if(_0x2361ee===_0x81e6('0x22')){_0x3917ed[_0x81e6('0x24')]=0x0;_0x3917ed[_0x81e6('0x25')]=0x0;}}var _0x44644e=_[_0x81e6('0x3a')](_0x32e949,['id',_0x3917ed['id']]);if(_0x44644e)_[_0x81e6('0x19')](_0x3917ed,_[_0x81e6('0x3b')](_0x44644e,_0x85be4b));return _0x3917ed;});}function updateAgentVoiceStatus(_0x2f3122,_0x2d5fb4,_0x54de77){var _0x17c5f3=_['filter'](_0x54de77,[_0x81e6('0x3c'),_0x2d5fb4['name']]);if(_0x17c5f3['length']===0x0)return _0x2f3122[_0x81e6('0x39')]=!![];if(_['some'](_0x17c5f3,['connectedlinenum',_0x2f3122[_0x81e6('0x3d')][_0x81e6('0x3e')]()]))return _0x2f3122[_0x81e6('0x3f')]=!![];if(!_0x2f3122[_0x81e6('0x3f')])return _0x2f3122[_0x81e6('0x39')]=!![];}function getVoiceQueueAgents(_0x32abcc,_0x15a20c,_0x4417a5,_0x5ba16e){var _0x4eae8a=_['find'](_0x15a20c,['id',_0x32abcc['id']]);if(!_0x4eae8a)return _0x32abcc;return _0x4eae8a[_0x81e6('0x40')]({'raw':!![]})[_0x81e6('0x15')](function(_0x4879fc){for(var _0x245736=0x0;_0x245736<_0x4879fc['length'];_0x245736++){var _0x2f74a7=_[_0x81e6('0x3a')](_0x4417a5,['id',_0x4879fc[_0x245736]['UserId']]);if(!_0x2f74a7){_0x2f74a7={'id':_0x4879fc[_0x245736][_0x81e6('0x41')],'name':_0x4879fc[_0x245736][_0x81e6('0x41')],'accountcode':'','online':![]};}var _0x3a51c6={'id':_0x2f74a7['id'],'name':_0x2f74a7[_0x81e6('0x10')],'internal':_0x2f74a7['accountcode'],'online':Boolean(_0x2f74a7[_0x81e6('0x42')]),'paused':Boolean(_0x4879fc[_0x245736]['paused'])};if(_0x2f74a7[_0x81e6('0x43')]===_0x81e6('0x3f'))updateAgentVoiceStatus(_0x3a51c6,_0x32abcc,_0x5ba16e);if(_0x3a51c6[_0x81e6('0x42')])_0x32abcc['loggedInDb']++;if(_0x3a51c6[_0x81e6('0x39')])_0x32abcc[_0x81e6('0x39')]++;if(_0x3a51c6[_0x81e6('0x21')]&&!_0x3a51c6[_0x81e6('0x39')]&&!_0x3a51c6[_0x81e6('0x3f')])_0x32abcc['paused']++;_0x32abcc[_0x81e6('0x36')][_0x81e6('0x23')](_0x3a51c6);}return _0x32abcc;});}function getQueueAgents(_0x18a43b,_0x241501,_0x180130){var _0x5313f0=_0x81e6('0x44')+_[_0x81e6('0x1c')](_0x180130)+_0x81e6('0x45');var _0x417c29=_0x180130+_0x81e6('0x46');return db[_0x5313f0][_0x81e6('0x47')]({'where':{[_[_0x81e6('0x1c')](_0x180130)+_0x81e6('0x48')]:_0x18a43b['id']},'raw':!![]})['then'](function(_0xe23b97){for(var _0x54a2a5=0x0;_0x54a2a5<_0xe23b97[_0x81e6('0x49')];_0x54a2a5++){var _0x5a7ed3=_[_0x81e6('0x3a')](_0x241501,['id',_0xe23b97[_0x54a2a5][_0x81e6('0x41')]]);if(!_0x5a7ed3){_0x5a7ed3={'id':_0xe23b97[_0x54a2a5][_0x81e6('0x41')],'name':_0xe23b97[_0x54a2a5]['UserId'],'online':![],['pauseField']:![]};}var _0x14f5f4={'id':_0x5a7ed3['id'],'name':_0x5a7ed3[_0x81e6('0x10')],'online':Boolean(_0x5a7ed3[_0x81e6('0x42')]),'paused':Boolean(_0x5a7ed3[_0x417c29])};if(_0x14f5f4[_0x81e6('0x42')])_0x18a43b[_0x81e6('0x4a')]++;_0x18a43b[_0x81e6('0x36')][_0x81e6('0x23')](_0x14f5f4);}return _0x18a43b;});}function isIdle(_0x97c4d6){return _0x97c4d6==='idle'||_0x97c4d6===_0x81e6('0x4b')||_0x97c4d6===_0x81e6('0x4c')||_0x97c4d6===_0x81e6('0x4d')||_[_0x81e6('0x4e')](_0x97c4d6);}function isAgentPaused(_0xa07a25,_0x4f86da){var _0x2fab85=[_0xa07a25[_0x81e6('0x4f')],_0xa07a25[_0x81e6('0x50')],_0xa07a25[_0x81e6('0x51')],_0xa07a25[_0x81e6('0x52')],_0xa07a25['smsPause'],_0xa07a25[_0x81e6('0x53')],_0xa07a25[_0x81e6('0x54')]];if(!_0x4f86da)return _[_0x81e6('0x55')](_0x2fab85);var _0x2a2e28=_[_0x81e6('0x56')](_0x2fab85);return _0x2a2e28[_0x81e6('0x49')]>0x0&&_0x2a2e28[_0x81e6('0x49')]<_0x2fab85[_0x81e6('0x49')]?!![]:![];}function isAgentIdle(_0x3d5f4a){if(_0x3d5f4a[_0x81e6('0x43')]!==_0x81e6('0x57')&&_0x3d5f4a[_0x81e6('0x53')]){_0x3d5f4a['voiceStatus']=_0x81e6('0x58');return![];}return _[_0x81e6('0x55')]([_0x3d5f4a[_0x81e6('0x59')],_0x3d5f4a['faxStatus'],_0x3d5f4a[_0x81e6('0x5a')],_0x3d5f4a['openchannelStatus'],_0x3d5f4a['smsStatus'],_0x3d5f4a[_0x81e6('0x43')],_0x3d5f4a[_0x81e6('0x5b')]],isIdle);}function getAgentStatus(_0x547ef9){var _0xffeffb=_0x81e6('0x4b');if(isAgentPaused(_0x547ef9))_0xffeffb='pause';else if(isAgentPaused(_0x547ef9,!![]))_0xffeffb=_0x81e6('0x5c');else if(isAgentIdle(_0x547ef9))_0xffeffb='idle';else _0xffeffb='busy';return _0xffeffb;}function validateChannel(_0x2cb52c){var _0x521494=[_0x81e6('0x5d'),'chat',_0x81e6('0x5e'),'openchannel',_0x81e6('0x5f'),_0x81e6('0x60'),_0x81e6('0x1b')];if(!_[_0x81e6('0x61')](_0x521494,_0x2cb52c[_0x81e6('0x62')]()))throw new Error('Invalid\x20channel');return _0x2cb52c['toLowerCase']();}function getFilteredAgentIds(_0x44b3f3,_0x3ca0c1){var _0x5ba7a9=_[_0x81e6('0x63')](_0x44b3f3)?_0x44b3f3:[_0x44b3f3];var _0x3a98f9=_[_0x81e6('0x34')](_0x5ba7a9,function(_0x41d9fc){return db[_0x3ca0c1][_0x81e6('0x64')]({'where':{'name':_0x41d9fc}})[_0x81e6('0x15')](function(_0x48d086){if(!_0x48d086)return[];return _0x48d086[_0x81e6('0x65')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x81e6('0x66')](_0x3a98f9)[_0x81e6('0x15')](function(_0x192e79){var _0x1aee04=_(_0x192e79)[_0x81e6('0x67')]()[_0x81e6('0x34')]('id')[_0x81e6('0x68')]()[_0x81e6('0x69')]();return _0x1aee04;});}exports[_0x81e6('0x65')]=function(_0x161295,_0x3d2ac8){var _0x101122='';var _0x53d4ce={'count':0x0,'rows':[]},_0x38e248={},_0x36a257,_0x42caee,_0x2de2d3,_0x2a1320=['userpic','online',_0x81e6('0x6a'),_0x81e6('0x6b'),_0x81e6('0x6c'),_0x81e6('0x6b'),_0x81e6('0x3d'),_0x81e6('0x6d'),'chatPause','openchannelPause',_0x81e6('0x51'),_0x81e6('0x6e'),_0x81e6('0x54'),'faxPause',_0x81e6('0x53'),_0x81e6('0x6f'),_0x81e6('0x70'),_0x81e6('0x71'),_0x81e6('0x72'),_0x81e6('0x73'),_0x81e6('0x74'),_0x81e6('0x75'),'openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity',_0x81e6('0x76'),'faxCurrentCapacity','chatStatus',_0x81e6('0x77'),_0x81e6('0x5a'),_0x81e6('0x78'),_0x81e6('0x5b'),_0x81e6('0x79'),_0x81e6('0x43'),_0x81e6('0x7a'),_0x81e6('0x7b'),_0x81e6('0x7c'),'smsStatusTime','whatsappStatusTime',_0x81e6('0x7d'),_0x81e6('0x7e'),_0x81e6('0x3c'),_0x81e6('0x7f'),_0x81e6('0x80'),_0x81e6('0x81'),_0x81e6('0x82'),'routealias'],_0x1be80d=[_0x81e6('0x4f'),_0x81e6('0x52'),'mailPause',_0x81e6('0x6e'),_0x81e6('0x54'),_0x81e6('0x50'),_0x81e6('0x53'),_0x81e6('0x42')];if(_0x161295[_0x81e6('0x83')][_0x81e6('0x84')]&&_0x161295['query'][_0x81e6('0x84')][_0x81e6('0x61')]('globalStatus')){_0x101122=_0x161295[_0x81e6('0x83')][_0x81e6('0x84')];_0x161295[_0x81e6('0x83')]['sort']='';}Promise[_0x81e6('0x85')]()[_0x81e6('0x15')](function(){if(_0x161295['query'][_0x81e6('0x86')])_0x36a257=validateChannel(_0x161295[_0x81e6('0x83')][_0x81e6('0x86')]);if(!_0x161295['query'][_0x81e6('0x87')])return[];var _0xf7b0ba=_[_0x81e6('0x1c')](_0x36a257)+_0x81e6('0x45');return getFilteredAgentIds(_0x161295[_0x81e6('0x83')][_0x81e6('0x87')],_0xf7b0ba);})['then'](function(_0x5b5431){var _0x35d591=_[_0x81e6('0x34')](db[_0x81e6('0x44')][_0x81e6('0x88')],function(_0x11e2d2){return{'name':_0x11e2d2[_0x81e6('0x89')],'type':_0x11e2d2[_0x81e6('0x8a')][_0x81e6('0x8b')]};});_0x161295[_0x81e6('0x83')]['role']=_0x81e6('0x8c');_0x161295[_0x81e6('0x83')][_0x81e6('0x42')]=!![];_0x38e248=qs[_0x81e6('0x8d')](_0x35d591,_0x161295);_0x38e248[_0x81e6('0x8e')]=!![];if(!_[_0x81e6('0x8f')](_0x5b5431)){_0x38e248['where']=_[_0x81e6('0x19')](_0x38e248[_0x81e6('0x90')],{'$and':[{'id':{'$in':_0x5b5431}}]});}else if(!_[_0x81e6('0x8f')](_0x161295['query']['globalQueueFilter'])){return _0x53d4ce;}if(_0x161295[_0x81e6('0x91')]['role']==='user'){var _0x419d90={'params':{'id':_0x161295[_0x81e6('0x91')]['userProfileId']},'query':{'section':_0x81e6('0x14'),'role':_0x81e6('0x8c'),'online':!![],'nolimit':_0x161295[_0x81e6('0x83')][_0x81e6('0x92')],'sort':_0x161295[_0x81e6('0x83')]['sort'],'filter':_0x161295[_0x81e6('0x83')]['filter'],'raw':!![],'ids':_0x5b5431}};return db[_0x81e6('0x93')][_0x81e6('0x94')](_0x419d90);}return db[_0x81e6('0x44')][_0x81e6('0x95')](_0x38e248);})[_0x81e6('0x15')](function(_0x572326){_0x53d4ce['count']=_0x572326[_0x81e6('0xb')];_0x42caee=_0x572326[_0x81e6('0x96')];return getRealtimeAgents();})[_0x81e6('0x15')](function(_0x593467){_0x2de2d3=_0x593467[_0x81e6('0x96')];return _0x42caee['map'](function(_0x86aebb){var _0x15d0ed=_['find'](_0x2de2d3,['id',_0x86aebb['id']]);if(_0x15d0ed)_['merge'](_0x86aebb,_[_0x81e6('0x3b')](_[_0x81e6('0x97')](_0x15d0ed,_0x1be80d),_0x2a1320));_0x86aebb[_0x81e6('0x98')]=getAgentStatus(_0x86aebb);return _0x86aebb;});})[_0x81e6('0x15')](function(_0x89e7b9){if(_0x101122[_0x81e6('0x61')](_0x81e6('0x98'))){var _0x34935f;if(_0x101122['includes']('-'))_0x34935f=_['orderBy'](_0x89e7b9,_0x81e6('0x98'),'desc');else _0x34935f=_['orderBy'](_0x89e7b9,'globalStatus','asc');return _0x34935f;}return _0x89e7b9;})[_0x81e6('0x15')](function(_0x101590){var _0x21134f=undefined;if(_0x161295[_0x81e6('0x83')][_0x81e6('0x99')]){_0x21134f=_[_0x81e6('0x56')](_0x101590,[_0x81e6('0x98'),_0x161295[_0x81e6('0x83')]['globalStatusFilter']]);if(_0x161295[_0x81e6('0x83')][_0x81e6('0x9a')]){_0x21134f=_['filter'](_0x21134f,[_0x81e6('0x6c'),_0x161295[_0x81e6('0x83')][_0x81e6('0x9a')]]);}if(!_0x21134f)return _0x53d4ce={'count':0x0,'rows':[]};}_0x53d4ce[_0x81e6('0x96')]=_0x21134f||_0x101590;return _0x53d4ce;})[_0x81e6('0x15')](respondWithFilteredResult(_0x3d2ac8,_0x38e248))['catch'](handleError(_0x3d2ac8,null));};exports['getQueues']=function(_0x72ab4b,_0x73c4bb){var _0x514579={'count':0x0,'rows':[]},_0x1149dd={},_0x121dc8,_0xb8715b,_0x35a43c,_0x163cdc,_0xa2be09;Promise[_0x81e6('0x85')]()[_0x81e6('0x15')](function(){if(_0x72ab4b[_0x81e6('0x83')][_0x81e6('0x86')])_0x121dc8=validateChannel(_0x72ab4b[_0x81e6('0x83')][_0x81e6('0x86')]);var _0x3fdbc3=_[_0x81e6('0x1c')](_0x121dc8)+_0x81e6('0x45');var _0x26122e=_['map'](db[_0x3fdbc3][_0x81e6('0x88')],function(_0x4d94d4){return{'name':_0x4d94d4[_0x81e6('0x89')],'type':_0x4d94d4['type']['key']};});_0x1149dd=qs[_0x81e6('0x8d')](_0x26122e,_0x72ab4b);if(_0x72ab4b[_0x81e6('0x91')][_0x81e6('0x9b')]===_0x81e6('0x91')){var _0x75874c={'params':{'id':_0x72ab4b[_0x81e6('0x91')][_0x81e6('0x9c')]},'query':{'section':_0x121dc8==='voice'&&_0x72ab4b['query'][_0x81e6('0x8a')]===_0x81e6('0x22')?'QueueCampaigns':_[_0x81e6('0x1c')](_0x121dc8)+_0x81e6('0x1d'),'type':_0x72ab4b['query'][_0x81e6('0x8a')],'nolimit':!![],'sort':_0x81e6('0x10'),'filter':_0x72ab4b['query']['filter']}};return db[_0x81e6('0x93')]['getResources'](_0x75874c);}return db[_0x3fdbc3][_0x81e6('0x95')](_0x1149dd);})[_0x81e6('0x15')](function(_0xd12b4e){_0x514579[_0x81e6('0xb')]=_0xd12b4e[_0x81e6('0xb')];_0xb8715b=_0xd12b4e[_0x81e6('0x96')];return getRealtimeQueues(_0x72ab4b,_0x121dc8);})[_0x81e6('0x15')](function(_0x1236c9){_0x163cdc=_0x1236c9[_0x81e6('0x96')];return getRealtimeAgents();})[_0x81e6('0x15')](function(_0x2131d5){_0x35a43c=_0x2131d5[_0x81e6('0x96')];if(_0x121dc8!=_0x81e6('0x1b'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x503a5f){_0xa2be09=_0x503a5f?_0x503a5f[_0x81e6('0x96')]:[];return initializeQueues(_0xb8715b,_0x163cdc,_0x121dc8,_0x72ab4b['query'][_0x81e6('0x8a')]);})[_0x81e6('0x15')](function(_0x26acb1){var _0x337d79=_0x26acb1[_0x81e6('0x34')](function(_0x427b09){if(_0x121dc8===_0x81e6('0x1b'))return getVoiceQueueAgents(_0x427b09,_0xb8715b,_0x35a43c,_0xa2be09);else return getQueueAgents(_0x427b09,_0x35a43c,_0x121dc8);});return Promise[_0x81e6('0x66')](_0x337d79);})[_0x81e6('0x15')](function(_0x2a4dcb){_0x514579['rows']=_0x2a4dcb;return _0x514579;})[_0x81e6('0x15')](respondWithFilteredResult(_0x73c4bb,_0x1149dd))[_0x81e6('0x1a')](handleError(_0x73c4bb,null));};
\ No newline at end of file
index a2076ac..bb08b91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x140d2f,_0x2ad576){var _0x1a04c6=function(_0x4f742b){while(--_0x4f742b){_0x140d2f['push'](_0x140d2f['shift']());}};_0x1a04c6(++_0x2ad576);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5753ea,_0x5c2ae2){var _0x3e74aa=function(_0x51fcef){while(--_0x51fcef){_0x5753ea['push'](_0x5753ea['shift']());}};_0x3e74aa(++_0x5c2ae2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 995b462..019c511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dd6=['DATE','INTEGER','STRING'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x0dd6,0xca));var _0x60dd=function(_0x3ed72c,_0xe382eb){_0x3ed72c=_0x3ed72c-0x0;var _0x42be69=_0x0dd6[_0x3ed72c];return _0x42be69;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x60dd('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x60dd('0x1')]},'scheduledat':{'type':Sequelize[_0x60dd('0x2')]},'uniqueid':{'type':Sequelize[_0x60dd('0x1')]},'starttime':{'type':Sequelize[_0x60dd('0x2')]},'responsetime':{'type':Sequelize[_0x60dd('0x2')]},'ringtime':{'type':Sequelize[_0x60dd('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x60dd('0x1')]},'campaigntype':{'type':Sequelize[_0x60dd('0x1')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5a5a=['DATE','exports','INTEGER','STRING'];(function(_0x6438af,_0x2ca096){var _0x3b4687=function(_0x5cbf62){while(--_0x5cbf62){_0x6438af['push'](_0x6438af['shift']());}};_0x3b4687(++_0x2ca096);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x11ced7,_0x29a8b0){_0x11ced7=_0x11ced7-0x0;var _0x4bed14=_0x5a5a[_0x11ced7];return _0x4bed14;};'use strict';var Sequelize=require('sequelize');module[_0xa5a5('0x0')]={'state':{'type':Sequelize[_0xa5a5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa5a5('0x2')]},'scheduledat':{'type':Sequelize[_0xa5a5('0x3')]},'uniqueid':{'type':Sequelize[_0xa5a5('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa5a5('0x3')]},'ringtime':{'type':Sequelize[_0xa5a5('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa5a5('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index aef4126..f07a24d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2425=['../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1ce6ce,_0x38835f){var _0x43f898=function(_0x578cc3){while(--_0x578cc3){_0x1ce6ce['push'](_0x1ce6ce['shift']());}};_0x43f898(++_0x38835f);}(_0x2425,0x1f3));var _0x5242=function(_0x2b2af1,_0x3ee788){_0x2b2af1=_0x2b2af1-0x0;var _0x374097=_0x2425[_0x2b2af1];return _0x374097;};'use strict';var _=require(_0x5242('0x0'));var util=require(_0x5242('0x1'));var logger=require(_0x5242('0x2'))(_0x5242('0x3'));var moment=require(_0x5242('0x4'));var BPromise=require(_0x5242('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5242('0x6'));var rimraf=require(_0x5242('0x7'));var config=require(_0x5242('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x5242('0x9')]=function(_0x56474e,_0x5e0162){return _0x56474e[_0x5242('0xa')](_0x5242('0xb'),attributes,{'tableName':_0x5242('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebc3=['exports','define','report_agent_preview','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x4acf48,_0x36192d){var _0x102e65=function(_0x1c4d2c){while(--_0x1c4d2c){_0x4acf48['push'](_0x4acf48['shift']());}};_0x102e65(++_0x36192d);}(_0xebc3,0x157));var _0x3ebc=function(_0x40b901,_0x1d76ca){_0x40b901=_0x40b901-0x0;var _0x2b4160=_0xebc3[_0x40b901];return _0x2b4160;};'use strict';var _=require(_0x3ebc('0x0'));var util=require(_0x3ebc('0x1'));var logger=require(_0x3ebc('0x2'))(_0x3ebc('0x3'));var moment=require('moment');var BPromise=require(_0x3ebc('0x4'));var rp=require(_0x3ebc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ebc('0x6'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0x3ebc('0x7')]=function(_0x5d6e98,_0x55f42d){return _0x5d6e98[_0x3ebc('0x8')]('ReportAgentPreview',attributes,{'tableName':_0x3ebc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fd3ffd2..158f3c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78e8=['ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info'];(function(_0x2bd15c,_0x5395e8){var _0x4d1101=function(_0xd2770c){while(--_0xd2770c){_0x2bd15c['push'](_0x2bd15c['shift']());}};_0x4d1101(++_0x5395e8);}(_0x78e8,0x14f));var _0x878e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x78e8[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x878e('0x0'));var util=require(_0x878e('0x1'));var moment=require('moment');var BPromise=require(_0x878e('0x2'));var rs=require(_0x878e('0x3'));var fs=require('fs');var Redis=require(_0x878e('0x4'));var db=require(_0x878e('0x5'))['db'];var utils=require(_0x878e('0x6'));var logger=require(_0x878e('0x7'))('rpc');var config=require(_0x878e('0x8'));var jayson=require(_0x878e('0x9'));var client=jayson[_0x878e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fce9c,_0x10aabf,_0x22bb31){return new BPromise(function(_0x1b286f,_0x425d95){return client[_0x878e('0xb')](_0x2fce9c,_0x22bb31)['then'](function(_0x2d1027){logger[_0x878e('0xc')](_0x878e('0xd'),_0x10aabf,_0x878e('0xe'));logger[_0x878e('0xf')](_0x878e('0x10'),_0x10aabf,'request\x20sent',JSON['stringify'](_0x2d1027));if(_0x2d1027[_0x878e('0x11')]){if(_0x2d1027['error'][_0x878e('0x12')]===0x1f4){logger['error'](_0x878e('0xd'),_0x10aabf,_0x2d1027[_0x878e('0x11')][_0x878e('0x13')]);return _0x425d95(_0x2d1027[_0x878e('0x11')][_0x878e('0x13')]);}logger[_0x878e('0x11')](_0x878e('0xd'),_0x10aabf,_0x2d1027['error'][_0x878e('0x13')]);return _0x1b286f(_0x2d1027[_0x878e('0x11')][_0x878e('0x13')]);}else{logger[_0x878e('0xc')](_0x878e('0xd'),_0x10aabf,_0x878e('0xe'));_0x1b286f(_0x2d1027[_0x878e('0x14')][_0x878e('0x13')]);}})['catch'](function(_0x5185ee){logger[_0x878e('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x10aabf,_0x5185ee);_0x425d95(_0x5185ee);});});}exports[_0x878e('0x15')]=function(_0x36d665){var _0x316884=this;return new Promise(function(_0x3d1aef,_0x4cc69a){return db[_0x878e('0x16')][_0x878e('0x17')](_0x36d665[_0x878e('0x18')],{'raw':_0x36d665[_0x878e('0x19')]?_0x36d665[_0x878e('0x19')][_0x878e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5a605a){logger[_0x878e('0xc')](_0x878e('0x15'),_0x36d665);logger['debug'](_0x878e('0x15'),_0x36d665,JSON[_0x878e('0x1b')](_0x5a605a));_0x3d1aef(_0x5a605a);})[_0x878e('0x1c')](function(_0x55c088){logger[_0x878e('0x11')](_0x878e('0x15'),_0x55c088[_0x878e('0x13')],_0x36d665);_0x4cc69a(_0x316884[_0x878e('0x11')](0x1f4,_0x55c088[_0x878e('0x13')]));});});};
\ No newline at end of file
+var _0x3de5=['rpc','jayson/promise','client','http','then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x135904,_0x1e252b){var _0x1ce7d5=function(_0x25a721){while(--_0x25a721){_0x135904['push'](_0x135904['shift']());}};_0x1ce7d5(++_0x1e252b);}(_0x3de5,0x68));var _0x53de=function(_0x444783,_0x3f35d5){_0x444783=_0x444783-0x0;var _0x23c9fc=_0x3de5[_0x444783];return _0x23c9fc;};'use strict';var _=require(_0x53de('0x0'));var util=require(_0x53de('0x1'));var moment=require(_0x53de('0x2'));var BPromise=require(_0x53de('0x3'));var rs=require(_0x53de('0x4'));var fs=require('fs');var Redis=require(_0x53de('0x5'));var db=require(_0x53de('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x53de('0x7'))(_0x53de('0x8'));var config=require('../../config/environment');var jayson=require(_0x53de('0x9'));var client=jayson[_0x53de('0xa')][_0x53de('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29f5f7,_0x27e370,_0x1d95b3){return new BPromise(function(_0x4ae718,_0x587b64){return client['request'](_0x29f5f7,_0x1d95b3)[_0x53de('0xc')](function(_0x23b325){logger[_0x53de('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x27e370,'request\x20sent');logger[_0x53de('0xe')](_0x53de('0xf'),_0x27e370,_0x53de('0x10'),JSON[_0x53de('0x11')](_0x23b325));if(_0x23b325[_0x53de('0x12')]){if(_0x23b325[_0x53de('0x12')]['code']===0x1f4){logger['error'](_0x53de('0x13'),_0x27e370,_0x23b325[_0x53de('0x12')][_0x53de('0x14')]);return _0x587b64(_0x23b325[_0x53de('0x12')][_0x53de('0x14')]);}logger[_0x53de('0x12')](_0x53de('0x13'),_0x27e370,_0x23b325['error'][_0x53de('0x14')]);return _0x4ae718(_0x23b325['error']['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x27e370,_0x53de('0x10'));_0x4ae718(_0x23b325[_0x53de('0x15')][_0x53de('0x14')]);}})['catch'](function(_0x1b2bbc){logger['error'](_0x53de('0x13'),_0x27e370,_0x1b2bbc);_0x587b64(_0x1b2bbc);});});}exports[_0x53de('0x16')]=function(_0x387d84){var _0x482ed3=this;return new Promise(function(_0x5d7aae,_0x167e05){return db[_0x53de('0x17')]['create'](_0x387d84[_0x53de('0x18')],{'raw':_0x387d84[_0x53de('0x19')]?_0x387d84[_0x53de('0x19')][_0x53de('0x1a')]===undefined?!![]:![]:!![]})[_0x53de('0xc')](function(_0x1b62eb){logger[_0x53de('0xd')](_0x53de('0x16'),_0x387d84);logger[_0x53de('0xe')](_0x53de('0x16'),_0x387d84,JSON['stringify'](_0x1b62eb));_0x5d7aae(_0x1b62eb);})[_0x53de('0x1b')](function(_0x176b14){logger[_0x53de('0x12')](_0x53de('0x16'),_0x176b14[_0x53de('0x14')],_0x387d84);_0x167e05(_0x482ed3[_0x53de('0x12')](0x1f4,_0x176b14['message']));});});};
\ No newline at end of file
index cf0cf1c..ba77250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7590=['smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','/outbound','outbound','/outbound/channels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','fax','/fax/queues/:id','showFaxQueues','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7590,0x1c6));var _0x0759=function(_0x1e8ec3,_0x3f0312){_0x1e8ec3=_0x1e8ec3-0x0;var _0x2d5f70=_0x7590[_0x1e8ec3];return _0x2d5f70;};'use strict';var multer=require('multer');var util=require(_0x0759('0x0'));var path=require(_0x0759('0x1'));var express=require(_0x0759('0x2'));var router=express[_0x0759('0x3')]();var auth=require(_0x0759('0x4'));var controller=require(_0x0759('0x5'));router[_0x0759('0x6')]('/voice/channels',auth[_0x0759('0x7')](),controller['voiceChannels']);router[_0x0759('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x0759('0x7')](),controller[_0x0759('0x8')]);router[_0x0759('0x6')](_0x0759('0x9'),auth[_0x0759('0x7')](),controller[_0x0759('0xa')]);router['get'](_0x0759('0xb'),auth[_0x0759('0x7')](),controller['voiceQueues']);router[_0x0759('0x6')](_0x0759('0xc'),auth[_0x0759('0x7')](),controller[_0x0759('0xd')]);router[_0x0759('0x6')](_0x0759('0xe'),auth[_0x0759('0x7')](),controller['mailQueues']);router[_0x0759('0x6')](_0x0759('0xf'),auth['isAuthenticated'](),controller[_0x0759('0x10')]);router['get'](_0x0759('0x11'),auth['isAuthenticated'](),controller[_0x0759('0x12')]);router[_0x0759('0x6')](_0x0759('0x13'),auth[_0x0759('0x7')](),controller[_0x0759('0x14')]);router['get'](_0x0759('0x15'),auth[_0x0759('0x7')](),controller[_0x0759('0x16')]);router['get'](_0x0759('0x17'),auth[_0x0759('0x7')](),controller[_0x0759('0x18')]);router[_0x0759('0x6')](_0x0759('0x19'),auth['isAuthenticated'](),controller[_0x0759('0x1a')]);router['get'](_0x0759('0x1b'),auth[_0x0759('0x7')](),controller[_0x0759('0x1c')]);router[_0x0759('0x6')](_0x0759('0x1d'),auth['isAuthenticated'](),controller[_0x0759('0x1e')]);router[_0x0759('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x0759('0x7')](),controller['voiceQueuesChannelHangup']);router['get'](_0x0759('0x1f'),auth[_0x0759('0x7')](),controller[_0x0759('0x20')]);router['get'](_0x0759('0x21'),auth[_0x0759('0x7')](),controller['showVoiceQueues']);router[_0x0759('0x22')]('/voice/queues/:id',auth[_0x0759('0x7')](),controller['updateVoiceQueue']);router['get'](_0x0759('0x23'),auth[_0x0759('0x7')](),controller[_0x0759('0x24')]);router[_0x0759('0x6')](_0x0759('0x25'),auth[_0x0759('0x7')](),controller['outboundChannels']);router[_0x0759('0x6')](_0x0759('0x26'),auth['isAuthenticated'](),controller[_0x0759('0x27')]);router[_0x0759('0x22')]('/agents/:id/capacity',auth[_0x0759('0x7')](),controller[_0x0759('0x28')]);router['get'](_0x0759('0x29'),auth[_0x0759('0x7')](),controller[_0x0759('0x2a')]);router[_0x0759('0x6')](_0x0759('0x2b'),auth['isAuthenticated'](),controller['trunks']);router['get'](_0x0759('0x2c'),auth[_0x0759('0x7')](),controller[_0x0759('0x2d')]);router[_0x0759('0x6')](_0x0759('0x2e'),auth['isAuthenticated'](),controller[_0x0759('0x2f')]);router[_0x0759('0x6')]('/chat/queues/waitinginteractions',auth[_0x0759('0x7')](),controller[_0x0759('0x30')]);router[_0x0759('0x6')](_0x0759('0x31'),auth[_0x0759('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x0759('0x6')](_0x0759('0x32'),auth['isAuthenticated'](),controller[_0x0759('0x33')]);router[_0x0759('0x6')](_0x0759('0x34'),auth['isAuthenticated'](),controller[_0x0759('0x35')]);router[_0x0759('0x6')](_0x0759('0x36'),auth[_0x0759('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x0759('0x6')](_0x0759('0x37'),auth['isAuthenticated'](),controller[_0x0759('0x38')]);router[_0x0759('0x6')](_0x0759('0x39'),auth[_0x0759('0x7')](),controller[_0x0759('0x3a')]);router[_0x0759('0x3b')](_0x0759('0x3c'),auth[_0x0759('0x7')](),controller['queueNotify'](_0x0759('0x3d')));router[_0x0759('0x6')](_0x0759('0x3e'),auth['isAuthenticated'](),controller[_0x0759('0x3f')]);router[_0x0759('0x3b')](_0x0759('0x40'),auth[_0x0759('0x7')](),controller[_0x0759('0x41')](_0x0759('0x42')));router['get'](_0x0759('0x43'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x0759('0x3b')]('/fax/queues/:id/notify',auth[_0x0759('0x7')](),controller[_0x0759('0x41')](_0x0759('0x44')));router['get'](_0x0759('0x45'),auth[_0x0759('0x7')](),controller[_0x0759('0x46')]);router[_0x0759('0x3b')]('/openchannel/queues/:id/notify',auth[_0x0759('0x7')](),controller[_0x0759('0x41')](_0x0759('0x47')));router[_0x0759('0x6')]('/openchannel/queues/:id',auth[_0x0759('0x7')](),controller[_0x0759('0x48')]);router[_0x0759('0x3b')](_0x0759('0x49'),auth[_0x0759('0x7')](),controller[_0x0759('0x41')](_0x0759('0x4a')));router['post']('/whatsapp/queues/:id/notify',auth[_0x0759('0x7')](),controller['queueNotify'](_0x0759('0x4b')));router[_0x0759('0x6')](_0x0759('0x4c'),auth[_0x0759('0x7')](),controller[_0x0759('0x4d')]);router[_0x0759('0x6')]('/whatsapp/queues/:id',auth[_0x0759('0x7')](),controller['showWhatsappQueues']);router[_0x0759('0x3b')]('/agents/:id/notify',auth[_0x0759('0x7')](),controller['agentNotify']);module[_0x0759('0x4e')]=router;
\ No newline at end of file
+var _0x3991=['voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/telephones','telephones','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','showSmsQueues','showWhatsappQueues','agentNotify','exports','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels'];(function(_0x248a43,_0x59e52a){var _0x451379=function(_0x2c5209){while(--_0x2c5209){_0x248a43['push'](_0x248a43['shift']());}};_0x451379(++_0x59e52a);}(_0x3991,0x169));var _0x1399=function(_0x3d9daf,_0x2dbc78){_0x3d9daf=_0x3d9daf-0x0;var _0x472822=_0x3991[_0x3d9daf];return _0x472822;};'use strict';var multer=require('multer');var util=require(_0x1399('0x0'));var path=require(_0x1399('0x1'));var express=require(_0x1399('0x2'));var router=express[_0x1399('0x3')]();var auth=require(_0x1399('0x4'));var controller=require('./rpc.controller');router[_0x1399('0x5')](_0x1399('0x6'),auth[_0x1399('0x7')](),controller[_0x1399('0x8')]);router[_0x1399('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x1399('0x9')]);router[_0x1399('0x5')](_0x1399('0xa'),auth[_0x1399('0x7')](),controller[_0x1399('0xb')]);router[_0x1399('0x5')]('/chat/queues',auth['isAuthenticated'](),controller[_0x1399('0xc')]);router[_0x1399('0x5')](_0x1399('0xd'),auth[_0x1399('0x7')](),controller[_0x1399('0xe')]);router['get']('/mail/accounts',auth[_0x1399('0x7')](),controller[_0x1399('0xf')]);router[_0x1399('0x5')](_0x1399('0x10'),auth[_0x1399('0x7')](),controller[_0x1399('0x11')]);router[_0x1399('0x5')](_0x1399('0x12'),auth[_0x1399('0x7')](),controller[_0x1399('0x13')]);router[_0x1399('0x5')](_0x1399('0x14'),auth[_0x1399('0x7')](),controller[_0x1399('0x15')]);router['get'](_0x1399('0x16'),auth[_0x1399('0x7')](),controller['faxQueues']);router['get'](_0x1399('0x17'),auth[_0x1399('0x7')](),controller['voiceQueuesPreview']);router[_0x1399('0x5')]('/voice/queues/channels',auth[_0x1399('0x7')](),controller['voiceQueuesChannels']);router[_0x1399('0x5')](_0x1399('0x18'),auth[_0x1399('0x7')](),controller['voiceQueuesChannel']);router[_0x1399('0x5')](_0x1399('0x19'),auth['isAuthenticated'](),controller[_0x1399('0x1a')]);router[_0x1399('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x1399('0x7')](),controller[_0x1399('0x1b')]);router[_0x1399('0x5')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x1399('0x1c')]);router[_0x1399('0x1d')](_0x1399('0x1e'),auth[_0x1399('0x7')](),controller['updateVoiceQueue']);router[_0x1399('0x5')](_0x1399('0x1f'),auth[_0x1399('0x7')](),controller[_0x1399('0x20')]);router[_0x1399('0x5')](_0x1399('0x21'),auth[_0x1399('0x7')](),controller[_0x1399('0x22')]);router[_0x1399('0x5')](_0x1399('0x23'),auth['isAuthenticated'](),controller['agents']);router[_0x1399('0x1d')]('/agents/:id/capacity',auth['isAuthenticated'](),controller['agentCapacity']);router[_0x1399('0x5')](_0x1399('0x24'),auth[_0x1399('0x7')](),controller[_0x1399('0x25')]);router[_0x1399('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0x1399('0x26')]);router[_0x1399('0x5')](_0x1399('0x27'),auth[_0x1399('0x7')](),controller['campaigns']);router['get'](_0x1399('0x28'),auth['isAuthenticated'](),controller[_0x1399('0x29')]);router['get'](_0x1399('0x2a'),auth[_0x1399('0x7')](),controller[_0x1399('0x2b')]);router[_0x1399('0x5')](_0x1399('0x2c'),auth[_0x1399('0x7')](),controller['mailQueuesWaitingInteractions']);router['get'](_0x1399('0x2d'),auth['isAuthenticated'](),controller[_0x1399('0x2e')]);router[_0x1399('0x5')](_0x1399('0x2f'),auth['isAuthenticated'](),controller[_0x1399('0x30')]);router[_0x1399('0x5')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x1399('0x5')](_0x1399('0x31'),auth[_0x1399('0x7')](),controller[_0x1399('0x32')]);router['get'](_0x1399('0x33'),auth[_0x1399('0x7')](),controller[_0x1399('0x34')]);router[_0x1399('0x35')](_0x1399('0x36'),auth['isAuthenticated'](),controller['queueNotify'](_0x1399('0x37')));router[_0x1399('0x5')]('/mail/queues/:id',auth[_0x1399('0x7')](),controller[_0x1399('0x38')]);router[_0x1399('0x35')](_0x1399('0x39'),auth[_0x1399('0x7')](),controller[_0x1399('0x3a')](_0x1399('0x3b')));router[_0x1399('0x5')]('/chat/queues/:id',auth[_0x1399('0x7')](),controller[_0x1399('0x3c')]);router[_0x1399('0x35')](_0x1399('0x3d'),auth[_0x1399('0x7')](),controller[_0x1399('0x3a')](_0x1399('0x3e')));router['get']('/fax/queues/:id',auth[_0x1399('0x7')](),controller[_0x1399('0x3f')]);router[_0x1399('0x35')](_0x1399('0x40'),auth['isAuthenticated'](),controller[_0x1399('0x3a')](_0x1399('0x41')));router['get']('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x1399('0x42')]);router['post'](_0x1399('0x43'),auth[_0x1399('0x7')](),controller[_0x1399('0x3a')](_0x1399('0x44')));router[_0x1399('0x35')](_0x1399('0x45'),auth[_0x1399('0x7')](),controller['queueNotify']('whatsapp'));router[_0x1399('0x5')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x1399('0x46')]);router['get']('/whatsapp/queues/:id',auth[_0x1399('0x7')](),controller[_0x1399('0x47')]);router[_0x1399('0x35')]('/agents/:id/notify',auth[_0x1399('0x7')](),controller[_0x1399('0x48')]);module[_0x1399('0x49')]=router;
\ No newline at end of file
index 242882a..638daef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038b=['\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','create','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','update','Start','agentTransferTimeout','moment','lodash','util','../../config/logger','jayson/promise','client','http','request','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','then','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne'];(function(_0x1b14b2,_0x5dea31){var _0x3fe7ea=function(_0x32260b){while(--_0x32260b){_0x1b14b2['push'](_0x1b14b2['shift']());}};_0x3fe7ea(++_0x5dea31);}(_0x038b,0x114));var _0xb038=function(_0x4c0fec,_0x25302f){_0x4c0fec=_0x4c0fec-0x0;var _0xc744f9=_0x038b[_0x4c0fec];return _0xc744f9;};'use strict';var BPromise=require('bluebird');var moment=require(_0xb038('0x0'));var _=require(_0xb038('0x1'));var util=require(_0xb038('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xb038('0x3'))('api');var jayson=require(_0xb038('0x4'));var amiClient=jayson[_0xb038('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xb038('0x5')][_0xb038('0x6')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2e3e64,_0x1b077a,_0x1534a9){return new BPromise(function(_0x4b4085,_0x48a4d7){var _0x462e8f=_0x1534a9?_0x1534a9:amiClient;return _0x462e8f[_0xb038('0x7')](_0x2e3e64,_0x1b077a)['then'](function(_0x53bcc0){if(_0x53bcc0[_0xb038('0x8')]){if(_0x53bcc0[_0xb038('0x8')]['code']===0x1f4){return _0x48a4d7(_0x53bcc0[_0xb038('0x8')][_0xb038('0x9')]);}return _0x4b4085(_0x53bcc0[_0xb038('0x8')][_0xb038('0x9')]);}else{_0x4b4085(_0x53bcc0[_0xb038('0xa')]);}})[_0xb038('0xb')](function(_0x1e6474){_0x48a4d7(_0x1e6474);});});}function respondWithResult(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xc8;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0xc')](_0x16e4a3)[_0xb038('0xd')](_0x57acd8);}return _0x439751[_0xb038('0xe')](0x194);};}function handleError(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0x1f4;return function(_0x13acc7){logger[_0xb038('0x8')](_0x13acc7['stack']);if(_0x13acc7[_0xb038('0xf')]){delete _0x13acc7[_0xb038('0xf')];}_0x3cc717[_0xb038('0xc')](_0x3a71a6)[_0xb038('0x10')](_0x13acc7);};}function findById(_0xdef213){return function(_0x2b4173){if(!_['isNil'](_0xdef213)&&!_[_0xb038('0x11')](_0x2b4173)&&!_[_0xb038('0x11')](_0x2b4173[_0xb038('0x12')])){return _[_0xb038('0x13')](_0x2b4173['rows'],function(_0x49b237){return _0x49b237['id']==_0xdef213;});}return null;};}exports[_0xb038('0x14')]=function(_0x3f48e6,_0x3e06ef){return respondWithRpcPromise(_0xb038('0x15'),_0x3f48e6['query'])[_0xb038('0x16')](respondWithResult(_0x3e06ef,null))[_0xb038('0xb')](handleError(_0x3e06ef,null));};exports[_0xb038('0x17')]=function(_0x33a377,_0xc6cd61){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xb038('0x18')](_0x33a377[_0xb038('0x19')],_0x33a377[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0xc6cd61,null))['catch'](handleError(_0xc6cd61,null));};exports[_0xb038('0x1b')]=function(_0x1b7505,_0x4bbf38){return respondWithRpcPromise(_0xb038('0x1c'),_[_0xb038('0x18')](_0x1b7505['query'],_0x1b7505[_0xb038('0x1a')]))['then'](respondWithResult(_0x4bbf38,null))[_0xb038('0xb')](handleError(_0x4bbf38,null));};exports[_0xb038('0x1d')]=function(_0x27ff21,_0x1df7c4){return respondWithRpcPromise(_0xb038('0x1e'),_0x27ff21[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x1df7c4,null))['catch'](handleError(_0x1df7c4,null));};exports[_0xb038('0x1f')]=function(_0x33cf3c,_0x226631){return respondWithRpcPromise('VoiceQueues',_0x33cf3c[_0xb038('0x19')])[_0xb038('0x16')](findById(_0x33cf3c[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x226631,null))[_0xb038('0xb')](handleError(_0x226631,null));};exports[_0xb038('0x20')]=function(_0x28a6a9,_0x12b3b6){return respondWithRpcPromise(_0xb038('0x21'),_['merge'](_0x28a6a9[_0xb038('0x22')],_0x28a6a9[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x12b3b6,null))[_0xb038('0xb')](handleError(_0x12b3b6,null));};exports[_0xb038('0x23')]=function(_0xbc8958,_0x29a0d7){return respondWithRpcPromise(_0xb038('0x24'),_[_0xb038('0x18')](_0xbc8958[_0xb038('0x19')],_0xbc8958[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x29a0d7,null))[_0xb038('0xb')](handleError(_0x29a0d7,null));};exports['voiceQueuesChannels']=function(_0x1d807a,_0x598554){return respondWithRpcPromise(_0xb038('0x25'),_0x1d807a[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x598554,null))[_0xb038('0xb')](handleError(_0x598554,null));};exports[_0xb038('0x26')]=function(_0x424b81,_0x3a393d){return respondWithRpcPromise(_0xb038('0x27'),_[_0xb038('0x18')](_0x424b81[_0xb038('0x19')],_0x424b81['params']))[_0xb038('0x16')](respondWithResult(_0x3a393d,null))[_0xb038('0xb')](handleError(_0x3a393d,null));};exports[_0xb038('0x28')]=function(_0x560342,_0x51e649){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xb038('0x18')](_0x560342[_0xb038('0x19')],_0x560342[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x51e649,null))[_0xb038('0xb')](handleError(_0x51e649,null));};exports[_0xb038('0x29')]=function(_0x48f777,_0x16abea){return respondWithRpcPromise(_0xb038('0x2a'),_[_0xb038('0x18')](_0x48f777[_0xb038('0x19')],_0x48f777['params']))[_0xb038('0x16')](respondWithResult(_0x16abea,null))[_0xb038('0xb')](handleError(_0x16abea,null));};exports['outbound']=function(_0x5cb40c,_0x26c769){return respondWithRpcPromise(_0xb038('0x2b'),_0x5cb40c[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x26c769,null))[_0xb038('0xb')](handleError(_0x26c769,null));};exports['outboundChannels']=function(_0x404f82,_0x125d2a){return respondWithRpcPromise(_0xb038('0x2c'),_0x404f82[_0xb038('0x19')])['then'](respondWithResult(_0x125d2a,null))[_0xb038('0xb')](handleError(_0x125d2a,null));};exports[_0xb038('0x2d')]=function(_0x7d2f79,_0x573426){var _0x412d71;return respondWithRpcPromise('Agents',_0x7d2f79[_0xb038('0x19')])[_0xb038('0x16')](function(_0x3ac1db){_0x412d71=_0x3ac1db;return respondWithRpcPromise('Agents',_0x7d2f79[_0xb038('0x19')],routingClient);})[_0xb038('0x16')](function(_0x4e0533){return _['merge']({},_0x4e0533,_0x412d71);})[_0xb038('0x16')](respondWithResult(_0x573426,null))[_0xb038('0xb')](handleError(_0x573426,null));};exports[_0xb038('0x2e')]=function(_0x3c291e,_0x5ad462){if(_0x3c291e[_0xb038('0x22')]&&_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')]&&_0x3c291e[_0xb038('0x30')]&&_0x3c291e['user'][_0xb038('0xf')]){for(var _0x269c7d in _0x3c291e['body'][_0xb038('0x2f')]){if(_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')]['hasOwnProperty'](_0x269c7d)){db[_0xb038('0x31')][_0xb038('0x32')]({'where':{'channel':_0x269c7d,'membername':_0x3c291e['user']['name'],'type':_0xb038('0x33'),'exitAt':null,'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d]&&_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0xb038('0x34')]?{'$notIn':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d]}:{'$ne':null}}})['then'](function(_0x5f0d9d){var _0x5e8383=moment()[_0xb038('0x35')](_0xb038('0x36'));for(var _0x52f0b8=0x0,_0x46a724=_0x5f0d9d[_0xb038('0x34')];_0x52f0b8<_0x46a724;_0x52f0b8+=0x1){_0x5f0d9d[_0x52f0b8][_0xb038('0x37')]({'exitAt':_0x5e8383});}});for(var _0x5f24cd=0x0;_0x5f24cd<_0x3c291e[_0xb038('0x22')]['interaction'][_0x269c7d]['length'];_0x5f24cd+=0x1){db[_0xb038('0x31')][_0xb038('0x38')]({'where':{'channel':_0x269c7d,'membername':_0x3c291e[_0xb038('0x30')][_0xb038('0xf')],'type':_0xb038('0x33'),'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0x5f24cd],'exitAt':null},'defaults':{'channel':_0x269c7d,'membername':_0x3c291e[_0xb038('0x30')][_0xb038('0xf')],'interface':_[_0xb038('0x11')](_0x3c291e['user'][_0xb038('0x39')])?util[_0xb038('0x35')]('SIP/%s',_0x3c291e[_0xb038('0x30')][_0xb038('0xf')]):_0x3c291e['user'][_0xb038('0x39')],'type':_0xb038('0x33'),'enterAt':moment()[_0xb038('0x35')](_0xb038('0x36')),'role':_0xb038('0x3a'),'internal':_0x3c291e[_0xb038('0x30')][_0xb038('0x3b')],'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0x5f24cd]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3c291e[_0xb038('0x1a')]['id'],'capacity':_0x3c291e[_0xb038('0x22')][_0xb038('0x3c')]},routingClient)[_0xb038('0x16')](respondWithResult(_0x5ad462,null))[_0xb038('0xb')](handleError(_0x5ad462,null));};exports[_0xb038('0x3d')]=function(_0x591077,_0x1f4997){return respondWithRpcPromise(_0xb038('0x3e'),_0x591077[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x1f4997,null))[_0xb038('0xb')](handleError(_0x1f4997,null));};exports[_0xb038('0x3f')]=function(_0xd7a862,_0x5b82f4){return respondWithRpcPromise(_0xb038('0x40'),_0xd7a862['query'])[_0xb038('0x16')](respondWithResult(_0x5b82f4,null))[_0xb038('0xb')](handleError(_0x5b82f4,null));};exports[_0xb038('0x41')]=function(_0x998fe3,_0x1518c4){return respondWithRpcPromise('Campaigns',_0x998fe3['query'])['then'](respondWithResult(_0x1518c4,null))[_0xb038('0xb')](handleError(_0x1518c4,null));};exports[_0xb038('0x42')]=function(_0x276fac,_0x218368){return respondWithRpcPromise(_0xb038('0x43'),_0x276fac[_0xb038('0x19')],routingClient)['then'](respondWithResult(_0x218368,null))[_0xb038('0xb')](handleError(_0x218368,null));};exports[_0xb038('0x44')]=function(_0x5b2cbb,_0x5b27d3){return respondWithRpcPromise(_0xb038('0x43'),_0x5b2cbb['query'],routingClient)[_0xb038('0x16')](findById(_0x5b2cbb['params']['id']))[_0xb038('0x16')](respondWithResult(_0x5b27d3,null))[_0xb038('0xb')](handleError(_0x5b27d3,null));};exports[_0xb038('0x45')]=function(_0x4300e9,_0x4ee38b){return respondWithRpcPromise(_0xb038('0x46'),_0x4300e9[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x4ee38b,null))[_0xb038('0xb')](handleError(_0x4ee38b,null));};exports[_0xb038('0x47')]=function(_0x1246c8,_0x14a553){return respondWithRpcPromise(_0xb038('0x46'),_0x1246c8[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x1246c8[_0xb038('0x1a')]['id']))[_0xb038('0x16')](respondWithResult(_0x14a553,null))['catch'](handleError(_0x14a553,null));};exports[_0xb038('0x48')]=function(_0x2fc38d,_0x438e7e){return respondWithRpcPromise(_0xb038('0x49'),_0x2fc38d[_0xb038('0x19')],mailClient)['then'](respondWithResult(_0x438e7e,null))[_0xb038('0xb')](handleError(_0x438e7e,null));};exports['openchannelQueues']=function(_0xfb3ce6,_0x170a7e){return respondWithRpcPromise('OpenchannelQueues',_0xfb3ce6[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x170a7e,null))[_0xb038('0xb')](handleError(_0x170a7e,null));};exports[_0xb038('0x4a')]=function(_0x120cc7,_0x2f01c0){return respondWithRpcPromise(_0xb038('0x4b'),_0x120cc7[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x120cc7[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x2f01c0,null))[_0xb038('0xb')](handleError(_0x2f01c0,null));};exports['smsQueues']=function(_0x189894,_0x37e445){return respondWithRpcPromise(_0xb038('0x4c'),_0x189894[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x37e445,null))[_0xb038('0xb')](handleError(_0x37e445,null));};exports[_0xb038('0x4d')]=function(_0x4c23b2,_0x572ad4){return respondWithRpcPromise(_0xb038('0x4c'),_0x4c23b2[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x4c23b2['params']['id']))['then'](respondWithResult(_0x572ad4,null))[_0xb038('0xb')](handleError(_0x572ad4,null));};exports['whatsappQueues']=function(_0x35da9e,_0x50e078){return respondWithRpcPromise(_0xb038('0x4e'),_0x35da9e['query'],routingClient)[_0xb038('0x16')](respondWithResult(_0x50e078,null))[_0xb038('0xb')](handleError(_0x50e078,null));};exports[_0xb038('0x4f')]=function(_0x112d77,_0x2c57b9){return respondWithRpcPromise(_0xb038('0x4e'),_0x112d77['query'],routingClient)['then'](findById(_0x112d77[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x2c57b9,null))[_0xb038('0xb')](handleError(_0x2c57b9,null));};exports[_0xb038('0x50')]=function(_0x2f4650,_0x538690){return respondWithRpcPromise(_0xb038('0x51'),_0x2f4650['query'],routingClient)[_0xb038('0x16')](respondWithResult(_0x538690,null))[_0xb038('0xb')](handleError(_0x538690,null));};exports[_0xb038('0x52')]=function(_0x4a417a,_0x40abb7){return respondWithRpcPromise(_0xb038('0x51'),_0x4a417a[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x4a417a[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x40abb7,null))['catch'](handleError(_0x40abb7,null));};exports['faxAccounts']=function(_0x609caf,_0x4efa0f){return respondWithRpcPromise(_0xb038('0x53'),_0x609caf['query'])[_0xb038('0x16')](respondWithResult(_0x4efa0f,null))[_0xb038('0xb')](handleError(_0x4efa0f,null));};exports[_0xb038('0x54')]=function(_0x1294d7,_0x7c8d01){return respondWithRpcPromise(_0xb038('0x55'),_0x1294d7[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x7c8d01,null))[_0xb038('0xb')](handleError(_0x7c8d01,null));};exports[_0xb038('0x56')]=function(_0x1db407,_0x1a5cf6){return respondWithRpcPromise(_0xb038('0x57'),_0x1db407[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x1a5cf6,null))[_0xb038('0xb')](handleError(_0x1a5cf6,null));};exports[_0xb038('0x58')]=function(_0x123e31,_0x1f9a30){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x123e31[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x1f9a30,null))[_0xb038('0xb')](handleError(_0x1f9a30,null));};exports[_0xb038('0x59')]=function(_0xdaacfe,_0x5ead21){return respondWithRpcPromise(_0xb038('0x5a'),_0xdaacfe[_0xb038('0x19')],routingClient)[_0xb038('0x16')](function(_0x80d720){if(_0xdaacfe[_0xb038('0x19')][_0xb038('0x5b')]!==undefined){var _0x2acbf6=_(_0x80d720[_0xb038('0x12')])[_0xb038('0x5c')]([_0xdaacfe['query']['type'],_0xdaacfe[_0xb038('0x1a')]['id']])['map'](_0xb038('0x5d'))['uniq']()['value']();return _0x80d720['rows'][_0xb038('0x5c')](function(_0x463ae6){return _0x2acbf6['indexOf'](_0x463ae6[_0xb038('0x5d')])>-0x1;});}else{return _0x80d720[_0xb038('0x12')][_0xb038('0x5c')](function(_0x31ccf7){return _0x31ccf7[_0xb038('0x5d')]===parseInt(_0xdaacfe[_0xb038('0x1a')]['id']);});}})[_0xb038('0x16')](respondWithResult(_0x5ead21,null))[_0xb038('0xb')](handleError(_0x5ead21,null));};exports[_0xb038('0x5e')]=function(_0xde487d,_0x4b15b7){return respondWithRpcPromise(_0xb038('0x5f'),_0xde487d[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x4b15b7,null))[_0xb038('0xb')](handleError(_0x4b15b7,null));};exports[_0xb038('0x60')]=function(_0x222e90,_0x425854){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x222e90[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x425854,null))[_0xb038('0xb')](handleError(_0x425854,null));};exports['faxQueuesWaitingInteractions']=function(_0x551fcc,_0x2adf3b){return respondWithRpcPromise(_0xb038('0x61'),_0x551fcc[_0xb038('0x19')],routingClient)['then'](respondWithResult(_0x2adf3b,null))[_0xb038('0xb')](handleError(_0x2adf3b,null));};exports[_0xb038('0x62')]=function(_0x5b003a){return function(_0x2e6db4,_0x1d5640){var _0x240d06,_0x2a41c8;var _0x24f810=_[_0xb038('0x63')](_0x5b003a);var _0x1ea747=_0x5b003a===_0xb038('0x64')?_0xb038('0x65'):_0xb038('0x66');return db[_0x24f810+_0xb038('0x67')][_0xb038('0x68')]({'raw':!![],'where':{'id':_0x2e6db4[_0xb038('0x1a')]['id']}})[_0xb038('0x16')](function(_0x5d1410){if(_[_0xb038('0x11')](_0x5d1410)){throw new Error(_0x24f810+_0xb038('0x69'));}_0x240d06=_0x5d1410;return db[_0x24f810+_0xb038('0x6a')][_0xb038('0x68')]({'where':{'id':_0x2e6db4[_0xb038('0x22')][_0xb038('0x6b')]},'include':[{'model':db[_0x24f810+_0xb038('0x6c')],'as':_0xb038('0x6c')},{'model':db[_0x24f810+_0x1ea747],'as':'Account'}]});})[_0xb038('0x16')](function(_0x3e01ce){if(_['isNil'](_0x3e01ce)){throw new Error(_0x24f810+_0xb038('0x6d'));}_0x2a41c8=_0x3e01ce;return _0x3e01ce['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x38a4d3={'uniqueid':_0x5b003a+'.'+_0x2a41c8['id']+'.'+_0x2a41c8['Interaction']['id'],'FromUserId':_0x2e6db4[_0xb038('0x30')]['id'],'type':'queue'};_0x38a4d3[_0x24f810+_0xb038('0x6e')]=_0x2a41c8['id'];_0x38a4d3[_0x24f810+_0xb038('0x6f')]=_0x2a41c8[_0xb038('0x6c')]['id'];_0x38a4d3[_0xb038('0x70')+_0x24f810+_0x1ea747+'Id']=_0x2a41c8[_0xb038('0x66')]['id'];_0x38a4d3['To'+_0x24f810+_0xb038('0x71')]=_0x240d06['id'];return db[_0x24f810+_0xb038('0x72')][_0xb038('0x73')](_0x38a4d3);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5b003a,'interaction':_0x2a41c8[_0xb038('0x6c')],'message':_0x2a41c8,'account':_0x2a41c8[_0xb038('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb038('0x74'),'appdata':_0x240d06[_0xb038('0xf')]+','+(_0x2a41c8['Account'][_0xb038('0x75')]||0x12c),'interval':_0xb038('0x76')}]},routingClient);})[_0xb038('0x16')](respondWithResult(_0x1d5640,null))[_0xb038('0xb')](handleError(_0x1d5640,null));};};exports[_0xb038('0x77')]=function(_0x139ffa,_0x208cdd){var _0x2ee9bd,_0x32ee35;if(_[_0xb038('0x11')](_0x139ffa['body']['channel'])){throw new Error(_0xb038('0x78'));}var _0xb7f025=_0x139ffa[_0xb038('0x22')][_0xb038('0x79')];var _0x3ee569=_[_0xb038('0x63')](_0xb7f025);var _0x3e129d=_0xb7f025==='chat'?_0xb038('0x65'):_0xb038('0x66');return db[_0xb038('0x7a')][_0xb038('0x68')]({'raw':!![],'where':{'id':_0x139ffa[_0xb038('0x1a')]['id'],'role':_0xb038('0x3a')}})['then'](function(_0x451fe5){if(_[_0xb038('0x11')](_0x451fe5)){throw new Error(_0xb038('0x7b'));}_0x2ee9bd=_0x451fe5;return db[_0x3ee569+_0xb038('0x6a')][_0xb038('0x68')]({'where':{'id':_0x139ffa[_0xb038('0x22')][_0xb038('0x6b')]},'include':[{'model':db[_0x3ee569+_0xb038('0x6c')],'as':_0xb038('0x6c')},{'model':db[_0x3ee569+_0x3e129d],'as':_0xb038('0x66')}]});})[_0xb038('0x16')](function(_0x22e0bd){if(_[_0xb038('0x11')](_0x22e0bd)){throw new Error(_0x3ee569+_0xb038('0x6d'));}_0x32ee35=_0x22e0bd;return _0x22e0bd[_0xb038('0x7c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb038('0x16')](function(){var _0x5448e3={'uniqueid':_0xb7f025+'.'+_0x32ee35['id']+'.'+_0x32ee35['Interaction']['id'],'FromUserId':_0x139ffa[_0xb038('0x30')]['id'],'type':_0xb038('0x74'),'ToUserId':_0x2ee9bd['id']};_0x5448e3[_0x3ee569+_0xb038('0x6e')]=_0x32ee35['id'];_0x5448e3[_0x3ee569+'InteractionId']=_0x32ee35[_0xb038('0x6c')]['id'];_0x5448e3[_0xb038('0x70')+_0x3ee569+_0x3e129d+'Id']=_0x32ee35[_0xb038('0x66')]['id'];return db[_0x3ee569+_0xb038('0x72')]['create'](_0x5448e3);})['then'](function(){return respondWithRpcPromise(_0xb038('0x7d'),{'channel':_0xb7f025,'interaction':_0x32ee35[_0xb038('0x6c')],'message':_0x32ee35,'account':_0x32ee35['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xb038('0x3a'),'appdata':_0x2ee9bd[_0xb038('0xf')]+','+(_0x32ee35[_0xb038('0x66')][_0xb038('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb038('0x16')](respondWithResult(_0x208cdd,null))[_0xb038('0xb')](handleError(_0x208cdd,null));};
\ No newline at end of file
+var _0x7da7=['value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','isNil','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','TransferReport','create','Start','Account','queue','agentNotify','channel','User','Agent\x20not\x20found','InteractionId','bluebird','moment','lodash','../../config/logger','api','client','http','request','error','message','catch','status','json','name','send','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','then','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agentCapacity','interaction','user','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','SIP/%s','INTERACTION','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','showWhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0x7da7,0x10d));var _0x77da=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x7da7[_0x5d7227];return _0x15ac55;};'use strict';var BPromise=require(_0x77da('0x0'));var moment=require(_0x77da('0x1'));var _=require(_0x77da('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x77da('0x3'))(_0x77da('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x77da('0x5')][_0x77da('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x77da('0x6')]({'port':0x232b});var routingClient=jayson[_0x77da('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){var _0x910e5b=_0x1191de?_0x1191de:amiClient;return _0x910e5b[_0x77da('0x7')](_0x30afe0,_0x47cf1d)['then'](function(_0x40c86e){if(_0x40c86e[_0x77da('0x8')]){if(_0x40c86e[_0x77da('0x8')]['code']===0x1f4){return _0x37c5ab(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}return _0x13992e(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}else{_0x13992e(_0x40c86e['result']);}})[_0x77da('0xa')](function(_0x3bcea0){_0x37c5ab(_0x3bcea0);});});}function respondWithResult(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xc8;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0xb')](_0x5d6e2f)[_0x77da('0xc')](_0x4a7748);}return _0x2acc65['sendStatus'](0x194);};}function handleError(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0x1f4;return function(_0x355719){logger[_0x77da('0x8')](_0x355719['stack']);if(_0x355719[_0x77da('0xd')]){delete _0x355719['name'];}_0x3b0ff2[_0x77da('0xb')](_0x369df0)[_0x77da('0xe')](_0x355719);};}function findById(_0x1b0e17){return function(_0x4500c4){if(!_['isNil'](_0x1b0e17)&&!_['isNil'](_0x4500c4)&&!_['isNil'](_0x4500c4['rows'])){return _[_0x77da('0xf')](_0x4500c4[_0x77da('0x10')],function(_0x289887){return _0x289887['id']==_0x1b0e17;});}return null;};}exports[_0x77da('0x11')]=function(_0x19a00c,_0x12d2b1){return respondWithRpcPromise(_0x77da('0x12'),_0x19a00c[_0x77da('0x13')])['then'](respondWithResult(_0x12d2b1,null))['catch'](handleError(_0x12d2b1,null));};exports[_0x77da('0x14')]=function(_0x4d1512,_0x507979){return respondWithRpcPromise(_0x77da('0x15'),_[_0x77da('0x16')](_0x4d1512[_0x77da('0x13')],_0x4d1512['params']))['then'](respondWithResult(_0x507979,null))[_0x77da('0xa')](handleError(_0x507979,null));};exports['voiceChannelStopMixMonitor']=function(_0x175ac4,_0x1c27aa){return respondWithRpcPromise(_0x77da('0x17'),_[_0x77da('0x16')](_0x175ac4[_0x77da('0x13')],_0x175ac4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x1c27aa,null))['catch'](handleError(_0x1c27aa,null));};exports['voiceQueues']=function(_0xfd160,_0x2d009f){return respondWithRpcPromise(_0x77da('0x1a'),_0xfd160[_0x77da('0x13')])['then'](respondWithResult(_0x2d009f,null))[_0x77da('0xa')](handleError(_0x2d009f,null));};exports[_0x77da('0x1b')]=function(_0x470c9f,_0x36115b){return respondWithRpcPromise(_0x77da('0x1a'),_0x470c9f['query'])[_0x77da('0x19')](findById(_0x470c9f[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x36115b,null))[_0x77da('0xa')](handleError(_0x36115b,null));};exports['updateVoiceQueue']=function(_0x5b4638,_0x4d395a){return respondWithRpcPromise(_0x77da('0x1c'),_[_0x77da('0x16')](_0x5b4638[_0x77da('0x1d')],_0x5b4638[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x4d395a,null))['catch'](handleError(_0x4d395a,null));};exports[_0x77da('0x1e')]=function(_0x26f5a0,_0x356bfb){return respondWithRpcPromise(_0x77da('0x1f'),_[_0x77da('0x16')](_0x26f5a0[_0x77da('0x13')],_0x26f5a0['params']))[_0x77da('0x19')](respondWithResult(_0x356bfb,null))[_0x77da('0xa')](handleError(_0x356bfb,null));};exports[_0x77da('0x20')]=function(_0x38643a,_0x3c3c64){return respondWithRpcPromise(_0x77da('0x21'),_0x38643a[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x3c3c64,null))['catch'](handleError(_0x3c3c64,null));};exports['voiceQueuesChannel']=function(_0x1366b4,_0x8e6181){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x77da('0x16')](_0x1366b4[_0x77da('0x13')],_0x1366b4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x8e6181,null))[_0x77da('0xa')](handleError(_0x8e6181,null));};exports[_0x77da('0x22')]=function(_0x20d1cc,_0x5c4a03){return respondWithRpcPromise(_0x77da('0x23'),_['merge'](_0x20d1cc['query'],_0x20d1cc['params']))[_0x77da('0x19')](respondWithResult(_0x5c4a03,null))['catch'](handleError(_0x5c4a03,null));};exports[_0x77da('0x24')]=function(_0xdac1a4,_0xce9df2){return respondWithRpcPromise(_0x77da('0x25'),_[_0x77da('0x16')](_0xdac1a4[_0x77da('0x13')],_0xdac1a4[_0x77da('0x18')]))['then'](respondWithResult(_0xce9df2,null))[_0x77da('0xa')](handleError(_0xce9df2,null));};exports[_0x77da('0x26')]=function(_0x1ca53a,_0x32785f){return respondWithRpcPromise(_0x77da('0x27'),_0x1ca53a[_0x77da('0x13')])['then'](respondWithResult(_0x32785f,null))[_0x77da('0xa')](handleError(_0x32785f,null));};exports[_0x77da('0x28')]=function(_0x2cd190,_0x4d04cd){return respondWithRpcPromise(_0x77da('0x29'),_0x2cd190['query'])['then'](respondWithResult(_0x4d04cd,null))['catch'](handleError(_0x4d04cd,null));};exports['agents']=function(_0x19f9f7,_0x1adba5){var _0xebdea1;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')])['then'](function(_0xf79c20){_0xebdea1=_0xf79c20;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')],routingClient);})[_0x77da('0x19')](function(_0x290667){return _[_0x77da('0x16')]({},_0x290667,_0xebdea1);})[_0x77da('0x19')](respondWithResult(_0x1adba5,null))['catch'](handleError(_0x1adba5,null));};exports[_0x77da('0x2a')]=function(_0x1f48bd,_0x44717a){if(_0x1f48bd[_0x77da('0x1d')]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]&&_0x1f48bd['user']&&_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]){for(var _0x21de41 in _0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]){if(_0x1f48bd[_0x77da('0x1d')]['interaction'][_0x77da('0x2d')](_0x21de41)){db['MemberReport'][_0x77da('0x2e')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')]?{'$notIn':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]}:{'$ne':null}}})[_0x77da('0x19')](function(_0x1bb77c){var _0x5964da=moment()[_0x77da('0x30')](_0x77da('0x31'));for(var _0x46f289=0x0,_0x287cf0=_0x1bb77c[_0x77da('0x2f')];_0x46f289<_0x287cf0;_0x46f289+=0x1){_0x1bb77c[_0x46f289][_0x77da('0x32')]({'exitAt':_0x5964da});}});for(var _0x558023=0x0;_0x558023<_0x1f48bd['body'][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')];_0x558023+=0x1){db[_0x77da('0x33')][_0x77da('0x34')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023],'exitAt':null},'defaults':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'interface':_['isNil'](_0x1f48bd[_0x77da('0x2c')]['interface'])?util['format'](_0x77da('0x35'),_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]):_0x1f48bd[_0x77da('0x2c')]['interface'],'type':_0x77da('0x36'),'enterAt':moment()[_0x77da('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x77da('0x37'),'internal':_0x1f48bd[_0x77da('0x2c')]['internal'],'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023]}});}}}}return respondWithRpcPromise(_0x77da('0x38'),{'id':_0x1f48bd[_0x77da('0x18')]['id'],'capacity':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x39')]},routingClient)[_0x77da('0x19')](respondWithResult(_0x44717a,null))[_0x77da('0xa')](handleError(_0x44717a,null));};exports[_0x77da('0x3a')]=function(_0x3a34a8,_0x52aa0a){return respondWithRpcPromise(_0x77da('0x3b'),_0x3a34a8['query'])[_0x77da('0x19')](respondWithResult(_0x52aa0a,null))[_0x77da('0xa')](handleError(_0x52aa0a,null));};exports[_0x77da('0x3c')]=function(_0x2eca67,_0x374179){return respondWithRpcPromise(_0x77da('0x3d'),_0x2eca67[_0x77da('0x13')])['then'](respondWithResult(_0x374179,null))[_0x77da('0xa')](handleError(_0x374179,null));};exports[_0x77da('0x3e')]=function(_0x1a7115,_0x353be9){return respondWithRpcPromise('Campaigns',_0x1a7115[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x353be9,null))[_0x77da('0xa')](handleError(_0x353be9,null));};exports['chatQueues']=function(_0x5a7ba7,_0x332763){return respondWithRpcPromise(_0x77da('0x3f'),_0x5a7ba7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x332763,null))[_0x77da('0xa')](handleError(_0x332763,null));};exports['showChatQueues']=function(_0x50437b,_0x365e91){return respondWithRpcPromise(_0x77da('0x3f'),_0x50437b['query'],routingClient)[_0x77da('0x19')](findById(_0x50437b[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x365e91,null))['catch'](handleError(_0x365e91,null));};exports[_0x77da('0x40')]=function(_0x111260,_0x5a5309){return respondWithRpcPromise(_0x77da('0x41'),_0x111260[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x5a5309,null))[_0x77da('0xa')](handleError(_0x5a5309,null));};exports[_0x77da('0x42')]=function(_0x99ac27,_0x1dc4ab){return respondWithRpcPromise(_0x77da('0x41'),_0x99ac27[_0x77da('0x13')],routingClient)['then'](findById(_0x99ac27[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1dc4ab,null))[_0x77da('0xa')](handleError(_0x1dc4ab,null));};exports[_0x77da('0x43')]=function(_0x329c6b,_0x3a0160){return respondWithRpcPromise('MailAccounts',_0x329c6b[_0x77da('0x13')],mailClient)[_0x77da('0x19')](respondWithResult(_0x3a0160,null))[_0x77da('0xa')](handleError(_0x3a0160,null));};exports['openchannelQueues']=function(_0x3e5dd9,_0x2f7cd8){return respondWithRpcPromise(_0x77da('0x44'),_0x3e5dd9[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2f7cd8,null))[_0x77da('0xa')](handleError(_0x2f7cd8,null));};exports[_0x77da('0x45')]=function(_0x53a9ee,_0x100094){return respondWithRpcPromise('OpenchannelQueues',_0x53a9ee[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x53a9ee[_0x77da('0x18')]['id']))['then'](respondWithResult(_0x100094,null))[_0x77da('0xa')](handleError(_0x100094,null));};exports[_0x77da('0x46')]=function(_0x282481,_0x30ea29){return respondWithRpcPromise('SmsQueues',_0x282481['query'],routingClient)['then'](respondWithResult(_0x30ea29,null))[_0x77da('0xa')](handleError(_0x30ea29,null));};exports[_0x77da('0x47')]=function(_0x2c4d7c,_0x2c7c8e){return respondWithRpcPromise(_0x77da('0x48'),_0x2c4d7c[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x2c4d7c[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x2c7c8e,null))[_0x77da('0xa')](handleError(_0x2c7c8e,null));};exports['whatsappQueues']=function(_0x3028ca,_0x6dd79f){return respondWithRpcPromise('WhatsappQueues',_0x3028ca['query'],routingClient)[_0x77da('0x19')](respondWithResult(_0x6dd79f,null))['catch'](handleError(_0x6dd79f,null));};exports[_0x77da('0x49')]=function(_0x1adab0,_0x1ff554){return respondWithRpcPromise('WhatsappQueues',_0x1adab0[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x1adab0[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1ff554,null))[_0x77da('0xa')](handleError(_0x1ff554,null));};exports['faxQueues']=function(_0x1f4c49,_0x20a636){return respondWithRpcPromise('FaxQueues',_0x1f4c49[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x20a636,null))[_0x77da('0xa')](handleError(_0x20a636,null));};exports[_0x77da('0x4a')]=function(_0x14496e,_0xdf9393){return respondWithRpcPromise(_0x77da('0x4b'),_0x14496e['query'],routingClient)[_0x77da('0x19')](findById(_0x14496e['params']['id']))[_0x77da('0x19')](respondWithResult(_0xdf9393,null))[_0x77da('0xa')](handleError(_0xdf9393,null));};exports[_0x77da('0x4c')]=function(_0x19b514,_0x470619){return respondWithRpcPromise(_0x77da('0x4d'),_0x19b514[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x470619,null))[_0x77da('0xa')](handleError(_0x470619,null));};exports[_0x77da('0x4e')]=function(_0x3c9ca7,_0x19065e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x3c9ca7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x19065e,null))[_0x77da('0xa')](handleError(_0x19065e,null));};exports[_0x77da('0x4f')]=function(_0x57b710,_0x293b5c){return respondWithRpcPromise(_0x77da('0x50'),_0x57b710[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x293b5c,null))[_0x77da('0xa')](handleError(_0x293b5c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x579314,_0x2a4f85){return respondWithRpcPromise(_0x77da('0x51'),_0x579314[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2a4f85,null))[_0x77da('0xa')](handleError(_0x2a4f85,null));};exports[_0x77da('0x52')]=function(_0x14dec8,_0xf95d48){return respondWithRpcPromise(_0x77da('0x51'),_0x14dec8['query'],routingClient)[_0x77da('0x19')](function(_0xfcf09c){if(_0x14dec8[_0x77da('0x13')][_0x77da('0x53')]!==undefined){var _0x17175=_(_0xfcf09c['rows'])[_0x77da('0x54')]([_0x14dec8[_0x77da('0x13')][_0x77da('0x53')],_0x14dec8[_0x77da('0x18')]['id']])[_0x77da('0x55')](_0x77da('0x56'))[_0x77da('0x57')]()[_0x77da('0x58')]();return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x4df868){return _0x17175['indexOf'](_0x4df868['queue_id'])>-0x1;});}else{return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x41fb81){return _0x41fb81['queue_id']===parseInt(_0x14dec8['params']['id']);});}})[_0x77da('0x19')](respondWithResult(_0xf95d48,null))[_0x77da('0xa')](handleError(_0xf95d48,null));};exports[_0x77da('0x59')]=function(_0x3a42e5,_0x1a92fd){return respondWithRpcPromise(_0x77da('0x5a'),_0x3a42e5[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x1a92fd,null))[_0x77da('0xa')](handleError(_0x1a92fd,null));};exports[_0x77da('0x5b')]=function(_0x27a462,_0x4cbd40){return respondWithRpcPromise(_0x77da('0x5c'),_0x27a462['query'],routingClient)['then'](respondWithResult(_0x4cbd40,null))[_0x77da('0xa')](handleError(_0x4cbd40,null));};exports['faxQueuesWaitingInteractions']=function(_0x4f9121,_0x22de60){return respondWithRpcPromise(_0x77da('0x5d'),_0x4f9121[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x22de60,null))['catch'](handleError(_0x22de60,null));};exports[_0x77da('0x5e')]=function(_0x4f1ae0){return function(_0x278f20,_0x1b85aa){var _0x554c44,_0x31834a;var _0x505520=_[_0x77da('0x5f')](_0x4f1ae0);var _0x45b0a5=_0x4f1ae0===_0x77da('0x60')?_0x77da('0x61'):'Account';return db[_0x505520+_0x77da('0x62')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x278f20[_0x77da('0x18')]['id']}})[_0x77da('0x19')](function(_0x3fd7c8){if(_[_0x77da('0x64')](_0x3fd7c8)){throw new Error(_0x505520+_0x77da('0x65'));}_0x554c44=_0x3fd7c8;return db[_0x505520+'Message']['findOne']({'where':{'id':_0x278f20[_0x77da('0x1d')][_0x77da('0x66')]},'include':[{'model':db[_0x505520+_0x77da('0x67')],'as':'Interaction'},{'model':db[_0x505520+_0x45b0a5],'as':'Account'}]});})['then'](function(_0x5aaafb){if(_[_0x77da('0x64')](_0x5aaafb)){throw new Error(_0x505520+_0x77da('0x68'));}_0x31834a=_0x5aaafb;return _0x5aaafb[_0x77da('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1636d6={'uniqueid':_0x4f1ae0+'.'+_0x31834a['id']+'.'+_0x31834a['Interaction']['id'],'FromUserId':_0x278f20[_0x77da('0x2c')]['id'],'type':'queue'};_0x1636d6[_0x505520+_0x77da('0x6a')]=_0x31834a['id'];_0x1636d6[_0x505520+'InteractionId']=_0x31834a[_0x77da('0x67')]['id'];_0x1636d6[_0x77da('0x6b')+_0x505520+_0x45b0a5+'Id']=_0x31834a['Account']['id'];_0x1636d6['To'+_0x505520+_0x77da('0x6c')]=_0x554c44['id'];return db[_0x505520+_0x77da('0x6d')][_0x77da('0x6e')](_0x1636d6);})[_0x77da('0x19')](function(){return respondWithRpcPromise(_0x77da('0x6f'),{'channel':_0x4f1ae0,'interaction':_0x31834a[_0x77da('0x67')],'message':_0x31834a,'account':_0x31834a[_0x77da('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x71'),'appdata':_0x554c44[_0x77da('0xd')]+','+(_0x31834a['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x1b85aa,null))[_0x77da('0xa')](handleError(_0x1b85aa,null));};};exports[_0x77da('0x72')]=function(_0x56efcf,_0x186d22){var _0x52638b,_0x5e93b1;if(_[_0x77da('0x64')](_0x56efcf[_0x77da('0x1d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x3c0cde=_0x56efcf[_0x77da('0x1d')][_0x77da('0x73')];var _0x5d9750=_[_0x77da('0x5f')](_0x3c0cde);var _0x5384d2=_0x3c0cde===_0x77da('0x60')?_0x77da('0x61'):_0x77da('0x70');return db[_0x77da('0x74')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x56efcf[_0x77da('0x18')]['id'],'role':'agent'}})[_0x77da('0x19')](function(_0x2410ae){if(_[_0x77da('0x64')](_0x2410ae)){throw new Error(_0x77da('0x75'));}_0x52638b=_0x2410ae;return db[_0x5d9750+'Message'][_0x77da('0x63')]({'where':{'id':_0x56efcf['body'][_0x77da('0x66')]},'include':[{'model':db[_0x5d9750+_0x77da('0x67')],'as':_0x77da('0x67')},{'model':db[_0x5d9750+_0x5384d2],'as':_0x77da('0x70')}]});})[_0x77da('0x19')](function(_0x2c3bcc){if(_[_0x77da('0x64')](_0x2c3bcc)){throw new Error(_0x5d9750+_0x77da('0x68'));}_0x5e93b1=_0x2c3bcc;return _0x2c3bcc['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x77da('0x19')](function(){var _0x3132f0={'uniqueid':_0x3c0cde+'.'+_0x5e93b1['id']+'.'+_0x5e93b1[_0x77da('0x67')]['id'],'FromUserId':_0x56efcf[_0x77da('0x2c')]['id'],'type':_0x77da('0x71'),'ToUserId':_0x52638b['id']};_0x3132f0[_0x5d9750+_0x77da('0x6a')]=_0x5e93b1['id'];_0x3132f0[_0x5d9750+_0x77da('0x76')]=_0x5e93b1[_0x77da('0x67')]['id'];_0x3132f0['From'+_0x5d9750+_0x5384d2+'Id']=_0x5e93b1['Account']['id'];return db[_0x5d9750+_0x77da('0x6d')][_0x77da('0x6e')](_0x3132f0);})[_0x77da('0x19')](function(){return respondWithRpcPromise('Start',{'channel':_0x3c0cde,'interaction':_0x5e93b1[_0x77da('0x67')],'message':_0x5e93b1,'account':_0x5e93b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x37'),'appdata':_0x52638b[_0x77da('0xd')]+','+(_0x5e93b1[_0x77da('0x70')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x186d22,null))['catch'](handleError(_0x186d22,null));};
\ No newline at end of file
index 911b78e..95de390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x779c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','run','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x55e72d,_0x2ca6c2){var _0xf1175b=function(_0x149d0b){while(--_0x149d0b){_0x55e72d['push'](_0x55e72d['shift']());}};_0xf1175b(++_0x2ca6c2);}(_0x779c,0xdf));var _0xc779=function(_0x278804,_0x196ffd){_0x278804=_0x278804-0x0;var _0xfb292b=_0x779c[_0x278804];return _0xfb292b;};'use strict';var multer=require(_0xc779('0x0'));var util=require(_0xc779('0x1'));var path=require(_0xc779('0x2'));var timeout=require(_0xc779('0x3'));var express=require(_0xc779('0x4'));var router=express[_0xc779('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc779('0x6'));var interaction=require(_0xc779('0x7'));var config=require(_0xc779('0x8'));var controller=require('./schedule.controller');router[_0xc779('0x9')]('/',auth[_0xc779('0xa')](),controller['index']);router[_0xc779('0x9')]('/:id',auth[_0xc779('0xa')](),controller['show']);router[_0xc779('0x9')]('/:id/run',auth[_0xc779('0xa')](),controller[_0xc779('0xb')]);router[_0xc779('0xc')]('/',auth[_0xc779('0xa')](),controller[_0xc779('0xd')]);router[_0xc779('0xe')]('/:id',auth[_0xc779('0xa')](),controller[_0xc779('0xf')]);router['delete'](_0xc779('0x10'),auth[_0xc779('0xa')](),controller[_0xc779('0x11')]);module[_0xc779('0x12')]=router;
\ No newline at end of file
+var _0xd048=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','put','update','delete','destroy','exports','multer','util'];(function(_0x5a573b,_0x3d44e3){var _0x1aa3d7=function(_0x394bca){while(--_0x394bca){_0x5a573b['push'](_0x5a573b['shift']());}};_0x1aa3d7(++_0x3d44e3);}(_0xd048,0x106));var _0x8d04=function(_0x440c00,_0x338207){_0x440c00=_0x440c00-0x0;var _0x3cf473=_0xd048[_0x440c00];return _0x3cf473;};'use strict';var multer=require(_0x8d04('0x0'));var util=require(_0x8d04('0x1'));var path=require('path');var timeout=require(_0x8d04('0x2'));var express=require('express');var router=express[_0x8d04('0x3')]();var fs_extra=require(_0x8d04('0x4'));var auth=require(_0x8d04('0x5'));var interaction=require(_0x8d04('0x6'));var config=require(_0x8d04('0x7'));var controller=require(_0x8d04('0x8'));router[_0x8d04('0x9')]('/',auth[_0x8d04('0xa')](),controller[_0x8d04('0xb')]);router[_0x8d04('0x9')](_0x8d04('0xc'),auth[_0x8d04('0xa')](),controller[_0x8d04('0xd')]);router[_0x8d04('0x9')](_0x8d04('0xe'),auth[_0x8d04('0xa')](),controller[_0x8d04('0xf')]);router[_0x8d04('0x10')]('/',auth[_0x8d04('0xa')](),controller['create']);router[_0x8d04('0x11')]('/:id',auth[_0x8d04('0xa')](),controller[_0x8d04('0x12')]);router[_0x8d04('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8d04('0x14')]);module[_0x8d04('0x15')]=router;
\ No newline at end of file
index 9ca084d..9cdb72a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1313=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports'];(function(_0x6bc98,_0x225871){var _0x3dca15=function(_0xef435a){while(--_0xef435a){_0x6bc98['push'](_0x6bc98['shift']());}};_0x3dca15(++_0x225871);}(_0x1313,0x18d));var _0x3131=function(_0x380cd3,_0x27aa3f){_0x380cd3=_0x380cd3-0x0;var _0x317451=_0x1313[_0x380cd3];return _0x317451;};'use strict';var Sequelize=require(_0x3131('0x0'));module[_0x3131('0x1')]={'name':{'type':Sequelize[_0x3131('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3131('0x2')]},'active':{'type':Sequelize[_0x3131('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3131('0x2')],'allowNull':![],'defaultValue':_0x3131('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x3131('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3131('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x3131('0x7')](_0x3131('0x8'),_0x3131('0x9'),'months',_0x3131('0xa'),_0x3131('0xb'),_0x3131('0xc'),'minutes'),'allowNull':![],'defaultValue':_0x3131('0xb')},'output':{'type':Sequelize[_0x3131('0x7')](_0x3131('0xd'),_0x3131('0xe'),_0x3131('0xf')),'allowNull':![],'defaultValue':_0x3131('0xd')},'type':{'type':Sequelize[_0x3131('0x7')](_0x3131('0x10'),_0x3131('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x3131('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x3131('0x12')]},'bcc':{'type':Sequelize[_0x3131('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x3131('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6c0c=['pdf','xlsx','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks','days','minutes','ENUM'];(function(_0x4fce45,_0xc31f54){var _0x3037d8=function(_0x103a6f){while(--_0x103a6f){_0x4fce45['push'](_0x4fce45['shift']());}};_0x3037d8(++_0xc31f54);}(_0x6c0c,0x149));var _0xc6c0=function(_0x1a6728,_0x3a4244){_0x1a6728=_0x1a6728-0x0;var _0x4d3e89=_0x6c0c[_0x1a6728];return _0x4d3e89;};'use strict';var Sequelize=require(_0xc6c0('0x0'));module['exports']={'name':{'type':Sequelize[_0xc6c0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc6c0('0x1')]},'active':{'type':Sequelize[_0xc6c0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc6c0('0x1')],'allowNull':![],'defaultValue':_0xc6c0('0x3')},'startAt':{'type':Sequelize[_0xc6c0('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xc6c0('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc6c0('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xc6c0('0x6'),_0xc6c0('0x7'),_0xc6c0('0x8'),_0xc6c0('0x9'),_0xc6c0('0xa'),'hours',_0xc6c0('0xb')),'allowNull':![],'defaultValue':_0xc6c0('0xa')},'output':{'type':Sequelize[_0xc6c0('0xc')]('csv',_0xc6c0('0xd'),_0xc6c0('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xc6c0('0xc')](_0xc6c0('0xf'),_0xc6c0('0x10')),'allowNull':![],'defaultValue':_0xc6c0('0xf')},'sendMail':{'type':Sequelize[_0xc6c0('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xc6c0('0x1')]},'cc':{'type':Sequelize[_0xc6c0('0x11')]},'bcc':{'type':Sequelize[_0xc6c0('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xc6c0('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index bb6011c..4e3a536 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d18=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','name','send','index','Schedule','fieldName','type','key','map','query','model','intersection','fields','attributes','hasOwnProperty','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x520e16,_0x545cb6){var _0x4771b5=function(_0x5e3a50){while(--_0x5e3a50){_0x520e16['push'](_0x520e16['shift']());}};_0x4771b5(++_0x545cb6);}(_0x7d18,0x183));var _0x87d1=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0x7d18[_0x4d7116];return _0x4593dc;};'use strict';var emlformat=require(_0x87d1('0x0'));var rimraf=require(_0x87d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x87d1('0x2'));var moment=require('moment');var BPromise=require(_0x87d1('0x3'));var Mustache=require('mustache');var util=require(_0x87d1('0x4'));var path=require(_0x87d1('0x5'));var sox=require(_0x87d1('0x6'));var csv=require(_0x87d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x87d1('0x8'));var _=require(_0x87d1('0x9'));var squel=require(_0x87d1('0xa'));var crypto=require(_0x87d1('0xb'));var jsforce=require(_0x87d1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x87d1('0x7'));var querystring=require(_0x87d1('0xd'));var Papa=require(_0x87d1('0xe'));var Redis=require(_0x87d1('0xf'));var authService=require(_0x87d1('0x10'));var qs=require(_0x87d1('0x11'));var as=require(_0x87d1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87d1('0x13'))(_0x87d1('0x14'));var utils=require(_0x87d1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x567a98,_0x4e62af){_0x4e62af=_0x4e62af||0xcc;return function(_0x49b565){if(_0x49b565){return _0x567a98['sendStatus'](_0x4e62af);}return _0x567a98['status'](_0x4e62af)[_0x87d1('0x16')]();};}function respondWithResult(_0xc3a78f,_0x5ac11c){_0x5ac11c=_0x5ac11c||0xc8;return function(_0x3382bb){if(_0x3382bb){return _0xc3a78f[_0x87d1('0x17')](_0x5ac11c)[_0x87d1('0x18')](_0x3382bb);}};}function respondWithFilteredResult(_0x290ef4,_0x267a53){return function(_0x287903){if(_0x287903){var _0x4be717=typeof _0x267a53[_0x87d1('0x19')]==='undefined'&&typeof _0x267a53['limit']===_0x87d1('0x1a');var _0xf766ad=_0x287903[_0x87d1('0x1b')];var _0x396c1c=_0x4be717?0x0:_0x267a53[_0x87d1('0x19')];var _0x1ac7cb=_0x4be717?_0x287903[_0x87d1('0x1b')]:_0x267a53['offset']+_0x267a53[_0x87d1('0x1c')];var _0x4df8ad;if(_0x1ac7cb>=_0xf766ad){_0x1ac7cb=_0xf766ad;_0x4df8ad=0xc8;}else{_0x4df8ad=0xce;}_0x290ef4['status'](_0x4df8ad);return _0x290ef4['set'](_0x87d1('0x1d'),_0x396c1c+'-'+_0x1ac7cb+'/'+_0xf766ad)['json'](_0x287903);}return null;};}function patchUpdates(_0x2d8184){return function(_0x3d66ed){try{jsonpatch[_0x87d1('0x1e')](_0x3d66ed,_0x2d8184,!![]);}catch(_0x2928c4){return BPromise[_0x87d1('0x1f')](_0x2928c4);}return _0x3d66ed[_0x87d1('0x20')]();};}function saveUpdates(_0x48e003,_0x6e4c7f){return function(_0x48e6d1){if(_0x48e6d1){return _0x48e6d1[_0x87d1('0x21')](_0x48e003)['then'](function(_0x351cd8){return _0x351cd8;});}return null;};}function removeEntity(_0x575e31,_0x2395c2){return function(_0x578d13){if(_0x578d13){return _0x578d13[_0x87d1('0x22')]()[_0x87d1('0x23')](function(){var _0x258243=_0x578d13[_0x87d1('0x24')]({'plain':!![]});var _0x5df0d6='Scheduler';return db[_0x87d1('0x25')][_0x87d1('0x22')]({'where':{'type':_0x5df0d6,'resourceId':_0x258243['id']}})[_0x87d1('0x23')](function(){return _0x578d13;});})[_0x87d1('0x23')](function(){_0x575e31[_0x87d1('0x17')](0xcc)[_0x87d1('0x16')]();});}};}function handleEntityNotFound(_0x462c14,_0x54d72d){return function(_0xf7e6f){if(!_0xf7e6f){_0x462c14[_0x87d1('0x26')](0x194);}return _0xf7e6f;};}function handleError(_0x3e558f,_0x46b01a){_0x46b01a=_0x46b01a||0x1f4;return function(_0x48dcc6){logger[_0x87d1('0x27')](_0x48dcc6['stack']);if(_0x48dcc6[_0x87d1('0x28')]){delete _0x48dcc6[_0x87d1('0x28')];}_0x3e558f[_0x87d1('0x17')](_0x46b01a)[_0x87d1('0x29')](_0x48dcc6);};}exports[_0x87d1('0x2a')]=function(_0x4626a7,_0x4a878a){var _0x570004={},_0x27295a={},_0x333ed2={'count':0x0,'rows':[]};var _0x30ba81=_['map'](db[_0x87d1('0x2b')]['rawAttributes'],function(_0x19c50e){return{'name':_0x19c50e[_0x87d1('0x2c')],'type':_0x19c50e[_0x87d1('0x2d')][_0x87d1('0x2e')]};});_0x27295a['model']=_[_0x87d1('0x2f')](_0x30ba81,_0x87d1('0x28'));_0x27295a[_0x87d1('0x30')]=_['keys'](_0x4626a7['query']);_0x27295a['filters']=_['intersection'](_0x27295a[_0x87d1('0x31')],_0x27295a[_0x87d1('0x30')]);_0x570004['attributes']=_[_0x87d1('0x32')](_0x27295a[_0x87d1('0x31')],qs['fields'](_0x4626a7[_0x87d1('0x30')][_0x87d1('0x33')]));_0x570004['attributes']=_0x570004[_0x87d1('0x34')]['length']?_0x570004[_0x87d1('0x34')]:_0x27295a[_0x87d1('0x31')];if(!_0x4626a7[_0x87d1('0x30')][_0x87d1('0x35')]('nolimit')){_0x570004['limit']=qs[_0x87d1('0x1c')](_0x4626a7[_0x87d1('0x30')][_0x87d1('0x1c')]);_0x570004[_0x87d1('0x19')]=qs[_0x87d1('0x19')](_0x4626a7[_0x87d1('0x30')]['offset']);}_0x570004['order']=qs['sort'](_0x4626a7[_0x87d1('0x30')]['sort']);_0x570004[_0x87d1('0x36')]=qs['filters'](_[_0x87d1('0x37')](_0x4626a7['query'],_0x27295a[_0x87d1('0x38')]),_0x30ba81);if(_0x4626a7[_0x87d1('0x30')][_0x87d1('0x39')]){_0x570004[_0x87d1('0x36')]=_[_0x87d1('0x3a')](_0x570004['where'],{'$or':_[_0x87d1('0x2f')](_0x30ba81,function(_0x5212e8){if(_0x5212e8['type']!==_0x87d1('0x3b')){var _0x354ea9={};_0x354ea9[_0x5212e8[_0x87d1('0x28')]]={'$like':'%'+_0x4626a7[_0x87d1('0x30')]['filter']+'%'};return _0x354ea9;}})});}_0x570004=_[_0x87d1('0x3a')]({},_0x570004,_0x4626a7[_0x87d1('0x3c')]);var _0x32c68e={'where':_0x570004[_0x87d1('0x36')]};return db[_0x87d1('0x2b')][_0x87d1('0x1b')](_0x32c68e)[_0x87d1('0x23')](function(_0x1c084a){_0x333ed2[_0x87d1('0x1b')]=_0x1c084a;if(_0x4626a7[_0x87d1('0x30')][_0x87d1('0x3d')]){_0x570004[_0x87d1('0x3e')]=[{'all':!![]}];}return db[_0x87d1('0x2b')][_0x87d1('0x3f')](_0x570004);})['then'](function(_0x2293ef){_0x333ed2[_0x87d1('0x40')]=_0x2293ef;return _0x333ed2;})[_0x87d1('0x23')](respondWithFilteredResult(_0x4a878a,_0x570004))[_0x87d1('0x41')](handleError(_0x4a878a,null));};exports[_0x87d1('0x42')]=function(_0x70ad04,_0x40fd7c){var _0x413966={'raw':![],'where':{'id':_0x70ad04[_0x87d1('0x43')]['id']}},_0x527eab={};_0x527eab[_0x87d1('0x31')]=_['keys'](db[_0x87d1('0x2b')][_0x87d1('0x44')]);_0x527eab['query']=_['keys'](_0x70ad04[_0x87d1('0x30')]);_0x527eab[_0x87d1('0x38')]=_[_0x87d1('0x32')](_0x527eab[_0x87d1('0x31')],_0x527eab[_0x87d1('0x30')]);_0x413966[_0x87d1('0x34')]=_[_0x87d1('0x32')](_0x527eab['model'],qs[_0x87d1('0x33')](_0x70ad04[_0x87d1('0x30')][_0x87d1('0x33')]));_0x413966[_0x87d1('0x34')]=_0x413966[_0x87d1('0x34')]['length']?_0x413966['attributes']:_0x527eab[_0x87d1('0x31')];if(_0x70ad04[_0x87d1('0x30')][_0x87d1('0x3d')]){_0x413966[_0x87d1('0x3e')]=[{'all':!![]}];}_0x413966=_[_0x87d1('0x3a')]({},_0x413966,_0x70ad04[_0x87d1('0x3c')]);return db[_0x87d1('0x2b')][_0x87d1('0x45')](_0x413966)[_0x87d1('0x23')](handleEntityNotFound(_0x40fd7c,null))[_0x87d1('0x23')](respondWithResult(_0x40fd7c,null))['catch'](handleError(_0x40fd7c,null));};exports['create']=function(_0x3a1462,_0x5e7017){return db[_0x87d1('0x2b')][_0x87d1('0x46')](_0x3a1462[_0x87d1('0x47')],{})['then'](function(_0x3ba276){var _0x3087c8=_0x3a1462[_0x87d1('0x48')]['get']({'plain':!![]});if(!_0x3087c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3087c8[_0x87d1('0x49')]===_0x87d1('0x48')){var _0x9144d=_0x3ba276[_0x87d1('0x24')]({'plain':!![]});var _0x45cdc2=_0x87d1('0x4a');return db[_0x87d1('0x4b')]['find']({'where':{'name':_0x45cdc2,'userProfileId':_0x3087c8[_0x87d1('0x4c')]},'raw':!![]})[_0x87d1('0x23')](function(_0x1631e4){if(_0x1631e4&&_0x1631e4[_0x87d1('0x4d')]===0x0){return db[_0x87d1('0x25')][_0x87d1('0x46')]({'name':_0x9144d[_0x87d1('0x28')],'resourceId':_0x9144d['id'],'type':_0x1631e4[_0x87d1('0x28')],'sectionId':_0x1631e4['id']},{})[_0x87d1('0x23')](function(){return _0x3ba276;});}else{return _0x3ba276;}})['catch'](function(_0x9a13cc){logger[_0x87d1('0x27')](_0x87d1('0x4e'),_0x9a13cc);throw _0x9a13cc;});}return _0x3ba276;})[_0x87d1('0x23')](respondWithResult(_0x5e7017,0xc9))[_0x87d1('0x41')](handleError(_0x5e7017,null));};exports[_0x87d1('0x21')]=function(_0x1dba35,_0x3399e0){if(_0x1dba35[_0x87d1('0x47')]['id']){delete _0x1dba35[_0x87d1('0x47')]['id'];}return db[_0x87d1('0x2b')][_0x87d1('0x45')]({'where':{'id':_0x1dba35[_0x87d1('0x43')]['id']}})[_0x87d1('0x23')](handleEntityNotFound(_0x3399e0,null))[_0x87d1('0x23')](saveUpdates(_0x1dba35['body'],null))[_0x87d1('0x23')](respondWithResult(_0x3399e0,null))[_0x87d1('0x41')](handleError(_0x3399e0,null));};exports[_0x87d1('0x22')]=function(_0x2e353d,_0x5c9a55){return db['Schedule'][_0x87d1('0x45')]({'where':{'id':_0x2e353d['params']['id']}})['then'](handleEntityNotFound(_0x5c9a55,null))[_0x87d1('0x23')](removeEntity(_0x5c9a55,null))[_0x87d1('0x41')](handleError(_0x5c9a55,null));};exports[_0x87d1('0x4f')]=function(_0x54ffc9,_0x5d6ed7,_0x4184be){var _0xaff89d=require(_0x87d1('0x50'));return db['Schedule'][_0x87d1('0x45')]({'where':{'id':_0x54ffc9['params']['id']},'raw':!![]})[_0x87d1('0x23')](handleEntityNotFound(_0x5d6ed7,null))[_0x87d1('0x23')](function(){_0xaff89d[_0x87d1('0x4f')](_0x54ffc9[_0x87d1('0x43')]['id']);})[_0x87d1('0x23')](respondWithStatusCode(_0x5d6ed7,null))[_0x87d1('0x41')](handleError(_0x5d6ed7,null));};
\ No newline at end of file
+var _0xbc00=['options','includeAll','include','rows','catch','show','params','rawAttributes','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','save','update','then','destroy','get','Scheduler','error','stack','name','map','Schedule','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0xbc00,0x1aa));var _0x0bc0=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xbc00[_0x67f95e];return _0x538f5a;};'use strict';var emlformat=require(_0x0bc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bc0('0x1'));var jsonpatch=require(_0x0bc0('0x2'));var rp=require(_0x0bc0('0x3'));var moment=require(_0x0bc0('0x4'));var BPromise=require(_0x0bc0('0x5'));var Mustache=require(_0x0bc0('0x6'));var util=require(_0x0bc0('0x7'));var path=require('path');var sox=require(_0x0bc0('0x8'));var csv=require(_0x0bc0('0x9'));var ejs=require(_0x0bc0('0xa'));var fs=require('fs');var fs_extra=require(_0x0bc0('0xb'));var _=require(_0x0bc0('0xc'));var squel=require(_0x0bc0('0xd'));var crypto=require('crypto');var jsforce=require(_0x0bc0('0xe'));var deskjs=require(_0x0bc0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0bc0('0x10'));var Papa=require(_0x0bc0('0x11'));var Redis=require(_0x0bc0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0bc0('0x13'));var hardwareService=require(_0x0bc0('0x14'));var logger=require(_0x0bc0('0x15'))('api');var utils=require(_0x0bc0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0bc0('0x17'))['db'];function respondWithStatusCode(_0x166667,_0x48acdc){_0x48acdc=_0x48acdc||0xcc;return function(_0x4e2f1f){if(_0x4e2f1f){return _0x166667[_0x0bc0('0x18')](_0x48acdc);}return _0x166667['status'](_0x48acdc)[_0x0bc0('0x19')]();};}function respondWithResult(_0x4e80f0,_0x2e4c1d){_0x2e4c1d=_0x2e4c1d||0xc8;return function(_0x23a5d6){if(_0x23a5d6){return _0x4e80f0['status'](_0x2e4c1d)[_0x0bc0('0x1a')](_0x23a5d6);}};}function respondWithFilteredResult(_0x32b3ae,_0x3c46cb){return function(_0x59505e){if(_0x59505e){var _0x4065c2=typeof _0x3c46cb[_0x0bc0('0x1b')]==='undefined'&&typeof _0x3c46cb['limit']===_0x0bc0('0x1c');var _0x52bbe4=_0x59505e[_0x0bc0('0x1d')];var _0x14b174=_0x4065c2?0x0:_0x3c46cb['offset'];var _0x41b4d7=_0x4065c2?_0x59505e[_0x0bc0('0x1d')]:_0x3c46cb[_0x0bc0('0x1b')]+_0x3c46cb[_0x0bc0('0x1e')];var _0x47de74;if(_0x41b4d7>=_0x52bbe4){_0x41b4d7=_0x52bbe4;_0x47de74=0xc8;}else{_0x47de74=0xce;}_0x32b3ae[_0x0bc0('0x1f')](_0x47de74);return _0x32b3ae['set'](_0x0bc0('0x20'),_0x14b174+'-'+_0x41b4d7+'/'+_0x52bbe4)[_0x0bc0('0x1a')](_0x59505e);}return null;};}function patchUpdates(_0x4214fc){return function(_0x2345e6){try{jsonpatch['apply'](_0x2345e6,_0x4214fc,!![]);}catch(_0x5656eb){return BPromise['reject'](_0x5656eb);}return _0x2345e6[_0x0bc0('0x21')]();};}function saveUpdates(_0x2e591a,_0x133829){return function(_0x35a37a){if(_0x35a37a){return _0x35a37a[_0x0bc0('0x22')](_0x2e591a)[_0x0bc0('0x23')](function(_0x29e4bb){return _0x29e4bb;});}return null;};}function removeEntity(_0x300f9f,_0x4eb1dd){return function(_0x311459){if(_0x311459){return _0x311459[_0x0bc0('0x24')]()['then'](function(){var _0x578b90=_0x311459[_0x0bc0('0x25')]({'plain':!![]});var _0x5803e4=_0x0bc0('0x26');return db['UserProfileResource'][_0x0bc0('0x24')]({'where':{'type':_0x5803e4,'resourceId':_0x578b90['id']}})['then'](function(){return _0x311459;});})['then'](function(){_0x300f9f['status'](0xcc)[_0x0bc0('0x19')]();});}};}function handleEntityNotFound(_0x40c9fd,_0x369503){return function(_0x94272){if(!_0x94272){_0x40c9fd[_0x0bc0('0x18')](0x194);}return _0x94272;};}function handleError(_0x3ba1a8,_0x588933){_0x588933=_0x588933||0x1f4;return function(_0x124fa8){logger[_0x0bc0('0x27')](_0x124fa8[_0x0bc0('0x28')]);if(_0x124fa8[_0x0bc0('0x29')]){delete _0x124fa8[_0x0bc0('0x29')];}_0x3ba1a8['status'](_0x588933)['send'](_0x124fa8);};}exports['index']=function(_0x2afc9e,_0x45c8da){var _0x28a822={},_0x44e390={},_0x35a3a3={'count':0x0,'rows':[]};var _0x11e4f2=_[_0x0bc0('0x2a')](db[_0x0bc0('0x2b')]['rawAttributes'],function(_0x313b47){return{'name':_0x313b47['fieldName'],'type':_0x313b47[_0x0bc0('0x2c')][_0x0bc0('0x2d')]};});_0x44e390[_0x0bc0('0x2e')]=_['map'](_0x11e4f2,_0x0bc0('0x29'));_0x44e390[_0x0bc0('0x2f')]=_[_0x0bc0('0x30')](_0x2afc9e[_0x0bc0('0x2f')]);_0x44e390[_0x0bc0('0x31')]=_[_0x0bc0('0x32')](_0x44e390[_0x0bc0('0x2e')],_0x44e390[_0x0bc0('0x2f')]);_0x28a822[_0x0bc0('0x33')]=_[_0x0bc0('0x32')](_0x44e390['model'],qs['fields'](_0x2afc9e[_0x0bc0('0x2f')]['fields']));_0x28a822[_0x0bc0('0x33')]=_0x28a822[_0x0bc0('0x33')][_0x0bc0('0x34')]?_0x28a822[_0x0bc0('0x33')]:_0x44e390['model'];if(!_0x2afc9e[_0x0bc0('0x2f')][_0x0bc0('0x35')](_0x0bc0('0x36'))){_0x28a822['limit']=qs[_0x0bc0('0x1e')](_0x2afc9e[_0x0bc0('0x2f')]['limit']);_0x28a822[_0x0bc0('0x1b')]=qs[_0x0bc0('0x1b')](_0x2afc9e[_0x0bc0('0x2f')][_0x0bc0('0x1b')]);}_0x28a822['order']=qs[_0x0bc0('0x37')](_0x2afc9e[_0x0bc0('0x2f')]['sort']);_0x28a822[_0x0bc0('0x38')]=qs[_0x0bc0('0x31')](_[_0x0bc0('0x39')](_0x2afc9e[_0x0bc0('0x2f')],_0x44e390['filters']),_0x11e4f2);if(_0x2afc9e['query']['filter']){_0x28a822[_0x0bc0('0x38')]=_['merge'](_0x28a822['where'],{'$or':_[_0x0bc0('0x2a')](_0x11e4f2,function(_0x543476){if(_0x543476[_0x0bc0('0x2c')]!=='VIRTUAL'){var _0x73f865={};_0x73f865[_0x543476['name']]={'$like':'%'+_0x2afc9e[_0x0bc0('0x2f')][_0x0bc0('0x3a')]+'%'};return _0x73f865;}})});}_0x28a822=_[_0x0bc0('0x3b')]({},_0x28a822,_0x2afc9e[_0x0bc0('0x3c')]);var _0x123c14={'where':_0x28a822[_0x0bc0('0x38')]};return db[_0x0bc0('0x2b')]['count'](_0x123c14)[_0x0bc0('0x23')](function(_0x3dfd83){_0x35a3a3[_0x0bc0('0x1d')]=_0x3dfd83;if(_0x2afc9e[_0x0bc0('0x2f')][_0x0bc0('0x3d')]){_0x28a822[_0x0bc0('0x3e')]=[{'all':!![]}];}return db[_0x0bc0('0x2b')]['findAll'](_0x28a822);})[_0x0bc0('0x23')](function(_0x14e16c){_0x35a3a3[_0x0bc0('0x3f')]=_0x14e16c;return _0x35a3a3;})[_0x0bc0('0x23')](respondWithFilteredResult(_0x45c8da,_0x28a822))[_0x0bc0('0x40')](handleError(_0x45c8da,null));};exports[_0x0bc0('0x41')]=function(_0xfc764,_0x277d48){var _0x3604ad={'raw':![],'where':{'id':_0xfc764[_0x0bc0('0x42')]['id']}},_0x1da60c={};_0x1da60c[_0x0bc0('0x2e')]=_[_0x0bc0('0x30')](db['Schedule'][_0x0bc0('0x43')]);_0x1da60c['query']=_[_0x0bc0('0x30')](_0xfc764[_0x0bc0('0x2f')]);_0x1da60c[_0x0bc0('0x31')]=_['intersection'](_0x1da60c['model'],_0x1da60c[_0x0bc0('0x2f')]);_0x3604ad[_0x0bc0('0x33')]=_[_0x0bc0('0x32')](_0x1da60c[_0x0bc0('0x2e')],qs['fields'](_0xfc764['query'][_0x0bc0('0x44')]));_0x3604ad['attributes']=_0x3604ad['attributes']['length']?_0x3604ad[_0x0bc0('0x33')]:_0x1da60c[_0x0bc0('0x2e')];if(_0xfc764[_0x0bc0('0x2f')]['includeAll']){_0x3604ad['include']=[{'all':!![]}];}_0x3604ad=_['merge']({},_0x3604ad,_0xfc764[_0x0bc0('0x3c')]);return db[_0x0bc0('0x2b')][_0x0bc0('0x45')](_0x3604ad)[_0x0bc0('0x23')](handleEntityNotFound(_0x277d48,null))[_0x0bc0('0x23')](respondWithResult(_0x277d48,null))[_0x0bc0('0x40')](handleError(_0x277d48,null));};exports['create']=function(_0x2f8fda,_0x3901ec){return db[_0x0bc0('0x2b')][_0x0bc0('0x46')](_0x2f8fda[_0x0bc0('0x47')],{})[_0x0bc0('0x23')](function(_0x49ff87){var _0x10fa84=_0x2f8fda['user']['get']({'plain':!![]});if(!_0x10fa84)throw new Error(_0x0bc0('0x48'));if(_0x10fa84[_0x0bc0('0x49')]===_0x0bc0('0x4a')){var _0x37311a=_0x49ff87[_0x0bc0('0x25')]({'plain':!![]});var _0x284c28='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x284c28,'userProfileId':_0x10fa84[_0x0bc0('0x4b')]},'raw':!![]})[_0x0bc0('0x23')](function(_0x46beeb){if(_0x46beeb&&_0x46beeb[_0x0bc0('0x4c')]===0x0){return db[_0x0bc0('0x4d')]['create']({'name':_0x37311a[_0x0bc0('0x29')],'resourceId':_0x37311a['id'],'type':_0x46beeb[_0x0bc0('0x29')],'sectionId':_0x46beeb['id']},{})[_0x0bc0('0x23')](function(){return _0x49ff87;});}else{return _0x49ff87;}})['catch'](function(_0x5bba46){logger['error'](_0x0bc0('0x4e'),_0x5bba46);throw _0x5bba46;});}return _0x49ff87;})[_0x0bc0('0x23')](respondWithResult(_0x3901ec,0xc9))[_0x0bc0('0x40')](handleError(_0x3901ec,null));};exports[_0x0bc0('0x22')]=function(_0x9cf649,_0x5e8876){if(_0x9cf649['body']['id']){delete _0x9cf649[_0x0bc0('0x47')]['id'];}return db[_0x0bc0('0x2b')]['find']({'where':{'id':_0x9cf649[_0x0bc0('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e8876,null))[_0x0bc0('0x23')](saveUpdates(_0x9cf649[_0x0bc0('0x47')],null))[_0x0bc0('0x23')](respondWithResult(_0x5e8876,null))[_0x0bc0('0x40')](handleError(_0x5e8876,null));};exports[_0x0bc0('0x24')]=function(_0x2f8908,_0x8c8b5c){return db[_0x0bc0('0x2b')][_0x0bc0('0x45')]({'where':{'id':_0x2f8908[_0x0bc0('0x42')]['id']}})[_0x0bc0('0x23')](handleEntityNotFound(_0x8c8b5c,null))['then'](removeEntity(_0x8c8b5c,null))[_0x0bc0('0x40')](handleError(_0x8c8b5c,null));};exports[_0x0bc0('0x4f')]=function(_0x1e2e75,_0x1fd69b,_0x54f69b){var _0x586ee6=require(_0x0bc0('0x50'));return db['Schedule'][_0x0bc0('0x45')]({'where':{'id':_0x1e2e75[_0x0bc0('0x42')]['id']},'raw':!![]})[_0x0bc0('0x23')](handleEntityNotFound(_0x1fd69b,null))['then'](function(){_0x586ee6['run'](_0x1e2e75[_0x0bc0('0x42')]['id']);})[_0x0bc0('0x23')](respondWithStatusCode(_0x1fd69b,null))[_0x0bc0('0x40')](handleError(_0x1fd69b,null));};
\ No newline at end of file
index c6f5812..22b9d0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcc1=['exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2515d5,_0x17fc48){var _0x11e51f=function(_0xd78e71){while(--_0xd78e71){_0x2515d5['push'](_0x2515d5['shift']());}};_0x11e51f(++_0x17fc48);}(_0xdcc1,0x1f0));var _0x1dcc=function(_0x19d937,_0x1f8072){_0x19d937=_0x19d937-0x0;var _0xac2938=_0xdcc1[_0x19d937];return _0xac2938;};'use strict';var _=require(_0x1dcc('0x0'));var util=require(_0x1dcc('0x1'));var logger=require(_0x1dcc('0x2'))(_0x1dcc('0x3'));var moment=require(_0x1dcc('0x4'));var BPromise=require(_0x1dcc('0x5'));var rp=require(_0x1dcc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dcc('0x7'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x1dcc('0x8')]=function(_0x59eed4,_0x20317c){return _0x59eed4[_0x1dcc('0x9')](_0x1dcc('0xa'),attributes,{'tableName':_0x1dcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7f0=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules'];(function(_0x18383f,_0x1d2a03){var _0x57ecf5=function(_0x4a336b){while(--_0x4a336b){_0x18383f['push'](_0x18383f['shift']());}};_0x57ecf5(++_0x1d2a03);}(_0xa7f0,0x9c));var _0x0a7f=function(_0x35070d,_0x1aa473){_0x35070d=_0x35070d-0x0;var _0x5e97bc=_0xa7f0[_0x35070d];return _0x5e97bc;};'use strict';var _=require(_0x0a7f('0x0'));var util=require(_0x0a7f('0x1'));var logger=require(_0x0a7f('0x2'))(_0x0a7f('0x3'));var moment=require('moment');var BPromise=require(_0x0a7f('0x4'));var rp=require(_0x0a7f('0x5'));var fs=require('fs');var path=require(_0x0a7f('0x6'));var rimraf=require('rimraf');var config=require(_0x0a7f('0x7'));var attributes=require(_0x0a7f('0x8'));module['exports']=function(_0x19c731,_0x678347){return _0x19c731[_0x0a7f('0x9')](_0x0a7f('0xa'),attributes,{'tableName':_0x0a7f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 004c0e1..1fad92e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x101b=['error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1829c3,_0x318d92){var _0x76c19f=function(_0x4f8e2e){while(--_0x4f8e2e){_0x1829c3['push'](_0x1829c3['shift']());}};_0x76c19f(++_0x318d92);}(_0x101b,0xb9));var _0xb101=function(_0x370102,_0x1a8c8a){_0x370102=_0x370102-0x0;var _0x51337c=_0x101b[_0x370102];return _0x51337c;};'use strict';var _=require('lodash');var util=require(_0xb101('0x0'));var moment=require(_0xb101('0x1'));var BPromise=require('bluebird');var rs=require(_0xb101('0x2'));var fs=require('fs');var Redis=require(_0xb101('0x3'));var db=require(_0xb101('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb101('0x5'));var config=require(_0xb101('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb101('0x7')][_0xb101('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x258deb,_0x484266,_0x512797){return new BPromise(function(_0x1b9265,_0x3db304){return client[_0xb101('0x9')](_0x258deb,_0x512797)[_0xb101('0xa')](function(_0x4a4021){logger['info'](_0xb101('0xb'),_0x484266,'request\x20sent');logger[_0xb101('0xc')](_0xb101('0xd'),_0x484266,_0xb101('0xe'),JSON['stringify'](_0x4a4021));if(_0x4a4021[_0xb101('0xf')]){if(_0x4a4021[_0xb101('0xf')]['code']===0x1f4){logger[_0xb101('0xf')](_0xb101('0xb'),_0x484266,_0x4a4021[_0xb101('0xf')][_0xb101('0x10')]);return _0x3db304(_0x4a4021['error']['message']);}logger[_0xb101('0xf')](_0xb101('0xb'),_0x484266,_0x4a4021['error'][_0xb101('0x10')]);return _0x1b9265(_0x4a4021[_0xb101('0xf')][_0xb101('0x10')]);}else{logger[_0xb101('0x11')](_0xb101('0xb'),_0x484266,_0xb101('0xe'));_0x1b9265(_0x4a4021[_0xb101('0x12')][_0xb101('0x10')]);}})[_0xb101('0x13')](function(_0x16c75c){logger['error'](_0xb101('0xb'),_0x484266,_0x16c75c);_0x3db304(_0x16c75c);});});}
\ No newline at end of file
+var _0x0ecd=['stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x4e9525,_0x1b5c6c){var _0x1bdf1a=function(_0xa1def){while(--_0xa1def){_0x4e9525['push'](_0x4e9525['shift']());}};_0x1bdf1a(++_0x1b5c6c);}(_0x0ecd,0x186));var _0xd0ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ecd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0ec('0x0'));var util=require(_0xd0ec('0x1'));var moment=require('moment');var BPromise=require(_0xd0ec('0x2'));var rs=require(_0xd0ec('0x3'));var fs=require('fs');var Redis=require(_0xd0ec('0x4'));var db=require(_0xd0ec('0x5'))['db'];var utils=require(_0xd0ec('0x6'));var logger=require('../../config/logger')(_0xd0ec('0x7'));var config=require(_0xd0ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd0ec('0x9')][_0xd0ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265260,_0x5d6ea9,_0x1e2df3){return new BPromise(function(_0x46be72,_0x5d549b){return client[_0xd0ec('0xb')](_0x265260,_0x1e2df3)[_0xd0ec('0xc')](function(_0x2514f0){logger[_0xd0ec('0xd')](_0xd0ec('0xe'),_0x5d6ea9,_0xd0ec('0xf'));logger[_0xd0ec('0x10')](_0xd0ec('0x11'),_0x5d6ea9,'request\x20sent',JSON[_0xd0ec('0x12')](_0x2514f0));if(_0x2514f0['error']){if(_0x2514f0['error'][_0xd0ec('0x13')]===0x1f4){logger[_0xd0ec('0x14')](_0xd0ec('0xe'),_0x5d6ea9,_0x2514f0[_0xd0ec('0x14')]['message']);return _0x5d549b(_0x2514f0['error'][_0xd0ec('0x15')]);}logger['error'](_0xd0ec('0xe'),_0x5d6ea9,_0x2514f0[_0xd0ec('0x14')][_0xd0ec('0x15')]);return _0x46be72(_0x2514f0[_0xd0ec('0x14')][_0xd0ec('0x15')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x5d6ea9,_0xd0ec('0xf'));_0x46be72(_0x2514f0[_0xd0ec('0x16')][_0xd0ec('0x15')]);}})[_0xd0ec('0x17')](function(_0x5189d5){logger[_0xd0ec('0x14')]('Schedule,\x20%s,\x20%s',_0x5d6ea9,_0x5189d5);_0x5d549b(_0x5189d5);});});}
\ No newline at end of file
index 648d9ab..0fa4c8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8530=['../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x270061,_0x4e41e1){var _0x329604=function(_0x719737){while(--_0x719737){_0x270061['push'](_0x270061['shift']());}};_0x329604(++_0x4e41e1);}(_0x8530,0x1d4));var _0x0853=function(_0x5b8057,_0x21873d){_0x5b8057=_0x5b8057-0x0;var _0x3d5c03=_0x8530[_0x5b8057];return _0x3d5c03;};'use strict';var multer=require(_0x0853('0x0'));var util=require(_0x0853('0x1'));var path=require(_0x0853('0x2'));var timeout=require(_0x0853('0x3'));var express=require(_0x0853('0x4'));var router=express[_0x0853('0x5')]();var fs_extra=require(_0x0853('0x6'));var auth=require(_0x0853('0x7'));var interaction=require(_0x0853('0x8'));var config=require(_0x0853('0x9'));var controller=require(_0x0853('0xa'));router[_0x0853('0xb')]('/',auth[_0x0853('0xc')](),controller[_0x0853('0xd')]);router[_0x0853('0xb')](_0x0853('0xe'),auth['isAuthenticated'](),controller[_0x0853('0xf')]);router['get'](_0x0853('0x10'),auth['isAuthenticated'](),controller[_0x0853('0x11')]);router[_0x0853('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x0853('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0853('0x13')]);router[_0x0853('0x14')](_0x0853('0x10'),auth[_0x0853('0xc')](),controller[_0x0853('0x15')]);router[_0x0853('0x16')](_0x0853('0x10'),auth['isAuthenticated'](),controller[_0x0853('0x17')]);module[_0x0853('0x18')]=router;
\ No newline at end of file
+var _0x7a66=['update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','create'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x7a66,0x1e6));var _0x67a6=function(_0x191b1a,_0x48e0e6){_0x191b1a=_0x191b1a-0x0;var _0x283089=_0x7a66[_0x191b1a];return _0x283089;};'use strict';var multer=require('multer');var util=require(_0x67a6('0x0'));var path=require('path');var timeout=require(_0x67a6('0x1'));var express=require('express');var router=express[_0x67a6('0x2')]();var fs_extra=require(_0x67a6('0x3'));var auth=require(_0x67a6('0x4'));var interaction=require(_0x67a6('0x5'));var config=require(_0x67a6('0x6'));var controller=require(_0x67a6('0x7'));router[_0x67a6('0x8')]('/',auth[_0x67a6('0x9')](),controller[_0x67a6('0xa')]);router[_0x67a6('0x8')](_0x67a6('0xb'),auth['isAuthenticated'](),controller[_0x67a6('0xc')]);router[_0x67a6('0x8')](_0x67a6('0xd'),auth['isAuthenticated'](),controller[_0x67a6('0xe')]);router[_0x67a6('0x8')](_0x67a6('0xf'),auth[_0x67a6('0x9')](),controller['download']);router[_0x67a6('0x10')]('/',auth['isAuthenticated'](),controller[_0x67a6('0x11')]);router['put'](_0x67a6('0xd'),auth['isAuthenticated'](),controller[_0x67a6('0x12')]);router[_0x67a6('0x13')](_0x67a6('0xd'),auth[_0x67a6('0x9')](),controller[_0x67a6('0x14')]);module['exports']=router;
\ No newline at end of file
index ab1d3d5..76b8670 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x073d=['createdAt','moment','path','../../config/environment','VIRTUAL','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','getDataValue','format','toString','MM-DD-YYYY\x20HH:mm'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x073d,0xd2));var _0xd073=function(_0x3e798a,_0x1c3f1f){_0x3e798a=_0x3e798a-0x0;var _0x34538f=_0x073d[_0x3e798a];return _0x34538f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd073('0x0'));var path=require(_0xd073('0x1'));var config=require(_0xd073('0x2'));module['exports']={'format':{'type':Sequelize[_0xd073('0x3')],'get':function(){return this['getDataValue'](_0xd073('0x4'))?path[_0xd073('0x5')](this['getDataValue'](_0xd073('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xd073('0x6')]},'channel':{'type':Sequelize[_0xd073('0x6')]},'value':{'type':Sequelize[_0xd073('0x6')],'set':function(_0x2f5792){var _0x3541cd=_0x2f5792[_0xd073('0x7')](/\\/g,'/');this[_0xd073('0x8')](_0xd073('0x4'),_0x3541cd);}},'rating':{'type':Sequelize[_0xd073('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd073('0x9')],'set':function(_0x1c9295){this[_0xd073('0x8')](_0xd073('0xa'),moment()['subtract'](_0x1c9295,'ms'));this['setDataValue'](_0xd073('0xb'),moment());this['setDataValue'](_0xd073('0xc'),_0x1c9295);}},'startedAt':{'type':Sequelize[_0xd073('0xd')],'get':function(){return moment(this[_0xd073('0xe')](_0xd073('0xa')))[_0xd073('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xd073('0x10')]();}},'closedAt':{'type':Sequelize[_0xd073('0xd')],'get':function(){return moment(this[_0xd073('0xe')](_0xd073('0xb')))['format'](_0xd073('0x11'))[_0xd073('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd073('0xe')](_0xd073('0x12')))[_0xd073('0xf')](_0xd073('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0xd073('0xd')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xd073('0xf')](_0xd073('0x11'))[_0xd073('0x10')]();}}};
\ No newline at end of file
+var _0x4732=['createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','closedAt','DATE','format','toString'];(function(_0x35279b,_0x337eae){var _0x36da9d=function(_0x5a2f15){while(--_0x5a2f15){_0x35279b['push'](_0x35279b['shift']());}};_0x36da9d(++_0x337eae);}(_0x4732,0x17d));var _0x2473=function(_0x4dc0c8,_0x48d51f){_0x4dc0c8=_0x4dc0c8-0x0;var _0x26bf81=_0x4732[_0x4dc0c8];return _0x26bf81;};'use strict';var Sequelize=require(_0x2473('0x0'));var moment=require('moment');var path=require(_0x2473('0x1'));var config=require('../../config/environment');module[_0x2473('0x2')]={'format':{'type':Sequelize[_0x2473('0x3')],'get':function(){return this[_0x2473('0x4')](_0x2473('0x5'))?path[_0x2473('0x6')](this[_0x2473('0x4')](_0x2473('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2473('0x7')]},'value':{'type':Sequelize[_0x2473('0x7')],'set':function(_0x50e340){var _0x4be81c=_0x50e340['replace'](/\\/g,'/');this[_0x2473('0x8')](_0x2473('0x5'),_0x4be81c);}},'rating':{'type':Sequelize[_0x2473('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2473('0x9')],'set':function(_0x52fffe){this['setDataValue'](_0x2473('0xa'),moment()['subtract'](_0x52fffe,'ms'));this[_0x2473('0x8')](_0x2473('0xb'),moment());this['setDataValue']('duration',_0x52fffe);}},'startedAt':{'type':Sequelize[_0x2473('0xc')],'get':function(){return moment(this[_0x2473('0x4')](_0x2473('0xa')))[_0x2473('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x2473('0xe')]();}},'closedAt':{'type':Sequelize[_0x2473('0xc')],'get':function(){return moment(this[_0x2473('0x4')](_0x2473('0xb')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x2473('0xc')],'get':function(){return moment(this[_0x2473('0x4')](_0x2473('0xf')))[_0x2473('0xd')](_0x2473('0x10'))[_0x2473('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2473('0x4')](_0x2473('0x11')))[_0x2473('0xd')](_0x2473('0x10'))[_0x2473('0xe')]();}}};
\ No newline at end of file
index a36d0eb..6a02a8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33c5=['download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','duration','createdAt','closedAt','value','describe'];(function(_0x73d7cb,_0x9ebae7){var _0x59a8e8=function(_0x9a97b5){while(--_0x9a97b5){_0x73d7cb['push'](_0x73d7cb['shift']());}};_0x59a8e8(++_0x9ebae7);}(_0x33c5,0xe6));var _0x533c=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x33c5[_0x4bfac3];return _0x15f0f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x34')](_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c')),[_0x533c('0x35')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x425f60[_0x533c('0x36')]);_0x38d886[_0x533c('0x38')]=_[_0x533c('0x39')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x36')]);_0x212d1b[_0x533c('0x3a')]=_['intersection'](_0x38d886[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x425f60[_0x533c('0x36')][_0x533c('0x3b')]));_0x212d1b['attributes']=_0x212d1b[_0x533c('0x3a')][_0x533c('0x3c')]?_0x212d1b[_0x533c('0x3a')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x36')]['hasOwnProperty']('nolimit')){_0x212d1b['limit']=qs['limit'](_0x425f60['query'][_0x533c('0x22')]);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b[_0x533c('0x3d')]=qs[_0x533c('0x3e')](_0x425f60['query'][_0x533c('0x3e')]);_0x212d1b[_0x533c('0x3f')]=qs[_0x533c('0x38')](_['pick'](_0x425f60[_0x533c('0x36')],_0x38d886[_0x533c('0x38')]),_0x2fc7fa);if(_0x425f60[_0x533c('0x36')]['filter']){_0x212d1b[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x454dbc){if(_0x454dbc[_0x533c('0x31')]!==_0x533c('0x41')){var _0x2dbd81={};_0x2dbd81[_0x454dbc[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x36')][_0x533c('0x42')]+'%'};return _0x2dbd81;}})});}_0x212d1b=_['merge']({},_0x212d1b,_0x425f60[_0x533c('0x43')]);var _0x784493={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x784493)[_0x533c('0x29')](function(_0x5d2bf9){_0x3c559b[_0x533c('0x23')]=_0x5d2bf9;if(_0x425f60[_0x533c('0x36')][_0x533c('0x44')]){_0x212d1b['include']=[{'all':!![]}];}return db[_0x533c('0x30')][_0x533c('0x45')](_0x212d1b);})[_0x533c('0x29')](function(_0x1abd47){_0x3c559b['rows']=_0x1abd47;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x39034e,_0x55a372){var _0x3f4015={'raw':![],'where':{'id':_0x39034e[_0x533c('0x47')]['id']}},_0x3f1e47={};_0x3f1e47['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x3f1e47[_0x533c('0x36')]=_['keys'](_0x39034e[_0x533c('0x36')]);_0x3f1e47['filters']=_[_0x533c('0x39')](_0x3f1e47['model'],_0x3f1e47[_0x533c('0x36')]);_0x3f4015[_0x533c('0x3a')]=_['intersection'](_0x3f1e47[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x39034e[_0x533c('0x36')][_0x533c('0x3b')]));_0x3f4015[_0x533c('0x3a')]=_0x3f4015['attributes'][_0x533c('0x3c')]?_0x3f4015[_0x533c('0x3a')]:_0x3f1e47[_0x533c('0x33')];if(_0x39034e[_0x533c('0x36')]['includeAll']){_0x3f4015[_0x533c('0x48')]=[{'all':!![]}];}_0x3f4015=_[_0x533c('0x40')]({},_0x3f4015,_0x39034e['options']);return db['ScreenRecording'][_0x533c('0x49')](_0x3f4015)['then'](handleEntityNotFound(_0x55a372,null))[_0x533c('0x29')](respondWithResult(_0x55a372,null))[_0x533c('0x4a')](handleError(_0x55a372,null));};exports[_0x533c('0x4b')]=function(_0x471c59,_0xe9354a){return db[_0x533c('0x30')][_0x533c('0x4b')](_0x471c59[_0x533c('0x4c')],{})['then'](respondWithResult(_0xe9354a,0xc9))[_0x533c('0x4a')](handleError(_0xe9354a,null));};exports[_0x533c('0x28')]=function(_0xaaf682,_0x57c6c6){if(_0xaaf682[_0x533c('0x4c')]['id']){delete _0xaaf682[_0x533c('0x4c')]['id'];}delete _0xaaf682['body'][_0x533c('0x4d')];delete _0xaaf682['body'][_0x533c('0x4e')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x4f')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x50')];return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0xaaf682['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x57c6c6,null))[_0x533c('0x29')](saveUpdates(_0xaaf682[_0x533c('0x4c')],null))[_0x533c('0x29')](respondWithResult(_0x57c6c6,null))[_0x533c('0x4a')](handleError(_0x57c6c6,null));};exports[_0x533c('0x51')]=function(_0x3eb174,_0x50d5a2){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x50d5a2,null))[_0x533c('0x4a')](handleError(_0x50d5a2,null));};exports[_0x533c('0x52')]=function(_0x5c5dd0,_0xac086b,_0x1da579){var _0x2f6794=require('../../components/encryptor');var _0x1de19e=![];var _0x564a31={};if(_0x5c5dd0['query'][_0x533c('0x31')]&&_0x5c5dd0[_0x533c('0x36')][_0x533c('0x31')]===_0x533c('0x53')){_0x564a31[_0x533c('0x53')]=_0x5c5dd0[_0x533c('0x47')]['id'];}else{_0x564a31['id']=_0x5c5dd0[_0x533c('0x47')]['id'];}return db['ScreenRecording'][_0x533c('0x49')]({'where':_0x564a31,'attributes':['id','value'],'raw':!![]})[_0x533c('0x29')](handleEntityNotFound(_0xac086b,null))[_0x533c('0x29')](function(_0x274686){if(_0x274686){var _0x2c7600=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x274686[_0x533c('0x50')]);var _0x58f528=util[_0x533c('0x35')](_0x533c('0x57'),_0x2c7600);if(fs[_0x533c('0x58')](_0x58f528)){_0x1de19e=!![];return _0x2f6794[_0x533c('0x59')](_0x58f528,_0x2c7600,config[_0x533c('0x5a')][_0x533c('0x5b')])['then'](function(){return _0x274686;});}return _0x274686;}})[_0x533c('0x29')](function(_0x554a9f){if(_0x554a9f){var _0x43383e=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x554a9f[_0x533c('0x50')]);if(!fs[_0x533c('0x58')](_0x43383e)){throw new db['Sequelize']['ValidationError'](_0x533c('0x5c'));}if(_0x554a9f[_0x533c('0x5d')]){return _0xac086b[_0x533c('0x52')](_0x43383e,_0x554a9f[_0x533c('0x5d')]+path['extname'](_0x43383e),function(){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}else{return _0xac086b[_0x533c('0x52')](_0x43383e,function(_0x8e04c7){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}}})[_0x533c('0x4a')](function(_0x2f2863){if(_0x2f2863[_0x533c('0x5f')]===_0x533c('0x5c')){_0xac086b[_0x533c('0x1d')](0x194)[_0x533c('0x2d')](_0x533c('0x60'));}else{return handleError(_0xac086b,null);}});};exports[_0x533c('0x2a')]=function(_0x13a7f2,_0xea6ea2){return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0x13a7f2[_0x533c('0x47')]['id']}})['then'](function(_0x31bba1){if(_['isNil'](_0x31bba1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x31bba1;})[_0x533c('0x29')](function(_0xb23f94){var _0x965b85=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0xb23f94[_0x533c('0x50')]);logger['info'](_0x533c('0x61'),_0x965b85);if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')](_0x533c('0x64')+_0x965b85+_0x533c('0x65'));fs['unlinkSync'](_0x965b85);}_0x965b85=_0x965b85+_0x533c('0x66');if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')]('File:\x20\x22'+_0x965b85+_0x533c('0x65'));fs[_0x533c('0x67')](_0x965b85);}return _0xb23f94;})['then'](function(_0x444f46){if(!_0x444f46)throw new InternalError();return _0x444f46['destroy']();})['then'](function(){_0xea6ea2[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();})[_0x533c('0x4a')](handleError(_0xea6ea2,null));};
\ No newline at end of file
+var _0x7217=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2c3c23,_0x3609b5){var _0x24e0ee=function(_0x510410){while(--_0x510410){_0x2c3c23['push'](_0x2c3c23['shift']());}};_0x24e0ee(++_0x3609b5);}(_0x7217,0x19e));var _0x7721=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7217[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));};
\ No newline at end of file
index 5a19275..fb655f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe514=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid','util'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xe514,0xd7));var _0x4e51=function(_0x4df240,_0x4506a8){_0x4df240=_0x4df240-0x0;var _0x56b70d=_0xe514[_0x4df240];return _0x56b70d;};'use strict';var _=require('lodash');var util=require(_0x4e51('0x0'));var logger=require(_0x4e51('0x1'))(_0x4e51('0x2'));var moment=require(_0x4e51('0x3'));var BPromise=require('bluebird');var rp=require(_0x4e51('0x4'));var fs=require('fs');var path=require(_0x4e51('0x5'));var rimraf=require(_0x4e51('0x6'));var config=require(_0x4e51('0x7'));var attributes=require(_0x4e51('0x8'));module[_0x4e51('0x9')]=function(_0x1ee0b9,_0x29062e){return _0x1ee0b9['define']('ScreenRecording',attributes,{'tableName':_0x4e51('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x4e51('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7326=['../../config/logger','api','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','lodash','util'];(function(_0xf84717,_0x440239){var _0x4e9f8d=function(_0x4bea32){while(--_0x4bea32){_0xf84717['push'](_0xf84717['shift']());}};_0x4e9f8d(++_0x440239);}(_0x7326,0xfb));var _0x6732=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7326[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x6732('0x0'));var util=require(_0x6732('0x1'));var logger=require(_0x6732('0x2'))(_0x6732('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6732('0x4'));var fs=require('fs');var path=require(_0x6732('0x5'));var rimraf=require('rimraf');var config=require(_0x6732('0x6'));var attributes=require(_0x6732('0x7'));module[_0x6732('0x8')]=function(_0x3962e3,_0xd4c6d6){return _0x3962e3[_0x6732('0x9')]('ScreenRecording',attributes,{'tableName':_0x6732('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
index f2d3015..ad8b9a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad57=['lodash','util','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result'];(function(_0x127316,_0x2774a8){var _0x34d919=function(_0x22691d){while(--_0x22691d){_0x127316['push'](_0x127316['shift']());}};_0x34d919(++_0x2774a8);}(_0xad57,0x156));var _0x7ad5=function(_0x5b45f5,_0xa1d593){_0x5b45f5=_0x5b45f5-0x0;var _0x56680e=_0xad57[_0x5b45f5];return _0x56680e;};'use strict';var _=require(_0x7ad5('0x0'));var util=require(_0x7ad5('0x1'));var moment=require(_0x7ad5('0x2'));var BPromise=require(_0x7ad5('0x3'));var rs=require(_0x7ad5('0x4'));var fs=require('fs');var Redis=require(_0x7ad5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7ad5('0x6'));var client=jayson[_0x7ad5('0x7')][_0x7ad5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x465fb4,_0x33d4e0,_0xed1595){return new BPromise(function(_0x23828f,_0x18e510){return client[_0x7ad5('0x9')](_0x465fb4,_0xed1595)[_0x7ad5('0xa')](function(_0x326075){logger[_0x7ad5('0xb')](_0x7ad5('0xc'),_0x33d4e0,'request\x20sent');logger[_0x7ad5('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x33d4e0,_0x7ad5('0xe'),JSON[_0x7ad5('0xf')](_0x326075));if(_0x326075['error']){if(_0x326075[_0x7ad5('0x10')]['code']===0x1f4){logger[_0x7ad5('0x10')](_0x7ad5('0xc'),_0x33d4e0,_0x326075[_0x7ad5('0x10')][_0x7ad5('0x11')]);return _0x18e510(_0x326075[_0x7ad5('0x10')]['message']);}logger[_0x7ad5('0x10')](_0x7ad5('0xc'),_0x33d4e0,_0x326075[_0x7ad5('0x10')][_0x7ad5('0x11')]);return _0x23828f(_0x326075[_0x7ad5('0x10')][_0x7ad5('0x11')]);}else{logger[_0x7ad5('0xb')](_0x7ad5('0xc'),_0x33d4e0,_0x7ad5('0xe'));_0x23828f(_0x326075[_0x7ad5('0x12')][_0x7ad5('0x11')]);}})['catch'](function(_0x2b54e5){logger[_0x7ad5('0x10')](_0x7ad5('0xc'),_0x33d4e0,_0x2b54e5);_0x18e510(_0x2b54e5);});});}
\ No newline at end of file
+var _0xdf15=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird'];(function(_0x1377e9,_0x232399){var _0x2996cf=function(_0xf59ea4){while(--_0xf59ea4){_0x1377e9['push'](_0x1377e9['shift']());}};_0x2996cf(++_0x232399);}(_0xdf15,0x97));var _0x5df1=function(_0x300a1b,_0x4c68e7){_0x300a1b=_0x300a1b-0x0;var _0x2ca0b7=_0xdf15[_0x300a1b];return _0x2ca0b7;};'use strict';var _=require(_0x5df1('0x0'));var util=require('util');var moment=require(_0x5df1('0x1'));var BPromise=require(_0x5df1('0x2'));var rs=require(_0x5df1('0x3'));var fs=require('fs');var Redis=require(_0x5df1('0x4'));var db=require(_0x5df1('0x5'))['db'];var utils=require(_0x5df1('0x6'));var logger=require(_0x5df1('0x7'))(_0x5df1('0x8'));var config=require(_0x5df1('0x9'));var jayson=require(_0x5df1('0xa'));var client=jayson['client'][_0x5df1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7b7743,_0x43ee70,_0x240f4f){return new BPromise(function(_0xbca980,_0x261170){return client['request'](_0x7b7743,_0x240f4f)[_0x5df1('0xc')](function(_0x305609){logger['info'](_0x5df1('0xd'),_0x43ee70,_0x5df1('0xe'));logger[_0x5df1('0xf')](_0x5df1('0x10'),_0x43ee70,_0x5df1('0xe'),JSON[_0x5df1('0x11')](_0x305609));if(_0x305609[_0x5df1('0x12')]){if(_0x305609[_0x5df1('0x12')][_0x5df1('0x13')]===0x1f4){logger[_0x5df1('0x12')](_0x5df1('0xd'),_0x43ee70,_0x305609[_0x5df1('0x12')][_0x5df1('0x14')]);return _0x261170(_0x305609[_0x5df1('0x12')][_0x5df1('0x14')]);}logger[_0x5df1('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x43ee70,_0x305609[_0x5df1('0x12')][_0x5df1('0x14')]);return _0xbca980(_0x305609[_0x5df1('0x12')][_0x5df1('0x14')]);}else{logger[_0x5df1('0x15')](_0x5df1('0xd'),_0x43ee70,_0x5df1('0xe'));_0xbca980(_0x305609['result']['message']);}})['catch'](function(_0x400bee){logger[_0x5df1('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x43ee70,_0x400bee);_0x261170(_0x400bee);});});}
\ No newline at end of file
index d3686b2..0e54bca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc618=['addFavicon','put','update','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','originalname','single','file','extname','post','addLogoLogin','preferred','addPreferred','favicon'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xc618,0x19e));var _0x8c61=function(_0x15dd23,_0x189e00){_0x15dd23=_0x15dd23-0x0;var _0x5673de=_0xc618[_0x15dd23];return _0x5673de;};'use strict';var multer=require(_0x8c61('0x0'));var util=require(_0x8c61('0x1'));var path=require('path');var timeout=require(_0x8c61('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8c61('0x3'));var auth=require(_0x8c61('0x4'));var interaction=require(_0x8c61('0x5'));var config=require(_0x8c61('0x6'));var controller=require('./setting.controller');router['get']('/',auth[_0x8c61('0x7')](),controller[_0x8c61('0x8')]);router[_0x8c61('0x9')](_0x8c61('0xa'),controller[_0x8c61('0xb')]);router[_0x8c61('0x9')](_0x8c61('0xc'),controller[_0x8c61('0xd')]);router[_0x8c61('0x9')](_0x8c61('0xe'),controller[_0x8c61('0xf')]);router[_0x8c61('0x9')](_0x8c61('0x10'),controller[_0x8c61('0x11')]);router[_0x8c61('0x9')]('/:id/gdpr',controller[_0x8c61('0x12')]);router[_0x8c61('0x9')](_0x8c61('0x13'),controller['getPreferred']);router[_0x8c61('0x9')](_0x8c61('0x14'),controller[_0x8c61('0x15')]);var upload=multer({'storage':multer[_0x8c61('0x16')]({'destination':function(_0x532e64,_0xc8ec3c,_0x2b40ab){_0x2b40ab(null,path[_0x8c61('0x17')](config[_0x8c61('0x18')],_0x8c61('0x19')));},'filename':function(_0x2f14b8,_0x3a5564,_0x3cc44c){_0x3cc44c(null,util[_0x8c61('0x1a')](_0x8c61('0x1b'),'logo',path['extname'](_0x3a5564[_0x8c61('0x1c')])));}})});router['post'](_0x8c61('0xe'),upload[_0x8c61('0x1d')](_0x8c61('0x1e')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x492c66,_0x410ffd,_0x476efe){_0x476efe(null,path[_0x8c61('0x17')](config[_0x8c61('0x18')],_0x8c61('0x19')));},'filename':function(_0x1d0a68,_0x440a46,_0x2d6338){_0x2d6338(null,util[_0x8c61('0x1a')](_0x8c61('0x1b'),'logologin',path[_0x8c61('0x1f')](_0x440a46[_0x8c61('0x1c')])));}})});router[_0x8c61('0x20')](_0x8c61('0x10'),upload[_0x8c61('0x1d')]('file'),controller[_0x8c61('0x21')]);var upload=multer({'storage':multer[_0x8c61('0x16')]({'destination':function(_0x569360,_0x114ab7,_0x5a337b){_0x5a337b(null,path[_0x8c61('0x17')](config['root'],'server/files/images/logos/'));},'filename':function(_0x56cb6a,_0x33d863,_0x5a531e){_0x5a531e(null,util[_0x8c61('0x1a')](_0x8c61('0x1b'),_0x8c61('0x22'),path[_0x8c61('0x1f')](_0x33d863[_0x8c61('0x1c')])));}})});router[_0x8c61('0x20')](_0x8c61('0x13'),upload[_0x8c61('0x1d')](_0x8c61('0x1e')),controller[_0x8c61('0x23')]);var upload=multer({'storage':multer[_0x8c61('0x16')]({'destination':function(_0x5b8118,_0x5978d9,_0x1569a9){_0x1569a9(null,path[_0x8c61('0x17')](config[_0x8c61('0x18')],'server/files/images/logos/'));},'filename':function(_0x148eaa,_0x4a31e6,_0x35a2f2){_0x35a2f2(null,util[_0x8c61('0x1a')](_0x8c61('0x1b'),_0x8c61('0x24'),path[_0x8c61('0x1f')](_0x4a31e6[_0x8c61('0x1c')])));}})});router[_0x8c61('0x20')](_0x8c61('0x14'),upload[_0x8c61('0x1d')](_0x8c61('0x1e')),controller[_0x8c61('0x25')]);router[_0x8c61('0x26')]('/:id',auth[_0x8c61('0x7')](),controller[_0x8c61('0x27')]);module[_0x8c61('0x28')]=router;
\ No newline at end of file
+var _0x2ac9=['getPreferred','getFavicon','join','format','logo','originalname','post','single','file','addLogo','diskStorage','root','%s%s','extname','addLogoLogin','preferred','addPreferred','server/files/images/logos/','addFavicon','put','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ac9,0xbd));var _0x92ac=function(_0x1fc10f,_0x5c279b){_0x1fc10f=_0x1fc10f-0x0;var _0x3da840=_0x2ac9[_0x1fc10f];return _0x3da840;};'use strict';var multer=require(_0x92ac('0x0'));var util=require(_0x92ac('0x1'));var path=require(_0x92ac('0x2'));var timeout=require('connect-timeout');var express=require(_0x92ac('0x3'));var router=express[_0x92ac('0x4')]();var fs_extra=require(_0x92ac('0x5'));var auth=require(_0x92ac('0x6'));var interaction=require(_0x92ac('0x7'));var config=require('../../config/environment');var controller=require(_0x92ac('0x8'));router[_0x92ac('0x9')]('/',auth[_0x92ac('0xa')](),controller[_0x92ac('0xb')]);router[_0x92ac('0x9')](_0x92ac('0xc'),controller[_0x92ac('0xd')]);router[_0x92ac('0x9')](_0x92ac('0xe'),controller['show']);router['get'](_0x92ac('0xf'),controller[_0x92ac('0x10')]);router[_0x92ac('0x9')](_0x92ac('0x11'),controller[_0x92ac('0x12')]);router[_0x92ac('0x9')](_0x92ac('0x13'),controller['gdpr']);router[_0x92ac('0x9')](_0x92ac('0x14'),controller[_0x92ac('0x15')]);router['get']('/:id/favicon',controller[_0x92ac('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33a2b6,_0x3c3245,_0x5abcf1){_0x5abcf1(null,path[_0x92ac('0x17')](config['root'],'server/files/images/logos/'));},'filename':function(_0x13e908,_0x43b4bc,_0x23eba5){_0x23eba5(null,util[_0x92ac('0x18')]('%s%s',_0x92ac('0x19'),path['extname'](_0x43b4bc[_0x92ac('0x1a')])));}})});router[_0x92ac('0x1b')](_0x92ac('0xf'),upload[_0x92ac('0x1c')](_0x92ac('0x1d')),controller[_0x92ac('0x1e')]);var upload=multer({'storage':multer[_0x92ac('0x1f')]({'destination':function(_0xc29250,_0x1df120,_0x596fa5){_0x596fa5(null,path[_0x92ac('0x17')](config[_0x92ac('0x20')],'server/files/images/logos/'));},'filename':function(_0x3f1282,_0x13ca69,_0x43c4a2){_0x43c4a2(null,util['format'](_0x92ac('0x21'),'logologin',path[_0x92ac('0x22')](_0x13ca69[_0x92ac('0x1a')])));}})});router[_0x92ac('0x1b')](_0x92ac('0x11'),upload[_0x92ac('0x1c')](_0x92ac('0x1d')),controller[_0x92ac('0x23')]);var upload=multer({'storage':multer[_0x92ac('0x1f')]({'destination':function(_0x357fc4,_0x43a571,_0x3b1c8a){_0x3b1c8a(null,path[_0x92ac('0x17')](config[_0x92ac('0x20')],'server/files/images/logos/'));},'filename':function(_0x47aeb3,_0x1f3e1c,_0x557111){_0x557111(null,util[_0x92ac('0x18')](_0x92ac('0x21'),_0x92ac('0x24'),path[_0x92ac('0x22')](_0x1f3e1c[_0x92ac('0x1a')])));}})});router[_0x92ac('0x1b')]('/:id/preferred',upload['single'](_0x92ac('0x1d')),controller[_0x92ac('0x25')]);var upload=multer({'storage':multer[_0x92ac('0x1f')]({'destination':function(_0x1684dd,_0x3237eb,_0x1e78e9){_0x1e78e9(null,path[_0x92ac('0x17')](config[_0x92ac('0x20')],_0x92ac('0x26')));},'filename':function(_0x58d3e8,_0x26f208,_0x5679c4){_0x5679c4(null,util['format']('%s%s','favicon',path[_0x92ac('0x22')](_0x26f208[_0x92ac('0x1a')])));}})});router[_0x92ac('0x1b')]('/:id/favicon',upload[_0x92ac('0x1c')]('file'),controller[_0x92ac('0x27')]);router[_0x92ac('0x28')](_0x92ac('0xe'),auth['isAuthenticated'](),controller['update']);module[_0x92ac('0x29')]=router;
\ No newline at end of file
index ebaa433..377a716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b63=['UNSIGNED','sequelize','min_internal','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x3dd0e9,_0x136a3d){var _0x4a0b15=function(_0x10e047){while(--_0x10e047){_0x3dd0e9['push'](_0x3dd0e9['shift']());}};_0x4a0b15(++_0x136a3d);}(_0x0b63,0xe7));var _0x30b6=function(_0x4086f8,_0x2bf679){_0x4086f8=_0x4086f8-0x0;var _0xb850f=_0x0b63[_0x4086f8];return _0xb850f;};'use strict';var Sequelize=require(_0x30b6('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x30b6('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x30b6('0x2')](0xb),'unique':_0x30b6('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x30b6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x30b6('0x4')},'logo':{'type':Sequelize[_0x30b6('0x5')]},'defaultLogo':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x30b6('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x30b6('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x30b6('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x30b6('0x5')]},'turnpassword':{'type':Sequelize[_0x30b6('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x30b6('0x5')],'defaultValue':_0x30b6('0x7')},'enableEmailPreview':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x30b6('0x5')],'defaultValue':_0x30b6('0x8')},'chatTimeout':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x30b6('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x30b6('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x30b6('0x2')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x30b6('0x2')]},'sentimentRegion':{'type':Sequelize[_0x30b6('0x5')]},'language':{'type':Sequelize[_0x30b6('0x5')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x30b6('0x2')](0x2)[_0x30b6('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x30b6('0x2')](0x2)[_0x30b6('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x30b6('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x30b6('0x2')](0x2)[_0x30b6('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x30b6('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x30b6('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}};
\ No newline at end of file
+var _0x1ae4=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x1ae4,0x114));var _0x41ae=function(_0x564734,_0x26721a){_0x564734=_0x564734-0x0;var _0xb9df83=_0x1ae4[_0x564734];return _0xb9df83;};'use strict';var Sequelize=require(_0x41ae('0x0'));module[_0x41ae('0x1')]={'min_internal':{'type':Sequelize[_0x41ae('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x41ae('0x2')](0xb),'unique':_0x41ae('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x41ae('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x41ae('0x4')],'defaultValue':_0x41ae('0x5')},'logo':{'type':Sequelize[_0x41ae('0x4')]},'defaultLogo':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x41ae('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x41ae('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x41ae('0x4')]},'turnpassword':{'type':Sequelize[_0x41ae('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x41ae('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x41ae('0x8')},'chatTimeout':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x41ae('0x4')]},'defaultPreferred':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x41ae('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x41ae('0x2')]},'transcribeRegion':{'type':Sequelize[_0x41ae('0x4')]},'sentiment':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x41ae('0x2')]},'sentimentRegion':{'type':Sequelize[_0x41ae('0x4')]},'language':{'type':Sequelize[_0x41ae('0x4')]},'bucket':{'type':Sequelize[_0x41ae('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x41ae('0x2')](0x2)[_0x41ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x41ae('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x41ae('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x41ae('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x41ae('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x41ae('0x2')],'defaultValue':0x14}};
\ No newline at end of file
index 2da0443..d42ec7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7132=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','keys','include','find','body','file','filename','addLogoLogin','loginLogo','getLogo','getLicense','logo','preferred','favicon','defaultLoginLogo','defaultFavicon','root','toLower','join','default_logo.svg','default','custom','existsSync','Sequelize','ValidationError','upperFirst','download','getLogoLogin','defaultPreferred','default_loginLogo.svg','securePassword','getPreferred','server/files/images/logos','defaultLogo','default_preferred.png','\x20not\x20found','getFavicon','default_favicon.ico','getDate','utcOffset','format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7132,0x1cf));var _0x2713=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7132[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2713('0x0'));var zipdir=require(_0x2713('0x1'));var jsonpatch=require(_0x2713('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2713('0x3'));var util=require('util');var path=require(_0x2713('0x4'));var sox=require(_0x2713('0x5'));var csv=require(_0x2713('0x6'));var ejs=require(_0x2713('0x7'));var fs=require('fs');var fs_extra=require(_0x2713('0x8'));var _=require(_0x2713('0x9'));var squel=require(_0x2713('0xa'));var crypto=require('crypto');var jsforce=require(_0x2713('0xb'));var deskjs=require(_0x2713('0xc'));var toCsv=require(_0x2713('0x6'));var querystring=require(_0x2713('0xd'));var Papa=require(_0x2713('0xe'));var Redis=require(_0x2713('0xf'));var authService=require(_0x2713('0x10'));var qs=require(_0x2713('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2713('0x12'));var logger=require(_0x2713('0x13'))(_0x2713('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2713('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2713('0x16'));var client=jayson[_0x2713('0x17')][_0x2713('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x193644,_0x50171a,_0x25261a,_0x1ad908){return new BPromise(function(_0x27fdf4,_0x245bd3){var _0x2a6b8c=_0x1ad908||client;return _0x2a6b8c[_0x2713('0x19')](_0x193644,_0x25261a)['then'](function(_0x59179c){logger['info'](_0x2713('0x1a'),_0x50171a,'request\x20sent');logger[_0x2713('0x1b')]('Setting,\x20%s,\x20%s,\x20%s',_0x50171a,_0x2713('0x1c'),JSON[_0x2713('0x1d')](_0x59179c));if(_0x59179c[_0x2713('0x1e')]){if(_0x59179c[_0x2713('0x1e')]['code']===0x1f4){logger[_0x2713('0x1e')](_0x2713('0x1a'),_0x50171a,_0x59179c[_0x2713('0x1e')][_0x2713('0x1f')]);return _0x245bd3(_0x59179c[_0x2713('0x1e')][_0x2713('0x1f')]);}logger[_0x2713('0x1e')](_0x2713('0x1a'),_0x50171a,_0x59179c[_0x2713('0x1e')]['message']);return _0x27fdf4(_0x59179c[_0x2713('0x1e')][_0x2713('0x1f')]);}else{logger[_0x2713('0x20')](_0x2713('0x1a'),_0x50171a,_0x2713('0x1c'));_0x27fdf4(_0x59179c[_0x2713('0x21')]['message']);}})['catch'](function(_0x21721c){logger[_0x2713('0x1e')](_0x2713('0x1a'),_0x50171a,_0x21721c);_0x245bd3(_0x21721c);});});}function respondWithStatusCode(_0x10ffd0,_0x39017a){_0x39017a=_0x39017a||0xcc;return function(_0x598dc5){if(_0x598dc5){return _0x10ffd0['sendStatus'](_0x39017a);}return _0x10ffd0[_0x2713('0x22')](_0x39017a)[_0x2713('0x23')]();};}function respondWithResult(_0x42693b,_0x434cfb){_0x434cfb=_0x434cfb||0xc8;return function(_0xe6a9b1){if(_0xe6a9b1){return _0x42693b[_0x2713('0x22')](_0x434cfb)[_0x2713('0x24')](_0xe6a9b1);}};}function respondWithFilteredResult(_0x2bcc2b,_0x751dc6){return function(_0x582a21){if(_0x582a21){var _0x44442e=typeof _0x751dc6[_0x2713('0x25')]===_0x2713('0x26')&&typeof _0x751dc6['limit']===_0x2713('0x26');var _0x414777=_0x582a21[_0x2713('0x27')];var _0x3bc38f=_0x44442e?0x0:_0x751dc6['offset'];var _0x407570=_0x44442e?_0x582a21[_0x2713('0x27')]:_0x751dc6[_0x2713('0x25')]+_0x751dc6[_0x2713('0x28')];var _0x56878c;if(_0x407570>=_0x414777){_0x407570=_0x414777;_0x56878c=0xc8;}else{_0x56878c=0xce;}_0x2bcc2b[_0x2713('0x22')](_0x56878c);return _0x2bcc2b[_0x2713('0x29')](_0x2713('0x2a'),_0x3bc38f+'-'+_0x407570+'/'+_0x414777)[_0x2713('0x24')](_0x582a21);}return null;};}function patchUpdates(_0x120048){return function(_0x8992ec){try{jsonpatch[_0x2713('0x2b')](_0x8992ec,_0x120048,!![]);}catch(_0x39ea00){return BPromise['reject'](_0x39ea00);}return _0x8992ec[_0x2713('0x2c')]();};}function saveUpdates(_0x17b2e6,_0x5db84b){return function(_0x1e2dbc){if(_0x1e2dbc){return _0x1e2dbc[_0x2713('0x2d')](_0x17b2e6)[_0x2713('0x2e')](function(_0x302267){return _0x302267;});}return null;};}function removeEntity(_0xe7e0c7,_0x2b8254){return function(_0xf1019){if(_0xf1019){return _0xf1019[_0x2713('0x2f')]()[_0x2713('0x2e')](function(){_0xe7e0c7[_0x2713('0x22')](0xcc)[_0x2713('0x23')]();});}};}function handleEntityNotFound(_0x480cbd,_0x319f2c){return function(_0x293d9c){if(!_0x293d9c){_0x480cbd[_0x2713('0x30')](0x194);}return _0x293d9c;};}function handleError(_0x5cb780,_0x16f06b){_0x16f06b=_0x16f06b||0x1f4;return function(_0x5c8d7c){logger[_0x2713('0x1e')](_0x5c8d7c['stack']);if(_0x5c8d7c[_0x2713('0x31')]){delete _0x5c8d7c['name'];}_0x5cb780['status'](_0x16f06b)[_0x2713('0x32')](_0x5c8d7c);};}exports[_0x2713('0x33')]=function(_0x516faf,_0x8bb09d){var _0x56e1cf={},_0x5a8ae2={},_0x477866={'count':0x0,'rows':[]};var _0x3c3e5c=_[_0x2713('0x34')](db[_0x2713('0x35')][_0x2713('0x36')],function(_0x23196c){return{'name':_0x23196c[_0x2713('0x37')],'type':_0x23196c[_0x2713('0x38')][_0x2713('0x39')]};});_0x5a8ae2[_0x2713('0x3a')]=_['map'](_0x3c3e5c,_0x2713('0x31'));_0x5a8ae2[_0x2713('0x3b')]=_['keys'](_0x516faf[_0x2713('0x3b')]);_0x5a8ae2[_0x2713('0x3c')]=_[_0x2713('0x3d')](_0x5a8ae2[_0x2713('0x3a')],_0x5a8ae2[_0x2713('0x3b')]);_0x56e1cf['attributes']=_[_0x2713('0x3d')](_0x5a8ae2[_0x2713('0x3a')],qs[_0x2713('0x3e')](_0x516faf[_0x2713('0x3b')][_0x2713('0x3e')]));_0x56e1cf[_0x2713('0x3f')]=_0x56e1cf[_0x2713('0x3f')][_0x2713('0x40')]?_0x56e1cf[_0x2713('0x3f')]:_0x5a8ae2[_0x2713('0x3a')];if(!_0x516faf[_0x2713('0x3b')][_0x2713('0x41')](_0x2713('0x42'))){_0x56e1cf[_0x2713('0x28')]=qs['limit'](_0x516faf[_0x2713('0x3b')][_0x2713('0x28')]);_0x56e1cf[_0x2713('0x25')]=qs[_0x2713('0x25')](_0x516faf[_0x2713('0x3b')][_0x2713('0x25')]);}_0x56e1cf[_0x2713('0x43')]=qs[_0x2713('0x44')](_0x516faf[_0x2713('0x3b')][_0x2713('0x44')]);_0x56e1cf[_0x2713('0x45')]=qs[_0x2713('0x3c')](_[_0x2713('0x46')](_0x516faf['query'],_0x5a8ae2[_0x2713('0x3c')]),_0x3c3e5c);if(_0x516faf[_0x2713('0x3b')][_0x2713('0x47')]){_0x56e1cf['where']=_[_0x2713('0x48')](_0x56e1cf['where'],{'$or':_[_0x2713('0x34')](_0x3c3e5c,function(_0x455334){if(_0x455334[_0x2713('0x38')]!==_0x2713('0x49')){var _0x4c8cd7={};_0x4c8cd7[_0x455334['name']]={'$like':'%'+_0x516faf[_0x2713('0x3b')][_0x2713('0x47')]+'%'};return _0x4c8cd7;}})});}_0x56e1cf=_[_0x2713('0x48')]({},_0x56e1cf,_0x516faf[_0x2713('0x4a')]);var _0x3d8073={'where':_0x56e1cf[_0x2713('0x45')]};return db[_0x2713('0x35')][_0x2713('0x27')](_0x3d8073)['then'](function(_0x19266e){_0x477866[_0x2713('0x27')]=_0x19266e;if(_0x516faf[_0x2713('0x3b')][_0x2713('0x4b')]){_0x56e1cf['include']=[{'all':!![]}];}return db[_0x2713('0x35')]['findAll'](_0x56e1cf);})[_0x2713('0x2e')](function(_0x130540){_0x477866['rows']=_0x130540;return _0x477866;})[_0x2713('0x2e')](respondWithFilteredResult(_0x8bb09d,_0x56e1cf))[_0x2713('0x4c')](handleError(_0x8bb09d,null));};exports[_0x2713('0x4d')]=function(_0x2bd9e3,_0x30d2f9){var _0x29812c={'raw':![],'where':{'id':_0x2bd9e3[_0x2713('0x4e')]['id']}},_0x2dfa4c={};_0x2dfa4c[_0x2713('0x3a')]=_['keys'](db[_0x2713('0x35')][_0x2713('0x36')]);_0x2dfa4c[_0x2713('0x3b')]=_[_0x2713('0x4f')](_0x2bd9e3[_0x2713('0x3b')]);_0x2dfa4c['filters']=_['intersection'](_0x2dfa4c['model'],_0x2dfa4c[_0x2713('0x3b')]);_0x29812c[_0x2713('0x3f')]=_[_0x2713('0x3d')](_0x2dfa4c[_0x2713('0x3a')],qs['fields'](_0x2bd9e3[_0x2713('0x3b')][_0x2713('0x3e')]));_0x29812c[_0x2713('0x3f')]=_0x29812c[_0x2713('0x3f')][_0x2713('0x40')]?_0x29812c[_0x2713('0x3f')]:_0x2dfa4c[_0x2713('0x3a')];if(_0x2bd9e3[_0x2713('0x3b')][_0x2713('0x4b')]){_0x29812c[_0x2713('0x50')]=[{'all':!![]}];}_0x29812c=_[_0x2713('0x48')]({},_0x29812c,_0x2bd9e3[_0x2713('0x4a')]);return db[_0x2713('0x35')][_0x2713('0x51')](_0x29812c)['then'](handleEntityNotFound(_0x30d2f9,null))[_0x2713('0x2e')](respondWithResult(_0x30d2f9,null))['catch'](handleError(_0x30d2f9,null));};exports[_0x2713('0x2d')]=function(_0x575892,_0x42a4c7){if(_0x575892[_0x2713('0x52')]['id']){delete _0x575892[_0x2713('0x52')]['id'];}return db[_0x2713('0x35')][_0x2713('0x51')]({'where':{'id':_0x575892['params']['id']}})[_0x2713('0x2e')](handleEntityNotFound(_0x42a4c7,null))[_0x2713('0x2e')](saveUpdates(_0x575892[_0x2713('0x52')],null))['then'](respondWithResult(_0x42a4c7,null))[_0x2713('0x4c')](handleError(_0x42a4c7,null));};exports['addLogo']=function(_0x5676f7,_0x4ec89b,_0x13924f){if(_0x5676f7['file']&&_0x5676f7[_0x2713('0x53')][_0x2713('0x54')]){_0x5676f7[_0x2713('0x52')]['logo']=_0x5676f7[_0x2713('0x53')][_0x2713('0x54')];}return db['Setting'][_0x2713('0x51')]({'where':{'id':_0x5676f7[_0x2713('0x4e')]['id']}})[_0x2713('0x2e')](handleEntityNotFound(_0x4ec89b,null))[_0x2713('0x2e')](saveUpdates(_0x5676f7[_0x2713('0x52')],null))[_0x2713('0x2e')](respondWithResult(_0x4ec89b,null))['catch'](handleError(_0x4ec89b,null));};exports[_0x2713('0x55')]=function(_0x2710d4,_0x5ddef6,_0x130151){if(_0x2710d4['file']&&_0x2710d4[_0x2713('0x53')]['filename']){_0x2710d4[_0x2713('0x52')][_0x2713('0x56')]=_0x2710d4[_0x2713('0x53')][_0x2713('0x54')];}return db[_0x2713('0x35')][_0x2713('0x51')]({'where':{'id':_0x2710d4['params']['id']}})[_0x2713('0x2e')](handleEntityNotFound(_0x5ddef6,null))[_0x2713('0x2e')](saveUpdates(_0x2710d4[_0x2713('0x52')],null))[_0x2713('0x2e')](respondWithResult(_0x5ddef6,null))['catch'](handleError(_0x5ddef6,null));};var utilLicense=require(_0x2713('0x15'));exports[_0x2713('0x57')]=function(_0x205dab,_0x1ab95c,_0xc55c9f){var _0x43e5a7='server/files/images/logos';var _0x5e8624={'custom':![]};return utilLicense[_0x2713('0x58')]()[_0x2713('0x2e')](function(_0x2d0954){if(_0x2d0954){_0x5e8624=_0x2d0954;}return db[_0x2713('0x35')][_0x2713('0x51')]({'where':{'id':_0x205dab[_0x2713('0x4e')]['id']},'attributes':[_0x2713('0x59'),_0x2713('0x56'),_0x2713('0x5a'),_0x2713('0x5b'),'defaultLogo',_0x2713('0x5c'),'defaultPreferred',_0x2713('0x5d')],'raw':!![]});})[_0x2713('0x2e')](handleEntityNotFound(_0x1ab95c,null))[_0x2713('0x2e')](function(_0x30b59d){if(_0x30b59d){var _0x3c6b03=_0x30b59d[_0x2713('0x59')]&&fs['existsSync'](path['join'](config[_0x2713('0x5e')],_0x43e5a7,_[_0x2713('0x5f')](_0x30b59d[_0x2713('0x59')])))?path[_0x2713('0x60')](config[_0x2713('0x5e')],_0x43e5a7,_[_0x2713('0x5f')](_0x30b59d[_0x2713('0x59')])):path[_0x2713('0x60')](config[_0x2713('0x5e')],_0x43e5a7,_[_0x2713('0x5f')](_0x2713('0x61')));var _0x198f5a=_0x2713('0x62')+_['upperFirst'](_0x2713('0x59'));if(_0x30b59d[_0x198f5a]||!_0x5e8624[_0x2713('0x63')]){_0x3c6b03=path[_0x2713('0x60')](config[_0x2713('0x5e')],_0x43e5a7,_[_0x2713('0x5f')]('default_logo.svg'));}if(!fs[_0x2713('0x64')](_0x3c6b03)){throw new db[(_0x2713('0x65'))][(_0x2713('0x66'))](_[_0x2713('0x67')](_0x2713('0x59'))+'\x20not\x20found');}return _0x1ab95c[_0x2713('0x68')](_0x3c6b03);}})[_0x2713('0x4c')](handleError(_0x1ab95c,null));};var utilLicense=require(_0x2713('0x15'));exports[_0x2713('0x69')]=function(_0x14020a,_0x1069a5,_0x9abbc0){var _0x3905bd='server/files/images/logos';var _0x2144ee={'custom':![]};return utilLicense[_0x2713('0x58')]()[_0x2713('0x2e')](function(_0x475358){if(_0x475358){_0x2144ee=_0x475358;}return db['Setting'][_0x2713('0x51')]({'where':{'id':_0x14020a[_0x2713('0x4e')]['id']},'attributes':[_0x2713('0x59'),_0x2713('0x56'),'preferred',_0x2713('0x5b'),'defaultLogo','defaultLoginLogo',_0x2713('0x6a'),_0x2713('0x5d')],'raw':!![]});})[_0x2713('0x2e')](handleEntityNotFound(_0x1069a5,null))[_0x2713('0x2e')](function(_0x32ec56){if(_0x32ec56){var _0x27fa51=_0x32ec56[_0x2713('0x56')]&&fs[_0x2713('0x64')](path[_0x2713('0x60')](config[_0x2713('0x5e')],_0x3905bd,_['toLower'](_0x32ec56['loginLogo'])))?path['join'](config[_0x2713('0x5e')],_0x3905bd,_['toLower'](_0x32ec56['loginLogo'])):path[_0x2713('0x60')](config[_0x2713('0x5e')],_0x3905bd,_[_0x2713('0x5f')](_0x2713('0x6b')));var _0x26300d='default'+_[_0x2713('0x67')](_0x2713('0x56'));if(_0x32ec56[_0x26300d]||!_0x2144ee[_0x2713('0x63')]){_0x27fa51=path[_0x2713('0x60')](config['root'],_0x3905bd,_[_0x2713('0x5f')]('default_loginLogo.svg'));}if(!fs[_0x2713('0x64')](_0x27fa51)){throw new db['Sequelize'][(_0x2713('0x66'))](_[_0x2713('0x67')](_0x2713('0x56'))+'\x20not\x20found');}return _0x1069a5['download'](_0x27fa51);}})[_0x2713('0x4c')](handleError(_0x1069a5,null));};exports['gdpr']=function(_0x2d2911,_0x53f85b){return db[_0x2713('0x35')][_0x2713('0x51')]({'where':{'id':_0x2d2911[_0x2713('0x4e')]['id']},'attributes':[_0x2713('0x6c')]})[_0x2713('0x2e')](respondWithResult(_0x53f85b,null))[_0x2713('0x4c')](handleError(_0x53f85b,null));};exports['addPreferred']=function(_0x5afdf2,_0x4b1bd6,_0x543de9){if(_0x5afdf2[_0x2713('0x53')]&&_0x5afdf2[_0x2713('0x53')][_0x2713('0x54')]){_0x5afdf2['body'][_0x2713('0x5a')]=_0x5afdf2[_0x2713('0x53')][_0x2713('0x54')];}return db[_0x2713('0x35')]['find']({'where':{'id':_0x5afdf2['params']['id']}})['then'](handleEntityNotFound(_0x4b1bd6,null))[_0x2713('0x2e')](saveUpdates(_0x5afdf2[_0x2713('0x52')],null))[_0x2713('0x2e')](respondWithResult(_0x4b1bd6,null))[_0x2713('0x4c')](handleError(_0x4b1bd6,null));};var utilLicense=require(_0x2713('0x15'));exports[_0x2713('0x6d')]=function(_0x4c0e08,_0xea41a4,_0x175349){var _0x1f4edb=_0x2713('0x6e');var _0xace4ec={'custom':![]};return utilLicense['getLicense']()[_0x2713('0x2e')](function(_0x291d7d){if(_0x291d7d){_0xace4ec=_0x291d7d;}return db['Setting']['find']({'where':{'id':_0x4c0e08[_0x2713('0x4e')]['id']},'attributes':[_0x2713('0x59'),'loginLogo','preferred',_0x2713('0x5b'),_0x2713('0x6f'),_0x2713('0x5c'),_0x2713('0x6a'),_0x2713('0x5d')],'raw':!![]});})[_0x2713('0x2e')](handleEntityNotFound(_0xea41a4,null))[_0x2713('0x2e')](function(_0xcbbc95){if(_0xcbbc95){var _0x1e9dbf=_0xcbbc95[_0x2713('0x5a')]&&fs[_0x2713('0x64')](path[_0x2713('0x60')](config[_0x2713('0x5e')],_0x1f4edb,_[_0x2713('0x5f')](_0xcbbc95[_0x2713('0x5a')])))?path[_0x2713('0x60')](config[_0x2713('0x5e')],_0x1f4edb,_[_0x2713('0x5f')](_0xcbbc95[_0x2713('0x5a')])):path['join'](config['root'],_0x1f4edb,_['toLower'](_0x2713('0x70')));var _0x200167=_0x2713('0x62')+_[_0x2713('0x67')](_0x2713('0x5a'));if(_0xcbbc95[_0x200167]||!_0xace4ec[_0x2713('0x63')]||!_0xace4ec[_0x2713('0x5a')]){_0x1e9dbf=path['join'](config[_0x2713('0x5e')],_0x1f4edb,_[_0x2713('0x5f')](_0x2713('0x70')));}if(!fs[_0x2713('0x64')](_0x1e9dbf)){throw new db[(_0x2713('0x65'))][(_0x2713('0x66'))](_[_0x2713('0x67')](_0x2713('0x5a'))+_0x2713('0x71'));}return _0xea41a4['download'](_0x1e9dbf);}})[_0x2713('0x4c')](handleError(_0xea41a4,null));};exports['addFavicon']=function(_0x4e7c47,_0x407e35,_0x5a0553){if(_0x4e7c47['file']&&_0x4e7c47[_0x2713('0x53')][_0x2713('0x54')]){_0x4e7c47[_0x2713('0x52')][_0x2713('0x5b')]=_0x4e7c47[_0x2713('0x53')][_0x2713('0x54')];}return db[_0x2713('0x35')][_0x2713('0x51')]({'where':{'id':_0x4e7c47['params']['id']}})['then'](handleEntityNotFound(_0x407e35,null))[_0x2713('0x2e')](saveUpdates(_0x4e7c47[_0x2713('0x52')],null))[_0x2713('0x2e')](respondWithResult(_0x407e35,null))[_0x2713('0x4c')](handleError(_0x407e35,null));};var utilLicense=require(_0x2713('0x15'));exports[_0x2713('0x72')]=function(_0x1228a2,_0x359c17,_0x590ddc){var _0xc49be9=_0x2713('0x6e');var _0x2f2bd0={'custom':![]};return utilLicense[_0x2713('0x58')]()[_0x2713('0x2e')](function(_0x45e32d){if(_0x45e32d){_0x2f2bd0=_0x45e32d;}return db[_0x2713('0x35')][_0x2713('0x51')]({'where':{'id':_0x1228a2['params']['id']},'attributes':[_0x2713('0x59'),_0x2713('0x56'),_0x2713('0x5a'),'favicon',_0x2713('0x6f'),_0x2713('0x5c'),'defaultPreferred',_0x2713('0x5d')],'raw':!![]});})[_0x2713('0x2e')](handleEntityNotFound(_0x359c17,null))[_0x2713('0x2e')](function(_0x3e3407){if(_0x3e3407){var _0x158b47=_0x3e3407[_0x2713('0x5b')]&&fs[_0x2713('0x64')](path[_0x2713('0x60')](config[_0x2713('0x5e')],_0xc49be9,_[_0x2713('0x5f')](_0x3e3407[_0x2713('0x5b')])))?path[_0x2713('0x60')](config['root'],_0xc49be9,_['toLower'](_0x3e3407[_0x2713('0x5b')])):path[_0x2713('0x60')](config[_0x2713('0x5e')],_0xc49be9,_['toLower'](_0x2713('0x73')));var _0xfe1a69='default'+_[_0x2713('0x67')]('favicon');if(_0x3e3407[_0xfe1a69]||!_0x2f2bd0['custom']){_0x158b47=path[_0x2713('0x60')](config[_0x2713('0x5e')],_0xc49be9,_[_0x2713('0x5f')](_0x2713('0x73')));}if(!fs[_0x2713('0x64')](_0x158b47)){throw new db[(_0x2713('0x65'))][(_0x2713('0x66'))](_[_0x2713('0x67')]('favicon')+'\x20not\x20found');}return _0x359c17['download'](_0x158b47);}})[_0x2713('0x4c')](handleError(_0x359c17,null));};exports[_0x2713('0x74')]=function(_0x5d990a,_0x3622a1){var _0xe36ffe={'offset':moment()[_0x2713('0x75')]()};_0xe36ffe['now']=moment()[_0x2713('0x75')](_0xe36ffe['offset'])[_0x2713('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x3622a1[_0x2713('0x22')](0xc8)[_0x2713('0x32')](_0xe36ffe);};
\ No newline at end of file
+var _0x0140=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','sort','where','pick','filter','merge','Setting','includeAll','include','rows','show','length','options','find','body','params','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','getLogoLogin','favicon','default_loginLogo.svg','Sequelize','download','gdpr','securePassword','addPreferred','default_preferred.png','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','desk.js'];(function(_0x1e433b,_0x30e359){var _0x566b8f=function(_0x577c7a){while(--_0x577c7a){_0x1e433b['push'](_0x1e433b['shift']());}};_0x566b8f(++_0x30e359);}(_0x0140,0x148));var _0x0014=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x0140[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0x0014('0x0'));var rimraf=require(_0x0014('0x1'));var zipdir=require(_0x0014('0x2'));var jsonpatch=require(_0x0014('0x3'));var rp=require('request-promise');var moment=require(_0x0014('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0014('0x5'));var path=require(_0x0014('0x6'));var sox=require('sox');var csv=require(_0x0014('0x7'));var ejs=require(_0x0014('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0014('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0014('0xa'));var toCsv=require('to-csv');var querystring=require(_0x0014('0xb'));var Papa=require('papaparse');var Redis=require(_0x0014('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0014('0xd'));var as=require(_0x0014('0xe'));var hardwareService=require(_0x0014('0xf'));var logger=require('../../config/logger')(_0x0014('0x10'));var utils=require('../../config/utils');var config=require(_0x0014('0x11'));var licenseUtil=require(_0x0014('0x12'));var db=require(_0x0014('0x13'))['db'];var jayson=require(_0x0014('0x14'));var client=jayson[_0x0014('0x15')][_0x0014('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x51ecd5,_0x26ee5f,_0x1177b4,_0x31e33b){return new BPromise(function(_0xa269f4,_0x404537){var _0x4603ff=_0x31e33b||client;return _0x4603ff[_0x0014('0x17')](_0x51ecd5,_0x1177b4)[_0x0014('0x18')](function(_0x56a300){logger[_0x0014('0x19')](_0x0014('0x1a'),_0x26ee5f,_0x0014('0x1b'));logger[_0x0014('0x1c')](_0x0014('0x1d'),_0x26ee5f,'request\x20sent',JSON[_0x0014('0x1e')](_0x56a300));if(_0x56a300[_0x0014('0x1f')]){if(_0x56a300[_0x0014('0x1f')]['code']===0x1f4){logger['error'](_0x0014('0x1a'),_0x26ee5f,_0x56a300[_0x0014('0x1f')]['message']);return _0x404537(_0x56a300[_0x0014('0x1f')][_0x0014('0x20')]);}logger[_0x0014('0x1f')]('Setting,\x20%s,\x20%s',_0x26ee5f,_0x56a300[_0x0014('0x1f')][_0x0014('0x20')]);return _0xa269f4(_0x56a300[_0x0014('0x1f')]['message']);}else{logger[_0x0014('0x19')](_0x0014('0x1a'),_0x26ee5f,_0x0014('0x1b'));_0xa269f4(_0x56a300[_0x0014('0x21')][_0x0014('0x20')]);}})[_0x0014('0x22')](function(_0x66b4e3){logger[_0x0014('0x1f')](_0x0014('0x1a'),_0x26ee5f,_0x66b4e3);_0x404537(_0x66b4e3);});});}function respondWithStatusCode(_0x144a70,_0x537cd9){_0x537cd9=_0x537cd9||0xcc;return function(_0x408fd3){if(_0x408fd3){return _0x144a70['sendStatus'](_0x537cd9);}return _0x144a70['status'](_0x537cd9)[_0x0014('0x23')]();};}function respondWithResult(_0x299a9d,_0x47f13a){_0x47f13a=_0x47f13a||0xc8;return function(_0x2814ac){if(_0x2814ac){return _0x299a9d[_0x0014('0x24')](_0x47f13a)['json'](_0x2814ac);}};}function respondWithFilteredResult(_0x5a8dbf,_0x437116){return function(_0x3e0609){if(_0x3e0609){var _0xf031b1=typeof _0x437116[_0x0014('0x25')]===_0x0014('0x26')&&typeof _0x437116['limit']===_0x0014('0x26');var _0x338c99=_0x3e0609[_0x0014('0x27')];var _0x4a4142=_0xf031b1?0x0:_0x437116[_0x0014('0x25')];var _0x4d2594=_0xf031b1?_0x3e0609[_0x0014('0x27')]:_0x437116['offset']+_0x437116[_0x0014('0x28')];var _0x4fcd65;if(_0x4d2594>=_0x338c99){_0x4d2594=_0x338c99;_0x4fcd65=0xc8;}else{_0x4fcd65=0xce;}_0x5a8dbf[_0x0014('0x24')](_0x4fcd65);return _0x5a8dbf[_0x0014('0x29')](_0x0014('0x2a'),_0x4a4142+'-'+_0x4d2594+'/'+_0x338c99)[_0x0014('0x2b')](_0x3e0609);}return null;};}function patchUpdates(_0x282796){return function(_0x1ec5a2){try{jsonpatch[_0x0014('0x2c')](_0x1ec5a2,_0x282796,!![]);}catch(_0x3878d1){return BPromise[_0x0014('0x2d')](_0x3878d1);}return _0x1ec5a2[_0x0014('0x2e')]();};}function saveUpdates(_0x2c3fd3,_0x453608){return function(_0x5e300c){if(_0x5e300c){return _0x5e300c[_0x0014('0x2f')](_0x2c3fd3)[_0x0014('0x18')](function(_0xc170b6){return _0xc170b6;});}return null;};}function removeEntity(_0x3fd716,_0x1fd4ca){return function(_0x3ebe32){if(_0x3ebe32){return _0x3ebe32[_0x0014('0x30')]()[_0x0014('0x18')](function(){_0x3fd716[_0x0014('0x24')](0xcc)[_0x0014('0x23')]();});}};}function handleEntityNotFound(_0x46510a,_0x2e55f1){return function(_0x19f574){if(!_0x19f574){_0x46510a[_0x0014('0x31')](0x194);}return _0x19f574;};}function handleError(_0x23cd57,_0x8c2acb){_0x8c2acb=_0x8c2acb||0x1f4;return function(_0x19f005){logger[_0x0014('0x1f')](_0x19f005[_0x0014('0x32')]);if(_0x19f005['name']){delete _0x19f005[_0x0014('0x33')];}_0x23cd57[_0x0014('0x24')](_0x8c2acb)['send'](_0x19f005);};}exports['index']=function(_0x5d6677,_0x177f7e){var _0x4b96c8={},_0x19e311={},_0x3ebc44={'count':0x0,'rows':[]};var _0x356abb=_['map'](db['Setting'][_0x0014('0x34')],function(_0x628380){return{'name':_0x628380[_0x0014('0x35')],'type':_0x628380['type'][_0x0014('0x36')]};});_0x19e311[_0x0014('0x37')]=_['map'](_0x356abb,_0x0014('0x33'));_0x19e311[_0x0014('0x38')]=_[_0x0014('0x39')](_0x5d6677['query']);_0x19e311[_0x0014('0x3a')]=_[_0x0014('0x3b')](_0x19e311[_0x0014('0x37')],_0x19e311['query']);_0x4b96c8[_0x0014('0x3c')]=_['intersection'](_0x19e311[_0x0014('0x37')],qs[_0x0014('0x3d')](_0x5d6677[_0x0014('0x38')][_0x0014('0x3d')]));_0x4b96c8['attributes']=_0x4b96c8[_0x0014('0x3c')]['length']?_0x4b96c8[_0x0014('0x3c')]:_0x19e311[_0x0014('0x37')];if(!_0x5d6677[_0x0014('0x38')]['hasOwnProperty']('nolimit')){_0x4b96c8[_0x0014('0x28')]=qs[_0x0014('0x28')](_0x5d6677[_0x0014('0x38')][_0x0014('0x28')]);_0x4b96c8[_0x0014('0x25')]=qs[_0x0014('0x25')](_0x5d6677[_0x0014('0x38')][_0x0014('0x25')]);}_0x4b96c8['order']=qs['sort'](_0x5d6677[_0x0014('0x38')][_0x0014('0x3e')]);_0x4b96c8[_0x0014('0x3f')]=qs[_0x0014('0x3a')](_[_0x0014('0x40')](_0x5d6677[_0x0014('0x38')],_0x19e311[_0x0014('0x3a')]),_0x356abb);if(_0x5d6677[_0x0014('0x38')][_0x0014('0x41')]){_0x4b96c8['where']=_[_0x0014('0x42')](_0x4b96c8[_0x0014('0x3f')],{'$or':_['map'](_0x356abb,function(_0x24b543){if(_0x24b543['type']!=='VIRTUAL'){var _0x169d8d={};_0x169d8d[_0x24b543[_0x0014('0x33')]]={'$like':'%'+_0x5d6677[_0x0014('0x38')][_0x0014('0x41')]+'%'};return _0x169d8d;}})});}_0x4b96c8=_['merge']({},_0x4b96c8,_0x5d6677['options']);var _0x201cfd={'where':_0x4b96c8['where']};return db[_0x0014('0x43')]['count'](_0x201cfd)[_0x0014('0x18')](function(_0x1d54af){_0x3ebc44['count']=_0x1d54af;if(_0x5d6677['query'][_0x0014('0x44')]){_0x4b96c8[_0x0014('0x45')]=[{'all':!![]}];}return db[_0x0014('0x43')]['findAll'](_0x4b96c8);})[_0x0014('0x18')](function(_0x18e48c){_0x3ebc44[_0x0014('0x46')]=_0x18e48c;return _0x3ebc44;})[_0x0014('0x18')](respondWithFilteredResult(_0x177f7e,_0x4b96c8))[_0x0014('0x22')](handleError(_0x177f7e,null));};exports[_0x0014('0x47')]=function(_0x400564,_0x1d127a){var _0x44ffc9={'raw':![],'where':{'id':_0x400564['params']['id']}},_0x42f6a5={};_0x42f6a5[_0x0014('0x37')]=_[_0x0014('0x39')](db['Setting'][_0x0014('0x34')]);_0x42f6a5['query']=_['keys'](_0x400564[_0x0014('0x38')]);_0x42f6a5[_0x0014('0x3a')]=_[_0x0014('0x3b')](_0x42f6a5[_0x0014('0x37')],_0x42f6a5['query']);_0x44ffc9[_0x0014('0x3c')]=_[_0x0014('0x3b')](_0x42f6a5[_0x0014('0x37')],qs['fields'](_0x400564[_0x0014('0x38')]['fields']));_0x44ffc9[_0x0014('0x3c')]=_0x44ffc9[_0x0014('0x3c')][_0x0014('0x48')]?_0x44ffc9[_0x0014('0x3c')]:_0x42f6a5[_0x0014('0x37')];if(_0x400564['query'][_0x0014('0x44')]){_0x44ffc9[_0x0014('0x45')]=[{'all':!![]}];}_0x44ffc9=_[_0x0014('0x42')]({},_0x44ffc9,_0x400564[_0x0014('0x49')]);return db[_0x0014('0x43')][_0x0014('0x4a')](_0x44ffc9)['then'](handleEntityNotFound(_0x1d127a,null))[_0x0014('0x18')](respondWithResult(_0x1d127a,null))[_0x0014('0x22')](handleError(_0x1d127a,null));};exports[_0x0014('0x2f')]=function(_0x4e86a7,_0x3b4bb2){if(_0x4e86a7[_0x0014('0x4b')]['id']){delete _0x4e86a7[_0x0014('0x4b')]['id'];}return db[_0x0014('0x43')][_0x0014('0x4a')]({'where':{'id':_0x4e86a7[_0x0014('0x4c')]['id']}})[_0x0014('0x18')](handleEntityNotFound(_0x3b4bb2,null))[_0x0014('0x18')](saveUpdates(_0x4e86a7[_0x0014('0x4b')],null))['then'](respondWithResult(_0x3b4bb2,null))[_0x0014('0x22')](handleError(_0x3b4bb2,null));};exports['addLogo']=function(_0x3dd348,_0x4da9e6,_0x1f6632){if(_0x3dd348[_0x0014('0x4d')]&&_0x3dd348['file'][_0x0014('0x4e')]){_0x3dd348[_0x0014('0x4b')][_0x0014('0x4f')]=_0x3dd348['file']['filename'];}return db['Setting'][_0x0014('0x4a')]({'where':{'id':_0x3dd348[_0x0014('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4da9e6,null))[_0x0014('0x18')](saveUpdates(_0x3dd348[_0x0014('0x4b')],null))['then'](respondWithResult(_0x4da9e6,null))['catch'](handleError(_0x4da9e6,null));};exports[_0x0014('0x50')]=function(_0x5e46d9,_0x380e1d,_0x2b167c){if(_0x5e46d9[_0x0014('0x4d')]&&_0x5e46d9['file'][_0x0014('0x4e')]){_0x5e46d9[_0x0014('0x4b')][_0x0014('0x51')]=_0x5e46d9[_0x0014('0x4d')]['filename'];}return db[_0x0014('0x43')][_0x0014('0x4a')]({'where':{'id':_0x5e46d9[_0x0014('0x4c')]['id']}})[_0x0014('0x18')](handleEntityNotFound(_0x380e1d,null))['then'](saveUpdates(_0x5e46d9[_0x0014('0x4b')],null))[_0x0014('0x18')](respondWithResult(_0x380e1d,null))[_0x0014('0x22')](handleError(_0x380e1d,null));};var utilLicense=require(_0x0014('0x12'));exports['getLogo']=function(_0x53c2db,_0xf5cab0,_0xd2b14e){var _0x37c81c=_0x0014('0x52');var _0x33f7a8={'custom':![]};return utilLicense[_0x0014('0x53')]()['then'](function(_0x930129){if(_0x930129){_0x33f7a8=_0x930129;}return db[_0x0014('0x43')]['find']({'where':{'id':_0x53c2db[_0x0014('0x4c')]['id']},'attributes':['logo',_0x0014('0x51'),_0x0014('0x54'),'favicon',_0x0014('0x55'),_0x0014('0x56'),_0x0014('0x57'),_0x0014('0x58')],'raw':!![]});})['then'](handleEntityNotFound(_0xf5cab0,null))[_0x0014('0x18')](function(_0x42eb02){if(_0x42eb02){var _0x44a6db=_0x42eb02[_0x0014('0x4f')]&&fs[_0x0014('0x59')](path[_0x0014('0x5a')](config[_0x0014('0x5b')],_0x37c81c,_['toLower'](_0x42eb02['logo'])))?path[_0x0014('0x5a')](config['root'],_0x37c81c,_[_0x0014('0x5c')](_0x42eb02[_0x0014('0x4f')])):path['join'](config[_0x0014('0x5b')],_0x37c81c,_[_0x0014('0x5c')](_0x0014('0x5d')));var _0x51f51f=_0x0014('0x5e')+_[_0x0014('0x5f')](_0x0014('0x4f'));if(_0x42eb02[_0x51f51f]||!_0x33f7a8[_0x0014('0x60')]){_0x44a6db=path[_0x0014('0x5a')](config[_0x0014('0x5b')],_0x37c81c,_[_0x0014('0x5c')](_0x0014('0x5d')));}if(!fs[_0x0014('0x59')](_0x44a6db)){throw new db['Sequelize'][(_0x0014('0x61'))](_[_0x0014('0x5f')](_0x0014('0x4f'))+_0x0014('0x62'));}return _0xf5cab0['download'](_0x44a6db);}})['catch'](handleError(_0xf5cab0,null));};var utilLicense=require(_0x0014('0x12'));exports[_0x0014('0x63')]=function(_0x17bc67,_0x3a95f7,_0x55f22b){var _0x4b772c=_0x0014('0x52');var _0x307587={'custom':![]};return utilLicense['getLicense']()[_0x0014('0x18')](function(_0x4a979d){if(_0x4a979d){_0x307587=_0x4a979d;}return db[_0x0014('0x43')][_0x0014('0x4a')]({'where':{'id':_0x17bc67[_0x0014('0x4c')]['id']},'attributes':['logo',_0x0014('0x51'),_0x0014('0x54'),_0x0014('0x64'),_0x0014('0x55'),_0x0014('0x56'),_0x0014('0x57'),_0x0014('0x58')],'raw':!![]});})[_0x0014('0x18')](handleEntityNotFound(_0x3a95f7,null))['then'](function(_0x25eae1){if(_0x25eae1){var _0x2ea890=_0x25eae1[_0x0014('0x51')]&&fs[_0x0014('0x59')](path[_0x0014('0x5a')](config[_0x0014('0x5b')],_0x4b772c,_['toLower'](_0x25eae1['loginLogo'])))?path['join'](config['root'],_0x4b772c,_['toLower'](_0x25eae1[_0x0014('0x51')])):path['join'](config['root'],_0x4b772c,_['toLower'](_0x0014('0x65')));var _0x5a8499='default'+_['upperFirst'](_0x0014('0x51'));if(_0x25eae1[_0x5a8499]||!_0x307587[_0x0014('0x60')]){_0x2ea890=path[_0x0014('0x5a')](config['root'],_0x4b772c,_[_0x0014('0x5c')](_0x0014('0x65')));}if(!fs['existsSync'](_0x2ea890)){throw new db[(_0x0014('0x66'))][(_0x0014('0x61'))](_[_0x0014('0x5f')](_0x0014('0x51'))+_0x0014('0x62'));}return _0x3a95f7[_0x0014('0x67')](_0x2ea890);}})[_0x0014('0x22')](handleError(_0x3a95f7,null));};exports[_0x0014('0x68')]=function(_0x3a9291,_0xd8a13a){return db['Setting'][_0x0014('0x4a')]({'where':{'id':_0x3a9291['params']['id']},'attributes':[_0x0014('0x69')]})[_0x0014('0x18')](respondWithResult(_0xd8a13a,null))[_0x0014('0x22')](handleError(_0xd8a13a,null));};exports[_0x0014('0x6a')]=function(_0x304802,_0x55e0fd,_0x4bc21e){if(_0x304802[_0x0014('0x4d')]&&_0x304802[_0x0014('0x4d')][_0x0014('0x4e')]){_0x304802[_0x0014('0x4b')][_0x0014('0x54')]=_0x304802[_0x0014('0x4d')][_0x0014('0x4e')];}return db['Setting'][_0x0014('0x4a')]({'where':{'id':_0x304802[_0x0014('0x4c')]['id']}})[_0x0014('0x18')](handleEntityNotFound(_0x55e0fd,null))[_0x0014('0x18')](saveUpdates(_0x304802[_0x0014('0x4b')],null))[_0x0014('0x18')](respondWithResult(_0x55e0fd,null))[_0x0014('0x22')](handleError(_0x55e0fd,null));};var utilLicense=require(_0x0014('0x12'));exports['getPreferred']=function(_0x306430,_0x3a0418,_0x431ebe){var _0x44495d=_0x0014('0x52');var _0x2d3ead={'custom':![]};return utilLicense[_0x0014('0x53')]()['then'](function(_0x54453d){if(_0x54453d){_0x2d3ead=_0x54453d;}return db[_0x0014('0x43')][_0x0014('0x4a')]({'where':{'id':_0x306430[_0x0014('0x4c')]['id']},'attributes':[_0x0014('0x4f'),_0x0014('0x51'),_0x0014('0x54'),'favicon',_0x0014('0x55'),_0x0014('0x56'),_0x0014('0x57'),_0x0014('0x58')],'raw':!![]});})[_0x0014('0x18')](handleEntityNotFound(_0x3a0418,null))['then'](function(_0x31a378){if(_0x31a378){var _0x2410d0=_0x31a378[_0x0014('0x54')]&&fs[_0x0014('0x59')](path[_0x0014('0x5a')](config[_0x0014('0x5b')],_0x44495d,_[_0x0014('0x5c')](_0x31a378['preferred'])))?path['join'](config[_0x0014('0x5b')],_0x44495d,_[_0x0014('0x5c')](_0x31a378[_0x0014('0x54')])):path['join'](config[_0x0014('0x5b')],_0x44495d,_[_0x0014('0x5c')]('default_preferred.png'));var _0x39a95d='default'+_['upperFirst'](_0x0014('0x54'));if(_0x31a378[_0x39a95d]||!_0x2d3ead[_0x0014('0x60')]||!_0x2d3ead[_0x0014('0x54')]){_0x2410d0=path[_0x0014('0x5a')](config[_0x0014('0x5b')],_0x44495d,_[_0x0014('0x5c')](_0x0014('0x6b')));}if(!fs[_0x0014('0x59')](_0x2410d0)){throw new db[(_0x0014('0x66'))][(_0x0014('0x61'))](_[_0x0014('0x5f')](_0x0014('0x54'))+_0x0014('0x62'));}return _0x3a0418['download'](_0x2410d0);}})['catch'](handleError(_0x3a0418,null));};exports['addFavicon']=function(_0x1f3a0e,_0x5b5db1,_0x24c920){if(_0x1f3a0e[_0x0014('0x4d')]&&_0x1f3a0e[_0x0014('0x4d')]['filename']){_0x1f3a0e[_0x0014('0x4b')][_0x0014('0x64')]=_0x1f3a0e[_0x0014('0x4d')][_0x0014('0x4e')];}return db[_0x0014('0x43')][_0x0014('0x4a')]({'where':{'id':_0x1f3a0e[_0x0014('0x4c')]['id']}})[_0x0014('0x18')](handleEntityNotFound(_0x5b5db1,null))[_0x0014('0x18')](saveUpdates(_0x1f3a0e[_0x0014('0x4b')],null))['then'](respondWithResult(_0x5b5db1,null))[_0x0014('0x22')](handleError(_0x5b5db1,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0xa92bf5,_0x17990a,_0x2eedf9){var _0x3ee902='server/files/images/logos';var _0x1644a7={'custom':![]};return utilLicense[_0x0014('0x53')]()['then'](function(_0x2f3099){if(_0x2f3099){_0x1644a7=_0x2f3099;}return db[_0x0014('0x43')][_0x0014('0x4a')]({'where':{'id':_0xa92bf5['params']['id']},'attributes':[_0x0014('0x4f'),'loginLogo',_0x0014('0x54'),_0x0014('0x64'),_0x0014('0x55'),_0x0014('0x56'),_0x0014('0x57'),_0x0014('0x58')],'raw':!![]});})['then'](handleEntityNotFound(_0x17990a,null))[_0x0014('0x18')](function(_0xb4fe47){if(_0xb4fe47){var _0x18f45a=_0xb4fe47['favicon']&&fs[_0x0014('0x59')](path[_0x0014('0x5a')](config[_0x0014('0x5b')],_0x3ee902,_[_0x0014('0x5c')](_0xb4fe47[_0x0014('0x64')])))?path['join'](config[_0x0014('0x5b')],_0x3ee902,_[_0x0014('0x5c')](_0xb4fe47[_0x0014('0x64')])):path['join'](config[_0x0014('0x5b')],_0x3ee902,_[_0x0014('0x5c')]('default_favicon.ico'));var _0x516019=_0x0014('0x5e')+_['upperFirst'](_0x0014('0x64'));if(_0xb4fe47[_0x516019]||!_0x1644a7[_0x0014('0x60')]){_0x18f45a=path['join'](config[_0x0014('0x5b')],_0x3ee902,_['toLower']('default_favicon.ico'));}if(!fs[_0x0014('0x59')](_0x18f45a)){throw new db[(_0x0014('0x66'))][(_0x0014('0x61'))](_[_0x0014('0x5f')]('favicon')+_0x0014('0x62'));}return _0x17990a[_0x0014('0x67')](_0x18f45a);}})[_0x0014('0x22')](handleError(_0x17990a,null));};exports[_0x0014('0x6c')]=function(_0x54933e,_0x267725){var _0x1aedd1={'offset':moment()[_0x0014('0x6d')]()};_0x1aedd1[_0x0014('0x6e')]=moment()[_0x0014('0x6d')](_0x1aedd1[_0x0014('0x25')])['format'](_0x0014('0x6f'));return _0x267725['status'](0xc8)[_0x0014('0x70')](_0x1aedd1);};
\ No newline at end of file
index 603fdd8..f20ebce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x147e80,_0x508f0c){var _0x3a4f65=function(_0x48aa1d){while(--_0x48aa1d){_0x147e80['push'](_0x147e80['shift']());}};_0x3a4f65(++_0x508f0c);}(_0x34e8,0x12c));var _0x834e=function(_0x512771,_0x357ef7){_0x512771=_0x512771-0x0;var _0x4c43cb=_0x34e8[_0x512771];return _0x4c43cb;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x58f642,_0xf9049d){var _0x3b819e=function(_0x5c18da){while(--_0x5c18da){_0x58f642['push'](_0x58f642['shift']());}};_0x3b819e(++_0xf9049d);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d50a6,_0x2bd68b){_0x2d50a6=_0x2d50a6-0x0;var _0x11cd63=_0xedd9[_0x2d50a6];return _0x11cd63;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4c2018b..6d5101c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf75a=['info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSetting','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5abdbd,_0x5d47fd){var _0x1f3b0e=function(_0xdcff9c){while(--_0xdcff9c){_0x5abdbd['push'](_0x5abdbd['shift']());}};_0x1f3b0e(++_0x5d47fd);}(_0xf75a,0x152));var _0xaf75=function(_0x520db8,_0x4606b5){_0x520db8=_0x520db8-0x0;var _0x4e658b=_0xf75a[_0x520db8];return _0x4e658b;};'use strict';var _=require(_0xaf75('0x0'));var util=require(_0xaf75('0x1'));var moment=require(_0xaf75('0x2'));var BPromise=require(_0xaf75('0x3'));var rs=require(_0xaf75('0x4'));var fs=require('fs');var Redis=require(_0xaf75('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf75('0x6'));var logger=require(_0xaf75('0x7'))(_0xaf75('0x8'));var config=require(_0xaf75('0x9'));var jayson=require(_0xaf75('0xa'));var client=jayson['client'][_0xaf75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf5fb27,_0x28bba3,_0xdbe33f){return new BPromise(function(_0x1d8e62,_0x4fced2){return client[_0xaf75('0xc')](_0xf5fb27,_0xdbe33f)[_0xaf75('0xd')](function(_0x4632b1){logger[_0xaf75('0xe')](_0xaf75('0xf'),_0x28bba3,'request\x20sent');logger[_0xaf75('0x10')](_0xaf75('0x11'),_0x28bba3,_0xaf75('0x12'),JSON[_0xaf75('0x13')](_0x4632b1));if(_0x4632b1[_0xaf75('0x14')]){if(_0x4632b1[_0xaf75('0x14')][_0xaf75('0x15')]===0x1f4){logger[_0xaf75('0x14')](_0xaf75('0xf'),_0x28bba3,_0x4632b1[_0xaf75('0x14')][_0xaf75('0x16')]);return _0x4fced2(_0x4632b1[_0xaf75('0x14')][_0xaf75('0x16')]);}logger[_0xaf75('0x14')](_0xaf75('0xf'),_0x28bba3,_0x4632b1[_0xaf75('0x14')][_0xaf75('0x16')]);return _0x1d8e62(_0x4632b1['error'][_0xaf75('0x16')]);}else{logger[_0xaf75('0xe')](_0xaf75('0xf'),_0x28bba3,'request\x20sent');_0x1d8e62(_0x4632b1[_0xaf75('0x17')]['message']);}})['catch'](function(_0x38cfca){logger['error'](_0xaf75('0xf'),_0x28bba3,_0x38cfca);_0x4fced2(_0x38cfca);});});}exports[_0xaf75('0x18')]=function(_0x49727a){var _0xc44bee=this;return new Promise(function(_0x555b5e,_0x1f6b3f){return db['Setting'][_0xaf75('0x19')]({'raw':_0x49727a[_0xaf75('0x1a')]?_0x49727a[_0xaf75('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x49727a[_0xaf75('0x1a')]?_0x49727a[_0xaf75('0x1a')][_0xaf75('0x1b')]||null:null,'attributes':_0x49727a[_0xaf75('0x1a')]?_0x49727a[_0xaf75('0x1a')][_0xaf75('0x1c')]||null:null,'include':_0x49727a[_0xaf75('0x1a')]?_0x49727a[_0xaf75('0x1a')]['include']?_['map'](_0x49727a[_0xaf75('0x1a')]['include'],function(_0x488a77){return{'model':db[_0x488a77['model']],'as':_0x488a77['as'],'attributes':_0x488a77[_0xaf75('0x1c')],'include':_0x488a77[_0xaf75('0x1d')]?_[_0xaf75('0x1e')](_0x488a77['include'],function(_0x1f4968){return{'model':db[_0x1f4968[_0xaf75('0x1f')]],'as':_0x1f4968['as'],'attributes':_0x1f4968[_0xaf75('0x1c')],'include':_0x1f4968[_0xaf75('0x1d')]?_[_0xaf75('0x1e')](_0x1f4968[_0xaf75('0x1d')],function(_0xdfa068){return{'model':db[_0xdfa068[_0xaf75('0x1f')]],'as':_0xdfa068['as'],'attributes':_0xdfa068['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf75('0xd')](function(_0x10248a){logger[_0xaf75('0xe')](_0xaf75('0x18'),_0x49727a);logger['debug'](_0xaf75('0x18'),_0x49727a,JSON['stringify'](_0x10248a));_0x555b5e(_0x10248a);})['catch'](function(_0x43500a){logger[_0xaf75('0x14')](_0xaf75('0x18'),_0x43500a['message'],_0x49727a);_0x1f6b3f(_0xc44bee[_0xaf75('0x14')](0x1f4,_0x43500a['message']));});});};
\ No newline at end of file
+var _0x0273=['info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Setting','find','options','where','attributes','include','map','model','ShowSetting','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x40c76b,_0x2ff0a8){var _0x2156d6=function(_0x5ef89b){while(--_0x5ef89b){_0x40c76b['push'](_0x40c76b['shift']());}};_0x2156d6(++_0x2ff0a8);}(_0x0273,0x1d2));var _0x3027=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0273[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3027('0x0'));var util=require(_0x3027('0x1'));var moment=require(_0x3027('0x2'));var BPromise=require('bluebird');var rs=require(_0x3027('0x3'));var fs=require('fs');var Redis=require(_0x3027('0x4'));var db=require(_0x3027('0x5'))['db'];var utils=require(_0x3027('0x6'));var logger=require(_0x3027('0x7'))(_0x3027('0x8'));var config=require('../../config/environment');var jayson=require(_0x3027('0x9'));var client=jayson[_0x3027('0xa')][_0x3027('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17442b,_0x3f2bb1,_0x5f1bbc){return new BPromise(function(_0x113e60,_0x20f1e3){return client[_0x3027('0xc')](_0x17442b,_0x5f1bbc)[_0x3027('0xd')](function(_0x38b061){logger[_0x3027('0xe')](_0x3027('0xf'),_0x3f2bb1,_0x3027('0x10'));logger['debug'](_0x3027('0x11'),_0x3f2bb1,_0x3027('0x10'),JSON[_0x3027('0x12')](_0x38b061));if(_0x38b061[_0x3027('0x13')]){if(_0x38b061[_0x3027('0x13')]['code']===0x1f4){logger[_0x3027('0x13')](_0x3027('0xf'),_0x3f2bb1,_0x38b061[_0x3027('0x13')][_0x3027('0x14')]);return _0x20f1e3(_0x38b061['error'][_0x3027('0x14')]);}logger[_0x3027('0x13')](_0x3027('0xf'),_0x3f2bb1,_0x38b061[_0x3027('0x13')][_0x3027('0x14')]);return _0x113e60(_0x38b061['error'][_0x3027('0x14')]);}else{logger[_0x3027('0xe')](_0x3027('0xf'),_0x3f2bb1,_0x3027('0x10'));_0x113e60(_0x38b061[_0x3027('0x15')][_0x3027('0x14')]);}})['catch'](function(_0x3fe253){logger[_0x3027('0x13')]('Setting,\x20%s,\x20%s',_0x3f2bb1,_0x3fe253);_0x20f1e3(_0x3fe253);});});}exports['ShowSetting']=function(_0x2a5be8){var _0x103040=this;return new Promise(function(_0x55aa31,_0x2365fb){return db[_0x3027('0x16')][_0x3027('0x17')]({'raw':_0x2a5be8[_0x3027('0x18')]?_0x2a5be8[_0x3027('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2a5be8[_0x3027('0x18')]?_0x2a5be8['options'][_0x3027('0x19')]||null:null,'attributes':_0x2a5be8[_0x3027('0x18')]?_0x2a5be8[_0x3027('0x18')][_0x3027('0x1a')]||null:null,'include':_0x2a5be8[_0x3027('0x18')]?_0x2a5be8[_0x3027('0x18')][_0x3027('0x1b')]?_[_0x3027('0x1c')](_0x2a5be8['options']['include'],function(_0x5b6fab){return{'model':db[_0x5b6fab[_0x3027('0x1d')]],'as':_0x5b6fab['as'],'attributes':_0x5b6fab[_0x3027('0x1a')],'include':_0x5b6fab[_0x3027('0x1b')]?_['map'](_0x5b6fab[_0x3027('0x1b')],function(_0x538b37){return{'model':db[_0x538b37[_0x3027('0x1d')]],'as':_0x538b37['as'],'attributes':_0x538b37[_0x3027('0x1a')],'include':_0x538b37[_0x3027('0x1b')]?_[_0x3027('0x1c')](_0x538b37[_0x3027('0x1b')],function(_0x1c3538){return{'model':db[_0x1c3538['model']],'as':_0x1c3538['as'],'attributes':_0x1c3538[_0x3027('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3027('0xd')](function(_0x261b81){logger['info'](_0x3027('0x1e'),_0x2a5be8);logger['debug'](_0x3027('0x1e'),_0x2a5be8,JSON[_0x3027('0x12')](_0x261b81));_0x55aa31(_0x261b81);})[_0x3027('0x1f')](function(_0x55a1d6){logger[_0x3027('0x13')](_0x3027('0x1e'),_0x55a1d6[_0x3027('0x14')],_0x2a5be8);_0x2365fb(_0x103040[_0x3027('0x13')](0x1f4,_0x55a1d6[_0x3027('0x14')]));});});};
\ No newline at end of file
index cef910a..52dc617 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x38f38e,_0x13021c){var _0x4df845=function(_0x47aa2e){while(--_0x47aa2e){_0x38f38e['push'](_0x38f38e['shift']());}};_0x4df845(++_0x13021c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x23c2c3,_0x27ecc8){_0x23c2c3=_0x23c2c3-0x0;var _0x41e09f=_0x7fbe[_0x23c2c3];return _0x41e09f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x474681,_0x523bb5){var _0x543a51=function(_0x222802){while(--_0x222802){_0x474681['push'](_0x474681['shift']());}};_0x543a51(++_0x523bb5);}(_0x6aa7,0x178));var _0x76aa=function(_0x3aca34,_0x22c163){_0x3aca34=_0x3aca34-0x0;var _0x4184f2=_0x6aa7[_0x3aca34];return _0x4184f2;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router;
\ No newline at end of file
index bab28da..35fc0fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f2f=['connectel','plivo','csc','infobip','BOOLEAN','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','name','STRING','generate','twilio','skebby'];(function(_0x5b298f,_0x4f874a){var _0x3dc1bf=function(_0x4ff5d6){while(--_0x4ff5d6){_0x5b298f['push'](_0x5b298f['shift']());}};_0x3dc1bf(++_0x4f874a);}(_0x3f2f,0x12a));var _0xf3f2=function(_0x18c32c,_0x1c58aa){_0x18c32c=_0x18c32c-0x0;var _0x3a3c8e=_0x3f2f[_0x18c32c];return _0x3a3c8e;};'use strict';var Sequelize=require(_0xf3f2('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf3f2('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xf3f2('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xf3f2('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xf3f2('0x2')],'defaultValue':function(){return rs[_0xf3f2('0x3')]();}},'phone':{'type':Sequelize[_0xf3f2('0x2')]},'type':{'type':Sequelize['ENUM'](_0xf3f2('0x4'),_0xf3f2('0x5'),_0xf3f2('0x6'),'clicksend',_0xf3f2('0x7'),'clickatell','bandwidth',_0xf3f2('0x8'),_0xf3f2('0x9'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xf3f2('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xf3f2('0x2')]},'senderString':{'type':Sequelize[_0xf3f2('0x2')]},'deliveryReport':{'type':Sequelize[_0xf3f2('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0xf3f2('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf3f2('0xb');}},'notificationSound':{'type':Sequelize[_0xf3f2('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf3f2('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf3f2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf3f2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf3f2('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf3f2('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf3f2('0xc')],'comment':_0xf3f2('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xf3f2('0xa')],'defaultValue':![],'comment':_0xf3f2('0xe'),'set':function(_0x240f20){if(!_0x240f20)this['setDataValue'](_0xf3f2('0xf'),null);this['setDataValue']('mandatoryDisposition',_0x240f20);}}};
\ No newline at end of file
+var _0x2da3=['plivo','clickatell','bandwidth','infobip','ENUM','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name','STRING','skebby','connectel','clicksend'];(function(_0x202352,_0x2431b5){var _0x1e29fb=function(_0x17d69b){while(--_0x17d69b){_0x202352['push'](_0x202352['shift']());}};_0x1e29fb(++_0x2431b5);}(_0x2da3,0x1c2));var _0x32da=function(_0x303904,_0xb8759d){_0x303904=_0x303904-0x0;var _0x1e45f6=_0x2da3[_0x303904];return _0x1e45f6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x32da('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x32da('0x1'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x32da('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x32da('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0x32da('0x3'),_0x32da('0x4'),_0x32da('0x5'),_0x32da('0x6'),_0x32da('0x7'),_0x32da('0x8'),'csc',_0x32da('0x9'),'intelepeer')},'accountSid':{'type':Sequelize[_0x32da('0x2')]},'authId':{'type':Sequelize[_0x32da('0x2')]},'authToken':{'type':Sequelize[_0x32da('0x2')]},'smsMethod':{'type':Sequelize[_0x32da('0xa')]('SI','TI','GP')},'username':{'type':Sequelize[_0x32da('0x2')]},'password':{'type':Sequelize[_0x32da('0x2')]},'apiKey':{'type':Sequelize[_0x32da('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x32da('0x2')]},'senderString':{'type':Sequelize[_0x32da('0x2')]},'deliveryReport':{'type':Sequelize[_0x32da('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x32da('0x2')]},'notificationTemplate':{'type':Sequelize[_0x32da('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x32da('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x32da('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x32da('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x32da('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x32da('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x32da('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x32da('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x32da('0xd')],'comment':_0x32da('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x32da('0xb')],'defaultValue':![],'comment':_0x32da('0xf'),'set':function(_0x29c26a){if(!_0x29c26a)this[_0x32da('0x10')](_0x32da('0x11'),null);this[_0x32da('0x10')](_0x32da('0x12'),_0x29c26a);}}};
\ No newline at end of file
index 3943662..7bf7b96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['options','find','create','user','role','UserProfileSection','autoAssociation','body','describe','SmsAccountId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','getAnswers','hasOwnProperty','CannedAnswer','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','CompanyId','ListId','mobile','twilio','From','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','infobip','results','csc','originatingAddress','clickatell','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','created','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','Tag','Tags','color','to\x20is\x20mandatory','List','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif','update','error_code','RECEIVED_BY_RECIPIENT','bandwidth','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','addAgents','ids','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','status','json','undefined','offset','count','limit','set','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','SmsAccount','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','params','Pause','rawAttributes','keys','includeAll'];(function(_0x66094a,_0x3f5795){var _0xf8cf1d=function(_0x65c657){while(--_0x65c657){_0x66094a['push'](_0x66094a['shift']());}};_0xf8cf1d(++_0x3f5795);}(_0x4b84,0x168));var _0x44b8=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x4b84[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require(_0x44b8('0x2'));var jsonpatch=require(_0x44b8('0x3'));var rp=require(_0x44b8('0x4'));var moment=require('moment');var BPromise=require(_0x44b8('0x5'));var Mustache=require(_0x44b8('0x6'));var util=require('util');var path=require(_0x44b8('0x7'));var sox=require(_0x44b8('0x8'));var csv=require(_0x44b8('0x9'));var ejs=require(_0x44b8('0xa'));var fs=require('fs');var fs_extra=require(_0x44b8('0xb'));var _=require(_0x44b8('0xc'));var squel=require('squel');var crypto=require(_0x44b8('0xd'));var jsforce=require(_0x44b8('0xe'));var deskjs=require(_0x44b8('0xf'));var toCsv=require(_0x44b8('0x9'));var querystring=require(_0x44b8('0x10'));var Papa=require(_0x44b8('0x11'));var Redis=require('ioredis');var authService=require(_0x44b8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x44b8('0x13'));var hardwareService=require(_0x44b8('0x14'));var logger=require(_0x44b8('0x15'))(_0x44b8('0x16'));var utils=require(_0x44b8('0x17'));var config=require(_0x44b8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x19'))['db'];config['redis']=_[_0x44b8('0x1a')](config[_0x44b8('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x44b8('0x1c'))(new Redis(config[_0x44b8('0x1b')]));require(_0x44b8('0x1d'))['register'](socket);var jayson=require(_0x44b8('0x1e'));var client=jayson[_0x44b8('0x1f')][_0x44b8('0x20')]({'port':0x232c});function respondWithRpcPromise(_0xbbbde7,_0x24f706,_0x1cf637,_0x510f6a){return new BPromise(function(_0x5c3a48,_0x3192ba){var _0x4a094a=_0x510f6a||client;return _0x4a094a[_0x44b8('0x21')](_0xbbbde7,_0x1cf637)[_0x44b8('0x22')](function(_0x54327c){logger[_0x44b8('0x23')](_0x44b8('0x24'),_0x24f706,_0x44b8('0x25'));logger[_0x44b8('0x26')](_0x44b8('0x27'),_0x24f706,'request\x20sent',JSON[_0x44b8('0x28')](_0x54327c));if(_0x54327c['error']){if(_0x54327c['error'][_0x44b8('0x29')]===0x1f4){logger[_0x44b8('0x2a')](_0x44b8('0x24'),_0x24f706,_0x54327c[_0x44b8('0x2a')][_0x44b8('0x2b')]);return _0x3192ba(_0x54327c[_0x44b8('0x2a')]['message']);}logger[_0x44b8('0x2a')](_0x44b8('0x24'),_0x24f706,_0x54327c[_0x44b8('0x2a')][_0x44b8('0x2b')]);return _0x5c3a48(_0x54327c[_0x44b8('0x2a')][_0x44b8('0x2b')]);}else{logger[_0x44b8('0x23')](_0x44b8('0x24'),_0x24f706,_0x44b8('0x25'));_0x5c3a48(_0x54327c[_0x44b8('0x2c')][_0x44b8('0x2b')]);}})[_0x44b8('0x2d')](function(_0x26c7a9){logger['error'](_0x44b8('0x24'),_0x24f706,_0x26c7a9);_0x3192ba(_0x26c7a9);});});}function respondWithStatusCode(_0x400064,_0x44cf67){_0x44cf67=_0x44cf67||0xcc;return function(_0x5f1d71){if(_0x5f1d71){return _0x400064[_0x44b8('0x2e')](_0x44cf67);}return _0x400064['status'](_0x44cf67)[_0x44b8('0x2f')]();};}function respondWithResult(_0x5a41fe,_0x39118d){_0x39118d=_0x39118d||0xc8;return function(_0x1c82d9){if(_0x1c82d9){return _0x5a41fe[_0x44b8('0x30')](_0x39118d)[_0x44b8('0x31')](_0x1c82d9);}};}function respondWithFilteredResult(_0x41941e,_0x13495a){return function(_0x56e6ab){if(_0x56e6ab){var _0x99e824=typeof _0x13495a['offset']===_0x44b8('0x32')&&typeof _0x13495a['limit']===_0x44b8('0x32');var _0x47320f=_0x56e6ab['count'];var _0xac3380=_0x99e824?0x0:_0x13495a[_0x44b8('0x33')];var _0x296f25=_0x99e824?_0x56e6ab[_0x44b8('0x34')]:_0x13495a[_0x44b8('0x33')]+_0x13495a[_0x44b8('0x35')];var _0x39f75c;if(_0x296f25>=_0x47320f){_0x296f25=_0x47320f;_0x39f75c=0xc8;}else{_0x39f75c=0xce;}_0x41941e[_0x44b8('0x30')](_0x39f75c);return _0x41941e[_0x44b8('0x36')]('Content-Range',_0xac3380+'-'+_0x296f25+'/'+_0x47320f)['json'](_0x56e6ab);}return null;};}function patchUpdates(_0x5eef83){return function(_0x254ad0){try{jsonpatch[_0x44b8('0x37')](_0x254ad0,_0x5eef83,!![]);}catch(_0x3b3996){return BPromise[_0x44b8('0x38')](_0x3b3996);}return _0x254ad0[_0x44b8('0x39')]();};}function saveUpdates(_0x1ff8c0,_0x57627){return function(_0x125378){if(_0x125378){return _0x125378['update'](_0x1ff8c0)[_0x44b8('0x22')](function(_0x2441c7){return _0x2441c7;});}return null;};}function removeEntity(_0x4da03a,_0x220f5a){return function(_0x44ff96){if(_0x44ff96){return _0x44ff96[_0x44b8('0x3a')]()[_0x44b8('0x22')](function(){var _0x3c2f0c=_0x44ff96[_0x44b8('0x3b')]({'plain':!![]});var _0x1bbb7b=_0x44b8('0x3c');return db[_0x44b8('0x3d')][_0x44b8('0x3a')]({'where':{'type':_0x1bbb7b,'resourceId':_0x3c2f0c['id']}})['then'](function(){return _0x44ff96;});})['then'](function(){_0x4da03a[_0x44b8('0x30')](0xcc)[_0x44b8('0x2f')]();});}};}function handleEntityNotFound(_0x37b6bf,_0x587017){return function(_0x241732){if(!_0x241732){_0x37b6bf[_0x44b8('0x2e')](0x194);}return _0x241732;};}function handleError(_0x36d59e,_0x3a343e){_0x3a343e=_0x3a343e||0x1f4;return function(_0x23699d){logger[_0x44b8('0x2a')](_0x23699d[_0x44b8('0x3e')]);if(_0x23699d[_0x44b8('0x3f')]){delete _0x23699d[_0x44b8('0x3f')];}_0x36d59e[_0x44b8('0x30')](_0x3a343e)[_0x44b8('0x40')](_0x23699d);};}exports['index']=function(_0x1767f0,_0x5e31e4){var _0x49ee70={'include':[{'model':db['Pause'],'as':_0x44b8('0x41')}]},_0x46636b={},_0x53e792={'count':0x0,'rows':[]};var _0x22f7d8=_[_0x44b8('0x42')](db[_0x44b8('0x43')]['rawAttributes'],function(_0x2ab982){return{'name':_0x2ab982[_0x44b8('0x44')],'type':_0x2ab982[_0x44b8('0x45')]['key']};});_0x46636b[_0x44b8('0x46')]=_['map'](_0x22f7d8,_0x44b8('0x3f'));_0x46636b['query']=_['keys'](_0x1767f0[_0x44b8('0x47')]);_0x46636b[_0x44b8('0x48')]=_[_0x44b8('0x49')](_0x46636b[_0x44b8('0x46')],_0x46636b[_0x44b8('0x47')]);_0x49ee70[_0x44b8('0x4a')]=_['intersection'](_0x46636b[_0x44b8('0x46')],qs['fields'](_0x1767f0[_0x44b8('0x47')][_0x44b8('0x4b')]));_0x49ee70[_0x44b8('0x4a')]=_0x49ee70[_0x44b8('0x4a')][_0x44b8('0x4c')]?_0x49ee70[_0x44b8('0x4a')]:_0x46636b[_0x44b8('0x46')];if(!_0x1767f0[_0x44b8('0x47')]['hasOwnProperty'](_0x44b8('0x4d'))){_0x49ee70[_0x44b8('0x35')]=qs['limit'](_0x1767f0['query'][_0x44b8('0x35')]);_0x49ee70[_0x44b8('0x33')]=qs[_0x44b8('0x33')](_0x1767f0[_0x44b8('0x47')][_0x44b8('0x33')]);}_0x49ee70[_0x44b8('0x4e')]=qs['sort'](_0x1767f0[_0x44b8('0x47')][_0x44b8('0x4f')]);_0x49ee70[_0x44b8('0x50')]=qs['filters'](_[_0x44b8('0x51')](_0x1767f0['query'],_0x46636b[_0x44b8('0x48')]),_0x22f7d8);if(_0x1767f0[_0x44b8('0x47')][_0x44b8('0x52')]){_0x49ee70[_0x44b8('0x50')]=_['merge'](_0x49ee70[_0x44b8('0x50')],{'$or':_['map'](_0x22f7d8,function(_0xb66cd5){if(_0xb66cd5[_0x44b8('0x45')]!=='VIRTUAL'){var _0x470bc2={};_0x470bc2[_0xb66cd5[_0x44b8('0x3f')]]={'$like':'%'+_0x1767f0['query'][_0x44b8('0x52')]+'%'};return _0x470bc2;}})});}_0x49ee70=_[_0x44b8('0x53')]({},_0x49ee70,_0x1767f0['options']);var _0x588a24={'where':_0x49ee70['where']};return db[_0x44b8('0x43')][_0x44b8('0x34')](_0x588a24)[_0x44b8('0x22')](function(_0x40f93c){_0x53e792[_0x44b8('0x34')]=_0x40f93c;if(_0x1767f0[_0x44b8('0x47')]['includeAll']){_0x49ee70[_0x44b8('0x54')]=[{'all':!![]}];}return db[_0x44b8('0x43')][_0x44b8('0x55')](_0x49ee70);})['then'](function(_0x223404){_0x53e792[_0x44b8('0x56')]=_0x223404;return _0x53e792;})['then'](respondWithFilteredResult(_0x5e31e4,_0x49ee70))[_0x44b8('0x2d')](handleError(_0x5e31e4,null));};exports['show']=function(_0x3294b6,_0x3131ec){var _0x41c848={'raw':![],'where':{'id':_0x3294b6[_0x44b8('0x57')]['id']},'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x41')}]},_0x16a194={};_0x16a194['model']=_['keys'](db[_0x44b8('0x43')][_0x44b8('0x59')]);_0x16a194[_0x44b8('0x47')]=_[_0x44b8('0x5a')](_0x3294b6[_0x44b8('0x47')]);_0x16a194[_0x44b8('0x48')]=_[_0x44b8('0x49')](_0x16a194[_0x44b8('0x46')],_0x16a194['query']);_0x41c848[_0x44b8('0x4a')]=_[_0x44b8('0x49')](_0x16a194[_0x44b8('0x46')],qs['fields'](_0x3294b6[_0x44b8('0x47')][_0x44b8('0x4b')]));_0x41c848['attributes']=_0x41c848[_0x44b8('0x4a')]['length']?_0x41c848['attributes']:_0x16a194[_0x44b8('0x46')];if(_0x3294b6['query'][_0x44b8('0x5b')]){_0x41c848[_0x44b8('0x54')]=[{'all':!![]}];}_0x41c848=_['merge']({},_0x41c848,_0x3294b6[_0x44b8('0x5c')]);return db[_0x44b8('0x43')][_0x44b8('0x5d')](_0x41c848)['then'](handleEntityNotFound(_0x3131ec,null))[_0x44b8('0x22')](respondWithResult(_0x3131ec,null))[_0x44b8('0x2d')](handleError(_0x3131ec,null));};exports['create']=function(_0x466d91,_0x456a1c){return db[_0x44b8('0x43')][_0x44b8('0x5e')](_0x466d91['body'],{})[_0x44b8('0x22')](function(_0x2bc101){var _0x1ff8b3=_0x466d91[_0x44b8('0x5f')]['get']({'plain':!![]});if(!_0x1ff8b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ff8b3[_0x44b8('0x60')]==='user'){var _0x9dde70=_0x2bc101[_0x44b8('0x3b')]({'plain':!![]});var _0x2aa8f8='SmsAccounts';return db[_0x44b8('0x61')][_0x44b8('0x5d')]({'where':{'name':_0x2aa8f8,'userProfileId':_0x1ff8b3['userProfileId']},'raw':!![]})[_0x44b8('0x22')](function(_0x1545cc){if(_0x1545cc&&_0x1545cc[_0x44b8('0x62')]===0x0){return db[_0x44b8('0x3d')][_0x44b8('0x5e')]({'name':_0x9dde70[_0x44b8('0x3f')],'resourceId':_0x9dde70['id'],'type':_0x1545cc['name'],'sectionId':_0x1545cc['id']},{})[_0x44b8('0x22')](function(){return _0x2bc101;});}else{return _0x2bc101;}})[_0x44b8('0x2d')](function(_0x10386c){logger[_0x44b8('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10386c);throw _0x10386c;});}return _0x2bc101;})[_0x44b8('0x22')](respondWithResult(_0x456a1c,0xc9))['catch'](handleError(_0x456a1c,null));};exports['update']=function(_0x4091fa,_0x12a7fb){if(_0x4091fa[_0x44b8('0x63')]['id']){delete _0x4091fa[_0x44b8('0x63')]['id'];}return db[_0x44b8('0x43')][_0x44b8('0x5d')]({'where':{'id':_0x4091fa[_0x44b8('0x57')]['id']},'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x41')}]})['then'](handleEntityNotFound(_0x12a7fb,null))[_0x44b8('0x22')](saveUpdates(_0x4091fa[_0x44b8('0x63')],null))[_0x44b8('0x22')](respondWithResult(_0x12a7fb,null))[_0x44b8('0x2d')](handleError(_0x12a7fb,null));};exports[_0x44b8('0x3a')]=function(_0x12b65d,_0x2f2d7b){return db['SmsAccount'][_0x44b8('0x5d')]({'where':{'id':_0x12b65d['params']['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x2f2d7b,null))['then'](removeEntity(_0x2f2d7b,null))['catch'](handleError(_0x2f2d7b,null));};exports[_0x44b8('0x64')]=function(_0x301244,_0x14405b){return db[_0x44b8('0x43')][_0x44b8('0x64')]()[_0x44b8('0x22')](respondWithResult(_0x14405b,null))[_0x44b8('0x2d')](handleError(_0x14405b,null));};exports['addDisposition']=function(_0x179330,_0x504b67,_0x3b8394){if(_0x179330[_0x44b8('0x63')]['id']){delete _0x179330[_0x44b8('0x63')]['id'];}return db[_0x44b8('0x43')][_0x44b8('0x5d')]({'where':{'id':_0x179330[_0x44b8('0x57')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x504b67,null))[_0x44b8('0x22')](function(_0x18c3c0){if(_0x18c3c0){_0x179330[_0x44b8('0x63')][_0x44b8('0x65')]=_0x18c3c0['id'];return db['Disposition'][_0x44b8('0x5e')](_0x179330[_0x44b8('0x63')]);}})[_0x44b8('0x22')](respondWithResult(_0x504b67,null))[_0x44b8('0x2d')](handleError(_0x504b67,null));};exports[_0x44b8('0x66')]=function(_0x2add2e,_0x4a0374,_0x55d0b0){var _0x3d068d={'raw':![],'where':{}};var _0x28f687={};var _0x220792={'count':0x0,'rows':[]};return db[_0x44b8('0x43')][_0x44b8('0x67')]({'where':{'id':_0x2add2e[_0x44b8('0x57')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x4a0374,null))['then'](function(_0x5b3b8a){if(_0x5b3b8a){_0x28f687[_0x44b8('0x46')]=_[_0x44b8('0x5a')](db['Disposition']['rawAttributes']);_0x28f687[_0x44b8('0x47')]=_['keys'](_0x2add2e['query']);_0x28f687[_0x44b8('0x48')]=_['intersection'](_0x28f687[_0x44b8('0x46')],_0x28f687[_0x44b8('0x47')]);_0x3d068d[_0x44b8('0x4a')]=_['intersection'](_0x28f687['model'],qs[_0x44b8('0x4b')](_0x2add2e[_0x44b8('0x47')][_0x44b8('0x4b')]));_0x3d068d[_0x44b8('0x4a')]=_0x3d068d[_0x44b8('0x4a')][_0x44b8('0x4c')]?_0x3d068d[_0x44b8('0x4a')]:_0x28f687[_0x44b8('0x46')];if(!_0x2add2e['query']['hasOwnProperty'](_0x44b8('0x4d'))){_0x3d068d[_0x44b8('0x35')]=qs[_0x44b8('0x35')](_0x2add2e[_0x44b8('0x47')][_0x44b8('0x35')]);_0x3d068d[_0x44b8('0x33')]=qs['offset'](_0x2add2e[_0x44b8('0x47')]['offset']);}_0x3d068d[_0x44b8('0x4e')]=qs[_0x44b8('0x4f')](_0x2add2e[_0x44b8('0x47')]['sort']);_0x3d068d['where']=qs[_0x44b8('0x48')](_[_0x44b8('0x51')](_0x2add2e['query'],_0x28f687['filters']));_0x3d068d[_0x44b8('0x50')]['SmsAccountId']=_0x5b3b8a['id'];if(_0x2add2e['query'][_0x44b8('0x52')]){_0x3d068d[_0x44b8('0x50')]=_[_0x44b8('0x53')](_0x3d068d['where'],{'$or':_[_0x44b8('0x42')](_0x3d068d[_0x44b8('0x4a')],function(_0x5428c6){var _0x221ffa={};_0x221ffa[_0x5428c6]={'$like':'%'+_0x2add2e['query']['filter']+'%'};return _0x221ffa;})});}_0x3d068d=_['merge']({},_0x3d068d,_0x2add2e[_0x44b8('0x5c')]);return db[_0x44b8('0x68')][_0x44b8('0x34')]({'where':_0x3d068d[_0x44b8('0x50')]})[_0x44b8('0x22')](function(_0x566dcf){_0x220792['count']=_0x566dcf;if(_0x2add2e[_0x44b8('0x47')][_0x44b8('0x5b')]){_0x3d068d['include']=[{'all':!![]}];}return db[_0x44b8('0x68')][_0x44b8('0x55')](_0x3d068d);})['then'](function(_0x36d067){_0x220792[_0x44b8('0x56')]=_0x36d067;return _0x220792;});}})['then'](respondWithFilteredResult(_0x4a0374,_0x3d068d))[_0x44b8('0x2d')](handleError(_0x4a0374,null));};exports[_0x44b8('0x69')]=function(_0x17c10b,_0x58d748,_0x32ce69){return db['SmsAccount']['find']({'where':{'id':_0x17c10b[_0x44b8('0x57')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x58d748,null))[_0x44b8('0x22')](function(_0x39c2a0){if(_0x39c2a0){return _0x39c2a0['removeDispositions'](_0x17c10b[_0x44b8('0x47')]['ids']);}})[_0x44b8('0x22')](respondWithStatusCode(_0x58d748,null))[_0x44b8('0x2d')](handleError(_0x58d748,null));};exports[_0x44b8('0x6a')]=function(_0x422032,_0x467165,_0x451cbe){if(_0x422032[_0x44b8('0x63')]['id']){delete _0x422032[_0x44b8('0x63')]['id'];}return db['SmsAccount'][_0x44b8('0x5d')]({'where':{'id':_0x422032[_0x44b8('0x57')]['id']}})['then'](handleEntityNotFound(_0x467165,null))['then'](function(_0x4d895d){if(_0x4d895d){_0x422032[_0x44b8('0x63')][_0x44b8('0x65')]=_0x4d895d['id'];return db['CannedAnswer']['create'](_0x422032[_0x44b8('0x63')]);}})['then'](respondWithResult(_0x467165,null))['catch'](handleError(_0x467165,null));};exports[_0x44b8('0x6b')]=function(_0x45f0ea,_0x948f6d,_0x475f24){var _0x2fe6a2={'raw':![],'where':{}};var _0x4d016b={};var _0x166f85={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x45f0ea[_0x44b8('0x57')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x948f6d,null))[_0x44b8('0x22')](function(_0x4d4cff){if(_0x4d4cff){_0x4d016b[_0x44b8('0x46')]=_[_0x44b8('0x5a')](db['CannedAnswer'][_0x44b8('0x59')]);_0x4d016b[_0x44b8('0x47')]=_[_0x44b8('0x5a')](_0x45f0ea[_0x44b8('0x47')]);_0x4d016b[_0x44b8('0x48')]=_['intersection'](_0x4d016b[_0x44b8('0x46')],_0x4d016b[_0x44b8('0x47')]);_0x2fe6a2[_0x44b8('0x4a')]=_['intersection'](_0x4d016b['model'],qs[_0x44b8('0x4b')](_0x45f0ea[_0x44b8('0x47')][_0x44b8('0x4b')]));_0x2fe6a2['attributes']=_0x2fe6a2[_0x44b8('0x4a')]['length']?_0x2fe6a2[_0x44b8('0x4a')]:_0x4d016b[_0x44b8('0x46')];if(!_0x45f0ea['query'][_0x44b8('0x6c')](_0x44b8('0x4d'))){_0x2fe6a2['limit']=qs[_0x44b8('0x35')](_0x45f0ea[_0x44b8('0x47')]['limit']);_0x2fe6a2['offset']=qs[_0x44b8('0x33')](_0x45f0ea[_0x44b8('0x47')][_0x44b8('0x33')]);}_0x2fe6a2[_0x44b8('0x4e')]=qs[_0x44b8('0x4f')](_0x45f0ea[_0x44b8('0x47')][_0x44b8('0x4f')]);_0x2fe6a2[_0x44b8('0x50')]=qs[_0x44b8('0x48')](_[_0x44b8('0x51')](_0x45f0ea[_0x44b8('0x47')],_0x4d016b[_0x44b8('0x48')]));_0x2fe6a2[_0x44b8('0x50')][_0x44b8('0x65')]=_0x4d4cff['id'];if(_0x45f0ea[_0x44b8('0x47')][_0x44b8('0x52')]){_0x2fe6a2[_0x44b8('0x50')]=_[_0x44b8('0x53')](_0x2fe6a2[_0x44b8('0x50')],{'$or':_[_0x44b8('0x42')](_0x2fe6a2[_0x44b8('0x4a')],function(_0xb94c0d){var _0x2e6a5a={};_0x2e6a5a[_0xb94c0d]={'$like':'%'+_0x45f0ea[_0x44b8('0x47')][_0x44b8('0x52')]+'%'};return _0x2e6a5a;})});}_0x2fe6a2=_[_0x44b8('0x53')]({},_0x2fe6a2,_0x45f0ea[_0x44b8('0x5c')]);return db[_0x44b8('0x6d')]['count']({'where':_0x2fe6a2[_0x44b8('0x50')]})[_0x44b8('0x22')](function(_0x549b8b){_0x166f85['count']=_0x549b8b;if(_0x45f0ea[_0x44b8('0x47')][_0x44b8('0x5b')]){_0x2fe6a2[_0x44b8('0x54')]=[{'all':!![]}];}return db[_0x44b8('0x6d')][_0x44b8('0x55')](_0x2fe6a2);})[_0x44b8('0x22')](function(_0x5924e7){_0x166f85[_0x44b8('0x56')]=_0x5924e7;return _0x166f85;});}})['then'](respondWithFilteredResult(_0x948f6d,_0x2fe6a2))[_0x44b8('0x2d')](handleError(_0x948f6d,null));};exports[_0x44b8('0x6e')]=function(_0x1702b0,_0x3bd193,_0x4028fe){return db[_0x44b8('0x43')][_0x44b8('0x5d')]({'where':{'id':_0x1702b0[_0x44b8('0x57')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x3bd193,null))['then'](function(_0x144975){if(_0x144975){return _0x144975['removeAnswers'](_0x1702b0[_0x44b8('0x47')]['ids']);}})[_0x44b8('0x22')](respondWithStatusCode(_0x3bd193,null))['catch'](handleError(_0x3bd193,null));};exports['notify']=function(_0x3f4b10,_0x239025,_0x450405){var _0x5cdb7a={'channel':_0x44b8('0x6f')};var _0x2b7e48=[];var _0x1152ce=[];var _0x491f78={};return db[_0x44b8('0x43')]['find']({'where':{'id':_0x3f4b10[_0x44b8('0x57')]['id']},'include':[{'model':db[_0x44b8('0x70')],'as':_0x44b8('0x71')}]})[_0x44b8('0x22')](handleEntityNotFound(_0x239025,null))[_0x44b8('0x22')](function(_0x4a21f6){_0x5cdb7a[_0x44b8('0x72')]=_0x4a21f6;_0x5cdb7a[_0x44b8('0x73')]=_[_0x44b8('0x74')](_0x4a21f6['Applications'],['priority'],[_0x44b8('0x75')]);if(_0x5cdb7a[_0x44b8('0x72')][_0x44b8('0x71')]){delete _0x5cdb7a[_0x44b8('0x72')][_0x44b8('0x71')];}return db[_0x44b8('0x76')][_0x44b8('0x64')]();})['then'](function(_0x30293d){if(!_0x30293d){throw new db[(_0x44b8('0x77'))][(_0x44b8('0x78'))]('no\x20available\x20attributes');}_0x2b7e48=_['difference'](_[_0x44b8('0x5a')](_0x30293d),['createdAt','updatedAt']);_0x1152ce=_[_0x44b8('0x79')](_[_0x44b8('0x5a')](_0x30293d),['createdAt',_0x44b8('0x7a'),_0x44b8('0x7b'),_0x44b8('0x7c')]);_0x5cdb7a['body']={'mapKey':_0x44b8('0x7d')};if(_0x5cdb7a['account'][_0x44b8('0x45')]){switch(_0x5cdb7a[_0x44b8('0x72')][_0x44b8('0x45')]){case _0x44b8('0x7e'):_0x5cdb7a['body']['from']=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x7f')];_0x5cdb7a['body'][_0x44b8('0x63')]=_0x3f4b10['body']['Body'];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x80')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x81')];break;case _0x44b8('0x82'):_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')]='+'+_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x84')];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x85')];break;case _0x44b8('0x86'):_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x83')];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x2b')];break;case _0x44b8('0x87'):_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x83')];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x63')];_0x5cdb7a['body'][_0x44b8('0x80')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x88')];break;case _0x44b8('0x89'):_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x7f')];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x8a')];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x80')]=_0x3f4b10['body']['MessageUUID'];break;case _0x44b8('0x8b'):_0x5cdb7a['body'][_0x44b8('0x83')]='+'+_0x3f4b10['body']['results'][0x0][_0x44b8('0x83')];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x8c')][0x0][_0x44b8('0x85')];_0x5cdb7a['body']['messageId']=_0x3f4b10['body'][_0x44b8('0x8c')][0x0][_0x44b8('0x80')];break;case _0x44b8('0x8d'):_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')]=_0x3f4b10['body'][_0x44b8('0x8e')];_0x5cdb7a[_0x44b8('0x63')]['body']=_0x3f4b10['body']['segmentedMessage'][_0x44b8('0x2b')];break;case _0x44b8('0x8f'):_0x5cdb7a[_0x44b8('0x63')]['from']=_0x3f4b10[_0x44b8('0x63')]['fromNumber'];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x85')];_0x5cdb7a[_0x44b8('0x63')]['messageId']=_0x3f4b10[_0x44b8('0x63')]['replyMessageId'];break;case'bandwidth':_0x5cdb7a['body']['messageId']=_0x3f4b10[_0x44b8('0x63')][0x0][_0x44b8('0x2b')]['id'];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')]=_0x3f4b10[_0x44b8('0x63')][0x0]['message'][_0x44b8('0x83')];_0x5cdb7a[_0x44b8('0x63')]['body']=_0x3f4b10['body'][0x0][_0x44b8('0x2b')][_0x44b8('0x85')];break;case _0x44b8('0x90'):_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')]=_0x3f4b10[_0x44b8('0x63')]['from'];_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')]=_0x3f4b10['body'][_0x44b8('0x2b')];_0x5cdb7a['body'][_0x44b8('0x80')]=_0x3f4b10[_0x44b8('0x63')][_0x44b8('0x91')];break;}}if(_0x5cdb7a['body']['id']){delete _0x5cdb7a[_0x44b8('0x63')]['id'];}if(_[_0x44b8('0x92')](_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')])){throw new db[(_0x44b8('0x77'))][(_0x44b8('0x78'))](_0x44b8('0x93'));}if(_[_0x44b8('0x92')](_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')])||_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')]===''){throw new db[(_0x44b8('0x77'))]['ValidationError'](_0x44b8('0x94'));}if(_[_0x44b8('0x92')](_0x5cdb7a['body'][_0x44b8('0x95')])){throw new db[(_0x44b8('0x77'))]['ValidationError'](_0x44b8('0x96')+_0x1152ce);}if(!_[_0x44b8('0x97')](_0x1152ce,_0x5cdb7a['body'][_0x44b8('0x95')])){throw new db[(_0x44b8('0x77'))][(_0x44b8('0x78'))](_0x44b8('0x98')+_0x1152ce);}_0x491f78[_0x5cdb7a['body'][_0x44b8('0x95')]]=_0x5cdb7a['body']['from'];return db[_0x44b8('0x99')][_0x44b8('0x5d')]({'where':{'id':_0x5cdb7a['account'][_0x44b8('0x7c')]},'include':[{'model':db[_0x44b8('0x76')],'as':_0x44b8('0x9a'),'where':_0x491f78,'limit':0x1,'order':[[_0x44b8('0x7a'),_0x44b8('0x9b')]]}]});})['then'](handleEntityNotFound(_0x239025,null))[_0x44b8('0x22')](function(_0x50f658){if(_0x50f658){_0x5cdb7a[_0x44b8('0x9c')]=_[_0x44b8('0x9d')](_0x50f658,[_0x44b8('0x9a')]);if(_0x50f658[_0x44b8('0x9a')][_0x44b8('0x4c')]){return _0x50f658[_0x44b8('0x9a')][0x0];}var _0x39f0ac=_[_0x44b8('0x1a')](_0x5cdb7a[_0x44b8('0x63')],{'firstName':_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')],'ListId':_0x50f658['id']});_0x39f0ac[_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x95')]]=_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')];return db[_0x44b8('0x76')]['create'](_0x39f0ac,{'fields':_0x2b7e48,'raw':!![]});}})[_0x44b8('0x22')](handleEntityNotFound(_0x239025,null))['then'](function(_0x353ac8){if(_0x353ac8){_0x5cdb7a[_0x44b8('0x9e')]=_0x353ac8;var _0x43fba7={'ContactId':_0x353ac8['id'],'phone':_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')],'SmsAccountId':_0x3f4b10[_0x44b8('0x57')]['id']};var _0xdc877d={'ContactId':_0x353ac8['id'],'SmsAccountId':_0x3f4b10[_0x44b8('0x57')]['id'],'closed':![]};return db['SmsInteraction'][_0x44b8('0x5d')]({'where':_0xdc877d})[_0x44b8('0x22')](function(_0x19e46b){if(_0x19e46b){return[_0x19e46b,![]];}return db[_0x44b8('0x9f')]['create'](_0x43fba7)[_0x44b8('0x22')](function(_0x40bc49){return[_0x40bc49,!![]];});});}})[_0x44b8('0xa0')](function(_0x564af3,_0x10a84e){_0x5cdb7a['interaction']=_0x564af3[_0x44b8('0x3b')]({'plain':!![]});_0x5cdb7a[_0x44b8('0xa1')]['created']=![];if(_0x10a84e){if(_0x5cdb7a['account'][_0x44b8('0xa2')]){_0x5cdb7a['applications'][_0x44b8('0xa3')]({'id':0x0,'priority':_0x5cdb7a[_0x44b8('0x73')]['length']+0x1,'app':_0x44b8('0xa4'),'appdata':_0x44b8('0xa5'),'interval':'*,*,*,*'});}_0x5cdb7a[_0x44b8('0xa1')][_0x44b8('0xa6')]=!![];}return db[_0x44b8('0xa7')][_0x44b8('0x5e')]({'phone':_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x83')],'messageId':_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x80')],'body':_0x5cdb7a[_0x44b8('0x63')][_0x44b8('0x63')],'SmsAccountId':_0x3f4b10[_0x44b8('0x57')]['id'],'SmsInteractionId':_0x564af3['id'],'direction':'in','ContactId':_0x564af3[_0x44b8('0xa8')],'AttachmentId':_0x5cdb7a[_0x44b8('0x63')]['AttachmentId']});})[_0x44b8('0x22')](function(_0x1f8993){_0x5cdb7a[_0x44b8('0x2b')]=_0x1f8993;if(_0x5cdb7a[_0x44b8('0xa1')][_0x44b8('0xa9')]){return db[_0x44b8('0xaa')]['find']({'attributes':['id',_0x44b8('0x3f')],'where':{'id':_0x5cdb7a['interaction'][_0x44b8('0xa9')]}})[_0x44b8('0x22')](function(_0x1724d7){if(_0x1724d7){_0x5cdb7a[_0x44b8('0x73')][_0x44b8('0xab')]({'id':0x0,'priority':0x0,'app':_0x44b8('0xac'),'appdata':_0x1724d7[_0x44b8('0x3f')]+','+(_0x5cdb7a[_0x44b8('0x72')][_0x44b8('0xad')]||0xa),'interval':_0x44b8('0xae')});}return respondWithRpcPromise('Start',_0x44b8('0xaf'),_0x5cdb7a);});}return respondWithRpcPromise(_0x44b8('0xb0'),_0x44b8('0xaf'),_0x5cdb7a);})[_0x44b8('0x22')](function(_0x526d07){if(_0x526d07){var _0x34a108=0xc8;var _0xafa36f=_0x44b8('0xb1');logger[_0x44b8('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xafa36f,_0x34a108,'entity\x20found');logger[_0x44b8('0x26')](_0x44b8('0xb2'),_0xafa36f,_0x34a108,'entity\x20found',JSON['stringify'](_0x526d07));if(_0x5cdb7a[_0x44b8('0x72')][_0x44b8('0x45')]===_0x44b8('0x7e')){return _0x239025[_0x44b8('0x30')](_0x34a108)[_0x44b8('0x36')](_0x44b8('0xb3'),_0x44b8('0xb4'))['send'](_0x44b8('0xb5'));}else{return _0x239025[_0x44b8('0x30')](_0x34a108)['json'](_0x526d07);}}})[_0x44b8('0x2d')](handleError(_0x239025,null));};exports[_0x44b8('0xb6')]=function(_0x1f39f0,_0x14d79f){var _0x414c20=_0x1f39f0['params']['id'];var _0x393eb5=_0x1f39f0['body'];var _0x3a44ea=0xc8;var _0x552768=null;return db[_0x44b8('0xb7')][_0x44b8('0xb8')]({'isolationLevel':db['sequelize'][_0x44b8('0xb9')][_0x44b8('0xba')][_0x44b8('0xbb')]},function(_0x22c0eb){return db['SmsAccount']['findOne']({'where':{'id':_0x414c20},'transaction':_0x22c0eb})['then'](function(_0x13af93){if(_0x13af93){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x414c20},'transaction':_0x22c0eb})[_0x44b8('0x22')](function(){var _0xdb930c=_[_0x44b8('0x42')](_0x393eb5,function(_0x2f38bb){_0x2f38bb[_0x44b8('0x65')]=_0x414c20;return _0x2f38bb;});return db[_0x44b8('0x70')][_0x44b8('0xbc')](_0xdb930c,{'transaction':_0x22c0eb});});}else{_0x3a44ea=0x194;_0x552768=[];}});})['then'](function(){if(_0x3a44ea!==0x194){return db[_0x44b8('0x70')][_0x44b8('0xbd')]({'where':{'SmsAccountId':_0x414c20},'order':'priority'})['then'](function(_0x1643d7){_0x552768=_0x1643d7;});}})[_0x44b8('0x2d')](function(_0x1de8b0){_0x3a44ea=0x1f4;logger[_0x44b8('0x2a')](_0x1de8b0[_0x44b8('0x3e')]);if(_0x1de8b0[_0x44b8('0x3f')]){delete _0x1de8b0['name'];}_0x552768=_0x1de8b0;})[_0x44b8('0xbe')](function(){if(_0x552768===null){_0x14d79f[_0x44b8('0x2e')](_0x3a44ea);}else{if(_0x3a44ea===0x1f4){_0x14d79f[_0x44b8('0x30')](_0x3a44ea)[_0x44b8('0x40')](_0x552768);}else{_0x14d79f[_0x44b8('0x30')](_0x3a44ea)[_0x44b8('0x31')](_0x552768);}}});};exports[_0x44b8('0xbf')]=function(_0x3e1507,_0x1bf536,_0x364887){var _0x4b4ec8={};var _0x2ee735={};var _0x571604;var _0x74dbcc;return db[_0x44b8('0x43')][_0x44b8('0x67')]({'where':{'id':_0x3e1507[_0x44b8('0x57')]['id']}})['then'](handleEntityNotFound(_0x1bf536,null))[_0x44b8('0x22')](function(_0x394a70){if(_0x394a70){_0x571604=_0x394a70;_0x2ee735['model']=_[_0x44b8('0x5a')](db['SmsApplication'][_0x44b8('0x59')]);_0x2ee735[_0x44b8('0x47')]=_[_0x44b8('0x5a')](_0x3e1507[_0x44b8('0x47')]);_0x2ee735[_0x44b8('0x48')]=_[_0x44b8('0x49')](_0x2ee735[_0x44b8('0x46')],_0x2ee735['query']);_0x4b4ec8[_0x44b8('0x4a')]=_[_0x44b8('0x49')](_0x2ee735[_0x44b8('0x46')],qs[_0x44b8('0x4b')](_0x3e1507['query'][_0x44b8('0x4b')]));_0x4b4ec8[_0x44b8('0x4a')]=_0x4b4ec8[_0x44b8('0x4a')][_0x44b8('0x4c')]?_0x4b4ec8['attributes']:_0x2ee735[_0x44b8('0x46')];_0x4b4ec8[_0x44b8('0x4e')]=qs[_0x44b8('0x4f')](_0x3e1507[_0x44b8('0x47')][_0x44b8('0x4f')]);_0x4b4ec8[_0x44b8('0x50')]=qs[_0x44b8('0x48')](_['pick'](_0x3e1507[_0x44b8('0x47')],_0x2ee735['filters']));if(_0x3e1507['query']['filter']){_0x4b4ec8[_0x44b8('0x50')]=_[_0x44b8('0x53')](_0x4b4ec8[_0x44b8('0x50')],{'$or':_['map'](_0x4b4ec8[_0x44b8('0x4a')],function(_0x42dd19){var _0x48ac1c={};_0x48ac1c[_0x42dd19]={'$like':'%'+_0x3e1507['query'][_0x44b8('0x52')]+'%'};return _0x48ac1c;})});}_0x4b4ec8=_[_0x44b8('0x53')]({},_0x4b4ec8,_0x3e1507[_0x44b8('0x5c')]);return _0x571604[_0x44b8('0xbf')](_0x4b4ec8);}})[_0x44b8('0x22')](function(_0x24c9eb){if(_0x24c9eb){_0x74dbcc=_0x24c9eb[_0x44b8('0x4c')];if(!_0x3e1507[_0x44b8('0x47')][_0x44b8('0x6c')]('nolimit')){_0x4b4ec8[_0x44b8('0x35')]=qs[_0x44b8('0x35')](_0x3e1507['query'][_0x44b8('0x35')]);_0x4b4ec8['offset']=qs[_0x44b8('0x33')](_0x3e1507[_0x44b8('0x47')][_0x44b8('0x33')]);}return _0x571604[_0x44b8('0xbf')](_0x4b4ec8);}})[_0x44b8('0x22')](function(_0x3084c6){if(_0x3084c6){return _0x3084c6?{'count':_0x74dbcc,'rows':_0x3084c6}:null;}})[_0x44b8('0x22')](respondWithResult(_0x1bf536,null))[_0x44b8('0x2d')](handleError(_0x1bf536,null));};exports[_0x44b8('0xc0')]=function(_0x113ac6,_0x16fe4b,_0x1bdc87){var _0x443083={'raw':![],'where':{}};var _0x226d86={};var _0xe5ab2d={'count':0x0,'rows':[]};return db[_0x44b8('0x43')][_0x44b8('0x67')]({'where':{'id':_0x113ac6[_0x44b8('0x57')]['id']}})['then'](handleEntityNotFound(_0x16fe4b,null))[_0x44b8('0x22')](function(_0x362615){if(_0x362615){_0x226d86[_0x44b8('0x46')]=_[_0x44b8('0x5a')](db['SmsInteraction'][_0x44b8('0x59')]);_0x226d86[_0x44b8('0x47')]=_[_0x44b8('0x5a')](_0x113ac6['query']);_0x226d86['filters']=_[_0x44b8('0x49')](_0x226d86[_0x44b8('0x46')],_0x226d86[_0x44b8('0x47')]);_0x443083[_0x44b8('0x4a')]=_['intersection'](_0x226d86[_0x44b8('0x46')],qs['fields'](_0x113ac6[_0x44b8('0x47')][_0x44b8('0x4b')]));_0x443083['attributes']=_0x443083[_0x44b8('0x4a')][_0x44b8('0x4c')]?_0x443083[_0x44b8('0x4a')]:_0x226d86['model'];if(!_0x113ac6[_0x44b8('0x47')][_0x44b8('0x6c')](_0x44b8('0x4d'))){_0x443083['limit']=qs['limit'](_0x113ac6[_0x44b8('0x47')][_0x44b8('0x35')]);_0x443083[_0x44b8('0x33')]=qs[_0x44b8('0x33')](_0x113ac6[_0x44b8('0x47')][_0x44b8('0x33')]);}_0x443083['order']=qs[_0x44b8('0x4f')](_0x113ac6[_0x44b8('0x47')][_0x44b8('0x4f')]);_0x443083[_0x44b8('0x50')]=qs[_0x44b8('0x48')](_[_0x44b8('0x51')](_0x113ac6[_0x44b8('0x47')],_0x226d86[_0x44b8('0x48')]));_0x443083[_0x44b8('0x50')][_0x44b8('0x65')]=_0x362615['id'];if(_0x113ac6[_0x44b8('0x47')][_0x44b8('0x52')]){_0x443083[_0x44b8('0x50')]=_[_0x44b8('0x53')](_0x443083[_0x44b8('0x50')],{'$or':_[_0x44b8('0x42')](_0x443083[_0x44b8('0x4a')],function(_0x49484c){var _0xffc6a4={};_0xffc6a4[_0x49484c]={'$like':'%'+_0x113ac6['query']['filter']+'%'};return _0xffc6a4;})});}_0x443083=_[_0x44b8('0x53')]({},_0x443083,_0x113ac6['options']);return db['SmsInteraction'][_0x44b8('0x34')]({'where':_0x443083[_0x44b8('0x50')]})['then'](function(_0x4a8cb6){_0xe5ab2d[_0x44b8('0x34')]=_0x4a8cb6;if(_0x113ac6[_0x44b8('0x47')][_0x44b8('0x5b')]){_0x443083['include']=[{'model':db['CmContact'],'as':_0x44b8('0xc1'),'required':![]},{'model':db[_0x44b8('0xaa')],'as':'Owner','attributes':[_0x44b8('0x3f'),_0x44b8('0xc2'),'internal'],'required':![]},{'model':db[_0x44b8('0xc3')],'as':_0x44b8('0xc4'),'attributes':['id',_0x44b8('0x3f'),_0x44b8('0xc5')],'where':_0x113ac6[_0x44b8('0x47')]['tag']?{'id':_0x113ac6['query']['tag']}:undefined,'required':_0x113ac6[_0x44b8('0x47')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x44b8('0x55')](_0x443083);})[_0x44b8('0x22')](function(_0x245240){_0xe5ab2d['rows']=_0x245240;return _0xe5ab2d;});}})[_0x44b8('0x22')](respondWithFilteredResult(_0x16fe4b,_0x443083))['catch'](handleError(_0x16fe4b,null));};exports[_0x44b8('0x40')]=function(_0x3d8751,_0x1a13d6,_0x316f9a){var _0x4f513f,_0x56db8e,_0x8ad020;if(_[_0x44b8('0x92')](_0x3d8751['body'][_0x44b8('0x63')])||_0x3d8751['body'][_0x44b8('0x63')]===''){throw new db[(_0x44b8('0x77'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x44b8('0x92')](_0x3d8751[_0x44b8('0x63')]['to'])){throw new db[(_0x44b8('0x77'))][(_0x44b8('0x78'))](_0x44b8('0xc6'));}_0x4f513f=_0x3d8751[_0x44b8('0x63')]['to'];return db[_0x44b8('0x43')]['find']({'where':{'id':_0x3d8751[_0x44b8('0x57')]['id']},'include':[{'model':db[_0x44b8('0x99')],'as':_0x44b8('0xc7'),'include':[{'model':db['CmContact'],'as':_0x44b8('0x9a'),'where':{'mobile':_0x4f513f},'limit':0x1,'order':[['updatedAt',_0x44b8('0x9b')]]}]}]})[_0x44b8('0x22')](handleEntityNotFound(_0x1a13d6,null))[_0x44b8('0x22')](function(_0x19d2db){if(_0x19d2db&&_0x19d2db['List']){_0x56db8e=_0x19d2db[_0x44b8('0x3b')]({'plain':!![]});if(_0x56db8e[_0x44b8('0xc7')]&&_0x56db8e['List']['Contacts'][_0x44b8('0x4c')]){return _0x56db8e[_0x44b8('0xc7')][_0x44b8('0x9a')][0x0];}return db[_0x44b8('0x76')][_0x44b8('0x5e')](_[_0x44b8('0x1a')](_0x3d8751['body'],{'firstName':_0x4f513f,'mobile':_0x4f513f,'phone':_0x4f513f,'ListId':_0x56db8e[_0x44b8('0x7c')]}));}})[_0x44b8('0x22')](handleEntityNotFound(_0x1a13d6,null))['then'](function(_0x1a25ae){if(_0x1a25ae){_0x8ad020=_0x1a25ae;return db[_0x44b8('0x9f')]['find']({'where':{'ContactId':_0x8ad020['id'],'closed':![],'SmsAccountId':_0x56db8e['id']}})['then'](function(_0x52f6ea){if(_0x52f6ea){return[_0x52f6ea,![]];}return db[_0x44b8('0x9f')][_0x44b8('0x5e')]({'UserId':_0x3d8751[_0x44b8('0x5f')]['id'],'ContactId':_0x8ad020['id'],'SmsAccountId':_0x56db8e['id'],'phone':_0x4f513f,'firstMsgDirection':'out','Messages':[_['merge'](_0x3d8751['body'],{'read':![],'body':_0x3d8751[_0x44b8('0x63')][_0x44b8('0x63')],'phone':_0x4f513f,'SmsAccountId':_0x56db8e['id'],'UserId':_0x3d8751[_0x44b8('0x5f')]['id'],'ContactId':_0x8ad020['id']})]},{'include':[{'model':db[_0x44b8('0xa7')],'as':_0x44b8('0xc8')}]})[_0x44b8('0x22')](function(_0x5d5213){return[_0x5d5213,!![]];});});}})[_0x44b8('0xa0')](function(_0x5a8a24,_0x578cdf){if(_0x578cdf){return _0x5a8a24;}return db[_0x44b8('0xa7')][_0x44b8('0x5e')](_['merge'](_0x3d8751[_0x44b8('0x63')],{'read':![],'body':_0x3d8751[_0x44b8('0x63')]['body'],'phone':_0x4f513f,'SmsAccountId':_0x56db8e['id'],'SmsInteractionId':_0x5a8a24['id'],'UserId':_0x3d8751[_0x44b8('0x5f')]['id'],'ContactId':_0x8ad020['id']}))[_0x44b8('0x22')](function(_0x59fed7){_0x5a8a24[_0x44b8('0xc9')][_0x44b8('0xc8')]=[];_0x5a8a24[_0x44b8('0xc9')][_0x44b8('0xc8')][_0x44b8('0xa3')](_0x59fed7[_0x44b8('0xc9')]);return _0x5a8a24;});})['then'](respondWithResult(_0x1a13d6,null))[_0x44b8('0x2d')](handleError(_0x1a13d6,null));};exports[_0x44b8('0x30')]=function(_0x8f2553,_0x5080c3,_0x2c8ece){if(_0x8f2553[_0x44b8('0x63')]['id']){delete _0x8f2553['body']['id'];}var _0x3745e3,_0x20f8ef,_0x585784;return db['SmsAccount'][_0x44b8('0x5d')]({'where':{'id':_0x8f2553['params']['id']}})['then'](handleEntityNotFound(_0x5080c3,null))['then'](function(_0x1aca16){if(_0x1aca16){_0x585784=_0x1aca16;logger[_0x44b8('0x26')](_0x44b8('0x27'),_0x44b8('0x30'),'received\x20delivery\x20report\x20from',_0x1aca16[_0x44b8('0x45')],util[_0x44b8('0xca')](_0x8f2553[_0x44b8('0x63')],{'showHidden':![],'depth':null}));switch(_0x1aca16['type']){case _0x44b8('0x82'):if(_0x8f2553[_0x44b8('0x63')][_0x44b8('0xcb')]&&_0x8f2553[_0x44b8('0x63')]['status']){_0x20f8ef=_0x8f2553[_0x44b8('0x63')][_0x44b8('0x30')];return db[_0x44b8('0xa7')][_0x44b8('0x5d')]({'where':{'messageId':_0x8f2553[_0x44b8('0x63')][_0x44b8('0xcb')]}});}break;case _0x44b8('0x86'):if(_0x8f2553[_0x44b8('0x63')]['requestid']&&_0x8f2553[_0x44b8('0x63')]['statusInt']){_0x20f8ef=_0x8f2553['body'][_0x44b8('0xcc')];return db['SmsMessage'][_0x44b8('0x5d')]({'where':{'messageId':_0x8f2553[_0x44b8('0x63')][_0x44b8('0xcd')]}});}break;case _0x44b8('0x87'):if(_0x8f2553[_0x44b8('0x63')][_0x44b8('0x88')]&&_0x8f2553[_0x44b8('0x63')][_0x44b8('0xce')]){_0x20f8ef=_0x8f2553['body'][_0x44b8('0xce')];return db[_0x44b8('0xa7')][_0x44b8('0x5d')]({'where':{'messageId':_0x8f2553[_0x44b8('0x63')]['message_id']}});}break;case _0x44b8('0x8b'):var _0x37c0d4=_0x8f2553[_0x44b8('0x63')][_0x44b8('0x8c')][0x0];if(_0x37c0d4['messageId']&&_0x37c0d4['status'][_0x44b8('0xcf')]===_0x44b8('0xd0')){_0x20f8ef=_0x37c0d4[_0x44b8('0x30')]['groupName'];return db['SmsMessage']['find']({'where':{'messageId':_0x37c0d4[_0x44b8('0x80')]}});}break;case'clickatell':if(_0x8f2553[_0x44b8('0x63')][_0x44b8('0x80')]&&_0x8f2553[_0x44b8('0x63')][_0x44b8('0x30')]){_0x20f8ef=_0x8f2553['body'][_0x44b8('0x30')];return db[_0x44b8('0xa7')][_0x44b8('0x5d')]({'where':{'messageId':_0x8f2553[_0x44b8('0x63')]['messageId']}});}break;case'bandwidth':if(_0x8f2553['body'][0x0]['message']['id']){_0x20f8ef=_0x8f2553['body'][0x0][_0x44b8('0x45')];return db[_0x44b8('0xa7')]['find']({'where':{'messageId':_0x8f2553[_0x44b8('0x63')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x8f2553[_0x44b8('0x63')][_0x44b8('0xd1')]&&_0x8f2553[_0x44b8('0x63')][_0x44b8('0x30')]){_0x20f8ef=_0x8f2553['body'][_0x44b8('0x30')];return db[_0x44b8('0xa7')][_0x44b8('0x5d')]({'where':{'messageId':_0x8f2553['body']['redif']}});}break;}}})[_0x44b8('0x22')](handleEntityNotFound(_0x5080c3,null))['then'](function(_0x5312d7){if(_0x5312d7){_0x3745e3=_0x5312d7;switch(_0x585784['type']){case _0x44b8('0x82'):if(_0x20f8ef==='DELIVERED'){return _0x3745e3[_0x44b8('0xd2')]({'read':!![]});}else{logger[_0x44b8('0x2a')](_0x44b8('0x27'),_0x44b8('0x30'),_0x44b8('0x82'),util[_0x44b8('0xca')](_0x8f2553['body'],{'showHidden':![],'depth':null}));}break;case _0x44b8('0x86'):if(_0x20f8ef==='1'){return _0x3745e3['update']({'read':!![]});}else{logger[_0x44b8('0x2a')](_0x44b8('0x27'),_0x44b8('0x30'),_0x44b8('0x82'),util['inspect'](_0x8f2553[_0x44b8('0x63')],{'showHidden':![],'depth':null}));}break;case _0x44b8('0x87'):if(!_0x8f2553[_0x44b8('0x63')][_0x44b8('0xd3')]&&_0x20f8ef>=0xc8&&_0x20f8ef<=0xce){return _0x3745e3[_0x44b8('0xd2')]({'read':!![]});}else{logger[_0x44b8('0x2a')](_0x44b8('0x27'),_0x44b8('0x30'),_0x44b8('0x87'),util[_0x44b8('0xca')](_0x8f2553['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x18c282=_0x8f2553[_0x44b8('0x63')][_0x44b8('0x8c')][0x0];if(_0x18c282[_0x44b8('0x30')][_0x44b8('0xcf')]===_0x44b8('0xd0')){return _0x3745e3['update']({'read':!![]});}else{logger['error'](_0x44b8('0x27'),_0x44b8('0x30'),_0x44b8('0x8b'),util[_0x44b8('0xca')](_0x8f2553[_0x44b8('0x63')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x20f8ef=='DELIVERED_TO_GATEWAY'||_0x20f8ef==_0x44b8('0xd4')){return _0x3745e3['update']({'read':!![]});}else{logger[_0x44b8('0x2a')](_0x44b8('0x27'),_0x44b8('0x30'),_0x44b8('0x8f'),util[_0x44b8('0xca')](_0x8f2553[_0x44b8('0x63')],{'showHidden':![],'depth':null}));}break;case _0x44b8('0xd5'):if(_0x20f8ef=='message-delivered'){return _0x3745e3['update']({'read':!![]});}else{logger[_0x44b8('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x44b8('0x30'),_0x44b8('0xd5'),util[_0x44b8('0xca')](_0x8f2553[_0x44b8('0x63')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x20f8ef===_0x44b8('0xd6')||_0x20f8ef===_0x44b8('0xd7')){return _0x3745e3[_0x44b8('0xd2')]({'read':!![]});}else{logger['error'](_0x44b8('0x27'),_0x44b8('0x30'),'intelepeer',util[_0x44b8('0xca')](_0x8f2553[_0x44b8('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x3745e3;}})[_0x44b8('0x22')](respondWithResult(_0x5080c3,null))[_0x44b8('0x2d')](handleError(_0x5080c3,null));};exports[_0x44b8('0xd8')]=function(_0x4b88b8,_0x19fa40,_0x412cab){var _0x3b8a25,_0x3682ba,_0x215577;return db[_0x44b8('0x43')][_0x44b8('0x5d')]({'where':{'id':_0x4b88b8['params']['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x19fa40,null))[_0x44b8('0x22')](function(_0x3e5217){if(_0x3e5217){_0x215577=_0x3e5217;logger['debug'](_0x44b8('0x27'),_0x44b8('0x30'),_0x44b8('0xd9'),_0x3e5217[_0x44b8('0x45')],util[_0x44b8('0xca')](_0x4b88b8[_0x44b8('0x47')],{'showHidden':![],'depth':null}));switch(_0x3e5217[_0x44b8('0x45')]){case _0x44b8('0x8d'):if(_0x4b88b8[_0x44b8('0x47')]['message-id']&&_0x4b88b8[_0x44b8('0x47')][_0x44b8('0xda')]){_0x3682ba=_0x4b88b8['query'][_0x44b8('0xda')];return db['SmsMessage'][_0x44b8('0x5d')]({'where':{'messageId':_0x4b88b8['query']['message-id']}});}break;}}})[_0x44b8('0x22')](handleEntityNotFound(_0x19fa40,null))[_0x44b8('0x22')](function(_0x1631a8){if(_0x1631a8){_0x3b8a25=_0x1631a8;switch(_0x215577[_0x44b8('0x45')]){case _0x44b8('0x8d'):if(_0x3682ba==='2'||_0x3682ba==='6'){return _0x3b8a25[_0x44b8('0xd2')]({'read':!![]});}else{logger[_0x44b8('0x2a')](_0x44b8('0x27'),_0x44b8('0x30'),_0x44b8('0x8d'),util[_0x44b8('0xca')](_0x4b88b8[_0x44b8('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x3b8a25;}})[_0x44b8('0x22')](respondWithResult(_0x19fa40,null))[_0x44b8('0x2d')](handleError(_0x19fa40,null));};exports['addAgents']=function(_0x7a2e7c,_0x3edaf2,_0x33425e){return db[_0x44b8('0x43')][_0x44b8('0x5d')]({'where':{'id':_0x7a2e7c['params']['id']}})['then'](handleEntityNotFound(_0x3edaf2,null))[_0x44b8('0x22')](function(_0x191b08){if(_0x191b08){return _0x191b08[_0x44b8('0xdb')](_0x7a2e7c['body']['ids'],_[_0x44b8('0x9d')](_0x7a2e7c['body'],['ids','id'])||{})[_0x44b8('0xa0')](function(_0x2845ef){for(var _0x5f3a00=0x0;_0x5f3a00<_0x7a2e7c[_0x44b8('0x63')][_0x44b8('0xdc')][_0x44b8('0x4c')];_0x5f3a00+=0x1){socket[_0x44b8('0xdd')]('userSmsAccount:save',{'UserId':Number(_0x7a2e7c[_0x44b8('0x63')]['ids'][_0x5f3a00]),'SmsAccountId':Number(_0x7a2e7c[_0x44b8('0x57')]['id'])});}return _0x2845ef;});}})[_0x44b8('0x22')](respondWithResult(_0x3edaf2,null))[_0x44b8('0x2d')](handleError(_0x3edaf2,null));};exports[_0x44b8('0xde')]=function(_0x310aa2,_0x4ba72e,_0x2951e8){return db[_0x44b8('0x43')][_0x44b8('0x5d')]({'where':{'id':_0x310aa2[_0x44b8('0x57')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x4ba72e,null))[_0x44b8('0x22')](function(_0x373efc){if(_0x373efc){return _0x373efc[_0x44b8('0xde')](_0x310aa2[_0x44b8('0x47')][_0x44b8('0xdc')])['then'](function(){if(_[_0x44b8('0xdf')](_0x310aa2['query'][_0x44b8('0xdc')])){for(var _0x1c50ce=0x0;_0x1c50ce<_0x310aa2[_0x44b8('0x47')][_0x44b8('0xdc')][_0x44b8('0x4c')];_0x1c50ce+=0x1){socket[_0x44b8('0xdd')](_0x44b8('0xe0'),{'UserId':Number(_0x310aa2[_0x44b8('0x47')][_0x44b8('0xdc')][_0x1c50ce]),'SmsAccountId':Number(_0x310aa2['params']['id'])});}}else{socket['emit'](_0x44b8('0xe0'),{'UserId':Number(_0x310aa2[_0x44b8('0x47')][_0x44b8('0xdc')]),'SmsAccountId':Number(_0x310aa2[_0x44b8('0x57')]['id'])});}});}})[_0x44b8('0x22')](respondWithStatusCode(_0x4ba72e,null))['catch'](handleError(_0x4ba72e,null));};exports['getAgents']=function(_0xa8eb3e,_0x2a1dbc,_0x59f13e){var _0x1c9d73={};var _0xa46b22={};var _0x568cf0;var _0x582bcf;return db[_0x44b8('0x43')][_0x44b8('0x67')]({'where':{'id':_0xa8eb3e[_0x44b8('0x57')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x2a1dbc,null))[_0x44b8('0x22')](function(_0xf47b9e){if(_0xf47b9e){_0x568cf0=_0xf47b9e;_0xa46b22['model']=_[_0x44b8('0x5a')](db['User'][_0x44b8('0x59')]);_0xa46b22[_0x44b8('0x47')]=_[_0x44b8('0x5a')](_0xa8eb3e['query']);_0xa46b22[_0x44b8('0x48')]=_['intersection'](_0xa46b22[_0x44b8('0x46')],_0xa46b22[_0x44b8('0x47')]);_0x1c9d73['attributes']=_[_0x44b8('0x49')](_0xa46b22[_0x44b8('0x46')],qs['fields'](_0xa8eb3e[_0x44b8('0x47')][_0x44b8('0x4b')]));_0x1c9d73[_0x44b8('0x4a')]=_0x1c9d73[_0x44b8('0x4a')][_0x44b8('0x4c')]?_0x1c9d73[_0x44b8('0x4a')]:_0xa46b22[_0x44b8('0x46')];_0x1c9d73[_0x44b8('0x4e')]=qs[_0x44b8('0x4f')](_0xa8eb3e[_0x44b8('0x47')][_0x44b8('0x4f')]);_0x1c9d73[_0x44b8('0x50')]=qs[_0x44b8('0x48')](_[_0x44b8('0x51')](_0xa8eb3e['query'],_0xa46b22['filters']));if(_0xa8eb3e[_0x44b8('0x47')]['filter']){_0x1c9d73['where']=_[_0x44b8('0x53')](_0x1c9d73['where'],{'$or':_[_0x44b8('0x42')](_0x1c9d73['attributes'],function(_0x4b5960){var _0x231fdb={};_0x231fdb[_0x4b5960]={'$like':'%'+_0xa8eb3e[_0x44b8('0x47')]['filter']+'%'};return _0x231fdb;})});}_0x1c9d73=_[_0x44b8('0x53')]({},_0x1c9d73,_0xa8eb3e[_0x44b8('0x5c')]);return _0x568cf0[_0x44b8('0xe1')](_0x1c9d73);}})[_0x44b8('0x22')](function(_0x9872f0){if(_0x9872f0){_0x582bcf=_0x9872f0['length'];if(!_0xa8eb3e['query']['hasOwnProperty'](_0x44b8('0x4d'))){_0x1c9d73[_0x44b8('0x35')]=qs[_0x44b8('0x35')](_0xa8eb3e[_0x44b8('0x47')][_0x44b8('0x35')]);_0x1c9d73[_0x44b8('0x33')]=qs['offset'](_0xa8eb3e['query'][_0x44b8('0x33')]);}return _0x568cf0[_0x44b8('0xe1')](_0x1c9d73);}})[_0x44b8('0x22')](function(_0x22bf19){if(_0x22bf19){return _0x22bf19?{'count':_0x582bcf,'rows':_0x22bf19}:null;}})[_0x44b8('0x22')](respondWithResult(_0x2a1dbc,null))[_0x44b8('0x2d')](handleError(_0x2a1dbc,null));};
\ No newline at end of file
+var _0x5cba=['orderBy','Applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','omit','SmsInteraction','interaction','autoclose','applications','push','close','unmanaged','created','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','json','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','Tags','color','tag','List','DESC','out','spread','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','connectel','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','SmsAccounts','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','SmsAccount','include','findAll','rows','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','findOne','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sms','SmsApplication','account'];(function(_0x40798d,_0x3d4bbb){var _0x6a942=function(_0x1ae3d1){while(--_0x1ae3d1){_0x40798d['push'](_0x40798d['shift']());}};_0x6a942(++_0x3d4bbb);}(_0x5cba,0x155));var _0xa5cb=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5cba[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xa5cb('0x0'));var rimraf=require(_0xa5cb('0x1'));var zipdir=require(_0xa5cb('0x2'));var jsonpatch=require(_0xa5cb('0x3'));var rp=require('request-promise');var moment=require(_0xa5cb('0x4'));var BPromise=require(_0xa5cb('0x5'));var Mustache=require(_0xa5cb('0x6'));var util=require(_0xa5cb('0x7'));var path=require(_0xa5cb('0x8'));var sox=require(_0xa5cb('0x9'));var csv=require(_0xa5cb('0xa'));var ejs=require(_0xa5cb('0xb'));var fs=require('fs');var fs_extra=require(_0xa5cb('0xc'));var _=require('lodash');var squel=require(_0xa5cb('0xd'));var crypto=require(_0xa5cb('0xe'));var jsforce=require(_0xa5cb('0xf'));var deskjs=require(_0xa5cb('0x10'));var toCsv=require(_0xa5cb('0xa'));var querystring=require(_0xa5cb('0x11'));var Papa=require(_0xa5cb('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa5cb('0x13'));var as=require(_0xa5cb('0x14'));var hardwareService=require(_0xa5cb('0x15'));var logger=require(_0xa5cb('0x16'))(_0xa5cb('0x17'));var utils=require(_0xa5cb('0x18'));var config=require(_0xa5cb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5cb('0x1a'))['db'];config['redis']=_[_0xa5cb('0x1b')](config[_0xa5cb('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5cb('0x1d'))(new Redis(config[_0xa5cb('0x1c')]));require(_0xa5cb('0x1e'))['register'](socket);var jayson=require(_0xa5cb('0x1f'));var client=jayson[_0xa5cb('0x20')][_0xa5cb('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x441493,_0x542d87,_0x235688,_0x239fc4){return new BPromise(function(_0x21c03f,_0x91eda5){var _0x511027=_0x239fc4||client;return _0x511027[_0xa5cb('0x22')](_0x441493,_0x235688)[_0xa5cb('0x23')](function(_0xaafa9){logger[_0xa5cb('0x24')](_0xa5cb('0x25'),_0x542d87,_0xa5cb('0x26'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x542d87,'request\x20sent',JSON[_0xa5cb('0x27')](_0xaafa9));if(_0xaafa9[_0xa5cb('0x28')]){if(_0xaafa9[_0xa5cb('0x28')][_0xa5cb('0x29')]===0x1f4){logger[_0xa5cb('0x28')](_0xa5cb('0x25'),_0x542d87,_0xaafa9[_0xa5cb('0x28')]['message']);return _0x91eda5(_0xaafa9[_0xa5cb('0x28')][_0xa5cb('0x2a')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x542d87,_0xaafa9[_0xa5cb('0x28')][_0xa5cb('0x2a')]);return _0x21c03f(_0xaafa9[_0xa5cb('0x28')][_0xa5cb('0x2a')]);}else{logger[_0xa5cb('0x24')](_0xa5cb('0x25'),_0x542d87,'request\x20sent');_0x21c03f(_0xaafa9[_0xa5cb('0x2b')]['message']);}})[_0xa5cb('0x2c')](function(_0x22eca3){logger[_0xa5cb('0x28')](_0xa5cb('0x25'),_0x542d87,_0x22eca3);_0x91eda5(_0x22eca3);});});}function respondWithStatusCode(_0x33983e,_0x1d1461){_0x1d1461=_0x1d1461||0xcc;return function(_0xc92a35){if(_0xc92a35){return _0x33983e[_0xa5cb('0x2d')](_0x1d1461);}return _0x33983e['status'](_0x1d1461)[_0xa5cb('0x2e')]();};}function respondWithResult(_0x27d7f7,_0x5b88bd){_0x5b88bd=_0x5b88bd||0xc8;return function(_0xd83890){if(_0xd83890){return _0x27d7f7[_0xa5cb('0x2f')](_0x5b88bd)['json'](_0xd83890);}};}function respondWithFilteredResult(_0x482dba,_0x2ccbf4){return function(_0x512a72){if(_0x512a72){var _0x21049f=typeof _0x2ccbf4['offset']===_0xa5cb('0x30')&&typeof _0x2ccbf4['limit']===_0xa5cb('0x30');var _0x1418bd=_0x512a72[_0xa5cb('0x31')];var _0x10d8a6=_0x21049f?0x0:_0x2ccbf4[_0xa5cb('0x32')];var _0x21987d=_0x21049f?_0x512a72[_0xa5cb('0x31')]:_0x2ccbf4['offset']+_0x2ccbf4[_0xa5cb('0x33')];var _0x27fe2f;if(_0x21987d>=_0x1418bd){_0x21987d=_0x1418bd;_0x27fe2f=0xc8;}else{_0x27fe2f=0xce;}_0x482dba['status'](_0x27fe2f);return _0x482dba[_0xa5cb('0x34')](_0xa5cb('0x35'),_0x10d8a6+'-'+_0x21987d+'/'+_0x1418bd)['json'](_0x512a72);}return null;};}function patchUpdates(_0x3bdadd){return function(_0x15541b){try{jsonpatch['apply'](_0x15541b,_0x3bdadd,!![]);}catch(_0x5e05ae){return BPromise[_0xa5cb('0x36')](_0x5e05ae);}return _0x15541b[_0xa5cb('0x37')]();};}function saveUpdates(_0x3880fe,_0x5321c1){return function(_0x51117d){if(_0x51117d){return _0x51117d[_0xa5cb('0x38')](_0x3880fe)[_0xa5cb('0x23')](function(_0x43acb1){return _0x43acb1;});}return null;};}function removeEntity(_0x16feb1,_0x2b284a){return function(_0x14127d){if(_0x14127d){return _0x14127d[_0xa5cb('0x39')]()[_0xa5cb('0x23')](function(){var _0x550e51=_0x14127d[_0xa5cb('0x3a')]({'plain':!![]});var _0x397dee=_0xa5cb('0x3b');return db['UserProfileResource'][_0xa5cb('0x39')]({'where':{'type':_0x397dee,'resourceId':_0x550e51['id']}})[_0xa5cb('0x23')](function(){return _0x14127d;});})[_0xa5cb('0x23')](function(){_0x16feb1[_0xa5cb('0x2f')](0xcc)[_0xa5cb('0x2e')]();});}};}function handleEntityNotFound(_0x53467a,_0x45ab36){return function(_0xb25d85){if(!_0xb25d85){_0x53467a[_0xa5cb('0x2d')](0x194);}return _0xb25d85;};}function handleError(_0x12770a,_0x3a66d2){_0x3a66d2=_0x3a66d2||0x1f4;return function(_0x1cbf35){logger[_0xa5cb('0x28')](_0x1cbf35[_0xa5cb('0x3c')]);if(_0x1cbf35[_0xa5cb('0x3d')]){delete _0x1cbf35[_0xa5cb('0x3d')];}_0x12770a[_0xa5cb('0x2f')](_0x3a66d2)[_0xa5cb('0x3e')](_0x1cbf35);};}exports[_0xa5cb('0x3f')]=function(_0x519383,_0x4dcc4e){var _0x53be34={'include':[{'model':db['Pause'],'as':_0xa5cb('0x40')}]},_0xcf2acf={},_0x1304c1={'count':0x0,'rows':[]};var _0x22a442=_[_0xa5cb('0x41')](db['SmsAccount'][_0xa5cb('0x42')],function(_0x44fae7){return{'name':_0x44fae7['fieldName'],'type':_0x44fae7[_0xa5cb('0x43')][_0xa5cb('0x44')]};});_0xcf2acf['model']=_[_0xa5cb('0x41')](_0x22a442,_0xa5cb('0x3d'));_0xcf2acf[_0xa5cb('0x45')]=_[_0xa5cb('0x46')](_0x519383[_0xa5cb('0x45')]);_0xcf2acf[_0xa5cb('0x47')]=_[_0xa5cb('0x48')](_0xcf2acf[_0xa5cb('0x49')],_0xcf2acf[_0xa5cb('0x45')]);_0x53be34['attributes']=_[_0xa5cb('0x48')](_0xcf2acf[_0xa5cb('0x49')],qs['fields'](_0x519383['query'][_0xa5cb('0x4a')]));_0x53be34['attributes']=_0x53be34[_0xa5cb('0x4b')][_0xa5cb('0x4c')]?_0x53be34['attributes']:_0xcf2acf[_0xa5cb('0x49')];if(!_0x519383[_0xa5cb('0x45')][_0xa5cb('0x4d')](_0xa5cb('0x4e'))){_0x53be34[_0xa5cb('0x33')]=qs[_0xa5cb('0x33')](_0x519383[_0xa5cb('0x45')][_0xa5cb('0x33')]);_0x53be34[_0xa5cb('0x32')]=qs[_0xa5cb('0x32')](_0x519383[_0xa5cb('0x45')][_0xa5cb('0x32')]);}_0x53be34[_0xa5cb('0x4f')]=qs[_0xa5cb('0x50')](_0x519383[_0xa5cb('0x45')]['sort']);_0x53be34[_0xa5cb('0x51')]=qs['filters'](_[_0xa5cb('0x52')](_0x519383[_0xa5cb('0x45')],_0xcf2acf[_0xa5cb('0x47')]),_0x22a442);if(_0x519383[_0xa5cb('0x45')][_0xa5cb('0x53')]){_0x53be34[_0xa5cb('0x51')]=_['merge'](_0x53be34[_0xa5cb('0x51')],{'$or':_[_0xa5cb('0x41')](_0x22a442,function(_0x4a5c36){if(_0x4a5c36['type']!=='VIRTUAL'){var _0x57ab72={};_0x57ab72[_0x4a5c36[_0xa5cb('0x3d')]]={'$like':'%'+_0x519383['query']['filter']+'%'};return _0x57ab72;}})});}_0x53be34=_[_0xa5cb('0x54')]({},_0x53be34,_0x519383['options']);var _0x56bbf9={'where':_0x53be34[_0xa5cb('0x51')]};return db[_0xa5cb('0x55')]['count'](_0x56bbf9)[_0xa5cb('0x23')](function(_0x7ff33f){_0x1304c1[_0xa5cb('0x31')]=_0x7ff33f;if(_0x519383[_0xa5cb('0x45')]['includeAll']){_0x53be34[_0xa5cb('0x56')]=[{'all':!![]}];}return db[_0xa5cb('0x55')][_0xa5cb('0x57')](_0x53be34);})[_0xa5cb('0x23')](function(_0x5988f3){_0x1304c1[_0xa5cb('0x58')]=_0x5988f3;return _0x1304c1;})[_0xa5cb('0x23')](respondWithFilteredResult(_0x4dcc4e,_0x53be34))['catch'](handleError(_0x4dcc4e,null));};exports[_0xa5cb('0x59')]=function(_0x6fc457,_0x9c7ee5){var _0x34a8f5={'raw':![],'where':{'id':_0x6fc457[_0xa5cb('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1d979b={};_0x1d979b[_0xa5cb('0x49')]=_[_0xa5cb('0x46')](db[_0xa5cb('0x55')][_0xa5cb('0x42')]);_0x1d979b[_0xa5cb('0x45')]=_['keys'](_0x6fc457[_0xa5cb('0x45')]);_0x1d979b[_0xa5cb('0x47')]=_['intersection'](_0x1d979b[_0xa5cb('0x49')],_0x1d979b[_0xa5cb('0x45')]);_0x34a8f5[_0xa5cb('0x4b')]=_[_0xa5cb('0x48')](_0x1d979b[_0xa5cb('0x49')],qs[_0xa5cb('0x4a')](_0x6fc457['query'][_0xa5cb('0x4a')]));_0x34a8f5['attributes']=_0x34a8f5[_0xa5cb('0x4b')][_0xa5cb('0x4c')]?_0x34a8f5[_0xa5cb('0x4b')]:_0x1d979b[_0xa5cb('0x49')];if(_0x6fc457[_0xa5cb('0x45')][_0xa5cb('0x5b')]){_0x34a8f5[_0xa5cb('0x56')]=[{'all':!![]}];}_0x34a8f5=_['merge']({},_0x34a8f5,_0x6fc457[_0xa5cb('0x5c')]);return db[_0xa5cb('0x55')][_0xa5cb('0x5d')](_0x34a8f5)[_0xa5cb('0x23')](handleEntityNotFound(_0x9c7ee5,null))[_0xa5cb('0x23')](respondWithResult(_0x9c7ee5,null))[_0xa5cb('0x2c')](handleError(_0x9c7ee5,null));};exports['create']=function(_0x521466,_0x111245){return db['SmsAccount'][_0xa5cb('0x5e')](_0x521466[_0xa5cb('0x5f')],{})[_0xa5cb('0x23')](function(_0x2372c6){var _0x4fb06a=_0x521466[_0xa5cb('0x60')][_0xa5cb('0x3a')]({'plain':!![]});if(!_0x4fb06a)throw new Error(_0xa5cb('0x61'));if(_0x4fb06a['role']===_0xa5cb('0x60')){var _0x327d4f=_0x2372c6[_0xa5cb('0x3a')]({'plain':!![]});var _0x1e5a17='SmsAccounts';return db['UserProfileSection'][_0xa5cb('0x5d')]({'where':{'name':_0x1e5a17,'userProfileId':_0x4fb06a[_0xa5cb('0x62')]},'raw':!![]})[_0xa5cb('0x23')](function(_0x184f36){if(_0x184f36&&_0x184f36[_0xa5cb('0x63')]===0x0){return db[_0xa5cb('0x64')][_0xa5cb('0x5e')]({'name':_0x327d4f['name'],'resourceId':_0x327d4f['id'],'type':_0x184f36['name'],'sectionId':_0x184f36['id']},{})[_0xa5cb('0x23')](function(){return _0x2372c6;});}else{return _0x2372c6;}})['catch'](function(_0x1dddcb){logger[_0xa5cb('0x28')](_0xa5cb('0x65'),_0x1dddcb);throw _0x1dddcb;});}return _0x2372c6;})[_0xa5cb('0x23')](respondWithResult(_0x111245,0xc9))[_0xa5cb('0x2c')](handleError(_0x111245,null));};exports['update']=function(_0x447063,_0xd7379a){if(_0x447063[_0xa5cb('0x5f')]['id']){delete _0x447063['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x447063[_0xa5cb('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0xa5cb('0x40')}]})[_0xa5cb('0x23')](handleEntityNotFound(_0xd7379a,null))[_0xa5cb('0x23')](saveUpdates(_0x447063[_0xa5cb('0x5f')],null))[_0xa5cb('0x23')](respondWithResult(_0xd7379a,null))[_0xa5cb('0x2c')](handleError(_0xd7379a,null));};exports['destroy']=function(_0x2c8a16,_0x5543ca){return db[_0xa5cb('0x55')][_0xa5cb('0x5d')]({'where':{'id':_0x2c8a16['params']['id']}})['then'](handleEntityNotFound(_0x5543ca,null))[_0xa5cb('0x23')](removeEntity(_0x5543ca,null))[_0xa5cb('0x2c')](handleError(_0x5543ca,null));};exports['describe']=function(_0x258d01,_0x196dbb){return db[_0xa5cb('0x55')][_0xa5cb('0x66')]()[_0xa5cb('0x23')](respondWithResult(_0x196dbb,null))[_0xa5cb('0x2c')](handleError(_0x196dbb,null));};exports['addDisposition']=function(_0x1772d5,_0x59c1c9,_0x39b114){if(_0x1772d5['body']['id']){delete _0x1772d5['body']['id'];}return db[_0xa5cb('0x55')][_0xa5cb('0x5d')]({'where':{'id':_0x1772d5[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x59c1c9,null))[_0xa5cb('0x23')](function(_0x42203f){if(_0x42203f){_0x1772d5[_0xa5cb('0x5f')][_0xa5cb('0x67')]=_0x42203f['id'];return db['Disposition'][_0xa5cb('0x5e')](_0x1772d5[_0xa5cb('0x5f')]);}})[_0xa5cb('0x23')](respondWithResult(_0x59c1c9,null))[_0xa5cb('0x2c')](handleError(_0x59c1c9,null));};exports['getDispositions']=function(_0x8abbc4,_0x13d950,_0x399435){var _0x55e56b={'raw':![],'where':{}};var _0x539ab8={};var _0x4c97f1={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa5cb('0x68')]({'where':{'id':_0x8abbc4[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x13d950,null))['then'](function(_0x10c971){if(_0x10c971){_0x539ab8['model']=_[_0xa5cb('0x46')](db[_0xa5cb('0x69')][_0xa5cb('0x42')]);_0x539ab8['query']=_[_0xa5cb('0x46')](_0x8abbc4[_0xa5cb('0x45')]);_0x539ab8[_0xa5cb('0x47')]=_[_0xa5cb('0x48')](_0x539ab8[_0xa5cb('0x49')],_0x539ab8[_0xa5cb('0x45')]);_0x55e56b[_0xa5cb('0x4b')]=_[_0xa5cb('0x48')](_0x539ab8['model'],qs['fields'](_0x8abbc4[_0xa5cb('0x45')]['fields']));_0x55e56b[_0xa5cb('0x4b')]=_0x55e56b[_0xa5cb('0x4b')][_0xa5cb('0x4c')]?_0x55e56b[_0xa5cb('0x4b')]:_0x539ab8[_0xa5cb('0x49')];if(!_0x8abbc4[_0xa5cb('0x45')][_0xa5cb('0x4d')]('nolimit')){_0x55e56b[_0xa5cb('0x33')]=qs[_0xa5cb('0x33')](_0x8abbc4[_0xa5cb('0x45')][_0xa5cb('0x33')]);_0x55e56b[_0xa5cb('0x32')]=qs['offset'](_0x8abbc4['query']['offset']);}_0x55e56b[_0xa5cb('0x4f')]=qs['sort'](_0x8abbc4[_0xa5cb('0x45')]['sort']);_0x55e56b[_0xa5cb('0x51')]=qs[_0xa5cb('0x47')](_[_0xa5cb('0x52')](_0x8abbc4[_0xa5cb('0x45')],_0x539ab8[_0xa5cb('0x47')]));_0x55e56b[_0xa5cb('0x51')][_0xa5cb('0x67')]=_0x10c971['id'];if(_0x8abbc4['query'][_0xa5cb('0x53')]){_0x55e56b[_0xa5cb('0x51')]=_[_0xa5cb('0x54')](_0x55e56b[_0xa5cb('0x51')],{'$or':_[_0xa5cb('0x41')](_0x55e56b['attributes'],function(_0x511c55){var _0xe6c979={};_0xe6c979[_0x511c55]={'$like':'%'+_0x8abbc4[_0xa5cb('0x45')]['filter']+'%'};return _0xe6c979;})});}_0x55e56b=_[_0xa5cb('0x54')]({},_0x55e56b,_0x8abbc4[_0xa5cb('0x5c')]);return db[_0xa5cb('0x69')]['count']({'where':_0x55e56b[_0xa5cb('0x51')]})[_0xa5cb('0x23')](function(_0x160ce1){_0x4c97f1[_0xa5cb('0x31')]=_0x160ce1;if(_0x8abbc4[_0xa5cb('0x45')][_0xa5cb('0x5b')]){_0x55e56b[_0xa5cb('0x56')]=[{'all':!![]}];}return db[_0xa5cb('0x69')][_0xa5cb('0x57')](_0x55e56b);})[_0xa5cb('0x23')](function(_0x23522b){_0x4c97f1[_0xa5cb('0x58')]=_0x23522b;return _0x4c97f1;});}})[_0xa5cb('0x23')](respondWithFilteredResult(_0x13d950,_0x55e56b))[_0xa5cb('0x2c')](handleError(_0x13d950,null));};exports[_0xa5cb('0x6a')]=function(_0x1c30f9,_0x437dae,_0x4f9906){return db[_0xa5cb('0x55')][_0xa5cb('0x5d')]({'where':{'id':_0x1c30f9[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x437dae,null))[_0xa5cb('0x23')](function(_0x3748df){if(_0x3748df){return _0x3748df[_0xa5cb('0x6a')](_0x1c30f9[_0xa5cb('0x45')][_0xa5cb('0x6b')]);}})[_0xa5cb('0x23')](respondWithStatusCode(_0x437dae,null))[_0xa5cb('0x2c')](handleError(_0x437dae,null));};exports[_0xa5cb('0x6c')]=function(_0xe0220d,_0x423746,_0x11c6bb){if(_0xe0220d['body']['id']){delete _0xe0220d[_0xa5cb('0x5f')]['id'];}return db[_0xa5cb('0x55')][_0xa5cb('0x5d')]({'where':{'id':_0xe0220d[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x423746,null))[_0xa5cb('0x23')](function(_0x4f188d){if(_0x4f188d){_0xe0220d[_0xa5cb('0x5f')]['SmsAccountId']=_0x4f188d['id'];return db['CannedAnswer'][_0xa5cb('0x5e')](_0xe0220d[_0xa5cb('0x5f')]);}})[_0xa5cb('0x23')](respondWithResult(_0x423746,null))[_0xa5cb('0x2c')](handleError(_0x423746,null));};exports[_0xa5cb('0x6d')]=function(_0x3c36c8,_0x4683dc,_0x3db258){var _0x421d89={'raw':![],'where':{}};var _0x13c022={};var _0x2ed803={'count':0x0,'rows':[]};return db[_0xa5cb('0x55')][_0xa5cb('0x68')]({'where':{'id':_0x3c36c8[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x4683dc,null))[_0xa5cb('0x23')](function(_0x10cc7b){if(_0x10cc7b){_0x13c022[_0xa5cb('0x49')]=_['keys'](db[_0xa5cb('0x6e')][_0xa5cb('0x42')]);_0x13c022[_0xa5cb('0x45')]=_['keys'](_0x3c36c8[_0xa5cb('0x45')]);_0x13c022['filters']=_[_0xa5cb('0x48')](_0x13c022['model'],_0x13c022[_0xa5cb('0x45')]);_0x421d89[_0xa5cb('0x4b')]=_[_0xa5cb('0x48')](_0x13c022[_0xa5cb('0x49')],qs[_0xa5cb('0x4a')](_0x3c36c8[_0xa5cb('0x45')][_0xa5cb('0x4a')]));_0x421d89[_0xa5cb('0x4b')]=_0x421d89[_0xa5cb('0x4b')][_0xa5cb('0x4c')]?_0x421d89['attributes']:_0x13c022[_0xa5cb('0x49')];if(!_0x3c36c8['query']['hasOwnProperty'](_0xa5cb('0x4e'))){_0x421d89['limit']=qs[_0xa5cb('0x33')](_0x3c36c8[_0xa5cb('0x45')][_0xa5cb('0x33')]);_0x421d89[_0xa5cb('0x32')]=qs[_0xa5cb('0x32')](_0x3c36c8[_0xa5cb('0x45')][_0xa5cb('0x32')]);}_0x421d89[_0xa5cb('0x4f')]=qs[_0xa5cb('0x50')](_0x3c36c8[_0xa5cb('0x45')]['sort']);_0x421d89[_0xa5cb('0x51')]=qs['filters'](_[_0xa5cb('0x52')](_0x3c36c8[_0xa5cb('0x45')],_0x13c022['filters']));_0x421d89[_0xa5cb('0x51')][_0xa5cb('0x67')]=_0x10cc7b['id'];if(_0x3c36c8[_0xa5cb('0x45')][_0xa5cb('0x53')]){_0x421d89[_0xa5cb('0x51')]=_[_0xa5cb('0x54')](_0x421d89[_0xa5cb('0x51')],{'$or':_[_0xa5cb('0x41')](_0x421d89['attributes'],function(_0x5dbebf){var _0x2e9556={};_0x2e9556[_0x5dbebf]={'$like':'%'+_0x3c36c8['query'][_0xa5cb('0x53')]+'%'};return _0x2e9556;})});}_0x421d89=_[_0xa5cb('0x54')]({},_0x421d89,_0x3c36c8[_0xa5cb('0x5c')]);return db['CannedAnswer'][_0xa5cb('0x31')]({'where':_0x421d89[_0xa5cb('0x51')]})[_0xa5cb('0x23')](function(_0x366443){_0x2ed803[_0xa5cb('0x31')]=_0x366443;if(_0x3c36c8['query']['includeAll']){_0x421d89['include']=[{'all':!![]}];}return db[_0xa5cb('0x6e')][_0xa5cb('0x57')](_0x421d89);})[_0xa5cb('0x23')](function(_0x26e514){_0x2ed803[_0xa5cb('0x58')]=_0x26e514;return _0x2ed803;});}})[_0xa5cb('0x23')](respondWithFilteredResult(_0x4683dc,_0x421d89))['catch'](handleError(_0x4683dc,null));};exports[_0xa5cb('0x6f')]=function(_0x4ff0b3,_0x4d0711,_0x1c9791){return db[_0xa5cb('0x55')]['find']({'where':{'id':_0x4ff0b3['params']['id']}})['then'](handleEntityNotFound(_0x4d0711,null))[_0xa5cb('0x23')](function(_0x5f4c00){if(_0x5f4c00){return _0x5f4c00[_0xa5cb('0x6f')](_0x4ff0b3[_0xa5cb('0x45')][_0xa5cb('0x6b')]);}})[_0xa5cb('0x23')](respondWithStatusCode(_0x4d0711,null))[_0xa5cb('0x2c')](handleError(_0x4d0711,null));};exports['notify']=function(_0x42d6b3,_0x5043d2,_0x354982){var _0x4435ea={'channel':_0xa5cb('0x70')};var _0x39a490=[];var _0x5ea8e3=[];var _0x4385be={};return db['SmsAccount'][_0xa5cb('0x5d')]({'where':{'id':_0x42d6b3[_0xa5cb('0x5a')]['id']},'include':[{'model':db[_0xa5cb('0x71')],'as':'Applications'}]})[_0xa5cb('0x23')](handleEntityNotFound(_0x5043d2,null))[_0xa5cb('0x23')](function(_0x512195){_0x4435ea[_0xa5cb('0x72')]=_0x512195;_0x4435ea['applications']=_[_0xa5cb('0x73')](_0x512195[_0xa5cb('0x74')],['priority'],[_0xa5cb('0x75')]);if(_0x4435ea[_0xa5cb('0x72')][_0xa5cb('0x74')]){delete _0x4435ea['account'][_0xa5cb('0x74')];}return db[_0xa5cb('0x76')][_0xa5cb('0x66')]();})[_0xa5cb('0x23')](function(_0x41b4fc){if(!_0x41b4fc){throw new db[(_0xa5cb('0x77'))][(_0xa5cb('0x78'))]('no\x20available\x20attributes');}_0x39a490=_[_0xa5cb('0x79')](_[_0xa5cb('0x46')](_0x41b4fc),[_0xa5cb('0x7a'),_0xa5cb('0x7b')]);_0x5ea8e3=_[_0xa5cb('0x79')](_[_0xa5cb('0x46')](_0x41b4fc),[_0xa5cb('0x7a'),_0xa5cb('0x7b'),_0xa5cb('0x7c'),_0xa5cb('0x7d')]);_0x4435ea[_0xa5cb('0x5f')]={'mapKey':_0xa5cb('0x7e')};if(_0x4435ea['account'][_0xa5cb('0x43')]){switch(_0x4435ea[_0xa5cb('0x72')][_0xa5cb('0x43')]){case _0xa5cb('0x7f'):_0x4435ea['body'][_0xa5cb('0x80')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x81')];_0x4435ea[_0xa5cb('0x5f')]['body']=_0x42d6b3['body'][_0xa5cb('0x82')];_0x4435ea['body'][_0xa5cb('0x83')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x84')];break;case _0xa5cb('0x85'):_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x80')]='+'+_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x86')];_0x4435ea['body'][_0xa5cb('0x5f')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x87')];break;case'connectel':_0x4435ea['body'][_0xa5cb('0x80')]=_0x42d6b3[_0xa5cb('0x5f')]['from'];_0x4435ea['body']['body']=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x2a')];break;case _0xa5cb('0x88'):_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x80')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x80')];_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x5f')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x5f')];_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x83')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x89')];break;case _0xa5cb('0x8a'):_0x4435ea[_0xa5cb('0x5f')]['from']=_0x42d6b3[_0xa5cb('0x5f')]['From'];_0x4435ea[_0xa5cb('0x5f')]['body']=_0x42d6b3['body'][_0xa5cb('0x8b')];_0x4435ea[_0xa5cb('0x5f')]['messageId']=_0x42d6b3[_0xa5cb('0x5f')]['MessageUUID'];break;case _0xa5cb('0x8c'):_0x4435ea[_0xa5cb('0x5f')]['from']='+'+_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x8d')][0x0][_0xa5cb('0x80')];_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x5f')]=_0x42d6b3['body'][_0xa5cb('0x8d')][0x0][_0xa5cb('0x87')];_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x83')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x8d')][0x0]['messageId'];break;case _0xa5cb('0x8e'):_0x4435ea[_0xa5cb('0x5f')]['from']=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x8f')];_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x5f')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x90')][_0xa5cb('0x2a')];break;case'clickatell':_0x4435ea['body']['from']=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x91')];_0x4435ea['body'][_0xa5cb('0x5f')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x87')];_0x4435ea['body'][_0xa5cb('0x83')]=_0x42d6b3[_0xa5cb('0x5f')][_0xa5cb('0x92')];break;case _0xa5cb('0x93'):_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x83')]=_0x42d6b3[_0xa5cb('0x5f')][0x0][_0xa5cb('0x2a')]['id'];_0x4435ea[_0xa5cb('0x5f')]['from']=_0x42d6b3[_0xa5cb('0x5f')][0x0][_0xa5cb('0x2a')]['from'];_0x4435ea[_0xa5cb('0x5f')]['body']=_0x42d6b3[_0xa5cb('0x5f')][0x0][_0xa5cb('0x2a')][_0xa5cb('0x87')];break;case _0xa5cb('0x94'):_0x4435ea['body'][_0xa5cb('0x80')]=_0x42d6b3[_0xa5cb('0x5f')]['from'];_0x4435ea['body'][_0xa5cb('0x5f')]=_0x42d6b3[_0xa5cb('0x5f')]['message'];_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x83')]=_0x42d6b3[_0xa5cb('0x5f')]['refid'];break;}}if(_0x4435ea[_0xa5cb('0x5f')]['id']){delete _0x4435ea[_0xa5cb('0x5f')]['id'];}if(_[_0xa5cb('0x95')](_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x80')])){throw new db[(_0xa5cb('0x77'))][(_0xa5cb('0x78'))](_0xa5cb('0x96'));}if(_['isNil'](_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x5f')])||_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x5f')]===''){throw new db[(_0xa5cb('0x77'))][(_0xa5cb('0x78'))](_0xa5cb('0x97'));}if(_[_0xa5cb('0x95')](_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x98')])){throw new db[(_0xa5cb('0x77'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5ea8e3);}if(!_[_0xa5cb('0x99')](_0x5ea8e3,_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x98')])){throw new db[(_0xa5cb('0x77'))]['ValidationError'](_0xa5cb('0x9a')+_0x5ea8e3);}_0x4385be[_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x98')]]=_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x80')];return db[_0xa5cb('0x9b')][_0xa5cb('0x5d')]({'where':{'id':_0x4435ea[_0xa5cb('0x72')]['ListId']},'include':[{'model':db[_0xa5cb('0x76')],'as':_0xa5cb('0x9c'),'where':_0x4385be,'limit':0x1,'order':[[_0xa5cb('0x7b'),'DESC']]}]});})[_0xa5cb('0x23')](handleEntityNotFound(_0x5043d2,null))[_0xa5cb('0x23')](function(_0x11daef){if(_0x11daef){_0x4435ea['list']=_[_0xa5cb('0x9d')](_0x11daef,[_0xa5cb('0x9c')]);if(_0x11daef[_0xa5cb('0x9c')][_0xa5cb('0x4c')]){return _0x11daef[_0xa5cb('0x9c')][0x0];}var _0x33ff90=_[_0xa5cb('0x1b')](_0x4435ea['body'],{'firstName':_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x80')],'ListId':_0x11daef['id']});_0x33ff90[_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x98')]]=_0x4435ea['body'][_0xa5cb('0x80')];return db['CmContact'][_0xa5cb('0x5e')](_0x33ff90,{'fields':_0x39a490,'raw':!![]});}})['then'](handleEntityNotFound(_0x5043d2,null))['then'](function(_0x27172c){if(_0x27172c){_0x4435ea['contact']=_0x27172c;var _0xf68278={'ContactId':_0x27172c['id'],'phone':_0x4435ea['body'][_0xa5cb('0x80')],'SmsAccountId':_0x42d6b3[_0xa5cb('0x5a')]['id']};var _0x47eb53={'ContactId':_0x27172c['id'],'SmsAccountId':_0x42d6b3[_0xa5cb('0x5a')]['id'],'closed':![]};return db[_0xa5cb('0x9e')][_0xa5cb('0x5d')]({'where':_0x47eb53})[_0xa5cb('0x23')](function(_0x77ce76){if(_0x77ce76){return[_0x77ce76,![]];}return db[_0xa5cb('0x9e')][_0xa5cb('0x5e')](_0xf68278)[_0xa5cb('0x23')](function(_0x165b94){return[_0x165b94,!![]];});});}})['spread'](function(_0x34203d,_0x8bb2bb){_0x4435ea[_0xa5cb('0x9f')]=_0x34203d[_0xa5cb('0x3a')]({'plain':!![]});_0x4435ea[_0xa5cb('0x9f')]['created']=![];if(_0x8bb2bb){if(_0x4435ea[_0xa5cb('0x72')][_0xa5cb('0xa0')]){_0x4435ea[_0xa5cb('0xa1')][_0xa5cb('0xa2')]({'id':0x0,'priority':_0x4435ea[_0xa5cb('0xa1')][_0xa5cb('0x4c')]+0x1,'app':_0xa5cb('0xa3'),'appdata':_0xa5cb('0xa4'),'interval':'*,*,*,*'});}_0x4435ea[_0xa5cb('0x9f')][_0xa5cb('0xa5')]=!![];}return db[_0xa5cb('0xa6')][_0xa5cb('0x5e')]({'phone':_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x80')],'messageId':_0x4435ea[_0xa5cb('0x5f')]['messageId'],'body':_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0x5f')],'SmsAccountId':_0x42d6b3[_0xa5cb('0x5a')]['id'],'SmsInteractionId':_0x34203d['id'],'direction':'in','ContactId':_0x34203d['ContactId'],'AttachmentId':_0x4435ea[_0xa5cb('0x5f')][_0xa5cb('0xa7')]});})[_0xa5cb('0x23')](function(_0xfd6e00){_0x4435ea[_0xa5cb('0x2a')]=_0xfd6e00;if(_0x4435ea[_0xa5cb('0x9f')][_0xa5cb('0xa8')]){return db[_0xa5cb('0xa9')][_0xa5cb('0x5d')]({'attributes':['id',_0xa5cb('0x3d')],'where':{'id':_0x4435ea['interaction'][_0xa5cb('0xa8')]}})[_0xa5cb('0x23')](function(_0x191153){if(_0x191153){_0x4435ea['applications'][_0xa5cb('0xaa')]({'id':0x0,'priority':0x0,'app':_0xa5cb('0xab'),'appdata':_0x191153[_0xa5cb('0x3d')]+','+(_0x4435ea['account'][_0xa5cb('0xac')]||0xa),'interval':_0xa5cb('0xad')});}return respondWithRpcPromise('Start',_0xa5cb('0xae'),_0x4435ea);});}return respondWithRpcPromise(_0xa5cb('0xaf'),_0xa5cb('0xae'),_0x4435ea);})[_0xa5cb('0x23')](function(_0x5eebb9){if(_0x5eebb9){var _0x5469e3=0xc8;var _0x59e84b=_0xa5cb('0xb0');logger['info'](_0xa5cb('0xb1'),_0x59e84b,_0x5469e3,_0xa5cb('0xb2'));logger[_0xa5cb('0xb3')](_0xa5cb('0xb4'),_0x59e84b,_0x5469e3,_0xa5cb('0xb2'),JSON[_0xa5cb('0x27')](_0x5eebb9));if(_0x4435ea[_0xa5cb('0x72')]['type']===_0xa5cb('0x7f')){return _0x5043d2[_0xa5cb('0x2f')](_0x5469e3)[_0xa5cb('0x34')](_0xa5cb('0xb5'),'text/xml')[_0xa5cb('0x3e')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x5043d2[_0xa5cb('0x2f')](_0x5469e3)[_0xa5cb('0xb6')](_0x5eebb9);}}})[_0xa5cb('0x2c')](handleError(_0x5043d2,null));};exports[_0xa5cb('0xb7')]=function(_0x44e695,_0x3f0538){var _0x5daa93=_0x44e695[_0xa5cb('0x5a')]['id'];var _0xe011a=_0x44e695['body'];var _0x58c411=0xc8;var _0x185879=null;return db[_0xa5cb('0xb8')][_0xa5cb('0xb9')]({'isolationLevel':db[_0xa5cb('0xb8')]['Transaction'][_0xa5cb('0xba')][_0xa5cb('0xbb')]},function(_0x4ff3b1){return db[_0xa5cb('0x55')]['findOne']({'where':{'id':_0x5daa93},'transaction':_0x4ff3b1})[_0xa5cb('0x23')](function(_0xf820d3){if(_0xf820d3){return db[_0xa5cb('0x71')]['destroy']({'where':{'SmsAccountId':_0x5daa93},'transaction':_0x4ff3b1})[_0xa5cb('0x23')](function(){var _0x4fb1d0=_['map'](_0xe011a,function(_0x575c67){_0x575c67[_0xa5cb('0x67')]=_0x5daa93;return _0x575c67;});return db[_0xa5cb('0x71')][_0xa5cb('0xbc')](_0x4fb1d0,{'transaction':_0x4ff3b1});});}else{_0x58c411=0x194;_0x185879=[];}});})[_0xa5cb('0x23')](function(){if(_0x58c411!==0x194){return db[_0xa5cb('0x71')]['findAndCountAll']({'where':{'SmsAccountId':_0x5daa93},'order':_0xa5cb('0xbd')})['then'](function(_0x2fff9e){_0x185879=_0x2fff9e;});}})[_0xa5cb('0x2c')](function(_0x3487ee){_0x58c411=0x1f4;logger['error'](_0x3487ee[_0xa5cb('0x3c')]);if(_0x3487ee[_0xa5cb('0x3d')]){delete _0x3487ee['name'];}_0x185879=_0x3487ee;})[_0xa5cb('0xbe')](function(){if(_0x185879===null){_0x3f0538['sendStatus'](_0x58c411);}else{if(_0x58c411===0x1f4){_0x3f0538[_0xa5cb('0x2f')](_0x58c411)['send'](_0x185879);}else{_0x3f0538[_0xa5cb('0x2f')](_0x58c411)['json'](_0x185879);}}});};exports[_0xa5cb('0xbf')]=function(_0x4af396,_0x67767e,_0x89256b){var _0x546f70={};var _0x3f5484={};var _0xf38f57;var _0x491489;return db[_0xa5cb('0x55')]['findOne']({'where':{'id':_0x4af396[_0xa5cb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x67767e,null))['then'](function(_0x32b257){if(_0x32b257){_0xf38f57=_0x32b257;_0x3f5484[_0xa5cb('0x49')]=_[_0xa5cb('0x46')](db['SmsApplication'][_0xa5cb('0x42')]);_0x3f5484[_0xa5cb('0x45')]=_['keys'](_0x4af396[_0xa5cb('0x45')]);_0x3f5484[_0xa5cb('0x47')]=_[_0xa5cb('0x48')](_0x3f5484[_0xa5cb('0x49')],_0x3f5484[_0xa5cb('0x45')]);_0x546f70[_0xa5cb('0x4b')]=_[_0xa5cb('0x48')](_0x3f5484[_0xa5cb('0x49')],qs['fields'](_0x4af396[_0xa5cb('0x45')][_0xa5cb('0x4a')]));_0x546f70['attributes']=_0x546f70['attributes']['length']?_0x546f70[_0xa5cb('0x4b')]:_0x3f5484[_0xa5cb('0x49')];_0x546f70[_0xa5cb('0x4f')]=qs[_0xa5cb('0x50')](_0x4af396[_0xa5cb('0x45')][_0xa5cb('0x50')]);_0x546f70[_0xa5cb('0x51')]=qs[_0xa5cb('0x47')](_[_0xa5cb('0x52')](_0x4af396['query'],_0x3f5484['filters']));if(_0x4af396['query'][_0xa5cb('0x53')]){_0x546f70[_0xa5cb('0x51')]=_['merge'](_0x546f70[_0xa5cb('0x51')],{'$or':_[_0xa5cb('0x41')](_0x546f70[_0xa5cb('0x4b')],function(_0x2a4a8b){var _0x38b6d4={};_0x38b6d4[_0x2a4a8b]={'$like':'%'+_0x4af396['query'][_0xa5cb('0x53')]+'%'};return _0x38b6d4;})});}_0x546f70=_['merge']({},_0x546f70,_0x4af396[_0xa5cb('0x5c')]);return _0xf38f57[_0xa5cb('0xbf')](_0x546f70);}})['then'](function(_0x31aa99){if(_0x31aa99){_0x491489=_0x31aa99['length'];if(!_0x4af396[_0xa5cb('0x45')][_0xa5cb('0x4d')](_0xa5cb('0x4e'))){_0x546f70['limit']=qs[_0xa5cb('0x33')](_0x4af396[_0xa5cb('0x45')][_0xa5cb('0x33')]);_0x546f70[_0xa5cb('0x32')]=qs['offset'](_0x4af396[_0xa5cb('0x45')]['offset']);}return _0xf38f57[_0xa5cb('0xbf')](_0x546f70);}})[_0xa5cb('0x23')](function(_0x3a8344){if(_0x3a8344){return _0x3a8344?{'count':_0x491489,'rows':_0x3a8344}:null;}})[_0xa5cb('0x23')](respondWithResult(_0x67767e,null))['catch'](handleError(_0x67767e,null));};exports[_0xa5cb('0xc0')]=function(_0x1d1e03,_0x3f82c2,_0x1d14f7){var _0x11ee25={'raw':![],'where':{}};var _0x5c7012={};var _0x108884={'count':0x0,'rows':[]};return db[_0xa5cb('0x55')]['findOne']({'where':{'id':_0x1d1e03[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x3f82c2,null))[_0xa5cb('0x23')](function(_0x30b3f4){if(_0x30b3f4){_0x5c7012['model']=_['keys'](db[_0xa5cb('0x9e')]['rawAttributes']);_0x5c7012[_0xa5cb('0x45')]=_[_0xa5cb('0x46')](_0x1d1e03[_0xa5cb('0x45')]);_0x5c7012[_0xa5cb('0x47')]=_['intersection'](_0x5c7012[_0xa5cb('0x49')],_0x5c7012['query']);_0x11ee25[_0xa5cb('0x4b')]=_['intersection'](_0x5c7012['model'],qs[_0xa5cb('0x4a')](_0x1d1e03[_0xa5cb('0x45')][_0xa5cb('0x4a')]));_0x11ee25[_0xa5cb('0x4b')]=_0x11ee25[_0xa5cb('0x4b')][_0xa5cb('0x4c')]?_0x11ee25[_0xa5cb('0x4b')]:_0x5c7012[_0xa5cb('0x49')];if(!_0x1d1e03[_0xa5cb('0x45')][_0xa5cb('0x4d')](_0xa5cb('0x4e'))){_0x11ee25[_0xa5cb('0x33')]=qs[_0xa5cb('0x33')](_0x1d1e03['query']['limit']);_0x11ee25['offset']=qs[_0xa5cb('0x32')](_0x1d1e03[_0xa5cb('0x45')][_0xa5cb('0x32')]);}_0x11ee25[_0xa5cb('0x4f')]=qs[_0xa5cb('0x50')](_0x1d1e03['query']['sort']);_0x11ee25[_0xa5cb('0x51')]=qs['filters'](_[_0xa5cb('0x52')](_0x1d1e03[_0xa5cb('0x45')],_0x5c7012[_0xa5cb('0x47')]));_0x11ee25[_0xa5cb('0x51')][_0xa5cb('0x67')]=_0x30b3f4['id'];if(_0x1d1e03[_0xa5cb('0x45')]['filter']){_0x11ee25[_0xa5cb('0x51')]=_[_0xa5cb('0x54')](_0x11ee25[_0xa5cb('0x51')],{'$or':_[_0xa5cb('0x41')](_0x11ee25[_0xa5cb('0x4b')],function(_0x22079e){var _0x5b7fb1={};_0x5b7fb1[_0x22079e]={'$like':'%'+_0x1d1e03[_0xa5cb('0x45')]['filter']+'%'};return _0x5b7fb1;})});}_0x11ee25=_[_0xa5cb('0x54')]({},_0x11ee25,_0x1d1e03['options']);return db[_0xa5cb('0x9e')][_0xa5cb('0x31')]({'where':_0x11ee25[_0xa5cb('0x51')]})[_0xa5cb('0x23')](function(_0x1fc818){_0x108884[_0xa5cb('0x31')]=_0x1fc818;if(_0x1d1e03[_0xa5cb('0x45')][_0xa5cb('0x5b')]){_0x11ee25[_0xa5cb('0x56')]=[{'model':db['CmContact'],'as':_0xa5cb('0xc1'),'required':![]},{'model':db[_0xa5cb('0xa9')],'as':_0xa5cb('0xc2'),'attributes':[_0xa5cb('0x3d'),_0xa5cb('0xc3'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xa5cb('0xc4'),'attributes':['id',_0xa5cb('0x3d'),_0xa5cb('0xc5')],'where':_0x1d1e03[_0xa5cb('0x45')][_0xa5cb('0xc6')]?{'id':_0x1d1e03[_0xa5cb('0x45')][_0xa5cb('0xc6')]}:undefined,'required':_0x1d1e03[_0xa5cb('0x45')][_0xa5cb('0xc6')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x11ee25);})['then'](function(_0x1f28a8){_0x108884['rows']=_0x1f28a8;return _0x108884;});}})['then'](respondWithFilteredResult(_0x3f82c2,_0x11ee25))[_0xa5cb('0x2c')](handleError(_0x3f82c2,null));};exports[_0xa5cb('0x3e')]=function(_0x31020c,_0x11ba47,_0x4f016d){var _0x501cdf,_0x1af576,_0x5ce782;if(_[_0xa5cb('0x95')](_0x31020c[_0xa5cb('0x5f')][_0xa5cb('0x5f')])||_0x31020c[_0xa5cb('0x5f')]['body']===''){throw new db[(_0xa5cb('0x77'))][(_0xa5cb('0x78'))](_0xa5cb('0x97'));}if(_['isNil'](_0x31020c['body']['to'])){throw new db[(_0xa5cb('0x77'))][(_0xa5cb('0x78'))]('to\x20is\x20mandatory');}_0x501cdf=_0x31020c[_0xa5cb('0x5f')]['to'];return db[_0xa5cb('0x55')][_0xa5cb('0x5d')]({'where':{'id':_0x31020c[_0xa5cb('0x5a')]['id']},'include':[{'model':db[_0xa5cb('0x9b')],'as':_0xa5cb('0xc7'),'include':[{'model':db[_0xa5cb('0x76')],'as':'Contacts','where':{'mobile':_0x501cdf},'limit':0x1,'order':[[_0xa5cb('0x7b'),_0xa5cb('0xc8')]]}]}]})[_0xa5cb('0x23')](handleEntityNotFound(_0x11ba47,null))['then'](function(_0x3c7fca){if(_0x3c7fca&&_0x3c7fca[_0xa5cb('0xc7')]){_0x1af576=_0x3c7fca['get']({'plain':!![]});if(_0x1af576[_0xa5cb('0xc7')]&&_0x1af576[_0xa5cb('0xc7')][_0xa5cb('0x9c')]['length']){return _0x1af576[_0xa5cb('0xc7')][_0xa5cb('0x9c')][0x0];}return db[_0xa5cb('0x76')][_0xa5cb('0x5e')](_[_0xa5cb('0x1b')](_0x31020c[_0xa5cb('0x5f')],{'firstName':_0x501cdf,'mobile':_0x501cdf,'phone':_0x501cdf,'ListId':_0x1af576[_0xa5cb('0x7d')]}));}})[_0xa5cb('0x23')](handleEntityNotFound(_0x11ba47,null))[_0xa5cb('0x23')](function(_0x1d6ada){if(_0x1d6ada){_0x5ce782=_0x1d6ada;return db[_0xa5cb('0x9e')][_0xa5cb('0x5d')]({'where':{'ContactId':_0x5ce782['id'],'closed':![],'SmsAccountId':_0x1af576['id']}})[_0xa5cb('0x23')](function(_0x1022ca){if(_0x1022ca){return[_0x1022ca,![]];}return db[_0xa5cb('0x9e')][_0xa5cb('0x5e')]({'UserId':_0x31020c[_0xa5cb('0x60')]['id'],'ContactId':_0x5ce782['id'],'SmsAccountId':_0x1af576['id'],'phone':_0x501cdf,'firstMsgDirection':_0xa5cb('0xc9'),'Messages':[_[_0xa5cb('0x54')](_0x31020c['body'],{'read':![],'body':_0x31020c['body'][_0xa5cb('0x5f')],'phone':_0x501cdf,'SmsAccountId':_0x1af576['id'],'UserId':_0x31020c[_0xa5cb('0x60')]['id'],'ContactId':_0x5ce782['id']})]},{'include':[{'model':db[_0xa5cb('0xa6')],'as':'Messages'}]})['then'](function(_0x33ee8a){return[_0x33ee8a,!![]];});});}})[_0xa5cb('0xca')](function(_0x13ef5e,_0x250ffc){if(_0x250ffc){return _0x13ef5e;}return db[_0xa5cb('0xa6')][_0xa5cb('0x5e')](_[_0xa5cb('0x54')](_0x31020c[_0xa5cb('0x5f')],{'read':![],'body':_0x31020c['body']['body'],'phone':_0x501cdf,'SmsAccountId':_0x1af576['id'],'SmsInteractionId':_0x13ef5e['id'],'UserId':_0x31020c[_0xa5cb('0x60')]['id'],'ContactId':_0x5ce782['id']}))[_0xa5cb('0x23')](function(_0x448a11){_0x13ef5e[_0xa5cb('0xcb')][_0xa5cb('0xcc')]=[];_0x13ef5e[_0xa5cb('0xcb')][_0xa5cb('0xcc')][_0xa5cb('0xa2')](_0x448a11[_0xa5cb('0xcb')]);return _0x13ef5e;});})['then'](respondWithResult(_0x11ba47,null))[_0xa5cb('0x2c')](handleError(_0x11ba47,null));};exports[_0xa5cb('0x2f')]=function(_0x39fbeb,_0x21c4ff,_0x171a83){if(_0x39fbeb[_0xa5cb('0x5f')]['id']){delete _0x39fbeb[_0xa5cb('0x5f')]['id'];}var _0x395645,_0x4a3120,_0x58e722;return db[_0xa5cb('0x55')]['find']({'where':{'id':_0x39fbeb[_0xa5cb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x21c4ff,null))[_0xa5cb('0x23')](function(_0x1cc747){if(_0x1cc747){_0x58e722=_0x1cc747;logger[_0xa5cb('0xb3')](_0xa5cb('0xb1'),'status',_0xa5cb('0xcd'),_0x1cc747['type'],util[_0xa5cb('0xce')](_0x39fbeb[_0xa5cb('0x5f')],{'showHidden':![],'depth':null}));switch(_0x1cc747[_0xa5cb('0x43')]){case _0xa5cb('0x85'):if(_0x39fbeb[_0xa5cb('0x5f')]['skebby_dispatch_id']&&_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0x2f')]){_0x4a3120=_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0x2f')];return db[_0xa5cb('0xa6')][_0xa5cb('0x5d')]({'where':{'messageId':_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0xcf')]}});}break;case'connectel':if(_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0xd0')]&&_0x39fbeb[_0xa5cb('0x5f')]['statusInt']){_0x4a3120=_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0xd1')];return db[_0xa5cb('0xa6')][_0xa5cb('0x5d')]({'where':{'messageId':_0x39fbeb['body'][_0xa5cb('0xd0')]}});}break;case _0xa5cb('0x88'):if(_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0x89')]&&_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0xd2')]){_0x4a3120=_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0xd2')];return db[_0xa5cb('0xa6')]['find']({'where':{'messageId':_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0x89')]}});}break;case _0xa5cb('0x8c'):var _0x261ae3=_0x39fbeb[_0xa5cb('0x5f')]['results'][0x0];if(_0x261ae3['messageId']&&_0x261ae3[_0xa5cb('0x2f')][_0xa5cb('0xd3')]===_0xa5cb('0xd4')){_0x4a3120=_0x261ae3[_0xa5cb('0x2f')]['groupName'];return db['SmsMessage'][_0xa5cb('0x5d')]({'where':{'messageId':_0x261ae3[_0xa5cb('0x83')]}});}break;case'clickatell':if(_0x39fbeb['body'][_0xa5cb('0x83')]&&_0x39fbeb['body'][_0xa5cb('0x2f')]){_0x4a3120=_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0x2f')];return db[_0xa5cb('0xa6')][_0xa5cb('0x5d')]({'where':{'messageId':_0x39fbeb[_0xa5cb('0x5f')]['messageId']}});}break;case'bandwidth':if(_0x39fbeb['body'][0x0][_0xa5cb('0x2a')]['id']){_0x4a3120=_0x39fbeb['body'][0x0]['type'];return db['SmsMessage']['find']({'where':{'messageId':_0x39fbeb[_0xa5cb('0x5f')][0x0][_0xa5cb('0x2a')]['id']}});}break;case _0xa5cb('0x94'):if(_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0xd5')]&&_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0x2f')]){_0x4a3120=_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0x2f')];return db[_0xa5cb('0xa6')][_0xa5cb('0x5d')]({'where':{'messageId':_0x39fbeb[_0xa5cb('0x5f')][_0xa5cb('0xd5')]}});}break;}}})[_0xa5cb('0x23')](handleEntityNotFound(_0x21c4ff,null))[_0xa5cb('0x23')](function(_0x39e7a0){if(_0x39e7a0){_0x395645=_0x39e7a0;switch(_0x58e722[_0xa5cb('0x43')]){case'skebby':if(_0x4a3120==='DELIVERED'){return _0x395645[_0xa5cb('0x38')]({'read':!![]});}else{logger[_0xa5cb('0x28')](_0xa5cb('0xb1'),_0xa5cb('0x2f'),_0xa5cb('0x85'),util[_0xa5cb('0xce')](_0x39fbeb[_0xa5cb('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa5cb('0xd6'):if(_0x4a3120==='1'){return _0x395645[_0xa5cb('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa5cb('0x2f'),_0xa5cb('0x85'),util[_0xa5cb('0xce')](_0x39fbeb['body'],{'showHidden':![],'depth':null}));}break;case _0xa5cb('0x88'):if(!_0x39fbeb[_0xa5cb('0x5f')]['error_code']&&_0x4a3120>=0xc8&&_0x4a3120<=0xce){return _0x395645[_0xa5cb('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa5cb('0x2f'),_0xa5cb('0x88'),util[_0xa5cb('0xce')](_0x39fbeb['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x16d821=_0x39fbeb[_0xa5cb('0x5f')]['results'][0x0];if(_0x16d821['status'][_0xa5cb('0xd3')]===_0xa5cb('0xd4')){return _0x395645[_0xa5cb('0x38')]({'read':!![]});}else{logger[_0xa5cb('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa5cb('0x2f'),'infobip',util[_0xa5cb('0xce')](_0x39fbeb[_0xa5cb('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa5cb('0xd7'):if(_0x4a3120==_0xa5cb('0xd8')||_0x4a3120==_0xa5cb('0xd9')){return _0x395645[_0xa5cb('0x38')]({'read':!![]});}else{logger[_0xa5cb('0x28')](_0xa5cb('0xb1'),_0xa5cb('0x2f'),'clickatell',util[_0xa5cb('0xce')](_0x39fbeb[_0xa5cb('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa5cb('0x93'):if(_0x4a3120==_0xa5cb('0xda')){return _0x395645['update']({'read':!![]});}else{logger[_0xa5cb('0x28')](_0xa5cb('0xb1'),_0xa5cb('0x2f'),'bandwidth',util[_0xa5cb('0xce')](_0x39fbeb[_0xa5cb('0x5f')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4a3120===_0xa5cb('0xdb')||_0x4a3120==='ACCEPTD'){return _0x395645['update']({'read':!![]});}else{logger[_0xa5cb('0x28')](_0xa5cb('0xb1'),_0xa5cb('0x2f'),'intelepeer',util[_0xa5cb('0xce')](_0x39fbeb['body'],{'showHidden':![],'depth':null}));}break;}return _0x395645;}})[_0xa5cb('0x23')](respondWithResult(_0x21c4ff,null))['catch'](handleError(_0x21c4ff,null));};exports[_0xa5cb('0xdc')]=function(_0x1cec06,_0x3773ec,_0x670789){var _0x57ab82,_0x3b799e,_0x485929;return db[_0xa5cb('0x55')][_0xa5cb('0x5d')]({'where':{'id':_0x1cec06[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x3773ec,null))[_0xa5cb('0x23')](function(_0x40689e){if(_0x40689e){_0x485929=_0x40689e;logger['debug'](_0xa5cb('0xb1'),'status',_0xa5cb('0xcd'),_0x40689e[_0xa5cb('0x43')],util[_0xa5cb('0xce')](_0x1cec06[_0xa5cb('0x45')],{'showHidden':![],'depth':null}));switch(_0x40689e[_0xa5cb('0x43')]){case'csc':if(_0x1cec06[_0xa5cb('0x45')][_0xa5cb('0xdd')]&&_0x1cec06['query'][_0xa5cb('0xde')]){_0x3b799e=_0x1cec06[_0xa5cb('0x45')][_0xa5cb('0xde')];return db[_0xa5cb('0xa6')]['find']({'where':{'messageId':_0x1cec06[_0xa5cb('0x45')][_0xa5cb('0xdd')]}});}break;}}})['then'](handleEntityNotFound(_0x3773ec,null))[_0xa5cb('0x23')](function(_0x781f85){if(_0x781f85){_0x57ab82=_0x781f85;switch(_0x485929[_0xa5cb('0x43')]){case _0xa5cb('0x8e'):if(_0x3b799e==='2'||_0x3b799e==='6'){return _0x57ab82[_0xa5cb('0x38')]({'read':!![]});}else{logger[_0xa5cb('0x28')](_0xa5cb('0xb1'),_0xa5cb('0x2f'),'csc',util[_0xa5cb('0xce')](_0x1cec06[_0xa5cb('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x57ab82;}})[_0xa5cb('0x23')](respondWithResult(_0x3773ec,null))[_0xa5cb('0x2c')](handleError(_0x3773ec,null));};exports[_0xa5cb('0xdf')]=function(_0xc2b443,_0x5200ef,_0x5223e3){return db['SmsAccount']['find']({'where':{'id':_0xc2b443['params']['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x5200ef,null))[_0xa5cb('0x23')](function(_0xcf0a42){if(_0xcf0a42){return _0xcf0a42[_0xa5cb('0xdf')](_0xc2b443['body'][_0xa5cb('0x6b')],_[_0xa5cb('0x9d')](_0xc2b443[_0xa5cb('0x5f')],['ids','id'])||{})[_0xa5cb('0xca')](function(_0x5d2e82){for(var _0x75a51f=0x0;_0x75a51f<_0xc2b443[_0xa5cb('0x5f')][_0xa5cb('0x6b')][_0xa5cb('0x4c')];_0x75a51f+=0x1){socket[_0xa5cb('0xe0')]('userSmsAccount:save',{'UserId':Number(_0xc2b443[_0xa5cb('0x5f')][_0xa5cb('0x6b')][_0x75a51f]),'SmsAccountId':Number(_0xc2b443[_0xa5cb('0x5a')]['id'])});}return _0x5d2e82;});}})[_0xa5cb('0x23')](respondWithResult(_0x5200ef,null))[_0xa5cb('0x2c')](handleError(_0x5200ef,null));};exports['removeAgents']=function(_0x1234ff,_0x38787e,_0x34f598){return db['SmsAccount']['find']({'where':{'id':_0x1234ff[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x38787e,null))['then'](function(_0x43426a){if(_0x43426a){return _0x43426a[_0xa5cb('0xe1')](_0x1234ff[_0xa5cb('0x45')][_0xa5cb('0x6b')])['then'](function(){if(_['isArray'](_0x1234ff[_0xa5cb('0x45')]['ids'])){for(var _0x2635a2=0x0;_0x2635a2<_0x1234ff[_0xa5cb('0x45')][_0xa5cb('0x6b')][_0xa5cb('0x4c')];_0x2635a2+=0x1){socket['emit'](_0xa5cb('0xe2'),{'UserId':Number(_0x1234ff['query'][_0xa5cb('0x6b')][_0x2635a2]),'SmsAccountId':Number(_0x1234ff[_0xa5cb('0x5a')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x1234ff[_0xa5cb('0x45')]['ids']),'SmsAccountId':Number(_0x1234ff[_0xa5cb('0x5a')]['id'])});}});}})[_0xa5cb('0x23')](respondWithStatusCode(_0x38787e,null))[_0xa5cb('0x2c')](handleError(_0x38787e,null));};exports['getAgents']=function(_0x26c3d3,_0x49b0fa,_0x3ff5b7){var _0x148dc0={};var _0x5e3e67={};var _0x2dbbf8;var _0x1b0f97;return db[_0xa5cb('0x55')][_0xa5cb('0x68')]({'where':{'id':_0x26c3d3[_0xa5cb('0x5a')]['id']}})[_0xa5cb('0x23')](handleEntityNotFound(_0x49b0fa,null))[_0xa5cb('0x23')](function(_0x1c6835){if(_0x1c6835){_0x2dbbf8=_0x1c6835;_0x5e3e67[_0xa5cb('0x49')]=_[_0xa5cb('0x46')](db['User'][_0xa5cb('0x42')]);_0x5e3e67['query']=_[_0xa5cb('0x46')](_0x26c3d3[_0xa5cb('0x45')]);_0x5e3e67[_0xa5cb('0x47')]=_['intersection'](_0x5e3e67[_0xa5cb('0x49')],_0x5e3e67[_0xa5cb('0x45')]);_0x148dc0['attributes']=_[_0xa5cb('0x48')](_0x5e3e67[_0xa5cb('0x49')],qs[_0xa5cb('0x4a')](_0x26c3d3[_0xa5cb('0x45')]['fields']));_0x148dc0['attributes']=_0x148dc0['attributes'][_0xa5cb('0x4c')]?_0x148dc0['attributes']:_0x5e3e67[_0xa5cb('0x49')];_0x148dc0[_0xa5cb('0x4f')]=qs[_0xa5cb('0x50')](_0x26c3d3[_0xa5cb('0x45')][_0xa5cb('0x50')]);_0x148dc0[_0xa5cb('0x51')]=qs[_0xa5cb('0x47')](_[_0xa5cb('0x52')](_0x26c3d3[_0xa5cb('0x45')],_0x5e3e67['filters']));if(_0x26c3d3[_0xa5cb('0x45')][_0xa5cb('0x53')]){_0x148dc0['where']=_[_0xa5cb('0x54')](_0x148dc0[_0xa5cb('0x51')],{'$or':_['map'](_0x148dc0[_0xa5cb('0x4b')],function(_0x3dfc46){var _0x367d1c={};_0x367d1c[_0x3dfc46]={'$like':'%'+_0x26c3d3[_0xa5cb('0x45')][_0xa5cb('0x53')]+'%'};return _0x367d1c;})});}_0x148dc0=_['merge']({},_0x148dc0,_0x26c3d3[_0xa5cb('0x5c')]);return _0x2dbbf8[_0xa5cb('0xe3')](_0x148dc0);}})[_0xa5cb('0x23')](function(_0x5741e3){if(_0x5741e3){_0x1b0f97=_0x5741e3[_0xa5cb('0x4c')];if(!_0x26c3d3[_0xa5cb('0x45')][_0xa5cb('0x4d')](_0xa5cb('0x4e'))){_0x148dc0[_0xa5cb('0x33')]=qs[_0xa5cb('0x33')](_0x26c3d3[_0xa5cb('0x45')][_0xa5cb('0x33')]);_0x148dc0['offset']=qs[_0xa5cb('0x32')](_0x26c3d3[_0xa5cb('0x45')][_0xa5cb('0x32')]);}return _0x2dbbf8[_0xa5cb('0xe3')](_0x148dc0);}})[_0xa5cb('0x23')](function(_0x4d88dd){if(_0x4d88dd){return _0x4d88dd?{'count':_0x1b0f97,'rows':_0x4d88dd}:null;}})[_0xa5cb('0x23')](respondWithResult(_0x49b0fa,null))[_0xa5cb('0x2c')](handleError(_0x49b0fa,null));};
\ No newline at end of file
index 915b89c..cc1d50c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x482c=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','SmsAccount'];(function(_0x452b8e,_0x441d1e){var _0x2803f9=function(_0x200098){while(--_0x200098){_0x452b8e['push'](_0x452b8e['shift']());}};_0x2803f9(++_0x441d1e);}(_0x482c,0x178));var _0xc482=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x482c[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xc482('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xc482('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc482('0x2')](0x0);var events={'afterCreate':_0xc482('0x3'),'afterUpdate':'update','afterDestroy':_0xc482('0x4')};function emitEvent(_0x4f6cd2){return function(_0x25ab29,_0xe818e,_0x49c893){SmsAccountEvents[_0xc482('0x5')](_0x4f6cd2+':'+_0x25ab29['id'],_0x25ab29);SmsAccountEvents[_0xc482('0x5')](_0x4f6cd2,_0x25ab29);_0x49c893(null);};}for(var e in events){if(events[_0xc482('0x6')](e)){var event=events[e];SmsAccount[_0xc482('0x7')](e,emitEvent(event));}}module[_0xc482('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0x1619=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount'];(function(_0x498eeb,_0x3eb8b5){var _0x19f67f=function(_0x32100d){while(--_0x32100d){_0x498eeb['push'](_0x498eeb['shift']());}};_0x19f67f(++_0x3eb8b5);}(_0x1619,0x17e));var _0x9161=function(_0x5b6dd3,_0x420e7d){_0x5b6dd3=_0x5b6dd3-0x0;var _0x104703=_0x1619[_0x5b6dd3];return _0x104703;};'use strict';var EventEmitter=require(_0x9161('0x0'));var SmsAccount=require(_0x9161('0x1'))['db'][_0x9161('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9161('0x3')](0x0);var events={'afterCreate':_0x9161('0x4'),'afterUpdate':_0x9161('0x5'),'afterDestroy':_0x9161('0x6')};function emitEvent(_0x1d44f7){return function(_0x3334ec,_0x5b8ac0,_0x4b884b){SmsAccountEvents['emit'](_0x1d44f7+':'+_0x3334ec['id'],_0x3334ec);SmsAccountEvents[_0x9161('0x7')](_0x1d44f7,_0x3334ec);_0x4b884b(null);};}for(var e in events){if(events[_0x9161('0x8')](e)){var event=events[e];SmsAccount[_0x9161('0x9')](e,emitEvent(event));}}module[_0x9161('0xa')]=SmsAccountEvents;
\ No newline at end of file
index 1511fd7..79e9c23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b70=['moment','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','../../config/logger','api'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4b70,0xc3));var _0x04b7=function(_0xfbbdcd,_0xfe860b){_0xfbbdcd=_0xfbbdcd-0x0;var _0x151333=_0x4b70[_0xfbbdcd];return _0x151333;};'use strict';var _=require(_0x04b7('0x0'));var util=require('util');var logger=require(_0x04b7('0x1'))(_0x04b7('0x2'));var moment=require(_0x04b7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x04b7('0x4'));var rimraf=require(_0x04b7('0x5'));var config=require(_0x04b7('0x6'));var attributes=require(_0x04b7('0x7'));module['exports']=function(_0x49eaf3,_0xfb23d6){return _0x49eaf3[_0x04b7('0x8')](_0x04b7('0x9'),attributes,{'tableName':_0x04b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a50=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','api','moment','request-promise'];(function(_0x627598,_0x1822f3){var _0x43517a=function(_0x49eb54){while(--_0x49eb54){_0x627598['push'](_0x627598['shift']());}};_0x43517a(++_0x1822f3);}(_0x3a50,0xcd));var _0x03a5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3a50[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x03a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x03a5('0x1'));var moment=require(_0x03a5('0x2'));var BPromise=require('bluebird');var rp=require(_0x03a5('0x3'));var fs=require('fs');var path=require(_0x03a5('0x4'));var rimraf=require(_0x03a5('0x5'));var config=require(_0x03a5('0x6'));var attributes=require(_0x03a5('0x7'));module[_0x03a5('0x8')]=function(_0x2f1970,_0x467fab){return _0x2f1970['define'](_0x03a5('0x9'),attributes,{'tableName':_0x03a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be06666..de22b27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75dc=['info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','options','raw','where','include','model','map','attributes','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','./smsAccount.socket','request','then'];(function(_0x3e8474,_0x2cbe02){var _0x3f33f7=function(_0x1c9d67){while(--_0x1c9d67){_0x3e8474['push'](_0x3e8474['shift']());}};_0x3f33f7(++_0x2cbe02);}(_0x75dc,0xa8));var _0xc75d=function(_0x4a746e,_0x3166c0){_0x4a746e=_0x4a746e-0x0;var _0x451a87=_0x75dc[_0x4a746e];return _0x451a87;};'use strict';var _=require('lodash');var util=require(_0xc75d('0x0'));var moment=require(_0xc75d('0x1'));var BPromise=require(_0xc75d('0x2'));var rs=require(_0xc75d('0x3'));var fs=require('fs');var Redis=require(_0xc75d('0x4'));var db=require(_0xc75d('0x5'))['db'];var utils=require(_0xc75d('0x6'));var logger=require(_0xc75d('0x7'))(_0xc75d('0x8'));var config=require(_0xc75d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc75d('0xa')]['http']({'port':0x232a});config['redis']=_[_0xc75d('0xb')](config[_0xc75d('0xc')],{'host':_0xc75d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc75d('0xc')]));require(_0xc75d('0xe'))['register'](socket);function respondWithRpcPromise(_0x26f9f4,_0x583695,_0x24dee4){return new BPromise(function(_0x343c24,_0x244714){return client[_0xc75d('0xf')](_0x26f9f4,_0x24dee4)[_0xc75d('0x10')](function(_0x58d996){logger[_0xc75d('0x11')](_0xc75d('0x12'),_0x583695,_0xc75d('0x13'));logger[_0xc75d('0x14')](_0xc75d('0x15'),_0x583695,_0xc75d('0x13'),JSON[_0xc75d('0x16')](_0x58d996));if(_0x58d996[_0xc75d('0x17')]){if(_0x58d996[_0xc75d('0x17')][_0xc75d('0x18')]===0x1f4){logger['error'](_0xc75d('0x12'),_0x583695,_0x58d996[_0xc75d('0x17')][_0xc75d('0x19')]);return _0x244714(_0x58d996['error']['message']);}logger['error'](_0xc75d('0x12'),_0x583695,_0x58d996[_0xc75d('0x17')][_0xc75d('0x19')]);return _0x343c24(_0x58d996[_0xc75d('0x17')][_0xc75d('0x19')]);}else{logger[_0xc75d('0x11')](_0xc75d('0x12'),_0x583695,_0xc75d('0x13'));_0x343c24(_0x58d996[_0xc75d('0x1a')][_0xc75d('0x19')]);}})['catch'](function(_0x16394d){logger[_0xc75d('0x17')](_0xc75d('0x12'),_0x583695,_0x16394d);_0x244714(_0x16394d);});});}exports[_0xc75d('0x1b')]=function(_0x184e96){var _0x131099=this;return new Promise(function(_0xd9ea97,_0xbc6e54){return db[_0xc75d('0x1c')]['find']({'raw':_0x184e96[_0xc75d('0x1d')]?_0x184e96[_0xc75d('0x1d')][_0xc75d('0x1e')]===undefined?!![]:![]:!![],'where':_0x184e96[_0xc75d('0x1d')]?_0x184e96[_0xc75d('0x1d')][_0xc75d('0x1f')]||null:null,'attributes':_0x184e96[_0xc75d('0x1d')]?_0x184e96[_0xc75d('0x1d')]['attributes']||null:null,'include':_0x184e96[_0xc75d('0x1d')]?_0x184e96['options'][_0xc75d('0x20')]?_['map'](_0x184e96[_0xc75d('0x1d')][_0xc75d('0x20')],function(_0x55cd18){return{'model':db[_0x55cd18[_0xc75d('0x21')]],'as':_0x55cd18['as'],'attributes':_0x55cd18['attributes'],'include':_0x55cd18[_0xc75d('0x20')]?_[_0xc75d('0x22')](_0x55cd18[_0xc75d('0x20')],function(_0x2a5163){return{'model':db[_0x2a5163[_0xc75d('0x21')]],'as':_0x2a5163['as'],'attributes':_0x2a5163[_0xc75d('0x23')],'include':_0x2a5163[_0xc75d('0x20')]?_[_0xc75d('0x22')](_0x2a5163['include'],function(_0x533a06){return{'model':db[_0x533a06[_0xc75d('0x21')]],'as':_0x533a06['as'],'attributes':_0x533a06['attributes']};}):[]};}):[]};}):[]:[]})[_0xc75d('0x10')](function(_0xbfe226){logger[_0xc75d('0x11')](_0xc75d('0x1b'),_0x184e96);logger['debug']('ShowSmsAccount',_0x184e96,JSON[_0xc75d('0x16')](_0xbfe226));_0xd9ea97(_0xbfe226);})[_0xc75d('0x24')](function(_0x194740){logger['error'](_0xc75d('0x1b'),_0x194740[_0xc75d('0x19')],_0x184e96);_0xbc6e54(_0x131099[_0xc75d('0x17')](0x1f4,_0x194740['message']));});});};
\ No newline at end of file
+var _0xe5bf=['debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SmsAccount','find','options','raw','where','attributes','include','model','ShowSmsAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s'];(function(_0x5b14f8,_0x4d84e3){var _0x53809b=function(_0x3f530d){while(--_0x3f530d){_0x5b14f8['push'](_0x5b14f8['shift']());}};_0x53809b(++_0x4d84e3);}(_0xe5bf,0x19d));var _0xfe5b=function(_0x406fd6,_0x386756){_0x406fd6=_0x406fd6-0x0;var _0x446608=_0xe5bf[_0x406fd6];return _0x446608;};'use strict';var _=require(_0xfe5b('0x0'));var util=require('util');var moment=require(_0xfe5b('0x1'));var BPromise=require(_0xfe5b('0x2'));var rs=require(_0xfe5b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe5b('0x4'))['db'];var utils=require(_0xfe5b('0x5'));var logger=require(_0xfe5b('0x6'))('rpc');var config=require(_0xfe5b('0x7'));var jayson=require(_0xfe5b('0x8'));var client=jayson['client'][_0xfe5b('0x9')]({'port':0x232a});config['redis']=_[_0xfe5b('0xa')](config[_0xfe5b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe5b('0xc'))(new Redis(config[_0xfe5b('0xb')]));require(_0xfe5b('0xd'))[_0xfe5b('0xe')](socket);function respondWithRpcPromise(_0x583390,_0xe8d62c,_0x1a4453){return new BPromise(function(_0x173744,_0x4922f6){return client[_0xfe5b('0xf')](_0x583390,_0x1a4453)[_0xfe5b('0x10')](function(_0x557161){logger[_0xfe5b('0x11')](_0xfe5b('0x12'),_0xe8d62c,'request\x20sent');logger[_0xfe5b('0x13')](_0xfe5b('0x14'),_0xe8d62c,_0xfe5b('0x15'),JSON[_0xfe5b('0x16')](_0x557161));if(_0x557161[_0xfe5b('0x17')]){if(_0x557161[_0xfe5b('0x17')]['code']===0x1f4){logger[_0xfe5b('0x17')](_0xfe5b('0x12'),_0xe8d62c,_0x557161[_0xfe5b('0x17')][_0xfe5b('0x18')]);return _0x4922f6(_0x557161[_0xfe5b('0x17')]['message']);}logger[_0xfe5b('0x17')]('SmsAccount,\x20%s,\x20%s',_0xe8d62c,_0x557161[_0xfe5b('0x17')]['message']);return _0x173744(_0x557161[_0xfe5b('0x17')]['message']);}else{logger[_0xfe5b('0x11')](_0xfe5b('0x12'),_0xe8d62c,_0xfe5b('0x15'));_0x173744(_0x557161[_0xfe5b('0x19')]['message']);}})[_0xfe5b('0x1a')](function(_0xcdc653){logger[_0xfe5b('0x17')](_0xfe5b('0x12'),_0xe8d62c,_0xcdc653);_0x4922f6(_0xcdc653);});});}exports['ShowSmsAccount']=function(_0x138828){var _0x35a313=this;return new Promise(function(_0x1f7a05,_0x2da389){return db[_0xfe5b('0x1b')][_0xfe5b('0x1c')]({'raw':_0x138828[_0xfe5b('0x1d')]?_0x138828['options'][_0xfe5b('0x1e')]===undefined?!![]:![]:!![],'where':_0x138828[_0xfe5b('0x1d')]?_0x138828['options'][_0xfe5b('0x1f')]||null:null,'attributes':_0x138828[_0xfe5b('0x1d')]?_0x138828[_0xfe5b('0x1d')][_0xfe5b('0x20')]||null:null,'include':_0x138828[_0xfe5b('0x1d')]?_0x138828[_0xfe5b('0x1d')][_0xfe5b('0x21')]?_['map'](_0x138828['options']['include'],function(_0x5681eb){return{'model':db[_0x5681eb[_0xfe5b('0x22')]],'as':_0x5681eb['as'],'attributes':_0x5681eb[_0xfe5b('0x20')],'include':_0x5681eb[_0xfe5b('0x21')]?_['map'](_0x5681eb['include'],function(_0x37416d){return{'model':db[_0x37416d[_0xfe5b('0x22')]],'as':_0x37416d['as'],'attributes':_0x37416d[_0xfe5b('0x20')],'include':_0x37416d[_0xfe5b('0x21')]?_['map'](_0x37416d[_0xfe5b('0x21')],function(_0x3e4d43){return{'model':db[_0x3e4d43[_0xfe5b('0x22')]],'as':_0x3e4d43['as'],'attributes':_0x3e4d43[_0xfe5b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfe5b('0x10')](function(_0x5d4459){logger['info'](_0xfe5b('0x23'),_0x138828);logger['debug'](_0xfe5b('0x23'),_0x138828,JSON[_0xfe5b('0x16')](_0x5d4459));_0x1f7a05(_0x5d4459);})[_0xfe5b('0x1a')](function(_0x207e27){logger['error'](_0xfe5b('0x23'),_0x207e27[_0xfe5b('0x18')],_0x138828);_0x2da389(_0x35a313[_0xfe5b('0x17')](0x1f4,_0x207e27['message']));});});};
\ No newline at end of file
index 8fbd1e9..2985b61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index b5e11f0..2fff58b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x180f5f,_0x3d347a){var _0x5ae7c9=function(_0x5b642d){while(--_0x5b642d){_0x180f5f['push'](_0x180f5f['shift']());}};_0x5ae7c9(++_0x3d347a);}(_0xedd9,0xfc));var _0x9edd=function(_0x5f5b2f,_0x1863c4){_0x5f5b2f=_0x5f5b2f-0x0;var _0x16c260=_0xedd9[_0x5f5b2f];return _0x16c260;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x4d4671,_0x21cefe){var _0x16436f=function(_0x455a90){while(--_0x455a90){_0x4d4671['push'](_0x4d4671['shift']());}};_0x16436f(++_0x21cefe);}(_0x55ca,0x126));var _0xa55c=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x55ca[_0x3e44fa];return _0x2a0aba;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router;
\ No newline at end of file
index 7e72afc..ffb62fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c8f=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x1b5e52,_0x242ef1){var _0x285966=function(_0x4345f8){while(--_0x4345f8){_0x1b5e52['push'](_0x1b5e52['shift']());}};_0x285966(++_0x242ef1);}(_0x2c8f,0x1da));var _0xf2c8=function(_0x15439e,_0x56e9c1){_0x15439e=_0x15439e-0x0;var _0x2624d3=_0x2c8f[_0x15439e];return _0x2624d3;};'use strict';var Sequelize=require(_0xf2c8('0x0'));module[_0xf2c8('0x1')]={'priority':{'type':Sequelize[_0xf2c8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf2c8('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf2c8('0x4')]()},'description':{'type':Sequelize[_0xf2c8('0x3')]},'interval':{'type':Sequelize[_0xf2c8('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x4b67=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x4b67,0xb8));var _0x74b6=function(_0x30c6a2,_0x5cee83){_0x30c6a2=_0x30c6a2-0x0;var _0x35d412=_0x4b67[_0x30c6a2];return _0x35d412;};'use strict';var Sequelize=require('sequelize');module[_0x74b6('0x0')]={'priority':{'type':Sequelize[_0x74b6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x74b6('0x2')],'allowNull':![],'defaultValue':_0x74b6('0x3')},'appdata':{'type':Sequelize[_0x74b6('0x4')]()},'description':{'type':Sequelize[_0x74b6('0x2')]},'interval':{'type':Sequelize[_0x74b6('0x2')],'defaultValue':_0x74b6('0x5')}};
\ No newline at end of file
index 087aa83..c197f3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5310=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','json','reject','update','then','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','include','SmsApplication','rows','catch','show','intersection','includeAll','options','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch'];(function(_0x42e541,_0x9d9d38){var _0x8b3436=function(_0x116847){while(--_0x116847){_0x42e541['push'](_0x42e541['shift']());}};_0x8b3436(++_0x9d9d38);}(_0x5310,0xd5));var _0x0531=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x5310[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0531('0x0'));var zipdir=require(_0x0531('0x1'));var jsonpatch=require(_0x0531('0x2'));var rp=require(_0x0531('0x3'));var moment=require(_0x0531('0x4'));var BPromise=require(_0x0531('0x5'));var Mustache=require(_0x0531('0x6'));var util=require(_0x0531('0x7'));var path=require(_0x0531('0x8'));var sox=require(_0x0531('0x9'));var csv=require(_0x0531('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0531('0xb'));var _=require(_0x0531('0xc'));var squel=require(_0x0531('0xd'));var crypto=require(_0x0531('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0531('0xf'));var toCsv=require(_0x0531('0xa'));var querystring=require(_0x0531('0x10'));var Papa=require('papaparse');var Redis=require(_0x0531('0x11'));var authService=require(_0x0531('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0531('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0531('0x14'));var utils=require(_0x0531('0x15'));var config=require(_0x0531('0x16'));var licenseUtil=require(_0x0531('0x17'));var db=require(_0x0531('0x18'))['db'];function respondWithStatusCode(_0x202d74,_0x109fca){_0x109fca=_0x109fca||0xcc;return function(_0x596bcf){if(_0x596bcf){return _0x202d74['sendStatus'](_0x109fca);}return _0x202d74[_0x0531('0x19')](_0x109fca)['end']();};}function respondWithResult(_0x3704dd,_0x4ec30b){_0x4ec30b=_0x4ec30b||0xc8;return function(_0x56d115){if(_0x56d115){return _0x3704dd[_0x0531('0x19')](_0x4ec30b)['json'](_0x56d115);}};}function respondWithFilteredResult(_0x2d4146,_0x2197d4){return function(_0x1356f4){if(_0x1356f4){var _0x27dfe1=typeof _0x2197d4[_0x0531('0x1a')]===_0x0531('0x1b')&&typeof _0x2197d4['limit']===_0x0531('0x1b');var _0x575f26=_0x1356f4[_0x0531('0x1c')];var _0x3db8a2=_0x27dfe1?0x0:_0x2197d4[_0x0531('0x1a')];var _0x52f0de=_0x27dfe1?_0x1356f4[_0x0531('0x1c')]:_0x2197d4[_0x0531('0x1a')]+_0x2197d4['limit'];var _0x3b6dfb;if(_0x52f0de>=_0x575f26){_0x52f0de=_0x575f26;_0x3b6dfb=0xc8;}else{_0x3b6dfb=0xce;}_0x2d4146[_0x0531('0x19')](_0x3b6dfb);return _0x2d4146[_0x0531('0x1d')](_0x0531('0x1e'),_0x3db8a2+'-'+_0x52f0de+'/'+_0x575f26)[_0x0531('0x1f')](_0x1356f4);}return null;};}function patchUpdates(_0xa62879){return function(_0x190863){try{jsonpatch['apply'](_0x190863,_0xa62879,!![]);}catch(_0x17abeb){return BPromise[_0x0531('0x20')](_0x17abeb);}return _0x190863['save']();};}function saveUpdates(_0x5a7912,_0x484dd7){return function(_0x35258b){if(_0x35258b){return _0x35258b[_0x0531('0x21')](_0x5a7912)[_0x0531('0x22')](function(_0x42a8cc){return _0x42a8cc;});}return null;};}function removeEntity(_0x59fb6f,_0x3eceee){return function(_0x4d6c18){if(_0x4d6c18){return _0x4d6c18['destroy']()[_0x0531('0x22')](function(){_0x59fb6f[_0x0531('0x19')](0xcc)[_0x0531('0x23')]();});}};}function handleEntityNotFound(_0x2fe320,_0x4d4f0a){return function(_0x53c1a6){if(!_0x53c1a6){_0x2fe320[_0x0531('0x24')](0x194);}return _0x53c1a6;};}function handleError(_0x57bc13,_0x34a086){_0x34a086=_0x34a086||0x1f4;return function(_0x16e0cc){logger['error'](_0x16e0cc[_0x0531('0x25')]);if(_0x16e0cc[_0x0531('0x26')]){delete _0x16e0cc['name'];}_0x57bc13[_0x0531('0x19')](_0x34a086)['send'](_0x16e0cc);};}exports[_0x0531('0x27')]=function(_0xe7a4aa,_0x4d0175){var _0x4435f4={},_0x57668b={},_0x434bbd={'count':0x0,'rows':[]};var _0x58f6f2=_[_0x0531('0x28')](db['SmsApplication'][_0x0531('0x29')],function(_0x1515b5){return{'name':_0x1515b5[_0x0531('0x2a')],'type':_0x1515b5[_0x0531('0x2b')][_0x0531('0x2c')]};});_0x57668b[_0x0531('0x2d')]=_['map'](_0x58f6f2,_0x0531('0x26'));_0x57668b[_0x0531('0x2e')]=_[_0x0531('0x2f')](_0xe7a4aa[_0x0531('0x2e')]);_0x57668b[_0x0531('0x30')]=_['intersection'](_0x57668b[_0x0531('0x2d')],_0x57668b['query']);_0x4435f4[_0x0531('0x31')]=_['intersection'](_0x57668b[_0x0531('0x2d')],qs[_0x0531('0x32')](_0xe7a4aa[_0x0531('0x2e')][_0x0531('0x32')]));_0x4435f4[_0x0531('0x31')]=_0x4435f4[_0x0531('0x31')][_0x0531('0x33')]?_0x4435f4['attributes']:_0x57668b[_0x0531('0x2d')];if(!_0xe7a4aa[_0x0531('0x2e')]['hasOwnProperty'](_0x0531('0x34'))){_0x4435f4[_0x0531('0x35')]=qs[_0x0531('0x35')](_0xe7a4aa[_0x0531('0x2e')]['limit']);_0x4435f4['offset']=qs[_0x0531('0x1a')](_0xe7a4aa[_0x0531('0x2e')][_0x0531('0x1a')]);}_0x4435f4[_0x0531('0x36')]=qs['sort'](_0xe7a4aa[_0x0531('0x2e')][_0x0531('0x37')]);_0x4435f4[_0x0531('0x38')]=qs[_0x0531('0x30')](_['pick'](_0xe7a4aa[_0x0531('0x2e')],_0x57668b[_0x0531('0x30')]),_0x58f6f2);if(_0xe7a4aa[_0x0531('0x2e')]['filter']){_0x4435f4[_0x0531('0x38')]=_['merge'](_0x4435f4[_0x0531('0x38')],{'$or':_[_0x0531('0x28')](_0x58f6f2,function(_0x4250c9){if(_0x4250c9[_0x0531('0x2b')]!=='VIRTUAL'){var _0x2ecd4a={};_0x2ecd4a[_0x4250c9[_0x0531('0x26')]]={'$like':'%'+_0xe7a4aa[_0x0531('0x2e')][_0x0531('0x39')]+'%'};return _0x2ecd4a;}})});}_0x4435f4=_[_0x0531('0x3a')]({},_0x4435f4,_0xe7a4aa['options']);var _0x4fbf75={'where':_0x4435f4[_0x0531('0x38')]};return db['SmsApplication'][_0x0531('0x1c')](_0x4fbf75)['then'](function(_0x25b2d1){_0x434bbd[_0x0531('0x1c')]=_0x25b2d1;if(_0xe7a4aa['query']['includeAll']){_0x4435f4[_0x0531('0x3b')]=[{'all':!![]}];}return db[_0x0531('0x3c')]['findAll'](_0x4435f4);})['then'](function(_0x37f1d1){_0x434bbd[_0x0531('0x3d')]=_0x37f1d1;return _0x434bbd;})[_0x0531('0x22')](respondWithFilteredResult(_0x4d0175,_0x4435f4))[_0x0531('0x3e')](handleError(_0x4d0175,null));};exports[_0x0531('0x3f')]=function(_0x5fcf83,_0x5e4b47){var _0x229316={'raw':!![],'where':{'id':_0x5fcf83['params']['id']}},_0x55395d={};_0x55395d[_0x0531('0x2d')]=_[_0x0531('0x2f')](db['SmsApplication']['rawAttributes']);_0x55395d[_0x0531('0x2e')]=_[_0x0531('0x2f')](_0x5fcf83['query']);_0x55395d[_0x0531('0x30')]=_[_0x0531('0x40')](_0x55395d[_0x0531('0x2d')],_0x55395d[_0x0531('0x2e')]);_0x229316[_0x0531('0x31')]=_[_0x0531('0x40')](_0x55395d[_0x0531('0x2d')],qs[_0x0531('0x32')](_0x5fcf83[_0x0531('0x2e')][_0x0531('0x32')]));_0x229316['attributes']=_0x229316[_0x0531('0x31')][_0x0531('0x33')]?_0x229316['attributes']:_0x55395d['model'];if(_0x5fcf83[_0x0531('0x2e')][_0x0531('0x41')]){_0x229316['include']=[{'all':!![]}];}_0x229316=_['merge']({},_0x229316,_0x5fcf83[_0x0531('0x42')]);return db['SmsApplication'][_0x0531('0x43')](_0x229316)[_0x0531('0x22')](handleEntityNotFound(_0x5e4b47,null))[_0x0531('0x22')](respondWithResult(_0x5e4b47,null))['catch'](handleError(_0x5e4b47,null));};exports['create']=function(_0x4332ba,_0x55dbe5){return db[_0x0531('0x3c')][_0x0531('0x44')](_0x4332ba[_0x0531('0x45')],{})[_0x0531('0x22')](respondWithResult(_0x55dbe5,0xc9))[_0x0531('0x3e')](handleError(_0x55dbe5,null));};exports[_0x0531('0x21')]=function(_0x123719,_0x5cb912){if(_0x123719[_0x0531('0x45')]['id']){delete _0x123719[_0x0531('0x45')]['id'];}return db[_0x0531('0x3c')][_0x0531('0x43')]({'where':{'id':_0x123719[_0x0531('0x46')]['id']}})[_0x0531('0x22')](handleEntityNotFound(_0x5cb912,null))[_0x0531('0x22')](saveUpdates(_0x123719[_0x0531('0x45')],null))[_0x0531('0x22')](respondWithResult(_0x5cb912,null))[_0x0531('0x3e')](handleError(_0x5cb912,null));};exports[_0x0531('0x47')]=function(_0x13c0e4,_0x383044){return db['SmsApplication'][_0x0531('0x43')]({'where':{'id':_0x13c0e4[_0x0531('0x46')]['id']}})[_0x0531('0x22')](handleEntityNotFound(_0x383044,null))[_0x0531('0x22')](removeEntity(_0x383044,null))['catch'](handleError(_0x383044,null));};
\ No newline at end of file
+var _0xc379=['reject','save','destroy','then','error','name','send','index','SmsApplication','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','update','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc379,0x1a4));var _0x9c37=function(_0x1ebfa4,_0x29e901){_0x1ebfa4=_0x1ebfa4-0x0;var _0x5f3dae=_0xc379[_0x1ebfa4];return _0x5f3dae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c37('0x0'));var jsonpatch=require(_0x9c37('0x1'));var rp=require(_0x9c37('0x2'));var moment=require('moment');var BPromise=require(_0x9c37('0x3'));var Mustache=require(_0x9c37('0x4'));var util=require(_0x9c37('0x5'));var path=require(_0x9c37('0x6'));var sox=require(_0x9c37('0x7'));var csv=require(_0x9c37('0x8'));var ejs=require(_0x9c37('0x9'));var fs=require('fs');var fs_extra=require(_0x9c37('0xa'));var _=require(_0x9c37('0xb'));var squel=require(_0x9c37('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c37('0xd'));var deskjs=require(_0x9c37('0xe'));var toCsv=require(_0x9c37('0x8'));var querystring=require(_0x9c37('0xf'));var Papa=require(_0x9c37('0x10'));var Redis=require('ioredis');var authService=require(_0x9c37('0x11'));var qs=require(_0x9c37('0x12'));var as=require(_0x9c37('0x13'));var hardwareService=require(_0x9c37('0x14'));var logger=require(_0x9c37('0x15'))(_0x9c37('0x16'));var utils=require(_0x9c37('0x17'));var config=require(_0x9c37('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bcb21,_0x32f4f6){_0x32f4f6=_0x32f4f6||0xcc;return function(_0x4ed5d9){if(_0x4ed5d9){return _0x3bcb21[_0x9c37('0x19')](_0x32f4f6);}return _0x3bcb21[_0x9c37('0x1a')](_0x32f4f6)[_0x9c37('0x1b')]();};}function respondWithResult(_0x500a6d,_0x393f07){_0x393f07=_0x393f07||0xc8;return function(_0x1a0a52){if(_0x1a0a52){return _0x500a6d[_0x9c37('0x1a')](_0x393f07)[_0x9c37('0x1c')](_0x1a0a52);}};}function respondWithFilteredResult(_0x220073,_0x3ef884){return function(_0x2587a0){if(_0x2587a0){var _0x4df56e=typeof _0x3ef884[_0x9c37('0x1d')]==='undefined'&&typeof _0x3ef884[_0x9c37('0x1e')]===_0x9c37('0x1f');var _0x4321ec=_0x2587a0[_0x9c37('0x20')];var _0x230ad3=_0x4df56e?0x0:_0x3ef884['offset'];var _0x58db01=_0x4df56e?_0x2587a0['count']:_0x3ef884[_0x9c37('0x1d')]+_0x3ef884[_0x9c37('0x1e')];var _0x2b2ae5;if(_0x58db01>=_0x4321ec){_0x58db01=_0x4321ec;_0x2b2ae5=0xc8;}else{_0x2b2ae5=0xce;}_0x220073[_0x9c37('0x1a')](_0x2b2ae5);return _0x220073[_0x9c37('0x21')](_0x9c37('0x22'),_0x230ad3+'-'+_0x58db01+'/'+_0x4321ec)[_0x9c37('0x1c')](_0x2587a0);}return null;};}function patchUpdates(_0x4afab5){return function(_0x358426){try{jsonpatch[_0x9c37('0x23')](_0x358426,_0x4afab5,!![]);}catch(_0x4042ae){return BPromise[_0x9c37('0x24')](_0x4042ae);}return _0x358426[_0x9c37('0x25')]();};}function saveUpdates(_0xafa25c,_0x11fe07){return function(_0x47a391){if(_0x47a391){return _0x47a391['update'](_0xafa25c)['then'](function(_0x76990f){return _0x76990f;});}return null;};}function removeEntity(_0x1417b5,_0x2569f2){return function(_0x78ef2a){if(_0x78ef2a){return _0x78ef2a[_0x9c37('0x26')]()[_0x9c37('0x27')](function(){_0x1417b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd7c55e,_0x2cc0c2){return function(_0x3e22ba){if(!_0x3e22ba){_0xd7c55e[_0x9c37('0x19')](0x194);}return _0x3e22ba;};}function handleError(_0x39a83c,_0x34a653){_0x34a653=_0x34a653||0x1f4;return function(_0x15ae63){logger[_0x9c37('0x28')](_0x15ae63['stack']);if(_0x15ae63[_0x9c37('0x29')]){delete _0x15ae63[_0x9c37('0x29')];}_0x39a83c[_0x9c37('0x1a')](_0x34a653)[_0x9c37('0x2a')](_0x15ae63);};}exports[_0x9c37('0x2b')]=function(_0x2f014a,_0x3493de){var _0xfaedb2={},_0x1419af={},_0x2352db={'count':0x0,'rows':[]};var _0x3e37d9=_['map'](db[_0x9c37('0x2c')][_0x9c37('0x2d')],function(_0x163035){return{'name':_0x163035[_0x9c37('0x2e')],'type':_0x163035[_0x9c37('0x2f')]['key']};});_0x1419af[_0x9c37('0x30')]=_[_0x9c37('0x31')](_0x3e37d9,'name');_0x1419af['query']=_[_0x9c37('0x32')](_0x2f014a[_0x9c37('0x33')]);_0x1419af[_0x9c37('0x34')]=_[_0x9c37('0x35')](_0x1419af['model'],_0x1419af['query']);_0xfaedb2[_0x9c37('0x36')]=_['intersection'](_0x1419af[_0x9c37('0x30')],qs[_0x9c37('0x37')](_0x2f014a[_0x9c37('0x33')]['fields']));_0xfaedb2[_0x9c37('0x36')]=_0xfaedb2[_0x9c37('0x36')][_0x9c37('0x38')]?_0xfaedb2[_0x9c37('0x36')]:_0x1419af[_0x9c37('0x30')];if(!_0x2f014a[_0x9c37('0x33')][_0x9c37('0x39')](_0x9c37('0x3a'))){_0xfaedb2[_0x9c37('0x1e')]=qs['limit'](_0x2f014a[_0x9c37('0x33')][_0x9c37('0x1e')]);_0xfaedb2[_0x9c37('0x1d')]=qs[_0x9c37('0x1d')](_0x2f014a[_0x9c37('0x33')][_0x9c37('0x1d')]);}_0xfaedb2[_0x9c37('0x3b')]=qs['sort'](_0x2f014a[_0x9c37('0x33')][_0x9c37('0x3c')]);_0xfaedb2[_0x9c37('0x3d')]=qs[_0x9c37('0x34')](_[_0x9c37('0x3e')](_0x2f014a['query'],_0x1419af[_0x9c37('0x34')]),_0x3e37d9);if(_0x2f014a[_0x9c37('0x33')][_0x9c37('0x3f')]){_0xfaedb2[_0x9c37('0x3d')]=_[_0x9c37('0x40')](_0xfaedb2[_0x9c37('0x3d')],{'$or':_[_0x9c37('0x31')](_0x3e37d9,function(_0x2af5ad){if(_0x2af5ad[_0x9c37('0x2f')]!=='VIRTUAL'){var _0x125880={};_0x125880[_0x2af5ad['name']]={'$like':'%'+_0x2f014a['query']['filter']+'%'};return _0x125880;}})});}_0xfaedb2=_[_0x9c37('0x40')]({},_0xfaedb2,_0x2f014a[_0x9c37('0x41')]);var _0x35140f={'where':_0xfaedb2[_0x9c37('0x3d')]};return db[_0x9c37('0x2c')][_0x9c37('0x20')](_0x35140f)[_0x9c37('0x27')](function(_0x4a615c){_0x2352db[_0x9c37('0x20')]=_0x4a615c;if(_0x2f014a[_0x9c37('0x33')][_0x9c37('0x42')]){_0xfaedb2[_0x9c37('0x43')]=[{'all':!![]}];}return db[_0x9c37('0x2c')]['findAll'](_0xfaedb2);})[_0x9c37('0x27')](function(_0x36f19c){_0x2352db[_0x9c37('0x44')]=_0x36f19c;return _0x2352db;})[_0x9c37('0x27')](respondWithFilteredResult(_0x3493de,_0xfaedb2))[_0x9c37('0x45')](handleError(_0x3493de,null));};exports[_0x9c37('0x46')]=function(_0x196245,_0x4cd258){var _0x2c67c5={'raw':!![],'where':{'id':_0x196245[_0x9c37('0x47')]['id']}},_0x4691f5={};_0x4691f5[_0x9c37('0x30')]=_['keys'](db[_0x9c37('0x2c')][_0x9c37('0x2d')]);_0x4691f5[_0x9c37('0x33')]=_['keys'](_0x196245[_0x9c37('0x33')]);_0x4691f5[_0x9c37('0x34')]=_[_0x9c37('0x35')](_0x4691f5['model'],_0x4691f5['query']);_0x2c67c5[_0x9c37('0x36')]=_['intersection'](_0x4691f5[_0x9c37('0x30')],qs[_0x9c37('0x37')](_0x196245[_0x9c37('0x33')]['fields']));_0x2c67c5[_0x9c37('0x36')]=_0x2c67c5[_0x9c37('0x36')][_0x9c37('0x38')]?_0x2c67c5[_0x9c37('0x36')]:_0x4691f5[_0x9c37('0x30')];if(_0x196245[_0x9c37('0x33')]['includeAll']){_0x2c67c5[_0x9c37('0x43')]=[{'all':!![]}];}_0x2c67c5=_['merge']({},_0x2c67c5,_0x196245[_0x9c37('0x41')]);return db['SmsApplication'][_0x9c37('0x48')](_0x2c67c5)[_0x9c37('0x27')](handleEntityNotFound(_0x4cd258,null))[_0x9c37('0x27')](respondWithResult(_0x4cd258,null))[_0x9c37('0x45')](handleError(_0x4cd258,null));};exports[_0x9c37('0x49')]=function(_0x33aad6,_0x20221e){return db[_0x9c37('0x2c')][_0x9c37('0x49')](_0x33aad6[_0x9c37('0x4a')],{})['then'](respondWithResult(_0x20221e,0xc9))[_0x9c37('0x45')](handleError(_0x20221e,null));};exports[_0x9c37('0x4b')]=function(_0x21067c,_0x51cd7c){if(_0x21067c[_0x9c37('0x4a')]['id']){delete _0x21067c['body']['id'];}return db['SmsApplication'][_0x9c37('0x48')]({'where':{'id':_0x21067c[_0x9c37('0x47')]['id']}})[_0x9c37('0x27')](handleEntityNotFound(_0x51cd7c,null))[_0x9c37('0x27')](saveUpdates(_0x21067c[_0x9c37('0x4a')],null))[_0x9c37('0x27')](respondWithResult(_0x51cd7c,null))[_0x9c37('0x45')](handleError(_0x51cd7c,null));};exports[_0x9c37('0x26')]=function(_0x597960,_0x2c11ff){return db['SmsApplication'][_0x9c37('0x48')]({'where':{'id':_0x597960[_0x9c37('0x47')]['id']}})[_0x9c37('0x27')](handleEntityNotFound(_0x2c11ff,null))[_0x9c37('0x27')](removeEntity(_0x2c11ff,null))['catch'](handleError(_0x2c11ff,null));};
\ No newline at end of file
index e70aa51..0e0c35c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe248=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x2916e0,_0x31ef7e){var _0x29d5fa=function(_0x4ff725){while(--_0x4ff725){_0x2916e0['push'](_0x2916e0['shift']());}};_0x29d5fa(++_0x31ef7e);}(_0xe248,0x1f0));var _0x8e24=function(_0x213583,_0x28f493){_0x213583=_0x213583-0x0;var _0x5c60be=_0xe248[_0x213583];return _0x5c60be;};'use strict';var _=require(_0x8e24('0x0'));var util=require('util');var logger=require(_0x8e24('0x1'))(_0x8e24('0x2'));var moment=require(_0x8e24('0x3'));var BPromise=require(_0x8e24('0x4'));var rp=require(_0x8e24('0x5'));var fs=require('fs');var path=require(_0x8e24('0x6'));var rimraf=require('rimraf');var config=require(_0x8e24('0x7'));var attributes=require(_0x8e24('0x8'));module[_0x8e24('0x9')]=function(_0x5632b0,_0x41c2f2){return _0x5632b0[_0x8e24('0xa')](_0x8e24('0xb'),attributes,{'tableName':_0x8e24('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e24('0xd'),'collate':_0x8e24('0xe')});};
\ No newline at end of file
+var _0xcddc=['lodash','util','api','bluebird','request-promise','path','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0xcddc,0x16b));var _0xccdd=function(_0x54a77a,_0x4c7764){_0x54a77a=_0x54a77a-0x0;var _0x2aa5b8=_0xcddc[_0x54a77a];return _0x2aa5b8;};'use strict';var _=require(_0xccdd('0x0'));var util=require(_0xccdd('0x1'));var logger=require('../../config/logger')(_0xccdd('0x2'));var moment=require('moment');var BPromise=require(_0xccdd('0x3'));var rp=require(_0xccdd('0x4'));var fs=require('fs');var path=require(_0xccdd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xccdd('0x6')]=function(_0x594c86,_0x1d9b43){return _0x594c86[_0xccdd('0x7')](_0xccdd('0x8'),attributes,{'tableName':_0xccdd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xccdd('0xa')});};
\ No newline at end of file
index f7b89bb..80b2f50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba37=['../../config/environment','client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xb8e1f2,_0x4c06a6){var _0xc37396=function(_0x20cc61){while(--_0x20cc61){_0xb8e1f2['push'](_0xb8e1f2['shift']());}};_0xc37396(++_0x4c06a6);}(_0xba37,0xb6));var _0x7ba3=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xba37[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x7ba3('0x0'));var util=require('util');var moment=require(_0x7ba3('0x1'));var BPromise=require('bluebird');var rs=require(_0x7ba3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ba3('0x3'))['db'];var utils=require(_0x7ba3('0x4'));var logger=require(_0x7ba3('0x5'))(_0x7ba3('0x6'));var config=require(_0x7ba3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7ba3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b4052,_0x1cac44,_0x39d42a){return new BPromise(function(_0x539743,_0x3388e9){return client[_0x7ba3('0x9')](_0x4b4052,_0x39d42a)[_0x7ba3('0xa')](function(_0x108326){logger[_0x7ba3('0xb')](_0x7ba3('0xc'),_0x1cac44,_0x7ba3('0xd'));logger[_0x7ba3('0xe')](_0x7ba3('0xf'),_0x1cac44,'request\x20sent',JSON[_0x7ba3('0x10')](_0x108326));if(_0x108326[_0x7ba3('0x11')]){if(_0x108326[_0x7ba3('0x11')][_0x7ba3('0x12')]===0x1f4){logger['error'](_0x7ba3('0xc'),_0x1cac44,_0x108326[_0x7ba3('0x11')][_0x7ba3('0x13')]);return _0x3388e9(_0x108326[_0x7ba3('0x11')][_0x7ba3('0x13')]);}logger[_0x7ba3('0x11')](_0x7ba3('0xc'),_0x1cac44,_0x108326['error'][_0x7ba3('0x13')]);return _0x539743(_0x108326[_0x7ba3('0x11')][_0x7ba3('0x13')]);}else{logger[_0x7ba3('0xb')](_0x7ba3('0xc'),_0x1cac44,_0x7ba3('0xd'));_0x539743(_0x108326[_0x7ba3('0x14')][_0x7ba3('0x13')]);}})['catch'](function(_0x5e5e72){logger[_0x7ba3('0x11')](_0x7ba3('0xc'),_0x1cac44,_0x5e5e72);_0x3388e9(_0x5e5e72);});});}
\ No newline at end of file
+var _0x25a9=['../../config/logger','jayson/promise','http','request','debug','request\x20sent','stringify','error','code','message','SmsApplication,\x20%s,\x20%s','info','result','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x11c9e8,_0x38a2a2){var _0x18b860=function(_0x52ead4){while(--_0x52ead4){_0x11c9e8['push'](_0x11c9e8['shift']());}};_0x18b860(++_0x38a2a2);}(_0x25a9,0xf1));var _0x925a=function(_0x51f632,_0x5a14d5){_0x51f632=_0x51f632-0x0;var _0x24cf36=_0x25a9[_0x51f632];return _0x24cf36;};'use strict';var _=require('lodash');var util=require(_0x925a('0x0'));var moment=require(_0x925a('0x1'));var BPromise=require(_0x925a('0x2'));var rs=require(_0x925a('0x3'));var fs=require('fs');var Redis=require(_0x925a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x925a('0x5'));var logger=require(_0x925a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x925a('0x7'));var client=jayson['client'][_0x925a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x217ed5,_0x29a50d,_0x4f049e){return new BPromise(function(_0x3c70f5,_0x407ee4){return client[_0x925a('0x9')](_0x217ed5,_0x4f049e)['then'](function(_0x3ed56d){logger['info']('SmsApplication,\x20%s,\x20%s',_0x29a50d,'request\x20sent');logger[_0x925a('0xa')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x29a50d,_0x925a('0xb'),JSON[_0x925a('0xc')](_0x3ed56d));if(_0x3ed56d[_0x925a('0xd')]){if(_0x3ed56d[_0x925a('0xd')][_0x925a('0xe')]===0x1f4){logger[_0x925a('0xd')]('SmsApplication,\x20%s,\x20%s',_0x29a50d,_0x3ed56d[_0x925a('0xd')][_0x925a('0xf')]);return _0x407ee4(_0x3ed56d[_0x925a('0xd')][_0x925a('0xf')]);}logger[_0x925a('0xd')](_0x925a('0x10'),_0x29a50d,_0x3ed56d[_0x925a('0xd')]['message']);return _0x3c70f5(_0x3ed56d[_0x925a('0xd')][_0x925a('0xf')]);}else{logger[_0x925a('0x11')](_0x925a('0x10'),_0x29a50d,'request\x20sent');_0x3c70f5(_0x3ed56d[_0x925a('0x12')][_0x925a('0xf')]);}})['catch'](function(_0x425afe){logger[_0x925a('0xd')](_0x925a('0x10'),_0x29a50d,_0x425afe);_0x407ee4(_0x425afe);});});}
\ No newline at end of file
index ff720c8..f9cb7c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','tracked','sms','smsinteraction:addtags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy'];(function(_0x452d3c,_0x325d0f){var _0x463923=function(_0x300480){while(--_0x300480){_0x452d3c['push'](_0x452d3c['shift']());}};_0x463923(++_0x325d0f);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x259e02,_0x3cb426){_0x259e02=_0x259e02-0x0;var _0x2f5b8e=_0xf4f4[_0x259e02];return _0x2f5b8e;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./smsInteraction.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x4f4f('0x11')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x11')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller['addMessage']);router[_0x4f4f('0x11')]('/:id/tags',auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x15')),controller['addTags']);router[_0x4f4f('0x16')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x4f4f('0x14'),_0x4f4f('0x17')),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x19')](_0x4f4f('0x1a'),auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x1b')),controller[_0x4f4f('0x1c')]);router[_0x4f4f('0x19')](_0x4f4f('0x1d'),auth['isAuthenticated'](),controller[_0x4f4f('0x1e')]);module[_0x4f4f('0x1f')]=router;
\ No newline at end of file
+var _0x4fc2=['removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy'];(function(_0xb79e92,_0x5d0eee){var _0x323b86=function(_0x42458f){while(--_0x42458f){_0xb79e92['push'](_0xb79e92['shift']());}};_0x323b86(++_0x5d0eee);}(_0x4fc2,0x111));var _0x24fc=function(_0x420c7e,_0x2fb00d){_0x420c7e=_0x420c7e-0x0;var _0x1fdcb0=_0x4fc2[_0x420c7e];return _0x1fdcb0;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['show']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['post']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['post'](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0x16'),auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x18')),controller[_0x24fc('0x19')]);router[_0x24fc('0x1a')]('/:id',auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x1b')),controller[_0x24fc('0x1c')]);router[_0x24fc('0x1d')](_0x24fc('0xe'),auth['isAuthenticated'](),interaction[_0x24fc('0x1e')](_0x24fc('0x17'),_0x24fc('0x1f')),controller[_0x24fc('0x20')]);router['delete'](_0x24fc('0x16'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x21')]);module['exports']=router;
\ No newline at end of file
index 9e319b3..7a51eb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1fa=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0xc1fa,0x83));var _0xac1f=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0xc1fa[_0x334651];return _0x29657c;};'use strict';var Sequelize=require(_0xac1f('0x0'));var moment=require(_0xac1f('0x1'));module[_0xac1f('0x2')]={'closed':{'type':Sequelize[_0xac1f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xac1f('0x4')]},'disposition':{'type':Sequelize[_0xac1f('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xac1f('0x5')]},'note':{'type':Sequelize[_0xac1f('0x5')]},'phone':{'type':Sequelize[_0xac1f('0x5')]},'read1stAt':{'type':Sequelize[_0xac1f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xac1f('0x6')]('in',_0xac1f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xac1f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xac1f('0x6')]('in',_0xac1f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xac1f('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7e4b=['moment','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0xea48f2,_0x1b302e){var _0x708fa2=function(_0x430ba8){while(--_0x430ba8){_0xea48f2['push'](_0xea48f2['shift']());}};_0x708fa2(++_0x1b302e);}(_0x7e4b,0x84));var _0xb7e4=function(_0x38f1ae,_0x4fdbc2){_0x38f1ae=_0x38f1ae-0x0;var _0x51ba06=_0x7e4b[_0x38f1ae];return _0x51ba06;};'use strict';var Sequelize=require(_0xb7e4('0x0'));var moment=require(_0xb7e4('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb7e4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb7e4('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb7e4('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb7e4('0x4')]},'note':{'type':Sequelize[_0xb7e4('0x4')]},'phone':{'type':Sequelize[_0xb7e4('0x4')]},'read1stAt':{'type':Sequelize[_0xb7e4('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb7e4('0x5')]('in',_0xb7e4('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb7e4('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb7e4('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb7e4('0x2')],'defaultValue':![]}};
\ No newline at end of file
index a626013..8b0a78a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aba=['Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','SmsInteraction','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','field','from','select','u.id','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','ContactId','type','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','body','some','isEmpty','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','Account.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.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','rawAttributes','includeAll','include','create','update','destroy','describe','SmsMessage','ids','omit','findOne','params','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','color','smsInteractionTags:save','removeTags','download','unix','server','tmp','root','files','attachments','join','transcript-%d-%s.zip','User','fullname','CmContact','firstName','lastName','Messages','direction','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closedAt','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','name','send','map','TagIds'];(function(_0x52e36b,_0x23c722){var _0x1801d9=function(_0x352237){while(--_0x352237){_0x52e36b['push'](_0x52e36b['shift']());}};_0x1801d9(++_0x23c722);}(_0x2aba,0x19a));var _0xa2ab=function(_0x2e3632,_0x2b47d9){_0x2e3632=_0x2e3632-0x0;var _0x520a71=_0x2aba[_0x2e3632];return _0x520a71;};'use strict';var emlformat=require(_0xa2ab('0x0'));var rimraf=require(_0xa2ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa2ab('0x2'));var Mustache=require(_0xa2ab('0x3'));var util=require('util');var path=require(_0xa2ab('0x4'));var sox=require(_0xa2ab('0x5'));var csv=require(_0xa2ab('0x6'));var ejs=require(_0xa2ab('0x7'));var fs=require('fs');var fs_extra=require(_0xa2ab('0x8'));var _=require(_0xa2ab('0x9'));var squel=require(_0xa2ab('0xa'));var crypto=require(_0xa2ab('0xb'));var jsforce=require(_0xa2ab('0xc'));var deskjs=require(_0xa2ab('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa2ab('0xe'));var Papa=require('papaparse');var Redis=require(_0xa2ab('0xf'));var authService=require(_0xa2ab('0x10'));var qs=require(_0xa2ab('0x11'));var as=require(_0xa2ab('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xa2ab('0x13'));var logger=require(_0xa2ab('0x14'))('api');var utils=require(_0xa2ab('0x15'));var config=require(_0xa2ab('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2ab('0x17'))['db'];config[_0xa2ab('0x18')]=_[_0xa2ab('0x19')](config[_0xa2ab('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xa2ab('0x1a'))(new Redis(config[_0xa2ab('0x18')]));require('./smsInteraction.socket')[_0xa2ab('0x1b')](socket);function respondWithStatusCode(_0xcfeb78,_0x58dad5){_0x58dad5=_0x58dad5||0xcc;return function(_0x580050){if(_0x580050){return _0xcfeb78[_0xa2ab('0x1c')](_0x58dad5);}return _0xcfeb78[_0xa2ab('0x1d')](_0x58dad5)[_0xa2ab('0x1e')]();};}function respondWithResult(_0x5590d4,_0x814885){_0x814885=_0x814885||0xc8;return function(_0x12970b){if(_0x12970b){return _0x5590d4[_0xa2ab('0x1d')](_0x814885)[_0xa2ab('0x1f')](_0x12970b);}};}function respondWithFilteredResult(_0x894e9e,_0x200cea){return function(_0x3384e4){if(_0x3384e4){var _0x3739bd=typeof _0x200cea[_0xa2ab('0x20')]==='undefined'&&typeof _0x200cea[_0xa2ab('0x21')]===_0xa2ab('0x22');var _0x2fc1a6=_0x3384e4['count'];var _0x41f5a0=_0x3739bd?0x0:_0x200cea[_0xa2ab('0x20')];var _0x2a1914=_0x3739bd?_0x3384e4[_0xa2ab('0x23')]:_0x200cea['offset']+_0x200cea[_0xa2ab('0x21')];var _0x3d9fcd;if(_0x2a1914>=_0x2fc1a6){_0x2a1914=_0x2fc1a6;_0x3d9fcd=0xc8;}else{_0x3d9fcd=0xce;}_0x894e9e['status'](_0x3d9fcd);return _0x894e9e[_0xa2ab('0x24')](_0xa2ab('0x25'),_0x41f5a0+'-'+_0x2a1914+'/'+_0x2fc1a6)[_0xa2ab('0x1f')](_0x3384e4);}return null;};}function patchUpdates(_0x3e02db){return function(_0x2e7635){try{jsonpatch['apply'](_0x2e7635,_0x3e02db,!![]);}catch(_0x4b49e4){return BPromise[_0xa2ab('0x26')](_0x4b49e4);}return _0x2e7635[_0xa2ab('0x27')]();};}function saveUpdates(_0x2bf378,_0x4deaec){return function(_0xd4796d){if(_0xd4796d){return _0xd4796d['update'](_0x2bf378)[_0xa2ab('0x28')](function(_0x3214df){return _0x3214df;});}return null;};}function removeEntity(_0x355345,_0x181077){return function(_0x51d6b5){if(_0x51d6b5){return _0x51d6b5['destroy']()[_0xa2ab('0x28')](function(){_0x355345[_0xa2ab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27407b,_0x444b58){return function(_0x11e874){if(!_0x11e874){_0x27407b[_0xa2ab('0x1c')](0x194);}return _0x11e874;};}function handleError(_0x6fd220,_0x1da2bd){_0x1da2bd=_0x1da2bd||0x1f4;return function(_0x2104f5){logger[_0xa2ab('0x29')](_0x2104f5['stack']);if(_0x2104f5[_0xa2ab('0x2a')]){delete _0x2104f5[_0xa2ab('0x2a')];}_0x6fd220[_0xa2ab('0x1d')](_0x1da2bd)[_0xa2ab('0x2b')](_0x2104f5);};}function getInteractionUsers(_0x166755,_0x31f158){return new BPromise(function(_0x3cfc4c,_0xb3954e){try{if(_0x31f158[_0x166755['id']]){_0x166755['Users']=_[_0xa2ab('0x2c')](_0x31f158[_0x166755['id']],function(_0x4f6b1f){return{'id':_0x4f6b1f['id'],'fullname':_0x4f6b1f['fullname']};});}}catch(_0x473754){_0xb3954e(_0x473754);}_0x3cfc4c(_0x166755);});}function getInteractionTags(_0x53c559,_0xf03846){return new BPromise(function(_0x402daf,_0x13c6ad){try{if(_0x53c559[_0xa2ab('0x2d')]){_0x53c559[_0xa2ab('0x2e')]=[];_0x53c559['TagIds'][_0xa2ab('0x2f')](',')[_0xa2ab('0x30')](function(_0x134bf3){_0x53c559[_0xa2ab('0x2e')][_0xa2ab('0x31')](_0xf03846[_0x134bf3]);});}delete _0x53c559['TagIds'];}catch(_0x4726dd){_0x13c6ad(_0x4726dd);}_0x402daf(_0x53c559);});}function updateSmsInteraction(_0x9fdf51,_0x4b7d96,_0x2831f3){return new BPromise(function(_0x2e0a87,_0x1d6608){return getInteractionUsers(_0x9fdf51,_0x2831f3)[_0xa2ab('0x28')](function(_0x241d0a){return getInteractionTags(_0x241d0a,_0x4b7d96);})[_0xa2ab('0x28')](function(_0x120989){return getStateInteraction(_0x120989);})[_0xa2ab('0x28')](function(_0x52f7b0){_0x2e0a87(_0x52f7b0);})[_0xa2ab('0x32')](function(_0xe197f5){_0x1d6608(_0xe197f5);});});}function getStateInteraction(_0xf7cfb6){return new BPromise(function(_0x4e7bd1){_0xf7cfb6[_0xa2ab('0x33')]=0x0;_0xf7cfb6[_0xa2ab('0x34')]=0x0;_0xf7cfb6[_0xa2ab('0x35')]=0x0;_0xf7cfb6[_0xa2ab('0x36')]=0x0;_0xf7cfb6[_0xa2ab('0x37')]=0x0;if(!_0xf7cfb6[_0xa2ab('0x38')]&&!_0xf7cfb6[_0xa2ab('0x39')]){_0xf7cfb6[_0xa2ab('0x33')]+=0x1;}if(!_0xf7cfb6[_0xa2ab('0x38')]&&_0xf7cfb6[_0xa2ab('0x39')]){_0xf7cfb6[_0xa2ab('0x34')]+=0x1;if(_0xf7cfb6[_0xa2ab('0x33')]){_0xf7cfb6[_0xa2ab('0x33')]-=0x1;}}if(_0xf7cfb6[_0xa2ab('0x38')]&&_0xf7cfb6[_0xa2ab('0x39')]){_0xf7cfb6[_0xa2ab('0x35')]+=0x1;if(_0xf7cfb6[_0xa2ab('0x34')]){_0xf7cfb6[_0xa2ab('0x34')]-=0x1;}}if(_0xf7cfb6[_0xa2ab('0x38')]&&!_0xf7cfb6[_0xa2ab('0x39')]){_0xf7cfb6[_0xa2ab('0x36')]+=0x1;if(_0xf7cfb6['waiting']){_0xf7cfb6['waiting']-=0x1;}}_0xf7cfb6[_0xa2ab('0x37')]+=0x1;_0x4e7bd1(_0xf7cfb6);});}exports[_0xa2ab('0x3a')]=function(_0x1c37aa,_0x4e11fd){var _0x2c255f={},_0x5f2852={},_0x159655={'count':0x0,'rows':[]};var _0x57d5f4=_[_0xa2ab('0x2c')](db[_0xa2ab('0x3b')]['rawAttributes'],function(_0x1fe6dc){return{'name':_0x1fe6dc[_0xa2ab('0x3c')],'type':_0x1fe6dc['type'][_0xa2ab('0x3d')]};});_0x5f2852[_0xa2ab('0x3e')]=_[_0xa2ab('0x2c')](_0x57d5f4,_0xa2ab('0x2a'));_0x5f2852[_0xa2ab('0x3f')]=_[_0xa2ab('0x40')](_0x1c37aa[_0xa2ab('0x3f')]);_0x5f2852[_0xa2ab('0x41')]=_[_0xa2ab('0x42')](_0x5f2852['model'],_0x5f2852[_0xa2ab('0x3f')]);_0x2c255f[_0xa2ab('0x43')]=_[_0xa2ab('0x42')](_0x5f2852[_0xa2ab('0x3e')],qs['fields'](_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x44')]));_0x2c255f[_0xa2ab('0x43')]=_0x2c255f[_0xa2ab('0x43')][_0xa2ab('0x45')]?_0x2c255f[_0xa2ab('0x43')]:_0x5f2852['model'];if(!_0x1c37aa[_0xa2ab('0x3f')]['hasOwnProperty'](_0xa2ab('0x46'))){_0x2c255f[_0xa2ab('0x21')]=qs[_0xa2ab('0x21')](_0x1c37aa['query'][_0xa2ab('0x21')]);_0x2c255f[_0xa2ab('0x20')]=qs[_0xa2ab('0x20')](_0x1c37aa['query']['offset']);}_0x2c255f['order']=qs[_0xa2ab('0x47')](_0x1c37aa['query'][_0xa2ab('0x47')]);_0x2c255f[_0xa2ab('0x48')]=qs[_0xa2ab('0x41')](_[_0xa2ab('0x49')](_0x1c37aa[_0xa2ab('0x3f')],_0x5f2852[_0xa2ab('0x41')]),_0x57d5f4);var _0x530cd7=[];var _0xc38e44=squel['select']()[_0xa2ab('0x4a')]('id')[_0xa2ab('0x4a')]('name')[_0xa2ab('0x4a')]('color')[_0xa2ab('0x4b')]('tools_tags');var _0x573122=squel[_0xa2ab('0x4c')]()[_0xa2ab('0x4a')](_0xa2ab('0x4d'))[_0xa2ab('0x4a')]('u.fullname')['field'](_0xa2ab('0x4e'))[_0xa2ab('0x4b')]('user_has_sms_interactions','ui')[_0xa2ab('0x4f')](_0xa2ab('0x50'),'u',_0xa2ab('0x51'));var _0x57079d=squel[_0xa2ab('0x4c')]()[_0xa2ab('0x4b')](_0xa2ab('0x52'),'i')['left_join']('cm_contacts','c',_0xa2ab('0x53'))['left_join'](_0xa2ab('0x50'),'o','o.id\x20=\x20i.UserId')[_0xa2ab('0x4f')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0xa2ab('0x4f')](_0xa2ab('0x54'),'me',_0xa2ab('0x55'))[_0xa2ab('0x4f')](_0xa2ab('0x56'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xa2ab('0x4f')](_0xa2ab('0x57'),'t',_0xa2ab('0x58'));var _0x490e72=squel[_0xa2ab('0x59')]();var _0x2a6a38=[];var _0x10d818=squel[_0xa2ab('0x59')]();var _0x224156;if(_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x5a')]){_0x224156=as[_0xa2ab('0x5b')](_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x5a')]);var _0x6b89bf=_0x224156[_0xa2ab('0x5c')];for(var _0x311241=0x0;_0x311241<_0x224156[_0xa2ab('0x5d')][_0xa2ab('0x45')];_0x311241++){var _0x71cff=_0x224156[_0xa2ab('0x5d')][_0x311241];var _0x300545='i';var _0x5f2a09=_[_0xa2ab('0x5e')](_0x57d5f4,[_0xa2ab('0x2a'),_0x71cff[_0xa2ab('0x4a')]]);if(!_0x5f2a09){switch(_0x71cff['field']){case _0xa2ab('0x5f'):if(_0x71cff['value']==0x1){_0x57079d['having']('`'+_0x71cff[_0xa2ab('0x4a')]+'`\x20=\x200');}else{_0x57079d['having']('`'+_0x71cff[_0xa2ab('0x4a')]+_0xa2ab('0x60'));}break;case _0xa2ab('0x61'):if(_0x71cff[_0xa2ab('0x62')]===_0xa2ab('0x63')){if(_0x71cff[_0xa2ab('0x64')]['split']('\x20')[_0xa2ab('0x45')]>0x1){_0x490e72[_0x6b89bf]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa2ab('0x65')](_0x71cff[_0xa2ab('0x64')]),null);}else{var _0x954530='%'+_0x71cff[_0xa2ab('0x64')]+'%';_0x490e72[_0x6b89bf]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x954530,_0x954530,_0x954530);}}else{_0x5f2a09=_[_0xa2ab('0x5e')](_0x57d5f4,['name',_0xa2ab('0x66')]);_0x71cff[_0xa2ab('0x4a')]='ContactId';_0x3668bf=as['buildExpression'](_0x300545,_0x5f2a09[_0xa2ab('0x67')],_0x71cff);_0x490e72[_0x6b89bf](_0x3668bf['text'],_0x3668bf[_0xa2ab('0x64')][_0xa2ab('0x68')],_0x3668bf[_0xa2ab('0x64')][_0xa2ab('0x1e')]);}break;case _0xa2ab('0x69'):var _0x3d1503=_0x71cff[_0xa2ab('0x64')][_0xa2ab('0x2f')](',')['map'](function(_0x34c0e4){return Number(_0x34c0e4);});_0x3d1503['forEach'](function(_0x268b99){_0x10d818['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x268b99+',%');});_0x2a6a38=_[_0xa2ab('0x6a')](_0x2a6a38,_0x3d1503);break;case'User':if(_0x71cff[_0xa2ab('0x62')]==='$substring'){_0x490e72[_0x6b89bf](_0xa2ab('0x6b'),'%'+_0x71cff['value']+'%',null);}else{_0x5f2a09=_[_0xa2ab('0x5e')](_0x57d5f4,[_0xa2ab('0x2a'),_0xa2ab('0x39')]);_0x71cff[_0xa2ab('0x4a')]=_0xa2ab('0x39');_0x3668bf=as[_0xa2ab('0x6c')](_0x300545,_0x5f2a09['type'],_0x71cff);_0x490e72[_0x6b89bf](_0x3668bf[_0xa2ab('0x6d')],_0x3668bf[_0xa2ab('0x64')][_0xa2ab('0x68')],_0x3668bf[_0xa2ab('0x64')][_0xa2ab('0x1e')]);}break;case _0xa2ab('0x6e'):_0x3668bf=as['buildExpression']('me',null,_0x71cff);_0x490e72[_0x6b89bf](_0x3668bf['text'],_0x3668bf['value']['start'],_0x3668bf[_0xa2ab('0x64')][_0xa2ab('0x1e')]);break;}}else{var _0x3668bf=as[_0xa2ab('0x6c')](_0x300545,_0x5f2a09[_0xa2ab('0x67')],_0x71cff);_0x490e72[_0x6b89bf](_0x3668bf[_0xa2ab('0x6d')],_0x3668bf[_0xa2ab('0x64')]['start'],_0x3668bf[_0xa2ab('0x64')][_0xa2ab('0x1e')]);}}}else{var _0x44d379=_(_0x1c37aa[_0xa2ab('0x3f')])['keys']()['map'](function(_0x1ea09e){return _[_0xa2ab('0x6f')](_0x57d5f4,[_0xa2ab('0x2a'),_0x1ea09e])?_0x1ea09e:undefined;})['compact']()['value']();if(!_[_0xa2ab('0x70')](_0x44d379)){_0x44d379['forEach'](function(_0x56c720){if(_0x56c720==='SmsAccountId'){_0x57079d[_0xa2ab('0x48')](_0xa2ab('0x71'),[]['concat'](_0x1c37aa[_0xa2ab('0x3f')][_0x56c720]));}else if(_0x56c720===_0xa2ab('0x72')){var _0xf1d765=JSON[_0xa2ab('0x73')](_0x1c37aa[_0xa2ab('0x3f')][_0x56c720])[_0xa2ab('0x74')];var _0x57d6bf=JSON[_0xa2ab('0x73')](_0x1c37aa[_0xa2ab('0x3f')][_0x56c720])[_0xa2ab('0x75')];_0x57079d[_0xa2ab('0x48')](_0xa2ab('0x76'),_0xf1d765,_0x57d6bf);}else{if(_0x1c37aa[_0xa2ab('0x3f')][_0x56c720]===_0xa2ab('0x77')){_0x57079d[_0xa2ab('0x48')]('i.'+_0x56c720+_0xa2ab('0x78'));}else{_0x57079d[_0xa2ab('0x48')]('i.'+_0x56c720+_0xa2ab('0x79'),_0x1c37aa[_0xa2ab('0x3f')][_0x56c720]);}}});}if(_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x7a')]){if(_0x1c37aa['query'][_0xa2ab('0x7a')]==0x1){_0x57079d[_0xa2ab('0x7b')]('`unreadMessages`\x20=\x200');}else{_0x57079d['having'](_0xa2ab('0x7c'));}}if(_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x7d')]){_0x2a6a38=_[_0xa2ab('0x7e')](_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x7d')])?_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x7d')]:new Array(_0x1c37aa['query']['tag']);_0x2a6a38[_0xa2ab('0x30')](function(_0x392756){_0x10d818['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x392756+',%');});}if(_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x7f')]){var _0x5da603=_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x7f')][_0xa2ab('0x80')]('\x5c','\x5c\x5c')[_0xa2ab('0x80')](/'/g,'\x27\x27');if(qs[_0xa2ab('0x81')](_0x5da603)){_0x490e72['or']('i.id\x20LIKE\x20?',_0x5da603+'%')['or'](_0xa2ab('0x82'),_0x5da603+'%');}else{_0x490e72['or'](_0xa2ab('0x83'),qs[_0xa2ab('0x65')](_0x5da603))['or'](_0xa2ab('0x84'),_0x5da603+'%');}}}_0x57079d[_0xa2ab('0x48')](_0x490e72);_0x57079d[_0xa2ab('0x85')]('i.id');var _0x81267b={'type':db['Sequelize']['QueryTypes'][_0xa2ab('0x86')],'raw':!![]};var _0x47dfc0=_0x57079d[_0xa2ab('0x87')]();_0x47dfc0[_0xa2ab('0x4a')]('i.id');_0x47dfc0[_0xa2ab('0x4a')](_0xa2ab('0x88'),_0xa2ab('0x5f'));if(_0x2c255f[_0xa2ab('0x89')]){_0x2c255f[_0xa2ab('0x89')][_0xa2ab('0x30')](function(_0x32043f){var _0x43889b=_0x32043f[0x0]===_0xa2ab('0x8a')?_0x32043f[0x0]:'i.'+_0x32043f[0x0];_0x57079d[_0xa2ab('0x89')](_0x43889b,_0x32043f[0x1]==='DESC'?![]:!![]);});}if(!_[_0xa2ab('0x70')](_0x2a6a38)){_0x57079d['having'](_0x10d818);_0x47dfc0[_0xa2ab('0x48')](_0xa2ab('0x8b'),_0x2a6a38);}BPromise[_0xa2ab('0x8c')]()[_0xa2ab('0x28')](function(){if(!_0x224156){if(_0x1c37aa['query']['SmsAccountId'])return;_0x47dfc0['where'](_0xa2ab('0x8d'));_0x57079d[_0xa2ab('0x48')](_0xa2ab('0x8d'));return;}if(_0x1c37aa[_0xa2ab('0x8e')][_0xa2ab('0x8f')]!=='agent')return;return _0x1c37aa[_0xa2ab('0x8e')][_0xa2ab('0x90')]({'attributes':['id'],'raw':!![]})[_0xa2ab('0x28')](function(_0x1c4409){if(_[_0xa2ab('0x70')](_0x1c4409)){_0x47dfc0[_0xa2ab('0x48')](_0xa2ab('0x91'));_0x57079d[_0xa2ab('0x48')](_0xa2ab('0x91'));}else{_0x47dfc0[_0xa2ab('0x48')]('i.SmsAccountId\x20IN\x20?',_[_0xa2ab('0x2c')](_0x1c4409,'id'));_0x57079d[_0xa2ab('0x48')](_0xa2ab('0x71'),_[_0xa2ab('0x2c')](_0x1c4409,'id'));}});})[_0xa2ab('0x28')](function(){if(_0x1c37aa['user'][_0xa2ab('0x8f')]===_0xa2ab('0x92')&&!_0x224156&&!_0x1c37aa['query']['SmsAccountId'])return[];return db[_0xa2ab('0x93')]['query'](_0x47dfc0[_0xa2ab('0x94')](),_0x81267b);})[_0xa2ab('0x28')](function(_0xcbbcef){_0x159655[_0xa2ab('0x23')]=_0xcbbcef['length'];if(_0x159655[_0xa2ab('0x23')]===0x0)return[];return db[_0xa2ab('0x93')][_0xa2ab('0x3f')](_0xc38e44[_0xa2ab('0x94')](),_0x81267b)[_0xa2ab('0x28')](function(_0xc8b3a9){_0x530cd7=_['keyBy'](_0xc8b3a9,'id');_0x81267b=_[_0xa2ab('0x95')](_0x81267b,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c37aa[_0xa2ab('0x3f')][_0xa2ab('0x44')]){_0x2c255f[_0xa2ab('0x43')][_0xa2ab('0x30')](function(_0x4c2d35){_0x57079d['field']('i.'+_0x4c2d35);});}else{_0x57079d[_0xa2ab('0x4a')](_0xa2ab('0x88'),_0xa2ab('0x5f'));_0x57079d[_0xa2ab('0x4a')]('a.key',_0xa2ab('0x96'));_0x57079d['field'](_0xa2ab('0x97'),_0xa2ab('0x98'));_0x57079d[_0xa2ab('0x4a')](_0xa2ab('0x99'),_0xa2ab('0x8a'));_0x57079d[_0xa2ab('0x4a')](_0xa2ab('0x9a'));_0x57079d[_0xa2ab('0x4a')](_0xa2ab('0x9b'),_0xa2ab('0x9c'));_0x57079d[_0xa2ab('0x4a')](_0xa2ab('0x9d'),_0xa2ab('0x9e'));_0x57079d[_0xa2ab('0x4a')](_0xa2ab('0x9f'),_0xa2ab('0xa0'));_0x57079d['field'](_0xa2ab('0xa1'),_0xa2ab('0xa2'));_0x57079d['field'](_0xa2ab('0xa3'),_0xa2ab('0xa4'));_0x57079d['field'](_0xa2ab('0xa5'),'Contact.fax');_0x57079d[_0xa2ab('0x4a')](_0xa2ab('0xa6'),'Owner.fullname');_0x57079d['field'](_0xa2ab('0xa7'),_0xa2ab('0xa8'));_0x57079d['field'](_0xa2ab('0xa9'),_0xa2ab('0x2d'));}if(_0x2c255f[_0xa2ab('0x21')])_0x57079d['limit'](_0x2c255f[_0xa2ab('0x21')]);if(_0x2c255f[_0xa2ab('0x20')])_0x57079d[_0xa2ab('0x20')](_0x2c255f[_0xa2ab('0x20')]);return db[_0xa2ab('0x93')]['query'](_0x57079d['toString'](),_0x81267b);})[_0xa2ab('0x28')](function(_0x5b49f3){if(_0x5b49f3[_0xa2ab('0x45')]>0x0)_0x573122[_0xa2ab('0x48')](_0xa2ab('0xaa'),_['map'](_0x5b49f3,'id'));return db[_0xa2ab('0x93')][_0xa2ab('0x3f')](_0x573122['toString'](),_0x81267b)['then'](function(_0x10c7bb){var _0x33250b=_[_0xa2ab('0xab')](_0x10c7bb,_0xa2ab('0xac'));var _0x31fa2c=[];_0x5b49f3['forEach'](function(_0x115c8d){_0x31fa2c['push'](updateSmsInteraction(_0x115c8d,_0x530cd7,_0x33250b));});return BPromise[_0xa2ab('0xad')](_0x31fa2c);});});})[_0xa2ab('0x28')](function(_0x3bf4f3){_0x159655[_0xa2ab('0xae')]=_0x3bf4f3;return _0x159655;})[_0xa2ab('0x28')](respondWithFilteredResult(_0x4e11fd,_0x2c255f))[_0xa2ab('0x32')](handleError(_0x4e11fd,null));};exports['show']=function(_0x58a3be,_0x7c459){var _0x335848={'raw':![],'where':{'id':_0x58a3be['params']['id']}},_0x32e464={};_0x32e464['model']=_[_0xa2ab('0x40')](db['SmsInteraction'][_0xa2ab('0xaf')]);_0x32e464['query']=_[_0xa2ab('0x40')](_0x58a3be[_0xa2ab('0x3f')]);_0x32e464[_0xa2ab('0x41')]=_[_0xa2ab('0x42')](_0x32e464[_0xa2ab('0x3e')],_0x32e464[_0xa2ab('0x3f')]);_0x335848[_0xa2ab('0x43')]=_['intersection'](_0x32e464[_0xa2ab('0x3e')],qs[_0xa2ab('0x44')](_0x58a3be[_0xa2ab('0x3f')]['fields']));_0x335848[_0xa2ab('0x43')]=_0x335848[_0xa2ab('0x43')][_0xa2ab('0x45')]?_0x335848[_0xa2ab('0x43')]:_0x32e464[_0xa2ab('0x3e')];if(_0x58a3be[_0xa2ab('0x3f')][_0xa2ab('0xb0')]){_0x335848[_0xa2ab('0xb1')]=[{'all':!![]}];}_0x335848=_[_0xa2ab('0x95')]({},_0x335848,_0x58a3be['options']);return db['SmsInteraction'][_0xa2ab('0x5e')](_0x335848)[_0xa2ab('0x28')](handleEntityNotFound(_0x7c459,null))['then'](respondWithResult(_0x7c459,null))[_0xa2ab('0x32')](handleError(_0x7c459,null));};exports[_0xa2ab('0xb2')]=function(_0x20b31d,_0x17677b){return db[_0xa2ab('0x3b')][_0xa2ab('0xb2')](_0x20b31d[_0xa2ab('0x6e')],{})[_0xa2ab('0x28')](respondWithResult(_0x17677b,0xc9))[_0xa2ab('0x32')](handleError(_0x17677b,null));};exports[_0xa2ab('0xb3')]=function(_0xe6a72d,_0x3f5579){if(_0xe6a72d[_0xa2ab('0x6e')]['id']){delete _0xe6a72d[_0xa2ab('0x6e')]['id'];}return db[_0xa2ab('0x3b')][_0xa2ab('0x5e')]({'where':{'id':_0xe6a72d['params']['id']}})[_0xa2ab('0x28')](handleEntityNotFound(_0x3f5579,null))[_0xa2ab('0x28')](saveUpdates(_0xe6a72d[_0xa2ab('0x6e')],null))[_0xa2ab('0x28')](respondWithResult(_0x3f5579,null))[_0xa2ab('0x32')](handleError(_0x3f5579,null));};exports[_0xa2ab('0xb4')]=function(_0x446a15,_0xa936ef){return db[_0xa2ab('0x3b')][_0xa2ab('0x5e')]({'where':{'id':_0x446a15['params']['id']}})[_0xa2ab('0x28')](handleEntityNotFound(_0xa936ef,null))[_0xa2ab('0x28')](removeEntity(_0xa936ef,null))[_0xa2ab('0x32')](handleError(_0xa936ef,null));};exports['describe']=function(_0x4e3719,_0x28c99b){return db[_0xa2ab('0x3b')][_0xa2ab('0xb5')]()[_0xa2ab('0x28')](respondWithResult(_0x28c99b,null))[_0xa2ab('0x32')](handleError(_0x28c99b,null));};exports['addMessage']=function(_0x84fdef,_0x1f823a,_0x24de10){return db[_0xa2ab('0xb6')][_0xa2ab('0x5e')]({'where':{'id':_0x84fdef['params']['id']}})[_0xa2ab('0x28')](handleEntityNotFound(_0x1f823a,null))[_0xa2ab('0x28')](function(_0x1c33d6){if(_0x1c33d6){return _0x1c33d6['addMessage'](_0x84fdef[_0xa2ab('0x6e')][_0xa2ab('0xb7')],_[_0xa2ab('0xb8')](_0x84fdef[_0xa2ab('0x6e')],[_0xa2ab('0xb7'),'id'])||{});}})[_0xa2ab('0x28')](respondWithResult(_0x1f823a,null))[_0xa2ab('0x32')](handleError(_0x1f823a,null));};exports['getMessages']=function(_0x38dfab,_0x5d9904,_0x1f9cfe){var _0x12c84f={'raw':![],'where':{}};var _0x70a3e={};var _0xbb72c3={'count':0x0,'rows':[]};return db[_0xa2ab('0x3b')][_0xa2ab('0xb9')]({'where':{'id':_0x38dfab[_0xa2ab('0xba')]['id']}})[_0xa2ab('0x28')](handleEntityNotFound(_0x5d9904,null))[_0xa2ab('0x28')](function(_0x5c05fb){if(_0x5c05fb){_0x70a3e[_0xa2ab('0x3e')]=_[_0xa2ab('0x40')](db[_0xa2ab('0xb6')][_0xa2ab('0xaf')]);_0x70a3e[_0xa2ab('0x3f')]=_[_0xa2ab('0x40')](_0x38dfab['query']);_0x70a3e[_0xa2ab('0x41')]=_[_0xa2ab('0x42')](_0x70a3e['model'],_0x70a3e[_0xa2ab('0x3f')]);_0x12c84f[_0xa2ab('0x43')]=_[_0xa2ab('0x42')](_0x70a3e[_0xa2ab('0x3e')],qs[_0xa2ab('0x44')](_0x38dfab['query']['fields']));_0x12c84f['attributes']=_0x12c84f[_0xa2ab('0x43')][_0xa2ab('0x45')]?_0x12c84f[_0xa2ab('0x43')]:_0x70a3e[_0xa2ab('0x3e')];if(!_0x38dfab[_0xa2ab('0x3f')][_0xa2ab('0xbb')]('nolimit')){_0x12c84f[_0xa2ab('0x21')]=qs['limit'](_0x38dfab[_0xa2ab('0x3f')][_0xa2ab('0x21')]);_0x12c84f[_0xa2ab('0x20')]=qs[_0xa2ab('0x20')](_0x38dfab['query'][_0xa2ab('0x20')]);}_0x12c84f[_0xa2ab('0x89')]=qs[_0xa2ab('0x47')](_0x38dfab['query']['sort']);_0x12c84f['where']=qs[_0xa2ab('0x41')](_[_0xa2ab('0x49')](_0x38dfab[_0xa2ab('0x3f')],_0x70a3e[_0xa2ab('0x41')]));_0x12c84f['where'][_0xa2ab('0xac')]=_0x5c05fb['id'];if(_0x38dfab[_0xa2ab('0x3f')][_0xa2ab('0x7f')]){_0x12c84f['where']=_['merge'](_0x12c84f[_0xa2ab('0x48')],{'$or':_[_0xa2ab('0x2c')](_0x12c84f[_0xa2ab('0x43')],function(_0x253750){var _0xde0036={};_0xde0036[_0x253750]={'$like':'%'+_0x38dfab[_0xa2ab('0x3f')][_0xa2ab('0x7f')]+'%'};return _0xde0036;})});}if(_0x38dfab[_0xa2ab('0x3f')][_0xa2ab('0x74')]){var _0x9c8aa3=_0x38dfab[_0xa2ab('0x3f')][_0xa2ab('0x74')][_0xa2ab('0x2f')](',');var _0x4a7bca={};_0x4a7bca[_0x9c8aa3[0x0]]={'$gte':moment(_0x9c8aa3[0x1])[_0xa2ab('0xbc')](_0xa2ab('0xbd'))};_0x12c84f['where']=_[_0xa2ab('0x95')](_0x12c84f[_0xa2ab('0x48')],_0x4a7bca);}_0x12c84f=_['merge']({},_0x12c84f,_0x38dfab[_0xa2ab('0xbe')]);return db[_0xa2ab('0xb6')]['count']({'where':_0x12c84f['where']})['then'](function(_0x3d3d56){_0xbb72c3[_0xa2ab('0x23')]=_0x3d3d56;if(_0x38dfab[_0xa2ab('0x3f')]['includeAll']){_0x12c84f[_0xa2ab('0xb1')]=[{'all':!![]}];}return db['SmsMessage'][_0xa2ab('0xbf')](_0x12c84f);})[_0xa2ab('0x28')](function(_0x5694dc){_0xbb72c3['rows']=_0x5694dc;return _0xbb72c3;});}})[_0xa2ab('0x28')](respondWithFilteredResult(_0x5d9904,_0x12c84f))[_0xa2ab('0x32')](handleError(_0x5d9904,null));};exports[_0xa2ab('0xc0')]=function(_0x30898d,_0x3abc24,_0xef4b60){return db[_0xa2ab('0x3b')][_0xa2ab('0x5e')]({'where':{'id':_0x30898d['params']['id']}})[_0xa2ab('0x28')](handleEntityNotFound(_0x3abc24,null))[_0xa2ab('0x28')](function(_0x357e8f){if(_0x357e8f){return _0x357e8f['setTags'](_0x30898d['body'][_0xa2ab('0xb7')],_[_0xa2ab('0xb8')](_0x30898d[_0xa2ab('0x6e')],['ids','id'])||{})['spread'](function(){return db[_0xa2ab('0x69')]['findAll']({'attributes':['id',_0xa2ab('0x2a'),_0xa2ab('0xc1')],'where':{'id':_0x30898d[_0xa2ab('0x6e')][_0xa2ab('0xb7')]}});})[_0xa2ab('0x28')](function(_0x490614){socket['emit'](_0xa2ab('0xc2'),{'id':Number(_0x30898d[_0xa2ab('0xba')]['id']),'tags':_0x490614||[]});return{'id':Number(_0x30898d[_0xa2ab('0xba')]['id']),'tags':_0x490614||[]};});}})[_0xa2ab('0x28')](respondWithResult(_0x3abc24,null))[_0xa2ab('0x32')](handleError(_0x3abc24,null));};exports[_0xa2ab('0xc3')]=function(_0x571797,_0xc74ad,_0x31a60c){return db[_0xa2ab('0x3b')]['find']({'where':{'id':_0x571797[_0xa2ab('0xba')]['id']}})[_0xa2ab('0x28')](handleEntityNotFound(_0xc74ad,null))[_0xa2ab('0x28')](function(_0x33b890){if(_0x33b890){return _0x33b890[_0xa2ab('0xc3')](_0x571797[_0xa2ab('0x3f')]['ids']);}})[_0xa2ab('0x28')](respondWithStatusCode(_0xc74ad,null))[_0xa2ab('0x32')](handleError(_0xc74ad,null));};exports[_0xa2ab('0xc4')]=function(_0x3afdb5,_0x5bc266){var _0x1469b6=moment()[_0xa2ab('0xc5')]()[_0xa2ab('0x94')]();var _0x308a33=path['join'](config['root'],_0xa2ab('0xc6'),'files',_0xa2ab('0xc7'));var _0x405483=path['join'](config[_0xa2ab('0xc8')],_0xa2ab('0xc6'),_0xa2ab('0xc9'),_0xa2ab('0xca'));var _0x4e2a8e=path[_0xa2ab('0xcb')](_0x308a33,_0x1469b6);var _0x1576b8=util[_0xa2ab('0xbc')](_0xa2ab('0xcc'),_0x3afdb5[_0xa2ab('0xba')]['id'],_0x1469b6);var _0x1b0060=path[_0xa2ab('0xcb')](_0x308a33,_0x1576b8);var _0x2185e4=[];_0x2185e4[_0xa2ab('0x31')]({'model':db[_0xa2ab('0xcd')],'as':'User','attributes':['id',_0xa2ab('0xce')],'raw':!![]});_0x2185e4['push']({'model':db[_0xa2ab('0xcf')],'as':_0xa2ab('0x61'),'attributes':['id',_0xa2ab('0xd0'),_0xa2ab('0xd1')],'raw':!![]});var _0x4c888a=[{'model':db[_0xa2ab('0xb6')],'as':_0xa2ab('0xd2'),'attributes':['id',_0xa2ab('0x6e'),_0xa2ab('0x72'),_0xa2ab('0xd3'),'secret','read'],'include':_0x2185e4}];_0x4c888a[_0xa2ab('0x31')]({'model':db[_0xa2ab('0xd4')],'as':_0xa2ab('0xd5'),'attributes':['id',_0xa2ab('0x2a')]});_0x4c888a[_0xa2ab('0x31')]({'model':db[_0xa2ab('0xcd')],'as':_0xa2ab('0xd6'),'attributes':['id',_0xa2ab('0xce')]});return db[_0xa2ab('0x3b')][_0xa2ab('0x5e')]({'where':{'id':_0x3afdb5[_0xa2ab('0xba')]['id']},'include':_0x4c888a})[_0xa2ab('0x28')](handleEntityNotFound(_0x5bc266,null))[_0xa2ab('0x28')](function(_0x2a3a24){if(_0x2a3a24){var _0xf17a75=_0x2a3a24[_0xa2ab('0xd7')]({'plain':!![]});fs[_0xa2ab('0xd8')](_0x4e2a8e);var _0x50d9be={'channel':_0xa2ab('0xd9'),'account':_0xf17a75[_0xa2ab('0xd5')][_0xa2ab('0x2a')],'agent':_0xf17a75[_0xa2ab('0xd6')]?_0xf17a75[_0xa2ab('0xd6')]['fullname']:_0xa2ab('0xda'),'createdAt':moment(_0xf17a75[_0xa2ab('0x72')])[_0xa2ab('0xbc')](_0xa2ab('0xbd'))[_0xa2ab('0x94')](),'closedAt':_0xf17a75['closed']?moment(_0xf17a75[_0xa2ab('0xdb')])[_0xa2ab('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa2ab('0x94')]():'','disposition':_0xf17a75['disposition'],'messages':_(_0xf17a75['Messages'])['filter']({'secret':![]})[_0xa2ab('0x2c')](function(_0x46a9f0){return{'date':moment(_0x46a9f0['createdAt'])['format'](_0xa2ab('0xbd'))['toString'](),'sender':_0x46a9f0[_0xa2ab('0xd3')]===_0xa2ab('0xdc')?_0x46a9f0[_0xa2ab('0xcd')]?_0x46a9f0[_0xa2ab('0xcd')][_0xa2ab('0xce')]:'System':_0x46a9f0[_0xa2ab('0x61')][_0xa2ab('0xd0')]+(_0x46a9f0['Contact'][_0xa2ab('0xd1')]?'\x20'+_0x46a9f0['Contact']['lastName']:''),'body':_0x46a9f0[_0xa2ab('0x6e')],'direction':_0x46a9f0[_0xa2ab('0xd3')]==='out'?'A':'C','secret':_0x46a9f0['secret'],'read':_0x46a9f0[_0xa2ab('0x7a')]};})['value']()};return ejs[_0xa2ab('0xdd')](path['join'](config[_0xa2ab('0xc8')],'server',_0xa2ab('0xde'),_0xa2ab('0xdf')),{'interaction':_0x50d9be})[_0xa2ab('0x28')](function(_0x248274){var _0x33106a=path[_0xa2ab('0xcb')](_0x4e2a8e,_0xa2ab('0xe0')+_0xf17a75['id']+'-'+_0x1469b6+_0xa2ab('0xe1'));var _0x45ed4b={'path':_0x33106a,'channel':_0xa2ab('0xd9'),'interactionId':_0xf17a75['id']};return pdf[_0xa2ab('0xe2')](_0x248274,_0x45ed4b);})[_0xa2ab('0x28')](function(){return new BPromise(function(_0x5b8000,_0x5615e3){zipdir(_0x4e2a8e,{'saveTo':_0x1b0060},function(_0x572634,_0x419ac2){if(_0x572634)return _0x5615e3(_0x572634);return _0x5b8000(_0x419ac2);});})['then'](function(){return new BPromise(function(_0x10e69f,_0x4d62be){rimraf(_0x4e2a8e,function(_0x3d2200){if(_0x3d2200)_0x4d62be(_0x3d2200);return _0x10e69f();});});})['then'](function(){return _0x5bc266['download'](_0x1b0060,_0x1576b8,function(_0x3abc5c){if(_0x3abc5c){console['log']('err',_0x3abc5c);}else{fs[_0xa2ab('0xe3')](_0x1b0060);}});});});}else{return _0x5bc266[_0xa2ab('0x1c')](0xc8);}})[_0xa2ab('0x32')](handleError(_0x5bc266,null));};
\ No newline at end of file
+var _0x8c45=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','start','body','compact','SmsAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','i.SmsAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.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.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','rawAttributes','includeAll','options','create','update','params','describe','SmsMessage','ids','omit','getMessages','findOne','pick','include','findAll','addTags','setTags','spread','Tag','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','format','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','waiting','talking','total','closed','UserId','answered','unmanaged','index','SmsInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','field','color','from','tools_tags','select','u.id','user_has_sms_interactions','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_messages','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text'];(function(_0x1b2cf0,_0x3e1559){var _0x566935=function(_0x5d2b27){while(--_0x5d2b27){_0x1b2cf0['push'](_0x1b2cf0['shift']());}};_0x566935(++_0x3e1559);}(_0x8c45,0x7c));var _0x58c4=function(_0x29716b,_0x1164ff){_0x29716b=_0x29716b-0x0;var _0x2681e2=_0x8c45[_0x29716b];return _0x2681e2;};'use strict';var emlformat=require(_0x58c4('0x0'));var rimraf=require(_0x58c4('0x1'));var zipdir=require(_0x58c4('0x2'));var jsonpatch=require(_0x58c4('0x3'));var rp=require(_0x58c4('0x4'));var moment=require(_0x58c4('0x5'));var BPromise=require(_0x58c4('0x6'));var Mustache=require(_0x58c4('0x7'));var util=require('util');var path=require(_0x58c4('0x8'));var sox=require(_0x58c4('0x9'));var csv=require(_0x58c4('0xa'));var ejs=require(_0x58c4('0xb'));var fs=require('fs');var fs_extra=require(_0x58c4('0xc'));var _=require(_0x58c4('0xd'));var squel=require(_0x58c4('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x58c4('0xf'));var toCsv=require(_0x58c4('0xa'));var querystring=require('querystring');var Papa=require(_0x58c4('0x10'));var Redis=require(_0x58c4('0x11'));var authService=require(_0x58c4('0x12'));var qs=require(_0x58c4('0x13'));var as=require(_0x58c4('0x14'));var pdf=require(_0x58c4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x58c4('0x16'))('api');var utils=require(_0x58c4('0x17'));var config=require(_0x58c4('0x18'));var licenseUtil=require(_0x58c4('0x19'));var db=require('../../mysqldb')['db'];config[_0x58c4('0x1a')]=_[_0x58c4('0x1b')](config[_0x58c4('0x1a')],{'host':_0x58c4('0x1c'),'port':0x18eb});var socket=require(_0x58c4('0x1d'))(new Redis(config[_0x58c4('0x1a')]));require(_0x58c4('0x1e'))['register'](socket);function respondWithStatusCode(_0x36e198,_0x20f790){_0x20f790=_0x20f790||0xcc;return function(_0x3efd34){if(_0x3efd34){return _0x36e198[_0x58c4('0x1f')](_0x20f790);}return _0x36e198[_0x58c4('0x20')](_0x20f790)[_0x58c4('0x21')]();};}function respondWithResult(_0x364c93,_0x4d8e5e){_0x4d8e5e=_0x4d8e5e||0xc8;return function(_0x46bda9){if(_0x46bda9){return _0x364c93['status'](_0x4d8e5e)[_0x58c4('0x22')](_0x46bda9);}};}function respondWithFilteredResult(_0x4ed7fe,_0x5b234a){return function(_0x11178a){if(_0x11178a){var _0x2bee21=typeof _0x5b234a[_0x58c4('0x23')]===_0x58c4('0x24')&&typeof _0x5b234a[_0x58c4('0x25')]===_0x58c4('0x24');var _0x2e9a80=_0x11178a[_0x58c4('0x26')];var _0xcb34f7=_0x2bee21?0x0:_0x5b234a['offset'];var _0x239fc7=_0x2bee21?_0x11178a[_0x58c4('0x26')]:_0x5b234a[_0x58c4('0x23')]+_0x5b234a[_0x58c4('0x25')];var _0x7cc8bf;if(_0x239fc7>=_0x2e9a80){_0x239fc7=_0x2e9a80;_0x7cc8bf=0xc8;}else{_0x7cc8bf=0xce;}_0x4ed7fe[_0x58c4('0x20')](_0x7cc8bf);return _0x4ed7fe['set'](_0x58c4('0x27'),_0xcb34f7+'-'+_0x239fc7+'/'+_0x2e9a80)['json'](_0x11178a);}return null;};}function patchUpdates(_0x190f43){return function(_0x5b75d5){try{jsonpatch['apply'](_0x5b75d5,_0x190f43,!![]);}catch(_0x55f168){return BPromise[_0x58c4('0x28')](_0x55f168);}return _0x5b75d5[_0x58c4('0x29')]();};}function saveUpdates(_0xf7c2d9,_0x19ffef){return function(_0x5a1cba){if(_0x5a1cba){return _0x5a1cba['update'](_0xf7c2d9)['then'](function(_0x269700){return _0x269700;});}return null;};}function removeEntity(_0x23f7f8,_0x45faa7){return function(_0x573c62){if(_0x573c62){return _0x573c62[_0x58c4('0x2a')]()[_0x58c4('0x2b')](function(){_0x23f7f8[_0x58c4('0x20')](0xcc)[_0x58c4('0x21')]();});}};}function handleEntityNotFound(_0x1bfa05,_0x30d238){return function(_0x18904c){if(!_0x18904c){_0x1bfa05[_0x58c4('0x1f')](0x194);}return _0x18904c;};}function handleError(_0x1e1eec,_0x198309){_0x198309=_0x198309||0x1f4;return function(_0x4921bc){logger[_0x58c4('0x2c')](_0x4921bc[_0x58c4('0x2d')]);if(_0x4921bc['name']){delete _0x4921bc[_0x58c4('0x2e')];}_0x1e1eec['status'](_0x198309)[_0x58c4('0x2f')](_0x4921bc);};}function getInteractionUsers(_0x340993,_0x57bace){return new BPromise(function(_0x38d5ec,_0x2000e9){try{if(_0x57bace[_0x340993['id']]){_0x340993[_0x58c4('0x30')]=_[_0x58c4('0x31')](_0x57bace[_0x340993['id']],function(_0x371a0a){return{'id':_0x371a0a['id'],'fullname':_0x371a0a[_0x58c4('0x32')]};});}}catch(_0x375310){_0x2000e9(_0x375310);}_0x38d5ec(_0x340993);});}function getInteractionTags(_0x50d4b5,_0x544311){return new BPromise(function(_0x26035c,_0x406a02){try{if(_0x50d4b5['TagIds']){_0x50d4b5['Tags']=[];_0x50d4b5[_0x58c4('0x33')][_0x58c4('0x34')](',')[_0x58c4('0x35')](function(_0x10cfef){_0x50d4b5['Tags'][_0x58c4('0x36')](_0x544311[_0x10cfef]);});}delete _0x50d4b5[_0x58c4('0x33')];}catch(_0x11ac4e){_0x406a02(_0x11ac4e);}_0x26035c(_0x50d4b5);});}function updateSmsInteraction(_0x2623de,_0x33cf10,_0x529ace){return new BPromise(function(_0x4144dc,_0x22110d){return getInteractionUsers(_0x2623de,_0x529ace)[_0x58c4('0x2b')](function(_0x4a52e2){return getInteractionTags(_0x4a52e2,_0x33cf10);})[_0x58c4('0x2b')](function(_0x3ee3da){return getStateInteraction(_0x3ee3da);})['then'](function(_0x15b291){_0x4144dc(_0x15b291);})[_0x58c4('0x37')](function(_0x218216){_0x22110d(_0x218216);});});}function getStateInteraction(_0x58ff17){return new BPromise(function(_0xb0a3df){_0x58ff17[_0x58c4('0x38')]=0x0;_0x58ff17[_0x58c4('0x39')]=0x0;_0x58ff17['answered']=0x0;_0x58ff17['unmanaged']=0x0;_0x58ff17[_0x58c4('0x3a')]=0x0;if(!_0x58ff17[_0x58c4('0x3b')]&&!_0x58ff17[_0x58c4('0x3c')]){_0x58ff17[_0x58c4('0x38')]+=0x1;}if(!_0x58ff17['closed']&&_0x58ff17[_0x58c4('0x3c')]){_0x58ff17[_0x58c4('0x39')]+=0x1;if(_0x58ff17['waiting']){_0x58ff17[_0x58c4('0x38')]-=0x1;}}if(_0x58ff17[_0x58c4('0x3b')]&&_0x58ff17[_0x58c4('0x3c')]){_0x58ff17[_0x58c4('0x3d')]+=0x1;if(_0x58ff17[_0x58c4('0x39')]){_0x58ff17[_0x58c4('0x39')]-=0x1;}}if(_0x58ff17['closed']&&!_0x58ff17[_0x58c4('0x3c')]){_0x58ff17[_0x58c4('0x3e')]+=0x1;if(_0x58ff17['waiting']){_0x58ff17[_0x58c4('0x38')]-=0x1;}}_0x58ff17[_0x58c4('0x3a')]+=0x1;_0xb0a3df(_0x58ff17);});}exports[_0x58c4('0x3f')]=function(_0x55f2d7,_0x3b271d){var _0x33269f={},_0x26e220={},_0x28aeca={'count':0x0,'rows':[]};var _0x252862=_[_0x58c4('0x31')](db[_0x58c4('0x40')]['rawAttributes'],function(_0x4da19e){return{'name':_0x4da19e[_0x58c4('0x41')],'type':_0x4da19e[_0x58c4('0x42')][_0x58c4('0x43')]};});_0x26e220[_0x58c4('0x44')]=_[_0x58c4('0x31')](_0x252862,_0x58c4('0x2e'));_0x26e220[_0x58c4('0x45')]=_[_0x58c4('0x46')](_0x55f2d7[_0x58c4('0x45')]);_0x26e220[_0x58c4('0x47')]=_[_0x58c4('0x48')](_0x26e220['model'],_0x26e220[_0x58c4('0x45')]);_0x33269f['attributes']=_[_0x58c4('0x48')](_0x26e220[_0x58c4('0x44')],qs['fields'](_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x49')]));_0x33269f['attributes']=_0x33269f[_0x58c4('0x4a')][_0x58c4('0x4b')]?_0x33269f[_0x58c4('0x4a')]:_0x26e220[_0x58c4('0x44')];if(!_0x55f2d7['query'][_0x58c4('0x4c')](_0x58c4('0x4d'))){_0x33269f[_0x58c4('0x25')]=qs[_0x58c4('0x25')](_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x25')]);_0x33269f[_0x58c4('0x23')]=qs[_0x58c4('0x23')](_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x23')]);}_0x33269f['order']=qs[_0x58c4('0x4e')](_0x55f2d7[_0x58c4('0x45')]['sort']);_0x33269f[_0x58c4('0x4f')]=qs[_0x58c4('0x47')](_['pick'](_0x55f2d7[_0x58c4('0x45')],_0x26e220[_0x58c4('0x47')]),_0x252862);var _0x578795=[];var _0xb635a2=squel['select']()[_0x58c4('0x50')]('id')[_0x58c4('0x50')](_0x58c4('0x2e'))[_0x58c4('0x50')](_0x58c4('0x51'))[_0x58c4('0x52')](_0x58c4('0x53'));var _0x59fb60=squel[_0x58c4('0x54')]()[_0x58c4('0x50')](_0x58c4('0x55'))[_0x58c4('0x50')]('u.fullname')[_0x58c4('0x50')]('ui.SmsInteractionId')[_0x58c4('0x52')](_0x58c4('0x56'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x10e1f1=squel[_0x58c4('0x54')]()[_0x58c4('0x52')](_0x58c4('0x57'),'i')[_0x58c4('0x58')](_0x58c4('0x59'),'c',_0x58c4('0x5a'))[_0x58c4('0x58')](_0x58c4('0x5b'),'o',_0x58c4('0x5c'))[_0x58c4('0x58')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x58c4('0x58')](_0x58c4('0x5d'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x58c4('0x58')]('sms_interaction_has_tags','it',_0x58c4('0x5e'))[_0x58c4('0x58')](_0x58c4('0x53'),'t',_0x58c4('0x5f'));var _0x2c6fab=squel[_0x58c4('0x60')]();var _0x25ee4d=[];var _0x14874d=squel['expr']();var _0x489dd2;if(_0x55f2d7[_0x58c4('0x45')]['search']){_0x489dd2=as[_0x58c4('0x61')](_0x55f2d7[_0x58c4('0x45')]['search']);var _0x4dc912=_0x489dd2[_0x58c4('0x62')];for(var _0x41159e=0x0;_0x41159e<_0x489dd2[_0x58c4('0x63')]['length'];_0x41159e++){var _0x5203ea=_0x489dd2[_0x58c4('0x63')][_0x41159e];var _0x18d5b3='i';var _0x265139=_['find'](_0x252862,['name',_0x5203ea[_0x58c4('0x50')]]);if(!_0x265139){switch(_0x5203ea[_0x58c4('0x50')]){case _0x58c4('0x64'):if(_0x5203ea[_0x58c4('0x65')]==0x1){_0x10e1f1[_0x58c4('0x66')]('`'+_0x5203ea[_0x58c4('0x50')]+_0x58c4('0x67'));}else{_0x10e1f1[_0x58c4('0x66')]('`'+_0x5203ea[_0x58c4('0x50')]+_0x58c4('0x68'));}break;case _0x58c4('0x69'):if(_0x5203ea[_0x58c4('0x6a')]===_0x58c4('0x6b')){if(_0x5203ea['value'][_0x58c4('0x34')]('\x20')[_0x58c4('0x4b')]>0x1){_0x2c6fab[_0x4dc912](_0x58c4('0x6c'),qs[_0x58c4('0x6d')](_0x5203ea['value']),null);}else{var _0x460d19='%'+_0x5203ea['value']+'%';_0x2c6fab[_0x4dc912]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x460d19,_0x460d19,_0x460d19);}}else{_0x265139=_['find'](_0x252862,['name',_0x58c4('0x6e')]);_0x5203ea[_0x58c4('0x50')]=_0x58c4('0x6e');_0x1ac53f=as[_0x58c4('0x6f')](_0x18d5b3,_0x265139[_0x58c4('0x42')],_0x5203ea);_0x2c6fab[_0x4dc912](_0x1ac53f[_0x58c4('0x70')],_0x1ac53f[_0x58c4('0x65')]['start'],_0x1ac53f[_0x58c4('0x65')][_0x58c4('0x21')]);}break;case'Tag':var _0x2da7e3=_0x5203ea[_0x58c4('0x65')][_0x58c4('0x34')](',')[_0x58c4('0x31')](function(_0x524ec3){return Number(_0x524ec3);});_0x2da7e3['forEach'](function(_0x38efea){_0x14874d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x38efea+',%');});_0x25ee4d=_['union'](_0x25ee4d,_0x2da7e3);break;case'User':if(_0x5203ea[_0x58c4('0x6a')]===_0x58c4('0x6b')){_0x2c6fab[_0x4dc912](_0x58c4('0x71'),'%'+_0x5203ea[_0x58c4('0x65')]+'%',null);}else{_0x265139=_[_0x58c4('0x72')](_0x252862,[_0x58c4('0x2e'),_0x58c4('0x3c')]);_0x5203ea['field']='UserId';_0x1ac53f=as[_0x58c4('0x6f')](_0x18d5b3,_0x265139[_0x58c4('0x42')],_0x5203ea);_0x2c6fab[_0x4dc912](_0x1ac53f[_0x58c4('0x70')],_0x1ac53f[_0x58c4('0x65')][_0x58c4('0x73')],_0x1ac53f[_0x58c4('0x65')][_0x58c4('0x21')]);}break;case _0x58c4('0x74'):_0x1ac53f=as[_0x58c4('0x6f')]('me',null,_0x5203ea);_0x2c6fab[_0x4dc912](_0x1ac53f[_0x58c4('0x70')],_0x1ac53f[_0x58c4('0x65')]['start'],_0x1ac53f[_0x58c4('0x65')][_0x58c4('0x21')]);break;}}else{var _0x1ac53f=as[_0x58c4('0x6f')](_0x18d5b3,_0x265139[_0x58c4('0x42')],_0x5203ea);_0x2c6fab[_0x4dc912](_0x1ac53f[_0x58c4('0x70')],_0x1ac53f[_0x58c4('0x65')][_0x58c4('0x73')],_0x1ac53f[_0x58c4('0x65')][_0x58c4('0x21')]);}}}else{var _0x1ca33e=_(_0x55f2d7[_0x58c4('0x45')])[_0x58c4('0x46')]()['map'](function(_0x18616d){return _['some'](_0x252862,[_0x58c4('0x2e'),_0x18616d])?_0x18616d:undefined;})[_0x58c4('0x75')]()[_0x58c4('0x65')]();if(!_['isEmpty'](_0x1ca33e)){_0x1ca33e[_0x58c4('0x35')](function(_0x366866){if(_0x366866===_0x58c4('0x76')){_0x10e1f1[_0x58c4('0x4f')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x55f2d7[_0x58c4('0x45')][_0x366866]));}else if(_0x366866===_0x58c4('0x77')){var _0x37670d=JSON[_0x58c4('0x78')](_0x55f2d7[_0x58c4('0x45')][_0x366866])[_0x58c4('0x79')];var _0x48a9af=JSON['parse'](_0x55f2d7[_0x58c4('0x45')][_0x366866])[_0x58c4('0x7a')];_0x10e1f1[_0x58c4('0x4f')](_0x58c4('0x7b'),_0x37670d,_0x48a9af);}else{if(_0x55f2d7[_0x58c4('0x45')][_0x366866]===_0x58c4('0x7c')){_0x10e1f1[_0x58c4('0x4f')]('i.'+_0x366866+_0x58c4('0x7d'));}else{_0x10e1f1[_0x58c4('0x4f')]('i.'+_0x366866+_0x58c4('0x7e'),_0x55f2d7[_0x58c4('0x45')][_0x366866]);}}});}if(_0x55f2d7['query'][_0x58c4('0x7f')]){if(_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x7f')]==0x1){_0x10e1f1[_0x58c4('0x66')](_0x58c4('0x80'));}else{_0x10e1f1[_0x58c4('0x66')](_0x58c4('0x81'));}}if(_0x55f2d7['query']['tag']){_0x25ee4d=_[_0x58c4('0x82')](_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x83')])?_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x83')]:new Array(_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x83')]);_0x25ee4d[_0x58c4('0x35')](function(_0x2099d7){_0x14874d['or'](_0x58c4('0x84'),'%,'+_0x2099d7+',%');});}if(_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x85')]){var _0x242ee5=_0x55f2d7['query'][_0x58c4('0x85')]['replace']('\x5c','\x5c\x5c')[_0x58c4('0x86')](/'/g,'\x27\x27');if(qs[_0x58c4('0x87')](_0x242ee5)){_0x2c6fab['or'](_0x58c4('0x88'),_0x242ee5+'%')['or'](_0x58c4('0x89'),_0x242ee5+'%');}else{_0x2c6fab['or'](_0x58c4('0x8a'),qs[_0x58c4('0x6d')](_0x242ee5))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x242ee5+'%');}}}_0x10e1f1[_0x58c4('0x4f')](_0x2c6fab);_0x10e1f1[_0x58c4('0x8b')](_0x58c4('0x8c'));var _0x31e4b1={'type':db[_0x58c4('0x8d')][_0x58c4('0x8e')][_0x58c4('0x8f')],'raw':!![]};var _0x5f2dc6=_0x10e1f1[_0x58c4('0x90')]();_0x5f2dc6[_0x58c4('0x50')](_0x58c4('0x8c'));_0x5f2dc6[_0x58c4('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x58c4('0x64'));if(_0x33269f['order']){_0x33269f[_0x58c4('0x91')]['forEach'](function(_0x317e40){var _0x5ef996=_0x317e40[0x0]===_0x58c4('0x92')?_0x317e40[0x0]:'i.'+_0x317e40[0x0];_0x10e1f1[_0x58c4('0x91')](_0x5ef996,_0x317e40[0x1]===_0x58c4('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x25ee4d)){_0x10e1f1[_0x58c4('0x66')](_0x14874d);_0x5f2dc6[_0x58c4('0x4f')]('t.id\x20IN\x20?',_0x25ee4d);}BPromise[_0x58c4('0x94')]()[_0x58c4('0x2b')](function(){if(!_0x489dd2){if(_0x55f2d7['query'][_0x58c4('0x76')])return;_0x5f2dc6[_0x58c4('0x4f')](_0x58c4('0x95'));_0x10e1f1[_0x58c4('0x4f')](_0x58c4('0x95'));return;}if(_0x55f2d7[_0x58c4('0x96')]['role']!==_0x58c4('0x97'))return;return _0x55f2d7[_0x58c4('0x96')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x58c4('0x2b')](function(_0x3b6325){if(_['isEmpty'](_0x3b6325)){_0x5f2dc6['where']('i.SmsAccountId\x20IS\x20NULL');_0x10e1f1['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x5f2dc6['where'](_0x58c4('0x98'),_[_0x58c4('0x31')](_0x3b6325,'id'));_0x10e1f1[_0x58c4('0x4f')](_0x58c4('0x98'),_['map'](_0x3b6325,'id'));}});})[_0x58c4('0x2b')](function(){if(_0x55f2d7[_0x58c4('0x96')][_0x58c4('0x99')]===_0x58c4('0x97')&&!_0x489dd2&&!_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x76')])return[];return db[_0x58c4('0x9a')][_0x58c4('0x45')](_0x5f2dc6[_0x58c4('0x9b')](),_0x31e4b1);})[_0x58c4('0x2b')](function(_0xdf14bb){_0x28aeca[_0x58c4('0x26')]=_0xdf14bb[_0x58c4('0x4b')];if(_0x28aeca[_0x58c4('0x26')]===0x0)return[];return db['sequelize'][_0x58c4('0x45')](_0xb635a2[_0x58c4('0x9b')](),_0x31e4b1)[_0x58c4('0x2b')](function(_0x36c47a){_0x578795=_[_0x58c4('0x9c')](_0x36c47a,'id');_0x31e4b1=_[_0x58c4('0x9d')](_0x31e4b1,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x55f2d7[_0x58c4('0x45')][_0x58c4('0x49')]){_0x33269f[_0x58c4('0x4a')][_0x58c4('0x35')](function(_0x40fae4){_0x10e1f1['field']('i.'+_0x40fae4);});}else{_0x10e1f1[_0x58c4('0x50')](_0x58c4('0x9e'),'unreadMessages');_0x10e1f1['field'](_0x58c4('0x9f'),_0x58c4('0xa0'));_0x10e1f1[_0x58c4('0x50')](_0x58c4('0xa1'),_0x58c4('0xa2'));_0x10e1f1[_0x58c4('0x50')](_0x58c4('0xa3'),_0x58c4('0x92'));_0x10e1f1[_0x58c4('0x50')](_0x58c4('0xa4'));_0x10e1f1[_0x58c4('0x50')](_0x58c4('0xa5'),'Contact.firstName');_0x10e1f1['field'](_0x58c4('0xa6'),_0x58c4('0xa7'));_0x10e1f1['field'](_0x58c4('0xa8'),_0x58c4('0xa9'));_0x10e1f1['field']('c.phone',_0x58c4('0xaa'));_0x10e1f1['field'](_0x58c4('0xab'),_0x58c4('0xac'));_0x10e1f1[_0x58c4('0x50')](_0x58c4('0xad'),_0x58c4('0xae'));_0x10e1f1[_0x58c4('0x50')](_0x58c4('0xaf'),_0x58c4('0xb0'));_0x10e1f1[_0x58c4('0x50')](_0x58c4('0xb1'),'Owner.internal');_0x10e1f1[_0x58c4('0x50')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x58c4('0x33'));}if(_0x33269f[_0x58c4('0x25')])_0x10e1f1[_0x58c4('0x25')](_0x33269f[_0x58c4('0x25')]);if(_0x33269f['offset'])_0x10e1f1[_0x58c4('0x23')](_0x33269f[_0x58c4('0x23')]);return db[_0x58c4('0x9a')][_0x58c4('0x45')](_0x10e1f1[_0x58c4('0x9b')](),_0x31e4b1);})[_0x58c4('0x2b')](function(_0x1f1176){if(_0x1f1176[_0x58c4('0x4b')]>0x0)_0x59fb60[_0x58c4('0x4f')](_0x58c4('0xb2'),_[_0x58c4('0x31')](_0x1f1176,'id'));return db[_0x58c4('0x9a')]['query'](_0x59fb60[_0x58c4('0x9b')](),_0x31e4b1)[_0x58c4('0x2b')](function(_0x52fd1f){var _0x4eeac0=_[_0x58c4('0xb3')](_0x52fd1f,_0x58c4('0xb4'));var _0x4def16=[];_0x1f1176['forEach'](function(_0x4c767c){_0x4def16[_0x58c4('0x36')](updateSmsInteraction(_0x4c767c,_0x578795,_0x4eeac0));});return BPromise[_0x58c4('0xb5')](_0x4def16);});});})['then'](function(_0x11e521){_0x28aeca[_0x58c4('0xb6')]=_0x11e521;return _0x28aeca;})[_0x58c4('0x2b')](respondWithFilteredResult(_0x3b271d,_0x33269f))[_0x58c4('0x37')](handleError(_0x3b271d,null));};exports[_0x58c4('0xb7')]=function(_0x2aff15,_0x28a3a7){var _0x2cca22={'raw':![],'where':{'id':_0x2aff15['params']['id']}},_0x2544de={};_0x2544de[_0x58c4('0x44')]=_[_0x58c4('0x46')](db[_0x58c4('0x40')][_0x58c4('0xb8')]);_0x2544de['query']=_[_0x58c4('0x46')](_0x2aff15['query']);_0x2544de['filters']=_[_0x58c4('0x48')](_0x2544de['model'],_0x2544de[_0x58c4('0x45')]);_0x2cca22['attributes']=_['intersection'](_0x2544de[_0x58c4('0x44')],qs[_0x58c4('0x49')](_0x2aff15[_0x58c4('0x45')][_0x58c4('0x49')]));_0x2cca22['attributes']=_0x2cca22['attributes'][_0x58c4('0x4b')]?_0x2cca22[_0x58c4('0x4a')]:_0x2544de[_0x58c4('0x44')];if(_0x2aff15[_0x58c4('0x45')][_0x58c4('0xb9')]){_0x2cca22['include']=[{'all':!![]}];}_0x2cca22=_[_0x58c4('0x9d')]({},_0x2cca22,_0x2aff15[_0x58c4('0xba')]);return db[_0x58c4('0x40')][_0x58c4('0x72')](_0x2cca22)[_0x58c4('0x2b')](handleEntityNotFound(_0x28a3a7,null))[_0x58c4('0x2b')](respondWithResult(_0x28a3a7,null))['catch'](handleError(_0x28a3a7,null));};exports[_0x58c4('0xbb')]=function(_0x1c9aaf,_0x4c658f){return db[_0x58c4('0x40')][_0x58c4('0xbb')](_0x1c9aaf[_0x58c4('0x74')],{})[_0x58c4('0x2b')](respondWithResult(_0x4c658f,0xc9))[_0x58c4('0x37')](handleError(_0x4c658f,null));};exports[_0x58c4('0xbc')]=function(_0x96963,_0x3aca93){if(_0x96963['body']['id']){delete _0x96963[_0x58c4('0x74')]['id'];}return db['SmsInteraction'][_0x58c4('0x72')]({'where':{'id':_0x96963['params']['id']}})[_0x58c4('0x2b')](handleEntityNotFound(_0x3aca93,null))[_0x58c4('0x2b')](saveUpdates(_0x96963[_0x58c4('0x74')],null))[_0x58c4('0x2b')](respondWithResult(_0x3aca93,null))['catch'](handleError(_0x3aca93,null));};exports['destroy']=function(_0x36caad,_0x4c85c9){return db[_0x58c4('0x40')][_0x58c4('0x72')]({'where':{'id':_0x36caad[_0x58c4('0xbd')]['id']}})[_0x58c4('0x2b')](handleEntityNotFound(_0x4c85c9,null))[_0x58c4('0x2b')](removeEntity(_0x4c85c9,null))[_0x58c4('0x37')](handleError(_0x4c85c9,null));};exports[_0x58c4('0xbe')]=function(_0x5c93d1,_0x11075d){return db['SmsInteraction'][_0x58c4('0xbe')]()[_0x58c4('0x2b')](respondWithResult(_0x11075d,null))[_0x58c4('0x37')](handleError(_0x11075d,null));};exports['addMessage']=function(_0x420305,_0x474fd4,_0x8f6da3){return db[_0x58c4('0xbf')][_0x58c4('0x72')]({'where':{'id':_0x420305[_0x58c4('0xbd')]['id']}})[_0x58c4('0x2b')](handleEntityNotFound(_0x474fd4,null))[_0x58c4('0x2b')](function(_0x29529d){if(_0x29529d){return _0x29529d['addMessage'](_0x420305['body'][_0x58c4('0xc0')],_[_0x58c4('0xc1')](_0x420305[_0x58c4('0x74')],[_0x58c4('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x474fd4,null))[_0x58c4('0x37')](handleError(_0x474fd4,null));};exports[_0x58c4('0xc2')]=function(_0xbe1446,_0x2f1fff,_0x5b13cd){var _0x267efc={'raw':![],'where':{}};var _0x1df4fb={};var _0x1c7a3e={'count':0x0,'rows':[]};return db[_0x58c4('0x40')][_0x58c4('0xc3')]({'where':{'id':_0xbe1446['params']['id']}})[_0x58c4('0x2b')](handleEntityNotFound(_0x2f1fff,null))[_0x58c4('0x2b')](function(_0x494868){if(_0x494868){_0x1df4fb[_0x58c4('0x44')]=_['keys'](db[_0x58c4('0xbf')][_0x58c4('0xb8')]);_0x1df4fb[_0x58c4('0x45')]=_['keys'](_0xbe1446[_0x58c4('0x45')]);_0x1df4fb[_0x58c4('0x47')]=_[_0x58c4('0x48')](_0x1df4fb[_0x58c4('0x44')],_0x1df4fb[_0x58c4('0x45')]);_0x267efc[_0x58c4('0x4a')]=_['intersection'](_0x1df4fb['model'],qs[_0x58c4('0x49')](_0xbe1446[_0x58c4('0x45')][_0x58c4('0x49')]));_0x267efc[_0x58c4('0x4a')]=_0x267efc[_0x58c4('0x4a')][_0x58c4('0x4b')]?_0x267efc[_0x58c4('0x4a')]:_0x1df4fb[_0x58c4('0x44')];if(!_0xbe1446[_0x58c4('0x45')][_0x58c4('0x4c')](_0x58c4('0x4d'))){_0x267efc['limit']=qs[_0x58c4('0x25')](_0xbe1446[_0x58c4('0x45')]['limit']);_0x267efc[_0x58c4('0x23')]=qs[_0x58c4('0x23')](_0xbe1446[_0x58c4('0x45')]['offset']);}_0x267efc[_0x58c4('0x91')]=qs[_0x58c4('0x4e')](_0xbe1446[_0x58c4('0x45')][_0x58c4('0x4e')]);_0x267efc[_0x58c4('0x4f')]=qs[_0x58c4('0x47')](_[_0x58c4('0xc4')](_0xbe1446[_0x58c4('0x45')],_0x1df4fb[_0x58c4('0x47')]));_0x267efc['where'][_0x58c4('0xb4')]=_0x494868['id'];if(_0xbe1446[_0x58c4('0x45')][_0x58c4('0x85')]){_0x267efc[_0x58c4('0x4f')]=_[_0x58c4('0x9d')](_0x267efc[_0x58c4('0x4f')],{'$or':_[_0x58c4('0x31')](_0x267efc[_0x58c4('0x4a')],function(_0x53b107){var _0x4f6045={};_0x4f6045[_0x53b107]={'$like':'%'+_0xbe1446[_0x58c4('0x45')][_0x58c4('0x85')]+'%'};return _0x4f6045;})});}if(_0xbe1446[_0x58c4('0x45')][_0x58c4('0x79')]){var _0x15d49b=_0xbe1446['query']['$gte']['split'](',');var _0xd78c45={};_0xd78c45[_0x15d49b[0x0]]={'$gte':moment(_0x15d49b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x267efc[_0x58c4('0x4f')]=_[_0x58c4('0x9d')](_0x267efc[_0x58c4('0x4f')],_0xd78c45);}_0x267efc=_[_0x58c4('0x9d')]({},_0x267efc,_0xbe1446[_0x58c4('0xba')]);return db[_0x58c4('0xbf')][_0x58c4('0x26')]({'where':_0x267efc[_0x58c4('0x4f')]})[_0x58c4('0x2b')](function(_0x285c97){_0x1c7a3e[_0x58c4('0x26')]=_0x285c97;if(_0xbe1446[_0x58c4('0x45')]['includeAll']){_0x267efc[_0x58c4('0xc5')]=[{'all':!![]}];}return db['SmsMessage'][_0x58c4('0xc6')](_0x267efc);})[_0x58c4('0x2b')](function(_0x17b81b){_0x1c7a3e[_0x58c4('0xb6')]=_0x17b81b;return _0x1c7a3e;});}})[_0x58c4('0x2b')](respondWithFilteredResult(_0x2f1fff,_0x267efc))['catch'](handleError(_0x2f1fff,null));};exports[_0x58c4('0xc7')]=function(_0x874cea,_0x352ef9,_0x25bcc2){return db[_0x58c4('0x40')][_0x58c4('0x72')]({'where':{'id':_0x874cea[_0x58c4('0xbd')]['id']}})[_0x58c4('0x2b')](handleEntityNotFound(_0x352ef9,null))[_0x58c4('0x2b')](function(_0x8ba0ac){if(_0x8ba0ac){return _0x8ba0ac[_0x58c4('0xc8')](_0x874cea[_0x58c4('0x74')][_0x58c4('0xc0')],_[_0x58c4('0xc1')](_0x874cea[_0x58c4('0x74')],[_0x58c4('0xc0'),'id'])||{})[_0x58c4('0xc9')](function(){return db[_0x58c4('0xca')][_0x58c4('0xc6')]({'attributes':['id','name',_0x58c4('0x51')],'where':{'id':_0x874cea[_0x58c4('0x74')][_0x58c4('0xc0')]}});})['then'](function(_0x135a16){socket['emit'](_0x58c4('0xcb'),{'id':Number(_0x874cea[_0x58c4('0xbd')]['id']),'tags':_0x135a16||[]});return{'id':Number(_0x874cea[_0x58c4('0xbd')]['id']),'tags':_0x135a16||[]};});}})[_0x58c4('0x2b')](respondWithResult(_0x352ef9,null))['catch'](handleError(_0x352ef9,null));};exports[_0x58c4('0xcc')]=function(_0x47948c,_0x95f09a,_0x4129f9){return db[_0x58c4('0x40')]['find']({'where':{'id':_0x47948c['params']['id']}})[_0x58c4('0x2b')](handleEntityNotFound(_0x95f09a,null))[_0x58c4('0x2b')](function(_0x90b2e9){if(_0x90b2e9){return _0x90b2e9['removeTags'](_0x47948c[_0x58c4('0x45')][_0x58c4('0xc0')]);}})[_0x58c4('0x2b')](respondWithStatusCode(_0x95f09a,null))['catch'](handleError(_0x95f09a,null));};exports[_0x58c4('0xcd')]=function(_0x3c72cb,_0x2534be){var _0x4a749e=moment()[_0x58c4('0xce')]()[_0x58c4('0x9b')]();var _0x35cf42=path[_0x58c4('0xcf')](config[_0x58c4('0xd0')],'server','files','tmp');var _0x174809=path['join'](config[_0x58c4('0xd0')],_0x58c4('0xd1'),_0x58c4('0xd2'),'attachments');var _0x269c59=path[_0x58c4('0xcf')](_0x35cf42,_0x4a749e);var _0x26fea8=util[_0x58c4('0xd3')](_0x58c4('0xd4'),_0x3c72cb[_0x58c4('0xbd')]['id'],_0x4a749e);var _0x1044b8=path['join'](_0x35cf42,_0x26fea8);var _0x9f016f=[];_0x9f016f['push']({'model':db[_0x58c4('0xd5')],'as':_0x58c4('0xd5'),'attributes':['id','fullname'],'raw':!![]});_0x9f016f[_0x58c4('0x36')]({'model':db[_0x58c4('0xd6')],'as':'Contact','attributes':['id',_0x58c4('0xd7'),_0x58c4('0xd8')],'raw':!![]});var _0x2cebcb=[{'model':db[_0x58c4('0xbf')],'as':_0x58c4('0xd9'),'attributes':['id',_0x58c4('0x74'),_0x58c4('0x77'),_0x58c4('0xda'),_0x58c4('0xdb'),_0x58c4('0x7f')],'include':_0x9f016f}];_0x2cebcb[_0x58c4('0x36')]({'model':db[_0x58c4('0xdc')],'as':_0x58c4('0xdd'),'attributes':['id','name']});_0x2cebcb[_0x58c4('0x36')]({'model':db['User'],'as':_0x58c4('0xde'),'attributes':['id',_0x58c4('0x32')]});return db['SmsInteraction']['find']({'where':{'id':_0x3c72cb[_0x58c4('0xbd')]['id']},'include':_0x2cebcb})[_0x58c4('0x2b')](handleEntityNotFound(_0x2534be,null))[_0x58c4('0x2b')](function(_0x322d81){if(_0x322d81){var _0x40397b=_0x322d81['get']({'plain':!![]});fs['mkdirSync'](_0x269c59);var _0x49d821={'channel':'Sms','account':_0x40397b[_0x58c4('0xdd')][_0x58c4('0x2e')],'agent':_0x40397b[_0x58c4('0xde')]?_0x40397b[_0x58c4('0xde')][_0x58c4('0x32')]:_0x58c4('0xdf'),'createdAt':moment(_0x40397b[_0x58c4('0x77')])[_0x58c4('0xd3')](_0x58c4('0xe0'))[_0x58c4('0x9b')](),'closedAt':_0x40397b[_0x58c4('0x3b')]?moment(_0x40397b[_0x58c4('0xe1')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x58c4('0x9b')]():'','disposition':_0x40397b[_0x58c4('0xe2')],'messages':_(_0x40397b[_0x58c4('0xd9')])['filter']({'secret':![]})[_0x58c4('0x31')](function(_0xd69cee){return{'date':moment(_0xd69cee[_0x58c4('0x77')])[_0x58c4('0xd3')](_0x58c4('0xe0'))['toString'](),'sender':_0xd69cee[_0x58c4('0xda')]===_0x58c4('0xe3')?_0xd69cee[_0x58c4('0xd5')]?_0xd69cee[_0x58c4('0xd5')][_0x58c4('0x32')]:_0x58c4('0xe4'):_0xd69cee['Contact'][_0x58c4('0xd7')]+(_0xd69cee[_0x58c4('0x69')]['lastName']?'\x20'+_0xd69cee[_0x58c4('0x69')][_0x58c4('0xd8')]:''),'body':_0xd69cee[_0x58c4('0x74')],'direction':_0xd69cee[_0x58c4('0xda')]===_0x58c4('0xe3')?'A':'C','secret':_0xd69cee[_0x58c4('0xdb')],'read':_0xd69cee[_0x58c4('0x7f')]};})[_0x58c4('0x65')]()};return ejs[_0x58c4('0xe5')](path[_0x58c4('0xcf')](config['root'],_0x58c4('0xd1'),_0x58c4('0xe6'),_0x58c4('0xe7')),{'interaction':_0x49d821})['then'](function(_0x583a8e){var _0x36187d=path[_0x58c4('0xcf')](_0x269c59,_0x58c4('0xe8')+_0x40397b['id']+'-'+_0x4a749e+_0x58c4('0xe9'));var _0x2a2898={'path':_0x36187d,'channel':_0x58c4('0xea'),'interactionId':_0x40397b['id']};return pdf['createPdfFromHTML'](_0x583a8e,_0x2a2898);})[_0x58c4('0x2b')](function(){return new BPromise(function(_0x4a59c8,_0x2d39fe){zipdir(_0x269c59,{'saveTo':_0x1044b8},function(_0x3614be,_0x2522c2){if(_0x3614be)return _0x2d39fe(_0x3614be);return _0x4a59c8(_0x2522c2);});})['then'](function(){return new BPromise(function(_0x41f9ed,_0x4ff1b6){rimraf(_0x269c59,function(_0x4e9291){if(_0x4e9291)_0x4ff1b6(_0x4e9291);return _0x41f9ed();});});})[_0x58c4('0x2b')](function(){return _0x2534be[_0x58c4('0xcd')](_0x1044b8,_0x26fea8,function(_0x47cbad){if(_0x47cbad){console[_0x58c4('0xeb')](_0x58c4('0xec'),_0x47cbad);}else{fs['unlinkSync'](_0x1044b8);}});});});}else{return _0x2534be['sendStatus'](0xc8);}})[_0x58c4('0x37')](handleError(_0x2534be,null));};
\ No newline at end of file
index eff0512..8986c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4213=['getUsers','setDataValue','Users','map','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove'];(function(_0x37f9fa,_0x4acb2d){var _0x3e4ffe=function(_0x802327){while(--_0x802327){_0x37f9fa['push'](_0x37f9fa['shift']());}};_0x3e4ffe(++_0x4acb2d);}(_0x4213,0x77));var _0x3421=function(_0x45335d,_0x209a29){_0x45335d=_0x45335d-0x0;var _0x116872=_0x4213[_0x45335d];return _0x116872;};'use strict';var EventEmitter=require(_0x3421('0x0'));var SmsInteraction=require(_0x3421('0x1'))['db'][_0x3421('0x2')];var SmsMessage=require(_0x3421('0x1'))['db'][_0x3421('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3421('0x4')](0x0);var events={'afterCreate':_0x3421('0x5'),'afterUpdate':'update','afterDestroy':_0x3421('0x6')};function emitEvent(_0x5c3719){return function(_0x459c5e,_0xfe969c,_0x2155f8){_0x459c5e[_0x3421('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x50e464){_0x459c5e[_0x3421('0x8')](_0x3421('0x9'),_0x50e464[_0x3421('0xa')](function(_0x13b0dd){return{'id':_0x13b0dd['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x459c5e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3421('0xb')](function(_0x58d511){_0x459c5e['setDataValue'](_0x3421('0xc'),_0x58d511['length']);SmsInteractionEvents[_0x3421('0xd')](_0x5c3719+':'+_0x459c5e['id'],_0x459c5e);SmsInteractionEvents[_0x3421('0xd')](_0x5c3719,_0x459c5e);_0x2155f8(null);})[_0x3421('0xe')](_0x2155f8(null));};}for(var e in events){if(events[_0x3421('0xf')](e)){var event=events[e];SmsInteraction[_0x3421('0x10')](e,emitEvent(event));}}module[_0x3421('0x11')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xfcbb=['catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x9844c2,_0x4a6e0a){var _0x425407=function(_0x36141d){while(--_0x36141d){_0x9844c2['push'](_0x9844c2['shift']());}};_0x425407(++_0x4a6e0a);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x39ce97,_0x2b1de2){_0x39ce97=_0x39ce97-0x0;var _0x22ce4f=_0xfcbb[_0x39ce97];return _0x22ce4f;};'use strict';var EventEmitter=require(_0xbfcb('0x0'));var SmsInteraction=require(_0xbfcb('0x1'))['db'][_0xbfcb('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xbfcb('0x3')](0x0);var events={'afterCreate':_0xbfcb('0x4'),'afterUpdate':_0xbfcb('0x5'),'afterDestroy':_0xbfcb('0x6')};function emitEvent(_0x1d8b50){return function(_0x5c5a1a,_0x5201d3,_0x32c2aa){_0x5c5a1a[_0xbfcb('0x7')]({'attributes':['id'],'raw':!![]})[_0xbfcb('0x8')](function(_0x2df839){_0x5c5a1a[_0xbfcb('0x9')](_0xbfcb('0xa'),_0x2df839[_0xbfcb('0xb')](function(_0x571001){return{'id':_0x571001['id']};}));return SmsMessage[_0xbfcb('0xc')]({'where':{'SmsInteractionId':_0x5c5a1a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbfcb('0x8')](function(_0x346685){_0x5c5a1a['setDataValue'](_0xbfcb('0xd'),_0x346685[_0xbfcb('0xe')]);SmsInteractionEvents[_0xbfcb('0xf')](_0x1d8b50+':'+_0x5c5a1a['id'],_0x5c5a1a);SmsInteractionEvents[_0xbfcb('0xf')](_0x1d8b50,_0x5c5a1a);_0x32c2aa(null);})[_0xbfcb('0x10')](_0x32c2aa(null));};}for(var e in events){if(events[_0xbfcb('0x11')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xbfcb('0x12')]=SmsInteractionEvents;
\ No newline at end of file
index c8c1424..34d05d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe847=['YYYY-MM-DD\x20HH:mm:ss','util','api','bluebird','request-promise','rimraf','./smsInteraction.attributes','exports','SmsInteraction','changed','closed'];(function(_0x5767a4,_0x256634){var _0x94cb0c=function(_0x41f1f2){while(--_0x41f1f2){_0x5767a4['push'](_0x5767a4['shift']());}};_0x94cb0c(++_0x256634);}(_0xe847,0x9b));var _0x7e84=function(_0x58c20e,_0x5ef5c5){_0x58c20e=_0x58c20e-0x0;var _0x276542=_0xe847[_0x58c20e];return _0x276542;};'use strict';var _=require('lodash');var util=require(_0x7e84('0x0'));var logger=require('../../config/logger')(_0x7e84('0x1'));var moment=require('moment');var BPromise=require(_0x7e84('0x2'));var rp=require(_0x7e84('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e84('0x4'));var config=require('../../config/environment');var attributes=require(_0x7e84('0x5'));module[_0x7e84('0x6')]=function(_0x2da225,_0x495687){return _0x2da225['define'](_0x7e84('0x7'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x41f8bf,_0x1d8965,_0x1e5cf1){if(_0x41f8bf[_0x7e84('0x8')](_0x7e84('0x9'))){_0x41f8bf['closedAt']=moment()['format'](_0x7e84('0xa'));}_0x1e5cf1(null,_0x41f8bf);}}});};
\ No newline at end of file
+var _0x5818=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','../../config/environment','define','SmsInteraction','changed'];(function(_0x549382,_0x52e970){var _0xb0e71b=function(_0xc6bdce){while(--_0xc6bdce){_0x549382['push'](_0x549382['shift']());}};_0xb0e71b(++_0x52e970);}(_0x5818,0x19c));var _0x8581=function(_0x235d0a,_0x4f8cc0){_0x235d0a=_0x235d0a-0x0;var _0x95e3bb=_0x5818[_0x235d0a];return _0x95e3bb;};'use strict';var _=require(_0x8581('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8581('0x1'));var moment=require(_0x8581('0x2'));var BPromise=require(_0x8581('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8581('0x4'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x587c39,_0x4bb5d3){return _0x587c39[_0x8581('0x5')](_0x8581('0x6'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ef690,_0x50d625,_0x558ce9){if(_0x4ef690[_0x8581('0x7')](_0x8581('0x8'))){_0x4ef690[_0x8581('0x9')]=moment()[_0x8581('0xa')](_0x8581('0xb'));}_0x558ce9(null,_0x4ef690);}}});};
\ No newline at end of file
index ef1eaca..365b8f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f07=['update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','SmsInteraction'];(function(_0x1f2ac8,_0x3d09fb){var _0x46e56a=function(_0x36d9e1){while(--_0x36d9e1){_0x1f2ac8['push'](_0x1f2ac8['shift']());}};_0x46e56a(++_0x3d09fb);}(_0x2f07,0x1d1));var _0x72f0=function(_0xb0546e,_0x2bb10c){_0xb0546e=_0xb0546e-0x0;var _0x47b8ae=_0x2f07[_0xb0546e];return _0x47b8ae;};'use strict';var _=require(_0x72f0('0x0'));var util=require(_0x72f0('0x1'));var moment=require(_0x72f0('0x2'));var BPromise=require(_0x72f0('0x3'));var rs=require(_0x72f0('0x4'));var fs=require('fs');var Redis=require(_0x72f0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x72f0('0x6'));var logger=require(_0x72f0('0x7'))('rpc');var config=require(_0x72f0('0x8'));var jayson=require(_0x72f0('0x9'));var client=jayson['client'][_0x72f0('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x72f0('0xb')],{'host':_0x72f0('0xc'),'port':0x18eb});var socket=require(_0x72f0('0xd'))(new Redis(config[_0x72f0('0xb')]));require(_0x72f0('0xe'))[_0x72f0('0xf')](socket);function respondWithRpcPromise(_0x41b45b,_0x3f60e7,_0x58e7f5){return new BPromise(function(_0x242dfc,_0x1ed6a0){return client[_0x72f0('0x10')](_0x41b45b,_0x58e7f5)[_0x72f0('0x11')](function(_0x1ba3d1){logger[_0x72f0('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x3f60e7,_0x72f0('0x13'));logger[_0x72f0('0x14')](_0x72f0('0x15'),_0x3f60e7,'request\x20sent',JSON[_0x72f0('0x16')](_0x1ba3d1));if(_0x1ba3d1[_0x72f0('0x17')]){if(_0x1ba3d1['error'][_0x72f0('0x18')]===0x1f4){logger[_0x72f0('0x17')](_0x72f0('0x19'),_0x3f60e7,_0x1ba3d1[_0x72f0('0x17')][_0x72f0('0x1a')]);return _0x1ed6a0(_0x1ba3d1['error'][_0x72f0('0x1a')]);}logger[_0x72f0('0x17')](_0x72f0('0x19'),_0x3f60e7,_0x1ba3d1['error'][_0x72f0('0x1a')]);return _0x242dfc(_0x1ba3d1[_0x72f0('0x17')][_0x72f0('0x1a')]);}else{logger[_0x72f0('0x12')](_0x72f0('0x19'),_0x3f60e7,'request\x20sent');_0x242dfc(_0x1ba3d1[_0x72f0('0x1b')]['message']);}})[_0x72f0('0x1c')](function(_0x3c60bf){logger[_0x72f0('0x17')](_0x72f0('0x19'),_0x3f60e7,_0x3c60bf);_0x1ed6a0(_0x3c60bf);});});}exports['UpdateSmsInteraction']=function(_0x230c88){var _0x1bab1b=this;return new Promise(function(_0x46bc1a,_0x501760){return db[_0x72f0('0x1d')][_0x72f0('0x1e')](_0x230c88[_0x72f0('0x1f')],{'raw':_0x230c88[_0x72f0('0x20')]?_0x230c88[_0x72f0('0x20')][_0x72f0('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x230c88[_0x72f0('0x20')]?_0x230c88['options'][_0x72f0('0x22')]||null:null,'attributes':_0x230c88[_0x72f0('0x20')]?_0x230c88[_0x72f0('0x20')][_0x72f0('0x23')]||null:null,'limit':_0x230c88[_0x72f0('0x20')]?_0x230c88[_0x72f0('0x20')][_0x72f0('0x24')]||null:null})[_0x72f0('0x11')](function(_0x2d824f){logger[_0x72f0('0x12')](_0x72f0('0x25'),_0x230c88);logger['debug'](_0x72f0('0x25'),_0x230c88,JSON['stringify'](_0x2d824f));_0x46bc1a(_0x2d824f);})[_0x72f0('0x1c')](function(_0x5012db){logger['error'](_0x72f0('0x25'),_0x5012db[_0x72f0('0x1a')],_0x230c88);_0x501760(_0x1bab1b[_0x72f0('0x17')](0x1f4,_0x5012db['message']));});});};exports[_0x72f0('0x26')]=function(_0x2c59ce){return new Promise(function(_0x769b68,_0x570407){return db['SmsInteraction'][_0x72f0('0x27')]({'where':_0x2c59ce[_0x72f0('0x20')]?_0x2c59ce[_0x72f0('0x20')]['where']||null:null})['then'](function(_0x171854){if(_0x171854){return _0x171854[_0x72f0('0x28')](_0x2c59ce[_0x72f0('0x1f')][_0x72f0('0x29')],_[_0x72f0('0x2a')](_0x2c59ce[_0x72f0('0x1f')],[_0x72f0('0x29'),'id'])||{});}})[_0x72f0('0x2b')](function(_0x3af0c2){logger[_0x72f0('0x12')](_0x72f0('0x2c'),_0x2c59ce);logger[_0x72f0('0x14')](_0x72f0('0x2c'),_0x2c59ce,JSON[_0x72f0('0x16')](_0x3af0c2));_0x769b68(_0x3af0c2);})['catch'](function(_0x4b0db4){logger[_0x72f0('0x17')](_0x72f0('0x2c'),_0x4b0db4['message'],_0x2c59ce);_0x570407(_this[_0x72f0('0x17')](0x1f4,_0x4b0db4[_0x72f0('0x1a')]));});});};
\ No newline at end of file
+var _0xf39d=['AddTagsToSmsInteraction','SmsInteraction','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateSmsInteraction','update','options','raw','where','attributes','limit','debug'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf39d,0xab));var _0xdf39=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0xf39d[_0x460fd7];return _0x44d1c2;};'use strict';var _=require(_0xdf39('0x0'));var util=require(_0xdf39('0x1'));var moment=require(_0xdf39('0x2'));var BPromise=require(_0xdf39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf39('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf39('0x5'));var logger=require(_0xdf39('0x6'))(_0xdf39('0x7'));var config=require(_0xdf39('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdf39('0x9')]['http']({'port':0x232a});config['redis']=_[_0xdf39('0xa')](config[_0xdf39('0xb')],{'host':_0xdf39('0xc'),'port':0x18eb});var socket=require(_0xdf39('0xd'))(new Redis(config[_0xdf39('0xb')]));require(_0xdf39('0xe'))[_0xdf39('0xf')](socket);function respondWithRpcPromise(_0x1b903e,_0x28b8b8,_0x173e80){return new BPromise(function(_0xd5b2d1,_0xf4fd60){return client[_0xdf39('0x10')](_0x1b903e,_0x173e80)[_0xdf39('0x11')](function(_0x22202f){logger[_0xdf39('0x12')](_0xdf39('0x13'),_0x28b8b8,'request\x20sent');logger['debug'](_0xdf39('0x14'),_0x28b8b8,_0xdf39('0x15'),JSON[_0xdf39('0x16')](_0x22202f));if(_0x22202f[_0xdf39('0x17')]){if(_0x22202f[_0xdf39('0x17')]['code']===0x1f4){logger[_0xdf39('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x28b8b8,_0x22202f[_0xdf39('0x17')]['message']);return _0xf4fd60(_0x22202f[_0xdf39('0x17')]['message']);}logger[_0xdf39('0x17')](_0xdf39('0x13'),_0x28b8b8,_0x22202f[_0xdf39('0x17')][_0xdf39('0x18')]);return _0xd5b2d1(_0x22202f['error'][_0xdf39('0x18')]);}else{logger[_0xdf39('0x12')](_0xdf39('0x13'),_0x28b8b8,_0xdf39('0x15'));_0xd5b2d1(_0x22202f['result'][_0xdf39('0x18')]);}})[_0xdf39('0x19')](function(_0x1d3ed0){logger[_0xdf39('0x17')](_0xdf39('0x13'),_0x28b8b8,_0x1d3ed0);_0xf4fd60(_0x1d3ed0);});});}exports[_0xdf39('0x1a')]=function(_0x1c009b){var _0x5a621b=this;return new Promise(function(_0x312642,_0x265a48){return db['SmsInteraction'][_0xdf39('0x1b')](_0x1c009b['body'],{'raw':_0x1c009b[_0xdf39('0x1c')]?_0x1c009b['options'][_0xdf39('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c009b[_0xdf39('0x1c')]?_0x1c009b[_0xdf39('0x1c')][_0xdf39('0x1e')]||null:null,'attributes':_0x1c009b[_0xdf39('0x1c')]?_0x1c009b['options'][_0xdf39('0x1f')]||null:null,'limit':_0x1c009b[_0xdf39('0x1c')]?_0x1c009b['options'][_0xdf39('0x20')]||null:null})[_0xdf39('0x11')](function(_0xdc236a){logger['info'](_0xdf39('0x1a'),_0x1c009b);logger[_0xdf39('0x21')](_0xdf39('0x1a'),_0x1c009b,JSON[_0xdf39('0x16')](_0xdc236a));_0x312642(_0xdc236a);})[_0xdf39('0x19')](function(_0xb2211c){logger[_0xdf39('0x17')](_0xdf39('0x1a'),_0xb2211c[_0xdf39('0x18')],_0x1c009b);_0x265a48(_0x5a621b[_0xdf39('0x17')](0x1f4,_0xb2211c['message']));});});};exports[_0xdf39('0x22')]=function(_0x267ba3){return new Promise(function(_0x1878f4,_0x325023){return db[_0xdf39('0x23')]['find']({'where':_0x267ba3[_0xdf39('0x1c')]?_0x267ba3['options'][_0xdf39('0x1e')]||null:null})['then'](function(_0xee6595){if(_0xee6595){return _0xee6595['addTags'](_0x267ba3[_0xdf39('0x24')][_0xdf39('0x25')],_[_0xdf39('0x26')](_0x267ba3[_0xdf39('0x24')],['ids','id'])||{});}})[_0xdf39('0x27')](function(_0x506048){logger[_0xdf39('0x12')]('AddTags',_0x267ba3);logger['debug'](_0xdf39('0x28'),_0x267ba3,JSON[_0xdf39('0x16')](_0x506048));_0x1878f4(_0x506048);})[_0xdf39('0x19')](function(_0x2b4ca5){logger[_0xdf39('0x17')](_0xdf39('0x28'),_0x2b4ca5[_0xdf39('0x18')],_0x267ba3);_0x325023(_this['error'](0x1f4,_0x2b4ca5[_0xdf39('0x18')]));});});};
\ No newline at end of file
index df13a04..84bffe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4fd=['emit','removeListener','register','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xd4fd,0x1b4));var _0xdd4f=function(_0x4b362d,_0x1c08ef){_0x4b362d=_0x4b362d-0x0;var _0x58ab0e=_0xd4fd[_0x4b362d];return _0x58ab0e;};'use strict';var SmsInteractionEvents=require(_0xdd4f('0x0'));var events=[_0xdd4f('0x1'),_0xdd4f('0x2'),_0xdd4f('0x3')];function createListener(_0x4b1a4d,_0xfc43d){return function(_0x2350d1){_0xfc43d[_0xdd4f('0x4')](_0x4b1a4d,_0x2350d1);};}function removeListener(_0x380b71,_0xa16236){return function(){SmsInteractionEvents[_0xdd4f('0x5')](_0x380b71,_0xa16236);};}exports[_0xdd4f('0x6')]=function(_0x1b8285){for(var _0x659bb2=0x0,_0x47bad8=events['length'];_0x659bb2<_0x47bad8;_0x659bb2++){var _0x1fe6bd=events[_0x659bb2];var _0x3b8769=createListener(_0xdd4f('0x7')+_0x1fe6bd,_0x1b8285);SmsInteractionEvents['on'](_0x1fe6bd,_0x3b8769);}};
\ No newline at end of file
+var _0x283a=['emit','removeListener','register','length','./smsInteraction.events','save','remove','update'];(function(_0x3db86b,_0xc3ca3e){var _0x34a8e1=function(_0x2ac2e7){while(--_0x2ac2e7){_0x3db86b['push'](_0x3db86b['shift']());}};_0x34a8e1(++_0xc3ca3e);}(_0x283a,0x104));var _0xa283=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x283a[_0x43dc7e];return _0x21e12d;};'use strict';var SmsInteractionEvents=require(_0xa283('0x0'));var events=[_0xa283('0x1'),_0xa283('0x2'),_0xa283('0x3')];function createListener(_0x27a92d,_0xa7a548){return function(_0x55fcc7){_0xa7a548[_0xa283('0x4')](_0x27a92d,_0x55fcc7);};}function removeListener(_0xd9cee9,_0x2075d4){return function(){SmsInteractionEvents[_0xa283('0x5')](_0xd9cee9,_0x2075d4);};}exports[_0xa283('0x6')]=function(_0x38c3af){for(var _0x4a9681=0x0,_0x4c9870=events[_0xa283('0x7')];_0x4a9681<_0x4c9870;_0x4a9681++){var _0x228c63=events[_0x4a9681];var _0x738d70=createListener('smsInteraction:'+_0x228c63,_0x38c3af);SmsInteractionEvents['on'](_0x228c63,_0x738d70);}};
\ No newline at end of file
index fee9b05..8da5b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b51=['describe','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated'];(function(_0x1e3116,_0x3b2e5c){var _0x3a5501=function(_0x51b726){while(--_0x51b726){_0x1e3116['push'](_0x1e3116['shift']());}};_0x3a5501(++_0x3b2e5c);}(_0x9b51,0x1d2));var _0x19b5=function(_0x18bf62,_0x2e2687){_0x18bf62=_0x18bf62-0x0;var _0x4ed65b=_0x9b51[_0x18bf62];return _0x4ed65b;};'use strict';var multer=require(_0x19b5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x19b5('0x1'));var express=require(_0x19b5('0x2'));var router=express['Router']();var fs_extra=require(_0x19b5('0x3'));var auth=require(_0x19b5('0x4'));var interaction=require(_0x19b5('0x5'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x19b5('0x6')]('/',auth['isAuthenticated'](),controller[_0x19b5('0x7')]);router[_0x19b5('0x6')](_0x19b5('0x8'),auth[_0x19b5('0x9')](),controller[_0x19b5('0xa')]);router[_0x19b5('0x6')](_0x19b5('0xb'),auth['isAuthenticated'](),controller[_0x19b5('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x19b5('0xd')](_0x19b5('0xe'),_0x19b5('0xf')),controller[_0x19b5('0x10')]);router[_0x19b5('0x11')](_0x19b5('0x12'),controller[_0x19b5('0x13')]);router[_0x19b5('0x14')](_0x19b5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x19b5('0x14')](_0x19b5('0x15'),auth[_0x19b5('0x9')](),controller[_0x19b5('0x16')]);router[_0x19b5('0x14')](_0x19b5('0x17'),auth['isAuthenticated'](),controller[_0x19b5('0x18')]);router[_0x19b5('0x19')](_0x19b5('0xb'),auth[_0x19b5('0x9')](),controller[_0x19b5('0x1a')]);module[_0x19b5('0x1b')]=router;
\ No newline at end of file
+var _0x6d1a=['./smsMessage.controller','get','/describe','isAuthenticated','/:id','show','post','tracked','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2dcb63,_0x28872f){var _0x295f8e=function(_0x1577df){while(--_0x1577df){_0x2dcb63['push'](_0x2dcb63['shift']());}};_0x295f8e(++_0x28872f);}(_0x6d1a,0x1c0));var _0xa6d1=function(_0x20a233,_0x485bf1){_0x20a233=_0x20a233-0x0;var _0x4bd9c6=_0x6d1a[_0x20a233];return _0x4bd9c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa6d1('0x0'));var timeout=require(_0xa6d1('0x1'));var express=require(_0xa6d1('0x2'));var router=express[_0xa6d1('0x3')]();var fs_extra=require(_0xa6d1('0x4'));var auth=require(_0xa6d1('0x5'));var interaction=require(_0xa6d1('0x6'));var config=require(_0xa6d1('0x7'));var controller=require(_0xa6d1('0x8'));router[_0xa6d1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa6d1('0xa'),auth[_0xa6d1('0xb')](),controller['describe']);router[_0xa6d1('0x9')](_0xa6d1('0xc'),auth[_0xa6d1('0xb')](),controller[_0xa6d1('0xd')]);router[_0xa6d1('0xe')]('/',auth[_0xa6d1('0xb')](),interaction[_0xa6d1('0xf')]('sms','smsmessage:create'),controller['create']);router[_0xa6d1('0xe')](_0xa6d1('0x10'),controller['status']);router[_0xa6d1('0x11')](_0xa6d1('0xc'),auth['isAuthenticated'](),controller[_0xa6d1('0x12')]);router[_0xa6d1('0x11')](_0xa6d1('0x13'),auth[_0xa6d1('0xb')](),controller[_0xa6d1('0x14')]);router['put'](_0xa6d1('0x15'),auth[_0xa6d1('0xb')](),controller[_0xa6d1('0x16')]);router['delete'](_0xa6d1('0xc'),auth[_0xa6d1('0xb')](),controller['destroy']);module[_0xa6d1('0x17')]=router;
\ No newline at end of file
index c2cbf75..6eeb42e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7488=['DATE','TEXT','sequelize','exports','BOOLEAN','ENUM','out','STRING'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7488,0x19a));var _0x8748=function(_0x2ed79b,_0x32ba6a){_0x2ed79b=_0x2ed79b-0x0;var _0x4aecd8=_0x7488[_0x2ed79b];return _0x4aecd8;};'use strict';var Sequelize=require(_0x8748('0x0'));module[_0x8748('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8748('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8748('0x3')]('in',_0x8748('0x4')),'defaultValue':_0x8748('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x8748('0x5')]},'readAt':{'type':Sequelize[_0x8748('0x6')]},'secret':{'type':Sequelize[_0x8748('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8748('0x5')]},'providerResponse':{'type':Sequelize[_0x8748('0x7')]}};
\ No newline at end of file
+var _0x8185=['sequelize','exports','out','STRING','BOOLEAN','TEXT'];(function(_0xd42933,_0x42dc08){var _0xd7cfba=function(_0x568b33){while(--_0x568b33){_0xd42933['push'](_0xd42933['shift']());}};_0xd7cfba(++_0x42dc08);}(_0x8185,0xc6));var _0x5818=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x8185[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0x5818('0x0'));module[_0x5818('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5818('0x2')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x5818('0x3')](0xbe)},'phone':{'type':Sequelize[_0x5818('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x5818('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5818('0x3')]},'providerResponse':{'type':Sequelize[_0x5818('0x5')]}};
\ No newline at end of file
index 4fda7f8..e34f16a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb7e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsMessage','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','internal','manual','format','channel','motionChannel','event','accept','EventManager','acceptmessage','sms-interactions','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','email','interface','SIP/%s','rejectmessage','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','inspect','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb7e,0x11a));var _0xedb7=function(_0x271bc5,_0x5b0a84){_0x271bc5=_0x271bc5-0x0;var _0x1f0dcd=_0xdb7e[_0x271bc5];return _0x1f0dcd;};'use strict';var emlformat=require(_0xedb7('0x0'));var rimraf=require(_0xedb7('0x1'));var zipdir=require(_0xedb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedb7('0x3'));var moment=require(_0xedb7('0x4'));var BPromise=require(_0xedb7('0x5'));var Mustache=require('mustache');var util=require(_0xedb7('0x6'));var path=require(_0xedb7('0x7'));var sox=require(_0xedb7('0x8'));var csv=require(_0xedb7('0x9'));var ejs=require(_0xedb7('0xa'));var fs=require('fs');var fs_extra=require(_0xedb7('0xb'));var _=require(_0xedb7('0xc'));var squel=require(_0xedb7('0xd'));var crypto=require(_0xedb7('0xe'));var jsforce=require(_0xedb7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xedb7('0x9'));var querystring=require(_0xedb7('0x10'));var Papa=require(_0xedb7('0x11'));var Redis=require(_0xedb7('0x12'));var authService=require(_0xedb7('0x13'));var qs=require(_0xedb7('0x14'));var as=require(_0xedb7('0x15'));var hardwareService=require(_0xedb7('0x16'));var logger=require(_0xedb7('0x17'))(_0xedb7('0x18'));var utils=require(_0xedb7('0x19'));var config=require(_0xedb7('0x1a'));var licenseUtil=require(_0xedb7('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xedb7('0x1c')](config[_0xedb7('0x1d')],{'host':_0xedb7('0x1e'),'port':0x18eb});var socket=require(_0xedb7('0x1f'))(new Redis(config[_0xedb7('0x1d')]));require(_0xedb7('0x20'))[_0xedb7('0x21')](socket);var jayson=require(_0xedb7('0x22'));var client=jayson[_0xedb7('0x23')]['http']({'port':0x232c});var client9002=jayson['client'][_0xedb7('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x119d3a,_0x196b3c,_0x552f9a,_0x23b06b){return new BPromise(function(_0x3ce7c5,_0x33554d){var _0x1c523f=_0x23b06b||client;return _0x1c523f[_0xedb7('0x25')](_0x119d3a,_0x552f9a)['then'](function(_0x5d2d6a){logger[_0xedb7('0x26')](_0xedb7('0x27'),_0x196b3c,_0xedb7('0x28'));logger[_0xedb7('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x196b3c,_0xedb7('0x28'),JSON[_0xedb7('0x2a')](_0x5d2d6a));if(_0x5d2d6a[_0xedb7('0x2b')]){if(_0x5d2d6a['error'][_0xedb7('0x2c')]===0x1f4){logger['error'](_0xedb7('0x27'),_0x196b3c,_0x5d2d6a[_0xedb7('0x2b')][_0xedb7('0x2d')]);return _0x33554d(_0x5d2d6a['error']['message']);}logger[_0xedb7('0x2b')](_0xedb7('0x27'),_0x196b3c,_0x5d2d6a['error'][_0xedb7('0x2d')]);return _0x3ce7c5(_0x5d2d6a[_0xedb7('0x2b')]['message']);}else{logger[_0xedb7('0x26')]('SmsMessage,\x20%s,\x20%s',_0x196b3c,'request\x20sent');_0x3ce7c5(_0x5d2d6a[_0xedb7('0x2e')][_0xedb7('0x2d')]);}})['catch'](function(_0x1ad4e9){logger[_0xedb7('0x2b')](_0xedb7('0x27'),_0x196b3c,_0x1ad4e9);_0x33554d(_0x1ad4e9);});});}function respondWithStatusCode(_0x172ebf,_0x2bcf43){_0x2bcf43=_0x2bcf43||0xcc;return function(_0xeb222d){if(_0xeb222d){return _0x172ebf[_0xedb7('0x2f')](_0x2bcf43);}return _0x172ebf[_0xedb7('0x30')](_0x2bcf43)['end']();};}function respondWithResult(_0x2070b8,_0x509106){_0x509106=_0x509106||0xc8;return function(_0x4d269e){if(_0x4d269e){return _0x2070b8[_0xedb7('0x30')](_0x509106)[_0xedb7('0x31')](_0x4d269e);}};}function respondWithFilteredResult(_0x55fe73,_0x4896a5){return function(_0x31bebf){if(_0x31bebf){var _0x515ab1=typeof _0x4896a5[_0xedb7('0x32')]===_0xedb7('0x33')&&typeof _0x4896a5[_0xedb7('0x34')]==='undefined';var _0x2eaace=_0x31bebf[_0xedb7('0x35')];var _0x320c92=_0x515ab1?0x0:_0x4896a5[_0xedb7('0x32')];var _0xe9293=_0x515ab1?_0x31bebf[_0xedb7('0x35')]:_0x4896a5['offset']+_0x4896a5[_0xedb7('0x34')];var _0x5e3da4;if(_0xe9293>=_0x2eaace){_0xe9293=_0x2eaace;_0x5e3da4=0xc8;}else{_0x5e3da4=0xce;}_0x55fe73[_0xedb7('0x30')](_0x5e3da4);return _0x55fe73['set'](_0xedb7('0x36'),_0x320c92+'-'+_0xe9293+'/'+_0x2eaace)['json'](_0x31bebf);}return null;};}function patchUpdates(_0x1b55cd){return function(_0x277d23){try{jsonpatch[_0xedb7('0x37')](_0x277d23,_0x1b55cd,!![]);}catch(_0x5bfa60){return BPromise['reject'](_0x5bfa60);}return _0x277d23[_0xedb7('0x38')]();};}function saveUpdates(_0x1efeb4,_0x505f28){return function(_0x59773e){if(_0x59773e){return _0x59773e[_0xedb7('0x39')](_0x1efeb4)['then'](function(_0x3f18cd){return _0x3f18cd;});}return null;};}function removeEntity(_0x182fcc,_0x37bb2a){return function(_0x7520f4){if(_0x7520f4){return _0x7520f4[_0xedb7('0x3a')]()[_0xedb7('0x3b')](function(){_0x182fcc['status'](0xcc)[_0xedb7('0x3c')]();});}};}function handleEntityNotFound(_0x478893,_0x5c841e){return function(_0x124a9d){if(!_0x124a9d){_0x478893[_0xedb7('0x2f')](0x194);}return _0x124a9d;};}function handleError(_0x21d9cc,_0x15bf48){_0x15bf48=_0x15bf48||0x1f4;return function(_0x481a24){logger[_0xedb7('0x2b')](_0x481a24[_0xedb7('0x3d')]);if(_0x481a24[_0xedb7('0x3e')]){delete _0x481a24[_0xedb7('0x3e')];}_0x21d9cc[_0xedb7('0x30')](_0x15bf48)[_0xedb7('0x3f')](_0x481a24);};}exports[_0xedb7('0x40')]=function(_0x262199,_0x33c827){var _0x4ff8a0={},_0x34f277={},_0x5ccd76={'count':0x0,'rows':[]};var _0x532d4a=_[_0xedb7('0x41')](db['SmsMessage'][_0xedb7('0x42')],function(_0xc5a766){return{'name':_0xc5a766[_0xedb7('0x43')],'type':_0xc5a766[_0xedb7('0x44')]['key']};});_0x34f277[_0xedb7('0x45')]=_[_0xedb7('0x41')](_0x532d4a,_0xedb7('0x3e'));_0x34f277[_0xedb7('0x46')]=_['keys'](_0x262199[_0xedb7('0x46')]);_0x34f277[_0xedb7('0x47')]=_[_0xedb7('0x48')](_0x34f277[_0xedb7('0x45')],_0x34f277[_0xedb7('0x46')]);_0x4ff8a0[_0xedb7('0x49')]=_[_0xedb7('0x48')](_0x34f277['model'],qs[_0xedb7('0x4a')](_0x262199['query'][_0xedb7('0x4a')]));_0x4ff8a0[_0xedb7('0x49')]=_0x4ff8a0[_0xedb7('0x49')]['length']?_0x4ff8a0[_0xedb7('0x49')]:_0x34f277[_0xedb7('0x45')];if(!_0x262199[_0xedb7('0x46')][_0xedb7('0x4b')](_0xedb7('0x4c'))){_0x4ff8a0['limit']=qs['limit'](_0x262199[_0xedb7('0x46')][_0xedb7('0x34')]);_0x4ff8a0[_0xedb7('0x32')]=qs[_0xedb7('0x32')](_0x262199[_0xedb7('0x46')][_0xedb7('0x32')]);}_0x4ff8a0[_0xedb7('0x4d')]=qs[_0xedb7('0x4e')](_0x262199[_0xedb7('0x46')][_0xedb7('0x4e')]);_0x4ff8a0[_0xedb7('0x4f')]=qs[_0xedb7('0x47')](_[_0xedb7('0x50')](_0x262199[_0xedb7('0x46')],_0x34f277['filters']),_0x532d4a);if(_0x262199[_0xedb7('0x46')]['filter']){_0x4ff8a0[_0xedb7('0x4f')]=_[_0xedb7('0x51')](_0x4ff8a0[_0xedb7('0x4f')],{'$or':_[_0xedb7('0x41')](_0x532d4a,function(_0x37382f){if(_0x37382f[_0xedb7('0x44')]!==_0xedb7('0x52')){var _0x1ff973={};_0x1ff973[_0x37382f[_0xedb7('0x3e')]]={'$like':'%'+_0x262199[_0xedb7('0x46')][_0xedb7('0x53')]+'%'};return _0x1ff973;}})});}_0x4ff8a0=_[_0xedb7('0x51')]({},_0x4ff8a0,_0x262199[_0xedb7('0x54')]);var _0x3082fa={'where':_0x4ff8a0[_0xedb7('0x4f')]};return db[_0xedb7('0x55')]['count'](_0x3082fa)[_0xedb7('0x3b')](function(_0x361fa4){_0x5ccd76[_0xedb7('0x35')]=_0x361fa4;if(_0x262199[_0xedb7('0x46')][_0xedb7('0x56')]){_0x4ff8a0[_0xedb7('0x57')]=[{'all':!![]}];}return db[_0xedb7('0x55')][_0xedb7('0x58')](_0x4ff8a0);})[_0xedb7('0x3b')](function(_0x441812){_0x5ccd76[_0xedb7('0x59')]=_0x441812;return _0x5ccd76;})[_0xedb7('0x3b')](respondWithFilteredResult(_0x33c827,_0x4ff8a0))[_0xedb7('0x5a')](handleError(_0x33c827,null));};exports[_0xedb7('0x5b')]=function(_0x319a35,_0x27661a){var _0xfc44={'raw':!![],'where':{'id':_0x319a35['params']['id']}},_0x14652c={};_0x14652c['model']=_[_0xedb7('0x5c')](db[_0xedb7('0x55')][_0xedb7('0x42')]);_0x14652c[_0xedb7('0x46')]=_[_0xedb7('0x5c')](_0x319a35[_0xedb7('0x46')]);_0x14652c['filters']=_[_0xedb7('0x48')](_0x14652c[_0xedb7('0x45')],_0x14652c['query']);_0xfc44[_0xedb7('0x49')]=_[_0xedb7('0x48')](_0x14652c['model'],qs['fields'](_0x319a35[_0xedb7('0x46')]['fields']));_0xfc44[_0xedb7('0x49')]=_0xfc44[_0xedb7('0x49')]['length']?_0xfc44['attributes']:_0x14652c[_0xedb7('0x45')];if(_0x319a35[_0xedb7('0x46')][_0xedb7('0x56')]){_0xfc44['include']=[{'all':!![]}];}_0xfc44=_[_0xedb7('0x51')]({},_0xfc44,_0x319a35[_0xedb7('0x54')]);return db['SmsMessage'][_0xedb7('0x5d')](_0xfc44)[_0xedb7('0x3b')](handleEntityNotFound(_0x27661a,null))[_0xedb7('0x3b')](respondWithResult(_0x27661a,null))[_0xedb7('0x5a')](handleError(_0x27661a,null));};exports[_0xedb7('0x5e')]=function(_0x2cb54a,_0x588920){return db['SmsMessage'][_0xedb7('0x5e')](_0x2cb54a[_0xedb7('0x5f')],{})[_0xedb7('0x3b')](respondWithResult(_0x588920,0xc9))[_0xedb7('0x5a')](handleError(_0x588920,null));};exports[_0xedb7('0x39')]=function(_0x1db5c8,_0x5a8f3a){if(_0x1db5c8[_0xedb7('0x5f')]['id']){delete _0x1db5c8['body']['id'];}return db[_0xedb7('0x55')]['find']({'where':{'id':_0x1db5c8[_0xedb7('0x60')]['id']}})[_0xedb7('0x3b')](handleEntityNotFound(_0x5a8f3a,null))[_0xedb7('0x3b')](saveUpdates(_0x1db5c8['body'],null))[_0xedb7('0x3b')](respondWithResult(_0x5a8f3a,null))[_0xedb7('0x5a')](handleError(_0x5a8f3a,null));};exports[_0xedb7('0x3a')]=function(_0x39f138,_0x5325ec){return db[_0xedb7('0x55')][_0xedb7('0x5d')]({'where':{'id':_0x39f138[_0xedb7('0x60')]['id']}})[_0xedb7('0x3b')](handleEntityNotFound(_0x5325ec,null))['then'](removeEntity(_0x5325ec,null))[_0xedb7('0x5a')](handleError(_0x5325ec,null));};exports['describe']=function(_0x1f3620,_0x121aad){return db[_0xedb7('0x55')][_0xedb7('0x61')]()[_0xedb7('0x3b')](respondWithResult(_0x121aad,null))[_0xedb7('0x5a')](handleError(_0x121aad,null));};var interaction_log=require(_0xedb7('0x17'))('sms-interactions');exports['accept']=function(_0x5aef9a,_0x15f850,_0x1d3247){var _0x4d274f={'agent':{},'channel':_0xedb7('0x62')};if(_0x5aef9a[_0xedb7('0x5f')]['id']){delete _0x5aef9a['body']['id'];}_0x5aef9a[_0xedb7('0x5f')]['read']=!![];_0x5aef9a[_0xedb7('0x5f')][_0xedb7('0x63')]=moment()['format'](_0xedb7('0x64'));_0x5aef9a[_0xedb7('0x5f')][_0xedb7('0x65')]=_0x5aef9a[_0xedb7('0x5f')][_0xedb7('0x65')]||_0x5aef9a['user']['id'];_0x4d274f[_0xedb7('0x66')]['id']=_0x5aef9a[_0xedb7('0x5f')][_0xedb7('0x65')];return db[_0xedb7('0x55')]['find']({'where':{'id':_0x5aef9a[_0xedb7('0x60')]['id'],'UserId':null}})[_0xedb7('0x3b')](handleEntityNotFound(_0x15f850,null))[_0xedb7('0x3b')](saveUpdates(_0x5aef9a['body'],null))[_0xedb7('0x3b')](function(_0x16d8a7){if(_0x16d8a7){_0x4d274f['message']=_0x16d8a7[_0xedb7('0x67')]({'plain':!![]});return db[_0xedb7('0x68')][_0xedb7('0x5d')]({'where':{'id':_0x16d8a7[_0xedb7('0x69')]}});}return null;})[_0xedb7('0x3b')](handleEntityNotFound(_0x15f850,null))[_0xedb7('0x3b')](function(_0x340983){if(_0x340983){return _0x340983[_0xedb7('0x39')]({'UserId':_0x5aef9a[_0xedb7('0x5f')][_0xedb7('0x65')],'read1stAt':_[_0xedb7('0x6a')](_0x340983['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xedb7('0x3b')](function(_0x21bc5e){if(_0x21bc5e){_0x4d274f[_0xedb7('0x6b')]=_0x21bc5e['get']({'plain':!![]});interaction_log[_0xedb7('0x26')](_0xedb7('0x6c'),_0x5aef9a['user']['id'],_0x5aef9a[_0xedb7('0x6d')]['name'],_0x5aef9a[_0xedb7('0x6d')][_0xedb7('0x6e')],_0x4d274f['interaction']['id'],_0x5aef9a[_0xedb7('0x5f')]?JSON['stringify'](_0x5aef9a[_0xedb7('0x5f')]):_0xedb7('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4d274f);}return null;})[_0xedb7('0x3b')](function(_0x4d9e16){var _0x3d88b5=_0xedb7('0x70')+_0x4d9e16[_0xedb7('0x2d')][_0xedb7('0x71')];return db[_0xedb7('0x72')][_0xedb7('0x46')](_0x3d88b5,{'type':db[_0xedb7('0x73')]['QueryTypes'][_0xedb7('0x74')],'raw':!![]})['then'](function(_0x1a6033){return _0x1a6033;});})[_0xedb7('0x3b')](function(_0x18d142){if(_0x18d142){_0x4d274f[_0xedb7('0x2d')][_0xedb7('0x75')]=_0x18d142[0x0];if(!_0x5aef9a[_0xedb7('0x5f')][_0xedb7('0x65')])return;return db[_0xedb7('0x76')][_0xedb7('0x5d')]({'where':{'id':_0x5aef9a[_0xedb7('0x5f')][_0xedb7('0x65')],'role':_0xedb7('0x66')},'attributes':['id','name',_0xedb7('0x77'),'email',_0xedb7('0x78')],'raw':!![]});}return null;})[_0xedb7('0x3b')](function(_0x479883){if(!_0x479883)return null;_0x4d274f[_0xedb7('0x2d')]['agent']=_0x479883;return _0x4d274f;})[_0xedb7('0x3b')](function(_0x37e303){if(_0x37e303){if(_0x5aef9a[_0xedb7('0x5f')][_0xedb7('0x79')]){_0x4d274f[_0xedb7('0x2d')]['interface']=util[_0xedb7('0x7a')]('SIP/%s',_0x5aef9a[_0xedb7('0x6d')][_0xedb7('0x3e')]);_0x4d274f[_0xedb7('0x2d')][_0xedb7('0x7b')]=_0x4d274f[_0xedb7('0x7b')];_0x4d274f[_0xedb7('0x2d')][_0xedb7('0x7c')]=_0x4d274f[_0xedb7('0x7b')];_0x4d274f[_0xedb7('0x2d')][_0xedb7('0x7d')]=_0xedb7('0x7e');return respondWithRpcPromise(_0xedb7('0x7f'),_0xedb7('0x7f'),{'event':_0xedb7('0x80'),'message':_0x4d274f[_0xedb7('0x2d')]},client9002)[_0xedb7('0x3b')](function(){return _0x4d274f;});}return _0x4d274f;}return null;})['then'](respondWithResult(_0x15f850,null))[_0xedb7('0x5a')](handleError(_0x15f850,null));};var interaction_log=require(_0xedb7('0x17'))(_0xedb7('0x81'));exports[_0xedb7('0x82')]=function(_0x5976c4,_0x139750,_0x529ebc){var _0x19a3e2={'agent':{},'channel':'sms'};if(_0x5976c4[_0xedb7('0x5f')]['id']){delete _0x5976c4['body']['id'];}_0x5976c4[_0xedb7('0x5f')][_0xedb7('0x65')]=_0x5976c4[_0xedb7('0x5f')]['UserId']||_0x5976c4['user']['id'];_0x19a3e2['agent']['id']=_0x5976c4[_0xedb7('0x5f')]['UserId'];return db[_0xedb7('0x55')][_0xedb7('0x5d')]({'where':{'id':_0x5976c4[_0xedb7('0x60')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x139750,null))[_0xedb7('0x3b')](function(_0x3f2100){if(_0x3f2100){_0x19a3e2[_0xedb7('0x2d')]=_0x3f2100[_0xedb7('0x67')]({'plain':!![]});return db['SmsInteraction'][_0xedb7('0x5d')]({'where':{'id':_0x3f2100[_0xedb7('0x69')]}});}return null;})[_0xedb7('0x3b')](handleEntityNotFound(_0x139750,null))[_0xedb7('0x3b')](function(_0x78c391){if(_0x78c391){_0x19a3e2[_0xedb7('0x6b')]=_0x78c391[_0xedb7('0x67')]({'plain':!![]});interaction_log[_0xedb7('0x26')](_0xedb7('0x83'),_0x5976c4[_0xedb7('0x6d')]['id'],_0x5976c4[_0xedb7('0x6d')][_0xedb7('0x3e')],_0x5976c4[_0xedb7('0x6d')]['role'],_0x19a3e2[_0xedb7('0x6b')]['id'],_0x5976c4[_0xedb7('0x5f')]?JSON[_0xedb7('0x2a')](_0x5976c4[_0xedb7('0x5f')]):_0xedb7('0x6f'));return respondWithRpcPromise(_0xedb7('0x84'),_0xedb7('0x85'),_0x19a3e2);}return null;})['then'](function(_0x3b7428){var _0x30874d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3b7428[_0xedb7('0x2d')][_0xedb7('0x71')];return db['sequelize']['query'](_0x30874d,{'type':db[_0xedb7('0x73')][_0xedb7('0x86')]['SELECT'],'raw':!![]})[_0xedb7('0x3b')](function(_0x4ca998){return _0x4ca998;});})[_0xedb7('0x3b')](function(_0x368af6){if(_0x368af6){_0x19a3e2[_0xedb7('0x2d')]['contact']=_0x368af6[0x0];if(!_0x5976c4[_0xedb7('0x5f')][_0xedb7('0x65')])return;return db[_0xedb7('0x76')][_0xedb7('0x5d')]({'where':{'id':_0x5976c4[_0xedb7('0x5f')][_0xedb7('0x65')],'role':_0xedb7('0x66')},'attributes':['id',_0xedb7('0x3e'),_0xedb7('0x77'),_0xedb7('0x87'),_0xedb7('0x78')],'raw':!![]});}return null;})[_0xedb7('0x3b')](function(_0x2452e4){if(!_0x2452e4)return null;_0x19a3e2[_0xedb7('0x2d')][_0xedb7('0x66')]=_0x2452e4;return _0x19a3e2;})[_0xedb7('0x3b')](function(_0x2f2154){if(_0x2f2154){_0x2f2154[_0xedb7('0x2d')][_0xedb7('0x88')]=util['format'](_0xedb7('0x89'),_0x5976c4[_0xedb7('0x6d')][_0xedb7('0x3e')]);_0x2f2154[_0xedb7('0x2d')]['channel']=_0x19a3e2[_0xedb7('0x7b')];_0x2f2154[_0xedb7('0x2d')][_0xedb7('0x7c')]=_0x19a3e2[_0xedb7('0x7b')];_0x2f2154['message'][_0xedb7('0x7d')]=_0xedb7('0x82');respondWithRpcPromise(_0xedb7('0x7f'),_0xedb7('0x7f'),{'event':_0xedb7('0x8a'),'message':_0x2f2154[_0xedb7('0x2d')]},client9002);return _0x19a3e2;}return null;})[_0xedb7('0x3b')](respondWithResult(_0x139750,null))['catch'](handleError(_0x139750,null));};exports['status']=function(_0x2e3202,_0x5c3167,_0x463ad3){if(_0x2e3202[_0xedb7('0x5f')]['id']){delete _0x2e3202[_0xedb7('0x5f')]['id'];}var _0x29644c;return db['SmsMessage']['find']({'where':{'id':_0x2e3202['params']['id']}})['then'](handleEntityNotFound(_0x5c3167,null))[_0xedb7('0x3b')](function(_0x20dc9b){if(_0x20dc9b){_0x29644c=_0x20dc9b;return db['SmsAccount'][_0xedb7('0x5d')]({'where':{'id':_0x20dc9b['SmsAccountId']}});}})[_0xedb7('0x3b')](handleEntityNotFound(_0x5c3167,null))[_0xedb7('0x3b')](function(_0x2fb600){if(_0x2fb600){logger[_0xedb7('0x29')](_0xedb7('0x8b'),_0xedb7('0x30'),'received\x20delivery\x20report\x20from',_0x2fb600[_0xedb7('0x44')],util['inspect'](_0x2e3202[_0xedb7('0x5f')],{'showHidden':![],'depth':null}));switch(_0x2fb600['type']){case _0xedb7('0x8c'):if(_0x2e3202[_0xedb7('0x5f')]['MessageSid']&&_0x2e3202[_0xedb7('0x5f')]['MessageSid']===_0x29644c['messageId']){return _0x29644c['update']({'read':!![]});}else{logger[_0xedb7('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xedb7('0x30'),_0xedb7('0x8c'),util[_0xedb7('0x8d')](_0x2e3202[_0xedb7('0x5f')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x2e3202[_0xedb7('0x5f')][_0xedb7('0x8e')]&&_0x2e3202['body'][_0xedb7('0x8e')]===_0x29644c['messageId']&&_[_0xedb7('0x8f')]([_0xedb7('0x90'),_0xedb7('0x91')],_0x2e3202[_0xedb7('0x5f')]['Status'])>=0x0){return _0x29644c[_0xedb7('0x39')]({'read':!![]});}else{logger[_0xedb7('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xedb7('0x30'),_0xedb7('0x92'),util[_0xedb7('0x8d')](_0x2e3202[_0xedb7('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xedb7('0x93'):var _0x395699=_0x2e3202[_0xedb7('0x5f')][_0xedb7('0x94')][0x0];if(_0x395699[_0xedb7('0x30')][_0xedb7('0x95')]===_0xedb7('0x96')){return _0x29644c[_0xedb7('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xedb7('0x30'),'infobip',util[_0xedb7('0x8d')](_0x2e3202[_0xedb7('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x29644c;}})[_0xedb7('0x3b')](respondWithResult(_0x5c3167,null))[_0xedb7('0x5a')](handleError(_0x5c3167,null));};
\ No newline at end of file
+var _0x08e2=['util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','jayson/promise','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','rawAttributes','fieldName','key','map','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SmsMessage','includeAll','include','findAll','rows','show','params','keys','intersection','options','find','create','body','describe','../../config/logger','accept','sms','read','readAt','UserId','agent','get','SmsInteraction','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','channel','motionChannel','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','contact','event','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x281331,_0x3b84f0){var _0x42b236=function(_0x1930ae){while(--_0x1930ae){_0x281331['push'](_0x281331['shift']());}};_0x42b236(++_0x3b84f0);}(_0x08e2,0x8c));var _0x208e=function(_0x568a12,_0x310a87){_0x568a12=_0x568a12-0x0;var _0xdcc120=_0x08e2[_0x568a12];return _0xdcc120;};'use strict';var emlformat=require(_0x208e('0x0'));var rimraf=require(_0x208e('0x1'));var zipdir=require(_0x208e('0x2'));var jsonpatch=require(_0x208e('0x3'));var rp=require(_0x208e('0x4'));var moment=require('moment');var BPromise=require(_0x208e('0x5'));var Mustache=require(_0x208e('0x6'));var util=require(_0x208e('0x7'));var path=require(_0x208e('0x8'));var sox=require(_0x208e('0x9'));var csv=require(_0x208e('0xa'));var ejs=require(_0x208e('0xb'));var fs=require('fs');var fs_extra=require(_0x208e('0xc'));var _=require(_0x208e('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x208e('0xe'));var deskjs=require(_0x208e('0xf'));var toCsv=require(_0x208e('0xa'));var querystring=require(_0x208e('0x10'));var Papa=require('papaparse');var Redis=require(_0x208e('0x11'));var authService=require(_0x208e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x208e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x208e('0x14'));var utils=require(_0x208e('0x15'));var config=require(_0x208e('0x16'));var licenseUtil=require(_0x208e('0x17'));var db=require(_0x208e('0x18'))['db'];config[_0x208e('0x19')]=_[_0x208e('0x1a')](config[_0x208e('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x208e('0x1b'))(new Redis(config[_0x208e('0x19')]));require(_0x208e('0x1c'))['register'](socket);var jayson=require(_0x208e('0x1d'));var client=jayson[_0x208e('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x208e('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e6e4f,_0xf6c76c,_0x196be3,_0x119284){return new BPromise(function(_0x19eb40,_0x883911){var _0x4fabb9=_0x119284||client;return _0x4fabb9[_0x208e('0x1f')](_0x3e6e4f,_0x196be3)[_0x208e('0x20')](function(_0x41642a){logger[_0x208e('0x21')](_0x208e('0x22'),_0xf6c76c,_0x208e('0x23'));logger[_0x208e('0x24')](_0x208e('0x25'),_0xf6c76c,_0x208e('0x23'),JSON[_0x208e('0x26')](_0x41642a));if(_0x41642a[_0x208e('0x27')]){if(_0x41642a[_0x208e('0x27')][_0x208e('0x28')]===0x1f4){logger[_0x208e('0x27')](_0x208e('0x22'),_0xf6c76c,_0x41642a[_0x208e('0x27')][_0x208e('0x29')]);return _0x883911(_0x41642a[_0x208e('0x27')][_0x208e('0x29')]);}logger[_0x208e('0x27')](_0x208e('0x22'),_0xf6c76c,_0x41642a[_0x208e('0x27')]['message']);return _0x19eb40(_0x41642a[_0x208e('0x27')]['message']);}else{logger[_0x208e('0x21')](_0x208e('0x22'),_0xf6c76c,'request\x20sent');_0x19eb40(_0x41642a[_0x208e('0x2a')][_0x208e('0x29')]);}})[_0x208e('0x2b')](function(_0x378486){logger[_0x208e('0x27')](_0x208e('0x22'),_0xf6c76c,_0x378486);_0x883911(_0x378486);});});}function respondWithStatusCode(_0x553612,_0x5261a8){_0x5261a8=_0x5261a8||0xcc;return function(_0x1c35d0){if(_0x1c35d0){return _0x553612[_0x208e('0x2c')](_0x5261a8);}return _0x553612[_0x208e('0x2d')](_0x5261a8)['end']();};}function respondWithResult(_0xd8a831,_0x38f902){_0x38f902=_0x38f902||0xc8;return function(_0x6ebbb0){if(_0x6ebbb0){return _0xd8a831[_0x208e('0x2d')](_0x38f902)[_0x208e('0x2e')](_0x6ebbb0);}};}function respondWithFilteredResult(_0x486c2d,_0x2c1d9e){return function(_0x18b095){if(_0x18b095){var _0xe145f6=typeof _0x2c1d9e[_0x208e('0x2f')]===_0x208e('0x30')&&typeof _0x2c1d9e[_0x208e('0x31')]===_0x208e('0x30');var _0x4188c5=_0x18b095[_0x208e('0x32')];var _0x353477=_0xe145f6?0x0:_0x2c1d9e[_0x208e('0x2f')];var _0x239524=_0xe145f6?_0x18b095[_0x208e('0x32')]:_0x2c1d9e[_0x208e('0x2f')]+_0x2c1d9e['limit'];var _0xde4913;if(_0x239524>=_0x4188c5){_0x239524=_0x4188c5;_0xde4913=0xc8;}else{_0xde4913=0xce;}_0x486c2d[_0x208e('0x2d')](_0xde4913);return _0x486c2d['set'](_0x208e('0x33'),_0x353477+'-'+_0x239524+'/'+_0x4188c5)[_0x208e('0x2e')](_0x18b095);}return null;};}function patchUpdates(_0x2894fd){return function(_0xe942b1){try{jsonpatch[_0x208e('0x34')](_0xe942b1,_0x2894fd,!![]);}catch(_0x538ecb){return BPromise[_0x208e('0x35')](_0x538ecb);}return _0xe942b1['save']();};}function saveUpdates(_0x43c7f0,_0x32ddf4){return function(_0x1fde3a){if(_0x1fde3a){return _0x1fde3a[_0x208e('0x36')](_0x43c7f0)[_0x208e('0x20')](function(_0x27e5a0){return _0x27e5a0;});}return null;};}function removeEntity(_0x58aec5,_0x3f6d18){return function(_0xc7672c){if(_0xc7672c){return _0xc7672c[_0x208e('0x37')]()[_0x208e('0x20')](function(){_0x58aec5[_0x208e('0x2d')](0xcc)[_0x208e('0x38')]();});}};}function handleEntityNotFound(_0x38f340,_0x5a2c4c){return function(_0x5c27a4){if(!_0x5c27a4){_0x38f340[_0x208e('0x2c')](0x194);}return _0x5c27a4;};}function handleError(_0x29552d,_0x40d28a){_0x40d28a=_0x40d28a||0x1f4;return function(_0x3b5b8b){logger['error'](_0x3b5b8b[_0x208e('0x39')]);if(_0x3b5b8b['name']){delete _0x3b5b8b[_0x208e('0x3a')];}_0x29552d['status'](_0x40d28a)[_0x208e('0x3b')](_0x3b5b8b);};}exports[_0x208e('0x3c')]=function(_0x49eb6e,_0x2d1af0){var _0x133a47={},_0x1ed41d={},_0x5200df={'count':0x0,'rows':[]};var _0x1511c3=_['map'](db['SmsMessage'][_0x208e('0x3d')],function(_0xcc04b2){return{'name':_0xcc04b2[_0x208e('0x3e')],'type':_0xcc04b2['type'][_0x208e('0x3f')]};});_0x1ed41d['model']=_[_0x208e('0x40')](_0x1511c3,_0x208e('0x3a'));_0x1ed41d[_0x208e('0x41')]=_['keys'](_0x49eb6e['query']);_0x1ed41d[_0x208e('0x42')]=_['intersection'](_0x1ed41d[_0x208e('0x43')],_0x1ed41d[_0x208e('0x41')]);_0x133a47['attributes']=_['intersection'](_0x1ed41d[_0x208e('0x43')],qs[_0x208e('0x44')](_0x49eb6e[_0x208e('0x41')][_0x208e('0x44')]));_0x133a47[_0x208e('0x45')]=_0x133a47[_0x208e('0x45')][_0x208e('0x46')]?_0x133a47[_0x208e('0x45')]:_0x1ed41d[_0x208e('0x43')];if(!_0x49eb6e[_0x208e('0x41')][_0x208e('0x47')](_0x208e('0x48'))){_0x133a47['limit']=qs[_0x208e('0x31')](_0x49eb6e[_0x208e('0x41')][_0x208e('0x31')]);_0x133a47[_0x208e('0x2f')]=qs[_0x208e('0x2f')](_0x49eb6e['query']['offset']);}_0x133a47[_0x208e('0x49')]=qs[_0x208e('0x4a')](_0x49eb6e[_0x208e('0x41')][_0x208e('0x4a')]);_0x133a47[_0x208e('0x4b')]=qs[_0x208e('0x42')](_[_0x208e('0x4c')](_0x49eb6e[_0x208e('0x41')],_0x1ed41d[_0x208e('0x42')]),_0x1511c3);if(_0x49eb6e['query'][_0x208e('0x4d')]){_0x133a47[_0x208e('0x4b')]=_[_0x208e('0x4e')](_0x133a47[_0x208e('0x4b')],{'$or':_[_0x208e('0x40')](_0x1511c3,function(_0x3c94f7){if(_0x3c94f7['type']!==_0x208e('0x4f')){var _0x543aeb={};_0x543aeb[_0x3c94f7[_0x208e('0x3a')]]={'$like':'%'+_0x49eb6e[_0x208e('0x41')][_0x208e('0x4d')]+'%'};return _0x543aeb;}})});}_0x133a47=_[_0x208e('0x4e')]({},_0x133a47,_0x49eb6e['options']);var _0x56ccbe={'where':_0x133a47[_0x208e('0x4b')]};return db[_0x208e('0x50')]['count'](_0x56ccbe)['then'](function(_0x3dd8c5){_0x5200df[_0x208e('0x32')]=_0x3dd8c5;if(_0x49eb6e[_0x208e('0x41')][_0x208e('0x51')]){_0x133a47[_0x208e('0x52')]=[{'all':!![]}];}return db[_0x208e('0x50')][_0x208e('0x53')](_0x133a47);})[_0x208e('0x20')](function(_0x44c703){_0x5200df[_0x208e('0x54')]=_0x44c703;return _0x5200df;})[_0x208e('0x20')](respondWithFilteredResult(_0x2d1af0,_0x133a47))[_0x208e('0x2b')](handleError(_0x2d1af0,null));};exports[_0x208e('0x55')]=function(_0x5fd1b0,_0x48e4ec){var _0x4229d0={'raw':!![],'where':{'id':_0x5fd1b0[_0x208e('0x56')]['id']}},_0x473a82={};_0x473a82[_0x208e('0x43')]=_['keys'](db[_0x208e('0x50')][_0x208e('0x3d')]);_0x473a82['query']=_[_0x208e('0x57')](_0x5fd1b0[_0x208e('0x41')]);_0x473a82['filters']=_[_0x208e('0x58')](_0x473a82[_0x208e('0x43')],_0x473a82[_0x208e('0x41')]);_0x4229d0[_0x208e('0x45')]=_[_0x208e('0x58')](_0x473a82[_0x208e('0x43')],qs['fields'](_0x5fd1b0[_0x208e('0x41')][_0x208e('0x44')]));_0x4229d0[_0x208e('0x45')]=_0x4229d0['attributes']['length']?_0x4229d0[_0x208e('0x45')]:_0x473a82['model'];if(_0x5fd1b0[_0x208e('0x41')][_0x208e('0x51')]){_0x4229d0['include']=[{'all':!![]}];}_0x4229d0=_['merge']({},_0x4229d0,_0x5fd1b0[_0x208e('0x59')]);return db[_0x208e('0x50')][_0x208e('0x5a')](_0x4229d0)[_0x208e('0x20')](handleEntityNotFound(_0x48e4ec,null))[_0x208e('0x20')](respondWithResult(_0x48e4ec,null))[_0x208e('0x2b')](handleError(_0x48e4ec,null));};exports[_0x208e('0x5b')]=function(_0x1e5f1d,_0x969da){return db[_0x208e('0x50')][_0x208e('0x5b')](_0x1e5f1d['body'],{})[_0x208e('0x20')](respondWithResult(_0x969da,0xc9))['catch'](handleError(_0x969da,null));};exports[_0x208e('0x36')]=function(_0x353bdf,_0x454d8f){if(_0x353bdf['body']['id']){delete _0x353bdf[_0x208e('0x5c')]['id'];}return db[_0x208e('0x50')][_0x208e('0x5a')]({'where':{'id':_0x353bdf[_0x208e('0x56')]['id']}})[_0x208e('0x20')](handleEntityNotFound(_0x454d8f,null))[_0x208e('0x20')](saveUpdates(_0x353bdf[_0x208e('0x5c')],null))[_0x208e('0x20')](respondWithResult(_0x454d8f,null))[_0x208e('0x2b')](handleError(_0x454d8f,null));};exports[_0x208e('0x37')]=function(_0x5f1dcc,_0x301e1e){return db[_0x208e('0x50')]['find']({'where':{'id':_0x5f1dcc['params']['id']}})[_0x208e('0x20')](handleEntityNotFound(_0x301e1e,null))[_0x208e('0x20')](removeEntity(_0x301e1e,null))['catch'](handleError(_0x301e1e,null));};exports[_0x208e('0x5d')]=function(_0x22b7a5,_0xb79dd0){return db[_0x208e('0x50')][_0x208e('0x5d')]()[_0x208e('0x20')](respondWithResult(_0xb79dd0,null))[_0x208e('0x2b')](handleError(_0xb79dd0,null));};var interaction_log=require(_0x208e('0x5e'))('sms-interactions');exports[_0x208e('0x5f')]=function(_0x2c7e1e,_0x12546c,_0x247801){var _0x26111a={'agent':{},'channel':_0x208e('0x60')};if(_0x2c7e1e[_0x208e('0x5c')]['id']){delete _0x2c7e1e[_0x208e('0x5c')]['id'];}_0x2c7e1e['body'][_0x208e('0x61')]=!![];_0x2c7e1e['body'][_0x208e('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c7e1e['body'][_0x208e('0x63')]=_0x2c7e1e[_0x208e('0x5c')][_0x208e('0x63')]||_0x2c7e1e['user']['id'];_0x26111a[_0x208e('0x64')]['id']=_0x2c7e1e[_0x208e('0x5c')][_0x208e('0x63')];return db[_0x208e('0x50')][_0x208e('0x5a')]({'where':{'id':_0x2c7e1e[_0x208e('0x56')]['id'],'UserId':null}})[_0x208e('0x20')](handleEntityNotFound(_0x12546c,null))['then'](saveUpdates(_0x2c7e1e[_0x208e('0x5c')],null))[_0x208e('0x20')](function(_0x2d363c){if(_0x2d363c){_0x26111a[_0x208e('0x29')]=_0x2d363c[_0x208e('0x65')]({'plain':!![]});return db[_0x208e('0x66')][_0x208e('0x5a')]({'where':{'id':_0x2d363c[_0x208e('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x12546c,null))[_0x208e('0x20')](function(_0x328966){if(_0x328966){return _0x328966['update']({'UserId':_0x2c7e1e[_0x208e('0x5c')]['UserId'],'read1stAt':_['isNil'](_0x328966['read1stAt'])?moment()[_0x208e('0x68')](_0x208e('0x69')):undefined});}return null;})['then'](function(_0x13b98a){if(_0x13b98a){_0x26111a[_0x208e('0x6a')]=_0x13b98a[_0x208e('0x65')]({'plain':!![]});interaction_log[_0x208e('0x21')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c7e1e[_0x208e('0x6b')]['id'],_0x2c7e1e[_0x208e('0x6b')][_0x208e('0x3a')],_0x2c7e1e[_0x208e('0x6b')][_0x208e('0x6c')],_0x26111a[_0x208e('0x6a')]['id'],_0x2c7e1e[_0x208e('0x5c')]?JSON[_0x208e('0x26')](_0x2c7e1e[_0x208e('0x5c')]):'null');return respondWithRpcPromise(_0x208e('0x6d'),_0x208e('0x6e'),_0x26111a);}return null;})['then'](function(_0x4aec6f){var _0x43d5a0=_0x208e('0x6f')+_0x4aec6f[_0x208e('0x29')]['ContactId'];return db[_0x208e('0x70')][_0x208e('0x41')](_0x43d5a0,{'type':db['Sequelize'][_0x208e('0x71')][_0x208e('0x72')],'raw':!![]})[_0x208e('0x20')](function(_0x1e8d30){return _0x1e8d30;});})[_0x208e('0x20')](function(_0x475eb9){if(_0x475eb9){_0x26111a['message']['contact']=_0x475eb9[0x0];if(!_0x2c7e1e[_0x208e('0x5c')]['UserId'])return;return db[_0x208e('0x73')][_0x208e('0x5a')]({'where':{'id':_0x2c7e1e[_0x208e('0x5c')][_0x208e('0x63')],'role':'agent'},'attributes':['id',_0x208e('0x3a'),_0x208e('0x74'),_0x208e('0x75'),'internal'],'raw':!![]});}return null;})[_0x208e('0x20')](function(_0x4670c9){if(!_0x4670c9)return null;_0x26111a[_0x208e('0x29')][_0x208e('0x64')]=_0x4670c9;return _0x26111a;})[_0x208e('0x20')](function(_0x457697){if(_0x457697){if(_0x2c7e1e[_0x208e('0x5c')][_0x208e('0x76')]){_0x26111a[_0x208e('0x29')][_0x208e('0x77')]=util[_0x208e('0x68')]('SIP/%s',_0x2c7e1e[_0x208e('0x6b')]['name']);_0x26111a[_0x208e('0x29')][_0x208e('0x78')]=_0x26111a[_0x208e('0x78')];_0x26111a['message'][_0x208e('0x79')]=_0x26111a[_0x208e('0x78')];_0x26111a[_0x208e('0x29')]['event']=_0x208e('0x5f');return respondWithRpcPromise(_0x208e('0x7a'),'EventManager',{'event':_0x208e('0x7b'),'message':_0x26111a['message']},client9002)[_0x208e('0x20')](function(){return _0x26111a;});}return _0x26111a;}return null;})[_0x208e('0x20')](respondWithResult(_0x12546c,null))['catch'](handleError(_0x12546c,null));};var interaction_log=require(_0x208e('0x5e'))(_0x208e('0x7c'));exports['reject']=function(_0x4282ae,_0x542dad,_0x41a1be){var _0x1aa836={'agent':{},'channel':_0x208e('0x60')};if(_0x4282ae[_0x208e('0x5c')]['id']){delete _0x4282ae[_0x208e('0x5c')]['id'];}_0x4282ae[_0x208e('0x5c')][_0x208e('0x63')]=_0x4282ae['body'][_0x208e('0x63')]||_0x4282ae[_0x208e('0x6b')]['id'];_0x1aa836[_0x208e('0x64')]['id']=_0x4282ae[_0x208e('0x5c')][_0x208e('0x63')];return db[_0x208e('0x50')]['find']({'where':{'id':_0x4282ae['params']['id'],'UserId':null}})[_0x208e('0x20')](handleEntityNotFound(_0x542dad,null))[_0x208e('0x20')](function(_0x2149af){if(_0x2149af){_0x1aa836[_0x208e('0x29')]=_0x2149af[_0x208e('0x65')]({'plain':!![]});return db[_0x208e('0x66')]['find']({'where':{'id':_0x2149af[_0x208e('0x67')]}});}return null;})[_0x208e('0x20')](handleEntityNotFound(_0x542dad,null))[_0x208e('0x20')](function(_0x50700){if(_0x50700){_0x1aa836['interaction']=_0x50700[_0x208e('0x65')]({'plain':!![]});interaction_log['info'](_0x208e('0x7d'),_0x4282ae[_0x208e('0x6b')]['id'],_0x4282ae['user']['name'],_0x4282ae['user'][_0x208e('0x6c')],_0x1aa836[_0x208e('0x6a')]['id'],_0x4282ae[_0x208e('0x5c')]?JSON[_0x208e('0x26')](_0x4282ae[_0x208e('0x5c')]):_0x208e('0x7e'));return respondWithRpcPromise('RejectMessage',_0x208e('0x7f'),_0x1aa836);}return null;})[_0x208e('0x20')](function(_0xe8ea3e){var _0x362f1e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe8ea3e['message']['ContactId'];return db[_0x208e('0x70')]['query'](_0x362f1e,{'type':db['Sequelize'][_0x208e('0x71')][_0x208e('0x72')],'raw':!![]})[_0x208e('0x20')](function(_0x428913){return _0x428913;});})[_0x208e('0x20')](function(_0x34f319){if(_0x34f319){_0x1aa836[_0x208e('0x29')][_0x208e('0x80')]=_0x34f319[0x0];if(!_0x4282ae[_0x208e('0x5c')][_0x208e('0x63')])return;return db[_0x208e('0x73')][_0x208e('0x5a')]({'where':{'id':_0x4282ae['body'][_0x208e('0x63')],'role':_0x208e('0x64')},'attributes':['id',_0x208e('0x3a'),'fullname',_0x208e('0x75'),'internal'],'raw':!![]});}return null;})[_0x208e('0x20')](function(_0x26906b){if(!_0x26906b)return null;_0x1aa836[_0x208e('0x29')][_0x208e('0x64')]=_0x26906b;return _0x1aa836;})[_0x208e('0x20')](function(_0x1beda4){if(_0x1beda4){_0x1beda4[_0x208e('0x29')][_0x208e('0x77')]=util[_0x208e('0x68')]('SIP/%s',_0x4282ae[_0x208e('0x6b')][_0x208e('0x3a')]);_0x1beda4['message']['channel']=_0x1aa836['channel'];_0x1beda4[_0x208e('0x29')][_0x208e('0x79')]=_0x1aa836[_0x208e('0x78')];_0x1beda4[_0x208e('0x29')][_0x208e('0x81')]='reject';respondWithRpcPromise('EventManager',_0x208e('0x7a'),{'event':_0x208e('0x82'),'message':_0x1beda4[_0x208e('0x29')]},client9002);return _0x1aa836;}return null;})[_0x208e('0x20')](respondWithResult(_0x542dad,null))[_0x208e('0x2b')](handleError(_0x542dad,null));};exports[_0x208e('0x2d')]=function(_0x17bc25,_0x394156,_0xa5fee){if(_0x17bc25[_0x208e('0x5c')]['id']){delete _0x17bc25['body']['id'];}var _0x5bede4;return db['SmsMessage']['find']({'where':{'id':_0x17bc25[_0x208e('0x56')]['id']}})[_0x208e('0x20')](handleEntityNotFound(_0x394156,null))[_0x208e('0x20')](function(_0x293533){if(_0x293533){_0x5bede4=_0x293533;return db['SmsAccount'][_0x208e('0x5a')]({'where':{'id':_0x293533[_0x208e('0x83')]}});}})[_0x208e('0x20')](handleEntityNotFound(_0x394156,null))[_0x208e('0x20')](function(_0x30b29a){if(_0x30b29a){logger[_0x208e('0x24')](_0x208e('0x25'),'status',_0x208e('0x84'),_0x30b29a['type'],util[_0x208e('0x85')](_0x17bc25[_0x208e('0x5c')],{'showHidden':![],'depth':null}));switch(_0x30b29a['type']){case _0x208e('0x86'):if(_0x17bc25[_0x208e('0x5c')][_0x208e('0x87')]&&_0x17bc25[_0x208e('0x5c')][_0x208e('0x87')]===_0x5bede4[_0x208e('0x88')]){return _0x5bede4[_0x208e('0x36')]({'read':!![]});}else{logger[_0x208e('0x27')](_0x208e('0x89'),_0x208e('0x2d'),'twilio',util[_0x208e('0x85')](_0x17bc25[_0x208e('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x208e('0x8a'):if(_0x17bc25['body'][_0x208e('0x8b')]&&_0x17bc25[_0x208e('0x5c')][_0x208e('0x8b')]===_0x5bede4[_0x208e('0x88')]&&_['indexOf']([_0x208e('0x8c'),_0x208e('0x8d')],_0x17bc25['body']['Status'])>=0x0){return _0x5bede4['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x208e('0x2d'),_0x208e('0x8e'),util[_0x208e('0x85')](_0x17bc25[_0x208e('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x208e('0x8f'):var _0x47dcd4=_0x17bc25[_0x208e('0x5c')][_0x208e('0x90')][0x0];if(_0x47dcd4[_0x208e('0x2d')][_0x208e('0x91')]===_0x208e('0x92')){return _0x5bede4[_0x208e('0x36')]({'read':!![]});}else{logger['error'](_0x208e('0x89'),'status',_0x208e('0x8f'),util[_0x208e('0x85')](_0x17bc25['body'],{'showHidden':![],'depth':null}));}break;}return _0x5bede4;}})['then'](respondWithResult(_0x394156,null))['catch'](handleError(_0x394156,null));};
\ No newline at end of file
index 7fe1d8d..66ac821 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2b3=['emit','exports','../../mysqldb','SmsMessage'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xc2b3,0x1f2));var _0x3c2b=function(_0x9747d9,_0x2c05ee){_0x9747d9=_0x9747d9-0x0;var _0x50831a=_0xc2b3[_0x9747d9];return _0x50831a;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x3c2b('0x0'))['db'][_0x3c2b('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x211afb){return function(_0x4f21ea,_0x2810ca,_0x533b8d){SmsMessageEvents[_0x3c2b('0x2')](_0x211afb+':'+_0x4f21ea['id'],_0x4f21ea);SmsMessageEvents[_0x3c2b('0x2')](_0x211afb,_0x4f21ea);_0x533b8d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x3c2b('0x3')]=SmsMessageEvents;
\ No newline at end of file
+var _0xb233=['hasOwnProperty','hook','exports','../../mysqldb','update','emit'];(function(_0x109c14,_0x4cb45d){var _0x5d15c5=function(_0x5b02fa){while(--_0x5b02fa){_0x109c14['push'](_0x109c14['shift']());}};_0x5d15c5(++_0x4cb45d);}(_0xb233,0x19b));var _0x3b23=function(_0x5c002b,_0x3ca3a9){_0x5c002b=_0x5c002b-0x0;var _0x1ce73b=_0xb233[_0x5c002b];return _0x1ce73b;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x3b23('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b23('0x1'),'afterDestroy':'remove'};function emitEvent(_0x26addc){return function(_0x1e3e44,_0x425d58,_0x1f8870){SmsMessageEvents[_0x3b23('0x2')](_0x26addc+':'+_0x1e3e44['id'],_0x1e3e44);SmsMessageEvents[_0x3b23('0x2')](_0x26addc,_0x1e3e44);_0x1f8870(null);};}for(var e in events){if(events[_0x3b23('0x3')](e)){var event=events[e];SmsMessage[_0x3b23('0x4')](e,emitEvent(event));}}module[_0x3b23('0x5')]=SmsMessageEvents;
\ No newline at end of file
index 94f0a5b..4539f23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x806d=['format','%s:%s','toString','base64','http_code','data','head','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/status?token=','application/json','IBSSO\x20','csc','login','sender','text','timestamp','keys','sort','length','createHash','hex','signature=','/external/get/send.php?','id_sms','read','Missing\x20parameters:\x20apiKey','clickatell','apiKey','uuid','UTF-8','bandwidth','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','status','refid','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','toLowerCase','direction','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','update','createdAt','catch','error','secret','find','then','type','twilio','accountSid','phone','authToken','messages','create','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','POST','user_key','session_key','total_sent','internal_order_id','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString'];(function(_0x3a1397,_0x47676f){var _0x52ee7e=function(_0x34a47b){while(--_0x34a47b){_0x3a1397['push'](_0x3a1397['shift']());}};_0x52ee7e(++_0x47676f);}(_0x806d,0x1a3));var _0xd806=function(_0x4ff765,_0x17866a){_0x4ff765=_0x4ff765-0x0;var _0x3d3302=_0x806d[_0x4ff765];return _0x3d3302;};'use strict';var _=require(_0xd806('0x0'));var util=require(_0xd806('0x1'));var logger=require(_0xd806('0x2'))(_0xd806('0x3'));var moment=require(_0xd806('0x4'));var BPromise=require('bluebird');var rp=require(_0xd806('0x5'));var fs=require('fs');var path=require(_0xd806('0x6'));var rimraf=require(_0xd806('0x7'));var config=require(_0xd806('0x8'));var attributes=require('./smsMessage.attributes');module[_0xd806('0x9')]=function(_0x1a4d64,_0x4635e6){return _0x1a4d64[_0xd806('0xa')](_0xd806('0xb'),attributes,{'tableName':_0xd806('0xc'),'paranoid':![],'indexes':[{'name':_0xd806('0xd'),'fields':[_0xd806('0xd')]},{'name':_0xd806('0xe'),'fields':[_0xd806('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x164e70,_0x464d62,_0x1c2fc7){var _0x44cb4a=_0x1a4d64[_0xd806('0x10')];var _0x3f90fe=_0x164e70[_0xd806('0x11')]({'plain':!![]});if(_0x3f90fe['direction'][_0xd806('0x12')]()==='in'||_0x3f90fe[_0xd806('0x13')][_0xd806('0x12')]()===_0xd806('0x14')&&!_0x3f90fe['secret']&&!_[_0xd806('0x15')](_0x3f90fe[_0xd806('0x16')])&&!_[_0xd806('0x15')](_0x3f90fe[_0xd806('0x17')])){_0x44cb4a[_0xd806('0x18')][_0xd806('0x19')]({'where':{'id':_0x3f90fe['SmsInteractionId']}})['then'](function(_0x389e48){if(_0x389e48){_0x389e48[_0xd806('0x1a')]({'lastMsgAt':_0x3f90fe[_0xd806('0x1b')],'lastMsgDirection':_0x3f90fe[_0xd806('0x13')][_0xd806('0x12')]()});}})[_0xd806('0x1c')](function(_0x1f0ac){console[_0xd806('0x1d')](_0x1f0ac);});}if(_0x3f90fe[_0xd806('0x13')]===_0xd806('0x14')&&!_0x3f90fe[_0xd806('0x1e')]){var _0x3eafbc;_0x44cb4a['SmsAccount'][_0xd806('0x1f')]({'where':{'id':_0x3f90fe['SmsAccountId']},'raw':!![]})[_0xd806('0x20')](function(_0x240eca){_0x3eafbc=_0x240eca;if(_0x3eafbc&&_0x3eafbc['type']){switch(_0x3eafbc[_0xd806('0x21')]){case _0xd806('0x22'):var _0x59ea1d=require(_0xd806('0x22'));if(_0x3eafbc[_0xd806('0x23')]&&_0x3eafbc['authToken']&&_0x3eafbc[_0xd806('0x24')]){var _0x227de1=new _0x59ea1d(_0x3eafbc[_0xd806('0x23')],_0x3eafbc[_0xd806('0x25')]);_0x227de1[_0xd806('0x26')][_0xd806('0x27')]({'body':_0x3f90fe['body'],'to':_0x3f90fe[_0xd806('0x24')],'from':_0x3eafbc[_0xd806('0x24')],'statusCallback':_0x3eafbc['remote']+_0xd806('0x28')+_0x3f90fe['id']+'/status?token='+_0x3eafbc[_0xd806('0x29')]})[_0xd806('0x20')](function(_0xdd584){if(_0xdd584[_0xd806('0x2a')]){return _0x164e70['update']({'messageId':_0xdd584[_0xd806('0x2a')]});}})['catch'](function(_0x8fbd93){logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x22'),util[_0xd806('0x2d')](_0x8fbd93,{'showHidden':![],'depth':null}));});}else{logger[_0xd806('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd806('0x22'),_0xd806('0x2e'));}break;case _0xd806('0x2f'):var _0xcf8d70=_0xd806('0x30');if(_0x3eafbc[_0xd806('0x31')]&&_0x3eafbc[_0xd806('0x32')]){var _0xc4e56a={'recipient':[_0x3f90fe[_0xd806('0x24')]],'message':_0x3f90fe['body'],'message_type':_0x3eafbc['smsMethod']};if(_0x3eafbc[_0xd806('0x33')]&&_0x3eafbc[_0xd806('0x33')]!=='SI'){_0xc4e56a['sender']=_0x3eafbc[_0xd806('0x24')];}var _0x4a031f={'url':_0xcf8d70+_0xd806('0x34')+_0x3eafbc[_0xd806('0x31')]+_0xd806('0x35')+_0x3eafbc['password'],'method':_0xd806('0x36')};rp(_0x4a031f)[_0xd806('0x20')](function(_0x1d55dd){var _0x29b33f=_0x1d55dd[_0xd806('0x37')](';');var _0x5537b8={'user_key':_0x29b33f[0x0],'session_key':_0x29b33f[0x1]};_0x4a031f={'url':_0xcf8d70+'sms','method':_0xd806('0x38'),'headers':{'user_key':_0x5537b8[_0xd806('0x39')],'Session_key':_0x5537b8[_0xd806('0x3a')]},'json':!![],'body':_0xc4e56a};return rp(_0x4a031f);})[_0xd806('0x20')](function(_0x3129e4){if(_0x3129e4[_0xd806('0x3b')]>=0x1){var _0x58b97f={'messageId':_0x3129e4[_0xd806('0x3c')]};if(_0x3eafbc['smsMethod']!=='GP'||!_0x3eafbc['deliveryReport']){_0x58b97f['read']=!![];}return _0x164e70[_0xd806('0x1a')](_0x58b97f);}else{return logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x2f'),util[_0xd806('0x2d')](_0x3129e4,{'showHidden':![],'depth':null}));}})[_0xd806('0x1c')](function(_0x1fe785){return logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x2f'),util[_0xd806('0x2d')](_0x1fe785,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),'skebby',_0xd806('0x3d'));}break;case _0xd806('0x3e'):if(_0x3eafbc[_0xd806('0x25')]){var _0x8e4835={'recipient':_0x3f90fe[_0xd806('0x24')],'message':_0x3f90fe[_0xd806('0xf')],'sender':_0x3eafbc['senderString']||_0x3eafbc[_0xd806('0x24')],'authorization':_0x3eafbc[_0xd806('0x25')]};var _0x464d62={'method':_0xd806('0x38'),'uri':_0xd806('0x3f'),'body':_0x8e4835,'json':!![]};rp(_0x464d62)[_0xd806('0x20')](function(_0x53d220){var _0x227414={'messageId':_0x53d220[_0xd806('0x40')]};if(!_0x3eafbc[_0xd806('0x41')]){_0x227414['read']=!![];}return _0x164e70[_0xd806('0x1a')](_0x227414);})[_0xd806('0x1c')](function(_0x4ded0d){logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x3e'),util[_0xd806('0x2d')](_0x4ded0d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x3e'),_0xd806('0x42'));}break;case'clicksend':if(_0x3eafbc[_0xd806('0x31')]&&_0x3eafbc[_0xd806('0x32')]){var _0x8e4835={'messages':[{'source':_0xd806('0x43'),'to':_0x3f90fe[_0xd806('0x24')],'body':_0x3f90fe[_0xd806('0xf')],'from':_0x3eafbc[_0xd806('0x44')]||_0x3eafbc[_0xd806('0x24')]}]};var _0x3ddeb5=util[_0xd806('0x45')](_0xd806('0x46'),_0x3eafbc[_0xd806('0x31')],_0x3eafbc[_0xd806('0x32')]);var _0x464d62={'method':_0xd806('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x8e4835,'headers':{'Authorization':util[_0xd806('0x45')]('Basic\x20%s',new Buffer(_0x3ddeb5)[_0xd806('0x47')](_0xd806('0x48')))},'json':!![]};rp(_0x464d62)[_0xd806('0x20')](function(_0x4298d1){if(_0x4298d1[_0xd806('0x49')]>=0xc8&&_0x4298d1[_0xd806('0x49')]<=0xce){if(_0x4298d1[_0xd806('0x4a')]&&_0x4298d1[_0xd806('0x4a')]['queued_count']>0x0){var _0x2d4732=_[_0xd806('0x4b')](_0x4298d1[_0xd806('0x4a')][_0xd806('0x26')]);var _0x528aa0={'messageId':_0x2d4732[_0xd806('0x4c')]};if(!_0x3eafbc[_0xd806('0x41')]){_0x528aa0['read']=!![];}return _0x164e70[_0xd806('0x1a')](_0x528aa0);}else{logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x4d'),util[_0xd806('0x2d')](_0x4298d1,{'showHidden':![],'depth':null}));}}else{logger[_0xd806('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd806('0x4d'),util['inspect'](_0x4298d1,{'showHidden':![],'depth':null}));}})[_0xd806('0x1c')](function(_0x548a1f){logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x4d'),util[_0xd806('0x2d')](_0x548a1f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x4d'),_0xd806('0x3d'));}break;case _0xd806('0x4e'):if(_0x3eafbc[_0xd806('0x4f')]&&_0x3eafbc['authToken']){var _0x8e4835={'dst':_0x3f90fe[_0xd806('0x24')],'text':_0x3f90fe[_0xd806('0xf')],'src':_0x3eafbc['senderString']||_0x3eafbc[_0xd806('0x24')],'url':_0x3eafbc[_0xd806('0x50')]+_0xd806('0x28')+_0x3f90fe['id']+'/status?token='+_0x3eafbc[_0xd806('0x29')]};var _0x3ddeb5=util[_0xd806('0x45')]('%s:%s',_0x3eafbc['authId'],_0x3eafbc[_0xd806('0x25')]);var _0x464d62={'method':_0xd806('0x38'),'uri':util[_0xd806('0x45')](_0xd806('0x51'),_0x3eafbc[_0xd806('0x4f')]),'body':_0x8e4835,'headers':{'Authorization':util[_0xd806('0x45')](_0xd806('0x52'),new Buffer(_0x3ddeb5)['toString'](_0xd806('0x48')))},'json':!![]};rp(_0x464d62)['then'](function(_0x1c3cf0){var _0x3b29de={'messageId':_0x1c3cf0['message_uuid'][0x0]};return _0x164e70[_0xd806('0x1a')](_0x3b29de);})[_0xd806('0x1c')](function(_0x5d2eed){logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x4e'),util[_0xd806('0x2d')](_0x5d2eed,{'showHidden':![],'depth':null}));});}else{logger[_0xd806('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd806('0x2c'),_0xd806('0x4e'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xd806('0x53'):if(_0x3eafbc[_0xd806('0x31')]&&_0x3eafbc[_0xd806('0x32')]){if(_0x3eafbc[_0xd806('0x54')]){var _0x55aeea={'method':_0xd806('0x38'),'uri':_0x3eafbc['baseUrl']+_0xd806('0x55'),'body':{'username':_0x3eafbc[_0xd806('0x31')],'password':_0x3eafbc['password']},'json':!![]};return rp(_0x55aeea)[_0xd806('0x20')](function(_0x44370d){var _0x37550a={'method':'POST','uri':_0x3eafbc[_0xd806('0x54')]+_0xd806('0x56'),'body':{'messages':[{'from':_0x3eafbc[_0xd806('0x24')],'destinations':[{'to':_0x3f90fe['phone']}],'text':_0x3f90fe[_0xd806('0xf')],'notifyUrl':_0x3eafbc['remote']+_0xd806('0x28')+_0x3f90fe['id']+_0xd806('0x57')+_0x3eafbc[_0xd806('0x29')],'notifyContentType':_0xd806('0x58'),'callbackData':_0x3eafbc['phone']+';'+_0x3f90fe[_0xd806('0xf')]}]},'headers':{'Authorization':_0xd806('0x59')+_0x44370d['token']},'json':!![]};return rp(_0x37550a)['then'](function(_0x5dd4f0){if(_0x5dd4f0[_0xd806('0x26')]){var _0xd036bf={'messageId':_0x5dd4f0['messages'][0x0][_0xd806('0xd')]};if(!_0x3eafbc['deliveryReport']){_0xd036bf['read']=!![];}return _0x164e70[_0xd806('0x1a')](_0xd036bf);}else{return logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),'infobip',util['inspect'](_0x5dd4f0,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2b1c30){return logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x53'),util[_0xd806('0x2d')](_0x2b1c30,{'showHidden':![],'depth':null}));});}else{logger[_0xd806('0x1d')](_0xd806('0x2b'),'afterCreate',_0xd806('0x53'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xd806('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd806('0x2c'),_0xd806('0x53'),_0xd806('0x3d'));}break;case _0xd806('0x5a'):var _0x2d427f=require('crypto');if(_0x3eafbc['apiKey']){var _0x32f225={};_0x32f225[_0xd806('0x5b')]=_0x3eafbc['username'];_0x32f225[_0xd806('0x24')]=_0x3f90fe[_0xd806('0x24')];_0x32f225[_0xd806('0x5c')]=_0x3eafbc['phone'];_0x32f225[_0xd806('0x5d')]=_0x3f90fe[_0xd806('0xf')];_0x32f225[_0xd806('0x5e')]=+new Date();var _0x386ebd='';var _0x4111d8='';var _0x12b15d=Object[_0xd806('0x5f')](_0x32f225);_0x12b15d[_0xd806('0x60')]();for(var _0x116413=0x0;_0x116413<_0x12b15d[_0xd806('0x61')];_0x116413++){if(_0x386ebd!=''){_0x386ebd+='&';}_0x386ebd+=_0x12b15d[_0x116413]+'='+encodeURIComponent(_0x32f225[_0x12b15d[_0x116413]]);_0x4111d8+=_0x32f225[_0x12b15d[_0x116413]];}_0x4111d8+=_0x3eafbc['apiKey'];_0x4111d8=_0x2d427f[_0xd806('0x62')]('md5')[_0xd806('0x1a')](_0x4111d8)['digest'](_0xd806('0x63'));if(_0x386ebd!==''){_0x386ebd+='&';}_0x386ebd+=_0xd806('0x64')+_0x4111d8;var _0x4a031f={'method':'GET','uri':_0x3eafbc[_0xd806('0x54')]+_0xd806('0x65')+_0x386ebd,'json':!![]};return rp(_0x4a031f)[_0xd806('0x20')](function(_0x5ed392){var _0x1b8477=Object['keys'](_0x5ed392);if(_0x5ed392[_0x1b8477[0x0]]['error']&&parseInt(_0x5ed392[_0x1b8477[0x0]][_0xd806('0x1d')])===0x0){var _0x36d0da={'messageId':_0x5ed392[_0x1b8477[0x0]][_0xd806('0x66')]};if(!_0x3eafbc[_0xd806('0x41')]){_0x36d0da[_0xd806('0x67')]=!![];}return _0x164e70[_0xd806('0x1a')](_0x36d0da);}else{return logger[_0xd806('0x1d')](_0xd806('0x2b'),'afterCreate',_0xd806('0x5a'),util[_0xd806('0x2d')](_0x5ed392[_0xd806('0x1d')],{'showHidden':![],'depth':null}));}})[_0xd806('0x1c')](function(_0x3ed3f7){return logger[_0xd806('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd806('0x2c'),_0xd806('0x5a'),util[_0xd806('0x2d')](_0x3ed3f7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x5a'),_0xd806('0x68'));}break;case _0xd806('0x69'):if(_0x3eafbc[_0xd806('0x6a')]){var _0x42b301={'method':_0xd806('0x38'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3eafbc['apiKey']},'body':{'content':_0x3f90fe['body'],'to':[_0x3f90fe[_0xd806('0x24')]],'from':_0x3eafbc['phone'],'binary':![],'clientMessageId':_0xd806('0x6b'),'charset':_0xd806('0x6c')},'json':!![]};rp(_0x42b301)[_0xd806('0x20')](function(_0x2543ac){if(!_0x2543ac[_0xd806('0x1d')]){var _0x37a9c6={'messageId':_0x2543ac['messages'][0x0]['apiMessageId']};if(!_0x3eafbc[_0xd806('0x41')]){_0x37a9c6[_0xd806('0x67')]=!![];}return _0x164e70[_0xd806('0x1a')](_0x37a9c6);}else{return logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x69'),util['inspect'](_0x2543ac['error'],{'showHidden':![],'depth':null}));}})[_0xd806('0x1c')](function(_0x559351){return logger[_0xd806('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd806('0x2c'),'clickatell',util[_0xd806('0x2d')](_0x559351,{'showHidden':![],'depth':null}));});}else{logger[_0xd806('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd806('0x2c'),_0xd806('0x69'),_0xd806('0x68'));}break;case _0xd806('0x6d'):if(_0x3eafbc[_0xd806('0x31')]&&_0x3eafbc[_0xd806('0x32')]){var _0x3ddeb5=util['format']('%s:%s',_0x3eafbc[_0xd806('0x31')],_0x3eafbc[_0xd806('0x32')]);var _0x464d62={'method':_0xd806('0x38'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3eafbc[_0xd806('0x6e')]+'/messages','body':{'to':[_0x3f90fe['phone']],'text':_0x3f90fe[_0xd806('0xf')],'from':_0x3eafbc['phone'],'applicationId':_0x3eafbc[_0xd806('0x6f')]},'headers':{'Authorization':util[_0xd806('0x45')](_0xd806('0x52'),new Buffer(_0x3ddeb5)[_0xd806('0x47')](_0xd806('0x48')))},'json':!![]};rp(_0x464d62)[_0xd806('0x20')](function(_0x53e04b){if(_0x53e04b['id']){var _0xe3f152={'messageId':_0x53e04b['id']};return _0x164e70[_0xd806('0x1a')](_0xe3f152);}else{logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x6d'),util[_0xd806('0x2d')](_0x53e04b,{'showHidden':![],'depth':null}));}})[_0xd806('0x1c')](function(_0x3a89b1){logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x6d'),util[_0xd806('0x2d')](_0x3a89b1,{'showHidden':![],'depth':null}));});}else{logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x3eafbc[_0xd806('0x6a')]){var _0x28a086={};var _0x4a031f={'method':_0xd806('0x38'),'uri':_0xd806('0x70'),'headers':{'Authorization':_0xd806('0x71')+_0x3eafbc['apiKey'],'Content-Type':_0xd806('0x58')},'body':{'from':_0x3eafbc[_0xd806('0x24')],'to':_0x3f90fe['phone'],'text':_0x3f90fe['body']},'json':!![]};return rp(_0x4a031f)[_0xd806('0x20')](function(_0x7c5f74){if(_0x7c5f74[_0xd806('0x72')]==0xca){_0x28a086['message']=_0x7c5f74;var _0x46090c={'method':_0xd806('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xd806('0x71')+_0x3eafbc[_0xd806('0x6a')],'Content-Type':_0xd806('0x58')},'body':{'refid':_0x28a086[_0xd806('0x73')]['refid']},'json':!![]};return rp(_0x46090c)[_0xd806('0x20')](function(_0x4ebd95){_0x28a086[_0xd806('0x74')]=_0x4ebd95;var _0x12425d={'messageId':_0x28a086[_0xd806('0x73')][_0xd806('0x75')],'read':!![]};return _0x164e70['update'](_0x12425d);});}else{return logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x76'),util[_0xd806('0x2d')](_0x7c5f74,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4e1479){return logger[_0xd806('0x1d')](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x76'),util['inspect'](_0x4e1479,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xd806('0x2b'),_0xd806('0x2c'),_0xd806('0x76'),_0xd806('0x77'));}break;}}})['finally'](function(){_0x1c2fc7();});}else{_0x1c2fc7();}}},'charset':_0xd806('0x78'),'collate':_0xd806('0x79')});};
\ No newline at end of file
+var _0x7279=['digest','hex','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','api','bluebird','path','exports','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','SmsInteractionId','then','update','createdAt','catch','secret','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','/api/sms/messages/','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','%s:%s','https://rest.clicksend.com/v3/sms/send','format','toString','http_code','data','queued_count','message_id','clickSend','authId','/status?token=','token','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','application/json','infobip','apiKey','login','sender','text','length','md5'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x7279,0x161));var _0x9727=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7279[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9727('0x0'));var moment=require('moment');var BPromise=require(_0x9727('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9727('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x9727('0x3')]=function(_0x171b05,_0x2e6b0c){return _0x171b05['define'](_0x9727('0x4'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x9727('0x5'),'fields':[_0x9727('0x5')]},{'name':_0x9727('0x6'),'fields':[_0x9727('0x7')],'type':_0x9727('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x436bcc,_0x39ea70,_0xc0b763){var _0x37dfb3=_0x171b05[_0x9727('0x9')];var _0x4dbfd5=_0x436bcc[_0x9727('0xa')]({'plain':!![]});if(_0x4dbfd5[_0x9727('0xb')][_0x9727('0xc')]()==='in'||_0x4dbfd5[_0x9727('0xb')][_0x9727('0xc')]()==='out'&&!_0x4dbfd5['secret']&&!_[_0x9727('0xd')](_0x4dbfd5[_0x9727('0xe')])&&!_[_0x9727('0xd')](_0x4dbfd5['SmsInteractionId'])){_0x37dfb3['SmsInteraction']['findOne']({'where':{'id':_0x4dbfd5[_0x9727('0xf')]}})[_0x9727('0x10')](function(_0x13dfe4){if(_0x13dfe4){_0x13dfe4[_0x9727('0x11')]({'lastMsgAt':_0x4dbfd5[_0x9727('0x12')],'lastMsgDirection':_0x4dbfd5[_0x9727('0xb')]['toLowerCase']()});}})[_0x9727('0x13')](function(_0x3f67e8){console['error'](_0x3f67e8);});}if(_0x4dbfd5['direction']==='out'&&!_0x4dbfd5[_0x9727('0x14')]){var _0x3fdcc0;_0x37dfb3[_0x9727('0x15')][_0x9727('0x16')]({'where':{'id':_0x4dbfd5[_0x9727('0x17')]},'raw':!![]})[_0x9727('0x10')](function(_0x56d0ab){_0x3fdcc0=_0x56d0ab;if(_0x3fdcc0&&_0x3fdcc0[_0x9727('0x18')]){switch(_0x3fdcc0[_0x9727('0x18')]){case _0x9727('0x19'):var _0x260be2=require(_0x9727('0x19'));if(_0x3fdcc0['accountSid']&&_0x3fdcc0[_0x9727('0x1a')]&&_0x3fdcc0[_0x9727('0x1b')]){var _0x5d5716=new _0x260be2(_0x3fdcc0[_0x9727('0x1c')],_0x3fdcc0[_0x9727('0x1a')]);_0x5d5716[_0x9727('0x1d')][_0x9727('0x1e')]({'body':_0x4dbfd5[_0x9727('0x7')],'to':_0x4dbfd5[_0x9727('0x1b')],'from':_0x3fdcc0['phone'],'statusCallback':_0x3fdcc0[_0x9727('0x1f')]+_0x9727('0x20')+_0x4dbfd5['id']+'/status?token='+_0x3fdcc0['token']})[_0x9727('0x10')](function(_0x1c766e){if(_0x1c766e[_0x9727('0x21')]){return _0x436bcc[_0x9727('0x11')]({'messageId':_0x1c766e[_0x9727('0x21')]});}})[_0x9727('0x13')](function(_0x2574be){logger[_0x9727('0x22')](_0x9727('0x23'),'afterCreate','twilio',util[_0x9727('0x24')](_0x2574be,{'showHidden':![],'depth':null}));});}else{logger[_0x9727('0x22')](_0x9727('0x23'),'afterCreate',_0x9727('0x19'),_0x9727('0x25'));}break;case _0x9727('0x26'):var _0x44da1c=_0x9727('0x27');if(_0x3fdcc0[_0x9727('0x28')]&&_0x3fdcc0[_0x9727('0x29')]){var _0x1ad251={'recipient':[_0x4dbfd5[_0x9727('0x1b')]],'message':_0x4dbfd5[_0x9727('0x7')],'message_type':_0x3fdcc0[_0x9727('0x2a')]};if(_0x3fdcc0[_0x9727('0x2a')]&&_0x3fdcc0[_0x9727('0x2a')]!=='SI'){_0x1ad251['sender']=_0x3fdcc0[_0x9727('0x1b')];}var _0x1e48b7={'url':_0x44da1c+_0x9727('0x2b')+_0x3fdcc0[_0x9727('0x28')]+_0x9727('0x2c')+_0x3fdcc0['password'],'method':_0x9727('0x2d')};rp(_0x1e48b7)[_0x9727('0x10')](function(_0x383d68){var _0x2faf15=_0x383d68[_0x9727('0x2e')](';');var _0x19605a={'user_key':_0x2faf15[0x0],'session_key':_0x2faf15[0x1]};_0x1e48b7={'url':_0x44da1c+_0x9727('0x2f'),'method':_0x9727('0x30'),'headers':{'user_key':_0x19605a[_0x9727('0x31')],'Session_key':_0x19605a[_0x9727('0x32')]},'json':!![],'body':_0x1ad251};return rp(_0x1e48b7);})[_0x9727('0x10')](function(_0x2aedb3){if(_0x2aedb3['total_sent']>=0x1){var _0x1b3f80={'messageId':_0x2aedb3[_0x9727('0x33')]};if(_0x3fdcc0[_0x9727('0x2a')]!=='GP'||!_0x3fdcc0[_0x9727('0x34')]){_0x1b3f80[_0x9727('0x35')]=!![];}return _0x436bcc[_0x9727('0x11')](_0x1b3f80);}else{return logger['error'](_0x9727('0x23'),_0x9727('0x36'),'skebby',util[_0x9727('0x24')](_0x2aedb3,{'showHidden':![],'depth':null}));}})[_0x9727('0x13')](function(_0x2be57c){return logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x26'),util[_0x9727('0x24')](_0x2be57c,{'showHidden':![],'depth':null}));});}else{logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),'skebby',_0x9727('0x37'));}break;case _0x9727('0x38'):if(_0x3fdcc0[_0x9727('0x1a')]){var _0x8789f={'recipient':_0x4dbfd5[_0x9727('0x1b')],'message':_0x4dbfd5[_0x9727('0x7')],'sender':_0x3fdcc0[_0x9727('0x39')]||_0x3fdcc0[_0x9727('0x1b')],'authorization':_0x3fdcc0[_0x9727('0x1a')]};var _0x39ea70={'method':_0x9727('0x30'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x8789f,'json':!![]};rp(_0x39ea70)['then'](function(_0x4a0def){var _0x29a259={'messageId':_0x4a0def[_0x9727('0x3a')]};if(!_0x3fdcc0[_0x9727('0x34')]){_0x29a259[_0x9727('0x35')]=!![];}return _0x436bcc[_0x9727('0x11')](_0x29a259);})[_0x9727('0x13')](function(_0x59d24a){logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x38'),util[_0x9727('0x24')](_0x59d24a,{'showHidden':![],'depth':null}));});}else{logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x38'),_0x9727('0x3b'));}break;case _0x9727('0x3c'):if(_0x3fdcc0[_0x9727('0x28')]&&_0x3fdcc0['password']){var _0x8789f={'messages':[{'source':'xCALLY\x20Motion','to':_0x4dbfd5['phone'],'body':_0x4dbfd5[_0x9727('0x7')],'from':_0x3fdcc0['senderString']||_0x3fdcc0['phone']}]};var _0x5dc0e0=util['format'](_0x9727('0x3d'),_0x3fdcc0[_0x9727('0x28')],_0x3fdcc0['password']);var _0x39ea70={'method':_0x9727('0x30'),'uri':_0x9727('0x3e'),'body':_0x8789f,'headers':{'Authorization':util[_0x9727('0x3f')]('Basic\x20%s',new Buffer(_0x5dc0e0)[_0x9727('0x40')]('base64'))},'json':!![]};rp(_0x39ea70)[_0x9727('0x10')](function(_0x4b3080){if(_0x4b3080[_0x9727('0x41')]>=0xc8&&_0x4b3080[_0x9727('0x41')]<=0xce){if(_0x4b3080[_0x9727('0x42')]&&_0x4b3080[_0x9727('0x42')][_0x9727('0x43')]>0x0){var _0x4b2d24=_['head'](_0x4b3080[_0x9727('0x42')][_0x9727('0x1d')]);var _0x422307={'messageId':_0x4b2d24[_0x9727('0x44')]};if(!_0x3fdcc0['deliveryReport']){_0x422307[_0x9727('0x35')]=!![];}return _0x436bcc[_0x9727('0x11')](_0x422307);}else{logger['error'](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x45'),util['inspect'](_0x4b3080,{'showHidden':![],'depth':null}));}}else{logger[_0x9727('0x22')](_0x9727('0x23'),'afterCreate',_0x9727('0x45'),util[_0x9727('0x24')](_0x4b3080,{'showHidden':![],'depth':null}));}})[_0x9727('0x13')](function(_0x53bd81){logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x45'),util['inspect'](_0x53bd81,{'showHidden':![],'depth':null}));});}else{logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x3fdcc0[_0x9727('0x46')]&&_0x3fdcc0[_0x9727('0x1a')]){var _0x8789f={'dst':_0x4dbfd5['phone'],'text':_0x4dbfd5[_0x9727('0x7')],'src':_0x3fdcc0[_0x9727('0x39')]||_0x3fdcc0[_0x9727('0x1b')],'url':_0x3fdcc0[_0x9727('0x1f')]+_0x9727('0x20')+_0x4dbfd5['id']+_0x9727('0x47')+_0x3fdcc0[_0x9727('0x48')]};var _0x5dc0e0=util[_0x9727('0x3f')]('%s:%s',_0x3fdcc0['authId'],_0x3fdcc0[_0x9727('0x1a')]);var _0x39ea70={'method':_0x9727('0x30'),'uri':util[_0x9727('0x3f')](_0x9727('0x49'),_0x3fdcc0[_0x9727('0x46')]),'body':_0x8789f,'headers':{'Authorization':util[_0x9727('0x3f')](_0x9727('0x4a'),new Buffer(_0x5dc0e0)[_0x9727('0x40')]('base64'))},'json':!![]};rp(_0x39ea70)[_0x9727('0x10')](function(_0x2de3cb){var _0x1b5510={'messageId':_0x2de3cb['message_uuid'][0x0]};return _0x436bcc[_0x9727('0x11')](_0x1b5510);})[_0x9727('0x13')](function(_0x906775){logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),'plivo',util[_0x9727('0x24')](_0x906775,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x4b'),_0x9727('0x4c'));}break;case'infobip':if(_0x3fdcc0[_0x9727('0x28')]&&_0x3fdcc0[_0x9727('0x29')]){if(_0x3fdcc0[_0x9727('0x4d')]){var _0x5728d2={'method':_0x9727('0x30'),'uri':_0x3fdcc0[_0x9727('0x4d')]+'/auth/1/session','body':{'username':_0x3fdcc0[_0x9727('0x28')],'password':_0x3fdcc0['password']},'json':!![]};return rp(_0x5728d2)[_0x9727('0x10')](function(_0x5ee423){var _0x1fa061={'method':_0x9727('0x30'),'uri':_0x3fdcc0[_0x9727('0x4d')]+_0x9727('0x4e'),'body':{'messages':[{'from':_0x3fdcc0[_0x9727('0x1b')],'destinations':[{'to':_0x4dbfd5[_0x9727('0x1b')]}],'text':_0x4dbfd5[_0x9727('0x7')],'notifyUrl':_0x3fdcc0[_0x9727('0x1f')]+'/api/sms/messages/'+_0x4dbfd5['id']+_0x9727('0x47')+_0x3fdcc0[_0x9727('0x48')],'notifyContentType':_0x9727('0x4f'),'callbackData':_0x3fdcc0[_0x9727('0x1b')]+';'+_0x4dbfd5['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x5ee423[_0x9727('0x48')]},'json':!![]};return rp(_0x1fa061)['then'](function(_0x34d812){if(_0x34d812[_0x9727('0x1d')]){var _0x45bbd8={'messageId':_0x34d812[_0x9727('0x1d')][0x0]['messageId']};if(!_0x3fdcc0['deliveryReport']){_0x45bbd8[_0x9727('0x35')]=!![];}return _0x436bcc[_0x9727('0x11')](_0x45bbd8);}else{return logger['error'](_0x9727('0x23'),_0x9727('0x36'),'infobip',util[_0x9727('0x24')](_0x34d812,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x40c613){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9727('0x36'),_0x9727('0x50'),util[_0x9727('0x24')](_0x40c613,{'showHidden':![],'depth':null}));});}else{logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x50'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x370d46=require('crypto');if(_0x3fdcc0[_0x9727('0x51')]){var _0x5bb0de={};_0x5bb0de[_0x9727('0x52')]=_0x3fdcc0['username'];_0x5bb0de['phone']=_0x4dbfd5[_0x9727('0x1b')];_0x5bb0de[_0x9727('0x53')]=_0x3fdcc0[_0x9727('0x1b')];_0x5bb0de[_0x9727('0x54')]=_0x4dbfd5['body'];_0x5bb0de['timestamp']=+new Date();var _0x189c5e='';var _0x442b0d='';var _0x463311=Object['keys'](_0x5bb0de);_0x463311['sort']();for(var _0x455d29=0x0;_0x455d29<_0x463311[_0x9727('0x55')];_0x455d29++){if(_0x189c5e!=''){_0x189c5e+='&';}_0x189c5e+=_0x463311[_0x455d29]+'='+encodeURIComponent(_0x5bb0de[_0x463311[_0x455d29]]);_0x442b0d+=_0x5bb0de[_0x463311[_0x455d29]];}_0x442b0d+=_0x3fdcc0[_0x9727('0x51')];_0x442b0d=_0x370d46['createHash'](_0x9727('0x56'))[_0x9727('0x11')](_0x442b0d)[_0x9727('0x57')](_0x9727('0x58'));if(_0x189c5e!==''){_0x189c5e+='&';}_0x189c5e+='signature='+_0x442b0d;var _0x1e48b7={'method':_0x9727('0x2d'),'uri':_0x3fdcc0[_0x9727('0x4d')]+_0x9727('0x59')+_0x189c5e,'json':!![]};return rp(_0x1e48b7)[_0x9727('0x10')](function(_0x1117af){var _0x20a55c=Object['keys'](_0x1117af);if(_0x1117af[_0x20a55c[0x0]][_0x9727('0x22')]&&parseInt(_0x1117af[_0x20a55c[0x0]][_0x9727('0x22')])===0x0){var _0x1b75b0={'messageId':_0x1117af[_0x20a55c[0x0]][_0x9727('0x5a')]};if(!_0x3fdcc0['deliveryReport']){_0x1b75b0['read']=!![];}return _0x436bcc[_0x9727('0x11')](_0x1b75b0);}else{return logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),'csc',util[_0x9727('0x24')](_0x1117af['error'],{'showHidden':![],'depth':null}));}})[_0x9727('0x13')](function(_0x24958f){return logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x5b'),util[_0x9727('0x24')](_0x24958f,{'showHidden':![],'depth':null}));});}else{logger[_0x9727('0x22')](_0x9727('0x23'),'afterCreate',_0x9727('0x5b'),_0x9727('0x5c'));}break;case _0x9727('0x5d'):if(_0x3fdcc0[_0x9727('0x51')]){var _0x235dc6={'method':'POST','uri':_0x9727('0x5e'),'headers':{'Authorization':_0x3fdcc0[_0x9727('0x51')]},'body':{'content':_0x4dbfd5[_0x9727('0x7')],'to':[_0x4dbfd5[_0x9727('0x1b')]],'from':_0x3fdcc0['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x9727('0x5f')},'json':!![]};rp(_0x235dc6)['then'](function(_0x226da3){if(!_0x226da3[_0x9727('0x22')]){var _0x5a7d12={'messageId':_0x226da3[_0x9727('0x1d')][0x0]['apiMessageId']};if(!_0x3fdcc0[_0x9727('0x34')]){_0x5a7d12[_0x9727('0x35')]=!![];}return _0x436bcc[_0x9727('0x11')](_0x5a7d12);}else{return logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x5d'),util[_0x9727('0x24')](_0x226da3['error'],{'showHidden':![],'depth':null}));}})[_0x9727('0x13')](function(_0x5b2748){return logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x5d'),util[_0x9727('0x24')](_0x5b2748,{'showHidden':![],'depth':null}));});}else{logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x5d'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x3fdcc0[_0x9727('0x28')]&&_0x3fdcc0['password']){var _0x5dc0e0=util[_0x9727('0x3f')](_0x9727('0x3d'),_0x3fdcc0[_0x9727('0x28')],_0x3fdcc0[_0x9727('0x29')]);var _0x39ea70={'method':_0x9727('0x30'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3fdcc0[_0x9727('0x60')]+_0x9727('0x61'),'body':{'to':[_0x4dbfd5[_0x9727('0x1b')]],'text':_0x4dbfd5[_0x9727('0x7')],'from':_0x3fdcc0[_0x9727('0x1b')],'applicationId':_0x3fdcc0[_0x9727('0x62')]},'headers':{'Authorization':util[_0x9727('0x3f')](_0x9727('0x4a'),new Buffer(_0x5dc0e0)[_0x9727('0x40')]('base64'))},'json':!![]};rp(_0x39ea70)[_0x9727('0x10')](function(_0x2f7c6b){if(_0x2f7c6b['id']){var _0x9ce79e={'messageId':_0x2f7c6b['id']};return _0x436bcc[_0x9727('0x11')](_0x9ce79e);}else{logger['error'](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x63'),util['inspect'](_0x2f7c6b,{'showHidden':![],'depth':null}));}})[_0x9727('0x13')](function(_0x5d49ff){logger[_0x9727('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9727('0x36'),_0x9727('0x63'),util['inspect'](_0x5d49ff,{'showHidden':![],'depth':null}));});}else{logger[_0x9727('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9727('0x63'),_0x9727('0x37'));}break;case _0x9727('0x64'):if(_0x3fdcc0[_0x9727('0x51')]){var _0x38f233={};var _0x1e48b7={'method':'POST','uri':_0x9727('0x65'),'headers':{'Authorization':_0x9727('0x66')+_0x3fdcc0['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x3fdcc0[_0x9727('0x1b')],'to':_0x4dbfd5[_0x9727('0x1b')],'text':_0x4dbfd5[_0x9727('0x7')]},'json':!![]};return rp(_0x1e48b7)[_0x9727('0x10')](function(_0x125241){if(_0x125241[_0x9727('0x67')]==0xca){_0x38f233[_0x9727('0x68')]=_0x125241;var _0x45e76f={'method':_0x9727('0x30'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x9727('0x66')+_0x3fdcc0[_0x9727('0x51')],'Content-Type':_0x9727('0x4f')},'body':{'refid':_0x38f233[_0x9727('0x68')][_0x9727('0x69')]},'json':!![]};return rp(_0x45e76f)[_0x9727('0x10')](function(_0x4fa5f3){_0x38f233[_0x9727('0x6a')]=_0x4fa5f3;var _0x35f163={'messageId':_0x38f233[_0x9727('0x68')][_0x9727('0x69')],'read':!![]};return _0x436bcc['update'](_0x35f163);});}else{return logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),'intelepeer',util[_0x9727('0x24')](_0x125241,{'showHidden':![],'depth':null}));}})[_0x9727('0x13')](function(_0x52283c){return logger[_0x9727('0x22')](_0x9727('0x23'),_0x9727('0x36'),_0x9727('0x64'),util[_0x9727('0x24')](_0x52283c,{'showHidden':![],'depth':null}));});}else{return logger[_0x9727('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9727('0x36'),_0x9727('0x64'),_0x9727('0x6b'));}break;}}})['finally'](function(){_0xc0b763();});}else{_0xc0b763();}}},'charset':_0x9727('0x6c'),'collate':_0x9727('0x6d')});};
\ No newline at end of file
index 1117c3d..382fa3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7739=['SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSmsMessage','SmsMessage','create','body','raw','then','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','debug'];(function(_0x359877,_0x46bbd1){var _0x32e0a1=function(_0x5b5ce1){while(--_0x5b5ce1){_0x359877['push'](_0x359877['shift']());}};_0x32e0a1(++_0x46bbd1);}(_0x7739,0x1db));var _0x9773=function(_0x5dced2,_0x5cd9bc){_0x5dced2=_0x5dced2-0x0;var _0x1c8147=_0x7739[_0x5dced2];return _0x1c8147;};'use strict';var _=require('lodash');var util=require(_0x9773('0x0'));var moment=require(_0x9773('0x1'));var BPromise=require(_0x9773('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9773('0x3'))['db'];var utils=require(_0x9773('0x4'));var logger=require(_0x9773('0x5'))(_0x9773('0x6'));var config=require(_0x9773('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9773('0x8')][_0x9773('0x9')]({'port':0x232a});config[_0x9773('0xa')]=_[_0x9773('0xb')](config[_0x9773('0xa')],{'host':_0x9773('0xc'),'port':0x18eb});var socket=require(_0x9773('0xd'))(new Redis(config['redis']));require(_0x9773('0xe'))[_0x9773('0xf')](socket);function respondWithRpcPromise(_0x1b23e2,_0x348a6a,_0x19aa71){return new BPromise(function(_0x37ffbe,_0x29398e){return client[_0x9773('0x10')](_0x1b23e2,_0x19aa71)['then'](function(_0x14c3eb){logger[_0x9773('0x11')](_0x9773('0x12'),_0x348a6a,'request\x20sent');logger[_0x9773('0x13')](_0x9773('0x14'),_0x348a6a,_0x9773('0x15'),JSON[_0x9773('0x16')](_0x14c3eb));if(_0x14c3eb[_0x9773('0x17')]){if(_0x14c3eb['error'][_0x9773('0x18')]===0x1f4){logger[_0x9773('0x17')]('SmsMessage,\x20%s,\x20%s',_0x348a6a,_0x14c3eb[_0x9773('0x17')]['message']);return _0x29398e(_0x14c3eb[_0x9773('0x17')]['message']);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x348a6a,_0x14c3eb[_0x9773('0x17')][_0x9773('0x19')]);return _0x37ffbe(_0x14c3eb['error'][_0x9773('0x19')]);}else{logger[_0x9773('0x11')](_0x9773('0x12'),_0x348a6a,_0x9773('0x15'));_0x37ffbe(_0x14c3eb['result']['message']);}})[_0x9773('0x1a')](function(_0x38a861){logger[_0x9773('0x17')](_0x9773('0x12'),_0x348a6a,_0x38a861);_0x29398e(_0x38a861);});});}exports[_0x9773('0x1b')]=function(_0x472937){var _0x302961=this;return new Promise(function(_0x1ac861,_0x43b865){return db[_0x9773('0x1c')][_0x9773('0x1d')](_0x472937[_0x9773('0x1e')],{'raw':_0x472937['options']?_0x472937['options'][_0x9773('0x1f')]===undefined?!![]:![]:!![]})[_0x9773('0x20')](function(_0x433511){logger[_0x9773('0x11')](_0x9773('0x1b'),_0x472937);logger[_0x9773('0x13')]('CreateSmsMessage',_0x472937,JSON[_0x9773('0x16')](_0x433511));_0x1ac861(_0x433511);})[_0x9773('0x1a')](function(_0x2468fd){logger[_0x9773('0x17')](_0x9773('0x1b'),_0x2468fd[_0x9773('0x19')],_0x472937);_0x43b865(_0x302961[_0x9773('0x17')](0x1f4,_0x2468fd[_0x9773('0x19')]));});});};
\ No newline at end of file
+var _0x6a2a=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./smsMessage.socket','request','then','info','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','options','raw','CreateSmsMessage'];(function(_0x352c08,_0x3c8fd8){var _0xebd1de=function(_0x197a71){while(--_0x197a71){_0x352c08['push'](_0x352c08['shift']());}};_0xebd1de(++_0x3c8fd8);}(_0x6a2a,0x1e0));var _0xa6a2=function(_0x4f828c,_0x2f6cac){_0x4f828c=_0x4f828c-0x0;var _0x1fea4d=_0x6a2a[_0x4f828c];return _0x1fea4d;};'use strict';var _=require(_0xa6a2('0x0'));var util=require(_0xa6a2('0x1'));var moment=require(_0xa6a2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6a2('0x3'));var fs=require('fs');var Redis=require(_0xa6a2('0x4'));var db=require(_0xa6a2('0x5'))['db'];var utils=require(_0xa6a2('0x6'));var logger=require(_0xa6a2('0x7'))(_0xa6a2('0x8'));var config=require(_0xa6a2('0x9'));var jayson=require(_0xa6a2('0xa'));var client=jayson[_0xa6a2('0xb')]['http']({'port':0x232a});config[_0xa6a2('0xc')]=_[_0xa6a2('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6a2('0xc')]));require(_0xa6a2('0xe'))['register'](socket);function respondWithRpcPromise(_0x3d57f8,_0x2214ee,_0x438974){return new BPromise(function(_0x466362,_0x1fd88e){return client[_0xa6a2('0xf')](_0x3d57f8,_0x438974)[_0xa6a2('0x10')](function(_0x2d7017){logger[_0xa6a2('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2214ee,_0xa6a2('0x12'));logger[_0xa6a2('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2214ee,_0xa6a2('0x12'),JSON[_0xa6a2('0x14')](_0x2d7017));if(_0x2d7017[_0xa6a2('0x15')]){if(_0x2d7017[_0xa6a2('0x15')][_0xa6a2('0x16')]===0x1f4){logger[_0xa6a2('0x15')](_0xa6a2('0x17'),_0x2214ee,_0x2d7017['error'][_0xa6a2('0x18')]);return _0x1fd88e(_0x2d7017['error'][_0xa6a2('0x18')]);}logger[_0xa6a2('0x15')](_0xa6a2('0x17'),_0x2214ee,_0x2d7017[_0xa6a2('0x15')]['message']);return _0x466362(_0x2d7017['error'][_0xa6a2('0x18')]);}else{logger[_0xa6a2('0x11')](_0xa6a2('0x17'),_0x2214ee,_0xa6a2('0x12'));_0x466362(_0x2d7017[_0xa6a2('0x19')]['message']);}})[_0xa6a2('0x1a')](function(_0x336baa){logger[_0xa6a2('0x15')](_0xa6a2('0x17'),_0x2214ee,_0x336baa);_0x1fd88e(_0x336baa);});});}exports['CreateSmsMessage']=function(_0x5ee80e){var _0x419aa7=this;return new Promise(function(_0x5a4217,_0x3ebd3b){return db['SmsMessage']['create'](_0x5ee80e['body'],{'raw':_0x5ee80e[_0xa6a2('0x1b')]?_0x5ee80e[_0xa6a2('0x1b')][_0xa6a2('0x1c')]===undefined?!![]:![]:!![]})[_0xa6a2('0x10')](function(_0x2408a7){logger['info'](_0xa6a2('0x1d'),_0x5ee80e);logger[_0xa6a2('0x13')]('CreateSmsMessage',_0x5ee80e,JSON[_0xa6a2('0x14')](_0x2408a7));_0x5a4217(_0x2408a7);})['catch'](function(_0x5193a0){logger['error'](_0xa6a2('0x1d'),_0x5193a0[_0xa6a2('0x18')],_0x5ee80e);_0x3ebd3b(_0x419aa7[_0xa6a2('0x15')](0x1f4,_0x5193a0[_0xa6a2('0x18')]));});});};
\ No newline at end of file
index 76bc6b1..c8f7d37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62fa=['removeListener','register','length','smsMessage:','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62fa,0x1e7));var _0xa62f=function(_0x1e1f96,_0x4b37be){_0x1e1f96=_0x1e1f96-0x0;var _0x31c952=_0x62fa[_0x1e1f96];return _0x31c952;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xa62f('0x0'),'remove',_0xa62f('0x1')];function createListener(_0x27f345,_0x462c54){return function(_0x401a9d){_0x462c54[_0xa62f('0x2')](_0x27f345,_0x401a9d);};}function removeListener(_0x1a81d3,_0x794ad9){return function(){SmsMessageEvents[_0xa62f('0x3')](_0x1a81d3,_0x794ad9);};}exports[_0xa62f('0x4')]=function(_0x5adfdd){for(var _0x2d90f6=0x0,_0x44a32f=events[_0xa62f('0x5')];_0x2d90f6<_0x44a32f;_0x2d90f6++){var _0x4bd5fe=events[_0x2d90f6];var _0x7c45d4=createListener(_0xa62f('0x6')+_0x4bd5fe,_0x5adfdd);SmsMessageEvents['on'](_0x4bd5fe,_0x7c45d4);}};
\ No newline at end of file
+var _0x0016=['length','smsMessage:','save','remove','emit','removeListener','register'];(function(_0x2bfd90,_0x102539){var _0x33e709=function(_0x198f74){while(--_0x198f74){_0x2bfd90['push'](_0x2bfd90['shift']());}};_0x33e709(++_0x102539);}(_0x0016,0x1f3));var _0x6001=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x0016[_0x188d31];return _0x30ed33;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x6001('0x0'),_0x6001('0x1'),'update'];function createListener(_0x3b9fb8,_0x37fc63){return function(_0x3229db){_0x37fc63[_0x6001('0x2')](_0x3b9fb8,_0x3229db);};}function removeListener(_0x569f53,_0x9f6384){return function(){SmsMessageEvents[_0x6001('0x3')](_0x569f53,_0x9f6384);};}exports[_0x6001('0x4')]=function(_0x36a9f4){for(var _0x2a53b2=0x0,_0x1e50d5=events[_0x6001('0x5')];_0x2a53b2<_0x1e50d5;_0x2a53b2++){var _0x36ea4c=events[_0x2a53b2];var _0x432b77=createListener(_0x6001('0x6')+_0x36ea4c,_0x36a9f4);SmsMessageEvents['on'](_0x36ea4c,_0x432b77);}};
\ No newline at end of file
index f8e5c38..34a022e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb11a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x2365b0,_0x25d9f2){var _0x4bfcea=function(_0x18659b){while(--_0x18659b){_0x2365b0['push'](_0x2365b0['shift']());}};_0x4bfcea(++_0x25d9f2);}(_0xb11a,0x108));var _0xab11=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xb11a[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require(_0xab11('0x0'));var util=require(_0xab11('0x1'));var path=require(_0xab11('0x2'));var timeout=require(_0xab11('0x3'));var express=require(_0xab11('0x4'));var router=express[_0xab11('0x5')]();var fs_extra=require(_0xab11('0x6'));var auth=require(_0xab11('0x7'));var interaction=require(_0xab11('0x8'));var config=require(_0xab11('0x9'));var controller=require(_0xab11('0xa'));router[_0xab11('0xb')]('/',auth[_0xab11('0xc')](),controller[_0xab11('0xd')]);router[_0xab11('0xb')](_0xab11('0xe'),auth[_0xab11('0xc')](),controller[_0xab11('0xf')]);router['get'](_0xab11('0x10'),auth[_0xab11('0xc')](),controller[_0xab11('0x11')]);router[_0xab11('0xb')]('/:id/members',auth[_0xab11('0xc')](),controller['getMembers']);router[_0xab11('0xb')](_0xab11('0x12'),auth[_0xab11('0xc')](),controller[_0xab11('0x13')]);router[_0xab11('0xb')]('/:id/users',auth[_0xab11('0xc')](),controller[_0xab11('0x14')]);router[_0xab11('0x15')]('/',auth[_0xab11('0xc')](),controller[_0xab11('0x16')]);router['post'](_0xab11('0x12'),auth[_0xab11('0xc')](),controller[_0xab11('0x17')]);router[_0xab11('0x15')](_0xab11('0x18'),auth[_0xab11('0xc')](),controller[_0xab11('0x19')]);router[_0xab11('0x1a')](_0xab11('0x10'),auth[_0xab11('0xc')](),controller[_0xab11('0x1b')]);router[_0xab11('0x1c')]('/:id',auth[_0xab11('0xc')](),controller[_0xab11('0x1d')]);router['delete'](_0xab11('0x12'),auth[_0xab11('0xc')](),controller[_0xab11('0x1e')]);router['delete'](_0xab11('0x18'),auth[_0xab11('0xc')](),controller[_0xab11('0x1f')]);module[_0xab11('0x20')]=router;
\ No newline at end of file
+var _0x1690=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeTeams'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1690,0x10f));var _0x0169=function(_0x21c3be,_0x45f9b5){_0x21c3be=_0x21c3be-0x0;var _0xf90d8b=_0x1690[_0x21c3be];return _0xf90d8b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0169('0x0'));var timeout=require(_0x0169('0x1'));var express=require(_0x0169('0x2'));var router=express[_0x0169('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0169('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0169('0x5'));var controller=require(_0x0169('0x6'));router[_0x0169('0x7')]('/',auth[_0x0169('0x8')](),controller[_0x0169('0x9')]);router[_0x0169('0x7')](_0x0169('0xa'),auth[_0x0169('0x8')](),controller[_0x0169('0xb')]);router['get'](_0x0169('0xc'),auth[_0x0169('0x8')](),controller[_0x0169('0xd')]);router[_0x0169('0x7')]('/:id/members',auth[_0x0169('0x8')](),controller[_0x0169('0xe')]);router[_0x0169('0x7')](_0x0169('0xf'),auth[_0x0169('0x8')](),controller[_0x0169('0x10')]);router[_0x0169('0x7')](_0x0169('0x11'),auth[_0x0169('0x8')](),controller[_0x0169('0x12')]);router[_0x0169('0x13')]('/',auth[_0x0169('0x8')](),controller[_0x0169('0x14')]);router[_0x0169('0x13')](_0x0169('0xf'),auth[_0x0169('0x8')](),controller[_0x0169('0x15')]);router[_0x0169('0x13')](_0x0169('0x11'),auth['isAuthenticated'](),controller[_0x0169('0x16')]);router[_0x0169('0x17')](_0x0169('0xc'),auth[_0x0169('0x8')](),controller['update']);router[_0x0169('0x18')]('/:id',auth[_0x0169('0x8')](),controller['destroy']);router[_0x0169('0x18')](_0x0169('0xf'),auth[_0x0169('0x8')](),controller[_0x0169('0x19')]);router[_0x0169('0x18')](_0x0169('0x11'),auth[_0x0169('0x8')](),controller['removeAgents']);module[_0x0169('0x1a')]=router;
\ No newline at end of file
index a16d10e..8d98e3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6882=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x52a1bf,_0x35af41){var _0x5987c4=function(_0x14ddea){while(--_0x14ddea){_0x52a1bf['push'](_0x52a1bf['shift']());}};_0x5987c4(++_0x35af41);}(_0x6882,0x8b));var _0x2688=function(_0x79e816,_0x557248){_0x79e816=_0x79e816-0x0;var _0x48133f=_0x6882[_0x79e816];return _0x48133f;};'use strict';var Sequelize=require(_0x2688('0x0'));module[_0x2688('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2688('0x2')]},'timeout':{'type':Sequelize[_0x2688('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2688('0x4')](_0x2688('0x5'),_0x2688('0x6'),_0x2688('0x7'))}};
\ No newline at end of file
+var _0xdb95=['roundrobin','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x1bac71,_0x27b67f){var _0x3b2e8f=function(_0x598368){while(--_0x598368){_0x1bac71['push'](_0x1bac71['shift']());}};_0x3b2e8f(++_0x27b67f);}(_0xdb95,0x1c8));var _0x5db9=function(_0xbf31a6,_0x2f0dbb){_0xbf31a6=_0xbf31a6-0x0;var _0xb89d92=_0xdb95[_0xbf31a6];return _0xb89d92;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5db9('0x0')],'unique':_0x5db9('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5db9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5db9('0x3')](_0x5db9('0x4'),_0x5db9('0x5'),_0x5db9('0x6'))}};
\ No newline at end of file
index b838dd6..a44e932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x434b=['offset','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SmsQueue','includeAll','include','findAll','rows','catch','params','create','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','findOne','UserSmsQueue','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','ids','User','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','limit','undefined','count'];(function(_0x14b004,_0x297060){var _0x3d501f=function(_0x4a38ac){while(--_0x4a38ac){_0x14b004['push'](_0x14b004['shift']());}};_0x3d501f(++_0x297060);}(_0x434b,0x17f));var _0xb434=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0x434b[_0x32b30c];return _0xcfc212;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb434('0x0'));var jsonpatch=require(_0xb434('0x1'));var rp=require('request-promise');var moment=require(_0xb434('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb434('0x3'));var util=require(_0xb434('0x4'));var path=require(_0xb434('0x5'));var sox=require(_0xb434('0x6'));var csv=require(_0xb434('0x7'));var ejs=require(_0xb434('0x8'));var fs=require('fs');var fs_extra=require(_0xb434('0x9'));var _=require(_0xb434('0xa'));var squel=require(_0xb434('0xb'));var crypto=require('crypto');var jsforce=require(_0xb434('0xc'));var deskjs=require(_0xb434('0xd'));var toCsv=require(_0xb434('0x7'));var querystring=require(_0xb434('0xe'));var Papa=require(_0xb434('0xf'));var Redis=require(_0xb434('0x10'));var authService=require(_0xb434('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb434('0x12'));var logger=require(_0xb434('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb434('0x14'));var licenseUtil=require(_0xb434('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb434('0x16')](config[_0xb434('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb434('0x18'))(new Redis(config[_0xb434('0x17')]));require(_0xb434('0x19'))[_0xb434('0x1a')](socket);function respondWithStatusCode(_0x17713e,_0x39a5a3){_0x39a5a3=_0x39a5a3||0xcc;return function(_0x1eb85e){if(_0x1eb85e){return _0x17713e[_0xb434('0x1b')](_0x39a5a3);}return _0x17713e['status'](_0x39a5a3)[_0xb434('0x1c')]();};}function respondWithResult(_0x1ef9d2,_0x166166){_0x166166=_0x166166||0xc8;return function(_0x445df3){if(_0x445df3){return _0x1ef9d2[_0xb434('0x1d')](_0x166166)[_0xb434('0x1e')](_0x445df3);}};}function respondWithFilteredResult(_0x7255f4,_0x21b664){return function(_0x5cb20f){if(_0x5cb20f){var _0x5a14ac=typeof _0x21b664['offset']==='undefined'&&typeof _0x21b664[_0xb434('0x1f')]===_0xb434('0x20');var _0x5d86d9=_0x5cb20f[_0xb434('0x21')];var _0x5e2494=_0x5a14ac?0x0:_0x21b664[_0xb434('0x22')];var _0x33c69b=_0x5a14ac?_0x5cb20f[_0xb434('0x21')]:_0x21b664[_0xb434('0x22')]+_0x21b664[_0xb434('0x1f')];var _0x321871;if(_0x33c69b>=_0x5d86d9){_0x33c69b=_0x5d86d9;_0x321871=0xc8;}else{_0x321871=0xce;}_0x7255f4[_0xb434('0x1d')](_0x321871);return _0x7255f4[_0xb434('0x23')](_0xb434('0x24'),_0x5e2494+'-'+_0x33c69b+'/'+_0x5d86d9)[_0xb434('0x1e')](_0x5cb20f);}return null;};}function patchUpdates(_0x1fa8cf){return function(_0x5bb2b1){try{jsonpatch[_0xb434('0x25')](_0x5bb2b1,_0x1fa8cf,!![]);}catch(_0x515921){return BPromise[_0xb434('0x26')](_0x515921);}return _0x5bb2b1[_0xb434('0x27')]();};}function saveUpdates(_0xca14ec,_0x26f49c){return function(_0x1a755d){if(_0x1a755d){return _0x1a755d[_0xb434('0x28')](_0xca14ec)[_0xb434('0x29')](function(_0x32d79a){return _0x32d79a;});}return null;};}function removeEntity(_0x169a6d,_0x576f0e){return function(_0x197e42){if(_0x197e42){return _0x197e42[_0xb434('0x2a')]()['then'](function(){var _0x4937f8=_0x197e42[_0xb434('0x2b')]({'plain':!![]});var _0x564b46=_0xb434('0x2c');return db[_0xb434('0x2d')]['destroy']({'where':{'type':_0x564b46,'resourceId':_0x4937f8['id']}})[_0xb434('0x29')](function(){return _0x197e42;});})['then'](function(){_0x169a6d['status'](0xcc)[_0xb434('0x1c')]();});}};}function handleEntityNotFound(_0x2790dd,_0x296a66){return function(_0x533c7b){if(!_0x533c7b){_0x2790dd[_0xb434('0x1b')](0x194);}return _0x533c7b;};}function handleError(_0x5d7318,_0x3b1bd9){_0x3b1bd9=_0x3b1bd9||0x1f4;return function(_0x36c2f2){logger[_0xb434('0x2e')](_0x36c2f2[_0xb434('0x2f')]);if(_0x36c2f2[_0xb434('0x30')]){delete _0x36c2f2['name'];}_0x5d7318[_0xb434('0x1d')](_0x3b1bd9)[_0xb434('0x31')](_0x36c2f2);};}exports[_0xb434('0x32')]=function(_0x392833,_0x1b7073){var _0x5557cc={},_0x5b583e={},_0x4f9ffa={'count':0x0,'rows':[]};var _0x4ced5c=_[_0xb434('0x33')](db['SmsQueue'][_0xb434('0x34')],function(_0x262888){return{'name':_0x262888[_0xb434('0x35')],'type':_0x262888[_0xb434('0x36')][_0xb434('0x37')]};});_0x5b583e[_0xb434('0x38')]=_['map'](_0x4ced5c,_0xb434('0x30'));_0x5b583e['query']=_[_0xb434('0x39')](_0x392833[_0xb434('0x3a')]);_0x5b583e[_0xb434('0x3b')]=_[_0xb434('0x3c')](_0x5b583e[_0xb434('0x38')],_0x5b583e[_0xb434('0x3a')]);_0x5557cc[_0xb434('0x3d')]=_['intersection'](_0x5b583e[_0xb434('0x38')],qs[_0xb434('0x3e')](_0x392833[_0xb434('0x3a')][_0xb434('0x3e')]));_0x5557cc[_0xb434('0x3d')]=_0x5557cc[_0xb434('0x3d')][_0xb434('0x3f')]?_0x5557cc['attributes']:_0x5b583e[_0xb434('0x38')];if(!_0x392833['query'][_0xb434('0x40')](_0xb434('0x41'))){_0x5557cc['limit']=qs[_0xb434('0x1f')](_0x392833[_0xb434('0x3a')][_0xb434('0x1f')]);_0x5557cc[_0xb434('0x22')]=qs[_0xb434('0x22')](_0x392833[_0xb434('0x3a')][_0xb434('0x22')]);}_0x5557cc[_0xb434('0x42')]=qs[_0xb434('0x43')](_0x392833[_0xb434('0x3a')][_0xb434('0x43')]);_0x5557cc[_0xb434('0x44')]=qs[_0xb434('0x3b')](_[_0xb434('0x45')](_0x392833[_0xb434('0x3a')],_0x5b583e[_0xb434('0x3b')]),_0x4ced5c);if(_0x392833[_0xb434('0x3a')][_0xb434('0x46')]){_0x5557cc[_0xb434('0x44')]=_[_0xb434('0x47')](_0x5557cc[_0xb434('0x44')],{'$or':_[_0xb434('0x33')](_0x4ced5c,function(_0x387358){if(_0x387358[_0xb434('0x36')]!=='VIRTUAL'){var _0x38fa4e={};_0x38fa4e[_0x387358[_0xb434('0x30')]]={'$like':'%'+_0x392833[_0xb434('0x3a')][_0xb434('0x46')]+'%'};return _0x38fa4e;}})});}_0x5557cc=_[_0xb434('0x47')]({},_0x5557cc,_0x392833[_0xb434('0x48')]);var _0xbe4f2a={'where':_0x5557cc['where']};return db[_0xb434('0x49')][_0xb434('0x21')](_0xbe4f2a)[_0xb434('0x29')](function(_0x372431){_0x4f9ffa[_0xb434('0x21')]=_0x372431;if(_0x392833[_0xb434('0x3a')][_0xb434('0x4a')]){_0x5557cc[_0xb434('0x4b')]=[{'all':!![]}];}return db[_0xb434('0x49')][_0xb434('0x4c')](_0x5557cc);})[_0xb434('0x29')](function(_0x16dd52){_0x4f9ffa[_0xb434('0x4d')]=_0x16dd52;return _0x4f9ffa;})['then'](respondWithFilteredResult(_0x1b7073,_0x5557cc))[_0xb434('0x4e')](handleError(_0x1b7073,null));};exports['show']=function(_0x126a34,_0x4ee803){var _0x2d022f={'raw':!![],'where':{'id':_0x126a34[_0xb434('0x4f')]['id']}},_0xa1753a={};_0xa1753a[_0xb434('0x38')]=_[_0xb434('0x39')](db['SmsQueue'][_0xb434('0x34')]);_0xa1753a['query']=_[_0xb434('0x39')](_0x126a34[_0xb434('0x3a')]);_0xa1753a[_0xb434('0x3b')]=_[_0xb434('0x3c')](_0xa1753a[_0xb434('0x38')],_0xa1753a[_0xb434('0x3a')]);_0x2d022f[_0xb434('0x3d')]=_[_0xb434('0x3c')](_0xa1753a[_0xb434('0x38')],qs[_0xb434('0x3e')](_0x126a34['query'][_0xb434('0x3e')]));_0x2d022f[_0xb434('0x3d')]=_0x2d022f[_0xb434('0x3d')][_0xb434('0x3f')]?_0x2d022f['attributes']:_0xa1753a[_0xb434('0x38')];if(_0x126a34['query'][_0xb434('0x4a')]){_0x2d022f[_0xb434('0x4b')]=[{'all':!![]}];}_0x2d022f=_[_0xb434('0x47')]({},_0x2d022f,_0x126a34['options']);return db[_0xb434('0x49')]['find'](_0x2d022f)[_0xb434('0x29')](handleEntityNotFound(_0x4ee803,null))['then'](respondWithResult(_0x4ee803,null))[_0xb434('0x4e')](handleError(_0x4ee803,null));};exports['create']=function(_0x340984,_0x14d762){return db[_0xb434('0x49')][_0xb434('0x50')](_0x340984['body'],{})['then'](function(_0xdd6b52){var _0x196775=_0x340984['user'][_0xb434('0x2b')]({'plain':!![]});if(!_0x196775)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x196775[_0xb434('0x51')]===_0xb434('0x52')){var _0x23b7e7=_0xdd6b52['get']({'plain':!![]});var _0x527e62=_0xb434('0x2c');return db[_0xb434('0x53')]['find']({'where':{'name':_0x527e62,'userProfileId':_0x196775['userProfileId']},'raw':!![]})[_0xb434('0x29')](function(_0x48f400){if(_0x48f400&&_0x48f400['autoAssociation']===0x0){return db[_0xb434('0x2d')][_0xb434('0x50')]({'name':_0x23b7e7[_0xb434('0x30')],'resourceId':_0x23b7e7['id'],'type':_0x48f400[_0xb434('0x30')],'sectionId':_0x48f400['id']},{})[_0xb434('0x29')](function(){return _0xdd6b52;});}else{return _0xdd6b52;}})[_0xb434('0x4e')](function(_0x11ea3d){logger[_0xb434('0x2e')](_0xb434('0x54'),_0x11ea3d);throw _0x11ea3d;});}return _0xdd6b52;})[_0xb434('0x29')](respondWithResult(_0x14d762,0xc9))[_0xb434('0x4e')](handleError(_0x14d762,null));};exports[_0xb434('0x28')]=function(_0x535a05,_0x463647){if(_0x535a05[_0xb434('0x55')]['id']){delete _0x535a05['body']['id'];}return db[_0xb434('0x49')][_0xb434('0x56')]({'where':{'id':_0x535a05[_0xb434('0x4f')]['id']}})[_0xb434('0x29')](handleEntityNotFound(_0x463647,null))[_0xb434('0x29')](saveUpdates(_0x535a05[_0xb434('0x55')],null))['then'](respondWithResult(_0x463647,null))[_0xb434('0x4e')](handleError(_0x463647,null));};exports[_0xb434('0x2a')]=function(_0x1fad2a,_0x5f4ff1){return db[_0xb434('0x49')][_0xb434('0x56')]({'where':{'id':_0x1fad2a[_0xb434('0x4f')]['id']}})[_0xb434('0x29')](handleEntityNotFound(_0x5f4ff1,null))[_0xb434('0x29')](removeEntity(_0x5f4ff1,null))[_0xb434('0x4e')](handleError(_0x5f4ff1,null));};exports[_0xb434('0x57')]=function(_0x3071d3,_0x43a861){return db[_0xb434('0x49')][_0xb434('0x57')]()[_0xb434('0x29')](respondWithResult(_0x43a861,null))['catch'](handleError(_0x43a861,null));};exports['getMembers']=function(_0x2ef8be,_0x26cc69,_0x5306a8){var _0x116480={'raw':!![],'where':{}},_0x34cf2a={},_0x53e420;return db[_0xb434('0x49')][_0xb434('0x58')]({'where':{'id':_0x2ef8be['params']['id']}})['then'](handleEntityNotFound(_0x26cc69,null))['then'](function(_0x344ca8){if(_0x344ca8){_0x53e420=_0x344ca8['get']({'plain':!![]});_0x34cf2a[_0xb434('0x38')]=_['keys'](db['UserSmsQueue']['rawAttributes']);_0x34cf2a['query']=_[_0xb434('0x39')](_0x2ef8be[_0xb434('0x3a')]);_0x34cf2a[_0xb434('0x3b')]=_[_0xb434('0x3c')](_0x34cf2a[_0xb434('0x38')],_0x34cf2a[_0xb434('0x3a')]);_0x116480['attributes']=_[_0xb434('0x3c')](_0x34cf2a[_0xb434('0x38')],qs[_0xb434('0x3e')](_0x2ef8be[_0xb434('0x3a')][_0xb434('0x3e')]));_0x116480[_0xb434('0x3d')]=_0x116480[_0xb434('0x3d')]['length']?_0x116480[_0xb434('0x3d')]:_0x34cf2a[_0xb434('0x38')];if(!_0x2ef8be[_0xb434('0x3a')][_0xb434('0x40')](_0xb434('0x41'))){_0x116480[_0xb434('0x1f')]=qs['limit'](_0x2ef8be[_0xb434('0x3a')][_0xb434('0x1f')]);_0x116480[_0xb434('0x22')]=qs['offset'](_0x2ef8be[_0xb434('0x3a')][_0xb434('0x22')]);}_0x116480[_0xb434('0x42')]=qs[_0xb434('0x43')](_0x2ef8be[_0xb434('0x3a')]['sort']);_0x116480[_0xb434('0x44')]=qs[_0xb434('0x3b')](_[_0xb434('0x45')](_0x2ef8be[_0xb434('0x3a')],_0x34cf2a[_0xb434('0x3b')]));_0x116480['where']['SmsQueueId']=_0x344ca8['id'];if(_0x2ef8be[_0xb434('0x3a')]['filter']){_0x116480['where']=_['merge'](_0x116480[_0xb434('0x44')],{'$or':_[_0xb434('0x33')](_0x116480[_0xb434('0x3d')],function(_0x4f83dd){var _0x4d9a47={};_0x4d9a47[_0x4f83dd]={'$like':'%'+_0x2ef8be['query'][_0xb434('0x46')]+'%'};return _0x4d9a47;})});}_0x116480=_[_0xb434('0x47')]({},_0x116480,_0x2ef8be[_0xb434('0x48')]);return db[_0xb434('0x59')]['findAll'](_0x116480);}})['then'](function(_0x2d7755){if(_0x2d7755){return db['User'][_0xb434('0x5a')]({'where':{'id':_[_0xb434('0x33')](_0x2d7755,_0xb434('0x5b')),'role':_0xb434('0x5c')},'attributes':['id',_0xb434('0x30'),_0xb434('0x5d'),'updatedAt',_0xb434('0x5e')]});}})[_0xb434('0x29')](function(_0x4cc202){if(_0x4cc202){return{'count':_0x4cc202[_0xb434('0x21')],'rows':_[_0xb434('0x33')](_0x4cc202[_0xb434('0x4d')],function(_0x5681ff){return{'membername':_0x5681ff['name'],'UserId':_0x5681ff['id'],'queue_name':_0x53e420[_0xb434('0x30')],'SmsQueueId':_0x53e420['id'],'interface':util[_0xb434('0x5f')](_0xb434('0x60'),_0xb434('0x61'),_0x5681ff['name']),'penalty':0x0,'paused':_0x5681ff[_0xb434('0x5d')],'createdAt':_0x5681ff[_0xb434('0x5e')],'updatedAt':_0x5681ff[_0xb434('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x26cc69,_0x116480))[_0xb434('0x4e')](handleError(_0x26cc69,null));};exports[_0xb434('0x63')]=function(_0x29ffd8,_0x65ad79,_0x5a22f4){var _0x21bbf6={};var _0x41680b={};var _0x5d8c11;var _0x5daf3d;return db[_0xb434('0x49')][_0xb434('0x58')]({'where':{'id':_0x29ffd8[_0xb434('0x4f')]['id']}})[_0xb434('0x29')](handleEntityNotFound(_0x65ad79,null))[_0xb434('0x29')](function(_0x48006d){if(_0x48006d){_0x5d8c11=_0x48006d;_0x41680b[_0xb434('0x38')]=_[_0xb434('0x39')](db['Team'][_0xb434('0x34')]);_0x41680b[_0xb434('0x3a')]=_[_0xb434('0x39')](_0x29ffd8[_0xb434('0x3a')]);_0x41680b[_0xb434('0x3b')]=_['intersection'](_0x41680b['model'],_0x41680b[_0xb434('0x3a')]);_0x21bbf6[_0xb434('0x3d')]=_[_0xb434('0x3c')](_0x41680b['model'],qs[_0xb434('0x3e')](_0x29ffd8['query']['fields']));_0x21bbf6[_0xb434('0x3d')]=_0x21bbf6[_0xb434('0x3d')]['length']?_0x21bbf6[_0xb434('0x3d')]:_0x41680b[_0xb434('0x38')];_0x21bbf6[_0xb434('0x42')]=qs[_0xb434('0x43')](_0x29ffd8[_0xb434('0x3a')][_0xb434('0x43')]);_0x21bbf6[_0xb434('0x44')]=qs['filters'](_[_0xb434('0x45')](_0x29ffd8['query'],_0x41680b[_0xb434('0x3b')]));if(_0x29ffd8[_0xb434('0x3a')][_0xb434('0x46')]){_0x21bbf6[_0xb434('0x44')]=_['merge'](_0x21bbf6[_0xb434('0x44')],{'$or':_[_0xb434('0x33')](_0x21bbf6[_0xb434('0x3d')],function(_0x290e7d){var _0x5e0ac6={};_0x5e0ac6[_0x290e7d]={'$like':'%'+_0x29ffd8['query'][_0xb434('0x46')]+'%'};return _0x5e0ac6;})});}_0x21bbf6=_[_0xb434('0x47')]({},_0x21bbf6,_0x29ffd8[_0xb434('0x48')]);return _0x5d8c11[_0xb434('0x63')](_0x21bbf6);}})['then'](function(_0x3f79dd){if(_0x3f79dd){_0x5daf3d=_0x3f79dd[_0xb434('0x3f')];if(!_0x29ffd8[_0xb434('0x3a')]['hasOwnProperty'](_0xb434('0x41'))){_0x21bbf6[_0xb434('0x1f')]=qs[_0xb434('0x1f')](_0x29ffd8['query'][_0xb434('0x1f')]);_0x21bbf6[_0xb434('0x22')]=qs[_0xb434('0x22')](_0x29ffd8[_0xb434('0x3a')][_0xb434('0x22')]);}return _0x5d8c11[_0xb434('0x63')](_0x21bbf6);}})[_0xb434('0x29')](function(_0x6067f2){if(_0x6067f2){return _0x6067f2?{'count':_0x5daf3d,'rows':_0x6067f2}:null;}})[_0xb434('0x29')](respondWithResult(_0x65ad79,null))[_0xb434('0x4e')](handleError(_0x65ad79,null));};exports['addTeams']=function(_0x4ae12e,_0x302df5,_0x894ccc){var _0x1f731d=_0x4ae12e[_0xb434('0x55')][_0xb434('0x64')];return db['Team'][_0xb434('0x4c')]({'where':{'id':_0x1f731d},'attributes':['id'],'include':[{'model':db[_0xb434('0x65')],'as':_0xb434('0x66'),'attributes':['id','name',_0xb434('0x67'),_0xb434('0x68'),_0xb434('0x69')],'raw':!![]}]})['then'](function(_0x4c5532){if(_0x4c5532){var _0x39e2a2=_['flatMap'](_0x4c5532,function(_0x27c938){var _0x2b3b6f=_0x27c938[_0xb434('0x2b')]({'plain':!![]});return _0x2b3b6f['Agents'];});return db[_0xb434('0x49')][_0xb434('0x56')]({'where':{'id':_0x4ae12e['params']['id']}})[_0xb434('0x29')](function(_0x294d86){return db[_0xb434('0x6a')][_0xb434('0x6b')](function(_0x5f3908){return _0x294d86[_0xb434('0x6c')](_0x1f731d,{'transaction':_0x5f3908})[_0xb434('0x29')](function(){return BPromise[_0xb434('0x6d')](_0x39e2a2,function(_0x7fa771){return db[_0xb434('0x59')][_0xb434('0x6e')]({'where':{'UserId':_0x7fa771['id'],'SmsQueueId':_0x4ae12e['params']['id']},'transaction':_0x5f3908});});})[_0xb434('0x29')](function(){_0x39e2a2[_0xb434('0x6f')](function(_0xa5037d){socket[_0xb434('0x70')]('userSmsQueue:save',{'UserId':_0xa5037d['id'],'SmsQueueId':_0x294d86['id']});});});});});}})[_0xb434('0x29')](respondWithStatusCode(_0x302df5,null))['catch'](handleError(_0x302df5,null));};exports['removeTeams']=function(_0x117a93,_0x4b74d3,_0x446412){return db['Team'][_0xb434('0x4c')]({'where':{'id':_0x117a93[_0xb434('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb434('0x65')],'as':_0xb434('0x66'),'attributes':['id'],'raw':!![]}]})[_0xb434('0x29')](handleEntityNotFound(_0x4b74d3,null))[_0xb434('0x29')](function(_0x34e60e){var _0x43e24a=_['map'](_0x34e60e,'id');var _0x371240=[];var _0x2c4ce1=[];var _0x550839=squel[_0xb434('0x71')]();_0x550839[_0xb434('0x72')](_0xb434('0x73'))[_0xb434('0x74')]('team_has_sms_queues','tq')[_0xb434('0x75')](_0xb434('0x76'),'ut',_0xb434('0x77'))[_0xb434('0x44')](_0xb434('0x78'),_0x117a93['params']['id']);for(var _0x24a573=0x0;_0x24a573<_0x34e60e[_0xb434('0x3f')];_0x24a573+=0x1){let _0x5eb1e0=_0x34e60e[_0x24a573];for(var _0x335308=0x0;_0x335308<_0x5eb1e0[_0xb434('0x66')][_0xb434('0x3f')];_0x335308+=0x1){let _0x52e922=_0x5eb1e0[_0xb434('0x66')][_0x335308];var _0x50e61b=_0x550839[_0xb434('0x79')]();_0x50e61b['where'](_0xb434('0x7a'),_0x52e922['id']);_0x2c4ce1['push'](db[_0xb434('0x6a')]['query'](_0x50e61b['toString'](),{'type':db['sequelize'][_0xb434('0x7b')]['SELECT']})[_0xb434('0x29')](function(_0x504e81){if(_0x504e81[_0xb434('0x3f')]===0x1){return _0x52e922['id'];}else{var _0x5550db=_[_0xb434('0x7c')](_[_0xb434('0x33')](_0x504e81,_0xb434('0x7d')),function(_0x4aa967){return _['includes'](_0x43e24a,_0x4aa967);});if(_0x5550db){return _0x52e922['id'];}}}));}}return BPromise[_0xb434('0x7e')](_0x2c4ce1)[_0xb434('0x29')](function(_0x103011){_0x371240=_(_0x371240)[_0xb434('0x7f')](_0x103011)['compact']()[_0xb434('0x80')]();return db[_0xb434('0x49')][_0xb434('0x56')]({'where':{'id':_0x117a93['params']['id']}})[_0xb434('0x29')](function(_0x45a3c7){return db[_0xb434('0x6a')][_0xb434('0x6b')](function(_0x42dd5c){return _0x45a3c7[_0xb434('0x81')](_0x117a93['query'][_0xb434('0x64')],{'transaction':_0x42dd5c})[_0xb434('0x29')](function(){if(!_[_0xb434('0x82')](_0x371240)){return _0x45a3c7['removeAgents'](_0x371240,{'transaction':_0x42dd5c});}})[_0xb434('0x29')](function(){_0x371240[_0xb434('0x6f')](function(_0x1625c8){socket[_0xb434('0x70')](_0xb434('0x83'),{'UserId':_0x1625c8,'SmsQueueId':_0x45a3c7['id']});});});});});});})[_0xb434('0x29')](respondWithStatusCode(_0x4b74d3,null))[_0xb434('0x4e')](handleError(_0x4b74d3,null));};exports[_0xb434('0x84')]=function(_0x34346f,_0x2a4652,_0x120561){return db[_0xb434('0x49')]['find']({'where':{'id':_0x34346f['params']['id']}})[_0xb434('0x29')](handleEntityNotFound(_0x2a4652,null))[_0xb434('0x29')](function(_0xc37578){if(_0xc37578){return _0xc37578[_0xb434('0x84')](_0x34346f[_0xb434('0x55')][_0xb434('0x64')],_[_0xb434('0x85')](_0x34346f[_0xb434('0x55')],['ids','id'])||{})[_0xb434('0x86')](function(_0x142f1f){for(var _0x50801c=0x0;_0x50801c<_0x34346f[_0xb434('0x55')][_0xb434('0x64')][_0xb434('0x3f')];_0x50801c+=0x1){socket[_0xb434('0x70')](_0xb434('0x87'),{'UserId':Number(_0x34346f[_0xb434('0x55')][_0xb434('0x64')][_0x50801c]),'SmsQueueId':Number(_0x34346f['params']['id'])});}return _0x142f1f;});}})['then'](respondWithResult(_0x2a4652,null))['catch'](handleError(_0x2a4652,null));};exports[_0xb434('0x88')]=function(_0x2c101e,_0x41c1e7,_0x5abda3){return db[_0xb434('0x49')][_0xb434('0x56')]({'where':{'id':_0x2c101e['params']['id']}})[_0xb434('0x29')](handleEntityNotFound(_0x41c1e7,null))[_0xb434('0x29')](function(_0x136b90){if(_0x136b90){return _0x136b90[_0xb434('0x88')](_0x2c101e[_0xb434('0x3a')][_0xb434('0x64')])[_0xb434('0x29')](function(){if(_[_0xb434('0x89')](_0x2c101e[_0xb434('0x3a')][_0xb434('0x64')])){for(var _0x523d2a=0x0;_0x523d2a<_0x2c101e[_0xb434('0x3a')][_0xb434('0x64')][_0xb434('0x3f')];_0x523d2a+=0x1){socket[_0xb434('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x2c101e[_0xb434('0x3a')][_0xb434('0x64')][_0x523d2a]),'SmsQueueId':Number(_0x2c101e[_0xb434('0x4f')]['id'])});}}else{socket[_0xb434('0x70')](_0xb434('0x83'),{'UserId':Number(_0x2c101e['query']['ids']),'SmsQueueId':Number(_0x2c101e[_0xb434('0x4f')]['id'])});}});}})[_0xb434('0x29')](respondWithStatusCode(_0x41c1e7,null))[_0xb434('0x4e')](handleError(_0x41c1e7,null));};exports[_0xb434('0x8a')]=function(_0x2231b2,_0x195e2d,_0xbf8d2d){var _0x235b8a={};var _0x11bbdc={};var _0x4eba16;var _0x44f942;return db[_0xb434('0x49')][_0xb434('0x58')]({'where':{'id':_0x2231b2[_0xb434('0x4f')]['id']}})[_0xb434('0x29')](handleEntityNotFound(_0x195e2d,null))[_0xb434('0x29')](function(_0x4d16f0){if(_0x4d16f0){_0x4eba16=_0x4d16f0;_0x11bbdc['model']=_[_0xb434('0x39')](db['User'][_0xb434('0x34')]);_0x11bbdc[_0xb434('0x3a')]=_[_0xb434('0x39')](_0x2231b2[_0xb434('0x3a')]);_0x11bbdc['filters']=_[_0xb434('0x3c')](_0x11bbdc[_0xb434('0x38')],_0x11bbdc['query']);_0x235b8a['attributes']=_[_0xb434('0x3c')](_0x11bbdc[_0xb434('0x38')],qs[_0xb434('0x3e')](_0x2231b2[_0xb434('0x3a')][_0xb434('0x3e')]));_0x235b8a[_0xb434('0x3d')]=_0x235b8a[_0xb434('0x3d')]['length']?_0x235b8a[_0xb434('0x3d')]:_0x11bbdc['model'];_0x235b8a[_0xb434('0x42')]=qs[_0xb434('0x43')](_0x2231b2[_0xb434('0x3a')][_0xb434('0x43')]);_0x235b8a[_0xb434('0x44')]=qs[_0xb434('0x3b')](_[_0xb434('0x45')](_0x2231b2[_0xb434('0x3a')],_0x11bbdc[_0xb434('0x3b')]));if(_0x2231b2[_0xb434('0x3a')]['filter']){_0x235b8a[_0xb434('0x44')]=_[_0xb434('0x47')](_0x235b8a['where'],{'$or':_[_0xb434('0x33')](_0x235b8a[_0xb434('0x3d')],function(_0x2bc2ff){var _0x35c0b6={};_0x35c0b6[_0x2bc2ff]={'$like':'%'+_0x2231b2[_0xb434('0x3a')]['filter']+'%'};return _0x35c0b6;})});}_0x235b8a=_[_0xb434('0x47')]({},_0x235b8a,_0x2231b2['options']);return _0x4eba16[_0xb434('0x8a')](_0x235b8a);}})[_0xb434('0x29')](function(_0x285e26){if(_0x285e26){_0x44f942=_0x285e26['length'];if(!_0x2231b2[_0xb434('0x3a')][_0xb434('0x40')]('nolimit')){_0x235b8a[_0xb434('0x1f')]=qs[_0xb434('0x1f')](_0x2231b2[_0xb434('0x3a')][_0xb434('0x1f')]);_0x235b8a['offset']=qs[_0xb434('0x22')](_0x2231b2[_0xb434('0x3a')][_0xb434('0x22')]);}return _0x4eba16[_0xb434('0x8a')](_0x235b8a);}})[_0xb434('0x29')](function(_0x3fc99a){if(_0x3fc99a){return _0x3fc99a?{'count':_0x44f942,'rows':_0x3fc99a}:null;}})[_0xb434('0x29')](respondWithResult(_0x195e2d,null))['catch'](handleError(_0x195e2d,null));};
\ No newline at end of file
+var _0x6950=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','sendStatus','stack','name','send','index','SmsQueue','rawAttributes','fieldName','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','pick','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','userSmsQueue:save','ids','select','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','sequelize','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','emit','userSmsQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsQueue.socket','status','end'];(function(_0x580cda,_0x477f55){var _0x508e0c=function(_0x47b69e){while(--_0x47b69e){_0x580cda['push'](_0x580cda['shift']());}};_0x508e0c(++_0x477f55);}(_0x6950,0xfb));var _0x0695=function(_0x1505a0,_0x3c7639){_0x1505a0=_0x1505a0-0x0;var _0x70077d=_0x6950[_0x1505a0];return _0x70077d;};'use strict';var emlformat=require(_0x0695('0x0'));var rimraf=require(_0x0695('0x1'));var zipdir=require(_0x0695('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0695('0x3'));var moment=require('moment');var BPromise=require(_0x0695('0x4'));var Mustache=require(_0x0695('0x5'));var util=require(_0x0695('0x6'));var path=require('path');var sox=require(_0x0695('0x7'));var csv=require('to-csv');var ejs=require(_0x0695('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0695('0x9'));var squel=require(_0x0695('0xa'));var crypto=require(_0x0695('0xb'));var jsforce=require(_0x0695('0xc'));var deskjs=require(_0x0695('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0695('0xe'));var Papa=require(_0x0695('0xf'));var Redis=require(_0x0695('0x10'));var authService=require(_0x0695('0x11'));var qs=require(_0x0695('0x12'));var as=require(_0x0695('0x13'));var hardwareService=require(_0x0695('0x14'));var logger=require(_0x0695('0x15'))('api');var utils=require(_0x0695('0x16'));var config=require(_0x0695('0x17'));var licenseUtil=require(_0x0695('0x18'));var db=require(_0x0695('0x19'))['db'];config[_0x0695('0x1a')]=_['defaults'](config['redis'],{'host':_0x0695('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0695('0x1a')]));require(_0x0695('0x1c'))['register'](socket);function respondWithStatusCode(_0x48954e,_0x3796de){_0x3796de=_0x3796de||0xcc;return function(_0x4eb422){if(_0x4eb422){return _0x48954e['sendStatus'](_0x3796de);}return _0x48954e[_0x0695('0x1d')](_0x3796de)[_0x0695('0x1e')]();};}function respondWithResult(_0x364d93,_0x3c8085){_0x3c8085=_0x3c8085||0xc8;return function(_0x3a1e97){if(_0x3a1e97){return _0x364d93[_0x0695('0x1d')](_0x3c8085)['json'](_0x3a1e97);}};}function respondWithFilteredResult(_0x50d412,_0x4cfc50){return function(_0x47efde){if(_0x47efde){var _0x2fe14d=typeof _0x4cfc50[_0x0695('0x1f')]===_0x0695('0x20')&&typeof _0x4cfc50[_0x0695('0x21')]==='undefined';var _0x3ea82f=_0x47efde[_0x0695('0x22')];var _0x77c707=_0x2fe14d?0x0:_0x4cfc50[_0x0695('0x1f')];var _0x1ecbbe=_0x2fe14d?_0x47efde[_0x0695('0x22')]:_0x4cfc50['offset']+_0x4cfc50['limit'];var _0x42ba7c;if(_0x1ecbbe>=_0x3ea82f){_0x1ecbbe=_0x3ea82f;_0x42ba7c=0xc8;}else{_0x42ba7c=0xce;}_0x50d412[_0x0695('0x1d')](_0x42ba7c);return _0x50d412[_0x0695('0x23')](_0x0695('0x24'),_0x77c707+'-'+_0x1ecbbe+'/'+_0x3ea82f)[_0x0695('0x25')](_0x47efde);}return null;};}function patchUpdates(_0x52704b){return function(_0x9b4412){try{jsonpatch[_0x0695('0x26')](_0x9b4412,_0x52704b,!![]);}catch(_0x210d96){return BPromise[_0x0695('0x27')](_0x210d96);}return _0x9b4412[_0x0695('0x28')]();};}function saveUpdates(_0x48260e,_0x2b7c0a){return function(_0x435e76){if(_0x435e76){return _0x435e76[_0x0695('0x29')](_0x48260e)[_0x0695('0x2a')](function(_0x484419){return _0x484419;});}return null;};}function removeEntity(_0x24c337,_0x485c13){return function(_0x71474){if(_0x71474){return _0x71474[_0x0695('0x2b')]()[_0x0695('0x2a')](function(){var _0xe63aa2=_0x71474[_0x0695('0x2c')]({'plain':!![]});var _0xc82683='SmsQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xc82683,'resourceId':_0xe63aa2['id']}})[_0x0695('0x2a')](function(){return _0x71474;});})[_0x0695('0x2a')](function(){_0x24c337[_0x0695('0x1d')](0xcc)[_0x0695('0x1e')]();});}};}function handleEntityNotFound(_0x5d4b7f,_0x4724b6){return function(_0x1bd9d8){if(!_0x1bd9d8){_0x5d4b7f[_0x0695('0x2d')](0x194);}return _0x1bd9d8;};}function handleError(_0x1ac1e3,_0x253b4a){_0x253b4a=_0x253b4a||0x1f4;return function(_0x38b746){logger['error'](_0x38b746[_0x0695('0x2e')]);if(_0x38b746[_0x0695('0x2f')]){delete _0x38b746[_0x0695('0x2f')];}_0x1ac1e3[_0x0695('0x1d')](_0x253b4a)[_0x0695('0x30')](_0x38b746);};}exports[_0x0695('0x31')]=function(_0x6727f6,_0x246399){var _0xb73102={},_0x287fcf={},_0x4e2bfb={'count':0x0,'rows':[]};var _0xfdef27=_['map'](db[_0x0695('0x32')][_0x0695('0x33')],function(_0x13e18c){return{'name':_0x13e18c[_0x0695('0x34')],'type':_0x13e18c['type']['key']};});_0x287fcf[_0x0695('0x35')]=_[_0x0695('0x36')](_0xfdef27,_0x0695('0x2f'));_0x287fcf[_0x0695('0x37')]=_['keys'](_0x6727f6[_0x0695('0x37')]);_0x287fcf['filters']=_[_0x0695('0x38')](_0x287fcf['model'],_0x287fcf['query']);_0xb73102['attributes']=_[_0x0695('0x38')](_0x287fcf['model'],qs['fields'](_0x6727f6[_0x0695('0x37')][_0x0695('0x39')]));_0xb73102[_0x0695('0x3a')]=_0xb73102[_0x0695('0x3a')][_0x0695('0x3b')]?_0xb73102['attributes']:_0x287fcf[_0x0695('0x35')];if(!_0x6727f6[_0x0695('0x37')][_0x0695('0x3c')](_0x0695('0x3d'))){_0xb73102['limit']=qs['limit'](_0x6727f6['query'][_0x0695('0x21')]);_0xb73102[_0x0695('0x1f')]=qs[_0x0695('0x1f')](_0x6727f6[_0x0695('0x37')][_0x0695('0x1f')]);}_0xb73102[_0x0695('0x3e')]=qs[_0x0695('0x3f')](_0x6727f6[_0x0695('0x37')][_0x0695('0x3f')]);_0xb73102['where']=qs[_0x0695('0x40')](_['pick'](_0x6727f6[_0x0695('0x37')],_0x287fcf[_0x0695('0x40')]),_0xfdef27);if(_0x6727f6['query'][_0x0695('0x41')]){_0xb73102[_0x0695('0x42')]=_[_0x0695('0x43')](_0xb73102[_0x0695('0x42')],{'$or':_[_0x0695('0x36')](_0xfdef27,function(_0x328bbd){if(_0x328bbd['type']!==_0x0695('0x44')){var _0x5e7bde={};_0x5e7bde[_0x328bbd[_0x0695('0x2f')]]={'$like':'%'+_0x6727f6[_0x0695('0x37')][_0x0695('0x41')]+'%'};return _0x5e7bde;}})});}_0xb73102=_[_0x0695('0x43')]({},_0xb73102,_0x6727f6[_0x0695('0x45')]);var _0x54da3c={'where':_0xb73102[_0x0695('0x42')]};return db[_0x0695('0x32')][_0x0695('0x22')](_0x54da3c)[_0x0695('0x2a')](function(_0x5a7e35){_0x4e2bfb['count']=_0x5a7e35;if(_0x6727f6[_0x0695('0x37')][_0x0695('0x46')]){_0xb73102[_0x0695('0x47')]=[{'all':!![]}];}return db[_0x0695('0x32')][_0x0695('0x48')](_0xb73102);})[_0x0695('0x2a')](function(_0x6869c5){_0x4e2bfb[_0x0695('0x49')]=_0x6869c5;return _0x4e2bfb;})['then'](respondWithFilteredResult(_0x246399,_0xb73102))[_0x0695('0x4a')](handleError(_0x246399,null));};exports[_0x0695('0x4b')]=function(_0x39ade9,_0x3ebe0f){var _0x3e065b={'raw':!![],'where':{'id':_0x39ade9[_0x0695('0x4c')]['id']}},_0x340d67={};_0x340d67[_0x0695('0x35')]=_[_0x0695('0x4d')](db[_0x0695('0x32')]['rawAttributes']);_0x340d67['query']=_['keys'](_0x39ade9[_0x0695('0x37')]);_0x340d67[_0x0695('0x40')]=_[_0x0695('0x38')](_0x340d67[_0x0695('0x35')],_0x340d67['query']);_0x3e065b['attributes']=_[_0x0695('0x38')](_0x340d67[_0x0695('0x35')],qs[_0x0695('0x39')](_0x39ade9[_0x0695('0x37')][_0x0695('0x39')]));_0x3e065b[_0x0695('0x3a')]=_0x3e065b[_0x0695('0x3a')][_0x0695('0x3b')]?_0x3e065b[_0x0695('0x3a')]:_0x340d67['model'];if(_0x39ade9['query'][_0x0695('0x46')]){_0x3e065b[_0x0695('0x47')]=[{'all':!![]}];}_0x3e065b=_[_0x0695('0x43')]({},_0x3e065b,_0x39ade9['options']);return db[_0x0695('0x32')][_0x0695('0x4e')](_0x3e065b)[_0x0695('0x2a')](handleEntityNotFound(_0x3ebe0f,null))[_0x0695('0x2a')](respondWithResult(_0x3ebe0f,null))['catch'](handleError(_0x3ebe0f,null));};exports[_0x0695('0x4f')]=function(_0x45964b,_0xad699a){return db['SmsQueue'][_0x0695('0x4f')](_0x45964b['body'],{})[_0x0695('0x2a')](function(_0x28bd93){var _0x571b20=_0x45964b[_0x0695('0x50')][_0x0695('0x2c')]({'plain':!![]});if(!_0x571b20)throw new Error(_0x0695('0x51'));if(_0x571b20[_0x0695('0x52')]===_0x0695('0x50')){var _0x38b704=_0x28bd93[_0x0695('0x2c')]({'plain':!![]});var _0x4f0bd0=_0x0695('0x53');return db[_0x0695('0x54')][_0x0695('0x4e')]({'where':{'name':_0x4f0bd0,'userProfileId':_0x571b20[_0x0695('0x55')]},'raw':!![]})[_0x0695('0x2a')](function(_0xaf8e60){if(_0xaf8e60&&_0xaf8e60['autoAssociation']===0x0){return db[_0x0695('0x56')]['create']({'name':_0x38b704['name'],'resourceId':_0x38b704['id'],'type':_0xaf8e60[_0x0695('0x2f')],'sectionId':_0xaf8e60['id']},{})[_0x0695('0x2a')](function(){return _0x28bd93;});}else{return _0x28bd93;}})['catch'](function(_0xde7124){logger[_0x0695('0x57')](_0x0695('0x58'),_0xde7124);throw _0xde7124;});}return _0x28bd93;})[_0x0695('0x2a')](respondWithResult(_0xad699a,0xc9))[_0x0695('0x4a')](handleError(_0xad699a,null));};exports[_0x0695('0x29')]=function(_0x211d93,_0x552c31){if(_0x211d93[_0x0695('0x59')]['id']){delete _0x211d93[_0x0695('0x59')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x211d93[_0x0695('0x4c')]['id']}})['then'](handleEntityNotFound(_0x552c31,null))['then'](saveUpdates(_0x211d93[_0x0695('0x59')],null))[_0x0695('0x2a')](respondWithResult(_0x552c31,null))[_0x0695('0x4a')](handleError(_0x552c31,null));};exports[_0x0695('0x2b')]=function(_0x3c558a,_0x3074d2){return db[_0x0695('0x32')][_0x0695('0x4e')]({'where':{'id':_0x3c558a['params']['id']}})[_0x0695('0x2a')](handleEntityNotFound(_0x3074d2,null))[_0x0695('0x2a')](removeEntity(_0x3074d2,null))[_0x0695('0x4a')](handleError(_0x3074d2,null));};exports[_0x0695('0x5a')]=function(_0x227abb,_0x4fc215){return db[_0x0695('0x32')]['describe']()[_0x0695('0x2a')](respondWithResult(_0x4fc215,null))[_0x0695('0x4a')](handleError(_0x4fc215,null));};exports[_0x0695('0x5b')]=function(_0x18d312,_0x54ee4c,_0x42552c){var _0x2a5d26={'raw':!![],'where':{}},_0xaa26bb={},_0x5258a2;return db['SmsQueue'][_0x0695('0x5c')]({'where':{'id':_0x18d312['params']['id']}})[_0x0695('0x2a')](handleEntityNotFound(_0x54ee4c,null))[_0x0695('0x2a')](function(_0x30237f){if(_0x30237f){_0x5258a2=_0x30237f['get']({'plain':!![]});_0xaa26bb[_0x0695('0x35')]=_[_0x0695('0x4d')](db['UserSmsQueue'][_0x0695('0x33')]);_0xaa26bb[_0x0695('0x37')]=_[_0x0695('0x4d')](_0x18d312[_0x0695('0x37')]);_0xaa26bb[_0x0695('0x40')]=_['intersection'](_0xaa26bb[_0x0695('0x35')],_0xaa26bb[_0x0695('0x37')]);_0x2a5d26[_0x0695('0x3a')]=_['intersection'](_0xaa26bb[_0x0695('0x35')],qs[_0x0695('0x39')](_0x18d312[_0x0695('0x37')]['fields']));_0x2a5d26[_0x0695('0x3a')]=_0x2a5d26[_0x0695('0x3a')][_0x0695('0x3b')]?_0x2a5d26['attributes']:_0xaa26bb[_0x0695('0x35')];if(!_0x18d312['query']['hasOwnProperty'](_0x0695('0x3d'))){_0x2a5d26[_0x0695('0x21')]=qs[_0x0695('0x21')](_0x18d312[_0x0695('0x37')][_0x0695('0x21')]);_0x2a5d26[_0x0695('0x1f')]=qs['offset'](_0x18d312['query'][_0x0695('0x1f')]);}_0x2a5d26[_0x0695('0x3e')]=qs[_0x0695('0x3f')](_0x18d312[_0x0695('0x37')][_0x0695('0x3f')]);_0x2a5d26['where']=qs[_0x0695('0x40')](_[_0x0695('0x5d')](_0x18d312[_0x0695('0x37')],_0xaa26bb['filters']));_0x2a5d26['where'][_0x0695('0x5e')]=_0x30237f['id'];if(_0x18d312['query'][_0x0695('0x41')]){_0x2a5d26[_0x0695('0x42')]=_[_0x0695('0x43')](_0x2a5d26[_0x0695('0x42')],{'$or':_[_0x0695('0x36')](_0x2a5d26[_0x0695('0x3a')],function(_0x37ac4c){var _0xed2403={};_0xed2403[_0x37ac4c]={'$like':'%'+_0x18d312[_0x0695('0x37')][_0x0695('0x41')]+'%'};return _0xed2403;})});}_0x2a5d26=_[_0x0695('0x43')]({},_0x2a5d26,_0x18d312[_0x0695('0x45')]);return db[_0x0695('0x5f')]['findAll'](_0x2a5d26);}})[_0x0695('0x2a')](function(_0x38b8d0){if(_0x38b8d0){return db[_0x0695('0x60')][_0x0695('0x61')]({'where':{'id':_[_0x0695('0x36')](_0x38b8d0,_0x0695('0x62')),'role':'agent'},'attributes':['id',_0x0695('0x2f'),_0x0695('0x63'),_0x0695('0x64'),_0x0695('0x65')]});}})[_0x0695('0x2a')](function(_0x20f860){if(_0x20f860){return{'count':_0x20f860['count'],'rows':_['map'](_0x20f860[_0x0695('0x49')],function(_0x5dd76f){return{'membername':_0x5dd76f[_0x0695('0x2f')],'UserId':_0x5dd76f['id'],'queue_name':_0x5258a2[_0x0695('0x2f')],'SmsQueueId':_0x5258a2['id'],'interface':util[_0x0695('0x66')](_0x0695('0x67'),'SIP',_0x5dd76f[_0x0695('0x2f')]),'penalty':0x0,'paused':_0x5dd76f[_0x0695('0x63')],'createdAt':_0x5dd76f['createdAt'],'updatedAt':_0x5dd76f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0695('0x2a')](respondWithFilteredResult(_0x54ee4c,_0x2a5d26))['catch'](handleError(_0x54ee4c,null));};exports[_0x0695('0x68')]=function(_0x36fbc1,_0x377fde,_0x2f3e57){var _0x37cc5d={};var _0xacf7e9={};var _0x5c10f6;var _0x4dbb54;return db['SmsQueue'][_0x0695('0x5c')]({'where':{'id':_0x36fbc1[_0x0695('0x4c')]['id']}})['then'](handleEntityNotFound(_0x377fde,null))[_0x0695('0x2a')](function(_0x9cc43a){if(_0x9cc43a){_0x5c10f6=_0x9cc43a;_0xacf7e9['model']=_[_0x0695('0x4d')](db[_0x0695('0x69')][_0x0695('0x33')]);_0xacf7e9[_0x0695('0x37')]=_['keys'](_0x36fbc1[_0x0695('0x37')]);_0xacf7e9[_0x0695('0x40')]=_['intersection'](_0xacf7e9[_0x0695('0x35')],_0xacf7e9['query']);_0x37cc5d['attributes']=_[_0x0695('0x38')](_0xacf7e9[_0x0695('0x35')],qs['fields'](_0x36fbc1[_0x0695('0x37')][_0x0695('0x39')]));_0x37cc5d[_0x0695('0x3a')]=_0x37cc5d['attributes'][_0x0695('0x3b')]?_0x37cc5d[_0x0695('0x3a')]:_0xacf7e9[_0x0695('0x35')];_0x37cc5d['order']=qs[_0x0695('0x3f')](_0x36fbc1[_0x0695('0x37')][_0x0695('0x3f')]);_0x37cc5d['where']=qs['filters'](_['pick'](_0x36fbc1[_0x0695('0x37')],_0xacf7e9[_0x0695('0x40')]));if(_0x36fbc1[_0x0695('0x37')]['filter']){_0x37cc5d[_0x0695('0x42')]=_['merge'](_0x37cc5d[_0x0695('0x42')],{'$or':_[_0x0695('0x36')](_0x37cc5d['attributes'],function(_0x16d4ee){var _0x13cf61={};_0x13cf61[_0x16d4ee]={'$like':'%'+_0x36fbc1[_0x0695('0x37')][_0x0695('0x41')]+'%'};return _0x13cf61;})});}_0x37cc5d=_['merge']({},_0x37cc5d,_0x36fbc1[_0x0695('0x45')]);return _0x5c10f6[_0x0695('0x68')](_0x37cc5d);}})['then'](function(_0xeb4b38){if(_0xeb4b38){_0x4dbb54=_0xeb4b38[_0x0695('0x3b')];if(!_0x36fbc1[_0x0695('0x37')][_0x0695('0x3c')](_0x0695('0x3d'))){_0x37cc5d['limit']=qs[_0x0695('0x21')](_0x36fbc1[_0x0695('0x37')][_0x0695('0x21')]);_0x37cc5d[_0x0695('0x1f')]=qs[_0x0695('0x1f')](_0x36fbc1[_0x0695('0x37')][_0x0695('0x1f')]);}return _0x5c10f6[_0x0695('0x68')](_0x37cc5d);}})[_0x0695('0x2a')](function(_0x56230b){if(_0x56230b){return _0x56230b?{'count':_0x4dbb54,'rows':_0x56230b}:null;}})[_0x0695('0x2a')](respondWithResult(_0x377fde,null))['catch'](handleError(_0x377fde,null));};exports[_0x0695('0x6a')]=function(_0x3127ed,_0x3cd811,_0x23d3e3){var _0x109a7a=_0x3127ed[_0x0695('0x59')]['ids'];return db[_0x0695('0x69')][_0x0695('0x48')]({'where':{'id':_0x109a7a},'attributes':['id'],'include':[{'model':db[_0x0695('0x60')],'as':'Agents','attributes':['id',_0x0695('0x2f'),'online',_0x0695('0x6b'),_0x0695('0x6c')],'raw':!![]}]})[_0x0695('0x2a')](function(_0x292eaa){if(_0x292eaa){var _0x2d31ce=_[_0x0695('0x6d')](_0x292eaa,function(_0x332f77){var _0xf0043=_0x332f77['get']({'plain':!![]});return _0xf0043[_0x0695('0x6e')];});return db[_0x0695('0x32')][_0x0695('0x4e')]({'where':{'id':_0x3127ed['params']['id']}})[_0x0695('0x2a')](function(_0x5e40a9){return db['sequelize'][_0x0695('0x6f')](function(_0x1daa97){return _0x5e40a9[_0x0695('0x6a')](_0x109a7a,{'transaction':_0x1daa97})[_0x0695('0x2a')](function(){return BPromise[_0x0695('0x70')](_0x2d31ce,function(_0x389040){return db[_0x0695('0x5f')][_0x0695('0x71')]({'where':{'UserId':_0x389040['id'],'SmsQueueId':_0x3127ed['params']['id']},'transaction':_0x1daa97});});})['then'](function(){_0x2d31ce[_0x0695('0x72')](function(_0x5a14cf){socket['emit'](_0x0695('0x73'),{'UserId':_0x5a14cf['id'],'SmsQueueId':_0x5e40a9['id']});});});});});}})[_0x0695('0x2a')](respondWithStatusCode(_0x3cd811,null))[_0x0695('0x4a')](handleError(_0x3cd811,null));};exports['removeTeams']=function(_0x5e6131,_0x319f61,_0x3767dd){return db[_0x0695('0x69')][_0x0695('0x48')]({'where':{'id':_0x5e6131['query'][_0x0695('0x74')]},'attributes':['id'],'include':[{'model':db[_0x0695('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x319f61,null))[_0x0695('0x2a')](function(_0x10dbc0){var _0x155970=_['map'](_0x10dbc0,'id');var _0x4288a3=[];var _0x552349=[];var _0x3c9727=squel[_0x0695('0x75')]();_0x3c9727['field'](_0x0695('0x76'))['from'](_0x0695('0x77'),'tq')[_0x0695('0x78')]('user_has_teams','ut',_0x0695('0x79'))[_0x0695('0x42')](_0x0695('0x7a'),_0x5e6131[_0x0695('0x4c')]['id']);for(var _0x40028b=0x0;_0x40028b<_0x10dbc0[_0x0695('0x3b')];_0x40028b+=0x1){let _0xd0ed55=_0x10dbc0[_0x40028b];for(var _0x44d065=0x0;_0x44d065<_0xd0ed55[_0x0695('0x6e')]['length'];_0x44d065+=0x1){let _0x62c792=_0xd0ed55[_0x0695('0x6e')][_0x44d065];var _0x3b8a82=_0x3c9727[_0x0695('0x7b')]();_0x3b8a82[_0x0695('0x42')]('ut.UserId\x20=\x20?',_0x62c792['id']);_0x552349['push'](db[_0x0695('0x7c')]['query'](_0x3b8a82['toString'](),{'type':db['sequelize'][_0x0695('0x7d')][_0x0695('0x7e')]})[_0x0695('0x2a')](function(_0x2cdf66){if(_0x2cdf66[_0x0695('0x3b')]===0x1){return _0x62c792['id'];}else{var _0x36587f=_[_0x0695('0x7f')](_['map'](_0x2cdf66,'TeamId'),function(_0x289be4){return _[_0x0695('0x80')](_0x155970,_0x289be4);});if(_0x36587f){return _0x62c792['id'];}}}));}}return BPromise[_0x0695('0x81')](_0x552349)[_0x0695('0x2a')](function(_0x29bbe1){_0x4288a3=_(_0x4288a3)[_0x0695('0x82')](_0x29bbe1)[_0x0695('0x83')]()[_0x0695('0x84')]();return db[_0x0695('0x32')][_0x0695('0x4e')]({'where':{'id':_0x5e6131[_0x0695('0x4c')]['id']}})[_0x0695('0x2a')](function(_0x3bfdbc){return db[_0x0695('0x7c')][_0x0695('0x6f')](function(_0x593073){return _0x3bfdbc['removeTeams'](_0x5e6131['query'][_0x0695('0x74')],{'transaction':_0x593073})[_0x0695('0x2a')](function(){if(!_[_0x0695('0x85')](_0x4288a3)){return _0x3bfdbc['removeAgents'](_0x4288a3,{'transaction':_0x593073});}})[_0x0695('0x2a')](function(){_0x4288a3[_0x0695('0x72')](function(_0x35147b){socket[_0x0695('0x86')](_0x0695('0x87'),{'UserId':_0x35147b,'SmsQueueId':_0x3bfdbc['id']});});});});});});})[_0x0695('0x2a')](respondWithStatusCode(_0x319f61,null))['catch'](handleError(_0x319f61,null));};exports[_0x0695('0x88')]=function(_0x5b476b,_0x49ba98,_0x177f3c){return db[_0x0695('0x32')]['find']({'where':{'id':_0x5b476b[_0x0695('0x4c')]['id']}})[_0x0695('0x2a')](handleEntityNotFound(_0x49ba98,null))[_0x0695('0x2a')](function(_0x2e21ce){if(_0x2e21ce){return _0x2e21ce[_0x0695('0x88')](_0x5b476b['body'][_0x0695('0x74')],_[_0x0695('0x89')](_0x5b476b[_0x0695('0x59')],['ids','id'])||{})['spread'](function(_0x5267d6){for(var _0x38a67b=0x0;_0x38a67b<_0x5b476b[_0x0695('0x59')][_0x0695('0x74')][_0x0695('0x3b')];_0x38a67b+=0x1){socket[_0x0695('0x86')](_0x0695('0x73'),{'UserId':Number(_0x5b476b[_0x0695('0x59')][_0x0695('0x74')][_0x38a67b]),'SmsQueueId':Number(_0x5b476b[_0x0695('0x4c')]['id'])});}return _0x5267d6;});}})[_0x0695('0x2a')](respondWithResult(_0x49ba98,null))[_0x0695('0x4a')](handleError(_0x49ba98,null));};exports['removeAgents']=function(_0x1400e7,_0x523eb9,_0x5915c5){return db[_0x0695('0x32')][_0x0695('0x4e')]({'where':{'id':_0x1400e7[_0x0695('0x4c')]['id']}})[_0x0695('0x2a')](handleEntityNotFound(_0x523eb9,null))[_0x0695('0x2a')](function(_0x498e01){if(_0x498e01){return _0x498e01[_0x0695('0x8a')](_0x1400e7[_0x0695('0x37')][_0x0695('0x74')])[_0x0695('0x2a')](function(){if(_[_0x0695('0x8b')](_0x1400e7[_0x0695('0x37')][_0x0695('0x74')])){for(var _0x5ad571=0x0;_0x5ad571<_0x1400e7[_0x0695('0x37')][_0x0695('0x74')][_0x0695('0x3b')];_0x5ad571+=0x1){socket[_0x0695('0x86')](_0x0695('0x87'),{'UserId':Number(_0x1400e7[_0x0695('0x37')][_0x0695('0x74')][_0x5ad571]),'SmsQueueId':Number(_0x1400e7['params']['id'])});}}else{socket[_0x0695('0x86')]('userSmsQueue:remove',{'UserId':Number(_0x1400e7['query'][_0x0695('0x74')]),'SmsQueueId':Number(_0x1400e7['params']['id'])});}});}})[_0x0695('0x2a')](respondWithStatusCode(_0x523eb9,null))[_0x0695('0x4a')](handleError(_0x523eb9,null));};exports['getAgents']=function(_0x3b8b35,_0x455050,_0x5d1d0){var _0x5a8b2f={};var _0x3358c6={};var _0x141096;var _0x4664e2;return db[_0x0695('0x32')][_0x0695('0x5c')]({'where':{'id':_0x3b8b35[_0x0695('0x4c')]['id']}})[_0x0695('0x2a')](handleEntityNotFound(_0x455050,null))[_0x0695('0x2a')](function(_0x2bdf53){if(_0x2bdf53){_0x141096=_0x2bdf53;_0x3358c6['model']=_[_0x0695('0x4d')](db[_0x0695('0x60')][_0x0695('0x33')]);_0x3358c6[_0x0695('0x37')]=_[_0x0695('0x4d')](_0x3b8b35[_0x0695('0x37')]);_0x3358c6[_0x0695('0x40')]=_[_0x0695('0x38')](_0x3358c6['model'],_0x3358c6[_0x0695('0x37')]);_0x5a8b2f[_0x0695('0x3a')]=_[_0x0695('0x38')](_0x3358c6[_0x0695('0x35')],qs['fields'](_0x3b8b35[_0x0695('0x37')][_0x0695('0x39')]));_0x5a8b2f[_0x0695('0x3a')]=_0x5a8b2f[_0x0695('0x3a')][_0x0695('0x3b')]?_0x5a8b2f[_0x0695('0x3a')]:_0x3358c6['model'];_0x5a8b2f['order']=qs[_0x0695('0x3f')](_0x3b8b35[_0x0695('0x37')][_0x0695('0x3f')]);_0x5a8b2f[_0x0695('0x42')]=qs[_0x0695('0x40')](_[_0x0695('0x5d')](_0x3b8b35['query'],_0x3358c6[_0x0695('0x40')]));if(_0x3b8b35[_0x0695('0x37')][_0x0695('0x41')]){_0x5a8b2f[_0x0695('0x42')]=_['merge'](_0x5a8b2f[_0x0695('0x42')],{'$or':_[_0x0695('0x36')](_0x5a8b2f[_0x0695('0x3a')],function(_0x58b2bb){var _0x119437={};_0x119437[_0x58b2bb]={'$like':'%'+_0x3b8b35[_0x0695('0x37')][_0x0695('0x41')]+'%'};return _0x119437;})});}_0x5a8b2f=_['merge']({},_0x5a8b2f,_0x3b8b35[_0x0695('0x45')]);return _0x141096[_0x0695('0x8c')](_0x5a8b2f);}})[_0x0695('0x2a')](function(_0x1dead8){if(_0x1dead8){_0x4664e2=_0x1dead8[_0x0695('0x3b')];if(!_0x3b8b35[_0x0695('0x37')][_0x0695('0x3c')](_0x0695('0x3d'))){_0x5a8b2f[_0x0695('0x21')]=qs['limit'](_0x3b8b35[_0x0695('0x37')][_0x0695('0x21')]);_0x5a8b2f[_0x0695('0x1f')]=qs['offset'](_0x3b8b35[_0x0695('0x37')][_0x0695('0x1f')]);}return _0x141096['getAgents'](_0x5a8b2f);}})[_0x0695('0x2a')](function(_0x23d85e){if(_0x23d85e){return _0x23d85e?{'count':_0x4664e2,'rows':_0x23d85e}:null;}})[_0x0695('0x2a')](respondWithResult(_0x455050,null))[_0x0695('0x4a')](handleError(_0x455050,null));};
\ No newline at end of file
index 9ffe69c..75f71cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x807a=['../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x72599d,_0x295a75){var _0x2bd09f=function(_0x123f2b){while(--_0x123f2b){_0x72599d['push'](_0x72599d['shift']());}};_0x2bd09f(++_0x295a75);}(_0x807a,0x98));var _0xa807=function(_0x351f01,_0x28eead){_0x351f01=_0x351f01-0x0;var _0x16a802=_0x807a[_0x351f01];return _0x16a802;};'use strict';var EventEmitter=require(_0xa807('0x0'));var SmsQueue=require(_0xa807('0x1'))['db'][_0xa807('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa807('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa807('0x4'),'afterDestroy':_0xa807('0x5')};function emitEvent(_0x3dfd7d){return function(_0x5c7c9b,_0x6a2cef,_0x16c048){SmsQueueEvents[_0xa807('0x6')](_0x3dfd7d+':'+_0x5c7c9b['id'],_0x5c7c9b);SmsQueueEvents['emit'](_0x3dfd7d,_0x5c7c9b);_0x16c048(null);};}for(var e in events){if(events[_0xa807('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xa807('0x8')]=SmsQueueEvents;
\ No newline at end of file
+var _0x74e8=['remove','emit','hasOwnProperty','exports','save','update'];(function(_0x1a3306,_0x2bcb81){var _0x48b05c=function(_0x49ad93){while(--_0x49ad93){_0x1a3306['push'](_0x1a3306['shift']());}};_0x48b05c(++_0x2bcb81);}(_0x74e8,0x14e));var _0x874e=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0x74e8[_0x421eeb];return _0x2c7371;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x874e('0x0'),'afterUpdate':_0x874e('0x1'),'afterDestroy':_0x874e('0x2')};function emitEvent(_0x5ddabb){return function(_0x521388,_0x151c1e,_0x58beeb){SmsQueueEvents[_0x874e('0x3')](_0x5ddabb+':'+_0x521388['id'],_0x521388);SmsQueueEvents[_0x874e('0x3')](_0x5ddabb,_0x521388);_0x58beeb(null);};}for(var e in events){if(events[_0x874e('0x4')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x874e('0x5')]=SmsQueueEvents;
\ No newline at end of file
index 6f03f04..6f67168 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c29=['define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x3c708b,_0x15381a){var _0x173c5b=function(_0x3733cb){while(--_0x3733cb){_0x3c708b['push'](_0x3c708b['shift']());}};_0x173c5b(++_0x15381a);}(_0x1c29,0x148));var _0x91c2=function(_0x288084,_0x1d3684){_0x288084=_0x288084-0x0;var _0x5e4a41=_0x1c29[_0x288084];return _0x5e4a41;};'use strict';var _=require('lodash');var util=require(_0x91c2('0x0'));var logger=require(_0x91c2('0x1'))(_0x91c2('0x2'));var moment=require(_0x91c2('0x3'));var BPromise=require(_0x91c2('0x4'));var rp=require(_0x91c2('0x5'));var fs=require('fs');var path=require(_0x91c2('0x6'));var rimraf=require(_0x91c2('0x7'));var config=require(_0x91c2('0x8'));var attributes=require(_0x91c2('0x9'));module['exports']=function(_0xebeaa,_0x178d0c){return _0xebeaa[_0x91c2('0xa')](_0x91c2('0xb'),attributes,{'tableName':_0x91c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a5d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash'];(function(_0x3d0913,_0xcd5de9){var _0x720fe6=function(_0x124618){while(--_0x124618){_0x3d0913['push'](_0x3d0913['shift']());}};_0x720fe6(++_0xcd5de9);}(_0x7a5d,0x1df));var _0xd7a5=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x7a5d[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xd7a5('0x0'));var util=require(_0xd7a5('0x1'));var logger=require(_0xd7a5('0x2'))(_0xd7a5('0x3'));var moment=require(_0xd7a5('0x4'));var BPromise=require(_0xd7a5('0x5'));var rp=require(_0xd7a5('0x6'));var fs=require('fs');var path=require(_0xd7a5('0x7'));var rimraf=require(_0xd7a5('0x8'));var config=require(_0xd7a5('0x9'));var attributes=require(_0xd7a5('0xa'));module[_0xd7a5('0xb')]=function(_0x5e5102,_0x527498){return _0x5e5102[_0xd7a5('0xc')](_0xd7a5('0xd'),attributes,{'tableName':_0xd7a5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 192c3a8..3058db6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c53=['message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','include','map','model','debug','find','where','ShowSmsQueue','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x56d8c4,_0x248e41){var _0x1714c6=function(_0x2e9078){while(--_0x2e9078){_0x56d8c4['push'](_0x56d8c4['shift']());}};_0x1714c6(++_0x248e41);}(_0x6c53,0x11a));var _0x36c5=function(_0x5f3b34,_0xdc1cfa){_0x5f3b34=_0x5f3b34-0x0;var _0x190267=_0x6c53[_0x5f3b34];return _0x190267;};'use strict';var _=require('lodash');var util=require(_0x36c5('0x0'));var moment=require(_0x36c5('0x1'));var BPromise=require('bluebird');var rs=require(_0x36c5('0x2'));var fs=require('fs');var Redis=require(_0x36c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x36c5('0x4'))(_0x36c5('0x5'));var config=require(_0x36c5('0x6'));var jayson=require(_0x36c5('0x7'));var client=jayson[_0x36c5('0x8')]['http']({'port':0x232a});config[_0x36c5('0x9')]=_['defaults'](config[_0x36c5('0x9')],{'host':_0x36c5('0xa'),'port':0x18eb});var socket=require(_0x36c5('0xb'))(new Redis(config['redis']));require(_0x36c5('0xc'))[_0x36c5('0xd')](socket);function respondWithRpcPromise(_0x3cb427,_0x124939,_0x356cb3){return new BPromise(function(_0x203168,_0x3141f2){return client[_0x36c5('0xe')](_0x3cb427,_0x356cb3)[_0x36c5('0xf')](function(_0x6981ab){logger[_0x36c5('0x10')](_0x36c5('0x11'),_0x124939,_0x36c5('0x12'));logger['debug'](_0x36c5('0x13'),_0x124939,_0x36c5('0x12'),JSON[_0x36c5('0x14')](_0x6981ab));if(_0x6981ab['error']){if(_0x6981ab['error']['code']===0x1f4){logger[_0x36c5('0x15')](_0x36c5('0x11'),_0x124939,_0x6981ab[_0x36c5('0x15')][_0x36c5('0x16')]);return _0x3141f2(_0x6981ab[_0x36c5('0x15')][_0x36c5('0x16')]);}logger[_0x36c5('0x15')](_0x36c5('0x11'),_0x124939,_0x6981ab[_0x36c5('0x15')][_0x36c5('0x16')]);return _0x203168(_0x6981ab['error'][_0x36c5('0x16')]);}else{logger[_0x36c5('0x10')](_0x36c5('0x11'),_0x124939,'request\x20sent');_0x203168(_0x6981ab[_0x36c5('0x17')][_0x36c5('0x16')]);}})[_0x36c5('0x18')](function(_0x25df23){logger[_0x36c5('0x15')](_0x36c5('0x11'),_0x124939,_0x25df23);_0x3141f2(_0x25df23);});});}exports[_0x36c5('0x19')]=function(_0x4bc6db){var _0x34e1c3=this;return new Promise(function(_0x4334f8,_0x3cd70d){return db[_0x36c5('0x1a')][_0x36c5('0x1b')]({'raw':_0x4bc6db[_0x36c5('0x1c')]?_0x4bc6db['options'][_0x36c5('0x1d')]===undefined?!![]:![]:!![],'where':_0x4bc6db[_0x36c5('0x1c')]?_0x4bc6db[_0x36c5('0x1c')]['where']||null:null,'attributes':_0x4bc6db[_0x36c5('0x1c')]?_0x4bc6db[_0x36c5('0x1c')][_0x36c5('0x1e')]||null:null,'limit':_0x4bc6db[_0x36c5('0x1c')]?_0x4bc6db[_0x36c5('0x1c')]['limit']||null:null,'include':_0x4bc6db['options']?_0x4bc6db[_0x36c5('0x1c')][_0x36c5('0x1f')]?_[_0x36c5('0x20')](_0x4bc6db['options'][_0x36c5('0x1f')],function(_0x2fda38){return{'model':db[_0x2fda38['model']],'as':_0x2fda38['as'],'attributes':_0x2fda38['attributes'],'include':_0x2fda38[_0x36c5('0x1f')]?_['map'](_0x2fda38[_0x36c5('0x1f')],function(_0x583281){return{'model':db[_0x583281[_0x36c5('0x21')]],'as':_0x583281['as'],'attributes':_0x583281['attributes'],'include':_0x583281['include']?_['map'](_0x583281['include'],function(_0x155fbd){return{'model':db[_0x155fbd[_0x36c5('0x21')]],'as':_0x155fbd['as'],'attributes':_0x155fbd[_0x36c5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x36c5('0xf')](function(_0x4dc99e){logger['info'](_0x36c5('0x19'),_0x4bc6db);logger[_0x36c5('0x22')](_0x36c5('0x19'),_0x4bc6db,JSON[_0x36c5('0x14')](_0x4dc99e));_0x4334f8(_0x4dc99e);})[_0x36c5('0x18')](function(_0x3df723){logger['error'](_0x36c5('0x19'),_0x3df723[_0x36c5('0x16')],_0x4bc6db);_0x3cd70d(_0x34e1c3['error'](0x1f4,_0x3df723[_0x36c5('0x16')]));});});};exports['ShowSmsQueue']=function(_0xaa0770){var _0x40d51e=this;return new Promise(function(_0x1284e5,_0x7d48ce){return db[_0x36c5('0x1a')][_0x36c5('0x23')]({'raw':_0xaa0770[_0x36c5('0x1c')]?_0xaa0770[_0x36c5('0x1c')][_0x36c5('0x1d')]===undefined?!![]:![]:!![],'where':_0xaa0770['options']?_0xaa0770[_0x36c5('0x1c')][_0x36c5('0x24')]||null:null,'attributes':_0xaa0770[_0x36c5('0x1c')]?_0xaa0770[_0x36c5('0x1c')][_0x36c5('0x1e')]||null:null,'include':_0xaa0770['options']?_0xaa0770[_0x36c5('0x1c')][_0x36c5('0x1f')]?_[_0x36c5('0x20')](_0xaa0770[_0x36c5('0x1c')][_0x36c5('0x1f')],function(_0x4eab7d){return{'model':db[_0x4eab7d[_0x36c5('0x21')]],'as':_0x4eab7d['as'],'attributes':_0x4eab7d[_0x36c5('0x1e')],'include':_0x4eab7d[_0x36c5('0x1f')]?_[_0x36c5('0x20')](_0x4eab7d[_0x36c5('0x1f')],function(_0x46f6c4){return{'model':db[_0x46f6c4[_0x36c5('0x21')]],'as':_0x46f6c4['as'],'attributes':_0x46f6c4[_0x36c5('0x1e')],'include':_0x46f6c4[_0x36c5('0x1f')]?_['map'](_0x46f6c4[_0x36c5('0x1f')],function(_0x3a0248){return{'model':db[_0x3a0248[_0x36c5('0x21')]],'as':_0x3a0248['as'],'attributes':_0x3a0248[_0x36c5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x36c5('0xf')](function(_0x416bac){logger[_0x36c5('0x10')](_0x36c5('0x25'),_0xaa0770);logger[_0x36c5('0x22')]('ShowSmsQueue',_0xaa0770,JSON[_0x36c5('0x14')](_0x416bac));_0x1284e5(_0x416bac);})['catch'](function(_0x244e11){logger['error']('ShowSmsQueue',_0x244e11['message'],_0xaa0770);_0x7d48ce(_0x40d51e['error'](0x1f4,_0x244e11[_0x36c5('0x16')]));});});};
\ No newline at end of file
+var _0x74c3=['info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','catch','GetSmsQueue','SmsQueue','options','where','attributes','limit','include','map','model','ShowSmsQueue','find','raw','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','request','then'];(function(_0xfe07dd,_0x2bb093){var _0xe9e3e=function(_0x37a54a){while(--_0x37a54a){_0xfe07dd['push'](_0xfe07dd['shift']());}};_0xe9e3e(++_0x2bb093);}(_0x74c3,0x16c));var _0x374c=function(_0x3121dd,_0x555395){_0x3121dd=_0x3121dd-0x0;var _0x459551=_0x74c3[_0x3121dd];return _0x459551;};'use strict';var _=require(_0x374c('0x0'));var util=require(_0x374c('0x1'));var moment=require('moment');var BPromise=require(_0x374c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x374c('0x3'));var logger=require(_0x374c('0x4'))(_0x374c('0x5'));var config=require(_0x374c('0x6'));var jayson=require(_0x374c('0x7'));var client=jayson[_0x374c('0x8')][_0x374c('0x9')]({'port':0x232a});config[_0x374c('0xa')]=_['defaults'](config[_0x374c('0xa')],{'host':_0x374c('0xb'),'port':0x18eb});var socket=require(_0x374c('0xc'))(new Redis(config[_0x374c('0xa')]));require(_0x374c('0xd'))['register'](socket);function respondWithRpcPromise(_0x4e1a18,_0x41cff8,_0x5889b8){return new BPromise(function(_0x41a8c6,_0x37ced2){return client[_0x374c('0xe')](_0x4e1a18,_0x5889b8)[_0x374c('0xf')](function(_0xc54669){logger[_0x374c('0x10')]('SmsQueue,\x20%s,\x20%s',_0x41cff8,_0x374c('0x11'));logger[_0x374c('0x12')](_0x374c('0x13'),_0x41cff8,_0x374c('0x11'),JSON[_0x374c('0x14')](_0xc54669));if(_0xc54669[_0x374c('0x15')]){if(_0xc54669[_0x374c('0x15')][_0x374c('0x16')]===0x1f4){logger[_0x374c('0x15')]('SmsQueue,\x20%s,\x20%s',_0x41cff8,_0xc54669[_0x374c('0x15')][_0x374c('0x17')]);return _0x37ced2(_0xc54669[_0x374c('0x15')][_0x374c('0x17')]);}logger[_0x374c('0x15')](_0x374c('0x18'),_0x41cff8,_0xc54669[_0x374c('0x15')][_0x374c('0x17')]);return _0x41a8c6(_0xc54669[_0x374c('0x15')]['message']);}else{logger['info'](_0x374c('0x18'),_0x41cff8,_0x374c('0x11'));_0x41a8c6(_0xc54669['result'][_0x374c('0x17')]);}})[_0x374c('0x19')](function(_0x2cf832){logger[_0x374c('0x15')](_0x374c('0x18'),_0x41cff8,_0x2cf832);_0x37ced2(_0x2cf832);});});}exports[_0x374c('0x1a')]=function(_0x505195){var _0x94ba72=this;return new Promise(function(_0x13b322,_0x4e89b4){return db[_0x374c('0x1b')]['findAll']({'raw':_0x505195['options']?_0x505195['options']['raw']===undefined?!![]:![]:!![],'where':_0x505195[_0x374c('0x1c')]?_0x505195[_0x374c('0x1c')][_0x374c('0x1d')]||null:null,'attributes':_0x505195[_0x374c('0x1c')]?_0x505195[_0x374c('0x1c')][_0x374c('0x1e')]||null:null,'limit':_0x505195['options']?_0x505195[_0x374c('0x1c')][_0x374c('0x1f')]||null:null,'include':_0x505195['options']?_0x505195[_0x374c('0x1c')][_0x374c('0x20')]?_[_0x374c('0x21')](_0x505195['options'][_0x374c('0x20')],function(_0x37872f){return{'model':db[_0x37872f['model']],'as':_0x37872f['as'],'attributes':_0x37872f['attributes'],'include':_0x37872f[_0x374c('0x20')]?_[_0x374c('0x21')](_0x37872f[_0x374c('0x20')],function(_0x2389c8){return{'model':db[_0x2389c8[_0x374c('0x22')]],'as':_0x2389c8['as'],'attributes':_0x2389c8[_0x374c('0x1e')],'include':_0x2389c8[_0x374c('0x20')]?_[_0x374c('0x21')](_0x2389c8[_0x374c('0x20')],function(_0x3ceb45){return{'model':db[_0x3ceb45[_0x374c('0x22')]],'as':_0x3ceb45['as'],'attributes':_0x3ceb45[_0x374c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x374c('0xf')](function(_0x4b19e8){logger[_0x374c('0x10')](_0x374c('0x1a'),_0x505195);logger['debug'](_0x374c('0x1a'),_0x505195,JSON[_0x374c('0x14')](_0x4b19e8));_0x13b322(_0x4b19e8);})[_0x374c('0x19')](function(_0x4cd881){logger[_0x374c('0x15')]('GetSmsQueue',_0x4cd881[_0x374c('0x17')],_0x505195);_0x4e89b4(_0x94ba72[_0x374c('0x15')](0x1f4,_0x4cd881['message']));});});};exports[_0x374c('0x23')]=function(_0x87bb39){var _0x127125=this;return new Promise(function(_0x4d6f8a,_0xb3d9c){return db[_0x374c('0x1b')][_0x374c('0x24')]({'raw':_0x87bb39['options']?_0x87bb39[_0x374c('0x1c')][_0x374c('0x25')]===undefined?!![]:![]:!![],'where':_0x87bb39['options']?_0x87bb39['options'][_0x374c('0x1d')]||null:null,'attributes':_0x87bb39['options']?_0x87bb39['options'][_0x374c('0x1e')]||null:null,'include':_0x87bb39[_0x374c('0x1c')]?_0x87bb39['options']['include']?_[_0x374c('0x21')](_0x87bb39[_0x374c('0x1c')][_0x374c('0x20')],function(_0x2e54c7){return{'model':db[_0x2e54c7[_0x374c('0x22')]],'as':_0x2e54c7['as'],'attributes':_0x2e54c7[_0x374c('0x1e')],'include':_0x2e54c7[_0x374c('0x20')]?_[_0x374c('0x21')](_0x2e54c7['include'],function(_0x193bf9){return{'model':db[_0x193bf9[_0x374c('0x22')]],'as':_0x193bf9['as'],'attributes':_0x193bf9[_0x374c('0x1e')],'include':_0x193bf9[_0x374c('0x20')]?_[_0x374c('0x21')](_0x193bf9[_0x374c('0x20')],function(_0x551ce1){return{'model':db[_0x551ce1[_0x374c('0x22')]],'as':_0x551ce1['as'],'attributes':_0x551ce1['attributes']};}):[]};}):[]};}):[]:[]})[_0x374c('0xf')](function(_0xe5ef81){logger[_0x374c('0x10')](_0x374c('0x23'),_0x87bb39);logger[_0x374c('0x12')](_0x374c('0x23'),_0x87bb39,JSON[_0x374c('0x14')](_0xe5ef81));_0x4d6f8a(_0xe5ef81);})[_0x374c('0x19')](function(_0x2f564c){logger[_0x374c('0x15')](_0x374c('0x23'),_0x2f564c[_0x374c('0x17')],_0x87bb39);_0xb3d9c(_0x127125[_0x374c('0x15')](0x1f4,_0x2f564c[_0x374c('0x17')]));});});};
\ No newline at end of file
index 4254d9c..9185f6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x337e=['removeListener','smsQueue:','save','update'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x337e,0x152));var _0xe337=function(_0x2a9b9b,_0x3801e5){_0x2a9b9b=_0x2a9b9b-0x0;var _0x592dc4=_0x337e[_0x2a9b9b];return _0x592dc4;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xe337('0x0'),'remove',_0xe337('0x1')];function createListener(_0x1eeb42,_0x131539){return function(_0x59df36){_0x131539['emit'](_0x1eeb42,_0x59df36);};}function removeListener(_0x2dd060,_0x291b35){return function(){SmsQueueEvents[_0xe337('0x2')](_0x2dd060,_0x291b35);};}exports['register']=function(_0x3409a9){for(var _0x15c468=0x0,_0x150b77=events['length'];_0x15c468<_0x150b77;_0x15c468++){var _0x24b9be=events[_0x15c468];var _0x10ede6=createListener(_0xe337('0x3')+_0x24b9be,_0x3409a9);SmsQueueEvents['on'](_0x24b9be,_0x10ede6);}};
\ No newline at end of file
+var _0x1203=['emit','removeListener','register','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x4063ad,_0x30ffcc){var _0x9b893=function(_0x30a42d){while(--_0x30a42d){_0x4063ad['push'](_0x4063ad['shift']());}};_0x9b893(++_0x30ffcc);}(_0x1203,0x1dc));var _0x3120=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1203[_0x14add3];return _0x4a174f;};'use strict';var SmsQueueEvents=require(_0x3120('0x0'));var events=[_0x3120('0x1'),_0x3120('0x2'),_0x3120('0x3')];function createListener(_0x325a76,_0x188b7c){return function(_0x408351){_0x188b7c[_0x3120('0x4')](_0x325a76,_0x408351);};}function removeListener(_0x334bea,_0x3e225c){return function(){SmsQueueEvents[_0x3120('0x5')](_0x334bea,_0x3e225c);};}exports[_0x3120('0x6')]=function(_0x122040){for(var _0x497547=0x0,_0x12609d=events['length'];_0x497547<_0x12609d;_0x497547++){var _0x1c0cd3=events[_0x497547];var _0x1a1a6b=createListener(_0x3120('0x7')+_0x1c0cd3,_0x122040);SmsQueueEvents['on'](_0x1c0cd3,_0x1a1a6b);}};
\ No newline at end of file
index cb35535..1b73d7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x830f=['index','/describe','describe','/:id','post','create','put','delete','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x281022,_0x39a6fe){var _0x544fd6=function(_0x30797b){while(--_0x30797b){_0x281022['push'](_0x281022['shift']());}};_0x544fd6(++_0x39a6fe);}(_0x830f,0x1a0));var _0xf830=function(_0x3f0c1a,_0x4463ea){_0x3f0c1a=_0x3f0c1a-0x0;var _0xf260b=_0x830f[_0x3f0c1a];return _0xf260b;};'use strict';var multer=require(_0xf830('0x0'));var util=require(_0xf830('0x1'));var path=require(_0xf830('0x2'));var timeout=require(_0xf830('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf830('0x4'));var config=require(_0xf830('0x5'));var controller=require(_0xf830('0x6'));router[_0xf830('0x7')]('/',auth[_0xf830('0x8')](),controller[_0xf830('0x9')]);router[_0xf830('0x7')](_0xf830('0xa'),auth[_0xf830('0x8')](),controller[_0xf830('0xb')]);router[_0xf830('0x7')](_0xf830('0xc'),auth[_0xf830('0x8')](),controller['show']);router[_0xf830('0xd')]('/',auth['isAuthenticated'](),controller[_0xf830('0xe')]);router[_0xf830('0xf')](_0xf830('0xc'),auth[_0xf830('0x8')](),controller['update']);router[_0xf830('0x10')](_0xf830('0xc'),auth[_0xf830('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3981=['/describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x19ff61,_0x34c15a){var _0x4f77f6=function(_0x27645f){while(--_0x27645f){_0x19ff61['push'](_0x19ff61['shift']());}};_0x4f77f6(++_0x34c15a);}(_0x3981,0x144));var _0x1398=function(_0x38fbf3,_0x48e426){_0x38fbf3=_0x38fbf3-0x0;var _0x3ab964=_0x3981[_0x38fbf3];return _0x3ab964;};'use strict';var multer=require(_0x1398('0x0'));var util=require('util');var path=require(_0x1398('0x1'));var timeout=require(_0x1398('0x2'));var express=require(_0x1398('0x3'));var router=express[_0x1398('0x4')]();var fs_extra=require(_0x1398('0x5'));var auth=require(_0x1398('0x6'));var interaction=require(_0x1398('0x7'));var config=require(_0x1398('0x8'));var controller=require(_0x1398('0x9'));router[_0x1398('0xa')]('/',auth[_0x1398('0xb')](),controller['index']);router[_0x1398('0xa')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller['describe']);router[_0x1398('0xa')](_0x1398('0xd'),auth[_0x1398('0xb')](),controller[_0x1398('0xe')]);router[_0x1398('0xf')]('/',auth[_0x1398('0xb')](),controller['create']);router[_0x1398('0x10')](_0x1398('0xd'),auth[_0x1398('0xb')](),controller[_0x1398('0x11')]);router[_0x1398('0x12')](_0x1398('0xd'),auth[_0x1398('0xb')](),controller[_0x1398('0x13')]);module[_0x1398('0x14')]=router;
\ No newline at end of file
index a43be45..0476ac7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e03=['DATE','moment','exports','STRING'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x4e03,0x1e5));var _0x34e0=function(_0x1a7225,_0x5abb05){_0x1a7225=_0x1a7225-0x0;var _0xbc3e2b=_0x4e03[_0x1a7225];return _0xbc3e2b;};'use strict';var moment=require(_0x34e0('0x0'));var Sequelize=require('sequelize');module[_0x34e0('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x34e0('0x2')]},'joinAt':{'type':Sequelize[_0x34e0('0x3')]},'leaveAt':{'type':Sequelize[_0x34e0('0x3')]},'acceptAt':{'type':Sequelize[_0x34e0('0x3')]},'exitAt':{'type':Sequelize[_0x34e0('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2424=['sequelize','STRING','DATE','moment'];(function(_0x1419f6,_0x4180de){var _0x5b07c7=function(_0x5dd304){while(--_0x5dd304){_0x1419f6['push'](_0x1419f6['shift']());}};_0x5b07c7(++_0x4180de);}(_0x2424,0x1b3));var _0x4242=function(_0x9f8187,_0x1e19e9){_0x9f8187=_0x9f8187-0x0;var _0x56ae05=_0x2424[_0x9f8187];return _0x56ae05;};'use strict';var moment=require(_0x4242('0x0'));var Sequelize=require(_0x4242('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4242('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4242('0x2')]},'joinAt':{'type':Sequelize[_0x4242('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4242('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 29fca64..a12dcbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98e3=['../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','update','rimraf','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment'];(function(_0x5c9ddf,_0x202e38){var _0x392b84=function(_0x4c5822){while(--_0x4c5822){_0x5c9ddf['push'](_0x5c9ddf['shift']());}};_0x392b84(++_0x202e38);}(_0x98e3,0x144));var _0x398e=function(_0xb3bff7,_0x53f391){_0xb3bff7=_0xb3bff7-0x0;var _0x4363fe=_0x98e3[_0xb3bff7];return _0x4363fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x398e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x398e('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x398e('0x2'));var util=require('util');var path=require('path');var sox=require(_0x398e('0x3'));var csv=require(_0x398e('0x4'));var ejs=require(_0x398e('0x5'));var fs=require('fs');var fs_extra=require(_0x398e('0x6'));var _=require(_0x398e('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x398e('0x8'));var deskjs=require(_0x398e('0x9'));var toCsv=require(_0x398e('0x4'));var querystring=require(_0x398e('0xa'));var Papa=require('papaparse');var Redis=require(_0x398e('0xb'));var authService=require(_0x398e('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x398e('0xd'));var hardwareService=require(_0x398e('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x398e('0xf'));var licenseUtil=require(_0x398e('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe5d210,_0xae2ce7){_0xae2ce7=_0xae2ce7||0xcc;return function(_0x23597d){if(_0x23597d){return _0xe5d210['sendStatus'](_0xae2ce7);}return _0xe5d210[_0x398e('0x11')](_0xae2ce7)[_0x398e('0x12')]();};}function respondWithResult(_0x4e4925,_0x4f7cb4){_0x4f7cb4=_0x4f7cb4||0xc8;return function(_0x3d3b34){if(_0x3d3b34){return _0x4e4925[_0x398e('0x11')](_0x4f7cb4)[_0x398e('0x13')](_0x3d3b34);}};}function respondWithFilteredResult(_0x4dfe91,_0x1683b5){return function(_0x4b947f){if(_0x4b947f){var _0x56694b=typeof _0x1683b5[_0x398e('0x14')]===_0x398e('0x15')&&typeof _0x1683b5[_0x398e('0x16')]===_0x398e('0x15');var _0x1b1e47=_0x4b947f[_0x398e('0x17')];var _0x506353=_0x56694b?0x0:_0x1683b5[_0x398e('0x14')];var _0x36f1bc=_0x56694b?_0x4b947f['count']:_0x1683b5['offset']+_0x1683b5[_0x398e('0x16')];var _0x1e632c;if(_0x36f1bc>=_0x1b1e47){_0x36f1bc=_0x1b1e47;_0x1e632c=0xc8;}else{_0x1e632c=0xce;}_0x4dfe91[_0x398e('0x11')](_0x1e632c);return _0x4dfe91[_0x398e('0x18')](_0x398e('0x19'),_0x506353+'-'+_0x36f1bc+'/'+_0x1b1e47)['json'](_0x4b947f);}return null;};}function patchUpdates(_0x16d6ec){return function(_0x545bdd){try{jsonpatch['apply'](_0x545bdd,_0x16d6ec,!![]);}catch(_0x50de0d){return BPromise[_0x398e('0x1a')](_0x50de0d);}return _0x545bdd[_0x398e('0x1b')]();};}function saveUpdates(_0x3a2519,_0x5981c7){return function(_0x5d5bf6){if(_0x5d5bf6){return _0x5d5bf6['update'](_0x3a2519)[_0x398e('0x1c')](function(_0x15670d){return _0x15670d;});}return null;};}function removeEntity(_0x3cfa48,_0x24affd){return function(_0x15fb72){if(_0x15fb72){return _0x15fb72[_0x398e('0x1d')]()[_0x398e('0x1c')](function(){_0x3cfa48[_0x398e('0x11')](0xcc)[_0x398e('0x12')]();});}};}function handleEntityNotFound(_0x5e36a2,_0x242396){return function(_0x5b42d4){if(!_0x5b42d4){_0x5e36a2[_0x398e('0x1e')](0x194);}return _0x5b42d4;};}function handleError(_0x48cd69,_0x59f64c){_0x59f64c=_0x59f64c||0x1f4;return function(_0x1c4d09){logger[_0x398e('0x1f')](_0x1c4d09[_0x398e('0x20')]);if(_0x1c4d09[_0x398e('0x21')]){delete _0x1c4d09['name'];}_0x48cd69[_0x398e('0x11')](_0x59f64c)[_0x398e('0x22')](_0x1c4d09);};}exports[_0x398e('0x23')]=function(_0x31d095,_0x4cfdff){var _0xe37a80={},_0xd38ea0={},_0x2d48c2={'count':0x0,'rows':[]};var _0x21b468=_['map'](db[_0x398e('0x24')][_0x398e('0x25')],function(_0x224bcb){return{'name':_0x224bcb[_0x398e('0x26')],'type':_0x224bcb[_0x398e('0x27')][_0x398e('0x28')]};});_0xd38ea0[_0x398e('0x29')]=_[_0x398e('0x2a')](_0x21b468,'name');_0xd38ea0['query']=_[_0x398e('0x2b')](_0x31d095[_0x398e('0x2c')]);_0xd38ea0[_0x398e('0x2d')]=_[_0x398e('0x2e')](_0xd38ea0[_0x398e('0x29')],_0xd38ea0[_0x398e('0x2c')]);_0xe37a80[_0x398e('0x2f')]=_['intersection'](_0xd38ea0['model'],qs[_0x398e('0x30')](_0x31d095['query'][_0x398e('0x30')]));_0xe37a80[_0x398e('0x2f')]=_0xe37a80[_0x398e('0x2f')][_0x398e('0x31')]?_0xe37a80[_0x398e('0x2f')]:_0xd38ea0['model'];if(!_0x31d095[_0x398e('0x2c')]['hasOwnProperty']('nolimit')){_0xe37a80[_0x398e('0x16')]=qs['limit'](_0x31d095[_0x398e('0x2c')][_0x398e('0x16')]);_0xe37a80[_0x398e('0x14')]=qs[_0x398e('0x14')](_0x31d095[_0x398e('0x2c')]['offset']);}_0xe37a80[_0x398e('0x32')]=qs[_0x398e('0x33')](_0x31d095['query']['sort']);_0xe37a80[_0x398e('0x34')]=qs[_0x398e('0x2d')](_[_0x398e('0x35')](_0x31d095['query'],_0xd38ea0['filters']),_0x21b468);if(_0x31d095['query'][_0x398e('0x36')]){_0xe37a80[_0x398e('0x34')]=_[_0x398e('0x37')](_0xe37a80['where'],{'$or':_[_0x398e('0x2a')](_0x21b468,function(_0x40aa69){if(_0x40aa69[_0x398e('0x27')]!==_0x398e('0x38')){var _0x56c92b={};_0x56c92b[_0x40aa69[_0x398e('0x21')]]={'$like':'%'+_0x31d095[_0x398e('0x2c')]['filter']+'%'};return _0x56c92b;}})});}_0xe37a80=_[_0x398e('0x37')]({},_0xe37a80,_0x31d095[_0x398e('0x39')]);var _0x3bd7d4={'where':_0xe37a80[_0x398e('0x34')]};return db[_0x398e('0x24')][_0x398e('0x17')](_0x3bd7d4)[_0x398e('0x1c')](function(_0x3b3cb3){_0x2d48c2[_0x398e('0x17')]=_0x3b3cb3;if(_0x31d095[_0x398e('0x2c')][_0x398e('0x3a')]){_0xe37a80['include']=[{'all':!![]}];}return db[_0x398e('0x24')]['findAll'](_0xe37a80);})[_0x398e('0x1c')](function(_0x6f67){_0x2d48c2[_0x398e('0x3b')]=_0x6f67;return _0x2d48c2;})['then'](respondWithFilteredResult(_0x4cfdff,_0xe37a80))[_0x398e('0x3c')](handleError(_0x4cfdff,null));};exports[_0x398e('0x3d')]=function(_0x597a8b,_0x31401e){var _0x44f457={'raw':!![],'where':{'id':_0x597a8b[_0x398e('0x3e')]['id']}},_0x1aed9b={};_0x1aed9b[_0x398e('0x29')]=_[_0x398e('0x2b')](db[_0x398e('0x24')][_0x398e('0x25')]);_0x1aed9b['query']=_[_0x398e('0x2b')](_0x597a8b[_0x398e('0x2c')]);_0x1aed9b[_0x398e('0x2d')]=_[_0x398e('0x2e')](_0x1aed9b['model'],_0x1aed9b[_0x398e('0x2c')]);_0x44f457[_0x398e('0x2f')]=_[_0x398e('0x2e')](_0x1aed9b['model'],qs['fields'](_0x597a8b[_0x398e('0x2c')][_0x398e('0x30')]));_0x44f457['attributes']=_0x44f457[_0x398e('0x2f')][_0x398e('0x31')]?_0x44f457[_0x398e('0x2f')]:_0x1aed9b['model'];if(_0x597a8b['query'][_0x398e('0x3a')]){_0x44f457[_0x398e('0x3f')]=[{'all':!![]}];}_0x44f457=_[_0x398e('0x37')]({},_0x44f457,_0x597a8b[_0x398e('0x39')]);return db[_0x398e('0x24')][_0x398e('0x40')](_0x44f457)[_0x398e('0x1c')](handleEntityNotFound(_0x31401e,null))[_0x398e('0x1c')](respondWithResult(_0x31401e,null))[_0x398e('0x3c')](handleError(_0x31401e,null));};exports[_0x398e('0x41')]=function(_0x5c02b4,_0x1c228b){return db[_0x398e('0x24')][_0x398e('0x41')](_0x5c02b4[_0x398e('0x42')],{})['then'](respondWithResult(_0x1c228b,0xc9))[_0x398e('0x3c')](handleError(_0x1c228b,null));};exports[_0x398e('0x43')]=function(_0x76b19f,_0x54cbca){if(_0x76b19f['body']['id']){delete _0x76b19f['body']['id'];}return db[_0x398e('0x24')][_0x398e('0x40')]({'where':{'id':_0x76b19f[_0x398e('0x3e')]['id']}})[_0x398e('0x1c')](handleEntityNotFound(_0x54cbca,null))[_0x398e('0x1c')](saveUpdates(_0x76b19f[_0x398e('0x42')],null))[_0x398e('0x1c')](respondWithResult(_0x54cbca,null))[_0x398e('0x3c')](handleError(_0x54cbca,null));};exports[_0x398e('0x1d')]=function(_0x30963d,_0x4d6e83){return db[_0x398e('0x24')][_0x398e('0x40')]({'where':{'id':_0x30963d[_0x398e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4d6e83,null))['then'](removeEntity(_0x4d6e83,null))[_0x398e('0x3c')](handleError(_0x4d6e83,null));};exports['describe']=function(_0x492397,_0x8d1535){return db[_0x398e('0x24')]['describe']()[_0x398e('0x1c')](respondWithResult(_0x8d1535,null))['catch'](handleError(_0x8d1535,null));};
\ No newline at end of file
+var _0x859b=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','update','destroy','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','then','include','findAll','catch','show','keys','includeAll','find','body','params','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x859b,0x1ec));var _0xb859=function(_0x5e86c1,_0x54cd15){_0x5e86c1=_0x5e86c1-0x0;var _0x4ff86b=_0x859b[_0x5e86c1];return _0x4ff86b;};'use strict';var emlformat=require(_0xb859('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb859('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb859('0x2'));var moment=require('moment');var BPromise=require(_0xb859('0x3'));var Mustache=require(_0xb859('0x4'));var util=require(_0xb859('0x5'));var path=require(_0xb859('0x6'));var sox=require(_0xb859('0x7'));var csv=require(_0xb859('0x8'));var ejs=require(_0xb859('0x9'));var fs=require('fs');var fs_extra=require(_0xb859('0xa'));var _=require(_0xb859('0xb'));var squel=require(_0xb859('0xc'));var crypto=require(_0xb859('0xd'));var jsforce=require(_0xb859('0xe'));var deskjs=require(_0xb859('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb859('0x10'));var Papa=require('papaparse');var Redis=require(_0xb859('0x11'));var authService=require(_0xb859('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb859('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb859('0x14'));var utils=require(_0xb859('0x15'));var config=require(_0xb859('0x16'));var licenseUtil=require(_0xb859('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55f77e,_0x3916b3){_0x3916b3=_0x3916b3||0xcc;return function(_0x26ec54){if(_0x26ec54){return _0x55f77e[_0xb859('0x18')](_0x3916b3);}return _0x55f77e['status'](_0x3916b3)[_0xb859('0x19')]();};}function respondWithResult(_0x218bea,_0x33a03b){_0x33a03b=_0x33a03b||0xc8;return function(_0x3f3b5d){if(_0x3f3b5d){return _0x218bea['status'](_0x33a03b)['json'](_0x3f3b5d);}};}function respondWithFilteredResult(_0x11b85f,_0x4ae52c){return function(_0x12a2ce){if(_0x12a2ce){var _0x51b731=typeof _0x4ae52c['offset']===_0xb859('0x1a')&&typeof _0x4ae52c[_0xb859('0x1b')]==='undefined';var _0x25fce3=_0x12a2ce[_0xb859('0x1c')];var _0x53b94e=_0x51b731?0x0:_0x4ae52c['offset'];var _0x3640e7=_0x51b731?_0x12a2ce[_0xb859('0x1c')]:_0x4ae52c[_0xb859('0x1d')]+_0x4ae52c[_0xb859('0x1b')];var _0x39d7ac;if(_0x3640e7>=_0x25fce3){_0x3640e7=_0x25fce3;_0x39d7ac=0xc8;}else{_0x39d7ac=0xce;}_0x11b85f[_0xb859('0x1e')](_0x39d7ac);return _0x11b85f[_0xb859('0x1f')](_0xb859('0x20'),_0x53b94e+'-'+_0x3640e7+'/'+_0x25fce3)[_0xb859('0x21')](_0x12a2ce);}return null;};}function patchUpdates(_0x35d032){return function(_0x558508){try{jsonpatch[_0xb859('0x22')](_0x558508,_0x35d032,!![]);}catch(_0x4a8790){return BPromise[_0xb859('0x23')](_0x4a8790);}return _0x558508['save']();};}function saveUpdates(_0x5bac15,_0x580e48){return function(_0x355ea0){if(_0x355ea0){return _0x355ea0[_0xb859('0x24')](_0x5bac15)['then'](function(_0x253f76){return _0x253f76;});}return null;};}function removeEntity(_0x140a73,_0x54934e){return function(_0x27bdfe){if(_0x27bdfe){return _0x27bdfe[_0xb859('0x25')]()['then'](function(){_0x140a73[_0xb859('0x1e')](0xcc)[_0xb859('0x19')]();});}};}function handleEntityNotFound(_0x4fd942,_0x360f95){return function(_0x535625){if(!_0x535625){_0x4fd942[_0xb859('0x18')](0x194);}return _0x535625;};}function handleError(_0xa53f9c,_0x5e8a0a){_0x5e8a0a=_0x5e8a0a||0x1f4;return function(_0x125c2f){logger['error'](_0x125c2f['stack']);if(_0x125c2f[_0xb859('0x26')]){delete _0x125c2f[_0xb859('0x26')];}_0xa53f9c[_0xb859('0x1e')](_0x5e8a0a)[_0xb859('0x27')](_0x125c2f);};}exports[_0xb859('0x28')]=function(_0x93810a,_0x3f2bd8){var _0x24814d={},_0x5ccf55={},_0x4e20ab={'count':0x0,'rows':[]};var _0x3304e8=_[_0xb859('0x29')](db[_0xb859('0x2a')][_0xb859('0x2b')],function(_0x1dd9a7){return{'name':_0x1dd9a7[_0xb859('0x2c')],'type':_0x1dd9a7['type'][_0xb859('0x2d')]};});_0x5ccf55[_0xb859('0x2e')]=_[_0xb859('0x29')](_0x3304e8,_0xb859('0x26'));_0x5ccf55['query']=_['keys'](_0x93810a[_0xb859('0x2f')]);_0x5ccf55['filters']=_['intersection'](_0x5ccf55[_0xb859('0x2e')],_0x5ccf55[_0xb859('0x2f')]);_0x24814d[_0xb859('0x30')]=_[_0xb859('0x31')](_0x5ccf55[_0xb859('0x2e')],qs[_0xb859('0x32')](_0x93810a[_0xb859('0x2f')]['fields']));_0x24814d[_0xb859('0x30')]=_0x24814d[_0xb859('0x30')][_0xb859('0x33')]?_0x24814d[_0xb859('0x30')]:_0x5ccf55[_0xb859('0x2e')];if(!_0x93810a[_0xb859('0x2f')]['hasOwnProperty'](_0xb859('0x34'))){_0x24814d['limit']=qs[_0xb859('0x1b')](_0x93810a[_0xb859('0x2f')][_0xb859('0x1b')]);_0x24814d['offset']=qs['offset'](_0x93810a[_0xb859('0x2f')][_0xb859('0x1d')]);}_0x24814d['order']=qs[_0xb859('0x35')](_0x93810a['query'][_0xb859('0x35')]);_0x24814d['where']=qs[_0xb859('0x36')](_[_0xb859('0x37')](_0x93810a['query'],_0x5ccf55[_0xb859('0x36')]),_0x3304e8);if(_0x93810a[_0xb859('0x2f')][_0xb859('0x38')]){_0x24814d[_0xb859('0x39')]=_[_0xb859('0x3a')](_0x24814d['where'],{'$or':_[_0xb859('0x29')](_0x3304e8,function(_0x3c2b6f){if(_0x3c2b6f[_0xb859('0x3b')]!==_0xb859('0x3c')){var _0x23b590={};_0x23b590[_0x3c2b6f['name']]={'$like':'%'+_0x93810a[_0xb859('0x2f')]['filter']+'%'};return _0x23b590;}})});}_0x24814d=_['merge']({},_0x24814d,_0x93810a[_0xb859('0x3d')]);var _0x34be1f={'where':_0x24814d[_0xb859('0x39')]};return db[_0xb859('0x2a')][_0xb859('0x1c')](_0x34be1f)[_0xb859('0x3e')](function(_0x1d2301){_0x4e20ab['count']=_0x1d2301;if(_0x93810a[_0xb859('0x2f')]['includeAll']){_0x24814d[_0xb859('0x3f')]=[{'all':!![]}];}return db[_0xb859('0x2a')][_0xb859('0x40')](_0x24814d);})[_0xb859('0x3e')](function(_0x4f6279){_0x4e20ab['rows']=_0x4f6279;return _0x4e20ab;})[_0xb859('0x3e')](respondWithFilteredResult(_0x3f2bd8,_0x24814d))[_0xb859('0x41')](handleError(_0x3f2bd8,null));};exports[_0xb859('0x42')]=function(_0x1407ff,_0x48c67b){var _0x1112b2={'raw':!![],'where':{'id':_0x1407ff['params']['id']}},_0x96a5c={};_0x96a5c[_0xb859('0x2e')]=_[_0xb859('0x43')](db[_0xb859('0x2a')][_0xb859('0x2b')]);_0x96a5c[_0xb859('0x2f')]=_[_0xb859('0x43')](_0x1407ff[_0xb859('0x2f')]);_0x96a5c['filters']=_[_0xb859('0x31')](_0x96a5c[_0xb859('0x2e')],_0x96a5c[_0xb859('0x2f')]);_0x1112b2['attributes']=_['intersection'](_0x96a5c[_0xb859('0x2e')],qs[_0xb859('0x32')](_0x1407ff[_0xb859('0x2f')]['fields']));_0x1112b2['attributes']=_0x1112b2[_0xb859('0x30')]['length']?_0x1112b2[_0xb859('0x30')]:_0x96a5c['model'];if(_0x1407ff[_0xb859('0x2f')][_0xb859('0x44')]){_0x1112b2[_0xb859('0x3f')]=[{'all':!![]}];}_0x1112b2=_[_0xb859('0x3a')]({},_0x1112b2,_0x1407ff[_0xb859('0x3d')]);return db[_0xb859('0x2a')][_0xb859('0x45')](_0x1112b2)[_0xb859('0x3e')](handleEntityNotFound(_0x48c67b,null))[_0xb859('0x3e')](respondWithResult(_0x48c67b,null))[_0xb859('0x41')](handleError(_0x48c67b,null));};exports['create']=function(_0x5237d7,_0x5e8b9b){return db[_0xb859('0x2a')]['create'](_0x5237d7[_0xb859('0x46')],{})[_0xb859('0x3e')](respondWithResult(_0x5e8b9b,0xc9))['catch'](handleError(_0x5e8b9b,null));};exports[_0xb859('0x24')]=function(_0x9384fb,_0x1d4a04){if(_0x9384fb[_0xb859('0x46')]['id']){delete _0x9384fb[_0xb859('0x46')]['id'];}return db['SmsQueueReport'][_0xb859('0x45')]({'where':{'id':_0x9384fb['params']['id']}})[_0xb859('0x3e')](handleEntityNotFound(_0x1d4a04,null))[_0xb859('0x3e')](saveUpdates(_0x9384fb[_0xb859('0x46')],null))['then'](respondWithResult(_0x1d4a04,null))['catch'](handleError(_0x1d4a04,null));};exports['destroy']=function(_0x4d8a30,_0x955277){return db[_0xb859('0x2a')][_0xb859('0x45')]({'where':{'id':_0x4d8a30[_0xb859('0x47')]['id']}})[_0xb859('0x3e')](handleEntityNotFound(_0x955277,null))[_0xb859('0x3e')](removeEntity(_0x955277,null))[_0xb859('0x41')](handleError(_0x955277,null));};exports[_0xb859('0x48')]=function(_0x3a63b0,_0x2fb875){return db[_0xb859('0x2a')][_0xb859('0x48')]()[_0xb859('0x3e')](respondWithResult(_0x2fb875,null))[_0xb859('0x41')](handleError(_0x2fb875,null));};
\ No newline at end of file
index 1b7ee45..df3495b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x37d0bc,_0x109b96){var _0x170e60=function(_0xae2ad){while(--_0xae2ad){_0x37d0bc['push'](_0x37d0bc['shift']());}};_0x170e60(++_0x109b96);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index ab7a4df..062b5cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79aa=['SmsQueueReport','update','where','limit','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x79aa,0x1b7));var _0xa79a=function(_0xb8f65,_0x5b3d4f){_0xb8f65=_0xb8f65-0x0;var _0x537221=_0x79aa[_0xb8f65];return _0x537221;};'use strict';var _=require(_0xa79a('0x0'));var util=require(_0xa79a('0x1'));var moment=require(_0xa79a('0x2'));var BPromise=require(_0xa79a('0x3'));var rs=require(_0xa79a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa79a('0x5'))['db'];var utils=require(_0xa79a('0x6'));var logger=require(_0xa79a('0x7'))('rpc');var config=require(_0xa79a('0x8'));var jayson=require(_0xa79a('0x9'));var client=jayson['client'][_0xa79a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cd65a,_0x303831,_0x536766){return new BPromise(function(_0x2a6553,_0x4d29f6){return client['request'](_0x4cd65a,_0x536766)['then'](function(_0x1f0701){logger[_0xa79a('0xb')](_0xa79a('0xc'),_0x303831,_0xa79a('0xd'));logger['debug'](_0xa79a('0xe'),_0x303831,_0xa79a('0xd'),JSON[_0xa79a('0xf')](_0x1f0701));if(_0x1f0701['error']){if(_0x1f0701[_0xa79a('0x10')]['code']===0x1f4){logger[_0xa79a('0x10')](_0xa79a('0xc'),_0x303831,_0x1f0701[_0xa79a('0x10')]['message']);return _0x4d29f6(_0x1f0701[_0xa79a('0x10')]['message']);}logger[_0xa79a('0x10')](_0xa79a('0xc'),_0x303831,_0x1f0701['error'][_0xa79a('0x11')]);return _0x2a6553(_0x1f0701['error'][_0xa79a('0x11')]);}else{logger['info'](_0xa79a('0xc'),_0x303831,_0xa79a('0xd'));_0x2a6553(_0x1f0701[_0xa79a('0x12')]['message']);}})[_0xa79a('0x13')](function(_0xcb2835){logger[_0xa79a('0x10')](_0xa79a('0xc'),_0x303831,_0xcb2835);_0x4d29f6(_0xcb2835);});});}exports['CreateSmsQueueReport']=function(_0x3a9296){var _0x2fb628=this;return new Promise(function(_0x5350ef,_0x4e0dd0){return db['SmsQueueReport'][_0xa79a('0x14')](_0x3a9296[_0xa79a('0x15')],{'raw':_0x3a9296[_0xa79a('0x16')]?_0x3a9296[_0xa79a('0x16')][_0xa79a('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5324a3){logger[_0xa79a('0xb')](_0xa79a('0x18'),_0x3a9296);logger['debug'](_0xa79a('0x18'),_0x3a9296,JSON[_0xa79a('0xf')](_0x5324a3));_0x5350ef(_0x5324a3);})[_0xa79a('0x13')](function(_0x4d77e5){logger[_0xa79a('0x10')]('CreateSmsQueueReport',_0x4d77e5[_0xa79a('0x11')],_0x3a9296);_0x4e0dd0(_0x2fb628[_0xa79a('0x10')](0x1f4,_0x4d77e5['message']));});});};exports[_0xa79a('0x19')]=function(_0x203c95){var _0x20d173=this;return new Promise(function(_0x53a3b8,_0x10ece3){return db[_0xa79a('0x1a')][_0xa79a('0x1b')](_0x203c95[_0xa79a('0x15')],{'raw':_0x203c95['options']?_0x203c95['options'][_0xa79a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x203c95[_0xa79a('0x16')]?_0x203c95[_0xa79a('0x16')][_0xa79a('0x1c')]||null:null,'attributes':_0x203c95[_0xa79a('0x16')]?_0x203c95[_0xa79a('0x16')]['attributes']||null:null,'limit':_0x203c95[_0xa79a('0x16')]?_0x203c95[_0xa79a('0x16')][_0xa79a('0x1d')]||null:null})[_0xa79a('0x1e')](function(_0xe8d117){logger[_0xa79a('0xb')](_0xa79a('0x19'),_0x203c95);logger['debug'](_0xa79a('0x19'),_0x203c95,JSON[_0xa79a('0xf')](_0xe8d117));_0x53a3b8(_0xe8d117);})[_0xa79a('0x13')](function(_0x464fdc){logger[_0xa79a('0x10')](_0xa79a('0x19'),_0x464fdc[_0xa79a('0x11')],_0x203c95);_0x10ece3(_0x20d173[_0xa79a('0x10')](0x1f4,_0x464fdc[_0xa79a('0x11')]));});});};
\ No newline at end of file
+var _0xb3d7=['catch','CreateSmsQueueReport','SmsQueueReport','create','body','raw','then','debug','UpdateSmsQueueReport','update','options','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x58bb99,_0x180832){var _0x35f105=function(_0x54de26){while(--_0x54de26){_0x58bb99['push'](_0x58bb99['shift']());}};_0x35f105(++_0x180832);}(_0xb3d7,0x156));var _0x7b3d=function(_0x3a0d5d,_0x520011){_0x3a0d5d=_0x3a0d5d-0x0;var _0x35c50e=_0xb3d7[_0x3a0d5d];return _0x35c50e;};'use strict';var _=require('lodash');var util=require(_0x7b3d('0x0'));var moment=require(_0x7b3d('0x1'));var BPromise=require(_0x7b3d('0x2'));var rs=require(_0x7b3d('0x3'));var fs=require('fs');var Redis=require(_0x7b3d('0x4'));var db=require(_0x7b3d('0x5'))['db'];var utils=require(_0x7b3d('0x6'));var logger=require(_0x7b3d('0x7'))(_0x7b3d('0x8'));var config=require(_0x7b3d('0x9'));var jayson=require(_0x7b3d('0xa'));var client=jayson[_0x7b3d('0xb')][_0x7b3d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46345a,_0x42ff7a,_0x54c956){return new BPromise(function(_0x263455,_0x1a5071){return client['request'](_0x46345a,_0x54c956)['then'](function(_0x3a011c){logger[_0x7b3d('0xd')](_0x7b3d('0xe'),_0x42ff7a,_0x7b3d('0xf'));logger['debug'](_0x7b3d('0x10'),_0x42ff7a,_0x7b3d('0xf'),JSON[_0x7b3d('0x11')](_0x3a011c));if(_0x3a011c[_0x7b3d('0x12')]){if(_0x3a011c[_0x7b3d('0x12')][_0x7b3d('0x13')]===0x1f4){logger[_0x7b3d('0x12')](_0x7b3d('0xe'),_0x42ff7a,_0x3a011c['error'][_0x7b3d('0x14')]);return _0x1a5071(_0x3a011c[_0x7b3d('0x12')]['message']);}logger[_0x7b3d('0x12')](_0x7b3d('0xe'),_0x42ff7a,_0x3a011c[_0x7b3d('0x12')][_0x7b3d('0x14')]);return _0x263455(_0x3a011c[_0x7b3d('0x12')]['message']);}else{logger['info'](_0x7b3d('0xe'),_0x42ff7a,_0x7b3d('0xf'));_0x263455(_0x3a011c['result'][_0x7b3d('0x14')]);}})[_0x7b3d('0x15')](function(_0x1d062c){logger[_0x7b3d('0x12')](_0x7b3d('0xe'),_0x42ff7a,_0x1d062c);_0x1a5071(_0x1d062c);});});}exports[_0x7b3d('0x16')]=function(_0x41de12){var _0xab3da7=this;return new Promise(function(_0x1e5b70,_0x1a2e78){return db[_0x7b3d('0x17')][_0x7b3d('0x18')](_0x41de12[_0x7b3d('0x19')],{'raw':_0x41de12['options']?_0x41de12['options'][_0x7b3d('0x1a')]===undefined?!![]:![]:!![]})[_0x7b3d('0x1b')](function(_0x259d1a){logger[_0x7b3d('0xd')]('CreateSmsQueueReport',_0x41de12);logger[_0x7b3d('0x1c')]('CreateSmsQueueReport',_0x41de12,JSON[_0x7b3d('0x11')](_0x259d1a));_0x1e5b70(_0x259d1a);})[_0x7b3d('0x15')](function(_0x254c0f){logger[_0x7b3d('0x12')](_0x7b3d('0x16'),_0x254c0f[_0x7b3d('0x14')],_0x41de12);_0x1a2e78(_0xab3da7[_0x7b3d('0x12')](0x1f4,_0x254c0f[_0x7b3d('0x14')]));});});};exports[_0x7b3d('0x1d')]=function(_0xa7f4f7){var _0x1d5acc=this;return new Promise(function(_0x4aef96,_0x250fad){return db[_0x7b3d('0x17')][_0x7b3d('0x1e')](_0xa7f4f7['body'],{'raw':_0xa7f4f7['options']?_0xa7f4f7[_0x7b3d('0x1f')][_0x7b3d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7f4f7['options']?_0xa7f4f7['options']['where']||null:null,'attributes':_0xa7f4f7[_0x7b3d('0x1f')]?_0xa7f4f7[_0x7b3d('0x1f')]['attributes']||null:null,'limit':_0xa7f4f7['options']?_0xa7f4f7[_0x7b3d('0x1f')][_0x7b3d('0x20')]||null:null})['then'](function(_0x102039){logger[_0x7b3d('0xd')](_0x7b3d('0x1d'),_0xa7f4f7);logger[_0x7b3d('0x1c')]('UpdateSmsQueueReport',_0xa7f4f7,JSON[_0x7b3d('0x11')](_0x102039));_0x4aef96(_0x102039);})[_0x7b3d('0x15')](function(_0x500ea2){logger[_0x7b3d('0x12')]('UpdateSmsQueueReport',_0x500ea2[_0x7b3d('0x14')],_0xa7f4f7);_0x250fad(_0x1d5acc[_0x7b3d('0x12')](0x1f4,_0x500ea2['message']));});});};
\ No newline at end of file
index c540bf1..bcac005 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbacd=['get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xbacd,0x1c5));var _0xdbac=function(_0x2abf36,_0x258e51){_0x2abf36=_0x2abf36-0x0;var _0x58491b=_0xbacd[_0x2abf36];return _0x58491b;};'use strict';var multer=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var path=require('path');var timeout=require(_0xdbac('0x2'));var express=require(_0xdbac('0x3'));var router=express[_0xdbac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdbac('0x5'));var interaction=require(_0xdbac('0x6'));var config=require(_0xdbac('0x7'));var controller=require(_0xdbac('0x8'));router[_0xdbac('0x9')]('/',auth[_0xdbac('0xa')](),controller[_0xdbac('0xb')]);router[_0xdbac('0x9')](_0xdbac('0xc'),auth[_0xdbac('0xa')](),controller[_0xdbac('0xd')]);router[_0xdbac('0x9')](_0xdbac('0xe'),auth[_0xdbac('0xa')](),controller[_0xdbac('0xf')]);router['post']('/',auth[_0xdbac('0xa')](),controller[_0xdbac('0x10')]);router['put'](_0xdbac('0xe'),auth['isAuthenticated'](),controller[_0xdbac('0x11')]);router[_0xdbac('0x12')](_0xdbac('0xe'),auth[_0xdbac('0xa')](),controller[_0xdbac('0x13')]);module[_0xdbac('0x14')]=router;
\ No newline at end of file
+var _0x56e7=['put','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x2661e3,_0x5d2b12){var _0x5be7e7=function(_0x4111bd){while(--_0x4111bd){_0x2661e3['push'](_0x2661e3['shift']());}};_0x5be7e7(++_0x5d2b12);}(_0x56e7,0x7b));var _0x756e=function(_0x33ca70,_0x4c27a7){_0x33ca70=_0x33ca70-0x0;var _0x52592e=_0x56e7[_0x33ca70];return _0x52592e;};'use strict';var multer=require('multer');var util=require(_0x756e('0x0'));var path=require(_0x756e('0x1'));var timeout=require('connect-timeout');var express=require(_0x756e('0x2'));var router=express[_0x756e('0x3')]();var fs_extra=require(_0x756e('0x4'));var auth=require(_0x756e('0x5'));var interaction=require(_0x756e('0x6'));var config=require(_0x756e('0x7'));var controller=require(_0x756e('0x8'));router['get']('/',auth[_0x756e('0x9')](),controller[_0x756e('0xa')]);router[_0x756e('0xb')](_0x756e('0xc'),auth['isAuthenticated'](),controller[_0x756e('0xd')]);router['get'](_0x756e('0xe'),auth[_0x756e('0x9')](),controller[_0x756e('0xf')]);router[_0x756e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x756e('0x11')](_0x756e('0xe'),auth[_0x756e('0x9')](),controller['update']);router[_0x756e('0x12')](_0x756e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x756e('0x13')]=router;
\ No newline at end of file
index 02c22a8..ae85223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x5d3076,_0x4a92d9){var _0x1708fa=function(_0x207110){while(--_0x207110){_0x5d3076['push'](_0x5d3076['shift']());}};_0x1708fa(++_0x4a92d9);}(_0xedd9,0xfc));var _0x9edd=function(_0x6f8934,_0x48c88f){_0x6f8934=_0x6f8934-0x0;var _0x21af99=_0xedd9[_0x6f8934];return _0x21af99;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3d90ed,_0x881a81){var _0x4a77b2=function(_0x56293e){while(--_0x56293e){_0x3d90ed['push'](_0x3d90ed['shift']());}};_0x4a77b2(++_0x881a81);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcb91[_0x4b369d];return _0x571a98;};'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
index dcc40dc..8d670d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0f8=['model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','keys','filters','intersection'];(function(_0x3b6ebe,_0x313e2a){var _0x3793af=function(_0x314985){while(--_0x314985){_0x3b6ebe['push'](_0x3b6ebe['shift']());}};_0x3793af(++_0x313e2a);}(_0xf0f8,0x67));var _0x8f0f=function(_0x260522,_0x271d29){_0x260522=_0x260522-0x0;var _0x1d7011=_0xf0f8[_0x260522];return _0x1d7011;};'use strict';var emlformat=require(_0x8f0f('0x0'));var rimraf=require(_0x8f0f('0x1'));var zipdir=require(_0x8f0f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f0f('0x3'));var moment=require('moment');var BPromise=require(_0x8f0f('0x4'));var Mustache=require(_0x8f0f('0x5'));var util=require(_0x8f0f('0x6'));var path=require(_0x8f0f('0x7'));var sox=require(_0x8f0f('0x8'));var csv=require('to-csv');var ejs=require(_0x8f0f('0x9'));var fs=require('fs');var fs_extra=require(_0x8f0f('0xa'));var _=require('lodash');var squel=require(_0x8f0f('0xb'));var crypto=require(_0x8f0f('0xc'));var jsforce=require(_0x8f0f('0xd'));var deskjs=require(_0x8f0f('0xe'));var toCsv=require(_0x8f0f('0xf'));var querystring=require(_0x8f0f('0x10'));var Papa=require(_0x8f0f('0x11'));var Redis=require('ioredis');var authService=require(_0x8f0f('0x12'));var qs=require(_0x8f0f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f0f('0x14'));var logger=require(_0x8f0f('0x15'))(_0x8f0f('0x16'));var utils=require(_0x8f0f('0x17'));var config=require(_0x8f0f('0x18'));var licenseUtil=require(_0x8f0f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cead6,_0x151586){_0x151586=_0x151586||0xcc;return function(_0x54d277){if(_0x54d277){return _0x1cead6[_0x8f0f('0x1a')](_0x151586);}return _0x1cead6[_0x8f0f('0x1b')](_0x151586)[_0x8f0f('0x1c')]();};}function respondWithResult(_0x373568,_0x2ac0a2){_0x2ac0a2=_0x2ac0a2||0xc8;return function(_0x18e2e9){if(_0x18e2e9){return _0x373568[_0x8f0f('0x1b')](_0x2ac0a2)[_0x8f0f('0x1d')](_0x18e2e9);}};}function respondWithFilteredResult(_0x1ff363,_0x1e9484){return function(_0x395cfc){if(_0x395cfc){var _0x23f832=typeof _0x1e9484[_0x8f0f('0x1e')]===_0x8f0f('0x1f')&&typeof _0x1e9484['limit']===_0x8f0f('0x1f');var _0x55ea91=_0x395cfc[_0x8f0f('0x20')];var _0x14266b=_0x23f832?0x0:_0x1e9484[_0x8f0f('0x1e')];var _0x37f161=_0x23f832?_0x395cfc[_0x8f0f('0x20')]:_0x1e9484[_0x8f0f('0x1e')]+_0x1e9484[_0x8f0f('0x21')];var _0x1f0961;if(_0x37f161>=_0x55ea91){_0x37f161=_0x55ea91;_0x1f0961=0xc8;}else{_0x1f0961=0xce;}_0x1ff363['status'](_0x1f0961);return _0x1ff363[_0x8f0f('0x22')](_0x8f0f('0x23'),_0x14266b+'-'+_0x37f161+'/'+_0x55ea91)[_0x8f0f('0x1d')](_0x395cfc);}return null;};}function patchUpdates(_0x386cab){return function(_0x1372b3){try{jsonpatch[_0x8f0f('0x24')](_0x1372b3,_0x386cab,!![]);}catch(_0xb2757){return BPromise[_0x8f0f('0x25')](_0xb2757);}return _0x1372b3[_0x8f0f('0x26')]();};}function saveUpdates(_0x260e78,_0x546b84){return function(_0xe3d3db){if(_0xe3d3db){return _0xe3d3db[_0x8f0f('0x27')](_0x260e78)[_0x8f0f('0x28')](function(_0x5b725d){return _0x5b725d;});}return null;};}function removeEntity(_0x4bc3ea,_0x292a36){return function(_0x44fed4){if(_0x44fed4){return _0x44fed4[_0x8f0f('0x29')]()['then'](function(){_0x4bc3ea[_0x8f0f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c8f59,_0x3a2e9e){return function(_0x238ae3){if(!_0x238ae3){_0x4c8f59[_0x8f0f('0x1a')](0x194);}return _0x238ae3;};}function handleError(_0x5e125c,_0x30b38c){_0x30b38c=_0x30b38c||0x1f4;return function(_0x40c9fc){logger[_0x8f0f('0x2a')](_0x40c9fc[_0x8f0f('0x2b')]);if(_0x40c9fc[_0x8f0f('0x2c')]){delete _0x40c9fc['name'];}_0x5e125c[_0x8f0f('0x1b')](_0x30b38c)[_0x8f0f('0x2d')](_0x40c9fc);};}exports[_0x8f0f('0x2e')]=function(_0x3ee59b,_0x310db2){var _0x586f17={},_0x5eb5a2={},_0xc61675={'count':0x0,'rows':[]};var _0x5a4f1c=_[_0x8f0f('0x2f')](db[_0x8f0f('0x30')][_0x8f0f('0x31')],function(_0x4ed93f){return{'name':_0x4ed93f[_0x8f0f('0x32')],'type':_0x4ed93f[_0x8f0f('0x33')]['key']};});_0x5eb5a2['model']=_[_0x8f0f('0x2f')](_0x5a4f1c,_0x8f0f('0x2c'));_0x5eb5a2['query']=_[_0x8f0f('0x34')](_0x3ee59b['query']);_0x5eb5a2[_0x8f0f('0x35')]=_[_0x8f0f('0x36')](_0x5eb5a2[_0x8f0f('0x37')],_0x5eb5a2[_0x8f0f('0x38')]);_0x586f17[_0x8f0f('0x39')]=_[_0x8f0f('0x36')](_0x5eb5a2[_0x8f0f('0x37')],qs[_0x8f0f('0x3a')](_0x3ee59b[_0x8f0f('0x38')][_0x8f0f('0x3a')]));_0x586f17['attributes']=_0x586f17[_0x8f0f('0x39')][_0x8f0f('0x3b')]?_0x586f17['attributes']:_0x5eb5a2[_0x8f0f('0x37')];if(!_0x3ee59b['query'][_0x8f0f('0x3c')]('nolimit')){_0x586f17['limit']=qs['limit'](_0x3ee59b['query']['limit']);_0x586f17[_0x8f0f('0x1e')]=qs[_0x8f0f('0x1e')](_0x3ee59b[_0x8f0f('0x38')][_0x8f0f('0x1e')]);}_0x586f17[_0x8f0f('0x3d')]=qs[_0x8f0f('0x3e')](_0x3ee59b[_0x8f0f('0x38')][_0x8f0f('0x3e')]);_0x586f17[_0x8f0f('0x3f')]=qs['filters'](_[_0x8f0f('0x40')](_0x3ee59b['query'],_0x5eb5a2[_0x8f0f('0x35')]),_0x5a4f1c);if(_0x3ee59b['query'][_0x8f0f('0x41')]){_0x586f17[_0x8f0f('0x3f')]=_[_0x8f0f('0x42')](_0x586f17[_0x8f0f('0x3f')],{'$or':_['map'](_0x5a4f1c,function(_0x4e6bdb){if(_0x4e6bdb[_0x8f0f('0x33')]!==_0x8f0f('0x43')){var _0x56536f={};_0x56536f[_0x4e6bdb['name']]={'$like':'%'+_0x3ee59b['query']['filter']+'%'};return _0x56536f;}})});}_0x586f17=_[_0x8f0f('0x42')]({},_0x586f17,_0x3ee59b[_0x8f0f('0x44')]);var _0x25f08f={'where':_0x586f17[_0x8f0f('0x3f')]};return db[_0x8f0f('0x30')]['count'](_0x25f08f)['then'](function(_0x5c2a63){_0xc61675['count']=_0x5c2a63;if(_0x3ee59b[_0x8f0f('0x38')][_0x8f0f('0x45')]){_0x586f17[_0x8f0f('0x46')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x8f0f('0x47')](_0x586f17);})[_0x8f0f('0x28')](function(_0x4e618d){_0xc61675[_0x8f0f('0x48')]=_0x4e618d;return _0xc61675;})[_0x8f0f('0x28')](respondWithFilteredResult(_0x310db2,_0x586f17))[_0x8f0f('0x49')](handleError(_0x310db2,null));};exports['show']=function(_0x447946,_0x9845ee){var _0x1535a6={'raw':!![],'where':{'id':_0x447946[_0x8f0f('0x4a')]['id']}},_0x2d3bd4={};_0x2d3bd4[_0x8f0f('0x37')]=_[_0x8f0f('0x34')](db['SmsTransferReport'][_0x8f0f('0x31')]);_0x2d3bd4[_0x8f0f('0x38')]=_[_0x8f0f('0x34')](_0x447946[_0x8f0f('0x38')]);_0x2d3bd4['filters']=_[_0x8f0f('0x36')](_0x2d3bd4[_0x8f0f('0x37')],_0x2d3bd4[_0x8f0f('0x38')]);_0x1535a6[_0x8f0f('0x39')]=_[_0x8f0f('0x36')](_0x2d3bd4[_0x8f0f('0x37')],qs[_0x8f0f('0x3a')](_0x447946['query']['fields']));_0x1535a6[_0x8f0f('0x39')]=_0x1535a6[_0x8f0f('0x39')][_0x8f0f('0x3b')]?_0x1535a6[_0x8f0f('0x39')]:_0x2d3bd4[_0x8f0f('0x37')];if(_0x447946['query'][_0x8f0f('0x45')]){_0x1535a6[_0x8f0f('0x46')]=[{'all':!![]}];}_0x1535a6=_[_0x8f0f('0x42')]({},_0x1535a6,_0x447946['options']);return db[_0x8f0f('0x30')][_0x8f0f('0x4b')](_0x1535a6)[_0x8f0f('0x28')](handleEntityNotFound(_0x9845ee,null))[_0x8f0f('0x28')](respondWithResult(_0x9845ee,null))['catch'](handleError(_0x9845ee,null));};exports[_0x8f0f('0x4c')]=function(_0x14d903,_0x14897c){return db[_0x8f0f('0x30')]['create'](_0x14d903['body'],{})['then'](respondWithResult(_0x14897c,0xc9))[_0x8f0f('0x49')](handleError(_0x14897c,null));};exports['update']=function(_0x262ae3,_0x351ee9){if(_0x262ae3[_0x8f0f('0x4d')]['id']){delete _0x262ae3[_0x8f0f('0x4d')]['id'];}return db['SmsTransferReport'][_0x8f0f('0x4b')]({'where':{'id':_0x262ae3['params']['id']}})[_0x8f0f('0x28')](handleEntityNotFound(_0x351ee9,null))[_0x8f0f('0x28')](saveUpdates(_0x262ae3['body'],null))[_0x8f0f('0x28')](respondWithResult(_0x351ee9,null))[_0x8f0f('0x49')](handleError(_0x351ee9,null));};exports[_0x8f0f('0x29')]=function(_0xe40840,_0x437261){return db[_0x8f0f('0x30')]['find']({'where':{'id':_0xe40840['params']['id']}})[_0x8f0f('0x28')](handleEntityNotFound(_0x437261,null))['then'](removeEntity(_0x437261,null))[_0x8f0f('0x49')](handleError(_0x437261,null));};exports[_0x8f0f('0x4e')]=function(_0x2137f5,_0x1d7dbe){return db[_0x8f0f('0x30')][_0x8f0f('0x4e')]()[_0x8f0f('0x28')](respondWithResult(_0x1d7dbe,null))[_0x8f0f('0x49')](handleError(_0x1d7dbe,null));};
\ No newline at end of file
+var _0xedcd=['json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','SmsTransferReport','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','rows','show','params','rawAttributes','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0xda90c,_0x1b67e0){var _0xedbd19=function(_0x44bae3){while(--_0x44bae3){_0xda90c['push'](_0xda90c['shift']());}};_0xedbd19(++_0x1b67e0);}(_0xedcd,0xca));var _0xdedc=function(_0x4e7307,_0x192c06){_0x4e7307=_0x4e7307-0x0;var _0x51c2f6=_0xedcd[_0x4e7307];return _0x51c2f6;};'use strict';var emlformat=require(_0xdedc('0x0'));var rimraf=require(_0xdedc('0x1'));var zipdir=require(_0xdedc('0x2'));var jsonpatch=require(_0xdedc('0x3'));var rp=require(_0xdedc('0x4'));var moment=require(_0xdedc('0x5'));var BPromise=require(_0xdedc('0x6'));var Mustache=require(_0xdedc('0x7'));var util=require(_0xdedc('0x8'));var path=require(_0xdedc('0x9'));var sox=require(_0xdedc('0xa'));var csv=require(_0xdedc('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdedc('0xc'));var _=require(_0xdedc('0xd'));var squel=require(_0xdedc('0xe'));var crypto=require(_0xdedc('0xf'));var jsforce=require(_0xdedc('0x10'));var deskjs=require(_0xdedc('0x11'));var toCsv=require(_0xdedc('0xb'));var querystring=require(_0xdedc('0x12'));var Papa=require(_0xdedc('0x13'));var Redis=require('ioredis');var authService=require(_0xdedc('0x14'));var qs=require(_0xdedc('0x15'));var as=require(_0xdedc('0x16'));var hardwareService=require(_0xdedc('0x17'));var logger=require('../../config/logger')(_0xdedc('0x18'));var utils=require(_0xdedc('0x19'));var config=require(_0xdedc('0x1a'));var licenseUtil=require(_0xdedc('0x1b'));var db=require(_0xdedc('0x1c'))['db'];function respondWithStatusCode(_0x55be4f,_0x375deb){_0x375deb=_0x375deb||0xcc;return function(_0x4604cc){if(_0x4604cc){return _0x55be4f[_0xdedc('0x1d')](_0x375deb);}return _0x55be4f[_0xdedc('0x1e')](_0x375deb)[_0xdedc('0x1f')]();};}function respondWithResult(_0xae08aa,_0x15896d){_0x15896d=_0x15896d||0xc8;return function(_0x20fb35){if(_0x20fb35){return _0xae08aa[_0xdedc('0x1e')](_0x15896d)[_0xdedc('0x20')](_0x20fb35);}};}function respondWithFilteredResult(_0x2c0c22,_0x34aff0){return function(_0x56308a){if(_0x56308a){var _0x41f51c=typeof _0x34aff0['offset']===_0xdedc('0x21')&&typeof _0x34aff0[_0xdedc('0x22')]===_0xdedc('0x21');var _0x5e2e66=_0x56308a['count'];var _0xb15bc3=_0x41f51c?0x0:_0x34aff0[_0xdedc('0x23')];var _0x49b090=_0x41f51c?_0x56308a[_0xdedc('0x24')]:_0x34aff0[_0xdedc('0x23')]+_0x34aff0['limit'];var _0x4fd1a5;if(_0x49b090>=_0x5e2e66){_0x49b090=_0x5e2e66;_0x4fd1a5=0xc8;}else{_0x4fd1a5=0xce;}_0x2c0c22[_0xdedc('0x1e')](_0x4fd1a5);return _0x2c0c22[_0xdedc('0x25')](_0xdedc('0x26'),_0xb15bc3+'-'+_0x49b090+'/'+_0x5e2e66)['json'](_0x56308a);}return null;};}function patchUpdates(_0x2ac5c7){return function(_0x4a1484){try{jsonpatch['apply'](_0x4a1484,_0x2ac5c7,!![]);}catch(_0xab1c7e){return BPromise[_0xdedc('0x27')](_0xab1c7e);}return _0x4a1484[_0xdedc('0x28')]();};}function saveUpdates(_0x13daae,_0x226a3a){return function(_0x1024b2){if(_0x1024b2){return _0x1024b2[_0xdedc('0x29')](_0x13daae)[_0xdedc('0x2a')](function(_0x5ea926){return _0x5ea926;});}return null;};}function removeEntity(_0x48e8d2,_0x39bcec){return function(_0x4babc9){if(_0x4babc9){return _0x4babc9[_0xdedc('0x2b')]()[_0xdedc('0x2a')](function(){_0x48e8d2[_0xdedc('0x1e')](0xcc)[_0xdedc('0x1f')]();});}};}function handleEntityNotFound(_0x7f25fe,_0xc6f53){return function(_0x52fce8){if(!_0x52fce8){_0x7f25fe['sendStatus'](0x194);}return _0x52fce8;};}function handleError(_0x3122b1,_0x36efe2){_0x36efe2=_0x36efe2||0x1f4;return function(_0x51bccf){logger['error'](_0x51bccf[_0xdedc('0x2c')]);if(_0x51bccf[_0xdedc('0x2d')]){delete _0x51bccf[_0xdedc('0x2d')];}_0x3122b1[_0xdedc('0x1e')](_0x36efe2)[_0xdedc('0x2e')](_0x51bccf);};}exports[_0xdedc('0x2f')]=function(_0x4abd3e,_0x32e0b7){var _0x5d77cd={},_0x1e9061={},_0x57da93={'count':0x0,'rows':[]};var _0x17aebb=_[_0xdedc('0x30')](db[_0xdedc('0x31')]['rawAttributes'],function(_0x4d455f){return{'name':_0x4d455f[_0xdedc('0x32')],'type':_0x4d455f['type']['key']};});_0x1e9061[_0xdedc('0x33')]=_['map'](_0x17aebb,_0xdedc('0x2d'));_0x1e9061[_0xdedc('0x34')]=_[_0xdedc('0x35')](_0x4abd3e[_0xdedc('0x34')]);_0x1e9061['filters']=_[_0xdedc('0x36')](_0x1e9061[_0xdedc('0x33')],_0x1e9061[_0xdedc('0x34')]);_0x5d77cd[_0xdedc('0x37')]=_[_0xdedc('0x36')](_0x1e9061[_0xdedc('0x33')],qs[_0xdedc('0x38')](_0x4abd3e[_0xdedc('0x34')][_0xdedc('0x38')]));_0x5d77cd[_0xdedc('0x37')]=_0x5d77cd['attributes'][_0xdedc('0x39')]?_0x5d77cd[_0xdedc('0x37')]:_0x1e9061[_0xdedc('0x33')];if(!_0x4abd3e['query']['hasOwnProperty'](_0xdedc('0x3a'))){_0x5d77cd[_0xdedc('0x22')]=qs[_0xdedc('0x22')](_0x4abd3e[_0xdedc('0x34')]['limit']);_0x5d77cd[_0xdedc('0x23')]=qs[_0xdedc('0x23')](_0x4abd3e['query'][_0xdedc('0x23')]);}_0x5d77cd[_0xdedc('0x3b')]=qs[_0xdedc('0x3c')](_0x4abd3e[_0xdedc('0x34')][_0xdedc('0x3c')]);_0x5d77cd[_0xdedc('0x3d')]=qs['filters'](_['pick'](_0x4abd3e[_0xdedc('0x34')],_0x1e9061[_0xdedc('0x3e')]),_0x17aebb);if(_0x4abd3e[_0xdedc('0x34')][_0xdedc('0x3f')]){_0x5d77cd[_0xdedc('0x3d')]=_[_0xdedc('0x40')](_0x5d77cd[_0xdedc('0x3d')],{'$or':_['map'](_0x17aebb,function(_0x3f11df){if(_0x3f11df[_0xdedc('0x41')]!==_0xdedc('0x42')){var _0x1c6b93={};_0x1c6b93[_0x3f11df['name']]={'$like':'%'+_0x4abd3e['query'][_0xdedc('0x3f')]+'%'};return _0x1c6b93;}})});}_0x5d77cd=_[_0xdedc('0x40')]({},_0x5d77cd,_0x4abd3e[_0xdedc('0x43')]);var _0x59e9c3={'where':_0x5d77cd[_0xdedc('0x3d')]};return db[_0xdedc('0x31')][_0xdedc('0x24')](_0x59e9c3)[_0xdedc('0x2a')](function(_0x388196){_0x57da93['count']=_0x388196;if(_0x4abd3e[_0xdedc('0x34')]['includeAll']){_0x5d77cd['include']=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x5d77cd);})[_0xdedc('0x2a')](function(_0xf3ec6a){_0x57da93[_0xdedc('0x44')]=_0xf3ec6a;return _0x57da93;})[_0xdedc('0x2a')](respondWithFilteredResult(_0x32e0b7,_0x5d77cd))['catch'](handleError(_0x32e0b7,null));};exports[_0xdedc('0x45')]=function(_0x510f35,_0x5a8baf){var _0x1d6c04={'raw':!![],'where':{'id':_0x510f35[_0xdedc('0x46')]['id']}},_0x90390d={};_0x90390d['model']=_[_0xdedc('0x35')](db[_0xdedc('0x31')][_0xdedc('0x47')]);_0x90390d['query']=_[_0xdedc('0x35')](_0x510f35[_0xdedc('0x34')]);_0x90390d['filters']=_[_0xdedc('0x36')](_0x90390d[_0xdedc('0x33')],_0x90390d['query']);_0x1d6c04[_0xdedc('0x37')]=_[_0xdedc('0x36')](_0x90390d[_0xdedc('0x33')],qs[_0xdedc('0x38')](_0x510f35[_0xdedc('0x34')][_0xdedc('0x38')]));_0x1d6c04[_0xdedc('0x37')]=_0x1d6c04[_0xdedc('0x37')][_0xdedc('0x39')]?_0x1d6c04['attributes']:_0x90390d[_0xdedc('0x33')];if(_0x510f35[_0xdedc('0x34')][_0xdedc('0x48')]){_0x1d6c04['include']=[{'all':!![]}];}_0x1d6c04=_['merge']({},_0x1d6c04,_0x510f35[_0xdedc('0x43')]);return db[_0xdedc('0x31')][_0xdedc('0x49')](_0x1d6c04)[_0xdedc('0x2a')](handleEntityNotFound(_0x5a8baf,null))[_0xdedc('0x2a')](respondWithResult(_0x5a8baf,null))[_0xdedc('0x4a')](handleError(_0x5a8baf,null));};exports[_0xdedc('0x4b')]=function(_0x451dc7,_0x326ca3){return db[_0xdedc('0x31')][_0xdedc('0x4b')](_0x451dc7[_0xdedc('0x4c')],{})[_0xdedc('0x2a')](respondWithResult(_0x326ca3,0xc9))[_0xdedc('0x4a')](handleError(_0x326ca3,null));};exports['update']=function(_0x3681d0,_0x579ec5){if(_0x3681d0[_0xdedc('0x4c')]['id']){delete _0x3681d0[_0xdedc('0x4c')]['id'];}return db['SmsTransferReport'][_0xdedc('0x49')]({'where':{'id':_0x3681d0[_0xdedc('0x46')]['id']}})['then'](handleEntityNotFound(_0x579ec5,null))[_0xdedc('0x2a')](saveUpdates(_0x3681d0[_0xdedc('0x4c')],null))[_0xdedc('0x2a')](respondWithResult(_0x579ec5,null))['catch'](handleError(_0x579ec5,null));};exports[_0xdedc('0x2b')]=function(_0xe11cde,_0x510254){return db[_0xdedc('0x31')][_0xdedc('0x49')]({'where':{'id':_0xe11cde['params']['id']}})[_0xdedc('0x2a')](handleEntityNotFound(_0x510254,null))[_0xdedc('0x2a')](removeEntity(_0x510254,null))[_0xdedc('0x4a')](handleError(_0x510254,null));};exports[_0xdedc('0x4d')]=function(_0x4cef2a,_0x4bda3b){return db[_0xdedc('0x31')][_0xdedc('0x4d')]()[_0xdedc('0x2a')](respondWithResult(_0x4bda3b,null))[_0xdedc('0x4a')](handleError(_0x4bda3b,null));};
\ No newline at end of file
index bd2af44..73e2c9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x093d=['bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4a1c30,_0x5f7499){var _0x2797c0=function(_0x2f0161){while(--_0x2f0161){_0x4a1c30['push'](_0x4a1c30['shift']());}};_0x2797c0(++_0x5f7499);}(_0x093d,0x1c9));var _0xd093=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0x093d[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0xd093('0x0'));var util=require(_0xd093('0x1'));var logger=require(_0xd093('0x2'))(_0xd093('0x3'));var moment=require(_0xd093('0x4'));var BPromise=require(_0xd093('0x5'));var rp=require(_0xd093('0x6'));var fs=require('fs');var path=require(_0xd093('0x7'));var rimraf=require(_0xd093('0x8'));var config=require(_0xd093('0x9'));var attributes=require(_0xd093('0xa'));module['exports']=function(_0x5851ee,_0x4e565d){return _0x5851ee['define'](_0xd093('0xb'),attributes,{'tableName':_0xd093('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd093('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbaf=['rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbaf,0xcb));var _0xffba=function(_0x89918d,_0x7fe2d2){_0x89918d=_0x89918d-0x0;var _0x11dac8=_0xfbaf[_0x89918d];return _0x11dac8;};'use strict';var _=require(_0xffba('0x0'));var util=require(_0xffba('0x1'));var logger=require('../../config/logger')(_0xffba('0x2'));var moment=require(_0xffba('0x3'));var BPromise=require('bluebird');var rp=require(_0xffba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffba('0x5'));var config=require(_0xffba('0x6'));var attributes=require(_0xffba('0x7'));module[_0xffba('0x8')]=function(_0x11d8fc,_0x3f2801){return _0x11d8fc[_0xffba('0x9')](_0xffba('0xa'),attributes,{'tableName':_0xffba('0xb'),'paranoid':![],'indexes':[{'name':_0xffba('0xc'),'fields':[_0xffba('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index e048e2f..0bc63fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc15b=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','then','info'];(function(_0x5a0aa7,_0x1a0282){var _0x10c507=function(_0x30d5e5){while(--_0x30d5e5){_0x5a0aa7['push'](_0x5a0aa7['shift']());}};_0x10c507(++_0x1a0282);}(_0xc15b,0xe4));var _0xbc15=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xc15b[_0x2fee96];return _0x2e6ad1;};'use strict';var _=require(_0xbc15('0x0'));var util=require('util');var moment=require(_0xbc15('0x1'));var BPromise=require(_0xbc15('0x2'));var rs=require(_0xbc15('0x3'));var fs=require('fs');var Redis=require(_0xbc15('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc15('0x5'))(_0xbc15('0x6'));var config=require(_0xbc15('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1231f0,_0x22576c,_0x3cb4b5){return new BPromise(function(_0x50a276,_0x5c6269){return client['request'](_0x1231f0,_0x3cb4b5)[_0xbc15('0x8')](function(_0x571348){logger[_0xbc15('0x9')](_0xbc15('0xa'),_0x22576c,_0xbc15('0xb'));logger['debug'](_0xbc15('0xc'),_0x22576c,_0xbc15('0xb'),JSON['stringify'](_0x571348));if(_0x571348[_0xbc15('0xd')]){if(_0x571348[_0xbc15('0xd')][_0xbc15('0xe')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x22576c,_0x571348['error'][_0xbc15('0xf')]);return _0x5c6269(_0x571348[_0xbc15('0xd')][_0xbc15('0xf')]);}logger[_0xbc15('0xd')](_0xbc15('0xa'),_0x22576c,_0x571348[_0xbc15('0xd')][_0xbc15('0xf')]);return _0x50a276(_0x571348[_0xbc15('0xd')][_0xbc15('0xf')]);}else{logger[_0xbc15('0x9')](_0xbc15('0xa'),_0x22576c,_0xbc15('0xb'));_0x50a276(_0x571348[_0xbc15('0x10')][_0xbc15('0xf')]);}})['catch'](function(_0x41a3e9){logger['error'](_0xbc15('0xa'),_0x22576c,_0x41a3e9);_0x5c6269(_0x41a3e9);});});}
\ No newline at end of file
+var _0x202c=['message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0x202c,0x178));var _0xc202=function(_0x8567ae,_0x118fcf){_0x8567ae=_0x8567ae-0x0;var _0x2f9e9b=_0x202c[_0x8567ae];return _0x2f9e9b;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});}
\ No newline at end of file
index e10b8ce..216d990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca36=['replace','%s-%s%s','extname','now','post','single','file','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','index','/:id','show','get','/:id/download','isAuthenticated','download','diskStorage','join','root','originalname'];(function(_0x3a0366,_0x5f39c0){var _0x2350df=function(_0x580882){while(--_0x580882){_0x3a0366['push'](_0x3a0366['shift']());}};_0x2350df(++_0x5f39c0);}(_0xca36,0xd6));var _0x6ca3=function(_0x529ee7,_0x3ed9ca){_0x529ee7=_0x529ee7-0x0;var _0x6f65ee=_0xca36[_0x529ee7];return _0x6f65ee;};'use strict';var multer=require('multer');var util=require(_0x6ca3('0x0'));var path=require(_0x6ca3('0x1'));var timeout=require(_0x6ca3('0x2'));var express=require(_0x6ca3('0x3'));var router=express[_0x6ca3('0x4')]();var fs_extra=require(_0x6ca3('0x5'));var auth=require(_0x6ca3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6ca3('0x7')]);router['get'](_0x6ca3('0x8'),auth['isAuthenticated'](),controller[_0x6ca3('0x9')]);router[_0x6ca3('0xa')](_0x6ca3('0xb'),auth[_0x6ca3('0xc')](),controller[_0x6ca3('0xd')]);var upload=multer({'storage':multer[_0x6ca3('0xe')]({'destination':function(_0x57d4cd,_0x5048b7,_0x2e304f){_0x2e304f(null,path[_0x6ca3('0xf')](config[_0x6ca3('0x10')],'server/files/sounds/original/'));},'filename':function(_0x2896cb,_0x433f8a,_0x2cca03){_0x433f8a[_0x6ca3('0x11')]=_0x433f8a[_0x6ca3('0x11')][_0x6ca3('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2cca03(null,util['format'](_0x6ca3('0x13'),path['basename'](_0x433f8a['originalname'],path[_0x6ca3('0x14')](_0x433f8a[_0x6ca3('0x11')])),Date[_0x6ca3('0x15')](),path[_0x6ca3('0x14')](_0x433f8a['originalname'])));}})});router[_0x6ca3('0x16')]('/',upload[_0x6ca3('0x17')](_0x6ca3('0x18')),controller[_0x6ca3('0x19')]);router['put'](_0x6ca3('0x8'),auth['isAuthenticated'](),controller[_0x6ca3('0x1a')]);router[_0x6ca3('0x1b')]('/:id',auth[_0x6ca3('0xc')](),controller[_0x6ca3('0x1b')]);module[_0x6ca3('0x1c')]=router;
\ No newline at end of file
+var _0x0dad=['index','get','/:id','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','single','file','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0x0dad,0xb6));var _0xd0da=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x0dad[_0x2aea9e];return _0x430b92;};'use strict';var multer=require(_0xd0da('0x0'));var util=require('util');var path=require(_0xd0da('0x1'));var timeout=require(_0xd0da('0x2'));var express=require(_0xd0da('0x3'));var router=express['Router']();var fs_extra=require(_0xd0da('0x4'));var auth=require(_0xd0da('0x5'));var interaction=require(_0xd0da('0x6'));var config=require(_0xd0da('0x7'));var controller=require(_0xd0da('0x8'));router['get']('/',auth[_0xd0da('0x9')](),controller[_0xd0da('0xa')]);router[_0xd0da('0xb')](_0xd0da('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd0da('0xb')](_0xd0da('0xd'),auth[_0xd0da('0x9')](),controller[_0xd0da('0xe')]);var upload=multer({'storage':multer[_0xd0da('0xf')]({'destination':function(_0x176ecc,_0x8aaf02,_0x34713a){_0x34713a(null,path['join'](config[_0xd0da('0x10')],_0xd0da('0x11')));},'filename':function(_0x5c5ef3,_0x39ac29,_0x185857){_0x39ac29[_0xd0da('0x12')]=_0x39ac29['originalname'][_0xd0da('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x185857(null,util[_0xd0da('0x14')](_0xd0da('0x15'),path['basename'](_0x39ac29[_0xd0da('0x12')],path[_0xd0da('0x16')](_0x39ac29['originalname'])),Date[_0xd0da('0x17')](),path['extname'](_0x39ac29[_0xd0da('0x12')])));}})});router[_0xd0da('0x18')]('/',upload[_0xd0da('0x19')](_0xd0da('0x1a')),controller[_0xd0da('0x1b')]);router[_0xd0da('0x1c')](_0xd0da('0xc'),auth[_0xd0da('0x9')](),controller[_0xd0da('0x1d')]);router[_0xd0da('0x1e')](_0xd0da('0xc'),auth[_0xd0da('0x9')](),controller[_0xd0da('0x1e')]);module[_0xd0da('0x1f')]=router;
\ No newline at end of file
index fc649b3..17c349f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb2c=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x5782c4,_0x1dc5f0){var _0x598375=function(_0x4df1dd){while(--_0x4df1dd){_0x5782c4['push'](_0x5782c4['shift']());}};_0x598375(++_0x1dc5f0);}(_0xcb2c,0x1ad));var _0xccb2=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xcb2c[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0xccb2('0x0'));module[_0xccb2('0x1')]={'name':{'type':Sequelize[_0xccb2('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xccb2('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xccb2('0x2')]},'original_format':{'type':Sequelize[_0xccb2('0x2')]},'original_duration':{'type':Sequelize[_0xccb2('0x3')]},'original_sampleCount':{'type':Sequelize[_0xccb2('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xccb2('0x4')]},'original_sampleRate':{'type':Sequelize[_0xccb2('0x5')]},'converted_format':{'type':Sequelize[_0xccb2('0x2')]},'converted_duration':{'type':Sequelize[_0xccb2('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xccb2('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xccb2('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xccb2('0x5')]}};
\ No newline at end of file
+var _0xe471=['sequelize','exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0xe471,0x19e));var _0x1e47=function(_0x195154,_0x2b397b){_0x195154=_0x195154-0x0;var _0x163ed7=_0xe471[_0x195154];return _0x163ed7;};'use strict';var Sequelize=require(_0x1e47('0x0'));module[_0x1e47('0x1')]={'name':{'type':Sequelize[_0x1e47('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x1e47('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x1e47('0x2')]},'original_duration':{'type':Sequelize[_0x1e47('0x3')]},'original_sampleCount':{'type':Sequelize[_0x1e47('0x4')]},'original_channelCount':{'type':Sequelize[_0x1e47('0x5')]},'original_bitRate':{'type':Sequelize[_0x1e47('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x1e47('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x1e47('0x4')]},'converted_channelCount':{'type':Sequelize[_0x1e47('0x5')]},'converted_bitRate':{'type':Sequelize[_0x1e47('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1e47('0x5')]}};
\ No newline at end of file
index b3d0fcc..c92e118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80fa=['where','merge','filter','options','include','findAll','rows','length','includeAll','catch','download','params','join','root','server/files/sounds/converted','save_name','converted_format','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','filename','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','0777','body','role','userProfileId','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','server/files/sounds/original','original_format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x1d1a1f,_0x4941d0){var _0x46eb35=function(_0x1e4a60){while(--_0x1e4a60){_0x1d1a1f['push'](_0x1d1a1f['shift']());}};_0x46eb35(++_0x4941d0);}(_0x80fa,0x1ae));var _0xa80f=function(_0x575df1,_0x16c7e0){_0x575df1=_0x575df1-0x0;var _0xa9c3db=_0x80fa[_0x575df1];return _0xa9c3db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa80f('0x0'));var jsonpatch=require(_0xa80f('0x1'));var rp=require(_0xa80f('0x2'));var moment=require('moment');var BPromise=require(_0xa80f('0x3'));var Mustache=require(_0xa80f('0x4'));var util=require(_0xa80f('0x5'));var path=require(_0xa80f('0x6'));var sox=require('sox');var csv=require(_0xa80f('0x7'));var ejs=require(_0xa80f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa80f('0x9'));var jsforce=require(_0xa80f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa80f('0x7'));var querystring=require('querystring');var Papa=require(_0xa80f('0xb'));var Redis=require(_0xa80f('0xc'));var authService=require(_0xa80f('0xd'));var qs=require(_0xa80f('0xe'));var as=require(_0xa80f('0xf'));var hardwareService=require(_0xa80f('0x10'));var logger=require(_0xa80f('0x11'))(_0xa80f('0x12'));var utils=require(_0xa80f('0x13'));var config=require(_0xa80f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa80f('0x15'))['db'];function respondWithStatusCode(_0x362974,_0x52d0c4){_0x52d0c4=_0x52d0c4||0xcc;return function(_0x275e78){if(_0x275e78){return _0x362974[_0xa80f('0x16')](_0x52d0c4);}return _0x362974['status'](_0x52d0c4)[_0xa80f('0x17')]();};}function respondWithResult(_0x536632,_0x2cdbce){_0x2cdbce=_0x2cdbce||0xc8;return function(_0x1fe2cc){if(_0x1fe2cc){return _0x536632[_0xa80f('0x18')](_0x2cdbce)['json'](_0x1fe2cc);}};}function respondWithFilteredResult(_0x1394e1,_0x5e8eb9){return function(_0x387b1){if(_0x387b1){var _0x4e0af0=typeof _0x5e8eb9[_0xa80f('0x19')]===_0xa80f('0x1a')&&typeof _0x5e8eb9['limit']==='undefined';var _0x3d94bd=_0x387b1[_0xa80f('0x1b')];var _0x39817a=_0x4e0af0?0x0:_0x5e8eb9[_0xa80f('0x19')];var _0x263ffa=_0x4e0af0?_0x387b1[_0xa80f('0x1b')]:_0x5e8eb9[_0xa80f('0x19')]+_0x5e8eb9[_0xa80f('0x1c')];var _0x542427;if(_0x263ffa>=_0x3d94bd){_0x263ffa=_0x3d94bd;_0x542427=0xc8;}else{_0x542427=0xce;}_0x1394e1[_0xa80f('0x18')](_0x542427);return _0x1394e1[_0xa80f('0x1d')](_0xa80f('0x1e'),_0x39817a+'-'+_0x263ffa+'/'+_0x3d94bd)[_0xa80f('0x1f')](_0x387b1);}return null;};}function patchUpdates(_0x5e0125){return function(_0x29b890){try{jsonpatch[_0xa80f('0x20')](_0x29b890,_0x5e0125,!![]);}catch(_0x9932ab){return BPromise[_0xa80f('0x21')](_0x9932ab);}return _0x29b890['save']();};}function saveUpdates(_0x1c988f,_0x4a9779){return function(_0x18c49d){if(_0x18c49d){return _0x18c49d[_0xa80f('0x22')](_0x1c988f)[_0xa80f('0x23')](function(_0x3804c9){return _0x3804c9;});}return null;};}function removeEntity(_0x213b5e,_0x2fef53){return function(_0x527053){if(_0x527053){return _0x527053[_0xa80f('0x24')]()['then'](function(){var _0x2c2acf=_0x527053[_0xa80f('0x25')]({'plain':!![]});var _0x518c06=_0xa80f('0x26');return db[_0xa80f('0x27')][_0xa80f('0x24')]({'where':{'type':_0x518c06,'resourceId':_0x2c2acf['id']}})['then'](function(){return _0x527053;});})['then'](function(){_0x213b5e['status'](0xcc)[_0xa80f('0x17')]();});}};}function handleEntityNotFound(_0x4698d6,_0x4014c9){return function(_0x1989fa){if(!_0x1989fa){_0x4698d6[_0xa80f('0x16')](0x194);}return _0x1989fa;};}function handleError(_0x3204c8,_0x40d7e8){_0x40d7e8=_0x40d7e8||0x1f4;return function(_0xf7871b){logger['error'](_0xf7871b[_0xa80f('0x28')]);if(_0xf7871b[_0xa80f('0x29')]){delete _0xf7871b['name'];}_0x3204c8[_0xa80f('0x18')](_0x40d7e8)[_0xa80f('0x2a')](_0xf7871b);};}exports[_0xa80f('0x2b')]=function(_0x2ad92e,_0x1a81c7){var _0x480909={},_0x1beab0={},_0x2be6e0={'count':0x0,'rows':[]};var _0x5b75ee=_[_0xa80f('0x2c')](db[_0xa80f('0x2d')][_0xa80f('0x2e')],function(_0xb3e39){return{'name':_0xb3e39[_0xa80f('0x2f')],'type':_0xb3e39[_0xa80f('0x30')][_0xa80f('0x31')]};});_0x1beab0[_0xa80f('0x32')]=_[_0xa80f('0x2c')](_0x5b75ee,_0xa80f('0x29'));_0x1beab0['query']=_[_0xa80f('0x33')](_0x2ad92e['query']);_0x1beab0[_0xa80f('0x34')]=_[_0xa80f('0x35')](_0x1beab0['model'],_0x1beab0[_0xa80f('0x36')]);_0x480909[_0xa80f('0x37')]=_[_0xa80f('0x35')](_0x1beab0[_0xa80f('0x32')],qs[_0xa80f('0x38')](_0x2ad92e['query'][_0xa80f('0x38')]));_0x480909[_0xa80f('0x37')]=_0x480909[_0xa80f('0x37')]['length']?_0x480909[_0xa80f('0x37')]:_0x1beab0[_0xa80f('0x32')];if(!_0x2ad92e[_0xa80f('0x36')][_0xa80f('0x39')](_0xa80f('0x3a'))){_0x480909[_0xa80f('0x1c')]=qs['limit'](_0x2ad92e[_0xa80f('0x36')][_0xa80f('0x1c')]);_0x480909[_0xa80f('0x19')]=qs[_0xa80f('0x19')](_0x2ad92e[_0xa80f('0x36')][_0xa80f('0x19')]);}_0x480909[_0xa80f('0x3b')]=qs[_0xa80f('0x3c')](_0x2ad92e[_0xa80f('0x36')][_0xa80f('0x3c')]);_0x480909['where']=qs[_0xa80f('0x34')](_[_0xa80f('0x3d')](_0x2ad92e['query'],_0x1beab0[_0xa80f('0x34')]),_0x5b75ee);if(_0x2ad92e['query']['filter']){_0x480909[_0xa80f('0x3e')]=_[_0xa80f('0x3f')](_0x480909[_0xa80f('0x3e')],{'$or':_[_0xa80f('0x2c')](_0x5b75ee,function(_0x584af9){if(_0x584af9[_0xa80f('0x30')]!=='VIRTUAL'){var _0x415945={};_0x415945[_0x584af9[_0xa80f('0x29')]]={'$like':'%'+_0x2ad92e[_0xa80f('0x36')][_0xa80f('0x40')]+'%'};return _0x415945;}})});}_0x480909=_['merge']({},_0x480909,_0x2ad92e[_0xa80f('0x41')]);var _0x1fa58a={'where':_0x480909[_0xa80f('0x3e')]};return db[_0xa80f('0x2d')][_0xa80f('0x1b')](_0x1fa58a)['then'](function(_0x20f872){_0x2be6e0[_0xa80f('0x1b')]=_0x20f872;if(_0x2ad92e['query']['includeAll']){_0x480909[_0xa80f('0x42')]=[{'all':!![]}];}return db[_0xa80f('0x2d')][_0xa80f('0x43')](_0x480909);})[_0xa80f('0x23')](function(_0x5b74c5){_0x2be6e0[_0xa80f('0x44')]=_0x5b74c5;return _0x2be6e0;})[_0xa80f('0x23')](respondWithFilteredResult(_0x1a81c7,_0x480909))['catch'](handleError(_0x1a81c7,null));};exports['show']=function(_0x132d83,_0x14c048){var _0x57f25a={'raw':!![],'where':{'id':_0x132d83['params']['id']}},_0x1d9b0f={};_0x1d9b0f[_0xa80f('0x32')]=_[_0xa80f('0x33')](db[_0xa80f('0x2d')]['rawAttributes']);_0x1d9b0f[_0xa80f('0x36')]=_[_0xa80f('0x33')](_0x132d83[_0xa80f('0x36')]);_0x1d9b0f[_0xa80f('0x34')]=_[_0xa80f('0x35')](_0x1d9b0f[_0xa80f('0x32')],_0x1d9b0f['query']);_0x57f25a[_0xa80f('0x37')]=_[_0xa80f('0x35')](_0x1d9b0f[_0xa80f('0x32')],qs[_0xa80f('0x38')](_0x132d83[_0xa80f('0x36')]['fields']));_0x57f25a[_0xa80f('0x37')]=_0x57f25a[_0xa80f('0x37')][_0xa80f('0x45')]?_0x57f25a[_0xa80f('0x37')]:_0x1d9b0f[_0xa80f('0x32')];if(_0x132d83[_0xa80f('0x36')][_0xa80f('0x46')]){_0x57f25a[_0xa80f('0x42')]=[{'all':!![]}];}_0x57f25a=_[_0xa80f('0x3f')]({},_0x57f25a,_0x132d83[_0xa80f('0x41')]);return db[_0xa80f('0x2d')]['find'](_0x57f25a)[_0xa80f('0x23')](handleEntityNotFound(_0x14c048,null))[_0xa80f('0x23')](respondWithResult(_0x14c048,null))[_0xa80f('0x47')](handleError(_0x14c048,null));};exports[_0xa80f('0x48')]=function(_0x1e06b0,_0x19e03b,_0x449837){return db[_0xa80f('0x2d')]['find']({'where':{'id':_0x1e06b0[_0xa80f('0x49')]['id']},'attributes':[_0xa80f('0x29'),'save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x19e03b,null))['then'](function(_0x111da5){if(_0x111da5){if(!fs['existsSync'](path[_0xa80f('0x4a')](config[_0xa80f('0x4b')],_0xa80f('0x4c'),_0x111da5[_0xa80f('0x4d')]+'.'+_0x111da5[_0xa80f('0x4e')]))){throw new db['Sequelize'][(_0xa80f('0x4f'))](_0xa80f('0x50'));}return _0x19e03b[_0xa80f('0x48')](path[_0xa80f('0x4a')](config[_0xa80f('0x4b')],_0xa80f('0x4c'),util[_0xa80f('0x51')](_0xa80f('0x52'),_0x111da5[_0xa80f('0x4d')],_0x111da5['converted_format'])),util['format'](_0xa80f('0x52'),_0x111da5['name'],_0x111da5['converted_format']));}return null;})[_0xa80f('0x47')](handleError(_0x19e03b,null));};exports[_0xa80f('0x53')]=function(_0x189a4e,_0x17de1a,_0x1b25f4){var _0x4b8d35={'name':path[_0xa80f('0x54')](_0x189a4e['file'][_0xa80f('0x55')],path[_0xa80f('0x56')](_0x189a4e[_0xa80f('0x57')][_0xa80f('0x55')])),'save_name':path['basename'](_0x189a4e[_0xa80f('0x57')]['filename'],path['extname'](_0x189a4e[_0xa80f('0x57')][_0xa80f('0x58')])),'original_format':path['extname'](_0x189a4e[_0xa80f('0x57')]['originalname'])['substring'](0x1),'converted_format':_0xa80f('0x59')};var _0x430065=path[_0xa80f('0x4a')](config['root'],'server/files/sounds/original',_0x189a4e[_0xa80f('0x57')][_0xa80f('0x58')]);var _0x520564=path[_0xa80f('0x4a')](config['root'],'server/files/sounds/converted',util['format'](_0xa80f('0x52'),path[_0xa80f('0x54')](_0x189a4e[_0xa80f('0x57')][_0xa80f('0x58')],path['extname'](_0x189a4e['file'][_0xa80f('0x58')])),_0x4b8d35[_0xa80f('0x4e')]));logger[_0xa80f('0x5a')](_0xa80f('0x5b'),_0x430065);logger['info'](_0xa80f('0x5c'),_0x520564);try{fs['chmodSync'](_0x430065,parseInt('0777',0x8));var _0x165c99=sox[_0xa80f('0x5d')](_0x430065,_0x520564,{'sampleRate':0x1f40,'format':_0xa80f('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x165c99['on']('error',function(_0x201925){fs[_0xa80f('0x5e')](_0x430065);_0x17de1a['status'](0x1f4)[_0xa80f('0x2a')](_0x201925);});_0x165c99['on'](_0xa80f('0x5f'),function(_0x8b9d32){_0x4b8d35[_0xa80f('0x60')]=isNaN(_0x8b9d32[_0xa80f('0x61')])?null:_0x8b9d32[_0xa80f('0x61')]*0x3e8;_0x4b8d35['original_sampleCount']=isNaN(_0x8b9d32[_0xa80f('0x62')])?null:_0x8b9d32['sampleCount'];_0x4b8d35[_0xa80f('0x63')]=isNaN(_0x8b9d32['channelCount'])?null:_0x8b9d32[_0xa80f('0x64')];_0x4b8d35['original_bitRate']=isNaN(_0x8b9d32[_0xa80f('0x65')])?null:_0x8b9d32[_0xa80f('0x65')];_0x4b8d35[_0xa80f('0x66')]=isNaN(_0x8b9d32['sampleRate'])?null:_0x8b9d32[_0xa80f('0x67')];});_0x165c99['on'](_0xa80f('0x68'),function(_0x333be1){_0x4b8d35[_0xa80f('0x69')]=isNaN(_0x333be1[_0xa80f('0x61')])?null:_0x333be1[_0xa80f('0x61')]*0x3e8;_0x4b8d35[_0xa80f('0x6a')]=isNaN(_0x333be1[_0xa80f('0x62')])?null:_0x333be1[_0xa80f('0x62')];_0x4b8d35['converted_channelCount']=isNaN(_0x333be1[_0xa80f('0x64')])?null:_0x333be1[_0xa80f('0x64')];_0x4b8d35[_0xa80f('0x6b')]=isNaN(_0x333be1[_0xa80f('0x65')])?null:_0x333be1['bitRate'];_0x4b8d35[_0xa80f('0x6c')]=isNaN(_0x333be1['sampleRate'])?null:_0x333be1[_0xa80f('0x67')];});_0x165c99['on'](_0xa80f('0x17'),function(){fs[_0xa80f('0x6d')](_0x520564,parseInt(_0xa80f('0x6e'),0x8));return db[_0xa80f('0x2d')][_0xa80f('0x53')](_0x4b8d35)['then'](function(_0x3b3875){var _0x5b95cb={'role':_0x189a4e[_0xa80f('0x6f')][_0xa80f('0x70')],'userProfileId':_0x189a4e['body'][_0xa80f('0x71')]};if(!_0x5b95cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b95cb['role']==='user'){var _0x1cbca0=_0x3b3875[_0xa80f('0x25')]({'plain':!![]});return db[_0xa80f('0x72')][_0xa80f('0x73')]({'where':{'name':'Sounds','userProfileId':_0x5b95cb[_0xa80f('0x71')]},'raw':!![]})['then'](function(_0x1c3a46){if(_0x1c3a46&&_0x1c3a46[_0xa80f('0x74')]===0x0){return db['UserProfileResource'][_0xa80f('0x53')]({'name':_0x1cbca0[_0xa80f('0x29')],'resourceId':_0x1cbca0['id'],'type':_0x1c3a46[_0xa80f('0x29')],'sectionId':_0x1c3a46['id']},{})[_0xa80f('0x23')](function(){return _0x3b3875;});}else{return _0x3b3875;}})['catch'](function(_0x25a460){logger[_0xa80f('0x75')](_0xa80f('0x76'),_0x25a460);throw _0x25a460;});}return _0x3b3875;})[_0xa80f('0x23')](respondWithResult(_0x17de1a,null))[_0xa80f('0x47')](handleError(_0x17de1a,null));});_0x165c99[_0xa80f('0x77')]();}catch(_0x31b306){_0x17de1a[_0xa80f('0x18')](0x1f4)[_0xa80f('0x2a')](_0x31b306);}};exports[_0xa80f('0x22')]=function(_0x39df72,_0x5ec449,_0x2d79b){return db[_0xa80f('0x2d')][_0xa80f('0x73')]({'where':{'id':_0x39df72[_0xa80f('0x49')]['id']}})[_0xa80f('0x23')](handleEntityNotFound(_0x5ec449,null))[_0xa80f('0x23')](saveUpdates(_['pick'](_0x39df72[_0xa80f('0x6f')],[_0xa80f('0x29'),_0xa80f('0x78')]),null))['then'](respondWithResult(_0x5ec449,null))[_0xa80f('0x47')](handleError(_0x5ec449,null));};exports['delete']=function(_0x990bf8,_0x56f8a5,_0x46b90d){return db['Sound'][_0xa80f('0x73')]({'where':{'id':_0x990bf8[_0xa80f('0x49')]['id']}})[_0xa80f('0x23')](function(_0x4fdb61){if(_0x4fdb61){return _0x4fdb61['destroy']();}})[_0xa80f('0x23')](function(_0x4a2162){var _0x33d272=path[_0xa80f('0x4a')](config[_0xa80f('0x4b')],_0xa80f('0x79'),util['format'](_0xa80f('0x52'),_0x4a2162[_0xa80f('0x4d')],_0x4a2162[_0xa80f('0x7a')]));var _0x39fe58=path[_0xa80f('0x4a')](config[_0xa80f('0x4b')],_0xa80f('0x4c'),util['format']('%s.%s',_0x4a2162[_0xa80f('0x4d')],_0x4a2162[_0xa80f('0x4e')]));fs['unlinkSync'](_0x33d272);fs[_0xa80f('0x5e')](_0x39fe58);return _0x4a2162;})[_0xa80f('0x23')](function(_0x45f8e4){if(_0x45f8e4){return _0x56f8a5[_0xa80f('0x18')](0xcc)[_0xa80f('0x17')]();}})[_0xa80f('0x23')](handleEntityNotFound(_0x56f8a5,null))[_0xa80f('0x47')](handleError(_0x56f8a5,null));};
\ No newline at end of file
+var _0x0c07=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','send','map','Sound','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','download','find','params','converted_format','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','%s.%s','save_name','original_format','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2c0ddc,_0x28ee13){var _0x56c6b1=function(_0x32159b){while(--_0x32159b){_0x2c0ddc['push'](_0x2c0ddc['shift']());}};_0x56c6b1(++_0x28ee13);}(_0x0c07,0x1d7));var _0x70c0=function(_0x22a3f0,_0x513d0e){_0x22a3f0=_0x22a3f0-0x0;var _0x2d8a9c=_0x0c07[_0x22a3f0];return _0x2d8a9c;};'use strict';var emlformat=require(_0x70c0('0x0'));var rimraf=require(_0x70c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x70c0('0x2'));var moment=require(_0x70c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x70c0('0x4'));var util=require(_0x70c0('0x5'));var path=require(_0x70c0('0x6'));var sox=require(_0x70c0('0x7'));var csv=require(_0x70c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70c0('0x9'));var _=require(_0x70c0('0xa'));var squel=require(_0x70c0('0xb'));var crypto=require('crypto');var jsforce=require(_0x70c0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x70c0('0x8'));var querystring=require(_0x70c0('0xd'));var Papa=require('papaparse');var Redis=require(_0x70c0('0xe'));var authService=require(_0x70c0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x70c0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70c0('0x11'))(_0x70c0('0x12'));var utils=require(_0x70c0('0x13'));var config=require(_0x70c0('0x14'));var licenseUtil=require(_0x70c0('0x15'));var db=require(_0x70c0('0x16'))['db'];function respondWithStatusCode(_0x9aa957,_0x20ed63){_0x20ed63=_0x20ed63||0xcc;return function(_0x3cae65){if(_0x3cae65){return _0x9aa957[_0x70c0('0x17')](_0x20ed63);}return _0x9aa957[_0x70c0('0x18')](_0x20ed63)['end']();};}function respondWithResult(_0x14f3fc,_0x3b61d7){_0x3b61d7=_0x3b61d7||0xc8;return function(_0x1d8a12){if(_0x1d8a12){return _0x14f3fc['status'](_0x3b61d7)[_0x70c0('0x19')](_0x1d8a12);}};}function respondWithFilteredResult(_0x440b9e,_0x2eb1a5){return function(_0x2c6283){if(_0x2c6283){var _0x352d2a=typeof _0x2eb1a5[_0x70c0('0x1a')]===_0x70c0('0x1b')&&typeof _0x2eb1a5[_0x70c0('0x1c')]==='undefined';var _0x4a65d6=_0x2c6283[_0x70c0('0x1d')];var _0x49ed9b=_0x352d2a?0x0:_0x2eb1a5[_0x70c0('0x1a')];var _0x212ce9=_0x352d2a?_0x2c6283[_0x70c0('0x1d')]:_0x2eb1a5[_0x70c0('0x1a')]+_0x2eb1a5[_0x70c0('0x1c')];var _0x333c2d;if(_0x212ce9>=_0x4a65d6){_0x212ce9=_0x4a65d6;_0x333c2d=0xc8;}else{_0x333c2d=0xce;}_0x440b9e[_0x70c0('0x18')](_0x333c2d);return _0x440b9e[_0x70c0('0x1e')](_0x70c0('0x1f'),_0x49ed9b+'-'+_0x212ce9+'/'+_0x4a65d6)[_0x70c0('0x19')](_0x2c6283);}return null;};}function patchUpdates(_0x48f010){return function(_0x2aa5e8){try{jsonpatch['apply'](_0x2aa5e8,_0x48f010,!![]);}catch(_0x380e47){return BPromise[_0x70c0('0x20')](_0x380e47);}return _0x2aa5e8[_0x70c0('0x21')]();};}function saveUpdates(_0x5a0fb1,_0x392f81){return function(_0xc7c68a){if(_0xc7c68a){return _0xc7c68a[_0x70c0('0x22')](_0x5a0fb1)[_0x70c0('0x23')](function(_0x15ce3f){return _0x15ce3f;});}return null;};}function removeEntity(_0x1ba495,_0x2cd9db){return function(_0x3f01bb){if(_0x3f01bb){return _0x3f01bb[_0x70c0('0x24')]()[_0x70c0('0x23')](function(){var _0x4f7477=_0x3f01bb[_0x70c0('0x25')]({'plain':!![]});var _0x1e92e5=_0x70c0('0x26');return db[_0x70c0('0x27')][_0x70c0('0x24')]({'where':{'type':_0x1e92e5,'resourceId':_0x4f7477['id']}})[_0x70c0('0x23')](function(){return _0x3f01bb;});})[_0x70c0('0x23')](function(){_0x1ba495['status'](0xcc)[_0x70c0('0x28')]();});}};}function handleEntityNotFound(_0x1f14e1,_0x4b47d5){return function(_0x519666){if(!_0x519666){_0x1f14e1[_0x70c0('0x17')](0x194);}return _0x519666;};}function handleError(_0xc284a4,_0x22192a){_0x22192a=_0x22192a||0x1f4;return function(_0x2eb96d){logger[_0x70c0('0x29')](_0x2eb96d[_0x70c0('0x2a')]);if(_0x2eb96d[_0x70c0('0x2b')]){delete _0x2eb96d[_0x70c0('0x2b')];}_0xc284a4[_0x70c0('0x18')](_0x22192a)[_0x70c0('0x2c')](_0x2eb96d);};}exports['index']=function(_0x3485dc,_0xc005d6){var _0xa9f819={},_0x293b62={},_0x570bf1={'count':0x0,'rows':[]};var _0x4001a7=_[_0x70c0('0x2d')](db[_0x70c0('0x2e')]['rawAttributes'],function(_0x2d523d){return{'name':_0x2d523d[_0x70c0('0x2f')],'type':_0x2d523d['type'][_0x70c0('0x30')]};});_0x293b62['model']=_[_0x70c0('0x2d')](_0x4001a7,_0x70c0('0x2b'));_0x293b62[_0x70c0('0x31')]=_['keys'](_0x3485dc[_0x70c0('0x31')]);_0x293b62[_0x70c0('0x32')]=_[_0x70c0('0x33')](_0x293b62['model'],_0x293b62[_0x70c0('0x31')]);_0xa9f819['attributes']=_['intersection'](_0x293b62[_0x70c0('0x34')],qs[_0x70c0('0x35')](_0x3485dc['query']['fields']));_0xa9f819[_0x70c0('0x36')]=_0xa9f819[_0x70c0('0x36')][_0x70c0('0x37')]?_0xa9f819['attributes']:_0x293b62[_0x70c0('0x34')];if(!_0x3485dc['query']['hasOwnProperty'](_0x70c0('0x38'))){_0xa9f819[_0x70c0('0x1c')]=qs[_0x70c0('0x1c')](_0x3485dc[_0x70c0('0x31')][_0x70c0('0x1c')]);_0xa9f819[_0x70c0('0x1a')]=qs[_0x70c0('0x1a')](_0x3485dc[_0x70c0('0x31')][_0x70c0('0x1a')]);}_0xa9f819[_0x70c0('0x39')]=qs[_0x70c0('0x3a')](_0x3485dc[_0x70c0('0x31')][_0x70c0('0x3a')]);_0xa9f819['where']=qs[_0x70c0('0x32')](_[_0x70c0('0x3b')](_0x3485dc[_0x70c0('0x31')],_0x293b62['filters']),_0x4001a7);if(_0x3485dc['query'][_0x70c0('0x3c')]){_0xa9f819[_0x70c0('0x3d')]=_[_0x70c0('0x3e')](_0xa9f819[_0x70c0('0x3d')],{'$or':_[_0x70c0('0x2d')](_0x4001a7,function(_0x55ba6b){if(_0x55ba6b[_0x70c0('0x3f')]!=='VIRTUAL'){var _0x560f32={};_0x560f32[_0x55ba6b['name']]={'$like':'%'+_0x3485dc[_0x70c0('0x31')]['filter']+'%'};return _0x560f32;}})});}_0xa9f819=_[_0x70c0('0x3e')]({},_0xa9f819,_0x3485dc[_0x70c0('0x40')]);var _0xa27827={'where':_0xa9f819['where']};return db[_0x70c0('0x2e')][_0x70c0('0x1d')](_0xa27827)['then'](function(_0x4d63e7){_0x570bf1[_0x70c0('0x1d')]=_0x4d63e7;if(_0x3485dc['query'][_0x70c0('0x41')]){_0xa9f819[_0x70c0('0x42')]=[{'all':!![]}];}return db[_0x70c0('0x2e')][_0x70c0('0x43')](_0xa9f819);})[_0x70c0('0x23')](function(_0x456962){_0x570bf1[_0x70c0('0x44')]=_0x456962;return _0x570bf1;})[_0x70c0('0x23')](respondWithFilteredResult(_0xc005d6,_0xa9f819))[_0x70c0('0x45')](handleError(_0xc005d6,null));};exports[_0x70c0('0x46')]=function(_0x2995c9,_0x978d20){var _0x500a64={'raw':!![],'where':{'id':_0x2995c9['params']['id']}},_0xf9895f={};_0xf9895f[_0x70c0('0x34')]=_[_0x70c0('0x47')](db[_0x70c0('0x2e')][_0x70c0('0x48')]);_0xf9895f[_0x70c0('0x31')]=_[_0x70c0('0x47')](_0x2995c9[_0x70c0('0x31')]);_0xf9895f[_0x70c0('0x32')]=_[_0x70c0('0x33')](_0xf9895f['model'],_0xf9895f[_0x70c0('0x31')]);_0x500a64[_0x70c0('0x36')]=_['intersection'](_0xf9895f[_0x70c0('0x34')],qs['fields'](_0x2995c9[_0x70c0('0x31')][_0x70c0('0x35')]));_0x500a64[_0x70c0('0x36')]=_0x500a64['attributes'][_0x70c0('0x37')]?_0x500a64[_0x70c0('0x36')]:_0xf9895f[_0x70c0('0x34')];if(_0x2995c9['query'][_0x70c0('0x41')]){_0x500a64['include']=[{'all':!![]}];}_0x500a64=_[_0x70c0('0x3e')]({},_0x500a64,_0x2995c9[_0x70c0('0x40')]);return db[_0x70c0('0x2e')]['find'](_0x500a64)[_0x70c0('0x23')](handleEntityNotFound(_0x978d20,null))[_0x70c0('0x23')](respondWithResult(_0x978d20,null))[_0x70c0('0x45')](handleError(_0x978d20,null));};exports[_0x70c0('0x49')]=function(_0x1e2616,_0x17ed7c,_0x5968c1){return db[_0x70c0('0x2e')][_0x70c0('0x4a')]({'where':{'id':_0x1e2616[_0x70c0('0x4b')]['id']},'attributes':['name','save_name',_0x70c0('0x4c')],'raw':!![]})[_0x70c0('0x23')](handleEntityNotFound(_0x17ed7c,null))[_0x70c0('0x23')](function(_0x2f77a1){if(_0x2f77a1){if(!fs['existsSync'](path[_0x70c0('0x4d')](config[_0x70c0('0x4e')],'server/files/sounds/converted',_0x2f77a1['save_name']+'.'+_0x2f77a1[_0x70c0('0x4c')]))){throw new db[(_0x70c0('0x4f'))][(_0x70c0('0x50'))](_0x70c0('0x51'));}return _0x17ed7c[_0x70c0('0x49')](path[_0x70c0('0x4d')](config[_0x70c0('0x4e')],_0x70c0('0x52'),util[_0x70c0('0x53')]('%s.%s',_0x2f77a1['save_name'],_0x2f77a1['converted_format'])),util[_0x70c0('0x53')]('%s.%s',_0x2f77a1[_0x70c0('0x2b')],_0x2f77a1['converted_format']));}return null;})['catch'](handleError(_0x17ed7c,null));};exports[_0x70c0('0x54')]=function(_0x3f06fc,_0x152842,_0x45db9c){var _0x5631f5={'name':path[_0x70c0('0x55')](_0x3f06fc[_0x70c0('0x56')][_0x70c0('0x57')],path[_0x70c0('0x58')](_0x3f06fc['file']['originalname'])),'save_name':path[_0x70c0('0x55')](_0x3f06fc['file']['filename'],path[_0x70c0('0x58')](_0x3f06fc[_0x70c0('0x56')][_0x70c0('0x59')])),'original_format':path[_0x70c0('0x58')](_0x3f06fc['file'][_0x70c0('0x57')])[_0x70c0('0x5a')](0x1),'converted_format':'wav'};var _0x49d51c=path[_0x70c0('0x4d')](config['root'],_0x70c0('0x5b'),_0x3f06fc['file'][_0x70c0('0x59')]);var _0x3455ad=path[_0x70c0('0x4d')](config[_0x70c0('0x4e')],_0x70c0('0x52'),util[_0x70c0('0x53')]('%s.%s',path[_0x70c0('0x55')](_0x3f06fc[_0x70c0('0x56')][_0x70c0('0x59')],path[_0x70c0('0x58')](_0x3f06fc[_0x70c0('0x56')]['filename'])),_0x5631f5[_0x70c0('0x4c')]));logger[_0x70c0('0x5c')](_0x70c0('0x5d'),_0x49d51c);logger['info'](_0x70c0('0x5e'),_0x3455ad);try{fs['chmodSync'](_0x49d51c,parseInt(_0x70c0('0x5f'),0x8));var _0x4905db=sox[_0x70c0('0x60')](_0x49d51c,_0x3455ad,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4905db['on']('error',function(_0x3a1853){fs[_0x70c0('0x61')](_0x49d51c);_0x152842['status'](0x1f4)[_0x70c0('0x2c')](_0x3a1853);});_0x4905db['on']('src',function(_0x1dfdae){_0x5631f5[_0x70c0('0x62')]=isNaN(_0x1dfdae[_0x70c0('0x63')])?null:_0x1dfdae['duration']*0x3e8;_0x5631f5['original_sampleCount']=isNaN(_0x1dfdae['sampleCount'])?null:_0x1dfdae[_0x70c0('0x64')];_0x5631f5[_0x70c0('0x65')]=isNaN(_0x1dfdae[_0x70c0('0x66')])?null:_0x1dfdae[_0x70c0('0x66')];_0x5631f5[_0x70c0('0x67')]=isNaN(_0x1dfdae[_0x70c0('0x68')])?null:_0x1dfdae[_0x70c0('0x68')];_0x5631f5[_0x70c0('0x69')]=isNaN(_0x1dfdae[_0x70c0('0x6a')])?null:_0x1dfdae[_0x70c0('0x6a')];});_0x4905db['on'](_0x70c0('0x6b'),function(_0x4e6c9c){_0x5631f5[_0x70c0('0x6c')]=isNaN(_0x4e6c9c[_0x70c0('0x63')])?null:_0x4e6c9c[_0x70c0('0x63')]*0x3e8;_0x5631f5[_0x70c0('0x6d')]=isNaN(_0x4e6c9c[_0x70c0('0x64')])?null:_0x4e6c9c[_0x70c0('0x64')];_0x5631f5['converted_channelCount']=isNaN(_0x4e6c9c[_0x70c0('0x66')])?null:_0x4e6c9c[_0x70c0('0x66')];_0x5631f5[_0x70c0('0x6e')]=isNaN(_0x4e6c9c[_0x70c0('0x68')])?null:_0x4e6c9c[_0x70c0('0x68')];_0x5631f5[_0x70c0('0x6f')]=isNaN(_0x4e6c9c[_0x70c0('0x6a')])?null:_0x4e6c9c[_0x70c0('0x6a')];});_0x4905db['on'](_0x70c0('0x28'),function(){fs[_0x70c0('0x70')](_0x3455ad,parseInt(_0x70c0('0x5f'),0x8));return db[_0x70c0('0x2e')]['create'](_0x5631f5)['then'](function(_0x10ed30){var _0x3212e3={'role':_0x3f06fc[_0x70c0('0x71')][_0x70c0('0x72')],'userProfileId':_0x3f06fc[_0x70c0('0x71')][_0x70c0('0x73')]};if(!_0x3212e3)throw new Error(_0x70c0('0x74'));if(_0x3212e3[_0x70c0('0x72')]===_0x70c0('0x75')){var _0x5431b3=_0x10ed30[_0x70c0('0x25')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x70c0('0x26'),'userProfileId':_0x3212e3[_0x70c0('0x73')]},'raw':!![]})['then'](function(_0x5b6a15){if(_0x5b6a15&&_0x5b6a15['autoAssociation']===0x0){return db[_0x70c0('0x27')][_0x70c0('0x54')]({'name':_0x5431b3[_0x70c0('0x2b')],'resourceId':_0x5431b3['id'],'type':_0x5b6a15[_0x70c0('0x2b')],'sectionId':_0x5b6a15['id']},{})['then'](function(){return _0x10ed30;});}else{return _0x10ed30;}})['catch'](function(_0x11b312){logger[_0x70c0('0x29')](_0x70c0('0x76'),_0x11b312);throw _0x11b312;});}return _0x10ed30;})[_0x70c0('0x23')](respondWithResult(_0x152842,null))[_0x70c0('0x45')](handleError(_0x152842,null));});_0x4905db['start']();}catch(_0x93fdc6){_0x152842[_0x70c0('0x18')](0x1f4)[_0x70c0('0x2c')](_0x93fdc6);}};exports['update']=function(_0x17e093,_0x38c15,_0x3115da){return db[_0x70c0('0x2e')][_0x70c0('0x4a')]({'where':{'id':_0x17e093[_0x70c0('0x4b')]['id']}})[_0x70c0('0x23')](handleEntityNotFound(_0x38c15,null))['then'](saveUpdates(_['pick'](_0x17e093['body'],[_0x70c0('0x2b'),_0x70c0('0x77')]),null))[_0x70c0('0x23')](respondWithResult(_0x38c15,null))[_0x70c0('0x45')](handleError(_0x38c15,null));};exports[_0x70c0('0x78')]=function(_0x105adb,_0x26a785,_0xe83c1b){return db[_0x70c0('0x2e')][_0x70c0('0x4a')]({'where':{'id':_0x105adb[_0x70c0('0x4b')]['id']}})['then'](function(_0x2e6e57){if(_0x2e6e57){return _0x2e6e57[_0x70c0('0x24')]();}})[_0x70c0('0x23')](function(_0x14f0af){var _0x17d0d2=path[_0x70c0('0x4d')](config['root'],_0x70c0('0x5b'),util['format'](_0x70c0('0x79'),_0x14f0af[_0x70c0('0x7a')],_0x14f0af[_0x70c0('0x7b')]));var _0x13de70=path[_0x70c0('0x4d')](config[_0x70c0('0x4e')],_0x70c0('0x52'),util[_0x70c0('0x53')]('%s.%s',_0x14f0af[_0x70c0('0x7a')],_0x14f0af[_0x70c0('0x4c')]));fs['unlinkSync'](_0x17d0d2);fs[_0x70c0('0x61')](_0x13de70);return _0x14f0af;})['then'](function(_0x103f3e){if(_0x103f3e){return _0x26a785[_0x70c0('0x18')](0xcc)[_0x70c0('0x28')]();}})[_0x70c0('0x23')](handleEntityNotFound(_0x26a785,null))['catch'](handleError(_0x26a785,null));};
\ No newline at end of file
index 19fa225..3d93b30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb120=['define','Sound','tools_sounds','lodash','api','moment','request-promise','path','./sound.attributes','exports'];(function(_0x59986f,_0x165c1c){var _0x14757c=function(_0x4f8c43){while(--_0x4f8c43){_0x59986f['push'](_0x59986f['shift']());}};_0x14757c(++_0x165c1c);}(_0xb120,0x1d9));var _0x0b12=function(_0x2e6b80,_0x31debe){_0x2e6b80=_0x2e6b80-0x0;var _0x1729be=_0xb120[_0x2e6b80];return _0x1729be;};'use strict';var _=require(_0x0b12('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0b12('0x1'));var moment=require(_0x0b12('0x2'));var BPromise=require('bluebird');var rp=require(_0x0b12('0x3'));var fs=require('fs');var path=require(_0x0b12('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0b12('0x5'));module[_0x0b12('0x6')]=function(_0x4e2e74,_0x512dc6){return _0x4e2e74[_0x0b12('0x7')](_0x0b12('0x8'),attributes,{'tableName':_0x0b12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b38=['rimraf','../../config/environment','./sound.attributes','define','Sound','util','../../config/logger','api','moment','bluebird'];(function(_0x1b8019,_0x4d9c53){var _0x538a6a=function(_0x1b151d){while(--_0x1b151d){_0x1b8019['push'](_0x1b8019['shift']());}};_0x538a6a(++_0x4d9c53);}(_0x0b38,0x16d));var _0x80b3=function(_0x337000,_0x5140b0){_0x337000=_0x337000-0x0;var _0x44cc5f=_0x0b38[_0x337000];return _0x44cc5f;};'use strict';var _=require('lodash');var util=require(_0x80b3('0x0'));var logger=require(_0x80b3('0x1'))(_0x80b3('0x2'));var moment=require(_0x80b3('0x3'));var BPromise=require(_0x80b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x80b3('0x5'));var config=require(_0x80b3('0x6'));var attributes=require(_0x80b3('0x7'));module['exports']=function(_0x188f20,_0x376fae){return _0x188f20[_0x80b3('0x8')](_0x80b3('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index edef2b5..ba72cd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a33=['error','message','result','catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x79f37,_0x3adaee){var _0x1023e0=function(_0x4783be){while(--_0x4783be){_0x79f37['push'](_0x79f37['shift']());}};_0x1023e0(++_0x3adaee);}(_0x0a33,0xc7));var _0x30a3=function(_0x2570e2,_0x34d5f2){_0x2570e2=_0x2570e2-0x0;var _0x12dcfd=_0x0a33[_0x2570e2];return _0x12dcfd;};'use strict';var _=require(_0x30a3('0x0'));var util=require(_0x30a3('0x1'));var moment=require(_0x30a3('0x2'));var BPromise=require(_0x30a3('0x3'));var rs=require(_0x30a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x30a3('0x5'));var logger=require(_0x30a3('0x6'))(_0x30a3('0x7'));var config=require(_0x30a3('0x8'));var jayson=require(_0x30a3('0x9'));var client=jayson['client'][_0x30a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10b322,_0x57ce25,_0x1682bd){return new BPromise(function(_0x180986,_0x4bcccd){return client[_0x30a3('0xb')](_0x10b322,_0x1682bd)[_0x30a3('0xc')](function(_0x347c4c){logger[_0x30a3('0xd')](_0x30a3('0xe'),_0x57ce25,'request\x20sent');logger[_0x30a3('0xf')](_0x30a3('0x10'),_0x57ce25,_0x30a3('0x11'),JSON['stringify'](_0x347c4c));if(_0x347c4c[_0x30a3('0x12')]){if(_0x347c4c[_0x30a3('0x12')]['code']===0x1f4){logger[_0x30a3('0x12')](_0x30a3('0xe'),_0x57ce25,_0x347c4c[_0x30a3('0x12')][_0x30a3('0x13')]);return _0x4bcccd(_0x347c4c[_0x30a3('0x12')]['message']);}logger[_0x30a3('0x12')](_0x30a3('0xe'),_0x57ce25,_0x347c4c[_0x30a3('0x12')][_0x30a3('0x13')]);return _0x180986(_0x347c4c[_0x30a3('0x12')]['message']);}else{logger[_0x30a3('0xd')](_0x30a3('0xe'),_0x57ce25,_0x30a3('0x11'));_0x180986(_0x347c4c[_0x30a3('0x14')]['message']);}})[_0x30a3('0x15')](function(_0x78f098){logger[_0x30a3('0x12')](_0x30a3('0xe'),_0x57ce25,_0x78f098);_0x4bcccd(_0x78f098);});});}exports[_0x30a3('0x16')]=function(_0xa9cd54){var _0x3b0714=this;return new Promise(function(_0x27279f,_0x781b01){return db[_0x30a3('0x17')][_0x30a3('0x18')]({'raw':_0xa9cd54[_0x30a3('0x19')]?_0xa9cd54['options'][_0x30a3('0x1a')]===undefined?!![]:![]:!![],'where':_0xa9cd54[_0x30a3('0x19')]?_0xa9cd54['options']['where']||null:null,'attributes':_0xa9cd54[_0x30a3('0x19')]?_0xa9cd54[_0x30a3('0x19')][_0x30a3('0x1b')]||null:null,'include':_0xa9cd54[_0x30a3('0x19')]?_0xa9cd54[_0x30a3('0x19')][_0x30a3('0x1c')]?_[_0x30a3('0x1d')](_0xa9cd54['options'][_0x30a3('0x1c')],function(_0x55689c){return{'model':db[_0x55689c[_0x30a3('0x1e')]],'as':_0x55689c['as'],'attributes':_0x55689c[_0x30a3('0x1b')],'include':_0x55689c[_0x30a3('0x1c')]?_[_0x30a3('0x1d')](_0x55689c[_0x30a3('0x1c')],function(_0x2a57e5){return{'model':db[_0x2a57e5[_0x30a3('0x1e')]],'as':_0x2a57e5['as'],'attributes':_0x2a57e5[_0x30a3('0x1b')],'include':_0x2a57e5[_0x30a3('0x1c')]?_[_0x30a3('0x1d')](_0x2a57e5['include'],function(_0x2f755a){return{'model':db[_0x2f755a[_0x30a3('0x1e')]],'as':_0x2f755a['as'],'attributes':_0x2f755a[_0x30a3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x30a3('0xc')](function(_0x5d0966){logger['info']('ShowSound',_0xa9cd54);logger[_0x30a3('0xf')](_0x30a3('0x16'),_0xa9cd54,JSON['stringify'](_0x5d0966));_0x27279f(_0x5d0966);})[_0x30a3('0x15')](function(_0x32f4be){logger['error']('ShowSound',_0x32f4be[_0x30a3('0x13')],_0xa9cd54);_0x781b01(_0x3b0714[_0x30a3('0x12')](0x1f4,_0x32f4be['message']));});});};
\ No newline at end of file
+var _0x0aa9=['http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','options','raw','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0xe50213,_0x33d3a7){var _0x580080=function(_0x23587a){while(--_0x23587a){_0xe50213['push'](_0xe50213['shift']());}};_0x580080(++_0x33d3a7);}(_0x0aa9,0x154));var _0x90aa=function(_0x370023,_0x1d4cd){_0x370023=_0x370023-0x0;var _0xf3d3fa=_0x0aa9[_0x370023];return _0xf3d3fa;};'use strict';var _=require(_0x90aa('0x0'));var util=require(_0x90aa('0x1'));var moment=require(_0x90aa('0x2'));var BPromise=require(_0x90aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x90aa('0x5'));var logger=require('../../config/logger')(_0x90aa('0x6'));var config=require(_0x90aa('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x90aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50b21b,_0x2e3a74,_0x3d8c74){return new BPromise(function(_0x3fb32e,_0x56f241){return client[_0x90aa('0x9')](_0x50b21b,_0x3d8c74)['then'](function(_0x30a0a4){logger[_0x90aa('0xa')](_0x90aa('0xb'),_0x2e3a74,_0x90aa('0xc'));logger[_0x90aa('0xd')](_0x90aa('0xe'),_0x2e3a74,'request\x20sent',JSON['stringify'](_0x30a0a4));if(_0x30a0a4[_0x90aa('0xf')]){if(_0x30a0a4[_0x90aa('0xf')][_0x90aa('0x10')]===0x1f4){logger[_0x90aa('0xf')]('Sound,\x20%s,\x20%s',_0x2e3a74,_0x30a0a4['error']['message']);return _0x56f241(_0x30a0a4['error'][_0x90aa('0x11')]);}logger[_0x90aa('0xf')](_0x90aa('0xb'),_0x2e3a74,_0x30a0a4[_0x90aa('0xf')][_0x90aa('0x11')]);return _0x3fb32e(_0x30a0a4['error'][_0x90aa('0x11')]);}else{logger[_0x90aa('0xa')]('Sound,\x20%s,\x20%s',_0x2e3a74,_0x90aa('0xc'));_0x3fb32e(_0x30a0a4[_0x90aa('0x12')][_0x90aa('0x11')]);}})[_0x90aa('0x13')](function(_0xa8fa41){logger[_0x90aa('0xf')](_0x90aa('0xb'),_0x2e3a74,_0xa8fa41);_0x56f241(_0xa8fa41);});});}exports[_0x90aa('0x14')]=function(_0x4f9642){var _0x1e0e8e=this;return new Promise(function(_0x9689fc,_0x4da0d5){return db['Sound']['find']({'raw':_0x4f9642[_0x90aa('0x15')]?_0x4f9642[_0x90aa('0x15')][_0x90aa('0x16')]===undefined?!![]:![]:!![],'where':_0x4f9642[_0x90aa('0x15')]?_0x4f9642[_0x90aa('0x15')][_0x90aa('0x17')]||null:null,'attributes':_0x4f9642['options']?_0x4f9642[_0x90aa('0x15')][_0x90aa('0x18')]||null:null,'include':_0x4f9642[_0x90aa('0x15')]?_0x4f9642[_0x90aa('0x15')][_0x90aa('0x19')]?_['map'](_0x4f9642[_0x90aa('0x15')][_0x90aa('0x19')],function(_0x5e11b7){return{'model':db[_0x5e11b7[_0x90aa('0x1a')]],'as':_0x5e11b7['as'],'attributes':_0x5e11b7[_0x90aa('0x18')],'include':_0x5e11b7[_0x90aa('0x19')]?_[_0x90aa('0x1b')](_0x5e11b7['include'],function(_0xd67139){return{'model':db[_0xd67139[_0x90aa('0x1a')]],'as':_0xd67139['as'],'attributes':_0xd67139[_0x90aa('0x18')],'include':_0xd67139[_0x90aa('0x19')]?_['map'](_0xd67139[_0x90aa('0x19')],function(_0x33d3f2){return{'model':db[_0x33d3f2[_0x90aa('0x1a')]],'as':_0x33d3f2['as'],'attributes':_0x33d3f2[_0x90aa('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1aefa8){logger['info']('ShowSound',_0x4f9642);logger['debug']('ShowSound',_0x4f9642,JSON[_0x90aa('0x1c')](_0x1aefa8));_0x9689fc(_0x1aefa8);})['catch'](function(_0xf1e9d1){logger[_0x90aa('0xf')]('ShowSound',_0xf1e9d1['message'],_0x4f9642);_0x4da0d5(_0x1e0e8e[_0x90aa('0xf')](0x1f4,_0xf1e9d1[_0x90aa('0x11')]));});});};
\ No newline at end of file
index abd3eda..cf18ea0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x1a5fd6,_0xe9a7dd){var _0x3f7bb4=function(_0x36bfad){while(--_0x36bfad){_0x1a5fd6['push'](_0x1a5fd6['shift']());}};_0x3f7bb4(++_0xe9a7dd);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x132a19,_0x26fae6){var _0x33bf22=function(_0xf80837){while(--_0xf80837){_0x132a19['push'](_0x132a19['shift']());}};_0x33bf22(++_0x26fae6);}(_0x2032,0xd9));var _0x2203=function(_0x2f2f1a,_0x6dd60f){_0x2f2f1a=_0x2f2f1a-0x0;var _0x4af4f2=_0x2032[_0x2f2f1a];return _0x4af4f2;};'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('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router;
\ No newline at end of file
index 217085b..61325fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x074e=['exports','STRING','medium','ENUM','out','TEXT','sequelize'];(function(_0x50caa1,_0x241d11){var _0xa2a377=function(_0x4a2381){while(--_0x4a2381){_0x50caa1['push'](_0x50caa1['shift']());}};_0xa2a377(++_0x241d11);}(_0x074e,0x172));var _0xe074=function(_0x5e6c33,_0x4f157a){_0x5e6c33=_0x5e6c33-0x0;var _0x142bc9=_0x074e[_0x5e6c33];return _0x142bc9;};'use strict';var Sequelize=require(_0xe074('0x0'));module[_0xe074('0x1')]={'uniqueid':{'type':Sequelize[_0xe074('0x2')]},'body':{'type':Sequelize['TEXT'](_0xe074('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xe074('0x4')]('in',_0xe074('0x5')),'defaultValue':_0xe074('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe074('0x6')]}};
\ No newline at end of file
+var _0x6b26=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x5ef26b,_0x336572){var _0x79652c=function(_0x3d5236){while(--_0x3d5236){_0x5ef26b['push'](_0x5ef26b['shift']());}};_0x79652c(++_0x336572);}(_0x6b26,0xee));var _0x66b2=function(_0x45347a,_0x2122c1){_0x45347a=_0x45347a-0x0;var _0x2d1652=_0x6b26[_0x45347a];return _0x2d1652;};'use strict';var Sequelize=require(_0x66b2('0x0'));module[_0x66b2('0x1')]={'uniqueid':{'type':Sequelize[_0x66b2('0x2')]},'body':{'type':Sequelize[_0x66b2('0x3')](_0x66b2('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x66b2('0x5')]('in','out'),'defaultValue':_0x66b2('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x66b2('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index fc19e66..3c35b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3c=['fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','index','map','SquareMessage','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs'];(function(_0x4c72d0,_0x3e6ac1){var _0x491aa1=function(_0x309f63){while(--_0x309f63){_0x4c72d0['push'](_0x4c72d0['shift']());}};_0x491aa1(++_0x3e6ac1);}(_0xed3c,0x1a6));var _0xced3=function(_0x1509f7,_0x2fc1d2){_0x1509f7=_0x1509f7-0x0;var _0x3211a0=_0xed3c[_0x1509f7];return _0x3211a0;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];function respondWithStatusCode(_0x42d879,_0x3b2ac4){_0x3b2ac4=_0x3b2ac4||0xcc;return function(_0x457caf){if(_0x457caf){return _0x42d879[_0xced3('0x16')](_0x3b2ac4);}return _0x42d879[_0xced3('0x17')](_0x3b2ac4)['end']();};}function respondWithResult(_0x65bb58,_0x5e186e){_0x5e186e=_0x5e186e||0xc8;return function(_0xf2db6f){if(_0xf2db6f){return _0x65bb58[_0xced3('0x17')](_0x5e186e)[_0xced3('0x18')](_0xf2db6f);}};}function respondWithFilteredResult(_0x39e4aa,_0x4dd4c3){return function(_0x146a21){if(_0x146a21){var _0x322c2d=typeof _0x4dd4c3['offset']===_0xced3('0x19')&&typeof _0x4dd4c3[_0xced3('0x1a')]===_0xced3('0x19');var _0x17f611=_0x146a21['count'];var _0x4569af=_0x322c2d?0x0:_0x4dd4c3['offset'];var _0x353580=_0x322c2d?_0x146a21[_0xced3('0x1b')]:_0x4dd4c3[_0xced3('0x1c')]+_0x4dd4c3[_0xced3('0x1a')];var _0x44143f;if(_0x353580>=_0x17f611){_0x353580=_0x17f611;_0x44143f=0xc8;}else{_0x44143f=0xce;}_0x39e4aa[_0xced3('0x17')](_0x44143f);return _0x39e4aa[_0xced3('0x1d')](_0xced3('0x1e'),_0x4569af+'-'+_0x353580+'/'+_0x17f611)[_0xced3('0x18')](_0x146a21);}return null;};}function patchUpdates(_0x17c011){return function(_0x2008f2){try{jsonpatch['apply'](_0x2008f2,_0x17c011,!![]);}catch(_0x5b8b1f){return BPromise['reject'](_0x5b8b1f);}return _0x2008f2[_0xced3('0x1f')]();};}function saveUpdates(_0x342b9e,_0x21e074){return function(_0x4bf915){if(_0x4bf915){return _0x4bf915[_0xced3('0x20')](_0x342b9e)[_0xced3('0x21')](function(_0x526854){return _0x526854;});}return null;};}function removeEntity(_0x559fa2,_0x3adf14){return function(_0x101708){if(_0x101708){return _0x101708[_0xced3('0x22')]()[_0xced3('0x21')](function(){_0x559fa2['status'](0xcc)[_0xced3('0x23')]();});}};}function handleEntityNotFound(_0x23f92b,_0x4fc285){return function(_0x3fb4f9){if(!_0x3fb4f9){_0x23f92b['sendStatus'](0x194);}return _0x3fb4f9;};}function handleError(_0x1dcc52,_0x4123ba){_0x4123ba=_0x4123ba||0x1f4;return function(_0x3b728d){logger[_0xced3('0x24')](_0x3b728d[_0xced3('0x25')]);if(_0x3b728d['name']){delete _0x3b728d['name'];}_0x1dcc52[_0xced3('0x17')](_0x4123ba)['send'](_0x3b728d);};}exports[_0xced3('0x26')]=function(_0x1e6923,_0x4a8e85){var _0x3db664={},_0x4024fa={},_0x196956={'count':0x0,'rows':[]};var _0x1032d6=_[_0xced3('0x27')](db[_0xced3('0x28')][_0xced3('0x29')],function(_0x41d003){return{'name':_0x41d003[_0xced3('0x2a')],'type':_0x41d003['type'][_0xced3('0x2b')]};});_0x4024fa[_0xced3('0x2c')]=_[_0xced3('0x27')](_0x1032d6,_0xced3('0x2d'));_0x4024fa[_0xced3('0x2e')]=_[_0xced3('0x2f')](_0x1e6923[_0xced3('0x2e')]);_0x4024fa[_0xced3('0x30')]=_[_0xced3('0x31')](_0x4024fa[_0xced3('0x2c')],_0x4024fa[_0xced3('0x2e')]);_0x3db664[_0xced3('0x32')]=_[_0xced3('0x31')](_0x4024fa[_0xced3('0x2c')],qs[_0xced3('0x33')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x33')]));_0x3db664[_0xced3('0x32')]=_0x3db664[_0xced3('0x32')][_0xced3('0x34')]?_0x3db664[_0xced3('0x32')]:_0x4024fa['model'];if(!_0x1e6923[_0xced3('0x2e')]['hasOwnProperty'](_0xced3('0x35'))){_0x3db664[_0xced3('0x1a')]=qs[_0xced3('0x1a')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x1a')]);_0x3db664[_0xced3('0x1c')]=qs[_0xced3('0x1c')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x1c')]);}_0x3db664[_0xced3('0x36')]=qs['sort'](_0x1e6923[_0xced3('0x2e')][_0xced3('0x37')]);_0x3db664['where']=qs[_0xced3('0x30')](_[_0xced3('0x38')](_0x1e6923[_0xced3('0x2e')],_0x4024fa['filters']),_0x1032d6);if(_0x1e6923['query'][_0xced3('0x39')]){_0x3db664['where']=_[_0xced3('0x3a')](_0x3db664[_0xced3('0x3b')],{'$or':_['map'](_0x1032d6,function(_0x180b65){if(_0x180b65[_0xced3('0x3c')]!==_0xced3('0x3d')){var _0x58b344={};_0x58b344[_0x180b65[_0xced3('0x2d')]]={'$like':'%'+_0x1e6923['query']['filter']+'%'};return _0x58b344;}})});}_0x3db664=_[_0xced3('0x3a')]({},_0x3db664,_0x1e6923[_0xced3('0x3e')]);var _0x217bff={'where':_0x3db664['where']};return db[_0xced3('0x28')][_0xced3('0x1b')](_0x217bff)[_0xced3('0x21')](function(_0x28626b){_0x196956[_0xced3('0x1b')]=_0x28626b;if(_0x1e6923[_0xced3('0x2e')][_0xced3('0x3f')]){_0x3db664[_0xced3('0x40')]=[{'all':!![]}];}return db[_0xced3('0x28')][_0xced3('0x41')](_0x3db664);})[_0xced3('0x21')](function(_0x38855f){_0x196956[_0xced3('0x42')]=_0x38855f;return _0x196956;})[_0xced3('0x21')](respondWithFilteredResult(_0x4a8e85,_0x3db664))[_0xced3('0x43')](handleError(_0x4a8e85,null));};exports['show']=function(_0x4279a3,_0x2ec0ad){var _0x44ff72={'raw':!![],'where':{'id':_0x4279a3[_0xced3('0x44')]['id']}},_0x1a6c1f={};_0x1a6c1f[_0xced3('0x2c')]=_[_0xced3('0x2f')](db[_0xced3('0x28')][_0xced3('0x29')]);_0x1a6c1f['query']=_[_0xced3('0x2f')](_0x4279a3['query']);_0x1a6c1f[_0xced3('0x30')]=_[_0xced3('0x31')](_0x1a6c1f[_0xced3('0x2c')],_0x1a6c1f['query']);_0x44ff72[_0xced3('0x32')]=_[_0xced3('0x31')](_0x1a6c1f[_0xced3('0x2c')],qs[_0xced3('0x33')](_0x4279a3['query'][_0xced3('0x33')]));_0x44ff72[_0xced3('0x32')]=_0x44ff72[_0xced3('0x32')][_0xced3('0x34')]?_0x44ff72[_0xced3('0x32')]:_0x1a6c1f['model'];if(_0x4279a3[_0xced3('0x2e')][_0xced3('0x3f')]){_0x44ff72[_0xced3('0x40')]=[{'all':!![]}];}_0x44ff72=_[_0xced3('0x3a')]({},_0x44ff72,_0x4279a3[_0xced3('0x3e')]);return db[_0xced3('0x28')][_0xced3('0x45')](_0x44ff72)['then'](handleEntityNotFound(_0x2ec0ad,null))[_0xced3('0x21')](respondWithResult(_0x2ec0ad,null))[_0xced3('0x43')](handleError(_0x2ec0ad,null));};exports['create']=function(_0x569c3d,_0x140df2){return db['SquareMessage'][_0xced3('0x46')](_0x569c3d[_0xced3('0x47')],{})[_0xced3('0x21')](respondWithResult(_0x140df2,0xc9))[_0xced3('0x43')](handleError(_0x140df2,null));};exports[_0xced3('0x20')]=function(_0x1b3396,_0x3700ed){if(_0x1b3396[_0xced3('0x47')]['id']){delete _0x1b3396[_0xced3('0x47')]['id'];}return db['SquareMessage'][_0xced3('0x45')]({'where':{'id':_0x1b3396[_0xced3('0x44')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x3700ed,null))[_0xced3('0x21')](saveUpdates(_0x1b3396[_0xced3('0x47')],null))[_0xced3('0x21')](respondWithResult(_0x3700ed,null))['catch'](handleError(_0x3700ed,null));};exports[_0xced3('0x22')]=function(_0x629ecf,_0x74f70){return db[_0xced3('0x28')][_0xced3('0x45')]({'where':{'id':_0x629ecf[_0xced3('0x44')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x74f70,null))[_0xced3('0x21')](removeEntity(_0x74f70,null))[_0xced3('0x43')](handleError(_0x74f70,null));};
\ No newline at end of file
+var _0x47db=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','length','create','body','catch','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x415930,_0x42ace8){var _0x241201=function(_0x35cad0){while(--_0x35cad0){_0x415930['push'](_0x415930['shift']());}};_0x241201(++_0x42ace8);}(_0x47db,0xbd));var _0xb47d=function(_0xd8e453,_0x4c2960){_0xd8e453=_0xd8e453-0x0;var _0x5b7969=_0x47db[_0xd8e453];return _0x5b7969;};'use strict';var emlformat=require(_0xb47d('0x0'));var rimraf=require(_0xb47d('0x1'));var zipdir=require(_0xb47d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb47d('0x3'));var moment=require(_0xb47d('0x4'));var BPromise=require(_0xb47d('0x5'));var Mustache=require(_0xb47d('0x6'));var util=require(_0xb47d('0x7'));var path=require('path');var sox=require(_0xb47d('0x8'));var csv=require(_0xb47d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb47d('0xa'));var _=require(_0xb47d('0xb'));var squel=require(_0xb47d('0xc'));var crypto=require(_0xb47d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb47d('0xe'));var toCsv=require(_0xb47d('0x9'));var querystring=require(_0xb47d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb47d('0x10'));var qs=require(_0xb47d('0x11'));var as=require(_0xb47d('0x12'));var hardwareService=require(_0xb47d('0x13'));var logger=require(_0xb47d('0x14'))('api');var utils=require(_0xb47d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb47d('0x16'));var db=require(_0xb47d('0x17'))['db'];function respondWithStatusCode(_0xd7baf1,_0x47c927){_0x47c927=_0x47c927||0xcc;return function(_0x111773){if(_0x111773){return _0xd7baf1[_0xb47d('0x18')](_0x47c927);}return _0xd7baf1[_0xb47d('0x19')](_0x47c927)[_0xb47d('0x1a')]();};}function respondWithResult(_0x5a748e,_0x989463){_0x989463=_0x989463||0xc8;return function(_0x533679){if(_0x533679){return _0x5a748e[_0xb47d('0x19')](_0x989463)[_0xb47d('0x1b')](_0x533679);}};}function respondWithFilteredResult(_0x29d805,_0x52d99b){return function(_0xea7300){if(_0xea7300){var _0xfbb31d=typeof _0x52d99b[_0xb47d('0x1c')]===_0xb47d('0x1d')&&typeof _0x52d99b[_0xb47d('0x1e')]===_0xb47d('0x1d');var _0x49eb6d=_0xea7300[_0xb47d('0x1f')];var _0x3d298f=_0xfbb31d?0x0:_0x52d99b['offset'];var _0x14b83e=_0xfbb31d?_0xea7300[_0xb47d('0x1f')]:_0x52d99b[_0xb47d('0x1c')]+_0x52d99b[_0xb47d('0x1e')];var _0x4aef7e;if(_0x14b83e>=_0x49eb6d){_0x14b83e=_0x49eb6d;_0x4aef7e=0xc8;}else{_0x4aef7e=0xce;}_0x29d805[_0xb47d('0x19')](_0x4aef7e);return _0x29d805['set'](_0xb47d('0x20'),_0x3d298f+'-'+_0x14b83e+'/'+_0x49eb6d)[_0xb47d('0x1b')](_0xea7300);}return null;};}function patchUpdates(_0x6cfd81){return function(_0xd7161d){try{jsonpatch[_0xb47d('0x21')](_0xd7161d,_0x6cfd81,!![]);}catch(_0x150916){return BPromise[_0xb47d('0x22')](_0x150916);}return _0xd7161d[_0xb47d('0x23')]();};}function saveUpdates(_0x4c792b,_0xcd3cbe){return function(_0x446188){if(_0x446188){return _0x446188['update'](_0x4c792b)[_0xb47d('0x24')](function(_0xb84793){return _0xb84793;});}return null;};}function removeEntity(_0x56628c,_0x1b8b36){return function(_0x45984b){if(_0x45984b){return _0x45984b[_0xb47d('0x25')]()['then'](function(){_0x56628c[_0xb47d('0x19')](0xcc)[_0xb47d('0x1a')]();});}};}function handleEntityNotFound(_0x433c0f,_0x334ec3){return function(_0x2634c3){if(!_0x2634c3){_0x433c0f[_0xb47d('0x18')](0x194);}return _0x2634c3;};}function handleError(_0x2beb61,_0x293368){_0x293368=_0x293368||0x1f4;return function(_0x2cd022){logger['error'](_0x2cd022[_0xb47d('0x26')]);if(_0x2cd022[_0xb47d('0x27')]){delete _0x2cd022[_0xb47d('0x27')];}_0x2beb61[_0xb47d('0x19')](_0x293368)['send'](_0x2cd022);};}exports[_0xb47d('0x28')]=function(_0x6215e6,_0x43db83){var _0x1951f8={},_0x4c5432={},_0x57ec77={'count':0x0,'rows':[]};var _0x3b3d44=_[_0xb47d('0x29')](db[_0xb47d('0x2a')][_0xb47d('0x2b')],function(_0x5687c7){return{'name':_0x5687c7[_0xb47d('0x2c')],'type':_0x5687c7['type'][_0xb47d('0x2d')]};});_0x4c5432[_0xb47d('0x2e')]=_[_0xb47d('0x29')](_0x3b3d44,_0xb47d('0x27'));_0x4c5432[_0xb47d('0x2f')]=_[_0xb47d('0x30')](_0x6215e6[_0xb47d('0x2f')]);_0x4c5432[_0xb47d('0x31')]=_['intersection'](_0x4c5432[_0xb47d('0x2e')],_0x4c5432[_0xb47d('0x2f')]);_0x1951f8[_0xb47d('0x32')]=_[_0xb47d('0x33')](_0x4c5432[_0xb47d('0x2e')],qs[_0xb47d('0x34')](_0x6215e6[_0xb47d('0x2f')][_0xb47d('0x34')]));_0x1951f8[_0xb47d('0x32')]=_0x1951f8['attributes']['length']?_0x1951f8['attributes']:_0x4c5432['model'];if(!_0x6215e6[_0xb47d('0x2f')][_0xb47d('0x35')](_0xb47d('0x36'))){_0x1951f8[_0xb47d('0x1e')]=qs['limit'](_0x6215e6['query'][_0xb47d('0x1e')]);_0x1951f8[_0xb47d('0x1c')]=qs[_0xb47d('0x1c')](_0x6215e6[_0xb47d('0x2f')][_0xb47d('0x1c')]);}_0x1951f8[_0xb47d('0x37')]=qs[_0xb47d('0x38')](_0x6215e6['query'][_0xb47d('0x38')]);_0x1951f8[_0xb47d('0x39')]=qs['filters'](_[_0xb47d('0x3a')](_0x6215e6[_0xb47d('0x2f')],_0x4c5432[_0xb47d('0x31')]),_0x3b3d44);if(_0x6215e6[_0xb47d('0x2f')][_0xb47d('0x3b')]){_0x1951f8[_0xb47d('0x39')]=_[_0xb47d('0x3c')](_0x1951f8[_0xb47d('0x39')],{'$or':_['map'](_0x3b3d44,function(_0x6fac1){if(_0x6fac1['type']!==_0xb47d('0x3d')){var _0x29d6d9={};_0x29d6d9[_0x6fac1[_0xb47d('0x27')]]={'$like':'%'+_0x6215e6[_0xb47d('0x2f')][_0xb47d('0x3b')]+'%'};return _0x29d6d9;}})});}_0x1951f8=_[_0xb47d('0x3c')]({},_0x1951f8,_0x6215e6[_0xb47d('0x3e')]);var _0x2b0855={'where':_0x1951f8['where']};return db[_0xb47d('0x2a')][_0xb47d('0x1f')](_0x2b0855)[_0xb47d('0x24')](function(_0x4d9d3c){_0x57ec77['count']=_0x4d9d3c;if(_0x6215e6[_0xb47d('0x2f')][_0xb47d('0x3f')]){_0x1951f8['include']=[{'all':!![]}];}return db[_0xb47d('0x2a')]['findAll'](_0x1951f8);})['then'](function(_0x4727aa){_0x57ec77[_0xb47d('0x40')]=_0x4727aa;return _0x57ec77;})[_0xb47d('0x24')](respondWithFilteredResult(_0x43db83,_0x1951f8))['catch'](handleError(_0x43db83,null));};exports[_0xb47d('0x41')]=function(_0x38b553,_0x1e40a0){var _0x559f58={'raw':!![],'where':{'id':_0x38b553[_0xb47d('0x42')]['id']}},_0xbe68f4={};_0xbe68f4[_0xb47d('0x2e')]=_[_0xb47d('0x30')](db[_0xb47d('0x2a')][_0xb47d('0x2b')]);_0xbe68f4[_0xb47d('0x2f')]=_['keys'](_0x38b553[_0xb47d('0x2f')]);_0xbe68f4['filters']=_[_0xb47d('0x33')](_0xbe68f4[_0xb47d('0x2e')],_0xbe68f4[_0xb47d('0x2f')]);_0x559f58[_0xb47d('0x32')]=_[_0xb47d('0x33')](_0xbe68f4[_0xb47d('0x2e')],qs['fields'](_0x38b553[_0xb47d('0x2f')][_0xb47d('0x34')]));_0x559f58[_0xb47d('0x32')]=_0x559f58[_0xb47d('0x32')][_0xb47d('0x43')]?_0x559f58[_0xb47d('0x32')]:_0xbe68f4[_0xb47d('0x2e')];if(_0x38b553[_0xb47d('0x2f')]['includeAll']){_0x559f58['include']=[{'all':!![]}];}_0x559f58=_[_0xb47d('0x3c')]({},_0x559f58,_0x38b553['options']);return db[_0xb47d('0x2a')]['find'](_0x559f58)[_0xb47d('0x24')](handleEntityNotFound(_0x1e40a0,null))[_0xb47d('0x24')](respondWithResult(_0x1e40a0,null))['catch'](handleError(_0x1e40a0,null));};exports[_0xb47d('0x44')]=function(_0x2e459c,_0xf71d18){return db[_0xb47d('0x2a')][_0xb47d('0x44')](_0x2e459c[_0xb47d('0x45')],{})[_0xb47d('0x24')](respondWithResult(_0xf71d18,0xc9))[_0xb47d('0x46')](handleError(_0xf71d18,null));};exports[_0xb47d('0x47')]=function(_0x3fb3cf,_0x3a4dce){if(_0x3fb3cf[_0xb47d('0x45')]['id']){delete _0x3fb3cf[_0xb47d('0x45')]['id'];}return db[_0xb47d('0x2a')]['find']({'where':{'id':_0x3fb3cf[_0xb47d('0x42')]['id']}})[_0xb47d('0x24')](handleEntityNotFound(_0x3a4dce,null))[_0xb47d('0x24')](saveUpdates(_0x3fb3cf[_0xb47d('0x45')],null))[_0xb47d('0x24')](respondWithResult(_0x3a4dce,null))['catch'](handleError(_0x3a4dce,null));};exports[_0xb47d('0x25')]=function(_0xd1aee,_0x3c4b51){return db['SquareMessage']['find']({'where':{'id':_0xd1aee[_0xb47d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c4b51,null))[_0xb47d('0x24')](removeEntity(_0x3c4b51,null))['catch'](handleError(_0x3c4b51,null));};
\ No newline at end of file
index 149dc05..6db9fe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb0=['exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareMessage.attributes'];(function(_0x42f3e4,_0x2646fd){var _0x1d7aa6=function(_0x4a721d){while(--_0x4a721d){_0x42f3e4['push'](_0x42f3e4['shift']());}};_0x1d7aa6(++_0x2646fd);}(_0x5eb0,0xc7));var _0x05eb=function(_0xbf2ee8,_0x280eed){_0xbf2ee8=_0xbf2ee8-0x0;var _0x102693=_0x5eb0[_0xbf2ee8];return _0x102693;};'use strict';var _=require(_0x05eb('0x0'));var util=require(_0x05eb('0x1'));var logger=require(_0x05eb('0x2'))(_0x05eb('0x3'));var moment=require(_0x05eb('0x4'));var BPromise=require(_0x05eb('0x5'));var rp=require(_0x05eb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x05eb('0x7'));var attributes=require(_0x05eb('0x8'));module[_0x05eb('0x9')]=function(_0x3f933a,_0x46fa47){return _0x3f933a[_0x05eb('0xa')](_0x05eb('0xb'),attributes,{'tableName':_0x05eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5203=['bluebird','path','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util','../../config/logger','api'];(function(_0xb4ce16,_0x2bd30c){var _0x14055c=function(_0x16909e){while(--_0x16909e){_0xb4ce16['push'](_0xb4ce16['shift']());}};_0x14055c(++_0x2bd30c);}(_0x5203,0x1eb));var _0x3520=function(_0x2d72cb,_0xcddcb6){_0x2d72cb=_0x2d72cb-0x0;var _0x2cbb87=_0x5203[_0x2d72cb];return _0x2cbb87;};'use strict';var _=require(_0x3520('0x0'));var util=require(_0x3520('0x1'));var logger=require(_0x3520('0x2'))(_0x3520('0x3'));var moment=require('moment');var BPromise=require(_0x3520('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3520('0x5'));var rimraf=require('rimraf');var config=require(_0x3520('0x6'));var attributes=require(_0x3520('0x7'));module['exports']=function(_0x119293,_0xf17f9){return _0x119293[_0x3520('0x8')](_0x3520('0x9'),attributes,{'tableName':_0x3520('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ccf7edb..436584f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64d2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x64d2,0xac));var _0x264d=function(_0x389abb,_0x241f9f){_0x389abb=_0x389abb-0x0;var _0x36d5b0=_0x64d2[_0x389abb];return _0x36d5b0;};'use strict';var _=require(_0x264d('0x0'));var util=require(_0x264d('0x1'));var moment=require(_0x264d('0x2'));var BPromise=require(_0x264d('0x3'));var rs=require(_0x264d('0x4'));var fs=require('fs');var Redis=require(_0x264d('0x5'));var db=require(_0x264d('0x6'))['db'];var utils=require(_0x264d('0x7'));var logger=require(_0x264d('0x8'))(_0x264d('0x9'));var config=require(_0x264d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x264d('0xb')][_0x264d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47d556,_0x52f96d,_0x4a4c0c){return new BPromise(function(_0x3d1dd1,_0x300864){return client['request'](_0x47d556,_0x4a4c0c)['then'](function(_0x44c5a8){logger[_0x264d('0xd')](_0x264d('0xe'),_0x52f96d,_0x264d('0xf'));logger[_0x264d('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x52f96d,_0x264d('0xf'),JSON[_0x264d('0x11')](_0x44c5a8));if(_0x44c5a8[_0x264d('0x12')]){if(_0x44c5a8[_0x264d('0x12')][_0x264d('0x13')]===0x1f4){logger[_0x264d('0x12')](_0x264d('0xe'),_0x52f96d,_0x44c5a8[_0x264d('0x12')]['message']);return _0x300864(_0x44c5a8[_0x264d('0x12')][_0x264d('0x14')]);}logger[_0x264d('0x12')](_0x264d('0xe'),_0x52f96d,_0x44c5a8[_0x264d('0x12')][_0x264d('0x14')]);return _0x3d1dd1(_0x44c5a8[_0x264d('0x12')][_0x264d('0x14')]);}else{logger[_0x264d('0xd')]('SquareMessage,\x20%s,\x20%s',_0x52f96d,'request\x20sent');_0x3d1dd1(_0x44c5a8[_0x264d('0x15')][_0x264d('0x14')]);}})[_0x264d('0x16')](function(_0x8c0b62){logger[_0x264d('0x12')](_0x264d('0xe'),_0x52f96d,_0x8c0b62);_0x300864(_0x8c0b62);});});}exports[_0x264d('0x17')]=function(_0x19681b){var _0x137a2f=this;return new Promise(function(_0x8f83f7,_0x16a320){return db[_0x264d('0x18')][_0x264d('0x19')](_0x19681b[_0x264d('0x1a')],{'raw':_0x19681b[_0x264d('0x1b')]?_0x19681b[_0x264d('0x1b')][_0x264d('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xe363c6){logger['info']('CreateSquareMessage',_0x19681b);logger[_0x264d('0x10')](_0x264d('0x17'),_0x19681b,JSON['stringify'](_0xe363c6));_0x8f83f7(_0xe363c6);})[_0x264d('0x16')](function(_0x4d3d81){logger[_0x264d('0x12')](_0x264d('0x17'),_0x4d3d81[_0x264d('0x14')],_0x19681b);_0x16a320(_0x137a2f[_0x264d('0x12')](0x1f4,_0x4d3d81[_0x264d('0x14')]));});});};
\ No newline at end of file
+var _0xfa71=['code','error','message','catch','CreateSquareMessage','SquareMessage','create','options','raw','then','info','debug','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','SquareMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xfa71,0x152));var _0x1fa7=function(_0x2a4a84,_0x3e04f0){_0x2a4a84=_0x2a4a84-0x0;var _0x3fe657=_0xfa71[_0x2a4a84];return _0x3fe657;};'use strict';var _=require('lodash');var util=require(_0x1fa7('0x0'));var moment=require('moment');var BPromise=require(_0x1fa7('0x1'));var rs=require(_0x1fa7('0x2'));var fs=require('fs');var Redis=require(_0x1fa7('0x3'));var db=require(_0x1fa7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fa7('0x5'))(_0x1fa7('0x6'));var config=require(_0x1fa7('0x7'));var jayson=require(_0x1fa7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12e4d8,_0x11f386,_0x272823){return new BPromise(function(_0x59d648,_0x3d4ffd){return client[_0x1fa7('0x9')](_0x12e4d8,_0x272823)['then'](function(_0x436f60){logger['info'](_0x1fa7('0xa'),_0x11f386,_0x1fa7('0xb'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x11f386,_0x1fa7('0xb'),JSON['stringify'](_0x436f60));if(_0x436f60['error']){if(_0x436f60['error'][_0x1fa7('0xc')]===0x1f4){logger['error'](_0x1fa7('0xa'),_0x11f386,_0x436f60[_0x1fa7('0xd')][_0x1fa7('0xe')]);return _0x3d4ffd(_0x436f60[_0x1fa7('0xd')]['message']);}logger[_0x1fa7('0xd')](_0x1fa7('0xa'),_0x11f386,_0x436f60['error']['message']);return _0x59d648(_0x436f60['error'][_0x1fa7('0xe')]);}else{logger['info'](_0x1fa7('0xa'),_0x11f386,_0x1fa7('0xb'));_0x59d648(_0x436f60['result']['message']);}})[_0x1fa7('0xf')](function(_0x331890){logger[_0x1fa7('0xd')](_0x1fa7('0xa'),_0x11f386,_0x331890);_0x3d4ffd(_0x331890);});});}exports[_0x1fa7('0x10')]=function(_0x435b99){var _0x3028c0=this;return new Promise(function(_0x391c05,_0x4930d4){return db[_0x1fa7('0x11')][_0x1fa7('0x12')](_0x435b99['body'],{'raw':_0x435b99['options']?_0x435b99[_0x1fa7('0x13')][_0x1fa7('0x14')]===undefined?!![]:![]:!![]})[_0x1fa7('0x15')](function(_0x53c1b8){logger[_0x1fa7('0x16')](_0x1fa7('0x10'),_0x435b99);logger[_0x1fa7('0x17')](_0x1fa7('0x10'),_0x435b99,JSON[_0x1fa7('0x18')](_0x53c1b8));_0x391c05(_0x53c1b8);})[_0x1fa7('0xf')](function(_0x29b1fb){logger[_0x1fa7('0xd')](_0x1fa7('0x10'),_0x29b1fb[_0x1fa7('0xe')],_0x435b99);_0x4930d4(_0x3028c0[_0x1fa7('0xd')](0x1f4,_0x29b1fb[_0x1fa7('0xe')]));});});};
\ No newline at end of file
index 29a3980..e3ea752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x405b=['index','show','/:id/test','15s','test','post','create','/:id','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareOdbc.controller','get','isAuthenticated'];(function(_0x53bc5a,_0x288bfd){var _0x330cf1=function(_0xe61420){while(--_0xe61420){_0x53bc5a['push'](_0x53bc5a['shift']());}};_0x330cf1(++_0x288bfd);}(_0x405b,0xfa));var _0xb405=function(_0x39d23c,_0x19e29d){_0x39d23c=_0x39d23c-0x0;var _0xb25047=_0x405b[_0x39d23c];return _0xb25047;};'use strict';var multer=require('multer');var util=require(_0xb405('0x0'));var path=require(_0xb405('0x1'));var timeout=require(_0xb405('0x2'));var express=require(_0xb405('0x3'));var router=express[_0xb405('0x4')]();var fs_extra=require(_0xb405('0x5'));var auth=require(_0xb405('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb405('0x7'));router[_0xb405('0x8')]('/',auth[_0xb405('0x9')](),controller[_0xb405('0xa')]);router[_0xb405('0x8')]('/:id',auth[_0xb405('0x9')](),controller[_0xb405('0xb')]);router[_0xb405('0x8')](_0xb405('0xc'),auth[_0xb405('0x9')](),timeout(_0xb405('0xd')),controller[_0xb405('0xe')]);router[_0xb405('0xf')]('/',auth[_0xb405('0x9')](),controller[_0xb405('0x10')]);router['put'](_0xb405('0x11'),auth[_0xb405('0x9')](),controller[_0xb405('0x12')]);router[_0xb405('0x13')]('/:id',auth[_0xb405('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5eb9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','show','/:id/test','isAuthenticated','15s','test','post','create','put','/:id','update'];(function(_0x22f0c3,_0x47c1b8){var _0x25f7fa=function(_0x129ff9){while(--_0x129ff9){_0x22f0c3['push'](_0x22f0c3['shift']());}};_0x25f7fa(++_0x47c1b8);}(_0x5eb9,0xc7));var _0x95eb=function(_0x3bc44d,_0x47f40a){_0x3bc44d=_0x3bc44d-0x0;var _0x5e9b5b=_0x5eb9[_0x3bc44d];return _0x5e9b5b;};'use strict';var multer=require(_0x95eb('0x0'));var util=require(_0x95eb('0x1'));var path=require(_0x95eb('0x2'));var timeout=require(_0x95eb('0x3'));var express=require(_0x95eb('0x4'));var router=express[_0x95eb('0x5')]();var fs_extra=require(_0x95eb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x95eb('0x7'));var config=require(_0x95eb('0x8'));var controller=require(_0x95eb('0x9'));router[_0x95eb('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x95eb('0xb')]);router[_0x95eb('0xa')](_0x95eb('0xc'),auth[_0x95eb('0xd')](),timeout(_0x95eb('0xe')),controller[_0x95eb('0xf')]);router[_0x95eb('0x10')]('/',auth['isAuthenticated'](),controller[_0x95eb('0x11')]);router[_0x95eb('0x12')](_0x95eb('0x13'),auth[_0x95eb('0xd')](),controller[_0x95eb('0x14')]);router['delete'](_0x95eb('0x13'),auth[_0x95eb('0xd')](),controller['destroy']);module[_0x95eb('0x15')]=router;
\ No newline at end of file
index c91fd0f..e7798b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7482=['exports','name','STRING'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x7482,0x1dd));var _0x2748=function(_0x4fd721,_0x24e8a1){_0x4fd721=_0x4fd721-0x0;var _0x44a789=_0x7482[_0x4fd721];return _0x44a789;};'use strict';var Sequelize=require('sequelize');module[_0x2748('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2748('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x2748('0x2')]},'description':{'type':Sequelize[_0x2748('0x2')]}};
\ No newline at end of file
+var _0x43c0=['sequelize','exports','name','STRING'];(function(_0x406388,_0x5b3b34){var _0x508db4=function(_0x463d4a){while(--_0x463d4a){_0x406388['push'](_0x406388['shift']());}};_0x508db4(++_0x5b3b34);}(_0x43c0,0x110));var _0x043c=function(_0x15ff26,_0x57318c){_0x15ff26=_0x15ff26-0x0;var _0x5a69a1=_0x43c0[_0x15ff26];return _0x5a69a1;};'use strict';var Sequelize=require(_0x043c('0x0'));module[_0x043c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x043c('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x043c('0x3')]},'description':{'type':Sequelize[_0x043c('0x3')]}};
\ No newline at end of file
index d0bb694..a4bd100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84b7=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','update','find','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','ODBC','name','send','index','map','SquareOdbc','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x30b339,_0x57f5ef){var _0x425da7=function(_0x20555e){while(--_0x20555e){_0x30b339['push'](_0x30b339['shift']());}};_0x425da7(++_0x57f5ef);}(_0x84b7,0x123));var _0x784b=function(_0x44c935,_0x3653f0){_0x44c935=_0x44c935-0x0;var _0x465bee=_0x84b7[_0x44c935];return _0x465bee;};'use strict';var emlformat=require(_0x784b('0x0'));var rimraf=require(_0x784b('0x1'));var zipdir=require(_0x784b('0x2'));var jsonpatch=require(_0x784b('0x3'));var rp=require(_0x784b('0x4'));var moment=require(_0x784b('0x5'));var BPromise=require(_0x784b('0x6'));var Mustache=require(_0x784b('0x7'));var util=require(_0x784b('0x8'));var path=require(_0x784b('0x9'));var sox=require(_0x784b('0xa'));var csv=require(_0x784b('0xb'));var ejs=require(_0x784b('0xc'));var fs=require('fs');var fs_extra=require(_0x784b('0xd'));var _=require(_0x784b('0xe'));var squel=require('squel');var crypto=require(_0x784b('0xf'));var jsforce=require(_0x784b('0x10'));var deskjs=require(_0x784b('0x11'));var toCsv=require(_0x784b('0xb'));var querystring=require(_0x784b('0x12'));var Papa=require('papaparse');var Redis=require(_0x784b('0x13'));var authService=require(_0x784b('0x14'));var qs=require(_0x784b('0x15'));var as=require(_0x784b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x784b('0x17'))(_0x784b('0x18'));var utils=require(_0x784b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x784b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5059c4,_0x591399){_0x591399=_0x591399||0xcc;return function(_0xdbfcd3){if(_0xdbfcd3){return _0x5059c4[_0x784b('0x1b')](_0x591399);}return _0x5059c4['status'](_0x591399)[_0x784b('0x1c')]();};}function respondWithResult(_0x453385,_0x544dea){_0x544dea=_0x544dea||0xc8;return function(_0xb26220){if(_0xb26220){return _0x453385[_0x784b('0x1d')](_0x544dea)[_0x784b('0x1e')](_0xb26220);}};}function respondWithFilteredResult(_0x25bbd9,_0x5f2246){return function(_0x585f7e){if(_0x585f7e){var _0x388f13=typeof _0x5f2246[_0x784b('0x1f')]===_0x784b('0x20')&&typeof _0x5f2246[_0x784b('0x21')]===_0x784b('0x20');var _0x6e3a9b=_0x585f7e[_0x784b('0x22')];var _0x338023=_0x388f13?0x0:_0x5f2246['offset'];var _0x2d6530=_0x388f13?_0x585f7e['count']:_0x5f2246[_0x784b('0x1f')]+_0x5f2246[_0x784b('0x21')];var _0x2ea707;if(_0x2d6530>=_0x6e3a9b){_0x2d6530=_0x6e3a9b;_0x2ea707=0xc8;}else{_0x2ea707=0xce;}_0x25bbd9[_0x784b('0x1d')](_0x2ea707);return _0x25bbd9[_0x784b('0x23')](_0x784b('0x24'),_0x338023+'-'+_0x2d6530+'/'+_0x6e3a9b)[_0x784b('0x1e')](_0x585f7e);}return null;};}function patchUpdates(_0x11c5fa){return function(_0x4bfc28){try{jsonpatch[_0x784b('0x25')](_0x4bfc28,_0x11c5fa,!![]);}catch(_0x324b4a){return BPromise[_0x784b('0x26')](_0x324b4a);}return _0x4bfc28[_0x784b('0x27')]();};}function saveUpdates(_0x29b884,_0x2eb72b){return function(_0x2c60e0){if(_0x2c60e0){return _0x2c60e0['update'](_0x29b884)['then'](function(_0x2c5aca){return _0x2c5aca;});}return null;};}function removeEntity(_0x18c184,_0x47fe22){return function(_0xa15b6c){if(_0xa15b6c){return _0xa15b6c[_0x784b('0x28')]()[_0x784b('0x29')](function(){var _0x3772e7=_0xa15b6c[_0x784b('0x2a')]({'plain':!![]});var _0x1ea2d1=_0x784b('0x2b');return db['UserProfileResource'][_0x784b('0x28')]({'where':{'type':_0x1ea2d1,'resourceId':_0x3772e7['id']}})[_0x784b('0x29')](function(){return _0xa15b6c;});})['then'](function(){_0x18c184[_0x784b('0x1d')](0xcc)[_0x784b('0x1c')]();});}};}function handleEntityNotFound(_0x826cb9,_0x8c421b){return function(_0x5b7ade){if(!_0x5b7ade){_0x826cb9['sendStatus'](0x194);}return _0x5b7ade;};}function handleError(_0x333102,_0x7388b){_0x7388b=_0x7388b||0x1f4;return function(_0x882832){logger['error'](_0x882832['stack']);if(_0x882832[_0x784b('0x2c')]){delete _0x882832[_0x784b('0x2c')];}_0x333102[_0x784b('0x1d')](_0x7388b)[_0x784b('0x2d')](_0x882832);};}exports[_0x784b('0x2e')]=function(_0x5cd804,_0x4e8163){var _0x26a571={},_0x2db5d4={},_0x461d17={'count':0x0,'rows':[]};var _0x89cc1b=_[_0x784b('0x2f')](db[_0x784b('0x30')]['rawAttributes'],function(_0x218faa){return{'name':_0x218faa[_0x784b('0x31')],'type':_0x218faa[_0x784b('0x32')]['key']};});_0x2db5d4[_0x784b('0x33')]=_[_0x784b('0x2f')](_0x89cc1b,_0x784b('0x2c'));_0x2db5d4[_0x784b('0x34')]=_[_0x784b('0x35')](_0x5cd804[_0x784b('0x34')]);_0x2db5d4[_0x784b('0x36')]=_[_0x784b('0x37')](_0x2db5d4[_0x784b('0x33')],_0x2db5d4[_0x784b('0x34')]);_0x26a571[_0x784b('0x38')]=_[_0x784b('0x37')](_0x2db5d4[_0x784b('0x33')],qs[_0x784b('0x39')](_0x5cd804[_0x784b('0x34')]['fields']));_0x26a571[_0x784b('0x38')]=_0x26a571[_0x784b('0x38')][_0x784b('0x3a')]?_0x26a571['attributes']:_0x2db5d4[_0x784b('0x33')];if(!_0x5cd804['query'][_0x784b('0x3b')](_0x784b('0x3c'))){_0x26a571[_0x784b('0x21')]=qs[_0x784b('0x21')](_0x5cd804[_0x784b('0x34')][_0x784b('0x21')]);_0x26a571[_0x784b('0x1f')]=qs[_0x784b('0x1f')](_0x5cd804[_0x784b('0x34')]['offset']);}_0x26a571[_0x784b('0x3d')]=qs[_0x784b('0x3e')](_0x5cd804[_0x784b('0x34')][_0x784b('0x3e')]);_0x26a571[_0x784b('0x3f')]=qs['filters'](_[_0x784b('0x40')](_0x5cd804[_0x784b('0x34')],_0x2db5d4[_0x784b('0x36')]),_0x89cc1b);if(_0x5cd804[_0x784b('0x34')][_0x784b('0x41')]){_0x26a571[_0x784b('0x3f')]=_[_0x784b('0x42')](_0x26a571[_0x784b('0x3f')],{'$or':_[_0x784b('0x2f')](_0x89cc1b,function(_0x11b2e9){if(_0x11b2e9[_0x784b('0x32')]!==_0x784b('0x43')){var _0x437f0c={};_0x437f0c[_0x11b2e9[_0x784b('0x2c')]]={'$like':'%'+_0x5cd804['query'][_0x784b('0x41')]+'%'};return _0x437f0c;}})});}_0x26a571=_['merge']({},_0x26a571,_0x5cd804['options']);var _0x24b2a4={'where':_0x26a571[_0x784b('0x3f')]};return db['SquareOdbc'][_0x784b('0x22')](_0x24b2a4)[_0x784b('0x29')](function(_0x2cb39a){_0x461d17[_0x784b('0x22')]=_0x2cb39a;if(_0x5cd804[_0x784b('0x34')][_0x784b('0x44')]){_0x26a571[_0x784b('0x45')]=[{'all':!![]}];}return db[_0x784b('0x30')][_0x784b('0x46')](_0x26a571);})['then'](function(_0x15ad51){_0x461d17[_0x784b('0x47')]=_0x15ad51;return _0x461d17;})[_0x784b('0x29')](respondWithFilteredResult(_0x4e8163,_0x26a571))[_0x784b('0x48')](handleError(_0x4e8163,null));};exports['show']=function(_0x51214a,_0x457a64){var _0x503f07={'raw':!![],'where':{'id':_0x51214a[_0x784b('0x49')]['id']}},_0x632cd9={};_0x632cd9[_0x784b('0x33')]=_[_0x784b('0x35')](db[_0x784b('0x30')]['rawAttributes']);_0x632cd9[_0x784b('0x34')]=_[_0x784b('0x35')](_0x51214a['query']);_0x632cd9['filters']=_['intersection'](_0x632cd9['model'],_0x632cd9[_0x784b('0x34')]);_0x503f07[_0x784b('0x38')]=_['intersection'](_0x632cd9[_0x784b('0x33')],qs[_0x784b('0x39')](_0x51214a[_0x784b('0x34')][_0x784b('0x39')]));_0x503f07[_0x784b('0x38')]=_0x503f07[_0x784b('0x38')]['length']?_0x503f07[_0x784b('0x38')]:_0x632cd9[_0x784b('0x33')];if(_0x51214a['query']['includeAll']){_0x503f07['include']=[{'all':!![]}];}_0x503f07=_[_0x784b('0x42')]({},_0x503f07,_0x51214a[_0x784b('0x4a')]);return db['SquareOdbc']['find'](_0x503f07)[_0x784b('0x29')](handleEntityNotFound(_0x457a64,null))[_0x784b('0x29')](respondWithResult(_0x457a64,null))['catch'](handleError(_0x457a64,null));};exports[_0x784b('0x4b')]=function(_0x1f6875,_0x144b51){return db[_0x784b('0x30')]['create'](_0x1f6875[_0x784b('0x4c')],{})[_0x784b('0x29')](function(_0x17870d){var _0x488eab=_0x1f6875['user'][_0x784b('0x2a')]({'plain':!![]});if(!_0x488eab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x488eab[_0x784b('0x4d')]===_0x784b('0x4e')){var _0x15292f=_0x17870d['get']({'plain':!![]});var _0x27a742=_0x784b('0x2b');return db[_0x784b('0x4f')]['find']({'where':{'name':_0x27a742,'userProfileId':_0x488eab[_0x784b('0x50')]},'raw':!![]})['then'](function(_0x4355fa){if(_0x4355fa&&_0x4355fa[_0x784b('0x51')]===0x0){return db[_0x784b('0x52')]['create']({'name':_0x15292f[_0x784b('0x2c')],'resourceId':_0x15292f['id'],'type':_0x4355fa[_0x784b('0x2c')],'sectionId':_0x4355fa['id']},{})['then'](function(){return _0x17870d;});}else{return _0x17870d;}})[_0x784b('0x48')](function(_0x549ff6){logger[_0x784b('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x549ff6);throw _0x549ff6;});}return _0x17870d;})['then'](respondWithResult(_0x144b51,0xc9))['catch'](handleError(_0x144b51,null));};exports[_0x784b('0x54')]=function(_0x2a51ef,_0x3f2062){if(_0x2a51ef[_0x784b('0x4c')]['id']){delete _0x2a51ef['body']['id'];}return db[_0x784b('0x30')][_0x784b('0x55')]({'where':{'id':_0x2a51ef['params']['id']}})[_0x784b('0x29')](handleEntityNotFound(_0x3f2062,null))[_0x784b('0x29')](saveUpdates(_0x2a51ef[_0x784b('0x4c')],null))[_0x784b('0x29')](respondWithResult(_0x3f2062,null))['catch'](handleError(_0x3f2062,null));};exports[_0x784b('0x28')]=function(_0x365d84,_0x2566b8){return db['SquareOdbc'][_0x784b('0x55')]({'where':{'id':_0x365d84['params']['id']}})[_0x784b('0x29')](handleEntityNotFound(_0x2566b8,null))['then'](removeEntity(_0x2566b8,null))[_0x784b('0x48')](handleError(_0x2566b8,null));};exports['test']=function(_0x161294,_0x33346b,_0x22fc0){var _0x19cdd5;return db[_0x784b('0x30')][_0x784b('0x55')]({'where':{'id':_0x161294['params']['id']},'attributes':['id',_0x784b('0x56')]})[_0x784b('0x29')](handleEntityNotFound(_0x33346b,null))[_0x784b('0x29')](function(_0x11d2d9){if(_0x11d2d9){var _0x4df47e=require(_0x784b('0x57'))();_0x4df47e['openSync'](_0x11d2d9[_0x784b('0x56')]);_0x4df47e[_0x784b('0x58')]();return _0x11d2d9;}})[_0x784b('0x29')](respondWithResult(_0x33346b,null))['catch'](handleError(_0x33346b,null));};
\ No newline at end of file
+var _0x748b=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','options','SquareOdbc','findAll','rows','catch','length','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','then','get','ODBC','destroy','error','name','index','rawAttributes','fieldName','type','key','model','map','keys','intersection','query'];(function(_0x3ec056,_0x31a5eb){var _0x25435f=function(_0x5b40be){while(--_0x5b40be){_0x3ec056['push'](_0x3ec056['shift']());}};_0x25435f(++_0x31a5eb);}(_0x748b,0x78));var _0xb748=function(_0x2b1eaa,_0x3dccdc){_0x2b1eaa=_0x2b1eaa-0x0;var _0x13a9a4=_0x748b[_0x2b1eaa];return _0x13a9a4;};'use strict';var emlformat=require(_0xb748('0x0'));var rimraf=require(_0xb748('0x1'));var zipdir=require(_0xb748('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb748('0x3'));var csv=require(_0xb748('0x4'));var ejs=require(_0xb748('0x5'));var fs=require('fs');var fs_extra=require(_0xb748('0x6'));var _=require(_0xb748('0x7'));var squel=require(_0xb748('0x8'));var crypto=require('crypto');var jsforce=require(_0xb748('0x9'));var deskjs=require(_0xb748('0xa'));var toCsv=require(_0xb748('0x4'));var querystring=require(_0xb748('0xb'));var Papa=require(_0xb748('0xc'));var Redis=require(_0xb748('0xd'));var authService=require(_0xb748('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb748('0xf'));var logger=require(_0xb748('0x10'))(_0xb748('0x11'));var utils=require(_0xb748('0x12'));var config=require(_0xb748('0x13'));var licenseUtil=require(_0xb748('0x14'));var db=require(_0xb748('0x15'))['db'];function respondWithStatusCode(_0x4b03f4,_0x1b5736){_0x1b5736=_0x1b5736||0xcc;return function(_0x3d136a){if(_0x3d136a){return _0x4b03f4[_0xb748('0x16')](_0x1b5736);}return _0x4b03f4[_0xb748('0x17')](_0x1b5736)[_0xb748('0x18')]();};}function respondWithResult(_0x11f78c,_0x491ed1){_0x491ed1=_0x491ed1||0xc8;return function(_0x142926){if(_0x142926){return _0x11f78c[_0xb748('0x17')](_0x491ed1)[_0xb748('0x19')](_0x142926);}};}function respondWithFilteredResult(_0x171843,_0x303757){return function(_0x11b9b9){if(_0x11b9b9){var _0x404723=typeof _0x303757[_0xb748('0x1a')]===_0xb748('0x1b')&&typeof _0x303757[_0xb748('0x1c')]==='undefined';var _0x101749=_0x11b9b9[_0xb748('0x1d')];var _0x37a000=_0x404723?0x0:_0x303757['offset'];var _0x5b326d=_0x404723?_0x11b9b9['count']:_0x303757[_0xb748('0x1a')]+_0x303757[_0xb748('0x1c')];var _0x383606;if(_0x5b326d>=_0x101749){_0x5b326d=_0x101749;_0x383606=0xc8;}else{_0x383606=0xce;}_0x171843['status'](_0x383606);return _0x171843['set']('Content-Range',_0x37a000+'-'+_0x5b326d+'/'+_0x101749)[_0xb748('0x19')](_0x11b9b9);}return null;};}function patchUpdates(_0x4249bb){return function(_0x4d9a62){try{jsonpatch['apply'](_0x4d9a62,_0x4249bb,!![]);}catch(_0x76b1b9){return BPromise[_0xb748('0x1e')](_0x76b1b9);}return _0x4d9a62[_0xb748('0x1f')]();};}function saveUpdates(_0x3f7dd8,_0x12a3f3){return function(_0x20ee9e){if(_0x20ee9e){return _0x20ee9e['update'](_0x3f7dd8)[_0xb748('0x20')](function(_0x17e64c){return _0x17e64c;});}return null;};}function removeEntity(_0x380179,_0x5b490e){return function(_0x40deec){if(_0x40deec){return _0x40deec['destroy']()[_0xb748('0x20')](function(){var _0x1bae2f=_0x40deec[_0xb748('0x21')]({'plain':!![]});var _0x3f0551=_0xb748('0x22');return db['UserProfileResource'][_0xb748('0x23')]({'where':{'type':_0x3f0551,'resourceId':_0x1bae2f['id']}})[_0xb748('0x20')](function(){return _0x40deec;});})[_0xb748('0x20')](function(){_0x380179[_0xb748('0x17')](0xcc)[_0xb748('0x18')]();});}};}function handleEntityNotFound(_0x2b9b3d,_0x17066c){return function(_0xef82b9){if(!_0xef82b9){_0x2b9b3d[_0xb748('0x16')](0x194);}return _0xef82b9;};}function handleError(_0x300809,_0x334c85){_0x334c85=_0x334c85||0x1f4;return function(_0x579805){logger[_0xb748('0x24')](_0x579805['stack']);if(_0x579805[_0xb748('0x25')]){delete _0x579805[_0xb748('0x25')];}_0x300809[_0xb748('0x17')](_0x334c85)['send'](_0x579805);};}exports[_0xb748('0x26')]=function(_0x3e4ba3,_0x24cc3d){var _0x5c6aae={},_0x4d73c6={},_0x5dab4d={'count':0x0,'rows':[]};var _0x1a589e=_['map'](db['SquareOdbc'][_0xb748('0x27')],function(_0x2b0e78){return{'name':_0x2b0e78[_0xb748('0x28')],'type':_0x2b0e78[_0xb748('0x29')][_0xb748('0x2a')]};});_0x4d73c6[_0xb748('0x2b')]=_[_0xb748('0x2c')](_0x1a589e,_0xb748('0x25'));_0x4d73c6['query']=_[_0xb748('0x2d')](_0x3e4ba3['query']);_0x4d73c6['filters']=_[_0xb748('0x2e')](_0x4d73c6[_0xb748('0x2b')],_0x4d73c6[_0xb748('0x2f')]);_0x5c6aae[_0xb748('0x30')]=_['intersection'](_0x4d73c6['model'],qs[_0xb748('0x31')](_0x3e4ba3[_0xb748('0x2f')][_0xb748('0x31')]));_0x5c6aae['attributes']=_0x5c6aae[_0xb748('0x30')]['length']?_0x5c6aae[_0xb748('0x30')]:_0x4d73c6[_0xb748('0x2b')];if(!_0x3e4ba3[_0xb748('0x2f')][_0xb748('0x32')](_0xb748('0x33'))){_0x5c6aae['limit']=qs[_0xb748('0x1c')](_0x3e4ba3[_0xb748('0x2f')]['limit']);_0x5c6aae['offset']=qs[_0xb748('0x1a')](_0x3e4ba3[_0xb748('0x2f')]['offset']);}_0x5c6aae[_0xb748('0x34')]=qs[_0xb748('0x35')](_0x3e4ba3[_0xb748('0x2f')]['sort']);_0x5c6aae[_0xb748('0x36')]=qs['filters'](_[_0xb748('0x37')](_0x3e4ba3[_0xb748('0x2f')],_0x4d73c6[_0xb748('0x38')]),_0x1a589e);if(_0x3e4ba3[_0xb748('0x2f')]['filter']){_0x5c6aae[_0xb748('0x36')]=_[_0xb748('0x39')](_0x5c6aae[_0xb748('0x36')],{'$or':_[_0xb748('0x2c')](_0x1a589e,function(_0x5eb823){if(_0x5eb823[_0xb748('0x29')]!=='VIRTUAL'){var _0x10d8b0={};_0x10d8b0[_0x5eb823[_0xb748('0x25')]]={'$like':'%'+_0x3e4ba3[_0xb748('0x2f')]['filter']+'%'};return _0x10d8b0;}})});}_0x5c6aae=_[_0xb748('0x39')]({},_0x5c6aae,_0x3e4ba3[_0xb748('0x3a')]);var _0x134c8b={'where':_0x5c6aae[_0xb748('0x36')]};return db[_0xb748('0x3b')]['count'](_0x134c8b)[_0xb748('0x20')](function(_0x598963){_0x5dab4d[_0xb748('0x1d')]=_0x598963;if(_0x3e4ba3[_0xb748('0x2f')]['includeAll']){_0x5c6aae['include']=[{'all':!![]}];}return db[_0xb748('0x3b')][_0xb748('0x3c')](_0x5c6aae);})[_0xb748('0x20')](function(_0x3312b9){_0x5dab4d[_0xb748('0x3d')]=_0x3312b9;return _0x5dab4d;})['then'](respondWithFilteredResult(_0x24cc3d,_0x5c6aae))[_0xb748('0x3e')](handleError(_0x24cc3d,null));};exports['show']=function(_0xe90e80,_0x2760b1){var _0x355122={'raw':!![],'where':{'id':_0xe90e80['params']['id']}},_0x5abecd={};_0x5abecd[_0xb748('0x2b')]=_[_0xb748('0x2d')](db['SquareOdbc'][_0xb748('0x27')]);_0x5abecd[_0xb748('0x2f')]=_[_0xb748('0x2d')](_0xe90e80[_0xb748('0x2f')]);_0x5abecd[_0xb748('0x38')]=_['intersection'](_0x5abecd[_0xb748('0x2b')],_0x5abecd['query']);_0x355122[_0xb748('0x30')]=_[_0xb748('0x2e')](_0x5abecd['model'],qs[_0xb748('0x31')](_0xe90e80[_0xb748('0x2f')][_0xb748('0x31')]));_0x355122[_0xb748('0x30')]=_0x355122['attributes'][_0xb748('0x3f')]?_0x355122[_0xb748('0x30')]:_0x5abecd[_0xb748('0x2b')];if(_0xe90e80[_0xb748('0x2f')][_0xb748('0x40')]){_0x355122[_0xb748('0x41')]=[{'all':!![]}];}_0x355122=_['merge']({},_0x355122,_0xe90e80[_0xb748('0x3a')]);return db[_0xb748('0x3b')]['find'](_0x355122)[_0xb748('0x20')](handleEntityNotFound(_0x2760b1,null))[_0xb748('0x20')](respondWithResult(_0x2760b1,null))[_0xb748('0x3e')](handleError(_0x2760b1,null));};exports[_0xb748('0x42')]=function(_0x38947c,_0x58d3a1){return db['SquareOdbc'][_0xb748('0x42')](_0x38947c[_0xb748('0x43')],{})[_0xb748('0x20')](function(_0x2303f5){var _0x6f0c38=_0x38947c['user'][_0xb748('0x21')]({'plain':!![]});if(!_0x6f0c38)throw new Error(_0xb748('0x44'));if(_0x6f0c38[_0xb748('0x45')]===_0xb748('0x46')){var _0xb9e5fb=_0x2303f5['get']({'plain':!![]});var _0x14dff2=_0xb748('0x22');return db[_0xb748('0x47')][_0xb748('0x48')]({'where':{'name':_0x14dff2,'userProfileId':_0x6f0c38[_0xb748('0x49')]},'raw':!![]})[_0xb748('0x20')](function(_0x2c0b6f){if(_0x2c0b6f&&_0x2c0b6f[_0xb748('0x4a')]===0x0){return db[_0xb748('0x4b')][_0xb748('0x42')]({'name':_0xb9e5fb[_0xb748('0x25')],'resourceId':_0xb9e5fb['id'],'type':_0x2c0b6f[_0xb748('0x25')],'sectionId':_0x2c0b6f['id']},{})[_0xb748('0x20')](function(){return _0x2303f5;});}else{return _0x2303f5;}})['catch'](function(_0x2f3b81){logger['error'](_0xb748('0x4c'),_0x2f3b81);throw _0x2f3b81;});}return _0x2303f5;})['then'](respondWithResult(_0x58d3a1,0xc9))[_0xb748('0x3e')](handleError(_0x58d3a1,null));};exports[_0xb748('0x4d')]=function(_0x136fb1,_0x4deab1){if(_0x136fb1['body']['id']){delete _0x136fb1['body']['id'];}return db[_0xb748('0x3b')][_0xb748('0x48')]({'where':{'id':_0x136fb1[_0xb748('0x4e')]['id']}})[_0xb748('0x20')](handleEntityNotFound(_0x4deab1,null))[_0xb748('0x20')](saveUpdates(_0x136fb1[_0xb748('0x43')],null))[_0xb748('0x20')](respondWithResult(_0x4deab1,null))[_0xb748('0x3e')](handleError(_0x4deab1,null));};exports[_0xb748('0x23')]=function(_0x3bacd4,_0x15108f){return db[_0xb748('0x3b')][_0xb748('0x48')]({'where':{'id':_0x3bacd4[_0xb748('0x4e')]['id']}})['then'](handleEntityNotFound(_0x15108f,null))[_0xb748('0x20')](removeEntity(_0x15108f,null))[_0xb748('0x3e')](handleError(_0x15108f,null));};exports[_0xb748('0x4f')]=function(_0x3e57b8,_0x3e2bca,_0xa0ae6a){var _0xa06429;return db[_0xb748('0x3b')][_0xb748('0x48')]({'where':{'id':_0x3e57b8['params']['id']},'attributes':['id',_0xb748('0x50')]})[_0xb748('0x20')](handleEntityNotFound(_0x3e2bca,null))[_0xb748('0x20')](function(_0x2a0ecf){if(_0x2a0ecf){var _0x57cd51=require(_0xb748('0x51'))();_0x57cd51[_0xb748('0x52')](_0x2a0ecf[_0xb748('0x50')]);_0x57cd51[_0xb748('0x53')]();return _0x2a0ecf;}})['then'](respondWithResult(_0x3e2bca,null))[_0xb748('0x3e')](handleError(_0x3e2bca,null));};
\ No newline at end of file
index bc93103..cfc4c34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9e0=['exports','define','square_odbc','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc9e0,0x193));var _0x0c9e=function(_0x2733d0,_0x3c44f5){_0x2733d0=_0x2733d0-0x0;var _0x2f886e=_0xc9e0[_0x2733d0];return _0x2f886e;};'use strict';var _=require(_0x0c9e('0x0'));var util=require('util');var logger=require(_0x0c9e('0x1'))('api');var moment=require(_0x0c9e('0x2'));var BPromise=require(_0x0c9e('0x3'));var rp=require(_0x0c9e('0x4'));var fs=require('fs');var path=require(_0x0c9e('0x5'));var rimraf=require('rimraf');var config=require(_0x0c9e('0x6'));var attributes=require('./squareOdbc.attributes');module[_0x0c9e('0x7')]=function(_0x36d068,_0x525a22){return _0x36d068[_0x0c9e('0x8')]('SquareOdbc',attributes,{'tableName':_0x0c9e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f47=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x1cd351,_0x4ff95b){var _0x82834a=function(_0x5b6161){while(--_0x5b6161){_0x1cd351['push'](_0x1cd351['shift']());}};_0x82834a(++_0x4ff95b);}(_0x8f47,0x118));var _0x78f4=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0x8f47[_0x4e0a03];return _0x2478fc;};'use strict';var _=require(_0x78f4('0x0'));var util=require(_0x78f4('0x1'));var logger=require(_0x78f4('0x2'))(_0x78f4('0x3'));var moment=require(_0x78f4('0x4'));var BPromise=require(_0x78f4('0x5'));var rp=require(_0x78f4('0x6'));var fs=require('fs');var path=require(_0x78f4('0x7'));var rimraf=require(_0x78f4('0x8'));var config=require(_0x78f4('0x9'));var attributes=require(_0x78f4('0xa'));module[_0x78f4('0xb')]=function(_0x47987e,_0x17eff6){return _0x47987e[_0x78f4('0xc')](_0x78f4('0xd'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fefcfee..faa5df2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b7=['ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xf7b7,0x123));var _0x7f7b=function(_0x159bf8,_0x11c08e){_0x159bf8=_0x159bf8-0x0;var _0x1f6900=_0xf7b7[_0x159bf8];return _0x1f6900;};'use strict';var _=require(_0x7f7b('0x0'));var util=require(_0x7f7b('0x1'));var moment=require(_0x7f7b('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f7b('0x3'));var fs=require('fs');var Redis=require(_0x7f7b('0x4'));var db=require(_0x7f7b('0x5'))['db'];var utils=require(_0x7f7b('0x6'));var logger=require(_0x7f7b('0x7'))(_0x7f7b('0x8'));var config=require(_0x7f7b('0x9'));var jayson=require(_0x7f7b('0xa'));var client=jayson[_0x7f7b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2604d3,_0x365bb9,_0x5d353c){return new BPromise(function(_0x58b3bf,_0x129c37){return client[_0x7f7b('0xc')](_0x2604d3,_0x5d353c)['then'](function(_0x3c6849){logger[_0x7f7b('0xd')](_0x7f7b('0xe'),_0x365bb9,'request\x20sent');logger[_0x7f7b('0xf')](_0x7f7b('0x10'),_0x365bb9,_0x7f7b('0x11'),JSON[_0x7f7b('0x12')](_0x3c6849));if(_0x3c6849[_0x7f7b('0x13')]){if(_0x3c6849[_0x7f7b('0x13')][_0x7f7b('0x14')]===0x1f4){logger['error'](_0x7f7b('0xe'),_0x365bb9,_0x3c6849[_0x7f7b('0x13')]['message']);return _0x129c37(_0x3c6849[_0x7f7b('0x13')]['message']);}logger[_0x7f7b('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x365bb9,_0x3c6849[_0x7f7b('0x13')][_0x7f7b('0x15')]);return _0x58b3bf(_0x3c6849[_0x7f7b('0x13')][_0x7f7b('0x15')]);}else{logger[_0x7f7b('0xd')](_0x7f7b('0xe'),_0x365bb9,_0x7f7b('0x11'));_0x58b3bf(_0x3c6849[_0x7f7b('0x16')]['message']);}})[_0x7f7b('0x17')](function(_0x1c7d4a){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x365bb9,_0x1c7d4a);_0x129c37(_0x1c7d4a);});});}exports[_0x7f7b('0x18')]=function(_0x832fdc){var _0x251360=this;return new Promise(function(_0x2b2357,_0x3f35e9){return db[_0x7f7b('0x19')][_0x7f7b('0x1a')]({'raw':_0x832fdc[_0x7f7b('0x1b')]?_0x832fdc[_0x7f7b('0x1b')][_0x7f7b('0x1c')]===undefined?!![]:![]:!![],'where':_0x832fdc[_0x7f7b('0x1b')]?_0x832fdc[_0x7f7b('0x1b')][_0x7f7b('0x1d')]||null:null,'attributes':_0x832fdc[_0x7f7b('0x1b')]?_0x832fdc[_0x7f7b('0x1b')][_0x7f7b('0x1e')]||null:null,'include':_0x832fdc[_0x7f7b('0x1b')]?_0x832fdc[_0x7f7b('0x1b')][_0x7f7b('0x1f')]?_[_0x7f7b('0x20')](_0x832fdc[_0x7f7b('0x1b')][_0x7f7b('0x1f')],function(_0x56dcb8){return{'model':db[_0x56dcb8[_0x7f7b('0x21')]],'as':_0x56dcb8['as'],'attributes':_0x56dcb8[_0x7f7b('0x1e')],'include':_0x56dcb8['include']?_[_0x7f7b('0x20')](_0x56dcb8[_0x7f7b('0x1f')],function(_0x16c39c){return{'model':db[_0x16c39c['model']],'as':_0x16c39c['as'],'attributes':_0x16c39c[_0x7f7b('0x1e')],'include':_0x16c39c['include']?_[_0x7f7b('0x20')](_0x16c39c['include'],function(_0x387e32){return{'model':db[_0x387e32[_0x7f7b('0x21')]],'as':_0x387e32['as'],'attributes':_0x387e32[_0x7f7b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7f7b('0x22')](function(_0x21419e){logger['info'](_0x7f7b('0x18'),_0x832fdc);logger[_0x7f7b('0xf')](_0x7f7b('0x18'),_0x832fdc,JSON[_0x7f7b('0x12')](_0x21419e));_0x2b2357(_0x21419e);})[_0x7f7b('0x17')](function(_0x5931ad){logger[_0x7f7b('0x13')](_0x7f7b('0x18'),_0x5931ad[_0x7f7b('0x15')],_0x832fdc);_0x3f35e9(_0x251360[_0x7f7b('0x13')](0x1f4,_0x5931ad['message']));});});};
\ No newline at end of file
+var _0x987e=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','options','raw','where','include','map','model','attributes','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xbd47fe,_0x2b1dff){var _0x207718=function(_0x1d168e){while(--_0x1d168e){_0xbd47fe['push'](_0xbd47fe['shift']());}};_0x207718(++_0x2b1dff);}(_0x987e,0x144));var _0xe987=function(_0x377cc8,_0x2f4f4d){_0x377cc8=_0x377cc8-0x0;var _0x4829ed=_0x987e[_0x377cc8];return _0x4829ed;};'use strict';var _=require(_0xe987('0x0'));var util=require(_0xe987('0x1'));var moment=require(_0xe987('0x2'));var BPromise=require(_0xe987('0x3'));var rs=require(_0xe987('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe987('0x5'))['db'];var utils=require(_0xe987('0x6'));var logger=require(_0xe987('0x7'))(_0xe987('0x8'));var config=require('../../config/environment');var jayson=require(_0xe987('0x9'));var client=jayson[_0xe987('0xa')][_0xe987('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc1e15d,_0x45862d,_0x3a6e27){return new BPromise(function(_0x3aa58a,_0xcc08cc){return client[_0xe987('0xc')](_0xc1e15d,_0x3a6e27)[_0xe987('0xd')](function(_0x3dd74d){logger['info'](_0xe987('0xe'),_0x45862d,_0xe987('0xf'));logger['debug'](_0xe987('0x10'),_0x45862d,'request\x20sent',JSON[_0xe987('0x11')](_0x3dd74d));if(_0x3dd74d[_0xe987('0x12')]){if(_0x3dd74d['error'][_0xe987('0x13')]===0x1f4){logger['error'](_0xe987('0xe'),_0x45862d,_0x3dd74d['error'][_0xe987('0x14')]);return _0xcc08cc(_0x3dd74d[_0xe987('0x12')]['message']);}logger['error'](_0xe987('0xe'),_0x45862d,_0x3dd74d['error'][_0xe987('0x14')]);return _0x3aa58a(_0x3dd74d['error']['message']);}else{logger[_0xe987('0x15')](_0xe987('0xe'),_0x45862d,_0xe987('0xf'));_0x3aa58a(_0x3dd74d[_0xe987('0x16')]['message']);}})[_0xe987('0x17')](function(_0x536f0e){logger[_0xe987('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x45862d,_0x536f0e);_0xcc08cc(_0x536f0e);});});}exports[_0xe987('0x18')]=function(_0x15a61e){var _0x113e18=this;return new Promise(function(_0x57cdf9,_0x5d65bd){return db['SquareOdbc']['find']({'raw':_0x15a61e[_0xe987('0x19')]?_0x15a61e['options'][_0xe987('0x1a')]===undefined?!![]:![]:!![],'where':_0x15a61e[_0xe987('0x19')]?_0x15a61e[_0xe987('0x19')][_0xe987('0x1b')]||null:null,'attributes':_0x15a61e['options']?_0x15a61e['options']['attributes']||null:null,'include':_0x15a61e[_0xe987('0x19')]?_0x15a61e[_0xe987('0x19')][_0xe987('0x1c')]?_[_0xe987('0x1d')](_0x15a61e[_0xe987('0x19')][_0xe987('0x1c')],function(_0x12bde4){return{'model':db[_0x12bde4[_0xe987('0x1e')]],'as':_0x12bde4['as'],'attributes':_0x12bde4[_0xe987('0x1f')],'include':_0x12bde4[_0xe987('0x1c')]?_[_0xe987('0x1d')](_0x12bde4[_0xe987('0x1c')],function(_0x266a93){return{'model':db[_0x266a93[_0xe987('0x1e')]],'as':_0x266a93['as'],'attributes':_0x266a93[_0xe987('0x1f')],'include':_0x266a93['include']?_[_0xe987('0x1d')](_0x266a93[_0xe987('0x1c')],function(_0x510f4b){return{'model':db[_0x510f4b[_0xe987('0x1e')]],'as':_0x510f4b['as'],'attributes':_0x510f4b[_0xe987('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe987('0xd')](function(_0xbbd441){logger[_0xe987('0x15')]('ShowSquareOdbc',_0x15a61e);logger[_0xe987('0x20')](_0xe987('0x18'),_0x15a61e,JSON[_0xe987('0x11')](_0xbbd441));_0x57cdf9(_0xbbd441);})[_0xe987('0x17')](function(_0x58b2d9){logger[_0xe987('0x12')]('ShowSquareOdbc',_0x58b2d9['message'],_0x15a61e);_0x5d65bd(_0x113e18['error'](0x1f4,_0x58b2d9[_0xe987('0x14')]));});});};
\ No newline at end of file
index 8d865ea..113e261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5800=['addUsers','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x5800,0x1b9));var _0x0580=function(_0x24d7a0,_0x575af){_0x24d7a0=_0x24d7a0-0x0;var _0x233885=_0x5800[_0x24d7a0];return _0x233885;};'use strict';var multer=require('multer');var util=require(_0x0580('0x0'));var path=require(_0x0580('0x1'));var timeout=require(_0x0580('0x2'));var express=require(_0x0580('0x3'));var router=express['Router']();var fs_extra=require(_0x0580('0x4'));var auth=require(_0x0580('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0580('0x6'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x0580('0x7')](),controller[_0x0580('0x8')]);router['get'](_0x0580('0x9'),auth['isAuthenticated'](),controller[_0x0580('0xa')]);router['get'](_0x0580('0xb'),auth[_0x0580('0x7')](),controller[_0x0580('0xc')]);router[_0x0580('0xd')]('/',auth[_0x0580('0x7')](),controller[_0x0580('0xe')]);router[_0x0580('0xd')](_0x0580('0xb'),auth['isAuthenticated'](),controller[_0x0580('0xf')]);router[_0x0580('0x10')](_0x0580('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x0580('0x11')](_0x0580('0x9'),auth[_0x0580('0x7')](),controller['destroy']);router[_0x0580('0x11')](_0x0580('0xb'),auth[_0x0580('0x7')](),controller['removeUsers']);module[_0x0580('0x12')]=router;
\ No newline at end of file
+var _0xb8cb=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/users','getUsers','post','create','put','/:id','update','delete','destroy','removeUsers'];(function(_0x3a08a5,_0x19c919){var _0x3d18e5=function(_0x435f56){while(--_0x435f56){_0x3a08a5['push'](_0x3a08a5['shift']());}};_0x3d18e5(++_0x19c919);}(_0xb8cb,0xd9));var _0xbb8c=function(_0xaedb7e,_0x509620){_0xaedb7e=_0xaedb7e-0x0;var _0x15d977=_0xb8cb[_0xaedb7e];return _0x15d977;};'use strict';var multer=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var path=require(_0xbb8c('0x2'));var timeout=require(_0xbb8c('0x3'));var express=require(_0xbb8c('0x4'));var router=express[_0xbb8c('0x5')]();var fs_extra=require(_0xbb8c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbb8c('0x7'));var config=require(_0xbb8c('0x8'));var controller=require('./squareProject.controller');router['get']('/',auth[_0xbb8c('0x9')](),controller[_0xbb8c('0xa')]);router[_0xbb8c('0xb')]('/:id',auth[_0xbb8c('0x9')](),controller[_0xbb8c('0xc')]);router[_0xbb8c('0xb')](_0xbb8c('0xd'),auth[_0xbb8c('0x9')](),controller[_0xbb8c('0xe')]);router[_0xbb8c('0xf')]('/',auth[_0xbb8c('0x9')](),controller[_0xbb8c('0x10')]);router[_0xbb8c('0xf')](_0xbb8c('0xd'),auth[_0xbb8c('0x9')](),controller['addUsers']);router[_0xbb8c('0x11')](_0xbb8c('0x12'),auth[_0xbb8c('0x9')](),controller[_0xbb8c('0x13')]);router[_0xbb8c('0x14')]('/:id',auth[_0xbb8c('0x9')](),controller[_0xbb8c('0x15')]);router[_0xbb8c('0x14')](_0xbb8c('0xd'),auth[_0xbb8c('0x9')](),controller[_0xbb8c('0x16')]);module[_0xbb8c('0x17')]=router;
\ No newline at end of file
index b9b8559..fa92832 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ee=['DATE','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production'];(function(_0x10e79d,_0x3a0510){var _0x4b871e=function(_0x315cf4){while(--_0x315cf4){_0x10e79d['push'](_0x10e79d['shift']());}};_0x4b871e(++_0x3a0510);}(_0x57ee,0x199));var _0xe57e=function(_0x25e651,_0x47cb4f){_0x25e651=_0x25e651-0x0;var _0x46c3d3=_0x57ee[_0x25e651];return _0x46c3d3;};'use strict';var Sequelize=require(_0xe57e('0x0'));module[_0xe57e('0x1')]={'name':{'type':Sequelize[_0xe57e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xe57e('0x2')]},'notes':{'type':Sequelize[_0xe57e('0x3')]},'preproduction':{'type':Sequelize[_0xe57e('0x4')](_0xe57e('0x5')),'get':function(){if(this[_0xe57e('0x6')](_0xe57e('0x7'))){return this['getDataValue'](_0xe57e('0x7'))[_0xe57e('0x8')](_0xe57e('0x9'));}}},'production':{'type':Sequelize[_0xe57e('0x4')](_0xe57e('0x5')),'get':function(){if(this['getDataValue'](_0xe57e('0xa'))){return this[_0xe57e('0x6')](_0xe57e('0xa'))[_0xe57e('0x8')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xe57e('0xb')]}};
\ No newline at end of file
+var _0xb067=['toString','utf8','production','exports','STRING','name','TEXT','long','getDataValue','preproduction'];(function(_0x1e57dc,_0x646ed7){var _0x3f78ff=function(_0x11daab){while(--_0x11daab){_0x1e57dc['push'](_0x1e57dc['shift']());}};_0x3f78ff(++_0x646ed7);}(_0xb067,0xc1));var _0x7b06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb067[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7b06('0x0')]={'name':{'type':Sequelize[_0x7b06('0x1')],'unique':_0x7b06('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x7b06('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x7b06('0x4')),'get':function(){if(this[_0x7b06('0x5')](_0x7b06('0x6'))){return this[_0x7b06('0x5')](_0x7b06('0x6'))[_0x7b06('0x7')](_0x7b06('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue']('production')){return this[_0x7b06('0x5')](_0x7b06('0x9'))[_0x7b06('0x7')](_0x7b06('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index e80a45c..3bde3d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fcf=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','stack','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','isArray','emit','userSquareProject:remove','getUsers','findOne','eml-format'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x1fcf,0x193));var _0xf1fc=function(_0x3f9024,_0x48d0e5){_0x3f9024=_0x3f9024-0x0;var _0x3c931c=_0x1fcf[_0x3f9024];return _0x3c931c;};'use strict';var emlformat=require(_0xf1fc('0x0'));var rimraf=require(_0xf1fc('0x1'));var zipdir=require(_0xf1fc('0x2'));var jsonpatch=require(_0xf1fc('0x3'));var rp=require(_0xf1fc('0x4'));var moment=require(_0xf1fc('0x5'));var BPromise=require(_0xf1fc('0x6'));var Mustache=require(_0xf1fc('0x7'));var util=require(_0xf1fc('0x8'));var path=require(_0xf1fc('0x9'));var sox=require('sox');var csv=require(_0xf1fc('0xa'));var ejs=require(_0xf1fc('0xb'));var fs=require('fs');var fs_extra=require(_0xf1fc('0xc'));var _=require(_0xf1fc('0xd'));var squel=require(_0xf1fc('0xe'));var crypto=require(_0xf1fc('0xf'));var jsforce=require(_0xf1fc('0x10'));var deskjs=require(_0xf1fc('0x11'));var toCsv=require(_0xf1fc('0xa'));var querystring=require(_0xf1fc('0x12'));var Papa=require(_0xf1fc('0x13'));var Redis=require(_0xf1fc('0x14'));var authService=require(_0xf1fc('0x15'));var qs=require(_0xf1fc('0x16'));var as=require(_0xf1fc('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1fc('0x18'))('api');var utils=require(_0xf1fc('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf1fc('0x1a'));var db=require(_0xf1fc('0x1b'))['db'];config['redis']=_[_0xf1fc('0x1c')](config[_0xf1fc('0x1d')],{'host':_0xf1fc('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1fc('0x1d')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x5e0369,_0x583c94){_0x583c94=_0x583c94||0xcc;return function(_0x3ade9e){if(_0x3ade9e){return _0x5e0369[_0xf1fc('0x1f')](_0x583c94);}return _0x5e0369['status'](_0x583c94)[_0xf1fc('0x20')]();};}function respondWithResult(_0x555b4c,_0xd0c4e0){_0xd0c4e0=_0xd0c4e0||0xc8;return function(_0x152396){if(_0x152396){return _0x555b4c[_0xf1fc('0x21')](_0xd0c4e0)[_0xf1fc('0x22')](_0x152396);}};}function respondWithFilteredResult(_0xb7dcfd,_0x4d0520){return function(_0xb4e477){if(_0xb4e477){var _0x2981a2=typeof _0x4d0520[_0xf1fc('0x23')]==='undefined'&&typeof _0x4d0520[_0xf1fc('0x24')]===_0xf1fc('0x25');var _0x305fb0=_0xb4e477['count'];var _0x24eee2=_0x2981a2?0x0:_0x4d0520[_0xf1fc('0x23')];var _0x46b5fa=_0x2981a2?_0xb4e477[_0xf1fc('0x26')]:_0x4d0520[_0xf1fc('0x23')]+_0x4d0520[_0xf1fc('0x24')];var _0x27bfb5;if(_0x46b5fa>=_0x305fb0){_0x46b5fa=_0x305fb0;_0x27bfb5=0xc8;}else{_0x27bfb5=0xce;}_0xb7dcfd[_0xf1fc('0x21')](_0x27bfb5);return _0xb7dcfd[_0xf1fc('0x27')](_0xf1fc('0x28'),_0x24eee2+'-'+_0x46b5fa+'/'+_0x305fb0)[_0xf1fc('0x22')](_0xb4e477);}return null;};}function patchUpdates(_0x508007){return function(_0x22a292){try{jsonpatch[_0xf1fc('0x29')](_0x22a292,_0x508007,!![]);}catch(_0x5bdf38){return BPromise['reject'](_0x5bdf38);}return _0x22a292[_0xf1fc('0x2a')]();};}function saveUpdates(_0x7c250f,_0x156c75){return function(_0xd71699){if(_0xd71699){return _0xd71699[_0xf1fc('0x2b')](_0x7c250f)['then'](function(_0x10e03f){return _0x10e03f;});}return null;};}function removeEntity(_0x46e77c,_0x325217){return function(_0xf14985){if(_0xf14985){return _0xf14985[_0xf1fc('0x2c')]()['then'](function(){var _0x2a5299=_0xf14985['get']({'plain':!![]});var _0x46a482='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0x46a482,'resourceId':_0x2a5299['id']}})[_0xf1fc('0x2d')](function(){return _0xf14985;});})[_0xf1fc('0x2d')](function(){_0x46e77c[_0xf1fc('0x21')](0xcc)[_0xf1fc('0x20')]();});}};}function handleEntityNotFound(_0x296077,_0x1eb7ff){return function(_0x2886fb){if(!_0x2886fb){_0x296077[_0xf1fc('0x1f')](0x194);}return _0x2886fb;};}function handleError(_0x2d518f,_0x1997b3){_0x1997b3=_0x1997b3||0x1f4;return function(_0x54532b){logger['error'](_0x54532b[_0xf1fc('0x2e')]);if(_0x54532b['name']){delete _0x54532b['name'];}_0x2d518f[_0xf1fc('0x21')](_0x1997b3)[_0xf1fc('0x2f')](_0x54532b);};}exports[_0xf1fc('0x30')]=function(_0x4da4d5,_0x260d37){var _0x32b74c={},_0x18f182={},_0x68d968={'count':0x0,'rows':[]};var _0x52856f=_[_0xf1fc('0x31')](db[_0xf1fc('0x32')][_0xf1fc('0x33')],function(_0xd7e01){return{'name':_0xd7e01[_0xf1fc('0x34')],'type':_0xd7e01[_0xf1fc('0x35')][_0xf1fc('0x36')]};});_0x18f182[_0xf1fc('0x37')]=_[_0xf1fc('0x31')](_0x52856f,_0xf1fc('0x38'));_0x18f182['query']=_[_0xf1fc('0x39')](_0x4da4d5[_0xf1fc('0x3a')]);_0x18f182[_0xf1fc('0x3b')]=_[_0xf1fc('0x3c')](_0x18f182[_0xf1fc('0x37')],_0x18f182['query']);_0x32b74c[_0xf1fc('0x3d')]=_['intersection'](_0x18f182[_0xf1fc('0x37')],qs[_0xf1fc('0x3e')](_0x4da4d5[_0xf1fc('0x3a')][_0xf1fc('0x3e')]));_0x32b74c[_0xf1fc('0x3d')]=_0x32b74c[_0xf1fc('0x3d')][_0xf1fc('0x3f')]?_0x32b74c[_0xf1fc('0x3d')]:_0x18f182[_0xf1fc('0x37')];if(!_0x4da4d5['query']['hasOwnProperty'](_0xf1fc('0x40'))){_0x32b74c[_0xf1fc('0x24')]=qs[_0xf1fc('0x24')](_0x4da4d5[_0xf1fc('0x3a')]['limit']);_0x32b74c[_0xf1fc('0x23')]=qs[_0xf1fc('0x23')](_0x4da4d5[_0xf1fc('0x3a')][_0xf1fc('0x23')]);}_0x32b74c[_0xf1fc('0x41')]=qs[_0xf1fc('0x42')](_0x4da4d5['query']['sort']);_0x32b74c[_0xf1fc('0x43')]=qs[_0xf1fc('0x3b')](_[_0xf1fc('0x44')](_0x4da4d5[_0xf1fc('0x3a')],_0x18f182[_0xf1fc('0x3b')]),_0x52856f);if(_0x4da4d5['query'][_0xf1fc('0x45')]){_0x32b74c['where']=_[_0xf1fc('0x46')](_0x32b74c['where'],{'$or':_[_0xf1fc('0x31')](_0x52856f,function(_0x2d11e4){if(_0x2d11e4['type']!==_0xf1fc('0x47')){var _0x4f3b19={};_0x4f3b19[_0x2d11e4['name']]={'$like':'%'+_0x4da4d5[_0xf1fc('0x3a')][_0xf1fc('0x45')]+'%'};return _0x4f3b19;}})});}_0x32b74c=_['merge']({},_0x32b74c,_0x4da4d5[_0xf1fc('0x48')]);var _0x317199={'where':_0x32b74c['where']};return db[_0xf1fc('0x32')][_0xf1fc('0x26')](_0x317199)[_0xf1fc('0x2d')](function(_0x2848bc){_0x68d968['count']=_0x2848bc;if(_0x4da4d5[_0xf1fc('0x3a')][_0xf1fc('0x49')]){_0x32b74c[_0xf1fc('0x4a')]=[{'all':!![]}];}return db[_0xf1fc('0x32')][_0xf1fc('0x4b')](_0x32b74c);})['then'](function(_0x33d9ed){_0x68d968[_0xf1fc('0x4c')]=_0x33d9ed;return _0x68d968;})[_0xf1fc('0x2d')](respondWithFilteredResult(_0x260d37,_0x32b74c))['catch'](handleError(_0x260d37,null));};exports['show']=function(_0x772853,_0x1487b7){var _0x2bfa1f={'raw':![],'where':{'id':_0x772853[_0xf1fc('0x4d')]['id']}},_0x4dc787={};_0x4dc787['model']=_['keys'](db[_0xf1fc('0x32')][_0xf1fc('0x33')]);_0x4dc787[_0xf1fc('0x3a')]=_[_0xf1fc('0x39')](_0x772853[_0xf1fc('0x3a')]);_0x4dc787[_0xf1fc('0x3b')]=_[_0xf1fc('0x3c')](_0x4dc787[_0xf1fc('0x37')],_0x4dc787[_0xf1fc('0x3a')]);_0x2bfa1f[_0xf1fc('0x3d')]=_[_0xf1fc('0x3c')](_0x4dc787[_0xf1fc('0x37')],qs['fields'](_0x772853[_0xf1fc('0x3a')]['fields']));_0x2bfa1f['attributes']=_0x2bfa1f[_0xf1fc('0x3d')][_0xf1fc('0x3f')]?_0x2bfa1f[_0xf1fc('0x3d')]:_0x4dc787[_0xf1fc('0x37')];if(_0x772853[_0xf1fc('0x3a')][_0xf1fc('0x49')]){_0x2bfa1f['include']=[{'all':!![]}];}_0x2bfa1f=_['merge']({},_0x2bfa1f,_0x772853[_0xf1fc('0x48')]);return db[_0xf1fc('0x32')][_0xf1fc('0x4e')](_0x2bfa1f)['then'](handleEntityNotFound(_0x1487b7,null))[_0xf1fc('0x2d')](respondWithResult(_0x1487b7,null))[_0xf1fc('0x4f')](handleError(_0x1487b7,null));};exports[_0xf1fc('0x50')]=function(_0x4f62d7,_0x5c1877){return db[_0xf1fc('0x32')][_0xf1fc('0x50')](_0x4f62d7['body'],{})[_0xf1fc('0x2d')](function(_0x23835c){var _0x3ce3e3=_0x4f62d7[_0xf1fc('0x51')][_0xf1fc('0x52')]({'plain':!![]});if(!_0x3ce3e3)throw new Error(_0xf1fc('0x53'));if(_0x3ce3e3[_0xf1fc('0x54')]===_0xf1fc('0x51')){var _0x5d1b75=_0x23835c['get']({'plain':!![]});var _0x5f1b35=_0xf1fc('0x55');return db[_0xf1fc('0x56')]['find']({'where':{'name':_0x5f1b35,'userProfileId':_0x3ce3e3[_0xf1fc('0x57')]},'raw':!![]})[_0xf1fc('0x2d')](function(_0x370ba6){if(_0x370ba6&&_0x370ba6[_0xf1fc('0x58')]===0x0){return db[_0xf1fc('0x59')][_0xf1fc('0x50')]({'name':_0x5d1b75['name'],'resourceId':_0x5d1b75['id'],'type':_0x370ba6[_0xf1fc('0x38')],'sectionId':_0x370ba6['id']},{})['then'](function(){return _0x23835c;});}else{return _0x23835c;}})[_0xf1fc('0x4f')](function(_0x38bba5){logger[_0xf1fc('0x5a')](_0xf1fc('0x5b'),_0x38bba5);throw _0x38bba5;});}return _0x23835c;})[_0xf1fc('0x2d')](respondWithResult(_0x5c1877,0xc9))[_0xf1fc('0x4f')](handleError(_0x5c1877,null));};exports[_0xf1fc('0x2b')]=function(_0x191974,_0x64fa4){if(_0x191974[_0xf1fc('0x5c')]['id']){delete _0x191974['body']['id'];}return db[_0xf1fc('0x32')]['find']({'where':{'id':_0x191974[_0xf1fc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x64fa4,null))[_0xf1fc('0x2d')](saveUpdates(_0x191974[_0xf1fc('0x5c')],null))['then'](respondWithResult(_0x64fa4,null))[_0xf1fc('0x4f')](handleError(_0x64fa4,null));};exports[_0xf1fc('0x2c')]=function(_0x2ff455,_0x18535f){return db[_0xf1fc('0x32')][_0xf1fc('0x4e')]({'where':{'id':_0x2ff455['params']['id']}})[_0xf1fc('0x2d')](handleEntityNotFound(_0x18535f,null))[_0xf1fc('0x2d')](removeEntity(_0x18535f,null))[_0xf1fc('0x4f')](handleError(_0x18535f,null));};exports[_0xf1fc('0x5d')]=function(_0x4b0297,_0x3e13e7,_0x469605){return db['SquareProject'][_0xf1fc('0x4e')]({'where':{'id':_0x4b0297['params']['id']}})[_0xf1fc('0x2d')](handleEntityNotFound(_0x3e13e7,null))['then'](function(_0x257376){if(_0x257376){return _0x257376[_0xf1fc('0x5d')](_0x4b0297[_0xf1fc('0x5c')][_0xf1fc('0x5e')],_[_0xf1fc('0x5f')](_0x4b0297[_0xf1fc('0x5c')],[_0xf1fc('0x5e'),'id'])||{});}})[_0xf1fc('0x2d')](respondWithResult(_0x3e13e7,null))[_0xf1fc('0x4f')](handleError(_0x3e13e7,null));};exports['removeUsers']=function(_0x37e5a6,_0x37fd10,_0x58ed98){return db[_0xf1fc('0x32')]['find']({'where':{'id':_0x37e5a6['params']['id']}})[_0xf1fc('0x2d')](handleEntityNotFound(_0x37fd10,null))['then'](function(_0x143913){if(_0x143913){return _0x143913['removeUsers'](_0x37e5a6[_0xf1fc('0x3a')]['ids'])[_0xf1fc('0x2d')](function(){if(_[_0xf1fc('0x60')](_0x37e5a6['query']['ids'])){for(var _0x4264b4=0x0;_0x4264b4<_0x37e5a6['query'][_0xf1fc('0x5e')][_0xf1fc('0x3f')];_0x4264b4+=0x1){socket[_0xf1fc('0x61')]('userSquareProject:remove',{'UserId':Number(_0x37e5a6[_0xf1fc('0x3a')][_0xf1fc('0x5e')][_0x4264b4]),'SquareProjectId':Number(_0x37e5a6['params']['id'])});}}else{socket['emit'](_0xf1fc('0x62'),{'UserId':Number(_0x37e5a6['query'][_0xf1fc('0x5e')]),'SquareProjectId':Number(_0x37e5a6[_0xf1fc('0x4d')]['id'])});}});}})[_0xf1fc('0x2d')](respondWithStatusCode(_0x37fd10,null))['catch'](handleError(_0x37fd10,null));};exports[_0xf1fc('0x63')]=function(_0x2dbb4a,_0x11bede,_0x2fd199){var _0x2f1e42={};var _0x212fa5={};var _0x2cab0b;var _0x3abd12;return db[_0xf1fc('0x32')][_0xf1fc('0x64')]({'where':{'id':_0x2dbb4a[_0xf1fc('0x4d')]['id']}})[_0xf1fc('0x2d')](handleEntityNotFound(_0x11bede,null))['then'](function(_0x5ec43d){if(_0x5ec43d){_0x2cab0b=_0x5ec43d;_0x212fa5['model']=_[_0xf1fc('0x39')](db['User'][_0xf1fc('0x33')]);_0x212fa5[_0xf1fc('0x3a')]=_['keys'](_0x2dbb4a[_0xf1fc('0x3a')]);_0x212fa5[_0xf1fc('0x3b')]=_['intersection'](_0x212fa5[_0xf1fc('0x37')],_0x212fa5[_0xf1fc('0x3a')]);_0x2f1e42[_0xf1fc('0x3d')]=_[_0xf1fc('0x3c')](_0x212fa5[_0xf1fc('0x37')],qs['fields'](_0x2dbb4a['query']['fields']));_0x2f1e42['attributes']=_0x2f1e42[_0xf1fc('0x3d')][_0xf1fc('0x3f')]?_0x2f1e42[_0xf1fc('0x3d')]:_0x212fa5[_0xf1fc('0x37')];_0x2f1e42[_0xf1fc('0x41')]=qs['sort'](_0x2dbb4a[_0xf1fc('0x3a')][_0xf1fc('0x42')]);_0x2f1e42['where']=qs[_0xf1fc('0x3b')](_[_0xf1fc('0x44')](_0x2dbb4a[_0xf1fc('0x3a')],_0x212fa5[_0xf1fc('0x3b')]));if(_0x2dbb4a[_0xf1fc('0x3a')][_0xf1fc('0x45')]){_0x2f1e42[_0xf1fc('0x43')]=_[_0xf1fc('0x46')](_0x2f1e42[_0xf1fc('0x43')],{'$or':_['map'](_0x2f1e42['attributes'],function(_0x89e276){var _0x2255f={};_0x2255f[_0x89e276]={'$like':'%'+_0x2dbb4a[_0xf1fc('0x3a')][_0xf1fc('0x45')]+'%'};return _0x2255f;})});}_0x2f1e42=_[_0xf1fc('0x46')]({},_0x2f1e42,_0x2dbb4a[_0xf1fc('0x48')]);return _0x2cab0b[_0xf1fc('0x63')](_0x2f1e42);}})['then'](function(_0x3a8a1e){if(_0x3a8a1e){_0x3abd12=_0x3a8a1e[_0xf1fc('0x3f')];if(!_0x2dbb4a[_0xf1fc('0x3a')]['hasOwnProperty'](_0xf1fc('0x40'))){_0x2f1e42[_0xf1fc('0x24')]=qs['limit'](_0x2dbb4a[_0xf1fc('0x3a')]['limit']);_0x2f1e42['offset']=qs[_0xf1fc('0x23')](_0x2dbb4a[_0xf1fc('0x3a')][_0xf1fc('0x23')]);}return _0x2cab0b['getUsers'](_0x2f1e42);}})[_0xf1fc('0x2d')](function(_0xd521b7){if(_0xd521b7){return _0xd521b7?{'count':_0x3abd12,'rows':_0xd521b7}:null;}})[_0xf1fc('0x2d')](respondWithResult(_0x11bede,null))['catch'](handleError(_0x11bede,null));};
\ No newline at end of file
+var _0x6e12=['offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','SquareProjects','end','error','stack','name','index','SquareProject','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','User','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','./squareProject.socket','register','sendStatus','status','json'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x6e12,0xf9));var _0x26e1=function(_0x59a383,_0x5afa5e){_0x59a383=_0x59a383-0x0;var _0x3c7638=_0x6e12[_0x59a383];return _0x3c7638;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26e1('0x0'));var zipdir=require(_0x26e1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x26e1('0x2'));var BPromise=require(_0x26e1('0x3'));var Mustache=require(_0x26e1('0x4'));var util=require('util');var path=require(_0x26e1('0x5'));var sox=require(_0x26e1('0x6'));var csv=require(_0x26e1('0x7'));var ejs=require(_0x26e1('0x8'));var fs=require('fs');var fs_extra=require(_0x26e1('0x9'));var _=require(_0x26e1('0xa'));var squel=require(_0x26e1('0xb'));var crypto=require(_0x26e1('0xc'));var jsforce=require(_0x26e1('0xd'));var deskjs=require(_0x26e1('0xe'));var toCsv=require(_0x26e1('0x7'));var querystring=require('querystring');var Papa=require(_0x26e1('0xf'));var Redis=require(_0x26e1('0x10'));var authService=require(_0x26e1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x26e1('0x12'));var hardwareService=require(_0x26e1('0x13'));var logger=require(_0x26e1('0x14'))(_0x26e1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26e1('0x16'))['db'];config['redis']=_['defaults'](config[_0x26e1('0x17')],{'host':_0x26e1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26e1('0x17')]));require(_0x26e1('0x19'))[_0x26e1('0x1a')](socket);function respondWithStatusCode(_0x1feb63,_0x2006b3){_0x2006b3=_0x2006b3||0xcc;return function(_0x5b35aa){if(_0x5b35aa){return _0x1feb63[_0x26e1('0x1b')](_0x2006b3);}return _0x1feb63['status'](_0x2006b3)['end']();};}function respondWithResult(_0x3abb14,_0x24416c){_0x24416c=_0x24416c||0xc8;return function(_0x117aaa){if(_0x117aaa){return _0x3abb14[_0x26e1('0x1c')](_0x24416c)[_0x26e1('0x1d')](_0x117aaa);}};}function respondWithFilteredResult(_0xb57bef,_0x3e6ff2){return function(_0x3f7645){if(_0x3f7645){var _0x270cf2=typeof _0x3e6ff2[_0x26e1('0x1e')]===_0x26e1('0x1f')&&typeof _0x3e6ff2[_0x26e1('0x20')]===_0x26e1('0x1f');var _0x53616b=_0x3f7645[_0x26e1('0x21')];var _0x466ea4=_0x270cf2?0x0:_0x3e6ff2['offset'];var _0x13af18=_0x270cf2?_0x3f7645[_0x26e1('0x21')]:_0x3e6ff2[_0x26e1('0x1e')]+_0x3e6ff2['limit'];var _0x117901;if(_0x13af18>=_0x53616b){_0x13af18=_0x53616b;_0x117901=0xc8;}else{_0x117901=0xce;}_0xb57bef[_0x26e1('0x1c')](_0x117901);return _0xb57bef['set'](_0x26e1('0x22'),_0x466ea4+'-'+_0x13af18+'/'+_0x53616b)['json'](_0x3f7645);}return null;};}function patchUpdates(_0x193a2d){return function(_0x3b3be0){try{jsonpatch['apply'](_0x3b3be0,_0x193a2d,!![]);}catch(_0x43ea6d){return BPromise[_0x26e1('0x23')](_0x43ea6d);}return _0x3b3be0[_0x26e1('0x24')]();};}function saveUpdates(_0x2cb964,_0xf9df32){return function(_0xb13cee){if(_0xb13cee){return _0xb13cee[_0x26e1('0x25')](_0x2cb964)[_0x26e1('0x26')](function(_0x378824){return _0x378824;});}return null;};}function removeEntity(_0x5eadb2,_0x1c81c3){return function(_0x1157f5){if(_0x1157f5){return _0x1157f5[_0x26e1('0x27')]()['then'](function(){var _0xc13da3=_0x1157f5[_0x26e1('0x28')]({'plain':!![]});var _0x3a2e8c=_0x26e1('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a2e8c,'resourceId':_0xc13da3['id']}})['then'](function(){return _0x1157f5;});})[_0x26e1('0x26')](function(){_0x5eadb2[_0x26e1('0x1c')](0xcc)[_0x26e1('0x2a')]();});}};}function handleEntityNotFound(_0xb954da,_0x341da7){return function(_0x2805ee){if(!_0x2805ee){_0xb954da[_0x26e1('0x1b')](0x194);}return _0x2805ee;};}function handleError(_0x2a4058,_0x1a0fad){_0x1a0fad=_0x1a0fad||0x1f4;return function(_0x14b909){logger[_0x26e1('0x2b')](_0x14b909[_0x26e1('0x2c')]);if(_0x14b909['name']){delete _0x14b909[_0x26e1('0x2d')];}_0x2a4058[_0x26e1('0x1c')](_0x1a0fad)['send'](_0x14b909);};}exports[_0x26e1('0x2e')]=function(_0x511176,_0x394fc2){var _0x7f3f58={},_0x422d5b={},_0x43edec={'count':0x0,'rows':[]};var _0x44a875=_['map'](db[_0x26e1('0x2f')][_0x26e1('0x30')],function(_0xd75e8a){return{'name':_0xd75e8a[_0x26e1('0x31')],'type':_0xd75e8a[_0x26e1('0x32')]['key']};});_0x422d5b[_0x26e1('0x33')]=_[_0x26e1('0x34')](_0x44a875,_0x26e1('0x2d'));_0x422d5b[_0x26e1('0x35')]=_[_0x26e1('0x36')](_0x511176[_0x26e1('0x35')]);_0x422d5b[_0x26e1('0x37')]=_[_0x26e1('0x38')](_0x422d5b['model'],_0x422d5b[_0x26e1('0x35')]);_0x7f3f58['attributes']=_[_0x26e1('0x38')](_0x422d5b[_0x26e1('0x33')],qs[_0x26e1('0x39')](_0x511176[_0x26e1('0x35')][_0x26e1('0x39')]));_0x7f3f58[_0x26e1('0x3a')]=_0x7f3f58['attributes'][_0x26e1('0x3b')]?_0x7f3f58['attributes']:_0x422d5b['model'];if(!_0x511176[_0x26e1('0x35')][_0x26e1('0x3c')](_0x26e1('0x3d'))){_0x7f3f58[_0x26e1('0x20')]=qs['limit'](_0x511176['query'][_0x26e1('0x20')]);_0x7f3f58[_0x26e1('0x1e')]=qs[_0x26e1('0x1e')](_0x511176[_0x26e1('0x35')][_0x26e1('0x1e')]);}_0x7f3f58[_0x26e1('0x3e')]=qs[_0x26e1('0x3f')](_0x511176[_0x26e1('0x35')]['sort']);_0x7f3f58[_0x26e1('0x40')]=qs[_0x26e1('0x37')](_[_0x26e1('0x41')](_0x511176[_0x26e1('0x35')],_0x422d5b['filters']),_0x44a875);if(_0x511176[_0x26e1('0x35')][_0x26e1('0x42')]){_0x7f3f58[_0x26e1('0x40')]=_[_0x26e1('0x43')](_0x7f3f58[_0x26e1('0x40')],{'$or':_[_0x26e1('0x34')](_0x44a875,function(_0xe52b9b){if(_0xe52b9b[_0x26e1('0x32')]!==_0x26e1('0x44')){var _0x398692={};_0x398692[_0xe52b9b[_0x26e1('0x2d')]]={'$like':'%'+_0x511176[_0x26e1('0x35')][_0x26e1('0x42')]+'%'};return _0x398692;}})});}_0x7f3f58=_['merge']({},_0x7f3f58,_0x511176['options']);var _0x4316ba={'where':_0x7f3f58[_0x26e1('0x40')]};return db[_0x26e1('0x2f')][_0x26e1('0x21')](_0x4316ba)['then'](function(_0x3aeddc){_0x43edec[_0x26e1('0x21')]=_0x3aeddc;if(_0x511176[_0x26e1('0x35')][_0x26e1('0x45')]){_0x7f3f58[_0x26e1('0x46')]=[{'all':!![]}];}return db[_0x26e1('0x2f')][_0x26e1('0x47')](_0x7f3f58);})['then'](function(_0x200fa6){_0x43edec[_0x26e1('0x48')]=_0x200fa6;return _0x43edec;})[_0x26e1('0x26')](respondWithFilteredResult(_0x394fc2,_0x7f3f58))[_0x26e1('0x49')](handleError(_0x394fc2,null));};exports['show']=function(_0x1a4790,_0x40ac32){var _0x2ca0df={'raw':![],'where':{'id':_0x1a4790['params']['id']}},_0x3ac2cc={};_0x3ac2cc[_0x26e1('0x33')]=_[_0x26e1('0x36')](db['SquareProject'][_0x26e1('0x30')]);_0x3ac2cc['query']=_[_0x26e1('0x36')](_0x1a4790[_0x26e1('0x35')]);_0x3ac2cc['filters']=_['intersection'](_0x3ac2cc[_0x26e1('0x33')],_0x3ac2cc[_0x26e1('0x35')]);_0x2ca0df[_0x26e1('0x3a')]=_[_0x26e1('0x38')](_0x3ac2cc[_0x26e1('0x33')],qs[_0x26e1('0x39')](_0x1a4790[_0x26e1('0x35')][_0x26e1('0x39')]));_0x2ca0df[_0x26e1('0x3a')]=_0x2ca0df[_0x26e1('0x3a')][_0x26e1('0x3b')]?_0x2ca0df[_0x26e1('0x3a')]:_0x3ac2cc['model'];if(_0x1a4790['query'][_0x26e1('0x45')]){_0x2ca0df[_0x26e1('0x46')]=[{'all':!![]}];}_0x2ca0df=_['merge']({},_0x2ca0df,_0x1a4790[_0x26e1('0x4a')]);return db[_0x26e1('0x2f')][_0x26e1('0x4b')](_0x2ca0df)[_0x26e1('0x26')](handleEntityNotFound(_0x40ac32,null))['then'](respondWithResult(_0x40ac32,null))['catch'](handleError(_0x40ac32,null));};exports[_0x26e1('0x4c')]=function(_0xd26ca8,_0x3ae5ec){return db[_0x26e1('0x2f')]['create'](_0xd26ca8[_0x26e1('0x4d')],{})[_0x26e1('0x26')](function(_0x5041d5){var _0x44f9d7=_0xd26ca8[_0x26e1('0x4e')][_0x26e1('0x28')]({'plain':!![]});if(!_0x44f9d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44f9d7['role']===_0x26e1('0x4e')){var _0x495c5e=_0x5041d5[_0x26e1('0x28')]({'plain':!![]});var _0x461696='SquareProjects';return db[_0x26e1('0x4f')]['find']({'where':{'name':_0x461696,'userProfileId':_0x44f9d7[_0x26e1('0x50')]},'raw':!![]})[_0x26e1('0x26')](function(_0xeb662c){if(_0xeb662c&&_0xeb662c[_0x26e1('0x51')]===0x0){return db['UserProfileResource'][_0x26e1('0x4c')]({'name':_0x495c5e[_0x26e1('0x2d')],'resourceId':_0x495c5e['id'],'type':_0xeb662c[_0x26e1('0x2d')],'sectionId':_0xeb662c['id']},{})[_0x26e1('0x26')](function(){return _0x5041d5;});}else{return _0x5041d5;}})[_0x26e1('0x49')](function(_0x1edce6){logger[_0x26e1('0x2b')](_0x26e1('0x52'),_0x1edce6);throw _0x1edce6;});}return _0x5041d5;})[_0x26e1('0x26')](respondWithResult(_0x3ae5ec,0xc9))['catch'](handleError(_0x3ae5ec,null));};exports['update']=function(_0x1f2cf7,_0x5be9c3){if(_0x1f2cf7['body']['id']){delete _0x1f2cf7[_0x26e1('0x4d')]['id'];}return db[_0x26e1('0x2f')][_0x26e1('0x4b')]({'where':{'id':_0x1f2cf7[_0x26e1('0x53')]['id']}})['then'](handleEntityNotFound(_0x5be9c3,null))[_0x26e1('0x26')](saveUpdates(_0x1f2cf7[_0x26e1('0x4d')],null))['then'](respondWithResult(_0x5be9c3,null))[_0x26e1('0x49')](handleError(_0x5be9c3,null));};exports['destroy']=function(_0x5afacb,_0x4b6133){return db[_0x26e1('0x2f')][_0x26e1('0x4b')]({'where':{'id':_0x5afacb[_0x26e1('0x53')]['id']}})['then'](handleEntityNotFound(_0x4b6133,null))['then'](removeEntity(_0x4b6133,null))['catch'](handleError(_0x4b6133,null));};exports[_0x26e1('0x54')]=function(_0x588ea6,_0x22d58e,_0x4ae29e){return db[_0x26e1('0x2f')]['find']({'where':{'id':_0x588ea6[_0x26e1('0x53')]['id']}})['then'](handleEntityNotFound(_0x22d58e,null))['then'](function(_0x3aada5){if(_0x3aada5){return _0x3aada5[_0x26e1('0x54')](_0x588ea6[_0x26e1('0x4d')][_0x26e1('0x55')],_[_0x26e1('0x56')](_0x588ea6[_0x26e1('0x4d')],['ids','id'])||{});}})[_0x26e1('0x26')](respondWithResult(_0x22d58e,null))[_0x26e1('0x49')](handleError(_0x22d58e,null));};exports[_0x26e1('0x57')]=function(_0x42aea9,_0x5e17b9,_0x17d35b){return db['SquareProject'][_0x26e1('0x4b')]({'where':{'id':_0x42aea9['params']['id']}})[_0x26e1('0x26')](handleEntityNotFound(_0x5e17b9,null))[_0x26e1('0x26')](function(_0xf1eccd){if(_0xf1eccd){return _0xf1eccd[_0x26e1('0x57')](_0x42aea9['query'][_0x26e1('0x55')])[_0x26e1('0x26')](function(){if(_[_0x26e1('0x58')](_0x42aea9[_0x26e1('0x35')][_0x26e1('0x55')])){for(var _0x3a6dfd=0x0;_0x3a6dfd<_0x42aea9[_0x26e1('0x35')]['ids']['length'];_0x3a6dfd+=0x1){socket['emit'](_0x26e1('0x59'),{'UserId':Number(_0x42aea9[_0x26e1('0x35')]['ids'][_0x3a6dfd]),'SquareProjectId':Number(_0x42aea9['params']['id'])});}}else{socket[_0x26e1('0x5a')](_0x26e1('0x59'),{'UserId':Number(_0x42aea9[_0x26e1('0x35')][_0x26e1('0x55')]),'SquareProjectId':Number(_0x42aea9[_0x26e1('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x5e17b9,null))[_0x26e1('0x49')](handleError(_0x5e17b9,null));};exports[_0x26e1('0x5b')]=function(_0xa03fa6,_0x3c8f05,_0xf30caa){var _0x22ddf3={};var _0x59b574={};var _0xe4c2fb;var _0x1e4fec;return db[_0x26e1('0x2f')]['findOne']({'where':{'id':_0xa03fa6[_0x26e1('0x53')]['id']}})[_0x26e1('0x26')](handleEntityNotFound(_0x3c8f05,null))[_0x26e1('0x26')](function(_0x2ed95d){if(_0x2ed95d){_0xe4c2fb=_0x2ed95d;_0x59b574[_0x26e1('0x33')]=_['keys'](db[_0x26e1('0x5c')][_0x26e1('0x30')]);_0x59b574[_0x26e1('0x35')]=_['keys'](_0xa03fa6[_0x26e1('0x35')]);_0x59b574[_0x26e1('0x37')]=_['intersection'](_0x59b574[_0x26e1('0x33')],_0x59b574[_0x26e1('0x35')]);_0x22ddf3['attributes']=_[_0x26e1('0x38')](_0x59b574['model'],qs[_0x26e1('0x39')](_0xa03fa6['query'][_0x26e1('0x39')]));_0x22ddf3[_0x26e1('0x3a')]=_0x22ddf3[_0x26e1('0x3a')][_0x26e1('0x3b')]?_0x22ddf3[_0x26e1('0x3a')]:_0x59b574[_0x26e1('0x33')];_0x22ddf3['order']=qs[_0x26e1('0x3f')](_0xa03fa6[_0x26e1('0x35')][_0x26e1('0x3f')]);_0x22ddf3['where']=qs[_0x26e1('0x37')](_['pick'](_0xa03fa6[_0x26e1('0x35')],_0x59b574[_0x26e1('0x37')]));if(_0xa03fa6[_0x26e1('0x35')]['filter']){_0x22ddf3['where']=_[_0x26e1('0x43')](_0x22ddf3[_0x26e1('0x40')],{'$or':_[_0x26e1('0x34')](_0x22ddf3[_0x26e1('0x3a')],function(_0x349d3b){var _0x1fef28={};_0x1fef28[_0x349d3b]={'$like':'%'+_0xa03fa6[_0x26e1('0x35')]['filter']+'%'};return _0x1fef28;})});}_0x22ddf3=_[_0x26e1('0x43')]({},_0x22ddf3,_0xa03fa6[_0x26e1('0x4a')]);return _0xe4c2fb['getUsers'](_0x22ddf3);}})[_0x26e1('0x26')](function(_0x52283a){if(_0x52283a){_0x1e4fec=_0x52283a['length'];if(!_0xa03fa6[_0x26e1('0x35')][_0x26e1('0x3c')](_0x26e1('0x3d'))){_0x22ddf3['limit']=qs[_0x26e1('0x20')](_0xa03fa6[_0x26e1('0x35')]['limit']);_0x22ddf3[_0x26e1('0x1e')]=qs[_0x26e1('0x1e')](_0xa03fa6[_0x26e1('0x35')]['offset']);}return _0xe4c2fb[_0x26e1('0x5b')](_0x22ddf3);}})[_0x26e1('0x26')](function(_0x3407f5){if(_0x3407f5){return _0x3407f5?{'count':_0x1e4fec,'rows':_0x3407f5}:null;}})['then'](respondWithResult(_0x3c8f05,null))[_0x26e1('0x49')](handleError(_0x3c8f05,null));};
\ No newline at end of file
index a3d6170..bf1a98a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4de=['update','remove','emit','hook','events','../../mysqldb','SquareProject','save'];(function(_0x536f38,_0x4d02e7){var _0x1283d5=function(_0x213197){while(--_0x213197){_0x536f38['push'](_0x536f38['shift']());}};_0x1283d5(++_0x4d02e7);}(_0xb4de,0x13c));var _0xeb4d=function(_0x2c0717,_0x3925a1){_0x2c0717=_0x2c0717-0x0;var _0xc9d223=_0xb4de[_0x2c0717];return _0xc9d223;};'use strict';var EventEmitter=require(_0xeb4d('0x0'));var SquareProject=require(_0xeb4d('0x1'))['db'][_0xeb4d('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb4d('0x3'),'afterUpdate':_0xeb4d('0x4'),'afterDestroy':_0xeb4d('0x5')};function emitEvent(_0x2dd7f1){return function(_0x170ca2,_0x36d1a0,_0x5f5aa3){SquareProjectEvents['emit'](_0x2dd7f1+':'+_0x170ca2['id'],_0x170ca2);SquareProjectEvents[_0xeb4d('0x6')](_0x2dd7f1,_0x170ca2);_0x5f5aa3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xeb4d('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
+var _0xc323=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x28732b,_0xa00741){var _0x48ce81=function(_0x2c5dd8){while(--_0x2c5dd8){_0x28732b['push'](_0x28732b['shift']());}};_0x48ce81(++_0xa00741);}(_0xc323,0x1d8));var _0x3c32=function(_0x2afbbf,_0x122676){_0x2afbbf=_0x2afbbf-0x0;var _0x4baa65=_0xc323[_0x2afbbf];return _0x4baa65;};'use strict';var EventEmitter=require(_0x3c32('0x0'));var SquareProject=require(_0x3c32('0x1'))['db'][_0x3c32('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x3c32('0x3')](0x0);var events={'afterCreate':_0x3c32('0x4'),'afterUpdate':'update','afterDestroy':_0x3c32('0x5')};function emitEvent(_0x459958){return function(_0x5b4820,_0x245a7f,_0x1dea8c){SquareProjectEvents[_0x3c32('0x6')](_0x459958+':'+_0x5b4820['id'],_0x5b4820);SquareProjectEvents['emit'](_0x459958,_0x5b4820);_0x1dea8c(null);};}for(var e in events){if(events[_0x3c32('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x3c32('0x8')]=SquareProjectEvents;
\ No newline at end of file
index c4af75d..6722c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30d6=['publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x30d6,0x1b7));var _0x630d=function(_0x4b90b3,_0x164fb2){_0x4b90b3=_0x4b90b3-0x0;var _0x45472e=_0x30d6[_0x4b90b3];return _0x45472e;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var logger=require('../../config/logger')(_0x630d('0x2'));var moment=require(_0x630d('0x3'));var BPromise=require(_0x630d('0x4'));var rp=require(_0x630d('0x5'));var fs=require('fs');var path=require(_0x630d('0x6'));var rimraf=require('rimraf');var config=require(_0x630d('0x7'));var attributes=require(_0x630d('0x8'));module[_0x630d('0x9')]=function(_0x534718,_0x1e6dd0){return _0x534718[_0x630d('0xa')](_0x630d('0xb'),attributes,{'tableName':_0x630d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a3db4,_0x232f79,_0x21594b){if(_0x4a3db4[_0x630d('0xd')](_0x630d('0xe'))){_0x4a3db4[_0x630d('0xf')]=moment()[_0x630d('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4a3db4['changed']('production')){_0x4a3db4[_0x630d('0x11')]=moment()['format'](_0x630d('0x12'));}_0x21594b(null,_0x4a3db4);}}});};
\ No newline at end of file
+var _0x10ee=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x2c34a0,_0x5f0424){var _0x2f995d=function(_0x6e1596){while(--_0x6e1596){_0x2c34a0['push'](_0x2c34a0['shift']());}};_0x2f995d(++_0x5f0424);}(_0x10ee,0x153));var _0xe10e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x10ee[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xe10e('0x0'));var util=require(_0xe10e('0x1'));var logger=require(_0xe10e('0x2'))('api');var moment=require(_0xe10e('0x3'));var BPromise=require(_0xe10e('0x4'));var rp=require(_0xe10e('0x5'));var fs=require('fs');var path=require(_0xe10e('0x6'));var rimraf=require(_0xe10e('0x7'));var config=require(_0xe10e('0x8'));var attributes=require(_0xe10e('0x9'));module[_0xe10e('0xa')]=function(_0x50823e,_0x34c444){return _0x50823e[_0xe10e('0xb')](_0xe10e('0xc'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x224937,_0x2e40dd,_0x31f16a){if(_0x224937[_0xe10e('0xd')](_0xe10e('0xe'))){_0x224937[_0xe10e('0xf')]=moment()[_0xe10e('0x10')](_0xe10e('0x11'));}if(_0x224937[_0xe10e('0xd')]('production')){_0x224937['publishedAt']=moment()[_0xe10e('0x10')](_0xe10e('0x11'));}_0x31f16a(null,_0x224937);}}});};
\ No newline at end of file
index c65901c..b00b66d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd203=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','info','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xd203,0x190));var _0x3d20=function(_0x43b3ec,_0x53d51f){_0x43b3ec=_0x43b3ec-0x0;var _0x25a5e6=_0xd203[_0x43b3ec];return _0x25a5e6;};'use strict';var _=require(_0x3d20('0x0'));var util=require(_0x3d20('0x1'));var moment=require('moment');var BPromise=require(_0x3d20('0x2'));var rs=require(_0x3d20('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d20('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d20('0x5'))(_0x3d20('0x6'));var config=require('../../config/environment');var jayson=require(_0x3d20('0x7'));var client=jayson['client'][_0x3d20('0x8')]({'port':0x232a});config[_0x3d20('0x9')]=_[_0x3d20('0xa')](config[_0x3d20('0x9')],{'host':_0x3d20('0xb'),'port':0x18eb});var socket=require(_0x3d20('0xc'))(new Redis(config[_0x3d20('0x9')]));require(_0x3d20('0xd'))[_0x3d20('0xe')](socket);function respondWithRpcPromise(_0x4cde47,_0x28331c,_0x122981){return new BPromise(function(_0x1c1818,_0x44c2d2){return client[_0x3d20('0xf')](_0x4cde47,_0x122981)[_0x3d20('0x10')](function(_0x245257){logger['info'](_0x3d20('0x11'),_0x28331c,_0x3d20('0x12'));logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0x28331c,_0x3d20('0x12'),JSON[_0x3d20('0x13')](_0x245257));if(_0x245257[_0x3d20('0x14')]){if(_0x245257[_0x3d20('0x14')][_0x3d20('0x15')]===0x1f4){logger[_0x3d20('0x14')](_0x3d20('0x11'),_0x28331c,_0x245257[_0x3d20('0x14')]['message']);return _0x44c2d2(_0x245257[_0x3d20('0x14')][_0x3d20('0x16')]);}logger[_0x3d20('0x14')](_0x3d20('0x11'),_0x28331c,_0x245257[_0x3d20('0x14')][_0x3d20('0x16')]);return _0x1c1818(_0x245257[_0x3d20('0x14')]['message']);}else{logger['info'](_0x3d20('0x11'),_0x28331c,'request\x20sent');_0x1c1818(_0x245257[_0x3d20('0x17')][_0x3d20('0x16')]);}})[_0x3d20('0x18')](function(_0x47cdaa){logger[_0x3d20('0x14')](_0x3d20('0x11'),_0x28331c,_0x47cdaa);_0x44c2d2(_0x47cdaa);});});}exports[_0x3d20('0x19')]=function(_0x3da184){var _0x5a9bc7=this;return new Promise(function(_0x1864d9,_0x3d0bd0){return db[_0x3d20('0x1a')][_0x3d20('0x1b')]({'raw':_0x3da184[_0x3d20('0x1c')]?_0x3da184[_0x3d20('0x1c')][_0x3d20('0x1d')]===undefined?!![]:![]:!![],'where':_0x3da184[_0x3d20('0x1c')]?_0x3da184[_0x3d20('0x1c')][_0x3d20('0x1e')]||null:null,'attributes':_0x3da184['options']?_0x3da184[_0x3d20('0x1c')][_0x3d20('0x1f')]||null:null,'include':_0x3da184['options']?_0x3da184[_0x3d20('0x1c')][_0x3d20('0x20')]?_[_0x3d20('0x21')](_0x3da184[_0x3d20('0x1c')]['include'],function(_0x24ed2f){return{'model':db[_0x24ed2f[_0x3d20('0x22')]],'as':_0x24ed2f['as'],'attributes':_0x24ed2f[_0x3d20('0x1f')],'include':_0x24ed2f['include']?_[_0x3d20('0x21')](_0x24ed2f[_0x3d20('0x20')],function(_0x285942){return{'model':db[_0x285942[_0x3d20('0x22')]],'as':_0x285942['as'],'attributes':_0x285942['attributes'],'include':_0x285942[_0x3d20('0x20')]?_[_0x3d20('0x21')](_0x285942[_0x3d20('0x20')],function(_0x5a00b9){return{'model':db[_0x5a00b9['model']],'as':_0x5a00b9['as'],'attributes':_0x5a00b9[_0x3d20('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3d20('0x10')](function(_0x4096d2){logger[_0x3d20('0x23')](_0x3d20('0x19'),_0x3da184);logger[_0x3d20('0x24')](_0x3d20('0x19'),_0x3da184,JSON['stringify'](_0x4096d2));_0x1864d9(_0x4096d2);})['catch'](function(_0x127b6f){logger[_0x3d20('0x14')](_0x3d20('0x19'),_0x127b6f[_0x3d20('0x16')],_0x3da184);_0x3d0bd0(_0x5a9bc7[_0x3d20('0x14')](0x1f4,_0x127b6f['message']));});});};
\ No newline at end of file
+var _0x455d=['lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','options','raw','where','include','map','attributes','debug'];(function(_0x305bbf,_0x5647b3){var _0x4ed772=function(_0x3315ed){while(--_0x3315ed){_0x305bbf['push'](_0x305bbf['shift']());}};_0x4ed772(++_0x5647b3);}(_0x455d,0x120));var _0xd455=function(_0x4df10f,_0x444fc2){_0x4df10f=_0x4df10f-0x0;var _0x17597f=_0x455d[_0x4df10f];return _0x17597f;};'use strict';var _=require(_0xd455('0x0'));var util=require(_0xd455('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd455('0x2'));var db=require(_0xd455('0x3'))['db'];var utils=require(_0xd455('0x4'));var logger=require(_0xd455('0x5'))(_0xd455('0x6'));var config=require('../../config/environment');var jayson=require(_0xd455('0x7'));var client=jayson['client'][_0xd455('0x8')]({'port':0x232a});config[_0xd455('0x9')]=_[_0xd455('0xa')](config[_0xd455('0x9')],{'host':_0xd455('0xb'),'port':0x18eb});var socket=require(_0xd455('0xc'))(new Redis(config['redis']));require(_0xd455('0xd'))[_0xd455('0xe')](socket);function respondWithRpcPromise(_0x2d02c2,_0x54b8c3,_0x58276c){return new BPromise(function(_0x58793f,_0x1e9b46){return client[_0xd455('0xf')](_0x2d02c2,_0x58276c)[_0xd455('0x10')](function(_0x5de1fa){logger[_0xd455('0x11')](_0xd455('0x12'),_0x54b8c3,_0xd455('0x13'));logger['debug'](_0xd455('0x14'),_0x54b8c3,'request\x20sent',JSON[_0xd455('0x15')](_0x5de1fa));if(_0x5de1fa[_0xd455('0x16')]){if(_0x5de1fa[_0xd455('0x16')][_0xd455('0x17')]===0x1f4){logger[_0xd455('0x16')]('SquareProject,\x20%s,\x20%s',_0x54b8c3,_0x5de1fa[_0xd455('0x16')][_0xd455('0x18')]);return _0x1e9b46(_0x5de1fa[_0xd455('0x16')]['message']);}logger[_0xd455('0x16')](_0xd455('0x12'),_0x54b8c3,_0x5de1fa['error']['message']);return _0x58793f(_0x5de1fa[_0xd455('0x16')]['message']);}else{logger[_0xd455('0x11')]('SquareProject,\x20%s,\x20%s',_0x54b8c3,_0xd455('0x13'));_0x58793f(_0x5de1fa[_0xd455('0x19')][_0xd455('0x18')]);}})[_0xd455('0x1a')](function(_0x4891d5){logger[_0xd455('0x16')](_0xd455('0x12'),_0x54b8c3,_0x4891d5);_0x1e9b46(_0x4891d5);});});}exports[_0xd455('0x1b')]=function(_0x176978){var _0x3bd4df=this;return new Promise(function(_0x2eb506,_0x2778f9){return db[_0xd455('0x1c')]['find']({'raw':_0x176978['options']?_0x176978[_0xd455('0x1d')][_0xd455('0x1e')]===undefined?!![]:![]:!![],'where':_0x176978[_0xd455('0x1d')]?_0x176978[_0xd455('0x1d')][_0xd455('0x1f')]||null:null,'attributes':_0x176978[_0xd455('0x1d')]?_0x176978[_0xd455('0x1d')]['attributes']||null:null,'include':_0x176978[_0xd455('0x1d')]?_0x176978[_0xd455('0x1d')][_0xd455('0x20')]?_[_0xd455('0x21')](_0x176978[_0xd455('0x1d')][_0xd455('0x20')],function(_0x3ba3d0){return{'model':db[_0x3ba3d0['model']],'as':_0x3ba3d0['as'],'attributes':_0x3ba3d0['attributes'],'include':_0x3ba3d0['include']?_[_0xd455('0x21')](_0x3ba3d0[_0xd455('0x20')],function(_0xaf92fb){return{'model':db[_0xaf92fb['model']],'as':_0xaf92fb['as'],'attributes':_0xaf92fb[_0xd455('0x22')],'include':_0xaf92fb['include']?_[_0xd455('0x21')](_0xaf92fb['include'],function(_0x19992e){return{'model':db[_0x19992e['model']],'as':_0x19992e['as'],'attributes':_0x19992e[_0xd455('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd455('0x10')](function(_0x205e9a){logger[_0xd455('0x11')](_0xd455('0x1b'),_0x176978);logger[_0xd455('0x23')](_0xd455('0x1b'),_0x176978,JSON['stringify'](_0x205e9a));_0x2eb506(_0x205e9a);})[_0xd455('0x1a')](function(_0x1ce13b){logger['error'](_0xd455('0x1b'),_0x1ce13b[_0xd455('0x18')],_0x176978);_0x2778f9(_0x3bd4df['error'](0x1f4,_0x1ce13b[_0xd455('0x18')]));});});};
\ No newline at end of file
index 4b1270a..1492d04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f1c=['./squareProject.events','save','emit','squareProject:'];(function(_0x2289d9,_0x32a974){var _0x49eaa1=function(_0x4005f5){while(--_0x4005f5){_0x2289d9['push'](_0x2289d9['shift']());}};_0x49eaa1(++_0x32a974);}(_0x7f1c,0xc8));var _0xc7f1=function(_0x516ae9,_0x5c0035){_0x516ae9=_0x516ae9-0x0;var _0x299b06=_0x7f1c[_0x516ae9];return _0x299b06;};'use strict';var SquareProjectEvents=require(_0xc7f1('0x0'));var events=[_0xc7f1('0x1'),'remove','update'];function createListener(_0x599eec,_0xbb7a7b){return function(_0x8e6a81){_0xbb7a7b[_0xc7f1('0x2')](_0x599eec,_0x8e6a81);};}function removeListener(_0x164e57,_0x302810){return function(){SquareProjectEvents['removeListener'](_0x164e57,_0x302810);};}exports['register']=function(_0x229660){for(var _0x45e5e1=0x0,_0x2c17cd=events['length'];_0x45e5e1<_0x2c17cd;_0x45e5e1++){var _0x3ca12a=events[_0x45e5e1];var _0x2853f5=createListener(_0xc7f1('0x3')+_0x3ca12a,_0x229660);SquareProjectEvents['on'](_0x3ca12a,_0x2853f5);}};
\ No newline at end of file
+var _0x1ae4=['update','removeListener','register','squareProject:','./squareProject.events'];(function(_0x20fb94,_0x6d127f){var _0xb3bb6f=function(_0x42f220){while(--_0x42f220){_0x20fb94['push'](_0x20fb94['shift']());}};_0xb3bb6f(++_0x6d127f);}(_0x1ae4,0x15d));var _0x41ae=function(_0x2e44f8,_0x449a39){_0x2e44f8=_0x2e44f8-0x0;var _0x3c1e17=_0x1ae4[_0x2e44f8];return _0x3c1e17;};'use strict';var SquareProjectEvents=require(_0x41ae('0x0'));var events=['save','remove',_0x41ae('0x1')];function createListener(_0x53290d,_0x4a600e){return function(_0x3acccf){_0x4a600e['emit'](_0x53290d,_0x3acccf);};}function removeListener(_0x5b252e,_0x159679){return function(){SquareProjectEvents[_0x41ae('0x2')](_0x5b252e,_0x159679);};}exports[_0x41ae('0x3')]=function(_0x38fe76){for(var _0x27f9ad=0x0,_0x8ae1d0=events['length'];_0x27f9ad<_0x8ae1d0;_0x27f9ad++){var _0x38d1af=events[_0x27f9ad];var _0x2a985c=createListener(_0x41ae('0x4')+_0x38d1af,_0x38fe76);SquareProjectEvents['on'](_0x38d1af,_0x2a985c);}};
\ No newline at end of file
index 3fce1bd..b1c9a0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x1a9b70,_0x41520e){var _0x53e6ac=function(_0x3be26c){while(--_0x3be26c){_0x1a9b70['push'](_0x1a9b70['shift']());}};_0x53e6ac(++_0x41520e);}(_0x53ec,0x192));var _0xc53e=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x53ec[_0x3792e6];return _0x441e44;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router;
\ No newline at end of file
+var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x5005b7,_0x126240){var _0x21ef12=function(_0x4f3ba4){while(--_0x4f3ba4){_0x5005b7['push'](_0x5005b7['shift']());}};_0x21ef12(++_0x126240);}(_0x5fab,0x177));var _0xb5fa=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0x5fab[_0x14d250];return _0xb991d8;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
index 8fcbfa2..6cc8599 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f47=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue'];(function(_0x4e563c,_0x5c337a){var _0x3ea0eb=function(_0x45fa2c){while(--_0x45fa2c){_0x4e563c['push'](_0x4e563c['shift']());}};_0x3ea0eb(++_0x5c337a);}(_0x6f47,0xc7));var _0x76f4=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x6f47[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'uniqueid':{'type':Sequelize[_0x76f4('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76f4('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x76f4('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76f4('0x1')]},'dnid':{'type':Sequelize[_0x76f4('0x1')]},'projectName':{'type':Sequelize[_0x76f4('0x1')]},'saveName':{'type':Sequelize[_0x76f4('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x76f4('0x1')]},'format':{'type':Sequelize[_0x76f4('0x2')],'get':function(){var _0x2176a7='';var _0x497f99=this[_0x76f4('0x3')](_0x76f4('0x4'));if(_0x497f99){_0x2176a7=_0x497f99[_0x76f4('0x5')](_0x497f99[_0x76f4('0x6')]('.'));}return _0x2176a7;}}};
\ No newline at end of file
+var _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x5805a2,_0x3cb76b){var _0x542db2=function(_0x447342){while(--_0x447342){_0x5805a2['push'](_0x5805a2['shift']());}};_0x542db2(++_0x3cb76b);}(_0x032e,0x124));var _0xe032=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x032e[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}};
\ No newline at end of file
index e30af0f..dd25139 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa594=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','keys','options','find','create','body','catch','download','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x10ed6a,_0x33230f){var _0x3bf0c7=function(_0x4e54af){while(--_0x4e54af){_0x10ed6a['push'](_0x10ed6a['shift']());}};_0x3bf0c7(++_0x33230f);}(_0xa594,0x1d0));var _0x4a59=function(_0x2b31a8,_0x28b862){_0x2b31a8=_0x2b31a8-0x0;var _0x1175a5=_0xa594[_0x2b31a8];return _0x1175a5;};'use strict';var emlformat=require(_0x4a59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a59('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4a59('0x2'));var BPromise=require(_0x4a59('0x3'));var Mustache=require(_0x4a59('0x4'));var util=require(_0x4a59('0x5'));var path=require(_0x4a59('0x6'));var sox=require('sox');var csv=require(_0x4a59('0x7'));var ejs=require(_0x4a59('0x8'));var fs=require('fs');var fs_extra=require(_0x4a59('0x9'));var _=require(_0x4a59('0xa'));var squel=require(_0x4a59('0xb'));var crypto=require(_0x4a59('0xc'));var jsforce=require(_0x4a59('0xd'));var deskjs=require(_0x4a59('0xe'));var toCsv=require(_0x4a59('0x7'));var querystring=require('querystring');var Papa=require(_0x4a59('0xf'));var Redis=require(_0x4a59('0x10'));var authService=require(_0x4a59('0x11'));var qs=require(_0x4a59('0x12'));var as=require(_0x4a59('0x13'));var hardwareService=require(_0x4a59('0x14'));var logger=require(_0x4a59('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4a59('0x16'))['db'];function respondWithStatusCode(_0x2bca8d,_0xb9abfa){_0xb9abfa=_0xb9abfa||0xcc;return function(_0x50b517){if(_0x50b517){return _0x2bca8d[_0x4a59('0x17')](_0xb9abfa);}return _0x2bca8d[_0x4a59('0x18')](_0xb9abfa)[_0x4a59('0x19')]();};}function respondWithResult(_0x2900c6,_0x483310){_0x483310=_0x483310||0xc8;return function(_0x3f7900){if(_0x3f7900){return _0x2900c6[_0x4a59('0x18')](_0x483310)[_0x4a59('0x1a')](_0x3f7900);}};}function respondWithFilteredResult(_0x37bee6,_0x609533){return function(_0x47dd74){if(_0x47dd74){var _0x4cd3ec=typeof _0x609533[_0x4a59('0x1b')]===_0x4a59('0x1c')&&typeof _0x609533['limit']==='undefined';var _0x4403ce=_0x47dd74[_0x4a59('0x1d')];var _0x40a91d=_0x4cd3ec?0x0:_0x609533[_0x4a59('0x1b')];var _0x284486=_0x4cd3ec?_0x47dd74[_0x4a59('0x1d')]:_0x609533[_0x4a59('0x1b')]+_0x609533[_0x4a59('0x1e')];var _0x4f332d;if(_0x284486>=_0x4403ce){_0x284486=_0x4403ce;_0x4f332d=0xc8;}else{_0x4f332d=0xce;}_0x37bee6['status'](_0x4f332d);return _0x37bee6[_0x4a59('0x1f')]('Content-Range',_0x40a91d+'-'+_0x284486+'/'+_0x4403ce)[_0x4a59('0x1a')](_0x47dd74);}return null;};}function patchUpdates(_0x1035e0){return function(_0xae4066){try{jsonpatch[_0x4a59('0x20')](_0xae4066,_0x1035e0,!![]);}catch(_0x10112e){return BPromise[_0x4a59('0x21')](_0x10112e);}return _0xae4066[_0x4a59('0x22')]();};}function saveUpdates(_0x1d3776,_0x44c31b){return function(_0x3bd307){if(_0x3bd307){return _0x3bd307[_0x4a59('0x23')](_0x1d3776)['then'](function(_0xd5eca1){return _0xd5eca1;});}return null;};}function removeEntity(_0x13f353,_0x3087a3){return function(_0x5b9cd7){if(_0x5b9cd7){return _0x5b9cd7[_0x4a59('0x24')]()[_0x4a59('0x25')](function(){_0x13f353[_0x4a59('0x18')](0xcc)[_0x4a59('0x19')]();});}};}function handleEntityNotFound(_0x508ca4,_0x3d30d2){return function(_0x5a286b){if(!_0x5a286b){_0x508ca4[_0x4a59('0x17')](0x194);}return _0x5a286b;};}function handleError(_0x23dce4,_0x413a79){_0x413a79=_0x413a79||0x1f4;return function(_0x473963){logger[_0x4a59('0x26')](_0x473963[_0x4a59('0x27')]);if(_0x473963[_0x4a59('0x28')]){delete _0x473963[_0x4a59('0x28')];}_0x23dce4[_0x4a59('0x18')](_0x413a79)[_0x4a59('0x29')](_0x473963);};}exports[_0x4a59('0x2a')]=function(_0x12a8f3,_0x518108){var _0x281d09={},_0x1d24e5={},_0x3b0ef6={'count':0x0,'rows':[]};var _0x2cf4e2=_[_0x4a59('0x2b')](db[_0x4a59('0x2c')][_0x4a59('0x2d')],function(_0x91e564){return{'name':_0x91e564[_0x4a59('0x2e')],'type':_0x91e564['type']['key']};});_0x1d24e5[_0x4a59('0x2f')]=_[_0x4a59('0x2b')](_0x2cf4e2,_0x4a59('0x28'));_0x1d24e5[_0x4a59('0x30')]=_['keys'](_0x12a8f3[_0x4a59('0x30')]);_0x1d24e5[_0x4a59('0x31')]=_['intersection'](_0x1d24e5[_0x4a59('0x2f')],_0x1d24e5[_0x4a59('0x30')]);_0x281d09[_0x4a59('0x32')]=_[_0x4a59('0x33')](_0x1d24e5['model'],qs[_0x4a59('0x34')](_0x12a8f3['query'][_0x4a59('0x34')]));_0x281d09[_0x4a59('0x32')]=_0x281d09[_0x4a59('0x32')][_0x4a59('0x35')]?_0x281d09['attributes']:_0x1d24e5[_0x4a59('0x2f')];if(!_0x12a8f3[_0x4a59('0x30')]['hasOwnProperty'](_0x4a59('0x36'))){_0x281d09[_0x4a59('0x1e')]=qs['limit'](_0x12a8f3[_0x4a59('0x30')]['limit']);_0x281d09[_0x4a59('0x1b')]=qs[_0x4a59('0x1b')](_0x12a8f3['query'][_0x4a59('0x1b')]);}_0x281d09[_0x4a59('0x37')]=qs[_0x4a59('0x38')](_0x12a8f3['query'][_0x4a59('0x38')]);_0x281d09[_0x4a59('0x39')]=qs['filters'](_[_0x4a59('0x3a')](_0x12a8f3[_0x4a59('0x30')],_0x1d24e5[_0x4a59('0x31')]),_0x2cf4e2);if(_0x12a8f3[_0x4a59('0x30')][_0x4a59('0x3b')]){_0x281d09['where']=_[_0x4a59('0x3c')](_0x281d09[_0x4a59('0x39')],{'$or':_[_0x4a59('0x2b')](_0x2cf4e2,function(_0x4a0dd3){if(_0x4a0dd3['type']!=='VIRTUAL'){var _0x3f2ff7={};_0x3f2ff7[_0x4a0dd3['name']]={'$like':'%'+_0x12a8f3[_0x4a59('0x30')][_0x4a59('0x3b')]+'%'};return _0x3f2ff7;}})});}_0x281d09=_[_0x4a59('0x3c')]({},_0x281d09,_0x12a8f3['options']);var _0x592d10={'where':_0x281d09[_0x4a59('0x39')]};return db[_0x4a59('0x2c')]['count'](_0x592d10)[_0x4a59('0x25')](function(_0x2f67a5){_0x3b0ef6[_0x4a59('0x1d')]=_0x2f67a5;if(_0x12a8f3['query'][_0x4a59('0x3d')]){_0x281d09[_0x4a59('0x3e')]=[{'all':!![]}];}return db[_0x4a59('0x2c')][_0x4a59('0x3f')](_0x281d09);})[_0x4a59('0x25')](function(_0x2243c5){_0x3b0ef6[_0x4a59('0x40')]=_0x2243c5;return _0x3b0ef6;})[_0x4a59('0x25')](respondWithFilteredResult(_0x518108,_0x281d09))['catch'](handleError(_0x518108,null));};exports['show']=function(_0x5a86d0,_0x5c4de3){var _0x3eb181={'raw':!![],'where':{'id':_0x5a86d0[_0x4a59('0x41')]['id']}},_0x448031={};_0x448031[_0x4a59('0x2f')]=_[_0x4a59('0x42')](db[_0x4a59('0x2c')][_0x4a59('0x2d')]);_0x448031[_0x4a59('0x30')]=_['keys'](_0x5a86d0[_0x4a59('0x30')]);_0x448031[_0x4a59('0x31')]=_['intersection'](_0x448031[_0x4a59('0x2f')],_0x448031[_0x4a59('0x30')]);_0x3eb181[_0x4a59('0x32')]=_[_0x4a59('0x33')](_0x448031[_0x4a59('0x2f')],qs[_0x4a59('0x34')](_0x5a86d0[_0x4a59('0x30')][_0x4a59('0x34')]));_0x3eb181[_0x4a59('0x32')]=_0x3eb181[_0x4a59('0x32')]['length']?_0x3eb181[_0x4a59('0x32')]:_0x448031[_0x4a59('0x2f')];if(_0x5a86d0[_0x4a59('0x30')]['includeAll']){_0x3eb181[_0x4a59('0x3e')]=[{'all':!![]}];}_0x3eb181=_[_0x4a59('0x3c')]({},_0x3eb181,_0x5a86d0[_0x4a59('0x43')]);return db['SquareRecording'][_0x4a59('0x44')](_0x3eb181)['then'](handleEntityNotFound(_0x5c4de3,null))[_0x4a59('0x25')](respondWithResult(_0x5c4de3,null))['catch'](handleError(_0x5c4de3,null));};exports[_0x4a59('0x45')]=function(_0xa3c7e7,_0x19d5c9){return db[_0x4a59('0x2c')][_0x4a59('0x45')](_0xa3c7e7[_0x4a59('0x46')],{})['then'](respondWithResult(_0x19d5c9,0xc9))['catch'](handleError(_0x19d5c9,null));};exports[_0x4a59('0x23')]=function(_0x2951f0,_0x44516f){if(_0x2951f0[_0x4a59('0x46')]['id']){delete _0x2951f0[_0x4a59('0x46')]['id'];}return db[_0x4a59('0x2c')]['find']({'where':{'id':_0x2951f0[_0x4a59('0x41')]['id']}})[_0x4a59('0x25')](handleEntityNotFound(_0x44516f,null))[_0x4a59('0x25')](saveUpdates(_0x2951f0[_0x4a59('0x46')],null))[_0x4a59('0x25')](respondWithResult(_0x44516f,null))[_0x4a59('0x47')](handleError(_0x44516f,null));};exports[_0x4a59('0x48')]=function(_0x40cc23,_0x52182e,_0xa0da99){var _0x535645=require(_0x4a59('0x49'));var _0x56aeb8=![];var _0x5c0d8c={};if(_0x40cc23['query'][_0x4a59('0x4a')]&&_0x40cc23['query'][_0x4a59('0x4a')]===_0x4a59('0x4b')){_0x5c0d8c['uniqueid']=_0x40cc23[_0x4a59('0x41')]['id'];}else{_0x5c0d8c['id']=_0x40cc23['params']['id'];}return db[_0x4a59('0x2c')][_0x4a59('0x44')]({'where':_0x5c0d8c,'attributes':['id',_0x4a59('0x4c'),_0x4a59('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x52182e,null))['then'](function(_0x5084b3){if(_0x5084b3){var _0x368910=_0x5084b3[_0x4a59('0x4c')];var _0x4ae07a=util[_0x4a59('0x4e')](_0x4a59('0x4f'),_0x368910);if(fs[_0x4a59('0x50')](_0x4ae07a)){_0x56aeb8=!![];return _0x535645['decryptFile'](_0x4ae07a,_0x368910,config[_0x4a59('0x51')]['recording'])[_0x4a59('0x25')](function(){return _0x5084b3;});}return _0x5084b3;}})[_0x4a59('0x25')](function(_0x545bc0){if(_0x545bc0){var _0x99c3f7=_0x545bc0[_0x4a59('0x4c')];if(!fs[_0x4a59('0x50')](_0x99c3f7)){throw new db[(_0x4a59('0x52'))][(_0x4a59('0x53'))](_0x4a59('0x54'));}if(_0x545bc0['filename']){return _0x52182e['download'](_0x99c3f7,_0x545bc0[_0x4a59('0x4d')]+path[_0x4a59('0x55')](_0x99c3f7),function(){if(_0x56aeb8){fs['unlink'](_0x99c3f7);}});}else{return _0x52182e[_0x4a59('0x48')](_0x99c3f7,function(_0x3ad6b4){if(_0x56aeb8){fs[_0x4a59('0x56')](_0x99c3f7);}});}}})['catch'](function(_0x3a9457){if(_0x3a9457['message']===_0x4a59('0x54')){_0x52182e['status'](0x194)[_0x4a59('0x29')]('Not\x20found');}else{return handleError(_0x52182e,null);}});};exports[_0x4a59('0x24')]=function(_0x2d0476,_0x29695e){return db['SquareRecording'][_0x4a59('0x44')]({'where':{'id':_0x2d0476[_0x4a59('0x41')]['id']}})[_0x4a59('0x25')](function(_0x1df366){if(_[_0x4a59('0x57')](_0x1df366)){throw new ReferenceError(_0x4a59('0x58'));}return _0x1df366;})[_0x4a59('0x25')](function(_0x2081b8){var _0x1b2e61=_0x2081b8['savePath'];logger[_0x4a59('0x59')](_0x4a59('0x5a'),_0x1b2e61);if(!_[_0x4a59('0x57')](_0x2081b8[_0x4a59('0x4c')])&&fs['existsSync'](_0x1b2e61)){logger[_0x4a59('0x59')](_0x4a59('0x5b')+_0x1b2e61+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4a59('0x5c')](_0x1b2e61);}_0x1b2e61=_0x1b2e61+_0x4a59('0x5d');if(!_['isNil'](_0x2081b8[_0x4a59('0x4c')])&&fs['existsSync'](_0x1b2e61)){logger[_0x4a59('0x59')](_0x4a59('0x5b')+_0x1b2e61+_0x4a59('0x5e'));fs['unlinkSync'](_0x1b2e61);}return _0x2081b8;})[_0x4a59('0x25')](function(_0xc3d74c){if(!_0xc3d74c)throw new InternalError();return _0xc3d74c[_0x4a59('0x24')]();})[_0x4a59('0x25')](function(){_0x29695e[_0x4a59('0x18')](0xcc)[_0x4a59('0x19')]();})[_0x4a59('0x47')](handleError(_0x29695e,null));};
\ No newline at end of file
+var _0x24b0=['json','save','then','destroy','end','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','catch','update','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','message','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range'];(function(_0x426b48,_0x595c31){var _0x31004d=function(_0x115016){while(--_0x115016){_0x426b48['push'](_0x426b48['shift']());}};_0x31004d(++_0x595c31);}(_0x24b0,0x104));var _0x024b=function(_0xb419b5,_0x1941ab){_0xb419b5=_0xb419b5-0x0;var _0x21cdd2=_0x24b0[_0xb419b5];return _0x21cdd2;};'use strict';var emlformat=require(_0x024b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x024b('0x1'));var rp=require(_0x024b('0x2'));var moment=require(_0x024b('0x3'));var BPromise=require(_0x024b('0x4'));var Mustache=require(_0x024b('0x5'));var util=require(_0x024b('0x6'));var path=require('path');var sox=require(_0x024b('0x7'));var csv=require(_0x024b('0x8'));var ejs=require(_0x024b('0x9'));var fs=require('fs');var fs_extra=require(_0x024b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x024b('0xb'));var jsforce=require(_0x024b('0xc'));var deskjs=require(_0x024b('0xd'));var toCsv=require(_0x024b('0x8'));var querystring=require(_0x024b('0xe'));var Papa=require(_0x024b('0xf'));var Redis=require(_0x024b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x024b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x024b('0x12'));var logger=require('../../config/logger')(_0x024b('0x13'));var utils=require(_0x024b('0x14'));var config=require(_0x024b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x024b('0x16'))['db'];function respondWithStatusCode(_0x3de9f0,_0x530c69){_0x530c69=_0x530c69||0xcc;return function(_0x4e474a){if(_0x4e474a){return _0x3de9f0[_0x024b('0x17')](_0x530c69);}return _0x3de9f0[_0x024b('0x18')](_0x530c69)['end']();};}function respondWithResult(_0x29e2c0,_0xa0e3a9){_0xa0e3a9=_0xa0e3a9||0xc8;return function(_0x2bcbde){if(_0x2bcbde){return _0x29e2c0[_0x024b('0x18')](_0xa0e3a9)['json'](_0x2bcbde);}};}function respondWithFilteredResult(_0x3eac8c,_0x2bd722){return function(_0x46dc9b){if(_0x46dc9b){var _0x1c5588=typeof _0x2bd722['offset']===_0x024b('0x19')&&typeof _0x2bd722[_0x024b('0x1a')]===_0x024b('0x19');var _0x262b87=_0x46dc9b[_0x024b('0x1b')];var _0x3c8fe8=_0x1c5588?0x0:_0x2bd722[_0x024b('0x1c')];var _0x4ae4b0=_0x1c5588?_0x46dc9b[_0x024b('0x1b')]:_0x2bd722[_0x024b('0x1c')]+_0x2bd722[_0x024b('0x1a')];var _0x1eade0;if(_0x4ae4b0>=_0x262b87){_0x4ae4b0=_0x262b87;_0x1eade0=0xc8;}else{_0x1eade0=0xce;}_0x3eac8c['status'](_0x1eade0);return _0x3eac8c[_0x024b('0x1d')](_0x024b('0x1e'),_0x3c8fe8+'-'+_0x4ae4b0+'/'+_0x262b87)[_0x024b('0x1f')](_0x46dc9b);}return null;};}function patchUpdates(_0x1cd6f5){return function(_0x30a00b){try{jsonpatch['apply'](_0x30a00b,_0x1cd6f5,!![]);}catch(_0x4280db){return BPromise['reject'](_0x4280db);}return _0x30a00b[_0x024b('0x20')]();};}function saveUpdates(_0x5d262e,_0xfa1770){return function(_0x53d7eb){if(_0x53d7eb){return _0x53d7eb['update'](_0x5d262e)[_0x024b('0x21')](function(_0x2037e9){return _0x2037e9;});}return null;};}function removeEntity(_0x46835e,_0x3c965f){return function(_0x12a906){if(_0x12a906){return _0x12a906[_0x024b('0x22')]()[_0x024b('0x21')](function(){_0x46835e['status'](0xcc)[_0x024b('0x23')]();});}};}function handleEntityNotFound(_0x1aa895,_0x4da8c8){return function(_0x242d4c){if(!_0x242d4c){_0x1aa895[_0x024b('0x17')](0x194);}return _0x242d4c;};}function handleError(_0x258dbe,_0xf02ace){_0xf02ace=_0xf02ace||0x1f4;return function(_0x1605b1){logger[_0x024b('0x24')](_0x1605b1[_0x024b('0x25')]);if(_0x1605b1[_0x024b('0x26')]){delete _0x1605b1[_0x024b('0x26')];}_0x258dbe[_0x024b('0x18')](_0xf02ace)[_0x024b('0x27')](_0x1605b1);};}exports[_0x024b('0x28')]=function(_0x46491e,_0x5bc0c0){var _0x5e488f={},_0x205cab={},_0x4591ac={'count':0x0,'rows':[]};var _0x3b77d3=_['map'](db[_0x024b('0x29')][_0x024b('0x2a')],function(_0x1e80ee){return{'name':_0x1e80ee[_0x024b('0x2b')],'type':_0x1e80ee[_0x024b('0x2c')][_0x024b('0x2d')]};});_0x205cab[_0x024b('0x2e')]=_[_0x024b('0x2f')](_0x3b77d3,_0x024b('0x26'));_0x205cab[_0x024b('0x30')]=_[_0x024b('0x31')](_0x46491e['query']);_0x205cab[_0x024b('0x32')]=_[_0x024b('0x33')](_0x205cab[_0x024b('0x2e')],_0x205cab[_0x024b('0x30')]);_0x5e488f[_0x024b('0x34')]=_[_0x024b('0x33')](_0x205cab[_0x024b('0x2e')],qs['fields'](_0x46491e[_0x024b('0x30')][_0x024b('0x35')]));_0x5e488f[_0x024b('0x34')]=_0x5e488f[_0x024b('0x34')][_0x024b('0x36')]?_0x5e488f[_0x024b('0x34')]:_0x205cab[_0x024b('0x2e')];if(!_0x46491e[_0x024b('0x30')][_0x024b('0x37')](_0x024b('0x38'))){_0x5e488f[_0x024b('0x1a')]=qs[_0x024b('0x1a')](_0x46491e[_0x024b('0x30')][_0x024b('0x1a')]);_0x5e488f[_0x024b('0x1c')]=qs[_0x024b('0x1c')](_0x46491e[_0x024b('0x30')]['offset']);}_0x5e488f[_0x024b('0x39')]=qs[_0x024b('0x3a')](_0x46491e[_0x024b('0x30')][_0x024b('0x3a')]);_0x5e488f[_0x024b('0x3b')]=qs[_0x024b('0x32')](_['pick'](_0x46491e[_0x024b('0x30')],_0x205cab[_0x024b('0x32')]),_0x3b77d3);if(_0x46491e[_0x024b('0x30')][_0x024b('0x3c')]){_0x5e488f['where']=_[_0x024b('0x3d')](_0x5e488f[_0x024b('0x3b')],{'$or':_[_0x024b('0x2f')](_0x3b77d3,function(_0x1c3448){if(_0x1c3448[_0x024b('0x2c')]!==_0x024b('0x3e')){var _0x52b6e2={};_0x52b6e2[_0x1c3448[_0x024b('0x26')]]={'$like':'%'+_0x46491e[_0x024b('0x30')][_0x024b('0x3c')]+'%'};return _0x52b6e2;}})});}_0x5e488f=_[_0x024b('0x3d')]({},_0x5e488f,_0x46491e[_0x024b('0x3f')]);var _0xa7a927={'where':_0x5e488f[_0x024b('0x3b')]};return db['SquareRecording'][_0x024b('0x1b')](_0xa7a927)[_0x024b('0x21')](function(_0x3ebe29){_0x4591ac['count']=_0x3ebe29;if(_0x46491e[_0x024b('0x30')][_0x024b('0x40')]){_0x5e488f[_0x024b('0x41')]=[{'all':!![]}];}return db[_0x024b('0x29')]['findAll'](_0x5e488f);})[_0x024b('0x21')](function(_0x1b9715){_0x4591ac[_0x024b('0x42')]=_0x1b9715;return _0x4591ac;})['then'](respondWithFilteredResult(_0x5bc0c0,_0x5e488f))['catch'](handleError(_0x5bc0c0,null));};exports[_0x024b('0x43')]=function(_0x2348d1,_0x56c9ce){var _0x1e268c={'raw':!![],'where':{'id':_0x2348d1[_0x024b('0x44')]['id']}},_0x445e85={};_0x445e85[_0x024b('0x2e')]=_['keys'](db['SquareRecording'][_0x024b('0x2a')]);_0x445e85[_0x024b('0x30')]=_[_0x024b('0x31')](_0x2348d1[_0x024b('0x30')]);_0x445e85[_0x024b('0x32')]=_[_0x024b('0x33')](_0x445e85[_0x024b('0x2e')],_0x445e85['query']);_0x1e268c[_0x024b('0x34')]=_[_0x024b('0x33')](_0x445e85[_0x024b('0x2e')],qs['fields'](_0x2348d1[_0x024b('0x30')][_0x024b('0x35')]));_0x1e268c[_0x024b('0x34')]=_0x1e268c[_0x024b('0x34')][_0x024b('0x36')]?_0x1e268c[_0x024b('0x34')]:_0x445e85[_0x024b('0x2e')];if(_0x2348d1['query']['includeAll']){_0x1e268c['include']=[{'all':!![]}];}_0x1e268c=_[_0x024b('0x3d')]({},_0x1e268c,_0x2348d1[_0x024b('0x3f')]);return db['SquareRecording'][_0x024b('0x45')](_0x1e268c)[_0x024b('0x21')](handleEntityNotFound(_0x56c9ce,null))['then'](respondWithResult(_0x56c9ce,null))['catch'](handleError(_0x56c9ce,null));};exports[_0x024b('0x46')]=function(_0x47e42d,_0x438570){return db[_0x024b('0x29')][_0x024b('0x46')](_0x47e42d[_0x024b('0x47')],{})[_0x024b('0x21')](respondWithResult(_0x438570,0xc9))[_0x024b('0x48')](handleError(_0x438570,null));};exports[_0x024b('0x49')]=function(_0x32e570,_0x46d336){if(_0x32e570[_0x024b('0x47')]['id']){delete _0x32e570[_0x024b('0x47')]['id'];}return db['SquareRecording'][_0x024b('0x45')]({'where':{'id':_0x32e570['params']['id']}})[_0x024b('0x21')](handleEntityNotFound(_0x46d336,null))[_0x024b('0x21')](saveUpdates(_0x32e570[_0x024b('0x47')],null))['then'](respondWithResult(_0x46d336,null))[_0x024b('0x48')](handleError(_0x46d336,null));};exports['download']=function(_0x32f6f3,_0x430fa4,_0x56d4b3){var _0x713a66=require('../../components/encryptor');var _0x581dc5=![];var _0x23ee47={};if(_0x32f6f3['query'][_0x024b('0x2c')]&&_0x32f6f3['query']['type']==='uniqueid'){_0x23ee47[_0x024b('0x4a')]=_0x32f6f3[_0x024b('0x44')]['id'];}else{_0x23ee47['id']=_0x32f6f3[_0x024b('0x44')]['id'];}return db[_0x024b('0x29')]['find']({'where':_0x23ee47,'attributes':['id',_0x024b('0x4b'),_0x024b('0x4c')],'raw':!![]})[_0x024b('0x21')](handleEntityNotFound(_0x430fa4,null))[_0x024b('0x21')](function(_0x35bccd){if(_0x35bccd){var _0x357e6f=_0x35bccd[_0x024b('0x4b')];var _0x3897d1=util[_0x024b('0x4d')](_0x024b('0x4e'),_0x357e6f);if(fs[_0x024b('0x4f')](_0x3897d1)){_0x581dc5=!![];return _0x713a66[_0x024b('0x50')](_0x3897d1,_0x357e6f,config[_0x024b('0x51')][_0x024b('0x52')])[_0x024b('0x21')](function(){return _0x35bccd;});}return _0x35bccd;}})[_0x024b('0x21')](function(_0x2ee0e7){if(_0x2ee0e7){var _0x2a4da2=_0x2ee0e7[_0x024b('0x4b')];if(!fs['existsSync'](_0x2a4da2)){throw new db[(_0x024b('0x53'))][(_0x024b('0x54'))](_0x024b('0x55'));}if(_0x2ee0e7[_0x024b('0x4c')]){return _0x430fa4[_0x024b('0x56')](_0x2a4da2,_0x2ee0e7[_0x024b('0x4c')]+path[_0x024b('0x57')](_0x2a4da2),function(){if(_0x581dc5){fs['unlink'](_0x2a4da2);}});}else{return _0x430fa4[_0x024b('0x56')](_0x2a4da2,function(_0x4d81c3){if(_0x581dc5){fs['unlink'](_0x2a4da2);}});}}})[_0x024b('0x48')](function(_0x519854){if(_0x519854[_0x024b('0x58')]===_0x024b('0x55')){_0x430fa4['status'](0x194)[_0x024b('0x27')]('Not\x20found');}else{return handleError(_0x430fa4,null);}});};exports[_0x024b('0x22')]=function(_0x5a8309,_0x2ab3d8){return db['SquareRecording'][_0x024b('0x45')]({'where':{'id':_0x5a8309[_0x024b('0x44')]['id']}})[_0x024b('0x21')](function(_0x3280f2){if(_['isNil'](_0x3280f2)){throw new ReferenceError(_0x024b('0x59'));}return _0x3280f2;})[_0x024b('0x21')](function(_0x5f12f8){var _0xc2ff20=_0x5f12f8[_0x024b('0x4b')];logger[_0x024b('0x5a')](_0x024b('0x5b'),_0xc2ff20);if(!_[_0x024b('0x5c')](_0x5f12f8[_0x024b('0x4b')])&&fs[_0x024b('0x4f')](_0xc2ff20)){logger['info']('File:\x20\x22'+_0xc2ff20+_0x024b('0x5d'));fs[_0x024b('0x5e')](_0xc2ff20);}_0xc2ff20=_0xc2ff20+_0x024b('0x5f');if(!_[_0x024b('0x5c')](_0x5f12f8[_0x024b('0x4b')])&&fs[_0x024b('0x4f')](_0xc2ff20)){logger['info'](_0x024b('0x60')+_0xc2ff20+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0xc2ff20);}return _0x5f12f8;})['then'](function(_0x8fb30a){if(!_0x8fb30a)throw new InternalError();return _0x8fb30a[_0x024b('0x22')]();})['then'](function(){_0x2ab3d8[_0x024b('0x18')](0xcc)[_0x024b('0x23')]();})[_0x024b('0x48')](handleError(_0x2ab3d8,null));};
\ No newline at end of file
index 3f5aeb8..9f4c2d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb44a=['../../config/logger','moment','path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings'];(function(_0x4deea0,_0xb25ba0){var _0x570ad9=function(_0x490931){while(--_0x490931){_0x4deea0['push'](_0x4deea0['shift']());}};_0x570ad9(++_0xb25ba0);}(_0xb44a,0x1c2));var _0xab44=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0xb44a[_0x2212d1];return _0x15eec5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0295=['define','lodash','api','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x57ad93,_0x54ec6b){var _0x124570=function(_0x2faefb){while(--_0x2faefb){_0x57ad93['push'](_0x57ad93['shift']());}};_0x124570(++_0x54ec6b);}(_0x0295,0x1f0));var _0x5029=function(_0x299d27,_0x4cbc19){_0x299d27=_0x299d27-0x0;var _0x5692a1=_0x0295[_0x299d27];return _0x5692a1;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 18a5458..2cb88af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc501=['body','options','raw','debug','stringify','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareRecording','SquareRecording','create'];(function(_0x2107e7,_0x21233d){var _0x2f15d5=function(_0x269f6c){while(--_0x269f6c){_0x2107e7['push'](_0x2107e7['shift']());}};_0x2f15d5(++_0x21233d);}(_0xc501,0x10b));var _0x1c50=function(_0x33dcf7,_0x3d5390){_0x33dcf7=_0x33dcf7-0x0;var _0x542d4e=_0xc501[_0x33dcf7];return _0x542d4e;};'use strict';var _=require(_0x1c50('0x0'));var util=require(_0x1c50('0x1'));var moment=require(_0x1c50('0x2'));var BPromise=require(_0x1c50('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c50('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c50('0x5'))(_0x1c50('0x6'));var config=require(_0x1c50('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1c50('0x8')][_0x1c50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a8869,_0x1b6793,_0x2ad4f4){return new BPromise(function(_0x31bc66,_0x28c5e6){return client[_0x1c50('0xa')](_0x2a8869,_0x2ad4f4)[_0x1c50('0xb')](function(_0xfaf52c){logger[_0x1c50('0xc')](_0x1c50('0xd'),_0x1b6793,_0x1c50('0xe'));logger['debug'](_0x1c50('0xf'),_0x1b6793,_0x1c50('0xe'),JSON['stringify'](_0xfaf52c));if(_0xfaf52c[_0x1c50('0x10')]){if(_0xfaf52c[_0x1c50('0x10')][_0x1c50('0x11')]===0x1f4){logger['error'](_0x1c50('0xd'),_0x1b6793,_0xfaf52c[_0x1c50('0x10')][_0x1c50('0x12')]);return _0x28c5e6(_0xfaf52c[_0x1c50('0x10')][_0x1c50('0x12')]);}logger[_0x1c50('0x10')](_0x1c50('0xd'),_0x1b6793,_0xfaf52c['error'][_0x1c50('0x12')]);return _0x31bc66(_0xfaf52c[_0x1c50('0x10')]['message']);}else{logger[_0x1c50('0xc')](_0x1c50('0xd'),_0x1b6793,'request\x20sent');_0x31bc66(_0xfaf52c[_0x1c50('0x13')][_0x1c50('0x12')]);}})['catch'](function(_0x34ca51){logger[_0x1c50('0x10')]('SquareRecording,\x20%s,\x20%s',_0x1b6793,_0x34ca51);_0x28c5e6(_0x34ca51);});});}exports[_0x1c50('0x14')]=function(_0x59755a){var _0x3d9891=this;return new Promise(function(_0x21b2b2,_0x25fafc){return db[_0x1c50('0x15')][_0x1c50('0x16')](_0x59755a[_0x1c50('0x17')],{'raw':_0x59755a[_0x1c50('0x18')]?_0x59755a[_0x1c50('0x18')][_0x1c50('0x19')]===undefined?!![]:![]:!![]})[_0x1c50('0xb')](function(_0x4090ca){logger[_0x1c50('0xc')](_0x1c50('0x14'),_0x59755a);logger[_0x1c50('0x1a')]('CreateSquareRecording',_0x59755a,JSON[_0x1c50('0x1b')](_0x4090ca));_0x21b2b2(_0x4090ca);})[_0x1c50('0x1c')](function(_0x42309e){logger[_0x1c50('0x10')](_0x1c50('0x14'),_0x42309e[_0x1c50('0x12')],_0x59755a);_0x25fafc(_0x3d9891[_0x1c50('0x10')](0x1f4,_0x42309e[_0x1c50('0x12')]));});});};
\ No newline at end of file
+var _0x97c2=['../../config/environment','jayson/promise','client','http','request','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareRecording','SquareRecording','create','body','options','raw','then','debug','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x4cdd67,_0x42835a){var _0x546041=function(_0x3469e0){while(--_0x3469e0){_0x4cdd67['push'](_0x4cdd67['shift']());}};_0x546041(++_0x42835a);}(_0x97c2,0x11c));var _0x297c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x97c2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x297c('0x0'));var util=require('util');var moment=require(_0x297c('0x1'));var BPromise=require(_0x297c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x297c('0x3'));var db=require(_0x297c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x297c('0x5'));var config=require(_0x297c('0x6'));var jayson=require(_0x297c('0x7'));var client=jayson[_0x297c('0x8')][_0x297c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a30bf,_0xd57005,_0x11f192){return new BPromise(function(_0x32883e,_0x33aeb9){return client[_0x297c('0xa')](_0x3a30bf,_0x11f192)['then'](function(_0x51538f){logger['info'](_0x297c('0xb'),_0xd57005,_0x297c('0xc'));logger['debug'](_0x297c('0xd'),_0xd57005,_0x297c('0xc'),JSON[_0x297c('0xe')](_0x51538f));if(_0x51538f[_0x297c('0xf')]){if(_0x51538f[_0x297c('0xf')][_0x297c('0x10')]===0x1f4){logger[_0x297c('0xf')](_0x297c('0xb'),_0xd57005,_0x51538f[_0x297c('0xf')]['message']);return _0x33aeb9(_0x51538f['error'][_0x297c('0x11')]);}logger[_0x297c('0xf')]('SquareRecording,\x20%s,\x20%s',_0xd57005,_0x51538f[_0x297c('0xf')][_0x297c('0x11')]);return _0x32883e(_0x51538f['error'][_0x297c('0x11')]);}else{logger[_0x297c('0x12')](_0x297c('0xb'),_0xd57005,'request\x20sent');_0x32883e(_0x51538f[_0x297c('0x13')][_0x297c('0x11')]);}})['catch'](function(_0x142dba){logger[_0x297c('0xf')](_0x297c('0xb'),_0xd57005,_0x142dba);_0x33aeb9(_0x142dba);});});}exports[_0x297c('0x14')]=function(_0x57833a){var _0x5481ce=this;return new Promise(function(_0x328799,_0x2db4b3){return db[_0x297c('0x15')][_0x297c('0x16')](_0x57833a[_0x297c('0x17')],{'raw':_0x57833a[_0x297c('0x18')]?_0x57833a['options'][_0x297c('0x19')]===undefined?!![]:![]:!![]})[_0x297c('0x1a')](function(_0x15e4a2){logger[_0x297c('0x12')](_0x297c('0x14'),_0x57833a);logger[_0x297c('0x1b')](_0x297c('0x14'),_0x57833a,JSON[_0x297c('0xe')](_0x15e4a2));_0x328799(_0x15e4a2);})[_0x297c('0x1c')](function(_0x8a5822){logger['error'](_0x297c('0x14'),_0x8a5822[_0x297c('0x11')],_0x57833a);_0x2db4b3(_0x5481ce[_0x297c('0xf')](0x1f4,_0x8a5822['message']));});});};
\ No newline at end of file
index b345c7b..f7c1bb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2838e2,_0x2f8d6e){var _0x4c20f4=function(_0x374a98){while(--_0x374a98){_0x2838e2['push'](_0x2838e2['shift']());}};_0x4c20f4(++_0x2f8d6e);}(_0xb10b,0x12a));var _0xbb10=function(_0xbaf699,_0x4aa945){_0xbaf699=_0xbaf699-0x0;var _0x55a131=_0xb10b[_0xbaf699];return _0x55a131;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_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('./squareReport.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
index 746405b..e4eed84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7438=['exports','STRING','DATE','BOOLEAN'];(function(_0x4230dc,_0x5b9c73){var _0x2d65d2=function(_0x296202){while(--_0x296202){_0x4230dc['push'](_0x4230dc['shift']());}};_0x2d65d2(++_0x5b9c73);}(_0x7438,0xd4));var _0x8743=function(_0x181f2c,_0x44a72b){_0x181f2c=_0x181f2c-0x0;var _0x300cf8=_0x7438[_0x181f2c];return _0x300cf8;};'use strict';var Sequelize=require('sequelize');module[_0x8743('0x0')]={'network':{'type':Sequelize[_0x8743('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x8743('0x1')]},'channel':{'type':Sequelize[_0x8743('0x1')]},'language':{'type':Sequelize[_0x8743('0x1')]},'type':{'type':Sequelize[_0x8743('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x8743('0x1')]},'callerid':{'type':Sequelize[_0x8743('0x1')]},'calleridname':{'type':Sequelize[_0x8743('0x1')]},'callingpres':{'type':Sequelize[_0x8743('0x1')]},'callingani2':{'type':Sequelize[_0x8743('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x8743('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x8743('0x1')]},'context':{'type':Sequelize[_0x8743('0x1')]},'extension':{'type':Sequelize[_0x8743('0x1')]},'priority':{'type':Sequelize[_0x8743('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x8743('0x1')]},'joinAt':{'type':Sequelize[_0x8743('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x8743('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x35ec=['sequelize','STRING','DATE'];(function(_0x5b80c7,_0x3b676c){var _0x59e729=function(_0x761ce5){while(--_0x761ce5){_0x5b80c7['push'](_0x5b80c7['shift']());}};_0x59e729(++_0x3b676c);}(_0x35ec,0xde));var _0xc35e=function(_0x54597b,_0x223ac4){_0x54597b=_0x54597b-0x0;var _0x40e3be=_0x35ec[_0x54597b];return _0x40e3be;};'use strict';var Sequelize=require(_0xc35e('0x0'));module['exports']={'network':{'type':Sequelize[_0xc35e('0x1')]},'network_script':{'type':Sequelize[_0xc35e('0x1')]},'request':{'type':Sequelize[_0xc35e('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc35e('0x1')]},'type':{'type':Sequelize[_0xc35e('0x1')]},'uniqueid':{'type':Sequelize[_0xc35e('0x1')]},'version':{'type':Sequelize[_0xc35e('0x1')]},'callerid':{'type':Sequelize[_0xc35e('0x1')]},'calleridname':{'type':Sequelize[_0xc35e('0x1')]},'callingpres':{'type':Sequelize[_0xc35e('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xc35e('0x1')]},'dnid':{'type':Sequelize[_0xc35e('0x1')]},'rdnis':{'type':Sequelize[_0xc35e('0x1')]},'context':{'type':Sequelize[_0xc35e('0x1')]},'extension':{'type':Sequelize[_0xc35e('0x1')]},'priority':{'type':Sequelize[_0xc35e('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc35e('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xc35e('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc35e('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index c23b9c0..684a28c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f96=['limit','count','offset','set','apply','reject','save','update','then','error','stack','name','index','SquareReport','rawAttributes','fieldName','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','filter','merge','where','map','type','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined'];(function(_0x186166,_0x549bc9){var _0x6dc33f=function(_0x10c54b){while(--_0x10c54b){_0x186166['push'](_0x186166['shift']());}};_0x6dc33f(++_0x549bc9);}(_0x9f96,0x10b));var _0x69f9=function(_0x271ce9,_0x20240c){_0x271ce9=_0x271ce9-0x0;var _0x12683d=_0x9f96[_0x271ce9];return _0x12683d;};'use strict';var emlformat=require(_0x69f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69f9('0x1'));var jsonpatch=require(_0x69f9('0x2'));var rp=require(_0x69f9('0x3'));var moment=require(_0x69f9('0x4'));var BPromise=require(_0x69f9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x69f9('0x6'));var csv=require(_0x69f9('0x7'));var ejs=require(_0x69f9('0x8'));var fs=require('fs');var fs_extra=require(_0x69f9('0x9'));var _=require(_0x69f9('0xa'));var squel=require(_0x69f9('0xb'));var crypto=require(_0x69f9('0xc'));var jsforce=require(_0x69f9('0xd'));var deskjs=require(_0x69f9('0xe'));var toCsv=require(_0x69f9('0x7'));var querystring=require('querystring');var Papa=require(_0x69f9('0xf'));var Redis=require(_0x69f9('0x10'));var authService=require(_0x69f9('0x11'));var qs=require(_0x69f9('0x12'));var as=require(_0x69f9('0x13'));var hardwareService=require(_0x69f9('0x14'));var logger=require(_0x69f9('0x15'))('api');var utils=require(_0x69f9('0x16'));var config=require(_0x69f9('0x17'));var licenseUtil=require(_0x69f9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x267d1b,_0x1f0cce){_0x1f0cce=_0x1f0cce||0xcc;return function(_0x45c5d1){if(_0x45c5d1){return _0x267d1b['sendStatus'](_0x1f0cce);}return _0x267d1b[_0x69f9('0x19')](_0x1f0cce)[_0x69f9('0x1a')]();};}function respondWithResult(_0x4c027f,_0x4688f7){_0x4688f7=_0x4688f7||0xc8;return function(_0x310c04){if(_0x310c04){return _0x4c027f[_0x69f9('0x19')](_0x4688f7)[_0x69f9('0x1b')](_0x310c04);}};}function respondWithFilteredResult(_0x2136d5,_0x1bc56d){return function(_0x317340){if(_0x317340){var _0x51c877=typeof _0x1bc56d['offset']===_0x69f9('0x1c')&&typeof _0x1bc56d[_0x69f9('0x1d')]===_0x69f9('0x1c');var _0x3c3dea=_0x317340[_0x69f9('0x1e')];var _0x3ab220=_0x51c877?0x0:_0x1bc56d[_0x69f9('0x1f')];var _0x1b9e5b=_0x51c877?_0x317340['count']:_0x1bc56d[_0x69f9('0x1f')]+_0x1bc56d[_0x69f9('0x1d')];var _0x432b7f;if(_0x1b9e5b>=_0x3c3dea){_0x1b9e5b=_0x3c3dea;_0x432b7f=0xc8;}else{_0x432b7f=0xce;}_0x2136d5[_0x69f9('0x19')](_0x432b7f);return _0x2136d5[_0x69f9('0x20')]('Content-Range',_0x3ab220+'-'+_0x1b9e5b+'/'+_0x3c3dea)[_0x69f9('0x1b')](_0x317340);}return null;};}function patchUpdates(_0x147022){return function(_0x54d766){try{jsonpatch[_0x69f9('0x21')](_0x54d766,_0x147022,!![]);}catch(_0x54444c){return BPromise[_0x69f9('0x22')](_0x54444c);}return _0x54d766[_0x69f9('0x23')]();};}function saveUpdates(_0x60cca6,_0x54620d){return function(_0x5bc613){if(_0x5bc613){return _0x5bc613[_0x69f9('0x24')](_0x60cca6)[_0x69f9('0x25')](function(_0x2d39ce){return _0x2d39ce;});}return null;};}function removeEntity(_0x150fe2,_0x5e7d5f){return function(_0x4762c0){if(_0x4762c0){return _0x4762c0['destroy']()[_0x69f9('0x25')](function(){_0x150fe2['status'](0xcc)[_0x69f9('0x1a')]();});}};}function handleEntityNotFound(_0x1690be,_0x160e68){return function(_0x226ecd){if(!_0x226ecd){_0x1690be['sendStatus'](0x194);}return _0x226ecd;};}function handleError(_0x329e40,_0x46d3ec){_0x46d3ec=_0x46d3ec||0x1f4;return function(_0x3f848d){logger[_0x69f9('0x26')](_0x3f848d[_0x69f9('0x27')]);if(_0x3f848d[_0x69f9('0x28')]){delete _0x3f848d[_0x69f9('0x28')];}_0x329e40['status'](_0x46d3ec)['send'](_0x3f848d);};}exports[_0x69f9('0x29')]=function(_0x17fa6f,_0xb577bd){var _0x47a18f={},_0x567df7={},_0x1b277a={'count':0x0,'rows':[]};var _0x5c6157=_['map'](db[_0x69f9('0x2a')][_0x69f9('0x2b')],function(_0xa1d891){return{'name':_0xa1d891[_0x69f9('0x2c')],'type':_0xa1d891['type'][_0x69f9('0x2d')]};});_0x567df7['model']=_['map'](_0x5c6157,'name');_0x567df7['query']=_[_0x69f9('0x2e')](_0x17fa6f[_0x69f9('0x2f')]);_0x567df7[_0x69f9('0x30')]=_['intersection'](_0x567df7['model'],_0x567df7[_0x69f9('0x2f')]);_0x47a18f[_0x69f9('0x31')]=_[_0x69f9('0x32')](_0x567df7[_0x69f9('0x33')],qs['fields'](_0x17fa6f[_0x69f9('0x2f')][_0x69f9('0x34')]));_0x47a18f[_0x69f9('0x31')]=_0x47a18f[_0x69f9('0x31')][_0x69f9('0x35')]?_0x47a18f[_0x69f9('0x31')]:_0x567df7['model'];if(!_0x17fa6f[_0x69f9('0x2f')][_0x69f9('0x36')](_0x69f9('0x37'))){_0x47a18f[_0x69f9('0x1d')]=qs[_0x69f9('0x1d')](_0x17fa6f[_0x69f9('0x2f')][_0x69f9('0x1d')]);_0x47a18f['offset']=qs[_0x69f9('0x1f')](_0x17fa6f['query'][_0x69f9('0x1f')]);}_0x47a18f[_0x69f9('0x38')]=qs['sort'](_0x17fa6f[_0x69f9('0x2f')]['sort']);_0x47a18f['where']=qs[_0x69f9('0x30')](_['pick'](_0x17fa6f[_0x69f9('0x2f')],_0x567df7[_0x69f9('0x30')]),_0x5c6157);if(_0x17fa6f[_0x69f9('0x2f')][_0x69f9('0x39')]){_0x47a18f['where']=_[_0x69f9('0x3a')](_0x47a18f[_0x69f9('0x3b')],{'$or':_[_0x69f9('0x3c')](_0x5c6157,function(_0x4a5a32){if(_0x4a5a32[_0x69f9('0x3d')]!=='VIRTUAL'){var _0x146fad={};_0x146fad[_0x4a5a32[_0x69f9('0x28')]]={'$like':'%'+_0x17fa6f[_0x69f9('0x2f')]['filter']+'%'};return _0x146fad;}})});}_0x47a18f=_[_0x69f9('0x3a')]({},_0x47a18f,_0x17fa6f['options']);var _0xaf4d91={'where':_0x47a18f[_0x69f9('0x3b')]};return db[_0x69f9('0x2a')][_0x69f9('0x1e')](_0xaf4d91)[_0x69f9('0x25')](function(_0x359be6){_0x1b277a['count']=_0x359be6;if(_0x17fa6f[_0x69f9('0x2f')]['includeAll']){_0x47a18f[_0x69f9('0x3e')]=[{'all':!![]}];}return db[_0x69f9('0x2a')][_0x69f9('0x3f')](_0x47a18f);})[_0x69f9('0x25')](function(_0x223bff){_0x1b277a[_0x69f9('0x40')]=_0x223bff;return _0x1b277a;})['then'](respondWithFilteredResult(_0xb577bd,_0x47a18f))[_0x69f9('0x41')](handleError(_0xb577bd,null));};exports[_0x69f9('0x42')]=function(_0x358885,_0x55dac8){var _0x25f2b5={'raw':!![],'where':{'id':_0x358885[_0x69f9('0x43')]['id']}},_0x31b206={};_0x31b206[_0x69f9('0x33')]=_['keys'](db[_0x69f9('0x2a')][_0x69f9('0x2b')]);_0x31b206['query']=_['keys'](_0x358885['query']);_0x31b206[_0x69f9('0x30')]=_[_0x69f9('0x32')](_0x31b206[_0x69f9('0x33')],_0x31b206[_0x69f9('0x2f')]);_0x25f2b5[_0x69f9('0x31')]=_[_0x69f9('0x32')](_0x31b206['model'],qs[_0x69f9('0x34')](_0x358885[_0x69f9('0x2f')][_0x69f9('0x34')]));_0x25f2b5[_0x69f9('0x31')]=_0x25f2b5[_0x69f9('0x31')][_0x69f9('0x35')]?_0x25f2b5[_0x69f9('0x31')]:_0x31b206[_0x69f9('0x33')];if(_0x358885['query']['includeAll']){_0x25f2b5[_0x69f9('0x3e')]=[{'all':!![]}];}_0x25f2b5=_[_0x69f9('0x3a')]({},_0x25f2b5,_0x358885[_0x69f9('0x44')]);return db['SquareReport'][_0x69f9('0x45')](_0x25f2b5)[_0x69f9('0x25')](handleEntityNotFound(_0x55dac8,null))[_0x69f9('0x25')](respondWithResult(_0x55dac8,null))[_0x69f9('0x41')](handleError(_0x55dac8,null));};exports[_0x69f9('0x46')]=function(_0x2b166a,_0x47b039){return db[_0x69f9('0x2a')][_0x69f9('0x46')](_0x2b166a[_0x69f9('0x47')],{})['then'](respondWithResult(_0x47b039,0xc9))[_0x69f9('0x41')](handleError(_0x47b039,null));};exports[_0x69f9('0x24')]=function(_0x40fe34,_0x578f13){if(_0x40fe34[_0x69f9('0x47')]['id']){delete _0x40fe34[_0x69f9('0x47')]['id'];}return db[_0x69f9('0x2a')][_0x69f9('0x45')]({'where':{'id':_0x40fe34[_0x69f9('0x43')]['id']}})[_0x69f9('0x25')](handleEntityNotFound(_0x578f13,null))[_0x69f9('0x25')](saveUpdates(_0x40fe34[_0x69f9('0x47')],null))[_0x69f9('0x25')](respondWithResult(_0x578f13,null))[_0x69f9('0x41')](handleError(_0x578f13,null));};exports[_0x69f9('0x48')]=function(_0x365eeb,_0x46ac77){return db[_0x69f9('0x2a')][_0x69f9('0x45')]({'where':{'id':_0x365eeb[_0x69f9('0x43')]['id']}})[_0x69f9('0x25')](handleEntityNotFound(_0x46ac77,null))[_0x69f9('0x25')](removeEntity(_0x46ac77,null))['catch'](handleError(_0x46ac77,null));};exports[_0x69f9('0x49')]=function(_0x110901,_0x547a14){return db[_0x69f9('0x2a')][_0x69f9('0x49')]()['then'](respondWithResult(_0x547a14,null))[_0x69f9('0x41')](handleError(_0x547a14,null));};
\ No newline at end of file
+var _0x1333=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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'];(function(_0x55f5a0,_0x37d4ff){var _0x5e2f24=function(_0x4e0196){while(--_0x4e0196){_0x55f5a0['push'](_0x55f5a0['shift']());}};_0x5e2f24(++_0x37d4ff);}(_0x1333,0x124));var _0x3133=function(_0xd63e2d,_0x37884c){_0xd63e2d=_0xd63e2d-0x0;var _0x384239=_0x1333[_0xd63e2d];return _0x384239;};'use strict';var emlformat=require(_0x3133('0x0'));var rimraf=require(_0x3133('0x1'));var zipdir=require(_0x3133('0x2'));var jsonpatch=require(_0x3133('0x3'));var rp=require(_0x3133('0x4'));var moment=require(_0x3133('0x5'));var BPromise=require(_0x3133('0x6'));var Mustache=require(_0x3133('0x7'));var util=require('util');var path=require(_0x3133('0x8'));var sox=require(_0x3133('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3133('0xa'));var _=require('lodash');var squel=require(_0x3133('0xb'));var crypto=require(_0x3133('0xc'));var jsforce=require(_0x3133('0xd'));var deskjs=require(_0x3133('0xe'));var toCsv=require(_0x3133('0xf'));var querystring=require(_0x3133('0x10'));var Papa=require(_0x3133('0x11'));var Redis=require(_0x3133('0x12'));var authService=require(_0x3133('0x13'));var qs=require(_0x3133('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3133('0x15'));var logger=require(_0x3133('0x16'))(_0x3133('0x17'));var utils=require(_0x3133('0x18'));var config=require(_0x3133('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3133('0x1a'))['db'];function respondWithStatusCode(_0x16a773,_0x56166c){_0x56166c=_0x56166c||0xcc;return function(_0x89d776){if(_0x89d776){return _0x16a773[_0x3133('0x1b')](_0x56166c);}return _0x16a773['status'](_0x56166c)[_0x3133('0x1c')]();};}function respondWithResult(_0x418506,_0x24479d){_0x24479d=_0x24479d||0xc8;return function(_0x2789ca){if(_0x2789ca){return _0x418506[_0x3133('0x1d')](_0x24479d)[_0x3133('0x1e')](_0x2789ca);}};}function respondWithFilteredResult(_0x49d8b4,_0x243c66){return function(_0x4da8bf){if(_0x4da8bf){var _0x412cf5=typeof _0x243c66[_0x3133('0x1f')]===_0x3133('0x20')&&typeof _0x243c66[_0x3133('0x21')]==='undefined';var _0x3a604c=_0x4da8bf['count'];var _0x1389b=_0x412cf5?0x0:_0x243c66[_0x3133('0x1f')];var _0x2d626e=_0x412cf5?_0x4da8bf['count']:_0x243c66[_0x3133('0x1f')]+_0x243c66[_0x3133('0x21')];var _0x1dbc75;if(_0x2d626e>=_0x3a604c){_0x2d626e=_0x3a604c;_0x1dbc75=0xc8;}else{_0x1dbc75=0xce;}_0x49d8b4[_0x3133('0x1d')](_0x1dbc75);return _0x49d8b4[_0x3133('0x22')](_0x3133('0x23'),_0x1389b+'-'+_0x2d626e+'/'+_0x3a604c)[_0x3133('0x1e')](_0x4da8bf);}return null;};}function patchUpdates(_0x5d80df){return function(_0x511980){try{jsonpatch[_0x3133('0x24')](_0x511980,_0x5d80df,!![]);}catch(_0x644bc4){return BPromise[_0x3133('0x25')](_0x644bc4);}return _0x511980[_0x3133('0x26')]();};}function saveUpdates(_0x26a91f,_0x23ca7d){return function(_0x14e964){if(_0x14e964){return _0x14e964[_0x3133('0x27')](_0x26a91f)[_0x3133('0x28')](function(_0xcfad1a){return _0xcfad1a;});}return null;};}function removeEntity(_0x1a19b4,_0x593040){return function(_0x1b4e82){if(_0x1b4e82){return _0x1b4e82['destroy']()[_0x3133('0x28')](function(){_0x1a19b4[_0x3133('0x1d')](0xcc)[_0x3133('0x1c')]();});}};}function handleEntityNotFound(_0x430339,_0x1397ec){return function(_0xe3aa1c){if(!_0xe3aa1c){_0x430339[_0x3133('0x1b')](0x194);}return _0xe3aa1c;};}function handleError(_0xfb84c9,_0x355982){_0x355982=_0x355982||0x1f4;return function(_0x140959){logger['error'](_0x140959[_0x3133('0x29')]);if(_0x140959[_0x3133('0x2a')]){delete _0x140959[_0x3133('0x2a')];}_0xfb84c9[_0x3133('0x1d')](_0x355982)[_0x3133('0x2b')](_0x140959);};}exports[_0x3133('0x2c')]=function(_0x5bfdbe,_0x2fe34f){var _0x2e4fe1={},_0x254f94={},_0x4c7f0d={'count':0x0,'rows':[]};var _0xe53439=_[_0x3133('0x2d')](db[_0x3133('0x2e')][_0x3133('0x2f')],function(_0x29bc91){return{'name':_0x29bc91[_0x3133('0x30')],'type':_0x29bc91['type'][_0x3133('0x31')]};});_0x254f94['model']=_['map'](_0xe53439,'name');_0x254f94[_0x3133('0x32')]=_[_0x3133('0x33')](_0x5bfdbe[_0x3133('0x32')]);_0x254f94[_0x3133('0x34')]=_[_0x3133('0x35')](_0x254f94['model'],_0x254f94[_0x3133('0x32')]);_0x2e4fe1[_0x3133('0x36')]=_[_0x3133('0x35')](_0x254f94[_0x3133('0x37')],qs[_0x3133('0x38')](_0x5bfdbe[_0x3133('0x32')][_0x3133('0x38')]));_0x2e4fe1[_0x3133('0x36')]=_0x2e4fe1[_0x3133('0x36')][_0x3133('0x39')]?_0x2e4fe1['attributes']:_0x254f94[_0x3133('0x37')];if(!_0x5bfdbe[_0x3133('0x32')][_0x3133('0x3a')](_0x3133('0x3b'))){_0x2e4fe1[_0x3133('0x21')]=qs[_0x3133('0x21')](_0x5bfdbe[_0x3133('0x32')][_0x3133('0x21')]);_0x2e4fe1[_0x3133('0x1f')]=qs[_0x3133('0x1f')](_0x5bfdbe['query'][_0x3133('0x1f')]);}_0x2e4fe1['order']=qs[_0x3133('0x3c')](_0x5bfdbe[_0x3133('0x32')]['sort']);_0x2e4fe1[_0x3133('0x3d')]=qs[_0x3133('0x34')](_[_0x3133('0x3e')](_0x5bfdbe[_0x3133('0x32')],_0x254f94['filters']),_0xe53439);if(_0x5bfdbe['query'][_0x3133('0x3f')]){_0x2e4fe1['where']=_[_0x3133('0x40')](_0x2e4fe1['where'],{'$or':_[_0x3133('0x2d')](_0xe53439,function(_0x2475f0){if(_0x2475f0[_0x3133('0x41')]!==_0x3133('0x42')){var _0x2f3712={};_0x2f3712[_0x2475f0[_0x3133('0x2a')]]={'$like':'%'+_0x5bfdbe[_0x3133('0x32')][_0x3133('0x3f')]+'%'};return _0x2f3712;}})});}_0x2e4fe1=_[_0x3133('0x40')]({},_0x2e4fe1,_0x5bfdbe[_0x3133('0x43')]);var _0x678160={'where':_0x2e4fe1[_0x3133('0x3d')]};return db[_0x3133('0x2e')][_0x3133('0x44')](_0x678160)[_0x3133('0x28')](function(_0x578a3c){_0x4c7f0d[_0x3133('0x44')]=_0x578a3c;if(_0x5bfdbe['query'][_0x3133('0x45')]){_0x2e4fe1[_0x3133('0x46')]=[{'all':!![]}];}return db[_0x3133('0x2e')][_0x3133('0x47')](_0x2e4fe1);})['then'](function(_0x45a6f7){_0x4c7f0d[_0x3133('0x48')]=_0x45a6f7;return _0x4c7f0d;})[_0x3133('0x28')](respondWithFilteredResult(_0x2fe34f,_0x2e4fe1))[_0x3133('0x49')](handleError(_0x2fe34f,null));};exports[_0x3133('0x4a')]=function(_0x11d027,_0x12e60d){var _0x13081b={'raw':!![],'where':{'id':_0x11d027['params']['id']}},_0x4f45a4={};_0x4f45a4[_0x3133('0x37')]=_[_0x3133('0x33')](db[_0x3133('0x2e')][_0x3133('0x2f')]);_0x4f45a4[_0x3133('0x32')]=_[_0x3133('0x33')](_0x11d027[_0x3133('0x32')]);_0x4f45a4[_0x3133('0x34')]=_[_0x3133('0x35')](_0x4f45a4[_0x3133('0x37')],_0x4f45a4['query']);_0x13081b[_0x3133('0x36')]=_[_0x3133('0x35')](_0x4f45a4[_0x3133('0x37')],qs[_0x3133('0x38')](_0x11d027[_0x3133('0x32')][_0x3133('0x38')]));_0x13081b['attributes']=_0x13081b[_0x3133('0x36')][_0x3133('0x39')]?_0x13081b[_0x3133('0x36')]:_0x4f45a4['model'];if(_0x11d027['query'][_0x3133('0x45')]){_0x13081b[_0x3133('0x46')]=[{'all':!![]}];}_0x13081b=_['merge']({},_0x13081b,_0x11d027[_0x3133('0x43')]);return db[_0x3133('0x2e')][_0x3133('0x4b')](_0x13081b)['then'](handleEntityNotFound(_0x12e60d,null))[_0x3133('0x28')](respondWithResult(_0x12e60d,null))[_0x3133('0x49')](handleError(_0x12e60d,null));};exports[_0x3133('0x4c')]=function(_0x2b8e25,_0x204fa9){return db[_0x3133('0x2e')][_0x3133('0x4c')](_0x2b8e25[_0x3133('0x4d')],{})[_0x3133('0x28')](respondWithResult(_0x204fa9,0xc9))[_0x3133('0x49')](handleError(_0x204fa9,null));};exports[_0x3133('0x27')]=function(_0x31876f,_0x58fec6){if(_0x31876f[_0x3133('0x4d')]['id']){delete _0x31876f[_0x3133('0x4d')]['id'];}return db['SquareReport'][_0x3133('0x4b')]({'where':{'id':_0x31876f['params']['id']}})[_0x3133('0x28')](handleEntityNotFound(_0x58fec6,null))[_0x3133('0x28')](saveUpdates(_0x31876f[_0x3133('0x4d')],null))[_0x3133('0x28')](respondWithResult(_0x58fec6,null))['catch'](handleError(_0x58fec6,null));};exports['destroy']=function(_0x546100,_0x407d5a){return db[_0x3133('0x2e')][_0x3133('0x4b')]({'where':{'id':_0x546100['params']['id']}})['then'](handleEntityNotFound(_0x407d5a,null))[_0x3133('0x28')](removeEntity(_0x407d5a,null))[_0x3133('0x49')](handleError(_0x407d5a,null));};exports[_0x3133('0x4e')]=function(_0x462375,_0x405370){return db['SquareReport'][_0x3133('0x4e')]()['then'](respondWithResult(_0x405370,null))[_0x3133('0x49')](handleError(_0x405370,null));};
\ No newline at end of file
index f874ef4..54e08ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc76a=['SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports'];(function(_0x55279f,_0x210a54){var _0x1870b7=function(_0x29e399){while(--_0x29e399){_0x55279f['push'](_0x55279f['shift']());}};_0x1870b7(++_0x210a54);}(_0xc76a,0xc9));var _0xac76=function(_0x896042,_0x1bfe7f){_0x896042=_0x896042-0x0;var _0x49503f=_0xc76a[_0x896042];return _0x49503f;};'use strict';var _=require(_0xac76('0x0'));var util=require(_0xac76('0x1'));var logger=require(_0xac76('0x2'))(_0xac76('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xac76('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac76('0x5'));var config=require(_0xac76('0x6'));var attributes=require(_0xac76('0x7'));module[_0xac76('0x8')]=function(_0x3664bd,_0x2b5524){return _0x3664bd['define'](_0xac76('0x9'),attributes,{'tableName':_0xac76('0xa'),'paranoid':![],'indexes':[{'name':_0xac76('0xb'),'fields':['uniqueid',_0xac76('0xc')]},{'name':'leaveAt','fields':[_0xac76('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x808a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util'];(function(_0x1ae3a6,_0x4d6fbd){var _0x2f7b56=function(_0xc96c76){while(--_0xc96c76){_0x1ae3a6['push'](_0x1ae3a6['shift']());}};_0x2f7b56(++_0x4d6fbd);}(_0x808a,0x1b3));var _0xa808=function(_0x1eadfb,_0xc1e08b){_0x1eadfb=_0x1eadfb-0x0;var _0x5500fc=_0x808a[_0x1eadfb];return _0x5500fc;};'use strict';var _=require(_0xa808('0x0'));var util=require(_0xa808('0x1'));var logger=require(_0xa808('0x2'))(_0xa808('0x3'));var moment=require(_0xa808('0x4'));var BPromise=require(_0xa808('0x5'));var rp=require(_0xa808('0x6'));var fs=require('fs');var path=require(_0xa808('0x7'));var rimraf=require(_0xa808('0x8'));var config=require(_0xa808('0x9'));var attributes=require(_0xa808('0xa'));module[_0xa808('0xb')]=function(_0x351d01,_0x34bca7){return _0x351d01[_0xa808('0xc')](_0xa808('0xd'),attributes,{'tableName':_0xa808('0xe'),'paranoid':![],'indexes':[{'name':_0xa808('0xf'),'fields':[_0xa808('0x10'),_0xa808('0x11')]},{'name':_0xa808('0x12'),'fields':[_0xa808('0x12')]}],'timestamps':!![]});};
\ No newline at end of file
index 00ae41a..cb622fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09a6=['body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','SquareReport','create','options','raw','debug','UpdateSquareReport'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x09a6,0x10c));var _0x609a=function(_0x3abe2f,_0x1bdf2b){_0x3abe2f=_0x3abe2f-0x0;var _0x3f81e6=_0x09a6[_0x3abe2f];return _0x3f81e6;};'use strict';var _=require(_0x609a('0x0'));var util=require('util');var moment=require(_0x609a('0x1'));var BPromise=require(_0x609a('0x2'));var rs=require(_0x609a('0x3'));var fs=require('fs');var Redis=require(_0x609a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x609a('0x5'));var logger=require(_0x609a('0x6'))(_0x609a('0x7'));var config=require(_0x609a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x609a('0x9')][_0x609a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d10e5,_0x2725a2,_0x5ada70){return new BPromise(function(_0x1ec4e8,_0x57bfcd){return client[_0x609a('0xb')](_0x4d10e5,_0x5ada70)[_0x609a('0xc')](function(_0x572c0e){logger[_0x609a('0xd')](_0x609a('0xe'),_0x2725a2,'request\x20sent');logger['debug'](_0x609a('0xf'),_0x2725a2,_0x609a('0x10'),JSON[_0x609a('0x11')](_0x572c0e));if(_0x572c0e['error']){if(_0x572c0e[_0x609a('0x12')]['code']===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x2725a2,_0x572c0e[_0x609a('0x12')][_0x609a('0x13')]);return _0x57bfcd(_0x572c0e['error']['message']);}logger[_0x609a('0x12')](_0x609a('0xe'),_0x2725a2,_0x572c0e[_0x609a('0x12')][_0x609a('0x13')]);return _0x1ec4e8(_0x572c0e[_0x609a('0x12')][_0x609a('0x13')]);}else{logger[_0x609a('0xd')]('SquareReport,\x20%s,\x20%s',_0x2725a2,_0x609a('0x10'));_0x1ec4e8(_0x572c0e[_0x609a('0x14')][_0x609a('0x13')]);}})[_0x609a('0x15')](function(_0x16aa98){logger[_0x609a('0x12')]('SquareReport,\x20%s,\x20%s',_0x2725a2,_0x16aa98);_0x57bfcd(_0x16aa98);});});}exports[_0x609a('0x16')]=function(_0x259955){var _0x261fb6=this;return new Promise(function(_0x52363e,_0x4e83c3){return db[_0x609a('0x17')][_0x609a('0x18')](_0x259955['body'],{'raw':_0x259955[_0x609a('0x19')]?_0x259955[_0x609a('0x19')][_0x609a('0x1a')]===undefined?!![]:![]:!![]})[_0x609a('0xc')](function(_0x3759b2){logger['info'](_0x609a('0x16'),_0x259955);logger[_0x609a('0x1b')](_0x609a('0x16'),_0x259955,JSON[_0x609a('0x11')](_0x3759b2));_0x52363e(_0x3759b2);})[_0x609a('0x15')](function(_0x4bc9f6){logger['error'](_0x609a('0x16'),_0x4bc9f6[_0x609a('0x13')],_0x259955);_0x4e83c3(_0x261fb6[_0x609a('0x12')](0x1f4,_0x4bc9f6[_0x609a('0x13')]));});});};exports[_0x609a('0x1c')]=function(_0x3ea72b){var _0x59e9ef=this;return new Promise(function(_0x3bf359,_0xc905f6){return db['SquareReport']['update'](_0x3ea72b[_0x609a('0x1d')],{'raw':_0x3ea72b[_0x609a('0x19')]?_0x3ea72b['options'][_0x609a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ea72b[_0x609a('0x19')]?_0x3ea72b[_0x609a('0x19')][_0x609a('0x1e')]||null:null,'attributes':_0x3ea72b[_0x609a('0x19')]?_0x3ea72b['options'][_0x609a('0x1f')]||null:null,'limit':_0x3ea72b['options']?_0x3ea72b[_0x609a('0x19')][_0x609a('0x20')]||null:null})[_0x609a('0xc')](function(_0x53e785){logger[_0x609a('0xd')](_0x609a('0x1c'),_0x3ea72b);logger[_0x609a('0x1b')](_0x609a('0x1c'),_0x3ea72b,JSON['stringify'](_0x53e785));_0x3bf359(_0x53e785);})['catch'](function(_0x111a10){logger['error'](_0x609a('0x1c'),_0x111a10['message'],_0x3ea72b);_0xc905f6(_0x59e9ef['error'](0x1f4,_0x111a10[_0x609a('0x13')]));});});};
\ No newline at end of file
+var _0x5721=['limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','SquareReport','create','body','options','debug','update','raw','attributes'];(function(_0x3b7c91,_0x5296fd){var _0x2587ae=function(_0x4fdfe8){while(--_0x4fdfe8){_0x3b7c91['push'](_0x3b7c91['shift']());}};_0x2587ae(++_0x5296fd);}(_0x5721,0xc2));var _0x1572=function(_0x491e15,_0x19559b){_0x491e15=_0x491e15-0x0;var _0x3a4c39=_0x5721[_0x491e15];return _0x3a4c39;};'use strict';var _=require(_0x1572('0x0'));var util=require(_0x1572('0x1'));var moment=require(_0x1572('0x2'));var BPromise=require(_0x1572('0x3'));var rs=require(_0x1572('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1572('0x5'))['db'];var utils=require(_0x1572('0x6'));var logger=require('../../config/logger')(_0x1572('0x7'));var config=require(_0x1572('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1572('0x9')][_0x1572('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x497685,_0x1dcf21,_0x517d02){return new BPromise(function(_0x589921,_0x3f3838){return client['request'](_0x497685,_0x517d02)[_0x1572('0xb')](function(_0x62c717){logger[_0x1572('0xc')](_0x1572('0xd'),_0x1dcf21,_0x1572('0xe'));logger['debug'](_0x1572('0xf'),_0x1dcf21,_0x1572('0xe'),JSON[_0x1572('0x10')](_0x62c717));if(_0x62c717['error']){if(_0x62c717[_0x1572('0x11')]['code']===0x1f4){logger['error'](_0x1572('0xd'),_0x1dcf21,_0x62c717[_0x1572('0x11')]['message']);return _0x3f3838(_0x62c717[_0x1572('0x11')][_0x1572('0x12')]);}logger[_0x1572('0x11')](_0x1572('0xd'),_0x1dcf21,_0x62c717[_0x1572('0x11')][_0x1572('0x12')]);return _0x589921(_0x62c717[_0x1572('0x11')][_0x1572('0x12')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x1dcf21,_0x1572('0xe'));_0x589921(_0x62c717[_0x1572('0x13')][_0x1572('0x12')]);}})[_0x1572('0x14')](function(_0x4bdaeb){logger['error'](_0x1572('0xd'),_0x1dcf21,_0x4bdaeb);_0x3f3838(_0x4bdaeb);});});}exports[_0x1572('0x15')]=function(_0x3f8df3){var _0x170306=this;return new Promise(function(_0x3a269d,_0x493cdd){return db[_0x1572('0x16')][_0x1572('0x17')](_0x3f8df3[_0x1572('0x18')],{'raw':_0x3f8df3['options']?_0x3f8df3[_0x1572('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x1572('0xb')](function(_0x544a78){logger[_0x1572('0xc')](_0x1572('0x15'),_0x3f8df3);logger[_0x1572('0x1a')]('CreateSquareReport',_0x3f8df3,JSON[_0x1572('0x10')](_0x544a78));_0x3a269d(_0x544a78);})[_0x1572('0x14')](function(_0x2caaf0){logger[_0x1572('0x11')]('CreateSquareReport',_0x2caaf0[_0x1572('0x12')],_0x3f8df3);_0x493cdd(_0x170306[_0x1572('0x11')](0x1f4,_0x2caaf0[_0x1572('0x12')]));});});};exports['UpdateSquareReport']=function(_0x3e8858){var _0x33d339=this;return new Promise(function(_0x548a72,_0x337955){return db[_0x1572('0x16')][_0x1572('0x1b')](_0x3e8858['body'],{'raw':_0x3e8858[_0x1572('0x19')]?_0x3e8858['options'][_0x1572('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e8858['options']?_0x3e8858['options']['where']||null:null,'attributes':_0x3e8858[_0x1572('0x19')]?_0x3e8858[_0x1572('0x19')][_0x1572('0x1d')]||null:null,'limit':_0x3e8858['options']?_0x3e8858[_0x1572('0x19')][_0x1572('0x1e')]||null:null})[_0x1572('0xb')](function(_0x19ae1f){logger['info'](_0x1572('0x1f'),_0x3e8858);logger[_0x1572('0x1a')](_0x1572('0x1f'),_0x3e8858,JSON[_0x1572('0x10')](_0x19ae1f));_0x548a72(_0x19ae1f);})['catch'](function(_0x2bfa5f){logger[_0x1572('0x11')](_0x1572('0x1f'),_0x2bfa5f[_0x1572('0x12')],_0x3e8858);_0x337955(_0x33d339[_0x1572('0x11')](0x1f4,_0x2bfa5f[_0x1572('0x12')]));});});};
\ No newline at end of file
index 7309f00..9b8e269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c6e=['delete','destroy','exports','multer','express','Router','fs-extra','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update'];(function(_0x28beae,_0x5ba3d1){var _0x1531cb=function(_0x1344f9){while(--_0x1344f9){_0x28beae['push'](_0x28beae['shift']());}};_0x1531cb(++_0x5ba3d1);}(_0x2c6e,0x124));var _0xe2c6=function(_0x117a92,_0x559fe6){_0x117a92=_0x117a92-0x0;var _0x27dbf2=_0x2c6e[_0x117a92];return _0x27dbf2;};'use strict';var multer=require(_0xe2c6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe2c6('0x1'));var router=express[_0xe2c6('0x2')]();var fs_extra=require(_0xe2c6('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe2c6('0x4'));router[_0xe2c6('0x5')]('/',auth[_0xe2c6('0x6')](),controller[_0xe2c6('0x7')]);router[_0xe2c6('0x5')](_0xe2c6('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xe2c6('0x5')](_0xe2c6('0x9'),auth['isAuthenticated'](),controller[_0xe2c6('0xa')]);router['post']('/',auth[_0xe2c6('0x6')](),controller[_0xe2c6('0xb')]);router[_0xe2c6('0xc')](_0xe2c6('0x9'),auth[_0xe2c6('0x6')](),controller[_0xe2c6('0xd')]);router[_0xe2c6('0xe')](_0xe2c6('0x9'),auth[_0xe2c6('0x6')](),controller[_0xe2c6('0xf')]);module[_0xe2c6('0x10')]=router;
\ No newline at end of file
+var _0x3dc6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path'];(function(_0x3cd9ca,_0x37f8b8){var _0x19b9c6=function(_0x494399){while(--_0x494399){_0x3cd9ca['push'](_0x3cd9ca['shift']());}};_0x19b9c6(++_0x37f8b8);}(_0x3dc6,0x1b6));var _0x63dc=function(_0x13da78,_0x19aafb){_0x13da78=_0x13da78-0x0;var _0x2f46d1=_0x3dc6[_0x13da78];return _0x2f46d1;};'use strict';var multer=require('multer');var util=require(_0x63dc('0x0'));var path=require(_0x63dc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x63dc('0x2')]();var fs_extra=require(_0x63dc('0x3'));var auth=require(_0x63dc('0x4'));var interaction=require(_0x63dc('0x5'));var config=require(_0x63dc('0x6'));var controller=require('./squareReportDetail.controller');router[_0x63dc('0x7')]('/',auth[_0x63dc('0x8')](),controller[_0x63dc('0x9')]);router[_0x63dc('0x7')](_0x63dc('0xa'),auth['isAuthenticated'](),controller[_0x63dc('0xb')]);router[_0x63dc('0x7')](_0x63dc('0xc'),auth[_0x63dc('0x8')](),controller[_0x63dc('0xd')]);router[_0x63dc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x63dc('0xf')](_0x63dc('0xc'),auth['isAuthenticated'](),controller[_0x63dc('0x10')]);router[_0x63dc('0x11')]('/:id',auth[_0x63dc('0x8')](),controller[_0x63dc('0x12')]);module[_0x63dc('0x13')]=router;
\ No newline at end of file
index dd22557..c9279d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea81=['sequelize','exports','STRING'];(function(_0x34361b,_0x9642d4){var _0x1de9c5=function(_0x41bc3f){while(--_0x41bc3f){_0x34361b['push'](_0x34361b['shift']());}};_0x1de9c5(++_0x9642d4);}(_0xea81,0x17d));var _0x1ea8=function(_0xc68904,_0x1abe4a){_0xc68904=_0xc68904-0x0;var _0x4cdb3e=_0xea81[_0xc68904];return _0x4cdb3e;};'use strict';var Sequelize=require(_0x1ea8('0x0'));module[_0x1ea8('0x1')]={'uniqueid':{'type':Sequelize[_0x1ea8('0x2')]},'node':{'type':Sequelize[_0x1ea8('0x2')]},'application':{'type':Sequelize[_0x1ea8('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x1ea8('0x2')]},'callerid':{'type':Sequelize[_0x1ea8('0x2')]}};
\ No newline at end of file
+var _0xe08c=['STRING','exports'];(function(_0x6e1e6e,_0x32eb2b){var _0x3f1e93=function(_0x379838){while(--_0x379838){_0x6e1e6e['push'](_0x6e1e6e['shift']());}};_0x3f1e93(++_0x32eb2b);}(_0xe08c,0xa3));var _0xce08=function(_0x1b7759,_0x2595e0){_0x1b7759=_0x1b7759-0x0;var _0x25e744=_0xe08c[_0x1b7759];return _0x25e744;};'use strict';var Sequelize=require('sequelize');module[_0xce08('0x0')]={'uniqueid':{'type':Sequelize[_0xce08('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xce08('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xce08('0x1')]},'callerid':{'type':Sequelize[_0xce08('0x1')]}};
\ No newline at end of file
index ee5a635..e8af9c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee1b=['include','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','name','send','map','SquareDetailsReport','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xee1b,0x9a));var _0xbee1=function(_0x2d279f,_0x79e9d0){_0x2d279f=_0x2d279f-0x0;var _0x5b3606=_0xee1b[_0x2d279f];return _0x5b3606;};'use strict';var emlformat=require(_0xbee1('0x0'));var rimraf=require(_0xbee1('0x1'));var zipdir=require(_0xbee1('0x2'));var jsonpatch=require(_0xbee1('0x3'));var rp=require(_0xbee1('0x4'));var moment=require(_0xbee1('0x5'));var BPromise=require(_0xbee1('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbee1('0x7'));var sox=require(_0xbee1('0x8'));var csv=require(_0xbee1('0x9'));var ejs=require(_0xbee1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbee1('0xb'));var squel=require(_0xbee1('0xc'));var crypto=require('crypto');var jsforce=require(_0xbee1('0xd'));var deskjs=require(_0xbee1('0xe'));var toCsv=require(_0xbee1('0x9'));var querystring=require(_0xbee1('0xf'));var Papa=require('papaparse');var Redis=require(_0xbee1('0x10'));var authService=require(_0xbee1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbee1('0x12'));var logger=require('../../config/logger')(_0xbee1('0x13'));var utils=require(_0xbee1('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbee1('0x15'))['db'];function respondWithStatusCode(_0x540cfe,_0x7322ec){_0x7322ec=_0x7322ec||0xcc;return function(_0x19e7d1){if(_0x19e7d1){return _0x540cfe[_0xbee1('0x16')](_0x7322ec);}return _0x540cfe[_0xbee1('0x17')](_0x7322ec)[_0xbee1('0x18')]();};}function respondWithResult(_0x5ac167,_0x3c524b){_0x3c524b=_0x3c524b||0xc8;return function(_0x13853a){if(_0x13853a){return _0x5ac167[_0xbee1('0x17')](_0x3c524b)[_0xbee1('0x19')](_0x13853a);}};}function respondWithFilteredResult(_0x627f26,_0x2aa472){return function(_0x50a9fa){if(_0x50a9fa){var _0x4f6daa=typeof _0x2aa472[_0xbee1('0x1a')]==='undefined'&&typeof _0x2aa472[_0xbee1('0x1b')]===_0xbee1('0x1c');var _0x33e50b=_0x50a9fa[_0xbee1('0x1d')];var _0x4a24fb=_0x4f6daa?0x0:_0x2aa472[_0xbee1('0x1a')];var _0x549ab8=_0x4f6daa?_0x50a9fa[_0xbee1('0x1d')]:_0x2aa472[_0xbee1('0x1a')]+_0x2aa472[_0xbee1('0x1b')];var _0x359840;if(_0x549ab8>=_0x33e50b){_0x549ab8=_0x33e50b;_0x359840=0xc8;}else{_0x359840=0xce;}_0x627f26['status'](_0x359840);return _0x627f26['set'](_0xbee1('0x1e'),_0x4a24fb+'-'+_0x549ab8+'/'+_0x33e50b)[_0xbee1('0x19')](_0x50a9fa);}return null;};}function patchUpdates(_0x4c6ef2){return function(_0x3c3ddd){try{jsonpatch['apply'](_0x3c3ddd,_0x4c6ef2,!![]);}catch(_0x23e62c){return BPromise[_0xbee1('0x1f')](_0x23e62c);}return _0x3c3ddd[_0xbee1('0x20')]();};}function saveUpdates(_0x43e841,_0x70bb17){return function(_0x4e6555){if(_0x4e6555){return _0x4e6555[_0xbee1('0x21')](_0x43e841)[_0xbee1('0x22')](function(_0x4b69ed){return _0x4b69ed;});}return null;};}function removeEntity(_0x46f850,_0x14f286){return function(_0x2d86d3){if(_0x2d86d3){return _0x2d86d3[_0xbee1('0x23')]()[_0xbee1('0x22')](function(){_0x46f850[_0xbee1('0x17')](0xcc)[_0xbee1('0x18')]();});}};}function handleEntityNotFound(_0x271e2f,_0x1a91eb){return function(_0x101d59){if(!_0x101d59){_0x271e2f[_0xbee1('0x16')](0x194);}return _0x101d59;};}function handleError(_0x2260df,_0x526bd5){_0x526bd5=_0x526bd5||0x1f4;return function(_0x6da0d0){logger['error'](_0x6da0d0['stack']);if(_0x6da0d0[_0xbee1('0x24')]){delete _0x6da0d0[_0xbee1('0x24')];}_0x2260df[_0xbee1('0x17')](_0x526bd5)[_0xbee1('0x25')](_0x6da0d0);};}exports['index']=function(_0x4a35b7,_0x1fb882){var _0x136d0={},_0x5cab0e={},_0x40734a={'count':0x0,'rows':[]};var _0x11ecdd=_[_0xbee1('0x26')](db[_0xbee1('0x27')]['rawAttributes'],function(_0x8bcb9){return{'name':_0x8bcb9['fieldName'],'type':_0x8bcb9[_0xbee1('0x28')][_0xbee1('0x29')]};});_0x5cab0e[_0xbee1('0x2a')]=_[_0xbee1('0x26')](_0x11ecdd,_0xbee1('0x24'));_0x5cab0e[_0xbee1('0x2b')]=_[_0xbee1('0x2c')](_0x4a35b7[_0xbee1('0x2b')]);_0x5cab0e['filters']=_['intersection'](_0x5cab0e[_0xbee1('0x2a')],_0x5cab0e[_0xbee1('0x2b')]);_0x136d0[_0xbee1('0x2d')]=_[_0xbee1('0x2e')](_0x5cab0e['model'],qs[_0xbee1('0x2f')](_0x4a35b7['query'][_0xbee1('0x2f')]));_0x136d0[_0xbee1('0x2d')]=_0x136d0[_0xbee1('0x2d')]['length']?_0x136d0[_0xbee1('0x2d')]:_0x5cab0e[_0xbee1('0x2a')];if(!_0x4a35b7[_0xbee1('0x2b')][_0xbee1('0x30')](_0xbee1('0x31'))){_0x136d0['limit']=qs[_0xbee1('0x1b')](_0x4a35b7[_0xbee1('0x2b')][_0xbee1('0x1b')]);_0x136d0[_0xbee1('0x1a')]=qs[_0xbee1('0x1a')](_0x4a35b7[_0xbee1('0x2b')][_0xbee1('0x1a')]);}_0x136d0[_0xbee1('0x32')]=qs[_0xbee1('0x33')](_0x4a35b7[_0xbee1('0x2b')][_0xbee1('0x33')]);_0x136d0[_0xbee1('0x34')]=qs[_0xbee1('0x35')](_[_0xbee1('0x36')](_0x4a35b7['query'],_0x5cab0e[_0xbee1('0x35')]),_0x11ecdd);if(_0x4a35b7[_0xbee1('0x2b')][_0xbee1('0x37')]){_0x136d0[_0xbee1('0x34')]=_['merge'](_0x136d0[_0xbee1('0x34')],{'$or':_[_0xbee1('0x26')](_0x11ecdd,function(_0x59abf1){if(_0x59abf1[_0xbee1('0x28')]!==_0xbee1('0x38')){var _0x4bb0af={};_0x4bb0af[_0x59abf1[_0xbee1('0x24')]]={'$like':'%'+_0x4a35b7[_0xbee1('0x2b')][_0xbee1('0x37')]+'%'};return _0x4bb0af;}})});}_0x136d0=_[_0xbee1('0x39')]({},_0x136d0,_0x4a35b7[_0xbee1('0x3a')]);var _0x58abb3={'where':_0x136d0[_0xbee1('0x34')]};return db[_0xbee1('0x27')][_0xbee1('0x1d')](_0x58abb3)[_0xbee1('0x22')](function(_0x163037){_0x40734a[_0xbee1('0x1d')]=_0x163037;if(_0x4a35b7[_0xbee1('0x2b')]['includeAll']){_0x136d0[_0xbee1('0x3b')]=[{'all':!![]}];}return db[_0xbee1('0x27')]['findAll'](_0x136d0);})[_0xbee1('0x22')](function(_0x537b73){_0x40734a[_0xbee1('0x3c')]=_0x537b73;return _0x40734a;})[_0xbee1('0x22')](respondWithFilteredResult(_0x1fb882,_0x136d0))[_0xbee1('0x3d')](handleError(_0x1fb882,null));};exports[_0xbee1('0x3e')]=function(_0x779029,_0x1c0fbd){var _0x51755={'raw':!![],'where':{'id':_0x779029[_0xbee1('0x3f')]['id']}},_0x4717e1={};_0x4717e1[_0xbee1('0x2a')]=_[_0xbee1('0x2c')](db['SquareDetailsReport'][_0xbee1('0x40')]);_0x4717e1['query']=_[_0xbee1('0x2c')](_0x779029[_0xbee1('0x2b')]);_0x4717e1['filters']=_[_0xbee1('0x2e')](_0x4717e1[_0xbee1('0x2a')],_0x4717e1[_0xbee1('0x2b')]);_0x51755[_0xbee1('0x2d')]=_[_0xbee1('0x2e')](_0x4717e1[_0xbee1('0x2a')],qs[_0xbee1('0x2f')](_0x779029[_0xbee1('0x2b')]['fields']));_0x51755[_0xbee1('0x2d')]=_0x51755[_0xbee1('0x2d')][_0xbee1('0x41')]?_0x51755['attributes']:_0x4717e1[_0xbee1('0x2a')];if(_0x779029['query'][_0xbee1('0x42')]){_0x51755[_0xbee1('0x3b')]=[{'all':!![]}];}_0x51755=_[_0xbee1('0x39')]({},_0x51755,_0x779029[_0xbee1('0x3a')]);return db['SquareDetailsReport'][_0xbee1('0x43')](_0x51755)[_0xbee1('0x22')](handleEntityNotFound(_0x1c0fbd,null))[_0xbee1('0x22')](respondWithResult(_0x1c0fbd,null))['catch'](handleError(_0x1c0fbd,null));};exports[_0xbee1('0x44')]=function(_0x8a3db0,_0x1f3041){return db['SquareDetailsReport']['create'](_0x8a3db0[_0xbee1('0x45')],{})[_0xbee1('0x22')](respondWithResult(_0x1f3041,0xc9))['catch'](handleError(_0x1f3041,null));};exports['update']=function(_0x5c56ad,_0x3914ff){if(_0x5c56ad[_0xbee1('0x45')]['id']){delete _0x5c56ad[_0xbee1('0x45')]['id'];}return db['SquareDetailsReport'][_0xbee1('0x43')]({'where':{'id':_0x5c56ad[_0xbee1('0x3f')]['id']}})[_0xbee1('0x22')](handleEntityNotFound(_0x3914ff,null))['then'](saveUpdates(_0x5c56ad[_0xbee1('0x45')],null))[_0xbee1('0x22')](respondWithResult(_0x3914ff,null))[_0xbee1('0x3d')](handleError(_0x3914ff,null));};exports[_0xbee1('0x23')]=function(_0x204a68,_0x1c3356){return db[_0xbee1('0x27')][_0xbee1('0x43')]({'where':{'id':_0x204a68['params']['id']}})[_0xbee1('0x22')](handleEntityNotFound(_0x1c3356,null))[_0xbee1('0x22')](removeEntity(_0x1c3356,null))[_0xbee1('0x3d')](handleError(_0x1c3356,null));};exports[_0xbee1('0x46')]=function(_0x1d1b88,_0x25e960){return db[_0xbee1('0x27')][_0xbee1('0x46')]()[_0xbee1('0x22')](respondWithResult(_0x25e960,null))[_0xbee1('0x3d')](handleError(_0x25e960,null));};
\ No newline at end of file
+var _0x5b21=['request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x5274f6,_0x2f5dd1){var _0x35759f=function(_0x3239f7){while(--_0x3239f7){_0x5274f6['push'](_0x5274f6['shift']());}};_0x35759f(++_0x2f5dd1);}(_0x5b21,0x1bf));var _0x15b2=function(_0x1ac8f6,_0x32c979){_0x1ac8f6=_0x1ac8f6-0x0;var _0xc27745=_0x5b21[_0x1ac8f6];return _0xc27745;};'use strict';var emlformat=require(_0x15b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15b2('0x1'));var jsonpatch=require(_0x15b2('0x2'));var rp=require(_0x15b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15b2('0x4'));var util=require(_0x15b2('0x5'));var path=require('path');var sox=require(_0x15b2('0x6'));var csv=require('to-csv');var ejs=require(_0x15b2('0x7'));var fs=require('fs');var fs_extra=require(_0x15b2('0x8'));var _=require(_0x15b2('0x9'));var squel=require(_0x15b2('0xa'));var crypto=require('crypto');var jsforce=require(_0x15b2('0xb'));var deskjs=require(_0x15b2('0xc'));var toCsv=require(_0x15b2('0xd'));var querystring=require('querystring');var Papa=require(_0x15b2('0xe'));var Redis=require(_0x15b2('0xf'));var authService=require(_0x15b2('0x10'));var qs=require(_0x15b2('0x11'));var as=require(_0x15b2('0x12'));var hardwareService=require(_0x15b2('0x13'));var logger=require(_0x15b2('0x14'))(_0x15b2('0x15'));var utils=require(_0x15b2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x15b2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46fd9d,_0x574d7f){_0x574d7f=_0x574d7f||0xcc;return function(_0x52b89e){if(_0x52b89e){return _0x46fd9d[_0x15b2('0x18')](_0x574d7f);}return _0x46fd9d[_0x15b2('0x19')](_0x574d7f)[_0x15b2('0x1a')]();};}function respondWithResult(_0x3e7379,_0x5a200a){_0x5a200a=_0x5a200a||0xc8;return function(_0x226cc6){if(_0x226cc6){return _0x3e7379[_0x15b2('0x19')](_0x5a200a)[_0x15b2('0x1b')](_0x226cc6);}};}function respondWithFilteredResult(_0x5a6a77,_0x4c6e0e){return function(_0x2eaae5){if(_0x2eaae5){var _0x59d1c0=typeof _0x4c6e0e[_0x15b2('0x1c')]===_0x15b2('0x1d')&&typeof _0x4c6e0e[_0x15b2('0x1e')]===_0x15b2('0x1d');var _0x111904=_0x2eaae5[_0x15b2('0x1f')];var _0x13a6b6=_0x59d1c0?0x0:_0x4c6e0e[_0x15b2('0x1c')];var _0x44011d=_0x59d1c0?_0x2eaae5[_0x15b2('0x1f')]:_0x4c6e0e[_0x15b2('0x1c')]+_0x4c6e0e[_0x15b2('0x1e')];var _0x390d35;if(_0x44011d>=_0x111904){_0x44011d=_0x111904;_0x390d35=0xc8;}else{_0x390d35=0xce;}_0x5a6a77[_0x15b2('0x19')](_0x390d35);return _0x5a6a77[_0x15b2('0x20')]('Content-Range',_0x13a6b6+'-'+_0x44011d+'/'+_0x111904)[_0x15b2('0x1b')](_0x2eaae5);}return null;};}function patchUpdates(_0xb74e88){return function(_0x400f7b){try{jsonpatch['apply'](_0x400f7b,_0xb74e88,!![]);}catch(_0x5965e1){return BPromise[_0x15b2('0x21')](_0x5965e1);}return _0x400f7b[_0x15b2('0x22')]();};}function saveUpdates(_0xee3376,_0x3cbd6e){return function(_0x1e1df2){if(_0x1e1df2){return _0x1e1df2[_0x15b2('0x23')](_0xee3376)['then'](function(_0x79bf9f){return _0x79bf9f;});}return null;};}function removeEntity(_0x309c9d,_0x3f8737){return function(_0x169f8b){if(_0x169f8b){return _0x169f8b[_0x15b2('0x24')]()[_0x15b2('0x25')](function(){_0x309c9d[_0x15b2('0x19')](0xcc)[_0x15b2('0x1a')]();});}};}function handleEntityNotFound(_0x52e376,_0x4ceb5c){return function(_0x32c491){if(!_0x32c491){_0x52e376[_0x15b2('0x18')](0x194);}return _0x32c491;};}function handleError(_0x379c3e,_0xc06473){_0xc06473=_0xc06473||0x1f4;return function(_0x5f2e02){logger[_0x15b2('0x26')](_0x5f2e02[_0x15b2('0x27')]);if(_0x5f2e02[_0x15b2('0x28')]){delete _0x5f2e02['name'];}_0x379c3e['status'](_0xc06473)[_0x15b2('0x29')](_0x5f2e02);};}exports[_0x15b2('0x2a')]=function(_0x48647a,_0x324d10){var _0x5e665d={},_0x4d731c={},_0x301f3e={'count':0x0,'rows':[]};var _0x4759ab=_['map'](db[_0x15b2('0x2b')][_0x15b2('0x2c')],function(_0x2a676a){return{'name':_0x2a676a[_0x15b2('0x2d')],'type':_0x2a676a[_0x15b2('0x2e')][_0x15b2('0x2f')]};});_0x4d731c['model']=_['map'](_0x4759ab,'name');_0x4d731c[_0x15b2('0x30')]=_[_0x15b2('0x31')](_0x48647a['query']);_0x4d731c[_0x15b2('0x32')]=_['intersection'](_0x4d731c['model'],_0x4d731c[_0x15b2('0x30')]);_0x5e665d[_0x15b2('0x33')]=_[_0x15b2('0x34')](_0x4d731c['model'],qs[_0x15b2('0x35')](_0x48647a[_0x15b2('0x30')]['fields']));_0x5e665d[_0x15b2('0x33')]=_0x5e665d['attributes'][_0x15b2('0x36')]?_0x5e665d['attributes']:_0x4d731c[_0x15b2('0x37')];if(!_0x48647a['query']['hasOwnProperty'](_0x15b2('0x38'))){_0x5e665d['limit']=qs[_0x15b2('0x1e')](_0x48647a[_0x15b2('0x30')][_0x15b2('0x1e')]);_0x5e665d[_0x15b2('0x1c')]=qs[_0x15b2('0x1c')](_0x48647a['query'][_0x15b2('0x1c')]);}_0x5e665d[_0x15b2('0x39')]=qs['sort'](_0x48647a[_0x15b2('0x30')][_0x15b2('0x3a')]);_0x5e665d[_0x15b2('0x3b')]=qs['filters'](_['pick'](_0x48647a[_0x15b2('0x30')],_0x4d731c[_0x15b2('0x32')]),_0x4759ab);if(_0x48647a[_0x15b2('0x30')][_0x15b2('0x3c')]){_0x5e665d[_0x15b2('0x3b')]=_[_0x15b2('0x3d')](_0x5e665d['where'],{'$or':_[_0x15b2('0x3e')](_0x4759ab,function(_0x1ff0fc){if(_0x1ff0fc[_0x15b2('0x2e')]!==_0x15b2('0x3f')){var _0x1efe1d={};_0x1efe1d[_0x1ff0fc[_0x15b2('0x28')]]={'$like':'%'+_0x48647a[_0x15b2('0x30')]['filter']+'%'};return _0x1efe1d;}})});}_0x5e665d=_['merge']({},_0x5e665d,_0x48647a[_0x15b2('0x40')]);var _0x4708e1={'where':_0x5e665d[_0x15b2('0x3b')]};return db[_0x15b2('0x2b')][_0x15b2('0x1f')](_0x4708e1)[_0x15b2('0x25')](function(_0x14d0f1){_0x301f3e[_0x15b2('0x1f')]=_0x14d0f1;if(_0x48647a[_0x15b2('0x30')][_0x15b2('0x41')]){_0x5e665d[_0x15b2('0x42')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x15b2('0x43')](_0x5e665d);})['then'](function(_0x26442b){_0x301f3e[_0x15b2('0x44')]=_0x26442b;return _0x301f3e;})[_0x15b2('0x25')](respondWithFilteredResult(_0x324d10,_0x5e665d))[_0x15b2('0x45')](handleError(_0x324d10,null));};exports[_0x15b2('0x46')]=function(_0x1e2cab,_0x1f4d30){var _0x31daf9={'raw':!![],'where':{'id':_0x1e2cab[_0x15b2('0x47')]['id']}},_0x2f30be={};_0x2f30be[_0x15b2('0x37')]=_['keys'](db[_0x15b2('0x2b')][_0x15b2('0x2c')]);_0x2f30be[_0x15b2('0x30')]=_[_0x15b2('0x31')](_0x1e2cab['query']);_0x2f30be[_0x15b2('0x32')]=_['intersection'](_0x2f30be[_0x15b2('0x37')],_0x2f30be[_0x15b2('0x30')]);_0x31daf9[_0x15b2('0x33')]=_[_0x15b2('0x34')](_0x2f30be[_0x15b2('0x37')],qs[_0x15b2('0x35')](_0x1e2cab[_0x15b2('0x30')]['fields']));_0x31daf9[_0x15b2('0x33')]=_0x31daf9['attributes'][_0x15b2('0x36')]?_0x31daf9[_0x15b2('0x33')]:_0x2f30be['model'];if(_0x1e2cab[_0x15b2('0x30')]['includeAll']){_0x31daf9[_0x15b2('0x42')]=[{'all':!![]}];}_0x31daf9=_[_0x15b2('0x3d')]({},_0x31daf9,_0x1e2cab[_0x15b2('0x40')]);return db[_0x15b2('0x2b')][_0x15b2('0x48')](_0x31daf9)[_0x15b2('0x25')](handleEntityNotFound(_0x1f4d30,null))['then'](respondWithResult(_0x1f4d30,null))[_0x15b2('0x45')](handleError(_0x1f4d30,null));};exports['create']=function(_0x278888,_0x3fe34a){return db['SquareDetailsReport']['create'](_0x278888[_0x15b2('0x49')],{})[_0x15b2('0x25')](respondWithResult(_0x3fe34a,0xc9))['catch'](handleError(_0x3fe34a,null));};exports['update']=function(_0x3ae39d,_0x9c9b31){if(_0x3ae39d[_0x15b2('0x49')]['id']){delete _0x3ae39d[_0x15b2('0x49')]['id'];}return db['SquareDetailsReport'][_0x15b2('0x48')]({'where':{'id':_0x3ae39d[_0x15b2('0x47')]['id']}})[_0x15b2('0x25')](handleEntityNotFound(_0x9c9b31,null))[_0x15b2('0x25')](saveUpdates(_0x3ae39d[_0x15b2('0x49')],null))[_0x15b2('0x25')](respondWithResult(_0x9c9b31,null))[_0x15b2('0x45')](handleError(_0x9c9b31,null));};exports[_0x15b2('0x24')]=function(_0x4b06f0,_0x4fb3ae){return db[_0x15b2('0x2b')][_0x15b2('0x48')]({'where':{'id':_0x4b06f0[_0x15b2('0x47')]['id']}})[_0x15b2('0x25')](handleEntityNotFound(_0x4fb3ae,null))[_0x15b2('0x25')](removeEntity(_0x4fb3ae,null))['catch'](handleError(_0x4fb3ae,null));};exports['describe']=function(_0x2cfe2c,_0x2179a4){return db[_0x15b2('0x2b')][_0x15b2('0x4a')]()[_0x15b2('0x25')](respondWithResult(_0x2179a4,null))['catch'](handleError(_0x2179a4,null));};
\ No newline at end of file
index 750bb60..be4ca4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d9f=['path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3815fe,_0x46e4d7){var _0x360bf5=function(_0x4f4603){while(--_0x4f4603){_0x3815fe['push'](_0x3815fe['shift']());}};_0x360bf5(++_0x46e4d7);}(_0x1d9f,0x18f));var _0xf1d9=function(_0x399a2a,_0x5feea2){_0x399a2a=_0x399a2a-0x0;var _0x52dda4=_0x1d9f[_0x399a2a];return _0x52dda4;};'use strict';var _=require(_0xf1d9('0x0'));var util=require(_0xf1d9('0x1'));var logger=require(_0xf1d9('0x2'))(_0xf1d9('0x3'));var moment=require(_0xf1d9('0x4'));var BPromise=require(_0xf1d9('0x5'));var rp=require(_0xf1d9('0x6'));var fs=require('fs');var path=require(_0xf1d9('0x7'));var rimraf=require(_0xf1d9('0x8'));var config=require(_0xf1d9('0x9'));var attributes=require(_0xf1d9('0xa'));module['exports']=function(_0x5269c7,_0x149fd8){return _0x5269c7[_0xf1d9('0xb')](_0xf1d9('0xc'),attributes,{'tableName':_0xf1d9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee6a=['../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0xeea277,_0x56ce7b){var _0x4a84cb=function(_0x3acad0){while(--_0x3acad0){_0xeea277['push'](_0xeea277['shift']());}};_0x4a84cb(++_0x56ce7b);}(_0xee6a,0x1d1));var _0xaee6=function(_0x11a99c,_0x5ee7a2){_0x11a99c=_0x11a99c-0x0;var _0x2eae41=_0xee6a[_0x11a99c];return _0x2eae41;};'use strict';var _=require(_0xaee6('0x0'));var util=require('util');var logger=require(_0xaee6('0x1'))(_0xaee6('0x2'));var moment=require('moment');var BPromise=require(_0xaee6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaee6('0x4'));var config=require(_0xaee6('0x5'));var attributes=require(_0xaee6('0x6'));module[_0xaee6('0x7')]=function(_0x30928e,_0x267e78){return _0x30928e['define'](_0xaee6('0x8'),attributes,{'tableName':_0xaee6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0d82990..961cc92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51c5=['options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','info','catch','CreateSquareDetailsReport','create'];(function(_0x4fcc5b,_0x2fe9ef){var _0x48cb49=function(_0x47fc29){while(--_0x47fc29){_0x4fcc5b['push'](_0x4fcc5b['shift']());}};_0x48cb49(++_0x2fe9ef);}(_0x51c5,0x8f));var _0x551c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x51c5[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});}exports[_0x551c('0x17')]=function(_0x274432){var _0x2a0b55=this;return new Promise(function(_0x4c8dba,_0x4fcaf3){return db['SquareDetailsReport'][_0x551c('0x18')](_0x274432['body'],{'raw':_0x274432['options']?_0x274432[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![]})[_0x551c('0x1b')](function(_0x1927e7){logger[_0x551c('0x15')](_0x551c('0x17'),_0x274432);logger['debug']('CreateSquareDetailsReport',_0x274432,JSON[_0x551c('0x10')](_0x1927e7));_0x4c8dba(_0x1927e7);})['catch'](function(_0x330160){logger[_0x551c('0x11')](_0x551c('0x17'),_0x330160[_0x551c('0x13')],_0x274432);_0x4fcaf3(_0x2a0b55[_0x551c('0x11')](0x1f4,_0x330160['message']));});});};
\ No newline at end of file
+var _0x3cae=['catch','CreateSquareDetailsReport','SquareDetailsReport','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x2bc4a1,_0x5a8fef){var _0x13b59b=function(_0x1d449f){while(--_0x1d449f){_0x2bc4a1['push'](_0x2bc4a1['shift']());}};_0x13b59b(++_0x5a8fef);}(_0x3cae,0x117));var _0xe3ca=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x3cae[_0x1e2080];return _0x260111;};'use strict';var _=require(_0xe3ca('0x0'));var util=require(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var BPromise=require(_0xe3ca('0x3'));var rs=require(_0xe3ca('0x4'));var fs=require('fs');var Redis=require(_0xe3ca('0x5'));var db=require(_0xe3ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ca('0x7'))(_0xe3ca('0x8'));var config=require('../../config/environment');var jayson=require(_0xe3ca('0x9'));var client=jayson['client'][_0xe3ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fafb4,_0x36d17a,_0x578178){return new BPromise(function(_0x2c4863,_0x100c20){return client[_0xe3ca('0xb')](_0x7fafb4,_0x578178)[_0xe3ca('0xc')](function(_0x1ae7bf){logger[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x36d17a,'request\x20sent');logger[_0xe3ca('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x36d17a,_0xe3ca('0x10'),JSON[_0xe3ca('0x11')](_0x1ae7bf));if(_0x1ae7bf[_0xe3ca('0x12')]){if(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x13')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x36d17a,_0x1ae7bf[_0xe3ca('0x12')]['message']);return _0x100c20(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);}logger['error'](_0xe3ca('0xe'),_0x36d17a,_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);return _0x2c4863(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);}else{logger[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x36d17a,_0xe3ca('0x10'));_0x2c4863(_0x1ae7bf['result']['message']);}})[_0xe3ca('0x15')](function(_0x4296ae){logger[_0xe3ca('0x12')](_0xe3ca('0xe'),_0x36d17a,_0x4296ae);_0x100c20(_0x4296ae);});});}exports[_0xe3ca('0x16')]=function(_0x2d73d9){var _0x5bb8d8=this;return new Promise(function(_0x2eafde,_0xda5841){return db[_0xe3ca('0x17')]['create'](_0x2d73d9['body'],{'raw':_0x2d73d9['options']?_0x2d73d9[_0xe3ca('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3b7591){logger[_0xe3ca('0xd')](_0xe3ca('0x16'),_0x2d73d9);logger[_0xe3ca('0xf')](_0xe3ca('0x16'),_0x2d73d9,JSON['stringify'](_0x3b7591));_0x2eafde(_0x3b7591);})[_0xe3ca('0x15')](function(_0x3ab26e){logger['error'](_0xe3ca('0x16'),_0x3ab26e[_0xe3ca('0x14')],_0x2d73d9);_0xda5841(_0x5bb8d8[_0xe3ca('0x12')](0x1f4,_0x3ab26e[_0xe3ca('0x14')]));});});};
\ No newline at end of file
index 2611ba8..1522fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a53=['/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','get'];(function(_0x100ea3,_0x474de1){var _0x1ca28e=function(_0x3e3708){while(--_0x3e3708){_0x100ea3['push'](_0x100ea3['shift']());}};_0x1ca28e(++_0x474de1);}(_0x3a53,0x1e6));var _0x33a5=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x3a53[_0x40b493];return _0x548365;};'use strict';var express=require(_0x33a5('0x0'));var router=express[_0x33a5('0x1')]();var auth=require(_0x33a5('0x2'));var controller=require('./system.controller');router[_0x33a5('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x33a5('0x3')](_0x33a5('0x4'),auth['isAuthenticated'](),controller[_0x33a5('0x5')]);module[_0x33a5('0x6')]=router;
\ No newline at end of file
+var _0x9380=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x17e69b,_0x512806){var _0x55eea8=function(_0x510384){while(--_0x510384){_0x17e69b['push'](_0x17e69b['shift']());}};_0x55eea8(++_0x512806);}(_0x9380,0xb2));var _0x0938=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9380[_0x46e363];return _0x3fb059;};'use strict';var express=require(_0x0938('0x0'));var router=express[_0x0938('0x1')]();var auth=require(_0x0938('0x2'));var controller=require(_0x0938('0x3'));router[_0x0938('0x4')]('/',auth[_0x0938('0x5')](),controller[_0x0938('0x6')]);router[_0x0938('0x4')](_0x0938('0x7'),auth[_0x0938('0x5')](),controller[_0x0938('0x8')]);module[_0x0938('0x9')]=router;
\ No newline at end of file
index 7c6fa8b..01cf27a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae06=['json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','util','lodash','error','inspect','name','status','send','index','getAllData','then','catch'];(function(_0x3e252f,_0x5953ef){var _0x556101=function(_0x16d438){while(--_0x16d438){_0x3e252f['push'](_0x3e252f['shift']());}};_0x556101(++_0x5953ef);}(_0xae06,0x82));var _0x6ae0=function(_0x35342a,_0x29aa08){_0x35342a=_0x35342a-0x0;var _0x9f9532=_0xae06[_0x35342a];return _0x9f9532;};'use strict';var info=require('systeminformation');var exec=require(_0x6ae0('0x0'))[_0x6ae0('0x1')];var logger=require(_0x6ae0('0x2'))('api');var util=require(_0x6ae0('0x3'));var BPromise=require('bluebird');var _=require(_0x6ae0('0x4'));function handleError(_0x572265,_0x335973,_0x554712){_0x335973=_0x335973||0x1f4;return function(_0xa6d837){logger[_0x6ae0('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x554712,_0x335973,util[_0x6ae0('0x6')](_0xa6d837,{'showHidden':![],'depth':null}));delete _0xa6d837[_0x6ae0('0x7')];_0x572265[_0x6ae0('0x8')](_0x335973)[_0x6ae0('0x9')](_0xa6d837);};}exports[_0x6ae0('0xa')]=function(_0x3ac98e,_0x20be26){return info[_0x6ae0('0xb')]()[_0x6ae0('0xc')](function(_0x37c9c6){return _0x20be26[_0x6ae0('0x8')](0xc8)['json'](_0x37c9c6);})[_0x6ae0('0xd')](function(_0x465919){return _0x20be26['status'](0x1f4)[_0x6ae0('0xe')](_0x465919);});};exports[_0x6ae0('0xf')]=function(_0x29a7a4,_0x4f310d){var _0x19ce1e=['components/import/cm'];return new BPromise(function(_0x1aca90,_0x269347){return exec(util[_0x6ae0('0x10')](_0x6ae0('0x11'),_0x29a7a4[_0x6ae0('0x12')]['pid']),function(_0x11283b,_0x3b3d37,_0x3d650a){if(_0x11283b){return _0x269347(_0x11283b);}return _0x1aca90(_0x3b3d37);});})[_0x6ae0('0xc')](function(_0x164c73){var _0x398832=![];var _0x4c11ce=_0x164c73['split'](/\n/);for(var _0x401a2b=0x0,_0x3ffbad=_0x19ce1e['length'];_0x401a2b<_0x3ffbad,_0x398832===![];_0x401a2b+=0x1){if(_0x164c73[_0x6ae0('0x13')](_0x19ce1e[_0x401a2b])>=0x0){_0x398832=!![];}}if(!_0x398832){throw new Error(util[_0x6ae0('0x10')](_0x6ae0('0x14'),_0x29a7a4[_0x6ae0('0x12')][_0x6ae0('0x15')]));}process['kill'](_0x29a7a4[_0x6ae0('0x12')][_0x6ae0('0x15')],_0x6ae0('0x16'));return _0x4f310d[_0x6ae0('0x8')](0xc8)[_0x6ae0('0xe')]({'message':util[_0x6ae0('0x10')](_0x6ae0('0x17'),_0x29a7a4[_0x6ae0('0x12')]['pid'])});})[_0x6ae0('0xd')](handleError(_0x4f310d,null,_0x6ae0('0xf')));};
\ No newline at end of file
+var _0xfc2f=['index','getAllData','then','status','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name'];(function(_0x176a49,_0x429e67){var _0x1473f8=function(_0xc5c82e){while(--_0xc5c82e){_0x176a49['push'](_0x176a49['shift']());}};_0x1473f8(++_0x429e67);}(_0xfc2f,0xe1));var _0xffc2=function(_0xef5400,_0x5ec7bb){_0xef5400=_0xef5400-0x0;var _0x24e5e9=_0xfc2f[_0xef5400];return _0x24e5e9;};'use strict';var info=require(_0xffc2('0x0'));var exec=require(_0xffc2('0x1'))['exec'];var logger=require(_0xffc2('0x2'))(_0xffc2('0x3'));var util=require(_0xffc2('0x4'));var BPromise=require(_0xffc2('0x5'));var _=require(_0xffc2('0x6'));function handleError(_0x160e0c,_0x25dd97,_0x163f63){_0x25dd97=_0x25dd97||0x1f4;return function(_0x284fdd){logger['error'](_0xffc2('0x7'),_0x163f63,_0x25dd97,util['inspect'](_0x284fdd,{'showHidden':![],'depth':null}));delete _0x284fdd[_0xffc2('0x8')];_0x160e0c['status'](_0x25dd97)['send'](_0x284fdd);};}exports[_0xffc2('0x9')]=function(_0x3db20e,_0x55e75f){return info[_0xffc2('0xa')]()[_0xffc2('0xb')](function(_0x41fa57){return _0x55e75f[_0xffc2('0xc')](0xc8)['json'](_0x41fa57);})[_0xffc2('0xd')](function(_0x1cdd09){return _0x55e75f[_0xffc2('0xc')](0x1f4)[_0xffc2('0xe')](_0x1cdd09);});};exports[_0xffc2('0xf')]=function(_0x2d61e1,_0x273427){var _0x1a2573=[_0xffc2('0x10')];return new BPromise(function(_0x28c9e4,_0x8d0ec1){return exec(util[_0xffc2('0x11')](_0xffc2('0x12'),_0x2d61e1[_0xffc2('0x13')][_0xffc2('0x14')]),function(_0x2d888a,_0x5bcd68,_0x4b655b){if(_0x2d888a){return _0x8d0ec1(_0x2d888a);}return _0x28c9e4(_0x5bcd68);});})[_0xffc2('0xb')](function(_0x3afe3a){var _0x26763b=![];var _0x438ac2=_0x3afe3a[_0xffc2('0x15')](/\n/);for(var _0x287867=0x0,_0x8bf0f8=_0x1a2573[_0xffc2('0x16')];_0x287867<_0x8bf0f8,_0x26763b===![];_0x287867+=0x1){if(_0x3afe3a[_0xffc2('0x17')](_0x1a2573[_0x287867])>=0x0){_0x26763b=!![];}}if(!_0x26763b){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x2d61e1['params']['pid']));}process['kill'](_0x2d61e1['params'][_0xffc2('0x14')],_0xffc2('0x18'));return _0x273427['status'](0xc8)[_0xffc2('0xe')]({'message':util[_0xffc2('0x11')](_0xffc2('0x19'),_0x2d61e1[_0xffc2('0x13')][_0xffc2('0x14')])});})[_0xffc2('0xd')](handleError(_0x273427,null,_0xffc2('0xf')));};
\ No newline at end of file
index dff1038..4e5ffeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ee7=['show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated'];(function(_0x32df33,_0x26da5b){var _0x511ed8=function(_0x3be8b9){while(--_0x3be8b9){_0x32df33['push'](_0x32df33['shift']());}};_0x511ed8(++_0x26da5b);}(_0x9ee7,0x196));var _0x79ee=function(_0x17226d,_0x5cdceb){_0x17226d=_0x17226d-0x0;var _0x1a0243=_0x9ee7[_0x17226d];return _0x1a0243;};'use strict';var multer=require(_0x79ee('0x0'));var util=require(_0x79ee('0x1'));var path=require(_0x79ee('0x2'));var timeout=require(_0x79ee('0x3'));var express=require(_0x79ee('0x4'));var router=express[_0x79ee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x79ee('0x6'));var interaction=require(_0x79ee('0x7'));var config=require(_0x79ee('0x8'));var controller=require(_0x79ee('0x9'));router[_0x79ee('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x79ee('0xa')]('/:id',auth[_0x79ee('0xb')](),controller[_0x79ee('0xc')]);router['post']('/',auth[_0x79ee('0xb')](),controller['create']);router[_0x79ee('0xd')](_0x79ee('0xe'),auth[_0x79ee('0xb')](),controller[_0x79ee('0xf')]);router[_0x79ee('0x10')](_0x79ee('0xe'),auth['isAuthenticated'](),controller[_0x79ee('0x11')]);module[_0x79ee('0x12')]=router;
\ No newline at end of file
+var _0x1402=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x221240,_0x523d4d){var _0x3c1bdb=function(_0xf4df61){while(--_0xf4df61){_0x221240['push'](_0x221240['shift']());}};_0x3c1bdb(++_0x523d4d);}(_0x1402,0xba));var _0x2140=function(_0x428534,_0x411af4){_0x428534=_0x428534-0x0;var _0x13a9c5=_0x1402[_0x428534];return _0x13a9c5;};'use strict';var multer=require(_0x2140('0x0'));var util=require(_0x2140('0x1'));var path=require(_0x2140('0x2'));var timeout=require(_0x2140('0x3'));var express=require('express');var router=express[_0x2140('0x4')]();var fs_extra=require(_0x2140('0x5'));var auth=require(_0x2140('0x6'));var interaction=require(_0x2140('0x7'));var config=require(_0x2140('0x8'));var controller=require(_0x2140('0x9'));router[_0x2140('0xa')]('/',auth[_0x2140('0xb')](),controller[_0x2140('0xc')]);router[_0x2140('0xa')](_0x2140('0xd'),auth[_0x2140('0xb')](),controller[_0x2140('0xe')]);router[_0x2140('0xf')]('/',auth[_0x2140('0xb')](),controller[_0x2140('0x10')]);router[_0x2140('0x11')](_0x2140('0xd'),auth[_0x2140('0xb')](),controller[_0x2140('0x12')]);router[_0x2140('0x13')](_0x2140('0xd'),auth[_0x2140('0xb')](),controller['destroy']);module[_0x2140('0x14')]=router;
\ No newline at end of file
index fda200b..2094c02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a5=['exports','STRING','sequelize'];(function(_0xbb7645,_0x50d220){var _0x1034ab=function(_0x5c8d2c){while(--_0x5c8d2c){_0xbb7645['push'](_0xbb7645['shift']());}};_0x1034ab(++_0x50d220);}(_0x63a5,0x18e));var _0x563a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x63a5[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x563a('0x0'));module[_0x563a('0x1')]={'name':{'type':Sequelize[_0x563a('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x563a('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x563a('0x2')]}};
\ No newline at end of file
+var _0x39c4=['exports','STRING','#0091EA'];(function(_0x39a72a,_0x12fc0e){var _0xa3db81=function(_0x279e07){while(--_0x279e07){_0x39a72a['push'](_0x39a72a['shift']());}};_0xa3db81(++_0x12fc0e);}(_0x39c4,0x174));var _0x439c=function(_0x1146ec,_0xf40140){_0x1146ec=_0x1146ec-0x0;var _0x2c5f27=_0x39c4[_0x1146ec];return _0x2c5f27;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x439c('0x1')],'defaultValue':_0x439c('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f3e4a7f..83dab03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2121=['include','findAll','rows','catch','show','params','length','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','create','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x493050,_0x49ead2){var _0x1a555b=function(_0x4d7f16){while(--_0x4d7f16){_0x493050['push'](_0x493050['shift']());}};_0x1a555b(++_0x49ead2);}(_0x2121,0x1b4));var _0x1212=function(_0x39655b,_0x5b10ff){_0x39655b=_0x39655b-0x0;var _0x32554a=_0x2121[_0x39655b];return _0x32554a;};'use strict';var emlformat=require(_0x1212('0x0'));var rimraf=require(_0x1212('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1212('0x2'));var moment=require(_0x1212('0x3'));var BPromise=require(_0x1212('0x4'));var Mustache=require(_0x1212('0x5'));var util=require(_0x1212('0x6'));var path=require('path');var sox=require(_0x1212('0x7'));var csv=require('to-csv');var ejs=require(_0x1212('0x8'));var fs=require('fs');var fs_extra=require(_0x1212('0x9'));var _=require(_0x1212('0xa'));var squel=require(_0x1212('0xb'));var crypto=require(_0x1212('0xc'));var jsforce=require(_0x1212('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1212('0xe'));var querystring=require(_0x1212('0xf'));var Papa=require(_0x1212('0x10'));var Redis=require(_0x1212('0x11'));var authService=require(_0x1212('0x12'));var qs=require(_0x1212('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1212('0x14'))(_0x1212('0x15'));var utils=require(_0x1212('0x16'));var config=require(_0x1212('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1212('0x18'))['db'];function respondWithStatusCode(_0x3cb42e,_0x17882d){_0x17882d=_0x17882d||0xcc;return function(_0x3e33fe){if(_0x3e33fe){return _0x3cb42e[_0x1212('0x19')](_0x17882d);}return _0x3cb42e[_0x1212('0x1a')](_0x17882d)[_0x1212('0x1b')]();};}function respondWithResult(_0x3ee480,_0x469cf6){_0x469cf6=_0x469cf6||0xc8;return function(_0x35b8ac){if(_0x35b8ac){return _0x3ee480[_0x1212('0x1a')](_0x469cf6)[_0x1212('0x1c')](_0x35b8ac);}};}function respondWithFilteredResult(_0x5ecfe5,_0x13e062){return function(_0x1919e1){if(_0x1919e1){var _0x5cc246=typeof _0x13e062['offset']==='undefined'&&typeof _0x13e062[_0x1212('0x1d')]===_0x1212('0x1e');var _0x768995=_0x1919e1[_0x1212('0x1f')];var _0x3cf284=_0x5cc246?0x0:_0x13e062[_0x1212('0x20')];var _0xb0dc88=_0x5cc246?_0x1919e1[_0x1212('0x1f')]:_0x13e062[_0x1212('0x20')]+_0x13e062['limit'];var _0x3c638a;if(_0xb0dc88>=_0x768995){_0xb0dc88=_0x768995;_0x3c638a=0xc8;}else{_0x3c638a=0xce;}_0x5ecfe5[_0x1212('0x1a')](_0x3c638a);return _0x5ecfe5[_0x1212('0x21')](_0x1212('0x22'),_0x3cf284+'-'+_0xb0dc88+'/'+_0x768995)[_0x1212('0x1c')](_0x1919e1);}return null;};}function patchUpdates(_0x2e656f){return function(_0x7d0810){try{jsonpatch[_0x1212('0x23')](_0x7d0810,_0x2e656f,!![]);}catch(_0x4e5437){return BPromise[_0x1212('0x24')](_0x4e5437);}return _0x7d0810[_0x1212('0x25')]();};}function saveUpdates(_0x46d6df,_0x5d15ca){return function(_0x1571fd){if(_0x1571fd){return _0x1571fd[_0x1212('0x26')](_0x46d6df)[_0x1212('0x27')](function(_0x28c92b){return _0x28c92b;});}return null;};}function removeEntity(_0x52132b,_0x58ab5b){return function(_0x59cd01){if(_0x59cd01){return _0x59cd01['destroy']()['then'](function(){var _0xec5b8d=_0x59cd01[_0x1212('0x28')]({'plain':!![]});var _0x4c32a7=_0x1212('0x29');return db[_0x1212('0x2a')]['destroy']({'where':{'type':_0x4c32a7,'resourceId':_0xec5b8d['id']}})[_0x1212('0x27')](function(){return _0x59cd01;});})[_0x1212('0x27')](function(){_0x52132b[_0x1212('0x1a')](0xcc)[_0x1212('0x1b')]();});}};}function handleEntityNotFound(_0x3a0ddf,_0x3f6be3){return function(_0x2750b0){if(!_0x2750b0){_0x3a0ddf[_0x1212('0x19')](0x194);}return _0x2750b0;};}function handleError(_0x53aa25,_0x156b50){_0x156b50=_0x156b50||0x1f4;return function(_0x7706a0){logger[_0x1212('0x2b')](_0x7706a0[_0x1212('0x2c')]);if(_0x7706a0[_0x1212('0x2d')]){delete _0x7706a0[_0x1212('0x2d')];}_0x53aa25[_0x1212('0x1a')](_0x156b50)[_0x1212('0x2e')](_0x7706a0);};}exports[_0x1212('0x2f')]=function(_0x1e3506,_0x4b8e34){var _0x5a9b18={},_0x365232={},_0x5769a9={'count':0x0,'rows':[]};var _0x339d58=_['map'](db[_0x1212('0x30')]['rawAttributes'],function(_0x2c9313){return{'name':_0x2c9313[_0x1212('0x31')],'type':_0x2c9313[_0x1212('0x32')][_0x1212('0x33')]};});_0x365232['model']=_[_0x1212('0x34')](_0x339d58,_0x1212('0x2d'));_0x365232[_0x1212('0x35')]=_[_0x1212('0x36')](_0x1e3506[_0x1212('0x35')]);_0x365232['filters']=_[_0x1212('0x37')](_0x365232[_0x1212('0x38')],_0x365232[_0x1212('0x35')]);_0x5a9b18['attributes']=_[_0x1212('0x37')](_0x365232[_0x1212('0x38')],qs[_0x1212('0x39')](_0x1e3506[_0x1212('0x35')]['fields']));_0x5a9b18[_0x1212('0x3a')]=_0x5a9b18[_0x1212('0x3a')]['length']?_0x5a9b18[_0x1212('0x3a')]:_0x365232[_0x1212('0x38')];if(!_0x1e3506[_0x1212('0x35')]['hasOwnProperty'](_0x1212('0x3b'))){_0x5a9b18[_0x1212('0x1d')]=qs[_0x1212('0x1d')](_0x1e3506['query'][_0x1212('0x1d')]);_0x5a9b18['offset']=qs[_0x1212('0x20')](_0x1e3506[_0x1212('0x35')]['offset']);}_0x5a9b18['order']=qs[_0x1212('0x3c')](_0x1e3506['query'][_0x1212('0x3c')]);_0x5a9b18[_0x1212('0x3d')]=qs[_0x1212('0x3e')](_[_0x1212('0x3f')](_0x1e3506[_0x1212('0x35')],_0x365232[_0x1212('0x3e')]),_0x339d58);if(_0x1e3506[_0x1212('0x35')][_0x1212('0x40')]){_0x5a9b18[_0x1212('0x3d')]=_[_0x1212('0x41')](_0x5a9b18[_0x1212('0x3d')],{'$or':_[_0x1212('0x34')](_0x339d58,function(_0x4995e1){if(_0x4995e1[_0x1212('0x32')]!==_0x1212('0x42')){var _0x42b95a={};_0x42b95a[_0x4995e1[_0x1212('0x2d')]]={'$like':'%'+_0x1e3506[_0x1212('0x35')]['filter']+'%'};return _0x42b95a;}})});}_0x5a9b18=_[_0x1212('0x41')]({},_0x5a9b18,_0x1e3506['options']);var _0x50fc00={'where':_0x5a9b18[_0x1212('0x3d')]};return db[_0x1212('0x30')][_0x1212('0x1f')](_0x50fc00)[_0x1212('0x27')](function(_0x469fcd){_0x5769a9['count']=_0x469fcd;if(_0x1e3506['query'][_0x1212('0x43')]){_0x5a9b18[_0x1212('0x44')]=[{'all':!![]}];}return db[_0x1212('0x30')][_0x1212('0x45')](_0x5a9b18);})[_0x1212('0x27')](function(_0x640717){_0x5769a9[_0x1212('0x46')]=_0x640717;return _0x5769a9;})[_0x1212('0x27')](respondWithFilteredResult(_0x4b8e34,_0x5a9b18))[_0x1212('0x47')](handleError(_0x4b8e34,null));};exports[_0x1212('0x48')]=function(_0x1af6ae,_0x15e1ce){var _0x4e1a32={'raw':!![],'where':{'id':_0x1af6ae[_0x1212('0x49')]['id']}},_0x584d32={};_0x584d32[_0x1212('0x38')]=_['keys'](db[_0x1212('0x30')]['rawAttributes']);_0x584d32[_0x1212('0x35')]=_[_0x1212('0x36')](_0x1af6ae[_0x1212('0x35')]);_0x584d32[_0x1212('0x3e')]=_[_0x1212('0x37')](_0x584d32['model'],_0x584d32[_0x1212('0x35')]);_0x4e1a32[_0x1212('0x3a')]=_[_0x1212('0x37')](_0x584d32['model'],qs[_0x1212('0x39')](_0x1af6ae[_0x1212('0x35')]['fields']));_0x4e1a32[_0x1212('0x3a')]=_0x4e1a32[_0x1212('0x3a')][_0x1212('0x4a')]?_0x4e1a32[_0x1212('0x3a')]:_0x584d32[_0x1212('0x38')];if(_0x1af6ae[_0x1212('0x35')]['includeAll']){_0x4e1a32[_0x1212('0x44')]=[{'all':!![]}];}_0x4e1a32=_[_0x1212('0x41')]({},_0x4e1a32,_0x1af6ae[_0x1212('0x4b')]);return db['Tag']['find'](_0x4e1a32)[_0x1212('0x27')](handleEntityNotFound(_0x15e1ce,null))['then'](respondWithResult(_0x15e1ce,null))[_0x1212('0x47')](handleError(_0x15e1ce,null));};exports['create']=function(_0x50a8ef,_0x19a24f){return db[_0x1212('0x30')]['create'](_0x50a8ef[_0x1212('0x4c')],{})['then'](function(_0x2972a3){var _0x24cae5=_0x50a8ef['user']['get']({'plain':!![]});if(!_0x24cae5)throw new Error(_0x1212('0x4d'));if(_0x24cae5['role']===_0x1212('0x4e')){var _0x53a46f=_0x2972a3[_0x1212('0x28')]({'plain':!![]});var _0x49b71b=_0x1212('0x29');return db[_0x1212('0x4f')][_0x1212('0x50')]({'where':{'name':_0x49b71b,'userProfileId':_0x24cae5[_0x1212('0x51')]},'raw':!![]})[_0x1212('0x27')](function(_0xcc376d){if(_0xcc376d&&_0xcc376d['autoAssociation']===0x0){return db['UserProfileResource'][_0x1212('0x52')]({'name':_0x53a46f[_0x1212('0x2d')],'resourceId':_0x53a46f['id'],'type':_0xcc376d[_0x1212('0x2d')],'sectionId':_0xcc376d['id']},{})[_0x1212('0x27')](function(){return _0x2972a3;});}else{return _0x2972a3;}})[_0x1212('0x47')](function(_0x3c1acf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c1acf);throw _0x3c1acf;});}return _0x2972a3;})['then'](respondWithResult(_0x19a24f,0xc9))[_0x1212('0x47')](handleError(_0x19a24f,null));};exports[_0x1212('0x26')]=function(_0x233854,_0x160cb8){if(_0x233854[_0x1212('0x4c')]['id']){delete _0x233854['body']['id'];}return db[_0x1212('0x30')][_0x1212('0x50')]({'where':{'id':_0x233854[_0x1212('0x49')]['id']}})[_0x1212('0x27')](handleEntityNotFound(_0x160cb8,null))[_0x1212('0x27')](saveUpdates(_0x233854[_0x1212('0x4c')],null))['then'](respondWithResult(_0x160cb8,null))[_0x1212('0x47')](handleError(_0x160cb8,null));};exports[_0x1212('0x53')]=function(_0x31d8be,_0x4a86bd){return db[_0x1212('0x30')][_0x1212('0x50')]({'where':{'id':_0x31d8be[_0x1212('0x49')]['id']}})[_0x1212('0x27')](handleEntityNotFound(_0x4a86bd,null))['then'](removeEntity(_0x4a86bd,null))[_0x1212('0x47')](handleError(_0x4a86bd,null));};
\ No newline at end of file
+var _0x5b02=['sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','get','Tags','UserProfileResource','destroy','error','stack','name','send','index','Tag','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x8f4fcf,_0x781bf6){var _0x3b9ec5=function(_0xdbbfc9){while(--_0xdbbfc9){_0x8f4fcf['push'](_0x8f4fcf['shift']());}};_0x3b9ec5(++_0x781bf6);}(_0x5b02,0xe9));var _0x25b0=function(_0x4172e6,_0xd67614){_0x4172e6=_0x4172e6-0x0;var _0xdc5064=_0x5b02[_0x4172e6];return _0xdc5064;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require(_0x25b0('0x1'));var zipdir=require(_0x25b0('0x2'));var jsonpatch=require(_0x25b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require('mustache');var util=require(_0x25b0('0x5'));var path=require(_0x25b0('0x6'));var sox=require(_0x25b0('0x7'));var csv=require(_0x25b0('0x8'));var ejs=require(_0x25b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var licenseUtil=require(_0x25b0('0x17'));var db=require(_0x25b0('0x18'))['db'];function respondWithStatusCode(_0x1d3178,_0x184452){_0x184452=_0x184452||0xcc;return function(_0x26a34f){if(_0x26a34f){return _0x1d3178[_0x25b0('0x19')](_0x184452);}return _0x1d3178[_0x25b0('0x1a')](_0x184452)[_0x25b0('0x1b')]();};}function respondWithResult(_0x42cc07,_0x293203){_0x293203=_0x293203||0xc8;return function(_0x211658){if(_0x211658){return _0x42cc07[_0x25b0('0x1a')](_0x293203)[_0x25b0('0x1c')](_0x211658);}};}function respondWithFilteredResult(_0x40071c,_0x5ac18d){return function(_0x51542b){if(_0x51542b){var _0xfe1ea6=typeof _0x5ac18d['offset']===_0x25b0('0x1d')&&typeof _0x5ac18d[_0x25b0('0x1e')]===_0x25b0('0x1d');var _0x3267b9=_0x51542b['count'];var _0x1d850f=_0xfe1ea6?0x0:_0x5ac18d[_0x25b0('0x1f')];var _0x20762e=_0xfe1ea6?_0x51542b[_0x25b0('0x20')]:_0x5ac18d[_0x25b0('0x1f')]+_0x5ac18d[_0x25b0('0x1e')];var _0x54f458;if(_0x20762e>=_0x3267b9){_0x20762e=_0x3267b9;_0x54f458=0xc8;}else{_0x54f458=0xce;}_0x40071c[_0x25b0('0x1a')](_0x54f458);return _0x40071c[_0x25b0('0x21')](_0x25b0('0x22'),_0x1d850f+'-'+_0x20762e+'/'+_0x3267b9)[_0x25b0('0x1c')](_0x51542b);}return null;};}function patchUpdates(_0x1dc691){return function(_0xea4162){try{jsonpatch[_0x25b0('0x23')](_0xea4162,_0x1dc691,!![]);}catch(_0x19599b){return BPromise[_0x25b0('0x24')](_0x19599b);}return _0xea4162[_0x25b0('0x25')]();};}function saveUpdates(_0x2b2eda,_0x3ce1da){return function(_0x5cb746){if(_0x5cb746){return _0x5cb746[_0x25b0('0x26')](_0x2b2eda)[_0x25b0('0x27')](function(_0x517ec5){return _0x517ec5;});}return null;};}function removeEntity(_0x2d7c17,_0x2023d8){return function(_0x3546f0){if(_0x3546f0){return _0x3546f0['destroy']()['then'](function(){var _0x50089e=_0x3546f0[_0x25b0('0x28')]({'plain':!![]});var _0x433085=_0x25b0('0x29');return db[_0x25b0('0x2a')][_0x25b0('0x2b')]({'where':{'type':_0x433085,'resourceId':_0x50089e['id']}})[_0x25b0('0x27')](function(){return _0x3546f0;});})[_0x25b0('0x27')](function(){_0x2d7c17[_0x25b0('0x1a')](0xcc)[_0x25b0('0x1b')]();});}};}function handleEntityNotFound(_0x596d14,_0x2ea408){return function(_0xbfba84){if(!_0xbfba84){_0x596d14['sendStatus'](0x194);}return _0xbfba84;};}function handleError(_0x567775,_0x5de43d){_0x5de43d=_0x5de43d||0x1f4;return function(_0x1a6212){logger[_0x25b0('0x2c')](_0x1a6212[_0x25b0('0x2d')]);if(_0x1a6212[_0x25b0('0x2e')]){delete _0x1a6212[_0x25b0('0x2e')];}_0x567775[_0x25b0('0x1a')](_0x5de43d)[_0x25b0('0x2f')](_0x1a6212);};}exports[_0x25b0('0x30')]=function(_0x36b81d,_0x285a2b){var _0x1e217c={},_0x3161c1={},_0x1ea374={'count':0x0,'rows':[]};var _0x4f640f=_['map'](db[_0x25b0('0x31')]['rawAttributes'],function(_0x4dfeea){return{'name':_0x4dfeea[_0x25b0('0x32')],'type':_0x4dfeea[_0x25b0('0x33')][_0x25b0('0x34')]};});_0x3161c1[_0x25b0('0x35')]=_[_0x25b0('0x36')](_0x4f640f,'name');_0x3161c1[_0x25b0('0x37')]=_[_0x25b0('0x38')](_0x36b81d['query']);_0x3161c1[_0x25b0('0x39')]=_[_0x25b0('0x3a')](_0x3161c1['model'],_0x3161c1[_0x25b0('0x37')]);_0x1e217c['attributes']=_[_0x25b0('0x3a')](_0x3161c1[_0x25b0('0x35')],qs[_0x25b0('0x3b')](_0x36b81d[_0x25b0('0x37')][_0x25b0('0x3b')]));_0x1e217c[_0x25b0('0x3c')]=_0x1e217c[_0x25b0('0x3c')][_0x25b0('0x3d')]?_0x1e217c[_0x25b0('0x3c')]:_0x3161c1['model'];if(!_0x36b81d[_0x25b0('0x37')][_0x25b0('0x3e')](_0x25b0('0x3f'))){_0x1e217c[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x36b81d[_0x25b0('0x37')][_0x25b0('0x1e')]);_0x1e217c[_0x25b0('0x1f')]=qs[_0x25b0('0x1f')](_0x36b81d[_0x25b0('0x37')]['offset']);}_0x1e217c[_0x25b0('0x40')]=qs[_0x25b0('0x41')](_0x36b81d[_0x25b0('0x37')]['sort']);_0x1e217c[_0x25b0('0x42')]=qs[_0x25b0('0x39')](_[_0x25b0('0x43')](_0x36b81d[_0x25b0('0x37')],_0x3161c1[_0x25b0('0x39')]),_0x4f640f);if(_0x36b81d[_0x25b0('0x37')][_0x25b0('0x44')]){_0x1e217c[_0x25b0('0x42')]=_['merge'](_0x1e217c['where'],{'$or':_[_0x25b0('0x36')](_0x4f640f,function(_0x30d1e3){if(_0x30d1e3[_0x25b0('0x33')]!=='VIRTUAL'){var _0x9c6ab4={};_0x9c6ab4[_0x30d1e3['name']]={'$like':'%'+_0x36b81d[_0x25b0('0x37')][_0x25b0('0x44')]+'%'};return _0x9c6ab4;}})});}_0x1e217c=_[_0x25b0('0x45')]({},_0x1e217c,_0x36b81d[_0x25b0('0x46')]);var _0x8a2eeb={'where':_0x1e217c['where']};return db[_0x25b0('0x31')][_0x25b0('0x20')](_0x8a2eeb)[_0x25b0('0x27')](function(_0x376d8a){_0x1ea374[_0x25b0('0x20')]=_0x376d8a;if(_0x36b81d['query'][_0x25b0('0x47')]){_0x1e217c[_0x25b0('0x48')]=[{'all':!![]}];}return db[_0x25b0('0x31')][_0x25b0('0x49')](_0x1e217c);})[_0x25b0('0x27')](function(_0x1adf8d){_0x1ea374[_0x25b0('0x4a')]=_0x1adf8d;return _0x1ea374;})[_0x25b0('0x27')](respondWithFilteredResult(_0x285a2b,_0x1e217c))[_0x25b0('0x4b')](handleError(_0x285a2b,null));};exports[_0x25b0('0x4c')]=function(_0x124d4b,_0x5186cc){var _0x13e2cf={'raw':!![],'where':{'id':_0x124d4b[_0x25b0('0x4d')]['id']}},_0x5cb047={};_0x5cb047[_0x25b0('0x35')]=_[_0x25b0('0x38')](db[_0x25b0('0x31')]['rawAttributes']);_0x5cb047[_0x25b0('0x37')]=_[_0x25b0('0x38')](_0x124d4b[_0x25b0('0x37')]);_0x5cb047['filters']=_[_0x25b0('0x3a')](_0x5cb047[_0x25b0('0x35')],_0x5cb047[_0x25b0('0x37')]);_0x13e2cf[_0x25b0('0x3c')]=_[_0x25b0('0x3a')](_0x5cb047[_0x25b0('0x35')],qs[_0x25b0('0x3b')](_0x124d4b['query'][_0x25b0('0x3b')]));_0x13e2cf[_0x25b0('0x3c')]=_0x13e2cf[_0x25b0('0x3c')]['length']?_0x13e2cf[_0x25b0('0x3c')]:_0x5cb047[_0x25b0('0x35')];if(_0x124d4b[_0x25b0('0x37')][_0x25b0('0x47')]){_0x13e2cf[_0x25b0('0x48')]=[{'all':!![]}];}_0x13e2cf=_['merge']({},_0x13e2cf,_0x124d4b[_0x25b0('0x46')]);return db[_0x25b0('0x31')][_0x25b0('0x4e')](_0x13e2cf)['then'](handleEntityNotFound(_0x5186cc,null))[_0x25b0('0x27')](respondWithResult(_0x5186cc,null))[_0x25b0('0x4b')](handleError(_0x5186cc,null));};exports[_0x25b0('0x4f')]=function(_0x1d6d55,_0x29165e){return db[_0x25b0('0x31')]['create'](_0x1d6d55['body'],{})['then'](function(_0x1eb908){var _0x4bd7ba=_0x1d6d55['user'][_0x25b0('0x28')]({'plain':!![]});if(!_0x4bd7ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bd7ba[_0x25b0('0x50')]==='user'){var _0x4fc22d=_0x1eb908[_0x25b0('0x28')]({'plain':!![]});var _0x14a8a7=_0x25b0('0x29');return db[_0x25b0('0x51')][_0x25b0('0x4e')]({'where':{'name':_0x14a8a7,'userProfileId':_0x4bd7ba[_0x25b0('0x52')]},'raw':!![]})[_0x25b0('0x27')](function(_0x2d5522){if(_0x2d5522&&_0x2d5522[_0x25b0('0x53')]===0x0){return db[_0x25b0('0x2a')]['create']({'name':_0x4fc22d['name'],'resourceId':_0x4fc22d['id'],'type':_0x2d5522['name'],'sectionId':_0x2d5522['id']},{})[_0x25b0('0x27')](function(){return _0x1eb908;});}else{return _0x1eb908;}})[_0x25b0('0x4b')](function(_0x2a28fb){logger[_0x25b0('0x2c')](_0x25b0('0x54'),_0x2a28fb);throw _0x2a28fb;});}return _0x1eb908;})[_0x25b0('0x27')](respondWithResult(_0x29165e,0xc9))[_0x25b0('0x4b')](handleError(_0x29165e,null));};exports['update']=function(_0x64ffa3,_0x4a8adc){if(_0x64ffa3[_0x25b0('0x55')]['id']){delete _0x64ffa3['body']['id'];}return db['Tag'][_0x25b0('0x4e')]({'where':{'id':_0x64ffa3['params']['id']}})['then'](handleEntityNotFound(_0x4a8adc,null))[_0x25b0('0x27')](saveUpdates(_0x64ffa3[_0x25b0('0x55')],null))[_0x25b0('0x27')](respondWithResult(_0x4a8adc,null))[_0x25b0('0x4b')](handleError(_0x4a8adc,null));};exports[_0x25b0('0x2b')]=function(_0x367d57,_0x8bbdb3){return db[_0x25b0('0x31')][_0x25b0('0x4e')]({'where':{'id':_0x367d57[_0x25b0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x8bbdb3,null))['then'](removeEntity(_0x8bbdb3,null))[_0x25b0('0x4b')](handleError(_0x8bbdb3,null));};
\ No newline at end of file
index 8488d24..d6c4511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4729=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x4729,0x68));var _0x9472=function(_0x43f004,_0x3a2404){_0x43f004=_0x43f004-0x0;var _0x4da275=_0x4729[_0x43f004];return _0x4da275;};'use strict';var _=require(_0x9472('0x0'));var util=require(_0x9472('0x1'));var logger=require(_0x9472('0x2'))(_0x9472('0x3'));var moment=require(_0x9472('0x4'));var BPromise=require(_0x9472('0x5'));var rp=require(_0x9472('0x6'));var fs=require('fs');var path=require(_0x9472('0x7'));var rimraf=require(_0x9472('0x8'));var config=require(_0x9472('0x9'));var attributes=require(_0x9472('0xa'));module[_0x9472('0xb')]=function(_0x14884d,_0x24d13d){return _0x14884d[_0x9472('0xc')](_0x9472('0xd'),attributes,{'tableName':_0x9472('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe815=['define','tools_tags','lodash','util','api','moment','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x412ff7,_0x5cae39){var _0x256616=function(_0x49d5aa){while(--_0x49d5aa){_0x412ff7['push'](_0x412ff7['shift']());}};_0x256616(++_0x5cae39);}(_0xe815,0x7a));var _0x5e81=function(_0x3c18d7,_0x3af571){_0x3c18d7=_0x3c18d7-0x0;var _0x599329=_0xe815[_0x3c18d7];return _0x599329;};'use strict';var _=require(_0x5e81('0x0'));var util=require(_0x5e81('0x1'));var logger=require('../../config/logger')(_0x5e81('0x2'));var moment=require(_0x5e81('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e81('0x4'));var rimraf=require(_0x5e81('0x5'));var config=require(_0x5e81('0x6'));var attributes=require(_0x5e81('0x7'));module['exports']=function(_0xae5ce,_0x590796){return _0xae5ce[_0x5e81('0x8')]('Tag',attributes,{'tableName':_0x5e81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 114b3e5..20c1415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1306=['client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x383704,_0xc9d43){var _0x66eb83=function(_0x4045a6){while(--_0x4045a6){_0x383704['push'](_0x383704['shift']());}};_0x66eb83(++_0xc9d43);}(_0x1306,0x17a));var _0x6130=function(_0x45bef4,_0x32e626){_0x45bef4=_0x45bef4-0x0;var _0x2ba10a=_0x1306[_0x45bef4];return _0x2ba10a;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db089,_0x25469a,_0x354501){return new BPromise(function(_0x288b1d,_0x13163f){return client[_0x6130('0xe')](_0x1db089,_0x354501)[_0x6130('0xf')](function(_0x33b116){logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));logger[_0x6130('0x13')](_0x6130('0x14'),_0x25469a,_0x6130('0x12'),JSON[_0x6130('0x15')](_0x33b116));if(_0x33b116['error']){if(_0x33b116[_0x6130('0x16')]['code']===0x1f4){logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116['error'][_0x6130('0x17')]);return _0x13163f(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);return _0x288b1d(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}else{logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));_0x288b1d(_0x33b116[_0x6130('0x18')][_0x6130('0x17')]);}})[_0x6130('0x19')](function(_0x46c2e3){logger['error']('Tag,\x20%s,\x20%s',_0x25469a,_0x46c2e3);_0x13163f(_0x46c2e3);});});}
\ No newline at end of file
+var _0x8ce1=['http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x18f69b,_0x33ec1a){var _0x746f1f=function(_0x4bf4c5){while(--_0x4bf4c5){_0x18f69b['push'](_0x18f69b['shift']());}};_0x746f1f(++_0x33ec1a);}(_0x8ce1,0x183));var _0x18ce=function(_0x38f3fb,_0x26fc6d){_0x38f3fb=_0x38f3fb-0x0;var _0x1016f1=_0x8ce1[_0x38f3fb];return _0x1016f1;};'use strict';var _=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var moment=require(_0x18ce('0x2'));var BPromise=require(_0x18ce('0x3'));var rs=require(_0x18ce('0x4'));var fs=require('fs');var Redis=require(_0x18ce('0x5'));var db=require(_0x18ce('0x6'))['db'];var utils=require(_0x18ce('0x7'));var logger=require(_0x18ce('0x8'))(_0x18ce('0x9'));var config=require(_0x18ce('0xa'));var jayson=require(_0x18ce('0xb'));var client=jayson[_0x18ce('0xc')][_0x18ce('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x682d4b,_0x359094,_0x4ebf82){return new BPromise(function(_0x1a60c5,_0x197a64){return client[_0x18ce('0xe')](_0x682d4b,_0x4ebf82)[_0x18ce('0xf')](function(_0x4db2af){logger[_0x18ce('0x10')](_0x18ce('0x11'),_0x359094,_0x18ce('0x12'));logger[_0x18ce('0x13')]('Tag,\x20%s,\x20%s,\x20%s',_0x359094,'request\x20sent',JSON[_0x18ce('0x14')](_0x4db2af));if(_0x4db2af[_0x18ce('0x15')]){if(_0x4db2af[_0x18ce('0x15')][_0x18ce('0x16')]===0x1f4){logger[_0x18ce('0x15')]('Tag,\x20%s,\x20%s',_0x359094,_0x4db2af[_0x18ce('0x15')][_0x18ce('0x17')]);return _0x197a64(_0x4db2af[_0x18ce('0x15')][_0x18ce('0x17')]);}logger[_0x18ce('0x15')]('Tag,\x20%s,\x20%s',_0x359094,_0x4db2af[_0x18ce('0x15')][_0x18ce('0x17')]);return _0x1a60c5(_0x4db2af[_0x18ce('0x15')][_0x18ce('0x17')]);}else{logger[_0x18ce('0x10')](_0x18ce('0x11'),_0x359094,_0x18ce('0x12'));_0x1a60c5(_0x4db2af['result'][_0x18ce('0x17')]);}})[_0x18ce('0x18')](function(_0x204d1a){logger[_0x18ce('0x15')](_0x18ce('0x11'),_0x359094,_0x204d1a);_0x197a64(_0x204d1a);});});}
\ No newline at end of file
index 7a9d23e..14b46fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
index 8ae5394..2cab1b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['exports','STRING'];(function(_0x414131,_0x336933){var _0x4c873f=function(_0x2e7d52){while(--_0x2e7d52){_0x414131['push'](_0x414131['shift']());}};_0x4c873f(++_0x336933);}(_0x757a,0xde));var _0xa757=function(_0x54ba32,_0x5c2615){_0x54ba32=_0x54ba32-0x0;var _0x1e27a1=_0x757a[_0x54ba32];return _0x1e27a1;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb10b=['name','sequelize','STRING'];(function(_0x2a8b68,_0x1a9c8e){var _0x562a68=function(_0x54e63a){while(--_0x54e63a){_0x2a8b68['push'](_0x2a8b68['shift']());}};_0x562a68(++_0x1a9c8e);}(_0xb10b,0x12a));var _0xbb10=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0xb10b[_0x23e33d];return _0x818fc;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
index a62f075..bb843e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75b9=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','rawAttributes','order','Queues','addQueues','Unknown\x20channel','add','ids','removeQueues','addAgents','Chat','Mail','Sms','Openchannel','Voice','penalty','defaults','TeamVoiceQueue','User','emit','Queue:save','QueueId','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','Queue:remove','getAgents','filter','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','Team','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId'];(function(_0x220fe2,_0x1cf532){var _0x30a7a8=function(_0x15fbde){while(--_0x15fbde){_0x220fe2['push'](_0x220fe2['shift']());}};_0x30a7a8(++_0x1cf532);}(_0x75b9,0xe7));var _0x975b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x75b9[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x975b('0x0'));var rimraf=require(_0x975b('0x1'));var zipdir=require(_0x975b('0x2'));var jsonpatch=require(_0x975b('0x3'));var rp=require(_0x975b('0x4'));var moment=require(_0x975b('0x5'));var BPromise=require(_0x975b('0x6'));var Mustache=require(_0x975b('0x7'));var util=require(_0x975b('0x8'));var path=require(_0x975b('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x975b('0xa'));var fs=require('fs');var fs_extra=require(_0x975b('0xb'));var _=require(_0x975b('0xc'));var squel=require('squel');var crypto=require(_0x975b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x975b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x975b('0xf'));var authService=require(_0x975b('0x10'));var qs=require(_0x975b('0x11'));var as=require(_0x975b('0x12'));var hardwareService=require(_0x975b('0x13'));var logger=require(_0x975b('0x14'))('api');var utils=require(_0x975b('0x15'));var config=require(_0x975b('0x16'));var licenseUtil=require(_0x975b('0x17'));var db=require(_0x975b('0x18'))['db'];config[_0x975b('0x19')]=_['defaults'](config[_0x975b('0x19')],{'host':_0x975b('0x1a'),'port':0x18eb});var socket=require(_0x975b('0x1b'))(new Redis(config[_0x975b('0x19')]));require(_0x975b('0x1c'))[_0x975b('0x1d')](socket);function respondWithStatusCode(_0x2d41f7,_0x4bb51e){_0x4bb51e=_0x4bb51e||0xcc;return function(_0x2d6698){if(_0x2d6698){return _0x2d41f7['sendStatus'](_0x4bb51e);}return _0x2d41f7['status'](_0x4bb51e)['end']();};}function respondWithResult(_0x35b308,_0x3b4489){_0x3b4489=_0x3b4489||0xc8;return function(_0x34ac7d){if(_0x34ac7d){return _0x35b308[_0x975b('0x1e')](_0x3b4489)[_0x975b('0x1f')](_0x34ac7d);}};}function respondWithFilteredResult(_0x130ac0,_0x1ccc59){return function(_0x3c5bf1){if(_0x3c5bf1){var _0x3a0e68=typeof _0x1ccc59[_0x975b('0x20')]==='undefined'&&typeof _0x1ccc59[_0x975b('0x21')]===_0x975b('0x22');var _0x2d5630=_0x3c5bf1['count'];var _0x1b6810=_0x3a0e68?0x0:_0x1ccc59[_0x975b('0x20')];var _0x3a22f8=_0x3a0e68?_0x3c5bf1[_0x975b('0x23')]:_0x1ccc59[_0x975b('0x20')]+_0x1ccc59['limit'];var _0x4bc4f0;if(_0x3a22f8>=_0x2d5630){_0x3a22f8=_0x2d5630;_0x4bc4f0=0xc8;}else{_0x4bc4f0=0xce;}_0x130ac0['status'](_0x4bc4f0);return _0x130ac0[_0x975b('0x24')](_0x975b('0x25'),_0x1b6810+'-'+_0x3a22f8+'/'+_0x2d5630)[_0x975b('0x1f')](_0x3c5bf1);}return null;};}function patchUpdates(_0x58702e){return function(_0x131a50){try{jsonpatch[_0x975b('0x26')](_0x131a50,_0x58702e,!![]);}catch(_0x24138f){return BPromise[_0x975b('0x27')](_0x24138f);}return _0x131a50[_0x975b('0x28')]();};}function saveUpdates(_0x38fcc4,_0x4d0371){return function(_0x3f2d89){if(_0x3f2d89){return _0x3f2d89[_0x975b('0x29')](_0x38fcc4)[_0x975b('0x2a')](function(_0x4d700d){return _0x4d700d;});}return null;};}function handleEntityNotFound(_0x2f3929,_0x30d232){return function(_0x37b0fa){if(!_0x37b0fa){_0x2f3929[_0x975b('0x2b')](0x194);}return _0x37b0fa;};}function handleError(_0x986dc9,_0x446a26){_0x446a26=_0x446a26||0x1f4;return function(_0x58294f){logger[_0x975b('0x2c')](_0x58294f[_0x975b('0x2d')]);if(_0x58294f[_0x975b('0x2e')]){delete _0x58294f[_0x975b('0x2e')];}_0x986dc9['status'](_0x446a26)[_0x975b('0x2f')](_0x58294f);};}exports[_0x975b('0x30')]=function(_0x306b86,_0x22f464){var _0x254001={},_0x232ba7={},_0x20d3c9={'count':0x0,'rows':[]};var _0x4556fa=_['map'](db['Team']['rawAttributes'],function(_0xa0dc04){return{'name':_0xa0dc04[_0x975b('0x31')],'type':_0xa0dc04[_0x975b('0x32')][_0x975b('0x33')]};});_0x232ba7[_0x975b('0x34')]=_[_0x975b('0x35')](_0x4556fa,'name');_0x232ba7[_0x975b('0x36')]=_['keys'](_0x306b86[_0x975b('0x36')]);_0x232ba7[_0x975b('0x37')]=_[_0x975b('0x38')](_0x232ba7[_0x975b('0x34')],_0x232ba7['query']);_0x254001[_0x975b('0x39')]=_[_0x975b('0x38')](_0x232ba7[_0x975b('0x34')],qs[_0x975b('0x3a')](_0x306b86[_0x975b('0x36')][_0x975b('0x3a')]));_0x254001[_0x975b('0x39')]=_0x254001[_0x975b('0x39')][_0x975b('0x3b')]?_0x254001[_0x975b('0x39')]:_0x232ba7[_0x975b('0x34')];if(!_0x306b86[_0x975b('0x36')]['hasOwnProperty'](_0x975b('0x3c'))){_0x254001[_0x975b('0x21')]=qs[_0x975b('0x21')](_0x306b86[_0x975b('0x36')][_0x975b('0x21')]);_0x254001['offset']=qs[_0x975b('0x20')](_0x306b86['query'][_0x975b('0x20')]);}_0x254001['order']=qs[_0x975b('0x3d')](_0x306b86[_0x975b('0x36')][_0x975b('0x3d')]);_0x254001[_0x975b('0x3e')]=qs[_0x975b('0x37')](_[_0x975b('0x3f')](_0x306b86[_0x975b('0x36')],_0x232ba7['filters']),_0x4556fa);if(_0x306b86[_0x975b('0x36')]['filter']){_0x254001[_0x975b('0x3e')]=_[_0x975b('0x40')](_0x254001[_0x975b('0x3e')],{'$or':_[_0x975b('0x35')](_0x4556fa,function(_0x33aef3){if(_0x33aef3[_0x975b('0x32')]!==_0x975b('0x41')){var _0xe86ba={};_0xe86ba[_0x33aef3[_0x975b('0x2e')]]={'$like':'%'+_0x306b86[_0x975b('0x36')]['filter']+'%'};return _0xe86ba;}})});}_0x254001=_[_0x975b('0x40')]({},_0x254001,_0x306b86['options']);var _0x1798b4={'where':_0x254001[_0x975b('0x3e')]};return db[_0x975b('0x42')][_0x975b('0x23')](_0x1798b4)[_0x975b('0x2a')](function(_0x123e08){_0x20d3c9[_0x975b('0x23')]=_0x123e08;if(_0x306b86['query'][_0x975b('0x43')]){_0x254001['include']=[{'all':!![]}];}return db['Team'][_0x975b('0x44')](_0x254001);})[_0x975b('0x2a')](function(_0x4cc6e3){_0x20d3c9['rows']=_0x4cc6e3;return _0x20d3c9;})[_0x975b('0x2a')](respondWithFilteredResult(_0x22f464,_0x254001))[_0x975b('0x45')](handleError(_0x22f464,null));};exports[_0x975b('0x46')]=function(_0x2dadd4,_0x938c3a){var _0x384ebe={'raw':![],'where':{'id':_0x2dadd4[_0x975b('0x47')]['id']}},_0x1c3dd2={};_0x1c3dd2[_0x975b('0x34')]=_['keys'](db[_0x975b('0x42')]['rawAttributes']);_0x1c3dd2['query']=_[_0x975b('0x48')](_0x2dadd4[_0x975b('0x36')]);_0x1c3dd2[_0x975b('0x37')]=_[_0x975b('0x38')](_0x1c3dd2[_0x975b('0x34')],_0x1c3dd2['query']);_0x384ebe['attributes']=_['intersection'](_0x1c3dd2[_0x975b('0x34')],qs[_0x975b('0x3a')](_0x2dadd4[_0x975b('0x36')]['fields']));_0x384ebe[_0x975b('0x39')]=_0x384ebe[_0x975b('0x39')][_0x975b('0x3b')]?_0x384ebe[_0x975b('0x39')]:_0x1c3dd2[_0x975b('0x34')];if(_0x2dadd4['query'][_0x975b('0x43')]){_0x384ebe[_0x975b('0x49')]=[{'all':!![]}];}_0x384ebe=_['merge']({},_0x384ebe,_0x2dadd4[_0x975b('0x4a')]);return db['Team'][_0x975b('0x4b')](_0x384ebe)['then'](handleEntityNotFound(_0x938c3a,null))[_0x975b('0x2a')](respondWithResult(_0x938c3a,null))[_0x975b('0x45')](handleError(_0x938c3a,null));};exports[_0x975b('0x4c')]=function(_0x495618,_0x3bb6bf){return db[_0x975b('0x42')]['create'](_0x495618[_0x975b('0x4d')],{})['then'](function(_0x5da233){var _0x4bd433=_0x495618['user'][_0x975b('0x4e')]({'plain':!![]});if(!_0x4bd433)throw new Error(_0x975b('0x4f'));if(_0x4bd433[_0x975b('0x50')]===_0x975b('0x51')){var _0x47b935=_0x5da233[_0x975b('0x4e')]({'plain':!![]});var _0x59d333=_0x975b('0x52');return db[_0x975b('0x53')][_0x975b('0x4b')]({'where':{'name':_0x59d333,'userProfileId':_0x4bd433[_0x975b('0x54')]},'raw':!![]})[_0x975b('0x2a')](function(_0x22f810){if(_0x22f810&&_0x22f810[_0x975b('0x55')]===0x0){return db[_0x975b('0x56')]['create']({'name':_0x47b935[_0x975b('0x2e')],'resourceId':_0x47b935['id'],'type':_0x22f810[_0x975b('0x2e')],'sectionId':_0x22f810['id']},{})[_0x975b('0x2a')](function(){return _0x5da233;});}else{return _0x5da233;}})['catch'](function(_0x20aa96){logger[_0x975b('0x2c')](_0x975b('0x57'),_0x20aa96);throw _0x20aa96;});}return _0x5da233;})[_0x975b('0x2a')](respondWithResult(_0x3bb6bf,0xc9))[_0x975b('0x45')](handleError(_0x3bb6bf,null));};exports[_0x975b('0x29')]=function(_0x3929ed,_0x2a6830){if(_0x3929ed[_0x975b('0x4d')]['id']){delete _0x3929ed[_0x975b('0x4d')]['id'];}return db[_0x975b('0x42')][_0x975b('0x4b')]({'where':{'id':_0x3929ed[_0x975b('0x47')]['id']}})[_0x975b('0x2a')](handleEntityNotFound(_0x2a6830,null))[_0x975b('0x2a')](saveUpdates(_0x3929ed[_0x975b('0x4d')],null))[_0x975b('0x2a')](respondWithResult(_0x2a6830,null))[_0x975b('0x45')](handleError(_0x2a6830,null));};exports[_0x975b('0x58')]=function(_0x21ded5,_0x947286){var _0x58de5f=_0x21ded5[_0x975b('0x47')]['id'];var _0x2f4c6a=[];return db[_0x975b('0x59')][_0x975b('0x5a')](function(_0x53689a){var _0x5d9116=_0x975b('0x5b')+_0x58de5f;return db[_0x975b('0x59')][_0x975b('0x36')](_0x5d9116,{'type':db[_0x975b('0x5c')][_0x975b('0x5d')]['SELECT'],'raw':!![],'transaction':_0x53689a})['then'](function(_0x5a6221){_0x2f4c6a=_[_0x975b('0x35')](_0x5a6221,function(_0x4e44a5){return Number(_0x4e44a5['UserId']);});})[_0x975b('0x2a')](function(){var _0x849f85='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x58de5f;return db[_0x975b('0x59')]['query'](_0x849f85,{'type':db[_0x975b('0x5c')][_0x975b('0x5d')]['SELECT'],'raw':!![],'transaction':_0x53689a});})[_0x975b('0x2a')](function(_0x3285b4){var _0x9b2685=_[_0x975b('0x35')](_0x3285b4,function(_0x4eb3ad){return Number(_0x4eb3ad[_0x975b('0x5e')]);});return db['UserVoiceQueue'][_0x975b('0x58')]({'where':{'UserId':{'$in':_0x2f4c6a},'VoiceQueueId':{'$in':_0x9b2685}},'transaction':_0x53689a});})[_0x975b('0x2a')](function(){var _0x4ca0d6=_0x975b('0x5f')+_0x58de5f;return db['sequelize'][_0x975b('0x36')](_0x4ca0d6,{'type':db[_0x975b('0x5c')][_0x975b('0x5d')][_0x975b('0x60')],'raw':!![],'transaction':_0x53689a});})[_0x975b('0x2a')](function(_0x45909b){var _0xd1a850=_[_0x975b('0x35')](_0x45909b,function(_0x3a37ba){return Number(_0x3a37ba[_0x975b('0x61')]);});return db[_0x975b('0x62')][_0x975b('0x58')]({'where':{'UserId':{'$in':_0x2f4c6a},'MailQueueId':{'$in':_0xd1a850}},'transaction':_0x53689a});})[_0x975b('0x2a')](function(){var _0x43e3f9=_0x975b('0x63')+_0x58de5f;return db[_0x975b('0x59')][_0x975b('0x36')](_0x43e3f9,{'type':db[_0x975b('0x5c')][_0x975b('0x5d')][_0x975b('0x60')],'raw':!![],'transaction':_0x53689a});})['then'](function(_0x3a16d9){var _0x556ef1=_[_0x975b('0x35')](_0x3a16d9,function(_0x46d259){return Number(_0x46d259[_0x975b('0x64')]);});return db[_0x975b('0x65')]['destroy']({'where':{'UserId':{'$in':_0x2f4c6a},'SmsQueueId':{'$in':_0x556ef1}},'transaction':_0x53689a});})['then'](function(){var _0x20e6f4=_0x975b('0x66')+_0x58de5f;return db['sequelize'][_0x975b('0x36')](_0x20e6f4,{'type':db['Sequelize'][_0x975b('0x5d')][_0x975b('0x60')],'raw':!![],'transaction':_0x53689a});})['then'](function(_0x1c3734){var _0x34dbcb=_[_0x975b('0x35')](_0x1c3734,function(_0x2670bc){return Number(_0x2670bc[_0x975b('0x67')]);});return db[_0x975b('0x68')][_0x975b('0x58')]({'where':{'UserId':{'$in':_0x2f4c6a},'ChatQueueId':{'$in':_0x34dbcb}},'transaction':_0x53689a});})[_0x975b('0x2a')](function(){var _0x4f2e79=_0x975b('0x69')+_0x58de5f;return db[_0x975b('0x59')]['query'](_0x4f2e79,{'type':db['Sequelize'][_0x975b('0x5d')][_0x975b('0x60')],'raw':!![],'transaction':_0x53689a});})['then'](function(_0x32ce0e){var _0xeffc3=_[_0x975b('0x35')](_0x32ce0e,function(_0x504b97){return Number(_0x504b97[_0x975b('0x6a')]);});return db[_0x975b('0x6b')][_0x975b('0x58')]({'where':{'UserId':{'$in':_0x2f4c6a},'FaxQueueId':{'$in':_0xeffc3}},'transaction':_0x53689a});})[_0x975b('0x2a')](function(){var _0xbf4a0d='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x58de5f;return db[_0x975b('0x59')][_0x975b('0x36')](_0xbf4a0d,{'type':db['Sequelize'][_0x975b('0x5d')][_0x975b('0x60')],'raw':!![],'transaction':_0x53689a});})[_0x975b('0x2a')](function(_0x58e7e7){var _0x2ff0e1=_[_0x975b('0x35')](_0x58e7e7,function(_0x35bb72){return Number(_0x35bb72[_0x975b('0x6c')]);});return db[_0x975b('0x6d')][_0x975b('0x58')]({'where':{'UserId':{'$in':_0x2f4c6a},'OpenchannelQueueId':{'$in':_0x2ff0e1}},'transaction':_0x53689a});})[_0x975b('0x2a')](function(){var _0x11dbee='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x58de5f;return db['sequelize'][_0x975b('0x36')](_0x11dbee,{'type':db['Sequelize'][_0x975b('0x5d')][_0x975b('0x60')],'raw':!![],'transaction':_0x53689a});})[_0x975b('0x2a')](function(_0x55db8c){var _0x331f6c=_[_0x975b('0x35')](_0x55db8c,function(_0x59c0a2){return Number(_0x59c0a2[_0x975b('0x6e')]);});return db[_0x975b('0x6f')][_0x975b('0x58')]({'where':{'UserId':{'$in':_0x2f4c6a},'WhatsappQueueId':{'$in':_0x331f6c}},'transaction':_0x53689a});})[_0x975b('0x2a')](function(){return db[_0x975b('0x70')][_0x975b('0x4b')]({'where':{'TeamId':_0x58de5f}});})[_0x975b('0x2a')](function(_0x44d4a3){if(_0x44d4a3===null){return;}return db[_0x975b('0x71')]['destroy']({'where':{'UserId':{'$in':_0x2f4c6a},'VoicePrefixId':_0x44d4a3[_0x975b('0x72')]},'transaction':_0x53689a});})[_0x975b('0x2a')](function(){return db[_0x975b('0x42')][_0x975b('0x58')]({'where':{'id':_0x58de5f},'cascade':!![],'transaction':_0x53689a});})[_0x975b('0x2a')](function(_0x55f04f){if(_0x55f04f===0x0){_0x947286['sendStatus'](0x194);}else{return db[_0x975b('0x56')][_0x975b('0x58')]({'where':{'type':_0x975b('0x52'),'resourceId':_0x58de5f},'cascade':!![],'transaction':_0x53689a})[_0x975b('0x2a')](function(){_0x947286[_0x975b('0x1e')](0xcc)['end']();});}})[_0x975b('0x45')](function(_0x5e0539){_0x947286[_0x975b('0x1e')](0x1f4)[_0x975b('0x2f')](_0x5e0539);});});};exports[_0x975b('0x73')]=function(_0x244acc,_0x5a7d96,_0x33e2bd){return db[_0x975b('0x42')][_0x975b('0x74')]({'where':{'id':_0x244acc[_0x975b('0x47')]['id']}})[_0x975b('0x2a')](handleEntityNotFound(_0x5a7d96,null))[_0x975b('0x2a')](function(_0x5c1ffe){if(!_0x244acc[_0x975b('0x36')][_0x975b('0x75')]||!utils[_0x975b('0x76')](_0x244acc[_0x975b('0x36')][_0x975b('0x75')])){throw new db['Sequelize'][(_0x975b('0x77'))]('Unknown\x20channel');}var _0x169650={};var _0x1f2b9d={};_0x1f2b9d['model']=_[_0x975b('0x48')](db[_[_0x975b('0x78')](_0x244acc['query'][_0x975b('0x75')][_0x975b('0x79')]())+_0x975b('0x7a')][_0x975b('0x7b')]);_0x1f2b9d[_0x975b('0x36')]=_[_0x975b('0x48')](_0x244acc[_0x975b('0x36')]);_0x1f2b9d[_0x975b('0x37')]=_[_0x975b('0x38')](_0x1f2b9d[_0x975b('0x34')],_0x1f2b9d['query']);_0x169650['attributes']=_[_0x975b('0x38')](_0x1f2b9d['model'],qs['fields'](_0x244acc[_0x975b('0x36')][_0x975b('0x3a')]));_0x169650[_0x975b('0x39')]=_0x169650[_0x975b('0x39')][_0x975b('0x3b')]?_0x169650['attributes']:_0x1f2b9d[_0x975b('0x34')];_0x169650[_0x975b('0x21')]=qs[_0x975b('0x21')](_0x244acc[_0x975b('0x36')]['limit']);_0x169650[_0x975b('0x20')]=qs[_0x975b('0x20')](_0x244acc[_0x975b('0x36')][_0x975b('0x20')]);_0x169650[_0x975b('0x7c')]=qs[_0x975b('0x3d')](_0x244acc['query'][_0x975b('0x3d')]);_0x169650['where']=qs[_0x975b('0x37')](_['pick'](_0x244acc[_0x975b('0x36')],_0x1f2b9d[_0x975b('0x37')]));_0x169650=_[_0x975b('0x40')]({},_0x169650,_0x244acc[_0x975b('0x4a')]);return _0x5c1ffe['get'+_[_0x975b('0x78')](_0x244acc[_0x975b('0x36')][_0x975b('0x75')][_0x975b('0x79')]())+_0x975b('0x7d')](_0x169650);})['then'](respondWithResult(_0x5a7d96,null))[_0x975b('0x45')](handleError(_0x5a7d96,null));};exports[_0x975b('0x7e')]=function(_0x20adc1,_0x48729a,_0x538b56){return db['Team'][_0x975b('0x74')]({'where':{'id':_0x20adc1['params']['id']}})['then'](function(_0x5c28ab){if(_0x5c28ab){if(!_0x20adc1[_0x975b('0x4d')][_0x975b('0x75')]||!utils['isValidChannel'](_0x20adc1[_0x975b('0x4d')][_0x975b('0x75')])){throw new db[(_0x975b('0x5c'))][(_0x975b('0x77'))](_0x975b('0x7f'));}return _0x5c28ab[_0x975b('0x80')+_[_0x975b('0x78')](_0x20adc1[_0x975b('0x4d')][_0x975b('0x75')][_0x975b('0x79')]())+'Queues'](_0x20adc1[_0x975b('0x4d')][_0x975b('0x81')]);}return null;})['then'](handleEntityNotFound(_0x48729a,null))['then'](respondWithStatusCode(_0x48729a,null))['catch'](handleError(_0x48729a,null));};exports[_0x975b('0x82')]=function(_0x45f5c3,_0x4e0b4f,_0x4afd7d){return db[_0x975b('0x42')]['findOne']({'where':{'id':_0x45f5c3['params']['id']}})[_0x975b('0x2a')](function(_0x402405){if(_0x402405){if(!_0x45f5c3['query']['channel']||!utils[_0x975b('0x76')](_0x45f5c3[_0x975b('0x36')]['channel'])){throw new db[(_0x975b('0x5c'))][(_0x975b('0x77'))](_0x975b('0x7f'));}return _0x402405['remove'+_[_0x975b('0x78')](_0x45f5c3['query'][_0x975b('0x75')][_0x975b('0x79')]())+_0x975b('0x7d')](_0x45f5c3[_0x975b('0x36')]['ids']);}return null;})[_0x975b('0x2a')](handleEntityNotFound(_0x4e0b4f,null))[_0x975b('0x2a')](respondWithStatusCode(_0x4e0b4f,null))[_0x975b('0x45')](handleError(_0x4e0b4f,null));};exports[_0x975b('0x83')]=function(_0xfd40d5,_0x200191){var _0x4d0f3a=_['isArray'](_0xfd40d5['body'][_0x975b('0x81')])?_0xfd40d5['body'][_0x975b('0x81')]:[_0xfd40d5['body']['ids']];var _0x2a40a7=_0xfd40d5[_0x975b('0x47')]['id'];return db[_0x975b('0x42')][_0x975b('0x4b')]({'where':{'id':_0x2a40a7}})['then'](handleEntityNotFound(_0x200191,null))[_0x975b('0x2a')](function(_0x2ccebb){if(_0x2ccebb){var _0x5b9322=['Voice',_0x975b('0x84'),_0x975b('0x85'),_0x975b('0x86'),'Fax',_0x975b('0x87'),'Whatsapp'];return db[_0x975b('0x59')][_0x975b('0x5a')](function(_0x425b6c){var _0x1c45ac=_[_0x975b('0x35')](_0x5b9322,function(_0x24b960){var _0x269741={'attributes':['id',_0x975b('0x2e')]};if(_0x24b960===_0x975b('0x88')){_0x269741['through']={'attributes':[_0x975b('0x89')]};}return _0x2ccebb[_0x975b('0x4e')+_0x24b960+_0x975b('0x7d')](_0x269741)[_0x975b('0x2a')](function(_0x3cd0c3){var _0x245e5d=_[_0x975b('0x35')](_0x3cd0c3,function(_0x1becb8){var _0xf79f79=_['map'](_0x4d0f3a,function(_0x3b8c27){var _0x2e7e53={'where':{'UserId':_0x3b8c27,[_0x24b960+'QueueId']:_0x1becb8['id']},'transaction':_0x425b6c};if(_0x24b960===_0x975b('0x88')){_0x2e7e53[_0x975b('0x8a')]={'penalty':_0x1becb8[_0x975b('0x8b')][_0x975b('0x89')]};}return db[_0x975b('0x8c')+_0x24b960+'Queue']['findOrCreate'](_0x2e7e53)[_0x975b('0x2a')](function(){socket[_0x975b('0x8d')](_0x975b('0x51')+_0x24b960+_0x975b('0x8e'),{'UserId':_0x3b8c27,[_0x24b960+_0x975b('0x8f')]:_0x1becb8['id']});if(_0x24b960!=='Voice'){return;}return db[_0x975b('0x8c')][_0x975b('0x44')]({'where':{'id':_0x4d0f3a,'online':0x1},'attributes':['id',_0x975b('0x2e'),_0x975b('0x90'),_0x975b('0x91'),_0x975b('0x92')],'raw':!![]})[_0x975b('0x2a')](function(_0x591f1c){var _0x3c5849=_[_0x975b('0x35')](_0x591f1c,function(_0x48015a){return db[_0x975b('0x93')][_0x975b('0x94')]({'membername':_0x48015a[_0x975b('0x2e')],'UserId':_0x48015a['id'],'queue_name':_0x1becb8['name'],'VoiceQueueId':_0x1becb8['id'],'interface':_[_0x975b('0x95')](_0x48015a[_0x975b('0x92')])?util[_0x975b('0x96')](_0x975b('0x97'),_0x48015a['name']):_0x48015a['interface'],'paused':_0x48015a[_0x975b('0x91')]||![],'penalty':_0x1becb8[_0x975b('0x8b')]['penalty']},{'transaction':_0x425b6c});});return Promise[_0x975b('0x98')](_0x3c5849);});});});return Promise[_0x975b('0x98')](_0xf79f79);});return Promise[_0x975b('0x98')](_0x245e5d);})['then'](function(){return db[_0x975b('0x70')]['findOne']({'where':{'teamId':_0x2a40a7}})[_0x975b('0x2a')](function(_0x3be327){if(_0x3be327){var _0x37e893=_[_0x975b('0x35')](_0x4d0f3a,function(_0xcc8769){db[_0x975b('0x71')][_0x975b('0x94')]({'UserId':_0xcc8769,'VoicePrefixId':_0x3be327[_0x975b('0x72')]});});return Promise['all'](_0x37e893);}});});});return Promise[_0x975b('0x98')](_0x1c45ac)[_0x975b('0x2a')](function(){return _0x2ccebb['addAgents'](_0x4d0f3a,{'transaction':_0x425b6c})['spread'](function(_0x58e863){return _0x58e863;});});});}})[_0x975b('0x2a')](respondWithResult(_0x200191,null))[_0x975b('0x45')](handleError(_0x200191,null));};exports[_0x975b('0x99')]=function(_0x4f1ccc,_0x31860c){var _0x553387=_['isArray'](_0x4f1ccc[_0x975b('0x36')]['ids'])?_0x4f1ccc[_0x975b('0x36')]['ids']:[_0x4f1ccc[_0x975b('0x36')][_0x975b('0x81')]];var _0x5b2f48=_0x4f1ccc['params']['id'];return db[_0x975b('0x42')][_0x975b('0x4b')]({'where':{'id':_0x5b2f48}})['then'](handleEntityNotFound(_0x31860c,null))[_0x975b('0x2a')](function(_0x579030){if(_0x579030){var _0x4c7c32=[_0x975b('0x88'),_0x975b('0x84'),_0x975b('0x85'),_0x975b('0x86'),'Fax',_0x975b('0x87'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x226635){var _0x4c6b1c=_[_0x975b('0x35')](_0x4c7c32,function(_0x431312){var _0x5b2978={'attributes':['id','name']};return _0x579030[_0x975b('0x4e')+_0x431312+_0x975b('0x7d')](_0x5b2978)['then'](function(_0x1b6c74){var _0x426dae=_[_0x975b('0x35')](_0x1b6c74,function(_0x49e7b5){return _0x49e7b5['removeAgents'](_0x553387,{'transaction':_0x226635})[_0x975b('0x2a')](function(){var _0x2cf2e1=_[_0x975b('0x35')](_0x553387,function(_0x63219b){socket[_0x975b('0x8d')](_0x975b('0x51')+_0x431312+_0x975b('0x9a'),{'UserId':Number(_0x63219b),[_0x431312+_0x975b('0x8f')]:_0x49e7b5['id']});if(_0x431312!==_0x975b('0x88')){return;}return db[_0x975b('0x93')]['destroy']({'where':{'VoiceQueueId':_0x49e7b5['id'],'UserId':_0x63219b},'transaction':_0x226635});});return Promise[_0x975b('0x98')](_0x2cf2e1);});});return Promise['all'](_0x426dae);});});return Promise[_0x975b('0x98')](_0x4c6b1c)[_0x975b('0x2a')](function(){return _0x579030[_0x975b('0x99')](_0x553387,{'transaction':_0x226635});})[_0x975b('0x2a')](function(){return db[_0x975b('0x70')][_0x975b('0x74')]({'where':{'teamId':_0x5b2f48}})['then'](function(_0x2ce5f9){if(_0x2ce5f9){var _0x573e9f=_['map'](_0x553387,function(_0x568a55){db[_0x975b('0x71')][_0x975b('0x58')]({'where':{'UserId':_0x568a55,'VoicePrefixId':_0x2ce5f9['VoicePrefixId']}});});return Promise['all'](_0x573e9f);}});});});}})[_0x975b('0x2a')](respondWithStatusCode(_0x31860c,null))['catch'](handleError(_0x31860c,null));};exports[_0x975b('0x9b')]=function(_0x3b1ce3,_0x41c9aa,_0x1ac8e6){var _0x2213f3={};var _0x3ab9db={};var _0x5ad591;var _0x103a0f;return db[_0x975b('0x42')][_0x975b('0x74')]({'where':{'id':_0x3b1ce3[_0x975b('0x47')]['id']}})[_0x975b('0x2a')](handleEntityNotFound(_0x41c9aa,null))['then'](function(_0x323f16){if(_0x323f16){_0x5ad591=_0x323f16;_0x3ab9db[_0x975b('0x34')]=_[_0x975b('0x48')](db[_0x975b('0x8c')][_0x975b('0x7b')]);_0x3ab9db['query']=_[_0x975b('0x48')](_0x3b1ce3[_0x975b('0x36')]);_0x3ab9db[_0x975b('0x37')]=_['intersection'](_0x3ab9db[_0x975b('0x34')],_0x3ab9db['query']);_0x2213f3['attributes']=_[_0x975b('0x38')](_0x3ab9db[_0x975b('0x34')],qs[_0x975b('0x3a')](_0x3b1ce3[_0x975b('0x36')][_0x975b('0x3a')]));_0x2213f3['attributes']=_0x2213f3['attributes'][_0x975b('0x3b')]?_0x2213f3['attributes']:_0x3ab9db['model'];_0x2213f3[_0x975b('0x7c')]=qs[_0x975b('0x3d')](_0x3b1ce3[_0x975b('0x36')][_0x975b('0x3d')]);_0x2213f3['where']=qs[_0x975b('0x37')](_[_0x975b('0x3f')](_0x3b1ce3['query'],_0x3ab9db['filters']));if(_0x3b1ce3[_0x975b('0x36')][_0x975b('0x9c')]){_0x2213f3['where']=_[_0x975b('0x40')](_0x2213f3['where'],{'$or':_[_0x975b('0x35')](_0x2213f3[_0x975b('0x39')],function(_0x1026bc){var _0x3eebc7={};_0x3eebc7[_0x1026bc]={'$like':'%'+_0x3b1ce3[_0x975b('0x36')][_0x975b('0x9c')]+'%'};return _0x3eebc7;})});}_0x2213f3=_['merge']({},_0x2213f3,_0x3b1ce3[_0x975b('0x4a')]);return _0x5ad591[_0x975b('0x9b')](_0x2213f3);}})[_0x975b('0x2a')](function(_0x56ac51){if(_0x56ac51){_0x103a0f=_0x56ac51['length'];if(!_0x3b1ce3[_0x975b('0x36')][_0x975b('0x9d')](_0x975b('0x3c'))){_0x2213f3[_0x975b('0x21')]=qs[_0x975b('0x21')](_0x3b1ce3[_0x975b('0x36')]['limit']);_0x2213f3[_0x975b('0x20')]=qs[_0x975b('0x20')](_0x3b1ce3[_0x975b('0x36')][_0x975b('0x20')]);}return _0x5ad591[_0x975b('0x9b')](_0x2213f3);}})['then'](function(_0x100a1f){if(_0x100a1f){return _0x100a1f?{'count':_0x103a0f,'rows':_0x100a1f}:null;}})[_0x975b('0x2a')](respondWithResult(_0x41c9aa,null))[_0x975b('0x45')](handleError(_0x41c9aa,null));};
\ No newline at end of file
+var _0xd0e5=['Sms','Fax','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','Queue:save','online','voicePause','interface','UserVoiceQueueRt','isNil','SIP/%s','all','upsert','spread','Chat','removeAgents','emit','Queue:remove','TeamVoicePrefix','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','stack','name','send','Team','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','user','get','role','Teams','userProfileId','autoAssociation','UserProfileResource','error','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','Queue','capitalize','toLowerCase','addQueues','add','Queues','removeQueues','remove','ids','addAgents','Voice'];(function(_0x4fa3dc,_0x3db582){var _0x6785dd=function(_0x3d9957){while(--_0x3d9957){_0x4fa3dc['push'](_0x4fa3dc['shift']());}};_0x6785dd(++_0x3db582);}(_0xd0e5,0x1f1));var _0x5d0e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xd0e5[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require(_0x5d0e('0x0'));var rimraf=require(_0x5d0e('0x1'));var zipdir=require(_0x5d0e('0x2'));var jsonpatch=require(_0x5d0e('0x3'));var rp=require(_0x5d0e('0x4'));var moment=require(_0x5d0e('0x5'));var BPromise=require(_0x5d0e('0x6'));var Mustache=require(_0x5d0e('0x7'));var util=require('util');var path=require(_0x5d0e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5d0e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d0e('0xa'));var squel=require(_0x5d0e('0xb'));var crypto=require(_0x5d0e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5d0e('0xd'));var toCsv=require(_0x5d0e('0xe'));var querystring=require('querystring');var Papa=require(_0x5d0e('0xf'));var Redis=require(_0x5d0e('0x10'));var authService=require(_0x5d0e('0x11'));var qs=require(_0x5d0e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d0e('0x13'));var logger=require(_0x5d0e('0x14'))('api');var utils=require(_0x5d0e('0x15'));var config=require(_0x5d0e('0x16'));var licenseUtil=require(_0x5d0e('0x17'));var db=require(_0x5d0e('0x18'))['db'];config[_0x5d0e('0x19')]=_[_0x5d0e('0x1a')](config[_0x5d0e('0x19')],{'host':_0x5d0e('0x1b'),'port':0x18eb});var socket=require(_0x5d0e('0x1c'))(new Redis(config[_0x5d0e('0x19')]));require(_0x5d0e('0x1d'))[_0x5d0e('0x1e')](socket);function respondWithStatusCode(_0x3fb400,_0x4603a5){_0x4603a5=_0x4603a5||0xcc;return function(_0x3763f0){if(_0x3763f0){return _0x3fb400['sendStatus'](_0x4603a5);}return _0x3fb400[_0x5d0e('0x1f')](_0x4603a5)[_0x5d0e('0x20')]();};}function respondWithResult(_0x4c19f7,_0x482ba2){_0x482ba2=_0x482ba2||0xc8;return function(_0x52617f){if(_0x52617f){return _0x4c19f7[_0x5d0e('0x1f')](_0x482ba2)[_0x5d0e('0x21')](_0x52617f);}};}function respondWithFilteredResult(_0x28f339,_0x1d8d7f){return function(_0x4279e9){if(_0x4279e9){var _0x3dfbd3=typeof _0x1d8d7f[_0x5d0e('0x22')]===_0x5d0e('0x23')&&typeof _0x1d8d7f[_0x5d0e('0x24')]===_0x5d0e('0x23');var _0x1c2b58=_0x4279e9[_0x5d0e('0x25')];var _0x2926cf=_0x3dfbd3?0x0:_0x1d8d7f[_0x5d0e('0x22')];var _0x29439f=_0x3dfbd3?_0x4279e9[_0x5d0e('0x25')]:_0x1d8d7f[_0x5d0e('0x22')]+_0x1d8d7f['limit'];var _0xde66ac;if(_0x29439f>=_0x1c2b58){_0x29439f=_0x1c2b58;_0xde66ac=0xc8;}else{_0xde66ac=0xce;}_0x28f339['status'](_0xde66ac);return _0x28f339[_0x5d0e('0x26')](_0x5d0e('0x27'),_0x2926cf+'-'+_0x29439f+'/'+_0x1c2b58)[_0x5d0e('0x21')](_0x4279e9);}return null;};}function patchUpdates(_0x4c8909){return function(_0x1dbbe2){try{jsonpatch['apply'](_0x1dbbe2,_0x4c8909,!![]);}catch(_0x128e8c){return BPromise[_0x5d0e('0x28')](_0x128e8c);}return _0x1dbbe2[_0x5d0e('0x29')]();};}function saveUpdates(_0x3f08dd,_0x41c93c){return function(_0x55b97b){if(_0x55b97b){return _0x55b97b[_0x5d0e('0x2a')](_0x3f08dd)[_0x5d0e('0x2b')](function(_0xa2b0d5){return _0xa2b0d5;});}return null;};}function handleEntityNotFound(_0x1a9714,_0x1a34b0){return function(_0xc409d6){if(!_0xc409d6){_0x1a9714[_0x5d0e('0x2c')](0x194);}return _0xc409d6;};}function handleError(_0x3b761a,_0x38a076){_0x38a076=_0x38a076||0x1f4;return function(_0x42f100){logger['error'](_0x42f100[_0x5d0e('0x2d')]);if(_0x42f100['name']){delete _0x42f100[_0x5d0e('0x2e')];}_0x3b761a['status'](_0x38a076)[_0x5d0e('0x2f')](_0x42f100);};}exports['index']=function(_0x184c3d,_0x1d0652){var _0x460e47={},_0x2d9f3d={},_0x59b837={'count':0x0,'rows':[]};var _0x2cd998=_['map'](db[_0x5d0e('0x30')]['rawAttributes'],function(_0x4ae52a){return{'name':_0x4ae52a[_0x5d0e('0x31')],'type':_0x4ae52a['type'][_0x5d0e('0x32')]};});_0x2d9f3d[_0x5d0e('0x33')]=_[_0x5d0e('0x34')](_0x2cd998,_0x5d0e('0x2e'));_0x2d9f3d['query']=_[_0x5d0e('0x35')](_0x184c3d['query']);_0x2d9f3d[_0x5d0e('0x36')]=_[_0x5d0e('0x37')](_0x2d9f3d[_0x5d0e('0x33')],_0x2d9f3d[_0x5d0e('0x38')]);_0x460e47[_0x5d0e('0x39')]=_[_0x5d0e('0x37')](_0x2d9f3d[_0x5d0e('0x33')],qs[_0x5d0e('0x3a')](_0x184c3d[_0x5d0e('0x38')][_0x5d0e('0x3a')]));_0x460e47[_0x5d0e('0x39')]=_0x460e47[_0x5d0e('0x39')][_0x5d0e('0x3b')]?_0x460e47[_0x5d0e('0x39')]:_0x2d9f3d[_0x5d0e('0x33')];if(!_0x184c3d['query'][_0x5d0e('0x3c')](_0x5d0e('0x3d'))){_0x460e47[_0x5d0e('0x24')]=qs[_0x5d0e('0x24')](_0x184c3d[_0x5d0e('0x38')][_0x5d0e('0x24')]);_0x460e47['offset']=qs[_0x5d0e('0x22')](_0x184c3d[_0x5d0e('0x38')][_0x5d0e('0x22')]);}_0x460e47[_0x5d0e('0x3e')]=qs[_0x5d0e('0x3f')](_0x184c3d['query'][_0x5d0e('0x3f')]);_0x460e47['where']=qs['filters'](_[_0x5d0e('0x40')](_0x184c3d['query'],_0x2d9f3d[_0x5d0e('0x36')]),_0x2cd998);if(_0x184c3d[_0x5d0e('0x38')][_0x5d0e('0x41')]){_0x460e47[_0x5d0e('0x42')]=_['merge'](_0x460e47[_0x5d0e('0x42')],{'$or':_['map'](_0x2cd998,function(_0x4ae469){if(_0x4ae469['type']!==_0x5d0e('0x43')){var _0x5c2ffc={};_0x5c2ffc[_0x4ae469[_0x5d0e('0x2e')]]={'$like':'%'+_0x184c3d[_0x5d0e('0x38')][_0x5d0e('0x41')]+'%'};return _0x5c2ffc;}})});}_0x460e47=_['merge']({},_0x460e47,_0x184c3d[_0x5d0e('0x44')]);var _0x20a53a={'where':_0x460e47[_0x5d0e('0x42')]};return db[_0x5d0e('0x30')][_0x5d0e('0x25')](_0x20a53a)['then'](function(_0x1b3ab7){_0x59b837[_0x5d0e('0x25')]=_0x1b3ab7;if(_0x184c3d['query'][_0x5d0e('0x45')]){_0x460e47[_0x5d0e('0x46')]=[{'all':!![]}];}return db['Team'][_0x5d0e('0x47')](_0x460e47);})[_0x5d0e('0x2b')](function(_0x2c7f50){_0x59b837[_0x5d0e('0x48')]=_0x2c7f50;return _0x59b837;})[_0x5d0e('0x2b')](respondWithFilteredResult(_0x1d0652,_0x460e47))[_0x5d0e('0x49')](handleError(_0x1d0652,null));};exports[_0x5d0e('0x4a')]=function(_0x5d0cac,_0x590eb8){var _0x5ade46={'raw':![],'where':{'id':_0x5d0cac[_0x5d0e('0x4b')]['id']}},_0x362398={};_0x362398[_0x5d0e('0x33')]=_['keys'](db['Team'][_0x5d0e('0x4c')]);_0x362398[_0x5d0e('0x38')]=_['keys'](_0x5d0cac[_0x5d0e('0x38')]);_0x362398[_0x5d0e('0x36')]=_[_0x5d0e('0x37')](_0x362398['model'],_0x362398['query']);_0x5ade46['attributes']=_[_0x5d0e('0x37')](_0x362398[_0x5d0e('0x33')],qs[_0x5d0e('0x3a')](_0x5d0cac[_0x5d0e('0x38')]['fields']));_0x5ade46[_0x5d0e('0x39')]=_0x5ade46['attributes'][_0x5d0e('0x3b')]?_0x5ade46['attributes']:_0x362398[_0x5d0e('0x33')];if(_0x5d0cac['query'][_0x5d0e('0x45')]){_0x5ade46['include']=[{'all':!![]}];}_0x5ade46=_[_0x5d0e('0x4d')]({},_0x5ade46,_0x5d0cac[_0x5d0e('0x44')]);return db[_0x5d0e('0x30')][_0x5d0e('0x4e')](_0x5ade46)[_0x5d0e('0x2b')](handleEntityNotFound(_0x590eb8,null))[_0x5d0e('0x2b')](respondWithResult(_0x590eb8,null))[_0x5d0e('0x49')](handleError(_0x590eb8,null));};exports[_0x5d0e('0x4f')]=function(_0x3e61d5,_0x184963){return db[_0x5d0e('0x30')]['create'](_0x3e61d5[_0x5d0e('0x50')],{})[_0x5d0e('0x2b')](function(_0x1b1247){var _0x57fad7=_0x3e61d5[_0x5d0e('0x51')][_0x5d0e('0x52')]({'plain':!![]});if(!_0x57fad7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57fad7[_0x5d0e('0x53')]===_0x5d0e('0x51')){var _0x42b750=_0x1b1247[_0x5d0e('0x52')]({'plain':!![]});var _0x273f11=_0x5d0e('0x54');return db['UserProfileSection'][_0x5d0e('0x4e')]({'where':{'name':_0x273f11,'userProfileId':_0x57fad7[_0x5d0e('0x55')]},'raw':!![]})[_0x5d0e('0x2b')](function(_0x2774fa){if(_0x2774fa&&_0x2774fa[_0x5d0e('0x56')]===0x0){return db[_0x5d0e('0x57')][_0x5d0e('0x4f')]({'name':_0x42b750[_0x5d0e('0x2e')],'resourceId':_0x42b750['id'],'type':_0x2774fa[_0x5d0e('0x2e')],'sectionId':_0x2774fa['id']},{})[_0x5d0e('0x2b')](function(){return _0x1b1247;});}else{return _0x1b1247;}})[_0x5d0e('0x49')](function(_0x356882){logger[_0x5d0e('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x356882);throw _0x356882;});}return _0x1b1247;})[_0x5d0e('0x2b')](respondWithResult(_0x184963,0xc9))[_0x5d0e('0x49')](handleError(_0x184963,null));};exports[_0x5d0e('0x2a')]=function(_0x473e0f,_0x5b8e76){if(_0x473e0f[_0x5d0e('0x50')]['id']){delete _0x473e0f[_0x5d0e('0x50')]['id'];}return db[_0x5d0e('0x30')][_0x5d0e('0x4e')]({'where':{'id':_0x473e0f[_0x5d0e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b8e76,null))[_0x5d0e('0x2b')](saveUpdates(_0x473e0f['body'],null))[_0x5d0e('0x2b')](respondWithResult(_0x5b8e76,null))['catch'](handleError(_0x5b8e76,null));};exports[_0x5d0e('0x59')]=function(_0x2a2777,_0x223ca4){var _0x2fe9d9=_0x2a2777[_0x5d0e('0x4b')]['id'];var _0x2ee584=[];return db[_0x5d0e('0x5a')][_0x5d0e('0x5b')](function(_0x2ac4be){var _0x457e6a=_0x5d0e('0x5c')+_0x2fe9d9;return db[_0x5d0e('0x5a')]['query'](_0x457e6a,{'type':db[_0x5d0e('0x5d')][_0x5d0e('0x5e')][_0x5d0e('0x5f')],'raw':!![],'transaction':_0x2ac4be})['then'](function(_0x5217ff){_0x2ee584=_[_0x5d0e('0x34')](_0x5217ff,function(_0x26dcf1){return Number(_0x26dcf1[_0x5d0e('0x60')]);});})[_0x5d0e('0x2b')](function(){var _0x2d1b82='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2fe9d9;return db[_0x5d0e('0x5a')][_0x5d0e('0x38')](_0x2d1b82,{'type':db[_0x5d0e('0x5d')][_0x5d0e('0x5e')]['SELECT'],'raw':!![],'transaction':_0x2ac4be});})['then'](function(_0x491d5c){var _0x204e78=_[_0x5d0e('0x34')](_0x491d5c,function(_0x1ae037){return Number(_0x1ae037[_0x5d0e('0x61')]);});return db['UserVoiceQueue'][_0x5d0e('0x59')]({'where':{'UserId':{'$in':_0x2ee584},'VoiceQueueId':{'$in':_0x204e78}},'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(){var _0x2809c0='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2fe9d9;return db[_0x5d0e('0x5a')]['query'](_0x2809c0,{'type':db[_0x5d0e('0x5d')][_0x5d0e('0x5e')][_0x5d0e('0x5f')],'raw':!![],'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(_0x20bb60){var _0x4c350b=_['map'](_0x20bb60,function(_0x49df1f){return Number(_0x49df1f[_0x5d0e('0x62')]);});return db[_0x5d0e('0x63')][_0x5d0e('0x59')]({'where':{'UserId':{'$in':_0x2ee584},'MailQueueId':{'$in':_0x4c350b}},'transaction':_0x2ac4be});})['then'](function(){var _0xa7f458='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2fe9d9;return db[_0x5d0e('0x5a')][_0x5d0e('0x38')](_0xa7f458,{'type':db['Sequelize'][_0x5d0e('0x5e')][_0x5d0e('0x5f')],'raw':!![],'transaction':_0x2ac4be});})['then'](function(_0x209c71){var _0x4ad4ae=_[_0x5d0e('0x34')](_0x209c71,function(_0x446a16){return Number(_0x446a16[_0x5d0e('0x64')]);});return db[_0x5d0e('0x65')][_0x5d0e('0x59')]({'where':{'UserId':{'$in':_0x2ee584},'SmsQueueId':{'$in':_0x4ad4ae}},'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(){var _0x11ddc7=_0x5d0e('0x66')+_0x2fe9d9;return db[_0x5d0e('0x5a')][_0x5d0e('0x38')](_0x11ddc7,{'type':db[_0x5d0e('0x5d')][_0x5d0e('0x5e')][_0x5d0e('0x5f')],'raw':!![],'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(_0x31fff7){var _0xbcd134=_[_0x5d0e('0x34')](_0x31fff7,function(_0x330e1f){return Number(_0x330e1f[_0x5d0e('0x67')]);});return db['UserChatQueue'][_0x5d0e('0x59')]({'where':{'UserId':{'$in':_0x2ee584},'ChatQueueId':{'$in':_0xbcd134}},'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(){var _0x2d6342=_0x5d0e('0x68')+_0x2fe9d9;return db[_0x5d0e('0x5a')]['query'](_0x2d6342,{'type':db['Sequelize'][_0x5d0e('0x5e')][_0x5d0e('0x5f')],'raw':!![],'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(_0x1b0e53){var _0x17e10e=_[_0x5d0e('0x34')](_0x1b0e53,function(_0xaa5556){return Number(_0xaa5556[_0x5d0e('0x69')]);});return db[_0x5d0e('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x2ee584},'FaxQueueId':{'$in':_0x17e10e}},'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(){var _0x26f0ea=_0x5d0e('0x6b')+_0x2fe9d9;return db[_0x5d0e('0x5a')]['query'](_0x26f0ea,{'type':db[_0x5d0e('0x5d')][_0x5d0e('0x5e')]['SELECT'],'raw':!![],'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(_0x4c2076){var _0x504409=_[_0x5d0e('0x34')](_0x4c2076,function(_0x11a4b9){return Number(_0x11a4b9['OpenchannelQueueId']);});return db[_0x5d0e('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x2ee584},'OpenchannelQueueId':{'$in':_0x504409}},'transaction':_0x2ac4be});})['then'](function(){var _0x4c34f9=_0x5d0e('0x6d')+_0x2fe9d9;return db[_0x5d0e('0x5a')][_0x5d0e('0x38')](_0x4c34f9,{'type':db[_0x5d0e('0x5d')][_0x5d0e('0x5e')][_0x5d0e('0x5f')],'raw':!![],'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(_0x30443f){var _0x56eab4=_['map'](_0x30443f,function(_0x2d8950){return Number(_0x2d8950[_0x5d0e('0x6e')]);});return db[_0x5d0e('0x6f')][_0x5d0e('0x59')]({'where':{'UserId':{'$in':_0x2ee584},'WhatsappQueueId':{'$in':_0x56eab4}},'transaction':_0x2ac4be});})['then'](function(){return db['TeamVoicePrefix'][_0x5d0e('0x4e')]({'where':{'TeamId':_0x2fe9d9}});})[_0x5d0e('0x2b')](function(_0x5b3bb4){if(_0x5b3bb4===null){return;}return db[_0x5d0e('0x70')][_0x5d0e('0x59')]({'where':{'UserId':{'$in':_0x2ee584},'VoicePrefixId':_0x5b3bb4[_0x5d0e('0x71')]},'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(){return db['Team'][_0x5d0e('0x59')]({'where':{'id':_0x2fe9d9},'cascade':!![],'transaction':_0x2ac4be});})[_0x5d0e('0x2b')](function(_0x556252){if(_0x556252===0x0){_0x223ca4[_0x5d0e('0x2c')](0x194);}else{return db[_0x5d0e('0x57')][_0x5d0e('0x59')]({'where':{'type':'Teams','resourceId':_0x2fe9d9},'cascade':!![],'transaction':_0x2ac4be})['then'](function(){_0x223ca4['status'](0xcc)[_0x5d0e('0x20')]();});}})['catch'](function(_0x3a23a5){_0x223ca4['status'](0x1f4)[_0x5d0e('0x2f')](_0x3a23a5);});});};exports[_0x5d0e('0x72')]=function(_0x4dbd83,_0x30e463,_0x5a9253){return db[_0x5d0e('0x30')][_0x5d0e('0x73')]({'where':{'id':_0x4dbd83[_0x5d0e('0x4b')]['id']}})[_0x5d0e('0x2b')](handleEntityNotFound(_0x30e463,null))[_0x5d0e('0x2b')](function(_0x160980){if(!_0x4dbd83[_0x5d0e('0x38')]['channel']||!utils[_0x5d0e('0x74')](_0x4dbd83[_0x5d0e('0x38')][_0x5d0e('0x75')])){throw new db[(_0x5d0e('0x5d'))][(_0x5d0e('0x76'))](_0x5d0e('0x77'));}var _0x3d623c={};var _0x1ee94c={};_0x1ee94c['model']=_[_0x5d0e('0x35')](db[_['capitalize'](_0x4dbd83[_0x5d0e('0x38')][_0x5d0e('0x75')]['toLowerCase']())+_0x5d0e('0x78')][_0x5d0e('0x4c')]);_0x1ee94c[_0x5d0e('0x38')]=_[_0x5d0e('0x35')](_0x4dbd83[_0x5d0e('0x38')]);_0x1ee94c['filters']=_[_0x5d0e('0x37')](_0x1ee94c[_0x5d0e('0x33')],_0x1ee94c[_0x5d0e('0x38')]);_0x3d623c[_0x5d0e('0x39')]=_[_0x5d0e('0x37')](_0x1ee94c[_0x5d0e('0x33')],qs[_0x5d0e('0x3a')](_0x4dbd83[_0x5d0e('0x38')][_0x5d0e('0x3a')]));_0x3d623c[_0x5d0e('0x39')]=_0x3d623c[_0x5d0e('0x39')]['length']?_0x3d623c[_0x5d0e('0x39')]:_0x1ee94c[_0x5d0e('0x33')];_0x3d623c[_0x5d0e('0x24')]=qs[_0x5d0e('0x24')](_0x4dbd83['query']['limit']);_0x3d623c[_0x5d0e('0x22')]=qs[_0x5d0e('0x22')](_0x4dbd83[_0x5d0e('0x38')][_0x5d0e('0x22')]);_0x3d623c[_0x5d0e('0x3e')]=qs[_0x5d0e('0x3f')](_0x4dbd83[_0x5d0e('0x38')][_0x5d0e('0x3f')]);_0x3d623c[_0x5d0e('0x42')]=qs[_0x5d0e('0x36')](_[_0x5d0e('0x40')](_0x4dbd83[_0x5d0e('0x38')],_0x1ee94c[_0x5d0e('0x36')]));_0x3d623c=_[_0x5d0e('0x4d')]({},_0x3d623c,_0x4dbd83[_0x5d0e('0x44')]);return _0x160980[_0x5d0e('0x52')+_[_0x5d0e('0x79')](_0x4dbd83[_0x5d0e('0x38')][_0x5d0e('0x75')][_0x5d0e('0x7a')]())+'Queues'](_0x3d623c);})[_0x5d0e('0x2b')](respondWithResult(_0x30e463,null))[_0x5d0e('0x49')](handleError(_0x30e463,null));};exports[_0x5d0e('0x7b')]=function(_0x155bb1,_0x125d2c,_0x36aead){return db[_0x5d0e('0x30')]['findOne']({'where':{'id':_0x155bb1[_0x5d0e('0x4b')]['id']}})[_0x5d0e('0x2b')](function(_0x13021d){if(_0x13021d){if(!_0x155bb1['body']['channel']||!utils['isValidChannel'](_0x155bb1[_0x5d0e('0x50')]['channel'])){throw new db['Sequelize'][(_0x5d0e('0x76'))](_0x5d0e('0x77'));}return _0x13021d[_0x5d0e('0x7c')+_[_0x5d0e('0x79')](_0x155bb1[_0x5d0e('0x50')][_0x5d0e('0x75')][_0x5d0e('0x7a')]())+_0x5d0e('0x7d')](_0x155bb1[_0x5d0e('0x50')]['ids']);}return null;})[_0x5d0e('0x2b')](handleEntityNotFound(_0x125d2c,null))[_0x5d0e('0x2b')](respondWithStatusCode(_0x125d2c,null))['catch'](handleError(_0x125d2c,null));};exports[_0x5d0e('0x7e')]=function(_0x3cb6c3,_0xb754d5,_0x11fd75){return db[_0x5d0e('0x30')][_0x5d0e('0x73')]({'where':{'id':_0x3cb6c3['params']['id']}})['then'](function(_0x23294b){if(_0x23294b){if(!_0x3cb6c3['query'][_0x5d0e('0x75')]||!utils[_0x5d0e('0x74')](_0x3cb6c3[_0x5d0e('0x38')][_0x5d0e('0x75')])){throw new db['Sequelize'][(_0x5d0e('0x76'))](_0x5d0e('0x77'));}return _0x23294b[_0x5d0e('0x7f')+_[_0x5d0e('0x79')](_0x3cb6c3[_0x5d0e('0x38')][_0x5d0e('0x75')][_0x5d0e('0x7a')]())+'Queues'](_0x3cb6c3[_0x5d0e('0x38')][_0x5d0e('0x80')]);}return null;})[_0x5d0e('0x2b')](handleEntityNotFound(_0xb754d5,null))[_0x5d0e('0x2b')](respondWithStatusCode(_0xb754d5,null))[_0x5d0e('0x49')](handleError(_0xb754d5,null));};exports[_0x5d0e('0x81')]=function(_0x11aa30,_0x20d8b8){var _0x59a7d0=_['isArray'](_0x11aa30[_0x5d0e('0x50')][_0x5d0e('0x80')])?_0x11aa30[_0x5d0e('0x50')][_0x5d0e('0x80')]:[_0x11aa30[_0x5d0e('0x50')][_0x5d0e('0x80')]];var _0x33a1d1=_0x11aa30[_0x5d0e('0x4b')]['id'];return db[_0x5d0e('0x30')][_0x5d0e('0x4e')]({'where':{'id':_0x33a1d1}})['then'](handleEntityNotFound(_0x20d8b8,null))[_0x5d0e('0x2b')](function(_0x1e19a4){if(_0x1e19a4){var _0x364116=[_0x5d0e('0x82'),'Chat','Mail',_0x5d0e('0x83'),_0x5d0e('0x84'),_0x5d0e('0x85'),_0x5d0e('0x86')];return db['sequelize'][_0x5d0e('0x5b')](function(_0x7aaa37){var _0x30abac=_[_0x5d0e('0x34')](_0x364116,function(_0x2d2b7c){var _0x547afa={'attributes':['id',_0x5d0e('0x2e')]};if(_0x2d2b7c===_0x5d0e('0x82')){_0x547afa[_0x5d0e('0x87')]={'attributes':['penalty']};}return _0x1e19a4[_0x5d0e('0x52')+_0x2d2b7c+_0x5d0e('0x7d')](_0x547afa)[_0x5d0e('0x2b')](function(_0x12c84f){var _0x21545b=_[_0x5d0e('0x34')](_0x12c84f,function(_0x17680b){var _0x54c813=_['map'](_0x59a7d0,function(_0x54ed16){var _0xd14e3d={'where':{'UserId':_0x54ed16,[_0x2d2b7c+_0x5d0e('0x88')]:_0x17680b['id']},'transaction':_0x7aaa37};if(_0x2d2b7c==='Voice'){_0xd14e3d['defaults']={'penalty':_0x17680b[_0x5d0e('0x89')][_0x5d0e('0x8a')]};}return db[_0x5d0e('0x8b')+_0x2d2b7c+_0x5d0e('0x78')][_0x5d0e('0x8c')](_0xd14e3d)[_0x5d0e('0x2b')](function(){socket['emit'](_0x5d0e('0x51')+_0x2d2b7c+_0x5d0e('0x8d'),{'UserId':_0x54ed16,[_0x2d2b7c+_0x5d0e('0x88')]:_0x17680b['id']});if(_0x2d2b7c!=='Voice'){return;}return db[_0x5d0e('0x8b')][_0x5d0e('0x47')]({'where':{'id':_0x59a7d0,'online':0x1},'attributes':['id',_0x5d0e('0x2e'),_0x5d0e('0x8e'),_0x5d0e('0x8f'),_0x5d0e('0x90')],'raw':!![]})[_0x5d0e('0x2b')](function(_0x52a37e){var _0x26589f=_['map'](_0x52a37e,function(_0x2a54a3){return db[_0x5d0e('0x91')]['upsert']({'membername':_0x2a54a3[_0x5d0e('0x2e')],'UserId':_0x2a54a3['id'],'queue_name':_0x17680b[_0x5d0e('0x2e')],'VoiceQueueId':_0x17680b['id'],'interface':_[_0x5d0e('0x92')](_0x2a54a3[_0x5d0e('0x90')])?util['format'](_0x5d0e('0x93'),_0x2a54a3[_0x5d0e('0x2e')]):_0x2a54a3[_0x5d0e('0x90')],'paused':_0x2a54a3['voicePause']||![],'penalty':_0x17680b['TeamVoiceQueue'][_0x5d0e('0x8a')]},{'transaction':_0x7aaa37});});return Promise['all'](_0x26589f);});});});return Promise['all'](_0x54c813);});return Promise[_0x5d0e('0x94')](_0x21545b);})[_0x5d0e('0x2b')](function(){return db['TeamVoicePrefix'][_0x5d0e('0x73')]({'where':{'teamId':_0x33a1d1}})[_0x5d0e('0x2b')](function(_0x34334e){if(_0x34334e){var _0x89ad90=_[_0x5d0e('0x34')](_0x59a7d0,function(_0x1681b4){db[_0x5d0e('0x70')][_0x5d0e('0x95')]({'UserId':_0x1681b4,'VoicePrefixId':_0x34334e['VoicePrefixId']});});return Promise[_0x5d0e('0x94')](_0x89ad90);}});});});return Promise[_0x5d0e('0x94')](_0x30abac)['then'](function(){return _0x1e19a4[_0x5d0e('0x81')](_0x59a7d0,{'transaction':_0x7aaa37})[_0x5d0e('0x96')](function(_0x4c9c57){return _0x4c9c57;});});});}})[_0x5d0e('0x2b')](respondWithResult(_0x20d8b8,null))[_0x5d0e('0x49')](handleError(_0x20d8b8,null));};exports['removeAgents']=function(_0x42a2fa,_0x2e7ddb){var _0x3a9563=_['isArray'](_0x42a2fa[_0x5d0e('0x38')]['ids'])?_0x42a2fa[_0x5d0e('0x38')][_0x5d0e('0x80')]:[_0x42a2fa[_0x5d0e('0x38')][_0x5d0e('0x80')]];var _0x296049=_0x42a2fa[_0x5d0e('0x4b')]['id'];return db[_0x5d0e('0x30')]['find']({'where':{'id':_0x296049}})['then'](handleEntityNotFound(_0x2e7ddb,null))[_0x5d0e('0x2b')](function(_0x66064c){if(_0x66064c){var _0x5115bd=['Voice',_0x5d0e('0x97'),'Mail',_0x5d0e('0x83'),'Fax',_0x5d0e('0x85'),_0x5d0e('0x86')];return db['sequelize']['transaction'](function(_0x248f31){var _0x4ff242=_[_0x5d0e('0x34')](_0x5115bd,function(_0x5dabfc){var _0x3c8146={'attributes':['id','name']};return _0x66064c[_0x5d0e('0x52')+_0x5dabfc+_0x5d0e('0x7d')](_0x3c8146)['then'](function(_0x43bffe){var _0x30c657=_[_0x5d0e('0x34')](_0x43bffe,function(_0xfc3555){return _0xfc3555[_0x5d0e('0x98')](_0x3a9563,{'transaction':_0x248f31})[_0x5d0e('0x2b')](function(){var _0x2493f0=_[_0x5d0e('0x34')](_0x3a9563,function(_0x2823d2){socket[_0x5d0e('0x99')](_0x5d0e('0x51')+_0x5dabfc+_0x5d0e('0x9a'),{'UserId':Number(_0x2823d2),[_0x5dabfc+_0x5d0e('0x88')]:_0xfc3555['id']});if(_0x5dabfc!==_0x5d0e('0x82')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0xfc3555['id'],'UserId':_0x2823d2},'transaction':_0x248f31});});return Promise['all'](_0x2493f0);});});return Promise[_0x5d0e('0x94')](_0x30c657);});});return Promise[_0x5d0e('0x94')](_0x4ff242)[_0x5d0e('0x2b')](function(){return _0x66064c['removeAgents'](_0x3a9563,{'transaction':_0x248f31});})[_0x5d0e('0x2b')](function(){return db[_0x5d0e('0x9b')][_0x5d0e('0x73')]({'where':{'teamId':_0x296049}})[_0x5d0e('0x2b')](function(_0x493040){if(_0x493040){var _0x535fa0=_[_0x5d0e('0x34')](_0x3a9563,function(_0x8349e6){db['UserVoicePrefix'][_0x5d0e('0x59')]({'where':{'UserId':_0x8349e6,'VoicePrefixId':_0x493040['VoicePrefixId']}});});return Promise[_0x5d0e('0x94')](_0x535fa0);}});});});}})[_0x5d0e('0x2b')](respondWithStatusCode(_0x2e7ddb,null))[_0x5d0e('0x49')](handleError(_0x2e7ddb,null));};exports[_0x5d0e('0x9c')]=function(_0x2b17e8,_0x11e807,_0x1203b9){var _0x36ea48={};var _0x4689cd={};var _0x326337;var _0x330a0d;return db[_0x5d0e('0x30')][_0x5d0e('0x73')]({'where':{'id':_0x2b17e8[_0x5d0e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11e807,null))['then'](function(_0x4ec6a0){if(_0x4ec6a0){_0x326337=_0x4ec6a0;_0x4689cd[_0x5d0e('0x33')]=_['keys'](db[_0x5d0e('0x8b')][_0x5d0e('0x4c')]);_0x4689cd['query']=_[_0x5d0e('0x35')](_0x2b17e8[_0x5d0e('0x38')]);_0x4689cd[_0x5d0e('0x36')]=_['intersection'](_0x4689cd[_0x5d0e('0x33')],_0x4689cd['query']);_0x36ea48['attributes']=_['intersection'](_0x4689cd[_0x5d0e('0x33')],qs[_0x5d0e('0x3a')](_0x2b17e8[_0x5d0e('0x38')][_0x5d0e('0x3a')]));_0x36ea48[_0x5d0e('0x39')]=_0x36ea48['attributes'][_0x5d0e('0x3b')]?_0x36ea48[_0x5d0e('0x39')]:_0x4689cd['model'];_0x36ea48[_0x5d0e('0x3e')]=qs[_0x5d0e('0x3f')](_0x2b17e8[_0x5d0e('0x38')]['sort']);_0x36ea48[_0x5d0e('0x42')]=qs['filters'](_[_0x5d0e('0x40')](_0x2b17e8[_0x5d0e('0x38')],_0x4689cd[_0x5d0e('0x36')]));if(_0x2b17e8['query'][_0x5d0e('0x41')]){_0x36ea48['where']=_[_0x5d0e('0x4d')](_0x36ea48['where'],{'$or':_[_0x5d0e('0x34')](_0x36ea48[_0x5d0e('0x39')],function(_0x354d08){var _0x1a1c62={};_0x1a1c62[_0x354d08]={'$like':'%'+_0x2b17e8['query'][_0x5d0e('0x41')]+'%'};return _0x1a1c62;})});}_0x36ea48=_[_0x5d0e('0x4d')]({},_0x36ea48,_0x2b17e8[_0x5d0e('0x44')]);return _0x326337[_0x5d0e('0x9c')](_0x36ea48);}})[_0x5d0e('0x2b')](function(_0x2d98fe){if(_0x2d98fe){_0x330a0d=_0x2d98fe[_0x5d0e('0x3b')];if(!_0x2b17e8[_0x5d0e('0x38')][_0x5d0e('0x3c')](_0x5d0e('0x3d'))){_0x36ea48['limit']=qs[_0x5d0e('0x24')](_0x2b17e8[_0x5d0e('0x38')][_0x5d0e('0x24')]);_0x36ea48['offset']=qs[_0x5d0e('0x22')](_0x2b17e8['query'][_0x5d0e('0x22')]);}return _0x326337[_0x5d0e('0x9c')](_0x36ea48);}})['then'](function(_0xdfca33){if(_0xdfca33){return _0xdfca33?{'count':_0x330a0d,'rows':_0xdfca33}:null;}})[_0x5d0e('0x2b')](respondWithResult(_0x11e807,null))[_0x5d0e('0x49')](handleError(_0x11e807,null));};
\ No newline at end of file
index 2a6aa0d..6b978bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6172=['save','update','remove','emit','hook','exports','../../mysqldb','Team'];(function(_0x327520,_0x312519){var _0x5349be=function(_0x484aef){while(--_0x484aef){_0x327520['push'](_0x327520['shift']());}};_0x5349be(++_0x312519);}(_0x6172,0x15e));var _0x2617=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6172[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var Team=require(_0x2617('0x0'))['db'][_0x2617('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2617('0x2'),'afterUpdate':_0x2617('0x3'),'afterDestroy':_0x2617('0x4')};function emitEvent(_0x3f8917){return function(_0x2ead92,_0x693663,_0x290abc){TeamEvents[_0x2617('0x5')](_0x3f8917+':'+_0x2ead92['id'],_0x2ead92);TeamEvents['emit'](_0x3f8917,_0x2ead92);_0x290abc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x2617('0x6')](e,emitEvent(event));}}module[_0x2617('0x7')]=TeamEvents;
\ No newline at end of file
+var _0x9cf0=['hasOwnProperty','exports','events','../../mysqldb','Team','save','update','remove','emit'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x9cf0,0x1e8));var _0x09cf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9cf0[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x09cf('0x0'));var Team=require(_0x09cf('0x1'))['db'][_0x09cf('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x09cf('0x3'),'afterUpdate':_0x09cf('0x4'),'afterDestroy':_0x09cf('0x5')};function emitEvent(_0x27ba5c){return function(_0x18a883,_0xeb0645,_0x2cd379){TeamEvents['emit'](_0x27ba5c+':'+_0x18a883['id'],_0x18a883);TeamEvents[_0x09cf('0x6')](_0x27ba5c,_0x18a883);_0x2cd379(null);};}for(var e in events){if(events[_0x09cf('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x09cf('0x8')]=TeamEvents;
\ No newline at end of file
index 03be233..a09d309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe745=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','Team','teams','lodash','util'];(function(_0x4066af,_0x577ef6){var _0x1a296b=function(_0x5050f7){while(--_0x5050f7){_0x4066af['push'](_0x4066af['shift']());}};_0x1a296b(++_0x577ef6);}(_0xe745,0x11c));var _0x5e74=function(_0x572eb9,_0x348eb8){_0x572eb9=_0x572eb9-0x0;var _0x27fcad=_0xe745[_0x572eb9];return _0x27fcad;};'use strict';var _=require(_0x5e74('0x0'));var util=require(_0x5e74('0x1'));var logger=require(_0x5e74('0x2'))(_0x5e74('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e74('0x4'));var fs=require('fs');var path=require(_0x5e74('0x5'));var rimraf=require(_0x5e74('0x6'));var config=require(_0x5e74('0x7'));var attributes=require('./team.attributes');module['exports']=function(_0x322946,_0x42a1d3){return _0x322946[_0x5e74('0x8')](_0x5e74('0x9'),attributes,{'tableName':_0x5e74('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2092=['../../config/logger','moment','request-promise','path','rimraf','./team.attributes','define','Team','teams','lodash','util'];(function(_0x4abf13,_0x28742a){var _0x27b0e5=function(_0x3a0aa5){while(--_0x3a0aa5){_0x4abf13['push'](_0x4abf13['shift']());}};_0x27b0e5(++_0x28742a);}(_0x2092,0xcf));var _0x2209=function(_0x152bd6,_0x2eab8f){_0x152bd6=_0x152bd6-0x0;var _0x408786=_0x2092[_0x152bd6];return _0x408786;};'use strict';var _=require(_0x2209('0x0'));var util=require(_0x2209('0x1'));var logger=require(_0x2209('0x2'))('api');var moment=require(_0x2209('0x3'));var BPromise=require('bluebird');var rp=require(_0x2209('0x4'));var fs=require('fs');var path=require(_0x2209('0x5'));var rimraf=require(_0x2209('0x6'));var config=require('../../config/environment');var attributes=require(_0x2209('0x7'));module['exports']=function(_0x2b0598,_0x419824){return _0x2b0598[_0x2209('0x8')](_0x2209('0x9'),attributes,{'tableName':_0x2209('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 614e053..8e66567 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc338=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4a5794,_0x5607c1){var _0x49ee5e=function(_0x2d5a1a){while(--_0x2d5a1a){_0x4a5794['push'](_0x4a5794['shift']());}};_0x49ee5e(++_0x5607c1);}(_0xc338,0x6f));var _0x8c33=function(_0x2b60d0,_0xba49af){_0x2b60d0=_0x2b60d0-0x0;var _0x2d78b7=_0xc338[_0x2b60d0];return _0x2d78b7;};'use strict';var _=require(_0x8c33('0x0'));var util=require('util');var moment=require(_0x8c33('0x1'));var BPromise=require(_0x8c33('0x2'));var rs=require(_0x8c33('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c33('0x4'))['db'];var utils=require(_0x8c33('0x5'));var logger=require(_0x8c33('0x6'))(_0x8c33('0x7'));var config=require('../../config/environment');var jayson=require(_0x8c33('0x8'));var client=jayson[_0x8c33('0x9')][_0x8c33('0xa')]({'port':0x232a});config[_0x8c33('0xb')]=_[_0x8c33('0xc')](config['redis'],{'host':_0x8c33('0xd'),'port':0x18eb});var socket=require(_0x8c33('0xe'))(new Redis(config['redis']));require(_0x8c33('0xf'))[_0x8c33('0x10')](socket);function respondWithRpcPromise(_0x5954dc,_0x33c807,_0x4db8ce){return new BPromise(function(_0x1f83b5,_0x41f7b1){return client[_0x8c33('0x11')](_0x5954dc,_0x4db8ce)['then'](function(_0x34ef52){logger[_0x8c33('0x12')](_0x8c33('0x13'),_0x33c807,_0x8c33('0x14'));logger[_0x8c33('0x15')](_0x8c33('0x16'),_0x33c807,_0x8c33('0x14'),JSON[_0x8c33('0x17')](_0x34ef52));if(_0x34ef52[_0x8c33('0x18')]){if(_0x34ef52['error'][_0x8c33('0x19')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x33c807,_0x34ef52[_0x8c33('0x18')]['message']);return _0x41f7b1(_0x34ef52['error']['message']);}logger[_0x8c33('0x18')](_0x8c33('0x13'),_0x33c807,_0x34ef52[_0x8c33('0x18')][_0x8c33('0x1a')]);return _0x1f83b5(_0x34ef52['error']['message']);}else{logger[_0x8c33('0x12')]('Team,\x20%s,\x20%s',_0x33c807,_0x8c33('0x14'));_0x1f83b5(_0x34ef52[_0x8c33('0x1b')][_0x8c33('0x1a')]);}})[_0x8c33('0x1c')](function(_0x782384){logger[_0x8c33('0x18')](_0x8c33('0x13'),_0x33c807,_0x782384);_0x41f7b1(_0x782384);});});}
\ No newline at end of file
+var _0xb815=['localhost','socket.io-emitter','./team.socket','register','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','Team,\x20%s,\x20%s','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x374e13,_0x34582f){var _0x45991e=function(_0x82f40a){while(--_0x82f40a){_0x374e13['push'](_0x374e13['shift']());}};_0x45991e(++_0x34582f);}(_0xb815,0x160));var _0x5b81=function(_0x19e08e,_0x178f46){_0x19e08e=_0x19e08e-0x0;var _0x14c229=_0xb815[_0x19e08e];return _0x14c229;};'use strict';var _=require(_0x5b81('0x0'));var util=require(_0x5b81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b81('0x3'))['db'];var utils=require(_0x5b81('0x4'));var logger=require(_0x5b81('0x5'))(_0x5b81('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b81('0x7'));var client=jayson[_0x5b81('0x8')][_0x5b81('0x9')]({'port':0x232a});config[_0x5b81('0xa')]=_[_0x5b81('0xb')](config[_0x5b81('0xa')],{'host':_0x5b81('0xc'),'port':0x18eb});var socket=require(_0x5b81('0xd'))(new Redis(config[_0x5b81('0xa')]));require(_0x5b81('0xe'))[_0x5b81('0xf')](socket);function respondWithRpcPromise(_0x1bd508,_0x3b480c,_0x5345f8){return new BPromise(function(_0x4153f0,_0x21bb6d){return client['request'](_0x1bd508,_0x5345f8)[_0x5b81('0x10')](function(_0x3d2296){logger[_0x5b81('0x11')]('Team,\x20%s,\x20%s',_0x3b480c,_0x5b81('0x12'));logger[_0x5b81('0x13')](_0x5b81('0x14'),_0x3b480c,_0x5b81('0x12'),JSON[_0x5b81('0x15')](_0x3d2296));if(_0x3d2296[_0x5b81('0x16')]){if(_0x3d2296[_0x5b81('0x16')]['code']===0x1f4){logger[_0x5b81('0x16')]('Team,\x20%s,\x20%s',_0x3b480c,_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);return _0x21bb6d(_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);}logger[_0x5b81('0x16')](_0x5b81('0x18'),_0x3b480c,_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);return _0x4153f0(_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);}else{logger[_0x5b81('0x11')]('Team,\x20%s,\x20%s',_0x3b480c,_0x5b81('0x12'));_0x4153f0(_0x3d2296[_0x5b81('0x19')][_0x5b81('0x17')]);}})['catch'](function(_0xfa7f55){logger['error'](_0x5b81('0x18'),_0x3b480c,_0xfa7f55);_0x21bb6d(_0xfa7f55);});});}
\ No newline at end of file
index 6685dff..d7ae208 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9bf=['register','length','team:','./team.events','remove','update'];(function(_0x459a62,_0x4206b7){var _0x4449c4=function(_0x593d5c){while(--_0x593d5c){_0x459a62['push'](_0x459a62['shift']());}};_0x4449c4(++_0x4206b7);}(_0xa9bf,0x8d));var _0xfa9b=function(_0x2c9d30,_0xb7653e){_0x2c9d30=_0x2c9d30-0x0;var _0x2ca878=_0xa9bf[_0x2c9d30];return _0x2ca878;};'use strict';var TeamEvents=require(_0xfa9b('0x0'));var events=['save',_0xfa9b('0x1'),_0xfa9b('0x2')];function createListener(_0x45542c,_0x30b5e0){return function(_0x46d411){_0x30b5e0['emit'](_0x45542c,_0x46d411);};}function removeListener(_0x5e4115,_0x3823a3){return function(){TeamEvents['removeListener'](_0x5e4115,_0x3823a3);};}exports[_0xfa9b('0x3')]=function(_0x99747b){for(var _0x17ebe0=0x0,_0x49caab=events[_0xfa9b('0x4')];_0x17ebe0<_0x49caab;_0x17ebe0++){var _0x58a81f=events[_0x17ebe0];var _0x377c49=createListener(_0xfa9b('0x5')+_0x58a81f,_0x99747b);TeamEvents['on'](_0x58a81f,_0x377c49);}};
\ No newline at end of file
+var _0x04c5=['removeListener','register','length','./team.events','emit'];(function(_0x247652,_0x4218b6){var _0x5503b6=function(_0x3951d1){while(--_0x3951d1){_0x247652['push'](_0x247652['shift']());}};_0x5503b6(++_0x4218b6);}(_0x04c5,0x125));var _0x504c=function(_0x128428,_0x92bd90){_0x128428=_0x128428-0x0;var _0x26f617=_0x04c5[_0x128428];return _0x26f617;};'use strict';var TeamEvents=require(_0x504c('0x0'));var events=['save','remove','update'];function createListener(_0x50185e,_0x1a5360){return function(_0x5def11){_0x1a5360[_0x504c('0x1')](_0x50185e,_0x5def11);};}function removeListener(_0x29d330,_0x5addbc){return function(){TeamEvents[_0x504c('0x2')](_0x29d330,_0x5addbc);};}exports[_0x504c('0x3')]=function(_0x1a8eac){for(var _0x31f0ec=0x0,_0x4b6fdf=events[_0x504c('0x4')];_0x31f0ec<_0x4b6fdf;_0x31f0ec++){var _0x17ca9e=events[_0x31f0ec];var _0x421979=createListener('team:'+_0x17ca9e,_0x1a8eac);TeamEvents['on'](_0x17ca9e,_0x421979);}};
\ No newline at end of file
index 6cee6ce..b184cd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d51=['exports','sequelize'];(function(_0x5f1a90,_0x297163){var _0x3613b1=function(_0x1cfad3){while(--_0x1cfad3){_0x5f1a90['push'](_0x5f1a90['shift']());}};_0x3613b1(++_0x297163);}(_0x7d51,0x1e9));var _0x17d5=function(_0x772a61,_0x4d192e){_0x772a61=_0x772a61-0x0;var _0x2a8d75=_0x7d51[_0x772a61];return _0x2a8d75;};'use strict';var Sequelize=require(_0x17d5('0x0'));module[_0x17d5('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0eaa=['exports','sequelize'];(function(_0x4224dd,_0xd3990e){var _0x2177a3=function(_0x28e0ef){while(--_0x28e0ef){_0x4224dd['push'](_0x4224dd['shift']());}};_0x2177a3(++_0xd3990e);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x506090,_0x44d91c){_0x506090=_0x506090-0x0;var _0x152fc3=_0x0eaa[_0x506090];return _0x152fc3;};'use strict';var Sequelize=require(_0xa0ea('0x0'));module[_0xa0ea('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index ba9594b..ca0afe5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8eba=['rimraf','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','bluebird','request-promise','path'];(function(_0xd57bf1,_0x1e33c5){var _0x23e146=function(_0x64313a){while(--_0x64313a){_0xd57bf1['push'](_0xd57bf1['shift']());}};_0x23e146(++_0x1e33c5);}(_0x8eba,0xc3));var _0xa8eb=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x8eba[_0x38b14f];return _0x22a324;};'use strict';var _=require(_0xa8eb('0x0'));var util=require(_0xa8eb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa8eb('0x2'));var rp=require(_0xa8eb('0x3'));var fs=require('fs');var path=require(_0xa8eb('0x4'));var rimraf=require(_0xa8eb('0x5'));var config=require('../../config/environment');var attributes=require(_0xa8eb('0x6'));module[_0xa8eb('0x7')]=function(_0x5abab9,_0x321f2f){return _0x5abab9['define'](_0xa8eb('0x8'),attributes,{'tableName':_0xa8eb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbcff=['rimraf','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2c7b0c,_0x481127){var _0x152a39=function(_0x272772){while(--_0x272772){_0x2c7b0c['push'](_0x2c7b0c['shift']());}};_0x152a39(++_0x481127);}(_0xbcff,0x12e));var _0xfbcf=function(_0xd4cada,_0x5b3d05){_0xd4cada=_0xd4cada-0x0;var _0x1bdb53=_0xbcff[_0xd4cada];return _0x1bdb53;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var logger=require(_0xfbcf('0x2'))('api');var moment=require(_0xfbcf('0x3'));var BPromise=require(_0xfbcf('0x4'));var rp=require(_0xfbcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbcf('0x6'));var config=require(_0xfbcf('0x7'));var attributes=require(_0xfbcf('0x8'));module['exports']=function(_0x2d8044,_0x3b30c8){return _0x2d8044['define'](_0xfbcf('0x9'),attributes,{'tableName':_0xfbcf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fb518f3..9ff0cf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x383944,_0x2cd825){var _0x29a406=function(_0x42b2e0){while(--_0x42b2e0){_0x383944['push'](_0x383944['shift']());}};_0x29a406(++_0x2cd825);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0xcb91[_0x416cdc];return _0x1931ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 181f80a..7b55814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd464=['exports'];(function(_0x28245a,_0x2e3476){var _0x4fb80e=function(_0x577152){while(--_0x577152){_0x28245a['push'](_0x28245a['shift']());}};_0x4fb80e(++_0x2e3476);}(_0xd464,0x1f1));var _0x4d46=function(_0x56fdff,_0x5ca0df){_0x56fdff=_0x56fdff-0x0;var _0x145984=_0xd464[_0x56fdff];return _0x145984;};'use strict';var Sequelize=require('sequelize');module[_0x4d46('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xafb5=['exports'];(function(_0x284d33,_0x5b003f){var _0x225cf8=function(_0xe512c4){while(--_0xe512c4){_0x284d33['push'](_0x284d33['shift']());}};_0x225cf8(++_0x5b003f);}(_0xafb5,0xa0));var _0x5afb=function(_0x4c90ec,_0x3c2311){_0x4c90ec=_0x4c90ec-0x0;var _0x1253b2=_0xafb5[_0x4c90ec];return _0x1253b2;};'use strict';var Sequelize=require('sequelize');module[_0x5afb('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 0d0ef74..ebb7692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x777f=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x777f,0x9f));var _0xf777=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x777f[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var logger=require(_0xf777('0x2'))(_0xf777('0x3'));var moment=require(_0xf777('0x4'));var BPromise=require(_0xf777('0x5'));var rp=require(_0xf777('0x6'));var fs=require('fs');var path=require(_0xf777('0x7'));var rimraf=require('rimraf');var config=require(_0xf777('0x8'));var attributes=require(_0xf777('0x9'));module['exports']=function(_0x5b7903,_0x5df5dc){return _0x5b7903[_0xf777('0xa')](_0xf777('0xb'),attributes,{'tableName':_0xf777('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf50b=['bluebird','request-promise','rimraf','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','api','moment'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0xf50b,0xc8));var _0xbf50=function(_0x453531,_0x406bc7){_0x453531=_0x453531-0x0;var _0x493e2d=_0xf50b[_0x453531];return _0x493e2d;};'use strict';var _=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var logger=require('../../config/logger')(_0xbf50('0x2'));var moment=require(_0xbf50('0x3'));var BPromise=require(_0xbf50('0x4'));var rp=require(_0xbf50('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf50('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf50('0x7'));module[_0xbf50('0x8')]=function(_0x1ecb62,_0x117cc8){return _0x1ecb62[_0xbf50('0x9')](_0xbf50('0xa'),attributes,{'tableName':_0xbf50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a347d2..0a3dd8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0e4=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x1f65de,_0x4cc5da){var _0xf105e3=function(_0x7bcb09){while(--_0x7bcb09){_0x1f65de['push'](_0x1f65de['shift']());}};_0xf105e3(++_0x4cc5da);}(_0xd0e4,0x1ba));var _0x4d0e=function(_0x3a9d2b,_0x4a754d){_0x3a9d2b=_0x3a9d2b-0x0;var _0x50dff9=_0xd0e4[_0x3a9d2b];return _0x50dff9;};'use strict';var _=require(_0x4d0e('0x0'));var util=require(_0x4d0e('0x1'));var moment=require('moment');var BPromise=require(_0x4d0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d0e('0x3'));var db=require(_0x4d0e('0x4'))['db'];var utils=require(_0x4d0e('0x5'));var logger=require(_0x4d0e('0x6'))(_0x4d0e('0x7'));var config=require(_0x4d0e('0x8'));var jayson=require(_0x4d0e('0x9'));var client=jayson[_0x4d0e('0xa')][_0x4d0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22059c,_0x1fedcf,_0x61f045){return new BPromise(function(_0x13d8aa,_0x5431a7){return client[_0x4d0e('0xc')](_0x22059c,_0x61f045)['then'](function(_0x2d8b3c){logger['info'](_0x4d0e('0xd'),_0x1fedcf,_0x4d0e('0xe'));logger[_0x4d0e('0xf')](_0x4d0e('0x10'),_0x1fedcf,'request\x20sent',JSON['stringify'](_0x2d8b3c));if(_0x2d8b3c[_0x4d0e('0x11')]){if(_0x2d8b3c[_0x4d0e('0x11')]['code']===0x1f4){logger[_0x4d0e('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1fedcf,_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);return _0x5431a7(_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);}logger['error'](_0x4d0e('0xd'),_0x1fedcf,_0x2d8b3c[_0x4d0e('0x11')]['message']);return _0x13d8aa(_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);}else{logger[_0x4d0e('0x13')](_0x4d0e('0xd'),_0x1fedcf,'request\x20sent');_0x13d8aa(_0x2d8b3c[_0x4d0e('0x14')][_0x4d0e('0x12')]);}})['catch'](function(_0x14227){logger[_0x4d0e('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1fedcf,_0x14227);_0x5431a7(_0x14227);});});}
\ No newline at end of file
+var _0x5127=['client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5127,0x64));var _0x7512=function(_0x2f8b0f,_0x2654eb){_0x2f8b0f=_0x2f8b0f-0x0;var _0x384196=_0x5127[_0x2f8b0f];return _0x384196;};'use strict';var _=require(_0x7512('0x0'));var util=require(_0x7512('0x1'));var moment=require(_0x7512('0x2'));var BPromise=require(_0x7512('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7512('0x4'));var db=require(_0x7512('0x5'))['db'];var utils=require(_0x7512('0x6'));var logger=require('../../config/logger')(_0x7512('0x7'));var config=require(_0x7512('0x8'));var jayson=require(_0x7512('0x9'));var client=jayson[_0x7512('0xa')][_0x7512('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d08ae,_0x40eee2,_0x208711){return new BPromise(function(_0x1be9e3,_0x4c3df7){return client[_0x7512('0xc')](_0x5d08ae,_0x208711)[_0x7512('0xd')](function(_0x16d3d0){logger['info'](_0x7512('0xe'),_0x40eee2,_0x7512('0xf'));logger[_0x7512('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x40eee2,'request\x20sent',JSON[_0x7512('0x11')](_0x16d3d0));if(_0x16d3d0[_0x7512('0x12')]){if(_0x16d3d0[_0x7512('0x12')]['code']===0x1f4){logger[_0x7512('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x40eee2,_0x16d3d0[_0x7512('0x12')]['message']);return _0x4c3df7(_0x16d3d0[_0x7512('0x12')][_0x7512('0x13')]);}logger[_0x7512('0x12')](_0x7512('0xe'),_0x40eee2,_0x16d3d0[_0x7512('0x12')][_0x7512('0x13')]);return _0x1be9e3(_0x16d3d0[_0x7512('0x12')]['message']);}else{logger[_0x7512('0x14')](_0x7512('0xe'),_0x40eee2,_0x7512('0xf'));_0x1be9e3(_0x16d3d0[_0x7512('0x15')][_0x7512('0x13')]);}})['catch'](function(_0x523fa0){logger['error'](_0x7512('0xe'),_0x40eee2,_0x523fa0);_0x4c3df7(_0x523fa0);});});}
\ No newline at end of file
index 0d7f3d2..5eacec1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa456=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x4a89dc,_0x4089fc){var _0x1560fa=function(_0x4277bb){while(--_0x4277bb){_0x4a89dc['push'](_0x4a89dc['shift']());}};_0x1560fa(++_0x4089fc);}(_0xa456,0x142));var _0x6a45=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xa456[_0x344a3f];return _0x264712;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var fs_extra=require(_0x6a45('0x5'));var auth=require(_0x6a45('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a45('0x7'));var controller=require(_0x6a45('0x8'));router[_0x6a45('0x9')]('/',auth[_0x6a45('0xa')](),controller['index']);router[_0x6a45('0x9')](_0x6a45('0xb'),auth[_0x6a45('0xa')](),controller[_0x6a45('0xc')]);router[_0x6a45('0xd')]('/',auth['isAuthenticated'](),controller[_0x6a45('0xe')]);router['put'](_0x6a45('0xb'),auth[_0x6a45('0xa')](),controller[_0x6a45('0xf')]);router[_0x6a45('0x10')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x6a45('0x11')]=router;
\ No newline at end of file
+var _0x0a1c=['show','post','create','put','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x4099fd,_0x28e46d){var _0xfcb4e6=function(_0x12406b){while(--_0x12406b){_0x4099fd['push'](_0x4099fd['shift']());}};_0xfcb4e6(++_0x28e46d);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x0a1c[_0x24237f];return _0x48298e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc0a1('0x0'));var timeout=require(_0xc0a1('0x1'));var express=require(_0xc0a1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc0a1('0x3'));var interaction=require(_0xc0a1('0x4'));var config=require(_0xc0a1('0x5'));var controller=require(_0xc0a1('0x6'));router[_0xc0a1('0x7')]('/',auth[_0xc0a1('0x8')](),controller[_0xc0a1('0x9')]);router[_0xc0a1('0x7')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller[_0xc0a1('0xb')]);router[_0xc0a1('0xc')]('/',auth[_0xc0a1('0x8')](),controller[_0xc0a1('0xd')]);router[_0xc0a1('0xe')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller['update']);router[_0xc0a1('0xf')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller['destroy']);module[_0xc0a1('0x10')]=router;
\ No newline at end of file
index 31e0662..7d6d2c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2b5=['STRING','TEXT','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd2b5,0xba));var _0x5d2b=function(_0x222600,_0x564ae2){_0x222600=_0x222600-0x0;var _0x297372=_0xd2b5[_0x222600];return _0x297372;};'use strict';var Sequelize=require(_0x5d2b('0x0'));module[_0x5d2b('0x1')]={'name':{'type':Sequelize[_0x5d2b('0x2')]},'description':{'type':Sequelize[_0x5d2b('0x2')]},'html':{'type':Sequelize[_0x5d2b('0x3')]}};
\ No newline at end of file
+var _0xeeac=['TEXT','sequelize','exports','STRING'];(function(_0x24a19c,_0x41f2e1){var _0x3a6d51=function(_0x43da3e){while(--_0x43da3e){_0x24a19c['push'](_0x24a19c['shift']());}};_0x3a6d51(++_0x41f2e1);}(_0xeeac,0x185));var _0xceea=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0xeeac[_0x2272b5];return _0x110156;};'use strict';var Sequelize=require(_0xceea('0x0'));module[_0xceea('0x1')]={'name':{'type':Sequelize[_0xceea('0x2')]},'description':{'type':Sequelize[_0xceea('0x2')]},'html':{'type':Sequelize[_0xceea('0x3')]}};
\ No newline at end of file
index 5c9c100..4971387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x911e=['where','VIRTUAL','merge','includeAll','include','Template','findAll','catch','show','params','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','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','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','Templates','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3d6f4f,_0x3bd32a){var _0x3b22dc=function(_0x2a7ecb){while(--_0x2a7ecb){_0x3d6f4f['push'](_0x3d6f4f['shift']());}};_0x3b22dc(++_0x3bd32a);}(_0x911e,0xbf));var _0xe911=function(_0x524186,_0x26d30d){_0x524186=_0x524186-0x0;var _0x5ae4fa=_0x911e[_0x524186];return _0x5ae4fa;};'use strict';var emlformat=require(_0xe911('0x0'));var rimraf=require(_0xe911('0x1'));var zipdir=require(_0xe911('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe911('0x3'));var BPromise=require(_0xe911('0x4'));var Mustache=require(_0xe911('0x5'));var util=require(_0xe911('0x6'));var path=require(_0xe911('0x7'));var sox=require(_0xe911('0x8'));var csv=require(_0xe911('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe911('0xa'));var _=require('lodash');var squel=require(_0xe911('0xb'));var crypto=require(_0xe911('0xc'));var jsforce=require(_0xe911('0xd'));var deskjs=require(_0xe911('0xe'));var toCsv=require(_0xe911('0x9'));var querystring=require('querystring');var Papa=require(_0xe911('0xf'));var Redis=require('ioredis');var authService=require(_0xe911('0x10'));var qs=require(_0xe911('0x11'));var as=require(_0xe911('0x12'));var hardwareService=require(_0xe911('0x13'));var logger=require(_0xe911('0x14'))(_0xe911('0x15'));var utils=require('../../config/utils');var config=require(_0xe911('0x16'));var licenseUtil=require(_0xe911('0x17'));var db=require(_0xe911('0x18'))['db'];function respondWithStatusCode(_0x8654d,_0x827520){_0x827520=_0x827520||0xcc;return function(_0x3fdd16){if(_0x3fdd16){return _0x8654d[_0xe911('0x19')](_0x827520);}return _0x8654d[_0xe911('0x1a')](_0x827520)['end']();};}function respondWithResult(_0xf2fdc8,_0x34b4f3){_0x34b4f3=_0x34b4f3||0xc8;return function(_0x491322){if(_0x491322){return _0xf2fdc8[_0xe911('0x1a')](_0x34b4f3)[_0xe911('0x1b')](_0x491322);}};}function respondWithFilteredResult(_0x28cbb1,_0x468f5a){return function(_0x80c7e6){if(_0x80c7e6){var _0x1b22e4=typeof _0x468f5a[_0xe911('0x1c')]===_0xe911('0x1d')&&typeof _0x468f5a[_0xe911('0x1e')]===_0xe911('0x1d');var _0x2ad71a=_0x80c7e6[_0xe911('0x1f')];var _0x2dd36b=_0x1b22e4?0x0:_0x468f5a[_0xe911('0x1c')];var _0x5bb03e=_0x1b22e4?_0x80c7e6[_0xe911('0x1f')]:_0x468f5a[_0xe911('0x1c')]+_0x468f5a['limit'];var _0x273f9e;if(_0x5bb03e>=_0x2ad71a){_0x5bb03e=_0x2ad71a;_0x273f9e=0xc8;}else{_0x273f9e=0xce;}_0x28cbb1[_0xe911('0x1a')](_0x273f9e);return _0x28cbb1[_0xe911('0x20')]('Content-Range',_0x2dd36b+'-'+_0x5bb03e+'/'+_0x2ad71a)[_0xe911('0x1b')](_0x80c7e6);}return null;};}function patchUpdates(_0x1297f6){return function(_0x455ac0){try{jsonpatch[_0xe911('0x21')](_0x455ac0,_0x1297f6,!![]);}catch(_0x4becc7){return BPromise['reject'](_0x4becc7);}return _0x455ac0[_0xe911('0x22')]();};}function saveUpdates(_0x5eb82a,_0x3e6530){return function(_0x374aea){if(_0x374aea){return _0x374aea['update'](_0x5eb82a)[_0xe911('0x23')](function(_0x78d4f6){return _0x78d4f6;});}return null;};}function removeEntity(_0x30f449,_0xd8b665){return function(_0xd08b46){if(_0xd08b46){return _0xd08b46[_0xe911('0x24')]()[_0xe911('0x23')](function(){var _0x329192=_0xd08b46[_0xe911('0x25')]({'plain':!![]});var _0x1b3c43=_0xe911('0x26');return db['UserProfileResource'][_0xe911('0x24')]({'where':{'type':_0x1b3c43,'resourceId':_0x329192['id']}})[_0xe911('0x23')](function(){return _0xd08b46;});})[_0xe911('0x23')](function(){_0x30f449[_0xe911('0x1a')](0xcc)[_0xe911('0x27')]();});}};}function handleEntityNotFound(_0x4fec05,_0x317642){return function(_0x435b77){if(!_0x435b77){_0x4fec05[_0xe911('0x19')](0x194);}return _0x435b77;};}function handleError(_0x5a6b16,_0x3d9753){_0x3d9753=_0x3d9753||0x1f4;return function(_0x506ece){logger[_0xe911('0x28')](_0x506ece[_0xe911('0x29')]);if(_0x506ece[_0xe911('0x2a')]){delete _0x506ece['name'];}_0x5a6b16[_0xe911('0x1a')](_0x3d9753)[_0xe911('0x2b')](_0x506ece);};}exports[_0xe911('0x2c')]=function(_0x27327a,_0x3c6ea3){var _0xaf2f18={},_0x21c188={},_0x142d3a={'count':0x0,'rows':[]};var _0x43bcf1=_[_0xe911('0x2d')](db['Template'][_0xe911('0x2e')],function(_0x3fe6f7){return{'name':_0x3fe6f7[_0xe911('0x2f')],'type':_0x3fe6f7[_0xe911('0x30')]['key']};});_0x21c188[_0xe911('0x31')]=_[_0xe911('0x2d')](_0x43bcf1,'name');_0x21c188[_0xe911('0x32')]=_[_0xe911('0x33')](_0x27327a[_0xe911('0x32')]);_0x21c188[_0xe911('0x34')]=_['intersection'](_0x21c188[_0xe911('0x31')],_0x21c188['query']);_0xaf2f18[_0xe911('0x35')]=_[_0xe911('0x36')](_0x21c188['model'],qs[_0xe911('0x37')](_0x27327a[_0xe911('0x32')]['fields']));_0xaf2f18[_0xe911('0x35')]=_0xaf2f18[_0xe911('0x35')][_0xe911('0x38')]?_0xaf2f18[_0xe911('0x35')]:_0x21c188[_0xe911('0x31')];if(!_0x27327a[_0xe911('0x32')][_0xe911('0x39')](_0xe911('0x3a'))){_0xaf2f18[_0xe911('0x1e')]=qs[_0xe911('0x1e')](_0x27327a[_0xe911('0x32')][_0xe911('0x1e')]);_0xaf2f18['offset']=qs[_0xe911('0x1c')](_0x27327a[_0xe911('0x32')]['offset']);}_0xaf2f18[_0xe911('0x3b')]=qs[_0xe911('0x3c')](_0x27327a['query'][_0xe911('0x3c')]);_0xaf2f18[_0xe911('0x3d')]=qs[_0xe911('0x34')](_['pick'](_0x27327a[_0xe911('0x32')],_0x21c188['filters']),_0x43bcf1);if(_0x27327a['query']['filter']){_0xaf2f18[_0xe911('0x3d')]=_['merge'](_0xaf2f18[_0xe911('0x3d')],{'$or':_[_0xe911('0x2d')](_0x43bcf1,function(_0x519b12){if(_0x519b12['type']!==_0xe911('0x3e')){var _0x46b966={};_0x46b966[_0x519b12[_0xe911('0x2a')]]={'$like':'%'+_0x27327a[_0xe911('0x32')]['filter']+'%'};return _0x46b966;}})});}_0xaf2f18=_[_0xe911('0x3f')]({},_0xaf2f18,_0x27327a['options']);var _0x1ab707={'where':_0xaf2f18['where']};return db['Template'][_0xe911('0x1f')](_0x1ab707)[_0xe911('0x23')](function(_0x5b2399){_0x142d3a[_0xe911('0x1f')]=_0x5b2399;if(_0x27327a[_0xe911('0x32')][_0xe911('0x40')]){_0xaf2f18[_0xe911('0x41')]=[{'all':!![]}];}return db[_0xe911('0x42')][_0xe911('0x43')](_0xaf2f18);})[_0xe911('0x23')](function(_0x352646){_0x142d3a['rows']=_0x352646;return _0x142d3a;})[_0xe911('0x23')](respondWithFilteredResult(_0x3c6ea3,_0xaf2f18))[_0xe911('0x44')](handleError(_0x3c6ea3,null));};exports[_0xe911('0x45')]=function(_0x135158,_0x34d134){var _0x19ee4b={'raw':!![],'where':{'id':_0x135158[_0xe911('0x46')]['id']}},_0x71c15c={};_0x71c15c[_0xe911('0x31')]=_['keys'](db['Template'][_0xe911('0x2e')]);_0x71c15c[_0xe911('0x32')]=_[_0xe911('0x33')](_0x135158[_0xe911('0x32')]);_0x71c15c[_0xe911('0x34')]=_[_0xe911('0x36')](_0x71c15c['model'],_0x71c15c['query']);_0x19ee4b[_0xe911('0x35')]=_['intersection'](_0x71c15c[_0xe911('0x31')],qs['fields'](_0x135158[_0xe911('0x32')][_0xe911('0x37')]));_0x19ee4b['attributes']=_0x19ee4b[_0xe911('0x35')]['length']?_0x19ee4b[_0xe911('0x35')]:_0x71c15c[_0xe911('0x31')];if(_0x135158[_0xe911('0x32')][_0xe911('0x40')]){_0x19ee4b[_0xe911('0x41')]=[{'all':!![]}];}_0x19ee4b=_[_0xe911('0x3f')]({},_0x19ee4b,_0x135158[_0xe911('0x47')]);return db[_0xe911('0x42')]['find'](_0x19ee4b)[_0xe911('0x23')](handleEntityNotFound(_0x34d134,null))[_0xe911('0x23')](respondWithResult(_0x34d134,null))[_0xe911('0x44')](handleError(_0x34d134,null));};exports[_0xe911('0x48')]=function(_0x149eff,_0x1b0107){return db[_0xe911('0x42')]['create'](_0x149eff['body'],{})[_0xe911('0x23')](function(_0x28061a){var _0x510d0d=_0x149eff['user'][_0xe911('0x25')]({'plain':!![]});if(!_0x510d0d)throw new Error(_0xe911('0x49'));if(_0x510d0d[_0xe911('0x4a')]===_0xe911('0x4b')){var _0x3fcf30=_0x28061a[_0xe911('0x25')]({'plain':!![]});var _0x32ad9d=_0xe911('0x26');return db[_0xe911('0x4c')][_0xe911('0x4d')]({'where':{'name':_0x32ad9d,'userProfileId':_0x510d0d[_0xe911('0x4e')]},'raw':!![]})['then'](function(_0x35612a){if(_0x35612a&&_0x35612a[_0xe911('0x4f')]===0x0){return db[_0xe911('0x50')][_0xe911('0x48')]({'name':_0x3fcf30[_0xe911('0x2a')],'resourceId':_0x3fcf30['id'],'type':_0x35612a[_0xe911('0x2a')],'sectionId':_0x35612a['id']},{})['then'](function(){return _0x28061a;});}else{return _0x28061a;}})['catch'](function(_0x434cc5){logger[_0xe911('0x28')](_0xe911('0x51'),_0x434cc5);throw _0x434cc5;});}return _0x28061a;})['then'](respondWithResult(_0x1b0107,0xc9))[_0xe911('0x44')](handleError(_0x1b0107,null));};exports[_0xe911('0x52')]=function(_0x526d2a,_0x35b1b9){if(_0x526d2a[_0xe911('0x53')]['id']){delete _0x526d2a['body']['id'];}return db[_0xe911('0x42')][_0xe911('0x4d')]({'where':{'id':_0x526d2a[_0xe911('0x46')]['id']}})['then'](handleEntityNotFound(_0x35b1b9,null))[_0xe911('0x23')](saveUpdates(_0x526d2a['body'],null))[_0xe911('0x23')](respondWithResult(_0x35b1b9,null))[_0xe911('0x44')](handleError(_0x35b1b9,null));};exports[_0xe911('0x24')]=function(_0x3b7e79,_0x402faa){return db['Template'][_0xe911('0x4d')]({'where':{'id':_0x3b7e79[_0xe911('0x46')]['id']}})[_0xe911('0x23')](handleEntityNotFound(_0x402faa,null))['then'](removeEntity(_0x402faa,null))[_0xe911('0x44')](handleError(_0x402faa,null));};
\ No newline at end of file
+var _0x4242=['update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','Template','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2722f8,_0x29f1e2){var _0x59c7cc=function(_0x767747){while(--_0x767747){_0x2722f8['push'](_0x2722f8['shift']());}};_0x59c7cc(++_0x29f1e2);}(_0x4242,0x84));var _0x2424=function(_0x557d6b,_0x4b0005){_0x557d6b=_0x557d6b-0x0;var _0x413760=_0x4242[_0x557d6b];return _0x413760;};'use strict';var emlformat=require(_0x2424('0x0'));var rimraf=require(_0x2424('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2424('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2424('0x3'));var Mustache=require(_0x2424('0x4'));var util=require(_0x2424('0x5'));var path=require(_0x2424('0x6'));var sox=require('sox');var csv=require(_0x2424('0x7'));var ejs=require(_0x2424('0x8'));var fs=require('fs');var fs_extra=require(_0x2424('0x9'));var _=require(_0x2424('0xa'));var squel=require(_0x2424('0xb'));var crypto=require(_0x2424('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2424('0xd'));var toCsv=require(_0x2424('0x7'));var querystring=require(_0x2424('0xe'));var Papa=require(_0x2424('0xf'));var Redis=require(_0x2424('0x10'));var authService=require(_0x2424('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2424('0x12'));var logger=require(_0x2424('0x13'))(_0x2424('0x14'));var utils=require(_0x2424('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2424('0x16'));var db=require(_0x2424('0x17'))['db'];function respondWithStatusCode(_0x3fd0e9,_0x3e4089){_0x3e4089=_0x3e4089||0xcc;return function(_0x2286a9){if(_0x2286a9){return _0x3fd0e9[_0x2424('0x18')](_0x3e4089);}return _0x3fd0e9[_0x2424('0x19')](_0x3e4089)['end']();};}function respondWithResult(_0x34b276,_0x37a8f5){_0x37a8f5=_0x37a8f5||0xc8;return function(_0x2acbc4){if(_0x2acbc4){return _0x34b276[_0x2424('0x19')](_0x37a8f5)[_0x2424('0x1a')](_0x2acbc4);}};}function respondWithFilteredResult(_0x298cdc,_0x9315b6){return function(_0x42f585){if(_0x42f585){var _0x348372=typeof _0x9315b6[_0x2424('0x1b')]===_0x2424('0x1c')&&typeof _0x9315b6[_0x2424('0x1d')]===_0x2424('0x1c');var _0x5e7196=_0x42f585[_0x2424('0x1e')];var _0x4b3e05=_0x348372?0x0:_0x9315b6[_0x2424('0x1b')];var _0x570d88=_0x348372?_0x42f585['count']:_0x9315b6[_0x2424('0x1b')]+_0x9315b6[_0x2424('0x1d')];var _0x3433e5;if(_0x570d88>=_0x5e7196){_0x570d88=_0x5e7196;_0x3433e5=0xc8;}else{_0x3433e5=0xce;}_0x298cdc[_0x2424('0x19')](_0x3433e5);return _0x298cdc[_0x2424('0x1f')](_0x2424('0x20'),_0x4b3e05+'-'+_0x570d88+'/'+_0x5e7196)[_0x2424('0x1a')](_0x42f585);}return null;};}function patchUpdates(_0x30495e){return function(_0x38ca8d){try{jsonpatch[_0x2424('0x21')](_0x38ca8d,_0x30495e,!![]);}catch(_0x7452c9){return BPromise[_0x2424('0x22')](_0x7452c9);}return _0x38ca8d[_0x2424('0x23')]();};}function saveUpdates(_0x4a10b0,_0x38a1bc){return function(_0x28561a){if(_0x28561a){return _0x28561a[_0x2424('0x24')](_0x4a10b0)[_0x2424('0x25')](function(_0x358d7e){return _0x358d7e;});}return null;};}function removeEntity(_0x2ac7cf,_0x31865e){return function(_0x41bf23){if(_0x41bf23){return _0x41bf23['destroy']()[_0x2424('0x25')](function(){var _0x2d43ec=_0x41bf23[_0x2424('0x26')]({'plain':!![]});var _0xf6857a='Templates';return db[_0x2424('0x27')][_0x2424('0x28')]({'where':{'type':_0xf6857a,'resourceId':_0x2d43ec['id']}})[_0x2424('0x25')](function(){return _0x41bf23;});})[_0x2424('0x25')](function(){_0x2ac7cf[_0x2424('0x19')](0xcc)[_0x2424('0x29')]();});}};}function handleEntityNotFound(_0x4bf672,_0x498b2d){return function(_0x4e14c4){if(!_0x4e14c4){_0x4bf672[_0x2424('0x18')](0x194);}return _0x4e14c4;};}function handleError(_0x3e45,_0x19ae8a){_0x19ae8a=_0x19ae8a||0x1f4;return function(_0x5d5b00){logger[_0x2424('0x2a')](_0x5d5b00[_0x2424('0x2b')]);if(_0x5d5b00[_0x2424('0x2c')]){delete _0x5d5b00[_0x2424('0x2c')];}_0x3e45[_0x2424('0x19')](_0x19ae8a)[_0x2424('0x2d')](_0x5d5b00);};}exports[_0x2424('0x2e')]=function(_0x51d5c6,_0x331031){var _0x38decd={},_0x27bc6f={},_0x4d4c6d={'count':0x0,'rows':[]};var _0x33ceb5=_['map'](db[_0x2424('0x2f')]['rawAttributes'],function(_0x456b4a){return{'name':_0x456b4a[_0x2424('0x30')],'type':_0x456b4a[_0x2424('0x31')][_0x2424('0x32')]};});_0x27bc6f[_0x2424('0x33')]=_[_0x2424('0x34')](_0x33ceb5,_0x2424('0x2c'));_0x27bc6f[_0x2424('0x35')]=_[_0x2424('0x36')](_0x51d5c6[_0x2424('0x35')]);_0x27bc6f['filters']=_[_0x2424('0x37')](_0x27bc6f['model'],_0x27bc6f[_0x2424('0x35')]);_0x38decd[_0x2424('0x38')]=_[_0x2424('0x37')](_0x27bc6f[_0x2424('0x33')],qs['fields'](_0x51d5c6[_0x2424('0x35')][_0x2424('0x39')]));_0x38decd[_0x2424('0x38')]=_0x38decd[_0x2424('0x38')][_0x2424('0x3a')]?_0x38decd[_0x2424('0x38')]:_0x27bc6f[_0x2424('0x33')];if(!_0x51d5c6[_0x2424('0x35')][_0x2424('0x3b')](_0x2424('0x3c'))){_0x38decd[_0x2424('0x1d')]=qs[_0x2424('0x1d')](_0x51d5c6[_0x2424('0x35')][_0x2424('0x1d')]);_0x38decd[_0x2424('0x1b')]=qs[_0x2424('0x1b')](_0x51d5c6[_0x2424('0x35')][_0x2424('0x1b')]);}_0x38decd['order']=qs['sort'](_0x51d5c6[_0x2424('0x35')]['sort']);_0x38decd[_0x2424('0x3d')]=qs[_0x2424('0x3e')](_[_0x2424('0x3f')](_0x51d5c6[_0x2424('0x35')],_0x27bc6f[_0x2424('0x3e')]),_0x33ceb5);if(_0x51d5c6[_0x2424('0x35')][_0x2424('0x40')]){_0x38decd['where']=_[_0x2424('0x41')](_0x38decd['where'],{'$or':_[_0x2424('0x34')](_0x33ceb5,function(_0x1381cb){if(_0x1381cb[_0x2424('0x31')]!==_0x2424('0x42')){var _0x1c0a48={};_0x1c0a48[_0x1381cb[_0x2424('0x2c')]]={'$like':'%'+_0x51d5c6[_0x2424('0x35')][_0x2424('0x40')]+'%'};return _0x1c0a48;}})});}_0x38decd=_['merge']({},_0x38decd,_0x51d5c6[_0x2424('0x43')]);var _0x38c0db={'where':_0x38decd[_0x2424('0x3d')]};return db[_0x2424('0x2f')]['count'](_0x38c0db)[_0x2424('0x25')](function(_0x4185e3){_0x4d4c6d[_0x2424('0x1e')]=_0x4185e3;if(_0x51d5c6[_0x2424('0x35')][_0x2424('0x44')]){_0x38decd[_0x2424('0x45')]=[{'all':!![]}];}return db[_0x2424('0x2f')][_0x2424('0x46')](_0x38decd);})[_0x2424('0x25')](function(_0x3692d8){_0x4d4c6d[_0x2424('0x47')]=_0x3692d8;return _0x4d4c6d;})[_0x2424('0x25')](respondWithFilteredResult(_0x331031,_0x38decd))[_0x2424('0x48')](handleError(_0x331031,null));};exports[_0x2424('0x49')]=function(_0x4784f2,_0x4a47e8){var _0xceb25f={'raw':!![],'where':{'id':_0x4784f2[_0x2424('0x4a')]['id']}},_0x1616b2={};_0x1616b2['model']=_[_0x2424('0x36')](db[_0x2424('0x2f')]['rawAttributes']);_0x1616b2[_0x2424('0x35')]=_[_0x2424('0x36')](_0x4784f2[_0x2424('0x35')]);_0x1616b2[_0x2424('0x3e')]=_[_0x2424('0x37')](_0x1616b2['model'],_0x1616b2[_0x2424('0x35')]);_0xceb25f[_0x2424('0x38')]=_[_0x2424('0x37')](_0x1616b2['model'],qs[_0x2424('0x39')](_0x4784f2[_0x2424('0x35')][_0x2424('0x39')]));_0xceb25f[_0x2424('0x38')]=_0xceb25f[_0x2424('0x38')][_0x2424('0x3a')]?_0xceb25f[_0x2424('0x38')]:_0x1616b2[_0x2424('0x33')];if(_0x4784f2[_0x2424('0x35')][_0x2424('0x44')]){_0xceb25f['include']=[{'all':!![]}];}_0xceb25f=_['merge']({},_0xceb25f,_0x4784f2[_0x2424('0x43')]);return db['Template'][_0x2424('0x4b')](_0xceb25f)[_0x2424('0x25')](handleEntityNotFound(_0x4a47e8,null))[_0x2424('0x25')](respondWithResult(_0x4a47e8,null))[_0x2424('0x48')](handleError(_0x4a47e8,null));};exports['create']=function(_0x4b115a,_0x3cb7c6){return db['Template'][_0x2424('0x4c')](_0x4b115a['body'],{})[_0x2424('0x25')](function(_0x4522cf){var _0x48f694=_0x4b115a[_0x2424('0x4d')][_0x2424('0x26')]({'plain':!![]});if(!_0x48f694)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48f694[_0x2424('0x4e')]==='user'){var _0x31269c=_0x4522cf[_0x2424('0x26')]({'plain':!![]});var _0x337117='Templates';return db[_0x2424('0x4f')][_0x2424('0x4b')]({'where':{'name':_0x337117,'userProfileId':_0x48f694[_0x2424('0x50')]},'raw':!![]})[_0x2424('0x25')](function(_0x1e7088){if(_0x1e7088&&_0x1e7088[_0x2424('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x31269c[_0x2424('0x2c')],'resourceId':_0x31269c['id'],'type':_0x1e7088['name'],'sectionId':_0x1e7088['id']},{})[_0x2424('0x25')](function(){return _0x4522cf;});}else{return _0x4522cf;}})[_0x2424('0x48')](function(_0x36e239){logger['error'](_0x2424('0x52'),_0x36e239);throw _0x36e239;});}return _0x4522cf;})[_0x2424('0x25')](respondWithResult(_0x3cb7c6,0xc9))[_0x2424('0x48')](handleError(_0x3cb7c6,null));};exports['update']=function(_0x2cf9ec,_0xf4a59c){if(_0x2cf9ec[_0x2424('0x53')]['id']){delete _0x2cf9ec[_0x2424('0x53')]['id'];}return db[_0x2424('0x2f')][_0x2424('0x4b')]({'where':{'id':_0x2cf9ec[_0x2424('0x4a')]['id']}})['then'](handleEntityNotFound(_0xf4a59c,null))['then'](saveUpdates(_0x2cf9ec[_0x2424('0x53')],null))[_0x2424('0x25')](respondWithResult(_0xf4a59c,null))['catch'](handleError(_0xf4a59c,null));};exports[_0x2424('0x28')]=function(_0x2227c7,_0x1e618e){return db[_0x2424('0x2f')]['find']({'where':{'id':_0x2227c7[_0x2424('0x4a')]['id']}})[_0x2424('0x25')](handleEntityNotFound(_0x1e618e,null))[_0x2424('0x25')](removeEntity(_0x1e618e,null))['catch'](handleError(_0x1e618e,null));};
\ No newline at end of file
index bde4449..00d511f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae3=['exports','define','Template','../../config/logger','api','moment','bluebird','request-promise','path','./template.attributes'];(function(_0x1c2051,_0x4cb6b9){var _0x2b58a0=function(_0x4308df){while(--_0x4308df){_0x1c2051['push'](_0x1c2051['shift']());}};_0x2b58a0(++_0x4cb6b9);}(_0xeae3,0x71));var _0x3eae=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xeae3[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3eae('0x0'))(_0x3eae('0x1'));var moment=require(_0x3eae('0x2'));var BPromise=require(_0x3eae('0x3'));var rp=require(_0x3eae('0x4'));var fs=require('fs');var path=require(_0x3eae('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3eae('0x6'));module[_0x3eae('0x7')]=function(_0x46ed48,_0x3aa9f5){return _0x46ed48[_0x3eae('0x8')](_0x3eae('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8823=['bluebird','request-promise','rimraf','../../config/environment','define','Template','lodash','util','../../config/logger','api','moment'];(function(_0x104adf,_0x4be6e6){var _0x49f313=function(_0x43ac73){while(--_0x43ac73){_0x104adf['push'](_0x104adf['shift']());}};_0x49f313(++_0x4be6e6);}(_0x8823,0x1a8));var _0x3882=function(_0x5306e6,_0x97d80){_0x5306e6=_0x5306e6-0x0;var _0x4a448d=_0x8823[_0x5306e6];return _0x4a448d;};'use strict';var _=require(_0x3882('0x0'));var util=require(_0x3882('0x1'));var logger=require(_0x3882('0x2'))(_0x3882('0x3'));var moment=require(_0x3882('0x4'));var BPromise=require(_0x3882('0x5'));var rp=require(_0x3882('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3882('0x7'));var config=require(_0x3882('0x8'));var attributes=require('./template.attributes');module['exports']=function(_0x19deb5,_0xda41a8){return _0x19deb5[_0x3882('0x9')](_0x3882('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ebe96b0..3d46652 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec81=['debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Template,\x20%s,\x20%s','message','result','GetTemplate','findAll','options','raw','attributes','include','model','map','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xec81,0x1d2));var _0x1ec8=function(_0x353247,_0x1466f9){_0x353247=_0x353247-0x0;var _0x45886e=_0xec81[_0x353247];return _0x45886e;};'use strict';var _=require(_0x1ec8('0x0'));var util=require(_0x1ec8('0x1'));var moment=require(_0x1ec8('0x2'));var BPromise=require(_0x1ec8('0x3'));var rs=require(_0x1ec8('0x4'));var fs=require('fs');var Redis=require(_0x1ec8('0x5'));var db=require(_0x1ec8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ec8('0x7'))(_0x1ec8('0x8'));var config=require(_0x1ec8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1ec8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a89b9,_0x28d1ed,_0x18cb4a){return new BPromise(function(_0x1f924b,_0x339825){return client[_0x1ec8('0xb')](_0x3a89b9,_0x18cb4a)[_0x1ec8('0xc')](function(_0x515d31){logger[_0x1ec8('0xd')]('Template,\x20%s,\x20%s',_0x28d1ed,'request\x20sent');logger[_0x1ec8('0xe')](_0x1ec8('0xf'),_0x28d1ed,_0x1ec8('0x10'),JSON['stringify'](_0x515d31));if(_0x515d31[_0x1ec8('0x11')]){if(_0x515d31[_0x1ec8('0x11')][_0x1ec8('0x12')]===0x1f4){logger[_0x1ec8('0x11')](_0x1ec8('0x13'),_0x28d1ed,_0x515d31[_0x1ec8('0x11')][_0x1ec8('0x14')]);return _0x339825(_0x515d31['error'][_0x1ec8('0x14')]);}logger[_0x1ec8('0x11')](_0x1ec8('0x13'),_0x28d1ed,_0x515d31[_0x1ec8('0x11')][_0x1ec8('0x14')]);return _0x1f924b(_0x515d31[_0x1ec8('0x11')][_0x1ec8('0x14')]);}else{logger[_0x1ec8('0xd')](_0x1ec8('0x13'),_0x28d1ed,_0x1ec8('0x10'));_0x1f924b(_0x515d31[_0x1ec8('0x15')]['message']);}})['catch'](function(_0x282523){logger[_0x1ec8('0x11')](_0x1ec8('0x13'),_0x28d1ed,_0x282523);_0x339825(_0x282523);});});}exports[_0x1ec8('0x16')]=function(_0x144351){var _0x44acc7=this;return new Promise(function(_0x245e7d,_0x270d18){return db['Template'][_0x1ec8('0x17')]({'raw':_0x144351[_0x1ec8('0x18')]?_0x144351['options'][_0x1ec8('0x19')]===undefined?!![]:![]:!![],'where':_0x144351[_0x1ec8('0x18')]?_0x144351[_0x1ec8('0x18')]['where']||null:null,'attributes':_0x144351[_0x1ec8('0x18')]?_0x144351['options'][_0x1ec8('0x1a')]||null:null,'limit':_0x144351['options']?_0x144351[_0x1ec8('0x18')]['limit']||null:null,'include':_0x144351['options']?_0x144351[_0x1ec8('0x18')][_0x1ec8('0x1b')]?_['map'](_0x144351['options'][_0x1ec8('0x1b')],function(_0xd9e353){return{'model':db[_0xd9e353[_0x1ec8('0x1c')]],'as':_0xd9e353['as'],'attributes':_0xd9e353[_0x1ec8('0x1a')],'include':_0xd9e353[_0x1ec8('0x1b')]?_[_0x1ec8('0x1d')](_0xd9e353['include'],function(_0x19cb09){return{'model':db[_0x19cb09['model']],'as':_0x19cb09['as'],'attributes':_0x19cb09['attributes'],'include':_0x19cb09[_0x1ec8('0x1b')]?_[_0x1ec8('0x1d')](_0x19cb09[_0x1ec8('0x1b')],function(_0x591bea){return{'model':db[_0x591bea['model']],'as':_0x591bea['as'],'attributes':_0x591bea[_0x1ec8('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40eb68){logger[_0x1ec8('0xd')](_0x1ec8('0x16'),_0x144351);logger['debug'](_0x1ec8('0x16'),_0x144351,JSON[_0x1ec8('0x1e')](_0x40eb68));_0x245e7d(_0x40eb68);})[_0x1ec8('0x1f')](function(_0x3abba0){logger[_0x1ec8('0x11')]('GetTemplate',_0x3abba0['message'],_0x144351);_0x270d18(_0x44acc7[_0x1ec8('0x11')](0x1f4,_0x3abba0['message']));});});};
\ No newline at end of file
+var _0x382a=['attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetTemplate','Template','findAll','raw','options','where'];(function(_0x190c49,_0x103457){var _0x475b9a=function(_0x44f13c){while(--_0x44f13c){_0x190c49['push'](_0x190c49['shift']());}};_0x475b9a(++_0x103457);}(_0x382a,0x91));var _0xa382=function(_0x4baac8,_0x5f1dc7){_0x4baac8=_0x4baac8-0x0;var _0x56ebc5=_0x382a[_0x4baac8];return _0x56ebc5;};'use strict';var _=require(_0xa382('0x0'));var util=require(_0xa382('0x1'));var moment=require(_0xa382('0x2'));var BPromise=require(_0xa382('0x3'));var rs=require(_0xa382('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa382('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa382('0x6'))(_0xa382('0x7'));var config=require(_0xa382('0x8'));var jayson=require(_0xa382('0x9'));var client=jayson['client'][_0xa382('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58abc0,_0x3949b4,_0x3106d6){return new BPromise(function(_0x528919,_0x2a137f){return client[_0xa382('0xb')](_0x58abc0,_0x3106d6)[_0xa382('0xc')](function(_0x1e845c){logger['info'](_0xa382('0xd'),_0x3949b4,'request\x20sent');logger[_0xa382('0xe')](_0xa382('0xf'),_0x3949b4,_0xa382('0x10'),JSON[_0xa382('0x11')](_0x1e845c));if(_0x1e845c[_0xa382('0x12')]){if(_0x1e845c[_0xa382('0x12')][_0xa382('0x13')]===0x1f4){logger['error'](_0xa382('0xd'),_0x3949b4,_0x1e845c[_0xa382('0x12')][_0xa382('0x14')]);return _0x2a137f(_0x1e845c[_0xa382('0x12')]['message']);}logger[_0xa382('0x12')]('Template,\x20%s,\x20%s',_0x3949b4,_0x1e845c['error'][_0xa382('0x14')]);return _0x528919(_0x1e845c[_0xa382('0x12')][_0xa382('0x14')]);}else{logger[_0xa382('0x15')](_0xa382('0xd'),_0x3949b4,_0xa382('0x10'));_0x528919(_0x1e845c[_0xa382('0x16')][_0xa382('0x14')]);}})[_0xa382('0x17')](function(_0x55c584){logger[_0xa382('0x12')](_0xa382('0xd'),_0x3949b4,_0x55c584);_0x2a137f(_0x55c584);});});}exports[_0xa382('0x18')]=function(_0x4e7e19){var _0x23431c=this;return new Promise(function(_0x610a06,_0x21262d){return db[_0xa382('0x19')][_0xa382('0x1a')]({'raw':_0x4e7e19['options']?_0x4e7e19['options'][_0xa382('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e7e19[_0xa382('0x1c')]?_0x4e7e19[_0xa382('0x1c')][_0xa382('0x1d')]||null:null,'attributes':_0x4e7e19[_0xa382('0x1c')]?_0x4e7e19[_0xa382('0x1c')][_0xa382('0x1e')]||null:null,'limit':_0x4e7e19[_0xa382('0x1c')]?_0x4e7e19[_0xa382('0x1c')][_0xa382('0x1f')]||null:null,'include':_0x4e7e19[_0xa382('0x1c')]?_0x4e7e19[_0xa382('0x1c')][_0xa382('0x20')]?_[_0xa382('0x21')](_0x4e7e19[_0xa382('0x1c')][_0xa382('0x20')],function(_0x382c7e){return{'model':db[_0x382c7e[_0xa382('0x22')]],'as':_0x382c7e['as'],'attributes':_0x382c7e[_0xa382('0x1e')],'include':_0x382c7e[_0xa382('0x20')]?_[_0xa382('0x21')](_0x382c7e['include'],function(_0x46e8fc){return{'model':db[_0x46e8fc[_0xa382('0x22')]],'as':_0x46e8fc['as'],'attributes':_0x46e8fc['attributes'],'include':_0x46e8fc[_0xa382('0x20')]?_[_0xa382('0x21')](_0x46e8fc[_0xa382('0x20')],function(_0xa4e0f5){return{'model':db[_0xa4e0f5[_0xa382('0x22')]],'as':_0xa4e0f5['as'],'attributes':_0xa4e0f5[_0xa382('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa382('0xc')](function(_0x5c9a6a){logger['info']('GetTemplate',_0x4e7e19);logger['debug'](_0xa382('0x18'),_0x4e7e19,JSON[_0xa382('0x11')](_0x5c9a6a));_0x610a06(_0x5c9a6a);})['catch'](function(_0x565a21){logger[_0xa382('0x12')](_0xa382('0x18'),_0x565a21[_0xa382('0x14')],_0x4e7e19);_0x21262d(_0x23431c[_0xa382('0x12')](0x1f4,_0x565a21[_0xa382('0x14')]));});});};
\ No newline at end of file
index 3d94256..dc35772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4091=['../../config/environment','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','put','update','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x217ae5,_0x5fe8df){var _0x1e9d49=function(_0x5e6a37){while(--_0x5e6a37){_0x217ae5['push'](_0x217ae5['shift']());}};_0x1e9d49(++_0x5fe8df);}(_0x4091,0x181));var _0x1409=function(_0xd57022,_0x1342d6){_0xd57022=_0xd57022-0x0;var _0x541170=_0x4091[_0xd57022];return _0x541170;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1409('0x0'));var timeout=require(_0x1409('0x1'));var express=require(_0x1409('0x2'));var router=express['Router']();var fs_extra=require(_0x1409('0x3'));var auth=require(_0x1409('0x4'));var interaction=require(_0x1409('0x5'));var config=require(_0x1409('0x6'));var controller=require('./trigger.controller');router[_0x1409('0x7')]('/',auth[_0x1409('0x8')](),controller[_0x1409('0x9')]);router[_0x1409('0x7')](_0x1409('0xa'),auth[_0x1409('0x8')](),controller[_0x1409('0xb')]);router[_0x1409('0x7')]('/:id/all_conditions',auth[_0x1409('0x8')](),controller[_0x1409('0xc')]);router['get'](_0x1409('0xd'),auth[_0x1409('0x8')](),controller['getAnyConditions']);router['get'](_0x1409('0xe'),auth[_0x1409('0x8')](),controller[_0x1409('0xf')]);router['post']('/',auth[_0x1409('0x8')](),controller[_0x1409('0x10')]);router[_0x1409('0x11')]('/:id/all_conditions',auth[_0x1409('0x8')](),controller[_0x1409('0x12')]);router[_0x1409('0x11')](_0x1409('0xd'),auth[_0x1409('0x8')](),controller[_0x1409('0x13')]);router[_0x1409('0x11')](_0x1409('0xe'),auth[_0x1409('0x8')](),controller['addAction']);router[_0x1409('0x14')](_0x1409('0xa'),auth[_0x1409('0x8')](),controller[_0x1409('0x15')]);router['delete']('/:id',auth[_0x1409('0x8')](),controller['destroy']);module[_0x1409('0x16')]=router;
\ No newline at end of file
+var _0x29ce=['getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id'];(function(_0x1058f7,_0x4fe464){var _0x422ecc=function(_0x496c6e){while(--_0x496c6e){_0x1058f7['push'](_0x1058f7['shift']());}};_0x422ecc(++_0x4fe464);}(_0x29ce,0x1e7));var _0xe29c=function(_0xa00bb1,_0x4af667){_0xa00bb1=_0xa00bb1-0x0;var _0xdfcf10=_0x29ce[_0xa00bb1];return _0xdfcf10;};'use strict';var multer=require(_0xe29c('0x0'));var util=require(_0xe29c('0x1'));var path=require(_0xe29c('0x2'));var timeout=require(_0xe29c('0x3'));var express=require(_0xe29c('0x4'));var router=express['Router']();var fs_extra=require(_0xe29c('0x5'));var auth=require(_0xe29c('0x6'));var interaction=require(_0xe29c('0x7'));var config=require(_0xe29c('0x8'));var controller=require(_0xe29c('0x9'));router[_0xe29c('0xa')]('/',auth[_0xe29c('0xb')](),controller['index']);router[_0xe29c('0xa')](_0xe29c('0xc'),auth[_0xe29c('0xb')](),controller['show']);router[_0xe29c('0xa')]('/:id/all_conditions',auth[_0xe29c('0xb')](),controller[_0xe29c('0xd')]);router[_0xe29c('0xa')](_0xe29c('0xe'),auth['isAuthenticated'](),controller[_0xe29c('0xf')]);router['get'](_0xe29c('0x10'),auth[_0xe29c('0xb')](),controller[_0xe29c('0x11')]);router[_0xe29c('0x12')]('/',auth[_0xe29c('0xb')](),controller[_0xe29c('0x13')]);router[_0xe29c('0x12')]('/:id/all_conditions',auth[_0xe29c('0xb')](),controller['addAllCondition']);router['post'](_0xe29c('0xe'),auth[_0xe29c('0xb')](),controller[_0xe29c('0x14')]);router['post'](_0xe29c('0x10'),auth[_0xe29c('0xb')](),controller[_0xe29c('0x15')]);router['put'](_0xe29c('0xc'),auth[_0xe29c('0xb')](),controller[_0xe29c('0x16')]);router['delete']('/:id',auth[_0xe29c('0xb')](),controller[_0xe29c('0x17')]);module[_0xe29c('0x18')]=router;
\ No newline at end of file
index 0d540eb..fa37902 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe996=['STRING','sequelize'];(function(_0x2073f8,_0x34a29d){var _0x11c069=function(_0x1c49ab){while(--_0x1c49ab){_0x2073f8['push'](_0x2073f8['shift']());}};_0x11c069(++_0x34a29d);}(_0xe996,0x95));var _0x6e99=function(_0x3ffac2,_0x17a6f8){_0x3ffac2=_0x3ffac2-0x0;var _0x2a9b02=_0xe996[_0x3ffac2];return _0x2a9b02;};'use strict';var Sequelize=require(_0x6e99('0x0'));module['exports']={'name':{'type':Sequelize[_0x6e99('0x1')]},'channel':{'type':Sequelize[_0x6e99('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbebd=['exports','STRING','BOOLEAN','sequelize'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0xbebd,0x1ab));var _0xdbeb=function(_0x593ccb,_0x5c2980){_0x593ccb=_0x593ccb-0x0;var _0x31a993=_0xbebd[_0x593ccb];return _0x31a993;};'use strict';var Sequelize=require(_0xdbeb('0x0'));module[_0xdbeb('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdbeb('0x2')]},'description':{'type':Sequelize[_0xdbeb('0x2')]},'status':{'type':Sequelize[_0xdbeb('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 5917c37..bfa1b09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6141=['include','rows','catch','show','params','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','getAnyConditions','findOne','TriggerId','Action','getActions','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6141,0x1a4));var _0x1614=function(_0x1b8803,_0x23ea02){_0x1b8803=_0x1b8803-0x0;var _0x11905d=_0x6141[_0x1b8803];return _0x11905d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1614('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1614('0x1'));var moment=require(_0x1614('0x2'));var BPromise=require(_0x1614('0x3'));var Mustache=require(_0x1614('0x4'));var util=require(_0x1614('0x5'));var path=require(_0x1614('0x6'));var sox=require(_0x1614('0x7'));var csv=require(_0x1614('0x8'));var ejs=require(_0x1614('0x9'));var fs=require('fs');var fs_extra=require(_0x1614('0xa'));var _=require(_0x1614('0xb'));var squel=require(_0x1614('0xc'));var crypto=require(_0x1614('0xd'));var jsforce=require(_0x1614('0xe'));var deskjs=require(_0x1614('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1614('0x10'));var Papa=require(_0x1614('0x11'));var Redis=require(_0x1614('0x12'));var authService=require(_0x1614('0x13'));var qs=require(_0x1614('0x14'));var as=require(_0x1614('0x15'));var hardwareService=require(_0x1614('0x16'));var logger=require(_0x1614('0x17'))(_0x1614('0x18'));var utils=require(_0x1614('0x19'));var config=require(_0x1614('0x1a'));var licenseUtil=require(_0x1614('0x1b'));var db=require(_0x1614('0x1c'))['db'];function respondWithStatusCode(_0x290b87,_0x8972d0){_0x8972d0=_0x8972d0||0xcc;return function(_0x1040fc){if(_0x1040fc){return _0x290b87[_0x1614('0x1d')](_0x8972d0);}return _0x290b87[_0x1614('0x1e')](_0x8972d0)[_0x1614('0x1f')]();};}function respondWithResult(_0x32e7d2,_0x113785){_0x113785=_0x113785||0xc8;return function(_0x273e17){if(_0x273e17){return _0x32e7d2[_0x1614('0x1e')](_0x113785)[_0x1614('0x20')](_0x273e17);}};}function respondWithFilteredResult(_0x1073f7,_0x31f7ed){return function(_0x20c892){if(_0x20c892){var _0x1957fe=typeof _0x31f7ed['offset']===_0x1614('0x21')&&typeof _0x31f7ed[_0x1614('0x22')]===_0x1614('0x21');var _0x21a274=_0x20c892[_0x1614('0x23')];var _0x2c4a9e=_0x1957fe?0x0:_0x31f7ed[_0x1614('0x24')];var _0x5d2b66=_0x1957fe?_0x20c892['count']:_0x31f7ed[_0x1614('0x24')]+_0x31f7ed['limit'];var _0x55716c;if(_0x5d2b66>=_0x21a274){_0x5d2b66=_0x21a274;_0x55716c=0xc8;}else{_0x55716c=0xce;}_0x1073f7[_0x1614('0x1e')](_0x55716c);return _0x1073f7[_0x1614('0x25')](_0x1614('0x26'),_0x2c4a9e+'-'+_0x5d2b66+'/'+_0x21a274)[_0x1614('0x20')](_0x20c892);}return null;};}function patchUpdates(_0x36c52f){return function(_0x12ff8b){try{jsonpatch[_0x1614('0x27')](_0x12ff8b,_0x36c52f,!![]);}catch(_0x2dd715){return BPromise[_0x1614('0x28')](_0x2dd715);}return _0x12ff8b[_0x1614('0x29')]();};}function saveUpdates(_0x1603de,_0x3ea495){return function(_0x2df13d){if(_0x2df13d){return _0x2df13d[_0x1614('0x2a')](_0x1603de)['then'](function(_0x912116){return _0x912116;});}return null;};}function removeEntity(_0x36cf9f,_0x478f2e){return function(_0x376f7e){if(_0x376f7e){return _0x376f7e[_0x1614('0x2b')]()[_0x1614('0x2c')](function(){var _0xd32f7e=_0x376f7e[_0x1614('0x2d')]({'plain':!![]});var _0x5d3bd2=_0x1614('0x2e');return db[_0x1614('0x2f')][_0x1614('0x2b')]({'where':{'type':_0x5d3bd2,'resourceId':_0xd32f7e['id']}})['then'](function(){return _0x376f7e;});})[_0x1614('0x2c')](function(){_0x36cf9f['status'](0xcc)[_0x1614('0x1f')]();});}};}function handleEntityNotFound(_0x5b768d,_0x2d27c4){return function(_0x560e7d){if(!_0x560e7d){_0x5b768d[_0x1614('0x1d')](0x194);}return _0x560e7d;};}function handleError(_0xfc0d7c,_0x34c692){_0x34c692=_0x34c692||0x1f4;return function(_0x1eb17f){logger[_0x1614('0x30')](_0x1eb17f[_0x1614('0x31')]);if(_0x1eb17f[_0x1614('0x32')]){delete _0x1eb17f['name'];}_0xfc0d7c[_0x1614('0x1e')](_0x34c692)[_0x1614('0x33')](_0x1eb17f);};}exports[_0x1614('0x34')]=function(_0x33b925,_0x28f248){var _0x9c8fd8={},_0x105b86={},_0x5dee81={'count':0x0,'rows':[]};var _0x2a046a=_[_0x1614('0x35')](db[_0x1614('0x36')][_0x1614('0x37')],function(_0x493df7){return{'name':_0x493df7['fieldName'],'type':_0x493df7[_0x1614('0x38')][_0x1614('0x39')]};});_0x105b86['model']=_[_0x1614('0x35')](_0x2a046a,'name');_0x105b86[_0x1614('0x3a')]=_[_0x1614('0x3b')](_0x33b925[_0x1614('0x3a')]);_0x105b86[_0x1614('0x3c')]=_[_0x1614('0x3d')](_0x105b86[_0x1614('0x3e')],_0x105b86[_0x1614('0x3a')]);_0x9c8fd8[_0x1614('0x3f')]=_[_0x1614('0x3d')](_0x105b86[_0x1614('0x3e')],qs['fields'](_0x33b925[_0x1614('0x3a')][_0x1614('0x40')]));_0x9c8fd8[_0x1614('0x3f')]=_0x9c8fd8[_0x1614('0x3f')]['length']?_0x9c8fd8[_0x1614('0x3f')]:_0x105b86['model'];if(!_0x33b925['query'][_0x1614('0x41')](_0x1614('0x42'))){_0x9c8fd8[_0x1614('0x22')]=qs[_0x1614('0x22')](_0x33b925[_0x1614('0x3a')][_0x1614('0x22')]);_0x9c8fd8[_0x1614('0x24')]=qs['offset'](_0x33b925[_0x1614('0x3a')][_0x1614('0x24')]);}_0x9c8fd8[_0x1614('0x43')]=qs[_0x1614('0x44')](_0x33b925['query'][_0x1614('0x44')]);_0x9c8fd8[_0x1614('0x45')]=qs['filters'](_[_0x1614('0x46')](_0x33b925['query'],_0x105b86[_0x1614('0x3c')]),_0x2a046a);if(_0x33b925[_0x1614('0x3a')]['filter']){_0x9c8fd8[_0x1614('0x45')]=_['merge'](_0x9c8fd8[_0x1614('0x45')],{'$or':_[_0x1614('0x35')](_0x2a046a,function(_0x285f7e){if(_0x285f7e[_0x1614('0x38')]!==_0x1614('0x47')){var _0x52760d={};_0x52760d[_0x285f7e[_0x1614('0x32')]]={'$like':'%'+_0x33b925['query'][_0x1614('0x48')]+'%'};return _0x52760d;}})});}_0x9c8fd8=_['merge']({},_0x9c8fd8,_0x33b925[_0x1614('0x49')]);var _0x4db788={'where':_0x9c8fd8[_0x1614('0x45')]};return db['Trigger']['count'](_0x4db788)[_0x1614('0x2c')](function(_0xc39a73){_0x5dee81['count']=_0xc39a73;if(_0x33b925['query'][_0x1614('0x4a')]){_0x9c8fd8[_0x1614('0x4b')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x9c8fd8);})['then'](function(_0xdc0cc9){_0x5dee81[_0x1614('0x4c')]=_0xdc0cc9;return _0x5dee81;})[_0x1614('0x2c')](respondWithFilteredResult(_0x28f248,_0x9c8fd8))[_0x1614('0x4d')](handleError(_0x28f248,null));};exports[_0x1614('0x4e')]=function(_0x54826b,_0x5539bd){var _0x1b77b6={'raw':![],'where':{'id':_0x54826b[_0x1614('0x4f')]['id']}},_0x1fab84={};_0x1fab84[_0x1614('0x3e')]=_['keys'](db['Trigger'][_0x1614('0x37')]);_0x1fab84[_0x1614('0x3a')]=_['keys'](_0x54826b[_0x1614('0x3a')]);_0x1fab84[_0x1614('0x3c')]=_[_0x1614('0x3d')](_0x1fab84['model'],_0x1fab84[_0x1614('0x3a')]);_0x1b77b6[_0x1614('0x3f')]=_['intersection'](_0x1fab84['model'],qs['fields'](_0x54826b[_0x1614('0x3a')][_0x1614('0x40')]));_0x1b77b6[_0x1614('0x3f')]=_0x1b77b6[_0x1614('0x3f')][_0x1614('0x50')]?_0x1b77b6[_0x1614('0x3f')]:_0x1fab84['model'];if(_0x54826b[_0x1614('0x3a')][_0x1614('0x4a')]){_0x1b77b6[_0x1614('0x4b')]=[{'all':!![]}];}_0x1b77b6=_[_0x1614('0x51')]({},_0x1b77b6,_0x54826b[_0x1614('0x49')]);return db['Trigger']['find'](_0x1b77b6)[_0x1614('0x2c')](handleEntityNotFound(_0x5539bd,null))['then'](respondWithResult(_0x5539bd,null))['catch'](handleError(_0x5539bd,null));};exports['create']=function(_0x186224,_0x2c929b){return db['Trigger'][_0x1614('0x52')](_0x186224[_0x1614('0x53')],{})[_0x1614('0x2c')](function(_0x1e5981){var _0x1d1a91=_0x186224[_0x1614('0x54')]['get']({'plain':!![]});if(!_0x1d1a91)throw new Error(_0x1614('0x55'));if(_0x1d1a91['role']===_0x1614('0x54')){var _0x441854=_0x1e5981[_0x1614('0x2d')]({'plain':!![]});var _0x567045='Triggers';return db['UserProfileSection'][_0x1614('0x56')]({'where':{'name':_0x567045,'userProfileId':_0x1d1a91[_0x1614('0x57')]},'raw':!![]})[_0x1614('0x2c')](function(_0x8e8b2c){if(_0x8e8b2c&&_0x8e8b2c[_0x1614('0x58')]===0x0){return db[_0x1614('0x2f')][_0x1614('0x52')]({'name':_0x441854[_0x1614('0x32')],'resourceId':_0x441854['id'],'type':_0x8e8b2c[_0x1614('0x32')],'sectionId':_0x8e8b2c['id']},{})[_0x1614('0x2c')](function(){return _0x1e5981;});}else{return _0x1e5981;}})[_0x1614('0x4d')](function(_0x2a8fc1){logger[_0x1614('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a8fc1);throw _0x2a8fc1;});}return _0x1e5981;})[_0x1614('0x2c')](respondWithResult(_0x2c929b,0xc9))['catch'](handleError(_0x2c929b,null));};exports[_0x1614('0x2a')]=function(_0x902a7c,_0x399ab7){if(_0x902a7c[_0x1614('0x53')]['id']){delete _0x902a7c[_0x1614('0x53')]['id'];}return db['Trigger'][_0x1614('0x56')]({'where':{'id':_0x902a7c['params']['id']}})['then'](handleEntityNotFound(_0x399ab7,null))['then'](saveUpdates(_0x902a7c[_0x1614('0x53')],null))[_0x1614('0x2c')](respondWithResult(_0x399ab7,null))[_0x1614('0x4d')](handleError(_0x399ab7,null));};exports['destroy']=function(_0x2b0e62,_0x38bfd1){return db[_0x1614('0x36')][_0x1614('0x56')]({'where':{'id':_0x2b0e62[_0x1614('0x4f')]['id']}})[_0x1614('0x2c')](handleEntityNotFound(_0x38bfd1,null))[_0x1614('0x2c')](removeEntity(_0x38bfd1,null))[_0x1614('0x4d')](handleError(_0x38bfd1,null));};exports[_0x1614('0x59')]=function(_0x11fc20,_0x365df5,_0x261333){if(_0x11fc20['body']['id']){delete _0x11fc20[_0x1614('0x53')]['id'];}return db[_0x1614('0x36')][_0x1614('0x56')]({'where':{'id':_0x11fc20['params']['id']}})[_0x1614('0x2c')](handleEntityNotFound(_0x365df5,null))[_0x1614('0x2c')](function(_0x51ac01){if(_0x51ac01){_0x11fc20[_0x1614('0x53')][_0x1614('0x5a')]=_0x51ac01['id'];return db[_0x1614('0x5b')][_0x1614('0x52')](_0x11fc20[_0x1614('0x53')]);}})[_0x1614('0x2c')](respondWithResult(_0x365df5,null))[_0x1614('0x4d')](handleError(_0x365df5,null));};exports[_0x1614('0x5c')]=function(_0x23d752,_0x55f4c4,_0x59611f){if(_0x23d752[_0x1614('0x53')]['id']){delete _0x23d752[_0x1614('0x53')]['id'];}return db[_0x1614('0x36')][_0x1614('0x56')]({'where':{'id':_0x23d752[_0x1614('0x4f')]['id']}})[_0x1614('0x2c')](handleEntityNotFound(_0x55f4c4,null))[_0x1614('0x2c')](function(_0x91d46d){if(_0x91d46d){_0x23d752['body']['TriggerAnyId']=_0x91d46d['id'];return db['Condition'][_0x1614('0x52')](_0x23d752[_0x1614('0x53')]);}})['then'](respondWithResult(_0x55f4c4,null))[_0x1614('0x4d')](handleError(_0x55f4c4,null));};exports[_0x1614('0x5d')]=function(_0x2d3f97,_0x34d452,_0x5e0faa){var _0x424d6e={};var _0x1e702e={};var _0x3a8e27;var _0x18943b;return db[_0x1614('0x36')]['findOne']({'where':{'id':_0x2d3f97[_0x1614('0x4f')]['id']}})['then'](handleEntityNotFound(_0x34d452,null))[_0x1614('0x2c')](function(_0x5c09ed){if(_0x5c09ed){_0x3a8e27=_0x5c09ed;_0x1e702e[_0x1614('0x3e')]=_['keys'](db['Condition'][_0x1614('0x37')]);_0x1e702e[_0x1614('0x3a')]=_[_0x1614('0x3b')](_0x2d3f97[_0x1614('0x3a')]);_0x1e702e[_0x1614('0x3c')]=_['intersection'](_0x1e702e[_0x1614('0x3e')],_0x1e702e[_0x1614('0x3a')]);_0x424d6e[_0x1614('0x3f')]=_[_0x1614('0x3d')](_0x1e702e[_0x1614('0x3e')],qs[_0x1614('0x40')](_0x2d3f97['query']['fields']));_0x424d6e[_0x1614('0x3f')]=_0x424d6e['attributes'][_0x1614('0x50')]?_0x424d6e[_0x1614('0x3f')]:_0x1e702e['model'];_0x424d6e['order']=qs[_0x1614('0x44')](_0x2d3f97[_0x1614('0x3a')][_0x1614('0x44')]);_0x424d6e['where']=qs[_0x1614('0x3c')](_[_0x1614('0x46')](_0x2d3f97[_0x1614('0x3a')],_0x1e702e[_0x1614('0x3c')]));if(_0x2d3f97[_0x1614('0x3a')][_0x1614('0x48')]){_0x424d6e[_0x1614('0x45')]=_[_0x1614('0x51')](_0x424d6e[_0x1614('0x45')],{'$or':_[_0x1614('0x35')](_0x424d6e[_0x1614('0x3f')],function(_0x1a55a6){var _0x23d078={};_0x23d078[_0x1a55a6]={'$like':'%'+_0x2d3f97['query'][_0x1614('0x48')]+'%'};return _0x23d078;})});}_0x424d6e=_[_0x1614('0x51')]({},_0x424d6e,_0x2d3f97[_0x1614('0x49')]);return _0x3a8e27[_0x1614('0x5d')](_0x424d6e);}})[_0x1614('0x2c')](function(_0x17b967){if(_0x17b967){_0x18943b=_0x17b967['length'];if(!_0x2d3f97[_0x1614('0x3a')][_0x1614('0x41')]('nolimit')){_0x424d6e[_0x1614('0x22')]=qs[_0x1614('0x22')](_0x2d3f97['query'][_0x1614('0x22')]);_0x424d6e[_0x1614('0x24')]=qs[_0x1614('0x24')](_0x2d3f97[_0x1614('0x3a')][_0x1614('0x24')]);}return _0x3a8e27['getAllConditions'](_0x424d6e);}})[_0x1614('0x2c')](function(_0xc7c86b){if(_0xc7c86b){return _0xc7c86b?{'count':_0x18943b,'rows':_0xc7c86b}:null;}})[_0x1614('0x2c')](respondWithResult(_0x34d452,null))[_0x1614('0x4d')](handleError(_0x34d452,null));};exports[_0x1614('0x5e')]=function(_0x5029c3,_0x502c3e,_0x454b86){var _0x4c1c1c={};var _0x55827b={};var _0xc50e0f;var _0x46e934;return db[_0x1614('0x36')][_0x1614('0x5f')]({'where':{'id':_0x5029c3['params']['id']}})[_0x1614('0x2c')](handleEntityNotFound(_0x502c3e,null))[_0x1614('0x2c')](function(_0x96c8af){if(_0x96c8af){_0xc50e0f=_0x96c8af;_0x55827b['model']=_['keys'](db[_0x1614('0x5b')][_0x1614('0x37')]);_0x55827b[_0x1614('0x3a')]=_[_0x1614('0x3b')](_0x5029c3[_0x1614('0x3a')]);_0x55827b[_0x1614('0x3c')]=_['intersection'](_0x55827b[_0x1614('0x3e')],_0x55827b['query']);_0x4c1c1c['attributes']=_[_0x1614('0x3d')](_0x55827b[_0x1614('0x3e')],qs['fields'](_0x5029c3['query'][_0x1614('0x40')]));_0x4c1c1c['attributes']=_0x4c1c1c['attributes']['length']?_0x4c1c1c['attributes']:_0x55827b[_0x1614('0x3e')];_0x4c1c1c[_0x1614('0x43')]=qs[_0x1614('0x44')](_0x5029c3[_0x1614('0x3a')][_0x1614('0x44')]);_0x4c1c1c[_0x1614('0x45')]=qs[_0x1614('0x3c')](_[_0x1614('0x46')](_0x5029c3[_0x1614('0x3a')],_0x55827b[_0x1614('0x3c')]));if(_0x5029c3[_0x1614('0x3a')][_0x1614('0x48')]){_0x4c1c1c[_0x1614('0x45')]=_['merge'](_0x4c1c1c[_0x1614('0x45')],{'$or':_[_0x1614('0x35')](_0x4c1c1c['attributes'],function(_0x8f97a8){var _0x2b53c7={};_0x2b53c7[_0x8f97a8]={'$like':'%'+_0x5029c3[_0x1614('0x3a')]['filter']+'%'};return _0x2b53c7;})});}_0x4c1c1c=_['merge']({},_0x4c1c1c,_0x5029c3[_0x1614('0x49')]);return _0xc50e0f[_0x1614('0x5e')](_0x4c1c1c);}})[_0x1614('0x2c')](function(_0x20870b){if(_0x20870b){_0x46e934=_0x20870b[_0x1614('0x50')];if(!_0x5029c3[_0x1614('0x3a')]['hasOwnProperty'](_0x1614('0x42'))){_0x4c1c1c[_0x1614('0x22')]=qs['limit'](_0x5029c3['query'][_0x1614('0x22')]);_0x4c1c1c['offset']=qs[_0x1614('0x24')](_0x5029c3[_0x1614('0x3a')][_0x1614('0x24')]);}return _0xc50e0f['getAnyConditions'](_0x4c1c1c);}})['then'](function(_0x3c3eda){if(_0x3c3eda){return _0x3c3eda?{'count':_0x46e934,'rows':_0x3c3eda}:null;}})[_0x1614('0x2c')](respondWithResult(_0x502c3e,null))[_0x1614('0x4d')](handleError(_0x502c3e,null));};exports['addAction']=function(_0x55c381,_0x4d4727,_0x3bc04c){if(_0x55c381[_0x1614('0x53')]['id']){delete _0x55c381[_0x1614('0x53')]['id'];}return db['Trigger']['find']({'where':{'id':_0x55c381[_0x1614('0x4f')]['id']}})[_0x1614('0x2c')](handleEntityNotFound(_0x4d4727,null))[_0x1614('0x2c')](function(_0x329046){if(_0x329046){_0x55c381[_0x1614('0x53')][_0x1614('0x60')]=_0x329046['id'];return db[_0x1614('0x61')][_0x1614('0x52')](_0x55c381[_0x1614('0x53')]);}})[_0x1614('0x2c')](respondWithResult(_0x4d4727,null))['catch'](handleError(_0x4d4727,null));};exports['getActions']=function(_0x23cf0d,_0x497a95,_0x30f133){var _0x18496c={};var _0x4ec2be={};var _0x17bf42;var _0x279b1c;return db[_0x1614('0x36')][_0x1614('0x5f')]({'where':{'id':_0x23cf0d[_0x1614('0x4f')]['id']}})['then'](handleEntityNotFound(_0x497a95,null))[_0x1614('0x2c')](function(_0x529ba2){if(_0x529ba2){_0x17bf42=_0x529ba2;_0x4ec2be[_0x1614('0x3e')]=_['keys'](db['Action'][_0x1614('0x37')]);_0x4ec2be['query']=_[_0x1614('0x3b')](_0x23cf0d[_0x1614('0x3a')]);_0x4ec2be['filters']=_['intersection'](_0x4ec2be['model'],_0x4ec2be[_0x1614('0x3a')]);_0x18496c['attributes']=_[_0x1614('0x3d')](_0x4ec2be[_0x1614('0x3e')],qs[_0x1614('0x40')](_0x23cf0d[_0x1614('0x3a')][_0x1614('0x40')]));_0x18496c['attributes']=_0x18496c[_0x1614('0x3f')][_0x1614('0x50')]?_0x18496c[_0x1614('0x3f')]:_0x4ec2be[_0x1614('0x3e')];_0x18496c[_0x1614('0x43')]=qs[_0x1614('0x44')](_0x23cf0d['query']['sort']);_0x18496c[_0x1614('0x45')]=qs[_0x1614('0x3c')](_[_0x1614('0x46')](_0x23cf0d['query'],_0x4ec2be[_0x1614('0x3c')]));if(_0x23cf0d[_0x1614('0x3a')]['filter']){_0x18496c[_0x1614('0x45')]=_[_0x1614('0x51')](_0x18496c[_0x1614('0x45')],{'$or':_['map'](_0x18496c[_0x1614('0x3f')],function(_0x2cb44a){var _0x4155ac={};_0x4155ac[_0x2cb44a]={'$like':'%'+_0x23cf0d[_0x1614('0x3a')]['filter']+'%'};return _0x4155ac;})});}_0x18496c=_[_0x1614('0x51')]({},_0x18496c,_0x23cf0d[_0x1614('0x49')]);return _0x17bf42[_0x1614('0x62')](_0x18496c);}})[_0x1614('0x2c')](function(_0x7238e1){if(_0x7238e1){_0x279b1c=_0x7238e1[_0x1614('0x50')];if(!_0x23cf0d['query'][_0x1614('0x41')](_0x1614('0x42'))){_0x18496c[_0x1614('0x22')]=qs[_0x1614('0x22')](_0x23cf0d[_0x1614('0x3a')]['limit']);_0x18496c[_0x1614('0x24')]=qs[_0x1614('0x24')](_0x23cf0d[_0x1614('0x3a')][_0x1614('0x24')]);}return _0x17bf42[_0x1614('0x62')](_0x18496c);}})['then'](function(_0x557d2d){if(_0x557d2d){return _0x557d2d?{'count':_0x279b1c,'rows':_0x557d2d}:null;}})['then'](respondWithResult(_0x497a95,null))['catch'](handleError(_0x497a95,null));};
\ No newline at end of file
+var _0xd4d9=['getAllConditions','nolimit','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','end','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','pick'];(function(_0x36ee10,_0x3e4e4b){var _0x1ae7e8=function(_0x138916){while(--_0x138916){_0x36ee10['push'](_0x36ee10['shift']());}};_0x1ae7e8(++_0x3e4e4b);}(_0xd4d9,0x12c));var _0x9d4d=function(_0x239bb2,_0xcf6e14){_0x239bb2=_0x239bb2-0x0;var _0x4c8df2=_0xd4d9[_0x239bb2];return _0x4c8df2;};'use strict';var emlformat=require(_0x9d4d('0x0'));var rimraf=require(_0x9d4d('0x1'));var zipdir=require(_0x9d4d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9d4d('0x3'));var BPromise=require(_0x9d4d('0x4'));var Mustache=require(_0x9d4d('0x5'));var util=require(_0x9d4d('0x6'));var path=require('path');var sox=require(_0x9d4d('0x7'));var csv=require(_0x9d4d('0x8'));var ejs=require(_0x9d4d('0x9'));var fs=require('fs');var fs_extra=require(_0x9d4d('0xa'));var _=require(_0x9d4d('0xb'));var squel=require(_0x9d4d('0xc'));var crypto=require('crypto');var jsforce=require(_0x9d4d('0xd'));var deskjs=require(_0x9d4d('0xe'));var toCsv=require(_0x9d4d('0x8'));var querystring=require(_0x9d4d('0xf'));var Papa=require(_0x9d4d('0x10'));var Redis=require(_0x9d4d('0x11'));var authService=require(_0x9d4d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9d4d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d4d('0x14'))('api');var utils=require(_0x9d4d('0x15'));var config=require(_0x9d4d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d4d('0x17'))['db'];function respondWithStatusCode(_0x5034ac,_0x4fed7b){_0x4fed7b=_0x4fed7b||0xcc;return function(_0xeaf9fc){if(_0xeaf9fc){return _0x5034ac[_0x9d4d('0x18')](_0x4fed7b);}return _0x5034ac['status'](_0x4fed7b)['end']();};}function respondWithResult(_0x42eed9,_0x58f919){_0x58f919=_0x58f919||0xc8;return function(_0x352027){if(_0x352027){return _0x42eed9[_0x9d4d('0x19')](_0x58f919)[_0x9d4d('0x1a')](_0x352027);}};}function respondWithFilteredResult(_0x149ec1,_0x4087a1){return function(_0x26c337){if(_0x26c337){var _0x3249ea=typeof _0x4087a1[_0x9d4d('0x1b')]===_0x9d4d('0x1c')&&typeof _0x4087a1['limit']===_0x9d4d('0x1c');var _0x10878a=_0x26c337[_0x9d4d('0x1d')];var _0x19787c=_0x3249ea?0x0:_0x4087a1['offset'];var _0x40a992=_0x3249ea?_0x26c337[_0x9d4d('0x1d')]:_0x4087a1[_0x9d4d('0x1b')]+_0x4087a1[_0x9d4d('0x1e')];var _0x5350a2;if(_0x40a992>=_0x10878a){_0x40a992=_0x10878a;_0x5350a2=0xc8;}else{_0x5350a2=0xce;}_0x149ec1[_0x9d4d('0x19')](_0x5350a2);return _0x149ec1['set'](_0x9d4d('0x1f'),_0x19787c+'-'+_0x40a992+'/'+_0x10878a)[_0x9d4d('0x1a')](_0x26c337);}return null;};}function patchUpdates(_0x2ce101){return function(_0x2f7d69){try{jsonpatch[_0x9d4d('0x20')](_0x2f7d69,_0x2ce101,!![]);}catch(_0x4f5735){return BPromise[_0x9d4d('0x21')](_0x4f5735);}return _0x2f7d69[_0x9d4d('0x22')]();};}function saveUpdates(_0x4ffd2a,_0x24338a){return function(_0x14e0f4){if(_0x14e0f4){return _0x14e0f4[_0x9d4d('0x23')](_0x4ffd2a)[_0x9d4d('0x24')](function(_0x365035){return _0x365035;});}return null;};}function removeEntity(_0x37aaad,_0x1e11b1){return function(_0x46519f){if(_0x46519f){return _0x46519f[_0x9d4d('0x25')]()[_0x9d4d('0x24')](function(){var _0x444ae8=_0x46519f[_0x9d4d('0x26')]({'plain':!![]});var _0x162ec1=_0x9d4d('0x27');return db['UserProfileResource'][_0x9d4d('0x25')]({'where':{'type':_0x162ec1,'resourceId':_0x444ae8['id']}})[_0x9d4d('0x24')](function(){return _0x46519f;});})[_0x9d4d('0x24')](function(){_0x37aaad[_0x9d4d('0x19')](0xcc)[_0x9d4d('0x28')]();});}};}function handleEntityNotFound(_0x4d41b1,_0x24a65f){return function(_0x5ced22){if(!_0x5ced22){_0x4d41b1[_0x9d4d('0x18')](0x194);}return _0x5ced22;};}function handleError(_0x3725ec,_0x30164e){_0x30164e=_0x30164e||0x1f4;return function(_0x23ef70){logger['error'](_0x23ef70[_0x9d4d('0x29')]);if(_0x23ef70[_0x9d4d('0x2a')]){delete _0x23ef70[_0x9d4d('0x2a')];}_0x3725ec[_0x9d4d('0x19')](_0x30164e)[_0x9d4d('0x2b')](_0x23ef70);};}exports[_0x9d4d('0x2c')]=function(_0xcfc37f,_0x113667){var _0x2d9ebb={},_0x416243={},_0x4b1237={'count':0x0,'rows':[]};var _0x3eb4ba=_[_0x9d4d('0x2d')](db[_0x9d4d('0x2e')][_0x9d4d('0x2f')],function(_0x20f905){return{'name':_0x20f905[_0x9d4d('0x30')],'type':_0x20f905['type'][_0x9d4d('0x31')]};});_0x416243[_0x9d4d('0x32')]=_[_0x9d4d('0x2d')](_0x3eb4ba,'name');_0x416243[_0x9d4d('0x33')]=_[_0x9d4d('0x34')](_0xcfc37f[_0x9d4d('0x33')]);_0x416243[_0x9d4d('0x35')]=_[_0x9d4d('0x36')](_0x416243[_0x9d4d('0x32')],_0x416243[_0x9d4d('0x33')]);_0x2d9ebb[_0x9d4d('0x37')]=_[_0x9d4d('0x36')](_0x416243[_0x9d4d('0x32')],qs[_0x9d4d('0x38')](_0xcfc37f[_0x9d4d('0x33')][_0x9d4d('0x38')]));_0x2d9ebb[_0x9d4d('0x37')]=_0x2d9ebb[_0x9d4d('0x37')][_0x9d4d('0x39')]?_0x2d9ebb[_0x9d4d('0x37')]:_0x416243['model'];if(!_0xcfc37f[_0x9d4d('0x33')][_0x9d4d('0x3a')]('nolimit')){_0x2d9ebb['limit']=qs[_0x9d4d('0x1e')](_0xcfc37f['query'][_0x9d4d('0x1e')]);_0x2d9ebb[_0x9d4d('0x1b')]=qs[_0x9d4d('0x1b')](_0xcfc37f['query'][_0x9d4d('0x1b')]);}_0x2d9ebb['order']=qs[_0x9d4d('0x3b')](_0xcfc37f[_0x9d4d('0x33')][_0x9d4d('0x3b')]);_0x2d9ebb[_0x9d4d('0x3c')]=qs[_0x9d4d('0x35')](_['pick'](_0xcfc37f[_0x9d4d('0x33')],_0x416243[_0x9d4d('0x35')]),_0x3eb4ba);if(_0xcfc37f['query'][_0x9d4d('0x3d')]){_0x2d9ebb[_0x9d4d('0x3c')]=_['merge'](_0x2d9ebb['where'],{'$or':_[_0x9d4d('0x2d')](_0x3eb4ba,function(_0xea4380){if(_0xea4380[_0x9d4d('0x3e')]!==_0x9d4d('0x3f')){var _0x58ecf7={};_0x58ecf7[_0xea4380[_0x9d4d('0x2a')]]={'$like':'%'+_0xcfc37f[_0x9d4d('0x33')][_0x9d4d('0x3d')]+'%'};return _0x58ecf7;}})});}_0x2d9ebb=_['merge']({},_0x2d9ebb,_0xcfc37f[_0x9d4d('0x40')]);var _0x51ca98={'where':_0x2d9ebb[_0x9d4d('0x3c')]};return db[_0x9d4d('0x2e')]['count'](_0x51ca98)[_0x9d4d('0x24')](function(_0x5cf037){_0x4b1237['count']=_0x5cf037;if(_0xcfc37f[_0x9d4d('0x33')][_0x9d4d('0x41')]){_0x2d9ebb[_0x9d4d('0x42')]=[{'all':!![]}];}return db[_0x9d4d('0x2e')][_0x9d4d('0x43')](_0x2d9ebb);})[_0x9d4d('0x24')](function(_0x18e5a6){_0x4b1237[_0x9d4d('0x44')]=_0x18e5a6;return _0x4b1237;})['then'](respondWithFilteredResult(_0x113667,_0x2d9ebb))[_0x9d4d('0x45')](handleError(_0x113667,null));};exports[_0x9d4d('0x46')]=function(_0x46cc44,_0x5e2aeb){var _0x3c17be={'raw':![],'where':{'id':_0x46cc44['params']['id']}},_0x54360d={};_0x54360d[_0x9d4d('0x32')]=_[_0x9d4d('0x34')](db[_0x9d4d('0x2e')][_0x9d4d('0x2f')]);_0x54360d[_0x9d4d('0x33')]=_[_0x9d4d('0x34')](_0x46cc44[_0x9d4d('0x33')]);_0x54360d[_0x9d4d('0x35')]=_[_0x9d4d('0x36')](_0x54360d[_0x9d4d('0x32')],_0x54360d['query']);_0x3c17be['attributes']=_['intersection'](_0x54360d[_0x9d4d('0x32')],qs[_0x9d4d('0x38')](_0x46cc44[_0x9d4d('0x33')]['fields']));_0x3c17be[_0x9d4d('0x37')]=_0x3c17be[_0x9d4d('0x37')]['length']?_0x3c17be['attributes']:_0x54360d['model'];if(_0x46cc44['query']['includeAll']){_0x3c17be[_0x9d4d('0x42')]=[{'all':!![]}];}_0x3c17be=_[_0x9d4d('0x47')]({},_0x3c17be,_0x46cc44[_0x9d4d('0x40')]);return db[_0x9d4d('0x2e')][_0x9d4d('0x48')](_0x3c17be)[_0x9d4d('0x24')](handleEntityNotFound(_0x5e2aeb,null))[_0x9d4d('0x24')](respondWithResult(_0x5e2aeb,null))[_0x9d4d('0x45')](handleError(_0x5e2aeb,null));};exports['create']=function(_0x13008c,_0x4f766b){return db[_0x9d4d('0x2e')][_0x9d4d('0x49')](_0x13008c[_0x9d4d('0x4a')],{})[_0x9d4d('0x24')](function(_0x464263){var _0x195510=_0x13008c['user'][_0x9d4d('0x26')]({'plain':!![]});if(!_0x195510)throw new Error(_0x9d4d('0x4b'));if(_0x195510[_0x9d4d('0x4c')]===_0x9d4d('0x4d')){var _0x166597=_0x464263[_0x9d4d('0x26')]({'plain':!![]});var _0x1ed4b0='Triggers';return db[_0x9d4d('0x4e')][_0x9d4d('0x48')]({'where':{'name':_0x1ed4b0,'userProfileId':_0x195510[_0x9d4d('0x4f')]},'raw':!![]})[_0x9d4d('0x24')](function(_0x4dec46){if(_0x4dec46&&_0x4dec46['autoAssociation']===0x0){return db[_0x9d4d('0x50')][_0x9d4d('0x49')]({'name':_0x166597[_0x9d4d('0x2a')],'resourceId':_0x166597['id'],'type':_0x4dec46[_0x9d4d('0x2a')],'sectionId':_0x4dec46['id']},{})['then'](function(){return _0x464263;});}else{return _0x464263;}})[_0x9d4d('0x45')](function(_0x10fbcc){logger[_0x9d4d('0x51')](_0x9d4d('0x52'),_0x10fbcc);throw _0x10fbcc;});}return _0x464263;})[_0x9d4d('0x24')](respondWithResult(_0x4f766b,0xc9))[_0x9d4d('0x45')](handleError(_0x4f766b,null));};exports['update']=function(_0x3088dd,_0x1c4942){if(_0x3088dd[_0x9d4d('0x4a')]['id']){delete _0x3088dd[_0x9d4d('0x4a')]['id'];}return db[_0x9d4d('0x2e')][_0x9d4d('0x48')]({'where':{'id':_0x3088dd[_0x9d4d('0x53')]['id']}})[_0x9d4d('0x24')](handleEntityNotFound(_0x1c4942,null))[_0x9d4d('0x24')](saveUpdates(_0x3088dd[_0x9d4d('0x4a')],null))['then'](respondWithResult(_0x1c4942,null))['catch'](handleError(_0x1c4942,null));};exports['destroy']=function(_0xbec17d,_0x18417e){return db[_0x9d4d('0x2e')][_0x9d4d('0x48')]({'where':{'id':_0xbec17d['params']['id']}})['then'](handleEntityNotFound(_0x18417e,null))[_0x9d4d('0x24')](removeEntity(_0x18417e,null))[_0x9d4d('0x45')](handleError(_0x18417e,null));};exports[_0x9d4d('0x54')]=function(_0x406355,_0x25cf6a,_0x3cbcc6){if(_0x406355[_0x9d4d('0x4a')]['id']){delete _0x406355[_0x9d4d('0x4a')]['id'];}return db[_0x9d4d('0x2e')][_0x9d4d('0x48')]({'where':{'id':_0x406355['params']['id']}})[_0x9d4d('0x24')](handleEntityNotFound(_0x25cf6a,null))['then'](function(_0x466b38){if(_0x466b38){_0x406355[_0x9d4d('0x4a')][_0x9d4d('0x55')]=_0x466b38['id'];return db[_0x9d4d('0x56')][_0x9d4d('0x49')](_0x406355[_0x9d4d('0x4a')]);}})[_0x9d4d('0x24')](respondWithResult(_0x25cf6a,null))['catch'](handleError(_0x25cf6a,null));};exports[_0x9d4d('0x57')]=function(_0xe15cf1,_0xc66f28,_0x3a92be){if(_0xe15cf1['body']['id']){delete _0xe15cf1[_0x9d4d('0x4a')]['id'];}return db[_0x9d4d('0x2e')][_0x9d4d('0x48')]({'where':{'id':_0xe15cf1[_0x9d4d('0x53')]['id']}})[_0x9d4d('0x24')](handleEntityNotFound(_0xc66f28,null))[_0x9d4d('0x24')](function(_0x107b65){if(_0x107b65){_0xe15cf1[_0x9d4d('0x4a')][_0x9d4d('0x58')]=_0x107b65['id'];return db['Condition'][_0x9d4d('0x49')](_0xe15cf1[_0x9d4d('0x4a')]);}})[_0x9d4d('0x24')](respondWithResult(_0xc66f28,null))[_0x9d4d('0x45')](handleError(_0xc66f28,null));};exports['getAllConditions']=function(_0x1c680f,_0x2afa0d,_0x56105b){var _0x48cf64={};var _0x1ea199={};var _0x2abbbb;var _0x299a96;return db[_0x9d4d('0x2e')][_0x9d4d('0x59')]({'where':{'id':_0x1c680f[_0x9d4d('0x53')]['id']}})[_0x9d4d('0x24')](handleEntityNotFound(_0x2afa0d,null))[_0x9d4d('0x24')](function(_0x3dad84){if(_0x3dad84){_0x2abbbb=_0x3dad84;_0x1ea199[_0x9d4d('0x32')]=_[_0x9d4d('0x34')](db[_0x9d4d('0x56')][_0x9d4d('0x2f')]);_0x1ea199[_0x9d4d('0x33')]=_[_0x9d4d('0x34')](_0x1c680f[_0x9d4d('0x33')]);_0x1ea199[_0x9d4d('0x35')]=_[_0x9d4d('0x36')](_0x1ea199[_0x9d4d('0x32')],_0x1ea199[_0x9d4d('0x33')]);_0x48cf64[_0x9d4d('0x37')]=_[_0x9d4d('0x36')](_0x1ea199[_0x9d4d('0x32')],qs[_0x9d4d('0x38')](_0x1c680f[_0x9d4d('0x33')][_0x9d4d('0x38')]));_0x48cf64[_0x9d4d('0x37')]=_0x48cf64[_0x9d4d('0x37')][_0x9d4d('0x39')]?_0x48cf64[_0x9d4d('0x37')]:_0x1ea199[_0x9d4d('0x32')];_0x48cf64[_0x9d4d('0x5a')]=qs[_0x9d4d('0x3b')](_0x1c680f['query']['sort']);_0x48cf64[_0x9d4d('0x3c')]=qs[_0x9d4d('0x35')](_[_0x9d4d('0x5b')](_0x1c680f[_0x9d4d('0x33')],_0x1ea199[_0x9d4d('0x35')]));if(_0x1c680f['query'][_0x9d4d('0x3d')]){_0x48cf64['where']=_[_0x9d4d('0x47')](_0x48cf64['where'],{'$or':_[_0x9d4d('0x2d')](_0x48cf64['attributes'],function(_0x131b04){var _0x3bbbbf={};_0x3bbbbf[_0x131b04]={'$like':'%'+_0x1c680f[_0x9d4d('0x33')][_0x9d4d('0x3d')]+'%'};return _0x3bbbbf;})});}_0x48cf64=_[_0x9d4d('0x47')]({},_0x48cf64,_0x1c680f['options']);return _0x2abbbb[_0x9d4d('0x5c')](_0x48cf64);}})[_0x9d4d('0x24')](function(_0x2e5113){if(_0x2e5113){_0x299a96=_0x2e5113[_0x9d4d('0x39')];if(!_0x1c680f[_0x9d4d('0x33')][_0x9d4d('0x3a')](_0x9d4d('0x5d'))){_0x48cf64[_0x9d4d('0x1e')]=qs[_0x9d4d('0x1e')](_0x1c680f[_0x9d4d('0x33')][_0x9d4d('0x1e')]);_0x48cf64['offset']=qs[_0x9d4d('0x1b')](_0x1c680f['query'][_0x9d4d('0x1b')]);}return _0x2abbbb[_0x9d4d('0x5c')](_0x48cf64);}})['then'](function(_0x358a7d){if(_0x358a7d){return _0x358a7d?{'count':_0x299a96,'rows':_0x358a7d}:null;}})[_0x9d4d('0x24')](respondWithResult(_0x2afa0d,null))[_0x9d4d('0x45')](handleError(_0x2afa0d,null));};exports['getAnyConditions']=function(_0x50f72c,_0x34b8a3,_0x4c18b0){var _0x4d91ca={};var _0x2b5f18={};var _0x5492bd;var _0x269cae;return db[_0x9d4d('0x2e')][_0x9d4d('0x59')]({'where':{'id':_0x50f72c[_0x9d4d('0x53')]['id']}})[_0x9d4d('0x24')](handleEntityNotFound(_0x34b8a3,null))[_0x9d4d('0x24')](function(_0x4f5359){if(_0x4f5359){_0x5492bd=_0x4f5359;_0x2b5f18[_0x9d4d('0x32')]=_[_0x9d4d('0x34')](db[_0x9d4d('0x56')][_0x9d4d('0x2f')]);_0x2b5f18[_0x9d4d('0x33')]=_[_0x9d4d('0x34')](_0x50f72c[_0x9d4d('0x33')]);_0x2b5f18[_0x9d4d('0x35')]=_[_0x9d4d('0x36')](_0x2b5f18[_0x9d4d('0x32')],_0x2b5f18['query']);_0x4d91ca[_0x9d4d('0x37')]=_[_0x9d4d('0x36')](_0x2b5f18[_0x9d4d('0x32')],qs[_0x9d4d('0x38')](_0x50f72c[_0x9d4d('0x33')][_0x9d4d('0x38')]));_0x4d91ca['attributes']=_0x4d91ca['attributes'][_0x9d4d('0x39')]?_0x4d91ca[_0x9d4d('0x37')]:_0x2b5f18[_0x9d4d('0x32')];_0x4d91ca[_0x9d4d('0x5a')]=qs['sort'](_0x50f72c[_0x9d4d('0x33')][_0x9d4d('0x3b')]);_0x4d91ca['where']=qs[_0x9d4d('0x35')](_[_0x9d4d('0x5b')](_0x50f72c[_0x9d4d('0x33')],_0x2b5f18['filters']));if(_0x50f72c[_0x9d4d('0x33')]['filter']){_0x4d91ca['where']=_['merge'](_0x4d91ca[_0x9d4d('0x3c')],{'$or':_[_0x9d4d('0x2d')](_0x4d91ca['attributes'],function(_0x1caec3){var _0x1fb562={};_0x1fb562[_0x1caec3]={'$like':'%'+_0x50f72c[_0x9d4d('0x33')][_0x9d4d('0x3d')]+'%'};return _0x1fb562;})});}_0x4d91ca=_[_0x9d4d('0x47')]({},_0x4d91ca,_0x50f72c[_0x9d4d('0x40')]);return _0x5492bd[_0x9d4d('0x5e')](_0x4d91ca);}})[_0x9d4d('0x24')](function(_0x41587c){if(_0x41587c){_0x269cae=_0x41587c['length'];if(!_0x50f72c[_0x9d4d('0x33')][_0x9d4d('0x3a')]('nolimit')){_0x4d91ca['limit']=qs[_0x9d4d('0x1e')](_0x50f72c['query'][_0x9d4d('0x1e')]);_0x4d91ca[_0x9d4d('0x1b')]=qs['offset'](_0x50f72c[_0x9d4d('0x33')][_0x9d4d('0x1b')]);}return _0x5492bd[_0x9d4d('0x5e')](_0x4d91ca);}})['then'](function(_0x4669d8){if(_0x4669d8){return _0x4669d8?{'count':_0x269cae,'rows':_0x4669d8}:null;}})[_0x9d4d('0x24')](respondWithResult(_0x34b8a3,null))['catch'](handleError(_0x34b8a3,null));};exports[_0x9d4d('0x5f')]=function(_0x3e1537,_0x594113,_0x19bacc){if(_0x3e1537['body']['id']){delete _0x3e1537[_0x9d4d('0x4a')]['id'];}return db[_0x9d4d('0x2e')][_0x9d4d('0x48')]({'where':{'id':_0x3e1537[_0x9d4d('0x53')]['id']}})[_0x9d4d('0x24')](handleEntityNotFound(_0x594113,null))[_0x9d4d('0x24')](function(_0x331170){if(_0x331170){_0x3e1537[_0x9d4d('0x4a')]['TriggerId']=_0x331170['id'];return db[_0x9d4d('0x60')][_0x9d4d('0x49')](_0x3e1537[_0x9d4d('0x4a')]);}})[_0x9d4d('0x24')](respondWithResult(_0x594113,null))['catch'](handleError(_0x594113,null));};exports[_0x9d4d('0x61')]=function(_0xa72e32,_0x5e0b06,_0x4f65e5){var _0x5a3146={};var _0x1ab3b8={};var _0x49aacd;var _0x4fb1a0;return db[_0x9d4d('0x2e')][_0x9d4d('0x59')]({'where':{'id':_0xa72e32[_0x9d4d('0x53')]['id']}})['then'](handleEntityNotFound(_0x5e0b06,null))[_0x9d4d('0x24')](function(_0x2870e7){if(_0x2870e7){_0x49aacd=_0x2870e7;_0x1ab3b8['model']=_['keys'](db[_0x9d4d('0x60')][_0x9d4d('0x2f')]);_0x1ab3b8['query']=_[_0x9d4d('0x34')](_0xa72e32[_0x9d4d('0x33')]);_0x1ab3b8[_0x9d4d('0x35')]=_[_0x9d4d('0x36')](_0x1ab3b8[_0x9d4d('0x32')],_0x1ab3b8['query']);_0x5a3146[_0x9d4d('0x37')]=_[_0x9d4d('0x36')](_0x1ab3b8['model'],qs[_0x9d4d('0x38')](_0xa72e32['query'][_0x9d4d('0x38')]));_0x5a3146[_0x9d4d('0x37')]=_0x5a3146[_0x9d4d('0x37')][_0x9d4d('0x39')]?_0x5a3146['attributes']:_0x1ab3b8[_0x9d4d('0x32')];_0x5a3146['order']=qs[_0x9d4d('0x3b')](_0xa72e32[_0x9d4d('0x33')][_0x9d4d('0x3b')]);_0x5a3146[_0x9d4d('0x3c')]=qs[_0x9d4d('0x35')](_['pick'](_0xa72e32[_0x9d4d('0x33')],_0x1ab3b8[_0x9d4d('0x35')]));if(_0xa72e32['query'][_0x9d4d('0x3d')]){_0x5a3146[_0x9d4d('0x3c')]=_[_0x9d4d('0x47')](_0x5a3146['where'],{'$or':_[_0x9d4d('0x2d')](_0x5a3146['attributes'],function(_0x5d5479){var _0x985f4c={};_0x985f4c[_0x5d5479]={'$like':'%'+_0xa72e32['query']['filter']+'%'};return _0x985f4c;})});}_0x5a3146=_[_0x9d4d('0x47')]({},_0x5a3146,_0xa72e32[_0x9d4d('0x40')]);return _0x49aacd['getActions'](_0x5a3146);}})[_0x9d4d('0x24')](function(_0x10d9d4){if(_0x10d9d4){_0x4fb1a0=_0x10d9d4['length'];if(!_0xa72e32[_0x9d4d('0x33')][_0x9d4d('0x3a')](_0x9d4d('0x5d'))){_0x5a3146['limit']=qs['limit'](_0xa72e32[_0x9d4d('0x33')][_0x9d4d('0x1e')]);_0x5a3146[_0x9d4d('0x1b')]=qs['offset'](_0xa72e32['query'][_0x9d4d('0x1b')]);}return _0x49aacd['getActions'](_0x5a3146);}})[_0x9d4d('0x24')](function(_0x22a65b){if(_0x22a65b){return _0x22a65b?{'count':_0x4fb1a0,'rows':_0x22a65b}:null;}})[_0x9d4d('0x24')](respondWithResult(_0x5e0b06,null))[_0x9d4d('0x45')](handleError(_0x5e0b06,null));};
\ No newline at end of file
index 0c159fa..1b746fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ce1=['../../config/environment','exports','Trigger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1e878f,_0x3a63e7){var _0x442563=function(_0x311f4d){while(--_0x311f4d){_0x1e878f['push'](_0x1e878f['shift']());}};_0x442563(++_0x3a63e7);}(_0x2ce1,0x8b));var _0x12ce=function(_0x21d17e,_0x4a20c7){_0x21d17e=_0x21d17e-0x0;var _0xa0e49f=_0x2ce1[_0x21d17e];return _0xa0e49f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x12ce('0x0'));var moment=require(_0x12ce('0x1'));var BPromise=require(_0x12ce('0x2'));var rp=require(_0x12ce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12ce('0x4'));var config=require(_0x12ce('0x5'));var attributes=require('./trigger.attributes');module[_0x12ce('0x6')]=function(_0x15aa00,_0x36562a){return _0x15aa00['define'](_0x12ce('0x7'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85d8=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','Trigger','tools_triggers'];(function(_0x4ff25d,_0x21c4af){var _0x4ccdea=function(_0x6e750a){while(--_0x6e750a){_0x4ff25d['push'](_0x4ff25d['shift']());}};_0x4ccdea(++_0x21c4af);}(_0x85d8,0x1b0));var _0x885d=function(_0x4ef3bf,_0x175720){_0x4ef3bf=_0x4ef3bf-0x0;var _0x185333=_0x85d8[_0x4ef3bf];return _0x185333;};'use strict';var _=require(_0x885d('0x0'));var util=require(_0x885d('0x1'));var logger=require(_0x885d('0x2'))(_0x885d('0x3'));var moment=require(_0x885d('0x4'));var BPromise=require('bluebird');var rp=require(_0x885d('0x5'));var fs=require('fs');var path=require(_0x885d('0x6'));var rimraf=require(_0x885d('0x7'));var config=require(_0x885d('0x8'));var attributes=require('./trigger.attributes');module['exports']=function(_0x186504,_0x30dcc2){return _0x186504[_0x885d('0x9')](_0x885d('0xa'),attributes,{'tableName':_0x885d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0ee8643..fc2ba9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a02=['Trigger','findAll','options','where','limit','map','include','model','attributes','then','GetTrigger','ShowTrigger','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x58167d,_0xcbbb39){var _0x473983=function(_0x43ed8d){while(--_0x43ed8d){_0x58167d['push'](_0x58167d['shift']());}};_0x473983(++_0xcbbb39);}(_0x6a02,0x7d));var _0x26a0=function(_0x36349a,_0x10c1e5){_0x36349a=_0x36349a-0x0;var _0x50a092=_0x6a02[_0x36349a];return _0x50a092;};'use strict';var _=require(_0x26a0('0x0'));var util=require(_0x26a0('0x1'));var moment=require(_0x26a0('0x2'));var BPromise=require(_0x26a0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26a0('0x4'));var db=require(_0x26a0('0x5'))['db'];var utils=require(_0x26a0('0x6'));var logger=require(_0x26a0('0x7'))('rpc');var config=require(_0x26a0('0x8'));var jayson=require(_0x26a0('0x9'));var client=jayson[_0x26a0('0xa')][_0x26a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bc92f,_0x573340,_0x310e91){return new BPromise(function(_0x1911f3,_0x185a87){return client[_0x26a0('0xc')](_0x4bc92f,_0x310e91)['then'](function(_0x3e31e7){logger['info'](_0x26a0('0xd'),_0x573340,_0x26a0('0xe'));logger[_0x26a0('0xf')](_0x26a0('0x10'),_0x573340,'request\x20sent',JSON['stringify'](_0x3e31e7));if(_0x3e31e7[_0x26a0('0x11')]){if(_0x3e31e7[_0x26a0('0x11')][_0x26a0('0x12')]===0x1f4){logger['error'](_0x26a0('0xd'),_0x573340,_0x3e31e7[_0x26a0('0x11')][_0x26a0('0x13')]);return _0x185a87(_0x3e31e7[_0x26a0('0x11')][_0x26a0('0x13')]);}logger['error'](_0x26a0('0xd'),_0x573340,_0x3e31e7[_0x26a0('0x11')][_0x26a0('0x13')]);return _0x1911f3(_0x3e31e7[_0x26a0('0x11')][_0x26a0('0x13')]);}else{logger[_0x26a0('0x14')](_0x26a0('0xd'),_0x573340,_0x26a0('0xe'));_0x1911f3(_0x3e31e7[_0x26a0('0x15')][_0x26a0('0x13')]);}})[_0x26a0('0x16')](function(_0x464bf4){logger['error'](_0x26a0('0xd'),_0x573340,_0x464bf4);_0x185a87(_0x464bf4);});});}exports['GetTrigger']=function(_0x4e8479){var _0x35c08f=this;return new Promise(function(_0x5ae22f,_0x5608cc){return db[_0x26a0('0x17')][_0x26a0('0x18')]({'raw':_0x4e8479[_0x26a0('0x19')]?_0x4e8479[_0x26a0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4e8479[_0x26a0('0x19')]?_0x4e8479[_0x26a0('0x19')][_0x26a0('0x1a')]||null:null,'attributes':_0x4e8479['options']?_0x4e8479[_0x26a0('0x19')]['attributes']||null:null,'limit':_0x4e8479[_0x26a0('0x19')]?_0x4e8479[_0x26a0('0x19')][_0x26a0('0x1b')]||null:null,'include':_0x4e8479[_0x26a0('0x19')]?_0x4e8479[_0x26a0('0x19')]['include']?_[_0x26a0('0x1c')](_0x4e8479[_0x26a0('0x19')][_0x26a0('0x1d')],function(_0x4b38a9){return{'model':db[_0x4b38a9[_0x26a0('0x1e')]],'as':_0x4b38a9['as'],'attributes':_0x4b38a9[_0x26a0('0x1f')],'include':_0x4b38a9[_0x26a0('0x1d')]?_['map'](_0x4b38a9[_0x26a0('0x1d')],function(_0x5e375f){return{'model':db[_0x5e375f[_0x26a0('0x1e')]],'as':_0x5e375f['as'],'attributes':_0x5e375f['attributes'],'include':_0x5e375f[_0x26a0('0x1d')]?_[_0x26a0('0x1c')](_0x5e375f[_0x26a0('0x1d')],function(_0x4ffbea){return{'model':db[_0x4ffbea[_0x26a0('0x1e')]],'as':_0x4ffbea['as'],'attributes':_0x4ffbea[_0x26a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x26a0('0x20')](function(_0xfddef5){logger[_0x26a0('0x14')](_0x26a0('0x21'),_0x4e8479);logger[_0x26a0('0xf')](_0x26a0('0x21'),_0x4e8479,JSON['stringify'](_0xfddef5));_0x5ae22f(_0xfddef5);})[_0x26a0('0x16')](function(_0x296515){logger[_0x26a0('0x11')](_0x26a0('0x21'),_0x296515[_0x26a0('0x13')],_0x4e8479);_0x5608cc(_0x35c08f[_0x26a0('0x11')](0x1f4,_0x296515[_0x26a0('0x13')]));});});};exports[_0x26a0('0x22')]=function(_0x1feff7){var _0x5bb26a=this;return new Promise(function(_0x33c8ff,_0x19fd52){return db[_0x26a0('0x17')][_0x26a0('0x23')]({'raw':_0x1feff7['options']?_0x1feff7['options']['raw']===undefined?!![]:![]:!![],'where':_0x1feff7[_0x26a0('0x19')]?_0x1feff7[_0x26a0('0x19')]['where']||null:null,'attributes':_0x1feff7[_0x26a0('0x19')]?_0x1feff7[_0x26a0('0x19')][_0x26a0('0x1f')]||null:null,'include':_0x1feff7['options']?_0x1feff7[_0x26a0('0x19')][_0x26a0('0x1d')]?_['map'](_0x1feff7[_0x26a0('0x19')]['include'],function(_0x1a3798){return{'model':db[_0x1a3798[_0x26a0('0x1e')]],'as':_0x1a3798['as'],'attributes':_0x1a3798[_0x26a0('0x1f')],'include':_0x1a3798[_0x26a0('0x1d')]?_[_0x26a0('0x1c')](_0x1a3798[_0x26a0('0x1d')],function(_0xdc2be1){return{'model':db[_0xdc2be1[_0x26a0('0x1e')]],'as':_0xdc2be1['as'],'attributes':_0xdc2be1[_0x26a0('0x1f')],'include':_0xdc2be1[_0x26a0('0x1d')]?_[_0x26a0('0x1c')](_0xdc2be1[_0x26a0('0x1d')],function(_0x2360b2){return{'model':db[_0x2360b2[_0x26a0('0x1e')]],'as':_0x2360b2['as'],'attributes':_0x2360b2[_0x26a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x26a0('0x20')](function(_0x5e723b){logger[_0x26a0('0x14')](_0x26a0('0x22'),_0x1feff7);logger[_0x26a0('0xf')]('ShowTrigger',_0x1feff7,JSON[_0x26a0('0x24')](_0x5e723b));_0x33c8ff(_0x5e723b);})[_0x26a0('0x16')](function(_0x3757a5){logger[_0x26a0('0x11')]('ShowTrigger',_0x3757a5[_0x26a0('0x13')],_0x1feff7);_0x19fd52(_0x5bb26a[_0x26a0('0x11')](0x1f4,_0x3757a5[_0x26a0('0x13')]));});});};
\ No newline at end of file
+var _0xd341=['jayson/promise','client','request','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','catch','find','ShowTrigger','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x53c05d,_0x43a7aa){var _0x5cb6e3=function(_0x3e8ba4){while(--_0x3e8ba4){_0x53c05d['push'](_0x53c05d['shift']());}};_0x5cb6e3(++_0x43a7aa);}(_0xd341,0x1f0));var _0x1d34=function(_0x5cd173,_0x2e0c9f){_0x5cd173=_0x5cd173-0x0;var _0x108f54=_0xd341[_0x5cd173];return _0x108f54;};'use strict';var _=require('lodash');var util=require(_0x1d34('0x0'));var moment=require(_0x1d34('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d34('0x2'));var fs=require('fs');var Redis=require(_0x1d34('0x3'));var db=require(_0x1d34('0x4'))['db'];var utils=require(_0x1d34('0x5'));var logger=require('../../config/logger')(_0x1d34('0x6'));var config=require(_0x1d34('0x7'));var jayson=require(_0x1d34('0x8'));var client=jayson[_0x1d34('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe850ea,_0x7ed60b,_0x587c43){return new BPromise(function(_0x303b20,_0x592c54){return client[_0x1d34('0xa')](_0xe850ea,_0x587c43)[_0x1d34('0xb')](function(_0x152c4b){logger['info'](_0x1d34('0xc'),_0x7ed60b,_0x1d34('0xd'));logger['debug'](_0x1d34('0xe'),_0x7ed60b,_0x1d34('0xd'),JSON['stringify'](_0x152c4b));if(_0x152c4b[_0x1d34('0xf')]){if(_0x152c4b['error'][_0x1d34('0x10')]===0x1f4){logger['error'](_0x1d34('0xc'),_0x7ed60b,_0x152c4b[_0x1d34('0xf')][_0x1d34('0x11')]);return _0x592c54(_0x152c4b[_0x1d34('0xf')][_0x1d34('0x11')]);}logger[_0x1d34('0xf')]('Trigger,\x20%s,\x20%s',_0x7ed60b,_0x152c4b['error'][_0x1d34('0x11')]);return _0x303b20(_0x152c4b[_0x1d34('0xf')][_0x1d34('0x11')]);}else{logger[_0x1d34('0x12')](_0x1d34('0xc'),_0x7ed60b,_0x1d34('0xd'));_0x303b20(_0x152c4b[_0x1d34('0x13')][_0x1d34('0x11')]);}})['catch'](function(_0x2a73f2){logger[_0x1d34('0xf')]('Trigger,\x20%s,\x20%s',_0x7ed60b,_0x2a73f2);_0x592c54(_0x2a73f2);});});}exports[_0x1d34('0x14')]=function(_0x5b052b){var _0x4557e7=this;return new Promise(function(_0x99d13d,_0x48c133){return db[_0x1d34('0x15')][_0x1d34('0x16')]({'raw':_0x5b052b[_0x1d34('0x17')]?_0x5b052b[_0x1d34('0x17')][_0x1d34('0x18')]===undefined?!![]:![]:!![],'where':_0x5b052b[_0x1d34('0x17')]?_0x5b052b[_0x1d34('0x17')][_0x1d34('0x19')]||null:null,'attributes':_0x5b052b['options']?_0x5b052b[_0x1d34('0x17')]['attributes']||null:null,'limit':_0x5b052b[_0x1d34('0x17')]?_0x5b052b[_0x1d34('0x17')][_0x1d34('0x1a')]||null:null,'include':_0x5b052b[_0x1d34('0x17')]?_0x5b052b[_0x1d34('0x17')][_0x1d34('0x1b')]?_[_0x1d34('0x1c')](_0x5b052b[_0x1d34('0x17')][_0x1d34('0x1b')],function(_0x3c5b2c){return{'model':db[_0x3c5b2c[_0x1d34('0x1d')]],'as':_0x3c5b2c['as'],'attributes':_0x3c5b2c[_0x1d34('0x1e')],'include':_0x3c5b2c[_0x1d34('0x1b')]?_[_0x1d34('0x1c')](_0x3c5b2c['include'],function(_0x4bb986){return{'model':db[_0x4bb986['model']],'as':_0x4bb986['as'],'attributes':_0x4bb986['attributes'],'include':_0x4bb986[_0x1d34('0x1b')]?_[_0x1d34('0x1c')](_0x4bb986[_0x1d34('0x1b')],function(_0x21e5ba){return{'model':db[_0x21e5ba[_0x1d34('0x1d')]],'as':_0x21e5ba['as'],'attributes':_0x21e5ba['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x518fe8){logger[_0x1d34('0x12')](_0x1d34('0x14'),_0x5b052b);logger[_0x1d34('0x1f')](_0x1d34('0x14'),_0x5b052b,JSON[_0x1d34('0x20')](_0x518fe8));_0x99d13d(_0x518fe8);})[_0x1d34('0x21')](function(_0x3ddcb0){logger[_0x1d34('0xf')](_0x1d34('0x14'),_0x3ddcb0['message'],_0x5b052b);_0x48c133(_0x4557e7[_0x1d34('0xf')](0x1f4,_0x3ddcb0[_0x1d34('0x11')]));});});};exports['ShowTrigger']=function(_0x444abd){var _0x4ca8d9=this;return new Promise(function(_0xb3849a,_0x1577b6){return db[_0x1d34('0x15')][_0x1d34('0x22')]({'raw':_0x444abd['options']?_0x444abd[_0x1d34('0x17')][_0x1d34('0x18')]===undefined?!![]:![]:!![],'where':_0x444abd[_0x1d34('0x17')]?_0x444abd[_0x1d34('0x17')]['where']||null:null,'attributes':_0x444abd[_0x1d34('0x17')]?_0x444abd[_0x1d34('0x17')]['attributes']||null:null,'include':_0x444abd['options']?_0x444abd[_0x1d34('0x17')][_0x1d34('0x1b')]?_[_0x1d34('0x1c')](_0x444abd[_0x1d34('0x17')][_0x1d34('0x1b')],function(_0x22593d){return{'model':db[_0x22593d[_0x1d34('0x1d')]],'as':_0x22593d['as'],'attributes':_0x22593d[_0x1d34('0x1e')],'include':_0x22593d['include']?_[_0x1d34('0x1c')](_0x22593d['include'],function(_0xb08482){return{'model':db[_0xb08482[_0x1d34('0x1d')]],'as':_0xb08482['as'],'attributes':_0xb08482[_0x1d34('0x1e')],'include':_0xb08482[_0x1d34('0x1b')]?_[_0x1d34('0x1c')](_0xb08482[_0x1d34('0x1b')],function(_0x161fc4){return{'model':db[_0x161fc4[_0x1d34('0x1d')]],'as':_0x161fc4['as'],'attributes':_0x161fc4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d34('0xb')](function(_0x2f6a1c){logger[_0x1d34('0x12')](_0x1d34('0x23'),_0x444abd);logger['debug'](_0x1d34('0x23'),_0x444abd,JSON[_0x1d34('0x20')](_0x2f6a1c));_0xb3849a(_0x2f6a1c);})[_0x1d34('0x21')](function(_0x5e1f00){logger[_0x1d34('0xf')](_0x1d34('0x23'),_0x5e1f00[_0x1d34('0x11')],_0x444abd);_0x1577b6(_0x4ca8d9[_0x1d34('0xf')](0x1f4,_0x5e1f00['message']));});});};
\ No newline at end of file
index 98a5680..4bc111c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94e4=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','clone','create','put','update','delete','destroy','exports','multer','path'];(function(_0x344bab,_0x41b8f6){var _0x360ab6=function(_0x219428){while(--_0x219428){_0x344bab['push'](_0x344bab['shift']());}};_0x360ab6(++_0x41b8f6);}(_0x94e4,0x1e2));var _0x494e=function(_0x35e3bf,_0x3b7eb0){_0x35e3bf=_0x35e3bf-0x0;var _0x1b925e=_0x94e4[_0x35e3bf];return _0x1b925e;};'use strict';var multer=require(_0x494e('0x0'));var util=require('util');var path=require(_0x494e('0x1'));var timeout=require(_0x494e('0x2'));var express=require(_0x494e('0x3'));var router=express[_0x494e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x494e('0x5'));var interaction=require(_0x494e('0x6'));var config=require(_0x494e('0x7'));var controller=require(_0x494e('0x8'));router['get']('/',auth[_0x494e('0x9')](),controller[_0x494e('0xa')]);router[_0x494e('0xb')](_0x494e('0xc'),auth[_0x494e('0x9')](),controller[_0x494e('0xd')]);router[_0x494e('0xe')]('/:id/clone',auth[_0x494e('0x9')](),controller[_0x494e('0xf')]);router['post']('/',auth[_0x494e('0x9')](),controller[_0x494e('0x10')]);router[_0x494e('0x11')](_0x494e('0xc'),auth[_0x494e('0x9')](),controller[_0x494e('0x12')]);router[_0x494e('0x13')](_0x494e('0xc'),auth['isAuthenticated'](),controller[_0x494e('0x14')]);module[_0x494e('0x15')]=router;
\ No newline at end of file
+var _0xcfc7=['index','/:id','post','/:id/clone','clone','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated'];(function(_0x13a1a8,_0x3358ed){var _0x3ee664=function(_0x2f8102){while(--_0x2f8102){_0x13a1a8['push'](_0x13a1a8['shift']());}};_0x3ee664(++_0x3358ed);}(_0xcfc7,0x9c));var _0x7cfc=function(_0x5aa1f2,_0x9e7d77){_0x5aa1f2=_0x5aa1f2-0x0;var _0x10d492=_0xcfc7[_0x5aa1f2];return _0x10d492;};'use strict';var multer=require(_0x7cfc('0x0'));var util=require(_0x7cfc('0x1'));var path=require('path');var timeout=require(_0x7cfc('0x2'));var express=require(_0x7cfc('0x3'));var router=express[_0x7cfc('0x4')]();var fs_extra=require(_0x7cfc('0x5'));var auth=require(_0x7cfc('0x6'));var interaction=require(_0x7cfc('0x7'));var config=require(_0x7cfc('0x8'));var controller=require(_0x7cfc('0x9'));router[_0x7cfc('0xa')]('/',auth[_0x7cfc('0xb')](),controller[_0x7cfc('0xc')]);router['get'](_0x7cfc('0xd'),auth[_0x7cfc('0xb')](),controller['show']);router[_0x7cfc('0xe')](_0x7cfc('0xf'),auth[_0x7cfc('0xb')](),controller[_0x7cfc('0x10')]);router['post']('/',auth[_0x7cfc('0xb')](),controller[_0x7cfc('0x11')]);router[_0x7cfc('0x12')]('/:id',auth[_0x7cfc('0xb')](),controller[_0x7cfc('0x13')]);router[_0x7cfc('0x14')](_0x7cfc('0xd'),auth[_0x7cfc('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index bc62619..2ccdf31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03c1=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','uac','uas','certificate','active','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','getDataValue','port,invite','insecure'];(function(_0x1dc2c7,_0x73a3b5){var _0x3ce97c=function(_0x56185d){while(--_0x56185d){_0x1dc2c7['push'](_0x1dc2c7['shift']());}};_0x3ce97c(++_0x73a3b5);}(_0x03c1,0x146));var _0x103c=function(_0x3b2be5,_0x9c01ae){_0x3b2be5=_0x3b2be5-0x0;var _0x14cd8=_0x03c1[_0x3b2be5];return _0x14cd8;};'use strict';var Sequelize=require(_0x103c('0x0'));module[_0x103c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x103c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x4'),_0x103c('0x5'),_0x103c('0x6')),'allowNull':![],'defaultValue':_0x103c('0x4')},'context':{'type':Sequelize[_0x103c('0x7')],'allowNull':![],'defaultValue':_0x103c('0x8')},'callingpres':{'type':Sequelize[_0x103c('0x3')]('ALLOWED_NOT_SCREENED',_0x103c('0x9'),_0x103c('0xa'),_0x103c('0xb'),_0x103c('0xc'),_0x103c('0xd'),_0x103c('0xe'),_0x103c('0xf'))},'deny':{'type':Sequelize[_0x103c('0x7')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x103c('0x7')]},'md5secret':{'type':Sequelize[_0x103c('0x7')]},'remotesecret':{'type':Sequelize[_0x103c('0x7')]},'transport':{'type':Sequelize[_0x103c('0x7')],'defaultValue':_0x103c('0x10'),'set':function(_0x12a074){this[_0x103c('0x11')](_0x103c('0x12'),_0x12a074?_0x12a074[_0x103c('0x13')](','):null);},'get':function(){return this['getDataValue'](_0x103c('0x12'))?this['getDataValue'](_0x103c('0x12'))[_0x103c('0x14')](','):null;},'comment':_0x103c('0x15')},'dtmfmode':{'type':Sequelize['ENUM'](_0x103c('0x16'),_0x103c('0x17'),_0x103c('0x18'),_0x103c('0x19'),_0x103c('0x1a')),'defaultValue':_0x103c('0x16')},'directmedia':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no',_0x103c('0x1c'),'update',_0x103c('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x103c('0x7')]},'directmediadeny':{'type':Sequelize[_0x103c('0x7')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x2cbfaf){this[_0x103c('0x11')](_0x103c('0x1e'),_0x2cbfaf?_0x2cbfaf['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue'](_0x103c('0x1e'))[_0x103c('0x14')](','):null;},'comment':_0x103c('0x1f')},'callgroup':{'type':Sequelize[_0x103c('0x7')]},'namedcallgroup':{'type':Sequelize[_0x103c('0x7')]},'pickupgroup':{'type':Sequelize[_0x103c('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x103c('0x7')]},'language':{'type':Sequelize[_0x103c('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x103c('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x103c('0x20')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x53d058){this[_0x103c('0x11')](_0x103c('0x21'),_0x53d058?_0x53d058['join'](';'):_0x103c('0x22'));},'get':function(){return this[_0x103c('0x23')](_0x103c('0x21'))?this['getDataValue'](_0x103c('0x21'))[_0x103c('0x14')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x103c('0x24'),'set':function(_0x48c1a0){this[_0x103c('0x11')]('insecure',_0x48c1a0?_0x48c1a0[_0x103c('0x13')](','):null);},'get':function(){return this[_0x103c('0x23')](_0x103c('0x25'))?this[_0x103c('0x23')]('insecure')[_0x103c('0x14')](','):null;},'comment':_0x103c('0x26')},'trustrpid':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x103c('0x1b'),'no','never')},'promiscredir':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x103c('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x103c('0x27')](0xb)},'setvar':{'type':Sequelize[_0x103c('0x7')]},'callerid':{'type':Sequelize[_0x103c('0x7')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x103c('0x7')]},'callcounter':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x103c('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x103c('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0x103c('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x103c('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0x103c('0x7')]},'template':{'type':Sequelize[_0x103c('0x7')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x103c('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x103c('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no')},'mailbox':{'type':Sequelize[_0x103c('0x7')]},'session_timers':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x29'),_0x103c('0x2a'),'originate')},'session_expires':{'type':Sequelize[_0x103c('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x103c('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x2b'),_0x103c('0x2c')),'defaultValue':_0x103c('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x103c('0x7')]},'regexten':{'type':Sequelize[_0x103c('0x7')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x103c('0x7')]},'port':{'type':Sequelize[_0x103c('0x27')](0x5)},'qualify':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no'),'defaultValue':_0x103c('0x1b')},'keepalive':{'type':Sequelize[_0x103c('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x103c('0x7')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x103c('0x7')]},'timert1':{'type':Sequelize[_0x103c('0x27')](0xb)},'timerb':{'type':Sequelize[_0x103c('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x103c('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x103c('0x7')]},'contactdeny':{'type':Sequelize[_0x103c('0x7')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x103c('0x7')]},'use_q850_reason':{'type':Sequelize[_0x103c('0x7')]},'maxforwards':{'type':Sequelize[_0x103c('0x27')](0xb)},'encryption':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x103c('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no')},'dtlsverify':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no','fingerprint',_0x103c('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x103c('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x103c('0x7')]},'dtlsprivatekey':{'type':Sequelize[_0x103c('0x7')]},'dtlscipher':{'type':Sequelize[_0x103c('0x7')]},'dtlscafile':{'type':Sequelize[_0x103c('0x7')]},'dtlscapath':{'type':Sequelize[_0x103c('0x7')]},'dtlssetup':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x2e'),'passive',_0x103c('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x103c('0x7')]},'usereqphone':{'type':Sequelize[_0x103c('0x3')](_0x103c('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x103c('0x7')]},'call_limit':{'type':Sequelize[_0x103c('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x103c('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x103c('0x1b'),'no')},'vmexten':{'type':Sequelize[_0x103c('0x7')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x103c('0x7')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x103c('0x7')]},'host':{'type':Sequelize[_0x103c('0x7')],'defaultValue':_0x103c('0x30')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x103c('0x1c'),_0x103c('0x31'),_0x103c('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x103c('0x7')]},'otherFields':{'type':Sequelize[_0x103c('0x7')]},'active':{'type':Sequelize[_0x103c('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x103c('0x7')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xa219=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','nonat','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER'];(function(_0x408130,_0x5e9764){var _0x305b96=function(_0x1abfbc){while(--_0x1abfbc){_0x408130['push'](_0x408130['shift']());}};_0x305b96(++_0x5e9764);}(_0xa219,0x1d1));var _0x9a21=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xa219[_0x2aa0e7];return _0x1472c0;};'use strict';var Sequelize=require(_0x9a21('0x0'));module[_0x9a21('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a21('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x4'),_0x9a21('0x5'),_0x9a21('0x6')),'allowNull':![],'defaultValue':_0x9a21('0x4')},'context':{'type':Sequelize[_0x9a21('0x7')],'allowNull':![],'defaultValue':_0x9a21('0x8')},'callingpres':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x9'),'ALLOWED_PASSED_SCREEN',_0x9a21('0xa'),'ALLOWED',_0x9a21('0xb'),_0x9a21('0xc'),_0x9a21('0xd'),_0x9a21('0xe'))},'deny':{'type':Sequelize[_0x9a21('0x7')]},'permit':{'type':Sequelize[_0x9a21('0x7')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x9a21('0x7')],'defaultValue':_0x9a21('0xf'),'set':function(_0x2dc5fc){this[_0x9a21('0x10')]('transport',_0x2dc5fc?_0x2dc5fc['join'](','):null);},'get':function(){return this['getDataValue'](_0x9a21('0x11'))?this[_0x9a21('0x12')]('transport')[_0x9a21('0x13')](','):null;},'comment':_0x9a21('0x14')},'dtmfmode':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x15'),_0x9a21('0x16'),'shortinfo','inband',_0x9a21('0x17')),'defaultValue':_0x9a21('0x15')},'directmedia':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no',_0x9a21('0x19'),'update',_0x9a21('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9a21('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9a21('0x7')]},'directmediadeny':{'type':Sequelize[_0x9a21('0x7')]},'nat':{'type':Sequelize[_0x9a21('0x7')],'defaultValue':_0x9a21('0x1b'),'set':function(_0x522bdf){this[_0x9a21('0x10')](_0x9a21('0x1c'),_0x522bdf?_0x522bdf[_0x9a21('0x1d')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x9a21('0x12')](_0x9a21('0x1c'))['split'](','):null;},'comment':_0x9a21('0x1e')},'callgroup':{'type':Sequelize[_0x9a21('0x7')]},'namedcallgroup':{'type':Sequelize[_0x9a21('0x7')]},'pickupgroup':{'type':Sequelize[_0x9a21('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x9a21('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9a21('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9a21('0x7')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x9a21('0x7')],'allowNull':![],'defaultValue':_0x9a21('0x1f'),'set':function(_0x2a6c89){this[_0x9a21('0x10')](_0x9a21('0x20'),_0x2a6c89?_0x2a6c89[_0x9a21('0x1d')](';'):_0x9a21('0x1f'));},'get':function(){return this[_0x9a21('0x12')](_0x9a21('0x20'))?this['getDataValue'](_0x9a21('0x20'))[_0x9a21('0x13')](';'):null;},'comment':_0x9a21('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0x9a21('0x18'),'no')},'insecure':{'type':Sequelize[_0x9a21('0x7')],'defaultValue':_0x9a21('0x22'),'set':function(_0x529a30){this[_0x9a21('0x10')](_0x9a21('0x23'),_0x529a30?_0x529a30[_0x9a21('0x1d')](','):null);},'get':function(){return this[_0x9a21('0x12')]('insecure')?this[_0x9a21('0x12')]('insecure')[_0x9a21('0x13')](','):null;},'comment':_0x9a21('0x24')},'trustrpid':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9a21('0x3')]('yes','no',_0x9a21('0x25'))},'promiscredir':{'type':Sequelize['ENUM'](_0x9a21('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no')},'accountcode':{'type':Sequelize[_0x9a21('0x26')](0xb)},'setvar':{'type':Sequelize[_0x9a21('0x7')]},'callerid':{'type':Sequelize[_0x9a21('0x7')],'defaultValue':_0x9a21('0x27')},'amaflags':{'type':Sequelize[_0x9a21('0x7')]},'callcounter':{'type':Sequelize['ENUM'](_0x9a21('0x18'),'no'),'defaultValue':_0x9a21('0x18')},'busylevel':{'type':Sequelize[_0x9a21('0x26')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x9a21('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x9a21('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x9a21('0x7')]},'videosupport':{'type':Sequelize['ENUM'](_0x9a21('0x18'),'no',_0x9a21('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9a21('0x3')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x29'),_0x9a21('0x2a'),_0x9a21('0x2b'))},'session_expires':{'type':Sequelize[_0x9a21('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x2c'),'uas'),'defaultValue':_0x9a21('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x9a21('0x7')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x9a21('0x7')]},'fromuser':{'type':Sequelize[_0x9a21('0x7')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no'),'defaultValue':_0x9a21('0x18')},'keepalive':{'type':Sequelize[_0x9a21('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x9a21('0x7')]},'defaultuser':{'type':Sequelize[_0x9a21('0x7')]},'rtptimeout':{'type':Sequelize[_0x9a21('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9a21('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9a21('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x9a21('0x3')]('yes','no',_0x9a21('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9a21('0x7')]},'callbackextension':{'type':Sequelize[_0x9a21('0x7')]},'timert1':{'type':Sequelize[_0x9a21('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x9a21('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x9a21('0x7')]},'contactdeny':{'type':Sequelize[_0x9a21('0x7')]},'contactacl':{'type':Sequelize[_0x9a21('0x7')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x9a21('0x26')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x9a21('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no')},'force_avp':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no')},'icesupport':{'type':Sequelize[_0x9a21('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no',_0x9a21('0x2f'),_0x9a21('0x30'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x9a21('0x7')]},'dtlscipher':{'type':Sequelize[_0x9a21('0x7')]},'dtlscafile':{'type':Sequelize[_0x9a21('0x7')]},'dtlscapath':{'type':Sequelize[_0x9a21('0x7')]},'dtlssetup':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x31'),_0x9a21('0x32'),_0x9a21('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9a21('0x7')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9a21('0x7')]},'recordofffeature':{'type':Sequelize[_0x9a21('0x7')]},'call_limit':{'type':Sequelize[_0x9a21('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x9a21('0x7')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9a21('0x7')],'defaultValue':_0x9a21('0x34')},'canreinvite':{'type':Sequelize[_0x9a21('0x3')](_0x9a21('0x18'),'no',_0x9a21('0x19'),_0x9a21('0x35'),_0x9a21('0x36')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9a21('0x7')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9a21('0x37')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
index d96d1fb..53dde15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0x59bd2b,_0x3cd231){var _0x2136b8=function(_0x1108b5){while(--_0x1108b5){_0x59bd2b['push'](_0x59bd2b['shift']());}};_0x2136b8(++_0x3cd231);}(_0x6aa7,0x178));var _0x76aa=function(_0x417f87,_0x26319d){_0x417f87=_0x417f87-0x0;var _0x2239b8=_0x6aa7[_0x417f87];return _0x2239b8;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));};
\ No newline at end of file
+var _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x1485bc,_0x5b33db){var _0x38adc7=function(_0x11cb92){while(--_0x11cb92){_0x1485bc['push'](_0x1485bc['shift']());}};_0x38adc7(++_0x5b33db);}(_0x3e74,0x175));var _0x43e7=function(_0x5f1205,_0x4fe1d4){_0x5f1205=_0x5f1205-0x0;var _0xd841cf=_0x3e74[_0x5f1205];return _0xd841cf;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));};
\ No newline at end of file
index 011d6cd..e51043d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe1a=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','Trunk','tools_trunks','lodash','util'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xfe1a,0x132));var _0xafe1=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xfe1a[_0x543084];return _0x306a57;};'use strict';var _=require(_0xafe1('0x0'));var util=require(_0xafe1('0x1'));var logger=require(_0xafe1('0x2'))('api');var moment=require(_0xafe1('0x3'));var BPromise=require(_0xafe1('0x4'));var rp=require(_0xafe1('0x5'));var fs=require('fs');var path=require(_0xafe1('0x6'));var rimraf=require('rimraf');var config=require(_0xafe1('0x7'));var attributes=require('./trunk.attributes');module['exports']=function(_0x2bd1c3,_0x3b4e3c){return _0x2bd1c3[_0xafe1('0x8')](_0xafe1('0x9'),attributes,{'tableName':_0xafe1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8375=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','Trunk','tools_trunks','lodash'];(function(_0x20cf28,_0x324bb8){var _0x4af1e2=function(_0xa6bcb8){while(--_0xa6bcb8){_0x20cf28['push'](_0x20cf28['shift']());}};_0x4af1e2(++_0x324bb8);}(_0x8375,0x1ed));var _0x5837=function(_0x4f0452,_0x23a1cc){_0x4f0452=_0x4f0452-0x0;var _0x52fa66=_0x8375[_0x4f0452];return _0x52fa66;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var logger=require(_0x5837('0x2'))(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var rp=require(_0x5837('0x6'));var fs=require('fs');var path=require(_0x5837('0x7'));var rimraf=require(_0x5837('0x8'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0x5837('0x9')]=function(_0x33d2fb,_0x170014){return _0x33d2fb[_0x5837('0xa')](_0x5837('0xb'),attributes,{'tableName':_0x5837('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 81e9a59..ce0e4d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc679=['rpc','../../config/environment','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','limit','include','map','model','attributes','then','debug','GetTrunk','Trunk','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0xc679,0x13c));var _0x9c67=function(_0x925481,_0x3f755e){_0x925481=_0x925481-0x0;var _0x3c5a3b=_0xc679[_0x925481];return _0x3c5a3b;};'use strict';var _=require(_0x9c67('0x0'));var util=require(_0x9c67('0x1'));var moment=require(_0x9c67('0x2'));var BPromise=require(_0x9c67('0x3'));var rs=require(_0x9c67('0x4'));var fs=require('fs');var Redis=require(_0x9c67('0x5'));var db=require(_0x9c67('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c67('0x7'))(_0x9c67('0x8'));var config=require(_0x9c67('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9c67('0xa')][_0x9c67('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33512a,_0x1b3dfd,_0x9e040d){return new BPromise(function(_0x3136ba,_0x1b547a){return client[_0x9c67('0xc')](_0x33512a,_0x9e040d)['then'](function(_0x55a974){logger[_0x9c67('0xd')](_0x9c67('0xe'),_0x1b3dfd,_0x9c67('0xf'));logger['debug'](_0x9c67('0x10'),_0x1b3dfd,_0x9c67('0xf'),JSON[_0x9c67('0x11')](_0x55a974));if(_0x55a974['error']){if(_0x55a974[_0x9c67('0x12')][_0x9c67('0x13')]===0x1f4){logger[_0x9c67('0x12')](_0x9c67('0xe'),_0x1b3dfd,_0x55a974[_0x9c67('0x12')][_0x9c67('0x14')]);return _0x1b547a(_0x55a974[_0x9c67('0x12')][_0x9c67('0x14')]);}logger['error'](_0x9c67('0xe'),_0x1b3dfd,_0x55a974['error'][_0x9c67('0x14')]);return _0x3136ba(_0x55a974[_0x9c67('0x12')][_0x9c67('0x14')]);}else{logger[_0x9c67('0xd')]('Trunk,\x20%s,\x20%s',_0x1b3dfd,'request\x20sent');_0x3136ba(_0x55a974['result'][_0x9c67('0x14')]);}})[_0x9c67('0x15')](function(_0x5ebb06){logger[_0x9c67('0x12')]('Trunk,\x20%s,\x20%s',_0x1b3dfd,_0x5ebb06);_0x1b547a(_0x5ebb06);});});}exports['GetTrunk']=function(_0x1be2a0){var _0x44aa68=this;return new Promise(function(_0x16a2a8,_0x138a49){return db['Trunk'][_0x9c67('0x16')]({'raw':_0x1be2a0[_0x9c67('0x17')]?_0x1be2a0[_0x9c67('0x17')][_0x9c67('0x18')]===undefined?!![]:![]:!![],'where':_0x1be2a0['options']?_0x1be2a0['options']['where']||null:null,'attributes':_0x1be2a0['options']?_0x1be2a0['options']['attributes']||null:null,'limit':_0x1be2a0['options']?_0x1be2a0['options'][_0x9c67('0x19')]||null:null,'include':_0x1be2a0[_0x9c67('0x17')]?_0x1be2a0[_0x9c67('0x17')][_0x9c67('0x1a')]?_[_0x9c67('0x1b')](_0x1be2a0[_0x9c67('0x17')][_0x9c67('0x1a')],function(_0xb292e9){return{'model':db[_0xb292e9[_0x9c67('0x1c')]],'as':_0xb292e9['as'],'attributes':_0xb292e9[_0x9c67('0x1d')],'include':_0xb292e9[_0x9c67('0x1a')]?_['map'](_0xb292e9[_0x9c67('0x1a')],function(_0x960877){return{'model':db[_0x960877['model']],'as':_0x960877['as'],'attributes':_0x960877['attributes'],'include':_0x960877[_0x9c67('0x1a')]?_['map'](_0x960877['include'],function(_0x5756c0){return{'model':db[_0x5756c0[_0x9c67('0x1c')]],'as':_0x5756c0['as'],'attributes':_0x5756c0[_0x9c67('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9c67('0x1e')](function(_0x3ffeb0){logger[_0x9c67('0xd')]('GetTrunk',_0x1be2a0);logger[_0x9c67('0x1f')](_0x9c67('0x20'),_0x1be2a0,JSON[_0x9c67('0x11')](_0x3ffeb0));_0x16a2a8(_0x3ffeb0);})['catch'](function(_0x1b1705){logger[_0x9c67('0x12')](_0x9c67('0x20'),_0x1b1705[_0x9c67('0x14')],_0x1be2a0);_0x138a49(_0x44aa68[_0x9c67('0x12')](0x1f4,_0x1b1705['message']));});});};exports['ShowTrunk']=function(_0x1e88a1){var _0xe78b14=this;return new Promise(function(_0xff0b9f,_0x55e73c){return db[_0x9c67('0x21')][_0x9c67('0x22')]({'raw':_0x1e88a1[_0x9c67('0x17')]?_0x1e88a1['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e88a1['options']?_0x1e88a1[_0x9c67('0x17')]['where']||null:null,'attributes':_0x1e88a1[_0x9c67('0x17')]?_0x1e88a1['options'][_0x9c67('0x1d')]||null:null,'include':_0x1e88a1[_0x9c67('0x17')]?_0x1e88a1['options']['include']?_[_0x9c67('0x1b')](_0x1e88a1[_0x9c67('0x17')][_0x9c67('0x1a')],function(_0x1397f9){return{'model':db[_0x1397f9[_0x9c67('0x1c')]],'as':_0x1397f9['as'],'attributes':_0x1397f9[_0x9c67('0x1d')],'include':_0x1397f9[_0x9c67('0x1a')]?_[_0x9c67('0x1b')](_0x1397f9[_0x9c67('0x1a')],function(_0x49cfd4){return{'model':db[_0x49cfd4['model']],'as':_0x49cfd4['as'],'attributes':_0x49cfd4[_0x9c67('0x1d')],'include':_0x49cfd4[_0x9c67('0x1a')]?_[_0x9c67('0x1b')](_0x49cfd4['include'],function(_0x582073){return{'model':db[_0x582073[_0x9c67('0x1c')]],'as':_0x582073['as'],'attributes':_0x582073[_0x9c67('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9c67('0x1e')](function(_0x13500c){logger[_0x9c67('0xd')]('ShowTrunk',_0x1e88a1);logger[_0x9c67('0x1f')](_0x9c67('0x23'),_0x1e88a1,JSON[_0x9c67('0x11')](_0x13500c));_0xff0b9f(_0x13500c);})[_0x9c67('0x15')](function(_0x2e59e0){logger[_0x9c67('0x12')](_0x9c67('0x23'),_0x2e59e0['message'],_0x1e88a1);_0x55e73c(_0xe78b14[_0x9c67('0x12')](0x1f4,_0x2e59e0[_0x9c67('0x14')]));});});};
\ No newline at end of file
+var _0xbb32=['request\x20sent','stringify','error','message','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','find','ShowTrunk','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Trunk,\x20%s,\x20%s','debug'];(function(_0x5f3cbc,_0x59f484){var _0x1f4bb5=function(_0x5f29b2){while(--_0x5f29b2){_0x5f3cbc['push'](_0x5f3cbc['shift']());}};_0x1f4bb5(++_0x59f484);}(_0xbb32,0xf8));var _0x2bb3=function(_0x504f7b,_0x1ac4e0){_0x504f7b=_0x504f7b-0x0;var _0x2b0904=_0xbb32[_0x504f7b];return _0x2b0904;};'use strict';var _=require(_0x2bb3('0x0'));var util=require(_0x2bb3('0x1'));var moment=require(_0x2bb3('0x2'));var BPromise=require('bluebird');var rs=require(_0x2bb3('0x3'));var fs=require('fs');var Redis=require(_0x2bb3('0x4'));var db=require(_0x2bb3('0x5'))['db'];var utils=require(_0x2bb3('0x6'));var logger=require(_0x2bb3('0x7'))(_0x2bb3('0x8'));var config=require(_0x2bb3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2bb3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x102da8,_0x5d5ee5,_0xe0a75){return new BPromise(function(_0x1a78a2,_0x2a0d7){return client[_0x2bb3('0xb')](_0x102da8,_0xe0a75)[_0x2bb3('0xc')](function(_0x53dab6){logger[_0x2bb3('0xd')](_0x2bb3('0xe'),_0x5d5ee5,'request\x20sent');logger[_0x2bb3('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5d5ee5,_0x2bb3('0x10'),JSON[_0x2bb3('0x11')](_0x53dab6));if(_0x53dab6[_0x2bb3('0x12')]){if(_0x53dab6[_0x2bb3('0x12')]['code']===0x1f4){logger[_0x2bb3('0x12')](_0x2bb3('0xe'),_0x5d5ee5,_0x53dab6[_0x2bb3('0x12')]['message']);return _0x2a0d7(_0x53dab6[_0x2bb3('0x12')][_0x2bb3('0x13')]);}logger[_0x2bb3('0x12')]('Trunk,\x20%s,\x20%s',_0x5d5ee5,_0x53dab6[_0x2bb3('0x12')][_0x2bb3('0x13')]);return _0x1a78a2(_0x53dab6['error']['message']);}else{logger[_0x2bb3('0xd')](_0x2bb3('0xe'),_0x5d5ee5,_0x2bb3('0x10'));_0x1a78a2(_0x53dab6['result'][_0x2bb3('0x13')]);}})[_0x2bb3('0x14')](function(_0x4f1743){logger['error'](_0x2bb3('0xe'),_0x5d5ee5,_0x4f1743);_0x2a0d7(_0x4f1743);});});}exports[_0x2bb3('0x15')]=function(_0x18962f){var _0x26f577=this;return new Promise(function(_0x5eb57f,_0x2d48e6){return db[_0x2bb3('0x16')][_0x2bb3('0x17')]({'raw':_0x18962f['options']?_0x18962f[_0x2bb3('0x18')][_0x2bb3('0x19')]===undefined?!![]:![]:!![],'where':_0x18962f[_0x2bb3('0x18')]?_0x18962f['options'][_0x2bb3('0x1a')]||null:null,'attributes':_0x18962f[_0x2bb3('0x18')]?_0x18962f[_0x2bb3('0x18')][_0x2bb3('0x1b')]||null:null,'limit':_0x18962f['options']?_0x18962f['options']['limit']||null:null,'include':_0x18962f[_0x2bb3('0x18')]?_0x18962f['options'][_0x2bb3('0x1c')]?_[_0x2bb3('0x1d')](_0x18962f[_0x2bb3('0x18')]['include'],function(_0x28c538){return{'model':db[_0x28c538[_0x2bb3('0x1e')]],'as':_0x28c538['as'],'attributes':_0x28c538['attributes'],'include':_0x28c538[_0x2bb3('0x1c')]?_[_0x2bb3('0x1d')](_0x28c538[_0x2bb3('0x1c')],function(_0x12d8f6){return{'model':db[_0x12d8f6['model']],'as':_0x12d8f6['as'],'attributes':_0x12d8f6['attributes'],'include':_0x12d8f6[_0x2bb3('0x1c')]?_['map'](_0x12d8f6['include'],function(_0x548d45){return{'model':db[_0x548d45[_0x2bb3('0x1e')]],'as':_0x548d45['as'],'attributes':_0x548d45[_0x2bb3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2bb3('0xc')](function(_0x37ec23){logger[_0x2bb3('0xd')](_0x2bb3('0x15'),_0x18962f);logger[_0x2bb3('0xf')](_0x2bb3('0x15'),_0x18962f,JSON['stringify'](_0x37ec23));_0x5eb57f(_0x37ec23);})[_0x2bb3('0x14')](function(_0x1ad705){logger['error'](_0x2bb3('0x15'),_0x1ad705[_0x2bb3('0x13')],_0x18962f);_0x2d48e6(_0x26f577[_0x2bb3('0x12')](0x1f4,_0x1ad705[_0x2bb3('0x13')]));});});};exports['ShowTrunk']=function(_0x513869){var _0x1c5024=this;return new Promise(function(_0x305c61,_0x30a95b){return db[_0x2bb3('0x16')][_0x2bb3('0x1f')]({'raw':_0x513869[_0x2bb3('0x18')]?_0x513869['options'][_0x2bb3('0x19')]===undefined?!![]:![]:!![],'where':_0x513869[_0x2bb3('0x18')]?_0x513869[_0x2bb3('0x18')][_0x2bb3('0x1a')]||null:null,'attributes':_0x513869[_0x2bb3('0x18')]?_0x513869['options'][_0x2bb3('0x1b')]||null:null,'include':_0x513869[_0x2bb3('0x18')]?_0x513869['options']['include']?_[_0x2bb3('0x1d')](_0x513869[_0x2bb3('0x18')][_0x2bb3('0x1c')],function(_0x2e1319){return{'model':db[_0x2e1319[_0x2bb3('0x1e')]],'as':_0x2e1319['as'],'attributes':_0x2e1319['attributes'],'include':_0x2e1319[_0x2bb3('0x1c')]?_[_0x2bb3('0x1d')](_0x2e1319[_0x2bb3('0x1c')],function(_0x36aa52){return{'model':db[_0x36aa52[_0x2bb3('0x1e')]],'as':_0x36aa52['as'],'attributes':_0x36aa52[_0x2bb3('0x1b')],'include':_0x36aa52[_0x2bb3('0x1c')]?_[_0x2bb3('0x1d')](_0x36aa52['include'],function(_0x31d05e){return{'model':db[_0x31d05e[_0x2bb3('0x1e')]],'as':_0x31d05e['as'],'attributes':_0x31d05e[_0x2bb3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2bb3('0xc')](function(_0x5897af){logger[_0x2bb3('0xd')](_0x2bb3('0x20'),_0x513869);logger[_0x2bb3('0xf')](_0x2bb3('0x20'),_0x513869,JSON[_0x2bb3('0x11')](_0x5897af));_0x305c61(_0x5897af);})['catch'](function(_0x93fc0f){logger['error']('ShowTrunk',_0x93fc0f[_0x2bb3('0x13')],_0x513869);_0x30a95b(_0x1c5024[_0x2bb3('0x12')](0x1f4,_0x93fc0f[_0x2bb3('0x13')]));});});};
\ No newline at end of file
index 44222b2..a13e7fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3951=['Router','./user-setting.controller','/:id','isAuthenticated','update'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x3951,0x168));var _0x1395=function(_0x2affd6,_0xc7d7f9){_0x2affd6=_0x2affd6-0x0;var _0xe4096b=_0x3951[_0x2affd6];return _0xe4096b;};'use strict';var express=require('express');var router=express[_0x1395('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x1395('0x1'));router['put'](_0x1395('0x2'),auth[_0x1395('0x3')](),controller[_0x1395('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xf795=['./user-setting.controller','/:id','isAuthenticated','update','exports','../../components/auth/service'];(function(_0x5a3651,_0x3c8cac){var _0x3d0604=function(_0x39c53e){while(--_0x39c53e){_0x5a3651['push'](_0x5a3651['shift']());}};_0x3d0604(++_0x3c8cac);}(_0xf795,0xf5));var _0x5f79=function(_0xec9322,_0x2d5b87){_0xec9322=_0xec9322-0x0;var _0x39d576=_0xf795[_0xec9322];return _0x39d576;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x5f79('0x0'));var controller=require(_0x5f79('0x1'));router['put'](_0x5f79('0x2'),auth[_0x5f79('0x3')](),controller[_0x5f79('0x4')]);module[_0x5f79('0x5')]=router;
\ No newline at end of file
index 4a64d72..5af63ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3ba=['TEXT','UserId','sequelize','error','warning','debug','exports','ENUM','BOOLEAN'];(function(_0x437e6e,_0x14919b){var _0xefdbe6=function(_0x3493a4){while(--_0x3493a4){_0x437e6e['push'](_0x437e6e['shift']());}};_0xefdbe6(++_0x14919b);}(_0xa3ba,0xad));var _0xaa3b=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0xa3ba[_0x7185f7];return _0x182e45;};'use strict';var Sequelize=require(_0xaa3b('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xaa3b('0x1'),_0xaa3b('0x2'),'info',_0xaa3b('0x3')];module[_0xaa3b('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xaa3b('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xaa3b('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xaa3b('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xaa3b('0x8')}};
\ No newline at end of file
+var _0x94f5=['error','warning','info','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x94f5,0x1ac));var _0x594f=function(_0x281dc6,_0x23b228){_0x281dc6=_0x281dc6-0x0;var _0x48960c=_0x94f5[_0x281dc6];return _0x48960c;};'use strict';var Sequelize=require(_0x594f('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x594f('0x1'),_0x594f('0x2'),_0x594f('0x3'),'debug'];module[_0x594f('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x594f('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x594f('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x594f('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x594f('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x594f('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x594f('0x9')],'unique':_0x594f('0xa')}};
\ No newline at end of file
index 620616d..5659ef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d25=['redis','register','defaults','localhost','json','update','then','sendStatus','error','name','user','role','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter'];(function(_0x57afbe,_0x3f7679){var _0x5541d7=function(_0x44fd9c){while(--_0x44fd9c){_0x57afbe['push'](_0x57afbe['shift']());}};_0x5541d7(++_0x3f7679);}(_0x1d25,0xba));var _0x51d2=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x1d25[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x51d2('0x0'));var Redis=require(_0x51d2('0x1'));var logger=require(_0x51d2('0x2'))(_0x51d2('0x3'));var config=require(_0x51d2('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x51d2('0x5'))(new Redis(config[_0x51d2('0x6')]));require('./user-setting.socket')[_0x51d2('0x7')](socket);config[_0x51d2('0x6')]=_[_0x51d2('0x8')](config[_0x51d2('0x6')],{'host':_0x51d2('0x9'),'port':0x18eb});function respondWithResult(_0x2e6956,_0x56edda){_0x56edda=_0x56edda||0xc8;return function(_0x18e8a9){if(_0x18e8a9){return _0x2e6956['status'](_0x56edda)[_0x51d2('0xa')](_0x18e8a9);}};}function saveUpdates(_0x4dfc7e){return function(_0x532061){if(_0x532061){return _0x532061[_0x51d2('0xb')](_0x4dfc7e)[_0x51d2('0xc')](function(_0x39cf55){return _0x39cf55;});}return null;};}function handleEntityNotFound(_0x359fb6){return function(_0x50f9b4){if(!_0x50f9b4){_0x359fb6[_0x51d2('0xd')](0x194);}return _0x50f9b4;};}function handleError(_0x46c9e8,_0x32d0ff){_0x32d0ff=_0x32d0ff||0x1f4;return function(_0xc69291){logger[_0x51d2('0xe')](_0xc69291['stack']);if(_0xc69291[_0x51d2('0xf')]){delete _0xc69291[_0x51d2('0xf')];}_0x46c9e8['status'](_0x32d0ff)['send'](_0xc69291);};}exports[_0x51d2('0xb')]=function(_0x1f81e4,_0x43ddf6){if(_0x1f81e4[_0x51d2('0x10')][_0x51d2('0x11')]!=='admin')throw new Error(_0x51d2('0x12'));if(isNaN(Number(_0x1f81e4['params']['id'])))throw new Error(_0x51d2('0x13'));return db[_0x51d2('0x14')][_0x51d2('0x15')]({'where':{'id':_0x1f81e4['params']['id']}})[_0x51d2('0xc')](handleEntityNotFound(_0x43ddf6,null))[_0x51d2('0xc')](saveUpdates(_0x1f81e4[_0x51d2('0x16')],null))[_0x51d2('0xc')](respondWithResult(_0x43ddf6,null))[_0x51d2('0x17')](handleError(_0x43ddf6,null));};
\ No newline at end of file
+var _0x3667=['body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','redis','register','defaults','localhost','status','json','update','then','sendStatus','error','stack','name','send','user','role','admin','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','params'];(function(_0xf91532,_0x4fef44){var _0x16955c=function(_0x2b2315){while(--_0x2b2315){_0xf91532['push'](_0xf91532['shift']());}};_0x16955c(++_0x4fef44);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var Redis=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var config=require(_0x7366('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x7366('0x5'))(new Redis(config[_0x7366('0x6')]));require('./user-setting.socket')[_0x7366('0x7')](socket);config[_0x7366('0x6')]=_[_0x7366('0x8')](config[_0x7366('0x6')],{'host':_0x7366('0x9'),'port':0x18eb});function respondWithResult(_0x589397,_0x28f6c8){_0x28f6c8=_0x28f6c8||0xc8;return function(_0xa1a3c5){if(_0xa1a3c5){return _0x589397[_0x7366('0xa')](_0x28f6c8)[_0x7366('0xb')](_0xa1a3c5);}};}function saveUpdates(_0x171fe2){return function(_0x108455){if(_0x108455){return _0x108455[_0x7366('0xc')](_0x171fe2)[_0x7366('0xd')](function(_0x18aee5){return _0x18aee5;});}return null;};}function handleEntityNotFound(_0x3cb737){return function(_0x7c3c01){if(!_0x7c3c01){_0x3cb737[_0x7366('0xe')](0x194);}return _0x7c3c01;};}function handleError(_0x57ea7f,_0x425ee4){_0x425ee4=_0x425ee4||0x1f4;return function(_0x2694fc){logger[_0x7366('0xf')](_0x2694fc[_0x7366('0x10')]);if(_0x2694fc[_0x7366('0x11')]){delete _0x2694fc[_0x7366('0x11')];}_0x57ea7f[_0x7366('0xa')](_0x425ee4)[_0x7366('0x12')](_0x2694fc);};}exports[_0x7366('0xc')]=function(_0x1813b7,_0x44d163){if(_0x1813b7[_0x7366('0x13')][_0x7366('0x14')]!==_0x7366('0x15'))throw new Error(_0x7366('0x16'));if(isNaN(Number(_0x1813b7['params']['id'])))throw new Error(_0x7366('0x17'));return db[_0x7366('0x18')][_0x7366('0x19')]({'where':{'id':_0x1813b7[_0x7366('0x1a')]['id']}})[_0x7366('0xd')](handleEntityNotFound(_0x44d163,null))[_0x7366('0xd')](saveUpdates(_0x1813b7[_0x7366('0x1b')],null))[_0x7366('0xd')](respondWithResult(_0x44d163,null))[_0x7366('0x1c')](handleError(_0x44d163,null));};
\ No newline at end of file
index 67a4bf8..52f4b13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a2d=['emit','hook','events','../../mysqldb','UserSetting','setMaxListeners','save','update','remove'];(function(_0x4398eb,_0x4eb3d8){var _0x8ba8b0=function(_0x133add){while(--_0x133add){_0x4398eb['push'](_0x4398eb['shift']());}};_0x8ba8b0(++_0x4eb3d8);}(_0x4a2d,0x12b));var _0xd4a2=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0x4a2d[_0x5cb97e];return _0x1714b4;};'use strict';var EventEmitter=require(_0xd4a2('0x0'));var UserSetting=require(_0xd4a2('0x1'))['db'][_0xd4a2('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xd4a2('0x3')](0x0);var events={'afterCreate':_0xd4a2('0x4'),'afterUpdate':_0xd4a2('0x5'),'afterDestroy':_0xd4a2('0x6')};function emitEvent(_0x5b881f){return function(_0x543832,_0x4667ed,_0x2e0234){UserSettingEvents[_0xd4a2('0x7')](_0x5b881f+':'+_0x543832['id'],_0x543832);UserSettingEvents[_0xd4a2('0x7')](_0x5b881f,_0x543832);_0x2e0234(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xd4a2('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents;
\ No newline at end of file
+var _0xdbe0=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x582b0f,_0x35a9de){var _0x4658f0=function(_0x106924){while(--_0x106924){_0x582b0f['push'](_0x582b0f['shift']());}};_0x4658f0(++_0x35a9de);}(_0xdbe0,0x137));var _0x0dbe=function(_0x40c0e5,_0x46b96d){_0x40c0e5=_0x40c0e5-0x0;var _0x3deeea=_0xdbe0[_0x40c0e5];return _0x3deeea;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x0dbe('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x0dbe('0x1')](0x0);var events={'afterCreate':_0x0dbe('0x2'),'afterUpdate':_0x0dbe('0x3'),'afterDestroy':_0x0dbe('0x4')};function emitEvent(_0x59804d){return function(_0x199510,_0x3dcf2a,_0x3437e4){UserSettingEvents[_0x0dbe('0x5')](_0x59804d+':'+_0x199510['id'],_0x199510);UserSettingEvents[_0x0dbe('0x5')](_0x59804d,_0x199510);_0x3437e4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x0dbe('0x6')]=UserSettingEvents;
\ No newline at end of file
index 6bb5a40..eb37518 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b02=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5b02,0xe9));var _0x25b0=function(_0x79569,_0x38a888){_0x79569=_0x79569-0x0;var _0x2ca90b=_0x5b02[_0x79569];return _0x2ca90b;};'use strict';var attributes=require(_0x25b0('0x0'));module[_0x25b0('0x1')]=function(_0x428458){return _0x428458[_0x25b0('0x2')]('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b5f2d){if(!_0x2b5f2d['clientSideLoggingEnabled'])_0x2b5f2d[_0x25b0('0x3')]=null;else if(_0x2b5f2d[_0x25b0('0x3')]===null)_0x2b5f2d[_0x25b0('0x3')]=new Date();}}});};
\ No newline at end of file
+var _0x44a3=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44a3,0x1a9));var _0x344a=function(_0x3937b6,_0xd53d2b){_0x3937b6=_0x3937b6-0x0;var _0x1ba356=_0x44a3[_0x3937b6];return _0x1ba356;};'use strict';var attributes=require(_0x344a('0x0'));module[_0x344a('0x1')]=function(_0x3fa916){return _0x3fa916[_0x344a('0x2')](_0x344a('0x3'),attributes,{'tableName':_0x344a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bb844){if(!_0x3bb844[_0x344a('0x5')])_0x3bb844['clientSideLoggingEnabledSince']=null;else if(_0x3bb844[_0x344a('0x6')]===null)_0x3bb844[_0x344a('0x6')]=new Date();}}});};
\ No newline at end of file
index 8abc6b9..434d4c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c6=['remove','update','user-setting:update','emit','user-setting:update:user-','UserId','length','./user-setting.events','save'];(function(_0x225712,_0x4f5b90){var _0x286076=function(_0x35a35b){while(--_0x35a35b){_0x225712['push'](_0x225712['shift']());}};_0x286076(++_0x4f5b90);}(_0xc1c6,0x166));var _0x6c1c=function(_0x21e82,_0x3660ca){_0x21e82=_0x21e82-0x0;var _0x223250=_0xc1c6[_0x21e82];return _0x223250;};'use strict';var UserSettingEvents=require(_0x6c1c('0x0'));var events=[_0x6c1c('0x1'),_0x6c1c('0x2'),_0x6c1c('0x3')];function createListener(_0x207d84,_0x549d81){return function(_0x3e9646){_0x549d81['emit'](_0x207d84,_0x3e9646);if(_0x207d84===_0x6c1c('0x4')){_0x549d81[_0x6c1c('0x5')](_0x6c1c('0x6')+_0x3e9646[_0x6c1c('0x7')],_0x3e9646);}};}exports['register']=function(_0x41b72b){for(var _0x36583c=0x0,_0x327a3e=events[_0x6c1c('0x8')];_0x36583c<_0x327a3e;_0x36583c++){var _0x135e23=events[_0x36583c];var _0x39ebf6=createListener('user-setting:'+_0x135e23,_0x41b72b);UserSettingEvents['on'](_0x135e23,_0x39ebf6);}};
\ No newline at end of file
+var _0x8c71=['update','emit','user-setting:update','user-setting:update:user-','register','length','user-setting:','./user-setting.events','remove'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8c71,0x1db));var _0x18c7=function(_0x16f88c,_0x2aad29){_0x16f88c=_0x16f88c-0x0;var _0x20ab2e=_0x8c71[_0x16f88c];return _0x20ab2e;};'use strict';var UserSettingEvents=require(_0x18c7('0x0'));var events=['save',_0x18c7('0x1'),_0x18c7('0x2')];function createListener(_0x328b78,_0x558e94){return function(_0xc2c9b2){_0x558e94[_0x18c7('0x3')](_0x328b78,_0xc2c9b2);if(_0x328b78===_0x18c7('0x4')){_0x558e94[_0x18c7('0x3')](_0x18c7('0x5')+_0xc2c9b2['UserId'],_0xc2c9b2);}};}exports[_0x18c7('0x6')]=function(_0x51c251){for(var _0x2f4a03=0x0,_0x3d1035=events[_0x18c7('0x7')];_0x2f4a03<_0x3d1035;_0x2f4a03++){var _0x121513=events[_0x2f4a03];var _0x1bffb6=createListener(_0x18c7('0x8')+_0x121513,_0x51c251);UserSettingEvents['on'](_0x121513,_0x1bffb6);}};
\ No newline at end of file
index c7f2613..b126ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1765=['/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','format','%s-%s','/:id/avatar','single','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1765,0xc3));var _0x5176=function(_0x56ea6f,_0x15535a){_0x56ea6f=_0x56ea6f-0x0;var _0x43ac31=_0x1765[_0x56ea6f];return _0x43ac31;};'use strict';var multer=require(_0x5176('0x0'));var util=require('util');var path=require(_0x5176('0x1'));var timeout=require(_0x5176('0x2'));var express=require(_0x5176('0x3'));var router=express[_0x5176('0x4')]();var fs_extra=require(_0x5176('0x5'));var auth=require(_0x5176('0x6'));var interaction=require(_0x5176('0x7'));var config=require(_0x5176('0x8'));var controller=require('./user.controller');router[_0x5176('0x9')]('/',auth[_0x5176('0xa')](),controller[_0x5176('0xb')]);router[_0x5176('0x9')](_0x5176('0xc'),auth['isAuthenticated'](),controller[_0x5176('0xd')]);router['get'](_0x5176('0xe'),auth[_0x5176('0xa')](),controller['whoami']);router['get'](_0x5176('0xf'),auth[_0x5176('0xa')](),controller[_0x5176('0x10')]);router['get'](_0x5176('0x11'),auth[_0x5176('0xa')](),controller['show']);router[_0x5176('0x9')]('/:id/avatar',controller[_0x5176('0x12')]);router['get'](_0x5176('0x13'),auth['isAuthenticated'](),controller[_0x5176('0x14')]);router[_0x5176('0x9')](_0x5176('0x15'),auth[_0x5176('0xa')](),controller[_0x5176('0x16')]);router['get']('/:id/queues',auth['isAuthenticated'](),controller[_0x5176('0x17')]);router[_0x5176('0x9')](_0x5176('0x18'),auth[_0x5176('0xa')](),controller[_0x5176('0x19')]);router[_0x5176('0x9')]('/:id/groups',auth[_0x5176('0xa')](),controller[_0x5176('0x1a')]);router['get'](_0x5176('0x1b'),auth[_0x5176('0xa')](),controller[_0x5176('0x1c')]);router[_0x5176('0x9')](_0x5176('0x1d'),auth['isAuthenticated'](),controller[_0x5176('0x1e')]);router[_0x5176('0x9')]('/:id/chat/interactions',auth[_0x5176('0xa')](),controller[_0x5176('0x1f')]);router[_0x5176('0x9')](_0x5176('0x20'),auth[_0x5176('0xa')](),controller['getOpenchannelInteractions']);router[_0x5176('0x9')](_0x5176('0x21'),auth[_0x5176('0xa')](),controller[_0x5176('0x22')]);router[_0x5176('0x9')](_0x5176('0x23'),auth[_0x5176('0xa')](),controller[_0x5176('0x24')]);router[_0x5176('0x9')](_0x5176('0x25'),auth[_0x5176('0xa')](),controller[_0x5176('0x26')]);router[_0x5176('0x9')](_0x5176('0x27'),auth[_0x5176('0xa')](),controller[_0x5176('0x28')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x5176('0x29')]);router[_0x5176('0x9')](_0x5176('0x2a'),auth[_0x5176('0xa')](),controller[_0x5176('0x2b')]);router[_0x5176('0x9')]('/:id/agents',auth['isAuthenticated'](),controller[_0x5176('0x2c')]);router[_0x5176('0x9')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x5176('0x2d')]);router[_0x5176('0x9')](_0x5176('0x2e'),auth[_0x5176('0xa')](),controller['getFaxAccounts']);router['get'](_0x5176('0x2f'),auth['isAuthenticated'](),controller[_0x5176('0x30')]);router[_0x5176('0x9')](_0x5176('0x31'),auth['isAuthenticated'](),controller[_0x5176('0x32')]);router['get'](_0x5176('0x33'),auth['isAuthenticated'](),controller[_0x5176('0x34')]);router[_0x5176('0x9')]('/:id/chat_websites',auth[_0x5176('0xa')](),controller[_0x5176('0x35')]);router[_0x5176('0x9')](_0x5176('0x36'),auth[_0x5176('0xa')](),controller['getWhatsappAccounts']);router[_0x5176('0x9')](_0x5176('0x37'),auth[_0x5176('0xa')](),controller[_0x5176('0x38')]);router[_0x5176('0x9')]('/:id/scheduled_calls',auth[_0x5176('0xa')](),controller[_0x5176('0x39')]);router['get'](_0x5176('0x3a'),auth['isAuthenticated'](),controller[_0x5176('0x3b')]);router[_0x5176('0x3c')](_0x5176('0x15'),auth[_0x5176('0xa')](),controller[_0x5176('0x3d')]);router[_0x5176('0x3c')]('/',auth[_0x5176('0xa')](),controller[_0x5176('0x3e')]);router[_0x5176('0x3c')](_0x5176('0x3f'),auth[_0x5176('0xa')](),controller[_0x5176('0x40')]);router[_0x5176('0x3c')](_0x5176('0x41'),auth['isAuthenticated'](),controller[_0x5176('0x42')]);var upload=multer({'storage':multer[_0x5176('0x43')]({'destination':function(_0x893d7c,_0x1a25fa,_0x8e7049){_0x8e7049(null,path[_0x5176('0x44')](config['root'],'server/files/images/'));},'filename':function(_0x1a7111,_0x577c68,_0x3cac6d){_0x3cac6d(null,util[_0x5176('0x45')](_0x5176('0x46'),Date['now'](),_0x577c68['originalname']));}})});router[_0x5176('0x3c')](_0x5176('0x47'),upload[_0x5176('0x48')]('file'),controller['addAvatar']);router[_0x5176('0x3c')](_0x5176('0x49'),auth[_0x5176('0xa')](),controller[_0x5176('0x4a')]);router[_0x5176('0x3c')](_0x5176('0x4b'),auth[_0x5176('0xa')](),controller[_0x5176('0x4c')]);router['post']('/:id/pause',auth[_0x5176('0xa')](),controller[_0x5176('0x4d')]);router[_0x5176('0x3c')](_0x5176('0x4e'),auth[_0x5176('0xa')](),controller[_0x5176('0x4f')]);router['post'](_0x5176('0x50'),auth[_0x5176('0xa')](),controller[_0x5176('0x51')]);router[_0x5176('0x3c')](_0x5176('0x52'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x5176('0x3c')](_0x5176('0x53'),auth[_0x5176('0xa')](),controller[_0x5176('0x54')]);router['post']('/:id/fax_interactions',auth[_0x5176('0xa')](),controller[_0x5176('0x55')]);router[_0x5176('0x3c')](_0x5176('0x56'),auth[_0x5176('0xa')](),controller[_0x5176('0x57')]);router[_0x5176('0x3c')](_0x5176('0x58'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router['post']('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['addWhatsappInteractions']);router['post'](_0x5176('0x2e'),auth[_0x5176('0xa')](),controller[_0x5176('0x59')]);router[_0x5176('0x3c')](_0x5176('0x2f'),auth[_0x5176('0xa')](),controller[_0x5176('0x5a')]);router['post']('/:id/openchannel_accounts',auth[_0x5176('0xa')](),controller[_0x5176('0x5b')]);router[_0x5176('0x3c')](_0x5176('0x33'),auth[_0x5176('0xa')](),controller[_0x5176('0x5c')]);router['post'](_0x5176('0x5d'),auth['isAuthenticated'](),controller[_0x5176('0x5e')]);router[_0x5176('0x3c')](_0x5176('0x36'),auth[_0x5176('0xa')](),controller['addWhatsappAccounts']);router[_0x5176('0x3c')](_0x5176('0x37'),auth['isAuthenticated'](),controller[_0x5176('0x5f')]);router['post'](_0x5176('0x3a'),auth['isAuthenticated'](),controller[_0x5176('0x60')]);router[_0x5176('0x61')](_0x5176('0x11'),auth[_0x5176('0xa')](),controller[_0x5176('0x62')]);router[_0x5176('0x61')](_0x5176('0x63'),auth[_0x5176('0xa')](),controller[_0x5176('0x64')]);router['delete'](_0x5176('0x41'),auth[_0x5176('0xa')](),controller['removeQueues']);router[_0x5176('0x65')](_0x5176('0x50'),auth[_0x5176('0xa')](),controller[_0x5176('0x66')]);router[_0x5176('0x65')](_0x5176('0x11'),auth['isAuthenticated'](),controller[_0x5176('0x67')]);router[_0x5176('0x65')](_0x5176('0x52'),auth[_0x5176('0xa')](),controller[_0x5176('0x68')]);router['delete'](_0x5176('0x53'),auth[_0x5176('0xa')](),controller['removeMailInteractions']);router[_0x5176('0x65')](_0x5176('0x69'),auth[_0x5176('0xa')](),controller['removeFaxInteractions']);router['delete'](_0x5176('0x56'),auth['isAuthenticated'](),controller[_0x5176('0x6a')]);router[_0x5176('0x65')](_0x5176('0x58'),auth['isAuthenticated'](),controller[_0x5176('0x6b')]);router['delete'](_0x5176('0x6c'),auth[_0x5176('0xa')](),controller[_0x5176('0x6d')]);router[_0x5176('0x65')](_0x5176('0x2e'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x5176('0x65')](_0x5176('0x2f'),auth[_0x5176('0xa')](),controller[_0x5176('0x6e')]);router[_0x5176('0x65')]('/:id/openchannel_accounts',auth[_0x5176('0xa')](),controller['removeOpenchannelAccounts']);router[_0x5176('0x65')]('/:id/sms_accounts',auth[_0x5176('0xa')](),controller[_0x5176('0x6f')]);router['delete'](_0x5176('0x5d'),auth[_0x5176('0xa')](),controller[_0x5176('0x70')]);router['delete'](_0x5176('0x36'),auth[_0x5176('0xa')](),controller[_0x5176('0x71')]);router['delete'](_0x5176('0x37'),auth[_0x5176('0xa')](),controller[_0x5176('0x72')]);router[_0x5176('0x65')](_0x5176('0x3a'),auth[_0x5176('0xa')](),controller[_0x5176('0x73')]);module[_0x5176('0x74')]=router;
\ No newline at end of file
+var _0x75a8=['addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','root','server/files/images/','now','originalname','file','addAvatar','/:id/login','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts'];(function(_0x2efe75,_0x3cf3fb){var _0x6c6ef8=function(_0x2a22c3){while(--_0x2a22c3){_0x2efe75['push'](_0x2efe75['shift']());}};_0x6c6ef8(++_0x3cf3fb);}(_0x75a8,0x1f2));var _0x875a=function(_0x19958f,_0x56c415){_0x19958f=_0x19958f-0x0;var _0x47e2a7=_0x75a8[_0x19958f];return _0x47e2a7;};'use strict';var multer=require(_0x875a('0x0'));var util=require('util');var path=require(_0x875a('0x1'));var timeout=require(_0x875a('0x2'));var express=require(_0x875a('0x3'));var router=express[_0x875a('0x4')]();var fs_extra=require(_0x875a('0x5'));var auth=require(_0x875a('0x6'));var interaction=require(_0x875a('0x7'));var config=require(_0x875a('0x8'));var controller=require(_0x875a('0x9'));router['get']('/',auth[_0x875a('0xa')](),controller[_0x875a('0xb')]);router[_0x875a('0xc')](_0x875a('0xd'),auth[_0x875a('0xa')](),controller['describe']);router[_0x875a('0xc')](_0x875a('0xe'),auth[_0x875a('0xa')](),controller[_0x875a('0xf')]);router[_0x875a('0xc')](_0x875a('0x10'),auth[_0x875a('0xa')](),controller[_0x875a('0x11')]);router['get'](_0x875a('0x12'),auth[_0x875a('0xa')](),controller[_0x875a('0x13')]);router[_0x875a('0xc')](_0x875a('0x14'),controller[_0x875a('0x15')]);router[_0x875a('0xc')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x875a('0x16')]);router[_0x875a('0xc')](_0x875a('0x17'),auth[_0x875a('0xa')](),controller[_0x875a('0x18')]);router['get'](_0x875a('0x19'),auth[_0x875a('0xa')](),controller[_0x875a('0x1a')]);router[_0x875a('0xc')](_0x875a('0x1b'),auth[_0x875a('0xa')](),controller[_0x875a('0x1c')]);router[_0x875a('0xc')](_0x875a('0x1d'),auth['isAuthenticated'](),controller[_0x875a('0x1e')]);router['get'](_0x875a('0x1f'),auth[_0x875a('0xa')](),controller[_0x875a('0x20')]);router[_0x875a('0xc')](_0x875a('0x21'),auth[_0x875a('0xa')](),controller[_0x875a('0x22')]);router[_0x875a('0xc')]('/:id/chat/interactions',auth[_0x875a('0xa')](),controller['getChatInteractions']);router[_0x875a('0xc')]('/:id/openchannel/interactions',auth[_0x875a('0xa')](),controller[_0x875a('0x23')]);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x875a('0xc')](_0x875a('0x24'),auth[_0x875a('0xa')](),controller[_0x875a('0x25')]);router[_0x875a('0xc')](_0x875a('0x26'),auth['isAuthenticated'](),controller[_0x875a('0x27')]);router[_0x875a('0xc')]('/:id/whatsapp/interactions',auth[_0x875a('0xa')](),controller[_0x875a('0x28')]);router[_0x875a('0xc')](_0x875a('0x29'),auth[_0x875a('0xa')](),controller[_0x875a('0x2a')]);router[_0x875a('0xc')](_0x875a('0x2b'),auth[_0x875a('0xa')](),controller['getLists']);router[_0x875a('0xc')](_0x875a('0x2c'),auth[_0x875a('0xa')](),controller['getAgents']);router[_0x875a('0xc')](_0x875a('0x2d'),auth[_0x875a('0xa')](),controller[_0x875a('0x2e')]);router[_0x875a('0xc')]('/:id/fax_accounts',auth[_0x875a('0xa')](),controller[_0x875a('0x2f')]);router['get'](_0x875a('0x30'),auth['isAuthenticated'](),controller[_0x875a('0x31')]);router['get'](_0x875a('0x32'),auth[_0x875a('0xa')](),controller[_0x875a('0x33')]);router[_0x875a('0xc')](_0x875a('0x34'),auth[_0x875a('0xa')](),controller[_0x875a('0x35')]);router['get'](_0x875a('0x36'),auth[_0x875a('0xa')](),controller[_0x875a('0x37')]);router[_0x875a('0xc')](_0x875a('0x38'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x875a('0xc')](_0x875a('0x39'),auth[_0x875a('0xa')](),controller[_0x875a('0x3a')]);router[_0x875a('0xc')](_0x875a('0x3b'),auth[_0x875a('0xa')](),controller['getScheduledCalls']);router[_0x875a('0xc')](_0x875a('0x3c'),auth[_0x875a('0xa')](),controller[_0x875a('0x3d')]);router[_0x875a('0x3e')](_0x875a('0x17'),auth['isAuthenticated'](),controller[_0x875a('0x3f')]);router['post']('/',auth['isAuthenticated'](),controller[_0x875a('0x40')]);router['post'](_0x875a('0x41'),auth[_0x875a('0xa')](),controller[_0x875a('0x42')]);router[_0x875a('0x3e')](_0x875a('0x19'),auth[_0x875a('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x875a('0x43')]({'destination':function(_0x21669d,_0x299325,_0x2f064b){_0x2f064b(null,path['join'](config[_0x875a('0x44')],_0x875a('0x45')));},'filename':function(_0x521140,_0xba50fa,_0x4d2f0a){_0x4d2f0a(null,util['format']('%s-%s',Date[_0x875a('0x46')](),_0xba50fa[_0x875a('0x47')]));}})});router[_0x875a('0x3e')](_0x875a('0x14'),upload['single'](_0x875a('0x48')),controller[_0x875a('0x49')]);router[_0x875a('0x3e')](_0x875a('0x4a'),auth[_0x875a('0xa')](),controller['login']);router[_0x875a('0x3e')]('/:id/logout',auth['isAuthenticated'](),controller['logout']);router[_0x875a('0x3e')](_0x875a('0x4b'),auth[_0x875a('0xa')](),controller[_0x875a('0x4c')]);router[_0x875a('0x3e')](_0x875a('0x4d'),auth['isAuthenticated'](),controller[_0x875a('0x4e')]);router['post'](_0x875a('0x29'),auth['isAuthenticated'](),controller['addTeams']);router[_0x875a('0x3e')](_0x875a('0x4f'),auth[_0x875a('0xa')](),controller[_0x875a('0x50')]);router[_0x875a('0x3e')](_0x875a('0x51'),auth[_0x875a('0xa')](),controller[_0x875a('0x52')]);router[_0x875a('0x3e')](_0x875a('0x53'),auth[_0x875a('0xa')](),controller[_0x875a('0x54')]);router[_0x875a('0x3e')](_0x875a('0x55'),auth[_0x875a('0xa')](),controller['addSmsInteractions']);router[_0x875a('0x3e')]('/:id/openchannel_interactions',auth[_0x875a('0xa')](),controller[_0x875a('0x56')]);router[_0x875a('0x3e')](_0x875a('0x57'),auth[_0x875a('0xa')](),controller[_0x875a('0x58')]);router[_0x875a('0x3e')](_0x875a('0x59'),auth[_0x875a('0xa')](),controller[_0x875a('0x5a')]);router[_0x875a('0x3e')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x875a('0x5b')]);router[_0x875a('0x3e')](_0x875a('0x32'),auth[_0x875a('0xa')](),controller[_0x875a('0x5c')]);router[_0x875a('0x3e')](_0x875a('0x34'),auth[_0x875a('0xa')](),controller[_0x875a('0x5d')]);router[_0x875a('0x3e')]('/:id/chat_websites',auth[_0x875a('0xa')](),controller[_0x875a('0x5e')]);router[_0x875a('0x3e')]('/:id/whatsapp_accounts',auth[_0x875a('0xa')](),controller[_0x875a('0x5f')]);router[_0x875a('0x3e')](_0x875a('0x39'),auth[_0x875a('0xa')](),controller[_0x875a('0x60')]);router['post'](_0x875a('0x3c'),auth[_0x875a('0xa')](),controller[_0x875a('0x61')]);router[_0x875a('0x62')](_0x875a('0x12'),auth['isAuthenticated'](),controller[_0x875a('0x63')]);router[_0x875a('0x62')](_0x875a('0x64'),auth[_0x875a('0xa')](),controller[_0x875a('0x65')]);router[_0x875a('0x66')]('/:id/queues',auth[_0x875a('0xa')](),controller[_0x875a('0x67')]);router['delete'](_0x875a('0x29'),auth[_0x875a('0xa')](),controller[_0x875a('0x68')]);router['delete'](_0x875a('0x12'),auth[_0x875a('0xa')](),controller['destroy']);router[_0x875a('0x66')](_0x875a('0x4f'),auth[_0x875a('0xa')](),controller[_0x875a('0x69')]);router[_0x875a('0x66')](_0x875a('0x51'),auth['isAuthenticated'](),controller[_0x875a('0x6a')]);router[_0x875a('0x66')](_0x875a('0x53'),auth['isAuthenticated'](),controller[_0x875a('0x6b')]);router[_0x875a('0x66')](_0x875a('0x55'),auth[_0x875a('0xa')](),controller[_0x875a('0x6c')]);router['delete']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x875a('0x6d')]);router[_0x875a('0x66')](_0x875a('0x57'),auth[_0x875a('0xa')](),controller[_0x875a('0x6e')]);router['delete'](_0x875a('0x59'),auth['isAuthenticated'](),controller[_0x875a('0x6f')]);router[_0x875a('0x66')](_0x875a('0x30'),auth[_0x875a('0xa')](),controller[_0x875a('0x70')]);router[_0x875a('0x66')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x875a('0x71')]);router[_0x875a('0x66')](_0x875a('0x34'),auth[_0x875a('0xa')](),controller['removeSmsAccounts']);router[_0x875a('0x66')](_0x875a('0x36'),auth[_0x875a('0xa')](),controller[_0x875a('0x72')]);router[_0x875a('0x66')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete'](_0x875a('0x39'),auth[_0x875a('0xa')](),controller[_0x875a('0x73')]);router[_0x875a('0x66')](_0x875a('0x3c'),auth['isAuthenticated'](),controller[_0x875a('0x74')]);module[_0x875a('0x75')]=router;
\ No newline at end of file
index 7f99300..37f43c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe168=['getDataValue','internal','email','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','BOOLEAN','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','active','passive','update,nonat','DATE','TEXT','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','dtlsenable','actpass','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','string','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>'];(function(_0x527c9a,_0xadf31d){var _0xe3e138=function(_0x14c227){while(--_0x14c227){_0x527c9a['push'](_0x527c9a['shift']());}};_0xe3e138(++_0xadf31d);}(_0xe168,0x164));var _0x8e16=function(_0x352a5e,_0x15555a){_0x352a5e=_0x352a5e-0x0;var _0x5000de=_0xe168[_0x352a5e];return _0x5000de;};'use strict';var Sequelize=require(_0x8e16('0x0'));var moment=require(_0x8e16('0x1'));var util=require('util');var _=require(_0x8e16('0x2'));module['exports']={'name':{'type':Sequelize[_0x8e16('0x3')],'allowNull':![],'unique':_0x8e16('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5707ce){this[_0x8e16('0x5')]('name',_0x5707ce);this['setDataValue'](_0x8e16('0x6'),_0x5707ce);},'comment':_0x8e16('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2e7924){this[_0x8e16('0x5')](_0x8e16('0x8'),_0x2e7924);this[_0x8e16('0x5')](_0x8e16('0x9'),util[_0x8e16('0xa')](_0x8e16('0xb'),_0x2e7924,this[_0x8e16('0xc')](_0x8e16('0xd'))));}},'alias':{'type':Sequelize[_0x8e16('0x3')]},'email':{'type':Sequelize[_0x8e16('0x3')],'allowNull':![],'unique':_0x8e16('0xe'),'validate':{'isEmail':!![]},'set':function(_0x1e3c2c){if(_0x1e3c2c){this[_0x8e16('0x5')](_0x8e16('0xe'),_0x1e3c2c['toLowerCase']());}}},'role':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x10'),_0x8e16('0x11'),_0x8e16('0x12'),_0x8e16('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x8e16('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x8e16('0x14')},'internal':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':![],'unique':_0x8e16('0xd'),'set':function(_0x1d358d){this[_0x8e16('0x5')](_0x8e16('0xd'),_0x1d358d);this[_0x8e16('0x5')](_0x8e16('0x16'),_0x1d358d);this[_0x8e16('0x5')]('callerid',util[_0x8e16('0xa')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0x8e16('0x8')),_0x1d358d));}},'salt':{'type':Sequelize[_0x8e16('0x3')]},'phone':{'type':Sequelize[_0x8e16('0x3')]},'mobile':{'type':Sequelize[_0x8e16('0x3')]},'address':{'type':Sequelize[_0x8e16('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x8e16('0x3')]},'city':{'type':Sequelize[_0x8e16('0x3')]},'country':{'type':Sequelize[_0x8e16('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8e16('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8e16('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![],'defaultValue':_0x8e16('0x18')},'ipaddr':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x8e16('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x8e16('0x19'),_0x8e16('0x11'),_0x8e16('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8e16('0x1b')},'callingpres':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x1c'),_0x8e16('0x1d'),'ALLOWED_FAILED_SCREEN',_0x8e16('0x1e'),'PROHIB_NOT_SCREENED',_0x8e16('0x1f'),_0x8e16('0x20'),_0x8e16('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8e16('0x22'),'set':function(_0x42581e){this[_0x8e16('0x5')]('transport',_0x42581e?_0x42581e[_0x8e16('0x23')](','):null);},'get':function(){return this[_0x8e16('0xc')](_0x8e16('0x24'))?this[_0x8e16('0xc')](_0x8e16('0x24'))['split'](','):null;},'comment':_0x8e16('0x25')},'dtmfmode':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x26'),_0x8e16('0x27'),'shortinfo','inband',_0x8e16('0x28')),'allowNull':!![],'defaultValue':_0x8e16('0x26')},'directmedia':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no',_0x8e16('0x2a'),_0x8e16('0x2b'),_0x8e16('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![],'defaultValue':_0x8e16('0x2d'),'set':function(_0xb0ac0e){this[_0x8e16('0x5')](_0x8e16('0x2e'),_0xb0ac0e?_0xb0ac0e['join'](','):null);},'get':function(){return this[_0x8e16('0xc')]('nat')?this['getDataValue'](_0x8e16('0x2e'))[_0x8e16('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x8e16('0x3')]},'namedcallgroup':{'type':Sequelize[_0x8e16('0x3')]},'pickupgroup':{'type':Sequelize[_0x8e16('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x8e16('0x3')],'allowNull':![],'defaultValue':_0x8e16('0x30')},'allow':{'type':Sequelize[_0x8e16('0x3')],'allowNull':![],'defaultValue':_0x8e16('0x31'),'set':function(_0x57c0fc){this[_0x8e16('0x5')](_0x8e16('0x32'),_0x57c0fc?_0x57c0fc[_0x8e16('0x23')](';'):_0x8e16('0x31'));},'get':function(){return this[_0x8e16('0xc')](_0x8e16('0x32'))?this[_0x8e16('0xc')](_0x8e16('0x32'))[_0x8e16('0x2f')](';'):null;},'comment':_0x8e16('0x33')},'autoframing':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![],'set':function(_0x44475b){this[_0x8e16('0x5')](_0x8e16('0x34'),_0x44475b?_0x44475b[_0x8e16('0x23')](','):null);},'get':function(){return this[_0x8e16('0xc')](_0x8e16('0x34'))?this[_0x8e16('0xc')](_0x8e16('0x34'))['split'](','):null;},'comment':_0x8e16('0x35')},'trustrpid':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8e16('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no',_0x8e16('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x8e16('0xf')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![],'defaultValue':_0x8e16('0x37')},'amaflags':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8e16('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no',_0x8e16('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x8e16('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x39'),_0x8e16('0x3a'),_0x8e16('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x3c'),'uas'),'allowNull':!![],'defaultValue':_0x8e16('0x3d')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![],'defaultValue':_0x8e16('0x29')},'keepalive':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x8e16('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x8e16('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x8e16('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no','fingerprint',_0x8e16('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x8e16('0x3f'),_0x8e16('0x40'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8e16('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x8e16('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x8e16('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x8e16('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x8e16('0xf')](_0x8e16('0x29'),'no',_0x8e16('0x2a'),_0x8e16('0x2b'),_0x8e16('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8e16('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x8e16('0x42')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8e16('0x43')]},'showWebBar':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0,'set':function(_0x108444){this[_0x8e16('0x5')]('showWebBar',_0x108444);var _0x21f902=this[_0x8e16('0x44')]({'plain':!![]});switch(_0x108444){case 0x0:case 0x1:var _0x967132=_0x21f902[_0x8e16('0x24')]?_[_0x8e16('0x45')](_0x21f902[_0x8e16('0x24')])?_0x21f902['transport'][_0x8e16('0x23')]():_0x21f902[_0x8e16('0x24')]:_0x8e16('0x22');if(_0x967132===_0x8e16('0x46')){_0x967132=_0x8e16('0x22');}this[_0x8e16('0x5')](_0x8e16('0x24'),_0x967132);this[_0x8e16('0x5')](_0x8e16('0x47'),'no');this['setDataValue'](_0x8e16('0x48'),null);this[_0x8e16('0x5')](_0x8e16('0x49'),null);this['setDataValue'](_0x8e16('0x4a'),null);this[_0x8e16('0x5')]('dtlsenable',null);this[_0x8e16('0x5')](_0x8e16('0x4b'),null);this[_0x8e16('0x5')](_0x8e16('0x4c'),null);this[_0x8e16('0x5')](_0x8e16('0x4d'),null);this[_0x8e16('0x5')](_0x8e16('0x4e'),null);this[_0x8e16('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x8e16('0x24'),_0x8e16('0x46'));this[_0x8e16('0x5')](_0x8e16('0x47'),_0x8e16('0x29'));this[_0x8e16('0x5')](_0x8e16('0x48'),_0x8e16('0x29'));this[_0x8e16('0x5')]('force_avp',_0x8e16('0x29'));this[_0x8e16('0x5')](_0x8e16('0x4a'),_0x8e16('0x29'));this[_0x8e16('0x5')](_0x8e16('0x4f'),_0x8e16('0x29'));this[_0x8e16('0x5')](_0x8e16('0x4b'),'no');this[_0x8e16('0x5')](_0x8e16('0x4c'),_0x8e16('0x50'));this[_0x8e16('0x5')](_0x8e16('0x4d'),_0x21f902['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0x8e16('0x4e'),_0x21f902[_0x8e16('0x4e')]||_0x8e16('0x51'));this['setDataValue'](_0x8e16('0x52'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x8e16('0x43')],'set':function(_0x9484a4){this[_0x8e16('0x5')](_0x8e16('0x53'),_0x9484a4?_0x9484a4['join'](','):[]);},'get':function(){return this['getDataValue'](_0x8e16('0x53'))?_[_0x8e16('0x54')](this[_0x8e16('0xc')](_0x8e16('0x53'))[_0x8e16('0x2f')](','),function(_0x366987){return parseInt(_0x366987,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x8e16('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8e16('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x8e16('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8e16('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x8e16('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8e16('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x8e16('0x55')],'get':function(){return this[_0x8e16('0xc')]('phoneBarEnableScreenRecordingByAgent')?this[_0x8e16('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8e16('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![],'set':function(_0x42417d){if(typeof _0x42417d===_0x8e16('0x56')){var _0x3f2326=_0x42417d==='1'?!![]:_0x42417d==='0'?![]:_0x42417d==='true'?!![]:_0x42417d===_0x8e16('0x57')?![]:![];this[_0x8e16('0x5')](_0x8e16('0x58'),_0x3f2326);}else{this[_0x8e16('0x5')](_0x8e16('0x58'),_0x42417d);}}},'blocked':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![],'set':function(_0x5cfae8){this[_0x8e16('0x5')](_0x8e16('0x59'),_0x5cfae8);if(_0x5cfae8===!![]){this[_0x8e16('0x5')](_0x8e16('0x5a'),moment());this[_0x8e16('0x5')](_0x8e16('0x5b'),0x0);}else{this[_0x8e16('0x5')](_0x8e16('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0x8e16('0x42')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x8e16('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x8e16('0x17')],'defaultValue':![]}};
\ No newline at end of file
+var _0xcbf9=['map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','format','getDataValue','internal','email','ENUM','admin','user','agent','telephone','accountcode','callerid','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','join','transport','split','rfc2833','info','shortinfo','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','nonat','update','update,nonat','TEXT','showWebBar','get','isArray','udp','wss','encryption','avpf','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','force_avp','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions'];(function(_0x5569ec,_0x1524a8){var _0x2ace99=function(_0x133842){while(--_0x133842){_0x5569ec['push'](_0x5569ec['shift']());}};_0x2ace99(++_0x1524a8);}(_0xcbf9,0x11c));var _0x9cbf=function(_0x59312d,_0x52bb25){_0x59312d=_0x59312d-0x0;var _0x13ca66=_0xcbf9[_0x59312d];return _0x13ca66;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x9cbf('0x0'));var _=require(_0x9cbf('0x1'));module[_0x9cbf('0x2')]={'name':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':![],'unique':_0x9cbf('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1604ea){this[_0x9cbf('0x5')](_0x9cbf('0x4'),_0x1604ea);this['setDataValue']('defaultuser',_0x1604ea);},'comment':_0x9cbf('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x43f68e){this[_0x9cbf('0x5')](_0x9cbf('0x7'),_0x43f68e);this[_0x9cbf('0x5')]('callerid',util[_0x9cbf('0x8')]('\x22%s\x22\x20<%s>',_0x43f68e,this[_0x9cbf('0x9')](_0x9cbf('0xa'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':![],'unique':_0x9cbf('0xb'),'validate':{'isEmail':!![]},'set':function(_0x5c488b){if(_0x5c488b){this[_0x9cbf('0x5')](_0x9cbf('0xb'),_0x5c488b['toLowerCase']());}}},'role':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0xd'),_0x9cbf('0xe'),_0x9cbf('0xf'),_0x9cbf('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x58f336){this[_0x9cbf('0x5')](_0x9cbf('0xa'),_0x58f336);this[_0x9cbf('0x5')](_0x9cbf('0x11'),_0x58f336);this[_0x9cbf('0x5')](_0x9cbf('0x12'),util[_0x9cbf('0x8')](_0x9cbf('0x13'),this[_0x9cbf('0x9')](_0x9cbf('0x7')),_0x58f336));}},'salt':{'type':Sequelize[_0x9cbf('0x3')]},'phone':{'type':Sequelize[_0x9cbf('0x3')]},'mobile':{'type':Sequelize[_0x9cbf('0x3')]},'address':{'type':Sequelize[_0x9cbf('0x3')]},'zipcode':{'type':Sequelize[_0x9cbf('0x3')]},'userpic':{'type':Sequelize[_0x9cbf('0x3')]},'city':{'type':Sequelize[_0x9cbf('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x9cbf('0x15')]},'voicePause':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x9cbf('0x16')},'lastPauseAt':{'type':Sequelize[_0x9cbf('0x15')]},'chatCapacity':{'type':Sequelize[_0x9cbf('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9cbf('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9cbf('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x9cbf('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9cbf('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9cbf('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9cbf('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![],'defaultValue':_0x9cbf('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x9cbf('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9cbf('0xc')]('friend',_0x9cbf('0xe'),_0x9cbf('0x19')),'allowNull':!![],'defaultValue':_0x9cbf('0x1a')},'context':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x1b'),_0x9cbf('0x1c'),'ALLOWED_FAILED_SCREEN',_0x9cbf('0x1d'),_0x9cbf('0x1e'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x315a8d){this[_0x9cbf('0x5')]('transport',_0x315a8d?_0x315a8d[_0x9cbf('0x1f')](','):null);},'get':function(){return this[_0x9cbf('0x9')]('transport')?this['getDataValue'](_0x9cbf('0x20'))[_0x9cbf('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x22'),_0x9cbf('0x23'),_0x9cbf('0x24'),'inband','auto'),'allowNull':!![],'defaultValue':_0x9cbf('0x22')},'directmedia':{'type':Sequelize['ENUM'](_0x9cbf('0x25'),'no','nonat','update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![],'defaultValue':_0x9cbf('0x26'),'set':function(_0x49b691){this['setDataValue'](_0x9cbf('0x27'),_0x49b691?_0x49b691[_0x9cbf('0x1f')](','):null);},'get':function(){return this['getDataValue'](_0x9cbf('0x27'))?this[_0x9cbf('0x9')](_0x9cbf('0x27'))[_0x9cbf('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x9cbf('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x9cbf('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x9cbf('0x3')]},'language':{'type':Sequelize[_0x9cbf('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9cbf('0x3')]},'disallow':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':![],'defaultValue':_0x9cbf('0x28')},'allow':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':![],'defaultValue':_0x9cbf('0x29'),'set':function(_0x1fdd53){this[_0x9cbf('0x5')]('allow',_0x1fdd53?_0x1fdd53['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9cbf('0x9')](_0x9cbf('0x2a'))?this[_0x9cbf('0x9')](_0x9cbf('0x2a'))[_0x9cbf('0x21')](';'):null;},'comment':_0x9cbf('0x2b')},'autoframing':{'type':Sequelize['ENUM'](_0x9cbf('0x25'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x3a007b){this['setDataValue'](_0x9cbf('0x2c'),_0x3a007b?_0x3a007b[_0x9cbf('0x1f')](','):null);},'get':function(){return this[_0x9cbf('0x9')](_0x9cbf('0x2c'))?this[_0x9cbf('0x9')](_0x9cbf('0x2c'))[_0x9cbf('0x21')](','):null;},'comment':_0x9cbf('0x2d')},'trustrpid':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no',_0x9cbf('0x2e')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9cbf('0x2f')},'amaflags':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x9cbf('0x25'),'no'),'allowNull':!![],'defaultValue':_0x9cbf('0x25')},'busylevel':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x9cbf('0xc')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9cbf('0xc')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9cbf('0xc')]('yes','no',_0x9cbf('0x30')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9cbf('0xc')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x31'),_0x9cbf('0x32'),_0x9cbf('0x33')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x34'),_0x9cbf('0x35')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![],'defaultValue':_0x9cbf('0x25')},'keepalive':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9cbf('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9cbf('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9cbf('0xc')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9cbf('0xc')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no',_0x9cbf('0x36'),_0x9cbf('0x37')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x38'),'passive',_0x9cbf('0x39')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9cbf('0xc')]('yes','no',_0x9cbf('0x3a'),_0x9cbf('0x3b'),_0x9cbf('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x9cbf('0x15')]},'passwordResetAt':{'type':Sequelize[_0x9cbf('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x9cbf('0x3d')]},'showWebBar':{'type':Sequelize[_0x9cbf('0x17')],'defaultValue':0x0,'set':function(_0x35236c){this['setDataValue'](_0x9cbf('0x3e'),_0x35236c);var _0x2ee7f4=this[_0x9cbf('0x3f')]({'plain':!![]});switch(_0x35236c){case 0x0:case 0x1:var _0x41cf83=_0x2ee7f4[_0x9cbf('0x20')]?_[_0x9cbf('0x40')](_0x2ee7f4[_0x9cbf('0x20')])?_0x2ee7f4['transport'][_0x9cbf('0x1f')]():_0x2ee7f4[_0x9cbf('0x20')]:_0x9cbf('0x41');if(_0x41cf83===_0x9cbf('0x42')){_0x41cf83=_0x9cbf('0x41');}this[_0x9cbf('0x5')](_0x9cbf('0x20'),_0x41cf83);this['setDataValue'](_0x9cbf('0x43'),'no');this['setDataValue'](_0x9cbf('0x44'),null);this['setDataValue']('force_avp',null);this[_0x9cbf('0x5')](_0x9cbf('0x45'),null);this[_0x9cbf('0x5')](_0x9cbf('0x46'),null);this[_0x9cbf('0x5')]('dtlsverify',null);this[_0x9cbf('0x5')](_0x9cbf('0x47'),null);this[_0x9cbf('0x5')](_0x9cbf('0x48'),null);this[_0x9cbf('0x5')](_0x9cbf('0x49'),null);this[_0x9cbf('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x9cbf('0x5')](_0x9cbf('0x20'),_0x9cbf('0x42'));this[_0x9cbf('0x5')](_0x9cbf('0x43'),_0x9cbf('0x25'));this[_0x9cbf('0x5')](_0x9cbf('0x44'),_0x9cbf('0x25'));this[_0x9cbf('0x5')](_0x9cbf('0x4a'),_0x9cbf('0x25'));this[_0x9cbf('0x5')](_0x9cbf('0x45'),'yes');this[_0x9cbf('0x5')]('dtlsenable',_0x9cbf('0x25'));this[_0x9cbf('0x5')](_0x9cbf('0x4b'),'no');this['setDataValue'](_0x9cbf('0x47'),_0x9cbf('0x39'));this['setDataValue']('dtlscertfile',_0x2ee7f4[_0x9cbf('0x48')]||_0x9cbf('0x4c'));this['setDataValue'](_0x9cbf('0x49'),_0x2ee7f4[_0x9cbf('0x49')]||_0x9cbf('0x4d'));this[_0x9cbf('0x5')](_0x9cbf('0x4e'),_0x9cbf('0x25'));break;default:}}},'permissions':{'type':Sequelize[_0x9cbf('0x3d')],'set':function(_0x3d8e5c){this[_0x9cbf('0x5')](_0x9cbf('0x4f'),_0x3d8e5c?_0x3d8e5c['join'](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x9cbf('0x50')](this[_0x9cbf('0x9')](_0x9cbf('0x4f'))['split'](','),function(_0x240308){return parseInt(_0x240308,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x9cbf('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x9cbf('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9cbf('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9cbf('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9cbf('0xc')](_0x9cbf('0x25'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9cbf('0x51')],'get':function(){return this[_0x9cbf('0x9')](_0x9cbf('0x52'))?this[_0x9cbf('0x9')](_0x9cbf('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x9cbf('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9cbf('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![],'set':function(_0x590efa){if(typeof _0x590efa===_0x9cbf('0x53')){var _0x3ca481=_0x590efa==='1'?!![]:_0x590efa==='0'?![]:_0x590efa===_0x9cbf('0x54')?!![]:_0x590efa===_0x9cbf('0x55')?![]:![];this[_0x9cbf('0x5')](_0x9cbf('0x56'),_0x3ca481);}else{this['setDataValue']('screenrecording',_0x590efa);}}},'blocked':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![],'set':function(_0x239673){this[_0x9cbf('0x5')](_0x9cbf('0x57'),_0x239673);if(_0x239673===!![]){this[_0x9cbf('0x5')](_0x9cbf('0x58'),moment());this[_0x9cbf('0x5')](_0x9cbf('0x59'),0x0);}else{this[_0x9cbf('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x9cbf('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9cbf('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9cbf('0x17')](0x5)[_0x9cbf('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9cbf('0x14')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 3edfd98..6ae17c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95b9=['firstName','lastName','Contact','dialActive','getApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','queues','teams','inbound','getAgents','lower','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','bluebird','util','path','lodash','squel','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','request\x20sent','debug','error','code','User,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','Content-Range','update','destroy','get','admin','Agents','Telephones','telephone','filter','ignore','map','value','includes','role','find','name','UserProfileResource','sendStatus','stack','User','rawAttributes','fieldName','type','key','password','salt','where','count','include','query','true','UserSetting','userSetting','attributes','push','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','all','show','params','keys','model','intersection','fields','includeAll','options','whatsapp','body','describe','addContacts','omit','ids','internal','findById','securePassword','max','min_internal','isNil','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','104','105','106','107','108','100','111','114','115','create','user','agent','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','findAll','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','oldPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','format','each','UserVoiceQueueRt','upsert','isValidChannel','isArray','Queue:remove','addAvatar','userpic','file','filename','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','createdAt','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','filters','order','sort','pick','hasOwnProperty','Tag','tag','nolimit','getQueues','Queue','merge','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','UserVoiceQueue.penalty','MemberReport','forEach','getChannels','PAUSE','LOGININPAUSE','YYYY-MM-DD\x20HH:mm:ss','isMiddleware','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','unpause','faxPause','smsPause','pauseType','manual','set','%s%s','Pause','getTeams','Team','addTeams','getVoiceQueues','setDataValue','Voice','getMailQueues','Mail','Sms','getWhatsappQueues','Whatsapp','getOpenchannelQueues','Openchannel','transaction','getDataValue','VoicePrefixId','removeTeams','getFaxQueues','flatten','removeAgent','UserVoicePrefix','getLists','CmList','values','send','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$in','$notLike','$notILike','$like','$overlap','$contains','$any'];(function(_0x1ebd10,_0x4914b4){var _0x1004d3=function(_0x59e3ba){while(--_0x59e3ba){_0x1ebd10['push'](_0x1ebd10['shift']());}};_0x1004d3(++_0x4914b4);}(_0x95b9,0x1c7));var _0x995b=function(_0x36f6a2,_0x2a28ac){_0x36f6a2=_0x36f6a2-0x0;var _0x3c0464=_0x95b9[_0x36f6a2];return _0x3c0464;};'use strict';var moment=require('moment');var BPromise=require(_0x995b('0x0'));var util=require(_0x995b('0x1'));var path=require(_0x995b('0x2'));var fs=require('fs');var _=require(_0x995b('0x3'));var squel=require(_0x995b('0x4'));var jayson=require('jayson/promise');var Redis=require(_0x995b('0x5'));var authService=require(_0x995b('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x995b('0x7'))(_0x995b('0x8'));var utils=require(_0x995b('0x9'));var config=require(_0x995b('0xa'));var licenseUtil=require('../../config/license/util');var db=require(_0x995b('0xb'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x995b('0xc')]));require(_0x995b('0xd'))[_0x995b('0xe')](socket);config[_0x995b('0xc')]=_[_0x995b('0xf')](config['redis'],{'host':_0x995b('0x10'),'port':0x18eb});var client=jayson[_0x995b('0x11')][_0x995b('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4bda3b,_0x492db1,_0x3480dd,_0x360c5e){return new BPromise(function(_0x283cd2,_0x57ce73){var _0x2a1408=_0x360c5e||client;return _0x2a1408[_0x995b('0x13')](_0x4bda3b,_0x3480dd)[_0x995b('0x14')](function(_0x4433af){logger[_0x995b('0x15')]('User,\x20%s,\x20%s',_0x492db1,_0x995b('0x16'));logger[_0x995b('0x17')]('User,\x20%s,\x20%s,\x20%s',_0x492db1,'request\x20sent',JSON['stringify'](_0x4433af));if(_0x4433af[_0x995b('0x18')]){if(_0x4433af['error'][_0x995b('0x19')]===0x1f4){logger['error'](_0x995b('0x1a'),_0x492db1,_0x4433af['error'][_0x995b('0x1b')]);return _0x57ce73(_0x4433af[_0x995b('0x18')][_0x995b('0x1b')]);}logger[_0x995b('0x18')](_0x995b('0x1a'),_0x492db1,_0x4433af[_0x995b('0x18')][_0x995b('0x1b')]);return _0x283cd2(_0x4433af[_0x995b('0x18')]['message']);}else{logger['info'](_0x995b('0x1a'),_0x492db1,_0x995b('0x16'));_0x283cd2(_0x4433af[_0x995b('0x1c')][_0x995b('0x1b')]);}})[_0x995b('0x1d')](function(_0x269ab1){logger[_0x995b('0x18')]('User,\x20%s,\x20%s',_0x492db1,_0x269ab1);_0x57ce73(_0x269ab1);});});}function respondWithStatusCode(_0x3456de,_0x50f287){_0x50f287=_0x50f287||0xcc;return function(_0x58b8fc){if(_0x58b8fc){return _0x3456de['sendStatus'](_0x50f287);}return _0x3456de[_0x995b('0x1e')](_0x50f287)[_0x995b('0x1f')]();};}function respondWithResult(_0x1dd850,_0x22cb96){_0x22cb96=_0x22cb96||0xc8;return function(_0x5f3f8c){if(_0x5f3f8c){return _0x1dd850[_0x995b('0x1e')](_0x22cb96)[_0x995b('0x20')](_0x5f3f8c);}};}function respondWithFilteredResult(_0x565ff6,_0x320961){return function(_0x477f4f){if(_0x477f4f){var _0x4e334b=typeof _0x320961[_0x995b('0x21')]==='undefined'&&typeof _0x320961[_0x995b('0x22')]==='undefined';var _0x50daea=_0x477f4f['count'];var _0x97e95c=_0x4e334b?0x0:_0x320961['offset'];var _0xd5422d=_0x4e334b?_0x477f4f['count']:_0x320961[_0x995b('0x21')]+_0x320961[_0x995b('0x22')];var _0x46538b;if(_0xd5422d>=_0x50daea){_0xd5422d=_0x50daea;_0x46538b=0xc8;}else{_0x46538b=0xce;}_0x565ff6['status'](_0x46538b);return _0x565ff6['set'](_0x995b('0x23'),_0x97e95c+'-'+_0xd5422d+'/'+_0x50daea)[_0x995b('0x20')](_0x477f4f);}return null;};}function saveUpdates(_0x11ab6c){return function(_0x158fdc){if(_0x158fdc){return _0x158fdc[_0x995b('0x24')](_0x11ab6c)[_0x995b('0x14')](function(_0x1562fc){return _0x1562fc;});}return null;};}function removeEntity(_0x269355){return function(_0xccd3a0){if(_0xccd3a0){return _0xccd3a0[_0x995b('0x25')]()[_0x995b('0x14')](function(){var _0x5a76b0=_0xccd3a0[_0x995b('0x26')]({'plain':!![]});if(_0x5a76b0['role']===_0x995b('0x27'))return;var _0xd0a8fe=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x995b('0x28'),'value':'agent','ignore':![]},{'name':_0x995b('0x29'),'value':_0x995b('0x2a'),'ignore':![]}];var _0x5c0061=_(_0xd0a8fe)[_0x995b('0x2b')](_0x995b('0x2c'))[_0x995b('0x2d')](_0x995b('0x2e'))[_0x995b('0x2e')]();if(_[_0x995b('0x2f')](_0x5c0061,_0x5a76b0[_0x995b('0x30')])){return;}var _0x29836a=_[_0x995b('0x31')](_0xd0a8fe,[_0x995b('0x2e'),_0x5a76b0[_0x995b('0x30')]])[_0x995b('0x32')];return db[_0x995b('0x33')][_0x995b('0x25')]({'where':{'type':_0x29836a,'resourceId':_0x5a76b0['id']}})[_0x995b('0x14')](function(){return _0xccd3a0;});})[_0x995b('0x14')](function(){_0x269355[_0x995b('0x1e')](0xcc)[_0x995b('0x1f')]();});}};}function handleEntityNotFound(_0x33cb49){return function(_0xc3df26){if(!_0xc3df26){_0x33cb49[_0x995b('0x34')](0x194);}return _0xc3df26;};}function handleError(_0x45f272,_0x28832d){_0x28832d=_0x28832d||0x1f4;return function(_0xcbc8e2){logger['error'](_0xcbc8e2[_0x995b('0x35')]);if(_0xcbc8e2[_0x995b('0x32')]){delete _0xcbc8e2['name'];}_0x45f272[_0x995b('0x1e')](_0x28832d)['send'](_0xcbc8e2);};}exports['index']=function(_0x5939e9,_0x5c1e63){var _0x3b7ab6={},_0x5e2517={'count':0x0,'rows':[]};var _0x2fa9d2=_(db[_0x995b('0x36')][_0x995b('0x37')])[_0x995b('0x2d')](function(_0x2f2e5b){return{'name':_0x2f2e5b[_0x995b('0x38')],'type':_0x2f2e5b[_0x995b('0x39')][_0x995b('0x3a')]};})['filter'](function(_0x369b09){return!_[_0x995b('0x2f')]([_0x995b('0x3b'),_0x995b('0x3c')],_0x369b09[_0x995b('0x32')]);})[_0x995b('0x2e')]();_0x3b7ab6=qs['getOptions'](_0x2fa9d2,_0x5939e9);var _0x424ccc={'where':_0x3b7ab6[_0x995b('0x3d')]};return db[_0x995b('0x36')][_0x995b('0x3e')](_0x424ccc)[_0x995b('0x14')](function(_0x5d274a){_0x5e2517['count']=_0x5d274a;if(_0x5939e9['query']['includeAll']){_0x3b7ab6[_0x995b('0x3f')]=[{'all':!![]}];}if(_0x5939e9[_0x995b('0x40')]['userSetting']===_0x995b('0x41')){_0x3b7ab6[_0x995b('0x3f')]=[{'model':db[_0x995b('0x42')],'as':_0x995b('0x43')}];}if(!_[_0x995b('0x2f')](_0x3b7ab6[_0x995b('0x44')],'id')){_0x3b7ab6[_0x995b('0x44')][_0x995b('0x45')]('id');}return db[_0x995b('0x36')]['findAll'](_0x3b7ab6);})[_0x995b('0x14')](function(_0x3251a1){_0x5e2517[_0x995b('0x46')]=_0x3251a1;if(_0x5939e9[_0x995b('0x40')][_0x995b('0x47')]===_0x995b('0x41')){var _0x565272=[];for(var _0x2e830b=0x0;_0x2e830b<_0x5e2517['rows'][_0x995b('0x48')];_0x2e830b++){_0x565272['push'](get_open_tabs(_0x995b('0x49'),_0x5e2517[_0x995b('0x46')][_0x2e830b][_0x995b('0x4a')]));_0x565272[_0x995b('0x45')](get_open_tabs(_0x995b('0x4b'),_0x5e2517['rows'][_0x2e830b]['dataValues']));_0x565272[_0x995b('0x45')](get_open_tabs(_0x995b('0x4c'),_0x5e2517['rows'][_0x2e830b]['dataValues']));_0x565272['push'](get_open_tabs(_0x995b('0x4d'),_0x5e2517['rows'][_0x2e830b][_0x995b('0x4a')]));_0x565272[_0x995b('0x45')](get_open_tabs(_0x995b('0x4e'),_0x5e2517[_0x995b('0x46')][_0x2e830b][_0x995b('0x4a')]));_0x565272[_0x995b('0x45')](get_open_tabs('whatsapp',_0x5e2517['rows'][_0x2e830b][_0x995b('0x4a')]));}return BPromise[_0x995b('0x4f')](_0x565272)[_0x995b('0x14')](function(){return _0x5e2517;});}else{return _0x5e2517;}})['then'](respondWithFilteredResult(_0x5c1e63,_0x3b7ab6))['catch'](handleError(_0x5c1e63,null));};exports[_0x995b('0x50')]=function(_0x3bddfb,_0x3b146d){var _0x37a3be={'raw':![],'where':{'id':_0x3bddfb[_0x995b('0x51')]['id']}},_0x3d3b1c={};_0x3d3b1c['model']=_['differenceBy'](_[_0x995b('0x52')](db[_0x995b('0x36')][_0x995b('0x37')]),[_0x995b('0x3b'),_0x995b('0x3c')]);_0x3d3b1c['query']=_[_0x995b('0x52')](_0x3bddfb[_0x995b('0x40')]);_0x3d3b1c['filters']=_['intersection'](_0x3d3b1c[_0x995b('0x53')],_0x3d3b1c['query']);_0x37a3be['attributes']=_[_0x995b('0x54')](_0x3d3b1c[_0x995b('0x53')],qs[_0x995b('0x55')](_0x3bddfb[_0x995b('0x40')]['fields']));_0x37a3be['attributes']=_0x37a3be[_0x995b('0x44')]['length']?_0x37a3be[_0x995b('0x44')]:_0x3d3b1c[_0x995b('0x53')];if(_0x3bddfb[_0x995b('0x40')][_0x995b('0x56')]){_0x37a3be[_0x995b('0x3f')]=[{'all':!![]}];}if(_0x3bddfb[_0x995b('0x40')][_0x995b('0x43')]===_0x995b('0x41')){_0x37a3be['include']=[{'model':db[_0x995b('0x42')],'as':_0x995b('0x43')}];}_0x37a3be=_['merge']({},_0x37a3be,_0x3bddfb[_0x995b('0x57')]);if(!_[_0x995b('0x2f')](_0x37a3be[_0x995b('0x44')],'id')){_0x37a3be['attributes']['push']('id');}return db[_0x995b('0x36')][_0x995b('0x31')](_0x37a3be)[_0x995b('0x14')](handleEntityNotFound(_0x3b146d,null))[_0x995b('0x14')](function(_0x858d7e){var _0x365a85=[];values=_0x858d7e;if(_0x3bddfb[_0x995b('0x40')][_0x995b('0x47')]==='true'){_0x365a85[_0x995b('0x45')](get_open_tabs('chat',_0x858d7e['dataValues']));_0x365a85[_0x995b('0x45')](get_open_tabs(_0x995b('0x4b'),_0x858d7e[_0x995b('0x4a')]));_0x365a85['push'](get_open_tabs(_0x995b('0x4e'),_0x858d7e[_0x995b('0x4a')]));_0x365a85['push'](get_open_tabs(_0x995b('0x58'),_0x858d7e[_0x995b('0x4a')]));_0x365a85[_0x995b('0x45')](get_open_tabs('fax',_0x858d7e[_0x995b('0x4a')]));_0x365a85[_0x995b('0x45')](get_open_tabs('mail',_0x858d7e['dataValues']));return BPromise[_0x995b('0x4f')](_0x365a85);}else{return values;}})[_0x995b('0x14')](function(){return values;})[_0x995b('0x14')](respondWithResult(_0x3b146d,null))[_0x995b('0x1d')](handleError(_0x3b146d,null));};exports[_0x995b('0x24')]=function(_0x25d55c,_0x278650){if(_0x25d55c[_0x995b('0x59')]['id']){delete _0x25d55c[_0x995b('0x59')]['id'];}delete _0x25d55c['body'][_0x995b('0x30')];return db['User'][_0x995b('0x31')]({'where':{'id':_0x25d55c[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x278650,null))['then'](saveUpdates(_0x25d55c['body'],null))[_0x995b('0x14')](respondWithResult(_0x278650,null))[_0x995b('0x1d')](handleError(_0x278650,null));};exports[_0x995b('0x5a')]=function(_0x2efbba,_0x25e0cb){return db[_0x995b('0x36')]['describe']()['then'](respondWithResult(_0x25e0cb,null))[_0x995b('0x1d')](handleError(_0x25e0cb,null));};exports[_0x995b('0x5b')]=function(_0x57849e,_0x21bde4){return db['User'][_0x995b('0x31')]({'where':{'id':_0x57849e['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x21bde4,null))[_0x995b('0x14')](function(_0x28fcee){if(_0x28fcee){return _0x28fcee[_0x995b('0x5b')](_0x57849e['body']['ids'],_[_0x995b('0x5c')](_0x57849e[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x21bde4,null))[_0x995b('0x1d')](handleError(_0x21bde4,null));};function validateUser(_0xb764){return new BPromise(function(_0x20722f,_0x3b5d7b){if(_0xb764[_0x995b('0x5e')])return _0x20722f(_0xb764);return db['Setting'][_0x995b('0x5f')](0x1)['then'](function(_0x5e81f9){if(_0x5e81f9[_0x995b('0x60')])authService['validatePasswordPattern'](_0xb764[_0x995b('0x3b')]);db[_0x995b('0x36')][_0x995b('0x61')](_0x995b('0x5e'))['then'](function(_0x7cd613){if(_['isNil'](_0x7cd613)){_0xb764[_0x995b('0x5e')]=_0x5e81f9[_0x995b('0x62')]||0x1;return;}if(_[_0x995b('0x63')](_0x5e81f9['min_internal'])||_0x5e81f9[_0x995b('0x62')]===_0x7cd613){_0xb764[_0x995b('0x5e')]=_0x7cd613+0x1;return;}if(_0x5e81f9['min_internal']>_0x7cd613){_0xb764['internal']=_0x5e81f9[_0x995b('0x62')];return;}return db['sequelize']['query'](_0x995b('0x64'),{'type':db[_0x995b('0x65')][_0x995b('0x66')][_0x995b('0x67')]})[_0x995b('0x14')](function(_0x575560){if(_0x575560&&_0x575560[_0x995b('0x48')]){for(var _0x511866=0x0,_0x3e93d7=_0x575560[_0x995b('0x48')];_0x511866<_0x3e93d7&&_[_0x995b('0x63')](_0xb764[_0x995b('0x5e')]);_0x511866++){if(_0x5e81f9[_0x995b('0x62')]<=_0x575560[_0x511866][_0x995b('0x68')]){_0xb764[_0x995b('0x5e')]=_0x575560[_0x511866][_0x995b('0x68')];}else if(_0x5e81f9[_0x995b('0x62')]>_0x575560[_0x511866][_0x995b('0x68')]&&_0x5e81f9[_0x995b('0x62')]<=_0x575560[_0x511866]['to']){_0xb764[_0x995b('0x5e')]=_0x5e81f9['min_internal'];}}}if(_['isNil'](_0xb764[_0x995b('0x5e')])){_0xb764['internal']=_0x7cd613+0x1;}return _0x20722f(_0xb764);});});})[_0x995b('0x1d')](function(_0x41063c){_0x3b5d7b(_0x41063c);});});}function updateUser(_0x4ce201){return new BPromise(function(_0x3f8705,_0x4def13){try{if(_0x4ce201[_0x995b('0x69')]){_0x4ce201[_0x995b('0x6a')]=_0x4ce201[_0x995b('0x5e')];_0x4ce201[_0x995b('0x6b')]={'mailbox':_0x4ce201['internal'],'password':_0x4ce201[_0x995b('0x3b')],'fullname':_0x4ce201[_0x995b('0x6c')],'email':_0x4ce201[_0x995b('0x6d')]};}if(_0x4ce201[_0x995b('0x30')]==='agent'){if(!_0x4ce201[_0x995b('0x6e')])_0x4ce201[_0x995b('0x6e')]=[_0x995b('0x6f'),_0x995b('0x70'),_0x995b('0x71'),'113',_0x995b('0x72'),_0x995b('0x73'),_0x995b('0x74'),_0x995b('0x75'),_0x995b('0x76'),_0x995b('0x77'),'109',_0x995b('0x78'),_0x995b('0x79'),_0x995b('0x7a'),_0x995b('0x7b')];}_0x3f8705(_0x4ce201);}catch(_0x32e774){_0x4def13(_0x32e774);}});}exports[_0x995b('0x7c')]=function(_0x23100d,_0x407c86){if(_0x23100d[_0x995b('0x7d')]['role']===_0x995b('0x7e'))throw new Error(_0x995b('0x7f'));if(_0x23100d['body']['role']==='user'&&_0x23100d['user']['role']!==_0x995b('0x27')){throw new Error(_0x995b('0x80'));}if(_0x23100d[_0x995b('0x59')][_0x995b('0x30')]===_0x995b('0x27')&&_0x23100d[_0x995b('0x7d')][_0x995b('0x30')]!==_0x995b('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x995b('0x81')]([_0x23100d[_0x995b('0x59')]])[_0x995b('0x14')](function(){return validateUser(_0x23100d[_0x995b('0x59')]);})['then'](function(_0x280c6e){return updateUser(_0x280c6e)['then'](function(_0x420ad9){if(_0x420ad9[_0x995b('0x30')]==='admin'){_0x420ad9['settingsEnabled']=_0x23100d['user'][_0x995b('0x82')];delete _0x420ad9['userProfileId'];}return _0x420ad9;});})[_0x995b('0x14')](function(_0x5d7e92){return db[_0x995b('0x36')][_0x995b('0x7c')](_0x5d7e92,{'include':[{'model':db[_0x995b('0x6b')],'as':'VoiceMail'}]});})['then'](function(_0x179fb3){if(_0x23100d[_0x995b('0x59')][_0x995b('0x30')]===_0x995b('0x7d'))return _0x179fb3;if(_0x23100d[_0x995b('0x7d')][_0x995b('0x30')]!==_0x995b('0x7d'))return _0x179fb3;return db[_0x995b('0x83')][_0x995b('0x31')]({'where':{'name':_0x179fb3[_0x995b('0x30')]===_0x995b('0x7e')?'Agents':_0x995b('0x29'),'userProfileId':_0x23100d[_0x995b('0x7d')][_0x995b('0x84')]},'raw':!![]})['then'](function(_0x350ca4){if(!_0x350ca4||_0x350ca4[_0x995b('0x85')]!=0x0)return _0x179fb3;return db[_0x995b('0x33')]['create']({'name':_0x179fb3[_0x995b('0x32')],'resourceId':_0x179fb3['id'],'type':_0x350ca4[_0x995b('0x32')],'sectionId':_0x350ca4['id']},{})[_0x995b('0x14')](function(){return _0x179fb3;});})['catch'](function(_0x376edc){logger[_0x995b('0x18')](_0x995b('0x86'),_0x376edc);throw _0x376edc;});})['then'](respondWithResult(_0x407c86,0xc9))[_0x995b('0x1d')](handleError(_0x407c86,null));};exports[_0x995b('0x87')]=function(_0x120820,_0x4f4865){var _0x18a513=_0x120820[_0x995b('0x59')];var _0x2f14d5=[];if(_0x120820[_0x995b('0x7d')]['role']==='agent')throw new Error(_0x995b('0x7f'));if(_['some'](_0x18a513,['role',_0x995b('0x7d')])&&_0x120820[_0x995b('0x7d')]['role']!==_0x995b('0x27')){throw new Error(_0x995b('0x80'));}if(_[_0x995b('0x88')](_0x18a513,['role',_0x995b('0x27')])&&_0x120820[_0x995b('0x7d')][_0x995b('0x30')]!=='admin'){throw new Error(_0x995b('0x89'));}return licenseUtil['checkUserLimits'](_0x18a513)[_0x995b('0x14')](function(){return validateUser(_0x18a513[0x0]);})[_0x995b('0x14')](function(){for(var _0x379fac=0x1;_0x379fac<_0x18a513[_0x995b('0x48')];_0x379fac++){var _0x56ae4b=_0x18a513[_0x379fac-0x1][_0x995b('0x5e')];if(!_0x18a513[_0x379fac][_0x995b('0x5e')])_0x18a513[_0x379fac][_0x995b('0x5e')]=_0x56ae4b+0x1;_0x2f14d5[_0x995b('0x45')](validateUser(_0x18a513[_0x379fac]));}return BPromise[_0x995b('0x4f')](_0x2f14d5);})[_0x995b('0x14')](function(){_0x2f14d5=[];for(var _0x47a07d=0x0;_0x47a07d<_0x18a513['length'];_0x47a07d++){_0x2f14d5[_0x995b('0x45')](updateUser(_0x18a513[_0x47a07d]));}return BPromise[_0x995b('0x4f')](_0x2f14d5);})['then'](function(){return BPromise['each'](_0x18a513,function(_0x53ce1e){return db['User']['create'](_0x53ce1e,{'include':[{'model':db[_0x995b('0x6b')],'as':_0x995b('0x6b')}]})['then'](function(_0x542da2){_0x53ce1e['id']=_0x542da2['id'];return _0x53ce1e;});});})[_0x995b('0x14')](function(_0x60483b){if(_0x120820[_0x995b('0x59')][_0x995b('0x30')]===_0x995b('0x7d'))return _0x60483b;if(_0x120820[_0x995b('0x7d')]['role']!==_0x995b('0x7d'))return _0x60483b;var _0x59c11e=_['some'](_0x60483b,function(_0x31fe9d){return _0x31fe9d[_0x995b('0x30')]===_0x995b('0x7e')||_0x31fe9d['role']===_0x995b('0x2a');});if(!_0x59c11e)return _0x60483b;return db[_0x995b('0x83')][_0x995b('0x8a')]({'where':{'name':{'$or':[_0x995b('0x28'),_0x995b('0x29')]},'userProfileId':_0x120820['user']['userProfileId']},'raw':!![]})[_0x995b('0x14')](function(_0xd32c84){if(_[_0x995b('0x8b')](_0xd32c84)||!_[_0x995b('0x88')](_0xd32c84,['autoAssociation',0x0]))return _0x60483b;_0x2f14d5=[];var _0x1e7a75=_(_0xd32c84)[_0x995b('0x2d')](function(_0xb96fe){if(_0xb96fe[_0x995b('0x85')]===0x1)return;return _0xb96fe['name']==='Agents'?_0x995b('0x7e'):_0x995b('0x2a');})[_0x995b('0x8c')]()['value']();for(var _0x73c74e=0x0;_0x73c74e<_0x60483b[_0x995b('0x48')];_0x73c74e++){if(!_['includes'](_0x1e7a75,_0x60483b[_0x73c74e][_0x995b('0x30')]))return;var _0x46c6c7=_0x60483b[_0x73c74e][_0x995b('0x30')]===_0x995b('0x7e')?_0x995b('0x28'):'Telephones';_0x2f14d5[_0x995b('0x45')](db[_0x995b('0x33')]['create']({'name':_0x60483b[_0x73c74e][_0x995b('0x32')],'resourceId':_0x60483b[_0x73c74e]['id'],'type':_0x46c6c7,'sectionId':_[_0x995b('0x31')](_0xd32c84,[_0x995b('0x32'),_0x46c6c7])['id']},{}));}return BPromise[_0x995b('0x4f')](_0x2f14d5);});})[_0x995b('0x14')](respondWithResult(_0x4f4865,0xc9))['catch'](handleError(_0x4f4865,null));};exports[_0x995b('0x8d')]=function(_0x25f5a6,_0x1f9f65){if(_0x25f5a6['body']['id']){delete _0x25f5a6[_0x995b('0x59')]['id'];}return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x25f5a6[_0x995b('0x51')]['id']}})[_0x995b('0x14')](function(_0x2036f3){if(!_0x2036f3)return null;if(_0x2036f3['id']===_0x25f5a6[_0x995b('0x7d')]['id']){if(!_0x25f5a6[_0x995b('0x59')]['oldPassword']||!_0x25f5a6[_0x995b('0x59')][_0x995b('0x8e')]){throw new db[(_0x995b('0x8f'))][(_0x995b('0x90'))](_0x995b('0x91'));}if(!_0x2036f3['authenticate'](_0x25f5a6[_0x995b('0x59')]['oldPassword'])){throw new db['Sequelize'][(_0x995b('0x90'))](_0x995b('0x92'));}if(_0x25f5a6[_0x995b('0x59')][_0x995b('0x93')]===_0x25f5a6[_0x995b('0x59')][_0x995b('0x8e')]){throw new db[(_0x995b('0x8f'))][(_0x995b('0x90'))](_0x995b('0x94'));}}else if(_0x25f5a6['user'][_0x995b('0x30')]==='admin'){if(!_0x25f5a6[_0x995b('0x59')][_0x995b('0x8e')]){throw new db['Sequelize']['ValidationError'](_0x995b('0x95'));}}else if(_0x25f5a6[_0x995b('0x7d')][_0x995b('0x30')]===_0x995b('0x7d')){if(!_0x25f5a6[_0x995b('0x59')][_0x995b('0x8e')]){throw new db['Sequelize']['ValidationError'](_0x995b('0x95'));}if(_0x2036f3[_0x995b('0x30')]!=='agent'){throw new db[(_0x995b('0x8f'))][(_0x995b('0x90'))](_0x995b('0x7f'));}}else{throw new db['Sequelize'][(_0x995b('0x90'))](_0x995b('0x7f'));}return _0x2036f3;})[_0x995b('0x14')](handleEntityNotFound(_0x1f9f65,null))[_0x995b('0x14')](function(_0x184166){return db[_0x995b('0x96')][_0x995b('0x97')]({'attributes':['id',_0x995b('0x60'),_0x995b('0x98'),'passwordHistoryLimit']})[_0x995b('0x14')](function(_0x473402){if(_0x473402[_0x995b('0x60')])authService['validatePasswordPattern'](_0x25f5a6[_0x995b('0x59')]['newPassword']);if(!_0x473402[_0x995b('0x98')]||!_0x184166['previousPasswords'])return _0x184166;authService[_0x995b('0x99')](_0x25f5a6[_0x995b('0x59')][_0x995b('0x8e')],_0x184166[_0x995b('0x9a')],_0x473402[_0x995b('0x9b')]);return _0x184166;})['then'](saveUpdates({'password':_0x25f5a6[_0x995b('0x59')]['newPassword'],'passwordResetAt':_0x25f5a6[_0x995b('0x7d')]['id']==_0x25f5a6['params']['id']?moment():null,'previousPasswords':authService[_0x995b('0x9c')](_0x25f5a6[_0x995b('0x59')][_0x995b('0x8e')],_0x184166['previousPasswords'])},null));})['then'](respondWithResult(_0x1f9f65,null))[_0x995b('0x1d')](handleError(_0x1f9f65,null));};exports[_0x995b('0x9d')]=function(_0x31f264,_0x516cf2){var _0x294634=_0x31f264[_0x995b('0x59')][_0x995b('0x9e')];return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x31f264[_0x995b('0x51')]['id']},'attributes':['id',_0x995b('0x32'),'role',_0x995b('0x9f'),_0x995b('0xa0'),_0x995b('0xa1'),_0x995b('0xa2')]})['then'](handleEntityNotFound(_0x516cf2,null))[_0x995b('0x14')](function(_0xc178){if(_0xc178){if(!utils['isValidChannel'](_0x294634)){throw new db['Sequelize'][(_0x995b('0x90'))](_0x995b('0xa3'));}return _0xc178[_0x995b('0xa4')+_[_0x995b('0xa5')](_0x294634[_0x995b('0xa6')]())+_0x995b('0xa7')](_0x31f264[_0x995b('0x59')]['ids'],{'penalty':_0x31f264[_0x995b('0x59')][_0x995b('0xa8')]||0x0})[_0x995b('0xa9')](function(_0x4901ad){for(var _0x59d9ba=0x0;_0x59d9ba<_0x31f264['body'][_0x995b('0x5d')][_0x995b('0x48')];_0x59d9ba+=0x1){var _0x4ae9ef={'UserId':Number(_0x31f264[_0x995b('0x51')]['id'])};_0x4ae9ef[_[_0x995b('0xa5')](_0x294634['toLowerCase']())+_0x995b('0xaa')]=Number(_0x31f264[_0x995b('0x59')][_0x995b('0x5d')][_0x59d9ba]);socket[_0x995b('0xab')](_0x995b('0x7d')+_[_0x995b('0xa5')](_0x294634['toLowerCase']())+_0x995b('0xac'),_0x4ae9ef);}return _0x4901ad;})[_0x995b('0x14')](function(){if(_0x294634===_0x995b('0xad')){return db[_0x995b('0xae')][_0x995b('0x8a')]({'where':{'id':_0x31f264[_0x995b('0x59')][_0x995b('0x5d')]||[]},'raw':!![],'attributes':['id',_0x995b('0x32')]});}})[_0x995b('0x14')](function(_0x406415){var _0x113391=_0xc178[_0x995b('0x26')]({'plain':!![]});var _0x201e84=[];if(_0x294634==='voice'&&_0x113391[_0x995b('0x30')]==='agent'&&_0x113391[_0x995b('0x9f')]){for(var _0x2c78bb=0x0;_0x2c78bb<_0x406415[_0x995b('0x48')];_0x2c78bb+=0x1){_0x201e84[_0x995b('0x45')]({'membername':_0x113391[_0x995b('0x32')],'UserId':_0x113391['id'],'queue_name':_0x406415[_0x2c78bb][_0x995b('0x32')],'VoiceQueueId':_0x406415[_0x2c78bb]['id'],'interface':_['isNil'](_0x113391['interface'])?util[_0x995b('0xaf')]('SIP/%s',_0x113391[_0x995b('0x32')]):_0x113391[_0x995b('0xa2')],'paused':_0x113391[_0x995b('0xa1')]||![],'penalty':_0x31f264['body'][_0x995b('0xa8')]||0x0});}return BPromise[_0x995b('0xb0')](_0x201e84,function(_0x3bfb69){return db[_0x995b('0xb1')][_0x995b('0xb2')](_0x3bfb69);});}return _0xc178;});}})[_0x995b('0x14')](respondWithStatusCode(_0x516cf2,null))[_0x995b('0x1d')](handleError(_0x516cf2,null));};exports['removeQueues']=function(_0x50a464,_0x3ee12c){var _0x5fa682,_0x26de19;return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x50a464[_0x995b('0x51')]['id']},'attributes':['id',_0x995b('0x32'),_0x995b('0x30')]})['then'](handleEntityNotFound(_0x3ee12c,null))[_0x995b('0x14')](function(_0xbe17c3){if(_0xbe17c3){_0x5fa682=_0xbe17c3;if(!_0x50a464[_0x995b('0x40')]['channel']||!utils[_0x995b('0xb3')](_0x50a464['query']['channel'])){throw new db[(_0x995b('0x8f'))]['ValidationError'](_0x995b('0xa3'));}return _0xbe17c3['remove'+_[_0x995b('0xa5')](_0x50a464['query'][_0x995b('0x9e')][_0x995b('0xa6')]())+_0x995b('0xa7')](_0x50a464['query']['ids']);}})['then'](function(_0x6ab296){if(_[_0x995b('0xb4')](_0x50a464[_0x995b('0x40')]['ids'])){for(var _0x18f0d9=0x0;_0x18f0d9<_0x50a464['query']['ids'][_0x995b('0x48')];_0x18f0d9+=0x1){_0x26de19={'UserId':Number(_0x50a464[_0x995b('0x51')]['id'])};_0x26de19[_['capitalize'](_0x50a464[_0x995b('0x40')]['channel'][_0x995b('0xa6')]())+_0x995b('0xaa')]=Number(_0x50a464[_0x995b('0x40')][_0x995b('0x5d')][_0x18f0d9]);socket[_0x995b('0xab')](_0x995b('0x7d')+_['capitalize'](_0x50a464['query'][_0x995b('0x9e')][_0x995b('0xa6')]())+'Queue:remove',_0x26de19);}}else{_0x26de19={'UserId':Number(_0x50a464[_0x995b('0x51')]['id'])};_0x26de19[_[_0x995b('0xa5')](_0x50a464['query'][_0x995b('0x9e')][_0x995b('0xa6')]())+_0x995b('0xaa')]=Number(_0x50a464[_0x995b('0x40')][_0x995b('0x5d')]);socket[_0x995b('0xab')](_0x995b('0x7d')+_[_0x995b('0xa5')](_0x50a464[_0x995b('0x40')][_0x995b('0x9e')][_0x995b('0xa6')]())+_0x995b('0xb5'),_0x26de19);}return _0x6ab296;})[_0x995b('0x14')](function(){if(_0x50a464['query'][_0x995b('0x9e')]===_0x995b('0xad')){return db['UserVoiceQueueRt'][_0x995b('0x25')]({'where':{'UserId':_0x50a464['params']['id'],'VoiceQueueId':_0x50a464[_0x995b('0x40')]['ids']},'individualHooks':!![]})[_0x995b('0x14')](function(){return _0x5fa682;});}return _0x5fa682;})['then'](respondWithStatusCode(_0x3ee12c,null))[_0x995b('0x1d')](handleError(_0x3ee12c,null));};exports[_0x995b('0xb6')]=function(_0x6e23f2,_0x24ce36){_0x6e23f2[_0x995b('0x59')][_0x995b('0xb7')]=_0x6e23f2[_0x995b('0xb8')][_0x995b('0xb9')];return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x6e23f2[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x24ce36,null))['then'](saveUpdates(_0x6e23f2[_0x995b('0x59')],null))['then'](respondWithResult(_0x24ce36,null))['catch'](handleError(_0x24ce36,null));};exports['getAvatar']=function(_0x888c8f,_0x3f0b3f){var _0x2c3534=path['join'](config[_0x995b('0xba')],_0x995b('0xbb'));return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x888c8f['params']['id']},'attributes':['id',_0x995b('0xb7')],'raw':!![]})[_0x995b('0x14')](handleEntityNotFound(_0x3f0b3f,null))[_0x995b('0x14')](function(_0x279711){if(_0x279711){if(_[_0x995b('0x63')](_0x279711[_0x995b('0xb7')])){return _0x3f0b3f[_0x995b('0xbc')](_0x2c3534);}else{if(!fs['existsSync'](path['join'](config['root'],'server/files/images/',_0x279711[_0x995b('0xb7')]))){return _0x3f0b3f[_0x995b('0xbc')](_0x2c3534);}return _0x3f0b3f[_0x995b('0xbc')](path['join'](config['root'],_0x995b('0xbd'),_0x279711['userpic']));}}})[_0x995b('0x1d')](handleError(_0x3f0b3f,null));};exports[_0x995b('0xbe')]=function(_0x14ef93,_0x2ce27a){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x14ef93[_0x995b('0x51')]['id']},'attributes':['id']})[_0x995b('0x14')](handleEntityNotFound(_0x2ce27a,null))[_0x995b('0x14')](function(_0x2cb8c5){var _0x341a8b=[];values=_0x2cb8c5[_0x995b('0x4a')];_0x341a8b[_0x995b('0x45')](get_open_tabs(_0x995b('0x49'),_0x2cb8c5[_0x995b('0x4a')]));_0x341a8b['push'](get_open_tabs(_0x995b('0x4b'),_0x2cb8c5[_0x995b('0x4a')]));_0x341a8b[_0x995b('0x45')](get_open_tabs(_0x995b('0x4e'),_0x2cb8c5[_0x995b('0x4a')]));_0x341a8b[_0x995b('0x45')](get_open_tabs(_0x995b('0x58'),_0x2cb8c5[_0x995b('0x4a')]));_0x341a8b['push'](get_open_tabs('fax',_0x2cb8c5['dataValues']));_0x341a8b[_0x995b('0x45')](get_open_tabs('mail',_0x2cb8c5[_0x995b('0x4a')]));return BPromise[_0x995b('0x4f')](_0x341a8b);})[_0x995b('0x14')](function(_0x37bcfc){if(_0x37bcfc){var _0xdce3a5=_['map'](values[_0x995b('0xbf')],function(_0x162a90){return{'channel':_0x995b('0xc0'),'id':_0x162a90['id'],'createdAt':_0x162a90['createdAt']};});var _0x3a2849=_[_0x995b('0x2d')](values[_0x995b('0xc1')],function(_0x549d50){return{'channel':'FAX','id':_0x549d50['id'],'createdAt':_0x549d50['createdAt']};});var _0x12d838=_['map'](values[_0x995b('0xc2')],function(_0x35bc24){return{'channel':_0x995b('0xc3'),'id':_0x35bc24['id'],'createdAt':_0x35bc24[_0x995b('0xc4')]};});var _0x4bceb0=_[_0x995b('0x2d')](values['MailOpenTabs'],function(_0x255e11){return{'channel':_0x995b('0xc5'),'id':_0x255e11['id'],'createdAt':_0x255e11[_0x995b('0xc4')]};});var _0x34a083=_[_0x995b('0x2d')](values[_0x995b('0xc6')],function(_0x24b108){return{'channel':_0x995b('0xc7'),'id':_0x24b108['id'],'createdAt':_0x24b108[_0x995b('0xc4')]};});var _0x49985c=_[_0x995b('0x2d')](values[_0x995b('0xc8')],function(_0x40858c){return{'channel':_0x995b('0xc9'),'id':_0x40858c['id'],'createdAt':_0x40858c[_0x995b('0xc4')]};});var _0xf12303=_[_0x995b('0xca')](_0xdce3a5,_0x3a2849,_0x12d838,_0x4bceb0,_0x34a083,_0x49985c);var _0x5e7ec2={'count':_0xf12303['length'],'rows':_0xf12303};return _0x5e7ec2;}else return null;})[_0x995b('0x14')](respondWithResult(_0x2ce27a,null))[_0x995b('0x1d')](handleError(_0x2ce27a,null));};exports[_0x995b('0xcb')]=function(_0x4b8c67,_0x280e11){var _0x508fa6={};var _0x865a1={};var _0x4baec7;var _0x146ff3;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x4b8c67[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x280e11,null))[_0x995b('0x14')](function(_0x2f87e8){if(_0x2f87e8){_0x4baec7=_0x2f87e8;_0x865a1[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0xcc')][_0x995b('0x37')]);_0x865a1['query']=_['keys'](_0x4b8c67[_0x995b('0x40')]);_0x865a1[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x865a1['model'],_0x865a1[_0x995b('0x40')]);_0x508fa6[_0x995b('0x44')]=_[_0x995b('0x54')](_0x865a1[_0x995b('0x53')],qs[_0x995b('0x55')](_0x4b8c67[_0x995b('0x40')][_0x995b('0x55')]));_0x508fa6[_0x995b('0x44')]=_0x508fa6[_0x995b('0x44')][_0x995b('0x48')]?_0x508fa6[_0x995b('0x44')]:_0x865a1[_0x995b('0x53')];_0x508fa6[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x4b8c67['query']['sort']);_0x508fa6['where']=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x4b8c67[_0x995b('0x40')],_0x865a1[_0x995b('0xcd')]));if(_0x4b8c67[_0x995b('0x40')][_0x995b('0x2b')]){_0x508fa6['where']=_['merge'](_0x508fa6[_0x995b('0x3d')],{'$or':_['map'](_0x508fa6[_0x995b('0x44')],function(_0x453257){var _0x3bf9ce={};_0x3bf9ce[_0x453257]={'$like':'%'+_0x4b8c67[_0x995b('0x40')]['filter']+'%'};return _0x3bf9ce;})});}_0x508fa6=_['merge']({},_0x508fa6,_0x4b8c67['options']);return _0x4baec7[_0x995b('0xcb')](_0x508fa6);}})[_0x995b('0x14')](function(_0x28d231){if(_0x28d231){_0x146ff3=_0x28d231[_0x995b('0x48')];if(_0x4b8c67['query'][_0x995b('0xd1')](_0x995b('0x56'))){_0x508fa6['include']=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0x995b('0xd2')],'as':'Tags','attributes':['id',_0x995b('0x32'),'color'],'where':_0x4b8c67[_0x995b('0x40')][_0x995b('0xd3')]?{'id':_0x4b8c67[_0x995b('0x40')][_0x995b('0xd3')]}:undefined,'required':_0x4b8c67[_0x995b('0x40')]['tag']?!![]:![]}];}if(!_0x4b8c67[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x508fa6[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x4b8c67[_0x995b('0x40')][_0x995b('0x22')]);_0x508fa6[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x4b8c67[_0x995b('0x40')][_0x995b('0x21')]);}return _0x4baec7[_0x995b('0xcb')](_0x508fa6);}})[_0x995b('0x14')](function(_0x1d61ad){if(_0x1d61ad){return _0x1d61ad?{'count':_0x146ff3,'rows':_0x1d61ad}:null;}})['then'](respondWithResult(_0x280e11,null))[_0x995b('0x1d')](handleError(_0x280e11,null));};exports[_0x995b('0xd5')]=function(_0xf032aa,_0x3ee699){var _0x3b3ceb;var _0x1216d8={};var _0xe96f40;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0xf032aa[_0x995b('0x51')]['id']},'attributes':['id','name',_0x995b('0x30')]})[_0x995b('0x14')](handleEntityNotFound(_0x3ee699,null))[_0x995b('0x14')](function(_0x33d79d){if(!utils['isValidChannel'](_0xf032aa[_0x995b('0x40')]['channel'])){throw new db[(_0x995b('0x8f'))][(_0x995b('0x90'))](_0x995b('0xa3'));}_0x3b3ceb=_0x33d79d;var _0x1507e8={};_0x1507e8[_0x995b('0x53')]=_['keys'](db[_['capitalize'](_0xf032aa[_0x995b('0x40')]['channel'])+_0x995b('0xd6')][_0x995b('0x37')]);_0x1507e8[_0x995b('0x40')]=_[_0x995b('0x52')](_0xf032aa[_0x995b('0x40')]);_0x1507e8[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x1507e8[_0x995b('0x53')],_0x1507e8[_0x995b('0x40')]);_0x1216d8[_0x995b('0x44')]=_[_0x995b('0x54')](_0x1507e8[_0x995b('0x53')],qs[_0x995b('0x55')](_0xf032aa['query'][_0x995b('0x55')]));_0x1216d8['attributes']=_0x1216d8['attributes'][_0x995b('0x48')]?_0x1216d8[_0x995b('0x44')]:_0x1507e8['model'];_0x1216d8[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0xf032aa[_0x995b('0x40')]['sort']);_0x1216d8['where']=qs['filters'](_['pick'](_0xf032aa[_0x995b('0x40')],_0x1507e8[_0x995b('0xcd')]));if(_0xf032aa[_0x995b('0x40')][_0x995b('0x2b')]){_0x1216d8[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x1216d8['where'],{'$or':_[_0x995b('0x2d')](_0x1216d8[_0x995b('0x44')],function(_0x45e09c){var _0x50a731={};_0x50a731[_0x45e09c]={'$like':'%'+_0xf032aa[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x50a731;})});}_0x1216d8=_[_0x995b('0xd7')]({},_0x1216d8,_0xf032aa[_0x995b('0x57')]);switch(_0x3b3ceb[_0x995b('0x30')]){case _0x995b('0x27'):return db[_[_0x995b('0xa5')](_0xf032aa[_0x995b('0x40')][_0x995b('0x9e')])+_0x995b('0xd6')][_0x995b('0x8a')](_0x1216d8);case'user':case _0x995b('0x7e'):return _0x3b3ceb['get'+_['capitalize'](_0xf032aa[_0x995b('0x40')]['channel'])+_0x995b('0xa7')](_0x1216d8);default:throw new db[(_0x995b('0x8f'))][(_0x995b('0x90'))](_0x995b('0xd8'));}})[_0x995b('0x14')](function(_0x5168f8){_0xe96f40=_0x5168f8[_0x995b('0x48')];if(!_0xf032aa[_0x995b('0x40')]['hasOwnProperty'](_0x995b('0xd4'))){_0x1216d8[_0x995b('0x22')]=qs['limit'](_0xf032aa['query']['limit']);_0x1216d8[_0x995b('0x21')]=qs[_0x995b('0x21')](_0xf032aa['query'][_0x995b('0x21')]);}switch(_0x3b3ceb[_0x995b('0x30')]){case _0x995b('0x27'):return db[_[_0x995b('0xa5')](_0xf032aa[_0x995b('0x40')][_0x995b('0x9e')])+'Queue']['findAll'](_0x1216d8);case _0x995b('0x7d'):case _0x995b('0x7e'):return _0x3b3ceb[_0x995b('0x26')+_[_0x995b('0xa5')](_0xf032aa[_0x995b('0x40')][_0x995b('0x9e')])+_0x995b('0xa7')](_0x1216d8);}})[_0x995b('0x14')](function(_0x34690c){return{'count':_0xe96f40,'rows':_0x34690c};})[_0x995b('0x14')](respondWithResult(_0x3ee699,null))[_0x995b('0x1d')](handleError(_0x3ee699,null));};exports[_0x995b('0xd9')]=function(_0x55580f,_0x134714){var _0x1420da={};var _0x4eafb9={};var _0x3487e3;var _0x575d99;return db[_0x995b('0x36')]['findOne']({'where':{'id':_0x55580f[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x134714,null))[_0x995b('0x14')](function(_0x4dd1dd){if(_0x4dd1dd){_0x3487e3=_0x4dd1dd;_0x4eafb9[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0xb1')][_0x995b('0x37')]);_0x4eafb9[_0x995b('0x40')]=_['keys'](_0x55580f['query']);_0x4eafb9[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x4eafb9[_0x995b('0x53')],_0x4eafb9[_0x995b('0x40')]);_0x1420da[_0x995b('0x44')]=_[_0x995b('0x54')](_0x4eafb9[_0x995b('0x53')],qs[_0x995b('0x55')](_0x55580f[_0x995b('0x40')][_0x995b('0x55')]));_0x1420da[_0x995b('0x44')]=_0x1420da[_0x995b('0x44')][_0x995b('0x48')]?_0x1420da[_0x995b('0x44')]:_0x4eafb9[_0x995b('0x53')];_0x1420da['order']=qs[_0x995b('0xcf')](_0x55580f['query'][_0x995b('0xcf')]);_0x1420da[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x55580f['query'],_0x4eafb9[_0x995b('0xcd')]));if(_0x55580f[_0x995b('0x40')][_0x995b('0x2b')]){_0x1420da[_0x995b('0x3d')]=_['merge'](_0x1420da['where'],{'$or':_[_0x995b('0x2d')](_0x1420da[_0x995b('0x44')],function(_0x20605b){var _0x5d37a6={};_0x5d37a6[_0x20605b]={'$like':'%'+_0x55580f[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x5d37a6;})});}_0x1420da=_[_0x995b('0xd7')]({},_0x1420da,_0x55580f[_0x995b('0x57')]);return _0x3487e3['getVoiceQueuesRt'](_0x1420da);}})[_0x995b('0x14')](function(_0x2d8b41){if(_0x2d8b41){_0x575d99=_0x2d8b41[_0x995b('0x48')];if(!_0x55580f['query']['hasOwnProperty'](_0x995b('0xd4'))){_0x1420da['limit']=qs[_0x995b('0x22')](_0x55580f['query'][_0x995b('0x22')]);_0x1420da[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x55580f[_0x995b('0x40')][_0x995b('0x21')]);}return _0x3487e3[_0x995b('0xd9')](_0x1420da);}})[_0x995b('0x14')](function(_0x3ccb14){if(_0x3ccb14){return _0x3ccb14?{'count':_0x575d99,'rows':_0x3ccb14}:null;}})[_0x995b('0x14')](respondWithResult(_0x134714,null))['catch'](handleError(_0x134714,null));};exports['getGroups']=function(_0x46940a,_0x4e9ee3){var _0x22266f={};var _0x1cd943={};var _0x50202d;var _0x490840;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x46940a[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e9ee3,null))[_0x995b('0x14')](function(_0x36a9ce){if(_0x36a9ce){_0x50202d=_0x36a9ce;_0x1cd943[_0x995b('0x53')]=_[_0x995b('0x52')](db['ChatGroup'][_0x995b('0x37')]);_0x1cd943[_0x995b('0x40')]=_[_0x995b('0x52')](_0x46940a['query']);_0x1cd943[_0x995b('0xcd')]=_['intersection'](_0x1cd943['model'],_0x1cd943['query']);_0x22266f[_0x995b('0x44')]=_['intersection'](_0x1cd943[_0x995b('0x53')],qs['fields'](_0x46940a[_0x995b('0x40')][_0x995b('0x55')]));_0x22266f[_0x995b('0x44')]=_0x22266f[_0x995b('0x44')]['length']?_0x22266f[_0x995b('0x44')]:_0x1cd943[_0x995b('0x53')];_0x22266f[_0x995b('0xce')]=qs['sort'](_0x46940a['query'][_0x995b('0xcf')]);_0x22266f[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x46940a['query'],_0x1cd943[_0x995b('0xcd')]));if(_0x46940a[_0x995b('0x40')][_0x995b('0x2b')]){_0x22266f['where']=_['merge'](_0x22266f['where'],{'$or':_[_0x995b('0x2d')](_0x22266f[_0x995b('0x44')],function(_0x26a988){var _0x3e09ae={};_0x3e09ae[_0x26a988]={'$like':'%'+_0x46940a[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x3e09ae;})});}_0x22266f=_[_0x995b('0xd7')]({},_0x22266f,_0x46940a[_0x995b('0x57')]);return _0x50202d[_0x995b('0xda')](_0x22266f);}})[_0x995b('0x14')](function(_0x20cc94){if(_0x20cc94){_0x490840=_0x20cc94[_0x995b('0x48')];if(!_0x46940a['query'][_0x995b('0xd1')]('nolimit')){_0x22266f['limit']=qs[_0x995b('0x22')](_0x46940a[_0x995b('0x40')][_0x995b('0x22')]);_0x22266f[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x46940a[_0x995b('0x40')]['offset']);}return _0x50202d[_0x995b('0xda')](_0x22266f);}})[_0x995b('0x14')](function(_0x296eba){if(_0x296eba){return _0x296eba?{'count':_0x490840,'rows':_0x296eba}:null;}})[_0x995b('0x14')](respondWithResult(_0x4e9ee3,null))['catch'](handleError(_0x4e9ee3,null));};exports[_0x995b('0xdb')]=function(_0x4dc980,_0x1f80dc){var _0x9c8871={'raw':!![],'where':{}};var _0x7aeaa7={};var _0x305e40={'count':0x0,'rows':[]};return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x4dc980[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x1f80dc,null))[_0x995b('0x14')](function(_0x3acd36){if(_0x3acd36){_0x7aeaa7[_0x995b('0x53')]=_['keys'](db[_0x995b('0xdc')][_0x995b('0x37')]);_0x7aeaa7[_0x995b('0x40')]=_['keys'](_0x4dc980['query']);_0x7aeaa7['filters']=_[_0x995b('0x54')](_0x7aeaa7[_0x995b('0x53')],_0x7aeaa7[_0x995b('0x40')]);_0x9c8871[_0x995b('0x44')]=_[_0x995b('0x54')](_0x7aeaa7[_0x995b('0x53')],qs[_0x995b('0x55')](_0x4dc980[_0x995b('0x40')]['fields']));_0x9c8871[_0x995b('0x44')]=_0x9c8871[_0x995b('0x44')][_0x995b('0x48')]?_0x9c8871[_0x995b('0x44')]:_0x7aeaa7[_0x995b('0x53')];if(!_0x4dc980['query'][_0x995b('0xd1')](_0x995b('0xd4'))){_0x9c8871[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x4dc980[_0x995b('0x40')]['limit']);_0x9c8871[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x4dc980[_0x995b('0x40')]['offset']);}_0x9c8871['order']=qs[_0x995b('0xcf')](_0x4dc980[_0x995b('0x40')][_0x995b('0xcf')]);_0x9c8871[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x4dc980[_0x995b('0x40')],_0x7aeaa7[_0x995b('0xcd')]));_0x9c8871[_0x995b('0x3d')]['UserId']=_0x3acd36['id'];if(_0x4dc980[_0x995b('0x40')][_0x995b('0x2b')]){_0x9c8871[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x9c8871['where'],{'$or':_[_0x995b('0x2d')](_0x9c8871[_0x995b('0x44')],function(_0x23e5e3){var _0x49bed3={};_0x49bed3[_0x23e5e3]={'$like':'%'+_0x4dc980[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x49bed3;})});}_0x9c8871=_['merge']({},_0x9c8871,_0x4dc980['options']);return db[_0x995b('0xdc')][_0x995b('0x3e')]({'where':_0x9c8871[_0x995b('0x3d')]})[_0x995b('0x14')](function(_0x2660c7){_0x305e40[_0x995b('0x3e')]=_0x2660c7;if(_0x4dc980[_0x995b('0x40')][_0x995b('0x56')]){_0x9c8871[_0x995b('0x3f')]=[{'all':!![]}];}return db[_0x995b('0xdc')][_0x995b('0x8a')](_0x9c8871);})[_0x995b('0x14')](function(_0x257a34){_0x305e40[_0x995b('0x46')]=_0x257a34;return _0x305e40;});}})['then'](respondWithFilteredResult(_0x1f80dc,_0x9c8871))[_0x995b('0x1d')](handleError(_0x1f80dc,null));};exports[_0x995b('0xdd')]=function(_0x4dcd14,_0x2ba82a){var _0x3d7f79={'raw':!![],'where':{}};var _0x133b08={};var _0x1ea1f9={'count':0x0,'rows':[]};return db['User'][_0x995b('0x97')]({'where':{'id':_0x4dcd14[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x2ba82a,null))[_0x995b('0x14')](function(_0x47e5da){if(_0x47e5da){_0x133b08['model']=_[_0x995b('0x52')](db[_0x995b('0xde')][_0x995b('0x37')]);_0x133b08[_0x995b('0x40')]=_[_0x995b('0x52')](_0x4dcd14[_0x995b('0x40')]);_0x133b08[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x133b08[_0x995b('0x53')],_0x133b08[_0x995b('0x40')]);_0x3d7f79[_0x995b('0x44')]=_[_0x995b('0x54')](_0x133b08[_0x995b('0x53')],qs['fields'](_0x4dcd14[_0x995b('0x40')][_0x995b('0x55')]));_0x3d7f79['attributes']=_0x3d7f79[_0x995b('0x44')][_0x995b('0x48')]?_0x3d7f79[_0x995b('0x44')]:_0x133b08[_0x995b('0x53')];if(!_0x4dcd14[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x3d7f79[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x4dcd14[_0x995b('0x40')]['limit']);_0x3d7f79[_0x995b('0x21')]=qs['offset'](_0x4dcd14[_0x995b('0x40')][_0x995b('0x21')]);}_0x3d7f79[_0x995b('0xce')]=qs['sort'](_0x4dcd14[_0x995b('0x40')][_0x995b('0xcf')]);_0x3d7f79['where']=qs['filters'](_[_0x995b('0xd0')](_0x4dcd14[_0x995b('0x40')],_0x133b08[_0x995b('0xcd')]));_0x3d7f79[_0x995b('0x3d')][_0x995b('0xdf')]=_0x47e5da['id'];if(_0x4dcd14[_0x995b('0x40')][_0x995b('0x2b')]){_0x3d7f79[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x3d7f79[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x3d7f79[_0x995b('0x44')],function(_0x4fa510){var _0x11e953={};_0x11e953[_0x4fa510]={'$like':'%'+_0x4dcd14[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x11e953;})});}_0x3d7f79=_['merge']({},_0x3d7f79,_0x4dcd14['options']);return db[_0x995b('0xde')][_0x995b('0x3e')]({'where':_0x3d7f79[_0x995b('0x3d')]})['then'](function(_0x4437b9){_0x1ea1f9[_0x995b('0x3e')]=_0x4437b9;if(_0x4dcd14['query'][_0x995b('0x56')]){_0x3d7f79[_0x995b('0x3f')]=[{'all':!![]}];}return db[_0x995b('0xde')][_0x995b('0x8a')](_0x3d7f79);})[_0x995b('0x14')](function(_0x3177a5){_0x1ea1f9[_0x995b('0x46')]=_0x3177a5;return _0x1ea1f9;});}})[_0x995b('0x14')](respondWithFilteredResult(_0x2ba82a,_0x3d7f79))[_0x995b('0x1d')](handleError(_0x2ba82a,null));};exports[_0x995b('0xe0')]=function(_0x5e6470,_0x45bedf){var _0x105079={};var _0x565ecb={};var _0x18a4b5;var _0x191361;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x5e6470[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x45bedf,null))[_0x995b('0x14')](function(_0x9063b){if(_0x9063b){_0x18a4b5=_0x9063b;_0x565ecb[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0xe1')][_0x995b('0x37')]);_0x565ecb['query']=_[_0x995b('0x52')](_0x5e6470['query']);_0x565ecb['filters']=_[_0x995b('0x54')](_0x565ecb[_0x995b('0x53')],_0x565ecb[_0x995b('0x40')]);_0x105079[_0x995b('0x44')]=_[_0x995b('0x54')](_0x565ecb[_0x995b('0x53')],qs[_0x995b('0x55')](_0x5e6470['query'][_0x995b('0x55')]));_0x105079['attributes']=_0x105079['attributes']['length']?_0x105079[_0x995b('0x44')]:_0x565ecb[_0x995b('0x53')];_0x105079[_0x995b('0xce')]=qs['sort'](_0x5e6470[_0x995b('0x40')]['sort']);_0x105079[_0x995b('0x3d')]=qs['filters'](_[_0x995b('0xd0')](_0x5e6470[_0x995b('0x40')],_0x565ecb[_0x995b('0xcd')]));if(_0x5e6470['query'][_0x995b('0x2b')]){_0x105079['where']=_['merge'](_0x105079[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x105079[_0x995b('0x44')],function(_0x4eb05f){var _0x364142={};_0x364142[_0x4eb05f]={'$like':'%'+_0x5e6470[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x364142;})});}_0x105079=_[_0x995b('0xd7')]({},_0x105079,_0x5e6470['options']);return _0x18a4b5[_0x995b('0xe0')](_0x105079);}})[_0x995b('0x14')](function(_0x4f2ab7){if(_0x4f2ab7){_0x191361=_0x4f2ab7[_0x995b('0x48')];if(!_0x5e6470['query'][_0x995b('0xd1')](_0x995b('0xd4'))){_0x105079[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x5e6470[_0x995b('0x40')]['limit']);_0x105079[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x5e6470['query']['offset']);}return _0x18a4b5[_0x995b('0xe0')](_0x105079);}})[_0x995b('0x14')](function(_0x713e8d){if(_0x713e8d){return _0x713e8d?{'count':_0x191361,'rows':_0x713e8d}:null;}})[_0x995b('0x14')](respondWithResult(_0x45bedf,null))['catch'](handleError(_0x45bedf,null));};exports[_0x995b('0xe2')]=function(_0x8a984b,_0x377f0e){var _0x58a5dd={};var _0x11d654={};var _0x2a7918;var _0x1884c7;return db[_0x995b('0x36')]['findOne']({'where':{'id':_0x8a984b[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x377f0e,null))[_0x995b('0x14')](function(_0x4577ec){if(_0x4577ec){_0x2a7918=_0x4577ec;_0x11d654[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0xe3')]['rawAttributes']);_0x11d654[_0x995b('0x40')]=_[_0x995b('0x52')](_0x8a984b[_0x995b('0x40')]);_0x11d654[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x11d654[_0x995b('0x53')],_0x11d654[_0x995b('0x40')]);_0x58a5dd['attributes']=_[_0x995b('0x54')](_0x11d654[_0x995b('0x53')],qs['fields'](_0x8a984b[_0x995b('0x40')]['fields']));_0x58a5dd['attributes']=_0x58a5dd[_0x995b('0x44')][_0x995b('0x48')]?_0x58a5dd['attributes']:_0x11d654[_0x995b('0x53')];_0x58a5dd[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x8a984b[_0x995b('0x40')]['sort']);_0x58a5dd[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x8a984b['query'],_0x11d654[_0x995b('0xcd')]));if(_0x8a984b[_0x995b('0x40')][_0x995b('0x2b')]){_0x58a5dd['where']=_[_0x995b('0xd7')](_0x58a5dd[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x58a5dd[_0x995b('0x44')],function(_0x391901){var _0x2104ac={};_0x2104ac[_0x391901]={'$like':'%'+_0x8a984b['query']['filter']+'%'};return _0x2104ac;})});}_0x58a5dd=_[_0x995b('0xd7')]({},_0x58a5dd,_0x8a984b[_0x995b('0x57')]);return _0x2a7918[_0x995b('0xe2')](_0x58a5dd);}})[_0x995b('0x14')](function(_0x3ff378){if(_0x3ff378){_0x1884c7=_0x3ff378[_0x995b('0x48')];if(!_0x8a984b[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x58a5dd['limit']=qs['limit'](_0x8a984b[_0x995b('0x40')][_0x995b('0x22')]);_0x58a5dd[_0x995b('0x21')]=qs['offset'](_0x8a984b[_0x995b('0x40')]['offset']);}return _0x2a7918[_0x995b('0xe2')](_0x58a5dd);}})['then'](function(_0x2bc725){if(_0x2bc725){return _0x2bc725?{'count':_0x1884c7,'rows':_0x2bc725}:null;}})['then'](respondWithResult(_0x377f0e,null))[_0x995b('0x1d')](handleError(_0x377f0e,null));};exports[_0x995b('0xe4')]=function(_0x576325,_0x2d9de2){var _0x16411a={'raw':!![],'where':{}};var _0x28f19e={};var _0x3d2c25={'count':0x0,'rows':[]};return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x576325[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x2d9de2,null))[_0x995b('0x14')](function(_0x5da812){if(_0x5da812){_0x28f19e[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0xe5')][_0x995b('0x37')]);_0x28f19e['query']=_['keys'](_0x576325[_0x995b('0x40')]);_0x28f19e['filters']=_[_0x995b('0x54')](_0x28f19e[_0x995b('0x53')],_0x28f19e[_0x995b('0x40')]);_0x16411a[_0x995b('0x44')]=_[_0x995b('0x54')](_0x28f19e[_0x995b('0x53')],qs[_0x995b('0x55')](_0x576325[_0x995b('0x40')]['fields']));_0x16411a[_0x995b('0x44')]=_0x16411a[_0x995b('0x44')]['length']?_0x16411a[_0x995b('0x44')]:_0x28f19e[_0x995b('0x53')];if(!_0x576325[_0x995b('0x40')][_0x995b('0xd1')]('nolimit')){_0x16411a[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x576325[_0x995b('0x40')][_0x995b('0x22')]);_0x16411a[_0x995b('0x21')]=qs['offset'](_0x576325[_0x995b('0x40')][_0x995b('0x21')]);}_0x16411a['order']=qs[_0x995b('0xcf')](_0x576325[_0x995b('0x40')]['sort']);_0x16411a['where']=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x576325[_0x995b('0x40')],_0x28f19e[_0x995b('0xcd')]));_0x16411a[_0x995b('0x3d')][_0x995b('0xdf')]=_0x5da812['id'];if(_0x576325[_0x995b('0x40')][_0x995b('0x2b')]){_0x16411a[_0x995b('0x3d')]=_['merge'](_0x16411a[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x16411a[_0x995b('0x44')],function(_0x592846){var _0x336812={};_0x336812[_0x592846]={'$like':'%'+_0x576325[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x336812;})});}_0x16411a=_[_0x995b('0xd7')]({},_0x16411a,_0x576325[_0x995b('0x57')]);return db[_0x995b('0xe5')][_0x995b('0x3e')]({'where':_0x16411a[_0x995b('0x3d')]})['then'](function(_0x465660){_0x3d2c25[_0x995b('0x3e')]=_0x465660;if(_0x576325[_0x995b('0x40')][_0x995b('0x56')]){_0x16411a['include']=[{'all':!![]}];}return db[_0x995b('0xe5')][_0x995b('0x8a')](_0x16411a);})[_0x995b('0x14')](function(_0x3d94a7){_0x3d2c25[_0x995b('0x46')]=_0x3d94a7;return _0x3d2c25;});}})[_0x995b('0x14')](respondWithFilteredResult(_0x2d9de2,_0x16411a))[_0x995b('0x1d')](handleError(_0x2d9de2,null));};exports[_0x995b('0xe6')]=function(_0x24b709,_0x5afef3){var _0x42114b={};var _0x561036={};var _0x463e05;var _0x547e36;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x24b709[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x5afef3,null))[_0x995b('0x14')](function(_0x48eb86){if(_0x48eb86){_0x463e05=_0x48eb86;_0x561036[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0xe7')][_0x995b('0x37')]);_0x561036[_0x995b('0x40')]=_[_0x995b('0x52')](_0x24b709[_0x995b('0x40')]);_0x561036[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x561036[_0x995b('0x53')],_0x561036[_0x995b('0x40')]);_0x42114b[_0x995b('0x44')]=_[_0x995b('0x54')](_0x561036[_0x995b('0x53')],qs[_0x995b('0x55')](_0x24b709['query'][_0x995b('0x55')]));_0x42114b['attributes']=_0x42114b['attributes'][_0x995b('0x48')]?_0x42114b['attributes']:_0x561036[_0x995b('0x53')];_0x42114b[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x24b709[_0x995b('0x40')][_0x995b('0xcf')]);_0x42114b[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x24b709[_0x995b('0x40')],_0x561036[_0x995b('0xcd')]));if(_0x24b709[_0x995b('0x40')][_0x995b('0x2b')]){_0x42114b[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x42114b[_0x995b('0x3d')],{'$or':_['map'](_0x42114b[_0x995b('0x44')],function(_0x385ff0){var _0x5e0bf7={};_0x5e0bf7[_0x385ff0]={'$like':'%'+_0x24b709[_0x995b('0x40')]['filter']+'%'};return _0x5e0bf7;})});}_0x42114b=_['merge']({},_0x42114b,_0x24b709[_0x995b('0x57')]);return _0x463e05[_0x995b('0xe6')](_0x42114b);}})[_0x995b('0x14')](function(_0x45dc6e){if(_0x45dc6e){_0x547e36=_0x45dc6e[_0x995b('0x48')];if(!_0x24b709[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x42114b[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x24b709[_0x995b('0x40')]['limit']);_0x42114b[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x24b709[_0x995b('0x40')]['offset']);}return _0x463e05['getSmsInteractions'](_0x42114b);}})['then'](function(_0x3d8569){if(_0x3d8569){return _0x3d8569?{'count':_0x547e36,'rows':_0x3d8569}:null;}})['then'](respondWithResult(_0x5afef3,null))[_0x995b('0x1d')](handleError(_0x5afef3,null));};exports[_0x995b('0xe8')]=function(_0x3051e5,_0x4ed0d7){var _0x3a323c={};var _0x16ebb8={};var _0x242c19;var _0x50ed22;return db['User'][_0x995b('0x97')]({'where':{'id':_0x3051e5[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x4ed0d7,null))[_0x995b('0x14')](function(_0x595404){if(_0x595404){_0x242c19=_0x595404;_0x16ebb8['model']=_[_0x995b('0x52')](db[_0x995b('0xe9')][_0x995b('0x37')]);_0x16ebb8[_0x995b('0x40')]=_['keys'](_0x3051e5[_0x995b('0x40')]);_0x16ebb8[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x16ebb8[_0x995b('0x53')],_0x16ebb8[_0x995b('0x40')]);_0x3a323c[_0x995b('0x44')]=_[_0x995b('0x54')](_0x16ebb8[_0x995b('0x53')],qs[_0x995b('0x55')](_0x3051e5[_0x995b('0x40')][_0x995b('0x55')]));_0x3a323c[_0x995b('0x44')]=_0x3a323c[_0x995b('0x44')]['length']?_0x3a323c[_0x995b('0x44')]:_0x16ebb8[_0x995b('0x53')];_0x3a323c['order']=qs[_0x995b('0xcf')](_0x3051e5[_0x995b('0x40')][_0x995b('0xcf')]);_0x3a323c['where']=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x3051e5[_0x995b('0x40')],_0x16ebb8['filters']));if(_0x3051e5[_0x995b('0x40')][_0x995b('0x2b')]){_0x3a323c[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x3a323c[_0x995b('0x3d')],{'$or':_['map'](_0x3a323c[_0x995b('0x44')],function(_0x21a8da){var _0x532fea={};_0x532fea[_0x21a8da]={'$like':'%'+_0x3051e5[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x532fea;})});}_0x3a323c=_[_0x995b('0xd7')]({},_0x3a323c,_0x3051e5[_0x995b('0x57')]);return _0x242c19[_0x995b('0xe8')](_0x3a323c);}})[_0x995b('0x14')](function(_0xa75929){if(_0xa75929){_0x50ed22=_0xa75929[_0x995b('0x48')];if(!_0x3051e5[_0x995b('0x40')][_0x995b('0xd1')]('nolimit')){_0x3a323c[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x3051e5[_0x995b('0x40')]['limit']);_0x3a323c[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x3051e5[_0x995b('0x40')]['offset']);}return _0x242c19['getFaxInteractions'](_0x3a323c);}})[_0x995b('0x14')](function(_0x3b95a3){if(_0x3b95a3){return _0x3b95a3?{'count':_0x50ed22,'rows':_0x3b95a3}:null;}})[_0x995b('0x14')](respondWithResult(_0x4ed0d7,null))['catch'](handleError(_0x4ed0d7,null));};exports[_0x995b('0xea')]=function(_0x4febb8,_0x5288ac){var _0x5461da={};var _0x24510f={};var _0xf67a55;var _0x35b6d2;return db[_0x995b('0x36')]['findOne']({'where':{'id':_0x4febb8[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x5288ac,null))['then'](function(_0xe60fbd){if(_0xe60fbd){_0xf67a55=_0xe60fbd;_0x24510f[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0xeb')][_0x995b('0x37')]);_0x24510f[_0x995b('0x40')]=_['keys'](_0x4febb8[_0x995b('0x40')]);_0x24510f['filters']=_[_0x995b('0x54')](_0x24510f[_0x995b('0x53')],_0x24510f[_0x995b('0x40')]);_0x5461da[_0x995b('0x44')]=_[_0x995b('0x54')](_0x24510f[_0x995b('0x53')],qs[_0x995b('0x55')](_0x4febb8[_0x995b('0x40')][_0x995b('0x55')]));_0x5461da[_0x995b('0x44')]=_0x5461da[_0x995b('0x44')][_0x995b('0x48')]?_0x5461da[_0x995b('0x44')]:_0x24510f[_0x995b('0x53')];_0x5461da['order']=qs[_0x995b('0xcf')](_0x4febb8['query'][_0x995b('0xcf')]);_0x5461da[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x4febb8[_0x995b('0x40')],_0x24510f[_0x995b('0xcd')]));if(_0x4febb8[_0x995b('0x40')][_0x995b('0x2b')]){_0x5461da[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x5461da[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x5461da['attributes'],function(_0x58fdde){var _0x2f155f={};_0x2f155f[_0x58fdde]={'$like':'%'+_0x4febb8[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x2f155f;})});}_0x5461da=_[_0x995b('0xd7')]({},_0x5461da,_0x4febb8['options']);return _0xf67a55[_0x995b('0xea')](_0x5461da);}})[_0x995b('0x14')](function(_0x78b6c4){if(_0x78b6c4){_0x35b6d2=_0x78b6c4[_0x995b('0x48')];if(!_0x4febb8[_0x995b('0x40')]['hasOwnProperty'](_0x995b('0xd4'))){_0x5461da[_0x995b('0x22')]=qs['limit'](_0x4febb8[_0x995b('0x40')]['limit']);_0x5461da[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x4febb8[_0x995b('0x40')]['offset']);}return _0xf67a55[_0x995b('0xea')](_0x5461da);}})[_0x995b('0x14')](function(_0x155177){if(_0x155177){return _0x155177?{'count':_0x35b6d2,'rows':_0x155177}:null;}})[_0x995b('0x14')](respondWithResult(_0x5288ac,null))['catch'](handleError(_0x5288ac,null));};exports[_0x995b('0xec')]=function(_0x79ffd3,_0x3badb3,_0x543cf1){var _0x24cd17;var _0x3d64ac;var _0xe62305;var _0x1d1742=!_[_0x995b('0x63')](_0x79ffd3[_0x995b('0x51')]['id'])?_0x79ffd3[_0x995b('0x51')]['id']:!_[_0x995b('0x63')](_0x79ffd3['user']['id'])?_0x79ffd3[_0x995b('0x7d')]['id']:null;return db[_0x995b('0x36')]['find']({'where':{'id':_0x1d1742,'role':{'$or':['admin',_0x995b('0x7d'),_0x995b('0x7e')]}},'attributes':['id',_0x995b('0x32'),_0x995b('0xed'),_0x995b('0xee'),_0x995b('0x30'),'internal',_0x995b('0xa0')]})[_0x995b('0x14')](function(_0x4998fa){if(_0x4998fa){if(_0x4998fa[_0x995b('0x30')]===_0x995b('0x7e')){_0x24cd17=_0x4998fa;if(_0x79ffd3['body'][_0x995b('0xa2')]){_0xe62305=util[_0x995b('0xaf')](_0x995b('0xef'),_0x24cd17[_0x79ffd3[_0x995b('0x59')][_0x995b('0xa2')]]);}else if(_0x79ffd3[_0x995b('0x59')][_0x995b('0xf0')]){_0xe62305=util[_0x995b('0xaf')](_0x995b('0xf1'),_0x79ffd3[_0x995b('0x59')][_0x995b('0xf0')]);}else{_0xe62305=util[_0x995b('0xaf')](_0x995b('0xf1'),_0x24cd17[_0x995b('0x32')]);}socket['to'](util[_0x995b('0xaf')](_0x995b('0xf2'),_0x24cd17['name']))[_0x995b('0xab')](_0x995b('0xf3'),{'user':{'id':_0x24cd17['id'],'name':_0x24cd17[_0x995b('0x32')]},'ip':_0x79ffd3[_0x995b('0xf4')][_0x995b('0xf5')]||_0x79ffd3[_0x995b('0xf6')][_0x995b('0xf7')]||_0x79ffd3[_0x995b('0xf8')][_0x995b('0xf7')]||_0x79ffd3[_0x995b('0xf6')][_0x995b('0xf8')][_0x995b('0xf7')]});return db[_0x995b('0xb1')][_0x995b('0x25')]({'where':{'membername':_0x24cd17[_0x995b('0x32')]},'individualHooks':!![]});}}else{throw new db[(_0x995b('0x8f'))][(_0x995b('0x90'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x995b('0x14')](function(){if(_0x24cd17){return _0x24cd17['getVoiceQueues']({'raw':!![]});}})[_0x995b('0x14')](function(_0x916c19){if(_0x24cd17){var _0x1f969e=[];if(_0x916c19){_0x3d64ac=_0x916c19;if(_0x3d64ac[_0x995b('0x48')]){for(var _0x5f4b89=0x0;_0x5f4b89<_0x3d64ac[_0x995b('0x48')];_0x5f4b89++){_0x1f969e[_0x995b('0x45')]({'membername':_0x24cd17['name'],'UserId':_0x24cd17['id'],'queue_name':_0x3d64ac[_0x5f4b89][_0x995b('0x32')],'VoiceQueueId':_0x3d64ac[_0x5f4b89]['id'],'interface':_0xe62305,'paused':_0x24cd17[_0x995b('0xa0')]||![],'penalty':_0x3d64ac[_0x5f4b89][_0x995b('0xf9')]||0x0});}return BPromise['each'](_0x1f969e,function(_0x1cb366){return db[_0x995b('0xb1')][_0x995b('0xb2')](_0x1cb366);});}}}})[_0x995b('0x14')](function(){if(_0x24cd17){return db[_0x995b('0xfa')][_0x995b('0x8a')]({'where':{'membername':_0x24cd17[_0x995b('0x32')],'exitAt':null}});}})[_0x995b('0x14')](function(_0x224486){if(_0x24cd17){var _0x98dd35=[];_0x224486[_0x995b('0xfb')](function(_0x34ec03){_0x98dd35[_0x995b('0x45')](_0x34ec03[_0x995b('0x24')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x98dd35);}})[_0x995b('0x14')](function(){if(_0x24cd17){var _0xd04711=[];var _0x13422e=[];var _0x4f4934=utils[_0x995b('0xfc')]();var _0x2ac12e={'membername':_0x24cd17['name'],'interface':_0xe62305,'enterAt':moment()[_0x995b('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x24cd17[_0x995b('0x30')],'internal':_0x24cd17['internal']};_0x4f4934[_0x995b('0xfb')](function(_0x580e1a){_0xd04711[_0x995b('0x45')](_[_0x995b('0xd7')]({'channel':_0x580e1a,'type':'LOGIN','data1':_0x79ffd3['body']['device'],'data2':_0xe62305},_0x2ac12e));if(_0x24cd17['loginInPause']){_0x13422e[_0x995b('0x45')](_['merge']({'channel':_0x580e1a,'type':_0x995b('0xfd'),'data1':_0x995b('0xfe')},_0x2ac12e));}});return db[_0x995b('0xfa')][_0x995b('0x87')](_0xd04711[_0x995b('0xca')](_0x13422e),{'individualHooks':!![]});}})[_0x995b('0x14')](function(){if(_0x24cd17){return _0x24cd17[_0x995b('0x24')]({'online':!![],'lastLoginAt':moment()['format'](_0x995b('0xff')),'voicePause':_0x24cd17[_0x995b('0xa0')]||![],'mailPause':_0x24cd17['loginInPause']||![],'chatPause':_0x24cd17[_0x995b('0xa0')]||![],'faxPause':_0x24cd17[_0x995b('0xa0')]||![],'smsPause':_0x24cd17[_0x995b('0xa0')]||![],'openchannelPause':_0x24cd17['loginInPause']||![],'whatsappPause':_0x24cd17[_0x995b('0xa0')]||![],'pauseType':_0x24cd17[_0x995b('0xa0')]?_0x995b('0xfe'):null,'interface':_0xe62305,'lastPauseAt':moment()[_0x995b('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x13c4a9){if(_0x79ffd3[_0x995b('0x100')]){return _0x543cf1();}else{return BPromise[_0x995b('0x101')](_0x13c4a9)[_0x995b('0x14')](respondWithResult(_0x3badb3,null));}})[_0x995b('0x1d')](handleError(_0x3badb3,null));};exports[_0x995b('0x102')]=function(_0x1dcdfb,_0x104d65){var _0x232dc5;return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x1dcdfb[_0x995b('0x51')]['id'],'role':_0x995b('0x7e')},'attributes':['id',_0x995b('0x32'),_0x995b('0x30')]})['then'](handleEntityNotFound(_0x104d65,null))[_0x995b('0x14')](function(_0x511488){if(_0x511488){_0x232dc5=_0x511488;return db['UserVoiceQueueRt'][_0x995b('0x25')]({'where':{'membername':_0x232dc5[_0x995b('0x32')]},'individualHooks':!![]});}})[_0x995b('0x14')](function(){return db[_0x995b('0xfa')]['findAll']({'where':{'membername':_0x232dc5[_0x995b('0x32')],'exitAt':null}});})[_0x995b('0x14')](function(_0x58fc9e){var _0x454510=[];_0x58fc9e['forEach'](function(_0x334f69){_0x454510[_0x995b('0x45')](_0x334f69[_0x995b('0x24')]({'exitAt':moment()[_0x995b('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x995b('0x4f')](_0x454510);})[_0x995b('0x14')](function(){return _0x232dc5[_0x995b('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x104d65,null))[_0x995b('0x1d')](handleError(_0x104d65,null));};exports[_0x995b('0x103')]=function(_0x26a164,_0x44aaa7){var _0x2d4792;return db[_0x995b('0xb1')][_0x995b('0x24')]({'paused':0x1},{'where':{'UserId':_0x26a164[_0x995b('0x51')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x26a164[_0x995b('0x51')]['id'],'role':_0x995b('0x7e')},'attributes':['id',_0x995b('0x32'),'role',_0x995b('0x5e'),'interface']});})[_0x995b('0x14')](handleEntityNotFound(_0x44aaa7,null))[_0x995b('0x14')](function(_0x2bb4c5){if(_0x2bb4c5){_0x2d4792=_0x2bb4c5;return respondWithRpcPromise(_0x995b('0x104'),_0x995b('0x103'),{'id':_0x2d4792['id'],'name':_0x2d4792['name'],'pause':!![]});}})[_0x995b('0x14')](function(){if(_0x2d4792){return db['MemberReport'][_0x995b('0x8a')]({'where':{'membername':_0x2d4792['name'],'type':_0x995b('0xfd'),'exitAt':null}});}})[_0x995b('0x14')](function(_0x86d97){if(_0x86d97[_0x995b('0x48')]){var _0x1d4961=moment()[_0x995b('0xaf')](_0x995b('0xff'));for(var _0x68f84b=0x0,_0x2d4479=_0x86d97['length'];_0x68f84b<_0x2d4479;_0x68f84b++){_0x86d97[_0x68f84b]['updateAttributes']({'exitAt':_0x1d4961});}}})[_0x995b('0x14')](function(){var _0x3094a1=[];var _0x2f6399=utils[_0x995b('0xfc')]();_0x2f6399['forEach'](function(_0x523ea2){_0x3094a1[_0x995b('0x45')]({'channel':_0x523ea2,'membername':_0x2d4792['name'],'interface':_['isNil'](_0x2d4792['interface'])?util[_0x995b('0xaf')](_0x995b('0xf1'),_0x2d4792[_0x995b('0x32')]):_0x2d4792[_0x995b('0xa2')],'type':_0x995b('0xfd'),'enterAt':moment()[_0x995b('0xaf')](_0x995b('0xff')),'data1':_0x26a164[_0x995b('0x59')][_0x995b('0x39')]||'DEFAULT\x20PAUSE','role':_0x2d4792[_0x995b('0x30')],'internal':_0x2d4792[_0x995b('0x5e')]});});return db['MemberReport']['bulkCreate'](_0x3094a1,{'individualHooks':!![]});})[_0x995b('0x14')](function(){return _0x2d4792[_0x995b('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x26a164[_0x995b('0x59')]['type']||_0x995b('0x105'),'lastPauseAt':moment()[_0x995b('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x995b('0x14')](respondWithResult(_0x44aaa7,null))[_0x995b('0x1d')](handleError(_0x44aaa7,null));};exports[_0x995b('0x106')]=function(_0x3bb86d,_0x2c8384){var _0x3c5b5a;return db['User'][_0x995b('0x31')]({'where':{'id':_0x3bb86d[_0x995b('0x51')]['id']},'attributes':['id',_0x995b('0x32'),_0x995b('0x30'),'voicePause','mailPause','chatPause',_0x995b('0x107'),'openchannelPause',_0x995b('0x108'),'whatsapppause',_0x995b('0x109'),'lastPauseAt']})[_0x995b('0x14')](handleEntityNotFound(_0x2c8384,null))[_0x995b('0x14')](function(_0x5c1375){if(_0x5c1375){_0x3c5b5a=_0x5c1375;if(_0x3bb86d[_0x995b('0x59')][_0x995b('0x9e')]&&!utils[_0x995b('0xb3')](_0x3bb86d[_0x995b('0x59')][_0x995b('0x9e')])){throw new db['Sequelize'][(_0x995b('0x90'))]('Unknown\x20channel');}switch(_0x3bb86d[_0x995b('0x59')][_0x995b('0x9e')]){case'voice':return respondWithRpcPromise(_0x995b('0x104'),'unpause',{'id':_0x3c5b5a['id'],'name':_0x3c5b5a[_0x995b('0x32')],'pause':![]})[_0x995b('0x14')](function(){return db[_0x995b('0xb1')][_0x995b('0x24')]({'paused':0x0},{'where':{'UserId':_0x3c5b5a['id']},'individualHooks':!![]});})[_0x995b('0x14')](function(){return db[_0x995b('0xfa')]['find']({'where':{'channel':_0x3bb86d[_0x995b('0x59')][_0x995b('0x9e')],'membername':_0x3c5b5a[_0x995b('0x32')],'type':'PAUSE','exitAt':null}});})[_0x995b('0x14')](function(_0x56419f){if(_0x56419f){return _0x56419f['update']({'exitAt':moment()['format'](_0x995b('0xff')),'data2':_0x995b('0x10a')},{'individualHooks':!![]});}return null;})[_0x995b('0x14')](function(){return _0x3c5b5a['update']({'voicePause':![]});});case'mail':case _0x995b('0x49'):case _0x995b('0x4c'):case _0x995b('0x4b'):case _0x995b('0x58'):case _0x995b('0x4e'):return db[_0x995b('0xfa')][_0x995b('0x31')]({'where':{'channel':_0x3bb86d[_0x995b('0x59')][_0x995b('0x9e')],'membername':_0x3c5b5a[_0x995b('0x32')],'type':'PAUSE','exitAt':null}})[_0x995b('0x14')](function(_0x20c7ce){if(_0x20c7ce){return _0x20c7ce['update']({'exitAt':moment()[_0x995b('0xaf')](_0x995b('0xff')),'data2':_0x995b('0x10a')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x2e2e96={};_[_0x995b('0x10b')](_0x2e2e96,util[_0x995b('0xaf')](_0x995b('0x10c'),_0x3bb86d[_0x995b('0x59')][_0x995b('0x9e')],_0x995b('0x10d')),![]);return _0x3c5b5a[_0x995b('0x24')](_0x2e2e96);});default:return respondWithRpcPromise('QueuePause',_0x995b('0x106'),{'id':_0x3c5b5a['id'],'name':_0x3c5b5a[_0x995b('0x32')],'pause':![]})[_0x995b('0x14')](function(){return db[_0x995b('0xb1')][_0x995b('0x24')]({'paused':0x0},{'where':{'UserId':_0x3c5b5a['id']}});})['then'](function(){return db[_0x995b('0xfa')][_0x995b('0x8a')]({'where':{'membername':_0x3c5b5a['name'],'type':_0x995b('0xfd'),'exitAt':null}});})[_0x995b('0x14')](function(_0x4df996){var _0xbb0f43=[];_0x4df996[_0x995b('0xfb')](function(_0x541285){_0xbb0f43[_0x995b('0x45')](_0x541285[_0x995b('0x24')]({'exitAt':moment()[_0x995b('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x995b('0x10a')}));});return BPromise['all'](_0xbb0f43);})[_0x995b('0x14')](function(){return _0x3c5b5a[_0x995b('0x24')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x995b('0x14')](respondWithResult(_0x2c8384,null))[_0x995b('0x1d')](handleError(_0x2c8384,null));};exports[_0x995b('0x10e')]=function(_0x5bdaf6,_0x3fce49){var _0x465960={};var _0x3dfaff={};var _0x3aa186;var _0x2eadc2;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x5bdaf6[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x3fce49,null))[_0x995b('0x14')](function(_0x4425b9){if(_0x4425b9){_0x3aa186=_0x4425b9;_0x3dfaff[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0x10f')][_0x995b('0x37')]);_0x3dfaff['query']=_[_0x995b('0x52')](_0x5bdaf6[_0x995b('0x40')]);_0x3dfaff[_0x995b('0xcd')]=_['intersection'](_0x3dfaff[_0x995b('0x53')],_0x3dfaff[_0x995b('0x40')]);_0x465960[_0x995b('0x44')]=_[_0x995b('0x54')](_0x3dfaff['model'],qs[_0x995b('0x55')](_0x5bdaf6[_0x995b('0x40')]['fields']));_0x465960[_0x995b('0x44')]=_0x465960['attributes']['length']?_0x465960[_0x995b('0x44')]:_0x3dfaff[_0x995b('0x53')];_0x465960[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x5bdaf6[_0x995b('0x40')][_0x995b('0xcf')]);_0x465960[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_['pick'](_0x5bdaf6[_0x995b('0x40')],_0x3dfaff['filters']));if(_0x5bdaf6[_0x995b('0x40')]['filter']){_0x465960[_0x995b('0x3d')]=_['merge'](_0x465960[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x465960[_0x995b('0x44')],function(_0x3afa3b){var _0xe05366={};_0xe05366[_0x3afa3b]={'$like':'%'+_0x5bdaf6[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0xe05366;})});}_0x465960=_['merge']({},_0x465960,_0x5bdaf6[_0x995b('0x57')]);return _0x3aa186[_0x995b('0x10e')](_0x465960);}})[_0x995b('0x14')](function(_0x1ce19d){if(_0x1ce19d){_0x2eadc2=_0x1ce19d[_0x995b('0x48')];if(!_0x5bdaf6[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x465960[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x5bdaf6[_0x995b('0x40')][_0x995b('0x22')]);_0x465960[_0x995b('0x21')]=qs['offset'](_0x5bdaf6[_0x995b('0x40')][_0x995b('0x21')]);}return _0x3aa186[_0x995b('0x10e')](_0x465960);}})[_0x995b('0x14')](function(_0x3367e9){if(_0x3367e9){return _0x3367e9?{'count':_0x2eadc2,'rows':_0x3367e9}:null;}})[_0x995b('0x14')](respondWithResult(_0x3fce49,null))[_0x995b('0x1d')](handleError(_0x3fce49,null));};exports[_0x995b('0x110')]=function(_0x455342,_0x3d685d){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x455342['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x3d685d,null))[_0x995b('0x14')](function(_0x2ed7d2){if(_0x2ed7d2){var _0x4d699f=_0x2ed7d2[_0x995b('0x26')]({'plain':!![]});return _0x2ed7d2['addTeams'](_0x455342[_0x995b('0x59')][_0x995b('0x5d')],_[_0x995b('0x5c')](_0x455342[_0x995b('0x59')],['ids','id'])||{})[_0x995b('0x14')](function(){for(var _0x423b1b=0x0;_0x423b1b<_0x455342['body'][_0x995b('0x5d')][_0x995b('0x48')];_0x423b1b++){var _0x559b26=[];var _0x15be9a={};db[_0x995b('0x10f')][_0x995b('0x97')]({'where':{'id':_0x455342[_0x995b('0x59')][_0x995b('0x5d')][_0x423b1b]}})['then'](function(_0x5b8698){_0x15be9a=_0x5b8698[_0x995b('0x4a')];_0x559b26[_0x995b('0x45')](_0x5b8698[_0x995b('0x111')]()[_0x995b('0x14')](function(_0x22fdb2){for(var _0x170100=0x0;_0x170100<_0x22fdb2[_0x995b('0x48')];_0x170100++){_0x22fdb2[_0x170100][_0x995b('0x112')](_0x995b('0x9e'),_0x995b('0x113'));}return _0x22fdb2;}));_0x559b26['push'](_0x5b8698['getChatQueues']()[_0x995b('0x14')](function(_0x7e7049){for(var _0x26ba73=0x0;_0x26ba73<_0x7e7049[_0x995b('0x48')];_0x26ba73++){_0x7e7049[_0x26ba73][_0x995b('0x112')]('channel','Chat');}return _0x7e7049;}));_0x559b26[_0x995b('0x45')](_0x5b8698[_0x995b('0x114')]()['then'](function(_0xb507ca){for(var _0x1a04e3=0x0;_0x1a04e3<_0xb507ca['length'];_0x1a04e3++){_0xb507ca[_0x1a04e3]['setDataValue']('channel',_0x995b('0x115'));}return _0xb507ca;}));_0x559b26[_0x995b('0x45')](_0x5b8698['getSmsQueues']()[_0x995b('0x14')](function(_0x128d1a){for(var _0x45816a=0x0;_0x45816a<_0x128d1a['length'];_0x45816a++){_0x128d1a[_0x45816a][_0x995b('0x112')](_0x995b('0x9e'),_0x995b('0x116'));}return _0x128d1a;}));_0x559b26[_0x995b('0x45')](_0x5b8698[_0x995b('0x117')]()['then'](function(_0x2a5f68){for(var _0x358bc1=0x0;_0x358bc1<_0x2a5f68[_0x995b('0x48')];_0x358bc1++){_0x2a5f68[_0x358bc1][_0x995b('0x112')](_0x995b('0x9e'),_0x995b('0x118'));}return _0x2a5f68;}));_0x559b26[_0x995b('0x45')](_0x5b8698['getFaxQueues']()['then'](function(_0x526f3d){for(var _0x3c2e03=0x0;_0x3c2e03<_0x526f3d['length'];_0x3c2e03++){_0x526f3d[_0x3c2e03][_0x995b('0x112')]('channel','Fax');}return _0x526f3d;}));_0x559b26['push'](_0x5b8698[_0x995b('0x119')]()[_0x995b('0x14')](function(_0x10008c){for(var _0x1ecb93=0x0;_0x1ecb93<_0x10008c[_0x995b('0x48')];_0x1ecb93++){_0x10008c[_0x1ecb93][_0x995b('0x112')](_0x995b('0x9e'),_0x995b('0x11a'));}return _0x10008c;}));return BPromise['all'](_0x559b26);})['then'](function(_0x29f5eb){var _0x46a67f=_['flatten'](_0x29f5eb);_0x559b26=[];return db[_0x995b('0x65')][_0x995b('0x11b')](function(_0x27491c){for(var _0x254966=0x0;_0x254966<_0x46a67f[_0x995b('0x48')];_0x254966++){_0x559b26[_0x995b('0x45')](_0x46a67f[_0x254966]['addAgent'](_0x4d699f['id']),{'transaction':_0x27491c});}return BPromise[_0x995b('0x4f')](_0x559b26)[_0x995b('0x14')](function(){if(_0x4d699f[_0x995b('0x9f')]){return BPromise[_0x995b('0xb0')](_[_0x995b('0x2b')](_0x46a67f,function(_0x1c7869){return _0x1c7869[_0x995b('0x11c')](_0x995b('0x9e'))===_0x995b('0x113');}),function(_0x1c91bb){return db[_0x995b('0xb1')][_0x995b('0xb2')]({'membername':_0x4d699f['name'],'UserId':_0x4d699f['id'],'queue_name':_0x1c91bb[_0x995b('0x32')],'VoiceQueueId':_0x1c91bb['id'],'interface':_[_0x995b('0x63')](_0x4d699f[_0x995b('0xa2')])?util['format']('SIP/%s',_0x4d699f[_0x995b('0x32')]):_0x4d699f[_0x995b('0xa2')],'paused':_0x4d699f[_0x995b('0xa1')]||![],'penalty':_0x4d699f[_0x995b('0xa8')]},{'transaction':_0x27491c});});}else{return;}})['then'](function(){for(var _0x3e2378=0x0;_0x3e2378<_0x46a67f[_0x995b('0x48')];_0x3e2378++){var _0x4641d8=_0x46a67f[_0x3e2378][_0x995b('0x11c')](_0x995b('0x9e'));var _0x5c9daf=_0x4641d8+_0x995b('0xaa');socket[_0x995b('0xab')](_0x995b('0x7d')+_0x4641d8+'Queue:save',{'UserId':_0x4d699f['id'],['queueField']:_0x46a67f[_0x3e2378]['id']});}});});})[_0x995b('0x14')](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x15be9a['id']}})['then'](function(_0x5a5d55){if(_0x5a5d55){db['UserVoicePrefix'][_0x995b('0x7c')]({'UserId':_0x455342[_0x995b('0x51')]['id'],'VoicePrefixId':_0x5a5d55[_0x995b('0x11d')]});}});});}});}})[_0x995b('0x14')](respondWithStatusCode(_0x3d685d,null))[_0x995b('0x1d')](handleError(_0x3d685d,null));};exports[_0x995b('0x11e')]=function(_0x4dccd8,_0x4bb6a2){return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x4dccd8['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x4bb6a2,null))['then'](function(_0x1fdf09){if(_0x1fdf09){var _0x40884b=_0x1fdf09['get']({'plain':!![]});var _0x2c86c0=_0x4dccd8['query'][_0x995b('0x5d')];return _0x1fdf09[_0x995b('0x11e')](_0x2c86c0)[_0x995b('0x14')](function(){for(var _0x35dee0=0x0;_0x35dee0<_0x2c86c0[_0x995b('0x48')];_0x35dee0++){var _0x4cbac5=[];var _0x5d0d72={};db[_0x995b('0x10f')]['findOne']({'where':{'id':_0x2c86c0[_0x35dee0]}})['then'](function(_0x50992d){_0x5d0d72=_0x50992d[_0x995b('0x4a')];_0x4cbac5[_0x995b('0x45')](_0x50992d[_0x995b('0x111')]()['then'](function(_0x5b0196){for(var _0x4a4548=0x0;_0x4a4548<_0x5b0196[_0x995b('0x48')];_0x4a4548++){_0x5b0196[_0x4a4548][_0x995b('0x112')](_0x995b('0x9e'),_0x995b('0x113'));}return _0x5b0196;}));_0x4cbac5['push'](_0x50992d['getChatQueues']()[_0x995b('0x14')](function(_0xe71519){for(var _0x5569a4=0x0;_0x5569a4<_0xe71519['length'];_0x5569a4++){_0xe71519[_0x5569a4]['setDataValue'](_0x995b('0x9e'),'Chat');}return _0xe71519;}));_0x4cbac5[_0x995b('0x45')](_0x50992d['getMailQueues']()['then'](function(_0x482242){for(var _0x26374d=0x0;_0x26374d<_0x482242[_0x995b('0x48')];_0x26374d++){_0x482242[_0x26374d][_0x995b('0x112')](_0x995b('0x9e'),_0x995b('0x115'));}return _0x482242;}));_0x4cbac5[_0x995b('0x45')](_0x50992d['getSmsQueues']()[_0x995b('0x14')](function(_0x59bd3c){for(var _0x81d894=0x0;_0x81d894<_0x59bd3c['length'];_0x81d894++){_0x59bd3c[_0x81d894][_0x995b('0x112')]('channel',_0x995b('0x116'));}return _0x59bd3c;}));_0x4cbac5['push'](_0x50992d[_0x995b('0x117')]()[_0x995b('0x14')](function(_0x13c075){for(var _0x23183f=0x0;_0x23183f<_0x13c075['length'];_0x23183f++){_0x13c075[_0x23183f][_0x995b('0x112')]('channel','Whatsapp');}return _0x13c075;}));_0x4cbac5[_0x995b('0x45')](_0x50992d[_0x995b('0x11f')]()['then'](function(_0x5caa87){for(var _0x3c607f=0x0;_0x3c607f<_0x5caa87['length'];_0x3c607f++){_0x5caa87[_0x3c607f]['setDataValue']('channel','Fax');}return _0x5caa87;}));_0x4cbac5[_0x995b('0x45')](_0x50992d[_0x995b('0x119')]()[_0x995b('0x14')](function(_0x26d5f4){for(var _0x1893a0=0x0;_0x1893a0<_0x26d5f4[_0x995b('0x48')];_0x1893a0++){_0x26d5f4[_0x1893a0][_0x995b('0x112')]('channel',_0x995b('0x11a'));}return _0x26d5f4;}));return BPromise[_0x995b('0x4f')](_0x4cbac5);})[_0x995b('0x14')](function(_0x5119ac){var _0x3046ac=_[_0x995b('0x120')](_0x5119ac);_0x4cbac5=[];return db[_0x995b('0x65')]['transaction'](function(_0x37746e){for(var _0x4fca65=0x0;_0x4fca65<_0x3046ac[_0x995b('0x48')];_0x4fca65++){_0x4cbac5[_0x995b('0x45')](_0x3046ac[_0x4fca65][_0x995b('0x121')](_0x40884b['id']),{'transaction':_0x37746e});}return BPromise[_0x995b('0x4f')](_0x4cbac5)[_0x995b('0x14')](function(){if(_0x40884b['online']){return BPromise[_0x995b('0xb0')](_[_0x995b('0x2b')](_0x3046ac,function(_0x251528){return _0x251528[_0x995b('0x11c')]('channel')===_0x995b('0x113');}),function(_0x297a59){return db['UserVoiceQueueRt'][_0x995b('0x25')]({'where':{'VoiceQueueId':_0x297a59['id'],'UserId':_0x40884b['id']},'transaction':_0x37746e});});}else{return;}})[_0x995b('0x14')](function(){db['TeamVoicePrefix'][_0x995b('0x97')]({'where':{'teamId':_0x5d0d72['id']}})['then'](function(_0x404cb7){if(_0x404cb7){return db[_0x995b('0x122')][_0x995b('0x25')]({'where':{'UserId':_0x40884b['id'],'VoicePrefixId':_0x404cb7[_0x995b('0x4a')]['VoicePrefixId']}});}});})[_0x995b('0x14')](function(){for(var _0xbc8e7a=0x0;_0xbc8e7a<_0x3046ac[_0x995b('0x48')];_0xbc8e7a++){var _0x54d15e=_0x3046ac[_0xbc8e7a][_0x995b('0x11c')](_0x995b('0x9e'));var _0xf2e1e1=_0x54d15e+_0x995b('0xaa');socket[_0x995b('0xab')]('user'+_0x54d15e+_0x995b('0xb5'),{'UserId':_0x40884b['id'],['queueField']:_0x3046ac[_0xbc8e7a]['id']});}});});});}});}})[_0x995b('0x14')](respondWithStatusCode(_0x4bb6a2,null))['catch'](handleError(_0x4bb6a2,null));};exports[_0x995b('0x123')]=function(_0x52dbdb,_0x916017){var _0x292027={};var _0xa9d9={};var _0x3f61da;var _0x4ece3b;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x52dbdb[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x916017,null))[_0x995b('0x14')](function(_0x40fb1f){if(_0x40fb1f){_0x3f61da=_0x40fb1f;_0xa9d9['model']=_[_0x995b('0x52')](db[_0x995b('0x124')][_0x995b('0x37')]);_0xa9d9[_0x995b('0x40')]=_[_0x995b('0x52')](_0x52dbdb['query']);_0xa9d9[_0x995b('0xcd')]=_[_0x995b('0x54')](_0xa9d9[_0x995b('0x53')],_0xa9d9[_0x995b('0x40')]);_0x292027[_0x995b('0x44')]=_[_0x995b('0x54')](_0xa9d9[_0x995b('0x53')],qs[_0x995b('0x55')](_0x52dbdb[_0x995b('0x40')][_0x995b('0x55')]));_0x292027[_0x995b('0x44')]=_0x292027[_0x995b('0x44')][_0x995b('0x48')]?_0x292027['attributes']:_0xa9d9['model'];_0x292027[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x52dbdb[_0x995b('0x40')][_0x995b('0xcf')]);_0x292027[_0x995b('0x3d')]=qs['filters'](_['pick'](_0x52dbdb['query'],_0xa9d9[_0x995b('0xcd')]));if(_0x52dbdb[_0x995b('0x40')][_0x995b('0x2b')]){_0x292027[_0x995b('0x3d')]=_['merge'](_0x292027[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x292027['attributes'],function(_0x3ac850){var _0x5a77e1={};_0x5a77e1[_0x3ac850]={'$like':'%'+_0x52dbdb[_0x995b('0x40')]['filter']+'%'};return _0x5a77e1;})});}_0x292027=_[_0x995b('0xd7')]({},_0x292027,_0x52dbdb[_0x995b('0x57')]);return _0x3f61da[_0x995b('0x123')](_0x292027);}})[_0x995b('0x14')](function(_0x4d936b){if(_0x4d936b){_0x4ece3b=_0x4d936b[_0x995b('0x48')];if(!_0x52dbdb[_0x995b('0x40')]['hasOwnProperty'](_0x995b('0xd4'))){_0x292027['limit']=qs['limit'](_0x52dbdb[_0x995b('0x40')][_0x995b('0x22')]);_0x292027[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x52dbdb[_0x995b('0x40')][_0x995b('0x21')]);}return _0x3f61da[_0x995b('0x123')](_0x292027);}})[_0x995b('0x14')](function(_0x1953eb){if(_0x1953eb){return _0x1953eb?{'count':_0x4ece3b,'rows':_0x1953eb}:null;}})[_0x995b('0x14')](respondWithResult(_0x916017,null))[_0x995b('0x1d')](handleError(_0x916017,null));};exports['getAgents']=function(_0xb5bc54,_0x4d8913){var _0xbfb71f={};var _0x4fd5b0={};var _0x1a1aae;return db[_0x995b('0x36')]['findOne']({'where':{'id':_0xb5bc54[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x4d8913,null))[_0x995b('0x14')](function(_0x48d407){if(_0x48d407){_0x1a1aae=_0x48d407;_0x4fd5b0[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0x36')][_0x995b('0x37')]);_0x4fd5b0[_0x995b('0x40')]=_[_0x995b('0x52')](_0xb5bc54[_0x995b('0x40')]);_0x4fd5b0[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x4fd5b0[_0x995b('0x53')],_0x4fd5b0[_0x995b('0x40')]);_0xbfb71f[_0x995b('0x44')]=_[_0x995b('0x54')](_0x4fd5b0[_0x995b('0x53')],qs[_0x995b('0x55')](_0xb5bc54['query'][_0x995b('0x55')]));_0xbfb71f[_0x995b('0x44')]=_0xbfb71f[_0x995b('0x44')][_0x995b('0x48')]?_0xbfb71f['attributes']:_0x4fd5b0[_0x995b('0x53')];_0xbfb71f['order']=qs[_0x995b('0xcf')](_0xb5bc54['query'][_0x995b('0xcf')]);_0xbfb71f[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0xb5bc54['query'],_0x4fd5b0[_0x995b('0xcd')]));if(_0xb5bc54[_0x995b('0x40')]['filter']){_0xbfb71f[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0xbfb71f[_0x995b('0x3d')],{'$or':_['map'](_0xbfb71f[_0x995b('0x44')],function(_0x75eb9c){var _0x322907={};_0x322907[_0x75eb9c]={'$like':'%'+_0xb5bc54[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x322907;})});}_0xbfb71f[_0x995b('0x53')]=db[_0x995b('0x36')];_0xbfb71f['as']=_0x995b('0x28');_0xbfb71f=_[_0x995b('0xd7')]({},_0xbfb71f,_0xb5bc54[_0x995b('0x57')]);return _0x1a1aae[_0x995b('0x111')]({'include':[_0xbfb71f]});}})['then'](function(_0x1d701d){if(_0x1d701d){var _0x5b4a35={},_0x5bb5c2=[];for(var _0x10c1a7=0x0;_0x10c1a7<_0x1d701d[_0x995b('0x48')];_0x10c1a7+=0x1){for(var _0x1e2b04=0x0,_0x2cd466;_0x1e2b04<_0x1d701d[_0x10c1a7][_0x995b('0x28')][_0x995b('0x48')];_0x1e2b04+=0x1){_0x2cd466=_0x1d701d[_0x10c1a7][_0x995b('0x28')][_0x1e2b04][_0x995b('0x26')]({'plain':!![]});_0x5b4a35[_0x2cd466['id']]=_0x2cd466;}}_0x5b4a35=_[_0x995b('0x125')](_0x5b4a35);for(var _0x389afe=qs['offset'](_0xb5bc54['query']['offset']);_0x389afe<_0x5b4a35[_0x995b('0x48')]&&_0x5bb5c2[_0x995b('0x48')]<qs[_0x995b('0x22')](_0xb5bc54[_0x995b('0x40')][_0x995b('0x22')]);_0x389afe+=0x1){if(_0x5b4a35[_0x389afe]){_0x5bb5c2[_0x995b('0x45')](_0x5b4a35[_0x389afe]);}}return{'count':_0x5b4a35[_0x995b('0x48')],'rows':_0x5bb5c2};}})[_0x995b('0x14')](respondWithResult(_0x4d8913,null))['catch'](handleError(_0x4d8913,null));};exports[_0x995b('0x25')]=function(_0x3f7f31,_0x35076a){if(_0x3f7f31[_0x995b('0x7d')]['id']==_0x3f7f31['params']['id']){return _0x35076a[_0x995b('0x1e')](0x1f4)[_0x995b('0x126')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x3f7f31[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x35076a,null))[_0x995b('0x14')](removeEntity(_0x35076a,null))[_0x995b('0x1d')](handleError(_0x35076a,null));};exports[_0x995b('0x127')]=function(_0x18fec7,_0xd7bdb8){return db[_0x995b('0x36')]['find']({'where':{'id':_0x18fec7[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0xd7bdb8,null))[_0x995b('0x14')](function(_0x1275b5){if(_0x1275b5){return _0x1275b5[_0x995b('0x127')](_0x18fec7[_0x995b('0x59')][_0x995b('0x5d')],_[_0x995b('0x5c')](_0x18fec7[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{})[_0x995b('0xa9')](function(){for(var _0x4b81aa=0x0;_0x4b81aa<_0x18fec7[_0x995b('0x59')]['ids']['length'];_0x4b81aa+=0x1){socket[_0x995b('0xab')](_0x995b('0x128'),{'ChatInteractionId':Number(_0x18fec7[_0x995b('0x59')][_0x995b('0x5d')][_0x4b81aa]),'UserId':Number(_0x18fec7['params']['id'])});}return _0x18fec7[_0x995b('0x59')][_0x995b('0x5d')];});}})[_0x995b('0x14')](respondWithResult(_0xd7bdb8,null))[_0x995b('0x1d')](handleError(_0xd7bdb8,null));};exports['removeChatInteractions']=function(_0x439709,_0x5ceddd){return db[_0x995b('0x36')]['find']({'where':{'id':_0x439709[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5ceddd,null))['then'](function(_0x1c2622){if(_0x1c2622){return _0x1c2622[_0x995b('0x129')](_0x439709[_0x995b('0x40')]['ids'])[_0x995b('0x14')](function(){if(_[_0x995b('0xb4')](_0x439709['query'][_0x995b('0x5d')])){for(var _0x3de406=0x0;_0x3de406<_0x439709[_0x995b('0x40')][_0x995b('0x5d')][_0x995b('0x48')];_0x3de406+=0x1){socket['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x439709['query']['ids'][_0x3de406]),'UserId':Number(_0x439709[_0x995b('0x51')]['id'])});}}else{socket[_0x995b('0xab')](_0x995b('0x12a'),{'ChatInteractionId':Number(_0x439709[_0x995b('0x40')][_0x995b('0x5d')]),'UserId':Number(_0x439709['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5ceddd,null))[_0x995b('0x1d')](handleError(_0x5ceddd,null));};exports['addMailInteractions']=function(_0x253dd3,_0x31be78){return db['User']['find']({'where':{'id':_0x253dd3[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x31be78,null))[_0x995b('0x14')](function(_0x3d2810){if(_0x3d2810){return _0x3d2810[_0x995b('0x12b')](_0x253dd3[_0x995b('0x59')][_0x995b('0x5d')],_['omit'](_0x253dd3[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{})['spread'](function(){for(var _0x3d0853=0x0;_0x3d0853<_0x253dd3['body'][_0x995b('0x5d')][_0x995b('0x48')];_0x3d0853+=0x1){socket[_0x995b('0xab')](_0x995b('0x12c'),{'MailInteractionId':Number(_0x253dd3[_0x995b('0x59')]['ids'][_0x3d0853]),'UserId':Number(_0x253dd3['params']['id'])});}return _0x253dd3[_0x995b('0x59')][_0x995b('0x5d')];});}})[_0x995b('0x14')](respondWithResult(_0x31be78,null))['catch'](handleError(_0x31be78,null));};exports[_0x995b('0x12d')]=function(_0x426837,_0x50e58){return db['User'][_0x995b('0x31')]({'where':{'id':_0x426837['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x50e58,null))[_0x995b('0x14')](function(_0x543e74){if(_0x543e74){return _0x543e74[_0x995b('0x12d')](_0x426837[_0x995b('0x40')]['ids'])[_0x995b('0x14')](function(){if(_[_0x995b('0xb4')](_0x426837['query'][_0x995b('0x5d')])){for(var _0x470387=0x0;_0x470387<_0x426837[_0x995b('0x40')]['ids'][_0x995b('0x48')];_0x470387+=0x1){socket['emit'](_0x995b('0x12e'),{'MailInteractionId':Number(_0x426837[_0x995b('0x40')][_0x995b('0x5d')][_0x470387]),'UserId':Number(_0x426837[_0x995b('0x51')]['id'])});}}else{socket[_0x995b('0xab')](_0x995b('0x12e'),{'MailInteractionId':Number(_0x426837[_0x995b('0x40')][_0x995b('0x5d')]),'UserId':Number(_0x426837[_0x995b('0x51')]['id'])});}});}})[_0x995b('0x14')](respondWithStatusCode(_0x50e58,null))[_0x995b('0x1d')](handleError(_0x50e58,null));};exports[_0x995b('0x12f')]=function(_0x3cde20,_0xb9f140){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x3cde20[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0xb9f140,null))[_0x995b('0x14')](function(_0x4435ea){if(_0x4435ea){return _0x4435ea[_0x995b('0x12f')](_0x3cde20[_0x995b('0x59')]['ids'],_[_0x995b('0x5c')](_0x3cde20[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{})[_0x995b('0xa9')](function(){for(var _0x207bbc=0x0;_0x207bbc<_0x3cde20[_0x995b('0x59')][_0x995b('0x5d')][_0x995b('0x48')];_0x207bbc+=0x1){socket['emit'](_0x995b('0x130'),{'FaxInteractionId':Number(_0x3cde20[_0x995b('0x59')]['ids'][_0x207bbc]),'UserId':Number(_0x3cde20[_0x995b('0x51')]['id'])});}return _0x3cde20[_0x995b('0x59')][_0x995b('0x5d')];});}})['then'](respondWithResult(_0xb9f140,null))[_0x995b('0x1d')](handleError(_0xb9f140,null));};exports[_0x995b('0x131')]=function(_0x4295ef,_0x168377){return db[_0x995b('0x36')]['find']({'where':{'id':_0x4295ef[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x168377,null))[_0x995b('0x14')](function(_0x3b2d81){if(_0x3b2d81){return _0x3b2d81['removeFaxInteractions'](_0x4295ef[_0x995b('0x40')][_0x995b('0x5d')])['then'](function(){if(_[_0x995b('0xb4')](_0x4295ef['query'][_0x995b('0x5d')])){for(var _0xaa2dca=0x0;_0xaa2dca<_0x4295ef[_0x995b('0x40')][_0x995b('0x5d')][_0x995b('0x48')];_0xaa2dca+=0x1){socket[_0x995b('0xab')](_0x995b('0x132'),{'FaxInteractionId':Number(_0x4295ef[_0x995b('0x40')][_0x995b('0x5d')][_0xaa2dca]),'UserId':Number(_0x4295ef[_0x995b('0x51')]['id'])});}}else{socket[_0x995b('0xab')](_0x995b('0x132'),{'FaxInteractionId':Number(_0x4295ef[_0x995b('0x40')][_0x995b('0x5d')]),'UserId':Number(_0x4295ef[_0x995b('0x51')]['id'])});}});}})[_0x995b('0x14')](respondWithStatusCode(_0x168377,null))[_0x995b('0x1d')](handleError(_0x168377,null));};exports['addSmsInteractions']=function(_0x4ae549,_0x4e008e){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x4ae549[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x4e008e,null))[_0x995b('0x14')](function(_0x200cb5){if(_0x200cb5){return _0x200cb5['addSmsInteractions'](_0x4ae549['body'][_0x995b('0x5d')],_[_0x995b('0x5c')](_0x4ae549['body'],[_0x995b('0x5d'),'id'])||{})[_0x995b('0xa9')](function(){for(var _0x44a791=0x0;_0x44a791<_0x4ae549[_0x995b('0x59')]['ids'][_0x995b('0x48')];_0x44a791+=0x1){socket[_0x995b('0xab')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x4ae549[_0x995b('0x59')][_0x995b('0x5d')][_0x44a791]),'UserId':Number(_0x4ae549[_0x995b('0x51')]['id'])});}return _0x4ae549[_0x995b('0x59')]['ids'];});}})[_0x995b('0x14')](respondWithResult(_0x4e008e,null))[_0x995b('0x1d')](handleError(_0x4e008e,null));};exports[_0x995b('0x133')]=function(_0x4ba217,_0xc6931a){return db[_0x995b('0x36')]['find']({'where':{'id':_0x4ba217[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0xc6931a,null))['then'](function(_0x56d8ab){if(_0x56d8ab){return _0x56d8ab[_0x995b('0x133')](_0x4ba217['query'][_0x995b('0x5d')])[_0x995b('0x14')](function(){if(_[_0x995b('0xb4')](_0x4ba217['query']['ids'])){for(var _0x1b0f26=0x0;_0x1b0f26<_0x4ba217[_0x995b('0x40')][_0x995b('0x5d')][_0x995b('0x48')];_0x1b0f26+=0x1){socket[_0x995b('0xab')](_0x995b('0x134'),{'SmsInteractionId':Number(_0x4ba217['query'][_0x995b('0x5d')][_0x1b0f26]),'UserId':Number(_0x4ba217['params']['id'])});}}else{socket[_0x995b('0xab')](_0x995b('0x134'),{'SmsInteractionId':Number(_0x4ba217['query']['ids']),'UserId':Number(_0x4ba217[_0x995b('0x51')]['id'])});}});}})[_0x995b('0x14')](respondWithStatusCode(_0xc6931a,null))[_0x995b('0x1d')](handleError(_0xc6931a,null));};exports['addOpenchannelInteractions']=function(_0x243e24,_0x5778eb){return db['User'][_0x995b('0x31')]({'where':{'id':_0x243e24['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x5778eb,null))[_0x995b('0x14')](function(_0x4b0ed7){if(_0x4b0ed7){return _0x4b0ed7['addOpenchannelInteractions'](_0x243e24['body']['ids'],_[_0x995b('0x5c')](_0x243e24[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{})[_0x995b('0xa9')](function(){for(var _0x379cbc=0x0;_0x379cbc<_0x243e24[_0x995b('0x59')]['ids'][_0x995b('0x48')];_0x379cbc+=0x1){socket[_0x995b('0xab')](_0x995b('0x135'),{'OpenchannelInteractionId':Number(_0x243e24[_0x995b('0x59')][_0x995b('0x5d')][_0x379cbc]),'UserId':Number(_0x243e24[_0x995b('0x51')]['id'])});}return _0x243e24['body']['ids'];});}})[_0x995b('0x14')](respondWithResult(_0x5778eb,null))[_0x995b('0x1d')](handleError(_0x5778eb,null));};exports[_0x995b('0x136')]=function(_0x50b7ee,_0x430505){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x50b7ee['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x430505,null))[_0x995b('0x14')](function(_0xb13dfb){if(_0xb13dfb){return _0xb13dfb[_0x995b('0x136')](_0x50b7ee['query']['ids'])[_0x995b('0x14')](function(){if(_[_0x995b('0xb4')](_0x50b7ee[_0x995b('0x40')][_0x995b('0x5d')])){for(var _0x25f3c4=0x0;_0x25f3c4<_0x50b7ee[_0x995b('0x40')][_0x995b('0x5d')]['length'];_0x25f3c4+=0x1){socket[_0x995b('0xab')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x50b7ee[_0x995b('0x40')][_0x995b('0x5d')][_0x25f3c4]),'UserId':Number(_0x50b7ee['params']['id'])});}}else{socket['emit'](_0x995b('0x137'),{'OpenchannelInteractionId':Number(_0x50b7ee[_0x995b('0x40')][_0x995b('0x5d')]),'UserId':Number(_0x50b7ee[_0x995b('0x51')]['id'])});}});}})[_0x995b('0x14')](respondWithStatusCode(_0x430505,null))[_0x995b('0x1d')](handleError(_0x430505,null));};exports[_0x995b('0x138')]=function(_0xd1cce9,_0x28fb5d){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0xd1cce9[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x28fb5d,null))[_0x995b('0x14')](function(_0x1ec436){if(_0x1ec436){return _0x1ec436['addWhatsappInteractions'](_0xd1cce9[_0x995b('0x59')][_0x995b('0x5d')],_['omit'](_0xd1cce9[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{})[_0x995b('0xa9')](function(){for(var _0xd7466e=0x0;_0xd7466e<_0xd1cce9[_0x995b('0x59')][_0x995b('0x5d')]['length'];_0xd7466e+=0x1){socket['emit'](_0x995b('0x139'),{'WhatsappInteractionId':Number(_0xd1cce9[_0x995b('0x59')][_0x995b('0x5d')][_0xd7466e]),'UserId':Number(_0xd1cce9[_0x995b('0x51')]['id'])});}return _0xd1cce9[_0x995b('0x59')]['ids'];});}})[_0x995b('0x14')](respondWithResult(_0x28fb5d,null))[_0x995b('0x1d')](handleError(_0x28fb5d,null));};exports['removeWhatsappInteractions']=function(_0x3e64c7,_0x5f2cfe){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x3e64c7[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x5f2cfe,null))['then'](function(_0x1e80a0){if(_0x1e80a0){return _0x1e80a0[_0x995b('0x13a')](_0x3e64c7[_0x995b('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x5f2cfe,null))[_0x995b('0x1d')](handleError(_0x5f2cfe,null));};exports[_0x995b('0x13b')]=function(_0x2e8d77,_0x419c38){var _0x111a72={};var _0x1b9d51={};var _0x15b051;var _0x546acd;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x2e8d77[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x419c38,null))[_0x995b('0x14')](function(_0x1b6796){if(_0x1b6796){_0x15b051=_0x1b6796;_0x1b9d51['model']=_[_0x995b('0x52')](db[_0x995b('0x13c')][_0x995b('0x37')]);_0x1b9d51['query']=_[_0x995b('0x52')](_0x2e8d77[_0x995b('0x40')]);_0x1b9d51['filters']=_['intersection'](_0x1b9d51['model'],_0x1b9d51[_0x995b('0x40')]);_0x111a72[_0x995b('0x44')]=_['intersection'](_0x1b9d51['model'],qs['fields'](_0x2e8d77[_0x995b('0x40')]['fields']));_0x111a72['attributes']=_0x111a72[_0x995b('0x44')]['length']?_0x111a72[_0x995b('0x44')]:_0x1b9d51[_0x995b('0x53')];_0x111a72[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x2e8d77[_0x995b('0x40')][_0x995b('0xcf')]);_0x111a72[_0x995b('0x3d')]=qs['filters'](_[_0x995b('0xd0')](_0x2e8d77[_0x995b('0x40')],_0x1b9d51[_0x995b('0xcd')]));if(_0x2e8d77[_0x995b('0x40')][_0x995b('0x2b')]){_0x111a72[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x111a72[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x111a72[_0x995b('0x44')],function(_0x344430){var _0x1e3333={};_0x1e3333[_0x344430]={'$like':'%'+_0x2e8d77['query']['filter']+'%'};return _0x1e3333;})});}_0x111a72=_[_0x995b('0xd7')]({},_0x111a72,_0x2e8d77[_0x995b('0x57')]);return _0x15b051[_0x995b('0x13b')](_0x111a72);}})[_0x995b('0x14')](function(_0x122e85){if(_0x122e85){_0x546acd=_0x122e85[_0x995b('0x48')];if(!_0x2e8d77[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x111a72['limit']=qs[_0x995b('0x22')](_0x2e8d77[_0x995b('0x40')][_0x995b('0x22')]);_0x111a72[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x2e8d77[_0x995b('0x40')][_0x995b('0x21')]);}return _0x15b051[_0x995b('0x13b')](_0x111a72);}})[_0x995b('0x14')](function(_0x20cb4f){if(_0x20cb4f){return _0x20cb4f?{'count':_0x546acd,'rows':_0x20cb4f}:null;}})[_0x995b('0x14')](respondWithResult(_0x419c38,null))['catch'](handleError(_0x419c38,null));};exports['getFaxAccounts']=function(_0x3b5d35,_0xb5d83f){var _0x2a0bfd={};var _0x520b2b={};var _0x2338f7;var _0x22617b;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x3b5d35['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0xb5d83f,null))[_0x995b('0x14')](function(_0x2edd81){if(_0x2edd81){_0x2338f7=_0x2edd81;_0x520b2b[_0x995b('0x53')]=_[_0x995b('0x52')](db['FaxAccount'][_0x995b('0x37')]);_0x520b2b[_0x995b('0x40')]=_[_0x995b('0x52')](_0x3b5d35[_0x995b('0x40')]);_0x520b2b[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x520b2b[_0x995b('0x53')],_0x520b2b['query']);_0x2a0bfd['attributes']=_[_0x995b('0x54')](_0x520b2b[_0x995b('0x53')],qs[_0x995b('0x55')](_0x3b5d35[_0x995b('0x40')][_0x995b('0x55')]));_0x2a0bfd[_0x995b('0x44')]=_0x2a0bfd['attributes'][_0x995b('0x48')]?_0x2a0bfd['attributes']:_0x520b2b[_0x995b('0x53')];_0x2a0bfd[_0x995b('0xce')]=qs['sort'](_0x3b5d35[_0x995b('0x40')]['sort']);_0x2a0bfd[_0x995b('0x3d')]=qs['filters'](_[_0x995b('0xd0')](_0x3b5d35[_0x995b('0x40')],_0x520b2b[_0x995b('0xcd')]));if(_0x3b5d35[_0x995b('0x40')]['filter']){_0x2a0bfd[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x2a0bfd[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x2a0bfd[_0x995b('0x44')],function(_0x515153){var _0x5dff28={};_0x5dff28[_0x515153]={'$like':'%'+_0x3b5d35['query'][_0x995b('0x2b')]+'%'};return _0x5dff28;})});}_0x2a0bfd=_[_0x995b('0xd7')]({},_0x2a0bfd,_0x3b5d35['options']);return _0x2338f7[_0x995b('0x13d')](_0x2a0bfd);}})['then'](function(_0x5a04e7){if(_0x5a04e7){_0x22617b=_0x5a04e7['length'];if(!_0x3b5d35['query'][_0x995b('0xd1')]('nolimit')){_0x2a0bfd[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x3b5d35[_0x995b('0x40')][_0x995b('0x22')]);_0x2a0bfd[_0x995b('0x21')]=qs['offset'](_0x3b5d35[_0x995b('0x40')][_0x995b('0x21')]);}return _0x2338f7[_0x995b('0x13d')](_0x2a0bfd);}})[_0x995b('0x14')](function(_0x455107){if(_0x455107){return _0x455107?{'count':_0x22617b,'rows':_0x455107}:null;}})[_0x995b('0x14')](respondWithResult(_0xb5d83f,null))['catch'](handleError(_0xb5d83f,null));};exports[_0x995b('0x13e')]=function(_0x4f56d4,_0x29d1fe){return db['User'][_0x995b('0x31')]({'where':{'id':_0x4f56d4[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x29d1fe,null))['then'](function(_0x26d379){if(_0x26d379){return _0x26d379['addFaxAccounts'](_0x4f56d4['body']['ids'],_['omit'](_0x4f56d4['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x29d1fe,null))['catch'](handleError(_0x29d1fe,null));};exports[_0x995b('0x13f')]=function(_0x526ce6,_0x5e9f33){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x526ce6[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x5e9f33,null))[_0x995b('0x14')](function(_0x53c891){if(_0x53c891){return _0x53c891[_0x995b('0x13f')](_0x526ce6[_0x995b('0x40')][_0x995b('0x5d')]);}})[_0x995b('0x14')](respondWithStatusCode(_0x5e9f33,null))['catch'](handleError(_0x5e9f33,null));};exports['getMailAccounts']=function(_0x22384d,_0x3603c7){var _0x10f54e={};var _0x5f025b={};var _0x597184;var _0x1d0c22;return db['User'][_0x995b('0x97')]({'where':{'id':_0x22384d[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x3603c7,null))[_0x995b('0x14')](function(_0x45364f){if(_0x45364f){_0x597184=_0x45364f;_0x5f025b['model']=_[_0x995b('0x52')](db[_0x995b('0x140')][_0x995b('0x37')]);_0x5f025b[_0x995b('0x40')]=_[_0x995b('0x52')](_0x22384d['query']);_0x5f025b['filters']=_[_0x995b('0x54')](_0x5f025b['model'],_0x5f025b['query']);_0x10f54e[_0x995b('0x44')]=_[_0x995b('0x54')](_0x5f025b[_0x995b('0x53')],qs['fields'](_0x22384d[_0x995b('0x40')]['fields']));_0x10f54e[_0x995b('0x44')]=_0x10f54e[_0x995b('0x44')]['length']?_0x10f54e[_0x995b('0x44')]:_0x5f025b[_0x995b('0x53')];_0x10f54e[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x22384d[_0x995b('0x40')]['sort']);_0x10f54e['where']=qs[_0x995b('0xcd')](_['pick'](_0x22384d[_0x995b('0x40')],_0x5f025b['filters']));if(_0x22384d[_0x995b('0x40')][_0x995b('0x2b')]){_0x10f54e['where']=_[_0x995b('0xd7')](_0x10f54e[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x10f54e[_0x995b('0x44')],function(_0x504a2b){var _0x3fe35c={};_0x3fe35c[_0x504a2b]={'$like':'%'+_0x22384d[_0x995b('0x40')]['filter']+'%'};return _0x3fe35c;})});}_0x10f54e=_[_0x995b('0xd7')]({},_0x10f54e,_0x22384d['options']);return _0x597184[_0x995b('0x141')](_0x10f54e);}})[_0x995b('0x14')](function(_0x2e84aa){if(_0x2e84aa){_0x1d0c22=_0x2e84aa[_0x995b('0x48')];if(!_0x22384d[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x10f54e['limit']=qs['limit'](_0x22384d[_0x995b('0x40')][_0x995b('0x22')]);_0x10f54e['offset']=qs[_0x995b('0x21')](_0x22384d[_0x995b('0x40')][_0x995b('0x21')]);}return _0x597184[_0x995b('0x141')](_0x10f54e);}})[_0x995b('0x14')](function(_0x4f6cd4){if(_0x4f6cd4){return _0x4f6cd4?{'count':_0x1d0c22,'rows':_0x4f6cd4}:null;}})[_0x995b('0x14')](respondWithResult(_0x3603c7,null))[_0x995b('0x1d')](handleError(_0x3603c7,null));};exports[_0x995b('0x142')]=function(_0x20f669,_0x760639){return db[_0x995b('0x36')]['find']({'where':{'id':_0x20f669[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x760639,null))[_0x995b('0x14')](function(_0x459af6){if(_0x459af6){return _0x459af6['addMailAccounts'](_0x20f669[_0x995b('0x59')]['ids'],_['omit'](_0x20f669[_0x995b('0x59')],['ids','id'])||{});}})[_0x995b('0x14')](respondWithResult(_0x760639,null))[_0x995b('0x1d')](handleError(_0x760639,null));};exports[_0x995b('0x143')]=function(_0x2b446d,_0x4c40c2){return db[_0x995b('0x36')]['find']({'where':{'id':_0x2b446d[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x4c40c2,null))[_0x995b('0x14')](function(_0x2e2b19){if(_0x2e2b19){return _0x2e2b19['removeMailAccounts'](_0x2b446d[_0x995b('0x40')][_0x995b('0x5d')]);}})[_0x995b('0x14')](respondWithStatusCode(_0x4c40c2,null))[_0x995b('0x1d')](handleError(_0x4c40c2,null));};exports['getOpenchannelAccounts']=function(_0x4bffd5,_0x1d62e6){var _0x5955aa={};var _0x5f1a1d={};var _0x4b52d5;var _0x486167;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x4bffd5[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x1d62e6,null))[_0x995b('0x14')](function(_0x1dd8f7){if(_0x1dd8f7){_0x4b52d5=_0x1dd8f7;_0x5f1a1d['model']=_[_0x995b('0x52')](db[_0x995b('0x144')]['rawAttributes']);_0x5f1a1d[_0x995b('0x40')]=_[_0x995b('0x52')](_0x4bffd5[_0x995b('0x40')]);_0x5f1a1d[_0x995b('0xcd')]=_['intersection'](_0x5f1a1d['model'],_0x5f1a1d[_0x995b('0x40')]);_0x5955aa['attributes']=_[_0x995b('0x54')](_0x5f1a1d[_0x995b('0x53')],qs[_0x995b('0x55')](_0x4bffd5['query'][_0x995b('0x55')]));_0x5955aa[_0x995b('0x44')]=_0x5955aa[_0x995b('0x44')][_0x995b('0x48')]?_0x5955aa[_0x995b('0x44')]:_0x5f1a1d[_0x995b('0x53')];_0x5955aa[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x4bffd5[_0x995b('0x40')][_0x995b('0xcf')]);_0x5955aa[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x4bffd5[_0x995b('0x40')],_0x5f1a1d[_0x995b('0xcd')]));if(_0x4bffd5[_0x995b('0x40')][_0x995b('0x2b')]){_0x5955aa[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x5955aa[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x5955aa[_0x995b('0x44')],function(_0x1515e3){var _0x48311b={};_0x48311b[_0x1515e3]={'$like':'%'+_0x4bffd5[_0x995b('0x40')]['filter']+'%'};return _0x48311b;})});}_0x5955aa=_[_0x995b('0xd7')]({},_0x5955aa,_0x4bffd5[_0x995b('0x57')]);return _0x4b52d5[_0x995b('0x145')](_0x5955aa);}})['then'](function(_0x4f8a24){if(_0x4f8a24){_0x486167=_0x4f8a24[_0x995b('0x48')];if(!_0x4bffd5['query'][_0x995b('0xd1')]('nolimit')){_0x5955aa[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x4bffd5[_0x995b('0x40')][_0x995b('0x22')]);_0x5955aa['offset']=qs['offset'](_0x4bffd5[_0x995b('0x40')][_0x995b('0x21')]);}return _0x4b52d5[_0x995b('0x145')](_0x5955aa);}})[_0x995b('0x14')](function(_0x9d4bdc){if(_0x9d4bdc){return _0x9d4bdc?{'count':_0x486167,'rows':_0x9d4bdc}:null;}})[_0x995b('0x14')](respondWithResult(_0x1d62e6,null))[_0x995b('0x1d')](handleError(_0x1d62e6,null));};exports[_0x995b('0x146')]=function(_0x3e357d,_0x4c2652){return db[_0x995b('0x36')]['find']({'where':{'id':_0x3e357d['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x4c2652,null))[_0x995b('0x14')](function(_0x35d9da){if(_0x35d9da){return _0x35d9da[_0x995b('0x146')](_0x3e357d[_0x995b('0x59')][_0x995b('0x5d')],_[_0x995b('0x5c')](_0x3e357d[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x4c2652,null))[_0x995b('0x1d')](handleError(_0x4c2652,null));};exports[_0x995b('0x147')]=function(_0x50fc3d,_0x4c3946){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x50fc3d[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x4c3946,null))['then'](function(_0x5ea861){if(_0x5ea861){return _0x5ea861[_0x995b('0x147')](_0x50fc3d[_0x995b('0x40')][_0x995b('0x5d')]);}})['then'](respondWithStatusCode(_0x4c3946,null))['catch'](handleError(_0x4c3946,null));};exports[_0x995b('0x148')]=function(_0x274847,_0x32accc){var _0x577ca5={};var _0x338f45={};var _0x54fcaa;var _0x22d8b8;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x274847[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x32accc,null))[_0x995b('0x14')](function(_0x5bb128){if(_0x5bb128){_0x54fcaa=_0x5bb128;_0x338f45[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0x149')]['rawAttributes']);_0x338f45[_0x995b('0x40')]=_[_0x995b('0x52')](_0x274847['query']);_0x338f45['filters']=_[_0x995b('0x54')](_0x338f45[_0x995b('0x53')],_0x338f45['query']);_0x577ca5[_0x995b('0x44')]=_[_0x995b('0x54')](_0x338f45['model'],qs[_0x995b('0x55')](_0x274847['query'][_0x995b('0x55')]));_0x577ca5[_0x995b('0x44')]=_0x577ca5[_0x995b('0x44')][_0x995b('0x48')]?_0x577ca5['attributes']:_0x338f45[_0x995b('0x53')];_0x577ca5[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x274847[_0x995b('0x40')]['sort']);_0x577ca5[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_['pick'](_0x274847['query'],_0x338f45[_0x995b('0xcd')]));if(_0x274847[_0x995b('0x40')]['filter']){_0x577ca5[_0x995b('0x3d')]=_['merge'](_0x577ca5[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x577ca5[_0x995b('0x44')],function(_0x5cbc36){var _0x375907={};_0x375907[_0x5cbc36]={'$like':'%'+_0x274847[_0x995b('0x40')]['filter']+'%'};return _0x375907;})});}_0x577ca5=_[_0x995b('0xd7')]({},_0x577ca5,_0x274847['options']);return _0x54fcaa['getSmsAccounts'](_0x577ca5);}})[_0x995b('0x14')](function(_0x116917){if(_0x116917){_0x22d8b8=_0x116917[_0x995b('0x48')];if(!_0x274847[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x577ca5[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x274847[_0x995b('0x40')][_0x995b('0x22')]);_0x577ca5['offset']=qs[_0x995b('0x21')](_0x274847['query'][_0x995b('0x21')]);}return _0x54fcaa['getSmsAccounts'](_0x577ca5);}})[_0x995b('0x14')](function(_0x4d28f5){if(_0x4d28f5){return _0x4d28f5?{'count':_0x22d8b8,'rows':_0x4d28f5}:null;}})[_0x995b('0x14')](respondWithResult(_0x32accc,null))['catch'](handleError(_0x32accc,null));};exports[_0x995b('0x14a')]=function(_0x4ae407,_0x1df601){return db['User'][_0x995b('0x31')]({'where':{'id':_0x4ae407['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x1df601,null))['then'](function(_0x3f8087){if(_0x3f8087){return _0x3f8087[_0x995b('0x14a')](_0x4ae407[_0x995b('0x59')][_0x995b('0x5d')],_[_0x995b('0x5c')](_0x4ae407[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{});}})[_0x995b('0x14')](respondWithResult(_0x1df601,null))[_0x995b('0x1d')](handleError(_0x1df601,null));};exports[_0x995b('0x14b')]=function(_0x252bed,_0x3eb20e){return db[_0x995b('0x36')]['find']({'where':{'id':_0x252bed['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x3eb20e,null))[_0x995b('0x14')](function(_0x107c99){if(_0x107c99){return _0x107c99[_0x995b('0x14b')](_0x252bed[_0x995b('0x40')][_0x995b('0x5d')]);}})[_0x995b('0x14')](respondWithStatusCode(_0x3eb20e,null))[_0x995b('0x1d')](handleError(_0x3eb20e,null));};exports['getChatWebsites']=function(_0x373610,_0xba094a){var _0x55dbf0={};var _0x2a2318={};var _0x36e0b9;var _0x25efbc;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x373610['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0xba094a,null))[_0x995b('0x14')](function(_0x4e57c3){if(_0x4e57c3){_0x36e0b9=_0x4e57c3;_0x2a2318['model']=_['keys'](db[_0x995b('0x14c')][_0x995b('0x37')]);_0x2a2318[_0x995b('0x40')]=_['keys'](_0x373610[_0x995b('0x40')]);_0x2a2318[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x2a2318['model'],_0x2a2318['query']);_0x55dbf0[_0x995b('0x44')]=_[_0x995b('0x54')](_0x2a2318[_0x995b('0x53')],qs['fields'](_0x373610[_0x995b('0x40')][_0x995b('0x55')]));_0x55dbf0['attributes']=_0x55dbf0[_0x995b('0x44')]['length']?_0x55dbf0[_0x995b('0x44')]:_0x2a2318[_0x995b('0x53')];_0x55dbf0[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x373610[_0x995b('0x40')][_0x995b('0xcf')]);_0x55dbf0[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_['pick'](_0x373610[_0x995b('0x40')],_0x2a2318[_0x995b('0xcd')]));if(_0x373610[_0x995b('0x40')][_0x995b('0x2b')]){_0x55dbf0[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x55dbf0[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x55dbf0[_0x995b('0x44')],function(_0x2c2546){var _0x2d52d1={};_0x2d52d1[_0x2c2546]={'$like':'%'+_0x373610[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x2d52d1;})});}_0x55dbf0=_[_0x995b('0xd7')]({},_0x55dbf0,_0x373610['options']);return _0x36e0b9[_0x995b('0x14d')](_0x55dbf0);}})[_0x995b('0x14')](function(_0x3eb9ed){if(_0x3eb9ed){_0x25efbc=_0x3eb9ed['length'];if(!_0x373610[_0x995b('0x40')][_0x995b('0xd1')]('nolimit')){_0x55dbf0['limit']=qs[_0x995b('0x22')](_0x373610['query'][_0x995b('0x22')]);_0x55dbf0[_0x995b('0x21')]=qs['offset'](_0x373610[_0x995b('0x40')][_0x995b('0x21')]);}return _0x36e0b9['getChatWebsites'](_0x55dbf0);}})[_0x995b('0x14')](function(_0x3d4777){if(_0x3d4777){return _0x3d4777?{'count':_0x25efbc,'rows':_0x3d4777}:null;}})[_0x995b('0x14')](respondWithResult(_0xba094a,null))['catch'](handleError(_0xba094a,null));};exports[_0x995b('0x14e')]=function(_0x1f3748,_0x39fa37){return db[_0x995b('0x36')]['find']({'where':{'id':_0x1f3748['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x39fa37,null))[_0x995b('0x14')](function(_0x3755bd){if(_0x3755bd){return _0x3755bd['addChatWebsites'](_0x1f3748[_0x995b('0x59')][_0x995b('0x5d')],_['omit'](_0x1f3748[_0x995b('0x59')],['ids','id'])||{});}})[_0x995b('0x14')](respondWithResult(_0x39fa37,null))['catch'](handleError(_0x39fa37,null));};exports[_0x995b('0x14f')]=function(_0x279db4,_0x251748){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x279db4['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x251748,null))[_0x995b('0x14')](function(_0x50c15d){if(_0x50c15d){return _0x50c15d['removeChatWebsites'](_0x279db4[_0x995b('0x40')][_0x995b('0x5d')]);}})[_0x995b('0x14')](respondWithStatusCode(_0x251748,null))[_0x995b('0x1d')](handleError(_0x251748,null));};exports['getWhatsappAccounts']=function(_0x583e06,_0x345390){var _0x5eaed5={};var _0x469c99={};var _0x1075a6;var _0x3e98b6;return db[_0x995b('0x36')][_0x995b('0x97')]({'where':{'id':_0x583e06[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x345390,null))['then'](function(_0x473a20){if(_0x473a20){_0x1075a6=_0x473a20;_0x469c99[_0x995b('0x53')]=_[_0x995b('0x52')](db[_0x995b('0x150')][_0x995b('0x37')]);_0x469c99[_0x995b('0x40')]=_['keys'](_0x583e06[_0x995b('0x40')]);_0x469c99[_0x995b('0xcd')]=_['intersection'](_0x469c99[_0x995b('0x53')],_0x469c99['query']);_0x5eaed5['attributes']=_[_0x995b('0x54')](_0x469c99[_0x995b('0x53')],qs[_0x995b('0x55')](_0x583e06[_0x995b('0x40')][_0x995b('0x55')]));_0x5eaed5[_0x995b('0x44')]=_0x5eaed5['attributes'][_0x995b('0x48')]?_0x5eaed5[_0x995b('0x44')]:_0x469c99['model'];_0x5eaed5[_0x995b('0xce')]=qs['sort'](_0x583e06[_0x995b('0x40')][_0x995b('0xcf')]);_0x5eaed5[_0x995b('0x3d')]=qs['filters'](_['pick'](_0x583e06[_0x995b('0x40')],_0x469c99[_0x995b('0xcd')]));if(_0x583e06[_0x995b('0x40')][_0x995b('0x2b')]){_0x5eaed5['where']=_[_0x995b('0xd7')](_0x5eaed5['where'],{'$or':_[_0x995b('0x2d')](_0x5eaed5[_0x995b('0x44')],function(_0x4e8007){var _0x2e5dc0={};_0x2e5dc0[_0x4e8007]={'$like':'%'+_0x583e06[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x2e5dc0;})});}_0x5eaed5=_[_0x995b('0xd7')]({},_0x5eaed5,_0x583e06['options']);return _0x1075a6[_0x995b('0x151')](_0x5eaed5);}})[_0x995b('0x14')](function(_0x97afaa){if(_0x97afaa){_0x3e98b6=_0x97afaa['length'];if(!_0x583e06[_0x995b('0x40')][_0x995b('0xd1')]('nolimit')){_0x5eaed5['limit']=qs[_0x995b('0x22')](_0x583e06[_0x995b('0x40')]['limit']);_0x5eaed5['offset']=qs[_0x995b('0x21')](_0x583e06[_0x995b('0x40')]['offset']);}return _0x1075a6[_0x995b('0x151')](_0x5eaed5);}})[_0x995b('0x14')](function(_0x2fdf23){if(_0x2fdf23){return _0x2fdf23?{'count':_0x3e98b6,'rows':_0x2fdf23}:null;}})[_0x995b('0x14')](respondWithResult(_0x345390,null))[_0x995b('0x1d')](handleError(_0x345390,null));};exports[_0x995b('0x152')]=function(_0x5ee2c6,_0x351e51){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x5ee2c6[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x351e51,null))[_0x995b('0x14')](function(_0x18ef94){if(_0x18ef94){return _0x18ef94[_0x995b('0x152')](_0x5ee2c6['body'][_0x995b('0x5d')],_[_0x995b('0x5c')](_0x5ee2c6[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x351e51,null))[_0x995b('0x1d')](handleError(_0x351e51,null));};exports[_0x995b('0x153')]=function(_0x40a613,_0x35c79b){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x40a613['params']['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x35c79b,null))[_0x995b('0x14')](function(_0x2c546f){if(_0x2c546f){return _0x2c546f[_0x995b('0x153')](_0x40a613[_0x995b('0x40')]['ids']);}})[_0x995b('0x14')](respondWithStatusCode(_0x35c79b,null))['catch'](handleError(_0x35c79b,null));};exports['getSquareProjects']=function(_0x5e6709,_0x39beb0){var _0x1bfd73={};var _0x4d8b2f={};var _0x56ad9c;var _0x58e174;return db['User'][_0x995b('0x97')]({'where':{'id':_0x5e6709[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x39beb0,null))[_0x995b('0x14')](function(_0x455512){if(_0x455512){_0x56ad9c=_0x455512;_0x4d8b2f[_0x995b('0x53')]=_[_0x995b('0x52')](db['SquareProject'][_0x995b('0x37')]);_0x4d8b2f[_0x995b('0x40')]=_[_0x995b('0x52')](_0x5e6709[_0x995b('0x40')]);_0x4d8b2f[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x4d8b2f['model'],_0x4d8b2f[_0x995b('0x40')]);_0x1bfd73[_0x995b('0x44')]=_['intersection'](_0x4d8b2f[_0x995b('0x53')],qs[_0x995b('0x55')](_0x5e6709[_0x995b('0x40')][_0x995b('0x55')]));_0x1bfd73[_0x995b('0x44')]=_0x1bfd73[_0x995b('0x44')][_0x995b('0x48')]?_0x1bfd73[_0x995b('0x44')]:_0x4d8b2f['model'];_0x1bfd73[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x5e6709[_0x995b('0x40')][_0x995b('0xcf')]);_0x1bfd73[_0x995b('0x3d')]=qs[_0x995b('0xcd')](_[_0x995b('0xd0')](_0x5e6709[_0x995b('0x40')],_0x4d8b2f[_0x995b('0xcd')]));if(_0x5e6709['query']['filter']){_0x1bfd73[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x1bfd73[_0x995b('0x3d')],{'$or':_[_0x995b('0x2d')](_0x1bfd73[_0x995b('0x44')],function(_0x3a75f2){var _0x405053={};_0x405053[_0x3a75f2]={'$like':'%'+_0x5e6709[_0x995b('0x40')][_0x995b('0x2b')]+'%'};return _0x405053;})});}_0x1bfd73=_[_0x995b('0xd7')]({},_0x1bfd73,_0x5e6709[_0x995b('0x57')]);return _0x56ad9c[_0x995b('0x154')](_0x1bfd73);}})['then'](function(_0x4965ee){if(_0x4965ee){_0x58e174=_0x4965ee[_0x995b('0x48')];if(!_0x5e6709[_0x995b('0x40')][_0x995b('0xd1')](_0x995b('0xd4'))){_0x1bfd73['limit']=qs['limit'](_0x5e6709[_0x995b('0x40')][_0x995b('0x22')]);_0x1bfd73['offset']=qs[_0x995b('0x21')](_0x5e6709['query'][_0x995b('0x21')]);}return _0x56ad9c[_0x995b('0x154')](_0x1bfd73);}})[_0x995b('0x14')](function(_0x4096e9){if(_0x4096e9){return _0x4096e9?{'count':_0x58e174,'rows':_0x4096e9}:null;}})[_0x995b('0x14')](respondWithResult(_0x39beb0,null))[_0x995b('0x1d')](handleError(_0x39beb0,null));};exports[_0x995b('0x155')]=function(_0x28bf7d,_0x173cd4){return db['User'][_0x995b('0x31')]({'where':{'id':_0x28bf7d[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x173cd4,null))[_0x995b('0x14')](function(_0x2137a0){if(_0x2137a0){return _0x2137a0['addSquareProjects'](_0x28bf7d['body']['ids'],_[_0x995b('0x5c')](_0x28bf7d[_0x995b('0x59')],[_0x995b('0x5d'),'id'])||{});}})[_0x995b('0x14')](respondWithResult(_0x173cd4,null))[_0x995b('0x1d')](handleError(_0x173cd4,null));};exports[_0x995b('0x156')]=function(_0x2b06bc,_0x315ac8){return db[_0x995b('0x36')]['find']({'where':{'id':_0x2b06bc[_0x995b('0x51')]['id']}})[_0x995b('0x14')](handleEntityNotFound(_0x315ac8,null))[_0x995b('0x14')](function(_0x272ac5){if(_0x272ac5){return _0x272ac5[_0x995b('0x156')](_0x2b06bc['query'][_0x995b('0x5d')]);}})['then'](respondWithStatusCode(_0x315ac8,null))[_0x995b('0x1d')](handleError(_0x315ac8,null));};exports[_0x995b('0x157')]=function(_0x4bbb23,_0x947793){var _0x44c493={},_0x380237={},_0x260550={'count':0x0,'rows':[]};var _0x1d6698=db[_0x995b('0x158')][_0x995b('0x37')];_0x380237[_0x995b('0x53')]=_['keys'](_0x1d6698);_0x380237['query']=_['keys'](_0x4bbb23[_0x995b('0x40')]);_0x380237[_0x995b('0xcd')]=_[_0x995b('0x54')](_0x380237['model'],_0x380237[_0x995b('0x40')]);_0x380237[_0x995b('0xcd')]=_[_0x995b('0xca')](_0x380237[_0x995b('0xcd')],[_0x995b('0x159'),_0x995b('0x15a'),_0x995b('0x15b'),'$gte',_0x995b('0x15c'),_0x995b('0x15d'),_0x995b('0x15e'),_0x995b('0x15f'),_0x995b('0x160'),_0x995b('0x161'),'$notBetween',_0x995b('0x162'),'$notIn','$like',_0x995b('0x163'),'$iLike',_0x995b('0x164'),_0x995b('0x165'),_0x995b('0x166'),_0x995b('0x167'),'$contained',_0x995b('0x168')]);_0x44c493['attributes']=_[_0x995b('0x54')](_0x380237[_0x995b('0x53')],qs[_0x995b('0x55')](_0x4bbb23['query'][_0x995b('0x55')]));_0x44c493['attributes']=_0x44c493['attributes'][_0x995b('0x48')]?_0x44c493[_0x995b('0x44')]:_0x380237[_0x995b('0x53')];if(!_0x4bbb23['query'][_0x995b('0xd1')]('nolimit')){_0x44c493[_0x995b('0x22')]=qs['limit'](_0x4bbb23[_0x995b('0x40')][_0x995b('0x22')]);_0x44c493[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x4bbb23[_0x995b('0x40')][_0x995b('0x21')]);}_0x44c493[_0x995b('0xce')]=qs[_0x995b('0xcf')](_0x4bbb23[_0x995b('0x40')][_0x995b('0xcf')]);_0x44c493[_0x995b('0x3d')]=qs['filters'](_[_0x995b('0xd0')](_0x4bbb23['query'],_0x380237[_0x995b('0xcd')]));if(_0x4bbb23[_0x995b('0x40')][_0x995b('0x2b')]){_0x44c493[_0x995b('0x3d')]=_[_0x995b('0xd7')](_0x44c493[_0x995b('0x3d')],{'$or':_['map'](_0x44c493['attributes'],function(_0x2a707e){var _0x404d7d={};_0x404d7d[_0x2a707e]={'$like':'%'+_0x4bbb23[_0x995b('0x40')]['filter']+'%'};return _0x404d7d;})});}_0x44c493[_0x995b('0x3d')]={'$and':[_0x44c493[_0x995b('0x3d')],{'$or':[{'UserId':_0x4bbb23[_0x995b('0x51')]['id']},{'OwnerId':_0x4bbb23[_0x995b('0x51')]['id']}]}]};_0x44c493=_['merge']({},_0x44c493,_0x4bbb23[_0x995b('0x57')]);var _0x2a16ee={'where':_0x44c493['where']};return db['CmHopper'][_0x995b('0x3e')](_0x2a16ee)[_0x995b('0x14')](function(_0x446540){_0x260550['count']=_0x446540;if(_0x4bbb23[_0x995b('0x40')][_0x995b('0x56')]){_0x44c493[_0x995b('0x3f')]=[{'attributes':['id',_0x995b('0x169'),_0x995b('0x16a'),_0x995b('0xed')],'model':db[_0x995b('0xcc')],'as':_0x995b('0x16b')},{'attributes':['id',_0x995b('0x32'),_0x995b('0x16c')],'model':db[_0x995b('0xae')],'as':_0x995b('0xd6')}];}return db[_0x995b('0x158')][_0x995b('0x8a')](_0x44c493);})[_0x995b('0x14')](function(_0x591674){_0x260550[_0x995b('0x46')]=_0x591674;return _0x260550;})[_0x995b('0x14')](respondWithFilteredResult(_0x947793,_0x44c493))[_0x995b('0x1d')](handleError(_0x947793,null));};exports[_0x995b('0x16d')]=function(_0x1945be,_0x50e625){if(!_['isNil'](_0x1945be['user']['id'])&&(_0x1945be['user'][_0x995b('0x30')]==_0x995b('0x27')||_0x1945be[_0x995b('0x7d')]['role']=='user')){return db['User'][_0x995b('0x97')]({'where':{'id':_0x1945be[_0x995b('0x51')]['id']},'raw':!![]})[_0x995b('0x14')](function(_0x1fc066){return authService['retrieveApiKey'](_0x1fc066);})[_0x995b('0x14')](function(_0x47cf6a){if(_0x47cf6a){return _0x50e625[_0x995b('0x1e')](0xc8)[_0x995b('0x20')]({'api_key':_0x47cf6a['token']});}else{return _0x50e625[_0x995b('0x1e')](0xcc)[_0x995b('0x20')]({'message':_0x995b('0x16e')});}})[_0x995b('0x1d')](handleError(_0x50e625,0x193));}else{return _0x50e625[_0x995b('0x1e')](0x191)['json']({'message':_0x995b('0x16f')});}};exports[_0x995b('0x170')]=function(_0x55a6e5,_0x339a1f){if(!_['isNil'](_0x55a6e5[_0x995b('0x7d')]['id'])&&(_0x55a6e5[_0x995b('0x7d')]['role']==_0x995b('0x27')||_0x55a6e5[_0x995b('0x7d')]['role']==_0x995b('0x7d'))){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0x55a6e5['params']['id']}})[_0x995b('0x14')](function(_0x47400a){return authService[_0x995b('0x171')](_0x47400a);})[_0x995b('0x14')](function(_0x4c1f09){return db['User'][_0x995b('0x24')]({'apiKeyIat':_0x4c1f09['iat'],'apiKeyNonce':_0x4c1f09['nonce']},{'where':{'id':_0x55a6e5[_0x995b('0x51')]['id']}})['then'](function(){return _0x339a1f[_0x995b('0x1e')](0xc8)[_0x995b('0x20')]({'api_key':_0x4c1f09[_0x995b('0x172')]});});})['catch'](handleError(_0x339a1f,0x193));}else{return _0x339a1f[_0x995b('0x1e')](0x191)[_0x995b('0x20')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x995b('0x173')]=function(_0xd6df3f,_0x5d6c6a){if(!_[_0x995b('0x63')](_0xd6df3f[_0x995b('0x7d')]['id'])&&(_0xd6df3f[_0x995b('0x7d')][_0x995b('0x30')]==_0x995b('0x27')||_0xd6df3f[_0x995b('0x7d')][_0x995b('0x30')]=='user')){return db[_0x995b('0x36')][_0x995b('0x31')]({'where':{'id':_0xd6df3f[_0x995b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5d6c6a,null))[_0x995b('0x14')](function(_0x3cc5f6){if(_0x3cc5f6&&_0x3cc5f6[_0x995b('0x174')]&&_0x3cc5f6[_0x995b('0x175')])return _0x3cc5f6;else throw{'message':_0x995b('0x176')};})[_0x995b('0x14')](function(){return db[_0x995b('0x36')][_0x995b('0x24')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0xd6df3f[_0x995b('0x51')]['id']}});})[_0x995b('0x14')](respondWithStatusCode(_0x5d6c6a,0xc8))[_0x995b('0x1d')](handleError(_0x5d6c6a,0x193));}else{return _0x5d6c6a[_0x995b('0x1e')](0x191)[_0x995b('0x20')]({'message':_0x995b('0x16f')});}};exports[_0x995b('0x177')]=function(_0x49f059,_0x12ebb8){var _0x506362=_0x49f059[_0x995b('0x7d')][_0x995b('0x26')]({'plain':!![]});if(!_0x506362){return _0x12ebb8[_0x995b('0x1e')](0x191)['send'](_0x995b('0x178'));}else{Promise[_0x995b('0x101')]()[_0x995b('0x14')](function(){if(_0x49f059['query'][_0x995b('0x43')]!==_0x995b('0x41'))return;return _0x49f059['user'][_0x995b('0x179')]();})[_0x995b('0x14')](function(_0x4ff224){if(!_0x4ff224)return;return _0x4ff224[_0x995b('0x26')]({'plain':!![]});})['then'](function(_0x3eeb99){_0x506362['userSetting']=_0x3eeb99;return _0x12ebb8[_0x995b('0x1e')](0xc8)[_0x995b('0x20')](_0x506362);});}};exports[_0x995b('0x17a')]=function(_0x487fae,_0x361c2d){var _0x2026f1={'offset':0x0},_0x491ef0={'count':0x0,'rows':[]};Promise[_0x995b('0x101')]()[_0x995b('0x14')](function(){if(!_0x487fae['query'][_0x995b('0x2b')]&&!_0x487fae[_0x995b('0x40')]['teams']&&!_0x487fae[_0x995b('0x40')][_0x995b('0x17b')])return[];return Promise[_0x995b('0x101')]()[_0x995b('0x14')](function(){var _0x157211=[];if(!_[_0x995b('0x8b')](_0x487fae['query'][_0x995b('0x17c')])){_0x157211[_0x995b('0x45')](db[_0x995b('0x10f')][_0x995b('0x8a')]({'attributes':['id',_0x995b('0x32')],'where':{'id':_0x487fae[_0x995b('0x40')]['teams']}}));}if(!_[_0x995b('0x8b')](_0x487fae[_0x995b('0x40')]['queues'])){_0x157211[_0x995b('0x45')](db[_0x995b('0xae')]['findAll']({'attributes':['id',_0x995b('0x32')],'type':_0x995b('0x17d'),'where':{'id':_0x487fae[_0x995b('0x40')]['queues']}}));}return Promise[_0x995b('0x4f')](_0x157211);})[_0x995b('0x14')](function(_0x137a45){var _0x553906=_[_0x995b('0x120')](_0x137a45)[_0x995b('0x2d')](function(_0x3d1acb){return _0x3d1acb[_0x995b('0x17e')]({'attributes':['id','name',_0x995b('0x5e'),_0x995b('0x9f')],'raw':!![]});});return Promise[_0x995b('0x4f')](_0x553906);})['then'](function(_0x31da4e){var _0x4626b0=_[_0x995b('0x120')](_0x31da4e);if(!_0x487fae['query'][_0x995b('0x2b')])return _0x4626b0;if(_[_0x995b('0x8b')](_0x4626b0)){return db[_0x995b('0x36')]['findAll']({'attributes':['id',_0x995b('0x32'),_0x995b('0x5e'),_0x995b('0x9f')],'where':{'role':'agent','$or':[db[_0x995b('0x65')][_0x995b('0x3d')](db[_0x995b('0x65')]['fn'](_0x995b('0x17f'),db[_0x995b('0x65')]['col'](_0x995b('0x32'))),{'$like':'%'+_0x487fae[_0x995b('0x40')]['filter']['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x487fae[_0x995b('0x40')][_0x995b('0x2b')]+'%'}}]},'raw':!![]});}else{return _(_0x4626b0)[_0x995b('0x120')]()['filter'](function(_0x4eb71f){return _0x4eb71f[_0x995b('0x32')][_0x995b('0xa6')]()[_0x995b('0x2f')](_0x487fae[_0x995b('0x40')][_0x995b('0x2b')][_0x995b('0xa6')]())||_0x4eb71f[_0x995b('0x5e')]['toString']()[_0x995b('0x2f')](_0x487fae[_0x995b('0x40')][_0x995b('0x2b')]);})[_0x995b('0x2e')]();}})[_0x995b('0x14')](function(_0x4106fd){var _0x28d946=_0x995b('0x32');var _0x37c4d6=_0x995b('0x180');if(_0x487fae['query']['sort']){_0x37c4d6=_0x487fae[_0x995b('0x40')][_0x995b('0xcf')][0x0]==='-'?_0x995b('0x181'):_0x995b('0x180');_0x28d946=_0x37c4d6===_0x995b('0x180')?_0x487fae[_0x995b('0x40')][_0x995b('0xcf')]:_0x487fae[_0x995b('0x40')][_0x995b('0xcf')][_0x995b('0x182')](0x1);}return _(_0x4106fd)[_0x995b('0x183')]('id')[_0x995b('0x184')]([function(_0x56a72f){return _0x28d946===_0x995b('0x32')?_0x56a72f[_0x28d946][_0x995b('0xa6')]():_0x56a72f[_0x28d946];}],[_0x37c4d6])['map'](function(_0x1b98a8){return _[_0x995b('0xd0')](_0x1b98a8,['id','name',_0x995b('0x5e'),'online']);})['value']();})[_0x995b('0x14')](function(_0x28dedf){return client['request'](_0x995b('0x28'),_0x487fae)[_0x995b('0x14')](function(_0x3379bd){if(_0x3379bd[_0x995b('0x18')])throw new Error(_0x995b('0x185'));var _0x2ec11b=_0x3379bd[_0x995b('0x1c')];var _0x2c378a=jayson[_0x995b('0x11')][_0x995b('0x12')]({'port':0x232c});return _0x2c378a['request']('Agents',_0x487fae)[_0x995b('0x14')](function(_0x4df3e3){if(_0x4df3e3[_0x995b('0x18')])throw new Error(_0x995b('0x186'));var _0x58368d=_0x4df3e3[_0x995b('0x1c')];return _['merge']({},_0x58368d,_0x2ec11b);});})[_0x995b('0x14')](function(_0x33251a){return _['map'](_0x28dedf,function(_0x397e85){var _0x5b3843=_[_0x995b('0x31')](_0x33251a[_0x995b('0x46')],['id',_0x397e85['id']]);if(!_0x5b3843||!_0x397e85[_0x995b('0x9f')]){_0x397e85['status']='offline';}else if(_0x5b3843[_0x995b('0xa1')]){_0x397e85[_0x995b('0x1e')]='pause';}else{_0x397e85[_0x995b('0x1e')]=_[_0x995b('0x2f')]([_0x995b('0x187'),_0x995b('0x188'),_0x995b('0x189'),_0x995b('0x18a'),null,undefined],_0x5b3843[_0x995b('0x18b')])?_0x995b('0x9f'):_0x995b('0x18c');}return _0x397e85;});});});})['then'](function(_0x48148d){if(!_0x487fae['query'][_0x995b('0xd1')]('nolimit')){_0x2026f1[_0x995b('0x22')]=qs[_0x995b('0x22')](_0x487fae[_0x995b('0x40')][_0x995b('0x22')]||0xa);_0x2026f1[_0x995b('0x21')]=qs[_0x995b('0x21')](_0x487fae['query']['offset']);}_0x491ef0[_0x995b('0x3e')]=_0x48148d[_0x995b('0x48')];_0x491ef0[_0x995b('0x46')]=_0x2026f1['limit']?_0x48148d[_0x995b('0x18d')](_0x2026f1[_0x995b('0x21')],_0x2026f1[_0x995b('0x21')]+_0x2026f1[_0x995b('0x22')]):_0x48148d;return _0x491ef0;})['then'](respondWithFilteredResult(_0x361c2d,_0x2026f1))[_0x995b('0x1d')](handleError(_0x361c2d,null));};function get_open_tabs(_0x4162ce,_0x8ef632){var _0x5e7e6e=_0x4162ce[_0x995b('0x18e')](0x0)[_0x995b('0x18f')]()+_0x4162ce[_0x995b('0x18d')](0x1);var _0x44a340={'type':db[_0x995b('0x8f')]['QueryTypes']['SELECT'],'raw':!![]};return new BPromise(function(_0x23aba3,_0x153a9d){var _0x7750bc=squel[_0x995b('0x190')]()[_0x995b('0x191')](_0x995b('0x192')+_0x5e7e6e+_0x995b('0x193'),'id')['field']('ui.createdAt')[_0x995b('0x68')]('user_has_'+_0x4162ce+_0x995b('0x194'),'ui')[_0x995b('0x3d')](_0x995b('0x195'),_0x8ef632['id']);return db[_0x995b('0x65')][_0x995b('0x40')](_0x7750bc[_0x995b('0x196')](),_0x44a340)[_0x995b('0x14')](function(_0x50fa17){_0x8ef632[_0x5e7e6e+_0x995b('0x197')]=_0x50fa17;_0x23aba3(_0x50fa17);})['catch'](function(_0x25ebb5){_0x153a9d(_0x25ebb5);});});}
\ No newline at end of file
+var _0x4e43=['addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','iat','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','teams','queues','inbound','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util','path','lodash','squel','jayson/promise','ioredis','../../components/parsers/qs','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','register','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','role','Users','user','Agents','agent','filter','value','find','UserProfileResource','sendStatus','stack','send','index','User','rawAttributes','map','fieldName','key','includes','password','name','getOptions','where','includeAll','include','true','UserSetting','attributes','push','query','openTabs','rows','dataValues','sms','fax','mail','openchannel','whatsapp','all','model','differenceBy','salt','keys','intersection','fields','length','userSetting','chat','update','body','params','describe','addContacts','ids','internal','findById','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','voicemail','mailbox','VoiceMail','email','permissions','102','103','113','110','105','106','107','108','109','100','111','114','create','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','Telephones','userProfileId','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','UserProfileSection','findAll','isEmpty','autoAssociation','telephone','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','emit','Queue:save','voice','get','online','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','channel','remove','Queues','isArray','QueueId','Queue:remove','addAvatar','filename','join','root','server/files/images/logos/default_profile.png','userpic','existsSync','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','MailOpenTabs','MAIL','createdAt','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','filters','order','sort','pick','merge','options','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','connection','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','bulkCreate','concat','isMiddleware','resolve','pause','QueuePause','type','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','manual','Pause','getTeams','Team','addTeams','setDataValue','Chat','getMailQueues','getSmsQueues','Sms','Whatsapp','Fax','Openchannel','flatten','transaction','addAgent','Voice','getDataValue','TeamVoicePrefix','VoicePrefixId','removeTeams','Mail','getWhatsappQueues','getOpenchannelQueues','UserVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject'];(function(_0xa416df,_0x4b387b){var _0x30bfa1=function(_0x362930){while(--_0x362930){_0xa416df['push'](_0xa416df['shift']());}};_0x30bfa1(++_0x4b387b);}(_0x4e43,0x1dd));var _0x34e4=function(_0x132d12,_0x2c9799){_0x132d12=_0x132d12-0x0;var _0x1c3163=_0x4e43[_0x132d12];return _0x1c3163;};'use strict';var moment=require(_0x34e4('0x0'));var BPromise=require('bluebird');var util=require(_0x34e4('0x1'));var path=require(_0x34e4('0x2'));var fs=require('fs');var _=require(_0x34e4('0x3'));var squel=require(_0x34e4('0x4'));var jayson=require(_0x34e4('0x5'));var Redis=require(_0x34e4('0x6'));var authService=require('../../components/auth/service');var qs=require(_0x34e4('0x7'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x34e4('0x8'));var licenseUtil=require(_0x34e4('0x9'));var db=require(_0x34e4('0xa'))['db'];var socket=require(_0x34e4('0xb'))(new Redis(config[_0x34e4('0xc')]));require('./user.socket')[_0x34e4('0xd')](socket);config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var client=jayson[_0x34e4('0xe')][_0x34e4('0xf')]({'port':0x232a});var values;function respondWithRpcPromise(_0x20c508,_0x29c28b,_0x15d05a,_0x333ea6){return new BPromise(function(_0x3a0427,_0xeaa596){var _0x1bd5eb=_0x333ea6||client;return _0x1bd5eb[_0x34e4('0x10')](_0x20c508,_0x15d05a)[_0x34e4('0x11')](function(_0x2b2eeb){logger[_0x34e4('0x12')]('User,\x20%s,\x20%s',_0x29c28b,_0x34e4('0x13'));logger[_0x34e4('0x14')](_0x34e4('0x15'),_0x29c28b,'request\x20sent',JSON[_0x34e4('0x16')](_0x2b2eeb));if(_0x2b2eeb[_0x34e4('0x17')]){if(_0x2b2eeb['error'][_0x34e4('0x18')]===0x1f4){logger['error'](_0x34e4('0x19'),_0x29c28b,_0x2b2eeb[_0x34e4('0x17')][_0x34e4('0x1a')]);return _0xeaa596(_0x2b2eeb[_0x34e4('0x17')][_0x34e4('0x1a')]);}logger[_0x34e4('0x17')]('User,\x20%s,\x20%s',_0x29c28b,_0x2b2eeb[_0x34e4('0x17')]['message']);return _0x3a0427(_0x2b2eeb['error'][_0x34e4('0x1a')]);}else{logger[_0x34e4('0x12')](_0x34e4('0x19'),_0x29c28b,_0x34e4('0x13'));_0x3a0427(_0x2b2eeb['result']['message']);}})[_0x34e4('0x1b')](function(_0x2b5780){logger[_0x34e4('0x17')](_0x34e4('0x19'),_0x29c28b,_0x2b5780);_0xeaa596(_0x2b5780);});});}function respondWithStatusCode(_0x1d0c38,_0xc024f6){_0xc024f6=_0xc024f6||0xcc;return function(_0x142dfa){if(_0x142dfa){return _0x1d0c38['sendStatus'](_0xc024f6);}return _0x1d0c38[_0x34e4('0x1c')](_0xc024f6)[_0x34e4('0x1d')]();};}function respondWithResult(_0x54c3cc,_0x425956){_0x425956=_0x425956||0xc8;return function(_0x587809){if(_0x587809){return _0x54c3cc['status'](_0x425956)[_0x34e4('0x1e')](_0x587809);}};}function respondWithFilteredResult(_0x3b0f4d,_0x394b55){return function(_0x847a6d){if(_0x847a6d){var _0xce9e6=typeof _0x394b55[_0x34e4('0x1f')]===_0x34e4('0x20')&&typeof _0x394b55[_0x34e4('0x21')]===_0x34e4('0x20');var _0x552a3f=_0x847a6d[_0x34e4('0x22')];var _0x435e6c=_0xce9e6?0x0:_0x394b55[_0x34e4('0x1f')];var _0x4fa157=_0xce9e6?_0x847a6d[_0x34e4('0x22')]:_0x394b55[_0x34e4('0x1f')]+_0x394b55[_0x34e4('0x21')];var _0x2b1316;if(_0x4fa157>=_0x552a3f){_0x4fa157=_0x552a3f;_0x2b1316=0xc8;}else{_0x2b1316=0xce;}_0x3b0f4d[_0x34e4('0x1c')](_0x2b1316);return _0x3b0f4d[_0x34e4('0x23')](_0x34e4('0x24'),_0x435e6c+'-'+_0x4fa157+'/'+_0x552a3f)[_0x34e4('0x1e')](_0x847a6d);}return null;};}function saveUpdates(_0x11c67f){return function(_0x433738){if(_0x433738){return _0x433738['update'](_0x11c67f)[_0x34e4('0x11')](function(_0x10b656){return _0x10b656;});}return null;};}function removeEntity(_0x2d503b){return function(_0x589813){if(_0x589813){return _0x589813[_0x34e4('0x25')]()[_0x34e4('0x11')](function(){var _0x1718f2=_0x589813['get']({'plain':!![]});if(_0x1718f2[_0x34e4('0x26')]==='admin')return;var _0x4324f3=[{'name':_0x34e4('0x27'),'value':_0x34e4('0x28'),'ignore':!![]},{'name':_0x34e4('0x29'),'value':_0x34e4('0x2a'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x4e1de1=_(_0x4324f3)[_0x34e4('0x2b')]('ignore')['map'](_0x34e4('0x2c'))[_0x34e4('0x2c')]();if(_['includes'](_0x4e1de1,_0x1718f2[_0x34e4('0x26')])){return;}var _0x594124=_[_0x34e4('0x2d')](_0x4324f3,['value',_0x1718f2['role']])['name'];return db[_0x34e4('0x2e')][_0x34e4('0x25')]({'where':{'type':_0x594124,'resourceId':_0x1718f2['id']}})['then'](function(){return _0x589813;});})[_0x34e4('0x11')](function(){_0x2d503b[_0x34e4('0x1c')](0xcc)[_0x34e4('0x1d')]();});}};}function handleEntityNotFound(_0x57a246){return function(_0x5926dc){if(!_0x5926dc){_0x57a246[_0x34e4('0x2f')](0x194);}return _0x5926dc;};}function handleError(_0x5173eb,_0x2638fb){_0x2638fb=_0x2638fb||0x1f4;return function(_0xc7f097){logger[_0x34e4('0x17')](_0xc7f097[_0x34e4('0x30')]);if(_0xc7f097['name']){delete _0xc7f097['name'];}_0x5173eb['status'](_0x2638fb)[_0x34e4('0x31')](_0xc7f097);};}exports[_0x34e4('0x32')]=function(_0x243c90,_0x1a98fd){var _0x3553c6={},_0x1e4629={'count':0x0,'rows':[]};var _0x339456=_(db[_0x34e4('0x33')][_0x34e4('0x34')])[_0x34e4('0x35')](function(_0x3e5796){return{'name':_0x3e5796[_0x34e4('0x36')],'type':_0x3e5796['type'][_0x34e4('0x37')]};})[_0x34e4('0x2b')](function(_0x33782e){return!_[_0x34e4('0x38')]([_0x34e4('0x39'),'salt'],_0x33782e[_0x34e4('0x3a')]);})[_0x34e4('0x2c')]();_0x3553c6=qs[_0x34e4('0x3b')](_0x339456,_0x243c90);var _0x4e9dcb={'where':_0x3553c6[_0x34e4('0x3c')]};return db[_0x34e4('0x33')]['count'](_0x4e9dcb)[_0x34e4('0x11')](function(_0x457268){_0x1e4629['count']=_0x457268;if(_0x243c90['query'][_0x34e4('0x3d')]){_0x3553c6[_0x34e4('0x3e')]=[{'all':!![]}];}if(_0x243c90['query']['userSetting']===_0x34e4('0x3f')){_0x3553c6[_0x34e4('0x3e')]=[{'model':db[_0x34e4('0x40')],'as':'userSetting'}];}if(!_[_0x34e4('0x38')](_0x3553c6[_0x34e4('0x41')],'id')){_0x3553c6[_0x34e4('0x41')][_0x34e4('0x42')]('id');}return db[_0x34e4('0x33')]['findAll'](_0x3553c6);})[_0x34e4('0x11')](function(_0x4eb340){_0x1e4629['rows']=_0x4eb340;if(_0x243c90[_0x34e4('0x43')][_0x34e4('0x44')]===_0x34e4('0x3f')){var _0x8e3fb8=[];for(var _0x131af8=0x0;_0x131af8<_0x1e4629[_0x34e4('0x45')]['length'];_0x131af8++){_0x8e3fb8[_0x34e4('0x42')](get_open_tabs('chat',_0x1e4629[_0x34e4('0x45')][_0x131af8][_0x34e4('0x46')]));_0x8e3fb8[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x47'),_0x1e4629['rows'][_0x131af8]['dataValues']));_0x8e3fb8[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x48'),_0x1e4629[_0x34e4('0x45')][_0x131af8]['dataValues']));_0x8e3fb8['push'](get_open_tabs(_0x34e4('0x49'),_0x1e4629[_0x34e4('0x45')][_0x131af8][_0x34e4('0x46')]));_0x8e3fb8[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x4a'),_0x1e4629['rows'][_0x131af8][_0x34e4('0x46')]));_0x8e3fb8[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x4b'),_0x1e4629[_0x34e4('0x45')][_0x131af8][_0x34e4('0x46')]));}return BPromise[_0x34e4('0x4c')](_0x8e3fb8)[_0x34e4('0x11')](function(){return _0x1e4629;});}else{return _0x1e4629;}})[_0x34e4('0x11')](respondWithFilteredResult(_0x1a98fd,_0x3553c6))[_0x34e4('0x1b')](handleError(_0x1a98fd,null));};exports['show']=function(_0x4e3e0d,_0x4aa0d5){var _0x3ca2dc={'raw':![],'where':{'id':_0x4e3e0d['params']['id']}},_0x19aaa2={};_0x19aaa2[_0x34e4('0x4d')]=_[_0x34e4('0x4e')](_['keys'](db['User'][_0x34e4('0x34')]),[_0x34e4('0x39'),_0x34e4('0x4f')]);_0x19aaa2[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x4e3e0d[_0x34e4('0x43')]);_0x19aaa2['filters']=_['intersection'](_0x19aaa2[_0x34e4('0x4d')],_0x19aaa2[_0x34e4('0x43')]);_0x3ca2dc[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x19aaa2['model'],qs[_0x34e4('0x52')](_0x4e3e0d['query'][_0x34e4('0x52')]));_0x3ca2dc[_0x34e4('0x41')]=_0x3ca2dc[_0x34e4('0x41')][_0x34e4('0x53')]?_0x3ca2dc[_0x34e4('0x41')]:_0x19aaa2[_0x34e4('0x4d')];if(_0x4e3e0d[_0x34e4('0x43')][_0x34e4('0x3d')]){_0x3ca2dc[_0x34e4('0x3e')]=[{'all':!![]}];}if(_0x4e3e0d[_0x34e4('0x43')][_0x34e4('0x54')]===_0x34e4('0x3f')){_0x3ca2dc[_0x34e4('0x3e')]=[{'model':db['UserSetting'],'as':_0x34e4('0x54')}];}_0x3ca2dc=_['merge']({},_0x3ca2dc,_0x4e3e0d['options']);if(!_[_0x34e4('0x38')](_0x3ca2dc[_0x34e4('0x41')],'id')){_0x3ca2dc[_0x34e4('0x41')][_0x34e4('0x42')]('id');}return db[_0x34e4('0x33')]['find'](_0x3ca2dc)['then'](handleEntityNotFound(_0x4aa0d5,null))[_0x34e4('0x11')](function(_0x3ee4f2){var _0x45556f=[];values=_0x3ee4f2;if(_0x4e3e0d[_0x34e4('0x43')][_0x34e4('0x44')]===_0x34e4('0x3f')){_0x45556f[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x55'),_0x3ee4f2[_0x34e4('0x46')]));_0x45556f[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x47'),_0x3ee4f2[_0x34e4('0x46')]));_0x45556f[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x4a'),_0x3ee4f2[_0x34e4('0x46')]));_0x45556f[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x4b'),_0x3ee4f2[_0x34e4('0x46')]));_0x45556f['push'](get_open_tabs(_0x34e4('0x48'),_0x3ee4f2[_0x34e4('0x46')]));_0x45556f[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x49'),_0x3ee4f2[_0x34e4('0x46')]));return BPromise[_0x34e4('0x4c')](_0x45556f);}else{return values;}})[_0x34e4('0x11')](function(){return values;})[_0x34e4('0x11')](respondWithResult(_0x4aa0d5,null))[_0x34e4('0x1b')](handleError(_0x4aa0d5,null));};exports[_0x34e4('0x56')]=function(_0x3498e3,_0x46138d){if(_0x3498e3['body']['id']){delete _0x3498e3[_0x34e4('0x57')]['id'];}delete _0x3498e3[_0x34e4('0x57')][_0x34e4('0x26')];return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x3498e3[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x46138d,null))[_0x34e4('0x11')](saveUpdates(_0x3498e3[_0x34e4('0x57')],null))[_0x34e4('0x11')](respondWithResult(_0x46138d,null))[_0x34e4('0x1b')](handleError(_0x46138d,null));};exports[_0x34e4('0x59')]=function(_0x596ec1,_0x395bea){return db[_0x34e4('0x33')][_0x34e4('0x59')]()['then'](respondWithResult(_0x395bea,null))[_0x34e4('0x1b')](handleError(_0x395bea,null));};exports[_0x34e4('0x5a')]=function(_0x5ccaf7,_0x23d13a){return db[_0x34e4('0x33')]['find']({'where':{'id':_0x5ccaf7['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x23d13a,null))[_0x34e4('0x11')](function(_0x2e25a2){if(_0x2e25a2){return _0x2e25a2['addContacts'](_0x5ccaf7[_0x34e4('0x57')]['ids'],_['omit'](_0x5ccaf7['body'],[_0x34e4('0x5b'),'id'])||{});}})[_0x34e4('0x11')](respondWithResult(_0x23d13a,null))[_0x34e4('0x1b')](handleError(_0x23d13a,null));};function validateUser(_0x4aef42){return new BPromise(function(_0x445d69,_0x52653b){if(_0x4aef42[_0x34e4('0x5c')])return _0x445d69(_0x4aef42);return db['Setting'][_0x34e4('0x5d')](0x1)[_0x34e4('0x11')](function(_0x184619){if(_0x184619['securePassword'])authService['validatePasswordPattern'](_0x4aef42[_0x34e4('0x39')]);db['User']['max']('internal')[_0x34e4('0x11')](function(_0xf66016){if(_[_0x34e4('0x5e')](_0xf66016)){_0x4aef42[_0x34e4('0x5c')]=_0x184619[_0x34e4('0x5f')]||0x1;return;}if(_[_0x34e4('0x5e')](_0x184619['min_internal'])||_0x184619['min_internal']===_0xf66016){_0x4aef42['internal']=_0xf66016+0x1;return;}if(_0x184619[_0x34e4('0x5f')]>_0xf66016){_0x4aef42[_0x34e4('0x5c')]=_0x184619[_0x34e4('0x5f')];return;}return db[_0x34e4('0x60')]['query'](_0x34e4('0x61'),{'type':db[_0x34e4('0x60')][_0x34e4('0x62')]['SELECT']})[_0x34e4('0x11')](function(_0xb1463){if(_0xb1463&&_0xb1463[_0x34e4('0x53')]){for(var _0x270877=0x0,_0x51228f=_0xb1463['length'];_0x270877<_0x51228f&&_[_0x34e4('0x5e')](_0x4aef42[_0x34e4('0x5c')]);_0x270877++){if(_0x184619[_0x34e4('0x5f')]<=_0xb1463[_0x270877][_0x34e4('0x63')]){_0x4aef42[_0x34e4('0x5c')]=_0xb1463[_0x270877][_0x34e4('0x63')];}else if(_0x184619[_0x34e4('0x5f')]>_0xb1463[_0x270877][_0x34e4('0x63')]&&_0x184619[_0x34e4('0x5f')]<=_0xb1463[_0x270877]['to']){_0x4aef42[_0x34e4('0x5c')]=_0x184619[_0x34e4('0x5f')];}}}if(_['isNil'](_0x4aef42[_0x34e4('0x5c')])){_0x4aef42[_0x34e4('0x5c')]=_0xf66016+0x1;}return _0x445d69(_0x4aef42);});});})[_0x34e4('0x1b')](function(_0x3fb961){_0x52653b(_0x3fb961);});});}function updateUser(_0x4fab8c){return new BPromise(function(_0x418def,_0x97fa4e){try{if(_0x4fab8c[_0x34e4('0x64')]){_0x4fab8c[_0x34e4('0x65')]=_0x4fab8c[_0x34e4('0x5c')];_0x4fab8c[_0x34e4('0x66')]={'mailbox':_0x4fab8c['internal'],'password':_0x4fab8c[_0x34e4('0x39')],'fullname':_0x4fab8c['fullname'],'email':_0x4fab8c[_0x34e4('0x67')]};}if(_0x4fab8c[_0x34e4('0x26')]===_0x34e4('0x2a')){if(!_0x4fab8c[_0x34e4('0x68')])_0x4fab8c[_0x34e4('0x68')]=['101',_0x34e4('0x69'),_0x34e4('0x6a'),_0x34e4('0x6b'),_0x34e4('0x6c'),'104',_0x34e4('0x6d'),_0x34e4('0x6e'),_0x34e4('0x6f'),_0x34e4('0x70'),_0x34e4('0x71'),_0x34e4('0x72'),_0x34e4('0x73'),_0x34e4('0x74'),'115'];}_0x418def(_0x4fab8c);}catch(_0x1c268f){_0x97fa4e(_0x1c268f);}});}exports[_0x34e4('0x75')]=function(_0x308d02,_0x59d0c6){if(_0x308d02['user'][_0x34e4('0x26')]===_0x34e4('0x2a'))throw new Error(_0x34e4('0x76'));if(_0x308d02[_0x34e4('0x57')][_0x34e4('0x26')]===_0x34e4('0x28')&&_0x308d02['user']['role']!==_0x34e4('0x77')){throw new Error(_0x34e4('0x78'));}if(_0x308d02[_0x34e4('0x57')][_0x34e4('0x26')]==='admin'&&_0x308d02['user'][_0x34e4('0x26')]!=='admin'){throw new Error(_0x34e4('0x79'));}return licenseUtil['checkUserLimits']([_0x308d02[_0x34e4('0x57')]])[_0x34e4('0x11')](function(){return validateUser(_0x308d02['body']);})[_0x34e4('0x11')](function(_0x57c72f){return updateUser(_0x57c72f)[_0x34e4('0x11')](function(_0x16c1de){if(_0x16c1de[_0x34e4('0x26')]==='admin'){_0x16c1de[_0x34e4('0x7a')]=_0x308d02['user'][_0x34e4('0x7a')];delete _0x16c1de['userProfileId'];}return _0x16c1de;});})['then'](function(_0x48a9be){return db['User'][_0x34e4('0x75')](_0x48a9be,{'include':[{'model':db[_0x34e4('0x66')],'as':_0x34e4('0x66')}]});})[_0x34e4('0x11')](function(_0x4e1560){if(_0x308d02['body'][_0x34e4('0x26')]===_0x34e4('0x28'))return _0x4e1560;if(_0x308d02[_0x34e4('0x28')]['role']!==_0x34e4('0x28'))return _0x4e1560;return db['UserProfileSection']['find']({'where':{'name':_0x4e1560['role']===_0x34e4('0x2a')?'Agents':_0x34e4('0x7b'),'userProfileId':_0x308d02[_0x34e4('0x28')][_0x34e4('0x7c')]},'raw':!![]})[_0x34e4('0x11')](function(_0xb00662){if(!_0xb00662||_0xb00662['autoAssociation']!=0x0)return _0x4e1560;return db[_0x34e4('0x2e')][_0x34e4('0x75')]({'name':_0x4e1560[_0x34e4('0x3a')],'resourceId':_0x4e1560['id'],'type':_0xb00662['name'],'sectionId':_0xb00662['id']},{})[_0x34e4('0x11')](function(){return _0x4e1560;});})[_0x34e4('0x1b')](function(_0x29f4d6){logger[_0x34e4('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29f4d6);throw _0x29f4d6;});})[_0x34e4('0x11')](respondWithResult(_0x59d0c6,0xc9))['catch'](handleError(_0x59d0c6,null));};exports['bulkCreate']=function(_0x48d9ad,_0x23f371){var _0x218408=_0x48d9ad[_0x34e4('0x57')];var _0x351dbe=[];if(_0x48d9ad['user'][_0x34e4('0x26')]==='agent')throw new Error(_0x34e4('0x76'));if(_[_0x34e4('0x7d')](_0x218408,[_0x34e4('0x26'),_0x34e4('0x28')])&&_0x48d9ad[_0x34e4('0x28')]['role']!==_0x34e4('0x77')){throw new Error(_0x34e4('0x78'));}if(_[_0x34e4('0x7d')](_0x218408,['role',_0x34e4('0x77')])&&_0x48d9ad[_0x34e4('0x28')][_0x34e4('0x26')]!=='admin'){throw new Error(_0x34e4('0x7e'));}return licenseUtil[_0x34e4('0x7f')](_0x218408)['then'](function(){return validateUser(_0x218408[0x0]);})['then'](function(){for(var _0x51c9ce=0x1;_0x51c9ce<_0x218408[_0x34e4('0x53')];_0x51c9ce++){var _0x2d88a0=_0x218408[_0x51c9ce-0x1][_0x34e4('0x5c')];if(!_0x218408[_0x51c9ce][_0x34e4('0x5c')])_0x218408[_0x51c9ce][_0x34e4('0x5c')]=_0x2d88a0+0x1;_0x351dbe['push'](validateUser(_0x218408[_0x51c9ce]));}return BPromise[_0x34e4('0x4c')](_0x351dbe);})['then'](function(){_0x351dbe=[];for(var _0x5bd6e9=0x0;_0x5bd6e9<_0x218408[_0x34e4('0x53')];_0x5bd6e9++){_0x351dbe[_0x34e4('0x42')](updateUser(_0x218408[_0x5bd6e9]));}return BPromise[_0x34e4('0x4c')](_0x351dbe);})[_0x34e4('0x11')](function(){return BPromise[_0x34e4('0x80')](_0x218408,function(_0x3f98fa){return db[_0x34e4('0x33')][_0x34e4('0x75')](_0x3f98fa,{'include':[{'model':db[_0x34e4('0x66')],'as':'VoiceMail'}]})[_0x34e4('0x11')](function(_0xeef519){_0x3f98fa['id']=_0xeef519['id'];return _0x3f98fa;});});})['then'](function(_0x22c4c4){if(_0x48d9ad[_0x34e4('0x57')]['role']===_0x34e4('0x28'))return _0x22c4c4;if(_0x48d9ad[_0x34e4('0x28')][_0x34e4('0x26')]!=='user')return _0x22c4c4;var _0x131a2d=_[_0x34e4('0x7d')](_0x22c4c4,function(_0x46057b){return _0x46057b[_0x34e4('0x26')]==='agent'||_0x46057b[_0x34e4('0x26')]==='telephone';});if(!_0x131a2d)return _0x22c4c4;return db[_0x34e4('0x81')][_0x34e4('0x82')]({'where':{'name':{'$or':[_0x34e4('0x29'),_0x34e4('0x7b')]},'userProfileId':_0x48d9ad[_0x34e4('0x28')][_0x34e4('0x7c')]},'raw':!![]})[_0x34e4('0x11')](function(_0x19d20c){if(_[_0x34e4('0x83')](_0x19d20c)||!_[_0x34e4('0x7d')](_0x19d20c,[_0x34e4('0x84'),0x0]))return _0x22c4c4;_0x351dbe=[];var _0x885f06=_(_0x19d20c)[_0x34e4('0x35')](function(_0x3b7528){if(_0x3b7528['autoAssociation']===0x1)return;return _0x3b7528[_0x34e4('0x3a')]===_0x34e4('0x29')?_0x34e4('0x2a'):_0x34e4('0x85');})[_0x34e4('0x86')]()[_0x34e4('0x2c')]();for(var _0x697310=0x0;_0x697310<_0x22c4c4['length'];_0x697310++){if(!_['includes'](_0x885f06,_0x22c4c4[_0x697310][_0x34e4('0x26')]))return;var _0x5893d7=_0x22c4c4[_0x697310][_0x34e4('0x26')]===_0x34e4('0x2a')?'Agents':_0x34e4('0x7b');_0x351dbe['push'](db[_0x34e4('0x2e')][_0x34e4('0x75')]({'name':_0x22c4c4[_0x697310]['name'],'resourceId':_0x22c4c4[_0x697310]['id'],'type':_0x5893d7,'sectionId':_[_0x34e4('0x2d')](_0x19d20c,['name',_0x5893d7])['id']},{}));}return BPromise['all'](_0x351dbe);});})['then'](respondWithResult(_0x23f371,0xc9))[_0x34e4('0x1b')](handleError(_0x23f371,null));};exports[_0x34e4('0x87')]=function(_0x1088f8,_0x18de03){if(_0x1088f8['body']['id']){delete _0x1088f8['body']['id'];}return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x1088f8[_0x34e4('0x58')]['id']}})['then'](function(_0xab582c){if(!_0xab582c)return null;if(_0xab582c['id']===_0x1088f8[_0x34e4('0x28')]['id']){if(!_0x1088f8[_0x34e4('0x57')][_0x34e4('0x88')]||!_0x1088f8['body']['newPassword']){throw new db[(_0x34e4('0x89'))][(_0x34e4('0x8a'))](_0x34e4('0x8b'));}if(!_0xab582c[_0x34e4('0x8c')](_0x1088f8['body'][_0x34e4('0x88')])){throw new db[(_0x34e4('0x89'))][(_0x34e4('0x8a'))]('Wrong\x20credentials');}if(_0x1088f8[_0x34e4('0x57')][_0x34e4('0x88')]===_0x1088f8[_0x34e4('0x57')][_0x34e4('0x8d')]){throw new db[(_0x34e4('0x89'))][(_0x34e4('0x8a'))](_0x34e4('0x8e'));}}else if(_0x1088f8['user']['role']===_0x34e4('0x77')){if(!_0x1088f8[_0x34e4('0x57')][_0x34e4('0x8d')]){throw new db[(_0x34e4('0x89'))][(_0x34e4('0x8a'))](_0x34e4('0x8f'));}}else if(_0x1088f8['user'][_0x34e4('0x26')]===_0x34e4('0x28')){if(!_0x1088f8[_0x34e4('0x57')][_0x34e4('0x8d')]){throw new db[(_0x34e4('0x89'))][(_0x34e4('0x8a'))](_0x34e4('0x8f'));}if(_0xab582c[_0x34e4('0x26')]!=='agent'){throw new db['Sequelize'][(_0x34e4('0x8a'))](_0x34e4('0x76'));}}else{throw new db['Sequelize'][(_0x34e4('0x8a'))](_0x34e4('0x76'));}return _0xab582c;})['then'](handleEntityNotFound(_0x18de03,null))[_0x34e4('0x11')](function(_0x5791ac){return db['Setting'][_0x34e4('0x90')]({'attributes':['id',_0x34e4('0x91'),_0x34e4('0x92'),'passwordHistoryLimit']})[_0x34e4('0x11')](function(_0x233da){if(_0x233da[_0x34e4('0x91')])authService[_0x34e4('0x93')](_0x1088f8[_0x34e4('0x57')][_0x34e4('0x8d')]);if(!_0x233da[_0x34e4('0x92')]||!_0x5791ac[_0x34e4('0x94')])return _0x5791ac;authService[_0x34e4('0x95')](_0x1088f8['body'][_0x34e4('0x8d')],_0x5791ac[_0x34e4('0x94')],_0x233da[_0x34e4('0x96')]);return _0x5791ac;})[_0x34e4('0x11')](saveUpdates({'password':_0x1088f8[_0x34e4('0x57')][_0x34e4('0x8d')],'passwordResetAt':_0x1088f8[_0x34e4('0x28')]['id']==_0x1088f8[_0x34e4('0x58')]['id']?moment():null,'previousPasswords':authService[_0x34e4('0x97')](_0x1088f8[_0x34e4('0x57')][_0x34e4('0x8d')],_0x5791ac[_0x34e4('0x94')])},null));})['then'](respondWithResult(_0x18de03,null))[_0x34e4('0x1b')](handleError(_0x18de03,null));};exports[_0x34e4('0x98')]=function(_0x6fc09a,_0x2e80f4){var _0x124732=_0x6fc09a[_0x34e4('0x57')]['channel'];return db[_0x34e4('0x33')]['find']({'where':{'id':_0x6fc09a[_0x34e4('0x58')]['id']},'attributes':['id','name',_0x34e4('0x26'),'online','loginInPause',_0x34e4('0x99'),_0x34e4('0x9a')]})[_0x34e4('0x11')](handleEntityNotFound(_0x2e80f4,null))[_0x34e4('0x11')](function(_0x54816b){if(_0x54816b){if(!utils[_0x34e4('0x9b')](_0x124732)){throw new db[(_0x34e4('0x89'))][(_0x34e4('0x8a'))](_0x34e4('0x9c'));}return _0x54816b[_0x34e4('0x9d')+_[_0x34e4('0x9e')](_0x124732[_0x34e4('0x9f')]())+'Queues'](_0x6fc09a[_0x34e4('0x57')]['ids'],{'penalty':_0x6fc09a[_0x34e4('0x57')][_0x34e4('0xa0')]||0x0})[_0x34e4('0xa1')](function(_0x1bc5d8){for(var _0x3b9ea4=0x0;_0x3b9ea4<_0x6fc09a[_0x34e4('0x57')][_0x34e4('0x5b')][_0x34e4('0x53')];_0x3b9ea4+=0x1){var _0x47f6fd={'UserId':Number(_0x6fc09a['params']['id'])};_0x47f6fd[_[_0x34e4('0x9e')](_0x124732[_0x34e4('0x9f')]())+'QueueId']=Number(_0x6fc09a[_0x34e4('0x57')][_0x34e4('0x5b')][_0x3b9ea4]);socket[_0x34e4('0xa2')](_0x34e4('0x28')+_['capitalize'](_0x124732[_0x34e4('0x9f')]())+_0x34e4('0xa3'),_0x47f6fd);}return _0x1bc5d8;})['then'](function(){if(_0x124732===_0x34e4('0xa4')){return db['VoiceQueue'][_0x34e4('0x82')]({'where':{'id':_0x6fc09a[_0x34e4('0x57')][_0x34e4('0x5b')]||[]},'raw':!![],'attributes':['id',_0x34e4('0x3a')]});}})[_0x34e4('0x11')](function(_0x41df3e){var _0x154deb=_0x54816b[_0x34e4('0xa5')]({'plain':!![]});var _0x28c7ed=[];if(_0x124732===_0x34e4('0xa4')&&_0x154deb[_0x34e4('0x26')]===_0x34e4('0x2a')&&_0x154deb[_0x34e4('0xa6')]){for(var _0x14a4be=0x0;_0x14a4be<_0x41df3e[_0x34e4('0x53')];_0x14a4be+=0x1){_0x28c7ed[_0x34e4('0x42')]({'membername':_0x154deb[_0x34e4('0x3a')],'UserId':_0x154deb['id'],'queue_name':_0x41df3e[_0x14a4be][_0x34e4('0x3a')],'VoiceQueueId':_0x41df3e[_0x14a4be]['id'],'interface':_[_0x34e4('0x5e')](_0x154deb[_0x34e4('0x9a')])?util[_0x34e4('0xa7')](_0x34e4('0xa8'),_0x154deb[_0x34e4('0x3a')]):_0x154deb['interface'],'paused':_0x154deb[_0x34e4('0x99')]||![],'penalty':_0x6fc09a[_0x34e4('0x57')][_0x34e4('0xa0')]||0x0});}return BPromise['each'](_0x28c7ed,function(_0x4de6ff){return db[_0x34e4('0xa9')][_0x34e4('0xaa')](_0x4de6ff);});}return _0x54816b;});}})['then'](respondWithStatusCode(_0x2e80f4,null))[_0x34e4('0x1b')](handleError(_0x2e80f4,null));};exports[_0x34e4('0xab')]=function(_0x151b6e,_0x278db7){var _0x30e1e1,_0x5e074e;return db[_0x34e4('0x33')]['find']({'where':{'id':_0x151b6e['params']['id']},'attributes':['id',_0x34e4('0x3a'),_0x34e4('0x26')]})[_0x34e4('0x11')](handleEntityNotFound(_0x278db7,null))['then'](function(_0x25fcb1){if(_0x25fcb1){_0x30e1e1=_0x25fcb1;if(!_0x151b6e[_0x34e4('0x43')][_0x34e4('0xac')]||!utils[_0x34e4('0x9b')](_0x151b6e['query'][_0x34e4('0xac')])){throw new db['Sequelize'][(_0x34e4('0x8a'))](_0x34e4('0x9c'));}return _0x25fcb1[_0x34e4('0xad')+_['capitalize'](_0x151b6e[_0x34e4('0x43')][_0x34e4('0xac')]['toLowerCase']())+_0x34e4('0xae')](_0x151b6e[_0x34e4('0x43')][_0x34e4('0x5b')]);}})[_0x34e4('0x11')](function(_0x56eef4){if(_[_0x34e4('0xaf')](_0x151b6e['query'][_0x34e4('0x5b')])){for(var _0x1ee978=0x0;_0x1ee978<_0x151b6e[_0x34e4('0x43')][_0x34e4('0x5b')]['length'];_0x1ee978+=0x1){_0x5e074e={'UserId':Number(_0x151b6e[_0x34e4('0x58')]['id'])};_0x5e074e[_['capitalize'](_0x151b6e[_0x34e4('0x43')][_0x34e4('0xac')][_0x34e4('0x9f')]())+_0x34e4('0xb0')]=Number(_0x151b6e[_0x34e4('0x43')][_0x34e4('0x5b')][_0x1ee978]);socket[_0x34e4('0xa2')]('user'+_[_0x34e4('0x9e')](_0x151b6e[_0x34e4('0x43')]['channel'][_0x34e4('0x9f')]())+_0x34e4('0xb1'),_0x5e074e);}}else{_0x5e074e={'UserId':Number(_0x151b6e[_0x34e4('0x58')]['id'])};_0x5e074e[_['capitalize'](_0x151b6e[_0x34e4('0x43')][_0x34e4('0xac')]['toLowerCase']())+_0x34e4('0xb0')]=Number(_0x151b6e[_0x34e4('0x43')][_0x34e4('0x5b')]);socket[_0x34e4('0xa2')](_0x34e4('0x28')+_['capitalize'](_0x151b6e[_0x34e4('0x43')][_0x34e4('0xac')]['toLowerCase']())+_0x34e4('0xb1'),_0x5e074e);}return _0x56eef4;})[_0x34e4('0x11')](function(){if(_0x151b6e['query']['channel']===_0x34e4('0xa4')){return db[_0x34e4('0xa9')][_0x34e4('0x25')]({'where':{'UserId':_0x151b6e[_0x34e4('0x58')]['id'],'VoiceQueueId':_0x151b6e['query'][_0x34e4('0x5b')]},'individualHooks':!![]})[_0x34e4('0x11')](function(){return _0x30e1e1;});}return _0x30e1e1;})[_0x34e4('0x11')](respondWithStatusCode(_0x278db7,null))[_0x34e4('0x1b')](handleError(_0x278db7,null));};exports[_0x34e4('0xb2')]=function(_0x2bd16b,_0x3b559f){_0x2bd16b[_0x34e4('0x57')]['userpic']=_0x2bd16b['file'][_0x34e4('0xb3')];return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x2bd16b[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x3b559f,null))[_0x34e4('0x11')](saveUpdates(_0x2bd16b[_0x34e4('0x57')],null))[_0x34e4('0x11')](respondWithResult(_0x3b559f,null))[_0x34e4('0x1b')](handleError(_0x3b559f,null));};exports['getAvatar']=function(_0x3e4d1c,_0x1e4e4b){var _0x1ae620=path[_0x34e4('0xb4')](config[_0x34e4('0xb5')],_0x34e4('0xb6'));return db[_0x34e4('0x33')]['find']({'where':{'id':_0x3e4d1c[_0x34e4('0x58')]['id']},'attributes':['id',_0x34e4('0xb7')],'raw':!![]})['then'](handleEntityNotFound(_0x1e4e4b,null))[_0x34e4('0x11')](function(_0x2ff6d3){if(_0x2ff6d3){if(_[_0x34e4('0x5e')](_0x2ff6d3[_0x34e4('0xb7')])){return _0x1e4e4b['download'](_0x1ae620);}else{if(!fs[_0x34e4('0xb8')](path[_0x34e4('0xb4')](config[_0x34e4('0xb5')],_0x34e4('0xb9'),_0x2ff6d3['userpic']))){return _0x1e4e4b[_0x34e4('0xba')](_0x1ae620);}return _0x1e4e4b[_0x34e4('0xba')](path[_0x34e4('0xb4')](config['root'],'server/files/images/',_0x2ff6d3[_0x34e4('0xb7')]));}}})[_0x34e4('0x1b')](handleError(_0x1e4e4b,null));};exports[_0x34e4('0xbb')]=function(_0x50e699,_0x4a52df){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x50e699[_0x34e4('0x58')]['id']},'attributes':['id']})[_0x34e4('0x11')](handleEntityNotFound(_0x4a52df,null))[_0x34e4('0x11')](function(_0x1744a7){var _0x71066b=[];values=_0x1744a7[_0x34e4('0x46')];_0x71066b['push'](get_open_tabs(_0x34e4('0x55'),_0x1744a7[_0x34e4('0x46')]));_0x71066b[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x47'),_0x1744a7[_0x34e4('0x46')]));_0x71066b[_0x34e4('0x42')](get_open_tabs('openchannel',_0x1744a7[_0x34e4('0x46')]));_0x71066b['push'](get_open_tabs(_0x34e4('0x4b'),_0x1744a7[_0x34e4('0x46')]));_0x71066b[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x48'),_0x1744a7[_0x34e4('0x46')]));_0x71066b[_0x34e4('0x42')](get_open_tabs(_0x34e4('0x49'),_0x1744a7[_0x34e4('0x46')]));return BPromise['all'](_0x71066b);})[_0x34e4('0x11')](function(_0xd7ddc6){if(_0xd7ddc6){var _0x5c7b2a=_[_0x34e4('0x35')](values[_0x34e4('0xbc')],function(_0x189890){return{'channel':_0x34e4('0xbd'),'id':_0x189890['id'],'createdAt':_0x189890['createdAt']};});var _0x5751e9=_['map'](values[_0x34e4('0xbe')],function(_0x1b95c1){return{'channel':_0x34e4('0xbf'),'id':_0x1b95c1['id'],'createdAt':_0x1b95c1['createdAt']};});var _0x3cce4e=_['map'](values['OpenchannelOpenTabs'],function(_0x785e6f){return{'channel':'OPENCHANNEL','id':_0x785e6f['id'],'createdAt':_0x785e6f['createdAt']};});var _0x50f66f=_[_0x34e4('0x35')](values[_0x34e4('0xc0')],function(_0x459d32){return{'channel':_0x34e4('0xc1'),'id':_0x459d32['id'],'createdAt':_0x459d32[_0x34e4('0xc2')]};});var _0x485eaf=_[_0x34e4('0x35')](values[_0x34e4('0xc3')],function(_0x146c65){return{'channel':_0x34e4('0xc4'),'id':_0x146c65['id'],'createdAt':_0x146c65['createdAt']};});var _0xca2110=_['map'](values[_0x34e4('0xc5')],function(_0x3faf3f){return{'channel':'WHATSAPP','id':_0x3faf3f['id'],'createdAt':_0x3faf3f[_0x34e4('0xc2')]};});var _0x4cea69=_['concat'](_0x5c7b2a,_0x5751e9,_0x3cce4e,_0x50f66f,_0x485eaf,_0xca2110);var _0x445c84={'count':_0x4cea69[_0x34e4('0x53')],'rows':_0x4cea69};return _0x445c84;}else return null;})[_0x34e4('0x11')](respondWithResult(_0x4a52df,null))[_0x34e4('0x1b')](handleError(_0x4a52df,null));};exports[_0x34e4('0xc6')]=function(_0x5e338c,_0x2ed9c8){var _0x100f47={};var _0x20a98b={};var _0x28dc5d;var _0xa93bd5;return db[_0x34e4('0x33')]['findOne']({'where':{'id':_0x5e338c[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x2ed9c8,null))[_0x34e4('0x11')](function(_0x4e0249){if(_0x4e0249){_0x28dc5d=_0x4e0249;_0x20a98b[_0x34e4('0x4d')]=_['keys'](db[_0x34e4('0xc7')]['rawAttributes']);_0x20a98b[_0x34e4('0x43')]=_['keys'](_0x5e338c[_0x34e4('0x43')]);_0x20a98b[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x20a98b['model'],_0x20a98b[_0x34e4('0x43')]);_0x100f47[_0x34e4('0x41')]=_['intersection'](_0x20a98b[_0x34e4('0x4d')],qs['fields'](_0x5e338c['query'][_0x34e4('0x52')]));_0x100f47['attributes']=_0x100f47[_0x34e4('0x41')]['length']?_0x100f47['attributes']:_0x20a98b[_0x34e4('0x4d')];_0x100f47[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x5e338c[_0x34e4('0x43')]['sort']);_0x100f47[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x5e338c[_0x34e4('0x43')],_0x20a98b['filters']));if(_0x5e338c[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x100f47['where']=_[_0x34e4('0xcc')](_0x100f47[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x100f47['attributes'],function(_0x50f60d){var _0x3fa135={};_0x3fa135[_0x50f60d]={'$like':'%'+_0x5e338c['query'][_0x34e4('0x2b')]+'%'};return _0x3fa135;})});}_0x100f47=_[_0x34e4('0xcc')]({},_0x100f47,_0x5e338c[_0x34e4('0xcd')]);return _0x28dc5d[_0x34e4('0xc6')](_0x100f47);}})[_0x34e4('0x11')](function(_0x21ce75){if(_0x21ce75){_0xa93bd5=_0x21ce75['length'];if(_0x5e338c[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0x3d'))){_0x100f47['include']=[{'model':db[_0x34e4('0xcf')],'as':_0x34e4('0xd0'),'required':![]},{'model':db[_0x34e4('0xd1')],'as':_0x34e4('0xd2'),'attributes':['id',_0x34e4('0x3a'),_0x34e4('0xd3')],'where':_0x5e338c[_0x34e4('0x43')][_0x34e4('0xd4')]?{'id':_0x5e338c[_0x34e4('0x43')][_0x34e4('0xd4')]}:undefined,'required':_0x5e338c['query']['tag']?!![]:![]}];}if(!_0x5e338c[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x100f47[_0x34e4('0x21')]=qs['limit'](_0x5e338c[_0x34e4('0x43')][_0x34e4('0x21')]);_0x100f47['offset']=qs[_0x34e4('0x1f')](_0x5e338c['query']['offset']);}return _0x28dc5d['getContacts'](_0x100f47);}})[_0x34e4('0x11')](function(_0x251e8d){if(_0x251e8d){return _0x251e8d?{'count':_0xa93bd5,'rows':_0x251e8d}:null;}})['then'](respondWithResult(_0x2ed9c8,null))[_0x34e4('0x1b')](handleError(_0x2ed9c8,null));};exports[_0x34e4('0xd6')]=function(_0x4d5202,_0x508259){var _0x41e835;var _0x44af98={};var _0x4d7bd7;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x4d5202['params']['id']},'attributes':['id','name','role']})[_0x34e4('0x11')](handleEntityNotFound(_0x508259,null))['then'](function(_0x20e4a0){if(!utils[_0x34e4('0x9b')](_0x4d5202[_0x34e4('0x43')][_0x34e4('0xac')])){throw new db['Sequelize'][(_0x34e4('0x8a'))](_0x34e4('0x9c'));}_0x41e835=_0x20e4a0;var _0x301acd={};_0x301acd[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_[_0x34e4('0x9e')](_0x4d5202[_0x34e4('0x43')]['channel'])+_0x34e4('0xd7')][_0x34e4('0x34')]);_0x301acd[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x4d5202['query']);_0x301acd[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x301acd[_0x34e4('0x4d')],_0x301acd[_0x34e4('0x43')]);_0x44af98[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x301acd[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x4d5202[_0x34e4('0x43')][_0x34e4('0x52')]));_0x44af98['attributes']=_0x44af98[_0x34e4('0x41')][_0x34e4('0x53')]?_0x44af98[_0x34e4('0x41')]:_0x301acd['model'];_0x44af98[_0x34e4('0xc9')]=qs['sort'](_0x4d5202[_0x34e4('0x43')]['sort']);_0x44af98[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_['pick'](_0x4d5202[_0x34e4('0x43')],_0x301acd['filters']));if(_0x4d5202[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x44af98[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x44af98[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x44af98[_0x34e4('0x41')],function(_0xb8ba6b){var _0x2fd0d4={};_0x2fd0d4[_0xb8ba6b]={'$like':'%'+_0x4d5202[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x2fd0d4;})});}_0x44af98=_[_0x34e4('0xcc')]({},_0x44af98,_0x4d5202['options']);switch(_0x41e835[_0x34e4('0x26')]){case _0x34e4('0x77'):return db[_[_0x34e4('0x9e')](_0x4d5202['query'][_0x34e4('0xac')])+_0x34e4('0xd7')][_0x34e4('0x82')](_0x44af98);case _0x34e4('0x28'):case _0x34e4('0x2a'):return _0x41e835[_0x34e4('0xa5')+_[_0x34e4('0x9e')](_0x4d5202[_0x34e4('0x43')][_0x34e4('0xac')])+_0x34e4('0xae')](_0x44af98);default:throw new db[(_0x34e4('0x89'))]['ValidationError'](_0x34e4('0xd8'));}})[_0x34e4('0x11')](function(_0x2ec914){_0x4d7bd7=_0x2ec914[_0x34e4('0x53')];if(!_0x4d5202[_0x34e4('0x43')]['hasOwnProperty'](_0x34e4('0xd5'))){_0x44af98[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x4d5202[_0x34e4('0x43')][_0x34e4('0x21')]);_0x44af98[_0x34e4('0x1f')]=qs['offset'](_0x4d5202[_0x34e4('0x43')][_0x34e4('0x1f')]);}switch(_0x41e835[_0x34e4('0x26')]){case'admin':return db[_[_0x34e4('0x9e')](_0x4d5202['query'][_0x34e4('0xac')])+_0x34e4('0xd7')][_0x34e4('0x82')](_0x44af98);case _0x34e4('0x28'):case _0x34e4('0x2a'):return _0x41e835['get'+_[_0x34e4('0x9e')](_0x4d5202['query'][_0x34e4('0xac')])+_0x34e4('0xae')](_0x44af98);}})[_0x34e4('0x11')](function(_0x41bedf){return{'count':_0x4d7bd7,'rows':_0x41bedf};})['then'](respondWithResult(_0x508259,null))[_0x34e4('0x1b')](handleError(_0x508259,null));};exports[_0x34e4('0xd9')]=function(_0x131d08,_0x3996a6){var _0x8cf12c={};var _0x1c39c9={};var _0xf7699d;var _0x32b0a3;return db[_0x34e4('0x33')]['findOne']({'where':{'id':_0x131d08[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x3996a6,null))[_0x34e4('0x11')](function(_0x4fd1bc){if(_0x4fd1bc){_0xf7699d=_0x4fd1bc;_0x1c39c9[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db['UserVoiceQueueRt'][_0x34e4('0x34')]);_0x1c39c9['query']=_[_0x34e4('0x50')](_0x131d08[_0x34e4('0x43')]);_0x1c39c9['filters']=_[_0x34e4('0x51')](_0x1c39c9[_0x34e4('0x4d')],_0x1c39c9['query']);_0x8cf12c[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x1c39c9[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x131d08[_0x34e4('0x43')][_0x34e4('0x52')]));_0x8cf12c[_0x34e4('0x41')]=_0x8cf12c[_0x34e4('0x41')][_0x34e4('0x53')]?_0x8cf12c[_0x34e4('0x41')]:_0x1c39c9[_0x34e4('0x4d')];_0x8cf12c['order']=qs[_0x34e4('0xca')](_0x131d08['query'][_0x34e4('0xca')]);_0x8cf12c[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x131d08[_0x34e4('0x43')],_0x1c39c9[_0x34e4('0xc8')]));if(_0x131d08[_0x34e4('0x43')]['filter']){_0x8cf12c['where']=_[_0x34e4('0xcc')](_0x8cf12c['where'],{'$or':_['map'](_0x8cf12c[_0x34e4('0x41')],function(_0x206609){var _0x1b938b={};_0x1b938b[_0x206609]={'$like':'%'+_0x131d08[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x1b938b;})});}_0x8cf12c=_[_0x34e4('0xcc')]({},_0x8cf12c,_0x131d08[_0x34e4('0xcd')]);return _0xf7699d[_0x34e4('0xd9')](_0x8cf12c);}})[_0x34e4('0x11')](function(_0x573dd8){if(_0x573dd8){_0x32b0a3=_0x573dd8[_0x34e4('0x53')];if(!_0x131d08[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x8cf12c[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x131d08['query']['limit']);_0x8cf12c['offset']=qs[_0x34e4('0x1f')](_0x131d08[_0x34e4('0x43')]['offset']);}return _0xf7699d['getVoiceQueuesRt'](_0x8cf12c);}})[_0x34e4('0x11')](function(_0x206bcd){if(_0x206bcd){return _0x206bcd?{'count':_0x32b0a3,'rows':_0x206bcd}:null;}})[_0x34e4('0x11')](respondWithResult(_0x3996a6,null))[_0x34e4('0x1b')](handleError(_0x3996a6,null));};exports[_0x34e4('0xda')]=function(_0x3eef0c,_0x1f92b7){var _0x279a3f={};var _0x2c377a={};var _0x989c71;var _0x5a2eed;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x3eef0c[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x1f92b7,null))[_0x34e4('0x11')](function(_0x375a86){if(_0x375a86){_0x989c71=_0x375a86;_0x2c377a['model']=_[_0x34e4('0x50')](db[_0x34e4('0xdb')][_0x34e4('0x34')]);_0x2c377a[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x3eef0c[_0x34e4('0x43')]);_0x2c377a['filters']=_['intersection'](_0x2c377a[_0x34e4('0x4d')],_0x2c377a['query']);_0x279a3f[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x2c377a['model'],qs[_0x34e4('0x52')](_0x3eef0c['query'][_0x34e4('0x52')]));_0x279a3f['attributes']=_0x279a3f[_0x34e4('0x41')][_0x34e4('0x53')]?_0x279a3f['attributes']:_0x2c377a['model'];_0x279a3f['order']=qs['sort'](_0x3eef0c[_0x34e4('0x43')]['sort']);_0x279a3f[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_['pick'](_0x3eef0c['query'],_0x2c377a[_0x34e4('0xc8')]));if(_0x3eef0c['query'][_0x34e4('0x2b')]){_0x279a3f['where']=_['merge'](_0x279a3f[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x279a3f[_0x34e4('0x41')],function(_0x23ef92){var _0x3ae1ed={};_0x3ae1ed[_0x23ef92]={'$like':'%'+_0x3eef0c['query']['filter']+'%'};return _0x3ae1ed;})});}_0x279a3f=_[_0x34e4('0xcc')]({},_0x279a3f,_0x3eef0c[_0x34e4('0xcd')]);return _0x989c71[_0x34e4('0xda')](_0x279a3f);}})['then'](function(_0x4cec3d){if(_0x4cec3d){_0x5a2eed=_0x4cec3d[_0x34e4('0x53')];if(!_0x3eef0c[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x279a3f['limit']=qs[_0x34e4('0x21')](_0x3eef0c['query'][_0x34e4('0x21')]);_0x279a3f[_0x34e4('0x1f')]=qs['offset'](_0x3eef0c[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x989c71[_0x34e4('0xda')](_0x279a3f);}})[_0x34e4('0x11')](function(_0x73863a){if(_0x73863a){return _0x73863a?{'count':_0x5a2eed,'rows':_0x73863a}:null;}})[_0x34e4('0x11')](respondWithResult(_0x1f92b7,null))[_0x34e4('0x1b')](handleError(_0x1f92b7,null));};exports[_0x34e4('0xdc')]=function(_0x5a8d85,_0x2aafb5){var _0x3168a2={'raw':!![],'where':{}};var _0x2bd1f3={};var _0x13f263={'count':0x0,'rows':[]};return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x5a8d85['params']['id']}})['then'](handleEntityNotFound(_0x2aafb5,null))[_0x34e4('0x11')](function(_0x3916c4){if(_0x3916c4){_0x2bd1f3[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0xdd')][_0x34e4('0x34')]);_0x2bd1f3[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x5a8d85[_0x34e4('0x43')]);_0x2bd1f3[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x2bd1f3[_0x34e4('0x4d')],_0x2bd1f3['query']);_0x3168a2['attributes']=_[_0x34e4('0x51')](_0x2bd1f3['model'],qs[_0x34e4('0x52')](_0x5a8d85[_0x34e4('0x43')][_0x34e4('0x52')]));_0x3168a2[_0x34e4('0x41')]=_0x3168a2['attributes']['length']?_0x3168a2[_0x34e4('0x41')]:_0x2bd1f3[_0x34e4('0x4d')];if(!_0x5a8d85[_0x34e4('0x43')][_0x34e4('0xce')]('nolimit')){_0x3168a2['limit']=qs['limit'](_0x5a8d85['query'][_0x34e4('0x21')]);_0x3168a2[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x5a8d85[_0x34e4('0x43')][_0x34e4('0x1f')]);}_0x3168a2[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x5a8d85[_0x34e4('0x43')][_0x34e4('0xca')]);_0x3168a2[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x5a8d85[_0x34e4('0x43')],_0x2bd1f3[_0x34e4('0xc8')]));_0x3168a2[_0x34e4('0x3c')][_0x34e4('0xde')]=_0x3916c4['id'];if(_0x5a8d85[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x3168a2[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x3168a2[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x3168a2[_0x34e4('0x41')],function(_0x4701b2){var _0x324a5a={};_0x324a5a[_0x4701b2]={'$like':'%'+_0x5a8d85['query'][_0x34e4('0x2b')]+'%'};return _0x324a5a;})});}_0x3168a2=_['merge']({},_0x3168a2,_0x5a8d85[_0x34e4('0xcd')]);return db[_0x34e4('0xdd')][_0x34e4('0x22')]({'where':_0x3168a2[_0x34e4('0x3c')]})[_0x34e4('0x11')](function(_0x22345f){_0x13f263[_0x34e4('0x22')]=_0x22345f;if(_0x5a8d85[_0x34e4('0x43')][_0x34e4('0x3d')]){_0x3168a2[_0x34e4('0x3e')]=[{'all':!![]}];}return db[_0x34e4('0xdd')][_0x34e4('0x82')](_0x3168a2);})[_0x34e4('0x11')](function(_0x261fd4){_0x13f263['rows']=_0x261fd4;return _0x13f263;});}})['then'](respondWithFilteredResult(_0x2aafb5,_0x3168a2))['catch'](handleError(_0x2aafb5,null));};exports[_0x34e4('0xdf')]=function(_0x1f4ac5,_0x54a5c7){var _0x97e497={'raw':!![],'where':{}};var _0x1b840b={};var _0xbe51fd={'count':0x0,'rows':[]};return db['User'][_0x34e4('0x90')]({'where':{'id':_0x1f4ac5[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x54a5c7,null))['then'](function(_0x4a3ab7){if(_0x4a3ab7){_0x1b840b[_0x34e4('0x4d')]=_['keys'](db['ScreenRecording'][_0x34e4('0x34')]);_0x1b840b[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x1f4ac5[_0x34e4('0x43')]);_0x1b840b[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x1b840b['model'],_0x1b840b[_0x34e4('0x43')]);_0x97e497[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x1b840b[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x1f4ac5['query'][_0x34e4('0x52')]));_0x97e497[_0x34e4('0x41')]=_0x97e497[_0x34e4('0x41')][_0x34e4('0x53')]?_0x97e497['attributes']:_0x1b840b[_0x34e4('0x4d')];if(!_0x1f4ac5[_0x34e4('0x43')]['hasOwnProperty'](_0x34e4('0xd5'))){_0x97e497['limit']=qs[_0x34e4('0x21')](_0x1f4ac5[_0x34e4('0x43')][_0x34e4('0x21')]);_0x97e497[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x1f4ac5[_0x34e4('0x43')][_0x34e4('0x1f')]);}_0x97e497[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x1f4ac5[_0x34e4('0x43')][_0x34e4('0xca')]);_0x97e497[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x1f4ac5[_0x34e4('0x43')],_0x1b840b[_0x34e4('0xc8')]));_0x97e497[_0x34e4('0x3c')]['UserId']=_0x4a3ab7['id'];if(_0x1f4ac5[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x97e497[_0x34e4('0x3c')]=_['merge'](_0x97e497[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x97e497['attributes'],function(_0x58976a){var _0x44602a={};_0x44602a[_0x58976a]={'$like':'%'+_0x1f4ac5[_0x34e4('0x43')]['filter']+'%'};return _0x44602a;})});}_0x97e497=_['merge']({},_0x97e497,_0x1f4ac5[_0x34e4('0xcd')]);return db[_0x34e4('0xe0')]['count']({'where':_0x97e497[_0x34e4('0x3c')]})['then'](function(_0x4aff2b){_0xbe51fd['count']=_0x4aff2b;if(_0x1f4ac5[_0x34e4('0x43')][_0x34e4('0x3d')]){_0x97e497['include']=[{'all':!![]}];}return db[_0x34e4('0xe0')]['findAll'](_0x97e497);})[_0x34e4('0x11')](function(_0x4eb818){_0xbe51fd[_0x34e4('0x45')]=_0x4eb818;return _0xbe51fd;});}})['then'](respondWithFilteredResult(_0x54a5c7,_0x97e497))[_0x34e4('0x1b')](handleError(_0x54a5c7,null));};exports[_0x34e4('0xe1')]=function(_0x448234,_0x15af66){var _0x3702f7={};var _0x477c1f={};var _0x22d693;var _0x50e221;return db[_0x34e4('0x33')]['findOne']({'where':{'id':_0x448234['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x15af66,null))[_0x34e4('0x11')](function(_0x138fdf){if(_0x138fdf){_0x22d693=_0x138fdf;_0x477c1f[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0xe2')][_0x34e4('0x34')]);_0x477c1f[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x448234['query']);_0x477c1f[_0x34e4('0xc8')]=_['intersection'](_0x477c1f[_0x34e4('0x4d')],_0x477c1f[_0x34e4('0x43')]);_0x3702f7['attributes']=_[_0x34e4('0x51')](_0x477c1f[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x448234[_0x34e4('0x43')]['fields']));_0x3702f7['attributes']=_0x3702f7[_0x34e4('0x41')]['length']?_0x3702f7[_0x34e4('0x41')]:_0x477c1f[_0x34e4('0x4d')];_0x3702f7[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x448234[_0x34e4('0x43')][_0x34e4('0xca')]);_0x3702f7[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x448234[_0x34e4('0x43')],_0x477c1f[_0x34e4('0xc8')]));if(_0x448234[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x3702f7[_0x34e4('0x3c')]=_['merge'](_0x3702f7[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x3702f7['attributes'],function(_0x44af78){var _0x50379a={};_0x50379a[_0x44af78]={'$like':'%'+_0x448234[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x50379a;})});}_0x3702f7=_[_0x34e4('0xcc')]({},_0x3702f7,_0x448234[_0x34e4('0xcd')]);return _0x22d693[_0x34e4('0xe1')](_0x3702f7);}})[_0x34e4('0x11')](function(_0x3b7840){if(_0x3b7840){_0x50e221=_0x3b7840[_0x34e4('0x53')];if(!_0x448234[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x3702f7[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x448234['query']['limit']);_0x3702f7['offset']=qs['offset'](_0x448234[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x22d693['getChatInteractions'](_0x3702f7);}})[_0x34e4('0x11')](function(_0x201234){if(_0x201234){return _0x201234?{'count':_0x50e221,'rows':_0x201234}:null;}})[_0x34e4('0x11')](respondWithResult(_0x15af66,null))[_0x34e4('0x1b')](handleError(_0x15af66,null));};exports[_0x34e4('0xe3')]=function(_0x889be9,_0x417a27){var _0x31f470={};var _0x4f1908={};var _0x33b2f7;var _0x3cc63c;return db['User'][_0x34e4('0x90')]({'where':{'id':_0x889be9[_0x34e4('0x58')]['id']}})['then'](handleEntityNotFound(_0x417a27,null))[_0x34e4('0x11')](function(_0x323d5a){if(_0x323d5a){_0x33b2f7=_0x323d5a;_0x4f1908['model']=_[_0x34e4('0x50')](db[_0x34e4('0xe4')][_0x34e4('0x34')]);_0x4f1908[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x889be9['query']);_0x4f1908[_0x34e4('0xc8')]=_['intersection'](_0x4f1908[_0x34e4('0x4d')],_0x4f1908['query']);_0x31f470[_0x34e4('0x41')]=_['intersection'](_0x4f1908[_0x34e4('0x4d')],qs['fields'](_0x889be9[_0x34e4('0x43')]['fields']));_0x31f470['attributes']=_0x31f470['attributes']['length']?_0x31f470[_0x34e4('0x41')]:_0x4f1908[_0x34e4('0x4d')];_0x31f470[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x889be9[_0x34e4('0x43')][_0x34e4('0xca')]);_0x31f470[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x889be9[_0x34e4('0x43')],_0x4f1908[_0x34e4('0xc8')]));if(_0x889be9[_0x34e4('0x43')]['filter']){_0x31f470['where']=_[_0x34e4('0xcc')](_0x31f470[_0x34e4('0x3c')],{'$or':_['map'](_0x31f470[_0x34e4('0x41')],function(_0x1b1249){var _0x132694={};_0x132694[_0x1b1249]={'$like':'%'+_0x889be9[_0x34e4('0x43')]['filter']+'%'};return _0x132694;})});}_0x31f470=_[_0x34e4('0xcc')]({},_0x31f470,_0x889be9[_0x34e4('0xcd')]);return _0x33b2f7[_0x34e4('0xe3')](_0x31f470);}})[_0x34e4('0x11')](function(_0xafcb97){if(_0xafcb97){_0x3cc63c=_0xafcb97['length'];if(!_0x889be9[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x31f470[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x889be9[_0x34e4('0x43')][_0x34e4('0x21')]);_0x31f470[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x889be9[_0x34e4('0x43')]['offset']);}return _0x33b2f7[_0x34e4('0xe3')](_0x31f470);}})[_0x34e4('0x11')](function(_0x1c045f){if(_0x1c045f){return _0x1c045f?{'count':_0x3cc63c,'rows':_0x1c045f}:null;}})[_0x34e4('0x11')](respondWithResult(_0x417a27,null))[_0x34e4('0x1b')](handleError(_0x417a27,null));};exports[_0x34e4('0xe5')]=function(_0x360cac,_0x21bd09){var _0x16ce80={'raw':!![],'where':{}};var _0x5d2bbe={};var _0x54e9db={'count':0x0,'rows':[]};return db[_0x34e4('0x33')]['findOne']({'where':{'id':_0x360cac['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x21bd09,null))[_0x34e4('0x11')](function(_0x4a5784){if(_0x4a5784){_0x5d2bbe[_0x34e4('0x4d')]=_['keys'](db['MailInteraction'][_0x34e4('0x34')]);_0x5d2bbe[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x360cac[_0x34e4('0x43')]);_0x5d2bbe[_0x34e4('0xc8')]=_['intersection'](_0x5d2bbe[_0x34e4('0x4d')],_0x5d2bbe[_0x34e4('0x43')]);_0x16ce80[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x5d2bbe[_0x34e4('0x4d')],qs['fields'](_0x360cac[_0x34e4('0x43')][_0x34e4('0x52')]));_0x16ce80['attributes']=_0x16ce80[_0x34e4('0x41')][_0x34e4('0x53')]?_0x16ce80[_0x34e4('0x41')]:_0x5d2bbe[_0x34e4('0x4d')];if(!_0x360cac[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x16ce80[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x360cac[_0x34e4('0x43')][_0x34e4('0x21')]);_0x16ce80['offset']=qs[_0x34e4('0x1f')](_0x360cac[_0x34e4('0x43')][_0x34e4('0x1f')]);}_0x16ce80[_0x34e4('0xc9')]=qs['sort'](_0x360cac[_0x34e4('0x43')][_0x34e4('0xca')]);_0x16ce80[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x360cac[_0x34e4('0x43')],_0x5d2bbe[_0x34e4('0xc8')]));_0x16ce80[_0x34e4('0x3c')][_0x34e4('0xde')]=_0x4a5784['id'];if(_0x360cac[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x16ce80[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x16ce80['where'],{'$or':_[_0x34e4('0x35')](_0x16ce80[_0x34e4('0x41')],function(_0x130263){var _0x306616={};_0x306616[_0x130263]={'$like':'%'+_0x360cac[_0x34e4('0x43')]['filter']+'%'};return _0x306616;})});}_0x16ce80=_['merge']({},_0x16ce80,_0x360cac[_0x34e4('0xcd')]);return db[_0x34e4('0xe6')]['count']({'where':_0x16ce80[_0x34e4('0x3c')]})[_0x34e4('0x11')](function(_0x3761a3){_0x54e9db[_0x34e4('0x22')]=_0x3761a3;if(_0x360cac[_0x34e4('0x43')][_0x34e4('0x3d')]){_0x16ce80[_0x34e4('0x3e')]=[{'all':!![]}];}return db[_0x34e4('0xe6')]['findAll'](_0x16ce80);})[_0x34e4('0x11')](function(_0x33c4a4){_0x54e9db[_0x34e4('0x45')]=_0x33c4a4;return _0x54e9db;});}})[_0x34e4('0x11')](respondWithFilteredResult(_0x21bd09,_0x16ce80))['catch'](handleError(_0x21bd09,null));};exports[_0x34e4('0xe7')]=function(_0x3e26c9,_0x1f1ae1){var _0x619d78={};var _0x3c9a30={};var _0x5e132a;var _0x2d1f32;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x3e26c9['params']['id']}})['then'](handleEntityNotFound(_0x1f1ae1,null))[_0x34e4('0x11')](function(_0x40938a){if(_0x40938a){_0x5e132a=_0x40938a;_0x3c9a30['model']=_[_0x34e4('0x50')](db[_0x34e4('0xe8')]['rawAttributes']);_0x3c9a30[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x3e26c9['query']);_0x3c9a30[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x3c9a30[_0x34e4('0x4d')],_0x3c9a30[_0x34e4('0x43')]);_0x619d78[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x3c9a30[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x3e26c9[_0x34e4('0x43')][_0x34e4('0x52')]));_0x619d78[_0x34e4('0x41')]=_0x619d78[_0x34e4('0x41')]['length']?_0x619d78[_0x34e4('0x41')]:_0x3c9a30[_0x34e4('0x4d')];_0x619d78[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x3e26c9[_0x34e4('0x43')][_0x34e4('0xca')]);_0x619d78[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x3e26c9[_0x34e4('0x43')],_0x3c9a30[_0x34e4('0xc8')]));if(_0x3e26c9[_0x34e4('0x43')]['filter']){_0x619d78['where']=_[_0x34e4('0xcc')](_0x619d78[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x619d78[_0x34e4('0x41')],function(_0x55cf74){var _0x2d4a48={};_0x2d4a48[_0x55cf74]={'$like':'%'+_0x3e26c9['query'][_0x34e4('0x2b')]+'%'};return _0x2d4a48;})});}_0x619d78=_[_0x34e4('0xcc')]({},_0x619d78,_0x3e26c9[_0x34e4('0xcd')]);return _0x5e132a[_0x34e4('0xe7')](_0x619d78);}})['then'](function(_0x490ac5){if(_0x490ac5){_0x2d1f32=_0x490ac5['length'];if(!_0x3e26c9[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x619d78[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x3e26c9['query'][_0x34e4('0x21')]);_0x619d78[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x3e26c9['query']['offset']);}return _0x5e132a[_0x34e4('0xe7')](_0x619d78);}})[_0x34e4('0x11')](function(_0x2d8706){if(_0x2d8706){return _0x2d8706?{'count':_0x2d1f32,'rows':_0x2d8706}:null;}})['then'](respondWithResult(_0x1f1ae1,null))[_0x34e4('0x1b')](handleError(_0x1f1ae1,null));};exports['getFaxInteractions']=function(_0x4f42cc,_0x3eb09c){var _0x58dd0a={};var _0x40bc88={};var _0x53edad;var _0x3f0c45;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x4f42cc[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x3eb09c,null))[_0x34e4('0x11')](function(_0x24a1b0){if(_0x24a1b0){_0x53edad=_0x24a1b0;_0x40bc88[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0xe9')][_0x34e4('0x34')]);_0x40bc88[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x4f42cc[_0x34e4('0x43')]);_0x40bc88[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x40bc88[_0x34e4('0x4d')],_0x40bc88[_0x34e4('0x43')]);_0x58dd0a['attributes']=_[_0x34e4('0x51')](_0x40bc88['model'],qs[_0x34e4('0x52')](_0x4f42cc[_0x34e4('0x43')][_0x34e4('0x52')]));_0x58dd0a[_0x34e4('0x41')]=_0x58dd0a['attributes'][_0x34e4('0x53')]?_0x58dd0a['attributes']:_0x40bc88[_0x34e4('0x4d')];_0x58dd0a['order']=qs[_0x34e4('0xca')](_0x4f42cc[_0x34e4('0x43')][_0x34e4('0xca')]);_0x58dd0a[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_['pick'](_0x4f42cc[_0x34e4('0x43')],_0x40bc88['filters']));if(_0x4f42cc['query'][_0x34e4('0x2b')]){_0x58dd0a[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x58dd0a['where'],{'$or':_[_0x34e4('0x35')](_0x58dd0a[_0x34e4('0x41')],function(_0x3685fd){var _0x35eaa6={};_0x35eaa6[_0x3685fd]={'$like':'%'+_0x4f42cc[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x35eaa6;})});}_0x58dd0a=_['merge']({},_0x58dd0a,_0x4f42cc[_0x34e4('0xcd')]);return _0x53edad['getFaxInteractions'](_0x58dd0a);}})['then'](function(_0x216711){if(_0x216711){_0x3f0c45=_0x216711['length'];if(!_0x4f42cc[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x58dd0a[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x4f42cc[_0x34e4('0x43')][_0x34e4('0x21')]);_0x58dd0a[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x4f42cc['query'][_0x34e4('0x1f')]);}return _0x53edad[_0x34e4('0xea')](_0x58dd0a);}})[_0x34e4('0x11')](function(_0x241a9c){if(_0x241a9c){return _0x241a9c?{'count':_0x3f0c45,'rows':_0x241a9c}:null;}})['then'](respondWithResult(_0x3eb09c,null))['catch'](handleError(_0x3eb09c,null));};exports['getWhatsappInteractions']=function(_0x1e04ec,_0xec8134){var _0x301982={};var _0x1a08de={};var _0x555d73;var _0x5d8405;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x1e04ec['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0xec8134,null))[_0x34e4('0x11')](function(_0x111d10){if(_0x111d10){_0x555d73=_0x111d10;_0x1a08de[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db['WhatsappInteraction'][_0x34e4('0x34')]);_0x1a08de[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x1e04ec['query']);_0x1a08de[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x1a08de[_0x34e4('0x4d')],_0x1a08de['query']);_0x301982[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x1a08de[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x1e04ec[_0x34e4('0x43')][_0x34e4('0x52')]));_0x301982['attributes']=_0x301982[_0x34e4('0x41')][_0x34e4('0x53')]?_0x301982[_0x34e4('0x41')]:_0x1a08de['model'];_0x301982[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x1e04ec[_0x34e4('0x43')]['sort']);_0x301982[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x1e04ec[_0x34e4('0x43')],_0x1a08de[_0x34e4('0xc8')]));if(_0x1e04ec[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x301982['where']=_[_0x34e4('0xcc')](_0x301982[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x301982[_0x34e4('0x41')],function(_0x147cd1){var _0x42d0a2={};_0x42d0a2[_0x147cd1]={'$like':'%'+_0x1e04ec[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x42d0a2;})});}_0x301982=_['merge']({},_0x301982,_0x1e04ec[_0x34e4('0xcd')]);return _0x555d73[_0x34e4('0xeb')](_0x301982);}})[_0x34e4('0x11')](function(_0x278b1e){if(_0x278b1e){_0x5d8405=_0x278b1e[_0x34e4('0x53')];if(!_0x1e04ec[_0x34e4('0x43')]['hasOwnProperty'](_0x34e4('0xd5'))){_0x301982[_0x34e4('0x21')]=qs['limit'](_0x1e04ec[_0x34e4('0x43')][_0x34e4('0x21')]);_0x301982[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x1e04ec[_0x34e4('0x43')]['offset']);}return _0x555d73[_0x34e4('0xeb')](_0x301982);}})[_0x34e4('0x11')](function(_0x163009){if(_0x163009){return _0x163009?{'count':_0x5d8405,'rows':_0x163009}:null;}})[_0x34e4('0x11')](respondWithResult(_0xec8134,null))['catch'](handleError(_0xec8134,null));};exports[_0x34e4('0xec')]=function(_0x121f7b,_0x433513,_0x3098a0){var _0x1942a9;var _0x26659e;var _0x2fdae9;var _0x3c74b1=!_[_0x34e4('0x5e')](_0x121f7b[_0x34e4('0x58')]['id'])?_0x121f7b['params']['id']:!_['isNil'](_0x121f7b['user']['id'])?_0x121f7b[_0x34e4('0x28')]['id']:null;return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x3c74b1,'role':{'$or':['admin',_0x34e4('0x28'),_0x34e4('0x2a')]}},'attributes':['id',_0x34e4('0x3a'),_0x34e4('0xed'),_0x34e4('0xee'),'role',_0x34e4('0x5c'),'loginInPause']})[_0x34e4('0x11')](function(_0xc8342b){if(_0xc8342b){if(_0xc8342b[_0x34e4('0x26')]==='agent'){_0x1942a9=_0xc8342b;if(_0x121f7b['body']['interface']){_0x2fdae9=util['format'](_0x34e4('0xef'),_0x1942a9[_0x121f7b[_0x34e4('0x57')][_0x34e4('0x9a')]]);}else if(_0x121f7b[_0x34e4('0x57')][_0x34e4('0xf0')]){_0x2fdae9=util[_0x34e4('0xa7')](_0x34e4('0xa8'),_0x121f7b['body'][_0x34e4('0xf0')]);}else{_0x2fdae9=util[_0x34e4('0xa7')](_0x34e4('0xa8'),_0x1942a9['name']);}socket['to'](util['format'](_0x34e4('0xf1'),_0x1942a9[_0x34e4('0x3a')]))['emit']('user:forcelogout',{'user':{'id':_0x1942a9['id'],'name':_0x1942a9['name']},'ip':_0x121f7b[_0x34e4('0xf2')][_0x34e4('0xf3')]||_0x121f7b[_0x34e4('0xf4')][_0x34e4('0xf5')]||_0x121f7b['socket']['remoteAddress']||_0x121f7b[_0x34e4('0xf4')]['socket']['remoteAddress']});return db['UserVoiceQueueRt'][_0x34e4('0x25')]({'where':{'membername':_0x1942a9['name']},'individualHooks':!![]});}}else{throw new db[(_0x34e4('0x89'))][(_0x34e4('0x8a'))](_0x34e4('0xf6'));}})[_0x34e4('0x11')](function(){if(_0x1942a9){return _0x1942a9[_0x34e4('0xf7')]({'raw':!![]});}})[_0x34e4('0x11')](function(_0x52acfc){if(_0x1942a9){var _0x381327=[];if(_0x52acfc){_0x26659e=_0x52acfc;if(_0x26659e[_0x34e4('0x53')]){for(var _0x5d8954=0x0;_0x5d8954<_0x26659e[_0x34e4('0x53')];_0x5d8954++){_0x381327[_0x34e4('0x42')]({'membername':_0x1942a9[_0x34e4('0x3a')],'UserId':_0x1942a9['id'],'queue_name':_0x26659e[_0x5d8954][_0x34e4('0x3a')],'VoiceQueueId':_0x26659e[_0x5d8954]['id'],'interface':_0x2fdae9,'paused':_0x1942a9[_0x34e4('0xf8')]||![],'penalty':_0x26659e[_0x5d8954]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x381327,function(_0x3c67f8){return db[_0x34e4('0xa9')][_0x34e4('0xaa')](_0x3c67f8);});}}}})['then'](function(){if(_0x1942a9){return db[_0x34e4('0xf9')][_0x34e4('0x82')]({'where':{'membername':_0x1942a9[_0x34e4('0x3a')],'exitAt':null}});}})[_0x34e4('0x11')](function(_0x320377){if(_0x1942a9){var _0x425276=[];_0x320377[_0x34e4('0xfa')](function(_0x364953){_0x425276[_0x34e4('0x42')](_0x364953['update']({'exitAt':moment()[_0x34e4('0xa7')](_0x34e4('0xfb'))}));});return BPromise[_0x34e4('0x4c')](_0x425276);}})[_0x34e4('0x11')](function(){if(_0x1942a9){var _0xd6a87b=[];var _0x1e1b35=[];var _0x2cd7b6=utils['getChannels']();var _0x29c7f0={'membername':_0x1942a9[_0x34e4('0x3a')],'interface':_0x2fdae9,'enterAt':moment()[_0x34e4('0xa7')](_0x34e4('0xfb')),'role':_0x1942a9[_0x34e4('0x26')],'internal':_0x1942a9['internal']};_0x2cd7b6[_0x34e4('0xfa')](function(_0xe69650){_0xd6a87b[_0x34e4('0x42')](_['merge']({'channel':_0xe69650,'type':_0x34e4('0xfc'),'data1':_0x121f7b['body']['device'],'data2':_0x2fdae9},_0x29c7f0));if(_0x1942a9[_0x34e4('0xf8')]){_0x1e1b35['push'](_[_0x34e4('0xcc')]({'channel':_0xe69650,'type':_0x34e4('0xfd'),'data1':_0x34e4('0xfe')},_0x29c7f0));}});return db['MemberReport'][_0x34e4('0xff')](_0xd6a87b[_0x34e4('0x100')](_0x1e1b35),{'individualHooks':!![]});}})[_0x34e4('0x11')](function(){if(_0x1942a9){return _0x1942a9['update']({'online':!![],'lastLoginAt':moment()[_0x34e4('0xa7')](_0x34e4('0xfb')),'voicePause':_0x1942a9[_0x34e4('0xf8')]||![],'mailPause':_0x1942a9['loginInPause']||![],'chatPause':_0x1942a9[_0x34e4('0xf8')]||![],'faxPause':_0x1942a9[_0x34e4('0xf8')]||![],'smsPause':_0x1942a9[_0x34e4('0xf8')]||![],'openchannelPause':_0x1942a9[_0x34e4('0xf8')]||![],'whatsappPause':_0x1942a9['loginInPause']||![],'pauseType':_0x1942a9[_0x34e4('0xf8')]?_0x34e4('0xfe'):null,'interface':_0x2fdae9,'lastPauseAt':moment()[_0x34e4('0xa7')](_0x34e4('0xfb'))});}})['then'](function(_0x3889de){if(_0x121f7b[_0x34e4('0x101')]){return _0x3098a0();}else{return BPromise[_0x34e4('0x102')](_0x3889de)[_0x34e4('0x11')](respondWithResult(_0x433513,null));}})[_0x34e4('0x1b')](handleError(_0x433513,null));};exports['logout']=function(_0xafde03,_0x68c9b8){var _0xbdeca7;return db['User'][_0x34e4('0x2d')]({'where':{'id':_0xafde03[_0x34e4('0x58')]['id'],'role':_0x34e4('0x2a')},'attributes':['id','name',_0x34e4('0x26')]})[_0x34e4('0x11')](handleEntityNotFound(_0x68c9b8,null))[_0x34e4('0x11')](function(_0x2e64de){if(_0x2e64de){_0xbdeca7=_0x2e64de;return db[_0x34e4('0xa9')][_0x34e4('0x25')]({'where':{'membername':_0xbdeca7[_0x34e4('0x3a')]},'individualHooks':!![]});}})['then'](function(){return db[_0x34e4('0xf9')][_0x34e4('0x82')]({'where':{'membername':_0xbdeca7[_0x34e4('0x3a')],'exitAt':null}});})[_0x34e4('0x11')](function(_0x500137){var _0xd40afd=[];_0x500137[_0x34e4('0xfa')](function(_0x1e876d){_0xd40afd[_0x34e4('0x42')](_0x1e876d[_0x34e4('0x56')]({'exitAt':moment()['format'](_0x34e4('0xfb'))}));});return BPromise[_0x34e4('0x4c')](_0xd40afd);})['then'](function(){return _0xbdeca7[_0x34e4('0x56')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x34e4('0x11')](respondWithResult(_0x68c9b8,null))[_0x34e4('0x1b')](handleError(_0x68c9b8,null));};exports[_0x34e4('0x103')]=function(_0x3d4029,_0x1135d2){var _0x378abd;return db[_0x34e4('0xa9')][_0x34e4('0x56')]({'paused':0x1},{'where':{'UserId':_0x3d4029[_0x34e4('0x58')]['id']},'individualHooks':!![]})[_0x34e4('0x11')](function(){return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x3d4029[_0x34e4('0x58')]['id'],'role':_0x34e4('0x2a')},'attributes':['id','name','role',_0x34e4('0x5c'),_0x34e4('0x9a')]});})['then'](handleEntityNotFound(_0x1135d2,null))[_0x34e4('0x11')](function(_0x513806){if(_0x513806){_0x378abd=_0x513806;return respondWithRpcPromise(_0x34e4('0x104'),_0x34e4('0x103'),{'id':_0x378abd['id'],'name':_0x378abd['name'],'pause':!![]});}})[_0x34e4('0x11')](function(){if(_0x378abd){return db['MemberReport'][_0x34e4('0x82')]({'where':{'membername':_0x378abd[_0x34e4('0x3a')],'type':_0x34e4('0xfd'),'exitAt':null}});}})[_0x34e4('0x11')](function(_0x54000f){if(_0x54000f[_0x34e4('0x53')]){var _0x524b5b=moment()['format'](_0x34e4('0xfb'));for(var _0x14cca7=0x0,_0x3b6c02=_0x54000f[_0x34e4('0x53')];_0x14cca7<_0x3b6c02;_0x14cca7++){_0x54000f[_0x14cca7]['updateAttributes']({'exitAt':_0x524b5b});}}})[_0x34e4('0x11')](function(){var _0x4e5132=[];var _0x59e64f=utils['getChannels']();_0x59e64f[_0x34e4('0xfa')](function(_0x25b0d5){_0x4e5132['push']({'channel':_0x25b0d5,'membername':_0x378abd['name'],'interface':_[_0x34e4('0x5e')](_0x378abd[_0x34e4('0x9a')])?util[_0x34e4('0xa7')](_0x34e4('0xa8'),_0x378abd[_0x34e4('0x3a')]):_0x378abd[_0x34e4('0x9a')],'type':'PAUSE','enterAt':moment()[_0x34e4('0xa7')](_0x34e4('0xfb')),'data1':_0x3d4029[_0x34e4('0x57')][_0x34e4('0x105')]||'DEFAULT\x20PAUSE','role':_0x378abd[_0x34e4('0x26')],'internal':_0x378abd[_0x34e4('0x5c')]});});return db[_0x34e4('0xf9')]['bulkCreate'](_0x4e5132,{'individualHooks':!![]});})[_0x34e4('0x11')](function(){return _0x378abd[_0x34e4('0x56')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3d4029[_0x34e4('0x57')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x34e4('0xa7')](_0x34e4('0xfb'))});})['then'](respondWithResult(_0x1135d2,null))['catch'](handleError(_0x1135d2,null));};exports[_0x34e4('0x106')]=function(_0x507e32,_0x9dad7e){var _0x36e434;return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x507e32[_0x34e4('0x58')]['id']},'attributes':['id',_0x34e4('0x3a'),'role',_0x34e4('0x99'),_0x34e4('0x107'),_0x34e4('0x108'),_0x34e4('0x109'),_0x34e4('0x10a'),_0x34e4('0x10b'),'whatsapppause',_0x34e4('0x10c'),'lastPauseAt']})[_0x34e4('0x11')](handleEntityNotFound(_0x9dad7e,null))[_0x34e4('0x11')](function(_0x23e3bd){if(_0x23e3bd){_0x36e434=_0x23e3bd;if(_0x507e32['body'][_0x34e4('0xac')]&&!utils['isValidChannel'](_0x507e32[_0x34e4('0x57')]['channel'])){throw new db[(_0x34e4('0x89'))][(_0x34e4('0x8a'))](_0x34e4('0x9c'));}switch(_0x507e32[_0x34e4('0x57')]['channel']){case _0x34e4('0xa4'):return respondWithRpcPromise(_0x34e4('0x104'),_0x34e4('0x106'),{'id':_0x36e434['id'],'name':_0x36e434[_0x34e4('0x3a')],'pause':![]})[_0x34e4('0x11')](function(){return db[_0x34e4('0xa9')][_0x34e4('0x56')]({'paused':0x0},{'where':{'UserId':_0x36e434['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0x34e4('0x2d')]({'where':{'channel':_0x507e32[_0x34e4('0x57')][_0x34e4('0xac')],'membername':_0x36e434[_0x34e4('0x3a')],'type':_0x34e4('0xfd'),'exitAt':null}});})[_0x34e4('0x11')](function(_0x22e5e8){if(_0x22e5e8){return _0x22e5e8[_0x34e4('0x56')]({'exitAt':moment()['format'](_0x34e4('0xfb')),'data2':_0x34e4('0x10d')},{'individualHooks':!![]});}return null;})[_0x34e4('0x11')](function(){return _0x36e434[_0x34e4('0x56')]({'voicePause':![]});});case _0x34e4('0x49'):case'chat':case'fax':case'sms':case _0x34e4('0x4b'):case _0x34e4('0x4a'):return db['MemberReport'][_0x34e4('0x2d')]({'where':{'channel':_0x507e32[_0x34e4('0x57')]['channel'],'membername':_0x36e434[_0x34e4('0x3a')],'type':_0x34e4('0xfd'),'exitAt':null}})[_0x34e4('0x11')](function(_0x3b6888){if(_0x3b6888){return _0x3b6888['update']({'exitAt':moment()[_0x34e4('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x34e4('0x10d')},{'individualHooks':!![]});}return null;})[_0x34e4('0x11')](function(){var _0x445f54={};_[_0x34e4('0x23')](_0x445f54,util['format']('%s%s',_0x507e32['body'][_0x34e4('0xac')],_0x34e4('0x10e')),![]);return _0x36e434[_0x34e4('0x56')](_0x445f54);});default:return respondWithRpcPromise(_0x34e4('0x104'),_0x34e4('0x106'),{'id':_0x36e434['id'],'name':_0x36e434[_0x34e4('0x3a')],'pause':![]})[_0x34e4('0x11')](function(){return db[_0x34e4('0xa9')][_0x34e4('0x56')]({'paused':0x0},{'where':{'UserId':_0x36e434['id']}});})[_0x34e4('0x11')](function(){return db[_0x34e4('0xf9')][_0x34e4('0x82')]({'where':{'membername':_0x36e434['name'],'type':_0x34e4('0xfd'),'exitAt':null}});})['then'](function(_0x5cd155){var _0x4ca471=[];_0x5cd155[_0x34e4('0xfa')](function(_0x331d95){_0x4ca471[_0x34e4('0x42')](_0x331d95['update']({'exitAt':moment()[_0x34e4('0xa7')](_0x34e4('0xfb')),'data2':_0x34e4('0x10d')}));});return BPromise['all'](_0x4ca471);})['then'](function(){return _0x36e434[_0x34e4('0x56')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x34e4('0x11')](respondWithResult(_0x9dad7e,null))['catch'](handleError(_0x9dad7e,null));};exports[_0x34e4('0x10f')]=function(_0x275044,_0x54558b){var _0x380ce7={};var _0x135b58={};var _0x127a89;var _0x326455;return db['User'][_0x34e4('0x90')]({'where':{'id':_0x275044[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x54558b,null))['then'](function(_0x863719){if(_0x863719){_0x127a89=_0x863719;_0x135b58[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0x110')][_0x34e4('0x34')]);_0x135b58[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x275044[_0x34e4('0x43')]);_0x135b58['filters']=_[_0x34e4('0x51')](_0x135b58[_0x34e4('0x4d')],_0x135b58[_0x34e4('0x43')]);_0x380ce7[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x135b58[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x275044[_0x34e4('0x43')][_0x34e4('0x52')]));_0x380ce7[_0x34e4('0x41')]=_0x380ce7[_0x34e4('0x41')]['length']?_0x380ce7[_0x34e4('0x41')]:_0x135b58[_0x34e4('0x4d')];_0x380ce7[_0x34e4('0xc9')]=qs['sort'](_0x275044[_0x34e4('0x43')]['sort']);_0x380ce7[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x275044[_0x34e4('0x43')],_0x135b58['filters']));if(_0x275044[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x380ce7[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x380ce7[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x380ce7['attributes'],function(_0x5e07bc){var _0x20f65a={};_0x20f65a[_0x5e07bc]={'$like':'%'+_0x275044[_0x34e4('0x43')]['filter']+'%'};return _0x20f65a;})});}_0x380ce7=_['merge']({},_0x380ce7,_0x275044[_0x34e4('0xcd')]);return _0x127a89['getTeams'](_0x380ce7);}})[_0x34e4('0x11')](function(_0xbfbc08){if(_0xbfbc08){_0x326455=_0xbfbc08[_0x34e4('0x53')];if(!_0x275044['query'][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x380ce7[_0x34e4('0x21')]=qs['limit'](_0x275044[_0x34e4('0x43')][_0x34e4('0x21')]);_0x380ce7[_0x34e4('0x1f')]=qs['offset'](_0x275044[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x127a89[_0x34e4('0x10f')](_0x380ce7);}})['then'](function(_0x5d5bc9){if(_0x5d5bc9){return _0x5d5bc9?{'count':_0x326455,'rows':_0x5d5bc9}:null;}})['then'](respondWithResult(_0x54558b,null))['catch'](handleError(_0x54558b,null));};exports[_0x34e4('0x111')]=function(_0x46bd23,_0x534d80){return db[_0x34e4('0x33')]['find']({'where':{'id':_0x46bd23['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x534d80,null))[_0x34e4('0x11')](function(_0x13da26){if(_0x13da26){var _0x5573e9=_0x13da26[_0x34e4('0xa5')]({'plain':!![]});return _0x13da26['addTeams'](_0x46bd23[_0x34e4('0x57')][_0x34e4('0x5b')],_['omit'](_0x46bd23['body'],[_0x34e4('0x5b'),'id'])||{})[_0x34e4('0x11')](function(){for(var _0xc65402=0x0;_0xc65402<_0x46bd23['body'][_0x34e4('0x5b')][_0x34e4('0x53')];_0xc65402++){var _0x4e20bc=[];var _0x4bcd51={};db['Team'][_0x34e4('0x90')]({'where':{'id':_0x46bd23[_0x34e4('0x57')][_0x34e4('0x5b')][_0xc65402]}})[_0x34e4('0x11')](function(_0x38ebda){_0x4bcd51=_0x38ebda[_0x34e4('0x46')];_0x4e20bc['push'](_0x38ebda[_0x34e4('0xf7')]()['then'](function(_0x5277e1){for(var _0x1721d2=0x0;_0x1721d2<_0x5277e1[_0x34e4('0x53')];_0x1721d2++){_0x5277e1[_0x1721d2][_0x34e4('0x112')]('channel','Voice');}return _0x5277e1;}));_0x4e20bc[_0x34e4('0x42')](_0x38ebda['getChatQueues']()[_0x34e4('0x11')](function(_0x7de377){for(var _0xb09055=0x0;_0xb09055<_0x7de377[_0x34e4('0x53')];_0xb09055++){_0x7de377[_0xb09055]['setDataValue'](_0x34e4('0xac'),_0x34e4('0x113'));}return _0x7de377;}));_0x4e20bc[_0x34e4('0x42')](_0x38ebda[_0x34e4('0x114')]()['then'](function(_0x56943c){for(var _0x231feb=0x0;_0x231feb<_0x56943c[_0x34e4('0x53')];_0x231feb++){_0x56943c[_0x231feb]['setDataValue']('channel','Mail');}return _0x56943c;}));_0x4e20bc[_0x34e4('0x42')](_0x38ebda[_0x34e4('0x115')]()['then'](function(_0x265365){for(var _0x52603f=0x0;_0x52603f<_0x265365[_0x34e4('0x53')];_0x52603f++){_0x265365[_0x52603f][_0x34e4('0x112')]('channel',_0x34e4('0x116'));}return _0x265365;}));_0x4e20bc[_0x34e4('0x42')](_0x38ebda['getWhatsappQueues']()[_0x34e4('0x11')](function(_0x20cbd2){for(var _0x2ebacc=0x0;_0x2ebacc<_0x20cbd2[_0x34e4('0x53')];_0x2ebacc++){_0x20cbd2[_0x2ebacc][_0x34e4('0x112')]('channel',_0x34e4('0x117'));}return _0x20cbd2;}));_0x4e20bc[_0x34e4('0x42')](_0x38ebda['getFaxQueues']()[_0x34e4('0x11')](function(_0x656aed){for(var _0x5061b2=0x0;_0x5061b2<_0x656aed[_0x34e4('0x53')];_0x5061b2++){_0x656aed[_0x5061b2]['setDataValue'](_0x34e4('0xac'),_0x34e4('0x118'));}return _0x656aed;}));_0x4e20bc['push'](_0x38ebda['getOpenchannelQueues']()[_0x34e4('0x11')](function(_0x38504a){for(var _0x4c6b84=0x0;_0x4c6b84<_0x38504a['length'];_0x4c6b84++){_0x38504a[_0x4c6b84][_0x34e4('0x112')](_0x34e4('0xac'),_0x34e4('0x119'));}return _0x38504a;}));return BPromise['all'](_0x4e20bc);})['then'](function(_0x438fb5){var _0x482222=_[_0x34e4('0x11a')](_0x438fb5);_0x4e20bc=[];return db['sequelize'][_0x34e4('0x11b')](function(_0x16596a){for(var _0x4b076c=0x0;_0x4b076c<_0x482222[_0x34e4('0x53')];_0x4b076c++){_0x4e20bc[_0x34e4('0x42')](_0x482222[_0x4b076c][_0x34e4('0x11c')](_0x5573e9['id']),{'transaction':_0x16596a});}return BPromise[_0x34e4('0x4c')](_0x4e20bc)[_0x34e4('0x11')](function(){if(_0x5573e9['online']){return BPromise[_0x34e4('0x80')](_['filter'](_0x482222,function(_0x4b3965){return _0x4b3965['getDataValue']('channel')===_0x34e4('0x11d');}),function(_0x397a05){return db[_0x34e4('0xa9')][_0x34e4('0xaa')]({'membername':_0x5573e9[_0x34e4('0x3a')],'UserId':_0x5573e9['id'],'queue_name':_0x397a05[_0x34e4('0x3a')],'VoiceQueueId':_0x397a05['id'],'interface':_['isNil'](_0x5573e9[_0x34e4('0x9a')])?util[_0x34e4('0xa7')]('SIP/%s',_0x5573e9[_0x34e4('0x3a')]):_0x5573e9[_0x34e4('0x9a')],'paused':_0x5573e9[_0x34e4('0x99')]||![],'penalty':_0x5573e9['penalty']},{'transaction':_0x16596a});});}else{return;}})[_0x34e4('0x11')](function(){for(var _0x593cd5=0x0;_0x593cd5<_0x482222[_0x34e4('0x53')];_0x593cd5++){var _0x1d5a4c=_0x482222[_0x593cd5][_0x34e4('0x11e')]('channel');var _0x3d4646=_0x1d5a4c+_0x34e4('0xb0');socket[_0x34e4('0xa2')](_0x34e4('0x28')+_0x1d5a4c+_0x34e4('0xa3'),{'UserId':_0x5573e9['id'],['queueField']:_0x482222[_0x593cd5]['id']});}});});})[_0x34e4('0x11')](function(){db[_0x34e4('0x11f')][_0x34e4('0x90')]({'where':{'teamId':_0x4bcd51['id']}})[_0x34e4('0x11')](function(_0x4b38a1){if(_0x4b38a1){db['UserVoicePrefix'][_0x34e4('0x75')]({'UserId':_0x46bd23[_0x34e4('0x58')]['id'],'VoicePrefixId':_0x4b38a1[_0x34e4('0x120')]});}});});}});}})[_0x34e4('0x11')](respondWithStatusCode(_0x534d80,null))[_0x34e4('0x1b')](handleError(_0x534d80,null));};exports[_0x34e4('0x121')]=function(_0x3a7bed,_0x3593ab){return db[_0x34e4('0x33')]['findOne']({'where':{'id':_0x3a7bed['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x3593ab,null))[_0x34e4('0x11')](function(_0x3edd5c){if(_0x3edd5c){var _0x4b4ba7=_0x3edd5c[_0x34e4('0xa5')]({'plain':!![]});var _0x1c8c30=_0x3a7bed[_0x34e4('0x43')][_0x34e4('0x5b')];return _0x3edd5c[_0x34e4('0x121')](_0x1c8c30)[_0x34e4('0x11')](function(){for(var _0x280b3e=0x0;_0x280b3e<_0x1c8c30[_0x34e4('0x53')];_0x280b3e++){var _0x2d9632=[];var _0x57c62e={};db[_0x34e4('0x110')][_0x34e4('0x90')]({'where':{'id':_0x1c8c30[_0x280b3e]}})['then'](function(_0x23f3e8){_0x57c62e=_0x23f3e8['dataValues'];_0x2d9632[_0x34e4('0x42')](_0x23f3e8[_0x34e4('0xf7')]()['then'](function(_0x363bb1){for(var _0x4414ca=0x0;_0x4414ca<_0x363bb1[_0x34e4('0x53')];_0x4414ca++){_0x363bb1[_0x4414ca][_0x34e4('0x112')](_0x34e4('0xac'),'Voice');}return _0x363bb1;}));_0x2d9632[_0x34e4('0x42')](_0x23f3e8['getChatQueues']()['then'](function(_0x34dbda){for(var _0x47e8d0=0x0;_0x47e8d0<_0x34dbda[_0x34e4('0x53')];_0x47e8d0++){_0x34dbda[_0x47e8d0][_0x34e4('0x112')](_0x34e4('0xac'),_0x34e4('0x113'));}return _0x34dbda;}));_0x2d9632[_0x34e4('0x42')](_0x23f3e8[_0x34e4('0x114')]()[_0x34e4('0x11')](function(_0x3ea2b4){for(var _0x33976d=0x0;_0x33976d<_0x3ea2b4[_0x34e4('0x53')];_0x33976d++){_0x3ea2b4[_0x33976d]['setDataValue'](_0x34e4('0xac'),_0x34e4('0x122'));}return _0x3ea2b4;}));_0x2d9632['push'](_0x23f3e8['getSmsQueues']()[_0x34e4('0x11')](function(_0x45476a){for(var _0xa4e048=0x0;_0xa4e048<_0x45476a[_0x34e4('0x53')];_0xa4e048++){_0x45476a[_0xa4e048][_0x34e4('0x112')](_0x34e4('0xac'),_0x34e4('0x116'));}return _0x45476a;}));_0x2d9632[_0x34e4('0x42')](_0x23f3e8[_0x34e4('0x123')]()[_0x34e4('0x11')](function(_0x1b5dbf){for(var _0x43fc08=0x0;_0x43fc08<_0x1b5dbf[_0x34e4('0x53')];_0x43fc08++){_0x1b5dbf[_0x43fc08][_0x34e4('0x112')](_0x34e4('0xac'),_0x34e4('0x117'));}return _0x1b5dbf;}));_0x2d9632[_0x34e4('0x42')](_0x23f3e8['getFaxQueues']()[_0x34e4('0x11')](function(_0x1f2364){for(var _0x427803=0x0;_0x427803<_0x1f2364[_0x34e4('0x53')];_0x427803++){_0x1f2364[_0x427803]['setDataValue']('channel',_0x34e4('0x118'));}return _0x1f2364;}));_0x2d9632[_0x34e4('0x42')](_0x23f3e8[_0x34e4('0x124')]()['then'](function(_0x44d5e6){for(var _0x590d3f=0x0;_0x590d3f<_0x44d5e6['length'];_0x590d3f++){_0x44d5e6[_0x590d3f][_0x34e4('0x112')]('channel',_0x34e4('0x119'));}return _0x44d5e6;}));return BPromise[_0x34e4('0x4c')](_0x2d9632);})[_0x34e4('0x11')](function(_0x55f151){var _0x506104=_[_0x34e4('0x11a')](_0x55f151);_0x2d9632=[];return db['sequelize'][_0x34e4('0x11b')](function(_0x153610){for(var _0xe60bbc=0x0;_0xe60bbc<_0x506104['length'];_0xe60bbc++){_0x2d9632[_0x34e4('0x42')](_0x506104[_0xe60bbc]['removeAgent'](_0x4b4ba7['id']),{'transaction':_0x153610});}return BPromise[_0x34e4('0x4c')](_0x2d9632)[_0x34e4('0x11')](function(){if(_0x4b4ba7[_0x34e4('0xa6')]){return BPromise[_0x34e4('0x80')](_[_0x34e4('0x2b')](_0x506104,function(_0x123962){return _0x123962[_0x34e4('0x11e')](_0x34e4('0xac'))===_0x34e4('0x11d');}),function(_0x28cae0){return db[_0x34e4('0xa9')][_0x34e4('0x25')]({'where':{'VoiceQueueId':_0x28cae0['id'],'UserId':_0x4b4ba7['id']},'transaction':_0x153610});});}else{return;}})[_0x34e4('0x11')](function(){db[_0x34e4('0x11f')]['findOne']({'where':{'teamId':_0x57c62e['id']}})['then'](function(_0x35a936){if(_0x35a936){return db[_0x34e4('0x125')][_0x34e4('0x25')]({'where':{'UserId':_0x4b4ba7['id'],'VoicePrefixId':_0x35a936[_0x34e4('0x46')]['VoicePrefixId']}});}});})['then'](function(){for(var _0x781ba8=0x0;_0x781ba8<_0x506104[_0x34e4('0x53')];_0x781ba8++){var _0x240a2d=_0x506104[_0x781ba8]['getDataValue'](_0x34e4('0xac'));var _0x5afd2b=_0x240a2d+_0x34e4('0xb0');socket[_0x34e4('0xa2')](_0x34e4('0x28')+_0x240a2d+_0x34e4('0xb1'),{'UserId':_0x4b4ba7['id'],['queueField']:_0x506104[_0x781ba8]['id']});}});});});}});}})[_0x34e4('0x11')](respondWithStatusCode(_0x3593ab,null))[_0x34e4('0x1b')](handleError(_0x3593ab,null));};exports[_0x34e4('0x126')]=function(_0x300152,_0x2bad44){var _0x1ed8ea={};var _0x2f9e73={};var _0x12f67e;var _0x1eb599;return db[_0x34e4('0x33')]['findOne']({'where':{'id':_0x300152['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x2bad44,null))[_0x34e4('0x11')](function(_0x2fd21a){if(_0x2fd21a){_0x12f67e=_0x2fd21a;_0x2f9e73['model']=_[_0x34e4('0x50')](db['CmList'][_0x34e4('0x34')]);_0x2f9e73['query']=_[_0x34e4('0x50')](_0x300152[_0x34e4('0x43')]);_0x2f9e73[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x2f9e73[_0x34e4('0x4d')],_0x2f9e73[_0x34e4('0x43')]);_0x1ed8ea[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x2f9e73[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x300152[_0x34e4('0x43')][_0x34e4('0x52')]));_0x1ed8ea[_0x34e4('0x41')]=_0x1ed8ea[_0x34e4('0x41')][_0x34e4('0x53')]?_0x1ed8ea[_0x34e4('0x41')]:_0x2f9e73[_0x34e4('0x4d')];_0x1ed8ea[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x300152[_0x34e4('0x43')]['sort']);_0x1ed8ea[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x300152[_0x34e4('0x43')],_0x2f9e73[_0x34e4('0xc8')]));if(_0x300152[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x1ed8ea[_0x34e4('0x3c')]=_['merge'](_0x1ed8ea[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x1ed8ea[_0x34e4('0x41')],function(_0x48fbdd){var _0x24d39e={};_0x24d39e[_0x48fbdd]={'$like':'%'+_0x300152[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x24d39e;})});}_0x1ed8ea=_[_0x34e4('0xcc')]({},_0x1ed8ea,_0x300152[_0x34e4('0xcd')]);return _0x12f67e[_0x34e4('0x126')](_0x1ed8ea);}})['then'](function(_0x2ca077){if(_0x2ca077){_0x1eb599=_0x2ca077[_0x34e4('0x53')];if(!_0x300152[_0x34e4('0x43')][_0x34e4('0xce')]('nolimit')){_0x1ed8ea[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x300152['query'][_0x34e4('0x21')]);_0x1ed8ea['offset']=qs[_0x34e4('0x1f')](_0x300152[_0x34e4('0x43')]['offset']);}return _0x12f67e[_0x34e4('0x126')](_0x1ed8ea);}})[_0x34e4('0x11')](function(_0x30ca8e){if(_0x30ca8e){return _0x30ca8e?{'count':_0x1eb599,'rows':_0x30ca8e}:null;}})['then'](respondWithResult(_0x2bad44,null))[_0x34e4('0x1b')](handleError(_0x2bad44,null));};exports[_0x34e4('0x127')]=function(_0x38e325,_0x3f9e78){var _0x449704={};var _0x53b178={};var _0x2dfa11;return db['User']['findOne']({'where':{'id':_0x38e325[_0x34e4('0x58')]['id']}})['then'](handleEntityNotFound(_0x3f9e78,null))[_0x34e4('0x11')](function(_0x1bfa35){if(_0x1bfa35){_0x2dfa11=_0x1bfa35;_0x53b178[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0x33')]['rawAttributes']);_0x53b178[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x38e325[_0x34e4('0x43')]);_0x53b178[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x53b178['model'],_0x53b178['query']);_0x449704[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x53b178['model'],qs[_0x34e4('0x52')](_0x38e325[_0x34e4('0x43')][_0x34e4('0x52')]));_0x449704['attributes']=_0x449704[_0x34e4('0x41')][_0x34e4('0x53')]?_0x449704[_0x34e4('0x41')]:_0x53b178[_0x34e4('0x4d')];_0x449704[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x38e325['query'][_0x34e4('0xca')]);_0x449704[_0x34e4('0x3c')]=qs['filters'](_[_0x34e4('0xcb')](_0x38e325[_0x34e4('0x43')],_0x53b178[_0x34e4('0xc8')]));if(_0x38e325['query'][_0x34e4('0x2b')]){_0x449704[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x449704['where'],{'$or':_[_0x34e4('0x35')](_0x449704[_0x34e4('0x41')],function(_0x6fcef7){var _0x46bf05={};_0x46bf05[_0x6fcef7]={'$like':'%'+_0x38e325['query'][_0x34e4('0x2b')]+'%'};return _0x46bf05;})});}_0x449704[_0x34e4('0x4d')]=db['User'];_0x449704['as']=_0x34e4('0x29');_0x449704=_['merge']({},_0x449704,_0x38e325['options']);return _0x2dfa11['getVoiceQueues']({'include':[_0x449704]});}})['then'](function(_0x5bd773){if(_0x5bd773){var _0x119223={},_0x1f0629=[];for(var _0x23ed14=0x0;_0x23ed14<_0x5bd773[_0x34e4('0x53')];_0x23ed14+=0x1){for(var _0x423bde=0x0,_0x1682c9;_0x423bde<_0x5bd773[_0x23ed14][_0x34e4('0x29')][_0x34e4('0x53')];_0x423bde+=0x1){_0x1682c9=_0x5bd773[_0x23ed14][_0x34e4('0x29')][_0x423bde][_0x34e4('0xa5')]({'plain':!![]});_0x119223[_0x1682c9['id']]=_0x1682c9;}}_0x119223=_[_0x34e4('0x128')](_0x119223);for(var _0x41ebb6=qs['offset'](_0x38e325['query']['offset']);_0x41ebb6<_0x119223[_0x34e4('0x53')]&&_0x1f0629[_0x34e4('0x53')]<qs[_0x34e4('0x21')](_0x38e325['query'][_0x34e4('0x21')]);_0x41ebb6+=0x1){if(_0x119223[_0x41ebb6]){_0x1f0629[_0x34e4('0x42')](_0x119223[_0x41ebb6]);}}return{'count':_0x119223[_0x34e4('0x53')],'rows':_0x1f0629};}})[_0x34e4('0x11')](respondWithResult(_0x3f9e78,null))[_0x34e4('0x1b')](handleError(_0x3f9e78,null));};exports[_0x34e4('0x25')]=function(_0x1c1614,_0x35e610){if(_0x1c1614[_0x34e4('0x28')]['id']==_0x1c1614[_0x34e4('0x58')]['id']){return _0x35e610['status'](0x1f4)[_0x34e4('0x31')]({'message':_0x34e4('0x129')});}return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x1c1614['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x35e610,null))['then'](removeEntity(_0x35e610,null))[_0x34e4('0x1b')](handleError(_0x35e610,null));};exports[_0x34e4('0x12a')]=function(_0x47124f,_0x49a25f){return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x47124f[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x49a25f,null))['then'](function(_0x339a60){if(_0x339a60){return _0x339a60[_0x34e4('0x12a')](_0x47124f[_0x34e4('0x57')][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x47124f[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{})[_0x34e4('0xa1')](function(){for(var _0x202c1b=0x0;_0x202c1b<_0x47124f[_0x34e4('0x57')]['ids']['length'];_0x202c1b+=0x1){socket['emit']('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x47124f['body'][_0x34e4('0x5b')][_0x202c1b]),'UserId':Number(_0x47124f[_0x34e4('0x58')]['id'])});}return _0x47124f[_0x34e4('0x57')]['ids'];});}})[_0x34e4('0x11')](respondWithResult(_0x49a25f,null))[_0x34e4('0x1b')](handleError(_0x49a25f,null));};exports['removeChatInteractions']=function(_0x38d0fa,_0x107bae){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x38d0fa['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x107bae,null))[_0x34e4('0x11')](function(_0xb96c7b){if(_0xb96c7b){return _0xb96c7b['removeChatInteractions'](_0x38d0fa[_0x34e4('0x43')]['ids'])[_0x34e4('0x11')](function(){if(_[_0x34e4('0xaf')](_0x38d0fa['query']['ids'])){for(var _0x11b96a=0x0;_0x11b96a<_0x38d0fa['query'][_0x34e4('0x5b')]['length'];_0x11b96a+=0x1){socket[_0x34e4('0xa2')](_0x34e4('0x12c'),{'ChatInteractionId':Number(_0x38d0fa[_0x34e4('0x43')][_0x34e4('0x5b')][_0x11b96a]),'UserId':Number(_0x38d0fa[_0x34e4('0x58')]['id'])});}}else{socket[_0x34e4('0xa2')](_0x34e4('0x12c'),{'ChatInteractionId':Number(_0x38d0fa[_0x34e4('0x43')]['ids']),'UserId':Number(_0x38d0fa[_0x34e4('0x58')]['id'])});}});}})[_0x34e4('0x11')](respondWithStatusCode(_0x107bae,null))[_0x34e4('0x1b')](handleError(_0x107bae,null));};exports[_0x34e4('0x12d')]=function(_0x2e4afc,_0x30aabc){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x2e4afc['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x30aabc,null))[_0x34e4('0x11')](function(_0x323797){if(_0x323797){return _0x323797['addMailInteractions'](_0x2e4afc[_0x34e4('0x57')][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x2e4afc['body'],[_0x34e4('0x5b'),'id'])||{})[_0x34e4('0xa1')](function(){for(var _0x1a309f=0x0;_0x1a309f<_0x2e4afc[_0x34e4('0x57')]['ids'][_0x34e4('0x53')];_0x1a309f+=0x1){socket[_0x34e4('0xa2')](_0x34e4('0x12e'),{'MailInteractionId':Number(_0x2e4afc[_0x34e4('0x57')][_0x34e4('0x5b')][_0x1a309f]),'UserId':Number(_0x2e4afc['params']['id'])});}return _0x2e4afc['body'][_0x34e4('0x5b')];});}})[_0x34e4('0x11')](respondWithResult(_0x30aabc,null))[_0x34e4('0x1b')](handleError(_0x30aabc,null));};exports[_0x34e4('0x12f')]=function(_0x391b63,_0x10f012){return db['User']['find']({'where':{'id':_0x391b63[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x10f012,null))[_0x34e4('0x11')](function(_0x16627f){if(_0x16627f){return _0x16627f[_0x34e4('0x12f')](_0x391b63[_0x34e4('0x43')][_0x34e4('0x5b')])[_0x34e4('0x11')](function(){if(_[_0x34e4('0xaf')](_0x391b63['query']['ids'])){for(var _0x19750e=0x0;_0x19750e<_0x391b63[_0x34e4('0x43')][_0x34e4('0x5b')]['length'];_0x19750e+=0x1){socket[_0x34e4('0xa2')](_0x34e4('0x130'),{'MailInteractionId':Number(_0x391b63['query']['ids'][_0x19750e]),'UserId':Number(_0x391b63[_0x34e4('0x58')]['id'])});}}else{socket['emit'](_0x34e4('0x130'),{'MailInteractionId':Number(_0x391b63[_0x34e4('0x43')][_0x34e4('0x5b')]),'UserId':Number(_0x391b63[_0x34e4('0x58')]['id'])});}});}})[_0x34e4('0x11')](respondWithStatusCode(_0x10f012,null))[_0x34e4('0x1b')](handleError(_0x10f012,null));};exports[_0x34e4('0x131')]=function(_0xb384d2,_0x4021b3){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0xb384d2[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x4021b3,null))['then'](function(_0x5608d8){if(_0x5608d8){return _0x5608d8[_0x34e4('0x131')](_0xb384d2[_0x34e4('0x57')]['ids'],_[_0x34e4('0x12b')](_0xb384d2[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{})[_0x34e4('0xa1')](function(){for(var _0x381834=0x0;_0x381834<_0xb384d2[_0x34e4('0x57')][_0x34e4('0x5b')][_0x34e4('0x53')];_0x381834+=0x1){socket[_0x34e4('0xa2')](_0x34e4('0x132'),{'FaxInteractionId':Number(_0xb384d2[_0x34e4('0x57')][_0x34e4('0x5b')][_0x381834]),'UserId':Number(_0xb384d2[_0x34e4('0x58')]['id'])});}return _0xb384d2[_0x34e4('0x57')][_0x34e4('0x5b')];});}})[_0x34e4('0x11')](respondWithResult(_0x4021b3,null))[_0x34e4('0x1b')](handleError(_0x4021b3,null));};exports[_0x34e4('0x133')]=function(_0x4d690a,_0x182e39){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x4d690a[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x182e39,null))[_0x34e4('0x11')](function(_0x2fd4dc){if(_0x2fd4dc){return _0x2fd4dc['removeFaxInteractions'](_0x4d690a[_0x34e4('0x43')][_0x34e4('0x5b')])[_0x34e4('0x11')](function(){if(_['isArray'](_0x4d690a['query']['ids'])){for(var _0x50589b=0x0;_0x50589b<_0x4d690a['query']['ids'][_0x34e4('0x53')];_0x50589b+=0x1){socket['emit'](_0x34e4('0x134'),{'FaxInteractionId':Number(_0x4d690a['query'][_0x34e4('0x5b')][_0x50589b]),'UserId':Number(_0x4d690a[_0x34e4('0x58')]['id'])});}}else{socket[_0x34e4('0xa2')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4d690a['query'][_0x34e4('0x5b')]),'UserId':Number(_0x4d690a[_0x34e4('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x182e39,null))[_0x34e4('0x1b')](handleError(_0x182e39,null));};exports['addSmsInteractions']=function(_0x2172d7,_0x5733de){return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x2172d7[_0x34e4('0x58')]['id']}})['then'](handleEntityNotFound(_0x5733de,null))['then'](function(_0x237b56){if(_0x237b56){return _0x237b56[_0x34e4('0x135')](_0x2172d7[_0x34e4('0x57')][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x2172d7[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{})['spread'](function(){for(var _0xed97e=0x0;_0xed97e<_0x2172d7[_0x34e4('0x57')][_0x34e4('0x5b')]['length'];_0xed97e+=0x1){socket[_0x34e4('0xa2')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x2172d7[_0x34e4('0x57')][_0x34e4('0x5b')][_0xed97e]),'UserId':Number(_0x2172d7[_0x34e4('0x58')]['id'])});}return _0x2172d7[_0x34e4('0x57')][_0x34e4('0x5b')];});}})[_0x34e4('0x11')](respondWithResult(_0x5733de,null))[_0x34e4('0x1b')](handleError(_0x5733de,null));};exports[_0x34e4('0x136')]=function(_0x126bda,_0x5bdab0){return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x126bda[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x5bdab0,null))[_0x34e4('0x11')](function(_0x4afc08){if(_0x4afc08){return _0x4afc08['removeSmsInteractions'](_0x126bda[_0x34e4('0x43')][_0x34e4('0x5b')])[_0x34e4('0x11')](function(){if(_['isArray'](_0x126bda['query'][_0x34e4('0x5b')])){for(var _0x2c8595=0x0;_0x2c8595<_0x126bda[_0x34e4('0x43')][_0x34e4('0x5b')][_0x34e4('0x53')];_0x2c8595+=0x1){socket[_0x34e4('0xa2')](_0x34e4('0x137'),{'SmsInteractionId':Number(_0x126bda['query']['ids'][_0x2c8595]),'UserId':Number(_0x126bda[_0x34e4('0x58')]['id'])});}}else{socket[_0x34e4('0xa2')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x126bda[_0x34e4('0x43')]['ids']),'UserId':Number(_0x126bda[_0x34e4('0x58')]['id'])});}});}})[_0x34e4('0x11')](respondWithStatusCode(_0x5bdab0,null))[_0x34e4('0x1b')](handleError(_0x5bdab0,null));};exports['addOpenchannelInteractions']=function(_0x12a942,_0x5de96e){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x12a942['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x5de96e,null))[_0x34e4('0x11')](function(_0x55ebdc){if(_0x55ebdc){return _0x55ebdc[_0x34e4('0x138')](_0x12a942[_0x34e4('0x57')]['ids'],_[_0x34e4('0x12b')](_0x12a942[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{})['spread'](function(){for(var _0x19f90d=0x0;_0x19f90d<_0x12a942[_0x34e4('0x57')][_0x34e4('0x5b')][_0x34e4('0x53')];_0x19f90d+=0x1){socket[_0x34e4('0xa2')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x12a942['body'][_0x34e4('0x5b')][_0x19f90d]),'UserId':Number(_0x12a942[_0x34e4('0x58')]['id'])});}return _0x12a942[_0x34e4('0x57')][_0x34e4('0x5b')];});}})[_0x34e4('0x11')](respondWithResult(_0x5de96e,null))[_0x34e4('0x1b')](handleError(_0x5de96e,null));};exports[_0x34e4('0x139')]=function(_0x21e53d,_0x4e93b6){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x21e53d['params']['id']}})['then'](handleEntityNotFound(_0x4e93b6,null))[_0x34e4('0x11')](function(_0x2cbbb8){if(_0x2cbbb8){return _0x2cbbb8[_0x34e4('0x139')](_0x21e53d[_0x34e4('0x43')]['ids'])['then'](function(){if(_[_0x34e4('0xaf')](_0x21e53d['query'][_0x34e4('0x5b')])){for(var _0x3143f9=0x0;_0x3143f9<_0x21e53d[_0x34e4('0x43')]['ids'][_0x34e4('0x53')];_0x3143f9+=0x1){socket[_0x34e4('0xa2')](_0x34e4('0x13a'),{'OpenchannelInteractionId':Number(_0x21e53d[_0x34e4('0x43')][_0x34e4('0x5b')][_0x3143f9]),'UserId':Number(_0x21e53d['params']['id'])});}}else{socket[_0x34e4('0xa2')](_0x34e4('0x13a'),{'OpenchannelInteractionId':Number(_0x21e53d[_0x34e4('0x43')][_0x34e4('0x5b')]),'UserId':Number(_0x21e53d[_0x34e4('0x58')]['id'])});}});}})[_0x34e4('0x11')](respondWithStatusCode(_0x4e93b6,null))['catch'](handleError(_0x4e93b6,null));};exports[_0x34e4('0x13b')]=function(_0x1df140,_0x59cb97){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x1df140[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x59cb97,null))[_0x34e4('0x11')](function(_0x269b46){if(_0x269b46){return _0x269b46['addWhatsappInteractions'](_0x1df140[_0x34e4('0x57')][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x1df140[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{})[_0x34e4('0xa1')](function(){for(var _0x4eff34=0x0;_0x4eff34<_0x1df140[_0x34e4('0x57')][_0x34e4('0x5b')]['length'];_0x4eff34+=0x1){socket[_0x34e4('0xa2')](_0x34e4('0x13c'),{'WhatsappInteractionId':Number(_0x1df140['body'][_0x34e4('0x5b')][_0x4eff34]),'UserId':Number(_0x1df140[_0x34e4('0x58')]['id'])});}return _0x1df140[_0x34e4('0x57')][_0x34e4('0x5b')];});}})[_0x34e4('0x11')](respondWithResult(_0x59cb97,null))[_0x34e4('0x1b')](handleError(_0x59cb97,null));};exports[_0x34e4('0x13d')]=function(_0x597d7c,_0x340025){return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x597d7c['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x340025,null))[_0x34e4('0x11')](function(_0x271d94){if(_0x271d94){return _0x271d94[_0x34e4('0x13d')](_0x597d7c[_0x34e4('0x43')][_0x34e4('0x5b')]);}})[_0x34e4('0x11')](respondWithStatusCode(_0x340025,null))['catch'](handleError(_0x340025,null));};exports['getVoicePrefixes']=function(_0x20eeb9,_0x575ce7){var _0x545b40={};var _0x4c52d7={};var _0x28f609;var _0x35393b;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x20eeb9[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x575ce7,null))['then'](function(_0x3dcf6b){if(_0x3dcf6b){_0x28f609=_0x3dcf6b;_0x4c52d7[_0x34e4('0x4d')]=_['keys'](db[_0x34e4('0x13e')]['rawAttributes']);_0x4c52d7[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x20eeb9['query']);_0x4c52d7['filters']=_[_0x34e4('0x51')](_0x4c52d7[_0x34e4('0x4d')],_0x4c52d7[_0x34e4('0x43')]);_0x545b40['attributes']=_[_0x34e4('0x51')](_0x4c52d7[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x20eeb9['query'][_0x34e4('0x52')]));_0x545b40[_0x34e4('0x41')]=_0x545b40[_0x34e4('0x41')][_0x34e4('0x53')]?_0x545b40[_0x34e4('0x41')]:_0x4c52d7[_0x34e4('0x4d')];_0x545b40[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x20eeb9[_0x34e4('0x43')][_0x34e4('0xca')]);_0x545b40[_0x34e4('0x3c')]=qs['filters'](_[_0x34e4('0xcb')](_0x20eeb9[_0x34e4('0x43')],_0x4c52d7['filters']));if(_0x20eeb9[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x545b40[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x545b40[_0x34e4('0x3c')],{'$or':_['map'](_0x545b40[_0x34e4('0x41')],function(_0x2c57cf){var _0x3da054={};_0x3da054[_0x2c57cf]={'$like':'%'+_0x20eeb9[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x3da054;})});}_0x545b40=_[_0x34e4('0xcc')]({},_0x545b40,_0x20eeb9['options']);return _0x28f609[_0x34e4('0x13f')](_0x545b40);}})['then'](function(_0x5c648a){if(_0x5c648a){_0x35393b=_0x5c648a[_0x34e4('0x53')];if(!_0x20eeb9[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x545b40[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x20eeb9[_0x34e4('0x43')]['limit']);_0x545b40[_0x34e4('0x1f')]=qs['offset'](_0x20eeb9[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x28f609[_0x34e4('0x13f')](_0x545b40);}})[_0x34e4('0x11')](function(_0x1405bf){if(_0x1405bf){return _0x1405bf?{'count':_0x35393b,'rows':_0x1405bf}:null;}})[_0x34e4('0x11')](respondWithResult(_0x575ce7,null))['catch'](handleError(_0x575ce7,null));};exports['getFaxAccounts']=function(_0x38c6b3,_0x125ca2){var _0x4c2707={};var _0x295d84={};var _0x1b478b;var _0x2eb4d8;return db['User']['findOne']({'where':{'id':_0x38c6b3[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x125ca2,null))[_0x34e4('0x11')](function(_0x5e896c){if(_0x5e896c){_0x1b478b=_0x5e896c;_0x295d84['model']=_[_0x34e4('0x50')](db[_0x34e4('0x140')][_0x34e4('0x34')]);_0x295d84[_0x34e4('0x43')]=_['keys'](_0x38c6b3['query']);_0x295d84[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x295d84[_0x34e4('0x4d')],_0x295d84['query']);_0x4c2707[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x295d84[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x38c6b3[_0x34e4('0x43')][_0x34e4('0x52')]));_0x4c2707[_0x34e4('0x41')]=_0x4c2707[_0x34e4('0x41')][_0x34e4('0x53')]?_0x4c2707[_0x34e4('0x41')]:_0x295d84['model'];_0x4c2707[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x38c6b3[_0x34e4('0x43')][_0x34e4('0xca')]);_0x4c2707[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x38c6b3['query'],_0x295d84[_0x34e4('0xc8')]));if(_0x38c6b3['query'][_0x34e4('0x2b')]){_0x4c2707[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x4c2707['where'],{'$or':_['map'](_0x4c2707[_0x34e4('0x41')],function(_0x20f6f7){var _0x704188={};_0x704188[_0x20f6f7]={'$like':'%'+_0x38c6b3[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x704188;})});}_0x4c2707=_[_0x34e4('0xcc')]({},_0x4c2707,_0x38c6b3[_0x34e4('0xcd')]);return _0x1b478b[_0x34e4('0x141')](_0x4c2707);}})['then'](function(_0x5d0c15){if(_0x5d0c15){_0x2eb4d8=_0x5d0c15[_0x34e4('0x53')];if(!_0x38c6b3[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x4c2707[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x38c6b3[_0x34e4('0x43')]['limit']);_0x4c2707[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x38c6b3[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x1b478b['getFaxAccounts'](_0x4c2707);}})['then'](function(_0x5229ad){if(_0x5229ad){return _0x5229ad?{'count':_0x2eb4d8,'rows':_0x5229ad}:null;}})[_0x34e4('0x11')](respondWithResult(_0x125ca2,null))['catch'](handleError(_0x125ca2,null));};exports['addFaxAccounts']=function(_0x78150d,_0x32f0a3){return db['User']['find']({'where':{'id':_0x78150d[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x32f0a3,null))[_0x34e4('0x11')](function(_0x13b9dc){if(_0x13b9dc){return _0x13b9dc[_0x34e4('0x142')](_0x78150d[_0x34e4('0x57')][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x78150d[_0x34e4('0x57')],['ids','id'])||{});}})[_0x34e4('0x11')](respondWithResult(_0x32f0a3,null))['catch'](handleError(_0x32f0a3,null));};exports[_0x34e4('0x143')]=function(_0x5247c3,_0x246e34){return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x5247c3[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x246e34,null))['then'](function(_0x39d4ea){if(_0x39d4ea){return _0x39d4ea['removeFaxAccounts'](_0x5247c3['query'][_0x34e4('0x5b')]);}})[_0x34e4('0x11')](respondWithStatusCode(_0x246e34,null))[_0x34e4('0x1b')](handleError(_0x246e34,null));};exports['getMailAccounts']=function(_0x3b76ef,_0x2becaf){var _0x4fee5d={};var _0x302a99={};var _0x230e39;var _0x1412b3;return db['User'][_0x34e4('0x90')]({'where':{'id':_0x3b76ef[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x2becaf,null))[_0x34e4('0x11')](function(_0x4d1f77){if(_0x4d1f77){_0x230e39=_0x4d1f77;_0x302a99['model']=_[_0x34e4('0x50')](db[_0x34e4('0x144')]['rawAttributes']);_0x302a99[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x3b76ef['query']);_0x302a99[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x302a99[_0x34e4('0x4d')],_0x302a99[_0x34e4('0x43')]);_0x4fee5d[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x302a99[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x3b76ef[_0x34e4('0x43')][_0x34e4('0x52')]));_0x4fee5d['attributes']=_0x4fee5d[_0x34e4('0x41')][_0x34e4('0x53')]?_0x4fee5d[_0x34e4('0x41')]:_0x302a99[_0x34e4('0x4d')];_0x4fee5d['order']=qs[_0x34e4('0xca')](_0x3b76ef['query'][_0x34e4('0xca')]);_0x4fee5d[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x3b76ef[_0x34e4('0x43')],_0x302a99[_0x34e4('0xc8')]));if(_0x3b76ef['query'][_0x34e4('0x2b')]){_0x4fee5d[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x4fee5d['where'],{'$or':_[_0x34e4('0x35')](_0x4fee5d[_0x34e4('0x41')],function(_0x424cea){var _0xb8ae34={};_0xb8ae34[_0x424cea]={'$like':'%'+_0x3b76ef['query']['filter']+'%'};return _0xb8ae34;})});}_0x4fee5d=_[_0x34e4('0xcc')]({},_0x4fee5d,_0x3b76ef[_0x34e4('0xcd')]);return _0x230e39['getMailAccounts'](_0x4fee5d);}})['then'](function(_0x3c74ac){if(_0x3c74ac){_0x1412b3=_0x3c74ac[_0x34e4('0x53')];if(!_0x3b76ef[_0x34e4('0x43')]['hasOwnProperty']('nolimit')){_0x4fee5d[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x3b76ef[_0x34e4('0x43')][_0x34e4('0x21')]);_0x4fee5d[_0x34e4('0x1f')]=qs['offset'](_0x3b76ef[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x230e39[_0x34e4('0x145')](_0x4fee5d);}})[_0x34e4('0x11')](function(_0x45c94e){if(_0x45c94e){return _0x45c94e?{'count':_0x1412b3,'rows':_0x45c94e}:null;}})[_0x34e4('0x11')](respondWithResult(_0x2becaf,null))[_0x34e4('0x1b')](handleError(_0x2becaf,null));};exports[_0x34e4('0x146')]=function(_0x2ccc49,_0x48fd01){return db[_0x34e4('0x33')]['find']({'where':{'id':_0x2ccc49['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x48fd01,null))[_0x34e4('0x11')](function(_0x31f89a){if(_0x31f89a){return _0x31f89a['addMailAccounts'](_0x2ccc49[_0x34e4('0x57')][_0x34e4('0x5b')],_['omit'](_0x2ccc49[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{});}})[_0x34e4('0x11')](respondWithResult(_0x48fd01,null))[_0x34e4('0x1b')](handleError(_0x48fd01,null));};exports['removeMailAccounts']=function(_0x579878,_0x2161e4){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x579878[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x2161e4,null))[_0x34e4('0x11')](function(_0x5d58be){if(_0x5d58be){return _0x5d58be['removeMailAccounts'](_0x579878[_0x34e4('0x43')][_0x34e4('0x5b')]);}})['then'](respondWithStatusCode(_0x2161e4,null))['catch'](handleError(_0x2161e4,null));};exports[_0x34e4('0x147')]=function(_0x5707c2,_0x51caaa){var _0x1bd962={};var _0x1e9e34={};var _0x3cdc95;var _0x4ba7fd;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x5707c2[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x51caaa,null))[_0x34e4('0x11')](function(_0x27a1e8){if(_0x27a1e8){_0x3cdc95=_0x27a1e8;_0x1e9e34[_0x34e4('0x4d')]=_['keys'](db[_0x34e4('0x148')][_0x34e4('0x34')]);_0x1e9e34[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x5707c2[_0x34e4('0x43')]);_0x1e9e34['filters']=_['intersection'](_0x1e9e34['model'],_0x1e9e34[_0x34e4('0x43')]);_0x1bd962[_0x34e4('0x41')]=_['intersection'](_0x1e9e34[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x5707c2[_0x34e4('0x43')][_0x34e4('0x52')]));_0x1bd962[_0x34e4('0x41')]=_0x1bd962[_0x34e4('0x41')]['length']?_0x1bd962[_0x34e4('0x41')]:_0x1e9e34['model'];_0x1bd962['order']=qs[_0x34e4('0xca')](_0x5707c2['query'][_0x34e4('0xca')]);_0x1bd962['where']=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x5707c2[_0x34e4('0x43')],_0x1e9e34[_0x34e4('0xc8')]));if(_0x5707c2[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x1bd962[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x1bd962[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x1bd962['attributes'],function(_0xd92a8){var _0x5120dd={};_0x5120dd[_0xd92a8]={'$like':'%'+_0x5707c2[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x5120dd;})});}_0x1bd962=_[_0x34e4('0xcc')]({},_0x1bd962,_0x5707c2[_0x34e4('0xcd')]);return _0x3cdc95[_0x34e4('0x147')](_0x1bd962);}})[_0x34e4('0x11')](function(_0x247f02){if(_0x247f02){_0x4ba7fd=_0x247f02['length'];if(!_0x5707c2[_0x34e4('0x43')]['hasOwnProperty'](_0x34e4('0xd5'))){_0x1bd962[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x5707c2[_0x34e4('0x43')]['limit']);_0x1bd962[_0x34e4('0x1f')]=qs['offset'](_0x5707c2[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x3cdc95[_0x34e4('0x147')](_0x1bd962);}})['then'](function(_0x235464){if(_0x235464){return _0x235464?{'count':_0x4ba7fd,'rows':_0x235464}:null;}})[_0x34e4('0x11')](respondWithResult(_0x51caaa,null))['catch'](handleError(_0x51caaa,null));};exports[_0x34e4('0x149')]=function(_0x68674a,_0x35e464){return db[_0x34e4('0x33')]['find']({'where':{'id':_0x68674a[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x35e464,null))['then'](function(_0x4cecbd){if(_0x4cecbd){return _0x4cecbd['addOpenchannelAccounts'](_0x68674a['body'][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x68674a[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{});}})[_0x34e4('0x11')](respondWithResult(_0x35e464,null))[_0x34e4('0x1b')](handleError(_0x35e464,null));};exports[_0x34e4('0x14a')]=function(_0x4c75d0,_0x33ace4){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x4c75d0[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x33ace4,null))[_0x34e4('0x11')](function(_0x337ba6){if(_0x337ba6){return _0x337ba6[_0x34e4('0x14a')](_0x4c75d0[_0x34e4('0x43')][_0x34e4('0x5b')]);}})[_0x34e4('0x11')](respondWithStatusCode(_0x33ace4,null))[_0x34e4('0x1b')](handleError(_0x33ace4,null));};exports[_0x34e4('0x14b')]=function(_0x13797e,_0x1f14ba){var _0x2abc7d={};var _0x4b99cf={};var _0x5bc38e;var _0x2f036b;return db[_0x34e4('0x33')]['findOne']({'where':{'id':_0x13797e[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x1f14ba,null))['then'](function(_0x43f452){if(_0x43f452){_0x5bc38e=_0x43f452;_0x4b99cf[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0x14c')][_0x34e4('0x34')]);_0x4b99cf[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x13797e[_0x34e4('0x43')]);_0x4b99cf[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x4b99cf[_0x34e4('0x4d')],_0x4b99cf[_0x34e4('0x43')]);_0x2abc7d['attributes']=_[_0x34e4('0x51')](_0x4b99cf['model'],qs[_0x34e4('0x52')](_0x13797e[_0x34e4('0x43')][_0x34e4('0x52')]));_0x2abc7d[_0x34e4('0x41')]=_0x2abc7d[_0x34e4('0x41')][_0x34e4('0x53')]?_0x2abc7d[_0x34e4('0x41')]:_0x4b99cf[_0x34e4('0x4d')];_0x2abc7d[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x13797e[_0x34e4('0x43')][_0x34e4('0xca')]);_0x2abc7d[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x13797e[_0x34e4('0x43')],_0x4b99cf[_0x34e4('0xc8')]));if(_0x13797e[_0x34e4('0x43')]['filter']){_0x2abc7d[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x2abc7d[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x2abc7d[_0x34e4('0x41')],function(_0x4d9c57){var _0x351667={};_0x351667[_0x4d9c57]={'$like':'%'+_0x13797e[_0x34e4('0x43')]['filter']+'%'};return _0x351667;})});}_0x2abc7d=_['merge']({},_0x2abc7d,_0x13797e['options']);return _0x5bc38e[_0x34e4('0x14b')](_0x2abc7d);}})[_0x34e4('0x11')](function(_0x311aa1){if(_0x311aa1){_0x2f036b=_0x311aa1[_0x34e4('0x53')];if(!_0x13797e[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x2abc7d[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x13797e[_0x34e4('0x43')][_0x34e4('0x21')]);_0x2abc7d[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x13797e[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x5bc38e[_0x34e4('0x14b')](_0x2abc7d);}})['then'](function(_0x7fdd4d){if(_0x7fdd4d){return _0x7fdd4d?{'count':_0x2f036b,'rows':_0x7fdd4d}:null;}})[_0x34e4('0x11')](respondWithResult(_0x1f14ba,null))['catch'](handleError(_0x1f14ba,null));};exports['addSmsAccounts']=function(_0x507a1b,_0x3c63ca){return db['User']['find']({'where':{'id':_0x507a1b[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x3c63ca,null))[_0x34e4('0x11')](function(_0x1e84f8){if(_0x1e84f8){return _0x1e84f8[_0x34e4('0x14d')](_0x507a1b['body'][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x507a1b[_0x34e4('0x57')],['ids','id'])||{});}})[_0x34e4('0x11')](respondWithResult(_0x3c63ca,null))['catch'](handleError(_0x3c63ca,null));};exports[_0x34e4('0x14e')]=function(_0x1ce5ea,_0x317219){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x1ce5ea[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x317219,null))[_0x34e4('0x11')](function(_0x412407){if(_0x412407){return _0x412407[_0x34e4('0x14e')](_0x1ce5ea[_0x34e4('0x43')][_0x34e4('0x5b')]);}})[_0x34e4('0x11')](respondWithStatusCode(_0x317219,null))[_0x34e4('0x1b')](handleError(_0x317219,null));};exports[_0x34e4('0x14f')]=function(_0x235ba5,_0x1e2ba5){var _0x2a10e1={};var _0x369dba={};var _0x4edc36;var _0x58e8f5;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x235ba5[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x1e2ba5,null))[_0x34e4('0x11')](function(_0x19aa59){if(_0x19aa59){_0x4edc36=_0x19aa59;_0x369dba[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0x150')]['rawAttributes']);_0x369dba[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x235ba5['query']);_0x369dba[_0x34e4('0xc8')]=_['intersection'](_0x369dba[_0x34e4('0x4d')],_0x369dba[_0x34e4('0x43')]);_0x2a10e1[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x369dba[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x235ba5[_0x34e4('0x43')][_0x34e4('0x52')]));_0x2a10e1[_0x34e4('0x41')]=_0x2a10e1[_0x34e4('0x41')][_0x34e4('0x53')]?_0x2a10e1['attributes']:_0x369dba[_0x34e4('0x4d')];_0x2a10e1['order']=qs['sort'](_0x235ba5[_0x34e4('0x43')]['sort']);_0x2a10e1[_0x34e4('0x3c')]=qs['filters'](_[_0x34e4('0xcb')](_0x235ba5[_0x34e4('0x43')],_0x369dba['filters']));if(_0x235ba5['query'][_0x34e4('0x2b')]){_0x2a10e1[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x2a10e1[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x2a10e1[_0x34e4('0x41')],function(_0x425398){var _0x1478d1={};_0x1478d1[_0x425398]={'$like':'%'+_0x235ba5['query'][_0x34e4('0x2b')]+'%'};return _0x1478d1;})});}_0x2a10e1=_[_0x34e4('0xcc')]({},_0x2a10e1,_0x235ba5[_0x34e4('0xcd')]);return _0x4edc36[_0x34e4('0x14f')](_0x2a10e1);}})['then'](function(_0x4981a0){if(_0x4981a0){_0x58e8f5=_0x4981a0[_0x34e4('0x53')];if(!_0x235ba5['query'][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x2a10e1['limit']=qs['limit'](_0x235ba5[_0x34e4('0x43')][_0x34e4('0x21')]);_0x2a10e1[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x235ba5['query'][_0x34e4('0x1f')]);}return _0x4edc36['getChatWebsites'](_0x2a10e1);}})[_0x34e4('0x11')](function(_0x3fed27){if(_0x3fed27){return _0x3fed27?{'count':_0x58e8f5,'rows':_0x3fed27}:null;}})[_0x34e4('0x11')](respondWithResult(_0x1e2ba5,null))[_0x34e4('0x1b')](handleError(_0x1e2ba5,null));};exports['addChatWebsites']=function(_0xeefccb,_0x4b68e9){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0xeefccb[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x4b68e9,null))[_0x34e4('0x11')](function(_0x28c8bb){if(_0x28c8bb){return _0x28c8bb[_0x34e4('0x151')](_0xeefccb[_0x34e4('0x57')]['ids'],_[_0x34e4('0x12b')](_0xeefccb['body'],[_0x34e4('0x5b'),'id'])||{});}})[_0x34e4('0x11')](respondWithResult(_0x4b68e9,null))[_0x34e4('0x1b')](handleError(_0x4b68e9,null));};exports[_0x34e4('0x152')]=function(_0x3b95c0,_0x4fd6bd){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x3b95c0['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x4fd6bd,null))[_0x34e4('0x11')](function(_0x44852e){if(_0x44852e){return _0x44852e[_0x34e4('0x152')](_0x3b95c0[_0x34e4('0x43')]['ids']);}})[_0x34e4('0x11')](respondWithStatusCode(_0x4fd6bd,null))[_0x34e4('0x1b')](handleError(_0x4fd6bd,null));};exports['getWhatsappAccounts']=function(_0x525a48,_0x4f54fc){var _0x25d9f3={};var _0x1f676c={};var _0x21f0ac;var _0x2197a9;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x525a48[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x4f54fc,null))[_0x34e4('0x11')](function(_0x34d1c2){if(_0x34d1c2){_0x21f0ac=_0x34d1c2;_0x1f676c[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0x153')][_0x34e4('0x34')]);_0x1f676c[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x525a48[_0x34e4('0x43')]);_0x1f676c['filters']=_[_0x34e4('0x51')](_0x1f676c[_0x34e4('0x4d')],_0x1f676c['query']);_0x25d9f3[_0x34e4('0x41')]=_['intersection'](_0x1f676c['model'],qs['fields'](_0x525a48[_0x34e4('0x43')][_0x34e4('0x52')]));_0x25d9f3[_0x34e4('0x41')]=_0x25d9f3[_0x34e4('0x41')][_0x34e4('0x53')]?_0x25d9f3['attributes']:_0x1f676c['model'];_0x25d9f3['order']=qs[_0x34e4('0xca')](_0x525a48[_0x34e4('0x43')][_0x34e4('0xca')]);_0x25d9f3['where']=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x525a48[_0x34e4('0x43')],_0x1f676c['filters']));if(_0x525a48[_0x34e4('0x43')]['filter']){_0x25d9f3['where']=_[_0x34e4('0xcc')](_0x25d9f3[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x25d9f3[_0x34e4('0x41')],function(_0x1c4455){var _0x387600={};_0x387600[_0x1c4455]={'$like':'%'+_0x525a48[_0x34e4('0x43')]['filter']+'%'};return _0x387600;})});}_0x25d9f3=_['merge']({},_0x25d9f3,_0x525a48[_0x34e4('0xcd')]);return _0x21f0ac[_0x34e4('0x154')](_0x25d9f3);}})[_0x34e4('0x11')](function(_0x28e816){if(_0x28e816){_0x2197a9=_0x28e816['length'];if(!_0x525a48['query'][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x25d9f3[_0x34e4('0x21')]=qs['limit'](_0x525a48['query'][_0x34e4('0x21')]);_0x25d9f3['offset']=qs[_0x34e4('0x1f')](_0x525a48[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x21f0ac[_0x34e4('0x154')](_0x25d9f3);}})[_0x34e4('0x11')](function(_0x19f714){if(_0x19f714){return _0x19f714?{'count':_0x2197a9,'rows':_0x19f714}:null;}})[_0x34e4('0x11')](respondWithResult(_0x4f54fc,null))[_0x34e4('0x1b')](handleError(_0x4f54fc,null));};exports[_0x34e4('0x155')]=function(_0x115540,_0x287299){return db[_0x34e4('0x33')]['find']({'where':{'id':_0x115540[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x287299,null))['then'](function(_0x133907){if(_0x133907){return _0x133907[_0x34e4('0x155')](_0x115540['body'][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x115540[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{});}})[_0x34e4('0x11')](respondWithResult(_0x287299,null))['catch'](handleError(_0x287299,null));};exports[_0x34e4('0x156')]=function(_0x4e9169,_0x27acc2){return db['User']['find']({'where':{'id':_0x4e9169[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x27acc2,null))[_0x34e4('0x11')](function(_0x17d5c0){if(_0x17d5c0){return _0x17d5c0['removeWhatsappAccounts'](_0x4e9169[_0x34e4('0x43')][_0x34e4('0x5b')]);}})[_0x34e4('0x11')](respondWithStatusCode(_0x27acc2,null))[_0x34e4('0x1b')](handleError(_0x27acc2,null));};exports[_0x34e4('0x157')]=function(_0x3f16a7,_0x461148){var _0x22675e={};var _0x13a23d={};var _0x30fd67;var _0xe820fd;return db[_0x34e4('0x33')][_0x34e4('0x90')]({'where':{'id':_0x3f16a7[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x461148,null))[_0x34e4('0x11')](function(_0x21da37){if(_0x21da37){_0x30fd67=_0x21da37;_0x13a23d[_0x34e4('0x4d')]=_[_0x34e4('0x50')](db[_0x34e4('0x158')][_0x34e4('0x34')]);_0x13a23d['query']=_[_0x34e4('0x50')](_0x3f16a7[_0x34e4('0x43')]);_0x13a23d[_0x34e4('0xc8')]=_[_0x34e4('0x51')](_0x13a23d[_0x34e4('0x4d')],_0x13a23d['query']);_0x22675e[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x13a23d['model'],qs[_0x34e4('0x52')](_0x3f16a7[_0x34e4('0x43')][_0x34e4('0x52')]));_0x22675e[_0x34e4('0x41')]=_0x22675e[_0x34e4('0x41')]['length']?_0x22675e[_0x34e4('0x41')]:_0x13a23d['model'];_0x22675e[_0x34e4('0xc9')]=qs[_0x34e4('0xca')](_0x3f16a7[_0x34e4('0x43')][_0x34e4('0xca')]);_0x22675e[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x3f16a7['query'],_0x13a23d[_0x34e4('0xc8')]));if(_0x3f16a7[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x22675e[_0x34e4('0x3c')]=_['merge'](_0x22675e['where'],{'$or':_[_0x34e4('0x35')](_0x22675e[_0x34e4('0x41')],function(_0x5f4a74){var _0x29c805={};_0x29c805[_0x5f4a74]={'$like':'%'+_0x3f16a7[_0x34e4('0x43')][_0x34e4('0x2b')]+'%'};return _0x29c805;})});}_0x22675e=_[_0x34e4('0xcc')]({},_0x22675e,_0x3f16a7[_0x34e4('0xcd')]);return _0x30fd67[_0x34e4('0x157')](_0x22675e);}})[_0x34e4('0x11')](function(_0x17ccff){if(_0x17ccff){_0xe820fd=_0x17ccff[_0x34e4('0x53')];if(!_0x3f16a7[_0x34e4('0x43')][_0x34e4('0xce')]('nolimit')){_0x22675e['limit']=qs[_0x34e4('0x21')](_0x3f16a7['query'][_0x34e4('0x21')]);_0x22675e['offset']=qs[_0x34e4('0x1f')](_0x3f16a7[_0x34e4('0x43')][_0x34e4('0x1f')]);}return _0x30fd67[_0x34e4('0x157')](_0x22675e);}})[_0x34e4('0x11')](function(_0x1fc09d){if(_0x1fc09d){return _0x1fc09d?{'count':_0xe820fd,'rows':_0x1fc09d}:null;}})[_0x34e4('0x11')](respondWithResult(_0x461148,null))[_0x34e4('0x1b')](handleError(_0x461148,null));};exports['addSquareProjects']=function(_0x2c5d3a,_0x5b1f86){return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x2c5d3a[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x5b1f86,null))['then'](function(_0x2e30e6){if(_0x2e30e6){return _0x2e30e6[_0x34e4('0x159')](_0x2c5d3a[_0x34e4('0x57')][_0x34e4('0x5b')],_[_0x34e4('0x12b')](_0x2c5d3a[_0x34e4('0x57')],[_0x34e4('0x5b'),'id'])||{});}})[_0x34e4('0x11')](respondWithResult(_0x5b1f86,null))[_0x34e4('0x1b')](handleError(_0x5b1f86,null));};exports[_0x34e4('0x15a')]=function(_0x19d67c,_0x1fdb89){return db['User'][_0x34e4('0x2d')]({'where':{'id':_0x19d67c['params']['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x1fdb89,null))[_0x34e4('0x11')](function(_0x22eaf3){if(_0x22eaf3){return _0x22eaf3[_0x34e4('0x15a')](_0x19d67c[_0x34e4('0x43')][_0x34e4('0x5b')]);}})['then'](respondWithStatusCode(_0x1fdb89,null))[_0x34e4('0x1b')](handleError(_0x1fdb89,null));};exports[_0x34e4('0x15b')]=function(_0x2ec6fe,_0x28594a){var _0x138fb6={},_0x4fc624={},_0x457618={'count':0x0,'rows':[]};var _0x3abc71=db[_0x34e4('0x15c')][_0x34e4('0x34')];_0x4fc624[_0x34e4('0x4d')]=_[_0x34e4('0x50')](_0x3abc71);_0x4fc624[_0x34e4('0x43')]=_[_0x34e4('0x50')](_0x2ec6fe['query']);_0x4fc624['filters']=_[_0x34e4('0x51')](_0x4fc624[_0x34e4('0x4d')],_0x4fc624[_0x34e4('0x43')]);_0x4fc624['filters']=_[_0x34e4('0x100')](_0x4fc624[_0x34e4('0xc8')],[_0x34e4('0x15d'),_0x34e4('0x15e'),_0x34e4('0x15f'),_0x34e4('0x160'),_0x34e4('0x161'),_0x34e4('0x162'),_0x34e4('0x163'),_0x34e4('0x164'),_0x34e4('0x165'),_0x34e4('0x166'),'$notBetween',_0x34e4('0x167'),_0x34e4('0x168'),_0x34e4('0x169'),_0x34e4('0x16a'),_0x34e4('0x16b'),_0x34e4('0x16c'),_0x34e4('0x169'),_0x34e4('0x16d'),_0x34e4('0x16e'),_0x34e4('0x16f'),_0x34e4('0x170')]);_0x138fb6[_0x34e4('0x41')]=_[_0x34e4('0x51')](_0x4fc624[_0x34e4('0x4d')],qs[_0x34e4('0x52')](_0x2ec6fe['query'][_0x34e4('0x52')]));_0x138fb6['attributes']=_0x138fb6[_0x34e4('0x41')]['length']?_0x138fb6[_0x34e4('0x41')]:_0x4fc624[_0x34e4('0x4d')];if(!_0x2ec6fe[_0x34e4('0x43')][_0x34e4('0xce')]('nolimit')){_0x138fb6[_0x34e4('0x21')]=qs[_0x34e4('0x21')](_0x2ec6fe[_0x34e4('0x43')][_0x34e4('0x21')]);_0x138fb6[_0x34e4('0x1f')]=qs[_0x34e4('0x1f')](_0x2ec6fe[_0x34e4('0x43')][_0x34e4('0x1f')]);}_0x138fb6['order']=qs[_0x34e4('0xca')](_0x2ec6fe[_0x34e4('0x43')]['sort']);_0x138fb6[_0x34e4('0x3c')]=qs[_0x34e4('0xc8')](_[_0x34e4('0xcb')](_0x2ec6fe[_0x34e4('0x43')],_0x4fc624[_0x34e4('0xc8')]));if(_0x2ec6fe[_0x34e4('0x43')][_0x34e4('0x2b')]){_0x138fb6[_0x34e4('0x3c')]=_[_0x34e4('0xcc')](_0x138fb6[_0x34e4('0x3c')],{'$or':_[_0x34e4('0x35')](_0x138fb6['attributes'],function(_0x52beba){var _0xf99b1b={};_0xf99b1b[_0x52beba]={'$like':'%'+_0x2ec6fe['query'][_0x34e4('0x2b')]+'%'};return _0xf99b1b;})});}_0x138fb6[_0x34e4('0x3c')]={'$and':[_0x138fb6[_0x34e4('0x3c')],{'$or':[{'UserId':_0x2ec6fe[_0x34e4('0x58')]['id']},{'OwnerId':_0x2ec6fe[_0x34e4('0x58')]['id']}]}]};_0x138fb6=_[_0x34e4('0xcc')]({},_0x138fb6,_0x2ec6fe[_0x34e4('0xcd')]);var _0x46211f={'where':_0x138fb6[_0x34e4('0x3c')]};return db['CmHopper']['count'](_0x46211f)[_0x34e4('0x11')](function(_0x3b3e2a){_0x457618[_0x34e4('0x22')]=_0x3b3e2a;if(_0x2ec6fe[_0x34e4('0x43')][_0x34e4('0x3d')]){_0x138fb6['include']=[{'attributes':['id',_0x34e4('0x171'),'lastName',_0x34e4('0xed')],'model':db[_0x34e4('0xc7')],'as':_0x34e4('0x172')},{'attributes':['id',_0x34e4('0x3a'),_0x34e4('0x173')],'model':db[_0x34e4('0x174')],'as':_0x34e4('0xd7')}];}return db[_0x34e4('0x15c')][_0x34e4('0x82')](_0x138fb6);})[_0x34e4('0x11')](function(_0x1287ab){_0x457618['rows']=_0x1287ab;return _0x457618;})[_0x34e4('0x11')](respondWithFilteredResult(_0x28594a,_0x138fb6))[_0x34e4('0x1b')](handleError(_0x28594a,null));};exports[_0x34e4('0x175')]=function(_0x2185ab,_0x2eab6c){if(!_['isNil'](_0x2185ab[_0x34e4('0x28')]['id'])&&(_0x2185ab[_0x34e4('0x28')][_0x34e4('0x26')]==_0x34e4('0x77')||_0x2185ab['user'][_0x34e4('0x26')]==_0x34e4('0x28'))){return db['User'][_0x34e4('0x90')]({'where':{'id':_0x2185ab['params']['id']},'raw':!![]})[_0x34e4('0x11')](function(_0x5827c1){return authService[_0x34e4('0x176')](_0x5827c1);})[_0x34e4('0x11')](function(_0x3e45d7){if(_0x3e45d7){return _0x2eab6c[_0x34e4('0x1c')](0xc8)['json']({'api_key':_0x3e45d7[_0x34e4('0x177')]});}else{return _0x2eab6c[_0x34e4('0x1c')](0xcc)[_0x34e4('0x1e')]({'message':_0x34e4('0x178')});}})[_0x34e4('0x1b')](handleError(_0x2eab6c,0x193));}else{return _0x2eab6c[_0x34e4('0x1c')](0x191)[_0x34e4('0x1e')]({'message':_0x34e4('0x179')});}};exports['createApiKey']=function(_0x58558c,_0x1a2aec){if(!_[_0x34e4('0x5e')](_0x58558c[_0x34e4('0x28')]['id'])&&(_0x58558c[_0x34e4('0x28')][_0x34e4('0x26')]==_0x34e4('0x77')||_0x58558c[_0x34e4('0x28')][_0x34e4('0x26')]==_0x34e4('0x28'))){return db[_0x34e4('0x33')][_0x34e4('0x2d')]({'where':{'id':_0x58558c[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](function(_0x5140a2){return authService['generateApiKey'](_0x5140a2);})[_0x34e4('0x11')](function(_0x25910f){return db['User'][_0x34e4('0x56')]({'apiKeyIat':_0x25910f[_0x34e4('0x17a')],'apiKeyNonce':_0x25910f['nonce']},{'where':{'id':_0x58558c[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](function(){return _0x1a2aec[_0x34e4('0x1c')](0xc8)[_0x34e4('0x1e')]({'api_key':_0x25910f['token']});});})['catch'](handleError(_0x1a2aec,0x193));}else{return _0x1a2aec[_0x34e4('0x1c')](0x191)[_0x34e4('0x1e')]({'message':_0x34e4('0x179')});}};exports['removeApiKey']=function(_0x4e4bf8,_0x3bf95a){if(!_['isNil'](_0x4e4bf8['user']['id'])&&(_0x4e4bf8[_0x34e4('0x28')][_0x34e4('0x26')]=='admin'||_0x4e4bf8[_0x34e4('0x28')]['role']==_0x34e4('0x28'))){return db[_0x34e4('0x33')]['find']({'where':{'id':_0x4e4bf8[_0x34e4('0x58')]['id']}})[_0x34e4('0x11')](handleEntityNotFound(_0x3bf95a,null))[_0x34e4('0x11')](function(_0x330863){if(_0x330863&&_0x330863[_0x34e4('0x17b')]&&_0x330863[_0x34e4('0x17c')])return _0x330863;else throw{'message':_0x34e4('0x17d')};})[_0x34e4('0x11')](function(){return db[_0x34e4('0x33')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x4e4bf8[_0x34e4('0x58')]['id']}});})[_0x34e4('0x11')](respondWithStatusCode(_0x3bf95a,0xc8))[_0x34e4('0x1b')](handleError(_0x3bf95a,0x193));}else{return _0x3bf95a['status'](0x191)[_0x34e4('0x1e')]({'message':_0x34e4('0x179')});}};exports[_0x34e4('0x17e')]=function(_0xc5dc25,_0xb71a74){var _0x3d825c=_0xc5dc25[_0x34e4('0x28')][_0x34e4('0xa5')]({'plain':!![]});if(!_0x3d825c){return _0xb71a74[_0x34e4('0x1c')](0x191)['send']('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{Promise['resolve']()[_0x34e4('0x11')](function(){if(_0xc5dc25[_0x34e4('0x43')]['userSetting']!=='true')return;return _0xc5dc25[_0x34e4('0x28')]['getUserSetting']();})[_0x34e4('0x11')](function(_0x35ec6f){if(!_0x35ec6f)return;return _0x35ec6f[_0x34e4('0xa5')]({'plain':!![]});})[_0x34e4('0x11')](function(_0x2a2d14){_0x3d825c['userSetting']=_0x2a2d14;return _0xb71a74[_0x34e4('0x1c')](0xc8)[_0x34e4('0x1e')](_0x3d825c);});}};exports['getPresence']=function(_0x3ba173,_0x23242d){var _0x41bd7d={'offset':0x0},_0x30d5ce={'count':0x0,'rows':[]};Promise[_0x34e4('0x102')]()['then'](function(){if(!_0x3ba173[_0x34e4('0x43')]['filter']&&!_0x3ba173[_0x34e4('0x43')][_0x34e4('0x17f')]&&!_0x3ba173[_0x34e4('0x43')][_0x34e4('0x180')])return[];return Promise[_0x34e4('0x102')]()[_0x34e4('0x11')](function(){var _0x32e84f=[];if(!_[_0x34e4('0x83')](_0x3ba173[_0x34e4('0x43')][_0x34e4('0x17f')])){_0x32e84f[_0x34e4('0x42')](db[_0x34e4('0x110')][_0x34e4('0x82')]({'attributes':['id',_0x34e4('0x3a')],'where':{'id':_0x3ba173[_0x34e4('0x43')][_0x34e4('0x17f')]}}));}if(!_[_0x34e4('0x83')](_0x3ba173[_0x34e4('0x43')][_0x34e4('0x180')])){_0x32e84f[_0x34e4('0x42')](db[_0x34e4('0x174')][_0x34e4('0x82')]({'attributes':['id',_0x34e4('0x3a')],'type':_0x34e4('0x181'),'where':{'id':_0x3ba173['query']['queues']}}));}return Promise['all'](_0x32e84f);})['then'](function(_0x48c60d){var _0x526750=_['flatten'](_0x48c60d)[_0x34e4('0x35')](function(_0x103997){return _0x103997[_0x34e4('0x127')]({'attributes':['id',_0x34e4('0x3a'),_0x34e4('0x5c'),_0x34e4('0xa6')],'raw':!![]});});return Promise[_0x34e4('0x4c')](_0x526750);})['then'](function(_0x55f911){var _0x14658a=_[_0x34e4('0x11a')](_0x55f911);if(!_0x3ba173['query'][_0x34e4('0x2b')])return _0x14658a;if(_[_0x34e4('0x83')](_0x14658a)){return db[_0x34e4('0x33')][_0x34e4('0x82')]({'attributes':['id',_0x34e4('0x3a'),'internal',_0x34e4('0xa6')],'where':{'role':'agent','$or':[db[_0x34e4('0x60')][_0x34e4('0x3c')](db[_0x34e4('0x60')]['fn']('lower',db[_0x34e4('0x60')]['col']('name')),{'$like':'%'+_0x3ba173[_0x34e4('0x43')][_0x34e4('0x2b')][_0x34e4('0x9f')]()+'%'}),{'internal':{'$like':'%'+_0x3ba173[_0x34e4('0x43')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x14658a)['flatten']()[_0x34e4('0x2b')](function(_0x345017){return _0x345017[_0x34e4('0x3a')][_0x34e4('0x9f')]()[_0x34e4('0x38')](_0x3ba173[_0x34e4('0x43')]['filter'][_0x34e4('0x9f')]())||_0x345017[_0x34e4('0x5c')][_0x34e4('0x182')]()[_0x34e4('0x38')](_0x3ba173[_0x34e4('0x43')][_0x34e4('0x2b')]);})[_0x34e4('0x2c')]();}})[_0x34e4('0x11')](function(_0x12c6c4){var _0x5e5a5b=_0x34e4('0x3a');var _0x11bc71=_0x34e4('0x183');if(_0x3ba173['query'][_0x34e4('0xca')]){_0x11bc71=_0x3ba173[_0x34e4('0x43')][_0x34e4('0xca')][0x0]==='-'?_0x34e4('0x184'):_0x34e4('0x183');_0x5e5a5b=_0x11bc71===_0x34e4('0x183')?_0x3ba173[_0x34e4('0x43')][_0x34e4('0xca')]:_0x3ba173[_0x34e4('0x43')]['sort'][_0x34e4('0x185')](0x1);}return _(_0x12c6c4)[_0x34e4('0x186')]('id')['orderBy']([function(_0x2d769b){return _0x5e5a5b===_0x34e4('0x3a')?_0x2d769b[_0x5e5a5b]['toLowerCase']():_0x2d769b[_0x5e5a5b];}],[_0x11bc71])['map'](function(_0x18ca0a){return _['pick'](_0x18ca0a,['id',_0x34e4('0x3a'),'internal',_0x34e4('0xa6')]);})[_0x34e4('0x2c')]();})['then'](function(_0x36702d){return client[_0x34e4('0x10')](_0x34e4('0x29'),_0x3ba173)[_0x34e4('0x11')](function(_0x1c0cb1){if(_0x1c0cb1[_0x34e4('0x17')])throw new Error(_0x34e4('0x187'));var _0x24a7ed=_0x1c0cb1[_0x34e4('0x188')];var _0x49df47=jayson[_0x34e4('0xe')][_0x34e4('0xf')]({'port':0x232c});return _0x49df47[_0x34e4('0x10')]('Agents',_0x3ba173)['then'](function(_0x3b9c6e){if(_0x3b9c6e['error'])throw new Error(_0x34e4('0x189'));var _0x4af1dd=_0x3b9c6e[_0x34e4('0x188')];return _['merge']({},_0x4af1dd,_0x24a7ed);});})[_0x34e4('0x11')](function(_0x2a8cd2){return _['map'](_0x36702d,function(_0x823978){var _0x486ebe=_['find'](_0x2a8cd2['rows'],['id',_0x823978['id']]);if(!_0x486ebe||!_0x823978['online']){_0x823978['status']='offline';}else if(_0x486ebe[_0x34e4('0x99')]){_0x823978['status']='pause';}else{_0x823978[_0x34e4('0x1c')]=_[_0x34e4('0x38')]([_0x34e4('0x18a'),_0x34e4('0x18b'),_0x34e4('0x18c'),_0x34e4('0x18d'),null,undefined],_0x486ebe[_0x34e4('0x18e')])?'online':_0x34e4('0x18f');}return _0x823978;});});});})[_0x34e4('0x11')](function(_0x54747c){if(!_0x3ba173[_0x34e4('0x43')][_0x34e4('0xce')](_0x34e4('0xd5'))){_0x41bd7d[_0x34e4('0x21')]=qs['limit'](_0x3ba173[_0x34e4('0x43')][_0x34e4('0x21')]||0xa);_0x41bd7d['offset']=qs[_0x34e4('0x1f')](_0x3ba173[_0x34e4('0x43')][_0x34e4('0x1f')]);}_0x30d5ce[_0x34e4('0x22')]=_0x54747c['length'];_0x30d5ce[_0x34e4('0x45')]=_0x41bd7d['limit']?_0x54747c[_0x34e4('0x190')](_0x41bd7d[_0x34e4('0x1f')],_0x41bd7d[_0x34e4('0x1f')]+_0x41bd7d[_0x34e4('0x21')]):_0x54747c;return _0x30d5ce;})[_0x34e4('0x11')](respondWithFilteredResult(_0x23242d,_0x41bd7d))[_0x34e4('0x1b')](handleError(_0x23242d,null));};function get_open_tabs(_0x68caf3,_0x267290){var _0x22aa76=_0x68caf3['charAt'](0x0)[_0x34e4('0x191')]()+_0x68caf3[_0x34e4('0x190')](0x1);var _0x28f085={'type':db[_0x34e4('0x89')][_0x34e4('0x62')]['SELECT'],'raw':!![]};return new BPromise(function(_0x260107,_0x157689){var _0x183483=squel[_0x34e4('0x192')]()[_0x34e4('0x193')](_0x34e4('0x194')+_0x22aa76+_0x34e4('0x195'),'id')['field'](_0x34e4('0x196'))[_0x34e4('0x63')](_0x34e4('0x197')+_0x68caf3+_0x34e4('0x198'),'ui')[_0x34e4('0x3c')](_0x34e4('0x199'),_0x267290['id']);return db[_0x34e4('0x60')][_0x34e4('0x43')](_0x183483[_0x34e4('0x182')](),_0x28f085)[_0x34e4('0x11')](function(_0x5df924){_0x267290[_0x22aa76+_0x34e4('0x19a')]=_0x5df924;_0x260107(_0x5df924);})['catch'](function(_0x2ea978){_0x157689(_0x2ea978);});});}
\ No newline at end of file
index 7ac382b..27460e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7306=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','User'];(function(_0x321c16,_0x186491){var _0x3e3498=function(_0x5d4dc7){while(--_0x5d4dc7){_0x321c16['push'](_0x321c16['shift']());}};_0x3e3498(++_0x186491);}(_0x7306,0x75));var _0x6730=function(_0x4cf984,_0x15b8ab){_0x4cf984=_0x4cf984-0x0;var _0x2cd092=_0x7306[_0x4cf984];return _0x2cd092;};'use strict';var EventEmitter=require(_0x6730('0x0'));var User=require(_0x6730('0x1'))['db'][_0x6730('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x6730('0x3')](0x0);var events={'afterCreate':_0x6730('0x4'),'afterUpdate':_0x6730('0x5'),'afterDestroy':_0x6730('0x6')};function emitEvent(_0x9b88df){return function(_0x121f09,_0x421a9c,_0x3437c4){UserEvents[_0x6730('0x7')](_0x9b88df+':'+_0x121f09['id'],_0x121f09);UserEvents['emit'](_0x9b88df,_0x121f09);_0x3437c4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0x6730('0x8')](e,emitEvent(event));}}module[_0x6730('0x9')]=UserEvents;
\ No newline at end of file
+var _0x3936=['exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x254744,_0x219e6b){var _0x2a6a96=function(_0x26aceb){while(--_0x26aceb){_0x254744['push'](_0x254744['shift']());}};_0x2a6a96(++_0x219e6b);}(_0x3936,0x161));var _0x6393=function(_0x2e8a6e,_0x18e64f){_0x2e8a6e=_0x2e8a6e-0x0;var _0x259829=_0x3936[_0x2e8a6e];return _0x259829;};'use strict';var EventEmitter=require(_0x6393('0x0'));var User=require(_0x6393('0x1'))['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0x6393('0x2')](0x0);var events={'afterCreate':_0x6393('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3e111f){return function(_0x23cb51,_0x36feab,_0x436641){UserEvents['emit'](_0x3e111f+':'+_0x23cb51['id'],_0x23cb51);UserEvents[_0x6393('0x4')](_0x3e111f,_0x23cb51);_0x436641(null);};}for(var e in events){if(events[_0x6393('0x5')](e)){var event=events[e];User[_0x6393('0x6')](e,emitEvent(event));}}module[_0x6393('0x7')]=UserEvents;
\ No newline at end of file
index 9cdc040..e452995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5864=['StopMixMonitor','wav','WAV','gsm','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','name','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','then','internal','catch','exports','models','define','User','users','utf8','undefined','resolve','userProfileId','privacyEnabled','updatePassword','changed','UserProfile','concat','userSetting','createUserSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','salt','base64','sha1','pbkdf2','indexOf','makeSalt','md5secret','bluebird','util','lodash','google','context','from-sip','system','length','format','%s%s','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','options','join'];(function(_0x224c71,_0x50da95){var _0x3e34f8=function(_0x1eaf8b){while(--_0x1eaf8b){_0x224c71['push'](_0x224c71['shift']());}};_0x3e34f8(++_0x50da95);}(_0x5864,0x7d));var _0x4586=function(_0x2880cd,_0x4fd6f4){_0x2880cd=_0x2880cd-0x0;var _0x540615=_0x5864[_0x2880cd];return _0x540615;};'use strict';var BPromise=require(_0x4586('0x0'));var crypto=require('crypto');var util=require(_0x4586('0x1'));var md5=require('md5');var _=require(_0x4586('0x2'));var attributes=require('./user.attributes');var authTypes=[_0x4586('0x3')];var validatePresenceOf=function(_0x4a502f){return _0x4a502f&&_0x4a502f['length'];};var getChanSpyApplications=function(_0x5061f6,_0x2d1565,_0x58b751){var _0x522bb5={'context':_0x5061f6[_0x4586('0x4')]||_0x4586('0x5'),'type':_0x4586('0x6'),'isApp':![],'UserId':_0x5061f6['id']};var _0x2fda7b=[];for(var _0x265f51=0x0,_0x160acc=0x1;_0x265f51<_0x58b751[_0x4586('0x7')];_0x265f51++,_0x160acc=0x1){var _0x200168={'exten':util[_0x4586('0x8')](_0x4586('0x9'),_0x58b751[_0x265f51]['prefix'],_0x2d1565),'ChanSpyId':_0x58b751[_0x265f51]['id']};_0x2fda7b[_0x4586('0xa')](_[_0x4586('0xb')]({'app':_0x4586('0xc'),'appdata':util['format'](_0x4586('0xd'),_0x4586('0xe')),'priority':_0x160acc++},_0x522bb5,_0x200168));if(_0x58b751[_0x265f51][_0x4586('0xf')]){_0x2fda7b[_0x4586('0xa')](_[_0x4586('0xb')]({'app':_0x4586('0x10'),'appdata':util['format'](_0x4586('0x11'),_0x58b751[_0x265f51][_0x4586('0x12')]),'priority':_0x160acc++},_0x522bb5,_0x200168));}if(_0x58b751[_0x265f51]['auth']){_0x2fda7b[_0x4586('0xa')](_[_0x4586('0xb')]({'app':_0x4586('0x13'),'appdata':_0x58b751[_0x265f51][_0x4586('0x14')],'priority':_0x160acc++},_0x522bb5,_0x200168));}_0x2fda7b[_0x4586('0xa')](_[_0x4586('0xb')]({'app':_0x4586('0x15'),'appdata':util[_0x4586('0x8')](_0x4586('0x16'),_0x5061f6['name'],_0x58b751[_0x265f51]['options']?_0x58b751[_0x265f51][_0x4586('0x17')][_0x4586('0x18')](''):''),'priority':_0x160acc++},_0x522bb5,_0x200168));if(_0x58b751[_0x265f51]['record']){_0x2fda7b[_0x4586('0xa')](_[_0x4586('0xb')]({'app':_0x4586('0x19'),'priority':_0x160acc++},_0x522bb5,_0x200168));}}return _0x2fda7b;};var getUserApplications=function(_0x2af18b,_0x26fa52){var _0x5c355f=[_0x4586('0x1a'),_0x4586('0x1b'),_0x4586('0x1c')];var _0x106778={'context':_0x2af18b[_0x4586('0x4')]||'from-sip','exten':_0x26fa52,'type':'system','isApp':![],'UserId':_0x2af18b['id']};var _0x2ed89a=[{'app':_0x4586('0xc'),'appdata':_0x4586('0x1d')}];if(_0x2af18b[_0x4586('0x1e')]&&_[_0x4586('0x1f')](_0x5c355f,_0x2af18b[_0x4586('0x1e')])){_0x2ed89a[_0x4586('0xa')]({'app':_0x4586('0xc'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x2ed89a[_0x4586('0xa')]({'app':_0x4586('0xc'),'appdata':util['format'](_0x4586('0x20'),_0x2af18b['extensionMonitor'])});_0x2ed89a[_0x4586('0xa')]({'app':_0x4586('0x21'),'appdata':util['format']('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x2af18b[_0x4586('0x22')])});}else{_0x2ed89a[_0x4586('0xa')]({'app':_0x4586('0x21'),'appdata':util[_0x4586('0x8')](_0x4586('0x23'),_0x2af18b[_0x4586('0x22')])});}_0x2ed89a[_0x4586('0xa')]({'app':_0x4586('0x24')});for(var _0x39e126=0x0;_0x39e126<_0x2ed89a[_0x4586('0x7')];_0x39e126++){_0x2ed89a[_0x39e126][_0x4586('0x25')]=_0x39e126+0x1;_0x2ed89a[_0x39e126]=_[_0x4586('0x26')](_0x2ed89a[_0x39e126],_0x106778);}return _0x2ed89a;};var getChanSpyPromise=function(_0x490973,_0x191583){return new BPromise(function(_0xd9fcb3,_0x9a0f20){return _0x490973[_0x4586('0x27')]['findAll']()[_0x4586('0x28')](function(_0x32a477){if(_0x32a477){var _0x15a4ef=getChanSpyApplications(_0x191583,_0x191583[_0x4586('0x29')],_0x32a477);if(_0x191583['internal']!=_0x191583[_0x4586('0x22')]){_0x15a4ef=_0x15a4ef['concat'](getChanSpyApplications(_0x191583,_0x191583[_0x4586('0x22')],_0x32a477));}return _0xd9fcb3(_0x15a4ef);}return _0xd9fcb3([]);})[_0x4586('0x2a')](function(_0x232e71){_0x9a0f20(_0x232e71);});});};module[_0x4586('0x2b')]=function(_0x3af0c4){var _0x4c792c=_0x3af0c4[_0x4586('0x2c')];return _0x3af0c4[_0x4586('0x2d')](_0x4586('0x2e'),attributes,{'tableName':_0x4586('0x2f'),'charset':_0x4586('0x30'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0xe94fef,_0x41db7e,_0x59efbb){var _0xefbb8a=typeof _0xe94fef['userProfileId']===_0x4586('0x31')?BPromise[_0x4586('0x32')](null):_0x4c792c['UserProfile']['find']({'where':{'id':_0xe94fef[_0x4586('0x33')]}});_0xefbb8a['then'](function(_0x568e4d){if(_0x568e4d){_0xe94fef['privacyEnabled']=_0x568e4d[_0x4586('0x34')];}})[_0x4586('0x28')](function(){_0xe94fef['updateMd5Password']();_0xe94fef[_0x4586('0x35')](_0x59efbb);})[_0x4586('0x2a')](function(_0x441536){_0x59efbb(_0x441536);});},'beforeUpdate':function(_0x14866a,_0x451d63,_0x33c228){Promise[_0x4586('0x32')]()[_0x4586('0x28')](function(){if(_0x14866a[_0x4586('0x36')](_0x4586('0x33'))===![])return;return _0x4c792c[_0x4586('0x37')]['find']({'where':{'id':_0x14866a[_0x4586('0x33')]}})[_0x4586('0x28')](function(_0x30c57c){if(_0x30c57c)_0x14866a['privacyEnabled']=_0x30c57c[_0x4586('0x34')];return;});})[_0x4586('0x28')](function(){if(_0x14866a[_0x4586('0x36')](_0x4586('0x14'))){_0x14866a['updateMd5Password']();return _0x14866a['updatePassword'](_0x33c228);}_0x33c228();})['catch'](function(_0xaee1c8){_0x33c228(_0xaee1c8);});},'afterCreate':function(_0x12ab2f,_0x2179b6,_0x5a1a69){var _0x20375d=getUserApplications(_0x12ab2f,_0x12ab2f[_0x4586('0x29')]);if(_0x12ab2f[_0x4586('0x29')]!=_0x12ab2f[_0x4586('0x22')]){_0x20375d=_0x20375d[_0x4586('0x38')](getUserApplications(_0x12ab2f,_0x12ab2f[_0x4586('0x22')]));}return Promise[_0x4586('0x32')]()[_0x4586('0x28')](function(){if(!_0x12ab2f[_0x4586('0x39')]){return _0x12ab2f[_0x4586('0x3a')]({'clientSideLoggingLevel':_0x4586('0x3b'),'clientSideLoggingEnabled':![]});}})[_0x4586('0x28')](function(){return _0x4c792c[_0x4586('0x3c')]['bulkCreate'](_0x20375d);})[_0x4586('0x28')](function(){if(_0x12ab2f[_0x4586('0xe')]){return getChanSpyPromise(_0x4c792c,_0x12ab2f);}})[_0x4586('0x28')](function(_0x3d32b8){if(_0x3d32b8&&_0x3d32b8['length']){return _0x4c792c[_0x4586('0x3c')][_0x4586('0x3d')](_0x3d32b8);}})[_0x4586('0x28')](function(){_0x5a1a69();})[_0x4586('0x2a')](function(_0x221e3e){_0x5a1a69(_0x221e3e);});},'afterUpdate':function(_0x4b36af,_0x1e23f7,_0x3124c0){return BPromise['resolve']()[_0x4586('0x28')](function(){if(_0x4b36af[_0x4586('0x36')](_0x4586('0xe'))||_0x4b36af['changed'](_0x4586('0x4'))){return _0x4c792c[_0x4586('0x3c')][_0x4586('0x3e')]({'where':{'UserId':_0x4b36af['id'],'type':_0x4586('0x6'),'ChanSpyId':{'$ne':null}}})[_0x4586('0x28')](function(){if(_0x4b36af[_0x4586('0xe')]){return getChanSpyPromise(_0x4c792c,_0x4b36af)[_0x4586('0x28')](function(_0x1e407e){if(_0x1e407e&&_0x1e407e[_0x4586('0x7')]){return _0x4c792c[_0x4586('0x3c')][_0x4586('0x3d')](_0x1e407e);}});}});}})[_0x4586('0x28')](function(){if(_0x4b36af[_0x4586('0x36')]('extensionMonitor')||_0x4b36af['changed'](_0x4586('0x4'))){return _0x4c792c[_0x4586('0x3c')]['destroy']({'where':{'UserId':_0x4b36af['id'],'type':_0x4586('0x6'),'ChanSpyId':null}})[_0x4586('0x28')](function(){var _0x2e4cda=getUserApplications(_0x4b36af,_0x4b36af['internal']);if(_0x4b36af['internal']!=_0x4b36af['name']){_0x2e4cda=_0x2e4cda[_0x4586('0x38')](getUserApplications(_0x4b36af,_0x4b36af['name']));}return _0x4c792c[_0x4586('0x3c')][_0x4586('0x3d')](_0x2e4cda);});}})['then'](function(){_0x3124c0();})[_0x4586('0x2a')](function(_0x33cacf){_0x3124c0(_0x33cacf);});},'afterDestroy':function(_0x2e4839){return _0x4c792c[_0x4586('0x3c')][_0x4586('0x3e')]({'where':{'UserId':_0x2e4839['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x1b48fa,_0x4b4dd4){if(!_0x4b4dd4){return this[_0x4586('0x14')]===this[_0x4586('0x3f')](_0x1b48fa);}var _0x3f3cc5=this;this['encryptPassword'](_0x1b48fa,function(_0x56557a,_0x4b3b83){if(_0x56557a){_0x4b4dd4(_0x56557a);}if(_0x3f3cc5[_0x4586('0x14')]===_0x4b3b83){_0x4b4dd4(null,!![]);}else{_0x4b4dd4(null,![]);}});},'makeSalt':function(_0x1ce6e2,_0x4c707d){var _0x39e68e=0x10;if(typeof arguments[0x0]===_0x4586('0x40')){_0x4c707d=arguments[0x0];_0x1ce6e2=_0x39e68e;}else if(typeof arguments[0x1]===_0x4586('0x40')){_0x4c707d=arguments[0x1];}else{throw new Error(_0x4586('0x41'));}if(!_0x1ce6e2){_0x1ce6e2=_0x39e68e;}return crypto[_0x4586('0x42')](_0x1ce6e2,function(_0x5985c7,_0x58c37a){if(_0x5985c7){_0x4c707d(_0x5985c7);}return _0x4c707d(null,_0x58c37a[_0x4586('0x43')]('base64'));});},'encryptPassword':function(_0x39c042,_0x44f614){if(!_0x39c042||!this[_0x4586('0x44')]){return _0x44f614?_0x44f614(null):null;}var _0xa675e8=0x2710;var _0x23e523=0x40;var _0x19e6e7=new Buffer(this['salt'],_0x4586('0x45'));if(!_0x44f614){return crypto['pbkdf2Sync'](_0x39c042,_0x19e6e7,_0xa675e8,_0x23e523,_0x4586('0x46'))['toString'](_0x4586('0x45'));}return crypto[_0x4586('0x47')](_0x39c042,_0x19e6e7,_0xa675e8,_0x23e523,_0x4586('0x46'),function(_0x53bd13,_0x59827e){if(_0x53bd13){_0x44f614(_0x53bd13);}return _0x44f614(null,_0x59827e[_0x4586('0x43')](_0x4586('0x45')));});},'updatePassword':function(_0x530a8c){if(!this[_0x4586('0x14')]){return _0x530a8c(null);}if(!validatePresenceOf(this[_0x4586('0x14')])&&authTypes[_0x4586('0x48')](this['provider'])===-0x1){_0x530a8c(new Error('Invalid\x20password'));}var _0x3286ca=this;this[_0x4586('0x49')](function(_0xd273fb,_0x351a55){if(_0xd273fb){return _0x530a8c(_0xd273fb);}_0x3286ca[_0x4586('0x44')]=_0x351a55;_0x3286ca[_0x4586('0x3f')](_0x3286ca[_0x4586('0x14')],function(_0x4e890f,_0xdfa432){if(_0x4e890f){_0x530a8c(_0x4e890f);}_0x3286ca[_0x4586('0x14')]=_0xdfa432;_0x530a8c(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0x4586('0x22')]+':asterisk:'+this[_0x4586('0x14')]);return this[_0x4586('0x4a')];}}});};
\ No newline at end of file
+var _0x8dff=['UserProfile','privacyEnabled','updateMd5Password','updatePassword','resolve','userProfileId','changed','concat','userSetting','createUserSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','provider','Invalid\x20password',':asterisk:','crypto','util','md5','./user.attributes','length','context','from-sip','system','format','%s%s','merge','Set','CDR(type)=%s','chanspy','push','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','record','StopMixMonitor','wav','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','name','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','then','internal','catch','models','define','User','utf8','utf8_bin','undefined'];(function(_0x4dbba7,_0x34d6d1){var _0x43ef83=function(_0x27acf1){while(--_0x27acf1){_0x4dbba7['push'](_0x4dbba7['shift']());}};_0x43ef83(++_0x34d6d1);}(_0x8dff,0x18d));var _0xf8df=function(_0x332a6b,_0x4be2fb){_0x332a6b=_0x332a6b-0x0;var _0x104b84=_0x8dff[_0x332a6b];return _0x104b84;};'use strict';var BPromise=require('bluebird');var crypto=require(_0xf8df('0x0'));var util=require(_0xf8df('0x1'));var md5=require(_0xf8df('0x2'));var _=require('lodash');var attributes=require(_0xf8df('0x3'));var authTypes=['google'];var validatePresenceOf=function(_0x5c1cf8){return _0x5c1cf8&&_0x5c1cf8[_0xf8df('0x4')];};var getChanSpyApplications=function(_0x2f18b4,_0x1bb68d,_0x65fd29){var _0x18ce6b={'context':_0x2f18b4[_0xf8df('0x5')]||_0xf8df('0x6'),'type':_0xf8df('0x7'),'isApp':![],'UserId':_0x2f18b4['id']};var _0x310ffd=[];for(var _0x40877=0x0,_0xc11664=0x1;_0x40877<_0x65fd29[_0xf8df('0x4')];_0x40877++,_0xc11664=0x1){var _0x264ad4={'exten':util[_0xf8df('0x8')](_0xf8df('0x9'),_0x65fd29[_0x40877]['prefix'],_0x1bb68d),'ChanSpyId':_0x65fd29[_0x40877]['id']};_0x310ffd['push'](_[_0xf8df('0xa')]({'app':_0xf8df('0xb'),'appdata':util[_0xf8df('0x8')](_0xf8df('0xc'),_0xf8df('0xd')),'priority':_0xc11664++},_0x18ce6b,_0x264ad4));if(_0x65fd29[_0x40877]['record']){_0x310ffd[_0xf8df('0xe')](_[_0xf8df('0xa')]({'app':'MixMonitor','appdata':util[_0xf8df('0x8')]('${UNIQUEID}.%s,a',_0x65fd29[_0x40877]['recordingFormat']),'priority':_0xc11664++},_0x18ce6b,_0x264ad4));}if(_0x65fd29[_0x40877][_0xf8df('0xf')]){_0x310ffd['push'](_[_0xf8df('0xa')]({'app':_0xf8df('0x10'),'appdata':_0x65fd29[_0x40877][_0xf8df('0x11')],'priority':_0xc11664++},_0x18ce6b,_0x264ad4));}_0x310ffd[_0xf8df('0xe')](_[_0xf8df('0xa')]({'app':_0xf8df('0x12'),'appdata':util[_0xf8df('0x8')](_0xf8df('0x13'),_0x2f18b4['name'],_0x65fd29[_0x40877][_0xf8df('0x14')]?_0x65fd29[_0x40877][_0xf8df('0x14')][_0xf8df('0x15')](''):''),'priority':_0xc11664++},_0x18ce6b,_0x264ad4));if(_0x65fd29[_0x40877][_0xf8df('0x16')]){_0x310ffd[_0xf8df('0xe')](_[_0xf8df('0xa')]({'app':_0xf8df('0x17'),'priority':_0xc11664++},_0x18ce6b,_0x264ad4));}}return _0x310ffd;};var getUserApplications=function(_0x27e8c5,_0x98ad0c){var _0x4debc2=[_0xf8df('0x18'),'WAV','gsm'];var _0x20d4be={'context':_0x27e8c5[_0xf8df('0x5')]||_0xf8df('0x6'),'exten':_0x98ad0c,'type':'system','isApp':![],'UserId':_0x27e8c5['id']};var _0x3ba96b=[{'app':_0xf8df('0xb'),'appdata':_0xf8df('0x19')}];if(_0x27e8c5[_0xf8df('0x1a')]&&_[_0xf8df('0x1b')](_0x4debc2,_0x27e8c5[_0xf8df('0x1a')])){_0x3ba96b['push']({'app':'Set','appdata':_0xf8df('0x1c')});_0x3ba96b[_0xf8df('0xe')]({'app':_0xf8df('0xb'),'appdata':util[_0xf8df('0x8')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x27e8c5[_0xf8df('0x1a')])});_0x3ba96b[_0xf8df('0xe')]({'app':_0xf8df('0x1d'),'appdata':util[_0xf8df('0x8')](_0xf8df('0x1e'),_0x27e8c5[_0xf8df('0x1f')])});}else{_0x3ba96b[_0xf8df('0xe')]({'app':'Dial','appdata':util[_0xf8df('0x8')](_0xf8df('0x20'),_0x27e8c5[_0xf8df('0x1f')])});}_0x3ba96b[_0xf8df('0xe')]({'app':_0xf8df('0x21')});for(var _0x4babe2=0x0;_0x4babe2<_0x3ba96b[_0xf8df('0x4')];_0x4babe2++){_0x3ba96b[_0x4babe2][_0xf8df('0x22')]=_0x4babe2+0x1;_0x3ba96b[_0x4babe2]=_[_0xf8df('0x23')](_0x3ba96b[_0x4babe2],_0x20d4be);}return _0x3ba96b;};var getChanSpyPromise=function(_0xf414b,_0x11b8b9){return new BPromise(function(_0x31d697,_0x251654){return _0xf414b[_0xf8df('0x24')][_0xf8df('0x25')]()[_0xf8df('0x26')](function(_0x1ab138){if(_0x1ab138){var _0x33ecde=getChanSpyApplications(_0x11b8b9,_0x11b8b9[_0xf8df('0x27')],_0x1ab138);if(_0x11b8b9[_0xf8df('0x27')]!=_0x11b8b9[_0xf8df('0x1f')]){_0x33ecde=_0x33ecde['concat'](getChanSpyApplications(_0x11b8b9,_0x11b8b9['name'],_0x1ab138));}return _0x31d697(_0x33ecde);}return _0x31d697([]);})[_0xf8df('0x28')](function(_0xc4562c){_0x251654(_0xc4562c);});});};module['exports']=function(_0x48c8f2){var _0x45c5ae=_0x48c8f2[_0xf8df('0x29')];return _0x48c8f2[_0xf8df('0x2a')](_0xf8df('0x2b'),attributes,{'tableName':'users','charset':_0xf8df('0x2c'),'collate':_0xf8df('0x2d'),'hooks':{'beforeCreate':function(_0xaf4a6f,_0xfdbdbe,_0x5ee98a){var _0x349274=typeof _0xaf4a6f['userProfileId']===_0xf8df('0x2e')?BPromise['resolve'](null):_0x45c5ae[_0xf8df('0x2f')]['find']({'where':{'id':_0xaf4a6f['userProfileId']}});_0x349274['then'](function(_0x2a4552){if(_0x2a4552){_0xaf4a6f[_0xf8df('0x30')]=_0x2a4552['privacyEnabled'];}})['then'](function(){_0xaf4a6f[_0xf8df('0x31')]();_0xaf4a6f[_0xf8df('0x32')](_0x5ee98a);})[_0xf8df('0x28')](function(_0x1a654c){_0x5ee98a(_0x1a654c);});},'beforeUpdate':function(_0x1d0371,_0x5ae6d4,_0x453c0a){Promise[_0xf8df('0x33')]()[_0xf8df('0x26')](function(){if(_0x1d0371['changed'](_0xf8df('0x34'))===![])return;return _0x45c5ae[_0xf8df('0x2f')]['find']({'where':{'id':_0x1d0371[_0xf8df('0x34')]}})[_0xf8df('0x26')](function(_0x51539d){if(_0x51539d)_0x1d0371[_0xf8df('0x30')]=_0x51539d[_0xf8df('0x30')];return;});})['then'](function(){if(_0x1d0371[_0xf8df('0x35')](_0xf8df('0x11'))){_0x1d0371[_0xf8df('0x31')]();return _0x1d0371[_0xf8df('0x32')](_0x453c0a);}_0x453c0a();})['catch'](function(_0x13e08e){_0x453c0a(_0x13e08e);});},'afterCreate':function(_0x2304f6,_0x517ce6,_0x6cc45e){var _0x36c2f5=getUserApplications(_0x2304f6,_0x2304f6[_0xf8df('0x27')]);if(_0x2304f6[_0xf8df('0x27')]!=_0x2304f6[_0xf8df('0x1f')]){_0x36c2f5=_0x36c2f5[_0xf8df('0x36')](getUserApplications(_0x2304f6,_0x2304f6[_0xf8df('0x1f')]));}return Promise[_0xf8df('0x33')]()[_0xf8df('0x26')](function(){if(!_0x2304f6[_0xf8df('0x37')]){return _0x2304f6[_0xf8df('0x38')]({'clientSideLoggingLevel':_0xf8df('0x39'),'clientSideLoggingEnabled':![]});}})[_0xf8df('0x26')](function(){return _0x45c5ae[_0xf8df('0x3a')][_0xf8df('0x3b')](_0x36c2f5);})[_0xf8df('0x26')](function(){if(_0x2304f6[_0xf8df('0xd')]){return getChanSpyPromise(_0x45c5ae,_0x2304f6);}})[_0xf8df('0x26')](function(_0x3c4bfa){if(_0x3c4bfa&&_0x3c4bfa[_0xf8df('0x4')]){return _0x45c5ae[_0xf8df('0x3a')][_0xf8df('0x3b')](_0x3c4bfa);}})[_0xf8df('0x26')](function(){_0x6cc45e();})[_0xf8df('0x28')](function(_0x13f2a1){_0x6cc45e(_0x13f2a1);});},'afterUpdate':function(_0x1c983d,_0x5000fb,_0x583aea){return BPromise[_0xf8df('0x33')]()[_0xf8df('0x26')](function(){if(_0x1c983d[_0xf8df('0x35')]('chanspy')||_0x1c983d[_0xf8df('0x35')](_0xf8df('0x5'))){return _0x45c5ae['VoiceExtension'][_0xf8df('0x3c')]({'where':{'UserId':_0x1c983d['id'],'type':_0xf8df('0x7'),'ChanSpyId':{'$ne':null}}})[_0xf8df('0x26')](function(){if(_0x1c983d['chanspy']){return getChanSpyPromise(_0x45c5ae,_0x1c983d)[_0xf8df('0x26')](function(_0x1f3539){if(_0x1f3539&&_0x1f3539[_0xf8df('0x4')]){return _0x45c5ae[_0xf8df('0x3a')][_0xf8df('0x3b')](_0x1f3539);}});}});}})['then'](function(){if(_0x1c983d[_0xf8df('0x35')](_0xf8df('0x1a'))||_0x1c983d['changed'](_0xf8df('0x5'))){return _0x45c5ae['VoiceExtension'][_0xf8df('0x3c')]({'where':{'UserId':_0x1c983d['id'],'type':_0xf8df('0x7'),'ChanSpyId':null}})[_0xf8df('0x26')](function(){var _0x3e13b=getUserApplications(_0x1c983d,_0x1c983d['internal']);if(_0x1c983d[_0xf8df('0x27')]!=_0x1c983d['name']){_0x3e13b=_0x3e13b[_0xf8df('0x36')](getUserApplications(_0x1c983d,_0x1c983d[_0xf8df('0x1f')]));}return _0x45c5ae[_0xf8df('0x3a')]['bulkCreate'](_0x3e13b);});}})[_0xf8df('0x26')](function(){_0x583aea();})['catch'](function(_0x1101de){_0x583aea(_0x1101de);});},'afterDestroy':function(_0x591e22){return _0x45c5ae[_0xf8df('0x3a')]['destroy']({'where':{'UserId':_0x591e22['id'],'type':_0xf8df('0x7')}});}},'instanceMethods':{'authenticate':function(_0x268647,_0x4d32bd){if(!_0x4d32bd){return this[_0xf8df('0x11')]===this[_0xf8df('0x3d')](_0x268647);}var _0x4432b0=this;this['encryptPassword'](_0x268647,function(_0x405fe4,_0x167f37){if(_0x405fe4){_0x4d32bd(_0x405fe4);}if(_0x4432b0[_0xf8df('0x11')]===_0x167f37){_0x4d32bd(null,!![]);}else{_0x4d32bd(null,![]);}});},'makeSalt':function(_0x3067aa,_0x3a4fcc){var _0xab7261=0x10;if(typeof arguments[0x0]===_0xf8df('0x3e')){_0x3a4fcc=arguments[0x0];_0x3067aa=_0xab7261;}else if(typeof arguments[0x1]===_0xf8df('0x3e')){_0x3a4fcc=arguments[0x1];}else{throw new Error(_0xf8df('0x3f'));}if(!_0x3067aa){_0x3067aa=_0xab7261;}return crypto[_0xf8df('0x40')](_0x3067aa,function(_0x424168,_0x2186bb){if(_0x424168){_0x3a4fcc(_0x424168);}return _0x3a4fcc(null,_0x2186bb[_0xf8df('0x41')](_0xf8df('0x42')));});},'encryptPassword':function(_0x9cb05e,_0x126c26){if(!_0x9cb05e||!this[_0xf8df('0x43')]){return _0x126c26?_0x126c26(null):null;}var _0x3699d4=0x2710;var _0x1fc2e4=0x40;var _0x25442f=new Buffer(this[_0xf8df('0x43')],_0xf8df('0x42'));if(!_0x126c26){return crypto[_0xf8df('0x44')](_0x9cb05e,_0x25442f,_0x3699d4,_0x1fc2e4,_0xf8df('0x45'))[_0xf8df('0x41')](_0xf8df('0x42'));}return crypto[_0xf8df('0x46')](_0x9cb05e,_0x25442f,_0x3699d4,_0x1fc2e4,_0xf8df('0x45'),function(_0x551b83,_0x3f1dde){if(_0x551b83){_0x126c26(_0x551b83);}return _0x126c26(null,_0x3f1dde[_0xf8df('0x41')]('base64'));});},'updatePassword':function(_0xd804e8){if(!this['password']){return _0xd804e8(null);}if(!validatePresenceOf(this[_0xf8df('0x11')])&&authTypes['indexOf'](this[_0xf8df('0x47')])===-0x1){_0xd804e8(new Error(_0xf8df('0x48')));}var _0x5bf25f=this;this['makeSalt'](function(_0x1e0c51,_0x24b410){if(_0x1e0c51){return _0xd804e8(_0x1e0c51);}_0x5bf25f[_0xf8df('0x43')]=_0x24b410;_0x5bf25f[_0xf8df('0x3d')](_0x5bf25f[_0xf8df('0x11')],function(_0x2e0894,_0x245ae7){if(_0x2e0894){_0xd804e8(_0x2e0894);}_0x5bf25f['password']=_0x245ae7;_0xd804e8(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this['name']+_0xf8df('0x49')+this['password']);return this['md5secret'];}}});};
\ No newline at end of file
index 6602e40..05d413c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bcc=['agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','forEach','merge','callysquare','loginInPause','LOGININPAUSE','bulkCreate','lodash','util','bluebird','../../config/utils','jayson/promise','client','http','redis','localhost','./user.socket','request','info','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','User,\x20%s,\x20%s','GetUser','findAll','options','raw','where','attributes','include','map','model','then','catch','ShowUser','User','find','debug','PauseUser','name','internal','interface','update','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','isNil','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','role','uniqueid','MemberReport','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','mail','chat','fax','sms','openchannel','whatsapp','%s%s','system','all','destroy','LoginUser','phone','agent','../../config/license/util','getLicense'];(function(_0x339974,_0x318f2f){var _0x56dc65=function(_0x30fe5a){while(--_0x30fe5a){_0x339974['push'](_0x339974['shift']());}};_0x56dc65(++_0x318f2f);}(_0x9bcc,0xb6));var _0xc9bc=function(_0x764970,_0x1c7f1e){_0x764970=_0x764970-0x0;var _0x28458f=_0x9bcc[_0x764970];return _0x28458f;};'use strict';var _=require(_0xc9bc('0x0'));var util=require(_0xc9bc('0x1'));var moment=require('moment');var BPromise=require(_0xc9bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc9bc('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc9bc('0x4'));var client=jayson[_0xc9bc('0x5')][_0xc9bc('0x6')]({'port':0x232a});config[_0xc9bc('0x7')]=_['defaults'](config[_0xc9bc('0x7')],{'host':_0xc9bc('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc9bc('0x7')]));require(_0xc9bc('0x9'))['register'](socket);function respondWithRpcPromise(_0x1b6262,_0x199a7a,_0x5225ab){return new BPromise(function(_0x23656f,_0x56aaac){return client[_0xc9bc('0xa')](_0x1b6262,_0x5225ab)['then'](function(_0x2c9c67){logger[_0xc9bc('0xb')]('User,\x20%s,\x20%s',_0x199a7a,'request\x20sent');logger['debug'](_0xc9bc('0xc'),_0x199a7a,_0xc9bc('0xd'),JSON[_0xc9bc('0xe')](_0x2c9c67));if(_0x2c9c67[_0xc9bc('0xf')]){if(_0x2c9c67[_0xc9bc('0xf')][_0xc9bc('0x10')]===0x1f4){logger[_0xc9bc('0xf')]('User,\x20%s,\x20%s',_0x199a7a,_0x2c9c67[_0xc9bc('0xf')][_0xc9bc('0x11')]);return _0x56aaac(_0x2c9c67[_0xc9bc('0xf')][_0xc9bc('0x11')]);}logger[_0xc9bc('0xf')](_0xc9bc('0x12'),_0x199a7a,_0x2c9c67[_0xc9bc('0xf')][_0xc9bc('0x11')]);return _0x23656f(_0x2c9c67[_0xc9bc('0xf')]['message']);}else{logger[_0xc9bc('0xb')](_0xc9bc('0x12'),_0x199a7a,_0xc9bc('0xd'));_0x23656f(_0x2c9c67['result']['message']);}})['catch'](function(_0x56c89b){logger['error'](_0xc9bc('0x12'),_0x199a7a,_0x56c89b);_0x56aaac(_0x56c89b);});});}exports[_0xc9bc('0x13')]=function(_0x45e936){var _0x32a375=this;return new Promise(function(_0x519aab,_0x328b10){return db['User'][_0xc9bc('0x14')]({'raw':_0x45e936['options']?_0x45e936[_0xc9bc('0x15')][_0xc9bc('0x16')]===undefined?!![]:![]:!![],'where':_0x45e936[_0xc9bc('0x15')]?_0x45e936[_0xc9bc('0x15')][_0xc9bc('0x17')]||null:null,'attributes':_0x45e936[_0xc9bc('0x15')]?_0x45e936[_0xc9bc('0x15')][_0xc9bc('0x18')]||null:null,'limit':_0x45e936[_0xc9bc('0x15')]?_0x45e936[_0xc9bc('0x15')]['limit']||null:null,'include':_0x45e936[_0xc9bc('0x15')]?_0x45e936[_0xc9bc('0x15')][_0xc9bc('0x19')]?_['map'](_0x45e936[_0xc9bc('0x15')]['include'],function(_0x40b468){return{'model':db[_0x40b468['model']],'as':_0x40b468['as'],'attributes':_0x40b468[_0xc9bc('0x18')],'include':_0x40b468[_0xc9bc('0x19')]?_[_0xc9bc('0x1a')](_0x40b468[_0xc9bc('0x19')],function(_0x77fd68){return{'model':db[_0x77fd68[_0xc9bc('0x1b')]],'as':_0x77fd68['as'],'attributes':_0x77fd68[_0xc9bc('0x18')],'include':_0x77fd68[_0xc9bc('0x19')]?_[_0xc9bc('0x1a')](_0x77fd68[_0xc9bc('0x19')],function(_0x140c69){return{'model':db[_0x140c69[_0xc9bc('0x1b')]],'as':_0x140c69['as'],'attributes':_0x140c69['attributes']};}):[]};}):[]};}):[]:[]})[_0xc9bc('0x1c')](function(_0x23bb41){logger[_0xc9bc('0xb')](_0xc9bc('0x13'),_0x45e936);logger['debug'](_0xc9bc('0x13'),_0x45e936,JSON['stringify'](_0x23bb41));_0x519aab(_0x23bb41);})[_0xc9bc('0x1d')](function(_0x584639){logger[_0xc9bc('0xf')](_0xc9bc('0x13'),_0x584639[_0xc9bc('0x11')],_0x45e936);_0x328b10(_0x32a375['error'](0x1f4,_0x584639[_0xc9bc('0x11')]));});});};exports[_0xc9bc('0x1e')]=function(_0x3a8756){var _0x5c641e=this;return new Promise(function(_0x27e2ea,_0x245a71){return db[_0xc9bc('0x1f')][_0xc9bc('0x20')]({'raw':_0x3a8756[_0xc9bc('0x15')]?_0x3a8756['options'][_0xc9bc('0x16')]===undefined?!![]:![]:!![],'where':_0x3a8756[_0xc9bc('0x15')]?_0x3a8756[_0xc9bc('0x15')][_0xc9bc('0x17')]||null:null,'attributes':_0x3a8756['options']?_0x3a8756[_0xc9bc('0x15')][_0xc9bc('0x18')]||null:null,'include':_0x3a8756['options']?_0x3a8756[_0xc9bc('0x15')][_0xc9bc('0x19')]?_[_0xc9bc('0x1a')](_0x3a8756[_0xc9bc('0x15')][_0xc9bc('0x19')],function(_0x342815){return{'model':db[_0x342815[_0xc9bc('0x1b')]],'as':_0x342815['as'],'attributes':_0x342815[_0xc9bc('0x18')],'include':_0x342815[_0xc9bc('0x19')]?_[_0xc9bc('0x1a')](_0x342815['include'],function(_0x344435){return{'model':db[_0x344435[_0xc9bc('0x1b')]],'as':_0x344435['as'],'attributes':_0x344435[_0xc9bc('0x18')],'include':_0x344435['include']?_[_0xc9bc('0x1a')](_0x344435['include'],function(_0x4caaf0){return{'model':db[_0x4caaf0[_0xc9bc('0x1b')]],'as':_0x4caaf0['as'],'attributes':_0x4caaf0[_0xc9bc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc9bc('0x1c')](function(_0x16dc23){logger[_0xc9bc('0xb')](_0xc9bc('0x1e'),_0x3a8756);logger[_0xc9bc('0x21')](_0xc9bc('0x1e'),_0x3a8756,JSON[_0xc9bc('0xe')](_0x16dc23));_0x27e2ea(_0x16dc23);})[_0xc9bc('0x1d')](function(_0x21bd9f){logger['error'](_0xc9bc('0x1e'),_0x21bd9f[_0xc9bc('0x11')],_0x3a8756);_0x245a71(_0x5c641e[_0xc9bc('0xf')](0x1f4,_0x21bd9f[_0xc9bc('0x11')]));});});};exports[_0xc9bc('0x22')]=function(_0x341a4b){var _0x1e8d0c=this;return new Promise(function(_0x35fd83,_0x3642e6){var _0x573944;return db['User']['find']({'where':_0x341a4b[_0xc9bc('0x15')][_0xc9bc('0x17')]||{},'attributes':['id',_0xc9bc('0x23'),'role',_0xc9bc('0x24'),_0xc9bc('0x25')]})[_0xc9bc('0x1c')](function(_0x2247ac){if(_0x2247ac){_0x573944=_0x2247ac;return db['UserVoiceQueueRt'][_0xc9bc('0x26')]({'paused':0x1},{'where':{'UserId':_0x573944['id']},'individualHooks':!![]});}})[_0xc9bc('0x1c')](function(){if(_0x573944){return db['MemberReport']['findAll']({'where':{'membername':_0x573944[_0xc9bc('0x23')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0xa8d4e8){if(_0x573944){if(_0xa8d4e8&&_0xa8d4e8[_0xc9bc('0x27')]){var _0xceb551=moment()[_0xc9bc('0x28')](_0xc9bc('0x29'));for(var _0x5a0b31=0x0,_0x388bbc=_0xa8d4e8[_0xc9bc('0x27')];_0x5a0b31<_0x388bbc;_0x5a0b31++){_0xa8d4e8[_0x5a0b31][_0xc9bc('0x2a')]({'exitAt':_0xceb551});}}}})[_0xc9bc('0x1c')](function(){if(_0x573944){var _0x7422f=[];var _0x1a0d19=utils[_0xc9bc('0x2b')]();_0x1a0d19['forEach'](function(_0x34fd5e){_0x7422f[_0xc9bc('0x2c')]({'channel':_0x34fd5e,'membername':_0x573944[_0xc9bc('0x23')],'interface':_[_0xc9bc('0x2d')](_0x573944[_0xc9bc('0x25')])?util[_0xc9bc('0x28')](_0xc9bc('0x2e'),_0x573944[_0xc9bc('0x23')]):_0x573944[_0xc9bc('0x25')],'type':_0xc9bc('0x2f'),'enterAt':moment()[_0xc9bc('0x28')](_0xc9bc('0x29')),'data1':_0x341a4b[_0xc9bc('0x30')][_0xc9bc('0x31')]||_0xc9bc('0x32'),'role':_0x573944[_0xc9bc('0x33')],'internal':_0x573944[_0xc9bc('0x24')],'uniqueid':_0x341a4b['body'][_0xc9bc('0x34')]||null});});return db[_0xc9bc('0x35')]['bulkCreate'](_0x7422f,{'individualHooks':!![]});}})['then'](function(){if(_0x573944){return _0x573944[_0xc9bc('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x341a4b['body'][_0xc9bc('0x31')]||_0xc9bc('0x32'),'lastPauseAt':moment()[_0xc9bc('0x28')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xc9bc('0x1c')](function(_0x20b8e3){_0x35fd83(_0x20b8e3);})['catch'](function(_0x2e27a4){_0x3642e6(_0x1e8d0c['error'](0x1f4,_0x2e27a4['message']));});});};exports[_0xc9bc('0x36')]=function(_0x534640){var _0x42cc72=this;return new Promise(function(_0x1f2db8,_0x38de87){var _0x10ab7d;return db[_0xc9bc('0x1f')][_0xc9bc('0x37')]({'where':_0x534640[_0xc9bc('0x15')][_0xc9bc('0x17')]||{},'attributes':['id',_0xc9bc('0x23')]})[_0xc9bc('0x1c')](function(_0x45a0ee){if(_0x45a0ee){_0x10ab7d=_0x45a0ee;if(_0x534640[_0xc9bc('0x30')][_0xc9bc('0x38')]&&!utils[_0xc9bc('0x39')](_0x534640[_0xc9bc('0x30')]['channel'])){throw new Error(_0xc9bc('0x3a'));}switch(_0x534640[_0xc9bc('0x30')][_0xc9bc('0x38')]){case _0xc9bc('0x3b'):return db[_0xc9bc('0x3c')][_0xc9bc('0x26')]({'paused':0x0},{'where':{'UserId':_0x10ab7d['id']}})[_0xc9bc('0x1c')](function(){return db[_0xc9bc('0x35')][_0xc9bc('0x20')]({'where':{'channel':_0x534640[_0xc9bc('0x30')][_0xc9bc('0x38')],'membername':_0x10ab7d[_0xc9bc('0x23')],'type':_0xc9bc('0x2f'),'exitAt':null}});})['then'](function(_0x38d6b0){if(_0x38d6b0){return _0x38d6b0[_0xc9bc('0x26')]({'exitAt':moment()[_0xc9bc('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x10ab7d['update']({'voicePause':![]});});case _0xc9bc('0x3d'):case _0xc9bc('0x3e'):case _0xc9bc('0x3f'):case _0xc9bc('0x40'):case _0xc9bc('0x41'):case _0xc9bc('0x42'):return db['MemberReport'][_0xc9bc('0x20')]({'where':{'channel':_0x534640[_0xc9bc('0x30')][_0xc9bc('0x38')],'membername':_0x10ab7d[_0xc9bc('0x23')],'type':_0xc9bc('0x2f'),'exitAt':null}})[_0xc9bc('0x1c')](function(_0xc4318){return _0xc4318['update']({'exitAt':moment()[_0xc9bc('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0xc9bc('0x1c')](function(){var _0x5e7a9c={};_['set'](_0x5e7a9c,util['format'](_0xc9bc('0x43'),_0x534640[_0xc9bc('0x30')][_0xc9bc('0x38')],'Pause'),![]);return _0x10ab7d['update'](_0x5e7a9c);});default:return db['UserVoiceQueueRt'][_0xc9bc('0x26')]({'paused':0x0},{'where':{'UserId':_0x10ab7d['id']}})[_0xc9bc('0x1c')](function(){return db[_0xc9bc('0x35')][_0xc9bc('0x14')]({'where':{'membername':_0x10ab7d[_0xc9bc('0x23')],'type':_0xc9bc('0x2f'),'exitAt':null}});})['then'](function(_0x5b8620){var _0x54e7a5=[];_0x5b8620['forEach'](function(_0xbdcf9e){_0x54e7a5[_0xc9bc('0x2c')](_0xbdcf9e[_0xc9bc('0x26')]({'exitAt':moment()['format'](_0xc9bc('0x29')),'data2':_0xc9bc('0x44')}));});return BPromise[_0xc9bc('0x45')](_0x54e7a5);})[_0xc9bc('0x1c')](function(){return _0x10ab7d[_0xc9bc('0x26')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xc9bc('0x1c')](function(_0x8457f2){_0x1f2db8(_0x8457f2);})[_0xc9bc('0x1d')](function(_0x173692){_0x38de87(_0x42cc72['error'](0x1f4,_0x173692[_0xc9bc('0x11')]));});});};exports['LogoutUser']=function(_0x5077a1){var _0x548f9e=this;return new Promise(function(_0x34b2db,_0x37c951){var _0x50f06b;return db['User']['findOne']({'where':_0x5077a1[_0xc9bc('0x15')][_0xc9bc('0x17')]||{},'attributes':['id','name']})[_0xc9bc('0x1c')](function(_0x26ee35){if(_0x26ee35){_0x50f06b=_0x26ee35;return db[_0xc9bc('0x3c')][_0xc9bc('0x46')]({'where':{'membername':_0x50f06b[_0xc9bc('0x23')]},'individualHooks':!![]});}})[_0xc9bc('0x1c')](function(){if(_0x50f06b){return db[_0xc9bc('0x35')][_0xc9bc('0x14')]({'where':{'membername':_0x50f06b[_0xc9bc('0x23')],'exitAt':null}});}})[_0xc9bc('0x1c')](function(_0x21fa94){if(_0x50f06b){if(_0x21fa94&&_0x21fa94['length']){var _0x3e6cc4=[];_0x21fa94['forEach'](function(_0x468697){_0x3e6cc4['push'](_0x468697['update']({'exitAt':moment()['format'](_0xc9bc('0x29'))}));});return BPromise['all'](_0x3e6cc4);}}})[_0xc9bc('0x1c')](function(){if(_0x50f06b){return _0x50f06b['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x18f64f){_0x34b2db(_0x18f64f);})[_0xc9bc('0x1d')](function(_0x1f9b51){_0x37c951(_0x548f9e[_0xc9bc('0xf')](0x1f4,_0x1f9b51[_0xc9bc('0x11')]));});});};exports[_0xc9bc('0x47')]=function(_0x13cb12){var _0x348002=this;return new Promise(function(_0x5a39eb,_0x51bd15){var _0x5d66be;var _0x368159;var _0x3ff212;var _0x296779;return db[_0xc9bc('0x1f')]['findOne']({'where':_0x13cb12[_0xc9bc('0x15')][_0xc9bc('0x17')]||{},'attributes':['id','name','role','mobile',_0xc9bc('0x48'),'internal','loginInPause',_0xc9bc('0x25')]})['then'](function(_0x1dce47){if(_0x1dce47){_0x5d66be=_0x1dce47;_0x296779=_0x13cb12[_0xc9bc('0x30')][_0xc9bc('0x25')]?_0x13cb12['body'][_0xc9bc('0x25')]:util['format'](_0xc9bc('0x2e'),_0x5d66be[_0xc9bc('0x23')]);return db[_0xc9bc('0x1f')]['count']({'where':{'role':_0xc9bc('0x49'),'online':!![],'id':{'$ne':_0x5d66be['id']}}});}})[_0xc9bc('0x1c')](function(_0x2c7821){if(_0x2c7821){_0x3ff212=_0x2c7821;return require(_0xc9bc('0x4a'))[_0xc9bc('0x4b')]();}})['then'](function(_0x4d8334){if(_0x4d8334&&_0x4d8334[_0xc9bc('0x4c')]&&_0x3ff212>=_0x4d8334[_0xc9bc('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xc9bc('0x1c')](function(){if(_0x5d66be){return db[_0xc9bc('0x3c')][_0xc9bc('0x46')]({'where':{'membername':_0x5d66be[_0xc9bc('0x23')]},'individualHooks':!![]});}})[_0xc9bc('0x1c')](function(){if(_0x5d66be){return _0x5d66be[_0xc9bc('0x4d')]({'raw':!![]});}})[_0xc9bc('0x1c')](function(_0xeb250d){if(_0x5d66be){if(_0xeb250d){var _0x534aaf=[];_0x368159=_0xeb250d;if(_0x368159[_0xc9bc('0x27')]){for(var _0x42f32a=0x0;_0x42f32a<_0x368159[_0xc9bc('0x27')];_0x42f32a++){_0x534aaf['push'](db[_0xc9bc('0x3c')][_0xc9bc('0x4e')]({'membername':_0x5d66be[_0xc9bc('0x23')],'UserId':_0x5d66be['id'],'queue_name':_0x368159[_0x42f32a][_0xc9bc('0x23')],'VoiceQueueId':_0x368159[_0x42f32a]['id'],'interface':_0x296779,'paused':_0x5d66be['loginInPause']||![],'penalty':_0x368159[_0x42f32a][_0xc9bc('0x4f')]||0x0}));}return BPromise[_0xc9bc('0x45')](_0x534aaf);}}}})[_0xc9bc('0x1c')](function(){if(_0x5d66be){return db[_0xc9bc('0x35')][_0xc9bc('0x14')]({'where':{'membername':_0x5d66be[_0xc9bc('0x23')],'exitAt':null}});}})[_0xc9bc('0x1c')](function(_0x1dd148){if(_0x5d66be){if(_0x1dd148&&_0x1dd148[_0xc9bc('0x27')]){var _0x2d26d5=[];_0x1dd148[_0xc9bc('0x50')](function(_0x816681){_0x2d26d5[_0xc9bc('0x2c')](_0x816681[_0xc9bc('0x26')]({'exitAt':moment()[_0xc9bc('0x28')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xc9bc('0x45')](_0x2d26d5);}}})['then'](function(_0x4b7e41){if(_0x5d66be){var _0x341d88=[];var _0x521e27=[];var _0x462eba=utils['getChannels']();var _0x4d78cf={'membername':_0x5d66be['name'],'interface':_0x296779,'enterAt':moment()[_0xc9bc('0x28')](_0xc9bc('0x29')),'role':_0x5d66be[_0xc9bc('0x33')],'internal':_0x5d66be[_0xc9bc('0x24')]};_0x462eba[_0xc9bc('0x50')](function(_0x477106){_0x341d88[_0xc9bc('0x2c')](_[_0xc9bc('0x51')]({'channel':_0x477106,'type':'LOGIN','data1':_0xc9bc('0x52'),'data2':_0x296779},_0x4d78cf));if(_0x5d66be[_0xc9bc('0x53')]){_0x521e27[_0xc9bc('0x2c')](_[_0xc9bc('0x51')]({'channel':_0x477106,'type':_0xc9bc('0x2f'),'data1':_0xc9bc('0x54')},_0x4d78cf));}});return db['MemberReport'][_0xc9bc('0x55')](_0x341d88['concat'](_0x521e27),{'individualHooks':!![]});}})[_0xc9bc('0x1c')](function(){if(_0x5d66be){return _0x5d66be[_0xc9bc('0x26')]({'online':!![],'lastLoginAt':moment()[_0xc9bc('0x28')](_0xc9bc('0x29')),'voicePause':_0x5d66be[_0xc9bc('0x53')]||![],'mailPause':_0x5d66be[_0xc9bc('0x53')]||![],'chatPause':_0x5d66be[_0xc9bc('0x53')]||![],'faxPause':_0x5d66be[_0xc9bc('0x53')]||![],'smsPause':_0x5d66be[_0xc9bc('0x53')]||![],'openchannelPause':_0x5d66be[_0xc9bc('0x53')]||![],'pauseType':_0x5d66be[_0xc9bc('0x53')]?_0xc9bc('0x54'):null,'lastPauseAt':moment()[_0xc9bc('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x296779});}})[_0xc9bc('0x1c')](function(_0x2844c9){_0x5a39eb(_0x2844c9);})[_0xc9bc('0x1d')](function(_0x163427){_0x51bd15(_0x348002['error'](0x1f4,_0x163427[_0xc9bc('0x11')]));});});};
\ No newline at end of file
+var _0xb594=['map','model','ShowUser','find','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','type','findOne','channel','isValidChannel','Unknown\x20channel','mail','chat','system','set','%s%s','all','LogoutUser','destroy','mobile','phone','loginInPause','SIP/%s','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','User,\x20%s,\x20%s','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','include'];(function(_0x6f9e6c,_0x5ef730){var _0x20a1a0=function(_0x231ec0){while(--_0x231ec0){_0x6f9e6c['push'](_0x6f9e6c['shift']());}};_0x20a1a0(++_0x5ef730);}(_0xb594,0x13e));var _0x4b59=function(_0xda0827,_0x4ed612){_0xda0827=_0xda0827-0x0;var _0x3ab014=_0xb594[_0xda0827];return _0x3ab014;};'use strict';var _=require('lodash');var util=require(_0x4b59('0x0'));var moment=require(_0x4b59('0x1'));var BPromise=require(_0x4b59('0x2'));var rs=require(_0x4b59('0x3'));var fs=require('fs');var Redis=require(_0x4b59('0x4'));var db=require(_0x4b59('0x5'))['db'];var utils=require(_0x4b59('0x6'));var logger=require(_0x4b59('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4b59('0x8'));var client=jayson['client'][_0x4b59('0x9')]({'port':0x232a});config[_0x4b59('0xa')]=_['defaults'](config[_0x4b59('0xa')],{'host':_0x4b59('0xb'),'port':0x18eb});var socket=require(_0x4b59('0xc'))(new Redis(config[_0x4b59('0xa')]));require(_0x4b59('0xd'))[_0x4b59('0xe')](socket);function respondWithRpcPromise(_0x59c303,_0x1cbbbc,_0x415ce5){return new BPromise(function(_0x29d9e8,_0x38376a){return client['request'](_0x59c303,_0x415ce5)[_0x4b59('0xf')](function(_0x2356ef){logger[_0x4b59('0x10')]('User,\x20%s,\x20%s',_0x1cbbbc,_0x4b59('0x11'));logger[_0x4b59('0x12')](_0x4b59('0x13'),_0x1cbbbc,'request\x20sent',JSON[_0x4b59('0x14')](_0x2356ef));if(_0x2356ef[_0x4b59('0x15')]){if(_0x2356ef['error']['code']===0x1f4){logger[_0x4b59('0x15')](_0x4b59('0x16'),_0x1cbbbc,_0x2356ef['error'][_0x4b59('0x17')]);return _0x38376a(_0x2356ef[_0x4b59('0x15')]['message']);}logger[_0x4b59('0x15')](_0x4b59('0x16'),_0x1cbbbc,_0x2356ef[_0x4b59('0x15')][_0x4b59('0x17')]);return _0x29d9e8(_0x2356ef[_0x4b59('0x15')][_0x4b59('0x17')]);}else{logger[_0x4b59('0x10')](_0x4b59('0x16'),_0x1cbbbc,_0x4b59('0x11'));_0x29d9e8(_0x2356ef[_0x4b59('0x18')][_0x4b59('0x17')]);}})[_0x4b59('0x19')](function(_0x5bffc4){logger[_0x4b59('0x15')]('User,\x20%s,\x20%s',_0x1cbbbc,_0x5bffc4);_0x38376a(_0x5bffc4);});});}exports[_0x4b59('0x1a')]=function(_0x10cc88){var _0x3ebd42=this;return new Promise(function(_0x4a9e82,_0x572eeb){return db[_0x4b59('0x1b')][_0x4b59('0x1c')]({'raw':_0x10cc88[_0x4b59('0x1d')]?_0x10cc88['options'][_0x4b59('0x1e')]===undefined?!![]:![]:!![],'where':_0x10cc88[_0x4b59('0x1d')]?_0x10cc88[_0x4b59('0x1d')][_0x4b59('0x1f')]||null:null,'attributes':_0x10cc88[_0x4b59('0x1d')]?_0x10cc88['options'][_0x4b59('0x20')]||null:null,'limit':_0x10cc88[_0x4b59('0x1d')]?_0x10cc88['options']['limit']||null:null,'include':_0x10cc88[_0x4b59('0x1d')]?_0x10cc88['options'][_0x4b59('0x21')]?_[_0x4b59('0x22')](_0x10cc88['options'][_0x4b59('0x21')],function(_0x3d2c4e){return{'model':db[_0x3d2c4e[_0x4b59('0x23')]],'as':_0x3d2c4e['as'],'attributes':_0x3d2c4e[_0x4b59('0x20')],'include':_0x3d2c4e[_0x4b59('0x21')]?_[_0x4b59('0x22')](_0x3d2c4e[_0x4b59('0x21')],function(_0x1f9650){return{'model':db[_0x1f9650[_0x4b59('0x23')]],'as':_0x1f9650['as'],'attributes':_0x1f9650[_0x4b59('0x20')],'include':_0x1f9650[_0x4b59('0x21')]?_[_0x4b59('0x22')](_0x1f9650[_0x4b59('0x21')],function(_0x5460d8){return{'model':db[_0x5460d8[_0x4b59('0x23')]],'as':_0x5460d8['as'],'attributes':_0x5460d8[_0x4b59('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4b59('0xf')](function(_0x128081){logger[_0x4b59('0x10')](_0x4b59('0x1a'),_0x10cc88);logger['debug'](_0x4b59('0x1a'),_0x10cc88,JSON[_0x4b59('0x14')](_0x128081));_0x4a9e82(_0x128081);})['catch'](function(_0x9424dd){logger[_0x4b59('0x15')]('GetUser',_0x9424dd['message'],_0x10cc88);_0x572eeb(_0x3ebd42[_0x4b59('0x15')](0x1f4,_0x9424dd['message']));});});};exports[_0x4b59('0x24')]=function(_0x1d5523){var _0x2d7194=this;return new Promise(function(_0x522250,_0x3489fa){return db['User'][_0x4b59('0x25')]({'raw':_0x1d5523[_0x4b59('0x1d')]?_0x1d5523[_0x4b59('0x1d')][_0x4b59('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d5523[_0x4b59('0x1d')]?_0x1d5523['options'][_0x4b59('0x1f')]||null:null,'attributes':_0x1d5523['options']?_0x1d5523['options']['attributes']||null:null,'include':_0x1d5523[_0x4b59('0x1d')]?_0x1d5523['options']['include']?_['map'](_0x1d5523[_0x4b59('0x1d')]['include'],function(_0x1afbbb){return{'model':db[_0x1afbbb['model']],'as':_0x1afbbb['as'],'attributes':_0x1afbbb[_0x4b59('0x20')],'include':_0x1afbbb[_0x4b59('0x21')]?_[_0x4b59('0x22')](_0x1afbbb[_0x4b59('0x21')],function(_0x4da859){return{'model':db[_0x4da859[_0x4b59('0x23')]],'as':_0x4da859['as'],'attributes':_0x4da859[_0x4b59('0x20')],'include':_0x4da859[_0x4b59('0x21')]?_[_0x4b59('0x22')](_0x4da859[_0x4b59('0x21')],function(_0x35a833){return{'model':db[_0x35a833[_0x4b59('0x23')]],'as':_0x35a833['as'],'attributes':_0x35a833['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b59('0xf')](function(_0x2a3667){logger[_0x4b59('0x10')](_0x4b59('0x24'),_0x1d5523);logger[_0x4b59('0x12')]('ShowUser',_0x1d5523,JSON[_0x4b59('0x14')](_0x2a3667));_0x522250(_0x2a3667);})[_0x4b59('0x19')](function(_0x21299d){logger[_0x4b59('0x15')](_0x4b59('0x24'),_0x21299d[_0x4b59('0x17')],_0x1d5523);_0x3489fa(_0x2d7194[_0x4b59('0x15')](0x1f4,_0x21299d[_0x4b59('0x17')]));});});};exports[_0x4b59('0x26')]=function(_0x79e3ff){var _0x11be3c=this;return new Promise(function(_0x21d28b,_0x57e2a6){var _0x1f4318;return db[_0x4b59('0x1b')][_0x4b59('0x25')]({'where':_0x79e3ff[_0x4b59('0x1d')][_0x4b59('0x1f')]||{},'attributes':['id',_0x4b59('0x27'),_0x4b59('0x28'),_0x4b59('0x29'),_0x4b59('0x2a')]})['then'](function(_0xaca2ea){if(_0xaca2ea){_0x1f4318=_0xaca2ea;return db[_0x4b59('0x2b')][_0x4b59('0x2c')]({'paused':0x1},{'where':{'UserId':_0x1f4318['id']},'individualHooks':!![]});}})['then'](function(){if(_0x1f4318){return db[_0x4b59('0x2d')]['findAll']({'where':{'membername':_0x1f4318['name'],'type':_0x4b59('0x2e'),'exitAt':null}});}})['then'](function(_0x464600){if(_0x1f4318){if(_0x464600&&_0x464600['length']){var _0x5beecb=moment()[_0x4b59('0x2f')](_0x4b59('0x30'));for(var _0x2eacd2=0x0,_0x4fba13=_0x464600[_0x4b59('0x31')];_0x2eacd2<_0x4fba13;_0x2eacd2++){_0x464600[_0x2eacd2][_0x4b59('0x32')]({'exitAt':_0x5beecb});}}}})[_0x4b59('0xf')](function(){if(_0x1f4318){var _0xd894b4=[];var _0x29969b=utils[_0x4b59('0x33')]();_0x29969b[_0x4b59('0x34')](function(_0x31c783){_0xd894b4[_0x4b59('0x35')]({'channel':_0x31c783,'membername':_0x1f4318[_0x4b59('0x27')],'interface':_[_0x4b59('0x36')](_0x1f4318[_0x4b59('0x2a')])?util['format']('SIP/%s',_0x1f4318['name']):_0x1f4318['interface'],'type':_0x4b59('0x2e'),'enterAt':moment()['format'](_0x4b59('0x30')),'data1':_0x79e3ff[_0x4b59('0x37')]['type']||_0x4b59('0x38'),'role':_0x1f4318[_0x4b59('0x28')],'internal':_0x1f4318['internal'],'uniqueid':_0x79e3ff['body'][_0x4b59('0x39')]||null});});return db[_0x4b59('0x2d')][_0x4b59('0x3a')](_0xd894b4,{'individualHooks':!![]});}})[_0x4b59('0xf')](function(){if(_0x1f4318){return _0x1f4318[_0x4b59('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x79e3ff[_0x4b59('0x37')][_0x4b59('0x3b')]||_0x4b59('0x38'),'lastPauseAt':moment()[_0x4b59('0x2f')](_0x4b59('0x30'))});}})['then'](function(_0x661f87){_0x21d28b(_0x661f87);})[_0x4b59('0x19')](function(_0x7576f0){_0x57e2a6(_0x11be3c['error'](0x1f4,_0x7576f0['message']));});});};exports['UnpauseUser']=function(_0x293276){var _0x33ad52=this;return new Promise(function(_0x19dec4,_0x5757ca){var _0x473aa3;return db[_0x4b59('0x1b')][_0x4b59('0x3c')]({'where':_0x293276[_0x4b59('0x1d')]['where']||{},'attributes':['id',_0x4b59('0x27')]})[_0x4b59('0xf')](function(_0x2da925){if(_0x2da925){_0x473aa3=_0x2da925;if(_0x293276['body'][_0x4b59('0x3d')]&&!utils[_0x4b59('0x3e')](_0x293276[_0x4b59('0x37')]['channel'])){throw new Error(_0x4b59('0x3f'));}switch(_0x293276[_0x4b59('0x37')][_0x4b59('0x3d')]){case'voice':return db[_0x4b59('0x2b')][_0x4b59('0x2c')]({'paused':0x0},{'where':{'UserId':_0x473aa3['id']}})[_0x4b59('0xf')](function(){return db[_0x4b59('0x2d')][_0x4b59('0x25')]({'where':{'channel':_0x293276[_0x4b59('0x37')][_0x4b59('0x3d')],'membername':_0x473aa3[_0x4b59('0x27')],'type':'PAUSE','exitAt':null}});})[_0x4b59('0xf')](function(_0x10239b){if(_0x10239b){return _0x10239b['update']({'exitAt':moment()['format'](_0x4b59('0x30')),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x473aa3[_0x4b59('0x2c')]({'voicePause':![]});});case _0x4b59('0x40'):case _0x4b59('0x41'):case'fax':case'sms':case'openchannel':case'whatsapp':return db[_0x4b59('0x2d')][_0x4b59('0x25')]({'where':{'channel':_0x293276['body']['channel'],'membername':_0x473aa3['name'],'type':_0x4b59('0x2e'),'exitAt':null}})['then'](function(_0x8166a9){return _0x8166a9[_0x4b59('0x2c')]({'exitAt':moment()[_0x4b59('0x2f')](_0x4b59('0x30')),'data2':_0x4b59('0x42')},{'individualHooks':!![]});})[_0x4b59('0xf')](function(){var _0xe842aa={};_[_0x4b59('0x43')](_0xe842aa,util[_0x4b59('0x2f')](_0x4b59('0x44'),_0x293276['body']['channel'],'Pause'),![]);return _0x473aa3[_0x4b59('0x2c')](_0xe842aa);});default:return db[_0x4b59('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x473aa3['id']}})[_0x4b59('0xf')](function(){return db['MemberReport'][_0x4b59('0x1c')]({'where':{'membername':_0x473aa3[_0x4b59('0x27')],'type':_0x4b59('0x2e'),'exitAt':null}});})[_0x4b59('0xf')](function(_0x7a97c9){var _0x480e32=[];_0x7a97c9[_0x4b59('0x34')](function(_0x5415c8){_0x480e32[_0x4b59('0x35')](_0x5415c8['update']({'exitAt':moment()[_0x4b59('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x4b59('0x42')}));});return BPromise[_0x4b59('0x45')](_0x480e32);})[_0x4b59('0xf')](function(){return _0x473aa3[_0x4b59('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x4b59('0xf')](function(_0x200ac4){_0x19dec4(_0x200ac4);})['catch'](function(_0x5004eb){_0x5757ca(_0x33ad52[_0x4b59('0x15')](0x1f4,_0x5004eb['message']));});});};exports[_0x4b59('0x46')]=function(_0x58282a){var _0x16f2ea=this;return new Promise(function(_0x3fa827,_0x4460d0){var _0x2ed46a;return db[_0x4b59('0x1b')][_0x4b59('0x3c')]({'where':_0x58282a[_0x4b59('0x1d')][_0x4b59('0x1f')]||{},'attributes':['id','name']})[_0x4b59('0xf')](function(_0x3100dc){if(_0x3100dc){_0x2ed46a=_0x3100dc;return db['UserVoiceQueueRt'][_0x4b59('0x47')]({'where':{'membername':_0x2ed46a[_0x4b59('0x27')]},'individualHooks':!![]});}})[_0x4b59('0xf')](function(){if(_0x2ed46a){return db[_0x4b59('0x2d')][_0x4b59('0x1c')]({'where':{'membername':_0x2ed46a[_0x4b59('0x27')],'exitAt':null}});}})['then'](function(_0x12bfa1){if(_0x2ed46a){if(_0x12bfa1&&_0x12bfa1[_0x4b59('0x31')]){var _0x215494=[];_0x12bfa1[_0x4b59('0x34')](function(_0x3ee9c1){_0x215494['push'](_0x3ee9c1[_0x4b59('0x2c')]({'exitAt':moment()['format'](_0x4b59('0x30'))}));});return BPromise[_0x4b59('0x45')](_0x215494);}}})['then'](function(){if(_0x2ed46a){return _0x2ed46a['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x4b59('0xf')](function(_0x1a02e2){_0x3fa827(_0x1a02e2);})[_0x4b59('0x19')](function(_0x15875d){_0x4460d0(_0x16f2ea['error'](0x1f4,_0x15875d[_0x4b59('0x17')]));});});};exports['LoginUser']=function(_0x1deba5){var _0x58daa5=this;return new Promise(function(_0x15783d,_0xae5a7b){var _0x1a8615;var _0x542a36;var _0x195b5d;var _0x3a704a;return db[_0x4b59('0x1b')][_0x4b59('0x3c')]({'where':_0x1deba5[_0x4b59('0x1d')][_0x4b59('0x1f')]||{},'attributes':['id',_0x4b59('0x27'),_0x4b59('0x28'),_0x4b59('0x48'),_0x4b59('0x49'),'internal',_0x4b59('0x4a'),'interface']})[_0x4b59('0xf')](function(_0x3c832f){if(_0x3c832f){_0x1a8615=_0x3c832f;_0x3a704a=_0x1deba5[_0x4b59('0x37')][_0x4b59('0x2a')]?_0x1deba5[_0x4b59('0x37')][_0x4b59('0x2a')]:util[_0x4b59('0x2f')](_0x4b59('0x4b'),_0x1a8615[_0x4b59('0x27')]);return db['User'][_0x4b59('0x4c')]({'where':{'role':_0x4b59('0x4d'),'online':!![],'id':{'$ne':_0x1a8615['id']}}});}})['then'](function(_0x19aa3b){if(_0x19aa3b){_0x195b5d=_0x19aa3b;return require('../../config/license/util')[_0x4b59('0x4e')]();}})[_0x4b59('0xf')](function(_0x487f43){if(_0x487f43&&_0x487f43[_0x4b59('0x4f')]&&_0x195b5d>=_0x487f43[_0x4b59('0x4f')]){throw new Error(_0x4b59('0x50'));}})[_0x4b59('0xf')](function(){if(_0x1a8615){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x1a8615['name']},'individualHooks':!![]});}})[_0x4b59('0xf')](function(){if(_0x1a8615){return _0x1a8615[_0x4b59('0x51')]({'raw':!![]});}})['then'](function(_0x4f4a1f){if(_0x1a8615){if(_0x4f4a1f){var _0x184beb=[];_0x542a36=_0x4f4a1f;if(_0x542a36[_0x4b59('0x31')]){for(var _0x35d5e0=0x0;_0x35d5e0<_0x542a36[_0x4b59('0x31')];_0x35d5e0++){_0x184beb['push'](db[_0x4b59('0x2b')][_0x4b59('0x52')]({'membername':_0x1a8615[_0x4b59('0x27')],'UserId':_0x1a8615['id'],'queue_name':_0x542a36[_0x35d5e0][_0x4b59('0x27')],'VoiceQueueId':_0x542a36[_0x35d5e0]['id'],'interface':_0x3a704a,'paused':_0x1a8615['loginInPause']||![],'penalty':_0x542a36[_0x35d5e0][_0x4b59('0x53')]||0x0}));}return BPromise[_0x4b59('0x45')](_0x184beb);}}}})[_0x4b59('0xf')](function(){if(_0x1a8615){return db[_0x4b59('0x2d')]['findAll']({'where':{'membername':_0x1a8615[_0x4b59('0x27')],'exitAt':null}});}})[_0x4b59('0xf')](function(_0x2aa11c){if(_0x1a8615){if(_0x2aa11c&&_0x2aa11c[_0x4b59('0x31')]){var _0x13a014=[];_0x2aa11c[_0x4b59('0x34')](function(_0x3675df){_0x13a014['push'](_0x3675df[_0x4b59('0x2c')]({'exitAt':moment()[_0x4b59('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x4b59('0x45')](_0x13a014);}}})[_0x4b59('0xf')](function(_0x4a83f4){if(_0x1a8615){var _0x769939=[];var _0x290bd2=[];var _0x42ccff=utils['getChannels']();var _0x433802={'membername':_0x1a8615['name'],'interface':_0x3a704a,'enterAt':moment()[_0x4b59('0x2f')](_0x4b59('0x30')),'role':_0x1a8615['role'],'internal':_0x1a8615['internal']};_0x42ccff[_0x4b59('0x34')](function(_0x243a5d){_0x769939[_0x4b59('0x35')](_[_0x4b59('0x54')]({'channel':_0x243a5d,'type':_0x4b59('0x55'),'data1':'callysquare','data2':_0x3a704a},_0x433802));if(_0x1a8615[_0x4b59('0x4a')]){_0x290bd2[_0x4b59('0x35')](_[_0x4b59('0x54')]({'channel':_0x243a5d,'type':'PAUSE','data1':_0x4b59('0x56')},_0x433802));}});return db['MemberReport'][_0x4b59('0x3a')](_0x769939[_0x4b59('0x57')](_0x290bd2),{'individualHooks':!![]});}})[_0x4b59('0xf')](function(){if(_0x1a8615){return _0x1a8615['update']({'online':!![],'lastLoginAt':moment()[_0x4b59('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x1a8615[_0x4b59('0x4a')]||![],'mailPause':_0x1a8615['loginInPause']||![],'chatPause':_0x1a8615[_0x4b59('0x4a')]||![],'faxPause':_0x1a8615[_0x4b59('0x4a')]||![],'smsPause':_0x1a8615[_0x4b59('0x4a')]||![],'openchannelPause':_0x1a8615[_0x4b59('0x4a')]||![],'pauseType':_0x1a8615[_0x4b59('0x4a')]?_0x4b59('0x56'):null,'lastPauseAt':moment()[_0x4b59('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3a704a});}})[_0x4b59('0xf')](function(_0xfbe894){_0x15783d(_0xfbe894);})[_0x4b59('0x19')](function(_0x256e5e){_0xae5a7b(_0x58daa5[_0x4b59('0x15')](0x1f4,_0x256e5e[_0x4b59('0x17')]));});});};
\ No newline at end of file
index c478b25..165839a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2a3=['update','emit','length','user:','./user.events','remove'];(function(_0x317417,_0x59a348){var _0x5831ce=function(_0x4bce94){while(--_0x4bce94){_0x317417['push'](_0x317417['shift']());}};_0x5831ce(++_0x59a348);}(_0xa2a3,0x172));var _0x3a2a=function(_0x3746ff,_0x5dfa8f){_0x3746ff=_0x3746ff-0x0;var _0x353055=_0xa2a3[_0x3746ff];return _0x353055;};'use strict';var UserEvents=require(_0x3a2a('0x0'));var events=['save',_0x3a2a('0x1'),_0x3a2a('0x2')];function createListener(_0x1fb85f,_0x22e3de){return function(_0x546690){_0x22e3de[_0x3a2a('0x3')](_0x1fb85f,_0x546690);};}function removeListener(_0x21fbce,_0x184b10){return function(){UserEvents['removeListener'](_0x21fbce,_0x184b10);};}exports['register']=function(_0x3bc26b){for(var _0x1ad995=0x0,_0x589197=events[_0x3a2a('0x4')];_0x1ad995<_0x589197;_0x1ad995++){var _0x137252=events[_0x1ad995];var _0x111595=createListener(_0x3a2a('0x5')+_0x137252,_0x3bc26b);UserEvents['on'](_0x137252,_0x111595);}};
\ No newline at end of file
+var _0x27b3=['./user.events','remove','emit','removeListener','register','length','user:'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0x27b3,0x9a));var _0x327b=function(_0x5ae3c8,_0x1f4431){_0x5ae3c8=_0x5ae3c8-0x0;var _0x154311=_0x27b3[_0x5ae3c8];return _0x154311;};'use strict';var UserEvents=require(_0x327b('0x0'));var events=['save',_0x327b('0x1'),'update'];function createListener(_0x550f97,_0x553b45){return function(_0x32a0f){_0x553b45[_0x327b('0x2')](_0x550f97,_0x32a0f);};}function removeListener(_0x19d942,_0xd46b3){return function(){UserEvents[_0x327b('0x3')](_0x19d942,_0xd46b3);};}exports[_0x327b('0x4')]=function(_0x9fa9ee){for(var _0x506c26=0x0,_0x23716f=events[_0x327b('0x5')];_0x506c26<_0x23716f;_0x506c26++){var _0x581a43=events[_0x506c26];var _0x1fbd63=createListener(_0x327b('0x6')+_0x581a43,_0x9fa9ee);UserEvents['on'](_0x581a43,_0x1fbd63);}};
\ No newline at end of file
index 17cc70f..dfc51fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x91d914,_0x2ee495){var _0x5a5937=function(_0x240404){while(--_0x240404){_0x91d914['push'](_0x91d914['shift']());}};_0x5a5937(++_0x2ee495);}(_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'));module['exports']=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1a1612,_0x185d35){var _0x5e2f78=function(_0x1ae28d){while(--_0x1ae28d){_0x1a1612['push'](_0x1a1612['shift']());}};_0x5e2f78(++_0x185d35);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xcb91[_0x4843f9];return _0x193c6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index 21b84fe..2bca4af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bae=['exports','INTEGER'];(function(_0x3078e1,_0x485d9d){var _0x2c77dd=function(_0x154016){while(--_0x154016){_0x3078e1['push'](_0x3078e1['shift']());}};_0x2c77dd(++_0x485d9d);}(_0x7bae,0xaa));var _0xe7ba=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7bae[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require('sequelize');module[_0xe7ba('0x0')]={'penalty':{'type':Sequelize[_0xe7ba('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8514=['sequelize','exports','INTEGER'];(function(_0x551e62,_0x7e39ce){var _0x1ccde1=function(_0x51e4ad){while(--_0x51e4ad){_0x551e62['push'](_0x551e62['shift']());}};_0x1ccde1(++_0x7e39ce);}(_0x8514,0x93));var _0x4851=function(_0x1b37d7,_0x7cb565){_0x1b37d7=_0x1b37d7-0x0;var _0x405aa6=_0x8514[_0x1b37d7];return _0x405aa6;};'use strict';var Sequelize=require(_0x4851('0x0'));module[_0x4851('0x1')]={'penalty':{'type':Sequelize[_0x4851('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 97adea4..6291db9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a69=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x40129d,_0x3f5039){var _0x4897af=function(_0x2d6314){while(--_0x2d6314){_0x40129d['push'](_0x40129d['shift']());}};_0x4897af(++_0x3f5039);}(_0x6a69,0xfc));var _0x96a6=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x6a69[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0x96a6('0x0'));var util=require(_0x96a6('0x1'));var logger=require(_0x96a6('0x2'))(_0x96a6('0x3'));var moment=require(_0x96a6('0x4'));var BPromise=require('bluebird');var rp=require(_0x96a6('0x5'));var fs=require('fs');var path=require(_0x96a6('0x6'));var rimraf=require(_0x96a6('0x7'));var config=require(_0x96a6('0x8'));var attributes=require(_0x96a6('0x9'));module[_0x96a6('0xa')]=function(_0x1db605,_0x29dc1d){return _0x1db605[_0x96a6('0xb')](_0x96a6('0xc'),attributes,{'tableName':_0x96a6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8863=['user_has_chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x8863,0xbc));var _0x3886=function(_0x35d294,_0x3a9b4){_0x35d294=_0x35d294-0x0;var _0xb9ae9a=_0x8863[_0x35d294];return _0xb9ae9a;};'use strict';var _=require(_0x3886('0x0'));var util=require(_0x3886('0x1'));var logger=require(_0x3886('0x2'))('api');var moment=require(_0x3886('0x3'));var BPromise=require(_0x3886('0x4'));var rp=require(_0x3886('0x5'));var fs=require('fs');var path=require(_0x3886('0x6'));var rimraf=require(_0x3886('0x7'));var config=require(_0x3886('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x3886('0x9')]=function(_0x25ef43,_0x31bc11){return _0x25ef43['define']('UserChatQueue',attributes,{'tableName':_0x3886('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ce4cc2..3e559f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89ab=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4293ae,_0x44d8e3){var _0x17d538=function(_0x18126f){while(--_0x18126f){_0x4293ae['push'](_0x4293ae['shift']());}};_0x17d538(++_0x44d8e3);}(_0x89ab,0x17f));var _0xb89a=function(_0x512194,_0x1537a3){_0x512194=_0x512194-0x0;var _0x15100e=_0x89ab[_0x512194];return _0x15100e;};'use strict';var _=require(_0xb89a('0x0'));var util=require(_0xb89a('0x1'));var moment=require(_0xb89a('0x2'));var BPromise=require(_0xb89a('0x3'));var rs=require(_0xb89a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb89a('0x5'))['db'];var utils=require(_0xb89a('0x6'));var logger=require(_0xb89a('0x7'))(_0xb89a('0x8'));var config=require(_0xb89a('0x9'));var jayson=require(_0xb89a('0xa'));var client=jayson[_0xb89a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c2cca,_0x1ad502,_0xbd1edd){return new BPromise(function(_0x1a1499,_0x5295a7){return client[_0xb89a('0xc')](_0x5c2cca,_0xbd1edd)[_0xb89a('0xd')](function(_0x1bd0ab){logger[_0xb89a('0xe')](_0xb89a('0xf'),_0x1ad502,_0xb89a('0x10'));logger[_0xb89a('0x11')](_0xb89a('0x12'),_0x1ad502,'request\x20sent',JSON[_0xb89a('0x13')](_0x1bd0ab));if(_0x1bd0ab[_0xb89a('0x14')]){if(_0x1bd0ab['error'][_0xb89a('0x15')]===0x1f4){logger[_0xb89a('0x14')](_0xb89a('0xf'),_0x1ad502,_0x1bd0ab['error']['message']);return _0x5295a7(_0x1bd0ab['error']['message']);}logger['error'](_0xb89a('0xf'),_0x1ad502,_0x1bd0ab[_0xb89a('0x14')]['message']);return _0x1a1499(_0x1bd0ab[_0xb89a('0x14')][_0xb89a('0x16')]);}else{logger[_0xb89a('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x1ad502,_0xb89a('0x10'));_0x1a1499(_0x1bd0ab[_0xb89a('0x17')][_0xb89a('0x16')]);}})[_0xb89a('0x18')](function(_0x33f286){logger[_0xb89a('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x1ad502,_0x33f286);_0x5295a7(_0x33f286);});});}
\ No newline at end of file
+var _0x0552=['error','UserChatQueue,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x574b13,_0x408752){var _0x1575f9=function(_0x1f8770){while(--_0x1f8770){_0x574b13['push'](_0x574b13['shift']());}};_0x1575f9(++_0x408752);}(_0x0552,0xbc));var _0x2055=function(_0x22bbe0,_0x5444fd){_0x22bbe0=_0x22bbe0-0x0;var _0x2407aa=_0x0552[_0x22bbe0];return _0x2407aa;};'use strict';var _=require(_0x2055('0x0'));var util=require(_0x2055('0x1'));var moment=require(_0x2055('0x2'));var BPromise=require('bluebird');var rs=require(_0x2055('0x3'));var fs=require('fs');var Redis=require(_0x2055('0x4'));var db=require(_0x2055('0x5'))['db'];var utils=require(_0x2055('0x6'));var logger=require('../../config/logger')(_0x2055('0x7'));var config=require(_0x2055('0x8'));var jayson=require(_0x2055('0x9'));var client=jayson[_0x2055('0xa')][_0x2055('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a6adb,_0x46396c,_0x1a73b0){return new BPromise(function(_0x1cd8f7,_0x51316a){return client[_0x2055('0xc')](_0x5a6adb,_0x1a73b0)['then'](function(_0x30854a){logger[_0x2055('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x46396c,_0x2055('0xe'));logger[_0x2055('0xf')](_0x2055('0x10'),_0x46396c,'request\x20sent',JSON[_0x2055('0x11')](_0x30854a));if(_0x30854a['error']){if(_0x30854a['error'][_0x2055('0x12')]===0x1f4){logger[_0x2055('0x13')](_0x2055('0x14'),_0x46396c,_0x30854a[_0x2055('0x13')][_0x2055('0x15')]);return _0x51316a(_0x30854a[_0x2055('0x13')][_0x2055('0x15')]);}logger[_0x2055('0x13')](_0x2055('0x14'),_0x46396c,_0x30854a[_0x2055('0x13')][_0x2055('0x15')]);return _0x1cd8f7(_0x30854a[_0x2055('0x13')][_0x2055('0x15')]);}else{logger[_0x2055('0xd')](_0x2055('0x14'),_0x46396c,_0x2055('0xe'));_0x1cd8f7(_0x30854a[_0x2055('0x16')][_0x2055('0x15')]);}})['catch'](function(_0x2746c1){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x46396c,_0x2746c1);_0x51316a(_0x2746c1);});});}
\ No newline at end of file
index f448bf6..65009d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1587cc,_0x2d8a36){var _0x2cec43=function(_0x3b3091){while(--_0x3b3091){_0x1587cc['push'](_0x1587cc['shift']());}};_0x2cec43(++_0x2d8a36);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xb33b42,_0x14221f){var _0x501e17=function(_0x466592){while(--_0x466592){_0xb33b42['push'](_0xb33b42['shift']());}};_0x501e17(++_0x14221f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index e229e6a..555e8d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcaa=['STRING','sequelize','exports','INTEGER'];(function(_0x483f0,_0x329df8){var _0x59a8eb=function(_0x369025){while(--_0x369025){_0x483f0['push'](_0x483f0['shift']());}};_0x59a8eb(++_0x329df8);}(_0xdcaa,0xe1));var _0xadca=function(_0x16f4fa,_0x1e82c6){_0x16f4fa=_0x16f4fa-0x0;var _0x4f6da5=_0xdcaa[_0x16f4fa];return _0x4f6da5;};'use strict';var Sequelize=require(_0xadca('0x0'));module[_0xadca('0x1')]={'penalty':{'type':Sequelize[_0xadca('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xadca('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xadca('0x3')]}};
\ No newline at end of file
+var _0xdb98=['INTEGER','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb98,0xc2));var _0x8db9=function(_0x8e286e,_0x5e859a){_0x8e286e=_0x8e286e-0x0;var _0x133d32=_0xdb98[_0x8e286e];return _0x133d32;};'use strict';var Sequelize=require(_0x8db9('0x0'));module[_0x8db9('0x1')]={'penalty':{'type':Sequelize[_0x8db9('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8db9('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8db9('0x3')]}};
\ No newline at end of file
index 6325a28..039568e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6120=['api','moment','bluebird','request-promise','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues'];(function(_0x51f04e,_0x22f18a){var _0x405871=function(_0x18257a){while(--_0x18257a){_0x51f04e['push'](_0x51f04e['shift']());}};_0x405871(++_0x22f18a);}(_0x6120,0x15f));var _0x0612=function(_0x48b7f5,_0x1744be){_0x48b7f5=_0x48b7f5-0x0;var _0x54ff24=_0x6120[_0x48b7f5];return _0x54ff24;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0612('0x0'));var moment=require(_0x0612('0x1'));var BPromise=require(_0x0612('0x2'));var rp=require(_0x0612('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0612('0x4'));var attributes=require(_0x0612('0x5'));module['exports']=function(_0x5d98c3,_0x1e2b2f){return _0x5d98c3[_0x0612('0x6')](_0x0612('0x7'),attributes,{'tableName':_0x0612('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x83a8=['define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','./userFaxQueue.attributes','exports'];(function(_0x2f8c21,_0x5053a5){var _0x18b640=function(_0x5de303){while(--_0x5de303){_0x2f8c21['push'](_0x2f8c21['shift']());}};_0x18b640(++_0x5053a5);}(_0x83a8,0x177));var _0x883a=function(_0x51075d,_0x2c4844){_0x51075d=_0x51075d-0x0;var _0x1fa1c6=_0x83a8[_0x51075d];return _0x1fa1c6;};'use strict';var _=require(_0x883a('0x0'));var util=require(_0x883a('0x1'));var logger=require(_0x883a('0x2'))(_0x883a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x883a('0x4'));var fs=require('fs');var path=require(_0x883a('0x5'));var rimraf=require(_0x883a('0x6'));var config=require('../../config/environment');var attributes=require(_0x883a('0x7'));module[_0x883a('0x8')]=function(_0x427c76,_0x4e2172){return _0x427c76[_0x883a('0x9')](_0x883a('0xa'),attributes,{'tableName':_0x883a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a6991c0..e26c2ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee1b=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5f27fa,_0x2d8d5a){var _0x13cd4e=function(_0x548345){while(--_0x548345){_0x5f27fa['push'](_0x5f27fa['shift']());}};_0x13cd4e(++_0x2d8d5a);}(_0xee1b,0x1b2));var _0xbee1=function(_0x3ac0ea,_0x3dbd26){_0x3ac0ea=_0x3ac0ea-0x0;var _0x1af97d=_0xee1b[_0x3ac0ea];return _0x1af97d;};'use strict';var _=require(_0xbee1('0x0'));var util=require(_0xbee1('0x1'));var moment=require(_0xbee1('0x2'));var BPromise=require(_0xbee1('0x3'));var rs=require(_0xbee1('0x4'));var fs=require('fs');var Redis=require(_0xbee1('0x5'));var db=require(_0xbee1('0x6'))['db'];var utils=require(_0xbee1('0x7'));var logger=require(_0xbee1('0x8'))(_0xbee1('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa29497,_0x24704c,_0xaa23f3){return new BPromise(function(_0x3a4457,_0x451a4b){return client[_0xbee1('0xb')](_0xa29497,_0xaa23f3)[_0xbee1('0xc')](function(_0x3f283f){logger[_0xbee1('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x24704c,_0xbee1('0xe'));logger[_0xbee1('0xf')](_0xbee1('0x10'),_0x24704c,_0xbee1('0xe'),JSON['stringify'](_0x3f283f));if(_0x3f283f[_0xbee1('0x11')]){if(_0x3f283f[_0xbee1('0x11')][_0xbee1('0x12')]===0x1f4){logger['error'](_0xbee1('0x13'),_0x24704c,_0x3f283f['error'][_0xbee1('0x14')]);return _0x451a4b(_0x3f283f[_0xbee1('0x11')][_0xbee1('0x14')]);}logger[_0xbee1('0x11')](_0xbee1('0x13'),_0x24704c,_0x3f283f[_0xbee1('0x11')][_0xbee1('0x14')]);return _0x3a4457(_0x3f283f[_0xbee1('0x11')][_0xbee1('0x14')]);}else{logger[_0xbee1('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x24704c,_0xbee1('0xe'));_0x3a4457(_0x3f283f['result'][_0xbee1('0x14')]);}})[_0xbee1('0x15')](function(_0x3e4cb9){logger[_0xbee1('0x11')](_0xbee1('0x13'),_0x24704c,_0x3e4cb9);_0x451a4b(_0x3e4cb9);});});}
\ No newline at end of file
+var _0x5f9f=['message','UserFaxQueue,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x27fa9e,_0x4cbe3a){var _0x53cd47=function(_0x35800a){while(--_0x35800a){_0x27fa9e['push'](_0x27fa9e['shift']());}};_0x53cd47(++_0x4cbe3a);}(_0x5f9f,0x17e));var _0xf5f9=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x5f9f[_0x4ae625];return _0x31accf;};'use strict';var _=require('lodash');var util=require(_0xf5f9('0x0'));var moment=require('moment');var BPromise=require(_0xf5f9('0x1'));var rs=require(_0xf5f9('0x2'));var fs=require('fs');var Redis=require(_0xf5f9('0x3'));var db=require(_0xf5f9('0x4'))['db'];var utils=require(_0xf5f9('0x5'));var logger=require(_0xf5f9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5f9('0x7')][_0xf5f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f9e30,_0x10d6a4,_0x3a0862){return new BPromise(function(_0x8504ec,_0x29930a){return client[_0xf5f9('0x9')](_0x2f9e30,_0x3a0862)[_0xf5f9('0xa')](function(_0x3a49f1){logger[_0xf5f9('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x10d6a4,_0xf5f9('0xc'));logger['debug'](_0xf5f9('0xd'),_0x10d6a4,_0xf5f9('0xc'),JSON[_0xf5f9('0xe')](_0x3a49f1));if(_0x3a49f1['error']){if(_0x3a49f1[_0xf5f9('0xf')][_0xf5f9('0x10')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x10d6a4,_0x3a49f1['error'][_0xf5f9('0x11')]);return _0x29930a(_0x3a49f1[_0xf5f9('0xf')][_0xf5f9('0x11')]);}logger[_0xf5f9('0xf')](_0xf5f9('0x12'),_0x10d6a4,_0x3a49f1[_0xf5f9('0xf')][_0xf5f9('0x11')]);return _0x8504ec(_0x3a49f1[_0xf5f9('0xf')][_0xf5f9('0x11')]);}else{logger[_0xf5f9('0xb')](_0xf5f9('0x12'),_0x10d6a4,_0xf5f9('0xc'));_0x8504ec(_0x3a49f1[_0xf5f9('0x13')]['message']);}})[_0xf5f9('0x14')](function(_0x5a8c62){logger['error'](_0xf5f9('0x12'),_0x10d6a4,_0x5a8c62);_0x29930a(_0x5a8c62);});});}
\ No newline at end of file
index 528c10e..2bac88e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x516cb1,_0x5a3498){var _0x35c1cf=function(_0x3b7605){while(--_0x3b7605){_0x516cb1['push'](_0x516cb1['shift']());}};_0x35c1cf(++_0x5a3498);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x36f6fb,_0x249aa3){var _0x39c006=function(_0x2ba353){while(--_0x2ba353){_0x36f6fb['push'](_0x36f6fb['shift']());}};_0x39c006(++_0x249aa3);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 6c8c315..b1294cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ddc=['sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ddc,0x196));var _0xc3dd=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3ddc[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xc3dd('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x22df=['sequelize','exports'];(function(_0x377dab,_0x210d1d){var _0x243025=function(_0x32dcc5){while(--_0x32dcc5){_0x377dab['push'](_0x377dab['shift']());}};_0x243025(++_0x210d1d);}(_0x22df,0xda));var _0xf22d=function(_0x20bf12,_0x3276f0){_0x20bf12=_0x20bf12-0x0;var _0x408ada=_0x22df[_0x20bf12];return _0x408ada;};'use strict';var Sequelize=require(_0xf22d('0x0'));module[_0xf22d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 367a6b8..7ac7fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83d2=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x3a0038,_0x1ffb5a){var _0x13da36=function(_0x3bd2e5){while(--_0x3bd2e5){_0x3a0038['push'](_0x3a0038['shift']());}};_0x13da36(++_0x1ffb5a);}(_0x83d2,0xed));var _0x283d=function(_0x261bcc,_0x5df9ec){_0x261bcc=_0x261bcc-0x0;var _0x3529db=_0x83d2[_0x261bcc];return _0x3529db;};'use strict';var _=require(_0x283d('0x0'));var util=require(_0x283d('0x1'));var logger=require(_0x283d('0x2'))(_0x283d('0x3'));var moment=require(_0x283d('0x4'));var BPromise=require(_0x283d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x283d('0x6'));var rimraf=require(_0x283d('0x7'));var config=require(_0x283d('0x8'));var attributes=require(_0x283d('0x9'));module[_0x283d('0xa')]=function(_0x5f58f8,_0x1b3f34){return _0x5f58f8[_0x283d('0xb')](_0x283d('0xc'),attributes,{'tableName':_0x283d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a9e=['../../config/environment','./userMailQueue.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x36ee82,_0x34a0d1){var _0x431bb8=function(_0x1d2565){while(--_0x1d2565){_0x36ee82['push'](_0x36ee82['shift']());}};_0x431bb8(++_0x34a0d1);}(_0x0a9e,0x164));var _0xe0a9=function(_0x2bfcf5,_0x41e1e5){_0x2bfcf5=_0x2bfcf5-0x0;var _0x26cca9=_0x0a9e[_0x2bfcf5];return _0x26cca9;};'use strict';var _=require(_0xe0a9('0x0'));var util=require('util');var logger=require(_0xe0a9('0x1'))(_0xe0a9('0x2'));var moment=require(_0xe0a9('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0a9('0x4'));var fs=require('fs');var path=require(_0xe0a9('0x5'));var rimraf=require(_0xe0a9('0x6'));var config=require(_0xe0a9('0x7'));var attributes=require(_0xe0a9('0x8'));module[_0xe0a9('0x9')]=function(_0x3b16fc,_0x48695e){return _0x3b16fc[_0xe0a9('0xa')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 91ed54e..f3f6488 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x31478f,_0x51efff){var _0x244d72=function(_0x46749a){while(--_0x46749a){_0x31478f['push'](_0x31478f['shift']());}};_0x244d72(++_0x51efff);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x7fbe[_0x2a390b];return _0x5df10a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x8ac82f,_0x5b91fd){var _0x95632e=function(_0x2ca4ea){while(--_0x2ca4ea){_0x8ac82f['push'](_0x8ac82f['shift']());}};_0x95632e(++_0x5b91fd);}(_0xe14b,0x93));var _0xbe14=function(_0x4ecfa1,_0x25ff10){_0x4ecfa1=_0x4ecfa1-0x0;var _0x132f1c=_0xe14b[_0x4ecfa1];return _0x132f1c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
index 988efc3..6b790ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69cd=['./userNotification.controller','post','isAuthenticated','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x46eb51,_0x3c6532){var _0x180645=function(_0x4d974d){while(--_0x4d974d){_0x46eb51['push'](_0x46eb51['shift']());}};_0x180645(++_0x3c6532);}(_0x69cd,0xa4));var _0xd69c=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x69cd[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0xd69c('0x0'));var util=require('util');var path=require(_0xd69c('0x1'));var timeout=require(_0xd69c('0x2'));var express=require('express');var router=express[_0xd69c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd69c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd69c('0x5'));var controller=require(_0xd69c('0x6'));router[_0xd69c('0x7')]('/',auth[_0xd69c('0x8')](),controller['sendUserNotification']);module[_0xd69c('0x9')]=router;
\ No newline at end of file
+var _0x63a8=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','sendUserNotification','exports','multer','path'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x63a8,0x12a));var _0x863a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x63a8[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x863a('0x0'));var util=require('util');var path=require(_0x863a('0x1'));var timeout=require(_0x863a('0x2'));var express=require(_0x863a('0x3'));var router=express[_0x863a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x863a('0x5'));var config=require(_0x863a('0x6'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x863a('0x7')](),controller[_0x863a('0x8')]);module[_0x863a('0x9')]=router;
\ No newline at end of file
index 7c392ee..f50c4c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52d8=['STRING','TEXT','exports'];(function(_0x15e3ca,_0x4a8860){var _0xb4594d=function(_0x2b3c11){while(--_0x2b3c11){_0x15e3ca['push'](_0x15e3ca['shift']());}};_0xb4594d(++_0x4a8860);}(_0x52d8,0x1b2));var _0x852d=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x52d8[_0x4c0622];return _0x1799d8;};'use strict';var Sequelize=require('sequelize');module[_0x852d('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x852d('0x1')]},'recipientsId':{'type':Sequelize[_0x852d('0x2')]},'recipientsDescription':{'type':Sequelize[_0x852d('0x1')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
+var _0x46fe=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x2ca641,_0xc33062){var _0x3b2761=function(_0xd0afd1){while(--_0xd0afd1){_0x2ca641['push'](_0x2ca641['shift']());}};_0x3b2761(++_0xc33062);}(_0x46fe,0x150));var _0xe46f=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x46fe[_0x534c8f];return _0x5a57f5;};'use strict';var Sequelize=require(_0xe46f('0x0'));module[_0xe46f('0x1')]={'body':{'type':Sequelize[_0xe46f('0x2')]},'senderName':{'type':Sequelize[_0xe46f('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xe46f('0x3')]},'beep':{'type':Sequelize[_0xe46f('0x4')]}};
\ No newline at end of file
index ecd99ba..b12a5e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd895=['undefined','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','ValidationError','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','UserNotification','create','forEach','recipient','emit','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','model','User','union','ids','queue','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./userNotification.socket','register','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd895,0xad));var _0x5d89=function(_0x12c813,_0x23d2ce){_0x12c813=_0x12c813-0x0;var _0x181630=_0xd895[_0x12c813];return _0x181630;};'use strict';var emlformat=require(_0x5d89('0x0'));var rimraf=require(_0x5d89('0x1'));var zipdir=require(_0x5d89('0x2'));var jsonpatch=require(_0x5d89('0x3'));var rp=require('request-promise');var moment=require(_0x5d89('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5d89('0x5'));var sox=require('sox');var csv=require(_0x5d89('0x6'));var ejs=require(_0x5d89('0x7'));var fs=require('fs');var fs_extra=require(_0x5d89('0x8'));var _=require(_0x5d89('0x9'));var squel=require(_0x5d89('0xa'));var crypto=require(_0x5d89('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5d89('0xc'));var toCsv=require(_0x5d89('0x6'));var querystring=require(_0x5d89('0xd'));var Papa=require(_0x5d89('0xe'));var Redis=require('ioredis');var authService=require(_0x5d89('0xf'));var qs=require(_0x5d89('0x10'));var as=require(_0x5d89('0x11'));var hardwareService=require(_0x5d89('0x12'));var logger=require(_0x5d89('0x13'))(_0x5d89('0x14'));var utils=require(_0x5d89('0x15'));var config=require(_0x5d89('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d89('0x17'))['db'];config['redis']=_[_0x5d89('0x18')](config[_0x5d89('0x19')],{'host':_0x5d89('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d89('0x19')]));require(_0x5d89('0x1b'))[_0x5d89('0x1c')](socket);function respondWithStatusCode(_0x17ed75,_0x53e5a1){_0x53e5a1=_0x53e5a1||0xcc;return function(_0x48516d){if(_0x48516d){return _0x17ed75['sendStatus'](_0x53e5a1);}return _0x17ed75[_0x5d89('0x1d')](_0x53e5a1)[_0x5d89('0x1e')]();};}function respondWithResult(_0x13a4fa,_0x2dc901){_0x2dc901=_0x2dc901||0xc8;return function(_0x6c7920){if(_0x6c7920){return _0x13a4fa['status'](_0x2dc901)[_0x5d89('0x1f')](_0x6c7920);}};}function respondWithFilteredResult(_0x1ee989,_0x59fd63){return function(_0x205d9d){if(_0x205d9d){var _0x6d0231=typeof _0x59fd63[_0x5d89('0x20')]===_0x5d89('0x21')&&typeof _0x59fd63[_0x5d89('0x22')]===_0x5d89('0x21');var _0x4ac9c7=_0x205d9d['count'];var _0x178481=_0x6d0231?0x0:_0x59fd63[_0x5d89('0x20')];var _0x506304=_0x6d0231?_0x205d9d['count']:_0x59fd63[_0x5d89('0x20')]+_0x59fd63['limit'];var _0x363fa1;if(_0x506304>=_0x4ac9c7){_0x506304=_0x4ac9c7;_0x363fa1=0xc8;}else{_0x363fa1=0xce;}_0x1ee989['status'](_0x363fa1);return _0x1ee989['set'](_0x5d89('0x23'),_0x178481+'-'+_0x506304+'/'+_0x4ac9c7)[_0x5d89('0x1f')](_0x205d9d);}return null;};}function patchUpdates(_0x31deb6){return function(_0x34f18d){try{jsonpatch[_0x5d89('0x24')](_0x34f18d,_0x31deb6,!![]);}catch(_0x2a385c){return BPromise[_0x5d89('0x25')](_0x2a385c);}return _0x34f18d[_0x5d89('0x26')]();};}function saveUpdates(_0x5eccd7,_0x597e89){return function(_0x344189){if(_0x344189){return _0x344189[_0x5d89('0x27')](_0x5eccd7)[_0x5d89('0x28')](function(_0x8af369){return _0x8af369;});}return null;};}function removeEntity(_0x13396f,_0x1b398b){return function(_0x10f0c3){if(_0x10f0c3){return _0x10f0c3[_0x5d89('0x29')]()[_0x5d89('0x28')](function(){_0x13396f[_0x5d89('0x1d')](0xcc)[_0x5d89('0x1e')]();});}};}function handleEntityNotFound(_0x438fc0,_0x4060d6){return function(_0x4685e8){if(!_0x4685e8){_0x438fc0['sendStatus'](0x194);}return _0x4685e8;};}function handleError(_0x50a84c,_0x23a763){_0x23a763=_0x23a763||0x1f4;return function(_0x4db501){logger['error'](_0x4db501[_0x5d89('0x2a')]);if(_0x4db501['name']){delete _0x4db501[_0x5d89('0x2b')];}_0x50a84c['status'](_0x23a763)[_0x5d89('0x2c')](_0x4db501);};}exports[_0x5d89('0x2d')]=function(_0x14b8f5,_0x34179b,_0x17a25b){if(!_0x14b8f5['body'][_0x5d89('0x2e')](_0x5d89('0x2f'))&&!_0x14b8f5[_0x5d89('0x30')][_0x5d89('0x2e')](_0x5d89('0x31'))){throw new db['Sequelize'][(_0x5d89('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x14b8f5['body']['hasOwnProperty'](_0x5d89('0x31'))&&!_0x14b8f5['body'][_0x5d89('0x2e')](_0x5d89('0x33'))){throw new db[(_0x5d89('0x34'))][(_0x5d89('0x32'))](_0x5d89('0x35'));}if(!_0x14b8f5['body'][_0x5d89('0x2e')](_0x5d89('0x36'))){throw new db[(_0x5d89('0x34'))][(_0x5d89('0x32'))](_0x5d89('0x37'));}else{try{var _0x59fd7a=JSON[_0x5d89('0x38')](_0x14b8f5[_0x5d89('0x30')][_0x5d89('0x36')]);}catch(_0x354bb1){logger['error'](_0x354bb1);throw new db[(_0x5d89('0x34'))][(_0x5d89('0x32'))](_0x5d89('0x39'));}var _0x2f208c=[_0x5d89('0x3a'),_0x5d89('0x3b'),_0x5d89('0x3c'),_0x5d89('0x3d'),_0x5d89('0x3e'),_0x5d89('0x3f'),_0x5d89('0x40'),_0x5d89('0x41'),'user'];if(_[_0x5d89('0x42')](_0x59fd7a,function(_0x515588){return!_[_0x5d89('0x43')](_0x2f208c,_0x515588['model'][_0x5d89('0x44')]());})){throw new db[(_0x5d89('0x34'))][(_0x5d89('0x32'))](_0x5d89('0x45'));}}}var _0x34d02d={};_0x34d02d[_0x5d89('0x46')]=_0x14b8f5['body'][_0x5d89('0x2e')](_0x5d89('0x46'))?_0x14b8f5['body'][_0x5d89('0x46')]:_0x14b8f5[_0x5d89('0x47')][_0x5d89('0x48')];_0x34d02d['recipientsDescription']=_[_0x5d89('0x49')](_0x14b8f5[_0x5d89('0x30')][_0x5d89('0x4a')])?null:_0x14b8f5['body']['recipientsDescription'];_0x34d02d[_0x5d89('0x4b')]=_0x14b8f5[_0x5d89('0x30')][_0x5d89('0x4b')]||![];_0x34d02d[_0x5d89('0x4c')]=_0x14b8f5[_0x5d89('0x47')]['id'];return getContent(_0x14b8f5['body'])['then'](function(_0x48d0ec){_0x34d02d['body']=_0x48d0ec;return getRecipients(_0x59fd7a);})[_0x5d89('0x28')](function(_0x31e9ce){_0x34d02d[_0x5d89('0x4d')]=_[_0x5d89('0x4e')](_0x31e9ce)[_0x5d89('0x4f')](',');return db['sequelize']['transaction'](function(_0x445f4d){return db[_0x5d89('0x50')][_0x5d89('0x51')](_0x34d02d,{'raw':!![],'transaction':_0x445f4d})[_0x5d89('0x28')](function(_0x573ff0){var _0x2470cb={'sender':_0x34d02d[_0x5d89('0x46')],'description':_0x34d02d[_0x5d89('0x4a')],'content':_0x34d02d[_0x5d89('0x30')],'beep':_0x34d02d[_0x5d89('0x4b')]};_0x31e9ce[_0x5d89('0x52')](function(_0x437c99){_0x2470cb[_0x5d89('0x53')]=_0x437c99;socket[_0x5d89('0x54')]('userNotification:send',_0x2470cb);});return _0x573ff0;});});})[_0x5d89('0x28')](respondWithResult(_0x34179b,0xc9))[_0x5d89('0x55')](handleError(_0x34179b,null));};function getContent(_0x4e2f8a){return new BPromise(function(_0x2f5473,_0x2be7c7){if(_0x4e2f8a['text']){_0x2f5473(_0x4e2f8a['text']);return;}return db[_0x5d89('0x56')][_0x5d89('0x57')]({'attributes':['html'],'where':{'id':_0x4e2f8a[_0x5d89('0x31')]},'raw':!![]})[_0x5d89('0x28')](function(_0x157b63){if(!_0x157b63)throw new db[(_0x5d89('0x34'))]['ValidationError'](_0x5d89('0x58'));var _0xfaeffa=Mustache[_0x5d89('0x59')](_0x157b63[_0x5d89('0x5a')],_0x4e2f8a['view']);_0x2f5473(_0xfaeffa);})[_0x5d89('0x55')](function(_0x29927b){_0x2be7c7(_0x29927b);});});}function getRecipients(_0x50b11b){return new BPromise(function(_0x5e5387,_0x9e4b83){var _0x307a68=[];var _0x535aaa=[];_0x50b11b['forEach'](function(_0x30b7c7){var _0x5c44ea=_[_0x5d89('0x5b')](_0x30b7c7[_0x5d89('0x5c')]['toLowerCase']());if(_0x5c44ea===_0x5d89('0x5d')){_0x307a68=_[_0x5d89('0x5e')](_0x307a68,_0x30b7c7[_0x5d89('0x5f')]);}else{if(_[_0x5d89('0x43')](_0x5c44ea,_0x5d89('0x60')))_0x5c44ea=_0x5c44ea['replace'](_0x5d89('0x60'),_0x5d89('0x61'));_0x30b7c7[_0x5d89('0x5f')][_0x5d89('0x52')](function(_0x163d04){_0x535aaa[_0x5d89('0x62')](getAgents(_0x5c44ea,_0x163d04));});}});return BPromise[_0x5d89('0x63')](_0x535aaa)[_0x5d89('0x28')](function(_0x1cf70f){_0x307a68=_[_0x5d89('0x5e')](_0x307a68,_[_0x5d89('0x64')](_0x1cf70f));_0x5e5387(_0x307a68);})[_0x5d89('0x55')](function(_0x5b49a0){_0x9e4b83(_0x5b49a0);});});}function getAgents(_0x4512be,_0x2d9c32){return new BPromise(function(_0x3634be,_0x3ea388){return db[_0x4512be][_0x5d89('0x57')]({'where':{'id':_0x2d9c32}})['then'](function(_0x8c06e8){return _0x8c06e8[_0x5d89('0x65')]({'attributes':['id'],'raw':!![]})[_0x5d89('0x28')](function(_0x484c92){var _0x265a91=_[_0x5d89('0x66')](_0x484c92,'id');_0x3634be(_0x265a91);});})[_0x5d89('0x55')](function(_0x15ec55){_0x3ea388(_0x15ec55);});});}
\ No newline at end of file
+var _0x236e=['Invalid\x20model\x20in\x20\x27recipients\x27\x20object','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','join','transaction','create','senderName','forEach','recipient','emit','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','toLowerCase','User','union','ids','queue','replace','Queue','push','all','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./userNotification.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model'];(function(_0x35cabc,_0xc0f89a){var _0x2af2b9=function(_0x7490fb){while(--_0x7490fb){_0x35cabc['push'](_0x35cabc['shift']());}};_0x2af2b9(++_0xc0f89a);}(_0x236e,0xe7));var _0xe236=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x236e[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require(_0xe236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe236('0x1'));var jsonpatch=require(_0xe236('0x2'));var rp=require(_0xe236('0x3'));var moment=require(_0xe236('0x4'));var BPromise=require(_0xe236('0x5'));var Mustache=require(_0xe236('0x6'));var util=require(_0xe236('0x7'));var path=require(_0xe236('0x8'));var sox=require(_0xe236('0x9'));var csv=require(_0xe236('0xa'));var ejs=require(_0xe236('0xb'));var fs=require('fs');var fs_extra=require(_0xe236('0xc'));var _=require(_0xe236('0xd'));var squel=require('squel');var crypto=require(_0xe236('0xe'));var jsforce=require(_0xe236('0xf'));var deskjs=require(_0xe236('0x10'));var toCsv=require(_0xe236('0xa'));var querystring=require(_0xe236('0x11'));var Papa=require('papaparse');var Redis=require(_0xe236('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe236('0x13'));var as=require(_0xe236('0x14'));var hardwareService=require(_0xe236('0x15'));var logger=require(_0xe236('0x16'))(_0xe236('0x17'));var utils=require(_0xe236('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe236('0x19'))['db'];config[_0xe236('0x1a')]=_['defaults'](config[_0xe236('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe236('0x1b'))(new Redis(config['redis']));require(_0xe236('0x1c'))['register'](socket);function respondWithStatusCode(_0x331c8e,_0x3a647f){_0x3a647f=_0x3a647f||0xcc;return function(_0x13c0ab){if(_0x13c0ab){return _0x331c8e[_0xe236('0x1d')](_0x3a647f);}return _0x331c8e[_0xe236('0x1e')](_0x3a647f)['end']();};}function respondWithResult(_0x2e7646,_0x224a2d){_0x224a2d=_0x224a2d||0xc8;return function(_0x3c5a40){if(_0x3c5a40){return _0x2e7646['status'](_0x224a2d)[_0xe236('0x1f')](_0x3c5a40);}};}function respondWithFilteredResult(_0x3d11c9,_0x42e102){return function(_0x4b8cd9){if(_0x4b8cd9){var _0x383552=typeof _0x42e102[_0xe236('0x20')]===_0xe236('0x21')&&typeof _0x42e102[_0xe236('0x22')]===_0xe236('0x21');var _0x4033be=_0x4b8cd9['count'];var _0x440842=_0x383552?0x0:_0x42e102[_0xe236('0x20')];var _0x25a57c=_0x383552?_0x4b8cd9[_0xe236('0x23')]:_0x42e102[_0xe236('0x20')]+_0x42e102[_0xe236('0x22')];var _0x5d0d66;if(_0x25a57c>=_0x4033be){_0x25a57c=_0x4033be;_0x5d0d66=0xc8;}else{_0x5d0d66=0xce;}_0x3d11c9[_0xe236('0x1e')](_0x5d0d66);return _0x3d11c9[_0xe236('0x24')](_0xe236('0x25'),_0x440842+'-'+_0x25a57c+'/'+_0x4033be)[_0xe236('0x1f')](_0x4b8cd9);}return null;};}function patchUpdates(_0x198fa1){return function(_0x1aee85){try{jsonpatch['apply'](_0x1aee85,_0x198fa1,!![]);}catch(_0x3c5264){return BPromise['reject'](_0x3c5264);}return _0x1aee85[_0xe236('0x26')]();};}function saveUpdates(_0x1ea8dc,_0x1b2d9a){return function(_0x50782f){if(_0x50782f){return _0x50782f[_0xe236('0x27')](_0x1ea8dc)[_0xe236('0x28')](function(_0x43cae3){return _0x43cae3;});}return null;};}function removeEntity(_0x381ec8,_0x4369ed){return function(_0x27e50f){if(_0x27e50f){return _0x27e50f[_0xe236('0x29')]()[_0xe236('0x28')](function(){_0x381ec8[_0xe236('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b2551,_0x2a1f49){return function(_0x953f4d){if(!_0x953f4d){_0x5b2551['sendStatus'](0x194);}return _0x953f4d;};}function handleError(_0x2d7c0c,_0x54f08b){_0x54f08b=_0x54f08b||0x1f4;return function(_0x422a39){logger[_0xe236('0x2a')](_0x422a39[_0xe236('0x2b')]);if(_0x422a39['name']){delete _0x422a39[_0xe236('0x2c')];}_0x2d7c0c[_0xe236('0x1e')](_0x54f08b)[_0xe236('0x2d')](_0x422a39);};}exports['sendUserNotification']=function(_0x412512,_0x256458,_0x2ec556){if(!_0x412512[_0xe236('0x2e')][_0xe236('0x2f')](_0xe236('0x30'))&&!_0x412512[_0xe236('0x2e')]['hasOwnProperty'](_0xe236('0x31'))){throw new db[(_0xe236('0x32'))][(_0xe236('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x412512[_0xe236('0x2e')][_0xe236('0x2f')](_0xe236('0x31'))&&!_0x412512[_0xe236('0x2e')][_0xe236('0x2f')]('view')){throw new db[(_0xe236('0x32'))]['ValidationError'](_0xe236('0x34'));}if(!_0x412512[_0xe236('0x2e')][_0xe236('0x2f')](_0xe236('0x35'))){throw new db['Sequelize'][(_0xe236('0x33'))](_0xe236('0x36'));}else{try{var _0x2697de=JSON[_0xe236('0x37')](_0x412512['body'][_0xe236('0x35')]);}catch(_0x30f332){logger[_0xe236('0x2a')](_0x30f332);throw new db[(_0xe236('0x32'))]['ValidationError'](_0xe236('0x38'));}var _0x45554a=[_0xe236('0x39'),_0xe236('0x3a'),_0xe236('0x3b'),_0xe236('0x3c'),_0xe236('0x3d'),_0xe236('0x3e'),_0xe236('0x3f'),_0xe236('0x40'),_0xe236('0x41')];if(_[_0xe236('0x42')](_0x2697de,function(_0x1a4dbf){return!_[_0xe236('0x43')](_0x45554a,_0x1a4dbf[_0xe236('0x44')]['toLowerCase']());})){throw new db[(_0xe236('0x32'))][(_0xe236('0x33'))](_0xe236('0x45'));}}}var _0x4efef4={};_0x4efef4['senderName']=_0x412512[_0xe236('0x2e')][_0xe236('0x2f')]('senderName')?_0x412512[_0xe236('0x2e')]['senderName']:_0x412512[_0xe236('0x41')][_0xe236('0x46')];_0x4efef4['recipientsDescription']=_[_0xe236('0x47')](_0x412512[_0xe236('0x2e')][_0xe236('0x48')])?null:_0x412512[_0xe236('0x2e')][_0xe236('0x48')];_0x4efef4[_0xe236('0x49')]=_0x412512['body'][_0xe236('0x49')]||![];_0x4efef4[_0xe236('0x4a')]=_0x412512['user']['id'];return getContent(_0x412512[_0xe236('0x2e')])['then'](function(_0x138363){_0x4efef4[_0xe236('0x2e')]=_0x138363;return getRecipients(_0x2697de);})[_0xe236('0x28')](function(_0xb2ef1b){_0x4efef4[_0xe236('0x4b')]=_['sortBy'](_0xb2ef1b)[_0xe236('0x4c')](',');return db['sequelize'][_0xe236('0x4d')](function(_0x4b6594){return db['UserNotification'][_0xe236('0x4e')](_0x4efef4,{'raw':!![],'transaction':_0x4b6594})['then'](function(_0x5e7dfe){var _0x38d751={'sender':_0x4efef4[_0xe236('0x4f')],'description':_0x4efef4[_0xe236('0x48')],'content':_0x4efef4[_0xe236('0x2e')],'beep':_0x4efef4[_0xe236('0x49')]};_0xb2ef1b[_0xe236('0x50')](function(_0x3e61ce){_0x38d751[_0xe236('0x51')]=_0x3e61ce;socket[_0xe236('0x52')]('userNotification:send',_0x38d751);});return _0x5e7dfe;});});})[_0xe236('0x28')](respondWithResult(_0x256458,0xc9))[_0xe236('0x53')](handleError(_0x256458,null));};function getContent(_0x50e68c){return new BPromise(function(_0x2d7fc1,_0x545d96){if(_0x50e68c[_0xe236('0x30')]){_0x2d7fc1(_0x50e68c[_0xe236('0x30')]);return;}return db[_0xe236('0x54')][_0xe236('0x55')]({'attributes':['html'],'where':{'id':_0x50e68c[_0xe236('0x31')]},'raw':!![]})[_0xe236('0x28')](function(_0x37cfbc){if(!_0x37cfbc)throw new db[(_0xe236('0x32'))][(_0xe236('0x33'))](_0xe236('0x56'));var _0x2612fe=Mustache[_0xe236('0x57')](_0x37cfbc['html'],_0x50e68c['view']);_0x2d7fc1(_0x2612fe);})[_0xe236('0x53')](function(_0x18f52e){_0x545d96(_0x18f52e);});});}function getRecipients(_0x128444){return new BPromise(function(_0x1a0bb9,_0x4ed72c){var _0x46c7c5=[];var _0x540be5=[];_0x128444['forEach'](function(_0x5d3130){var _0x479566=_[_0xe236('0x58')](_0x5d3130['model'][_0xe236('0x59')]());if(_0x479566===_0xe236('0x5a')){_0x46c7c5=_[_0xe236('0x5b')](_0x46c7c5,_0x5d3130[_0xe236('0x5c')]);}else{if(_[_0xe236('0x43')](_0x479566,_0xe236('0x5d')))_0x479566=_0x479566[_0xe236('0x5e')]('queue',_0xe236('0x5f'));_0x5d3130[_0xe236('0x5c')]['forEach'](function(_0x28aa6a){_0x540be5[_0xe236('0x60')](getAgents(_0x479566,_0x28aa6a));});}});return BPromise[_0xe236('0x61')](_0x540be5)[_0xe236('0x28')](function(_0x3852ea){_0x46c7c5=_[_0xe236('0x5b')](_0x46c7c5,_['flatten'](_0x3852ea));_0x1a0bb9(_0x46c7c5);})[_0xe236('0x53')](function(_0x3e52db){_0x4ed72c(_0x3e52db);});});}function getAgents(_0x48a9ce,_0x594866){return new BPromise(function(_0x3dfb68,_0x5c216b){return db[_0x48a9ce][_0xe236('0x55')]({'where':{'id':_0x594866}})[_0xe236('0x28')](function(_0x9424b9){return _0x9424b9[_0xe236('0x62')]({'attributes':['id'],'raw':!![]})['then'](function(_0x52d78c){var _0x5e39a4=_[_0xe236('0x63')](_0x52d78c,'id');_0x3dfb68(_0x5e39a4);});})[_0xe236('0x53')](function(_0xf6419c){_0x5c216b(_0xf6419c);});});}
\ No newline at end of file
index 97b74ff..398e9b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83aa=['../../mysqldb','update','remove','emit','hasOwnProperty','exports'];(function(_0x22bb88,_0x12b18a){var _0x3cdbd3=function(_0xe476de){while(--_0xe476de){_0x22bb88['push'](_0x22bb88['shift']());}};_0x3cdbd3(++_0x12b18a);}(_0x83aa,0x174));var _0xa83a=function(_0x592af3,_0x1f05db){_0x592af3=_0x592af3-0x0;var _0x2f0878=_0x83aa[_0x592af3];return _0x2f0878;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xa83a('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa83a('0x1'),'afterDestroy':_0xa83a('0x2')};function emitEvent(_0x4b1bd2){return function(_0x3dfead,_0x18ce0e,_0xae1357){UserNotificationEvents[_0xa83a('0x3')](_0x4b1bd2+':'+_0x3dfead['id'],_0x3dfead);UserNotificationEvents[_0xa83a('0x3')](_0x4b1bd2,_0x3dfead);_0xae1357(null);};}for(var e in events){if(events[_0xa83a('0x4')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xa83a('0x5')]=UserNotificationEvents;
\ No newline at end of file
+var _0xd071=['save','remove','emit','exports','events','../../mysqldb','UserNotification'];(function(_0x4fef9c,_0x426335){var _0x2f3603=function(_0x29feee){while(--_0x29feee){_0x4fef9c['push'](_0x4fef9c['shift']());}};_0x2f3603(++_0x426335);}(_0xd071,0x89));var _0x1d07=function(_0x4c62c2,_0x1caefe){_0x4c62c2=_0x4c62c2-0x0;var _0x2b44a8=_0xd071[_0x4c62c2];return _0x2b44a8;};'use strict';var EventEmitter=require(_0x1d07('0x0'));var UserNotification=require(_0x1d07('0x1'))['db'][_0x1d07('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1d07('0x3'),'afterUpdate':'update','afterDestroy':_0x1d07('0x4')};function emitEvent(_0x5a7b62){return function(_0xc9e65,_0x1a049e,_0x5e1a86){UserNotificationEvents[_0x1d07('0x5')](_0x5a7b62+':'+_0xc9e65['id'],_0xc9e65);UserNotificationEvents['emit'](_0x5a7b62,_0xc9e65);_0x5e1a86(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x1d07('0x6')]=UserNotificationEvents;
\ No newline at end of file
index 2ba12a3..1fd338a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc105=['userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification'];(function(_0x512f81,_0x4a7986){var _0xa15099=function(_0x1f7371){while(--_0x1f7371){_0x512f81['push'](_0x512f81['shift']());}};_0xa15099(++_0x4a7986);}(_0xc105,0x1ce));var _0x5c10=function(_0x46c9a5,_0x1cb9e7){_0x46c9a5=_0x46c9a5-0x0;var _0x5e3eec=_0xc105[_0x46c9a5];return _0x5e3eec;};'use strict';var _=require(_0x5c10('0x0'));var util=require(_0x5c10('0x1'));var logger=require(_0x5c10('0x2'))(_0x5c10('0x3'));var moment=require(_0x5c10('0x4'));var BPromise=require(_0x5c10('0x5'));var rp=require(_0x5c10('0x6'));var fs=require('fs');var path=require(_0x5c10('0x7'));var rimraf=require(_0x5c10('0x8'));var config=require(_0x5c10('0x9'));var attributes=require(_0x5c10('0xa'));module[_0x5c10('0xb')]=function(_0x4f76ab,_0x5048f1){return _0x4f76ab[_0x5c10('0xc')](_0x5c10('0xd'),attributes,{'tableName':_0x5c10('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5c10('0xf'),'collate':_0x5c10('0x10')});};
\ No newline at end of file
+var _0x8535=['userNotifications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','./userNotification.attributes','UserNotification'];(function(_0x58c7fe,_0x3990ad){var _0x3b19ba=function(_0x34c331){while(--_0x34c331){_0x58c7fe['push'](_0x58c7fe['shift']());}};_0x3b19ba(++_0x3990ad);}(_0x8535,0x66));var _0x5853=function(_0x1e4da1,_0x597bc8){_0x1e4da1=_0x1e4da1-0x0;var _0x3fdcb5=_0x8535[_0x1e4da1];return _0x3fdcb5;};'use strict';var _=require('lodash');var util=require(_0x5853('0x0'));var logger=require('../../config/logger')(_0x5853('0x1'));var moment=require(_0x5853('0x2'));var BPromise=require(_0x5853('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5853('0x4'));var rimraf=require(_0x5853('0x5'));var config=require('../../config/environment');var attributes=require(_0x5853('0x6'));module['exports']=function(_0x3a1f4b,_0x2dd66d){return _0x3a1f4b['define'](_0x5853('0x7'),attributes,{'tableName':_0x5853('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5853('0x9'),'collate':_0x5853('0xa')});};
\ No newline at end of file
index 2964901..93026f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b0=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','UserNotification,\x20%s,\x20%s','message','result','catch'];(function(_0x2ebde6,_0x5b1d52){var _0x4b0d3d=function(_0x3c25d8){while(--_0x3c25d8){_0x2ebde6['push'](_0x2ebde6['shift']());}};_0x4b0d3d(++_0x5b1d52);}(_0x32b0,0x1e6));var _0x032b=function(_0x1627a9,_0x43576a){_0x1627a9=_0x1627a9-0x0;var _0x47a97d=_0x32b0[_0x1627a9];return _0x47a97d;};'use strict';var _=require(_0x032b('0x0'));var util=require(_0x032b('0x1'));var moment=require('moment');var BPromise=require(_0x032b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x032b('0x3'));var db=require(_0x032b('0x4'))['db'];var utils=require(_0x032b('0x5'));var logger=require(_0x032b('0x6'))(_0x032b('0x7'));var config=require(_0x032b('0x8'));var jayson=require(_0x032b('0x9'));var client=jayson[_0x032b('0xa')]['http']({'port':0x232a});config[_0x032b('0xb')]=_['defaults'](config['redis'],{'host':_0x032b('0xc'),'port':0x18eb});var socket=require(_0x032b('0xd'))(new Redis(config[_0x032b('0xb')]));require(_0x032b('0xe'))[_0x032b('0xf')](socket);function respondWithRpcPromise(_0xc45d3e,_0x3c48b7,_0x12db12){return new BPromise(function(_0x105ef7,_0x130d93){return client[_0x032b('0x10')](_0xc45d3e,_0x12db12)[_0x032b('0x11')](function(_0x53aad1){logger[_0x032b('0x12')]('UserNotification,\x20%s,\x20%s',_0x3c48b7,_0x032b('0x13'));logger[_0x032b('0x14')](_0x032b('0x15'),_0x3c48b7,_0x032b('0x13'),JSON['stringify'](_0x53aad1));if(_0x53aad1[_0x032b('0x16')]){if(_0x53aad1[_0x032b('0x16')]['code']===0x1f4){logger[_0x032b('0x16')](_0x032b('0x17'),_0x3c48b7,_0x53aad1['error'][_0x032b('0x18')]);return _0x130d93(_0x53aad1[_0x032b('0x16')][_0x032b('0x18')]);}logger[_0x032b('0x16')](_0x032b('0x17'),_0x3c48b7,_0x53aad1[_0x032b('0x16')]['message']);return _0x105ef7(_0x53aad1['error']['message']);}else{logger[_0x032b('0x12')](_0x032b('0x17'),_0x3c48b7,_0x032b('0x13'));_0x105ef7(_0x53aad1[_0x032b('0x19')][_0x032b('0x18')]);}})[_0x032b('0x1a')](function(_0xda7e15){logger[_0x032b('0x16')](_0x032b('0x17'),_0x3c48b7,_0xda7e15);_0x130d93(_0xda7e15);});});}
\ No newline at end of file
+var _0x90f8=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','UserNotification,\x20%s,\x20%s'];(function(_0x1d219f,_0x4f51be){var _0x1d93c2=function(_0x4db6b8){while(--_0x4db6b8){_0x1d219f['push'](_0x1d219f['shift']());}};_0x1d93c2(++_0x4f51be);}(_0x90f8,0x189));var _0x890f=function(_0x2b0a0b,_0x1bd154){_0x2b0a0b=_0x2b0a0b-0x0;var _0x53258c=_0x90f8[_0x2b0a0b];return _0x53258c;};'use strict';var _=require(_0x890f('0x0'));var util=require(_0x890f('0x1'));var moment=require(_0x890f('0x2'));var BPromise=require(_0x890f('0x3'));var rs=require(_0x890f('0x4'));var fs=require('fs');var Redis=require(_0x890f('0x5'));var db=require(_0x890f('0x6'))['db'];var utils=require(_0x890f('0x7'));var logger=require(_0x890f('0x8'))(_0x890f('0x9'));var config=require(_0x890f('0xa'));var jayson=require(_0x890f('0xb'));var client=jayson[_0x890f('0xc')][_0x890f('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0x890f('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x890f('0xf'))(new Redis(config[_0x890f('0xe')]));require(_0x890f('0x10'))[_0x890f('0x11')](socket);function respondWithRpcPromise(_0x5bb077,_0x340ae4,_0x25a171){return new BPromise(function(_0x32b490,_0x4ea974){return client[_0x890f('0x12')](_0x5bb077,_0x25a171)[_0x890f('0x13')](function(_0x22301c){logger[_0x890f('0x14')]('UserNotification,\x20%s,\x20%s',_0x340ae4,_0x890f('0x15'));logger[_0x890f('0x16')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x340ae4,_0x890f('0x15'),JSON[_0x890f('0x17')](_0x22301c));if(_0x22301c[_0x890f('0x18')]){if(_0x22301c[_0x890f('0x18')][_0x890f('0x19')]===0x1f4){logger[_0x890f('0x18')](_0x890f('0x1a'),_0x340ae4,_0x22301c['error'][_0x890f('0x1b')]);return _0x4ea974(_0x22301c[_0x890f('0x18')][_0x890f('0x1b')]);}logger[_0x890f('0x18')](_0x890f('0x1a'),_0x340ae4,_0x22301c[_0x890f('0x18')]['message']);return _0x32b490(_0x22301c['error'][_0x890f('0x1b')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x340ae4,_0x890f('0x15'));_0x32b490(_0x22301c[_0x890f('0x1c')][_0x890f('0x1b')]);}})[_0x890f('0x1d')](function(_0x4215f2){logger[_0x890f('0x18')](_0x890f('0x1a'),_0x340ae4,_0x4215f2);_0x4ea974(_0x4215f2);});});}
\ No newline at end of file
index c97cd74..276b3e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdada=['userNotification:','save','update','emit','removeListener','register'];(function(_0x58ed4c,_0x3f4fc2){var _0x4d1ac5=function(_0x2cb5ce){while(--_0x2cb5ce){_0x58ed4c['push'](_0x58ed4c['shift']());}};_0x4d1ac5(++_0x3f4fc2);}(_0xdada,0x163));var _0xadad=function(_0x49ed22,_0x55cdf2){_0x49ed22=_0x49ed22-0x0;var _0xfd0256=_0xdada[_0x49ed22];return _0xfd0256;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xadad('0x0'),'remove',_0xadad('0x1')];function createListener(_0x406df5,_0x58cfff){return function(_0x17af2e){_0x58cfff[_0xadad('0x2')](_0x406df5,_0x17af2e);};}function removeListener(_0x33ee31,_0x2565c2){return function(){UserNotificationEvents[_0xadad('0x3')](_0x33ee31,_0x2565c2);};}exports[_0xadad('0x4')]=function(_0x21efd4){for(var _0x110da7=0x0,_0x43383f=events['length'];_0x110da7<_0x43383f;_0x110da7++){var _0x59724e=events[_0x110da7];var _0x39d74e=createListener(_0xadad('0x5')+_0x59724e,_0x21efd4);UserNotificationEvents['on'](_0x59724e,_0x39d74e);}};
\ No newline at end of file
+var _0x486d=['save','update','removeListener','length','userNotification:'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x486d,0xa5));var _0xd486=function(_0x396722,_0xfcea1f){_0x396722=_0x396722-0x0;var _0x390b27=_0x486d[_0x396722];return _0x390b27;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xd486('0x0'),'remove',_0xd486('0x1')];function createListener(_0x42a4b1,_0x22d2ac){return function(_0x59637c){_0x22d2ac['emit'](_0x42a4b1,_0x59637c);};}function removeListener(_0xea7b40,_0x2a0fed){return function(){UserNotificationEvents[_0xd486('0x2')](_0xea7b40,_0x2a0fed);};}exports['register']=function(_0x3b949e){for(var _0xc20c01=0x0,_0x3175d1=events[_0xd486('0x3')];_0xc20c01<_0x3175d1;_0xc20c01++){var _0x470b0e=events[_0xc20c01];var _0x5ed861=createListener(_0xd486('0x4')+_0x470b0e,_0x3b949e);UserNotificationEvents['on'](_0x470b0e,_0x5ed861);}};
\ No newline at end of file
index 8914649..23a6ead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x48f7cc,_0x462000){var _0x162c86=function(_0x3c1d85){while(--_0x3c1d85){_0x48f7cc['push'](_0x48f7cc['shift']());}};_0x162c86(++_0x462000);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x366378,_0x33a2fa){var _0x19bbf0=function(_0x27900e){while(--_0x27900e){_0x366378['push'](_0x366378['shift']());}};_0x19bbf0(++_0x33a2fa);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index ef67fba..78ac716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x913a=['INTEGER','exports'];(function(_0x4fd896,_0x3b94d2){var _0x2fe4dc=function(_0x4c9da1){while(--_0x4c9da1){_0x4fd896['push'](_0x4fd896['shift']());}};_0x2fe4dc(++_0x3b94d2);}(_0x913a,0xe1));var _0xa913=function(_0x389be6,_0x3af74d){_0x389be6=_0x389be6-0x0;var _0x86190d=_0x913a[_0x389be6];return _0x86190d;};'use strict';var Sequelize=require('sequelize');module[_0xa913('0x0')]={'penalty':{'type':Sequelize[_0xa913('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7345=['INTEGER','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7345,0x163));var _0x5734=function(_0x19524b,_0x2a1247){_0x19524b=_0x19524b-0x0;var _0xe007bc=_0x7345[_0x19524b];return _0xe007bc;};'use strict';var Sequelize=require(_0x5734('0x0'));module[_0x5734('0x1')]={'penalty':{'type':Sequelize[_0x5734('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index da0cea6..332bd14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92ad=['api','moment','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash'];(function(_0xc7807d,_0x890a48){var _0x267bcf=function(_0x549d03){while(--_0x549d03){_0xc7807d['push'](_0xc7807d['shift']());}};_0x267bcf(++_0x890a48);}(_0x92ad,0x1ee));var _0xd92a=function(_0x3a1383,_0x230180){_0x3a1383=_0x3a1383-0x0;var _0xf004e=_0x92ad[_0x3a1383];return _0xf004e;};'use strict';var _=require(_0xd92a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd92a('0x1'));var moment=require(_0xd92a('0x2'));var BPromise=require(_0xd92a('0x3'));var rp=require(_0xd92a('0x4'));var fs=require('fs');var path=require(_0xd92a('0x5'));var rimraf=require(_0xd92a('0x6'));var config=require('../../config/environment');var attributes=require(_0xd92a('0x7'));module[_0xd92a('0x8')]=function(_0x4dfabb,_0x3145b7){return _0x4dfabb[_0xd92a('0x9')](_0xd92a('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd26=['define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x3cfd5a,_0x2cf2a3){var _0x5720e0=function(_0x4e6827){while(--_0x4e6827){_0x3cfd5a['push'](_0x3cfd5a['shift']());}};_0x5720e0(++_0x2cf2a3);}(_0xcd26,0xd5));var _0x6cd2=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0xcd26[_0x421cf8];return _0x145c48;};'use strict';var _=require('lodash');var util=require(_0x6cd2('0x0'));var logger=require(_0x6cd2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6cd2('0x2'));var rp=require(_0x6cd2('0x3'));var fs=require('fs');var path=require(_0x6cd2('0x4'));var rimraf=require('rimraf');var config=require(_0x6cd2('0x5'));var attributes=require(_0x6cd2('0x6'));module['exports']=function(_0x2818c4,_0x28c78c){return _0x2818c4[_0x6cd2('0x7')](_0x6cd2('0x8'),attributes,{'tableName':_0x6cd2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4a75a28..b0be640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a49=['rpc','../../config/environment','client','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1fd437,_0x2c0b47){var _0x40d9e6=function(_0x1668a1){while(--_0x1668a1){_0x1fd437['push'](_0x1fd437['shift']());}};_0x40d9e6(++_0x2c0b47);}(_0x8a49,0xf5));var _0x98a4=function(_0x30562d,_0x522b66){_0x30562d=_0x30562d-0x0;var _0x1f6ced=_0x8a49[_0x30562d];return _0x1f6ced;};'use strict';var _=require(_0x98a4('0x0'));var util=require('util');var moment=require(_0x98a4('0x1'));var BPromise=require(_0x98a4('0x2'));var rs=require(_0x98a4('0x3'));var fs=require('fs');var Redis=require(_0x98a4('0x4'));var db=require(_0x98a4('0x5'))['db'];var utils=require(_0x98a4('0x6'));var logger=require('../../config/logger')(_0x98a4('0x7'));var config=require(_0x98a4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x98a4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fcc27,_0xeafd29,_0x55a04b){return new BPromise(function(_0x3adae2,_0xade265){return client['request'](_0x1fcc27,_0x55a04b)['then'](function(_0x48a614){logger[_0x98a4('0xa')](_0x98a4('0xb'),_0xeafd29,_0x98a4('0xc'));logger[_0x98a4('0xd')](_0x98a4('0xe'),_0xeafd29,_0x98a4('0xc'),JSON[_0x98a4('0xf')](_0x48a614));if(_0x48a614[_0x98a4('0x10')]){if(_0x48a614['error'][_0x98a4('0x11')]===0x1f4){logger[_0x98a4('0x10')](_0x98a4('0xb'),_0xeafd29,_0x48a614[_0x98a4('0x10')][_0x98a4('0x12')]);return _0xade265(_0x48a614[_0x98a4('0x10')]['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0xeafd29,_0x48a614[_0x98a4('0x10')]['message']);return _0x3adae2(_0x48a614[_0x98a4('0x10')][_0x98a4('0x12')]);}else{logger['info'](_0x98a4('0xb'),_0xeafd29,_0x98a4('0xc'));_0x3adae2(_0x48a614[_0x98a4('0x13')][_0x98a4('0x12')]);}})[_0x98a4('0x14')](function(_0x7c38c7){logger[_0x98a4('0x10')](_0x98a4('0xb'),_0xeafd29,_0x7c38c7);_0xade265(_0x7c38c7);});});}
\ No newline at end of file
+var _0x37e2=['error','UserOpenchannelQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','request\x20sent','stringify','code'];(function(_0x4329c8,_0x476c65){var _0x5d0da9=function(_0x118173){while(--_0x118173){_0x4329c8['push'](_0x4329c8['shift']());}};_0x5d0da9(++_0x476c65);}(_0x37e2,0xfb));var _0x237e=function(_0x13b20d,_0x2c5b94){_0x13b20d=_0x13b20d-0x0;var _0x237a60=_0x37e2[_0x13b20d];return _0x237a60;};'use strict';var _=require(_0x237e('0x0'));var util=require(_0x237e('0x1'));var moment=require(_0x237e('0x2'));var BPromise=require(_0x237e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x237e('0x4'));var db=require(_0x237e('0x5'))['db'];var utils=require(_0x237e('0x6'));var logger=require(_0x237e('0x7'))('rpc');var config=require(_0x237e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x237e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x190b6c,_0x56ce74,_0x255c49){return new BPromise(function(_0x40d4cd,_0x6f5352){return client['request'](_0x190b6c,_0x255c49)[_0x237e('0xa')](function(_0x7b99f0){logger[_0x237e('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x56ce74,_0x237e('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x56ce74,_0x237e('0xc'),JSON[_0x237e('0xd')](_0x7b99f0));if(_0x7b99f0['error']){if(_0x7b99f0['error'][_0x237e('0xe')]===0x1f4){logger[_0x237e('0xf')](_0x237e('0x10'),_0x56ce74,_0x7b99f0['error'][_0x237e('0x11')]);return _0x6f5352(_0x7b99f0['error']['message']);}logger[_0x237e('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x56ce74,_0x7b99f0[_0x237e('0xf')][_0x237e('0x11')]);return _0x40d4cd(_0x7b99f0['error'][_0x237e('0x11')]);}else{logger[_0x237e('0xb')](_0x237e('0x10'),_0x56ce74,_0x237e('0xc'));_0x40d4cd(_0x7b99f0[_0x237e('0x12')][_0x237e('0x11')]);}})['catch'](function(_0x24dfe3){logger[_0x237e('0xf')](_0x237e('0x10'),_0x56ce74,_0x24dfe3);_0x6f5352(_0x24dfe3);});});}
\ No newline at end of file
index 2fc624e..95b8bef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a6c=['/:id/resources','addResources','put','delete','removeSections','removeResources','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','show','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections'];(function(_0x47cd62,_0x19bbf3){var _0x7923b9=function(_0x420f48){while(--_0x420f48){_0x47cd62['push'](_0x47cd62['shift']());}};_0x7923b9(++_0x19bbf3);}(_0x0a6c,0x93));var _0xc0a6=function(_0x569283,_0x1b92b9){_0x569283=_0x569283-0x0;var _0x3316da=_0x0a6c[_0x569283];return _0x3316da;};'use strict';var multer=require(_0xc0a6('0x0'));var util=require('util');var path=require(_0xc0a6('0x1'));var timeout=require('connect-timeout');var express=require(_0xc0a6('0x2'));var router=express[_0xc0a6('0x3')]();var fs_extra=require(_0xc0a6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc0a6('0x5'));var config=require(_0xc0a6('0x6'));var controller=require('./userProfile.controller');router[_0xc0a6('0x7')]('/',auth['isAuthenticated'](),controller[_0xc0a6('0x8')]);router['get'](_0xc0a6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xc0a6('0x7')](_0xc0a6('0xa'),auth[_0xc0a6('0xb')](),controller[_0xc0a6('0xc')]);router[_0xc0a6('0x7')](_0xc0a6('0xd'),auth[_0xc0a6('0xb')](),controller[_0xc0a6('0xe')]);router[_0xc0a6('0x7')]('/:id/resources',auth['isAuthenticated'](),controller[_0xc0a6('0xf')]);router[_0xc0a6('0x10')]('/',auth[_0xc0a6('0xb')](),controller[_0xc0a6('0x11')]);router[_0xc0a6('0x10')](_0xc0a6('0x12'),auth[_0xc0a6('0xb')](),controller[_0xc0a6('0x13')]);router[_0xc0a6('0x10')](_0xc0a6('0xd'),auth[_0xc0a6('0xb')](),controller[_0xc0a6('0x14')]);router['post'](_0xc0a6('0x15'),auth[_0xc0a6('0xb')](),controller[_0xc0a6('0x16')]);router[_0xc0a6('0x17')]('/:id',auth[_0xc0a6('0xb')](),controller['update']);router[_0xc0a6('0x18')](_0xc0a6('0xa'),auth[_0xc0a6('0xb')](),controller['destroy']);router[_0xc0a6('0x18')]('/:id/sections',auth['isAuthenticated'](),controller[_0xc0a6('0x19')]);router['delete'](_0xc0a6('0x15'),auth['isAuthenticated'](),controller[_0xc0a6('0x1a')]);module[_0xc0a6('0x1b')]=router;
\ No newline at end of file
+var _0xe430=['/:id/sections','getSections','getResources','create','post','clone','addSections','/:id/resources','addResources','put','delete','destroy','removeSections','removeResources','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x296a49,_0x523826){var _0x3c90f4=function(_0x395da6){while(--_0x395da6){_0x296a49['push'](_0x296a49['shift']());}};_0x3c90f4(++_0x523826);}(_0xe430,0x1da));var _0x0e43=function(_0x3fd837,_0x4c8a51){_0x3fd837=_0x3fd837-0x0;var _0x5a2e48=_0xe430[_0x3fd837];return _0x5a2e48;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0e43('0x0'));var express=require(_0x0e43('0x1'));var router=express[_0x0e43('0x2')]();var fs_extra=require(_0x0e43('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0e43('0x4'));var config=require(_0x0e43('0x5'));var controller=require(_0x0e43('0x6'));router[_0x0e43('0x7')]('/',auth[_0x0e43('0x8')](),controller[_0x0e43('0x9')]);router[_0x0e43('0x7')](_0x0e43('0xa'),auth[_0x0e43('0x8')](),controller['describe']);router[_0x0e43('0x7')](_0x0e43('0xb'),auth[_0x0e43('0x8')](),controller['show']);router['get'](_0x0e43('0xc'),auth[_0x0e43('0x8')](),controller[_0x0e43('0xd')]);router[_0x0e43('0x7')]('/:id/resources',auth['isAuthenticated'](),controller[_0x0e43('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0e43('0xf')]);router[_0x0e43('0x10')]('/:id/clone',auth[_0x0e43('0x8')](),controller[_0x0e43('0x11')]);router[_0x0e43('0x10')](_0x0e43('0xc'),auth['isAuthenticated'](),controller[_0x0e43('0x12')]);router[_0x0e43('0x10')](_0x0e43('0x13'),auth['isAuthenticated'](),controller[_0x0e43('0x14')]);router[_0x0e43('0x15')](_0x0e43('0xb'),auth[_0x0e43('0x8')](),controller['update']);router[_0x0e43('0x16')](_0x0e43('0xb'),auth[_0x0e43('0x8')](),controller[_0x0e43('0x17')]);router[_0x0e43('0x16')](_0x0e43('0xc'),auth[_0x0e43('0x8')](),controller[_0x0e43('0x18')]);router[_0x0e43('0x16')](_0x0e43('0x13'),auth[_0x0e43('0x8')](),controller[_0x0e43('0x19')]);module[_0x0e43('0x1a')]=router;
\ No newline at end of file
index afe731f..8d7dc9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe559=['join','getDataValue','BOOLEAN','sequelize','name','STRING','setDataValue','crudPermissions'];(function(_0x5f5927,_0x56792e){var _0x3a84c0=function(_0x3e15b9){while(--_0x3e15b9){_0x5f5927['push'](_0x5f5927['shift']());}};_0x3a84c0(++_0x56792e);}(_0xe559,0x183));var _0x9e55=function(_0x5a7459,_0x54b0b5){_0x5a7459=_0x5a7459-0x0;var _0x2a1254=_0xe559[_0x5a7459];return _0x2a1254;};'use strict';var Sequelize=require(_0x9e55('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9e55('0x1')},'crudPermissions':{'type':Sequelize[_0x9e55('0x2')],'set':function(_0x5c0c5c){this[_0x9e55('0x3')](_0x9e55('0x4'),_0x5c0c5c?_0x5c0c5c[_0x9e55('0x5')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x9e55('0x6')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9e55('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9e55('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9e55('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9e55('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x9e55('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9e55('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9e55('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6ea8=['STRING','name','crudPermissions','join','split','BOOLEAN','sequelize','exports'];(function(_0x133adf,_0x38fac5){var _0x1fbed4=function(_0x5be269){while(--_0x5be269){_0x133adf['push'](_0x133adf['shift']());}};_0x1fbed4(++_0x38fac5);}(_0x6ea8,0x96));var _0x86ea=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x6ea8[_0x382a62];return _0x490a25;};'use strict';var Sequelize=require(_0x86ea('0x0'));module[_0x86ea('0x1')]={'name':{'type':Sequelize[_0x86ea('0x2')],'allowNull':![],'unique':_0x86ea('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x34bf9a){this['setDataValue'](_0x86ea('0x4'),_0x34bf9a?_0x34bf9a[_0x86ea('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x86ea('0x4'))?this['getDataValue']('crudPermissions')[_0x86ea('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x86ea('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x86ea('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x86ea('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x86ea('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x86ea('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x86ea('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x86ea('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x86ea('0x7')],'defaultValue':!![]}};
\ No newline at end of file
index 7f1be60..9c29c52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56b9=['sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','clone','params','length','get','omit','updatedAt','crudPermissions','body','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','sectionId','UserProfileResource','describe','addSections','userProfileId','Resources','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit'];(function(_0x975c5a,_0x485444){var _0x4914f7=function(_0x45dafe){while(--_0x45dafe){_0x975c5a['push'](_0x975c5a['shift']());}};_0x4914f7(++_0x485444);}(_0x56b9,0x196));var _0x956b=function(_0x434372,_0x1a1a87){_0x434372=_0x434372-0x0;var _0x48bf7a=_0x56b9[_0x434372];return _0x48bf7a;};'use strict';var emlformat=require(_0x956b('0x0'));var rimraf=require(_0x956b('0x1'));var zipdir=require(_0x956b('0x2'));var jsonpatch=require(_0x956b('0x3'));var rp=require(_0x956b('0x4'));var moment=require(_0x956b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x956b('0x6'));var util=require('util');var path=require(_0x956b('0x7'));var sox=require(_0x956b('0x8'));var csv=require(_0x956b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x956b('0xa'));var _=require(_0x956b('0xb'));var squel=require(_0x956b('0xc'));var crypto=require(_0x956b('0xd'));var jsforce=require(_0x956b('0xe'));var deskjs=require(_0x956b('0xf'));var toCsv=require(_0x956b('0x9'));var querystring=require(_0x956b('0x10'));var Papa=require('papaparse');var Redis=require(_0x956b('0x11'));var authService=require(_0x956b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x956b('0x13'));var hardwareService=require(_0x956b('0x14'));var logger=require(_0x956b('0x15'))(_0x956b('0x16'));var utils=require(_0x956b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x956b('0x18'));var db=require(_0x956b('0x19'))['db'];config[_0x956b('0x1a')]=_[_0x956b('0x1b')](config[_0x956b('0x1a')],{'host':_0x956b('0x1c'),'port':0x18eb});var socket=require(_0x956b('0x1d'))(new Redis(config[_0x956b('0x1a')]));require(_0x956b('0x1e'))[_0x956b('0x1f')](socket);function respondWithStatusCode(_0x389c3b,_0x5d3016){_0x5d3016=_0x5d3016||0xcc;return function(_0x43655d){if(_0x43655d){return _0x389c3b[_0x956b('0x20')](_0x5d3016);}return _0x389c3b[_0x956b('0x21')](_0x5d3016)['end']();};}function respondWithResult(_0x96ea9d,_0x3426a2){_0x3426a2=_0x3426a2||0xc8;return function(_0x3e37f1){if(_0x3e37f1){return _0x96ea9d[_0x956b('0x21')](_0x3426a2)[_0x956b('0x22')](_0x3e37f1);}};}function respondWithFilteredResult(_0x2bece3,_0x978146){return function(_0x57dff2){if(_0x57dff2){var _0x2db85f=typeof _0x978146[_0x956b('0x23')]===_0x956b('0x24')&&typeof _0x978146['limit']===_0x956b('0x24');var _0x45211c=_0x57dff2['count'];var _0x5dc7e0=_0x2db85f?0x0:_0x978146[_0x956b('0x23')];var _0x218974=_0x2db85f?_0x57dff2[_0x956b('0x25')]:_0x978146['offset']+_0x978146[_0x956b('0x26')];var _0x2a4cb5;if(_0x218974>=_0x45211c){_0x218974=_0x45211c;_0x2a4cb5=0xc8;}else{_0x2a4cb5=0xce;}_0x2bece3[_0x956b('0x21')](_0x2a4cb5);return _0x2bece3[_0x956b('0x27')](_0x956b('0x28'),_0x5dc7e0+'-'+_0x218974+'/'+_0x45211c)[_0x956b('0x22')](_0x57dff2);}return null;};}function patchUpdates(_0x4ad9bb){return function(_0xf69961){try{jsonpatch[_0x956b('0x29')](_0xf69961,_0x4ad9bb,!![]);}catch(_0x1f9ff6){return BPromise[_0x956b('0x2a')](_0x1f9ff6);}return _0xf69961[_0x956b('0x2b')]();};}function saveUpdates(_0x1ecd0a,_0x9ce16){return function(_0xb99870){if(_0xb99870){return _0xb99870[_0x956b('0x2c')](_0x1ecd0a)[_0x956b('0x2d')](function(_0x32f727){return _0x32f727;});}return null;};}function removeEntity(_0x512a68,_0x502875){return function(_0x3940bb){if(_0x3940bb){return _0x3940bb[_0x956b('0x2e')]()[_0x956b('0x2d')](function(){_0x512a68[_0x956b('0x21')](0xcc)[_0x956b('0x2f')]();});}};}function handleEntityNotFound(_0xa0105e,_0x331c58){return function(_0x4c529a){if(!_0x4c529a){_0xa0105e[_0x956b('0x20')](0x194);}return _0x4c529a;};}function handleError(_0x30786d,_0x6268cb){_0x6268cb=_0x6268cb||0x1f4;return function(_0x3d33ad){logger[_0x956b('0x30')](_0x3d33ad[_0x956b('0x31')]);if(_0x3d33ad[_0x956b('0x32')]){delete _0x3d33ad[_0x956b('0x32')];}_0x30786d[_0x956b('0x21')](_0x6268cb)[_0x956b('0x33')](_0x3d33ad);};}exports[_0x956b('0x34')]=function(_0x29dd86,_0x1c5f3d){var _0x2dac3e={},_0x397865={},_0x3d7edb={'count':0x0,'rows':[]};var _0x46a67c=_[_0x956b('0x35')](db[_0x956b('0x36')][_0x956b('0x37')],function(_0xc2eeec){return{'name':_0xc2eeec['fieldName'],'type':_0xc2eeec[_0x956b('0x38')][_0x956b('0x39')]};});_0x397865[_0x956b('0x3a')]=_[_0x956b('0x35')](_0x46a67c,_0x956b('0x32'));_0x397865[_0x956b('0x3b')]=_[_0x956b('0x3c')](_0x29dd86[_0x956b('0x3b')]);_0x397865['filters']=_['intersection'](_0x397865[_0x956b('0x3a')],_0x397865[_0x956b('0x3b')]);_0x2dac3e[_0x956b('0x3d')]=_[_0x956b('0x3e')](_0x397865[_0x956b('0x3a')],qs[_0x956b('0x3f')](_0x29dd86[_0x956b('0x3b')]['fields']));_0x2dac3e[_0x956b('0x3d')]=_0x2dac3e['attributes']['length']?_0x2dac3e[_0x956b('0x3d')]:_0x397865[_0x956b('0x3a')];if(!_0x29dd86[_0x956b('0x3b')][_0x956b('0x40')](_0x956b('0x41'))){_0x2dac3e[_0x956b('0x26')]=qs[_0x956b('0x26')](_0x29dd86['query'][_0x956b('0x26')]);_0x2dac3e[_0x956b('0x23')]=qs['offset'](_0x29dd86[_0x956b('0x3b')][_0x956b('0x23')]);}_0x2dac3e['order']=qs[_0x956b('0x42')](_0x29dd86['query'][_0x956b('0x42')]);_0x2dac3e[_0x956b('0x43')]=qs[_0x956b('0x44')](_[_0x956b('0x45')](_0x29dd86['query'],_0x397865['filters']),_0x46a67c);if(_0x29dd86[_0x956b('0x3b')][_0x956b('0x46')]){_0x2dac3e[_0x956b('0x43')]=_[_0x956b('0x47')](_0x2dac3e[_0x956b('0x43')],{'$or':_[_0x956b('0x35')](_0x46a67c,function(_0x4ef70a){if(_0x4ef70a[_0x956b('0x38')]!==_0x956b('0x48')){var _0x4d8a3c={};_0x4d8a3c[_0x4ef70a[_0x956b('0x32')]]={'$like':'%'+_0x29dd86['query']['filter']+'%'};return _0x4d8a3c;}})});}_0x2dac3e=_[_0x956b('0x47')]({},_0x2dac3e,_0x29dd86[_0x956b('0x49')]);var _0x4df0bc={'where':_0x2dac3e[_0x956b('0x43')]};return db[_0x956b('0x36')]['count'](_0x4df0bc)[_0x956b('0x2d')](function(_0x591823){_0x3d7edb['count']=_0x591823;if(_0x29dd86[_0x956b('0x3b')][_0x956b('0x4a')]){_0x2dac3e[_0x956b('0x4b')]=[{'all':!![]}];}return db['UserProfile'][_0x956b('0x4c')](_0x2dac3e);})[_0x956b('0x2d')](function(_0x3b3fe6){_0x3d7edb[_0x956b('0x4d')]=_0x3b3fe6;return _0x3d7edb;})[_0x956b('0x2d')](respondWithFilteredResult(_0x1c5f3d,_0x2dac3e))[_0x956b('0x4e')](handleError(_0x1c5f3d,null));};exports[_0x956b('0x4f')]=function(_0x165d50,_0x58c86d){var _0x680222={'raw':![],'where':{'id':_0x165d50['params']['id']}},_0x27ceeb={};_0x27ceeb[_0x956b('0x3a')]=_[_0x956b('0x3c')](db[_0x956b('0x36')]['rawAttributes']);_0x27ceeb[_0x956b('0x3b')]=_[_0x956b('0x3c')](_0x165d50['query']);_0x27ceeb['filters']=_['intersection'](_0x27ceeb[_0x956b('0x3a')],_0x27ceeb[_0x956b('0x3b')]);_0x680222[_0x956b('0x3d')]=_[_0x956b('0x3e')](_0x27ceeb[_0x956b('0x3a')],qs[_0x956b('0x3f')](_0x165d50[_0x956b('0x3b')][_0x956b('0x3f')]));_0x680222[_0x956b('0x3d')]=_0x680222[_0x956b('0x3d')]['length']?_0x680222['attributes']:_0x27ceeb['model'];if(_0x165d50['query']['includeAll']){_0x680222[_0x956b('0x4b')]=[{'all':!![]}];}_0x680222=_[_0x956b('0x47')]({},_0x680222,_0x165d50[_0x956b('0x49')]);return db[_0x956b('0x36')][_0x956b('0x50')](_0x680222)['then'](handleEntityNotFound(_0x58c86d,null))[_0x956b('0x2d')](respondWithResult(_0x58c86d,null))[_0x956b('0x4e')](handleError(_0x58c86d,null));};exports[_0x956b('0x51')]=function(_0x4f1cfd,_0x49f331){return db[_0x956b('0x36')][_0x956b('0x51')](_0x4f1cfd['body'],{})[_0x956b('0x2d')](respondWithResult(_0x49f331,0xc9))[_0x956b('0x4e')](handleError(_0x49f331,null));};exports[_0x956b('0x52')]=function(_0x499fbe,_0x4fd0a1){var _0x4c969a={'where':{'id':_0x499fbe[_0x956b('0x53')]['id']}},_0x10e989={};_0x10e989[_0x956b('0x3a')]=_[_0x956b('0x3c')](db[_0x956b('0x36')][_0x956b('0x37')]);_0x4c969a[_0x956b('0x3d')]=_[_0x956b('0x3e')](_0x10e989[_0x956b('0x3a')],qs[_0x956b('0x3f')](_0x499fbe[_0x956b('0x3b')][_0x956b('0x3f')]));_0x4c969a[_0x956b('0x3d')]=_0x4c969a[_0x956b('0x3d')][_0x956b('0x54')]?_0x4c969a['attributes']:_0x10e989[_0x956b('0x3a')];if(_0x499fbe['query'][_0x956b('0x4a')]){_0x4c969a[_0x956b('0x4b')]=[{'all':!![]}];}_0x4c969a=_[_0x956b('0x47')]({},_0x4c969a,_0x499fbe[_0x956b('0x49')]);return db[_0x956b('0x36')][_0x956b('0x50')](_0x4c969a)['then'](handleEntityNotFound(_0x4fd0a1,null))['then'](function(_0x321573){if(_0x321573){var _0x2807f9=_0x321573[_0x956b('0x55')]({'plain':!![]});_0x2807f9=qs[_0x956b('0x56')](_0x2807f9,['id','createdAt',_0x956b('0x57'),_0x956b('0x58')]);_0x499fbe[_0x956b('0x59')]=_[_0x956b('0x56')](_0x499fbe[_0x956b('0x59')],['id',_0x956b('0x5a'),_0x956b('0x57')]);return db[_0x956b('0x5b')][_0x956b('0x5c')](function(_0x7832a6){return db[_0x956b('0x36')][_0x956b('0x51')](_[_0x956b('0x47')](_0x2807f9,_0x499fbe[_0x956b('0x59')]),{'include':_0x499fbe[_0x956b('0x3b')][_0x956b('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x7832a6})[_0x956b('0x2d')](function(_0xe12e4c){var _0x3e235c=_0xe12e4c['get']({'plain':!![]});return db[_0x956b('0x5d')][_0x956b('0x4c')]({'where':{'userProfileId':_0x499fbe[_0x956b('0x53')]['id']},'raw':!![]})['then'](function(_0x5efe94){if(_0x5efe94){return BPromise['each'](_0x5efe94,function(_0x2fba6a){return new BPromise(function(_0x31bd22,_0xb6b13){if(_0x2fba6a[_0x956b('0x5e')]===null||_0x2fba6a[_0x956b('0x5e')]===0x1)_0x31bd22(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2fba6a['id']},'raw':!![]})[_0x956b('0x2d')](function(_0x5a2bf3){var _0x13e991=_['map'](_0x5a2bf3,function(_0x46caf7){return qs['omit'](_0x46caf7,['id','createdAt','updatedAt',_0x956b('0x5f')]);});_0x31bd22(_0x13e991);})[_0x956b('0x4e')](function(_0x42f69f){_0xb6b13(_0x42f69f);});})['then'](function(_0x31d413){var _0x16dc7b=qs[_0x956b('0x56')](_0x2fba6a,['id',_0x956b('0x5a'),'updatedAt']);_0x16dc7b['userProfileId']=_0x3e235c['id'];if(_0x31d413)_0x16dc7b['Resources']=_0x31d413;return _0x16dc7b;})[_0x956b('0x2d')](function(_0x2a3ca4){return db['UserProfileSection'][_0x956b('0x51')](_0x2a3ca4,{'include':[{'model':db[_0x956b('0x60')],'as':'Resources'}],'raw':!![],'transaction':_0x7832a6});});})[_0x956b('0x2d')](function(){return _0x3e235c;});}});});});}})['then'](respondWithResult(_0x4fd0a1,0xc9))[_0x956b('0x4e')](handleError(_0x4fd0a1,null));};exports['update']=function(_0x413b23,_0x426ea0){if(_0x413b23[_0x956b('0x59')]['id']){delete _0x413b23[_0x956b('0x59')]['id'];}return db[_0x956b('0x36')]['find']({'where':{'id':_0x413b23[_0x956b('0x53')]['id']}})[_0x956b('0x2d')](handleEntityNotFound(_0x426ea0,null))[_0x956b('0x2d')](saveUpdates(_0x413b23[_0x956b('0x59')],null))[_0x956b('0x2d')](respondWithResult(_0x426ea0,null))[_0x956b('0x4e')](handleError(_0x426ea0,null));};exports[_0x956b('0x2e')]=function(_0x3a1c97,_0x7606d5){return db[_0x956b('0x36')][_0x956b('0x50')]({'where':{'id':_0x3a1c97[_0x956b('0x53')]['id']}})[_0x956b('0x2d')](handleEntityNotFound(_0x7606d5,null))[_0x956b('0x2d')](removeEntity(_0x7606d5,null))[_0x956b('0x4e')](handleError(_0x7606d5,null));};exports[_0x956b('0x61')]=function(_0x47cf95,_0x2871e7){return db[_0x956b('0x36')][_0x956b('0x61')]()[_0x956b('0x2d')](respondWithResult(_0x2871e7,null))['catch'](handleError(_0x2871e7,null));};exports[_0x956b('0x62')]=function(_0x5a713d,_0x1d0d13){var _0x27c39d=_0x5a713d[_0x956b('0x59')];return db['UserProfile']['find']({'where':{'id':_0x5a713d[_0x956b('0x53')]['id']}})[_0x956b('0x2d')](handleEntityNotFound(_0x1d0d13,null))[_0x956b('0x2d')](function(_0x4b617d){if(_0x4b617d){return db[_0x956b('0x5b')][_0x956b('0x5c')](function(_0x5ee507){return db[_0x956b('0x5d')][_0x956b('0x2e')]({'where':{'userProfileId':_0x5a713d[_0x956b('0x53')]['id'],'sectionId':_[_0x956b('0x35')](_0x27c39d,function(_0x1d331b){return _0x1d331b[_0x956b('0x5f')];})},'transaction':_0x5ee507})[_0x956b('0x2d')](function(){var _0x21d2be=_[_0x956b('0x35')](_0x27c39d,function(_0x4f564f){_0x4f564f[_0x956b('0x63')]=_0x5a713d[_0x956b('0x53')]['id'];return _0x4f564f;});var _0x57b3fe=[];return BPromise['each'](_0x21d2be,function(_0x2ed012){return db[_0x956b('0x5d')][_0x956b('0x51')](_0x2ed012,{'include':[{'model':db['UserProfileResource'],'as':_0x956b('0x64')}],'raw':!![],'transaction':_0x5ee507})['then'](function(_0x23a2c3){_0x57b3fe[_0x956b('0x65')](_0x23a2c3[_0x956b('0x55')]({'plain':!![]}));});})[_0x956b('0x2d')](function(){return _0x57b3fe;});});});}})[_0x956b('0x2d')](function(_0x1b0e62){return _0x1b0e62;})[_0x956b('0x2d')](respondWithResult(_0x1d0d13,null))[_0x956b('0x4e')](handleError(_0x1d0d13,null));};exports[_0x956b('0x66')]=function(_0x570f27,_0x5dd704){var _0x10b0ca;return db[_0x956b('0x36')][_0x956b('0x50')]({'where':{'id':_0x570f27['params']['id']},'attributes':['id',_0x956b('0x32')]})['then'](handleEntityNotFound(_0x5dd704,null))[_0x956b('0x2d')](function(_0x2e1a8d){if(_0x2e1a8d){_0x10b0ca=_0x2e1a8d;return db[_0x956b('0x5d')][_0x956b('0x2e')]({'where':{'userProfileId':_0x570f27[_0x956b('0x53')]['id'],'sectionId':_0x570f27[_0x956b('0x3b')][_0x956b('0x67')]}});}})[_0x956b('0x2d')](function(){return _0x10b0ca;})[_0x956b('0x2d')](respondWithStatusCode(_0x5dd704,null))[_0x956b('0x4e')](handleError(_0x5dd704,null));};exports[_0x956b('0x68')]=function(_0x2627c3,_0x532531){var _0x3d58ca=[];var _0x4143b9=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2627c3[_0x956b('0x53')]['id']},'raw':!![]})[_0x956b('0x2d')](function(_0x32dea5){_0x3d58ca=_[_0x956b('0x46')](_0x32dea5,function(_0x12cdeb){return _0x12cdeb[_0x956b('0x69')]===0x1||_['includes']([0x3eb,0x709],_0x12cdeb[_0x956b('0x5f')]);});if(!_[_0x956b('0x6a')](_0x3d58ca)){return _[_0x956b('0x35')](_0x3d58ca,function(_0x1264a6){return _0x1264a6[_0x956b('0x5f')];});}else{return;}})[_0x956b('0x2d')](function(_0x4dd82c){if(_0x4dd82c)_0x4143b9=_0x4dd82c;if(_[_0x956b('0x6b')](_0x4143b9,0x64)){var _0x53a4ae=_[_0x956b('0x50')](_0x3d58ca,{'sectionId':0x64});return hasDefaultDashboard(_0x53a4ae)[_0x956b('0x2d')](function(_0x1e3c92){return _['map'](_0x3d58ca,function(_0x3e0473){if(_0x3e0473[_0x956b('0x5f')]===0x64){_0x3e0473[_0x956b('0x6c')]=_0x1e3c92;}return _0x3e0473;});});}else{return;}})[_0x956b('0x2d')](function(_0x1f8405){if(_0x1f8405)_0x3d58ca=_0x1f8405;if(_['includes'](_0x4143b9,0x3eb)){var _0x5dfdb7=_[_0x956b('0x50')](_0x3d58ca,{'sectionId':0x3eb});return getCustomDashboards(_0x5dfdb7)[_0x956b('0x2d')](function(_0x53b81d){return _['map'](_0x3d58ca,function(_0x38e366){if(_0x5dfdb7['enabled']){if(_0x38e366['sectionId']===0x3eb){_0x38e366[_0x956b('0x6c')]=_0x53b81d;}}else{if(_0x38e366[_0x956b('0x5f')]===0x64){_0x38e366[_0x956b('0x6c')]=_0x53b81d;}}return _0x38e366;});});}else{return;}})['then'](function(_0x1cee78){if(_0x1cee78)_0x3d58ca=_0x1cee78;if(_['includes'](_0x4143b9,0x709)){var _0x59836d=_['find'](_0x3d58ca,{'sectionId':0x709});return getPlugins(_0x59836d)[_0x956b('0x2d')](function(_0x5106e5){if(_0x59836d[_0x956b('0x69')]){return _[_0x956b('0x35')](_0x3d58ca,function(_0x4e33c2){if(_0x4e33c2[_0x956b('0x5f')]===0x709){_0x4e33c2[_0x956b('0x6c')]=_0x5106e5;}return _0x4e33c2;});}else{var _0x5a9ca8={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5106e5};var _0xde2342=_[_0x956b('0x35')](_0x3d58ca);_0xde2342[_0x956b('0x65')](_0x5a9ca8);return _0xde2342;}});}else{return;}})['then'](function(_0x55d215){if(_0x55d215)_0x3d58ca=_0x55d215;return _[_0x956b('0x46')](_0x3d58ca,[_0x956b('0x69'),0x1]);})[_0x956b('0x2d')](respondWithResult(_0x532531,null))[_0x956b('0x4e')](handleError(_0x532531,null));};function hasDefaultDashboard(_0x3974f6){var _0x1f5b6f=[0x65];return new BPromise(function(_0x57df81,_0x1f2a50){try{if(_0x3974f6['autoAssociation']){_0x57df81(_0x1f5b6f);}else{return db[_0x956b('0x60')]['findOne']({'where':{'sectionId':_0x3974f6['id']},'raw':!![]})[_0x956b('0x2d')](function(_0x35041d){_0x35041d?_0x57df81(_0x1f5b6f):_0x57df81();});}}catch(_0xdf84a2){_0x1f2a50(_0xdf84a2);}});}function getCustomDashboards(_0x5396cb){var _0xc7e389=[];return new BPromise(function(_0x5cbf1c,_0x16cdb5){try{if(_0x5396cb[_0x956b('0x5e')]){return db['Dashboard'][_0x956b('0x4c')]({'raw':!![]})[_0x956b('0x2d')](function(_0x32975d){_0x32975d[_0x956b('0x6d')](function(_0x100f99){_0xc7e389[_0x956b('0x65')](_0x100f99['id']+0x1869f);});_0x5cbf1c(_0xc7e389);});}else{return db[_0x956b('0x60')][_0x956b('0x4c')]({'where':{'sectionId':_0x5396cb['id']},'raw':!![]})[_0x956b('0x2d')](function(_0x4a4746){_0x4a4746[_0x956b('0x6d')](function(_0x1310c3){_0xc7e389['push'](_0x1310c3['resourceId']+0x1869f);});_0x5cbf1c(_0xc7e389);});}}catch(_0x22bfb5){_0x16cdb5(_0x22bfb5);}});}function getPlugins(_0x5cee44){var _0x44069f=[];return new BPromise(function(_0x2dbe77,_0x58d9af){try{if(_0x5cee44[_0x956b('0x5e')]){return db[_0x956b('0x6e')][_0x956b('0x4c')]({'raw':!![]})[_0x956b('0x2d')](function(_0x4266be){_0x4266be[_0x956b('0x6d')](function(_0x33d051){_0x44069f[_0x956b('0x65')](_0x33d051['id']+0x15b38);});_0x2dbe77(_0x44069f);});}else{return db[_0x956b('0x60')]['findAll']({'where':{'sectionId':_0x5cee44['id']},'raw':!![]})[_0x956b('0x2d')](function(_0x5c8ef5){_0x5c8ef5[_0x956b('0x6d')](function(_0x4ece13){_0x44069f[_0x956b('0x65')](_0x4ece13[_0x956b('0x6f')]+0x15b38);});_0x2dbe77(_0x44069f);});}}catch(_0x424c65){_0x58d9af(_0x424c65);}});}exports['addResources']=function(_0x4cced1,_0x4f92e6){return db[_0x956b('0x36')][_0x956b('0x50')]({'where':{'id':_0x4cced1[_0x956b('0x53')]['id']}})[_0x956b('0x2d')](handleEntityNotFound(_0x4f92e6,null))[_0x956b('0x2d')](function(_0x3f4270){if(_0x3f4270){return db[_0x956b('0x5b')]['transaction'](function(_0x5d6ee2){return db[_0x956b('0x5d')]['findAll']({'where':{'userProfileId':_0x4cced1[_0x956b('0x53')]['id']},'attributes':['id'],'raw':!![]})[_0x956b('0x2d')](function(_0xc8b100){if(_0xc8b100){return db[_0x956b('0x5d')][_0x956b('0x2e')]({'where':{'userProfileId':_0x4cced1['params']['id'],'id':_['map'](_0xc8b100,function(_0xda80b6){return _0xda80b6['id'];})},'transaction':_0x5d6ee2});}})[_0x956b('0x2d')](function(_0x10347e){var _0x35328b=_['map'](_0x4cced1['body'],function(_0x1f1ded){_0x1f1ded[_0x956b('0x63')]=_0x4cced1['params']['id'];return _0x1f1ded;});return db['UserProfileSection']['bulkCreate'](_0x35328b,{'raw':!![],'transaction':_0x5d6ee2});})['then'](function(_0x556492){var _0x4b3e5d=_[_0x956b('0x46')](_[_0x956b('0x35')](_0x556492,function(_0x46965a){return _0x46965a['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4b3e5d){return db[_0x956b('0x5d')]['findAll']({'where':{'userProfileId':_0x4cced1[_0x956b('0x53')]['id'],'sectionId':_[_0x956b('0x35')](_0x4b3e5d,function(_0x1be426){return _0x1be426['sectionId'];})},'attributes':['id',_0x956b('0x5f')],'raw':!![]})[_0x956b('0x2d')](function(_0x2028b3){var _0x5d0cfe=_['map'](_0x4cced1[_0x956b('0x59')],function(_0x28c40f){_0x28c40f[_0x956b('0x63')]=_0x4cced1[_0x956b('0x53')]['id'];return _0x28c40f;});return db[_0x956b('0x60')][_0x956b('0x70')](_0x5d0cfe,{'raw':!![],'transaction':_0x5d6ee2});});}})[_0x956b('0x4e')](handleError(_0x4f92e6,null));});}})[_0x956b('0x2d')](function(_0x42a200){var _0x288894=_[_0x956b('0x35')](_0x42a200,function(_0x5ba0b4){return _0x5ba0b4[_0x956b('0x55')]({'plain':!![]});});})[_0x956b('0x2d')](respondWithResult(_0x4f92e6,null))['catch'](handleError(_0x4f92e6,null));};exports[_0x956b('0x71')]=function(_0xc77505,_0x36aa28,_0x42c8f2){return db[_0x956b('0x36')][_0x956b('0x50')]({'where':{'id':_0xc77505['params']['id']}})[_0x956b('0x2d')](handleEntityNotFound(_0x36aa28,null))[_0x956b('0x2d')](function(_0x4fac7c){if(_0x4fac7c){return _0x4fac7c['removeResources'](_0xc77505[_0x956b('0x3b')][_0x956b('0x67')]);}})[_0x956b('0x2d')](respondWithStatusCode(_0x36aa28,null))[_0x956b('0x4e')](handleError(_0x36aa28,null));};exports[_0x956b('0x72')]=function(_0xfec9ec,_0x540fd0){var _0x1be098={};if(!_0xfec9ec[_0x956b('0x3b')][_0x956b('0x73')])throw new Error(_0x956b('0x74'));if(!_0xfec9ec[_0x956b('0x3b')][_0x956b('0x40')](_0x956b('0x41'))){_0x1be098[_0x956b('0x26')]=qs[_0x956b('0x26')](_0xfec9ec[_0x956b('0x3b')]['limit']);_0x1be098[_0x956b('0x23')]=qs[_0x956b('0x23')](_0xfec9ec['query'][_0x956b('0x23')]);}return db['UserProfile'][_0x956b('0x50')]({'where':{'id':_0xfec9ec['params']['id']}})[_0x956b('0x2d')](function(_0x180ab7){if(!_0x180ab7)throw new Error(_0x956b('0x75')+_0xfec9ec[_0x956b('0x53')]['id']);return db[_0x956b('0x36')][_0x956b('0x72')](_0xfec9ec);})[_0x956b('0x2d')](respondWithFilteredResult(_0x540fd0,_0x1be098))[_0x956b('0x4e')](handleError(_0x540fd0,null));};
\ No newline at end of file
+var _0xbc87=['ids','enabled','includes','isEmpty','subsections','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','sectionId','Resources','UserProfileResource','destroy','describe','userProfileId','each','push','removeSections'];(function(_0xf394a,_0x20d1dd){var _0xde580f=function(_0x44798e){while(--_0x44798e){_0xf394a['push'](_0xf394a['shift']());}};_0xde580f(++_0x20d1dd);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x4dd888,_0x19fd09){_0x4dd888=_0x4dd888-0x0;var _0x3d12bc=_0xbc87[_0x4dd888];return _0x3d12bc;};'use strict';var emlformat=require(_0x7bc8('0x0'));var rimraf=require(_0x7bc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bc8('0x2'));var rp=require(_0x7bc8('0x3'));var moment=require(_0x7bc8('0x4'));var BPromise=require(_0x7bc8('0x5'));var Mustache=require('mustache');var util=require(_0x7bc8('0x6'));var path=require(_0x7bc8('0x7'));var sox=require(_0x7bc8('0x8'));var csv=require(_0x7bc8('0x9'));var ejs=require(_0x7bc8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7bc8('0xb'));var crypto=require(_0x7bc8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7bc8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7bc8('0xe'));var Papa=require(_0x7bc8('0xf'));var Redis=require('ioredis');var authService=require(_0x7bc8('0x10'));var qs=require(_0x7bc8('0x11'));var as=require(_0x7bc8('0x12'));var hardwareService=require(_0x7bc8('0x13'));var logger=require(_0x7bc8('0x14'))('api');var utils=require(_0x7bc8('0x15'));var config=require(_0x7bc8('0x16'));var licenseUtil=require(_0x7bc8('0x17'));var db=require(_0x7bc8('0x18'))['db'];config[_0x7bc8('0x19')]=_[_0x7bc8('0x1a')](config[_0x7bc8('0x19')],{'host':_0x7bc8('0x1b'),'port':0x18eb});var socket=require(_0x7bc8('0x1c'))(new Redis(config[_0x7bc8('0x19')]));require(_0x7bc8('0x1d'))['register'](socket);function respondWithStatusCode(_0xaffc57,_0x1621bc){_0x1621bc=_0x1621bc||0xcc;return function(_0x22696c){if(_0x22696c){return _0xaffc57[_0x7bc8('0x1e')](_0x1621bc);}return _0xaffc57['status'](_0x1621bc)[_0x7bc8('0x1f')]();};}function respondWithResult(_0x53be05,_0x249bd2){_0x249bd2=_0x249bd2||0xc8;return function(_0x56a3f3){if(_0x56a3f3){return _0x53be05[_0x7bc8('0x20')](_0x249bd2)[_0x7bc8('0x21')](_0x56a3f3);}};}function respondWithFilteredResult(_0x2afec4,_0x4fdcb0){return function(_0xcfb543){if(_0xcfb543){var _0x1f2fb9=typeof _0x4fdcb0[_0x7bc8('0x22')]===_0x7bc8('0x23')&&typeof _0x4fdcb0[_0x7bc8('0x24')]===_0x7bc8('0x23');var _0x7c2bdb=_0xcfb543[_0x7bc8('0x25')];var _0x5cc4af=_0x1f2fb9?0x0:_0x4fdcb0[_0x7bc8('0x22')];var _0x5d0791=_0x1f2fb9?_0xcfb543[_0x7bc8('0x25')]:_0x4fdcb0[_0x7bc8('0x22')]+_0x4fdcb0[_0x7bc8('0x24')];var _0x42a251;if(_0x5d0791>=_0x7c2bdb){_0x5d0791=_0x7c2bdb;_0x42a251=0xc8;}else{_0x42a251=0xce;}_0x2afec4[_0x7bc8('0x20')](_0x42a251);return _0x2afec4[_0x7bc8('0x26')]('Content-Range',_0x5cc4af+'-'+_0x5d0791+'/'+_0x7c2bdb)[_0x7bc8('0x21')](_0xcfb543);}return null;};}function patchUpdates(_0x60cbb9){return function(_0x117c79){try{jsonpatch[_0x7bc8('0x27')](_0x117c79,_0x60cbb9,!![]);}catch(_0x2fd38b){return BPromise[_0x7bc8('0x28')](_0x2fd38b);}return _0x117c79[_0x7bc8('0x29')]();};}function saveUpdates(_0x305e52,_0x1e42e6){return function(_0x2672d4){if(_0x2672d4){return _0x2672d4[_0x7bc8('0x2a')](_0x305e52)['then'](function(_0x3ef138){return _0x3ef138;});}return null;};}function removeEntity(_0x9dc530,_0x2133eb){return function(_0x369550){if(_0x369550){return _0x369550['destroy']()['then'](function(){_0x9dc530['status'](0xcc)[_0x7bc8('0x1f')]();});}};}function handleEntityNotFound(_0x402f17,_0x157b66){return function(_0x2f519c){if(!_0x2f519c){_0x402f17['sendStatus'](0x194);}return _0x2f519c;};}function handleError(_0x3e4f4c,_0x344fa0){_0x344fa0=_0x344fa0||0x1f4;return function(_0x212515){logger['error'](_0x212515[_0x7bc8('0x2b')]);if(_0x212515['name']){delete _0x212515[_0x7bc8('0x2c')];}_0x3e4f4c[_0x7bc8('0x20')](_0x344fa0)[_0x7bc8('0x2d')](_0x212515);};}exports[_0x7bc8('0x2e')]=function(_0xe8418c,_0x235ab8){var _0x1540b5={},_0xbe46e2={},_0xd7d333={'count':0x0,'rows':[]};var _0x44afe0=_[_0x7bc8('0x2f')](db[_0x7bc8('0x30')][_0x7bc8('0x31')],function(_0x43d13d){return{'name':_0x43d13d['fieldName'],'type':_0x43d13d[_0x7bc8('0x32')][_0x7bc8('0x33')]};});_0xbe46e2[_0x7bc8('0x34')]=_['map'](_0x44afe0,_0x7bc8('0x2c'));_0xbe46e2['query']=_[_0x7bc8('0x35')](_0xe8418c['query']);_0xbe46e2[_0x7bc8('0x36')]=_[_0x7bc8('0x37')](_0xbe46e2[_0x7bc8('0x34')],_0xbe46e2[_0x7bc8('0x38')]);_0x1540b5[_0x7bc8('0x39')]=_['intersection'](_0xbe46e2[_0x7bc8('0x34')],qs[_0x7bc8('0x3a')](_0xe8418c[_0x7bc8('0x38')][_0x7bc8('0x3a')]));_0x1540b5[_0x7bc8('0x39')]=_0x1540b5[_0x7bc8('0x39')][_0x7bc8('0x3b')]?_0x1540b5[_0x7bc8('0x39')]:_0xbe46e2[_0x7bc8('0x34')];if(!_0xe8418c[_0x7bc8('0x38')][_0x7bc8('0x3c')](_0x7bc8('0x3d'))){_0x1540b5[_0x7bc8('0x24')]=qs[_0x7bc8('0x24')](_0xe8418c['query'][_0x7bc8('0x24')]);_0x1540b5[_0x7bc8('0x22')]=qs[_0x7bc8('0x22')](_0xe8418c[_0x7bc8('0x38')][_0x7bc8('0x22')]);}_0x1540b5[_0x7bc8('0x3e')]=qs[_0x7bc8('0x3f')](_0xe8418c[_0x7bc8('0x38')][_0x7bc8('0x3f')]);_0x1540b5[_0x7bc8('0x40')]=qs[_0x7bc8('0x36')](_[_0x7bc8('0x41')](_0xe8418c[_0x7bc8('0x38')],_0xbe46e2[_0x7bc8('0x36')]),_0x44afe0);if(_0xe8418c[_0x7bc8('0x38')][_0x7bc8('0x42')]){_0x1540b5['where']=_['merge'](_0x1540b5[_0x7bc8('0x40')],{'$or':_[_0x7bc8('0x2f')](_0x44afe0,function(_0x2a3097){if(_0x2a3097[_0x7bc8('0x32')]!==_0x7bc8('0x43')){var _0x5185c5={};_0x5185c5[_0x2a3097[_0x7bc8('0x2c')]]={'$like':'%'+_0xe8418c[_0x7bc8('0x38')][_0x7bc8('0x42')]+'%'};return _0x5185c5;}})});}_0x1540b5=_[_0x7bc8('0x44')]({},_0x1540b5,_0xe8418c[_0x7bc8('0x45')]);var _0x21172d={'where':_0x1540b5[_0x7bc8('0x40')]};return db['UserProfile']['count'](_0x21172d)[_0x7bc8('0x46')](function(_0xbabf7b){_0xd7d333[_0x7bc8('0x25')]=_0xbabf7b;if(_0xe8418c['query'][_0x7bc8('0x47')]){_0x1540b5[_0x7bc8('0x48')]=[{'all':!![]}];}return db['UserProfile'][_0x7bc8('0x49')](_0x1540b5);})[_0x7bc8('0x46')](function(_0x22f361){_0xd7d333[_0x7bc8('0x4a')]=_0x22f361;return _0xd7d333;})[_0x7bc8('0x46')](respondWithFilteredResult(_0x235ab8,_0x1540b5))[_0x7bc8('0x4b')](handleError(_0x235ab8,null));};exports[_0x7bc8('0x4c')]=function(_0x4c79e3,_0x397966){var _0x159350={'raw':![],'where':{'id':_0x4c79e3[_0x7bc8('0x4d')]['id']}},_0x282fd1={};_0x282fd1[_0x7bc8('0x34')]=_[_0x7bc8('0x35')](db[_0x7bc8('0x30')][_0x7bc8('0x31')]);_0x282fd1[_0x7bc8('0x38')]=_[_0x7bc8('0x35')](_0x4c79e3[_0x7bc8('0x38')]);_0x282fd1[_0x7bc8('0x36')]=_['intersection'](_0x282fd1[_0x7bc8('0x34')],_0x282fd1[_0x7bc8('0x38')]);_0x159350['attributes']=_['intersection'](_0x282fd1[_0x7bc8('0x34')],qs[_0x7bc8('0x3a')](_0x4c79e3[_0x7bc8('0x38')][_0x7bc8('0x3a')]));_0x159350[_0x7bc8('0x39')]=_0x159350[_0x7bc8('0x39')][_0x7bc8('0x3b')]?_0x159350[_0x7bc8('0x39')]:_0x282fd1[_0x7bc8('0x34')];if(_0x4c79e3[_0x7bc8('0x38')]['includeAll']){_0x159350[_0x7bc8('0x48')]=[{'all':!![]}];}_0x159350=_[_0x7bc8('0x44')]({},_0x159350,_0x4c79e3['options']);return db[_0x7bc8('0x30')][_0x7bc8('0x4e')](_0x159350)[_0x7bc8('0x46')](handleEntityNotFound(_0x397966,null))['then'](respondWithResult(_0x397966,null))[_0x7bc8('0x4b')](handleError(_0x397966,null));};exports[_0x7bc8('0x4f')]=function(_0x32166f,_0x3bc9b8){return db[_0x7bc8('0x30')]['create'](_0x32166f[_0x7bc8('0x50')],{})[_0x7bc8('0x46')](respondWithResult(_0x3bc9b8,0xc9))[_0x7bc8('0x4b')](handleError(_0x3bc9b8,null));};exports['clone']=function(_0x52d093,_0x8fbe67){var _0x314af0={'where':{'id':_0x52d093[_0x7bc8('0x4d')]['id']}},_0x356789={};_0x356789[_0x7bc8('0x34')]=_['keys'](db[_0x7bc8('0x30')][_0x7bc8('0x31')]);_0x314af0[_0x7bc8('0x39')]=_[_0x7bc8('0x37')](_0x356789[_0x7bc8('0x34')],qs[_0x7bc8('0x3a')](_0x52d093['query']['fields']));_0x314af0['attributes']=_0x314af0[_0x7bc8('0x39')][_0x7bc8('0x3b')]?_0x314af0[_0x7bc8('0x39')]:_0x356789[_0x7bc8('0x34')];if(_0x52d093['query'][_0x7bc8('0x47')]){_0x314af0[_0x7bc8('0x48')]=[{'all':!![]}];}_0x314af0=_[_0x7bc8('0x44')]({},_0x314af0,_0x52d093[_0x7bc8('0x45')]);return db[_0x7bc8('0x30')][_0x7bc8('0x4e')](_0x314af0)[_0x7bc8('0x46')](handleEntityNotFound(_0x8fbe67,null))[_0x7bc8('0x46')](function(_0x964898){if(_0x964898){var _0x252026=_0x964898[_0x7bc8('0x51')]({'plain':!![]});_0x252026=qs[_0x7bc8('0x52')](_0x252026,['id','createdAt',_0x7bc8('0x53'),_0x7bc8('0x54')]);_0x52d093['body']=_['omit'](_0x52d093['body'],['id',_0x7bc8('0x55'),_0x7bc8('0x53')]);return db[_0x7bc8('0x56')][_0x7bc8('0x57')](function(_0x197388){return db[_0x7bc8('0x30')][_0x7bc8('0x4f')](_[_0x7bc8('0x44')](_0x252026,_0x52d093[_0x7bc8('0x50')]),{'include':_0x52d093[_0x7bc8('0x38')][_0x7bc8('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x197388})['then'](function(_0x41fd1d){var _0x386963=_0x41fd1d['get']({'plain':!![]});return db[_0x7bc8('0x58')]['findAll']({'where':{'userProfileId':_0x52d093[_0x7bc8('0x4d')]['id']},'raw':!![]})[_0x7bc8('0x46')](function(_0x27cde0){if(_0x27cde0){return BPromise['each'](_0x27cde0,function(_0x3ddb75){return new BPromise(function(_0x24c6ba,_0x260c7e){if(_0x3ddb75[_0x7bc8('0x59')]===null||_0x3ddb75[_0x7bc8('0x59')]===0x1)_0x24c6ba(null);return db['UserProfileResource'][_0x7bc8('0x49')]({'where':{'sectionId':_0x3ddb75['id']},'raw':!![]})[_0x7bc8('0x46')](function(_0x50cc22){var _0x1fb856=_[_0x7bc8('0x2f')](_0x50cc22,function(_0x1c0849){return qs['omit'](_0x1c0849,['id','createdAt',_0x7bc8('0x53'),_0x7bc8('0x5a')]);});_0x24c6ba(_0x1fb856);})[_0x7bc8('0x4b')](function(_0x18c1ff){_0x260c7e(_0x18c1ff);});})['then'](function(_0x1df276){var _0xc7d5f6=qs[_0x7bc8('0x52')](_0x3ddb75,['id',_0x7bc8('0x55'),_0x7bc8('0x53')]);_0xc7d5f6['userProfileId']=_0x386963['id'];if(_0x1df276)_0xc7d5f6[_0x7bc8('0x5b')]=_0x1df276;return _0xc7d5f6;})[_0x7bc8('0x46')](function(_0x1b869e){return db['UserProfileSection'][_0x7bc8('0x4f')](_0x1b869e,{'include':[{'model':db[_0x7bc8('0x5c')],'as':'Resources'}],'raw':!![],'transaction':_0x197388});});})[_0x7bc8('0x46')](function(){return _0x386963;});}});});});}})[_0x7bc8('0x46')](respondWithResult(_0x8fbe67,0xc9))['catch'](handleError(_0x8fbe67,null));};exports['update']=function(_0x475847,_0x540f5c){if(_0x475847['body']['id']){delete _0x475847[_0x7bc8('0x50')]['id'];}return db[_0x7bc8('0x30')][_0x7bc8('0x4e')]({'where':{'id':_0x475847[_0x7bc8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x540f5c,null))[_0x7bc8('0x46')](saveUpdates(_0x475847[_0x7bc8('0x50')],null))['then'](respondWithResult(_0x540f5c,null))[_0x7bc8('0x4b')](handleError(_0x540f5c,null));};exports[_0x7bc8('0x5d')]=function(_0x532943,_0x49514a){return db[_0x7bc8('0x30')][_0x7bc8('0x4e')]({'where':{'id':_0x532943['params']['id']}})[_0x7bc8('0x46')](handleEntityNotFound(_0x49514a,null))[_0x7bc8('0x46')](removeEntity(_0x49514a,null))['catch'](handleError(_0x49514a,null));};exports['describe']=function(_0x471022,_0x245f6f){return db[_0x7bc8('0x30')][_0x7bc8('0x5e')]()[_0x7bc8('0x46')](respondWithResult(_0x245f6f,null))[_0x7bc8('0x4b')](handleError(_0x245f6f,null));};exports['addSections']=function(_0x230d47,_0x253c38){var _0x583ac8=_0x230d47['body'];return db[_0x7bc8('0x30')][_0x7bc8('0x4e')]({'where':{'id':_0x230d47[_0x7bc8('0x4d')]['id']}})[_0x7bc8('0x46')](handleEntityNotFound(_0x253c38,null))['then'](function(_0x2f32a5){if(_0x2f32a5){return db[_0x7bc8('0x56')][_0x7bc8('0x57')](function(_0x51b816){return db[_0x7bc8('0x58')][_0x7bc8('0x5d')]({'where':{'userProfileId':_0x230d47['params']['id'],'sectionId':_['map'](_0x583ac8,function(_0x5809b7){return _0x5809b7[_0x7bc8('0x5a')];})},'transaction':_0x51b816})['then'](function(){var _0x116ac0=_['map'](_0x583ac8,function(_0x65aaa5){_0x65aaa5[_0x7bc8('0x5f')]=_0x230d47[_0x7bc8('0x4d')]['id'];return _0x65aaa5;});var _0x2e98f2=[];return BPromise[_0x7bc8('0x60')](_0x116ac0,function(_0x97a037){return db['UserProfileSection'][_0x7bc8('0x4f')](_0x97a037,{'include':[{'model':db[_0x7bc8('0x5c')],'as':_0x7bc8('0x5b')}],'raw':!![],'transaction':_0x51b816})['then'](function(_0x22f86f){_0x2e98f2[_0x7bc8('0x61')](_0x22f86f[_0x7bc8('0x51')]({'plain':!![]}));});})[_0x7bc8('0x46')](function(){return _0x2e98f2;});});});}})[_0x7bc8('0x46')](function(_0x134551){return _0x134551;})[_0x7bc8('0x46')](respondWithResult(_0x253c38,null))[_0x7bc8('0x4b')](handleError(_0x253c38,null));};exports[_0x7bc8('0x62')]=function(_0x5c436f,_0x55a36e){var _0x20a536;return db['UserProfile'][_0x7bc8('0x4e')]({'where':{'id':_0x5c436f[_0x7bc8('0x4d')]['id']},'attributes':['id',_0x7bc8('0x2c')]})[_0x7bc8('0x46')](handleEntityNotFound(_0x55a36e,null))[_0x7bc8('0x46')](function(_0x563d08){if(_0x563d08){_0x20a536=_0x563d08;return db[_0x7bc8('0x58')]['destroy']({'where':{'userProfileId':_0x5c436f[_0x7bc8('0x4d')]['id'],'sectionId':_0x5c436f[_0x7bc8('0x38')][_0x7bc8('0x63')]}});}})[_0x7bc8('0x46')](function(){return _0x20a536;})[_0x7bc8('0x46')](respondWithStatusCode(_0x55a36e,null))[_0x7bc8('0x4b')](handleError(_0x55a36e,null));};exports['getSections']=function(_0x13c537,_0x135d9e){var _0x406c35=[];var _0x486021=[];return db[_0x7bc8('0x58')][_0x7bc8('0x49')]({'where':{'userProfileId':_0x13c537[_0x7bc8('0x4d')]['id']},'raw':!![]})[_0x7bc8('0x46')](function(_0x163b4d){_0x406c35=_[_0x7bc8('0x42')](_0x163b4d,function(_0x5049bc){return _0x5049bc[_0x7bc8('0x64')]===0x1||_[_0x7bc8('0x65')]([0x3eb,0x709],_0x5049bc[_0x7bc8('0x5a')]);});if(!_[_0x7bc8('0x66')](_0x406c35)){return _[_0x7bc8('0x2f')](_0x406c35,function(_0x4a90f8){return _0x4a90f8[_0x7bc8('0x5a')];});}else{return;}})[_0x7bc8('0x46')](function(_0x1d1ccc){if(_0x1d1ccc)_0x486021=_0x1d1ccc;if(_[_0x7bc8('0x65')](_0x486021,0x64)){var _0xae6807=_[_0x7bc8('0x4e')](_0x406c35,{'sectionId':0x64});return hasDefaultDashboard(_0xae6807)[_0x7bc8('0x46')](function(_0x128394){return _['map'](_0x406c35,function(_0x5ac909){if(_0x5ac909[_0x7bc8('0x5a')]===0x64){_0x5ac909[_0x7bc8('0x67')]=_0x128394;}return _0x5ac909;});});}else{return;}})[_0x7bc8('0x46')](function(_0x22e3ec){if(_0x22e3ec)_0x406c35=_0x22e3ec;if(_['includes'](_0x486021,0x3eb)){var _0x38dda8=_[_0x7bc8('0x4e')](_0x406c35,{'sectionId':0x3eb});return getCustomDashboards(_0x38dda8)['then'](function(_0x4479cd){return _[_0x7bc8('0x2f')](_0x406c35,function(_0x26fa9d){if(_0x38dda8[_0x7bc8('0x64')]){if(_0x26fa9d[_0x7bc8('0x5a')]===0x3eb){_0x26fa9d['subsections']=_0x4479cd;}}else{if(_0x26fa9d[_0x7bc8('0x5a')]===0x64){_0x26fa9d[_0x7bc8('0x67')]=_0x4479cd;}}return _0x26fa9d;});});}else{return;}})[_0x7bc8('0x46')](function(_0x2b1301){if(_0x2b1301)_0x406c35=_0x2b1301;if(_[_0x7bc8('0x65')](_0x486021,0x709)){var _0x59c420=_[_0x7bc8('0x4e')](_0x406c35,{'sectionId':0x709});return getPlugins(_0x59c420)[_0x7bc8('0x46')](function(_0x1e2066){if(_0x59c420[_0x7bc8('0x64')]){return _[_0x7bc8('0x2f')](_0x406c35,function(_0x13fe5d){if(_0x13fe5d[_0x7bc8('0x5a')]===0x709){_0x13fe5d['subsections']=_0x1e2066;}return _0x13fe5d;});}else{var _0x136e4c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1e2066};var _0x13535a=_['map'](_0x406c35);_0x13535a[_0x7bc8('0x61')](_0x136e4c);return _0x13535a;}});}else{return;}})[_0x7bc8('0x46')](function(_0x132f4f){if(_0x132f4f)_0x406c35=_0x132f4f;return _[_0x7bc8('0x42')](_0x406c35,[_0x7bc8('0x64'),0x1]);})[_0x7bc8('0x46')](respondWithResult(_0x135d9e,null))['catch'](handleError(_0x135d9e,null));};function hasDefaultDashboard(_0x1033d1){var _0x572e42=[0x65];return new BPromise(function(_0x50a5e0,_0x5c1916){try{if(_0x1033d1[_0x7bc8('0x59')]){_0x50a5e0(_0x572e42);}else{return db['UserProfileResource'][_0x7bc8('0x68')]({'where':{'sectionId':_0x1033d1['id']},'raw':!![]})['then'](function(_0xcfbd34){_0xcfbd34?_0x50a5e0(_0x572e42):_0x50a5e0();});}}catch(_0x339257){_0x5c1916(_0x339257);}});}function getCustomDashboards(_0x445ee6){var _0x438dd6=[];return new BPromise(function(_0x5894db,_0x4a4e12){try{if(_0x445ee6[_0x7bc8('0x59')]){return db['Dashboard'][_0x7bc8('0x49')]({'raw':!![]})[_0x7bc8('0x46')](function(_0x39086a){_0x39086a[_0x7bc8('0x69')](function(_0x21701a){_0x438dd6[_0x7bc8('0x61')](_0x21701a['id']+0x1869f);});_0x5894db(_0x438dd6);});}else{return db[_0x7bc8('0x5c')][_0x7bc8('0x49')]({'where':{'sectionId':_0x445ee6['id']},'raw':!![]})[_0x7bc8('0x46')](function(_0x2c1048){_0x2c1048[_0x7bc8('0x69')](function(_0x23e23b){_0x438dd6[_0x7bc8('0x61')](_0x23e23b[_0x7bc8('0x6a')]+0x1869f);});_0x5894db(_0x438dd6);});}}catch(_0x42bb37){_0x4a4e12(_0x42bb37);}});}function getPlugins(_0x3018f9){var _0x24cb41=[];return new BPromise(function(_0x42f254,_0x134ba2){try{if(_0x3018f9[_0x7bc8('0x59')]){return db['Plugin'][_0x7bc8('0x49')]({'raw':!![]})[_0x7bc8('0x46')](function(_0x23b87a){_0x23b87a[_0x7bc8('0x69')](function(_0xfa9422){_0x24cb41[_0x7bc8('0x61')](_0xfa9422['id']+0x15b38);});_0x42f254(_0x24cb41);});}else{return db[_0x7bc8('0x5c')][_0x7bc8('0x49')]({'where':{'sectionId':_0x3018f9['id']},'raw':!![]})['then'](function(_0x44437c){_0x44437c[_0x7bc8('0x69')](function(_0x42eaa7){_0x24cb41['push'](_0x42eaa7[_0x7bc8('0x6a')]+0x15b38);});_0x42f254(_0x24cb41);});}}catch(_0x57866d){_0x134ba2(_0x57866d);}});}exports[_0x7bc8('0x6b')]=function(_0x3e57b8,_0x599224){return db[_0x7bc8('0x30')][_0x7bc8('0x4e')]({'where':{'id':_0x3e57b8[_0x7bc8('0x4d')]['id']}})[_0x7bc8('0x46')](handleEntityNotFound(_0x599224,null))[_0x7bc8('0x46')](function(_0x5ba78c){if(_0x5ba78c){return db['sequelize']['transaction'](function(_0x1dd598){return db[_0x7bc8('0x58')][_0x7bc8('0x49')]({'where':{'userProfileId':_0x3e57b8[_0x7bc8('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x7bc8('0x46')](function(_0x335afe){if(_0x335afe){return db['UserProfileSection'][_0x7bc8('0x5d')]({'where':{'userProfileId':_0x3e57b8[_0x7bc8('0x4d')]['id'],'id':_[_0x7bc8('0x2f')](_0x335afe,function(_0x1bdb7a){return _0x1bdb7a['id'];})},'transaction':_0x1dd598});}})[_0x7bc8('0x46')](function(_0x3d88b1){var _0x37ff6d=_[_0x7bc8('0x2f')](_0x3e57b8[_0x7bc8('0x50')],function(_0x2cf4b5){_0x2cf4b5[_0x7bc8('0x5f')]=_0x3e57b8['params']['id'];return _0x2cf4b5;});return db[_0x7bc8('0x58')][_0x7bc8('0x6c')](_0x37ff6d,{'raw':!![],'transaction':_0x1dd598});})[_0x7bc8('0x46')](function(_0x1ce893){var _0x3fb272=_[_0x7bc8('0x42')](_[_0x7bc8('0x2f')](_0x1ce893,function(_0x51a629){return _0x51a629[_0x7bc8('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x3fb272){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3e57b8[_0x7bc8('0x4d')]['id'],'sectionId':_['map'](_0x3fb272,function(_0x19d027){return _0x19d027[_0x7bc8('0x5a')];})},'attributes':['id',_0x7bc8('0x5a')],'raw':!![]})[_0x7bc8('0x46')](function(_0x3b338a){var _0x2d042f=_[_0x7bc8('0x2f')](_0x3e57b8[_0x7bc8('0x50')],function(_0x7d685b){_0x7d685b[_0x7bc8('0x5f')]=_0x3e57b8[_0x7bc8('0x4d')]['id'];return _0x7d685b;});return db[_0x7bc8('0x5c')][_0x7bc8('0x6c')](_0x2d042f,{'raw':!![],'transaction':_0x1dd598});});}})[_0x7bc8('0x4b')](handleError(_0x599224,null));});}})[_0x7bc8('0x46')](function(_0x532fbc){var _0x509e18=_[_0x7bc8('0x2f')](_0x532fbc,function(_0x3f41cd){return _0x3f41cd[_0x7bc8('0x51')]({'plain':!![]});});})[_0x7bc8('0x46')](respondWithResult(_0x599224,null))[_0x7bc8('0x4b')](handleError(_0x599224,null));};exports[_0x7bc8('0x6d')]=function(_0x954f30,_0x37d0c2,_0x13d49d){return db[_0x7bc8('0x30')][_0x7bc8('0x4e')]({'where':{'id':_0x954f30[_0x7bc8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x37d0c2,null))[_0x7bc8('0x46')](function(_0x4b9dac){if(_0x4b9dac){return _0x4b9dac[_0x7bc8('0x6d')](_0x954f30['query'][_0x7bc8('0x63')]);}})[_0x7bc8('0x46')](respondWithStatusCode(_0x37d0c2,null))[_0x7bc8('0x4b')](handleError(_0x37d0c2,null));};exports[_0x7bc8('0x6e')]=function(_0xdaf6f6,_0x6673b5){var _0x529308={};if(!_0xdaf6f6['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0xdaf6f6[_0x7bc8('0x38')]['hasOwnProperty'](_0x7bc8('0x3d'))){_0x529308[_0x7bc8('0x24')]=qs[_0x7bc8('0x24')](_0xdaf6f6['query'][_0x7bc8('0x24')]);_0x529308[_0x7bc8('0x22')]=qs[_0x7bc8('0x22')](_0xdaf6f6[_0x7bc8('0x38')][_0x7bc8('0x22')]);}return db['UserProfile'][_0x7bc8('0x4e')]({'where':{'id':_0xdaf6f6[_0x7bc8('0x4d')]['id']}})['then'](function(_0x1eba80){if(!_0x1eba80)throw new Error(_0x7bc8('0x6f')+_0xdaf6f6[_0x7bc8('0x4d')]['id']);return db[_0x7bc8('0x30')]['getResources'](_0xdaf6f6);})[_0x7bc8('0x46')](respondWithFilteredResult(_0x6673b5,_0x529308))['catch'](handleError(_0x6673b5,null));};
\ No newline at end of file
index 2bf30da..e71ebc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f44=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6f44,0x1ea));var _0x46f4=function(_0x55b00f,_0x134f07){_0x55b00f=_0x55b00f-0x0;var _0x4cd0ba=_0x6f44[_0x55b00f];return _0x4cd0ba;};'use strict';var EventEmitter=require(_0x46f4('0x0'));var UserProfile=require(_0x46f4('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x46f4('0x2')](0x0);var events={'afterCreate':_0x46f4('0x3'),'afterUpdate':_0x46f4('0x4'),'afterDestroy':_0x46f4('0x5')};function emitEvent(_0x4099a9){return function(_0x1e2554,_0x26f749,_0x200f8b){UserProfileEvents[_0x46f4('0x6')](_0x4099a9+':'+_0x1e2554['id'],_0x1e2554);UserProfileEvents['emit'](_0x4099a9,_0x1e2554);_0x200f8b(null);};}for(var e in events){if(events[_0x46f4('0x7')](e)){var event=events[e];UserProfile[_0x46f4('0x8')](e,emitEvent(event));}}module[_0x46f4('0x9')]=UserProfileEvents;
\ No newline at end of file
+var _0xb931=['remove','emit','hasOwnProperty','hook','exports','UserProfile','update'];(function(_0x442ede,_0x2c3376){var _0x3b7c68=function(_0x4fd896){while(--_0x4fd896){_0x442ede['push'](_0x442ede['shift']());}};_0x3b7c68(++_0x2c3376);}(_0xb931,0x155));var _0x1b93=function(_0x38231c,_0x1a5931){_0x38231c=_0x38231c-0x0;var _0x5be4e8=_0xb931[_0x38231c];return _0x5be4e8;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db'][_0x1b93('0x0')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b93('0x1'),'afterDestroy':_0x1b93('0x2')};function emitEvent(_0x2d11a5){return function(_0x42a943,_0x1c8b77,_0xa36141){UserProfileEvents[_0x1b93('0x3')](_0x2d11a5+':'+_0x42a943['id'],_0x42a943);UserProfileEvents[_0x1b93('0x3')](_0x2d11a5,_0x42a943);_0xa36141(null);};}for(var e in events){if(events[_0x1b93('0x4')](e)){var event=events[e];UserProfile[_0x1b93('0x5')](e,emitEvent(event));}}module[_0x1b93('0x6')]=UserProfileEvents;
\ No newline at end of file
index d469f06..586c35c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd47e=['VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Tag','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','metrics','charAt','slice','QueryTypes','SELECT','select','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','OpenTabs','UserProfile','user_profiles','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','all','union','ignore','autoAssociation','push','rawAttributes','keys','filters','intersection','attributes','fields','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','merge','options','includeAll','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','count','include','Tags','color','ThroughTags','tag','true','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','filter','value','findAll','then','associatedResources','map','field','model','name','catch','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone'];(function(_0x3805a0,_0x501a20){var _0x3bc3c2=function(_0x2c08fb){while(--_0x2c08fb){_0x3805a0['push'](_0x3805a0['shift']());}};_0x3bc3c2(++_0x501a20);}(_0xd47e,0x13c));var _0xed47=function(_0x2b9e93,_0x5851dc){_0x2b9e93=_0x2b9e93-0x0;var _0x5041be=_0xd47e[_0x2b9e93];return _0x5041be;};'use strict';var _=require(_0xed47('0x0'));var attributes=require(_0xed47('0x1'));var qs=require(_0xed47('0x2'));var squel=require(_0xed47('0x3'));module['exports']=function(_0x374d40){var _0x453a50=_0x374d40['models'];function _0x5d353b(_0x1164fd,_0x9fc5ef){return new Promise(function(_0x3bb00b,_0x2876d8){if(!_0x9fc5ef)return _0x3bb00b(null);var _0x94e898=_0x9fc5ef[_0xed47('0x4')]?{[_0x9fc5ef['filter']['field']]:_0x9fc5ef[_0xed47('0x4')][_0xed47('0x5')]}:undefined;return _0x453a50[_0x1164fd][_0xed47('0x6')]({'where':_0x94e898,'raw':!![]})[_0xed47('0x7')](function(_0x2f81ee){_0x9fc5ef[_0xed47('0x8')]=_[_0xed47('0x9')](_0x2f81ee,'id');_0x3bb00b(_0x9fc5ef);})['catch'](function(_0x5c1e32){_0x2876d8(_0x5c1e32);});});}function _0x525cec(_0x5c2b36,_0x1a4cbb){return new Promise(function(_0x5c3e0d,_0x3b59f5){var _0xb954b3=_0x5c2b36[_0xed47('0x4')]?{[_0x5c2b36[_0xed47('0x4')][_0xed47('0xa')]]:_0x5c2b36['filter']['value']}:undefined;return _0x453a50[_0x5c2b36[_0xed47('0xb')]][_0xed47('0x6')]({'where':_0xb954b3,'raw':!![]})[_0xed47('0x7')](function(_0x2c2ec5){_0x1a4cbb[_0xed47('0x8')]=_[_0xed47('0x9')](_0x2c2ec5,function(_0xc788e6){return _0xc788e6[_0xed47('0xc')];});_0x5c3e0d(_0x1a4cbb);})[_0xed47('0xd')](function(_0x54f3ac){_0x3b59f5(_0x54f3ac);});});}function _0x5f1ed6(_0x562db0,_0xeea365,_0x471683){if(!_0xeea365)return Promise['resolve'](null);return new Promise(function(_0x2c37e2,_0x3815f7){return _0x453a50[_0xed47('0xe')][_0xed47('0x6')]({'where':{'sectionId':_0xeea365['id']},'raw':!![]})[_0xed47('0x7')](function(_0x412a25){if(_0x562db0['field']&&_0x562db0['field']!=='id'){_0xeea365[_0xed47('0x8')]=_['map'](_0x412a25,function(_0x559cf7){return _0x559cf7[_0x562db0['field']];});}else{if(_0x471683===_0xed47('0xf')){_0xeea365[_0xed47('0x8')]=_[_0xed47('0x9')](_0x412a25,function(_0x3cc4ba){return{'id':_0x3cc4ba[_0xed47('0x10')],'type':_0x3cc4ba['type']};});}else{_0xeea365[_0xed47('0x8')]=_[_0xed47('0x9')](_0x412a25,function(_0x4bc370){return _0x4bc370[_0xed47('0x10')];});}}_0x2c37e2(_0xeea365);})[_0xed47('0xd')](function(_0x39ccc0){_0x3815f7(_0x39ccc0);});});}function _0x55a154(_0x481354,_0x3b78e0){var _0x173ee9={'parentSections':[]};switch(_0x481354[_0xed47('0x11')]()){case _0xed47('0x12'):_0x173ee9['childModel']='SquareProject';break;case _0xed47('0x13'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x15');break;case'squarerecordings':_0x173ee9[_0xed47('0x14')]=_0xed47('0x16');_0x173ee9[_0xed47('0x17')]=[{'name':_0xed47('0x18'),'field':_0xed47('0xc'),'foreignKey':_0xed47('0x19')}];break;case _0xed47('0x1a'):_0x173ee9['childModel']='JscriptyProject';break;case _0xed47('0x1b'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x1c');_0x173ee9[_0xed47('0x17')]=[{'name':_0xed47('0x1d'),'field':'id','foreignKey':_0xed47('0x1e')}];break;case _0xed47('0x1f'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x20');break;case _0xed47('0x21'):_0x173ee9[_0xed47('0x14')]='CmCompany';break;case _0xed47('0x22'):_0x173ee9['childModel']=_0xed47('0x23');break;case _0xed47('0x24'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x25');break;case _0xed47('0x26'):_0x173ee9[_0xed47('0x14')]='ChatWebsite';break;case _0xed47('0x27'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x28');break;case _0xed47('0x29'):_0x173ee9[_0xed47('0x14')]='FaxAccount';break;case _0xed47('0x2a'):case'internalroutes':case _0xed47('0x2b'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x2c');break;case _0xed47('0x2d'):_0x173ee9[_0xed47('0x14')]='VoiceContext';break;case _0xed47('0x2e'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x2f');break;case'voicerecordings':_0x173ee9[_0xed47('0x14')]=_0xed47('0x30');_0x173ee9['parentSections']=[{'name':_0xed47('0x31'),'field':_0xed47('0xc'),'foreignKey':_0xed47('0x32'),'model':_0xed47('0x33'),'filter':{'field':_0xed47('0x34'),'value':[_0xed47('0x35')]}},{'name':_0xed47('0x36'),'field':'name','foreignKey':_0xed47('0x32'),'model':_0xed47('0x33'),'filter':{'field':_0xed47('0x34'),'value':[_0xed47('0x37')]}},{'name':_0xed47('0x38'),'field':_0xed47('0xc'),'foreignKey':_0xed47('0x39'),'model':_0xed47('0x3a'),'filter':{'field':_0xed47('0x3b'),'value':[_0xed47('0x3c')]}},{'name':_0xed47('0x3d'),'field':_0xed47('0xc'),'foreignKey':_0xed47('0x39'),'model':_0xed47('0x3a'),'filter':{'field':'type','value':[_0xed47('0x3e')]}}];break;case'musiconholds':_0x173ee9[_0xed47('0x14')]=_0xed47('0x3f');break;case _0xed47('0x40'):_0x173ee9[_0xed47('0x14')]='VoiceChanSpy';break;case _0xed47('0x41'):_0x173ee9[_0xed47('0x14')]='VoicePrefix';break;case _0xed47('0x42'):_0x173ee9[_0xed47('0x14')]='Campaign';break;case _0xed47('0x43'):_0x173ee9['childModel']=_0xed47('0x44');break;case'mailaccounts':_0x173ee9[_0xed47('0x14')]=_0xed47('0x45');break;case _0xed47('0x46'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x47');break;case _0xed47('0x48'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x49');break;case _0xed47('0x4a'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x4b');break;case _0xed47('0x4c'):_0x173ee9[_0xed47('0x14')]='SmsQueue';break;case _0xed47('0x4d'):_0x173ee9['childModel']=_0xed47('0x4e');break;case'whatsappqueues':_0x173ee9['childModel']='WhatsappQueue';break;case _0xed47('0x4f'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x50');break;case _0xed47('0x51'):_0x173ee9[_0xed47('0x14')]='Team';break;case _0xed47('0x52'):case _0xed47('0x53'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x3a');if(_0x3b78e0){_0x173ee9[_0xed47('0x17')]=[{'name':_0xed47('0x38')},{'name':_0xed47('0x3d')}];}break;case _0xed47('0x54'):case'agents':case'telephones':_0x173ee9['childModel']=_0xed47('0x33');if(_0x3b78e0){_0x173ee9[_0xed47('0x17')]=[{'name':'Users','filter':{'field':'role','value':[_0xed47('0x55'),_0xed47('0x56')]},'ignore':!![]},{'name':_0xed47('0x31')},{'name':_0xed47('0x36')}];}break;case _0xed47('0x57'):_0x173ee9['childModel']=_0xed47('0x58');break;case _0xed47('0x59'):_0x173ee9['childModel']='SalesforceAccount';break;case _0xed47('0x5a'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x5b');break;case'sugarcrmaccounts':_0x173ee9['childModel']=_0xed47('0x5c');break;case _0xed47('0x5d'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x5e');break;case _0xed47('0x5f'):_0x173ee9[_0xed47('0x14')]='ZohoAccount';break;case _0xed47('0x60'):_0x173ee9['childModel']=_0xed47('0x33');break;case _0xed47('0x61'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x62');break;case _0xed47('0x63'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x64');break;case _0xed47('0x65'):_0x173ee9['childModel']=_0xed47('0x66');break;case _0xed47('0x67'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x68');break;case _0xed47('0x69'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x6a');break;case _0xed47('0x6b'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x6c');break;case _0xed47('0x6d'):_0x173ee9[_0xed47('0x14')]='Sound';break;case'tags':_0x173ee9[_0xed47('0x14')]=_0xed47('0x6e');break;case _0xed47('0x6f'):_0x173ee9['childModel']=_0xed47('0x70');break;case _0xed47('0x71'):_0x173ee9['childModel']='Trigger';break;case _0xed47('0x72'):_0x173ee9['childModel']=_0xed47('0x73');break;case _0xed47('0x74'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x75');break;case _0xed47('0x76'):_0x173ee9[_0xed47('0x14')]=_0xed47('0x77');break;case'extractedreports':_0x173ee9[_0xed47('0x14')]=_0xed47('0xf');_0x173ee9[_0xed47('0x17')]=[{'name':_0xed47('0x78'),'field':'id','foreignKey':'reportId'}];break;case _0xed47('0x79'):_0x173ee9[_0xed47('0x14')]='AnalyticMetric';break;}return _0x173ee9;}function _0x289471(_0xe868c8,_0x5e12bb){var _0x231ea6=_0xe868c8[_0xed47('0x7a')](0x0)['toUpperCase']()+_0xe868c8[_0xed47('0x7b')](0x1);var _0x38dfdb={'type':_0x453a50['Sequelize'][_0xed47('0x7c')][_0xed47('0x7d')],'raw':!![]};return new Promise(function(_0x52a7bd,_0x414c84){var _0x2673b3=squel[_0xed47('0x7e')]()[_0xed47('0xa')]('ui.'+_0x231ea6+_0xed47('0x7f'),'id')[_0xed47('0xa')](_0xed47('0x80'))['from'](_0xed47('0x81')+_0xe868c8+_0xed47('0x82'),'ui')[_0xed47('0x83')](_0xed47('0x84'),_0x5e12bb['id']);return _0x453a50['sequelize']['query'](_0x2673b3['toString'](),_0x38dfdb)[_0xed47('0x7')](function(_0xfa7d25){_0x5e12bb[_0x231ea6+_0xed47('0x85')]=_0xfa7d25;_0x52a7bd(_0xfa7d25);})[_0xed47('0xd')](function(_0x2a06b5){_0x414c84(_0x2a06b5);});});}return _0x374d40['define'](_0xed47('0x86'),attributes,{'tableName':_0xed47('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x375303){var _0x4ccb92={'raw':_0x375303[_0xed47('0x88')]['raw'],'where':{}};var _0x4230ed={};var _0x95691a={'count':0x0,'rows':[]};var _0x481bdb=_0x375303['query'][_0xed47('0x89')];var _0x11953b=_0x375303[_0xed47('0x88')][_0xed47('0x8a')]||![];var _0x249f98=_0x55a154(_0x481bdb,_0x11953b);if(!_0x249f98[_0xed47('0x14')])throw new Error(_0xed47('0x8b')+_0x481bdb+'\x27');var _0x377099=[{'name':_0x481bdb}];if(!_[_0xed47('0x8c')](_0x249f98['parentSections']))_0x377099=_0x249f98['parentSections'];var _0x1ac7fc=[];for(var _0xc54b58=0x0;_0xc54b58<_0x377099[_0xed47('0x8d')];_0xc54b58++){_0x1ac7fc['push'](_0x453a50[_0xed47('0x8e')][_0xed47('0x8f')]({'where':{'userProfileId':_0x375303['params']['id'],'name':_0x377099[_0xc54b58][_0xed47('0xc')]},'raw':!![]}));}return Promise[_0xed47('0x90')](_0x1ac7fc)[_0xed47('0x7')](function(_0x52c8b2){var _0x2771aa=_[_0xed47('0x4')](_0x52c8b2,function(_0x50a89f){return _0x50a89f?_0x50a89f:undefined;});var _0x2c8a1f=_['filter'](_0x377099,['ignore',!![]]);var _0x43f798=_[_0xed47('0x8c')](_0x2771aa)&&_[_0xed47('0x8c')](_0x2c8a1f)?null:_[_0xed47('0x91')](_0x2c8a1f,_0x2771aa);if(!_0x43f798)return null;var _0x413f3d=[];for(var _0x7f6bce=0x0;_0x7f6bce<_0x43f798[_0xed47('0x8d')];_0x7f6bce++){var _0xfd7284=_[_0xed47('0x8f')](_0x377099,function(_0x37632d){return _0x43f798[_0x7f6bce]?_0x37632d['name']===_0x43f798[_0x7f6bce][_0xed47('0xc')]:null;});if(_0xfd7284){if(_0x43f798[_0x7f6bce][_0xed47('0x92')]){_0x413f3d['push'](_0x5d353b(_0x249f98[_0xed47('0x14')],_0x43f798[_0x7f6bce]));}else{if(!_0x43f798[_0x7f6bce][_0xed47('0x93')]){_0x413f3d[_0xed47('0x94')](_0x5f1ed6(_0xfd7284,_0x43f798[_0x7f6bce],_0x249f98[_0xed47('0x14')]));}else{if(_0xfd7284[_0xed47('0xb')]){_0x413f3d[_0xed47('0x94')](_0x525cec(_0xfd7284,_0x43f798[_0x7f6bce]));}}}}}return Promise['all'](_0x413f3d);})[_0xed47('0x7')](function(_0x47d887){var _0x532248=_0x47d887;var _0x5684de=null;if(_0x532248){_0x5684de=_0x532248[_0xed47('0x8d')]===0x1?_0x532248[0x0]:null;}if(!_0x5684de&&!_0x532248)return _0x95691a;var _0x6673d5=_0x453a50[_0x249f98[_0xed47('0x14')]][_0xed47('0x95')];_0x4230ed[_0xed47('0xb')]=_[_0xed47('0x96')](_0x6673d5);_0x4230ed[_0xed47('0x88')]=_[_0xed47('0x96')](_0x375303[_0xed47('0x88')]);_0x4230ed[_0xed47('0x97')]=_[_0xed47('0x98')](_0x4230ed[_0xed47('0xb')],_0x4230ed[_0xed47('0x88')]);_0x4ccb92[_0xed47('0x99')]=_[_0xed47('0x98')](_0x4230ed[_0xed47('0xb')],qs[_0xed47('0x9a')](_0x375303[_0xed47('0x88')]['fields']));_0x4ccb92['attributes']=_0x4ccb92[_0xed47('0x99')]['length']?_0x4ccb92[_0xed47('0x99')]:_0x4230ed['model'];if(!_0x375303[_0xed47('0x88')]['hasOwnProperty']('nolimit')){_0x4ccb92[_0xed47('0x9b')]=qs[_0xed47('0x9b')](_0x375303[_0xed47('0x88')][_0xed47('0x9b')]);_0x4ccb92[_0xed47('0x9c')]=qs[_0xed47('0x9c')](_0x375303[_0xed47('0x88')][_0xed47('0x9c')]);}_0x4ccb92[_0xed47('0x9d')]=qs[_0xed47('0x9e')](_0x375303[_0xed47('0x88')][_0xed47('0x9e')]);_0x4ccb92[_0xed47('0x83')]=qs['filters'](_[_0xed47('0x9f')](_0x375303[_0xed47('0x88')],_0x4230ed['filters']));if(_0x375303[_0xed47('0x88')]['filter']){_0x4ccb92[_0xed47('0x83')]=_['merge'](_0x4ccb92[_0xed47('0x83')],{'$or':_[_0xed47('0x9')](_0x6673d5,function(_0x18d23e){if(_0x18d23e[_0xed47('0x3b')][_0xed47('0xa0')]!==_0xed47('0xa1')){var _0x4bcad7={};_0x4bcad7[_0x18d23e[_0xed47('0xa')]]={'$like':'%'+_0x375303[_0xed47('0x88')][_0xed47('0x4')]+'%'};return _0x4bcad7;}})});}var _0x27cb68=[];var _0x44195d=null;var _0x369fad={};if(_0x5684de){_0x44195d=_[_0xed47('0x8f')](_0x377099,[_0xed47('0xc'),_0x5684de[_0xed47('0xc')]]);if(_0x44195d[_0xed47('0xa')]){_0x369fad={};if(_0x249f98[_0xed47('0x14')]==='AnalyticExtractedReport'){_0x369fad[_0x44195d[_0xed47('0xa2')]]=_[_0xed47('0x9')](_0x5684de[_0xed47('0x8')],'id');}else{_0x369fad[_0x44195d[_0xed47('0xa2')]]=_0x5684de['associatedResources'];}_0x27cb68[_0xed47('0x94')](_0x369fad);}else{_0x4ccb92[_0xed47('0x83')]['id']=_0x5684de[_0xed47('0x8')];}}else{for(var _0x254396=0x0;_0x254396<_0x532248[_0xed47('0x8d')];_0x254396++){_0x44195d=_['find'](_0x377099,[_0xed47('0xc'),_0x532248[_0x254396]['name']]);if(_0x44195d[_0xed47('0xa')]){_0x369fad={};_0x369fad[_0x44195d[_0xed47('0xa2')]]=_0x532248[_0x254396][_0xed47('0x8')];_0x27cb68[_0xed47('0x94')](_0x369fad);}else{if(!_0x4ccb92[_0xed47('0x83')]['id'])_0x4ccb92['where']['id']=[];_0x532248[_0x254396][_0xed47('0x8')]['forEach'](function(_0x3924ac){_0x4ccb92[_0xed47('0x83')]['id']['push'](_0x3924ac);});}}}if(!_[_0xed47('0x8c')](_0x27cb68)){_0x4ccb92[_0xed47('0x83')]=_[_0xed47('0xa3')](_0x4ccb92['where'],{'$and':{'$or':_0x27cb68}});}_0x4ccb92=_[_0xed47('0xa3')]({},_0x4ccb92,_0x375303[_0xed47('0xa4')]);if(_0x5684de&&!_0x5684de['autoAssociation']&&_0x249f98[_0xed47('0x14')]===_0xed47('0xf')){if(_0x375303[_0xed47('0x88')][_0xed47('0xa5')]){_0x4ccb92['include']=[{'all':!![]}];}return _0x453a50[_0x249f98[_0xed47('0x14')]][_0xed47('0x6')](_0x4ccb92)[_0xed47('0x7')](function(_0x44dcec){var _0x4919e9=[];_0x44dcec['forEach'](function(_0x16c9eb){var _0x747e41;switch(_0x16c9eb[_0xed47('0xa6')]){case _0xed47('0xa7'):_0x747e41=_[_0xed47('0x8f')](_0x5684de[_0xed47('0x8')],function(_0x3b1f6b){return _0x3b1f6b['id']===_0x16c9eb[_0xed47('0xa8')]&&_0x3b1f6b[_0xed47('0x3b')]===_0xed47('0xa9');});break;case _0xed47('0xaa'):_0x747e41=_[_0xed47('0x8f')](_0x5684de['associatedResources'],function(_0x5a2b74){return _0x5a2b74['id']===_0x16c9eb['reportId']&&_0x5a2b74[_0xed47('0x3b')]===_0xed47('0xab');});break;}if(_0x747e41)_0x4919e9[_0xed47('0x94')](_0x16c9eb);});_0x95691a['count']=_0x4919e9['length'];_0x95691a[_0xed47('0xac')]=_0x4919e9;return _0x95691a;});}else{return _0x453a50[_0x249f98[_0xed47('0x14')]]['count']({'where':_0x4ccb92[_0xed47('0x83')]})[_0xed47('0x7')](function(_0x3cb5db){_0x95691a[_0xed47('0xad')]=_0x3cb5db;if(_0x375303['query'][_0xed47('0xa5')]){if(_0x249f98['childModel']==='CmContact'){_0x4ccb92[_0xed47('0xae')]=[{'model':_0x453a50[_0xed47('0x6e')],'as':_0xed47('0xaf'),'attributes':['id',_0xed47('0xc'),_0xed47('0xb0')],'required':_0x375303['query']['tag']?!![]:![]},{'model':_0x453a50[_0xed47('0x6e')],'as':_0xed47('0xb1'),'attributes':['id',_0xed47('0xc'),_0xed47('0xb0')],'through':_0x375303['query'][_0xed47('0xb2')]?{'attributes':[],'where':{'TagId':_0x375303[_0xed47('0x88')][_0xed47('0xb2')]||undefined}}:{},'required':_0x375303[_0xed47('0x88')][_0xed47('0xb2')]?!![]:![]}];}else{_0x4ccb92[_0xed47('0xae')]=[{'all':!![]}];}}return _0x453a50[_0x249f98['childModel']][_0xed47('0x6')](_0x4ccb92);})[_0xed47('0x7')](function(_0x5719b0){_0x95691a[_0xed47('0xac')]=_0x5719b0;if(_0x481bdb==='Agents'&&_0x375303[_0xed47('0x88')]['openTabs']===_0xed47('0xb3')){var _0x45ea61=[];for(var _0x1a0885=0x0;_0x1a0885<_0x95691a[_0xed47('0xac')][_0xed47('0x8d')];_0x1a0885++){_0x45ea61[_0xed47('0x94')](_0x289471(_0xed47('0xb4'),_0x95691a[_0xed47('0xac')][_0x1a0885][_0xed47('0xb5')]));_0x45ea61[_0xed47('0x94')](_0x289471(_0xed47('0xb6'),_0x95691a['rows'][_0x1a0885]['dataValues']));_0x45ea61['push'](_0x289471(_0xed47('0xb7'),_0x95691a['rows'][_0x1a0885][_0xed47('0xb5')]));_0x45ea61['push'](_0x289471('mail',_0x95691a[_0xed47('0xac')][_0x1a0885][_0xed47('0xb5')]));_0x45ea61[_0xed47('0x94')](_0x289471(_0xed47('0xb8'),_0x95691a['rows'][_0x1a0885][_0xed47('0xb5')]));_0x45ea61[_0xed47('0x94')](_0x289471(_0xed47('0xb9'),_0x95691a[_0xed47('0xac')][_0x1a0885][_0xed47('0xb5')]));}return Promise['all'](_0x45ea61)['then'](function(){return _0x95691a;});}return _0x95691a;});}});}}});};
\ No newline at end of file
+var _0x40fd=['includeAll','include','forEach','reportType','default','DefaultReports','CustomReports','count','ids','CmContact','Tags','color','ThroughTags','tag','rows','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','exports','models','field','value','findAll','then','associatedResources','catch','filter','model','map','resolve','UserProfileResource','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projects','JscriptyProject','contacts','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','Agents','membername','User','telephone','VoiceQueues','queue','type','inbound','VoiceQueue','musiconholds','chanspies','voiceprefixes','ivrcampaigns','mailqueues','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','users','agents','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','pauses','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','QueryTypes','select','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','find','params','all','union','ignore','push','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','where','merge','foreignKey','autoAssociation'];(function(_0x38b3cb,_0x4ad7b3){var _0x5a9a84=function(_0x237634){while(--_0x237634){_0x38b3cb['push'](_0x38b3cb['shift']());}};_0x5a9a84(++_0x4ad7b3);}(_0x40fd,0x187));var _0xd40f=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x40fd[_0x4067ac];return _0x53d74d;};'use strict';var _=require(_0xd40f('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xd40f('0x1'));var squel=require('squel');module[_0xd40f('0x2')]=function(_0x2eb913){var _0x418276=_0x2eb913[_0xd40f('0x3')];function _0x15a822(_0x35474d,_0x58b4e8){return new Promise(function(_0x4379ee,_0xd4aa0d){if(!_0x58b4e8)return _0x4379ee(null);var _0x1c6e24=_0x58b4e8['filter']?{[_0x58b4e8['filter'][_0xd40f('0x4')]]:_0x58b4e8['filter'][_0xd40f('0x5')]}:undefined;return _0x418276[_0x35474d][_0xd40f('0x6')]({'where':_0x1c6e24,'raw':!![]})[_0xd40f('0x7')](function(_0x4b4f54){_0x58b4e8[_0xd40f('0x8')]=_['map'](_0x4b4f54,'id');_0x4379ee(_0x58b4e8);})[_0xd40f('0x9')](function(_0x21b251){_0xd4aa0d(_0x21b251);});});}function _0x51bc7c(_0x47be89,_0x2272d2){return new Promise(function(_0x13b29d,_0x1cdb90){var _0x29f13e=_0x47be89[_0xd40f('0xa')]?{[_0x47be89['filter'][_0xd40f('0x4')]]:_0x47be89[_0xd40f('0xa')]['value']}:undefined;return _0x418276[_0x47be89[_0xd40f('0xb')]][_0xd40f('0x6')]({'where':_0x29f13e,'raw':!![]})[_0xd40f('0x7')](function(_0x41cb4d){_0x2272d2[_0xd40f('0x8')]=_[_0xd40f('0xc')](_0x41cb4d,function(_0xd332ba){return _0xd332ba['name'];});_0x13b29d(_0x2272d2);})[_0xd40f('0x9')](function(_0x35ca79){_0x1cdb90(_0x35ca79);});});}function _0x2d3aef(_0x27949f,_0x23a22b,_0x5b9be7){if(!_0x23a22b)return Promise[_0xd40f('0xd')](null);return new Promise(function(_0x3e8646,_0x27640a){return _0x418276[_0xd40f('0xe')][_0xd40f('0x6')]({'where':{'sectionId':_0x23a22b['id']},'raw':!![]})[_0xd40f('0x7')](function(_0x57f865){if(_0x27949f[_0xd40f('0x4')]&&_0x27949f[_0xd40f('0x4')]!=='id'){_0x23a22b[_0xd40f('0x8')]=_['map'](_0x57f865,function(_0xe356d5){return _0xe356d5[_0x27949f[_0xd40f('0x4')]];});}else{if(_0x5b9be7==='AnalyticExtractedReport'){_0x23a22b[_0xd40f('0x8')]=_[_0xd40f('0xc')](_0x57f865,function(_0x5b2db5){return{'id':_0x5b2db5[_0xd40f('0xf')],'type':_0x5b2db5['type']};});}else{_0x23a22b['associatedResources']=_[_0xd40f('0xc')](_0x57f865,function(_0x14b907){return _0x14b907[_0xd40f('0xf')];});}}_0x3e8646(_0x23a22b);})[_0xd40f('0x9')](function(_0x2b277d){_0x27640a(_0x2b277d);});});}function _0x3907ce(_0xcdd492,_0x5d1faf){var _0x279f57={'parentSections':[]};switch(_0xcdd492[_0xd40f('0x10')]()){case _0xd40f('0x11'):_0x279f57['childModel']=_0xd40f('0x12');break;case _0xd40f('0x13'):_0x279f57[_0xd40f('0x14')]='SquareOdbc';break;case _0xd40f('0x15'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x16');_0x279f57[_0xd40f('0x17')]=[{'name':_0xd40f('0x18'),'field':_0xd40f('0x19'),'foreignKey':'projectName'}];break;case _0xd40f('0x1a'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x1b');break;case _0xd40f('0x1c'):_0x279f57[_0xd40f('0x14')]='CmContact';_0x279f57[_0xd40f('0x17')]=[{'name':'Lists','field':'id','foreignKey':_0xd40f('0x1d')}];break;case'lists':_0x279f57[_0xd40f('0x14')]=_0xd40f('0x1e');break;case _0xd40f('0x1f'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x20');break;case _0xd40f('0x21'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x22');break;case _0xd40f('0x23'):_0x279f57['childModel']=_0xd40f('0x24');break;case _0xd40f('0x25'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x26');break;case _0xd40f('0x27'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x28');break;case _0xd40f('0x29'):_0x279f57['childModel']=_0xd40f('0x2a');break;case _0xd40f('0x2b'):case'internalroutes':case _0xd40f('0x2c'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x2d');break;case _0xd40f('0x2e'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x2f');break;case _0xd40f('0x30'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x31');break;case'voicerecordings':_0x279f57['childModel']='VoiceRecording';_0x279f57[_0xd40f('0x17')]=[{'name':_0xd40f('0x32'),'field':'name','foreignKey':_0xd40f('0x33'),'model':_0xd40f('0x34'),'filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':_0xd40f('0x19'),'foreignKey':_0xd40f('0x33'),'model':'User','filter':{'field':'role','value':[_0xd40f('0x35')]}},{'name':_0xd40f('0x36'),'field':'name','foreignKey':_0xd40f('0x37'),'model':'VoiceQueue','filter':{'field':_0xd40f('0x38'),'value':[_0xd40f('0x39')]}},{'name':'QueueCampaigns','field':_0xd40f('0x19'),'foreignKey':_0xd40f('0x37'),'model':_0xd40f('0x3a'),'filter':{'field':_0xd40f('0x38'),'value':['outbound']}}];break;case _0xd40f('0x3b'):_0x279f57[_0xd40f('0x14')]='VoiceMusicOnHold';break;case _0xd40f('0x3c'):_0x279f57[_0xd40f('0x14')]='VoiceChanSpy';break;case _0xd40f('0x3d'):_0x279f57[_0xd40f('0x14')]='VoicePrefix';break;case _0xd40f('0x3e'):_0x279f57[_0xd40f('0x14')]='Campaign';break;case _0xd40f('0x3f'):_0x279f57[_0xd40f('0x14')]='MailQueue';break;case _0xd40f('0x40'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x41');break;case'mailsubstatuses':_0x279f57['childModel']=_0xd40f('0x42');break;case _0xd40f('0x43'):_0x279f57['childModel']='OpenchannelQueue';break;case _0xd40f('0x44'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x45');break;case _0xd40f('0x46'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x47');break;case _0xd40f('0x48'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x49');break;case _0xd40f('0x4a'):_0x279f57[_0xd40f('0x14')]='WhatsappQueue';break;case _0xd40f('0x4b'):_0x279f57['childModel']=_0xd40f('0x4c');break;case _0xd40f('0x4d'):_0x279f57[_0xd40f('0x14')]='Team';break;case'voicequeues':case'queuecampaigns':_0x279f57['childModel']=_0xd40f('0x3a');if(_0x5d1faf){_0x279f57[_0xd40f('0x17')]=[{'name':_0xd40f('0x36')},{'name':'QueueCampaigns'}];}break;case _0xd40f('0x4e'):case _0xd40f('0x4f'):case'telephones':_0x279f57[_0xd40f('0x14')]=_0xd40f('0x34');if(_0x5d1faf){_0x279f57['parentSections']=[{'name':_0xd40f('0x50'),'filter':{'field':'role','value':[_0xd40f('0x51'),'user']},'ignore':!![]},{'name':_0xd40f('0x32')},{'name':'Telephones'}];}break;case _0xd40f('0x52'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x53');break;case _0xd40f('0x54'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x55');break;case _0xd40f('0x56'):_0x279f57[_0xd40f('0x14')]='FreshdeskAccount';break;case _0xd40f('0x57'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x58');break;case _0xd40f('0x59'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x5a');break;case _0xd40f('0x5b'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x5c');break;case _0xd40f('0x5d'):_0x279f57['childModel']=_0xd40f('0x34');break;case _0xd40f('0x5e'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x5f');break;case _0xd40f('0x60'):_0x279f57['childModel']=_0xd40f('0x61');break;case _0xd40f('0x62'):_0x279f57[_0xd40f('0x14')]='Dashboard';break;case _0xd40f('0x63'):_0x279f57[_0xd40f('0x14')]='Interval';break;case _0xd40f('0x64'):_0x279f57['childModel']=_0xd40f('0x65');break;case _0xd40f('0x66'):_0x279f57['childModel']=_0xd40f('0x67');break;case _0xd40f('0x68'):_0x279f57[_0xd40f('0x14')]='Sound';break;case _0xd40f('0x69'):_0x279f57['childModel']=_0xd40f('0x6a');break;case _0xd40f('0x6b'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x6c');break;case _0xd40f('0x6d'):_0x279f57['childModel']=_0xd40f('0x6e');break;case _0xd40f('0x6f'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x70');break;case _0xd40f('0x71'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x72');break;case _0xd40f('0x73'):_0x279f57[_0xd40f('0x14')]='Plugin';break;case _0xd40f('0x74'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x75');_0x279f57[_0xd40f('0x17')]=[{'name':_0xd40f('0x76'),'field':'id','foreignKey':_0xd40f('0x77')}];break;case _0xd40f('0x78'):_0x279f57[_0xd40f('0x14')]=_0xd40f('0x79');break;}return _0x279f57;}function _0x1d8288(_0x296355,_0x28978e){var _0x300627=_0x296355[_0xd40f('0x7a')](0x0)['toUpperCase']()+_0x296355['slice'](0x1);var _0x30304c={'type':_0x418276['Sequelize'][_0xd40f('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x3ff00c,_0x54962a){var _0x3a6f35=squel[_0xd40f('0x7c')]()[_0xd40f('0x4')](_0xd40f('0x7d')+_0x300627+_0xd40f('0x7e'),'id')[_0xd40f('0x4')](_0xd40f('0x7f'))['from']('user_has_'+_0x296355+_0xd40f('0x80'),'ui')['where'](_0xd40f('0x81'),_0x28978e['id']);return _0x418276[_0xd40f('0x82')][_0xd40f('0x83')](_0x3a6f35[_0xd40f('0x84')](),_0x30304c)[_0xd40f('0x7')](function(_0x1a2549){_0x28978e[_0x300627+_0xd40f('0x85')]=_0x1a2549;_0x3ff00c(_0x1a2549);})[_0xd40f('0x9')](function(_0x3005c0){_0x54962a(_0x3005c0);});});}return _0x2eb913[_0xd40f('0x86')](_0xd40f('0x87'),attributes,{'tableName':_0xd40f('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2c93db){var _0x2a4681={'raw':_0x2c93db[_0xd40f('0x83')][_0xd40f('0x89')],'where':{}};var _0x285f30={};var _0x5bc895={'count':0x0,'rows':[]};var _0x2af603=_0x2c93db[_0xd40f('0x83')][_0xd40f('0x8a')];var _0x14fb15=_0x2c93db[_0xd40f('0x83')][_0xd40f('0x8b')]||![];var _0x5248c1=_0x3907ce(_0x2af603,_0x14fb15);if(!_0x5248c1[_0xd40f('0x14')])throw new Error(_0xd40f('0x8c')+_0x2af603+'\x27');var _0x36c577=[{'name':_0x2af603}];if(!_[_0xd40f('0x8d')](_0x5248c1[_0xd40f('0x17')]))_0x36c577=_0x5248c1['parentSections'];var _0x426f9a=[];for(var _0x54b34a=0x0;_0x54b34a<_0x36c577[_0xd40f('0x8e')];_0x54b34a++){_0x426f9a['push'](_0x418276['UserProfileSection'][_0xd40f('0x8f')]({'where':{'userProfileId':_0x2c93db[_0xd40f('0x90')]['id'],'name':_0x36c577[_0x54b34a][_0xd40f('0x19')]},'raw':!![]}));}return Promise[_0xd40f('0x91')](_0x426f9a)[_0xd40f('0x7')](function(_0xe14323){var _0x4fa557=_[_0xd40f('0xa')](_0xe14323,function(_0x363747){return _0x363747?_0x363747:undefined;});var _0x5a6ff1=_['filter'](_0x36c577,['ignore',!![]]);var _0x4ec22d=_[_0xd40f('0x8d')](_0x4fa557)&&_[_0xd40f('0x8d')](_0x5a6ff1)?null:_[_0xd40f('0x92')](_0x5a6ff1,_0x4fa557);if(!_0x4ec22d)return null;var _0x438dab=[];for(var _0x1ae3e6=0x0;_0x1ae3e6<_0x4ec22d[_0xd40f('0x8e')];_0x1ae3e6++){var _0x44e742=_['find'](_0x36c577,function(_0x30f01c){return _0x4ec22d[_0x1ae3e6]?_0x30f01c[_0xd40f('0x19')]===_0x4ec22d[_0x1ae3e6][_0xd40f('0x19')]:null;});if(_0x44e742){if(_0x4ec22d[_0x1ae3e6][_0xd40f('0x93')]){_0x438dab[_0xd40f('0x94')](_0x15a822(_0x5248c1[_0xd40f('0x14')],_0x4ec22d[_0x1ae3e6]));}else{if(!_0x4ec22d[_0x1ae3e6]['autoAssociation']){_0x438dab[_0xd40f('0x94')](_0x2d3aef(_0x44e742,_0x4ec22d[_0x1ae3e6],_0x5248c1[_0xd40f('0x14')]));}else{if(_0x44e742['model']){_0x438dab[_0xd40f('0x94')](_0x51bc7c(_0x44e742,_0x4ec22d[_0x1ae3e6]));}}}}}return Promise[_0xd40f('0x91')](_0x438dab);})['then'](function(_0x23a359){var _0x422d55=_0x23a359;var _0x156369=null;if(_0x422d55){_0x156369=_0x422d55[_0xd40f('0x8e')]===0x1?_0x422d55[0x0]:null;}if(!_0x156369&&!_0x422d55)return _0x5bc895;var _0x262bcc=_0x418276[_0x5248c1['childModel']][_0xd40f('0x95')];_0x285f30['model']=_[_0xd40f('0x96')](_0x262bcc);_0x285f30[_0xd40f('0x83')]=_['keys'](_0x2c93db[_0xd40f('0x83')]);_0x285f30[_0xd40f('0x97')]=_[_0xd40f('0x98')](_0x285f30[_0xd40f('0xb')],_0x285f30[_0xd40f('0x83')]);_0x2a4681['attributes']=_[_0xd40f('0x98')](_0x285f30['model'],qs[_0xd40f('0x99')](_0x2c93db[_0xd40f('0x83')][_0xd40f('0x99')]));_0x2a4681[_0xd40f('0x9a')]=_0x2a4681[_0xd40f('0x9a')]['length']?_0x2a4681['attributes']:_0x285f30['model'];if(!_0x2c93db[_0xd40f('0x83')][_0xd40f('0x9b')]('nolimit')){_0x2a4681[_0xd40f('0x9c')]=qs[_0xd40f('0x9c')](_0x2c93db[_0xd40f('0x83')]['limit']);_0x2a4681[_0xd40f('0x9d')]=qs[_0xd40f('0x9d')](_0x2c93db[_0xd40f('0x83')][_0xd40f('0x9d')]);}_0x2a4681[_0xd40f('0x9e')]=qs[_0xd40f('0x9f')](_0x2c93db[_0xd40f('0x83')][_0xd40f('0x9f')]);_0x2a4681[_0xd40f('0xa0')]=qs['filters'](_['pick'](_0x2c93db[_0xd40f('0x83')],_0x285f30[_0xd40f('0x97')]));if(_0x2c93db[_0xd40f('0x83')][_0xd40f('0xa')]){_0x2a4681['where']=_[_0xd40f('0xa1')](_0x2a4681[_0xd40f('0xa0')],{'$or':_[_0xd40f('0xc')](_0x262bcc,function(_0x2f7b9c){if(_0x2f7b9c[_0xd40f('0x38')]['key']!=='VIRTUAL'){var _0x208a52={};_0x208a52[_0x2f7b9c[_0xd40f('0x4')]]={'$like':'%'+_0x2c93db[_0xd40f('0x83')][_0xd40f('0xa')]+'%'};return _0x208a52;}})});}var _0x43aba=[];var _0x281e3f=null;var _0xf97bb5={};if(_0x156369){_0x281e3f=_[_0xd40f('0x8f')](_0x36c577,[_0xd40f('0x19'),_0x156369['name']]);if(_0x281e3f[_0xd40f('0x4')]){_0xf97bb5={};if(_0x5248c1[_0xd40f('0x14')]===_0xd40f('0x75')){_0xf97bb5[_0x281e3f['foreignKey']]=_[_0xd40f('0xc')](_0x156369[_0xd40f('0x8')],'id');}else{_0xf97bb5[_0x281e3f[_0xd40f('0xa2')]]=_0x156369[_0xd40f('0x8')];}_0x43aba['push'](_0xf97bb5);}else{_0x2a4681[_0xd40f('0xa0')]['id']=_0x156369['associatedResources'];}}else{for(var _0x1ea583=0x0;_0x1ea583<_0x422d55[_0xd40f('0x8e')];_0x1ea583++){_0x281e3f=_[_0xd40f('0x8f')](_0x36c577,['name',_0x422d55[_0x1ea583][_0xd40f('0x19')]]);if(_0x281e3f[_0xd40f('0x4')]){_0xf97bb5={};_0xf97bb5[_0x281e3f[_0xd40f('0xa2')]]=_0x422d55[_0x1ea583][_0xd40f('0x8')];_0x43aba['push'](_0xf97bb5);}else{if(!_0x2a4681[_0xd40f('0xa0')]['id'])_0x2a4681[_0xd40f('0xa0')]['id']=[];_0x422d55[_0x1ea583][_0xd40f('0x8')]['forEach'](function(_0x4765d6){_0x2a4681[_0xd40f('0xa0')]['id']['push'](_0x4765d6);});}}}if(!_[_0xd40f('0x8d')](_0x43aba)){_0x2a4681[_0xd40f('0xa0')]=_[_0xd40f('0xa1')](_0x2a4681['where'],{'$and':{'$or':_0x43aba}});}_0x2a4681=_[_0xd40f('0xa1')]({},_0x2a4681,_0x2c93db['options']);if(_0x156369&&!_0x156369[_0xd40f('0xa3')]&&_0x5248c1[_0xd40f('0x14')]==='AnalyticExtractedReport'){if(_0x2c93db[_0xd40f('0x83')][_0xd40f('0xa4')]){_0x2a4681[_0xd40f('0xa5')]=[{'all':!![]}];}return _0x418276[_0x5248c1[_0xd40f('0x14')]][_0xd40f('0x6')](_0x2a4681)[_0xd40f('0x7')](function(_0x506cfd){var _0x553eda=[];_0x506cfd[_0xd40f('0xa6')](function(_0x22966a){var _0x5ac1f4;switch(_0x22966a[_0xd40f('0xa7')]){case _0xd40f('0xa8'):_0x5ac1f4=_[_0xd40f('0x8f')](_0x156369[_0xd40f('0x8')],function(_0x17f63a){return _0x17f63a['id']===_0x22966a[_0xd40f('0x77')]&&_0x17f63a[_0xd40f('0x38')]===_0xd40f('0xa9');});break;case'custom':_0x5ac1f4=_[_0xd40f('0x8f')](_0x156369[_0xd40f('0x8')],function(_0x23d5c6){return _0x23d5c6['id']===_0x22966a[_0xd40f('0x77')]&&_0x23d5c6[_0xd40f('0x38')]===_0xd40f('0xaa');});break;}if(_0x5ac1f4)_0x553eda['push'](_0x22966a);});_0x5bc895[_0xd40f('0xab')]=_0x553eda['length'];_0x5bc895['rows']=_0x553eda;return _0x5bc895;});}else{if(!_[_0xd40f('0x8d')](_0x2c93db[_0xd40f('0x83')][_0xd40f('0xac')])){_0x2a4681['where']['id']=_0x2a4681[_0xd40f('0xa0')]['id']?_[_0xd40f('0x98')](_0x2a4681[_0xd40f('0xa0')]['id'],_0x2c93db['query'][_0xd40f('0xac')]):_0x2c93db[_0xd40f('0x83')][_0xd40f('0xac')];}return _0x418276[_0x5248c1[_0xd40f('0x14')]]['count']({'where':_0x2a4681[_0xd40f('0xa0')]})[_0xd40f('0x7')](function(_0x15c245){_0x5bc895[_0xd40f('0xab')]=_0x15c245;if(_0x2c93db[_0xd40f('0x83')][_0xd40f('0xa4')]){if(_0x5248c1[_0xd40f('0x14')]===_0xd40f('0xad')){_0x2a4681['include']=[{'model':_0x418276['Tag'],'as':_0xd40f('0xae'),'attributes':['id','name',_0xd40f('0xaf')],'required':_0x2c93db[_0xd40f('0x83')]['tag']?!![]:![]},{'model':_0x418276[_0xd40f('0x6a')],'as':_0xd40f('0xb0'),'attributes':['id','name','color'],'through':_0x2c93db[_0xd40f('0x83')][_0xd40f('0xb1')]?{'attributes':[],'where':{'TagId':_0x2c93db[_0xd40f('0x83')][_0xd40f('0xb1')]||undefined}}:{},'required':_0x2c93db[_0xd40f('0x83')][_0xd40f('0xb1')]?!![]:![]}];}else{_0x2a4681[_0xd40f('0xa5')]=[{'all':!![]}];}}return _0x418276[_0x5248c1[_0xd40f('0x14')]][_0xd40f('0x6')](_0x2a4681);})[_0xd40f('0x7')](function(_0x551443){_0x5bc895[_0xd40f('0xb2')]=_0x551443;if(_0x2af603===_0xd40f('0x32')&&_0x2c93db[_0xd40f('0x83')]['openTabs']==='true'){var _0x1633bb=[];for(var _0x320295=0x0;_0x320295<_0x5bc895[_0xd40f('0xb2')][_0xd40f('0x8e')];_0x320295++){_0x1633bb[_0xd40f('0x94')](_0x1d8288(_0xd40f('0xb3'),_0x5bc895[_0xd40f('0xb2')][_0x320295][_0xd40f('0xb4')]));_0x1633bb[_0xd40f('0x94')](_0x1d8288(_0xd40f('0xb5'),_0x5bc895[_0xd40f('0xb2')][_0x320295][_0xd40f('0xb4')]));_0x1633bb[_0xd40f('0x94')](_0x1d8288('fax',_0x5bc895[_0xd40f('0xb2')][_0x320295][_0xd40f('0xb4')]));_0x1633bb[_0xd40f('0x94')](_0x1d8288(_0xd40f('0xb6'),_0x5bc895[_0xd40f('0xb2')][_0x320295][_0xd40f('0xb4')]));_0x1633bb[_0xd40f('0x94')](_0x1d8288(_0xd40f('0xb7'),_0x5bc895[_0xd40f('0xb2')][_0x320295][_0xd40f('0xb4')]));_0x1633bb[_0xd40f('0x94')](_0x1d8288(_0xd40f('0xb8'),_0x5bc895[_0xd40f('0xb2')][_0x320295][_0xd40f('0xb4')]));}return Promise[_0xd40f('0x91')](_0x1633bb)[_0xd40f('0x7')](function(){return _0x5bc895;});}return _0x5bc895;});}});}}});};
\ No newline at end of file
index ef0f7d4..bcf6e69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce22=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2c4d17,_0x4f08e1){var _0x1f09cb=function(_0x4bf653){while(--_0x4bf653){_0x2c4d17['push'](_0x2c4d17['shift']());}};_0x1f09cb(++_0x4f08e1);}(_0xce22,0xea));var _0x2ce2=function(_0x435f71,_0x2ff13d){_0x435f71=_0x435f71-0x0;var _0x6811ae=_0xce22[_0x435f71];return _0x6811ae;};'use strict';var _=require(_0x2ce2('0x0'));var util=require(_0x2ce2('0x1'));var moment=require(_0x2ce2('0x2'));var BPromise=require(_0x2ce2('0x3'));var rs=require(_0x2ce2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ce2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ce2('0x6'))(_0x2ce2('0x7'));var config=require(_0x2ce2('0x8'));var jayson=require(_0x2ce2('0x9'));var client=jayson[_0x2ce2('0xa')][_0x2ce2('0xb')]({'port':0x232a});config[_0x2ce2('0xc')]=_['defaults'](config[_0x2ce2('0xc')],{'host':_0x2ce2('0xd'),'port':0x18eb});var socket=require(_0x2ce2('0xe'))(new Redis(config[_0x2ce2('0xc')]));require(_0x2ce2('0xf'))[_0x2ce2('0x10')](socket);function respondWithRpcPromise(_0x56b53e,_0x25d27e,_0x3c2e05){return new BPromise(function(_0x561dae,_0x26218a){return client[_0x2ce2('0x11')](_0x56b53e,_0x3c2e05)['then'](function(_0xaa959){logger[_0x2ce2('0x12')](_0x2ce2('0x13'),_0x25d27e,_0x2ce2('0x14'));logger['debug'](_0x2ce2('0x15'),_0x25d27e,_0x2ce2('0x14'),JSON[_0x2ce2('0x16')](_0xaa959));if(_0xaa959['error']){if(_0xaa959[_0x2ce2('0x17')]['code']===0x1f4){logger['error'](_0x2ce2('0x13'),_0x25d27e,_0xaa959[_0x2ce2('0x17')][_0x2ce2('0x18')]);return _0x26218a(_0xaa959[_0x2ce2('0x17')][_0x2ce2('0x18')]);}logger[_0x2ce2('0x17')](_0x2ce2('0x13'),_0x25d27e,_0xaa959['error']['message']);return _0x561dae(_0xaa959['error'][_0x2ce2('0x18')]);}else{logger[_0x2ce2('0x12')](_0x2ce2('0x13'),_0x25d27e,_0x2ce2('0x14'));_0x561dae(_0xaa959[_0x2ce2('0x19')]['message']);}})[_0x2ce2('0x1a')](function(_0x52d535){logger[_0x2ce2('0x17')](_0x2ce2('0x13'),_0x25d27e,_0x52d535);_0x26218a(_0x52d535);});});}
\ No newline at end of file
+var _0x71ad=['bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util'];(function(_0x53e0f1,_0x3bbca3){var _0x332f2a=function(_0x52c61f){while(--_0x52c61f){_0x53e0f1['push'](_0x53e0f1['shift']());}};_0x332f2a(++_0x3bbca3);}(_0x71ad,0xee));var _0xd71a=function(_0xec7b40,_0x33d537){_0xec7b40=_0xec7b40-0x0;var _0x44a113=_0x71ad[_0xec7b40];return _0x44a113;};'use strict';var _=require(_0xd71a('0x0'));var util=require(_0xd71a('0x1'));var moment=require('moment');var BPromise=require(_0xd71a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd71a('0x3'));var db=require(_0xd71a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd71a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd71a('0x6'));var client=jayson['client'][_0xd71a('0x7')]({'port':0x232a});config[_0xd71a('0x8')]=_[_0xd71a('0x9')](config[_0xd71a('0x8')],{'host':_0xd71a('0xa'),'port':0x18eb});var socket=require(_0xd71a('0xb'))(new Redis(config[_0xd71a('0x8')]));require('./userProfile.socket')[_0xd71a('0xc')](socket);function respondWithRpcPromise(_0x4b31a8,_0x52aff1,_0x1364b4){return new BPromise(function(_0x38af93,_0x260305){return client[_0xd71a('0xd')](_0x4b31a8,_0x1364b4)[_0xd71a('0xe')](function(_0x19294e){logger[_0xd71a('0xf')](_0xd71a('0x10'),_0x52aff1,_0xd71a('0x11'));logger[_0xd71a('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x52aff1,_0xd71a('0x11'),JSON[_0xd71a('0x13')](_0x19294e));if(_0x19294e[_0xd71a('0x14')]){if(_0x19294e[_0xd71a('0x14')][_0xd71a('0x15')]===0x1f4){logger[_0xd71a('0x14')](_0xd71a('0x10'),_0x52aff1,_0x19294e[_0xd71a('0x14')][_0xd71a('0x16')]);return _0x260305(_0x19294e[_0xd71a('0x14')][_0xd71a('0x16')]);}logger[_0xd71a('0x14')](_0xd71a('0x10'),_0x52aff1,_0x19294e[_0xd71a('0x14')][_0xd71a('0x16')]);return _0x38af93(_0x19294e['error'][_0xd71a('0x16')]);}else{logger[_0xd71a('0xf')](_0xd71a('0x10'),_0x52aff1,'request\x20sent');_0x38af93(_0x19294e['result']['message']);}})[_0xd71a('0x17')](function(_0x139bc8){logger[_0xd71a('0x14')](_0xd71a('0x10'),_0x52aff1,_0x139bc8);_0x260305(_0x139bc8);});});}
\ No newline at end of file
index 3410782..a26c640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x360f=['./userProfile.events','save','remove','update','emit','removeListener','register','userProfile:'];(function(_0x41eba9,_0x4bae0b){var _0x5b94f4=function(_0x9b12e6){while(--_0x9b12e6){_0x41eba9['push'](_0x41eba9['shift']());}};_0x5b94f4(++_0x4bae0b);}(_0x360f,0x1e8));var _0xf360=function(_0x5ba4d8,_0x196a5b){_0x5ba4d8=_0x5ba4d8-0x0;var _0x1e1817=_0x360f[_0x5ba4d8];return _0x1e1817;};'use strict';var UserProfileEvents=require(_0xf360('0x0'));var events=[_0xf360('0x1'),_0xf360('0x2'),_0xf360('0x3')];function createListener(_0x321b99,_0x400f25){return function(_0x225334){_0x400f25[_0xf360('0x4')](_0x321b99,_0x225334);};}function removeListener(_0x412175,_0x5ec5d6){return function(){UserProfileEvents[_0xf360('0x5')](_0x412175,_0x5ec5d6);};}exports[_0xf360('0x6')]=function(_0x44d57e){for(var _0x2f5201=0x0,_0x24a2b2=events['length'];_0x2f5201<_0x24a2b2;_0x2f5201++){var _0x2c8552=events[_0x2f5201];var _0x3a82a6=createListener(_0xf360('0x7')+_0x2c8552,_0x44d57e);UserProfileEvents['on'](_0x2c8552,_0x3a82a6);}};
\ No newline at end of file
+var _0x2d81=['removeListener','register','length','userProfile:','save','emit'];(function(_0x16ef95,_0x3502e5){var _0x5935fd=function(_0xcba66f){while(--_0xcba66f){_0x16ef95['push'](_0x16ef95['shift']());}};_0x5935fd(++_0x3502e5);}(_0x2d81,0x1a2));var _0x12d8=function(_0x463570,_0x56a748){_0x463570=_0x463570-0x0;var _0x487a90=_0x2d81[_0x463570];return _0x487a90;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x12d8('0x0'),'remove','update'];function createListener(_0x2b014f,_0x14dcf3){return function(_0x167e16){_0x14dcf3[_0x12d8('0x1')](_0x2b014f,_0x167e16);};}function removeListener(_0x249e2c,_0x4324ff){return function(){UserProfileEvents[_0x12d8('0x2')](_0x249e2c,_0x4324ff);};}exports[_0x12d8('0x3')]=function(_0x2b82a8){for(var _0x44e392=0x0,_0x4e8420=events[_0x12d8('0x4')];_0x44e392<_0x4e8420;_0x44e392++){var _0x513f1b=events[_0x44e392];var _0x1f3249=createListener(_0x12d8('0x5')+_0x513f1b,_0x2b82a8);UserProfileEvents['on'](_0x513f1b,_0x1f3249);}};
\ No newline at end of file
index 371e83b..5079aef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb55d=['./userProfileResource.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3f3d0e,_0x8a0892){var _0x3b84ad=function(_0x3fae1c){while(--_0x3fae1c){_0x3f3d0e['push'](_0x3f3d0e['shift']());}};_0x3b84ad(++_0x8a0892);}(_0xb55d,0x91));var _0xdb55=function(_0x4c301f,_0x47cd78){_0x4c301f=_0x4c301f-0x0;var _0x21ba7b=_0xb55d[_0x4c301f];return _0x21ba7b;};'use strict';var multer=require(_0xdb55('0x0'));var util=require(_0xdb55('0x1'));var path=require('path');var timeout=require(_0xdb55('0x2'));var express=require(_0xdb55('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdb55('0x4'));var interaction=require(_0xdb55('0x5'));var config=require(_0xdb55('0x6'));var controller=require(_0xdb55('0x7'));router['get']('/',auth[_0xdb55('0x8')](),controller[_0xdb55('0x9')]);router[_0xdb55('0xa')]('/describe',auth[_0xdb55('0x8')](),controller['describe']);router[_0xdb55('0xa')](_0xdb55('0xb'),auth['isAuthenticated'](),controller[_0xdb55('0xc')]);router[_0xdb55('0xd')]('/',auth[_0xdb55('0x8')](),controller[_0xdb55('0xe')]);router[_0xdb55('0xf')](_0xdb55('0xb'),auth[_0xdb55('0x8')](),controller[_0xdb55('0x10')]);router[_0xdb55('0x11')](_0xdb55('0xb'),auth['isAuthenticated'](),controller[_0xdb55('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x0e22=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x5d0fb7,_0x9f7a71){var _0x385d9b=function(_0x2dfb67){while(--_0x2dfb67){_0x5d0fb7['push'](_0x5d0fb7['shift']());}};_0x385d9b(++_0x9f7a71);}(_0x0e22,0x134));var _0x20e2=function(_0xe6f4ef,_0x4e34cc){_0xe6f4ef=_0xe6f4ef-0x0;var _0x4f3447=_0x0e22[_0xe6f4ef];return _0x4f3447;};'use strict';var multer=require(_0x20e2('0x0'));var util=require('util');var path=require(_0x20e2('0x1'));var timeout=require(_0x20e2('0x2'));var express=require(_0x20e2('0x3'));var router=express[_0x20e2('0x4')]();var fs_extra=require(_0x20e2('0x5'));var auth=require(_0x20e2('0x6'));var interaction=require(_0x20e2('0x7'));var config=require('../../config/environment');var controller=require(_0x20e2('0x8'));router[_0x20e2('0x9')]('/',auth[_0x20e2('0xa')](),controller[_0x20e2('0xb')]);router['get'](_0x20e2('0xc'),auth[_0x20e2('0xa')](),controller[_0x20e2('0xd')]);router['get'](_0x20e2('0xe'),auth[_0x20e2('0xa')](),controller[_0x20e2('0xf')]);router[_0x20e2('0x10')]('/',auth[_0x20e2('0xa')](),controller[_0x20e2('0x11')]);router[_0x20e2('0x12')]('/:id',auth[_0x20e2('0xa')](),controller[_0x20e2('0x13')]);router[_0x20e2('0x14')](_0x20e2('0xe'),auth[_0x20e2('0xa')](),controller[_0x20e2('0x15')]);module['exports']=router;
\ No newline at end of file
index 1af5540..8d84489 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f1=['INTEGER','STRING','sequelize'];(function(_0x3a3b9e,_0xc59037){var _0x148103=function(_0x406731){while(--_0x406731){_0x3a3b9e['push'](_0x3a3b9e['shift']());}};_0x148103(++_0xc59037);}(_0x28f1,0x113));var _0x128f=function(_0x32e816,_0x5b3f1b){_0x32e816=_0x32e816-0x0;var _0x42f513=_0x28f1[_0x32e816];return _0x42f513;};'use strict';var Sequelize=require(_0x128f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x128f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x128f('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x8530=['exports','STRING','INTEGER'];(function(_0x247be2,_0x260e66){var _0x519698=function(_0xef8dad){while(--_0xef8dad){_0x247be2['push'](_0x247be2['shift']());}};_0x519698(++_0x260e66);}(_0x8530,0x1e9));var _0x0853=function(_0x346958,_0x356a16){_0x346958=_0x346958-0x0;var _0x297ed0=_0x8530[_0x346958];return _0x297ed0;};'use strict';var Sequelize=require('sequelize');module[_0x0853('0x0')]={'name':{'type':Sequelize[_0x0853('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0853('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0853('0x1')],'allowNull':![]}};
\ No newline at end of file
index f6e338b..6531ce7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x124614,_0x4add3e){var _0x547ee0=function(_0x4ace39){while(--_0x4ace39){_0x124614['push'](_0x124614['shift']());}};_0x547ee0(++_0x4add3e);}(_0x524e,0x15e));var _0xe524=function(_0x3e6cc2,_0x438908){_0x3e6cc2=_0x3e6cc2-0x0;var _0x4331a6=_0x524e[_0x3e6cc2];return _0x4331a6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['UserProfileResource'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['UserProfileResource'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['UserProfileResource'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));};
\ No newline at end of file
+var _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4fa97c,_0x4aa6ab){var _0x518c7f=function(_0x2bd135){while(--_0x2bd135){_0x4fa97c['push'](_0x4fa97c['shift']());}};_0x518c7f(++_0x4aa6ab);}(_0x430c,0x1a1));var _0xc430=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x430c[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));};
\ No newline at end of file
index 589bcba..7961ad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x007a=['path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x007a,0x79));var _0xa007=function(_0x946e1b,_0x4f9f57){_0x946e1b=_0x946e1b-0x0;var _0x4db99b=_0x007a[_0x946e1b];return _0x4db99b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa007('0x0'))(_0xa007('0x1'));var moment=require(_0xa007('0x2'));var BPromise=require(_0xa007('0x3'));var rp=require(_0xa007('0x4'));var fs=require('fs');var path=require(_0xa007('0x5'));var rimraf=require(_0xa007('0x6'));var config=require('../../config/environment');var attributes=require(_0xa007('0x7'));module[_0xa007('0x8')]=function(_0x46c906,_0x2ca9d4){return _0x46c906[_0xa007('0x9')](_0xa007('0xa'),attributes,{'tableName':_0xa007('0xb'),'paranoid':![],'indexes':[{'name':_0xa007('0xc'),'fields':['resourceId',_0xa007('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c35=['bluebird','request-promise','./userProfileResource.attributes','exports','define','UserProfileResource','sectionId','lodash','../../config/logger','api','moment'];(function(_0x31759e,_0x45c66e){var _0x146d6e=function(_0x8aa49a){while(--_0x8aa49a){_0x31759e['push'](_0x31759e['shift']());}};_0x146d6e(++_0x45c66e);}(_0x1c35,0x1ca));var _0x51c3=function(_0x486479,_0x2022d2){_0x486479=_0x486479-0x0;var _0x559d47=_0x1c35[_0x486479];return _0x559d47;};'use strict';var _=require(_0x51c3('0x0'));var util=require('util');var logger=require(_0x51c3('0x1'))(_0x51c3('0x2'));var moment=require(_0x51c3('0x3'));var BPromise=require(_0x51c3('0x4'));var rp=require(_0x51c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x51c3('0x6'));module[_0x51c3('0x7')]=function(_0x449589,_0x1616e0){return _0x449589[_0x51c3('0x8')](_0x51c3('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x51c3('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index a0e47bc..7537e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98f5=['jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98f5,0x1ad));var _0x598f=function(_0x5f5512,_0x4e17fe){_0x5f5512=_0x5f5512-0x0;var _0x11a869=_0x98f5[_0x5f5512];return _0x11a869;};'use strict';var _=require(_0x598f('0x0'));var util=require(_0x598f('0x1'));var moment=require(_0x598f('0x2'));var BPromise=require(_0x598f('0x3'));var rs=require(_0x598f('0x4'));var fs=require('fs');var Redis=require(_0x598f('0x5'));var db=require(_0x598f('0x6'))['db'];var utils=require(_0x598f('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x598f('0x8'));var client=jayson[_0x598f('0x9')][_0x598f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xee26db,_0x417252,_0x29cf02){return new BPromise(function(_0x1cbdab,_0x4d2fb8){return client[_0x598f('0xb')](_0xee26db,_0x29cf02)[_0x598f('0xc')](function(_0x106c0f){logger[_0x598f('0xd')](_0x598f('0xe'),_0x417252,_0x598f('0xf'));logger[_0x598f('0x10')](_0x598f('0x11'),_0x417252,_0x598f('0xf'),JSON['stringify'](_0x106c0f));if(_0x106c0f['error']){if(_0x106c0f[_0x598f('0x12')][_0x598f('0x13')]===0x1f4){logger[_0x598f('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x417252,_0x106c0f[_0x598f('0x12')]['message']);return _0x4d2fb8(_0x106c0f[_0x598f('0x12')][_0x598f('0x14')]);}logger[_0x598f('0x12')](_0x598f('0xe'),_0x417252,_0x106c0f[_0x598f('0x12')][_0x598f('0x14')]);return _0x1cbdab(_0x106c0f[_0x598f('0x12')]['message']);}else{logger[_0x598f('0xd')](_0x598f('0xe'),_0x417252,'request\x20sent');_0x1cbdab(_0x106c0f[_0x598f('0x15')][_0x598f('0x14')]);}})[_0x598f('0x16')](function(_0x3d07f6){logger['error'](_0x598f('0xe'),_0x417252,_0x3d07f6);_0x4d2fb8(_0x3d07f6);});});}
\ No newline at end of file
+var _0x51b1=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0x51b1,0x70));var _0x151b=function(_0x54fbcb,_0x21a10f){_0x54fbcb=_0x54fbcb-0x0;var _0x58e047=_0x51b1[_0x54fbcb];return _0x58e047;};'use strict';var _=require(_0x151b('0x0'));var util=require(_0x151b('0x1'));var moment=require(_0x151b('0x2'));var BPromise=require(_0x151b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x151b('0x4'));var db=require(_0x151b('0x5'))['db'];var utils=require(_0x151b('0x6'));var logger=require(_0x151b('0x7'))(_0x151b('0x8'));var config=require(_0x151b('0x9'));var jayson=require(_0x151b('0xa'));var client=jayson[_0x151b('0xb')][_0x151b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c1db3,_0x2d6577,_0x1c624a){return new BPromise(function(_0x1ca1e9,_0x34aade){return client['request'](_0x5c1db3,_0x1c624a)[_0x151b('0xd')](function(_0x37dd2b){logger['info'](_0x151b('0xe'),_0x2d6577,_0x151b('0xf'));logger[_0x151b('0x10')](_0x151b('0x11'),_0x2d6577,_0x151b('0xf'),JSON[_0x151b('0x12')](_0x37dd2b));if(_0x37dd2b['error']){if(_0x37dd2b[_0x151b('0x13')]['code']===0x1f4){logger['error'](_0x151b('0xe'),_0x2d6577,_0x37dd2b[_0x151b('0x13')]['message']);return _0x34aade(_0x37dd2b[_0x151b('0x13')][_0x151b('0x14')]);}logger[_0x151b('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x2d6577,_0x37dd2b[_0x151b('0x13')][_0x151b('0x14')]);return _0x1ca1e9(_0x37dd2b[_0x151b('0x13')][_0x151b('0x14')]);}else{logger[_0x151b('0x15')](_0x151b('0xe'),_0x2d6577,_0x151b('0xf'));_0x1ca1e9(_0x37dd2b[_0x151b('0x16')][_0x151b('0x14')]);}})['catch'](function(_0x2b5ea9){logger[_0x151b('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x2d6577,_0x2b5ea9);_0x34aade(_0x2b5ea9);});});}
\ No newline at end of file
index 3d0ae44..4894092 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4698=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','./userProfileSection.controller'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0x4698,0x150));var _0x8469=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x4698[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require(_0x8469('0x0'));var util=require(_0x8469('0x1'));var path=require(_0x8469('0x2'));var timeout=require(_0x8469('0x3'));var express=require('express');var router=express[_0x8469('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8469('0x5'));router[_0x8469('0x6')]('/',auth[_0x8469('0x7')](),controller[_0x8469('0x8')]);router[_0x8469('0x6')](_0x8469('0x9'),auth[_0x8469('0x7')](),controller[_0x8469('0xa')]);router['get'](_0x8469('0xb'),auth[_0x8469('0x7')](),controller[_0x8469('0xc')]);router[_0x8469('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8469('0xe')](_0x8469('0xb'),auth[_0x8469('0x7')](),controller[_0x8469('0xf')]);router[_0x8469('0x10')]('/:id',auth[_0x8469('0x7')](),controller[_0x8469('0x11')]);module[_0x8469('0x12')]=router;
\ No newline at end of file
+var _0xe5cb=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','./userProfileSection.controller','get'];(function(_0x1dc704,_0x15e578){var _0x23cb91=function(_0x38d8ad){while(--_0x38d8ad){_0x1dc704['push'](_0x1dc704['shift']());}};_0x23cb91(++_0x15e578);}(_0xe5cb,0x77));var _0xbe5c=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xe5cb[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0xbe5c('0x0'));var util=require(_0xbe5c('0x1'));var path=require('path');var timeout=require(_0xbe5c('0x2'));var express=require('express');var router=express[_0xbe5c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe5c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe5c('0x5'));router[_0xbe5c('0x6')]('/',auth[_0xbe5c('0x7')](),controller['index']);router['get'](_0xbe5c('0x8'),auth[_0xbe5c('0x7')](),controller[_0xbe5c('0x9')]);router[_0xbe5c('0x6')](_0xbe5c('0xa'),auth[_0xbe5c('0x7')](),controller[_0xbe5c('0xb')]);router[_0xbe5c('0xc')]('/',auth[_0xbe5c('0x7')](),controller[_0xbe5c('0xd')]);router[_0xbe5c('0xe')](_0xbe5c('0xa'),auth[_0xbe5c('0x7')](),controller[_0xbe5c('0xf')]);router['delete'](_0xbe5c('0xa'),auth['isAuthenticated'](),controller[_0xbe5c('0x10')]);module[_0xbe5c('0x11')]=router;
\ No newline at end of file
index 34b3abe..2f76481 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x28c7c3,_0x57fc4f){var _0x3a61e1=function(_0x402ef1){while(--_0x402ef1){_0x28c7c3['push'](_0x28c7c3['shift']());}};_0x3a61e1(++_0x57fc4f);}(_0xefda,0x96));var _0xaefd=function(_0x5d3c64,_0x1092ac){_0x5d3c64=_0x5d3c64-0x0;var _0x161d1e=_0xefda[_0x5d3c64];return _0x161d1e;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xaefd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaefd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaefd('0x1')],'set':function(_0x2ade44){this[_0xaefd('0x4')](_0xaefd('0x5'),_0x2ade44?_0x2ade44[_0xaefd('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xaefd('0x5'))?this[_0xaefd('0x7')](_0xaefd('0x5'))[_0xaefd('0x8')](''):[];}}};
\ No newline at end of file
+var _0xbaf0=['split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x54ae0d,_0xd4fae){var _0x456421=function(_0x15369f){while(--_0x15369f){_0x54ae0d['push'](_0x54ae0d['shift']());}};_0x456421(++_0xd4fae);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x232cc7){this[_0x0baf('0x4')](_0x0baf('0x5'),_0x232cc7?_0x232cc7[_0x0baf('0x6')](''):[]);},'get':function(){return this[_0x0baf('0x7')](_0x0baf('0x5'))?this[_0x0baf('0x7')](_0x0baf('0x5'))[_0x0baf('0x8')](''):[];}}};
\ No newline at end of file
index 6b379ee..f4f8f9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44e9=['rawAttributes','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','index','UserProfileSection'];(function(_0x450a0d,_0x21839f){var _0x41e651=function(_0x174efa){while(--_0x174efa){_0x450a0d['push'](_0x450a0d['shift']());}};_0x41e651(++_0x21839f);}(_0x44e9,0x1ed));var _0x944e=function(_0x1e3341,_0x5aeada){_0x1e3341=_0x1e3341-0x0;var _0x23ba93=_0x44e9[_0x1e3341];return _0x23ba93;};'use strict';var emlformat=require(_0x944e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x944e('0x1'));var jsonpatch=require(_0x944e('0x2'));var rp=require(_0x944e('0x3'));var moment=require(_0x944e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x944e('0x5'));var util=require('util');var path=require(_0x944e('0x6'));var sox=require(_0x944e('0x7'));var csv=require(_0x944e('0x8'));var ejs=require(_0x944e('0x9'));var fs=require('fs');var fs_extra=require(_0x944e('0xa'));var _=require(_0x944e('0xb'));var squel=require(_0x944e('0xc'));var crypto=require(_0x944e('0xd'));var jsforce=require(_0x944e('0xe'));var deskjs=require(_0x944e('0xf'));var toCsv=require(_0x944e('0x8'));var querystring=require(_0x944e('0x10'));var Papa=require(_0x944e('0x11'));var Redis=require(_0x944e('0x12'));var authService=require(_0x944e('0x13'));var qs=require(_0x944e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x944e('0x15'));var logger=require(_0x944e('0x16'))('api');var utils=require(_0x944e('0x17'));var config=require(_0x944e('0x18'));var licenseUtil=require(_0x944e('0x19'));var db=require(_0x944e('0x1a'))['db'];function respondWithStatusCode(_0x591203,_0x15952b){_0x15952b=_0x15952b||0xcc;return function(_0xc1b4e){if(_0xc1b4e){return _0x591203['sendStatus'](_0x15952b);}return _0x591203[_0x944e('0x1b')](_0x15952b)[_0x944e('0x1c')]();};}function respondWithResult(_0x2967bd,_0x41610a){_0x41610a=_0x41610a||0xc8;return function(_0x27d8bb){if(_0x27d8bb){return _0x2967bd[_0x944e('0x1b')](_0x41610a)[_0x944e('0x1d')](_0x27d8bb);}};}function respondWithFilteredResult(_0x500fa5,_0x518846){return function(_0x1f2691){if(_0x1f2691){var _0x599da8=typeof _0x518846[_0x944e('0x1e')]===_0x944e('0x1f')&&typeof _0x518846['limit']==='undefined';var _0x1008f9=_0x1f2691[_0x944e('0x20')];var _0x1c8a22=_0x599da8?0x0:_0x518846[_0x944e('0x1e')];var _0x4bb36d=_0x599da8?_0x1f2691[_0x944e('0x20')]:_0x518846[_0x944e('0x1e')]+_0x518846[_0x944e('0x21')];var _0xb55b7b;if(_0x4bb36d>=_0x1008f9){_0x4bb36d=_0x1008f9;_0xb55b7b=0xc8;}else{_0xb55b7b=0xce;}_0x500fa5[_0x944e('0x1b')](_0xb55b7b);return _0x500fa5[_0x944e('0x22')](_0x944e('0x23'),_0x1c8a22+'-'+_0x4bb36d+'/'+_0x1008f9)['json'](_0x1f2691);}return null;};}function patchUpdates(_0x2df88){return function(_0x6c09cf){try{jsonpatch[_0x944e('0x24')](_0x6c09cf,_0x2df88,!![]);}catch(_0x19b2bf){return BPromise[_0x944e('0x25')](_0x19b2bf);}return _0x6c09cf[_0x944e('0x26')]();};}function saveUpdates(_0x4f48c0,_0x3f41e1){return function(_0x50d2d3){if(_0x50d2d3){return _0x50d2d3['update'](_0x4f48c0)[_0x944e('0x27')](function(_0xede353){return _0xede353;});}return null;};}function removeEntity(_0xb5cce8,_0x2d08aa){return function(_0x39cf5a){if(_0x39cf5a){return _0x39cf5a['destroy']()[_0x944e('0x27')](function(){_0xb5cce8[_0x944e('0x1b')](0xcc)[_0x944e('0x1c')]();});}};}function handleEntityNotFound(_0x3a9a78,_0xb6ca2){return function(_0x1c2c6c){if(!_0x1c2c6c){_0x3a9a78[_0x944e('0x28')](0x194);}return _0x1c2c6c;};}function handleError(_0x54b795,_0x2f89eb){_0x2f89eb=_0x2f89eb||0x1f4;return function(_0x3ab1b1){logger[_0x944e('0x29')](_0x3ab1b1[_0x944e('0x2a')]);if(_0x3ab1b1[_0x944e('0x2b')]){delete _0x3ab1b1[_0x944e('0x2b')];}_0x54b795[_0x944e('0x1b')](_0x2f89eb)['send'](_0x3ab1b1);};}exports[_0x944e('0x2c')]=function(_0x21360e,_0x503cde){var _0x4e3d34={},_0x3263b0={},_0x173829={'count':0x0,'rows':[]};var _0x2553d9=_['map'](db[_0x944e('0x2d')][_0x944e('0x2e')],function(_0x2f9881){return{'name':_0x2f9881['fieldName'],'type':_0x2f9881['type'][_0x944e('0x2f')]};});_0x3263b0[_0x944e('0x30')]=_[_0x944e('0x31')](_0x2553d9,'name');_0x3263b0[_0x944e('0x32')]=_['keys'](_0x21360e[_0x944e('0x32')]);_0x3263b0[_0x944e('0x33')]=_['intersection'](_0x3263b0['model'],_0x3263b0[_0x944e('0x32')]);_0x4e3d34[_0x944e('0x34')]=_[_0x944e('0x35')](_0x3263b0[_0x944e('0x30')],qs[_0x944e('0x36')](_0x21360e['query'][_0x944e('0x36')]));_0x4e3d34[_0x944e('0x34')]=_0x4e3d34[_0x944e('0x34')][_0x944e('0x37')]?_0x4e3d34['attributes']:_0x3263b0[_0x944e('0x30')];if(!_0x21360e[_0x944e('0x32')][_0x944e('0x38')](_0x944e('0x39'))){_0x4e3d34['limit']=qs['limit'](_0x21360e[_0x944e('0x32')][_0x944e('0x21')]);_0x4e3d34[_0x944e('0x1e')]=qs['offset'](_0x21360e['query']['offset']);}_0x4e3d34['order']=qs[_0x944e('0x3a')](_0x21360e[_0x944e('0x32')]['sort']);_0x4e3d34[_0x944e('0x3b')]=qs[_0x944e('0x33')](_[_0x944e('0x3c')](_0x21360e[_0x944e('0x32')],_0x3263b0[_0x944e('0x33')]),_0x2553d9);if(_0x21360e[_0x944e('0x32')][_0x944e('0x3d')]){_0x4e3d34['where']=_[_0x944e('0x3e')](_0x4e3d34['where'],{'$or':_['map'](_0x2553d9,function(_0x211b34){if(_0x211b34['type']!==_0x944e('0x3f')){var _0x4bbe72={};_0x4bbe72[_0x211b34['name']]={'$like':'%'+_0x21360e[_0x944e('0x32')][_0x944e('0x3d')]+'%'};return _0x4bbe72;}})});}_0x4e3d34=_['merge']({},_0x4e3d34,_0x21360e[_0x944e('0x40')]);var _0x232a09={'where':_0x4e3d34[_0x944e('0x3b')]};return db[_0x944e('0x2d')][_0x944e('0x20')](_0x232a09)[_0x944e('0x27')](function(_0x573615){_0x173829[_0x944e('0x20')]=_0x573615;if(_0x21360e['query'][_0x944e('0x41')]){_0x4e3d34[_0x944e('0x42')]=[{'all':!![]}];}return db['UserProfileSection'][_0x944e('0x43')](_0x4e3d34);})[_0x944e('0x27')](function(_0x3c2bb7){_0x173829['rows']=_0x3c2bb7;return _0x173829;})[_0x944e('0x27')](respondWithFilteredResult(_0x503cde,_0x4e3d34))[_0x944e('0x44')](handleError(_0x503cde,null));};exports[_0x944e('0x45')]=function(_0x35fc99,_0x5b2c22){var _0x52d125={'raw':![],'where':{'id':_0x35fc99[_0x944e('0x46')]['id']}},_0x83a40f={};_0x83a40f[_0x944e('0x30')]=_[_0x944e('0x47')](db[_0x944e('0x2d')][_0x944e('0x2e')]);_0x83a40f['query']=_['keys'](_0x35fc99['query']);_0x83a40f[_0x944e('0x33')]=_[_0x944e('0x35')](_0x83a40f[_0x944e('0x30')],_0x83a40f[_0x944e('0x32')]);_0x52d125[_0x944e('0x34')]=_[_0x944e('0x35')](_0x83a40f[_0x944e('0x30')],qs[_0x944e('0x36')](_0x35fc99[_0x944e('0x32')][_0x944e('0x36')]));_0x52d125[_0x944e('0x34')]=_0x52d125[_0x944e('0x34')][_0x944e('0x37')]?_0x52d125['attributes']:_0x83a40f[_0x944e('0x30')];if(_0x35fc99[_0x944e('0x32')][_0x944e('0x41')]){_0x52d125[_0x944e('0x42')]=[{'all':!![]}];}_0x52d125=_[_0x944e('0x3e')]({},_0x52d125,_0x35fc99[_0x944e('0x40')]);return db[_0x944e('0x2d')][_0x944e('0x48')](_0x52d125)[_0x944e('0x27')](handleEntityNotFound(_0x5b2c22,null))[_0x944e('0x27')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));};exports[_0x944e('0x49')]=function(_0x3b803d,_0x4cdec6){return db[_0x944e('0x2d')][_0x944e('0x49')](_0x3b803d['body'],{})[_0x944e('0x27')](respondWithResult(_0x4cdec6,0xc9))[_0x944e('0x44')](handleError(_0x4cdec6,null));};exports[_0x944e('0x4a')]=function(_0x1de0ef,_0x4cedfc){if(_0x1de0ef[_0x944e('0x4b')]['id']){delete _0x1de0ef['body']['id'];}return db['UserProfileSection'][_0x944e('0x48')]({'where':{'id':_0x1de0ef[_0x944e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cedfc,null))[_0x944e('0x27')](saveUpdates(_0x1de0ef[_0x944e('0x4b')],null))['then'](respondWithResult(_0x4cedfc,null))[_0x944e('0x44')](handleError(_0x4cedfc,null));};exports['destroy']=function(_0x2e5df1,_0x15e7c8){return db['UserProfileSection'][_0x944e('0x48')]({'where':{'id':_0x2e5df1[_0x944e('0x46')]['id']}})[_0x944e('0x27')](handleEntityNotFound(_0x15e7c8,null))[_0x944e('0x27')](removeEntity(_0x15e7c8,null))[_0x944e('0x44')](handleError(_0x15e7c8,null));};exports['describe']=function(_0x525013,_0x59ed6c){return db[_0x944e('0x2d')][_0x944e('0x4c')]()[_0x944e('0x27')](respondWithResult(_0x59ed6c,null))[_0x944e('0x44')](handleError(_0x59ed6c,null));};
\ No newline at end of file
+var _0xdc39=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','status','end','error','stack','name','send','index','map','UserProfileSection','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xdc39,0x144));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9dc3('0x0'));var rimraf=require(_0x9dc3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dc3('0x2'));var rp=require(_0x9dc3('0x3'));var moment=require(_0x9dc3('0x4'));var BPromise=require(_0x9dc3('0x5'));var Mustache=require(_0x9dc3('0x6'));var util=require(_0x9dc3('0x7'));var path=require(_0x9dc3('0x8'));var sox=require(_0x9dc3('0x9'));var csv=require('to-csv');var ejs=require(_0x9dc3('0xa'));var fs=require('fs');var fs_extra=require(_0x9dc3('0xb'));var _=require(_0x9dc3('0xc'));var squel=require('squel');var crypto=require(_0x9dc3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9dc3('0xe'));var toCsv=require(_0x9dc3('0xf'));var querystring=require(_0x9dc3('0x10'));var Papa=require(_0x9dc3('0x11'));var Redis=require(_0x9dc3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9dc3('0x13'));var as=require(_0x9dc3('0x14'));var hardwareService=require(_0x9dc3('0x15'));var logger=require(_0x9dc3('0x16'))(_0x9dc3('0x17'));var utils=require('../../config/utils');var config=require(_0x9dc3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9dc3('0x19'))['db'];function respondWithStatusCode(_0x570b69,_0x2ff89c){_0x2ff89c=_0x2ff89c||0xcc;return function(_0x53666f){if(_0x53666f){return _0x570b69[_0x9dc3('0x1a')](_0x2ff89c);}return _0x570b69['status'](_0x2ff89c)['end']();};}function respondWithResult(_0x3bdc7a,_0x23f645){_0x23f645=_0x23f645||0xc8;return function(_0x3a1afb){if(_0x3a1afb){return _0x3bdc7a['status'](_0x23f645)[_0x9dc3('0x1b')](_0x3a1afb);}};}function respondWithFilteredResult(_0xfcc4d5,_0x3a2f25){return function(_0x2033c3){if(_0x2033c3){var _0x50fbb9=typeof _0x3a2f25[_0x9dc3('0x1c')]===_0x9dc3('0x1d')&&typeof _0x3a2f25['limit']===_0x9dc3('0x1d');var _0x1da940=_0x2033c3[_0x9dc3('0x1e')];var _0x5b1a3f=_0x50fbb9?0x0:_0x3a2f25[_0x9dc3('0x1c')];var _0x594066=_0x50fbb9?_0x2033c3[_0x9dc3('0x1e')]:_0x3a2f25[_0x9dc3('0x1c')]+_0x3a2f25[_0x9dc3('0x1f')];var _0x512de6;if(_0x594066>=_0x1da940){_0x594066=_0x1da940;_0x512de6=0xc8;}else{_0x512de6=0xce;}_0xfcc4d5['status'](_0x512de6);return _0xfcc4d5['set'](_0x9dc3('0x20'),_0x5b1a3f+'-'+_0x594066+'/'+_0x1da940)[_0x9dc3('0x1b')](_0x2033c3);}return null;};}function patchUpdates(_0x39c64a){return function(_0x19892c){try{jsonpatch[_0x9dc3('0x21')](_0x19892c,_0x39c64a,!![]);}catch(_0x1ea7f9){return BPromise[_0x9dc3('0x22')](_0x1ea7f9);}return _0x19892c['save']();};}function saveUpdates(_0xe8bb5e,_0x54ef1d){return function(_0x107c0a){if(_0x107c0a){return _0x107c0a[_0x9dc3('0x23')](_0xe8bb5e)[_0x9dc3('0x24')](function(_0x229bb6){return _0x229bb6;});}return null;};}function removeEntity(_0x3358ab,_0x4f2587){return function(_0x1dd2c1){if(_0x1dd2c1){return _0x1dd2c1[_0x9dc3('0x25')]()['then'](function(){_0x3358ab[_0x9dc3('0x26')](0xcc)[_0x9dc3('0x27')]();});}};}function handleEntityNotFound(_0x38bd46,_0x3dfd7e){return function(_0x2daeca){if(!_0x2daeca){_0x38bd46[_0x9dc3('0x1a')](0x194);}return _0x2daeca;};}function handleError(_0x569b1d,_0x180f6d){_0x180f6d=_0x180f6d||0x1f4;return function(_0x53dd2d){logger[_0x9dc3('0x28')](_0x53dd2d[_0x9dc3('0x29')]);if(_0x53dd2d[_0x9dc3('0x2a')]){delete _0x53dd2d[_0x9dc3('0x2a')];}_0x569b1d[_0x9dc3('0x26')](_0x180f6d)[_0x9dc3('0x2b')](_0x53dd2d);};}exports[_0x9dc3('0x2c')]=function(_0x108c06,_0x27b56d){var _0x3f0264={},_0x5a9540={},_0x1a6b0a={'count':0x0,'rows':[]};var _0x3bbd19=_[_0x9dc3('0x2d')](db[_0x9dc3('0x2e')]['rawAttributes'],function(_0x12cb63){return{'name':_0x12cb63['fieldName'],'type':_0x12cb63[_0x9dc3('0x2f')]['key']};});_0x5a9540[_0x9dc3('0x30')]=_['map'](_0x3bbd19,_0x9dc3('0x2a'));_0x5a9540[_0x9dc3('0x31')]=_['keys'](_0x108c06[_0x9dc3('0x31')]);_0x5a9540[_0x9dc3('0x32')]=_[_0x9dc3('0x33')](_0x5a9540[_0x9dc3('0x30')],_0x5a9540[_0x9dc3('0x31')]);_0x3f0264[_0x9dc3('0x34')]=_[_0x9dc3('0x33')](_0x5a9540['model'],qs['fields'](_0x108c06['query'][_0x9dc3('0x35')]));_0x3f0264[_0x9dc3('0x34')]=_0x3f0264['attributes'][_0x9dc3('0x36')]?_0x3f0264['attributes']:_0x5a9540[_0x9dc3('0x30')];if(!_0x108c06[_0x9dc3('0x31')][_0x9dc3('0x37')](_0x9dc3('0x38'))){_0x3f0264[_0x9dc3('0x1f')]=qs[_0x9dc3('0x1f')](_0x108c06[_0x9dc3('0x31')][_0x9dc3('0x1f')]);_0x3f0264['offset']=qs[_0x9dc3('0x1c')](_0x108c06['query']['offset']);}_0x3f0264[_0x9dc3('0x39')]=qs[_0x9dc3('0x3a')](_0x108c06[_0x9dc3('0x31')][_0x9dc3('0x3a')]);_0x3f0264[_0x9dc3('0x3b')]=qs[_0x9dc3('0x32')](_[_0x9dc3('0x3c')](_0x108c06[_0x9dc3('0x31')],_0x5a9540['filters']),_0x3bbd19);if(_0x108c06[_0x9dc3('0x31')][_0x9dc3('0x3d')]){_0x3f0264[_0x9dc3('0x3b')]=_[_0x9dc3('0x3e')](_0x3f0264[_0x9dc3('0x3b')],{'$or':_[_0x9dc3('0x2d')](_0x3bbd19,function(_0x2d239b){if(_0x2d239b[_0x9dc3('0x2f')]!==_0x9dc3('0x3f')){var _0x3c772f={};_0x3c772f[_0x2d239b['name']]={'$like':'%'+_0x108c06['query']['filter']+'%'};return _0x3c772f;}})});}_0x3f0264=_[_0x9dc3('0x3e')]({},_0x3f0264,_0x108c06[_0x9dc3('0x40')]);var _0x386c61={'where':_0x3f0264[_0x9dc3('0x3b')]};return db[_0x9dc3('0x2e')][_0x9dc3('0x1e')](_0x386c61)['then'](function(_0x2c814c){_0x1a6b0a[_0x9dc3('0x1e')]=_0x2c814c;if(_0x108c06[_0x9dc3('0x31')][_0x9dc3('0x41')]){_0x3f0264[_0x9dc3('0x42')]=[{'all':!![]}];}return db[_0x9dc3('0x2e')][_0x9dc3('0x43')](_0x3f0264);})[_0x9dc3('0x24')](function(_0x35ffc4){_0x1a6b0a['rows']=_0x35ffc4;return _0x1a6b0a;})[_0x9dc3('0x24')](respondWithFilteredResult(_0x27b56d,_0x3f0264))[_0x9dc3('0x44')](handleError(_0x27b56d,null));};exports['show']=function(_0x50667b,_0x2cd119){var _0x5acaa5={'raw':![],'where':{'id':_0x50667b[_0x9dc3('0x45')]['id']}},_0x56e5ba={};_0x56e5ba[_0x9dc3('0x30')]=_[_0x9dc3('0x46')](db[_0x9dc3('0x2e')][_0x9dc3('0x47')]);_0x56e5ba[_0x9dc3('0x31')]=_[_0x9dc3('0x46')](_0x50667b[_0x9dc3('0x31')]);_0x56e5ba[_0x9dc3('0x32')]=_['intersection'](_0x56e5ba[_0x9dc3('0x30')],_0x56e5ba[_0x9dc3('0x31')]);_0x5acaa5[_0x9dc3('0x34')]=_[_0x9dc3('0x33')](_0x56e5ba[_0x9dc3('0x30')],qs[_0x9dc3('0x35')](_0x50667b['query'][_0x9dc3('0x35')]));_0x5acaa5[_0x9dc3('0x34')]=_0x5acaa5[_0x9dc3('0x34')][_0x9dc3('0x36')]?_0x5acaa5[_0x9dc3('0x34')]:_0x56e5ba[_0x9dc3('0x30')];if(_0x50667b[_0x9dc3('0x31')][_0x9dc3('0x41')]){_0x5acaa5[_0x9dc3('0x42')]=[{'all':!![]}];}_0x5acaa5=_[_0x9dc3('0x3e')]({},_0x5acaa5,_0x50667b[_0x9dc3('0x40')]);return db[_0x9dc3('0x2e')][_0x9dc3('0x48')](_0x5acaa5)['then'](handleEntityNotFound(_0x2cd119,null))[_0x9dc3('0x24')](respondWithResult(_0x2cd119,null))['catch'](handleError(_0x2cd119,null));};exports[_0x9dc3('0x49')]=function(_0x429fc2,_0x405874){return db[_0x9dc3('0x2e')][_0x9dc3('0x49')](_0x429fc2['body'],{})[_0x9dc3('0x24')](respondWithResult(_0x405874,0xc9))[_0x9dc3('0x44')](handleError(_0x405874,null));};exports[_0x9dc3('0x23')]=function(_0x3e502a,_0x485341){if(_0x3e502a[_0x9dc3('0x4a')]['id']){delete _0x3e502a[_0x9dc3('0x4a')]['id'];}return db['UserProfileSection'][_0x9dc3('0x48')]({'where':{'id':_0x3e502a[_0x9dc3('0x45')]['id']}})['then'](handleEntityNotFound(_0x485341,null))[_0x9dc3('0x24')](saveUpdates(_0x3e502a[_0x9dc3('0x4a')],null))[_0x9dc3('0x24')](respondWithResult(_0x485341,null))[_0x9dc3('0x44')](handleError(_0x485341,null));};exports['destroy']=function(_0x43badc,_0x1c3f6e){return db[_0x9dc3('0x2e')]['find']({'where':{'id':_0x43badc[_0x9dc3('0x45')]['id']}})[_0x9dc3('0x24')](handleEntityNotFound(_0x1c3f6e,null))[_0x9dc3('0x24')](removeEntity(_0x1c3f6e,null))[_0x9dc3('0x44')](handleError(_0x1c3f6e,null));};exports[_0x9dc3('0x4b')]=function(_0x4b0267,_0x46ee52){return db[_0x9dc3('0x2e')][_0x9dc3('0x4b')]()['then'](respondWithResult(_0x46ee52,null))[_0x9dc3('0x44')](handleError(_0x46ee52,null));};
\ No newline at end of file
index 757f5c7..b4b27ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ce9=['../../config/logger','api','moment','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','userProfileId','lodash','util'];(function(_0xad0143,_0x3674ca){var _0x2bcfd9=function(_0x335574){while(--_0x335574){_0xad0143['push'](_0xad0143['shift']());}};_0x2bcfd9(++_0x3674ca);}(_0x0ce9,0x9a));var _0x90ce=function(_0x2195a4,_0x41e7e8){_0x2195a4=_0x2195a4-0x0;var _0x3c88b7=_0x0ce9[_0x2195a4];return _0x3c88b7;};'use strict';var _=require(_0x90ce('0x0'));var util=require(_0x90ce('0x1'));var logger=require(_0x90ce('0x2'))(_0x90ce('0x3'));var moment=require(_0x90ce('0x4'));var BPromise=require('bluebird');var rp=require(_0x90ce('0x5'));var fs=require('fs');var path=require(_0x90ce('0x6'));var rimraf=require(_0x90ce('0x7'));var config=require('../../config/environment');var attributes=require(_0x90ce('0x8'));module[_0x90ce('0x9')]=function(_0x217c2c,_0x14d075){return _0x217c2c[_0x90ce('0xa')]('UserProfileSection',attributes,{'tableName':_0x90ce('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x90ce('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcbff=['./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4b86f6,_0x4e0f0b){var _0x2af28c=function(_0xe8d30a){while(--_0xe8d30a){_0x4b86f6['push'](_0x4b86f6['shift']());}};_0x2af28c(++_0x4e0f0b);}(_0xcbff,0x1c6));var _0xfcbf=function(_0x4d2ec1,_0x470a0a){_0x4d2ec1=_0x4d2ec1-0x0;var _0x17ad5f=_0xcbff[_0x4d2ec1];return _0x17ad5f;};'use strict';var _=require(_0xfcbf('0x0'));var util=require(_0xfcbf('0x1'));var logger=require('../../config/logger')(_0xfcbf('0x2'));var moment=require(_0xfcbf('0x3'));var BPromise=require(_0xfcbf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcbf('0x5'));var rimraf=require(_0xfcbf('0x6'));var config=require(_0xfcbf('0x7'));var attributes=require(_0xfcbf('0x8'));module[_0xfcbf('0x9')]=function(_0x5d11f7,_0x5e3962){return _0x5d11f7['define'](_0xfcbf('0xa'),attributes,{'tableName':_0xfcbf('0xb'),'paranoid':![],'indexes':[{'name':_0xfcbf('0xc'),'fields':[_0xfcbf('0xd'),'userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
index 7db289b..94f7166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c23=['message','UserProfileSection,\x20%s,\x20%s','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','code','error'];(function(_0x25b495,_0x2d9805){var _0x1e54f1=function(_0x561d6c){while(--_0x561d6c){_0x25b495['push'](_0x25b495['shift']());}};_0x1e54f1(++_0x2d9805);}(_0x7c23,0xad));var _0x37c2=function(_0x356a62,_0x236fe8){_0x356a62=_0x356a62-0x0;var _0x5bfbbe=_0x7c23[_0x356a62];return _0x5bfbbe;};'use strict';var _=require('lodash');var util=require(_0x37c2('0x0'));var moment=require(_0x37c2('0x1'));var BPromise=require(_0x37c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37c2('0x3'));var db=require(_0x37c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x37c2('0x5'))('rpc');var config=require(_0x37c2('0x6'));var jayson=require(_0x37c2('0x7'));var client=jayson[_0x37c2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9969e9,_0x5b6993,_0x1e1ebe){return new BPromise(function(_0x30a429,_0x1b8e26){return client[_0x37c2('0x9')](_0x9969e9,_0x1e1ebe)[_0x37c2('0xa')](function(_0x15e05e){logger[_0x37c2('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x5b6993,_0x37c2('0xc'));logger[_0x37c2('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5b6993,_0x37c2('0xc'),JSON[_0x37c2('0xe')](_0x15e05e));if(_0x15e05e['error']){if(_0x15e05e['error'][_0x37c2('0xf')]===0x1f4){logger[_0x37c2('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x5b6993,_0x15e05e[_0x37c2('0x10')][_0x37c2('0x11')]);return _0x1b8e26(_0x15e05e['error'][_0x37c2('0x11')]);}logger['error'](_0x37c2('0x12'),_0x5b6993,_0x15e05e['error'][_0x37c2('0x11')]);return _0x30a429(_0x15e05e[_0x37c2('0x10')][_0x37c2('0x11')]);}else{logger['info'](_0x37c2('0x12'),_0x5b6993,_0x37c2('0xc'));_0x30a429(_0x15e05e['result'][_0x37c2('0x11')]);}})['catch'](function(_0x124c6d){logger[_0x37c2('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x5b6993,_0x124c6d);_0x1b8e26(_0x124c6d);});});}
\ No newline at end of file
+var _0x0402=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis'];(function(_0x4bb051,_0x4172a8){var _0x568878=function(_0x3badbb){while(--_0x3badbb){_0x4bb051['push'](_0x4bb051['shift']());}};_0x568878(++_0x4172a8);}(_0x0402,0x176));var _0x2040=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x0402[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x2040('0x0'));var util=require('util');var moment=require(_0x2040('0x1'));var BPromise=require('bluebird');var rs=require(_0x2040('0x2'));var fs=require('fs');var Redis=require(_0x2040('0x3'));var db=require(_0x2040('0x4'))['db'];var utils=require(_0x2040('0x5'));var logger=require(_0x2040('0x6'))(_0x2040('0x7'));var config=require(_0x2040('0x8'));var jayson=require(_0x2040('0x9'));var client=jayson[_0x2040('0xa')][_0x2040('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13fe28,_0x3f9c9a,_0x211d87){return new BPromise(function(_0x14e043,_0x86cc3f){return client[_0x2040('0xc')](_0x13fe28,_0x211d87)['then'](function(_0x5a01f0){logger[_0x2040('0xd')](_0x2040('0xe'),_0x3f9c9a,_0x2040('0xf'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3f9c9a,_0x2040('0xf'),JSON[_0x2040('0x10')](_0x5a01f0));if(_0x5a01f0[_0x2040('0x11')]){if(_0x5a01f0[_0x2040('0x11')][_0x2040('0x12')]===0x1f4){logger[_0x2040('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x3f9c9a,_0x5a01f0[_0x2040('0x11')][_0x2040('0x13')]);return _0x86cc3f(_0x5a01f0[_0x2040('0x11')][_0x2040('0x13')]);}logger[_0x2040('0x11')](_0x2040('0xe'),_0x3f9c9a,_0x5a01f0[_0x2040('0x11')][_0x2040('0x13')]);return _0x14e043(_0x5a01f0[_0x2040('0x11')]['message']);}else{logger[_0x2040('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x3f9c9a,'request\x20sent');_0x14e043(_0x5a01f0['result'][_0x2040('0x13')]);}})[_0x2040('0x14')](function(_0x45da46){logger['error'](_0x2040('0xe'),_0x3f9c9a,_0x45da46);_0x86cc3f(_0x45da46);});});}
\ No newline at end of file
index e90c3e5..d766767 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4cb9d5,_0x187d5a){var _0x444523=function(_0x46497c){while(--_0x46497c){_0x4cb9d5['push'](_0x4cb9d5['shift']());}};_0x444523(++_0x187d5a);}(_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'));module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x18e84d,_0x400654){var _0x154f7c=function(_0xbb4ecb){while(--_0xbb4ecb){_0x18e84d['push'](_0x18e84d['shift']());}};_0x154f7c(++_0x400654);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 981a49a..7c218e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa25a=['sequelize','exports','INTEGER'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa25a,0x153));var _0xaa25=function(_0x1fba85,_0x4c8186){_0x1fba85=_0x1fba85-0x0;var _0x386848=_0xa25a[_0x1fba85];return _0x386848;};'use strict';var Sequelize=require(_0xaa25('0x0'));module[_0xaa25('0x1')]={'penalty':{'type':Sequelize[_0xaa25('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4c0a=['sequelize','INTEGER'];(function(_0x6063c2,_0x83b5fc){var _0x47d59c=function(_0x184abd){while(--_0x184abd){_0x6063c2['push'](_0x6063c2['shift']());}};_0x47d59c(++_0x83b5fc);}(_0x4c0a,0x11a));var _0xa4c0=function(_0x2b12a8,_0x419e75){_0x2b12a8=_0x2b12a8-0x0;var _0x3d3974=_0x4c0a[_0x2b12a8];return _0x3d3974;};'use strict';var Sequelize=require(_0xa4c0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa4c0('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 646b51c..db37c8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x199c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x199c,0x1d8));var _0xc199=function(_0x192aa7,_0x27d63a){_0x192aa7=_0x192aa7-0x0;var _0x1d31b5=_0x199c[_0x192aa7];return _0x1d31b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc199('0x0'))(_0xc199('0x1'));var moment=require(_0xc199('0x2'));var BPromise=require(_0xc199('0x3'));var rp=require(_0xc199('0x4'));var fs=require('fs');var path=require(_0xc199('0x5'));var rimraf=require(_0xc199('0x6'));var config=require(_0xc199('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xc199('0x8')]=function(_0x2ff172,_0x499721){return _0x2ff172['define'](_0xc199('0x9'),attributes,{'tableName':_0xc199('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ccb=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x378f93,_0x3d2a98){var _0x1186e4=function(_0x511a19){while(--_0x511a19){_0x378f93['push'](_0x378f93['shift']());}};_0x1186e4(++_0x3d2a98);}(_0x4ccb,0x196));var _0xb4cc=function(_0x2c453c,_0x4cea8e){_0x2c453c=_0x2c453c-0x0;var _0x22dd4c=_0x4ccb[_0x2c453c];return _0x22dd4c;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xb4cc('0x8')]=function(_0x2181b2,_0x1e19dd){return _0x2181b2['define'](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 613789e..411d0ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16dc=['request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x16dc,0x186));var _0xc16d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc16d('0x0'));var BPromise=require('bluebird');var rs=require(_0xc16d('0x1'));var fs=require('fs');var Redis=require(_0xc16d('0x2'));var db=require(_0xc16d('0x3'))['db'];var utils=require(_0xc16d('0x4'));var logger=require(_0xc16d('0x5'))('rpc');var config=require(_0xc16d('0x6'));var jayson=require(_0xc16d('0x7'));var client=jayson[_0xc16d('0x8')][_0xc16d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x309ac0,_0x420305,_0x4a5a6e){return new BPromise(function(_0x9b44fa,_0x20067d){return client[_0xc16d('0xa')](_0x309ac0,_0x4a5a6e)[_0xc16d('0xb')](function(_0x45a494){logger['info'](_0xc16d('0xc'),_0x420305,_0xc16d('0xd'));logger['debug'](_0xc16d('0xe'),_0x420305,'request\x20sent',JSON['stringify'](_0x45a494));if(_0x45a494[_0xc16d('0xf')]){if(_0x45a494[_0xc16d('0xf')][_0xc16d('0x10')]===0x1f4){logger[_0xc16d('0xf')](_0xc16d('0xc'),_0x420305,_0x45a494[_0xc16d('0xf')]['message']);return _0x20067d(_0x45a494[_0xc16d('0xf')][_0xc16d('0x11')]);}logger[_0xc16d('0xf')](_0xc16d('0xc'),_0x420305,_0x45a494[_0xc16d('0xf')][_0xc16d('0x11')]);return _0x9b44fa(_0x45a494['error']['message']);}else{logger['info'](_0xc16d('0xc'),_0x420305,_0xc16d('0xd'));_0x9b44fa(_0x45a494[_0xc16d('0x12')]['message']);}})[_0xc16d('0x13')](function(_0x227247){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x420305,_0x227247);_0x20067d(_0x227247);});});}
\ No newline at end of file
+var _0xaeb9=['code','UserSmsQueue,\x20%s,\x20%s','message','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x39321f,_0x9abfe){var _0x3bcf91=function(_0x4e07ef){while(--_0x4e07ef){_0x39321f['push'](_0x39321f['shift']());}};_0x3bcf91(++_0x9abfe);}(_0xaeb9,0xcc));var _0x9aeb=function(_0x1844bd,_0x3332a2){_0x1844bd=_0x1844bd-0x0;var _0x5dc32b=_0xaeb9[_0x1844bd];return _0x5dc32b;};'use strict';var _=require('lodash');var util=require(_0x9aeb('0x0'));var moment=require(_0x9aeb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9aeb('0x2'));var db=require(_0x9aeb('0x3'))['db'];var utils=require(_0x9aeb('0x4'));var logger=require(_0x9aeb('0x5'))(_0x9aeb('0x6'));var config=require(_0x9aeb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9aeb('0x8')][_0x9aeb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ebb93,_0x59c628,_0x856d3c){return new BPromise(function(_0x21b75b,_0x432023){return client[_0x9aeb('0xa')](_0x4ebb93,_0x856d3c)[_0x9aeb('0xb')](function(_0x5d7090){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x59c628,_0x9aeb('0xc'));logger[_0x9aeb('0xd')](_0x9aeb('0xe'),_0x59c628,'request\x20sent',JSON['stringify'](_0x5d7090));if(_0x5d7090[_0x9aeb('0xf')]){if(_0x5d7090[_0x9aeb('0xf')][_0x9aeb('0x10')]===0x1f4){logger[_0x9aeb('0xf')](_0x9aeb('0x11'),_0x59c628,_0x5d7090['error'][_0x9aeb('0x12')]);return _0x432023(_0x5d7090['error'][_0x9aeb('0x12')]);}logger[_0x9aeb('0xf')](_0x9aeb('0x11'),_0x59c628,_0x5d7090[_0x9aeb('0xf')][_0x9aeb('0x12')]);return _0x21b75b(_0x5d7090[_0x9aeb('0xf')][_0x9aeb('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x59c628,_0x9aeb('0xc'));_0x21b75b(_0x5d7090['result'][_0x9aeb('0x12')]);}})[_0x9aeb('0x13')](function(_0x510ad2){logger[_0x9aeb('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x59c628,_0x510ad2);_0x432023(_0x510ad2);});});}
\ No newline at end of file
index 75c5add..9c96c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa60d=['INTEGER','exports'];(function(_0xbebaa4,_0x4fabd5){var _0x476d6b=function(_0xcf45a3){while(--_0xcf45a3){_0xbebaa4['push'](_0xbebaa4['shift']());}};_0x476d6b(++_0x4fabd5);}(_0xa60d,0x199));var _0xda60=function(_0x10baeb,_0x1f83cf){_0x10baeb=_0x10baeb-0x0;var _0x54493e=_0xa60d[_0x10baeb];return _0x54493e;};'use strict';var Sequelize=require('sequelize');module[_0xda60('0x0')]={'UserId':{'type':Sequelize[_0xda60('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xda60('0x1')]}};
\ No newline at end of file
+var _0x4e5b=['sequelize','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4e5b,0x17c));var _0xb4e5=function(_0x4c65fd,_0x2ba5cc){_0x4c65fd=_0x4c65fd-0x0;var _0x315e4b=_0x4e5b[_0x4c65fd];return _0x315e4b;};'use strict';var Sequelize=require(_0xb4e5('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xb4e5('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xb4e5('0x1')]}};
\ No newline at end of file
index 8f24e8e..a3a3534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4f41c1,_0x123b40){var _0x128a3c=function(_0x1c1f30){while(--_0x1c1f30){_0x4f41c1['push'](_0x4f41c1['shift']());}};_0x128a3c(++_0x123b40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2abf29,_0x37e1ab){var _0x12fac2=function(_0x2ef935){while(--_0x2ef935){_0x2abf29['push'](_0x2abf29['shift']());}};_0x12fac2(++_0x37e1ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 08ac47b..8fcd475 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1cf28e,_0x3eb763){var _0x402fbb=function(_0x51bc62){while(--_0x51bc62){_0x1cf28e['push'](_0x1cf28e['shift']());}};_0x402fbb(++_0x3eb763);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x21bc4f,_0x13fef4){var _0x2f9d6f=function(_0x16fb1f){while(--_0x16fb1f){_0x21bc4f['push'](_0x21bc4f['shift']());}};_0x2f9d6f(++_0x13fef4);}(_0xedd9,0xfc));var _0x9edd=function(_0x4b2934,_0x35277c){_0x4b2934=_0x4b2934-0x0;var _0x3e1069=_0xedd9[_0x4b2934];return _0x3e1069;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 859041c..15b8e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ed7=['sequelize','INTEGER'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x9ed7,0x168));var _0x79ed=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0x9ed7[_0x566bdf];return _0x331215;};'use strict';var Sequelize=require(_0x79ed('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x79ed('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x88ca=['sequelize','INTEGER'];(function(_0x1864f7,_0x42394){var _0xc07137=function(_0x5a7d4e){while(--_0x5a7d4e){_0x1864f7['push'](_0x1864f7['shift']());}};_0xc07137(++_0x42394);}(_0x88ca,0xa6));var _0xa88c=function(_0x4232d8,_0x13fd09){_0x4232d8=_0x4232d8-0x0;var _0x324de2=_0x88ca[_0x4232d8];return _0x324de2;};'use strict';var Sequelize=require(_0xa88c('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa88c('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 9dfe680..8ae902e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb56=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues'];(function(_0x4367a7,_0x271829){var _0x210d5a=function(_0xc22775){while(--_0xc22775){_0x4367a7['push'](_0x4367a7['shift']());}};_0x210d5a(++_0x271829);}(_0xeb56,0x1ce));var _0x6eb5=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0xeb56[_0x9729d7];return _0x3c4ac6;};'use strict';var _=require(_0x6eb5('0x0'));var util=require(_0x6eb5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6eb5('0x2'));var rp=require(_0x6eb5('0x3'));var fs=require('fs');var path=require(_0x6eb5('0x4'));var rimraf=require(_0x6eb5('0x5'));var config=require(_0x6eb5('0x6'));var attributes=require(_0x6eb5('0x7'));module[_0x6eb5('0x8')]=function(_0x20db2b,_0x163331){return _0x20db2b[_0x6eb5('0x9')]('UserVoiceQueue',attributes,{'tableName':_0x6eb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9846=['UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x2859f2,_0x1e3102){var _0x4974cd=function(_0x13ec65){while(--_0x13ec65){_0x2859f2['push'](_0x2859f2['shift']());}};_0x4974cd(++_0x1e3102);}(_0x9846,0x120));var _0x6984=function(_0x2d32f8,_0x5516c9){_0x2d32f8=_0x2d32f8-0x0;var _0xbc97ce=_0x9846[_0x2d32f8];return _0xbc97ce;};'use strict';var _=require(_0x6984('0x0'));var util=require(_0x6984('0x1'));var logger=require(_0x6984('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6984('0x3'));var rp=require(_0x6984('0x4'));var fs=require('fs');var path=require(_0x6984('0x5'));var rimraf=require(_0x6984('0x6'));var config=require(_0x6984('0x7'));var attributes=require(_0x6984('0x8'));module[_0x6984('0x9')]=function(_0x59e101,_0x588aed){return _0x59e101[_0x6984('0xa')](_0x6984('0xb'),attributes,{'tableName':_0x6984('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 82436ba..a621474 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcd5=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch'];(function(_0x37556a,_0x43a12e){var _0x49caa1=function(_0x43d5b9){while(--_0x43d5b9){_0x37556a['push'](_0x37556a['shift']());}};_0x49caa1(++_0x43a12e);}(_0xfcd5,0x143));var _0x5fcd=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xfcd5[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x5fcd('0x0'));var util=require(_0x5fcd('0x1'));var moment=require(_0x5fcd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fcd('0x3'));var db=require(_0x5fcd('0x4'))['db'];var utils=require(_0x5fcd('0x5'));var logger=require('../../config/logger')(_0x5fcd('0x6'));var config=require(_0x5fcd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5fcd('0x8')][_0x5fcd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5053a9,_0x51f049,_0x5dfabe){return new BPromise(function(_0x12e7c6,_0x553810){return client['request'](_0x5053a9,_0x5dfabe)['then'](function(_0x563a07){logger[_0x5fcd('0xa')](_0x5fcd('0xb'),_0x51f049,'request\x20sent');logger[_0x5fcd('0xc')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x51f049,_0x5fcd('0xd'),JSON['stringify'](_0x563a07));if(_0x563a07[_0x5fcd('0xe')]){if(_0x563a07[_0x5fcd('0xe')][_0x5fcd('0xf')]===0x1f4){logger[_0x5fcd('0xe')](_0x5fcd('0xb'),_0x51f049,_0x563a07['error'][_0x5fcd('0x10')]);return _0x553810(_0x563a07[_0x5fcd('0xe')][_0x5fcd('0x10')]);}logger[_0x5fcd('0xe')](_0x5fcd('0xb'),_0x51f049,_0x563a07[_0x5fcd('0xe')][_0x5fcd('0x10')]);return _0x12e7c6(_0x563a07[_0x5fcd('0xe')][_0x5fcd('0x10')]);}else{logger[_0x5fcd('0xa')](_0x5fcd('0xb'),_0x51f049,'request\x20sent');_0x12e7c6(_0x563a07[_0x5fcd('0x11')][_0x5fcd('0x10')]);}})[_0x5fcd('0x12')](function(_0x446957){logger[_0x5fcd('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x51f049,_0x446957);_0x553810(_0x446957);});});}
\ No newline at end of file
+var _0x4267=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x32904d,_0x28b13c){var _0x252bd9=function(_0x39276f){while(--_0x39276f){_0x32904d['push'](_0x32904d['shift']());}};_0x252bd9(++_0x28b13c);}(_0x4267,0x161));var _0x7426=function(_0x2324bb,_0x24a969){_0x2324bb=_0x2324bb-0x0;var _0x106e69=_0x4267[_0x2324bb];return _0x106e69;};'use strict';var _=require(_0x7426('0x0'));var util=require(_0x7426('0x1'));var moment=require(_0x7426('0x2'));var BPromise=require('bluebird');var rs=require(_0x7426('0x3'));var fs=require('fs');var Redis=require(_0x7426('0x4'));var db=require(_0x7426('0x5'))['db'];var utils=require(_0x7426('0x6'));var logger=require(_0x7426('0x7'))('rpc');var config=require(_0x7426('0x8'));var jayson=require(_0x7426('0x9'));var client=jayson[_0x7426('0xa')][_0x7426('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2be621,_0x526a1f,_0x447e36){return new BPromise(function(_0x27898a,_0x202893){return client['request'](_0x2be621,_0x447e36)[_0x7426('0xc')](function(_0x706676){logger[_0x7426('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x526a1f,_0x7426('0xe'));logger['debug'](_0x7426('0xf'),_0x526a1f,_0x7426('0xe'),JSON['stringify'](_0x706676));if(_0x706676[_0x7426('0x10')]){if(_0x706676['error']['code']===0x1f4){logger['error'](_0x7426('0x11'),_0x526a1f,_0x706676[_0x7426('0x10')][_0x7426('0x12')]);return _0x202893(_0x706676['error'][_0x7426('0x12')]);}logger['error'](_0x7426('0x11'),_0x526a1f,_0x706676['error'][_0x7426('0x12')]);return _0x27898a(_0x706676['error'][_0x7426('0x12')]);}else{logger[_0x7426('0xd')](_0x7426('0x11'),_0x526a1f,_0x7426('0xe'));_0x27898a(_0x706676[_0x7426('0x13')][_0x7426('0x12')]);}})[_0x7426('0x14')](function(_0x449341){logger[_0x7426('0x10')](_0x7426('0x11'),_0x526a1f,_0x449341);_0x202893(_0x449341);});});}
\ No newline at end of file
index 2336876..2140587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x353862,_0x32e86a){var _0x37d694=function(_0x3fab8f){while(--_0x3fab8f){_0x353862['push'](_0x353862['shift']());}};_0x37d694(++_0x32e86a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x114bf1,_0x16ac4a){var _0x58072f=function(_0x377d8a){while(--_0x377d8a){_0x114bf1['push'](_0x114bf1['shift']());}};_0x58072f(++_0x16ac4a);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index d244e86..dd3118f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e8d=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x24b151,_0x6cfedb){var _0x51eec5=function(_0x2ea497){while(--_0x2ea497){_0x24b151['push'](_0x24b151['shift']());}};_0x51eec5(++_0x6cfedb);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x472887,_0x53cfbe){_0x472887=_0x472887-0x0;var _0x2ba508=_0x5e8d[_0x472887];return _0x2ba508;};'use strict';var Sequelize=require(_0xd5e8('0x0'));module[_0xd5e8('0x1')]={'uniqueid':{'type':Sequelize[_0xd5e8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd5e8('0x3')},'membername':{'type':Sequelize[_0xd5e8('0x4')],'allowNull':![],'comment':_0xd5e8('0x3')},'UserId':{'type':Sequelize[_0xd5e8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd5e8('0x5'),'comment':_0xd5e8('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xd5e8('0x4')],'allowNull':![],'unique':_0xd5e8('0x5'),'comment':_0xd5e8('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xd5e8('0x3')},'paused':{'type':Sequelize[_0xd5e8('0x2')](0xb),'defaultValue':0x0,'comment':_0xd5e8('0x3')}};
\ No newline at end of file
+var _0xb51b=['Required\x20by\x20Asterisk','sequelize','INTEGER','STRING','queue_interface'];(function(_0x38fe86,_0x15424d){var _0x2cbbb2=function(_0x1c0aff){while(--_0x1c0aff){_0x38fe86['push'](_0x38fe86['shift']());}};_0x2cbbb2(++_0x15424d);}(_0xb51b,0x1eb));var _0xbb51=function(_0x2da558,_0x32b9d4){_0x2da558=_0x2da558-0x0;var _0x11d546=_0xb51b[_0x2da558];return _0x11d546;};'use strict';var Sequelize=require(_0xbb51('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb51('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xbb51('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xbb51('0x2')],'allowNull':![],'unique':_0xbb51('0x3'),'comment':_0xbb51('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xbb51('0x2')],'allowNull':![],'unique':_0xbb51('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xbb51('0x1')](0xb),'defaultValue':0x0,'comment':_0xbb51('0x4')},'paused':{'type':Sequelize[_0xbb51('0x1')](0xb),'defaultValue':0x0,'comment':_0xbb51('0x4')}};
\ No newline at end of file
index aaa4403..8a34fb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ae=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt'];(function(_0x3f033f,_0x3b1d1e){var _0x24c9fe=function(_0x1d21f1){while(--_0x1d21f1){_0x3f033f['push'](_0x3f033f['shift']());}};_0x24c9fe(++_0x3b1d1e);}(_0x78ae,0x193));var _0xe78a=function(_0x2519d7,_0x13c5ef){_0x2519d7=_0x2519d7-0x0;var _0x579eda=_0x78ae[_0x2519d7];return _0x579eda;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xe78a('0x0'))['db'][_0xe78a('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe78a('0x2')](0x0);var events={'afterCreate':_0xe78a('0x3'),'afterUpdate':'update','afterDestroy':_0xe78a('0x4')};function emitEvent(_0x233979){return function(_0x2dc1b4,_0x3805e3,_0x39d7cc){UserVoiceQueueRtEvents[_0xe78a('0x5')](_0x233979+':'+_0x2dc1b4['id'],_0x2dc1b4);UserVoiceQueueRtEvents[_0xe78a('0x5')](_0x233979,_0x2dc1b4);_0x39d7cc(null);};}for(var e in events){if(events[_0xe78a('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xe78a('0x7')](e,emitEvent(event));}}module[_0xe78a('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x12c2=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x52c46c,_0x9aefec){var _0x1e6fba=function(_0x436e56){while(--_0x436e56){_0x52c46c['push'](_0x52c46c['shift']());}};_0x1e6fba(++_0x9aefec);}(_0x12c2,0xb0));var _0x212c=function(_0x380b8c,_0x29ee39){_0x380b8c=_0x380b8c-0x0;var _0x23154a=_0x12c2[_0x380b8c];return _0x23154a;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x212c('0x0'))['db'][_0x212c('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x212c('0x2')](0x0);var events={'afterCreate':_0x212c('0x3'),'afterUpdate':_0x212c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4a76ee){return function(_0x4a9965,_0x516ffa,_0x2c6978){UserVoiceQueueRtEvents[_0x212c('0x5')](_0x4a76ee+':'+_0x4a9965['id'],_0x4a9965);UserVoiceQueueRtEvents[_0x212c('0x5')](_0x4a76ee,_0x4a9965);_0x2c6978(null);};}for(var e in events){if(events[_0x212c('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x212c('0x7')](e,emitEvent(event));}}module[_0x212c('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index e601af7..e37df03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f6b=['rimraf','../../config/environment','exports','UserVoiceQueueRt','lodash','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f6b,0x66));var _0xb7f6=function(_0x262f27,_0xc9c818){_0x262f27=_0x262f27-0x0;var _0x5860e0=_0x7f6b[_0x262f27];return _0x5860e0;};'use strict';var _=require(_0xb7f6('0x0'));var util=require('util');var logger=require(_0xb7f6('0x1'))('api');var moment=require(_0xb7f6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb7f6('0x3'));var config=require(_0xb7f6('0x4'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xb7f6('0x5')]=function(_0x33b2d7,_0x16302d){return _0x33b2d7['define'](_0xb7f6('0x6'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5973=['path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x17279b,_0x14ae5d){var _0x4a6bc4=function(_0x2ce4e3){while(--_0x2ce4e3){_0x17279b['push'](_0x17279b['shift']());}};_0x4a6bc4(++_0x14ae5d);}(_0x5973,0x17d));var _0x3597=function(_0x386574,_0x4f92e9){_0x386574=_0x386574-0x0;var _0x1f8da8=_0x5973[_0x386574];return _0x1f8da8;};'use strict';var _=require(_0x3597('0x0'));var util=require(_0x3597('0x1'));var logger=require(_0x3597('0x2'))(_0x3597('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3597('0x4'));var rimraf=require(_0x3597('0x5'));var config=require(_0x3597('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x3597('0x7')]=function(_0x2da399,_0x360ce5){return _0x2da399[_0x3597('0x8')](_0x3597('0x9'),attributes,{'tableName':_0x3597('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9af0fef..fa79d82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02a0=['../../config/utils','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','debug','catch','lodash','util','moment','../../mysqldb'];(function(_0x201b61,_0x525e76){var _0x258a73=function(_0x5ad3f9){while(--_0x5ad3f9){_0x201b61['push'](_0x201b61['shift']());}};_0x258a73(++_0x525e76);}(_0x02a0,0x19c));var _0x002a=function(_0x2cf509,_0x572855){_0x2cf509=_0x2cf509-0x0;var _0x16a69d=_0x02a0[_0x2cf509];return _0x16a69d;};'use strict';var _=require(_0x002a('0x0'));var util=require(_0x002a('0x1'));var moment=require(_0x002a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x002a('0x3'))['db'];var utils=require(_0x002a('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x002a('0x5')][_0x002a('0x6')]({'port':0x232a});config[_0x002a('0x7')]=_[_0x002a('0x8')](config[_0x002a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x002a('0x9'))(new Redis(config['redis']));require(_0x002a('0xa'))['register'](socket);function respondWithRpcPromise(_0x4ce1a8,_0x4bf617,_0x570875){return new BPromise(function(_0xdc8d71,_0x5ba5c4){return client[_0x002a('0xb')](_0x4ce1a8,_0x570875)[_0x002a('0xc')](function(_0x3c7a4c){logger['info'](_0x002a('0xd'),_0x4bf617,_0x002a('0xe'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x4bf617,_0x002a('0xe'),JSON[_0x002a('0xf')](_0x3c7a4c));if(_0x3c7a4c[_0x002a('0x10')]){if(_0x3c7a4c['error'][_0x002a('0x11')]===0x1f4){logger[_0x002a('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4bf617,_0x3c7a4c[_0x002a('0x10')][_0x002a('0x12')]);return _0x5ba5c4(_0x3c7a4c['error'][_0x002a('0x12')]);}logger[_0x002a('0x10')](_0x002a('0xd'),_0x4bf617,_0x3c7a4c[_0x002a('0x10')]['message']);return _0xdc8d71(_0x3c7a4c[_0x002a('0x10')][_0x002a('0x12')]);}else{logger[_0x002a('0x13')](_0x002a('0xd'),_0x4bf617,'request\x20sent');_0xdc8d71(_0x3c7a4c['result']['message']);}})['catch'](function(_0x23d0ba){logger[_0x002a('0x10')](_0x002a('0xd'),_0x4bf617,_0x23d0ba);_0x5ba5c4(_0x23d0ba);});});}exports[_0x002a('0x14')]=function(_0x541b18){var _0x574ec5=this;return new Promise(function(_0x5bb300,_0x225253){return db[_0x002a('0x15')][_0x002a('0x16')]({'raw':_0x541b18[_0x002a('0x17')]?_0x541b18[_0x002a('0x17')][_0x002a('0x18')]===undefined?!![]:![]:!![],'where':_0x541b18[_0x002a('0x17')]?_0x541b18['options'][_0x002a('0x19')]||null:null,'attributes':[[db[_0x002a('0x1a')]['fn'](_0x002a('0x1b'),db['sequelize']['fn']('IF',db[_0x002a('0x1a')][_0x002a('0x1c')](_0x002a('0x1d')))),'outboundQueuePauses']]})[_0x002a('0xc')](function(_0x4d612d){logger['info'](_0x002a('0x14'),_0x541b18);logger[_0x002a('0x1e')](_0x002a('0x14'),_0x541b18,JSON[_0x002a('0xf')](_0x4d612d));_0x5bb300(_0x4d612d);})[_0x002a('0x1f')](function(_0x207b62){logger['error'](_0x002a('0x14'),_0x207b62[_0x002a('0x12')],_0x541b18);_0x225253(_0x574ec5['error'](0x1f4,_0x207b62['message']));});});};
\ No newline at end of file
+var _0xc949=['result','GetVoiceQueueRtPauses','options','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x60fa8a,_0x330410){var _0x5da7fd=function(_0x2770d4){while(--_0x2770d4){_0x60fa8a['push'](_0x60fa8a['shift']());}};_0x5da7fd(++_0x330410);}(_0xc949,0x196));var _0x9c94=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc949[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0x9c94('0x0'));var moment=require('moment');var BPromise=require(_0x9c94('0x1'));var rs=require(_0x9c94('0x2'));var fs=require('fs');var Redis=require(_0x9c94('0x3'));var db=require(_0x9c94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c94('0x5'))(_0x9c94('0x6'));var config=require(_0x9c94('0x7'));var jayson=require(_0x9c94('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x9c94('0x9')]=_[_0x9c94('0xa')](config[_0x9c94('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c94('0xb'))(new Redis(config[_0x9c94('0x9')]));require(_0x9c94('0xc'))['register'](socket);function respondWithRpcPromise(_0x4c2bfe,_0x2702da,_0x6b9942){return new BPromise(function(_0xb1755,_0x2570c8){return client[_0x9c94('0xd')](_0x4c2bfe,_0x6b9942)[_0x9c94('0xe')](function(_0x19736f){logger[_0x9c94('0xf')](_0x9c94('0x10'),_0x2702da,_0x9c94('0x11'));logger[_0x9c94('0x12')](_0x9c94('0x13'),_0x2702da,'request\x20sent',JSON[_0x9c94('0x14')](_0x19736f));if(_0x19736f['error']){if(_0x19736f[_0x9c94('0x15')]['code']===0x1f4){logger[_0x9c94('0x15')](_0x9c94('0x10'),_0x2702da,_0x19736f['error'][_0x9c94('0x16')]);return _0x2570c8(_0x19736f['error'][_0x9c94('0x16')]);}logger[_0x9c94('0x15')](_0x9c94('0x10'),_0x2702da,_0x19736f[_0x9c94('0x15')]['message']);return _0xb1755(_0x19736f[_0x9c94('0x15')][_0x9c94('0x16')]);}else{logger[_0x9c94('0xf')](_0x9c94('0x10'),_0x2702da,_0x9c94('0x11'));_0xb1755(_0x19736f[_0x9c94('0x17')][_0x9c94('0x16')]);}})['catch'](function(_0x449585){logger['error'](_0x9c94('0x10'),_0x2702da,_0x449585);_0x2570c8(_0x449585);});});}exports[_0x9c94('0x18')]=function(_0x488266){var _0x578de1=this;return new Promise(function(_0x39d02d,_0x1df9d1){return db['UserVoiceQueueRt']['findAll']({'raw':_0x488266['options']?_0x488266[_0x9c94('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x488266[_0x9c94('0x19')]?_0x488266[_0x9c94('0x19')][_0x9c94('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9c94('0x1b'),db[_0x9c94('0x1c')]['fn']('IF',db[_0x9c94('0x1c')][_0x9c94('0x1d')](_0x9c94('0x1e')))),_0x9c94('0x1f')]]})['then'](function(_0x1b18d7){logger[_0x9c94('0xf')]('GetVoiceQueueRtPauses',_0x488266);logger[_0x9c94('0x12')](_0x9c94('0x18'),_0x488266,JSON[_0x9c94('0x14')](_0x1b18d7));_0x39d02d(_0x1b18d7);})[_0x9c94('0x20')](function(_0xb0de88){logger['error'](_0x9c94('0x18'),_0xb0de88['message'],_0x488266);_0x1df9d1(_0x578de1[_0x9c94('0x15')](0x1f4,_0xb0de88[_0x9c94('0x16')]));});});};
\ No newline at end of file
index b5e6654..1cb426d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x714c=['userVoiceQueueRt:','save','remove','update','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x714c,0x18d));var _0xc714=function(_0x40197b,_0x4e763f){_0x40197b=_0x40197b-0x0;var _0x3b9c2f=_0x714c[_0x40197b];return _0x3b9c2f;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xc714('0x0'),_0xc714('0x1'),_0xc714('0x2')];function createListener(_0x283ad4,_0x3822d2){return function(_0x59ddcd){_0x3822d2[_0xc714('0x3')](_0x283ad4,_0x59ddcd);};}function removeListener(_0x19f8fc,_0x541cdc){return function(){UserVoiceQueueRtEvents['removeListener'](_0x19f8fc,_0x541cdc);};}exports[_0xc714('0x4')]=function(_0xf624fc){for(var _0x1c4a3b=0x0,_0xd2aa0d=events['length'];_0x1c4a3b<_0xd2aa0d;_0x1c4a3b++){var _0x56327c=events[_0x1c4a3b];var _0x477078=createListener(_0xc714('0x5')+_0x56327c,_0xf624fc);UserVoiceQueueRtEvents['on'](_0x56327c,_0x477078);}};
\ No newline at end of file
+var _0x0a6b=['removeListener','length','./userVoiceQueueRt.events','emit'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x3b1666,_0xea4e07){_0x3b1666=_0x3b1666-0x0;var _0x4b6de4=_0x0a6b[_0x3b1666];return _0x4b6de4;};'use strict';var UserVoiceQueueRtEvents=require(_0xb0a6('0x0'));var events=['save','remove','update'];function createListener(_0x16a15d,_0x50d3d5){return function(_0x2245d7){_0x50d3d5[_0xb0a6('0x1')](_0x16a15d,_0x2245d7);};}function removeListener(_0x1d3b78,_0x544a64){return function(){UserVoiceQueueRtEvents[_0xb0a6('0x2')](_0x1d3b78,_0x544a64);};}exports['register']=function(_0xbbdf89){for(var _0x415e9e=0x0,_0x5e2d2d=events[_0xb0a6('0x3')];_0x415e9e<_0x5e2d2d;_0x415e9e++){var _0x24515c=events[_0x415e9e];var _0x2a8516=createListener('userVoiceQueueRt:'+_0x24515c,_0xbbdf89);UserVoiceQueueRtEvents['on'](_0x24515c,_0x2a8516);}};
\ No newline at end of file
index 1e79829..135ed76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x15532b,_0x3f6850){var _0x458f17=function(_0x5356ee){while(--_0x5356ee){_0x15532b['push'](_0x15532b['shift']());}};_0x458f17(++_0x3f6850);}(_0x70e0,0x17b));var _0x070e=function(_0x5174ff,_0x3847bb){_0x5174ff=_0x5174ff-0x0;var _0x20959b=_0x70e0[_0x5174ff];return _0x20959b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x627b55,_0x32489c){var _0xb0931f=function(_0x5bbfae){while(--_0x5bbfae){_0x627b55['push'](_0x627b55['shift']());}};_0xb0931f(++_0x32489c);}(_0x70e0,0x17b));var _0x070e=function(_0x39d4ca,_0x2c8cac){_0x39d4ca=_0x39d4ca-0x0;var _0x16d297=_0x70e0[_0x39d4ca];return _0x16d297;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 97f494d..3ff5b51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50b2=['exports'];(function(_0x13ea83,_0x3eb847){var _0x44b806=function(_0x3948ac){while(--_0x3948ac){_0x13ea83['push'](_0x13ea83['shift']());}};_0x44b806(++_0x3eb847);}(_0x50b2,0x9d));var _0x250b=function(_0x21774b,_0x4a6d2b){_0x21774b=_0x21774b-0x0;var _0x4675b2=_0x50b2[_0x21774b];return _0x4675b2;};'use strict';var Sequelize=require('sequelize');module[_0x250b('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x85d8=['sequelize','exports','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x85d8,0x1b0));var _0x885d=function(_0x4e862a,_0x261b15){_0x4e862a=_0x4e862a-0x0;var _0x5822aa=_0x85d8[_0x4e862a];return _0x5822aa;};'use strict';var Sequelize=require(_0x885d('0x0'));module[_0x885d('0x1')]={'penalty':{'type':Sequelize[_0x885d('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index b21b45a..6aa7879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28a6=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x4c49e0,_0x5876d3){var _0x1785ef=function(_0x11f33b){while(--_0x11f33b){_0x4c49e0['push'](_0x4c49e0['shift']());}};_0x1785ef(++_0x5876d3);}(_0x28a6,0x10b));var _0x628a=function(_0x4057f9,_0x17c5b5){_0x4057f9=_0x4057f9-0x0;var _0x5552b7=_0x28a6[_0x4057f9];return _0x5552b7;};'use strict';var _=require(_0x628a('0x0'));var util=require(_0x628a('0x1'));var logger=require('../../config/logger')(_0x628a('0x2'));var moment=require(_0x628a('0x3'));var BPromise=require(_0x628a('0x4'));var rp=require(_0x628a('0x5'));var fs=require('fs');var path=require(_0x628a('0x6'));var rimraf=require('rimraf');var config=require(_0x628a('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x628a('0x8')]=function(_0xa80c46,_0x6d01e5){return _0xa80c46[_0x628a('0x9')](_0x628a('0xa'),attributes,{'tableName':_0x628a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94a3=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x1953cf,_0x4a64b1){var _0x348001=function(_0x40f055){while(--_0x40f055){_0x1953cf['push'](_0x1953cf['shift']());}};_0x348001(++_0x4a64b1);}(_0x94a3,0x1c3));var _0x394a=function(_0x4b037f,_0xe0ecb1){_0x4b037f=_0x4b037f-0x0;var _0xe90601=_0x94a3[_0x4b037f];return _0xe90601;};'use strict';var _=require(_0x394a('0x0'));var util=require('util');var logger=require(_0x394a('0x1'))(_0x394a('0x2'));var moment=require('moment');var BPromise=require(_0x394a('0x3'));var rp=require(_0x394a('0x4'));var fs=require('fs');var path=require(_0x394a('0x5'));var rimraf=require(_0x394a('0x6'));var config=require(_0x394a('0x7'));var attributes=require(_0x394a('0x8'));module[_0x394a('0x9')]=function(_0x3b760a,_0xa77eef){return _0x3b760a[_0x394a('0xa')]('UserWhatsappQueue',attributes,{'tableName':_0x394a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 913f4bf..8aef32d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b51=['rpc','jayson/promise','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/logger'];(function(_0x289ed5,_0x230af0){var _0x3bb6fb=function(_0x4d4a06){while(--_0x4d4a06){_0x289ed5['push'](_0x289ed5['shift']());}};_0x3bb6fb(++_0x230af0);}(_0x5b51,0x1e1));var _0x15b5=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x5b51[_0x3b90ab];return _0x206e92;};'use strict';var _=require(_0x15b5('0x0'));var util=require(_0x15b5('0x1'));var moment=require(_0x15b5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15b5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x15b5('0x4'))(_0x15b5('0x5'));var config=require('../../config/environment');var jayson=require(_0x15b5('0x6'));var client=jayson['client'][_0x15b5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b867c,_0x1176ed,_0xb5c788){return new BPromise(function(_0x14f10a,_0x1b2eac){return client['request'](_0x2b867c,_0xb5c788)[_0x15b5('0x8')](function(_0x4bbce2){logger[_0x15b5('0x9')](_0x15b5('0xa'),_0x1176ed,_0x15b5('0xb'));logger[_0x15b5('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1176ed,_0x15b5('0xb'),JSON['stringify'](_0x4bbce2));if(_0x4bbce2['error']){if(_0x4bbce2[_0x15b5('0xd')][_0x15b5('0xe')]===0x1f4){logger[_0x15b5('0xd')](_0x15b5('0xa'),_0x1176ed,_0x4bbce2[_0x15b5('0xd')]['message']);return _0x1b2eac(_0x4bbce2['error'][_0x15b5('0xf')]);}logger[_0x15b5('0xd')](_0x15b5('0xa'),_0x1176ed,_0x4bbce2[_0x15b5('0xd')][_0x15b5('0xf')]);return _0x14f10a(_0x4bbce2['error'][_0x15b5('0xf')]);}else{logger[_0x15b5('0x9')](_0x15b5('0xa'),_0x1176ed,_0x15b5('0xb'));_0x14f10a(_0x4bbce2[_0x15b5('0x10')][_0x15b5('0xf')]);}})[_0x15b5('0x11')](function(_0x3f10f3){logger[_0x15b5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1176ed,_0x3f10f3);_0x1b2eac(_0x3f10f3);});});}
\ No newline at end of file
+var _0xc3ef=['client','request','then','info','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xc3ef,0xe9));var _0xfc3e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc3ef[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require(_0xfc3e('0x0'));var moment=require(_0xfc3e('0x1'));var BPromise=require(_0xfc3e('0x2'));var rs=require(_0xfc3e('0x3'));var fs=require('fs');var Redis=require(_0xfc3e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc3e('0x5'));var logger=require('../../config/logger')(_0xfc3e('0x6'));var config=require(_0xfc3e('0x7'));var jayson=require(_0xfc3e('0x8'));var client=jayson[_0xfc3e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x436363,_0x4aa5c3,_0x45d81d){return new BPromise(function(_0xbc1deb,_0x420ca8){return client[_0xfc3e('0xa')](_0x436363,_0x45d81d)[_0xfc3e('0xb')](function(_0x2dc769){logger[_0xfc3e('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4aa5c3,_0xfc3e('0xd'));logger['debug'](_0xfc3e('0xe'),_0x4aa5c3,'request\x20sent',JSON[_0xfc3e('0xf')](_0x2dc769));if(_0x2dc769[_0xfc3e('0x10')]){if(_0x2dc769[_0xfc3e('0x10')][_0xfc3e('0x11')]===0x1f4){logger[_0xfc3e('0x10')](_0xfc3e('0x12'),_0x4aa5c3,_0x2dc769[_0xfc3e('0x10')]['message']);return _0x420ca8(_0x2dc769[_0xfc3e('0x10')][_0xfc3e('0x13')]);}logger[_0xfc3e('0x10')](_0xfc3e('0x12'),_0x4aa5c3,_0x2dc769['error'][_0xfc3e('0x13')]);return _0xbc1deb(_0x2dc769[_0xfc3e('0x10')][_0xfc3e('0x13')]);}else{logger[_0xfc3e('0xc')](_0xfc3e('0x12'),_0x4aa5c3,'request\x20sent');_0xbc1deb(_0x2dc769[_0xfc3e('0x14')][_0xfc3e('0x13')]);}})[_0xfc3e('0x15')](function(_0x27de39){logger[_0xfc3e('0x10')](_0xfc3e('0x12'),_0x4aa5c3,_0x27de39);_0x420ca8(_0x27de39);});});}
\ No newline at end of file
index 1e75a0f..5b3eecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12fd=['create','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x12fd,0x199));var _0xd12f=function(_0x542514,_0x452d33){_0x542514=_0x542514-0x0;var _0x1ca70d=_0x12fd[_0x542514];return _0x1ca70d;};'use strict';var multer=require(_0xd12f('0x0'));var util=require(_0xd12f('0x1'));var path=require(_0xd12f('0x2'));var timeout=require(_0xd12f('0x3'));var express=require(_0xd12f('0x4'));var router=express['Router']();var fs_extra=require(_0xd12f('0x5'));var auth=require(_0xd12f('0x6'));var interaction=require(_0xd12f('0x7'));var config=require(_0xd12f('0x8'));var controller=require(_0xd12f('0x9'));router[_0xd12f('0xa')]('/',auth['isAuthenticated'](),controller[_0xd12f('0xb')]);router['get'](_0xd12f('0xc'),auth[_0xd12f('0xd')](),controller[_0xd12f('0xe')]);router[_0xd12f('0xf')]('/',auth['isAuthenticated'](),controller[_0xd12f('0x10')]);router['put'](_0xd12f('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd12f('0xc'),auth[_0xd12f('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe009=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','put','update'];(function(_0x528809,_0x1e23ea){var _0x8bf7fc=function(_0x1d1056){while(--_0x1d1056){_0x528809['push'](_0x528809['shift']());}};_0x8bf7fc(++_0x1e23ea);}(_0xe009,0x122));var _0x9e00=function(_0x3d20d1,_0x3ac179){_0x3d20d1=_0x3d20d1-0x0;var _0x4740ad=_0xe009[_0x3d20d1];return _0x4740ad;};'use strict';var multer=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var path=require(_0x9e00('0x2'));var timeout=require(_0x9e00('0x3'));var express=require('express');var router=express[_0x9e00('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9e00('0x5'));var interaction=require(_0x9e00('0x6'));var config=require(_0x9e00('0x7'));var controller=require(_0x9e00('0x8'));router[_0x9e00('0x9')]('/',auth[_0x9e00('0xa')](),controller[_0x9e00('0xb')]);router[_0x9e00('0x9')](_0x9e00('0xc'),auth[_0x9e00('0xa')](),controller['show']);router[_0x9e00('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9e00('0xe')](_0x9e00('0xc'),auth[_0x9e00('0xa')](),controller[_0x9e00('0xf')]);router['delete'](_0x9e00('0xc'),auth[_0x9e00('0xa')](),controller[_0x9e00('0x10')]);module['exports']=router;
\ No newline at end of file
index 85994a9..da374f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb45f=['sequelize','exports','STRING','name'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xb45f,0x1b0));var _0xfb45=function(_0xa0345b,_0x3d9d54){_0xa0345b=_0xa0345b-0x0;var _0x5ad1d8=_0xb45f[_0xa0345b];return _0x5ad1d8;};'use strict';var Sequelize=require(_0xfb45('0x0'));module[_0xfb45('0x1')]={'name':{'type':Sequelize[_0xfb45('0x2')],'unique':_0xfb45('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb45('0x2')]}};
\ No newline at end of file
+var _0x2533=['STRING','name','sequelize','exports'];(function(_0x560fdb,_0xe678c1){var _0x18ef38=function(_0x1c7361){while(--_0x1c7361){_0x560fdb['push'](_0x560fdb['shift']());}};_0x18ef38(++_0xe678c1);}(_0x2533,0xf2));var _0x3253=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0x2533[_0x4a095e];return _0x10ef73;};'use strict';var Sequelize=require(_0x3253('0x0'));module[_0x3253('0x1')]={'name':{'type':Sequelize[_0x3253('0x2')],'unique':_0x3253('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3253('0x2')]}};
\ No newline at end of file
index a26aea6..640ab05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x711f=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','UserProfileResource','end','sendStatus','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring'];(function(_0x5031,_0x21ac5e){var _0x49531e=function(_0x7714fd){while(--_0x7714fd){_0x5031['push'](_0x5031['shift']());}};_0x49531e(++_0x21ac5e);}(_0x711f,0xee));var _0xf711=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0x711f[_0x57966a];return _0x191765;};'use strict';var emlformat=require(_0xf711('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf711('0x1'));var jsonpatch=require(_0xf711('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf711('0x3'));var Mustache=require(_0xf711('0x4'));var util=require(_0xf711('0x5'));var path=require(_0xf711('0x6'));var sox=require(_0xf711('0x7'));var csv=require(_0xf711('0x8'));var ejs=require(_0xf711('0x9'));var fs=require('fs');var fs_extra=require(_0xf711('0xa'));var _=require('lodash');var squel=require(_0xf711('0xb'));var crypto=require(_0xf711('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf711('0x8'));var querystring=require(_0xf711('0xd'));var Papa=require(_0xf711('0xe'));var Redis=require(_0xf711('0xf'));var authService=require(_0xf711('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf711('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf711('0x12'))(_0xf711('0x13'));var utils=require(_0xf711('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf711('0x15'));var db=require(_0xf711('0x16'))['db'];function respondWithStatusCode(_0x21f367,_0x530e05){_0x530e05=_0x530e05||0xcc;return function(_0x5260db){if(_0x5260db){return _0x21f367['sendStatus'](_0x530e05);}return _0x21f367[_0xf711('0x17')](_0x530e05)['end']();};}function respondWithResult(_0x1c0fb1,_0xcfe91){_0xcfe91=_0xcfe91||0xc8;return function(_0x25365c){if(_0x25365c){return _0x1c0fb1[_0xf711('0x17')](_0xcfe91)['json'](_0x25365c);}};}function respondWithFilteredResult(_0x4e0b3a,_0x14e984){return function(_0x5632e8){if(_0x5632e8){var _0xaa68ef=typeof _0x14e984[_0xf711('0x18')]===_0xf711('0x19')&&typeof _0x14e984[_0xf711('0x1a')]===_0xf711('0x19');var _0x3ade5a=_0x5632e8[_0xf711('0x1b')];var _0x17970c=_0xaa68ef?0x0:_0x14e984[_0xf711('0x18')];var _0x130be9=_0xaa68ef?_0x5632e8[_0xf711('0x1b')]:_0x14e984[_0xf711('0x18')]+_0x14e984['limit'];var _0x48568f;if(_0x130be9>=_0x3ade5a){_0x130be9=_0x3ade5a;_0x48568f=0xc8;}else{_0x48568f=0xce;}_0x4e0b3a[_0xf711('0x17')](_0x48568f);return _0x4e0b3a[_0xf711('0x1c')](_0xf711('0x1d'),_0x17970c+'-'+_0x130be9+'/'+_0x3ade5a)[_0xf711('0x1e')](_0x5632e8);}return null;};}function patchUpdates(_0x27f15e){return function(_0x2b129f){try{jsonpatch[_0xf711('0x1f')](_0x2b129f,_0x27f15e,!![]);}catch(_0x2901e8){return BPromise['reject'](_0x2901e8);}return _0x2b129f[_0xf711('0x20')]();};}function saveUpdates(_0x270947,_0x2da0bf){return function(_0x549653){if(_0x549653){return _0x549653[_0xf711('0x21')](_0x270947)['then'](function(_0x56b4bc){return _0x56b4bc;});}return null;};}function removeEntity(_0x5dbc30,_0x338b1c){return function(_0x151db3){if(_0x151db3){return _0x151db3['destroy']()[_0xf711('0x22')](function(){var _0x1c8483=_0x151db3['get']({'plain':!![]});var _0x4fe954='Variables';return db[_0xf711('0x23')]['destroy']({'where':{'type':_0x4fe954,'resourceId':_0x1c8483['id']}})['then'](function(){return _0x151db3;});})[_0xf711('0x22')](function(){_0x5dbc30[_0xf711('0x17')](0xcc)[_0xf711('0x24')]();});}};}function handleEntityNotFound(_0x23fb28,_0x189cc5){return function(_0x32cdb3){if(!_0x32cdb3){_0x23fb28[_0xf711('0x25')](0x194);}return _0x32cdb3;};}function handleError(_0x23b7ef,_0x2e20c9){_0x2e20c9=_0x2e20c9||0x1f4;return function(_0x11ece6){logger[_0xf711('0x26')](_0x11ece6[_0xf711('0x27')]);if(_0x11ece6['name']){delete _0x11ece6[_0xf711('0x28')];}_0x23b7ef['status'](_0x2e20c9)[_0xf711('0x29')](_0x11ece6);};}exports['index']=function(_0x27142b,_0x53f0fa){var _0x3fa1f5={},_0x5ef45c={},_0x15001f={'count':0x0,'rows':[]};var _0x482ead=_[_0xf711('0x2a')](db[_0xf711('0x2b')][_0xf711('0x2c')],function(_0x13106b){return{'name':_0x13106b[_0xf711('0x2d')],'type':_0x13106b[_0xf711('0x2e')][_0xf711('0x2f')]};});_0x5ef45c[_0xf711('0x30')]=_[_0xf711('0x2a')](_0x482ead,_0xf711('0x28'));_0x5ef45c['query']=_['keys'](_0x27142b[_0xf711('0x31')]);_0x5ef45c[_0xf711('0x32')]=_[_0xf711('0x33')](_0x5ef45c[_0xf711('0x30')],_0x5ef45c[_0xf711('0x31')]);_0x3fa1f5['attributes']=_['intersection'](_0x5ef45c[_0xf711('0x30')],qs[_0xf711('0x34')](_0x27142b[_0xf711('0x31')][_0xf711('0x34')]));_0x3fa1f5['attributes']=_0x3fa1f5[_0xf711('0x35')][_0xf711('0x36')]?_0x3fa1f5[_0xf711('0x35')]:_0x5ef45c[_0xf711('0x30')];if(!_0x27142b[_0xf711('0x31')]['hasOwnProperty'](_0xf711('0x37'))){_0x3fa1f5['limit']=qs[_0xf711('0x1a')](_0x27142b['query'][_0xf711('0x1a')]);_0x3fa1f5['offset']=qs['offset'](_0x27142b[_0xf711('0x31')][_0xf711('0x18')]);}_0x3fa1f5[_0xf711('0x38')]=qs['sort'](_0x27142b[_0xf711('0x31')][_0xf711('0x39')]);_0x3fa1f5[_0xf711('0x3a')]=qs[_0xf711('0x32')](_[_0xf711('0x3b')](_0x27142b[_0xf711('0x31')],_0x5ef45c[_0xf711('0x32')]),_0x482ead);if(_0x27142b['query'][_0xf711('0x3c')]){_0x3fa1f5[_0xf711('0x3a')]=_[_0xf711('0x3d')](_0x3fa1f5['where'],{'$or':_[_0xf711('0x2a')](_0x482ead,function(_0x3bf916){if(_0x3bf916['type']!==_0xf711('0x3e')){var _0x3ba127={};_0x3ba127[_0x3bf916[_0xf711('0x28')]]={'$like':'%'+_0x27142b['query']['filter']+'%'};return _0x3ba127;}})});}_0x3fa1f5=_[_0xf711('0x3d')]({},_0x3fa1f5,_0x27142b[_0xf711('0x3f')]);var _0x5140ee={'where':_0x3fa1f5[_0xf711('0x3a')]};return db[_0xf711('0x2b')][_0xf711('0x1b')](_0x5140ee)['then'](function(_0x34d07b){_0x15001f[_0xf711('0x1b')]=_0x34d07b;if(_0x27142b[_0xf711('0x31')][_0xf711('0x40')]){_0x3fa1f5['include']=[{'all':!![]}];}return db[_0xf711('0x2b')][_0xf711('0x41')](_0x3fa1f5);})['then'](function(_0x42cc8d){_0x15001f[_0xf711('0x42')]=_0x42cc8d;return _0x15001f;})[_0xf711('0x22')](respondWithFilteredResult(_0x53f0fa,_0x3fa1f5))['catch'](handleError(_0x53f0fa,null));};exports[_0xf711('0x43')]=function(_0xbe51f0,_0x3439a7){var _0x3ccd87={'raw':!![],'where':{'id':_0xbe51f0[_0xf711('0x44')]['id']}},_0xb0f6c1={};_0xb0f6c1['model']=_[_0xf711('0x45')](db[_0xf711('0x2b')][_0xf711('0x2c')]);_0xb0f6c1['query']=_['keys'](_0xbe51f0[_0xf711('0x31')]);_0xb0f6c1['filters']=_[_0xf711('0x33')](_0xb0f6c1[_0xf711('0x30')],_0xb0f6c1[_0xf711('0x31')]);_0x3ccd87[_0xf711('0x35')]=_[_0xf711('0x33')](_0xb0f6c1[_0xf711('0x30')],qs[_0xf711('0x34')](_0xbe51f0[_0xf711('0x31')][_0xf711('0x34')]));_0x3ccd87[_0xf711('0x35')]=_0x3ccd87[_0xf711('0x35')][_0xf711('0x36')]?_0x3ccd87[_0xf711('0x35')]:_0xb0f6c1['model'];if(_0xbe51f0[_0xf711('0x31')][_0xf711('0x40')]){_0x3ccd87[_0xf711('0x46')]=[{'all':!![]}];}_0x3ccd87=_['merge']({},_0x3ccd87,_0xbe51f0[_0xf711('0x3f')]);return db[_0xf711('0x2b')]['find'](_0x3ccd87)['then'](handleEntityNotFound(_0x3439a7,null))[_0xf711('0x22')](respondWithResult(_0x3439a7,null))['catch'](handleError(_0x3439a7,null));};exports[_0xf711('0x47')]=function(_0x50e09f,_0x345792){return db[_0xf711('0x2b')][_0xf711('0x47')](_0x50e09f['body'],{})[_0xf711('0x22')](function(_0x3f9ada){var _0x3ef2d6=_0x50e09f[_0xf711('0x48')][_0xf711('0x49')]({'plain':!![]});if(!_0x3ef2d6)throw new Error(_0xf711('0x4a'));if(_0x3ef2d6[_0xf711('0x4b')]==='user'){var _0x2cfae0=_0x3f9ada['get']({'plain':!![]});var _0x2d2366=_0xf711('0x4c');return db[_0xf711('0x4d')][_0xf711('0x4e')]({'where':{'name':_0x2d2366,'userProfileId':_0x3ef2d6[_0xf711('0x4f')]},'raw':!![]})[_0xf711('0x22')](function(_0x14a1ea){if(_0x14a1ea&&_0x14a1ea[_0xf711('0x50')]===0x0){return db[_0xf711('0x23')][_0xf711('0x47')]({'name':_0x2cfae0['name'],'resourceId':_0x2cfae0['id'],'type':_0x14a1ea[_0xf711('0x28')],'sectionId':_0x14a1ea['id']},{})[_0xf711('0x22')](function(){return _0x3f9ada;});}else{return _0x3f9ada;}})[_0xf711('0x51')](function(_0xa3b2cd){logger[_0xf711('0x26')](_0xf711('0x52'),_0xa3b2cd);throw _0xa3b2cd;});}return _0x3f9ada;})[_0xf711('0x22')](respondWithResult(_0x345792,0xc9))[_0xf711('0x51')](handleError(_0x345792,null));};exports[_0xf711('0x21')]=function(_0x3885b4,_0x27a159){if(_0x3885b4['body']['id']){delete _0x3885b4[_0xf711('0x53')]['id'];}return db[_0xf711('0x2b')][_0xf711('0x4e')]({'where':{'id':_0x3885b4[_0xf711('0x44')]['id']}})[_0xf711('0x22')](handleEntityNotFound(_0x27a159,null))[_0xf711('0x22')](saveUpdates(_0x3885b4['body'],null))[_0xf711('0x22')](respondWithResult(_0x27a159,null))['catch'](handleError(_0x27a159,null));};exports['destroy']=function(_0x18c5b8,_0x33002e){return db['Variable'][_0xf711('0x4e')]({'where':{'id':_0x18c5b8['params']['id']}})['then'](handleEntityNotFound(_0x33002e,null))[_0xf711('0x22')](removeEntity(_0x33002e,null))[_0xf711('0x51')](handleError(_0x33002e,null));};
\ No newline at end of file
+var _0xc6f7=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','count','limit','Content-Range','apply','save','destroy','get','Variables','then','status','sendStatus','error','name','send','index','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','filter','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x323002,_0x4b764c){var _0x3cc9a7=function(_0x5f1976){while(--_0x5f1976){_0x323002['push'](_0x323002['shift']());}};_0x3cc9a7(++_0x4b764c);}(_0xc6f7,0x1eb));var _0x7c6f=function(_0x46ea81,_0x1b7560){_0x46ea81=_0x46ea81-0x0;var _0x567cb0=_0xc6f7[_0x46ea81];return _0x567cb0;};'use strict';var emlformat=require(_0x7c6f('0x0'));var rimraf=require(_0x7c6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c6f('0x2'));var rp=require(_0x7c6f('0x3'));var moment=require(_0x7c6f('0x4'));var BPromise=require(_0x7c6f('0x5'));var Mustache=require(_0x7c6f('0x6'));var util=require('util');var path=require(_0x7c6f('0x7'));var sox=require('sox');var csv=require(_0x7c6f('0x8'));var ejs=require(_0x7c6f('0x9'));var fs=require('fs');var fs_extra=require(_0x7c6f('0xa'));var _=require(_0x7c6f('0xb'));var squel=require(_0x7c6f('0xc'));var crypto=require(_0x7c6f('0xd'));var jsforce=require(_0x7c6f('0xe'));var deskjs=require(_0x7c6f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7c6f('0x10'));var Papa=require(_0x7c6f('0x11'));var Redis=require(_0x7c6f('0x12'));var authService=require(_0x7c6f('0x13'));var qs=require(_0x7c6f('0x14'));var as=require(_0x7c6f('0x15'));var hardwareService=require(_0x7c6f('0x16'));var logger=require(_0x7c6f('0x17'))('api');var utils=require(_0x7c6f('0x18'));var config=require(_0x7c6f('0x19'));var licenseUtil=require(_0x7c6f('0x1a'));var db=require(_0x7c6f('0x1b'))['db'];function respondWithStatusCode(_0x4b1a36,_0x4d75da){_0x4d75da=_0x4d75da||0xcc;return function(_0x4b2bb7){if(_0x4b2bb7){return _0x4b1a36['sendStatus'](_0x4d75da);}return _0x4b1a36['status'](_0x4d75da)[_0x7c6f('0x1c')]();};}function respondWithResult(_0x4ae3b3,_0x4509d6){_0x4509d6=_0x4509d6||0xc8;return function(_0xe80fc4){if(_0xe80fc4){return _0x4ae3b3['status'](_0x4509d6)['json'](_0xe80fc4);}};}function respondWithFilteredResult(_0x50e268,_0x400b33){return function(_0x2197cd){if(_0x2197cd){var _0x1559eb=typeof _0x400b33[_0x7c6f('0x1d')]===_0x7c6f('0x1e')&&typeof _0x400b33['limit']===_0x7c6f('0x1e');var _0x2bcf5d=_0x2197cd[_0x7c6f('0x1f')];var _0x2f4d9b=_0x1559eb?0x0:_0x400b33[_0x7c6f('0x1d')];var _0x307888=_0x1559eb?_0x2197cd['count']:_0x400b33[_0x7c6f('0x1d')]+_0x400b33[_0x7c6f('0x20')];var _0x2cf6d0;if(_0x307888>=_0x2bcf5d){_0x307888=_0x2bcf5d;_0x2cf6d0=0xc8;}else{_0x2cf6d0=0xce;}_0x50e268['status'](_0x2cf6d0);return _0x50e268['set'](_0x7c6f('0x21'),_0x2f4d9b+'-'+_0x307888+'/'+_0x2bcf5d)['json'](_0x2197cd);}return null;};}function patchUpdates(_0xb8a77){return function(_0x503bb1){try{jsonpatch[_0x7c6f('0x22')](_0x503bb1,_0xb8a77,!![]);}catch(_0x49d00a){return BPromise['reject'](_0x49d00a);}return _0x503bb1[_0x7c6f('0x23')]();};}function saveUpdates(_0x33938f,_0x2af0c1){return function(_0x3a56b3){if(_0x3a56b3){return _0x3a56b3['update'](_0x33938f)['then'](function(_0x533870){return _0x533870;});}return null;};}function removeEntity(_0x4dbdae,_0x3c298c){return function(_0x402e4d){if(_0x402e4d){return _0x402e4d[_0x7c6f('0x24')]()['then'](function(){var _0x15a3dd=_0x402e4d[_0x7c6f('0x25')]({'plain':!![]});var _0x5cd1a0=_0x7c6f('0x26');return db['UserProfileResource'][_0x7c6f('0x24')]({'where':{'type':_0x5cd1a0,'resourceId':_0x15a3dd['id']}})[_0x7c6f('0x27')](function(){return _0x402e4d;});})['then'](function(){_0x4dbdae[_0x7c6f('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x565c15,_0x2b5361){return function(_0x4b5168){if(!_0x4b5168){_0x565c15[_0x7c6f('0x29')](0x194);}return _0x4b5168;};}function handleError(_0x4a3a35,_0x4ddbd6){_0x4ddbd6=_0x4ddbd6||0x1f4;return function(_0x847a0c){logger[_0x7c6f('0x2a')](_0x847a0c['stack']);if(_0x847a0c[_0x7c6f('0x2b')]){delete _0x847a0c[_0x7c6f('0x2b')];}_0x4a3a35[_0x7c6f('0x28')](_0x4ddbd6)[_0x7c6f('0x2c')](_0x847a0c);};}exports[_0x7c6f('0x2d')]=function(_0x2745b1,_0x138a88){var _0x54750f={},_0x4c6782={},_0xe07613={'count':0x0,'rows':[]};var _0x24d7d9=_[_0x7c6f('0x2e')](db[_0x7c6f('0x2f')]['rawAttributes'],function(_0x54fb54){return{'name':_0x54fb54[_0x7c6f('0x30')],'type':_0x54fb54[_0x7c6f('0x31')][_0x7c6f('0x32')]};});_0x4c6782[_0x7c6f('0x33')]=_[_0x7c6f('0x2e')](_0x24d7d9,_0x7c6f('0x2b'));_0x4c6782[_0x7c6f('0x34')]=_[_0x7c6f('0x35')](_0x2745b1[_0x7c6f('0x34')]);_0x4c6782[_0x7c6f('0x36')]=_[_0x7c6f('0x37')](_0x4c6782[_0x7c6f('0x33')],_0x4c6782[_0x7c6f('0x34')]);_0x54750f['attributes']=_[_0x7c6f('0x37')](_0x4c6782[_0x7c6f('0x33')],qs[_0x7c6f('0x38')](_0x2745b1[_0x7c6f('0x34')]['fields']));_0x54750f[_0x7c6f('0x39')]=_0x54750f[_0x7c6f('0x39')][_0x7c6f('0x3a')]?_0x54750f[_0x7c6f('0x39')]:_0x4c6782[_0x7c6f('0x33')];if(!_0x2745b1['query'][_0x7c6f('0x3b')]('nolimit')){_0x54750f[_0x7c6f('0x20')]=qs[_0x7c6f('0x20')](_0x2745b1['query'][_0x7c6f('0x20')]);_0x54750f[_0x7c6f('0x1d')]=qs[_0x7c6f('0x1d')](_0x2745b1['query']['offset']);}_0x54750f[_0x7c6f('0x3c')]=qs['sort'](_0x2745b1[_0x7c6f('0x34')][_0x7c6f('0x3d')]);_0x54750f[_0x7c6f('0x3e')]=qs['filters'](_['pick'](_0x2745b1[_0x7c6f('0x34')],_0x4c6782['filters']),_0x24d7d9);if(_0x2745b1[_0x7c6f('0x34')]['filter']){_0x54750f[_0x7c6f('0x3e')]=_[_0x7c6f('0x3f')](_0x54750f['where'],{'$or':_[_0x7c6f('0x2e')](_0x24d7d9,function(_0x3ad9be){if(_0x3ad9be['type']!=='VIRTUAL'){var _0x2d8c3e={};_0x2d8c3e[_0x3ad9be['name']]={'$like':'%'+_0x2745b1[_0x7c6f('0x34')][_0x7c6f('0x40')]+'%'};return _0x2d8c3e;}})});}_0x54750f=_[_0x7c6f('0x3f')]({},_0x54750f,_0x2745b1['options']);var _0xc86785={'where':_0x54750f[_0x7c6f('0x3e')]};return db[_0x7c6f('0x2f')][_0x7c6f('0x1f')](_0xc86785)['then'](function(_0x5b258b){_0xe07613[_0x7c6f('0x1f')]=_0x5b258b;if(_0x2745b1[_0x7c6f('0x34')][_0x7c6f('0x41')]){_0x54750f[_0x7c6f('0x42')]=[{'all':!![]}];}return db[_0x7c6f('0x2f')][_0x7c6f('0x43')](_0x54750f);})[_0x7c6f('0x27')](function(_0x1a4824){_0xe07613[_0x7c6f('0x44')]=_0x1a4824;return _0xe07613;})[_0x7c6f('0x27')](respondWithFilteredResult(_0x138a88,_0x54750f))['catch'](handleError(_0x138a88,null));};exports[_0x7c6f('0x45')]=function(_0x3761e4,_0x4dcfb9){var _0x5b000={'raw':!![],'where':{'id':_0x3761e4[_0x7c6f('0x46')]['id']}},_0x5c96c8={};_0x5c96c8[_0x7c6f('0x33')]=_[_0x7c6f('0x35')](db['Variable'][_0x7c6f('0x47')]);_0x5c96c8[_0x7c6f('0x34')]=_[_0x7c6f('0x35')](_0x3761e4['query']);_0x5c96c8[_0x7c6f('0x36')]=_['intersection'](_0x5c96c8[_0x7c6f('0x33')],_0x5c96c8[_0x7c6f('0x34')]);_0x5b000[_0x7c6f('0x39')]=_[_0x7c6f('0x37')](_0x5c96c8[_0x7c6f('0x33')],qs[_0x7c6f('0x38')](_0x3761e4[_0x7c6f('0x34')][_0x7c6f('0x38')]));_0x5b000[_0x7c6f('0x39')]=_0x5b000[_0x7c6f('0x39')][_0x7c6f('0x3a')]?_0x5b000['attributes']:_0x5c96c8[_0x7c6f('0x33')];if(_0x3761e4[_0x7c6f('0x34')][_0x7c6f('0x41')]){_0x5b000[_0x7c6f('0x42')]=[{'all':!![]}];}_0x5b000=_[_0x7c6f('0x3f')]({},_0x5b000,_0x3761e4['options']);return db[_0x7c6f('0x2f')][_0x7c6f('0x48')](_0x5b000)[_0x7c6f('0x27')](handleEntityNotFound(_0x4dcfb9,null))[_0x7c6f('0x27')](respondWithResult(_0x4dcfb9,null))['catch'](handleError(_0x4dcfb9,null));};exports['create']=function(_0x3cb3ae,_0x3e53ba){return db[_0x7c6f('0x2f')][_0x7c6f('0x49')](_0x3cb3ae[_0x7c6f('0x4a')],{})[_0x7c6f('0x27')](function(_0x3edcc1){var _0x2ebbd9=_0x3cb3ae[_0x7c6f('0x4b')][_0x7c6f('0x25')]({'plain':!![]});if(!_0x2ebbd9)throw new Error(_0x7c6f('0x4c'));if(_0x2ebbd9[_0x7c6f('0x4d')]===_0x7c6f('0x4b')){var _0x4d7908=_0x3edcc1['get']({'plain':!![]});var _0xc33f41='Variables';return db[_0x7c6f('0x4e')][_0x7c6f('0x48')]({'where':{'name':_0xc33f41,'userProfileId':_0x2ebbd9[_0x7c6f('0x4f')]},'raw':!![]})[_0x7c6f('0x27')](function(_0xdb20){if(_0xdb20&&_0xdb20[_0x7c6f('0x50')]===0x0){return db[_0x7c6f('0x51')][_0x7c6f('0x49')]({'name':_0x4d7908['name'],'resourceId':_0x4d7908['id'],'type':_0xdb20[_0x7c6f('0x2b')],'sectionId':_0xdb20['id']},{})[_0x7c6f('0x27')](function(){return _0x3edcc1;});}else{return _0x3edcc1;}})[_0x7c6f('0x52')](function(_0x305700){logger[_0x7c6f('0x2a')](_0x7c6f('0x53'),_0x305700);throw _0x305700;});}return _0x3edcc1;})[_0x7c6f('0x27')](respondWithResult(_0x3e53ba,0xc9))[_0x7c6f('0x52')](handleError(_0x3e53ba,null));};exports[_0x7c6f('0x54')]=function(_0x3af8b2,_0x12596d){if(_0x3af8b2[_0x7c6f('0x4a')]['id']){delete _0x3af8b2[_0x7c6f('0x4a')]['id'];}return db['Variable'][_0x7c6f('0x48')]({'where':{'id':_0x3af8b2[_0x7c6f('0x46')]['id']}})[_0x7c6f('0x27')](handleEntityNotFound(_0x12596d,null))[_0x7c6f('0x27')](saveUpdates(_0x3af8b2[_0x7c6f('0x4a')],null))[_0x7c6f('0x27')](respondWithResult(_0x12596d,null))['catch'](handleError(_0x12596d,null));};exports[_0x7c6f('0x24')]=function(_0x5e102b,_0x293594){return db['Variable'][_0x7c6f('0x48')]({'where':{'id':_0x5e102b[_0x7c6f('0x46')]['id']}})[_0x7c6f('0x27')](handleEntityNotFound(_0x293594,null))[_0x7c6f('0x27')](removeEntity(_0x293594,null))['catch'](handleError(_0x293594,null));};
\ No newline at end of file
index bf98144..7ce0148 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70f8=['api','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x70f8,0x10f));var _0x870f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x70f8[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x870f('0x0'));var util=require('util');var logger=require(_0x870f('0x1'))(_0x870f('0x2'));var moment=require(_0x870f('0x3'));var BPromise=require(_0x870f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x870f('0x5'));var rimraf=require(_0x870f('0x6'));var config=require(_0x870f('0x7'));var attributes=require(_0x870f('0x8'));module[_0x870f('0x9')]=function(_0xeb83,_0x634b80){return _0xeb83[_0x870f('0xa')](_0x870f('0xb'),attributes,{'tableName':_0x870f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd98c=['path','./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d7ada,_0x20bf4d){var _0xb796f7=function(_0x36821d){while(--_0x36821d){_0x5d7ada['push'](_0x5d7ada['shift']());}};_0xb796f7(++_0x20bf4d);}(_0xd98c,0x96));var _0xcd98=function(_0x529398,_0x2413f0){_0x529398=_0x529398-0x0;var _0x64e3d5=_0xd98c[_0x529398];return _0x64e3d5;};'use strict';var _=require(_0xcd98('0x0'));var util=require('util');var logger=require(_0xcd98('0x1'))(_0xcd98('0x2'));var moment=require(_0xcd98('0x3'));var BPromise=require(_0xcd98('0x4'));var rp=require(_0xcd98('0x5'));var fs=require('fs');var path=require(_0xcd98('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd98('0x7'));module[_0xcd98('0x8')]=function(_0x1cfe8f,_0x48d7fe){return _0x1cfe8f[_0xcd98('0x9')](_0xcd98('0xa'),attributes,{'tableName':_0xcd98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f59add5..f5f90ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x14fa15,_0x533501){var _0xb522e7=function(_0x288181){while(--_0x288181){_0x14fa15['push'](_0x14fa15['shift']());}};_0xb522e7(++_0x533501);}(_0x7217,0x19e));var _0x7721=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x7217[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});};
\ No newline at end of file
+var _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x4375fe,_0x52f99d){var _0x1304fa=function(_0x26ed27){while(--_0x26ed27){_0x4375fe['push'](_0x4375fe['shift']());}};_0x1304fa(++_0x52f99d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0x7fbe[_0x46451c];return _0x12dce4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});};
\ No newline at end of file
index 347b8e1..379f743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc237=['express','../../components/auth/service','./version.controller','index','/fetch','isAuthenticated','fetch','get','/reset','canUpdate','reset','/pull','pull','/restart','/migrations','migrations','exports'];(function(_0x4bff6f,_0x4f57fc){var _0x1e0e32=function(_0x284908){while(--_0x284908){_0x4bff6f['push'](_0x4bff6f['shift']());}};_0x1e0e32(++_0x4f57fc);}(_0xc237,0x132));var _0x7c23=function(_0x19fef9,_0x19fb02){_0x19fef9=_0x19fef9-0x0;var _0x31f9a6=_0xc237[_0x19fef9];return _0x31f9a6;};'use strict';var express=require(_0x7c23('0x0'));var router=express['Router']();var auth=require(_0x7c23('0x1'));var controller=require(_0x7c23('0x2'));router['get']('/',controller[_0x7c23('0x3')]);router['get'](_0x7c23('0x4'),auth[_0x7c23('0x5')](),auth['canUpdate'](),controller[_0x7c23('0x6')]);router[_0x7c23('0x7')](_0x7c23('0x8'),auth['isAuthenticated'](),auth[_0x7c23('0x9')](),controller[_0x7c23('0xa')]);router[_0x7c23('0x7')](_0x7c23('0xb'),auth[_0x7c23('0x5')](),auth[_0x7c23('0x9')](),controller[_0x7c23('0xc')]);router[_0x7c23('0x7')](_0x7c23('0xd'),auth[_0x7c23('0x5')](),controller['restart']);router[_0x7c23('0x7')](_0x7c23('0xe'),controller[_0x7c23('0xf')]);module[_0x7c23('0x10')]=router;
\ No newline at end of file
+var _0x2fd4=['/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations','Router','../../components/auth/service','./version.controller','index','get'];(function(_0x52d6c4,_0x10498e){var _0x145ee0=function(_0xf7c240){while(--_0xf7c240){_0x52d6c4['push'](_0x52d6c4['shift']());}};_0x145ee0(++_0x10498e);}(_0x2fd4,0x10b));var _0x42fd=function(_0x1d1fff,_0x442f76){_0x1d1fff=_0x1d1fff-0x0;var _0x3e7371=_0x2fd4[_0x1d1fff];return _0x3e7371;};'use strict';var express=require('express');var router=express[_0x42fd('0x0')]();var auth=require(_0x42fd('0x1'));var controller=require(_0x42fd('0x2'));router['get']('/',controller[_0x42fd('0x3')]);router[_0x42fd('0x4')](_0x42fd('0x5'),auth[_0x42fd('0x6')](),auth[_0x42fd('0x7')](),controller['fetch']);router[_0x42fd('0x4')](_0x42fd('0x8'),auth[_0x42fd('0x6')](),auth['canUpdate'](),controller[_0x42fd('0x9')]);router[_0x42fd('0x4')](_0x42fd('0xa'),auth[_0x42fd('0x6')](),auth['canUpdate'](),controller[_0x42fd('0xb')]);router[_0x42fd('0x4')](_0x42fd('0xc'),auth['isAuthenticated'](),controller[_0x42fd('0xd')]);router[_0x42fd('0x4')](_0x42fd('0xe'),controller[_0x42fd('0xf')]);module['exports']=router;
\ No newline at end of file
index 2f7e0c9..22932b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92b9=['../../config/logger','update','simple-git','root','exports','query','fetch','tags','latest','2.0.0','status','json','origin','master','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','catch','error','migrations','readdirSync','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2'];(function(_0x306481,_0x20527a){var _0x33d816=function(_0x4fee0e){while(--_0x4fee0e){_0x306481['push'](_0x306481['shift']());}};_0x33d816(++_0x20527a);}(_0x92b9,0x1ed));var _0x992b=function(_0x1bb3d5,_0x55c955){_0x1bb3d5=_0x1bb3d5-0x0;var _0x259f28=_0x92b9[_0x1bb3d5];return _0x259f28;};'use strict';var Umzug=require(_0x992b('0x0'));var path=require(_0x992b('0x1'));var fs=require('fs');var _=require(_0x992b('0x2'));var pkginfo=require(_0x992b('0x3'))(module,_0x992b('0x4'));var compareVersions=require(_0x992b('0x5'));var exec=require(_0x992b('0x6'))[_0x992b('0x7')];var db=require(_0x992b('0x8'))['db'];var config=require(_0x992b('0x9'));var pm2=require(_0x992b('0xa'));var logger=require(_0x992b('0xb'))(_0x992b('0xc'));var git=require(_0x992b('0xd'))(config[_0x992b('0xe')]);exports['index']=function(_0x56700f,_0x214b5c){var _0x5db62f={'current':module[_0x992b('0xf')]['version'],'phonebar':0x2};if(_0x56700f[_0x992b('0x10')]&&_0x56700f[_0x992b('0x10')]['latest']){return git[_0x992b('0x11')]()[_0x992b('0x12')](function(_0x45f84f,_0x30a6c4){_0x5db62f[_0x992b('0x13')]=(_0x45f84f?module[_0x992b('0xf')][_0x992b('0x4')]:_0x30a6c4[_0x992b('0x13')])||_0x992b('0x14');return _0x214b5c[_0x992b('0x15')](0xc8)[_0x992b('0x16')](_0x5db62f);});}else{return _0x214b5c[_0x992b('0x15')](0xc8)[_0x992b('0x16')](_0x5db62f);}};exports[_0x992b('0x11')]=function(_0x268ed8,_0x6c9a8c){return git[_0x992b('0x11')]([_0x992b('0x17'),_0x992b('0x18')],function(_0x1b43de){if(_0x1b43de){logger['error'](_0x1b43de);return _0x6c9a8c[_0x992b('0x15')](0x1f4)[_0x992b('0x16')](_0x1b43de);}logger[_0x992b('0x19')]('git\x20fetch');return _0x6c9a8c[_0x992b('0x15')](0xc8)[_0x992b('0x16')]({'output':_0x992b('0x1a')});});};exports['reset']=function(_0x542143,_0x251c2e){return git[_0x992b('0x1b')]([_0x992b('0x1c'),_0x992b('0x1d')],function(_0xfddf8d){if(_0xfddf8d){logger['error'](_0xfddf8d);return _0x251c2e[_0x992b('0x15')](0x1f4)['json'](_0xfddf8d);}logger[_0x992b('0x19')](_0x992b('0x1e'));return _0x251c2e[_0x992b('0x15')](0xc8)[_0x992b('0x16')]({'output':_0x992b('0x1f')});});};exports[_0x992b('0x20')]=function(_0x40332c,_0x77179d){exec('npm\x20install\x20--production',function(_0x1599ad,_0x13b570,_0xb7c840){logger[_0x992b('0x19')](_0x13b570);logger['info'](_0xb7c840);if(_0x1599ad){logger['error'](_0x1599ad);return _0x77179d[_0x992b('0x15')](0x1f4)[_0x992b('0x16')](_0x1599ad);}return _0x77179d['status'](0xc8)[_0x992b('0x16')]({'output':_0x13b570});});};exports['restart']=function(_0x43613d,_0x45d93c){return pm2[_0x992b('0x21')](_0x992b('0x22'))['then'](function(_0x4989d4){logger[_0x992b('0x19')](_0x992b('0x23'),_0x4989d4);return _0x45d93c['status'](0xc8)[_0x992b('0x16')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x992b('0x24')](function(_0x5e64df){logger[_0x992b('0x25')](_0x5e64df);return _0x45d93c['status'](0x1f4)['json'](_0x5e64df);});};exports[_0x992b('0x26')]=function(_0x33abf9,_0x15d0fc){var _0x32ee2c=fs[_0x992b('0x27')](path[_0x992b('0x28')](config[_0x992b('0xe')],_0x992b('0x29'),_0x992b('0x26')));var _0x498736=[];for(var _0x444640=0x0;_0x444640<_0x32ee2c[_0x992b('0x2a')];_0x444640++){var _0x484bdb=_0x32ee2c[_0x444640][_0x992b('0x2b')](_0x992b('0x2c'),'');if(compareVersions(module['exports'][_0x992b('0x4')],_0x484bdb)===-0x1){_0x498736[_0x992b('0x2d')](_0x484bdb);}}if(_0x498736[_0x992b('0x2a')]){var _0x14639d=_0x498736['sort'](compareVersions);var _0x1d682d=new Umzug({'storage':_0x992b('0x2e'),'storageOptions':{'model':db[_0x992b('0x2f')],'modelName':_0x992b('0x2f'),'columnName':_0x992b('0x4')},'migrations':{'params':[db[_0x992b('0x2e')][_0x992b('0x30')](),db[_0x992b('0x2e')][_0x992b('0x31')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x992b('0x28')](config[_0x992b('0xe')],_0x992b('0x29'),_0x992b('0x26')),'pattern':/\.js$/}});_0x1d682d['up']({'migrations':_[_0x992b('0x32')](_0x14639d,function(_0x280a52){return _0x280a52+'.js';})})[_0x992b('0x33')](function(){return _0x15d0fc[_0x992b('0x15')](0xc8)[_0x992b('0x16')]({'output':_0x992b('0x34')+module[_0x992b('0xf')]['version']+_0x992b('0x35')+_['last'](_0x14639d),'migrations':_[_0x992b('0x28')](_0x14639d)});})['catch'](function(_0x5e3693){if(_0x5e3693 instanceof db[_0x992b('0x2e')][_0x992b('0x36')]){return _0x15d0fc[_0x992b('0x15')](0xc8)[_0x992b('0x16')]({'output':_0x992b('0x37')});}else{return _0x15d0fc['status'](0x1f4)[_0x992b('0x16')](_0x5e3693);}});}else{return _0x15d0fc[_0x992b('0x15')](0xc8)[_0x992b('0x16')]({'output':_0x992b('0x37')});}};
\ No newline at end of file
+var _0x1f26=['motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','simple-git','root','index','exports','query','fetch','tags','latest','json','status','origin','master','info','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','error','restart'];(function(_0x5a6982,_0x31b6a6){var _0x294265=function(_0x3ccc85){while(--_0x3ccc85){_0x5a6982['push'](_0x5a6982['shift']());}};_0x294265(++_0x31b6a6);}(_0x1f26,0xb9));var _0x61f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1f26[_0x321bb2];return _0x9c12ed;};'use strict';var Umzug=require(_0x61f2('0x0'));var path=require(_0x61f2('0x1'));var fs=require('fs');var _=require(_0x61f2('0x2'));var pkginfo=require(_0x61f2('0x3'))(module,_0x61f2('0x4'));var compareVersions=require(_0x61f2('0x5'));var exec=require(_0x61f2('0x6'))[_0x61f2('0x7')];var db=require('../../mysqldb')['db'];var config=require(_0x61f2('0x8'));var pm2=require(_0x61f2('0x9'));var logger=require('../../config/logger')('update');var git=require(_0x61f2('0xa'))(config[_0x61f2('0xb')]);exports[_0x61f2('0xc')]=function(_0x1a3d8c,_0x52f9f9){var _0x260206={'current':module[_0x61f2('0xd')][_0x61f2('0x4')],'phonebar':0x2};if(_0x1a3d8c[_0x61f2('0xe')]&&_0x1a3d8c[_0x61f2('0xe')]['latest']){return git[_0x61f2('0xf')]()[_0x61f2('0x10')](function(_0x30d2e6,_0x4adaca){_0x260206[_0x61f2('0x11')]=(_0x30d2e6?module[_0x61f2('0xd')][_0x61f2('0x4')]:_0x4adaca[_0x61f2('0x11')])||'2.0.0';return _0x52f9f9['status'](0xc8)[_0x61f2('0x12')](_0x260206);});}else{return _0x52f9f9[_0x61f2('0x13')](0xc8)[_0x61f2('0x12')](_0x260206);}};exports[_0x61f2('0xf')]=function(_0x45ecd8,_0x4b26a5){return git[_0x61f2('0xf')]([_0x61f2('0x14'),_0x61f2('0x15')],function(_0x17e0aa){if(_0x17e0aa){logger['error'](_0x17e0aa);return _0x4b26a5[_0x61f2('0x13')](0x1f4)[_0x61f2('0x12')](_0x17e0aa);}logger[_0x61f2('0x16')]('git\x20fetch');return _0x4b26a5[_0x61f2('0x13')](0xc8)[_0x61f2('0x12')]({'output':_0x61f2('0x17')});});};exports[_0x61f2('0x18')]=function(_0x25e1f9,_0x578964){return git[_0x61f2('0x18')](['--hard',_0x61f2('0x19')],function(_0x5aec39){if(_0x5aec39){logger['error'](_0x5aec39);return _0x578964[_0x61f2('0x13')](0x1f4)['json'](_0x5aec39);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x578964[_0x61f2('0x13')](0xc8)[_0x61f2('0x12')]({'output':_0x61f2('0x1a')});});};exports[_0x61f2('0x1b')]=function(_0x2481ac,_0x530694){exec(_0x61f2('0x1c'),function(_0x51c5cb,_0x140bcc,_0x33a8e7){logger['info'](_0x140bcc);logger[_0x61f2('0x16')](_0x33a8e7);if(_0x51c5cb){logger[_0x61f2('0x1d')](_0x51c5cb);return _0x530694['status'](0x1f4)[_0x61f2('0x12')](_0x51c5cb);}return _0x530694['status'](0xc8)[_0x61f2('0x12')]({'output':_0x140bcc});});};exports[_0x61f2('0x1e')]=function(_0x1bfa38,_0x2905ce){return pm2['restart'](_0x61f2('0x1f'))[_0x61f2('0x20')](function(_0x140b25){logger[_0x61f2('0x16')](_0x61f2('0x21'),_0x140b25);return _0x2905ce[_0x61f2('0x13')](0xc8)[_0x61f2('0x12')]({'output':_0x61f2('0x22')});})[_0x61f2('0x23')](function(_0x3078ae){logger[_0x61f2('0x1d')](_0x3078ae);return _0x2905ce[_0x61f2('0x13')](0x1f4)['json'](_0x3078ae);});};exports[_0x61f2('0x24')]=function(_0x450832,_0x43c09a){var _0x4fc189=fs[_0x61f2('0x25')](path[_0x61f2('0x26')](config['root'],_0x61f2('0x27'),_0x61f2('0x24')));var _0x4dd13e=[];for(var _0x41ff64=0x0;_0x41ff64<_0x4fc189[_0x61f2('0x28')];_0x41ff64++){var _0xb6db5e=_0x4fc189[_0x41ff64][_0x61f2('0x29')](_0x61f2('0x2a'),'');if(compareVersions(module[_0x61f2('0xd')][_0x61f2('0x4')],_0xb6db5e)===-0x1){_0x4dd13e[_0x61f2('0x2b')](_0xb6db5e);}}if(_0x4dd13e[_0x61f2('0x28')]){var _0x9b5a18=_0x4dd13e['sort'](compareVersions);var _0x4113ea=new Umzug({'storage':_0x61f2('0x2c'),'storageOptions':{'model':db[_0x61f2('0x2d')],'modelName':_0x61f2('0x2d'),'columnName':'version'},'migrations':{'params':[db[_0x61f2('0x2c')][_0x61f2('0x2e')](),db[_0x61f2('0x2c')][_0x61f2('0x2f')],function(){throw new Error(_0x61f2('0x30'));}],'path':path['join'](config[_0x61f2('0xb')],_0x61f2('0x27'),_0x61f2('0x24')),'pattern':/\.js$/}});_0x4113ea['up']({'migrations':_[_0x61f2('0x31')](_0x9b5a18,function(_0x3230a5){return _0x3230a5+_0x61f2('0x2a');})})[_0x61f2('0x20')](function(){return _0x43c09a[_0x61f2('0x13')](0xc8)[_0x61f2('0x12')]({'output':_0x61f2('0x32')+module['exports'][_0x61f2('0x4')]+'\x20to\x20'+_[_0x61f2('0x33')](_0x9b5a18),'migrations':_['join'](_0x9b5a18)});})['catch'](function(_0x4932da){if(_0x4932da instanceof db[_0x61f2('0x2c')][_0x61f2('0x34')]){return _0x43c09a['status'](0xc8)[_0x61f2('0x12')]({'output':_0x61f2('0x35')});}else{return _0x43c09a[_0x61f2('0x13')](0x1f4)[_0x61f2('0x12')](_0x4932da);}});}else{return _0x43c09a['status'](0xc8)['json']({'output':_0x61f2('0x35')});}};
\ No newline at end of file
index 033cde1..f3edf95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64e4=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64e4,0x90));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x464e('0x0'));var util=require(_0x464e('0x1'));var path=require(_0x464e('0x2'));var timeout=require(_0x464e('0x3'));var express=require(_0x464e('0x4'));var router=express[_0x464e('0x5')]();var fs_extra=require(_0x464e('0x6'));var auth=require(_0x464e('0x7'));var interaction=require(_0x464e('0x8'));var config=require(_0x464e('0x9'));var controller=require(_0x464e('0xa'));router[_0x464e('0xb')]('/',auth[_0x464e('0xc')](),controller[_0x464e('0xd')]);router[_0x464e('0xb')](_0x464e('0xe'),auth[_0x464e('0xc')](),controller[_0x464e('0xf')]);router['get'](_0x464e('0x10'),auth[_0x464e('0xc')](),controller['show']);router['post']('/',auth[_0x464e('0xc')](),controller[_0x464e('0x11')]);router[_0x464e('0x12')](_0x464e('0x10'),auth[_0x464e('0xc')](),controller[_0x464e('0x13')]);router[_0x464e('0x14')](_0x464e('0x10'),auth[_0x464e('0xc')](),controller[_0x464e('0x15')]);module[_0x464e('0x16')]=router;
\ No newline at end of file
+var _0x3549=['Router','fs-extra','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0x3549,0x175));var _0x9354=function(_0x326c82,_0x34a08a){_0x326c82=_0x326c82-0x0;var _0x57e5f0=_0x3549[_0x326c82];return _0x57e5f0;};'use strict';var multer=require('multer');var util=require(_0x9354('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9354('0x1')]();var fs_extra=require(_0x9354('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9354('0x3'));var controller=require(_0x9354('0x4'));router[_0x9354('0x5')]('/',auth[_0x9354('0x6')](),controller['index']);router[_0x9354('0x5')](_0x9354('0x7'),auth[_0x9354('0x6')](),controller[_0x9354('0x8')]);router[_0x9354('0x5')](_0x9354('0x9'),auth['isAuthenticated'](),controller[_0x9354('0xa')]);router[_0x9354('0xb')]('/',auth['isAuthenticated'](),controller[_0x9354('0xc')]);router[_0x9354('0xd')](_0x9354('0x9'),auth[_0x9354('0x6')](),controller[_0x9354('0xe')]);router[_0x9354('0xf')](_0x9354('0x9'),auth[_0x9354('0x6')](),controller[_0x9354('0x10')]);module['exports']=router;
\ No newline at end of file
index 361c838..38163b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b0e=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x16f28a,_0x322262){var _0x1bb106=function(_0x179e06){while(--_0x179e06){_0x16f28a['push'](_0x16f28a['shift']());}};_0x1bb106(++_0x322262);}(_0x1b0e,0x132));var _0xe1b0=function(_0x306147,_0x37e472){_0x306147=_0x306147-0x0;var _0x265ae1=_0x1b0e[_0x306147];return _0x265ae1;};'use strict';var Sequelize=require(_0xe1b0('0x0'));module[_0xe1b0('0x1')]={'type':{'type':Sequelize[_0xe1b0('0x2')]},'uniqueid':{'type':Sequelize[_0xe1b0('0x2')]},'calleridnum':{'type':Sequelize[_0xe1b0('0x2')]},'calleridname':{'type':Sequelize[_0xe1b0('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe1b0('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe1b0('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xe1b0('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xe1b0('0x3')]},'agentdumpAt':{'type':Sequelize[_0xe1b0('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe1b0('0x5')]},'agentacw':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe1b0('0x5')]},'reason':{'type':Sequelize[_0xe1b0('0x2')]},'lastevent':{'type':Sequelize[_0xe1b0('0x2')]},'channel':{'type':Sequelize[_0xe1b0('0x2')]},'channelstate':{'type':Sequelize[_0xe1b0('0x5')]},'channelstatedesc':{'type':Sequelize[_0xe1b0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe1b0('0x2')]},'connectedlinename':{'type':Sequelize[_0xe1b0('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe1b0('0x2')]},'context':{'type':Sequelize[_0xe1b0('0x2')]},'exten':{'type':Sequelize[_0xe1b0('0x2')]},'priority':{'type':Sequelize[_0xe1b0('0x2')]},'destchannel':{'type':Sequelize[_0xe1b0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe1b0('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xe1b0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe1b0('0x2')]},'destcalleridname':{'type':Sequelize[_0xe1b0('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe1b0('0x2')]},'destlanguage':{'type':Sequelize[_0xe1b0('0x2')]},'destaccountcode':{'type':Sequelize[_0xe1b0('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xe1b0('0x2')]},'destuniqueid':{'type':Sequelize[_0xe1b0('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe1b0('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xe1b0('0x2')]},'transfer':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe1b0('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xe1b0('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe1b0('0x2')]},'agententerreason':{'type':Sequelize[_0xe1b0('0x5')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x757a=['INTEGER','BOOLEAN','exports','STRING','DATE'];(function(_0x47b367,_0x1b7b0a){var _0xd7ea75=function(_0x29dc73){while(--_0x29dc73){_0x47b367['push'](_0x47b367['shift']());}};_0xd7ea75(++_0x1b7b0a);}(_0x757a,0xde));var _0xa757=function(_0xe597bd,_0x35d589){_0xe597bd=_0xe597bd-0x0;var _0x40e544=_0x757a[_0xe597bd];return _0x40e544;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'type':{'type':Sequelize[_0xa757('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa757('0x1')]},'interface':{'type':Sequelize[_0xa757('0x1')]},'membername':{'type':Sequelize[_0xa757('0x1')]},'agentcalledAt':{'type':Sequelize[_0xa757('0x2')]},'agentconnectAt':{'type':Sequelize[_0xa757('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xa757('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xa757('0x2')]},'holdtime':{'type':Sequelize[_0xa757('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa757('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xa757('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xa757('0x3')]},'agentacw':{'type':Sequelize[_0xa757('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa757('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xa757('0x1')]},'channel':{'type':Sequelize[_0xa757('0x1')]},'channelstate':{'type':Sequelize[_0xa757('0x3')]},'channelstatedesc':{'type':Sequelize[_0xa757('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa757('0x1')]},'connectedlinename':{'type':Sequelize[_0xa757('0x1')]},'language':{'type':Sequelize[_0xa757('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa757('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xa757('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xa757('0x1')]},'destaccountcode':{'type':Sequelize[_0xa757('0x1')]},'destcontext':{'type':Sequelize[_0xa757('0x1')]},'destexten':{'type':Sequelize[_0xa757('0x1')]},'destpriority':{'type':Sequelize[_0xa757('0x1')]},'destuniqueid':{'type':Sequelize[_0xa757('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa757('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xa757('0x1')]},'transfer':{'type':Sequelize[_0xa757('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa757('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xa757('0x1')]},'transferuniqueid':{'type':Sequelize[_0xa757('0x1')]},'agententerreason':{'type':Sequelize[_0xa757('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 8817a75..55aaeee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
index 5a3666c..5fe65e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d92=['report_agent','destuniqueid','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0x564471,_0xc29127){var _0x194daf=function(_0x21fe9d){while(--_0x21fe9d){_0x564471['push'](_0x564471['shift']());}};_0x194daf(++_0xc29127);}(_0x9d92,0xdf));var _0x29d9=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0x9d92[_0x4687df];return _0x32eaef;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x29d9('0x1'));var moment=require(_0x29d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x29d9('0x3'));var fs=require('fs');var path=require(_0x29d9('0x4'));var rimraf=require(_0x29d9('0x5'));var config=require(_0x29d9('0x6'));var attributes=require(_0x29d9('0x7'));module[_0x29d9('0x8')]=function(_0x27d032,_0x52932b){return _0x27d032[_0x29d9('0x9')](_0x29d9('0xa'),attributes,{'tableName':_0x29d9('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x29d9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7e6=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define'];(function(_0x38e57c,_0x299baa){var _0x48b9a2=function(_0x1efebd){while(--_0x1efebd){_0x38e57c['push'](_0x38e57c['shift']());}};_0x48b9a2(++_0x299baa);}(_0xa7e6,0x74));var _0x6a7e=function(_0x2bcb85,_0x25ad2f){_0x2bcb85=_0x2bcb85-0x0;var _0x1b8e2e=_0xa7e6[_0x2bcb85];return _0x1b8e2e;};'use strict';var _=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var logger=require(_0x6a7e('0x2'))(_0x6a7e('0x3'));var moment=require(_0x6a7e('0x4'));var BPromise=require(_0x6a7e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a7e('0x6'));var rimraf=require(_0x6a7e('0x7'));var config=require(_0x6a7e('0x8'));var attributes=require(_0x6a7e('0x9'));module[_0x6a7e('0xa')]=function(_0x599006,_0x79df6f){return _0x599006[_0x6a7e('0xb')](_0x6a7e('0xc'),attributes,{'tableName':_0x6a7e('0xd'),'paranoid':![],'indexes':[{'fields':[_0x6a7e('0xe'),_0x6a7e('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 568ba90..88ecb14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e79=['util','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','stringify','UpdateVoiceAgentReport','update','where','attributes','limit','lodash'];(function(_0x625540,_0x3e4cf2){var _0x1007d8=function(_0x237ed1){while(--_0x237ed1){_0x625540['push'](_0x625540['shift']());}};_0x1007d8(++_0x3e4cf2);}(_0x3e79,0x9a));var _0x93e7=function(_0x121a0f,_0x1539eb){_0x121a0f=_0x121a0f-0x0;var _0x18d0f0=_0x3e79[_0x121a0f];return _0x18d0f0;};'use strict';var _=require(_0x93e7('0x0'));var util=require(_0x93e7('0x1'));var moment=require(_0x93e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x93e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x93e7('0x4'));var logger=require('../../config/logger')(_0x93e7('0x5'));var config=require('../../config/environment');var jayson=require(_0x93e7('0x6'));var client=jayson[_0x93e7('0x7')][_0x93e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e6fe3,_0x22b56e,_0x430b62){return new BPromise(function(_0x4ffc30,_0xdc79c0){return client[_0x93e7('0x9')](_0x4e6fe3,_0x430b62)[_0x93e7('0xa')](function(_0x8f8d58){logger[_0x93e7('0xb')](_0x93e7('0xc'),_0x22b56e,_0x93e7('0xd'));logger[_0x93e7('0xe')](_0x93e7('0xf'),_0x22b56e,_0x93e7('0xd'),JSON['stringify'](_0x8f8d58));if(_0x8f8d58[_0x93e7('0x10')]){if(_0x8f8d58[_0x93e7('0x10')]['code']===0x1f4){logger[_0x93e7('0x10')](_0x93e7('0xc'),_0x22b56e,_0x8f8d58[_0x93e7('0x10')][_0x93e7('0x11')]);return _0xdc79c0(_0x8f8d58[_0x93e7('0x10')][_0x93e7('0x11')]);}logger[_0x93e7('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x22b56e,_0x8f8d58[_0x93e7('0x10')]['message']);return _0x4ffc30(_0x8f8d58[_0x93e7('0x10')][_0x93e7('0x11')]);}else{logger[_0x93e7('0xb')](_0x93e7('0xc'),_0x22b56e,_0x93e7('0xd'));_0x4ffc30(_0x8f8d58[_0x93e7('0x12')][_0x93e7('0x11')]);}})[_0x93e7('0x13')](function(_0x4b6c43){logger[_0x93e7('0x10')](_0x93e7('0xc'),_0x22b56e,_0x4b6c43);_0xdc79c0(_0x4b6c43);});});}exports[_0x93e7('0x14')]=function(_0x14b951){var _0x5781a5=this;return new Promise(function(_0x548aa1,_0x1340e1){return db[_0x93e7('0x15')][_0x93e7('0x16')](_0x14b951[_0x93e7('0x17')],{'raw':_0x14b951['options']?_0x14b951[_0x93e7('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x93e7('0xa')](function(_0x2d9dee){logger[_0x93e7('0xb')](_0x93e7('0x14'),_0x14b951);logger[_0x93e7('0xe')](_0x93e7('0x14'),_0x14b951,JSON[_0x93e7('0x19')](_0x2d9dee));_0x548aa1(_0x2d9dee);})['catch'](function(_0x14e1e4){logger[_0x93e7('0x10')]('CreateVoiceAgentReport',_0x14e1e4[_0x93e7('0x11')],_0x14b951);_0x1340e1(_0x5781a5[_0x93e7('0x10')](0x1f4,_0x14e1e4[_0x93e7('0x11')]));});});};exports[_0x93e7('0x1a')]=function(_0x4e627b){var _0x33e6aa=this;return new Promise(function(_0x46ad06,_0x274942){return db[_0x93e7('0x15')][_0x93e7('0x1b')](_0x4e627b[_0x93e7('0x17')],{'raw':_0x4e627b[_0x93e7('0x18')]?_0x4e627b[_0x93e7('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e627b[_0x93e7('0x18')]?_0x4e627b[_0x93e7('0x18')][_0x93e7('0x1c')]||null:null,'attributes':_0x4e627b[_0x93e7('0x18')]?_0x4e627b[_0x93e7('0x18')][_0x93e7('0x1d')]||null:null,'limit':_0x4e627b[_0x93e7('0x18')]?_0x4e627b[_0x93e7('0x18')][_0x93e7('0x1e')]||null:null})[_0x93e7('0xa')](function(_0x3d36ac){logger[_0x93e7('0xb')](_0x93e7('0x1a'),_0x4e627b);logger[_0x93e7('0xe')](_0x93e7('0x1a'),_0x4e627b,JSON['stringify'](_0x3d36ac));_0x46ad06(_0x3d36ac);})[_0x93e7('0x13')](function(_0x398afe){logger[_0x93e7('0x10')](_0x93e7('0x1a'),_0x398afe['message'],_0x4e627b);_0x274942(_0x33e6aa[_0x93e7('0x10')](0x1f4,_0x398afe[_0x93e7('0x11')]));});});};
\ No newline at end of file
+var _0xcac9=['jayson/promise','client','http','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','then','UpdateVoiceAgentReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5676aa,_0x4e2c3c){var _0x573c2b=function(_0x16597c){while(--_0x16597c){_0x5676aa['push'](_0x5676aa['shift']());}};_0x573c2b(++_0x4e2c3c);}(_0xcac9,0x137));var _0x9cac=function(_0x3e5f6d,_0x121db6){_0x3e5f6d=_0x3e5f6d-0x0;var _0x1bea6e=_0xcac9[_0x3e5f6d];return _0x1bea6e;};'use strict';var _=require(_0x9cac('0x0'));var util=require(_0x9cac('0x1'));var moment=require(_0x9cac('0x2'));var BPromise=require(_0x9cac('0x3'));var rs=require(_0x9cac('0x4'));var fs=require('fs');var Redis=require(_0x9cac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9cac('0x6'));var logger=require(_0x9cac('0x7'))(_0x9cac('0x8'));var config=require('../../config/environment');var jayson=require(_0x9cac('0x9'));var client=jayson[_0x9cac('0xa')][_0x9cac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x340d49,_0x9833e9,_0x3e1cc9){return new BPromise(function(_0x3dcb7f,_0x175695){return client['request'](_0x340d49,_0x3e1cc9)['then'](function(_0x196505){logger[_0x9cac('0xc')](_0x9cac('0xd'),_0x9833e9,_0x9cac('0xe'));logger[_0x9cac('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x9833e9,_0x9cac('0xe'),JSON[_0x9cac('0x10')](_0x196505));if(_0x196505[_0x9cac('0x11')]){if(_0x196505[_0x9cac('0x11')][_0x9cac('0x12')]===0x1f4){logger['error'](_0x9cac('0xd'),_0x9833e9,_0x196505[_0x9cac('0x11')][_0x9cac('0x13')]);return _0x175695(_0x196505[_0x9cac('0x11')][_0x9cac('0x13')]);}logger[_0x9cac('0x11')](_0x9cac('0xd'),_0x9833e9,_0x196505['error'][_0x9cac('0x13')]);return _0x3dcb7f(_0x196505['error']['message']);}else{logger[_0x9cac('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x9833e9,'request\x20sent');_0x3dcb7f(_0x196505[_0x9cac('0x14')][_0x9cac('0x13')]);}})[_0x9cac('0x15')](function(_0x5d43ac){logger[_0x9cac('0x11')](_0x9cac('0xd'),_0x9833e9,_0x5d43ac);_0x175695(_0x5d43ac);});});}exports[_0x9cac('0x16')]=function(_0x31cb37){var _0x19b987=this;return new Promise(function(_0x5e93f4,_0x1e6a19){return db[_0x9cac('0x17')][_0x9cac('0x18')](_0x31cb37['body'],{'raw':_0x31cb37['options']?_0x31cb37[_0x9cac('0x19')][_0x9cac('0x1a')]===undefined?!![]:![]:!![]})[_0x9cac('0x1b')](function(_0x3bb243){logger['info'](_0x9cac('0x16'),_0x31cb37);logger[_0x9cac('0xf')]('CreateVoiceAgentReport',_0x31cb37,JSON[_0x9cac('0x10')](_0x3bb243));_0x5e93f4(_0x3bb243);})['catch'](function(_0x46d64b){logger['error']('CreateVoiceAgentReport',_0x46d64b[_0x9cac('0x13')],_0x31cb37);_0x1e6a19(_0x19b987[_0x9cac('0x11')](0x1f4,_0x46d64b['message']));});});};exports[_0x9cac('0x1c')]=function(_0x27800b){var _0x6d55dd=this;return new Promise(function(_0x23628f,_0x92da9b){return db[_0x9cac('0x17')]['update'](_0x27800b['body'],{'raw':_0x27800b[_0x9cac('0x19')]?_0x27800b[_0x9cac('0x19')][_0x9cac('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27800b[_0x9cac('0x19')]?_0x27800b[_0x9cac('0x19')][_0x9cac('0x1d')]||null:null,'attributes':_0x27800b[_0x9cac('0x19')]?_0x27800b['options'][_0x9cac('0x1e')]||null:null,'limit':_0x27800b[_0x9cac('0x19')]?_0x27800b[_0x9cac('0x19')][_0x9cac('0x1f')]||null:null})['then'](function(_0x5859fd){logger[_0x9cac('0xc')](_0x9cac('0x1c'),_0x27800b);logger[_0x9cac('0xf')](_0x9cac('0x1c'),_0x27800b,JSON[_0x9cac('0x10')](_0x5859fd));_0x23628f(_0x5859fd);})[_0x9cac('0x15')](function(_0x20eb8f){logger['error']('UpdateVoiceAgentReport',_0x20eb8f[_0x9cac('0x13')],_0x27800b);_0x92da9b(_0x6d55dd[_0x9cac('0x11')](0x1f4,_0x20eb8f[_0x9cac('0x13')]));});});};
\ No newline at end of file
index 0aef208..db46c76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa630=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe'];(function(_0x447763,_0x1316e9){var _0x30235e=function(_0xd59b3f){while(--_0xd59b3f){_0x447763['push'](_0x447763['shift']());}};_0x30235e(++_0x1316e9);}(_0xa630,0xbe));var _0x0a63=function(_0x3ccbea,_0x38011d){_0x3ccbea=_0x3ccbea-0x0;var _0x5b3966=_0xa630[_0x3ccbea];return _0x5b3966;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')]('/',auth[_0x0a63('0x8')](),controller['index']);router[_0x0a63('0x7')](_0x0a63('0x9'),auth[_0x0a63('0x8')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x7')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')]('/',auth[_0x0a63('0x8')](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0xb'),auth[_0x0a63('0x8')](),controller[_0x0a63('0x10')]);router[_0x0a63('0x11')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0x12')]);module[_0x0a63('0x13')]=router;
\ No newline at end of file
+var _0x33c5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x33c5,0xe6));var _0x533c=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x33c5[_0x810e4d];return _0x13f01c;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0xa')]);router[_0x533c('0x8')](_0x533c('0xb'),auth[_0x533c('0x9')](),controller[_0x533c('0xc')]);router[_0x533c('0x8')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0xe')]);router[_0x533c('0xf')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0x10')]);router[_0x533c('0x11')]('/:id',auth[_0x533c('0x9')](),controller[_0x533c('0x12')]);router[_0x533c('0x13')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0x14')]);module['exports']=router;
\ No newline at end of file
index 3633916..5ac40a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bf1=['DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','TEXT'];(function(_0x4a004b,_0x4ba890){var _0x11c6c0=function(_0x2d0225){while(--_0x2d0225){_0x4a004b['push'](_0x4a004b['shift']());}};_0x11c6c0(++_0x4ba890);}(_0x8bf1,0x65));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x18bf('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x18bf('0x1')]},'type':{'type':Sequelize[_0x18bf('0x2')](_0x18bf('0x3'),_0x18bf('0x4'),_0x18bf('0x5'),_0x18bf('0x6'),_0x18bf('0x7'),'dialer')},'tag':{'type':Sequelize[_0x18bf('0x1')]},'accountcode':{'type':Sequelize[_0x18bf('0x1')]},'source':{'type':Sequelize[_0x18bf('0x1')]},'destination':{'type':Sequelize[_0x18bf('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x18bf('0x1')]},'channel':{'type':Sequelize[_0x18bf('0x1')]},'destinationchannel':{'type':Sequelize[_0x18bf('0x1')]},'lastapplication':{'type':Sequelize[_0x18bf('0x1')]},'lastdata':{'type':Sequelize[_0x18bf('0x8')]},'starttime':{'type':Sequelize[_0x18bf('0x9')]},'systemanswertime':{'type':Sequelize[_0x18bf('0x9')]},'answertime':{'type':Sequelize[_0x18bf('0x9')]},'endtime':{'type':Sequelize[_0x18bf('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x18bf('0xa')]},'mohtime':{'type':Sequelize[_0x18bf('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x18bf('0x1')]},'amaflags':{'type':Sequelize[_0x18bf('0x1')]},'userfield':{'type':Sequelize[_0x18bf('0x1')]},'userDisposition':{'type':Sequelize[_0x18bf('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x18bf('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x18bf('0x1')]},'note':{'type':Sequelize[_0x18bf('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x18bf('0xa')]},'sipcallid':{'type':Sequelize[_0x18bf('0x1')]}};
\ No newline at end of file
+var _0x0f42=['ENUM','internal','inbound-fax','dialer','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x544aa7,_0x20c74c){var _0x32d13a=function(_0x1ed5dc){while(--_0x1ed5dc){_0x544aa7['push'](_0x544aa7['shift']());}};_0x32d13a(++_0x20c74c);}(_0x0f42,0x126));var _0x20f4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f42[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x20f4('0x0'));module[_0x20f4('0x1')]={'uniqueid':{'type':Sequelize[_0x20f4('0x2')]},'type':{'type':Sequelize[_0x20f4('0x3')]('inbound',_0x20f4('0x4'),'outbound',_0x20f4('0x5'),'outbound-fax',_0x20f4('0x6'))},'tag':{'type':Sequelize[_0x20f4('0x2')]},'accountcode':{'type':Sequelize[_0x20f4('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x20f4('0x2')]},'destinationcontext':{'type':Sequelize[_0x20f4('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x20f4('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x20f4('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x20f4('0x7')]},'endtime':{'type':Sequelize[_0x20f4('0x7')]},'duration':{'type':Sequelize[_0x20f4('0x8')]},'billableseconds':{'type':Sequelize[_0x20f4('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x20f4('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x20f4('0x2')]},'userDisposition':{'type':Sequelize[_0x20f4('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x20f4('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x20f4('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x20f4('0x2')]},'routeid':{'type':Sequelize[_0x20f4('0x8')]},'sipcallid':{'type':Sequelize[_0x20f4('0x2')]}};
\ No newline at end of file
index 8a9cdf5..f474585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0xadb5,0xad));var _0x5adb=function(_0x355aa2,_0x2dadbf){_0x355aa2=_0x355aa2-0x0;var _0x1bb2b3=_0xadb5[_0x355aa2];return _0x1bb2b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));};
\ No newline at end of file
+var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x1d9f3b,_0x470c92){var _0x237778=function(_0x836311){while(--_0x836311){_0x1d9f3b['push'](_0x1d9f3b['shift']());}};_0x237778(++_0x470c92);}(_0xdb28,0x106));var _0x8db2=function(_0x555c47,_0x5f4269){_0x555c47=_0x555c47-0x0;var _0x296880=_0xdb28[_0x555c47];return _0x296880;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));};
\ No newline at end of file
index 512db27..ad9e89b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8db=['VoiceCallReport','report_call','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x388b49,_0x33397c){var _0x47b773=function(_0x1c9c69){while(--_0x1c9c69){_0x388b49['push'](_0x388b49['shift']());}};_0x47b773(++_0x33397c);}(_0xa8db,0x16d));var _0xba8d=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0xa8db[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require('lodash');var util=require(_0xba8d('0x0'));var logger=require(_0xba8d('0x1'))(_0xba8d('0x2'));var moment=require('moment');var BPromise=require(_0xba8d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba8d('0x4'));var rimraf=require(_0xba8d('0x5'));var config=require(_0xba8d('0x6'));var attributes=require(_0xba8d('0x7'));module[_0xba8d('0x8')]=function(_0x89faab,_0x3dc3df){return _0x89faab['define'](_0xba8d('0x9'),attributes,{'tableName':_0xba8d('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0140=['api','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceCallReport','uniqueid','lodash','util'];(function(_0x29e02c,_0x8cde89){var _0x146554=function(_0x170064){while(--_0x170064){_0x29e02c['push'](_0x29e02c['shift']());}};_0x146554(++_0x8cde89);}(_0x0140,0xa3));var _0x0014=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x0140[_0x2f3ecd];return _0xffdc44;};'use strict';var _=require(_0x0014('0x0'));var util=require(_0x0014('0x1'));var logger=require('../../config/logger')(_0x0014('0x2'));var moment=require('moment');var BPromise=require(_0x0014('0x3'));var rp=require(_0x0014('0x4'));var fs=require('fs');var path=require(_0x0014('0x5'));var rimraf=require(_0x0014('0x6'));var config=require(_0x0014('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x205167,_0x5e90ce){return _0x205167[_0x0014('0x8')](_0x0014('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x0014('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 53c0fdc..c4f735e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x794e=['include','map','model','debug','CreateVoiceCallReport','create','body','raw','update','UpdateVoiceCallReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes'];(function(_0xe06e19,_0x2fc943){var _0x1283bb=function(_0x100541){while(--_0x100541){_0xe06e19['push'](_0xe06e19['shift']());}};_0x1283bb(++_0x2fc943);}(_0x794e,0xee));var _0xe794=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x794e[_0x432fca];return _0x3adba4;};'use strict';var _=require('lodash');var util=require(_0xe794('0x0'));var moment=require(_0xe794('0x1'));var BPromise=require(_0xe794('0x2'));var rs=require(_0xe794('0x3'));var fs=require('fs');var Redis=require(_0xe794('0x4'));var db=require(_0xe794('0x5'))['db'];var utils=require(_0xe794('0x6'));var logger=require('../../config/logger')(_0xe794('0x7'));var config=require(_0xe794('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe794('0x9')][_0xe794('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x368951,_0x4f9681,_0xd2fbf){return new BPromise(function(_0x2ec85e,_0x144886){return client[_0xe794('0xb')](_0x368951,_0xd2fbf)[_0xe794('0xc')](function(_0x4c21e7){logger[_0xe794('0xd')](_0xe794('0xe'),_0x4f9681,_0xe794('0xf'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4f9681,_0xe794('0xf'),JSON[_0xe794('0x10')](_0x4c21e7));if(_0x4c21e7['error']){if(_0x4c21e7[_0xe794('0x11')][_0xe794('0x12')]===0x1f4){logger[_0xe794('0x11')](_0xe794('0xe'),_0x4f9681,_0x4c21e7[_0xe794('0x11')][_0xe794('0x13')]);return _0x144886(_0x4c21e7[_0xe794('0x11')][_0xe794('0x13')]);}logger[_0xe794('0x11')](_0xe794('0xe'),_0x4f9681,_0x4c21e7['error']['message']);return _0x2ec85e(_0x4c21e7[_0xe794('0x11')][_0xe794('0x13')]);}else{logger[_0xe794('0xd')](_0xe794('0xe'),_0x4f9681,'request\x20sent');_0x2ec85e(_0x4c21e7[_0xe794('0x14')]['message']);}})[_0xe794('0x15')](function(_0x3bdeca){logger[_0xe794('0x11')](_0xe794('0xe'),_0x4f9681,_0x3bdeca);_0x144886(_0x3bdeca);});});}exports[_0xe794('0x16')]=function(_0x18cbd7){var _0xb32f85=this;return new Promise(function(_0x25d8fc,_0x23403b){return db[_0xe794('0x17')][_0xe794('0x18')]({'raw':_0x18cbd7['options']?_0x18cbd7['options']['raw']===undefined?!![]:![]:!![],'where':_0x18cbd7[_0xe794('0x19')]?_0x18cbd7[_0xe794('0x19')][_0xe794('0x1a')]||null:null,'attributes':_0x18cbd7[_0xe794('0x19')]?_0x18cbd7[_0xe794('0x19')][_0xe794('0x1b')]||null:null,'limit':_0x18cbd7[_0xe794('0x19')]?_0x18cbd7[_0xe794('0x19')]['limit']||null:null,'include':_0x18cbd7['options']?_0x18cbd7[_0xe794('0x19')][_0xe794('0x1c')]?_['map'](_0x18cbd7[_0xe794('0x19')][_0xe794('0x1c')],function(_0x28ebc5){return{'model':db[_0x28ebc5['model']],'as':_0x28ebc5['as'],'attributes':_0x28ebc5[_0xe794('0x1b')],'include':_0x28ebc5[_0xe794('0x1c')]?_[_0xe794('0x1d')](_0x28ebc5[_0xe794('0x1c')],function(_0x4fc0f2){return{'model':db[_0x4fc0f2[_0xe794('0x1e')]],'as':_0x4fc0f2['as'],'attributes':_0x4fc0f2[_0xe794('0x1b')],'include':_0x4fc0f2[_0xe794('0x1c')]?_['map'](_0x4fc0f2[_0xe794('0x1c')],function(_0x3df6df){return{'model':db[_0x3df6df[_0xe794('0x1e')]],'as':_0x3df6df['as'],'attributes':_0x3df6df['attributes']};}):[]};}):[]};}):[]:[]})[_0xe794('0xc')](function(_0x43f29c){logger[_0xe794('0xd')](_0xe794('0x16'),_0x18cbd7);logger[_0xe794('0x1f')](_0xe794('0x16'),_0x18cbd7,JSON[_0xe794('0x10')](_0x43f29c));_0x25d8fc(_0x43f29c);})[_0xe794('0x15')](function(_0xd5bc10){logger[_0xe794('0x11')](_0xe794('0x16'),_0xd5bc10[_0xe794('0x13')],_0x18cbd7);_0x23403b(_0xb32f85[_0xe794('0x11')](0x1f4,_0xd5bc10['message']));});});};exports[_0xe794('0x20')]=function(_0x501e02){var _0x32ee80=this;return new Promise(function(_0x490a5c,_0x48d554){return db['VoiceCallReport'][_0xe794('0x21')](_0x501e02[_0xe794('0x22')],{'raw':_0x501e02[_0xe794('0x19')]?_0x501e02[_0xe794('0x19')][_0xe794('0x23')]===undefined?!![]:![]:!![]})[_0xe794('0xc')](function(_0x2488e5){logger[_0xe794('0xd')](_0xe794('0x20'),_0x501e02);logger[_0xe794('0x1f')](_0xe794('0x20'),_0x501e02,JSON[_0xe794('0x10')](_0x2488e5));_0x490a5c(_0x2488e5);})['catch'](function(_0x1a3679){logger[_0xe794('0x11')](_0xe794('0x20'),_0x1a3679[_0xe794('0x13')],_0x501e02);_0x48d554(_0x32ee80[_0xe794('0x11')](0x1f4,_0x1a3679[_0xe794('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x118d0b){var _0x12315f=this;return new Promise(function(_0x35ba54,_0x555646){return db[_0xe794('0x17')][_0xe794('0x24')](_0x118d0b['body'],{'raw':_0x118d0b[_0xe794('0x19')]?_0x118d0b[_0xe794('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x118d0b[_0xe794('0x19')]?_0x118d0b[_0xe794('0x19')][_0xe794('0x1a')]||null:null,'attributes':_0x118d0b[_0xe794('0x19')]?_0x118d0b[_0xe794('0x19')]['attributes']||null:null,'limit':_0x118d0b[_0xe794('0x19')]?_0x118d0b[_0xe794('0x19')]['limit']||null:null})['then'](function(_0x2a36b6){logger[_0xe794('0xd')]('UpdateVoiceCallReport',_0x118d0b);logger[_0xe794('0x1f')]('UpdateVoiceCallReport',_0x118d0b,JSON[_0xe794('0x10')](_0x2a36b6));_0x35ba54(_0x2a36b6);})['catch'](function(_0x31ed11){logger[_0xe794('0x11')](_0xe794('0x25'),_0x31ed11[_0xe794('0x13')],_0x118d0b);_0x555646(_0x12315f['error'](0x1f4,_0x31ed11['message']));});});};
\ No newline at end of file
+var _0x2095=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','include','map','model','then','debug','catch','CreateVoiceCallReport','body','update','UpdateVoiceCallReport','lodash','util','bluebird'];(function(_0x29e7ac,_0x17a540){var _0x358daf=function(_0x18dfec){while(--_0x18dfec){_0x29e7ac['push'](_0x29e7ac['shift']());}};_0x358daf(++_0x17a540);}(_0x2095,0x8d));var _0x5209=function(_0x51bbee,_0x5f1425){_0x51bbee=_0x51bbee-0x0;var _0x258743=_0x2095[_0x51bbee];return _0x258743;};'use strict';var _=require(_0x5209('0x0'));var util=require(_0x5209('0x1'));var moment=require('moment');var BPromise=require(_0x5209('0x2'));var rs=require(_0x5209('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5209('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5209('0x5'))(_0x5209('0x6'));var config=require(_0x5209('0x7'));var jayson=require(_0x5209('0x8'));var client=jayson[_0x5209('0x9')][_0x5209('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b2f10,_0x4dcc69,_0x10dc06){return new BPromise(function(_0x1ec1a1,_0x5414e0){return client['request'](_0x1b2f10,_0x10dc06)['then'](function(_0x518e4){logger[_0x5209('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x4dcc69,'request\x20sent');logger['debug'](_0x5209('0xc'),_0x4dcc69,_0x5209('0xd'),JSON[_0x5209('0xe')](_0x518e4));if(_0x518e4['error']){if(_0x518e4[_0x5209('0xf')][_0x5209('0x10')]===0x1f4){logger[_0x5209('0xf')](_0x5209('0x11'),_0x4dcc69,_0x518e4['error'][_0x5209('0x12')]);return _0x5414e0(_0x518e4[_0x5209('0xf')]['message']);}logger[_0x5209('0xf')](_0x5209('0x11'),_0x4dcc69,_0x518e4[_0x5209('0xf')][_0x5209('0x12')]);return _0x1ec1a1(_0x518e4[_0x5209('0xf')][_0x5209('0x12')]);}else{logger[_0x5209('0xb')](_0x5209('0x11'),_0x4dcc69,_0x5209('0xd'));_0x1ec1a1(_0x518e4['result'][_0x5209('0x12')]);}})['catch'](function(_0x46beaf){logger[_0x5209('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x4dcc69,_0x46beaf);_0x5414e0(_0x46beaf);});});}exports[_0x5209('0x13')]=function(_0x303eff){var _0x3fec09=this;return new Promise(function(_0x31755d,_0x553998){return db[_0x5209('0x14')]['findAll']({'raw':_0x303eff['options']?_0x303eff[_0x5209('0x15')][_0x5209('0x16')]===undefined?!![]:![]:!![],'where':_0x303eff['options']?_0x303eff[_0x5209('0x15')][_0x5209('0x17')]||null:null,'attributes':_0x303eff[_0x5209('0x15')]?_0x303eff[_0x5209('0x15')][_0x5209('0x18')]||null:null,'limit':_0x303eff[_0x5209('0x15')]?_0x303eff[_0x5209('0x15')][_0x5209('0x19')]||null:null,'include':_0x303eff['options']?_0x303eff[_0x5209('0x15')][_0x5209('0x1a')]?_[_0x5209('0x1b')](_0x303eff[_0x5209('0x15')][_0x5209('0x1a')],function(_0x52f5f8){return{'model':db[_0x52f5f8[_0x5209('0x1c')]],'as':_0x52f5f8['as'],'attributes':_0x52f5f8[_0x5209('0x18')],'include':_0x52f5f8['include']?_['map'](_0x52f5f8[_0x5209('0x1a')],function(_0x4039bc){return{'model':db[_0x4039bc[_0x5209('0x1c')]],'as':_0x4039bc['as'],'attributes':_0x4039bc[_0x5209('0x18')],'include':_0x4039bc[_0x5209('0x1a')]?_[_0x5209('0x1b')](_0x4039bc[_0x5209('0x1a')],function(_0x223ced){return{'model':db[_0x223ced[_0x5209('0x1c')]],'as':_0x223ced['as'],'attributes':_0x223ced[_0x5209('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5209('0x1d')](function(_0x1111dc){logger[_0x5209('0xb')](_0x5209('0x13'),_0x303eff);logger[_0x5209('0x1e')](_0x5209('0x13'),_0x303eff,JSON[_0x5209('0xe')](_0x1111dc));_0x31755d(_0x1111dc);})[_0x5209('0x1f')](function(_0x55b322){logger[_0x5209('0xf')](_0x5209('0x13'),_0x55b322[_0x5209('0x12')],_0x303eff);_0x553998(_0x3fec09['error'](0x1f4,_0x55b322[_0x5209('0x12')]));});});};exports[_0x5209('0x20')]=function(_0x54d0cc){var _0x49bd11=this;return new Promise(function(_0x149273,_0x51de3e){return db['VoiceCallReport']['create'](_0x54d0cc[_0x5209('0x21')],{'raw':_0x54d0cc[_0x5209('0x15')]?_0x54d0cc['options'][_0x5209('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x26aeb6){logger['info'](_0x5209('0x20'),_0x54d0cc);logger[_0x5209('0x1e')](_0x5209('0x20'),_0x54d0cc,JSON[_0x5209('0xe')](_0x26aeb6));_0x149273(_0x26aeb6);})[_0x5209('0x1f')](function(_0x69beb7){logger[_0x5209('0xf')](_0x5209('0x20'),_0x69beb7[_0x5209('0x12')],_0x54d0cc);_0x51de3e(_0x49bd11[_0x5209('0xf')](0x1f4,_0x69beb7[_0x5209('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x2a987f){var _0x4d17a7=this;return new Promise(function(_0x55ead5,_0x78889e){return db[_0x5209('0x14')][_0x5209('0x22')](_0x2a987f[_0x5209('0x21')],{'raw':_0x2a987f['options']?_0x2a987f[_0x5209('0x15')][_0x5209('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a987f[_0x5209('0x15')]?_0x2a987f[_0x5209('0x15')]['where']||null:null,'attributes':_0x2a987f['options']?_0x2a987f['options'][_0x5209('0x18')]||null:null,'limit':_0x2a987f['options']?_0x2a987f[_0x5209('0x15')][_0x5209('0x19')]||null:null})[_0x5209('0x1d')](function(_0x4f3566){logger[_0x5209('0xb')](_0x5209('0x23'),_0x2a987f);logger[_0x5209('0x1e')](_0x5209('0x23'),_0x2a987f,JSON[_0x5209('0xe')](_0x4f3566));_0x55ead5(_0x4f3566);})['catch'](function(_0x227bc6){logger[_0x5209('0xf')]('UpdateVoiceCallReport',_0x227bc6['message'],_0x2a987f);_0x78889e(_0x4d17a7[_0x5209('0xf')](0x1f4,_0x227bc6['message']));});});};
\ No newline at end of file
index f9810d4..ad0ba5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89d4=['destroy','exports','util','connect-timeout','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x89d4,0x192));var _0x489d=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x89d4[_0x17882c];return _0x355a59;};'use strict';var multer=require('multer');var util=require(_0x489d('0x0'));var path=require('path');var timeout=require(_0x489d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x489d('0x2'));var config=require(_0x489d('0x3'));var controller=require(_0x489d('0x4'));router[_0x489d('0x5')]('/',auth['isAuthenticated'](),controller[_0x489d('0x6')]);router['get'](_0x489d('0x7'),auth[_0x489d('0x8')](),controller[_0x489d('0x9')]);router['post']('/',auth[_0x489d('0x8')](),controller[_0x489d('0xa')]);router[_0x489d('0xb')]('/:id',auth[_0x489d('0x8')](),controller[_0x489d('0xc')]);router[_0x489d('0xd')](_0x489d('0x7'),auth[_0x489d('0x8')](),controller[_0x489d('0xe')]);module[_0x489d('0xf')]=router;
\ No newline at end of file
+var _0x0ac7=['post','create','put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0x0ac7,0x1ba));var _0x70ac=function(_0x5d5ab2,_0x1d3681){_0x5d5ab2=_0x5d5ab2-0x0;var _0xb8fe37=_0x0ac7[_0x5d5ab2];return _0xb8fe37;};'use strict';var multer=require(_0x70ac('0x0'));var util=require(_0x70ac('0x1'));var path=require(_0x70ac('0x2'));var timeout=require(_0x70ac('0x3'));var express=require(_0x70ac('0x4'));var router=express['Router']();var fs_extra=require(_0x70ac('0x5'));var auth=require(_0x70ac('0x6'));var interaction=require(_0x70ac('0x7'));var config=require(_0x70ac('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x70ac('0x9')]('/',auth[_0x70ac('0xa')](),controller[_0x70ac('0xb')]);router[_0x70ac('0x9')](_0x70ac('0xc'),auth[_0x70ac('0xa')](),controller[_0x70ac('0xd')]);router[_0x70ac('0xe')]('/',auth[_0x70ac('0xa')](),controller[_0x70ac('0xf')]);router[_0x70ac('0x10')](_0x70ac('0xc'),auth[_0x70ac('0xa')](),controller['update']);router[_0x70ac('0x11')](_0x70ac('0xc'),auth[_0x70ac('0xa')](),controller[_0x70ac('0x12')]);module['exports']=router;
\ No newline at end of file
index b5c6bb6..a7fe26d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe934=['sequelize','STRING','name','setDataValue','options','join','getDataValue','BOOLEAN'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xe934,0x1e0));var _0x4e93=function(_0x55d244,_0x3bf14d){_0x55d244=_0x55d244-0x0;var _0x422d81=_0xe934[_0x55d244];return _0x422d81;};'use strict';var Sequelize=require(_0x4e93('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e93('0x1')]},'prefix':{'type':Sequelize[_0x4e93('0x1')],'unique':_0x4e93('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x4e93('0x1')],'set':function(_0xccfd33){this[_0x4e93('0x3')](_0x4e93('0x4'),_0xccfd33?_0xccfd33[_0x4e93('0x5')](''):[]);},'get':function(){return this[_0x4e93('0x6')](_0x4e93('0x4'))?this[_0x4e93('0x6')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x4e93('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x4e93('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4e93('0x1')]},'description':{'type':Sequelize[_0x4e93('0x1')]}};
\ No newline at end of file
+var _0x3d54=['getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join'];(function(_0x4adaa4,_0x314558){var _0x299514=function(_0x4e0389){while(--_0x4e0389){_0x4adaa4['push'](_0x4adaa4['shift']());}};_0x299514(++_0x314558);}(_0x3d54,0x68));var _0x43d5=function(_0x48ffc9,_0x581b31){_0x48ffc9=_0x48ffc9-0x0;var _0x1985cb=_0x3d54[_0x48ffc9];return _0x1985cb;};'use strict';var Sequelize=require(_0x43d5('0x0'));module[_0x43d5('0x1')]={'name':{'type':Sequelize[_0x43d5('0x2')]},'prefix':{'type':Sequelize[_0x43d5('0x2')],'unique':_0x43d5('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x315fe6){this[_0x43d5('0x4')]('options',_0x315fe6?_0x315fe6[_0x43d5('0x5')](''):[]);},'get':function(){return this[_0x43d5('0x6')](_0x43d5('0x7'))?this[_0x43d5('0x6')]('options')[_0x43d5('0x8')](''):[];}},'auth':{'type':Sequelize[_0x43d5('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x43d5('0x2')]},'record':{'type':Sequelize[_0x43d5('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x43d5('0x2')]}};
\ No newline at end of file
index 1398d41..acee251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b07=['error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','length','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','end'];(function(_0x1f0f33,_0x337c27){var _0x58e70b=function(_0x4d85ea){while(--_0x4d85ea){_0x1f0f33['push'](_0x1f0f33['shift']());}};_0x58e70b(++_0x337c27);}(_0x4b07,0x1d6));var _0x74b0=function(_0x15ef28,_0xad6108){_0x15ef28=_0x15ef28-0x0;var _0x3b6c49=_0x4b07[_0x15ef28];return _0x3b6c49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74b0('0x0'));var zipdir=require(_0x74b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b0('0x2'));var moment=require(_0x74b0('0x3'));var BPromise=require(_0x74b0('0x4'));var Mustache=require(_0x74b0('0x5'));var util=require('util');var path=require(_0x74b0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74b0('0x7'));var _=require(_0x74b0('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x74b0('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x74b0('0xa'));var querystring=require(_0x74b0('0xb'));var Papa=require(_0x74b0('0xc'));var Redis=require(_0x74b0('0xd'));var authService=require(_0x74b0('0xe'));var qs=require(_0x74b0('0xf'));var as=require(_0x74b0('0x10'));var hardwareService=require(_0x74b0('0x11'));var logger=require(_0x74b0('0x12'))(_0x74b0('0x13'));var utils=require(_0x74b0('0x14'));var config=require(_0x74b0('0x15'));var licenseUtil=require(_0x74b0('0x16'));var db=require(_0x74b0('0x17'))['db'];function respondWithStatusCode(_0xf1ec58,_0x200f36){_0x200f36=_0x200f36||0xcc;return function(_0x4e9f47){if(_0x4e9f47){return _0xf1ec58[_0x74b0('0x18')](_0x200f36);}return _0xf1ec58[_0x74b0('0x19')](_0x200f36)['end']();};}function respondWithResult(_0xefd5f7,_0x49f519){_0x49f519=_0x49f519||0xc8;return function(_0x72f633){if(_0x72f633){return _0xefd5f7[_0x74b0('0x19')](_0x49f519)['json'](_0x72f633);}};}function respondWithFilteredResult(_0x4004d7,_0x50aa7d){return function(_0x3b002a){if(_0x3b002a){var _0x539172=typeof _0x50aa7d[_0x74b0('0x1a')]==='undefined'&&typeof _0x50aa7d[_0x74b0('0x1b')]===_0x74b0('0x1c');var _0x397ee4=_0x3b002a[_0x74b0('0x1d')];var _0x26deb1=_0x539172?0x0:_0x50aa7d[_0x74b0('0x1a')];var _0x8425cc=_0x539172?_0x3b002a[_0x74b0('0x1d')]:_0x50aa7d['offset']+_0x50aa7d['limit'];var _0x55ccc1;if(_0x8425cc>=_0x397ee4){_0x8425cc=_0x397ee4;_0x55ccc1=0xc8;}else{_0x55ccc1=0xce;}_0x4004d7[_0x74b0('0x19')](_0x55ccc1);return _0x4004d7['set'](_0x74b0('0x1e'),_0x26deb1+'-'+_0x8425cc+'/'+_0x397ee4)[_0x74b0('0x1f')](_0x3b002a);}return null;};}function patchUpdates(_0xc17e43){return function(_0x28a89e){try{jsonpatch['apply'](_0x28a89e,_0xc17e43,!![]);}catch(_0x18004b){return BPromise[_0x74b0('0x20')](_0x18004b);}return _0x28a89e[_0x74b0('0x21')]();};}function saveUpdates(_0xc6c020,_0x550ff7){return function(_0x44f568){if(_0x44f568){return _0x44f568[_0x74b0('0x22')](_0xc6c020)[_0x74b0('0x23')](function(_0x167dd7){return _0x167dd7;});}return null;};}function removeEntity(_0x3e70d5,_0x1396f3){return function(_0x7259f4){if(_0x7259f4){return _0x7259f4[_0x74b0('0x24')]()[_0x74b0('0x23')](function(){var _0x54e2fd=_0x7259f4[_0x74b0('0x25')]({'plain':!![]});var _0x5b6b58='ChanSpies';return db[_0x74b0('0x26')][_0x74b0('0x24')]({'where':{'type':_0x5b6b58,'resourceId':_0x54e2fd['id']}})[_0x74b0('0x23')](function(){return _0x7259f4;});})['then'](function(){_0x3e70d5[_0x74b0('0x19')](0xcc)[_0x74b0('0x27')]();});}};}function handleEntityNotFound(_0x1f8b2a,_0x531fee){return function(_0x57c283){if(!_0x57c283){_0x1f8b2a[_0x74b0('0x18')](0x194);}return _0x57c283;};}function handleError(_0x3b84f0,_0x2d061b){_0x2d061b=_0x2d061b||0x1f4;return function(_0x2163f4){logger[_0x74b0('0x28')](_0x2163f4[_0x74b0('0x29')]);if(_0x2163f4['name']){delete _0x2163f4[_0x74b0('0x2a')];}_0x3b84f0['status'](_0x2d061b)[_0x74b0('0x2b')](_0x2163f4);};}exports[_0x74b0('0x2c')]=function(_0x4dfbdb,_0x2b93ae){var _0x25db17={},_0x143093={},_0x5e0560={'count':0x0,'rows':[]};var _0x529abb=_['map'](db[_0x74b0('0x2d')][_0x74b0('0x2e')],function(_0x57f04e){return{'name':_0x57f04e[_0x74b0('0x2f')],'type':_0x57f04e[_0x74b0('0x30')][_0x74b0('0x31')]};});_0x143093[_0x74b0('0x32')]=_[_0x74b0('0x33')](_0x529abb,_0x74b0('0x2a'));_0x143093['query']=_[_0x74b0('0x34')](_0x4dfbdb[_0x74b0('0x35')]);_0x143093[_0x74b0('0x36')]=_['intersection'](_0x143093[_0x74b0('0x32')],_0x143093[_0x74b0('0x35')]);_0x25db17['attributes']=_[_0x74b0('0x37')](_0x143093[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x4dfbdb['query'][_0x74b0('0x38')]));_0x25db17[_0x74b0('0x39')]=_0x25db17[_0x74b0('0x39')]['length']?_0x25db17['attributes']:_0x143093[_0x74b0('0x32')];if(!_0x4dfbdb['query'][_0x74b0('0x3a')](_0x74b0('0x3b'))){_0x25db17[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x25db17[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x25db17[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x25db17[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x4dfbdb[_0x74b0('0x35')],_0x143093[_0x74b0('0x36')]),_0x529abb);if(_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x40')]){_0x25db17[_0x74b0('0x3e')]=_[_0x74b0('0x41')](_0x25db17[_0x74b0('0x3e')],{'$or':_['map'](_0x529abb,function(_0x83be1d){if(_0x83be1d['type']!=='VIRTUAL'){var _0x4fe7da={};_0x4fe7da[_0x83be1d[_0x74b0('0x2a')]]={'$like':'%'+_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x40')]+'%'};return _0x4fe7da;}})});}_0x25db17=_[_0x74b0('0x41')]({},_0x25db17,_0x4dfbdb[_0x74b0('0x42')]);var _0x145f01={'where':_0x25db17['where']};return db['VoiceChanSpy'][_0x74b0('0x1d')](_0x145f01)[_0x74b0('0x23')](function(_0x409c65){_0x5e0560[_0x74b0('0x1d')]=_0x409c65;if(_0x4dfbdb[_0x74b0('0x35')]['includeAll']){_0x25db17['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x74b0('0x43')](_0x25db17);})[_0x74b0('0x23')](function(_0xffc84){_0x5e0560[_0x74b0('0x44')]=_0xffc84;return _0x5e0560;})['then'](respondWithFilteredResult(_0x2b93ae,_0x25db17))[_0x74b0('0x45')](handleError(_0x2b93ae,null));};exports[_0x74b0('0x46')]=function(_0x5ce200,_0x24dcbd){var _0x3c6973={'raw':![],'where':{'id':_0x5ce200[_0x74b0('0x47')]['id']}},_0x5bee95={};_0x5bee95['model']=_[_0x74b0('0x34')](db[_0x74b0('0x2d')][_0x74b0('0x2e')]);_0x5bee95['query']=_['keys'](_0x5ce200[_0x74b0('0x35')]);_0x5bee95['filters']=_[_0x74b0('0x37')](_0x5bee95['model'],_0x5bee95[_0x74b0('0x35')]);_0x3c6973[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x5bee95[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x5ce200[_0x74b0('0x35')][_0x74b0('0x38')]));_0x3c6973[_0x74b0('0x39')]=_0x3c6973[_0x74b0('0x39')][_0x74b0('0x48')]?_0x3c6973[_0x74b0('0x39')]:_0x5bee95[_0x74b0('0x32')];if(_0x5ce200['query'][_0x74b0('0x49')]){_0x3c6973['include']=[{'all':!![]}];}_0x3c6973=_[_0x74b0('0x41')]({},_0x3c6973,_0x5ce200[_0x74b0('0x42')]);return db[_0x74b0('0x2d')][_0x74b0('0x4a')](_0x3c6973)[_0x74b0('0x23')](handleEntityNotFound(_0x24dcbd,null))[_0x74b0('0x23')](respondWithResult(_0x24dcbd,null))['catch'](handleError(_0x24dcbd,null));};exports['create']=function(_0x4edafa,_0x53551f){return db[_0x74b0('0x2d')][_0x74b0('0x4b')](_0x4edafa['body'],{})[_0x74b0('0x23')](function(_0x14cc33){var _0x163af6=_0x4edafa['user'][_0x74b0('0x25')]({'plain':!![]});if(!_0x163af6)throw new Error(_0x74b0('0x4c'));if(_0x163af6[_0x74b0('0x4d')]===_0x74b0('0x4e')){var _0x53bfb8=_0x14cc33[_0x74b0('0x25')]({'plain':!![]});var _0x2e3192=_0x74b0('0x4f');return db[_0x74b0('0x50')]['find']({'where':{'name':_0x2e3192,'userProfileId':_0x163af6[_0x74b0('0x51')]},'raw':!![]})[_0x74b0('0x23')](function(_0x24de7a){if(_0x24de7a&&_0x24de7a[_0x74b0('0x52')]===0x0){return db[_0x74b0('0x26')][_0x74b0('0x4b')]({'name':_0x53bfb8['name'],'resourceId':_0x53bfb8['id'],'type':_0x24de7a['name'],'sectionId':_0x24de7a['id']},{})['then'](function(){return _0x14cc33;});}else{return _0x14cc33;}})[_0x74b0('0x45')](function(_0x1a11ca){logger[_0x74b0('0x28')](_0x74b0('0x53'),_0x1a11ca);throw _0x1a11ca;});}return _0x14cc33;})[_0x74b0('0x23')](respondWithResult(_0x53551f,0xc9))[_0x74b0('0x45')](handleError(_0x53551f,null));};exports['update']=function(_0x5235d4,_0x239a1){if(_0x5235d4['body']['id']){delete _0x5235d4[_0x74b0('0x54')]['id'];}return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x5235d4[_0x74b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x239a1,null))['then'](saveUpdates(_0x5235d4[_0x74b0('0x54')],null))[_0x74b0('0x23')](respondWithResult(_0x239a1,null))[_0x74b0('0x45')](handleError(_0x239a1,null));};exports['destroy']=function(_0x706f2c,_0x510307){return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x706f2c['params']['id']}})['then'](handleEntityNotFound(_0x510307,null))[_0x74b0('0x23')](removeEntity(_0x510307,null))[_0x74b0('0x45')](handleError(_0x510307,null));};
\ No newline at end of file
+var _0x5b05=['undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','include','findAll','catch','show','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ChanSpies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset'];(function(_0x543294,_0x2688bf){var _0x3b3031=function(_0x1c433a){while(--_0x1c433a){_0x543294['push'](_0x543294['shift']());}};_0x3b3031(++_0x2688bf);}(_0x5b05,0x190));var _0x55b0=function(_0x4d4c9b,_0x1b2534){_0x4d4c9b=_0x4d4c9b-0x0;var _0x2d31f6=_0x5b05[_0x4d4c9b];return _0x2d31f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55b0('0x0'));var zipdir=require(_0x55b0('0x1'));var jsonpatch=require(_0x55b0('0x2'));var rp=require(_0x55b0('0x3'));var moment=require(_0x55b0('0x4'));var BPromise=require(_0x55b0('0x5'));var Mustache=require(_0x55b0('0x6'));var util=require(_0x55b0('0x7'));var path=require(_0x55b0('0x8'));var sox=require(_0x55b0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55b0('0xa'));var _=require(_0x55b0('0xb'));var squel=require(_0x55b0('0xc'));var crypto=require(_0x55b0('0xd'));var jsforce=require(_0x55b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x55b0('0xf'));var querystring=require(_0x55b0('0x10'));var Papa=require(_0x55b0('0x11'));var Redis=require(_0x55b0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x55b0('0x13'));var hardwareService=require(_0x55b0('0x14'));var logger=require(_0x55b0('0x15'))(_0x55b0('0x16'));var utils=require(_0x55b0('0x17'));var config=require(_0x55b0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x55b0('0x19'))['db'];function respondWithStatusCode(_0x35212d,_0x4d8be8){_0x4d8be8=_0x4d8be8||0xcc;return function(_0x8c1df0){if(_0x8c1df0){return _0x35212d[_0x55b0('0x1a')](_0x4d8be8);}return _0x35212d[_0x55b0('0x1b')](_0x4d8be8)[_0x55b0('0x1c')]();};}function respondWithResult(_0x5baa88,_0x525f9b){_0x525f9b=_0x525f9b||0xc8;return function(_0x4d614b){if(_0x4d614b){return _0x5baa88[_0x55b0('0x1b')](_0x525f9b)['json'](_0x4d614b);}};}function respondWithFilteredResult(_0x7d7527,_0x3ca8e2){return function(_0x4d2271){if(_0x4d2271){var _0x15fa8f=typeof _0x3ca8e2[_0x55b0('0x1d')]===_0x55b0('0x1e')&&typeof _0x3ca8e2[_0x55b0('0x1f')]===_0x55b0('0x1e');var _0x4f98ba=_0x4d2271[_0x55b0('0x20')];var _0x20b1c5=_0x15fa8f?0x0:_0x3ca8e2[_0x55b0('0x1d')];var _0x5ca2ec=_0x15fa8f?_0x4d2271['count']:_0x3ca8e2[_0x55b0('0x1d')]+_0x3ca8e2[_0x55b0('0x1f')];var _0x3f9458;if(_0x5ca2ec>=_0x4f98ba){_0x5ca2ec=_0x4f98ba;_0x3f9458=0xc8;}else{_0x3f9458=0xce;}_0x7d7527['status'](_0x3f9458);return _0x7d7527[_0x55b0('0x21')](_0x55b0('0x22'),_0x20b1c5+'-'+_0x5ca2ec+'/'+_0x4f98ba)[_0x55b0('0x23')](_0x4d2271);}return null;};}function patchUpdates(_0x3ff56c){return function(_0x55b08e){try{jsonpatch[_0x55b0('0x24')](_0x55b08e,_0x3ff56c,!![]);}catch(_0x27ecd1){return BPromise[_0x55b0('0x25')](_0x27ecd1);}return _0x55b08e[_0x55b0('0x26')]();};}function saveUpdates(_0x4fa147,_0x4082ce){return function(_0x5e3acc){if(_0x5e3acc){return _0x5e3acc[_0x55b0('0x27')](_0x4fa147)['then'](function(_0x33bcc1){return _0x33bcc1;});}return null;};}function removeEntity(_0x25eb8a,_0x1ea756){return function(_0x3056f8){if(_0x3056f8){return _0x3056f8[_0x55b0('0x28')]()[_0x55b0('0x29')](function(){var _0xa0ede8=_0x3056f8['get']({'plain':!![]});var _0x244092='ChanSpies';return db[_0x55b0('0x2a')][_0x55b0('0x28')]({'where':{'type':_0x244092,'resourceId':_0xa0ede8['id']}})[_0x55b0('0x29')](function(){return _0x3056f8;});})['then'](function(){_0x25eb8a[_0x55b0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x586d1b,_0x3c6c63){return function(_0x3842ff){if(!_0x3842ff){_0x586d1b[_0x55b0('0x1a')](0x194);}return _0x3842ff;};}function handleError(_0x68a9fa,_0x17bd73){_0x17bd73=_0x17bd73||0x1f4;return function(_0x20385f){logger[_0x55b0('0x2b')](_0x20385f[_0x55b0('0x2c')]);if(_0x20385f[_0x55b0('0x2d')]){delete _0x20385f[_0x55b0('0x2d')];}_0x68a9fa[_0x55b0('0x1b')](_0x17bd73)[_0x55b0('0x2e')](_0x20385f);};}exports[_0x55b0('0x2f')]=function(_0x11e555,_0xc62841){var _0x321752={},_0x564887={},_0x35fbf8={'count':0x0,'rows':[]};var _0x1cd7fa=_[_0x55b0('0x30')](db[_0x55b0('0x31')]['rawAttributes'],function(_0x30abf1){return{'name':_0x30abf1[_0x55b0('0x32')],'type':_0x30abf1[_0x55b0('0x33')][_0x55b0('0x34')]};});_0x564887[_0x55b0('0x35')]=_[_0x55b0('0x30')](_0x1cd7fa,'name');_0x564887[_0x55b0('0x36')]=_['keys'](_0x11e555[_0x55b0('0x36')]);_0x564887[_0x55b0('0x37')]=_[_0x55b0('0x38')](_0x564887[_0x55b0('0x35')],_0x564887[_0x55b0('0x36')]);_0x321752[_0x55b0('0x39')]=_[_0x55b0('0x38')](_0x564887[_0x55b0('0x35')],qs[_0x55b0('0x3a')](_0x11e555[_0x55b0('0x36')]['fields']));_0x321752[_0x55b0('0x39')]=_0x321752[_0x55b0('0x39')][_0x55b0('0x3b')]?_0x321752[_0x55b0('0x39')]:_0x564887[_0x55b0('0x35')];if(!_0x11e555[_0x55b0('0x36')][_0x55b0('0x3c')](_0x55b0('0x3d'))){_0x321752[_0x55b0('0x1f')]=qs['limit'](_0x11e555['query'][_0x55b0('0x1f')]);_0x321752['offset']=qs[_0x55b0('0x1d')](_0x11e555['query'][_0x55b0('0x1d')]);}_0x321752[_0x55b0('0x3e')]=qs['sort'](_0x11e555[_0x55b0('0x36')][_0x55b0('0x3f')]);_0x321752[_0x55b0('0x40')]=qs['filters'](_['pick'](_0x11e555['query'],_0x564887[_0x55b0('0x37')]),_0x1cd7fa);if(_0x11e555['query']['filter']){_0x321752[_0x55b0('0x40')]=_[_0x55b0('0x41')](_0x321752['where'],{'$or':_[_0x55b0('0x30')](_0x1cd7fa,function(_0x2768eb){if(_0x2768eb['type']!=='VIRTUAL'){var _0x330992={};_0x330992[_0x2768eb[_0x55b0('0x2d')]]={'$like':'%'+_0x11e555[_0x55b0('0x36')]['filter']+'%'};return _0x330992;}})});}_0x321752=_[_0x55b0('0x41')]({},_0x321752,_0x11e555[_0x55b0('0x42')]);var _0x1e82ad={'where':_0x321752[_0x55b0('0x40')]};return db[_0x55b0('0x31')][_0x55b0('0x20')](_0x1e82ad)[_0x55b0('0x29')](function(_0x163f93){_0x35fbf8[_0x55b0('0x20')]=_0x163f93;if(_0x11e555['query']['includeAll']){_0x321752[_0x55b0('0x43')]=[{'all':!![]}];}return db[_0x55b0('0x31')][_0x55b0('0x44')](_0x321752);})[_0x55b0('0x29')](function(_0x5cb5e1){_0x35fbf8['rows']=_0x5cb5e1;return _0x35fbf8;})['then'](respondWithFilteredResult(_0xc62841,_0x321752))[_0x55b0('0x45')](handleError(_0xc62841,null));};exports[_0x55b0('0x46')]=function(_0x1c8cfc,_0x18a283){var _0x95ed8d={'raw':![],'where':{'id':_0x1c8cfc['params']['id']}},_0x340c16={};_0x340c16[_0x55b0('0x35')]=_[_0x55b0('0x47')](db[_0x55b0('0x31')]['rawAttributes']);_0x340c16[_0x55b0('0x36')]=_[_0x55b0('0x47')](_0x1c8cfc[_0x55b0('0x36')]);_0x340c16[_0x55b0('0x37')]=_[_0x55b0('0x38')](_0x340c16[_0x55b0('0x35')],_0x340c16['query']);_0x95ed8d[_0x55b0('0x39')]=_['intersection'](_0x340c16[_0x55b0('0x35')],qs[_0x55b0('0x3a')](_0x1c8cfc[_0x55b0('0x36')][_0x55b0('0x3a')]));_0x95ed8d[_0x55b0('0x39')]=_0x95ed8d[_0x55b0('0x39')][_0x55b0('0x3b')]?_0x95ed8d[_0x55b0('0x39')]:_0x340c16['model'];if(_0x1c8cfc['query'][_0x55b0('0x48')]){_0x95ed8d[_0x55b0('0x43')]=[{'all':!![]}];}_0x95ed8d=_[_0x55b0('0x41')]({},_0x95ed8d,_0x1c8cfc[_0x55b0('0x42')]);return db['VoiceChanSpy']['find'](_0x95ed8d)[_0x55b0('0x29')](handleEntityNotFound(_0x18a283,null))[_0x55b0('0x29')](respondWithResult(_0x18a283,null))[_0x55b0('0x45')](handleError(_0x18a283,null));};exports['create']=function(_0x4b2df2,_0x7e2fc){return db['VoiceChanSpy'][_0x55b0('0x49')](_0x4b2df2[_0x55b0('0x4a')],{})[_0x55b0('0x29')](function(_0x100143){var _0x5730da=_0x4b2df2[_0x55b0('0x4b')]['get']({'plain':!![]});if(!_0x5730da)throw new Error(_0x55b0('0x4c'));if(_0x5730da[_0x55b0('0x4d')]===_0x55b0('0x4b')){var _0x955c43=_0x100143[_0x55b0('0x4e')]({'plain':!![]});var _0x5442c9=_0x55b0('0x4f');return db[_0x55b0('0x50')][_0x55b0('0x51')]({'where':{'name':_0x5442c9,'userProfileId':_0x5730da[_0x55b0('0x52')]},'raw':!![]})['then'](function(_0x395f54){if(_0x395f54&&_0x395f54[_0x55b0('0x53')]===0x0){return db[_0x55b0('0x2a')][_0x55b0('0x49')]({'name':_0x955c43[_0x55b0('0x2d')],'resourceId':_0x955c43['id'],'type':_0x395f54['name'],'sectionId':_0x395f54['id']},{})[_0x55b0('0x29')](function(){return _0x100143;});}else{return _0x100143;}})[_0x55b0('0x45')](function(_0x44ca57){logger['error'](_0x55b0('0x54'),_0x44ca57);throw _0x44ca57;});}return _0x100143;})[_0x55b0('0x29')](respondWithResult(_0x7e2fc,0xc9))[_0x55b0('0x45')](handleError(_0x7e2fc,null));};exports[_0x55b0('0x27')]=function(_0x2df6e6,_0x555c0f){if(_0x2df6e6[_0x55b0('0x4a')]['id']){delete _0x2df6e6[_0x55b0('0x4a')]['id'];}return db[_0x55b0('0x31')]['find']({'where':{'id':_0x2df6e6[_0x55b0('0x55')]['id']}})[_0x55b0('0x29')](handleEntityNotFound(_0x555c0f,null))[_0x55b0('0x29')](saveUpdates(_0x2df6e6['body'],null))[_0x55b0('0x29')](respondWithResult(_0x555c0f,null))['catch'](handleError(_0x555c0f,null));};exports[_0x55b0('0x28')]=function(_0x42f748,_0x567dc5){return db['VoiceChanSpy'][_0x55b0('0x51')]({'where':{'id':_0x42f748[_0x55b0('0x55')]['id']}})[_0x55b0('0x29')](handleEntityNotFound(_0x567dc5,null))[_0x55b0('0x29')](removeEntity(_0x567dc5,null))[_0x55b0('0x45')](handleError(_0x567dc5,null));};
\ No newline at end of file
index 30e152f..f6aa4b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcebc=['length','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','push','merge','CDR(type)=%s','MixMonitor','recordingFormat','password','SIP/%s,%s','options','join','StopMixMonitor','concat','internal','name','User','findAll','agent','then','catch','exports','define','VoiceExtension','bulkCreate','destroy'];(function(_0x15dff5,_0x2d22c1){var _0x3e3dd4=function(_0x31c582){while(--_0x31c582){_0x15dff5['push'](_0x15dff5['shift']());}};_0x3e3dd4(++_0x2d22c1);}(_0xcebc,0x1e1));var _0xcceb=function(_0x489a29,_0x41b4a8){_0x489a29=_0x489a29-0x0;var _0x5cd130=_0xcebc[_0x489a29];return _0x5cd130;};'use strict';var _=require(_0xcceb('0x0'));var util=require(_0xcceb('0x1'));var BPromise=require(_0xcceb('0x2'));var attributes=require(_0xcceb('0x3'));var getUserApplications=function(_0x20e21f,_0x21c17e,_0x462db3){var _0x48edb0=0x1;var _0x345d34=[];var _0x184b93={'context':_0x21c17e['context']||_0xcceb('0x4'),'exten':util[_0xcceb('0x5')](_0xcceb('0x6'),_0x20e21f[_0xcceb('0x7')],_0x462db3),'type':'system','isApp':![],'ChanSpyId':_0x20e21f['id'],'UserId':_0x21c17e['id']};_0x345d34[_0xcceb('0x8')](_[_0xcceb('0x9')]({'app':'Set','appdata':util[_0xcceb('0x5')](_0xcceb('0xa'),'chanspy'),'priority':_0x48edb0++},_0x184b93));if(_0x20e21f['record']){_0x345d34[_0xcceb('0x8')](_[_0xcceb('0x9')]({'app':_0xcceb('0xb'),'appdata':util[_0xcceb('0x5')]('${UNIQUEID}.%s,a',_0x20e21f[_0xcceb('0xc')]),'priority':_0x48edb0++},_0x184b93));}if(_0x20e21f['auth']){_0x345d34[_0xcceb('0x8')](_[_0xcceb('0x9')]({'app':'Authenticate','appdata':_0x20e21f[_0xcceb('0xd')],'priority':_0x48edb0++},_0x184b93));}_0x345d34[_0xcceb('0x8')](_['merge']({'app':'ChanSpy','appdata':util[_0xcceb('0x5')](_0xcceb('0xe'),_0x21c17e['name'],_0x20e21f[_0xcceb('0xf')]?_0x20e21f['options'][_0xcceb('0x10')](''):''),'priority':_0x48edb0++},_0x184b93));if(_0x20e21f['record']){_0x345d34[_0xcceb('0x8')](_[_0xcceb('0x9')]({'app':_0xcceb('0x11'),'priority':_0x48edb0++},_0x184b93));}return _0x345d34;};var getChanSpyApplications=function(_0x1428d8,_0x2fdba1){var _0x46ff7d=[];for(var _0xa67ea5=0x0,_0x1c2290=0x1;_0xa67ea5<_0x2fdba1['length'];_0xa67ea5++,_0x1c2290=0x1){_0x46ff7d=_0x46ff7d[_0xcceb('0x12')](getUserApplications(_0x1428d8,_0x2fdba1[_0xa67ea5],_0x2fdba1[_0xa67ea5][_0xcceb('0x13')]));if(_0x2fdba1[_0xa67ea5]['internal']!=_0x2fdba1[_0xa67ea5][_0xcceb('0x14')]){_0x46ff7d=_0x46ff7d[_0xcceb('0x12')](getUserApplications(_0x1428d8,_0x2fdba1[_0xa67ea5],_0x2fdba1[_0xa67ea5]['name']));}}return _0x46ff7d;};var getChanSpyPromise=function(_0x2b150c,_0xf33a4a){return new BPromise(function(_0x4c7576,_0x4f5bd0){return _0x2b150c[_0xcceb('0x15')][_0xcceb('0x16')]({'attributes':['id',_0xcceb('0x14'),'internal'],'where':{'role':_0xcceb('0x17'),'chanspy':!![]},'raw':!![]})[_0xcceb('0x18')](function(_0x491032){if(_0x491032){return _0x4c7576(getChanSpyApplications(_0xf33a4a,_0x491032));}return _0x4c7576([]);})[_0xcceb('0x19')](function(_0x4d30aa){_0x4f5bd0(_0x4d30aa);});});};module[_0xcceb('0x1a')]=function(_0x5944e4,_0x4a1644){var _0x48249b=_0x5944e4['models'];return _0x5944e4[_0xcceb('0x1b')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x36a9bf,_0x21a8bb,_0x4b1b81){return getChanSpyPromise(_0x48249b,_0x36a9bf)[_0xcceb('0x18')](function(_0x2f1619){if(_0x2f1619&&_0x2f1619['length']){return _0x48249b[_0xcceb('0x1c')][_0xcceb('0x1d')](_0x2f1619);}})['then'](function(){_0x4b1b81();})[_0xcceb('0x19')](function(_0x85af36){_0x4b1b81(_0x85af36);});},'afterUpdate':function(_0x5d5f1d,_0x4ae3b5,_0x440ced){return _0x48249b[_0xcceb('0x1c')][_0xcceb('0x1e')]({'where':{'ChanSpyId':_0x5d5f1d['id']}})[_0xcceb('0x18')](function(){return getChanSpyPromise(_0x48249b,_0x5d5f1d);})[_0xcceb('0x18')](function(_0x3ea1b1){if(_0x3ea1b1&&_0x3ea1b1[_0xcceb('0x1f')]){return _0x48249b[_0xcceb('0x1c')]['bulkCreate'](_0x3ea1b1);}})['then'](function(){_0x440ced();})['catch'](function(_0x5582d2){_0x440ced(_0x5582d2);});},'afterDestroy':function(_0x302a0a,_0xb5a1a9,_0x29533f){return _0x48249b[_0xcceb('0x1c')][_0xcceb('0x1e')]({'where':{'ChanSpyId':_0x302a0a['id']}})[_0xcceb('0x18')](function(){_0x29533f();})[_0xcceb('0x19')](function(_0xcd90a3){_0x29533f(_0xcd90a3);});}}});};
\ No newline at end of file
+var _0x9c09=['recordingFormat','Authenticate','ChanSpy','options','join','length','internal','concat','User','findAll','name','agent','then','catch','exports','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x9c09,0x1c3));var _0x99c0=function(_0x5cf016,_0x43ada9){_0x5cf016=_0x5cf016-0x0;var _0x41a7ba=_0x9c09[_0x5cf016];return _0x41a7ba;};'use strict';var _=require(_0x99c0('0x0'));var util=require(_0x99c0('0x1'));var BPromise=require(_0x99c0('0x2'));var attributes=require(_0x99c0('0x3'));var getUserApplications=function(_0x2ef189,_0x50ea7e,_0xfc398f){var _0x53d997=0x1;var _0x4541da=[];var _0x561bb6={'context':_0x50ea7e[_0x99c0('0x4')]||_0x99c0('0x5'),'exten':util[_0x99c0('0x6')]('%s%s',_0x2ef189[_0x99c0('0x7')],_0xfc398f),'type':_0x99c0('0x8'),'isApp':![],'ChanSpyId':_0x2ef189['id'],'UserId':_0x50ea7e['id']};_0x4541da[_0x99c0('0x9')](_[_0x99c0('0xa')]({'app':_0x99c0('0xb'),'appdata':util['format'](_0x99c0('0xc'),_0x99c0('0xd')),'priority':_0x53d997++},_0x561bb6));if(_0x2ef189[_0x99c0('0xe')]){_0x4541da[_0x99c0('0x9')](_['merge']({'app':_0x99c0('0xf'),'appdata':util[_0x99c0('0x6')](_0x99c0('0x10'),_0x2ef189[_0x99c0('0x11')]),'priority':_0x53d997++},_0x561bb6));}if(_0x2ef189['auth']){_0x4541da[_0x99c0('0x9')](_[_0x99c0('0xa')]({'app':_0x99c0('0x12'),'appdata':_0x2ef189['password'],'priority':_0x53d997++},_0x561bb6));}_0x4541da[_0x99c0('0x9')](_[_0x99c0('0xa')]({'app':_0x99c0('0x13'),'appdata':util[_0x99c0('0x6')]('SIP/%s,%s',_0x50ea7e['name'],_0x2ef189['options']?_0x2ef189[_0x99c0('0x14')][_0x99c0('0x15')](''):''),'priority':_0x53d997++},_0x561bb6));if(_0x2ef189[_0x99c0('0xe')]){_0x4541da['push'](_[_0x99c0('0xa')]({'app':'StopMixMonitor','priority':_0x53d997++},_0x561bb6));}return _0x4541da;};var getChanSpyApplications=function(_0x17f10e,_0xe509e4){var _0x1fa184=[];for(var _0x1ab19d=0x0,_0x464015=0x1;_0x1ab19d<_0xe509e4[_0x99c0('0x16')];_0x1ab19d++,_0x464015=0x1){_0x1fa184=_0x1fa184['concat'](getUserApplications(_0x17f10e,_0xe509e4[_0x1ab19d],_0xe509e4[_0x1ab19d][_0x99c0('0x17')]));if(_0xe509e4[_0x1ab19d]['internal']!=_0xe509e4[_0x1ab19d]['name']){_0x1fa184=_0x1fa184[_0x99c0('0x18')](getUserApplications(_0x17f10e,_0xe509e4[_0x1ab19d],_0xe509e4[_0x1ab19d]['name']));}}return _0x1fa184;};var getChanSpyPromise=function(_0x9437db,_0x2c6f33){return new BPromise(function(_0x257aa2,_0x3d3f53){return _0x9437db[_0x99c0('0x19')][_0x99c0('0x1a')]({'attributes':['id',_0x99c0('0x1b'),'internal'],'where':{'role':_0x99c0('0x1c'),'chanspy':!![]},'raw':!![]})[_0x99c0('0x1d')](function(_0x32b362){if(_0x32b362){return _0x257aa2(getChanSpyApplications(_0x2c6f33,_0x32b362));}return _0x257aa2([]);})[_0x99c0('0x1e')](function(_0x3885b9){_0x3d3f53(_0x3885b9);});});};module[_0x99c0('0x1f')]=function(_0x2bc861,_0x5ce80b){var _0xb2c7b4=_0x2bc861['models'];return _0x2bc861['define']('VoiceChanSpy',attributes,{'tableName':_0x99c0('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x54908c,_0x3165e8,_0x355fa4){return getChanSpyPromise(_0xb2c7b4,_0x54908c)[_0x99c0('0x1d')](function(_0x48b737){if(_0x48b737&&_0x48b737[_0x99c0('0x16')]){return _0xb2c7b4[_0x99c0('0x21')][_0x99c0('0x22')](_0x48b737);}})['then'](function(){_0x355fa4();})[_0x99c0('0x1e')](function(_0x29d71b){_0x355fa4(_0x29d71b);});},'afterUpdate':function(_0x5e9eb6,_0x3ecbfb,_0x6e21ad){return _0xb2c7b4['VoiceExtension'][_0x99c0('0x23')]({'where':{'ChanSpyId':_0x5e9eb6['id']}})[_0x99c0('0x1d')](function(){return getChanSpyPromise(_0xb2c7b4,_0x5e9eb6);})[_0x99c0('0x1d')](function(_0x46e7e9){if(_0x46e7e9&&_0x46e7e9[_0x99c0('0x16')]){return _0xb2c7b4['VoiceExtension'][_0x99c0('0x22')](_0x46e7e9);}})[_0x99c0('0x1d')](function(){_0x6e21ad();})[_0x99c0('0x1e')](function(_0x4a50cf){_0x6e21ad(_0x4a50cf);});},'afterDestroy':function(_0x1597c1,_0x59329d,_0x439d7b){return _0xb2c7b4[_0x99c0('0x21')][_0x99c0('0x23')]({'where':{'ChanSpyId':_0x1597c1['id']}})['then'](function(){_0x439d7b();})[_0x99c0('0x1e')](function(_0x41e35f){_0x439d7b(_0x41e35f);});}}});};
\ No newline at end of file
index 231532e..8f62d8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc29b=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x20b363,_0x18a5bc){var _0x34571f=function(_0x578105){while(--_0x578105){_0x20b363['push'](_0x20b363['shift']());}};_0x34571f(++_0x18a5bc);}(_0xc29b,0x12d));var _0xbc29=function(_0x4c9072,_0x4a6cea){_0x4c9072=_0x4c9072-0x0;var _0x3d19de=_0xc29b[_0x4c9072];return _0x3d19de;};'use strict';var _=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var moment=require(_0xbc29('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc29('0x3'));var fs=require('fs');var Redis=require(_0xbc29('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc29('0x5'));var logger=require(_0xbc29('0x6'))(_0xbc29('0x7'));var config=require(_0xbc29('0x8'));var jayson=require(_0xbc29('0x9'));var client=jayson[_0xbc29('0xa')][_0xbc29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40f0c9,_0x463e2b,_0x37d9dd){return new BPromise(function(_0x2e5fb7,_0x29b188){return client[_0xbc29('0xc')](_0x40f0c9,_0x37d9dd)[_0xbc29('0xd')](function(_0x320cb4){logger[_0xbc29('0xe')](_0xbc29('0xf'),_0x463e2b,_0xbc29('0x10'));logger[_0xbc29('0x11')](_0xbc29('0x12'),_0x463e2b,'request\x20sent',JSON[_0xbc29('0x13')](_0x320cb4));if(_0x320cb4[_0xbc29('0x14')]){if(_0x320cb4[_0xbc29('0x14')][_0xbc29('0x15')]===0x1f4){logger[_0xbc29('0x14')](_0xbc29('0xf'),_0x463e2b,_0x320cb4[_0xbc29('0x14')]['message']);return _0x29b188(_0x320cb4[_0xbc29('0x14')][_0xbc29('0x16')]);}logger[_0xbc29('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x463e2b,_0x320cb4['error'][_0xbc29('0x16')]);return _0x2e5fb7(_0x320cb4['error'][_0xbc29('0x16')]);}else{logger[_0xbc29('0xe')](_0xbc29('0xf'),_0x463e2b,'request\x20sent');_0x2e5fb7(_0x320cb4[_0xbc29('0x17')]['message']);}})[_0xbc29('0x18')](function(_0x3b5bae){logger[_0xbc29('0x14')](_0xbc29('0xf'),_0x463e2b,_0x3b5bae);_0x29b188(_0x3b5bae);});});}
\ No newline at end of file
+var _0x4876=['stringify','error','code','message','result','catch','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x377d13,_0x3efde4){var _0xba8db4=function(_0x4b3769){while(--_0x4b3769){_0x377d13['push'](_0x377d13['shift']());}};_0xba8db4(++_0x3efde4);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6487('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6487('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x6487('0x2'));var logger=require(_0x6487('0x3'))(_0x6487('0x4'));var config=require(_0x6487('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6487('0x6')][_0x6487('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52177e,_0x289918,_0x14d6d8){return new BPromise(function(_0x2df3c1,_0x3f237a){return client[_0x6487('0x8')](_0x52177e,_0x14d6d8)[_0x6487('0x9')](function(_0x84bd9f){logger[_0x6487('0xa')](_0x6487('0xb'),_0x289918,'request\x20sent');logger[_0x6487('0xc')](_0x6487('0xd'),_0x289918,_0x6487('0xe'),JSON[_0x6487('0xf')](_0x84bd9f));if(_0x84bd9f[_0x6487('0x10')]){if(_0x84bd9f[_0x6487('0x10')][_0x6487('0x11')]===0x1f4){logger[_0x6487('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x289918,_0x84bd9f[_0x6487('0x10')][_0x6487('0x12')]);return _0x3f237a(_0x84bd9f[_0x6487('0x10')][_0x6487('0x12')]);}logger['error'](_0x6487('0xb'),_0x289918,_0x84bd9f[_0x6487('0x10')][_0x6487('0x12')]);return _0x2df3c1(_0x84bd9f[_0x6487('0x10')]['message']);}else{logger['info'](_0x6487('0xb'),_0x289918,'request\x20sent');_0x2df3c1(_0x84bd9f[_0x6487('0x13')]['message']);}})[_0x6487('0x14')](function(_0x3e7560){logger[_0x6487('0x10')](_0x6487('0xb'),_0x289918,_0x3e7560);_0x3f237a(_0x3e7560);});});}
\ No newline at end of file
index e4abd8f..afaab34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5069=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x1a3b17,_0x275664){var _0x473739=function(_0x13ff24){while(--_0x13ff24){_0x1a3b17['push'](_0x1a3b17['shift']());}};_0x473739(++_0x275664);}(_0x5069,0xc0));var _0x9506=function(_0x5520cf,_0x4dc97c){_0x5520cf=_0x5520cf-0x0;var _0x27f48c=_0x5069[_0x5520cf];return _0x27f48c;};'use strict';var multer=require(_0x9506('0x0'));var util=require(_0x9506('0x1'));var path=require(_0x9506('0x2'));var timeout=require(_0x9506('0x3'));var express=require('express');var router=express[_0x9506('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9506('0x5'));var interaction=require(_0x9506('0x6'));var config=require(_0x9506('0x7'));var controller=require(_0x9506('0x8'));router[_0x9506('0x9')]('/',auth[_0x9506('0xa')](),controller[_0x9506('0xb')]);router[_0x9506('0x9')]('/:id',auth[_0x9506('0xa')](),controller[_0x9506('0xc')]);router[_0x9506('0xd')]('/',auth[_0x9506('0xa')](),controller[_0x9506('0xe')]);router[_0x9506('0xf')](_0x9506('0x10'),auth[_0x9506('0xa')](),controller[_0x9506('0x11')]);router[_0x9506('0x12')](_0x9506('0x10'),auth[_0x9506('0xa')](),controller[_0x9506('0x13')]);module[_0x9506('0x14')]=router;
\ No newline at end of file
+var _0xd28a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1f22c6,_0x4a2a05){var _0x37a2bd=function(_0xa4941e){while(--_0xa4941e){_0x1f22c6['push'](_0x1f22c6['shift']());}};_0x37a2bd(++_0x4a2a05);}(_0xd28a,0xbc));var _0xad28=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd28a[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xad28('0x0'));var util=require(_0xad28('0x1'));var path=require(_0xad28('0x2'));var timeout=require(_0xad28('0x3'));var express=require(_0xad28('0x4'));var router=express['Router']();var fs_extra=require(_0xad28('0x5'));var auth=require(_0xad28('0x6'));var interaction=require(_0xad28('0x7'));var config=require(_0xad28('0x8'));var controller=require('./voiceContext.controller');router[_0xad28('0x9')]('/',auth[_0xad28('0xa')](),controller[_0xad28('0xb')]);router[_0xad28('0x9')](_0xad28('0xc'),auth[_0xad28('0xa')](),controller[_0xad28('0xd')]);router[_0xad28('0xe')]('/',auth['isAuthenticated'](),controller[_0xad28('0xf')]);router[_0xad28('0x10')](_0xad28('0xc'),auth['isAuthenticated'](),controller[_0xad28('0x11')]);router[_0xad28('0x12')](_0xad28('0xc'),auth[_0xad28('0xa')](),controller[_0xad28('0x13')]);module[_0xad28('0x14')]=router;
\ No newline at end of file
index 3184348..9a71c38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fe2=['sequelize','STRING','name','BOOLEAN'];(function(_0xb1c5d5,_0x3a2038){var _0x3766dc=function(_0x12344b){while(--_0x12344b){_0xb1c5d5['push'](_0xb1c5d5['shift']());}};_0x3766dc(++_0x3a2038);}(_0x6fe2,0x118));var _0x26fe=function(_0x19f304,_0x45bdc1){_0x19f304=_0x19f304-0x0;var _0x5dd574=_0x6fe2[_0x19f304];return _0x5dd574;};'use strict';var Sequelize=require(_0x26fe('0x0'));module['exports']={'name':{'type':Sequelize[_0x26fe('0x1')],'unique':_0x26fe('0x2')},'description':{'type':Sequelize[_0x26fe('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x26fe('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x02c1=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4a4c9f,_0x5cce76){var _0x5af457=function(_0x24a8af){while(--_0x24a8af){_0x4a4c9f['push'](_0x4a4c9f['shift']());}};_0x5af457(++_0x5cce76);}(_0x02c1,0x1a1));var _0x102c=function(_0x4c7d08,_0x58d4b8){_0x4c7d08=_0x4c7d08-0x0;var _0xb691b6=_0x02c1[_0x4c7d08];return _0xb691b6;};'use strict';var Sequelize=require(_0x102c('0x0'));module[_0x102c('0x1')]={'name':{'type':Sequelize[_0x102c('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x102c('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x102c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 7ac9d44..8525fb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f84=['autoAssociation','join','root','writeFileSync','destroy','utf8','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','get','Contexts','UserProfileResource','sendStatus','stack','name','send','map','VoiceContext','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','filters','where','merge','filter','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','readFileSync','server/files/templates/context.ejs','render','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId'];(function(_0x1e09a1,_0x1c14f9){var _0x24ac77=function(_0x272fa1){while(--_0x272fa1){_0x1e09a1['push'](_0x1e09a1['shift']());}};_0x24ac77(++_0x1c14f9);}(_0x5f84,0x197));var _0x45f8=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x5f84[_0x46698a];return _0x356db0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45f8('0x0'));var zipdir=require(_0x45f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x45f8('0x2'));var moment=require('moment');var BPromise=require(_0x45f8('0x3'));var Mustache=require(_0x45f8('0x4'));var util=require(_0x45f8('0x5'));var path=require(_0x45f8('0x6'));var sox=require('sox');var csv=require(_0x45f8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45f8('0x8'));var _=require(_0x45f8('0x9'));var squel=require(_0x45f8('0xa'));var crypto=require(_0x45f8('0xb'));var jsforce=require(_0x45f8('0xc'));var deskjs=require(_0x45f8('0xd'));var toCsv=require(_0x45f8('0x7'));var querystring=require(_0x45f8('0xe'));var Papa=require(_0x45f8('0xf'));var Redis=require(_0x45f8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x45f8('0x11'));var as=require(_0x45f8('0x12'));var hardwareService=require(_0x45f8('0x13'));var logger=require('../../config/logger')(_0x45f8('0x14'));var utils=require('../../config/utils');var config=require(_0x45f8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x45f8('0x16'));var client=jayson[_0x45f8('0x17')][_0x45f8('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x50f5b1,_0x214983,_0x38cebb,_0x4d5299){return new BPromise(function(_0x2472e7,_0xf53492){var _0x5ce453=_0x4d5299||client;return _0x5ce453['request'](_0x50f5b1,_0x38cebb)[_0x45f8('0x19')](function(_0x3dac96){logger[_0x45f8('0x1a')](_0x45f8('0x1b'),_0x214983,_0x45f8('0x1c'));logger[_0x45f8('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x214983,'request\x20sent',JSON[_0x45f8('0x1e')](_0x3dac96));if(_0x3dac96[_0x45f8('0x1f')]){if(_0x3dac96['error'][_0x45f8('0x20')]===0x1f4){logger[_0x45f8('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x214983,_0x3dac96[_0x45f8('0x1f')]['message']);return _0xf53492(_0x3dac96[_0x45f8('0x1f')][_0x45f8('0x21')]);}logger[_0x45f8('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x214983,_0x3dac96[_0x45f8('0x1f')][_0x45f8('0x21')]);return _0x2472e7(_0x3dac96['error'][_0x45f8('0x21')]);}else{logger[_0x45f8('0x1a')](_0x45f8('0x1b'),_0x214983,_0x45f8('0x1c'));_0x2472e7(_0x3dac96[_0x45f8('0x22')]['message']);}})[_0x45f8('0x23')](function(_0x1d20d1){logger[_0x45f8('0x1f')](_0x45f8('0x1b'),_0x214983,_0x1d20d1);_0xf53492(_0x1d20d1);});});}function respondWithStatusCode(_0xa82c8e,_0x41ff39){_0x41ff39=_0x41ff39||0xcc;return function(_0x19372f){if(_0x19372f){return _0xa82c8e['sendStatus'](_0x41ff39);}return _0xa82c8e[_0x45f8('0x24')](_0x41ff39)[_0x45f8('0x25')]();};}function respondWithResult(_0x58132c,_0x2c5559){_0x2c5559=_0x2c5559||0xc8;return function(_0x4001a3){if(_0x4001a3){return _0x58132c[_0x45f8('0x24')](_0x2c5559)[_0x45f8('0x26')](_0x4001a3);}};}function respondWithFilteredResult(_0x1734f2,_0x2f39ce){return function(_0x166643){if(_0x166643){var _0x118826=typeof _0x2f39ce['offset']===_0x45f8('0x27')&&typeof _0x2f39ce['limit']===_0x45f8('0x27');var _0x1502f3=_0x166643[_0x45f8('0x28')];var _0x4e785b=_0x118826?0x0:_0x2f39ce['offset'];var _0x276d56=_0x118826?_0x166643['count']:_0x2f39ce[_0x45f8('0x29')]+_0x2f39ce[_0x45f8('0x2a')];var _0x51e50a;if(_0x276d56>=_0x1502f3){_0x276d56=_0x1502f3;_0x51e50a=0xc8;}else{_0x51e50a=0xce;}_0x1734f2[_0x45f8('0x24')](_0x51e50a);return _0x1734f2[_0x45f8('0x2b')](_0x45f8('0x2c'),_0x4e785b+'-'+_0x276d56+'/'+_0x1502f3)[_0x45f8('0x26')](_0x166643);}return null;};}function patchUpdates(_0xc616fb){return function(_0x36f33f){try{jsonpatch[_0x45f8('0x2d')](_0x36f33f,_0xc616fb,!![]);}catch(_0x35de3f){return BPromise['reject'](_0x35de3f);}return _0x36f33f['save']();};}function saveUpdates(_0x5591b8,_0x20250d){return function(_0x276a2b){if(_0x276a2b){return _0x276a2b[_0x45f8('0x2e')](_0x5591b8)[_0x45f8('0x19')](function(_0x2c0b87){return _0x2c0b87;});}return null;};}function removeEntity(_0xd42170,_0x14e874){return function(_0x4db167){if(_0x4db167){return _0x4db167['destroy']()['then'](function(){var _0x40f73a=_0x4db167[_0x45f8('0x2f')]({'plain':!![]});var _0x442524=_0x45f8('0x30');return db[_0x45f8('0x31')]['destroy']({'where':{'type':_0x442524,'resourceId':_0x40f73a['id']}})[_0x45f8('0x19')](function(){return _0x4db167;});})[_0x45f8('0x19')](function(){_0xd42170[_0x45f8('0x24')](0xcc)[_0x45f8('0x25')]();});}};}function handleEntityNotFound(_0x36df4f,_0x1b39e7){return function(_0x433ce7){if(!_0x433ce7){_0x36df4f[_0x45f8('0x32')](0x194);}return _0x433ce7;};}function handleError(_0x70d0ff,_0x2e9c25){_0x2e9c25=_0x2e9c25||0x1f4;return function(_0x31f492){logger[_0x45f8('0x1f')](_0x31f492[_0x45f8('0x33')]);if(_0x31f492['name']){delete _0x31f492[_0x45f8('0x34')];}_0x70d0ff[_0x45f8('0x24')](_0x2e9c25)[_0x45f8('0x35')](_0x31f492);};}exports['index']=function(_0x40c655,_0x2bec53){var _0x1aa256={},_0x1a55bc={},_0xaaa658={'count':0x0,'rows':[]};var _0x495d88=_[_0x45f8('0x36')](db[_0x45f8('0x37')][_0x45f8('0x38')],function(_0x5b6466){return{'name':_0x5b6466[_0x45f8('0x39')],'type':_0x5b6466[_0x45f8('0x3a')][_0x45f8('0x3b')]};});_0x1a55bc['model']=_[_0x45f8('0x36')](_0x495d88,_0x45f8('0x34'));_0x1a55bc[_0x45f8('0x3c')]=_['keys'](_0x40c655[_0x45f8('0x3c')]);_0x1a55bc['filters']=_[_0x45f8('0x3d')](_0x1a55bc[_0x45f8('0x3e')],_0x1a55bc[_0x45f8('0x3c')]);_0x1aa256['attributes']=_['intersection'](_0x1a55bc[_0x45f8('0x3e')],qs[_0x45f8('0x3f')](_0x40c655['query'][_0x45f8('0x3f')]));_0x1aa256[_0x45f8('0x40')]=_0x1aa256[_0x45f8('0x40')][_0x45f8('0x41')]?_0x1aa256[_0x45f8('0x40')]:_0x1a55bc[_0x45f8('0x3e')];if(!_0x40c655['query'][_0x45f8('0x42')](_0x45f8('0x43'))){_0x1aa256['limit']=qs[_0x45f8('0x2a')](_0x40c655['query']['limit']);_0x1aa256[_0x45f8('0x29')]=qs[_0x45f8('0x29')](_0x40c655[_0x45f8('0x3c')]['offset']);}_0x1aa256[_0x45f8('0x44')]=qs['sort'](_0x40c655['query']['sort']);_0x1aa256['where']=qs['filters'](_['pick'](_0x40c655['query'],_0x1a55bc[_0x45f8('0x45')]),_0x495d88);if(_0x40c655[_0x45f8('0x3c')]['filter']){_0x1aa256[_0x45f8('0x46')]=_[_0x45f8('0x47')](_0x1aa256[_0x45f8('0x46')],{'$or':_[_0x45f8('0x36')](_0x495d88,function(_0x13d537){if(_0x13d537[_0x45f8('0x3a')]!=='VIRTUAL'){var _0x76c6fa={};_0x76c6fa[_0x13d537[_0x45f8('0x34')]]={'$like':'%'+_0x40c655[_0x45f8('0x3c')][_0x45f8('0x48')]+'%'};return _0x76c6fa;}})});}_0x1aa256=_[_0x45f8('0x47')]({},_0x1aa256,_0x40c655[_0x45f8('0x49')]);var _0x3122ca={'where':_0x1aa256[_0x45f8('0x46')]};return db[_0x45f8('0x37')][_0x45f8('0x28')](_0x3122ca)[_0x45f8('0x19')](function(_0x33def2){_0xaaa658[_0x45f8('0x28')]=_0x33def2;if(_0x40c655[_0x45f8('0x3c')][_0x45f8('0x4a')]){_0x1aa256[_0x45f8('0x4b')]=[{'all':!![]}];}return db[_0x45f8('0x37')][_0x45f8('0x4c')](_0x1aa256);})[_0x45f8('0x19')](function(_0x19373c){_0xaaa658[_0x45f8('0x4d')]=_0x19373c;return _0xaaa658;})['then'](respondWithFilteredResult(_0x2bec53,_0x1aa256))['catch'](handleError(_0x2bec53,null));};exports[_0x45f8('0x4e')]=function(_0x4a02f7,_0x5adc3e){var _0x4d5d68={'raw':![],'where':{'id':_0x4a02f7[_0x45f8('0x4f')]['id']}},_0x18badf={};_0x18badf['model']=_[_0x45f8('0x50')](db[_0x45f8('0x37')][_0x45f8('0x38')]);_0x18badf[_0x45f8('0x3c')]=_[_0x45f8('0x50')](_0x4a02f7['query']);_0x18badf['filters']=_[_0x45f8('0x3d')](_0x18badf['model'],_0x18badf[_0x45f8('0x3c')]);_0x4d5d68[_0x45f8('0x40')]=_['intersection'](_0x18badf[_0x45f8('0x3e')],qs['fields'](_0x4a02f7[_0x45f8('0x3c')]['fields']));_0x4d5d68[_0x45f8('0x40')]=_0x4d5d68[_0x45f8('0x40')][_0x45f8('0x41')]?_0x4d5d68[_0x45f8('0x40')]:_0x18badf[_0x45f8('0x3e')];if(_0x4a02f7[_0x45f8('0x3c')][_0x45f8('0x4a')]){_0x4d5d68[_0x45f8('0x4b')]=[{'all':!![]}];}_0x4d5d68=_[_0x45f8('0x47')]({},_0x4d5d68,_0x4a02f7[_0x45f8('0x49')]);return db['VoiceContext'][_0x45f8('0x51')](_0x4d5d68)[_0x45f8('0x19')](handleEntityNotFound(_0x5adc3e,null))[_0x45f8('0x19')](respondWithResult(_0x5adc3e,null))['catch'](handleError(_0x5adc3e,null));};exports[_0x45f8('0x52')]=function(_0x342b3b,_0x373f38,_0x396a8f){var _0x497d65;return db[_0x45f8('0x37')][_0x45f8('0x52')](_0x342b3b[_0x45f8('0x53')],{'raw':!![]})[_0x45f8('0x19')](function(_0x239956){_0x497d65=_0x239956;return db[_0x45f8('0x37')]['findAll']({'raw':!![]});})['then'](function(_0x1581c3){var _0xb32d73=fs[_0x45f8('0x54')](path['join'](config['root'],_0x45f8('0x55')),'utf8');var _0x1d3df3=ejs[_0x45f8('0x56')](_0xb32d73,{'contexts':_0x1581c3||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x1d3df3);})[_0x45f8('0x19')](function(){return respondWithRpcPromise(_0x45f8('0x57'),'create',{'module':_0x45f8('0x58')});})[_0x45f8('0x19')](function(){var _0x17f464=_0x342b3b[_0x45f8('0x59')][_0x45f8('0x2f')]({'plain':!![]});if(!_0x17f464)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17f464[_0x45f8('0x5a')]===_0x45f8('0x59')){var _0x4ba3ca=_0x497d65['get']({'plain':!![]});return db[_0x45f8('0x5b')][_0x45f8('0x51')]({'where':{'name':_0x45f8('0x30'),'userProfileId':_0x17f464[_0x45f8('0x5c')]},'raw':!![]})['then'](function(_0x1ea649){if(_0x1ea649&&_0x1ea649[_0x45f8('0x5d')]===0x0){return db[_0x45f8('0x31')]['create']({'name':_0x4ba3ca['name'],'resourceId':_0x4ba3ca['id'],'type':_0x1ea649[_0x45f8('0x34')],'sectionId':_0x1ea649['id']},{})[_0x45f8('0x19')](function(){return _0x497d65;});}else{return _0x497d65;}})[_0x45f8('0x23')](function(_0x3e7215){logger[_0x45f8('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e7215);throw _0x3e7215;});}return _0x497d65;})[_0x45f8('0x19')](respondWithResult(_0x373f38,0xc9))[_0x45f8('0x23')](handleError(_0x373f38,null));};exports['update']=function(_0x53ba58,_0x4c98a1,_0x5cd114){var _0x24fb93;return db['VoiceContext']['find']({'where':{'id':_0x53ba58[_0x45f8('0x4f')]['id']}})[_0x45f8('0x19')](handleEntityNotFound(_0x4c98a1,null))['then'](saveUpdates(_0x53ba58[_0x45f8('0x53')],null))[_0x45f8('0x19')](function(_0x2fc226){if(_0x2fc226){_0x24fb93=_0x2fc226;return db[_0x45f8('0x37')]['findAll']({'raw':!![]});}})[_0x45f8('0x19')](function(_0x2dcb83){var _0x48df2d=fs[_0x45f8('0x54')](path[_0x45f8('0x5e')](config[_0x45f8('0x5f')],_0x45f8('0x55')),'utf8');var _0x49fee5=ejs[_0x45f8('0x56')](_0x48df2d,{'contexts':_0x2dcb83||[]});fs[_0x45f8('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x49fee5);})[_0x45f8('0x19')](function(){return respondWithRpcPromise('Reload',_0x45f8('0x2e'),{'module':_0x45f8('0x58')});})[_0x45f8('0x19')](function(){return _0x24fb93;})['then'](respondWithResult(_0x4c98a1,null))['catch'](handleError(_0x4c98a1,null));};exports[_0x45f8('0x61')]=function(_0x55c189,_0x40e09d,_0x31e002){var _0x2d558e;return db[_0x45f8('0x37')][_0x45f8('0x51')]({'where':{'id':_0x55c189[_0x45f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x40e09d,null))['then'](removeEntity(_0x40e09d,null))[_0x45f8('0x19')](function(){return db[_0x45f8('0x37')][_0x45f8('0x4c')]({'raw':!![]});})[_0x45f8('0x19')](function(_0x5a1b3c){var _0x11c4ce=fs[_0x45f8('0x54')](path[_0x45f8('0x5e')](config[_0x45f8('0x5f')],'server/files/templates/context.ejs'),_0x45f8('0x62'));var _0x21d510=ejs[_0x45f8('0x56')](_0x11c4ce,{'contexts':_0x5a1b3c});fs[_0x45f8('0x60')](_0x45f8('0x63'),_0x21d510);return respondWithRpcPromise(_0x45f8('0x57'),_0x45f8('0x61'),{'module':'chan_sip.so'});})[_0x45f8('0x23')](handleError(_0x40e09d,null));};
\ No newline at end of file
+var _0xb33d=['request-promise','moment','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','sendStatus','stack','name','send','VoiceContext','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','params','length','find','create','body','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','readFileSync','join','eml-format','rimraf','zip-dir'];(function(_0x4df58e,_0xf2d8dd){var _0x16ac17=function(_0x28a08c){while(--_0x28a08c){_0x4df58e['push'](_0x4df58e['shift']());}};_0x16ac17(++_0xf2d8dd);}(_0xb33d,0xc7));var _0xdb33=function(_0x3412e0,_0x5c4e4f){_0x3412e0=_0x3412e0-0x0;var _0x479b68=_0xb33d[_0x3412e0];return _0x479b68;};'use strict';var emlformat=require(_0xdb33('0x0'));var rimraf=require(_0xdb33('0x1'));var zipdir=require(_0xdb33('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb33('0x3'));var moment=require(_0xdb33('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdb33('0x5'));var sox=require(_0xdb33('0x6'));var csv=require(_0xdb33('0x7'));var ejs=require(_0xdb33('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb33('0x9'));var squel=require(_0xdb33('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdb33('0xb'));var toCsv=require(_0xdb33('0x7'));var querystring=require('querystring');var Papa=require(_0xdb33('0xc'));var Redis=require('ioredis');var authService=require(_0xdb33('0xd'));var qs=require(_0xdb33('0xe'));var as=require(_0xdb33('0xf'));var hardwareService=require(_0xdb33('0x10'));var logger=require(_0xdb33('0x11'))(_0xdb33('0x12'));var utils=require(_0xdb33('0x13'));var config=require(_0xdb33('0x14'));var licenseUtil=require(_0xdb33('0x15'));var db=require(_0xdb33('0x16'))['db'];var jayson=require(_0xdb33('0x17'));var client=jayson[_0xdb33('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x436feb,_0x26c855,_0x5b208b,_0x1f01b4){return new BPromise(function(_0x9617bc,_0x3be66f){var _0x381208=_0x1f01b4||client;return _0x381208[_0xdb33('0x19')](_0x436feb,_0x5b208b)[_0xdb33('0x1a')](function(_0x37ccea){logger[_0xdb33('0x1b')](_0xdb33('0x1c'),_0x26c855,'request\x20sent');logger['debug'](_0xdb33('0x1d'),_0x26c855,_0xdb33('0x1e'),JSON[_0xdb33('0x1f')](_0x37ccea));if(_0x37ccea['error']){if(_0x37ccea[_0xdb33('0x20')][_0xdb33('0x21')]===0x1f4){logger['error'](_0xdb33('0x1c'),_0x26c855,_0x37ccea[_0xdb33('0x20')]['message']);return _0x3be66f(_0x37ccea[_0xdb33('0x20')][_0xdb33('0x22')]);}logger[_0xdb33('0x20')](_0xdb33('0x1c'),_0x26c855,_0x37ccea[_0xdb33('0x20')][_0xdb33('0x22')]);return _0x9617bc(_0x37ccea[_0xdb33('0x20')]['message']);}else{logger[_0xdb33('0x1b')](_0xdb33('0x1c'),_0x26c855,_0xdb33('0x1e'));_0x9617bc(_0x37ccea[_0xdb33('0x23')][_0xdb33('0x22')]);}})['catch'](function(_0x53a4e3){logger['error'](_0xdb33('0x1c'),_0x26c855,_0x53a4e3);_0x3be66f(_0x53a4e3);});});}function respondWithStatusCode(_0x55ee4f,_0xad20e9){_0xad20e9=_0xad20e9||0xcc;return function(_0x3d0740){if(_0x3d0740){return _0x55ee4f['sendStatus'](_0xad20e9);}return _0x55ee4f[_0xdb33('0x24')](_0xad20e9)[_0xdb33('0x25')]();};}function respondWithResult(_0xa981b8,_0x29cb45){_0x29cb45=_0x29cb45||0xc8;return function(_0xd13f4c){if(_0xd13f4c){return _0xa981b8[_0xdb33('0x24')](_0x29cb45)[_0xdb33('0x26')](_0xd13f4c);}};}function respondWithFilteredResult(_0x2a9227,_0x119c68){return function(_0x4dc388){if(_0x4dc388){var _0x278ce7=typeof _0x119c68[_0xdb33('0x27')]==='undefined'&&typeof _0x119c68['limit']==='undefined';var _0x3fcf2e=_0x4dc388[_0xdb33('0x28')];var _0x24f1af=_0x278ce7?0x0:_0x119c68['offset'];var _0x27f485=_0x278ce7?_0x4dc388[_0xdb33('0x28')]:_0x119c68[_0xdb33('0x27')]+_0x119c68[_0xdb33('0x29')];var _0x7a1733;if(_0x27f485>=_0x3fcf2e){_0x27f485=_0x3fcf2e;_0x7a1733=0xc8;}else{_0x7a1733=0xce;}_0x2a9227['status'](_0x7a1733);return _0x2a9227[_0xdb33('0x2a')](_0xdb33('0x2b'),_0x24f1af+'-'+_0x27f485+'/'+_0x3fcf2e)[_0xdb33('0x26')](_0x4dc388);}return null;};}function patchUpdates(_0x158607){return function(_0x5fdc18){try{jsonpatch[_0xdb33('0x2c')](_0x5fdc18,_0x158607,!![]);}catch(_0x25e1d2){return BPromise[_0xdb33('0x2d')](_0x25e1d2);}return _0x5fdc18[_0xdb33('0x2e')]();};}function saveUpdates(_0x24302c,_0xd93505){return function(_0x4723d8){if(_0x4723d8){return _0x4723d8[_0xdb33('0x2f')](_0x24302c)['then'](function(_0x56fbf6){return _0x56fbf6;});}return null;};}function removeEntity(_0x464121,_0x5aba59){return function(_0x2a05b1){if(_0x2a05b1){return _0x2a05b1[_0xdb33('0x30')]()[_0xdb33('0x1a')](function(){var _0x2e8e0d=_0x2a05b1['get']({'plain':!![]});var _0x2381b7='Contexts';return db[_0xdb33('0x31')][_0xdb33('0x30')]({'where':{'type':_0x2381b7,'resourceId':_0x2e8e0d['id']}})[_0xdb33('0x1a')](function(){return _0x2a05b1;});})[_0xdb33('0x1a')](function(){_0x464121[_0xdb33('0x24')](0xcc)[_0xdb33('0x25')]();});}};}function handleEntityNotFound(_0x2dd018,_0x242c31){return function(_0x115eb5){if(!_0x115eb5){_0x2dd018[_0xdb33('0x32')](0x194);}return _0x115eb5;};}function handleError(_0x209fee,_0x48e365){_0x48e365=_0x48e365||0x1f4;return function(_0x390ca4){logger[_0xdb33('0x20')](_0x390ca4[_0xdb33('0x33')]);if(_0x390ca4['name']){delete _0x390ca4[_0xdb33('0x34')];}_0x209fee['status'](_0x48e365)[_0xdb33('0x35')](_0x390ca4);};}exports['index']=function(_0x5490c9,_0x2b67b2){var _0x468ce6={},_0x1c31c3={},_0x581195={'count':0x0,'rows':[]};var _0x4e03ab=_['map'](db[_0xdb33('0x36')][_0xdb33('0x37')],function(_0x51aca2){return{'name':_0x51aca2[_0xdb33('0x38')],'type':_0x51aca2['type'][_0xdb33('0x39')]};});_0x1c31c3[_0xdb33('0x3a')]=_[_0xdb33('0x3b')](_0x4e03ab,_0xdb33('0x34'));_0x1c31c3[_0xdb33('0x3c')]=_[_0xdb33('0x3d')](_0x5490c9['query']);_0x1c31c3[_0xdb33('0x3e')]=_['intersection'](_0x1c31c3['model'],_0x1c31c3['query']);_0x468ce6[_0xdb33('0x3f')]=_[_0xdb33('0x40')](_0x1c31c3[_0xdb33('0x3a')],qs[_0xdb33('0x41')](_0x5490c9[_0xdb33('0x3c')]['fields']));_0x468ce6[_0xdb33('0x3f')]=_0x468ce6[_0xdb33('0x3f')]['length']?_0x468ce6['attributes']:_0x1c31c3['model'];if(!_0x5490c9[_0xdb33('0x3c')][_0xdb33('0x42')](_0xdb33('0x43'))){_0x468ce6[_0xdb33('0x29')]=qs['limit'](_0x5490c9[_0xdb33('0x3c')]['limit']);_0x468ce6['offset']=qs[_0xdb33('0x27')](_0x5490c9[_0xdb33('0x3c')][_0xdb33('0x27')]);}_0x468ce6[_0xdb33('0x44')]=qs[_0xdb33('0x45')](_0x5490c9[_0xdb33('0x3c')][_0xdb33('0x45')]);_0x468ce6['where']=qs['filters'](_['pick'](_0x5490c9[_0xdb33('0x3c')],_0x1c31c3[_0xdb33('0x3e')]),_0x4e03ab);if(_0x5490c9[_0xdb33('0x3c')]['filter']){_0x468ce6[_0xdb33('0x46')]=_[_0xdb33('0x47')](_0x468ce6['where'],{'$or':_[_0xdb33('0x3b')](_0x4e03ab,function(_0x3d3bd9){if(_0x3d3bd9[_0xdb33('0x48')]!==_0xdb33('0x49')){var _0x4bee9a={};_0x4bee9a[_0x3d3bd9[_0xdb33('0x34')]]={'$like':'%'+_0x5490c9[_0xdb33('0x3c')][_0xdb33('0x4a')]+'%'};return _0x4bee9a;}})});}_0x468ce6=_[_0xdb33('0x47')]({},_0x468ce6,_0x5490c9[_0xdb33('0x4b')]);var _0x421e5e={'where':_0x468ce6[_0xdb33('0x46')]};return db[_0xdb33('0x36')][_0xdb33('0x28')](_0x421e5e)[_0xdb33('0x1a')](function(_0x6d811f){_0x581195['count']=_0x6d811f;if(_0x5490c9['query']['includeAll']){_0x468ce6[_0xdb33('0x4c')]=[{'all':!![]}];}return db[_0xdb33('0x36')][_0xdb33('0x4d')](_0x468ce6);})[_0xdb33('0x1a')](function(_0xd0cca0){_0x581195['rows']=_0xd0cca0;return _0x581195;})[_0xdb33('0x1a')](respondWithFilteredResult(_0x2b67b2,_0x468ce6))[_0xdb33('0x4e')](handleError(_0x2b67b2,null));};exports[_0xdb33('0x4f')]=function(_0x4c7c0d,_0x1bfd66){var _0x3fd4b4={'raw':![],'where':{'id':_0x4c7c0d[_0xdb33('0x50')]['id']}},_0x365dc2={};_0x365dc2[_0xdb33('0x3a')]=_[_0xdb33('0x3d')](db[_0xdb33('0x36')][_0xdb33('0x37')]);_0x365dc2[_0xdb33('0x3c')]=_[_0xdb33('0x3d')](_0x4c7c0d[_0xdb33('0x3c')]);_0x365dc2[_0xdb33('0x3e')]=_[_0xdb33('0x40')](_0x365dc2[_0xdb33('0x3a')],_0x365dc2[_0xdb33('0x3c')]);_0x3fd4b4[_0xdb33('0x3f')]=_[_0xdb33('0x40')](_0x365dc2[_0xdb33('0x3a')],qs[_0xdb33('0x41')](_0x4c7c0d[_0xdb33('0x3c')][_0xdb33('0x41')]));_0x3fd4b4[_0xdb33('0x3f')]=_0x3fd4b4[_0xdb33('0x3f')][_0xdb33('0x51')]?_0x3fd4b4[_0xdb33('0x3f')]:_0x365dc2['model'];if(_0x4c7c0d['query']['includeAll']){_0x3fd4b4[_0xdb33('0x4c')]=[{'all':!![]}];}_0x3fd4b4=_[_0xdb33('0x47')]({},_0x3fd4b4,_0x4c7c0d[_0xdb33('0x4b')]);return db[_0xdb33('0x36')][_0xdb33('0x52')](_0x3fd4b4)[_0xdb33('0x1a')](handleEntityNotFound(_0x1bfd66,null))['then'](respondWithResult(_0x1bfd66,null))['catch'](handleError(_0x1bfd66,null));};exports['create']=function(_0x454382,_0x47bb6,_0x590927){var _0x28682b;return db[_0xdb33('0x36')][_0xdb33('0x53')](_0x454382[_0xdb33('0x54')],{'raw':!![]})[_0xdb33('0x1a')](function(_0x223687){_0x28682b=_0x223687;return db[_0xdb33('0x36')][_0xdb33('0x4d')]({'raw':!![]});})['then'](function(_0x8625a5){var _0x353b08=fs['readFileSync'](path['join'](config[_0xdb33('0x55')],_0xdb33('0x56')),_0xdb33('0x57'));var _0x59baae=ejs[_0xdb33('0x58')](_0x353b08,{'contexts':_0x8625a5||[]});fs[_0xdb33('0x59')](_0xdb33('0x5a'),_0x59baae);})['then'](function(){return respondWithRpcPromise(_0xdb33('0x5b'),'create',{'module':_0xdb33('0x5c')});})[_0xdb33('0x1a')](function(){var _0x565bfa=_0x454382[_0xdb33('0x5d')][_0xdb33('0x5e')]({'plain':!![]});if(!_0x565bfa)throw new Error(_0xdb33('0x5f'));if(_0x565bfa[_0xdb33('0x60')]===_0xdb33('0x5d')){var _0x4c3bc1=_0x28682b['get']({'plain':!![]});return db['UserProfileSection'][_0xdb33('0x52')]({'where':{'name':_0xdb33('0x61'),'userProfileId':_0x565bfa[_0xdb33('0x62')]},'raw':!![]})[_0xdb33('0x1a')](function(_0x44f9c8){if(_0x44f9c8&&_0x44f9c8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4c3bc1[_0xdb33('0x34')],'resourceId':_0x4c3bc1['id'],'type':_0x44f9c8[_0xdb33('0x34')],'sectionId':_0x44f9c8['id']},{})[_0xdb33('0x1a')](function(){return _0x28682b;});}else{return _0x28682b;}})[_0xdb33('0x4e')](function(_0x59b9f3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59b9f3);throw _0x59b9f3;});}return _0x28682b;})[_0xdb33('0x1a')](respondWithResult(_0x47bb6,0xc9))[_0xdb33('0x4e')](handleError(_0x47bb6,null));};exports[_0xdb33('0x2f')]=function(_0xe24f9c,_0x424ea0,_0x26053f){var _0xd0a873;return db[_0xdb33('0x36')][_0xdb33('0x52')]({'where':{'id':_0xe24f9c[_0xdb33('0x50')]['id']}})[_0xdb33('0x1a')](handleEntityNotFound(_0x424ea0,null))[_0xdb33('0x1a')](saveUpdates(_0xe24f9c[_0xdb33('0x54')],null))[_0xdb33('0x1a')](function(_0x505e19){if(_0x505e19){_0xd0a873=_0x505e19;return db[_0xdb33('0x36')]['findAll']({'raw':!![]});}})[_0xdb33('0x1a')](function(_0x5248f0){var _0x344a1f=fs[_0xdb33('0x63')](path[_0xdb33('0x64')](config[_0xdb33('0x55')],_0xdb33('0x56')),_0xdb33('0x57'));var _0x487205=ejs[_0xdb33('0x58')](_0x344a1f,{'contexts':_0x5248f0||[]});fs['writeFileSync'](_0xdb33('0x5a'),_0x487205);})[_0xdb33('0x1a')](function(){return respondWithRpcPromise(_0xdb33('0x5b'),'update',{'module':'chan_sip.so'});})[_0xdb33('0x1a')](function(){return _0xd0a873;})[_0xdb33('0x1a')](respondWithResult(_0x424ea0,null))[_0xdb33('0x4e')](handleError(_0x424ea0,null));};exports[_0xdb33('0x30')]=function(_0x13cc20,_0x24f1a1,_0x17f826){var _0x2d75c2;return db[_0xdb33('0x36')][_0xdb33('0x52')]({'where':{'id':_0x13cc20[_0xdb33('0x50')]['id']}})[_0xdb33('0x1a')](handleEntityNotFound(_0x24f1a1,null))[_0xdb33('0x1a')](removeEntity(_0x24f1a1,null))[_0xdb33('0x1a')](function(){return db['VoiceContext'][_0xdb33('0x4d')]({'raw':!![]});})['then'](function(_0x4e444b){var _0x5b3e50=fs['readFileSync'](path[_0xdb33('0x64')](config[_0xdb33('0x55')],_0xdb33('0x56')),_0xdb33('0x57'));var _0x40f52e=ejs['render'](_0x5b3e50,{'contexts':_0x4e444b});fs['writeFileSync'](_0xdb33('0x5a'),_0x40f52e);return respondWithRpcPromise(_0xdb33('0x5b'),'destroy',{'module':'chan_sip.so'});})['catch'](handleError(_0x24f1a1,null));};
\ No newline at end of file
index 350b84d..4730aa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f37=['rimraf','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','request-promise'];(function(_0x236f3b,_0x4d2e8d){var _0x23230c=function(_0x3c02bc){while(--_0x3c02bc){_0x236f3b['push'](_0x236f3b['shift']());}};_0x23230c(++_0x4d2e8d);}(_0x9f37,0xb6));var _0x79f3=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x9f37[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var logger=require(_0x79f3('0x2'))('api');var moment=require(_0x79f3('0x3'));var BPromise=require('bluebird');var rp=require(_0x79f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x79f3('0x6'));module[_0x79f3('0x7')]=function(_0x1ca94e,_0x4ee7f1){return _0x1ca94e[_0x79f3('0x8')](_0x79f3('0x9'),attributes,{'tableName':_0x79f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa105=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3e3f27,_0x2c2ecf){var _0x15c868=function(_0x4b348d){while(--_0x4b348d){_0x3e3f27['push'](_0x3e3f27['shift']());}};_0x15c868(++_0x2c2ecf);}(_0xa105,0xe8));var _0x5a10=function(_0x3bcc2b,_0x45fb59){_0x3bcc2b=_0x3bcc2b-0x0;var _0xd940b2=_0xa105[_0x3bcc2b];return _0xd940b2;};'use strict';var _=require(_0x5a10('0x0'));var util=require(_0x5a10('0x1'));var logger=require(_0x5a10('0x2'))(_0x5a10('0x3'));var moment=require(_0x5a10('0x4'));var BPromise=require(_0x5a10('0x5'));var rp=require(_0x5a10('0x6'));var fs=require('fs');var path=require(_0x5a10('0x7'));var rimraf=require(_0x5a10('0x8'));var config=require(_0x5a10('0x9'));var attributes=require(_0x5a10('0xa'));module[_0x5a10('0xb')]=function(_0x5ee360,_0x118cc6){return _0x5ee360[_0x5a10('0xc')](_0x5a10('0xd'),attributes,{'tableName':_0x5a10('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 13a8652..59be4e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc91=['client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x584ecc,_0x43bf8b){var _0x3b7f9d=function(_0x396850){while(--_0x396850){_0x584ecc['push'](_0x584ecc['shift']());}};_0x3b7f9d(++_0x43bf8b);}(_0xdc91,0x8b));var _0x1dc9=function(_0x5c88be,_0x2fb134){_0x5c88be=_0x5c88be-0x0;var _0x58a8a6=_0xdc91[_0x5c88be];return _0x58a8a6;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});}
\ No newline at end of file
+var _0xe027=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x17e4b9,_0x8d6e0c){var _0x3b74a6=function(_0x11b49c){while(--_0x11b49c){_0x17e4b9['push'](_0x17e4b9['shift']());}};_0x3b74a6(++_0x8d6e0c);}(_0xe027,0x106));var _0x7e02=function(_0x3a2ca4,_0x546e29){_0x3a2ca4=_0x3a2ca4-0x0;var _0x5ae61e=_0xe027[_0x3a2ca4];return _0x5ae61e;};'use strict';var _=require(_0x7e02('0x0'));var util=require(_0x7e02('0x1'));var moment=require(_0x7e02('0x2'));var BPromise=require(_0x7e02('0x3'));var rs=require(_0x7e02('0x4'));var fs=require('fs');var Redis=require(_0x7e02('0x5'));var db=require(_0x7e02('0x6'))['db'];var utils=require(_0x7e02('0x7'));var logger=require(_0x7e02('0x8'))(_0x7e02('0x9'));var config=require(_0x7e02('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ebeca,_0x10ffc5,_0x53b91c){return new BPromise(function(_0x557349,_0x1533d0){return client['request'](_0x4ebeca,_0x53b91c)[_0x7e02('0xc')](function(_0x135555){logger[_0x7e02('0xd')](_0x7e02('0xe'),_0x10ffc5,_0x7e02('0xf'));logger[_0x7e02('0x10')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x10ffc5,_0x7e02('0xf'),JSON['stringify'](_0x135555));if(_0x135555[_0x7e02('0x11')]){if(_0x135555[_0x7e02('0x11')][_0x7e02('0x12')]===0x1f4){logger[_0x7e02('0x11')](_0x7e02('0xe'),_0x10ffc5,_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);return _0x1533d0(_0x135555['error'][_0x7e02('0x13')]);}logger['error'](_0x7e02('0xe'),_0x10ffc5,_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);return _0x557349(_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);}else{logger[_0x7e02('0xd')]('VoiceContext,\x20%s,\x20%s',_0x10ffc5,'request\x20sent');_0x557349(_0x135555['result'][_0x7e02('0x13')]);}})['catch'](function(_0xc9e71c){logger[_0x7e02('0x11')](_0x7e02('0xe'),_0x10ffc5,_0xc9e71c);_0x1533d0(_0xc9e71c);});});}
\ No newline at end of file
index e482213..2476389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b2=['isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe'];(function(_0x3d9312,_0x3363fc){var _0x3a0a42=function(_0x58cad2){while(--_0x58cad2){_0x3d9312['push'](_0x3d9312['shift']());}};_0x3a0a42(++_0x3363fc);}(_0x61b2,0x139));var _0x261b=function(_0x53785b,_0x14b386){_0x53785b=_0x53785b-0x0;var _0x2ae6da=_0x61b2[_0x53785b];return _0x2ae6da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x261b('0x0'));var timeout=require(_0x261b('0x1'));var express=require(_0x261b('0x2'));var router=express['Router']();var fs_extra=require(_0x261b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x261b('0x4'));var config=require(_0x261b('0x5'));var controller=require(_0x261b('0x6'));router[_0x261b('0x7')]('/',auth['isAuthenticated'](),controller[_0x261b('0x8')]);router[_0x261b('0x7')](_0x261b('0x9'),auth[_0x261b('0xa')](),controller['describe']);router[_0x261b('0x7')](_0x261b('0xb'),auth['isAuthenticated'](),controller[_0x261b('0xc')]);router[_0x261b('0xd')]('/',auth['isAuthenticated'](),controller[_0x261b('0xe')]);router['put'](_0x261b('0xb'),auth['isAuthenticated'](),controller[_0x261b('0xf')]);router[_0x261b('0x10')](_0x261b('0xb'),auth[_0x261b('0xa')](),controller[_0x261b('0x11')]);module[_0x261b('0x12')]=router;
\ No newline at end of file
+var _0x22cc=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','util','path'];(function(_0x556771,_0x447992){var _0x4c9da8=function(_0x58d40b){while(--_0x58d40b){_0x556771['push'](_0x556771['shift']());}};_0x4c9da8(++_0x447992);}(_0x22cc,0x1e1));var _0xc22c=function(_0x396e83,_0x2d51e2){_0x396e83=_0x396e83-0x0;var _0x4a42cc=_0x22cc[_0x396e83];return _0x4a42cc;};'use strict';var multer=require('multer');var util=require(_0xc22c('0x0'));var path=require(_0xc22c('0x1'));var timeout=require(_0xc22c('0x2'));var express=require(_0xc22c('0x3'));var router=express[_0xc22c('0x4')]();var fs_extra=require(_0xc22c('0x5'));var auth=require(_0xc22c('0x6'));var interaction=require(_0xc22c('0x7'));var config=require(_0xc22c('0x8'));var controller=require(_0xc22c('0x9'));router[_0xc22c('0xa')]('/',auth[_0xc22c('0xb')](),controller[_0xc22c('0xc')]);router[_0xc22c('0xa')](_0xc22c('0xd'),auth[_0xc22c('0xb')](),controller['describe']);router['get'](_0xc22c('0xe'),auth[_0xc22c('0xb')](),controller['show']);router[_0xc22c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc22c('0x10')]);router[_0xc22c('0x11')](_0xc22c('0xe'),auth['isAuthenticated'](),controller[_0xc22c('0x12')]);router[_0xc22c('0x13')]('/:id',auth[_0xc22c('0xb')](),controller[_0xc22c('0x14')]);module['exports']=router;
\ No newline at end of file
index 7f44d45..01a461b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x3256c6,_0x3166f8){var _0x19ae14=function(_0x532a54){while(--_0x532a54){_0x3256c6['push'](_0x3256c6['shift']());}};_0x19ae14(++_0x3166f8);}(_0xe5b3,0x133));var _0x3e5b=function(_0x50d4df,_0x26c472){_0x50d4df=_0x50d4df-0x0;var _0x593f76=_0xe5b3[_0x50d4df];return _0x593f76;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x1f9232,_0x3acab4){var _0x195841=function(_0x3e28e0){while(--_0x3e28e0){_0x1f9232['push'](_0x1f9232['shift']());}};_0x195841(++_0x3acab4);}(_0x9a19,0x114));var _0x99a1=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0x9a19[_0x55d829];return _0x52163b;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}};
\ No newline at end of file
index fc6b160..2489bb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5359=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf'];(function(_0x5a5af6,_0x1859de){var _0xddbe9b=function(_0x10be7c){while(--_0x10be7c){_0x5a5af6['push'](_0x5a5af6['shift']());}};_0xddbe9b(++_0x1859de);}(_0x5359,0x132));var _0x9535=function(_0x15e69c,_0x28acce){_0x15e69c=_0x15e69c-0x0;var _0x272f38=_0x5359[_0x15e69c];return _0x272f38;};'use strict';var emlformat=require(_0x9535('0x0'));var rimraf=require(_0x9535('0x1'));var zipdir=require(_0x9535('0x2'));var jsonpatch=require(_0x9535('0x3'));var rp=require(_0x9535('0x4'));var moment=require(_0x9535('0x5'));var BPromise=require(_0x9535('0x6'));var Mustache=require(_0x9535('0x7'));var util=require(_0x9535('0x8'));var path=require('path');var sox=require(_0x9535('0x9'));var csv=require('to-csv');var ejs=require(_0x9535('0xa'));var fs=require('fs');var fs_extra=require(_0x9535('0xb'));var _=require(_0x9535('0xc'));var squel=require(_0x9535('0xd'));var crypto=require(_0x9535('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9535('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9535('0x10'));var Papa=require('papaparse');var Redis=require(_0x9535('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9535('0x12'));var as=require(_0x9535('0x13'));var hardwareService=require(_0x9535('0x14'));var logger=require(_0x9535('0x15'))('api');var utils=require(_0x9535('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9535('0x17'));var db=require(_0x9535('0x18'))['db'];function respondWithStatusCode(_0x25d0b0,_0x161545){_0x161545=_0x161545||0xcc;return function(_0x1595dd){if(_0x1595dd){return _0x25d0b0[_0x9535('0x19')](_0x161545);}return _0x25d0b0[_0x9535('0x1a')](_0x161545)[_0x9535('0x1b')]();};}function respondWithResult(_0x16a9d1,_0xa4fab){_0xa4fab=_0xa4fab||0xc8;return function(_0x271e69){if(_0x271e69){return _0x16a9d1[_0x9535('0x1a')](_0xa4fab)[_0x9535('0x1c')](_0x271e69);}};}function respondWithFilteredResult(_0x287afa,_0x39e746){return function(_0x1be834){if(_0x1be834){var _0x1a3cc5=typeof _0x39e746[_0x9535('0x1d')]===_0x9535('0x1e')&&typeof _0x39e746[_0x9535('0x1f')]===_0x9535('0x1e');var _0x3d49ed=_0x1be834[_0x9535('0x20')];var _0x58373d=_0x1a3cc5?0x0:_0x39e746[_0x9535('0x1d')];var _0x4ea16c=_0x1a3cc5?_0x1be834[_0x9535('0x20')]:_0x39e746[_0x9535('0x1d')]+_0x39e746['limit'];var _0x3a7b7e;if(_0x4ea16c>=_0x3d49ed){_0x4ea16c=_0x3d49ed;_0x3a7b7e=0xc8;}else{_0x3a7b7e=0xce;}_0x287afa[_0x9535('0x1a')](_0x3a7b7e);return _0x287afa[_0x9535('0x21')](_0x9535('0x22'),_0x58373d+'-'+_0x4ea16c+'/'+_0x3d49ed)['json'](_0x1be834);}return null;};}function patchUpdates(_0x2ea6a1){return function(_0x56a92c){try{jsonpatch[_0x9535('0x23')](_0x56a92c,_0x2ea6a1,!![]);}catch(_0x2d688b){return BPromise['reject'](_0x2d688b);}return _0x56a92c[_0x9535('0x24')]();};}function saveUpdates(_0x59b0d3,_0x4ada3d){return function(_0x486361){if(_0x486361){return _0x486361[_0x9535('0x25')](_0x59b0d3)[_0x9535('0x26')](function(_0x56934f){return _0x56934f;});}return null;};}function removeEntity(_0x51cd32,_0x12c9c){return function(_0x44f1f9){if(_0x44f1f9){return _0x44f1f9[_0x9535('0x27')]()[_0x9535('0x26')](function(){_0x51cd32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x589ac3,_0xdd02eb){return function(_0x1fb9aa){if(!_0x1fb9aa){_0x589ac3[_0x9535('0x19')](0x194);}return _0x1fb9aa;};}function handleError(_0x538186,_0x33954b){_0x33954b=_0x33954b||0x1f4;return function(_0x158353){logger[_0x9535('0x28')](_0x158353[_0x9535('0x29')]);if(_0x158353['name']){delete _0x158353[_0x9535('0x2a')];}_0x538186[_0x9535('0x1a')](_0x33954b)[_0x9535('0x2b')](_0x158353);};}exports['index']=function(_0x538206,_0x2a3b7f){var _0x53e882={},_0x5ab91d={},_0x195dce={'count':0x0,'rows':[]};var _0xcdb18a=_['map'](db[_0x9535('0x2c')][_0x9535('0x2d')],function(_0x1694f0){return{'name':_0x1694f0[_0x9535('0x2e')],'type':_0x1694f0[_0x9535('0x2f')][_0x9535('0x30')]};});_0x5ab91d[_0x9535('0x31')]=_[_0x9535('0x32')](_0xcdb18a,'name');_0x5ab91d[_0x9535('0x33')]=_[_0x9535('0x34')](_0x538206['query']);_0x5ab91d[_0x9535('0x35')]=_[_0x9535('0x36')](_0x5ab91d[_0x9535('0x31')],_0x5ab91d['query']);_0x53e882[_0x9535('0x37')]=_['intersection'](_0x5ab91d['model'],qs[_0x9535('0x38')](_0x538206['query'][_0x9535('0x38')]));_0x53e882[_0x9535('0x37')]=_0x53e882[_0x9535('0x37')][_0x9535('0x39')]?_0x53e882[_0x9535('0x37')]:_0x5ab91d[_0x9535('0x31')];if(!_0x538206[_0x9535('0x33')][_0x9535('0x3a')](_0x9535('0x3b'))){_0x53e882[_0x9535('0x1f')]=qs[_0x9535('0x1f')](_0x538206[_0x9535('0x33')][_0x9535('0x1f')]);_0x53e882[_0x9535('0x1d')]=qs[_0x9535('0x1d')](_0x538206[_0x9535('0x33')]['offset']);}_0x53e882[_0x9535('0x3c')]=qs[_0x9535('0x3d')](_0x538206[_0x9535('0x33')]['sort']);_0x53e882[_0x9535('0x3e')]=qs[_0x9535('0x35')](_[_0x9535('0x3f')](_0x538206[_0x9535('0x33')],_0x5ab91d[_0x9535('0x35')]),_0xcdb18a);if(_0x538206[_0x9535('0x33')][_0x9535('0x40')]){_0x53e882['where']=_[_0x9535('0x41')](_0x53e882[_0x9535('0x3e')],{'$or':_[_0x9535('0x32')](_0xcdb18a,function(_0x17fa99){if(_0x17fa99['type']!=='VIRTUAL'){var _0x3db015={};_0x3db015[_0x17fa99[_0x9535('0x2a')]]={'$like':'%'+_0x538206[_0x9535('0x33')][_0x9535('0x40')]+'%'};return _0x3db015;}})});}_0x53e882=_[_0x9535('0x41')]({},_0x53e882,_0x538206[_0x9535('0x42')]);var _0x57dfa1={'where':_0x53e882[_0x9535('0x3e')]};return db[_0x9535('0x2c')]['count'](_0x57dfa1)[_0x9535('0x26')](function(_0x12982f){_0x195dce[_0x9535('0x20')]=_0x12982f;if(_0x538206[_0x9535('0x33')][_0x9535('0x43')]){_0x53e882[_0x9535('0x44')]=[{'all':!![]}];}return db[_0x9535('0x2c')][_0x9535('0x45')](_0x53e882);})['then'](function(_0x394583){_0x195dce[_0x9535('0x46')]=_0x394583;return _0x195dce;})['then'](respondWithFilteredResult(_0x2a3b7f,_0x53e882))[_0x9535('0x47')](handleError(_0x2a3b7f,null));};exports['show']=function(_0x4f799f,_0x57a232){var _0xf2635f={'raw':!![],'where':{'id':_0x4f799f[_0x9535('0x48')]['id']}},_0x2d7b8f={};_0x2d7b8f[_0x9535('0x31')]=_[_0x9535('0x34')](db[_0x9535('0x2c')][_0x9535('0x2d')]);_0x2d7b8f['query']=_[_0x9535('0x34')](_0x4f799f['query']);_0x2d7b8f[_0x9535('0x35')]=_[_0x9535('0x36')](_0x2d7b8f['model'],_0x2d7b8f[_0x9535('0x33')]);_0xf2635f['attributes']=_[_0x9535('0x36')](_0x2d7b8f[_0x9535('0x31')],qs[_0x9535('0x38')](_0x4f799f[_0x9535('0x33')][_0x9535('0x38')]));_0xf2635f[_0x9535('0x37')]=_0xf2635f['attributes'][_0x9535('0x39')]?_0xf2635f[_0x9535('0x37')]:_0x2d7b8f[_0x9535('0x31')];if(_0x4f799f['query'][_0x9535('0x43')]){_0xf2635f[_0x9535('0x44')]=[{'all':!![]}];}_0xf2635f=_['merge']({},_0xf2635f,_0x4f799f[_0x9535('0x42')]);return db[_0x9535('0x2c')][_0x9535('0x49')](_0xf2635f)[_0x9535('0x26')](handleEntityNotFound(_0x57a232,null))[_0x9535('0x26')](respondWithResult(_0x57a232,null))[_0x9535('0x47')](handleError(_0x57a232,null));};exports[_0x9535('0x4a')]=function(_0x5f1f11,_0x5791e1){return db['VoiceDialReport'][_0x9535('0x4a')](_0x5f1f11[_0x9535('0x4b')],{})[_0x9535('0x26')](respondWithResult(_0x5791e1,0xc9))[_0x9535('0x47')](handleError(_0x5791e1,null));};exports['update']=function(_0xa8ec38,_0x1080a3){if(_0xa8ec38[_0x9535('0x4b')]['id']){delete _0xa8ec38['body']['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0xa8ec38[_0x9535('0x48')]['id']}})[_0x9535('0x26')](handleEntityNotFound(_0x1080a3,null))[_0x9535('0x26')](saveUpdates(_0xa8ec38[_0x9535('0x4b')],null))[_0x9535('0x26')](respondWithResult(_0x1080a3,null))[_0x9535('0x47')](handleError(_0x1080a3,null));};exports['destroy']=function(_0x744f28,_0x5eec84){return db[_0x9535('0x2c')][_0x9535('0x49')]({'where':{'id':_0x744f28[_0x9535('0x48')]['id']}})[_0x9535('0x26')](handleEntityNotFound(_0x5eec84,null))['then'](removeEntity(_0x5eec84,null))['catch'](handleError(_0x5eec84,null));};exports[_0x9535('0x4c')]=function(_0x266906,_0x3bc510){return db[_0x9535('0x2c')][_0x9535('0x4c')]()[_0x9535('0x26')](respondWithResult(_0x3bc510,null))['catch'](handleError(_0x3bc510,null));};
\ No newline at end of file
+var _0x46cd=['rows','show','include','find','create','catch','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','index','map','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','VoiceDialReport'];(function(_0x327309,_0x38d085){var _0x1cf45d=function(_0x2ba00b){while(--_0x2ba00b){_0x327309['push'](_0x327309['shift']());}};_0x1cf45d(++_0x38d085);}(_0x46cd,0xea));var _0xd46c=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x46cd[_0x26f702];return _0x11417d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd46c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46c('0x1'));var rp=require(_0xd46c('0x2'));var moment=require(_0xd46c('0x3'));var BPromise=require(_0xd46c('0x4'));var Mustache=require('mustache');var util=require(_0xd46c('0x5'));var path=require(_0xd46c('0x6'));var sox=require(_0xd46c('0x7'));var csv=require(_0xd46c('0x8'));var ejs=require(_0xd46c('0x9'));var fs=require('fs');var fs_extra=require(_0xd46c('0xa'));var _=require(_0xd46c('0xb'));var squel=require(_0xd46c('0xc'));var crypto=require(_0xd46c('0xd'));var jsforce=require(_0xd46c('0xe'));var deskjs=require(_0xd46c('0xf'));var toCsv=require(_0xd46c('0x8'));var querystring=require(_0xd46c('0x10'));var Papa=require(_0xd46c('0x11'));var Redis=require('ioredis');var authService=require(_0xd46c('0x12'));var qs=require(_0xd46c('0x13'));var as=require(_0xd46c('0x14'));var hardwareService=require(_0xd46c('0x15'));var logger=require('../../config/logger')(_0xd46c('0x16'));var utils=require(_0xd46c('0x17'));var config=require(_0xd46c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46c('0x19'))['db'];function respondWithStatusCode(_0x43a5a1,_0x598f85){_0x598f85=_0x598f85||0xcc;return function(_0x305e45){if(_0x305e45){return _0x43a5a1[_0xd46c('0x1a')](_0x598f85);}return _0x43a5a1['status'](_0x598f85)[_0xd46c('0x1b')]();};}function respondWithResult(_0x21c338,_0x1bd1df){_0x1bd1df=_0x1bd1df||0xc8;return function(_0x4c4688){if(_0x4c4688){return _0x21c338[_0xd46c('0x1c')](_0x1bd1df)[_0xd46c('0x1d')](_0x4c4688);}};}function respondWithFilteredResult(_0x37970b,_0x694684){return function(_0x45235d){if(_0x45235d){var _0x53902b=typeof _0x694684['offset']===_0xd46c('0x1e')&&typeof _0x694684[_0xd46c('0x1f')]===_0xd46c('0x1e');var _0x4dba41=_0x45235d[_0xd46c('0x20')];var _0x5816a6=_0x53902b?0x0:_0x694684[_0xd46c('0x21')];var _0x1c3e22=_0x53902b?_0x45235d['count']:_0x694684['offset']+_0x694684['limit'];var _0x5d7571;if(_0x1c3e22>=_0x4dba41){_0x1c3e22=_0x4dba41;_0x5d7571=0xc8;}else{_0x5d7571=0xce;}_0x37970b[_0xd46c('0x1c')](_0x5d7571);return _0x37970b[_0xd46c('0x22')]('Content-Range',_0x5816a6+'-'+_0x1c3e22+'/'+_0x4dba41)[_0xd46c('0x1d')](_0x45235d);}return null;};}function patchUpdates(_0x605b97){return function(_0x57228f){try{jsonpatch[_0xd46c('0x23')](_0x57228f,_0x605b97,!![]);}catch(_0xb0a7d4){return BPromise['reject'](_0xb0a7d4);}return _0x57228f[_0xd46c('0x24')]();};}function saveUpdates(_0x1cc964,_0x3ad981){return function(_0x550c80){if(_0x550c80){return _0x550c80[_0xd46c('0x25')](_0x1cc964)[_0xd46c('0x26')](function(_0x5c3699){return _0x5c3699;});}return null;};}function removeEntity(_0x2d2383,_0x5aeaf9){return function(_0x14e131){if(_0x14e131){return _0x14e131[_0xd46c('0x27')]()[_0xd46c('0x26')](function(){_0x2d2383[_0xd46c('0x1c')](0xcc)[_0xd46c('0x1b')]();});}};}function handleEntityNotFound(_0x106901,_0x4b4010){return function(_0x509bac){if(!_0x509bac){_0x106901[_0xd46c('0x1a')](0x194);}return _0x509bac;};}function handleError(_0x1be353,_0x54ad02){_0x54ad02=_0x54ad02||0x1f4;return function(_0x582e26){logger[_0xd46c('0x28')](_0x582e26[_0xd46c('0x29')]);if(_0x582e26[_0xd46c('0x2a')]){delete _0x582e26['name'];}_0x1be353[_0xd46c('0x1c')](_0x54ad02)[_0xd46c('0x2b')](_0x582e26);};}exports[_0xd46c('0x2c')]=function(_0x5408a3,_0x20c704){var _0x349e79={},_0x99ccb9={},_0x33fdb5={'count':0x0,'rows':[]};var _0x45e998=_[_0xd46c('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0x5de5ca){return{'name':_0x5de5ca['fieldName'],'type':_0x5de5ca['type']['key']};});_0x99ccb9[_0xd46c('0x2e')]=_['map'](_0x45e998,_0xd46c('0x2a'));_0x99ccb9[_0xd46c('0x2f')]=_[_0xd46c('0x30')](_0x5408a3[_0xd46c('0x2f')]);_0x99ccb9[_0xd46c('0x31')]=_[_0xd46c('0x32')](_0x99ccb9[_0xd46c('0x2e')],_0x99ccb9['query']);_0x349e79[_0xd46c('0x33')]=_[_0xd46c('0x32')](_0x99ccb9[_0xd46c('0x2e')],qs['fields'](_0x5408a3['query'][_0xd46c('0x34')]));_0x349e79[_0xd46c('0x33')]=_0x349e79[_0xd46c('0x33')][_0xd46c('0x35')]?_0x349e79[_0xd46c('0x33')]:_0x99ccb9[_0xd46c('0x2e')];if(!_0x5408a3['query'][_0xd46c('0x36')]('nolimit')){_0x349e79[_0xd46c('0x1f')]=qs['limit'](_0x5408a3[_0xd46c('0x2f')][_0xd46c('0x1f')]);_0x349e79[_0xd46c('0x21')]=qs['offset'](_0x5408a3[_0xd46c('0x2f')]['offset']);}_0x349e79[_0xd46c('0x37')]=qs[_0xd46c('0x38')](_0x5408a3[_0xd46c('0x2f')][_0xd46c('0x38')]);_0x349e79[_0xd46c('0x39')]=qs[_0xd46c('0x31')](_[_0xd46c('0x3a')](_0x5408a3[_0xd46c('0x2f')],_0x99ccb9[_0xd46c('0x31')]),_0x45e998);if(_0x5408a3[_0xd46c('0x2f')][_0xd46c('0x3b')]){_0x349e79['where']=_[_0xd46c('0x3c')](_0x349e79[_0xd46c('0x39')],{'$or':_['map'](_0x45e998,function(_0x37520d){if(_0x37520d[_0xd46c('0x3d')]!==_0xd46c('0x3e')){var _0xefae3f={};_0xefae3f[_0x37520d[_0xd46c('0x2a')]]={'$like':'%'+_0x5408a3['query'][_0xd46c('0x3b')]+'%'};return _0xefae3f;}})});}_0x349e79=_[_0xd46c('0x3c')]({},_0x349e79,_0x5408a3[_0xd46c('0x3f')]);var _0x304d6c={'where':_0x349e79[_0xd46c('0x39')]};return db['VoiceDialReport'][_0xd46c('0x20')](_0x304d6c)[_0xd46c('0x26')](function(_0x466ec3){_0x33fdb5['count']=_0x466ec3;if(_0x5408a3[_0xd46c('0x2f')][_0xd46c('0x40')]){_0x349e79['include']=[{'all':!![]}];}return db[_0xd46c('0x41')]['findAll'](_0x349e79);})[_0xd46c('0x26')](function(_0xb90096){_0x33fdb5[_0xd46c('0x42')]=_0xb90096;return _0x33fdb5;})[_0xd46c('0x26')](respondWithFilteredResult(_0x20c704,_0x349e79))['catch'](handleError(_0x20c704,null));};exports[_0xd46c('0x43')]=function(_0x52aa75,_0x209499){var _0x578a0a={'raw':!![],'where':{'id':_0x52aa75['params']['id']}},_0x451e34={};_0x451e34[_0xd46c('0x2e')]=_[_0xd46c('0x30')](db[_0xd46c('0x41')]['rawAttributes']);_0x451e34[_0xd46c('0x2f')]=_[_0xd46c('0x30')](_0x52aa75[_0xd46c('0x2f')]);_0x451e34[_0xd46c('0x31')]=_[_0xd46c('0x32')](_0x451e34[_0xd46c('0x2e')],_0x451e34['query']);_0x578a0a[_0xd46c('0x33')]=_[_0xd46c('0x32')](_0x451e34[_0xd46c('0x2e')],qs[_0xd46c('0x34')](_0x52aa75[_0xd46c('0x2f')][_0xd46c('0x34')]));_0x578a0a[_0xd46c('0x33')]=_0x578a0a[_0xd46c('0x33')][_0xd46c('0x35')]?_0x578a0a[_0xd46c('0x33')]:_0x451e34['model'];if(_0x52aa75[_0xd46c('0x2f')][_0xd46c('0x40')]){_0x578a0a[_0xd46c('0x44')]=[{'all':!![]}];}_0x578a0a=_[_0xd46c('0x3c')]({},_0x578a0a,_0x52aa75[_0xd46c('0x3f')]);return db[_0xd46c('0x41')][_0xd46c('0x45')](_0x578a0a)[_0xd46c('0x26')](handleEntityNotFound(_0x209499,null))[_0xd46c('0x26')](respondWithResult(_0x209499,null))['catch'](handleError(_0x209499,null));};exports[_0xd46c('0x46')]=function(_0x514a10,_0xd9e200){return db[_0xd46c('0x41')][_0xd46c('0x46')](_0x514a10['body'],{})[_0xd46c('0x26')](respondWithResult(_0xd9e200,0xc9))[_0xd46c('0x47')](handleError(_0xd9e200,null));};exports[_0xd46c('0x25')]=function(_0x31bb36,_0x5a9e4e){if(_0x31bb36['body']['id']){delete _0x31bb36[_0xd46c('0x48')]['id'];}return db[_0xd46c('0x41')]['find']({'where':{'id':_0x31bb36[_0xd46c('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a9e4e,null))['then'](saveUpdates(_0x31bb36[_0xd46c('0x48')],null))[_0xd46c('0x26')](respondWithResult(_0x5a9e4e,null))[_0xd46c('0x47')](handleError(_0x5a9e4e,null));};exports[_0xd46c('0x27')]=function(_0x47aec9,_0x491f3a){return db[_0xd46c('0x41')]['find']({'where':{'id':_0x47aec9[_0xd46c('0x49')]['id']}})[_0xd46c('0x26')](handleEntityNotFound(_0x491f3a,null))[_0xd46c('0x26')](removeEntity(_0x491f3a,null))[_0xd46c('0x47')](handleError(_0x491f3a,null));};exports['describe']=function(_0x28793e,_0x37e581){return db[_0xd46c('0x41')][_0xd46c('0x4a')]()[_0xd46c('0x26')](respondWithResult(_0x37e581,null))[_0xd46c('0x47')](handleError(_0x37e581,null));};
\ No newline at end of file
index c64a14f..72f3f96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8454=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x8454,0x1a4));var _0x4845=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8454[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4845('0x0'));var util=require(_0x4845('0x1'));var logger=require(_0x4845('0x2'))(_0x4845('0x3'));var moment=require(_0x4845('0x4'));var BPromise=require(_0x4845('0x5'));var rp=require(_0x4845('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4845('0x7'));var config=require(_0x4845('0x8'));var attributes=require(_0x4845('0x9'));module[_0x4845('0xa')]=function(_0x5304c9,_0x5425f4){return _0x5304c9[_0x4845('0xb')](_0x4845('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x4845('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c4d=['../../config/logger','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','lodash'];(function(_0x2b9e4b,_0x6f0648){var _0x4e5f5c=function(_0x4ea888){while(--_0x4ea888){_0x2b9e4b['push'](_0x2b9e4b['shift']());}};_0x4e5f5c(++_0x6f0648);}(_0x5c4d,0x18f));var _0xd5c4=function(_0x477328,_0x132b3f){_0x477328=_0x477328-0x0;var _0x91ccd0=_0x5c4d[_0x477328];return _0x91ccd0;};'use strict';var _=require(_0xd5c4('0x0'));var util=require('util');var logger=require(_0xd5c4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd5c4('0x2'));var fs=require('fs');var path=require(_0xd5c4('0x3'));var rimraf=require(_0xd5c4('0x4'));var config=require('../../config/environment');var attributes=require(_0xd5c4('0x5'));module[_0xd5c4('0x6')]=function(_0x204a6f,_0x422cd8){return _0x204a6f[_0xd5c4('0x7')](_0xd5c4('0x8'),attributes,{'tableName':_0xd5c4('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 0c797a1..12ca0c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ee8=['UpdateVoiceDialReport','VoiceDialReport','update','options','attributes','limit','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceDialReport,\x20%s,\x20%s','message','result','catch','create','body','raw','CreateVoiceDialReport'];(function(_0x6fd276,_0x32ca86){var _0x870689=function(_0x34f8dc){while(--_0x34f8dc){_0x6fd276['push'](_0x6fd276['shift']());}};_0x870689(++_0x32ca86);}(_0x7ee8,0xe7));var _0x87ee=function(_0x5c6d14,_0x484e06){_0x5c6d14=_0x5c6d14-0x0;var _0x5b3bfe=_0x7ee8[_0x5c6d14];return _0x5b3bfe;};'use strict';var _=require(_0x87ee('0x0'));var util=require(_0x87ee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x87ee('0x2'));var fs=require('fs');var Redis=require(_0x87ee('0x3'));var db=require(_0x87ee('0x4'))['db'];var utils=require(_0x87ee('0x5'));var logger=require(_0x87ee('0x6'))(_0x87ee('0x7'));var config=require('../../config/environment');var jayson=require(_0x87ee('0x8'));var client=jayson[_0x87ee('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d0d23,_0x3c85f8,_0x2bba9b){return new BPromise(function(_0x50c126,_0x2d552d){return client[_0x87ee('0xa')](_0x5d0d23,_0x2bba9b)['then'](function(_0x42871e){logger[_0x87ee('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x3c85f8,_0x87ee('0xc'));logger[_0x87ee('0xd')](_0x87ee('0xe'),_0x3c85f8,_0x87ee('0xc'),JSON[_0x87ee('0xf')](_0x42871e));if(_0x42871e[_0x87ee('0x10')]){if(_0x42871e[_0x87ee('0x10')]['code']===0x1f4){logger[_0x87ee('0x10')](_0x87ee('0x11'),_0x3c85f8,_0x42871e['error'][_0x87ee('0x12')]);return _0x2d552d(_0x42871e['error'][_0x87ee('0x12')]);}logger[_0x87ee('0x10')](_0x87ee('0x11'),_0x3c85f8,_0x42871e[_0x87ee('0x10')][_0x87ee('0x12')]);return _0x50c126(_0x42871e[_0x87ee('0x10')]['message']);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3c85f8,_0x87ee('0xc'));_0x50c126(_0x42871e[_0x87ee('0x13')][_0x87ee('0x12')]);}})[_0x87ee('0x14')](function(_0x4e87f5){logger['error'](_0x87ee('0x11'),_0x3c85f8,_0x4e87f5);_0x2d552d(_0x4e87f5);});});}exports['CreateVoiceDialReport']=function(_0x49a0c7){var _0x100977=this;return new Promise(function(_0x5bb2a3,_0x2a8cf7){return db['VoiceDialReport'][_0x87ee('0x15')](_0x49a0c7[_0x87ee('0x16')],{'raw':_0x49a0c7['options']?_0x49a0c7['options'][_0x87ee('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x404b38){logger['info'](_0x87ee('0x18'),_0x49a0c7);logger[_0x87ee('0xd')]('CreateVoiceDialReport',_0x49a0c7,JSON[_0x87ee('0xf')](_0x404b38));_0x5bb2a3(_0x404b38);})[_0x87ee('0x14')](function(_0x40ca5f){logger[_0x87ee('0x10')](_0x87ee('0x18'),_0x40ca5f['message'],_0x49a0c7);_0x2a8cf7(_0x100977['error'](0x1f4,_0x40ca5f['message']));});});};exports[_0x87ee('0x19')]=function(_0x2c206b){var _0x11d818=this;return new Promise(function(_0x1d1a2c,_0x248998){return db[_0x87ee('0x1a')][_0x87ee('0x1b')](_0x2c206b[_0x87ee('0x16')],{'raw':_0x2c206b[_0x87ee('0x1c')]?_0x2c206b[_0x87ee('0x1c')][_0x87ee('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c206b[_0x87ee('0x1c')]?_0x2c206b[_0x87ee('0x1c')]['where']||null:null,'attributes':_0x2c206b['options']?_0x2c206b[_0x87ee('0x1c')][_0x87ee('0x1d')]||null:null,'limit':_0x2c206b[_0x87ee('0x1c')]?_0x2c206b['options'][_0x87ee('0x1e')]||null:null})[_0x87ee('0x1f')](function(_0x435b3c){logger[_0x87ee('0xb')](_0x87ee('0x19'),_0x2c206b);logger[_0x87ee('0xd')](_0x87ee('0x19'),_0x2c206b,JSON[_0x87ee('0xf')](_0x435b3c));_0x1d1a2c(_0x435b3c);})[_0x87ee('0x14')](function(_0x505ada){logger[_0x87ee('0x10')]('UpdateVoiceDialReport',_0x505ada['message'],_0x2c206b);_0x248998(_0x11d818['error'](0x1f4,_0x505ada[_0x87ee('0x12')]));});});};
\ No newline at end of file
+var _0x62d8=['http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','update','where','limit','lodash','util','moment','../../mysqldb','../../config/logger','rpc','client'];(function(_0x313962,_0x38f29e){var _0x382cb1=function(_0x1e2e8c){while(--_0x1e2e8c){_0x313962['push'](_0x313962['shift']());}};_0x382cb1(++_0x38f29e);}(_0x62d8,0x1d5));var _0x862d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x62d8[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x862d('0x0'));var util=require(_0x862d('0x1'));var moment=require(_0x862d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x862d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x862d('0x4'))(_0x862d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x862d('0x6')][_0x862d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d20bb,_0x3aa056,_0x2ecd86){return new BPromise(function(_0x50d77d,_0x43d82f){return client['request'](_0x5d20bb,_0x2ecd86)[_0x862d('0x8')](function(_0x380499){logger[_0x862d('0x9')](_0x862d('0xa'),_0x3aa056,_0x862d('0xb'));logger[_0x862d('0xc')](_0x862d('0xd'),_0x3aa056,'request\x20sent',JSON[_0x862d('0xe')](_0x380499));if(_0x380499['error']){if(_0x380499['error']['code']===0x1f4){logger['error'](_0x862d('0xa'),_0x3aa056,_0x380499['error']['message']);return _0x43d82f(_0x380499[_0x862d('0xf')][_0x862d('0x10')]);}logger[_0x862d('0xf')](_0x862d('0xa'),_0x3aa056,_0x380499[_0x862d('0xf')]['message']);return _0x50d77d(_0x380499[_0x862d('0xf')][_0x862d('0x10')]);}else{logger['info'](_0x862d('0xa'),_0x3aa056,_0x862d('0xb'));_0x50d77d(_0x380499[_0x862d('0x11')][_0x862d('0x10')]);}})[_0x862d('0x12')](function(_0x46398a){logger[_0x862d('0xf')](_0x862d('0xa'),_0x3aa056,_0x46398a);_0x43d82f(_0x46398a);});});}exports[_0x862d('0x13')]=function(_0x531d3c){var _0x52fe7a=this;return new Promise(function(_0x47dd77,_0x43bda5){return db[_0x862d('0x14')]['create'](_0x531d3c[_0x862d('0x15')],{'raw':_0x531d3c[_0x862d('0x16')]?_0x531d3c[_0x862d('0x16')][_0x862d('0x17')]===undefined?!![]:![]:!![]})[_0x862d('0x8')](function(_0x396b5b){logger[_0x862d('0x9')](_0x862d('0x13'),_0x531d3c);logger['debug'](_0x862d('0x13'),_0x531d3c,JSON[_0x862d('0xe')](_0x396b5b));_0x47dd77(_0x396b5b);})[_0x862d('0x12')](function(_0x133caa){logger[_0x862d('0xf')](_0x862d('0x13'),_0x133caa['message'],_0x531d3c);_0x43bda5(_0x52fe7a[_0x862d('0xf')](0x1f4,_0x133caa[_0x862d('0x10')]));});});};exports[_0x862d('0x18')]=function(_0x4c1bd2){var _0x3cc597=this;return new Promise(function(_0x4fe1b5,_0x579526){return db[_0x862d('0x14')][_0x862d('0x19')](_0x4c1bd2[_0x862d('0x15')],{'raw':_0x4c1bd2[_0x862d('0x16')]?_0x4c1bd2[_0x862d('0x16')][_0x862d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c1bd2[_0x862d('0x16')]?_0x4c1bd2['options'][_0x862d('0x1a')]||null:null,'attributes':_0x4c1bd2['options']?_0x4c1bd2[_0x862d('0x16')]['attributes']||null:null,'limit':_0x4c1bd2[_0x862d('0x16')]?_0x4c1bd2['options'][_0x862d('0x1b')]||null:null})[_0x862d('0x8')](function(_0x53d193){logger[_0x862d('0x9')](_0x862d('0x18'),_0x4c1bd2);logger[_0x862d('0xc')](_0x862d('0x18'),_0x4c1bd2,JSON[_0x862d('0xe')](_0x53d193));_0x4fe1b5(_0x53d193);})[_0x862d('0x12')](function(_0x353217){logger[_0x862d('0xf')](_0x862d('0x18'),_0x353217[_0x862d('0x10')],_0x4c1bd2);_0x579526(_0x3cc597[_0x862d('0xf')](0x1f4,_0x353217['message']));});});};
\ No newline at end of file
index a5b419b..b9850b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadc1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','show','create','/:id/applications','addApplications','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4949dc,_0x5c75d9){var _0x17c8f5=function(_0x57e3f2){while(--_0x57e3f2){_0x4949dc['push'](_0x4949dc['shift']());}};_0x17c8f5(++_0x5c75d9);}(_0xadc1,0x13c));var _0x1adc=function(_0x3b1e3f,_0xf8826b){_0x3b1e3f=_0x3b1e3f-0x0;var _0x3b1cd3=_0xadc1[_0x3b1e3f];return _0x3b1cd3;};'use strict';var multer=require(_0x1adc('0x0'));var util=require(_0x1adc('0x1'));var path=require(_0x1adc('0x2'));var timeout=require(_0x1adc('0x3'));var express=require('express');var router=express[_0x1adc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1adc('0x5'));var interaction=require(_0x1adc('0x6'));var config=require(_0x1adc('0x7'));var controller=require(_0x1adc('0x8'));router[_0x1adc('0x9')]('/',auth[_0x1adc('0xa')](),controller['index']);router[_0x1adc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1adc('0xb')]);router['post']('/',auth[_0x1adc('0xa')](),controller[_0x1adc('0xc')]);router['post'](_0x1adc('0xd'),auth['isAuthenticated'](),controller[_0x1adc('0xe')]);router['put']('/:id',auth[_0x1adc('0xa')](),controller[_0x1adc('0xf')]);router[_0x1adc('0x10')](_0x1adc('0x11'),auth[_0x1adc('0xa')](),controller[_0x1adc('0x12')]);module[_0x1adc('0x13')]=router;
\ No newline at end of file
+var _0x1e94=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','post','addApplications'];(function(_0x3540ca,_0x4551e2){var _0x4e4847=function(_0x26a7f3){while(--_0x26a7f3){_0x3540ca['push'](_0x3540ca['shift']());}};_0x4e4847(++_0x4551e2);}(_0x1e94,0x140));var _0x41e9=function(_0x5f10ca,_0x9a1699){_0x5f10ca=_0x5f10ca-0x0;var _0x5d5f0f=_0x1e94[_0x5f10ca];return _0x5d5f0f;};'use strict';var multer=require(_0x41e9('0x0'));var util=require(_0x41e9('0x1'));var path=require(_0x41e9('0x2'));var timeout=require(_0x41e9('0x3'));var express=require(_0x41e9('0x4'));var router=express[_0x41e9('0x5')]();var fs_extra=require(_0x41e9('0x6'));var auth=require(_0x41e9('0x7'));var interaction=require(_0x41e9('0x8'));var config=require(_0x41e9('0x9'));var controller=require(_0x41e9('0xa'));router[_0x41e9('0xb')]('/',auth[_0x41e9('0xc')](),controller[_0x41e9('0xd')]);router[_0x41e9('0xb')]('/:id',auth[_0x41e9('0xc')](),controller['show']);router[_0x41e9('0xe')]('/',auth[_0x41e9('0xc')](),controller['create']);router['post']('/:id/applications',auth[_0x41e9('0xc')](),controller[_0x41e9('0xf')]);router[_0x41e9('0x10')](_0x41e9('0x11'),auth[_0x41e9('0xc')](),controller[_0x41e9('0x12')]);router[_0x41e9('0x13')](_0x41e9('0x11'),auth[_0x41e9('0xc')](),controller['destroy']);module[_0x41e9('0x14')]=router;
\ No newline at end of file
index 680f025..51504c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b58=['exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','any','BOOLEAN','INTEGER','VIRTUAL','exten','sequelize'];(function(_0x20db2d,_0x2d15de){var _0x179d8d=function(_0x38e150){while(--_0x38e150){_0x20db2d['push'](_0x20db2d['shift']());}};_0x179d8d(++_0x2d15de);}(_0x6b58,0xdf));var _0x86b5=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0x6b58[_0x3a13cf];return _0x4817c;};'use strict';var Sequelize=require(_0x86b5('0x0'));module[_0x86b5('0x1')]={'context':{'type':Sequelize[_0x86b5('0x2')],'allowNull':![],'unique':_0x86b5('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x86b5('0x2')],'allowNull':![],'unique':_0x86b5('0x3')},'priority':{'type':Sequelize[_0x86b5('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x86b5('0x3')},'tag':{'type':Sequelize[_0x86b5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86b5('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x86b5('0x5')](_0x86b5('0x6'),_0x86b5('0x7'),_0x86b5('0x8'),'inbound-fax',_0x86b5('0x9'),_0x86b5('0xa'),_0x86b5('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x86b5('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x86b5('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x86b5('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x86b5('0xd')]},'recordingFormat':{'type':Sequelize[_0x86b5('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x86b5('0xe')],'get':function(_0x73a8ec){return this['getDataValue'](_0x86b5('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0xb2f7=['inbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound'];(function(_0x3a2988,_0x29de91){var _0x36a07d=function(_0x4eb6de){while(--_0x4eb6de){_0x3a2988['push'](_0x3a2988['shift']());}};_0x36a07d(++_0x29de91);}(_0xb2f7,0x1d8));var _0x7b2f=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xb2f7[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x7b2f('0x0'));module[_0x7b2f('0x1')]={'context':{'type':Sequelize[_0x7b2f('0x2')],'allowNull':![],'unique':_0x7b2f('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7b2f('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x7b2f('0x3')},'tag':{'type':Sequelize[_0x7b2f('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7b2f('0x4')},'appdata':{'type':Sequelize[_0x7b2f('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7b2f('0x5')](_0x7b2f('0x6'),_0x7b2f('0x7'),'internal',_0x7b2f('0x8'),'outbound-fax','system',_0x7b2f('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x7b2f('0x2')]},'interval':{'type':Sequelize[_0x7b2f('0x2')],'allowNull':![],'defaultValue':_0x7b2f('0xa')},'IntervalId':{'type':Sequelize[_0x7b2f('0xb')]},'isApp':{'type':Sequelize[_0x7b2f('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7b2f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7b2f('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x7b2f('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7b2f('0xb')]},'recordingFormat':{'type':Sequelize[_0x7b2f('0x2')],'defaultValue':_0x7b2f('0xd')},'answer':{'type':Sequelize[_0x7b2f('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7b2f('0xe')],'get':function(_0x30e368){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0x7b2f('0x2')],'allowNull':!![]}};
\ No newline at end of file
index d2b3c05..415d4c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6e9=['includeAll','include','findAll','rows','catch','body','startsWith','concat','exten','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','outbound','InternalRoutes','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','description','recordingFormat','cutdigits','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','stack','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','./voiceExtension.socket','register','end','json','offset','undefined','limit','count','status','set','Content-Range','destroy','then','InboundRoutes','OutboundRoutes','internal','filter','ignore','map','value','includes','type','find','name','error','send','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','filters','pick','where','VIRTUAL','merge','options'];(function(_0x1e9285,_0xc4fe73){var _0x5684b4=function(_0x4ab03f){while(--_0x4ab03f){_0x1e9285['push'](_0x1e9285['shift']());}};_0x5684b4(++_0xc4fe73);}(_0xc6e9,0x138));var _0x9c6e=function(_0x5120ad,_0x173124){_0x5120ad=_0x5120ad-0x0;var _0xebf870=_0xc6e9[_0x5120ad];return _0xebf870;};'use strict';var _=require(_0x9c6e('0x0'));var Redis=require(_0x9c6e('0x1'));var qs=require(_0x9c6e('0x2'));var logger=require('../../config/logger')(_0x9c6e('0x3'));var config=require(_0x9c6e('0x4'));var db=require(_0x9c6e('0x5'))['db'];config[_0x9c6e('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c6e('0x6')]));require(_0x9c6e('0x7'))[_0x9c6e('0x8')](socket);function respondWithStatusCode(_0x2fb928,_0x8de455){_0x8de455=_0x8de455||0xcc;return function(_0x39bb06){if(_0x39bb06){return _0x2fb928['sendStatus'](_0x8de455);}return _0x2fb928['status'](_0x8de455)[_0x9c6e('0x9')]();};}function respondWithResult(_0x3614ac,_0x54edf4){_0x54edf4=_0x54edf4||0xc8;return function(_0x20959a){if(_0x20959a){return _0x3614ac['status'](_0x54edf4)[_0x9c6e('0xa')](_0x20959a);}};}function respondWithFilteredResult(_0x3a8b84,_0x2b24d9){return function(_0x3dab81){if(_0x3dab81){var _0x462600=typeof _0x2b24d9[_0x9c6e('0xb')]===_0x9c6e('0xc')&&typeof _0x2b24d9[_0x9c6e('0xd')]===_0x9c6e('0xc');var _0x193d19=_0x3dab81['count'];var _0x11af09=_0x462600?0x0:_0x2b24d9['offset'];var _0x3e284f=_0x462600?_0x3dab81[_0x9c6e('0xe')]:_0x2b24d9['offset']+_0x2b24d9[_0x9c6e('0xd')];var _0x2e3cfe;if(_0x3e284f>=_0x193d19){_0x3e284f=_0x193d19;_0x2e3cfe=0xc8;}else{_0x2e3cfe=0xce;}_0x3a8b84[_0x9c6e('0xf')](_0x2e3cfe);return _0x3a8b84[_0x9c6e('0x10')](_0x9c6e('0x11'),_0x11af09+'-'+_0x3e284f+'/'+_0x193d19)[_0x9c6e('0xa')](_0x3dab81);}return null;};}function removeEntity(_0x227c29){return function(_0xb62889){if(_0xb62889){return _0xb62889[_0x9c6e('0x12')]()[_0x9c6e('0x13')](function(){var _0x3b9370=_0xb62889['get']({'plain':!![]});var _0x3e83e9=[{'name':_0x9c6e('0x14'),'value':'inbound','ignore':![]},{'name':_0x9c6e('0x15'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0x9c6e('0x16'),'ignore':![]}];var _0x481802=_(_0x3e83e9)[_0x9c6e('0x17')](_0x9c6e('0x18'))[_0x9c6e('0x19')](_0x9c6e('0x1a'))[_0x9c6e('0x1a')]();if(_[_0x9c6e('0x1b')](_0x481802,_0x3b9370[_0x9c6e('0x1c')])){return;}var _0x3831c5=_[_0x9c6e('0x1d')](_0x3e83e9,['value',_0x3b9370[_0x9c6e('0x1c')]])[_0x9c6e('0x1e')];return db['UserProfileResource']['destroy']({'where':{'type':_0x3831c5,'resourceId':_0x3b9370['id']}})[_0x9c6e('0x13')](function(){return _0xb62889;});})['then'](function(){_0x227c29[_0x9c6e('0xf')](0xcc)[_0x9c6e('0x9')]();});}};}function handleEntityNotFound(_0x32f083){return function(_0x5d017f){if(!_0x5d017f){_0x32f083['sendStatus'](0x194);}return _0x5d017f;};}function handleError(_0x4deb58,_0x1a8cee){_0x1a8cee=_0x1a8cee||0x1f4;return function(_0x39232a){logger[_0x9c6e('0x1f')](_0x39232a['stack']);if(_0x39232a[_0x9c6e('0x1e')]){delete _0x39232a[_0x9c6e('0x1e')];}_0x4deb58[_0x9c6e('0xf')](_0x1a8cee)[_0x9c6e('0x20')](_0x39232a);};}exports['index']=function(_0xeb7858,_0x7c06d6){var _0x161cfb={},_0x4f78d7={},_0x1d3bcc={'count':0x0,'rows':[]};var _0x1c08e3=_[_0x9c6e('0x19')](db[_0x9c6e('0x21')][_0x9c6e('0x22')],function(_0x85cf8a){return{'name':_0x85cf8a[_0x9c6e('0x23')],'type':_0x85cf8a[_0x9c6e('0x1c')][_0x9c6e('0x24')]};});_0x4f78d7[_0x9c6e('0x25')]=_[_0x9c6e('0x19')](_0x1c08e3,_0x9c6e('0x1e'));_0x4f78d7['query']=_[_0x9c6e('0x26')](_0xeb7858[_0x9c6e('0x27')]);_0x4f78d7['filters']=_[_0x9c6e('0x28')](_0x4f78d7[_0x9c6e('0x25')],_0x4f78d7[_0x9c6e('0x27')]);_0x161cfb['attributes']=_[_0x9c6e('0x28')](_0x4f78d7[_0x9c6e('0x25')],qs[_0x9c6e('0x29')](_0xeb7858[_0x9c6e('0x27')][_0x9c6e('0x29')]));_0x161cfb['attributes']=_0x161cfb[_0x9c6e('0x2a')][_0x9c6e('0x2b')]?_0x161cfb[_0x9c6e('0x2a')]:_0x4f78d7[_0x9c6e('0x25')];if(!_0xeb7858[_0x9c6e('0x27')][_0x9c6e('0x2c')](_0x9c6e('0x2d'))){_0x161cfb[_0x9c6e('0xd')]=qs[_0x9c6e('0xd')](_0xeb7858['query'][_0x9c6e('0xd')]);_0x161cfb[_0x9c6e('0xb')]=qs[_0x9c6e('0xb')](_0xeb7858[_0x9c6e('0x27')][_0x9c6e('0xb')]);}_0x161cfb['order']=qs['sort'](_0xeb7858[_0x9c6e('0x27')]['sort']);_0x161cfb['where']=qs[_0x9c6e('0x2e')](_[_0x9c6e('0x2f')](_0xeb7858[_0x9c6e('0x27')],_0x4f78d7[_0x9c6e('0x2e')]),_0x1c08e3);if(_0xeb7858[_0x9c6e('0x27')][_0x9c6e('0x17')]){_0x161cfb['where']=_['merge'](_0x161cfb[_0x9c6e('0x30')],{'$or':_[_0x9c6e('0x19')](_0x1c08e3,function(_0x487bd8){if(_0x487bd8[_0x9c6e('0x1c')]!==_0x9c6e('0x31')){var _0xdbf543={};_0xdbf543[_0x487bd8['name']]={'$like':'%'+_0xeb7858[_0x9c6e('0x27')][_0x9c6e('0x17')]+'%'};return _0xdbf543;}})});}_0x161cfb=_[_0x9c6e('0x32')]({},_0x161cfb,_0xeb7858[_0x9c6e('0x33')]);var _0x2524dd={'where':_0x161cfb[_0x9c6e('0x30')]};return db[_0x9c6e('0x21')]['count'](_0x2524dd)['then'](function(_0x5c545c){_0x1d3bcc[_0x9c6e('0xe')]=_0x5c545c;if(_0xeb7858[_0x9c6e('0x27')][_0x9c6e('0x34')]){_0x161cfb[_0x9c6e('0x35')]=[{'all':!![]}];}return db[_0x9c6e('0x21')][_0x9c6e('0x36')](_0x161cfb);})['then'](function(_0x59fc5){_0x1d3bcc[_0x9c6e('0x37')]=_0x59fc5;return _0x1d3bcc;})[_0x9c6e('0x13')](respondWithFilteredResult(_0x7c06d6,_0x161cfb))['catch'](handleError(_0x7c06d6,null));};exports['show']=function(_0x40740d,_0x2d28ad){var _0x483093={'raw':![],'where':{'id':_0x40740d['params']['id']}},_0x760f88={};_0x760f88[_0x9c6e('0x25')]=_[_0x9c6e('0x26')](db[_0x9c6e('0x21')][_0x9c6e('0x22')]);_0x760f88[_0x9c6e('0x27')]=_[_0x9c6e('0x26')](_0x40740d[_0x9c6e('0x27')]);_0x760f88['filters']=_[_0x9c6e('0x28')](_0x760f88[_0x9c6e('0x25')],_0x760f88[_0x9c6e('0x27')]);_0x483093[_0x9c6e('0x2a')]=_['intersection'](_0x760f88[_0x9c6e('0x25')],qs[_0x9c6e('0x29')](_0x40740d['query'][_0x9c6e('0x29')]));_0x483093[_0x9c6e('0x2a')]=_0x483093['attributes'][_0x9c6e('0x2b')]?_0x483093['attributes']:_0x760f88['model'];if(_0x40740d[_0x9c6e('0x27')]['includeAll']){_0x483093[_0x9c6e('0x35')]=[{'all':!![]}];}_0x483093=_[_0x9c6e('0x32')]({},_0x483093,_0x40740d['options']);return db[_0x9c6e('0x21')][_0x9c6e('0x1d')](_0x483093)[_0x9c6e('0x13')](handleEntityNotFound(_0x2d28ad,null))['then'](respondWithResult(_0x2d28ad,null))[_0x9c6e('0x38')](handleError(_0x2d28ad,null));};exports['destroy']=function(_0x228b8c,_0x955ae8){return db[_0x9c6e('0x21')]['find']({'where':{'id':_0x228b8c['params']['id']}})[_0x9c6e('0x13')](handleEntityNotFound(_0x955ae8,null))[_0x9c6e('0x13')](removeEntity(_0x955ae8,null))['catch'](handleError(_0x955ae8,null));};exports['create']=function(_0x403917,_0x45c4fa){if(_0x403917[_0x9c6e('0x39')][_0x9c6e('0x1c')]==='outbound'&&!_[_0x9c6e('0x3a')](_0x403917[_0x9c6e('0x39')]['exten'],'_')){_0x403917['body']['exten']='_'[_0x9c6e('0x3b')](_0x403917[_0x9c6e('0x39')][_0x9c6e('0x3c')]);}return db['VoiceExtension'][_0x9c6e('0x3d')](_0x403917['body'],{'raw':![]})[_0x9c6e('0x13')](function(_0x384fa6){var _0x1ae6fb=_0x403917[_0x9c6e('0x3e')][_0x9c6e('0x3f')]({'plain':!![]});if(!_0x1ae6fb)throw new Error(_0x9c6e('0x40'));if(_0x1ae6fb[_0x9c6e('0x41')]===_0x9c6e('0x3e')){var _0x4b8ef6=_0x384fa6[_0x9c6e('0x3f')]({'plain':!![]});var _0x2d615e=[{'name':'InboundRoutes','value':_0x9c6e('0x42')},{'name':_0x9c6e('0x15'),'value':_0x9c6e('0x43')},{'name':_0x9c6e('0x44'),'value':_0x9c6e('0x16')}];var _0x1ef149=_[_0x9c6e('0x1d')](_0x2d615e,[_0x9c6e('0x1a'),_0x4b8ef6[_0x9c6e('0x1c')]])['name'];return db['UserProfileSection'][_0x9c6e('0x1d')]({'where':{'name':_0x1ef149,'userProfileId':_0x1ae6fb[_0x9c6e('0x45')]},'raw':!![]})[_0x9c6e('0x13')](function(_0x19815a){if(_0x19815a&&_0x19815a['autoAssociation']===0x0){return db[_0x9c6e('0x46')][_0x9c6e('0x3d')]({'name':_0x4b8ef6['name'],'resourceId':_0x4b8ef6['id'],'type':_0x19815a[_0x9c6e('0x1e')],'sectionId':_0x19815a['id']},{})[_0x9c6e('0x13')](function(){return _0x384fa6;});}else{return _0x384fa6;}})[_0x9c6e('0x38')](function(_0x45f99c){logger['error'](_0x9c6e('0x47'),_0x45f99c);throw _0x45f99c;});}return _0x384fa6;})['then'](respondWithResult(_0x45c4fa,0xc9))[_0x9c6e('0x38')](handleError(_0x45c4fa,null));};exports[_0x9c6e('0x48')]=function(_0x40e9b5,_0x2f85d3){if(_0x40e9b5[_0x9c6e('0x39')]['id']){delete _0x40e9b5['body']['id'];}return db[_0x9c6e('0x21')]['find']({'where':{'id':_0x40e9b5[_0x9c6e('0x49')]['id']}})[_0x9c6e('0x13')](handleEntityNotFound(_0x2f85d3,null))[_0x9c6e('0x13')](function(_0x9d206f){if(_0x9d206f){return db['VoiceExtension'][_0x9c6e('0x48')](_[_0x9c6e('0x2f')](_0x40e9b5[_0x9c6e('0x39')],['exten','context',_0x9c6e('0x4a'),_0x9c6e('0x4b'),_0x9c6e('0x4c'),'mandatoryDisposition','alias']),{'where':{'context':_0x9d206f[_0x9c6e('0x4d')],'exten':_0x9d206f['exten']},'individualHooks':!![]})[_0x9c6e('0x13')](function(_0x6f59ad){return _0x6f59ad;});}return null;})[_0x9c6e('0x13')](respondWithStatusCode(_0x2f85d3,null))[_0x9c6e('0x38')](handleError(_0x2f85d3,null));};exports[_0x9c6e('0x4e')]=function(_0x25b123,_0x46df4b){var _0x15d08b=_0x25b123[_0x9c6e('0x49')]['id'];var _0xe57a05=_0x25b123[_0x9c6e('0x39')];var _0x4345f9=0xc8;var _0x5669c6=null;return db[_0x9c6e('0x4f')][_0x9c6e('0x50')]({'isolationLevel':db['sequelize'][_0x9c6e('0x51')][_0x9c6e('0x52')][_0x9c6e('0x53')]},function(_0x5ad472){return db[_0x9c6e('0x21')][_0x9c6e('0x54')]({'where':{'id':_0x15d08b},'transaction':_0x5ad472})[_0x9c6e('0x13')](function(_0xe884b4){if(_0xe884b4){return db['VoiceExtension'][_0x9c6e('0x12')]({'where':{'VoiceExtensionId':_0x15d08b},'transaction':_0x5ad472})[_0x9c6e('0x13')](function(){var _0x5c518b=_['map'](_0xe57a05,function(_0x3b74c9){_0x3b74c9[_0x9c6e('0x55')]=_0x15d08b;_0x3b74c9[_0x9c6e('0x56')]=!![];return _0x3b74c9;});return _0xe884b4[_0x9c6e('0x57')](_0x5c518b);})[_0x9c6e('0x13')](function(_0x48318e){return db[_0x9c6e('0x21')][_0x9c6e('0x58')](_0x48318e,{'transaction':_0x5ad472});});}else{_0x4345f9=0x194;_0x5669c6=[];}});})[_0x9c6e('0x13')](function(){if(_0x4345f9!==0x194){return db[_0x9c6e('0x21')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x15d08b},'order':_0x9c6e('0x59')})[_0x9c6e('0x13')](function(_0x497ea2){_0x5669c6=_0x497ea2;});}})['catch'](function(_0x8d974f){_0x4345f9=0x1f4;logger['error'](_0x8d974f[_0x9c6e('0x5a')]);if(_0x8d974f[_0x9c6e('0x1e')]){delete _0x8d974f[_0x9c6e('0x1e')];}_0x5669c6=_0x8d974f;})['finally'](function(){if(_0x5669c6===null){_0x46df4b['sendStatus'](_0x4345f9);}else{if(_0x4345f9===0x1f4){_0x46df4b[_0x9c6e('0xf')](_0x4345f9)[_0x9c6e('0x20')](_0x5669c6);}else{_0x46df4b[_0x9c6e('0xf')](_0x4345f9)[_0x9c6e('0xa')](_0x5669c6);}}});};
\ No newline at end of file
+var _0xdb10=['value','includes','type','find','UserProfileResource','then','stack','name','index','VoiceExtension','rawAttributes','fieldName','query','keys','filters','model','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','fields','length','create','startsWith','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','internal','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','finally','send','json','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','undefined','count','Content-Range','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map'];(function(_0x353b20,_0x3d980f){var _0x5e7f3b=function(_0x401546){while(--_0x401546){_0x353b20['push'](_0x353b20['shift']());}};_0x5e7f3b(++_0x3d980f);}(_0xdb10,0x157));var _0x0db1=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0xdb10[_0x5090d4];return _0x56c310;};'use strict';var _=require('lodash');var Redis=require(_0x0db1('0x0'));var qs=require(_0x0db1('0x1'));var logger=require(_0x0db1('0x2'))('api');var config=require('../../config/environment');var db=require(_0x0db1('0x3'))['db'];config[_0x0db1('0x4')]=_['defaults'](config[_0x0db1('0x4')],{'host':_0x0db1('0x5'),'port':0x18eb});var socket=require(_0x0db1('0x6'))(new Redis(config[_0x0db1('0x4')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x83d036,_0x4d06bf){_0x4d06bf=_0x4d06bf||0xcc;return function(_0xcdad38){if(_0xcdad38){return _0x83d036[_0x0db1('0x7')](_0x4d06bf);}return _0x83d036[_0x0db1('0x8')](_0x4d06bf)[_0x0db1('0x9')]();};}function respondWithResult(_0x421efc,_0x2a8a65){_0x2a8a65=_0x2a8a65||0xc8;return function(_0xdc81bd){if(_0xdc81bd){return _0x421efc['status'](_0x2a8a65)['json'](_0xdc81bd);}};}function respondWithFilteredResult(_0x145f4f,_0x211a60){return function(_0x192fc4){if(_0x192fc4){var _0x21eba4=typeof _0x211a60[_0x0db1('0xa')]==='undefined'&&typeof _0x211a60[_0x0db1('0xb')]===_0x0db1('0xc');var _0x5a8c79=_0x192fc4[_0x0db1('0xd')];var _0x3743cd=_0x21eba4?0x0:_0x211a60[_0x0db1('0xa')];var _0x1d0f70=_0x21eba4?_0x192fc4['count']:_0x211a60[_0x0db1('0xa')]+_0x211a60[_0x0db1('0xb')];var _0x2c333b;if(_0x1d0f70>=_0x5a8c79){_0x1d0f70=_0x5a8c79;_0x2c333b=0xc8;}else{_0x2c333b=0xce;}_0x145f4f[_0x0db1('0x8')](_0x2c333b);return _0x145f4f['set'](_0x0db1('0xe'),_0x3743cd+'-'+_0x1d0f70+'/'+_0x5a8c79)['json'](_0x192fc4);}return null;};}function removeEntity(_0x489f6c){return function(_0x229018){if(_0x229018){return _0x229018[_0x0db1('0xf')]()['then'](function(){var _0x335846=_0x229018[_0x0db1('0x10')]({'plain':!![]});var _0x419493=[{'name':_0x0db1('0x11'),'value':_0x0db1('0x12'),'ignore':![]},{'name':_0x0db1('0x13'),'value':_0x0db1('0x14'),'ignore':![]},{'name':_0x0db1('0x15'),'value':'internal','ignore':![]}];var _0x1d4823=_(_0x419493)[_0x0db1('0x16')](_0x0db1('0x17'))[_0x0db1('0x18')](_0x0db1('0x19'))[_0x0db1('0x19')]();if(_[_0x0db1('0x1a')](_0x1d4823,_0x335846[_0x0db1('0x1b')])){return;}var _0x43216a=_[_0x0db1('0x1c')](_0x419493,['value',_0x335846[_0x0db1('0x1b')]])['name'];return db[_0x0db1('0x1d')][_0x0db1('0xf')]({'where':{'type':_0x43216a,'resourceId':_0x335846['id']}})[_0x0db1('0x1e')](function(){return _0x229018;});})[_0x0db1('0x1e')](function(){_0x489f6c[_0x0db1('0x8')](0xcc)[_0x0db1('0x9')]();});}};}function handleEntityNotFound(_0x5e41f5){return function(_0x3c3d70){if(!_0x3c3d70){_0x5e41f5[_0x0db1('0x7')](0x194);}return _0x3c3d70;};}function handleError(_0x5a3e8f,_0x4995da){_0x4995da=_0x4995da||0x1f4;return function(_0x244aed){logger['error'](_0x244aed[_0x0db1('0x1f')]);if(_0x244aed[_0x0db1('0x20')]){delete _0x244aed[_0x0db1('0x20')];}_0x5a3e8f['status'](_0x4995da)['send'](_0x244aed);};}exports[_0x0db1('0x21')]=function(_0x50ea7d,_0x35a246){var _0x132838={},_0x302499={},_0x1c1db7={'count':0x0,'rows':[]};var _0x4de2fc=_[_0x0db1('0x18')](db[_0x0db1('0x22')][_0x0db1('0x23')],function(_0x521de0){return{'name':_0x521de0[_0x0db1('0x24')],'type':_0x521de0[_0x0db1('0x1b')]['key']};});_0x302499['model']=_['map'](_0x4de2fc,'name');_0x302499[_0x0db1('0x25')]=_[_0x0db1('0x26')](_0x50ea7d[_0x0db1('0x25')]);_0x302499[_0x0db1('0x27')]=_['intersection'](_0x302499[_0x0db1('0x28')],_0x302499['query']);_0x132838['attributes']=_['intersection'](_0x302499[_0x0db1('0x28')],qs['fields'](_0x50ea7d[_0x0db1('0x25')]['fields']));_0x132838['attributes']=_0x132838[_0x0db1('0x29')]['length']?_0x132838[_0x0db1('0x29')]:_0x302499[_0x0db1('0x28')];if(!_0x50ea7d['query'][_0x0db1('0x2a')](_0x0db1('0x2b'))){_0x132838[_0x0db1('0xb')]=qs[_0x0db1('0xb')](_0x50ea7d['query'][_0x0db1('0xb')]);_0x132838[_0x0db1('0xa')]=qs[_0x0db1('0xa')](_0x50ea7d[_0x0db1('0x25')][_0x0db1('0xa')]);}_0x132838['order']=qs['sort'](_0x50ea7d[_0x0db1('0x25')][_0x0db1('0x2c')]);_0x132838[_0x0db1('0x2d')]=qs[_0x0db1('0x27')](_['pick'](_0x50ea7d[_0x0db1('0x25')],_0x302499[_0x0db1('0x27')]),_0x4de2fc);if(_0x50ea7d[_0x0db1('0x25')][_0x0db1('0x16')]){_0x132838[_0x0db1('0x2d')]=_[_0x0db1('0x2e')](_0x132838['where'],{'$or':_[_0x0db1('0x18')](_0x4de2fc,function(_0x4da26c){if(_0x4da26c[_0x0db1('0x1b')]!==_0x0db1('0x2f')){var _0x273d26={};_0x273d26[_0x4da26c['name']]={'$like':'%'+_0x50ea7d[_0x0db1('0x25')][_0x0db1('0x16')]+'%'};return _0x273d26;}})});}_0x132838=_[_0x0db1('0x2e')]({},_0x132838,_0x50ea7d[_0x0db1('0x30')]);var _0x17db73={'where':_0x132838[_0x0db1('0x2d')]};return db[_0x0db1('0x22')]['count'](_0x17db73)[_0x0db1('0x1e')](function(_0xf706f8){_0x1c1db7[_0x0db1('0xd')]=_0xf706f8;if(_0x50ea7d[_0x0db1('0x25')][_0x0db1('0x31')]){_0x132838[_0x0db1('0x32')]=[{'all':!![]}];}return db['VoiceExtension'][_0x0db1('0x33')](_0x132838);})['then'](function(_0x5be637){_0x1c1db7[_0x0db1('0x34')]=_0x5be637;return _0x1c1db7;})['then'](respondWithFilteredResult(_0x35a246,_0x132838))[_0x0db1('0x35')](handleError(_0x35a246,null));};exports[_0x0db1('0x36')]=function(_0x60aaee,_0x2b0872){var _0x512d51={'raw':![],'where':{'id':_0x60aaee[_0x0db1('0x37')]['id']}},_0x1273d2={};_0x1273d2[_0x0db1('0x28')]=_[_0x0db1('0x26')](db['VoiceExtension']['rawAttributes']);_0x1273d2['query']=_['keys'](_0x60aaee[_0x0db1('0x25')]);_0x1273d2[_0x0db1('0x27')]=_[_0x0db1('0x38')](_0x1273d2[_0x0db1('0x28')],_0x1273d2[_0x0db1('0x25')]);_0x512d51[_0x0db1('0x29')]=_[_0x0db1('0x38')](_0x1273d2[_0x0db1('0x28')],qs[_0x0db1('0x39')](_0x60aaee[_0x0db1('0x25')]['fields']));_0x512d51[_0x0db1('0x29')]=_0x512d51[_0x0db1('0x29')][_0x0db1('0x3a')]?_0x512d51['attributes']:_0x1273d2[_0x0db1('0x28')];if(_0x60aaee[_0x0db1('0x25')]['includeAll']){_0x512d51[_0x0db1('0x32')]=[{'all':!![]}];}_0x512d51=_['merge']({},_0x512d51,_0x60aaee['options']);return db[_0x0db1('0x22')][_0x0db1('0x1c')](_0x512d51)[_0x0db1('0x1e')](handleEntityNotFound(_0x2b0872,null))[_0x0db1('0x1e')](respondWithResult(_0x2b0872,null))['catch'](handleError(_0x2b0872,null));};exports['destroy']=function(_0x927597,_0x1c0fd9){return db[_0x0db1('0x22')][_0x0db1('0x1c')]({'where':{'id':_0x927597[_0x0db1('0x37')]['id']}})['then'](handleEntityNotFound(_0x1c0fd9,null))['then'](removeEntity(_0x1c0fd9,null))[_0x0db1('0x35')](handleError(_0x1c0fd9,null));};exports[_0x0db1('0x3b')]=function(_0x4ef8b8,_0x2a9bd3){if(_0x4ef8b8['body']['type']==='outbound'&&!_[_0x0db1('0x3c')](_0x4ef8b8[_0x0db1('0x3d')]['exten'],'_')){_0x4ef8b8['body'][_0x0db1('0x3e')]='_'[_0x0db1('0x3f')](_0x4ef8b8[_0x0db1('0x3d')]['exten']);}return db[_0x0db1('0x22')][_0x0db1('0x3b')](_0x4ef8b8[_0x0db1('0x3d')],{'raw':![]})[_0x0db1('0x1e')](function(_0x488acf){var _0x20f515=_0x4ef8b8['user'][_0x0db1('0x10')]({'plain':!![]});if(!_0x20f515)throw new Error(_0x0db1('0x40'));if(_0x20f515['role']===_0x0db1('0x41')){var _0x4f3893=_0x488acf[_0x0db1('0x10')]({'plain':!![]});var _0x6178ce=[{'name':'InboundRoutes','value':_0x0db1('0x12')},{'name':_0x0db1('0x13'),'value':_0x0db1('0x14')},{'name':_0x0db1('0x15'),'value':_0x0db1('0x42')}];var _0x16da19=_['find'](_0x6178ce,[_0x0db1('0x19'),_0x4f3893['type']])[_0x0db1('0x20')];return db[_0x0db1('0x43')][_0x0db1('0x1c')]({'where':{'name':_0x16da19,'userProfileId':_0x20f515['userProfileId']},'raw':!![]})[_0x0db1('0x1e')](function(_0x4b267c){if(_0x4b267c&&_0x4b267c[_0x0db1('0x44')]===0x0){return db[_0x0db1('0x1d')][_0x0db1('0x3b')]({'name':_0x4f3893[_0x0db1('0x20')],'resourceId':_0x4f3893['id'],'type':_0x4b267c[_0x0db1('0x20')],'sectionId':_0x4b267c['id']},{})['then'](function(){return _0x488acf;});}else{return _0x488acf;}})[_0x0db1('0x35')](function(_0x50dbdf){logger[_0x0db1('0x45')](_0x0db1('0x46'),_0x50dbdf);throw _0x50dbdf;});}return _0x488acf;})[_0x0db1('0x1e')](respondWithResult(_0x2a9bd3,0xc9))[_0x0db1('0x35')](handleError(_0x2a9bd3,null));};exports['update']=function(_0x8d92d3,_0x18cfa2){if(_0x8d92d3[_0x0db1('0x3d')]['id']){delete _0x8d92d3[_0x0db1('0x3d')]['id'];}return db[_0x0db1('0x22')]['find']({'where':{'id':_0x8d92d3[_0x0db1('0x37')]['id']}})['then'](handleEntityNotFound(_0x18cfa2,null))['then'](function(_0x1b7725){if(_0x1b7725){return db['VoiceExtension'][_0x0db1('0x47')](_[_0x0db1('0x48')](_0x8d92d3[_0x0db1('0x3d')],['exten','context',_0x0db1('0x49'),_0x0db1('0x4a'),_0x0db1('0x4b'),_0x0db1('0x4c'),_0x0db1('0x4d')]),{'where':{'context':_0x1b7725[_0x0db1('0x4e')],'exten':_0x1b7725[_0x0db1('0x3e')]},'individualHooks':!![]})['then'](function(_0x16606a){return _0x16606a;});}return null;})[_0x0db1('0x1e')](respondWithStatusCode(_0x18cfa2,null))[_0x0db1('0x35')](handleError(_0x18cfa2,null));};exports[_0x0db1('0x4f')]=function(_0x2c432b,_0x3d3c49){var _0x20d6ec=_0x2c432b[_0x0db1('0x37')]['id'];var _0x116c8b=_0x2c432b[_0x0db1('0x3d')];var _0x2c88f8=0xc8;var _0x281781=null;return db[_0x0db1('0x50')][_0x0db1('0x51')]({'isolationLevel':db['sequelize'][_0x0db1('0x52')]['ISOLATION_LEVELS'][_0x0db1('0x53')]},function(_0x554edc){return db[_0x0db1('0x22')][_0x0db1('0x54')]({'where':{'id':_0x20d6ec},'transaction':_0x554edc})[_0x0db1('0x1e')](function(_0x500d2d){if(_0x500d2d){return db['VoiceExtension'][_0x0db1('0xf')]({'where':{'VoiceExtensionId':_0x20d6ec},'transaction':_0x554edc})[_0x0db1('0x1e')](function(){var _0x4c53a3=_[_0x0db1('0x18')](_0x116c8b,function(_0x407b6b){_0x407b6b[_0x0db1('0x55')]=_0x20d6ec;_0x407b6b[_0x0db1('0x56')]=!![];return _0x407b6b;});return _0x500d2d[_0x0db1('0x57')](_0x4c53a3);})[_0x0db1('0x1e')](function(_0x3841c0){return db[_0x0db1('0x22')][_0x0db1('0x58')](_0x3841c0,{'transaction':_0x554edc});});}else{_0x2c88f8=0x194;_0x281781=[];}});})[_0x0db1('0x1e')](function(){if(_0x2c88f8!==0x194){return db[_0x0db1('0x22')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x20d6ec},'order':'cast(priority\x20as\x20unsigned)'})[_0x0db1('0x1e')](function(_0x335f2f){_0x281781=_0x335f2f;});}})[_0x0db1('0x35')](function(_0x4916e1){_0x2c88f8=0x1f4;logger[_0x0db1('0x45')](_0x4916e1['stack']);if(_0x4916e1['name']){delete _0x4916e1['name'];}_0x281781=_0x4916e1;})[_0x0db1('0x59')](function(){if(_0x281781===null){_0x3d3c49[_0x0db1('0x7')](_0x2c88f8);}else{if(_0x2c88f8===0x1f4){_0x3d3c49[_0x0db1('0x8')](_0x2c88f8)[_0x0db1('0x5a')](_0x281781);}else{_0x3d3c49[_0x0db1('0x8')](_0x2c88f8)[_0x0db1('0x5b')](_0x281781);}}});};
\ No newline at end of file
index 4443762..85beb80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a58=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove'];(function(_0x3caa4e,_0x574d64){var _0x399be5=function(_0x4e9db2){while(--_0x4e9db2){_0x3caa4e['push'](_0x3caa4e['shift']());}};_0x399be5(++_0x574d64);}(_0x8a58,0x12d));var _0x88a5=function(_0xcd4d8e,_0x1fc2fd){_0xcd4d8e=_0xcd4d8e-0x0;var _0x1c3c61=_0x8a58[_0xcd4d8e];return _0x1c3c61;};'use strict';var EventEmitter=require(_0x88a5('0x0'));var VoiceExtension=require(_0x88a5('0x1'))['db'][_0x88a5('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x88a5('0x3')](0x0);var events={'afterCreate':_0x88a5('0x4'),'afterUpdate':_0x88a5('0x5'),'afterDestroy':_0x88a5('0x6')};function emitEvent(_0xc2852d){return function(_0x2c3025,_0xbc8120,_0x4c8020){VoiceExtensionEvents[_0x88a5('0x7')](_0xc2852d+':'+_0x2c3025['id'],_0x2c3025);VoiceExtensionEvents[_0x88a5('0x7')](_0xc2852d,_0x2c3025);_0x4c8020(null);};}for(var e in events){if(events[_0x88a5('0x8')](e)){var event=events[e];VoiceExtension[_0x88a5('0x9')](e,emitEvent(event));}}module[_0x88a5('0xa')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xf52c=['../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xf52c,0x19d));var _0xcf52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf52c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xcf52('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xcf52('0x1')](0x0);var events={'afterCreate':_0xcf52('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3166bc){return function(_0x429485,_0x494b12,_0x139d46){VoiceExtensionEvents['emit'](_0x3166bc+':'+_0x429485['id'],_0x429485);VoiceExtensionEvents[_0xcf52('0x3')](_0x3166bc,_0x429485);_0x139d46(null);};}for(var e in events){if(events[_0xcf52('0x4')](e)){var event=events[e];VoiceExtension[_0xcf52('0x5')](e,emitEvent(event));}}module[_0xcf52('0x6')]=VoiceExtensionEvents;
\ No newline at end of file
index 018b579..3c84676 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd730=['Hangup','./voiceExtension.attributes','models','type','CDR(type)=','exten','alias','No\x20alias\x20set','context','push','inbound','Set','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','NoOp','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','name','split','phone','param','prefix','${EXTEN:','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get'];(function(_0xa0af03,_0xa57c29){var _0x8f8e5=function(_0x4cebca){while(--_0x4cebca){_0xa0af03['push'](_0xa0af03['shift']());}};_0x8f8e5(++_0xa57c29);}(_0xd730,0xfd));var _0x0d73=function(_0x31d431,_0x4135c6){_0x31d431=_0x31d431-0x0;var _0x14b046=_0xd730[_0x31d431];return _0x14b046;};'use strict';var _=require('lodash');var attributes=require(_0x0d73('0x0'));module['exports']=function(_0xe72e89){var _0x5f34ae=_0xe72e89[_0x0d73('0x1')];function _0x5c9f09(_0x476846){var _0x44d213=0x2;var _0x1c036c=[{'type':_0x476846[_0x0d73('0x2')],'app':'Set','appdata':_0x0d73('0x3')+_0x476846[_0x0d73('0x2')],'context':_0x476846['context'],'exten':_0x476846[_0x0d73('0x4')],'priority':_0x44d213++,'VoiceExtensionId':_0x476846['id']},{'type':_0x476846['type'],'app':_0x476846[_0x0d73('0x5')]?'Set':'NoOp','appdata':_0x476846[_0x0d73('0x5')]?'CDR(routeAlias)='+_0x476846[_0x0d73('0x5')]:_0x0d73('0x6'),'context':_0x476846[_0x0d73('0x7')],'exten':_0x476846['exten'],'priority':_0x44d213++,'VoiceExtensionId':_0x476846['id']}];if(_0x476846[_0x0d73('0x2')]==='inbound'){_0x1c036c[_0x0d73('0x8')]({'type':_0x0d73('0x9'),'app':_0x0d73('0xa'),'appdata':_0x0d73('0xb')+_0x476846['id'],'context':_0x476846[_0x0d73('0x7')],'exten':_0x476846[_0x0d73('0x4')],'priority':_0x44d213++,'VoiceExtensionId':_0x476846['id']});}_0x1c036c[_0x0d73('0x8')]({'type':_0x476846[_0x0d73('0x2')],'app':_0x0d73('0xa'),'appdata':_0x0d73('0xc'),'context':_0x476846[_0x0d73('0x7')],'exten':_0x476846[_0x0d73('0x4')],'priority':_0x44d213++,'VoiceExtensionId':_0x476846['id']},{'type':_0x476846[_0x0d73('0x2')],'app':'Set','appdata':_0x0d73('0xd'),'context':_0x476846[_0x0d73('0x7')],'exten':_0x476846[_0x0d73('0x4')],'priority':_0x44d213++,'VoiceExtensionId':_0x476846['id']},{'type':_0x476846[_0x0d73('0x2')],'app':_0x0d73('0xa'),'appdata':'MONITOR_OPTIONS=ab','context':_0x476846[_0x0d73('0x7')],'exten':_0x476846[_0x0d73('0x4')],'priority':_0x44d213++,'VoiceExtensionId':_0x476846['id']});return _0x1c036c;}function _0x515c9a(_0x548f6a){var _0x56648f=0x2;var _0x158933=[{'type':_0x0d73('0xe'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x548f6a[_0x0d73('0x7')],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':_0x0d73('0xe'),'app':_0x548f6a[_0x0d73('0x5')]?_0x0d73('0xa'):_0x0d73('0xf'),'appdata':_0x548f6a['alias']?_0x0d73('0x10')+_0x548f6a[_0x0d73('0x5')]:'No\x20alias\x20set','context':_0x548f6a['context'],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':_0x0d73('0xe'),'app':_0x0d73('0xa'),'appdata':_0x0d73('0x11')+(_0x548f6a[_0x0d73('0x12')]?'${EXTEN:'+_0x548f6a[_0x0d73('0x12')]+'}':_0x0d73('0x13')),'context':_0x548f6a[_0x0d73('0x7')],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':_0x0d73('0xe'),'app':_0x0d73('0xa'),'appdata':_0x0d73('0xb')+_0x548f6a['id'],'context':_0x548f6a[_0x0d73('0x7')],'exten':_0x548f6a['exten'],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':_0x0d73('0xe'),'app':_0x0d73('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x56648f+0x2)+'):Goto('+(_0x56648f+0x1)+')','context':_0x548f6a[_0x0d73('0x7')],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':_0x0d73('0xe'),'app':_0x0d73('0xa'),'appdata':_0x548f6a[_0x0d73('0x12')]?_0x0d73('0x15')+_0x548f6a[_0x0d73('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x548f6a['context'],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':_0x0d73('0xe'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x548f6a[_0x0d73('0x7')],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':_0x0d73('0xe'),'app':_0x0d73('0xa'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x548f6a[_0x0d73('0x7')],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':_0x0d73('0xe'),'app':_0x0d73('0xa'),'appdata':_0x0d73('0x16'),'context':_0x548f6a[_0x0d73('0x7')],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':'outbound','app':_0x0d73('0xa'),'appdata':_0x0d73('0x17')+_0x548f6a['id'],'context':_0x548f6a['context'],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']}];if(_0x548f6a[_0x0d73('0x18')](_0x0d73('0x19'))&&_0x548f6a[_0x0d73('0x19')]!=='none'){_0x158933[_0x0d73('0x8')]({'type':_0x0d73('0xe'),'app':_0x0d73('0xa'),'appdata':_0x0d73('0x1a'),'context':_0x548f6a[_0x0d73('0x7')],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']},{'type':'outbound','app':_0x0d73('0xa'),'appdata':_0x0d73('0x1b')+_0x548f6a[_0x0d73('0x19')]||_0x0d73('0x1c'),'context':_0x548f6a['context'],'exten':_0x548f6a[_0x0d73('0x4')],'priority':_0x56648f++,'VoiceExtensionId':_0x548f6a['id']});}return _0x158933;}function _0x3778d3(_0x7e19f6,_0x28b411){var _0x308e91=[{'name':_0x0d73('0x1d'),'param':0x0},{'name':_0x0d73('0x1e'),'param':0x1},{'name':_0x0d73('0x1f'),'param':0x2},{'name':_0x0d73('0x20'),'param':0x3}];var _0x5d9eb6={};var _0x3a6190=_0x28b411['split'](',');var _0x548d5e=[];for(var _0x25ab7b=0x0;_0x25ab7b<_0x308e91[_0x0d73('0x21')];_0x25ab7b++){switch(_0x308e91[_0x25ab7b][_0x0d73('0x22')]){case _0x0d73('0x1d'):_0x5d9eb6[_0x0d73('0x1d')]=_0x3a6190[_0x308e91[_0x25ab7b]['param']][_0x0d73('0x23')]('/')[0x1];_0x5d9eb6[_0x0d73('0x24')]=_0x3a6190[_0x308e91[_0x25ab7b][_0x0d73('0x25')]][_0x0d73('0x23')]('/')[0x2];_0x5d9eb6[_0x0d73('0x26')]=_0x5d9eb6[_0x0d73('0x24')]?_0x5d9eb6[_0x0d73('0x24')][_0x0d73('0x23')]('$')[0x0]:undefined;_0x5d9eb6[_0x0d73('0x24')]=_0x7e19f6[_0x0d73('0x12')]?(_0x5d9eb6['prefix']||'')+_0x0d73('0x27')+_0x7e19f6[_0x0d73('0x12')]+'}':(_0x5d9eb6[_0x0d73('0x26')]||'')+_0x0d73('0x13');_0x548d5e[_0x308e91[_0x25ab7b][_0x0d73('0x25')]]=[_0x0d73('0x28'),_0x5d9eb6[_0x0d73('0x1d')],_0x5d9eb6[_0x0d73('0x24')]][_0x0d73('0x29')]('/');break;case _0x0d73('0x1f'):_0x5d9eb6[_0x0d73('0x1f')]=_0x3a6190[_0x308e91[_0x25ab7b][_0x0d73('0x25')]];if(_0x7e19f6[_0x0d73('0x19')]!==_0x0d73('0x2a')){if(_0x5d9eb6[_0x0d73('0x1f')][_0x0d73('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x5d9eb6[_0x0d73('0x1f')]+=_0x0d73('0x2c');}}else{_0x5d9eb6[_0x0d73('0x1f')]=_0x5d9eb6['options'][_0x0d73('0x2d')](_0x0d73('0x2c'),'');}_0x548d5e[_0x308e91[_0x25ab7b]['param']]=_0x5d9eb6[_0x0d73('0x1f')];break;default:_0x548d5e[_0x308e91[_0x25ab7b][_0x0d73('0x25')]]=_0x3a6190[_0x308e91[_0x25ab7b][_0x0d73('0x25')]];}}return _0x548d5e[_0x0d73('0x29')](',');}function _0xb4891b(_0x11a1ed,_0x12b1d2,_0xc86dc5){return new Promise(function(_0x1af04a,_0x5cb819){var _0x262244=[];if(_[_0x0d73('0x2e')](_0x12b1d2))return _0x1af04a(_0x262244);_0x5f34ae['Interval'][_0x0d73('0x2f')]({'attributes':['id',_0x0d73('0x30'),_0x0d73('0x31')],'raw':!![]})[_0x0d73('0x32')](function(_0x338358){for(var _0x3eb588=0x0,_0xcc63cc=0x0;_0x3eb588<_0x12b1d2['length'];_0x3eb588++,_0xcc63cc=0x0){var _0xa2f71c=_0x12b1d2[_0x3eb588];var _0x33ae6c=[];var _0x5a9f97=[];delete _0xa2f71c['id'];if(_0xa2f71c['interval']!==_0x0d73('0x33')){_0xa2f71c['intervals']=[_0xa2f71c[_0x0d73('0x30')]];}else{_0xa2f71c[_0x0d73('0x34')]=_0xa2f71c[_0x0d73('0x31')]?_[_0x0d73('0x35')](_[_0x0d73('0x36')](_0x338358,{'IntervalId':_0xa2f71c[_0x0d73('0x31')]}),_0x0d73('0x30')):[];}_0xa2f71c[_0x0d73('0x7')]=_0x11a1ed['context'];_0xa2f71c[_0x0d73('0x4')]=_0x11a1ed[_0x0d73('0x4')];if(_0xa2f71c[_0x0d73('0x2')])_0xa2f71c['type']=_0xa2f71c[_0x0d73('0x2')][_0x0d73('0x37')]();if(_0x11a1ed[_0x0d73('0x2')]===_0x0d73('0xe')){if(_0xa2f71c[_0x0d73('0x18')]('tag')&&_0xa2f71c[_0x0d73('0x38')]&&_0xa2f71c[_0x0d73('0x38')]!=='--'){_0x33ae6c[_0x0d73('0x8')]({'type':_0xa2f71c[_0x0d73('0x2')][_0x0d73('0x37')](),'app':_0x0d73('0xa'),'appdata':'CDR(tag)='+_0xa2f71c[_0x0d73('0x38')],'context':_0x11a1ed['context'],'exten':_0x11a1ed[_0x0d73('0x4')],'priority':_0xa2f71c[_0x0d73('0x34')][_0x0d73('0x21')]+_0xc86dc5+_0xcc63cc++,'VoiceExtensionId':_0x11a1ed['id']});}_0x33ae6c[_0x0d73('0x8')]({'type':_0xa2f71c[_0x0d73('0x2')][_0x0d73('0x37')](),'app':_0x0d73('0x14'),'appdata':_0x0d73('0x39')+(_0xa2f71c[_0x0d73('0x3a')]?_0x0d73('0x3b')+_0xa2f71c[_0x0d73('0x3a')]+')':'NoOp(No\x20number\x20available)'),'context':_0x11a1ed['context'],'exten':_0x11a1ed[_0x0d73('0x4')],'priority':_0xa2f71c['intervals'][_0x0d73('0x21')]+_0xc86dc5+_0xcc63cc++,'VoiceExtensionId':_0x11a1ed['id']});}else{if(_0xa2f71c[_0x0d73('0x18')](_0x0d73('0x3c'))){if([_0x0d73('0x3d'),_0x0d73('0x3e')][_0x0d73('0x3f')](_0xa2f71c[_0x0d73('0x40')][_0x0d73('0x37')]())&&_0xa2f71c[_0x0d73('0x41')]!==_0x0d73('0x42')){if(_0xa2f71c[_0x0d73('0x3c')]){_0x33ae6c[_0x0d73('0x8')]({'type':_0xa2f71c[_0x0d73('0x2')][_0x0d73('0x37')](),'app':_0x0d73('0x14'),'appdata':_0x0d73('0x43'),'context':_0x11a1ed[_0x0d73('0x7')],'exten':_0x11a1ed[_0x0d73('0x4')],'priority':_0xa2f71c['intervals']['length']+_0xc86dc5+_0xcc63cc++,'VoiceExtensionId':_0x11a1ed['id']});_0x33ae6c[_0x0d73('0x8')]({'type':_0xa2f71c['type'][_0x0d73('0x37')](),'app':_0x0d73('0xa'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x11a1ed['context'],'exten':_0x11a1ed['exten'],'priority':_0xa2f71c['intervals'][_0x0d73('0x21')]+_0xc86dc5+_0xcc63cc++,'VoiceExtensionId':_0x11a1ed['id']});}else{_0x33ae6c[_0x0d73('0x8')]({'type':_0xa2f71c[_0x0d73('0x2')][_0x0d73('0x37')](),'app':_0x0d73('0x14'),'appdata':_0x0d73('0x44'),'context':_0x11a1ed[_0x0d73('0x7')],'exten':_0x11a1ed['exten'],'priority':_0xa2f71c[_0x0d73('0x34')][_0x0d73('0x21')]+_0xc86dc5+_0xcc63cc++,'VoiceExtensionId':_0x11a1ed['id']});_0x33ae6c[_0x0d73('0x8')]({'type':_0xa2f71c['type']['toLowerCase'](),'app':_0x0d73('0xa'),'appdata':_0x0d73('0x45'),'context':_0x11a1ed[_0x0d73('0x7')],'exten':_0x11a1ed[_0x0d73('0x4')],'priority':_0xa2f71c[_0x0d73('0x34')][_0x0d73('0x21')]+_0xc86dc5+_0xcc63cc++,'VoiceExtensionId':_0x11a1ed['id']});}}}}for(var _0x1583a5=0x0;_0x1583a5<_0xa2f71c[_0x0d73('0x34')]['length'];_0x1583a5++){var _0x571cad=_0xc86dc5+_0xa2f71c[_0x0d73('0x34')]['length'];var _0x4c9efd=_0x1583a5===_0xa2f71c[_0x0d73('0x34')][_0x0d73('0x21')]-0x1?_0xc86dc5+_0x33ae6c['length']+_0x5a9f97[_0x0d73('0x21')]+0x2:_0xc86dc5+_0x1583a5+0x1;_0x33ae6c[_0x0d73('0x46')](_0x1583a5,0x0,{'type':_0x11a1ed[_0x0d73('0x2')],'app':_0x0d73('0x47'),'appdata':_0xa2f71c[_0x0d73('0x34')][_0x1583a5]+'?'+_0x11a1ed[_0x0d73('0x7')]+',${EXTEN},'+_0x571cad+':'+_0x11a1ed['context']+_0x0d73('0x48')+_0x4c9efd,'exten':_0x11a1ed[_0x0d73('0x4')],'context':_0x11a1ed[_0x0d73('0x7')],'priority':_0xc86dc5+_0x1583a5,'VoiceExtensionId':_0x11a1ed['id']});}if(_0xa2f71c[_0x0d73('0x41')]===_0x0d73('0x49'))_0xa2f71c[_0x0d73('0x4a')]=_0x3778d3(_0x11a1ed,_0xa2f71c['appdata']);_0xa2f71c[_0x0d73('0x4b')]=_0x33ae6c[_0x0d73('0x21')]?_[_0x0d73('0x4c')](_0x33ae6c)['priority']+0x1:_0xc86dc5;_0x262244=_[_0x0d73('0x4d')](_0x262244,_0x33ae6c,[_0xa2f71c],_0x5a9f97);_0xc86dc5=_[_0x0d73('0x4c')](_0x262244)['priority']+0x1;}return _0x1af04a(_0x262244);})[_0x0d73('0x4e')](function(_0x199d34){_0x5cb819(_0x199d34);});});}return _0xe72e89[_0x0d73('0x4f')](_0x0d73('0x50'),attributes,{'tableName':_0x0d73('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x561976){var _0xa028dc=this[_0x0d73('0x52')]({'plain':!![]});var _0x1540f3=_0xa028dc[_0x0d73('0x2')]===_0x0d73('0xe')?_0x515c9a(_0xa028dc):_0x5c9f09(_0xa028dc);return _0xb4891b(_0xa028dc,_0x561976,_[_0x0d73('0x4c')](_0x1540f3)[_0x0d73('0x4b')]+0x1)['then'](function(_0x245a32){var _0x587327=_[_0x0d73('0x4d')](_0x1540f3,_0x245a32);_0x587327[_0x0d73('0x8')]({'type':_0xa028dc[_0x0d73('0x2')],'app':_0x0d73('0x53'),'exten':_0xa028dc[_0x0d73('0x4')],'context':_0xa028dc[_0x0d73('0x7')],'priority':_['last'](_0x587327)[_0x0d73('0x4b')]+0x1,'VoiceExtensionId':_0xa028dc['id']});return _0x587327;});}}});};
\ No newline at end of file
+var _0x5549=['get','Hangup','lodash','./voiceExtension.attributes','exports','type','CDR(type)=','context','exten','Set','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','alias','CDR(destination)=','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','url','split','param','phone','prefix','SIP','trunk','join','options','none','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','then','length','*,*,*,*','intervals','IntervalId','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0x5549,0x1f4));var _0x9554=function(_0x1b6e27,_0x40a484){_0x1b6e27=_0x1b6e27-0x0;var _0x5a99fa=_0x5549[_0x1b6e27];return _0x5a99fa;};'use strict';var _=require(_0x9554('0x0'));var attributes=require(_0x9554('0x1'));module[_0x9554('0x2')]=function(_0x2ef320){var _0x153cf2=_0x2ef320['models'];function _0x1a31f7(_0x25e709){var _0x244b13=0x2;var _0x36fc55=[{'type':_0x25e709[_0x9554('0x3')],'app':'Set','appdata':_0x9554('0x4')+_0x25e709['type'],'context':_0x25e709[_0x9554('0x5')],'exten':_0x25e709[_0x9554('0x6')],'priority':_0x244b13++,'VoiceExtensionId':_0x25e709['id']},{'type':_0x25e709[_0x9554('0x3')],'app':_0x25e709['alias']?_0x9554('0x7'):'NoOp','appdata':_0x25e709['alias']?_0x9554('0x8')+_0x25e709['alias']:_0x9554('0x9'),'context':_0x25e709[_0x9554('0x5')],'exten':_0x25e709[_0x9554('0x6')],'priority':_0x244b13++,'VoiceExtensionId':_0x25e709['id']}];if(_0x25e709[_0x9554('0x3')]===_0x9554('0xa')){_0x36fc55['push']({'type':'inbound','app':_0x9554('0x7'),'appdata':_0x9554('0xb')+_0x25e709['id'],'context':_0x25e709[_0x9554('0x5')],'exten':_0x25e709['exten'],'priority':_0x244b13++,'VoiceExtensionId':_0x25e709['id']});}_0x36fc55[_0x9554('0xc')]({'type':_0x25e709[_0x9554('0x3')],'app':_0x9554('0x7'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x25e709[_0x9554('0x5')],'exten':_0x25e709[_0x9554('0x6')],'priority':_0x244b13++,'VoiceExtensionId':_0x25e709['id']},{'type':_0x25e709['type'],'app':_0x9554('0x7'),'appdata':_0x9554('0xd'),'context':_0x25e709[_0x9554('0x5')],'exten':_0x25e709[_0x9554('0x6')],'priority':_0x244b13++,'VoiceExtensionId':_0x25e709['id']},{'type':_0x25e709['type'],'app':_0x9554('0x7'),'appdata':_0x9554('0xe'),'context':_0x25e709[_0x9554('0x5')],'exten':_0x25e709['exten'],'priority':_0x244b13++,'VoiceExtensionId':_0x25e709['id']});return _0x36fc55;}function _0x3163d5(_0x484397){var _0x18811c=0x2;var _0x262038=[{'type':'outbound','app':_0x9554('0x7'),'appdata':_0x9554('0xf'),'context':_0x484397[_0x9554('0x5')],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':_0x9554('0x10'),'app':_0x484397[_0x9554('0x11')]?_0x9554('0x7'):'NoOp','appdata':_0x484397[_0x9554('0x11')]?_0x9554('0x8')+_0x484397[_0x9554('0x11')]:_0x9554('0x9'),'context':_0x484397[_0x9554('0x5')],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':_0x9554('0x10'),'app':_0x9554('0x7'),'appdata':_0x9554('0x12')+(_0x484397['cutdigits']?_0x9554('0x13')+_0x484397['cutdigits']+'}':_0x9554('0x14')),'context':_0x484397[_0x9554('0x5')],'exten':_0x484397['exten'],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':'outbound','app':_0x9554('0x7'),'appdata':_0x9554('0xb')+_0x484397['id'],'context':_0x484397[_0x9554('0x5')],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':_0x9554('0x10'),'app':_0x9554('0x15'),'appdata':_0x9554('0x16')+(_0x18811c+0x2)+_0x9554('0x17')+(_0x18811c+0x1)+')','context':_0x484397[_0x9554('0x5')],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':'outbound','app':_0x9554('0x7'),'appdata':_0x484397[_0x9554('0x18')]?_0x9554('0x19')+_0x484397['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x484397['context'],'exten':_0x484397['exten'],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':_0x9554('0x10'),'app':'Set','appdata':_0x9554('0x1a'),'context':_0x484397[_0x9554('0x5')],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':_0x9554('0x10'),'app':'Set','appdata':_0x9554('0xd'),'context':_0x484397[_0x9554('0x5')],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':_0x9554('0x10'),'app':_0x9554('0x7'),'appdata':_0x9554('0xe'),'context':_0x484397['context'],'exten':_0x484397['exten'],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':_0x9554('0x10'),'app':_0x9554('0x7'),'appdata':_0x9554('0x1b')+_0x484397['id'],'context':_0x484397[_0x9554('0x5')],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']}];if(_0x484397[_0x9554('0x1c')](_0x9554('0x1d'))&&_0x484397[_0x9554('0x1d')]!=='none'){_0x262038[_0x9554('0xc')]({'type':_0x9554('0x10'),'app':_0x9554('0x7'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x484397[_0x9554('0x5')],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']},{'type':'outbound','app':_0x9554('0x7'),'appdata':_0x9554('0x1e')+_0x484397['recordingFormat']||_0x9554('0x1f'),'context':_0x484397['context'],'exten':_0x484397[_0x9554('0x6')],'priority':_0x18811c++,'VoiceExtensionId':_0x484397['id']});}return _0x262038;}function _0x2fd874(_0x555fbd,_0x1c75f9){var _0x4b934e=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x9554('0x20'),'param':0x3}];var _0x51432b={};var _0x2279f0=_0x1c75f9[_0x9554('0x21')](',');var _0x424a45=[];for(var _0xc2cce9=0x0;_0xc2cce9<_0x4b934e['length'];_0xc2cce9++){switch(_0x4b934e[_0xc2cce9]['name']){case'trunk':_0x51432b['trunk']=_0x2279f0[_0x4b934e[_0xc2cce9][_0x9554('0x22')]][_0x9554('0x21')]('/')[0x1];_0x51432b[_0x9554('0x23')]=_0x2279f0[_0x4b934e[_0xc2cce9][_0x9554('0x22')]]['split']('/')[0x2];_0x51432b[_0x9554('0x24')]=_0x51432b[_0x9554('0x23')]?_0x51432b[_0x9554('0x23')][_0x9554('0x21')]('$')[0x0]:undefined;_0x51432b[_0x9554('0x23')]=_0x555fbd[_0x9554('0x18')]?(_0x51432b['prefix']||'')+'${EXTEN:'+_0x555fbd[_0x9554('0x18')]+'}':(_0x51432b[_0x9554('0x24')]||'')+_0x9554('0x14');_0x424a45[_0x4b934e[_0xc2cce9]['param']]=[_0x9554('0x25'),_0x51432b[_0x9554('0x26')],_0x51432b[_0x9554('0x23')]][_0x9554('0x27')]('/');break;case _0x9554('0x28'):_0x51432b[_0x9554('0x28')]=_0x2279f0[_0x4b934e[_0xc2cce9][_0x9554('0x22')]];if(_0x555fbd['recordingFormat']!==_0x9554('0x29')){if(_0x51432b[_0x9554('0x28')]['indexOf'](_0x9554('0x2a'))<0x0){_0x51432b[_0x9554('0x28')]+=_0x9554('0x2a');}}else{_0x51432b[_0x9554('0x28')]=_0x51432b['options'][_0x9554('0x2b')](_0x9554('0x2a'),'');}_0x424a45[_0x4b934e[_0xc2cce9][_0x9554('0x22')]]=_0x51432b[_0x9554('0x28')];break;default:_0x424a45[_0x4b934e[_0xc2cce9][_0x9554('0x22')]]=_0x2279f0[_0x4b934e[_0xc2cce9][_0x9554('0x22')]];}}return _0x424a45[_0x9554('0x27')](',');}function _0x472226(_0x88fbf,_0x3aa365,_0x143f3b){return new Promise(function(_0x577303,_0x492a1c){var _0x57cbeb=[];if(_[_0x9554('0x2c')](_0x3aa365))return _0x577303(_0x57cbeb);_0x153cf2['Interval'][_0x9554('0x2d')]({'attributes':['id',_0x9554('0x2e'),'IntervalId'],'raw':!![]})[_0x9554('0x2f')](function(_0x1741d8){for(var _0x45717e=0x0,_0x5283d2=0x0;_0x45717e<_0x3aa365[_0x9554('0x30')];_0x45717e++,_0x5283d2=0x0){var _0x3a1e23=_0x3aa365[_0x45717e];var _0x940be3=[];var _0x3e132f=[];delete _0x3a1e23['id'];if(_0x3a1e23[_0x9554('0x2e')]!==_0x9554('0x31')){_0x3a1e23[_0x9554('0x32')]=[_0x3a1e23[_0x9554('0x2e')]];}else{_0x3a1e23[_0x9554('0x32')]=_0x3a1e23[_0x9554('0x33')]?_['map'](_[_0x9554('0x34')](_0x1741d8,{'IntervalId':_0x3a1e23[_0x9554('0x33')]}),'interval'):[];}_0x3a1e23[_0x9554('0x5')]=_0x88fbf[_0x9554('0x5')];_0x3a1e23[_0x9554('0x6')]=_0x88fbf[_0x9554('0x6')];if(_0x3a1e23[_0x9554('0x3')])_0x3a1e23[_0x9554('0x3')]=_0x3a1e23[_0x9554('0x3')][_0x9554('0x35')]();if(_0x88fbf[_0x9554('0x3')]===_0x9554('0x10')){if(_0x3a1e23[_0x9554('0x1c')]('tag')&&_0x3a1e23['tag']&&_0x3a1e23[_0x9554('0x36')]!=='--'){_0x940be3[_0x9554('0xc')]({'type':_0x3a1e23['type'][_0x9554('0x35')](),'app':'Set','appdata':_0x9554('0x37')+_0x3a1e23[_0x9554('0x36')],'context':_0x88fbf['context'],'exten':_0x88fbf['exten'],'priority':_0x3a1e23['intervals'][_0x9554('0x30')]+_0x143f3b+_0x5283d2++,'VoiceExtensionId':_0x88fbf['id']});}_0x940be3[_0x9554('0xc')]({'type':_0x3a1e23[_0x9554('0x3')]['toLowerCase'](),'app':_0x9554('0x15'),'appdata':_0x9554('0x38')+(_0x3a1e23[_0x9554('0x39')]?'Set(CALLERID(all)='+_0x3a1e23[_0x9554('0x39')]+')':_0x9554('0x3a')),'context':_0x88fbf[_0x9554('0x5')],'exten':_0x88fbf[_0x9554('0x6')],'priority':_0x3a1e23[_0x9554('0x32')]['length']+_0x143f3b+_0x5283d2++,'VoiceExtensionId':_0x88fbf['id']});}else{if(_0x3a1e23[_0x9554('0x1c')](_0x9554('0x3b'))){if([_0x9554('0x3c'),_0x9554('0x3d')][_0x9554('0x3e')](_0x3a1e23[_0x9554('0x3f')][_0x9554('0x35')]())&&_0x3a1e23[_0x9554('0x40')]!==_0x9554('0x41')){if(_0x3a1e23[_0x9554('0x3b')]){_0x940be3[_0x9554('0xc')]({'type':_0x3a1e23[_0x9554('0x3')][_0x9554('0x35')](),'app':_0x9554('0x15'),'appdata':_0x9554('0x42'),'context':_0x88fbf[_0x9554('0x5')],'exten':_0x88fbf['exten'],'priority':_0x3a1e23[_0x9554('0x32')][_0x9554('0x30')]+_0x143f3b+_0x5283d2++,'VoiceExtensionId':_0x88fbf['id']});_0x940be3[_0x9554('0xc')]({'type':_0x3a1e23[_0x9554('0x3')][_0x9554('0x35')](),'app':_0x9554('0x7'),'appdata':_0x9554('0x43'),'context':_0x88fbf[_0x9554('0x5')],'exten':_0x88fbf[_0x9554('0x6')],'priority':_0x3a1e23[_0x9554('0x32')][_0x9554('0x30')]+_0x143f3b+_0x5283d2++,'VoiceExtensionId':_0x88fbf['id']});}else{_0x940be3[_0x9554('0xc')]({'type':_0x3a1e23[_0x9554('0x3')][_0x9554('0x35')](),'app':_0x9554('0x15'),'appdata':_0x9554('0x44'),'context':_0x88fbf[_0x9554('0x5')],'exten':_0x88fbf[_0x9554('0x6')],'priority':_0x3a1e23[_0x9554('0x32')][_0x9554('0x30')]+_0x143f3b+_0x5283d2++,'VoiceExtensionId':_0x88fbf['id']});_0x940be3[_0x9554('0xc')]({'type':_0x3a1e23[_0x9554('0x3')][_0x9554('0x35')](),'app':_0x9554('0x7'),'appdata':_0x9554('0x45'),'context':_0x88fbf[_0x9554('0x5')],'exten':_0x88fbf[_0x9554('0x6')],'priority':_0x3a1e23[_0x9554('0x32')]['length']+_0x143f3b+_0x5283d2++,'VoiceExtensionId':_0x88fbf['id']});}}}}for(var _0x125fb5=0x0;_0x125fb5<_0x3a1e23[_0x9554('0x32')][_0x9554('0x30')];_0x125fb5++){var _0x9168d6=_0x143f3b+_0x3a1e23[_0x9554('0x32')][_0x9554('0x30')];var _0x1d8ec7=_0x125fb5===_0x3a1e23[_0x9554('0x32')][_0x9554('0x30')]-0x1?_0x143f3b+_0x940be3['length']+_0x3e132f[_0x9554('0x30')]+0x2:_0x143f3b+_0x125fb5+0x1;_0x940be3['splice'](_0x125fb5,0x0,{'type':_0x88fbf['type'],'app':_0x9554('0x46'),'appdata':_0x3a1e23[_0x9554('0x32')][_0x125fb5]+'?'+_0x88fbf[_0x9554('0x5')]+_0x9554('0x47')+_0x9168d6+':'+_0x88fbf[_0x9554('0x5')]+',${EXTEN},'+_0x1d8ec7,'exten':_0x88fbf[_0x9554('0x6')],'context':_0x88fbf[_0x9554('0x5')],'priority':_0x143f3b+_0x125fb5,'VoiceExtensionId':_0x88fbf['id']});}if(_0x3a1e23[_0x9554('0x40')]===_0x9554('0x48'))_0x3a1e23[_0x9554('0x49')]=_0x2fd874(_0x88fbf,_0x3a1e23['appdata']);_0x3a1e23[_0x9554('0x4a')]=_0x940be3[_0x9554('0x30')]?_[_0x9554('0x4b')](_0x940be3)['priority']+0x1:_0x143f3b;_0x57cbeb=_[_0x9554('0x4c')](_0x57cbeb,_0x940be3,[_0x3a1e23],_0x3e132f);_0x143f3b=_[_0x9554('0x4b')](_0x57cbeb)['priority']+0x1;}return _0x577303(_0x57cbeb);})[_0x9554('0x4d')](function(_0x8ff4c1){_0x492a1c(_0x8ff4c1);});});}return _0x2ef320[_0x9554('0x4e')](_0x9554('0x4f'),attributes,{'tableName':_0x9554('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4003ad){var _0x2e76d1=this[_0x9554('0x51')]({'plain':!![]});var _0x330b4e=_0x2e76d1['type']===_0x9554('0x10')?_0x3163d5(_0x2e76d1):_0x1a31f7(_0x2e76d1);return _0x472226(_0x2e76d1,_0x4003ad,_[_0x9554('0x4b')](_0x330b4e)[_0x9554('0x4a')]+0x1)['then'](function(_0x49de1d){var _0x309cde=_[_0x9554('0x4c')](_0x330b4e,_0x49de1d);_0x309cde[_0x9554('0xc')]({'type':_0x2e76d1[_0x9554('0x3')],'app':_0x9554('0x52'),'exten':_0x2e76d1[_0x9554('0x6')],'context':_0x2e76d1[_0x9554('0x5')],'priority':_[_0x9554('0x4b')](_0x309cde)[_0x9554('0x4a')]+0x1,'VoiceExtensionId':_0x2e76d1['id']});return _0x309cde;});}}});};
\ No newline at end of file
index 4b19db9..0c3056b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44e8=['../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','GetVoiceExtension','findAll','raw','options','where','attributes','limit','include','map','model','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1b1c05,_0x330148){var _0x5612e3=function(_0x24ba39){while(--_0x24ba39){_0x1b1c05['push'](_0x1b1c05['shift']());}};_0x5612e3(++_0x330148);}(_0x44e8,0xd7));var _0x844e=function(_0xbac4cb,_0x4221f2){_0xbac4cb=_0xbac4cb-0x0;var _0x468bac=_0x44e8[_0xbac4cb];return _0x468bac;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x844e('0x1'));var rs=require(_0x844e('0x2'));var fs=require('fs');var Redis=require(_0x844e('0x3'));var db=require(_0x844e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x844e('0x5'))(_0x844e('0x6'));var config=require(_0x844e('0x7'));var jayson=require(_0x844e('0x8'));var client=jayson['client'][_0x844e('0x9')]({'port':0x232a});config[_0x844e('0xa')]=_[_0x844e('0xb')](config[_0x844e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x844e('0xc'))(new Redis(config[_0x844e('0xa')]));require(_0x844e('0xd'))[_0x844e('0xe')](socket);function respondWithRpcPromise(_0x32c6c7,_0x1f9921,_0x536601){return new BPromise(function(_0x39ef28,_0x1b4cf6){return client[_0x844e('0xf')](_0x32c6c7,_0x536601)[_0x844e('0x10')](function(_0x14909f){logger[_0x844e('0x11')](_0x844e('0x12'),_0x1f9921,'request\x20sent');logger[_0x844e('0x13')](_0x844e('0x14'),_0x1f9921,'request\x20sent',JSON[_0x844e('0x15')](_0x14909f));if(_0x14909f[_0x844e('0x16')]){if(_0x14909f['error'][_0x844e('0x17')]===0x1f4){logger[_0x844e('0x16')](_0x844e('0x12'),_0x1f9921,_0x14909f['error'][_0x844e('0x18')]);return _0x1b4cf6(_0x14909f[_0x844e('0x16')][_0x844e('0x18')]);}logger[_0x844e('0x16')](_0x844e('0x12'),_0x1f9921,_0x14909f[_0x844e('0x16')][_0x844e('0x18')]);return _0x39ef28(_0x14909f[_0x844e('0x16')]['message']);}else{logger[_0x844e('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x1f9921,_0x844e('0x19'));_0x39ef28(_0x14909f['result'][_0x844e('0x18')]);}})['catch'](function(_0x43f05d){logger[_0x844e('0x16')](_0x844e('0x12'),_0x1f9921,_0x43f05d);_0x1b4cf6(_0x43f05d);});});}exports[_0x844e('0x1a')]=function(_0x3ea7da){var _0x2b58c7=this;return new Promise(function(_0x181afd,_0x243aeb){return db['VoiceExtension'][_0x844e('0x1b')]({'raw':_0x3ea7da['options']?_0x3ea7da['options'][_0x844e('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ea7da[_0x844e('0x1d')]?_0x3ea7da[_0x844e('0x1d')][_0x844e('0x1e')]||null:null,'attributes':_0x3ea7da['options']?_0x3ea7da[_0x844e('0x1d')][_0x844e('0x1f')]||null:null,'limit':_0x3ea7da['options']?_0x3ea7da[_0x844e('0x1d')][_0x844e('0x20')]||null:null,'include':_0x3ea7da[_0x844e('0x1d')]?_0x3ea7da[_0x844e('0x1d')][_0x844e('0x21')]?_[_0x844e('0x22')](_0x3ea7da['options'][_0x844e('0x21')],function(_0xadf0d8){return{'model':db[_0xadf0d8[_0x844e('0x23')]],'as':_0xadf0d8['as'],'attributes':_0xadf0d8[_0x844e('0x1f')],'include':_0xadf0d8[_0x844e('0x21')]?_['map'](_0xadf0d8[_0x844e('0x21')],function(_0x5080c1){return{'model':db[_0x5080c1['model']],'as':_0x5080c1['as'],'attributes':_0x5080c1[_0x844e('0x1f')],'include':_0x5080c1[_0x844e('0x21')]?_[_0x844e('0x22')](_0x5080c1['include'],function(_0x489349){return{'model':db[_0x489349[_0x844e('0x23')]],'as':_0x489349['as'],'attributes':_0x489349[_0x844e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x228cc1){logger[_0x844e('0x11')](_0x844e('0x1a'),_0x3ea7da);logger[_0x844e('0x13')](_0x844e('0x1a'),_0x3ea7da,JSON[_0x844e('0x15')](_0x228cc1));_0x181afd(_0x228cc1);})[_0x844e('0x24')](function(_0x2a06a){logger[_0x844e('0x16')](_0x844e('0x1a'),_0x2a06a['message'],_0x3ea7da);_0x243aeb(_0x2b58c7[_0x844e('0x16')](0x1f4,_0x2a06a[_0x844e('0x18')]));});});};
\ No newline at end of file
+var _0x6f47=['VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','attributes','limit','map','include','model','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info'];(function(_0x24374d,_0x28c4d8){var _0x43f58f=function(_0x4619ae){while(--_0x4619ae){_0x24374d['push'](_0x24374d['shift']());}};_0x43f58f(++_0x28c4d8);}(_0x6f47,0xc7));var _0x76f4=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x6f47[_0x1b7368];return _0x25d54c;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x76f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76f4('0x4'))(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var jayson=require(_0x76f4('0x7'));var client=jayson['client'][_0x76f4('0x8')]({'port':0x232a});config[_0x76f4('0x9')]=_[_0x76f4('0xa')](config['redis'],{'host':_0x76f4('0xb'),'port':0x18eb});var socket=require(_0x76f4('0xc'))(new Redis(config[_0x76f4('0x9')]));require(_0x76f4('0xd'))[_0x76f4('0xe')](socket);function respondWithRpcPromise(_0x4c6b5c,_0x5367d6,_0x3347ef){return new BPromise(function(_0x18e41a,_0x5af83c){return client['request'](_0x4c6b5c,_0x3347ef)[_0x76f4('0xf')](function(_0x458c22){logger[_0x76f4('0x10')](_0x76f4('0x11'),_0x5367d6,_0x76f4('0x12'));logger[_0x76f4('0x13')](_0x76f4('0x14'),_0x5367d6,_0x76f4('0x12'),JSON[_0x76f4('0x15')](_0x458c22));if(_0x458c22['error']){if(_0x458c22[_0x76f4('0x16')][_0x76f4('0x17')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x5367d6,_0x458c22['error'][_0x76f4('0x18')]);return _0x5af83c(_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);}logger[_0x76f4('0x16')](_0x76f4('0x11'),_0x5367d6,_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);return _0x18e41a(_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);}else{logger[_0x76f4('0x10')](_0x76f4('0x11'),_0x5367d6,_0x76f4('0x12'));_0x18e41a(_0x458c22[_0x76f4('0x19')][_0x76f4('0x18')]);}})[_0x76f4('0x1a')](function(_0x397360){logger[_0x76f4('0x16')](_0x76f4('0x11'),_0x5367d6,_0x397360);_0x5af83c(_0x397360);});});}exports[_0x76f4('0x1b')]=function(_0x35b406){var _0x46f057=this;return new Promise(function(_0x285232,_0x5bf3d5){return db[_0x76f4('0x1c')]['findAll']({'raw':_0x35b406[_0x76f4('0x1d')]?_0x35b406[_0x76f4('0x1d')][_0x76f4('0x1e')]===undefined?!![]:![]:!![],'where':_0x35b406['options']?_0x35b406['options']['where']||null:null,'attributes':_0x35b406[_0x76f4('0x1d')]?_0x35b406[_0x76f4('0x1d')][_0x76f4('0x1f')]||null:null,'limit':_0x35b406[_0x76f4('0x1d')]?_0x35b406[_0x76f4('0x1d')][_0x76f4('0x20')]||null:null,'include':_0x35b406[_0x76f4('0x1d')]?_0x35b406['options']['include']?_[_0x76f4('0x21')](_0x35b406['options'][_0x76f4('0x22')],function(_0x5355bd){return{'model':db[_0x5355bd['model']],'as':_0x5355bd['as'],'attributes':_0x5355bd['attributes'],'include':_0x5355bd[_0x76f4('0x22')]?_[_0x76f4('0x21')](_0x5355bd[_0x76f4('0x22')],function(_0x1d1fe6){return{'model':db[_0x1d1fe6[_0x76f4('0x23')]],'as':_0x1d1fe6['as'],'attributes':_0x1d1fe6[_0x76f4('0x1f')],'include':_0x1d1fe6['include']?_[_0x76f4('0x21')](_0x1d1fe6['include'],function(_0x5346be){return{'model':db[_0x5346be['model']],'as':_0x5346be['as'],'attributes':_0x5346be[_0x76f4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x76f4('0xf')](function(_0x41dea4){logger[_0x76f4('0x10')]('GetVoiceExtension',_0x35b406);logger[_0x76f4('0x13')]('GetVoiceExtension',_0x35b406,JSON[_0x76f4('0x15')](_0x41dea4));_0x285232(_0x41dea4);})[_0x76f4('0x1a')](function(_0x43ac4a){logger[_0x76f4('0x16')](_0x76f4('0x1b'),_0x43ac4a['message'],_0x35b406);_0x5bf3d5(_0x46f057['error'](0x1f4,_0x43ac4a[_0x76f4('0x18')]));});});};
\ No newline at end of file
index 7991f2c..84989ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x223ca7,_0xcd4422){var _0x314ddf=function(_0x414478){while(--_0x414478){_0x223ca7['push'](_0x223ca7['shift']());}};_0x314ddf(++_0xcd4422);}(_0x7a54,0x106));var _0x47a5=function(_0x56331c,_0x190f9f){_0x56331c=_0x56331c-0x0;var _0x560d55=_0x7a54[_0x56331c];return _0x560d55;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
+var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1ca87d,_0x5a6ec9){_0x1ca87d=_0x1ca87d-0x0;var _0x535397=_0x1cb9[_0x1ca87d];return _0x535397;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}};
\ No newline at end of file
index 5fcee5b..fbe2f78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['show','/:id/messages','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x297f9c,_0x512838){var _0x19f907=function(_0x3493e9){while(--_0x3493e9){_0x297f9c['push'](_0x297f9c['shift']());}};_0x19f907(++_0x512838);}(_0xeda8,0x104));var _0x8eda=function(_0x205ea7,_0x2652e7){_0x205ea7=_0x205ea7-0x0;var _0x34ebba=_0xeda8[_0x205ea7];return _0x34ebba;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')](_0x8eda('0x11'),auth['isAuthenticated'](),controller[_0x8eda('0x12')]);router['delete'](_0x8eda('0x11'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x13')]);module[_0x8eda('0x14')]=router;
\ No newline at end of file
+var _0x6050=['/:id/messages','isAuthenticated','getMessages','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','show','get'];(function(_0x194d21,_0xa22a5d){var _0xa092e9=function(_0x5bd461){while(--_0x5bd461){_0x194d21['push'](_0x194d21['shift']());}};_0xa092e9(++_0xa22a5d);}(_0x6050,0x196));var _0x0605=function(_0x373b59,_0x3f2845){_0x373b59=_0x373b59-0x0;var _0x5c01f0=_0x6050[_0x373b59];return _0x5c01f0;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['post']('/',auth[_0x0605('0xd')](),controller[_0x0605('0xf')]);router[_0x0605('0x10')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x12')]);router[_0x0605('0x13')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x14')]);module[_0x0605('0x15')]=router;
\ No newline at end of file
index 1349b5d..19be689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0746=['contest_mailbox','setDataValue','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail'];(function(_0x639b4b,_0x37c1c1){var _0x88755e=function(_0x1889fd){while(--_0x1889fd){_0x639b4b['push'](_0x639b4b['shift']());}};_0x88755e(++_0x37c1c1);}(_0x0746,0x10d));var _0x6074=function(_0x368476,_0x214c64){_0x368476=_0x368476-0x0;var _0x701531=_0x0746[_0x368476];return _0x701531;};'use strict';var Sequelize=require(_0x6074('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x6074('0x1')]},'context':{'type':Sequelize[_0x6074('0x1')],'defaultValue':_0x6074('0x2'),'unique':_0x6074('0x3')},'mailbox':{'type':Sequelize[_0x6074('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x6074('0x1')]},'fullname':{'type':Sequelize[_0x6074('0x1')]},'email':{'type':Sequelize[_0x6074('0x1')],'validate':{'isEmail':!![]},'set':function(_0x26f151){this[_0x6074('0x4')]('email',typeof _0x26f151==='string'&&_0x26f151['trim']()?_0x26f151[_0x6074('0x5')]():null);}},'pager':{'type':Sequelize[_0x6074('0x1')]},'tz':{'type':Sequelize[_0x6074('0x1')],'defaultValue':_0x6074('0x6')},'attach':{'type':Sequelize['ENUM'](_0x6074('0x7'),'no'),'defaultValue':_0x6074('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x6074('0x1')]},'callback':{'type':Sequelize[_0x6074('0x1')]},'review':{'type':Sequelize[_0x6074('0x8')](_0x6074('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6074('0x8')](_0x6074('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6074('0x8')](_0x6074('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6074('0x8')](_0x6074('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6074('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6074('0x8')](_0x6074('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6074('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6074('0x8')](_0x6074('0x7'),'no'),'defaultValue':_0x6074('0x7'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x6074('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x6074('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6074('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x6074('0xa')},'emailsubject':{'type':Sequelize[_0x6074('0x1')]},'emailbody':{'type':Sequelize[_0x6074('0x1')]},'maxsecs':{'type':Sequelize[_0x6074('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6074('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6074('0xc')],'get':function(){return this[_0x6074('0xd')](_0x6074('0xe'))+_0x6074('0xf')+this[_0x6074('0xd')](_0x6074('0x10'));}}};
\ No newline at end of file
+var _0xa21b=['\x20-\x20','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x347740,_0x156512){var _0x4fc2ca=function(_0x1ddf5d){while(--_0x1ddf5d){_0x347740['push'](_0x347740['shift']());}};_0x4fc2ca(++_0x156512);}(_0xa21b,0x1b4));var _0xba21=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xa21b[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0xba21('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xba21('0x1')]},'context':{'type':Sequelize[_0xba21('0x1')],'defaultValue':'from-voicemail','unique':_0xba21('0x2')},'mailbox':{'type':Sequelize[_0xba21('0x1')],'defaultValue':'','allowNull':![],'unique':_0xba21('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xba21('0x1')]},'email':{'type':Sequelize[_0xba21('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3dd247){this[_0xba21('0x3')](_0xba21('0x4'),typeof _0x3dd247==='string'&&_0x3dd247['trim']()?_0x3dd247['trim']():null);}},'pager':{'type':Sequelize[_0xba21('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xba21('0x5')](_0xba21('0x6'),'no'),'defaultValue':_0xba21('0x6'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xba21('0x6'),'no'),'defaultValue':_0xba21('0x6'),'allowNull':![]},'dialout':{'type':Sequelize[_0xba21('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xba21('0x5')](_0xba21('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xba21('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xba21('0x5')](_0xba21('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xba21('0x7'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xba21('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xba21('0x5')](_0xba21('0x6'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xba21('0x5')](_0xba21('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xba21('0x5')](_0xba21('0x6'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xba21('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xba21('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xba21('0x8')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xba21('0x1')]},'maxsecs':{'type':Sequelize[_0xba21('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xba21('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xba21('0xa')],'get':function(){return this[_0xba21('0xb')]('fullname')+_0xba21('0xc')+this[_0xba21('0xb')](_0xba21('0xd'));}}};
\ No newline at end of file
index 5b33257..69c7a36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe511=['pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','create','catch','body','destroy','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','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','end','json','offset','limit','count','set','Content-Range','save','update','then','get','Voicemails','error','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','filters'];(function(_0x13f88c,_0x52e2b0){var _0x2f57b1=function(_0x188a92){while(--_0x188a92){_0x13f88c['push'](_0x13f88c['shift']());}};_0x2f57b1(++_0x52e2b0);}(_0xe511,0x16f));var _0x1e51=function(_0x153846,_0x1227ad){_0x153846=_0x153846-0x0;var _0x3ee557=_0xe511[_0x153846];return _0x3ee557;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];function respondWithStatusCode(_0x3c5330,_0x5544eb){_0x5544eb=_0x5544eb||0xcc;return function(_0x408a77){if(_0x408a77){return _0x3c5330[_0x1e51('0x18')](_0x5544eb);}return _0x3c5330[_0x1e51('0x19')](_0x5544eb)[_0x1e51('0x1a')]();};}function respondWithResult(_0x21bcbd,_0x32945d){_0x32945d=_0x32945d||0xc8;return function(_0x441c70){if(_0x441c70){return _0x21bcbd[_0x1e51('0x19')](_0x32945d)[_0x1e51('0x1b')](_0x441c70);}};}function respondWithFilteredResult(_0xd76fba,_0x5a5c07){return function(_0x3b01b7){if(_0x3b01b7){var _0x24db4f=typeof _0x5a5c07[_0x1e51('0x1c')]==='undefined'&&typeof _0x5a5c07[_0x1e51('0x1d')]==='undefined';var _0x53d222=_0x3b01b7[_0x1e51('0x1e')];var _0x27dcad=_0x24db4f?0x0:_0x5a5c07[_0x1e51('0x1c')];var _0x4785a5=_0x24db4f?_0x3b01b7[_0x1e51('0x1e')]:_0x5a5c07[_0x1e51('0x1c')]+_0x5a5c07['limit'];var _0x39449b;if(_0x4785a5>=_0x53d222){_0x4785a5=_0x53d222;_0x39449b=0xc8;}else{_0x39449b=0xce;}_0xd76fba['status'](_0x39449b);return _0xd76fba[_0x1e51('0x1f')](_0x1e51('0x20'),_0x27dcad+'-'+_0x4785a5+'/'+_0x53d222)[_0x1e51('0x1b')](_0x3b01b7);}return null;};}function patchUpdates(_0x183a95){return function(_0x506f40){try{jsonpatch['apply'](_0x506f40,_0x183a95,!![]);}catch(_0x4e6a49){return BPromise['reject'](_0x4e6a49);}return _0x506f40[_0x1e51('0x21')]();};}function saveUpdates(_0x4f1f56,_0x3f7340){return function(_0x28aacb){if(_0x28aacb){return _0x28aacb[_0x1e51('0x22')](_0x4f1f56)[_0x1e51('0x23')](function(_0x23c85a){return _0x23c85a;});}return null;};}function removeEntity(_0xf9298,_0x270adf){return function(_0x461d3d){if(_0x461d3d){return _0x461d3d['destroy']()['then'](function(){var _0x43f5c5=_0x461d3d[_0x1e51('0x24')]({'plain':!![]});var _0x2e42b1=_0x1e51('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x2e42b1,'resourceId':_0x43f5c5['id']}})['then'](function(){return _0x461d3d;});})[_0x1e51('0x23')](function(){_0xf9298[_0x1e51('0x19')](0xcc)[_0x1e51('0x1a')]();});}};}function handleEntityNotFound(_0x5412bc,_0x1e7a96){return function(_0x49c507){if(!_0x49c507){_0x5412bc['sendStatus'](0x194);}return _0x49c507;};}function handleError(_0x3349f0,_0x5c5bbd){_0x5c5bbd=_0x5c5bbd||0x1f4;return function(_0x170ec6){logger[_0x1e51('0x26')](_0x170ec6['stack']);if(_0x170ec6[_0x1e51('0x27')]){delete _0x170ec6[_0x1e51('0x27')];}_0x3349f0[_0x1e51('0x19')](_0x5c5bbd)[_0x1e51('0x28')](_0x170ec6);};}exports['index']=function(_0x4cf046,_0x4f67d3){var _0x20eb9b={},_0x288b50={},_0x1ba84a={'count':0x0,'rows':[]};var _0x36dabe=_[_0x1e51('0x29')](db[_0x1e51('0x2a')][_0x1e51('0x2b')],function(_0x34701c){return{'name':_0x34701c[_0x1e51('0x2c')],'type':_0x34701c[_0x1e51('0x2d')][_0x1e51('0x2e')]};});_0x288b50['model']=_[_0x1e51('0x29')](_0x36dabe,_0x1e51('0x27'));_0x288b50[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x4cf046[_0x1e51('0x2f')]);_0x288b50['filters']=_[_0x1e51('0x31')](_0x288b50['model'],_0x288b50[_0x1e51('0x2f')]);_0x20eb9b[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0x288b50['model'],qs[_0x1e51('0x33')](_0x4cf046['query'][_0x1e51('0x33')]));_0x20eb9b['attributes']=_0x20eb9b['attributes'][_0x1e51('0x34')]?_0x20eb9b[_0x1e51('0x32')]:_0x288b50[_0x1e51('0x35')];if(!_0x4cf046['query'][_0x1e51('0x36')]('nolimit')){_0x20eb9b[_0x1e51('0x1d')]=qs[_0x1e51('0x1d')](_0x4cf046['query'][_0x1e51('0x1d')]);_0x20eb9b[_0x1e51('0x1c')]=qs[_0x1e51('0x1c')](_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x1c')]);}_0x20eb9b[_0x1e51('0x37')]=qs['sort'](_0x4cf046['query'][_0x1e51('0x38')]);_0x20eb9b['where']=qs[_0x1e51('0x39')](_[_0x1e51('0x3a')](_0x4cf046[_0x1e51('0x2f')],_0x288b50[_0x1e51('0x39')]),_0x36dabe);if(_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x3b')]){_0x20eb9b[_0x1e51('0x3c')]=_[_0x1e51('0x3d')](_0x20eb9b[_0x1e51('0x3c')],{'$or':_[_0x1e51('0x29')](_0x36dabe,function(_0x45d5fe){if(_0x45d5fe['type']!==_0x1e51('0x3e')){var _0x5818be={};_0x5818be[_0x45d5fe[_0x1e51('0x27')]]={'$like':'%'+_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x5818be;}})});}_0x20eb9b=_[_0x1e51('0x3d')]({},_0x20eb9b,_0x4cf046[_0x1e51('0x3f')]);var _0x2f8fd9={'where':_0x20eb9b[_0x1e51('0x3c')]};return db[_0x1e51('0x2a')][_0x1e51('0x1e')](_0x2f8fd9)[_0x1e51('0x23')](function(_0xc40fce){_0x1ba84a['count']=_0xc40fce;if(_0x4cf046['query'][_0x1e51('0x40')]){_0x20eb9b[_0x1e51('0x41')]=[{'all':!![]}];}return db[_0x1e51('0x2a')][_0x1e51('0x42')](_0x20eb9b);})[_0x1e51('0x23')](function(_0x1a9e0d){_0x1ba84a[_0x1e51('0x43')]=_0x1a9e0d;return _0x1ba84a;})[_0x1e51('0x23')](respondWithFilteredResult(_0x4f67d3,_0x20eb9b))['catch'](handleError(_0x4f67d3,null));};exports[_0x1e51('0x44')]=function(_0x30eba9,_0x1750b3){var _0x41ca21={'raw':!![],'where':{'id':_0x30eba9[_0x1e51('0x45')]['id']}},_0xfd96a0={};_0xfd96a0[_0x1e51('0x35')]=_['keys'](db[_0x1e51('0x2a')][_0x1e51('0x2b')]);_0xfd96a0['query']=_[_0x1e51('0x30')](_0x30eba9[_0x1e51('0x2f')]);_0xfd96a0[_0x1e51('0x39')]=_['intersection'](_0xfd96a0[_0x1e51('0x35')],_0xfd96a0[_0x1e51('0x2f')]);_0x41ca21[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0xfd96a0[_0x1e51('0x35')],qs[_0x1e51('0x33')](_0x30eba9[_0x1e51('0x2f')][_0x1e51('0x33')]));_0x41ca21[_0x1e51('0x32')]=_0x41ca21['attributes'][_0x1e51('0x34')]?_0x41ca21[_0x1e51('0x32')]:_0xfd96a0['model'];if(_0x30eba9[_0x1e51('0x2f')][_0x1e51('0x40')]){_0x41ca21[_0x1e51('0x41')]=[{'all':!![]}];}_0x41ca21=_['merge']({},_0x41ca21,_0x30eba9[_0x1e51('0x3f')]);return db[_0x1e51('0x2a')][_0x1e51('0x46')](_0x41ca21)['then'](handleEntityNotFound(_0x1750b3,null))[_0x1e51('0x23')](respondWithResult(_0x1750b3,null))['catch'](handleError(_0x1750b3,null));};exports['create']=function(_0x54688b,_0x169e6c){return db[_0x1e51('0x2a')]['create'](_0x54688b['body'],{})[_0x1e51('0x23')](function(_0x7ffc42){var _0x2a43dd=_0x54688b[_0x1e51('0x47')][_0x1e51('0x24')]({'plain':!![]});if(!_0x2a43dd)throw new Error(_0x1e51('0x48'));if(_0x2a43dd['role']===_0x1e51('0x47')){var _0x48a2d0=_0x7ffc42[_0x1e51('0x24')]({'plain':!![]});var _0x43589a='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x43589a,'userProfileId':_0x2a43dd[_0x1e51('0x49')]},'raw':!![]})[_0x1e51('0x23')](function(_0x31a37a){if(_0x31a37a&&_0x31a37a['autoAssociation']===0x0){return db[_0x1e51('0x4a')][_0x1e51('0x4b')]({'name':_0x48a2d0[_0x1e51('0x27')],'resourceId':_0x48a2d0['id'],'type':_0x31a37a[_0x1e51('0x27')],'sectionId':_0x31a37a['id']},{})[_0x1e51('0x23')](function(){return _0x7ffc42;});}else{return _0x7ffc42;}})[_0x1e51('0x4c')](function(_0x32fe1f){logger[_0x1e51('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32fe1f);throw _0x32fe1f;});}return _0x7ffc42;})[_0x1e51('0x23')](respondWithResult(_0x169e6c,0xc9))[_0x1e51('0x4c')](handleError(_0x169e6c,null));};exports[_0x1e51('0x22')]=function(_0x213edb,_0x177b63){if(_0x213edb[_0x1e51('0x4d')]['id']){delete _0x213edb['body']['id'];}return db[_0x1e51('0x2a')]['find']({'where':{'id':_0x213edb['params']['id']}})['then'](handleEntityNotFound(_0x177b63,null))[_0x1e51('0x23')](saveUpdates(_0x213edb[_0x1e51('0x4d')],null))[_0x1e51('0x23')](respondWithResult(_0x177b63,null))['catch'](handleError(_0x177b63,null));};exports[_0x1e51('0x4e')]=function(_0x133576,_0x36c981){return db['VoiceMail'][_0x1e51('0x46')]({'where':{'id':_0x133576[_0x1e51('0x45')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x36c981,null))['then'](removeEntity(_0x36c981,null))[_0x1e51('0x4c')](handleError(_0x36c981,null));};exports[_0x1e51('0x4f')]=function(_0x175aa0,_0x30ee67,_0x666ae9){return db[_0x1e51('0x2a')][_0x1e51('0x50')]({'where':{'id':_0x175aa0[_0x1e51('0x45')]['id']}})['then'](handleEntityNotFound(_0x30ee67,null))[_0x1e51('0x23')](function(_0x2e78e7){var _0x48848f;var _0x5a9d2a={},_0x577b19={};_0x577b19[_0x1e51('0x35')]=_[_0x1e51('0x30')](db[_0x1e51('0x51')][_0x1e51('0x2b')]);_0x577b19[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x175aa0[_0x1e51('0x2f')]);_0x577b19[_0x1e51('0x39')]=_[_0x1e51('0x31')](_0x577b19['model'],_0x577b19['query']);_0x5a9d2a['attributes']=_[_0x1e51('0x31')](_0x577b19[_0x1e51('0x35')],qs['fields'](_0x175aa0['query'][_0x1e51('0x33')]));_0x5a9d2a[_0x1e51('0x32')]=_0x5a9d2a['attributes'][_0x1e51('0x34')]?_0x5a9d2a[_0x1e51('0x32')]:_0x577b19[_0x1e51('0x35')];if(!_0x175aa0[_0x1e51('0x2f')][_0x1e51('0x36')](_0x1e51('0x52'))){_0x5a9d2a[_0x1e51('0x1d')]=qs[_0x1e51('0x1d')](_0x175aa0[_0x1e51('0x2f')][_0x1e51('0x1d')]);_0x5a9d2a['offset']=qs[_0x1e51('0x1c')](_0x175aa0[_0x1e51('0x2f')][_0x1e51('0x1c')]);}_0x5a9d2a[_0x1e51('0x37')]=qs[_0x1e51('0x38')](_0x175aa0[_0x1e51('0x2f')]['sort']);_0x5a9d2a['where']=qs[_0x1e51('0x39')](_[_0x1e51('0x3a')](_0x175aa0[_0x1e51('0x2f')],_0x577b19[_0x1e51('0x39')]));if(_0x175aa0['query']['filter']){_0x5a9d2a['where']=_[_0x1e51('0x3d')](_0x5a9d2a[_0x1e51('0x3c')],{'$or':_[_0x1e51('0x29')](_0x5a9d2a[_0x1e51('0x32')],function(_0x184665){var _0x5c68b1={};_0x5c68b1[_0x184665]={'$like':'%'+_0x175aa0[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x5c68b1;})});}_0x5a9d2a[_0x1e51('0x3c')]=_['merge'](_0x5a9d2a[_0x1e51('0x3c')],{'mailboxuser':_0x2e78e7[_0x1e51('0x53')]});_0x5a9d2a=_[_0x1e51('0x3d')]({},_0x5a9d2a,_0x175aa0['options']);return db[_0x1e51('0x51')][_0x1e51('0x54')](_0x5a9d2a)['then'](respondWithFilteredResult(_0x30ee67,_0x5a9d2a));})['catch'](handleError(_0x30ee67,null));};
\ No newline at end of file
+var _0xd87e=['autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','sort','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','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','undefined','limit','count','set','Content-Range','save','then','destroy','get','Voicemails','UserProfileResource','error','name','map','VoiceMail','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0x37d6e6,_0x19e1d9){var _0x5286d4=function(_0x2c7f4b){while(--_0x2c7f4b){_0x37d6e6['push'](_0x37d6e6['shift']());}};_0x5286d4(++_0x19e1d9);}(_0xd87e,0x1bf));var _0xed87=function(_0x50748b,_0x599d6d){_0x50748b=_0x50748b-0x0;var _0x5688d7=_0xd87e[_0x50748b];return _0x5688d7;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){var _0x5d15b3=_0x27799a[_0xed87('0x25')]({'plain':!![]});var _0x3c22b7=_0xed87('0x26');return db[_0xed87('0x27')][_0xed87('0x24')]({'where':{'type':_0x3c22b7,'resourceId':_0x5d15b3['id']}})[_0xed87('0x23')](function(){return _0x27799a;});})[_0xed87('0x23')](function(){_0x3d1641[_0xed87('0x19')](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x38f5c,_0x469181){return function(_0x341a35){if(!_0x341a35){_0x38f5c[_0xed87('0x18')](0x194);}return _0x341a35;};}function handleError(_0x2b86e2,_0x4dfaf2){_0x4dfaf2=_0x4dfaf2||0x1f4;return function(_0xb32b1c){logger[_0xed87('0x28')](_0xb32b1c['stack']);if(_0xb32b1c[_0xed87('0x29')]){delete _0xb32b1c[_0xed87('0x29')];}_0x2b86e2[_0xed87('0x19')](_0x4dfaf2)['send'](_0xb32b1c);};}exports['index']=function(_0xd0efba,_0x428b75){var _0x21ab8a={},_0x549a19={},_0x37d45a={'count':0x0,'rows':[]};var _0x3b87e3=_[_0xed87('0x2a')](db[_0xed87('0x2b')][_0xed87('0x2c')],function(_0x46b9f9){return{'name':_0x46b9f9[_0xed87('0x2d')],'type':_0x46b9f9[_0xed87('0x2e')][_0xed87('0x2f')]};});_0x549a19['model']=_[_0xed87('0x2a')](_0x3b87e3,_0xed87('0x29'));_0x549a19['query']=_[_0xed87('0x30')](_0xd0efba['query']);_0x549a19[_0xed87('0x31')]=_[_0xed87('0x32')](_0x549a19[_0xed87('0x33')],_0x549a19[_0xed87('0x34')]);_0x21ab8a[_0xed87('0x35')]=_[_0xed87('0x32')](_0x549a19[_0xed87('0x33')],qs[_0xed87('0x36')](_0xd0efba[_0xed87('0x34')][_0xed87('0x36')]));_0x21ab8a[_0xed87('0x35')]=_0x21ab8a['attributes'][_0xed87('0x37')]?_0x21ab8a[_0xed87('0x35')]:_0x549a19['model'];if(!_0xd0efba[_0xed87('0x34')]['hasOwnProperty'](_0xed87('0x38'))){_0x21ab8a[_0xed87('0x1e')]=qs['limit'](_0xd0efba[_0xed87('0x34')][_0xed87('0x1e')]);_0x21ab8a[_0xed87('0x1c')]=qs[_0xed87('0x1c')](_0xd0efba[_0xed87('0x34')]['offset']);}_0x21ab8a[_0xed87('0x39')]=qs['sort'](_0xd0efba[_0xed87('0x34')]['sort']);_0x21ab8a[_0xed87('0x3a')]=qs[_0xed87('0x31')](_[_0xed87('0x3b')](_0xd0efba[_0xed87('0x34')],_0x549a19[_0xed87('0x31')]),_0x3b87e3);if(_0xd0efba[_0xed87('0x34')][_0xed87('0x3c')]){_0x21ab8a[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0x21ab8a['where'],{'$or':_['map'](_0x3b87e3,function(_0xa6714a){if(_0xa6714a[_0xed87('0x2e')]!==_0xed87('0x3e')){var _0x325112={};_0x325112[_0xa6714a[_0xed87('0x29')]]={'$like':'%'+_0xd0efba[_0xed87('0x34')]['filter']+'%'};return _0x325112;}})});}_0x21ab8a=_[_0xed87('0x3d')]({},_0x21ab8a,_0xd0efba[_0xed87('0x3f')]);var _0x1c49b0={'where':_0x21ab8a['where']};return db[_0xed87('0x2b')][_0xed87('0x1f')](_0x1c49b0)[_0xed87('0x23')](function(_0x1b0092){_0x37d45a[_0xed87('0x1f')]=_0x1b0092;if(_0xd0efba[_0xed87('0x34')][_0xed87('0x40')]){_0x21ab8a[_0xed87('0x41')]=[{'all':!![]}];}return db[_0xed87('0x2b')][_0xed87('0x42')](_0x21ab8a);})['then'](function(_0x7e6cbb){_0x37d45a[_0xed87('0x43')]=_0x7e6cbb;return _0x37d45a;})[_0xed87('0x23')](respondWithFilteredResult(_0x428b75,_0x21ab8a))['catch'](handleError(_0x428b75,null));};exports['show']=function(_0xa31eec,_0x7aa7fa){var _0x40cd98={'raw':!![],'where':{'id':_0xa31eec['params']['id']}},_0x41a658={};_0x41a658[_0xed87('0x33')]=_[_0xed87('0x30')](db['VoiceMail'][_0xed87('0x2c')]);_0x41a658[_0xed87('0x34')]=_[_0xed87('0x30')](_0xa31eec[_0xed87('0x34')]);_0x41a658[_0xed87('0x31')]=_[_0xed87('0x32')](_0x41a658[_0xed87('0x33')],_0x41a658[_0xed87('0x34')]);_0x40cd98[_0xed87('0x35')]=_[_0xed87('0x32')](_0x41a658[_0xed87('0x33')],qs['fields'](_0xa31eec[_0xed87('0x34')][_0xed87('0x36')]));_0x40cd98[_0xed87('0x35')]=_0x40cd98[_0xed87('0x35')][_0xed87('0x37')]?_0x40cd98[_0xed87('0x35')]:_0x41a658[_0xed87('0x33')];if(_0xa31eec[_0xed87('0x34')][_0xed87('0x40')]){_0x40cd98[_0xed87('0x41')]=[{'all':!![]}];}_0x40cd98=_[_0xed87('0x3d')]({},_0x40cd98,_0xa31eec[_0xed87('0x3f')]);return db[_0xed87('0x2b')][_0xed87('0x44')](_0x40cd98)[_0xed87('0x23')](handleEntityNotFound(_0x7aa7fa,null))[_0xed87('0x23')](respondWithResult(_0x7aa7fa,null))[_0xed87('0x45')](handleError(_0x7aa7fa,null));};exports['create']=function(_0x2c7bef,_0x1a68a7){return db[_0xed87('0x2b')]['create'](_0x2c7bef[_0xed87('0x46')],{})[_0xed87('0x23')](function(_0x54bc95){var _0x33e736=_0x2c7bef[_0xed87('0x47')][_0xed87('0x25')]({'plain':!![]});if(!_0x33e736)throw new Error(_0xed87('0x48'));if(_0x33e736['role']===_0xed87('0x47')){var _0x436e15=_0x54bc95[_0xed87('0x25')]({'plain':!![]});var _0x272a07=_0xed87('0x26');return db[_0xed87('0x49')][_0xed87('0x44')]({'where':{'name':_0x272a07,'userProfileId':_0x33e736[_0xed87('0x4a')]},'raw':!![]})[_0xed87('0x23')](function(_0x251d4e){if(_0x251d4e&&_0x251d4e[_0xed87('0x4b')]===0x0){return db[_0xed87('0x27')][_0xed87('0x4c')]({'name':_0x436e15['name'],'resourceId':_0x436e15['id'],'type':_0x251d4e[_0xed87('0x29')],'sectionId':_0x251d4e['id']},{})['then'](function(){return _0x54bc95;});}else{return _0x54bc95;}})[_0xed87('0x45')](function(_0x329973){logger[_0xed87('0x28')](_0xed87('0x4d'),_0x329973);throw _0x329973;});}return _0x54bc95;})[_0xed87('0x23')](respondWithResult(_0x1a68a7,0xc9))[_0xed87('0x45')](handleError(_0x1a68a7,null));};exports[_0xed87('0x4e')]=function(_0xccdbb6,_0x3b413d){if(_0xccdbb6[_0xed87('0x46')]['id']){delete _0xccdbb6['body']['id'];}return db[_0xed87('0x2b')][_0xed87('0x44')]({'where':{'id':_0xccdbb6[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3b413d,null))[_0xed87('0x23')](saveUpdates(_0xccdbb6[_0xed87('0x46')],null))[_0xed87('0x23')](respondWithResult(_0x3b413d,null))[_0xed87('0x45')](handleError(_0x3b413d,null));};exports[_0xed87('0x24')]=function(_0x367ff4,_0x32db1f){return db['VoiceMail']['find']({'where':{'id':_0x367ff4[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x32db1f,null))[_0xed87('0x23')](removeEntity(_0x32db1f,null))[_0xed87('0x45')](handleError(_0x32db1f,null));};exports[_0xed87('0x50')]=function(_0x4dd840,_0x7e6738,_0x1ddd72){return db[_0xed87('0x2b')][_0xed87('0x51')]({'where':{'id':_0x4dd840[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x7e6738,null))[_0xed87('0x23')](function(_0x1391a2){var _0x2ffffa;var _0xf4ec55={},_0x3feebb={};_0x3feebb[_0xed87('0x33')]=_[_0xed87('0x30')](db[_0xed87('0x52')]['rawAttributes']);_0x3feebb[_0xed87('0x34')]=_[_0xed87('0x30')](_0x4dd840[_0xed87('0x34')]);_0x3feebb[_0xed87('0x31')]=_[_0xed87('0x32')](_0x3feebb[_0xed87('0x33')],_0x3feebb[_0xed87('0x34')]);_0xf4ec55[_0xed87('0x35')]=_['intersection'](_0x3feebb[_0xed87('0x33')],qs[_0xed87('0x36')](_0x4dd840[_0xed87('0x34')][_0xed87('0x36')]));_0xf4ec55[_0xed87('0x35')]=_0xf4ec55[_0xed87('0x35')]['length']?_0xf4ec55['attributes']:_0x3feebb[_0xed87('0x33')];if(!_0x4dd840[_0xed87('0x34')][_0xed87('0x53')](_0xed87('0x38'))){_0xf4ec55[_0xed87('0x1e')]=qs[_0xed87('0x1e')](_0x4dd840[_0xed87('0x34')][_0xed87('0x1e')]);_0xf4ec55['offset']=qs[_0xed87('0x1c')](_0x4dd840['query'][_0xed87('0x1c')]);}_0xf4ec55[_0xed87('0x39')]=qs['sort'](_0x4dd840[_0xed87('0x34')][_0xed87('0x54')]);_0xf4ec55['where']=qs[_0xed87('0x31')](_[_0xed87('0x3b')](_0x4dd840[_0xed87('0x34')],_0x3feebb[_0xed87('0x31')]));if(_0x4dd840[_0xed87('0x34')]['filter']){_0xf4ec55[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0xf4ec55[_0xed87('0x3a')],{'$or':_[_0xed87('0x2a')](_0xf4ec55['attributes'],function(_0x58279a){var _0x3a6ab6={};_0x3a6ab6[_0x58279a]={'$like':'%'+_0x4dd840[_0xed87('0x34')]['filter']+'%'};return _0x3a6ab6;})});}_0xf4ec55[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0xf4ec55[_0xed87('0x3a')],{'mailboxuser':_0x1391a2[_0xed87('0x55')]});_0xf4ec55=_[_0xed87('0x3d')]({},_0xf4ec55,_0x4dd840[_0xed87('0x3f')]);return db[_0xed87('0x52')][_0xed87('0x56')](_0xf4ec55)[_0xed87('0x23')](respondWithFilteredResult(_0x7e6738,_0xf4ec55));})[_0xed87('0x45')](handleError(_0x7e6738,null));};
\ No newline at end of file
index 180ecda..acb58be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf78d=['api','bluebird','request-promise','../../config/environment','./voiceMail.attributes','voice_voicemail','mailbox','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf78d,0x1e7));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdf78('0x0'));var util=require(_0xdf78('0x1'));var logger=require(_0xdf78('0x2'))(_0xdf78('0x3'));var moment=require('moment');var BPromise=require(_0xdf78('0x4'));var rp=require(_0xdf78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdf78('0x6'));var attributes=require(_0xdf78('0x7'));module['exports']=function(_0x1bd9aa,_0x21d9cf){return _0x1bd9aa['define']('VoiceMail',attributes,{'tableName':_0xdf78('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xdf78('0x9'),'context']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6eb0=['voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail'];(function(_0x308c65,_0x4268a2){var _0x56379b=function(_0x14efea){while(--_0x14efea){_0x308c65['push'](_0x308c65['shift']());}};_0x56379b(++_0x4268a2);}(_0x6eb0,0x164));var _0x06eb=function(_0x3cdedd,_0x56bb3d){_0x3cdedd=_0x3cdedd-0x0;var _0xd88570=_0x6eb0[_0x3cdedd];return _0xd88570;};'use strict';var _=require(_0x06eb('0x0'));var util=require(_0x06eb('0x1'));var logger=require(_0x06eb('0x2'))(_0x06eb('0x3'));var moment=require(_0x06eb('0x4'));var BPromise=require(_0x06eb('0x5'));var rp=require(_0x06eb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06eb('0x7'));var config=require(_0x06eb('0x8'));var attributes=require(_0x06eb('0x9'));module['exports']=function(_0x129fde,_0x10f185){return _0x129fde[_0x06eb('0xa')](_0x06eb('0xb'),attributes,{'tableName':_0x06eb('0xc'),'paranoid':![],'indexes':[{'name':_0x06eb('0xd'),'fields':[_0x06eb('0xe'),_0x06eb('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index b1f1f24..5a9b30a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9f2=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x24f734,_0x55ed37){var _0x467c79=function(_0x1f6653){while(--_0x1f6653){_0x24f734['push'](_0x24f734['shift']());}};_0x467c79(++_0x55ed37);}(_0xe9f2,0x14a));var _0x2e9f=function(_0x7ad33,_0x1c3e65){_0x7ad33=_0x7ad33-0x0;var _0x3ed72b=_0xe9f2[_0x7ad33];return _0x3ed72b;};'use strict';var _=require(_0x2e9f('0x0'));var util=require(_0x2e9f('0x1'));var moment=require('moment');var BPromise=require(_0x2e9f('0x2'));var rs=require(_0x2e9f('0x3'));var fs=require('fs');var Redis=require(_0x2e9f('0x4'));var db=require(_0x2e9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e9f('0x6'))(_0x2e9f('0x7'));var config=require(_0x2e9f('0x8'));var jayson=require(_0x2e9f('0x9'));var client=jayson[_0x2e9f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x202422,_0x396d8d,_0x20f890){return new BPromise(function(_0x5285fb,_0xa3a0a0){return client[_0x2e9f('0xb')](_0x202422,_0x20f890)[_0x2e9f('0xc')](function(_0x4a8dcd){logger[_0x2e9f('0xd')](_0x2e9f('0xe'),_0x396d8d,'request\x20sent');logger[_0x2e9f('0xf')](_0x2e9f('0x10'),_0x396d8d,_0x2e9f('0x11'),JSON['stringify'](_0x4a8dcd));if(_0x4a8dcd[_0x2e9f('0x12')]){if(_0x4a8dcd[_0x2e9f('0x12')]['code']===0x1f4){logger[_0x2e9f('0x12')](_0x2e9f('0xe'),_0x396d8d,_0x4a8dcd['error'][_0x2e9f('0x13')]);return _0xa3a0a0(_0x4a8dcd[_0x2e9f('0x12')]['message']);}logger[_0x2e9f('0x12')](_0x2e9f('0xe'),_0x396d8d,_0x4a8dcd['error'][_0x2e9f('0x13')]);return _0x5285fb(_0x4a8dcd[_0x2e9f('0x12')][_0x2e9f('0x13')]);}else{logger[_0x2e9f('0xd')](_0x2e9f('0xe'),_0x396d8d,_0x2e9f('0x11'));_0x5285fb(_0x4a8dcd[_0x2e9f('0x14')]['message']);}})[_0x2e9f('0x15')](function(_0x3694e6){logger[_0x2e9f('0x12')](_0x2e9f('0xe'),_0x396d8d,_0x3694e6);_0xa3a0a0(_0x3694e6);});});}
\ No newline at end of file
+var _0x4abc=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4abc,0xd6));var _0xc4ab=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4abc[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xc4ab('0x0'));var util=require(_0xc4ab('0x1'));var moment=require(_0xc4ab('0x2'));var BPromise=require(_0xc4ab('0x3'));var rs=require(_0xc4ab('0x4'));var fs=require('fs');var Redis=require(_0xc4ab('0x5'));var db=require(_0xc4ab('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc4ab('0x7'));var config=require(_0xc4ab('0x8'));var jayson=require(_0xc4ab('0x9'));var client=jayson[_0xc4ab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27f437,_0x5a9560,_0x12b322){return new BPromise(function(_0x1148f1,_0x419aee){return client[_0xc4ab('0xb')](_0x27f437,_0x12b322)[_0xc4ab('0xc')](function(_0x462327){logger[_0xc4ab('0xd')](_0xc4ab('0xe'),_0x5a9560,_0xc4ab('0xf'));logger['debug'](_0xc4ab('0x10'),_0x5a9560,'request\x20sent',JSON[_0xc4ab('0x11')](_0x462327));if(_0x462327[_0xc4ab('0x12')]){if(_0x462327['error'][_0xc4ab('0x13')]===0x1f4){logger[_0xc4ab('0x12')]('VoiceMail,\x20%s,\x20%s',_0x5a9560,_0x462327['error'][_0xc4ab('0x14')]);return _0x419aee(_0x462327[_0xc4ab('0x12')][_0xc4ab('0x14')]);}logger['error'](_0xc4ab('0xe'),_0x5a9560,_0x462327[_0xc4ab('0x12')]['message']);return _0x1148f1(_0x462327['error'][_0xc4ab('0x14')]);}else{logger['info'](_0xc4ab('0xe'),_0x5a9560,_0xc4ab('0xf'));_0x1148f1(_0x462327[_0xc4ab('0x15')]['message']);}})['catch'](function(_0x535dc0){logger[_0xc4ab('0x12')](_0xc4ab('0xe'),_0x5a9560,_0x535dc0);_0x419aee(_0x535dc0);});});}
\ No newline at end of file
index 5d42148..01264cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe784=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id/download','download','post','create','put','/:id','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe784,0x1b9));var _0x4e78=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xe784[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x4e78('0x0'));var util=require(_0x4e78('0x1'));var path=require(_0x4e78('0x2'));var timeout=require(_0x4e78('0x3'));var express=require(_0x4e78('0x4'));var router=express[_0x4e78('0x5')]();var fs_extra=require(_0x4e78('0x6'));var auth=require(_0x4e78('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4e78('0x8'));var controller=require(_0x4e78('0x9'));router[_0x4e78('0xa')]('/',auth[_0x4e78('0xb')](),controller[_0x4e78('0xc')]);router[_0x4e78('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x4e78('0xd'),auth[_0x4e78('0xb')](),controller[_0x4e78('0xe')]);router[_0x4e78('0xf')]('/',auth[_0x4e78('0xb')](),controller[_0x4e78('0x10')]);router[_0x4e78('0x11')](_0x4e78('0x12'),auth['isAuthenticated'](),controller[_0x4e78('0x13')]);router[_0x4e78('0x14')](_0x4e78('0x12'),auth[_0x4e78('0xb')](),controller[_0x4e78('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xfb50=['create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','post'];(function(_0x208645,_0x37fcd7){var _0x2614c2=function(_0x19db3e){while(--_0x19db3e){_0x208645['push'](_0x208645['shift']());}};_0x2614c2(++_0x37fcd7);}(_0xfb50,0x140));var _0x0fb5=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xfb50[_0x2dd390];return _0x3afe47;};'use strict';var multer=require(_0x0fb5('0x0'));var util=require('util');var path=require(_0x0fb5('0x1'));var timeout=require(_0x0fb5('0x2'));var express=require(_0x0fb5('0x3'));var router=express[_0x0fb5('0x4')]();var fs_extra=require(_0x0fb5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fb5('0x6'));var config=require(_0x0fb5('0x7'));var controller=require(_0x0fb5('0x8'));router[_0x0fb5('0x9')]('/',auth[_0x0fb5('0xa')](),controller[_0x0fb5('0xb')]);router[_0x0fb5('0x9')](_0x0fb5('0xc'),auth[_0x0fb5('0xa')](),controller[_0x0fb5('0xd')]);router['get']('/:id/download',auth[_0x0fb5('0xa')](),controller[_0x0fb5('0xe')]);router[_0x0fb5('0xf')]('/',auth['isAuthenticated'](),controller[_0x0fb5('0x10')]);router[_0x0fb5('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0fb5('0x12')]('/:id',auth[_0x0fb5('0xa')](),controller[_0x0fb5('0x13')]);module[_0x0fb5('0x14')]=router;
\ No newline at end of file
index c6f2b1d..163e00d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5859=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0x5859,0x65));var _0x9585=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5859[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x9585('0x0'));module[_0x9585('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a47c9){return this[_0x9585('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x9585('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x9585('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x9585('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x9585('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x9585('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9585('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x9585('0x5')](_0x9585('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x9585('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x9585('0x7'),'defaultValue':Sequelize[_0x9585('0x8')](_0x9585('0x9'))}};
\ No newline at end of file
+var _0x0331=['INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x1be48d,_0x1c61ff){var _0x16c530=function(_0x57e645){while(--_0x57e645){_0x1be48d['push'](_0x1be48d['shift']());}};_0x16c530(++_0x1c61ff);}(_0x0331,0x85));var _0x1033=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x0331[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require(_0x1033('0x0'));module[_0x1033('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xbec70c){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x1033('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x1033('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x1033('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x1033('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x1033('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x1033('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1033('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x1033('0x4')](_0x1033('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x1033('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x1033('0x3')],'defaultValue':''},'stamp':{'type':_0x1033('0x6'),'defaultValue':Sequelize[_0x1033('0x7')](_0x1033('0x8'))}};
\ No newline at end of file
index 4f7f54f..a765f47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3728=['type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceMailMessage','include','rows','catch','show','params','fields','includeAll','options','create','body','find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes'];(function(_0x17c350,_0x2c4385){var _0x569d0f=function(_0x479efb){while(--_0x479efb){_0x17c350['push'](_0x17c350['shift']());}};_0x569d0f(++_0x2c4385);}(_0x3728,0x81));var _0x8372=function(_0x2e60f5,_0x4a513d){_0x2e60f5=_0x2e60f5-0x0;var _0x26a07c=_0x3728[_0x2e60f5];return _0x26a07c;};'use strict';var emlformat=require(_0x8372('0x0'));var rimraf=require(_0x8372('0x1'));var zipdir=require(_0x8372('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8372('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8372('0x4'));var util=require(_0x8372('0x5'));var path=require(_0x8372('0x6'));var sox=require(_0x8372('0x7'));var csv=require(_0x8372('0x8'));var ejs=require(_0x8372('0x9'));var fs=require('fs');var fs_extra=require(_0x8372('0xa'));var _=require('lodash');var squel=require(_0x8372('0xb'));var crypto=require(_0x8372('0xc'));var jsforce=require(_0x8372('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8372('0x8'));var querystring=require(_0x8372('0xe'));var Papa=require('papaparse');var Redis=require(_0x8372('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8372('0x10'));var as=require(_0x8372('0x11'));var hardwareService=require(_0x8372('0x12'));var logger=require(_0x8372('0x13'))(_0x8372('0x14'));var utils=require(_0x8372('0x15'));var config=require(_0x8372('0x16'));var licenseUtil=require(_0x8372('0x17'));var db=require(_0x8372('0x18'))['db'];function respondWithStatusCode(_0x1b6afc,_0x37f5e4){_0x37f5e4=_0x37f5e4||0xcc;return function(_0x50f16c){if(_0x50f16c){return _0x1b6afc[_0x8372('0x19')](_0x37f5e4);}return _0x1b6afc[_0x8372('0x1a')](_0x37f5e4)['end']();};}function respondWithResult(_0x975860,_0x5a75c3){_0x5a75c3=_0x5a75c3||0xc8;return function(_0x45ce0c){if(_0x45ce0c){return _0x975860['status'](_0x5a75c3)[_0x8372('0x1b')](_0x45ce0c);}};}function respondWithFilteredResult(_0x2d5754,_0x5a7688){return function(_0x56f57e){if(_0x56f57e){var _0x4285aa=typeof _0x5a7688[_0x8372('0x1c')]===_0x8372('0x1d')&&typeof _0x5a7688[_0x8372('0x1e')]===_0x8372('0x1d');var _0x587a79=_0x56f57e[_0x8372('0x1f')];var _0x3f85f0=_0x4285aa?0x0:_0x5a7688[_0x8372('0x1c')];var _0x1c705a=_0x4285aa?_0x56f57e[_0x8372('0x1f')]:_0x5a7688[_0x8372('0x1c')]+_0x5a7688[_0x8372('0x1e')];var _0x5a1d4f;if(_0x1c705a>=_0x587a79){_0x1c705a=_0x587a79;_0x5a1d4f=0xc8;}else{_0x5a1d4f=0xce;}_0x2d5754['status'](_0x5a1d4f);return _0x2d5754[_0x8372('0x20')]('Content-Range',_0x3f85f0+'-'+_0x1c705a+'/'+_0x587a79)[_0x8372('0x1b')](_0x56f57e);}return null;};}function patchUpdates(_0x563ddd){return function(_0x238b7b){try{jsonpatch[_0x8372('0x21')](_0x238b7b,_0x563ddd,!![]);}catch(_0x114c4b){return BPromise[_0x8372('0x22')](_0x114c4b);}return _0x238b7b[_0x8372('0x23')]();};}function saveUpdates(_0x120c9f,_0x378407){return function(_0x3996d6){if(_0x3996d6){return _0x3996d6[_0x8372('0x24')](_0x120c9f)[_0x8372('0x25')](function(_0x154932){return _0x154932;});}return null;};}function removeEntity(_0x40257c,_0x41b4b6){return function(_0x59caa2){if(_0x59caa2){return _0x59caa2[_0x8372('0x26')]()[_0x8372('0x25')](function(){_0x40257c[_0x8372('0x1a')](0xcc)[_0x8372('0x27')]();});}};}function handleEntityNotFound(_0x547317,_0x36f538){return function(_0x36dd00){if(!_0x36dd00){_0x547317['sendStatus'](0x194);}return _0x36dd00;};}function handleError(_0x267cb5,_0x418ff9){_0x418ff9=_0x418ff9||0x1f4;return function(_0xd348dd){logger[_0x8372('0x28')](_0xd348dd[_0x8372('0x29')]);if(_0xd348dd[_0x8372('0x2a')]){delete _0xd348dd[_0x8372('0x2a')];}_0x267cb5[_0x8372('0x1a')](_0x418ff9)[_0x8372('0x2b')](_0xd348dd);};}exports[_0x8372('0x2c')]=function(_0x10af40,_0x59bca7){var _0x4c01db={},_0x5986a0={},_0x57b09e={'count':0x0,'rows':[]};var _0x1010f0=_[_0x8372('0x2d')](db['VoiceMailMessage'][_0x8372('0x2e')],function(_0x1f3da2){return{'name':_0x1f3da2['fieldName'],'type':_0x1f3da2[_0x8372('0x2f')][_0x8372('0x30')]};});_0x5986a0[_0x8372('0x31')]=_['differenceBy'](_[_0x8372('0x2d')](_0x1010f0,_0x8372('0x2a')),[_0x8372('0x2a')]);_0x5986a0[_0x8372('0x32')]=_[_0x8372('0x33')](_0x10af40[_0x8372('0x32')]);_0x5986a0[_0x8372('0x34')]=_[_0x8372('0x35')](_0x5986a0['model'],_0x5986a0['query']);_0x4c01db['attributes']=_['intersection'](_0x5986a0['model'],qs['fields'](_0x10af40[_0x8372('0x32')]['fields']));_0x4c01db[_0x8372('0x36')]=_0x4c01db[_0x8372('0x36')][_0x8372('0x37')]?_0x4c01db[_0x8372('0x36')]:_0x5986a0[_0x8372('0x31')];if(!_0x10af40[_0x8372('0x32')][_0x8372('0x38')](_0x8372('0x39'))){_0x4c01db[_0x8372('0x1e')]=qs['limit'](_0x10af40[_0x8372('0x32')][_0x8372('0x1e')]);_0x4c01db[_0x8372('0x1c')]=qs[_0x8372('0x1c')](_0x10af40[_0x8372('0x32')][_0x8372('0x1c')]);}_0x4c01db[_0x8372('0x3a')]=qs['sort'](_0x10af40['query'][_0x8372('0x3b')]);_0x4c01db[_0x8372('0x3c')]=qs[_0x8372('0x34')](_[_0x8372('0x3d')](_0x10af40[_0x8372('0x32')],_0x5986a0[_0x8372('0x34')]),_0x1010f0);if(_0x10af40[_0x8372('0x32')][_0x8372('0x3e')]){_0x4c01db['where']=_[_0x8372('0x3f')](_0x4c01db[_0x8372('0x3c')],{'$or':_[_0x8372('0x2d')](_0x1010f0,function(_0x42434c){if(_0x42434c[_0x8372('0x2f')]!==_0x8372('0x40')){var _0x47b037={};_0x47b037[_0x42434c[_0x8372('0x2a')]]={'$like':'%'+_0x10af40[_0x8372('0x32')]['filter']+'%'};return _0x47b037;}})});}_0x4c01db=_['merge']({},_0x4c01db,_0x10af40['options']);var _0xe22009={'where':_0x4c01db[_0x8372('0x3c')]};return db[_0x8372('0x41')][_0x8372('0x1f')](_0xe22009)[_0x8372('0x25')](function(_0x17cfa8){_0x57b09e[_0x8372('0x1f')]=_0x17cfa8;if(_0x10af40[_0x8372('0x32')]['includeAll']){_0x4c01db[_0x8372('0x42')]=[{'all':!![]}];}return db[_0x8372('0x41')]['findAll'](_0x4c01db);})[_0x8372('0x25')](function(_0x41ca1d){_0x57b09e[_0x8372('0x43')]=_0x41ca1d;return _0x57b09e;})[_0x8372('0x25')](respondWithFilteredResult(_0x59bca7,_0x4c01db))[_0x8372('0x44')](handleError(_0x59bca7,null));};exports[_0x8372('0x45')]=function(_0xe7136b,_0x27857c){var _0x5139dc={'raw':!![],'where':{'id':_0xe7136b[_0x8372('0x46')]['id']}},_0x1ca7a1={};_0x1ca7a1[_0x8372('0x31')]=_['keys'](db[_0x8372('0x41')][_0x8372('0x2e')]);_0x1ca7a1[_0x8372('0x32')]=_['keys'](_0xe7136b[_0x8372('0x32')]);_0x1ca7a1[_0x8372('0x34')]=_[_0x8372('0x35')](_0x1ca7a1['model'],_0x1ca7a1[_0x8372('0x32')]);_0x5139dc[_0x8372('0x36')]=_[_0x8372('0x35')](_0x1ca7a1[_0x8372('0x31')],qs[_0x8372('0x47')](_0xe7136b['query']['fields']));_0x5139dc[_0x8372('0x36')]=_0x5139dc[_0x8372('0x36')][_0x8372('0x37')]?_0x5139dc[_0x8372('0x36')]:_0x1ca7a1[_0x8372('0x31')];if(_0xe7136b[_0x8372('0x32')][_0x8372('0x48')]){_0x5139dc[_0x8372('0x42')]=[{'all':!![]}];}_0x5139dc=_[_0x8372('0x3f')]({},_0x5139dc,_0xe7136b[_0x8372('0x49')]);return db[_0x8372('0x41')]['find'](_0x5139dc)[_0x8372('0x25')](handleEntityNotFound(_0x27857c,null))[_0x8372('0x25')](respondWithResult(_0x27857c,null))[_0x8372('0x44')](handleError(_0x27857c,null));};exports[_0x8372('0x4a')]=function(_0x340810,_0x556977){return db[_0x8372('0x41')][_0x8372('0x4a')](_0x340810['body'],{})[_0x8372('0x25')](respondWithResult(_0x556977,0xc9))[_0x8372('0x44')](handleError(_0x556977,null));};exports[_0x8372('0x24')]=function(_0x2e4774,_0x4e2369){if(_0x2e4774[_0x8372('0x4b')]['id']){delete _0x2e4774['body']['id'];}return db['VoiceMailMessage'][_0x8372('0x4c')]({'where':{'id':_0x2e4774['params']['id']}})[_0x8372('0x25')](handleEntityNotFound(_0x4e2369,null))[_0x8372('0x25')](saveUpdates(_0x2e4774[_0x8372('0x4b')],null))[_0x8372('0x25')](respondWithResult(_0x4e2369,null))[_0x8372('0x44')](handleError(_0x4e2369,null));};exports[_0x8372('0x26')]=function(_0x554ae0,_0x3f5efb){return db[_0x8372('0x41')]['find']({'where':{'id':_0x554ae0[_0x8372('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f5efb,null))[_0x8372('0x25')](removeEntity(_0x3f5efb,null))[_0x8372('0x44')](handleError(_0x3f5efb,null));};exports[_0x8372('0x4d')]=function(_0x6d6508,_0x3dbd8a,_0x1a02fb){return db[_0x8372('0x41')][_0x8372('0x4c')]({'where':{'id':_0x6d6508[_0x8372('0x46')]['id']},'attributes':['id',_0x8372('0x4e'),'msg_id']})['then'](handleEntityNotFound(_0x3dbd8a,null))[_0x8372('0x25')](function(_0xc3cf65){if(_0xc3cf65){if(!_0xc3cf65[_0x8372('0x4e')]){throw new db[(_0x8372('0x4f'))][(_0x8372('0x50'))](_0x8372('0x51'));}var _0x4e0b3f={'Content-Type':_0x8372('0x52'),'Content-Disposition':_0x8372('0x53')};if(_0xc3cf65[_0x8372('0x54')]){_0x4e0b3f[_0x8372('0x55')]=_0x8372('0x56')+_0xc3cf65[_0x8372('0x54')]+_0x8372('0x57');}_0x3dbd8a[_0x8372('0x20')](_0x4e0b3f);return _0x3dbd8a[_0x8372('0x2b')](new Buffer(_0xc3cf65[_0x8372('0x4e')]));}})[_0x8372('0x44')](handleError(_0x3dbd8a,null));};
\ No newline at end of file
+var _0xc1a6=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','index','map','VoiceMailMessage','rawAttributes','key','model','differenceBy','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','options','includeAll','include','findAll','catch','params','keys','find','create','body','msg_id','recording','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','send','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x133990,_0x334b7a){var _0x176242=function(_0x3ac1c0){while(--_0x3ac1c0){_0x133990['push'](_0x133990['shift']());}};_0x176242(++_0x334b7a);}(_0xc1a6,0xf9));var _0x6c1a=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xc1a6[_0xbb091];return _0x467a04;};'use strict';var emlformat=require(_0x6c1a('0x0'));var rimraf=require(_0x6c1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c1a('0x2'));var rp=require(_0x6c1a('0x3'));var moment=require(_0x6c1a('0x4'));var BPromise=require(_0x6c1a('0x5'));var Mustache=require(_0x6c1a('0x6'));var util=require(_0x6c1a('0x7'));var path=require(_0x6c1a('0x8'));var sox=require(_0x6c1a('0x9'));var csv=require(_0x6c1a('0xa'));var ejs=require(_0x6c1a('0xb'));var fs=require('fs');var fs_extra=require(_0x6c1a('0xc'));var _=require(_0x6c1a('0xd'));var squel=require(_0x6c1a('0xe'));var crypto=require(_0x6c1a('0xf'));var jsforce=require(_0x6c1a('0x10'));var deskjs=require(_0x6c1a('0x11'));var toCsv=require(_0x6c1a('0xa'));var querystring=require(_0x6c1a('0x12'));var Papa=require(_0x6c1a('0x13'));var Redis=require(_0x6c1a('0x14'));var authService=require(_0x6c1a('0x15'));var qs=require(_0x6c1a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c1a('0x17'));var logger=require(_0x6c1a('0x18'))(_0x6c1a('0x19'));var utils=require(_0x6c1a('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x6c1a('0x1b'));var db=require(_0x6c1a('0x1c'))['db'];function respondWithStatusCode(_0x2e5765,_0x145b32){_0x145b32=_0x145b32||0xcc;return function(_0x5a20e1){if(_0x5a20e1){return _0x2e5765[_0x6c1a('0x1d')](_0x145b32);}return _0x2e5765[_0x6c1a('0x1e')](_0x145b32)['end']();};}function respondWithResult(_0xb925c4,_0x3fe8a8){_0x3fe8a8=_0x3fe8a8||0xc8;return function(_0x29a95c){if(_0x29a95c){return _0xb925c4[_0x6c1a('0x1e')](_0x3fe8a8)[_0x6c1a('0x1f')](_0x29a95c);}};}function respondWithFilteredResult(_0x971e6,_0x5258ea){return function(_0x35657e){if(_0x35657e){var _0x4a9048=typeof _0x5258ea[_0x6c1a('0x20')]===_0x6c1a('0x21')&&typeof _0x5258ea[_0x6c1a('0x22')]===_0x6c1a('0x21');var _0x4fcc15=_0x35657e['count'];var _0x109f0c=_0x4a9048?0x0:_0x5258ea[_0x6c1a('0x20')];var _0x18ff63=_0x4a9048?_0x35657e[_0x6c1a('0x23')]:_0x5258ea[_0x6c1a('0x20')]+_0x5258ea['limit'];var _0x4e5102;if(_0x18ff63>=_0x4fcc15){_0x18ff63=_0x4fcc15;_0x4e5102=0xc8;}else{_0x4e5102=0xce;}_0x971e6['status'](_0x4e5102);return _0x971e6[_0x6c1a('0x24')](_0x6c1a('0x25'),_0x109f0c+'-'+_0x18ff63+'/'+_0x4fcc15)[_0x6c1a('0x1f')](_0x35657e);}return null;};}function patchUpdates(_0x415e2f){return function(_0x29dd0e){try{jsonpatch[_0x6c1a('0x26')](_0x29dd0e,_0x415e2f,!![]);}catch(_0x52b93a){return BPromise['reject'](_0x52b93a);}return _0x29dd0e[_0x6c1a('0x27')]();};}function saveUpdates(_0x111c3d,_0x2b2cf3){return function(_0x5bf2e9){if(_0x5bf2e9){return _0x5bf2e9[_0x6c1a('0x28')](_0x111c3d)['then'](function(_0x50b4b8){return _0x50b4b8;});}return null;};}function removeEntity(_0x17a671,_0x148d60){return function(_0x445686){if(_0x445686){return _0x445686[_0x6c1a('0x29')]()[_0x6c1a('0x2a')](function(){_0x17a671[_0x6c1a('0x1e')](0xcc)[_0x6c1a('0x2b')]();});}};}function handleEntityNotFound(_0x3123cc,_0x583185){return function(_0xfea159){if(!_0xfea159){_0x3123cc['sendStatus'](0x194);}return _0xfea159;};}function handleError(_0x251b74,_0x23516f){_0x23516f=_0x23516f||0x1f4;return function(_0x3a3a59){logger[_0x6c1a('0x2c')](_0x3a3a59[_0x6c1a('0x2d')]);if(_0x3a3a59[_0x6c1a('0x2e')]){delete _0x3a3a59[_0x6c1a('0x2e')];}_0x251b74[_0x6c1a('0x1e')](_0x23516f)['send'](_0x3a3a59);};}exports[_0x6c1a('0x2f')]=function(_0x5df847,_0x5602fd){var _0x3eafb7={},_0x236792={},_0x1da8f6={'count':0x0,'rows':[]};var _0x58a68a=_[_0x6c1a('0x30')](db[_0x6c1a('0x31')][_0x6c1a('0x32')],function(_0x4cfe13){return{'name':_0x4cfe13['fieldName'],'type':_0x4cfe13['type'][_0x6c1a('0x33')]};});_0x236792[_0x6c1a('0x34')]=_[_0x6c1a('0x35')](_[_0x6c1a('0x30')](_0x58a68a,_0x6c1a('0x2e')),['name']);_0x236792[_0x6c1a('0x36')]=_['keys'](_0x5df847[_0x6c1a('0x36')]);_0x236792['filters']=_['intersection'](_0x236792[_0x6c1a('0x34')],_0x236792['query']);_0x3eafb7['attributes']=_[_0x6c1a('0x37')](_0x236792[_0x6c1a('0x34')],qs[_0x6c1a('0x38')](_0x5df847[_0x6c1a('0x36')][_0x6c1a('0x38')]));_0x3eafb7[_0x6c1a('0x39')]=_0x3eafb7[_0x6c1a('0x39')][_0x6c1a('0x3a')]?_0x3eafb7[_0x6c1a('0x39')]:_0x236792['model'];if(!_0x5df847[_0x6c1a('0x36')][_0x6c1a('0x3b')](_0x6c1a('0x3c'))){_0x3eafb7[_0x6c1a('0x22')]=qs['limit'](_0x5df847[_0x6c1a('0x36')][_0x6c1a('0x22')]);_0x3eafb7[_0x6c1a('0x20')]=qs[_0x6c1a('0x20')](_0x5df847[_0x6c1a('0x36')][_0x6c1a('0x20')]);}_0x3eafb7[_0x6c1a('0x3d')]=qs['sort'](_0x5df847[_0x6c1a('0x36')][_0x6c1a('0x3e')]);_0x3eafb7['where']=qs[_0x6c1a('0x3f')](_['pick'](_0x5df847[_0x6c1a('0x36')],_0x236792['filters']),_0x58a68a);if(_0x5df847[_0x6c1a('0x36')][_0x6c1a('0x40')]){_0x3eafb7[_0x6c1a('0x41')]=_[_0x6c1a('0x42')](_0x3eafb7[_0x6c1a('0x41')],{'$or':_['map'](_0x58a68a,function(_0x46824f){if(_0x46824f[_0x6c1a('0x43')]!=='VIRTUAL'){var _0x3bf07b={};_0x3bf07b[_0x46824f['name']]={'$like':'%'+_0x5df847['query']['filter']+'%'};return _0x3bf07b;}})});}_0x3eafb7=_['merge']({},_0x3eafb7,_0x5df847[_0x6c1a('0x44')]);var _0x23bd56={'where':_0x3eafb7[_0x6c1a('0x41')]};return db[_0x6c1a('0x31')]['count'](_0x23bd56)[_0x6c1a('0x2a')](function(_0x6586e5){_0x1da8f6[_0x6c1a('0x23')]=_0x6586e5;if(_0x5df847[_0x6c1a('0x36')][_0x6c1a('0x45')]){_0x3eafb7[_0x6c1a('0x46')]=[{'all':!![]}];}return db[_0x6c1a('0x31')][_0x6c1a('0x47')](_0x3eafb7);})[_0x6c1a('0x2a')](function(_0x2dfa2b){_0x1da8f6['rows']=_0x2dfa2b;return _0x1da8f6;})['then'](respondWithFilteredResult(_0x5602fd,_0x3eafb7))[_0x6c1a('0x48')](handleError(_0x5602fd,null));};exports['show']=function(_0x4bcd6d,_0x487b8c){var _0x4b71f1={'raw':!![],'where':{'id':_0x4bcd6d[_0x6c1a('0x49')]['id']}},_0x246f29={};_0x246f29[_0x6c1a('0x34')]=_[_0x6c1a('0x4a')](db[_0x6c1a('0x31')]['rawAttributes']);_0x246f29['query']=_[_0x6c1a('0x4a')](_0x4bcd6d['query']);_0x246f29[_0x6c1a('0x3f')]=_[_0x6c1a('0x37')](_0x246f29[_0x6c1a('0x34')],_0x246f29[_0x6c1a('0x36')]);_0x4b71f1[_0x6c1a('0x39')]=_[_0x6c1a('0x37')](_0x246f29[_0x6c1a('0x34')],qs['fields'](_0x4bcd6d[_0x6c1a('0x36')][_0x6c1a('0x38')]));_0x4b71f1[_0x6c1a('0x39')]=_0x4b71f1[_0x6c1a('0x39')][_0x6c1a('0x3a')]?_0x4b71f1[_0x6c1a('0x39')]:_0x246f29['model'];if(_0x4bcd6d['query'][_0x6c1a('0x45')]){_0x4b71f1[_0x6c1a('0x46')]=[{'all':!![]}];}_0x4b71f1=_[_0x6c1a('0x42')]({},_0x4b71f1,_0x4bcd6d[_0x6c1a('0x44')]);return db[_0x6c1a('0x31')][_0x6c1a('0x4b')](_0x4b71f1)[_0x6c1a('0x2a')](handleEntityNotFound(_0x487b8c,null))[_0x6c1a('0x2a')](respondWithResult(_0x487b8c,null))['catch'](handleError(_0x487b8c,null));};exports[_0x6c1a('0x4c')]=function(_0x3e3744,_0x4c8fb0){return db[_0x6c1a('0x31')][_0x6c1a('0x4c')](_0x3e3744[_0x6c1a('0x4d')],{})[_0x6c1a('0x2a')](respondWithResult(_0x4c8fb0,0xc9))['catch'](handleError(_0x4c8fb0,null));};exports[_0x6c1a('0x28')]=function(_0x2b745a,_0x4eec7f){if(_0x2b745a[_0x6c1a('0x4d')]['id']){delete _0x2b745a['body']['id'];}return db[_0x6c1a('0x31')]['find']({'where':{'id':_0x2b745a[_0x6c1a('0x49')]['id']}})[_0x6c1a('0x2a')](handleEntityNotFound(_0x4eec7f,null))['then'](saveUpdates(_0x2b745a[_0x6c1a('0x4d')],null))[_0x6c1a('0x2a')](respondWithResult(_0x4eec7f,null))[_0x6c1a('0x48')](handleError(_0x4eec7f,null));};exports['destroy']=function(_0x13398a,_0x2ea647){return db[_0x6c1a('0x31')]['find']({'where':{'id':_0x13398a[_0x6c1a('0x49')]['id']}})[_0x6c1a('0x2a')](handleEntityNotFound(_0x2ea647,null))[_0x6c1a('0x2a')](removeEntity(_0x2ea647,null))[_0x6c1a('0x48')](handleError(_0x2ea647,null));};exports['download']=function(_0x4d7504,_0x30633f,_0x39d137){return db[_0x6c1a('0x31')][_0x6c1a('0x4b')]({'where':{'id':_0x4d7504[_0x6c1a('0x49')]['id']},'attributes':['id','recording',_0x6c1a('0x4e')]})[_0x6c1a('0x2a')](handleEntityNotFound(_0x30633f,null))[_0x6c1a('0x2a')](function(_0x6d4fb0){if(_0x6d4fb0){if(!_0x6d4fb0[_0x6c1a('0x4f')]){throw new db[(_0x6c1a('0x50'))][(_0x6c1a('0x51'))]('VoiceMailMessage\x20not\x20found');}var _0x48f2b5={'Content-Type':_0x6c1a('0x52'),'Content-Disposition':_0x6c1a('0x53')};if(_0x6d4fb0['msg_id']){_0x48f2b5[_0x6c1a('0x54')]=_0x6c1a('0x55')+_0x6d4fb0['msg_id']+'.wav\x22';}_0x30633f[_0x6c1a('0x24')](_0x48f2b5);return _0x30633f[_0x6c1a('0x56')](new Buffer(_0x6d4fb0['recording']));}})['catch'](handleError(_0x30633f,null));};
\ No newline at end of file
index 531ce2b..0115305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbd5=['voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x2d1c60,_0x4f6e1a){var _0x82e7ba=function(_0x2fe238){while(--_0x2fe238){_0x2d1c60['push'](_0x2d1c60['shift']());}};_0x82e7ba(++_0x4f6e1a);}(_0xdbd5,0xe2));var _0x5dbd=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0xdbd5[_0x223c0d];return _0x207827;};'use strict';var _=require(_0x5dbd('0x0'));var util=require(_0x5dbd('0x1'));var logger=require(_0x5dbd('0x2'))(_0x5dbd('0x3'));var moment=require(_0x5dbd('0x4'));var BPromise=require(_0x5dbd('0x5'));var rp=require(_0x5dbd('0x6'));var fs=require('fs');var path=require(_0x5dbd('0x7'));var rimraf=require(_0x5dbd('0x8'));var config=require(_0x5dbd('0x9'));var attributes=require(_0x5dbd('0xa'));module[_0x5dbd('0xb')]=function(_0x57c5da,_0x12baf5){return _0x57c5da[_0x5dbd('0xc')](_0x5dbd('0xd'),attributes,{'tableName':_0x5dbd('0xe'),'paranoid':![],'indexes':[{'name':_0x5dbd('0xf'),'fields':[_0x5dbd('0xf')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x47c6=['api','moment','bluebird','rimraf','../../config/environment','exports','define','VoiceMailMessage','dir','lodash','util'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x47c6,0x1ab));var _0x647c=function(_0x1306e9,_0x4fd1ce){_0x1306e9=_0x1306e9-0x0;var _0x15eafb=_0x47c6[_0x1306e9];return _0x15eafb;};'use strict';var _=require(_0x647c('0x0'));var util=require(_0x647c('0x1'));var logger=require('../../config/logger')(_0x647c('0x2'));var moment=require(_0x647c('0x3'));var BPromise=require(_0x647c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x647c('0x5'));var config=require(_0x647c('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x647c('0x7')]=function(_0x19c31a,_0x1905e1){return _0x19c31a[_0x647c('0x8')](_0x647c('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x647c('0xa'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
index 81fa770..0b9e546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec16=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4fcadb,_0x293a79){var _0x488e9e=function(_0x1f8c2c){while(--_0x1f8c2c){_0x4fcadb['push'](_0x4fcadb['shift']());}};_0x488e9e(++_0x293a79);}(_0xec16,0xa9));var _0x6ec1=function(_0x4b18ea,_0x2c070a){_0x4b18ea=_0x4b18ea-0x0;var _0x28ec1c=_0xec16[_0x4b18ea];return _0x28ec1c;};'use strict';var _=require(_0x6ec1('0x0'));var util=require('util');var moment=require(_0x6ec1('0x1'));var BPromise=require(_0x6ec1('0x2'));var rs=require(_0x6ec1('0x3'));var fs=require('fs');var Redis=require(_0x6ec1('0x4'));var db=require(_0x6ec1('0x5'))['db'];var utils=require(_0x6ec1('0x6'));var logger=require(_0x6ec1('0x7'))(_0x6ec1('0x8'));var config=require(_0x6ec1('0x9'));var jayson=require(_0x6ec1('0xa'));var client=jayson[_0x6ec1('0xb')][_0x6ec1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d288a,_0x44fd14,_0x27e3d7){return new BPromise(function(_0x1e124d,_0x449581){return client[_0x6ec1('0xd')](_0x3d288a,_0x27e3d7)['then'](function(_0x4b1359){logger[_0x6ec1('0xe')](_0x6ec1('0xf'),_0x44fd14,_0x6ec1('0x10'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x44fd14,'request\x20sent',JSON['stringify'](_0x4b1359));if(_0x4b1359['error']){if(_0x4b1359[_0x6ec1('0x11')][_0x6ec1('0x12')]===0x1f4){logger[_0x6ec1('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x44fd14,_0x4b1359[_0x6ec1('0x11')][_0x6ec1('0x13')]);return _0x449581(_0x4b1359[_0x6ec1('0x11')][_0x6ec1('0x13')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x44fd14,_0x4b1359[_0x6ec1('0x11')]['message']);return _0x1e124d(_0x4b1359['error']['message']);}else{logger[_0x6ec1('0xe')](_0x6ec1('0xf'),_0x44fd14,'request\x20sent');_0x1e124d(_0x4b1359[_0x6ec1('0x14')]['message']);}})[_0x6ec1('0x15')](function(_0x2ca18f){logger[_0x6ec1('0x11')](_0x6ec1('0xf'),_0x44fd14,_0x2ca18f);_0x449581(_0x2ca18f);});});}
\ No newline at end of file
+var _0x7646=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3d1ca1,_0x1bda6c){var _0x3fd32f=function(_0x5b96c8){while(--_0x5b96c8){_0x3d1ca1['push'](_0x3d1ca1['shift']());}};_0x3fd32f(++_0x1bda6c);}(_0x7646,0x6d));var _0x6764=function(_0xa7bc63,_0x32af4b){_0xa7bc63=_0xa7bc63-0x0;var _0x278ee2=_0x7646[_0xa7bc63];return _0x278ee2;};'use strict';var _=require(_0x6764('0x0'));var util=require(_0x6764('0x1'));var moment=require(_0x6764('0x2'));var BPromise=require(_0x6764('0x3'));var rs=require(_0x6764('0x4'));var fs=require('fs');var Redis=require(_0x6764('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6764('0x6'))(_0x6764('0x7'));var config=require('../../config/environment');var jayson=require(_0x6764('0x8'));var client=jayson[_0x6764('0x9')][_0x6764('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e17a3,_0x502c1f,_0x4deac9){return new BPromise(function(_0x2c34e1,_0x575df5){return client[_0x6764('0xb')](_0x1e17a3,_0x4deac9)[_0x6764('0xc')](function(_0x4bbb49){logger[_0x6764('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x502c1f,_0x6764('0xe'));logger[_0x6764('0xf')](_0x6764('0x10'),_0x502c1f,_0x6764('0xe'),JSON[_0x6764('0x11')](_0x4bbb49));if(_0x4bbb49[_0x6764('0x12')]){if(_0x4bbb49['error'][_0x6764('0x13')]===0x1f4){logger[_0x6764('0x12')](_0x6764('0x14'),_0x502c1f,_0x4bbb49[_0x6764('0x12')][_0x6764('0x15')]);return _0x575df5(_0x4bbb49[_0x6764('0x12')][_0x6764('0x15')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x502c1f,_0x4bbb49[_0x6764('0x12')]['message']);return _0x2c34e1(_0x4bbb49[_0x6764('0x12')][_0x6764('0x15')]);}else{logger['info'](_0x6764('0x14'),_0x502c1f,_0x6764('0xe'));_0x2c34e1(_0x4bbb49['result']['message']);}})[_0x6764('0x16')](function(_0x345e30){logger[_0x6764('0x12')](_0x6764('0x14'),_0x502c1f,_0x345e30);_0x575df5(_0x345e30);});});}
\ No newline at end of file
index 61dfb1e..da0ef5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeee=['../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','post','create','addSound','update','delete','removeSound','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a0d1d,_0xd75a32){var _0x7e4375=function(_0x127e53){while(--_0x127e53){_0x1a0d1d['push'](_0x1a0d1d['shift']());}};_0x7e4375(++_0xd75a32);}(_0xfeee,0x93));var _0xefee=function(_0x2bc700,_0x161780){_0x2bc700=_0x2bc700-0x0;var _0x4de4c2=_0xfeee[_0x2bc700];return _0x4de4c2;};'use strict';var multer=require('multer');var util=require(_0xefee('0x0'));var path=require(_0xefee('0x1'));var timeout=require(_0xefee('0x2'));var express=require(_0xefee('0x3'));var router=express[_0xefee('0x4')]();var fs_extra=require(_0xefee('0x5'));var auth=require(_0xefee('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xefee('0x7'));var controller=require(_0xefee('0x8'));router[_0xefee('0x9')]('/',auth[_0xefee('0xa')](),controller[_0xefee('0xb')]);router[_0xefee('0x9')](_0xefee('0xc'),auth[_0xefee('0xa')](),controller[_0xefee('0xd')]);router[_0xefee('0x9')](_0xefee('0xe'),auth['isAuthenticated'](),controller['getSounds']);router[_0xefee('0xf')]('/',auth[_0xefee('0xa')](),controller[_0xefee('0x10')]);router[_0xefee('0xf')](_0xefee('0xe'),auth['isAuthenticated'](),controller[_0xefee('0x11')]);router['put'](_0xefee('0xc'),auth[_0xefee('0xa')](),controller[_0xefee('0x12')]);router[_0xefee('0x13')](_0xefee('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xefee('0x13')]('/:id/sounds/:id2',auth[_0xefee('0xa')](),controller[_0xefee('0x14')]);module[_0xefee('0x15')]=router;
\ No newline at end of file
+var _0x5ae2=['../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','destroy','/:id/sounds/:id2','removeSound','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x2c3f08,_0x380f2b){var _0x4ea2ab=function(_0x4b198a){while(--_0x4b198a){_0x2c3f08['push'](_0x2c3f08['shift']());}};_0x4ea2ab(++_0x380f2b);}(_0x5ae2,0x1af));var _0x25ae=function(_0x5554c5,_0x4e2cec){_0x5554c5=_0x5554c5-0x0;var _0x359003=_0x5ae2[_0x5554c5];return _0x359003;};'use strict';var multer=require(_0x25ae('0x0'));var util=require(_0x25ae('0x1'));var path=require(_0x25ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x25ae('0x3'));var router=express['Router']();var fs_extra=require(_0x25ae('0x4'));var auth=require(_0x25ae('0x5'));var interaction=require(_0x25ae('0x6'));var config=require('../../config/environment');var controller=require(_0x25ae('0x7'));router[_0x25ae('0x8')]('/',auth[_0x25ae('0x9')](),controller[_0x25ae('0xa')]);router[_0x25ae('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x25ae('0xb')]);router[_0x25ae('0x8')](_0x25ae('0xc'),auth['isAuthenticated'](),controller[_0x25ae('0xd')]);router[_0x25ae('0xe')]('/',auth['isAuthenticated'](),controller[_0x25ae('0xf')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0x25ae('0x10')]);router[_0x25ae('0x11')](_0x25ae('0x12'),auth['isAuthenticated'](),controller[_0x25ae('0x13')]);router['delete']('/:id',auth[_0x25ae('0x9')](),controller[_0x25ae('0x14')]);router['delete'](_0x25ae('0x15'),auth['isAuthenticated'](),controller[_0x25ae('0x16')]);module['exports']=router;
\ No newline at end of file
index eec529b..4a542a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9971=['sequelize','exports','name','ENUM','files','quietmp3nb','quietmp3','mp3','STRING','alpha'];(function(_0x239786,_0x471f27){var _0x3f15e2=function(_0x1c3781){while(--_0x1c3781){_0x239786['push'](_0x239786['shift']());}};_0x3f15e2(++_0x471f27);}(_0x9971,0x122));var _0x1997=function(_0x1c129a,_0x36a6d6){_0x1c129a=_0x1c129a-0x0;var _0x233ab0=_0x9971[_0x1c129a];return _0x233ab0;};'use strict';var Sequelize=require(_0x1997('0x0'));module[_0x1997('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1997('0x2')},'mode':{'type':Sequelize[_0x1997('0x3')]('custom',_0x1997('0x4'),'mp3nb',_0x1997('0x5'),_0x1997('0x6'),_0x1997('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x1997('0x8')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x1997('0x8')],'allowNull':!![],'defaultValue':_0x1997('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8bb5=['TIMESTAMP','BOOLEAN','sequelize','STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x564021,_0x9e83e4){var _0x4ce660=function(_0x51c644){while(--_0x51c644){_0x564021['push'](_0x564021['shift']());}};_0x4ce660(++_0x9e83e4);}(_0x8bb5,0x12e));var _0x58bb=function(_0x140b77,_0x39b444){_0x140b77=_0x140b77-0x0;var _0x182d1a=_0x8bb5[_0x140b77];return _0x182d1a;};'use strict';var Sequelize=require(_0x58bb('0x0'));module['exports']={'name':{'type':Sequelize[_0x58bb('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x58bb('0x2')](_0x58bb('0x3'),_0x58bb('0x4'),_0x58bb('0x5'),_0x58bb('0x6'),_0x58bb('0x7'),_0x58bb('0x8')),'allowNull':!![],'defaultValue':_0x58bb('0x4')},'directory':{'type':Sequelize[_0x58bb('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x58bb('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x58bb('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x58bb('0x1')],'allowNull':!![],'defaultValue':_0x58bb('0x9')},'format':{'type':Sequelize[_0x58bb('0x1')],'allowNull':!![]},'stamp':{'type':_0x58bb('0xa')},'defaultEntry':{'type':Sequelize[_0x58bb('0xb')],'defaultValue':0x0}};
\ No newline at end of file
index e7dc202..50f2c79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf423=['basename','save_name','extname','symlinkSync','findOne','id2','message','getSounds','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','UserProfileResource','end','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','filter','options','findAll','rows','catch','show','params','keys','include','body','find','create','transaction','mode','directory','root','server/files/moh','files','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MusicOnHolds','userProfileId','destroy','sequelize','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','addSound','Sound','converted_format','createdAt','format','%s.%s'];(function(_0x2512ca,_0x17a9de){var _0x264a6b=function(_0xc55a6f){while(--_0xc55a6f){_0x2512ca['push'](_0x2512ca['shift']());}};_0x264a6b(++_0x17a9de);}(_0xf423,0xea));var _0x3f42=function(_0x1fdd0e,_0x278e56){_0x1fdd0e=_0x1fdd0e-0x0;var _0x493f84=_0xf423[_0x1fdd0e];return _0x493f84;};'use strict';var emlformat=require(_0x3f42('0x0'));var rimraf=require(_0x3f42('0x1'));var zipdir=require(_0x3f42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f42('0x3'));var moment=require('moment');var BPromise=require(_0x3f42('0x4'));var Mustache=require(_0x3f42('0x5'));var util=require(_0x3f42('0x6'));var path=require(_0x3f42('0x7'));var sox=require(_0x3f42('0x8'));var csv=require(_0x3f42('0x9'));var ejs=require(_0x3f42('0xa'));var fs=require('fs');var fs_extra=require(_0x3f42('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3f42('0xc'));var jsforce=require(_0x3f42('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3f42('0x9'));var querystring=require(_0x3f42('0xe'));var Papa=require(_0x3f42('0xf'));var Redis=require(_0x3f42('0x10'));var authService=require(_0x3f42('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3f42('0x12'));var hardwareService=require(_0x3f42('0x13'));var logger=require(_0x3f42('0x14'))(_0x3f42('0x15'));var utils=require('../../config/utils');var config=require(_0x3f42('0x16'));var licenseUtil=require(_0x3f42('0x17'));var db=require(_0x3f42('0x18'))['db'];function respondWithStatusCode(_0x2e9b3f,_0x285585){_0x285585=_0x285585||0xcc;return function(_0x2476fd){if(_0x2476fd){return _0x2e9b3f[_0x3f42('0x19')](_0x285585);}return _0x2e9b3f[_0x3f42('0x1a')](_0x285585)['end']();};}function respondWithResult(_0x11ba2f,_0x543c4d){_0x543c4d=_0x543c4d||0xc8;return function(_0x3399a2){if(_0x3399a2){return _0x11ba2f[_0x3f42('0x1a')](_0x543c4d)[_0x3f42('0x1b')](_0x3399a2);}};}function respondWithFilteredResult(_0x380afb,_0x31c2d5){return function(_0x470700){if(_0x470700){var _0x53b740=typeof _0x31c2d5[_0x3f42('0x1c')]===_0x3f42('0x1d')&&typeof _0x31c2d5[_0x3f42('0x1e')]===_0x3f42('0x1d');var _0x19c471=_0x470700['count'];var _0x35f54b=_0x53b740?0x0:_0x31c2d5[_0x3f42('0x1c')];var _0x5c7c78=_0x53b740?_0x470700[_0x3f42('0x1f')]:_0x31c2d5[_0x3f42('0x1c')]+_0x31c2d5[_0x3f42('0x1e')];var _0xfa300a;if(_0x5c7c78>=_0x19c471){_0x5c7c78=_0x19c471;_0xfa300a=0xc8;}else{_0xfa300a=0xce;}_0x380afb['status'](_0xfa300a);return _0x380afb[_0x3f42('0x20')]('Content-Range',_0x35f54b+'-'+_0x5c7c78+'/'+_0x19c471)[_0x3f42('0x1b')](_0x470700);}return null;};}function patchUpdates(_0x11eadd){return function(_0x1944c1){try{jsonpatch[_0x3f42('0x21')](_0x1944c1,_0x11eadd,!![]);}catch(_0x248b3a){return BPromise[_0x3f42('0x22')](_0x248b3a);}return _0x1944c1[_0x3f42('0x23')]();};}function saveUpdates(_0x4ca825,_0x55befb){return function(_0x4e66ad){if(_0x4e66ad){return _0x4e66ad[_0x3f42('0x24')](_0x4ca825)[_0x3f42('0x25')](function(_0x4b341d){return _0x4b341d;});}return null;};}function removeEntity(_0x203357,_0x2ab576){return function(_0x44b3fb){if(_0x44b3fb){return _0x44b3fb['destroy']()[_0x3f42('0x25')](function(){var _0x4cee35=_0x44b3fb[_0x3f42('0x26')]({'plain':!![]});var _0x1d303c='MusicOnHolds';return db[_0x3f42('0x27')]['destroy']({'where':{'type':_0x1d303c,'resourceId':_0x4cee35['id']}})[_0x3f42('0x25')](function(){return _0x44b3fb;});})['then'](function(){_0x203357[_0x3f42('0x1a')](0xcc)[_0x3f42('0x28')]();});}};}function handleEntityNotFound(_0x42379c,_0x141918){return function(_0x3533ec){if(!_0x3533ec){_0x42379c['sendStatus'](0x194);}return _0x3533ec;};}function handleError(_0x1f62c6,_0x31212d){_0x31212d=_0x31212d||0x1f4;return function(_0x9c2ea3){logger[_0x3f42('0x29')](_0x9c2ea3[_0x3f42('0x2a')]);if(_0x9c2ea3[_0x3f42('0x2b')]){delete _0x9c2ea3['name'];}_0x1f62c6[_0x3f42('0x1a')](_0x31212d)[_0x3f42('0x2c')](_0x9c2ea3);};}exports[_0x3f42('0x2d')]=function(_0x116f6f,_0x544b00){var _0x55f071={},_0x17a8af={},_0x355732={'count':0x0,'rows':[]};var _0x340a69=_[_0x3f42('0x2e')](db[_0x3f42('0x2f')][_0x3f42('0x30')],function(_0x3d6397){return{'name':_0x3d6397[_0x3f42('0x31')],'type':_0x3d6397['type'][_0x3f42('0x32')]};});_0x17a8af['model']=_['map'](_0x340a69,_0x3f42('0x2b'));_0x17a8af[_0x3f42('0x33')]=_['keys'](_0x116f6f[_0x3f42('0x33')]);_0x17a8af['filters']=_[_0x3f42('0x34')](_0x17a8af[_0x3f42('0x35')],_0x17a8af[_0x3f42('0x33')]);_0x55f071['attributes']=_[_0x3f42('0x34')](_0x17a8af[_0x3f42('0x35')],qs[_0x3f42('0x36')](_0x116f6f[_0x3f42('0x33')]['fields']));_0x55f071[_0x3f42('0x37')]=_0x55f071[_0x3f42('0x37')][_0x3f42('0x38')]?_0x55f071[_0x3f42('0x37')]:_0x17a8af[_0x3f42('0x35')];if(!_0x116f6f[_0x3f42('0x33')][_0x3f42('0x39')](_0x3f42('0x3a'))){_0x55f071[_0x3f42('0x1e')]=qs['limit'](_0x116f6f[_0x3f42('0x33')][_0x3f42('0x1e')]);_0x55f071['offset']=qs[_0x3f42('0x1c')](_0x116f6f[_0x3f42('0x33')][_0x3f42('0x1c')]);}_0x55f071[_0x3f42('0x3b')]=qs[_0x3f42('0x3c')](_0x116f6f[_0x3f42('0x33')][_0x3f42('0x3c')]);delete _0x116f6f[_0x3f42('0x33')]['sort'];_0x55f071['where']=qs[_0x3f42('0x3d')](_[_0x3f42('0x3e')](_0x116f6f['query'],_0x17a8af[_0x3f42('0x3d')]),_0x340a69);if(_0x116f6f['query']['filter']){_0x55f071[_0x3f42('0x3f')]=_[_0x3f42('0x40')](_0x55f071[_0x3f42('0x3f')],{'$or':_[_0x3f42('0x2e')](_0x340a69,function(_0x499be5){if(_0x499be5[_0x3f42('0x41')]!=='VIRTUAL'){var _0x238907={};_0x238907[_0x499be5[_0x3f42('0x2b')]]={'$like':'%'+_0x116f6f[_0x3f42('0x33')][_0x3f42('0x42')]+'%'};return _0x238907;}})});}_0x55f071=_[_0x3f42('0x40')]({},_0x55f071,_0x116f6f[_0x3f42('0x43')]);var _0x32c659={'where':_0x55f071['where']};return db[_0x3f42('0x2f')][_0x3f42('0x1f')](_0x32c659)[_0x3f42('0x25')](function(_0x3396b5){_0x355732['count']=_0x3396b5;if(_0x116f6f[_0x3f42('0x33')]['includeAll']){_0x55f071['include']=[{'all':!![]}];}return db[_0x3f42('0x2f')][_0x3f42('0x44')](_0x55f071);})[_0x3f42('0x25')](function(_0x17d4f2){_0x355732[_0x3f42('0x45')]=_0x17d4f2;return _0x355732;})[_0x3f42('0x25')](respondWithFilteredResult(_0x544b00,_0x55f071))[_0x3f42('0x46')](handleError(_0x544b00,null));};exports[_0x3f42('0x47')]=function(_0x3b0cd1,_0x463d02){var _0x505ee7={'raw':![],'where':{'id':_0x3b0cd1[_0x3f42('0x48')]['id']}},_0x2e7333={};_0x2e7333['model']=_[_0x3f42('0x49')](db['VoiceMusicOnHold'][_0x3f42('0x30')]);_0x2e7333[_0x3f42('0x33')]=_[_0x3f42('0x49')](_0x3b0cd1[_0x3f42('0x33')]);_0x2e7333[_0x3f42('0x3d')]=_[_0x3f42('0x34')](_0x2e7333[_0x3f42('0x35')],_0x2e7333['query']);_0x505ee7[_0x3f42('0x37')]=_[_0x3f42('0x34')](_0x2e7333[_0x3f42('0x35')],qs[_0x3f42('0x36')](_0x3b0cd1[_0x3f42('0x33')][_0x3f42('0x36')]));_0x505ee7[_0x3f42('0x37')]=_0x505ee7['attributes'][_0x3f42('0x38')]?_0x505ee7[_0x3f42('0x37')]:_0x2e7333['model'];if(_0x3b0cd1[_0x3f42('0x33')]['includeAll']){_0x505ee7[_0x3f42('0x4a')]=[{'all':!![]}];}_0x505ee7=_[_0x3f42('0x40')]({},_0x505ee7,_0x3b0cd1[_0x3f42('0x43')]);return db['VoiceMusicOnHold']['find'](_0x505ee7)[_0x3f42('0x25')](handleEntityNotFound(_0x463d02,null))['then'](respondWithResult(_0x463d02,null))[_0x3f42('0x46')](handleError(_0x463d02,null));};exports[_0x3f42('0x24')]=function(_0x4b64f9,_0x3f7898){if(_0x4b64f9[_0x3f42('0x4b')]['id']){delete _0x4b64f9['body']['id'];}return db[_0x3f42('0x2f')][_0x3f42('0x4c')]({'where':{'id':_0x4b64f9['params']['id']}})[_0x3f42('0x25')](handleEntityNotFound(_0x3f7898,null))[_0x3f42('0x25')](saveUpdates(_0x4b64f9[_0x3f42('0x4b')],null))[_0x3f42('0x25')](respondWithResult(_0x3f7898,null))['catch'](handleError(_0x3f7898,null));};exports[_0x3f42('0x4d')]=function(_0x579ba7,_0x5ecfcc,_0x2549af){return db['sequelize'][_0x3f42('0x4e')](function(_0x2729e3){if(_0x579ba7['body'][_0x3f42('0x4f')]==='files'){_0x579ba7[_0x3f42('0x4b')][_0x3f42('0x50')]=path['join'](config[_0x3f42('0x51')],_0x3f42('0x52'),_0x579ba7[_0x3f42('0x4b')]['name']);}return db[_0x3f42('0x2f')][_0x3f42('0x4d')](_0x579ba7[_0x3f42('0x4b')],{'transaction':_0x2729e3})[_0x3f42('0x25')](function(_0x3c0803){if(_0x579ba7[_0x3f42('0x4b')][_0x3f42('0x4f')]===_0x3f42('0x53')){fs[_0x3f42('0x54')](_0x3c0803[_0x3f42('0x50')],parseInt(_0x3f42('0x55'),0x8));}var _0x1022fc=_0x579ba7[_0x3f42('0x56')][_0x3f42('0x26')]({'plain':!![]});if(!_0x1022fc)throw new Error(_0x3f42('0x57'));if(_0x1022fc['role']==='user'){var _0x4b3db2=_0x3c0803[_0x3f42('0x26')]({'plain':!![]});return db[_0x3f42('0x58')][_0x3f42('0x4c')]({'where':{'name':_0x3f42('0x59'),'userProfileId':_0x1022fc[_0x3f42('0x5a')]},'raw':!![]})[_0x3f42('0x25')](function(_0x4b25b3){if(_0x4b25b3&&_0x4b25b3['autoAssociation']===0x0){return db[_0x3f42('0x27')][_0x3f42('0x4d')]({'name':_0x4b3db2[_0x3f42('0x2b')],'resourceId':_0x4b3db2['id'],'type':_0x4b25b3[_0x3f42('0x2b')],'sectionId':_0x4b25b3['id']},{})[_0x3f42('0x25')](function(){return _0x3c0803;});}else{return _0x3c0803;}})[_0x3f42('0x46')](function(_0x5cc84f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cc84f);});}return _0x3c0803;});})[_0x3f42('0x25')](respondWithResult(_0x5ecfcc,0xc9))[_0x3f42('0x46')](handleError(_0x5ecfcc,null));};exports[_0x3f42('0x5b')]=function(_0x1ceb7a,_0x2dc71a,_0x101e92){var _0x3cd04c;return db['VoiceMusicOnHold'][_0x3f42('0x4c')]({'where':{'id':_0x1ceb7a[_0x3f42('0x48')]['id']}})[_0x3f42('0x25')](function(_0x46d47d){if(_0x46d47d){return db[_0x3f42('0x5c')]['transaction'](function(_0x66b577){return _0x46d47d[_0x3f42('0x5b')]({'transaction':_0x66b577,'raw':!![]})[_0x3f42('0x25')](function(_0x234c13){if(_0x234c13[_0x3f42('0x50')]){fs['readdirSync'](_0x234c13['directory'])[_0x3f42('0x5d')](function(_0x6ab4f7){fs[_0x3f42('0x5e')](path[_0x3f42('0x5f')](_0x234c13['directory'],_0x6ab4f7));});fs[_0x3f42('0x60')](_0x234c13[_0x3f42('0x50')]);}return _0x234c13;});})[_0x3f42('0x46')](function(_0x3c700b){throw new db[(_0x3f42('0x61'))][(_0x3f42('0x62'))](_0x3c700b['message']);});}})[_0x3f42('0x25')](handleEntityNotFound(_0x2dc71a,null))[_0x3f42('0x25')](removeEntity(_0x2dc71a,null))['catch'](handleError(_0x2dc71a,null));};exports[_0x3f42('0x63')]=function(_0x1fe22b,_0x3dc7e4,_0x3ee27e){return db['sequelize'][_0x3f42('0x4e')](function(_0x17d800){var _0x419dc2;return db[_0x3f42('0x2f')][_0x3f42('0x4c')]({'where':{'id':_0x1fe22b['params']['id']}})['then'](function(_0x20eefe){if(_0x20eefe){_0x419dc2=_0x20eefe;return _0x20eefe[_0x3f42('0x63')](_0x1fe22b[_0x3f42('0x4b')]['id'],{'transaction':_0x17d800});}})[_0x3f42('0x25')](function(_0x582c88){if(_0x582c88){return db[_0x3f42('0x64')]['findOne']({'where':{'id':_0x1fe22b[_0x3f42('0x4b')]['id']},'attributes':['id',_0x3f42('0x2b'),'save_name',_0x3f42('0x65'),_0x3f42('0x66')],'raw':!![]});}})['then'](function(_0x2b74c0){if(_0x2b74c0){var _0x3b671d=path[_0x3f42('0x5f')](config['root'],'server/files/sounds/converted',util[_0x3f42('0x67')](_0x3f42('0x68'),path[_0x3f42('0x69')](_0x2b74c0[_0x3f42('0x6a')],path[_0x3f42('0x6b')](_0x2b74c0[_0x3f42('0x6a')])),_0x2b74c0[_0x3f42('0x65')]));var _0x25e9cb=path['join'](config[_0x3f42('0x51')],_0x3f42('0x52'),_0x419dc2[_0x3f42('0x2b')],util[_0x3f42('0x67')]('%s.%s',_0x2b74c0[_0x3f42('0x2b')],_0x2b74c0[_0x3f42('0x65')]));fs[_0x3f42('0x6c')](_0x3b671d,_0x25e9cb);return _0x2b74c0;}})[_0x3f42('0x46')](function(_0x570602){throw new db[(_0x3f42('0x61'))][(_0x3f42('0x62'))](_0x570602['message']);});})[_0x3f42('0x25')](handleEntityNotFound(_0x3dc7e4,null))[_0x3f42('0x25')](respondWithResult(_0x3dc7e4,0xc9))[_0x3f42('0x46')](handleError(_0x3dc7e4,null));};exports['removeSound']=function(_0x34d005,_0x268f3c,_0x44c1c9){return db['sequelize'][_0x3f42('0x4e')](function(_0x591d1f){var _0x23cf54;return db[_0x3f42('0x2f')][_0x3f42('0x6d')]({'where':{'id':_0x34d005[_0x3f42('0x48')]['id']}})['then'](handleEntityNotFound(_0x268f3c,null))[_0x3f42('0x25')](function(_0x404274){if(_0x404274){_0x23cf54=_0x404274;return _0x404274['removeSound'](_0x34d005[_0x3f42('0x48')][_0x3f42('0x6e')]);}})[_0x3f42('0x25')](function(_0x508c1c){if(_0x508c1c){return db['Sound'][_0x3f42('0x6d')]({'where':{'id':_0x34d005[_0x3f42('0x48')][_0x3f42('0x6e')]},'attributes':['id',_0x3f42('0x2b'),_0x3f42('0x6a'),_0x3f42('0x65'),_0x3f42('0x66')],'raw':!![]});}})[_0x3f42('0x25')](function(_0x15a206){if(_0x15a206){fs[_0x3f42('0x5e')](path['join'](_0x23cf54[_0x3f42('0x50')],util[_0x3f42('0x67')](_0x3f42('0x68'),_0x15a206[_0x3f42('0x2b')],_0x15a206[_0x3f42('0x65')])));return _0x15a206;}})[_0x3f42('0x46')](function(_0x12a5f6){throw new db[(_0x3f42('0x61'))][(_0x3f42('0x62'))](_0x12a5f6[_0x3f42('0x6f')]);});})[_0x3f42('0x25')](handleEntityNotFound(_0x268f3c,null))[_0x3f42('0x25')](respondWithStatusCode(_0x268f3c,0xcc))['catch'](handleError(_0x268f3c,null));};exports[_0x3f42('0x70')]=function(_0x26a241,_0x3a5207,_0x310482){var _0x3f2d2f={};var _0x41e5ae={};var _0x2822d3;var _0x5ec94e;return db[_0x3f42('0x2f')][_0x3f42('0x6d')]({'where':{'id':_0x26a241[_0x3f42('0x48')]['id']}})[_0x3f42('0x25')](handleEntityNotFound(_0x3a5207,null))[_0x3f42('0x25')](function(_0x1ca2bc){if(_0x1ca2bc){_0x2822d3=_0x1ca2bc;_0x41e5ae['model']=_['keys'](db[_0x3f42('0x64')][_0x3f42('0x30')]);_0x41e5ae['query']=_[_0x3f42('0x49')](_0x26a241[_0x3f42('0x33')]);_0x41e5ae['filters']=_[_0x3f42('0x34')](_0x41e5ae[_0x3f42('0x35')],_0x41e5ae[_0x3f42('0x33')]);_0x3f2d2f[_0x3f42('0x37')]=_[_0x3f42('0x34')](_0x41e5ae[_0x3f42('0x35')],qs[_0x3f42('0x36')](_0x26a241['query'][_0x3f42('0x36')]));_0x3f2d2f[_0x3f42('0x37')]=_0x3f2d2f[_0x3f42('0x37')][_0x3f42('0x38')]?_0x3f2d2f[_0x3f42('0x37')]:_0x41e5ae['model'];_0x3f2d2f[_0x3f42('0x3b')]=qs[_0x3f42('0x3c')](_0x26a241[_0x3f42('0x33')][_0x3f42('0x3c')]);_0x3f2d2f[_0x3f42('0x3f')]=qs[_0x3f42('0x3d')](_[_0x3f42('0x3e')](_0x26a241[_0x3f42('0x33')],_0x41e5ae['filters']));if(_0x26a241[_0x3f42('0x33')]['filter']){_0x3f2d2f[_0x3f42('0x3f')]=_[_0x3f42('0x40')](_0x3f2d2f[_0x3f42('0x3f')],{'$or':_[_0x3f42('0x2e')](_0x3f2d2f['attributes'],function(_0xa7a6ee){var _0x19c7be={};_0x19c7be[_0xa7a6ee]={'$like':'%'+_0x26a241['query']['filter']+'%'};return _0x19c7be;})});}_0x3f2d2f=_['merge']({},_0x3f2d2f,_0x26a241[_0x3f42('0x43')]);return _0x2822d3['getSounds'](_0x3f2d2f);}})[_0x3f42('0x25')](function(_0x102f6b){if(_0x102f6b){_0x5ec94e=_0x102f6b[_0x3f42('0x38')];if(!_0x26a241['query']['hasOwnProperty']('nolimit')){_0x3f2d2f['limit']=qs[_0x3f42('0x1e')](_0x26a241[_0x3f42('0x33')]['limit']);_0x3f2d2f['offset']=qs[_0x3f42('0x1c')](_0x26a241[_0x3f42('0x33')][_0x3f42('0x1c')]);}return _0x2822d3[_0x3f42('0x70')](_0x3f2d2f);}})[_0x3f42('0x25')](function(_0x4c362d){if(_0x4c362d){return _0x4c362d?{'count':_0x5ec94e,'rows':_0x4c362d}:null;}})[_0x3f42('0x25')](respondWithResult(_0x3a5207,null))['catch'](handleError(_0x3a5207,null));};
\ No newline at end of file
+var _0x017a=['query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','create','sequelize','files','server/files/moh','mode','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','join','directory','rmdirSync','ValidationError','message','addSound','findOne','save_name','createdAt','format','root','%s.%s','converted_format','symlinkSync','Sequelize','removeSound','id2','Sound','order','pick','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','end','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','model','keys','filters','intersection'];(function(_0x2856de,_0x468770){var _0x3018a9=function(_0x5f4c93){while(--_0x5f4c93){_0x2856de['push'](_0x2856de['shift']());}};_0x3018a9(++_0x468770);}(_0x017a,0xa9));var _0xa017=function(_0x4420a8,_0x478dc7){_0x4420a8=_0x4420a8-0x0;var _0x4598f1=_0x017a[_0x4420a8];return _0x4598f1;};'use strict';var emlformat=require(_0xa017('0x0'));var rimraf=require(_0xa017('0x1'));var zipdir=require(_0xa017('0x2'));var jsonpatch=require(_0xa017('0x3'));var rp=require('request-promise');var moment=require(_0xa017('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa017('0x5'));var util=require(_0xa017('0x6'));var path=require(_0xa017('0x7'));var sox=require('sox');var csv=require(_0xa017('0x8'));var ejs=require(_0xa017('0x9'));var fs=require('fs');var fs_extra=require(_0xa017('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa017('0xb'));var deskjs=require(_0xa017('0xc'));var toCsv=require(_0xa017('0x8'));var querystring=require(_0xa017('0xd'));var Papa=require(_0xa017('0xe'));var Redis=require(_0xa017('0xf'));var authService=require(_0xa017('0x10'));var qs=require(_0xa017('0x11'));var as=require(_0xa017('0x12'));var hardwareService=require(_0xa017('0x13'));var logger=require(_0xa017('0x14'))(_0xa017('0x15'));var utils=require(_0xa017('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa017('0x17'));var db=require(_0xa017('0x18'))['db'];function respondWithStatusCode(_0x33e7dc,_0x1da192){_0x1da192=_0x1da192||0xcc;return function(_0x5cfad9){if(_0x5cfad9){return _0x33e7dc[_0xa017('0x19')](_0x1da192);}return _0x33e7dc[_0xa017('0x1a')](_0x1da192)['end']();};}function respondWithResult(_0x1a873c,_0x32f69a){_0x32f69a=_0x32f69a||0xc8;return function(_0x318d60){if(_0x318d60){return _0x1a873c[_0xa017('0x1a')](_0x32f69a)[_0xa017('0x1b')](_0x318d60);}};}function respondWithFilteredResult(_0x40cd56,_0x516873){return function(_0x5d03c6){if(_0x5d03c6){var _0x266330=typeof _0x516873[_0xa017('0x1c')]===_0xa017('0x1d')&&typeof _0x516873[_0xa017('0x1e')]===_0xa017('0x1d');var _0x508971=_0x5d03c6['count'];var _0x876c13=_0x266330?0x0:_0x516873[_0xa017('0x1c')];var _0x578034=_0x266330?_0x5d03c6[_0xa017('0x1f')]:_0x516873[_0xa017('0x1c')]+_0x516873[_0xa017('0x1e')];var _0x599bb3;if(_0x578034>=_0x508971){_0x578034=_0x508971;_0x599bb3=0xc8;}else{_0x599bb3=0xce;}_0x40cd56[_0xa017('0x1a')](_0x599bb3);return _0x40cd56[_0xa017('0x20')](_0xa017('0x21'),_0x876c13+'-'+_0x578034+'/'+_0x508971)[_0xa017('0x1b')](_0x5d03c6);}return null;};}function patchUpdates(_0x30fbea){return function(_0x13c597){try{jsonpatch['apply'](_0x13c597,_0x30fbea,!![]);}catch(_0x220537){return BPromise['reject'](_0x220537);}return _0x13c597[_0xa017('0x22')]();};}function saveUpdates(_0x46be0b,_0x2d8e45){return function(_0x1a6028){if(_0x1a6028){return _0x1a6028[_0xa017('0x23')](_0x46be0b)[_0xa017('0x24')](function(_0x236987){return _0x236987;});}return null;};}function removeEntity(_0x4d0988,_0x2d3dab){return function(_0x16d75f){if(_0x16d75f){return _0x16d75f['destroy']()[_0xa017('0x24')](function(){var _0x591c8d=_0x16d75f[_0xa017('0x25')]({'plain':!![]});var _0x57659f=_0xa017('0x26');return db[_0xa017('0x27')][_0xa017('0x28')]({'where':{'type':_0x57659f,'resourceId':_0x591c8d['id']}})[_0xa017('0x24')](function(){return _0x16d75f;});})[_0xa017('0x24')](function(){_0x4d0988[_0xa017('0x1a')](0xcc)[_0xa017('0x29')]();});}};}function handleEntityNotFound(_0x38853d,_0x35e3fa){return function(_0x1df908){if(!_0x1df908){_0x38853d[_0xa017('0x19')](0x194);}return _0x1df908;};}function handleError(_0xe90e42,_0x3f5dc){_0x3f5dc=_0x3f5dc||0x1f4;return function(_0x200135){logger['error'](_0x200135[_0xa017('0x2a')]);if(_0x200135['name']){delete _0x200135[_0xa017('0x2b')];}_0xe90e42[_0xa017('0x1a')](_0x3f5dc)[_0xa017('0x2c')](_0x200135);};}exports['index']=function(_0x4b3c27,_0x935f0b){var _0x17428a={},_0x2461cc={},_0x376ef1={'count':0x0,'rows':[]};var _0x3bcf70=_[_0xa017('0x2d')](db[_0xa017('0x2e')][_0xa017('0x2f')],function(_0x3d6f5b){return{'name':_0x3d6f5b[_0xa017('0x30')],'type':_0x3d6f5b['type']['key']};});_0x2461cc[_0xa017('0x31')]=_['map'](_0x3bcf70,_0xa017('0x2b'));_0x2461cc['query']=_[_0xa017('0x32')](_0x4b3c27['query']);_0x2461cc[_0xa017('0x33')]=_[_0xa017('0x34')](_0x2461cc['model'],_0x2461cc[_0xa017('0x35')]);_0x17428a[_0xa017('0x36')]=_['intersection'](_0x2461cc[_0xa017('0x31')],qs[_0xa017('0x37')](_0x4b3c27[_0xa017('0x35')][_0xa017('0x37')]));_0x17428a[_0xa017('0x36')]=_0x17428a[_0xa017('0x36')][_0xa017('0x38')]?_0x17428a[_0xa017('0x36')]:_0x2461cc[_0xa017('0x31')];if(!_0x4b3c27[_0xa017('0x35')][_0xa017('0x39')](_0xa017('0x3a'))){_0x17428a['limit']=qs[_0xa017('0x1e')](_0x4b3c27[_0xa017('0x35')][_0xa017('0x1e')]);_0x17428a[_0xa017('0x1c')]=qs[_0xa017('0x1c')](_0x4b3c27[_0xa017('0x35')][_0xa017('0x1c')]);}_0x17428a['order']=qs['sort'](_0x4b3c27[_0xa017('0x35')][_0xa017('0x3b')]);delete _0x4b3c27[_0xa017('0x35')][_0xa017('0x3b')];_0x17428a[_0xa017('0x3c')]=qs[_0xa017('0x33')](_['pick'](_0x4b3c27[_0xa017('0x35')],_0x2461cc[_0xa017('0x33')]),_0x3bcf70);if(_0x4b3c27[_0xa017('0x35')]['filter']){_0x17428a['where']=_[_0xa017('0x3d')](_0x17428a[_0xa017('0x3c')],{'$or':_[_0xa017('0x2d')](_0x3bcf70,function(_0x12d673){if(_0x12d673[_0xa017('0x3e')]!==_0xa017('0x3f')){var _0x55e7b9={};_0x55e7b9[_0x12d673[_0xa017('0x2b')]]={'$like':'%'+_0x4b3c27['query'][_0xa017('0x40')]+'%'};return _0x55e7b9;}})});}_0x17428a=_[_0xa017('0x3d')]({},_0x17428a,_0x4b3c27[_0xa017('0x41')]);var _0x19653a={'where':_0x17428a[_0xa017('0x3c')]};return db[_0xa017('0x2e')][_0xa017('0x1f')](_0x19653a)[_0xa017('0x24')](function(_0x184229){_0x376ef1[_0xa017('0x1f')]=_0x184229;if(_0x4b3c27[_0xa017('0x35')][_0xa017('0x42')]){_0x17428a[_0xa017('0x43')]=[{'all':!![]}];}return db[_0xa017('0x2e')][_0xa017('0x44')](_0x17428a);})[_0xa017('0x24')](function(_0x3816c0){_0x376ef1[_0xa017('0x45')]=_0x3816c0;return _0x376ef1;})[_0xa017('0x24')](respondWithFilteredResult(_0x935f0b,_0x17428a))[_0xa017('0x46')](handleError(_0x935f0b,null));};exports[_0xa017('0x47')]=function(_0x3ba88e,_0x5b47a2){var _0xeb5595={'raw':![],'where':{'id':_0x3ba88e['params']['id']}},_0x277378={};_0x277378[_0xa017('0x31')]=_[_0xa017('0x32')](db[_0xa017('0x2e')][_0xa017('0x2f')]);_0x277378[_0xa017('0x35')]=_[_0xa017('0x32')](_0x3ba88e[_0xa017('0x35')]);_0x277378[_0xa017('0x33')]=_[_0xa017('0x34')](_0x277378['model'],_0x277378[_0xa017('0x35')]);_0xeb5595[_0xa017('0x36')]=_['intersection'](_0x277378['model'],qs[_0xa017('0x37')](_0x3ba88e[_0xa017('0x35')][_0xa017('0x37')]));_0xeb5595[_0xa017('0x36')]=_0xeb5595[_0xa017('0x36')][_0xa017('0x38')]?_0xeb5595['attributes']:_0x277378[_0xa017('0x31')];if(_0x3ba88e[_0xa017('0x35')][_0xa017('0x42')]){_0xeb5595[_0xa017('0x43')]=[{'all':!![]}];}_0xeb5595=_[_0xa017('0x3d')]({},_0xeb5595,_0x3ba88e[_0xa017('0x41')]);return db[_0xa017('0x2e')][_0xa017('0x48')](_0xeb5595)[_0xa017('0x24')](handleEntityNotFound(_0x5b47a2,null))[_0xa017('0x24')](respondWithResult(_0x5b47a2,null))[_0xa017('0x46')](handleError(_0x5b47a2,null));};exports[_0xa017('0x23')]=function(_0x57f3ae,_0xf007f1){if(_0x57f3ae[_0xa017('0x49')]['id']){delete _0x57f3ae['body']['id'];}return db['VoiceMusicOnHold'][_0xa017('0x48')]({'where':{'id':_0x57f3ae[_0xa017('0x4a')]['id']}})['then'](handleEntityNotFound(_0xf007f1,null))[_0xa017('0x24')](saveUpdates(_0x57f3ae[_0xa017('0x49')],null))[_0xa017('0x24')](respondWithResult(_0xf007f1,null))[_0xa017('0x46')](handleError(_0xf007f1,null));};exports[_0xa017('0x4b')]=function(_0x178ac4,_0x127faf,_0x424804){return db[_0xa017('0x4c')]['transaction'](function(_0x4762a2){if(_0x178ac4[_0xa017('0x49')]['mode']===_0xa017('0x4d')){_0x178ac4[_0xa017('0x49')]['directory']=path['join'](config['root'],_0xa017('0x4e'),_0x178ac4[_0xa017('0x49')][_0xa017('0x2b')]);}return db[_0xa017('0x2e')][_0xa017('0x4b')](_0x178ac4[_0xa017('0x49')],{'transaction':_0x4762a2})[_0xa017('0x24')](function(_0xa61d95){if(_0x178ac4[_0xa017('0x49')][_0xa017('0x4f')]===_0xa017('0x4d')){fs[_0xa017('0x50')](_0xa61d95['directory'],parseInt(_0xa017('0x51'),0x8));}var _0x547f44=_0x178ac4[_0xa017('0x52')][_0xa017('0x25')]({'plain':!![]});if(!_0x547f44)throw new Error(_0xa017('0x53'));if(_0x547f44['role']==='user'){var _0x2c65f2=_0xa61d95[_0xa017('0x25')]({'plain':!![]});return db[_0xa017('0x54')][_0xa017('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x547f44[_0xa017('0x55')]},'raw':!![]})[_0xa017('0x24')](function(_0x4fa8dc){if(_0x4fa8dc&&_0x4fa8dc[_0xa017('0x56')]===0x0){return db[_0xa017('0x27')][_0xa017('0x4b')]({'name':_0x2c65f2[_0xa017('0x2b')],'resourceId':_0x2c65f2['id'],'type':_0x4fa8dc['name'],'sectionId':_0x4fa8dc['id']},{})[_0xa017('0x24')](function(){return _0xa61d95;});}else{return _0xa61d95;}})[_0xa017('0x46')](function(_0x16af17){logger['error'](_0xa017('0x57'),_0x16af17);});}return _0xa61d95;});})['then'](respondWithResult(_0x127faf,0xc9))[_0xa017('0x46')](handleError(_0x127faf,null));};exports['destroy']=function(_0x500596,_0x4913b3,_0x598875){var _0x3d8ffd;return db[_0xa017('0x2e')][_0xa017('0x48')]({'where':{'id':_0x500596[_0xa017('0x4a')]['id']}})[_0xa017('0x24')](function(_0x32795e){if(_0x32795e){return db[_0xa017('0x4c')][_0xa017('0x58')](function(_0x2265c9){return _0x32795e['destroy']({'transaction':_0x2265c9,'raw':!![]})[_0xa017('0x24')](function(_0x3b3604){if(_0x3b3604['directory']){fs[_0xa017('0x59')](_0x3b3604['directory'])['forEach'](function(_0x569f4a){fs['unlinkSync'](path[_0xa017('0x5a')](_0x3b3604[_0xa017('0x5b')],_0x569f4a));});fs[_0xa017('0x5c')](_0x3b3604['directory']);}return _0x3b3604;});})[_0xa017('0x46')](function(_0x4f8ce6){throw new db['Sequelize'][(_0xa017('0x5d'))](_0x4f8ce6[_0xa017('0x5e')]);});}})[_0xa017('0x24')](handleEntityNotFound(_0x4913b3,null))[_0xa017('0x24')](removeEntity(_0x4913b3,null))[_0xa017('0x46')](handleError(_0x4913b3,null));};exports[_0xa017('0x5f')]=function(_0x1fcaab,_0x591577,_0x2ca884){return db[_0xa017('0x4c')][_0xa017('0x58')](function(_0xcc1b96){var _0x5c1662;return db[_0xa017('0x2e')]['find']({'where':{'id':_0x1fcaab[_0xa017('0x4a')]['id']}})[_0xa017('0x24')](function(_0x62c261){if(_0x62c261){_0x5c1662=_0x62c261;return _0x62c261['addSound'](_0x1fcaab[_0xa017('0x49')]['id'],{'transaction':_0xcc1b96});}})[_0xa017('0x24')](function(_0x551520){if(_0x551520){return db['Sound'][_0xa017('0x60')]({'where':{'id':_0x1fcaab['body']['id']},'attributes':['id',_0xa017('0x2b'),_0xa017('0x61'),'converted_format',_0xa017('0x62')],'raw':!![]});}})[_0xa017('0x24')](function(_0x5a1322){if(_0x5a1322){var _0x24358e=path['join'](config['root'],'server/files/sounds/converted',util[_0xa017('0x63')]('%s.%s',path['basename'](_0x5a1322[_0xa017('0x61')],path['extname'](_0x5a1322[_0xa017('0x61')])),_0x5a1322['converted_format']));var _0xeb6f27=path['join'](config[_0xa017('0x64')],_0xa017('0x4e'),_0x5c1662[_0xa017('0x2b')],util['format'](_0xa017('0x65'),_0x5a1322[_0xa017('0x2b')],_0x5a1322[_0xa017('0x66')]));fs[_0xa017('0x67')](_0x24358e,_0xeb6f27);return _0x5a1322;}})[_0xa017('0x46')](function(_0x4ba949){throw new db[(_0xa017('0x68'))][(_0xa017('0x5d'))](_0x4ba949[_0xa017('0x5e')]);});})[_0xa017('0x24')](handleEntityNotFound(_0x591577,null))[_0xa017('0x24')](respondWithResult(_0x591577,0xc9))[_0xa017('0x46')](handleError(_0x591577,null));};exports[_0xa017('0x69')]=function(_0x4e650b,_0x39bc11,_0xaab89){return db[_0xa017('0x4c')]['transaction'](function(_0x2abce8){var _0x44ce69;return db[_0xa017('0x2e')]['findOne']({'where':{'id':_0x4e650b[_0xa017('0x4a')]['id']}})[_0xa017('0x24')](handleEntityNotFound(_0x39bc11,null))['then'](function(_0x32d291){if(_0x32d291){_0x44ce69=_0x32d291;return _0x32d291[_0xa017('0x69')](_0x4e650b[_0xa017('0x4a')][_0xa017('0x6a')]);}})[_0xa017('0x24')](function(_0x260f63){if(_0x260f63){return db['Sound']['findOne']({'where':{'id':_0x4e650b['params'][_0xa017('0x6a')]},'attributes':['id',_0xa017('0x2b'),'save_name',_0xa017('0x66'),'createdAt'],'raw':!![]});}})['then'](function(_0x330902){if(_0x330902){fs['unlinkSync'](path[_0xa017('0x5a')](_0x44ce69['directory'],util[_0xa017('0x63')](_0xa017('0x65'),_0x330902[_0xa017('0x2b')],_0x330902['converted_format'])));return _0x330902;}})[_0xa017('0x46')](function(_0xb0c603){throw new db[(_0xa017('0x68'))][(_0xa017('0x5d'))](_0xb0c603[_0xa017('0x5e')]);});})['then'](handleEntityNotFound(_0x39bc11,null))[_0xa017('0x24')](respondWithStatusCode(_0x39bc11,0xcc))['catch'](handleError(_0x39bc11,null));};exports['getSounds']=function(_0x5d145b,_0xb0a4b2,_0x6bcbc0){var _0x44841b={};var _0x49d334={};var _0x12da44;var _0xf4ba19;return db[_0xa017('0x2e')]['findOne']({'where':{'id':_0x5d145b[_0xa017('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb0a4b2,null))[_0xa017('0x24')](function(_0x6987fc){if(_0x6987fc){_0x12da44=_0x6987fc;_0x49d334[_0xa017('0x31')]=_['keys'](db[_0xa017('0x6b')]['rawAttributes']);_0x49d334[_0xa017('0x35')]=_['keys'](_0x5d145b[_0xa017('0x35')]);_0x49d334[_0xa017('0x33')]=_[_0xa017('0x34')](_0x49d334[_0xa017('0x31')],_0x49d334[_0xa017('0x35')]);_0x44841b[_0xa017('0x36')]=_['intersection'](_0x49d334[_0xa017('0x31')],qs['fields'](_0x5d145b[_0xa017('0x35')]['fields']));_0x44841b[_0xa017('0x36')]=_0x44841b['attributes'][_0xa017('0x38')]?_0x44841b['attributes']:_0x49d334[_0xa017('0x31')];_0x44841b[_0xa017('0x6c')]=qs[_0xa017('0x3b')](_0x5d145b[_0xa017('0x35')]['sort']);_0x44841b[_0xa017('0x3c')]=qs['filters'](_[_0xa017('0x6d')](_0x5d145b[_0xa017('0x35')],_0x49d334[_0xa017('0x33')]));if(_0x5d145b[_0xa017('0x35')][_0xa017('0x40')]){_0x44841b['where']=_['merge'](_0x44841b['where'],{'$or':_[_0xa017('0x2d')](_0x44841b[_0xa017('0x36')],function(_0x5f51c8){var _0x5a4a8d={};_0x5a4a8d[_0x5f51c8]={'$like':'%'+_0x5d145b[_0xa017('0x35')]['filter']+'%'};return _0x5a4a8d;})});}_0x44841b=_[_0xa017('0x3d')]({},_0x44841b,_0x5d145b[_0xa017('0x41')]);return _0x12da44[_0xa017('0x6e')](_0x44841b);}})[_0xa017('0x24')](function(_0x130c7f){if(_0x130c7f){_0xf4ba19=_0x130c7f[_0xa017('0x38')];if(!_0x5d145b[_0xa017('0x35')]['hasOwnProperty'](_0xa017('0x3a'))){_0x44841b[_0xa017('0x1e')]=qs['limit'](_0x5d145b[_0xa017('0x35')][_0xa017('0x1e')]);_0x44841b[_0xa017('0x1c')]=qs['offset'](_0x5d145b[_0xa017('0x35')]['offset']);}return _0x12da44[_0xa017('0x6e')](_0x44841b);}})['then'](function(_0x93bf41){if(_0x93bf41){return _0x93bf41?{'count':_0xf4ba19,'rows':_0x93bf41}:null;}})[_0xa017('0x24')](respondWithResult(_0xb0a4b2,null))[_0xa017('0x46')](handleError(_0xb0a4b2,null));};
\ No newline at end of file
index 331169b..75182d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3fc=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','lodash','util','../../config/logger'];(function(_0x55d61d,_0x240720){var _0x32f539=function(_0x56543d){while(--_0x56543d){_0x55d61d['push'](_0x55d61d['shift']());}};_0x32f539(++_0x240720);}(_0xb3fc,0x69));var _0xcb3f=function(_0x5dcc04,_0x45c416){_0x5dcc04=_0x5dcc04-0x0;var _0x451853=_0xb3fc[_0x5dcc04];return _0x451853;};'use strict';var _=require(_0xcb3f('0x0'));var util=require(_0xcb3f('0x1'));var logger=require(_0xcb3f('0x2'))(_0xcb3f('0x3'));var moment=require(_0xcb3f('0x4'));var BPromise=require(_0xcb3f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb3f('0x6'));var rimraf=require(_0xcb3f('0x7'));var config=require(_0xcb3f('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xcb3f('0x9')]=function(_0x1ecd13,_0x1d6321){return _0x1ecd13[_0xcb3f('0xa')](_0xcb3f('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a69=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0x9f27a3,_0x3716d9){var _0x1e712e=function(_0x5cb75a){while(--_0x5cb75a){_0x9f27a3['push'](_0x9f27a3['shift']());}};_0x1e712e(++_0x3716d9);}(_0x8a69,0xb4));var _0x98a6=function(_0x4ee057,_0x1061f2){_0x4ee057=_0x4ee057-0x0;var _0x225599=_0x8a69[_0x4ee057];return _0x225599;};'use strict';var _=require(_0x98a6('0x0'));var util=require(_0x98a6('0x1'));var logger=require(_0x98a6('0x2'))(_0x98a6('0x3'));var moment=require(_0x98a6('0x4'));var BPromise=require(_0x98a6('0x5'));var rp=require(_0x98a6('0x6'));var fs=require('fs');var path=require(_0x98a6('0x7'));var rimraf=require(_0x98a6('0x8'));var config=require('../../config/environment');var attributes=require(_0x98a6('0x9'));module['exports']=function(_0x1875f9,_0xdd98a4){return _0x1875f9[_0x98a6('0xa')](_0x98a6('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5de15a4..5e66e31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x1b9a29,_0x1ce5c6){var _0x6b2b27=function(_0x453ceb){while(--_0x453ceb){_0x1b9a29['push'](_0x1b9a29['shift']());}};_0x6b2b27(++_0x1ce5c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x3e5bb0,_0x2091d7){var _0x5f28c7=function(_0xb30a85){while(--_0xb30a85){_0x3e5bb0['push'](_0x3e5bb0['shift']());}};_0x5f28c7(++_0x2091d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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
index 922d787..5d7cd7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8de=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','index','isAuthenticated','describe','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','put','/:id','update','destroy','delete','removeTeams','exports'];(function(_0x5c1197,_0x3731f7){var _0x5aed99=function(_0x1f6d77){while(--_0x1f6d77){_0x5c1197['push'](_0x5c1197['shift']());}};_0x5aed99(++_0x3731f7);}(_0xf8de,0x1d4));var _0xef8d=function(_0x283541,_0x568805){_0x283541=_0x283541-0x0;var _0x5b7862=_0xf8de[_0x283541];return _0x5b7862;};'use strict';var multer=require('multer');var util=require(_0xef8d('0x0'));var path=require(_0xef8d('0x1'));var timeout=require('connect-timeout');var express=require(_0xef8d('0x2'));var router=express['Router']();var fs_extra=require(_0xef8d('0x3'));var auth=require(_0xef8d('0x4'));var interaction=require(_0xef8d('0x5'));var config=require('../../config/environment');var controller=require(_0xef8d('0x6'));router[_0xef8d('0x7')]('/',auth['isAuthenticated'](),controller[_0xef8d('0x8')]);router['get']('/describe',auth[_0xef8d('0x9')](),controller[_0xef8d('0xa')]);router[_0xef8d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xef8d('0xb')]);router[_0xef8d('0x7')](_0xef8d('0xc'),auth[_0xef8d('0x9')](),controller[_0xef8d('0xd')]);router[_0xef8d('0x7')](_0xef8d('0xe'),auth[_0xef8d('0x9')](),controller[_0xef8d('0xf')]);router[_0xef8d('0x10')]('/',auth[_0xef8d('0x9')](),controller[_0xef8d('0x11')]);router[_0xef8d('0x10')](_0xef8d('0xc'),auth[_0xef8d('0x9')](),controller[_0xef8d('0x12')]);router['post']('/:id/teams',auth[_0xef8d('0x9')](),controller['addTeams']);router[_0xef8d('0x13')](_0xef8d('0x14'),auth[_0xef8d('0x9')](),controller[_0xef8d('0x15')]);router['delete']('/:id',auth[_0xef8d('0x9')](),controller[_0xef8d('0x16')]);router[_0xef8d('0x17')](_0xef8d('0xc'),auth[_0xef8d('0x9')](),controller['removeAgents']);router[_0xef8d('0x17')](_0xef8d('0xe'),auth[_0xef8d('0x9')](),controller[_0xef8d('0x18')]);module[_0xef8d('0x19')]=router;
\ No newline at end of file
+var _0xf4e5=['/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','update','destroy','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get'];(function(_0x3fe1d7,_0x59960b){var _0x451f4b=function(_0x37277c){while(--_0x37277c){_0x3fe1d7['push'](_0x3fe1d7['shift']());}};_0x451f4b(++_0x59960b);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x510174,_0x393e13){_0x510174=_0x510174-0x0;var _0x55eb9d=_0xf4e5[_0x510174];return _0x55eb9d;};'use strict';var multer=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var path=require(_0x5f4e('0x2'));var timeout=require(_0x5f4e('0x3'));var express=require(_0x5f4e('0x4'));var router=express[_0x5f4e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5f4e('0x6'));var config=require(_0x5f4e('0x7'));var controller=require(_0x5f4e('0x8'));router['get']('/',auth[_0x5f4e('0x9')](),controller[_0x5f4e('0xa')]);router[_0x5f4e('0xb')](_0x5f4e('0xc'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0xd')]);router[_0x5f4e('0xb')](_0x5f4e('0xe'),auth[_0x5f4e('0x9')](),controller['show']);router['get'](_0x5f4e('0xf'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x10')]);router['get'](_0x5f4e('0x11'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x12')]);router[_0x5f4e('0x13')]('/',auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x14')]);router[_0x5f4e('0x13')](_0x5f4e('0xf'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x15')]);router[_0x5f4e('0x13')]('/:id/teams',auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x16')]);router['put'](_0x5f4e('0xe'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x17')]);router['delete'](_0x5f4e('0xe'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x18')]);router['delete'](_0x5f4e('0xf'),auth[_0x5f4e('0x9')](),controller['removeAgents']);router[_0x5f4e('0x19')](_0x5f4e('0x11'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x1a')]);module[_0x5f4e('0x1b')]=router;
\ No newline at end of file
index 71f4a7f..493fa24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x680c=['STRING','INTEGER','sequelize','name','system-','getDataValue'];(function(_0x7c48df,_0x50a697){var _0xe5a4e6=function(_0x2b01df){while(--_0x2b01df){_0x7c48df['push'](_0x7c48df['shift']());}};_0xe5a4e6(++_0x50a697);}(_0x680c,0x74));var _0xc680=function(_0x3dcab,_0x58860f){_0x3dcab=_0x3dcab-0x0;var _0x517c6a=_0x680c[_0x3dcab];return _0x517c6a;};'use strict';var Sequelize=require(_0xc680('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc680('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5beb3f){return _0xc680('0x2')+this[_0xc680('0x3')](_0xc680('0x1'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xc680('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0xc680('0x5')]}};
\ No newline at end of file
+var _0x143c=['STRING','name','VIRTUAL','system-','INTEGER','exports'];(function(_0xe1912c,_0x4a8e7b){var _0xdd75b0=function(_0x3c6280){while(--_0x3c6280){_0xe1912c['push'](_0xe1912c['shift']());}};_0xdd75b0(++_0x4a8e7b);}(_0x143c,0x6b));var _0xc143=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x143c[_0x26f702];return _0x11417d;};'use strict';var Sequelize=require('sequelize');module[_0xc143('0x0')]={'name':{'type':Sequelize[_0xc143('0x1')],'allowNull':![],'unique':_0xc143('0x2')},'prefix':{'type':Sequelize[_0xc143('0x3')],'get':function(_0x43c3d3){return _0xc143('0x4')+this['getDataValue'](_0xc143('0x2'))+'-';}},'description':{'type':Sequelize[_0xc143('0x1')]},'callerIdAll':{'type':Sequelize[_0xc143('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xc143('0x5')]}};
\ No newline at end of file
index 5d4c98d..4c24cec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3266=['index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','emit','userVoicePrefix:save','ids','removeAgents','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','getTeams','Team','interface','Agents','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x4c06ac,_0x568788){var _0x2333cb=function(_0xdb5c64){while(--_0xdb5c64){_0x4c06ac['push'](_0x4c06ac['shift']());}};_0x2333cb(++_0x568788);}(_0x3266,0x6a));var _0x6326=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x3266[_0x3aaf0a];return _0x33e6bc;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];config[_0x6326('0x1c')]=_['defaults'](config['redis'],{'host':_0x6326('0x1d'),'port':0x18eb});var socket=require(_0x6326('0x1e'))(new Redis(config['redis']));require(_0x6326('0x1f'))['register'](socket);function respondWithStatusCode(_0x2d2d9b,_0x20dcc6){_0x20dcc6=_0x20dcc6||0xcc;return function(_0x3d6ac0){if(_0x3d6ac0){return _0x2d2d9b[_0x6326('0x20')](_0x20dcc6);}return _0x2d2d9b[_0x6326('0x21')](_0x20dcc6)[_0x6326('0x22')]();};}function respondWithResult(_0x55923a,_0x1104c5){_0x1104c5=_0x1104c5||0xc8;return function(_0x518e6f){if(_0x518e6f){return _0x55923a['status'](_0x1104c5)['json'](_0x518e6f);}};}function respondWithFilteredResult(_0x51e7b9,_0x5d402d){return function(_0x58e960){if(_0x58e960){var _0xdf5ced=typeof _0x5d402d[_0x6326('0x23')]===_0x6326('0x24')&&typeof _0x5d402d['limit']==='undefined';var _0x954ed5=_0x58e960[_0x6326('0x25')];var _0x272b5c=_0xdf5ced?0x0:_0x5d402d[_0x6326('0x23')];var _0x3c08db=_0xdf5ced?_0x58e960[_0x6326('0x25')]:_0x5d402d[_0x6326('0x23')]+_0x5d402d['limit'];var _0x22307f;if(_0x3c08db>=_0x954ed5){_0x3c08db=_0x954ed5;_0x22307f=0xc8;}else{_0x22307f=0xce;}_0x51e7b9['status'](_0x22307f);return _0x51e7b9[_0x6326('0x26')](_0x6326('0x27'),_0x272b5c+'-'+_0x3c08db+'/'+_0x954ed5)[_0x6326('0x28')](_0x58e960);}return null;};}function patchUpdates(_0x24fb78){return function(_0x43cdfc){try{jsonpatch[_0x6326('0x29')](_0x43cdfc,_0x24fb78,!![]);}catch(_0x225555){return BPromise[_0x6326('0x2a')](_0x225555);}return _0x43cdfc[_0x6326('0x2b')]();};}function saveUpdates(_0x2d0d00,_0x34954b){return function(_0x4933e1){if(_0x4933e1){return _0x4933e1[_0x6326('0x2c')](_0x2d0d00)[_0x6326('0x2d')](function(_0x575701){return _0x575701;});}return null;};}function removeEntity(_0x4e272b,_0x4d28fd){return function(_0x405474){if(_0x405474){return _0x405474['destroy']()[_0x6326('0x2d')](function(){var _0x1a48da=_0x405474['get']({'plain':!![]});var _0x15e33d=_0x6326('0x2e');return db[_0x6326('0x2f')][_0x6326('0x30')]({'where':{'type':_0x15e33d,'resourceId':_0x1a48da['id']}})[_0x6326('0x2d')](function(){return _0x405474;});})[_0x6326('0x2d')](function(){_0x4e272b[_0x6326('0x21')](0xcc)[_0x6326('0x22')]();});}};}function handleEntityNotFound(_0x461e0f,_0x127744){return function(_0x4980f6){if(!_0x4980f6){_0x461e0f[_0x6326('0x20')](0x194);}return _0x4980f6;};}function handleError(_0x331772,_0x134524){_0x134524=_0x134524||0x1f4;return function(_0x2e0445){logger[_0x6326('0x31')](_0x2e0445['stack']);if(_0x2e0445[_0x6326('0x32')]){delete _0x2e0445[_0x6326('0x32')];}_0x331772[_0x6326('0x21')](_0x134524)['send'](_0x2e0445);};}exports[_0x6326('0x33')]=function(_0x4d7807,_0x4e703a){var _0xfb6b62={},_0x7ac8d9={},_0x160a12={'count':0x0,'rows':[]};var _0x103b1c=_[_0x6326('0x34')](db[_0x6326('0x35')][_0x6326('0x36')],function(_0x46c803){return{'name':_0x46c803[_0x6326('0x37')],'type':_0x46c803[_0x6326('0x38')][_0x6326('0x39')]};});_0x7ac8d9[_0x6326('0x3a')]=_['map'](_0x103b1c,_0x6326('0x32'));_0x7ac8d9[_0x6326('0x3b')]=_['keys'](_0x4d7807[_0x6326('0x3b')]);_0x7ac8d9[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x7ac8d9['model'],_0x7ac8d9[_0x6326('0x3b')]);_0xfb6b62['attributes']=_['intersection'](_0x7ac8d9[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x4d7807[_0x6326('0x3b')]['fields']));_0xfb6b62[_0x6326('0x3f')]=_0xfb6b62['attributes'][_0x6326('0x40')]?_0xfb6b62['attributes']:_0x7ac8d9[_0x6326('0x3a')];if(!_0x4d7807[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0xfb6b62[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x4d7807['query'][_0x6326('0x43')]);_0xfb6b62[_0x6326('0x23')]=qs['offset'](_0x4d7807[_0x6326('0x3b')]['offset']);}_0xfb6b62['order']=qs[_0x6326('0x44')](_0x4d7807[_0x6326('0x3b')][_0x6326('0x44')]);_0xfb6b62[_0x6326('0x45')]=qs[_0x6326('0x3c')](_[_0x6326('0x46')](_0x4d7807['query'],_0x7ac8d9['filters']),_0x103b1c);if(_0x4d7807[_0x6326('0x3b')]['filter']){_0xfb6b62[_0x6326('0x45')]=_['merge'](_0xfb6b62[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x103b1c,function(_0x335feb){if(_0x335feb[_0x6326('0x38')]!==_0x6326('0x47')){var _0x1b754d={};_0x1b754d[_0x335feb[_0x6326('0x32')]]={'$like':'%'+_0x4d7807[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x1b754d;}})});}_0xfb6b62=_[_0x6326('0x49')]({},_0xfb6b62,_0x4d7807[_0x6326('0x4a')]);var _0x5d36b1={'where':_0xfb6b62[_0x6326('0x45')]};return db['VoicePrefix'][_0x6326('0x25')](_0x5d36b1)[_0x6326('0x2d')](function(_0x16fc33){_0x160a12[_0x6326('0x25')]=_0x16fc33;if(_0x4d7807['query'][_0x6326('0x4b')]){_0xfb6b62[_0x6326('0x4c')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6326('0x4d')](_0xfb6b62);})[_0x6326('0x2d')](function(_0x7a5057){_0x160a12[_0x6326('0x4e')]=_0x7a5057;return _0x160a12;})['then'](respondWithFilteredResult(_0x4e703a,_0xfb6b62))[_0x6326('0x4f')](handleError(_0x4e703a,null));};exports[_0x6326('0x50')]=function(_0x231e15,_0x28504f){var _0x44d852={'raw':![],'where':{'id':_0x231e15[_0x6326('0x51')]['id']}},_0x165953={};_0x165953['model']=_[_0x6326('0x52')](db[_0x6326('0x35')][_0x6326('0x36')]);_0x165953[_0x6326('0x3b')]=_['keys'](_0x231e15[_0x6326('0x3b')]);_0x165953['filters']=_[_0x6326('0x3d')](_0x165953[_0x6326('0x3a')],_0x165953[_0x6326('0x3b')]);_0x44d852[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x165953['model'],qs[_0x6326('0x3e')](_0x231e15['query']['fields']));_0x44d852[_0x6326('0x3f')]=_0x44d852[_0x6326('0x3f')]['length']?_0x44d852[_0x6326('0x3f')]:_0x165953[_0x6326('0x3a')];if(_0x231e15[_0x6326('0x3b')][_0x6326('0x4b')]){_0x44d852[_0x6326('0x4c')]=[{'all':!![]}];}_0x44d852=_['merge']({},_0x44d852,_0x231e15['options']);return db[_0x6326('0x35')][_0x6326('0x53')](_0x44d852)[_0x6326('0x2d')](handleEntityNotFound(_0x28504f,null))[_0x6326('0x2d')](respondWithResult(_0x28504f,null))[_0x6326('0x4f')](handleError(_0x28504f,null));};exports[_0x6326('0x30')]=function(_0xdc4522,_0x55bcd6){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0xdc4522[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x55bcd6,null))[_0x6326('0x2d')](removeEntity(_0x55bcd6,null))['catch'](handleError(_0x55bcd6,null));};exports[_0x6326('0x54')]=function(_0x55537a,_0x216972){return db[_0x6326('0x35')]['describe']()[_0x6326('0x2d')](respondWithResult(_0x216972,null))['catch'](handleError(_0x216972,null));};exports[_0x6326('0x55')]=function(_0x202fd3,_0x2ee8df){var _0x35400e;return db['sequelize'][_0x6326('0x56')](function(_0xbe6b3e){return db['VoicePrefix'][_0x6326('0x55')](_0x202fd3[_0x6326('0x57')],{'transaction':_0xbe6b3e})[_0x6326('0x2d')](function(_0x4a42ae){_0x35400e=_0x4a42ae[_0x6326('0x58')]({'plain':!![]});return db[_0x6326('0x59')]['find']({'where':{'id':_0x35400e[_0x6326('0x5a')]},'raw':!![]})['then'](function(_0x1f1463){return createVoicePrefixExtensions(_0x35400e,_0x1f1463,_0xbe6b3e);});});})[_0x6326('0x2d')](function(){var _0x3e9825=_0x202fd3[_0x6326('0x5b')][_0x6326('0x58')]({'plain':!![]});if(!_0x3e9825)throw new Error(_0x6326('0x5c'));if(_0x3e9825[_0x6326('0x5d')]==='user'){var _0x51adce=_0x35400e;return db['UserProfileSection'][_0x6326('0x53')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9825[_0x6326('0x5e')]},'raw':!![]})[_0x6326('0x2d')](function(_0xcae454){if(_0xcae454&&_0xcae454[_0x6326('0x5f')]===0x0){return db[_0x6326('0x2f')]['create']({'name':_0x51adce[_0x6326('0x32')],'resourceId':_0x51adce['id'],'type':_0xcae454[_0x6326('0x32')],'sectionId':_0xcae454['id']},{})['then'](function(){return _0x35400e;});}else{return _0x35400e;}})[_0x6326('0x4f')](function(_0xdeba28){logger[_0x6326('0x31')](_0x6326('0x60'),_0xdeba28);throw _0xdeba28;});}return _0x35400e;})[_0x6326('0x2d')](respondWithResult(_0x2ee8df,null))[_0x6326('0x4f')](handleError(_0x2ee8df,null));};function Extension(_0x320d43,_0x2f624f,_0x2c7a8d,_0x37506f){this['context']=_0x6326('0x61');this[_0x6326('0x62')]=_0x320d43;this[_0x6326('0x63')]=_0x2c7a8d;this[_0x6326('0x38')]='system';this['description']=_0x6326('0x64');this[_0x6326('0x65')]=_0x2f624f;this[_0x6326('0x66')]=_0x37506f;}function createVoicePrefixExtensions(_0x10f54b,_0x3ac39d,_0x54a9eb){return new BPromise(function(_0x4cec50,_0x13fc10){var _0x447b34=new Extension(formatPrefixName(_0x10f54b[_0x6326('0x67')]),0x1,_0x6326('0x68'),'Voice\x20Prefix');_0x447b34[_0x6326('0x69')]=_0x10f54b['id'];return db[_0x6326('0x59')][_0x6326('0x55')](_0x447b34,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x4197d6){var _0xc8f404=_0x4197d6['get']({'plain':!![]});var _0x2bc08a=_['map'](addVoicePrefixExtensions(_0x10f54b,_0x3ac39d),function(_0x4877c8){_0x4877c8[_0x6326('0x5a')]=_0xc8f404['id'];_0x4877c8['VoicePrefixId']=_0x10f54b['id'];return _0x4877c8;});return db[_0x6326('0x59')][_0x6326('0x6a')](_0x2bc08a,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x3b6de7){if(!_0x3b6de7){return _0x13fc10(_0x6326('0x6b'));}else{return _0x4cec50(_0x3b6de7);}})[_0x6326('0x4f')](function(_0x1e8d86){return _0x13fc10(_0x1e8d86);});});;});};function addVoicePrefixExtensions(_0x75e3a7,_0xa2928e){var _0x3f5e2e=[];var _0x53ff60=formatPrefixName(_0x75e3a7[_0x6326('0x67')]);_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x2,_0x6326('0x6d'),_0x6326('0x6e')+_0x75e3a7[_0x6326('0x32')]));if(_0x75e3a7['callerIdAll']){_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,_0x6326('0x6d'),_0x6326('0x6f')+_0x75e3a7[_0x6326('0x70')]));}else{_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,'NoOp',_0x6326('0x71')));}_0x3f5e2e['push'](new Extension(_0x53ff60,0x4,'goto',_0xa2928e[_0x6326('0x72')]+','+_0x6326('0x73')+(0x8+_0x75e3a7[_0x6326('0x32')][_0x6326('0x40')])+'}'+','+0x1));return _0x3f5e2e;}function formatPrefixName(_0x4fd921){var _0x4fbede='_';for(var _0x5cadb2=0x0;_0x5cadb2<_0x4fd921['length'];_0x5cadb2++){if(_0x4fd921[_0x6326('0x74')](_0x5cadb2)=='-'){_0x4fbede+=_0x4fd921['charAt'](_0x5cadb2);}else{_0x4fbede+='['+_0x4fd921[_0x6326('0x74')](_0x5cadb2)+']';}}_0x4fbede+='.';return _0x4fbede;}exports[_0x6326('0x2c')]=function(_0x54730e,_0x4c1d7e,_0x5401cf){var _0x5e86bc=_0x54730e['body'];_0x5e86bc[_0x6326('0x67')]='system-'+_0x5e86bc['name']+'-';return db['sequelize']['transaction'](function(_0x19916e){return db['VoicePrefix'][_0x6326('0x2c')](_0x5e86bc,{'where':{'id':_0x5e86bc['id']},'transaction':_0x19916e})[_0x6326('0x2d')](function(){return db['VoiceExtension'][_0x6326('0x30')]({'where':{'VoicePrefixId':_0x5e86bc['id']},'transaction':_0x19916e})['then'](function(){return db[_0x6326('0x59')][_0x6326('0x53')]({'where':{'id':_0x5e86bc[_0x6326('0x5a')]},'raw':!![]})[_0x6326('0x2d')](function(_0x339838){return createVoicePrefixExtensions(_0x5e86bc,_0x339838,_0x19916e);});});});})[_0x6326('0x2d')](function(){return db[_0x6326('0x35')][_0x6326('0x75')](_0x5e86bc['id']);})[_0x6326('0x2d')](respondWithResult(_0x4c1d7e,null))[_0x6326('0x4f')](handleError(_0x4c1d7e,null));};exports[_0x6326('0x76')]=function(_0x19cc2b,_0x3bc5f3,_0x27a505){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0x19cc2b[_0x6326('0x51')]['id']}})['then'](handleEntityNotFound(_0x3bc5f3,null))['then'](function(_0x543792){if(_0x543792){return _0x543792['addAgents'](_0x19cc2b[_0x6326('0x57')]['ids'],_['omit'](_0x19cc2b['body'],['ids','id'])||{})['spread'](function(_0x5a1a9f){for(var _0xe845d6=0x0;_0xe845d6<_0x19cc2b[_0x6326('0x57')]['ids'][_0x6326('0x40')];_0xe845d6+=0x1){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':Number(_0x19cc2b['body'][_0x6326('0x79')][_0xe845d6]),'VoicePrefixId':Number(_0x19cc2b[_0x6326('0x51')]['id'])});}return _0x5a1a9f;});}})[_0x6326('0x2d')](respondWithResult(_0x3bc5f3,null))[_0x6326('0x4f')](handleError(_0x3bc5f3,null));};exports[_0x6326('0x7a')]=function(_0x483813,_0x3bff09,_0x4aec22){return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x483813['params']['id']}})['then'](handleEntityNotFound(_0x3bff09,null))['then'](function(_0x491f2e){if(_0x491f2e){return _0x491f2e['removeAgents'](_0x483813['query']['ids'])[_0x6326('0x2d')](function(){if(_[_0x6326('0x7b')](_0x483813[_0x6326('0x3b')][_0x6326('0x79')])){for(var _0x590e06=0x0;_0x590e06<_0x483813['query']['ids'][_0x6326('0x40')];_0x590e06+=0x1){socket[_0x6326('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x483813[_0x6326('0x3b')]['ids'][_0x590e06]),'VoicePrefixId':Number(_0x483813['params']['id'])});}}else{socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':Number(_0x483813[_0x6326('0x3b')][_0x6326('0x79')]),'VoicePrefixId':Number(_0x483813[_0x6326('0x51')]['id'])});}});}})[_0x6326('0x2d')](respondWithStatusCode(_0x3bff09,null))[_0x6326('0x4f')](handleError(_0x3bff09,null));};exports['getAgents']=function(_0x5afd24,_0x4c8bde,_0x1ec0ef){var _0x5223f4={};var _0x48631a={};var _0xaea64f;var _0x429c41;return db['VoicePrefix'][_0x6326('0x7d')]({'where':{'id':_0x5afd24['params']['id']}})['then'](handleEntityNotFound(_0x4c8bde,null))[_0x6326('0x2d')](function(_0xbca686){if(_0xbca686){_0xaea64f=_0xbca686;_0x48631a['model']=_['keys'](db[_0x6326('0x7e')][_0x6326('0x36')]);_0x48631a[_0x6326('0x3b')]=_[_0x6326('0x52')](_0x5afd24['query']);_0x48631a['filters']=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],_0x48631a[_0x6326('0x3b')]);_0x5223f4[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x5afd24[_0x6326('0x3b')]['fields']));_0x5223f4[_0x6326('0x3f')]=_0x5223f4['attributes'][_0x6326('0x40')]?_0x5223f4[_0x6326('0x3f')]:_0x48631a[_0x6326('0x3a')];_0x5223f4[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x5afd24[_0x6326('0x3b')]['sort']);_0x5223f4[_0x6326('0x45')]=qs[_0x6326('0x3c')](_['pick'](_0x5afd24[_0x6326('0x3b')],_0x48631a[_0x6326('0x3c')]));if(_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]){_0x5223f4[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5223f4[_0x6326('0x45')],{'$or':_['map'](_0x5223f4[_0x6326('0x3f')],function(_0x21ccbf){var _0x458a7e={};_0x458a7e[_0x21ccbf]={'$like':'%'+_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x458a7e;})});}_0x5223f4=_['merge']({},_0x5223f4,_0x5afd24[_0x6326('0x4a')]);return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})['then'](function(_0x411fe5){if(_0x411fe5){_0x429c41=_0x411fe5[_0x6326('0x40')];if(!_0x5afd24[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5223f4[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x5afd24[_0x6326('0x3b')]['limit']);_0x5223f4[_0x6326('0x23')]=qs[_0x6326('0x23')](_0x5afd24[_0x6326('0x3b')][_0x6326('0x23')]);}return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})[_0x6326('0x2d')](function(_0xcb5683){if(_0xcb5683){return _0xcb5683?{'count':_0x429c41,'rows':_0xcb5683}:null;}})['then'](respondWithResult(_0x4c8bde,null))[_0x6326('0x4f')](handleError(_0x4c8bde,null));};exports['getTeams']=function(_0x44cea5,_0x57e6ad,_0x3a9312){var _0x5b251f={};var _0x2b885b={};var _0xda3005;var _0x29682b;return db[_0x6326('0x35')][_0x6326('0x7d')]({'where':{'id':_0x44cea5[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x57e6ad,null))['then'](function(_0x1da431){if(_0x1da431){_0xda3005=_0x1da431;_0x2b885b[_0x6326('0x3a')]=_[_0x6326('0x52')](db['Team'][_0x6326('0x36')]);_0x2b885b['query']=_[_0x6326('0x52')](_0x44cea5[_0x6326('0x3b')]);_0x2b885b[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x2b885b[_0x6326('0x3a')],_0x2b885b[_0x6326('0x3b')]);_0x5b251f[_0x6326('0x3f')]=_['intersection'](_0x2b885b[_0x6326('0x3a')],qs['fields'](_0x44cea5[_0x6326('0x3b')][_0x6326('0x3e')]));_0x5b251f[_0x6326('0x3f')]=_0x5b251f[_0x6326('0x3f')]['length']?_0x5b251f['attributes']:_0x2b885b[_0x6326('0x3a')];_0x5b251f[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x44cea5[_0x6326('0x3b')]['sort']);_0x5b251f[_0x6326('0x45')]=qs['filters'](_['pick'](_0x44cea5[_0x6326('0x3b')],_0x2b885b[_0x6326('0x3c')]));if(_0x44cea5[_0x6326('0x3b')][_0x6326('0x48')]){_0x5b251f[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5b251f[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x5b251f[_0x6326('0x3f')],function(_0x3884db){var _0x5ccb35={};_0x5ccb35[_0x3884db]={'$like':'%'+_0x44cea5['query'][_0x6326('0x48')]+'%'};return _0x5ccb35;})});}_0x5b251f=_['merge']({},_0x5b251f,_0x44cea5[_0x6326('0x4a')]);return _0xda3005['getTeams'](_0x5b251f);}})['then'](function(_0x10d3c6){if(_0x10d3c6){_0x29682b=_0x10d3c6[_0x6326('0x40')];if(!_0x44cea5[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5b251f[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x44cea5[_0x6326('0x3b')]['limit']);_0x5b251f['offset']=qs[_0x6326('0x23')](_0x44cea5['query'][_0x6326('0x23')]);}return _0xda3005[_0x6326('0x81')](_0x5b251f);}})['then'](function(_0x5c57e5){if(_0x5c57e5){return _0x5c57e5?{'count':_0x29682b,'rows':_0x5c57e5}:null;}})[_0x6326('0x2d')](respondWithResult(_0x57e6ad,null))['catch'](handleError(_0x57e6ad,null));};exports['addTeams']=function(_0x50d766,_0x4f45a6,_0x3a9a9e){var _0x22c60d=_0x50d766[_0x6326('0x57')][_0x6326('0x79')];var _0x26f784;return db[_0x6326('0x82')]['findAll']({'where':{'id':_0x22c60d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause',_0x6326('0x83')],'raw':!![]}]})[_0x6326('0x2d')](function(_0x215db1){if(_0x215db1){_0x26f784=_0x215db1;var _0x2a9f5c=_['flatMap'](_0x215db1,function(_0x20f5ea){var _0x293f72=_0x20f5ea['get']({'plain':!![]});return _0x293f72[_0x6326('0x84')];});return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x50d766[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](function(_0x5d4b0a){return db['sequelize'][_0x6326('0x56')](function(_0xf912fe){return _0x5d4b0a[_0x6326('0x85')](_0x22c60d,{'transaction':_0xf912fe})['then'](function(){return BPromise[_0x6326('0x86')](_0x26f784,function(_0x464914){return db[_0x6326('0x87')]['upsert']({'TeamId':_0x464914['id'],'VoicePrefixId':_0x50d766[_0x6326('0x51')]['id']},{'transaction':_0xf912fe});});})['then'](function(){return BPromise[_0x6326('0x86')](_0x2a9f5c,function(_0x5a7b49){return db[_0x6326('0x88')][_0x6326('0x89')]({'where':{'UserId':_0x5a7b49['id'],'VoicePrefixId':_0x50d766['params']['id']},'transaction':_0xf912fe});});})[_0x6326('0x2d')](function(){_0x2a9f5c[_0x6326('0x8a')](function(_0x38d8c8){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':_0x38d8c8['id'],'VoicePrefixId':_0x5d4b0a['id']});});});});});}})[_0x6326('0x2d')](respondWithStatusCode(_0x4f45a6,null))[_0x6326('0x4f')](handleError(_0x4f45a6,null));};exports[_0x6326('0x8b')]=function(_0x43dc1e,_0x26ea69,_0x1a4b94){return db[_0x6326('0x82')][_0x6326('0x4d')]({'where':{'id':_0x43dc1e['query'][_0x6326('0x79')]},'attributes':['id'],'include':[{'model':db[_0x6326('0x7e')],'as':_0x6326('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x26ea69,null))['then'](function(_0x489226){var _0x5db6b3=_[_0x6326('0x34')](_0x489226,'id');var _0x5135df=[];var _0x4c15d2=[];var _0xd9c385=squel['select']();_0xd9c385['field'](_0x6326('0x8c'))['from'](_0x6326('0x8d'),'tq')[_0x6326('0x8e')](_0x6326('0x8f'),'ut',_0x6326('0x90'))[_0x6326('0x45')](_0x6326('0x91'),_0x43dc1e[_0x6326('0x51')]['id']);for(var _0x26391c=0x0;_0x26391c<_0x489226[_0x6326('0x40')];_0x26391c+=0x1){let _0x1adcbc=_0x489226[_0x26391c];for(var _0x46bece=0x0;_0x46bece<_0x1adcbc[_0x6326('0x84')][_0x6326('0x40')];_0x46bece+=0x1){let _0x30d31a=_0x1adcbc[_0x6326('0x84')][_0x46bece];var _0x3ec241=_0xd9c385[_0x6326('0x92')]();_0x3ec241[_0x6326('0x45')](_0x6326('0x93'),_0x30d31a['id']);_0x4c15d2[_0x6326('0x6c')](db['sequelize'][_0x6326('0x3b')](_0x3ec241[_0x6326('0x94')](),{'type':db[_0x6326('0x95')][_0x6326('0x96')][_0x6326('0x97')]})[_0x6326('0x2d')](function(_0x292657){if(_0x292657[_0x6326('0x40')]===0x1){return _0x30d31a['id'];}else{var _0x909cce=_[_0x6326('0x98')](_['map'](_0x292657,_0x6326('0x99')),function(_0x4b493a){return _[_0x6326('0x9a')](_0x5db6b3,_0x4b493a);});if(_0x909cce){return _0x30d31a['id'];}}}));}}return BPromise[_0x6326('0x9b')](_0x4c15d2)['then'](function(_0x2b98a4){_0x5135df=_(_0x5135df)[_0x6326('0x9c')](_0x2b98a4)['compact']()['value']();return db[_0x6326('0x35')]['find']({'where':{'id':_0x43dc1e[_0x6326('0x51')]['id']}})['then'](function(_0x4a470e){return db[_0x6326('0x95')][_0x6326('0x56')](function(_0x298a11){return _0x4a470e[_0x6326('0x8b')](_0x43dc1e[_0x6326('0x3b')][_0x6326('0x79')],{'transaction':_0x298a11})[_0x6326('0x2d')](function(){if(!_['isEmpty'](_0x5135df)){return _0x4a470e['removeAgents'](_0x5135df,{'transaction':_0x298a11});}})[_0x6326('0x2d')](function(){_0x5135df[_0x6326('0x8a')](function(_0x42d1db){socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':_0x42d1db,'VoicePrefixId':_0x4a470e['id']});});});});});});})['then'](respondWithStatusCode(_0x26ea69,null))[_0x6326('0x4f')](handleError(_0x26ea69,null));};
\ No newline at end of file
+var _0x351d=['isEmpty','forEach','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','VoicePrefixes','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','VoicePrefix','findAll','catch','show','params','length','merge','options','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','get','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','CDR(prefix)=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','Team','getTeams','addTeams','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','removeTeams','Agents','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x351d,0x90));var _0xd351=function(_0x20c7ee,_0x28a534){_0x20c7ee=_0x20c7ee-0x0;var _0x2dfd84=_0x351d[_0x20c7ee];return _0x2dfd84;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd351('0x13')]=_[_0xd351('0x14')](config[_0xd351('0x13')],{'host':_0xd351('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd351('0x13')]));require(_0xd351('0x16'))['register'](socket);function respondWithStatusCode(_0xc5a145,_0xb106ef){_0xb106ef=_0xb106ef||0xcc;return function(_0x3c2299){if(_0x3c2299){return _0xc5a145[_0xd351('0x17')](_0xb106ef);}return _0xc5a145[_0xd351('0x18')](_0xb106ef)['end']();};}function respondWithResult(_0x9f790f,_0x49d8bb){_0x49d8bb=_0x49d8bb||0xc8;return function(_0x5bdc03){if(_0x5bdc03){return _0x9f790f[_0xd351('0x18')](_0x49d8bb)['json'](_0x5bdc03);}};}function respondWithFilteredResult(_0x21e591,_0x1de35f){return function(_0x4e0164){if(_0x4e0164){var _0x4c6693=typeof _0x1de35f[_0xd351('0x19')]===_0xd351('0x1a')&&typeof _0x1de35f[_0xd351('0x1b')]===_0xd351('0x1a');var _0x51f265=_0x4e0164[_0xd351('0x1c')];var _0x4abbed=_0x4c6693?0x0:_0x1de35f['offset'];var _0x37d3ac=_0x4c6693?_0x4e0164['count']:_0x1de35f[_0xd351('0x19')]+_0x1de35f[_0xd351('0x1b')];var _0x3634c9;if(_0x37d3ac>=_0x51f265){_0x37d3ac=_0x51f265;_0x3634c9=0xc8;}else{_0x3634c9=0xce;}_0x21e591[_0xd351('0x18')](_0x3634c9);return _0x21e591[_0xd351('0x1d')]('Content-Range',_0x4abbed+'-'+_0x37d3ac+'/'+_0x51f265)[_0xd351('0x1e')](_0x4e0164);}return null;};}function patchUpdates(_0xbbc58){return function(_0x241265){try{jsonpatch['apply'](_0x241265,_0xbbc58,!![]);}catch(_0x1ce7f7){return BPromise[_0xd351('0x1f')](_0x1ce7f7);}return _0x241265[_0xd351('0x20')]();};}function saveUpdates(_0x59fb6d,_0x1ce279){return function(_0x34a5cb){if(_0x34a5cb){return _0x34a5cb[_0xd351('0x21')](_0x59fb6d)[_0xd351('0x22')](function(_0x489c9a){return _0x489c9a;});}return null;};}function removeEntity(_0x40f7f3,_0x483c92){return function(_0x358bff){if(_0x358bff){return _0x358bff[_0xd351('0x23')]()['then'](function(){var _0x2648d0=_0x358bff['get']({'plain':!![]});var _0x50d67e=_0xd351('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x50d67e,'resourceId':_0x2648d0['id']}})[_0xd351('0x22')](function(){return _0x358bff;});})['then'](function(){_0x40f7f3[_0xd351('0x18')](0xcc)[_0xd351('0x25')]();});}};}function handleEntityNotFound(_0x407b50,_0x4d3f48){return function(_0x71ce9c){if(!_0x71ce9c){_0x407b50['sendStatus'](0x194);}return _0x71ce9c;};}function handleError(_0x1c826b,_0x50039b){_0x50039b=_0x50039b||0x1f4;return function(_0x5f07b1){logger[_0xd351('0x26')](_0x5f07b1[_0xd351('0x27')]);if(_0x5f07b1[_0xd351('0x28')]){delete _0x5f07b1[_0xd351('0x28')];}_0x1c826b['status'](_0x50039b)[_0xd351('0x29')](_0x5f07b1);};}exports[_0xd351('0x2a')]=function(_0x38023c,_0x41da60){var _0x140591={},_0x205c79={},_0x103a7b={'count':0x0,'rows':[]};var _0x898949=_[_0xd351('0x2b')](db['VoicePrefix'][_0xd351('0x2c')],function(_0x453270){return{'name':_0x453270[_0xd351('0x2d')],'type':_0x453270[_0xd351('0x2e')]['key']};});_0x205c79[_0xd351('0x2f')]=_[_0xd351('0x2b')](_0x898949,_0xd351('0x28'));_0x205c79[_0xd351('0x30')]=_[_0xd351('0x31')](_0x38023c[_0xd351('0x30')]);_0x205c79[_0xd351('0x32')]=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],_0x205c79['query']);_0x140591['attributes']=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x38023c[_0xd351('0x30')][_0xd351('0x34')]));_0x140591[_0xd351('0x35')]=_0x140591['attributes']['length']?_0x140591[_0xd351('0x35')]:_0x205c79['model'];if(!_0x38023c[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x140591[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x38023c[_0xd351('0x30')][_0xd351('0x1b')]);_0x140591[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x38023c[_0xd351('0x30')][_0xd351('0x19')]);}_0x140591['order']=qs[_0xd351('0x38')](_0x38023c['query'][_0xd351('0x38')]);_0x140591[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x38023c[_0xd351('0x30')],_0x205c79[_0xd351('0x32')]),_0x898949);if(_0x38023c['query'][_0xd351('0x3b')]){_0x140591[_0xd351('0x39')]=_['merge'](_0x140591[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x898949,function(_0x382f5b){if(_0x382f5b[_0xd351('0x2e')]!==_0xd351('0x3c')){var _0x5cc105={};_0x5cc105[_0x382f5b['name']]={'$like':'%'+_0x38023c[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x5cc105;}})});}_0x140591=_['merge']({},_0x140591,_0x38023c['options']);var _0x16677f={'where':_0x140591[_0xd351('0x39')]};return db['VoicePrefix']['count'](_0x16677f)[_0xd351('0x22')](function(_0x18f9d1){_0x103a7b[_0xd351('0x1c')]=_0x18f9d1;if(_0x38023c[_0xd351('0x30')][_0xd351('0x3d')]){_0x140591[_0xd351('0x3e')]=[{'all':!![]}];}return db[_0xd351('0x3f')][_0xd351('0x40')](_0x140591);})[_0xd351('0x22')](function(_0x553360){_0x103a7b['rows']=_0x553360;return _0x103a7b;})[_0xd351('0x22')](respondWithFilteredResult(_0x41da60,_0x140591))[_0xd351('0x41')](handleError(_0x41da60,null));};exports[_0xd351('0x42')]=function(_0x35f38f,_0x2bdd8f){var _0x4332e7={'raw':![],'where':{'id':_0x35f38f[_0xd351('0x43')]['id']}},_0xeaf4dc={};_0xeaf4dc[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x3f')][_0xd351('0x2c')]);_0xeaf4dc[_0xd351('0x30')]=_[_0xd351('0x31')](_0x35f38f[_0xd351('0x30')]);_0xeaf4dc[_0xd351('0x32')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],_0xeaf4dc[_0xd351('0x30')]);_0x4332e7[_0xd351('0x35')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x35f38f[_0xd351('0x30')][_0xd351('0x34')]));_0x4332e7[_0xd351('0x35')]=_0x4332e7['attributes'][_0xd351('0x44')]?_0x4332e7['attributes']:_0xeaf4dc[_0xd351('0x2f')];if(_0x35f38f[_0xd351('0x30')]['includeAll']){_0x4332e7['include']=[{'all':!![]}];}_0x4332e7=_[_0xd351('0x45')]({},_0x4332e7,_0x35f38f[_0xd351('0x46')]);return db[_0xd351('0x3f')]['find'](_0x4332e7)[_0xd351('0x22')](handleEntityNotFound(_0x2bdd8f,null))[_0xd351('0x22')](respondWithResult(_0x2bdd8f,null))['catch'](handleError(_0x2bdd8f,null));};exports[_0xd351('0x23')]=function(_0x53a2e8,_0x1eb5f3){return db[_0xd351('0x3f')]['find']({'where':{'id':_0x53a2e8['params']['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x1eb5f3,null))['then'](removeEntity(_0x1eb5f3,null))[_0xd351('0x41')](handleError(_0x1eb5f3,null));};exports[_0xd351('0x47')]=function(_0x9f1cd0,_0x4a27e3){return db[_0xd351('0x3f')]['describe']()['then'](respondWithResult(_0x4a27e3,null))['catch'](handleError(_0x4a27e3,null));};exports[_0xd351('0x48')]=function(_0x292af3,_0x334029){var _0x5a2e9b;return db['sequelize'][_0xd351('0x49')](function(_0x42f248){return db['VoicePrefix'][_0xd351('0x48')](_0x292af3[_0xd351('0x4a')],{'transaction':_0x42f248})['then'](function(_0x24ee0f){_0x5a2e9b=_0x24ee0f['get']({'plain':!![]});return db[_0xd351('0x4b')]['find']({'where':{'id':_0x5a2e9b[_0xd351('0x4c')]},'raw':!![]})[_0xd351('0x22')](function(_0x169ab1){return createVoicePrefixExtensions(_0x5a2e9b,_0x169ab1,_0x42f248);});});})[_0xd351('0x22')](function(){var _0xb5f3ee=_0x292af3[_0xd351('0x4d')][_0xd351('0x4e')]({'plain':!![]});if(!_0xb5f3ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb5f3ee['role']===_0xd351('0x4d')){var _0x624224=_0x5a2e9b;return db['UserProfileSection'][_0xd351('0x4f')]({'where':{'name':_0xd351('0x24'),'userProfileId':_0xb5f3ee[_0xd351('0x50')]},'raw':!![]})['then'](function(_0x169122){if(_0x169122&&_0x169122['autoAssociation']===0x0){return db['UserProfileResource'][_0xd351('0x48')]({'name':_0x624224[_0xd351('0x28')],'resourceId':_0x624224['id'],'type':_0x169122['name'],'sectionId':_0x169122['id']},{})[_0xd351('0x22')](function(){return _0x5a2e9b;});}else{return _0x5a2e9b;}})[_0xd351('0x41')](function(_0x2d9747){logger[_0xd351('0x26')](_0xd351('0x51'),_0x2d9747);throw _0x2d9747;});}return _0x5a2e9b;})[_0xd351('0x22')](respondWithResult(_0x334029,null))['catch'](handleError(_0x334029,null));};function Extension(_0x1e1173,_0x2a7390,_0x36fb5b,_0x8461b){this[_0xd351('0x52')]=_0xd351('0x53');this[_0xd351('0x54')]=_0x1e1173;this['app']=_0x36fb5b;this[_0xd351('0x2e')]='system';this[_0xd351('0x55')]=_0xd351('0x56');this[_0xd351('0x57')]=_0x2a7390;this[_0xd351('0x58')]=_0x8461b;}function createVoicePrefixExtensions(_0x70cdb,_0x4eaf18,_0x413931){return new BPromise(function(_0x4c8038,_0x4685fa){var _0x45bcc7=new Extension(formatPrefixName(_0x70cdb[_0xd351('0x59')]),0x1,_0xd351('0x5a'),_0xd351('0x5b'));_0x45bcc7['VoicePrefixId']=_0x70cdb['id'];return db['VoiceExtension'][_0xd351('0x48')](_0x45bcc7,{'transaction':_0x413931})[_0xd351('0x22')](function(_0x4b9367){var _0x2d2655=_0x4b9367[_0xd351('0x4e')]({'plain':!![]});var _0x2718e9=_['map'](addVoicePrefixExtensions(_0x70cdb,_0x4eaf18),function(_0x2b47ab){_0x2b47ab[_0xd351('0x4c')]=_0x2d2655['id'];_0x2b47ab[_0xd351('0x5c')]=_0x70cdb['id'];return _0x2b47ab;});return db[_0xd351('0x4b')]['bulkCreate'](_0x2718e9,{'transaction':_0x413931})['then'](function(_0x40c78b){if(!_0x40c78b){return _0x4685fa(_0xd351('0x5d'));}else{return _0x4c8038(_0x40c78b);}})[_0xd351('0x41')](function(_0xa000b4){return _0x4685fa(_0xa000b4);});});;});};function addVoicePrefixExtensions(_0x36b38f,_0x3b0993){var _0x2c83fe=[];var _0x5e2e06=formatPrefixName(_0x36b38f[_0xd351('0x59')]);_0x2c83fe['push'](new Extension(_0x5e2e06,0x2,'Set',_0xd351('0x5e')+_0x36b38f[_0xd351('0x28')]));if(_0x36b38f['callerIdAll']){_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,'Set','PREFIX-CALLERIDALL='+_0x36b38f['callerIdAll']));}else{_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,_0xd351('0x5a'),_0xd351('0x60')));}_0x2c83fe['push'](new Extension(_0x5e2e06,0x4,_0xd351('0x61'),_0x3b0993[_0xd351('0x52')]+','+_0xd351('0x62')+(0x8+_0x36b38f[_0xd351('0x28')][_0xd351('0x44')])+'}'+','+0x1));return _0x2c83fe;}function formatPrefixName(_0x475534){var _0x15fcab='_';for(var _0x6bf19c=0x0;_0x6bf19c<_0x475534[_0xd351('0x44')];_0x6bf19c++){if(_0x475534[_0xd351('0x63')](_0x6bf19c)=='-'){_0x15fcab+=_0x475534[_0xd351('0x63')](_0x6bf19c);}else{_0x15fcab+='['+_0x475534['charAt'](_0x6bf19c)+']';}}_0x15fcab+='.';return _0x15fcab;}exports[_0xd351('0x21')]=function(_0x2d59a5,_0x431e91,_0xcc7a10){var _0xf24a29=_0x2d59a5[_0xd351('0x4a')];_0xf24a29['prefix']=_0xd351('0x64')+_0xf24a29[_0xd351('0x28')]+'-';return db['sequelize']['transaction'](function(_0x436e1d){return db[_0xd351('0x3f')][_0xd351('0x21')](_0xf24a29,{'where':{'id':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x23')]({'where':{'VoicePrefixId':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x4f')]({'where':{'id':_0xf24a29['VoiceExtensionId']},'raw':!![]})[_0xd351('0x22')](function(_0x129623){return createVoicePrefixExtensions(_0xf24a29,_0x129623,_0x436e1d);});});});})['then'](function(){return db[_0xd351('0x3f')]['findById'](_0xf24a29['id']);})[_0xd351('0x22')](respondWithResult(_0x431e91,null))['catch'](handleError(_0x431e91,null));};exports[_0xd351('0x65')]=function(_0x406d8a,_0xbd31ca,_0x451445){return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x406d8a[_0xd351('0x43')]['id']}})['then'](handleEntityNotFound(_0xbd31ca,null))[_0xd351('0x22')](function(_0x2558b4){if(_0x2558b4){return _0x2558b4[_0xd351('0x65')](_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')],_['omit'](_0x406d8a[_0xd351('0x4a')],[_0xd351('0x66'),'id'])||{})[_0xd351('0x67')](function(_0x54b38c){for(var _0x38a3ec=0x0;_0x38a3ec<_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0xd351('0x44')];_0x38a3ec+=0x1){socket[_0xd351('0x68')](_0xd351('0x69'),{'UserId':Number(_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0x38a3ec]),'VoicePrefixId':Number(_0x406d8a[_0xd351('0x43')]['id'])});}return _0x54b38c;});}})['then'](respondWithResult(_0xbd31ca,null))[_0xd351('0x41')](handleError(_0xbd31ca,null));};exports[_0xd351('0x6a')]=function(_0x5036e6,_0x44df63,_0x4c1468){return db['VoicePrefix']['find']({'where':{'id':_0x5036e6[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x44df63,null))[_0xd351('0x22')](function(_0x5b2bf9){if(_0x5b2bf9){return _0x5b2bf9[_0xd351('0x6a')](_0x5036e6['query'][_0xd351('0x66')])['then'](function(){if(_[_0xd351('0x6b')](_0x5036e6[_0xd351('0x30')][_0xd351('0x66')])){for(var _0x16dd16=0x0;_0x16dd16<_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0xd351('0x44')];_0x16dd16+=0x1){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0x16dd16]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}}else{socket['emit'](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}});}})[_0xd351('0x22')](respondWithStatusCode(_0x44df63,null))['catch'](handleError(_0x44df63,null));};exports[_0xd351('0x6d')]=function(_0x1e6c85,_0x2adab4,_0x2a1ea4){var _0x4a4b25={};var _0x1fda25={};var _0x36bbee;var _0x48b5ee;return db[_0xd351('0x3f')][_0xd351('0x6e')]({'where':{'id':_0x1e6c85[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x2adab4,null))['then'](function(_0x523895){if(_0x523895){_0x36bbee=_0x523895;_0x1fda25[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x6f')][_0xd351('0x2c')]);_0x1fda25['query']=_[_0xd351('0x31')](_0x1e6c85[_0xd351('0x30')]);_0x1fda25[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1fda25[_0xd351('0x2f')],_0x1fda25['query']);_0x4a4b25[_0xd351('0x35')]=_[_0xd351('0x33')](_0x1fda25['model'],qs[_0xd351('0x34')](_0x1e6c85[_0xd351('0x30')]['fields']));_0x4a4b25[_0xd351('0x35')]=_0x4a4b25['attributes'][_0xd351('0x44')]?_0x4a4b25['attributes']:_0x1fda25[_0xd351('0x2f')];_0x4a4b25[_0xd351('0x70')]=qs[_0xd351('0x38')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x38')]);_0x4a4b25[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x1e6c85[_0xd351('0x30')],_0x1fda25['filters']));if(_0x1e6c85[_0xd351('0x30')][_0xd351('0x3b')]){_0x4a4b25[_0xd351('0x39')]=_[_0xd351('0x45')](_0x4a4b25[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x4a4b25[_0xd351('0x35')],function(_0x54041b){var _0x56458b={};_0x56458b[_0x54041b]={'$like':'%'+_0x1e6c85[_0xd351('0x30')]['filter']+'%'};return _0x56458b;})});}_0x4a4b25=_[_0xd351('0x45')]({},_0x4a4b25,_0x1e6c85[_0xd351('0x46')]);return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x2d5e2b){if(_0x2d5e2b){_0x48b5ee=_0x2d5e2b['length'];if(!_0x1e6c85[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x4a4b25[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x1b')]);_0x4a4b25[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x19')]);}return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x4ddd65){if(_0x4ddd65){return _0x4ddd65?{'count':_0x48b5ee,'rows':_0x4ddd65}:null;}})['then'](respondWithResult(_0x2adab4,null))[_0xd351('0x41')](handleError(_0x2adab4,null));};exports['getTeams']=function(_0x5c202f,_0x426964,_0x4557ed){var _0x3f6826={};var _0x1a5e8e={};var _0x54fc9c;var _0x2443bd;return db['VoicePrefix']['findOne']({'where':{'id':_0x5c202f[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x426964,null))[_0xd351('0x22')](function(_0x15690b){if(_0x15690b){_0x54fc9c=_0x15690b;_0x1a5e8e[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x71')]['rawAttributes']);_0x1a5e8e[_0xd351('0x30')]=_[_0xd351('0x31')](_0x5c202f[_0xd351('0x30')]);_0x1a5e8e[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1a5e8e[_0xd351('0x2f')],_0x1a5e8e['query']);_0x3f6826['attributes']=_[_0xd351('0x33')](_0x1a5e8e['model'],qs[_0xd351('0x34')](_0x5c202f[_0xd351('0x30')]['fields']));_0x3f6826[_0xd351('0x35')]=_0x3f6826[_0xd351('0x35')][_0xd351('0x44')]?_0x3f6826[_0xd351('0x35')]:_0x1a5e8e[_0xd351('0x2f')];_0x3f6826['order']=qs[_0xd351('0x38')](_0x5c202f['query'][_0xd351('0x38')]);_0x3f6826[_0xd351('0x39')]=qs['filters'](_[_0xd351('0x3a')](_0x5c202f[_0xd351('0x30')],_0x1a5e8e[_0xd351('0x32')]));if(_0x5c202f[_0xd351('0x30')]['filter']){_0x3f6826['where']=_['merge'](_0x3f6826[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x3f6826[_0xd351('0x35')],function(_0x40740e){var _0x3606b1={};_0x3606b1[_0x40740e]={'$like':'%'+_0x5c202f[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x3606b1;})});}_0x3f6826=_['merge']({},_0x3f6826,_0x5c202f[_0xd351('0x46')]);return _0x54fc9c['getTeams'](_0x3f6826);}})[_0xd351('0x22')](function(_0x55d564){if(_0x55d564){_0x2443bd=_0x55d564['length'];if(!_0x5c202f[_0xd351('0x30')]['hasOwnProperty'](_0xd351('0x37'))){_0x3f6826[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x5c202f[_0xd351('0x30')][_0xd351('0x1b')]);_0x3f6826[_0xd351('0x19')]=qs['offset'](_0x5c202f['query'][_0xd351('0x19')]);}return _0x54fc9c[_0xd351('0x72')](_0x3f6826);}})['then'](function(_0x3d3cfa){if(_0x3d3cfa){return _0x3d3cfa?{'count':_0x2443bd,'rows':_0x3d3cfa}:null;}})['then'](respondWithResult(_0x426964,null))[_0xd351('0x41')](handleError(_0x426964,null));};exports[_0xd351('0x73')]=function(_0x6fd03b,_0x19d16a,_0x127bf9){var _0x4ab9b9=_0x6fd03b[_0xd351('0x4a')]['ids'];var _0x581e66;return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x4ab9b9},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':'Agents','attributes':['id','name',_0xd351('0x74'),_0xd351('0x75'),_0xd351('0x76')],'raw':!![]}]})[_0xd351('0x22')](function(_0x1ddacf){if(_0x1ddacf){_0x581e66=_0x1ddacf;var _0x4cadbe=_[_0xd351('0x77')](_0x1ddacf,function(_0x269bf6){var _0x3da123=_0x269bf6[_0xd351('0x4e')]({'plain':!![]});return _0x3da123['Agents'];});return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x6fd03b['params']['id']}})[_0xd351('0x22')](function(_0x46745f){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x37d882){return _0x46745f['addTeams'](_0x4ab9b9,{'transaction':_0x37d882})[_0xd351('0x22')](function(){return BPromise[_0xd351('0x79')](_0x581e66,function(_0x5ceda1){return db[_0xd351('0x7a')]['upsert']({'TeamId':_0x5ceda1['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},{'transaction':_0x37d882});});})[_0xd351('0x22')](function(){return BPromise['each'](_0x4cadbe,function(_0x1f0812){return db[_0xd351('0x7b')][_0xd351('0x7c')]({'where':{'UserId':_0x1f0812['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},'transaction':_0x37d882});});})[_0xd351('0x22')](function(){_0x4cadbe['forEach'](function(_0x23b2fe){socket['emit'](_0xd351('0x69'),{'UserId':_0x23b2fe['id'],'VoicePrefixId':_0x46745f['id']});});});});});}})[_0xd351('0x22')](respondWithStatusCode(_0x19d16a,null))[_0xd351('0x41')](handleError(_0x19d16a,null));};exports[_0xd351('0x7d')]=function(_0x160102,_0x24ac40,_0x3b2690){return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x160102['query'][_0xd351('0x66')]},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':_0xd351('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xd351('0x22')](handleEntityNotFound(_0x24ac40,null))['then'](function(_0x280220){var _0x4f8f00=_[_0xd351('0x2b')](_0x280220,'id');var _0x107886=[];var _0x3a3633=[];var _0x403312=squel[_0xd351('0x7f')]();_0x403312['field'](_0xd351('0x80'))[_0xd351('0x81')]('team_has_voice_prefixes','tq')['join'](_0xd351('0x82'),'ut',_0xd351('0x83'))[_0xd351('0x39')](_0xd351('0x84'),_0x160102[_0xd351('0x43')]['id']);for(var _0x1373c0=0x0;_0x1373c0<_0x280220[_0xd351('0x44')];_0x1373c0+=0x1){let _0x78b55c=_0x280220[_0x1373c0];for(var _0x2de03c=0x0;_0x2de03c<_0x78b55c[_0xd351('0x7e')][_0xd351('0x44')];_0x2de03c+=0x1){let _0x6f4c1e=_0x78b55c[_0xd351('0x7e')][_0x2de03c];var _0x56b88b=_0x403312['clone']();_0x56b88b[_0xd351('0x39')]('ut.UserId\x20=\x20?',_0x6f4c1e['id']);_0x3a3633[_0xd351('0x5f')](db[_0xd351('0x78')][_0xd351('0x30')](_0x56b88b[_0xd351('0x85')](),{'type':db[_0xd351('0x78')][_0xd351('0x86')]['SELECT']})[_0xd351('0x22')](function(_0x2725c4){if(_0x2725c4['length']===0x1){return _0x6f4c1e['id'];}else{var _0x31c1dc=_['every'](_['map'](_0x2725c4,_0xd351('0x87')),function(_0x2f188b){return _['includes'](_0x4f8f00,_0x2f188b);});if(_0x31c1dc){return _0x6f4c1e['id'];}}}));}}return BPromise[_0xd351('0x88')](_0x3a3633)[_0xd351('0x22')](function(_0x5126a1){_0x107886=_(_0x107886)[_0xd351('0x89')](_0x5126a1)[_0xd351('0x8a')]()[_0xd351('0x8b')]();return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x160102['params']['id']}})[_0xd351('0x22')](function(_0x1db9db){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x2ef116){return _0x1db9db[_0xd351('0x7d')](_0x160102[_0xd351('0x30')][_0xd351('0x66')],{'transaction':_0x2ef116})[_0xd351('0x22')](function(){if(!_[_0xd351('0x8c')](_0x107886)){return _0x1db9db[_0xd351('0x6a')](_0x107886,{'transaction':_0x2ef116});}})[_0xd351('0x22')](function(){_0x107886[_0xd351('0x8d')](function(_0x585e94){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':_0x585e94,'VoicePrefixId':_0x1db9db['id']});});});});});});})[_0xd351('0x22')](respondWithStatusCode(_0x24ac40,null))[_0xd351('0x41')](handleError(_0x24ac40,null));};
\ No newline at end of file
index 20a7ae0..80c8936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x754a=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x44401b,_0x3fe37d){var _0x45cc85=function(_0x87cfbf){while(--_0x87cfbf){_0x44401b['push'](_0x44401b['shift']());}};_0x45cc85(++_0x3fe37d);}(_0x754a,0xb3));var _0xa754=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x754a[_0xd09668];return _0x68726;};'use strict';var EventEmitter=require(_0xa754('0x0'));var VoicePrefix=require(_0xa754('0x1'))['db'][_0xa754('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa754('0x3')](0x0);var events={'afterCreate':_0xa754('0x4'),'afterUpdate':_0xa754('0x5'),'afterDestroy':'remove'};function emitEvent(_0x224138){return function(_0x3ff61a,_0x52feb0,_0x40d084){VoicePrefixEvents[_0xa754('0x6')](_0x224138+':'+_0x3ff61a['id'],_0x3ff61a);VoicePrefixEvents[_0xa754('0x6')](_0x224138,_0x3ff61a);_0x40d084(null);};}for(var e in events){if(events[_0xa754('0x7')](e)){var event=events[e];VoicePrefix[_0xa754('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0x289b=['VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x463a6e,_0x1b47b5){var _0x51d8c6=function(_0x21f507){while(--_0x21f507){_0x463a6e['push'](_0x463a6e['shift']());}};_0x51d8c6(++_0x1b47b5);}(_0x289b,0x184));var _0xb289=function(_0x11c06e,_0x1cb9c7){_0x11c06e=_0x11c06e-0x0;var _0x20a7dc=_0x289b[_0x11c06e];return _0x20a7dc;};'use strict';var EventEmitter=require(_0xb289('0x0'));var VoicePrefix=require(_0xb289('0x1'))['db'][_0xb289('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xb289('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb289('0x4'),'afterDestroy':_0xb289('0x5')};function emitEvent(_0x279ab){return function(_0x26e130,_0x1535df,_0x18cf38){VoicePrefixEvents[_0xb289('0x6')](_0x279ab+':'+_0x26e130['id'],_0x26e130);VoicePrefixEvents['emit'](_0x279ab,_0x26e130);_0x18cf38(null);};}for(var e in events){if(events[_0xb289('0x7')](e)){var event=events[e];VoicePrefix[_0xb289('0x8')](e,emitEvent(event));}}module[_0xb289('0x9')]=VoicePrefixEvents;
\ No newline at end of file
index 073ea0d..0e96c4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0147=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','api'];(function(_0x243dce,_0x548bcf){var _0x482b9d=function(_0x504104){while(--_0x504104){_0x243dce['push'](_0x243dce['shift']());}};_0x482b9d(++_0x548bcf);}(_0x0147,0x77));var _0x7014=function(_0x30e481,_0xd14ac1){_0x30e481=_0x30e481-0x0;var _0x127ea9=_0x0147[_0x30e481];return _0x127ea9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7014('0x0'));var moment=require(_0x7014('0x1'));var BPromise=require(_0x7014('0x2'));var rp=require(_0x7014('0x3'));var fs=require('fs');var path=require(_0x7014('0x4'));var rimraf=require(_0x7014('0x5'));var config=require(_0x7014('0x6'));var attributes=require(_0x7014('0x7'));module[_0x7014('0x8')]=function(_0x583e71,_0x190284){return _0x583e71[_0x7014('0x9')](_0x7014('0xa'),attributes,{'tableName':_0x7014('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ed7=['rimraf','../../config/environment','define','VoicePrefix','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4ed7,0x1ee));var _0x74ed=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x4ed7[_0x15fc7a];return _0x3aa9f4;};'use strict';var _=require(_0x74ed('0x0'));var util=require('util');var logger=require(_0x74ed('0x1'))('api');var moment=require(_0x74ed('0x2'));var BPromise=require(_0x74ed('0x3'));var rp=require(_0x74ed('0x4'));var fs=require('fs');var path=require(_0x74ed('0x5'));var rimraf=require(_0x74ed('0x6'));var config=require(_0x74ed('0x7'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x41d5a0,_0x539261){return _0x41d5a0[_0x74ed('0x8')](_0x74ed('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3859e76..94b004f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd2f=['localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x319f6d,_0x20e9bd){var _0x4f631f=function(_0x1b984f){while(--_0x1b984f){_0x319f6d['push'](_0x319f6d['shift']());}};_0x4f631f(++_0x20e9bd);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xcd2f[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfcd2('0x0'));var rs=require(_0xfcd2('0x1'));var fs=require('fs');var Redis=require(_0xfcd2('0x2'));var db=require(_0xfcd2('0x3'))['db'];var utils=require(_0xfcd2('0x4'));var logger=require(_0xfcd2('0x5'))(_0xfcd2('0x6'));var config=require(_0xfcd2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfcd2('0x8')][_0xfcd2('0x9')]({'port':0x232a});config[_0xfcd2('0xa')]=_[_0xfcd2('0xb')](config[_0xfcd2('0xa')],{'host':_0xfcd2('0xc'),'port':0x18eb});var socket=require(_0xfcd2('0xd'))(new Redis(config[_0xfcd2('0xa')]));require(_0xfcd2('0xe'))[_0xfcd2('0xf')](socket);function respondWithRpcPromise(_0x3c4880,_0x53999a,_0x5994cf){return new BPromise(function(_0x18fa4d,_0x24cd5d){return client[_0xfcd2('0x10')](_0x3c4880,_0x5994cf)[_0xfcd2('0x11')](function(_0x53777e){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x53999a,'request\x20sent');logger['debug'](_0xfcd2('0x12'),_0x53999a,_0xfcd2('0x13'),JSON['stringify'](_0x53777e));if(_0x53777e[_0xfcd2('0x14')]){if(_0x53777e[_0xfcd2('0x14')]['code']===0x1f4){logger['error'](_0xfcd2('0x15'),_0x53999a,_0x53777e[_0xfcd2('0x14')][_0xfcd2('0x16')]);return _0x24cd5d(_0x53777e[_0xfcd2('0x14')][_0xfcd2('0x16')]);}logger['error'](_0xfcd2('0x15'),_0x53999a,_0x53777e[_0xfcd2('0x14')][_0xfcd2('0x16')]);return _0x18fa4d(_0x53777e[_0xfcd2('0x14')][_0xfcd2('0x16')]);}else{logger[_0xfcd2('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x53999a,_0xfcd2('0x13'));_0x18fa4d(_0x53777e[_0xfcd2('0x18')][_0xfcd2('0x16')]);}})[_0xfcd2('0x19')](function(_0x580184){logger[_0xfcd2('0x14')](_0xfcd2('0x15'),_0x53999a,_0x580184);_0x24cd5d(_0x580184);});});}
\ No newline at end of file
+var _0x27eb=['localhost','./voicePrefix.socket','register','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x538230,_0x522250){var _0x30f32b=function(_0x37a340){while(--_0x37a340){_0x538230['push'](_0x538230['shift']());}};_0x30f32b(++_0x522250);}(_0x27eb,0xd0));var _0xb27e=function(_0xb8b838,_0x2e2f0c){_0xb8b838=_0xb8b838-0x0;var _0x54038d=_0x27eb[_0xb8b838];return _0x54038d;};'use strict';var _=require(_0xb27e('0x0'));var util=require(_0xb27e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb27e('0x2'));var fs=require('fs');var Redis=require(_0xb27e('0x3'));var db=require(_0xb27e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb27e('0x5'))(_0xb27e('0x6'));var config=require(_0xb27e('0x7'));var jayson=require(_0xb27e('0x8'));var client=jayson['client'][_0xb27e('0x9')]({'port':0x232a});config[_0xb27e('0xa')]=_[_0xb27e('0xb')](config[_0xb27e('0xa')],{'host':_0xb27e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb27e('0xa')]));require(_0xb27e('0xd'))[_0xb27e('0xe')](socket);function respondWithRpcPromise(_0x2e9752,_0x26ea1f,_0x51a872){return new BPromise(function(_0x2b7bdc,_0x11bd85){return client['request'](_0x2e9752,_0x51a872)['then'](function(_0x38a41d){logger['info'](_0xb27e('0xf'),_0x26ea1f,_0xb27e('0x10'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x26ea1f,'request\x20sent',JSON[_0xb27e('0x11')](_0x38a41d));if(_0x38a41d['error']){if(_0x38a41d[_0xb27e('0x12')]['code']===0x1f4){logger[_0xb27e('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x26ea1f,_0x38a41d[_0xb27e('0x12')][_0xb27e('0x13')]);return _0x11bd85(_0x38a41d[_0xb27e('0x12')]['message']);}logger[_0xb27e('0x12')](_0xb27e('0xf'),_0x26ea1f,_0x38a41d[_0xb27e('0x12')][_0xb27e('0x13')]);return _0x2b7bdc(_0x38a41d[_0xb27e('0x12')][_0xb27e('0x13')]);}else{logger[_0xb27e('0x14')](_0xb27e('0xf'),_0x26ea1f,_0xb27e('0x10'));_0x2b7bdc(_0x38a41d['result'][_0xb27e('0x13')]);}})[_0xb27e('0x15')](function(_0x26bbf9){logger['error'](_0xb27e('0xf'),_0x26ea1f,_0x26bbf9);_0x11bd85(_0x26bbf9);});});}
\ No newline at end of file
index 0a7edb6..c05eafc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e81=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','emit'];(function(_0x4d0a08,_0x4f0797){var _0x319b51=function(_0x6f75af){while(--_0x6f75af){_0x4d0a08['push'](_0x4d0a08['shift']());}};_0x319b51(++_0x4f0797);}(_0x4e81,0x1bc));var _0x14e8=function(_0x53f04f,_0x419aa8){_0x53f04f=_0x53f04f-0x0;var _0x16a824=_0x4e81[_0x53f04f];return _0x16a824;};'use strict';var VoicePrefixEvents=require(_0x14e8('0x0'));var events=[_0x14e8('0x1'),_0x14e8('0x2'),'update'];function createListener(_0x4b9800,_0x4cda11){return function(_0x2184fc){_0x4cda11[_0x14e8('0x3')](_0x4b9800,_0x2184fc);};}function removeListener(_0x224121,_0x436444){return function(){VoicePrefixEvents[_0x14e8('0x4')](_0x224121,_0x436444);};}exports[_0x14e8('0x5')]=function(_0x56a266){for(var _0x57c79b=0x0,_0x3e73d2=events[_0x14e8('0x6')];_0x57c79b<_0x3e73d2;_0x57c79b++){var _0x21f860=events[_0x57c79b];var _0x3c1b93=createListener(_0x14e8('0x7')+_0x21f860,_0x56a266);VoicePrefixEvents['on'](_0x21f860,_0x3c1b93);}};
\ No newline at end of file
+var _0xcd60=['register','length','./voicePrefix.events','save','remove','update','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd60,0xf0));var _0x0cd6=function(_0x5b5e83,_0x4ecef2){_0x5b5e83=_0x5b5e83-0x0;var _0x1dd7fe=_0xcd60[_0x5b5e83];return _0x1dd7fe;};'use strict';var VoicePrefixEvents=require(_0x0cd6('0x0'));var events=[_0x0cd6('0x1'),_0x0cd6('0x2'),_0x0cd6('0x3')];function createListener(_0x15e600,_0x455593){return function(_0x155444){_0x455593['emit'](_0x15e600,_0x155444);};}function removeListener(_0x10c2b8,_0x117c2e){return function(){VoicePrefixEvents[_0x0cd6('0x4')](_0x10c2b8,_0x117c2e);};}exports[_0x0cd6('0x5')]=function(_0x3b4f35){for(var _0x5f4525=0x0,_0x2ceb47=events[_0x0cd6('0x6')];_0x5f4525<_0x2ceb47;_0x5f4525++){var _0x47c8b2=events[_0x5f4525];var _0x4714bf=createListener('voicePrefix:'+_0x47c8b2,_0x3b4f35);VoicePrefixEvents['on'](_0x47c8b2,_0x4714bf);}};
\ No newline at end of file
index a39f45b..1e972e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0xb10b,0x12a));var _0xbb10=function(_0x354b70,_0x2ee366){_0x354b70=_0x354b70-0x0;var _0x56a7e8=_0xb10b[_0x354b70];return _0x56a7e8;};'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('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
+var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x30a34b,_0x45d8f3){var _0x3cbeb0=function(_0x28c732){while(--_0x28c732){_0x30a34b['push'](_0x30a34b['shift']());}};_0x3cbeb0(++_0x45d8f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
index 216c38e..3e6c951 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7198=['https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','name','ENUM','outbound','inbound','STRING','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','periodic_announce','join','getDataValue','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX'];(function(_0x54c695,_0x5d6677){var _0x3ce06b=function(_0x55bdf1){while(--_0x55bdf1){_0x54c695['push'](_0x54c695['shift']());}};_0x3ce06b(++_0x5d6677);}(_0x7198,0x115));var _0x8719=function(_0x3273e3,_0x587f59){_0x3273e3=_0x3273e3-0x0;var _0x37da75=_0x7198[_0x3273e3];return _0x37da75;};'use strict';var Sequelize=require('sequelize');module[_0x8719('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8719('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8719('0x2')]('inbound',_0x8719('0x3')),'allowNull':![],'defaultValue':_0x8719('0x4')},'musiconhold':{'type':Sequelize[_0x8719('0x5')],'defaultValue':_0x8719('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x8719('0x7'),_0x8719('0x8'),_0x8719('0x9'),_0x8719('0xa'),'rrmemory',_0x8719('0xb'),_0x8719('0xc'),_0x8719('0xd')),'allowNull':![],'defaultValue':_0x8719('0x7'),'set':function(_0x3d3106){this[_0x8719('0xe')](_0x8719('0xf'),_0x3d3106?_0x3d3106:_0x8719('0x10'));},'get':function(){var _0x36c1bb=this['getDataValue']('type');var _0x496bfb=this['getDataValue'](_0x8719('0x11'));var _0x287792=this['getDataValue'](_0x8719('0xf'));if(_0x36c1bb==='inbound'){return _0x287792;}if(_0x496bfb===_0x8719('0x12')&&_0x287792==='rrmemory'||_0x496bfb===_0x8719('0x12')&&_0x287792===_0x8719('0x13')){return _0x287792;}if(_0x496bfb===_0x8719('0x14')||_0x496bfb===_0x8719('0x15')||_0x496bfb===_0x8719('0x16')){return _0x287792;}return null;}},'servicelevel':{'type':Sequelize[_0x8719('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8719('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8719('0x5')]},'weight':{'type':Sequelize[_0x8719('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8719('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8719('0x2')](_0x8719('0x18'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x8719('0x2')](_0x8719('0x18'),'no',_0x8719('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8719('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x8719('0x2')](_0x8719('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x8719('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8719('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x8719('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8719('0x2')](_0x8719('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8719('0x2')](_0x8719('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x8719('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8719('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8719('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8719('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8719('0x2')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8719('0x2')]('yes','no'),'defaultValue':_0x8719('0x18')},'announce_holdtime':{'type':Sequelize[_0x8719('0x2')]('yes','no',_0x8719('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8719('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8719('0x2')](_0x8719('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8719('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8719('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8719('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8719('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8719('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8719('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8719('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8719('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x8719('0x5')]},'queue_quantity2':{'type':Sequelize[_0x8719('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x8719('0x5')]},'queue_less_than':{'type':Sequelize[_0x8719('0x5')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x398f81){this[_0x8719('0xe')](_0x8719('0x1b'),_0x398f81?_0x398f81[_0x8719('0x1c')](','):[]);},'get':function(){return this[_0x8719('0x1d')](_0x8719('0x1b'))?this[_0x8719('0x1d')](_0x8719('0x1b'))[_0x8719('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x8719('0x5')],'defaultValue':_0x8719('0x18'),'set':function(_0xfd9020){this[_0x8719('0xe')]('joinempty',_0xfd9020?_0xfd9020['join'](','):undefined);},'get':function(){return this[_0x8719('0x1d')](_0x8719('0x1f'))?this[_0x8719('0x1d')]('joinempty')[_0x8719('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8719('0x5')],'defaultValue':'no','set':function(_0x58382a){this['setDataValue'](_0x8719('0x20'),_0x58382a?_0x58382a[_0x8719('0x1c')](','):undefined);},'get':function(){return this[_0x8719('0x1d')](_0x8719('0x20'))?this[_0x8719('0x1d')](_0x8719('0x20'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8719('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8719('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8719('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8719('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x8719('0x21')],'defaultValue':0x0,'set':function(_0x21723a){this[_0x8719('0xe')](_0x8719('0x22'),_0x21723a);if(_0x21723a){if(this[_0x8719('0x1d')](_0x8719('0x23'))<0x2){this[_0x8719('0xe')](_0x8719('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8719('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8719('0x21')],'defaultValue':0x0,'comment':_0x8719('0x24')},'dialMethod':{'type':Sequelize[_0x8719('0x2')](_0x8719('0x25'),_0x8719('0x14'),_0x8719('0x16'),_0x8719('0x15'),'booked'),'defaultValue':_0x8719('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x8719('0x17')](0x4)[_0x8719('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8719('0x27')},'dialLimitQueue':{'type':Sequelize[_0x8719('0x17')](0x4)[_0x8719('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x8719('0x28')](0x2)[_0x8719('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x8719('0x29')),'defaultValue':_0x8719('0x29'),'comment':_0x8719('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8719('0x28')](0x2)[_0x8719('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8719('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8719('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8719('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8719('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x8719('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8719('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x8719('0x5')],'defaultValue':_0x8719('0x2e'),'comment':_0x8719('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8719('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8719('0x17')](0x5)[_0x8719('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8719('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8719('0x17')](0x5)[_0x8719('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8719('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0x3,'comment':_0x8719('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8719('0x17')](0x5)[_0x8719('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8719('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8719('0x35')},'dialTimezone':{'type':Sequelize[_0x8719('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8719('0x5')],'defaultValue':_0x8719('0x36')},'dialPrefix':{'type':Sequelize[_0x8719('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8719('0x37'),'never',_0x8719('0x38')),'defaultValue':_0x8719('0x37')},'dialAMDActive':{'type':Sequelize[_0x8719('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x8719('0x17')](0x9)[_0x8719('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8719('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x8719('0x17')](0x9)[_0x8719('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8719('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8719('0x17')](0x9)[_0x8719('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8719('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8719('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8719('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x8719('0x17')](0x9)[_0x8719('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8719('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x8719('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8719('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8719('0x17')](0x5)[_0x8719('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8719('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8719('0x17')](0x9)[_0x8719('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8719('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x8719('0x17')](0x5)[_0x8719('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8719('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x8719('0x21')],'defaultValue':0x0,'comment':_0x8719('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8719('0x2')]('DESC',_0x8719('0x42')),'defaultValue':_0x8719('0x43')},'dialQueueProject2':{'type':Sequelize[_0x8719('0x5')],'comment':_0x8719('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8719('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8719('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x8719('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8719('0x45')},'dialCutDigit':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8719('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8719('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8719('0x47')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8719('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8719('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8719('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8719('0x17')](0x5)[_0x8719('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8719('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8719('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8719('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8719('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8719('0x17')](0x5)[_0x8719('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8719('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8719('0x17')],'allowNull':!![],'comment':_0x8719('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x8719('0x21')],'defaultValue':![],'comment':_0x8719('0x4f'),'set':function(_0x302b18){if(!_0x302b18)this[_0x8719('0xe')](_0x8719('0x50'),null);this[_0x8719('0xe')]('mandatoryDisposition',_0x302b18);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8719('0x17')](0x3)[_0x8719('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8719('0x21')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8719('0x21')],'defaultValue':![]}};
\ No newline at end of file
+var _0x28ab=['#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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','dialMethod','getDataValue','booked','roundrobin','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x28ab,0x1f3));var _0xb28a=function(_0x2e3a71,_0x43761a){_0x2e3a71=_0x2e3a71-0x0;var _0x4c97dc=_0x28ab[_0x2e3a71];return _0x4c97dc;};'use strict';var Sequelize=require(_0xb28a('0x0'));module['exports']={'name':{'type':Sequelize[_0xb28a('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x3'),_0xb28a('0x4')),'allowNull':![],'defaultValue':_0xb28a('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xb28a('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xb28a('0x2')]('rr',_0xb28a('0x6'),_0xb28a('0x7'),_0xb28a('0x8'),_0xb28a('0x9'),_0xb28a('0xa'),_0xb28a('0xb'),_0xb28a('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0xb28a('0x6'),'set':function(_0xd9c7cd){this[_0xb28a('0xd')](_0xb28a('0xe'),_0xd9c7cd?_0xd9c7cd:_0xb28a('0xa'));},'get':function(){var _0x55818a=this['getDataValue']('type');var _0x58174c=this['getDataValue'](_0xb28a('0xf'));var _0x1db2ae=this[_0xb28a('0x10')](_0xb28a('0xe'));if(_0x55818a==='inbound'){return _0x1db2ae;}if(_0x58174c==='booked'&&_0x1db2ae===_0xb28a('0xa')||_0x58174c===_0xb28a('0x11')&&_0x1db2ae===_0xb28a('0x12')){return _0x1db2ae;}if(_0x58174c==='progressive'||_0x58174c===_0xb28a('0x13')||_0x58174c===_0xb28a('0x14')){return _0x1db2ae;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb28a('0x15')](0xb)},'timeout':{'type':Sequelize[_0xb28a('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb28a('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no',_0xb28a('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb28a('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb28a('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb28a('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb28a('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':_0xb28a('0x16')},'announce_holdtime':{'type':Sequelize[_0xb28a('0x2')]('yes','no',_0xb28a('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xb28a('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xb28a('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb28a('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb28a('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb28a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xb28a('0x1')]},'queue_quantity2':{'type':Sequelize[_0xb28a('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xb28a('0x1')]},'queue_less_than':{'type':Sequelize[_0xb28a('0x1')]},'periodic_announce':{'type':Sequelize[_0xb28a('0x19')],'set':function(_0x212def){this[_0xb28a('0xd')](_0xb28a('0x1a'),_0x212def?_0x212def[_0xb28a('0x1b')](','):[]);},'get':function(){return this[_0xb28a('0x10')](_0xb28a('0x1a'))?this['getDataValue'](_0xb28a('0x1a'))[_0xb28a('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':_0xb28a('0x16'),'set':function(_0xcadbc){this['setDataValue'](_0xb28a('0x1d'),_0xcadbc?_0xcadbc[_0xb28a('0x1b')](','):undefined);},'get':function(){return this[_0xb28a('0x10')](_0xb28a('0x1d'))?this[_0xb28a('0x10')](_0xb28a('0x1d'))[_0xb28a('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':'no','set':function(_0x5d067b){this[_0xb28a('0xd')](_0xb28a('0x1e'),_0x5d067b?_0x5d067b[_0xb28a('0x1b')](','):undefined);},'get':function(){return this[_0xb28a('0x10')](_0xb28a('0x1e'))?this[_0xb28a('0x10')](_0xb28a('0x1e'))[_0xb28a('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb28a('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb28a('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb28a('0x1')]},'description':{'type':Sequelize[_0xb28a('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0xa1d49d){this[_0xb28a('0xd')](_0xb28a('0x1f'),_0xa1d49d);if(_0xa1d49d){if(this['getDataValue'](_0xb28a('0x20'))<0x2){this[_0xb28a('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb28a('0x21')],'defaultValue':0x0,'comment':_0xb28a('0x22')},'dialMethod':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x23'),_0xb28a('0x24'),_0xb28a('0x14'),_0xb28a('0x13'),'booked'),'defaultValue':_0xb28a('0x24'),'comment':_0xb28a('0x25')},'dialLimitChannel':{'type':Sequelize[_0xb28a('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xb28a('0x15')](0x4)[_0xb28a('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb28a('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xb28a('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb28a('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xb28a('0x29'),_0xb28a('0x2a')),'defaultValue':_0xb28a('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb28a('0x2b')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb28a('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb28a('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb28a('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb28a('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb28a('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':_0xb28a('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xb28a('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb28a('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb28a('0x15')](0x5)[_0xb28a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb28a('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb28a('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb28a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb28a('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'comment':_0xb28a('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb28a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb28a('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb28a('0x37')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':_0xb28a('0x38')},'dialPrefix':{'type':Sequelize[_0xb28a('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb28a('0x2')](_0xb28a('0x39'),_0xb28a('0x3a'),_0xb28a('0x3b')),'defaultValue':_0xb28a('0x39')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb28a('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb28a('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xb28a('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb28a('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb28a('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb28a('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb28a('0x15')](0x9)[_0xb28a('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb28a('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0xb28a('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb28a('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb28a('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb28a('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb28a('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb28a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb28a('0x15')](0x9)[_0xb28a('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb28a('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xb28a('0x15')](0x5)[_0xb28a('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb28a('0x43')},'dialRecallInQueue':{'type':Sequelize[_0xb28a('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb28a('0x2')]('DESC',_0xb28a('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xb28a('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb28a('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb28a('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb28a('0x45')},'dialCutDigit':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb28a('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb28a('0x15')](0x5)[_0xb28a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb28a('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb28a('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0xb28a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb28a('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb28a('0x15')](0x5)[_0xb28a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb28a('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb28a('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb28a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb28a('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb28a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb28a('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb28a('0x15')](0x5)[_0xb28a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb28a('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb28a('0x21')],'defaultValue':![],'comment':_0xb28a('0x4f'),'set':function(_0x2a2e99){if(!_0x2a2e99)this['setDataValue'](_0xb28a('0x50'),null);this[_0xb28a('0xd')](_0xb28a('0x51'),_0x2a2e99);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb28a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb28a('0x15')](0x3)[_0xb28a('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xb28a('0x21')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xb28a('0x21')],'defaultValue':![]}};
\ No newline at end of file
index 5276862..6663dd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86eb=['type','find','name','UserProfileResource','destroy','error','stack','send','map','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','merge','options','VoiceQueue','includeAll','findAll','rows','params','include','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','getHoppers','findOne','CmHopper','sort','getHopperHistories','order','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','interface','flatMap','forEach','penalty','sequelize','transaction','TeamVoiceQueue','findOrCreate','each','upsert','isNil','format','voicePause','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','TeamId','all','union','compact','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','insert','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','json','reject','save','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','value','includes'];(function(_0x59c5db,_0x2baa34){var _0x1162ce=function(_0x11f36d){while(--_0x11f36d){_0x59c5db['push'](_0x59c5db['shift']());}};_0x1162ce(++_0x2baa34);}(_0x86eb,0x85));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xb86e('0x0'));var rimraf=require(_0xb86e('0x1'));var zipdir=require(_0xb86e('0x2'));var jsonpatch=require(_0xb86e('0x3'));var rp=require(_0xb86e('0x4'));var moment=require(_0xb86e('0x5'));var BPromise=require(_0xb86e('0x6'));var Mustache=require(_0xb86e('0x7'));var util=require(_0xb86e('0x8'));var path=require(_0xb86e('0x9'));var sox=require(_0xb86e('0xa'));var csv=require(_0xb86e('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb86e('0xc'));var _=require(_0xb86e('0xd'));var squel=require(_0xb86e('0xe'));var crypto=require(_0xb86e('0xf'));var jsforce=require(_0xb86e('0x10'));var deskjs=require(_0xb86e('0x11'));var toCsv=require(_0xb86e('0xb'));var querystring=require(_0xb86e('0x12'));var Papa=require(_0xb86e('0x13'));var Redis=require(_0xb86e('0x14'));var authService=require(_0xb86e('0x15'));var qs=require(_0xb86e('0x16'));var as=require(_0xb86e('0x17'));var hardwareService=require(_0xb86e('0x18'));var logger=require('../../config/logger')(_0xb86e('0x19'));var utils=require(_0xb86e('0x1a'));var config=require(_0xb86e('0x1b'));var licenseUtil=require(_0xb86e('0x1c'));var db=require('../../mysqldb')['db'];config[_0xb86e('0x1d')]=_[_0xb86e('0x1e')](config['redis'],{'host':_0xb86e('0x1f'),'port':0x18eb});var socket=require(_0xb86e('0x20'))(new Redis(config[_0xb86e('0x1d')]));require(_0xb86e('0x21'))[_0xb86e('0x22')](socket);function respondWithStatusCode(_0x45a14f,_0xf4b145){_0xf4b145=_0xf4b145||0xcc;return function(_0x400fa3){if(_0x400fa3){return _0x45a14f[_0xb86e('0x23')](_0xf4b145);}return _0x45a14f['status'](_0xf4b145)[_0xb86e('0x24')]();};}function respondWithResult(_0x3f4c86,_0x17f454){_0x17f454=_0x17f454||0xc8;return function(_0x48e1f5){if(_0x48e1f5){return _0x3f4c86[_0xb86e('0x25')](_0x17f454)['json'](_0x48e1f5);}};}function respondWithFilteredResult(_0x514137,_0x3b0186){return function(_0x10762a){if(_0x10762a){var _0x446fb7=typeof _0x3b0186[_0xb86e('0x26')]===_0xb86e('0x27')&&typeof _0x3b0186['limit']===_0xb86e('0x27');var _0x261029=_0x10762a[_0xb86e('0x28')];var _0xc6411e=_0x446fb7?0x0:_0x3b0186[_0xb86e('0x26')];var _0x1a4b70=_0x446fb7?_0x10762a[_0xb86e('0x28')]:_0x3b0186[_0xb86e('0x26')]+_0x3b0186[_0xb86e('0x29')];var _0x1bb75d;if(_0x1a4b70>=_0x261029){_0x1a4b70=_0x261029;_0x1bb75d=0xc8;}else{_0x1bb75d=0xce;}_0x514137[_0xb86e('0x25')](_0x1bb75d);return _0x514137[_0xb86e('0x2a')]('Content-Range',_0xc6411e+'-'+_0x1a4b70+'/'+_0x261029)[_0xb86e('0x2b')](_0x10762a);}return null;};}function patchUpdates(_0x1a89a8){return function(_0xa23afb){try{jsonpatch['apply'](_0xa23afb,_0x1a89a8,!![]);}catch(_0x5c25ed){return BPromise[_0xb86e('0x2c')](_0x5c25ed);}return _0xa23afb[_0xb86e('0x2d')]();};}function saveUpdates(_0x28e61b,_0xe41ecf){return function(_0xb565f){if(_0xb565f){return _0xb565f['update'](_0x28e61b)[_0xb86e('0x2e')](function(_0x386d57){return _0x386d57;});}return null;};}function removeEntity(_0x5c8eb0,_0x3975e4){return function(_0x26ba49){if(_0x26ba49){return _0x26ba49['destroy']()[_0xb86e('0x2e')](function(){var _0x312573=_0x26ba49[_0xb86e('0x2f')]({'plain':!![]});var _0x5b6585=[{'name':_0xb86e('0x30'),'value':_0xb86e('0x31'),'ignore':![]},{'name':_0xb86e('0x32'),'value':_0xb86e('0x33'),'ignore':![]}];var _0x11ebff=_(_0x5b6585)[_0xb86e('0x34')]('ignore')['map']('value')[_0xb86e('0x35')]();if(_[_0xb86e('0x36')](_0x11ebff,_0x312573[_0xb86e('0x37')])){return;}var _0x56a2a6=_[_0xb86e('0x38')](_0x5b6585,[_0xb86e('0x35'),_0x312573['type']])[_0xb86e('0x39')];return db[_0xb86e('0x3a')][_0xb86e('0x3b')]({'where':{'type':_0x56a2a6,'resourceId':_0x312573['id']}})['then'](function(){return _0x26ba49;});})[_0xb86e('0x2e')](function(){_0x5c8eb0[_0xb86e('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e1ede,_0x4fa7e2){return function(_0x35df62){if(!_0x35df62){_0x5e1ede[_0xb86e('0x23')](0x194);}return _0x35df62;};}function handleError(_0x33e70d,_0x16f7b2){_0x16f7b2=_0x16f7b2||0x1f4;return function(_0x2479ae){logger[_0xb86e('0x3c')](_0x2479ae[_0xb86e('0x3d')]);if(_0x2479ae[_0xb86e('0x39')]){delete _0x2479ae[_0xb86e('0x39')];}_0x33e70d[_0xb86e('0x25')](_0x16f7b2)[_0xb86e('0x3e')](_0x2479ae);};}exports['index']=function(_0x44c757,_0x142a5e){var _0x8ba474={},_0x2e94e7={},_0x4a4604={'count':0x0,'rows':[]};var _0x1ad084=_[_0xb86e('0x3f')](db['VoiceQueue'][_0xb86e('0x40')],function(_0x5dcfc1){return{'name':_0x5dcfc1[_0xb86e('0x41')],'type':_0x5dcfc1['type'][_0xb86e('0x42')]};});_0x2e94e7[_0xb86e('0x43')]=_['map'](_0x1ad084,_0xb86e('0x39'));_0x2e94e7['query']=_[_0xb86e('0x44')](_0x44c757['query']);_0x2e94e7[_0xb86e('0x45')]=_['intersection'](_0x2e94e7[_0xb86e('0x43')],_0x2e94e7[_0xb86e('0x46')]);_0x8ba474[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x2e94e7['model'],qs[_0xb86e('0x49')](_0x44c757[_0xb86e('0x46')][_0xb86e('0x49')]));_0x8ba474['attributes']=_0x8ba474[_0xb86e('0x47')][_0xb86e('0x4a')]?_0x8ba474[_0xb86e('0x47')]:_0x2e94e7[_0xb86e('0x43')];if(!_0x44c757[_0xb86e('0x46')][_0xb86e('0x4b')](_0xb86e('0x4c'))){_0x8ba474[_0xb86e('0x29')]=qs['limit'](_0x44c757['query'][_0xb86e('0x29')]);_0x8ba474['offset']=qs[_0xb86e('0x26')](_0x44c757[_0xb86e('0x46')]['offset']);}_0x8ba474['order']=qs['sort'](_0x44c757[_0xb86e('0x46')]['sort']);_0x8ba474[_0xb86e('0x4d')]=qs[_0xb86e('0x45')](_[_0xb86e('0x4e')](_0x44c757[_0xb86e('0x46')],_0x2e94e7[_0xb86e('0x45')]),_0x1ad084);if(_0x44c757['query'][_0xb86e('0x34')]){_0x8ba474['where']=_[_0xb86e('0x4f')](_0x8ba474[_0xb86e('0x4d')],{'$or':_[_0xb86e('0x3f')](_0x1ad084,function(_0x1eef0d){if(_0x1eef0d[_0xb86e('0x37')]!=='VIRTUAL'){var _0x3c0f51={};_0x3c0f51[_0x1eef0d[_0xb86e('0x39')]]={'$like':'%'+_0x44c757['query'][_0xb86e('0x34')]+'%'};return _0x3c0f51;}})});}_0x8ba474=_['merge']({},_0x8ba474,_0x44c757[_0xb86e('0x50')]);var _0x2381ed={'where':_0x8ba474[_0xb86e('0x4d')]};return db[_0xb86e('0x51')][_0xb86e('0x28')](_0x2381ed)[_0xb86e('0x2e')](function(_0x4fceda){_0x4a4604[_0xb86e('0x28')]=_0x4fceda;if(_0x44c757[_0xb86e('0x46')][_0xb86e('0x52')]){_0x8ba474['include']=[{'all':!![]}];}return db[_0xb86e('0x51')][_0xb86e('0x53')](_0x8ba474);})['then'](function(_0x212e3d){_0x4a4604[_0xb86e('0x54')]=_0x212e3d;return _0x4a4604;})[_0xb86e('0x2e')](respondWithFilteredResult(_0x142a5e,_0x8ba474))['catch'](handleError(_0x142a5e,null));};exports['show']=function(_0x163125,_0x1b74ca){var _0x43403f={'raw':![],'where':{'id':_0x163125[_0xb86e('0x55')]['id']}},_0x5a719c={};_0x5a719c[_0xb86e('0x43')]=_['keys'](db[_0xb86e('0x51')][_0xb86e('0x40')]);_0x5a719c['query']=_[_0xb86e('0x44')](_0x163125[_0xb86e('0x46')]);_0x5a719c['filters']=_['intersection'](_0x5a719c[_0xb86e('0x43')],_0x5a719c[_0xb86e('0x46')]);_0x43403f[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x5a719c[_0xb86e('0x43')],qs[_0xb86e('0x49')](_0x163125['query'][_0xb86e('0x49')]));_0x43403f[_0xb86e('0x47')]=_0x43403f[_0xb86e('0x47')][_0xb86e('0x4a')]?_0x43403f[_0xb86e('0x47')]:_0x5a719c[_0xb86e('0x43')];if(_0x163125[_0xb86e('0x46')]['includeAll']){_0x43403f[_0xb86e('0x56')]=[{'all':!![]}];}_0x43403f=_[_0xb86e('0x4f')]({},_0x43403f,_0x163125[_0xb86e('0x50')]);return db[_0xb86e('0x51')][_0xb86e('0x38')](_0x43403f)['then'](handleEntityNotFound(_0x1b74ca,null))[_0xb86e('0x2e')](respondWithResult(_0x1b74ca,null))[_0xb86e('0x57')](handleError(_0x1b74ca,null));};exports[_0xb86e('0x58')]=function(_0x4c9f16,_0x166875){return db[_0xb86e('0x51')]['create'](_0x4c9f16[_0xb86e('0x59')],{})[_0xb86e('0x2e')](function(_0x3d0995){var _0x1da45b=_0x4c9f16[_0xb86e('0x5a')][_0xb86e('0x2f')]({'plain':!![]});if(!_0x1da45b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1da45b[_0xb86e('0x5b')]===_0xb86e('0x5a')){var _0x58c799=_0x3d0995[_0xb86e('0x2f')]({'plain':!![]});var _0x2ce765=[{'name':_0xb86e('0x30'),'value':_0xb86e('0x31')},{'name':_0xb86e('0x32'),'value':_0xb86e('0x33')}];var _0x50c9cf=_[_0xb86e('0x38')](_0x2ce765,['value',_0x58c799[_0xb86e('0x37')]])[_0xb86e('0x39')];return db[_0xb86e('0x5c')][_0xb86e('0x38')]({'where':{'name':_0x50c9cf,'userProfileId':_0x1da45b[_0xb86e('0x5d')]},'raw':!![]})['then'](function(_0x25b03e){if(_0x25b03e&&_0x25b03e[_0xb86e('0x5e')]===0x0){return db[_0xb86e('0x3a')]['create']({'name':_0x58c799[_0xb86e('0x39')],'resourceId':_0x58c799['id'],'type':_0x25b03e[_0xb86e('0x39')],'sectionId':_0x25b03e['id']},{})[_0xb86e('0x2e')](function(){return _0x3d0995;});}else{return _0x3d0995;}})[_0xb86e('0x57')](function(_0x241992){logger['error'](_0xb86e('0x5f'),_0x241992);throw _0x241992;});}return _0x3d0995;})[_0xb86e('0x2e')](respondWithResult(_0x166875,0xc9))['catch'](handleError(_0x166875,null));};exports[_0xb86e('0x60')]=function(_0x50161c,_0x4a0cd1){var _0x27d6a2={'where':{'id':_0x50161c[_0xb86e('0x55')]['id']}},_0x3bda3e={};_0x3bda3e[_0xb86e('0x43')]=_['keys'](db[_0xb86e('0x51')][_0xb86e('0x40')]);_0x27d6a2['attributes']=_[_0xb86e('0x48')](_0x3bda3e['model'],qs['fields'](_0x50161c[_0xb86e('0x46')][_0xb86e('0x49')]));_0x27d6a2[_0xb86e('0x47')]=_0x27d6a2[_0xb86e('0x47')][_0xb86e('0x4a')]?_0x27d6a2[_0xb86e('0x47')]:_0x3bda3e[_0xb86e('0x43')];if(_0x50161c[_0xb86e('0x46')][_0xb86e('0x52')]){_0x27d6a2[_0xb86e('0x56')]=[{'all':!![]}];}_0x27d6a2=_[_0xb86e('0x4f')]({},_0x27d6a2,_0x50161c[_0xb86e('0x50')]);return db[_0xb86e('0x51')][_0xb86e('0x38')](_0x27d6a2)[_0xb86e('0x2e')](handleEntityNotFound(_0x4a0cd1,null))[_0xb86e('0x2e')](function(_0x3e5f43){if(_0x3e5f43){var _0x584cdb=_0x3e5f43[_0xb86e('0x2f')]({'plain':!![]});_0x584cdb=qs[_0xb86e('0x61')](_0x584cdb,['id',_0xb86e('0x62'),_0xb86e('0x63')]);_0x50161c[_0xb86e('0x59')]=_[_0xb86e('0x61')](_0x50161c[_0xb86e('0x59')],['id',_0xb86e('0x62'),_0xb86e('0x63')]);return db[_0xb86e('0x51')]['create'](_[_0xb86e('0x4f')](_0x584cdb,_0x50161c[_0xb86e('0x59')]),{'include':_0x50161c[_0xb86e('0x46')][_0xb86e('0x52')]?[{'all':!![]}]:undefined})[_0xb86e('0x2e')](function(_0x585d86){var _0x1cd2ef=_0x50161c['user'][_0xb86e('0x2f')]({'plain':!![]});if(!_0x1cd2ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cd2ef[_0xb86e('0x5b')]==='user'){var _0x1f547d=_0x585d86[_0xb86e('0x2f')]({'plain':!![]});var _0x2af8ed=[{'name':_0xb86e('0x30'),'value':_0xb86e('0x31')},{'name':_0xb86e('0x32'),'value':_0xb86e('0x33')}];var _0xb96691=_[_0xb86e('0x38')](_0x2af8ed,['value',_0x1f547d[_0xb86e('0x37')]])['name'];return db['UserProfileSection'][_0xb86e('0x38')]({'where':{'name':_0xb96691,'userProfileId':_0x1cd2ef[_0xb86e('0x5d')]},'raw':!![]})[_0xb86e('0x2e')](function(_0x309c72){if(_0x309c72&&_0x309c72[_0xb86e('0x5e')]===0x0){return db[_0xb86e('0x3a')][_0xb86e('0x58')]({'name':_0x1f547d['name'],'resourceId':_0x1f547d['id'],'type':_0x309c72[_0xb86e('0x39')],'sectionId':_0x309c72['id']},{})[_0xb86e('0x2e')](function(){return _0x585d86;});}else{return _0x585d86;}})[_0xb86e('0x57')](function(_0x31d00a){logger[_0xb86e('0x3c')](_0xb86e('0x5f'),_0x31d00a);throw _0x31d00a;});}return _0x585d86;});}})['then'](respondWithResult(_0x4a0cd1,0xc9))[_0xb86e('0x57')](handleError(_0x4a0cd1,null));};exports[_0xb86e('0x64')]=function(_0x3a3a86,_0x30aabd){if(_0x3a3a86[_0xb86e('0x59')]['id']){delete _0x3a3a86[_0xb86e('0x59')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x3a3a86['params']['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x30aabd,null))[_0xb86e('0x2e')](saveUpdates(_0x3a3a86['body'],null))['then'](respondWithResult(_0x30aabd,null))[_0xb86e('0x57')](handleError(_0x30aabd,null));};exports['destroy']=function(_0x711c74,_0xcc91b5){return db[_0xb86e('0x51')][_0xb86e('0x38')]({'where':{'id':_0x711c74[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0xcc91b5,null))['then'](removeEntity(_0xcc91b5,null))['catch'](handleError(_0xcc91b5,null));};exports[_0xb86e('0x65')]=function(_0x47bd77,_0x24f7dd,_0x141a56){var _0x6c4b80={'raw':![],'where':{}};var _0x4b09ea={};var _0x1f1d34={'count':0x0,'rows':[]};return db[_0xb86e('0x51')][_0xb86e('0x66')]({'where':{'id':_0x47bd77['params']['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x24f7dd,null))[_0xb86e('0x2e')](function(_0x338edd){if(_0x338edd){_0x4b09ea['model']=_[_0xb86e('0x44')](db[_0xb86e('0x67')][_0xb86e('0x40')]);_0x4b09ea[_0xb86e('0x46')]=_[_0xb86e('0x44')](_0x47bd77[_0xb86e('0x46')]);_0x4b09ea[_0xb86e('0x45')]=_[_0xb86e('0x48')](_0x4b09ea[_0xb86e('0x43')],_0x4b09ea['query']);_0x6c4b80[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x4b09ea[_0xb86e('0x43')],qs['fields'](_0x47bd77[_0xb86e('0x46')][_0xb86e('0x49')]));_0x6c4b80[_0xb86e('0x47')]=_0x6c4b80[_0xb86e('0x47')][_0xb86e('0x4a')]?_0x6c4b80[_0xb86e('0x47')]:_0x4b09ea[_0xb86e('0x43')];if(!_0x47bd77['query'][_0xb86e('0x4b')]('nolimit')){_0x6c4b80[_0xb86e('0x29')]=qs[_0xb86e('0x29')](_0x47bd77[_0xb86e('0x46')][_0xb86e('0x29')]);_0x6c4b80['offset']=qs[_0xb86e('0x26')](_0x47bd77['query'][_0xb86e('0x26')]);}_0x6c4b80['order']=qs[_0xb86e('0x68')](_0x47bd77[_0xb86e('0x46')][_0xb86e('0x68')]);_0x6c4b80[_0xb86e('0x4d')]=qs['filters'](_[_0xb86e('0x4e')](_0x47bd77[_0xb86e('0x46')],_0x4b09ea[_0xb86e('0x45')]));_0x6c4b80[_0xb86e('0x4d')]['VoiceQueueId']=_0x338edd['id'];if(_0x47bd77[_0xb86e('0x46')][_0xb86e('0x34')]){_0x6c4b80['where']=_[_0xb86e('0x4f')](_0x6c4b80[_0xb86e('0x4d')],{'$or':_['map'](_0x6c4b80[_0xb86e('0x47')],function(_0x24e2d6){var _0x3daf3a={};_0x3daf3a[_0x24e2d6]={'$like':'%'+_0x47bd77[_0xb86e('0x46')][_0xb86e('0x34')]+'%'};return _0x3daf3a;})});}_0x6c4b80=_['merge']({},_0x6c4b80,_0x47bd77[_0xb86e('0x50')]);return db['CmHopper'][_0xb86e('0x28')]({'where':_0x6c4b80['where']})['then'](function(_0x42e82f){_0x1f1d34[_0xb86e('0x28')]=_0x42e82f;if(_0x47bd77[_0xb86e('0x46')][_0xb86e('0x52')]){_0x6c4b80[_0xb86e('0x56')]=[{'all':!![]}];}return db[_0xb86e('0x67')][_0xb86e('0x53')](_0x6c4b80);})[_0xb86e('0x2e')](function(_0x3235e2){_0x1f1d34[_0xb86e('0x54')]=_0x3235e2;return _0x1f1d34;});}})[_0xb86e('0x2e')](respondWithFilteredResult(_0x24f7dd,_0x6c4b80))[_0xb86e('0x57')](handleError(_0x24f7dd,null));};exports[_0xb86e('0x69')]=function(_0x48fe6a,_0x184f70,_0x4413a3){var _0x389bb9={'raw':!![],'where':{}};var _0x21dbe6={};var _0x4dd248={'count':0x0,'rows':[]};return db[_0xb86e('0x51')]['findOne']({'where':{'id':_0x48fe6a[_0xb86e('0x55')]['id']}})['then'](handleEntityNotFound(_0x184f70,null))[_0xb86e('0x2e')](function(_0x1f0f09){if(_0x1f0f09){_0x21dbe6['model']=_[_0xb86e('0x44')](db['CmHopperHistory'][_0xb86e('0x40')]);_0x21dbe6[_0xb86e('0x46')]=_[_0xb86e('0x44')](_0x48fe6a[_0xb86e('0x46')]);_0x21dbe6['filters']=_['intersection'](_0x21dbe6[_0xb86e('0x43')],_0x21dbe6[_0xb86e('0x46')]);_0x389bb9['attributes']=_[_0xb86e('0x48')](_0x21dbe6[_0xb86e('0x43')],qs[_0xb86e('0x49')](_0x48fe6a[_0xb86e('0x46')][_0xb86e('0x49')]));_0x389bb9[_0xb86e('0x47')]=_0x389bb9[_0xb86e('0x47')]['length']?_0x389bb9['attributes']:_0x21dbe6[_0xb86e('0x43')];if(!_0x48fe6a[_0xb86e('0x46')]['hasOwnProperty']('nolimit')){_0x389bb9[_0xb86e('0x29')]=qs[_0xb86e('0x29')](_0x48fe6a[_0xb86e('0x46')][_0xb86e('0x29')]);_0x389bb9['offset']=qs['offset'](_0x48fe6a['query'][_0xb86e('0x26')]);}_0x389bb9[_0xb86e('0x6a')]=qs[_0xb86e('0x68')](_0x48fe6a[_0xb86e('0x46')][_0xb86e('0x68')]);_0x389bb9['where']=qs[_0xb86e('0x45')](_[_0xb86e('0x4e')](_0x48fe6a[_0xb86e('0x46')],_0x21dbe6[_0xb86e('0x45')]));_0x389bb9[_0xb86e('0x4d')][_0xb86e('0x6b')]=_0x1f0f09['id'];if(_0x48fe6a[_0xb86e('0x46')][_0xb86e('0x34')]){_0x389bb9[_0xb86e('0x4d')]=_[_0xb86e('0x4f')](_0x389bb9[_0xb86e('0x4d')],{'$or':_[_0xb86e('0x3f')](_0x389bb9[_0xb86e('0x47')],function(_0x5f021a){var _0x3c44d3={};_0x3c44d3[_0x5f021a]={'$like':'%'+_0x48fe6a[_0xb86e('0x46')]['filter']+'%'};return _0x3c44d3;})});}_0x389bb9=_[_0xb86e('0x4f')]({},_0x389bb9,_0x48fe6a[_0xb86e('0x50')]);return db[_0xb86e('0x6c')][_0xb86e('0x28')]({'where':_0x389bb9['where']})[_0xb86e('0x2e')](function(_0x2323ec){_0x4dd248[_0xb86e('0x28')]=_0x2323ec;if(_0x48fe6a['query']['includeAll']){_0x389bb9[_0xb86e('0x56')]=[{'all':!![]}];}return db[_0xb86e('0x6c')][_0xb86e('0x53')](_0x389bb9);})['then'](function(_0x57d2e9){_0x4dd248['rows']=_0x57d2e9;return _0x4dd248;});}})['then'](respondWithFilteredResult(_0x184f70,_0x389bb9))[_0xb86e('0x57')](handleError(_0x184f70,null));};exports[_0xb86e('0x6d')]=function(_0x2fdb8d,_0x3b4ec8,_0x582504){var _0x11d6f5={'raw':!![],'where':{}};var _0x4b172b={};var _0x1fe3c7={'count':0x0,'rows':[]};return db[_0xb86e('0x51')][_0xb86e('0x66')]({'where':{'id':_0x2fdb8d[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x3b4ec8,null))[_0xb86e('0x2e')](function(_0x3b40ff){if(_0x3b40ff){_0x4b172b[_0xb86e('0x43')]=_[_0xb86e('0x44')](db['CmHopperFinal'][_0xb86e('0x40')]);_0x4b172b[_0xb86e('0x46')]=_[_0xb86e('0x44')](_0x2fdb8d[_0xb86e('0x46')]);_0x4b172b[_0xb86e('0x45')]=_[_0xb86e('0x48')](_0x4b172b[_0xb86e('0x43')],_0x4b172b[_0xb86e('0x46')]);_0x11d6f5[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x4b172b[_0xb86e('0x43')],qs['fields'](_0x2fdb8d[_0xb86e('0x46')][_0xb86e('0x49')]));_0x11d6f5[_0xb86e('0x47')]=_0x11d6f5['attributes'][_0xb86e('0x4a')]?_0x11d6f5[_0xb86e('0x47')]:_0x4b172b[_0xb86e('0x43')];if(!_0x2fdb8d[_0xb86e('0x46')][_0xb86e('0x4b')](_0xb86e('0x4c'))){_0x11d6f5[_0xb86e('0x29')]=qs['limit'](_0x2fdb8d[_0xb86e('0x46')][_0xb86e('0x29')]);_0x11d6f5[_0xb86e('0x26')]=qs[_0xb86e('0x26')](_0x2fdb8d[_0xb86e('0x46')]['offset']);}_0x11d6f5[_0xb86e('0x6a')]=qs[_0xb86e('0x68')](_0x2fdb8d[_0xb86e('0x46')][_0xb86e('0x68')]);_0x11d6f5[_0xb86e('0x4d')]=qs[_0xb86e('0x45')](_['pick'](_0x2fdb8d[_0xb86e('0x46')],_0x4b172b['filters']));_0x11d6f5[_0xb86e('0x4d')][_0xb86e('0x6b')]=_0x3b40ff['id'];if(_0x2fdb8d[_0xb86e('0x46')]['filter']){_0x11d6f5[_0xb86e('0x4d')]=_[_0xb86e('0x4f')](_0x11d6f5[_0xb86e('0x4d')],{'$or':_[_0xb86e('0x3f')](_0x11d6f5['attributes'],function(_0x4d1a04){var _0x4c961f={};_0x4c961f[_0x4d1a04]={'$like':'%'+_0x2fdb8d[_0xb86e('0x46')][_0xb86e('0x34')]+'%'};return _0x4c961f;})});}_0x11d6f5=_[_0xb86e('0x4f')]({},_0x11d6f5,_0x2fdb8d[_0xb86e('0x50')]);return db[_0xb86e('0x6e')][_0xb86e('0x28')]({'where':_0x11d6f5['where']})[_0xb86e('0x2e')](function(_0x11c791){_0x1fe3c7['count']=_0x11c791;if(_0x2fdb8d[_0xb86e('0x46')][_0xb86e('0x52')]){_0x11d6f5[_0xb86e('0x56')]=[{'all':!![]}];}return db[_0xb86e('0x6e')][_0xb86e('0x53')](_0x11d6f5);})[_0xb86e('0x2e')](function(_0x10e13a){_0x1fe3c7[_0xb86e('0x54')]=_0x10e13a;return _0x1fe3c7;});}})['then'](respondWithFilteredResult(_0x3b4ec8,_0x11d6f5))[_0xb86e('0x57')](handleError(_0x3b4ec8,null));};exports['getHopperBlacks']=function(_0x3e2ffa,_0x5408c5,_0x533fe8){var _0x2d34b0={'raw':!![],'where':{}};var _0x1236d4={};var _0x2b229f={'count':0x0,'rows':[]};return db[_0xb86e('0x51')][_0xb86e('0x66')]({'where':{'id':_0x3e2ffa[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x5408c5,null))[_0xb86e('0x2e')](function(_0x4b73b4){if(_0x4b73b4){_0x1236d4['model']=_[_0xb86e('0x44')](db[_0xb86e('0x6f')]['rawAttributes']);_0x1236d4[_0xb86e('0x46')]=_[_0xb86e('0x44')](_0x3e2ffa[_0xb86e('0x46')]);_0x1236d4['filters']=_[_0xb86e('0x48')](_0x1236d4[_0xb86e('0x43')],_0x1236d4[_0xb86e('0x46')]);_0x2d34b0[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x1236d4['model'],qs[_0xb86e('0x49')](_0x3e2ffa[_0xb86e('0x46')][_0xb86e('0x49')]));_0x2d34b0[_0xb86e('0x47')]=_0x2d34b0[_0xb86e('0x47')]['length']?_0x2d34b0['attributes']:_0x1236d4[_0xb86e('0x43')];if(!_0x3e2ffa[_0xb86e('0x46')]['hasOwnProperty'](_0xb86e('0x4c'))){_0x2d34b0['limit']=qs['limit'](_0x3e2ffa[_0xb86e('0x46')][_0xb86e('0x29')]);_0x2d34b0[_0xb86e('0x26')]=qs['offset'](_0x3e2ffa[_0xb86e('0x46')][_0xb86e('0x26')]);}_0x2d34b0[_0xb86e('0x6a')]=qs[_0xb86e('0x68')](_0x3e2ffa[_0xb86e('0x46')][_0xb86e('0x68')]);_0x2d34b0[_0xb86e('0x4d')]=qs[_0xb86e('0x45')](_[_0xb86e('0x4e')](_0x3e2ffa[_0xb86e('0x46')],_0x1236d4[_0xb86e('0x45')]));_0x2d34b0[_0xb86e('0x4d')][_0xb86e('0x6b')]=_0x4b73b4['id'];if(_0x3e2ffa['query'][_0xb86e('0x34')]){_0x2d34b0['where']=_[_0xb86e('0x4f')](_0x2d34b0[_0xb86e('0x4d')],{'$or':_['map'](_0x2d34b0['attributes'],function(_0x31ec84){var _0x5eaf6a={};_0x5eaf6a[_0x31ec84]={'$like':'%'+_0x3e2ffa[_0xb86e('0x46')][_0xb86e('0x34')]+'%'};return _0x5eaf6a;})});}_0x2d34b0=_['merge']({},_0x2d34b0,_0x3e2ffa['options']);return db[_0xb86e('0x6f')][_0xb86e('0x28')]({'where':_0x2d34b0[_0xb86e('0x4d')]})[_0xb86e('0x2e')](function(_0x1f48ff){_0x2b229f[_0xb86e('0x28')]=_0x1f48ff;if(_0x3e2ffa[_0xb86e('0x46')][_0xb86e('0x52')]){_0x2d34b0[_0xb86e('0x56')]=[{'all':!![]}];}return db[_0xb86e('0x6f')][_0xb86e('0x53')](_0x2d34b0);})[_0xb86e('0x2e')](function(_0x5a06ca){_0x2b229f[_0xb86e('0x54')]=_0x5a06ca;return _0x2b229f;});}})[_0xb86e('0x2e')](respondWithFilteredResult(_0x5408c5,_0x2d34b0))[_0xb86e('0x57')](handleError(_0x5408c5,null));};exports[_0xb86e('0x70')]=function(_0x1b3369,_0x5b3c23,_0x3132e8){var _0x54c25b={};var _0xab557c={};var _0xe4bfd8;var _0x208cee;return db[_0xb86e('0x51')]['findOne']({'where':{'id':_0x1b3369[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x5b3c23,null))[_0xb86e('0x2e')](function(_0x11c5d1){if(_0x11c5d1){_0xe4bfd8=_0x11c5d1;_0xab557c['model']=_[_0xb86e('0x44')](db[_0xb86e('0x71')][_0xb86e('0x40')]);_0xab557c[_0xb86e('0x46')]=_[_0xb86e('0x44')](_0x1b3369[_0xb86e('0x46')]);_0xab557c[_0xb86e('0x45')]=_['intersection'](_0xab557c[_0xb86e('0x43')],_0xab557c[_0xb86e('0x46')]);_0x54c25b['attributes']=_['intersection'](_0xab557c[_0xb86e('0x43')],qs[_0xb86e('0x49')](_0x1b3369[_0xb86e('0x46')][_0xb86e('0x49')]));_0x54c25b[_0xb86e('0x47')]=_0x54c25b['attributes'][_0xb86e('0x4a')]?_0x54c25b[_0xb86e('0x47')]:_0xab557c['model'];_0x54c25b['order']=qs[_0xb86e('0x68')](_0x1b3369[_0xb86e('0x46')][_0xb86e('0x68')]);_0x54c25b[_0xb86e('0x4d')]=qs[_0xb86e('0x45')](_[_0xb86e('0x4e')](_0x1b3369[_0xb86e('0x46')],_0xab557c[_0xb86e('0x45')]));if(_0x1b3369[_0xb86e('0x46')][_0xb86e('0x34')]){_0x54c25b['where']=_[_0xb86e('0x4f')](_0x54c25b[_0xb86e('0x4d')],{'$or':_[_0xb86e('0x3f')](_0x54c25b['attributes'],function(_0x289d95){var _0x5ae7df={};_0x5ae7df[_0x289d95]={'$like':'%'+_0x1b3369['query'][_0xb86e('0x34')]+'%'};return _0x5ae7df;})});}_0x54c25b=_[_0xb86e('0x4f')]({},_0x54c25b,_0x1b3369[_0xb86e('0x50')]);return _0xe4bfd8[_0xb86e('0x70')](_0x54c25b);}})[_0xb86e('0x2e')](function(_0x29adfd){if(_0x29adfd){_0x208cee=_0x29adfd[_0xb86e('0x4a')];if(!_0x1b3369[_0xb86e('0x46')][_0xb86e('0x4b')](_0xb86e('0x4c'))){_0x54c25b[_0xb86e('0x29')]=qs['limit'](_0x1b3369[_0xb86e('0x46')][_0xb86e('0x29')]);_0x54c25b[_0xb86e('0x26')]=qs[_0xb86e('0x26')](_0x1b3369['query'][_0xb86e('0x26')]);}return _0xe4bfd8['getTeams'](_0x54c25b);}})[_0xb86e('0x2e')](function(_0xce07ae){if(_0xce07ae){return _0xce07ae?{'count':_0x208cee,'rows':_0xce07ae}:null;}})[_0xb86e('0x2e')](respondWithResult(_0x5b3c23,null))['catch'](handleError(_0x5b3c23,null));};exports[_0xb86e('0x72')]=function(_0x29e9d4,_0x36f156,_0x5ed4a8){var _0x1eac84=_0x29e9d4[_0xb86e('0x59')][_0xb86e('0x73')];var _0x1e840f=_[_0xb86e('0x3f')](_0x1eac84,'id');return db[_0xb86e('0x71')][_0xb86e('0x53')]({'where':{'id':_0x1e840f},'attributes':['id'],'include':[{'model':db[_0xb86e('0x74')],'as':_0xb86e('0x75'),'attributes':['id',_0xb86e('0x39'),'online','voicePause',_0xb86e('0x76')],'raw':!![]}]})[_0xb86e('0x2e')](function(_0x4208cf){if(_0x4208cf){var _0x53b446=_[_0xb86e('0x77')](_0x4208cf,function(_0x98bb9f){var _0x1104d3=_0x98bb9f[_0xb86e('0x2f')]({'plain':!![]});_0x1104d3['Agents'][_0xb86e('0x78')](function(_0x5038d8){_0x5038d8['penalty']=_[_0xb86e('0x38')](_0x1eac84,{'id':_0x1104d3['id']})[_0xb86e('0x79')];});return _0x1104d3[_0xb86e('0x75')];});return db[_0xb86e('0x51')][_0xb86e('0x38')]({'where':{'id':_0x29e9d4[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](function(_0x279805){return db[_0xb86e('0x7a')][_0xb86e('0x7b')](function(_0x20917d){return _0x279805['addTeams'](_0x1e840f,{'transaction':_0x20917d})[_0xb86e('0x2e')](function(){return BPromise['each'](_0x1eac84,function(_0x476e8f){return db[_0xb86e('0x7c')]['upsert']({'TeamId':_0x476e8f['id'],'VoiceQueueId':_0x29e9d4[_0xb86e('0x55')]['id'],'penalty':_0x476e8f[_0xb86e('0x79')]},{'transaction':_0x20917d});});})[_0xb86e('0x2e')](function(){return BPromise['each'](_0x53b446,function(_0x2475be){return db['UserVoiceQueue'][_0xb86e('0x7d')]({'where':{'UserId':_0x2475be['id'],'VoiceQueueId':_0x29e9d4[_0xb86e('0x55')]['id']},'defaults':{'penalty':_0x2475be[_0xb86e('0x79')]},'transaction':_0x20917d});});})[_0xb86e('0x2e')](function(){return BPromise[_0xb86e('0x7e')](_[_0xb86e('0x34')](_0x53b446,{'online':!![]}),function(_0x1d5f60){return db['UserVoiceQueueRt'][_0xb86e('0x7f')]({'membername':_0x1d5f60['name'],'UserId':_0x1d5f60['id'],'queue_name':_0x279805[_0xb86e('0x39')],'VoiceQueueId':_0x279805['id'],'interface':_[_0xb86e('0x80')](_0x1d5f60[_0xb86e('0x76')])?util[_0xb86e('0x81')]('SIP/%s',_0x1d5f60['name']):_0x1d5f60[_0xb86e('0x76')],'paused':_0x1d5f60[_0xb86e('0x82')]||![],'penalty':_0x1d5f60[_0xb86e('0x79')]},{'transaction':_0x20917d});});})[_0xb86e('0x2e')](function(){_0x53b446['forEach'](function(_0x5b85fb){socket[_0xb86e('0x83')](_0xb86e('0x84'),{'UserId':_0x5b85fb['id'],'VoiceQueueId':_0x279805['id']});});});});});}})[_0xb86e('0x2e')](respondWithStatusCode(_0x36f156,null))[_0xb86e('0x57')](handleError(_0x36f156,null));};exports[_0xb86e('0x85')]=function(_0x1f48e1,_0x218eb2,_0x365322){return db[_0xb86e('0x71')][_0xb86e('0x53')]({'where':{'id':_0x1f48e1[_0xb86e('0x46')][_0xb86e('0x86')]},'attributes':['id'],'include':[{'model':db[_0xb86e('0x74')],'as':_0xb86e('0x75'),'attributes':['id'],'raw':!![]}]})[_0xb86e('0x2e')](handleEntityNotFound(_0x218eb2,null))[_0xb86e('0x2e')](function(_0x2942a9){var _0x3b2adb=_[_0xb86e('0x3f')](_0x2942a9,'id');var _0xbf27e8=[];var _0x32633b=[];var _0x316348=squel['select']();_0x316348[_0xb86e('0x87')](_0xb86e('0x88'))['from'](_0xb86e('0x89'),'tq')[_0xb86e('0x8a')](_0xb86e('0x8b'),'ut',_0xb86e('0x8c'))[_0xb86e('0x4d')](_0xb86e('0x8d'),_0x1f48e1[_0xb86e('0x55')]['id']);for(var _0x2cd98a=0x0;_0x2cd98a<_0x2942a9[_0xb86e('0x4a')];_0x2cd98a+=0x1){let _0x4736a7=_0x2942a9[_0x2cd98a];for(var _0x419c95=0x0;_0x419c95<_0x4736a7[_0xb86e('0x75')][_0xb86e('0x4a')];_0x419c95+=0x1){let _0x30f8e8=_0x4736a7[_0xb86e('0x75')][_0x419c95];var _0x17b5a9=_0x316348[_0xb86e('0x60')]();_0x17b5a9[_0xb86e('0x4d')](_0xb86e('0x8e'),_0x30f8e8['id']);_0x32633b[_0xb86e('0x8f')](db['sequelize'][_0xb86e('0x46')](_0x17b5a9['toString'](),{'type':db['sequelize']['QueryTypes'][_0xb86e('0x90')]})[_0xb86e('0x2e')](function(_0x23c166){if(_0x23c166[_0xb86e('0x4a')]===0x1){return _0x30f8e8['id'];}else{var _0x1ca952=_['every'](_[_0xb86e('0x3f')](_0x23c166,_0xb86e('0x91')),function(_0x8c1733){return _['includes'](_0x3b2adb,_0x8c1733);});if(_0x1ca952){return _0x30f8e8['id'];}}}));}}return BPromise[_0xb86e('0x92')](_0x32633b)[_0xb86e('0x2e')](function(_0x5a1ff2){_0xbf27e8=_(_0xbf27e8)[_0xb86e('0x93')](_0x5a1ff2)[_0xb86e('0x94')]()['value']();return db[_0xb86e('0x51')][_0xb86e('0x38')]({'where':{'id':_0x1f48e1[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](function(_0xcad4ba){return db[_0xb86e('0x7a')][_0xb86e('0x7b')](function(_0x5c4449){return _0xcad4ba[_0xb86e('0x85')](_0x1f48e1[_0xb86e('0x46')][_0xb86e('0x86')],{'transaction':_0x5c4449})[_0xb86e('0x2e')](function(){if(!_[_0xb86e('0x95')](_0xbf27e8)){return _0xcad4ba['removeAgents'](_0xbf27e8,{'transaction':_0x5c4449})[_0xb86e('0x2e')](function(){return db[_0xb86e('0x96')][_0xb86e('0x3b')]({'where':{'VoiceQueueId':_0x1f48e1[_0xb86e('0x55')]['id'],'UserId':_0xbf27e8},'transaction':_0x5c4449});});}})[_0xb86e('0x2e')](function(){_0xbf27e8['forEach'](function(_0x65b854){socket['emit'](_0xb86e('0x97'),{'UserId':_0x65b854,'VoiceQueueId':_0xcad4ba['id']});});});});});});})[_0xb86e('0x2e')](respondWithStatusCode(_0x218eb2,null))[_0xb86e('0x57')](handleError(_0x218eb2,null));};exports['addAgents']=function(_0x1e5b82,_0x414974,_0x2a487c){var _0x3f26dc,_0x15f4d0;return db['VoiceQueue'][_0xb86e('0x38')]({'where':{'id':_0x1e5b82['params']['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x414974,null))[_0xb86e('0x2e')](function(_0x54fb70){if(_0x54fb70){_0x15f4d0=_0x54fb70;return _0x54fb70[_0xb86e('0x98')](_0x1e5b82[_0xb86e('0x59')][_0xb86e('0x86')],_['omit'](_0x1e5b82[_0xb86e('0x59')],[_0xb86e('0x86'),'id'])||{})['spread'](function(_0x22df33){for(var _0xac7d53=0x0;_0xac7d53<_0x1e5b82[_0xb86e('0x59')][_0xb86e('0x86')][_0xb86e('0x4a')];_0xac7d53+=0x1){socket[_0xb86e('0x83')](_0xb86e('0x84'),{'UserId':Number(_0x1e5b82[_0xb86e('0x59')]['ids'][_0xac7d53]),'VoiceQueueId':Number(_0x1e5b82[_0xb86e('0x55')]['id'])});}return _0x22df33;});}})['then'](function(_0x5a6d70){_0x3f26dc=_0x5a6d70||[];if(_0x15f4d0){return db[_0xb86e('0x74')]['findAll']({'where':{'id':_0x1e5b82[_0xb86e('0x59')][_0xb86e('0x86')]},'attributes':['id',_0xb86e('0x39'),'online',_0xb86e('0x82'),'interface'],'raw':!![]});}})[_0xb86e('0x2e')](function(_0x294ca0){if(!_[_0xb86e('0x95')](_0x294ca0)){var _0x40bf38=[];for(var _0x59e721=0x0;_0x59e721<_0x294ca0['length'];_0x59e721++){if(_0x294ca0[_0x59e721]['online']){_0x40bf38[_0xb86e('0x8f')](db['UserVoiceQueueRt'][_0xb86e('0x7f')]({'membername':_0x294ca0[_0x59e721]['name'],'UserId':_0x294ca0[_0x59e721]['id'],'queue_name':_0x15f4d0[_0xb86e('0x39')],'VoiceQueueId':_0x15f4d0['id'],'interface':_[_0xb86e('0x80')](_0x294ca0[_0x59e721]['interface'])?util[_0xb86e('0x81')](_0xb86e('0x99'),_0x294ca0[_0x59e721][_0xb86e('0x39')]):_0x294ca0[_0x59e721]['interface'],'paused':_0x294ca0[_0x59e721]['voicePause']||![],'penalty':_0x1e5b82[_0xb86e('0x59')][_0xb86e('0x79')]||0x0}));}}return BPromise[_0xb86e('0x92')](_0x40bf38);}})[_0xb86e('0x2e')](function(){return _0x3f26dc;})['then'](respondWithResult(_0x414974,null))[_0xb86e('0x57')](handleError(_0x414974,null));};exports['removeAgents']=function(_0x3146ef,_0x1843dc,_0x5c3e3d){return db[_0xb86e('0x51')][_0xb86e('0x38')]({'where':{'id':_0x3146ef[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x1843dc,null))[_0xb86e('0x2e')](function(_0x36a42b){if(_0x36a42b){return _0x36a42b['removeAgents'](_0x3146ef[_0xb86e('0x46')]['ids'])['then'](function(){if(_[_0xb86e('0x9a')](_0x3146ef[_0xb86e('0x46')][_0xb86e('0x86')])){for(var _0x26ceca=0x0;_0x26ceca<_0x3146ef[_0xb86e('0x46')][_0xb86e('0x86')][_0xb86e('0x4a')];_0x26ceca+=0x1){socket['emit'](_0xb86e('0x97'),{'UserId':Number(_0x3146ef[_0xb86e('0x46')][_0xb86e('0x86')][_0x26ceca]),'VoiceQueueId':Number(_0x3146ef[_0xb86e('0x55')]['id'])});}}else{socket['emit'](_0xb86e('0x97'),{'UserId':Number(_0x3146ef['query'][_0xb86e('0x86')]),'VoiceQueueId':Number(_0x3146ef['params']['id'])});}});}})['then'](function(_0x11df3d){return db[_0xb86e('0x96')][_0xb86e('0x3b')]({'where':{'VoiceQueueId':_0x3146ef[_0xb86e('0x55')]['id'],'UserId':_0x3146ef[_0xb86e('0x46')][_0xb86e('0x86')]}})[_0xb86e('0x2e')](function(){return _0x11df3d;});})[_0xb86e('0x2e')](respondWithStatusCode(_0x1843dc,null))['catch'](handleError(_0x1843dc,null));};exports[_0xb86e('0x9b')]=function(_0x5562ee,_0x71b9d1,_0x36e567){var _0x22078f={};var _0x35d448={};var _0x15506d;var _0x54a486;return db[_0xb86e('0x51')]['findOne']({'where':{'id':_0x5562ee[_0xb86e('0x55')]['id']}})['then'](handleEntityNotFound(_0x71b9d1,null))[_0xb86e('0x2e')](function(_0x1801df){if(_0x1801df){_0x15506d=_0x1801df;_0x35d448['model']=_[_0xb86e('0x44')](db[_0xb86e('0x74')][_0xb86e('0x40')]);_0x35d448['query']=_[_0xb86e('0x44')](_0x5562ee[_0xb86e('0x46')]);_0x35d448[_0xb86e('0x45')]=_[_0xb86e('0x48')](_0x35d448[_0xb86e('0x43')],_0x35d448[_0xb86e('0x46')]);_0x22078f[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x35d448['model'],qs[_0xb86e('0x49')](_0x5562ee[_0xb86e('0x46')][_0xb86e('0x49')]));_0x22078f[_0xb86e('0x47')]=_0x22078f['attributes'][_0xb86e('0x4a')]?_0x22078f[_0xb86e('0x47')]:_0x35d448[_0xb86e('0x43')];_0x22078f[_0xb86e('0x6a')]=qs['sort'](_0x5562ee[_0xb86e('0x46')][_0xb86e('0x68')]);_0x22078f['where']=qs[_0xb86e('0x45')](_[_0xb86e('0x4e')](_0x5562ee[_0xb86e('0x46')],_0x35d448['filters']));if(_0x5562ee[_0xb86e('0x46')][_0xb86e('0x34')]){_0x22078f['where']=_[_0xb86e('0x4f')](_0x22078f['where'],{'$or':_[_0xb86e('0x3f')](_0x22078f[_0xb86e('0x47')],function(_0x55d5d8){var _0x3416ec={};_0x3416ec[_0x55d5d8]={'$like':'%'+_0x5562ee[_0xb86e('0x46')]['filter']+'%'};return _0x3416ec;})});}_0x22078f=_['merge']({},_0x22078f,_0x5562ee[_0xb86e('0x50')]);return _0x15506d['getAgents'](_0x22078f);}})[_0xb86e('0x2e')](function(_0x57ec23){if(_0x57ec23){_0x54a486=_0x57ec23['length'];if(!_0x5562ee['query'][_0xb86e('0x4b')]('nolimit')){_0x22078f[_0xb86e('0x29')]=qs['limit'](_0x5562ee[_0xb86e('0x46')][_0xb86e('0x29')]);_0x22078f[_0xb86e('0x26')]=qs[_0xb86e('0x26')](_0x5562ee['query'][_0xb86e('0x26')]);}return _0x15506d[_0xb86e('0x9b')](_0x22078f);}})[_0xb86e('0x2e')](function(_0x2fbead){if(_0x2fbead){return _0x2fbead?{'count':_0x54a486,'rows':_0x2fbead}:null;}})[_0xb86e('0x2e')](respondWithResult(_0x71b9d1,null))[_0xb86e('0x57')](handleError(_0x71b9d1,null));};exports[_0xb86e('0x9c')]=function(_0x165fee,_0x2e6275,_0x43f162){var _0x1570db={};var _0x50f109={};var _0x15c216;var _0x4cc717;return db[_0xb86e('0x51')][_0xb86e('0x66')]({'where':{'id':_0x165fee[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x2e6275,null))[_0xb86e('0x2e')](function(_0x40c1e0){if(_0x40c1e0){_0x15c216=_0x40c1e0;_0x50f109[_0xb86e('0x43')]=_[_0xb86e('0x44')](db[_0xb86e('0x96')][_0xb86e('0x40')]);_0x50f109[_0xb86e('0x46')]=_[_0xb86e('0x44')](_0x165fee['query']);_0x50f109['filters']=_[_0xb86e('0x48')](_0x50f109[_0xb86e('0x43')],_0x50f109[_0xb86e('0x46')]);_0x1570db[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x50f109[_0xb86e('0x43')],qs[_0xb86e('0x49')](_0x165fee[_0xb86e('0x46')]['fields']));_0x1570db[_0xb86e('0x47')]=_0x1570db['attributes'][_0xb86e('0x4a')]?_0x1570db[_0xb86e('0x47')]:_0x50f109[_0xb86e('0x43')];_0x1570db[_0xb86e('0x6a')]=qs['sort'](_0x165fee[_0xb86e('0x46')]['sort']);_0x1570db[_0xb86e('0x4d')]=qs[_0xb86e('0x45')](_[_0xb86e('0x4e')](_0x165fee[_0xb86e('0x46')],_0x50f109[_0xb86e('0x45')]));if(_0x165fee[_0xb86e('0x46')][_0xb86e('0x34')]){_0x1570db['where']=_[_0xb86e('0x4f')](_0x1570db[_0xb86e('0x4d')],{'$or':_[_0xb86e('0x3f')](_0x1570db[_0xb86e('0x47')],function(_0x5deeed){var _0x3e8110={};_0x3e8110[_0x5deeed]={'$like':'%'+_0x165fee[_0xb86e('0x46')]['filter']+'%'};return _0x3e8110;})});}_0x1570db=_[_0xb86e('0x4f')]({},_0x1570db,_0x165fee[_0xb86e('0x50')]);return _0x15c216[_0xb86e('0x9c')](_0x1570db);}})['then'](function(_0x15785c){if(_0x15785c){_0x4cc717=_0x15785c[_0xb86e('0x4a')];if(!_0x165fee[_0xb86e('0x46')]['hasOwnProperty'](_0xb86e('0x4c'))){_0x1570db[_0xb86e('0x29')]=qs[_0xb86e('0x29')](_0x165fee[_0xb86e('0x46')][_0xb86e('0x29')]);_0x1570db[_0xb86e('0x26')]=qs[_0xb86e('0x26')](_0x165fee[_0xb86e('0x46')][_0xb86e('0x26')]);}return _0x15c216[_0xb86e('0x9c')](_0x1570db);}})[_0xb86e('0x2e')](function(_0x5b1871){return _0x5b1871?{'count':_0x4cc717,'rows':_0x5b1871}:null;})['then'](respondWithResult(_0x2e6275,null))[_0xb86e('0x57')](handleError(_0x2e6275,null));};exports[_0xb86e('0x9d')]=function(_0x16dc74,_0x114982,_0x53e78a){var _0x53144b={};var _0x2966b6={};var _0x2caab0;var _0x1f4e34;return db['VoiceQueue'][_0xb86e('0x66')]({'where':{'id':_0x16dc74[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x114982,null))[_0xb86e('0x2e')](function(_0x551f15){if(_0x551f15){_0x2caab0=_0x551f15;_0x2966b6[_0xb86e('0x43')]=_['keys'](db[_0xb86e('0x9e')]['rawAttributes']);_0x2966b6[_0xb86e('0x46')]=_[_0xb86e('0x44')](_0x16dc74[_0xb86e('0x46')]);_0x2966b6[_0xb86e('0x45')]=_[_0xb86e('0x48')](_0x2966b6['model'],_0x2966b6[_0xb86e('0x46')]);_0x53144b[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x2966b6[_0xb86e('0x43')],qs[_0xb86e('0x49')](_0x16dc74[_0xb86e('0x46')]['fields']));_0x53144b[_0xb86e('0x47')]=_0x53144b[_0xb86e('0x47')][_0xb86e('0x4a')]?_0x53144b['attributes']:_0x2966b6['model'];_0x53144b[_0xb86e('0x6a')]=qs['sort'](_0x16dc74['query'][_0xb86e('0x68')]);_0x53144b[_0xb86e('0x4d')]=qs['filters'](_['pick'](_0x16dc74[_0xb86e('0x46')],_0x2966b6['filters']));if(_0x16dc74[_0xb86e('0x46')][_0xb86e('0x34')]){_0x53144b[_0xb86e('0x4d')]=_[_0xb86e('0x4f')](_0x53144b[_0xb86e('0x4d')],{'$or':_[_0xb86e('0x3f')](_0x53144b['attributes'],function(_0x353a8f){var _0x28fdc1={};_0x28fdc1[_0x353a8f]={'$like':'%'+_0x16dc74[_0xb86e('0x46')]['filter']+'%'};return _0x28fdc1;})});}_0x53144b=_['merge']({},_0x53144b,_0x16dc74[_0xb86e('0x50')]);return _0x2caab0[_0xb86e('0x9d')](_0x53144b);}})[_0xb86e('0x2e')](function(_0x2caa08){if(_0x2caa08){_0x1f4e34=_0x2caa08[_0xb86e('0x4a')];if(!_0x16dc74[_0xb86e('0x46')][_0xb86e('0x4b')](_0xb86e('0x4c'))){_0x53144b[_0xb86e('0x29')]=qs[_0xb86e('0x29')](_0x16dc74[_0xb86e('0x46')][_0xb86e('0x29')]);_0x53144b[_0xb86e('0x26')]=qs['offset'](_0x16dc74['query']['offset']);}return _0x2caab0[_0xb86e('0x9d')](_0x53144b);}})['then'](function(_0xbb5369){if(_0xbb5369){return _0xbb5369?{'count':_0x1f4e34,'rows':_0xbb5369}:null;}})[_0xb86e('0x2e')](respondWithResult(_0x114982,null))['catch'](handleError(_0x114982,null));};exports[_0xb86e('0x9f')]=function(_0x52f108,_0x34bfbb,_0x438213){var _0x475f3d,_0xfd61d3;return db['VoiceQueue']['find']({'where':{'id':_0x52f108[_0xb86e('0x55')]['id']}})['then'](handleEntityNotFound(_0x34bfbb,null))[_0xb86e('0x2e')](function(_0x1bb07d){if(_0x1bb07d){_0xfd61d3=_0x1bb07d;return _0x1bb07d['addLists'](_0x52f108[_0xb86e('0x59')][_0xb86e('0x86')],_[_0xb86e('0x61')](_0x52f108[_0xb86e('0x59')],[_0xb86e('0x86'),'id'])||{});}return null;})[_0xb86e('0xa0')](function(_0x4336ff){var _0x2d6dbd;_0x475f3d=_0x4336ff||[];var _0x50e2d1=[];if(_0x4336ff){for(var _0x4de456=0x0;_0x4de456<_0x4336ff[_0xb86e('0x4a')];_0x4de456+=0x1){var _0x36c986=_0x4336ff[_0x4de456]['get']({'plain':!![]});_0xfd61d3['dialCheckDuplicateType']=_0x52f108[_0xb86e('0x59')][_0xb86e('0xa1')]?_0x52f108[_0xb86e('0x59')][_0xb86e('0xa1')]:_0xfd61d3['dialCheckDuplicateType'];switch(_0xfd61d3['dialCheckDuplicateType']){case _0xb86e('0xa2'):_0x2d6dbd=squel['insert']()[_0xb86e('0xa3')](_0xb86e('0xa4'))[_0xb86e('0xa5')]([_0xb86e('0xa6'),_0xb86e('0xa7'),_0xb86e('0xa8'),_0xb86e('0xa9'),'VoiceQueueId',_0xb86e('0x62'),_0xb86e('0x63')],squel[_0xb86e('0xaa')]()['field'](_0xb86e('0xa6'),_0xb86e('0xa6'))[_0xb86e('0x87')]('NOW()',_0xb86e('0xa7'))[_0xb86e('0x87')]('id',_0xb86e('0xa8'))[_0xb86e('0x87')](_0x36c986[_0xb86e('0xab')][_0xb86e('0xac')](),_0xb86e('0xa9'))[_0xb86e('0x87')](_0x52f108['params']['id'][_0xb86e('0xac')](),_0xb86e('0x6b'))[_0xb86e('0x87')](_0xb86e('0xad'),_0xb86e('0x62'))[_0xb86e('0x87')](_0xb86e('0xad'),_0xb86e('0x63'))[_0xb86e('0xae')](_0xb86e('0xaf'))[_0xb86e('0x4d')](_0xb86e('0xb0'))[_0xb86e('0x4d')](_0xb86e('0xb1'),_0x36c986['CmListId'][_0xb86e('0xac')]())[_0xb86e('0x4d')](_0xb86e('0xb2'))[_0xb86e('0x4d')](_0xb86e('0xb3'),squel[_0xb86e('0xaa')]()[_0xb86e('0x87')](_0xb86e('0xb4'))[_0xb86e('0xae')](_0xb86e('0xb5'))[_0xb86e('0x4d')]('VoiceQueueId\x20=\x20?',_0x52f108[_0xb86e('0x55')]['id'][_0xb86e('0xac')]()))[_0xb86e('0x4d')](_0xb86e('0xb3'),squel['select']()[_0xb86e('0x87')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xb86e('0x4d')](_0xb86e('0x8d'),_0x52f108[_0xb86e('0x55')]['id'][_0xb86e('0xac')]())))[_0xb86e('0xac')]();break;case _0xb86e('0xb6'):_0x2d6dbd=squel[_0xb86e('0xb7')]()[_0xb86e('0xa3')](_0xb86e('0xa4'))[_0xb86e('0xa5')]([_0xb86e('0xa6'),_0xb86e('0xa7'),_0xb86e('0xa8'),_0xb86e('0xa9'),_0xb86e('0x6b'),'createdAt',_0xb86e('0x63')],squel['select']()[_0xb86e('0x87')]('phone',_0xb86e('0xa6'))[_0xb86e('0x87')](_0xb86e('0xad'),_0xb86e('0xa7'))['field']('id',_0xb86e('0xa8'))[_0xb86e('0x87')](_0x36c986[_0xb86e('0xab')][_0xb86e('0xac')](),_0xb86e('0xa9'))[_0xb86e('0x87')](_0x52f108['params']['id']['toString'](),_0xb86e('0x6b'))[_0xb86e('0x87')](_0xb86e('0xad'),'createdAt')[_0xb86e('0x87')](_0xb86e('0xad'),'updatedAt')[_0xb86e('0xae')](_0xb86e('0xaf'))[_0xb86e('0x4d')](_0xb86e('0xb0'))[_0xb86e('0x4d')](_0xb86e('0xb1'),_0x36c986[_0xb86e('0xab')][_0xb86e('0xac')]())['where'](_0xb86e('0xb2'))[_0xb86e('0x4d')](_0xb86e('0xb3'),squel[_0xb86e('0xaa')]()['field']('COALESCE(phone,\x27\x27)')[_0xb86e('0xae')](_0xb86e('0xa4'))['where']('VoiceQueueId\x20=\x20?',_0x52f108['params']['id'][_0xb86e('0xac')]())))[_0xb86e('0xac')]();break;default:_0x2d6dbd=squel[_0xb86e('0xb7')]()['into']('cm_hopper')[_0xb86e('0xa5')]([_0xb86e('0xa6'),_0xb86e('0xa7'),_0xb86e('0xa8'),'ListId','VoiceQueueId',_0xb86e('0x62'),_0xb86e('0x63')],squel[_0xb86e('0xaa')]()[_0xb86e('0x87')]('phone',_0xb86e('0xa6'))[_0xb86e('0x87')]('NOW()',_0xb86e('0xa7'))['field']('id',_0xb86e('0xa8'))[_0xb86e('0x87')](_0x36c986[_0xb86e('0xab')]['toString'](),_0xb86e('0xa9'))[_0xb86e('0x87')](_0x52f108[_0xb86e('0x55')]['id'][_0xb86e('0xac')](),_0xb86e('0x6b'))[_0xb86e('0x87')](_0xb86e('0xad'),_0xb86e('0x62'))['field'](_0xb86e('0xad'),_0xb86e('0x63'))['from'](_0xb86e('0xaf'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x36c986[_0xb86e('0xab')][_0xb86e('0xac')]())[_0xb86e('0x4d')](_0xb86e('0xb2')))['toString']();}_0x50e2d1['push'](db[_0xb86e('0x7a')][_0xb86e('0x46')](_0x2d6dbd));}return BPromise[_0xb86e('0x92')](_0x50e2d1);}})['then'](function(){return _0x475f3d;})['then'](respondWithResult(_0x34bfbb,null))[_0xb86e('0x57')](handleError(_0x34bfbb,null));};exports['removeLists']=function(_0x227b7a,_0x3aa56e,_0x1a82cb){return db['VoiceQueue'][_0xb86e('0x38')]({'where':{'id':_0x227b7a[_0xb86e('0x55')]['id']}})['then'](handleEntityNotFound(_0x3aa56e,null))[_0xb86e('0x2e')](function(_0x305734){if(_0x305734){return _0x305734[_0xb86e('0xb8')](_0x227b7a[_0xb86e('0x46')]['ids']);}})[_0xb86e('0x2e')](function(_0x147dcc){if(_0x147dcc){return db[_0xb86e('0x67')][_0xb86e('0x3b')]({'where':{'ListId':_0x227b7a[_0xb86e('0x46')][_0xb86e('0x86')],'VoiceQueueId':_0x227b7a['params']['id']}})[_0xb86e('0x2e')](function(){return _0x147dcc;});}})['then'](respondWithStatusCode(_0x3aa56e,null))[_0xb86e('0x57')](handleError(_0x3aa56e,null));};exports[_0xb86e('0xb9')]=function(_0x27737a,_0x176883,_0x1841db){var _0x38a782={};var _0x317fae={};var _0x2de2ec;var _0x1f2347;return db['VoiceQueue'][_0xb86e('0x66')]({'where':{'id':_0x27737a[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x176883,null))[_0xb86e('0x2e')](function(_0x2adc26){if(_0x2adc26){_0x2de2ec=_0x2adc26;_0x317fae['model']=_['keys'](db[_0xb86e('0x9e')][_0xb86e('0x40')]);_0x317fae[_0xb86e('0x46')]=_[_0xb86e('0x44')](_0x27737a[_0xb86e('0x46')]);_0x317fae['filters']=_[_0xb86e('0x48')](_0x317fae['model'],_0x317fae[_0xb86e('0x46')]);_0x38a782[_0xb86e('0x47')]=_[_0xb86e('0x48')](_0x317fae[_0xb86e('0x43')],qs['fields'](_0x27737a['query'][_0xb86e('0x49')]));_0x38a782[_0xb86e('0x47')]=_0x38a782[_0xb86e('0x47')][_0xb86e('0x4a')]?_0x38a782[_0xb86e('0x47')]:_0x317fae[_0xb86e('0x43')];_0x38a782[_0xb86e('0x6a')]=qs[_0xb86e('0x68')](_0x27737a[_0xb86e('0x46')][_0xb86e('0x68')]);_0x38a782[_0xb86e('0x4d')]=qs[_0xb86e('0x45')](_[_0xb86e('0x4e')](_0x27737a['query'],_0x317fae[_0xb86e('0x45')]));if(_0x27737a[_0xb86e('0x46')][_0xb86e('0x34')]){_0x38a782[_0xb86e('0x4d')]=_[_0xb86e('0x4f')](_0x38a782[_0xb86e('0x4d')],{'$or':_[_0xb86e('0x3f')](_0x38a782[_0xb86e('0x47')],function(_0x3cbaf5){var _0x204da9={};_0x204da9[_0x3cbaf5]={'$like':'%'+_0x27737a['query'][_0xb86e('0x34')]+'%'};return _0x204da9;})});}_0x38a782=_[_0xb86e('0x4f')]({},_0x38a782,_0x27737a[_0xb86e('0x50')]);return _0x2de2ec['getBlackLists'](_0x38a782);}})[_0xb86e('0x2e')](function(_0x3839a1){if(_0x3839a1){_0x1f2347=_0x3839a1[_0xb86e('0x4a')];if(!_0x27737a[_0xb86e('0x46')]['hasOwnProperty']('nolimit')){_0x38a782[_0xb86e('0x29')]=qs[_0xb86e('0x29')](_0x27737a[_0xb86e('0x46')][_0xb86e('0x29')]);_0x38a782[_0xb86e('0x26')]=qs[_0xb86e('0x26')](_0x27737a[_0xb86e('0x46')][_0xb86e('0x26')]);}return _0x2de2ec[_0xb86e('0xb9')](_0x38a782);}})[_0xb86e('0x2e')](function(_0x267067){if(_0x267067){return _0x267067?{'count':_0x1f2347,'rows':_0x267067}:null;}})[_0xb86e('0x2e')](respondWithResult(_0x176883,null))[_0xb86e('0x57')](handleError(_0x176883,null));};exports[_0xb86e('0xba')]=function(_0x4d1e6c,_0x1e40f3,_0xab4bc2){var _0x306871,_0xa7460a;return db[_0xb86e('0x51')][_0xb86e('0x38')]({'where':{'id':_0x4d1e6c[_0xb86e('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e40f3,null))[_0xb86e('0x2e')](function(_0x2db360){if(_0x2db360){_0xa7460a=_0x2db360;return _0x2db360[_0xb86e('0xba')](_0x4d1e6c[_0xb86e('0x59')][_0xb86e('0x86')],_[_0xb86e('0x61')](_0x4d1e6c[_0xb86e('0x59')],['ids','id'])||{});}return null;})['spread'](function(_0x35594d){var _0x5a2540;_0x306871=_0x35594d||[];var _0x2826f4=[];if(_0x35594d){for(var _0x5b2d99=0x0;_0x5b2d99<_0x35594d[_0xb86e('0x4a')];_0x5b2d99+=0x1){var _0x11c9f1=_0x35594d[_0x5b2d99][_0xb86e('0x2f')]({'plain':!![]});_0x5a2540=squel[_0xb86e('0xb7')]()[_0xb86e('0xa3')]('cm_hopper_black')[_0xb86e('0xa5')]([_0xb86e('0xa6'),_0xb86e('0xa8'),_0xb86e('0xa9'),_0xb86e('0x6b'),_0xb86e('0x62'),_0xb86e('0x63')],squel[_0xb86e('0xaa')]()['field'](_0xb86e('0xa6'),_0xb86e('0xa6'))[_0xb86e('0x87')]('id',_0xb86e('0xa8'))[_0xb86e('0x87')](_0x11c9f1[_0xb86e('0xab')][_0xb86e('0xac')](),_0xb86e('0xa9'))[_0xb86e('0x87')](_0x4d1e6c[_0xb86e('0x55')]['id'][_0xb86e('0xac')](),_0xb86e('0x6b'))['field'](_0xb86e('0xad'),_0xb86e('0x62'))[_0xb86e('0x87')](_0xb86e('0xad'),_0xb86e('0x63'))[_0xb86e('0xae')](_0xb86e('0xaf'))[_0xb86e('0x4d')]('deletedAt\x20IS\x20NULL')['where'](_0xb86e('0xb1'),_0x11c9f1[_0xb86e('0xab')][_0xb86e('0xac')]())[_0xb86e('0x4d')](_0xb86e('0xb2')))[_0xb86e('0xac')]();_0x2826f4[_0xb86e('0x8f')](db[_0xb86e('0x7a')][_0xb86e('0x46')](_0x5a2540));}return BPromise['all'](_0x2826f4);}})['then'](function(){return _0x306871;})[_0xb86e('0x2e')](respondWithResult(_0x1e40f3,null))[_0xb86e('0x57')](handleError(_0x1e40f3,null));};exports[_0xb86e('0xbb')]=function(_0x299d1b,_0x501755,_0x538838){return db[_0xb86e('0x51')][_0xb86e('0x38')]({'where':{'id':_0x299d1b[_0xb86e('0x55')]['id']}})[_0xb86e('0x2e')](handleEntityNotFound(_0x501755,null))[_0xb86e('0x2e')](function(_0x328f6c){if(_0x328f6c){return _0x328f6c['removeBlackLists'](_0x299d1b[_0xb86e('0x46')][_0xb86e('0x86')]);}})[_0xb86e('0x2e')](function(_0x5dd243){if(_0x5dd243){return db[_0xb86e('0x6f')][_0xb86e('0x3b')]({'where':{'ListId':_0x299d1b[_0xb86e('0x46')][_0xb86e('0x86')],'VoiceQueueId':_0x299d1b[_0xb86e('0x55')]['id']}})['then'](function(){return _0x5dd243;});}})[_0xb86e('0x2e')](respondWithStatusCode(_0x501755,null))[_0xb86e('0x57')](handleError(_0x501755,null));};
\ No newline at end of file
+var _0x150c=['include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','clone','omit','createdAt','updatedAt','role','UserProfileSection','autoAssociation','findOne','CmHopper','filters','VoiceQueueId','findAll','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','addTeams','TeamVoiceQueue','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','select','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','push','upsert','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','fromQuery','scheduledAt','ContactId','ListId','field','phone','CmListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','type','find','value','name','UserProfileResource','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll'];(function(_0xc18cfa,_0x2414e3){var _0x38d2a9=function(_0x14a6e8){while(--_0x14a6e8){_0xc18cfa['push'](_0xc18cfa['shift']());}};_0x38d2a9(++_0x2414e3);}(_0x150c,0x66));var _0xc150=function(_0xd37e3d,_0x5c9573){_0xd37e3d=_0xd37e3d-0x0;var _0xff1ac0=_0x150c[_0xd37e3d];return _0xff1ac0;};'use strict';var emlformat=require(_0xc150('0x0'));var rimraf=require(_0xc150('0x1'));var zipdir=require(_0xc150('0x2'));var jsonpatch=require(_0xc150('0x3'));var rp=require(_0xc150('0x4'));var moment=require(_0xc150('0x5'));var BPromise=require(_0xc150('0x6'));var Mustache=require(_0xc150('0x7'));var util=require(_0xc150('0x8'));var path=require(_0xc150('0x9'));var sox=require(_0xc150('0xa'));var csv=require(_0xc150('0xb'));var ejs=require(_0xc150('0xc'));var fs=require('fs');var fs_extra=require(_0xc150('0xd'));var _=require('lodash');var squel=require(_0xc150('0xe'));var crypto=require(_0xc150('0xf'));var jsforce=require(_0xc150('0x10'));var deskjs=require(_0xc150('0x11'));var toCsv=require(_0xc150('0xb'));var querystring=require(_0xc150('0x12'));var Papa=require(_0xc150('0x13'));var Redis=require(_0xc150('0x14'));var authService=require(_0xc150('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xc150('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc150('0x17'));var utils=require(_0xc150('0x18'));var config=require(_0xc150('0x19'));var licenseUtil=require(_0xc150('0x1a'));var db=require(_0xc150('0x1b'))['db'];config[_0xc150('0x1c')]=_[_0xc150('0x1d')](config[_0xc150('0x1c')],{'host':_0xc150('0x1e'),'port':0x18eb});var socket=require(_0xc150('0x1f'))(new Redis(config[_0xc150('0x1c')]));require(_0xc150('0x20'))[_0xc150('0x21')](socket);function respondWithStatusCode(_0x41acde,_0x311961){_0x311961=_0x311961||0xcc;return function(_0x12ca7b){if(_0x12ca7b){return _0x41acde[_0xc150('0x22')](_0x311961);}return _0x41acde[_0xc150('0x23')](_0x311961)[_0xc150('0x24')]();};}function respondWithResult(_0x260181,_0x19ea6e){_0x19ea6e=_0x19ea6e||0xc8;return function(_0x3bac2f){if(_0x3bac2f){return _0x260181[_0xc150('0x23')](_0x19ea6e)[_0xc150('0x25')](_0x3bac2f);}};}function respondWithFilteredResult(_0x345fb5,_0x215dc3){return function(_0x463ab3){if(_0x463ab3){var _0x1dd7db=typeof _0x215dc3['offset']===_0xc150('0x26')&&typeof _0x215dc3['limit']==='undefined';var _0x1994a5=_0x463ab3[_0xc150('0x27')];var _0x4a5f2b=_0x1dd7db?0x0:_0x215dc3['offset'];var _0x2ebb15=_0x1dd7db?_0x463ab3['count']:_0x215dc3[_0xc150('0x28')]+_0x215dc3[_0xc150('0x29')];var _0x2e9d5d;if(_0x2ebb15>=_0x1994a5){_0x2ebb15=_0x1994a5;_0x2e9d5d=0xc8;}else{_0x2e9d5d=0xce;}_0x345fb5['status'](_0x2e9d5d);return _0x345fb5['set'](_0xc150('0x2a'),_0x4a5f2b+'-'+_0x2ebb15+'/'+_0x1994a5)['json'](_0x463ab3);}return null;};}function patchUpdates(_0x1074a9){return function(_0x2dbb31){try{jsonpatch[_0xc150('0x2b')](_0x2dbb31,_0x1074a9,!![]);}catch(_0x586d4c){return BPromise['reject'](_0x586d4c);}return _0x2dbb31['save']();};}function saveUpdates(_0x494de4,_0x4b64fb){return function(_0x57f33a){if(_0x57f33a){return _0x57f33a['update'](_0x494de4)[_0xc150('0x2c')](function(_0x1f4eaa){return _0x1f4eaa;});}return null;};}function removeEntity(_0x5cd3d,_0x2ddd15){return function(_0x4e98d9){if(_0x4e98d9){return _0x4e98d9[_0xc150('0x2d')]()[_0xc150('0x2c')](function(){var _0x1523b8=_0x4e98d9[_0xc150('0x2e')]({'plain':!![]});var _0x98b025=[{'name':_0xc150('0x2f'),'value':_0xc150('0x30'),'ignore':![]},{'name':_0xc150('0x31'),'value':_0xc150('0x32'),'ignore':![]}];var _0x5ab2ae=_(_0x98b025)[_0xc150('0x33')](_0xc150('0x34'))[_0xc150('0x35')]('value')['value']();if(_['includes'](_0x5ab2ae,_0x1523b8[_0xc150('0x36')])){return;}var _0x4351bb=_[_0xc150('0x37')](_0x98b025,[_0xc150('0x38'),_0x1523b8[_0xc150('0x36')]])[_0xc150('0x39')];return db[_0xc150('0x3a')][_0xc150('0x2d')]({'where':{'type':_0x4351bb,'resourceId':_0x1523b8['id']}})[_0xc150('0x2c')](function(){return _0x4e98d9;});})[_0xc150('0x2c')](function(){_0x5cd3d[_0xc150('0x23')](0xcc)[_0xc150('0x24')]();});}};}function handleEntityNotFound(_0x26b2f8,_0x302922){return function(_0x3474db){if(!_0x3474db){_0x26b2f8['sendStatus'](0x194);}return _0x3474db;};}function handleError(_0x4a6f51,_0x4399ff){_0x4399ff=_0x4399ff||0x1f4;return function(_0x388a7a){logger[_0xc150('0x3b')](_0x388a7a[_0xc150('0x3c')]);if(_0x388a7a[_0xc150('0x39')]){delete _0x388a7a['name'];}_0x4a6f51[_0xc150('0x23')](_0x4399ff)['send'](_0x388a7a);};}exports[_0xc150('0x3d')]=function(_0x1ae5f1,_0x3123dc){var _0x4ea501={},_0x5ee8b6={},_0x5bbb31={'count':0x0,'rows':[]};var _0x15d59c=_['map'](db[_0xc150('0x3e')][_0xc150('0x3f')],function(_0x187d41){return{'name':_0x187d41[_0xc150('0x40')],'type':_0x187d41[_0xc150('0x36')][_0xc150('0x41')]};});_0x5ee8b6[_0xc150('0x42')]=_[_0xc150('0x35')](_0x15d59c,_0xc150('0x39'));_0x5ee8b6[_0xc150('0x43')]=_[_0xc150('0x44')](_0x1ae5f1[_0xc150('0x43')]);_0x5ee8b6['filters']=_[_0xc150('0x45')](_0x5ee8b6[_0xc150('0x42')],_0x5ee8b6['query']);_0x4ea501['attributes']=_[_0xc150('0x45')](_0x5ee8b6[_0xc150('0x42')],qs[_0xc150('0x46')](_0x1ae5f1[_0xc150('0x43')][_0xc150('0x46')]));_0x4ea501[_0xc150('0x47')]=_0x4ea501[_0xc150('0x47')][_0xc150('0x48')]?_0x4ea501[_0xc150('0x47')]:_0x5ee8b6[_0xc150('0x42')];if(!_0x1ae5f1[_0xc150('0x43')][_0xc150('0x49')](_0xc150('0x4a'))){_0x4ea501[_0xc150('0x29')]=qs[_0xc150('0x29')](_0x1ae5f1[_0xc150('0x43')]['limit']);_0x4ea501[_0xc150('0x28')]=qs[_0xc150('0x28')](_0x1ae5f1['query'][_0xc150('0x28')]);}_0x4ea501[_0xc150('0x4b')]=qs[_0xc150('0x4c')](_0x1ae5f1[_0xc150('0x43')][_0xc150('0x4c')]);_0x4ea501[_0xc150('0x4d')]=qs['filters'](_[_0xc150('0x4e')](_0x1ae5f1[_0xc150('0x43')],_0x5ee8b6['filters']),_0x15d59c);if(_0x1ae5f1[_0xc150('0x43')][_0xc150('0x33')]){_0x4ea501[_0xc150('0x4d')]=_[_0xc150('0x4f')](_0x4ea501[_0xc150('0x4d')],{'$or':_['map'](_0x15d59c,function(_0x2ad4c9){if(_0x2ad4c9[_0xc150('0x36')]!==_0xc150('0x50')){var _0x30cc95={};_0x30cc95[_0x2ad4c9[_0xc150('0x39')]]={'$like':'%'+_0x1ae5f1['query'][_0xc150('0x33')]+'%'};return _0x30cc95;}})});}_0x4ea501=_['merge']({},_0x4ea501,_0x1ae5f1[_0xc150('0x51')]);var _0x1f06c4={'where':_0x4ea501[_0xc150('0x4d')]};return db[_0xc150('0x3e')][_0xc150('0x27')](_0x1f06c4)[_0xc150('0x2c')](function(_0x161d5f){_0x5bbb31[_0xc150('0x27')]=_0x161d5f;if(_0x1ae5f1['query'][_0xc150('0x52')]){_0x4ea501[_0xc150('0x53')]=[{'all':!![]}];}return db[_0xc150('0x3e')]['findAll'](_0x4ea501);})[_0xc150('0x2c')](function(_0x21ec4d){_0x5bbb31['rows']=_0x21ec4d;return _0x5bbb31;})[_0xc150('0x2c')](respondWithFilteredResult(_0x3123dc,_0x4ea501))[_0xc150('0x54')](handleError(_0x3123dc,null));};exports['show']=function(_0xd7a121,_0x4a010c){var _0x54cb8c={'raw':![],'where':{'id':_0xd7a121[_0xc150('0x55')]['id']}},_0x236189={};_0x236189['model']=_[_0xc150('0x44')](db['VoiceQueue'][_0xc150('0x3f')]);_0x236189[_0xc150('0x43')]=_[_0xc150('0x44')](_0xd7a121[_0xc150('0x43')]);_0x236189['filters']=_[_0xc150('0x45')](_0x236189[_0xc150('0x42')],_0x236189['query']);_0x54cb8c['attributes']=_['intersection'](_0x236189['model'],qs[_0xc150('0x46')](_0xd7a121[_0xc150('0x43')][_0xc150('0x46')]));_0x54cb8c[_0xc150('0x47')]=_0x54cb8c[_0xc150('0x47')][_0xc150('0x48')]?_0x54cb8c[_0xc150('0x47')]:_0x236189[_0xc150('0x42')];if(_0xd7a121['query'][_0xc150('0x52')]){_0x54cb8c[_0xc150('0x53')]=[{'all':!![]}];}_0x54cb8c=_[_0xc150('0x4f')]({},_0x54cb8c,_0xd7a121[_0xc150('0x51')]);return db['VoiceQueue']['find'](_0x54cb8c)['then'](handleEntityNotFound(_0x4a010c,null))[_0xc150('0x2c')](respondWithResult(_0x4a010c,null))['catch'](handleError(_0x4a010c,null));};exports[_0xc150('0x56')]=function(_0x3d3141,_0x499331){return db['VoiceQueue']['create'](_0x3d3141[_0xc150('0x57')],{})[_0xc150('0x2c')](function(_0x11e75d){var _0x58a163=_0x3d3141[_0xc150('0x58')][_0xc150('0x2e')]({'plain':!![]});if(!_0x58a163)throw new Error(_0xc150('0x59'));if(_0x58a163['role']===_0xc150('0x58')){var _0x572fd5=_0x11e75d['get']({'plain':!![]});var _0x16f704=[{'name':_0xc150('0x2f'),'value':'inbound'},{'name':_0xc150('0x31'),'value':_0xc150('0x32')}];var _0x35da14=_[_0xc150('0x37')](_0x16f704,[_0xc150('0x38'),_0x572fd5[_0xc150('0x36')]])['name'];return db['UserProfileSection'][_0xc150('0x37')]({'where':{'name':_0x35da14,'userProfileId':_0x58a163[_0xc150('0x5a')]},'raw':!![]})[_0xc150('0x2c')](function(_0x5a20a9){if(_0x5a20a9&&_0x5a20a9['autoAssociation']===0x0){return db[_0xc150('0x3a')][_0xc150('0x56')]({'name':_0x572fd5[_0xc150('0x39')],'resourceId':_0x572fd5['id'],'type':_0x5a20a9[_0xc150('0x39')],'sectionId':_0x5a20a9['id']},{})['then'](function(){return _0x11e75d;});}else{return _0x11e75d;}})[_0xc150('0x54')](function(_0x1f0f22){logger[_0xc150('0x3b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f0f22);throw _0x1f0f22;});}return _0x11e75d;})[_0xc150('0x2c')](respondWithResult(_0x499331,0xc9))[_0xc150('0x54')](handleError(_0x499331,null));};exports[_0xc150('0x5b')]=function(_0x612d5f,_0x32e3f8){var _0x3b5c14={'where':{'id':_0x612d5f[_0xc150('0x55')]['id']}},_0x5e8f27={};_0x5e8f27[_0xc150('0x42')]=_[_0xc150('0x44')](db[_0xc150('0x3e')][_0xc150('0x3f')]);_0x3b5c14[_0xc150('0x47')]=_['intersection'](_0x5e8f27['model'],qs[_0xc150('0x46')](_0x612d5f[_0xc150('0x43')][_0xc150('0x46')]));_0x3b5c14[_0xc150('0x47')]=_0x3b5c14[_0xc150('0x47')]['length']?_0x3b5c14[_0xc150('0x47')]:_0x5e8f27[_0xc150('0x42')];if(_0x612d5f[_0xc150('0x43')]['includeAll']){_0x3b5c14[_0xc150('0x53')]=[{'all':!![]}];}_0x3b5c14=_[_0xc150('0x4f')]({},_0x3b5c14,_0x612d5f[_0xc150('0x51')]);return db[_0xc150('0x3e')][_0xc150('0x37')](_0x3b5c14)[_0xc150('0x2c')](handleEntityNotFound(_0x32e3f8,null))[_0xc150('0x2c')](function(_0x2495e7){if(_0x2495e7){var _0x3132b0=_0x2495e7[_0xc150('0x2e')]({'plain':!![]});_0x3132b0=qs[_0xc150('0x5c')](_0x3132b0,['id',_0xc150('0x5d'),_0xc150('0x5e')]);_0x612d5f[_0xc150('0x57')]=_[_0xc150('0x5c')](_0x612d5f['body'],['id',_0xc150('0x5d'),'updatedAt']);return db[_0xc150('0x3e')][_0xc150('0x56')](_['merge'](_0x3132b0,_0x612d5f['body']),{'include':_0x612d5f[_0xc150('0x43')][_0xc150('0x52')]?[{'all':!![]}]:undefined})[_0xc150('0x2c')](function(_0x215f8c){var _0x2479a9=_0x612d5f['user'][_0xc150('0x2e')]({'plain':!![]});if(!_0x2479a9)throw new Error(_0xc150('0x59'));if(_0x2479a9[_0xc150('0x5f')]===_0xc150('0x58')){var _0x32c19d=_0x215f8c[_0xc150('0x2e')]({'plain':!![]});var _0x3b7f81=[{'name':_0xc150('0x2f'),'value':_0xc150('0x30')},{'name':'QueueCampaigns','value':_0xc150('0x32')}];var _0x3782ae=_[_0xc150('0x37')](_0x3b7f81,[_0xc150('0x38'),_0x32c19d[_0xc150('0x36')]])['name'];return db[_0xc150('0x60')][_0xc150('0x37')]({'where':{'name':_0x3782ae,'userProfileId':_0x2479a9[_0xc150('0x5a')]},'raw':!![]})['then'](function(_0x53eda2){if(_0x53eda2&&_0x53eda2[_0xc150('0x61')]===0x0){return db[_0xc150('0x3a')][_0xc150('0x56')]({'name':_0x32c19d['name'],'resourceId':_0x32c19d['id'],'type':_0x53eda2[_0xc150('0x39')],'sectionId':_0x53eda2['id']},{})[_0xc150('0x2c')](function(){return _0x215f8c;});}else{return _0x215f8c;}})[_0xc150('0x54')](function(_0x29b3e9){logger[_0xc150('0x3b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29b3e9);throw _0x29b3e9;});}return _0x215f8c;});}})['then'](respondWithResult(_0x32e3f8,0xc9))[_0xc150('0x54')](handleError(_0x32e3f8,null));};exports['update']=function(_0x208a94,_0x5e0e5e){if(_0x208a94['body']['id']){delete _0x208a94[_0xc150('0x57')]['id'];}return db['VoiceQueue'][_0xc150('0x37')]({'where':{'id':_0x208a94['params']['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x5e0e5e,null))[_0xc150('0x2c')](saveUpdates(_0x208a94[_0xc150('0x57')],null))[_0xc150('0x2c')](respondWithResult(_0x5e0e5e,null))[_0xc150('0x54')](handleError(_0x5e0e5e,null));};exports[_0xc150('0x2d')]=function(_0x2ff8a8,_0x5616ee){return db[_0xc150('0x3e')][_0xc150('0x37')]({'where':{'id':_0x2ff8a8[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x5616ee,null))[_0xc150('0x2c')](removeEntity(_0x5616ee,null))[_0xc150('0x54')](handleError(_0x5616ee,null));};exports['getHoppers']=function(_0x35fbc1,_0x4b81bc,_0x3fd3b8){var _0x430ac6={'raw':![],'where':{}};var _0x8f0a39={};var _0x1c9954={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc150('0x62')]({'where':{'id':_0x35fbc1['params']['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x4b81bc,null))[_0xc150('0x2c')](function(_0xf3611f){if(_0xf3611f){_0x8f0a39[_0xc150('0x42')]=_[_0xc150('0x44')](db[_0xc150('0x63')][_0xc150('0x3f')]);_0x8f0a39[_0xc150('0x43')]=_[_0xc150('0x44')](_0x35fbc1[_0xc150('0x43')]);_0x8f0a39[_0xc150('0x64')]=_[_0xc150('0x45')](_0x8f0a39[_0xc150('0x42')],_0x8f0a39[_0xc150('0x43')]);_0x430ac6[_0xc150('0x47')]=_[_0xc150('0x45')](_0x8f0a39['model'],qs[_0xc150('0x46')](_0x35fbc1[_0xc150('0x43')][_0xc150('0x46')]));_0x430ac6[_0xc150('0x47')]=_0x430ac6[_0xc150('0x47')][_0xc150('0x48')]?_0x430ac6['attributes']:_0x8f0a39['model'];if(!_0x35fbc1[_0xc150('0x43')][_0xc150('0x49')](_0xc150('0x4a'))){_0x430ac6[_0xc150('0x29')]=qs[_0xc150('0x29')](_0x35fbc1[_0xc150('0x43')][_0xc150('0x29')]);_0x430ac6[_0xc150('0x28')]=qs['offset'](_0x35fbc1['query'][_0xc150('0x28')]);}_0x430ac6[_0xc150('0x4b')]=qs[_0xc150('0x4c')](_0x35fbc1[_0xc150('0x43')][_0xc150('0x4c')]);_0x430ac6[_0xc150('0x4d')]=qs[_0xc150('0x64')](_[_0xc150('0x4e')](_0x35fbc1[_0xc150('0x43')],_0x8f0a39['filters']));_0x430ac6[_0xc150('0x4d')][_0xc150('0x65')]=_0xf3611f['id'];if(_0x35fbc1[_0xc150('0x43')][_0xc150('0x33')]){_0x430ac6[_0xc150('0x4d')]=_[_0xc150('0x4f')](_0x430ac6[_0xc150('0x4d')],{'$or':_[_0xc150('0x35')](_0x430ac6['attributes'],function(_0x50a490){var _0xa03cb4={};_0xa03cb4[_0x50a490]={'$like':'%'+_0x35fbc1[_0xc150('0x43')][_0xc150('0x33')]+'%'};return _0xa03cb4;})});}_0x430ac6=_[_0xc150('0x4f')]({},_0x430ac6,_0x35fbc1[_0xc150('0x51')]);return db[_0xc150('0x63')][_0xc150('0x27')]({'where':_0x430ac6['where']})['then'](function(_0x15de6d){_0x1c9954[_0xc150('0x27')]=_0x15de6d;if(_0x35fbc1[_0xc150('0x43')][_0xc150('0x52')]){_0x430ac6['include']=[{'all':!![]}];}return db['CmHopper'][_0xc150('0x66')](_0x430ac6);})[_0xc150('0x2c')](function(_0x5f4c2d){_0x1c9954['rows']=_0x5f4c2d;return _0x1c9954;});}})[_0xc150('0x2c')](respondWithFilteredResult(_0x4b81bc,_0x430ac6))[_0xc150('0x54')](handleError(_0x4b81bc,null));};exports['getHopperHistories']=function(_0x4b47d3,_0x3bdf2c,_0x2d8d0c){var _0x5c1af6={'raw':!![],'where':{}};var _0x1dde60={};var _0x2168cf={'count':0x0,'rows':[]};return db[_0xc150('0x3e')][_0xc150('0x62')]({'where':{'id':_0x4b47d3[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x3bdf2c,null))[_0xc150('0x2c')](function(_0x12ace8){if(_0x12ace8){_0x1dde60[_0xc150('0x42')]=_['keys'](db['CmHopperHistory'][_0xc150('0x3f')]);_0x1dde60['query']=_['keys'](_0x4b47d3[_0xc150('0x43')]);_0x1dde60[_0xc150('0x64')]=_[_0xc150('0x45')](_0x1dde60[_0xc150('0x42')],_0x1dde60[_0xc150('0x43')]);_0x5c1af6[_0xc150('0x47')]=_[_0xc150('0x45')](_0x1dde60[_0xc150('0x42')],qs[_0xc150('0x46')](_0x4b47d3[_0xc150('0x43')]['fields']));_0x5c1af6['attributes']=_0x5c1af6[_0xc150('0x47')][_0xc150('0x48')]?_0x5c1af6[_0xc150('0x47')]:_0x1dde60[_0xc150('0x42')];if(!_0x4b47d3[_0xc150('0x43')]['hasOwnProperty']('nolimit')){_0x5c1af6[_0xc150('0x29')]=qs[_0xc150('0x29')](_0x4b47d3[_0xc150('0x43')]['limit']);_0x5c1af6['offset']=qs[_0xc150('0x28')](_0x4b47d3['query']['offset']);}_0x5c1af6[_0xc150('0x4b')]=qs[_0xc150('0x4c')](_0x4b47d3[_0xc150('0x43')][_0xc150('0x4c')]);_0x5c1af6[_0xc150('0x4d')]=qs['filters'](_[_0xc150('0x4e')](_0x4b47d3[_0xc150('0x43')],_0x1dde60[_0xc150('0x64')]));_0x5c1af6['where']['VoiceQueueId']=_0x12ace8['id'];if(_0x4b47d3[_0xc150('0x43')][_0xc150('0x33')]){_0x5c1af6['where']=_['merge'](_0x5c1af6[_0xc150('0x4d')],{'$or':_[_0xc150('0x35')](_0x5c1af6['attributes'],function(_0xc9f66e){var _0x476cdc={};_0x476cdc[_0xc9f66e]={'$like':'%'+_0x4b47d3['query'][_0xc150('0x33')]+'%'};return _0x476cdc;})});}_0x5c1af6=_[_0xc150('0x4f')]({},_0x5c1af6,_0x4b47d3[_0xc150('0x51')]);return db['CmHopperHistory'][_0xc150('0x27')]({'where':_0x5c1af6[_0xc150('0x4d')]})['then'](function(_0x4f7430){_0x2168cf[_0xc150('0x27')]=_0x4f7430;if(_0x4b47d3['query'][_0xc150('0x52')]){_0x5c1af6[_0xc150('0x53')]=[{'all':!![]}];}return db[_0xc150('0x67')]['findAll'](_0x5c1af6);})['then'](function(_0x482d0d){_0x2168cf[_0xc150('0x68')]=_0x482d0d;return _0x2168cf;});}})[_0xc150('0x2c')](respondWithFilteredResult(_0x3bdf2c,_0x5c1af6))[_0xc150('0x54')](handleError(_0x3bdf2c,null));};exports[_0xc150('0x69')]=function(_0x1e4adb,_0x247724,_0x3c345d){var _0x118c03={'raw':!![],'where':{}};var _0x34914={};var _0x292011={'count':0x0,'rows':[]};return db[_0xc150('0x3e')]['findOne']({'where':{'id':_0x1e4adb['params']['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x247724,null))['then'](function(_0x11c17e){if(_0x11c17e){_0x34914[_0xc150('0x42')]=_[_0xc150('0x44')](db[_0xc150('0x6a')][_0xc150('0x3f')]);_0x34914[_0xc150('0x43')]=_[_0xc150('0x44')](_0x1e4adb[_0xc150('0x43')]);_0x34914['filters']=_[_0xc150('0x45')](_0x34914[_0xc150('0x42')],_0x34914[_0xc150('0x43')]);_0x118c03['attributes']=_[_0xc150('0x45')](_0x34914[_0xc150('0x42')],qs[_0xc150('0x46')](_0x1e4adb[_0xc150('0x43')][_0xc150('0x46')]));_0x118c03[_0xc150('0x47')]=_0x118c03['attributes'][_0xc150('0x48')]?_0x118c03[_0xc150('0x47')]:_0x34914[_0xc150('0x42')];if(!_0x1e4adb[_0xc150('0x43')][_0xc150('0x49')](_0xc150('0x4a'))){_0x118c03[_0xc150('0x29')]=qs['limit'](_0x1e4adb[_0xc150('0x43')][_0xc150('0x29')]);_0x118c03['offset']=qs['offset'](_0x1e4adb[_0xc150('0x43')][_0xc150('0x28')]);}_0x118c03[_0xc150('0x4b')]=qs['sort'](_0x1e4adb[_0xc150('0x43')][_0xc150('0x4c')]);_0x118c03[_0xc150('0x4d')]=qs[_0xc150('0x64')](_[_0xc150('0x4e')](_0x1e4adb[_0xc150('0x43')],_0x34914[_0xc150('0x64')]));_0x118c03[_0xc150('0x4d')]['VoiceQueueId']=_0x11c17e['id'];if(_0x1e4adb[_0xc150('0x43')]['filter']){_0x118c03['where']=_[_0xc150('0x4f')](_0x118c03[_0xc150('0x4d')],{'$or':_[_0xc150('0x35')](_0x118c03[_0xc150('0x47')],function(_0x499dab){var _0x2f7f89={};_0x2f7f89[_0x499dab]={'$like':'%'+_0x1e4adb[_0xc150('0x43')][_0xc150('0x33')]+'%'};return _0x2f7f89;})});}_0x118c03=_[_0xc150('0x4f')]({},_0x118c03,_0x1e4adb['options']);return db['CmHopperFinal'][_0xc150('0x27')]({'where':_0x118c03[_0xc150('0x4d')]})[_0xc150('0x2c')](function(_0x503366){_0x292011['count']=_0x503366;if(_0x1e4adb[_0xc150('0x43')]['includeAll']){_0x118c03[_0xc150('0x53')]=[{'all':!![]}];}return db[_0xc150('0x6a')][_0xc150('0x66')](_0x118c03);})['then'](function(_0x5380e6){_0x292011[_0xc150('0x68')]=_0x5380e6;return _0x292011;});}})[_0xc150('0x2c')](respondWithFilteredResult(_0x247724,_0x118c03))[_0xc150('0x54')](handleError(_0x247724,null));};exports[_0xc150('0x6b')]=function(_0x203fa9,_0x14ff7f,_0x4e9251){var _0x1ec27a={'raw':!![],'where':{}};var _0x55239a={};var _0x2b00bf={'count':0x0,'rows':[]};return db[_0xc150('0x3e')]['findOne']({'where':{'id':_0x203fa9['params']['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x14ff7f,null))[_0xc150('0x2c')](function(_0x52b3d2){if(_0x52b3d2){_0x55239a['model']=_['keys'](db[_0xc150('0x6c')][_0xc150('0x3f')]);_0x55239a[_0xc150('0x43')]=_['keys'](_0x203fa9[_0xc150('0x43')]);_0x55239a[_0xc150('0x64')]=_['intersection'](_0x55239a[_0xc150('0x42')],_0x55239a[_0xc150('0x43')]);_0x1ec27a[_0xc150('0x47')]=_[_0xc150('0x45')](_0x55239a[_0xc150('0x42')],qs[_0xc150('0x46')](_0x203fa9['query'][_0xc150('0x46')]));_0x1ec27a[_0xc150('0x47')]=_0x1ec27a[_0xc150('0x47')][_0xc150('0x48')]?_0x1ec27a[_0xc150('0x47')]:_0x55239a['model'];if(!_0x203fa9['query'][_0xc150('0x49')](_0xc150('0x4a'))){_0x1ec27a[_0xc150('0x29')]=qs['limit'](_0x203fa9[_0xc150('0x43')]['limit']);_0x1ec27a[_0xc150('0x28')]=qs[_0xc150('0x28')](_0x203fa9[_0xc150('0x43')]['offset']);}_0x1ec27a[_0xc150('0x4b')]=qs[_0xc150('0x4c')](_0x203fa9[_0xc150('0x43')][_0xc150('0x4c')]);_0x1ec27a[_0xc150('0x4d')]=qs[_0xc150('0x64')](_[_0xc150('0x4e')](_0x203fa9[_0xc150('0x43')],_0x55239a['filters']));_0x1ec27a[_0xc150('0x4d')][_0xc150('0x65')]=_0x52b3d2['id'];if(_0x203fa9['query'][_0xc150('0x33')]){_0x1ec27a['where']=_[_0xc150('0x4f')](_0x1ec27a['where'],{'$or':_[_0xc150('0x35')](_0x1ec27a['attributes'],function(_0x433494){var _0x185760={};_0x185760[_0x433494]={'$like':'%'+_0x203fa9[_0xc150('0x43')][_0xc150('0x33')]+'%'};return _0x185760;})});}_0x1ec27a=_[_0xc150('0x4f')]({},_0x1ec27a,_0x203fa9[_0xc150('0x51')]);return db[_0xc150('0x6c')]['count']({'where':_0x1ec27a[_0xc150('0x4d')]})[_0xc150('0x2c')](function(_0x41936e){_0x2b00bf['count']=_0x41936e;if(_0x203fa9['query'][_0xc150('0x52')]){_0x1ec27a[_0xc150('0x53')]=[{'all':!![]}];}return db[_0xc150('0x6c')][_0xc150('0x66')](_0x1ec27a);})[_0xc150('0x2c')](function(_0xc6f0af){_0x2b00bf[_0xc150('0x68')]=_0xc6f0af;return _0x2b00bf;});}})[_0xc150('0x2c')](respondWithFilteredResult(_0x14ff7f,_0x1ec27a))['catch'](handleError(_0x14ff7f,null));};exports[_0xc150('0x6d')]=function(_0x469df3,_0x3b7de1,_0x32d9d3){var _0x3ab846={};var _0x1607bd={};var _0x57554d;var _0x10876a;return db[_0xc150('0x3e')][_0xc150('0x62')]({'where':{'id':_0x469df3['params']['id']}})['then'](handleEntityNotFound(_0x3b7de1,null))[_0xc150('0x2c')](function(_0x2cd178){if(_0x2cd178){_0x57554d=_0x2cd178;_0x1607bd[_0xc150('0x42')]=_[_0xc150('0x44')](db[_0xc150('0x6e')][_0xc150('0x3f')]);_0x1607bd['query']=_[_0xc150('0x44')](_0x469df3[_0xc150('0x43')]);_0x1607bd['filters']=_[_0xc150('0x45')](_0x1607bd[_0xc150('0x42')],_0x1607bd[_0xc150('0x43')]);_0x3ab846[_0xc150('0x47')]=_[_0xc150('0x45')](_0x1607bd[_0xc150('0x42')],qs['fields'](_0x469df3[_0xc150('0x43')][_0xc150('0x46')]));_0x3ab846[_0xc150('0x47')]=_0x3ab846[_0xc150('0x47')][_0xc150('0x48')]?_0x3ab846[_0xc150('0x47')]:_0x1607bd[_0xc150('0x42')];_0x3ab846[_0xc150('0x4b')]=qs[_0xc150('0x4c')](_0x469df3[_0xc150('0x43')][_0xc150('0x4c')]);_0x3ab846[_0xc150('0x4d')]=qs['filters'](_['pick'](_0x469df3[_0xc150('0x43')],_0x1607bd[_0xc150('0x64')]));if(_0x469df3[_0xc150('0x43')]['filter']){_0x3ab846[_0xc150('0x4d')]=_['merge'](_0x3ab846[_0xc150('0x4d')],{'$or':_[_0xc150('0x35')](_0x3ab846[_0xc150('0x47')],function(_0xd363e8){var _0x8e3b60={};_0x8e3b60[_0xd363e8]={'$like':'%'+_0x469df3[_0xc150('0x43')][_0xc150('0x33')]+'%'};return _0x8e3b60;})});}_0x3ab846=_[_0xc150('0x4f')]({},_0x3ab846,_0x469df3['options']);return _0x57554d[_0xc150('0x6d')](_0x3ab846);}})[_0xc150('0x2c')](function(_0x401143){if(_0x401143){_0x10876a=_0x401143[_0xc150('0x48')];if(!_0x469df3['query']['hasOwnProperty']('nolimit')){_0x3ab846[_0xc150('0x29')]=qs[_0xc150('0x29')](_0x469df3[_0xc150('0x43')][_0xc150('0x29')]);_0x3ab846[_0xc150('0x28')]=qs[_0xc150('0x28')](_0x469df3[_0xc150('0x43')][_0xc150('0x28')]);}return _0x57554d[_0xc150('0x6d')](_0x3ab846);}})[_0xc150('0x2c')](function(_0x2f7527){if(_0x2f7527){return _0x2f7527?{'count':_0x10876a,'rows':_0x2f7527}:null;}})[_0xc150('0x2c')](respondWithResult(_0x3b7de1,null))[_0xc150('0x54')](handleError(_0x3b7de1,null));};exports['addTeams']=function(_0x226df5,_0x54bdba,_0x9a4aa9){var _0x16e905=_0x226df5[_0xc150('0x57')][_0xc150('0x6f')];var _0x582209=_[_0xc150('0x35')](_0x16e905,'id');return db['Team'][_0xc150('0x66')]({'where':{'id':_0x582209},'attributes':['id'],'include':[{'model':db[_0xc150('0x70')],'as':_0xc150('0x71'),'attributes':['id','name',_0xc150('0x72'),_0xc150('0x73'),_0xc150('0x74')],'raw':!![]}]})[_0xc150('0x2c')](function(_0x276762){if(_0x276762){var _0x2ea90e=_[_0xc150('0x75')](_0x276762,function(_0x1ac5e3){var _0x2b23b9=_0x1ac5e3[_0xc150('0x2e')]({'plain':!![]});_0x2b23b9[_0xc150('0x71')]['forEach'](function(_0x485adc){_0x485adc['penalty']=_[_0xc150('0x37')](_0x16e905,{'id':_0x2b23b9['id']})[_0xc150('0x76')];});return _0x2b23b9['Agents'];});return db[_0xc150('0x3e')]['find']({'where':{'id':_0x226df5[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](function(_0x2a98f6){return db[_0xc150('0x77')][_0xc150('0x78')](function(_0x29b8c5){return _0x2a98f6[_0xc150('0x79')](_0x582209,{'transaction':_0x29b8c5})[_0xc150('0x2c')](function(){return BPromise['each'](_0x16e905,function(_0x55373c){return db[_0xc150('0x7a')]['upsert']({'TeamId':_0x55373c['id'],'VoiceQueueId':_0x226df5[_0xc150('0x55')]['id'],'penalty':_0x55373c['penalty']},{'transaction':_0x29b8c5});});})[_0xc150('0x2c')](function(){return BPromise[_0xc150('0x7b')](_0x2ea90e,function(_0x2e9bf8){return db[_0xc150('0x7c')][_0xc150('0x7d')]({'where':{'UserId':_0x2e9bf8['id'],'VoiceQueueId':_0x226df5[_0xc150('0x55')]['id']},'defaults':{'penalty':_0x2e9bf8[_0xc150('0x76')]},'transaction':_0x29b8c5});});})[_0xc150('0x2c')](function(){return BPromise[_0xc150('0x7b')](_['filter'](_0x2ea90e,{'online':!![]}),function(_0x302ee7){return db[_0xc150('0x7e')]['upsert']({'membername':_0x302ee7[_0xc150('0x39')],'UserId':_0x302ee7['id'],'queue_name':_0x2a98f6[_0xc150('0x39')],'VoiceQueueId':_0x2a98f6['id'],'interface':_[_0xc150('0x7f')](_0x302ee7['interface'])?util[_0xc150('0x80')](_0xc150('0x81'),_0x302ee7[_0xc150('0x39')]):_0x302ee7[_0xc150('0x74')],'paused':_0x302ee7[_0xc150('0x73')]||![],'penalty':_0x302ee7['penalty']},{'transaction':_0x29b8c5});});})[_0xc150('0x2c')](function(){_0x2ea90e[_0xc150('0x82')](function(_0x1d4b3d){socket[_0xc150('0x83')](_0xc150('0x84'),{'UserId':_0x1d4b3d['id'],'VoiceQueueId':_0x2a98f6['id']});});});});});}})[_0xc150('0x2c')](respondWithStatusCode(_0x54bdba,null))[_0xc150('0x54')](handleError(_0x54bdba,null));};exports['removeTeams']=function(_0x16da4d,_0x2b7d8f,_0x11c2c2){return db[_0xc150('0x6e')][_0xc150('0x66')]({'where':{'id':_0x16da4d[_0xc150('0x43')][_0xc150('0x85')]},'attributes':['id'],'include':[{'model':db[_0xc150('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc150('0x2c')](handleEntityNotFound(_0x2b7d8f,null))['then'](function(_0xaee06f){var _0x4f6281=_[_0xc150('0x35')](_0xaee06f,'id');var _0x5db08f=[];var _0x155672=[];var _0x28f58a=squel[_0xc150('0x86')]();_0x28f58a['field']('tq.TeamId')['from']('team_has_voice_queues','tq')[_0xc150('0x87')]('user_has_teams','ut',_0xc150('0x88'))[_0xc150('0x4d')](_0xc150('0x89'),_0x16da4d[_0xc150('0x55')]['id']);for(var _0x562bac=0x0;_0x562bac<_0xaee06f[_0xc150('0x48')];_0x562bac+=0x1){let _0x3253f1=_0xaee06f[_0x562bac];for(var _0x8194bf=0x0;_0x8194bf<_0x3253f1['Agents'][_0xc150('0x48')];_0x8194bf+=0x1){let _0xcd86d4=_0x3253f1[_0xc150('0x71')][_0x8194bf];var _0x76c863=_0x28f58a[_0xc150('0x5b')]();_0x76c863[_0xc150('0x4d')]('ut.UserId\x20=\x20?',_0xcd86d4['id']);_0x155672['push'](db[_0xc150('0x77')][_0xc150('0x43')](_0x76c863[_0xc150('0x8a')](),{'type':db[_0xc150('0x77')][_0xc150('0x8b')]['SELECT']})[_0xc150('0x2c')](function(_0x46aa00){if(_0x46aa00[_0xc150('0x48')]===0x1){return _0xcd86d4['id'];}else{var _0x3eb78b=_[_0xc150('0x8c')](_[_0xc150('0x35')](_0x46aa00,_0xc150('0x8d')),function(_0x33ddc4){return _[_0xc150('0x8e')](_0x4f6281,_0x33ddc4);});if(_0x3eb78b){return _0xcd86d4['id'];}}}));}}return BPromise[_0xc150('0x8f')](_0x155672)[_0xc150('0x2c')](function(_0x4128cb){_0x5db08f=_(_0x5db08f)[_0xc150('0x90')](_0x4128cb)[_0xc150('0x91')]()[_0xc150('0x38')]();return db['VoiceQueue'][_0xc150('0x37')]({'where':{'id':_0x16da4d[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](function(_0x4f13d4){return db[_0xc150('0x77')][_0xc150('0x78')](function(_0x1e5520){return _0x4f13d4[_0xc150('0x92')](_0x16da4d[_0xc150('0x43')]['ids'],{'transaction':_0x1e5520})['then'](function(){if(!_[_0xc150('0x93')](_0x5db08f)){return _0x4f13d4[_0xc150('0x94')](_0x5db08f,{'transaction':_0x1e5520})[_0xc150('0x2c')](function(){return db[_0xc150('0x7e')][_0xc150('0x2d')]({'where':{'VoiceQueueId':_0x16da4d[_0xc150('0x55')]['id'],'UserId':_0x5db08f},'transaction':_0x1e5520});});}})['then'](function(){_0x5db08f[_0xc150('0x82')](function(_0x522902){socket[_0xc150('0x83')](_0xc150('0x95'),{'UserId':_0x522902,'VoiceQueueId':_0x4f13d4['id']});});});});});});})[_0xc150('0x2c')](respondWithStatusCode(_0x2b7d8f,null))[_0xc150('0x54')](handleError(_0x2b7d8f,null));};exports[_0xc150('0x96')]=function(_0x2e6edc,_0x4bef82,_0x10c897){var _0x52c4cb,_0x1fea3;return db[_0xc150('0x3e')][_0xc150('0x37')]({'where':{'id':_0x2e6edc[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x4bef82,null))[_0xc150('0x2c')](function(_0x201034){if(_0x201034){_0x1fea3=_0x201034;return _0x201034['addAgents'](_0x2e6edc['body']['ids'],_[_0xc150('0x5c')](_0x2e6edc[_0xc150('0x57')],['ids','id'])||{})[_0xc150('0x97')](function(_0x521047){for(var _0x4859f0=0x0;_0x4859f0<_0x2e6edc['body']['ids'][_0xc150('0x48')];_0x4859f0+=0x1){socket['emit'](_0xc150('0x84'),{'UserId':Number(_0x2e6edc[_0xc150('0x57')][_0xc150('0x85')][_0x4859f0]),'VoiceQueueId':Number(_0x2e6edc[_0xc150('0x55')]['id'])});}return _0x521047;});}})['then'](function(_0x4e1883){_0x52c4cb=_0x4e1883||[];if(_0x1fea3){return db[_0xc150('0x70')][_0xc150('0x66')]({'where':{'id':_0x2e6edc[_0xc150('0x57')]['ids']},'attributes':['id',_0xc150('0x39'),_0xc150('0x72'),_0xc150('0x73'),_0xc150('0x74')],'raw':!![]});}})[_0xc150('0x2c')](function(_0x1b45d1){if(!_[_0xc150('0x93')](_0x1b45d1)){var _0x82fda6=[];for(var _0x1cbe1d=0x0;_0x1cbe1d<_0x1b45d1[_0xc150('0x48')];_0x1cbe1d++){if(_0x1b45d1[_0x1cbe1d][_0xc150('0x72')]){_0x82fda6[_0xc150('0x98')](db[_0xc150('0x7e')][_0xc150('0x99')]({'membername':_0x1b45d1[_0x1cbe1d][_0xc150('0x39')],'UserId':_0x1b45d1[_0x1cbe1d]['id'],'queue_name':_0x1fea3['name'],'VoiceQueueId':_0x1fea3['id'],'interface':_[_0xc150('0x7f')](_0x1b45d1[_0x1cbe1d][_0xc150('0x74')])?util[_0xc150('0x80')](_0xc150('0x81'),_0x1b45d1[_0x1cbe1d][_0xc150('0x39')]):_0x1b45d1[_0x1cbe1d][_0xc150('0x74')],'paused':_0x1b45d1[_0x1cbe1d][_0xc150('0x73')]||![],'penalty':_0x2e6edc[_0xc150('0x57')]['penalty']||0x0}));}}return BPromise[_0xc150('0x8f')](_0x82fda6);}})[_0xc150('0x2c')](function(){return _0x52c4cb;})[_0xc150('0x2c')](respondWithResult(_0x4bef82,null))[_0xc150('0x54')](handleError(_0x4bef82,null));};exports[_0xc150('0x94')]=function(_0xe5c11b,_0x53f8f1,_0x1b6792){return db['VoiceQueue'][_0xc150('0x37')]({'where':{'id':_0xe5c11b[_0xc150('0x55')]['id']}})['then'](handleEntityNotFound(_0x53f8f1,null))[_0xc150('0x2c')](function(_0x3262a0){if(_0x3262a0){return _0x3262a0[_0xc150('0x94')](_0xe5c11b[_0xc150('0x43')][_0xc150('0x85')])[_0xc150('0x2c')](function(){if(_[_0xc150('0x9a')](_0xe5c11b['query'][_0xc150('0x85')])){for(var _0x17a8ea=0x0;_0x17a8ea<_0xe5c11b[_0xc150('0x43')]['ids']['length'];_0x17a8ea+=0x1){socket[_0xc150('0x83')](_0xc150('0x95'),{'UserId':Number(_0xe5c11b[_0xc150('0x43')][_0xc150('0x85')][_0x17a8ea]),'VoiceQueueId':Number(_0xe5c11b[_0xc150('0x55')]['id'])});}}else{socket[_0xc150('0x83')](_0xc150('0x95'),{'UserId':Number(_0xe5c11b[_0xc150('0x43')][_0xc150('0x85')]),'VoiceQueueId':Number(_0xe5c11b[_0xc150('0x55')]['id'])});}});}})[_0xc150('0x2c')](function(_0x4c26de){return db['UserVoiceQueueRt'][_0xc150('0x2d')]({'where':{'VoiceQueueId':_0xe5c11b[_0xc150('0x55')]['id'],'UserId':_0xe5c11b[_0xc150('0x43')]['ids']}})['then'](function(){return _0x4c26de;});})[_0xc150('0x2c')](respondWithStatusCode(_0x53f8f1,null))[_0xc150('0x54')](handleError(_0x53f8f1,null));};exports['getAgents']=function(_0x13e1b5,_0xfe11a0,_0x2b3c65){var _0x2c8244={};var _0x29c97c={};var _0x3db47c;var _0x332d26;return db[_0xc150('0x3e')][_0xc150('0x62')]({'where':{'id':_0x13e1b5[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0xfe11a0,null))['then'](function(_0x42ca9f){if(_0x42ca9f){_0x3db47c=_0x42ca9f;_0x29c97c['model']=_['keys'](db[_0xc150('0x70')][_0xc150('0x3f')]);_0x29c97c[_0xc150('0x43')]=_[_0xc150('0x44')](_0x13e1b5[_0xc150('0x43')]);_0x29c97c[_0xc150('0x64')]=_[_0xc150('0x45')](_0x29c97c[_0xc150('0x42')],_0x29c97c['query']);_0x2c8244[_0xc150('0x47')]=_[_0xc150('0x45')](_0x29c97c['model'],qs['fields'](_0x13e1b5['query'][_0xc150('0x46')]));_0x2c8244[_0xc150('0x47')]=_0x2c8244['attributes'][_0xc150('0x48')]?_0x2c8244[_0xc150('0x47')]:_0x29c97c[_0xc150('0x42')];_0x2c8244[_0xc150('0x4b')]=qs[_0xc150('0x4c')](_0x13e1b5['query'][_0xc150('0x4c')]);_0x2c8244[_0xc150('0x4d')]=qs[_0xc150('0x64')](_['pick'](_0x13e1b5[_0xc150('0x43')],_0x29c97c['filters']));if(_0x13e1b5['query']['filter']){_0x2c8244['where']=_[_0xc150('0x4f')](_0x2c8244[_0xc150('0x4d')],{'$or':_[_0xc150('0x35')](_0x2c8244[_0xc150('0x47')],function(_0x3fc4b2){var _0x1d83ce={};_0x1d83ce[_0x3fc4b2]={'$like':'%'+_0x13e1b5['query'][_0xc150('0x33')]+'%'};return _0x1d83ce;})});}_0x2c8244=_[_0xc150('0x4f')]({},_0x2c8244,_0x13e1b5[_0xc150('0x51')]);return _0x3db47c['getAgents'](_0x2c8244);}})[_0xc150('0x2c')](function(_0x34e6db){if(_0x34e6db){_0x332d26=_0x34e6db[_0xc150('0x48')];if(!_0x13e1b5['query'][_0xc150('0x49')](_0xc150('0x4a'))){_0x2c8244[_0xc150('0x29')]=qs['limit'](_0x13e1b5[_0xc150('0x43')]['limit']);_0x2c8244['offset']=qs[_0xc150('0x28')](_0x13e1b5[_0xc150('0x43')][_0xc150('0x28')]);}return _0x3db47c[_0xc150('0x9b')](_0x2c8244);}})[_0xc150('0x2c')](function(_0x37b573){if(_0x37b573){return _0x37b573?{'count':_0x332d26,'rows':_0x37b573}:null;}})[_0xc150('0x2c')](respondWithResult(_0xfe11a0,null))[_0xc150('0x54')](handleError(_0xfe11a0,null));};exports[_0xc150('0x9c')]=function(_0x1199fc,_0x1a5d78,_0x23e5a3){var _0x113579={};var _0x9bbec8={};var _0x44c736;var _0x587a18;return db['VoiceQueue']['findOne']({'where':{'id':_0x1199fc[_0xc150('0x55')]['id']}})['then'](handleEntityNotFound(_0x1a5d78,null))[_0xc150('0x2c')](function(_0x282d93){if(_0x282d93){_0x44c736=_0x282d93;_0x9bbec8[_0xc150('0x42')]=_[_0xc150('0x44')](db[_0xc150('0x7e')][_0xc150('0x3f')]);_0x9bbec8['query']=_[_0xc150('0x44')](_0x1199fc['query']);_0x9bbec8[_0xc150('0x64')]=_[_0xc150('0x45')](_0x9bbec8[_0xc150('0x42')],_0x9bbec8['query']);_0x113579[_0xc150('0x47')]=_[_0xc150('0x45')](_0x9bbec8['model'],qs['fields'](_0x1199fc[_0xc150('0x43')][_0xc150('0x46')]));_0x113579['attributes']=_0x113579[_0xc150('0x47')]['length']?_0x113579['attributes']:_0x9bbec8[_0xc150('0x42')];_0x113579[_0xc150('0x4b')]=qs[_0xc150('0x4c')](_0x1199fc[_0xc150('0x43')][_0xc150('0x4c')]);_0x113579['where']=qs['filters'](_['pick'](_0x1199fc['query'],_0x9bbec8['filters']));if(_0x1199fc[_0xc150('0x43')]['filter']){_0x113579[_0xc150('0x4d')]=_['merge'](_0x113579[_0xc150('0x4d')],{'$or':_['map'](_0x113579[_0xc150('0x47')],function(_0xf55d99){var _0x521050={};_0x521050[_0xf55d99]={'$like':'%'+_0x1199fc['query'][_0xc150('0x33')]+'%'};return _0x521050;})});}_0x113579=_[_0xc150('0x4f')]({},_0x113579,_0x1199fc[_0xc150('0x51')]);return _0x44c736[_0xc150('0x9c')](_0x113579);}})[_0xc150('0x2c')](function(_0x282e7f){if(_0x282e7f){_0x587a18=_0x282e7f[_0xc150('0x48')];if(!_0x1199fc[_0xc150('0x43')][_0xc150('0x49')]('nolimit')){_0x113579[_0xc150('0x29')]=qs['limit'](_0x1199fc['query'][_0xc150('0x29')]);_0x113579[_0xc150('0x28')]=qs[_0xc150('0x28')](_0x1199fc['query'][_0xc150('0x28')]);}return _0x44c736[_0xc150('0x9c')](_0x113579);}})[_0xc150('0x2c')](function(_0x6e3592){return _0x6e3592?{'count':_0x587a18,'rows':_0x6e3592}:null;})['then'](respondWithResult(_0x1a5d78,null))[_0xc150('0x54')](handleError(_0x1a5d78,null));};exports[_0xc150('0x9d')]=function(_0x489da6,_0x17b463,_0x21523e){var _0x21e308={};var _0x50768e={};var _0xe7aa57;var _0x337263;return db[_0xc150('0x3e')]['findOne']({'where':{'id':_0x489da6['params']['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x17b463,null))[_0xc150('0x2c')](function(_0xb19cc2){if(_0xb19cc2){_0xe7aa57=_0xb19cc2;_0x50768e['model']=_[_0xc150('0x44')](db['CmList']['rawAttributes']);_0x50768e['query']=_[_0xc150('0x44')](_0x489da6['query']);_0x50768e[_0xc150('0x64')]=_[_0xc150('0x45')](_0x50768e[_0xc150('0x42')],_0x50768e['query']);_0x21e308['attributes']=_[_0xc150('0x45')](_0x50768e[_0xc150('0x42')],qs[_0xc150('0x46')](_0x489da6[_0xc150('0x43')][_0xc150('0x46')]));_0x21e308[_0xc150('0x47')]=_0x21e308[_0xc150('0x47')][_0xc150('0x48')]?_0x21e308[_0xc150('0x47')]:_0x50768e[_0xc150('0x42')];_0x21e308['order']=qs[_0xc150('0x4c')](_0x489da6[_0xc150('0x43')]['sort']);_0x21e308[_0xc150('0x4d')]=qs[_0xc150('0x64')](_[_0xc150('0x4e')](_0x489da6['query'],_0x50768e[_0xc150('0x64')]));if(_0x489da6[_0xc150('0x43')]['filter']){_0x21e308[_0xc150('0x4d')]=_[_0xc150('0x4f')](_0x21e308[_0xc150('0x4d')],{'$or':_[_0xc150('0x35')](_0x21e308['attributes'],function(_0xdf1f8d){var _0x38ebcb={};_0x38ebcb[_0xdf1f8d]={'$like':'%'+_0x489da6[_0xc150('0x43')][_0xc150('0x33')]+'%'};return _0x38ebcb;})});}_0x21e308=_[_0xc150('0x4f')]({},_0x21e308,_0x489da6[_0xc150('0x51')]);return _0xe7aa57['getLists'](_0x21e308);}})[_0xc150('0x2c')](function(_0x19549d){if(_0x19549d){_0x337263=_0x19549d['length'];if(!_0x489da6[_0xc150('0x43')][_0xc150('0x49')](_0xc150('0x4a'))){_0x21e308['limit']=qs[_0xc150('0x29')](_0x489da6[_0xc150('0x43')][_0xc150('0x29')]);_0x21e308[_0xc150('0x28')]=qs['offset'](_0x489da6[_0xc150('0x43')][_0xc150('0x28')]);}return _0xe7aa57['getLists'](_0x21e308);}})[_0xc150('0x2c')](function(_0x3eaf50){if(_0x3eaf50){return _0x3eaf50?{'count':_0x337263,'rows':_0x3eaf50}:null;}})[_0xc150('0x2c')](respondWithResult(_0x17b463,null))[_0xc150('0x54')](handleError(_0x17b463,null));};exports[_0xc150('0x9e')]=function(_0x46ee38,_0x110675,_0x169bc8){var _0x348306,_0x4e06ac;return db[_0xc150('0x3e')][_0xc150('0x37')]({'where':{'id':_0x46ee38[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x110675,null))['then'](function(_0x494cb2){if(_0x494cb2){_0x4e06ac=_0x494cb2;return _0x494cb2[_0xc150('0x9e')](_0x46ee38['body'][_0xc150('0x85')],_['omit'](_0x46ee38[_0xc150('0x57')],['ids','id'])||{});}return null;})[_0xc150('0x97')](function(_0x1f63b5){var _0x17e394;_0x348306=_0x1f63b5||[];var _0x270881=[];if(_0x1f63b5){for(var _0x4ff48c=0x0;_0x4ff48c<_0x1f63b5[_0xc150('0x48')];_0x4ff48c+=0x1){var _0x2e8362=_0x1f63b5[_0x4ff48c][_0xc150('0x2e')]({'plain':!![]});_0x4e06ac[_0xc150('0x9f')]=_0x46ee38[_0xc150('0x57')][_0xc150('0x9f')]?_0x46ee38[_0xc150('0x57')]['dialCheckDuplicateType']:_0x4e06ac[_0xc150('0x9f')];switch(_0x4e06ac[_0xc150('0x9f')]){case _0xc150('0xa0'):_0x17e394=squel['insert']()['into']('cm_hopper')[_0xc150('0xa1')](['phone',_0xc150('0xa2'),_0xc150('0xa3'),_0xc150('0xa4'),'VoiceQueueId',_0xc150('0x5d'),'updatedAt'],squel[_0xc150('0x86')]()[_0xc150('0xa5')](_0xc150('0xa6'),_0xc150('0xa6'))[_0xc150('0xa5')]('NOW()',_0xc150('0xa2'))[_0xc150('0xa5')]('id','ContactId')[_0xc150('0xa5')](_0x2e8362[_0xc150('0xa7')][_0xc150('0x8a')](),'ListId')['field'](_0x46ee38[_0xc150('0x55')]['id'][_0xc150('0x8a')](),_0xc150('0x65'))[_0xc150('0xa5')](_0xc150('0xa8'),_0xc150('0x5d'))['field'](_0xc150('0xa8'),'updatedAt')[_0xc150('0xa9')](_0xc150('0xaa'))[_0xc150('0x4d')](_0xc150('0xab'))[_0xc150('0x4d')](_0xc150('0xac'),_0x2e8362['CmListId'][_0xc150('0x8a')]())[_0xc150('0x4d')](_0xc150('0xad'))[_0xc150('0x4d')](_0xc150('0xae'),squel[_0xc150('0x86')]()[_0xc150('0xa5')]('COALESCE(calleridnum,\x27\x27)')[_0xc150('0xa9')]('cm_hopper_final')[_0xc150('0x4d')](_0xc150('0x89'),_0x46ee38['params']['id'][_0xc150('0x8a')]()))[_0xc150('0x4d')](_0xc150('0xae'),squel[_0xc150('0x86')]()[_0xc150('0xa5')](_0xc150('0xaf'))[_0xc150('0xa9')](_0xc150('0xb0'))[_0xc150('0x4d')]('VoiceQueueId\x20=\x20?',_0x46ee38[_0xc150('0x55')]['id']['toString']())))[_0xc150('0x8a')]();break;case _0xc150('0xb1'):_0x17e394=squel[_0xc150('0xb2')]()[_0xc150('0xb3')](_0xc150('0xb0'))[_0xc150('0xa1')]([_0xc150('0xa6'),_0xc150('0xa2'),'ContactId',_0xc150('0xa4'),_0xc150('0x65'),_0xc150('0x5d'),'updatedAt'],squel['select']()[_0xc150('0xa5')](_0xc150('0xa6'),_0xc150('0xa6'))[_0xc150('0xa5')](_0xc150('0xa8'),'scheduledAt')[_0xc150('0xa5')]('id','ContactId')[_0xc150('0xa5')](_0x2e8362[_0xc150('0xa7')][_0xc150('0x8a')](),_0xc150('0xa4'))[_0xc150('0xa5')](_0x46ee38['params']['id'][_0xc150('0x8a')](),_0xc150('0x65'))[_0xc150('0xa5')]('NOW()','createdAt')[_0xc150('0xa5')](_0xc150('0xa8'),_0xc150('0x5e'))['from']('cm_contacts')[_0xc150('0x4d')]('deletedAt\x20IS\x20NULL')[_0xc150('0x4d')](_0xc150('0xac'),_0x2e8362['CmListId'][_0xc150('0x8a')]())[_0xc150('0x4d')]('phone\x20IS\x20NOT\x20NULL')[_0xc150('0x4d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc150('0x86')]()[_0xc150('0xa5')](_0xc150('0xaf'))[_0xc150('0xa9')]('cm_hopper')[_0xc150('0x4d')]('VoiceQueueId\x20=\x20?',_0x46ee38[_0xc150('0x55')]['id']['toString']())))[_0xc150('0x8a')]();break;default:_0x17e394=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone','scheduledAt',_0xc150('0xa3'),_0xc150('0xa4'),_0xc150('0x65'),_0xc150('0x5d'),_0xc150('0x5e')],squel['select']()['field'](_0xc150('0xa6'),_0xc150('0xa6'))[_0xc150('0xa5')]('NOW()',_0xc150('0xa2'))[_0xc150('0xa5')]('id',_0xc150('0xa3'))[_0xc150('0xa5')](_0x2e8362['CmListId'][_0xc150('0x8a')](),_0xc150('0xa4'))[_0xc150('0xa5')](_0x46ee38['params']['id'][_0xc150('0x8a')](),'VoiceQueueId')[_0xc150('0xa5')](_0xc150('0xa8'),_0xc150('0x5d'))[_0xc150('0xa5')]('NOW()',_0xc150('0x5e'))[_0xc150('0xa9')](_0xc150('0xaa'))[_0xc150('0x4d')]('deletedAt\x20IS\x20NULL')[_0xc150('0x4d')]('ListId\x20=\x20?',_0x2e8362[_0xc150('0xa7')]['toString']())[_0xc150('0x4d')](_0xc150('0xad')))[_0xc150('0x8a')]();}_0x270881[_0xc150('0x98')](db[_0xc150('0x77')]['query'](_0x17e394));}return BPromise[_0xc150('0x8f')](_0x270881);}})[_0xc150('0x2c')](function(){return _0x348306;})[_0xc150('0x2c')](respondWithResult(_0x110675,null))['catch'](handleError(_0x110675,null));};exports[_0xc150('0xb4')]=function(_0x4eab7e,_0x1be6ac,_0x50b5f6){return db[_0xc150('0x3e')]['find']({'where':{'id':_0x4eab7e['params']['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x1be6ac,null))[_0xc150('0x2c')](function(_0x171f03){if(_0x171f03){return _0x171f03['removeLists'](_0x4eab7e['query'][_0xc150('0x85')]);}})[_0xc150('0x2c')](function(_0x3b2258){if(_0x3b2258){return db[_0xc150('0x63')]['destroy']({'where':{'ListId':_0x4eab7e[_0xc150('0x43')][_0xc150('0x85')],'VoiceQueueId':_0x4eab7e[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](function(){return _0x3b2258;});}})[_0xc150('0x2c')](respondWithStatusCode(_0x1be6ac,null))[_0xc150('0x54')](handleError(_0x1be6ac,null));};exports[_0xc150('0xb5')]=function(_0x44a993,_0xe12d09,_0x3171fc){var _0x4b83b9={};var _0x5dd91a={};var _0x5aa812;var _0x494a0f;return db[_0xc150('0x3e')][_0xc150('0x62')]({'where':{'id':_0x44a993[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0xe12d09,null))[_0xc150('0x2c')](function(_0x5cb1b8){if(_0x5cb1b8){_0x5aa812=_0x5cb1b8;_0x5dd91a[_0xc150('0x42')]=_[_0xc150('0x44')](db['CmList'][_0xc150('0x3f')]);_0x5dd91a[_0xc150('0x43')]=_[_0xc150('0x44')](_0x44a993['query']);_0x5dd91a[_0xc150('0x64')]=_[_0xc150('0x45')](_0x5dd91a['model'],_0x5dd91a[_0xc150('0x43')]);_0x4b83b9[_0xc150('0x47')]=_[_0xc150('0x45')](_0x5dd91a[_0xc150('0x42')],qs[_0xc150('0x46')](_0x44a993[_0xc150('0x43')][_0xc150('0x46')]));_0x4b83b9[_0xc150('0x47')]=_0x4b83b9['attributes'][_0xc150('0x48')]?_0x4b83b9['attributes']:_0x5dd91a[_0xc150('0x42')];_0x4b83b9[_0xc150('0x4b')]=qs[_0xc150('0x4c')](_0x44a993[_0xc150('0x43')][_0xc150('0x4c')]);_0x4b83b9[_0xc150('0x4d')]=qs['filters'](_[_0xc150('0x4e')](_0x44a993[_0xc150('0x43')],_0x5dd91a['filters']));if(_0x44a993['query'][_0xc150('0x33')]){_0x4b83b9[_0xc150('0x4d')]=_[_0xc150('0x4f')](_0x4b83b9['where'],{'$or':_[_0xc150('0x35')](_0x4b83b9[_0xc150('0x47')],function(_0x28f0b6){var _0x3d429f={};_0x3d429f[_0x28f0b6]={'$like':'%'+_0x44a993[_0xc150('0x43')][_0xc150('0x33')]+'%'};return _0x3d429f;})});}_0x4b83b9=_[_0xc150('0x4f')]({},_0x4b83b9,_0x44a993[_0xc150('0x51')]);return _0x5aa812['getBlackLists'](_0x4b83b9);}})[_0xc150('0x2c')](function(_0x43fce2){if(_0x43fce2){_0x494a0f=_0x43fce2['length'];if(!_0x44a993[_0xc150('0x43')][_0xc150('0x49')](_0xc150('0x4a'))){_0x4b83b9['limit']=qs['limit'](_0x44a993[_0xc150('0x43')]['limit']);_0x4b83b9[_0xc150('0x28')]=qs['offset'](_0x44a993['query'][_0xc150('0x28')]);}return _0x5aa812[_0xc150('0xb5')](_0x4b83b9);}})[_0xc150('0x2c')](function(_0x40652a){if(_0x40652a){return _0x40652a?{'count':_0x494a0f,'rows':_0x40652a}:null;}})[_0xc150('0x2c')](respondWithResult(_0xe12d09,null))[_0xc150('0x54')](handleError(_0xe12d09,null));};exports[_0xc150('0xb6')]=function(_0x2fe6d5,_0x4123ef,_0x5e34bb){var _0x1d0cce,_0x4d8b1e;return db[_0xc150('0x3e')][_0xc150('0x37')]({'where':{'id':_0x2fe6d5[_0xc150('0x55')]['id']}})['then'](handleEntityNotFound(_0x4123ef,null))[_0xc150('0x2c')](function(_0x512d8f){if(_0x512d8f){_0x4d8b1e=_0x512d8f;return _0x512d8f[_0xc150('0xb6')](_0x2fe6d5[_0xc150('0x57')][_0xc150('0x85')],_[_0xc150('0x5c')](_0x2fe6d5[_0xc150('0x57')],[_0xc150('0x85'),'id'])||{});}return null;})[_0xc150('0x97')](function(_0x7899c0){var _0x1247c2;_0x1d0cce=_0x7899c0||[];var _0x15261d=[];if(_0x7899c0){for(var _0x110c63=0x0;_0x110c63<_0x7899c0[_0xc150('0x48')];_0x110c63+=0x1){var _0xe4380e=_0x7899c0[_0x110c63]['get']({'plain':!![]});_0x1247c2=squel[_0xc150('0xb2')]()['into'](_0xc150('0xb7'))[_0xc150('0xa1')]([_0xc150('0xa6'),'ContactId',_0xc150('0xa4'),_0xc150('0x65'),'createdAt',_0xc150('0x5e')],squel['select']()[_0xc150('0xa5')]('phone','phone')['field']('id',_0xc150('0xa3'))[_0xc150('0xa5')](_0xe4380e[_0xc150('0xa7')][_0xc150('0x8a')](),_0xc150('0xa4'))['field'](_0x2fe6d5[_0xc150('0x55')]['id'][_0xc150('0x8a')](),'VoiceQueueId')[_0xc150('0xa5')](_0xc150('0xa8'),_0xc150('0x5d'))[_0xc150('0xa5')](_0xc150('0xa8'),'updatedAt')[_0xc150('0xa9')](_0xc150('0xaa'))[_0xc150('0x4d')](_0xc150('0xab'))[_0xc150('0x4d')](_0xc150('0xac'),_0xe4380e[_0xc150('0xa7')][_0xc150('0x8a')]())[_0xc150('0x4d')](_0xc150('0xad')))[_0xc150('0x8a')]();_0x15261d[_0xc150('0x98')](db[_0xc150('0x77')][_0xc150('0x43')](_0x1247c2));}return BPromise[_0xc150('0x8f')](_0x15261d);}})['then'](function(){return _0x1d0cce;})[_0xc150('0x2c')](respondWithResult(_0x4123ef,null))[_0xc150('0x54')](handleError(_0x4123ef,null));};exports[_0xc150('0xb8')]=function(_0x1b510b,_0x587dd6,_0x1b1c27){return db[_0xc150('0x3e')]['find']({'where':{'id':_0x1b510b[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](handleEntityNotFound(_0x587dd6,null))[_0xc150('0x2c')](function(_0x183c85){if(_0x183c85){return _0x183c85[_0xc150('0xb8')](_0x1b510b[_0xc150('0x43')][_0xc150('0x85')]);}})[_0xc150('0x2c')](function(_0x51aa6a){if(_0x51aa6a){return db[_0xc150('0x6c')][_0xc150('0x2d')]({'where':{'ListId':_0x1b510b[_0xc150('0x43')]['ids'],'VoiceQueueId':_0x1b510b[_0xc150('0x55')]['id']}})[_0xc150('0x2c')](function(){return _0x51aa6a;});}})[_0xc150('0x2c')](respondWithStatusCode(_0x587dd6,null))['catch'](handleError(_0x587dd6,null));};
\ No newline at end of file
index 7c893a4..f6d1b7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4c=['../../mysqldb','VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1676af,_0x35e2a8){var _0x13154f=function(_0x4fdf9e){while(--_0x4fdf9e){_0x1676af['push'](_0x1676af['shift']());}};_0x13154f(++_0x35e2a8);}(_0xee4c,0xdb));var _0xcee4=function(_0xfb0882,_0x3464f0){_0xfb0882=_0xfb0882-0x0;var _0x513e38=_0xee4c[_0xfb0882];return _0x513e38;};'use strict';var EventEmitter=require(_0xcee4('0x0'));var VoiceQueue=require(_0xcee4('0x1'))['db'][_0xcee4('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xcee4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcee4('0x4'),'afterDestroy':_0xcee4('0x5')};function emitEvent(_0x751aad){return function(_0x159537,_0xdd4bcf,_0x5adac5){VoiceQueueEvents[_0xcee4('0x6')](_0x751aad+':'+_0x159537['id'],_0x159537);VoiceQueueEvents[_0xcee4('0x6')](_0x751aad,_0x159537);_0x5adac5(null);};}for(var e in events){if(events[_0xcee4('0x7')](e)){var event=events[e];VoiceQueue[_0xcee4('0x8')](e,emitEvent(event));}}module[_0xcee4('0x9')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xa329=['update','remove','emit','hasOwnProperty','events','../../mysqldb','VoiceQueue','save'];(function(_0x44d5a4,_0x2e1506){var _0x285ba9=function(_0x57ec11){while(--_0x57ec11){_0x44d5a4['push'](_0x44d5a4['shift']());}};_0x285ba9(++_0x2e1506);}(_0xa329,0x19c));var _0x9a32=function(_0x158a8c,_0x4a9a17){_0x158a8c=_0x158a8c-0x0;var _0x98ff07=_0xa329[_0x158a8c];return _0x98ff07;};'use strict';var EventEmitter=require(_0x9a32('0x0'));var VoiceQueue=require(_0x9a32('0x1'))['db'][_0x9a32('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a32('0x3'),'afterUpdate':_0x9a32('0x4'),'afterDestroy':_0x9a32('0x5')};function emitEvent(_0x23a5a1){return function(_0x10b859,_0x438b63,_0x508381){VoiceQueueEvents[_0x9a32('0x6')](_0x23a5a1+':'+_0x10b859['id'],_0x10b859);VoiceQueueEvents[_0x9a32('0x6')](_0x23a5a1,_0x10b859);_0x508381(null);};}for(var e in events){if(events[_0x9a32('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
index 3c5e8bb..ee98e93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x1baccc,_0x2a5c75){var _0x4d986e=function(_0x5c9919){while(--_0x5c9919){_0x1baccc['push'](_0x1baccc['shift']());}};_0x4d986e(++_0x2a5c75);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x334292,_0x4b363f){var _0x3ecafb=function(_0x5d48ce){while(--_0x5d48ce){_0x334292['push'](_0x334292['shift']());}};_0x3ecafb(++_0x4b363f);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 42c4265..e119ae3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27e8=['defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0x27e8,0x1ac));var _0x827e=function(_0x3c8ca2,_0x5dbe49){_0x3c8ca2=_0x3c8ca2-0x0;var _0x2781da=_0x27e8[_0x3c8ca2];return _0x2781da;};'use strict';var _=require(_0x827e('0x0'));var util=require(_0x827e('0x1'));var moment=require(_0x827e('0x2'));var BPromise=require(_0x827e('0x3'));var rs=require(_0x827e('0x4'));var fs=require('fs');var Redis=require(_0x827e('0x5'));var db=require(_0x827e('0x6'))['db'];var utils=require(_0x827e('0x7'));var logger=require(_0x827e('0x8'))('rpc');var config=require(_0x827e('0x9'));var jayson=require(_0x827e('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x827e('0xb')]=_[_0x827e('0xc')](config[_0x827e('0xb')],{'host':_0x827e('0xd'),'port':0x18eb});var socket=require(_0x827e('0xe'))(new Redis(config[_0x827e('0xb')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x418da0,_0x2c00b0,_0x3fe8a9){return new BPromise(function(_0x28928c,_0x3a7ed9){return client['request'](_0x418da0,_0x3fe8a9)[_0x827e('0xf')](function(_0x410c6c){logger[_0x827e('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x2c00b0,_0x827e('0x11'));logger[_0x827e('0x12')](_0x827e('0x13'),_0x2c00b0,_0x827e('0x11'),JSON['stringify'](_0x410c6c));if(_0x410c6c[_0x827e('0x14')]){if(_0x410c6c[_0x827e('0x14')][_0x827e('0x15')]===0x1f4){logger[_0x827e('0x14')](_0x827e('0x16'),_0x2c00b0,_0x410c6c[_0x827e('0x14')]['message']);return _0x3a7ed9(_0x410c6c[_0x827e('0x14')][_0x827e('0x17')]);}logger[_0x827e('0x14')](_0x827e('0x16'),_0x2c00b0,_0x410c6c[_0x827e('0x14')][_0x827e('0x17')]);return _0x28928c(_0x410c6c['error'][_0x827e('0x17')]);}else{logger[_0x827e('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x2c00b0,'request\x20sent');_0x28928c(_0x410c6c[_0x827e('0x18')][_0x827e('0x17')]);}})[_0x827e('0x19')](function(_0x505ea8){logger[_0x827e('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x2c00b0,_0x505ea8);_0x3a7ed9(_0x505ea8);});});}exports['GetVoiceQueue']=function(_0x48a668){var _0x4772de=this;return new Promise(function(_0xb09a78,_0x71b8c6){return db['VoiceQueue'][_0x827e('0x1a')]({'raw':_0x48a668[_0x827e('0x1b')]?_0x48a668[_0x827e('0x1b')][_0x827e('0x1c')]===undefined?!![]:![]:!![],'where':_0x48a668[_0x827e('0x1b')]?_0x48a668[_0x827e('0x1b')][_0x827e('0x1d')]||null:null,'attributes':_0x48a668[_0x827e('0x1b')]?_0x48a668[_0x827e('0x1b')][_0x827e('0x1e')]||null:null,'limit':_0x48a668[_0x827e('0x1b')]?_0x48a668[_0x827e('0x1b')][_0x827e('0x1f')]||null:null,'include':_0x48a668[_0x827e('0x1b')]?_0x48a668[_0x827e('0x1b')][_0x827e('0x20')]?_[_0x827e('0x21')](_0x48a668[_0x827e('0x1b')]['include'],function(_0x597bbd){return{'model':db[_0x597bbd[_0x827e('0x22')]],'as':_0x597bbd['as'],'attributes':_0x597bbd[_0x827e('0x1e')],'include':_0x597bbd['include']?_[_0x827e('0x21')](_0x597bbd['include'],function(_0x13cb01){return{'model':db[_0x13cb01[_0x827e('0x22')]],'as':_0x13cb01['as'],'attributes':_0x13cb01['attributes'],'include':_0x13cb01['include']?_[_0x827e('0x21')](_0x13cb01[_0x827e('0x20')],function(_0x20affe){return{'model':db[_0x20affe['model']],'as':_0x20affe['as'],'attributes':_0x20affe[_0x827e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x827e('0xf')](function(_0x489155){logger['info'](_0x827e('0x23'),_0x48a668);logger[_0x827e('0x12')](_0x827e('0x23'),_0x48a668,JSON['stringify'](_0x489155));_0xb09a78(_0x489155);})['catch'](function(_0x90564e){logger[_0x827e('0x14')](_0x827e('0x23'),_0x90564e[_0x827e('0x17')],_0x48a668);_0x71b8c6(_0x4772de[_0x827e('0x14')](0x1f4,_0x90564e['message']));});});};exports[_0x827e('0x24')]=function(_0x506c80){var _0x2f4cc7=this;return new Promise(function(_0x4cf501,_0x83cf){return db[_0x827e('0x25')][_0x827e('0x26')]({'raw':_0x506c80[_0x827e('0x1b')]?_0x506c80[_0x827e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x506c80['options']?_0x506c80['options']['where']||null:null,'attributes':_0x506c80[_0x827e('0x1b')]?_0x506c80[_0x827e('0x1b')][_0x827e('0x1e')]||null:null,'include':_0x506c80[_0x827e('0x1b')]?_0x506c80[_0x827e('0x1b')][_0x827e('0x20')]?_[_0x827e('0x21')](_0x506c80[_0x827e('0x1b')][_0x827e('0x20')],function(_0x5c056c){return{'model':db[_0x5c056c[_0x827e('0x22')]],'as':_0x5c056c['as'],'attributes':_0x5c056c[_0x827e('0x1e')],'include':_0x5c056c[_0x827e('0x20')]?_['map'](_0x5c056c[_0x827e('0x20')],function(_0x16962c){return{'model':db[_0x16962c[_0x827e('0x22')]],'as':_0x16962c['as'],'attributes':_0x16962c[_0x827e('0x1e')],'include':_0x16962c[_0x827e('0x20')]?_['map'](_0x16962c[_0x827e('0x20')],function(_0x44281b){return{'model':db[_0x44281b[_0x827e('0x22')]],'as':_0x44281b['as'],'attributes':_0x44281b[_0x827e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27f4b0){logger[_0x827e('0x10')](_0x827e('0x24'),_0x506c80);logger[_0x827e('0x12')]('ShowVoiceQueue',_0x506c80,JSON[_0x827e('0x27')](_0x27f4b0));_0x4cf501(_0x27f4b0);})['catch'](function(_0x2b9951){logger['error'](_0x827e('0x24'),_0x2b9951[_0x827e('0x17')],_0x506c80);_0x83cf(_0x2f4cc7[_0x827e('0x14')](0x1f4,_0x2b9951[_0x827e('0x17')]));});});};
\ No newline at end of file
+var _0xc089=['VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','limit','include','model','attributes','map','then','ShowVoiceQueue','catch','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd9ea6,_0x52b2cd){var _0x14b15d=function(_0x50dd11){while(--_0x50dd11){_0xd9ea6['push'](_0xd9ea6['shift']());}};_0x14b15d(++_0x52b2cd);}(_0xc089,0x12c));var _0x9c08=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc089[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c08('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c08('0x1'));var db=require(_0x9c08('0x2'))['db'];var utils=require(_0x9c08('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9c08('0x4'));var client=jayson['client'][_0x9c08('0x5')]({'port':0x232a});config[_0x9c08('0x6')]=_[_0x9c08('0x7')](config[_0x9c08('0x6')],{'host':_0x9c08('0x8'),'port':0x18eb});var socket=require(_0x9c08('0x9'))(new Redis(config[_0x9c08('0x6')]));require(_0x9c08('0xa'))['register'](socket);function respondWithRpcPromise(_0x2ab4ef,_0x52a625,_0x1e96e9){return new BPromise(function(_0x386269,_0x41fd3f){return client[_0x9c08('0xb')](_0x2ab4ef,_0x1e96e9)['then'](function(_0x56b39a){logger['info'](_0x9c08('0xc'),_0x52a625,_0x9c08('0xd'));logger[_0x9c08('0xe')](_0x9c08('0xf'),_0x52a625,_0x9c08('0xd'),JSON[_0x9c08('0x10')](_0x56b39a));if(_0x56b39a[_0x9c08('0x11')]){if(_0x56b39a[_0x9c08('0x11')][_0x9c08('0x12')]===0x1f4){logger[_0x9c08('0x11')](_0x9c08('0xc'),_0x52a625,_0x56b39a[_0x9c08('0x11')][_0x9c08('0x13')]);return _0x41fd3f(_0x56b39a[_0x9c08('0x11')][_0x9c08('0x13')]);}logger[_0x9c08('0x11')](_0x9c08('0xc'),_0x52a625,_0x56b39a['error'][_0x9c08('0x13')]);return _0x386269(_0x56b39a[_0x9c08('0x11')][_0x9c08('0x13')]);}else{logger[_0x9c08('0x14')](_0x9c08('0xc'),_0x52a625,_0x9c08('0xd'));_0x386269(_0x56b39a[_0x9c08('0x15')][_0x9c08('0x13')]);}})['catch'](function(_0x30bdf){logger[_0x9c08('0x11')](_0x9c08('0xc'),_0x52a625,_0x30bdf);_0x41fd3f(_0x30bdf);});});}exports[_0x9c08('0x16')]=function(_0xb454b6){var _0x35bbf4=this;return new Promise(function(_0x307ff1,_0x4b9d4d){return db[_0x9c08('0x17')][_0x9c08('0x18')]({'raw':_0xb454b6[_0x9c08('0x19')]?_0xb454b6[_0x9c08('0x19')][_0x9c08('0x1a')]===undefined?!![]:![]:!![],'where':_0xb454b6[_0x9c08('0x19')]?_0xb454b6[_0x9c08('0x19')]['where']||null:null,'attributes':_0xb454b6[_0x9c08('0x19')]?_0xb454b6[_0x9c08('0x19')]['attributes']||null:null,'limit':_0xb454b6['options']?_0xb454b6[_0x9c08('0x19')][_0x9c08('0x1b')]||null:null,'include':_0xb454b6[_0x9c08('0x19')]?_0xb454b6[_0x9c08('0x19')][_0x9c08('0x1c')]?_['map'](_0xb454b6[_0x9c08('0x19')][_0x9c08('0x1c')],function(_0x54fbf5){return{'model':db[_0x54fbf5[_0x9c08('0x1d')]],'as':_0x54fbf5['as'],'attributes':_0x54fbf5[_0x9c08('0x1e')],'include':_0x54fbf5['include']?_[_0x9c08('0x1f')](_0x54fbf5[_0x9c08('0x1c')],function(_0x17cf9a){return{'model':db[_0x17cf9a['model']],'as':_0x17cf9a['as'],'attributes':_0x17cf9a[_0x9c08('0x1e')],'include':_0x17cf9a[_0x9c08('0x1c')]?_['map'](_0x17cf9a['include'],function(_0x49b3e2){return{'model':db[_0x49b3e2['model']],'as':_0x49b3e2['as'],'attributes':_0x49b3e2[_0x9c08('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9c08('0x20')](function(_0x2c5c09){logger[_0x9c08('0x14')](_0x9c08('0x16'),_0xb454b6);logger[_0x9c08('0xe')]('GetVoiceQueue',_0xb454b6,JSON[_0x9c08('0x10')](_0x2c5c09));_0x307ff1(_0x2c5c09);})['catch'](function(_0x200c12){logger['error'](_0x9c08('0x16'),_0x200c12['message'],_0xb454b6);_0x4b9d4d(_0x35bbf4['error'](0x1f4,_0x200c12[_0x9c08('0x13')]));});});};exports[_0x9c08('0x21')]=function(_0x71941){var _0x5c8c66=this;return new Promise(function(_0x1fe4a8,_0x2602d2){return db['VoiceQueue']['find']({'raw':_0x71941[_0x9c08('0x19')]?_0x71941['options'][_0x9c08('0x1a')]===undefined?!![]:![]:!![],'where':_0x71941['options']?_0x71941[_0x9c08('0x19')]['where']||null:null,'attributes':_0x71941[_0x9c08('0x19')]?_0x71941['options'][_0x9c08('0x1e')]||null:null,'include':_0x71941[_0x9c08('0x19')]?_0x71941[_0x9c08('0x19')][_0x9c08('0x1c')]?_[_0x9c08('0x1f')](_0x71941['options'][_0x9c08('0x1c')],function(_0x4851f5){return{'model':db[_0x4851f5[_0x9c08('0x1d')]],'as':_0x4851f5['as'],'attributes':_0x4851f5['attributes'],'include':_0x4851f5[_0x9c08('0x1c')]?_[_0x9c08('0x1f')](_0x4851f5[_0x9c08('0x1c')],function(_0x316f68){return{'model':db[_0x316f68['model']],'as':_0x316f68['as'],'attributes':_0x316f68[_0x9c08('0x1e')],'include':_0x316f68[_0x9c08('0x1c')]?_['map'](_0x316f68['include'],function(_0x23cc14){return{'model':db[_0x23cc14[_0x9c08('0x1d')]],'as':_0x23cc14['as'],'attributes':_0x23cc14[_0x9c08('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9c08('0x20')](function(_0x4cb2d4){logger[_0x9c08('0x14')](_0x9c08('0x21'),_0x71941);logger[_0x9c08('0xe')](_0x9c08('0x21'),_0x71941,JSON[_0x9c08('0x10')](_0x4cb2d4));_0x1fe4a8(_0x4cb2d4);})[_0x9c08('0x22')](function(_0x5d43dc){logger[_0x9c08('0x11')](_0x9c08('0x21'),_0x5d43dc['message'],_0x71941);_0x2602d2(_0x5c8c66[_0x9c08('0x11')](0x1f4,_0x5d43dc[_0x9c08('0x13')]));});});};
\ No newline at end of file
index 30e1362..1369988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d78=['remove','update','emit','removeListener','register','./voiceQueue.events','save'];(function(_0x1aff80,_0x56b825){var _0x5daec2=function(_0x265898){while(--_0x265898){_0x1aff80['push'](_0x1aff80['shift']());}};_0x5daec2(++_0x56b825);}(_0x1d78,0x16a));var _0x81d7=function(_0x242459,_0x19c969){_0x242459=_0x242459-0x0;var _0x569200=_0x1d78[_0x242459];return _0x569200;};'use strict';var VoiceQueueEvents=require(_0x81d7('0x0'));var events=[_0x81d7('0x1'),_0x81d7('0x2'),_0x81d7('0x3')];function createListener(_0xfd3fb6,_0xb99000){return function(_0x234265){_0xb99000[_0x81d7('0x4')](_0xfd3fb6,_0x234265);};}function removeListener(_0x331d00,_0x8c1c59){return function(){VoiceQueueEvents[_0x81d7('0x5')](_0x331d00,_0x8c1c59);};}exports[_0x81d7('0x6')]=function(_0x99bd18){for(var _0x15338c=0x0,_0x5cb3dc=events['length'];_0x15338c<_0x5cb3dc;_0x15338c++){var _0x2fdf68=events[_0x15338c];var _0x1317c4=createListener('voiceQueue:'+_0x2fdf68,_0x99bd18);VoiceQueueEvents['on'](_0x2fdf68,_0x1317c4);}};
\ No newline at end of file
+var _0xbbc5=['voiceQueue:','./voiceQueue.events','update','removeListener','length'];(function(_0x41c4f6,_0x22dfd2){var _0x9fde5d=function(_0x41f7ef){while(--_0x41f7ef){_0x41c4f6['push'](_0x41c4f6['shift']());}};_0x9fde5d(++_0x22dfd2);}(_0xbbc5,0x1e1));var _0x5bbc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbbc5[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceQueueEvents=require(_0x5bbc('0x0'));var events=['save','remove',_0x5bbc('0x1')];function createListener(_0x3f76d2,_0x2faba5){return function(_0x1b2b33){_0x2faba5['emit'](_0x3f76d2,_0x1b2b33);};}function removeListener(_0xc4bed0,_0x1bcbf3){return function(){VoiceQueueEvents[_0x5bbc('0x2')](_0xc4bed0,_0x1bcbf3);};}exports['register']=function(_0x53a6df){for(var _0x2741a3=0x0,_0x112fc4=events[_0x5bbc('0x3')];_0x2741a3<_0x112fc4;_0x2741a3++){var _0x716c59=events[_0x2741a3];var _0xd13c26=createListener(_0x5bbc('0x4')+_0x716c59,_0x53a6df);VoiceQueueEvents['on'](_0x716c59,_0xd13c26);}};
\ No newline at end of file
index 987a524..ed10d2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcd1=['put','update','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','get','describe','/index','getVoiceQueuesReport','/:id','post'];(function(_0x42f8f7,_0x4715f7){var _0x5bba4d=function(_0xbd11e3){while(--_0xbd11e3){_0x42f8f7['push'](_0x42f8f7['shift']());}};_0x5bba4d(++_0x4715f7);}(_0xbcd1,0x114));var _0x1bcd=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xbcd1[_0x433a86];return _0x23000c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1bcd('0x0'));var express=require('express');var router=express[_0x1bcd('0x1')]();var fs_extra=require(_0x1bcd('0x2'));var auth=require(_0x1bcd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1bcd('0x4'));var controller=require(_0x1bcd('0x5'));router['get']('/',auth[_0x1bcd('0x6')](),controller['index']);router[_0x1bcd('0x7')]('/describe',auth[_0x1bcd('0x6')](),controller[_0x1bcd('0x8')]);router[_0x1bcd('0x7')](_0x1bcd('0x9'),auth[_0x1bcd('0x6')](),controller[_0x1bcd('0xa')]);router[_0x1bcd('0x7')](_0x1bcd('0xb'),auth[_0x1bcd('0x6')](),controller['show']);router[_0x1bcd('0xc')]('/',auth[_0x1bcd('0x6')](),controller['create']);router[_0x1bcd('0xd')](_0x1bcd('0xb'),auth[_0x1bcd('0x6')](),controller[_0x1bcd('0xe')]);router[_0x1bcd('0xf')](_0x1bcd('0xb'),auth['isAuthenticated'](),controller[_0x1bcd('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xcbb3=['../../config/environment','index','get','isAuthenticated','getVoiceQueuesReport','/:id','show','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x347d10,_0x2d798f){var _0x1154c5=function(_0x201ce9){while(--_0x201ce9){_0x347d10['push'](_0x347d10['shift']());}};_0x1154c5(++_0x2d798f);}(_0xcbb3,0x14d));var _0x3cbb=function(_0x21def0,_0x2137a3){_0x21def0=_0x21def0-0x0;var _0x10fdc3=_0xcbb3[_0x21def0];return _0x10fdc3;};'use strict';var multer=require(_0x3cbb('0x0'));var util=require(_0x3cbb('0x1'));var path=require(_0x3cbb('0x2'));var timeout=require(_0x3cbb('0x3'));var express=require(_0x3cbb('0x4'));var router=express[_0x3cbb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3cbb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3cbb('0x7'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3cbb('0x8')]);router[_0x3cbb('0x9')]('/describe',auth[_0x3cbb('0xa')](),controller['describe']);router['get']('/index',auth[_0x3cbb('0xa')](),controller[_0x3cbb('0xb')]);router[_0x3cbb('0x9')](_0x3cbb('0xc'),auth[_0x3cbb('0xa')](),controller[_0x3cbb('0xd')]);router['post']('/',auth[_0x3cbb('0xa')](),controller['create']);router['put'](_0x3cbb('0xc'),auth[_0x3cbb('0xa')](),controller[_0x3cbb('0xe')]);router['delete']('/:id',auth[_0x3cbb('0xa')](),controller[_0x3cbb('0xf')]);module[_0x3cbb('0x10')]=router;
\ No newline at end of file
index b3b64a0..07c1cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0925=['STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x5d4e83,_0x23c49e){var _0x503b36=function(_0xaabb32){while(--_0xaabb32){_0x5d4e83['push'](_0x5d4e83['shift']());}};_0x503b36(++_0x23c49e);}(_0x0925,0x96));var _0x5092=function(_0x528fd9,_0x4de3c4){_0x528fd9=_0x528fd9-0x0;var _0x59b2aa=_0x0925[_0x528fd9];return _0x59b2aa;};'use strict';var Sequelize=require(_0x5092('0x0'));var moment=require(_0x5092('0x1'));module[_0x5092('0x2')]={'type':{'type':Sequelize[_0x5092('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5092('0x3')]},'calleridname':{'type':Sequelize[_0x5092('0x3')]},'queue':{'type':Sequelize[_0x5092('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x5092('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1666ab){var _0x3c412f=moment(_0x1666ab);var _0x57fc57=moment(this[_0x5092('0x5')](_0x5092('0x6')))['format'](_0x5092('0x7'));var _0x10b323=_0x3c412f[_0x5092('0x8')](_0x57fc57,_0x5092('0x9'));this[_0x5092('0xa')](_0x5092('0xb'),_0x1666ab);this[_0x5092('0xa')](_0x5092('0xc'),_0x10b323||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x5092('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5092('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x5092('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5092('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x5092('0x3')],'comment':_0x5092('0xe')},'originalposition':{'type':Sequelize[_0x5092('0xf')]},'channel':{'type':Sequelize[_0x5092('0x3')]},'connectedlinenum':{'type':Sequelize[_0x5092('0x3')]},'connectedlinename':{'type':Sequelize[_0x5092('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5092('0x3')]},'priority':{'type':Sequelize[_0x5092('0x3')]},'holdtime':{'type':Sequelize[_0x5092('0xf')]},'mohtime':{'type':Sequelize[_0x5092('0xf')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5092('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x5092('0x3')]},'transfer':{'type':Sequelize[_0x5092('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5092('0x3')],'comment':_0x5092('0x10')},'transferexten':{'type':Sequelize[_0x5092('0x3')]},'transferuniqueid':{'type':Sequelize[_0x5092('0x3')]},'disposition':{'type':Sequelize[_0x5092('0x3')]},'secondDisposition':{'type':Sequelize[_0x5092('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5092('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x5092('0xf')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa1a1=['BOOLEAN','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa1a1,0xe5));var _0x1a1a=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xa1a1[_0x2ac4af];return _0x3a36df;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1a1a('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1a1a('0x1')]},'calleridnum':{'type':Sequelize[_0x1a1a('0x1')]},'calleridname':{'type':Sequelize[_0x1a1a('0x1')]},'queue':{'type':Sequelize[_0x1a1a('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x1a1a('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x1a1a('0x2')],'set':function(_0x2b1780){var _0x7bd7f=moment(_0x2b1780);var _0x123d4f=moment(this[_0x1a1a('0x3')](_0x1a1a('0x4')))[_0x1a1a('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0xdfc387=_0x7bd7f[_0x1a1a('0x6')](_0x123d4f,_0x1a1a('0x7'));this[_0x1a1a('0x8')](_0x1a1a('0x9'),_0x2b1780);this['setDataValue']('holdtime',_0xdfc387||null);}},'position':{'type':Sequelize[_0x1a1a('0xa')]},'count':{'type':Sequelize[_0x1a1a('0xa')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1a1a('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x1a1a('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x1a1a('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1a1a('0x2')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x1a1a('0x1')]},'connectedlinenum':{'type':Sequelize[_0x1a1a('0x1')]},'connectedlinename':{'type':Sequelize[_0x1a1a('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1a1a('0x1')]},'holdtime':{'type':Sequelize[_0x1a1a('0xa')]},'mohtime':{'type':Sequelize[_0x1a1a('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1a1a('0x1')]},'transfer':{'type':Sequelize[_0x1a1a('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1a1a('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x1a1a('0x1')]},'disposition':{'type':Sequelize[_0x1a1a('0x1')]},'secondDisposition':{'type':Sequelize[_0x1a1a('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x1a1a('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index 8015e23..b22138b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x255e=['defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','map','VoiceQueueReport','type','key','model','keys','filters','query','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','rawAttributes','includeAll','options','find','catch','create','body','params','getVoiceQueuesReport','hasOwnProperty','order','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util'];(function(_0x204369,_0x495882){var _0x3e4b82=function(_0x35b640){while(--_0x35b640){_0x204369['push'](_0x204369['shift']());}};_0x3e4b82(++_0x495882);}(_0x255e,0x185));var _0xe255=function(_0x38cb08,_0x210df0){_0x38cb08=_0x38cb08-0x0;var _0x3261cb=_0x255e[_0x38cb08];return _0x3261cb;};'use strict';var emlformat=require(_0xe255('0x0'));var rimraf=require(_0xe255('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe255('0x2'));var rp=require(_0xe255('0x3'));var moment=require(_0xe255('0x4'));var BPromise=require(_0xe255('0x5'));var Mustache=require(_0xe255('0x6'));var util=require(_0xe255('0x7'));var path=require(_0xe255('0x8'));var sox=require(_0xe255('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe255('0xa'));var _=require(_0xe255('0xb'));var squel=require(_0xe255('0xc'));var crypto=require(_0xe255('0xd'));var jsforce=require(_0xe255('0xe'));var deskjs=require(_0xe255('0xf'));var toCsv=require(_0xe255('0x10'));var querystring=require(_0xe255('0x11'));var Papa=require(_0xe255('0x12'));var Redis=require(_0xe255('0x13'));var authService=require(_0xe255('0x14'));var qs=require(_0xe255('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe255('0x16'));var logger=require('../../config/logger')(_0xe255('0x17'));var utils=require('../../config/utils');var config=require(_0xe255('0x18'));var licenseUtil=require(_0xe255('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe255('0x1a')](config['redis'],{'host':_0xe255('0x1b'),'port':0x18eb});var socket=require(_0xe255('0x1c'))(new Redis(config['redis']));require(_0xe255('0x1d'))[_0xe255('0x1e')](socket);function respondWithStatusCode(_0x1b9849,_0x585fe3){_0x585fe3=_0x585fe3||0xcc;return function(_0x14ec0f){if(_0x14ec0f){return _0x1b9849[_0xe255('0x1f')](_0x585fe3);}return _0x1b9849['status'](_0x585fe3)[_0xe255('0x20')]();};}function respondWithResult(_0x3b7415,_0x556708){_0x556708=_0x556708||0xc8;return function(_0x46f566){if(_0x46f566){return _0x3b7415[_0xe255('0x21')](_0x556708)[_0xe255('0x22')](_0x46f566);}};}function respondWithFilteredResult(_0x164e6a,_0x8680aa){return function(_0x3ed839){if(_0x3ed839){var _0x3f577b=typeof _0x8680aa['offset']===_0xe255('0x23')&&typeof _0x8680aa[_0xe255('0x24')]==='undefined';var _0x20e45a=_0x3ed839[_0xe255('0x25')];var _0x1852da=_0x3f577b?0x0:_0x8680aa['offset'];var _0x1b7ee5=_0x3f577b?_0x3ed839[_0xe255('0x25')]:_0x8680aa[_0xe255('0x26')]+_0x8680aa['limit'];var _0x1b339a;if(_0x1b7ee5>=_0x20e45a){_0x1b7ee5=_0x20e45a;_0x1b339a=0xc8;}else{_0x1b339a=0xce;}_0x164e6a[_0xe255('0x21')](_0x1b339a);return _0x164e6a[_0xe255('0x27')](_0xe255('0x28'),_0x1852da+'-'+_0x1b7ee5+'/'+_0x20e45a)[_0xe255('0x22')](_0x3ed839);}return null;};}function patchUpdates(_0x3d6a47){return function(_0x30d31b){try{jsonpatch[_0xe255('0x29')](_0x30d31b,_0x3d6a47,!![]);}catch(_0x24444b){return BPromise['reject'](_0x24444b);}return _0x30d31b[_0xe255('0x2a')]();};}function saveUpdates(_0x37d87d,_0x290291){return function(_0x37d5aa){if(_0x37d5aa){return _0x37d5aa[_0xe255('0x2b')](_0x37d87d)[_0xe255('0x2c')](function(_0x445f14){return _0x445f14;});}return null;};}function removeEntity(_0x54bd5e,_0x2c68a0){return function(_0x3a9eae){if(_0x3a9eae){return _0x3a9eae[_0xe255('0x2d')]()[_0xe255('0x2c')](function(){_0x54bd5e[_0xe255('0x21')](0xcc)[_0xe255('0x20')]();});}};}function handleEntityNotFound(_0x4cb4ff,_0x18e11f){return function(_0x411fdd){if(!_0x411fdd){_0x4cb4ff[_0xe255('0x1f')](0x194);}return _0x411fdd;};}function handleError(_0x48c27a,_0x489519){_0x489519=_0x489519||0x1f4;return function(_0x1b5173){logger[_0xe255('0x2e')](_0x1b5173[_0xe255('0x2f')]);if(_0x1b5173[_0xe255('0x30')]){delete _0x1b5173['name'];}_0x48c27a['status'](_0x489519)['send'](_0x1b5173);};}exports['index']=function(_0x140de4,_0x13f289){var _0x4b71e4={},_0x15cfd3={},_0x4896ca={'count':0x0,'rows':[]};var _0x581ef2=_[_0xe255('0x31')](db[_0xe255('0x32')]['rawAttributes'],function(_0x19e716){return{'name':_0x19e716['fieldName'],'type':_0x19e716[_0xe255('0x33')][_0xe255('0x34')]};});_0x15cfd3[_0xe255('0x35')]=_[_0xe255('0x31')](_0x581ef2,_0xe255('0x30'));_0x15cfd3['query']=_[_0xe255('0x36')](_0x140de4['query']);_0x15cfd3[_0xe255('0x37')]=_['intersection'](_0x15cfd3[_0xe255('0x35')],_0x15cfd3[_0xe255('0x38')]);_0x4b71e4['attributes']=_[_0xe255('0x39')](_0x15cfd3[_0xe255('0x35')],qs['fields'](_0x140de4['query'][_0xe255('0x3a')]));_0x4b71e4['attributes']=_0x4b71e4[_0xe255('0x3b')][_0xe255('0x3c')]?_0x4b71e4['attributes']:_0x15cfd3['model'];if(!_0x140de4['query']['hasOwnProperty'](_0xe255('0x3d'))){_0x4b71e4['limit']=qs[_0xe255('0x24')](_0x140de4[_0xe255('0x38')]['limit']);_0x4b71e4[_0xe255('0x26')]=qs['offset'](_0x140de4[_0xe255('0x38')]['offset']);}_0x4b71e4['order']=qs[_0xe255('0x3e')](_0x140de4[_0xe255('0x38')][_0xe255('0x3e')]);_0x4b71e4[_0xe255('0x3f')]=qs[_0xe255('0x37')](_['pick'](_0x140de4['query'],_0x15cfd3[_0xe255('0x37')]),_0x581ef2);if(_0x140de4['query'][_0xe255('0x40')]){_0x4b71e4[_0xe255('0x3f')]=_[_0xe255('0x41')](_0x4b71e4[_0xe255('0x3f')],{'$or':_[_0xe255('0x31')](_0x581ef2,function(_0x3599cd){if(_0x3599cd['type']!==_0xe255('0x42')){var _0x303e3a={};_0x303e3a[_0x3599cd['name']]={'$like':'%'+_0x140de4['query'][_0xe255('0x40')]+'%'};return _0x303e3a;}})});}_0x4b71e4=_[_0xe255('0x41')]({},_0x4b71e4,_0x140de4['options']);var _0x599eb9={'where':_0x4b71e4[_0xe255('0x3f')]};return db[_0xe255('0x32')][_0xe255('0x25')](_0x599eb9)[_0xe255('0x2c')](function(_0x485571){_0x4896ca[_0xe255('0x25')]=_0x485571;if(_0x140de4['query']['includeAll']){_0x4b71e4[_0xe255('0x43')]=[{'all':!![]}];}return db[_0xe255('0x32')][_0xe255('0x44')](_0x4b71e4);})[_0xe255('0x2c')](function(_0xeb473c){_0x4896ca[_0xe255('0x45')]=_0xeb473c;return _0x4896ca;})[_0xe255('0x2c')](respondWithFilteredResult(_0x13f289,_0x4b71e4))['catch'](handleError(_0x13f289,null));};exports[_0xe255('0x46')]=function(_0x422342,_0x6d616e){var _0x3184f1={'raw':![],'where':{'id':_0x422342['params']['id']}},_0x7b041d={};_0x7b041d['model']=_[_0xe255('0x36')](db[_0xe255('0x32')][_0xe255('0x47')]);_0x7b041d[_0xe255('0x38')]=_[_0xe255('0x36')](_0x422342[_0xe255('0x38')]);_0x7b041d[_0xe255('0x37')]=_[_0xe255('0x39')](_0x7b041d[_0xe255('0x35')],_0x7b041d[_0xe255('0x38')]);_0x3184f1[_0xe255('0x3b')]=_['intersection'](_0x7b041d[_0xe255('0x35')],qs[_0xe255('0x3a')](_0x422342[_0xe255('0x38')][_0xe255('0x3a')]));_0x3184f1[_0xe255('0x3b')]=_0x3184f1['attributes'][_0xe255('0x3c')]?_0x3184f1[_0xe255('0x3b')]:_0x7b041d[_0xe255('0x35')];if(_0x422342['query'][_0xe255('0x48')]){_0x3184f1['include']=[{'all':!![]}];}_0x3184f1=_['merge']({},_0x3184f1,_0x422342[_0xe255('0x49')]);return db[_0xe255('0x32')][_0xe255('0x4a')](_0x3184f1)['then'](handleEntityNotFound(_0x6d616e,null))['then'](respondWithResult(_0x6d616e,null))[_0xe255('0x4b')](handleError(_0x6d616e,null));};exports[_0xe255('0x4c')]=function(_0x8f66b6,_0x2b657e){return db['VoiceQueueReport'][_0xe255('0x4c')](_0x8f66b6[_0xe255('0x4d')],{})['then'](respondWithResult(_0x2b657e,0xc9))[_0xe255('0x4b')](handleError(_0x2b657e,null));};exports['update']=function(_0x1ff986,_0x4feedc){if(_0x1ff986['body']['id']){delete _0x1ff986[_0xe255('0x4d')]['id'];}return db[_0xe255('0x32')][_0xe255('0x4a')]({'where':{'id':_0x1ff986['params']['id']}})[_0xe255('0x2c')](handleEntityNotFound(_0x4feedc,null))['then'](saveUpdates(_0x1ff986['body'],null))[_0xe255('0x2c')](respondWithResult(_0x4feedc,null))[_0xe255('0x4b')](handleError(_0x4feedc,null));};exports[_0xe255('0x2d')]=function(_0x261c00,_0xba3346){return db[_0xe255('0x32')][_0xe255('0x4a')]({'where':{'id':_0x261c00[_0xe255('0x4e')]['id']}})['then'](handleEntityNotFound(_0xba3346,null))[_0xe255('0x2c')](removeEntity(_0xba3346,null))[_0xe255('0x4b')](handleError(_0xba3346,null));};exports['describe']=function(_0xf78d19,_0x183279){return db['VoiceQueueReport']['describe']()[_0xe255('0x2c')](respondWithResult(_0x183279,null))[_0xe255('0x4b')](handleError(_0x183279,null));};exports[_0xe255('0x4f')]=function(_0x48e52e,_0x4fd142){var _0xd866b2={},_0x37667b={},_0x4a107a={'count':0x0,'rows':[]};_0x37667b[_0xe255('0x35')]=_[_0xe255('0x36')](db['VoiceQueueReport'][_0xe255('0x47')]);_0x37667b[_0xe255('0x38')]=_[_0xe255('0x36')](_0x48e52e[_0xe255('0x38')]);_0x37667b[_0xe255('0x37')]=_[_0xe255('0x39')](_0x37667b['model'],_0x37667b[_0xe255('0x38')]);_0xd866b2[_0xe255('0x3b')]=_[_0xe255('0x39')](_0x37667b[_0xe255('0x35')],qs[_0xe255('0x3a')](_0x48e52e[_0xe255('0x38')]['fields']));_0xd866b2[_0xe255('0x3b')]=_0xd866b2[_0xe255('0x3b')][_0xe255('0x3c')]?_0xd866b2[_0xe255('0x3b')]:_0x37667b[_0xe255('0x35')];if(!_0x48e52e[_0xe255('0x38')][_0xe255('0x50')](_0xe255('0x3d'))){_0xd866b2[_0xe255('0x24')]=qs[_0xe255('0x24')](_0x48e52e[_0xe255('0x38')][_0xe255('0x24')]);_0xd866b2[_0xe255('0x26')]=qs[_0xe255('0x26')](_0x48e52e[_0xe255('0x38')][_0xe255('0x26')]);}_0xd866b2[_0xe255('0x51')]=qs[_0xe255('0x3e')](_0x48e52e[_0xe255('0x38')][_0xe255('0x3e')]);_0xd866b2[_0xe255('0x3f')]=qs[_0xe255('0x37')](_[_0xe255('0x52')](_0x48e52e['query'],_0x37667b[_0xe255('0x37')]));if(_0x48e52e[_0xe255('0x38')][_0xe255('0x40')]){_0xd866b2[_0xe255('0x3f')]=_[_0xe255('0x41')](_0xd866b2[_0xe255('0x3f')],{'$or':_[_0xe255('0x31')](_0xd866b2['attributes'],function(_0x4ae88a){var _0x4140f5={};_0x4140f5[_0x4ae88a]={'$like':'%'+_0x48e52e['query'][_0xe255('0x40')]+'%'};return _0x4140f5;})});}_0xd866b2=_[_0xe255('0x41')]({},_0xd866b2,_0x48e52e[_0xe255('0x49')]);var _0x256e41={'where':_0xd866b2[_0xe255('0x3f')]};return db[_0xe255('0x32')][_0xe255('0x25')](_0x256e41)['then'](function(_0x48379c){_0x4a107a['count']=_0x48379c;if(_0x48e52e[_0xe255('0x38')][_0xe255('0x48')]){_0xd866b2[_0xe255('0x43')]=[{'all':!![]}];}return db[_0xe255('0x32')][_0xe255('0x44')](_0xd866b2);})['then'](function(_0x30c110){_0x4a107a[_0xe255('0x45')]=_0x30c110;return _0x4a107a;})[_0xe255('0x2c')](respondWithFilteredResult(_0x4fd142,_0xd866b2,'getVoiceQueuesReport'))[_0xe255('0x4b')](handleError(_0x4fd142,null,_0xe255('0x4f')));};
\ No newline at end of file
+var _0x8adb=['../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','getVoiceQueuesReport','hasOwnProperty','zip-dir','request-promise','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8adb,0x1bd));var _0xb8ad=function(_0x1f0d07,_0x2b0955){_0x1f0d07=_0x1f0d07-0x0;var _0x36c46f=_0x8adb[_0x1f0d07];return _0x36c46f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb8ad('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8ad('0x1'));var moment=require(_0xb8ad('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb8ad('0x3'));var path=require(_0xb8ad('0x4'));var sox=require(_0xb8ad('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8ad('0x6'));var _=require(_0xb8ad('0x7'));var squel=require(_0xb8ad('0x8'));var crypto=require(_0xb8ad('0x9'));var jsforce=require(_0xb8ad('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb8ad('0xb'));var querystring=require(_0xb8ad('0xc'));var Papa=require(_0xb8ad('0xd'));var Redis=require(_0xb8ad('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb8ad('0xf'));var as=require(_0xb8ad('0x10'));var hardwareService=require(_0xb8ad('0x11'));var logger=require(_0xb8ad('0x12'))('api');var utils=require(_0xb8ad('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb8ad('0x14'))['db'];config[_0xb8ad('0x15')]=_[_0xb8ad('0x16')](config[_0xb8ad('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8ad('0x17'))(new Redis(config[_0xb8ad('0x15')]));require('./voiceQueueReport.socket')[_0xb8ad('0x18')](socket);function respondWithStatusCode(_0xd3c92c,_0x4788d3){_0x4788d3=_0x4788d3||0xcc;return function(_0x26f6bd){if(_0x26f6bd){return _0xd3c92c[_0xb8ad('0x19')](_0x4788d3);}return _0xd3c92c[_0xb8ad('0x1a')](_0x4788d3)[_0xb8ad('0x1b')]();};}function respondWithResult(_0x550fca,_0x4f56c4){_0x4f56c4=_0x4f56c4||0xc8;return function(_0x468e3a){if(_0x468e3a){return _0x550fca[_0xb8ad('0x1a')](_0x4f56c4)['json'](_0x468e3a);}};}function respondWithFilteredResult(_0x352f95,_0x358b4f){return function(_0x1226c8){if(_0x1226c8){var _0x30b483=typeof _0x358b4f[_0xb8ad('0x1c')]===_0xb8ad('0x1d')&&typeof _0x358b4f[_0xb8ad('0x1e')]===_0xb8ad('0x1d');var _0x32b61b=_0x1226c8[_0xb8ad('0x1f')];var _0x449193=_0x30b483?0x0:_0x358b4f[_0xb8ad('0x1c')];var _0x526eeb=_0x30b483?_0x1226c8[_0xb8ad('0x1f')]:_0x358b4f[_0xb8ad('0x1c')]+_0x358b4f[_0xb8ad('0x1e')];var _0x408c81;if(_0x526eeb>=_0x32b61b){_0x526eeb=_0x32b61b;_0x408c81=0xc8;}else{_0x408c81=0xce;}_0x352f95[_0xb8ad('0x1a')](_0x408c81);return _0x352f95[_0xb8ad('0x20')](_0xb8ad('0x21'),_0x449193+'-'+_0x526eeb+'/'+_0x32b61b)[_0xb8ad('0x22')](_0x1226c8);}return null;};}function patchUpdates(_0x492d1f){return function(_0x15a7e5){try{jsonpatch[_0xb8ad('0x23')](_0x15a7e5,_0x492d1f,!![]);}catch(_0x3d4524){return BPromise[_0xb8ad('0x24')](_0x3d4524);}return _0x15a7e5[_0xb8ad('0x25')]();};}function saveUpdates(_0x49910e,_0x2bb3e4){return function(_0x2afb32){if(_0x2afb32){return _0x2afb32['update'](_0x49910e)[_0xb8ad('0x26')](function(_0x4f1de5){return _0x4f1de5;});}return null;};}function removeEntity(_0x2646f2,_0x509288){return function(_0x5f3927){if(_0x5f3927){return _0x5f3927['destroy']()[_0xb8ad('0x26')](function(){_0x2646f2[_0xb8ad('0x1a')](0xcc)[_0xb8ad('0x1b')]();});}};}function handleEntityNotFound(_0x335d83,_0x4531c9){return function(_0x57f1a1){if(!_0x57f1a1){_0x335d83['sendStatus'](0x194);}return _0x57f1a1;};}function handleError(_0x56e29c,_0x2e2635){_0x2e2635=_0x2e2635||0x1f4;return function(_0x3377e4){logger['error'](_0x3377e4['stack']);if(_0x3377e4[_0xb8ad('0x27')]){delete _0x3377e4[_0xb8ad('0x27')];}_0x56e29c[_0xb8ad('0x1a')](_0x2e2635)[_0xb8ad('0x28')](_0x3377e4);};}exports[_0xb8ad('0x29')]=function(_0x24d526,_0x52abad){var _0xcfc673={},_0x1b9455={},_0x40cbbf={'count':0x0,'rows':[]};var _0xe33046=_['map'](db[_0xb8ad('0x2a')][_0xb8ad('0x2b')],function(_0x51b374){return{'name':_0x51b374[_0xb8ad('0x2c')],'type':_0x51b374[_0xb8ad('0x2d')][_0xb8ad('0x2e')]};});_0x1b9455[_0xb8ad('0x2f')]=_[_0xb8ad('0x30')](_0xe33046,_0xb8ad('0x27'));_0x1b9455[_0xb8ad('0x31')]=_['keys'](_0x24d526[_0xb8ad('0x31')]);_0x1b9455[_0xb8ad('0x32')]=_[_0xb8ad('0x33')](_0x1b9455[_0xb8ad('0x2f')],_0x1b9455[_0xb8ad('0x31')]);_0xcfc673[_0xb8ad('0x34')]=_[_0xb8ad('0x33')](_0x1b9455[_0xb8ad('0x2f')],qs[_0xb8ad('0x35')](_0x24d526[_0xb8ad('0x31')]['fields']));_0xcfc673[_0xb8ad('0x34')]=_0xcfc673[_0xb8ad('0x34')][_0xb8ad('0x36')]?_0xcfc673[_0xb8ad('0x34')]:_0x1b9455[_0xb8ad('0x2f')];if(!_0x24d526[_0xb8ad('0x31')]['hasOwnProperty']('nolimit')){_0xcfc673[_0xb8ad('0x1e')]=qs[_0xb8ad('0x1e')](_0x24d526[_0xb8ad('0x31')][_0xb8ad('0x1e')]);_0xcfc673[_0xb8ad('0x1c')]=qs['offset'](_0x24d526[_0xb8ad('0x31')]['offset']);}_0xcfc673[_0xb8ad('0x37')]=qs[_0xb8ad('0x38')](_0x24d526[_0xb8ad('0x31')][_0xb8ad('0x38')]);_0xcfc673[_0xb8ad('0x39')]=qs[_0xb8ad('0x32')](_[_0xb8ad('0x3a')](_0x24d526[_0xb8ad('0x31')],_0x1b9455[_0xb8ad('0x32')]),_0xe33046);if(_0x24d526[_0xb8ad('0x31')][_0xb8ad('0x3b')]){_0xcfc673[_0xb8ad('0x39')]=_[_0xb8ad('0x3c')](_0xcfc673[_0xb8ad('0x39')],{'$or':_[_0xb8ad('0x30')](_0xe33046,function(_0x3c9d0c){if(_0x3c9d0c[_0xb8ad('0x2d')]!=='VIRTUAL'){var _0xe2531={};_0xe2531[_0x3c9d0c['name']]={'$like':'%'+_0x24d526[_0xb8ad('0x31')][_0xb8ad('0x3b')]+'%'};return _0xe2531;}})});}_0xcfc673=_[_0xb8ad('0x3c')]({},_0xcfc673,_0x24d526[_0xb8ad('0x3d')]);var _0x50816b={'where':_0xcfc673['where']};return db[_0xb8ad('0x2a')][_0xb8ad('0x1f')](_0x50816b)[_0xb8ad('0x26')](function(_0x5117f9){_0x40cbbf[_0xb8ad('0x1f')]=_0x5117f9;if(_0x24d526[_0xb8ad('0x31')][_0xb8ad('0x3e')]){_0xcfc673[_0xb8ad('0x3f')]=[{'all':!![]}];}return db[_0xb8ad('0x2a')][_0xb8ad('0x40')](_0xcfc673);})[_0xb8ad('0x26')](function(_0x356884){_0x40cbbf[_0xb8ad('0x41')]=_0x356884;return _0x40cbbf;})[_0xb8ad('0x26')](respondWithFilteredResult(_0x52abad,_0xcfc673))[_0xb8ad('0x42')](handleError(_0x52abad,null));};exports[_0xb8ad('0x43')]=function(_0x46d39c,_0x1302f8){var _0x4cd02e={'raw':![],'where':{'id':_0x46d39c[_0xb8ad('0x44')]['id']}},_0x213db0={};_0x213db0['model']=_[_0xb8ad('0x45')](db['VoiceQueueReport']['rawAttributes']);_0x213db0['query']=_[_0xb8ad('0x45')](_0x46d39c[_0xb8ad('0x31')]);_0x213db0[_0xb8ad('0x32')]=_[_0xb8ad('0x33')](_0x213db0[_0xb8ad('0x2f')],_0x213db0[_0xb8ad('0x31')]);_0x4cd02e[_0xb8ad('0x34')]=_['intersection'](_0x213db0[_0xb8ad('0x2f')],qs[_0xb8ad('0x35')](_0x46d39c[_0xb8ad('0x31')][_0xb8ad('0x35')]));_0x4cd02e[_0xb8ad('0x34')]=_0x4cd02e['attributes']['length']?_0x4cd02e['attributes']:_0x213db0[_0xb8ad('0x2f')];if(_0x46d39c[_0xb8ad('0x31')]['includeAll']){_0x4cd02e[_0xb8ad('0x3f')]=[{'all':!![]}];}_0x4cd02e=_['merge']({},_0x4cd02e,_0x46d39c['options']);return db[_0xb8ad('0x2a')][_0xb8ad('0x46')](_0x4cd02e)[_0xb8ad('0x26')](handleEntityNotFound(_0x1302f8,null))[_0xb8ad('0x26')](respondWithResult(_0x1302f8,null))[_0xb8ad('0x42')](handleError(_0x1302f8,null));};exports[_0xb8ad('0x47')]=function(_0x2f26f7,_0x128294){return db['VoiceQueueReport'][_0xb8ad('0x47')](_0x2f26f7['body'],{})[_0xb8ad('0x26')](respondWithResult(_0x128294,0xc9))[_0xb8ad('0x42')](handleError(_0x128294,null));};exports['update']=function(_0x22db5f,_0x170e3d){if(_0x22db5f[_0xb8ad('0x48')]['id']){delete _0x22db5f[_0xb8ad('0x48')]['id'];}return db[_0xb8ad('0x2a')][_0xb8ad('0x46')]({'where':{'id':_0x22db5f[_0xb8ad('0x44')]['id']}})[_0xb8ad('0x26')](handleEntityNotFound(_0x170e3d,null))[_0xb8ad('0x26')](saveUpdates(_0x22db5f[_0xb8ad('0x48')],null))['then'](respondWithResult(_0x170e3d,null))[_0xb8ad('0x42')](handleError(_0x170e3d,null));};exports[_0xb8ad('0x49')]=function(_0x23fe93,_0x500f0a){return db['VoiceQueueReport']['find']({'where':{'id':_0x23fe93[_0xb8ad('0x44')]['id']}})[_0xb8ad('0x26')](handleEntityNotFound(_0x500f0a,null))[_0xb8ad('0x26')](removeEntity(_0x500f0a,null))[_0xb8ad('0x42')](handleError(_0x500f0a,null));};exports['describe']=function(_0x2243b9,_0x154028){return db[_0xb8ad('0x2a')][_0xb8ad('0x4a')]()[_0xb8ad('0x26')](respondWithResult(_0x154028,null))[_0xb8ad('0x42')](handleError(_0x154028,null));};exports[_0xb8ad('0x4b')]=function(_0x4f3c16,_0x12736b){var _0x609406={},_0x34d311={},_0x417e56={'count':0x0,'rows':[]};_0x34d311[_0xb8ad('0x2f')]=_['keys'](db[_0xb8ad('0x2a')][_0xb8ad('0x2b')]);_0x34d311[_0xb8ad('0x31')]=_['keys'](_0x4f3c16['query']);_0x34d311['filters']=_['intersection'](_0x34d311[_0xb8ad('0x2f')],_0x34d311[_0xb8ad('0x31')]);_0x609406[_0xb8ad('0x34')]=_[_0xb8ad('0x33')](_0x34d311[_0xb8ad('0x2f')],qs[_0xb8ad('0x35')](_0x4f3c16['query']['fields']));_0x609406[_0xb8ad('0x34')]=_0x609406[_0xb8ad('0x34')][_0xb8ad('0x36')]?_0x609406['attributes']:_0x34d311[_0xb8ad('0x2f')];if(!_0x4f3c16[_0xb8ad('0x31')][_0xb8ad('0x4c')]('nolimit')){_0x609406[_0xb8ad('0x1e')]=qs[_0xb8ad('0x1e')](_0x4f3c16['query'][_0xb8ad('0x1e')]);_0x609406[_0xb8ad('0x1c')]=qs[_0xb8ad('0x1c')](_0x4f3c16[_0xb8ad('0x31')][_0xb8ad('0x1c')]);}_0x609406['order']=qs[_0xb8ad('0x38')](_0x4f3c16[_0xb8ad('0x31')][_0xb8ad('0x38')]);_0x609406[_0xb8ad('0x39')]=qs[_0xb8ad('0x32')](_[_0xb8ad('0x3a')](_0x4f3c16[_0xb8ad('0x31')],_0x34d311['filters']));if(_0x4f3c16[_0xb8ad('0x31')][_0xb8ad('0x3b')]){_0x609406[_0xb8ad('0x39')]=_['merge'](_0x609406['where'],{'$or':_[_0xb8ad('0x30')](_0x609406[_0xb8ad('0x34')],function(_0x8b3f4){var _0x1e823b={};_0x1e823b[_0x8b3f4]={'$like':'%'+_0x4f3c16['query'][_0xb8ad('0x3b')]+'%'};return _0x1e823b;})});}_0x609406=_['merge']({},_0x609406,_0x4f3c16[_0xb8ad('0x3d')]);var _0x7a0520={'where':_0x609406[_0xb8ad('0x39')]};return db[_0xb8ad('0x2a')][_0xb8ad('0x1f')](_0x7a0520)['then'](function(_0x54c3ee){_0x417e56['count']=_0x54c3ee;if(_0x4f3c16['query'][_0xb8ad('0x3e')]){_0x609406[_0xb8ad('0x3f')]=[{'all':!![]}];}return db[_0xb8ad('0x2a')][_0xb8ad('0x40')](_0x609406);})[_0xb8ad('0x26')](function(_0x3b3274){_0x417e56[_0xb8ad('0x41')]=_0x3b3274;return _0x417e56;})[_0xb8ad('0x26')](respondWithFilteredResult(_0x12736b,_0x609406,'getVoiceQueuesReport'))[_0xb8ad('0x42')](handleError(_0x12736b,null,'getVoiceQueuesReport'));};
\ No newline at end of file
index b1a1fe2..72cec14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0ea=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb0ea,0x128));var _0xab0e=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xb0ea[_0x3fa37f];return _0x5a01d5;};'use strict';var EventEmitter=require(_0xab0e('0x0'));var VoiceQueueReport=require(_0xab0e('0x1'))['db'][_0xab0e('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xab0e('0x3')](0x0);var events={'afterCreate':_0xab0e('0x4'),'afterUpdate':_0xab0e('0x5'),'afterDestroy':_0xab0e('0x6')};function emitEvent(_0x2784e6){return function(_0x1a9d27,_0x419df8,_0x507e79){VoiceQueueReportEvents[_0xab0e('0x7')](_0x2784e6+':'+_0x1a9d27['id'],_0x1a9d27);VoiceQueueReportEvents[_0xab0e('0x7')](_0x2784e6,_0x1a9d27);_0x507e79(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xab0e('0x8')](e,emitEvent(event));}}module[_0xab0e('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xb8a7=['exports','events','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xfd6ab1,_0x2de93d){var _0x45b16f=function(_0x359394){while(--_0x359394){_0xfd6ab1['push'](_0xfd6ab1['shift']());}};_0x45b16f(++_0x2de93d);}(_0xb8a7,0x161));var _0x7b8a=function(_0x4b186f,_0x86dd8a){_0x4b186f=_0x4b186f-0x0;var _0x14be6d=_0xb8a7[_0x4b186f];return _0x14be6d;};'use strict';var EventEmitter=require(_0x7b8a('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x7b8a('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7b8a('0x2')](0x0);var events={'afterCreate':_0x7b8a('0x3'),'afterUpdate':_0x7b8a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45d38a){return function(_0x5427f2,_0x13fd37,_0x4224db){VoiceQueueReportEvents['emit'](_0x45d38a+':'+_0x5427f2['id'],_0x5427f2);VoiceQueueReportEvents[_0x7b8a('0x5')](_0x45d38a,_0x5427f2);_0x4224db(null);};}for(var e in events){if(events[_0x7b8a('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x7b8a('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
index 8433d51..e212a51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6247=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','define','report_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x52e901,_0x5aa4d1){var _0x21e610=function(_0x30d77c){while(--_0x30d77c){_0x52e901['push'](_0x52e901['shift']());}};_0x21e610(++_0x5aa4d1);}(_0x6247,0x19f));var _0x7624=function(_0x4de0d1,_0x1f9758){_0x4de0d1=_0x4de0d1-0x0;var _0x36aa4b=_0x6247[_0x4de0d1];return _0x36aa4b;};'use strict';var _=require(_0x7624('0x0'));var util=require(_0x7624('0x1'));var logger=require(_0x7624('0x2'))(_0x7624('0x3'));var moment=require(_0x7624('0x4'));var BPromise=require(_0x7624('0x5'));var rp=require(_0x7624('0x6'));var fs=require('fs');var path=require(_0x7624('0x7'));var rimraf=require(_0x7624('0x8'));var config=require(_0x7624('0x9'));var attributes=require(_0x7624('0xa'));module['exports']=function(_0xee88dc,_0x2613c5){return _0xee88dc[_0x7624('0xb')]('VoiceQueueReport',attributes,{'tableName':_0x7624('0xc'),'paranoid':![],'indexes':[{'fields':[_0x7624('0xd')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x595f=['lodash','api','moment','bluebird','request-promise','rimraf','./voiceQueueReport.attributes','define','uniqueid','calleridnum'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0x595f,0x1b8));var _0xf595=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x595f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf595('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf595('0x1'));var moment=require(_0xf595('0x2'));var BPromise=require(_0xf595('0x3'));var rp=require(_0xf595('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf595('0x5'));var config=require('../../config/environment');var attributes=require(_0xf595('0x6'));module['exports']=function(_0xc3571,_0x58a6b6){return _0xc3571[_0xf595('0x7')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xf595('0x8')]},{'fields':[_0xf595('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 4f04f7a..26ffecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae47=['debug','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','where','include','map','model','attributes','GetVoiceQueueReport'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xae47,0x1bc));var _0x7ae4=function(_0x3cce24,_0xa49279){_0x3cce24=_0x3cce24-0x0;var _0x2ff0df=_0xae47[_0x3cce24];return _0x2ff0df;};'use strict';var _=require(_0x7ae4('0x0'));var util=require(_0x7ae4('0x1'));var moment=require(_0x7ae4('0x2'));var BPromise=require(_0x7ae4('0x3'));var rs=require(_0x7ae4('0x4'));var fs=require('fs');var Redis=require(_0x7ae4('0x5'));var db=require(_0x7ae4('0x6'))['db'];var utils=require(_0x7ae4('0x7'));var logger=require(_0x7ae4('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7ae4('0x9')][_0x7ae4('0xa')]({'port':0x232a});config[_0x7ae4('0xb')]=_[_0x7ae4('0xc')](config['redis'],{'host':_0x7ae4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ae4('0xb')]));require('./voiceQueueReport.socket')[_0x7ae4('0xe')](socket);function respondWithRpcPromise(_0x44e36a,_0x134cd4,_0x42062e){return new BPromise(function(_0x1ab3f8,_0x8230bd){return client['request'](_0x44e36a,_0x42062e)[_0x7ae4('0xf')](function(_0x2208a4){logger[_0x7ae4('0x10')](_0x7ae4('0x11'),_0x134cd4,_0x7ae4('0x12'));logger['debug'](_0x7ae4('0x13'),_0x134cd4,_0x7ae4('0x12'),JSON[_0x7ae4('0x14')](_0x2208a4));if(_0x2208a4[_0x7ae4('0x15')]){if(_0x2208a4[_0x7ae4('0x15')][_0x7ae4('0x16')]===0x1f4){logger[_0x7ae4('0x15')](_0x7ae4('0x11'),_0x134cd4,_0x2208a4[_0x7ae4('0x15')][_0x7ae4('0x17')]);return _0x8230bd(_0x2208a4[_0x7ae4('0x15')][_0x7ae4('0x17')]);}logger['error'](_0x7ae4('0x11'),_0x134cd4,_0x2208a4[_0x7ae4('0x15')]['message']);return _0x1ab3f8(_0x2208a4[_0x7ae4('0x15')][_0x7ae4('0x17')]);}else{logger[_0x7ae4('0x10')](_0x7ae4('0x11'),_0x134cd4,_0x7ae4('0x12'));_0x1ab3f8(_0x2208a4[_0x7ae4('0x18')][_0x7ae4('0x17')]);}})[_0x7ae4('0x19')](function(_0x237b66){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x134cd4,_0x237b66);_0x8230bd(_0x237b66);});});}exports['GetVoiceQueueReport']=function(_0x576ab6){var _0x447ce4=this;return new Promise(function(_0x237b30,_0x5a4a27){return db[_0x7ae4('0x1a')][_0x7ae4('0x1b')]({'raw':_0x576ab6[_0x7ae4('0x1c')]?_0x576ab6[_0x7ae4('0x1c')][_0x7ae4('0x1d')]===undefined?!![]:![]:!![],'where':_0x576ab6[_0x7ae4('0x1c')]?_0x576ab6[_0x7ae4('0x1c')][_0x7ae4('0x1e')]||null:null,'attributes':_0x576ab6['options']?_0x576ab6[_0x7ae4('0x1c')]['attributes']||null:null,'limit':_0x576ab6[_0x7ae4('0x1c')]?_0x576ab6[_0x7ae4('0x1c')]['limit']||null:null,'include':_0x576ab6[_0x7ae4('0x1c')]?_0x576ab6[_0x7ae4('0x1c')][_0x7ae4('0x1f')]?_[_0x7ae4('0x20')](_0x576ab6[_0x7ae4('0x1c')][_0x7ae4('0x1f')],function(_0x48a326){return{'model':db[_0x48a326[_0x7ae4('0x21')]],'as':_0x48a326['as'],'attributes':_0x48a326['attributes'],'include':_0x48a326['include']?_[_0x7ae4('0x20')](_0x48a326[_0x7ae4('0x1f')],function(_0x4a2956){return{'model':db[_0x4a2956[_0x7ae4('0x21')]],'as':_0x4a2956['as'],'attributes':_0x4a2956[_0x7ae4('0x22')],'include':_0x4a2956[_0x7ae4('0x1f')]?_[_0x7ae4('0x20')](_0x4a2956[_0x7ae4('0x1f')],function(_0x1f7ccb){return{'model':db[_0x1f7ccb[_0x7ae4('0x21')]],'as':_0x1f7ccb['as'],'attributes':_0x1f7ccb[_0x7ae4('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x381530){logger[_0x7ae4('0x10')](_0x7ae4('0x23'),_0x576ab6);logger[_0x7ae4('0x24')]('GetVoiceQueueReport',_0x576ab6,JSON[_0x7ae4('0x14')](_0x381530));_0x237b30(_0x381530);})[_0x7ae4('0x19')](function(_0x482bed){logger['error'](_0x7ae4('0x23'),_0x482bed[_0x7ae4('0x17')],_0x576ab6);_0x5a4a27(_0x447ce4[_0x7ae4('0x15')](0x1f4,_0x482bed[_0x7ae4('0x17')]));});});};exports[_0x7ae4('0x25')]=function(_0x45fb71){var _0x12e8f2=this;return new Promise(function(_0x3242ab,_0x43ca95){return db[_0x7ae4('0x1a')]['create'](_0x45fb71[_0x7ae4('0x26')],{'raw':_0x45fb71[_0x7ae4('0x1c')]?_0x45fb71[_0x7ae4('0x1c')][_0x7ae4('0x1d')]===undefined?!![]:![]:!![]})[_0x7ae4('0xf')](function(_0x108507){logger[_0x7ae4('0x10')](_0x7ae4('0x25'),_0x45fb71);logger['debug'](_0x7ae4('0x25'),_0x45fb71,JSON[_0x7ae4('0x14')](_0x108507));_0x3242ab(_0x108507);})[_0x7ae4('0x19')](function(_0x2abea2){logger[_0x7ae4('0x15')](_0x7ae4('0x25'),_0x2abea2[_0x7ae4('0x17')],_0x45fb71);_0x43ca95(_0x12e8f2[_0x7ae4('0x15')](0x1f4,_0x2abea2['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x29b503){var _0x565742=this;return new Promise(function(_0x583a7b,_0x40d08f){return db['VoiceQueueReport']['update'](_0x29b503[_0x7ae4('0x26')],{'raw':_0x29b503[_0x7ae4('0x1c')]?_0x29b503[_0x7ae4('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29b503['options']?_0x29b503[_0x7ae4('0x1c')][_0x7ae4('0x1e')]||null:null,'attributes':_0x29b503[_0x7ae4('0x1c')]?_0x29b503[_0x7ae4('0x1c')][_0x7ae4('0x22')]||null:null,'limit':_0x29b503[_0x7ae4('0x1c')]?_0x29b503['options']['limit']||null:null})['then'](function(_0x423bd8){logger[_0x7ae4('0x10')](_0x7ae4('0x27'),_0x29b503);logger[_0x7ae4('0x24')]('UpdateVoiceQueueReport',_0x29b503,JSON[_0x7ae4('0x14')](_0x423bd8));_0x583a7b(_0x423bd8);})[_0x7ae4('0x19')](function(_0x7af8bb){logger[_0x7ae4('0x15')]('UpdateVoiceQueueReport',_0x7af8bb['message'],_0x29b503);_0x40d08f(_0x565742[_0x7ae4('0x15')](0x1f4,_0x7af8bb[_0x7ae4('0x17')]));});});};
\ No newline at end of file
+var _0x85cd=['catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','stringify','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1dbfdb,_0x41d120){var _0x5d50b4=function(_0x5ee2f5){while(--_0x5ee2f5){_0x1dbfdb['push'](_0x1dbfdb['shift']());}};_0x5d50b4(++_0x41d120);}(_0x85cd,0xa7));var _0xd85c=function(_0x9af00d,_0xa7d573){_0x9af00d=_0x9af00d-0x0;var _0x43ceec=_0x85cd[_0x9af00d];return _0x43ceec;};'use strict';var _=require(_0xd85c('0x0'));var util=require(_0xd85c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd85c('0x2'));var fs=require('fs');var Redis=require(_0xd85c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd85c('0x4'));var logger=require(_0xd85c('0x5'))(_0xd85c('0x6'));var config=require('../../config/environment');var jayson=require(_0xd85c('0x7'));var client=jayson[_0xd85c('0x8')]['http']({'port':0x232a});config[_0xd85c('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x2b9e10,_0x4d5e2e,_0x2eb5d1){return new BPromise(function(_0x25aba6,_0x2d6e6f){return client[_0xd85c('0xa')](_0x2b9e10,_0x2eb5d1)[_0xd85c('0xb')](function(_0x1825bf){logger['info'](_0xd85c('0xc'),_0x4d5e2e,_0xd85c('0xd'));logger['debug'](_0xd85c('0xe'),_0x4d5e2e,'request\x20sent',JSON['stringify'](_0x1825bf));if(_0x1825bf[_0xd85c('0xf')]){if(_0x1825bf[_0xd85c('0xf')][_0xd85c('0x10')]===0x1f4){logger[_0xd85c('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x4d5e2e,_0x1825bf['error'][_0xd85c('0x11')]);return _0x2d6e6f(_0x1825bf['error']['message']);}logger[_0xd85c('0xf')](_0xd85c('0xc'),_0x4d5e2e,_0x1825bf[_0xd85c('0xf')][_0xd85c('0x11')]);return _0x25aba6(_0x1825bf[_0xd85c('0xf')][_0xd85c('0x11')]);}else{logger['info'](_0xd85c('0xc'),_0x4d5e2e,_0xd85c('0xd'));_0x25aba6(_0x1825bf['result'][_0xd85c('0x11')]);}})[_0xd85c('0x12')](function(_0x2e90df){logger[_0xd85c('0xf')](_0xd85c('0xc'),_0x4d5e2e,_0x2e90df);_0x2d6e6f(_0x2e90df);});});}exports[_0xd85c('0x13')]=function(_0x41bac8){var _0x576188=this;return new Promise(function(_0x482859,_0x2bc193){return db['VoiceQueueReport'][_0xd85c('0x14')]({'raw':_0x41bac8[_0xd85c('0x15')]?_0x41bac8[_0xd85c('0x15')][_0xd85c('0x16')]===undefined?!![]:![]:!![],'where':_0x41bac8[_0xd85c('0x15')]?_0x41bac8[_0xd85c('0x15')][_0xd85c('0x17')]||null:null,'attributes':_0x41bac8['options']?_0x41bac8['options'][_0xd85c('0x18')]||null:null,'limit':_0x41bac8[_0xd85c('0x15')]?_0x41bac8['options'][_0xd85c('0x19')]||null:null,'include':_0x41bac8[_0xd85c('0x15')]?_0x41bac8[_0xd85c('0x15')][_0xd85c('0x1a')]?_[_0xd85c('0x1b')](_0x41bac8[_0xd85c('0x15')]['include'],function(_0x4c5939){return{'model':db[_0x4c5939[_0xd85c('0x1c')]],'as':_0x4c5939['as'],'attributes':_0x4c5939[_0xd85c('0x18')],'include':_0x4c5939[_0xd85c('0x1a')]?_[_0xd85c('0x1b')](_0x4c5939[_0xd85c('0x1a')],function(_0x154ddf){return{'model':db[_0x154ddf['model']],'as':_0x154ddf['as'],'attributes':_0x154ddf[_0xd85c('0x18')],'include':_0x154ddf['include']?_[_0xd85c('0x1b')](_0x154ddf[_0xd85c('0x1a')],function(_0x25058){return{'model':db[_0x25058[_0xd85c('0x1c')]],'as':_0x25058['as'],'attributes':_0x25058[_0xd85c('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd85c('0xb')](function(_0x320849){logger[_0xd85c('0x1d')]('GetVoiceQueueReport',_0x41bac8);logger[_0xd85c('0x1e')]('GetVoiceQueueReport',_0x41bac8,JSON[_0xd85c('0x1f')](_0x320849));_0x482859(_0x320849);})['catch'](function(_0x447c30){logger['error'](_0xd85c('0x13'),_0x447c30[_0xd85c('0x11')],_0x41bac8);_0x2bc193(_0x576188[_0xd85c('0xf')](0x1f4,_0x447c30[_0xd85c('0x11')]));});});};exports[_0xd85c('0x20')]=function(_0xda8ab2){var _0x390522=this;return new Promise(function(_0x1e9183,_0x2a7d27){return db[_0xd85c('0x21')][_0xd85c('0x22')](_0xda8ab2[_0xd85c('0x23')],{'raw':_0xda8ab2[_0xd85c('0x15')]?_0xda8ab2[_0xd85c('0x15')][_0xd85c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0xe612bd){logger[_0xd85c('0x1d')](_0xd85c('0x20'),_0xda8ab2);logger['debug'](_0xd85c('0x20'),_0xda8ab2,JSON[_0xd85c('0x1f')](_0xe612bd));_0x1e9183(_0xe612bd);})['catch'](function(_0x3477f4){logger[_0xd85c('0xf')](_0xd85c('0x20'),_0x3477f4[_0xd85c('0x11')],_0xda8ab2);_0x2a7d27(_0x390522[_0xd85c('0xf')](0x1f4,_0x3477f4['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x5e2a04){var _0xa13db4=this;return new Promise(function(_0x67864,_0x52d030){return db[_0xd85c('0x21')]['update'](_0x5e2a04['body'],{'raw':_0x5e2a04[_0xd85c('0x15')]?_0x5e2a04[_0xd85c('0x15')][_0xd85c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e2a04[_0xd85c('0x15')]?_0x5e2a04[_0xd85c('0x15')][_0xd85c('0x17')]||null:null,'attributes':_0x5e2a04[_0xd85c('0x15')]?_0x5e2a04[_0xd85c('0x15')][_0xd85c('0x18')]||null:null,'limit':_0x5e2a04[_0xd85c('0x15')]?_0x5e2a04[_0xd85c('0x15')][_0xd85c('0x19')]||null:null})['then'](function(_0x54dad2){logger['info'](_0xd85c('0x24'),_0x5e2a04);logger[_0xd85c('0x1e')](_0xd85c('0x24'),_0x5e2a04,JSON['stringify'](_0x54dad2));_0x67864(_0x54dad2);})[_0xd85c('0x12')](function(_0x308fec){logger['error']('UpdateVoiceQueueReport',_0x308fec[_0xd85c('0x11')],_0x5e2a04);_0x52d030(_0xa13db4[_0xd85c('0xf')](0x1f4,_0x308fec[_0xd85c('0x11')]));});});};
\ No newline at end of file
index cb5761a..52c7149 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a93=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','removeListener','register'];(function(_0x15ce39,_0x56772e){var _0x4c72ce=function(_0xd4996d){while(--_0xd4996d){_0x15ce39['push'](_0x15ce39['shift']());}};_0x4c72ce(++_0x56772e);}(_0x6a93,0x1d7));var _0x36a9=function(_0x39b7a3,_0x35063b){_0x39b7a3=_0x39b7a3-0x0;var _0x48a4a9=_0x6a93[_0x39b7a3];return _0x48a4a9;};'use strict';var VoiceQueueReportEvents=require(_0x36a9('0x0'));var events=[_0x36a9('0x1'),_0x36a9('0x2'),'update'];function createListener(_0x508291,_0x3d1196){return function(_0x209444){_0x3d1196['emit'](_0x508291,_0x209444);};}function removeListener(_0x2deb45,_0x2127e0){return function(){VoiceQueueReportEvents[_0x36a9('0x3')](_0x2deb45,_0x2127e0);};}exports[_0x36a9('0x4')]=function(_0x2c1be3){for(var _0x6de7d=0x0,_0x258db9=events[_0x36a9('0x5')];_0x6de7d<_0x258db9;_0x6de7d++){var _0x156951=events[_0x6de7d];var _0x444d75=createListener(_0x36a9('0x6')+_0x156951,_0x2c1be3);VoiceQueueReportEvents['on'](_0x156951,_0x444d75);}};
\ No newline at end of file
+var _0x3cd8=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x651909,_0x15c6b4){var _0x572299=function(_0x5e8a48){while(--_0x5e8a48){_0x651909['push'](_0x651909['shift']());}};_0x572299(++_0x15c6b4);}(_0x3cd8,0x150));var _0x83cd=function(_0x569caa,_0x5174ce){_0x569caa=_0x569caa-0x0;var _0x44cb5a=_0x3cd8[_0x569caa];return _0x44cb5a;};'use strict';var VoiceQueueReportEvents=require(_0x83cd('0x0'));var events=[_0x83cd('0x1'),_0x83cd('0x2'),_0x83cd('0x3')];function createListener(_0x239e59,_0x227d23){return function(_0x29d99d){_0x227d23[_0x83cd('0x4')](_0x239e59,_0x29d99d);};}function removeListener(_0x51b758,_0x42a80b){return function(){VoiceQueueReportEvents[_0x83cd('0x5')](_0x51b758,_0x42a80b);};}exports[_0x83cd('0x6')]=function(_0x2d20d8){for(var _0x340fa9=0x0,_0xb6ca3a=events[_0x83cd('0x7')];_0x340fa9<_0xb6ca3a;_0x340fa9++){var _0x309a7a=events[_0x340fa9];var _0x1bd528=createListener(_0x83cd('0x8')+_0x309a7a,_0x2d20d8);VoiceQueueReportEvents['on'](_0x309a7a,_0x1bd528);}};
\ No newline at end of file
index 78fce6e..43250c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33d8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','update','destroy','exports','util','path'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x33d8,0x1a7));var _0x833d=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x33d8[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require('multer');var util=require(_0x833d('0x0'));var path=require(_0x833d('0x1'));var timeout=require(_0x833d('0x2'));var express=require(_0x833d('0x3'));var router=express[_0x833d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x833d('0x5'));var interaction=require(_0x833d('0x6'));var config=require('../../config/environment');var controller=require(_0x833d('0x7'));router[_0x833d('0x8')]('/',auth[_0x833d('0x9')](),controller[_0x833d('0xa')]);router[_0x833d('0x8')](_0x833d('0xb'),auth[_0x833d('0x9')](),controller[_0x833d('0xc')]);router[_0x833d('0xd')]('/',auth[_0x833d('0x9')](),controller['create']);router['put'](_0x833d('0xb'),auth[_0x833d('0x9')](),controller[_0x833d('0xe')]);router['delete'](_0x833d('0xb'),auth[_0x833d('0x9')](),controller[_0x833d('0xf')]);module[_0x833d('0x10')]=router;
\ No newline at end of file
+var _0xef62=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','put','update','destroy','exports'];(function(_0x1959ca,_0x5a40b0){var _0xf8830a=function(_0x23ccea){while(--_0x23ccea){_0x1959ca['push'](_0x1959ca['shift']());}};_0xf8830a(++_0x5a40b0);}(_0xef62,0xee));var _0x2ef6=function(_0x4dcf4d,_0x267157){_0x4dcf4d=_0x4dcf4d-0x0;var _0xf8fde7=_0xef62[_0x4dcf4d];return _0xf8fde7;};'use strict';var multer=require(_0x2ef6('0x0'));var util=require('util');var path=require(_0x2ef6('0x1'));var timeout=require(_0x2ef6('0x2'));var express=require(_0x2ef6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2ef6('0x4'));var interaction=require(_0x2ef6('0x5'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0x2ef6('0x6')]('/',auth['isAuthenticated'](),controller[_0x2ef6('0x7')]);router['get']('/:id',auth[_0x2ef6('0x8')](),controller[_0x2ef6('0x9')]);router['post']('/',auth[_0x2ef6('0x8')](),controller['create']);router[_0x2ef6('0xa')]('/:id',auth[_0x2ef6('0x8')](),controller[_0x2ef6('0xb')]);router['delete']('/:id',auth[_0x2ef6('0x8')](),controller[_0x2ef6('0xc')]);module[_0x2ef6('0xd')]=router;
\ No newline at end of file
index a11df6b..5c638b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x961e=['sequelize','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2161d9,_0x854ce0){var _0x46052f=function(_0x2bb436){while(--_0x2bb436){_0x2161d9['push'](_0x2161d9['shift']());}};_0x46052f(++_0x854ce0);}(_0x961e,0xd2));var _0xe961=function(_0x374bda,_0x4ff16b){_0x374bda=_0x374bda-0x0;var _0x49124f=_0x961e[_0x374bda];return _0x49124f;};'use strict';var Sequelize=require(_0xe961('0x0'));var moment=require(_0xe961('0x1'));module[_0xe961('0x2')]={'time':{'type':Sequelize[_0xe961('0x3')]},'callid':{'type':Sequelize[_0xe961('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe961('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe961('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe961('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe961('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe961('0x4')],'allowNull':![],'defaultValue':moment()[_0xe961('0x5')](_0xe961('0x6'))}};
\ No newline at end of file
+var _0xbf3c=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','DATE','format'];(function(_0x281d23,_0x20d215){var _0x6b91db=function(_0x3205c4){while(--_0x3205c4){_0x281d23['push'](_0x281d23['shift']());}};_0x6b91db(++_0x20d215);}(_0xbf3c,0x163));var _0xcbf3=function(_0x4509d1,_0x32d668){_0x4509d1=_0x4509d1-0x0;var _0x821a23=_0xbf3c[_0x4509d1];return _0x821a23;};'use strict';var Sequelize=require(_0xcbf3('0x0'));var moment=require('moment');module[_0xcbf3('0x1')]={'time':{'type':Sequelize[_0xcbf3('0x2')]},'callid':{'type':Sequelize[_0xcbf3('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xcbf3('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xcbf3('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xcbf3('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xcbf3('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xcbf3('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xcbf3('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xcbf3('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xcbf3('0x3')],'allowNull':![],'defaultValue':moment()[_0xcbf3('0x4')](_0xcbf3('0x5'))}};
\ No newline at end of file
index 44f2dd9..4b26c64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a09=['count','limit','set','json','apply','reject','save','update','then','destroy','error','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','body','catch','find','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a09,0x196));var _0x90a0=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0x0a09[_0x2c27ed];return _0x597bd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90a0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90a0('0x1'));var rp=require(_0x90a0('0x2'));var moment=require('moment');var BPromise=require(_0x90a0('0x3'));var Mustache=require(_0x90a0('0x4'));var util=require('util');var path=require(_0x90a0('0x5'));var sox=require(_0x90a0('0x6'));var csv=require(_0x90a0('0x7'));var ejs=require(_0x90a0('0x8'));var fs=require('fs');var fs_extra=require(_0x90a0('0x9'));var _=require('lodash');var squel=require(_0x90a0('0xa'));var crypto=require(_0x90a0('0xb'));var jsforce=require(_0x90a0('0xc'));var deskjs=require(_0x90a0('0xd'));var toCsv=require(_0x90a0('0x7'));var querystring=require(_0x90a0('0xe'));var Papa=require(_0x90a0('0xf'));var Redis=require('ioredis');var authService=require(_0x90a0('0x10'));var qs=require(_0x90a0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x90a0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x90a0('0x13'));var db=require(_0x90a0('0x14'))['db'];function respondWithStatusCode(_0x299b99,_0x428ce7){_0x428ce7=_0x428ce7||0xcc;return function(_0x33c366){if(_0x33c366){return _0x299b99[_0x90a0('0x15')](_0x428ce7);}return _0x299b99[_0x90a0('0x16')](_0x428ce7)[_0x90a0('0x17')]();};}function respondWithResult(_0x1caad4,_0x707df7){_0x707df7=_0x707df7||0xc8;return function(_0x5689f4){if(_0x5689f4){return _0x1caad4[_0x90a0('0x16')](_0x707df7)['json'](_0x5689f4);}};}function respondWithFilteredResult(_0x1736fd,_0x1c6a64){return function(_0x1e6d9d){if(_0x1e6d9d){var _0x1f4d57=typeof _0x1c6a64[_0x90a0('0x18')]===_0x90a0('0x19')&&typeof _0x1c6a64['limit']==='undefined';var _0x190e09=_0x1e6d9d[_0x90a0('0x1a')];var _0x481177=_0x1f4d57?0x0:_0x1c6a64[_0x90a0('0x18')];var _0x1478f3=_0x1f4d57?_0x1e6d9d[_0x90a0('0x1a')]:_0x1c6a64[_0x90a0('0x18')]+_0x1c6a64[_0x90a0('0x1b')];var _0xda6726;if(_0x1478f3>=_0x190e09){_0x1478f3=_0x190e09;_0xda6726=0xc8;}else{_0xda6726=0xce;}_0x1736fd['status'](_0xda6726);return _0x1736fd[_0x90a0('0x1c')]('Content-Range',_0x481177+'-'+_0x1478f3+'/'+_0x190e09)[_0x90a0('0x1d')](_0x1e6d9d);}return null;};}function patchUpdates(_0x3413d6){return function(_0x2697ca){try{jsonpatch[_0x90a0('0x1e')](_0x2697ca,_0x3413d6,!![]);}catch(_0x5cc83f){return BPromise[_0x90a0('0x1f')](_0x5cc83f);}return _0x2697ca[_0x90a0('0x20')]();};}function saveUpdates(_0x3837ab,_0x1f5ca3){return function(_0x51704b){if(_0x51704b){return _0x51704b[_0x90a0('0x21')](_0x3837ab)[_0x90a0('0x22')](function(_0x45d48b){return _0x45d48b;});}return null;};}function removeEntity(_0xe90e28,_0x1a9045){return function(_0x3bc549){if(_0x3bc549){return _0x3bc549[_0x90a0('0x23')]()[_0x90a0('0x22')](function(){_0xe90e28[_0x90a0('0x16')](0xcc)[_0x90a0('0x17')]();});}};}function handleEntityNotFound(_0x14e43d,_0xdf4eb5){return function(_0x450139){if(!_0x450139){_0x14e43d[_0x90a0('0x15')](0x194);}return _0x450139;};}function handleError(_0x117f1a,_0x50879a){_0x50879a=_0x50879a||0x1f4;return function(_0x18de86){logger[_0x90a0('0x24')](_0x18de86['stack']);if(_0x18de86[_0x90a0('0x25')]){delete _0x18de86[_0x90a0('0x25')];}_0x117f1a[_0x90a0('0x16')](_0x50879a)['send'](_0x18de86);};}exports[_0x90a0('0x26')]=function(_0x28b857,_0x103c1f){var _0x37b3cf={},_0x94b32e={},_0x17983e={'count':0x0,'rows':[]};var _0x1a9f52=_[_0x90a0('0x27')](db[_0x90a0('0x28')][_0x90a0('0x29')],function(_0x5deffb){return{'name':_0x5deffb[_0x90a0('0x2a')],'type':_0x5deffb[_0x90a0('0x2b')]['key']};});_0x94b32e[_0x90a0('0x2c')]=_['map'](_0x1a9f52,_0x90a0('0x25'));_0x94b32e[_0x90a0('0x2d')]=_[_0x90a0('0x2e')](_0x28b857['query']);_0x94b32e[_0x90a0('0x2f')]=_[_0x90a0('0x30')](_0x94b32e[_0x90a0('0x2c')],_0x94b32e[_0x90a0('0x2d')]);_0x37b3cf['attributes']=_[_0x90a0('0x30')](_0x94b32e[_0x90a0('0x2c')],qs[_0x90a0('0x31')](_0x28b857[_0x90a0('0x2d')][_0x90a0('0x31')]));_0x37b3cf[_0x90a0('0x32')]=_0x37b3cf[_0x90a0('0x32')]['length']?_0x37b3cf[_0x90a0('0x32')]:_0x94b32e[_0x90a0('0x2c')];if(!_0x28b857[_0x90a0('0x2d')][_0x90a0('0x33')](_0x90a0('0x34'))){_0x37b3cf[_0x90a0('0x1b')]=qs[_0x90a0('0x1b')](_0x28b857[_0x90a0('0x2d')][_0x90a0('0x1b')]);_0x37b3cf[_0x90a0('0x18')]=qs[_0x90a0('0x18')](_0x28b857[_0x90a0('0x2d')][_0x90a0('0x18')]);}_0x37b3cf[_0x90a0('0x35')]=qs[_0x90a0('0x36')](_0x28b857['query'][_0x90a0('0x36')]);_0x37b3cf[_0x90a0('0x37')]=qs[_0x90a0('0x2f')](_[_0x90a0('0x38')](_0x28b857[_0x90a0('0x2d')],_0x94b32e['filters']),_0x1a9f52);if(_0x28b857['query'][_0x90a0('0x39')]){_0x37b3cf[_0x90a0('0x37')]=_[_0x90a0('0x3a')](_0x37b3cf[_0x90a0('0x37')],{'$or':_[_0x90a0('0x27')](_0x1a9f52,function(_0x997f24){if(_0x997f24[_0x90a0('0x2b')]!==_0x90a0('0x3b')){var _0x389723={};_0x389723[_0x997f24['name']]={'$like':'%'+_0x28b857[_0x90a0('0x2d')][_0x90a0('0x39')]+'%'};return _0x389723;}})});}_0x37b3cf=_['merge']({},_0x37b3cf,_0x28b857[_0x90a0('0x3c')]);var _0x383200={'where':_0x37b3cf[_0x90a0('0x37')]};return db[_0x90a0('0x28')]['count'](_0x383200)['then'](function(_0x45084e){_0x17983e['count']=_0x45084e;if(_0x28b857[_0x90a0('0x2d')][_0x90a0('0x3d')]){_0x37b3cf[_0x90a0('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x90a0('0x3f')](_0x37b3cf);})['then'](function(_0x2aa267){_0x17983e[_0x90a0('0x40')]=_0x2aa267;return _0x17983e;})[_0x90a0('0x22')](respondWithFilteredResult(_0x103c1f,_0x37b3cf))['catch'](handleError(_0x103c1f,null));};exports[_0x90a0('0x41')]=function(_0x5b5c49,_0x449d33){var _0x11fe80={'raw':!![],'where':{'id':_0x5b5c49[_0x90a0('0x42')]['id']}},_0xdd6db5={};_0xdd6db5['model']=_[_0x90a0('0x2e')](db[_0x90a0('0x28')][_0x90a0('0x29')]);_0xdd6db5[_0x90a0('0x2d')]=_[_0x90a0('0x2e')](_0x5b5c49[_0x90a0('0x2d')]);_0xdd6db5[_0x90a0('0x2f')]=_[_0x90a0('0x30')](_0xdd6db5['model'],_0xdd6db5[_0x90a0('0x2d')]);_0x11fe80[_0x90a0('0x32')]=_[_0x90a0('0x30')](_0xdd6db5[_0x90a0('0x2c')],qs[_0x90a0('0x31')](_0x5b5c49[_0x90a0('0x2d')][_0x90a0('0x31')]));_0x11fe80[_0x90a0('0x32')]=_0x11fe80['attributes'][_0x90a0('0x43')]?_0x11fe80[_0x90a0('0x32')]:_0xdd6db5['model'];if(_0x5b5c49[_0x90a0('0x2d')]['includeAll']){_0x11fe80['include']=[{'all':!![]}];}_0x11fe80=_[_0x90a0('0x3a')]({},_0x11fe80,_0x5b5c49[_0x90a0('0x3c')]);return db[_0x90a0('0x28')]['find'](_0x11fe80)[_0x90a0('0x22')](handleEntityNotFound(_0x449d33,null))[_0x90a0('0x22')](respondWithResult(_0x449d33,null))['catch'](handleError(_0x449d33,null));};exports['create']=function(_0x298323,_0x429384){return db[_0x90a0('0x28')][_0x90a0('0x44')](_0x298323[_0x90a0('0x45')],{})[_0x90a0('0x22')](respondWithResult(_0x429384,0xc9))[_0x90a0('0x46')](handleError(_0x429384,null));};exports[_0x90a0('0x21')]=function(_0x39e1ac,_0x15b83c){if(_0x39e1ac[_0x90a0('0x45')]['id']){delete _0x39e1ac[_0x90a0('0x45')]['id'];}return db[_0x90a0('0x28')][_0x90a0('0x47')]({'where':{'id':_0x39e1ac[_0x90a0('0x42')]['id']}})[_0x90a0('0x22')](handleEntityNotFound(_0x15b83c,null))[_0x90a0('0x22')](saveUpdates(_0x39e1ac[_0x90a0('0x45')],null))[_0x90a0('0x22')](respondWithResult(_0x15b83c,null))[_0x90a0('0x46')](handleError(_0x15b83c,null));};exports[_0x90a0('0x23')]=function(_0x229212,_0x3fc408){return db[_0x90a0('0x28')][_0x90a0('0x47')]({'where':{'id':_0x229212['params']['id']}})['then'](handleEntityNotFound(_0x3fc408,null))[_0x90a0('0x22')](removeEntity(_0x3fc408,null))[_0x90a0('0x46')](handleError(_0x3fc408,null));};
\ No newline at end of file
+var _0x1173=['hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','includeAll','include','findAll','rows','show','params','length','find','body','catch','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2a280d,_0x223ecc){var _0x2e1d02=function(_0x58121a){while(--_0x58121a){_0x2a280d['push'](_0x2a280d['shift']());}};_0x2e1d02(++_0x223ecc);}(_0x1173,0xa4));var _0x3117=function(_0x364390,_0x46b408){_0x364390=_0x364390-0x0;var _0x3cf60d=_0x1173[_0x364390];return _0x3cf60d;};'use strict';var emlformat=require(_0x3117('0x0'));var rimraf=require(_0x3117('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3117('0x2'));var rp=require(_0x3117('0x3'));var moment=require('moment');var BPromise=require(_0x3117('0x4'));var Mustache=require(_0x3117('0x5'));var util=require(_0x3117('0x6'));var path=require(_0x3117('0x7'));var sox=require(_0x3117('0x8'));var csv=require(_0x3117('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3117('0xa'));var _=require(_0x3117('0xb'));var squel=require(_0x3117('0xc'));var crypto=require(_0x3117('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3117('0x9'));var querystring=require(_0x3117('0xe'));var Papa=require(_0x3117('0xf'));var Redis=require(_0x3117('0x10'));var authService=require(_0x3117('0x11'));var qs=require(_0x3117('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3117('0x13'));var logger=require(_0x3117('0x14'))(_0x3117('0x15'));var utils=require('../../config/utils');var config=require(_0x3117('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3117('0x17'))['db'];function respondWithStatusCode(_0x806f49,_0x36a197){_0x36a197=_0x36a197||0xcc;return function(_0x4f4981){if(_0x4f4981){return _0x806f49[_0x3117('0x18')](_0x36a197);}return _0x806f49[_0x3117('0x19')](_0x36a197)[_0x3117('0x1a')]();};}function respondWithResult(_0x2d8d01,_0xb37a4){_0xb37a4=_0xb37a4||0xc8;return function(_0x35ad08){if(_0x35ad08){return _0x2d8d01['status'](_0xb37a4)[_0x3117('0x1b')](_0x35ad08);}};}function respondWithFilteredResult(_0x277975,_0x2c10bc){return function(_0x2ceb3e){if(_0x2ceb3e){var _0x5ad1ae=typeof _0x2c10bc[_0x3117('0x1c')]===_0x3117('0x1d')&&typeof _0x2c10bc[_0x3117('0x1e')]===_0x3117('0x1d');var _0x19bdc5=_0x2ceb3e[_0x3117('0x1f')];var _0x3a34e7=_0x5ad1ae?0x0:_0x2c10bc[_0x3117('0x1c')];var _0x2d9705=_0x5ad1ae?_0x2ceb3e[_0x3117('0x1f')]:_0x2c10bc[_0x3117('0x1c')]+_0x2c10bc[_0x3117('0x1e')];var _0x1b1a56;if(_0x2d9705>=_0x19bdc5){_0x2d9705=_0x19bdc5;_0x1b1a56=0xc8;}else{_0x1b1a56=0xce;}_0x277975['status'](_0x1b1a56);return _0x277975['set']('Content-Range',_0x3a34e7+'-'+_0x2d9705+'/'+_0x19bdc5)[_0x3117('0x1b')](_0x2ceb3e);}return null;};}function patchUpdates(_0x19c681){return function(_0x1f8049){try{jsonpatch['apply'](_0x1f8049,_0x19c681,!![]);}catch(_0x5ddc9a){return BPromise[_0x3117('0x20')](_0x5ddc9a);}return _0x1f8049[_0x3117('0x21')]();};}function saveUpdates(_0x35c305,_0x726e2e){return function(_0x1713c0){if(_0x1713c0){return _0x1713c0[_0x3117('0x22')](_0x35c305)['then'](function(_0x5b920f){return _0x5b920f;});}return null;};}function removeEntity(_0x1cf7e2,_0x3206f2){return function(_0x4d815e){if(_0x4d815e){return _0x4d815e['destroy']()[_0x3117('0x23')](function(){_0x1cf7e2[_0x3117('0x19')](0xcc)[_0x3117('0x1a')]();});}};}function handleEntityNotFound(_0x1e87b9,_0xfeab5c){return function(_0x4461ee){if(!_0x4461ee){_0x1e87b9[_0x3117('0x18')](0x194);}return _0x4461ee;};}function handleError(_0x22f902,_0x205edf){_0x205edf=_0x205edf||0x1f4;return function(_0x39b04e){logger[_0x3117('0x24')](_0x39b04e[_0x3117('0x25')]);if(_0x39b04e[_0x3117('0x26')]){delete _0x39b04e[_0x3117('0x26')];}_0x22f902[_0x3117('0x19')](_0x205edf)[_0x3117('0x27')](_0x39b04e);};}exports['index']=function(_0x515094,_0x11f7d4){var _0x44d6d3={},_0x37275e={},_0x5d1da7={'count':0x0,'rows':[]};var _0xc35b50=_[_0x3117('0x28')](db['VoiceQueuesLog'][_0x3117('0x29')],function(_0x2e7269){return{'name':_0x2e7269[_0x3117('0x2a')],'type':_0x2e7269[_0x3117('0x2b')][_0x3117('0x2c')]};});_0x37275e[_0x3117('0x2d')]=_[_0x3117('0x28')](_0xc35b50,_0x3117('0x26'));_0x37275e[_0x3117('0x2e')]=_[_0x3117('0x2f')](_0x515094[_0x3117('0x2e')]);_0x37275e[_0x3117('0x30')]=_[_0x3117('0x31')](_0x37275e['model'],_0x37275e[_0x3117('0x2e')]);_0x44d6d3[_0x3117('0x32')]=_[_0x3117('0x31')](_0x37275e[_0x3117('0x2d')],qs[_0x3117('0x33')](_0x515094[_0x3117('0x2e')][_0x3117('0x33')]));_0x44d6d3[_0x3117('0x32')]=_0x44d6d3[_0x3117('0x32')]['length']?_0x44d6d3[_0x3117('0x32')]:_0x37275e['model'];if(!_0x515094[_0x3117('0x2e')][_0x3117('0x34')]('nolimit')){_0x44d6d3['limit']=qs[_0x3117('0x1e')](_0x515094[_0x3117('0x2e')][_0x3117('0x1e')]);_0x44d6d3[_0x3117('0x1c')]=qs['offset'](_0x515094[_0x3117('0x2e')][_0x3117('0x1c')]);}_0x44d6d3['order']=qs['sort'](_0x515094[_0x3117('0x2e')][_0x3117('0x35')]);_0x44d6d3[_0x3117('0x36')]=qs[_0x3117('0x30')](_[_0x3117('0x37')](_0x515094[_0x3117('0x2e')],_0x37275e[_0x3117('0x30')]),_0xc35b50);if(_0x515094[_0x3117('0x2e')][_0x3117('0x38')]){_0x44d6d3[_0x3117('0x36')]=_[_0x3117('0x39')](_0x44d6d3[_0x3117('0x36')],{'$or':_['map'](_0xc35b50,function(_0x1acb4d){if(_0x1acb4d[_0x3117('0x2b')]!==_0x3117('0x3a')){var _0x20691d={};_0x20691d[_0x1acb4d['name']]={'$like':'%'+_0x515094[_0x3117('0x2e')][_0x3117('0x38')]+'%'};return _0x20691d;}})});}_0x44d6d3=_[_0x3117('0x39')]({},_0x44d6d3,_0x515094[_0x3117('0x3b')]);var _0xd1d91d={'where':_0x44d6d3[_0x3117('0x36')]};return db[_0x3117('0x3c')][_0x3117('0x1f')](_0xd1d91d)[_0x3117('0x23')](function(_0x2d9b45){_0x5d1da7['count']=_0x2d9b45;if(_0x515094['query'][_0x3117('0x3d')]){_0x44d6d3[_0x3117('0x3e')]=[{'all':!![]}];}return db[_0x3117('0x3c')][_0x3117('0x3f')](_0x44d6d3);})[_0x3117('0x23')](function(_0x32d5e2){_0x5d1da7[_0x3117('0x40')]=_0x32d5e2;return _0x5d1da7;})[_0x3117('0x23')](respondWithFilteredResult(_0x11f7d4,_0x44d6d3))['catch'](handleError(_0x11f7d4,null));};exports[_0x3117('0x41')]=function(_0xb75aca,_0x4f0a10){var _0x5d34eb={'raw':!![],'where':{'id':_0xb75aca[_0x3117('0x42')]['id']}},_0x40cbc8={};_0x40cbc8[_0x3117('0x2d')]=_[_0x3117('0x2f')](db[_0x3117('0x3c')][_0x3117('0x29')]);_0x40cbc8['query']=_[_0x3117('0x2f')](_0xb75aca[_0x3117('0x2e')]);_0x40cbc8[_0x3117('0x30')]=_[_0x3117('0x31')](_0x40cbc8[_0x3117('0x2d')],_0x40cbc8[_0x3117('0x2e')]);_0x5d34eb[_0x3117('0x32')]=_[_0x3117('0x31')](_0x40cbc8[_0x3117('0x2d')],qs[_0x3117('0x33')](_0xb75aca[_0x3117('0x2e')]['fields']));_0x5d34eb[_0x3117('0x32')]=_0x5d34eb[_0x3117('0x32')][_0x3117('0x43')]?_0x5d34eb[_0x3117('0x32')]:_0x40cbc8[_0x3117('0x2d')];if(_0xb75aca[_0x3117('0x2e')][_0x3117('0x3d')]){_0x5d34eb[_0x3117('0x3e')]=[{'all':!![]}];}_0x5d34eb=_[_0x3117('0x39')]({},_0x5d34eb,_0xb75aca[_0x3117('0x3b')]);return db[_0x3117('0x3c')][_0x3117('0x44')](_0x5d34eb)[_0x3117('0x23')](handleEntityNotFound(_0x4f0a10,null))[_0x3117('0x23')](respondWithResult(_0x4f0a10,null))['catch'](handleError(_0x4f0a10,null));};exports['create']=function(_0x469e8d,_0x59b9d8){return db[_0x3117('0x3c')]['create'](_0x469e8d[_0x3117('0x45')],{})[_0x3117('0x23')](respondWithResult(_0x59b9d8,0xc9))[_0x3117('0x46')](handleError(_0x59b9d8,null));};exports[_0x3117('0x22')]=function(_0x3b26e7,_0xd1a83b){if(_0x3b26e7['body']['id']){delete _0x3b26e7[_0x3117('0x45')]['id'];}return db['VoiceQueuesLog'][_0x3117('0x44')]({'where':{'id':_0x3b26e7[_0x3117('0x42')]['id']}})[_0x3117('0x23')](handleEntityNotFound(_0xd1a83b,null))[_0x3117('0x23')](saveUpdates(_0x3b26e7[_0x3117('0x45')],null))['then'](respondWithResult(_0xd1a83b,null))[_0x3117('0x46')](handleError(_0xd1a83b,null));};exports[_0x3117('0x47')]=function(_0x1c390d,_0x347b6e){return db[_0x3117('0x3c')][_0x3117('0x44')]({'where':{'id':_0x1c390d[_0x3117('0x42')]['id']}})['then'](handleEntityNotFound(_0x347b6e,null))[_0x3117('0x23')](removeEntity(_0x347b6e,null))[_0x3117('0x46')](handleError(_0x347b6e,null));};
\ No newline at end of file
index a3281e0..6d34c60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x185e=['VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x54399a,_0x4a95cc){var _0xf7e794=function(_0x279e8a){while(--_0x279e8a){_0x54399a['push'](_0x54399a['shift']());}};_0xf7e794(++_0x4a95cc);}(_0x185e,0x11c));var _0xe185=function(_0x17fe77,_0x3ed5ca){_0x17fe77=_0x17fe77-0x0;var _0x5efa87=_0x185e[_0x17fe77];return _0x5efa87;};'use strict';var _=require(_0xe185('0x0'));var util=require(_0xe185('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe185('0x2'));var BPromise=require('bluebird');var rp=require(_0xe185('0x3'));var fs=require('fs');var path=require(_0xe185('0x4'));var rimraf=require(_0xe185('0x5'));var config=require(_0xe185('0x6'));var attributes=require(_0xe185('0x7'));module[_0xe185('0x8')]=function(_0x45a8d5,_0x2db8f1){return _0x45a8d5[_0xe185('0x9')](_0xe185('0xa'),attributes,{'tableName':_0xe185('0xb'),'paranoid':![],'indexes':[{'name':_0xe185('0xc'),'fields':[_0xe185('0xd'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
+var _0xbfca=['path','rimraf','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x264a3d,_0x94e5e8){var _0x3871f4=function(_0x3af9d0){while(--_0x3af9d0){_0x264a3d['push'](_0x264a3d['shift']());}};_0x3871f4(++_0x94e5e8);}(_0xbfca,0x112));var _0xabfc=function(_0x1cbc6b,_0x2b13b5){_0x1cbc6b=_0x1cbc6b-0x0;var _0x46da0d=_0xbfca[_0x1cbc6b];return _0x46da0d;};'use strict';var _=require(_0xabfc('0x0'));var util=require(_0xabfc('0x1'));var logger=require(_0xabfc('0x2'))(_0xabfc('0x3'));var moment=require(_0xabfc('0x4'));var BPromise=require('bluebird');var rp=require(_0xabfc('0x5'));var fs=require('fs');var path=require(_0xabfc('0x6'));var rimraf=require(_0xabfc('0x7'));var config=require('../../config/environment');var attributes=require(_0xabfc('0x8'));module['exports']=function(_0x6a772a,_0x28777d){return _0x6a772a[_0xabfc('0x9')](_0xabfc('0xa'),attributes,{'tableName':_0xabfc('0xb'),'paranoid':![],'indexes':[{'name':_0xabfc('0xc'),'fields':[_0xabfc('0xd'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
index 542c4b9..f4cc43f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe356=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result'];(function(_0x16dbcd,_0x274516){var _0x34706e=function(_0x43433d){while(--_0x43433d){_0x16dbcd['push'](_0x16dbcd['shift']());}};_0x34706e(++_0x274516);}(_0xe356,0x1ee));var _0x6e35=function(_0x207b23,_0x55e6e3){_0x207b23=_0x207b23-0x0;var _0xbd3e28=_0xe356[_0x207b23];return _0xbd3e28;};'use strict';var _=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var moment=require(_0x6e35('0x2'));var BPromise=require(_0x6e35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e35('0x5'));var logger=require(_0x6e35('0x6'))(_0x6e35('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e35('0x8'));var client=jayson[_0x6e35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389ae2,_0xba948e,_0x114b4c){return new BPromise(function(_0x1da99b,_0x5119fa){return client[_0x6e35('0xa')](_0x389ae2,_0x114b4c)['then'](function(_0x3b3c16){logger['info'](_0x6e35('0xb'),_0xba948e,'request\x20sent');logger['debug'](_0x6e35('0xc'),_0xba948e,_0x6e35('0xd'),JSON['stringify'](_0x3b3c16));if(_0x3b3c16['error']){if(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0xf')]===0x1f4){logger[_0x6e35('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0xba948e,_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);return _0x5119fa(_0x3b3c16[_0x6e35('0xe')]['message']);}logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3b3c16[_0x6e35('0xe')]['message']);return _0x1da99b(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);}else{logger[_0x6e35('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0xba948e,_0x6e35('0xd'));_0x1da99b(_0x3b3c16[_0x6e35('0x12')][_0x6e35('0x10')]);}})['catch'](function(_0x3e7e7a){logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3e7e7a);_0x5119fa(_0x3e7e7a);});});}
\ No newline at end of file
+var _0xa74d=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa74d,0x1cf));var _0xda74=function(_0x1aba9f,_0x21676b){_0x1aba9f=_0x1aba9f-0x0;var _0x55f244=_0xa74d[_0x1aba9f];return _0x55f244;};'use strict';var _=require('lodash');var util=require(_0xda74('0x0'));var moment=require(_0xda74('0x1'));var BPromise=require(_0xda74('0x2'));var rs=require(_0xda74('0x3'));var fs=require('fs');var Redis=require(_0xda74('0x4'));var db=require(_0xda74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda74('0x6'))(_0xda74('0x7'));var config=require(_0xda74('0x8'));var jayson=require(_0xda74('0x9'));var client=jayson[_0xda74('0xa')][_0xda74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2113f2,_0x3fa4e7,_0x5da443){return new BPromise(function(_0x23d5f5,_0x517251){return client['request'](_0x2113f2,_0x5da443)[_0xda74('0xc')](function(_0x411790){logger['info'](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));logger[_0xda74('0xf')](_0xda74('0x10'),_0x3fa4e7,_0xda74('0xe'),JSON[_0xda74('0x11')](_0x411790));if(_0x411790[_0xda74('0x12')]){if(_0x411790[_0xda74('0x12')]['code']===0x1f4){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')]['message']);return _0x517251(_0x411790[_0xda74('0x12')][_0xda74('0x13')]);}logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')][_0xda74('0x13')]);return _0x23d5f5(_0x411790[_0xda74('0x12')]['message']);}else{logger[_0xda74('0x14')](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));_0x23d5f5(_0x411790[_0xda74('0x15')][_0xda74('0x13')]);}})['catch'](function(_0x1535d3){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x1535d3);_0x517251(_0x1535d3);});});}
\ No newline at end of file
index af7bb26..07b134b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde78=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','describe','/:id','show','isAuthenticated','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0xeacecb,_0x55450f){var _0x2eb561=function(_0x305534){while(--_0x305534){_0xeacecb['push'](_0xeacecb['shift']());}};_0x2eb561(++_0x55450f);}(_0xde78,0xdb));var _0x8de7=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0xde78[_0xe1b5f6];return _0x44636e;};'use strict';var multer=require(_0x8de7('0x0'));var util=require(_0x8de7('0x1'));var path=require(_0x8de7('0x2'));var timeout=require('connect-timeout');var express=require(_0x8de7('0x3'));var router=express[_0x8de7('0x4')]();var fs_extra=require(_0x8de7('0x5'));var auth=require(_0x8de7('0x6'));var interaction=require(_0x8de7('0x7'));var config=require(_0x8de7('0x8'));var controller=require(_0x8de7('0x9'));router[_0x8de7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8de7('0xa')](_0x8de7('0xb'),auth['isAuthenticated'](),controller[_0x8de7('0xc')]);router[_0x8de7('0xa')](_0x8de7('0xd'),auth['isAuthenticated'](),controller[_0x8de7('0xe')]);router[_0x8de7('0xa')]('/:id/download',auth[_0x8de7('0xf')](),controller[_0x8de7('0x10')]);router['get'](_0x8de7('0x11'),controller[_0x8de7('0x12')]);router[_0x8de7('0xa')](_0x8de7('0x13'),auth[_0x8de7('0xf')](),controller[_0x8de7('0x14')]);router['post']('/',auth[_0x8de7('0xf')](),controller[_0x8de7('0x15')]);router[_0x8de7('0x16')](_0x8de7('0x13'),auth[_0x8de7('0xf')](),controller[_0x8de7('0x17')]);router[_0x8de7('0x18')]('/:id',auth[_0x8de7('0xf')](),controller[_0x8de7('0x19')]);router['delete'](_0x8de7('0xd'),auth[_0x8de7('0xf')](),controller[_0x8de7('0x1a')]);module[_0x8de7('0x1b')]=router;
\ No newline at end of file
+var _0x8487=['post','create','runTranscribe','put','/:id','update','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe'];(function(_0x4297c,_0x5d2d9d){var _0x401283=function(_0x4f42f0){while(--_0x4f42f0){_0x4297c['push'](_0x4297c['shift']());}};_0x401283(++_0x5d2d9d);}(_0x8487,0x142));var _0x7848=function(_0x59136f,_0x560a68){_0x59136f=_0x59136f-0x0;var _0x466ef8=_0x8487[_0x59136f];return _0x466ef8;};'use strict';var multer=require('multer');var util=require(_0x7848('0x0'));var path=require('path');var timeout=require(_0x7848('0x1'));var express=require('express');var router=express[_0x7848('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7848('0x3'));var interaction=require(_0x7848('0x4'));var config=require(_0x7848('0x5'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x7848('0x6')](),controller['index']);router[_0x7848('0x7')]('/describe',auth[_0x7848('0x6')](),controller[_0x7848('0x8')]);router[_0x7848('0x7')]('/:id',auth[_0x7848('0x6')](),controller['show']);router['get'](_0x7848('0x9'),auth[_0x7848('0x6')](),controller[_0x7848('0xa')]);router[_0x7848('0x7')]('/:id/downloads',controller[_0x7848('0xb')]);router[_0x7848('0x7')](_0x7848('0xc'),auth[_0x7848('0x6')](),controller[_0x7848('0xd')]);router[_0x7848('0xe')]('/',auth['isAuthenticated'](),controller[_0x7848('0xf')]);router[_0x7848('0xe')](_0x7848('0xc'),auth[_0x7848('0x6')](),controller[_0x7848('0x10')]);router[_0x7848('0x11')](_0x7848('0x12'),auth['isAuthenticated'](),controller[_0x7848('0x13')]);router['delete']('/:id',auth[_0x7848('0x6')](),controller[_0x7848('0x14')]);module['exports']=router;
\ No newline at end of file
index ba08087..950e123 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
+var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
index 688893f..58fda44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51bc=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','key','model','differenceBy','format','query','keys','filters','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','unlink','message','sequelize','col','token','$and','push','existsSync','extname','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','transcribeStatus','runTranscribe','findOne','secrets','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','zip-dir'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x51bc,0x13c));var _0xc51b=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x51bc[_0x2adbeb];return _0x5e18a6;};'use strict';var emlformat=require(_0xc51b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc51b('0x1'));var jsonpatch=require(_0xc51b('0x2'));var rp=require(_0xc51b('0x3'));var moment=require(_0xc51b('0x4'));var BPromise=require(_0xc51b('0x5'));var Mustache=require(_0xc51b('0x6'));var util=require(_0xc51b('0x7'));var path=require(_0xc51b('0x8'));var sox=require(_0xc51b('0x9'));var csv=require(_0xc51b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc51b('0xb'));var _=require(_0xc51b('0xc'));var squel=require(_0xc51b('0xd'));var crypto=require(_0xc51b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc51b('0xf'));var toCsv=require(_0xc51b('0xa'));var querystring=require(_0xc51b('0x10'));var Papa=require(_0xc51b('0x11'));var AWS=require('aws-sdk');var uuidv4=require(_0xc51b('0x12'));var Redis=require(_0xc51b('0x13'));var authService=require(_0xc51b('0x14'));var qs=require(_0xc51b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc51b('0x16'))(_0xc51b('0x17'));var utils=require(_0xc51b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc51b('0x19'));var db=require(_0xc51b('0x1a'))['db'];function respondWithStatusCode(_0x38bf17,_0x2f0253){_0x2f0253=_0x2f0253||0xcc;return function(_0x4e76d5){if(_0x4e76d5){return _0x38bf17[_0xc51b('0x1b')](_0x2f0253);}return _0x38bf17['status'](_0x2f0253)['end']();};}function respondWithResult(_0x1020d7,_0x40e808){_0x40e808=_0x40e808||0xc8;return function(_0x541dc0){if(_0x541dc0){return _0x1020d7[_0xc51b('0x1c')](_0x40e808)[_0xc51b('0x1d')](_0x541dc0);}};}function respondWithFilteredResult(_0x1281a4,_0x135332){return function(_0x5c4da7){if(_0x5c4da7){var _0x826963=typeof _0x135332[_0xc51b('0x1e')]==='undefined'&&typeof _0x135332[_0xc51b('0x1f')]===_0xc51b('0x20');var _0x5471bc=_0x5c4da7['count'];var _0x609fea=_0x826963?0x0:_0x135332[_0xc51b('0x1e')];var _0x3143af=_0x826963?_0x5c4da7[_0xc51b('0x21')]:_0x135332[_0xc51b('0x1e')]+_0x135332[_0xc51b('0x1f')];var _0x54e48b;if(_0x3143af>=_0x5471bc){_0x3143af=_0x5471bc;_0x54e48b=0xc8;}else{_0x54e48b=0xce;}_0x1281a4['status'](_0x54e48b);return _0x1281a4[_0xc51b('0x22')](_0xc51b('0x23'),_0x609fea+'-'+_0x3143af+'/'+_0x5471bc)[_0xc51b('0x1d')](_0x5c4da7);}return null;};}function patchUpdates(_0x495975){return function(_0xd81cbf){try{jsonpatch[_0xc51b('0x24')](_0xd81cbf,_0x495975,!![]);}catch(_0x3e6e5a){return BPromise[_0xc51b('0x25')](_0x3e6e5a);}return _0xd81cbf['save']();};}function saveUpdates(_0x239c3c,_0xbb069b){return function(_0x36cdbf){if(_0x36cdbf){return _0x36cdbf[_0xc51b('0x26')](_0x239c3c)[_0xc51b('0x27')](function(_0x1ae1fa){return _0x1ae1fa;});}return null;};}function removeEntity(_0xf1cd4b,_0x3d7156){return function(_0x231891){if(_0x231891){return _0x231891[_0xc51b('0x28')]()[_0xc51b('0x27')](function(){_0xf1cd4b[_0xc51b('0x1c')](0xcc)[_0xc51b('0x29')]();});}};}function handleEntityNotFound(_0x462f45,_0x196e85){return function(_0xb0ef74){if(!_0xb0ef74){_0x462f45[_0xc51b('0x1b')](0x194);}return _0xb0ef74;};}function handleError(_0x21f30b,_0x4f27e7){_0x4f27e7=_0x4f27e7||0x1f4;return function(_0x7bf86e){logger[_0xc51b('0x2a')](_0x7bf86e[_0xc51b('0x2b')]);if(_0x7bf86e[_0xc51b('0x2c')]){delete _0x7bf86e[_0xc51b('0x2c')];}_0x21f30b[_0xc51b('0x1c')](_0x4f27e7)[_0xc51b('0x2d')](_0x7bf86e);};}exports[_0xc51b('0x2e')]=function(_0x7bdabe,_0x5b61a0){var _0x581d59={},_0xb4690e={},_0xa8297f={'count':0x0,'rows':[]};var _0x2700c3=_[_0xc51b('0x2f')](db[_0xc51b('0x30')][_0xc51b('0x31')],function(_0x1bf4ef){return{'name':_0x1bf4ef['fieldName'],'type':_0x1bf4ef['type'][_0xc51b('0x32')]};});_0xb4690e[_0xc51b('0x33')]=_[_0xc51b('0x34')](_[_0xc51b('0x2f')](_0x2700c3,'name'),[_0xc51b('0x35')]);_0xb4690e[_0xc51b('0x36')]=_[_0xc51b('0x37')](_0x7bdabe[_0xc51b('0x36')]);_0xb4690e[_0xc51b('0x38')]=_['intersection'](_0xb4690e[_0xc51b('0x33')],_0xb4690e[_0xc51b('0x36')]);_0x581d59['attributes']=_['intersection'](_0xb4690e[_0xc51b('0x33')],qs[_0xc51b('0x39')](_0x7bdabe[_0xc51b('0x36')]['fields']));_0x581d59['attributes']=_0x581d59['attributes'][_0xc51b('0x3a')]?_0x581d59[_0xc51b('0x3b')]:_0xb4690e['model'];if(!_0x7bdabe[_0xc51b('0x36')][_0xc51b('0x3c')]('nolimit')){_0x581d59[_0xc51b('0x1f')]=qs[_0xc51b('0x1f')](_0x7bdabe[_0xc51b('0x36')][_0xc51b('0x1f')]);_0x581d59[_0xc51b('0x1e')]=qs[_0xc51b('0x1e')](_0x7bdabe[_0xc51b('0x36')][_0xc51b('0x1e')]);}_0x581d59[_0xc51b('0x3d')]=qs[_0xc51b('0x3e')](_0x7bdabe[_0xc51b('0x36')]['sort']);_0x581d59[_0xc51b('0x3f')]=qs['filters'](_[_0xc51b('0x40')](_0x7bdabe[_0xc51b('0x36')],_0xb4690e['filters']),_0x2700c3);if(_0x7bdabe['query'][_0xc51b('0x41')]){_0x581d59[_0xc51b('0x3f')]=_[_0xc51b('0x42')](_0x581d59[_0xc51b('0x3f')],{'$or':_[_0xc51b('0x2f')](_0x2700c3,function(_0x571ecd){if(_0x571ecd[_0xc51b('0x43')]!==_0xc51b('0x44')){var _0x4ec561={};_0x4ec561[_0x571ecd[_0xc51b('0x2c')]]={'$like':'%'+_0x7bdabe['query']['filter']+'%'};return _0x4ec561;}})});}_0x581d59=_[_0xc51b('0x42')]({},_0x581d59,_0x7bdabe[_0xc51b('0x45')]);var _0x1c5aa8={'where':_0x581d59[_0xc51b('0x3f')]};return db['VoiceRecording'][_0xc51b('0x21')](_0x1c5aa8)[_0xc51b('0x27')](function(_0x1db46d){_0xa8297f['count']=_0x1db46d;if(_0x7bdabe['query'][_0xc51b('0x46')]){_0x581d59[_0xc51b('0x47')]=[{'all':!![]}];}return db[_0xc51b('0x30')][_0xc51b('0x48')](_0x581d59);})[_0xc51b('0x27')](function(_0x2444a9){_0xa8297f[_0xc51b('0x49')]=_0x2444a9;return _0xa8297f;})['then'](respondWithFilteredResult(_0x5b61a0,_0x581d59))[_0xc51b('0x4a')](handleError(_0x5b61a0,null));};exports[_0xc51b('0x4b')]=function(_0x40e2be,_0x29c0ac){var _0x3f9d15={'raw':![],'where':{'id':_0x40e2be[_0xc51b('0x4c')]['id']}},_0x2fb0d2={};_0x2fb0d2[_0xc51b('0x33')]=_['keys'](db['VoiceRecording'][_0xc51b('0x31')]);_0x2fb0d2['query']=_[_0xc51b('0x37')](_0x40e2be[_0xc51b('0x36')]);_0x2fb0d2[_0xc51b('0x38')]=_[_0xc51b('0x4d')](_0x2fb0d2[_0xc51b('0x33')],_0x2fb0d2[_0xc51b('0x36')]);_0x3f9d15[_0xc51b('0x3b')]=_[_0xc51b('0x4d')](_0x2fb0d2[_0xc51b('0x33')],qs[_0xc51b('0x39')](_0x40e2be['query'][_0xc51b('0x39')]));_0x3f9d15['attributes']=_0x3f9d15[_0xc51b('0x3b')][_0xc51b('0x3a')]?_0x3f9d15[_0xc51b('0x3b')]:_0x2fb0d2['model'];if(_0x40e2be[_0xc51b('0x36')][_0xc51b('0x46')]){_0x3f9d15[_0xc51b('0x47')]=[{'all':!![]}];}_0x3f9d15=_[_0xc51b('0x42')]({},_0x3f9d15,_0x40e2be['options']);return db[_0xc51b('0x30')][_0xc51b('0x4e')](_0x3f9d15)['then'](handleEntityNotFound(_0x29c0ac,null))['then'](respondWithResult(_0x29c0ac,null))[_0xc51b('0x4a')](handleError(_0x29c0ac,null));};exports[_0xc51b('0x4f')]=function(_0x1f150b,_0x3be02c){return db[_0xc51b('0x30')][_0xc51b('0x4f')](_0x1f150b[_0xc51b('0x50')],{})[_0xc51b('0x27')](respondWithResult(_0x3be02c,0xc9))['catch'](handleError(_0x3be02c,null));};exports[_0xc51b('0x26')]=function(_0x13e9f3,_0x1a971d){if(_0x13e9f3[_0xc51b('0x50')]['id']){delete _0x13e9f3[_0xc51b('0x50')]['id'];}return db[_0xc51b('0x30')][_0xc51b('0x4e')]({'where':{'id':_0x13e9f3[_0xc51b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a971d,null))[_0xc51b('0x27')](saveUpdates(_0x13e9f3[_0xc51b('0x50')],null))['then'](respondWithResult(_0x1a971d,null))[_0xc51b('0x4a')](handleError(_0x1a971d,null));};exports['describe']=function(_0x3d7df0,_0x470491){return db[_0xc51b('0x30')][_0xc51b('0x51')]()[_0xc51b('0x27')](respondWithResult(_0x470491,null))[_0xc51b('0x4a')](handleError(_0x470491,null));};exports['download']=function(_0x240d8b,_0xdb34d0,_0x5701ee){var _0xe4f50f=require(_0xc51b('0x52'));var _0x376a27=![];var _0x5963ba={};if(_0x240d8b[_0xc51b('0x36')][_0xc51b('0x43')]&&_0x240d8b['query'][_0xc51b('0x43')]===_0xc51b('0x53')){_0x5963ba['uniqueid']=_0x240d8b[_0xc51b('0x4c')]['id'];}else{_0x5963ba['id']=_0x240d8b[_0xc51b('0x4c')]['id'];}return db[_0xc51b('0x30')][_0xc51b('0x4e')]({'where':_0x5963ba,'attributes':['id',_0xc51b('0x54')],'raw':!![]})[_0xc51b('0x27')](handleEntityNotFound(_0xdb34d0,null))[_0xc51b('0x27')](function(_0x3797b0){if(_0x3797b0){var _0x9756ce=_0x3797b0[_0xc51b('0x54')];var _0x2f8d72=util['format'](_0xc51b('0x55'),_0x9756ce);if(fs['existsSync'](_0x2f8d72)){_0x376a27=!![];return _0xe4f50f[_0xc51b('0x56')](_0x2f8d72,_0x9756ce,config['secrets'][_0xc51b('0x57')])[_0xc51b('0x27')](function(){return _0x3797b0;});}return _0x3797b0;}})[_0xc51b('0x27')](function(_0x3d9cf0){if(_0x3d9cf0){var _0x17eb72=_0x3d9cf0['value'];if(!fs['existsSync'](_0x17eb72)){throw new db[(_0xc51b('0x58'))][(_0xc51b('0x59'))](_0xc51b('0x5a'));}if(_0x3d9cf0[_0xc51b('0x5b')]){return _0xdb34d0[_0xc51b('0x5c')](_0x17eb72,_0x3d9cf0[_0xc51b('0x5b')]+path['extname'](_0x17eb72),function(){if(_0x376a27){fs[_0xc51b('0x5d')](_0x17eb72);}});}else{return _0xdb34d0[_0xc51b('0x5c')](_0x17eb72,function(_0x2d08f0){if(_0x376a27){fs[_0xc51b('0x5d')](_0x17eb72);}});}}})[_0xc51b('0x4a')](function(_0x84fdf5){if(_0x84fdf5[_0xc51b('0x5e')]===_0xc51b('0x5a')){_0xdb34d0['status'](0x194)['send']('Not\x20found');}else{return handleError(_0xdb34d0,null);}});};exports['downloads']=function(_0x33a335,_0x4491e3,_0x30abe8){var _0x255892=require(_0xc51b('0x52'));var _0x51fd94=![];var _0x2398ff={'$and':[db['sequelize'][_0xc51b('0x3f')](db[_0xc51b('0x5f')]['fn']('MD5',db[_0xc51b('0x5f')][_0xc51b('0x60')](_0xc51b('0x53'))),_0x33a335['query'][_0xc51b('0x61')])]};if(_0x33a335[_0xc51b('0x36')][_0xc51b('0x43')]&&_0x33a335[_0xc51b('0x36')][_0xc51b('0x43')]===_0xc51b('0x53')){_0x2398ff[_0xc51b('0x62')]['push']({'uniqueid':_0x33a335[_0xc51b('0x4c')]['id']});}else{_0x2398ff[_0xc51b('0x62')][_0xc51b('0x63')]({'id':_0x33a335['params']['id']});}return db[_0xc51b('0x30')][_0xc51b('0x4e')]({'where':_0x2398ff,'attributes':['id',_0xc51b('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x4491e3,null))[_0xc51b('0x27')](function(_0x5af33e){if(_0x5af33e){var _0x47e28e=util[_0xc51b('0x35')](_0xc51b('0x55'),_0x5af33e['value']);if(fs[_0xc51b('0x64')](_0x47e28e)){_0x51fd94=!![];return _0x255892[_0xc51b('0x56')](_0x47e28e,_0x5af33e[_0xc51b('0x54')],config['secrets'][_0xc51b('0x57')])[_0xc51b('0x27')](function(){return _0x5af33e;});}return _0x5af33e;}})[_0xc51b('0x27')](function(_0x1d5d9b){if(_0x1d5d9b){if(!fs[_0xc51b('0x64')](_0x1d5d9b[_0xc51b('0x54')])){throw new db['Sequelize'][(_0xc51b('0x59'))](_0xc51b('0x5a'));}if(_0x1d5d9b['filename']){return _0x4491e3[_0xc51b('0x5c')](_0x1d5d9b[_0xc51b('0x54')],_0x1d5d9b[_0xc51b('0x5b')]+path[_0xc51b('0x65')](_0x1d5d9b['value']),function(){if(_0x51fd94){fs[_0xc51b('0x5d')](_0x1d5d9b[_0xc51b('0x54')]);}});}else{return _0x4491e3[_0xc51b('0x5c')](_0x1d5d9b['value'],function(_0x592151){if(_0x51fd94){fs[_0xc51b('0x5d')](_0x1d5d9b[_0xc51b('0x54')]);}});}}})[_0xc51b('0x4a')](handleError(_0x4491e3,null));};exports[_0xc51b('0x28')]=function(_0x590adc,_0x3a367b){return db['VoiceRecording'][_0xc51b('0x4e')]({'where':{'id':_0x590adc['params']['id']}})['then'](function(_0x2b9c2a){if(_[_0xc51b('0x66')](_0x2b9c2a)){throw new ReferenceError(_0xc51b('0x67'));}return _0x2b9c2a;})['then'](function(_0x3b22f3){var _0x2b1092=_0x3b22f3[_0xc51b('0x54')];logger['info'](_0xc51b('0x68'),_0x2b1092);if(!_['isNil'](_0x3b22f3[_0xc51b('0x54')])&&fs[_0xc51b('0x64')](_0x2b1092)){logger[_0xc51b('0x69')](_0xc51b('0x6a')+_0x2b1092+_0xc51b('0x6b'));fs['unlinkSync'](_0x2b1092);}_0x2b1092=_0x2b1092+_0xc51b('0x6c');if(!_[_0xc51b('0x66')](_0x3b22f3['value'])&&fs[_0xc51b('0x64')](_0x2b1092)){logger[_0xc51b('0x69')](_0xc51b('0x6a')+_0x2b1092+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc51b('0x6d')](_0x2b1092);}return _0x3b22f3;})[_0xc51b('0x27')](function(_0x580b06){if(!_0x580b06)throw new InternalError();return _0x580b06[_0xc51b('0x28')]();})[_0xc51b('0x27')](function(){_0x3a367b['status'](0xcc)[_0xc51b('0x29')]();})[_0xc51b('0x4a')](handleError(_0x3a367b,null));};function getBucketslist(_0x733be2,_0x25deba,_0x561829){return new Promise(function(_0x1dd965,_0x45211d){var _0x13b28f=new AWS['S3']({'accessKeyId':_0x25deba,'secretAccessKey':_0x733be2,'region':_0x561829});_0x13b28f[_0xc51b('0x6e')]({},function(_0x20a2ca,_0x15b2f3){if(_0x20a2ca){return _0x45211d(_0x20a2ca);}else{return _0x1dd965(_0x15b2f3);}});});}function createBucket(_0x40bf01,_0x16073a,_0x121335,_0x517564){return new Promise(function(_0x46771d,_0x1a042b){var _0x17360b=new AWS['S3']({'accessKeyId':_0x16073a,'secretAccessKey':_0x40bf01,'region':_0x121335});_0x17360b['createBucket']({'Bucket':_0x517564},function(_0x40e29b,_0x29d8a3){if(_0x40e29b){return _0x1a042b(_0x40e29b);}else{return _0x46771d(_0x29d8a3);}});});}function uploadFile(_0x574cbc,_0x32ff7d,_0x5504ca,_0x6fce45,_0x1e24d2,_0x466ee7){return new Promise(function(_0x3832f2,_0x2fd9d4){var _0x21a7fe=new AWS['S3']({'accessKeyId':_0x32ff7d,'secretAccessKey':_0x574cbc,'region':_0x5504ca});_0x21a7fe[_0xc51b('0x6f')]({'Bucket':_0x6fce45,'Key':_0x1e24d2,'Body':_0x466ee7},function(_0x3d129f,_0x16a222){if(_0x3d129f){return _0x2fd9d4(_0x3d129f);}else{return _0x3832f2(_0x16a222);}});});}function startTranscribe(_0x38e5b1,_0x18b81f,_0x7a65bb,_0x14e13e,_0x552525,_0x4468ad){return new Promise(function(_0x2a71c1,_0xe65528){var _0x4876a8=new AWS[(_0xc51b('0x70'))]({'accessKeyId':_0x18b81f,'secretAccessKey':_0x38e5b1,'region':_0x7a65bb});_0x4876a8[_0xc51b('0x71')]({'TranscriptionJobName':_0x14e13e,'LanguageCode':_0x552525,'Media':{'MediaFileUri':_0x4468ad}},function(_0x511f5c,_0x27beed){if(_0x511f5c){return _0xe65528(_0x511f5c);}else{return _0x2a71c1(_0x27beed);}});});}function transcribe(_0x1e0dff,_0x45400c,_0x32341a,_0x13041a,_0x14aa09,_0x1231a5,_0x530b0a){return new Promise(function(_0x1b1852,_0xc5474){var _0x175373={};logger[_0xc51b('0x69')](util[_0xc51b('0x35')](_0xc51b('0x72'),_0x1e0dff,_0x14aa09));return uploadFile(_0x45400c,_0x32341a,_0x13041a,_0x14aa09,path[_0xc51b('0x73')](_0x1231a5),fs[_0xc51b('0x74')](_0x1231a5))['then'](function(_0x541f95){logger[_0xc51b('0x69')](util[_0xc51b('0x35')](_0xc51b('0x75'),_0x1e0dff,_0x14aa09,_0x541f95[_0xc51b('0x76')]));_0x175373[_0xc51b('0x77')]=_0x541f95[_0xc51b('0x78')];_0x175373[_0xc51b('0x79')]=_0x541f95['Location'];logger[_0xc51b('0x69')](util[_0xc51b('0x35')](_0xc51b('0x7a'),_0x1e0dff));return startTranscribe(_0x45400c,_0x32341a,_0x13041a,uuidv4(),_0x530b0a,_0x541f95[_0xc51b('0x76')]);})['then'](function(_0x3143c0){logger['info'](util['format'](_0xc51b('0x7b'),_0x1e0dff,_0x3143c0[_0xc51b('0x7c')]['TranscriptionJobName']));_0x175373[_0xc51b('0x7d')]=_0x3143c0[_0xc51b('0x7c')]['TranscriptionJobName'];_0x175373[_0xc51b('0x7e')]=_0x3143c0[_0xc51b('0x7c')]['TranscriptionJobStatus'];return _0x1b1852(_0x175373);})[_0xc51b('0x4a')](function(_0x65e5ce){return _0xc5474(_0x65e5ce);});});}exports[_0xc51b('0x7f')]=function(_0x5ba37a,_0x2a02ce,_0x2d6bd5){var _0x3f7243;var _0x30025f;var _0xd96bae;var _0x199912=require(_0xc51b('0x52'));return db[_0xc51b('0x30')][_0xc51b('0x80')]({'where':{'id':_0x5ba37a[_0xc51b('0x4c')]['id']}})[_0xc51b('0x27')](function(_0x2e9560){if(_0x2e9560){var _0x1ebdbe=util[_0xc51b('0x35')](_0xc51b('0x55'),_0x2e9560[_0xc51b('0x54')]);if(fs[_0xc51b('0x64')](_0x1ebdbe)){cypher=!![];return _0x199912[_0xc51b('0x56')](_0x1ebdbe,_0x2e9560[_0xc51b('0x54')],config[_0xc51b('0x81')]['recording'])[_0xc51b('0x27')](function(){return _0x2e9560;});}return _0x2e9560;}})[_0xc51b('0x27')](function(_0x11e9aa){if(!_0x11e9aa){throw new db[(_0xc51b('0x58'))][(_0xc51b('0x59'))](_0xc51b('0x82'));}_0x30025f=_0x11e9aa;return db[_0xc51b('0x83')][_0xc51b('0x80')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2a02ce,null))[_0xc51b('0x27')](function(_0x437119){if(_0x437119){_0x3f7243=_0x437119;if(!_0x3f7243[_0xc51b('0x84')]||!_0x3f7243[_0xc51b('0x85')]||!_0x3f7243['transcribeRegion']||!_0x3f7243[_0xc51b('0x86')]||!_0x3f7243['bucket']){throw new db[(_0xc51b('0x58'))][(_0xc51b('0x59'))](_0xc51b('0x87'));}if(_0x5ba37a[_0xc51b('0x50')]['runSentiment']&&(!_0x3f7243[_0xc51b('0x88')]||!_0x3f7243[_0xc51b('0x89')]||!_0x3f7243[_0xc51b('0x8a')]||!_0x3f7243[_0xc51b('0x86')]||!_0x3f7243[_0xc51b('0x77')])){throw new db[(_0xc51b('0x58'))]['ValidationError'](_0xc51b('0x8b'));}return db[_0xc51b('0x8c')][_0xc51b('0x80')]({'where':{'id':_0x3f7243['transcribeAccountId']}});}})['then'](function(_0x59eaeb){if(!_0x59eaeb){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x59eaeb[_0xc51b('0x8d')]||!_0x59eaeb[_0xc51b('0x8e')]){throw new db[(_0xc51b('0x58'))][(_0xc51b('0x59'))](_0xc51b('0x8f'));}_0xd96bae=_0x59eaeb;return getBucketslist(_0xd96bae[_0xc51b('0x8d')],_0xd96bae[_0xc51b('0x8e')],_0x3f7243[_0xc51b('0x90')]);})[_0xc51b('0x27')](function(_0x45a9a7){if(_0x45a9a7&&_0x45a9a7[_0xc51b('0x91')]){var _0x4b1c92=_[_0xc51b('0x4e')](_0x45a9a7[_0xc51b('0x91')],function(_0x4a0d0b){return _0x4a0d0b[_0xc51b('0x92')]===_0x3f7243[_0xc51b('0x77')];});if(!_0x4b1c92){logger['info'](util[_0xc51b('0x35')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x5ba37a[_0xc51b('0x4c')]['id'],_0x3f7243['bucket']));return createBucket(_0xd96bae[_0xc51b('0x8d')],_0xd96bae[_0xc51b('0x8e')],_0x3f7243[_0xc51b('0x90')],_0x3f7243[_0xc51b('0x77')]);}logger['info'](util['format'](_0xc51b('0x93'),_0x5ba37a[_0xc51b('0x4c')]['id'],_0x3f7243[_0xc51b('0x77')]));return;}})[_0xc51b('0x27')](function(_0x17a693){if(_0x30025f['transcribeStatus']===_0xc51b('0x94')){return transcribe(_0x5ba37a[_0xc51b('0x4c')]['id'],_0xd96bae['data1'],_0xd96bae[_0xc51b('0x8e')],_0x3f7243[_0xc51b('0x90')],_0x3f7243[_0xc51b('0x77')],_0x30025f[_0xc51b('0x54')],_0x3f7243['language']);}else{logger[_0xc51b('0x69')](util[_0xc51b('0x35')](_0xc51b('0x95'),_0x5ba37a[_0xc51b('0x4c')]['id']));return{'transcribeStatus':_0xc51b('0x96')};}})['then'](function(_0x4d52c1){if(_0x4d52c1){_0x4d52c1[_0xc51b('0x97')]=_0x5ba37a[_0xc51b('0x50')][_0xc51b('0x98')];return _0x30025f[_0xc51b('0x99')](_0x4d52c1);}})[_0xc51b('0x27')](respondWithResult(_0x2a02ce,null))[_0xc51b('0x4a')](handleError(_0x2a02ce,null));};function writeFile(_0x583d7b,_0x5c4813){return new Promise(function(_0x297e03,_0x3770de){fs['writeFile'](_0x5c4813,_0x583d7b,function(_0xa0333f,_0x29cda1){if(_0xa0333f){return _0x3770de(_0xa0333f);}else{return _0x297e03(_0x29cda1);}});});}exports[_0xc51b('0x9a')]=function(_0x25c67f,_0x3a6764,_0x547c19){return db[_0xc51b('0x30')][_0xc51b('0x80')]({'where':{'id':_0x25c67f[_0xc51b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3a6764))[_0xc51b('0x27')](function(_0x1d5ac1){if(_0x1d5ac1&&_0x1d5ac1['fileText']){var _0x357c58=_0x1d5ac1[_0xc51b('0x9b')];var _0x3efbbe=config[_0xc51b('0x9c')]+'/server/files/transcribes/transcribe_'+_0x1d5ac1['id']+_0xc51b('0x9d');if(fs[_0xc51b('0x64')](_0x3efbbe)){return _0x3efbbe;}return writeFile(_0x357c58,_0x3efbbe)[_0xc51b('0x27')](function(){return _0x3efbbe;});}else{throw new db[(_0xc51b('0x58'))][(_0xc51b('0x59'))](_0xc51b('0x9e'));}})[_0xc51b('0x27')](function(_0x5e1622){return _0x3a6764['download'](_0x5e1622);})[_0xc51b('0x4a')](handleError(_0x3a6764));};
\ No newline at end of file
+var _0xf31e=['where','merge','include','rows','catch','params','length','options','create','body','find','describe','download','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','$and','push','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','runTranscribe','Setting','findOne','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','data1','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','save','then','destroy','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','format','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter'];(function(_0xd5709b,_0x101823){var _0x3dc484=function(_0x28a409){while(--_0x28a409){_0xd5709b['push'](_0xd5709b['shift']());}};_0x3dc484(++_0x101823);}(_0xf31e,0x16e));var _0xef31=function(_0x238440,_0x1f2e93){_0x238440=_0x238440-0x0;var _0x495bcc=_0xf31e[_0x238440];return _0x495bcc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xef31('0x0'));var jsonpatch=require(_0xef31('0x1'));var rp=require(_0xef31('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xef31('0x3'));var path=require(_0xef31('0x4'));var sox=require(_0xef31('0x5'));var csv=require('to-csv');var ejs=require(_0xef31('0x6'));var fs=require('fs');var fs_extra=require(_0xef31('0x7'));var _=require('lodash');var squel=require(_0xef31('0x8'));var crypto=require(_0xef31('0x9'));var jsforce=require(_0xef31('0xa'));var deskjs=require(_0xef31('0xb'));var toCsv=require(_0xef31('0xc'));var querystring=require('querystring');var Papa=require(_0xef31('0xd'));var AWS=require(_0xef31('0xe'));var uuidv4=require('uuid/v4');var Redis=require(_0xef31('0xf'));var authService=require(_0xef31('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xef31('0x11'));var hardwareService=require(_0xef31('0x12'));var logger=require(_0xef31('0x13'))(_0xef31('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xef31('0x15'));var db=require(_0xef31('0x16'))['db'];function respondWithStatusCode(_0x238833,_0x341457){_0x341457=_0x341457||0xcc;return function(_0x5ee79d){if(_0x5ee79d){return _0x238833[_0xef31('0x17')](_0x341457);}return _0x238833[_0xef31('0x18')](_0x341457)[_0xef31('0x19')]();};}function respondWithResult(_0x13b33a,_0x1af1b7){_0x1af1b7=_0x1af1b7||0xc8;return function(_0x487adc){if(_0x487adc){return _0x13b33a[_0xef31('0x18')](_0x1af1b7)['json'](_0x487adc);}};}function respondWithFilteredResult(_0x5acaf9,_0x38e597){return function(_0xcd940d){if(_0xcd940d){var _0x2f0275=typeof _0x38e597[_0xef31('0x1a')]==='undefined'&&typeof _0x38e597['limit']==='undefined';var _0x373f2d=_0xcd940d[_0xef31('0x1b')];var _0x186ee4=_0x2f0275?0x0:_0x38e597[_0xef31('0x1a')];var _0x5c3844=_0x2f0275?_0xcd940d[_0xef31('0x1b')]:_0x38e597[_0xef31('0x1a')]+_0x38e597[_0xef31('0x1c')];var _0x2bd7ad;if(_0x5c3844>=_0x373f2d){_0x5c3844=_0x373f2d;_0x2bd7ad=0xc8;}else{_0x2bd7ad=0xce;}_0x5acaf9['status'](_0x2bd7ad);return _0x5acaf9[_0xef31('0x1d')](_0xef31('0x1e'),_0x186ee4+'-'+_0x5c3844+'/'+_0x373f2d)[_0xef31('0x1f')](_0xcd940d);}return null;};}function patchUpdates(_0x1431d1){return function(_0x5ccf15){try{jsonpatch[_0xef31('0x20')](_0x5ccf15,_0x1431d1,!![]);}catch(_0x221e90){return BPromise['reject'](_0x221e90);}return _0x5ccf15[_0xef31('0x21')]();};}function saveUpdates(_0x5c1968,_0x29fc28){return function(_0x3c4620){if(_0x3c4620){return _0x3c4620['update'](_0x5c1968)[_0xef31('0x22')](function(_0x436210){return _0x436210;});}return null;};}function removeEntity(_0x3d4128,_0x6f8507){return function(_0x5c0b49){if(_0x5c0b49){return _0x5c0b49[_0xef31('0x23')]()[_0xef31('0x22')](function(){_0x3d4128['status'](0xcc)[_0xef31('0x19')]();});}};}function handleEntityNotFound(_0x570371,_0x2e760f){return function(_0x13ee9e){if(!_0x13ee9e){_0x570371[_0xef31('0x17')](0x194);}return _0x13ee9e;};}function handleError(_0x37283c,_0x169f79){_0x169f79=_0x169f79||0x1f4;return function(_0x3f2c36){logger['error'](_0x3f2c36[_0xef31('0x24')]);if(_0x3f2c36[_0xef31('0x25')]){delete _0x3f2c36['name'];}_0x37283c[_0xef31('0x18')](_0x169f79)[_0xef31('0x26')](_0x3f2c36);};}exports['index']=function(_0x4f0b94,_0x182943){var _0x4d83da={},_0x2e9cb3={},_0x53f554={'count':0x0,'rows':[]};var _0x3f5216=_[_0xef31('0x27')](db[_0xef31('0x28')][_0xef31('0x29')],function(_0x5c4fc5){return{'name':_0x5c4fc5[_0xef31('0x2a')],'type':_0x5c4fc5[_0xef31('0x2b')][_0xef31('0x2c')]};});_0x2e9cb3[_0xef31('0x2d')]=_['differenceBy'](_[_0xef31('0x27')](_0x3f5216,_0xef31('0x25')),[_0xef31('0x2e')]);_0x2e9cb3[_0xef31('0x2f')]=_[_0xef31('0x30')](_0x4f0b94[_0xef31('0x2f')]);_0x2e9cb3[_0xef31('0x31')]=_[_0xef31('0x32')](_0x2e9cb3[_0xef31('0x2d')],_0x2e9cb3[_0xef31('0x2f')]);_0x4d83da[_0xef31('0x33')]=_['intersection'](_0x2e9cb3['model'],qs[_0xef31('0x34')](_0x4f0b94['query'][_0xef31('0x34')]));_0x4d83da[_0xef31('0x33')]=_0x4d83da['attributes']['length']?_0x4d83da[_0xef31('0x33')]:_0x2e9cb3[_0xef31('0x2d')];if(!_0x4f0b94['query']['hasOwnProperty'](_0xef31('0x35'))){_0x4d83da[_0xef31('0x1c')]=qs[_0xef31('0x1c')](_0x4f0b94[_0xef31('0x2f')][_0xef31('0x1c')]);_0x4d83da[_0xef31('0x1a')]=qs[_0xef31('0x1a')](_0x4f0b94['query']['offset']);}_0x4d83da['order']=qs[_0xef31('0x36')](_0x4f0b94[_0xef31('0x2f')][_0xef31('0x36')]);_0x4d83da['where']=qs['filters'](_[_0xef31('0x37')](_0x4f0b94[_0xef31('0x2f')],_0x2e9cb3[_0xef31('0x31')]),_0x3f5216);if(_0x4f0b94[_0xef31('0x2f')][_0xef31('0x38')]){_0x4d83da[_0xef31('0x39')]=_[_0xef31('0x3a')](_0x4d83da[_0xef31('0x39')],{'$or':_[_0xef31('0x27')](_0x3f5216,function(_0x1f8959){if(_0x1f8959[_0xef31('0x2b')]!=='VIRTUAL'){var _0x4bd568={};_0x4bd568[_0x1f8959[_0xef31('0x25')]]={'$like':'%'+_0x4f0b94[_0xef31('0x2f')]['filter']+'%'};return _0x4bd568;}})});}_0x4d83da=_[_0xef31('0x3a')]({},_0x4d83da,_0x4f0b94['options']);var _0x5b8501={'where':_0x4d83da[_0xef31('0x39')]};return db[_0xef31('0x28')][_0xef31('0x1b')](_0x5b8501)[_0xef31('0x22')](function(_0x1ae46e){_0x53f554[_0xef31('0x1b')]=_0x1ae46e;if(_0x4f0b94[_0xef31('0x2f')]['includeAll']){_0x4d83da[_0xef31('0x3b')]=[{'all':!![]}];}return db[_0xef31('0x28')]['findAll'](_0x4d83da);})[_0xef31('0x22')](function(_0xf2338a){_0x53f554[_0xef31('0x3c')]=_0xf2338a;return _0x53f554;})['then'](respondWithFilteredResult(_0x182943,_0x4d83da))[_0xef31('0x3d')](handleError(_0x182943,null));};exports['show']=function(_0x4c5e09,_0x4ae2e7){var _0x2d5471={'raw':![],'where':{'id':_0x4c5e09[_0xef31('0x3e')]['id']}},_0x4166bd={};_0x4166bd[_0xef31('0x2d')]=_[_0xef31('0x30')](db['VoiceRecording'][_0xef31('0x29')]);_0x4166bd[_0xef31('0x2f')]=_[_0xef31('0x30')](_0x4c5e09[_0xef31('0x2f')]);_0x4166bd[_0xef31('0x31')]=_['intersection'](_0x4166bd[_0xef31('0x2d')],_0x4166bd[_0xef31('0x2f')]);_0x2d5471[_0xef31('0x33')]=_[_0xef31('0x32')](_0x4166bd[_0xef31('0x2d')],qs[_0xef31('0x34')](_0x4c5e09[_0xef31('0x2f')][_0xef31('0x34')]));_0x2d5471[_0xef31('0x33')]=_0x2d5471['attributes'][_0xef31('0x3f')]?_0x2d5471[_0xef31('0x33')]:_0x4166bd[_0xef31('0x2d')];if(_0x4c5e09['query']['includeAll']){_0x2d5471[_0xef31('0x3b')]=[{'all':!![]}];}_0x2d5471=_[_0xef31('0x3a')]({},_0x2d5471,_0x4c5e09[_0xef31('0x40')]);return db[_0xef31('0x28')]['find'](_0x2d5471)[_0xef31('0x22')](handleEntityNotFound(_0x4ae2e7,null))[_0xef31('0x22')](respondWithResult(_0x4ae2e7,null))[_0xef31('0x3d')](handleError(_0x4ae2e7,null));};exports[_0xef31('0x41')]=function(_0x22328c,_0xf89613){return db[_0xef31('0x28')][_0xef31('0x41')](_0x22328c[_0xef31('0x42')],{})['then'](respondWithResult(_0xf89613,0xc9))['catch'](handleError(_0xf89613,null));};exports['update']=function(_0x2de7a8,_0x2ddbb5){if(_0x2de7a8[_0xef31('0x42')]['id']){delete _0x2de7a8['body']['id'];}return db[_0xef31('0x28')][_0xef31('0x43')]({'where':{'id':_0x2de7a8[_0xef31('0x3e')]['id']}})[_0xef31('0x22')](handleEntityNotFound(_0x2ddbb5,null))[_0xef31('0x22')](saveUpdates(_0x2de7a8[_0xef31('0x42')],null))[_0xef31('0x22')](respondWithResult(_0x2ddbb5,null))[_0xef31('0x3d')](handleError(_0x2ddbb5,null));};exports[_0xef31('0x44')]=function(_0x45921e,_0x51c669){return db[_0xef31('0x28')]['describe']()[_0xef31('0x22')](respondWithResult(_0x51c669,null))[_0xef31('0x3d')](handleError(_0x51c669,null));};exports[_0xef31('0x45')]=function(_0x2e682e,_0x4627d7,_0x5aafaa){var _0x534f44=require('../../components/encryptor');var _0xe7ab60=![];var _0x5c400e={};if(_0x2e682e[_0xef31('0x2f')][_0xef31('0x2b')]&&_0x2e682e[_0xef31('0x2f')][_0xef31('0x2b')]===_0xef31('0x46')){_0x5c400e[_0xef31('0x46')]=_0x2e682e['params']['id'];}else{_0x5c400e['id']=_0x2e682e[_0xef31('0x3e')]['id'];}return db[_0xef31('0x28')]['find']({'where':_0x5c400e,'attributes':['id',_0xef31('0x47')],'raw':!![]})[_0xef31('0x22')](handleEntityNotFound(_0x4627d7,null))[_0xef31('0x22')](function(_0x45d8f8){if(_0x45d8f8){var _0x503131=_0x45d8f8[_0xef31('0x47')];var _0x2c46d6=util[_0xef31('0x2e')](_0xef31('0x48'),_0x503131);if(fs['existsSync'](_0x2c46d6)){_0xe7ab60=!![];return _0x534f44[_0xef31('0x49')](_0x2c46d6,_0x503131,config[_0xef31('0x4a')][_0xef31('0x4b')])['then'](function(){return _0x45d8f8;});}return _0x45d8f8;}})[_0xef31('0x22')](function(_0x3ce2ab){if(_0x3ce2ab){var _0x2636f8=_0x3ce2ab[_0xef31('0x47')];if(!fs[_0xef31('0x4c')](_0x2636f8)){throw new db[(_0xef31('0x4d'))][(_0xef31('0x4e'))]('VoiceRecording\x20not\x20found');}if(_0x3ce2ab[_0xef31('0x4f')]){return _0x4627d7[_0xef31('0x45')](_0x2636f8,_0x3ce2ab['filename']+path[_0xef31('0x50')](_0x2636f8),function(){if(_0xe7ab60){fs[_0xef31('0x51')](_0x2636f8);}});}else{return _0x4627d7[_0xef31('0x45')](_0x2636f8,function(_0x2ab118){if(_0xe7ab60){fs[_0xef31('0x51')](_0x2636f8);}});}}})[_0xef31('0x3d')](function(_0x7f48f2){if(_0x7f48f2[_0xef31('0x52')]===_0xef31('0x53')){_0x4627d7[_0xef31('0x18')](0x194)['send'](_0xef31('0x54'));}else{return handleError(_0x4627d7,null);}});};exports[_0xef31('0x55')]=function(_0x34a4fb,_0x132f08,_0x179b82){var _0x510d8b=require(_0xef31('0x56'));var _0x52a97a=![];var _0x4a104f={'$and':[db[_0xef31('0x57')]['where'](db[_0xef31('0x57')]['fn'](_0xef31('0x58'),db[_0xef31('0x57')][_0xef31('0x59')]('uniqueid')),_0x34a4fb[_0xef31('0x2f')]['token'])]};if(_0x34a4fb[_0xef31('0x2f')][_0xef31('0x2b')]&&_0x34a4fb[_0xef31('0x2f')]['type']===_0xef31('0x46')){_0x4a104f[_0xef31('0x5a')][_0xef31('0x5b')]({'uniqueid':_0x34a4fb['params']['id']});}else{_0x4a104f[_0xef31('0x5a')][_0xef31('0x5b')]({'id':_0x34a4fb['params']['id']});}return db[_0xef31('0x28')][_0xef31('0x43')]({'where':_0x4a104f,'attributes':['id',_0xef31('0x47')],'raw':!![]})[_0xef31('0x22')](handleEntityNotFound(_0x132f08,null))['then'](function(_0x51b501){if(_0x51b501){var _0x51f837=util['format'](_0xef31('0x48'),_0x51b501[_0xef31('0x47')]);if(fs[_0xef31('0x4c')](_0x51f837)){_0x52a97a=!![];return _0x510d8b[_0xef31('0x49')](_0x51f837,_0x51b501[_0xef31('0x47')],config[_0xef31('0x4a')][_0xef31('0x4b')])[_0xef31('0x22')](function(){return _0x51b501;});}return _0x51b501;}})[_0xef31('0x22')](function(_0x50c1cc){if(_0x50c1cc){if(!fs[_0xef31('0x4c')](_0x50c1cc[_0xef31('0x47')])){throw new db[(_0xef31('0x4d'))][(_0xef31('0x4e'))](_0xef31('0x53'));}if(_0x50c1cc[_0xef31('0x4f')]){return _0x132f08['download'](_0x50c1cc['value'],_0x50c1cc[_0xef31('0x4f')]+path[_0xef31('0x50')](_0x50c1cc['value']),function(){if(_0x52a97a){fs[_0xef31('0x51')](_0x50c1cc[_0xef31('0x47')]);}});}else{return _0x132f08['download'](_0x50c1cc[_0xef31('0x47')],function(_0x515d1c){if(_0x52a97a){fs[_0xef31('0x51')](_0x50c1cc[_0xef31('0x47')]);}});}}})[_0xef31('0x3d')](handleError(_0x132f08,null));};exports[_0xef31('0x23')]=function(_0x3e81d2,_0x25c93f){return db['VoiceRecording'][_0xef31('0x43')]({'where':{'id':_0x3e81d2[_0xef31('0x3e')]['id']}})[_0xef31('0x22')](function(_0x3cf9d3){if(_[_0xef31('0x5c')](_0x3cf9d3)){throw new ReferenceError(_0xef31('0x5d'));}return _0x3cf9d3;})[_0xef31('0x22')](function(_0x3cf49c){var _0x598b90=_0x3cf49c[_0xef31('0x47')];logger['info'](_0xef31('0x5e'),_0x598b90);if(!_[_0xef31('0x5c')](_0x3cf49c[_0xef31('0x47')])&&fs[_0xef31('0x4c')](_0x598b90)){logger[_0xef31('0x5f')]('File:\x20\x22'+_0x598b90+_0xef31('0x60'));fs[_0xef31('0x61')](_0x598b90);}_0x598b90=_0x598b90+_0xef31('0x62');if(!_[_0xef31('0x5c')](_0x3cf49c[_0xef31('0x47')])&&fs['existsSync'](_0x598b90)){logger[_0xef31('0x5f')](_0xef31('0x63')+_0x598b90+_0xef31('0x60'));fs[_0xef31('0x61')](_0x598b90);}return _0x3cf49c;})['then'](function(_0x13fe8e){if(!_0x13fe8e)throw new InternalError();return _0x13fe8e[_0xef31('0x23')]();})[_0xef31('0x22')](function(){_0x25c93f['status'](0xcc)[_0xef31('0x19')]();})['catch'](handleError(_0x25c93f,null));};function getBucketslist(_0x4c5da0,_0x182d9c,_0x30b970){return new Promise(function(_0x2aac7b,_0x1c41b6){var _0x41340f=new AWS['S3']({'accessKeyId':_0x182d9c,'secretAccessKey':_0x4c5da0,'region':_0x30b970});_0x41340f[_0xef31('0x64')]({},function(_0x25fca8,_0x510de9){if(_0x25fca8){return _0x1c41b6(_0x25fca8);}else{return _0x2aac7b(_0x510de9);}});});}function createBucket(_0x1dfc46,_0x46c70c,_0x35153a,_0x1cc8f1){return new Promise(function(_0x3df8f5,_0x5b7ed0){var _0x4549e3=new AWS['S3']({'accessKeyId':_0x46c70c,'secretAccessKey':_0x1dfc46,'region':_0x35153a});_0x4549e3['createBucket']({'Bucket':_0x1cc8f1},function(_0x39ee27,_0x2ad8e2){if(_0x39ee27){return _0x5b7ed0(_0x39ee27);}else{return _0x3df8f5(_0x2ad8e2);}});});}function uploadFile(_0x4d3470,_0x13335e,_0xf14868,_0x53f34f,_0x4979d9,_0x5be5c4){return new Promise(function(_0x1a9418,_0xd1f1af){var _0x4b7b22=new AWS['S3']({'accessKeyId':_0x13335e,'secretAccessKey':_0x4d3470,'region':_0xf14868});_0x4b7b22['upload']({'Bucket':_0x53f34f,'Key':_0x4979d9,'Body':_0x5be5c4},function(_0x2010db,_0x196571){if(_0x2010db){return _0xd1f1af(_0x2010db);}else{return _0x1a9418(_0x196571);}});});}function startTranscribe(_0x96f3c6,_0x5b5225,_0x3a1646,_0x6562d8,_0x197e52,_0x2d6b8a){return new Promise(function(_0x44c0b7,_0x1c67f7){var _0x2285b0=new AWS['TranscribeService']({'accessKeyId':_0x5b5225,'secretAccessKey':_0x96f3c6,'region':_0x3a1646});_0x2285b0['startTranscriptionJob']({'TranscriptionJobName':_0x6562d8,'LanguageCode':_0x197e52,'Media':{'MediaFileUri':_0x2d6b8a}},function(_0x31cdf3,_0x548bf0){if(_0x31cdf3){return _0x1c67f7(_0x31cdf3);}else{return _0x44c0b7(_0x548bf0);}});});}function transcribe(_0x56d4d5,_0x244e0f,_0x5a8824,_0x2d257b,_0x3ae3fa,_0x5540dc,_0x203698){return new Promise(function(_0xfd7134,_0xb2bb24){var _0x4dbafb={};logger[_0xef31('0x5f')](util[_0xef31('0x2e')](_0xef31('0x65'),_0x56d4d5,_0x3ae3fa));return uploadFile(_0x244e0f,_0x5a8824,_0x2d257b,_0x3ae3fa,path['basename'](_0x5540dc),fs[_0xef31('0x66')](_0x5540dc))[_0xef31('0x22')](function(_0x2d8114){logger[_0xef31('0x5f')](util[_0xef31('0x2e')](_0xef31('0x67'),_0x56d4d5,_0x3ae3fa,_0x2d8114[_0xef31('0x68')]));_0x4dbafb[_0xef31('0x69')]=_0x2d8114[_0xef31('0x6a')];_0x4dbafb[_0xef31('0x6b')]=_0x2d8114[_0xef31('0x68')];logger[_0xef31('0x5f')](util[_0xef31('0x2e')](_0xef31('0x6c'),_0x56d4d5));return startTranscribe(_0x244e0f,_0x5a8824,_0x2d257b,uuidv4(),_0x203698,_0x2d8114[_0xef31('0x68')]);})[_0xef31('0x22')](function(_0x5c60d6){logger[_0xef31('0x5f')](util['format'](_0xef31('0x6d'),_0x56d4d5,_0x5c60d6[_0xef31('0x6e')][_0xef31('0x6f')]));_0x4dbafb['transcribeName']=_0x5c60d6[_0xef31('0x6e')][_0xef31('0x6f')];_0x4dbafb['transcribeStatus']=_0x5c60d6['TranscriptionJob']['TranscriptionJobStatus'];return _0xfd7134(_0x4dbafb);})[_0xef31('0x3d')](function(_0x127162){return _0xb2bb24(_0x127162);});});}exports[_0xef31('0x70')]=function(_0x14d080,_0x35438c,_0x21c3c4){var _0x11516e;var _0x5220ad;var _0x21eefd;var _0x3d044d=require(_0xef31('0x56'));return db[_0xef31('0x28')]['findOne']({'where':{'id':_0x14d080[_0xef31('0x3e')]['id']}})['then'](function(_0x297b4c){if(_0x297b4c){var _0xb776ef=util[_0xef31('0x2e')](_0xef31('0x48'),_0x297b4c[_0xef31('0x47')]);if(fs[_0xef31('0x4c')](_0xb776ef)){cypher=!![];return _0x3d044d['decryptFile'](_0xb776ef,_0x297b4c[_0xef31('0x47')],config[_0xef31('0x4a')][_0xef31('0x4b')])[_0xef31('0x22')](function(){return _0x297b4c;});}return _0x297b4c;}})[_0xef31('0x22')](function(_0x267bbd){if(!_0x267bbd){throw new db[(_0xef31('0x4d'))][(_0xef31('0x4e'))]('Voice\x20Recording\x20not\x20found');}_0x5220ad=_0x267bbd;return db[_0xef31('0x71')][_0xef31('0x72')]({'where':{'id':0x1}});})[_0xef31('0x22')](handleEntityNotFound(_0x35438c,null))[_0xef31('0x22')](function(_0x319ab7){if(_0x319ab7){_0x11516e=_0x319ab7;if(!_0x11516e['transcribe']||!_0x11516e[_0xef31('0x73')]||!_0x11516e['transcribeRegion']||!_0x11516e[_0xef31('0x74')]||!_0x11516e['bucket']){throw new db[(_0xef31('0x4d'))][(_0xef31('0x4e'))](_0xef31('0x75'));}if(_0x14d080[_0xef31('0x42')][_0xef31('0x76')]&&(!_0x11516e[_0xef31('0x77')]||!_0x11516e[_0xef31('0x78')]||!_0x11516e[_0xef31('0x79')]||!_0x11516e[_0xef31('0x74')]||!_0x11516e[_0xef31('0x69')])){throw new db[(_0xef31('0x4d'))][(_0xef31('0x4e'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xef31('0x7a')][_0xef31('0x72')]({'where':{'id':_0x11516e[_0xef31('0x73')]}});}})[_0xef31('0x22')](function(_0x16b03c){if(!_0x16b03c){throw new db[(_0xef31('0x4d'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x16b03c[_0xef31('0x7b')]||!_0x16b03c['data2']){throw new db[(_0xef31('0x4d'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x21eefd=_0x16b03c;return getBucketslist(_0x21eefd['data1'],_0x21eefd['data2'],_0x11516e[_0xef31('0x7c')]);})['then'](function(_0x334b6f){if(_0x334b6f&&_0x334b6f[_0xef31('0x7d')]){var _0x15bc81=_[_0xef31('0x43')](_0x334b6f['Buckets'],function(_0x3d695b){return _0x3d695b[_0xef31('0x7e')]===_0x11516e[_0xef31('0x69')];});if(!_0x15bc81){logger[_0xef31('0x5f')](util[_0xef31('0x2e')](_0xef31('0x7f'),_0x14d080[_0xef31('0x3e')]['id'],_0x11516e[_0xef31('0x69')]));return createBucket(_0x21eefd[_0xef31('0x7b')],_0x21eefd[_0xef31('0x80')],_0x11516e[_0xef31('0x7c')],_0x11516e['bucket']);}logger[_0xef31('0x5f')](util[_0xef31('0x2e')](_0xef31('0x81'),_0x14d080[_0xef31('0x3e')]['id'],_0x11516e[_0xef31('0x69')]));return;}})[_0xef31('0x22')](function(_0x12daf3){if(_0x5220ad[_0xef31('0x82')]===_0xef31('0x83')){return transcribe(_0x14d080['params']['id'],_0x21eefd[_0xef31('0x7b')],_0x21eefd['data2'],_0x11516e['transcribeRegion'],_0x11516e[_0xef31('0x69')],_0x5220ad[_0xef31('0x47')],_0x11516e[_0xef31('0x74')]);}else{logger[_0xef31('0x5f')](util[_0xef31('0x2e')](_0xef31('0x84'),_0x14d080[_0xef31('0x3e')]['id']));return{'transcribeStatus':_0xef31('0x85')};}})[_0xef31('0x22')](function(_0x2ee322){if(_0x2ee322){_0x2ee322['tempSentiment']=_0x14d080['body']['runSentiment'];return _0x5220ad[_0xef31('0x86')](_0x2ee322);}})[_0xef31('0x22')](respondWithResult(_0x35438c,null))['catch'](handleError(_0x35438c,null));};function writeFile(_0x168983,_0x940777){return new Promise(function(_0xe1f803,_0x1cc3f0){fs[_0xef31('0x87')](_0x940777,_0x168983,function(_0x1ba8a7,_0x4cd791){if(_0x1ba8a7){return _0x1cc3f0(_0x1ba8a7);}else{return _0xe1f803(_0x4cd791);}});});}exports[_0xef31('0x88')]=function(_0x5d4e61,_0x1c776f,_0x374441){return db[_0xef31('0x28')][_0xef31('0x72')]({'where':{'id':_0x5d4e61[_0xef31('0x3e')]['id']}})[_0xef31('0x22')](handleEntityNotFound(_0x1c776f))[_0xef31('0x22')](function(_0x49ee27){if(_0x49ee27&&_0x49ee27[_0xef31('0x89')]){var _0x15bd10=_0x49ee27[_0xef31('0x89')];var _0x24d2b0=config[_0xef31('0x8a')]+_0xef31('0x8b')+_0x49ee27['id']+_0xef31('0x8c');if(fs[_0xef31('0x4c')](_0x24d2b0)){return _0x24d2b0;}return writeFile(_0x15bd10,_0x24d2b0)[_0xef31('0x22')](function(){return _0x24d2b0;});}else{throw new db['Sequelize'][(_0xef31('0x4e'))]('Transcript\x20not\x20available');}})[_0xef31('0x22')](function(_0x27da7c){return _0x1c776f[_0xef31('0x45')](_0x27da7c);})[_0xef31('0x3d')](handleError(_0x1c776f));};
\ No newline at end of file
index 3c197d7..46da3a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5525=['define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','moment','path','./voiceRecording.attributes','exports'];(function(_0x3befef,_0x2a1bd8){var _0x2edab8=function(_0x4020bf){while(--_0x4020bf){_0x3befef['push'](_0x3befef['shift']());}};_0x2edab8(++_0x2a1bd8);}(_0x5525,0x87));var _0x5552=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5525[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var logger=require(_0x5552('0x2'))(_0x5552('0x3'));var moment=require(_0x5552('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5552('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5552('0x6'));module[_0x5552('0x7')]=function(_0x5da9b2,_0x28df4f){return _0x5da9b2[_0x5552('0x8')](_0x5552('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x5552('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x52e1=['uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings'];(function(_0x4e8bf9,_0x39f545){var _0x5c8bf7=function(_0x3f4260){while(--_0x3f4260){_0x4e8bf9['push'](_0x4e8bf9['shift']());}};_0x5c8bf7(++_0x39f545);}(_0x52e1,0x175));var _0x152e=function(_0x23bb8e,_0x2395f5){_0x23bb8e=_0x23bb8e-0x0;var _0x3e5930=_0x52e1[_0x23bb8e];return _0x3e5930;};'use strict';var _=require(_0x152e('0x0'));var util=require(_0x152e('0x1'));var logger=require(_0x152e('0x2'))('api');var moment=require(_0x152e('0x3'));var BPromise=require('bluebird');var rp=require(_0x152e('0x4'));var fs=require('fs');var path=require(_0x152e('0x5'));var rimraf=require(_0x152e('0x6'));var config=require('../../config/environment');var attributes=require(_0x152e('0x7'));module[_0x152e('0x8')]=function(_0x20e56d,_0x57e69e){return _0x20e56d['define'](_0x152e('0x9'),attributes,{'tableName':_0x152e('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x152e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 51bd63d..00313e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x1c2aeb,_0x48433c){var _0x783379=function(_0x3e8820){while(--_0x3e8820){_0x1c2aeb['push'](_0x1c2aeb['shift']());}};_0x783379(++_0x48433c);}(_0xd943,0x15d));var _0x3d94=function(_0x2c0e59,_0x131be5){_0x2c0e59=_0x2c0e59-0x0;var _0x4a6196=_0xd943[_0x2c0e59];return _0x4a6196;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}exports[_0x3d94('0x14')]=function(_0x2acee3){var _0x1c35a8=this;return new Promise(function(_0x4afc92,_0x3ca0e3){return db[_0x3d94('0x15')]['update'](_0x2acee3[_0x3d94('0x16')],{'raw':_0x2acee3['options']?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x19')]||null:null,'attributes':_0x2acee3['options']?_0x2acee3['options'][_0x3d94('0x1a')]||null:null,'limit':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')]['limit']||null:null})[_0x3d94('0xa')](function(_0x2e8c91){logger[_0x3d94('0xb')](_0x3d94('0x14'),_0x2acee3);logger[_0x3d94('0x1b')](_0x3d94('0x14'),_0x2acee3,JSON[_0x3d94('0x1c')](_0x2e8c91));_0x4afc92(_0x2e8c91);})[_0x3d94('0x13')](function(_0xee7b8d){logger[_0x3d94('0xe')](_0x3d94('0x14'),_0xee7b8d[_0x3d94('0x11')],_0x2acee3);_0x3ca0e3(_0x1c35a8[_0x3d94('0xe')](0x1f4,_0xee7b8d[_0x3d94('0x11')]));});});};exports[_0x3d94('0x1d')]=function(_0x5b3b31){var _0x123183=this;return new Promise(function(_0x558fd2,_0x28a698){var _0x1d0a7a=require(_0x3d94('0x1e'));var _0x439173;return db[_0x3d94('0x1f')][_0x3d94('0x20')]({'attributes':['id',_0x3d94('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x584c4a){_0x439173=_0x584c4a;return db[_0x3d94('0x15')]['create'](_0x5b3b31['body']);})[_0x3d94('0xa')](function(_0x58c0d0){if(_0x439173[_0x3d94('0x21')]&&fs[_0x3d94('0x22')](_0x58c0d0[_0x3d94('0x23')])){var _0x4cef9c=util[_0x3d94('0x24')]('%s.cypher',_0x58c0d0[_0x3d94('0x23')]);return _0x1d0a7a['encryptFile'](_0x58c0d0[_0x3d94('0x23')],_0x4cef9c,config[_0x3d94('0x25')][_0x3d94('0x26')])[_0x3d94('0xa')](function(){fs['unlink'](_0x58c0d0[_0x3d94('0x23')]);logger['info'](_0x3d94('0x27'));return _0x58c0d0;});}return _0x58c0d0;})[_0x3d94('0xa')](function(_0x51d308){logger['info'](_0x3d94('0x1d'),_0x5b3b31);logger[_0x3d94('0x1b')](_0x3d94('0x1d'),_0x5b3b31,JSON['stringify'](_0x51d308));_0x558fd2(_0x51d308);})[_0x3d94('0x13')](function(_0x3d29fd){logger['error'](_0x3d94('0x1d'),_0x3d29fd[_0x3d94('0x11')],_0x5b3b31);_0x28a698(_0x123183[_0x3d94('0xe')](0x1f4,_0x3d29fd[_0x3d94('0x11')]));});});};
\ No newline at end of file
+var _0x7b84=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x7b84,0x17c));var _0x47b8=function(_0x4a9274,_0x5b16d2){_0x4a9274=_0x4a9274-0x0;var _0x2d177b=_0x7b84[_0x4a9274];return _0x2d177b;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('VoiceRecording,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}exports['UpdateVoiceRecording']=function(_0x4f7317){var _0x299195=this;return new Promise(function(_0x36faf1,_0x2797ac){return db['VoiceRecording']['update'](_0x4f7317['body'],{'raw':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317['options'][_0x47b8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1c')]||null:null,'attributes':_0x4f7317['options']?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1d')]||null:null,'limit':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1e')]||null:null})[_0x47b8('0xe')](function(_0x54f6bc){logger[_0x47b8('0xf')](_0x47b8('0x1f'),_0x4f7317);logger['debug'](_0x47b8('0x1f'),_0x4f7317,JSON[_0x47b8('0x14')](_0x54f6bc));_0x36faf1(_0x54f6bc);})[_0x47b8('0x19')](function(_0x142fb6){logger['error'](_0x47b8('0x1f'),_0x142fb6[_0x47b8('0x17')],_0x4f7317);_0x2797ac(_0x299195[_0x47b8('0x15')](0x1f4,_0x142fb6[_0x47b8('0x17')]));});});};exports[_0x47b8('0x20')]=function(_0xbf5ce9){var _0x40918f=this;return new Promise(function(_0x568c1e,_0x43fd49){var _0x1f719a=require('../../components/encryptor');var _0x195a66;return db[_0x47b8('0x21')][_0x47b8('0x22')]({'attributes':['id',_0x47b8('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x162d96){_0x195a66=_0x162d96;return db['VoiceRecording'][_0x47b8('0x24')](_0xbf5ce9[_0x47b8('0x25')]);})[_0x47b8('0xe')](function(_0x2e540d){if(_0x195a66['callRecordingEncryption']&&fs[_0x47b8('0x26')](_0x2e540d[_0x47b8('0x27')])){var _0x402e7c=util[_0x47b8('0x28')](_0x47b8('0x29'),_0x2e540d[_0x47b8('0x27')]);return _0x1f719a['encryptFile'](_0x2e540d['value'],_0x402e7c,config['secrets'][_0x47b8('0x2a')])[_0x47b8('0xe')](function(){fs[_0x47b8('0x2b')](_0x2e540d['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x2e540d;});}return _0x2e540d;})['then'](function(_0x347769){logger[_0x47b8('0xf')](_0x47b8('0x20'),_0xbf5ce9);logger[_0x47b8('0x12')](_0x47b8('0x20'),_0xbf5ce9,JSON[_0x47b8('0x14')](_0x347769));_0x568c1e(_0x347769);})[_0x47b8('0x19')](function(_0x460dcc){logger[_0x47b8('0x15')]('CreateVoiceRecording',_0x460dcc['message'],_0xbf5ce9);_0x43fd49(_0x40918f[_0x47b8('0x15')](0x1f4,_0x460dcc[_0x47b8('0x17')]));});});};
\ No newline at end of file
index 68c8f12..ebd394c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78b7=['show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x134c44,_0x3775fb){var _0xb2964f=function(_0x5d5884){while(--_0x5d5884){_0x134c44['push'](_0x134c44['shift']());}};_0xb2964f(++_0x3775fb);}(_0x78b7,0x1be));var _0x778b=function(_0x5b091e,_0x4d0ea2){_0x5b091e=_0x5b091e-0x0;var _0x2ef245=_0x78b7[_0x5b091e];return _0x2ef245;};'use strict';var multer=require(_0x778b('0x0'));var util=require(_0x778b('0x1'));var path=require(_0x778b('0x2'));var timeout=require(_0x778b('0x3'));var express=require(_0x778b('0x4'));var router=express[_0x778b('0x5')]();var fs_extra=require(_0x778b('0x6'));var auth=require(_0x778b('0x7'));var interaction=require(_0x778b('0x8'));var config=require(_0x778b('0x9'));var controller=require(_0x778b('0xa'));router[_0x778b('0xb')]('/',auth[_0x778b('0xc')](),controller[_0x778b('0xd')]);router[_0x778b('0xb')]('/describe',auth[_0x778b('0xc')](),controller[_0x778b('0xe')]);router['get'](_0x778b('0xf'),auth[_0x778b('0xc')](),controller[_0x778b('0x10')]);router[_0x778b('0x11')]('/',auth[_0x778b('0xc')](),controller[_0x778b('0x12')]);router[_0x778b('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x778b('0xf'),auth['isAuthenticated'](),controller[_0x778b('0x14')]);module[_0x778b('0x15')]=router;
\ No newline at end of file
+var _0x326f=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','show','post','/:id','destroy'];(function(_0x278aa2,_0x1ffa84){var _0x11488b=function(_0x4678e1){while(--_0x4678e1){_0x278aa2['push'](_0x278aa2['shift']());}};_0x11488b(++_0x1ffa84);}(_0x326f,0x1a3));var _0xf326=function(_0x365682,_0x130257){_0x365682=_0x365682-0x0;var _0x25e007=_0x326f[_0x365682];return _0x25e007;};'use strict';var multer=require(_0xf326('0x0'));var util=require(_0xf326('0x1'));var path=require(_0xf326('0x2'));var timeout=require(_0xf326('0x3'));var express=require('express');var router=express[_0xf326('0x4')]();var fs_extra=require(_0xf326('0x5'));var auth=require(_0xf326('0x6'));var interaction=require(_0xf326('0x7'));var config=require(_0xf326('0x8'));var controller=require(_0xf326('0x9'));router[_0xf326('0xa')]('/',auth[_0xf326('0xb')](),controller[_0xf326('0xc')]);router[_0xf326('0xa')]('/describe',auth[_0xf326('0xb')](),controller[_0xf326('0xd')]);router[_0xf326('0xa')]('/:id',auth[_0xf326('0xb')](),controller[_0xf326('0xe')]);router[_0xf326('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf326('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf326('0x10'),auth[_0xf326('0xb')](),controller[_0xf326('0x11')]);module[_0xf326('0x12')]=router;
\ No newline at end of file
index 5b504a7..bf80750 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1d7=['attended','STRING','ENUM','moment','blind'];(function(_0x3fb0bb,_0x639d5){var _0x469750=function(_0x397304){while(--_0x397304){_0x3fb0bb['push'](_0x3fb0bb['shift']());}};_0x469750(++_0x639d5);}(_0xa1d7,0x94));var _0x7a1d=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0xa1d7[_0x136619];return _0x38c4a5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7a1d('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x7a1d('0x1'),_0x7a1d('0x2'))},'result':{'type':Sequelize[_0x7a1d('0x3')]},'transfererchannel':{'type':Sequelize[_0x7a1d('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x7a1d('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x7a1d('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x7a1d('0x3')]},'transfereechannel':{'type':Sequelize[_0x7a1d('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x7a1d('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x7a1d('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7a1d('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x7a1d('0x3')]},'transfereecontext':{'type':Sequelize[_0x7a1d('0x3')]},'transfereeexten':{'type':Sequelize[_0x7a1d('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x7a1d('0x4')]('Yes','No')},'context':{'type':Sequelize[_0x7a1d('0x3')]},'extension':{'type':Sequelize[_0x7a1d('0x3')]}};
\ No newline at end of file
+var _0x28d3=['sequelize','exports','blind','attended','STRING','Yes'];(function(_0x52f29a,_0x8fb750){var _0x1d3592=function(_0x35cc30){while(--_0x35cc30){_0x52f29a['push'](_0x52f29a['shift']());}};_0x1d3592(++_0x8fb750);}(_0x28d3,0x6c));var _0x328d=function(_0x3314d2,_0x1f2483){_0x3314d2=_0x3314d2-0x0;var _0x236d07=_0x28d3[_0x3314d2];return _0x236d07;};'use strict';var Sequelize=require(_0x328d('0x0'));var moment=require('moment');module[_0x328d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x328d('0x2'),_0x328d('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x328d('0x4')]},'transferercalleridname':{'type':Sequelize[_0x328d('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x328d('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x328d('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x328d('0x4')]},'transferercontext':{'type':Sequelize[_0x328d('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x328d('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x328d('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x328d('0x4')]},'transfereecontext':{'type':Sequelize[_0x328d('0x4')]},'transfereeexten':{'type':Sequelize[_0x328d('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x328d('0x5'),'No')},'context':{'type':Sequelize[_0x328d('0x4')]},'extension':{'type':Sequelize[_0x328d('0x4')]}};
\ No newline at end of file
index 038a775..fbd02d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc140=['include','findAll','rows','show','params','find','catch','create','body','update','describe','eml-format','rimraf','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','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll'];(function(_0x4e1216,_0x591de2){var _0x423cd8=function(_0x24e561){while(--_0x24e561){_0x4e1216['push'](_0x4e1216['shift']());}};_0x423cd8(++_0x591de2);}(_0xc140,0xfb));var _0x0c14=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0xc140[_0x1e03e4];return _0x4a887e;};'use strict';var emlformat=require(_0x0c14('0x0'));var rimraf=require(_0x0c14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c14('0x2'));var rp=require(_0x0c14('0x3'));var moment=require(_0x0c14('0x4'));var BPromise=require(_0x0c14('0x5'));var Mustache=require(_0x0c14('0x6'));var util=require(_0x0c14('0x7'));var path=require(_0x0c14('0x8'));var sox=require(_0x0c14('0x9'));var csv=require('to-csv');var ejs=require(_0x0c14('0xa'));var fs=require('fs');var fs_extra=require(_0x0c14('0xb'));var _=require(_0x0c14('0xc'));var squel=require(_0x0c14('0xd'));var crypto=require(_0x0c14('0xe'));var jsforce=require(_0x0c14('0xf'));var deskjs=require(_0x0c14('0x10'));var toCsv=require(_0x0c14('0x11'));var querystring=require(_0x0c14('0x12'));var Papa=require(_0x0c14('0x13'));var Redis=require(_0x0c14('0x14'));var authService=require(_0x0c14('0x15'));var qs=require(_0x0c14('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c14('0x17'));var logger=require(_0x0c14('0x18'))(_0x0c14('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0c14('0x1a'))['db'];function respondWithStatusCode(_0x211ed5,_0x2a2e7f){_0x2a2e7f=_0x2a2e7f||0xcc;return function(_0x1ec5d9){if(_0x1ec5d9){return _0x211ed5['sendStatus'](_0x2a2e7f);}return _0x211ed5[_0x0c14('0x1b')](_0x2a2e7f)[_0x0c14('0x1c')]();};}function respondWithResult(_0x4900d0,_0x52d1b2){_0x52d1b2=_0x52d1b2||0xc8;return function(_0xffda4a){if(_0xffda4a){return _0x4900d0[_0x0c14('0x1b')](_0x52d1b2)['json'](_0xffda4a);}};}function respondWithFilteredResult(_0x4eddec,_0x1dfd9){return function(_0xc4b5a4){if(_0xc4b5a4){var _0x1238aa=typeof _0x1dfd9[_0x0c14('0x1d')]===_0x0c14('0x1e')&&typeof _0x1dfd9[_0x0c14('0x1f')]===_0x0c14('0x1e');var _0x40c395=_0xc4b5a4[_0x0c14('0x20')];var _0x421df1=_0x1238aa?0x0:_0x1dfd9[_0x0c14('0x1d')];var _0x23d64c=_0x1238aa?_0xc4b5a4[_0x0c14('0x20')]:_0x1dfd9[_0x0c14('0x1d')]+_0x1dfd9[_0x0c14('0x1f')];var _0x39599b;if(_0x23d64c>=_0x40c395){_0x23d64c=_0x40c395;_0x39599b=0xc8;}else{_0x39599b=0xce;}_0x4eddec[_0x0c14('0x1b')](_0x39599b);return _0x4eddec[_0x0c14('0x21')](_0x0c14('0x22'),_0x421df1+'-'+_0x23d64c+'/'+_0x40c395)[_0x0c14('0x23')](_0xc4b5a4);}return null;};}function patchUpdates(_0x16ccd3){return function(_0x9080b8){try{jsonpatch[_0x0c14('0x24')](_0x9080b8,_0x16ccd3,!![]);}catch(_0x4bd0d8){return BPromise[_0x0c14('0x25')](_0x4bd0d8);}return _0x9080b8[_0x0c14('0x26')]();};}function saveUpdates(_0x23326c,_0x56b7d6){return function(_0x1020bd){if(_0x1020bd){return _0x1020bd['update'](_0x23326c)[_0x0c14('0x27')](function(_0x500459){return _0x500459;});}return null;};}function removeEntity(_0x3c3a57,_0x4ba2db){return function(_0x41e372){if(_0x41e372){return _0x41e372[_0x0c14('0x28')]()[_0x0c14('0x27')](function(){_0x3c3a57[_0x0c14('0x1b')](0xcc)[_0x0c14('0x1c')]();});}};}function handleEntityNotFound(_0x48856e,_0x41d22f){return function(_0x579c4d){if(!_0x579c4d){_0x48856e[_0x0c14('0x29')](0x194);}return _0x579c4d;};}function handleError(_0x107b55,_0x3c35a0){_0x3c35a0=_0x3c35a0||0x1f4;return function(_0xbb86c7){logger[_0x0c14('0x2a')](_0xbb86c7['stack']);if(_0xbb86c7[_0x0c14('0x2b')]){delete _0xbb86c7['name'];}_0x107b55[_0x0c14('0x1b')](_0x3c35a0)[_0x0c14('0x2c')](_0xbb86c7);};}exports[_0x0c14('0x2d')]=function(_0x3a9257,_0x417106){var _0x105da0={},_0x402da5={},_0x48b3fc={'count':0x0,'rows':[]};var _0x237cba=_[_0x0c14('0x2e')](db[_0x0c14('0x2f')][_0x0c14('0x30')],function(_0x1ca3e6){return{'name':_0x1ca3e6[_0x0c14('0x31')],'type':_0x1ca3e6[_0x0c14('0x32')][_0x0c14('0x33')]};});_0x402da5[_0x0c14('0x34')]=_[_0x0c14('0x2e')](_0x237cba,_0x0c14('0x2b'));_0x402da5['query']=_[_0x0c14('0x35')](_0x3a9257['query']);_0x402da5['filters']=_['intersection'](_0x402da5[_0x0c14('0x34')],_0x402da5[_0x0c14('0x36')]);_0x105da0['attributes']=_[_0x0c14('0x37')](_0x402da5[_0x0c14('0x34')],qs['fields'](_0x3a9257[_0x0c14('0x36')][_0x0c14('0x38')]));_0x105da0[_0x0c14('0x39')]=_0x105da0[_0x0c14('0x39')][_0x0c14('0x3a')]?_0x105da0[_0x0c14('0x39')]:_0x402da5[_0x0c14('0x34')];if(!_0x3a9257['query'][_0x0c14('0x3b')](_0x0c14('0x3c'))){_0x105da0[_0x0c14('0x1f')]=qs[_0x0c14('0x1f')](_0x3a9257[_0x0c14('0x36')][_0x0c14('0x1f')]);_0x105da0['offset']=qs[_0x0c14('0x1d')](_0x3a9257[_0x0c14('0x36')][_0x0c14('0x1d')]);}_0x105da0[_0x0c14('0x3d')]=qs[_0x0c14('0x3e')](_0x3a9257[_0x0c14('0x36')][_0x0c14('0x3e')]);_0x105da0[_0x0c14('0x3f')]=qs['filters'](_['pick'](_0x3a9257[_0x0c14('0x36')],_0x402da5[_0x0c14('0x40')]),_0x237cba);if(_0x3a9257[_0x0c14('0x36')]['filter']){_0x105da0['where']=_[_0x0c14('0x41')](_0x105da0['where'],{'$or':_[_0x0c14('0x2e')](_0x237cba,function(_0xae205b){if(_0xae205b[_0x0c14('0x32')]!=='VIRTUAL'){var _0x432288={};_0x432288[_0xae205b[_0x0c14('0x2b')]]={'$like':'%'+_0x3a9257['query'][_0x0c14('0x42')]+'%'};return _0x432288;}})});}_0x105da0=_[_0x0c14('0x41')]({},_0x105da0,_0x3a9257[_0x0c14('0x43')]);var _0x1704c3={'where':_0x105da0[_0x0c14('0x3f')]};return db[_0x0c14('0x2f')]['count'](_0x1704c3)[_0x0c14('0x27')](function(_0x14095e){_0x48b3fc[_0x0c14('0x20')]=_0x14095e;if(_0x3a9257[_0x0c14('0x36')][_0x0c14('0x44')]){_0x105da0[_0x0c14('0x45')]=[{'all':!![]}];}return db[_0x0c14('0x2f')][_0x0c14('0x46')](_0x105da0);})[_0x0c14('0x27')](function(_0x57ecf2){_0x48b3fc[_0x0c14('0x47')]=_0x57ecf2;return _0x48b3fc;})[_0x0c14('0x27')](respondWithFilteredResult(_0x417106,_0x105da0))['catch'](handleError(_0x417106,null));};exports[_0x0c14('0x48')]=function(_0xf22a94,_0x3608b2){var _0x138fbe={'raw':!![],'where':{'id':_0xf22a94[_0x0c14('0x49')]['id']}},_0x39c07a={};_0x39c07a[_0x0c14('0x34')]=_[_0x0c14('0x35')](db['VoiceTransferReport'][_0x0c14('0x30')]);_0x39c07a[_0x0c14('0x36')]=_[_0x0c14('0x35')](_0xf22a94[_0x0c14('0x36')]);_0x39c07a[_0x0c14('0x40')]=_[_0x0c14('0x37')](_0x39c07a[_0x0c14('0x34')],_0x39c07a[_0x0c14('0x36')]);_0x138fbe[_0x0c14('0x39')]=_[_0x0c14('0x37')](_0x39c07a[_0x0c14('0x34')],qs[_0x0c14('0x38')](_0xf22a94[_0x0c14('0x36')][_0x0c14('0x38')]));_0x138fbe['attributes']=_0x138fbe[_0x0c14('0x39')][_0x0c14('0x3a')]?_0x138fbe[_0x0c14('0x39')]:_0x39c07a['model'];if(_0xf22a94[_0x0c14('0x36')][_0x0c14('0x44')]){_0x138fbe[_0x0c14('0x45')]=[{'all':!![]}];}_0x138fbe=_[_0x0c14('0x41')]({},_0x138fbe,_0xf22a94[_0x0c14('0x43')]);return db[_0x0c14('0x2f')][_0x0c14('0x4a')](_0x138fbe)['then'](handleEntityNotFound(_0x3608b2,null))['then'](respondWithResult(_0x3608b2,null))[_0x0c14('0x4b')](handleError(_0x3608b2,null));};exports[_0x0c14('0x4c')]=function(_0x1a0573,_0x299016){return db[_0x0c14('0x2f')][_0x0c14('0x4c')](_0x1a0573[_0x0c14('0x4d')],{})[_0x0c14('0x27')](respondWithResult(_0x299016,0xc9))[_0x0c14('0x4b')](handleError(_0x299016,null));};exports[_0x0c14('0x4e')]=function(_0x1d7638,_0x1c4b06){if(_0x1d7638[_0x0c14('0x4d')]['id']){delete _0x1d7638[_0x0c14('0x4d')]['id'];}return db[_0x0c14('0x2f')][_0x0c14('0x4a')]({'where':{'id':_0x1d7638[_0x0c14('0x49')]['id']}})[_0x0c14('0x27')](handleEntityNotFound(_0x1c4b06,null))[_0x0c14('0x27')](saveUpdates(_0x1d7638[_0x0c14('0x4d')],null))[_0x0c14('0x27')](respondWithResult(_0x1c4b06,null))['catch'](handleError(_0x1c4b06,null));};exports[_0x0c14('0x28')]=function(_0x235eb3,_0x229b59){return db[_0x0c14('0x2f')][_0x0c14('0x4a')]({'where':{'id':_0x235eb3[_0x0c14('0x49')]['id']}})['then'](handleEntityNotFound(_0x229b59,null))['then'](removeEntity(_0x229b59,null))[_0x0c14('0x4b')](handleError(_0x229b59,null));};exports[_0x0c14('0x4f')]=function(_0x153a25,_0x3f3a14){return db[_0x0c14('0x2f')][_0x0c14('0x4f')]()['then'](respondWithResult(_0x3f3a14,null))[_0x0c14('0x4b')](handleError(_0x3f3a14,null));};
\ No newline at end of file
+var _0x7a60=['type','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','undefined','limit','count','offset','set','json','reject','save','update','then','status','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName'];(function(_0x2d13af,_0x33bd37){var _0x4753e1=function(_0x2e86be){while(--_0x2e86be){_0x2d13af['push'](_0x2d13af['shift']());}};_0x4753e1(++_0x33bd37);}(_0x7a60,0x18c));var _0x07a6=function(_0x439ee7,_0x3e914e){_0x439ee7=_0x439ee7-0x0;var _0x34e7b1=_0x7a60[_0x439ee7];return _0x34e7b1;};'use strict';var emlformat=require(_0x07a6('0x0'));var rimraf=require(_0x07a6('0x1'));var zipdir=require(_0x07a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x07a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x07a6('0x4'));var util=require('util');var path=require(_0x07a6('0x5'));var sox=require(_0x07a6('0x6'));var csv=require(_0x07a6('0x7'));var ejs=require(_0x07a6('0x8'));var fs=require('fs');var fs_extra=require(_0x07a6('0x9'));var _=require(_0x07a6('0xa'));var squel=require(_0x07a6('0xb'));var crypto=require(_0x07a6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x07a6('0xd'));var toCsv=require(_0x07a6('0x7'));var querystring=require(_0x07a6('0xe'));var Papa=require(_0x07a6('0xf'));var Redis=require(_0x07a6('0x10'));var authService=require(_0x07a6('0x11'));var qs=require(_0x07a6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x07a6('0x13'))(_0x07a6('0x14'));var utils=require('../../config/utils');var config=require(_0x07a6('0x15'));var licenseUtil=require(_0x07a6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38807a,_0x178598){_0x178598=_0x178598||0xcc;return function(_0x214494){if(_0x214494){return _0x38807a[_0x07a6('0x17')](_0x178598);}return _0x38807a['status'](_0x178598)['end']();};}function respondWithResult(_0x29d457,_0x294879){_0x294879=_0x294879||0xc8;return function(_0x17177e){if(_0x17177e){return _0x29d457['status'](_0x294879)['json'](_0x17177e);}};}function respondWithFilteredResult(_0x3f03a4,_0x279026){return function(_0x3efb00){if(_0x3efb00){var _0x54dd27=typeof _0x279026['offset']===_0x07a6('0x18')&&typeof _0x279026[_0x07a6('0x19')]===_0x07a6('0x18');var _0x42ccce=_0x3efb00['count'];var _0xccbcde=_0x54dd27?0x0:_0x279026['offset'];var _0x13f489=_0x54dd27?_0x3efb00[_0x07a6('0x1a')]:_0x279026[_0x07a6('0x1b')]+_0x279026[_0x07a6('0x19')];var _0x2e748e;if(_0x13f489>=_0x42ccce){_0x13f489=_0x42ccce;_0x2e748e=0xc8;}else{_0x2e748e=0xce;}_0x3f03a4['status'](_0x2e748e);return _0x3f03a4[_0x07a6('0x1c')]('Content-Range',_0xccbcde+'-'+_0x13f489+'/'+_0x42ccce)[_0x07a6('0x1d')](_0x3efb00);}return null;};}function patchUpdates(_0x4dffde){return function(_0x5abef5){try{jsonpatch['apply'](_0x5abef5,_0x4dffde,!![]);}catch(_0x39fa15){return BPromise[_0x07a6('0x1e')](_0x39fa15);}return _0x5abef5[_0x07a6('0x1f')]();};}function saveUpdates(_0x18df34,_0x3b041a){return function(_0x8f3cad){if(_0x8f3cad){return _0x8f3cad[_0x07a6('0x20')](_0x18df34)[_0x07a6('0x21')](function(_0x51fe17){return _0x51fe17;});}return null;};}function removeEntity(_0x314291,_0x31832b){return function(_0x591bb4){if(_0x591bb4){return _0x591bb4['destroy']()[_0x07a6('0x21')](function(){_0x314291[_0x07a6('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e4d7,_0x26fd51){return function(_0x382205){if(!_0x382205){_0x52e4d7['sendStatus'](0x194);}return _0x382205;};}function handleError(_0x5adef1,_0xb6a023){_0xb6a023=_0xb6a023||0x1f4;return function(_0x422204){logger['error'](_0x422204[_0x07a6('0x23')]);if(_0x422204['name']){delete _0x422204[_0x07a6('0x24')];}_0x5adef1[_0x07a6('0x22')](_0xb6a023)[_0x07a6('0x25')](_0x422204);};}exports[_0x07a6('0x26')]=function(_0x2476f8,_0x5e71cb){var _0x314736={},_0x529cdc={},_0x1e7c74={'count':0x0,'rows':[]};var _0x277032=_['map'](db[_0x07a6('0x27')][_0x07a6('0x28')],function(_0x451ddd){return{'name':_0x451ddd[_0x07a6('0x29')],'type':_0x451ddd[_0x07a6('0x2a')]['key']};});_0x529cdc['model']=_[_0x07a6('0x2b')](_0x277032,'name');_0x529cdc[_0x07a6('0x2c')]=_[_0x07a6('0x2d')](_0x2476f8[_0x07a6('0x2c')]);_0x529cdc['filters']=_[_0x07a6('0x2e')](_0x529cdc[_0x07a6('0x2f')],_0x529cdc[_0x07a6('0x2c')]);_0x314736['attributes']=_['intersection'](_0x529cdc[_0x07a6('0x2f')],qs[_0x07a6('0x30')](_0x2476f8[_0x07a6('0x2c')][_0x07a6('0x30')]));_0x314736[_0x07a6('0x31')]=_0x314736['attributes'][_0x07a6('0x32')]?_0x314736[_0x07a6('0x31')]:_0x529cdc[_0x07a6('0x2f')];if(!_0x2476f8[_0x07a6('0x2c')][_0x07a6('0x33')](_0x07a6('0x34'))){_0x314736[_0x07a6('0x19')]=qs[_0x07a6('0x19')](_0x2476f8[_0x07a6('0x2c')][_0x07a6('0x19')]);_0x314736['offset']=qs[_0x07a6('0x1b')](_0x2476f8[_0x07a6('0x2c')][_0x07a6('0x1b')]);}_0x314736[_0x07a6('0x35')]=qs[_0x07a6('0x36')](_0x2476f8['query'][_0x07a6('0x36')]);_0x314736[_0x07a6('0x37')]=qs[_0x07a6('0x38')](_[_0x07a6('0x39')](_0x2476f8[_0x07a6('0x2c')],_0x529cdc[_0x07a6('0x38')]),_0x277032);if(_0x2476f8[_0x07a6('0x2c')][_0x07a6('0x3a')]){_0x314736[_0x07a6('0x37')]=_[_0x07a6('0x3b')](_0x314736[_0x07a6('0x37')],{'$or':_[_0x07a6('0x2b')](_0x277032,function(_0x16f25e){if(_0x16f25e[_0x07a6('0x2a')]!==_0x07a6('0x3c')){var _0x2d2615={};_0x2d2615[_0x16f25e[_0x07a6('0x24')]]={'$like':'%'+_0x2476f8['query'][_0x07a6('0x3a')]+'%'};return _0x2d2615;}})});}_0x314736=_[_0x07a6('0x3b')]({},_0x314736,_0x2476f8['options']);var _0x11f978={'where':_0x314736[_0x07a6('0x37')]};return db[_0x07a6('0x27')][_0x07a6('0x1a')](_0x11f978)[_0x07a6('0x21')](function(_0x278b41){_0x1e7c74[_0x07a6('0x1a')]=_0x278b41;if(_0x2476f8[_0x07a6('0x2c')][_0x07a6('0x3d')]){_0x314736[_0x07a6('0x3e')]=[{'all':!![]}];}return db[_0x07a6('0x27')][_0x07a6('0x3f')](_0x314736);})['then'](function(_0x2b2d09){_0x1e7c74['rows']=_0x2b2d09;return _0x1e7c74;})[_0x07a6('0x21')](respondWithFilteredResult(_0x5e71cb,_0x314736))[_0x07a6('0x40')](handleError(_0x5e71cb,null));};exports[_0x07a6('0x41')]=function(_0x4d6284,_0x236002){var _0x99153d={'raw':!![],'where':{'id':_0x4d6284[_0x07a6('0x42')]['id']}},_0x870371={};_0x870371['model']=_[_0x07a6('0x2d')](db[_0x07a6('0x27')][_0x07a6('0x28')]);_0x870371[_0x07a6('0x2c')]=_[_0x07a6('0x2d')](_0x4d6284[_0x07a6('0x2c')]);_0x870371[_0x07a6('0x38')]=_[_0x07a6('0x2e')](_0x870371[_0x07a6('0x2f')],_0x870371[_0x07a6('0x2c')]);_0x99153d[_0x07a6('0x31')]=_[_0x07a6('0x2e')](_0x870371[_0x07a6('0x2f')],qs[_0x07a6('0x30')](_0x4d6284[_0x07a6('0x2c')][_0x07a6('0x30')]));_0x99153d['attributes']=_0x99153d['attributes'][_0x07a6('0x32')]?_0x99153d['attributes']:_0x870371['model'];if(_0x4d6284[_0x07a6('0x2c')][_0x07a6('0x3d')]){_0x99153d[_0x07a6('0x3e')]=[{'all':!![]}];}_0x99153d=_[_0x07a6('0x3b')]({},_0x99153d,_0x4d6284[_0x07a6('0x43')]);return db[_0x07a6('0x27')][_0x07a6('0x44')](_0x99153d)['then'](handleEntityNotFound(_0x236002,null))[_0x07a6('0x21')](respondWithResult(_0x236002,null))[_0x07a6('0x40')](handleError(_0x236002,null));};exports[_0x07a6('0x45')]=function(_0x448c82,_0x2eb326){return db['VoiceTransferReport'][_0x07a6('0x45')](_0x448c82['body'],{})[_0x07a6('0x21')](respondWithResult(_0x2eb326,0xc9))[_0x07a6('0x40')](handleError(_0x2eb326,null));};exports['update']=function(_0x5f4124,_0x48959){if(_0x5f4124[_0x07a6('0x46')]['id']){delete _0x5f4124[_0x07a6('0x46')]['id'];}return db[_0x07a6('0x27')][_0x07a6('0x44')]({'where':{'id':_0x5f4124[_0x07a6('0x42')]['id']}})[_0x07a6('0x21')](handleEntityNotFound(_0x48959,null))[_0x07a6('0x21')](saveUpdates(_0x5f4124[_0x07a6('0x46')],null))[_0x07a6('0x21')](respondWithResult(_0x48959,null))[_0x07a6('0x40')](handleError(_0x48959,null));};exports[_0x07a6('0x47')]=function(_0x300375,_0x181f1e){return db[_0x07a6('0x27')]['find']({'where':{'id':_0x300375[_0x07a6('0x42')]['id']}})['then'](handleEntityNotFound(_0x181f1e,null))['then'](removeEntity(_0x181f1e,null))['catch'](handleError(_0x181f1e,null));};exports['describe']=function(_0x39a321,_0x4bf3f7){return db[_0x07a6('0x27')][_0x07a6('0x48')]()[_0x07a6('0x21')](respondWithResult(_0x4bf3f7,null))['catch'](handleError(_0x4bf3f7,null));};
\ No newline at end of file
index ecc7510..a0a3d0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23c5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceTransferReport','report_call_transfer'];(function(_0x52454f,_0x2ca919){var _0x31b759=function(_0x27cca4){while(--_0x27cca4){_0x52454f['push'](_0x52454f['shift']());}};_0x31b759(++_0x2ca919);}(_0x23c5,0x138));var _0x523c=function(_0x3dad42,_0x4a2dc3){_0x3dad42=_0x3dad42-0x0;var _0x19f2fd=_0x23c5[_0x3dad42];return _0x19f2fd;};'use strict';var _=require('lodash');var util=require(_0x523c('0x0'));var logger=require(_0x523c('0x1'))(_0x523c('0x2'));var moment=require(_0x523c('0x3'));var BPromise=require(_0x523c('0x4'));var rp=require(_0x523c('0x5'));var fs=require('fs');var path=require(_0x523c('0x6'));var rimraf=require(_0x523c('0x7'));var config=require(_0x523c('0x8'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x2df773,_0x3b1021){return _0x2df773[_0x523c('0x9')](_0x523c('0xa'),attributes,{'tableName':_0x523c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x855b=['api','request-promise','path','rimraf','../../config/environment','report_call_transfer','lodash','util','../../config/logger'];(function(_0x5f59ac,_0x365c3f){var _0x365664=function(_0x4831c5){while(--_0x4831c5){_0x5f59ac['push'](_0x5f59ac['shift']());}};_0x365664(++_0x365c3f);}(_0x855b,0x7b));var _0xb855=function(_0x163a02,_0xc84479){_0x163a02=_0x163a02-0x0;var _0x5dadcb=_0x855b[_0x163a02];return _0x5dadcb;};'use strict';var _=require(_0xb855('0x0'));var util=require(_0xb855('0x1'));var logger=require(_0xb855('0x2'))(_0xb855('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb855('0x4'));var fs=require('fs');var path=require(_0xb855('0x5'));var rimraf=require(_0xb855('0x6'));var config=require(_0xb855('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x187b07,_0x5df62a){return _0x187b07['define']('VoiceTransferReport',attributes,{'tableName':_0xb855('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d3495fe..0bd2eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x612c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateVoiceTransferReport','create','body','options','raw','then','info','debug','stringify','lodash','util'];(function(_0x224074,_0xc5c950){var _0x5caaad=function(_0x51eb2a){while(--_0x51eb2a){_0x224074['push'](_0x224074['shift']());}};_0x5caaad(++_0xc5c950);}(_0x612c,0x1e4));var _0xc612=function(_0x584587,_0x5e2fe6){_0x584587=_0x584587-0x0;var _0xed6e57=_0x612c[_0x584587];return _0xed6e57;};'use strict';var _=require(_0xc612('0x0'));var util=require(_0xc612('0x1'));var moment=require(_0xc612('0x2'));var BPromise=require(_0xc612('0x3'));var rs=require(_0xc612('0x4'));var fs=require('fs');var Redis=require(_0xc612('0x5'));var db=require(_0xc612('0x6'))['db'];var utils=require(_0xc612('0x7'));var logger=require('../../config/logger')(_0xc612('0x8'));var config=require(_0xc612('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc612('0xa')][_0xc612('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fe3e7,_0x225053,_0x55ba56){return new BPromise(function(_0x21fa5f,_0x41b670){return client[_0xc612('0xc')](_0x3fe3e7,_0x55ba56)['then'](function(_0x134d42){logger['info'](_0xc612('0xd'),_0x225053,'request\x20sent');logger['debug'](_0xc612('0xe'),_0x225053,'request\x20sent',JSON['stringify'](_0x134d42));if(_0x134d42[_0xc612('0xf')]){if(_0x134d42[_0xc612('0xf')][_0xc612('0x10')]===0x1f4){logger[_0xc612('0xf')](_0xc612('0xd'),_0x225053,_0x134d42[_0xc612('0xf')][_0xc612('0x11')]);return _0x41b670(_0x134d42[_0xc612('0xf')][_0xc612('0x11')]);}logger[_0xc612('0xf')](_0xc612('0xd'),_0x225053,_0x134d42[_0xc612('0xf')][_0xc612('0x11')]);return _0x21fa5f(_0x134d42[_0xc612('0xf')]['message']);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x225053,'request\x20sent');_0x21fa5f(_0x134d42['result'][_0xc612('0x11')]);}})['catch'](function(_0x41a60b){logger[_0xc612('0xf')](_0xc612('0xd'),_0x225053,_0x41a60b);_0x41b670(_0x41a60b);});});}exports[_0xc612('0x12')]=function(_0x571cc3){var _0x3b848c=this;return new Promise(function(_0x453b53,_0x5d850f){return db['VoiceTransferReport'][_0xc612('0x13')](_0x571cc3[_0xc612('0x14')],{'raw':_0x571cc3[_0xc612('0x15')]?_0x571cc3[_0xc612('0x15')][_0xc612('0x16')]===undefined?!![]:![]:!![]})[_0xc612('0x17')](function(_0x597328){logger[_0xc612('0x18')]('CreateVoiceTransferReport',_0x571cc3);logger[_0xc612('0x19')](_0xc612('0x12'),_0x571cc3,JSON[_0xc612('0x1a')](_0x597328));_0x453b53(_0x597328);})['catch'](function(_0x35a1d3){logger[_0xc612('0xf')](_0xc612('0x12'),_0x35a1d3[_0xc612('0x11')],_0x571cc3);_0x5d850f(_0x3b848c['error'](0x1f4,_0x35a1d3[_0xc612('0x11')]));});});};
\ No newline at end of file
+var _0x7243=['rpc','../../config/environment','client','http','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','create','body','options','CreateVoiceTransferReport','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4660c2,_0x481753){var _0x332061=function(_0x5aad1c){while(--_0x5aad1c){_0x4660c2['push'](_0x4660c2['shift']());}};_0x332061(++_0x481753);}(_0x7243,0x7c));var _0x3724=function(_0x3a598c,_0x4c0503){_0x3a598c=_0x3a598c-0x0;var _0x54dcdd=_0x7243[_0x3a598c];return _0x54dcdd;};'use strict';var _=require('lodash');var util=require(_0x3724('0x0'));var moment=require(_0x3724('0x1'));var BPromise=require(_0x3724('0x2'));var rs=require(_0x3724('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3724('0x4'))['db'];var utils=require(_0x3724('0x5'));var logger=require('../../config/logger')(_0x3724('0x6'));var config=require(_0x3724('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3724('0x8')][_0x3724('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a3469,_0x2e956c,_0x2e837d){return new BPromise(function(_0x5d47ff,_0x466910){return client['request'](_0x4a3469,_0x2e837d)[_0x3724('0xa')](function(_0x34f6e8){logger[_0x3724('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x2e956c,_0x3724('0xc'));logger[_0x3724('0xd')](_0x3724('0xe'),_0x2e956c,_0x3724('0xc'),JSON[_0x3724('0xf')](_0x34f6e8));if(_0x34f6e8[_0x3724('0x10')]){if(_0x34f6e8[_0x3724('0x10')][_0x3724('0x11')]===0x1f4){logger[_0x3724('0x10')](_0x3724('0x12'),_0x2e956c,_0x34f6e8[_0x3724('0x10')][_0x3724('0x13')]);return _0x466910(_0x34f6e8['error'][_0x3724('0x13')]);}logger['error'](_0x3724('0x12'),_0x2e956c,_0x34f6e8[_0x3724('0x10')][_0x3724('0x13')]);return _0x5d47ff(_0x34f6e8['error']['message']);}else{logger[_0x3724('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x2e956c,_0x3724('0xc'));_0x5d47ff(_0x34f6e8[_0x3724('0x14')][_0x3724('0x13')]);}})[_0x3724('0x15')](function(_0x40e3f0){logger[_0x3724('0x10')](_0x3724('0x12'),_0x2e956c,_0x40e3f0);_0x466910(_0x40e3f0);});});}exports['CreateVoiceTransferReport']=function(_0x408eae){var _0x4cd660=this;return new Promise(function(_0x38a69d,_0x1bb739){return db['VoiceTransferReport'][_0x3724('0x16')](_0x408eae[_0x3724('0x17')],{'raw':_0x408eae[_0x3724('0x18')]?_0x408eae[_0x3724('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x59d768){logger['info'](_0x3724('0x19'),_0x408eae);logger[_0x3724('0xd')](_0x3724('0x19'),_0x408eae,JSON[_0x3724('0xf')](_0x59d768));_0x38a69d(_0x59d768);})['catch'](function(_0x335be5){logger[_0x3724('0x10')](_0x3724('0x19'),_0x335be5[_0x3724('0x13')],_0x408eae);_0x1bb739(_0x4cd660[_0x3724('0x10')](0x1f4,_0x335be5[_0x3724('0x13')]));});});};
\ No newline at end of file
index 057b8f5..4f1e4c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['/unhold','unhold','/calls','calls','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','hold'];(function(_0x213c63,_0x420de6){var _0x300bfb=function(_0x5d0b2e){while(--_0x5d0b2e){_0x213c63['push'](_0x213c63['shift']());}};_0x300bfb(++_0x420de6);}(_0x34e8,0x12c));var _0x834e=function(_0x60fa7b,_0x582e7f){_0x60fa7b=_0x60fa7b-0x0;var _0x5e158e=_0x34e8[_0x60fa7b];return _0x5e158e;};'use strict';var express=require(_0x834e('0x0'));var router=express[_0x834e('0x1')]();var auth=require(_0x834e('0x2'));var controller=require(_0x834e('0x3'));router['post'](_0x834e('0x4'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x7')]);router[_0x834e('0x8')](_0x834e('0x9'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0xa')]);router['post'](_0x834e('0xb'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xc')]);router[_0x834e('0x8')](_0x834e('0xd'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xe')]);router[_0x834e('0x8')](_0x834e('0xf'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x10')]);router[_0x834e('0x8')](_0x834e('0x11'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0x12')]);router[_0x834e('0x8')]('/transfer',auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x13')]);module[_0x834e('0x14')]=router;
\ No newline at end of file
+var _0xbec5=['exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup','/answer','answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer'];(function(_0x3c1faf,_0x59f7d2){var _0x2491d0=function(_0x1cdeba){while(--_0x1cdeba){_0x3c1faf['push'](_0x3c1faf['shift']());}};_0x2491d0(++_0x59f7d2);}(_0xbec5,0xe5));var _0x5bec=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xbec5[_0x1dbaf7];return _0x593f05;};'use strict';var express=require(_0x5bec('0x0'));var router=express[_0x5bec('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5bec('0x2'));router[_0x5bec('0x3')](_0x5bec('0x4'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller['originate']);router[_0x5bec('0x3')](_0x5bec('0x7'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0x8')]);router[_0x5bec('0x3')](_0x5bec('0x9'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xa')]);router[_0x5bec('0x3')](_0x5bec('0xb'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller['hold']);router[_0x5bec('0x3')](_0x5bec('0xc'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0xd')]);router[_0x5bec('0x3')](_0x5bec('0xe'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xf')]);router['post'](_0x5bec('0x10'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0x11')]);module[_0x5bec('0x12')]=router;
\ No newline at end of file
index 96a1632..e5028df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc03=['send','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','info','format','json','originate\x20executed!','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','bluebird','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','stringify','handleError:','error','stack','name','status'];(function(_0x1b7a13,_0x4d3718){var _0x163406=function(_0x487cca){while(--_0x487cca){_0x1b7a13['push'](_0x1b7a13['shift']());}};_0x163406(++_0x4d3718);}(_0xfc03,0x16f));var _0x3fc0=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xfc03[_0x36ed48];return _0x51c63a;};'use strict';var path=require(_0x3fc0('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x3fc0('0x1'))['db'];var config=require(_0x3fc0('0x2'));var util=require('util');var BPromise=require(_0x3fc0('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x3fc0('0x4')][_0x3fc0('0x5')]({'port':0x232a});var logger=require(_0x3fc0('0x6'))(_0x3fc0('0x7'));var Redis=require(_0x3fc0('0x8'));config[_0x3fc0('0x9')]=_[_0x3fc0('0xa')](config[_0x3fc0('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3fc0('0xb'))(new Redis(config['redis']));var Schema=require(_0x3fc0('0xc'));var originateValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],_0x3fc0('0xe')]},'callNumber':{'type':_0x3fc0('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x3fc0('0xf')},'callbackUrl':{'type':_0x3fc0('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],_0x3fc0('0xe')]},'sessionId':{'type':_0x3fc0('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3fc0('0xe')]},'sessionId':{'type':_0x3fc0('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3fc0('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x3fc0('0xf'),'required':[!![],_0x3fc0('0x10')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3fc0('0xe')]},'sessionId':{'type':_0x3fc0('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3fc0('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],_0x3fc0('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x277dbf,_0x3d869e,_0x3ef95e){logger['info'](_0x277dbf,_0x3d869e,JSON[_0x3fc0('0x11')](_0x3ef95e));io['to'](_0x277dbf)['emit'](_0x3d869e,_0x3ef95e);}function handleError(_0x121931){return function(_0x3c5026){console['log'](_0x3fc0('0x12'),_0x3c5026,_0x3c5026 instanceof RangeError);logger[_0x3fc0('0x13')](_0x3c5026[_0x3fc0('0x14')]);if(_0x3c5026 instanceof RangeError){if(_0x3c5026[_0x3fc0('0x15')]){delete _0x3c5026[_0x3fc0('0x15')];}_0x121931[_0x3fc0('0x16')](0x194)[_0x3fc0('0x17')](_0x3c5026);}else{if(_0x3c5026[_0x3fc0('0x15')]){delete _0x3c5026[_0x3fc0('0x15')];}_0x121931['status'](0x1f4)[_0x3fc0('0x17')](_0x3c5026);}};}function checkError(){return function(_0x9ab2c5){if(!_0x9ab2c5){throw new RangeError(_0x3fc0('0x18'));}return _0x9ab2c5;};}function respondWithRpcPromise(_0x3d6c0a,_0x3a09cd){return new BPromise(function(_0x448293,_0x47c770){var _0x477674=amiClient;return _0x477674[_0x3fc0('0x19')](_0x3d6c0a,_0x3a09cd)[_0x3fc0('0x1a')](function(_0x28fc65){if(_0x28fc65[_0x3fc0('0x13')]){if(_0x28fc65[_0x3fc0('0x13')][_0x3fc0('0x1b')]===0x1f4){return _0x47c770(_0x28fc65[_0x3fc0('0x13')][_0x3fc0('0x1c')]);}return _0x448293(_0x28fc65[_0x3fc0('0x13')][_0x3fc0('0x1c')]);}else{_0x448293(_0x28fc65[_0x3fc0('0x1d')]);}})[_0x3fc0('0x1e')](function(_0xba1a23){_0x47c770(_0xba1a23);});});}function getAgent(_0x55f507){return db[_0x3fc0('0x1f')]['findOne']({'where':{'id':_0x55f507,'role':_0x3fc0('0x20')}})[_0x3fc0('0x1a')](checkError());}function getAgentCheckSession(_0x1d9932,_0x35c34c){return new BPromise(function(_0x5a9179,_0x134317){var _0x197dfa=respondWithRpcPromise(_0x3fc0('0x21'));var _0x2645b4=getAgent(_0x1d9932);Promise['all']([_0x197dfa,_0x2645b4])[_0x3fc0('0x1a')](function(_0x1a2261){var _0x1960a4=_0x1a2261[0x0];var _0xac736c=_0x1a2261[0x1];var _0x29aa32=_[_0x3fc0('0x22')](_0x1960a4['rows'],function(_0xd9ecae){return _0xd9ecae[_0x3fc0('0x23')]==_0xac736c['id']&&_0xd9ecae[_0x3fc0('0x24')]==_0x35c34c;});if(_0x29aa32[_0x3fc0('0x25')]==0x1){_0x5a9179(_0xac736c);}else{_0x134317(new RangeError(_0x3fc0('0x26')+_0x35c34c+_0x3fc0('0x27')));}});});}exports[_0x3fc0('0x28')]=function(_0x164a96,_0x4d6551){logger['info'](_0x3fc0('0x29'),_0x164a96['body']);var _0x58d698=originateValidation[_0x3fc0('0xc')](_0x164a96[_0x3fc0('0x2a')]);if(_0x58d698[_0x3fc0('0x25')]>0x0){return _0x4d6551[_0x3fc0('0x16')](0x190)['json'](_0x58d698);}var _0x4dc8cd=_0x164a96[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x151492=_0x164a96[_0x3fc0('0x2a')][_0x3fc0('0x2c')];var _0x5f0ca1=_0x164a96[_0x3fc0('0x2a')][_0x3fc0('0x2d')];var _0x399c9c=_0x164a96['body'][_0x3fc0('0x2e')];return getAgent(_0x4dc8cd)[_0x3fc0('0x1a')](function(_0x325a2f){logger[_0x3fc0('0x2f')]('entityFound:',_0x325a2f[_0x3fc0('0x15')]);emit(util[_0x3fc0('0x30')]('user:%s',_0x325a2f[_0x3fc0('0x15')]),'webbar:originate',{'callNumber':_0x151492,'callerId':_0x5f0ca1,'callbackUrl':_0x399c9c});return _0x4d6551[_0x3fc0('0x16')](0xc8)[_0x3fc0('0x31')]({'error':![],'message':_0x3fc0('0x32')});})[_0x3fc0('0x1e')](handleError(_0x4d6551));};exports[_0x3fc0('0x33')]=function(_0x104332,_0x469d4b){logger[_0x3fc0('0x2f')](_0x3fc0('0x34'),_0x104332[_0x3fc0('0x2a')]);var _0x41b4b3=hangupValidation['validate'](_0x104332[_0x3fc0('0x2a')]);if(_0x41b4b3[_0x3fc0('0x25')]>0x0){return _0x469d4b[_0x3fc0('0x16')](0x190)[_0x3fc0('0x31')](_0x41b4b3);}var _0x21de4c=_0x104332[_0x3fc0('0x2a')]['userId'];var _0x5ae22c=_0x104332[_0x3fc0('0x2a')][_0x3fc0('0x24')];return getAgent(_0x21de4c)[_0x3fc0('0x1a')](function(_0x3e285f){logger[_0x3fc0('0x2f')]('entityFound:',_0x3e285f['name']);emit(util['format'](_0x3fc0('0x35'),_0x3e285f[_0x3fc0('0x15')]),_0x3fc0('0x36'),{'sessionId':_0x5ae22c});return _0x469d4b['status'](0xc8)['json']({'error':![],'message':_0x3fc0('0x37')});})[_0x3fc0('0x1e')](handleError(_0x469d4b));};exports[_0x3fc0('0x38')]=function(_0x10b845,_0x494c66){logger['info'](_0x3fc0('0x39'),_0x10b845[_0x3fc0('0x2a')]);var _0x547670=answerValidation[_0x3fc0('0xc')](_0x10b845['body']);if(_0x547670[_0x3fc0('0x25')]>0x0){return _0x494c66[_0x3fc0('0x16')](0x190)[_0x3fc0('0x31')](_0x547670);}var _0x90120f=_0x10b845[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x80dfee=_0x10b845[_0x3fc0('0x2a')]['sessionId'];return getAgent(_0x90120f)[_0x3fc0('0x1a')](function(_0x5bd6a8){logger[_0x3fc0('0x2f')](_0x3fc0('0x3a'),_0x5bd6a8[_0x3fc0('0x15')]);emit(util[_0x3fc0('0x30')](_0x3fc0('0x35'),_0x5bd6a8['name']),_0x3fc0('0x3b'),{'sessionId':_0x80dfee});return _0x494c66[_0x3fc0('0x16')](0xc8)[_0x3fc0('0x31')]({'error':![],'message':_0x3fc0('0x3c')});})['catch'](handleError(_0x494c66));};exports[_0x3fc0('0x3d')]=function(_0x5a1672,_0x21c065){logger[_0x3fc0('0x2f')](_0x3fc0('0x3e'),_0x5a1672[_0x3fc0('0x2a')]);var _0x277480=holdValidation['validate'](_0x5a1672[_0x3fc0('0x2a')]);if(_0x277480[_0x3fc0('0x25')]>0x0){return _0x21c065[_0x3fc0('0x16')](0x190)['json'](_0x277480);}var _0x3df404=_0x5a1672[_0x3fc0('0x2a')]['userId'];var _0x1f5e6a=_0x5a1672[_0x3fc0('0x2a')][_0x3fc0('0x24')];return getAgent(_0x3df404)['then'](function(_0x5e5c73){logger[_0x3fc0('0x2f')](_0x3fc0('0x3a'),_0x5e5c73[_0x3fc0('0x15')]);emit(util['format'](_0x3fc0('0x35'),_0x5e5c73['name']),_0x3fc0('0x3f'),{'sessionId':_0x1f5e6a});return _0x21c065['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x3fc0('0x1e')](handleError(_0x21c065));};exports[_0x3fc0('0x40')]=function(_0x141b4c,_0x3730f5){logger[_0x3fc0('0x2f')](_0x3fc0('0x41'),_0x141b4c['body']);var _0x2cf279=unholdValidation[_0x3fc0('0xc')](_0x141b4c['body']);if(_0x2cf279['length']>0x0){return _0x3730f5[_0x3fc0('0x16')](0x190)[_0x3fc0('0x31')](_0x2cf279);}var _0x1f070b=_0x141b4c[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x330b8f=_0x141b4c[_0x3fc0('0x2a')][_0x3fc0('0x24')];return getAgent(_0x1f070b)[_0x3fc0('0x1a')](function(_0x1cc9f2){logger[_0x3fc0('0x2f')](_0x3fc0('0x3a'),_0x1cc9f2['name']);emit(util[_0x3fc0('0x30')](_0x3fc0('0x35'),_0x1cc9f2[_0x3fc0('0x15')]),_0x3fc0('0x42'),{'sessionId':_0x330b8f});return _0x3730f5[_0x3fc0('0x16')](0xc8)['json']({'error':![],'message':_0x3fc0('0x43')});})['catch'](handleError(_0x3730f5));};exports[_0x3fc0('0x44')]=function(_0xa4864f,_0x397434){logger[_0x3fc0('0x2f')]('calls\x20fired:',_0x397434[_0x3fc0('0x2a')]);var _0xd903e3=callsValidation[_0x3fc0('0xc')](_0xa4864f[_0x3fc0('0x2a')]);if(_0xd903e3[_0x3fc0('0x25')]>0x0){return _0x397434[_0x3fc0('0x16')](0x190)['json'](_0xd903e3);}var _0x2c5ca1=_0xa4864f[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x21c46f=respondWithRpcPromise(_0x3fc0('0x21'));var _0x737d45=getAgent(_0x2c5ca1);return Promise['all']([_0x21c46f,_0x737d45])[_0x3fc0('0x1a')](function(_0x258a27){var _0x3e04a1=_0x258a27[0x0];var _0x5a3732=_0x258a27[0x1];var _0x2cc735=_[_0x3fc0('0x22')](_0x3e04a1[_0x3fc0('0x45')],function(_0x2b709c){return _0x2b709c[_0x3fc0('0x23')]==_0x5a3732['id'];});return _0x397434[_0x3fc0('0x16')](0xc8)[_0x3fc0('0x31')]({'count':_0x2cc735[_0x3fc0('0x25')],'rows':_0x2cc735});})[_0x3fc0('0x1e')](handleError(_0x397434));};exports[_0x3fc0('0x46')]=function(_0x4a5b96,_0x194a3b){logger[_0x3fc0('0x2f')](_0x3fc0('0x47'),_0x4a5b96[_0x3fc0('0x2a')]);var _0x4cb346=conferenceValidation[_0x3fc0('0xc')](_0x4a5b96[_0x3fc0('0x2a')]);if(_0x4cb346[_0x3fc0('0x25')]>0x0){return _0x194a3b[_0x3fc0('0x16')](0x190)[_0x3fc0('0x31')](_0x4cb346);}var _0x27a828=_0x4a5b96[_0x3fc0('0x2a')][_0x3fc0('0x2b')];return getAgent(_0x27a828)[_0x3fc0('0x1a')](function(_0x2b9226){logger['info'](_0x3fc0('0x3a'),_0x2b9226[_0x3fc0('0x15')]);emit(util[_0x3fc0('0x30')](_0x3fc0('0x35'),_0x2b9226[_0x3fc0('0x15')]),_0x3fc0('0x48'));return _0x194a3b['status'](0xc8)[_0x3fc0('0x31')]({'error':![],'message':_0x3fc0('0x49')});})[_0x3fc0('0x1e')](handleError(_0x194a3b));};exports['transfer']=function(_0x40f6d8,_0x431087){logger[_0x3fc0('0x2f')](_0x3fc0('0x4a'),_0x40f6d8[_0x3fc0('0x2a')]);var _0x12758a=transferValidation[_0x3fc0('0xc')](_0x40f6d8[_0x3fc0('0x2a')]);if(_0x12758a[_0x3fc0('0x25')]>0x0){return _0x431087['status'](0x190)[_0x3fc0('0x31')](_0x12758a);}var _0x16cd67=_0x40f6d8[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x3b9b6f=_0x40f6d8['body'][_0x3fc0('0x24')];var _0x42c1ee=_0x40f6d8[_0x3fc0('0x2a')][_0x3fc0('0x4b')];return getAgent(_0x16cd67)[_0x3fc0('0x1a')](function(_0x20e372){logger[_0x3fc0('0x2f')](_0x3fc0('0x3a'),_0x20e372[_0x3fc0('0x15')]);emit(util[_0x3fc0('0x30')](_0x3fc0('0x35'),_0x20e372['name']),_0x3fc0('0x4c'),{'sessionId':_0x3b9b6f,'transferNumber':_0x42c1ee});return _0x431087['status'](0xc8)[_0x3fc0('0x31')]({'error':![],'message':_0x3fc0('0x4d')});})[_0x3fc0('0x1e')](handleError(_0x431087));};
\ No newline at end of file
+var _0x7a2c=['answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','unhold','webbar:unhold','unhold\x20executed!','all','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','transferNumber\x20is\x20required','stringify','log','handleError:','name','send','request','then','error','code','message','result','catch','User','agent','VoiceChannels','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','status','userId','body','callNumber','callerId','callbackUrl','info','format','user:%s','webbar:originate','json','hangup','hangup\x20fired:','length','entityFound:','webbar:hangup','hangup\x20executed!','answer'];(function(_0x5bd5b4,_0x42c432){var _0x5e442c=function(_0x520506){while(--_0x520506){_0x5bd5b4['push'](_0x5bd5b4['shift']());}};_0x5e442c(++_0x42c432);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x42d026,_0x3bc04e){_0x42d026=_0x42d026-0x0;var _0x819270=_0x7a2c[_0x42d026];return _0x819270;};'use strict';var path=require(_0xc7a2('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xc7a2('0x1'))['db'];var config=require(_0xc7a2('0x2'));var util=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var jayson=require(_0xc7a2('0x5'));var amiClient=jayson[_0xc7a2('0x6')][_0xc7a2('0x7')]({'port':0x232a});var logger=require(_0xc7a2('0x8'))('webbarapi');var Redis=require(_0xc7a2('0x9'));config[_0xc7a2('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc7a2('0xb'))(new Redis(config[_0xc7a2('0xa')]));var Schema=require(_0xc7a2('0xc'));var originateValidation=new Schema({'userId':{'type':_0xc7a2('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xc7a2('0xe'),'required':[!![],_0xc7a2('0xf')]},'callerId':{'type':_0xc7a2('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xc7a2('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xc7a2('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc7a2('0xd'),'required':[!![],_0xc7a2('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xc7a2('0xd'),'required':[!![],_0xc7a2('0x10')]},'sessionId':{'type':_0xc7a2('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xc7a2('0xe'),'required':[!![],_0xc7a2('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xc7a2('0xd'),'required':[!![],_0xc7a2('0x10')]},'sessionId':{'type':_0xc7a2('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xc7a2('0xd'),'required':[!![],_0xc7a2('0x10')]},'sessionId':{'type':_0xc7a2('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xc7a2('0xd'),'required':[!![],_0xc7a2('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0xc7a2('0xd'),'required':[!![],_0xc7a2('0x10')]}});function emit(_0x26d678,_0x2c3338,_0x2bc321){logger['info'](_0x26d678,_0x2c3338,JSON[_0xc7a2('0x12')](_0x2bc321));io['to'](_0x26d678)['emit'](_0x2c3338,_0x2bc321);}function handleError(_0x2414f4){return function(_0x302d54){console[_0xc7a2('0x13')](_0xc7a2('0x14'),_0x302d54,_0x302d54 instanceof RangeError);logger['error'](_0x302d54['stack']);if(_0x302d54 instanceof RangeError){if(_0x302d54[_0xc7a2('0x15')]){delete _0x302d54[_0xc7a2('0x15')];}_0x2414f4['status'](0x194)['send'](_0x302d54);}else{if(_0x302d54['name']){delete _0x302d54[_0xc7a2('0x15')];}_0x2414f4['status'](0x1f4)[_0xc7a2('0x16')](_0x302d54);}};}function checkError(){return function(_0x260be1){if(!_0x260be1){throw new RangeError('NotFound');}return _0x260be1;};}function respondWithRpcPromise(_0x40f3c4,_0x2dff1d){return new BPromise(function(_0x1b51a1,_0x35e0f6){var _0x337bdb=amiClient;return _0x337bdb[_0xc7a2('0x17')](_0x40f3c4,_0x2dff1d)[_0xc7a2('0x18')](function(_0x4a05e1){if(_0x4a05e1['error']){if(_0x4a05e1[_0xc7a2('0x19')][_0xc7a2('0x1a')]===0x1f4){return _0x35e0f6(_0x4a05e1['error'][_0xc7a2('0x1b')]);}return _0x1b51a1(_0x4a05e1[_0xc7a2('0x19')][_0xc7a2('0x1b')]);}else{_0x1b51a1(_0x4a05e1[_0xc7a2('0x1c')]);}})[_0xc7a2('0x1d')](function(_0x35584a){_0x35e0f6(_0x35584a);});});}function getAgent(_0x1beecd){return db[_0xc7a2('0x1e')]['findOne']({'where':{'id':_0x1beecd,'role':_0xc7a2('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x206eb7,_0x4cc3a8){return new BPromise(function(_0x20404b,_0x14182f){var _0xd93f19=respondWithRpcPromise(_0xc7a2('0x20'));var _0x4977f0=getAgent(_0x206eb7);Promise['all']([_0xd93f19,_0x4977f0])[_0xc7a2('0x18')](function(_0x2f3097){var _0x272c6b=_0x2f3097[0x0];var _0x305efb=_0x2f3097[0x1];var _0x3be88c=_[_0xc7a2('0x21')](_0x272c6b[_0xc7a2('0x22')],function(_0x5e970e){return _0x5e970e[_0xc7a2('0x23')]==_0x305efb['id']&&_0x5e970e[_0xc7a2('0x24')]==_0x4cc3a8;});if(_0x3be88c['length']==0x1){_0x20404b(_0x305efb);}else{_0x14182f(new RangeError(_0xc7a2('0x25')+_0x4cc3a8+_0xc7a2('0x26')));}});});}exports[_0xc7a2('0x27')]=function(_0x517df7,_0x2820a9){logger['info'](_0xc7a2('0x28'),_0x517df7['body']);var _0x5cd5ef=originateValidation[_0xc7a2('0xc')](_0x517df7['body']);if(_0x5cd5ef['length']>0x0){return _0x2820a9[_0xc7a2('0x29')](0x190)['json'](_0x5cd5ef);}var _0x3df1d2=_0x517df7['body'][_0xc7a2('0x2a')];var _0x2a8a26=_0x517df7[_0xc7a2('0x2b')][_0xc7a2('0x2c')];var _0x3d5d7e=_0x517df7[_0xc7a2('0x2b')][_0xc7a2('0x2d')];var _0x2a3bfb=_0x517df7[_0xc7a2('0x2b')][_0xc7a2('0x2e')];return getAgent(_0x3df1d2)['then'](function(_0x30234f){logger[_0xc7a2('0x2f')]('entityFound:',_0x30234f[_0xc7a2('0x15')]);emit(util[_0xc7a2('0x30')](_0xc7a2('0x31'),_0x30234f[_0xc7a2('0x15')]),_0xc7a2('0x32'),{'callNumber':_0x2a8a26,'callerId':_0x3d5d7e,'callbackUrl':_0x2a3bfb});return _0x2820a9[_0xc7a2('0x29')](0xc8)[_0xc7a2('0x33')]({'error':![],'message':'originate\x20executed!'});})[_0xc7a2('0x1d')](handleError(_0x2820a9));};exports[_0xc7a2('0x34')]=function(_0x468151,_0x49ad1f){logger[_0xc7a2('0x2f')](_0xc7a2('0x35'),_0x468151['body']);var _0x366706=hangupValidation[_0xc7a2('0xc')](_0x468151[_0xc7a2('0x2b')]);if(_0x366706[_0xc7a2('0x36')]>0x0){return _0x49ad1f[_0xc7a2('0x29')](0x190)[_0xc7a2('0x33')](_0x366706);}var _0x8559fe=_0x468151[_0xc7a2('0x2b')]['userId'];var _0xd418ee=_0x468151['body'][_0xc7a2('0x24')];return getAgent(_0x8559fe)[_0xc7a2('0x18')](function(_0x2cd014){logger[_0xc7a2('0x2f')](_0xc7a2('0x37'),_0x2cd014[_0xc7a2('0x15')]);emit(util[_0xc7a2('0x30')](_0xc7a2('0x31'),_0x2cd014['name']),_0xc7a2('0x38'),{'sessionId':_0xd418ee});return _0x49ad1f[_0xc7a2('0x29')](0xc8)[_0xc7a2('0x33')]({'error':![],'message':_0xc7a2('0x39')});})[_0xc7a2('0x1d')](handleError(_0x49ad1f));};exports[_0xc7a2('0x3a')]=function(_0x4c99de,_0x5ebb9c){logger['info'](_0xc7a2('0x3b'),_0x4c99de[_0xc7a2('0x2b')]);var _0x28ed1c=answerValidation[_0xc7a2('0xc')](_0x4c99de[_0xc7a2('0x2b')]);if(_0x28ed1c[_0xc7a2('0x36')]>0x0){return _0x5ebb9c[_0xc7a2('0x29')](0x190)[_0xc7a2('0x33')](_0x28ed1c);}var _0x246482=_0x4c99de['body']['userId'];var _0x4bcb42=_0x4c99de[_0xc7a2('0x2b')][_0xc7a2('0x24')];return getAgent(_0x246482)['then'](function(_0x44f2e9){logger[_0xc7a2('0x2f')](_0xc7a2('0x37'),_0x44f2e9['name']);emit(util[_0xc7a2('0x30')]('user:%s',_0x44f2e9[_0xc7a2('0x15')]),_0xc7a2('0x3c'),{'sessionId':_0x4bcb42});return _0x5ebb9c['status'](0xc8)['json']({'error':![],'message':_0xc7a2('0x3d')});})[_0xc7a2('0x1d')](handleError(_0x5ebb9c));};exports['hold']=function(_0x8b8cc2,_0x404e48){logger[_0xc7a2('0x2f')](_0xc7a2('0x3e'),_0x8b8cc2[_0xc7a2('0x2b')]);var _0xa81aa3=holdValidation['validate'](_0x8b8cc2[_0xc7a2('0x2b')]);if(_0xa81aa3[_0xc7a2('0x36')]>0x0){return _0x404e48[_0xc7a2('0x29')](0x190)[_0xc7a2('0x33')](_0xa81aa3);}var _0x54fc41=_0x8b8cc2[_0xc7a2('0x2b')][_0xc7a2('0x2a')];var _0x2adcc6=_0x8b8cc2[_0xc7a2('0x2b')][_0xc7a2('0x24')];return getAgent(_0x54fc41)[_0xc7a2('0x18')](function(_0x7378ed){logger[_0xc7a2('0x2f')]('entityFound:',_0x7378ed[_0xc7a2('0x15')]);emit(util[_0xc7a2('0x30')](_0xc7a2('0x31'),_0x7378ed[_0xc7a2('0x15')]),'webbar:hold',{'sessionId':_0x2adcc6});return _0x404e48[_0xc7a2('0x29')](0xc8)[_0xc7a2('0x33')]({'error':![],'message':'hold\x20executed!'});})[_0xc7a2('0x1d')](handleError(_0x404e48));};exports[_0xc7a2('0x3f')]=function(_0xb09c6f,_0x457318){logger[_0xc7a2('0x2f')]('unhold\x20fired:',_0xb09c6f[_0xc7a2('0x2b')]);var _0x44716e=unholdValidation[_0xc7a2('0xc')](_0xb09c6f['body']);if(_0x44716e['length']>0x0){return _0x457318[_0xc7a2('0x29')](0x190)['json'](_0x44716e);}var _0x4944b7=_0xb09c6f[_0xc7a2('0x2b')][_0xc7a2('0x2a')];var _0x4a6cb2=_0xb09c6f['body'][_0xc7a2('0x24')];return getAgent(_0x4944b7)[_0xc7a2('0x18')](function(_0x119355){logger[_0xc7a2('0x2f')](_0xc7a2('0x37'),_0x119355['name']);emit(util[_0xc7a2('0x30')](_0xc7a2('0x31'),_0x119355['name']),_0xc7a2('0x40'),{'sessionId':_0x4a6cb2});return _0x457318[_0xc7a2('0x29')](0xc8)[_0xc7a2('0x33')]({'error':![],'message':_0xc7a2('0x41')});})[_0xc7a2('0x1d')](handleError(_0x457318));};exports['calls']=function(_0xd91777,_0x40afd2){logger[_0xc7a2('0x2f')]('calls\x20fired:',_0x40afd2[_0xc7a2('0x2b')]);var _0x3174ef=callsValidation[_0xc7a2('0xc')](_0xd91777[_0xc7a2('0x2b')]);if(_0x3174ef[_0xc7a2('0x36')]>0x0){return _0x40afd2[_0xc7a2('0x29')](0x190)['json'](_0x3174ef);}var _0x458ee7=_0xd91777[_0xc7a2('0x2b')][_0xc7a2('0x2a')];var _0x332e8e=respondWithRpcPromise(_0xc7a2('0x20'));var _0x1f0762=getAgent(_0x458ee7);return Promise[_0xc7a2('0x42')]([_0x332e8e,_0x1f0762])['then'](function(_0x2b1bb3){var _0x4e51a8=_0x2b1bb3[0x0];var _0x4e1efa=_0x2b1bb3[0x1];var _0x38df09=_[_0xc7a2('0x21')](_0x4e51a8[_0xc7a2('0x22')],function(_0x4b3045){return _0x4b3045[_0xc7a2('0x23')]==_0x4e1efa['id'];});return _0x40afd2['status'](0xc8)['json']({'count':_0x38df09[_0xc7a2('0x36')],'rows':_0x38df09});})[_0xc7a2('0x1d')](handleError(_0x40afd2));};exports[_0xc7a2('0x43')]=function(_0x1c915b,_0x2fd2b2){logger[_0xc7a2('0x2f')]('conference\x20fired:',_0x1c915b['body']);var _0x5a91d1=conferenceValidation[_0xc7a2('0xc')](_0x1c915b['body']);if(_0x5a91d1['length']>0x0){return _0x2fd2b2['status'](0x190)['json'](_0x5a91d1);}var _0x100b1f=_0x1c915b[_0xc7a2('0x2b')][_0xc7a2('0x2a')];return getAgent(_0x100b1f)[_0xc7a2('0x18')](function(_0x52c83a){logger[_0xc7a2('0x2f')](_0xc7a2('0x37'),_0x52c83a[_0xc7a2('0x15')]);emit(util[_0xc7a2('0x30')](_0xc7a2('0x31'),_0x52c83a[_0xc7a2('0x15')]),_0xc7a2('0x44'));return _0x2fd2b2[_0xc7a2('0x29')](0xc8)[_0xc7a2('0x33')]({'error':![],'message':_0xc7a2('0x45')});})[_0xc7a2('0x1d')](handleError(_0x2fd2b2));};exports['transfer']=function(_0x531924,_0x3613be){logger['info'](_0xc7a2('0x46'),_0x531924[_0xc7a2('0x2b')]);var _0x3dc131=transferValidation[_0xc7a2('0xc')](_0x531924['body']);if(_0x3dc131[_0xc7a2('0x36')]>0x0){return _0x3613be[_0xc7a2('0x29')](0x190)[_0xc7a2('0x33')](_0x3dc131);}var _0xc7ce86=_0x531924[_0xc7a2('0x2b')]['userId'];var _0x1d387c=_0x531924[_0xc7a2('0x2b')][_0xc7a2('0x24')];var _0x45044a=_0x531924[_0xc7a2('0x2b')]['transferNumber'];return getAgent(_0xc7ce86)[_0xc7a2('0x18')](function(_0x4ce8d0){logger['info'](_0xc7a2('0x37'),_0x4ce8d0[_0xc7a2('0x15')]);emit(util[_0xc7a2('0x30')]('user:%s',_0x4ce8d0[_0xc7a2('0x15')]),_0xc7a2('0x47'),{'sessionId':_0x1d387c,'transferNumber':_0x45044a});return _0x3613be['status'](0xc8)[_0xc7a2('0x33')]({'error':![],'message':_0xc7a2('0x48')});})[_0xc7a2('0x1d')](handleError(_0x3613be));};
\ No newline at end of file
index ab5af7f..a96307f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93e9=['/describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','/:id/users','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x93e9,0xcc));var _0x993e=function(_0x6e76c2,_0x35c6fd){_0x6e76c2=_0x6e76c2-0x0;var _0x51c19a=_0x93e9[_0x6e76c2];return _0x51c19a;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['describe']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getDispositions']);router[_0x993e('0x9')](_0x993e('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x993e('0x9')]('/:id/users',auth[_0x993e('0xa')](),controller['getAgents']);router['get'](_0x993e('0x11'),auth[_0x993e('0xa')](),controller[_0x993e('0x12')]);router[_0x993e('0x13')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0x14')]);router[_0x993e('0x13')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller[_0x993e('0x15')]);router[_0x993e('0x13')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x16')]);router[_0x993e('0x13')](_0x993e('0x17'),auth[_0x993e('0xa')](),controller['addAgents']);router[_0x993e('0x13')](_0x993e('0x11'),auth[_0x993e('0xa')](),controller[_0x993e('0x18')]);router[_0x993e('0x13')](_0x993e('0x19'),controller['notify']);router[_0x993e('0x13')](_0x993e('0x1a'),auth[_0x993e('0xa')](),controller[_0x993e('0x1b')]);router[_0x993e('0x1c')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0x1d')]);router['delete'](_0x993e('0xd'),auth['isAuthenticated'](),controller[_0x993e('0x1e')]);router[_0x993e('0x1f')](_0x993e('0xf'),auth['isAuthenticated'](),controller[_0x993e('0x20')]);router[_0x993e('0x1f')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x21')]);router[_0x993e('0x1f')](_0x993e('0x17'),auth[_0x993e('0xa')](),controller[_0x993e('0x22')]);module[_0x993e('0x23')]=router;
\ No newline at end of file
+var _0xe3da=['/:id/send','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/notify','notify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0xb')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0xb')]('/:id/canned_answers',auth[_0xae3d('0xc')](),controller['getAnswers']);router[_0xae3d('0xb')](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x14')]);router['get'](_0xae3d('0x15'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x16')]);router[_0xae3d('0x17')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x18')]);router[_0xae3d('0x17')]('/:id/dispositions',auth[_0xae3d('0xc')](),controller[_0xae3d('0x19')]);router[_0xae3d('0x17')](_0xae3d('0x1a'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1b')]);router['post'](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1c')]);router['post'](_0xae3d('0x15'),auth[_0xae3d('0xc')](),controller['addApplications']);router['post'](_0xae3d('0x1d'),controller[_0xae3d('0x1e')]);router[_0xae3d('0x17')](_0xae3d('0x1f'),auth[_0xae3d('0xc')](),controller['send']);router[_0xae3d('0x20')]('/:id',auth[_0xae3d('0xc')](),controller[_0xae3d('0x21')]);router[_0xae3d('0x22')](_0xae3d('0x23'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x24')]);router[_0xae3d('0x22')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x25')]);router[_0xae3d('0x22')](_0xae3d('0x1a'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x26')]);router[_0xae3d('0x22')](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x27')]);module[_0xae3d('0x28')]=router;
\ No newline at end of file
index b52dc88..7aaf3a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18a4=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x18a4,0xa9));var _0x418a=function(_0x43c363,_0x16c2e1){_0x43c363=_0x43c363-0x0;var _0xf102f2=_0x18a4[_0x43c363];return _0xf102f2;};'use strict';var Sequelize=require(_0x418a('0x0'));var rs=require(_0x418a('0x1'));module[_0x418a('0x2')]={'name':{'type':Sequelize[_0x418a('0x3')],'unique':_0x418a('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x418a('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x418a('0x3')],'defaultValue':function(){return rs[_0x418a('0x5')]();}},'phone':{'type':Sequelize[_0x418a('0x3')]},'type':{'type':Sequelize['ENUM'](_0x418a('0x6'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x418a('0x3')]},'authToken':{'type':Sequelize[_0x418a('0x3')]},'notificationTemplate':{'type':Sequelize[_0x418a('0x7')],'defaultValue':function(){return _0x418a('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x418a('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x418a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x418a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x418a('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x418a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x418a('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x418a('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2ee4cd){if(!_0x2ee4cd){this[_0x418a('0xb')](_0x418a('0xc'),null);}this['setDataValue'](_0x418a('0xd'),_0x2ee4cd);}},'description':{'type':Sequelize[_0x418a('0x3')]}};
\ No newline at end of file
+var _0x656b=['name','ENUM','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x12cd74,_0x2e0610){var _0x311481=function(_0x178b3b){while(--_0x178b3b){_0x12cd74['push'](_0x12cd74['shift']());}};_0x311481(++_0x2e0610);}(_0x656b,0x92));var _0xb656=function(_0x4afdf9,_0x151826){_0x4afdf9=_0x4afdf9-0x0;var _0xe61e27=_0x656b[_0x4afdf9];return _0xe61e27;};'use strict';var Sequelize=require(_0xb656('0x0'));var rs=require(_0xb656('0x1'));module[_0xb656('0x2')]={'name':{'type':Sequelize[_0xb656('0x3')],'unique':_0xb656('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xb656('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xb656('0x3')]},'type':{'type':Sequelize[_0xb656('0x5')](_0xb656('0x6'),'sinch')},'accountSid':{'type':Sequelize[_0xb656('0x3')]},'baseUrl':{'type':Sequelize[_0xb656('0x3')]},'authToken':{'type':Sequelize[_0xb656('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb656('0x7')],'defaultValue':function(){return _0xb656('0x8');}},'notificationSound':{'type':Sequelize[_0xb656('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb656('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb656('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb656('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb656('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb656('0xa')],'comment':_0xb656('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xb656('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xda9af9){if(!_0xda9af9){this[_0xb656('0xc')](_0xb656('0xd'),null);}this[_0xb656('0xc')](_0xb656('0xe'),_0xda9af9);}},'description':{'type':Sequelize[_0xb656('0x3')]}};
\ No newline at end of file
index c2be7ca..2f1745d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbced=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','send','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','account','sinch','statuses','read','WhatsappMessage','applications','orderBy','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','unmanaged','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','updatedAt','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x2d0fff,_0x128adc){var _0x40c5b1=function(_0x2bbb86){while(--_0x2bbb86){_0x2d0fff['push'](_0x2d0fff['shift']());}};_0x40c5b1(++_0x128adc);}(_0xbced,0xb0));var _0xdbce=function(_0x41f213,_0x5df97f){_0x41f213=_0x41f213-0x0;var _0x12ef88=_0xbced[_0x41f213];return _0x12ef88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdbce('0x0'));var zipdir=require(_0xdbce('0x1'));var jsonpatch=require(_0xdbce('0x2'));var rp=require('request-promise');var moment=require(_0xdbce('0x3'));var BPromise=require(_0xdbce('0x4'));var Mustache=require(_0xdbce('0x5'));var util=require(_0xdbce('0x6'));var path=require(_0xdbce('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdbce('0x8'));var fs=require('fs');var fs_extra=require(_0xdbce('0x9'));var _=require(_0xdbce('0xa'));var squel=require(_0xdbce('0xb'));var crypto=require(_0xdbce('0xc'));var jsforce=require(_0xdbce('0xd'));var deskjs=require(_0xdbce('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbce('0xf'));var Papa=require(_0xdbce('0x10'));var Redis=require(_0xdbce('0x11'));var authService=require(_0xdbce('0x12'));var qs=require(_0xdbce('0x13'));var as=require(_0xdbce('0x14'));var hardwareService=require(_0xdbce('0x15'));var logger=require('../../config/logger')(_0xdbce('0x16'));var utils=require(_0xdbce('0x17'));var config=require(_0xdbce('0x18'));var licenseUtil=require(_0xdbce('0x19'));var db=require('../../mysqldb')['db'];config[_0xdbce('0x1a')]=_[_0xdbce('0x1b')](config[_0xdbce('0x1a')],{'host':_0xdbce('0x1c'),'port':0x18eb});var socket=require(_0xdbce('0x1d'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xdbce('0x1e'));var client=jayson[_0xdbce('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x220d28,_0x2c6b2d,_0x1fc7bb,_0x45c7d4){return new BPromise(function(_0x19d3d9,_0x3a0b29){var _0x4718dc=_0x45c7d4||client;return _0x4718dc[_0xdbce('0x20')](_0x220d28,_0x1fc7bb)[_0xdbce('0x21')](function(_0x212936){logger[_0xdbce('0x22')](_0xdbce('0x23'),_0x2c6b2d,'request\x20sent');logger['debug'](_0xdbce('0x24'),_0x2c6b2d,_0xdbce('0x25'),JSON[_0xdbce('0x26')](_0x212936));if(_0x212936['error']){if(_0x212936['error'][_0xdbce('0x27')]===0x1f4){logger[_0xdbce('0x28')](_0xdbce('0x23'),_0x2c6b2d,_0x212936['error'][_0xdbce('0x29')]);return _0x3a0b29(_0x212936[_0xdbce('0x28')][_0xdbce('0x29')]);}logger[_0xdbce('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x2c6b2d,_0x212936['error'][_0xdbce('0x29')]);return _0x19d3d9(_0x212936[_0xdbce('0x28')][_0xdbce('0x29')]);}else{logger[_0xdbce('0x22')](_0xdbce('0x23'),_0x2c6b2d,_0xdbce('0x25'));_0x19d3d9(_0x212936[_0xdbce('0x2a')]['message']);}})[_0xdbce('0x2b')](function(_0x2c1fad){logger[_0xdbce('0x28')](_0xdbce('0x23'),_0x2c6b2d,_0x2c1fad);_0x3a0b29(_0x2c1fad);});});}function respondWithStatusCode(_0x8a6bd5,_0x32cd6d){_0x32cd6d=_0x32cd6d||0xcc;return function(_0x493e54){if(_0x493e54){return _0x8a6bd5['sendStatus'](_0x32cd6d);}return _0x8a6bd5[_0xdbce('0x2c')](_0x32cd6d)[_0xdbce('0x2d')]();};}function respondWithResult(_0x7bc957,_0x2a7012){_0x2a7012=_0x2a7012||0xc8;return function(_0x53006e){if(_0x53006e){return _0x7bc957[_0xdbce('0x2c')](_0x2a7012)['json'](_0x53006e);}};}function respondWithFilteredResult(_0x413720,_0x586023){return function(_0x52eb2e){if(_0x52eb2e){var _0xcd88b=typeof _0x586023[_0xdbce('0x2e')]===_0xdbce('0x2f')&&typeof _0x586023[_0xdbce('0x30')]===_0xdbce('0x2f');var _0x433878=_0x52eb2e[_0xdbce('0x31')];var _0x4579b5=_0xcd88b?0x0:_0x586023['offset'];var _0x2a3c1a=_0xcd88b?_0x52eb2e[_0xdbce('0x31')]:_0x586023[_0xdbce('0x2e')]+_0x586023[_0xdbce('0x30')];var _0x1d01bd;if(_0x2a3c1a>=_0x433878){_0x2a3c1a=_0x433878;_0x1d01bd=0xc8;}else{_0x1d01bd=0xce;}_0x413720['status'](_0x1d01bd);return _0x413720['set'](_0xdbce('0x32'),_0x4579b5+'-'+_0x2a3c1a+'/'+_0x433878)[_0xdbce('0x33')](_0x52eb2e);}return null;};}function patchUpdates(_0x51191d){return function(_0x4e1b90){try{jsonpatch[_0xdbce('0x34')](_0x4e1b90,_0x51191d,!![]);}catch(_0x31d02d){return BPromise['reject'](_0x31d02d);}return _0x4e1b90[_0xdbce('0x35')]();};}function saveUpdates(_0x3506d9,_0x22cf53){return function(_0x27758a){if(_0x27758a){return _0x27758a[_0xdbce('0x36')](_0x3506d9)[_0xdbce('0x21')](function(_0x16ec3c){return _0x16ec3c;});}return null;};}function removeEntity(_0x1b65b0,_0x23b613){return function(_0x1194e5){if(_0x1194e5){return _0x1194e5[_0xdbce('0x37')]()['then'](function(){var _0x21623d=_0x1194e5[_0xdbce('0x38')]({'plain':!![]});var _0x3b474f=_0xdbce('0x39');return db[_0xdbce('0x3a')][_0xdbce('0x37')]({'where':{'type':_0x3b474f,'resourceId':_0x21623d['id']}})[_0xdbce('0x21')](function(){return _0x1194e5;});})[_0xdbce('0x21')](function(){_0x1b65b0[_0xdbce('0x2c')](0xcc)[_0xdbce('0x2d')]();});}};}function handleEntityNotFound(_0x2df803,_0x40e009){return function(_0x4e2341){if(!_0x4e2341){_0x2df803[_0xdbce('0x3b')](0x194);}return _0x4e2341;};}function handleError(_0x1d5f4e,_0x32b092){_0x32b092=_0x32b092||0x1f4;return function(_0x47d12c){logger[_0xdbce('0x28')](_0x47d12c[_0xdbce('0x3c')]);if(_0x47d12c['name']){delete _0x47d12c[_0xdbce('0x3d')];}_0x1d5f4e[_0xdbce('0x2c')](_0x32b092)[_0xdbce('0x3e')](_0x47d12c);};}exports['index']=function(_0x5aae77,_0x277ee2){var _0x2d29b7={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3875c6={},_0xbcbede={'count':0x0,'rows':[]};var _0x402218=_[_0xdbce('0x3f')](db[_0xdbce('0x40')][_0xdbce('0x41')],function(_0x1163dc){return{'name':_0x1163dc[_0xdbce('0x42')],'type':_0x1163dc[_0xdbce('0x43')][_0xdbce('0x44')]};});_0x3875c6[_0xdbce('0x45')]=_[_0xdbce('0x3f')](_0x402218,'name');_0x3875c6[_0xdbce('0x46')]=_[_0xdbce('0x47')](_0x5aae77[_0xdbce('0x46')]);_0x3875c6[_0xdbce('0x48')]=_['intersection'](_0x3875c6['model'],_0x3875c6[_0xdbce('0x46')]);_0x2d29b7['attributes']=_[_0xdbce('0x49')](_0x3875c6[_0xdbce('0x45')],qs[_0xdbce('0x4a')](_0x5aae77[_0xdbce('0x46')][_0xdbce('0x4a')]));_0x2d29b7[_0xdbce('0x4b')]=_0x2d29b7[_0xdbce('0x4b')][_0xdbce('0x4c')]?_0x2d29b7['attributes']:_0x3875c6[_0xdbce('0x45')];if(!_0x5aae77[_0xdbce('0x46')][_0xdbce('0x4d')]('nolimit')){_0x2d29b7[_0xdbce('0x30')]=qs[_0xdbce('0x30')](_0x5aae77['query'][_0xdbce('0x30')]);_0x2d29b7[_0xdbce('0x2e')]=qs['offset'](_0x5aae77['query']['offset']);}_0x2d29b7[_0xdbce('0x4e')]=qs[_0xdbce('0x4f')](_0x5aae77[_0xdbce('0x46')][_0xdbce('0x4f')]);_0x2d29b7[_0xdbce('0x50')]=qs['filters'](_['pick'](_0x5aae77[_0xdbce('0x46')],_0x3875c6['filters']),_0x402218);if(_0x5aae77[_0xdbce('0x46')][_0xdbce('0x51')]){_0x2d29b7[_0xdbce('0x50')]=_[_0xdbce('0x52')](_0x2d29b7[_0xdbce('0x50')],{'$or':_['map'](_0x402218,function(_0x33291d){if(_0x33291d[_0xdbce('0x43')]!==_0xdbce('0x53')){var _0x3ce501={};_0x3ce501[_0x33291d['name']]={'$like':'%'+_0x5aae77[_0xdbce('0x46')]['filter']+'%'};return _0x3ce501;}})});}_0x2d29b7=_[_0xdbce('0x52')]({},_0x2d29b7,_0x5aae77[_0xdbce('0x54')]);var _0x32dde3={'where':_0x2d29b7['where']};return db[_0xdbce('0x40')][_0xdbce('0x31')](_0x32dde3)[_0xdbce('0x21')](function(_0x28547c){_0xbcbede[_0xdbce('0x31')]=_0x28547c;if(_0x5aae77['query'][_0xdbce('0x55')]){_0x2d29b7[_0xdbce('0x56')]=[{'all':!![]}];}return db[_0xdbce('0x40')][_0xdbce('0x57')](_0x2d29b7);})[_0xdbce('0x21')](function(_0x233e39){_0xbcbede[_0xdbce('0x58')]=_0x233e39;return _0xbcbede;})[_0xdbce('0x21')](respondWithFilteredResult(_0x277ee2,_0x2d29b7))[_0xdbce('0x2b')](handleError(_0x277ee2,null));};exports[_0xdbce('0x59')]=function(_0x2cad43,_0x379c85){var _0x4cf706={'raw':![],'where':{'id':_0x2cad43[_0xdbce('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x25a9df={};_0x25a9df[_0xdbce('0x45')]=_[_0xdbce('0x47')](db[_0xdbce('0x40')][_0xdbce('0x41')]);_0x25a9df[_0xdbce('0x46')]=_[_0xdbce('0x47')](_0x2cad43['query']);_0x25a9df[_0xdbce('0x48')]=_['intersection'](_0x25a9df[_0xdbce('0x45')],_0x25a9df['query']);_0x4cf706[_0xdbce('0x4b')]=_['intersection'](_0x25a9df['model'],qs[_0xdbce('0x4a')](_0x2cad43['query'][_0xdbce('0x4a')]));_0x4cf706[_0xdbce('0x4b')]=_0x4cf706[_0xdbce('0x4b')][_0xdbce('0x4c')]?_0x4cf706['attributes']:_0x25a9df['model'];if(_0x2cad43[_0xdbce('0x46')][_0xdbce('0x55')]){_0x4cf706['include']=[{'all':!![]}];}_0x4cf706=_[_0xdbce('0x52')]({},_0x4cf706,_0x2cad43[_0xdbce('0x54')]);return db[_0xdbce('0x40')][_0xdbce('0x5b')](_0x4cf706)[_0xdbce('0x21')](handleEntityNotFound(_0x379c85,null))[_0xdbce('0x21')](respondWithResult(_0x379c85,null))[_0xdbce('0x2b')](handleError(_0x379c85,null));};exports['create']=function(_0x50867d,_0x4f948c){return db[_0xdbce('0x40')][_0xdbce('0x5c')](_0x50867d[_0xdbce('0x5d')],{})[_0xdbce('0x21')](function(_0x2bfab0){var _0x45c251=_0x50867d['user'][_0xdbce('0x38')]({'plain':!![]});if(!_0x45c251)throw new Error(_0xdbce('0x5e'));if(_0x45c251[_0xdbce('0x5f')]===_0xdbce('0x60')){var _0x407bfc=_0x2bfab0['get']({'plain':!![]});var _0x10813b='WhatsappAccounts';return db[_0xdbce('0x61')]['find']({'where':{'name':_0x10813b,'userProfileId':_0x45c251[_0xdbce('0x62')]},'raw':!![]})[_0xdbce('0x21')](function(_0x172d19){if(_0x172d19&&_0x172d19['autoAssociation']===0x0){return db[_0xdbce('0x3a')]['create']({'name':_0x407bfc['name'],'resourceId':_0x407bfc['id'],'type':_0x172d19['name'],'sectionId':_0x172d19['id']},{})[_0xdbce('0x21')](function(){return _0x2bfab0;});}else{return _0x2bfab0;}})['catch'](function(_0x320b7e){logger[_0xdbce('0x28')](_0xdbce('0x63'),_0x320b7e);throw _0x320b7e;});}return _0x2bfab0;})[_0xdbce('0x21')](respondWithResult(_0x4f948c,0xc9))[_0xdbce('0x2b')](handleError(_0x4f948c,null));};exports[_0xdbce('0x36')]=function(_0x329421,_0x11d5f6){if(_0x329421[_0xdbce('0x5d')]['id']){delete _0x329421['body']['id'];}return db[_0xdbce('0x40')][_0xdbce('0x5b')]({'where':{'id':_0x329421[_0xdbce('0x5a')]['id']},'include':[{'model':db[_0xdbce('0x64')],'as':_0xdbce('0x65')}]})[_0xdbce('0x21')](handleEntityNotFound(_0x11d5f6,null))[_0xdbce('0x21')](saveUpdates(_0x329421['body'],null))['then'](respondWithResult(_0x11d5f6,null))[_0xdbce('0x2b')](handleError(_0x11d5f6,null));};exports[_0xdbce('0x37')]=function(_0x57f9b5,_0x38fa72){return db[_0xdbce('0x40')][_0xdbce('0x5b')]({'where':{'id':_0x57f9b5['params']['id']}})[_0xdbce('0x21')](handleEntityNotFound(_0x38fa72,null))[_0xdbce('0x21')](removeEntity(_0x38fa72,null))[_0xdbce('0x2b')](handleError(_0x38fa72,null));};exports['describe']=function(_0x4deee1,_0x296899){return db[_0xdbce('0x40')][_0xdbce('0x66')]()[_0xdbce('0x21')](respondWithResult(_0x296899,null))[_0xdbce('0x2b')](handleError(_0x296899,null));};exports[_0xdbce('0x67')]=function(_0x86b2fd,_0xf48460,_0x1ab4dd){if(_0x86b2fd[_0xdbce('0x5d')]['id']){delete _0x86b2fd[_0xdbce('0x5d')]['id'];}return db[_0xdbce('0x40')][_0xdbce('0x5b')]({'where':{'id':_0x86b2fd['params']['id']}})['then'](handleEntityNotFound(_0xf48460,null))[_0xdbce('0x21')](function(_0x4922f3){if(_0x4922f3){_0x86b2fd[_0xdbce('0x5d')][_0xdbce('0x68')]=_0x4922f3['id'];return db[_0xdbce('0x69')][_0xdbce('0x5c')](_0x86b2fd['body']);}})[_0xdbce('0x21')](respondWithResult(_0xf48460,null))[_0xdbce('0x2b')](handleError(_0xf48460,null));};exports[_0xdbce('0x6a')]=function(_0x242304,_0x2e4a95,_0x6cad6c){var _0x316812={'raw':![],'where':{}};var _0x45c3c3={};var _0x3670b6={'count':0x0,'rows':[]};return db[_0xdbce('0x40')][_0xdbce('0x6b')]({'where':{'id':_0x242304[_0xdbce('0x5a')]['id']}})[_0xdbce('0x21')](handleEntityNotFound(_0x2e4a95,null))[_0xdbce('0x21')](function(_0x4017dc){if(_0x4017dc){_0x45c3c3['model']=_[_0xdbce('0x47')](db[_0xdbce('0x69')][_0xdbce('0x41')]);_0x45c3c3[_0xdbce('0x46')]=_[_0xdbce('0x47')](_0x242304[_0xdbce('0x46')]);_0x45c3c3[_0xdbce('0x48')]=_[_0xdbce('0x49')](_0x45c3c3[_0xdbce('0x45')],_0x45c3c3[_0xdbce('0x46')]);_0x316812[_0xdbce('0x4b')]=_['intersection'](_0x45c3c3['model'],qs['fields'](_0x242304['query'][_0xdbce('0x4a')]));_0x316812[_0xdbce('0x4b')]=_0x316812['attributes'][_0xdbce('0x4c')]?_0x316812['attributes']:_0x45c3c3[_0xdbce('0x45')];if(!_0x242304['query'][_0xdbce('0x4d')](_0xdbce('0x6c'))){_0x316812[_0xdbce('0x30')]=qs[_0xdbce('0x30')](_0x242304[_0xdbce('0x46')][_0xdbce('0x30')]);_0x316812[_0xdbce('0x2e')]=qs[_0xdbce('0x2e')](_0x242304[_0xdbce('0x46')][_0xdbce('0x2e')]);}_0x316812[_0xdbce('0x4e')]=qs[_0xdbce('0x4f')](_0x242304['query'][_0xdbce('0x4f')]);_0x316812[_0xdbce('0x50')]=qs[_0xdbce('0x48')](_[_0xdbce('0x6d')](_0x242304[_0xdbce('0x46')],_0x45c3c3[_0xdbce('0x48')]));_0x316812[_0xdbce('0x50')][_0xdbce('0x68')]=_0x4017dc['id'];if(_0x242304['query']['filter']){_0x316812['where']=_[_0xdbce('0x52')](_0x316812[_0xdbce('0x50')],{'$or':_[_0xdbce('0x3f')](_0x316812[_0xdbce('0x4b')],function(_0x27a71f){var _0x168c94={};_0x168c94[_0x27a71f]={'$like':'%'+_0x242304[_0xdbce('0x46')][_0xdbce('0x51')]+'%'};return _0x168c94;})});}_0x316812=_[_0xdbce('0x52')]({},_0x316812,_0x242304[_0xdbce('0x54')]);return db[_0xdbce('0x69')][_0xdbce('0x31')]({'where':_0x316812[_0xdbce('0x50')]})[_0xdbce('0x21')](function(_0x454291){_0x3670b6[_0xdbce('0x31')]=_0x454291;if(_0x242304[_0xdbce('0x46')][_0xdbce('0x55')]){_0x316812[_0xdbce('0x56')]=[{'all':!![]}];}return db[_0xdbce('0x69')][_0xdbce('0x57')](_0x316812);})[_0xdbce('0x21')](function(_0x13d327){_0x3670b6[_0xdbce('0x58')]=_0x13d327;return _0x3670b6;});}})[_0xdbce('0x21')](respondWithFilteredResult(_0x2e4a95,_0x316812))[_0xdbce('0x2b')](handleError(_0x2e4a95,null));};exports[_0xdbce('0x6e')]=function(_0x4caa2c,_0x56e0ca,_0x48bba9){return db[_0xdbce('0x40')][_0xdbce('0x5b')]({'where':{'id':_0x4caa2c['params']['id']}})[_0xdbce('0x21')](handleEntityNotFound(_0x56e0ca,null))[_0xdbce('0x21')](function(_0x3e9cc0){if(_0x3e9cc0){return _0x3e9cc0[_0xdbce('0x6e')](_0x4caa2c['query'][_0xdbce('0x6f')]);}})[_0xdbce('0x21')](respondWithStatusCode(_0x56e0ca,null))['catch'](handleError(_0x56e0ca,null));};exports[_0xdbce('0x70')]=function(_0x2bd7c6,_0x33fe61,_0x27332f){if(_0x2bd7c6[_0xdbce('0x5d')]['id']){delete _0x2bd7c6[_0xdbce('0x5d')]['id'];}return db[_0xdbce('0x40')][_0xdbce('0x5b')]({'where':{'id':_0x2bd7c6['params']['id']}})['then'](handleEntityNotFound(_0x33fe61,null))['then'](function(_0x24fc81){if(_0x24fc81){_0x2bd7c6['body']['WhatsappAccountId']=_0x24fc81['id'];return db[_0xdbce('0x71')][_0xdbce('0x5c')](_0x2bd7c6[_0xdbce('0x5d')]);}})[_0xdbce('0x21')](respondWithResult(_0x33fe61,null))[_0xdbce('0x2b')](handleError(_0x33fe61,null));};exports[_0xdbce('0x72')]=function(_0x3ac278,_0x53fdac,_0xed4786){var _0x228790={'raw':![],'where':{}};var _0x31d86e={};var _0x4f8e2a={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xdbce('0x6b')]({'where':{'id':_0x3ac278[_0xdbce('0x5a')]['id']}})[_0xdbce('0x21')](handleEntityNotFound(_0x53fdac,null))['then'](function(_0x9bccf8){if(_0x9bccf8){_0x31d86e[_0xdbce('0x45')]=_[_0xdbce('0x47')](db[_0xdbce('0x71')][_0xdbce('0x41')]);_0x31d86e[_0xdbce('0x46')]=_[_0xdbce('0x47')](_0x3ac278[_0xdbce('0x46')]);_0x31d86e[_0xdbce('0x48')]=_[_0xdbce('0x49')](_0x31d86e[_0xdbce('0x45')],_0x31d86e[_0xdbce('0x46')]);_0x228790[_0xdbce('0x4b')]=_[_0xdbce('0x49')](_0x31d86e[_0xdbce('0x45')],qs[_0xdbce('0x4a')](_0x3ac278['query'][_0xdbce('0x4a')]));_0x228790[_0xdbce('0x4b')]=_0x228790[_0xdbce('0x4b')][_0xdbce('0x4c')]?_0x228790[_0xdbce('0x4b')]:_0x31d86e[_0xdbce('0x45')];if(!_0x3ac278[_0xdbce('0x46')][_0xdbce('0x4d')]('nolimit')){_0x228790[_0xdbce('0x30')]=qs[_0xdbce('0x30')](_0x3ac278[_0xdbce('0x46')][_0xdbce('0x30')]);_0x228790['offset']=qs['offset'](_0x3ac278['query'][_0xdbce('0x2e')]);}_0x228790['order']=qs['sort'](_0x3ac278[_0xdbce('0x46')][_0xdbce('0x4f')]);_0x228790[_0xdbce('0x50')]=qs[_0xdbce('0x48')](_['pick'](_0x3ac278['query'],_0x31d86e[_0xdbce('0x48')]));_0x228790[_0xdbce('0x50')][_0xdbce('0x68')]=_0x9bccf8['id'];if(_0x3ac278['query']['filter']){_0x228790[_0xdbce('0x50')]=_[_0xdbce('0x52')](_0x228790[_0xdbce('0x50')],{'$or':_[_0xdbce('0x3f')](_0x228790[_0xdbce('0x4b')],function(_0x38108d){var _0x53c230={};_0x53c230[_0x38108d]={'$like':'%'+_0x3ac278[_0xdbce('0x46')]['filter']+'%'};return _0x53c230;})});}_0x228790=_[_0xdbce('0x52')]({},_0x228790,_0x3ac278['options']);return db[_0xdbce('0x71')][_0xdbce('0x31')]({'where':_0x228790[_0xdbce('0x50')]})['then'](function(_0x4632a8){_0x4f8e2a[_0xdbce('0x31')]=_0x4632a8;if(_0x3ac278['query'][_0xdbce('0x55')]){_0x228790[_0xdbce('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xdbce('0x57')](_0x228790);})['then'](function(_0xd82e60){_0x4f8e2a['rows']=_0xd82e60;return _0x4f8e2a;});}})[_0xdbce('0x21')](respondWithFilteredResult(_0x53fdac,_0x228790))[_0xdbce('0x2b')](handleError(_0x53fdac,null));};exports[_0xdbce('0x73')]=function(_0x4e9f28,_0x444566,_0x89ce88){return db[_0xdbce('0x40')]['find']({'where':{'id':_0x4e9f28[_0xdbce('0x5a')]['id']}})[_0xdbce('0x21')](handleEntityNotFound(_0x444566,null))[_0xdbce('0x21')](function(_0x14fcf5){if(_0x14fcf5){return _0x14fcf5['removeAnswers'](_0x4e9f28[_0xdbce('0x46')]['ids']);}})[_0xdbce('0x21')](respondWithStatusCode(_0x444566,null))[_0xdbce('0x2b')](handleError(_0x444566,null));};exports[_0xdbce('0x74')]=function(_0x45ca41,_0x1c456a,_0x3817ed){return db[_0xdbce('0x40')][_0xdbce('0x5b')]({'where':{'id':_0x45ca41['params']['id']}})[_0xdbce('0x21')](handleEntityNotFound(_0x1c456a,null))['then'](function(_0x5818b2){if(_0x5818b2){return _0x5818b2['addAgents'](_0x45ca41[_0xdbce('0x5d')][_0xdbce('0x6f')],_[_0xdbce('0x75')](_0x45ca41[_0xdbce('0x5d')],[_0xdbce('0x6f'),'id'])||{})[_0xdbce('0x76')](function(_0xb05543){for(var _0xc8ff15=0x0;_0xc8ff15<_0x45ca41[_0xdbce('0x5d')][_0xdbce('0x6f')][_0xdbce('0x4c')];_0xc8ff15+=0x1){socket[_0xdbce('0x77')](_0xdbce('0x78'),{'UserId':Number(_0x45ca41[_0xdbce('0x5d')]['ids'][_0xc8ff15]),'WhatsappAccountId':Number(_0x45ca41[_0xdbce('0x5a')]['id'])});}return _0xb05543;});}})[_0xdbce('0x21')](respondWithResult(_0x1c456a,null))['catch'](handleError(_0x1c456a,null));};exports[_0xdbce('0x79')]=function(_0x25782e,_0x36ac20,_0x310eb4){return db[_0xdbce('0x40')][_0xdbce('0x5b')]({'where':{'id':_0x25782e[_0xdbce('0x5a')]['id']}})[_0xdbce('0x21')](handleEntityNotFound(_0x36ac20,null))[_0xdbce('0x21')](function(_0x1b2a37){if(_0x1b2a37){return _0x1b2a37[_0xdbce('0x79')](_0x25782e['query'][_0xdbce('0x6f')])['then'](function(){if(_[_0xdbce('0x7a')](_0x25782e[_0xdbce('0x46')][_0xdbce('0x6f')])){for(var _0x7d1dea=0x0;_0x7d1dea<_0x25782e['query'][_0xdbce('0x6f')][_0xdbce('0x4c')];_0x7d1dea+=0x1){socket['emit'](_0xdbce('0x7b'),{'UserId':Number(_0x25782e['query'][_0xdbce('0x6f')][_0x7d1dea]),'WhatsappAccountId':Number(_0x25782e[_0xdbce('0x5a')]['id'])});}}else{socket[_0xdbce('0x77')]('userWhatsappAccount:remove',{'UserId':Number(_0x25782e[_0xdbce('0x46')][_0xdbce('0x6f')]),'WhatsappAccountId':Number(_0x25782e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x36ac20,null))['catch'](handleError(_0x36ac20,null));};exports[_0xdbce('0x7c')]=function(_0x36e33b,_0x15ee9b,_0x26d779){var _0x4b9ea5={};var _0x4c4c80={};var _0x50ec1a;var _0x543ac2;return db[_0xdbce('0x40')]['findOne']({'where':{'id':_0x36e33b[_0xdbce('0x5a')]['id']}})[_0xdbce('0x21')](handleEntityNotFound(_0x15ee9b,null))[_0xdbce('0x21')](function(_0x53144e){if(_0x53144e){_0x50ec1a=_0x53144e;_0x4c4c80[_0xdbce('0x45')]=_['keys'](db[_0xdbce('0x7d')][_0xdbce('0x41')]);_0x4c4c80[_0xdbce('0x46')]=_[_0xdbce('0x47')](_0x36e33b[_0xdbce('0x46')]);_0x4c4c80[_0xdbce('0x48')]=_[_0xdbce('0x49')](_0x4c4c80[_0xdbce('0x45')],_0x4c4c80[_0xdbce('0x46')]);_0x4b9ea5[_0xdbce('0x4b')]=_[_0xdbce('0x49')](_0x4c4c80[_0xdbce('0x45')],qs['fields'](_0x36e33b[_0xdbce('0x46')][_0xdbce('0x4a')]));_0x4b9ea5[_0xdbce('0x4b')]=_0x4b9ea5[_0xdbce('0x4b')][_0xdbce('0x4c')]?_0x4b9ea5[_0xdbce('0x4b')]:_0x4c4c80[_0xdbce('0x45')];_0x4b9ea5[_0xdbce('0x4e')]=qs['sort'](_0x36e33b['query'][_0xdbce('0x4f')]);_0x4b9ea5['where']=qs['filters'](_[_0xdbce('0x6d')](_0x36e33b[_0xdbce('0x46')],_0x4c4c80[_0xdbce('0x48')]));if(_0x36e33b[_0xdbce('0x46')][_0xdbce('0x51')]){_0x4b9ea5['where']=_[_0xdbce('0x52')](_0x4b9ea5[_0xdbce('0x50')],{'$or':_[_0xdbce('0x3f')](_0x4b9ea5[_0xdbce('0x4b')],function(_0x50a535){var _0x26a99e={};_0x26a99e[_0x50a535]={'$like':'%'+_0x36e33b[_0xdbce('0x46')][_0xdbce('0x51')]+'%'};return _0x26a99e;})});}_0x4b9ea5=_[_0xdbce('0x52')]({},_0x4b9ea5,_0x36e33b[_0xdbce('0x54')]);return _0x50ec1a[_0xdbce('0x7c')](_0x4b9ea5);}})[_0xdbce('0x21')](function(_0x4d7858){if(_0x4d7858){_0x543ac2=_0x4d7858['length'];if(!_0x36e33b[_0xdbce('0x46')][_0xdbce('0x4d')](_0xdbce('0x6c'))){_0x4b9ea5[_0xdbce('0x30')]=qs[_0xdbce('0x30')](_0x36e33b[_0xdbce('0x46')]['limit']);_0x4b9ea5[_0xdbce('0x2e')]=qs[_0xdbce('0x2e')](_0x36e33b[_0xdbce('0x46')]['offset']);}return _0x50ec1a[_0xdbce('0x7c')](_0x4b9ea5);}})[_0xdbce('0x21')](function(_0xc37e82){if(_0xc37e82){return _0xc37e82?{'count':_0x543ac2,'rows':_0xc37e82}:null;}})[_0xdbce('0x21')](respondWithResult(_0x15ee9b,null))[_0xdbce('0x2b')](handleError(_0x15ee9b,null));};exports[_0xdbce('0x7e')]=function(_0x3e9f7f,_0x3b1b6e){var _0x28aea8=_0x3e9f7f['params']['id'];var _0x268694=_0x3e9f7f[_0xdbce('0x5d')];var _0x5c8937=0xc8;var _0x397d99=null;return db[_0xdbce('0x7f')]['transaction']({'isolationLevel':db[_0xdbce('0x7f')][_0xdbce('0x80')][_0xdbce('0x81')][_0xdbce('0x82')]},function(_0x209bb1){return db[_0xdbce('0x40')][_0xdbce('0x6b')]({'where':{'id':_0x28aea8},'transaction':_0x209bb1})[_0xdbce('0x21')](function(_0x5a23f7){if(_0x5a23f7){return db[_0xdbce('0x83')][_0xdbce('0x37')]({'where':{'WhatsappAccountId':_0x28aea8},'transaction':_0x209bb1})[_0xdbce('0x21')](function(){var _0x22412a=_[_0xdbce('0x3f')](_0x268694,function(_0x208c43){_0x208c43[_0xdbce('0x68')]=_0x28aea8;return _0x208c43;});return db[_0xdbce('0x83')][_0xdbce('0x84')](_0x22412a,{'transaction':_0x209bb1});});}else{_0x5c8937=0x194;_0x397d99=[];}});})['then'](function(){if(_0x5c8937!==0x194){return db['WhatsappApplication'][_0xdbce('0x85')]({'where':{'WhatsappAccountId':_0x28aea8},'order':_0xdbce('0x86')})[_0xdbce('0x21')](function(_0x2fd9f0){_0x397d99=_0x2fd9f0;});}})['catch'](function(_0x6f4e9b){_0x5c8937=0x1f4;logger['error'](_0x6f4e9b[_0xdbce('0x3c')]);if(_0x6f4e9b[_0xdbce('0x3d')]){delete _0x6f4e9b[_0xdbce('0x3d')];}_0x397d99=_0x6f4e9b;})[_0xdbce('0x87')](function(){if(_0x397d99===null){_0x3b1b6e[_0xdbce('0x3b')](_0x5c8937);}else{if(_0x5c8937===0x1f4){_0x3b1b6e['status'](_0x5c8937)[_0xdbce('0x3e')](_0x397d99);}else{_0x3b1b6e[_0xdbce('0x2c')](_0x5c8937)[_0xdbce('0x33')](_0x397d99);}}});};exports[_0xdbce('0x88')]=function(_0x57e3e8,_0x167373,_0x3fb687){var _0x4e50af={};var _0x2487b4={};var _0x46d186;var _0x5e7b89;return db['WhatsappAccount']['findOne']({'where':{'id':_0x57e3e8['params']['id']}})['then'](handleEntityNotFound(_0x167373,null))['then'](function(_0x14fa92){if(_0x14fa92){_0x46d186=_0x14fa92;_0x2487b4['model']=_[_0xdbce('0x47')](db['WhatsappApplication'][_0xdbce('0x41')]);_0x2487b4[_0xdbce('0x46')]=_[_0xdbce('0x47')](_0x57e3e8[_0xdbce('0x46')]);_0x2487b4[_0xdbce('0x48')]=_[_0xdbce('0x49')](_0x2487b4['model'],_0x2487b4[_0xdbce('0x46')]);_0x4e50af[_0xdbce('0x4b')]=_[_0xdbce('0x49')](_0x2487b4[_0xdbce('0x45')],qs[_0xdbce('0x4a')](_0x57e3e8[_0xdbce('0x46')][_0xdbce('0x4a')]));_0x4e50af[_0xdbce('0x4b')]=_0x4e50af[_0xdbce('0x4b')]['length']?_0x4e50af[_0xdbce('0x4b')]:_0x2487b4[_0xdbce('0x45')];_0x4e50af['order']=qs[_0xdbce('0x4f')](_0x57e3e8[_0xdbce('0x46')][_0xdbce('0x4f')]);_0x4e50af['where']=qs['filters'](_[_0xdbce('0x6d')](_0x57e3e8[_0xdbce('0x46')],_0x2487b4[_0xdbce('0x48')]));if(_0x57e3e8[_0xdbce('0x46')][_0xdbce('0x51')]){_0x4e50af[_0xdbce('0x50')]=_[_0xdbce('0x52')](_0x4e50af[_0xdbce('0x50')],{'$or':_[_0xdbce('0x3f')](_0x4e50af[_0xdbce('0x4b')],function(_0x2a0619){var _0x92c3bf={};_0x92c3bf[_0x2a0619]={'$like':'%'+_0x57e3e8[_0xdbce('0x46')][_0xdbce('0x51')]+'%'};return _0x92c3bf;})});}_0x4e50af=_[_0xdbce('0x52')]({},_0x4e50af,_0x57e3e8[_0xdbce('0x54')]);return _0x46d186['getApplications'](_0x4e50af);}})['then'](function(_0x4398dc){if(_0x4398dc){_0x5e7b89=_0x4398dc[_0xdbce('0x4c')];if(!_0x57e3e8[_0xdbce('0x46')]['hasOwnProperty'](_0xdbce('0x6c'))){_0x4e50af[_0xdbce('0x30')]=qs[_0xdbce('0x30')](_0x57e3e8[_0xdbce('0x46')][_0xdbce('0x30')]);_0x4e50af['offset']=qs[_0xdbce('0x2e')](_0x57e3e8[_0xdbce('0x46')][_0xdbce('0x2e')]);}return _0x46d186[_0xdbce('0x88')](_0x4e50af);}})[_0xdbce('0x21')](function(_0x1b02b8){if(_0x1b02b8){return _0x1b02b8?{'count':_0x5e7b89,'rows':_0x1b02b8}:null;}})[_0xdbce('0x21')](respondWithResult(_0x167373,null))['catch'](handleError(_0x167373,null));};exports[_0xdbce('0x89')]=function(_0x111a3f,_0x5146dd,_0x22d099){var _0x1e02ad={'channel':_0xdbce('0x8a')};var _0x115805=[];var _0x39ca15=[];var _0x53fb4c={};return db[_0xdbce('0x40')][_0xdbce('0x5b')]({'where':{'id':_0x111a3f['params']['id']},'include':[{'model':db[_0xdbce('0x83')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x5146dd,null))[_0xdbce('0x21')](function(_0x5060dc){_0x1e02ad[_0xdbce('0x8b')]=_0x5060dc;if(_0x1e02ad[_0xdbce('0x8b')]&&_0x1e02ad['account'][_0xdbce('0x43')]===_0xdbce('0x8c')&&_0x111a3f['body'][_0xdbce('0x8d')]){if(_0x111a3f[_0xdbce('0x5d')][_0xdbce('0x8d')][_0xdbce('0x4c')]===0x0)return;if(_0x111a3f[_0xdbce('0x5d')][_0xdbce('0x8d')][0x0]['state']!==_0xdbce('0x8e'))return;return db[_0xdbce('0x8f')][_0xdbce('0x36')]({'read':!![],'readAt':_0x111a3f[_0xdbce('0x5d')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x111a3f[_0xdbce('0x5d')][_0xdbce('0x8d')][0x0]['message_id']},'individualHooks':!![]})[_0xdbce('0x21')](function(_0x573934){return _0x5146dd['status'](0xc8)[_0xdbce('0x33')](_0x573934);});}_0x1e02ad[_0xdbce('0x90')]=_[_0xdbce('0x91')](_0x5060dc['Applications'],['priority'],['asc']);if(_0x1e02ad['account'][_0xdbce('0x92')]){delete _0x1e02ad['account'][_0xdbce('0x92')];}return db[_0xdbce('0x93')][_0xdbce('0x66')]()[_0xdbce('0x21')](function(_0x5a6699){if(!_0x5a6699){throw new db[(_0xdbce('0x94'))][(_0xdbce('0x95'))](_0xdbce('0x96'));}_0x115805=_['difference'](_[_0xdbce('0x47')](_0x5a6699),[_0xdbce('0x97'),'updatedAt']);_0x39ca15=_[_0xdbce('0x98')](_['keys'](_0x5a6699),[_0xdbce('0x97'),'updatedAt',_0xdbce('0x99'),_0xdbce('0x9a')]);_0x1e02ad['body']={'mapKey':_0xdbce('0x9b')};if(_0x1e02ad['account']&&_0x1e02ad[_0xdbce('0x8b')][_0xdbce('0x43')]===_0xdbce('0x9c')){_0x1e02ad['body'][_0xdbce('0x9d')]=_0x111a3f[_0xdbce('0x5d')]['From'][_0xdbce('0x9e')](_0xdbce('0x9f'),'');_0x1e02ad['body'][_0xdbce('0x5d')]=_0x111a3f['body'][_0xdbce('0xa0')];_0x1e02ad['body'][_0xdbce('0xa1')]=_0x111a3f[_0xdbce('0x5d')]['MessageSid'];}if(_0x1e02ad[_0xdbce('0x8b')]&&_0x1e02ad[_0xdbce('0x8b')]['type']===_0xdbce('0x8c')){_0x1e02ad['body'][_0xdbce('0x9d')]=_0x111a3f['body'][_0xdbce('0xa2')][0x0][_0xdbce('0x9d')];_0x1e02ad['body']['body']=_0x111a3f[_0xdbce('0x5d')][_0xdbce('0xa2')][0x0]['message'][_0xdbce('0x5d')];_0x1e02ad['body'][_0xdbce('0xa1')]=_0x111a3f[_0xdbce('0x5d')][_0xdbce('0xa2')][0x0][_0xdbce('0xa3')];}if(_0x1e02ad['body']['id']){delete _0x1e02ad[_0xdbce('0x5d')]['id'];}if(_[_0xdbce('0xa4')](_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0x9d')])){throw new db['Sequelize'][(_0xdbce('0x95'))](_0xdbce('0xa5'));}if(_['isNil'](_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0x5d')])||_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0x5d')]===''){throw new db[(_0xdbce('0x94'))][(_0xdbce('0x95'))](_0xdbce('0xa6'));}if(_[_0xdbce('0xa4')](_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0xa7')])){throw new db[(_0xdbce('0x94'))][(_0xdbce('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39ca15);}if(!_[_0xdbce('0xa8')](_0x39ca15,_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0xa7')])){throw new db['Sequelize'][(_0xdbce('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39ca15);}_0x53fb4c[_0x1e02ad[_0xdbce('0x5d')]['mapKey']]=_0x1e02ad[_0xdbce('0x5d')]['from'];return db['CmList'][_0xdbce('0x5b')]({'where':{'id':_0x1e02ad[_0xdbce('0x8b')][_0xdbce('0x9a')]},'include':[{'model':db[_0xdbce('0x93')],'as':_0xdbce('0xa9'),'where':_0x53fb4c,'limit':0x1,'order':[['updatedAt',_0xdbce('0xaa')]]}]});})['then'](handleEntityNotFound(_0x5146dd,null))[_0xdbce('0x21')](function(_0xc270b2){if(_0xc270b2){_0x1e02ad[_0xdbce('0xab')]=_[_0xdbce('0x75')](_0xc270b2,[_0xdbce('0xa9')]);if(_0xc270b2[_0xdbce('0xa9')]['length']){return _0xc270b2[_0xdbce('0xa9')][0x0];}var _0x22a0b0=_['defaults'](_0x1e02ad[_0xdbce('0x5d')],{'firstName':_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0x9d')],'ListId':_0xc270b2['id']});_0x22a0b0[_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0xa7')]]=_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0x9d')];return db[_0xdbce('0x93')][_0xdbce('0x5c')](_0x22a0b0,{'fields':_0x115805,'raw':!![]});}})[_0xdbce('0x21')](handleEntityNotFound(_0x5146dd,null))[_0xdbce('0x21')](function(_0x1933f0){if(_0x1933f0){_0x1e02ad[_0xdbce('0xac')]=_0x1933f0;var _0x4521ec={'ContactId':_0x1933f0['id'],'phone':_0x1e02ad['body'][_0xdbce('0x9d')],'WhatsappAccountId':_0x111a3f[_0xdbce('0x5a')]['id']};var _0x267eb0={'ContactId':_0x1933f0['id'],'WhatsappAccountId':_0x111a3f[_0xdbce('0x5a')]['id'],'closed':![]};return db[_0xdbce('0xad')][_0xdbce('0x5b')]({'where':_0x267eb0})[_0xdbce('0x21')](function(_0x36cf9c){if(_0x36cf9c){return[_0x36cf9c,![]];}return db['WhatsappInteraction'][_0xdbce('0x5c')](_0x4521ec)[_0xdbce('0x21')](function(_0x495274){return[_0x495274,!![]];});});}})['spread'](function(_0x561cc2,_0x399a2e){_0x1e02ad[_0xdbce('0xae')]=_0x561cc2[_0xdbce('0x38')]({'plain':!![]});_0x1e02ad[_0xdbce('0xae')][_0xdbce('0xaf')]=![];if(_0x399a2e){if(_0x1e02ad[_0xdbce('0x8b')][_0xdbce('0xb0')]){_0x1e02ad[_0xdbce('0x90')]['push']({'id':0x0,'priority':_0x1e02ad['applications'][_0xdbce('0x4c')]+0x1,'app':'close','appdata':_0xdbce('0xb1'),'interval':'*,*,*,*'});}_0x1e02ad['interaction'][_0xdbce('0xaf')]=!![];}return db['WhatsappMessage'][_0xdbce('0x5c')]({'phone':_0x1e02ad['body']['from'],'messageId':_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0xa1')],'body':_0x1e02ad['body'][_0xdbce('0x5d')],'WhatsappAccountId':_0x111a3f['params']['id'],'WhatsappInteractionId':_0x561cc2['id'],'direction':'in','ContactId':_0x561cc2[_0xdbce('0xb2')],'AttachmentId':_0x1e02ad[_0xdbce('0x5d')][_0xdbce('0xb3')]});})[_0xdbce('0x21')](function(_0x1059ff){_0x1e02ad[_0xdbce('0x29')]=_0x1059ff;if(_0x1e02ad['interaction'][_0xdbce('0xb4')]){return db['User'][_0xdbce('0x5b')]({'attributes':['id','name'],'where':{'id':_0x1e02ad[_0xdbce('0xae')][_0xdbce('0xb4')]}})[_0xdbce('0x21')](function(_0x21ebdf){if(_0x21ebdf){_0x1e02ad[_0xdbce('0x90')][_0xdbce('0xb5')]({'id':0x0,'priority':0x0,'app':_0xdbce('0xb6'),'appdata':_0x21ebdf['name']+','+(_0x1e02ad[_0xdbce('0x8b')][_0xdbce('0xb7')]||0xa),'interval':_0xdbce('0xb8')});}return respondWithRpcPromise(_0xdbce('0xb9'),_0xdbce('0xba'),_0x1e02ad);});}return respondWithRpcPromise(_0xdbce('0xb9'),_0xdbce('0xba'),_0x1e02ad);})['then'](function(_0x47ffa5){if(_0x47ffa5){var _0x387748=0xc8;var _0x47c21c=_0xdbce('0xbb');logger[_0xdbce('0x22')](_0xdbce('0x24'),_0x47c21c,_0x387748,_0xdbce('0xbc'));logger['debug'](_0xdbce('0xbd'),_0x47c21c,_0x387748,_0xdbce('0xbc'),JSON[_0xdbce('0x26')](_0x47ffa5));if(_0x1e02ad[_0xdbce('0x8b')]['type']===_0xdbce('0x9c')){return _0x5146dd['status'](_0x387748)[_0xdbce('0xbe')](_0xdbce('0xbf'),_0xdbce('0xc0'))[_0xdbce('0x3e')](_0xdbce('0xc1'));}else{return _0x5146dd[_0xdbce('0x2c')](_0x387748)[_0xdbce('0x33')](_0x47ffa5);}}});})['catch'](handleError(_0x5146dd,null));};exports[_0xdbce('0x3e')]=function(_0x5cf55b,_0x2ce19b,_0x5bb062){var _0x515fd1,_0x20ddbf,_0x3f172f;if(_['isNil'](_0x5cf55b[_0xdbce('0x5d')][_0xdbce('0x5d')])||_0x5cf55b[_0xdbce('0x5d')][_0xdbce('0x5d')]===''){throw new db[(_0xdbce('0x94'))][(_0xdbce('0x95'))](_0xdbce('0xa6'));}if(_[_0xdbce('0xa4')](_0x5cf55b[_0xdbce('0x5d')]['to'])){throw new db[(_0xdbce('0x94'))]['ValidationError'](_0xdbce('0xc2'));}_0x515fd1=_0x5cf55b[_0xdbce('0x5d')]['to'];return db[_0xdbce('0x40')]['find']({'where':{'id':_0x5cf55b[_0xdbce('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xdbce('0xc3'),'include':[{'model':db[_0xdbce('0x93')],'as':'Contacts','where':{'mobile':_0x515fd1},'limit':0x1,'order':[[_0xdbce('0xc4'),_0xdbce('0xaa')]]}]}]})[_0xdbce('0x21')](handleEntityNotFound(_0x2ce19b,null))[_0xdbce('0x21')](function(_0x3a2c71){if(_0x3a2c71&&_0x3a2c71['List']){_0x20ddbf=_0x3a2c71[_0xdbce('0x38')]({'plain':!![]});if(_0x20ddbf['List']&&_0x20ddbf['List'][_0xdbce('0xa9')][_0xdbce('0x4c')]){return _0x20ddbf[_0xdbce('0xc3')]['Contacts'][0x0];}return db[_0xdbce('0x93')][_0xdbce('0x5c')](_[_0xdbce('0x1b')](_0x5cf55b[_0xdbce('0x5d')],{'firstName':_0x515fd1,'mobile':_0x515fd1,'phone':_0x515fd1,'ListId':_0x20ddbf['ListId']}));}})[_0xdbce('0x21')](handleEntityNotFound(_0x2ce19b,null))[_0xdbce('0x21')](function(_0x18ced5){if(_0x18ced5){_0x3f172f=_0x18ced5;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x3f172f['id'],'closed':![],'WhatsappAccountId':_0x20ddbf['id']}})['then'](function(_0xb3f70){if(_0xb3f70){return[_0xb3f70,![]];}return db[_0xdbce('0xad')]['create']({'UserId':_0x5cf55b[_0xdbce('0x60')]['id'],'ContactId':_0x3f172f['id'],'WhatsappAccountId':_0x20ddbf['id'],'phone':_0x515fd1,'firstMsgDirection':_0xdbce('0xc5'),'Messages':[_['merge'](_0x5cf55b['body'],{'read':![],'body':_0x5cf55b[_0xdbce('0x5d')][_0xdbce('0x5d')],'phone':_0x515fd1,'WhatsappAccountId':_0x20ddbf['id'],'UserId':_0x5cf55b[_0xdbce('0x60')]['id'],'ContactId':_0x3f172f['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xdbce('0xc6')}]})[_0xdbce('0x21')](function(_0x204d47){return[_0x204d47,!![]];});});}})[_0xdbce('0x76')](function(_0x55c333,_0x7b24e5){if(_0x7b24e5){return _0x55c333;}return db[_0xdbce('0x8f')][_0xdbce('0x5c')](_[_0xdbce('0x52')](_0x5cf55b[_0xdbce('0x5d')],{'read':![],'body':_0x5cf55b[_0xdbce('0x5d')][_0xdbce('0x5d')],'phone':_0x515fd1,'WhatsappAccountId':_0x20ddbf['id'],'WhatsappInteractionId':_0x55c333['id'],'UserId':_0x5cf55b[_0xdbce('0x60')]['id'],'ContactId':_0x3f172f['id']}))[_0xdbce('0x21')](function(_0x417375){_0x55c333[_0xdbce('0xc7')][_0xdbce('0xc6')]=[];_0x55c333[_0xdbce('0xc7')]['Messages'][_0xdbce('0xc8')](_0x417375[_0xdbce('0xc7')]);return _0x55c333;});})['then'](respondWithResult(_0x2ce19b,null))[_0xdbce('0x2b')](handleError(_0x2ce19b,null));};
\ No newline at end of file
+var _0x2707=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','create','body','user','role','UserProfileSection','autoAssociation','describe','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','stack','getApplications','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','Contacts','contact','WhatsappInteraction','spread','created','unmanaged','*,*,*,*','interaction','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./whatsappAccount.socket','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1e041d,_0x5b0198){var _0x117f51=function(_0x4cc342){while(--_0x4cc342){_0x1e041d['push'](_0x1e041d['shift']());}};_0x117f51(++_0x5b0198);}(_0x2707,0x124));var _0x7270=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x2707[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require(_0x7270('0x0'));var rimraf=require(_0x7270('0x1'));var zipdir=require(_0x7270('0x2'));var jsonpatch=require(_0x7270('0x3'));var rp=require(_0x7270('0x4'));var moment=require(_0x7270('0x5'));var BPromise=require(_0x7270('0x6'));var Mustache=require(_0x7270('0x7'));var util=require(_0x7270('0x8'));var path=require('path');var sox=require(_0x7270('0x9'));var csv=require('to-csv');var ejs=require(_0x7270('0xa'));var fs=require('fs');var fs_extra=require(_0x7270('0xb'));var _=require(_0x7270('0xc'));var squel=require(_0x7270('0xd'));var crypto=require(_0x7270('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7270('0xf'));var querystring=require('querystring');var Papa=require(_0x7270('0x10'));var Redis=require(_0x7270('0x11'));var authService=require(_0x7270('0x12'));var qs=require(_0x7270('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7270('0x14'));var logger=require(_0x7270('0x15'))(_0x7270('0x16'));var utils=require(_0x7270('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7270('0x18'));var db=require('../../mysqldb')['db'];config[_0x7270('0x19')]=_[_0x7270('0x1a')](config['redis'],{'host':_0x7270('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7270('0x19')]));require(_0x7270('0x1c'))['register'](socket);var jayson=require(_0x7270('0x1d'));var client=jayson[_0x7270('0x1e')][_0x7270('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x53fb6e,_0x1a1bb7,_0x22a841,_0x1c24f4){return new BPromise(function(_0x19a669,_0x5bc9bc){var _0xde07ea=_0x1c24f4||client;return _0xde07ea[_0x7270('0x20')](_0x53fb6e,_0x22a841)[_0x7270('0x21')](function(_0x3b1239){logger['info'](_0x7270('0x22'),_0x1a1bb7,_0x7270('0x23'));logger[_0x7270('0x24')](_0x7270('0x25'),_0x1a1bb7,_0x7270('0x23'),JSON[_0x7270('0x26')](_0x3b1239));if(_0x3b1239['error']){if(_0x3b1239[_0x7270('0x27')][_0x7270('0x28')]===0x1f4){logger['error'](_0x7270('0x22'),_0x1a1bb7,_0x3b1239[_0x7270('0x27')][_0x7270('0x29')]);return _0x5bc9bc(_0x3b1239[_0x7270('0x27')][_0x7270('0x29')]);}logger['error'](_0x7270('0x22'),_0x1a1bb7,_0x3b1239[_0x7270('0x27')]['message']);return _0x19a669(_0x3b1239['error'][_0x7270('0x29')]);}else{logger[_0x7270('0x2a')](_0x7270('0x22'),_0x1a1bb7,_0x7270('0x23'));_0x19a669(_0x3b1239[_0x7270('0x2b')][_0x7270('0x29')]);}})[_0x7270('0x2c')](function(_0xf7bc8f){logger['error'](_0x7270('0x22'),_0x1a1bb7,_0xf7bc8f);_0x5bc9bc(_0xf7bc8f);});});}function respondWithStatusCode(_0x84a5f9,_0x20ea59){_0x20ea59=_0x20ea59||0xcc;return function(_0x1985bb){if(_0x1985bb){return _0x84a5f9[_0x7270('0x2d')](_0x20ea59);}return _0x84a5f9['status'](_0x20ea59)[_0x7270('0x2e')]();};}function respondWithResult(_0x3dc368,_0x529dc6){_0x529dc6=_0x529dc6||0xc8;return function(_0x26c610){if(_0x26c610){return _0x3dc368[_0x7270('0x2f')](_0x529dc6)[_0x7270('0x30')](_0x26c610);}};}function respondWithFilteredResult(_0x558a4d,_0x36ffcf){return function(_0x128ed1){if(_0x128ed1){var _0x5d5ca2=typeof _0x36ffcf[_0x7270('0x31')]===_0x7270('0x32')&&typeof _0x36ffcf[_0x7270('0x33')]===_0x7270('0x32');var _0x440d1c=_0x128ed1[_0x7270('0x34')];var _0x53b5c2=_0x5d5ca2?0x0:_0x36ffcf[_0x7270('0x31')];var _0x46ad25=_0x5d5ca2?_0x128ed1[_0x7270('0x34')]:_0x36ffcf[_0x7270('0x31')]+_0x36ffcf['limit'];var _0x2c2287;if(_0x46ad25>=_0x440d1c){_0x46ad25=_0x440d1c;_0x2c2287=0xc8;}else{_0x2c2287=0xce;}_0x558a4d[_0x7270('0x2f')](_0x2c2287);return _0x558a4d['set'](_0x7270('0x35'),_0x53b5c2+'-'+_0x46ad25+'/'+_0x440d1c)[_0x7270('0x30')](_0x128ed1);}return null;};}function patchUpdates(_0x27b09a){return function(_0x3f8fca){try{jsonpatch[_0x7270('0x36')](_0x3f8fca,_0x27b09a,!![]);}catch(_0x42fedd){return BPromise[_0x7270('0x37')](_0x42fedd);}return _0x3f8fca[_0x7270('0x38')]();};}function saveUpdates(_0x1d60ef,_0x53116){return function(_0x212f85){if(_0x212f85){return _0x212f85[_0x7270('0x39')](_0x1d60ef)[_0x7270('0x21')](function(_0xfd8cd6){return _0xfd8cd6;});}return null;};}function removeEntity(_0x4c13f4,_0x50c80c){return function(_0x32dfe4){if(_0x32dfe4){return _0x32dfe4['destroy']()['then'](function(){var _0x4fa46f=_0x32dfe4[_0x7270('0x3a')]({'plain':!![]});var _0x20491f='WhatsappAccounts';return db[_0x7270('0x3b')]['destroy']({'where':{'type':_0x20491f,'resourceId':_0x4fa46f['id']}})[_0x7270('0x21')](function(){return _0x32dfe4;});})[_0x7270('0x21')](function(){_0x4c13f4[_0x7270('0x2f')](0xcc)[_0x7270('0x2e')]();});}};}function handleEntityNotFound(_0x44056e,_0x58a415){return function(_0x4330a0){if(!_0x4330a0){_0x44056e['sendStatus'](0x194);}return _0x4330a0;};}function handleError(_0x25d433,_0x282495){_0x282495=_0x282495||0x1f4;return function(_0x243de8){logger[_0x7270('0x27')](_0x243de8['stack']);if(_0x243de8[_0x7270('0x3c')]){delete _0x243de8[_0x7270('0x3c')];}_0x25d433[_0x7270('0x2f')](_0x282495)[_0x7270('0x3d')](_0x243de8);};}exports['index']=function(_0x1534b9,_0x1686b0){var _0x9f5ddc={'include':[{'model':db[_0x7270('0x3e')],'as':_0x7270('0x3f')}]},_0x538d3b={},_0x357542={'count':0x0,'rows':[]};var _0x22c220=_[_0x7270('0x40')](db[_0x7270('0x41')]['rawAttributes'],function(_0x12b421){return{'name':_0x12b421[_0x7270('0x42')],'type':_0x12b421[_0x7270('0x43')]['key']};});_0x538d3b[_0x7270('0x44')]=_[_0x7270('0x40')](_0x22c220,'name');_0x538d3b[_0x7270('0x45')]=_[_0x7270('0x46')](_0x1534b9[_0x7270('0x45')]);_0x538d3b[_0x7270('0x47')]=_[_0x7270('0x48')](_0x538d3b[_0x7270('0x44')],_0x538d3b[_0x7270('0x45')]);_0x9f5ddc[_0x7270('0x49')]=_[_0x7270('0x48')](_0x538d3b[_0x7270('0x44')],qs[_0x7270('0x4a')](_0x1534b9[_0x7270('0x45')][_0x7270('0x4a')]));_0x9f5ddc[_0x7270('0x49')]=_0x9f5ddc[_0x7270('0x49')]['length']?_0x9f5ddc['attributes']:_0x538d3b['model'];if(!_0x1534b9[_0x7270('0x45')][_0x7270('0x4b')](_0x7270('0x4c'))){_0x9f5ddc[_0x7270('0x33')]=qs[_0x7270('0x33')](_0x1534b9[_0x7270('0x45')]['limit']);_0x9f5ddc[_0x7270('0x31')]=qs[_0x7270('0x31')](_0x1534b9[_0x7270('0x45')][_0x7270('0x31')]);}_0x9f5ddc[_0x7270('0x4d')]=qs['sort'](_0x1534b9[_0x7270('0x45')][_0x7270('0x4e')]);_0x9f5ddc[_0x7270('0x4f')]=qs[_0x7270('0x47')](_[_0x7270('0x50')](_0x1534b9[_0x7270('0x45')],_0x538d3b[_0x7270('0x47')]),_0x22c220);if(_0x1534b9[_0x7270('0x45')]['filter']){_0x9f5ddc[_0x7270('0x4f')]=_[_0x7270('0x51')](_0x9f5ddc['where'],{'$or':_['map'](_0x22c220,function(_0x5ad90d){if(_0x5ad90d[_0x7270('0x43')]!==_0x7270('0x52')){var _0x118b91={};_0x118b91[_0x5ad90d['name']]={'$like':'%'+_0x1534b9[_0x7270('0x45')][_0x7270('0x53')]+'%'};return _0x118b91;}})});}_0x9f5ddc=_['merge']({},_0x9f5ddc,_0x1534b9[_0x7270('0x54')]);var _0x112703={'where':_0x9f5ddc[_0x7270('0x4f')]};return db['WhatsappAccount'][_0x7270('0x34')](_0x112703)[_0x7270('0x21')](function(_0xe5ec8c){_0x357542[_0x7270('0x34')]=_0xe5ec8c;if(_0x1534b9[_0x7270('0x45')][_0x7270('0x55')]){_0x9f5ddc[_0x7270('0x56')]=[{'all':!![]}];}return db[_0x7270('0x41')][_0x7270('0x57')](_0x9f5ddc);})['then'](function(_0x350c98){_0x357542[_0x7270('0x58')]=_0x350c98;return _0x357542;})[_0x7270('0x21')](respondWithFilteredResult(_0x1686b0,_0x9f5ddc))[_0x7270('0x2c')](handleError(_0x1686b0,null));};exports['show']=function(_0x4245f6,_0x200399){var _0x1d7ca5={'raw':![],'where':{'id':_0x4245f6[_0x7270('0x59')]['id']},'include':[{'model':db[_0x7270('0x3e')],'as':_0x7270('0x3f')}]},_0x1f5c36={};_0x1f5c36[_0x7270('0x44')]=_[_0x7270('0x46')](db[_0x7270('0x41')][_0x7270('0x5a')]);_0x1f5c36[_0x7270('0x45')]=_[_0x7270('0x46')](_0x4245f6[_0x7270('0x45')]);_0x1f5c36['filters']=_[_0x7270('0x48')](_0x1f5c36[_0x7270('0x44')],_0x1f5c36[_0x7270('0x45')]);_0x1d7ca5[_0x7270('0x49')]=_['intersection'](_0x1f5c36[_0x7270('0x44')],qs[_0x7270('0x4a')](_0x4245f6['query']['fields']));_0x1d7ca5[_0x7270('0x49')]=_0x1d7ca5[_0x7270('0x49')][_0x7270('0x5b')]?_0x1d7ca5['attributes']:_0x1f5c36[_0x7270('0x44')];if(_0x4245f6['query'][_0x7270('0x55')]){_0x1d7ca5[_0x7270('0x56')]=[{'all':!![]}];}_0x1d7ca5=_[_0x7270('0x51')]({},_0x1d7ca5,_0x4245f6[_0x7270('0x54')]);return db[_0x7270('0x41')][_0x7270('0x5c')](_0x1d7ca5)['then'](handleEntityNotFound(_0x200399,null))[_0x7270('0x21')](respondWithResult(_0x200399,null))[_0x7270('0x2c')](handleError(_0x200399,null));};exports[_0x7270('0x5d')]=function(_0x213d0f,_0x5a27dd){return db['WhatsappAccount'][_0x7270('0x5d')](_0x213d0f[_0x7270('0x5e')],{})[_0x7270('0x21')](function(_0x2d8879){var _0x5031ea=_0x213d0f[_0x7270('0x5f')][_0x7270('0x3a')]({'plain':!![]});if(!_0x5031ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5031ea[_0x7270('0x60')]==='user'){var _0x2574aa=_0x2d8879[_0x7270('0x3a')]({'plain':!![]});var _0x337298='WhatsappAccounts';return db[_0x7270('0x61')][_0x7270('0x5c')]({'where':{'name':_0x337298,'userProfileId':_0x5031ea['userProfileId']},'raw':!![]})[_0x7270('0x21')](function(_0x19e350){if(_0x19e350&&_0x19e350[_0x7270('0x62')]===0x0){return db[_0x7270('0x3b')]['create']({'name':_0x2574aa['name'],'resourceId':_0x2574aa['id'],'type':_0x19e350[_0x7270('0x3c')],'sectionId':_0x19e350['id']},{})[_0x7270('0x21')](function(){return _0x2d8879;});}else{return _0x2d8879;}})[_0x7270('0x2c')](function(_0x107ad7){logger[_0x7270('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x107ad7);throw _0x107ad7;});}return _0x2d8879;})[_0x7270('0x21')](respondWithResult(_0x5a27dd,0xc9))['catch'](handleError(_0x5a27dd,null));};exports[_0x7270('0x39')]=function(_0x38a708,_0x5a8e48){if(_0x38a708[_0x7270('0x5e')]['id']){delete _0x38a708['body']['id'];}return db['WhatsappAccount'][_0x7270('0x5c')]({'where':{'id':_0x38a708['params']['id']},'include':[{'model':db[_0x7270('0x3e')],'as':_0x7270('0x3f')}]})[_0x7270('0x21')](handleEntityNotFound(_0x5a8e48,null))['then'](saveUpdates(_0x38a708[_0x7270('0x5e')],null))['then'](respondWithResult(_0x5a8e48,null))[_0x7270('0x2c')](handleError(_0x5a8e48,null));};exports['destroy']=function(_0x5c5839,_0x4f9176){return db[_0x7270('0x41')]['find']({'where':{'id':_0x5c5839[_0x7270('0x59')]['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x4f9176,null))['then'](removeEntity(_0x4f9176,null))[_0x7270('0x2c')](handleError(_0x4f9176,null));};exports[_0x7270('0x63')]=function(_0x323b4f,_0x5b2c44){return db[_0x7270('0x41')][_0x7270('0x63')]()[_0x7270('0x21')](respondWithResult(_0x5b2c44,null))[_0x7270('0x2c')](handleError(_0x5b2c44,null));};exports['addDisposition']=function(_0x45f2f5,_0x34cf1b,_0x57ddaa){if(_0x45f2f5['body']['id']){delete _0x45f2f5[_0x7270('0x5e')]['id'];}return db[_0x7270('0x41')][_0x7270('0x5c')]({'where':{'id':_0x45f2f5[_0x7270('0x59')]['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x34cf1b,null))[_0x7270('0x21')](function(_0x4457ae){if(_0x4457ae){_0x45f2f5[_0x7270('0x5e')][_0x7270('0x64')]=_0x4457ae['id'];return db[_0x7270('0x65')][_0x7270('0x5d')](_0x45f2f5[_0x7270('0x5e')]);}})[_0x7270('0x21')](respondWithResult(_0x34cf1b,null))[_0x7270('0x2c')](handleError(_0x34cf1b,null));};exports[_0x7270('0x66')]=function(_0x38688d,_0x306ec5,_0x44a8d9){var _0x3ad8a5={'raw':![],'where':{}};var _0x1214ac={};var _0x25f181={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x7270('0x67')]({'where':{'id':_0x38688d[_0x7270('0x59')]['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x306ec5,null))['then'](function(_0x1d237b){if(_0x1d237b){_0x1214ac[_0x7270('0x44')]=_[_0x7270('0x46')](db[_0x7270('0x65')][_0x7270('0x5a')]);_0x1214ac[_0x7270('0x45')]=_['keys'](_0x38688d[_0x7270('0x45')]);_0x1214ac[_0x7270('0x47')]=_[_0x7270('0x48')](_0x1214ac['model'],_0x1214ac['query']);_0x3ad8a5[_0x7270('0x49')]=_[_0x7270('0x48')](_0x1214ac[_0x7270('0x44')],qs[_0x7270('0x4a')](_0x38688d['query'][_0x7270('0x4a')]));_0x3ad8a5['attributes']=_0x3ad8a5[_0x7270('0x49')]['length']?_0x3ad8a5['attributes']:_0x1214ac['model'];if(!_0x38688d[_0x7270('0x45')][_0x7270('0x4b')](_0x7270('0x4c'))){_0x3ad8a5['limit']=qs[_0x7270('0x33')](_0x38688d['query'][_0x7270('0x33')]);_0x3ad8a5['offset']=qs[_0x7270('0x31')](_0x38688d[_0x7270('0x45')][_0x7270('0x31')]);}_0x3ad8a5[_0x7270('0x4d')]=qs[_0x7270('0x4e')](_0x38688d[_0x7270('0x45')]['sort']);_0x3ad8a5[_0x7270('0x4f')]=qs['filters'](_['pick'](_0x38688d['query'],_0x1214ac[_0x7270('0x47')]));_0x3ad8a5[_0x7270('0x4f')][_0x7270('0x64')]=_0x1d237b['id'];if(_0x38688d[_0x7270('0x45')]['filter']){_0x3ad8a5[_0x7270('0x4f')]=_['merge'](_0x3ad8a5[_0x7270('0x4f')],{'$or':_[_0x7270('0x40')](_0x3ad8a5['attributes'],function(_0x5599e7){var _0x2d8e22={};_0x2d8e22[_0x5599e7]={'$like':'%'+_0x38688d[_0x7270('0x45')][_0x7270('0x53')]+'%'};return _0x2d8e22;})});}_0x3ad8a5=_['merge']({},_0x3ad8a5,_0x38688d['options']);return db['Disposition']['count']({'where':_0x3ad8a5['where']})['then'](function(_0x35338a){_0x25f181[_0x7270('0x34')]=_0x35338a;if(_0x38688d[_0x7270('0x45')][_0x7270('0x55')]){_0x3ad8a5[_0x7270('0x56')]=[{'all':!![]}];}return db[_0x7270('0x65')][_0x7270('0x57')](_0x3ad8a5);})[_0x7270('0x21')](function(_0x20b9d5){_0x25f181[_0x7270('0x58')]=_0x20b9d5;return _0x25f181;});}})['then'](respondWithFilteredResult(_0x306ec5,_0x3ad8a5))['catch'](handleError(_0x306ec5,null));};exports[_0x7270('0x68')]=function(_0x5ac7b6,_0x4a09d5,_0x51219f){return db['WhatsappAccount']['find']({'where':{'id':_0x5ac7b6[_0x7270('0x59')]['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x4a09d5,null))[_0x7270('0x21')](function(_0x3b02a4){if(_0x3b02a4){return _0x3b02a4['removeDispositions'](_0x5ac7b6[_0x7270('0x45')][_0x7270('0x69')]);}})['then'](respondWithStatusCode(_0x4a09d5,null))[_0x7270('0x2c')](handleError(_0x4a09d5,null));};exports[_0x7270('0x6a')]=function(_0x6bb173,_0x3879e1,_0x2f0e45){if(_0x6bb173[_0x7270('0x5e')]['id']){delete _0x6bb173[_0x7270('0x5e')]['id'];}return db[_0x7270('0x41')][_0x7270('0x5c')]({'where':{'id':_0x6bb173['params']['id']}})['then'](handleEntityNotFound(_0x3879e1,null))[_0x7270('0x21')](function(_0x3941e9){if(_0x3941e9){_0x6bb173['body'][_0x7270('0x64')]=_0x3941e9['id'];return db[_0x7270('0x6b')][_0x7270('0x5d')](_0x6bb173[_0x7270('0x5e')]);}})[_0x7270('0x21')](respondWithResult(_0x3879e1,null))[_0x7270('0x2c')](handleError(_0x3879e1,null));};exports['getAnswers']=function(_0x165881,_0x1e1d74,_0x2257fc){var _0x3f0ce0={'raw':![],'where':{}};var _0x9d5ad4={};var _0x1d91e0={'count':0x0,'rows':[]};return db[_0x7270('0x41')][_0x7270('0x67')]({'where':{'id':_0x165881['params']['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x1e1d74,null))[_0x7270('0x21')](function(_0x10e550){if(_0x10e550){_0x9d5ad4[_0x7270('0x44')]=_['keys'](db[_0x7270('0x6b')][_0x7270('0x5a')]);_0x9d5ad4['query']=_[_0x7270('0x46')](_0x165881[_0x7270('0x45')]);_0x9d5ad4[_0x7270('0x47')]=_['intersection'](_0x9d5ad4[_0x7270('0x44')],_0x9d5ad4[_0x7270('0x45')]);_0x3f0ce0[_0x7270('0x49')]=_[_0x7270('0x48')](_0x9d5ad4[_0x7270('0x44')],qs[_0x7270('0x4a')](_0x165881['query'][_0x7270('0x4a')]));_0x3f0ce0[_0x7270('0x49')]=_0x3f0ce0[_0x7270('0x49')]['length']?_0x3f0ce0[_0x7270('0x49')]:_0x9d5ad4[_0x7270('0x44')];if(!_0x165881[_0x7270('0x45')][_0x7270('0x4b')](_0x7270('0x4c'))){_0x3f0ce0['limit']=qs[_0x7270('0x33')](_0x165881[_0x7270('0x45')][_0x7270('0x33')]);_0x3f0ce0[_0x7270('0x31')]=qs['offset'](_0x165881[_0x7270('0x45')][_0x7270('0x31')]);}_0x3f0ce0[_0x7270('0x4d')]=qs[_0x7270('0x4e')](_0x165881[_0x7270('0x45')][_0x7270('0x4e')]);_0x3f0ce0['where']=qs[_0x7270('0x47')](_[_0x7270('0x50')](_0x165881[_0x7270('0x45')],_0x9d5ad4[_0x7270('0x47')]));_0x3f0ce0['where'][_0x7270('0x64')]=_0x10e550['id'];if(_0x165881[_0x7270('0x45')]['filter']){_0x3f0ce0[_0x7270('0x4f')]=_[_0x7270('0x51')](_0x3f0ce0[_0x7270('0x4f')],{'$or':_[_0x7270('0x40')](_0x3f0ce0['attributes'],function(_0x1e2aad){var _0x34dcf1={};_0x34dcf1[_0x1e2aad]={'$like':'%'+_0x165881['query'][_0x7270('0x53')]+'%'};return _0x34dcf1;})});}_0x3f0ce0=_['merge']({},_0x3f0ce0,_0x165881['options']);return db[_0x7270('0x6b')][_0x7270('0x34')]({'where':_0x3f0ce0['where']})[_0x7270('0x21')](function(_0x559559){_0x1d91e0[_0x7270('0x34')]=_0x559559;if(_0x165881[_0x7270('0x45')][_0x7270('0x55')]){_0x3f0ce0[_0x7270('0x56')]=[{'all':!![]}];}return db[_0x7270('0x6b')][_0x7270('0x57')](_0x3f0ce0);})[_0x7270('0x21')](function(_0x15e01e){_0x1d91e0[_0x7270('0x58')]=_0x15e01e;return _0x1d91e0;});}})['then'](respondWithFilteredResult(_0x1e1d74,_0x3f0ce0))[_0x7270('0x2c')](handleError(_0x1e1d74,null));};exports['removeAnswers']=function(_0x2b978b,_0x1aa372,_0x193c15){return db[_0x7270('0x41')][_0x7270('0x5c')]({'where':{'id':_0x2b978b['params']['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x1aa372,null))[_0x7270('0x21')](function(_0x38d458){if(_0x38d458){return _0x38d458[_0x7270('0x6c')](_0x2b978b[_0x7270('0x45')][_0x7270('0x69')]);}})[_0x7270('0x21')](respondWithStatusCode(_0x1aa372,null))[_0x7270('0x2c')](handleError(_0x1aa372,null));};exports[_0x7270('0x6d')]=function(_0x5be4a9,_0x182b5d,_0x53cd1e){return db[_0x7270('0x41')][_0x7270('0x5c')]({'where':{'id':_0x5be4a9[_0x7270('0x59')]['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x182b5d,null))[_0x7270('0x21')](function(_0x5b6304){if(_0x5b6304){return _0x5b6304['addAgents'](_0x5be4a9[_0x7270('0x5e')][_0x7270('0x69')],_[_0x7270('0x6e')](_0x5be4a9['body'],['ids','id'])||{})['spread'](function(_0x30f961){for(var _0x3c581a=0x0;_0x3c581a<_0x5be4a9[_0x7270('0x5e')]['ids']['length'];_0x3c581a+=0x1){socket[_0x7270('0x6f')]('userWhatsappAccount:save',{'UserId':Number(_0x5be4a9[_0x7270('0x5e')]['ids'][_0x3c581a]),'WhatsappAccountId':Number(_0x5be4a9[_0x7270('0x59')]['id'])});}return _0x30f961;});}})[_0x7270('0x21')](respondWithResult(_0x182b5d,null))[_0x7270('0x2c')](handleError(_0x182b5d,null));};exports[_0x7270('0x70')]=function(_0x2eb1ce,_0x49e4ca,_0x536f68){return db[_0x7270('0x41')][_0x7270('0x5c')]({'where':{'id':_0x2eb1ce[_0x7270('0x59')]['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x49e4ca,null))[_0x7270('0x21')](function(_0x18a9b1){if(_0x18a9b1){return _0x18a9b1['removeAgents'](_0x2eb1ce['query'][_0x7270('0x69')])[_0x7270('0x21')](function(){if(_['isArray'](_0x2eb1ce[_0x7270('0x45')][_0x7270('0x69')])){for(var _0x49dc47=0x0;_0x49dc47<_0x2eb1ce[_0x7270('0x45')]['ids'][_0x7270('0x5b')];_0x49dc47+=0x1){socket[_0x7270('0x6f')](_0x7270('0x71'),{'UserId':Number(_0x2eb1ce[_0x7270('0x45')][_0x7270('0x69')][_0x49dc47]),'WhatsappAccountId':Number(_0x2eb1ce[_0x7270('0x59')]['id'])});}}else{socket[_0x7270('0x6f')](_0x7270('0x71'),{'UserId':Number(_0x2eb1ce['query']['ids']),'WhatsappAccountId':Number(_0x2eb1ce['params']['id'])});}});}})[_0x7270('0x21')](respondWithStatusCode(_0x49e4ca,null))['catch'](handleError(_0x49e4ca,null));};exports[_0x7270('0x72')]=function(_0x2f0369,_0xd117bb,_0x396763){var _0x560233={};var _0x4f99b7={};var _0x385a46;var _0xdf43e;return db[_0x7270('0x41')]['findOne']({'where':{'id':_0x2f0369[_0x7270('0x59')]['id']}})[_0x7270('0x21')](handleEntityNotFound(_0xd117bb,null))[_0x7270('0x21')](function(_0x20167a){if(_0x20167a){_0x385a46=_0x20167a;_0x4f99b7['model']=_[_0x7270('0x46')](db[_0x7270('0x73')]['rawAttributes']);_0x4f99b7[_0x7270('0x45')]=_[_0x7270('0x46')](_0x2f0369['query']);_0x4f99b7[_0x7270('0x47')]=_[_0x7270('0x48')](_0x4f99b7[_0x7270('0x44')],_0x4f99b7[_0x7270('0x45')]);_0x560233[_0x7270('0x49')]=_[_0x7270('0x48')](_0x4f99b7[_0x7270('0x44')],qs[_0x7270('0x4a')](_0x2f0369[_0x7270('0x45')][_0x7270('0x4a')]));_0x560233[_0x7270('0x49')]=_0x560233['attributes'][_0x7270('0x5b')]?_0x560233[_0x7270('0x49')]:_0x4f99b7['model'];_0x560233[_0x7270('0x4d')]=qs[_0x7270('0x4e')](_0x2f0369[_0x7270('0x45')][_0x7270('0x4e')]);_0x560233['where']=qs['filters'](_[_0x7270('0x50')](_0x2f0369['query'],_0x4f99b7[_0x7270('0x47')]));if(_0x2f0369['query'][_0x7270('0x53')]){_0x560233[_0x7270('0x4f')]=_['merge'](_0x560233[_0x7270('0x4f')],{'$or':_['map'](_0x560233[_0x7270('0x49')],function(_0xf11951){var _0x45d6af={};_0x45d6af[_0xf11951]={'$like':'%'+_0x2f0369[_0x7270('0x45')][_0x7270('0x53')]+'%'};return _0x45d6af;})});}_0x560233=_[_0x7270('0x51')]({},_0x560233,_0x2f0369[_0x7270('0x54')]);return _0x385a46[_0x7270('0x72')](_0x560233);}})[_0x7270('0x21')](function(_0x4d2268){if(_0x4d2268){_0xdf43e=_0x4d2268['length'];if(!_0x2f0369[_0x7270('0x45')]['hasOwnProperty'](_0x7270('0x4c'))){_0x560233[_0x7270('0x33')]=qs[_0x7270('0x33')](_0x2f0369[_0x7270('0x45')][_0x7270('0x33')]);_0x560233['offset']=qs['offset'](_0x2f0369[_0x7270('0x45')][_0x7270('0x31')]);}return _0x385a46[_0x7270('0x72')](_0x560233);}})['then'](function(_0x3240ab){if(_0x3240ab){return _0x3240ab?{'count':_0xdf43e,'rows':_0x3240ab}:null;}})[_0x7270('0x21')](respondWithResult(_0xd117bb,null))[_0x7270('0x2c')](handleError(_0xd117bb,null));};exports['addApplications']=function(_0x131bbe,_0x40aeb6){var _0x7ed86=_0x131bbe[_0x7270('0x59')]['id'];var _0x2a7595=_0x131bbe[_0x7270('0x5e')];var _0x2960b4=0xc8;var _0x2d3600=null;return db[_0x7270('0x74')][_0x7270('0x75')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x427ec4){return db[_0x7270('0x41')][_0x7270('0x67')]({'where':{'id':_0x7ed86},'transaction':_0x427ec4})[_0x7270('0x21')](function(_0x37fd15){if(_0x37fd15){return db[_0x7270('0x76')]['destroy']({'where':{'WhatsappAccountId':_0x7ed86},'transaction':_0x427ec4})[_0x7270('0x21')](function(){var _0x3f0610=_['map'](_0x2a7595,function(_0x225dd6){_0x225dd6[_0x7270('0x64')]=_0x7ed86;return _0x225dd6;});return db[_0x7270('0x76')][_0x7270('0x77')](_0x3f0610,{'transaction':_0x427ec4});});}else{_0x2960b4=0x194;_0x2d3600=[];}});})[_0x7270('0x21')](function(){if(_0x2960b4!==0x194){return db[_0x7270('0x76')][_0x7270('0x78')]({'where':{'WhatsappAccountId':_0x7ed86},'order':'priority'})[_0x7270('0x21')](function(_0x2da066){_0x2d3600=_0x2da066;});}})[_0x7270('0x2c')](function(_0x1fc33e){_0x2960b4=0x1f4;logger['error'](_0x1fc33e[_0x7270('0x79')]);if(_0x1fc33e[_0x7270('0x3c')]){delete _0x1fc33e[_0x7270('0x3c')];}_0x2d3600=_0x1fc33e;})['finally'](function(){if(_0x2d3600===null){_0x40aeb6[_0x7270('0x2d')](_0x2960b4);}else{if(_0x2960b4===0x1f4){_0x40aeb6['status'](_0x2960b4)[_0x7270('0x3d')](_0x2d3600);}else{_0x40aeb6[_0x7270('0x2f')](_0x2960b4)[_0x7270('0x30')](_0x2d3600);}}});};exports[_0x7270('0x7a')]=function(_0x590f4c,_0x5b8d63,_0x5159ba){var _0x356e30={};var _0x207249={};var _0x2112bb;var _0x57a170;return db[_0x7270('0x41')][_0x7270('0x67')]({'where':{'id':_0x590f4c[_0x7270('0x59')]['id']}})[_0x7270('0x21')](handleEntityNotFound(_0x5b8d63,null))[_0x7270('0x21')](function(_0x53abf8){if(_0x53abf8){_0x2112bb=_0x53abf8;_0x207249['model']=_[_0x7270('0x46')](db[_0x7270('0x76')][_0x7270('0x5a')]);_0x207249[_0x7270('0x45')]=_[_0x7270('0x46')](_0x590f4c[_0x7270('0x45')]);_0x207249[_0x7270('0x47')]=_[_0x7270('0x48')](_0x207249[_0x7270('0x44')],_0x207249[_0x7270('0x45')]);_0x356e30['attributes']=_[_0x7270('0x48')](_0x207249[_0x7270('0x44')],qs[_0x7270('0x4a')](_0x590f4c[_0x7270('0x45')][_0x7270('0x4a')]));_0x356e30[_0x7270('0x49')]=_0x356e30[_0x7270('0x49')][_0x7270('0x5b')]?_0x356e30[_0x7270('0x49')]:_0x207249[_0x7270('0x44')];_0x356e30[_0x7270('0x4d')]=qs['sort'](_0x590f4c[_0x7270('0x45')][_0x7270('0x4e')]);_0x356e30[_0x7270('0x4f')]=qs[_0x7270('0x47')](_['pick'](_0x590f4c[_0x7270('0x45')],_0x207249[_0x7270('0x47')]));if(_0x590f4c['query'][_0x7270('0x53')]){_0x356e30[_0x7270('0x4f')]=_[_0x7270('0x51')](_0x356e30[_0x7270('0x4f')],{'$or':_[_0x7270('0x40')](_0x356e30[_0x7270('0x49')],function(_0x240875){var _0x404221={};_0x404221[_0x240875]={'$like':'%'+_0x590f4c[_0x7270('0x45')][_0x7270('0x53')]+'%'};return _0x404221;})});}_0x356e30=_[_0x7270('0x51')]({},_0x356e30,_0x590f4c[_0x7270('0x54')]);return _0x2112bb[_0x7270('0x7a')](_0x356e30);}})[_0x7270('0x21')](function(_0x54278e){if(_0x54278e){_0x57a170=_0x54278e[_0x7270('0x5b')];if(!_0x590f4c[_0x7270('0x45')][_0x7270('0x4b')](_0x7270('0x4c'))){_0x356e30[_0x7270('0x33')]=qs['limit'](_0x590f4c[_0x7270('0x45')][_0x7270('0x33')]);_0x356e30[_0x7270('0x31')]=qs[_0x7270('0x31')](_0x590f4c[_0x7270('0x45')][_0x7270('0x31')]);}return _0x2112bb[_0x7270('0x7a')](_0x356e30);}})['then'](function(_0x2e7ca7){if(_0x2e7ca7){return _0x2e7ca7?{'count':_0x57a170,'rows':_0x2e7ca7}:null;}})['then'](respondWithResult(_0x5b8d63,null))[_0x7270('0x2c')](handleError(_0x5b8d63,null));};exports['notify']=function(_0x27b439,_0x30c95a,_0x3325a0){var _0x3db7c1={'channel':'whatsapp'};var _0x595e6c=[];var _0x7c0c60=[];var _0x5a0224={};return db[_0x7270('0x41')][_0x7270('0x5c')]({'where':{'id':_0x27b439['params']['id']},'include':[{'model':db[_0x7270('0x76')],'as':_0x7270('0x7b')}]})['then'](handleEntityNotFound(_0x30c95a,null))[_0x7270('0x21')](function(_0x8dd3cf){_0x3db7c1[_0x7270('0x7c')]=_0x8dd3cf;if(_0x3db7c1[_0x7270('0x7c')]&&_0x3db7c1[_0x7270('0x7c')][_0x7270('0x43')]===_0x7270('0x7d')&&_0x27b439['body'][_0x7270('0x7e')]){if(_0x27b439['body'][_0x7270('0x7e')][_0x7270('0x5b')]===0x0)return;if(_0x27b439[_0x7270('0x5e')][_0x7270('0x7e')][0x0][_0x7270('0x7f')]!==_0x7270('0x80'))return;return db[_0x7270('0x81')][_0x7270('0x39')]({'read':!![],'readAt':_0x27b439['body'][_0x7270('0x7e')][0x0][_0x7270('0x82')]},{'where':{'messageId':_0x27b439['body'][_0x7270('0x7e')][0x0][_0x7270('0x83')]},'individualHooks':!![]})[_0x7270('0x21')](function(_0x358acb){return _0x30c95a[_0x7270('0x2f')](0xc8)[_0x7270('0x30')](_0x358acb);});}_0x3db7c1[_0x7270('0x84')]=_[_0x7270('0x85')](_0x8dd3cf['Applications'],['priority'],['asc']);if(_0x3db7c1[_0x7270('0x7c')][_0x7270('0x7b')]){delete _0x3db7c1[_0x7270('0x7c')][_0x7270('0x7b')];}return db[_0x7270('0x86')][_0x7270('0x63')]()[_0x7270('0x21')](function(_0x5a52b3){if(!_0x5a52b3){throw new db[(_0x7270('0x87'))][(_0x7270('0x88'))](_0x7270('0x89'));}_0x595e6c=_['difference'](_[_0x7270('0x46')](_0x5a52b3),[_0x7270('0x8a'),'updatedAt']);_0x7c0c60=_[_0x7270('0x8b')](_[_0x7270('0x46')](_0x5a52b3),['createdAt',_0x7270('0x8c'),_0x7270('0x8d'),_0x7270('0x8e')]);_0x3db7c1[_0x7270('0x5e')]={'mapKey':'mobile'};if(_0x3db7c1[_0x7270('0x7c')]&&_0x3db7c1[_0x7270('0x7c')][_0x7270('0x43')]===_0x7270('0x8f')){_0x3db7c1[_0x7270('0x5e')][_0x7270('0x90')]=_0x27b439[_0x7270('0x5e')][_0x7270('0x91')][_0x7270('0x92')](_0x7270('0x93'),'');_0x3db7c1[_0x7270('0x5e')][_0x7270('0x5e')]=_0x27b439[_0x7270('0x5e')][_0x7270('0x94')];_0x3db7c1['body'][_0x7270('0x95')]=_0x27b439[_0x7270('0x5e')][_0x7270('0x96')];}if(_0x3db7c1[_0x7270('0x7c')]&&_0x3db7c1[_0x7270('0x7c')]['type']==='sinch'){_0x3db7c1[_0x7270('0x5e')][_0x7270('0x90')]=_0x27b439[_0x7270('0x5e')][_0x7270('0x97')][0x0][_0x7270('0x90')];_0x3db7c1[_0x7270('0x5e')][_0x7270('0x5e')]=_0x27b439[_0x7270('0x5e')][_0x7270('0x97')][0x0][_0x7270('0x29')][_0x7270('0x5e')];_0x3db7c1[_0x7270('0x5e')][_0x7270('0x95')]=_0x27b439[_0x7270('0x5e')][_0x7270('0x97')][0x0][_0x7270('0x83')];}if(_0x3db7c1[_0x7270('0x5e')]['id']){delete _0x3db7c1['body']['id'];}if(_[_0x7270('0x98')](_0x3db7c1[_0x7270('0x5e')][_0x7270('0x90')])){throw new db['Sequelize'][(_0x7270('0x88'))](_0x7270('0x99'));}if(_[_0x7270('0x98')](_0x3db7c1['body']['body'])||_0x3db7c1[_0x7270('0x5e')]['body']===''){throw new db[(_0x7270('0x87'))][(_0x7270('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7270('0x98')](_0x3db7c1[_0x7270('0x5e')][_0x7270('0x9a')])){throw new db[(_0x7270('0x87'))][(_0x7270('0x88'))](_0x7270('0x9b')+_0x7c0c60);}if(!_[_0x7270('0x9c')](_0x7c0c60,_0x3db7c1['body'][_0x7270('0x9a')])){throw new db[(_0x7270('0x87'))][(_0x7270('0x88'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7c0c60);}_0x5a0224[_0x3db7c1['body']['mapKey']]=_0x3db7c1['body']['from'];return db[_0x7270('0x9d')][_0x7270('0x5c')]({'where':{'id':_0x3db7c1['account'][_0x7270('0x8e')]},'include':[{'model':db[_0x7270('0x86')],'as':'Contacts','where':_0x5a0224,'limit':0x1,'order':[[_0x7270('0x8c'),_0x7270('0x9e')]]}]});})[_0x7270('0x21')](handleEntityNotFound(_0x30c95a,null))[_0x7270('0x21')](function(_0x34857d){if(_0x34857d){_0x3db7c1[_0x7270('0x9f')]=_['omit'](_0x34857d,[_0x7270('0xa0')]);if(_0x34857d[_0x7270('0xa0')][_0x7270('0x5b')]){return _0x34857d[_0x7270('0xa0')][0x0];}var _0x11a1b9=_[_0x7270('0x1a')](_0x3db7c1[_0x7270('0x5e')],{'firstName':_0x3db7c1[_0x7270('0x5e')][_0x7270('0x90')],'ListId':_0x34857d['id']});_0x11a1b9[_0x3db7c1[_0x7270('0x5e')][_0x7270('0x9a')]]=_0x3db7c1['body'][_0x7270('0x90')];return db['CmContact'][_0x7270('0x5d')](_0x11a1b9,{'fields':_0x595e6c,'raw':!![]});}})[_0x7270('0x21')](handleEntityNotFound(_0x30c95a,null))['then'](function(_0x353315){if(_0x353315){_0x3db7c1[_0x7270('0xa1')]=_0x353315;var _0x3651cd={'ContactId':_0x353315['id'],'phone':_0x3db7c1[_0x7270('0x5e')][_0x7270('0x90')],'WhatsappAccountId':_0x27b439['params']['id']};var _0x265f99={'ContactId':_0x353315['id'],'WhatsappAccountId':_0x27b439[_0x7270('0x59')]['id'],'closed':![]};return db[_0x7270('0xa2')][_0x7270('0x5c')]({'where':_0x265f99})[_0x7270('0x21')](function(_0x47b040){if(_0x47b040){return[_0x47b040,![]];}return db[_0x7270('0xa2')]['create'](_0x3651cd)[_0x7270('0x21')](function(_0x102515){return[_0x102515,!![]];});});}})[_0x7270('0xa3')](function(_0x1dd45a,_0x3548e5){_0x3db7c1['interaction']=_0x1dd45a['get']({'plain':!![]});_0x3db7c1['interaction'][_0x7270('0xa4')]=![];if(_0x3548e5){if(_0x3db7c1['account']['autoclose']){_0x3db7c1[_0x7270('0x84')]['push']({'id':0x0,'priority':_0x3db7c1[_0x7270('0x84')][_0x7270('0x5b')]+0x1,'app':'close','appdata':_0x7270('0xa5'),'interval':_0x7270('0xa6')});}_0x3db7c1[_0x7270('0xa7')][_0x7270('0xa4')]=!![];}return db[_0x7270('0x81')][_0x7270('0x5d')]({'phone':_0x3db7c1[_0x7270('0x5e')]['from'],'messageId':_0x3db7c1['body'][_0x7270('0x95')],'body':_0x3db7c1[_0x7270('0x5e')]['body'],'WhatsappAccountId':_0x27b439[_0x7270('0x59')]['id'],'WhatsappInteractionId':_0x1dd45a['id'],'direction':'in','ContactId':_0x1dd45a[_0x7270('0xa8')],'AttachmentId':_0x3db7c1[_0x7270('0x5e')][_0x7270('0xa9')]});})[_0x7270('0x21')](function(_0x1a0550){_0x3db7c1[_0x7270('0x29')]=_0x1a0550;if(_0x3db7c1[_0x7270('0xa7')][_0x7270('0xaa')]){return db[_0x7270('0x73')][_0x7270('0x5c')]({'attributes':['id',_0x7270('0x3c')],'where':{'id':_0x3db7c1['interaction'][_0x7270('0xaa')]}})[_0x7270('0x21')](function(_0x28f2c9){if(_0x28f2c9){_0x3db7c1[_0x7270('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7270('0xab'),'appdata':_0x28f2c9[_0x7270('0x3c')]+','+(_0x3db7c1[_0x7270('0x7c')][_0x7270('0xac')]||0xa),'interval':_0x7270('0xa6')});}return respondWithRpcPromise(_0x7270('0xad'),_0x7270('0xae'),_0x3db7c1);});}return respondWithRpcPromise(_0x7270('0xad'),_0x7270('0xae'),_0x3db7c1);})[_0x7270('0x21')](function(_0x3350dc){if(_0x3350dc){var _0x21542c=0xc8;var _0x34a07a=_0x7270('0xaf');logger[_0x7270('0x2a')](_0x7270('0x25'),_0x34a07a,_0x21542c,_0x7270('0xb0'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x34a07a,_0x21542c,_0x7270('0xb0'),JSON[_0x7270('0x26')](_0x3350dc));if(_0x3db7c1[_0x7270('0x7c')][_0x7270('0x43')]===_0x7270('0x8f')){return _0x30c95a['status'](_0x21542c)['set'](_0x7270('0xb1'),_0x7270('0xb2'))[_0x7270('0x3d')](_0x7270('0xb3'));}else{return _0x30c95a[_0x7270('0x2f')](_0x21542c)[_0x7270('0x30')](_0x3350dc);}}});})['catch'](handleError(_0x30c95a,null));};exports[_0x7270('0x3d')]=function(_0x1eac62,_0x5e01f6,_0x13da6f){var _0x4f28c5,_0x3c895d,_0x2b0c31;if(_[_0x7270('0x98')](_0x1eac62['body'][_0x7270('0x5e')])||_0x1eac62[_0x7270('0x5e')][_0x7270('0x5e')]===''){throw new db['Sequelize'][(_0x7270('0x88'))](_0x7270('0xb4'));}if(_['isNil'](_0x1eac62['body']['to'])){throw new db['Sequelize'][(_0x7270('0x88'))](_0x7270('0xb5'));}_0x4f28c5=_0x1eac62[_0x7270('0x5e')]['to'];return db[_0x7270('0x41')][_0x7270('0x5c')]({'where':{'id':_0x1eac62['params']['id']},'include':[{'model':db[_0x7270('0x9d')],'as':_0x7270('0xb6'),'include':[{'model':db[_0x7270('0x86')],'as':_0x7270('0xa0'),'where':{'mobile':_0x4f28c5},'limit':0x1,'order':[['updatedAt',_0x7270('0x9e')]]}]}]})[_0x7270('0x21')](handleEntityNotFound(_0x5e01f6,null))['then'](function(_0xfeb005){if(_0xfeb005&&_0xfeb005['List']){_0x3c895d=_0xfeb005['get']({'plain':!![]});if(_0x3c895d[_0x7270('0xb6')]&&_0x3c895d['List'][_0x7270('0xa0')]['length']){return _0x3c895d['List'][_0x7270('0xa0')][0x0];}return db[_0x7270('0x86')]['create'](_[_0x7270('0x1a')](_0x1eac62['body'],{'firstName':_0x4f28c5,'mobile':_0x4f28c5,'phone':_0x4f28c5,'ListId':_0x3c895d[_0x7270('0x8e')]}));}})['then'](handleEntityNotFound(_0x5e01f6,null))['then'](function(_0x551a91){if(_0x551a91){_0x2b0c31=_0x551a91;return db[_0x7270('0xa2')][_0x7270('0x5c')]({'where':{'ContactId':_0x2b0c31['id'],'closed':![],'WhatsappAccountId':_0x3c895d['id']}})['then'](function(_0x54470e){if(_0x54470e){return[_0x54470e,![]];}return db[_0x7270('0xa2')][_0x7270('0x5d')]({'UserId':_0x1eac62['user']['id'],'ContactId':_0x2b0c31['id'],'WhatsappAccountId':_0x3c895d['id'],'phone':_0x4f28c5,'firstMsgDirection':'out','Messages':[_['merge'](_0x1eac62[_0x7270('0x5e')],{'read':![],'body':_0x1eac62[_0x7270('0x5e')][_0x7270('0x5e')],'phone':_0x4f28c5,'WhatsappAccountId':_0x3c895d['id'],'UserId':_0x1eac62[_0x7270('0x5f')]['id'],'ContactId':_0x2b0c31['id']})]},{'include':[{'model':db[_0x7270('0x81')],'as':_0x7270('0xb7')}]})[_0x7270('0x21')](function(_0xbade2d){return[_0xbade2d,!![]];});});}})['spread'](function(_0x44ef1b,_0x2d9cd8){if(_0x2d9cd8){return _0x44ef1b;}return db[_0x7270('0x81')][_0x7270('0x5d')](_[_0x7270('0x51')](_0x1eac62[_0x7270('0x5e')],{'read':![],'body':_0x1eac62['body'][_0x7270('0x5e')],'phone':_0x4f28c5,'WhatsappAccountId':_0x3c895d['id'],'WhatsappInteractionId':_0x44ef1b['id'],'UserId':_0x1eac62['user']['id'],'ContactId':_0x2b0c31['id']}))[_0x7270('0x21')](function(_0x1ad054){_0x44ef1b[_0x7270('0xb8')][_0x7270('0xb7')]=[];_0x44ef1b[_0x7270('0xb8')][_0x7270('0xb7')][_0x7270('0xb9')](_0x1ad054[_0x7270('0xb8')]);return _0x44ef1b;});})[_0x7270('0x21')](respondWithResult(_0x5e01f6,null))[_0x7270('0x2c')](handleError(_0x5e01f6,null));};
\ No newline at end of file
index 001945c..f72cd8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36b8=['WhatsappAccount','setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x55ae5b,_0x5d06ee){var _0x5ad873=function(_0x1745f9){while(--_0x1745f9){_0x55ae5b['push'](_0x55ae5b['shift']());}};_0x5ad873(++_0x5d06ee);}(_0x36b8,0x66));var _0x836b=function(_0x417af3,_0x3afb8d){_0x417af3=_0x417af3-0x0;var _0xda1aa2=_0x36b8[_0x417af3];return _0xda1aa2;};'use strict';var EventEmitter=require(_0x836b('0x0'));var WhatsappAccount=require(_0x836b('0x1'))['db'][_0x836b('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x836b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x836b('0x4')};function emitEvent(_0x60977d){return function(_0x4778de,_0x21ddeb,_0x372f8d){WhatsappAccountEvents[_0x836b('0x5')](_0x60977d+':'+_0x4778de['id'],_0x4778de);WhatsappAccountEvents[_0x836b('0x5')](_0x60977d,_0x4778de);_0x372f8d(null);};}for(var e in events){if(events[_0x836b('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x836b('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x716d=['update','remove','emit','hasOwnProperty','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x4d5450,_0x41b333){var _0x44a0c1=function(_0x267da0){while(--_0x267da0){_0x4d5450['push'](_0x4d5450['shift']());}};_0x44a0c1(++_0x41b333);}(_0x716d,0x17e));var _0xd716=function(_0x19994a,_0xc04eec){_0x19994a=_0x19994a-0x0;var _0x550bff=_0x716d[_0x19994a];return _0x550bff;};'use strict';var EventEmitter=require(_0xd716('0x0'));var WhatsappAccount=require(_0xd716('0x1'))['db'][_0xd716('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd716('0x3')](0x0);var events={'afterCreate':_0xd716('0x4'),'afterUpdate':_0xd716('0x5'),'afterDestroy':_0xd716('0x6')};function emitEvent(_0x46d1ec){return function(_0x41c0c1,_0x319fd9,_0x2dd20a){WhatsappAccountEvents[_0xd716('0x7')](_0x46d1ec+':'+_0x41c0c1['id'],_0x41c0c1);WhatsappAccountEvents[_0xd716('0x7')](_0x46d1ec,_0x41c0c1);_0x2dd20a(null);};}for(var e in events){if(events[_0xd716('0x8')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
index e08ca7f..37f9448 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23e6=['request-promise','path','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','util','api','bluebird'];(function(_0x565156,_0x19ff0c){var _0x1ec5d=function(_0x5c57f6){while(--_0x5c57f6){_0x565156['push'](_0x565156['shift']());}};_0x1ec5d(++_0x19ff0c);}(_0x23e6,0x1a4));var _0x623e=function(_0x394d80,_0x1e6060){_0x394d80=_0x394d80-0x0;var _0x371934=_0x23e6[_0x394d80];return _0x371934;};'use strict';var _=require('lodash');var util=require(_0x623e('0x0'));var logger=require('../../config/logger')(_0x623e('0x1'));var moment=require('moment');var BPromise=require(_0x623e('0x2'));var rp=require(_0x623e('0x3'));var fs=require('fs');var path=require(_0x623e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x623e('0x5'));module[_0x623e('0x6')]=function(_0x269f7d,_0x5c0466){return _0x269f7d['define'](_0x623e('0x7'),attributes,{'tableName':_0x623e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ee4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','util'];(function(_0x3af2a2,_0x56c1dd){var _0x351be0=function(_0x33b22d){while(--_0x33b22d){_0x3af2a2['push'](_0x3af2a2['shift']());}};_0x351be0(++_0x56c1dd);}(_0x3ee4,0xdf));var _0x43ee=function(_0x568fb5,_0x55a557){_0x568fb5=_0x568fb5-0x0;var _0x230034=_0x3ee4[_0x568fb5];return _0x230034;};'use strict';var _=require('lodash');var util=require(_0x43ee('0x0'));var logger=require(_0x43ee('0x1'))(_0x43ee('0x2'));var moment=require(_0x43ee('0x3'));var BPromise=require(_0x43ee('0x4'));var rp=require(_0x43ee('0x5'));var fs=require('fs');var path=require(_0x43ee('0x6'));var rimraf=require(_0x43ee('0x7'));var config=require(_0x43ee('0x8'));var attributes=require(_0x43ee('0x9'));module[_0x43ee('0xa')]=function(_0x2ad283,_0x3ee99b){return _0x2ad283[_0x43ee('0xb')](_0x43ee('0xc'),attributes,{'tableName':_0x43ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75b0dec..45b071b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d64=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','request\x20sent','debug','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','WhatsappAccount','find','options','raw','attributes','include','map','model','then','ShowWhatsappAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f66c2,_0x47d4ed){var _0x447633=function(_0x3205d4){while(--_0x3205d4){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x447633(++_0x47d4ed);}(_0x0d64,0x17f));var _0x40d6=function(_0x3655e5,_0x469eae){_0x3655e5=_0x3655e5-0x0;var _0x37dfac=_0x0d64[_0x3655e5];return _0x37dfac;};'use strict';var _=require(_0x40d6('0x0'));var util=require(_0x40d6('0x1'));var moment=require(_0x40d6('0x2'));var BPromise=require(_0x40d6('0x3'));var rs=require(_0x40d6('0x4'));var fs=require('fs');var Redis=require(_0x40d6('0x5'));var db=require(_0x40d6('0x6'))['db'];var utils=require(_0x40d6('0x7'));var logger=require(_0x40d6('0x8'))(_0x40d6('0x9'));var config=require('../../config/environment');var jayson=require(_0x40d6('0xa'));var client=jayson[_0x40d6('0xb')][_0x40d6('0xc')]({'port':0x232a});config[_0x40d6('0xd')]=_[_0x40d6('0xe')](config[_0x40d6('0xd')],{'host':_0x40d6('0xf'),'port':0x18eb});var socket=require(_0x40d6('0x10'))(new Redis(config['redis']));require(_0x40d6('0x11'))[_0x40d6('0x12')](socket);function respondWithRpcPromise(_0x47478a,_0x4a5031,_0x34c1fd){return new BPromise(function(_0x302c7f,_0x4664ec){return client[_0x40d6('0x13')](_0x47478a,_0x34c1fd)['then'](function(_0x40cf9f){logger[_0x40d6('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x4a5031,_0x40d6('0x15'));logger[_0x40d6('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4a5031,_0x40d6('0x15'),JSON['stringify'](_0x40cf9f));if(_0x40cf9f[_0x40d6('0x17')]){if(_0x40cf9f[_0x40d6('0x17')][_0x40d6('0x18')]===0x1f4){logger[_0x40d6('0x17')](_0x40d6('0x19'),_0x4a5031,_0x40cf9f[_0x40d6('0x17')][_0x40d6('0x1a')]);return _0x4664ec(_0x40cf9f[_0x40d6('0x17')][_0x40d6('0x1a')]);}logger[_0x40d6('0x17')](_0x40d6('0x19'),_0x4a5031,_0x40cf9f['error'][_0x40d6('0x1a')]);return _0x302c7f(_0x40cf9f[_0x40d6('0x17')][_0x40d6('0x1a')]);}else{logger[_0x40d6('0x14')](_0x40d6('0x19'),_0x4a5031,_0x40d6('0x15'));_0x302c7f(_0x40cf9f[_0x40d6('0x1b')][_0x40d6('0x1a')]);}})['catch'](function(_0x3e3613){logger[_0x40d6('0x17')](_0x40d6('0x19'),_0x4a5031,_0x3e3613);_0x4664ec(_0x3e3613);});});}exports['ShowWhatsappAccount']=function(_0x3fe017){var _0x2ef2a2=this;return new Promise(function(_0x2dbbcb,_0x4e068a){return db[_0x40d6('0x1c')][_0x40d6('0x1d')]({'raw':_0x3fe017[_0x40d6('0x1e')]?_0x3fe017['options'][_0x40d6('0x1f')]===undefined?!![]:![]:!![],'where':_0x3fe017[_0x40d6('0x1e')]?_0x3fe017[_0x40d6('0x1e')]['where']||null:null,'attributes':_0x3fe017[_0x40d6('0x1e')]?_0x3fe017[_0x40d6('0x1e')][_0x40d6('0x20')]||null:null,'include':_0x3fe017[_0x40d6('0x1e')]?_0x3fe017[_0x40d6('0x1e')]['include']?_['map'](_0x3fe017[_0x40d6('0x1e')][_0x40d6('0x21')],function(_0x57e168){return{'model':db[_0x57e168['model']],'as':_0x57e168['as'],'attributes':_0x57e168[_0x40d6('0x20')],'include':_0x57e168['include']?_[_0x40d6('0x22')](_0x57e168[_0x40d6('0x21')],function(_0x3cb2e9){return{'model':db[_0x3cb2e9[_0x40d6('0x23')]],'as':_0x3cb2e9['as'],'attributes':_0x3cb2e9[_0x40d6('0x20')],'include':_0x3cb2e9['include']?_[_0x40d6('0x22')](_0x3cb2e9[_0x40d6('0x21')],function(_0x42624d){return{'model':db[_0x42624d[_0x40d6('0x23')]],'as':_0x42624d['as'],'attributes':_0x42624d[_0x40d6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x40d6('0x24')](function(_0x398cc7){logger[_0x40d6('0x14')](_0x40d6('0x25'),_0x3fe017);logger[_0x40d6('0x16')](_0x40d6('0x25'),_0x3fe017,JSON[_0x40d6('0x26')](_0x398cc7));_0x2dbbcb(_0x398cc7);})['catch'](function(_0x5f4965){logger[_0x40d6('0x17')](_0x40d6('0x25'),_0x5f4965['message'],_0x3fe017);_0x4e068a(_0x2ef2a2[_0x40d6('0x17')](0x1f4,_0x5f4965[_0x40d6('0x1a')]));});});};
\ No newline at end of file
+var _0xcfa5=['WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','attributes','include','model','map','debug','lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x54936f,_0x3694cf){var _0x397529=function(_0x117278){while(--_0x117278){_0x54936f['push'](_0x54936f['shift']());}};_0x397529(++_0x3694cf);}(_0xcfa5,0xbb));var _0x5cfa=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xcfa5[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x5cfa('0x0'));var util=require(_0x5cfa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5cfa('0x2'));var logger=require(_0x5cfa('0x3'))(_0x5cfa('0x4'));var config=require(_0x5cfa('0x5'));var jayson=require(_0x5cfa('0x6'));var client=jayson['client'][_0x5cfa('0x7')]({'port':0x232a});config['redis']=_[_0x5cfa('0x8')](config[_0x5cfa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5cfa('0xa'))(new Redis(config['redis']));require(_0x5cfa('0xb'))[_0x5cfa('0xc')](socket);function respondWithRpcPromise(_0x52dc8a,_0x5b1c7a,_0x19dea3){return new BPromise(function(_0x1a3bcf,_0x368894){return client['request'](_0x52dc8a,_0x19dea3)[_0x5cfa('0xd')](function(_0x34b1c9){logger[_0x5cfa('0xe')](_0x5cfa('0xf'),_0x5b1c7a,_0x5cfa('0x10'));logger['debug'](_0x5cfa('0x11'),_0x5b1c7a,_0x5cfa('0x10'),JSON[_0x5cfa('0x12')](_0x34b1c9));if(_0x34b1c9['error']){if(_0x34b1c9['error']['code']===0x1f4){logger['error'](_0x5cfa('0xf'),_0x5b1c7a,_0x34b1c9[_0x5cfa('0x13')][_0x5cfa('0x14')]);return _0x368894(_0x34b1c9[_0x5cfa('0x13')][_0x5cfa('0x14')]);}logger[_0x5cfa('0x13')](_0x5cfa('0xf'),_0x5b1c7a,_0x34b1c9[_0x5cfa('0x13')][_0x5cfa('0x14')]);return _0x1a3bcf(_0x34b1c9['error'][_0x5cfa('0x14')]);}else{logger[_0x5cfa('0xe')](_0x5cfa('0xf'),_0x5b1c7a,_0x5cfa('0x10'));_0x1a3bcf(_0x34b1c9[_0x5cfa('0x15')][_0x5cfa('0x14')]);}})[_0x5cfa('0x16')](function(_0x5806fb){logger[_0x5cfa('0x13')](_0x5cfa('0xf'),_0x5b1c7a,_0x5806fb);_0x368894(_0x5806fb);});});}exports[_0x5cfa('0x17')]=function(_0x1ccd6e){var _0xbf5ba6=this;return new Promise(function(_0x46cd72,_0x11a7b3){return db[_0x5cfa('0x18')][_0x5cfa('0x19')]({'raw':_0x1ccd6e['options']?_0x1ccd6e['options'][_0x5cfa('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ccd6e[_0x5cfa('0x1b')]?_0x1ccd6e[_0x5cfa('0x1b')][_0x5cfa('0x1c')]||null:null,'attributes':_0x1ccd6e[_0x5cfa('0x1b')]?_0x1ccd6e[_0x5cfa('0x1b')][_0x5cfa('0x1d')]||null:null,'include':_0x1ccd6e[_0x5cfa('0x1b')]?_0x1ccd6e[_0x5cfa('0x1b')][_0x5cfa('0x1e')]?_['map'](_0x1ccd6e[_0x5cfa('0x1b')][_0x5cfa('0x1e')],function(_0x207a0a){return{'model':db[_0x207a0a[_0x5cfa('0x1f')]],'as':_0x207a0a['as'],'attributes':_0x207a0a[_0x5cfa('0x1d')],'include':_0x207a0a['include']?_[_0x5cfa('0x20')](_0x207a0a[_0x5cfa('0x1e')],function(_0x2484ad){return{'model':db[_0x2484ad[_0x5cfa('0x1f')]],'as':_0x2484ad['as'],'attributes':_0x2484ad[_0x5cfa('0x1d')],'include':_0x2484ad[_0x5cfa('0x1e')]?_[_0x5cfa('0x20')](_0x2484ad[_0x5cfa('0x1e')],function(_0xf36e85){return{'model':db[_0xf36e85[_0x5cfa('0x1f')]],'as':_0xf36e85['as'],'attributes':_0xf36e85[_0x5cfa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5cfa('0xd')](function(_0x1ea1dc){logger[_0x5cfa('0xe')](_0x5cfa('0x17'),_0x1ccd6e);logger[_0x5cfa('0x21')]('ShowWhatsappAccount',_0x1ccd6e,JSON['stringify'](_0x1ea1dc));_0x46cd72(_0x1ea1dc);})[_0x5cfa('0x16')](function(_0x5257e8){logger[_0x5cfa('0x13')](_0x5cfa('0x17'),_0x5257e8[_0x5cfa('0x14')],_0x1ccd6e);_0x11a7b3(_0xbf5ba6['error'](0x1f4,_0x5257e8[_0x5cfa('0x14')]));});});};
\ No newline at end of file
index f64f1ad..5790512 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82e5=['emit','removeListener','register','./whatsappAccount.events','save','update'];(function(_0x24c135,_0xdb4450){var _0x290c66=function(_0x537cf8){while(--_0x537cf8){_0x24c135['push'](_0x24c135['shift']());}};_0x290c66(++_0xdb4450);}(_0x82e5,0x17d));var _0x582e=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x82e5[_0x397cfb];return _0x15fed9;};'use strict';var WhatsappAccountEvents=require(_0x582e('0x0'));var events=[_0x582e('0x1'),'remove',_0x582e('0x2')];function createListener(_0x559495,_0xcfc6b2){return function(_0x4d1dc9){_0xcfc6b2[_0x582e('0x3')](_0x559495,_0x4d1dc9);};}function removeListener(_0x13685b,_0x53f007){return function(){WhatsappAccountEvents[_0x582e('0x4')](_0x13685b,_0x53f007);};}exports[_0x582e('0x5')]=function(_0x295055){for(var _0x568f4c=0x0,_0x1fa2db=events['length'];_0x568f4c<_0x1fa2db;_0x568f4c++){var _0x34535e=events[_0x568f4c];var _0x4b71dc=createListener('whatsappAccount:'+_0x34535e,_0x295055);WhatsappAccountEvents['on'](_0x34535e,_0x4b71dc);}};
\ No newline at end of file
+var _0xce96=['remove','update','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xce96,0x6e));var _0x6ce9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xce96[_0xa464c9];return _0x3d73c4;};'use strict';var WhatsappAccountEvents=require(_0x6ce9('0x0'));var events=[_0x6ce9('0x1'),_0x6ce9('0x2'),_0x6ce9('0x3')];function createListener(_0x21e70c,_0x3ca2fb){return function(_0x481818){_0x3ca2fb[_0x6ce9('0x4')](_0x21e70c,_0x481818);};}function removeListener(_0x45c906,_0x13e246){return function(){WhatsappAccountEvents[_0x6ce9('0x5')](_0x45c906,_0x13e246);};}exports['register']=function(_0x36d0cb){for(var _0x223134=0x0,_0x464420=events[_0x6ce9('0x6')];_0x223134<_0x464420;_0x223134++){var _0x34a6d9=events[_0x223134];var _0x1a0afc=createListener(_0x6ce9('0x7')+_0x34a6d9,_0x36d0cb);WhatsappAccountEvents['on'](_0x34a6d9,_0x1a0afc);}};
\ No newline at end of file
index 5640460..d25f2aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f8b=['index','get','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x3bdd38,_0x42b165){var _0x3a0fef=function(_0x50f23d){while(--_0x50f23d){_0x3bdd38['push'](_0x3bdd38['shift']());}};_0x3a0fef(++_0x42b165);}(_0x9f8b,0xd9));var _0xb9f8=function(_0x42693d,_0x434c1c){_0x42693d=_0x42693d-0x0;var _0x57f95f=_0x9f8b[_0x42693d];return _0x57f95f;};'use strict';var multer=require(_0xb9f8('0x0'));var util=require(_0xb9f8('0x1'));var path=require(_0xb9f8('0x2'));var timeout=require(_0xb9f8('0x3'));var express=require(_0xb9f8('0x4'));var router=express[_0xb9f8('0x5')]();var fs_extra=require(_0xb9f8('0x6'));var auth=require(_0xb9f8('0x7'));var interaction=require(_0xb9f8('0x8'));var config=require(_0xb9f8('0x9'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0xb9f8('0xa')](),controller[_0xb9f8('0xb')]);router[_0xb9f8('0xc')]('/:id',auth[_0xb9f8('0xa')](),controller['show']);router[_0xb9f8('0xd')]('/',auth[_0xb9f8('0xa')](),controller[_0xb9f8('0xe')]);router['put'](_0xb9f8('0xf'),auth[_0xb9f8('0xa')](),controller[_0xb9f8('0x10')]);router[_0xb9f8('0x11')](_0xb9f8('0xf'),auth[_0xb9f8('0xa')](),controller['destroy']);module[_0xb9f8('0x12')]=router;
\ No newline at end of file
+var _0x98ae=['util','path','express','Router','fs-extra','../../components/auth/service','./whatsappApplication.controller','index','get','isAuthenticated','show','post','put','/:id','delete','destroy','exports','multer'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x98ae,0xb3));var _0xe98a=function(_0x12d4da,_0x24f552){_0x12d4da=_0x12d4da-0x0;var _0x25f0ed=_0x98ae[_0x12d4da];return _0x25f0ed;};'use strict';var multer=require(_0xe98a('0x0'));var util=require(_0xe98a('0x1'));var path=require(_0xe98a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe98a('0x3'));var router=express[_0xe98a('0x4')]();var fs_extra=require(_0xe98a('0x5'));var auth=require(_0xe98a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe98a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe98a('0x8')]);router[_0xe98a('0x9')]('/:id',auth[_0xe98a('0xa')](),controller[_0xe98a('0xb')]);router[_0xe98a('0xc')]('/',auth[_0xe98a('0xa')](),controller['create']);router[_0xe98a('0xd')](_0xe98a('0xe'),auth[_0xe98a('0xa')](),controller['update']);router[_0xe98a('0xf')](_0xe98a('0xe'),auth[_0xe98a('0xa')](),controller[_0xe98a('0x10')]);module[_0xe98a('0x11')]=router;
\ No newline at end of file
index a60438b..d511597 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56c4=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x5dda85,_0x2314d1){var _0x10df74=function(_0x440ec5){while(--_0x440ec5){_0x5dda85['push'](_0x5dda85['shift']());}};_0x10df74(++_0x2314d1);}(_0x56c4,0xf2));var _0x456c=function(_0x460919,_0x1391eb){_0x460919=_0x460919-0x0;var _0x8f5776=_0x56c4[_0x460919];return _0x8f5776;};'use strict';var Sequelize=require(_0x456c('0x0'));module[_0x456c('0x1')]={'priority':{'type':Sequelize[_0x456c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x456c('0x3')],'allowNull':![],'defaultValue':_0x456c('0x4')},'appdata':{'type':Sequelize[_0x456c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x456c('0x3')],'defaultValue':_0x456c('0x6')}};
\ No newline at end of file
+var _0x7e79=['INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x107974,_0x1d0a2c){var _0xdfbb79=function(_0x39be1e){while(--_0x39be1e){_0x107974['push'](_0x107974['shift']());}};_0xdfbb79(++_0x1d0a2c);}(_0x7e79,0x180));var _0x97e7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7e79[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x97e7('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x97e7('0x1')]()},'description':{'type':Sequelize[_0x97e7('0x2')]},'interval':{'type':Sequelize[_0x97e7('0x2')],'defaultValue':_0x97e7('0x3')}};
\ No newline at end of file
index 3e5ad2e..93412ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c19=['pick','filters','filter','merge','where','WhatsappApplication','include','findAll','rows','params','includeAll','options','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0xb410c1,_0x1b72ce){var _0x2aa733=function(_0x30fffc){while(--_0x30fffc){_0xb410c1['push'](_0xb410c1['shift']());}};_0x2aa733(++_0x1b72ce);}(_0x0c19,0xf5));var _0x90c1=function(_0x309f14,_0x47e384){_0x309f14=_0x309f14-0x0;var _0x18e1b1=_0x0c19[_0x309f14];return _0x18e1b1;};'use strict';var emlformat=require(_0x90c1('0x0'));var rimraf=require(_0x90c1('0x1'));var zipdir=require(_0x90c1('0x2'));var jsonpatch=require(_0x90c1('0x3'));var rp=require(_0x90c1('0x4'));var moment=require(_0x90c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x90c1('0x6'));var util=require(_0x90c1('0x7'));var path=require(_0x90c1('0x8'));var sox=require('sox');var csv=require(_0x90c1('0x9'));var ejs=require(_0x90c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90c1('0xb'));var squel=require(_0x90c1('0xc'));var crypto=require(_0x90c1('0xd'));var jsforce=require(_0x90c1('0xe'));var deskjs=require(_0x90c1('0xf'));var toCsv=require(_0x90c1('0x9'));var querystring=require(_0x90c1('0x10'));var Papa=require('papaparse');var Redis=require(_0x90c1('0x11'));var authService=require(_0x90c1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x90c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x90c1('0x14'));var utils=require('../../config/utils');var config=require(_0x90c1('0x15'));var licenseUtil=require(_0x90c1('0x16'));var db=require(_0x90c1('0x17'))['db'];function respondWithStatusCode(_0x2d9964,_0x4aa112){_0x4aa112=_0x4aa112||0xcc;return function(_0x59a0ca){if(_0x59a0ca){return _0x2d9964[_0x90c1('0x18')](_0x4aa112);}return _0x2d9964[_0x90c1('0x19')](_0x4aa112)[_0x90c1('0x1a')]();};}function respondWithResult(_0x3a8b82,_0x52a659){_0x52a659=_0x52a659||0xc8;return function(_0xaaab35){if(_0xaaab35){return _0x3a8b82[_0x90c1('0x19')](_0x52a659)[_0x90c1('0x1b')](_0xaaab35);}};}function respondWithFilteredResult(_0x139c67,_0x38fcea){return function(_0x1cfb86){if(_0x1cfb86){var _0x4f77bf=typeof _0x38fcea[_0x90c1('0x1c')]===_0x90c1('0x1d')&&typeof _0x38fcea[_0x90c1('0x1e')]===_0x90c1('0x1d');var _0x2fefb9=_0x1cfb86[_0x90c1('0x1f')];var _0x3b6671=_0x4f77bf?0x0:_0x38fcea[_0x90c1('0x1c')];var _0x372949=_0x4f77bf?_0x1cfb86[_0x90c1('0x1f')]:_0x38fcea[_0x90c1('0x1c')]+_0x38fcea['limit'];var _0x302ca2;if(_0x372949>=_0x2fefb9){_0x372949=_0x2fefb9;_0x302ca2=0xc8;}else{_0x302ca2=0xce;}_0x139c67[_0x90c1('0x19')](_0x302ca2);return _0x139c67[_0x90c1('0x20')](_0x90c1('0x21'),_0x3b6671+'-'+_0x372949+'/'+_0x2fefb9)[_0x90c1('0x1b')](_0x1cfb86);}return null;};}function patchUpdates(_0x3c8cc6){return function(_0x5a8358){try{jsonpatch[_0x90c1('0x22')](_0x5a8358,_0x3c8cc6,!![]);}catch(_0x5bfe28){return BPromise[_0x90c1('0x23')](_0x5bfe28);}return _0x5a8358['save']();};}function saveUpdates(_0x4b0480,_0x18323c){return function(_0x512cd9){if(_0x512cd9){return _0x512cd9['update'](_0x4b0480)[_0x90c1('0x24')](function(_0x5f4c05){return _0x5f4c05;});}return null;};}function removeEntity(_0x4d53fd,_0x36fe37){return function(_0x5e7258){if(_0x5e7258){return _0x5e7258[_0x90c1('0x25')]()['then'](function(){_0x4d53fd[_0x90c1('0x19')](0xcc)[_0x90c1('0x1a')]();});}};}function handleEntityNotFound(_0x309f83,_0x2625af){return function(_0x174506){if(!_0x174506){_0x309f83[_0x90c1('0x18')](0x194);}return _0x174506;};}function handleError(_0x2a60fb,_0x5b38f5){_0x5b38f5=_0x5b38f5||0x1f4;return function(_0x26ee39){logger[_0x90c1('0x26')](_0x26ee39[_0x90c1('0x27')]);if(_0x26ee39[_0x90c1('0x28')]){delete _0x26ee39[_0x90c1('0x28')];}_0x2a60fb[_0x90c1('0x19')](_0x5b38f5)[_0x90c1('0x29')](_0x26ee39);};}exports[_0x90c1('0x2a')]=function(_0x40c45d,_0x1ed79c){var _0x17b923={},_0x2f85dc={},_0x46c65b={'count':0x0,'rows':[]};var _0x39f856=_[_0x90c1('0x2b')](db['WhatsappApplication'][_0x90c1('0x2c')],function(_0x435e56){return{'name':_0x435e56[_0x90c1('0x2d')],'type':_0x435e56[_0x90c1('0x2e')][_0x90c1('0x2f')]};});_0x2f85dc[_0x90c1('0x30')]=_[_0x90c1('0x2b')](_0x39f856,_0x90c1('0x28'));_0x2f85dc[_0x90c1('0x31')]=_[_0x90c1('0x32')](_0x40c45d[_0x90c1('0x31')]);_0x2f85dc['filters']=_[_0x90c1('0x33')](_0x2f85dc[_0x90c1('0x30')],_0x2f85dc[_0x90c1('0x31')]);_0x17b923['attributes']=_[_0x90c1('0x33')](_0x2f85dc[_0x90c1('0x30')],qs[_0x90c1('0x34')](_0x40c45d[_0x90c1('0x31')][_0x90c1('0x34')]));_0x17b923[_0x90c1('0x35')]=_0x17b923[_0x90c1('0x35')][_0x90c1('0x36')]?_0x17b923[_0x90c1('0x35')]:_0x2f85dc[_0x90c1('0x30')];if(!_0x40c45d[_0x90c1('0x31')][_0x90c1('0x37')](_0x90c1('0x38'))){_0x17b923[_0x90c1('0x1e')]=qs['limit'](_0x40c45d[_0x90c1('0x31')][_0x90c1('0x1e')]);_0x17b923[_0x90c1('0x1c')]=qs[_0x90c1('0x1c')](_0x40c45d['query']['offset']);}_0x17b923[_0x90c1('0x39')]=qs[_0x90c1('0x3a')](_0x40c45d[_0x90c1('0x31')][_0x90c1('0x3a')]);_0x17b923['where']=qs['filters'](_[_0x90c1('0x3b')](_0x40c45d[_0x90c1('0x31')],_0x2f85dc[_0x90c1('0x3c')]),_0x39f856);if(_0x40c45d[_0x90c1('0x31')][_0x90c1('0x3d')]){_0x17b923['where']=_['merge'](_0x17b923['where'],{'$or':_[_0x90c1('0x2b')](_0x39f856,function(_0x18c35d){if(_0x18c35d[_0x90c1('0x2e')]!=='VIRTUAL'){var _0x32bc3d={};_0x32bc3d[_0x18c35d['name']]={'$like':'%'+_0x40c45d['query'][_0x90c1('0x3d')]+'%'};return _0x32bc3d;}})});}_0x17b923=_[_0x90c1('0x3e')]({},_0x17b923,_0x40c45d['options']);var _0x3ace43={'where':_0x17b923[_0x90c1('0x3f')]};return db[_0x90c1('0x40')][_0x90c1('0x1f')](_0x3ace43)[_0x90c1('0x24')](function(_0x275731){_0x46c65b['count']=_0x275731;if(_0x40c45d[_0x90c1('0x31')]['includeAll']){_0x17b923[_0x90c1('0x41')]=[{'all':!![]}];}return db[_0x90c1('0x40')][_0x90c1('0x42')](_0x17b923);})[_0x90c1('0x24')](function(_0x8c47ec){_0x46c65b[_0x90c1('0x43')]=_0x8c47ec;return _0x46c65b;})[_0x90c1('0x24')](respondWithFilteredResult(_0x1ed79c,_0x17b923))['catch'](handleError(_0x1ed79c,null));};exports['show']=function(_0x2cd0fa,_0x118104){var _0x1699a1={'raw':!![],'where':{'id':_0x2cd0fa[_0x90c1('0x44')]['id']}},_0x4175d1={};_0x4175d1['model']=_['keys'](db[_0x90c1('0x40')][_0x90c1('0x2c')]);_0x4175d1['query']=_[_0x90c1('0x32')](_0x2cd0fa['query']);_0x4175d1['filters']=_[_0x90c1('0x33')](_0x4175d1['model'],_0x4175d1[_0x90c1('0x31')]);_0x1699a1['attributes']=_['intersection'](_0x4175d1[_0x90c1('0x30')],qs[_0x90c1('0x34')](_0x2cd0fa[_0x90c1('0x31')][_0x90c1('0x34')]));_0x1699a1['attributes']=_0x1699a1[_0x90c1('0x35')][_0x90c1('0x36')]?_0x1699a1[_0x90c1('0x35')]:_0x4175d1[_0x90c1('0x30')];if(_0x2cd0fa['query'][_0x90c1('0x45')]){_0x1699a1[_0x90c1('0x41')]=[{'all':!![]}];}_0x1699a1=_['merge']({},_0x1699a1,_0x2cd0fa[_0x90c1('0x46')]);return db[_0x90c1('0x40')][_0x90c1('0x47')](_0x1699a1)[_0x90c1('0x24')](handleEntityNotFound(_0x118104,null))[_0x90c1('0x24')](respondWithResult(_0x118104,null))['catch'](handleError(_0x118104,null));};exports[_0x90c1('0x48')]=function(_0x4bde8e,_0x304011){return db['WhatsappApplication'][_0x90c1('0x48')](_0x4bde8e[_0x90c1('0x49')],{})[_0x90c1('0x24')](respondWithResult(_0x304011,0xc9))[_0x90c1('0x4a')](handleError(_0x304011,null));};exports[_0x90c1('0x4b')]=function(_0x3aa812,_0x1d00e4){if(_0x3aa812[_0x90c1('0x49')]['id']){delete _0x3aa812[_0x90c1('0x49')]['id'];}return db['WhatsappApplication'][_0x90c1('0x47')]({'where':{'id':_0x3aa812['params']['id']}})[_0x90c1('0x24')](handleEntityNotFound(_0x1d00e4,null))[_0x90c1('0x24')](saveUpdates(_0x3aa812[_0x90c1('0x49')],null))[_0x90c1('0x24')](respondWithResult(_0x1d00e4,null))[_0x90c1('0x4a')](handleError(_0x1d00e4,null));};exports[_0x90c1('0x25')]=function(_0x201674,_0x177a53){return db[_0x90c1('0x40')][_0x90c1('0x47')]({'where':{'id':_0x201674[_0x90c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x177a53,null))[_0x90c1('0x24')](removeEntity(_0x177a53,null))[_0x90c1('0x4a')](handleError(_0x177a53,null));};
\ No newline at end of file
+var _0xbd8e=['sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','WhatsappApplication','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','request-promise','bluebird','mustache','util','path'];(function(_0x36d064,_0x35854e){var _0x218fcd=function(_0x143eba){while(--_0x143eba){_0x36d064['push'](_0x36d064['shift']());}};_0x218fcd(++_0x35854e);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xbd8e[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xebd8('0x0'));var rimraf=require(_0xebd8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xebd8('0x2'));var moment=require('moment');var BPromise=require(_0xebd8('0x3'));var Mustache=require(_0xebd8('0x4'));var util=require(_0xebd8('0x5'));var path=require(_0xebd8('0x6'));var sox=require(_0xebd8('0x7'));var csv=require('to-csv');var ejs=require(_0xebd8('0x8'));var fs=require('fs');var fs_extra=require(_0xebd8('0x9'));var _=require(_0xebd8('0xa'));var squel=require(_0xebd8('0xb'));var crypto=require(_0xebd8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xebd8('0xd'));var toCsv=require(_0xebd8('0xe'));var querystring=require(_0xebd8('0xf'));var Papa=require(_0xebd8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xebd8('0x11'));var hardwareService=require(_0xebd8('0x12'));var logger=require(_0xebd8('0x13'))(_0xebd8('0x14'));var utils=require(_0xebd8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xebd8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x247d34,_0x1d13c8){_0x1d13c8=_0x1d13c8||0xcc;return function(_0x4c3293){if(_0x4c3293){return _0x247d34[_0xebd8('0x17')](_0x1d13c8);}return _0x247d34[_0xebd8('0x18')](_0x1d13c8)[_0xebd8('0x19')]();};}function respondWithResult(_0x5cc357,_0x12b5cd){_0x12b5cd=_0x12b5cd||0xc8;return function(_0x5ca45c){if(_0x5ca45c){return _0x5cc357[_0xebd8('0x18')](_0x12b5cd)['json'](_0x5ca45c);}};}function respondWithFilteredResult(_0x598f71,_0x3e50e0){return function(_0x10d4eb){if(_0x10d4eb){var _0x2162ad=typeof _0x3e50e0[_0xebd8('0x1a')]===_0xebd8('0x1b')&&typeof _0x3e50e0[_0xebd8('0x1c')]===_0xebd8('0x1b');var _0x33ceac=_0x10d4eb[_0xebd8('0x1d')];var _0x3e0293=_0x2162ad?0x0:_0x3e50e0[_0xebd8('0x1a')];var _0x46a956=_0x2162ad?_0x10d4eb[_0xebd8('0x1d')]:_0x3e50e0[_0xebd8('0x1a')]+_0x3e50e0['limit'];var _0x158940;if(_0x46a956>=_0x33ceac){_0x46a956=_0x33ceac;_0x158940=0xc8;}else{_0x158940=0xce;}_0x598f71[_0xebd8('0x18')](_0x158940);return _0x598f71[_0xebd8('0x1e')](_0xebd8('0x1f'),_0x3e0293+'-'+_0x46a956+'/'+_0x33ceac)[_0xebd8('0x20')](_0x10d4eb);}return null;};}function patchUpdates(_0x24be02){return function(_0x1c8e6a){try{jsonpatch[_0xebd8('0x21')](_0x1c8e6a,_0x24be02,!![]);}catch(_0x56f1f6){return BPromise['reject'](_0x56f1f6);}return _0x1c8e6a[_0xebd8('0x22')]();};}function saveUpdates(_0x9b52cf,_0x26aff8){return function(_0x2a27a6){if(_0x2a27a6){return _0x2a27a6[_0xebd8('0x23')](_0x9b52cf)[_0xebd8('0x24')](function(_0x12c460){return _0x12c460;});}return null;};}function removeEntity(_0x44493c,_0x43903b){return function(_0x228411){if(_0x228411){return _0x228411[_0xebd8('0x25')]()[_0xebd8('0x24')](function(){_0x44493c[_0xebd8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e1654,_0x54a9e4){return function(_0x132159){if(!_0x132159){_0x3e1654[_0xebd8('0x17')](0x194);}return _0x132159;};}function handleError(_0x2aea80,_0xed6322){_0xed6322=_0xed6322||0x1f4;return function(_0x552db7){logger['error'](_0x552db7[_0xebd8('0x26')]);if(_0x552db7[_0xebd8('0x27')]){delete _0x552db7[_0xebd8('0x27')];}_0x2aea80[_0xebd8('0x18')](_0xed6322)[_0xebd8('0x28')](_0x552db7);};}exports[_0xebd8('0x29')]=function(_0x427709,_0x5b0db9){var _0x5284df={},_0x352a96={},_0x57c013={'count':0x0,'rows':[]};var _0x2a0464=_['map'](db[_0xebd8('0x2a')][_0xebd8('0x2b')],function(_0x51e28e){return{'name':_0x51e28e[_0xebd8('0x2c')],'type':_0x51e28e['type'][_0xebd8('0x2d')]};});_0x352a96[_0xebd8('0x2e')]=_[_0xebd8('0x2f')](_0x2a0464,'name');_0x352a96['query']=_[_0xebd8('0x30')](_0x427709[_0xebd8('0x31')]);_0x352a96[_0xebd8('0x32')]=_['intersection'](_0x352a96[_0xebd8('0x2e')],_0x352a96[_0xebd8('0x31')]);_0x5284df[_0xebd8('0x33')]=_[_0xebd8('0x34')](_0x352a96[_0xebd8('0x2e')],qs[_0xebd8('0x35')](_0x427709[_0xebd8('0x31')][_0xebd8('0x35')]));_0x5284df[_0xebd8('0x33')]=_0x5284df[_0xebd8('0x33')][_0xebd8('0x36')]?_0x5284df[_0xebd8('0x33')]:_0x352a96[_0xebd8('0x2e')];if(!_0x427709[_0xebd8('0x31')][_0xebd8('0x37')](_0xebd8('0x38'))){_0x5284df[_0xebd8('0x1c')]=qs[_0xebd8('0x1c')](_0x427709['query'][_0xebd8('0x1c')]);_0x5284df[_0xebd8('0x1a')]=qs['offset'](_0x427709[_0xebd8('0x31')][_0xebd8('0x1a')]);}_0x5284df[_0xebd8('0x39')]=qs[_0xebd8('0x3a')](_0x427709[_0xebd8('0x31')]['sort']);_0x5284df[_0xebd8('0x3b')]=qs[_0xebd8('0x32')](_[_0xebd8('0x3c')](_0x427709[_0xebd8('0x31')],_0x352a96[_0xebd8('0x32')]),_0x2a0464);if(_0x427709[_0xebd8('0x31')][_0xebd8('0x3d')]){_0x5284df[_0xebd8('0x3b')]=_['merge'](_0x5284df[_0xebd8('0x3b')],{'$or':_[_0xebd8('0x2f')](_0x2a0464,function(_0x55cee9){if(_0x55cee9[_0xebd8('0x3e')]!=='VIRTUAL'){var _0x214275={};_0x214275[_0x55cee9[_0xebd8('0x27')]]={'$like':'%'+_0x427709[_0xebd8('0x31')][_0xebd8('0x3d')]+'%'};return _0x214275;}})});}_0x5284df=_['merge']({},_0x5284df,_0x427709[_0xebd8('0x3f')]);var _0x13c74e={'where':_0x5284df[_0xebd8('0x3b')]};return db['WhatsappApplication'][_0xebd8('0x1d')](_0x13c74e)[_0xebd8('0x24')](function(_0x3b6318){_0x57c013[_0xebd8('0x1d')]=_0x3b6318;if(_0x427709[_0xebd8('0x31')][_0xebd8('0x40')]){_0x5284df[_0xebd8('0x41')]=[{'all':!![]}];}return db[_0xebd8('0x2a')][_0xebd8('0x42')](_0x5284df);})[_0xebd8('0x24')](function(_0x36d021){_0x57c013[_0xebd8('0x43')]=_0x36d021;return _0x57c013;})['then'](respondWithFilteredResult(_0x5b0db9,_0x5284df))[_0xebd8('0x44')](handleError(_0x5b0db9,null));};exports[_0xebd8('0x45')]=function(_0x521474,_0x1ea255){var _0x32b470={'raw':!![],'where':{'id':_0x521474['params']['id']}},_0x354283={};_0x354283['model']=_['keys'](db[_0xebd8('0x2a')][_0xebd8('0x2b')]);_0x354283[_0xebd8('0x31')]=_[_0xebd8('0x30')](_0x521474['query']);_0x354283['filters']=_[_0xebd8('0x34')](_0x354283['model'],_0x354283['query']);_0x32b470[_0xebd8('0x33')]=_[_0xebd8('0x34')](_0x354283[_0xebd8('0x2e')],qs['fields'](_0x521474[_0xebd8('0x31')][_0xebd8('0x35')]));_0x32b470[_0xebd8('0x33')]=_0x32b470[_0xebd8('0x33')][_0xebd8('0x36')]?_0x32b470['attributes']:_0x354283['model'];if(_0x521474['query'][_0xebd8('0x40')]){_0x32b470[_0xebd8('0x41')]=[{'all':!![]}];}_0x32b470=_['merge']({},_0x32b470,_0x521474[_0xebd8('0x3f')]);return db[_0xebd8('0x2a')][_0xebd8('0x46')](_0x32b470)[_0xebd8('0x24')](handleEntityNotFound(_0x1ea255,null))['then'](respondWithResult(_0x1ea255,null))[_0xebd8('0x44')](handleError(_0x1ea255,null));};exports['create']=function(_0x46eda9,_0x1ae625){return db[_0xebd8('0x2a')][_0xebd8('0x47')](_0x46eda9[_0xebd8('0x48')],{})[_0xebd8('0x24')](respondWithResult(_0x1ae625,0xc9))[_0xebd8('0x44')](handleError(_0x1ae625,null));};exports['update']=function(_0x2d57e7,_0x479140){if(_0x2d57e7[_0xebd8('0x48')]['id']){delete _0x2d57e7[_0xebd8('0x48')]['id'];}return db[_0xebd8('0x2a')]['find']({'where':{'id':_0x2d57e7[_0xebd8('0x49')]['id']}})[_0xebd8('0x24')](handleEntityNotFound(_0x479140,null))[_0xebd8('0x24')](saveUpdates(_0x2d57e7[_0xebd8('0x48')],null))[_0xebd8('0x24')](respondWithResult(_0x479140,null))['catch'](handleError(_0x479140,null));};exports[_0xebd8('0x25')]=function(_0x16d43a,_0x3cb0d5){return db[_0xebd8('0x2a')][_0xebd8('0x46')]({'where':{'id':_0x16d43a[_0xebd8('0x49')]['id']}})[_0xebd8('0x24')](handleEntityNotFound(_0x3cb0d5,null))[_0xebd8('0x24')](removeEntity(_0x3cb0d5,null))[_0xebd8('0x44')](handleError(_0x3cb0d5,null));};
\ No newline at end of file
index 76d127c..3e93f90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bc3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0x3af7b7,_0x208014){var _0x8408b5=function(_0x22161d){while(--_0x22161d){_0x3af7b7['push'](_0x3af7b7['shift']());}};_0x8408b5(++_0x208014);}(_0x4bc3,0x16e));var _0x34bc=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x4bc3[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var logger=require('../../config/logger')(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x34bc('0x4'));var fs=require('fs');var path=require(_0x34bc('0x5'));var rimraf=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var attributes=require(_0x34bc('0x8'));module[_0x34bc('0x9')]=function(_0x2cc9c2,_0x4c63a1){return _0x2cc9c2[_0x34bc('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x34bc('0xb'),'collate':_0x34bc('0xc')});};
\ No newline at end of file
+var _0x0a12=['util','bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications'];(function(_0x3230a9,_0x593859){var _0x9a3d41=function(_0x459195){while(--_0x459195){_0x3230a9['push'](_0x3230a9['shift']());}};_0x9a3d41(++_0x593859);}(_0x0a12,0xb8));var _0x20a1=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x0a12[_0x1b7368];return _0x25d54c;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20a1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a1('0x2'));var rimraf=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var attributes=require(_0x20a1('0x5'));module[_0x20a1('0x6')]=function(_0x2e0ad3,_0x1fedd2){return _0x2e0ad3['define']('WhatsappApplication',attributes,{'tableName':_0x20a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 411e13e..3c89ba3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x514ec6,_0x346c50){var _0x475d37=function(_0x4153c5){while(--_0x4153c5){_0x514ec6['push'](_0x514ec6['shift']());}};_0x475d37(++_0x346c50);}(_0x032e,0x124));var _0xe032=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x032e[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});}
\ No newline at end of file
+var _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5601b4,_0x458d4f){var _0x266798=function(_0x43e9d9){while(--_0x43e9d9){_0x5601b4['push'](_0x5601b4['shift']());}};_0x266798(++_0x458d4f);}(_0x032e,0x124));var _0xe032=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x032e[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});}
\ No newline at end of file
index 8375fec..e39536e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/messages','/:id/download','download','create','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','multer'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0x7da7,0x10d));var _0x77da=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x7da7[_0x454e6d];return _0x4bc294;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./whatsappInteraction.controller');router[_0x77da('0x7')]('/',auth[_0x77da('0x8')](),controller['index']);router[_0x77da('0x7')]('/describe',auth[_0x77da('0x8')](),controller[_0x77da('0x9')]);router[_0x77da('0x7')](_0x77da('0xa'),auth[_0x77da('0x8')](),controller['show']);router[_0x77da('0x7')](_0x77da('0xb'),auth[_0x77da('0x8')](),controller['getMessages']);router[_0x77da('0x7')](_0x77da('0xc'),auth[_0x77da('0x8')](),controller[_0x77da('0xd')]);router['post']('/',auth[_0x77da('0x8')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0x77da('0x10')]);router[_0x77da('0xf')]('/:id/tags',auth[_0x77da('0x8')](),interaction[_0x77da('0x11')](_0x77da('0x12'),_0x77da('0x13')),controller['addTags']);router[_0x77da('0x14')]('/:id',auth[_0x77da('0x8')](),interaction[_0x77da('0x11')](_0x77da('0x12'),_0x77da('0x15')),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x77da('0x11')](_0x77da('0x12'),_0x77da('0x16')),controller[_0x77da('0x17')]);router[_0x77da('0x18')](_0x77da('0x19'),auth[_0x77da('0x8')](),controller[_0x77da('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x06f4=['connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','destroy','delete','multer','util'];(function(_0x567590,_0x7baf9c){var _0x5444a5=function(_0xc1bf71){while(--_0xc1bf71){_0x567590['push'](_0x567590['shift']());}};_0x5444a5(++_0x7baf9c);}(_0x06f4,0x136));var _0x406f=function(_0x3857bb,_0x583861){_0x3857bb=_0x3857bb-0x0;var _0x5e1d12=_0x06f4[_0x3857bb];return _0x5e1d12;};'use strict';var multer=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var path=require('path');var timeout=require(_0x406f('0x2'));var express=require(_0x406f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x406f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x406f('0x5'));var controller=require(_0x406f('0x6'));router[_0x406f('0x7')]('/',auth[_0x406f('0x8')](),controller['index']);router[_0x406f('0x7')]('/describe',auth[_0x406f('0x8')](),controller[_0x406f('0x9')]);router[_0x406f('0x7')]('/:id',auth[_0x406f('0x8')](),controller['show']);router['get'](_0x406f('0xa'),auth['isAuthenticated'](),controller[_0x406f('0xb')]);router['get'](_0x406f('0xc'),auth['isAuthenticated'](),controller[_0x406f('0xd')]);router[_0x406f('0xe')]('/',auth['isAuthenticated'](),controller[_0x406f('0xf')]);router[_0x406f('0xe')](_0x406f('0xa'),auth[_0x406f('0x8')](),controller[_0x406f('0x10')]);router[_0x406f('0xe')](_0x406f('0x11'),auth[_0x406f('0x8')](),interaction[_0x406f('0x12')](_0x406f('0x13'),_0x406f('0x14')),controller['addTags']);router[_0x406f('0x15')](_0x406f('0x16'),auth[_0x406f('0x8')](),interaction['tracked'](_0x406f('0x13'),_0x406f('0x17')),controller['update']);router['delete'](_0x406f('0x16'),auth[_0x406f('0x8')](),interaction['tracked'](_0x406f('0x13'),'whatsappinteraction:destroy'),controller[_0x406f('0x18')]);router[_0x406f('0x19')](_0x406f('0x11'),auth[_0x406f('0x8')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index 57faeb7..202e3e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x975f=['out','ENUM','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x54b47e,_0x1c23d9){var _0x1fa4b8=function(_0x2d42a3){while(--_0x2d42a3){_0x54b47e['push'](_0x54b47e['shift']());}};_0x1fa4b8(++_0x1c23d9);}(_0x975f,0x191));var _0xf975=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x975f[_0x93942f];return _0x23fcd8;};'use strict';var Sequelize=require(_0xf975('0x0'));var moment=require('moment');module[_0xf975('0x1')]={'closed':{'type':Sequelize[_0xf975('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf975('0x3')]},'disposition':{'type':Sequelize[_0xf975('0x4')]},'secondDisposition':{'type':Sequelize[_0xf975('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf975('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf975('0x4')]},'read1stAt':{'type':Sequelize[_0xf975('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf975('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf975('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf975('0x6')]('in',_0xf975('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf975('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x37a7=['moment','STRING','DATE','ENUM','out','BOOLEAN','sequelize'];(function(_0x1db880,_0x4e261a){var _0x28e7ab=function(_0xf62b2){while(--_0xf62b2){_0x1db880['push'](_0x1db880['shift']());}};_0x28e7ab(++_0x4e261a);}(_0x37a7,0x6f));var _0x737a=function(_0x46e0c8,_0x15ba31){_0x46e0c8=_0x46e0c8-0x0;var _0x5dbc8d=_0x37a7[_0x46e0c8];return _0x5dbc8d;};'use strict';var Sequelize=require(_0x737a('0x0'));var moment=require(_0x737a('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x737a('0x2')]},'secondDisposition':{'type':Sequelize[_0x737a('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x737a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x737a('0x4')]('in',_0x737a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x737a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x737a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x737a('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 27caf12..6c1ade0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f37=['Content-Range','json','apply','save','update','destroy','then','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','waiting','talking','answered','closed','UserId','unmanaged','total','index','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','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?','find','ContactId','buildExpression','text','start','end','Tag','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.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.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','show','params','include','merge','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','setTags','emit','whatsappInteractionTags:save','download','join','server','files','tmp','root','transcript-%d-%s.zip','User','firstName','lastName','attachments','Attachment','Messages','direction','WhatsappAccount','Owner','mkdirSync','Whatsapp','Account','N.A.','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','renderFile','downloadInteraction.ejs','transcript-','log','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x559499,_0x2ecc11){var _0x476cb7=function(_0x48fde0){while(--_0x48fde0){_0x559499['push'](_0x559499['shift']());}};_0x476cb7(++_0x2ecc11);}(_0x9f37,0xd1));var _0x79f3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9f37[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x79f3('0x0'));var rimraf=require(_0x79f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79f3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x79f3('0x3'));var Mustache=require(_0x79f3('0x4'));var util=require(_0x79f3('0x5'));var path=require('path');var sox=require(_0x79f3('0x6'));var csv=require(_0x79f3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79f3('0x8'));var squel=require(_0x79f3('0x9'));var crypto=require(_0x79f3('0xa'));var jsforce=require(_0x79f3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x79f3('0x7'));var querystring=require(_0x79f3('0xc'));var Papa=require('papaparse');var Redis=require(_0x79f3('0xd'));var authService=require(_0x79f3('0xe'));var qs=require(_0x79f3('0xf'));var as=require(_0x79f3('0x10'));var pdf=require(_0x79f3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x79f3('0x12'))(_0x79f3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x79f3('0x14'));var db=require(_0x79f3('0x15'))['db'];config[_0x79f3('0x16')]=_[_0x79f3('0x17')](config['redis'],{'host':_0x79f3('0x18'),'port':0x18eb});var socket=require(_0x79f3('0x19'))(new Redis(config[_0x79f3('0x16')]));require(_0x79f3('0x1a'))[_0x79f3('0x1b')](socket);function respondWithStatusCode(_0x42d4d1,_0x5a79eb){_0x5a79eb=_0x5a79eb||0xcc;return function(_0x5764d4){if(_0x5764d4){return _0x42d4d1[_0x79f3('0x1c')](_0x5a79eb);}return _0x42d4d1[_0x79f3('0x1d')](_0x5a79eb)['end']();};}function respondWithResult(_0x359fe8,_0x2e3e5b){_0x2e3e5b=_0x2e3e5b||0xc8;return function(_0x23874b){if(_0x23874b){return _0x359fe8[_0x79f3('0x1d')](_0x2e3e5b)['json'](_0x23874b);}};}function respondWithFilteredResult(_0x31e411,_0x897f98){return function(_0x2179d0){if(_0x2179d0){var _0x331b30=typeof _0x897f98[_0x79f3('0x1e')]===_0x79f3('0x1f')&&typeof _0x897f98[_0x79f3('0x20')]===_0x79f3('0x1f');var _0x2f6ba7=_0x2179d0[_0x79f3('0x21')];var _0x25df77=_0x331b30?0x0:_0x897f98[_0x79f3('0x1e')];var _0x1d150e=_0x331b30?_0x2179d0[_0x79f3('0x21')]:_0x897f98[_0x79f3('0x1e')]+_0x897f98[_0x79f3('0x20')];var _0xdc0f58;if(_0x1d150e>=_0x2f6ba7){_0x1d150e=_0x2f6ba7;_0xdc0f58=0xc8;}else{_0xdc0f58=0xce;}_0x31e411[_0x79f3('0x1d')](_0xdc0f58);return _0x31e411[_0x79f3('0x22')](_0x79f3('0x23'),_0x25df77+'-'+_0x1d150e+'/'+_0x2f6ba7)[_0x79f3('0x24')](_0x2179d0);}return null;};}function patchUpdates(_0x297e50){return function(_0x146e15){try{jsonpatch[_0x79f3('0x25')](_0x146e15,_0x297e50,!![]);}catch(_0x1200ec){return BPromise['reject'](_0x1200ec);}return _0x146e15[_0x79f3('0x26')]();};}function saveUpdates(_0x508966,_0x2b6ced){return function(_0x168fe8){if(_0x168fe8){return _0x168fe8[_0x79f3('0x27')](_0x508966)['then'](function(_0x4a9518){return _0x4a9518;});}return null;};}function removeEntity(_0x1e8010,_0x142cfa){return function(_0x6975d8){if(_0x6975d8){return _0x6975d8[_0x79f3('0x28')]()[_0x79f3('0x29')](function(){_0x1e8010[_0x79f3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31efe8,_0x30b394){return function(_0x4d5e0f){if(!_0x4d5e0f){_0x31efe8[_0x79f3('0x1c')](0x194);}return _0x4d5e0f;};}function handleError(_0x201235,_0x39ab86){_0x39ab86=_0x39ab86||0x1f4;return function(_0x4c3c11){logger['error'](_0x4c3c11[_0x79f3('0x2a')]);if(_0x4c3c11[_0x79f3('0x2b')]){delete _0x4c3c11[_0x79f3('0x2b')];}_0x201235[_0x79f3('0x1d')](_0x39ab86)[_0x79f3('0x2c')](_0x4c3c11);};}function getInteractionUsers(_0x69d14f,_0x3db9cd){return new BPromise(function(_0x250a48,_0x3b30ce){try{if(_0x3db9cd[_0x69d14f['id']]){_0x69d14f[_0x79f3('0x2d')]=_[_0x79f3('0x2e')](_0x3db9cd[_0x69d14f['id']],function(_0x23fde6){return{'id':_0x23fde6['id'],'fullname':_0x23fde6[_0x79f3('0x2f')]};});}}catch(_0x16f859){_0x3b30ce(_0x16f859);}_0x250a48(_0x69d14f);});}function getInteractionTags(_0x53ecba,_0x3a8bcc){return new BPromise(function(_0x13b870,_0x29e665){try{if(_0x53ecba[_0x79f3('0x30')]){_0x53ecba[_0x79f3('0x31')]=[];_0x53ecba[_0x79f3('0x30')]['split'](',')['forEach'](function(_0x36554f){_0x53ecba['Tags'][_0x79f3('0x32')](_0x3a8bcc[_0x36554f]);});}delete _0x53ecba[_0x79f3('0x30')];}catch(_0x9e714f){_0x29e665(_0x9e714f);}_0x13b870(_0x53ecba);});}function updateWhatsappInteraction(_0x518dca,_0x356a48,_0x323414){return new BPromise(function(_0x22b732,_0x59195d){return getInteractionUsers(_0x518dca,_0x323414)[_0x79f3('0x29')](function(_0x5a77d2){return getInteractionTags(_0x5a77d2,_0x356a48);})[_0x79f3('0x29')](function(_0x49a237){return getStateInteraction(_0x49a237);})[_0x79f3('0x29')](function(_0x1e27b8){_0x22b732(_0x1e27b8);})[_0x79f3('0x33')](function(_0x22e09e){_0x59195d(_0x22e09e);});});}function getStateInteraction(_0x477e8a){return new BPromise(function(_0x4fa06f){_0x477e8a[_0x79f3('0x34')]=0x0;_0x477e8a[_0x79f3('0x35')]=0x0;_0x477e8a[_0x79f3('0x36')]=0x0;_0x477e8a['unmanaged']=0x0;_0x477e8a['total']=0x0;if(!_0x477e8a[_0x79f3('0x37')]&&!_0x477e8a[_0x79f3('0x38')]){_0x477e8a['waiting']+=0x1;}if(!_0x477e8a[_0x79f3('0x37')]&&_0x477e8a[_0x79f3('0x38')]){_0x477e8a['talking']+=0x1;if(_0x477e8a[_0x79f3('0x34')]){_0x477e8a['waiting']-=0x1;}}if(_0x477e8a[_0x79f3('0x37')]&&_0x477e8a[_0x79f3('0x38')]){_0x477e8a[_0x79f3('0x36')]+=0x1;if(_0x477e8a[_0x79f3('0x35')]){_0x477e8a['talking']-=0x1;}}if(_0x477e8a[_0x79f3('0x37')]&&!_0x477e8a['UserId']){_0x477e8a[_0x79f3('0x39')]+=0x1;if(_0x477e8a[_0x79f3('0x34')]){_0x477e8a['waiting']-=0x1;}}_0x477e8a[_0x79f3('0x3a')]+=0x1;_0x4fa06f(_0x477e8a);});}exports[_0x79f3('0x3b')]=function(_0x57f0ba,_0x447cfb){var _0x3f3583={},_0x34ce49={},_0x316554={'count':0x0,'rows':[]};var _0x165eb6=_[_0x79f3('0x2e')](db['WhatsappInteraction'][_0x79f3('0x3c')],function(_0x389ece){return{'name':_0x389ece[_0x79f3('0x3d')],'type':_0x389ece[_0x79f3('0x3e')]['key']};});_0x34ce49['model']=_[_0x79f3('0x2e')](_0x165eb6,'name');_0x34ce49[_0x79f3('0x3f')]=_[_0x79f3('0x40')](_0x57f0ba[_0x79f3('0x3f')]);_0x34ce49[_0x79f3('0x41')]=_[_0x79f3('0x42')](_0x34ce49[_0x79f3('0x43')],_0x34ce49['query']);_0x3f3583[_0x79f3('0x44')]=_[_0x79f3('0x42')](_0x34ce49['model'],qs[_0x79f3('0x45')](_0x57f0ba['query'][_0x79f3('0x45')]));_0x3f3583[_0x79f3('0x44')]=_0x3f3583['attributes'][_0x79f3('0x46')]?_0x3f3583[_0x79f3('0x44')]:_0x34ce49[_0x79f3('0x43')];if(!_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x47')](_0x79f3('0x48'))){_0x3f3583[_0x79f3('0x20')]=qs['limit'](_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x20')]);_0x3f3583['offset']=qs[_0x79f3('0x1e')](_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x1e')]);}_0x3f3583[_0x79f3('0x49')]=qs[_0x79f3('0x4a')](_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x4a')]);_0x3f3583['where']=qs[_0x79f3('0x41')](_['pick'](_0x57f0ba[_0x79f3('0x3f')],_0x34ce49[_0x79f3('0x41')]),_0x165eb6);var _0x148ed0=[];var _0x1a75f9=squel[_0x79f3('0x4b')]()[_0x79f3('0x4c')]('id')[_0x79f3('0x4c')](_0x79f3('0x2b'))[_0x79f3('0x4c')](_0x79f3('0x4d'))[_0x79f3('0x4e')]('tools_tags');var _0x417e3a=squel[_0x79f3('0x4b')]()[_0x79f3('0x4c')]('u.id')[_0x79f3('0x4c')](_0x79f3('0x4f'))[_0x79f3('0x4c')](_0x79f3('0x50'))[_0x79f3('0x4e')](_0x79f3('0x51'),'ui')[_0x79f3('0x52')](_0x79f3('0x53'),'u',_0x79f3('0x54'));var _0x469eef=squel['select']()[_0x79f3('0x4e')](_0x79f3('0x55'),'i')[_0x79f3('0x52')](_0x79f3('0x56'),'c',_0x79f3('0x57'))[_0x79f3('0x52')](_0x79f3('0x53'),'o',_0x79f3('0x58'))[_0x79f3('0x52')](_0x79f3('0x59'),'a',_0x79f3('0x5a'))[_0x79f3('0x52')](_0x79f3('0x5b'),'me',_0x79f3('0x5c'))[_0x79f3('0x52')](_0x79f3('0x5d'),'it',_0x79f3('0x5e'))[_0x79f3('0x52')](_0x79f3('0x5f'),'t',_0x79f3('0x60'));var _0x2921f3=squel[_0x79f3('0x61')]();var _0x19a198=[];var _0x49697e=squel[_0x79f3('0x61')]();var _0x4792bd;if(_0x57f0ba['query'][_0x79f3('0x62')]){_0x4792bd=as['parseSearch'](_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x62')]);var _0x409a95=_0x4792bd[_0x79f3('0x63')];for(var _0x2f4c88=0x0;_0x2f4c88<_0x4792bd[_0x79f3('0x64')]['length'];_0x2f4c88++){var _0x3c7562=_0x4792bd[_0x79f3('0x64')][_0x2f4c88];var _0x46f84e='i';var _0x471747=_['find'](_0x165eb6,[_0x79f3('0x2b'),_0x3c7562[_0x79f3('0x4c')]]);if(!_0x471747){switch(_0x3c7562[_0x79f3('0x4c')]){case _0x79f3('0x65'):if(_0x3c7562[_0x79f3('0x66')]==0x1){_0x469eef[_0x79f3('0x67')]('`'+_0x3c7562[_0x79f3('0x4c')]+_0x79f3('0x68'));}else{_0x469eef[_0x79f3('0x67')]('`'+_0x3c7562[_0x79f3('0x4c')]+_0x79f3('0x69'));}break;case _0x79f3('0x6a'):if(_0x3c7562['operator']==='$substring'){if(_0x3c7562[_0x79f3('0x66')]['split']('\x20')['length']>0x1){_0x2921f3[_0x409a95](_0x79f3('0x6b'),qs[_0x79f3('0x6c')](_0x3c7562[_0x79f3('0x66')]),null);}else{var _0x39023e='%'+_0x3c7562[_0x79f3('0x66')]+'%';_0x2921f3[_0x409a95](_0x79f3('0x6d'),_0x39023e,_0x39023e,_0x39023e);}}else{_0x471747=_[_0x79f3('0x6e')](_0x165eb6,[_0x79f3('0x2b'),'ContactId']);_0x3c7562[_0x79f3('0x4c')]=_0x79f3('0x6f');_0x5b7a2d=as[_0x79f3('0x70')](_0x46f84e,_0x471747['type'],_0x3c7562);_0x2921f3[_0x409a95](_0x5b7a2d[_0x79f3('0x71')],_0x5b7a2d[_0x79f3('0x66')][_0x79f3('0x72')],_0x5b7a2d[_0x79f3('0x66')][_0x79f3('0x73')]);}break;case _0x79f3('0x74'):var _0x259cb1=_0x3c7562[_0x79f3('0x66')][_0x79f3('0x75')](',')['map'](function(_0x4e369e){return Number(_0x4e369e);});_0x259cb1[_0x79f3('0x76')](function(_0x8f2625){_0x49697e['or'](_0x79f3('0x77'),'%,'+_0x8f2625+',%');});_0x19a198=_[_0x79f3('0x78')](_0x19a198,_0x259cb1);break;case'User':if(_0x3c7562[_0x79f3('0x79')]==='$substring'){_0x2921f3[_0x409a95](_0x79f3('0x7a'),'%'+_0x3c7562['value']+'%',null);}else{_0x471747=_['find'](_0x165eb6,[_0x79f3('0x2b'),_0x79f3('0x38')]);_0x3c7562[_0x79f3('0x4c')]=_0x79f3('0x38');_0x5b7a2d=as[_0x79f3('0x70')](_0x46f84e,_0x471747[_0x79f3('0x3e')],_0x3c7562);_0x2921f3[_0x409a95](_0x5b7a2d['text'],_0x5b7a2d[_0x79f3('0x66')][_0x79f3('0x72')],_0x5b7a2d[_0x79f3('0x66')][_0x79f3('0x73')]);}break;case _0x79f3('0x7b'):_0x5b7a2d=as[_0x79f3('0x70')]('me',null,_0x3c7562);_0x2921f3[_0x409a95](_0x5b7a2d[_0x79f3('0x71')],_0x5b7a2d[_0x79f3('0x66')]['start'],_0x5b7a2d['value'][_0x79f3('0x73')]);break;}}else{var _0x5b7a2d=as['buildExpression'](_0x46f84e,_0x471747['type'],_0x3c7562);_0x2921f3[_0x409a95](_0x5b7a2d[_0x79f3('0x71')],_0x5b7a2d[_0x79f3('0x66')]['start'],_0x5b7a2d[_0x79f3('0x66')]['end']);}}}else{var _0x3e3754=_(_0x57f0ba[_0x79f3('0x3f')])['keys']()[_0x79f3('0x2e')](function(_0x357b8b){return _[_0x79f3('0x7c')](_0x165eb6,[_0x79f3('0x2b'),_0x357b8b])?_0x357b8b:undefined;})[_0x79f3('0x7d')]()[_0x79f3('0x66')]();if(!_[_0x79f3('0x7e')](_0x3e3754)){_0x3e3754[_0x79f3('0x76')](function(_0x1b97d9){if(_0x1b97d9===_0x79f3('0x7f')){_0x469eef[_0x79f3('0x80')](_0x79f3('0x81'),[][_0x79f3('0x82')](_0x57f0ba[_0x79f3('0x3f')][_0x1b97d9]));}else if(_0x1b97d9===_0x79f3('0x83')){var _0x268442=JSON[_0x79f3('0x84')](_0x57f0ba['query'][_0x1b97d9])['$gte'];var _0x51ebd0=JSON[_0x79f3('0x84')](_0x57f0ba['query'][_0x1b97d9])[_0x79f3('0x85')];_0x469eef[_0x79f3('0x80')](_0x79f3('0x86'),_0x268442,_0x51ebd0);}else{if(_0x57f0ba[_0x79f3('0x3f')][_0x1b97d9]==='null'){_0x469eef['where']('i.'+_0x1b97d9+_0x79f3('0x87'));}else{_0x469eef[_0x79f3('0x80')]('i.'+_0x1b97d9+_0x79f3('0x88'),_0x57f0ba[_0x79f3('0x3f')][_0x1b97d9]);}}});}if(_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x89')]){if(_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x89')]==0x1){_0x469eef[_0x79f3('0x67')](_0x79f3('0x8a'));}else{_0x469eef[_0x79f3('0x67')](_0x79f3('0x8b'));}}if(_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x8c')]){_0x19a198=_[_0x79f3('0x8d')](_0x57f0ba['query'][_0x79f3('0x8c')])?_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x8c')]:new Array(_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x8c')]);_0x19a198[_0x79f3('0x76')](function(_0x3824d6){_0x49697e['or'](_0x79f3('0x77'),'%,'+_0x3824d6+',%');});}if(_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x8e')]){var _0x5155d2=_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x8e')][_0x79f3('0x8f')]('\x5c','\x5c\x5c')[_0x79f3('0x8f')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5155d2)){_0x2921f3['or'](_0x79f3('0x90'),_0x5155d2+'%')['or'](_0x79f3('0x91'),_0x5155d2+'%');}else{_0x2921f3['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x79f3('0x6c')](_0x5155d2))['or'](_0x79f3('0x92'),_0x5155d2+'%');}}}_0x469eef['where'](_0x2921f3);_0x469eef[_0x79f3('0x93')](_0x79f3('0x94'));var _0x51097a={'type':db['Sequelize'][_0x79f3('0x95')][_0x79f3('0x96')],'raw':!![]};var _0x22be37=_0x469eef[_0x79f3('0x97')]();_0x22be37[_0x79f3('0x4c')]('i.id');_0x22be37[_0x79f3('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x79f3('0x65'));if(_0x3f3583[_0x79f3('0x49')]){_0x3f3583['order'][_0x79f3('0x76')](function(_0x2cad2f){var _0x5e3d8b=_0x2cad2f[0x0]===_0x79f3('0x98')?_0x2cad2f[0x0]:'i.'+_0x2cad2f[0x0];_0x469eef[_0x79f3('0x49')](_0x5e3d8b,_0x2cad2f[0x1]==='DESC'?![]:!![]);});}if(!_[_0x79f3('0x7e')](_0x19a198)){_0x469eef[_0x79f3('0x67')](_0x49697e);_0x22be37['where'](_0x79f3('0x99'),_0x19a198);}BPromise[_0x79f3('0x9a')]()[_0x79f3('0x29')](function(){if(!_0x4792bd){if(_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x7f')])return;_0x22be37[_0x79f3('0x80')](_0x79f3('0x9b'));_0x469eef['where'](_0x79f3('0x9b'));return;}if(_0x57f0ba['user']['role']!==_0x79f3('0x9c'))return;return _0x57f0ba[_0x79f3('0x9d')][_0x79f3('0x9e')]({'attributes':['id'],'raw':!![]})[_0x79f3('0x29')](function(_0x4e0ec5){if(_['isEmpty'](_0x4e0ec5)){_0x22be37[_0x79f3('0x80')](_0x79f3('0x9f'));_0x469eef[_0x79f3('0x80')](_0x79f3('0x9f'));}else{_0x22be37['where'](_0x79f3('0x81'),_[_0x79f3('0x2e')](_0x4e0ec5,'id'));_0x469eef[_0x79f3('0x80')](_0x79f3('0x81'),_[_0x79f3('0x2e')](_0x4e0ec5,'id'));}});})[_0x79f3('0x29')](function(){if(_0x57f0ba[_0x79f3('0x9d')][_0x79f3('0xa0')]===_0x79f3('0x9c')&&!_0x4792bd&&!_0x57f0ba[_0x79f3('0x3f')][_0x79f3('0x7f')])return[];return db[_0x79f3('0xa1')]['query'](_0x22be37[_0x79f3('0xa2')](),_0x51097a);})[_0x79f3('0x29')](function(_0x283c1e){_0x316554['count']=_0x283c1e[_0x79f3('0x46')];if(_0x316554[_0x79f3('0x21')]===0x0)return[];return db['sequelize']['query'](_0x1a75f9['toString'](),_0x51097a)[_0x79f3('0x29')](function(_0x1bacb2){_0x148ed0=_[_0x79f3('0xa3')](_0x1bacb2,'id');_0x51097a=_['merge'](_0x51097a,{'model':db[_0x79f3('0xa4')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57f0ba['query']['fields']){_0x3f3583[_0x79f3('0x44')][_0x79f3('0x76')](function(_0x5eedb3){_0x469eef['field']('i.'+_0x5eedb3);});}else{_0x469eef[_0x79f3('0x4c')](_0x79f3('0xa5'),_0x79f3('0x65'));_0x469eef[_0x79f3('0x4c')](_0x79f3('0xa6'),_0x79f3('0xa7'));_0x469eef[_0x79f3('0x4c')](_0x79f3('0xa8'),_0x79f3('0xa9'));_0x469eef[_0x79f3('0x4c')](_0x79f3('0xaa'),'contactName');_0x469eef[_0x79f3('0x4c')](_0x79f3('0xab'));_0x469eef[_0x79f3('0x4c')]('c.firstName',_0x79f3('0xac'));_0x469eef['field']('c.lastName','Contact.lastName');_0x469eef['field'](_0x79f3('0xad'),_0x79f3('0xae'));_0x469eef[_0x79f3('0x4c')]('c.phone',_0x79f3('0xaf'));_0x469eef['field']('c.mobile',_0x79f3('0xb0'));_0x469eef[_0x79f3('0x4c')](_0x79f3('0xb1'),_0x79f3('0xb2'));_0x469eef['field'](_0x79f3('0xb3'),_0x79f3('0xb4'));_0x469eef[_0x79f3('0x4c')](_0x79f3('0xb5'),_0x79f3('0xb6'));_0x469eef[_0x79f3('0x4c')](_0x79f3('0xb7'),_0x79f3('0x30'));}if(_0x3f3583['limit'])_0x469eef[_0x79f3('0x20')](_0x3f3583[_0x79f3('0x20')]);if(_0x3f3583[_0x79f3('0x1e')])_0x469eef[_0x79f3('0x1e')](_0x3f3583[_0x79f3('0x1e')]);return db[_0x79f3('0xa1')]['query'](_0x469eef[_0x79f3('0xa2')](),_0x51097a);})['then'](function(_0xcc7d68){if(_0xcc7d68[_0x79f3('0x46')]>0x0)_0x417e3a[_0x79f3('0x80')](_0x79f3('0xb8'),_[_0x79f3('0x2e')](_0xcc7d68,'id'));return db['sequelize'][_0x79f3('0x3f')](_0x417e3a['toString'](),_0x51097a)[_0x79f3('0x29')](function(_0xf76ea8){var _0x4cf6b3=_['groupBy'](_0xf76ea8,_0x79f3('0xb9'));var _0x199f7b=[];_0xcc7d68[_0x79f3('0x76')](function(_0x53202e){_0x199f7b['push'](updateWhatsappInteraction(_0x53202e,_0x148ed0,_0x4cf6b3));});return BPromise[_0x79f3('0xba')](_0x199f7b);});});})['then'](function(_0x3f38a1){_0x316554['rows']=_0x3f38a1;return _0x316554;})['then'](respondWithFilteredResult(_0x447cfb,_0x3f3583))[_0x79f3('0x33')](handleError(_0x447cfb,null));};exports[_0x79f3('0xbb')]=function(_0x489fce,_0x4d4298){var _0x3799e6={'raw':![],'where':{'id':_0x489fce[_0x79f3('0xbc')]['id']}},_0x4530e9={};_0x4530e9['model']=_[_0x79f3('0x40')](db[_0x79f3('0xa4')][_0x79f3('0x3c')]);_0x4530e9[_0x79f3('0x3f')]=_[_0x79f3('0x40')](_0x489fce[_0x79f3('0x3f')]);_0x4530e9['filters']=_[_0x79f3('0x42')](_0x4530e9[_0x79f3('0x43')],_0x4530e9[_0x79f3('0x3f')]);_0x3799e6[_0x79f3('0x44')]=_['intersection'](_0x4530e9[_0x79f3('0x43')],qs['fields'](_0x489fce[_0x79f3('0x3f')][_0x79f3('0x45')]));_0x3799e6[_0x79f3('0x44')]=_0x3799e6['attributes'][_0x79f3('0x46')]?_0x3799e6[_0x79f3('0x44')]:_0x4530e9[_0x79f3('0x43')];if(_0x489fce[_0x79f3('0x3f')]['includeAll']){_0x3799e6[_0x79f3('0xbd')]=[{'all':!![]}];}_0x3799e6=_[_0x79f3('0xbe')]({},_0x3799e6,_0x489fce[_0x79f3('0xbf')]);return db['WhatsappInteraction'][_0x79f3('0x6e')](_0x3799e6)[_0x79f3('0x29')](handleEntityNotFound(_0x4d4298,null))[_0x79f3('0x29')](respondWithResult(_0x4d4298,null))['catch'](handleError(_0x4d4298,null));};exports[_0x79f3('0xc0')]=function(_0x45c3b2,_0x1e5bab){return db[_0x79f3('0xa4')][_0x79f3('0xc0')](_0x45c3b2[_0x79f3('0x7b')],{})['then'](respondWithResult(_0x1e5bab,0xc9))[_0x79f3('0x33')](handleError(_0x1e5bab,null));};exports['update']=function(_0x335a18,_0x47e6b8){if(_0x335a18[_0x79f3('0x7b')]['id']){delete _0x335a18[_0x79f3('0x7b')]['id'];}return db[_0x79f3('0xa4')][_0x79f3('0x6e')]({'where':{'id':_0x335a18[_0x79f3('0xbc')]['id']}})[_0x79f3('0x29')](handleEntityNotFound(_0x47e6b8,null))[_0x79f3('0x29')](saveUpdates(_0x335a18[_0x79f3('0x7b')],null))[_0x79f3('0x29')](respondWithResult(_0x47e6b8,null))['catch'](handleError(_0x47e6b8,null));};exports[_0x79f3('0x28')]=function(_0x3137e2,_0x4b09e9){return db[_0x79f3('0xa4')][_0x79f3('0x6e')]({'where':{'id':_0x3137e2[_0x79f3('0xbc')]['id']}})[_0x79f3('0x29')](handleEntityNotFound(_0x4b09e9,null))[_0x79f3('0x29')](removeEntity(_0x4b09e9,null))[_0x79f3('0x33')](handleError(_0x4b09e9,null));};exports['describe']=function(_0x5394ff,_0x503765){return db[_0x79f3('0xa4')][_0x79f3('0xc1')]()[_0x79f3('0x29')](respondWithResult(_0x503765,null))[_0x79f3('0x33')](handleError(_0x503765,null));};exports[_0x79f3('0xc2')]=function(_0x599b72,_0x21cb69,_0x5d9586){return db[_0x79f3('0xc3')][_0x79f3('0x6e')]({'where':{'id':_0x599b72['params']['id']}})[_0x79f3('0x29')](handleEntityNotFound(_0x21cb69,null))[_0x79f3('0x29')](function(_0x33d06a){if(_0x33d06a){return _0x33d06a['addMessage'](_0x599b72[_0x79f3('0x7b')][_0x79f3('0xc4')],_[_0x79f3('0xc5')](_0x599b72[_0x79f3('0x7b')],['ids','id'])||{});}})[_0x79f3('0x29')](respondWithResult(_0x21cb69,null))[_0x79f3('0x33')](handleError(_0x21cb69,null));};exports[_0x79f3('0xc6')]=function(_0x48c493,_0x5b0ced,_0xe775d7){var _0x4df299={'raw':![],'where':{}};var _0x4139f8={};var _0x39b35f={'count':0x0,'rows':[]};return db[_0x79f3('0xa4')][_0x79f3('0xc7')]({'where':{'id':_0x48c493['params']['id']}})[_0x79f3('0x29')](handleEntityNotFound(_0x5b0ced,null))[_0x79f3('0x29')](function(_0x148e27){if(_0x148e27){_0x4139f8[_0x79f3('0x43')]=_[_0x79f3('0x40')](db[_0x79f3('0xc3')]['rawAttributes']);_0x4139f8[_0x79f3('0x3f')]=_[_0x79f3('0x40')](_0x48c493[_0x79f3('0x3f')]);_0x4139f8[_0x79f3('0x41')]=_[_0x79f3('0x42')](_0x4139f8[_0x79f3('0x43')],_0x4139f8['query']);_0x4df299[_0x79f3('0x44')]=_['intersection'](_0x4139f8[_0x79f3('0x43')],qs[_0x79f3('0x45')](_0x48c493[_0x79f3('0x3f')][_0x79f3('0x45')]));_0x4df299[_0x79f3('0x44')]=_0x4df299[_0x79f3('0x44')][_0x79f3('0x46')]?_0x4df299['attributes']:_0x4139f8[_0x79f3('0x43')];if(!_0x48c493[_0x79f3('0x3f')][_0x79f3('0x47')](_0x79f3('0x48'))){_0x4df299['limit']=qs[_0x79f3('0x20')](_0x48c493[_0x79f3('0x3f')][_0x79f3('0x20')]);_0x4df299[_0x79f3('0x1e')]=qs[_0x79f3('0x1e')](_0x48c493['query'][_0x79f3('0x1e')]);}_0x4df299['order']=qs[_0x79f3('0x4a')](_0x48c493['query']['sort']);_0x4df299['where']=qs[_0x79f3('0x41')](_[_0x79f3('0xc8')](_0x48c493[_0x79f3('0x3f')],_0x4139f8[_0x79f3('0x41')]));_0x4df299['where']['WhatsappInteractionId']=_0x148e27['id'];if(_0x48c493['query'][_0x79f3('0x8e')]){_0x4df299['where']=_[_0x79f3('0xbe')](_0x4df299[_0x79f3('0x80')],{'$or':_['map'](_0x4df299[_0x79f3('0x44')],function(_0x18bc14){var _0x209cd7={};_0x209cd7[_0x18bc14]={'$like':'%'+_0x48c493['query'][_0x79f3('0x8e')]+'%'};return _0x209cd7;})});}if(_0x48c493[_0x79f3('0x3f')][_0x79f3('0xc9')]){var _0x36f14d=_0x48c493[_0x79f3('0x3f')][_0x79f3('0xc9')][_0x79f3('0x75')](',');var _0x161942={};_0x161942[_0x36f14d[0x0]]={'$gte':moment(_0x36f14d[0x1])[_0x79f3('0xca')](_0x79f3('0xcb'))};_0x4df299[_0x79f3('0x80')]=_[_0x79f3('0xbe')](_0x4df299[_0x79f3('0x80')],_0x161942);}_0x4df299=_[_0x79f3('0xbe')]({},_0x4df299,_0x48c493[_0x79f3('0xbf')]);return db['WhatsappMessage']['count']({'where':_0x4df299[_0x79f3('0x80')]})[_0x79f3('0x29')](function(_0x45e82d){_0x39b35f['count']=_0x45e82d;if(_0x48c493[_0x79f3('0x3f')][_0x79f3('0xcc')]){_0x4df299[_0x79f3('0xbd')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x79f3('0xcd')](_0x4df299);})['then'](function(_0x1dd331){_0x39b35f[_0x79f3('0xce')]=_0x1dd331;return _0x39b35f;});}})[_0x79f3('0x29')](respondWithFilteredResult(_0x5b0ced,_0x4df299))[_0x79f3('0x33')](handleError(_0x5b0ced,null));};exports[_0x79f3('0xcf')]=function(_0x24a9c5,_0x6f3f6e,_0x55eba3){return db[_0x79f3('0xa4')][_0x79f3('0x6e')]({'where':{'id':_0x24a9c5[_0x79f3('0xbc')]['id']}})['then'](handleEntityNotFound(_0x6f3f6e,null))[_0x79f3('0x29')](function(_0x5e91ca){if(_0x5e91ca){return _0x5e91ca[_0x79f3('0xd0')](_0x24a9c5[_0x79f3('0x7b')][_0x79f3('0xc4')],_[_0x79f3('0xc5')](_0x24a9c5[_0x79f3('0x7b')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x79f3('0xcd')]({'attributes':['id',_0x79f3('0x2b'),_0x79f3('0x4d')],'where':{'id':_0x24a9c5[_0x79f3('0x7b')][_0x79f3('0xc4')]}});})[_0x79f3('0x29')](function(_0x14f227){socket[_0x79f3('0xd1')](_0x79f3('0xd2'),{'id':Number(_0x24a9c5[_0x79f3('0xbc')]['id']),'tags':_0x14f227||[]});return{'id':Number(_0x24a9c5['params']['id']),'tags':_0x14f227||[]};});}})['then'](respondWithResult(_0x6f3f6e,null))[_0x79f3('0x33')](handleError(_0x6f3f6e,null));};exports['removeTags']=function(_0x39b954,_0x74171c,_0x820990){return db[_0x79f3('0xa4')][_0x79f3('0x6e')]({'where':{'id':_0x39b954['params']['id']}})[_0x79f3('0x29')](handleEntityNotFound(_0x74171c,null))['then'](function(_0x552fae){if(_0x552fae){return _0x552fae['removeTags'](_0x39b954[_0x79f3('0x3f')][_0x79f3('0xc4')]);}})[_0x79f3('0x29')](respondWithStatusCode(_0x74171c,null))['catch'](handleError(_0x74171c,null));};exports[_0x79f3('0xd3')]=function(_0xfa3014,_0x4416d9){var _0x2f9db0=moment()['unix']()[_0x79f3('0xa2')]();var _0x91d36e=path[_0x79f3('0xd4')](config['root'],_0x79f3('0xd5'),_0x79f3('0xd6'),_0x79f3('0xd7'));var _0x46a306=path[_0x79f3('0xd4')](config[_0x79f3('0xd8')],'server',_0x79f3('0xd6'),'attachments');var _0x16425d=path[_0x79f3('0xd4')](_0x91d36e,_0x2f9db0);var _0x55df1b=util[_0x79f3('0xca')](_0x79f3('0xd9'),_0xfa3014['params']['id'],_0x2f9db0);var _0x19e8fd=path[_0x79f3('0xd4')](_0x91d36e,_0x55df1b);var _0x1c9421=[];_0x1c9421[_0x79f3('0x32')]({'model':db[_0x79f3('0xda')],'as':'User','attributes':['id',_0x79f3('0x2f')],'raw':!![]});_0x1c9421[_0x79f3('0x32')]({'model':db['CmContact'],'as':_0x79f3('0x6a'),'attributes':['id',_0x79f3('0xdb'),_0x79f3('0xdc')],'raw':!![]});if(_0xfa3014[_0x79f3('0x3f')][_0x79f3('0xdd')]){_0x1c9421[_0x79f3('0x32')]({'model':db[_0x79f3('0xde')],'as':_0x79f3('0xde'),'raw':!![]});}var _0x2e969c=[{'model':db[_0x79f3('0xc3')],'as':_0x79f3('0xdf'),'attributes':['id','body',_0x79f3('0x83'),_0x79f3('0xe0'),'secret',_0x79f3('0x89')],'include':_0x1c9421}];_0x2e969c[_0x79f3('0x32')]({'model':db[_0x79f3('0xe1')],'as':'Account','attributes':['id',_0x79f3('0x2b')]});_0x2e969c[_0x79f3('0x32')]({'model':db[_0x79f3('0xda')],'as':_0x79f3('0xe2'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x79f3('0x6e')]({'where':{'id':_0xfa3014['params']['id']},'include':_0x2e969c})[_0x79f3('0x29')](handleEntityNotFound(_0x4416d9,null))[_0x79f3('0x29')](function(_0x3979cc){if(_0x3979cc){var _0x15ab9e=_0x3979cc['get']({'plain':!![]});fs[_0x79f3('0xe3')](_0x16425d);var _0x42509d={'channel':_0x79f3('0xe4'),'account':_0x15ab9e[_0x79f3('0xe5')]['name'],'agent':_0x15ab9e['Owner']?_0x15ab9e[_0x79f3('0xe2')]['fullname']:_0x79f3('0xe6'),'createdAt':moment(_0x15ab9e[_0x79f3('0x83')])[_0x79f3('0xca')]('YYYY-MM-DD\x20HH:mm:ss')[_0x79f3('0xa2')](),'closedAt':_0x15ab9e[_0x79f3('0x37')]?moment(_0x15ab9e[_0x79f3('0xe7')])['format'](_0x79f3('0xcb'))['toString']():'','disposition':_0x15ab9e['disposition'],'messages':_(_0x15ab9e[_0x79f3('0xdf')])[_0x79f3('0x8e')]({'secret':![]})[_0x79f3('0x2e')](function(_0x5d1c7e){if(_0x5d1c7e['Attachment']){var _0x17d93e=path[_0x79f3('0xd4')](_0x46a306,_0x5d1c7e['Attachment'][_0x79f3('0xe8')]);if(fs[_0x79f3('0xe9')](_0x17d93e)){fs[_0x79f3('0xea')](_0x17d93e)[_0x79f3('0xeb')](fs[_0x79f3('0xec')](path[_0x79f3('0xd4')](_0x16425d,_0x5d1c7e[_0x79f3('0xde')][_0x79f3('0xe8')])));}}return{'date':moment(_0x5d1c7e[_0x79f3('0x83')])['format'](_0x79f3('0xcb'))['toString'](),'sender':_0x5d1c7e[_0x79f3('0xe0')]===_0x79f3('0xed')?_0x5d1c7e[_0x79f3('0xda')]?_0x5d1c7e[_0x79f3('0xda')][_0x79f3('0x2f')]:_0x79f3('0xee'):_0x5d1c7e[_0x79f3('0x6a')][_0x79f3('0xdb')]+(_0x5d1c7e['Contact'][_0x79f3('0xdc')]?'\x20'+_0x5d1c7e[_0x79f3('0x6a')][_0x79f3('0xdc')]:''),'body':_0x5d1c7e[_0x79f3('0xde')]?_0x5d1c7e[_0x79f3('0xde')]['basename']:_0x5d1c7e[_0x79f3('0x7b')],'direction':_0x5d1c7e['direction']===_0x79f3('0xed')?'A':'C','secret':_0x5d1c7e[_0x79f3('0xef')],'read':_0x5d1c7e['read'],'attachment':_0x5d1c7e[_0x79f3('0xde')]};})[_0x79f3('0x66')]()};return ejs[_0x79f3('0xf0')](path['join'](config[_0x79f3('0xd8')],_0x79f3('0xd5'),'views',_0x79f3('0xf1')),{'interaction':_0x42509d})[_0x79f3('0x29')](function(_0x20d006){var _0x3fa466=path[_0x79f3('0xd4')](_0x16425d,_0x79f3('0xf2')+_0x15ab9e['id']+'-'+_0x2f9db0+'.pdf');var _0x3b9533={'path':_0x3fa466,'channel':_0x79f3('0xe4'),'interactionId':_0x15ab9e['id']};return pdf['createPdfFromHTML'](_0x20d006,_0x3b9533);})[_0x79f3('0x29')](function(){return new BPromise(function(_0x4867a6,_0x23337f){zipdir(_0x16425d,{'saveTo':_0x19e8fd},function(_0x5bcb77,_0xc1e08a){if(_0x5bcb77)return _0x23337f(_0x5bcb77);return _0x4867a6(_0xc1e08a);});})[_0x79f3('0x29')](function(){return new BPromise(function(_0x11489b,_0x1ca927){rimraf(_0x16425d,function(_0x19bb53){if(_0x19bb53)_0x1ca927(_0x19bb53);return _0x11489b();});});})[_0x79f3('0x29')](function(){return _0x4416d9[_0x79f3('0xd3')](_0x19e8fd,_0x55df1b,function(_0x577933){if(_0x577933){console[_0x79f3('0xf3')]('err',_0x577933);}else{fs['unlinkSync'](_0x19e8fd);}});});});}else{return _0x4416d9[_0x79f3('0x1c')](0xc8);}})[_0x79f3('0x33')](handleError(_0x4416d9,null));};
\ No newline at end of file
+var _0xd663=['log','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','waiting','answered','unmanaged','closed','UserId','talking','total','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','merge','options','create','update','describe','addMessage','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','WhatsappMessage','findAll','addTags','setTags','ids','emit','whatsappInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','CmContact','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','out','firstName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download'];(function(_0xe3f08c,_0x48a9bc){var _0x45441d=function(_0x101d48){while(--_0x101d48){_0xe3f08c['push'](_0xe3f08c['shift']());}};_0x45441d(++_0x48a9bc);}(_0xd663,0x1ed));var _0x3d66=function(_0x5c3e6d,_0x4735ec){_0x5c3e6d=_0x5c3e6d-0x0;var _0x3c5fc4=_0xd663[_0x5c3e6d];return _0x3c5fc4;};'use strict';var emlformat=require(_0x3d66('0x0'));var rimraf=require(_0x3d66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d66('0x2'));var rp=require(_0x3d66('0x3'));var moment=require(_0x3d66('0x4'));var BPromise=require(_0x3d66('0x5'));var Mustache=require(_0x3d66('0x6'));var util=require('util');var path=require(_0x3d66('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d66('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3d66('0x9'));var deskjs=require(_0x3d66('0xa'));var toCsv=require(_0x3d66('0xb'));var querystring=require(_0x3d66('0xc'));var Papa=require(_0x3d66('0xd'));var Redis=require(_0x3d66('0xe'));var authService=require(_0x3d66('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3d66('0x10'));var pdf=require(_0x3d66('0x11'));var hardwareService=require(_0x3d66('0x12'));var logger=require('../../config/logger')(_0x3d66('0x13'));var utils=require(_0x3d66('0x14'));var config=require(_0x3d66('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d66('0x16'))['db'];config[_0x3d66('0x17')]=_[_0x3d66('0x18')](config[_0x3d66('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d66('0x19'))(new Redis(config['redis']));require(_0x3d66('0x1a'))[_0x3d66('0x1b')](socket);function respondWithStatusCode(_0x271dd0,_0x3075e2){_0x3075e2=_0x3075e2||0xcc;return function(_0x30260d){if(_0x30260d){return _0x271dd0[_0x3d66('0x1c')](_0x3075e2);}return _0x271dd0['status'](_0x3075e2)['end']();};}function respondWithResult(_0xe5bf8f,_0x4651b8){_0x4651b8=_0x4651b8||0xc8;return function(_0x4bd10f){if(_0x4bd10f){return _0xe5bf8f[_0x3d66('0x1d')](_0x4651b8)[_0x3d66('0x1e')](_0x4bd10f);}};}function respondWithFilteredResult(_0x42cd68,_0x1dfd81){return function(_0xe13f0f){if(_0xe13f0f){var _0x239ffb=typeof _0x1dfd81[_0x3d66('0x1f')]===_0x3d66('0x20')&&typeof _0x1dfd81[_0x3d66('0x21')]===_0x3d66('0x20');var _0x3bf534=_0xe13f0f[_0x3d66('0x22')];var _0x46e35c=_0x239ffb?0x0:_0x1dfd81[_0x3d66('0x1f')];var _0x21cfd7=_0x239ffb?_0xe13f0f['count']:_0x1dfd81[_0x3d66('0x1f')]+_0x1dfd81['limit'];var _0x118bba;if(_0x21cfd7>=_0x3bf534){_0x21cfd7=_0x3bf534;_0x118bba=0xc8;}else{_0x118bba=0xce;}_0x42cd68[_0x3d66('0x1d')](_0x118bba);return _0x42cd68[_0x3d66('0x23')](_0x3d66('0x24'),_0x46e35c+'-'+_0x21cfd7+'/'+_0x3bf534)[_0x3d66('0x1e')](_0xe13f0f);}return null;};}function patchUpdates(_0x139cb5){return function(_0x1c851f){try{jsonpatch[_0x3d66('0x25')](_0x1c851f,_0x139cb5,!![]);}catch(_0x1eb922){return BPromise['reject'](_0x1eb922);}return _0x1c851f[_0x3d66('0x26')]();};}function saveUpdates(_0x1a970c,_0x2c1779){return function(_0x1cbf89){if(_0x1cbf89){return _0x1cbf89['update'](_0x1a970c)[_0x3d66('0x27')](function(_0x45628b){return _0x45628b;});}return null;};}function removeEntity(_0x4302ad,_0x29819d){return function(_0x4f0d9e){if(_0x4f0d9e){return _0x4f0d9e[_0x3d66('0x28')]()[_0x3d66('0x27')](function(){_0x4302ad[_0x3d66('0x1d')](0xcc)[_0x3d66('0x29')]();});}};}function handleEntityNotFound(_0x3ff9c5,_0x77dc85){return function(_0x45ee47){if(!_0x45ee47){_0x3ff9c5[_0x3d66('0x1c')](0x194);}return _0x45ee47;};}function handleError(_0x325de1,_0x1271bf){_0x1271bf=_0x1271bf||0x1f4;return function(_0x54ba13){logger[_0x3d66('0x2a')](_0x54ba13[_0x3d66('0x2b')]);if(_0x54ba13[_0x3d66('0x2c')]){delete _0x54ba13[_0x3d66('0x2c')];}_0x325de1[_0x3d66('0x1d')](_0x1271bf)[_0x3d66('0x2d')](_0x54ba13);};}function getInteractionUsers(_0x1223c8,_0xabe382){return new BPromise(function(_0x3044f2,_0xab45d5){try{if(_0xabe382[_0x1223c8['id']]){_0x1223c8[_0x3d66('0x2e')]=_['map'](_0xabe382[_0x1223c8['id']],function(_0x563dca){return{'id':_0x563dca['id'],'fullname':_0x563dca[_0x3d66('0x2f')]};});}}catch(_0x19cfb1){_0xab45d5(_0x19cfb1);}_0x3044f2(_0x1223c8);});}function getInteractionTags(_0x279101,_0x26f667){return new BPromise(function(_0x16ec87,_0x32081c){try{if(_0x279101[_0x3d66('0x30')]){_0x279101[_0x3d66('0x31')]=[];_0x279101[_0x3d66('0x30')][_0x3d66('0x32')](',')[_0x3d66('0x33')](function(_0x9424b5){_0x279101[_0x3d66('0x31')][_0x3d66('0x34')](_0x26f667[_0x9424b5]);});}delete _0x279101[_0x3d66('0x30')];}catch(_0x30247c){_0x32081c(_0x30247c);}_0x16ec87(_0x279101);});}function updateWhatsappInteraction(_0x119d26,_0x2e7263,_0x21692b){return new BPromise(function(_0x1b679f,_0x44874c){return getInteractionUsers(_0x119d26,_0x21692b)[_0x3d66('0x27')](function(_0x443d0c){return getInteractionTags(_0x443d0c,_0x2e7263);})['then'](function(_0x32ced6){return getStateInteraction(_0x32ced6);})[_0x3d66('0x27')](function(_0xf1bcb4){_0x1b679f(_0xf1bcb4);})['catch'](function(_0x2f0add){_0x44874c(_0x2f0add);});});}function getStateInteraction(_0x596f26){return new BPromise(function(_0x2ac6ce){_0x596f26[_0x3d66('0x35')]=0x0;_0x596f26['talking']=0x0;_0x596f26[_0x3d66('0x36')]=0x0;_0x596f26[_0x3d66('0x37')]=0x0;_0x596f26['total']=0x0;if(!_0x596f26[_0x3d66('0x38')]&&!_0x596f26[_0x3d66('0x39')]){_0x596f26['waiting']+=0x1;}if(!_0x596f26[_0x3d66('0x38')]&&_0x596f26[_0x3d66('0x39')]){_0x596f26[_0x3d66('0x3a')]+=0x1;if(_0x596f26[_0x3d66('0x35')]){_0x596f26['waiting']-=0x1;}}if(_0x596f26[_0x3d66('0x38')]&&_0x596f26['UserId']){_0x596f26[_0x3d66('0x36')]+=0x1;if(_0x596f26['talking']){_0x596f26[_0x3d66('0x3a')]-=0x1;}}if(_0x596f26[_0x3d66('0x38')]&&!_0x596f26[_0x3d66('0x39')]){_0x596f26['unmanaged']+=0x1;if(_0x596f26[_0x3d66('0x35')]){_0x596f26[_0x3d66('0x35')]-=0x1;}}_0x596f26[_0x3d66('0x3b')]+=0x1;_0x2ac6ce(_0x596f26);});}exports[_0x3d66('0x3c')]=function(_0x122cd4,_0x1bfedc){var _0x2306af={},_0x38633f={},_0x3d6cfa={'count':0x0,'rows':[]};var _0xa1a5f2=_[_0x3d66('0x3d')](db[_0x3d66('0x3e')][_0x3d66('0x3f')],function(_0x4b4337){return{'name':_0x4b4337[_0x3d66('0x40')],'type':_0x4b4337[_0x3d66('0x41')][_0x3d66('0x42')]};});_0x38633f['model']=_['map'](_0xa1a5f2,_0x3d66('0x2c'));_0x38633f[_0x3d66('0x43')]=_[_0x3d66('0x44')](_0x122cd4[_0x3d66('0x43')]);_0x38633f[_0x3d66('0x45')]=_[_0x3d66('0x46')](_0x38633f[_0x3d66('0x47')],_0x38633f[_0x3d66('0x43')]);_0x2306af['attributes']=_[_0x3d66('0x46')](_0x38633f[_0x3d66('0x47')],qs[_0x3d66('0x48')](_0x122cd4['query']['fields']));_0x2306af[_0x3d66('0x49')]=_0x2306af[_0x3d66('0x49')][_0x3d66('0x4a')]?_0x2306af[_0x3d66('0x49')]:_0x38633f[_0x3d66('0x47')];if(!_0x122cd4[_0x3d66('0x43')][_0x3d66('0x4b')](_0x3d66('0x4c'))){_0x2306af['limit']=qs[_0x3d66('0x21')](_0x122cd4['query'][_0x3d66('0x21')]);_0x2306af[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x122cd4['query'][_0x3d66('0x1f')]);}_0x2306af[_0x3d66('0x4d')]=qs[_0x3d66('0x4e')](_0x122cd4[_0x3d66('0x43')]['sort']);_0x2306af['where']=qs[_0x3d66('0x45')](_['pick'](_0x122cd4['query'],_0x38633f[_0x3d66('0x45')]),_0xa1a5f2);var _0x3c5b6d=[];var _0x32edc2=squel[_0x3d66('0x4f')]()[_0x3d66('0x50')]('id')[_0x3d66('0x50')](_0x3d66('0x2c'))['field'](_0x3d66('0x51'))[_0x3d66('0x52')](_0x3d66('0x53'));var _0x18a603=squel[_0x3d66('0x4f')]()['field'](_0x3d66('0x54'))[_0x3d66('0x50')](_0x3d66('0x55'))[_0x3d66('0x50')](_0x3d66('0x56'))[_0x3d66('0x52')](_0x3d66('0x57'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x3d2fed=squel[_0x3d66('0x4f')]()['from'](_0x3d66('0x58'),'i')[_0x3d66('0x59')](_0x3d66('0x5a'),'c',_0x3d66('0x5b'))[_0x3d66('0x59')](_0x3d66('0x5c'),'o',_0x3d66('0x5d'))[_0x3d66('0x59')](_0x3d66('0x5e'),'a','a.id\x20=\x20i.WhatsappAccountId')['left_join'](_0x3d66('0x5f'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x3d66('0x60'),'it',_0x3d66('0x61'))[_0x3d66('0x59')](_0x3d66('0x53'),'t',_0x3d66('0x62'));var _0x4863d5=squel[_0x3d66('0x63')]();var _0x33b4f1=[];var _0x19e5b5=squel[_0x3d66('0x63')]();var _0x5ac044;if(_0x122cd4[_0x3d66('0x43')][_0x3d66('0x64')]){_0x5ac044=as[_0x3d66('0x65')](_0x122cd4['query']['search']);var _0x4f6ffa=_0x5ac044[_0x3d66('0x66')];for(var _0x8b3860=0x0;_0x8b3860<_0x5ac044[_0x3d66('0x67')][_0x3d66('0x4a')];_0x8b3860++){var _0x4b451d=_0x5ac044[_0x3d66('0x67')][_0x8b3860];var _0x96edb2='i';var _0x49bd50=_[_0x3d66('0x68')](_0xa1a5f2,[_0x3d66('0x2c'),_0x4b451d[_0x3d66('0x50')]]);if(!_0x49bd50){switch(_0x4b451d[_0x3d66('0x50')]){case _0x3d66('0x69'):if(_0x4b451d[_0x3d66('0x6a')]==0x1){_0x3d2fed[_0x3d66('0x6b')]('`'+_0x4b451d['field']+'`\x20=\x200');}else{_0x3d2fed['having']('`'+_0x4b451d[_0x3d66('0x50')]+_0x3d66('0x6c'));}break;case _0x3d66('0x6d'):if(_0x4b451d[_0x3d66('0x6e')]==='$substring'){if(_0x4b451d[_0x3d66('0x6a')][_0x3d66('0x32')]('\x20')[_0x3d66('0x4a')]>0x1){_0x4863d5[_0x4f6ffa](_0x3d66('0x6f'),qs[_0x3d66('0x70')](_0x4b451d[_0x3d66('0x6a')]),null);}else{var _0x468007='%'+_0x4b451d[_0x3d66('0x6a')]+'%';_0x4863d5[_0x4f6ffa]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x468007,_0x468007,_0x468007);}}else{_0x49bd50=_[_0x3d66('0x68')](_0xa1a5f2,['name','ContactId']);_0x4b451d[_0x3d66('0x50')]=_0x3d66('0x71');_0x1a8077=as[_0x3d66('0x72')](_0x96edb2,_0x49bd50[_0x3d66('0x41')],_0x4b451d);_0x4863d5[_0x4f6ffa](_0x1a8077[_0x3d66('0x73')],_0x1a8077[_0x3d66('0x6a')][_0x3d66('0x74')],_0x1a8077[_0x3d66('0x6a')][_0x3d66('0x29')]);}break;case _0x3d66('0x75'):var _0x279b47=_0x4b451d[_0x3d66('0x6a')]['split'](',')[_0x3d66('0x3d')](function(_0x5ddf51){return Number(_0x5ddf51);});_0x279b47[_0x3d66('0x33')](function(_0x4870ae){_0x19e5b5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4870ae+',%');});_0x33b4f1=_[_0x3d66('0x76')](_0x33b4f1,_0x279b47);break;case _0x3d66('0x77'):if(_0x4b451d[_0x3d66('0x6e')]===_0x3d66('0x78')){_0x4863d5[_0x4f6ffa](_0x3d66('0x79'),'%'+_0x4b451d[_0x3d66('0x6a')]+'%',null);}else{_0x49bd50=_[_0x3d66('0x68')](_0xa1a5f2,[_0x3d66('0x2c'),'UserId']);_0x4b451d[_0x3d66('0x50')]=_0x3d66('0x39');_0x1a8077=as[_0x3d66('0x72')](_0x96edb2,_0x49bd50['type'],_0x4b451d);_0x4863d5[_0x4f6ffa](_0x1a8077[_0x3d66('0x73')],_0x1a8077[_0x3d66('0x6a')][_0x3d66('0x74')],_0x1a8077[_0x3d66('0x6a')][_0x3d66('0x29')]);}break;case _0x3d66('0x7a'):_0x1a8077=as[_0x3d66('0x72')]('me',null,_0x4b451d);_0x4863d5[_0x4f6ffa](_0x1a8077[_0x3d66('0x73')],_0x1a8077[_0x3d66('0x6a')][_0x3d66('0x74')],_0x1a8077['value']['end']);break;}}else{var _0x1a8077=as[_0x3d66('0x72')](_0x96edb2,_0x49bd50['type'],_0x4b451d);_0x4863d5[_0x4f6ffa](_0x1a8077[_0x3d66('0x73')],_0x1a8077[_0x3d66('0x6a')][_0x3d66('0x74')],_0x1a8077[_0x3d66('0x6a')][_0x3d66('0x29')]);}}}else{var _0x1aacc9=_(_0x122cd4[_0x3d66('0x43')])['keys']()[_0x3d66('0x3d')](function(_0x3bca16){return _['some'](_0xa1a5f2,[_0x3d66('0x2c'),_0x3bca16])?_0x3bca16:undefined;})[_0x3d66('0x7b')]()[_0x3d66('0x6a')]();if(!_['isEmpty'](_0x1aacc9)){_0x1aacc9[_0x3d66('0x33')](function(_0x592491){if(_0x592491===_0x3d66('0x7c')){_0x3d2fed[_0x3d66('0x7d')](_0x3d66('0x7e'),[][_0x3d66('0x7f')](_0x122cd4[_0x3d66('0x43')][_0x592491]));}else if(_0x592491===_0x3d66('0x80')){var _0x4e9f4d=JSON['parse'](_0x122cd4[_0x3d66('0x43')][_0x592491])['$gte'];var _0x92f5e9=JSON[_0x3d66('0x81')](_0x122cd4[_0x3d66('0x43')][_0x592491])['$lte'];_0x3d2fed[_0x3d66('0x7d')](_0x3d66('0x82'),_0x4e9f4d,_0x92f5e9);}else{if(_0x122cd4[_0x3d66('0x43')][_0x592491]==='null'){_0x3d2fed[_0x3d66('0x7d')]('i.'+_0x592491+_0x3d66('0x83'));}else{_0x3d2fed['where']('i.'+_0x592491+_0x3d66('0x84'),_0x122cd4[_0x3d66('0x43')][_0x592491]);}}});}if(_0x122cd4[_0x3d66('0x43')][_0x3d66('0x85')]){if(_0x122cd4[_0x3d66('0x43')]['read']==0x1){_0x3d2fed[_0x3d66('0x6b')](_0x3d66('0x86'));}else{_0x3d2fed[_0x3d66('0x6b')](_0x3d66('0x87'));}}if(_0x122cd4[_0x3d66('0x43')][_0x3d66('0x88')]){_0x33b4f1=_[_0x3d66('0x89')](_0x122cd4[_0x3d66('0x43')][_0x3d66('0x88')])?_0x122cd4[_0x3d66('0x43')][_0x3d66('0x88')]:new Array(_0x122cd4[_0x3d66('0x43')]['tag']);_0x33b4f1[_0x3d66('0x33')](function(_0x595512){_0x19e5b5['or'](_0x3d66('0x8a'),'%,'+_0x595512+',%');});}if(_0x122cd4[_0x3d66('0x43')][_0x3d66('0x8b')]){var _0x51b057=_0x122cd4[_0x3d66('0x43')]['filter'][_0x3d66('0x8c')]('\x5c','\x5c\x5c')[_0x3d66('0x8c')](/'/g,'\x27\x27');if(qs[_0x3d66('0x8d')](_0x51b057)){_0x4863d5['or'](_0x3d66('0x8e'),_0x51b057+'%')['or'](_0x3d66('0x8f'),_0x51b057+'%');}else{_0x4863d5['or'](_0x3d66('0x90'),qs[_0x3d66('0x70')](_0x51b057))['or'](_0x3d66('0x91'),_0x51b057+'%');}}}_0x3d2fed[_0x3d66('0x7d')](_0x4863d5);_0x3d2fed['group'](_0x3d66('0x92'));var _0x715567={'type':db[_0x3d66('0x93')][_0x3d66('0x94')][_0x3d66('0x95')],'raw':!![]};var _0x15e57c=_0x3d2fed[_0x3d66('0x96')]();_0x15e57c[_0x3d66('0x50')](_0x3d66('0x92'));_0x15e57c['field'](_0x3d66('0x97'),_0x3d66('0x69'));if(_0x2306af[_0x3d66('0x4d')]){_0x2306af[_0x3d66('0x4d')][_0x3d66('0x33')](function(_0x9f4000){var _0x1ab607=_0x9f4000[0x0]===_0x3d66('0x98')?_0x9f4000[0x0]:'i.'+_0x9f4000[0x0];_0x3d2fed[_0x3d66('0x4d')](_0x1ab607,_0x9f4000[0x1]===_0x3d66('0x99')?![]:!![]);});}if(!_[_0x3d66('0x9a')](_0x33b4f1)){_0x3d2fed['having'](_0x19e5b5);_0x15e57c[_0x3d66('0x7d')](_0x3d66('0x9b'),_0x33b4f1);}BPromise['resolve']()[_0x3d66('0x27')](function(){if(!_0x5ac044){if(_0x122cd4[_0x3d66('0x43')]['WhatsappAccountId'])return;_0x15e57c['where'](_0x3d66('0x9c'));_0x3d2fed[_0x3d66('0x7d')](_0x3d66('0x9c'));return;}if(_0x122cd4['user'][_0x3d66('0x9d')]!==_0x3d66('0x9e'))return;return _0x122cd4[_0x3d66('0x9f')][_0x3d66('0xa0')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2e23a2){if(_[_0x3d66('0x9a')](_0x2e23a2)){_0x15e57c[_0x3d66('0x7d')]('i.WhatsappAccountId\x20IS\x20NULL');_0x3d2fed[_0x3d66('0x7d')](_0x3d66('0xa1'));}else{_0x15e57c[_0x3d66('0x7d')]('i.WhatsappAccountId\x20IN\x20?',_[_0x3d66('0x3d')](_0x2e23a2,'id'));_0x3d2fed['where'](_0x3d66('0x7e'),_[_0x3d66('0x3d')](_0x2e23a2,'id'));}});})[_0x3d66('0x27')](function(){if(_0x122cd4['user'][_0x3d66('0x9d')]===_0x3d66('0x9e')&&!_0x5ac044&&!_0x122cd4['query'][_0x3d66('0x7c')])return[];return db['sequelize'][_0x3d66('0x43')](_0x15e57c[_0x3d66('0xa2')](),_0x715567);})[_0x3d66('0x27')](function(_0x4ec0ad){_0x3d6cfa[_0x3d66('0x22')]=_0x4ec0ad[_0x3d66('0x4a')];if(_0x3d6cfa[_0x3d66('0x22')]===0x0)return[];return db[_0x3d66('0xa3')][_0x3d66('0x43')](_0x32edc2['toString'](),_0x715567)[_0x3d66('0x27')](function(_0x1bca47){_0x3c5b6d=_[_0x3d66('0xa4')](_0x1bca47,'id');_0x715567=_['merge'](_0x715567,{'model':db[_0x3d66('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x122cd4[_0x3d66('0x43')][_0x3d66('0x48')]){_0x2306af[_0x3d66('0x49')][_0x3d66('0x33')](function(_0x551248){_0x3d2fed['field']('i.'+_0x551248);});}else{_0x3d2fed[_0x3d66('0x50')](_0x3d66('0x97'),'unreadMessages');_0x3d2fed[_0x3d66('0x50')](_0x3d66('0xa5'),_0x3d66('0xa6'));_0x3d2fed['field'](_0x3d66('0xa7'),_0x3d66('0xa8'));_0x3d2fed['field']('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',_0x3d66('0x98'));_0x3d2fed['field'](_0x3d66('0xa9'));_0x3d2fed[_0x3d66('0x50')](_0x3d66('0xaa'),'Contact.firstName');_0x3d2fed['field'](_0x3d66('0xab'),_0x3d66('0xac'));_0x3d2fed[_0x3d66('0x50')](_0x3d66('0xad'),_0x3d66('0xae'));_0x3d2fed['field']('c.phone',_0x3d66('0xaf'));_0x3d2fed[_0x3d66('0x50')](_0x3d66('0xb0'),_0x3d66('0xb1'));_0x3d2fed[_0x3d66('0x50')](_0x3d66('0xb2'),'Contact.fax');_0x3d2fed['field'](_0x3d66('0xb3'),_0x3d66('0xb4'));_0x3d2fed['field'](_0x3d66('0xb5'),_0x3d66('0xb6'));_0x3d2fed['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2306af['limit'])_0x3d2fed['limit'](_0x2306af['limit']);if(_0x2306af[_0x3d66('0x1f')])_0x3d2fed[_0x3d66('0x1f')](_0x2306af[_0x3d66('0x1f')]);return db[_0x3d66('0xa3')][_0x3d66('0x43')](_0x3d2fed[_0x3d66('0xa2')](),_0x715567);})[_0x3d66('0x27')](function(_0x5419e2){if(_0x5419e2[_0x3d66('0x4a')]>0x0)_0x18a603[_0x3d66('0x7d')](_0x3d66('0xb7'),_[_0x3d66('0x3d')](_0x5419e2,'id'));return db[_0x3d66('0xa3')]['query'](_0x18a603['toString'](),_0x715567)[_0x3d66('0x27')](function(_0xa158b5){var _0x1d38f2=_[_0x3d66('0xb8')](_0xa158b5,_0x3d66('0xb9'));var _0x431c60=[];_0x5419e2[_0x3d66('0x33')](function(_0x16a3cf){_0x431c60[_0x3d66('0x34')](updateWhatsappInteraction(_0x16a3cf,_0x3c5b6d,_0x1d38f2));});return BPromise[_0x3d66('0xba')](_0x431c60);});});})[_0x3d66('0x27')](function(_0xd0ffd6){_0x3d6cfa[_0x3d66('0xbb')]=_0xd0ffd6;return _0x3d6cfa;})['then'](respondWithFilteredResult(_0x1bfedc,_0x2306af))[_0x3d66('0xbc')](handleError(_0x1bfedc,null));};exports[_0x3d66('0xbd')]=function(_0x1ebded,_0x55e084){var _0x2fe272={'raw':![],'where':{'id':_0x1ebded[_0x3d66('0xbe')]['id']}},_0x3a31b2={};_0x3a31b2['model']=_['keys'](db['WhatsappInteraction'][_0x3d66('0x3f')]);_0x3a31b2['query']=_[_0x3d66('0x44')](_0x1ebded[_0x3d66('0x43')]);_0x3a31b2[_0x3d66('0x45')]=_[_0x3d66('0x46')](_0x3a31b2['model'],_0x3a31b2[_0x3d66('0x43')]);_0x2fe272[_0x3d66('0x49')]=_['intersection'](_0x3a31b2[_0x3d66('0x47')],qs['fields'](_0x1ebded[_0x3d66('0x43')][_0x3d66('0x48')]));_0x2fe272['attributes']=_0x2fe272['attributes'][_0x3d66('0x4a')]?_0x2fe272['attributes']:_0x3a31b2[_0x3d66('0x47')];if(_0x1ebded[_0x3d66('0x43')][_0x3d66('0xbf')]){_0x2fe272['include']=[{'all':!![]}];}_0x2fe272=_[_0x3d66('0xc0')]({},_0x2fe272,_0x1ebded[_0x3d66('0xc1')]);return db[_0x3d66('0x3e')][_0x3d66('0x68')](_0x2fe272)[_0x3d66('0x27')](handleEntityNotFound(_0x55e084,null))['then'](respondWithResult(_0x55e084,null))[_0x3d66('0xbc')](handleError(_0x55e084,null));};exports['create']=function(_0x327382,_0x15fa24){return db['WhatsappInteraction'][_0x3d66('0xc2')](_0x327382[_0x3d66('0x7a')],{})[_0x3d66('0x27')](respondWithResult(_0x15fa24,0xc9))['catch'](handleError(_0x15fa24,null));};exports[_0x3d66('0xc3')]=function(_0xd38828,_0x2a1e5f){if(_0xd38828[_0x3d66('0x7a')]['id']){delete _0xd38828[_0x3d66('0x7a')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0xd38828[_0x3d66('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a1e5f,null))[_0x3d66('0x27')](saveUpdates(_0xd38828[_0x3d66('0x7a')],null))[_0x3d66('0x27')](respondWithResult(_0x2a1e5f,null))['catch'](handleError(_0x2a1e5f,null));};exports[_0x3d66('0x28')]=function(_0x6d104a,_0x191263){return db['WhatsappInteraction'][_0x3d66('0x68')]({'where':{'id':_0x6d104a['params']['id']}})[_0x3d66('0x27')](handleEntityNotFound(_0x191263,null))[_0x3d66('0x27')](removeEntity(_0x191263,null))[_0x3d66('0xbc')](handleError(_0x191263,null));};exports[_0x3d66('0xc4')]=function(_0x4791e2,_0x2deb2c){return db['WhatsappInteraction']['describe']()[_0x3d66('0x27')](respondWithResult(_0x2deb2c,null))[_0x3d66('0xbc')](handleError(_0x2deb2c,null));};exports[_0x3d66('0xc5')]=function(_0x482e9d,_0x11c05b,_0x5e4272){return db['WhatsappMessage'][_0x3d66('0x68')]({'where':{'id':_0x482e9d['params']['id']}})[_0x3d66('0x27')](handleEntityNotFound(_0x11c05b,null))[_0x3d66('0x27')](function(_0x18103e){if(_0x18103e){return _0x18103e['addMessage'](_0x482e9d[_0x3d66('0x7a')]['ids'],_['omit'](_0x482e9d[_0x3d66('0x7a')],['ids','id'])||{});}})[_0x3d66('0x27')](respondWithResult(_0x11c05b,null))[_0x3d66('0xbc')](handleError(_0x11c05b,null));};exports[_0x3d66('0xc6')]=function(_0x71a017,_0x146b0e,_0x1bf85c){var _0x27cc88={'raw':![],'where':{}};var _0x1457f1={};var _0x3732d0={'count':0x0,'rows':[]};return db[_0x3d66('0x3e')]['findOne']({'where':{'id':_0x71a017[_0x3d66('0xbe')]['id']}})[_0x3d66('0x27')](handleEntityNotFound(_0x146b0e,null))[_0x3d66('0x27')](function(_0x2ae44b){if(_0x2ae44b){_0x1457f1[_0x3d66('0x47')]=_[_0x3d66('0x44')](db['WhatsappMessage'][_0x3d66('0x3f')]);_0x1457f1[_0x3d66('0x43')]=_[_0x3d66('0x44')](_0x71a017[_0x3d66('0x43')]);_0x1457f1[_0x3d66('0x45')]=_[_0x3d66('0x46')](_0x1457f1[_0x3d66('0x47')],_0x1457f1['query']);_0x27cc88[_0x3d66('0x49')]=_['intersection'](_0x1457f1['model'],qs[_0x3d66('0x48')](_0x71a017[_0x3d66('0x43')]['fields']));_0x27cc88['attributes']=_0x27cc88[_0x3d66('0x49')][_0x3d66('0x4a')]?_0x27cc88[_0x3d66('0x49')]:_0x1457f1['model'];if(!_0x71a017[_0x3d66('0x43')][_0x3d66('0x4b')]('nolimit')){_0x27cc88['limit']=qs[_0x3d66('0x21')](_0x71a017['query'][_0x3d66('0x21')]);_0x27cc88[_0x3d66('0x1f')]=qs[_0x3d66('0x1f')](_0x71a017[_0x3d66('0x43')][_0x3d66('0x1f')]);}_0x27cc88[_0x3d66('0x4d')]=qs['sort'](_0x71a017['query'][_0x3d66('0x4e')]);_0x27cc88[_0x3d66('0x7d')]=qs[_0x3d66('0x45')](_[_0x3d66('0xc7')](_0x71a017[_0x3d66('0x43')],_0x1457f1[_0x3d66('0x45')]));_0x27cc88[_0x3d66('0x7d')]['WhatsappInteractionId']=_0x2ae44b['id'];if(_0x71a017['query'][_0x3d66('0x8b')]){_0x27cc88['where']=_[_0x3d66('0xc0')](_0x27cc88[_0x3d66('0x7d')],{'$or':_[_0x3d66('0x3d')](_0x27cc88[_0x3d66('0x49')],function(_0x1c3cbf){var _0x3bad06={};_0x3bad06[_0x1c3cbf]={'$like':'%'+_0x71a017[_0x3d66('0x43')][_0x3d66('0x8b')]+'%'};return _0x3bad06;})});}if(_0x71a017[_0x3d66('0x43')][_0x3d66('0xc8')]){var _0x63e5b1=_0x71a017[_0x3d66('0x43')][_0x3d66('0xc8')][_0x3d66('0x32')](',');var _0x2e4612={};_0x2e4612[_0x63e5b1[0x0]]={'$gte':moment(_0x63e5b1[0x1])[_0x3d66('0xc9')](_0x3d66('0xca'))};_0x27cc88[_0x3d66('0x7d')]=_[_0x3d66('0xc0')](_0x27cc88[_0x3d66('0x7d')],_0x2e4612);}_0x27cc88=_[_0x3d66('0xc0')]({},_0x27cc88,_0x71a017[_0x3d66('0xc1')]);return db['WhatsappMessage'][_0x3d66('0x22')]({'where':_0x27cc88['where']})['then'](function(_0x283955){_0x3732d0[_0x3d66('0x22')]=_0x283955;if(_0x71a017[_0x3d66('0x43')]['includeAll']){_0x27cc88[_0x3d66('0xcb')]=[{'all':!![]}];}return db[_0x3d66('0xcc')][_0x3d66('0xcd')](_0x27cc88);})['then'](function(_0x1279c8){_0x3732d0['rows']=_0x1279c8;return _0x3732d0;});}})['then'](respondWithFilteredResult(_0x146b0e,_0x27cc88))[_0x3d66('0xbc')](handleError(_0x146b0e,null));};exports[_0x3d66('0xce')]=function(_0xbe36d8,_0x1d11ec,_0xc54ac){return db['WhatsappInteraction'][_0x3d66('0x68')]({'where':{'id':_0xbe36d8[_0x3d66('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1d11ec,null))[_0x3d66('0x27')](function(_0x4e0bdd){if(_0x4e0bdd){return _0x4e0bdd[_0x3d66('0xcf')](_0xbe36d8['body'][_0x3d66('0xd0')],_['omit'](_0xbe36d8[_0x3d66('0x7a')],['ids','id'])||{})['spread'](function(){return db[_0x3d66('0x75')]['findAll']({'attributes':['id',_0x3d66('0x2c'),_0x3d66('0x51')],'where':{'id':_0xbe36d8['body'][_0x3d66('0xd0')]}});})[_0x3d66('0x27')](function(_0x2147e6){socket[_0x3d66('0xd1')](_0x3d66('0xd2'),{'id':Number(_0xbe36d8[_0x3d66('0xbe')]['id']),'tags':_0x2147e6||[]});return{'id':Number(_0xbe36d8[_0x3d66('0xbe')]['id']),'tags':_0x2147e6||[]};});}})[_0x3d66('0x27')](respondWithResult(_0x1d11ec,null))[_0x3d66('0xbc')](handleError(_0x1d11ec,null));};exports[_0x3d66('0xd3')]=function(_0x580707,_0x2183a0,_0x141612){return db[_0x3d66('0x3e')][_0x3d66('0x68')]({'where':{'id':_0x580707[_0x3d66('0xbe')]['id']}})[_0x3d66('0x27')](handleEntityNotFound(_0x2183a0,null))[_0x3d66('0x27')](function(_0x118e0b){if(_0x118e0b){return _0x118e0b[_0x3d66('0xd3')](_0x580707[_0x3d66('0x43')][_0x3d66('0xd0')]);}})[_0x3d66('0x27')](respondWithStatusCode(_0x2183a0,null))[_0x3d66('0xbc')](handleError(_0x2183a0,null));};exports['download']=function(_0x4decb0,_0x35fae3){var _0x4dbb99=moment()['unix']()[_0x3d66('0xa2')]();var _0x294ff6=path[_0x3d66('0xd4')](config[_0x3d66('0xd5')],_0x3d66('0xd6'),_0x3d66('0xd7'),_0x3d66('0xd8'));var _0x21291c=path['join'](config[_0x3d66('0xd5')],'server',_0x3d66('0xd7'),_0x3d66('0xd9'));var _0xc1d558=path['join'](_0x294ff6,_0x4dbb99);var _0x255726=util[_0x3d66('0xc9')]('transcript-%d-%s.zip',_0x4decb0[_0x3d66('0xbe')]['id'],_0x4dbb99);var _0x1f69f0=path['join'](_0x294ff6,_0x255726);var _0x4b8ffe=[];_0x4b8ffe[_0x3d66('0x34')]({'model':db[_0x3d66('0x77')],'as':_0x3d66('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x4b8ffe['push']({'model':db[_0x3d66('0xda')],'as':'Contact','attributes':['id','firstName',_0x3d66('0xdb')],'raw':!![]});if(_0x4decb0['query'][_0x3d66('0xd9')]){_0x4b8ffe['push']({'model':db['Attachment'],'as':_0x3d66('0xdc'),'raw':!![]});}var _0x47210a=[{'model':db[_0x3d66('0xcc')],'as':_0x3d66('0xdd'),'attributes':['id',_0x3d66('0x7a'),_0x3d66('0x80'),_0x3d66('0xde'),_0x3d66('0xdf'),_0x3d66('0x85')],'include':_0x4b8ffe}];_0x47210a[_0x3d66('0x34')]({'model':db[_0x3d66('0xe0')],'as':_0x3d66('0xe1'),'attributes':['id',_0x3d66('0x2c')]});_0x47210a[_0x3d66('0x34')]({'model':db['User'],'as':'Owner','attributes':['id',_0x3d66('0x2f')]});return db[_0x3d66('0x3e')][_0x3d66('0x68')]({'where':{'id':_0x4decb0[_0x3d66('0xbe')]['id']},'include':_0x47210a})[_0x3d66('0x27')](handleEntityNotFound(_0x35fae3,null))['then'](function(_0x3d470f){if(_0x3d470f){var _0x1f2d14=_0x3d470f[_0x3d66('0xe2')]({'plain':!![]});fs[_0x3d66('0xe3')](_0xc1d558);var _0x1f3d27={'channel':_0x3d66('0xe4'),'account':_0x1f2d14[_0x3d66('0xe1')][_0x3d66('0x2c')],'agent':_0x1f2d14[_0x3d66('0xe5')]?_0x1f2d14[_0x3d66('0xe5')]['fullname']:_0x3d66('0xe6'),'createdAt':moment(_0x1f2d14['createdAt'])[_0x3d66('0xc9')](_0x3d66('0xca'))[_0x3d66('0xa2')](),'closedAt':_0x1f2d14[_0x3d66('0x38')]?moment(_0x1f2d14[_0x3d66('0xe7')])[_0x3d66('0xc9')](_0x3d66('0xca'))[_0x3d66('0xa2')]():'','disposition':_0x1f2d14[_0x3d66('0xe8')],'messages':_(_0x1f2d14[_0x3d66('0xdd')])[_0x3d66('0x8b')]({'secret':![]})['map'](function(_0x552ef3){if(_0x552ef3[_0x3d66('0xdc')]){var _0x48ddff=path[_0x3d66('0xd4')](_0x21291c,_0x552ef3[_0x3d66('0xdc')][_0x3d66('0xe9')]);if(fs[_0x3d66('0xea')](_0x48ddff)){fs[_0x3d66('0xeb')](_0x48ddff)[_0x3d66('0xec')](fs['createWriteStream'](path[_0x3d66('0xd4')](_0xc1d558,_0x552ef3[_0x3d66('0xdc')][_0x3d66('0xe9')])));}}return{'date':moment(_0x552ef3[_0x3d66('0x80')])[_0x3d66('0xc9')](_0x3d66('0xca'))['toString'](),'sender':_0x552ef3['direction']===_0x3d66('0xed')?_0x552ef3[_0x3d66('0x77')]?_0x552ef3[_0x3d66('0x77')][_0x3d66('0x2f')]:'System':_0x552ef3[_0x3d66('0x6d')][_0x3d66('0xee')]+(_0x552ef3[_0x3d66('0x6d')][_0x3d66('0xdb')]?'\x20'+_0x552ef3['Contact'][_0x3d66('0xdb')]:''),'body':_0x552ef3['Attachment']?_0x552ef3[_0x3d66('0xdc')][_0x3d66('0xe9')]:_0x552ef3[_0x3d66('0x7a')],'direction':_0x552ef3[_0x3d66('0xde')]==='out'?'A':'C','secret':_0x552ef3[_0x3d66('0xdf')],'read':_0x552ef3['read'],'attachment':_0x552ef3['Attachment']};})[_0x3d66('0x6a')]()};return ejs[_0x3d66('0xef')](path[_0x3d66('0xd4')](config[_0x3d66('0xd5')],_0x3d66('0xd6'),_0x3d66('0xf0'),_0x3d66('0xf1')),{'interaction':_0x1f3d27})[_0x3d66('0x27')](function(_0x440746){var _0x57fae3=path[_0x3d66('0xd4')](_0xc1d558,'transcript-'+_0x1f2d14['id']+'-'+_0x4dbb99+_0x3d66('0xf2'));var _0x57fdc8={'path':_0x57fae3,'channel':'Whatsapp','interactionId':_0x1f2d14['id']};return pdf[_0x3d66('0xf3')](_0x440746,_0x57fdc8);})[_0x3d66('0x27')](function(){return new BPromise(function(_0x4807a7,_0x140624){zipdir(_0xc1d558,{'saveTo':_0x1f69f0},function(_0x5dcf5e,_0x4836e3){if(_0x5dcf5e)return _0x140624(_0x5dcf5e);return _0x4807a7(_0x4836e3);});})[_0x3d66('0x27')](function(){return new BPromise(function(_0x445509,_0x1255a1){rimraf(_0xc1d558,function(_0x44fa49){if(_0x44fa49)_0x1255a1(_0x44fa49);return _0x445509();});});})['then'](function(){return _0x35fae3[_0x3d66('0xf4')](_0x1f69f0,_0x255726,function(_0x593d9b){if(_0x593d9b){console[_0x3d66('0xf5')]('err',_0x593d9b);}else{fs['unlinkSync'](_0x1f69f0);}});});});}else{return _0x35fae3[_0x3d66('0x1c')](0xc8);}})[_0x3d66('0xbc')](handleError(_0x35fae3,null));};
\ No newline at end of file
index 9a61300..b71a681 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x710e=['hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x58d57c,_0x2c6d91){var _0x52832c=function(_0x54f657){while(--_0x54f657){_0x58d57c['push'](_0x58d57c['shift']());}};_0x52832c(++_0x2c6d91);}(_0x710e,0xb6));var _0xe710=function(_0x59e9c2,_0xe673e){_0x59e9c2=_0x59e9c2-0x0;var _0x359594=_0x710e[_0x59e9c2];return _0x359594;};'use strict';var EventEmitter=require(_0xe710('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xe710('0x1'))['db'][_0xe710('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe710('0x3')](0x0);var events={'afterCreate':_0xe710('0x4'),'afterUpdate':_0xe710('0x5'),'afterDestroy':'remove'};function emitEvent(_0x17600b){return function(_0x2e25b1,_0x5289ce,_0x5a9e4c){_0x2e25b1[_0xe710('0x6')]({'attributes':['id'],'raw':!![]})[_0xe710('0x7')](function(_0x205db2){_0x2e25b1[_0xe710('0x8')](_0xe710('0x9'),_0x205db2[_0xe710('0xa')](function(_0x5e162a){return{'id':_0x5e162a['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x2e25b1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x21aa4f){_0x2e25b1[_0xe710('0x8')](_0xe710('0xb'),_0x21aa4f[_0xe710('0xc')]);WhatsappInteractionEvents[_0xe710('0xd')](_0x17600b+':'+_0x2e25b1['id'],_0x2e25b1);WhatsappInteractionEvents[_0xe710('0xd')](_0x17600b,_0x2e25b1);_0x5a9e4c(null);})[_0xe710('0xe')](_0x5a9e4c(null));};}for(var e in events){if(events[_0xe710('0xf')](e)){var event=events[e];WhatsappInteraction[_0xe710('0x10')](e,emitEvent(event));}}module[_0xe710('0x11')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x77f1=['exports','../../mysqldb','WhatsappInteraction','update','remove','getUsers','then','setDataValue','Users','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x780601,_0x1f4ed0){var _0x58359c=function(_0x86a798){while(--_0x86a798){_0x780601['push'](_0x780601['shift']());}};_0x58359c(++_0x1f4ed0);}(_0x77f1,0x1dd));var _0x177f=function(_0x3f312d,_0xe263ff){_0x3f312d=_0x3f312d-0x0;var _0x38cdc5=_0x77f1[_0x3f312d];return _0x38cdc5;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x177f('0x0'))['db'][_0x177f('0x1')];var WhatsappMessage=require(_0x177f('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x177f('0x2'),'afterDestroy':_0x177f('0x3')};function emitEvent(_0x57dc73){return function(_0x68cb6a,_0x22c85f,_0x31c4de){_0x68cb6a[_0x177f('0x4')]({'attributes':['id'],'raw':!![]})[_0x177f('0x5')](function(_0x58525a){_0x68cb6a[_0x177f('0x6')](_0x177f('0x7'),_0x58525a['map'](function(_0xba9371){return{'id':_0xba9371['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x68cb6a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x177f('0x5')](function(_0x4e1bab){_0x68cb6a[_0x177f('0x6')](_0x177f('0x8'),_0x4e1bab['length']);WhatsappInteractionEvents[_0x177f('0x9')](_0x57dc73+':'+_0x68cb6a['id'],_0x68cb6a);WhatsappInteractionEvents[_0x177f('0x9')](_0x57dc73,_0x68cb6a);_0x31c4de(null);})[_0x177f('0xa')](_0x31c4de(null));};}for(var e in events){if(events[_0x177f('0xb')](e)){var event=events[e];WhatsappInteraction[_0x177f('0xc')](e,emitEvent(event));}}module[_0x177f('0xd')]=WhatsappInteractionEvents;
\ No newline at end of file
index f91ede7..5d9d9b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c4a=['api','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','lodash'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9c4a,0x1b9));var _0xa9c4=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x9c4a[_0x26f702];return _0x11417d;};'use strict';var _=require(_0xa9c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa9c4('0x1'));var moment=require('moment');var BPromise=require(_0xa9c4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9c4('0x3'));var rimraf=require(_0xa9c4('0x4'));var config=require(_0xa9c4('0x5'));var attributes=require(_0xa9c4('0x6'));module['exports']=function(_0xc7b768,_0x2725fd){return _0xc7b768[_0xa9c4('0x7')](_0xa9c4('0x8'),attributes,{'tableName':_0xa9c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x247c97,_0x2416e0,_0x3df9b1){if(_0x247c97[_0xa9c4('0xa')](_0xa9c4('0xb'))){_0x247c97['closedAt']=moment()[_0xa9c4('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3df9b1(null,_0x247c97);}}});};
\ No newline at end of file
+var _0x9e8e=['WhatsappInteraction','changed','closed','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x9e8e,0x16b));var _0xe9e8=function(_0x38df0b,_0x5413ca){_0x38df0b=_0x38df0b-0x0;var _0x75b96c=_0x9e8e[_0x38df0b];return _0x75b96c;};'use strict';var _=require(_0xe9e8('0x0'));var util=require(_0xe9e8('0x1'));var logger=require(_0xe9e8('0x2'))(_0xe9e8('0x3'));var moment=require(_0xe9e8('0x4'));var BPromise=require(_0xe9e8('0x5'));var rp=require(_0xe9e8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9e8('0x7'));var config=require(_0xe9e8('0x8'));var attributes=require(_0xe9e8('0x9'));module[_0xe9e8('0xa')]=function(_0x3ed7a8,_0x3338f3){return _0x3ed7a8[_0xe9e8('0xb')](_0xe9e8('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d5975,_0x37c151,_0x338c91){if(_0x1d5975[_0xe9e8('0xd')](_0xe9e8('0xe'))){_0x1d5975['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x338c91(null,_0x1d5975);}}});};
\ No newline at end of file
index 9de07c3..6f70116 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2be=['message','catch','update','body','options','where','attributes','then','UpdateWhatsappInteraction','find','ids','spread','info','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappInteraction,\x20%s,\x20%s'];(function(_0x205e68,_0x838899){var _0x4f4a51=function(_0x2dd573){while(--_0x2dd573){_0x205e68['push'](_0x205e68['shift']());}};_0x4f4a51(++_0x838899);}(_0xf2be,0x9e));var _0xef2b=function(_0x54cbf8,_0x44b315){_0x54cbf8=_0x54cbf8-0x0;var _0x35a617=_0xf2be[_0x54cbf8];return _0x35a617;};'use strict';var _=require(_0xef2b('0x0'));var util=require(_0xef2b('0x1'));var moment=require(_0xef2b('0x2'));var BPromise=require('bluebird');var rs=require(_0xef2b('0x3'));var fs=require('fs');var Redis=require(_0xef2b('0x4'));var db=require(_0xef2b('0x5'))['db'];var utils=require(_0xef2b('0x6'));var logger=require(_0xef2b('0x7'))(_0xef2b('0x8'));var config=require('../../config/environment');var jayson=require(_0xef2b('0x9'));var client=jayson[_0xef2b('0xa')][_0xef2b('0xb')]({'port':0x232a});config[_0xef2b('0xc')]=_[_0xef2b('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xef2b('0xe'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xef2b('0xf')](socket);function respondWithRpcPromise(_0x570acb,_0x3301ae,_0x14141d){return new BPromise(function(_0xd0ff02,_0x222f1c){return client['request'](_0x570acb,_0x14141d)['then'](function(_0x53b028){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x3301ae,'request\x20sent');logger[_0xef2b('0x10')](_0xef2b('0x11'),_0x3301ae,_0xef2b('0x12'),JSON[_0xef2b('0x13')](_0x53b028));if(_0x53b028['error']){if(_0x53b028[_0xef2b('0x14')]['code']===0x1f4){logger['error'](_0xef2b('0x15'),_0x3301ae,_0x53b028['error'][_0xef2b('0x16')]);return _0x222f1c(_0x53b028[_0xef2b('0x14')][_0xef2b('0x16')]);}logger[_0xef2b('0x14')](_0xef2b('0x15'),_0x3301ae,_0x53b028[_0xef2b('0x14')]['message']);return _0xd0ff02(_0x53b028[_0xef2b('0x14')]['message']);}else{logger['info'](_0xef2b('0x15'),_0x3301ae,_0xef2b('0x12'));_0xd0ff02(_0x53b028['result'][_0xef2b('0x16')]);}})[_0xef2b('0x17')](function(_0x31f598){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x3301ae,_0x31f598);_0x222f1c(_0x31f598);});});}exports['UpdateWhatsappInteraction']=function(_0x478527){var _0x4751d9=this;return new Promise(function(_0x136df2,_0x24acbc){return db['WhatsappInteraction'][_0xef2b('0x18')](_0x478527[_0xef2b('0x19')],{'raw':_0x478527[_0xef2b('0x1a')]?_0x478527[_0xef2b('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x478527[_0xef2b('0x1a')]?_0x478527[_0xef2b('0x1a')][_0xef2b('0x1b')]||null:null,'attributes':_0x478527[_0xef2b('0x1a')]?_0x478527[_0xef2b('0x1a')][_0xef2b('0x1c')]||null:null,'limit':_0x478527[_0xef2b('0x1a')]?_0x478527[_0xef2b('0x1a')]['limit']||null:null})[_0xef2b('0x1d')](function(_0x5f3149){logger['info'](_0xef2b('0x1e'),_0x478527);logger[_0xef2b('0x10')](_0xef2b('0x1e'),_0x478527,JSON[_0xef2b('0x13')](_0x5f3149));_0x136df2(_0x5f3149);})['catch'](function(_0x2beb2b){logger[_0xef2b('0x14')](_0xef2b('0x1e'),_0x2beb2b[_0xef2b('0x16')],_0x478527);_0x24acbc(_0x4751d9[_0xef2b('0x14')](0x1f4,_0x2beb2b[_0xef2b('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x493b7d){return new Promise(function(_0x212621,_0x35aaaf){return db['WhatsappInteraction'][_0xef2b('0x1f')]({'where':_0x493b7d[_0xef2b('0x1a')]?_0x493b7d['options'][_0xef2b('0x1b')]||null:null})[_0xef2b('0x1d')](function(_0x4f8fc1){if(_0x4f8fc1){return _0x4f8fc1['addTags'](_0x493b7d[_0xef2b('0x19')][_0xef2b('0x20')],_['omit'](_0x493b7d['body'],[_0xef2b('0x20'),'id'])||{});}})[_0xef2b('0x21')](function(_0x259e43){logger[_0xef2b('0x22')](_0xef2b('0x23'),_0x493b7d);logger['debug'](_0xef2b('0x23'),_0x493b7d,JSON['stringify'](_0x259e43));_0x212621(_0x259e43);})[_0xef2b('0x17')](function(_0x5c4f7c){logger[_0xef2b('0x14')](_0xef2b('0x23'),_0x5c4f7c['message'],_0x493b7d);_0x35aaaf(_this[_0xef2b('0x14')](0x1f4,_0x5c4f7c['message']));});});};
\ No newline at end of file
+var _0xe87e=['error','message','result','catch','WhatsappInteraction','update','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b0875,_0x21ff12){var _0xedb8d7=function(_0x33ebf6){while(--_0x33ebf6){_0x2b0875['push'](_0x2b0875['shift']());}};_0xedb8d7(++_0x21ff12);}(_0xe87e,0x90));var _0xee87=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xe87e[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xee87('0x0'));var util=require(_0xee87('0x1'));var moment=require('moment');var BPromise=require(_0xee87('0x2'));var rs=require(_0xee87('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee87('0x4'))['db'];var utils=require(_0xee87('0x5'));var logger=require(_0xee87('0x6'))(_0xee87('0x7'));var config=require(_0xee87('0x8'));var jayson=require(_0xee87('0x9'));var client=jayson[_0xee87('0xa')][_0xee87('0xb')]({'port':0x232a});config['redis']=_[_0xee87('0xc')](config['redis'],{'host':_0xee87('0xd'),'port':0x18eb});var socket=require(_0xee87('0xe'))(new Redis(config[_0xee87('0xf')]));require('./whatsappInteraction.socket')[_0xee87('0x10')](socket);function respondWithRpcPromise(_0x3c3697,_0x408ea9,_0xb6e1f0){return new BPromise(function(_0xad9f6d,_0x34ac64){return client['request'](_0x3c3697,_0xb6e1f0)[_0xee87('0x11')](function(_0x2ac8a4){logger[_0xee87('0x12')](_0xee87('0x13'),_0x408ea9,_0xee87('0x14'));logger[_0xee87('0x15')](_0xee87('0x16'),_0x408ea9,_0xee87('0x14'),JSON[_0xee87('0x17')](_0x2ac8a4));if(_0x2ac8a4['error']){if(_0x2ac8a4[_0xee87('0x18')]['code']===0x1f4){logger[_0xee87('0x18')](_0xee87('0x13'),_0x408ea9,_0x2ac8a4['error'][_0xee87('0x19')]);return _0x34ac64(_0x2ac8a4['error']['message']);}logger[_0xee87('0x18')](_0xee87('0x13'),_0x408ea9,_0x2ac8a4[_0xee87('0x18')][_0xee87('0x19')]);return _0xad9f6d(_0x2ac8a4['error'][_0xee87('0x19')]);}else{logger[_0xee87('0x12')](_0xee87('0x13'),_0x408ea9,'request\x20sent');_0xad9f6d(_0x2ac8a4[_0xee87('0x1a')][_0xee87('0x19')]);}})[_0xee87('0x1b')](function(_0x5547ef){logger['error'](_0xee87('0x13'),_0x408ea9,_0x5547ef);_0x34ac64(_0x5547ef);});});}exports['UpdateWhatsappInteraction']=function(_0x2f9bef){var _0x3431da=this;return new Promise(function(_0x3014e9,_0xd5b0f1){return db[_0xee87('0x1c')][_0xee87('0x1d')](_0x2f9bef[_0xee87('0x1e')],{'raw':_0x2f9bef[_0xee87('0x1f')]?_0x2f9bef[_0xee87('0x1f')][_0xee87('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f9bef[_0xee87('0x1f')]?_0x2f9bef[_0xee87('0x1f')][_0xee87('0x21')]||null:null,'attributes':_0x2f9bef['options']?_0x2f9bef[_0xee87('0x1f')][_0xee87('0x22')]||null:null,'limit':_0x2f9bef[_0xee87('0x1f')]?_0x2f9bef[_0xee87('0x1f')][_0xee87('0x23')]||null:null})[_0xee87('0x11')](function(_0x3fd5ac){logger['info'](_0xee87('0x24'),_0x2f9bef);logger[_0xee87('0x15')](_0xee87('0x24'),_0x2f9bef,JSON[_0xee87('0x17')](_0x3fd5ac));_0x3014e9(_0x3fd5ac);})['catch'](function(_0x4f8042){logger[_0xee87('0x18')](_0xee87('0x24'),_0x4f8042[_0xee87('0x19')],_0x2f9bef);_0xd5b0f1(_0x3431da[_0xee87('0x18')](0x1f4,_0x4f8042[_0xee87('0x19')]));});});};exports[_0xee87('0x25')]=function(_0x23e5b9){return new Promise(function(_0x1dea86,_0x43c941){return db[_0xee87('0x1c')][_0xee87('0x26')]({'where':_0x23e5b9[_0xee87('0x1f')]?_0x23e5b9[_0xee87('0x1f')][_0xee87('0x21')]||null:null})[_0xee87('0x11')](function(_0x138544){if(_0x138544){return _0x138544['addTags'](_0x23e5b9[_0xee87('0x1e')][_0xee87('0x27')],_['omit'](_0x23e5b9[_0xee87('0x1e')],[_0xee87('0x27'),'id'])||{});}})[_0xee87('0x28')](function(_0x19c054){logger['info']('AddTags',_0x23e5b9);logger['debug'](_0xee87('0x29'),_0x23e5b9,JSON[_0xee87('0x17')](_0x19c054));_0x1dea86(_0x19c054);})['catch'](function(_0x5b825c){logger[_0xee87('0x18')](_0xee87('0x29'),_0x5b825c[_0xee87('0x19')],_0x23e5b9);_0x43c941(_this[_0xee87('0x18')](0x1f4,_0x5b825c[_0xee87('0x19')]));});});};
\ No newline at end of file
index 01739cd..1b3452c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcca5=['register','length','./whatsappInteraction.events','save','update','emit','removeListener'];(function(_0x5a0446,_0x22bf4f){var _0xe63c67=function(_0x28ab60){while(--_0x28ab60){_0x5a0446['push'](_0x5a0446['shift']());}};_0xe63c67(++_0x22bf4f);}(_0xcca5,0x17c));var _0x5cca=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0xcca5[_0x5d6c3e];return _0x44ecb7;};'use strict';var WhatsappInteractionEvents=require(_0x5cca('0x0'));var events=[_0x5cca('0x1'),'remove',_0x5cca('0x2')];function createListener(_0xc2d393,_0xfd1715){return function(_0x2eac98){_0xfd1715[_0x5cca('0x3')](_0xc2d393,_0x2eac98);};}function removeListener(_0x2790b3,_0x22adf9){return function(){WhatsappInteractionEvents[_0x5cca('0x4')](_0x2790b3,_0x22adf9);};}exports[_0x5cca('0x5')]=function(_0x2cf17a){for(var _0x3923ae=0x0,_0x41b25c=events[_0x5cca('0x6')];_0x3923ae<_0x41b25c;_0x3923ae++){var _0x5a8596=events[_0x3923ae];var _0xe2b48a=createListener('whatsappInteraction:'+_0x5a8596,_0x2cf17a);WhatsappInteractionEvents['on'](_0x5a8596,_0xe2b48a);}};
\ No newline at end of file
+var _0x0dec=['./whatsappInteraction.events','save','remove','update','emit','removeListener','length','whatsappInteraction:'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x0dec,0x70));var _0xc0de=function(_0xa95a37,_0x3d8699){_0xa95a37=_0xa95a37-0x0;var _0x128602=_0x0dec[_0xa95a37];return _0x128602;};'use strict';var WhatsappInteractionEvents=require(_0xc0de('0x0'));var events=[_0xc0de('0x1'),_0xc0de('0x2'),_0xc0de('0x3')];function createListener(_0x1bdb72,_0x415e3c){return function(_0x4f45cc){_0x415e3c[_0xc0de('0x4')](_0x1bdb72,_0x4f45cc);};}function removeListener(_0x4d6460,_0x1e2d63){return function(){WhatsappInteractionEvents[_0xc0de('0x5')](_0x4d6460,_0x1e2d63);};}exports['register']=function(_0x31e1f6){for(var _0x3fae5b=0x0,_0x22a505=events[_0xc0de('0x6')];_0x3fae5b<_0x22a505;_0x3fae5b++){var _0x43220c=events[_0x3fae5b];var _0x1a55f3=createListener(_0xc0de('0x7')+_0x43220c,_0x31e1f6);WhatsappInteractionEvents['on'](_0x43220c,_0x1a55f3);}};
\ No newline at end of file
index 1c90e32..c574f06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c32=['./whatsappMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','whatsapp','create','/:id/status','status','put','update','accept','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x1158d5,_0x4e7ee8){var _0x3e9d61=function(_0x182cc7){while(--_0x182cc7){_0x1158d5['push'](_0x1158d5['shift']());}};_0x3e9d61(++_0x4e7ee8);}(_0x1c32,0x1a3));var _0x21c3=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0x1c32[_0x3e182f];return _0x23edc9;};'use strict';var multer=require(_0x21c3('0x0'));var util=require('util');var path=require(_0x21c3('0x1'));var timeout=require(_0x21c3('0x2'));var express=require(_0x21c3('0x3'));var router=express['Router']();var fs_extra=require(_0x21c3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x21c3('0x5'));var config=require('../../config/environment');var controller=require(_0x21c3('0x6'));router[_0x21c3('0x7')]('/',auth[_0x21c3('0x8')](),controller['index']);router[_0x21c3('0x7')](_0x21c3('0x9'),auth['isAuthenticated'](),controller[_0x21c3('0xa')]);router['get']('/:id',auth[_0x21c3('0x8')](),controller[_0x21c3('0xb')]);router[_0x21c3('0xc')]('/',auth['isAuthenticated'](),interaction[_0x21c3('0xd')](_0x21c3('0xe'),'whatsappmessage:create'),controller[_0x21c3('0xf')]);router[_0x21c3('0xc')](_0x21c3('0x10'),controller[_0x21c3('0x11')]);router[_0x21c3('0x12')]('/:id',auth[_0x21c3('0x8')](),controller[_0x21c3('0x13')]);router[_0x21c3('0x12')]('/:id/accept',auth[_0x21c3('0x8')](),controller[_0x21c3('0x14')]);router[_0x21c3('0x12')]('/:id/reject',auth[_0x21c3('0x8')](),controller['reject']);router[_0x21c3('0x15')](_0x21c3('0x16'),auth[_0x21c3('0x8')](),controller[_0x21c3('0x17')]);module[_0x21c3('0x18')]=router;
\ No newline at end of file
+var _0x47ce=['put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','describe','get','post','whatsappmessage:create','status'];(function(_0x301506,_0x54fee6){var _0x1dd5ee=function(_0x2ea0d8){while(--_0x2ea0d8){_0x301506['push'](_0x301506['shift']());}};_0x1dd5ee(++_0x54fee6);}(_0x47ce,0x120));var _0xe47c=function(_0x404a05,_0x5d9716){_0x404a05=_0x404a05-0x0;var _0x2ca6a6=_0x47ce[_0x404a05];return _0x2ca6a6;};'use strict';var multer=require(_0xe47c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe47c('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xe47c('0x2'));var config=require(_0xe47c('0x3'));var controller=require(_0xe47c('0x4'));router['get']('/',auth[_0xe47c('0x5')](),controller[_0xe47c('0x6')]);router['get']('/describe',auth[_0xe47c('0x5')](),controller[_0xe47c('0x7')]);router[_0xe47c('0x8')]('/:id',auth[_0xe47c('0x5')](),controller['show']);router[_0xe47c('0x9')]('/',auth[_0xe47c('0x5')](),interaction['tracked']('whatsapp',_0xe47c('0xa')),controller['create']);router[_0xe47c('0x9')]('/:id/status',controller[_0xe47c('0xb')]);router[_0xe47c('0xc')](_0xe47c('0xd'),auth[_0xe47c('0x5')](),controller[_0xe47c('0xe')]);router[_0xe47c('0xc')](_0xe47c('0xf'),auth['isAuthenticated'](),controller[_0xe47c('0x10')]);router[_0xe47c('0xc')](_0xe47c('0x11'),auth[_0xe47c('0x5')](),controller['reject']);router[_0xe47c('0x12')]('/:id',auth[_0xe47c('0x5')](),controller[_0xe47c('0x13')]);module['exports']=router;
\ No newline at end of file
index 380ce9c..69190b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa306=['DATE','sequelize','exports','TEXT','BOOLEAN','out','STRING'];(function(_0x33c98e,_0x19de46){var _0x188da9=function(_0x533b52){while(--_0x533b52){_0x33c98e['push'](_0x33c98e['shift']());}};_0x188da9(++_0x19de46);}(_0xa306,0x1cf));var _0x6a30=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xa306[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0x6a30('0x0'));module[_0x6a30('0x1')]={'body':{'type':Sequelize[_0x6a30('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6a30('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6a30('0x4')),'defaultValue':_0x6a30('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6a30('0x5')](0xbe)},'phone':{'type':Sequelize[_0x6a30('0x5')]},'readAt':{'type':Sequelize[_0x6a30('0x6')]},'secret':{'type':Sequelize[_0x6a30('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6a30('0x5')]},'providerResponse':{'type':Sequelize[_0x6a30('0x2')]}};
\ No newline at end of file
+var _0xf041=['medium','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x3fb9a3,_0x49f706){var _0x21f742=function(_0x25ff0d){while(--_0x25ff0d){_0x3fb9a3['push'](_0x3fb9a3['shift']());}};_0x21f742(++_0x49f706);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x1f04('0x0')](_0x1f04('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x1f04('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1f04('0x3')]('in','out'),'defaultValue':_0x1f04('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x1f04('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1f04('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index a86e2b2..e9339eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82a1=['zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','offset','limit','undefined','count','Content-Range','json','apply','reject','save','destroy','status','end','stack','name','send','index','map','WhatsappMessage','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','rows','show','params','rawAttributes','length','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','update','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','AcceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format'];(function(_0x136815,_0x530645){var _0x577c5a=function(_0x3132d7){while(--_0x3132d7){_0x136815['push'](_0x136815['shift']());}};_0x577c5a(++_0x530645);}(_0x82a1,0x88));var _0x182a=function(_0x12581e,_0x53183b){_0x12581e=_0x12581e-0x0;var _0xbb3cc6=_0x82a1[_0x12581e];return _0xbb3cc6;};'use strict';var emlformat=require(_0x182a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x182a('0x1'));var jsonpatch=require(_0x182a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x182a('0x3'));var Mustache=require(_0x182a('0x4'));var util=require('util');var path=require(_0x182a('0x5'));var sox=require(_0x182a('0x6'));var csv=require(_0x182a('0x7'));var ejs=require(_0x182a('0x8'));var fs=require('fs');var fs_extra=require(_0x182a('0x9'));var _=require(_0x182a('0xa'));var squel=require(_0x182a('0xb'));var crypto=require(_0x182a('0xc'));var jsforce=require(_0x182a('0xd'));var deskjs=require(_0x182a('0xe'));var toCsv=require(_0x182a('0x7'));var querystring=require(_0x182a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x182a('0x10'));var qs=require(_0x182a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x182a('0x12'))(_0x182a('0x13'));var utils=require('../../config/utils');var config=require(_0x182a('0x14'));var licenseUtil=require(_0x182a('0x15'));var db=require(_0x182a('0x16'))['db'];config[_0x182a('0x17')]=_[_0x182a('0x18')](config[_0x182a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x182a('0x19'))(new Redis(config[_0x182a('0x17')]));require('./whatsappMessage.socket')[_0x182a('0x1a')](socket);var jayson=require(_0x182a('0x1b'));var client=jayson[_0x182a('0x1c')][_0x182a('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x182a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x333082,_0x2f57ab,_0xda7d5,_0x457a2d){return new BPromise(function(_0x2eb101,_0x832c15){var _0x30895d=_0x457a2d||client;return _0x30895d[_0x182a('0x1e')](_0x333082,_0xda7d5)[_0x182a('0x1f')](function(_0x172fe1){logger[_0x182a('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x2f57ab,_0x182a('0x21'));logger[_0x182a('0x22')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2f57ab,_0x182a('0x21'),JSON[_0x182a('0x23')](_0x172fe1));if(_0x172fe1[_0x182a('0x24')]){if(_0x172fe1[_0x182a('0x24')]['code']===0x1f4){logger[_0x182a('0x24')](_0x182a('0x25'),_0x2f57ab,_0x172fe1[_0x182a('0x24')]['message']);return _0x832c15(_0x172fe1[_0x182a('0x24')][_0x182a('0x26')]);}logger[_0x182a('0x24')](_0x182a('0x25'),_0x2f57ab,_0x172fe1[_0x182a('0x24')][_0x182a('0x26')]);return _0x2eb101(_0x172fe1[_0x182a('0x24')][_0x182a('0x26')]);}else{logger[_0x182a('0x20')](_0x182a('0x25'),_0x2f57ab,_0x182a('0x21'));_0x2eb101(_0x172fe1[_0x182a('0x27')]['message']);}})[_0x182a('0x28')](function(_0x4a4558){logger[_0x182a('0x24')](_0x182a('0x25'),_0x2f57ab,_0x4a4558);_0x832c15(_0x4a4558);});});}function respondWithStatusCode(_0x52407b,_0x5f28a6){_0x5f28a6=_0x5f28a6||0xcc;return function(_0x4fc6f5){if(_0x4fc6f5){return _0x52407b[_0x182a('0x29')](_0x5f28a6);}return _0x52407b['status'](_0x5f28a6)['end']();};}function respondWithResult(_0x13d413,_0x1189f3){_0x1189f3=_0x1189f3||0xc8;return function(_0x3c2743){if(_0x3c2743){return _0x13d413['status'](_0x1189f3)['json'](_0x3c2743);}};}function respondWithFilteredResult(_0x2caafa,_0x24ed99){return function(_0x39c129){if(_0x39c129){var _0x102f9e=typeof _0x24ed99[_0x182a('0x2a')]==='undefined'&&typeof _0x24ed99[_0x182a('0x2b')]===_0x182a('0x2c');var _0x411fc8=_0x39c129[_0x182a('0x2d')];var _0x51d2b4=_0x102f9e?0x0:_0x24ed99[_0x182a('0x2a')];var _0x50cada=_0x102f9e?_0x39c129['count']:_0x24ed99[_0x182a('0x2a')]+_0x24ed99[_0x182a('0x2b')];var _0x44d33b;if(_0x50cada>=_0x411fc8){_0x50cada=_0x411fc8;_0x44d33b=0xc8;}else{_0x44d33b=0xce;}_0x2caafa['status'](_0x44d33b);return _0x2caafa['set'](_0x182a('0x2e'),_0x51d2b4+'-'+_0x50cada+'/'+_0x411fc8)[_0x182a('0x2f')](_0x39c129);}return null;};}function patchUpdates(_0x57ba74){return function(_0xd204db){try{jsonpatch[_0x182a('0x30')](_0xd204db,_0x57ba74,!![]);}catch(_0x24a250){return BPromise[_0x182a('0x31')](_0x24a250);}return _0xd204db[_0x182a('0x32')]();};}function saveUpdates(_0x286162,_0x2e889a){return function(_0x1e8a8b){if(_0x1e8a8b){return _0x1e8a8b['update'](_0x286162)[_0x182a('0x1f')](function(_0x3cceaf){return _0x3cceaf;});}return null;};}function removeEntity(_0x43d32b,_0x374078){return function(_0x503531){if(_0x503531){return _0x503531[_0x182a('0x33')]()[_0x182a('0x1f')](function(){_0x43d32b[_0x182a('0x34')](0xcc)[_0x182a('0x35')]();});}};}function handleEntityNotFound(_0x3942e,_0x2d2509){return function(_0x5be0b8){if(!_0x5be0b8){_0x3942e['sendStatus'](0x194);}return _0x5be0b8;};}function handleError(_0x59eb92,_0x588606){_0x588606=_0x588606||0x1f4;return function(_0x48d3d3){logger[_0x182a('0x24')](_0x48d3d3[_0x182a('0x36')]);if(_0x48d3d3[_0x182a('0x37')]){delete _0x48d3d3[_0x182a('0x37')];}_0x59eb92[_0x182a('0x34')](_0x588606)[_0x182a('0x38')](_0x48d3d3);};}exports[_0x182a('0x39')]=function(_0x4f3552,_0x25803f){var _0x46f2f1={},_0x4be657={},_0x1407eb={'count':0x0,'rows':[]};var _0x5ceeee=_[_0x182a('0x3a')](db[_0x182a('0x3b')]['rawAttributes'],function(_0x562d32){return{'name':_0x562d32[_0x182a('0x3c')],'type':_0x562d32[_0x182a('0x3d')]['key']};});_0x4be657[_0x182a('0x3e')]=_[_0x182a('0x3a')](_0x5ceeee,_0x182a('0x37'));_0x4be657[_0x182a('0x3f')]=_[_0x182a('0x40')](_0x4f3552['query']);_0x4be657['filters']=_[_0x182a('0x41')](_0x4be657[_0x182a('0x3e')],_0x4be657[_0x182a('0x3f')]);_0x46f2f1[_0x182a('0x42')]=_[_0x182a('0x41')](_0x4be657[_0x182a('0x3e')],qs[_0x182a('0x43')](_0x4f3552[_0x182a('0x3f')][_0x182a('0x43')]));_0x46f2f1[_0x182a('0x42')]=_0x46f2f1[_0x182a('0x42')]['length']?_0x46f2f1['attributes']:_0x4be657[_0x182a('0x3e')];if(!_0x4f3552[_0x182a('0x3f')][_0x182a('0x44')](_0x182a('0x45'))){_0x46f2f1['limit']=qs[_0x182a('0x2b')](_0x4f3552[_0x182a('0x3f')][_0x182a('0x2b')]);_0x46f2f1[_0x182a('0x2a')]=qs[_0x182a('0x2a')](_0x4f3552[_0x182a('0x3f')]['offset']);}_0x46f2f1[_0x182a('0x46')]=qs[_0x182a('0x47')](_0x4f3552[_0x182a('0x3f')]['sort']);_0x46f2f1[_0x182a('0x48')]=qs[_0x182a('0x49')](_[_0x182a('0x4a')](_0x4f3552[_0x182a('0x3f')],_0x4be657[_0x182a('0x49')]),_0x5ceeee);if(_0x4f3552[_0x182a('0x3f')][_0x182a('0x4b')]){_0x46f2f1[_0x182a('0x48')]=_['merge'](_0x46f2f1['where'],{'$or':_[_0x182a('0x3a')](_0x5ceeee,function(_0x424324){if(_0x424324[_0x182a('0x3d')]!==_0x182a('0x4c')){var _0x4415b7={};_0x4415b7[_0x424324[_0x182a('0x37')]]={'$like':'%'+_0x4f3552['query'][_0x182a('0x4b')]+'%'};return _0x4415b7;}})});}_0x46f2f1=_[_0x182a('0x4d')]({},_0x46f2f1,_0x4f3552['options']);var _0x1b491d={'where':_0x46f2f1[_0x182a('0x48')]};return db[_0x182a('0x3b')][_0x182a('0x2d')](_0x1b491d)[_0x182a('0x1f')](function(_0x57fb84){_0x1407eb[_0x182a('0x2d')]=_0x57fb84;if(_0x4f3552[_0x182a('0x3f')][_0x182a('0x4e')]){_0x46f2f1[_0x182a('0x4f')]=[{'all':!![]}];}return db[_0x182a('0x3b')]['findAll'](_0x46f2f1);})[_0x182a('0x1f')](function(_0x255193){_0x1407eb[_0x182a('0x50')]=_0x255193;return _0x1407eb;})[_0x182a('0x1f')](respondWithFilteredResult(_0x25803f,_0x46f2f1))[_0x182a('0x28')](handleError(_0x25803f,null));};exports[_0x182a('0x51')]=function(_0x25fa0f,_0x87db9d){var _0x1ab727={'raw':!![],'where':{'id':_0x25fa0f[_0x182a('0x52')]['id']}},_0x2a0cf9={};_0x2a0cf9[_0x182a('0x3e')]=_['keys'](db[_0x182a('0x3b')][_0x182a('0x53')]);_0x2a0cf9['query']=_[_0x182a('0x40')](_0x25fa0f[_0x182a('0x3f')]);_0x2a0cf9[_0x182a('0x49')]=_['intersection'](_0x2a0cf9[_0x182a('0x3e')],_0x2a0cf9['query']);_0x1ab727[_0x182a('0x42')]=_[_0x182a('0x41')](_0x2a0cf9[_0x182a('0x3e')],qs[_0x182a('0x43')](_0x25fa0f[_0x182a('0x3f')]['fields']));_0x1ab727[_0x182a('0x42')]=_0x1ab727[_0x182a('0x42')][_0x182a('0x54')]?_0x1ab727[_0x182a('0x42')]:_0x2a0cf9[_0x182a('0x3e')];if(_0x25fa0f[_0x182a('0x3f')][_0x182a('0x4e')]){_0x1ab727[_0x182a('0x4f')]=[{'all':!![]}];}_0x1ab727=_[_0x182a('0x4d')]({},_0x1ab727,_0x25fa0f['options']);return db['WhatsappMessage'][_0x182a('0x55')](_0x1ab727)[_0x182a('0x1f')](handleEntityNotFound(_0x87db9d,null))[_0x182a('0x1f')](respondWithResult(_0x87db9d,null))[_0x182a('0x28')](handleError(_0x87db9d,null));};exports[_0x182a('0x56')]=function(_0x270b74,_0x5d56b0){return db[_0x182a('0x3b')][_0x182a('0x56')](_0x270b74['body'],{})[_0x182a('0x1f')](respondWithResult(_0x5d56b0,0xc9))[_0x182a('0x28')](handleError(_0x5d56b0,null));};exports['update']=function(_0x17132a,_0x395e97){if(_0x17132a[_0x182a('0x57')]['id']){delete _0x17132a[_0x182a('0x57')]['id'];}return db[_0x182a('0x3b')][_0x182a('0x55')]({'where':{'id':_0x17132a['params']['id']}})[_0x182a('0x1f')](handleEntityNotFound(_0x395e97,null))[_0x182a('0x1f')](saveUpdates(_0x17132a['body'],null))[_0x182a('0x1f')](respondWithResult(_0x395e97,null))[_0x182a('0x28')](handleError(_0x395e97,null));};exports[_0x182a('0x33')]=function(_0x5c7e43,_0x39d3c9){return db['WhatsappMessage']['find']({'where':{'id':_0x5c7e43[_0x182a('0x52')]['id']}})[_0x182a('0x1f')](handleEntityNotFound(_0x39d3c9,null))[_0x182a('0x1f')](removeEntity(_0x39d3c9,null))[_0x182a('0x28')](handleError(_0x39d3c9,null));};exports[_0x182a('0x58')]=function(_0x3405f6,_0x3ab66d){return db[_0x182a('0x3b')][_0x182a('0x58')]()[_0x182a('0x1f')](respondWithResult(_0x3ab66d,null))[_0x182a('0x28')](handleError(_0x3ab66d,null));};var interaction_log=require('../../config/logger')(_0x182a('0x59'));exports[_0x182a('0x5a')]=function(_0x585d01,_0x56ab62,_0x2a8895){var _0x1d7aa8={'agent':{},'channel':_0x182a('0x5b')};if(_0x585d01[_0x182a('0x57')]['id']){delete _0x585d01[_0x182a('0x57')]['id'];}_0x585d01[_0x182a('0x57')][_0x182a('0x5c')]=!![];_0x585d01['body'][_0x182a('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x585d01[_0x182a('0x57')]['UserId']=_0x585d01[_0x182a('0x57')][_0x182a('0x5e')]||_0x585d01['user']['id'];_0x1d7aa8[_0x182a('0x5f')]['id']=_0x585d01['body'][_0x182a('0x5e')];return db['WhatsappMessage'][_0x182a('0x55')]({'where':{'id':_0x585d01[_0x182a('0x52')]['id'],'UserId':null}})[_0x182a('0x1f')](handleEntityNotFound(_0x56ab62,null))[_0x182a('0x1f')](saveUpdates(_0x585d01[_0x182a('0x57')],null))[_0x182a('0x1f')](function(_0x5531f9){if(_0x5531f9){_0x1d7aa8[_0x182a('0x26')]=_0x5531f9[_0x182a('0x60')]({'plain':!![]});return db[_0x182a('0x61')][_0x182a('0x55')]({'where':{'id':_0x5531f9[_0x182a('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x56ab62,null))['then'](function(_0x2d6b87){if(_0x2d6b87){return _0x2d6b87[_0x182a('0x63')]({'UserId':_0x585d01[_0x182a('0x57')]['UserId'],'read1stAt':_[_0x182a('0x64')](_0x2d6b87[_0x182a('0x65')])?moment()[_0x182a('0x66')](_0x182a('0x67')):undefined});}return null;})[_0x182a('0x1f')](function(_0x21fe97){if(_0x21fe97){_0x1d7aa8[_0x182a('0x68')]=_0x21fe97['get']({'plain':!![]});interaction_log[_0x182a('0x20')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x585d01[_0x182a('0x69')]['id'],_0x585d01[_0x182a('0x69')][_0x182a('0x37')],_0x585d01['user'][_0x182a('0x6a')],_0x1d7aa8['interaction']['id'],_0x585d01[_0x182a('0x57')]?JSON[_0x182a('0x23')](_0x585d01[_0x182a('0x57')]):'null');return respondWithRpcPromise(_0x182a('0x6b'),'acceptMessage',_0x1d7aa8);}return null;})['then'](function(_0x3dff23){var _0x243b5b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3dff23[_0x182a('0x26')]['ContactId'];return db[_0x182a('0x6c')][_0x182a('0x3f')](_0x243b5b,{'type':db[_0x182a('0x6d')][_0x182a('0x6e')][_0x182a('0x6f')],'raw':!![]})[_0x182a('0x1f')](function(_0x5351c1){return _0x5351c1;});})[_0x182a('0x1f')](function(_0x203157){if(_0x203157){_0x1d7aa8[_0x182a('0x26')][_0x182a('0x70')]=_0x203157[0x0];if(!_0x585d01['body'][_0x182a('0x5e')])return;return db[_0x182a('0x71')]['find']({'where':{'id':_0x585d01[_0x182a('0x57')][_0x182a('0x5e')],'role':'agent'},'attributes':['id',_0x182a('0x37'),'fullname',_0x182a('0x72'),_0x182a('0x73')],'raw':!![]});}return null;})[_0x182a('0x1f')](function(_0x55bd1b){if(!_0x55bd1b)return null;_0x1d7aa8[_0x182a('0x26')][_0x182a('0x5f')]=_0x55bd1b;return _0x1d7aa8;})[_0x182a('0x1f')](function(_0x372661){if(_0x372661){if(_0x585d01[_0x182a('0x57')][_0x182a('0x74')]){_0x1d7aa8[_0x182a('0x26')][_0x182a('0x75')]=util['format']('SIP/%s',_0x585d01[_0x182a('0x69')]['name']);_0x1d7aa8['message'][_0x182a('0x76')]=_0x1d7aa8[_0x182a('0x76')];_0x1d7aa8[_0x182a('0x26')]['motionChannel']=_0x1d7aa8[_0x182a('0x76')];_0x1d7aa8['message'][_0x182a('0x77')]='accept';return respondWithRpcPromise(_0x182a('0x78'),'EventManager',{'event':_0x182a('0x79'),'message':_0x1d7aa8[_0x182a('0x26')]},client9002)['then'](function(){return _0x1d7aa8;});}return _0x1d7aa8;}return null;})['then'](respondWithResult(_0x56ab62,null))['catch'](handleError(_0x56ab62,null));};var interaction_log=require('../../config/logger')(_0x182a('0x59'));exports['reject']=function(_0x46c2b4,_0x8e53d,_0x1fc638){var _0x5c157e={'agent':{},'channel':_0x182a('0x5b')};if(_0x46c2b4['body']['id']){delete _0x46c2b4[_0x182a('0x57')]['id'];}_0x46c2b4['body'][_0x182a('0x5e')]=_0x46c2b4[_0x182a('0x57')][_0x182a('0x5e')]||_0x46c2b4[_0x182a('0x69')]['id'];_0x5c157e[_0x182a('0x5f')]['id']=_0x46c2b4[_0x182a('0x57')]['UserId'];return db[_0x182a('0x3b')]['find']({'where':{'id':_0x46c2b4['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x8e53d,null))[_0x182a('0x1f')](function(_0x55bf10){if(_0x55bf10){_0x5c157e[_0x182a('0x26')]=_0x55bf10[_0x182a('0x60')]({'plain':!![]});return db[_0x182a('0x61')][_0x182a('0x55')]({'where':{'id':_0x55bf10[_0x182a('0x62')]}});}return null;})[_0x182a('0x1f')](handleEntityNotFound(_0x8e53d,null))['then'](function(_0x35ae0d){if(_0x35ae0d){_0x5c157e[_0x182a('0x68')]=_0x35ae0d[_0x182a('0x60')]({'plain':!![]});interaction_log[_0x182a('0x20')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46c2b4[_0x182a('0x69')]['id'],_0x46c2b4[_0x182a('0x69')][_0x182a('0x37')],_0x46c2b4[_0x182a('0x69')][_0x182a('0x6a')],_0x5c157e[_0x182a('0x68')]['id'],_0x46c2b4[_0x182a('0x57')]?JSON[_0x182a('0x23')](_0x46c2b4[_0x182a('0x57')]):'null');return respondWithRpcPromise(_0x182a('0x7a'),_0x182a('0x7b'),_0x5c157e);}return null;})[_0x182a('0x1f')](function(_0x22d594){var _0x5595a9=_0x182a('0x7c')+_0x22d594['message'][_0x182a('0x7d')];return db[_0x182a('0x6c')]['query'](_0x5595a9,{'type':db['Sequelize']['QueryTypes'][_0x182a('0x6f')],'raw':!![]})[_0x182a('0x1f')](function(_0x3c6fad){return _0x3c6fad;});})['then'](function(_0x17a638){if(_0x17a638){_0x5c157e[_0x182a('0x26')][_0x182a('0x70')]=_0x17a638[0x0];if(!_0x46c2b4['body']['UserId'])return;return db['User'][_0x182a('0x55')]({'where':{'id':_0x46c2b4[_0x182a('0x57')]['UserId'],'role':_0x182a('0x5f')},'attributes':['id',_0x182a('0x37'),'fullname',_0x182a('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x33e0b6){if(!_0x33e0b6)return null;_0x5c157e['message'][_0x182a('0x5f')]=_0x33e0b6;return _0x5c157e;})[_0x182a('0x1f')](function(_0x474576){if(_0x474576){_0x474576[_0x182a('0x26')][_0x182a('0x75')]=util[_0x182a('0x66')]('SIP/%s',_0x46c2b4[_0x182a('0x69')][_0x182a('0x37')]);_0x474576[_0x182a('0x26')][_0x182a('0x76')]=_0x5c157e[_0x182a('0x76')];_0x474576[_0x182a('0x26')][_0x182a('0x7e')]=_0x5c157e[_0x182a('0x76')];_0x474576[_0x182a('0x26')][_0x182a('0x77')]=_0x182a('0x31');respondWithRpcPromise(_0x182a('0x78'),'EventManager',{'event':_0x182a('0x7f'),'message':_0x474576[_0x182a('0x26')]},client9002);return _0x5c157e;}return null;})[_0x182a('0x1f')](respondWithResult(_0x8e53d,null))[_0x182a('0x28')](handleError(_0x8e53d,null));};exports['status']=function(_0x538ebb,_0x4c531e,_0xf9180f){if(_0x538ebb[_0x182a('0x57')]['id']){delete _0x538ebb['body']['id'];}var _0x58d204;return db[_0x182a('0x3b')][_0x182a('0x55')]({'where':{'id':_0x538ebb[_0x182a('0x52')]['id']}})[_0x182a('0x1f')](handleEntityNotFound(_0x4c531e,null))[_0x182a('0x1f')](function(_0x3a56e8){if(_0x3a56e8){_0x58d204=_0x3a56e8;return db[_0x182a('0x80')][_0x182a('0x55')]({'where':{'id':_0x3a56e8[_0x182a('0x81')]}});}})[_0x182a('0x1f')](handleEntityNotFound(_0x4c531e,null))['then'](function(_0x15b740){if(_0x15b740){logger[_0x182a('0x22')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x182a('0x34'),_0x182a('0x82'),_0x15b740[_0x182a('0x3d')],util['inspect'](_0x538ebb[_0x182a('0x57')],{'showHidden':![],'depth':null}));switch(_0x15b740[_0x182a('0x3d')]){case _0x182a('0x83'):if(_0x538ebb['body'][_0x182a('0x84')]&&_0x538ebb['body'][_0x182a('0x84')]===_0x58d204[_0x182a('0x85')]&&_0x538ebb['body']['MessageStatus']&&_0x538ebb[_0x182a('0x57')][_0x182a('0x86')]===_0x182a('0x5c')){return _0x58d204[_0x182a('0x63')]({'read':!![]});}else{logger[_0x182a('0x24')](_0x182a('0x87'),'status','twilio',util[_0x182a('0x88')](_0x538ebb[_0x182a('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x58d204;}})['then'](respondWithResult(_0x4c531e,null))['catch'](handleError(_0x4c531e,null));};
\ No newline at end of file
+var _0x52db=['whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteraction','isNil','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','destroy','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','show','params','intersection','includeAll','options','create','body','update','find','describe','accept'];(function(_0xedd575,_0x170e2a){var _0x28e064=function(_0x1f2563){while(--_0x1f2563){_0xedd575['push'](_0xedd575['shift']());}};_0x28e064(++_0x170e2a);}(_0x52db,0xc7));var _0xb52d=function(_0x520dff,_0xf3f397){_0x520dff=_0x520dff-0x0;var _0x3e44d0=_0x52db[_0x520dff];return _0x3e44d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb52d('0x0'));var zipdir=require(_0xb52d('0x1'));var jsonpatch=require(_0xb52d('0x2'));var rp=require(_0xb52d('0x3'));var moment=require(_0xb52d('0x4'));var BPromise=require(_0xb52d('0x5'));var Mustache=require(_0xb52d('0x6'));var util=require(_0xb52d('0x7'));var path=require('path');var sox=require(_0xb52d('0x8'));var csv=require(_0xb52d('0x9'));var ejs=require(_0xb52d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb52d('0xb'));var squel=require('squel');var crypto=require(_0xb52d('0xc'));var jsforce=require(_0xb52d('0xd'));var deskjs=require(_0xb52d('0xe'));var toCsv=require(_0xb52d('0x9'));var querystring=require(_0xb52d('0xf'));var Papa=require(_0xb52d('0x10'));var Redis=require(_0xb52d('0x11'));var authService=require(_0xb52d('0x12'));var qs=require(_0xb52d('0x13'));var as=require(_0xb52d('0x14'));var hardwareService=require(_0xb52d('0x15'));var logger=require(_0xb52d('0x16'))(_0xb52d('0x17'));var utils=require(_0xb52d('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb52d('0x19'))['db'];config[_0xb52d('0x1a')]=_[_0xb52d('0x1b')](config[_0xb52d('0x1a')],{'host':_0xb52d('0x1c'),'port':0x18eb});var socket=require(_0xb52d('0x1d'))(new Redis(config['redis']));require(_0xb52d('0x1e'))['register'](socket);var jayson=require(_0xb52d('0x1f'));var client=jayson[_0xb52d('0x20')][_0xb52d('0x21')]({'port':0x232c});var client9002=jayson[_0xb52d('0x20')][_0xb52d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x740f11,_0x38db95,_0x5e0eb7,_0x11f703){return new BPromise(function(_0x49ad1a,_0x58e787){var _0x286697=_0x11f703||client;return _0x286697[_0xb52d('0x22')](_0x740f11,_0x5e0eb7)[_0xb52d('0x23')](function(_0x19410b){logger[_0xb52d('0x24')](_0xb52d('0x25'),_0x38db95,'request\x20sent');logger[_0xb52d('0x26')](_0xb52d('0x27'),_0x38db95,_0xb52d('0x28'),JSON['stringify'](_0x19410b));if(_0x19410b[_0xb52d('0x29')]){if(_0x19410b[_0xb52d('0x29')][_0xb52d('0x2a')]===0x1f4){logger[_0xb52d('0x29')](_0xb52d('0x25'),_0x38db95,_0x19410b[_0xb52d('0x29')]['message']);return _0x58e787(_0x19410b[_0xb52d('0x29')][_0xb52d('0x2b')]);}logger[_0xb52d('0x29')](_0xb52d('0x25'),_0x38db95,_0x19410b[_0xb52d('0x29')]['message']);return _0x49ad1a(_0x19410b[_0xb52d('0x29')][_0xb52d('0x2b')]);}else{logger[_0xb52d('0x24')](_0xb52d('0x25'),_0x38db95,'request\x20sent');_0x49ad1a(_0x19410b[_0xb52d('0x2c')][_0xb52d('0x2b')]);}})[_0xb52d('0x2d')](function(_0x387224){logger['error'](_0xb52d('0x25'),_0x38db95,_0x387224);_0x58e787(_0x387224);});});}function respondWithStatusCode(_0x3d9a43,_0x232ffb){_0x232ffb=_0x232ffb||0xcc;return function(_0x37fb18){if(_0x37fb18){return _0x3d9a43[_0xb52d('0x2e')](_0x232ffb);}return _0x3d9a43['status'](_0x232ffb)[_0xb52d('0x2f')]();};}function respondWithResult(_0x5674ef,_0x4d22fc){_0x4d22fc=_0x4d22fc||0xc8;return function(_0x18fc03){if(_0x18fc03){return _0x5674ef[_0xb52d('0x30')](_0x4d22fc)['json'](_0x18fc03);}};}function respondWithFilteredResult(_0x34de4c,_0x383989){return function(_0x95710d){if(_0x95710d){var _0x19e501=typeof _0x383989[_0xb52d('0x31')]===_0xb52d('0x32')&&typeof _0x383989['limit']===_0xb52d('0x32');var _0x133602=_0x95710d[_0xb52d('0x33')];var _0x362c98=_0x19e501?0x0:_0x383989[_0xb52d('0x31')];var _0x239bd3=_0x19e501?_0x95710d[_0xb52d('0x33')]:_0x383989['offset']+_0x383989[_0xb52d('0x34')];var _0x1e6037;if(_0x239bd3>=_0x133602){_0x239bd3=_0x133602;_0x1e6037=0xc8;}else{_0x1e6037=0xce;}_0x34de4c[_0xb52d('0x30')](_0x1e6037);return _0x34de4c[_0xb52d('0x35')](_0xb52d('0x36'),_0x362c98+'-'+_0x239bd3+'/'+_0x133602)[_0xb52d('0x37')](_0x95710d);}return null;};}function patchUpdates(_0x3f520f){return function(_0x2d1c5e){try{jsonpatch[_0xb52d('0x38')](_0x2d1c5e,_0x3f520f,!![]);}catch(_0x74184d){return BPromise[_0xb52d('0x39')](_0x74184d);}return _0x2d1c5e['save']();};}function saveUpdates(_0x27df14,_0x36d2b6){return function(_0x3c8eea){if(_0x3c8eea){return _0x3c8eea['update'](_0x27df14)['then'](function(_0x2a4b98){return _0x2a4b98;});}return null;};}function removeEntity(_0x36a51a,_0x2e58cd){return function(_0x3e88d4){if(_0x3e88d4){return _0x3e88d4[_0xb52d('0x3a')]()['then'](function(){_0x36a51a[_0xb52d('0x30')](0xcc)[_0xb52d('0x2f')]();});}};}function handleEntityNotFound(_0x1e6496,_0x1ce474){return function(_0x30e822){if(!_0x30e822){_0x1e6496[_0xb52d('0x2e')](0x194);}return _0x30e822;};}function handleError(_0x3f9601,_0x43e0d8){_0x43e0d8=_0x43e0d8||0x1f4;return function(_0x3ca470){logger['error'](_0x3ca470[_0xb52d('0x3b')]);if(_0x3ca470[_0xb52d('0x3c')]){delete _0x3ca470[_0xb52d('0x3c')];}_0x3f9601[_0xb52d('0x30')](_0x43e0d8)[_0xb52d('0x3d')](_0x3ca470);};}exports[_0xb52d('0x3e')]=function(_0x23d280,_0x494e33){var _0x5e8b9d={},_0xc27ff={},_0x418e23={'count':0x0,'rows':[]};var _0xf0adb2=_['map'](db[_0xb52d('0x3f')][_0xb52d('0x40')],function(_0x3fd4b9){return{'name':_0x3fd4b9[_0xb52d('0x41')],'type':_0x3fd4b9[_0xb52d('0x42')][_0xb52d('0x43')]};});_0xc27ff[_0xb52d('0x44')]=_[_0xb52d('0x45')](_0xf0adb2,_0xb52d('0x3c'));_0xc27ff[_0xb52d('0x46')]=_[_0xb52d('0x47')](_0x23d280[_0xb52d('0x46')]);_0xc27ff[_0xb52d('0x48')]=_['intersection'](_0xc27ff[_0xb52d('0x44')],_0xc27ff['query']);_0x5e8b9d['attributes']=_['intersection'](_0xc27ff[_0xb52d('0x44')],qs['fields'](_0x23d280[_0xb52d('0x46')][_0xb52d('0x49')]));_0x5e8b9d[_0xb52d('0x4a')]=_0x5e8b9d[_0xb52d('0x4a')][_0xb52d('0x4b')]?_0x5e8b9d[_0xb52d('0x4a')]:_0xc27ff[_0xb52d('0x44')];if(!_0x23d280['query'][_0xb52d('0x4c')](_0xb52d('0x4d'))){_0x5e8b9d[_0xb52d('0x34')]=qs[_0xb52d('0x34')](_0x23d280[_0xb52d('0x46')][_0xb52d('0x34')]);_0x5e8b9d[_0xb52d('0x31')]=qs['offset'](_0x23d280[_0xb52d('0x46')][_0xb52d('0x31')]);}_0x5e8b9d[_0xb52d('0x4e')]=qs[_0xb52d('0x4f')](_0x23d280[_0xb52d('0x46')]['sort']);_0x5e8b9d[_0xb52d('0x50')]=qs[_0xb52d('0x48')](_[_0xb52d('0x51')](_0x23d280[_0xb52d('0x46')],_0xc27ff[_0xb52d('0x48')]),_0xf0adb2);if(_0x23d280[_0xb52d('0x46')][_0xb52d('0x52')]){_0x5e8b9d[_0xb52d('0x50')]=_[_0xb52d('0x53')](_0x5e8b9d['where'],{'$or':_[_0xb52d('0x45')](_0xf0adb2,function(_0x117fdc){if(_0x117fdc['type']!==_0xb52d('0x54')){var _0x39a0bf={};_0x39a0bf[_0x117fdc[_0xb52d('0x3c')]]={'$like':'%'+_0x23d280[_0xb52d('0x46')][_0xb52d('0x52')]+'%'};return _0x39a0bf;}})});}_0x5e8b9d=_[_0xb52d('0x53')]({},_0x5e8b9d,_0x23d280['options']);var _0x50244f={'where':_0x5e8b9d[_0xb52d('0x50')]};return db[_0xb52d('0x3f')]['count'](_0x50244f)['then'](function(_0x405f0c){_0x418e23[_0xb52d('0x33')]=_0x405f0c;if(_0x23d280['query']['includeAll']){_0x5e8b9d[_0xb52d('0x55')]=[{'all':!![]}];}return db[_0xb52d('0x3f')]['findAll'](_0x5e8b9d);})[_0xb52d('0x23')](function(_0x2c666f){_0x418e23['rows']=_0x2c666f;return _0x418e23;})[_0xb52d('0x23')](respondWithFilteredResult(_0x494e33,_0x5e8b9d))['catch'](handleError(_0x494e33,null));};exports[_0xb52d('0x56')]=function(_0x28d374,_0x236e70){var _0x451de1={'raw':!![],'where':{'id':_0x28d374[_0xb52d('0x57')]['id']}},_0x3daae7={};_0x3daae7[_0xb52d('0x44')]=_['keys'](db['WhatsappMessage']['rawAttributes']);_0x3daae7[_0xb52d('0x46')]=_[_0xb52d('0x47')](_0x28d374[_0xb52d('0x46')]);_0x3daae7[_0xb52d('0x48')]=_[_0xb52d('0x58')](_0x3daae7[_0xb52d('0x44')],_0x3daae7['query']);_0x451de1[_0xb52d('0x4a')]=_[_0xb52d('0x58')](_0x3daae7[_0xb52d('0x44')],qs[_0xb52d('0x49')](_0x28d374[_0xb52d('0x46')][_0xb52d('0x49')]));_0x451de1[_0xb52d('0x4a')]=_0x451de1['attributes'][_0xb52d('0x4b')]?_0x451de1[_0xb52d('0x4a')]:_0x3daae7['model'];if(_0x28d374[_0xb52d('0x46')][_0xb52d('0x59')]){_0x451de1[_0xb52d('0x55')]=[{'all':!![]}];}_0x451de1=_[_0xb52d('0x53')]({},_0x451de1,_0x28d374[_0xb52d('0x5a')]);return db['WhatsappMessage']['find'](_0x451de1)['then'](handleEntityNotFound(_0x236e70,null))[_0xb52d('0x23')](respondWithResult(_0x236e70,null))['catch'](handleError(_0x236e70,null));};exports[_0xb52d('0x5b')]=function(_0x520f23,_0x538074){return db['WhatsappMessage'][_0xb52d('0x5b')](_0x520f23[_0xb52d('0x5c')],{})[_0xb52d('0x23')](respondWithResult(_0x538074,0xc9))[_0xb52d('0x2d')](handleError(_0x538074,null));};exports[_0xb52d('0x5d')]=function(_0x4369c2,_0x3c142e){if(_0x4369c2['body']['id']){delete _0x4369c2[_0xb52d('0x5c')]['id'];}return db['WhatsappMessage'][_0xb52d('0x5e')]({'where':{'id':_0x4369c2[_0xb52d('0x57')]['id']}})[_0xb52d('0x23')](handleEntityNotFound(_0x3c142e,null))[_0xb52d('0x23')](saveUpdates(_0x4369c2[_0xb52d('0x5c')],null))[_0xb52d('0x23')](respondWithResult(_0x3c142e,null))[_0xb52d('0x2d')](handleError(_0x3c142e,null));};exports[_0xb52d('0x3a')]=function(_0x1b6827,_0x5602ba){return db['WhatsappMessage'][_0xb52d('0x5e')]({'where':{'id':_0x1b6827[_0xb52d('0x57')]['id']}})['then'](handleEntityNotFound(_0x5602ba,null))['then'](removeEntity(_0x5602ba,null))[_0xb52d('0x2d')](handleError(_0x5602ba,null));};exports[_0xb52d('0x5f')]=function(_0x287c41,_0x3521f4){return db[_0xb52d('0x3f')][_0xb52d('0x5f')]()[_0xb52d('0x23')](respondWithResult(_0x3521f4,null))[_0xb52d('0x2d')](handleError(_0x3521f4,null));};var interaction_log=require(_0xb52d('0x16'))('whatsapp-interactions');exports[_0xb52d('0x60')]=function(_0x477ef8,_0x475f4c,_0x803c82){var _0x37d09a={'agent':{},'channel':_0xb52d('0x61')};if(_0x477ef8[_0xb52d('0x5c')]['id']){delete _0x477ef8[_0xb52d('0x5c')]['id'];}_0x477ef8[_0xb52d('0x5c')]['read']=!![];_0x477ef8[_0xb52d('0x5c')][_0xb52d('0x62')]=moment()['format'](_0xb52d('0x63'));_0x477ef8['body'][_0xb52d('0x64')]=_0x477ef8[_0xb52d('0x5c')][_0xb52d('0x64')]||_0x477ef8['user']['id'];_0x37d09a[_0xb52d('0x65')]['id']=_0x477ef8[_0xb52d('0x5c')][_0xb52d('0x64')];return db[_0xb52d('0x3f')][_0xb52d('0x5e')]({'where':{'id':_0x477ef8[_0xb52d('0x57')]['id'],'UserId':null}})[_0xb52d('0x23')](handleEntityNotFound(_0x475f4c,null))[_0xb52d('0x23')](saveUpdates(_0x477ef8[_0xb52d('0x5c')],null))[_0xb52d('0x23')](function(_0x57b707){if(_0x57b707){_0x37d09a[_0xb52d('0x2b')]=_0x57b707['get']({'plain':!![]});return db[_0xb52d('0x66')][_0xb52d('0x5e')]({'where':{'id':_0x57b707['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x475f4c,null))[_0xb52d('0x23')](function(_0x3663ff){if(_0x3663ff){return _0x3663ff[_0xb52d('0x5d')]({'UserId':_0x477ef8[_0xb52d('0x5c')]['UserId'],'read1stAt':_[_0xb52d('0x67')](_0x3663ff['read1stAt'])?moment()[_0xb52d('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb52d('0x23')](function(_0x4a9e46){if(_0x4a9e46){_0x37d09a[_0xb52d('0x69')]=_0x4a9e46[_0xb52d('0x6a')]({'plain':!![]});interaction_log[_0xb52d('0x24')](_0xb52d('0x6b'),_0x477ef8[_0xb52d('0x6c')]['id'],_0x477ef8[_0xb52d('0x6c')][_0xb52d('0x3c')],_0x477ef8['user'][_0xb52d('0x6d')],_0x37d09a[_0xb52d('0x69')]['id'],_0x477ef8[_0xb52d('0x5c')]?JSON[_0xb52d('0x6e')](_0x477ef8[_0xb52d('0x5c')]):_0xb52d('0x6f'));return respondWithRpcPromise(_0xb52d('0x70'),_0xb52d('0x71'),_0x37d09a);}return null;})['then'](function(_0x39a37c){var _0x2a710a=_0xb52d('0x72')+_0x39a37c[_0xb52d('0x2b')]['ContactId'];return db[_0xb52d('0x73')][_0xb52d('0x46')](_0x2a710a,{'type':db[_0xb52d('0x74')][_0xb52d('0x75')][_0xb52d('0x76')],'raw':!![]})['then'](function(_0x1a0209){return _0x1a0209;});})[_0xb52d('0x23')](function(_0x4cc556){if(_0x4cc556){_0x37d09a[_0xb52d('0x2b')][_0xb52d('0x77')]=_0x4cc556[0x0];if(!_0x477ef8['body']['UserId'])return;return db['User'][_0xb52d('0x5e')]({'where':{'id':_0x477ef8[_0xb52d('0x5c')][_0xb52d('0x64')],'role':_0xb52d('0x65')},'attributes':['id',_0xb52d('0x3c'),_0xb52d('0x78'),_0xb52d('0x79'),_0xb52d('0x7a')],'raw':!![]});}return null;})['then'](function(_0x58d4f4){if(!_0x58d4f4)return null;_0x37d09a['message']['agent']=_0x58d4f4;return _0x37d09a;})['then'](function(_0x70cb48){if(_0x70cb48){if(_0x477ef8[_0xb52d('0x5c')][_0xb52d('0x7b')]){_0x37d09a[_0xb52d('0x2b')][_0xb52d('0x7c')]=util[_0xb52d('0x68')](_0xb52d('0x7d'),_0x477ef8['user'][_0xb52d('0x3c')]);_0x37d09a[_0xb52d('0x2b')]['channel']=_0x37d09a[_0xb52d('0x7e')];_0x37d09a[_0xb52d('0x2b')][_0xb52d('0x7f')]=_0x37d09a[_0xb52d('0x7e')];_0x37d09a[_0xb52d('0x2b')][_0xb52d('0x80')]=_0xb52d('0x60');return respondWithRpcPromise(_0xb52d('0x81'),_0xb52d('0x81'),{'event':_0xb52d('0x82'),'message':_0x37d09a[_0xb52d('0x2b')]},client9002)[_0xb52d('0x23')](function(){return _0x37d09a;});}return _0x37d09a;}return null;})[_0xb52d('0x23')](respondWithResult(_0x475f4c,null))[_0xb52d('0x2d')](handleError(_0x475f4c,null));};var interaction_log=require(_0xb52d('0x16'))('whatsapp-interactions');exports[_0xb52d('0x39')]=function(_0x315d60,_0x3d3d4b,_0x2f561f){var _0x779d7a={'agent':{},'channel':_0xb52d('0x61')};if(_0x315d60['body']['id']){delete _0x315d60[_0xb52d('0x5c')]['id'];}_0x315d60['body'][_0xb52d('0x64')]=_0x315d60[_0xb52d('0x5c')][_0xb52d('0x64')]||_0x315d60[_0xb52d('0x6c')]['id'];_0x779d7a[_0xb52d('0x65')]['id']=_0x315d60[_0xb52d('0x5c')][_0xb52d('0x64')];return db[_0xb52d('0x3f')]['find']({'where':{'id':_0x315d60[_0xb52d('0x57')]['id'],'UserId':null}})[_0xb52d('0x23')](handleEntityNotFound(_0x3d3d4b,null))[_0xb52d('0x23')](function(_0x42e1dd){if(_0x42e1dd){_0x779d7a[_0xb52d('0x2b')]=_0x42e1dd[_0xb52d('0x6a')]({'plain':!![]});return db['WhatsappInteraction'][_0xb52d('0x5e')]({'where':{'id':_0x42e1dd[_0xb52d('0x83')]}});}return null;})['then'](handleEntityNotFound(_0x3d3d4b,null))[_0xb52d('0x23')](function(_0x18539d){if(_0x18539d){_0x779d7a[_0xb52d('0x69')]=_0x18539d[_0xb52d('0x6a')]({'plain':!![]});interaction_log[_0xb52d('0x24')](_0xb52d('0x84'),_0x315d60[_0xb52d('0x6c')]['id'],_0x315d60[_0xb52d('0x6c')][_0xb52d('0x3c')],_0x315d60[_0xb52d('0x6c')][_0xb52d('0x6d')],_0x779d7a[_0xb52d('0x69')]['id'],_0x315d60[_0xb52d('0x5c')]?JSON[_0xb52d('0x6e')](_0x315d60[_0xb52d('0x5c')]):_0xb52d('0x6f'));return respondWithRpcPromise(_0xb52d('0x85'),_0xb52d('0x86'),_0x779d7a);}return null;})['then'](function(_0x2337bd){var _0x2d221c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2337bd[_0xb52d('0x2b')]['ContactId'];return db[_0xb52d('0x73')]['query'](_0x2d221c,{'type':db[_0xb52d('0x74')][_0xb52d('0x75')][_0xb52d('0x76')],'raw':!![]})[_0xb52d('0x23')](function(_0x4125e3){return _0x4125e3;});})[_0xb52d('0x23')](function(_0xafff54){if(_0xafff54){_0x779d7a[_0xb52d('0x2b')]['contact']=_0xafff54[0x0];if(!_0x315d60[_0xb52d('0x5c')][_0xb52d('0x64')])return;return db[_0xb52d('0x87')][_0xb52d('0x5e')]({'where':{'id':_0x315d60['body']['UserId'],'role':_0xb52d('0x65')},'attributes':['id',_0xb52d('0x3c'),_0xb52d('0x78'),_0xb52d('0x79'),_0xb52d('0x7a')],'raw':!![]});}return null;})[_0xb52d('0x23')](function(_0x3196a1){if(!_0x3196a1)return null;_0x779d7a[_0xb52d('0x2b')]['agent']=_0x3196a1;return _0x779d7a;})[_0xb52d('0x23')](function(_0x1abe65){if(_0x1abe65){_0x1abe65[_0xb52d('0x2b')][_0xb52d('0x7c')]=util[_0xb52d('0x68')]('SIP/%s',_0x315d60[_0xb52d('0x6c')][_0xb52d('0x3c')]);_0x1abe65['message'][_0xb52d('0x7e')]=_0x779d7a['channel'];_0x1abe65[_0xb52d('0x2b')][_0xb52d('0x7f')]=_0x779d7a['channel'];_0x1abe65[_0xb52d('0x2b')]['event']=_0xb52d('0x39');respondWithRpcPromise(_0xb52d('0x81'),_0xb52d('0x81'),{'event':_0xb52d('0x88'),'message':_0x1abe65[_0xb52d('0x2b')]},client9002);return _0x779d7a;}return null;})[_0xb52d('0x23')](respondWithResult(_0x3d3d4b,null))[_0xb52d('0x2d')](handleError(_0x3d3d4b,null));};exports[_0xb52d('0x30')]=function(_0x5cffac,_0x55a80a,_0x24e1d6){if(_0x5cffac[_0xb52d('0x5c')]['id']){delete _0x5cffac['body']['id'];}var _0x13c5ea;return db[_0xb52d('0x3f')]['find']({'where':{'id':_0x5cffac[_0xb52d('0x57')]['id']}})[_0xb52d('0x23')](handleEntityNotFound(_0x55a80a,null))[_0xb52d('0x23')](function(_0x5ead30){if(_0x5ead30){_0x13c5ea=_0x5ead30;return db[_0xb52d('0x89')][_0xb52d('0x5e')]({'where':{'id':_0x5ead30[_0xb52d('0x8a')]}});}})[_0xb52d('0x23')](handleEntityNotFound(_0x55a80a,null))['then'](function(_0x2da09c){if(_0x2da09c){logger[_0xb52d('0x26')](_0xb52d('0x8b'),_0xb52d('0x30'),_0xb52d('0x8c'),_0x2da09c[_0xb52d('0x42')],util['inspect'](_0x5cffac[_0xb52d('0x5c')],{'showHidden':![],'depth':null}));switch(_0x2da09c[_0xb52d('0x42')]){case _0xb52d('0x8d'):if(_0x5cffac[_0xb52d('0x5c')]['MessageSid']&&_0x5cffac['body'][_0xb52d('0x8e')]===_0x13c5ea[_0xb52d('0x8f')]&&_0x5cffac[_0xb52d('0x5c')][_0xb52d('0x90')]&&_0x5cffac[_0xb52d('0x5c')]['MessageStatus']===_0xb52d('0x91')){return _0x13c5ea[_0xb52d('0x5d')]({'read':!![]});}else{logger[_0xb52d('0x29')](_0xb52d('0x92'),_0xb52d('0x30'),_0xb52d('0x8d'),util[_0xb52d('0x93')](_0x5cffac[_0xb52d('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x13c5ea;}})[_0xb52d('0x23')](respondWithResult(_0x55a80a,null))[_0xb52d('0x2d')](handleError(_0x55a80a,null));};
\ No newline at end of file
index 0b18730..86ca1f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','save','remove','emit'];(function(_0x4a71ce,_0x27bb91){var _0x439cb6=function(_0x459542){while(--_0x459542){_0x4a71ce['push'](_0x4a71ce['shift']());}};_0x439cb6(++_0x27bb91);}(_0xb10b,0x12a));var _0xbb10=function(_0x52c907,_0x5bb5cb){_0x52c907=_0x52c907-0x0;var _0x568c5a=_0xb10b[_0x52c907];return _0x568c5a;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){WhatsappMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);WhatsappMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];WhatsappMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0xe1e3=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x50514e,_0x118e18){var _0x1f1386=function(_0x369b5e){while(--_0x369b5e){_0x50514e['push'](_0x50514e['shift']());}};_0x1f1386(++_0x118e18);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x107f5b,_0x1288b5){_0x107f5b=_0x107f5b-0x0;var _0x52f1fa=_0xe1e3[_0x107f5b];return _0x52f1fa;};'use strict';var EventEmitter=require(_0x3e1e('0x0'));var WhatsappMessage=require(_0x3e1e('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3e1e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3e1e('0x3')};function emitEvent(_0x4d5360){return function(_0x3bacc,_0x5a11ef,_0x1abd25){WhatsappMessageEvents[_0x3e1e('0x4')](_0x4d5360+':'+_0x3bacc['id'],_0x3bacc);WhatsappMessageEvents[_0x3e1e('0x4')](_0x4d5360,_0x3bacc);_0x1abd25(null);};}for(var e in events){if(events[_0x3e1e('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x3e1e('0x6')]=WhatsappMessageEvents;
\ No newline at end of file
index 933b00b..8fbb337 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe524=['twilio','accountSid','authToken','phone','whatsapp:','remote','/status?token=','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','createdAt','toLowerCase','catch','error','find','WhatsappAccountId','type'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0xe524,0x1d8));var _0x4e52=function(_0x43b38f,_0x15d64f){_0x43b38f=_0x43b38f-0x0;var _0x1f7cfa=_0xe524[_0x43b38f];return _0x1f7cfa;};'use strict';var _=require('lodash');var util=require(_0x4e52('0x0'));var logger=require(_0x4e52('0x1'))(_0x4e52('0x2'));var moment=require(_0x4e52('0x3'));var BPromise=require(_0x4e52('0x4'));var rp=require('request-promise');var fetch=require(_0x4e52('0x5'));var fs=require('fs');var path=require(_0x4e52('0x6'));var rimraf=require(_0x4e52('0x7'));var config=require(_0x4e52('0x8'));var attributes=require(_0x4e52('0x9'));module[_0x4e52('0xa')]=function(_0x30e2af,_0x16cf08){return _0x30e2af['define'](_0x4e52('0xb'),attributes,{'tableName':_0x4e52('0xc'),'paranoid':![],'indexes':[{'name':_0x4e52('0xd'),'fields':[_0x4e52('0xd')]},{'name':_0x4e52('0xe'),'fields':[_0x4e52('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b66e3,_0x206d84,_0x2c9fae){var _0x119405=_0x30e2af[_0x4e52('0x10')];var _0x35ff28=_0x3b66e3['get']({'plain':!![]});if(_0x35ff28[_0x4e52('0x11')]['toLowerCase']()==='in'||_0x35ff28[_0x4e52('0x11')]['toLowerCase']()===_0x4e52('0x12')&&!_0x35ff28[_0x4e52('0x13')]&&!_[_0x4e52('0x14')](_0x35ff28[_0x4e52('0x15')])){_0x119405[_0x4e52('0x16')][_0x4e52('0x17')]({'where':{'id':_0x35ff28['WhatsappInteractionId']}})[_0x4e52('0x18')](function(_0x5a7bce){if(_0x5a7bce){_0x5a7bce['update']({'lastMsgAt':_0x35ff28[_0x4e52('0x19')],'lastMsgDirection':_0x35ff28['direction'][_0x4e52('0x1a')]()});}})[_0x4e52('0x1b')](function(_0x1eb9a4){console[_0x4e52('0x1c')](_0x1eb9a4);});}if(_0x35ff28['direction']===_0x4e52('0x12')&&!_0x35ff28[_0x4e52('0x13')]){var _0x3fc06b;_0x119405['WhatsappAccount'][_0x4e52('0x1d')]({'where':{'id':_0x35ff28[_0x4e52('0x1e')]},'raw':!![]})[_0x4e52('0x18')](function(_0x3a6342){_0x3fc06b=_0x3a6342;if(_0x3fc06b&&_0x3fc06b[_0x4e52('0x1f')]){switch(_0x3fc06b[_0x4e52('0x1f')]){case _0x4e52('0x20'):var _0x426068=require(_0x4e52('0x20'));if(_0x3fc06b[_0x4e52('0x21')]&&_0x3fc06b[_0x4e52('0x22')]&&_0x3fc06b[_0x4e52('0x23')]){var _0x570901=new _0x426068(_0x3fc06b['accountSid'],_0x3fc06b['authToken']);_0x570901['messages']['create']({'body':_0x35ff28['body'],'to':_0x4e52('0x24')+_0x35ff28[_0x4e52('0x23')],'from':_0x4e52('0x24')+_0x3fc06b[_0x4e52('0x23')],'statusCallback':_0x3fc06b[_0x4e52('0x25')]+'/api/whatsapp/messages/'+_0x35ff28['id']+_0x4e52('0x26')+_0x3fc06b['token']})[_0x4e52('0x18')](function(_0x1c06bc){if(_0x1c06bc[_0x4e52('0x27')]){return _0x3b66e3[_0x4e52('0x28')]({'messageId':_0x1c06bc[_0x4e52('0x27')]});}})[_0x4e52('0x1b')](function(_0x52f8f8){logger[_0x4e52('0x1c')](_0x4e52('0x29'),_0x4e52('0x2a'),_0x4e52('0x20'),util[_0x4e52('0x2b')](_0x52f8f8,{'showHidden':![],'depth':null}));});}else{logger[_0x4e52('0x1c')](_0x4e52('0x29'),_0x4e52('0x2a'),_0x4e52('0x20'),_0x4e52('0x2c'));}break;case _0x4e52('0x2d'):var _0x32923c=_0x3fc06b[_0x4e52('0x21')];var _0x3e1888=_0x3fc06b[_0x4e52('0x22')];var _0x3d65eb=_0x3fc06b[_0x4e52('0x2e')]+_0x4e52('0x2f')+_0x32923c+_0x4e52('0x30');var _0x515bfa={'to':[_0x35ff28[_0x4e52('0x23')]],'message':{'type':_0x4e52('0x31'),'text':_0x35ff28['body']}};var _0x1a3992={'method':'POST','uri':_0x3d65eb,'headers':{'Authorization':_0x4e52('0x32')+_0x3e1888,'Content-Type':'application/json'},'body':_0x515bfa,'json':!![]};rp(_0x1a3992)[_0x4e52('0x18')](function(_0x45efd5){if(_0x45efd5[_0x4e52('0x33')][0x0][_0x4e52('0x34')]){return _0x3b66e3[_0x4e52('0x28')]({'messageId':_0x45efd5['statuses'][0x0][_0x4e52('0x34')]});}})[_0x4e52('0x1b')](function(_0xe1416d){logger['err'](_0x4e52('0x35'),_0xe1416d);});break;}}})[_0x4e52('0x36')](function(){_0x2c9fae();});}else{_0x2c9fae();}}},'charset':'utf8mb4','collate':_0x4e52('0x37')});};
\ No newline at end of file
+var _0xd5bf=['FULLTEXT','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','error','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','body'];(function(_0x1c60bd,_0x207c9b){var _0xc46ef9=function(_0x271c57){while(--_0x271c57){_0x1c60bd['push'](_0x1c60bd['shift']());}};_0xc46ef9(++_0x207c9b);}(_0xd5bf,0x66));var _0xfd5b=function(_0x271685,_0x2eeb77){_0x271685=_0x271685-0x0;var _0x18cca8=_0xd5bf[_0x271685];return _0x18cca8;};'use strict';var _=require(_0xfd5b('0x0'));var util=require(_0xfd5b('0x1'));var logger=require(_0xfd5b('0x2'))(_0xfd5b('0x3'));var moment=require(_0xfd5b('0x4'));var BPromise=require(_0xfd5b('0x5'));var rp=require(_0xfd5b('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require(_0xfd5b('0x7'));var config=require(_0xfd5b('0x8'));var attributes=require(_0xfd5b('0x9'));module['exports']=function(_0x5f079a,_0x2c61da){return _0x5f079a[_0xfd5b('0xa')](_0xfd5b('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xfd5b('0xc'),'fields':[_0xfd5b('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0xfd5b('0xd')],'type':_0xfd5b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5eefe8,_0x20222a,_0x56e7e7){var _0x29ee53=_0x5f079a['models'];var _0x18fb9b=_0x5eefe8['get']({'plain':!![]});if(_0x18fb9b[_0xfd5b('0xf')][_0xfd5b('0x10')]()==='in'||_0x18fb9b['direction']['toLowerCase']()===_0xfd5b('0x11')&&!_0x18fb9b[_0xfd5b('0x12')]&&!_['isNil'](_0x18fb9b[_0xfd5b('0x13')])){_0x29ee53[_0xfd5b('0x14')][_0xfd5b('0x15')]({'where':{'id':_0x18fb9b[_0xfd5b('0x16')]}})[_0xfd5b('0x17')](function(_0x3b6ea7){if(_0x3b6ea7){_0x3b6ea7[_0xfd5b('0x18')]({'lastMsgAt':_0x18fb9b[_0xfd5b('0x19')],'lastMsgDirection':_0x18fb9b[_0xfd5b('0xf')][_0xfd5b('0x10')]()});}})['catch'](function(_0x42c653){console[_0xfd5b('0x1a')](_0x42c653);});}if(_0x18fb9b[_0xfd5b('0xf')]===_0xfd5b('0x11')&&!_0x18fb9b['secret']){var _0x2e2a4d;_0x29ee53['WhatsappAccount']['find']({'where':{'id':_0x18fb9b[_0xfd5b('0x1b')]},'raw':!![]})[_0xfd5b('0x17')](function(_0x4bd45e){_0x2e2a4d=_0x4bd45e;if(_0x2e2a4d&&_0x2e2a4d[_0xfd5b('0x1c')]){switch(_0x2e2a4d[_0xfd5b('0x1c')]){case'twilio':var _0x4bc6fd=require(_0xfd5b('0x1d'));if(_0x2e2a4d[_0xfd5b('0x1e')]&&_0x2e2a4d[_0xfd5b('0x1f')]&&_0x2e2a4d[_0xfd5b('0x20')]){var _0x3bac94=new _0x4bc6fd(_0x2e2a4d['accountSid'],_0x2e2a4d[_0xfd5b('0x1f')]);_0x3bac94[_0xfd5b('0x21')][_0xfd5b('0x22')]({'body':_0x18fb9b[_0xfd5b('0xd')],'to':_0xfd5b('0x23')+_0x18fb9b[_0xfd5b('0x20')],'from':_0xfd5b('0x23')+_0x2e2a4d[_0xfd5b('0x20')],'statusCallback':_0x2e2a4d[_0xfd5b('0x24')]+_0xfd5b('0x25')+_0x18fb9b['id']+_0xfd5b('0x26')+_0x2e2a4d[_0xfd5b('0x27')]})[_0xfd5b('0x17')](function(_0x17e0fe){if(_0x17e0fe[_0xfd5b('0x28')]){return _0x5eefe8[_0xfd5b('0x18')]({'messageId':_0x17e0fe['sid']});}})[_0xfd5b('0x29')](function(_0x44f7e1){logger[_0xfd5b('0x1a')](_0xfd5b('0x2a'),_0xfd5b('0x2b'),_0xfd5b('0x1d'),util[_0xfd5b('0x2c')](_0x44f7e1,{'showHidden':![],'depth':null}));});}else{logger[_0xfd5b('0x1a')](_0xfd5b('0x2a'),_0xfd5b('0x2b'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xfd5b('0x2d'):var _0x3907df=_0x2e2a4d['accountSid'];var _0x46fd6d=_0x2e2a4d[_0xfd5b('0x1f')];var _0x4f80f5=_0x2e2a4d[_0xfd5b('0x2e')]+_0xfd5b('0x2f')+_0x3907df+_0xfd5b('0x30');var _0x43c66d={'to':[_0x18fb9b['phone']],'message':{'type':_0xfd5b('0x31'),'text':_0x18fb9b[_0xfd5b('0xd')]}};var _0x17f26f={'method':_0xfd5b('0x32'),'uri':_0x4f80f5,'headers':{'Authorization':_0xfd5b('0x33')+_0x46fd6d,'Content-Type':'application/json'},'body':_0x43c66d,'json':!![]};rp(_0x17f26f)[_0xfd5b('0x17')](function(_0xfe60e6){if(_0xfe60e6[_0xfd5b('0x34')][0x0][_0xfd5b('0x35')]){return _0x5eefe8[_0xfd5b('0x18')]({'messageId':_0xfe60e6['statuses'][0x0][_0xfd5b('0x35')]});}})[_0xfd5b('0x29')](function(_0x1b892b){logger['err'](_0xfd5b('0x36'),_0x1b892b);});break;}}})[_0xfd5b('0x37')](function(){_0x56e7e7();});}else{_0x56e7e7();}}},'charset':_0xfd5b('0x38'),'collate':_0xfd5b('0x39')});};
\ No newline at end of file
index 93ab9c7..c97b201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1295=['client','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3db948,_0x190742){var _0x380de7=function(_0x3dda9e){while(--_0x3dda9e){_0x3db948['push'](_0x3db948['shift']());}};_0x380de7(++_0x190742);}(_0x1295,0x8a));var _0x5129=function(_0x440938,_0x405b36){_0x440938=_0x440938-0x0;var _0x512a8c=_0x1295[_0x440938];return _0x512a8c;};'use strict';var _=require(_0x5129('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5129('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5129('0x2'))['db'];var utils=require(_0x5129('0x3'));var logger=require(_0x5129('0x4'))('rpc');var config=require(_0x5129('0x5'));var jayson=require(_0x5129('0x6'));var client=jayson[_0x5129('0x7')]['http']({'port':0x232a});config[_0x5129('0x8')]=_[_0x5129('0x9')](config[_0x5129('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x5129('0xa'))(new Redis(config['redis']));require(_0x5129('0xb'))[_0x5129('0xc')](socket);function respondWithRpcPromise(_0x490af5,_0x129fce,_0x3d28c4){return new BPromise(function(_0x3c25bc,_0x3f7a9b){return client[_0x5129('0xd')](_0x490af5,_0x3d28c4)[_0x5129('0xe')](function(_0x15a093){logger[_0x5129('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x129fce,'request\x20sent');logger[_0x5129('0x10')](_0x5129('0x11'),_0x129fce,_0x5129('0x12'),JSON[_0x5129('0x13')](_0x15a093));if(_0x15a093['error']){if(_0x15a093[_0x5129('0x14')]['code']===0x1f4){logger[_0x5129('0x14')](_0x5129('0x15'),_0x129fce,_0x15a093[_0x5129('0x14')]['message']);return _0x3f7a9b(_0x15a093[_0x5129('0x14')][_0x5129('0x16')]);}logger[_0x5129('0x14')](_0x5129('0x15'),_0x129fce,_0x15a093['error']['message']);return _0x3c25bc(_0x15a093[_0x5129('0x14')][_0x5129('0x16')]);}else{logger['info'](_0x5129('0x15'),_0x129fce,_0x5129('0x12'));_0x3c25bc(_0x15a093['result'][_0x5129('0x16')]);}})[_0x5129('0x17')](function(_0x4d9a43){logger[_0x5129('0x14')](_0x5129('0x15'),_0x129fce,_0x4d9a43);_0x3f7a9b(_0x4d9a43);});});}exports[_0x5129('0x18')]=function(_0x11a11a){var _0x105629=this;return new Promise(function(_0x55bfe0,_0x2abf02){return db[_0x5129('0x19')][_0x5129('0x1a')](_0x11a11a['body'],{'raw':_0x11a11a['options']?_0x11a11a[_0x5129('0x1b')][_0x5129('0x1c')]===undefined?!![]:![]:!![]})[_0x5129('0xe')](function(_0x4646e8){logger['info']('CreateWhatsappMessage',_0x11a11a);logger['debug'](_0x5129('0x18'),_0x11a11a,JSON['stringify'](_0x4646e8));_0x55bfe0(_0x4646e8);})[_0x5129('0x17')](function(_0x5a3f8d){logger[_0x5129('0x14')](_0x5129('0x18'),_0x5a3f8d[_0x5129('0x16')],_0x11a11a);_0x2abf02(_0x105629[_0x5129('0x14')](0x1f4,_0x5a3f8d[_0x5129('0x16')]));});});};
\ No newline at end of file
+var _0xa4f6=['message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x304bd5,_0xea943d){var _0x2bcd87=function(_0x53d3c5){while(--_0x53d3c5){_0x304bd5['push'](_0x304bd5['shift']());}};_0x2bcd87(++_0xea943d);}(_0xa4f6,0x6b));var _0x6a4f=function(_0x4f8518,_0xcd7bea){_0x4f8518=_0x4f8518-0x0;var _0x143fff=_0xa4f6[_0x4f8518];return _0x143fff;};'use strict';var _=require(_0x6a4f('0x0'));var util=require(_0x6a4f('0x1'));var moment=require('moment');var BPromise=require(_0x6a4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a4f('0x3'))['db'];var utils=require(_0x6a4f('0x4'));var logger=require(_0x6a4f('0x5'))(_0x6a4f('0x6'));var config=require(_0x6a4f('0x7'));var jayson=require(_0x6a4f('0x8'));var client=jayson[_0x6a4f('0x9')]['http']({'port':0x232a});config[_0x6a4f('0xa')]=_[_0x6a4f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6a4f('0xc'))(new Redis(config[_0x6a4f('0xa')]));require(_0x6a4f('0xd'))[_0x6a4f('0xe')](socket);function respondWithRpcPromise(_0x3a4500,_0xd5fd4,_0x277320){return new BPromise(function(_0x357f46,_0x133eda){return client[_0x6a4f('0xf')](_0x3a4500,_0x277320)['then'](function(_0x4bf5c4){logger['info'](_0x6a4f('0x10'),_0xd5fd4,_0x6a4f('0x11'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xd5fd4,_0x6a4f('0x11'),JSON[_0x6a4f('0x12')](_0x4bf5c4));if(_0x4bf5c4[_0x6a4f('0x13')]){if(_0x4bf5c4[_0x6a4f('0x13')][_0x6a4f('0x14')]===0x1f4){logger[_0x6a4f('0x13')](_0x6a4f('0x10'),_0xd5fd4,_0x4bf5c4[_0x6a4f('0x13')][_0x6a4f('0x15')]);return _0x133eda(_0x4bf5c4[_0x6a4f('0x13')][_0x6a4f('0x15')]);}logger[_0x6a4f('0x13')](_0x6a4f('0x10'),_0xd5fd4,_0x4bf5c4[_0x6a4f('0x13')][_0x6a4f('0x15')]);return _0x357f46(_0x4bf5c4[_0x6a4f('0x13')][_0x6a4f('0x15')]);}else{logger[_0x6a4f('0x16')](_0x6a4f('0x10'),_0xd5fd4,'request\x20sent');_0x357f46(_0x4bf5c4[_0x6a4f('0x17')][_0x6a4f('0x15')]);}})[_0x6a4f('0x18')](function(_0x29ec49){logger[_0x6a4f('0x13')](_0x6a4f('0x10'),_0xd5fd4,_0x29ec49);_0x133eda(_0x29ec49);});});}exports[_0x6a4f('0x19')]=function(_0x4f1f4f){var _0xc5dc7f=this;return new Promise(function(_0x3679a0,_0x52e384){return db[_0x6a4f('0x1a')][_0x6a4f('0x1b')](_0x4f1f4f[_0x6a4f('0x1c')],{'raw':_0x4f1f4f[_0x6a4f('0x1d')]?_0x4f1f4f[_0x6a4f('0x1d')][_0x6a4f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x24eacb){logger[_0x6a4f('0x16')](_0x6a4f('0x19'),_0x4f1f4f);logger[_0x6a4f('0x1f')](_0x6a4f('0x19'),_0x4f1f4f,JSON[_0x6a4f('0x12')](_0x24eacb));_0x3679a0(_0x24eacb);})['catch'](function(_0x43fdf9){logger['error'](_0x6a4f('0x19'),_0x43fdf9['message'],_0x4f1f4f);_0x52e384(_0xc5dc7f['error'](0x1f4,_0x43fdf9['message']));});});};
\ No newline at end of file
index 2c907a8..c311852 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64dc=['emit','removeListener','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x187b47,_0x5349cc){var _0x7f0737=function(_0x19b1e4){while(--_0x19b1e4){_0x187b47['push'](_0x187b47['shift']());}};_0x7f0737(++_0x5349cc);}(_0x64dc,0x19a));var _0xc64d=function(_0x513513,_0x1f35a7){_0x513513=_0x513513-0x0;var _0x111b69=_0x64dc[_0x513513];return _0x111b69;};'use strict';var WhatsappMessageEvents=require(_0xc64d('0x0'));var events=[_0xc64d('0x1'),_0xc64d('0x2'),'update'];function createListener(_0x24ba66,_0x5e119d){return function(_0x299457){_0x5e119d[_0xc64d('0x3')](_0x24ba66,_0x299457);};}function removeListener(_0x46a868,_0x47fd61){return function(){WhatsappMessageEvents[_0xc64d('0x4')](_0x46a868,_0x47fd61);};}exports['register']=function(_0x4124fc){for(var _0x3537db=0x0,_0x223f1b=events[_0xc64d('0x5')];_0x3537db<_0x223f1b;_0x3537db++){var _0x54bc75=events[_0x3537db];var _0x42e1a9=createListener(_0xc64d('0x6')+_0x54bc75,_0x4124fc);WhatsappMessageEvents['on'](_0x54bc75,_0x42e1a9);}};
\ No newline at end of file
+var _0x114e=['save','remove','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x2293ed,_0xa62e95){var _0xe780be=function(_0x599d44){while(--_0x599d44){_0x2293ed['push'](_0x2293ed['shift']());}};_0xe780be(++_0xa62e95);}(_0x114e,0x1d8));var _0xe114=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x114e[_0x40a045];return _0x1a687c;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xe114('0x0'),_0xe114('0x1'),_0xe114('0x2')];function createListener(_0xbb860e,_0x149106){return function(_0x506db5){_0x149106[_0xe114('0x3')](_0xbb860e,_0x506db5);};}function removeListener(_0x3395fe,_0x4cc9ad){return function(){WhatsappMessageEvents[_0xe114('0x4')](_0x3395fe,_0x4cc9ad);};}exports[_0xe114('0x5')]=function(_0x50ac16){for(var _0x170776=0x0,_0x2dd0df=events[_0xe114('0x6')];_0x170776<_0x2dd0df;_0x170776++){var _0x160823=events[_0x170776];var _0x2c671b=createListener(_0xe114('0x7')+_0x160823,_0x50ac16);WhatsappMessageEvents['on'](_0x160823,_0x2c671b);}};
\ No newline at end of file
index fea93f8..9a5279c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5329=['/:id/members','getMembers','/:id/teams','getTeams','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x2e3047,_0x498eec){var _0x42077c=function(_0x19799b){while(--_0x19799b){_0x2e3047['push'](_0x2e3047['shift']());}};_0x42077c(++_0x498eec);}(_0x5329,0x130));var _0x9532=function(_0x4d8445,_0xb3a6e8){_0x4d8445=_0x4d8445-0x0;var _0x571340=_0x5329[_0x4d8445];return _0x571340;};'use strict';var multer=require(_0x9532('0x0'));var util=require(_0x9532('0x1'));var path=require('path');var timeout=require(_0x9532('0x2'));var express=require('express');var router=express[_0x9532('0x3')]();var fs_extra=require(_0x9532('0x4'));var auth=require(_0x9532('0x5'));var interaction=require(_0x9532('0x6'));var config=require(_0x9532('0x7'));var controller=require(_0x9532('0x8'));router[_0x9532('0x9')]('/',auth['isAuthenticated'](),controller[_0x9532('0xa')]);router[_0x9532('0x9')](_0x9532('0xb'),auth[_0x9532('0xc')](),controller[_0x9532('0xd')]);router['get']('/:id',auth[_0x9532('0xc')](),controller[_0x9532('0xe')]);router[_0x9532('0x9')](_0x9532('0xf'),auth[_0x9532('0xc')](),controller[_0x9532('0x10')]);router[_0x9532('0x9')](_0x9532('0x11'),auth[_0x9532('0xc')](),controller[_0x9532('0x12')]);router[_0x9532('0x9')]('/:id/users',auth[_0x9532('0xc')](),controller['getAgents']);router[_0x9532('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9532('0x13')](_0x9532('0x11'),auth[_0x9532('0xc')](),controller[_0x9532('0x14')]);router['post']('/:id/users',auth[_0x9532('0xc')](),controller[_0x9532('0x15')]);router[_0x9532('0x16')](_0x9532('0x17'),auth[_0x9532('0xc')](),controller[_0x9532('0x18')]);router[_0x9532('0x19')](_0x9532('0x17'),auth[_0x9532('0xc')](),controller[_0x9532('0x1a')]);router['delete'](_0x9532('0x11'),auth[_0x9532('0xc')](),controller['removeTeams']);router[_0x9532('0x19')]('/:id/users',auth[_0x9532('0xc')](),controller[_0x9532('0x1b')]);module[_0x9532('0x1c')]=router;
\ No newline at end of file
+var _0x43c2=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy'];(function(_0x3420f1,_0x3a85e3){var _0x429a67=function(_0x354c9c){while(--_0x354c9c){_0x3420f1['push'](_0x3420f1['shift']());}};_0x429a67(++_0x3a85e3);}(_0x43c2,0xbc));var _0x243c=function(_0x4191e3,_0x55abdc){_0x4191e3=_0x4191e3-0x0;var _0x17df1d=_0x43c2[_0x4191e3];return _0x17df1d;};'use strict';var multer=require(_0x243c('0x0'));var util=require(_0x243c('0x1'));var path=require(_0x243c('0x2'));var timeout=require(_0x243c('0x3'));var express=require(_0x243c('0x4'));var router=express[_0x243c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x243c('0x6'));var interaction=require(_0x243c('0x7'));var config=require(_0x243c('0x8'));var controller=require(_0x243c('0x9'));router[_0x243c('0xa')]('/',auth[_0x243c('0xb')](),controller[_0x243c('0xc')]);router[_0x243c('0xa')](_0x243c('0xd'),auth[_0x243c('0xb')](),controller[_0x243c('0xe')]);router[_0x243c('0xa')](_0x243c('0xf'),auth[_0x243c('0xb')](),controller[_0x243c('0x10')]);router[_0x243c('0xa')](_0x243c('0x11'),auth[_0x243c('0xb')](),controller['getMembers']);router[_0x243c('0xa')](_0x243c('0x12'),auth['isAuthenticated'](),controller['getTeams']);router[_0x243c('0xa')]('/:id/users',auth[_0x243c('0xb')](),controller[_0x243c('0x13')]);router[_0x243c('0x14')]('/',auth[_0x243c('0xb')](),controller[_0x243c('0x15')]);router[_0x243c('0x14')](_0x243c('0x12'),auth[_0x243c('0xb')](),controller[_0x243c('0x16')]);router[_0x243c('0x14')](_0x243c('0x17'),auth[_0x243c('0xb')](),controller[_0x243c('0x18')]);router[_0x243c('0x19')](_0x243c('0xf'),auth[_0x243c('0xb')](),controller[_0x243c('0x1a')]);router[_0x243c('0x1b')](_0x243c('0xf'),auth[_0x243c('0xb')](),controller[_0x243c('0x1c')]);router[_0x243c('0x1b')](_0x243c('0x12'),auth[_0x243c('0xb')](),controller['removeTeams']);router[_0x243c('0x1b')](_0x243c('0x17'),auth[_0x243c('0xb')](),controller[_0x243c('0x1d')]);module[_0x243c('0x1e')]=router;
\ No newline at end of file
index 912a6f7..b718e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffaa=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0x5737ee,_0x27c4e1){var _0x40feb4=function(_0x577214){while(--_0x577214){_0x5737ee['push'](_0x5737ee['shift']());}};_0x40feb4(++_0x27c4e1);}(_0xffaa,0x130));var _0xaffa=function(_0x4de066,_0x1da16e){_0x4de066=_0x4de066-0x0;var _0xbcb9ff=_0xffaa[_0x4de066];return _0xbcb9ff;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'name':{'type':Sequelize[_0xaffa('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaffa('0x3')](_0xaffa('0x4'),_0xaffa('0x5'),_0xaffa('0x6'))},'description':{'type':Sequelize[_0xaffa('0x2')]}};
\ No newline at end of file
+var _0xb63f=['beepall','roundrobin','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x18f937,_0x3fe81b){var _0x287672=function(_0x26742d){while(--_0x26742d){_0x18f937['push'](_0x18f937['shift']());}};_0x287672(++_0x3fe81b);}(_0xb63f,0xa3));var _0xfb63=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0xb63f[_0x44b7d6];return _0x5346f0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfb63('0x0')],'unique':_0xfb63('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfb63('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb63('0x3')](_0xfb63('0x4'),_0xfb63('0x5'),_0xfb63('0x6'))},'description':{'type':Sequelize[_0xfb63('0x0')]}};
\ No newline at end of file
index cfe1bb4..c307391 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14d1=['sequelize','addTeams','each','forEach','userWhatsappQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','isEmpty','emit','userWhatsappQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','WhatsappQueue','findAll','catch','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','ids','Team','voicePause','interface'];(function(_0x4b6abc,_0x2e2664){var _0x34b242=function(_0x13f114){while(--_0x13f114){_0x4b6abc['push'](_0x4b6abc['shift']());}};_0x34b242(++_0x2e2664);}(_0x14d1,0xac));var _0x114d=function(_0x5d1a2d,_0x17ade6){_0x5d1a2d=_0x5d1a2d-0x0;var _0x2b6c56=_0x14d1[_0x5d1a2d];return _0x2b6c56;};'use strict';var emlformat=require(_0x114d('0x0'));var rimraf=require(_0x114d('0x1'));var zipdir=require(_0x114d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x114d('0x3'));var moment=require('moment');var BPromise=require(_0x114d('0x4'));var Mustache=require('mustache');var util=require(_0x114d('0x5'));var path=require(_0x114d('0x6'));var sox=require(_0x114d('0x7'));var csv=require('to-csv');var ejs=require(_0x114d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x114d('0x9'));var squel=require(_0x114d('0xa'));var crypto=require(_0x114d('0xb'));var jsforce=require(_0x114d('0xc'));var deskjs=require(_0x114d('0xd'));var toCsv=require(_0x114d('0xe'));var querystring=require(_0x114d('0xf'));var Papa=require(_0x114d('0x10'));var Redis=require(_0x114d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x114d('0x12'));var as=require(_0x114d('0x13'));var hardwareService=require(_0x114d('0x14'));var logger=require('../../config/logger')(_0x114d('0x15'));var utils=require(_0x114d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x114d('0x17'))['db'];config[_0x114d('0x18')]=_[_0x114d('0x19')](config[_0x114d('0x18')],{'host':_0x114d('0x1a'),'port':0x18eb});var socket=require(_0x114d('0x1b'))(new Redis(config[_0x114d('0x18')]));require(_0x114d('0x1c'))[_0x114d('0x1d')](socket);function respondWithStatusCode(_0x1b7d49,_0x332f1d){_0x332f1d=_0x332f1d||0xcc;return function(_0x2e2bea){if(_0x2e2bea){return _0x1b7d49[_0x114d('0x1e')](_0x332f1d);}return _0x1b7d49[_0x114d('0x1f')](_0x332f1d)['end']();};}function respondWithResult(_0x674fa8,_0x253a9c){_0x253a9c=_0x253a9c||0xc8;return function(_0x34d913){if(_0x34d913){return _0x674fa8[_0x114d('0x1f')](_0x253a9c)[_0x114d('0x20')](_0x34d913);}};}function respondWithFilteredResult(_0x35028a,_0x40b232){return function(_0x45ad73){if(_0x45ad73){var _0x1f8e89=typeof _0x40b232[_0x114d('0x21')]===_0x114d('0x22')&&typeof _0x40b232['limit']===_0x114d('0x22');var _0x3cee2e=_0x45ad73[_0x114d('0x23')];var _0x4f6c1f=_0x1f8e89?0x0:_0x40b232[_0x114d('0x21')];var _0x3c51e0=_0x1f8e89?_0x45ad73[_0x114d('0x23')]:_0x40b232[_0x114d('0x21')]+_0x40b232[_0x114d('0x24')];var _0x28bd9e;if(_0x3c51e0>=_0x3cee2e){_0x3c51e0=_0x3cee2e;_0x28bd9e=0xc8;}else{_0x28bd9e=0xce;}_0x35028a[_0x114d('0x1f')](_0x28bd9e);return _0x35028a[_0x114d('0x25')](_0x114d('0x26'),_0x4f6c1f+'-'+_0x3c51e0+'/'+_0x3cee2e)[_0x114d('0x20')](_0x45ad73);}return null;};}function patchUpdates(_0x2ec016){return function(_0x140e84){try{jsonpatch[_0x114d('0x27')](_0x140e84,_0x2ec016,!![]);}catch(_0x15a31d){return BPromise[_0x114d('0x28')](_0x15a31d);}return _0x140e84[_0x114d('0x29')]();};}function saveUpdates(_0x6fa29d,_0x3110da){return function(_0x4060fe){if(_0x4060fe){return _0x4060fe[_0x114d('0x2a')](_0x6fa29d)[_0x114d('0x2b')](function(_0x53ce13){return _0x53ce13;});}return null;};}function removeEntity(_0x2bd3b6,_0x5e3605){return function(_0x4e3f79){if(_0x4e3f79){return _0x4e3f79[_0x114d('0x2c')]()['then'](function(){var _0x1a748a=_0x4e3f79[_0x114d('0x2d')]({'plain':!![]});var _0x2e498d=_0x114d('0x2e');return db[_0x114d('0x2f')][_0x114d('0x2c')]({'where':{'type':_0x2e498d,'resourceId':_0x1a748a['id']}})[_0x114d('0x2b')](function(){return _0x4e3f79;});})[_0x114d('0x2b')](function(){_0x2bd3b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7a0f,_0x32c62c){return function(_0x179b60){if(!_0x179b60){_0x2c7a0f[_0x114d('0x1e')](0x194);}return _0x179b60;};}function handleError(_0xdf2e08,_0x59b261){_0x59b261=_0x59b261||0x1f4;return function(_0x329295){logger[_0x114d('0x30')](_0x329295['stack']);if(_0x329295[_0x114d('0x31')]){delete _0x329295['name'];}_0xdf2e08[_0x114d('0x1f')](_0x59b261)[_0x114d('0x32')](_0x329295);};}exports[_0x114d('0x33')]=function(_0x471fea,_0x5a8657){var _0x384488={},_0x19ab0f={},_0x2728fe={'count':0x0,'rows':[]};var _0x404778=_[_0x114d('0x34')](db['WhatsappQueue'][_0x114d('0x35')],function(_0x493ef3){return{'name':_0x493ef3['fieldName'],'type':_0x493ef3['type'][_0x114d('0x36')]};});_0x19ab0f[_0x114d('0x37')]=_[_0x114d('0x34')](_0x404778,_0x114d('0x31'));_0x19ab0f[_0x114d('0x38')]=_[_0x114d('0x39')](_0x471fea[_0x114d('0x38')]);_0x19ab0f[_0x114d('0x3a')]=_[_0x114d('0x3b')](_0x19ab0f[_0x114d('0x37')],_0x19ab0f[_0x114d('0x38')]);_0x384488[_0x114d('0x3c')]=_[_0x114d('0x3b')](_0x19ab0f[_0x114d('0x37')],qs[_0x114d('0x3d')](_0x471fea[_0x114d('0x38')][_0x114d('0x3d')]));_0x384488['attributes']=_0x384488[_0x114d('0x3c')][_0x114d('0x3e')]?_0x384488['attributes']:_0x19ab0f[_0x114d('0x37')];if(!_0x471fea[_0x114d('0x38')]['hasOwnProperty'](_0x114d('0x3f'))){_0x384488[_0x114d('0x24')]=qs[_0x114d('0x24')](_0x471fea[_0x114d('0x38')][_0x114d('0x24')]);_0x384488[_0x114d('0x21')]=qs[_0x114d('0x21')](_0x471fea[_0x114d('0x38')][_0x114d('0x21')]);}_0x384488[_0x114d('0x40')]=qs[_0x114d('0x41')](_0x471fea[_0x114d('0x38')]['sort']);_0x384488[_0x114d('0x42')]=qs['filters'](_[_0x114d('0x43')](_0x471fea[_0x114d('0x38')],_0x19ab0f['filters']),_0x404778);if(_0x471fea[_0x114d('0x38')]['filter']){_0x384488[_0x114d('0x42')]=_[_0x114d('0x44')](_0x384488[_0x114d('0x42')],{'$or':_[_0x114d('0x34')](_0x404778,function(_0x7e9c53){if(_0x7e9c53['type']!==_0x114d('0x45')){var _0x2c3bdb={};_0x2c3bdb[_0x7e9c53['name']]={'$like':'%'+_0x471fea[_0x114d('0x38')][_0x114d('0x46')]+'%'};return _0x2c3bdb;}})});}_0x384488=_[_0x114d('0x44')]({},_0x384488,_0x471fea['options']);var _0x2ea64a={'where':_0x384488['where']};return db['WhatsappQueue'][_0x114d('0x23')](_0x2ea64a)[_0x114d('0x2b')](function(_0x370cec){_0x2728fe[_0x114d('0x23')]=_0x370cec;if(_0x471fea[_0x114d('0x38')][_0x114d('0x47')]){_0x384488[_0x114d('0x48')]=[{'all':!![]}];}return db[_0x114d('0x49')][_0x114d('0x4a')](_0x384488);})[_0x114d('0x2b')](function(_0x1369dc){_0x2728fe['rows']=_0x1369dc;return _0x2728fe;})[_0x114d('0x2b')](respondWithFilteredResult(_0x5a8657,_0x384488))[_0x114d('0x4b')](handleError(_0x5a8657,null));};exports['show']=function(_0x2a4de3,_0x2c5121){var _0x5cfee0={'raw':!![],'where':{'id':_0x2a4de3['params']['id']}},_0x17f544={};_0x17f544['model']=_[_0x114d('0x39')](db['WhatsappQueue'][_0x114d('0x35')]);_0x17f544[_0x114d('0x38')]=_[_0x114d('0x39')](_0x2a4de3[_0x114d('0x38')]);_0x17f544[_0x114d('0x3a')]=_[_0x114d('0x3b')](_0x17f544[_0x114d('0x37')],_0x17f544[_0x114d('0x38')]);_0x5cfee0[_0x114d('0x3c')]=_[_0x114d('0x3b')](_0x17f544[_0x114d('0x37')],qs['fields'](_0x2a4de3[_0x114d('0x38')][_0x114d('0x3d')]));_0x5cfee0[_0x114d('0x3c')]=_0x5cfee0[_0x114d('0x3c')]['length']?_0x5cfee0['attributes']:_0x17f544[_0x114d('0x37')];if(_0x2a4de3[_0x114d('0x38')]['includeAll']){_0x5cfee0[_0x114d('0x48')]=[{'all':!![]}];}_0x5cfee0=_[_0x114d('0x44')]({},_0x5cfee0,_0x2a4de3[_0x114d('0x4c')]);return db[_0x114d('0x49')]['find'](_0x5cfee0)[_0x114d('0x2b')](handleEntityNotFound(_0x2c5121,null))[_0x114d('0x2b')](respondWithResult(_0x2c5121,null))[_0x114d('0x4b')](handleError(_0x2c5121,null));};exports[_0x114d('0x4d')]=function(_0x45c8ab,_0x5424ca){return db[_0x114d('0x49')][_0x114d('0x4d')](_0x45c8ab[_0x114d('0x4e')],{})[_0x114d('0x2b')](function(_0x45bb6d){var _0x544eb0=_0x45c8ab[_0x114d('0x4f')][_0x114d('0x2d')]({'plain':!![]});if(!_0x544eb0)throw new Error(_0x114d('0x50'));if(_0x544eb0[_0x114d('0x51')]===_0x114d('0x4f')){var _0x3e27e4=_0x45bb6d['get']({'plain':!![]});var _0x53edc3=_0x114d('0x2e');return db[_0x114d('0x52')][_0x114d('0x53')]({'where':{'name':_0x53edc3,'userProfileId':_0x544eb0[_0x114d('0x54')]},'raw':!![]})['then'](function(_0x3a98da){if(_0x3a98da&&_0x3a98da[_0x114d('0x55')]===0x0){return db[_0x114d('0x2f')]['create']({'name':_0x3e27e4[_0x114d('0x31')],'resourceId':_0x3e27e4['id'],'type':_0x3a98da[_0x114d('0x31')],'sectionId':_0x3a98da['id']},{})[_0x114d('0x2b')](function(){return _0x45bb6d;});}else{return _0x45bb6d;}})[_0x114d('0x4b')](function(_0x75e307){logger[_0x114d('0x30')](_0x114d('0x56'),_0x75e307);throw _0x75e307;});}return _0x45bb6d;})[_0x114d('0x2b')](respondWithResult(_0x5424ca,0xc9))[_0x114d('0x4b')](handleError(_0x5424ca,null));};exports[_0x114d('0x2a')]=function(_0x1a6a6b,_0x388c6c){if(_0x1a6a6b[_0x114d('0x4e')]['id']){delete _0x1a6a6b[_0x114d('0x4e')]['id'];}return db[_0x114d('0x49')][_0x114d('0x53')]({'where':{'id':_0x1a6a6b['params']['id']}})[_0x114d('0x2b')](handleEntityNotFound(_0x388c6c,null))[_0x114d('0x2b')](saveUpdates(_0x1a6a6b[_0x114d('0x4e')],null))['then'](respondWithResult(_0x388c6c,null))['catch'](handleError(_0x388c6c,null));};exports[_0x114d('0x2c')]=function(_0x47255b,_0x37e15f){return db[_0x114d('0x49')][_0x114d('0x53')]({'where':{'id':_0x47255b[_0x114d('0x57')]['id']}})[_0x114d('0x2b')](handleEntityNotFound(_0x37e15f,null))[_0x114d('0x2b')](removeEntity(_0x37e15f,null))[_0x114d('0x4b')](handleError(_0x37e15f,null));};exports[_0x114d('0x58')]=function(_0x59d6ca,_0x57e1e7){return db[_0x114d('0x49')][_0x114d('0x58')]()[_0x114d('0x2b')](respondWithResult(_0x57e1e7,null))['catch'](handleError(_0x57e1e7,null));};exports['getMembers']=function(_0x3c91c6,_0x51c9a5,_0x4d9013){var _0x460479={'raw':!![],'where':{}},_0x30000d={},_0x24567a;return db[_0x114d('0x49')][_0x114d('0x59')]({'where':{'id':_0x3c91c6[_0x114d('0x57')]['id']}})['then'](handleEntityNotFound(_0x51c9a5,null))['then'](function(_0x561242){if(_0x561242){_0x24567a=_0x561242[_0x114d('0x2d')]({'plain':!![]});_0x30000d[_0x114d('0x37')]=_[_0x114d('0x39')](db[_0x114d('0x5a')][_0x114d('0x35')]);_0x30000d[_0x114d('0x38')]=_[_0x114d('0x39')](_0x3c91c6[_0x114d('0x38')]);_0x30000d[_0x114d('0x3a')]=_['intersection'](_0x30000d[_0x114d('0x37')],_0x30000d[_0x114d('0x38')]);_0x460479[_0x114d('0x3c')]=_[_0x114d('0x3b')](_0x30000d['model'],qs['fields'](_0x3c91c6[_0x114d('0x38')]['fields']));_0x460479[_0x114d('0x3c')]=_0x460479[_0x114d('0x3c')][_0x114d('0x3e')]?_0x460479[_0x114d('0x3c')]:_0x30000d[_0x114d('0x37')];if(!_0x3c91c6[_0x114d('0x38')][_0x114d('0x5b')](_0x114d('0x3f'))){_0x460479[_0x114d('0x24')]=qs[_0x114d('0x24')](_0x3c91c6[_0x114d('0x38')][_0x114d('0x24')]);_0x460479[_0x114d('0x21')]=qs[_0x114d('0x21')](_0x3c91c6[_0x114d('0x38')]['offset']);}_0x460479['order']=qs['sort'](_0x3c91c6[_0x114d('0x38')][_0x114d('0x41')]);_0x460479[_0x114d('0x42')]=qs[_0x114d('0x3a')](_['pick'](_0x3c91c6[_0x114d('0x38')],_0x30000d[_0x114d('0x3a')]));_0x460479[_0x114d('0x42')][_0x114d('0x5c')]=_0x561242['id'];if(_0x3c91c6[_0x114d('0x38')]['filter']){_0x460479[_0x114d('0x42')]=_[_0x114d('0x44')](_0x460479['where'],{'$or':_[_0x114d('0x34')](_0x460479[_0x114d('0x3c')],function(_0x59fd72){var _0x6982e5={};_0x6982e5[_0x59fd72]={'$like':'%'+_0x3c91c6['query'][_0x114d('0x46')]+'%'};return _0x6982e5;})});}_0x460479=_['merge']({},_0x460479,_0x3c91c6[_0x114d('0x4c')]);return db['UserWhatsappQueue']['findAll'](_0x460479);}})[_0x114d('0x2b')](function(_0x400eb3){if(_0x400eb3){return db[_0x114d('0x5d')][_0x114d('0x5e')]({'where':{'id':_[_0x114d('0x34')](_0x400eb3,_0x114d('0x5f')),'role':_0x114d('0x60')},'attributes':['id',_0x114d('0x31'),_0x114d('0x61'),_0x114d('0x62'),_0x114d('0x63')]});}})[_0x114d('0x2b')](function(_0x187978){if(_0x187978){return{'count':_0x187978[_0x114d('0x23')],'rows':_[_0x114d('0x34')](_0x187978[_0x114d('0x64')],function(_0x259e74){return{'membername':_0x259e74[_0x114d('0x31')],'UserId':_0x259e74['id'],'queue_name':_0x24567a['name'],'WhatsappQueueId':_0x24567a['id'],'interface':util[_0x114d('0x65')](_0x114d('0x66'),'SIP',_0x259e74[_0x114d('0x31')]),'penalty':0x0,'paused':_0x259e74[_0x114d('0x61')],'createdAt':_0x259e74[_0x114d('0x63')],'updatedAt':_0x259e74[_0x114d('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x51c9a5,_0x460479))[_0x114d('0x4b')](handleError(_0x51c9a5,null));};exports[_0x114d('0x67')]=function(_0x2632ab,_0x462c1b,_0x379d95){var _0x1178ef={};var _0x27fc14={};var _0x3d77f4;var _0x5ebdcf;return db[_0x114d('0x49')][_0x114d('0x59')]({'where':{'id':_0x2632ab[_0x114d('0x57')]['id']}})['then'](handleEntityNotFound(_0x462c1b,null))[_0x114d('0x2b')](function(_0x30f66f){if(_0x30f66f){_0x3d77f4=_0x30f66f;_0x27fc14[_0x114d('0x37')]=_['keys'](db['Team'][_0x114d('0x35')]);_0x27fc14[_0x114d('0x38')]=_[_0x114d('0x39')](_0x2632ab['query']);_0x27fc14['filters']=_[_0x114d('0x3b')](_0x27fc14['model'],_0x27fc14[_0x114d('0x38')]);_0x1178ef[_0x114d('0x3c')]=_[_0x114d('0x3b')](_0x27fc14[_0x114d('0x37')],qs[_0x114d('0x3d')](_0x2632ab[_0x114d('0x38')][_0x114d('0x3d')]));_0x1178ef[_0x114d('0x3c')]=_0x1178ef[_0x114d('0x3c')][_0x114d('0x3e')]?_0x1178ef['attributes']:_0x27fc14[_0x114d('0x37')];_0x1178ef['order']=qs[_0x114d('0x41')](_0x2632ab[_0x114d('0x38')][_0x114d('0x41')]);_0x1178ef[_0x114d('0x42')]=qs[_0x114d('0x3a')](_[_0x114d('0x43')](_0x2632ab[_0x114d('0x38')],_0x27fc14[_0x114d('0x3a')]));if(_0x2632ab[_0x114d('0x38')][_0x114d('0x46')]){_0x1178ef[_0x114d('0x42')]=_[_0x114d('0x44')](_0x1178ef[_0x114d('0x42')],{'$or':_[_0x114d('0x34')](_0x1178ef[_0x114d('0x3c')],function(_0x41bacd){var _0x159ce3={};_0x159ce3[_0x41bacd]={'$like':'%'+_0x2632ab[_0x114d('0x38')]['filter']+'%'};return _0x159ce3;})});}_0x1178ef=_[_0x114d('0x44')]({},_0x1178ef,_0x2632ab['options']);return _0x3d77f4['getTeams'](_0x1178ef);}})[_0x114d('0x2b')](function(_0x40e466){if(_0x40e466){_0x5ebdcf=_0x40e466['length'];if(!_0x2632ab[_0x114d('0x38')][_0x114d('0x5b')](_0x114d('0x3f'))){_0x1178ef['limit']=qs['limit'](_0x2632ab['query'][_0x114d('0x24')]);_0x1178ef[_0x114d('0x21')]=qs[_0x114d('0x21')](_0x2632ab[_0x114d('0x38')]['offset']);}return _0x3d77f4[_0x114d('0x67')](_0x1178ef);}})[_0x114d('0x2b')](function(_0x2ca9e2){if(_0x2ca9e2){return _0x2ca9e2?{'count':_0x5ebdcf,'rows':_0x2ca9e2}:null;}})['then'](respondWithResult(_0x462c1b,null))[_0x114d('0x4b')](handleError(_0x462c1b,null));};exports['addTeams']=function(_0x2d65ea,_0x243112,_0x44821a){var _0x444bad=_0x2d65ea[_0x114d('0x4e')][_0x114d('0x68')];return db[_0x114d('0x69')]['findAll']({'where':{'id':_0x444bad},'attributes':['id'],'include':[{'model':db[_0x114d('0x5d')],'as':'Agents','attributes':['id',_0x114d('0x31'),'online',_0x114d('0x6a'),_0x114d('0x6b')],'raw':!![]}]})[_0x114d('0x2b')](function(_0x18c34e){if(_0x18c34e){var _0x461844=_['flatMap'](_0x18c34e,function(_0x40dc0d){var _0x3a3078=_0x40dc0d[_0x114d('0x2d')]({'plain':!![]});return _0x3a3078['Agents'];});return db[_0x114d('0x49')][_0x114d('0x53')]({'where':{'id':_0x2d65ea[_0x114d('0x57')]['id']}})[_0x114d('0x2b')](function(_0x2b9311){return db[_0x114d('0x6c')]['transaction'](function(_0x4f1840){return _0x2b9311[_0x114d('0x6d')](_0x444bad,{'transaction':_0x4f1840})['then'](function(){return BPromise[_0x114d('0x6e')](_0x461844,function(_0x147af1){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x147af1['id'],'WhatsappQueueId':_0x2d65ea[_0x114d('0x57')]['id']},'transaction':_0x4f1840});});})['then'](function(){_0x461844[_0x114d('0x6f')](function(_0xa1e4be){socket['emit'](_0x114d('0x70'),{'UserId':_0xa1e4be['id'],'WhatsappQueueId':_0x2b9311['id']});});});});});}})[_0x114d('0x2b')](respondWithStatusCode(_0x243112,null))[_0x114d('0x4b')](handleError(_0x243112,null));};exports[_0x114d('0x71')]=function(_0x4e725d,_0x4f7e83,_0x135a09){return db[_0x114d('0x69')]['findAll']({'where':{'id':_0x4e725d[_0x114d('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x114d('0x5d')],'as':_0x114d('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4f7e83,null))[_0x114d('0x2b')](function(_0x24f2a8){var _0x4b6628=_[_0x114d('0x34')](_0x24f2a8,'id');var _0x5ba595=[];var _0x10618c=[];var _0x3dd439=squel[_0x114d('0x73')]();_0x3dd439[_0x114d('0x74')](_0x114d('0x75'))[_0x114d('0x76')](_0x114d('0x77'),'tq')[_0x114d('0x78')](_0x114d('0x79'),'ut',_0x114d('0x7a'))['where'](_0x114d('0x7b'),_0x4e725d[_0x114d('0x57')]['id']);for(var _0x5dc162=0x0;_0x5dc162<_0x24f2a8[_0x114d('0x3e')];_0x5dc162+=0x1){let _0x25feee=_0x24f2a8[_0x5dc162];for(var _0x526667=0x0;_0x526667<_0x25feee[_0x114d('0x72')][_0x114d('0x3e')];_0x526667+=0x1){let _0x5cbc1e=_0x25feee[_0x114d('0x72')][_0x526667];var _0x172312=_0x3dd439['clone']();_0x172312[_0x114d('0x42')]('ut.UserId\x20=\x20?',_0x5cbc1e['id']);_0x10618c['push'](db[_0x114d('0x6c')][_0x114d('0x38')](_0x172312[_0x114d('0x7c')](),{'type':db[_0x114d('0x6c')][_0x114d('0x7d')][_0x114d('0x7e')]})['then'](function(_0x2c7634){if(_0x2c7634[_0x114d('0x3e')]===0x1){return _0x5cbc1e['id'];}else{var _0x399472=_['every'](_[_0x114d('0x34')](_0x2c7634,'TeamId'),function(_0x3a402e){return _[_0x114d('0x7f')](_0x4b6628,_0x3a402e);});if(_0x399472){return _0x5cbc1e['id'];}}}));}}return BPromise[_0x114d('0x80')](_0x10618c)[_0x114d('0x2b')](function(_0x246a07){_0x5ba595=_(_0x5ba595)[_0x114d('0x81')](_0x246a07)[_0x114d('0x82')]()[_0x114d('0x83')]();return db[_0x114d('0x49')]['find']({'where':{'id':_0x4e725d[_0x114d('0x57')]['id']}})[_0x114d('0x2b')](function(_0x24a914){return db[_0x114d('0x6c')]['transaction'](function(_0x312c5e){return _0x24a914[_0x114d('0x71')](_0x4e725d['query'][_0x114d('0x68')],{'transaction':_0x312c5e})['then'](function(){if(!_[_0x114d('0x84')](_0x5ba595)){return _0x24a914['removeAgents'](_0x5ba595,{'transaction':_0x312c5e});}})['then'](function(){_0x5ba595[_0x114d('0x6f')](function(_0x27465c){socket[_0x114d('0x85')](_0x114d('0x86'),{'UserId':_0x27465c,'WhatsappQueueId':_0x24a914['id']});});});});});});})[_0x114d('0x2b')](respondWithStatusCode(_0x4f7e83,null))[_0x114d('0x4b')](handleError(_0x4f7e83,null));};exports[_0x114d('0x87')]=function(_0x354810,_0x343b2b,_0x6f8380){return db['WhatsappQueue']['find']({'where':{'id':_0x354810['params']['id']}})[_0x114d('0x2b')](handleEntityNotFound(_0x343b2b,null))[_0x114d('0x2b')](function(_0x3f51d1){if(_0x3f51d1){return _0x3f51d1[_0x114d('0x87')](_0x354810['body'][_0x114d('0x68')],_['omit'](_0x354810[_0x114d('0x4e')],[_0x114d('0x68'),'id'])||{})[_0x114d('0x88')](function(_0x94cc3c){for(var _0x11439=0x0;_0x11439<_0x354810[_0x114d('0x4e')][_0x114d('0x68')][_0x114d('0x3e')];_0x11439+=0x1){socket[_0x114d('0x85')]('userWhatsappQueue:save',{'UserId':Number(_0x354810[_0x114d('0x4e')][_0x114d('0x68')][_0x11439]),'WhatsappQueueId':Number(_0x354810['params']['id'])});}return _0x94cc3c;});}})[_0x114d('0x2b')](respondWithResult(_0x343b2b,null))[_0x114d('0x4b')](handleError(_0x343b2b,null));};exports[_0x114d('0x89')]=function(_0x38545a,_0x37c11a,_0x33e4b5){return db['WhatsappQueue'][_0x114d('0x53')]({'where':{'id':_0x38545a[_0x114d('0x57')]['id']}})[_0x114d('0x2b')](handleEntityNotFound(_0x37c11a,null))[_0x114d('0x2b')](function(_0x17a7fb){if(_0x17a7fb){return _0x17a7fb['removeAgents'](_0x38545a[_0x114d('0x38')][_0x114d('0x68')])['then'](function(){if(_[_0x114d('0x8a')](_0x38545a['query'][_0x114d('0x68')])){for(var _0x4d39e5=0x0;_0x4d39e5<_0x38545a[_0x114d('0x38')]['ids'][_0x114d('0x3e')];_0x4d39e5+=0x1){socket['emit'](_0x114d('0x86'),{'UserId':Number(_0x38545a[_0x114d('0x38')][_0x114d('0x68')][_0x4d39e5]),'WhatsappQueueId':Number(_0x38545a[_0x114d('0x57')]['id'])});}}else{socket[_0x114d('0x85')](_0x114d('0x86'),{'UserId':Number(_0x38545a[_0x114d('0x38')][_0x114d('0x68')]),'WhatsappQueueId':Number(_0x38545a[_0x114d('0x57')]['id'])});}});}})[_0x114d('0x2b')](respondWithStatusCode(_0x37c11a,null))[_0x114d('0x4b')](handleError(_0x37c11a,null));};exports[_0x114d('0x8b')]=function(_0x5e5faf,_0x32a0bc,_0x174730){var _0x40984a={};var _0x4e708c={};var _0xa60257;var _0x482df0;return db[_0x114d('0x49')][_0x114d('0x59')]({'where':{'id':_0x5e5faf['params']['id']}})[_0x114d('0x2b')](handleEntityNotFound(_0x32a0bc,null))[_0x114d('0x2b')](function(_0x1c20d7){if(_0x1c20d7){_0xa60257=_0x1c20d7;_0x4e708c[_0x114d('0x37')]=_['keys'](db[_0x114d('0x5d')]['rawAttributes']);_0x4e708c[_0x114d('0x38')]=_[_0x114d('0x39')](_0x5e5faf[_0x114d('0x38')]);_0x4e708c[_0x114d('0x3a')]=_[_0x114d('0x3b')](_0x4e708c[_0x114d('0x37')],_0x4e708c[_0x114d('0x38')]);_0x40984a[_0x114d('0x3c')]=_['intersection'](_0x4e708c[_0x114d('0x37')],qs['fields'](_0x5e5faf[_0x114d('0x38')]['fields']));_0x40984a[_0x114d('0x3c')]=_0x40984a[_0x114d('0x3c')][_0x114d('0x3e')]?_0x40984a[_0x114d('0x3c')]:_0x4e708c[_0x114d('0x37')];_0x40984a[_0x114d('0x40')]=qs[_0x114d('0x41')](_0x5e5faf[_0x114d('0x38')][_0x114d('0x41')]);_0x40984a[_0x114d('0x42')]=qs[_0x114d('0x3a')](_[_0x114d('0x43')](_0x5e5faf[_0x114d('0x38')],_0x4e708c['filters']));if(_0x5e5faf[_0x114d('0x38')][_0x114d('0x46')]){_0x40984a[_0x114d('0x42')]=_[_0x114d('0x44')](_0x40984a[_0x114d('0x42')],{'$or':_['map'](_0x40984a[_0x114d('0x3c')],function(_0x760497){var _0x8adbf6={};_0x8adbf6[_0x760497]={'$like':'%'+_0x5e5faf[_0x114d('0x38')]['filter']+'%'};return _0x8adbf6;})});}_0x40984a=_[_0x114d('0x44')]({},_0x40984a,_0x5e5faf[_0x114d('0x4c')]);return _0xa60257['getAgents'](_0x40984a);}})[_0x114d('0x2b')](function(_0x1033d6){if(_0x1033d6){_0x482df0=_0x1033d6[_0x114d('0x3e')];if(!_0x5e5faf[_0x114d('0x38')][_0x114d('0x5b')]('nolimit')){_0x40984a[_0x114d('0x24')]=qs[_0x114d('0x24')](_0x5e5faf[_0x114d('0x38')][_0x114d('0x24')]);_0x40984a['offset']=qs[_0x114d('0x21')](_0x5e5faf[_0x114d('0x38')][_0x114d('0x21')]);}return _0xa60257[_0x114d('0x8b')](_0x40984a);}})[_0x114d('0x2b')](function(_0x41f8f9){if(_0x41f8f9){return _0x41f8f9?{'count':_0x482df0,'rows':_0x41f8f9}:null;}})[_0x114d('0x2b')](respondWithResult(_0x32a0bc,null))['catch'](handleError(_0x32a0bc,null));};
\ No newline at end of file
+var _0x22f3=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','WhatsappQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','options','WhatsappQueue','includeAll','include','rows','catch','show','params','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','findOne','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','pick','addTeams','ids','findAll','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','Team','User','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','value','emit','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','getAgents','nolimit','eml-format'];(function(_0x3edede,_0x2b0df8){var _0xa865e5=function(_0x224cee){while(--_0x224cee){_0x3edede['push'](_0x3edede['shift']());}};_0xa865e5(++_0x2b0df8);}(_0x22f3,0x8c));var _0x322f=function(_0xd7c26c,_0x1cb87e){_0xd7c26c=_0xd7c26c-0x0;var _0x51940a=_0x22f3[_0xd7c26c];return _0x51940a;};'use strict';var emlformat=require(_0x322f('0x0'));var rimraf=require(_0x322f('0x1'));var zipdir=require(_0x322f('0x2'));var jsonpatch=require(_0x322f('0x3'));var rp=require(_0x322f('0x4'));var moment=require(_0x322f('0x5'));var BPromise=require(_0x322f('0x6'));var Mustache=require(_0x322f('0x7'));var util=require('util');var path=require(_0x322f('0x8'));var sox=require(_0x322f('0x9'));var csv=require('to-csv');var ejs=require(_0x322f('0xa'));var fs=require('fs');var fs_extra=require(_0x322f('0xb'));var _=require(_0x322f('0xc'));var squel=require(_0x322f('0xd'));var crypto=require(_0x322f('0xe'));var jsforce=require(_0x322f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x322f('0x10'));var querystring=require(_0x322f('0x11'));var Papa=require('papaparse');var Redis=require(_0x322f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x322f('0x13'));var hardwareService=require(_0x322f('0x14'));var logger=require(_0x322f('0x15'))(_0x322f('0x16'));var utils=require('../../config/utils');var config=require(_0x322f('0x17'));var licenseUtil=require(_0x322f('0x18'));var db=require('../../mysqldb')['db'];config[_0x322f('0x19')]=_['defaults'](config[_0x322f('0x19')],{'host':_0x322f('0x1a'),'port':0x18eb});var socket=require(_0x322f('0x1b'))(new Redis(config['redis']));require(_0x322f('0x1c'))[_0x322f('0x1d')](socket);function respondWithStatusCode(_0x1e5432,_0x1a1dbf){_0x1a1dbf=_0x1a1dbf||0xcc;return function(_0x44d3c1){if(_0x44d3c1){return _0x1e5432[_0x322f('0x1e')](_0x1a1dbf);}return _0x1e5432['status'](_0x1a1dbf)[_0x322f('0x1f')]();};}function respondWithResult(_0x4f1aa8,_0x2dad9f){_0x2dad9f=_0x2dad9f||0xc8;return function(_0x31b2ba){if(_0x31b2ba){return _0x4f1aa8[_0x322f('0x20')](_0x2dad9f)[_0x322f('0x21')](_0x31b2ba);}};}function respondWithFilteredResult(_0x157dc0,_0x2e879d){return function(_0x3939d8){if(_0x3939d8){var _0x5c33ea=typeof _0x2e879d[_0x322f('0x22')]===_0x322f('0x23')&&typeof _0x2e879d[_0x322f('0x24')]===_0x322f('0x23');var _0x5d638a=_0x3939d8['count'];var _0x251d9a=_0x5c33ea?0x0:_0x2e879d[_0x322f('0x22')];var _0x429a88=_0x5c33ea?_0x3939d8[_0x322f('0x25')]:_0x2e879d[_0x322f('0x22')]+_0x2e879d['limit'];var _0x5b0261;if(_0x429a88>=_0x5d638a){_0x429a88=_0x5d638a;_0x5b0261=0xc8;}else{_0x5b0261=0xce;}_0x157dc0[_0x322f('0x20')](_0x5b0261);return _0x157dc0[_0x322f('0x26')](_0x322f('0x27'),_0x251d9a+'-'+_0x429a88+'/'+_0x5d638a)['json'](_0x3939d8);}return null;};}function patchUpdates(_0x15922d){return function(_0x29e456){try{jsonpatch[_0x322f('0x28')](_0x29e456,_0x15922d,!![]);}catch(_0x8ffbb){return BPromise[_0x322f('0x29')](_0x8ffbb);}return _0x29e456['save']();};}function saveUpdates(_0x194896,_0x59f111){return function(_0x46ec11){if(_0x46ec11){return _0x46ec11['update'](_0x194896)['then'](function(_0x526a91){return _0x526a91;});}return null;};}function removeEntity(_0x55ab41,_0x517366){return function(_0x461a84){if(_0x461a84){return _0x461a84['destroy']()[_0x322f('0x2a')](function(){var _0xa36ce2=_0x461a84[_0x322f('0x2b')]({'plain':!![]});var _0x1b32ad=_0x322f('0x2c');return db[_0x322f('0x2d')]['destroy']({'where':{'type':_0x1b32ad,'resourceId':_0xa36ce2['id']}})[_0x322f('0x2a')](function(){return _0x461a84;});})[_0x322f('0x2a')](function(){_0x55ab41[_0x322f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d19de,_0x582ef7){return function(_0x2693a7){if(!_0x2693a7){_0x2d19de['sendStatus'](0x194);}return _0x2693a7;};}function handleError(_0x444be3,_0xe02676){_0xe02676=_0xe02676||0x1f4;return function(_0x5c8ab2){logger[_0x322f('0x2e')](_0x5c8ab2[_0x322f('0x2f')]);if(_0x5c8ab2[_0x322f('0x30')]){delete _0x5c8ab2['name'];}_0x444be3[_0x322f('0x20')](_0xe02676)['send'](_0x5c8ab2);};}exports[_0x322f('0x31')]=function(_0x104c41,_0x53dc32){var _0x275fd3={},_0x39cde5={},_0x505b52={'count':0x0,'rows':[]};var _0x3a2f62=_['map'](db['WhatsappQueue'][_0x322f('0x32')],function(_0x37fe18){return{'name':_0x37fe18[_0x322f('0x33')],'type':_0x37fe18[_0x322f('0x34')][_0x322f('0x35')]};});_0x39cde5[_0x322f('0x36')]=_[_0x322f('0x37')](_0x3a2f62,'name');_0x39cde5[_0x322f('0x38')]=_[_0x322f('0x39')](_0x104c41[_0x322f('0x38')]);_0x39cde5[_0x322f('0x3a')]=_[_0x322f('0x3b')](_0x39cde5[_0x322f('0x36')],_0x39cde5['query']);_0x275fd3[_0x322f('0x3c')]=_[_0x322f('0x3b')](_0x39cde5[_0x322f('0x36')],qs[_0x322f('0x3d')](_0x104c41[_0x322f('0x38')][_0x322f('0x3d')]));_0x275fd3[_0x322f('0x3c')]=_0x275fd3['attributes'][_0x322f('0x3e')]?_0x275fd3['attributes']:_0x39cde5[_0x322f('0x36')];if(!_0x104c41[_0x322f('0x38')]['hasOwnProperty']('nolimit')){_0x275fd3[_0x322f('0x24')]=qs[_0x322f('0x24')](_0x104c41['query'][_0x322f('0x24')]);_0x275fd3[_0x322f('0x22')]=qs['offset'](_0x104c41[_0x322f('0x38')][_0x322f('0x22')]);}_0x275fd3[_0x322f('0x3f')]=qs[_0x322f('0x40')](_0x104c41[_0x322f('0x38')][_0x322f('0x40')]);_0x275fd3[_0x322f('0x41')]=qs[_0x322f('0x3a')](_['pick'](_0x104c41[_0x322f('0x38')],_0x39cde5[_0x322f('0x3a')]),_0x3a2f62);if(_0x104c41[_0x322f('0x38')][_0x322f('0x42')]){_0x275fd3[_0x322f('0x41')]=_['merge'](_0x275fd3[_0x322f('0x41')],{'$or':_[_0x322f('0x37')](_0x3a2f62,function(_0x30e453){if(_0x30e453[_0x322f('0x34')]!==_0x322f('0x43')){var _0x39cad0={};_0x39cad0[_0x30e453['name']]={'$like':'%'+_0x104c41[_0x322f('0x38')]['filter']+'%'};return _0x39cad0;}})});}_0x275fd3=_['merge']({},_0x275fd3,_0x104c41[_0x322f('0x44')]);var _0x4aa9bb={'where':_0x275fd3[_0x322f('0x41')]};return db[_0x322f('0x45')][_0x322f('0x25')](_0x4aa9bb)[_0x322f('0x2a')](function(_0x10ebd1){_0x505b52[_0x322f('0x25')]=_0x10ebd1;if(_0x104c41[_0x322f('0x38')][_0x322f('0x46')]){_0x275fd3[_0x322f('0x47')]=[{'all':!![]}];}return db[_0x322f('0x45')]['findAll'](_0x275fd3);})[_0x322f('0x2a')](function(_0x550891){_0x505b52[_0x322f('0x48')]=_0x550891;return _0x505b52;})[_0x322f('0x2a')](respondWithFilteredResult(_0x53dc32,_0x275fd3))[_0x322f('0x49')](handleError(_0x53dc32,null));};exports[_0x322f('0x4a')]=function(_0x2d6f46,_0x5e650a){var _0x553bc4={'raw':!![],'where':{'id':_0x2d6f46[_0x322f('0x4b')]['id']}},_0x59d1bc={};_0x59d1bc[_0x322f('0x36')]=_[_0x322f('0x39')](db[_0x322f('0x45')]['rawAttributes']);_0x59d1bc[_0x322f('0x38')]=_['keys'](_0x2d6f46[_0x322f('0x38')]);_0x59d1bc[_0x322f('0x3a')]=_[_0x322f('0x3b')](_0x59d1bc[_0x322f('0x36')],_0x59d1bc[_0x322f('0x38')]);_0x553bc4[_0x322f('0x3c')]=_[_0x322f('0x3b')](_0x59d1bc[_0x322f('0x36')],qs[_0x322f('0x3d')](_0x2d6f46[_0x322f('0x38')][_0x322f('0x3d')]));_0x553bc4['attributes']=_0x553bc4[_0x322f('0x3c')][_0x322f('0x3e')]?_0x553bc4[_0x322f('0x3c')]:_0x59d1bc[_0x322f('0x36')];if(_0x2d6f46[_0x322f('0x38')][_0x322f('0x46')]){_0x553bc4[_0x322f('0x47')]=[{'all':!![]}];}_0x553bc4=_[_0x322f('0x4c')]({},_0x553bc4,_0x2d6f46[_0x322f('0x44')]);return db[_0x322f('0x45')][_0x322f('0x4d')](_0x553bc4)[_0x322f('0x2a')](handleEntityNotFound(_0x5e650a,null))[_0x322f('0x2a')](respondWithResult(_0x5e650a,null))[_0x322f('0x49')](handleError(_0x5e650a,null));};exports[_0x322f('0x4e')]=function(_0x236ad5,_0x4ff391){return db[_0x322f('0x45')]['create'](_0x236ad5[_0x322f('0x4f')],{})[_0x322f('0x2a')](function(_0x5952ce){var _0x2e0389=_0x236ad5['user'][_0x322f('0x2b')]({'plain':!![]});if(!_0x2e0389)throw new Error(_0x322f('0x50'));if(_0x2e0389[_0x322f('0x51')]===_0x322f('0x52')){var _0x5a3032=_0x5952ce[_0x322f('0x2b')]({'plain':!![]});var _0x24ee6c=_0x322f('0x2c');return db[_0x322f('0x53')][_0x322f('0x4d')]({'where':{'name':_0x24ee6c,'userProfileId':_0x2e0389['userProfileId']},'raw':!![]})[_0x322f('0x2a')](function(_0x417843){if(_0x417843&&_0x417843['autoAssociation']===0x0){return db[_0x322f('0x2d')][_0x322f('0x4e')]({'name':_0x5a3032[_0x322f('0x30')],'resourceId':_0x5a3032['id'],'type':_0x417843['name'],'sectionId':_0x417843['id']},{})[_0x322f('0x2a')](function(){return _0x5952ce;});}else{return _0x5952ce;}})[_0x322f('0x49')](function(_0x3c9edd){logger[_0x322f('0x2e')](_0x322f('0x54'),_0x3c9edd);throw _0x3c9edd;});}return _0x5952ce;})[_0x322f('0x2a')](respondWithResult(_0x4ff391,0xc9))[_0x322f('0x49')](handleError(_0x4ff391,null));};exports[_0x322f('0x55')]=function(_0x1c4359,_0x5582a8){if(_0x1c4359[_0x322f('0x4f')]['id']){delete _0x1c4359[_0x322f('0x4f')]['id'];}return db[_0x322f('0x45')][_0x322f('0x4d')]({'where':{'id':_0x1c4359[_0x322f('0x4b')]['id']}})[_0x322f('0x2a')](handleEntityNotFound(_0x5582a8,null))[_0x322f('0x2a')](saveUpdates(_0x1c4359[_0x322f('0x4f')],null))[_0x322f('0x2a')](respondWithResult(_0x5582a8,null))[_0x322f('0x49')](handleError(_0x5582a8,null));};exports[_0x322f('0x56')]=function(_0x5461be,_0x22f1c1){return db['WhatsappQueue'][_0x322f('0x4d')]({'where':{'id':_0x5461be[_0x322f('0x4b')]['id']}})[_0x322f('0x2a')](handleEntityNotFound(_0x22f1c1,null))[_0x322f('0x2a')](removeEntity(_0x22f1c1,null))[_0x322f('0x49')](handleError(_0x22f1c1,null));};exports[_0x322f('0x57')]=function(_0xd70318,_0x5a2572){return db[_0x322f('0x45')][_0x322f('0x57')]()['then'](respondWithResult(_0x5a2572,null))['catch'](handleError(_0x5a2572,null));};exports['getMembers']=function(_0x13e2d1,_0x39106a,_0x3e2f1e){var _0x58b03a={'raw':!![],'where':{}},_0x13eeb3={},_0x1594ae;return db[_0x322f('0x45')][_0x322f('0x58')]({'where':{'id':_0x13e2d1[_0x322f('0x4b')]['id']}})[_0x322f('0x2a')](handleEntityNotFound(_0x39106a,null))[_0x322f('0x2a')](function(_0x1e148f){if(_0x1e148f){_0x1594ae=_0x1e148f[_0x322f('0x2b')]({'plain':!![]});_0x13eeb3[_0x322f('0x36')]=_[_0x322f('0x39')](db[_0x322f('0x59')][_0x322f('0x32')]);_0x13eeb3[_0x322f('0x38')]=_[_0x322f('0x39')](_0x13e2d1[_0x322f('0x38')]);_0x13eeb3[_0x322f('0x3a')]=_[_0x322f('0x3b')](_0x13eeb3[_0x322f('0x36')],_0x13eeb3[_0x322f('0x38')]);_0x58b03a[_0x322f('0x3c')]=_[_0x322f('0x3b')](_0x13eeb3[_0x322f('0x36')],qs[_0x322f('0x3d')](_0x13e2d1[_0x322f('0x38')][_0x322f('0x3d')]));_0x58b03a['attributes']=_0x58b03a[_0x322f('0x3c')][_0x322f('0x3e')]?_0x58b03a[_0x322f('0x3c')]:_0x13eeb3['model'];if(!_0x13e2d1[_0x322f('0x38')][_0x322f('0x5a')]('nolimit')){_0x58b03a[_0x322f('0x24')]=qs['limit'](_0x13e2d1['query'][_0x322f('0x24')]);_0x58b03a[_0x322f('0x22')]=qs[_0x322f('0x22')](_0x13e2d1[_0x322f('0x38')][_0x322f('0x22')]);}_0x58b03a[_0x322f('0x3f')]=qs[_0x322f('0x40')](_0x13e2d1[_0x322f('0x38')]['sort']);_0x58b03a[_0x322f('0x41')]=qs[_0x322f('0x3a')](_['pick'](_0x13e2d1[_0x322f('0x38')],_0x13eeb3['filters']));_0x58b03a[_0x322f('0x41')][_0x322f('0x5b')]=_0x1e148f['id'];if(_0x13e2d1['query'][_0x322f('0x42')]){_0x58b03a['where']=_['merge'](_0x58b03a[_0x322f('0x41')],{'$or':_[_0x322f('0x37')](_0x58b03a[_0x322f('0x3c')],function(_0x34e11a){var _0x59b8da={};_0x59b8da[_0x34e11a]={'$like':'%'+_0x13e2d1[_0x322f('0x38')]['filter']+'%'};return _0x59b8da;})});}_0x58b03a=_[_0x322f('0x4c')]({},_0x58b03a,_0x13e2d1[_0x322f('0x44')]);return db[_0x322f('0x59')]['findAll'](_0x58b03a);}})['then'](function(_0x2312b2){if(_0x2312b2){return db['User'][_0x322f('0x5c')]({'where':{'id':_[_0x322f('0x37')](_0x2312b2,_0x322f('0x5d')),'role':_0x322f('0x5e')},'attributes':['id',_0x322f('0x30'),_0x322f('0x5f'),_0x322f('0x60'),_0x322f('0x61')]});}})['then'](function(_0x16f801){if(_0x16f801){return{'count':_0x16f801[_0x322f('0x25')],'rows':_['map'](_0x16f801[_0x322f('0x48')],function(_0x1df9e4){return{'membername':_0x1df9e4['name'],'UserId':_0x1df9e4['id'],'queue_name':_0x1594ae[_0x322f('0x30')],'WhatsappQueueId':_0x1594ae['id'],'interface':util[_0x322f('0x62')](_0x322f('0x63'),_0x322f('0x64'),_0x1df9e4[_0x322f('0x30')]),'penalty':0x0,'paused':_0x1df9e4[_0x322f('0x5f')],'createdAt':_0x1df9e4['createdAt'],'updatedAt':_0x1df9e4[_0x322f('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x322f('0x2a')](respondWithFilteredResult(_0x39106a,_0x58b03a))[_0x322f('0x49')](handleError(_0x39106a,null));};exports[_0x322f('0x65')]=function(_0x1d2d86,_0x17f164,_0x52927c){var _0x42f36b={};var _0xed0f9d={};var _0x3784e2;var _0x9d94bc;return db[_0x322f('0x45')][_0x322f('0x58')]({'where':{'id':_0x1d2d86[_0x322f('0x4b')]['id']}})[_0x322f('0x2a')](handleEntityNotFound(_0x17f164,null))[_0x322f('0x2a')](function(_0x766c5b){if(_0x766c5b){_0x3784e2=_0x766c5b;_0xed0f9d['model']=_[_0x322f('0x39')](db['Team'][_0x322f('0x32')]);_0xed0f9d[_0x322f('0x38')]=_[_0x322f('0x39')](_0x1d2d86['query']);_0xed0f9d['filters']=_['intersection'](_0xed0f9d[_0x322f('0x36')],_0xed0f9d[_0x322f('0x38')]);_0x42f36b['attributes']=_[_0x322f('0x3b')](_0xed0f9d['model'],qs[_0x322f('0x3d')](_0x1d2d86['query'][_0x322f('0x3d')]));_0x42f36b[_0x322f('0x3c')]=_0x42f36b[_0x322f('0x3c')][_0x322f('0x3e')]?_0x42f36b[_0x322f('0x3c')]:_0xed0f9d[_0x322f('0x36')];_0x42f36b[_0x322f('0x3f')]=qs['sort'](_0x1d2d86[_0x322f('0x38')][_0x322f('0x40')]);_0x42f36b['where']=qs[_0x322f('0x3a')](_[_0x322f('0x66')](_0x1d2d86[_0x322f('0x38')],_0xed0f9d['filters']));if(_0x1d2d86[_0x322f('0x38')][_0x322f('0x42')]){_0x42f36b[_0x322f('0x41')]=_[_0x322f('0x4c')](_0x42f36b['where'],{'$or':_[_0x322f('0x37')](_0x42f36b[_0x322f('0x3c')],function(_0x597226){var _0x48cf21={};_0x48cf21[_0x597226]={'$like':'%'+_0x1d2d86['query']['filter']+'%'};return _0x48cf21;})});}_0x42f36b=_[_0x322f('0x4c')]({},_0x42f36b,_0x1d2d86[_0x322f('0x44')]);return _0x3784e2[_0x322f('0x65')](_0x42f36b);}})[_0x322f('0x2a')](function(_0x136cb2){if(_0x136cb2){_0x9d94bc=_0x136cb2[_0x322f('0x3e')];if(!_0x1d2d86[_0x322f('0x38')][_0x322f('0x5a')]('nolimit')){_0x42f36b[_0x322f('0x24')]=qs[_0x322f('0x24')](_0x1d2d86[_0x322f('0x38')]['limit']);_0x42f36b[_0x322f('0x22')]=qs['offset'](_0x1d2d86['query'][_0x322f('0x22')]);}return _0x3784e2[_0x322f('0x65')](_0x42f36b);}})[_0x322f('0x2a')](function(_0x5cdf68){if(_0x5cdf68){return _0x5cdf68?{'count':_0x9d94bc,'rows':_0x5cdf68}:null;}})[_0x322f('0x2a')](respondWithResult(_0x17f164,null))[_0x322f('0x49')](handleError(_0x17f164,null));};exports[_0x322f('0x67')]=function(_0x1674ef,_0x4d14af,_0x5f0b55){var _0x4c26f9=_0x1674ef[_0x322f('0x4f')][_0x322f('0x68')];return db['Team'][_0x322f('0x69')]({'where':{'id':_0x4c26f9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x322f('0x6a'),'attributes':['id',_0x322f('0x30'),_0x322f('0x6b'),_0x322f('0x6c'),'interface'],'raw':!![]}]})[_0x322f('0x2a')](function(_0x38636e){if(_0x38636e){var _0x3834b6=_[_0x322f('0x6d')](_0x38636e,function(_0x4eb3d0){var _0x1060ed=_0x4eb3d0[_0x322f('0x2b')]({'plain':!![]});return _0x1060ed[_0x322f('0x6a')];});return db[_0x322f('0x45')][_0x322f('0x4d')]({'where':{'id':_0x1674ef[_0x322f('0x4b')]['id']}})[_0x322f('0x2a')](function(_0x45ce46){return db[_0x322f('0x6e')][_0x322f('0x6f')](function(_0x2a275b){return _0x45ce46[_0x322f('0x67')](_0x4c26f9,{'transaction':_0x2a275b})['then'](function(){return BPromise[_0x322f('0x70')](_0x3834b6,function(_0x1f12bb){return db[_0x322f('0x59')][_0x322f('0x71')]({'where':{'UserId':_0x1f12bb['id'],'WhatsappQueueId':_0x1674ef[_0x322f('0x4b')]['id']},'transaction':_0x2a275b});});})['then'](function(){_0x3834b6[_0x322f('0x72')](function(_0x4ad96c){socket['emit'](_0x322f('0x73'),{'UserId':_0x4ad96c['id'],'WhatsappQueueId':_0x45ce46['id']});});});});});}})[_0x322f('0x2a')](respondWithStatusCode(_0x4d14af,null))[_0x322f('0x49')](handleError(_0x4d14af,null));};exports[_0x322f('0x74')]=function(_0x2889e4,_0x5b6c42,_0x30de5a){return db[_0x322f('0x75')][_0x322f('0x69')]({'where':{'id':_0x2889e4[_0x322f('0x38')][_0x322f('0x68')]},'attributes':['id'],'include':[{'model':db[_0x322f('0x76')],'as':_0x322f('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x322f('0x2a')](handleEntityNotFound(_0x5b6c42,null))['then'](function(_0x42258f){var _0x59e187=_['map'](_0x42258f,'id');var _0x19345a=[];var _0x1217f8=[];var _0x2a293a=squel['select']();_0x2a293a['field']('tq.TeamId')[_0x322f('0x77')](_0x322f('0x78'),'tq')[_0x322f('0x79')](_0x322f('0x7a'),'ut',_0x322f('0x7b'))['where']('WhatsappQueueId\x20=\x20?',_0x2889e4[_0x322f('0x4b')]['id']);for(var _0x31d167=0x0;_0x31d167<_0x42258f[_0x322f('0x3e')];_0x31d167+=0x1){let _0x5d980d=_0x42258f[_0x31d167];for(var _0x159697=0x0;_0x159697<_0x5d980d['Agents'][_0x322f('0x3e')];_0x159697+=0x1){let _0x29f684=_0x5d980d[_0x322f('0x6a')][_0x159697];var _0x5824eb=_0x2a293a[_0x322f('0x7c')]();_0x5824eb[_0x322f('0x41')](_0x322f('0x7d'),_0x29f684['id']);_0x1217f8['push'](db[_0x322f('0x6e')][_0x322f('0x38')](_0x5824eb[_0x322f('0x7e')](),{'type':db[_0x322f('0x6e')]['QueryTypes'][_0x322f('0x7f')]})['then'](function(_0x1eaa45){if(_0x1eaa45['length']===0x1){return _0x29f684['id'];}else{var _0x3de57c=_['every'](_[_0x322f('0x37')](_0x1eaa45,_0x322f('0x80')),function(_0x23647e){return _[_0x322f('0x81')](_0x59e187,_0x23647e);});if(_0x3de57c){return _0x29f684['id'];}}}));}}return BPromise[_0x322f('0x82')](_0x1217f8)[_0x322f('0x2a')](function(_0x42de5b){_0x19345a=_(_0x19345a)['union'](_0x42de5b)[_0x322f('0x83')]()[_0x322f('0x84')]();return db[_0x322f('0x45')]['find']({'where':{'id':_0x2889e4[_0x322f('0x4b')]['id']}})['then'](function(_0x5cf7b7){return db[_0x322f('0x6e')][_0x322f('0x6f')](function(_0x590c72){return _0x5cf7b7[_0x322f('0x74')](_0x2889e4['query'][_0x322f('0x68')],{'transaction':_0x590c72})[_0x322f('0x2a')](function(){if(!_['isEmpty'](_0x19345a)){return _0x5cf7b7['removeAgents'](_0x19345a,{'transaction':_0x590c72});}})[_0x322f('0x2a')](function(){_0x19345a['forEach'](function(_0x1efc5e){socket[_0x322f('0x85')](_0x322f('0x86'),{'UserId':_0x1efc5e,'WhatsappQueueId':_0x5cf7b7['id']});});});});});});})['then'](respondWithStatusCode(_0x5b6c42,null))[_0x322f('0x49')](handleError(_0x5b6c42,null));};exports[_0x322f('0x87')]=function(_0x38fbf6,_0x4500b5,_0x55e6f9){return db[_0x322f('0x45')][_0x322f('0x4d')]({'where':{'id':_0x38fbf6['params']['id']}})[_0x322f('0x2a')](handleEntityNotFound(_0x4500b5,null))[_0x322f('0x2a')](function(_0x1ef78b){if(_0x1ef78b){return _0x1ef78b[_0x322f('0x87')](_0x38fbf6[_0x322f('0x4f')][_0x322f('0x68')],_[_0x322f('0x88')](_0x38fbf6[_0x322f('0x4f')],[_0x322f('0x68'),'id'])||{})[_0x322f('0x89')](function(_0x4ecfe8){for(var _0x33c4f2=0x0;_0x33c4f2<_0x38fbf6[_0x322f('0x4f')]['ids']['length'];_0x33c4f2+=0x1){socket[_0x322f('0x85')]('userWhatsappQueue:save',{'UserId':Number(_0x38fbf6[_0x322f('0x4f')][_0x322f('0x68')][_0x33c4f2]),'WhatsappQueueId':Number(_0x38fbf6['params']['id'])});}return _0x4ecfe8;});}})[_0x322f('0x2a')](respondWithResult(_0x4500b5,null))['catch'](handleError(_0x4500b5,null));};exports[_0x322f('0x8a')]=function(_0x378836,_0x2ef161,_0x4dec33){return db['WhatsappQueue'][_0x322f('0x4d')]({'where':{'id':_0x378836[_0x322f('0x4b')]['id']}})[_0x322f('0x2a')](handleEntityNotFound(_0x2ef161,null))['then'](function(_0x3ca7f1){if(_0x3ca7f1){return _0x3ca7f1[_0x322f('0x8a')](_0x378836[_0x322f('0x38')][_0x322f('0x68')])[_0x322f('0x2a')](function(){if(_['isArray'](_0x378836['query'][_0x322f('0x68')])){for(var _0x359730=0x0;_0x359730<_0x378836[_0x322f('0x38')][_0x322f('0x68')]['length'];_0x359730+=0x1){socket[_0x322f('0x85')](_0x322f('0x86'),{'UserId':Number(_0x378836[_0x322f('0x38')][_0x322f('0x68')][_0x359730]),'WhatsappQueueId':Number(_0x378836['params']['id'])});}}else{socket['emit'](_0x322f('0x86'),{'UserId':Number(_0x378836[_0x322f('0x38')][_0x322f('0x68')]),'WhatsappQueueId':Number(_0x378836[_0x322f('0x4b')]['id'])});}});}})[_0x322f('0x2a')](respondWithStatusCode(_0x2ef161,null))[_0x322f('0x49')](handleError(_0x2ef161,null));};exports[_0x322f('0x8b')]=function(_0x4eed77,_0x1db808,_0x375751){var _0x98fbcf={};var _0x3800f5={};var _0x17738d;var _0x48791e;return db[_0x322f('0x45')]['findOne']({'where':{'id':_0x4eed77[_0x322f('0x4b')]['id']}})[_0x322f('0x2a')](handleEntityNotFound(_0x1db808,null))[_0x322f('0x2a')](function(_0x2906e4){if(_0x2906e4){_0x17738d=_0x2906e4;_0x3800f5['model']=_[_0x322f('0x39')](db[_0x322f('0x76')][_0x322f('0x32')]);_0x3800f5[_0x322f('0x38')]=_[_0x322f('0x39')](_0x4eed77[_0x322f('0x38')]);_0x3800f5['filters']=_['intersection'](_0x3800f5[_0x322f('0x36')],_0x3800f5[_0x322f('0x38')]);_0x98fbcf[_0x322f('0x3c')]=_[_0x322f('0x3b')](_0x3800f5[_0x322f('0x36')],qs[_0x322f('0x3d')](_0x4eed77[_0x322f('0x38')][_0x322f('0x3d')]));_0x98fbcf['attributes']=_0x98fbcf[_0x322f('0x3c')][_0x322f('0x3e')]?_0x98fbcf[_0x322f('0x3c')]:_0x3800f5[_0x322f('0x36')];_0x98fbcf[_0x322f('0x3f')]=qs['sort'](_0x4eed77['query'][_0x322f('0x40')]);_0x98fbcf[_0x322f('0x41')]=qs['filters'](_[_0x322f('0x66')](_0x4eed77[_0x322f('0x38')],_0x3800f5[_0x322f('0x3a')]));if(_0x4eed77['query'][_0x322f('0x42')]){_0x98fbcf[_0x322f('0x41')]=_[_0x322f('0x4c')](_0x98fbcf[_0x322f('0x41')],{'$or':_['map'](_0x98fbcf[_0x322f('0x3c')],function(_0x2d98ef){var _0x416ec1={};_0x416ec1[_0x2d98ef]={'$like':'%'+_0x4eed77[_0x322f('0x38')][_0x322f('0x42')]+'%'};return _0x416ec1;})});}_0x98fbcf=_['merge']({},_0x98fbcf,_0x4eed77[_0x322f('0x44')]);return _0x17738d[_0x322f('0x8b')](_0x98fbcf);}})[_0x322f('0x2a')](function(_0xce688c){if(_0xce688c){_0x48791e=_0xce688c['length'];if(!_0x4eed77[_0x322f('0x38')]['hasOwnProperty'](_0x322f('0x8c'))){_0x98fbcf[_0x322f('0x24')]=qs['limit'](_0x4eed77[_0x322f('0x38')][_0x322f('0x24')]);_0x98fbcf[_0x322f('0x22')]=qs[_0x322f('0x22')](_0x4eed77['query'][_0x322f('0x22')]);}return _0x17738d[_0x322f('0x8b')](_0x98fbcf);}})[_0x322f('0x2a')](function(_0x5f26b5){if(_0x5f26b5){return _0x5f26b5?{'count':_0x48791e,'rows':_0x5f26b5}:null;}})[_0x322f('0x2a')](respondWithResult(_0x1db808,null))[_0x322f('0x49')](handleError(_0x1db808,null));};
\ No newline at end of file
index 3803ff8..10c802e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf852=['WhatsappQueue','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf852,0x74));var _0x2f85=function(_0x3ac4f4,_0x3467fe){_0x3ac4f4=_0x3ac4f4-0x0;var _0xfc21fc=_0xf852[_0x3ac4f4];return _0xfc21fc;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x2f85('0x0'))['db'][_0x2f85('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2f85('0x2'),'afterUpdate':_0x2f85('0x3'),'afterDestroy':_0x2f85('0x4')};function emitEvent(_0x485c62){return function(_0x140774,_0x2afbab,_0x207efa){WhatsappQueueEvents[_0x2f85('0x5')](_0x485c62+':'+_0x140774['id'],_0x140774);WhatsappQueueEvents[_0x2f85('0x5')](_0x485c62,_0x140774);_0x207efa(null);};}for(var e in events){if(events[_0x2f85('0x6')](e)){var event=events[e];WhatsappQueue[_0x2f85('0x7')](e,emitEvent(event));}}module[_0x2f85('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0xb52b=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','save','update'];(function(_0x543405,_0x332b29){var _0x5c5c7c=function(_0x4a8c8c){while(--_0x4a8c8c){_0x543405['push'](_0x543405['shift']());}};_0x5c5c7c(++_0x332b29);}(_0xb52b,0x152));var _0xbb52=function(_0x1b1245,_0x5cb32b){_0x1b1245=_0x1b1245-0x0;var _0x12da2e=_0xb52b[_0x1b1245];return _0x12da2e;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xbb52('0x0'))['db'][_0xbb52('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbb52('0x2'),'afterUpdate':_0xbb52('0x3'),'afterDestroy':_0xbb52('0x4')};function emitEvent(_0x59f10a){return function(_0x1afa09,_0x57bded,_0x59ac2e){WhatsappQueueEvents['emit'](_0x59f10a+':'+_0x1afa09['id'],_0x1afa09);WhatsappQueueEvents[_0xbb52('0x5')](_0x59f10a,_0x1afa09);_0x59ac2e(null);};}for(var e in events){if(events[_0xbb52('0x6')](e)){var event=events[e];WhatsappQueue[_0xbb52('0x7')](e,emitEvent(event));}}module[_0xbb52('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
index 85fb9a2..b9913bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f49=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x1f49,0x182));var _0x91f4=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x1f49[_0x365e54];return _0x13317a;};'use strict';var _=require(_0x91f4('0x0'));var util=require(_0x91f4('0x1'));var logger=require(_0x91f4('0x2'))(_0x91f4('0x3'));var moment=require(_0x91f4('0x4'));var BPromise=require(_0x91f4('0x5'));var rp=require(_0x91f4('0x6'));var fs=require('fs');var path=require(_0x91f4('0x7'));var rimraf=require(_0x91f4('0x8'));var config=require(_0x91f4('0x9'));var attributes=require(_0x91f4('0xa'));module[_0x91f4('0xb')]=function(_0x5d8ec9,_0xe6d5d){return _0x5d8ec9[_0x91f4('0xc')](_0x91f4('0xd'),attributes,{'tableName':_0x91f4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa8d=['./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xaa8d,0x7b));var _0xdaa8=function(_0x1df5ad,_0x605c13){_0x1df5ad=_0x1df5ad-0x0;var _0x90a14b=_0xaa8d[_0x1df5ad];return _0x90a14b;};'use strict';var _=require(_0xdaa8('0x0'));var util=require(_0xdaa8('0x1'));var logger=require(_0xdaa8('0x2'))(_0xdaa8('0x3'));var moment=require(_0xdaa8('0x4'));var BPromise=require(_0xdaa8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdaa8('0x6'));var config=require('../../config/environment');var attributes=require(_0xdaa8('0x7'));module['exports']=function(_0x18474b,_0x2bef5f){return _0x18474b['define'](_0xdaa8('0x8'),attributes,{'tableName':_0xdaa8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 933d6f3..37f9c3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf25f=['catch','ShowWhatsappQueue','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model'];(function(_0x559528,_0x455857){var _0x567e33=function(_0xbc0b9f){while(--_0xbc0b9f){_0x559528['push'](_0x559528['shift']());}};_0x567e33(++_0x455857);}(_0xf25f,0x1d7));var _0xff25=function(_0x4e967a,_0x1e4651){_0x4e967a=_0x4e967a-0x0;var _0x46e0c5=_0xf25f[_0x4e967a];return _0x46e0c5;};'use strict';var _=require(_0xff25('0x0'));var util=require(_0xff25('0x1'));var moment=require('moment');var BPromise=require(_0xff25('0x2'));var rs=require(_0xff25('0x3'));var fs=require('fs');var Redis=require(_0xff25('0x4'));var db=require(_0xff25('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff25('0x6'))(_0xff25('0x7'));var config=require(_0xff25('0x8'));var jayson=require(_0xff25('0x9'));var client=jayson[_0xff25('0xa')][_0xff25('0xb')]({'port':0x232a});config[_0xff25('0xc')]=_['defaults'](config[_0xff25('0xc')],{'host':_0xff25('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff25('0xc')]));require(_0xff25('0xe'))[_0xff25('0xf')](socket);function respondWithRpcPromise(_0x85fe39,_0x55d9fc,_0x1340b5){return new BPromise(function(_0x246d95,_0x126253){return client[_0xff25('0x10')](_0x85fe39,_0x1340b5)[_0xff25('0x11')](function(_0x249a6d){logger[_0xff25('0x12')](_0xff25('0x13'),_0x55d9fc,_0xff25('0x14'));logger[_0xff25('0x15')](_0xff25('0x16'),_0x55d9fc,'request\x20sent',JSON['stringify'](_0x249a6d));if(_0x249a6d[_0xff25('0x17')]){if(_0x249a6d['error'][_0xff25('0x18')]===0x1f4){logger[_0xff25('0x17')](_0xff25('0x13'),_0x55d9fc,_0x249a6d[_0xff25('0x17')][_0xff25('0x19')]);return _0x126253(_0x249a6d['error']['message']);}logger['error'](_0xff25('0x13'),_0x55d9fc,_0x249a6d[_0xff25('0x17')]['message']);return _0x246d95(_0x249a6d[_0xff25('0x17')][_0xff25('0x19')]);}else{logger[_0xff25('0x12')](_0xff25('0x13'),_0x55d9fc,_0xff25('0x14'));_0x246d95(_0x249a6d['result'][_0xff25('0x19')]);}})['catch'](function(_0x3f1896){logger['error'](_0xff25('0x13'),_0x55d9fc,_0x3f1896);_0x126253(_0x3f1896);});});}exports[_0xff25('0x1a')]=function(_0x3eab20){var _0x5a3035=this;return new Promise(function(_0x21f15b,_0x7a5726){return db[_0xff25('0x1b')][_0xff25('0x1c')]({'raw':_0x3eab20[_0xff25('0x1d')]?_0x3eab20[_0xff25('0x1d')][_0xff25('0x1e')]===undefined?!![]:![]:!![],'where':_0x3eab20[_0xff25('0x1d')]?_0x3eab20[_0xff25('0x1d')][_0xff25('0x1f')]||null:null,'attributes':_0x3eab20[_0xff25('0x1d')]?_0x3eab20[_0xff25('0x1d')][_0xff25('0x20')]||null:null,'limit':_0x3eab20[_0xff25('0x1d')]?_0x3eab20[_0xff25('0x1d')]['limit']||null:null,'include':_0x3eab20[_0xff25('0x1d')]?_0x3eab20[_0xff25('0x1d')][_0xff25('0x21')]?_[_0xff25('0x22')](_0x3eab20[_0xff25('0x1d')][_0xff25('0x21')],function(_0x3c6c59){return{'model':db[_0x3c6c59['model']],'as':_0x3c6c59['as'],'attributes':_0x3c6c59['attributes'],'include':_0x3c6c59[_0xff25('0x21')]?_[_0xff25('0x22')](_0x3c6c59[_0xff25('0x21')],function(_0x47d182){return{'model':db[_0x47d182[_0xff25('0x23')]],'as':_0x47d182['as'],'attributes':_0x47d182[_0xff25('0x20')],'include':_0x47d182['include']?_['map'](_0x47d182[_0xff25('0x21')],function(_0x5e3107){return{'model':db[_0x5e3107['model']],'as':_0x5e3107['as'],'attributes':_0x5e3107['attributes']};}):[]};}):[]};}):[]:[]})[_0xff25('0x11')](function(_0x4934d3){logger[_0xff25('0x12')](_0xff25('0x1a'),_0x3eab20);logger['debug'](_0xff25('0x1a'),_0x3eab20,JSON['stringify'](_0x4934d3));_0x21f15b(_0x4934d3);})[_0xff25('0x24')](function(_0x21b6ae){logger[_0xff25('0x17')](_0xff25('0x1a'),_0x21b6ae[_0xff25('0x19')],_0x3eab20);_0x7a5726(_0x5a3035['error'](0x1f4,_0x21b6ae[_0xff25('0x19')]));});});};exports[_0xff25('0x25')]=function(_0x52fb52){var _0x135c4d=this;return new Promise(function(_0x5c1927,_0x23f0c3){return db[_0xff25('0x1b')]['find']({'raw':_0x52fb52[_0xff25('0x1d')]?_0x52fb52['options'][_0xff25('0x1e')]===undefined?!![]:![]:!![],'where':_0x52fb52[_0xff25('0x1d')]?_0x52fb52[_0xff25('0x1d')]['where']||null:null,'attributes':_0x52fb52[_0xff25('0x1d')]?_0x52fb52['options']['attributes']||null:null,'include':_0x52fb52[_0xff25('0x1d')]?_0x52fb52[_0xff25('0x1d')]['include']?_['map'](_0x52fb52['options']['include'],function(_0x1dc636){return{'model':db[_0x1dc636['model']],'as':_0x1dc636['as'],'attributes':_0x1dc636[_0xff25('0x20')],'include':_0x1dc636[_0xff25('0x21')]?_[_0xff25('0x22')](_0x1dc636[_0xff25('0x21')],function(_0x31e2ef){return{'model':db[_0x31e2ef[_0xff25('0x23')]],'as':_0x31e2ef['as'],'attributes':_0x31e2ef[_0xff25('0x20')],'include':_0x31e2ef[_0xff25('0x21')]?_[_0xff25('0x22')](_0x31e2ef[_0xff25('0x21')],function(_0x592ddc){return{'model':db[_0x592ddc['model']],'as':_0x592ddc['as'],'attributes':_0x592ddc[_0xff25('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32bafa){logger[_0xff25('0x12')](_0xff25('0x25'),_0x52fb52);logger[_0xff25('0x15')]('ShowWhatsappQueue',_0x52fb52,JSON[_0xff25('0x26')](_0x32bafa));_0x5c1927(_0x32bafa);})[_0xff25('0x24')](function(_0x45c772){logger['error'](_0xff25('0x25'),_0x45c772['message'],_0x52fb52);_0x23f0c3(_0x135c4d[_0xff25('0x17')](0x1f4,_0x45c772[_0xff25('0x19')]));});});};
\ No newline at end of file
+var _0x0fc0=['./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','catch','ShowWhatsappQueue','find','raw','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x4ccca5,_0x400e59){var _0x4e5ec8=function(_0x49705d){while(--_0x49705d){_0x4ccca5['push'](_0x4ccca5['shift']());}};_0x4e5ec8(++_0x400e59);}(_0x0fc0,0xbb));var _0x00fc=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0fc0[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x00fc('0x0'));var util=require(_0x00fc('0x1'));var moment=require(_0x00fc('0x2'));var BPromise=require(_0x00fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00fc('0x4'));var db=require(_0x00fc('0x5'))['db'];var utils=require(_0x00fc('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x00fc('0x7')][_0x00fc('0x8')]({'port':0x232a});config[_0x00fc('0x9')]=_[_0x00fc('0xa')](config[_0x00fc('0x9')],{'host':_0x00fc('0xb'),'port':0x18eb});var socket=require(_0x00fc('0xc'))(new Redis(config[_0x00fc('0x9')]));require(_0x00fc('0xd'))[_0x00fc('0xe')](socket);function respondWithRpcPromise(_0x40a4e4,_0x3aa194,_0x380cab){return new BPromise(function(_0xae4017,_0x3c101d){return client[_0x00fc('0xf')](_0x40a4e4,_0x380cab)[_0x00fc('0x10')](function(_0x47576c){logger[_0x00fc('0x11')](_0x00fc('0x12'),_0x3aa194,_0x00fc('0x13'));logger[_0x00fc('0x14')](_0x00fc('0x15'),_0x3aa194,_0x00fc('0x13'),JSON[_0x00fc('0x16')](_0x47576c));if(_0x47576c[_0x00fc('0x17')]){if(_0x47576c[_0x00fc('0x17')]['code']===0x1f4){logger['error'](_0x00fc('0x12'),_0x3aa194,_0x47576c[_0x00fc('0x17')][_0x00fc('0x18')]);return _0x3c101d(_0x47576c['error']['message']);}logger[_0x00fc('0x17')](_0x00fc('0x12'),_0x3aa194,_0x47576c[_0x00fc('0x17')]['message']);return _0xae4017(_0x47576c[_0x00fc('0x17')][_0x00fc('0x18')]);}else{logger[_0x00fc('0x11')](_0x00fc('0x12'),_0x3aa194,'request\x20sent');_0xae4017(_0x47576c[_0x00fc('0x19')][_0x00fc('0x18')]);}})['catch'](function(_0x4d1c32){logger[_0x00fc('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x3aa194,_0x4d1c32);_0x3c101d(_0x4d1c32);});});}exports[_0x00fc('0x1a')]=function(_0x539848){var _0x55d966=this;return new Promise(function(_0x10c16c,_0x6d948e){return db[_0x00fc('0x1b')][_0x00fc('0x1c')]({'raw':_0x539848[_0x00fc('0x1d')]?_0x539848[_0x00fc('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x539848[_0x00fc('0x1d')]?_0x539848[_0x00fc('0x1d')][_0x00fc('0x1e')]||null:null,'attributes':_0x539848[_0x00fc('0x1d')]?_0x539848[_0x00fc('0x1d')][_0x00fc('0x1f')]||null:null,'limit':_0x539848['options']?_0x539848[_0x00fc('0x1d')][_0x00fc('0x20')]||null:null,'include':_0x539848['options']?_0x539848[_0x00fc('0x1d')][_0x00fc('0x21')]?_[_0x00fc('0x22')](_0x539848[_0x00fc('0x1d')][_0x00fc('0x21')],function(_0x10537f){return{'model':db[_0x10537f['model']],'as':_0x10537f['as'],'attributes':_0x10537f['attributes'],'include':_0x10537f[_0x00fc('0x21')]?_[_0x00fc('0x22')](_0x10537f[_0x00fc('0x21')],function(_0x5174b1){return{'model':db[_0x5174b1['model']],'as':_0x5174b1['as'],'attributes':_0x5174b1[_0x00fc('0x1f')],'include':_0x5174b1[_0x00fc('0x21')]?_[_0x00fc('0x22')](_0x5174b1['include'],function(_0x31366f){return{'model':db[_0x31366f['model']],'as':_0x31366f['as'],'attributes':_0x31366f[_0x00fc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x00fc('0x10')](function(_0x43ba61){logger[_0x00fc('0x11')](_0x00fc('0x1a'),_0x539848);logger[_0x00fc('0x14')](_0x00fc('0x1a'),_0x539848,JSON[_0x00fc('0x16')](_0x43ba61));_0x10c16c(_0x43ba61);})[_0x00fc('0x23')](function(_0x152eb7){logger[_0x00fc('0x17')]('GetWhatsappQueue',_0x152eb7[_0x00fc('0x18')],_0x539848);_0x6d948e(_0x55d966['error'](0x1f4,_0x152eb7[_0x00fc('0x18')]));});});};exports[_0x00fc('0x24')]=function(_0x34593c){var _0x4295f9=this;return new Promise(function(_0x26b4f7,_0x8886d6){return db[_0x00fc('0x1b')][_0x00fc('0x25')]({'raw':_0x34593c['options']?_0x34593c[_0x00fc('0x1d')][_0x00fc('0x26')]===undefined?!![]:![]:!![],'where':_0x34593c[_0x00fc('0x1d')]?_0x34593c['options']['where']||null:null,'attributes':_0x34593c['options']?_0x34593c[_0x00fc('0x1d')]['attributes']||null:null,'include':_0x34593c[_0x00fc('0x1d')]?_0x34593c[_0x00fc('0x1d')][_0x00fc('0x21')]?_[_0x00fc('0x22')](_0x34593c[_0x00fc('0x1d')][_0x00fc('0x21')],function(_0x43ca0f){return{'model':db[_0x43ca0f['model']],'as':_0x43ca0f['as'],'attributes':_0x43ca0f[_0x00fc('0x1f')],'include':_0x43ca0f['include']?_[_0x00fc('0x22')](_0x43ca0f[_0x00fc('0x21')],function(_0x1aa400){return{'model':db[_0x1aa400[_0x00fc('0x27')]],'as':_0x1aa400['as'],'attributes':_0x1aa400['attributes'],'include':_0x1aa400['include']?_['map'](_0x1aa400['include'],function(_0x4ca6cb){return{'model':db[_0x4ca6cb[_0x00fc('0x27')]],'as':_0x4ca6cb['as'],'attributes':_0x4ca6cb[_0x00fc('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x524cbd){logger[_0x00fc('0x11')](_0x00fc('0x24'),_0x34593c);logger[_0x00fc('0x14')](_0x00fc('0x24'),_0x34593c,JSON[_0x00fc('0x16')](_0x524cbd));_0x26b4f7(_0x524cbd);})['catch'](function(_0x12c9af){logger['error'](_0x00fc('0x24'),_0x12c9af[_0x00fc('0x18')],_0x34593c);_0x8886d6(_0x4295f9[_0x00fc('0x17')](0x1f4,_0x12c9af['message']));});});};
\ No newline at end of file
index 23a8bd8..40e9ca1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5095=['removeListener','register','length','whatsappQueue:','save','remove','update'];(function(_0x266219,_0x3428b4){var _0x4c79df=function(_0x49044c){while(--_0x49044c){_0x266219['push'](_0x266219['shift']());}};_0x4c79df(++_0x3428b4);}(_0x5095,0xac));var _0x5509=function(_0x51fe23,_0x270ca9){_0x51fe23=_0x51fe23-0x0;var _0x4fdfbb=_0x5095[_0x51fe23];return _0x4fdfbb;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x5509('0x0'),_0x5509('0x1'),_0x5509('0x2')];function createListener(_0x29cd93,_0x160a45){return function(_0x2cfb5e){_0x160a45['emit'](_0x29cd93,_0x2cfb5e);};}function removeListener(_0x387dfd,_0x4b438f){return function(){WhatsappQueueEvents[_0x5509('0x3')](_0x387dfd,_0x4b438f);};}exports[_0x5509('0x4')]=function(_0x177f2d){for(var _0x1f09be=0x0,_0x5c06b0=events[_0x5509('0x5')];_0x1f09be<_0x5c06b0;_0x1f09be++){var _0x5fa064=events[_0x1f09be];var _0x42fe43=createListener(_0x5509('0x6')+_0x5fa064,_0x177f2d);WhatsappQueueEvents['on'](_0x5fa064,_0x42fe43);}};
\ No newline at end of file
+var _0x671d=['register','length','./whatsappQueue.events','save','remove','update','emit'];(function(_0x386ee7,_0x22c4cb){var _0x5798c1=function(_0x47b87a){while(--_0x47b87a){_0x386ee7['push'](_0x386ee7['shift']());}};_0x5798c1(++_0x22c4cb);}(_0x671d,0xb1));var _0xd671=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0x671d[_0x33c1b1];return _0x2c2037;};'use strict';var WhatsappQueueEvents=require(_0xd671('0x0'));var events=[_0xd671('0x1'),_0xd671('0x2'),_0xd671('0x3')];function createListener(_0x1a57a8,_0x38ead0){return function(_0x21c75b){_0x38ead0[_0xd671('0x4')](_0x1a57a8,_0x21c75b);};}function removeListener(_0x5e2819,_0x2b2afa){return function(){WhatsappQueueEvents['removeListener'](_0x5e2819,_0x2b2afa);};}exports[_0xd671('0x5')]=function(_0x2b4d06){for(var _0x16706d=0x0,_0x1ffaa7=events[_0xd671('0x6')];_0x16706d<_0x1ffaa7;_0x16706d++){var _0x39bafe=events[_0x16706d];var _0x5d78df=createListener('whatsappQueue:'+_0x39bafe,_0x2b4d06);WhatsappQueueEvents['on'](_0x39bafe,_0x5d78df);}};
\ No newline at end of file
index 6ed4218..b6c7cf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a1=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x2f5dcf,_0x1ba71e){var _0x3327e3=function(_0x239030){while(--_0x239030){_0x2f5dcf['push'](_0x2f5dcf['shift']());}};_0x3327e3(++_0x1ba71e);}(_0xd3a1,0x7e));var _0x1d3a=function(_0x534cdd,_0x22a5f5){_0x534cdd=_0x534cdd-0x0;var _0x67eead=_0xd3a1[_0x534cdd];return _0x67eead;};'use strict';var multer=require(_0x1d3a('0x0'));var util=require(_0x1d3a('0x1'));var path=require(_0x1d3a('0x2'));var timeout=require(_0x1d3a('0x3'));var express=require(_0x1d3a('0x4'));var router=express[_0x1d3a('0x5')]();var fs_extra=require(_0x1d3a('0x6'));var auth=require(_0x1d3a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1d3a('0x8'));var controller=require(_0x1d3a('0x9'));router[_0x1d3a('0xa')]('/',auth[_0x1d3a('0xb')](),controller[_0x1d3a('0xc')]);router[_0x1d3a('0xa')](_0x1d3a('0xd'),auth['isAuthenticated'](),controller[_0x1d3a('0xe')]);router[_0x1d3a('0xa')]('/:id',auth[_0x1d3a('0xb')](),controller[_0x1d3a('0xf')]);router[_0x1d3a('0x10')]('/',auth[_0x1d3a('0xb')](),controller[_0x1d3a('0x11')]);router[_0x1d3a('0x12')](_0x1d3a('0x13'),auth[_0x1d3a('0xb')](),controller[_0x1d3a('0x14')]);router[_0x1d3a('0x15')]('/:id',auth[_0x1d3a('0xb')](),controller[_0x1d3a('0x16')]);module[_0x1d3a('0x17')]=router;
\ No newline at end of file
+var _0x1298=['delete','exports','connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x4ffd71,_0x5d1866){var _0x471287=function(_0x4e38cd){while(--_0x4e38cd){_0x4ffd71['push'](_0x4ffd71['shift']());}};_0x471287(++_0x5d1866);}(_0x1298,0x1a0));var _0x8129=function(_0xdba5a6,_0x19d2fe){_0xdba5a6=_0xdba5a6-0x0;var _0xe3a989=_0x1298[_0xdba5a6];return _0xe3a989;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8129('0x0'));var express=require(_0x8129('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8129('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x8129('0x3'));var controller=require(_0x8129('0x4'));router[_0x8129('0x5')]('/',auth[_0x8129('0x6')](),controller[_0x8129('0x7')]);router[_0x8129('0x5')](_0x8129('0x8'),auth[_0x8129('0x6')](),controller[_0x8129('0x9')]);router[_0x8129('0x5')](_0x8129('0xa'),auth[_0x8129('0x6')](),controller[_0x8129('0xb')]);router[_0x8129('0xc')]('/',auth['isAuthenticated'](),controller[_0x8129('0xd')]);router[_0x8129('0xe')](_0x8129('0xa'),auth['isAuthenticated'](),controller[_0x8129('0xf')]);router[_0x8129('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8129('0x11')]=router;
\ No newline at end of file
index c955bbf..fa2678f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x2fa996,_0x3122f8){var _0x4d5702=function(_0x3f268e){while(--_0x3f268e){_0x2fa996['push'](_0x2fa996['shift']());}};_0x4d5702(++_0x3122f8);}(_0x7a54,0x106));var _0x47a5=function(_0x3d06b9,_0x14c28a){_0x3d06b9=_0x3d06b9-0x0;var _0xffbfb6=_0x7a54[_0x3d06b9];return _0xffbfb6;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x4cdf7d,_0xe52d49){var _0x49a8fa=function(_0x4263d7){while(--_0x4263d7){_0x4cdf7d['push'](_0x4cdf7d['shift']());}};_0x49a8fa(++_0xe52d49);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
index f887a98..a4f2719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9be=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','WhatsappQueueReport','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','options','includeAll','include','show','params','rawAttributes','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xb9be,0xc5));var _0xeb9b=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb9be[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];function respondWithStatusCode(_0x3df18a,_0x2a01df){_0x2a01df=_0x2a01df||0xcc;return function(_0x51598f){if(_0x51598f){return _0x3df18a['sendStatus'](_0x2a01df);}return _0x3df18a['status'](_0x2a01df)[_0xeb9b('0x19')]();};}function respondWithResult(_0x1ef03f,_0x2674e6){_0x2674e6=_0x2674e6||0xc8;return function(_0x4ec46d){if(_0x4ec46d){return _0x1ef03f['status'](_0x2674e6)['json'](_0x4ec46d);}};}function respondWithFilteredResult(_0x32538b,_0x1a5f27){return function(_0x406afd){if(_0x406afd){var _0x3fa308=typeof _0x1a5f27[_0xeb9b('0x1a')]===_0xeb9b('0x1b')&&typeof _0x1a5f27[_0xeb9b('0x1c')]==='undefined';var _0x2e8645=_0x406afd[_0xeb9b('0x1d')];var _0x21aca6=_0x3fa308?0x0:_0x1a5f27[_0xeb9b('0x1a')];var _0x3cbe3e=_0x3fa308?_0x406afd[_0xeb9b('0x1d')]:_0x1a5f27[_0xeb9b('0x1a')]+_0x1a5f27[_0xeb9b('0x1c')];var _0x2c199f;if(_0x3cbe3e>=_0x2e8645){_0x3cbe3e=_0x2e8645;_0x2c199f=0xc8;}else{_0x2c199f=0xce;}_0x32538b[_0xeb9b('0x1e')](_0x2c199f);return _0x32538b['set'](_0xeb9b('0x1f'),_0x21aca6+'-'+_0x3cbe3e+'/'+_0x2e8645)['json'](_0x406afd);}return null;};}function patchUpdates(_0x5d5f54){return function(_0x580498){try{jsonpatch[_0xeb9b('0x20')](_0x580498,_0x5d5f54,!![]);}catch(_0x4ab4b8){return BPromise[_0xeb9b('0x21')](_0x4ab4b8);}return _0x580498[_0xeb9b('0x22')]();};}function saveUpdates(_0x37935c,_0x37d7e0){return function(_0x3c8be7){if(_0x3c8be7){return _0x3c8be7[_0xeb9b('0x23')](_0x37935c)[_0xeb9b('0x24')](function(_0x15e5b8){return _0x15e5b8;});}return null;};}function removeEntity(_0x142d1c,_0x46df93){return function(_0x61c86d){if(_0x61c86d){return _0x61c86d[_0xeb9b('0x25')]()[_0xeb9b('0x24')](function(){_0x142d1c[_0xeb9b('0x1e')](0xcc)[_0xeb9b('0x19')]();});}};}function handleEntityNotFound(_0x434461,_0x4c997e){return function(_0xd57390){if(!_0xd57390){_0x434461['sendStatus'](0x194);}return _0xd57390;};}function handleError(_0x66a567,_0x5d6846){_0x5d6846=_0x5d6846||0x1f4;return function(_0x347ec1){logger[_0xeb9b('0x26')](_0x347ec1[_0xeb9b('0x27')]);if(_0x347ec1[_0xeb9b('0x28')]){delete _0x347ec1['name'];}_0x66a567[_0xeb9b('0x1e')](_0x5d6846)[_0xeb9b('0x29')](_0x347ec1);};}exports['index']=function(_0x35ff07,_0x33bb1d){var _0x5ce745={},_0x2a4b51={},_0x2ea20f={'count':0x0,'rows':[]};var _0x4188d5=_['map'](db[_0xeb9b('0x2a')]['rawAttributes'],function(_0x6bb66){return{'name':_0x6bb66['fieldName'],'type':_0x6bb66[_0xeb9b('0x2b')]['key']};});_0x2a4b51[_0xeb9b('0x2c')]=_['map'](_0x4188d5,_0xeb9b('0x28'));_0x2a4b51['query']=_[_0xeb9b('0x2d')](_0x35ff07[_0xeb9b('0x2e')]);_0x2a4b51[_0xeb9b('0x2f')]=_[_0xeb9b('0x30')](_0x2a4b51[_0xeb9b('0x2c')],_0x2a4b51[_0xeb9b('0x2e')]);_0x5ce745[_0xeb9b('0x31')]=_[_0xeb9b('0x30')](_0x2a4b51[_0xeb9b('0x2c')],qs[_0xeb9b('0x32')](_0x35ff07['query'][_0xeb9b('0x32')]));_0x5ce745[_0xeb9b('0x31')]=_0x5ce745[_0xeb9b('0x31')][_0xeb9b('0x33')]?_0x5ce745[_0xeb9b('0x31')]:_0x2a4b51[_0xeb9b('0x2c')];if(!_0x35ff07[_0xeb9b('0x2e')]['hasOwnProperty'](_0xeb9b('0x34'))){_0x5ce745[_0xeb9b('0x1c')]=qs[_0xeb9b('0x1c')](_0x35ff07['query'][_0xeb9b('0x1c')]);_0x5ce745[_0xeb9b('0x1a')]=qs[_0xeb9b('0x1a')](_0x35ff07[_0xeb9b('0x2e')][_0xeb9b('0x1a')]);}_0x5ce745[_0xeb9b('0x35')]=qs['sort'](_0x35ff07[_0xeb9b('0x2e')][_0xeb9b('0x36')]);_0x5ce745['where']=qs[_0xeb9b('0x2f')](_[_0xeb9b('0x37')](_0x35ff07[_0xeb9b('0x2e')],_0x2a4b51[_0xeb9b('0x2f')]),_0x4188d5);if(_0x35ff07[_0xeb9b('0x2e')][_0xeb9b('0x38')]){_0x5ce745[_0xeb9b('0x39')]=_['merge'](_0x5ce745[_0xeb9b('0x39')],{'$or':_[_0xeb9b('0x3a')](_0x4188d5,function(_0x3b5472){if(_0x3b5472['type']!=='VIRTUAL'){var _0x4eacc3={};_0x4eacc3[_0x3b5472[_0xeb9b('0x28')]]={'$like':'%'+_0x35ff07[_0xeb9b('0x2e')][_0xeb9b('0x38')]+'%'};return _0x4eacc3;}})});}_0x5ce745=_['merge']({},_0x5ce745,_0x35ff07[_0xeb9b('0x3b')]);var _0x9b36ae={'where':_0x5ce745[_0xeb9b('0x39')]};return db[_0xeb9b('0x2a')][_0xeb9b('0x1d')](_0x9b36ae)[_0xeb9b('0x24')](function(_0x377c9d){_0x2ea20f['count']=_0x377c9d;if(_0x35ff07[_0xeb9b('0x2e')][_0xeb9b('0x3c')]){_0x5ce745[_0xeb9b('0x3d')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x5ce745);})[_0xeb9b('0x24')](function(_0x110122){_0x2ea20f['rows']=_0x110122;return _0x2ea20f;})[_0xeb9b('0x24')](respondWithFilteredResult(_0x33bb1d,_0x5ce745))['catch'](handleError(_0x33bb1d,null));};exports[_0xeb9b('0x3e')]=function(_0xcce4da,_0x28b075){var _0x300565={'raw':!![],'where':{'id':_0xcce4da[_0xeb9b('0x3f')]['id']}},_0xbee63e={};_0xbee63e[_0xeb9b('0x2c')]=_[_0xeb9b('0x2d')](db[_0xeb9b('0x2a')][_0xeb9b('0x40')]);_0xbee63e[_0xeb9b('0x2e')]=_[_0xeb9b('0x2d')](_0xcce4da['query']);_0xbee63e['filters']=_[_0xeb9b('0x30')](_0xbee63e['model'],_0xbee63e[_0xeb9b('0x2e')]);_0x300565[_0xeb9b('0x31')]=_[_0xeb9b('0x30')](_0xbee63e['model'],qs[_0xeb9b('0x32')](_0xcce4da[_0xeb9b('0x2e')]['fields']));_0x300565[_0xeb9b('0x31')]=_0x300565[_0xeb9b('0x31')][_0xeb9b('0x33')]?_0x300565[_0xeb9b('0x31')]:_0xbee63e[_0xeb9b('0x2c')];if(_0xcce4da[_0xeb9b('0x2e')][_0xeb9b('0x3c')]){_0x300565[_0xeb9b('0x3d')]=[{'all':!![]}];}_0x300565=_['merge']({},_0x300565,_0xcce4da['options']);return db[_0xeb9b('0x2a')]['find'](_0x300565)['then'](handleEntityNotFound(_0x28b075,null))[_0xeb9b('0x24')](respondWithResult(_0x28b075,null))[_0xeb9b('0x41')](handleError(_0x28b075,null));};exports[_0xeb9b('0x42')]=function(_0x195f5a,_0x45bc74){return db[_0xeb9b('0x2a')]['create'](_0x195f5a['body'],{})['then'](respondWithResult(_0x45bc74,0xc9))[_0xeb9b('0x41')](handleError(_0x45bc74,null));};exports['update']=function(_0x4901b0,_0x2ee59c){if(_0x4901b0[_0xeb9b('0x43')]['id']){delete _0x4901b0[_0xeb9b('0x43')]['id'];}return db[_0xeb9b('0x2a')][_0xeb9b('0x44')]({'where':{'id':_0x4901b0[_0xeb9b('0x3f')]['id']}})[_0xeb9b('0x24')](handleEntityNotFound(_0x2ee59c,null))[_0xeb9b('0x24')](saveUpdates(_0x4901b0[_0xeb9b('0x43')],null))['then'](respondWithResult(_0x2ee59c,null))['catch'](handleError(_0x2ee59c,null));};exports[_0xeb9b('0x25')]=function(_0x21c93a,_0x542ef4){return db[_0xeb9b('0x2a')]['find']({'where':{'id':_0x21c93a[_0xeb9b('0x3f')]['id']}})[_0xeb9b('0x24')](handleEntityNotFound(_0x542ef4,null))['then'](removeEntity(_0x542ef4,null))['catch'](handleError(_0x542ef4,null));};exports['describe']=function(_0x211238,_0x32d8cd){return db[_0xeb9b('0x2a')]['describe']()['then'](respondWithResult(_0x32d8cd,null))[_0xeb9b('0x41')](handleError(_0x32d8cd,null));};
\ No newline at end of file
+var _0x1c9a=['eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe'];(function(_0x3af270,_0x5675b4){var _0x1dc18a=function(_0x310711){while(--_0x310711){_0x3af270['push'](_0x3af270['shift']());}};_0x1dc18a(++_0x5675b4);}(_0x1c9a,0x98));var _0xa1c9=function(_0x2ba719,_0x1bc88b){_0x2ba719=_0x2ba719-0x0;var _0x54253b=_0x1c9a[_0x2ba719];return _0x54253b;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];function respondWithStatusCode(_0x17ee28,_0x57e2a8){_0x57e2a8=_0x57e2a8||0xcc;return function(_0x341233){if(_0x341233){return _0x17ee28[_0xa1c9('0x19')](_0x57e2a8);}return _0x17ee28[_0xa1c9('0x1a')](_0x57e2a8)[_0xa1c9('0x1b')]();};}function respondWithResult(_0x13f4e9,_0x4c70dd){_0x4c70dd=_0x4c70dd||0xc8;return function(_0x335dda){if(_0x335dda){return _0x13f4e9[_0xa1c9('0x1a')](_0x4c70dd)[_0xa1c9('0x1c')](_0x335dda);}};}function respondWithFilteredResult(_0xd9bca1,_0x2d825c){return function(_0x1bbc94){if(_0x1bbc94){var _0x44ab5b=typeof _0x2d825c[_0xa1c9('0x1d')]===_0xa1c9('0x1e')&&typeof _0x2d825c[_0xa1c9('0x1f')]==='undefined';var _0x11ca10=_0x1bbc94[_0xa1c9('0x20')];var _0x224ae4=_0x44ab5b?0x0:_0x2d825c['offset'];var _0x2fb81e=_0x44ab5b?_0x1bbc94['count']:_0x2d825c[_0xa1c9('0x1d')]+_0x2d825c[_0xa1c9('0x1f')];var _0x204d54;if(_0x2fb81e>=_0x11ca10){_0x2fb81e=_0x11ca10;_0x204d54=0xc8;}else{_0x204d54=0xce;}_0xd9bca1['status'](_0x204d54);return _0xd9bca1[_0xa1c9('0x21')](_0xa1c9('0x22'),_0x224ae4+'-'+_0x2fb81e+'/'+_0x11ca10)[_0xa1c9('0x1c')](_0x1bbc94);}return null;};}function patchUpdates(_0x4edf37){return function(_0x41e6d2){try{jsonpatch[_0xa1c9('0x23')](_0x41e6d2,_0x4edf37,!![]);}catch(_0x4c6dbb){return BPromise[_0xa1c9('0x24')](_0x4c6dbb);}return _0x41e6d2[_0xa1c9('0x25')]();};}function saveUpdates(_0x9f201f,_0x4d05d0){return function(_0x29f1b1){if(_0x29f1b1){return _0x29f1b1[_0xa1c9('0x26')](_0x9f201f)[_0xa1c9('0x27')](function(_0x23a461){return _0x23a461;});}return null;};}function removeEntity(_0x24a5da,_0x4a0a0c){return function(_0x50b16b){if(_0x50b16b){return _0x50b16b[_0xa1c9('0x28')]()['then'](function(){_0x24a5da[_0xa1c9('0x1a')](0xcc)[_0xa1c9('0x1b')]();});}};}function handleEntityNotFound(_0x1c6f37,_0x3059eb){return function(_0x339ed1){if(!_0x339ed1){_0x1c6f37['sendStatus'](0x194);}return _0x339ed1;};}function handleError(_0x1925e7,_0x3ca2a8){_0x3ca2a8=_0x3ca2a8||0x1f4;return function(_0x20cbe1){logger['error'](_0x20cbe1[_0xa1c9('0x29')]);if(_0x20cbe1[_0xa1c9('0x2a')]){delete _0x20cbe1[_0xa1c9('0x2a')];}_0x1925e7['status'](_0x3ca2a8)[_0xa1c9('0x2b')](_0x20cbe1);};}exports[_0xa1c9('0x2c')]=function(_0x594137,_0x38936f){var _0x48ce34={},_0xdf6d0c={},_0x2404c3={'count':0x0,'rows':[]};var _0x88ba11=_[_0xa1c9('0x2d')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')],function(_0x42fcb2){return{'name':_0x42fcb2[_0xa1c9('0x30')],'type':_0x42fcb2['type']['key']};});_0xdf6d0c[_0xa1c9('0x31')]=_[_0xa1c9('0x2d')](_0x88ba11,_0xa1c9('0x2a'));_0xdf6d0c[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x594137['query']);_0xdf6d0c['filters']=_['intersection'](_0xdf6d0c[_0xa1c9('0x31')],_0xdf6d0c[_0xa1c9('0x32')]);_0x48ce34[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0xdf6d0c[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x594137[_0xa1c9('0x32')]['fields']));_0x48ce34[_0xa1c9('0x34')]=_0x48ce34['attributes'][_0xa1c9('0x37')]?_0x48ce34['attributes']:_0xdf6d0c[_0xa1c9('0x31')];if(!_0x594137[_0xa1c9('0x32')][_0xa1c9('0x38')]('nolimit')){_0x48ce34[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x48ce34['offset']=qs['offset'](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1d')]);}_0x48ce34[_0xa1c9('0x39')]=qs[_0xa1c9('0x3a')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3a')]);_0x48ce34[_0xa1c9('0x3b')]=qs[_0xa1c9('0x3c')](_[_0xa1c9('0x3d')](_0x594137[_0xa1c9('0x32')],_0xdf6d0c['filters']),_0x88ba11);if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]){_0x48ce34[_0xa1c9('0x3b')]=_[_0xa1c9('0x3f')](_0x48ce34[_0xa1c9('0x3b')],{'$or':_[_0xa1c9('0x2d')](_0x88ba11,function(_0x5011a3){if(_0x5011a3[_0xa1c9('0x40')]!==_0xa1c9('0x41')){var _0x29d871={};_0x29d871[_0x5011a3['name']]={'$like':'%'+_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]+'%'};return _0x29d871;}})});}_0x48ce34=_['merge']({},_0x48ce34,_0x594137[_0xa1c9('0x42')]);var _0x25502f={'where':_0x48ce34['where']};return db['WhatsappQueueReport'][_0xa1c9('0x20')](_0x25502f)[_0xa1c9('0x27')](function(_0x34a6b8){_0x2404c3[_0xa1c9('0x20')]=_0x34a6b8;if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x48ce34[_0xa1c9('0x44')]=[{'all':!![]}];}return db[_0xa1c9('0x2e')][_0xa1c9('0x45')](_0x48ce34);})[_0xa1c9('0x27')](function(_0x5ac71f){_0x2404c3['rows']=_0x5ac71f;return _0x2404c3;})[_0xa1c9('0x27')](respondWithFilteredResult(_0x38936f,_0x48ce34))[_0xa1c9('0x46')](handleError(_0x38936f,null));};exports['show']=function(_0x30ce3b,_0x102a33){var _0x43de42={'raw':!![],'where':{'id':_0x30ce3b[_0xa1c9('0x47')]['id']}},_0x36c846={};_0x36c846[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')]);_0x36c846[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x30ce3b['query']);_0x36c846[_0xa1c9('0x3c')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],_0x36c846['query']);_0x43de42[_0xa1c9('0x34')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x30ce3b['query'][_0xa1c9('0x36')]));_0x43de42[_0xa1c9('0x34')]=_0x43de42['attributes'][_0xa1c9('0x37')]?_0x43de42[_0xa1c9('0x34')]:_0x36c846[_0xa1c9('0x31')];if(_0x30ce3b[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x43de42[_0xa1c9('0x44')]=[{'all':!![]}];}_0x43de42=_['merge']({},_0x43de42,_0x30ce3b[_0xa1c9('0x42')]);return db[_0xa1c9('0x2e')][_0xa1c9('0x48')](_0x43de42)[_0xa1c9('0x27')](handleEntityNotFound(_0x102a33,null))[_0xa1c9('0x27')](respondWithResult(_0x102a33,null))['catch'](handleError(_0x102a33,null));};exports['create']=function(_0x4cf00a,_0x15329c){return db[_0xa1c9('0x2e')][_0xa1c9('0x49')](_0x4cf00a['body'],{})[_0xa1c9('0x27')](respondWithResult(_0x15329c,0xc9))[_0xa1c9('0x46')](handleError(_0x15329c,null));};exports['update']=function(_0x43ee79,_0x4bdf5d){if(_0x43ee79['body']['id']){delete _0x43ee79[_0xa1c9('0x4a')]['id'];}return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x43ee79[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x4bdf5d,null))[_0xa1c9('0x27')](saveUpdates(_0x43ee79[_0xa1c9('0x4a')],null))[_0xa1c9('0x27')](respondWithResult(_0x4bdf5d,null))[_0xa1c9('0x46')](handleError(_0x4bdf5d,null));};exports[_0xa1c9('0x28')]=function(_0x2b2065,_0x1bed85){return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x2b2065[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x1bed85,null))[_0xa1c9('0x27')](removeEntity(_0x1bed85,null))[_0xa1c9('0x46')](handleError(_0x1bed85,null));};exports[_0xa1c9('0x4b')]=function(_0x4a968e,_0x55dc05){return db[_0xa1c9('0x2e')][_0xa1c9('0x4b')]()[_0xa1c9('0x27')](respondWithResult(_0x55dc05,null))[_0xa1c9('0x46')](handleError(_0x55dc05,null));};
\ No newline at end of file
index ea7e3f5..b08acfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb364=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_whatsapp_queue','uniqueid','util'];(function(_0x107a1b,_0x5c3f30){var _0x569292=function(_0x13a750){while(--_0x13a750){_0x107a1b['push'](_0x107a1b['shift']());}};_0x569292(++_0x5c3f30);}(_0xb364,0x149));var _0x4b36=function(_0x1eb14e,_0x47efd0){_0x1eb14e=_0x1eb14e-0x0;var _0x357718=_0xb364[_0x1eb14e];return _0x357718;};'use strict';var _=require('lodash');var util=require(_0x4b36('0x0'));var logger=require(_0x4b36('0x1'))(_0x4b36('0x2'));var moment=require('moment');var BPromise=require(_0x4b36('0x3'));var rp=require(_0x4b36('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b36('0x5'));var config=require(_0x4b36('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0x4b36('0x7')]=function(_0x4bff53,_0x2ccb44){return _0x4bff53[_0x4b36('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x4b36('0x9'),'paranoid':![],'indexes':[{'name':_0x4b36('0xa'),'fields':[_0x4b36('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xedc7=['../../config/environment','exports','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xedc7,0x13d));var _0x7edc=function(_0x413692,_0x183ab3){_0x413692=_0x413692-0x0;var _0x549f49=_0xedc7[_0x413692];return _0x549f49;};'use strict';var _=require(_0x7edc('0x0'));var util=require(_0x7edc('0x1'));var logger=require(_0x7edc('0x2'))(_0x7edc('0x3'));var moment=require(_0x7edc('0x4'));var BPromise=require(_0x7edc('0x5'));var rp=require(_0x7edc('0x6'));var fs=require('fs');var path=require(_0x7edc('0x7'));var rimraf=require('rimraf');var config=require(_0x7edc('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x7edc('0x9')]=function(_0x7c2d45,_0xa415bc){return _0x7c2d45[_0x7edc('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x7edc('0xb'),'paranoid':![],'indexes':[{'name':_0x7edc('0xc'),'fields':[_0x7edc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 6a45a70..1c14eaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcd1=['info','WhatsappQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateWhatsappQueueReport','create','body','raw','then','WhatsappQueueReport','update','options','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x1464c3,_0x41d2c3){var _0x133aea=function(_0x13ccae){while(--_0x13ccae){_0x1464c3['push'](_0x1464c3['shift']());}};_0x133aea(++_0x41d2c3);}(_0xfcd1,0x78));var _0x1fcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcd1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1fcd('0x0'));var util=require('util');var moment=require(_0x1fcd('0x1'));var BPromise=require(_0x1fcd('0x2'));var rs=require(_0x1fcd('0x3'));var fs=require('fs');var Redis=require(_0x1fcd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fcd('0x5'));var logger=require(_0x1fcd('0x6'))(_0x1fcd('0x7'));var config=require('../../config/environment');var jayson=require(_0x1fcd('0x8'));var client=jayson[_0x1fcd('0x9')][_0x1fcd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7cdd24,_0x570841,_0x4af119){return new BPromise(function(_0x55eb2c,_0x3492df){return client[_0x1fcd('0xb')](_0x7cdd24,_0x4af119)['then'](function(_0x233c04){logger[_0x1fcd('0xc')](_0x1fcd('0xd'),_0x570841,'request\x20sent');logger[_0x1fcd('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x570841,_0x1fcd('0xf'),JSON[_0x1fcd('0x10')](_0x233c04));if(_0x233c04[_0x1fcd('0x11')]){if(_0x233c04[_0x1fcd('0x11')]['code']===0x1f4){logger[_0x1fcd('0x11')](_0x1fcd('0xd'),_0x570841,_0x233c04[_0x1fcd('0x11')][_0x1fcd('0x12')]);return _0x3492df(_0x233c04[_0x1fcd('0x11')]['message']);}logger['error'](_0x1fcd('0xd'),_0x570841,_0x233c04[_0x1fcd('0x11')][_0x1fcd('0x12')]);return _0x55eb2c(_0x233c04[_0x1fcd('0x11')][_0x1fcd('0x12')]);}else{logger[_0x1fcd('0xc')](_0x1fcd('0xd'),_0x570841,_0x1fcd('0xf'));_0x55eb2c(_0x233c04[_0x1fcd('0x13')][_0x1fcd('0x12')]);}})[_0x1fcd('0x14')](function(_0x537f6a){logger[_0x1fcd('0x11')](_0x1fcd('0xd'),_0x570841,_0x537f6a);_0x3492df(_0x537f6a);});});}exports[_0x1fcd('0x15')]=function(_0x5655f2){var _0x13cfac=this;return new Promise(function(_0x1d7512,_0x302f83){return db['WhatsappQueueReport'][_0x1fcd('0x16')](_0x5655f2[_0x1fcd('0x17')],{'raw':_0x5655f2['options']?_0x5655f2['options'][_0x1fcd('0x18')]===undefined?!![]:![]:!![]})[_0x1fcd('0x19')](function(_0x54ca7f){logger['info'](_0x1fcd('0x15'),_0x5655f2);logger[_0x1fcd('0xe')]('CreateWhatsappQueueReport',_0x5655f2,JSON[_0x1fcd('0x10')](_0x54ca7f));_0x1d7512(_0x54ca7f);})['catch'](function(_0x4e594e){logger[_0x1fcd('0x11')](_0x1fcd('0x15'),_0x4e594e[_0x1fcd('0x12')],_0x5655f2);_0x302f83(_0x13cfac['error'](0x1f4,_0x4e594e[_0x1fcd('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x45b29e){var _0x257e4c=this;return new Promise(function(_0x46b1b9,_0x11d874){return db[_0x1fcd('0x1a')][_0x1fcd('0x1b')](_0x45b29e[_0x1fcd('0x17')],{'raw':_0x45b29e[_0x1fcd('0x1c')]?_0x45b29e[_0x1fcd('0x1c')][_0x1fcd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b29e['options']?_0x45b29e[_0x1fcd('0x1c')][_0x1fcd('0x1d')]||null:null,'attributes':_0x45b29e[_0x1fcd('0x1c')]?_0x45b29e['options'][_0x1fcd('0x1e')]||null:null,'limit':_0x45b29e[_0x1fcd('0x1c')]?_0x45b29e[_0x1fcd('0x1c')][_0x1fcd('0x1f')]||null:null})['then'](function(_0x222982){logger[_0x1fcd('0xc')]('UpdateWhatsappQueueReport',_0x45b29e);logger[_0x1fcd('0xe')](_0x1fcd('0x20'),_0x45b29e,JSON[_0x1fcd('0x10')](_0x222982));_0x46b1b9(_0x222982);})['catch'](function(_0x19c2a5){logger[_0x1fcd('0x11')]('UpdateWhatsappQueueReport',_0x19c2a5[_0x1fcd('0x12')],_0x45b29e);_0x11d874(_0x257e4c[_0x1fcd('0x11')](0x1f4,_0x19c2a5[_0x1fcd('0x12')]));});});};
\ No newline at end of file
+var _0xdbcc=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','catch','UpdateWhatsappQueueReport','where','limit','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x1265d5,_0x91d775){var _0x939f43=function(_0x3aae4d){while(--_0x3aae4d){_0x1265d5['push'](_0x1265d5['shift']());}};_0x939f43(++_0x91d775);}(_0xdbcc,0x184));var _0xcdbc=function(_0x192199,_0x3c6d4e){_0x192199=_0x192199-0x0;var _0x689797=_0xdbcc[_0x192199];return _0x689797;};'use strict';var _=require(_0xcdbc('0x0'));var util=require(_0xcdbc('0x1'));var moment=require('moment');var BPromise=require(_0xcdbc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdbc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdbc('0x4'))(_0xcdbc('0x5'));var config=require(_0xcdbc('0x6'));var jayson=require(_0xcdbc('0x7'));var client=jayson[_0xcdbc('0x8')][_0xcdbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17758b,_0x333ce9,_0x30598d){return new BPromise(function(_0x4dceac,_0x15c16f){return client[_0xcdbc('0xa')](_0x17758b,_0x30598d)[_0xcdbc('0xb')](function(_0x2b57bc){logger[_0xcdbc('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x333ce9,_0xcdbc('0xd'));logger[_0xcdbc('0xe')](_0xcdbc('0xf'),_0x333ce9,'request\x20sent',JSON[_0xcdbc('0x10')](_0x2b57bc));if(_0x2b57bc[_0xcdbc('0x11')]){if(_0x2b57bc[_0xcdbc('0x11')]['code']===0x1f4){logger[_0xcdbc('0x11')](_0xcdbc('0x12'),_0x333ce9,_0x2b57bc[_0xcdbc('0x11')][_0xcdbc('0x13')]);return _0x15c16f(_0x2b57bc[_0xcdbc('0x11')][_0xcdbc('0x13')]);}logger[_0xcdbc('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x333ce9,_0x2b57bc[_0xcdbc('0x11')][_0xcdbc('0x13')]);return _0x4dceac(_0x2b57bc[_0xcdbc('0x11')][_0xcdbc('0x13')]);}else{logger[_0xcdbc('0xc')](_0xcdbc('0x12'),_0x333ce9,_0xcdbc('0xd'));_0x4dceac(_0x2b57bc[_0xcdbc('0x14')][_0xcdbc('0x13')]);}})['catch'](function(_0x467e01){logger['error'](_0xcdbc('0x12'),_0x333ce9,_0x467e01);_0x15c16f(_0x467e01);});});}exports[_0xcdbc('0x15')]=function(_0x1a8473){var _0x4b18ba=this;return new Promise(function(_0x42a8c6,_0x17b8ec){return db[_0xcdbc('0x16')][_0xcdbc('0x17')](_0x1a8473[_0xcdbc('0x18')],{'raw':_0x1a8473[_0xcdbc('0x19')]?_0x1a8473[_0xcdbc('0x19')][_0xcdbc('0x1a')]===undefined?!![]:![]:!![]})[_0xcdbc('0xb')](function(_0x462972){logger[_0xcdbc('0xc')](_0xcdbc('0x15'),_0x1a8473);logger['debug'](_0xcdbc('0x15'),_0x1a8473,JSON[_0xcdbc('0x10')](_0x462972));_0x42a8c6(_0x462972);})[_0xcdbc('0x1b')](function(_0x9ffa22){logger[_0xcdbc('0x11')]('CreateWhatsappQueueReport',_0x9ffa22[_0xcdbc('0x13')],_0x1a8473);_0x17b8ec(_0x4b18ba[_0xcdbc('0x11')](0x1f4,_0x9ffa22[_0xcdbc('0x13')]));});});};exports[_0xcdbc('0x1c')]=function(_0x442743){var _0x2d2318=this;return new Promise(function(_0x3c5d12,_0x411a12){return db[_0xcdbc('0x16')]['update'](_0x442743['body'],{'raw':_0x442743[_0xcdbc('0x19')]?_0x442743[_0xcdbc('0x19')][_0xcdbc('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x442743[_0xcdbc('0x19')]?_0x442743[_0xcdbc('0x19')][_0xcdbc('0x1d')]||null:null,'attributes':_0x442743[_0xcdbc('0x19')]?_0x442743['options']['attributes']||null:null,'limit':_0x442743[_0xcdbc('0x19')]?_0x442743[_0xcdbc('0x19')][_0xcdbc('0x1e')]||null:null})[_0xcdbc('0xb')](function(_0x36f959){logger['info'](_0xcdbc('0x1c'),_0x442743);logger[_0xcdbc('0xe')](_0xcdbc('0x1c'),_0x442743,JSON[_0xcdbc('0x10')](_0x36f959));_0x3c5d12(_0x36f959);})[_0xcdbc('0x1b')](function(_0x1be6ba){logger[_0xcdbc('0x11')]('UpdateWhatsappQueueReport',_0x1be6ba[_0xcdbc('0x13')],_0x442743);_0x411a12(_0x2d2318[_0xcdbc('0x11')](0x1f4,_0x1be6ba[_0xcdbc('0x13')]));});});};
\ No newline at end of file
index b3f44c0..eae1cd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc34b=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','post','put','update'];(function(_0x5543dd,_0x3ba614){var _0x96d9ab=function(_0x5a27f4){while(--_0x5a27f4){_0x5543dd['push'](_0x5543dd['shift']());}};_0x96d9ab(++_0x3ba614);}(_0xc34b,0xc7));var _0xbc34=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0xc34b[_0x5180c3];return _0x55c975;};'use strict';var multer=require(_0xbc34('0x0'));var util=require(_0xbc34('0x1'));var path=require(_0xbc34('0x2'));var timeout=require(_0xbc34('0x3'));var express=require(_0xbc34('0x4'));var router=express[_0xbc34('0x5')]();var fs_extra=require(_0xbc34('0x6'));var auth=require(_0xbc34('0x7'));var interaction=require(_0xbc34('0x8'));var config=require(_0xbc34('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0xbc34('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbc34('0xa')](_0xbc34('0xb'),auth[_0xbc34('0xc')](),controller['describe']);router[_0xbc34('0xa')](_0xbc34('0xd'),auth[_0xbc34('0xc')](),controller['show']);router[_0xbc34('0xe')]('/',auth[_0xbc34('0xc')](),controller['create']);router[_0xbc34('0xf')](_0xbc34('0xd'),auth[_0xbc34('0xc')](),controller[_0xbc34('0x10')]);router['delete'](_0xbc34('0xd'),auth['isAuthenticated'](),controller[_0xbc34('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x26e9=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x26e9,0x179));var _0x926e=function(_0x2b12f7,_0x4033ac){_0x2b12f7=_0x2b12f7-0x0;var _0x8cb277=_0x26e9[_0x2b12f7];return _0x8cb277;};'use strict';var multer=require(_0x926e('0x0'));var util=require('util');var path=require(_0x926e('0x1'));var timeout=require(_0x926e('0x2'));var express=require('express');var router=express[_0x926e('0x3')]();var fs_extra=require(_0x926e('0x4'));var auth=require(_0x926e('0x5'));var interaction=require(_0x926e('0x6'));var config=require(_0x926e('0x7'));var controller=require(_0x926e('0x8'));router[_0x926e('0x9')]('/',auth[_0x926e('0xa')](),controller[_0x926e('0xb')]);router[_0x926e('0x9')](_0x926e('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x926e('0xd'),auth['isAuthenticated'](),controller[_0x926e('0xe')]);router['post']('/',auth[_0x926e('0xa')](),controller[_0x926e('0xf')]);router[_0x926e('0x10')]('/:id',auth[_0x926e('0xa')](),controller[_0x926e('0x11')]);router[_0x926e('0x12')](_0x926e('0xd'),auth[_0x926e('0xa')](),controller[_0x926e('0x13')]);module[_0x926e('0x14')]=router;
\ No newline at end of file
index 648c5c5..182eff0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x438a=['agent','queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x4edafe,_0x1b3031){var _0x100a2d=function(_0x3c7c6c){while(--_0x3c7c6c){_0x4edafe['push'](_0x4edafe['shift']());}};_0x100a2d(++_0x1b3031);}(_0x438a,0x18b));var _0xa438=function(_0x2825d1,_0x5dcfda){_0x2825d1=_0x2825d1-0x0;var _0x3f3996=_0x438a[_0x2825d1];return _0x3f3996;};'use strict';var Sequelize=require(_0xa438('0x0'));module[_0xa438('0x1')]={'uniqueid':{'type':Sequelize[_0xa438('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa438('0x3')](_0xa438('0x4'),_0xa438('0x5'),_0xa438('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xa438('0x7')]}};
\ No newline at end of file
+var _0x9672=['ENUM','account','agent','queue','sequelize','exports'];(function(_0x345082,_0x5ab2ec){var _0x41ccfd=function(_0x2889ba){while(--_0x2889ba){_0x345082['push'](_0x345082['shift']());}};_0x41ccfd(++_0x5ab2ec);}(_0x9672,0xee));var _0x2967=function(_0x6a55de,_0x1fc544){_0x6a55de=_0x6a55de-0x0;var _0x1be8fe=_0x9672[_0x6a55de];return _0x1be8fe;};'use strict';var Sequelize=require(_0x2967('0x0'));module[_0x2967('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2967('0x2')](_0x2967('0x3'),_0x2967('0x4'),_0x2967('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index fd2e469..85dabaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d03=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','destroy','stack','send','map','WhatsappTransferReport','rawAttributes','type','key','name','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','show','keys','find','create','body','catch','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x28258a,_0x22f398){var _0x4e968e=function(_0xda8c73){while(--_0xda8c73){_0x28258a['push'](_0x28258a['shift']());}};_0x4e968e(++_0x22f398);}(_0x2d03,0x1e7));var _0x32d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d03[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32d0('0x0'));var zipdir=require(_0x32d0('0x1'));var jsonpatch=require(_0x32d0('0x2'));var rp=require('request-promise');var moment=require(_0x32d0('0x3'));var BPromise=require(_0x32d0('0x4'));var Mustache=require(_0x32d0('0x5'));var util=require(_0x32d0('0x6'));var path=require('path');var sox=require(_0x32d0('0x7'));var csv=require(_0x32d0('0x8'));var ejs=require(_0x32d0('0x9'));var fs=require('fs');var fs_extra=require(_0x32d0('0xa'));var _=require(_0x32d0('0xb'));var squel=require(_0x32d0('0xc'));var crypto=require(_0x32d0('0xd'));var jsforce=require(_0x32d0('0xe'));var deskjs=require(_0x32d0('0xf'));var toCsv=require(_0x32d0('0x8'));var querystring=require(_0x32d0('0x10'));var Papa=require('papaparse');var Redis=require(_0x32d0('0x11'));var authService=require(_0x32d0('0x12'));var qs=require(_0x32d0('0x13'));var as=require(_0x32d0('0x14'));var hardwareService=require(_0x32d0('0x15'));var logger=require(_0x32d0('0x16'))(_0x32d0('0x17'));var utils=require(_0x32d0('0x18'));var config=require(_0x32d0('0x19'));var licenseUtil=require(_0x32d0('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42d056,_0x3e0118){_0x3e0118=_0x3e0118||0xcc;return function(_0x20c9ab){if(_0x20c9ab){return _0x42d056[_0x32d0('0x1b')](_0x3e0118);}return _0x42d056[_0x32d0('0x1c')](_0x3e0118)[_0x32d0('0x1d')]();};}function respondWithResult(_0x18209a,_0xc9556e){_0xc9556e=_0xc9556e||0xc8;return function(_0x3dd31b){if(_0x3dd31b){return _0x18209a[_0x32d0('0x1c')](_0xc9556e)[_0x32d0('0x1e')](_0x3dd31b);}};}function respondWithFilteredResult(_0x10f7b2,_0x160617){return function(_0x5c1a3a){if(_0x5c1a3a){var _0x67ae36=typeof _0x160617[_0x32d0('0x1f')]==='undefined'&&typeof _0x160617[_0x32d0('0x20')]===_0x32d0('0x21');var _0x44fc33=_0x5c1a3a[_0x32d0('0x22')];var _0x28085c=_0x67ae36?0x0:_0x160617[_0x32d0('0x1f')];var _0x5d8a82=_0x67ae36?_0x5c1a3a['count']:_0x160617[_0x32d0('0x1f')]+_0x160617[_0x32d0('0x20')];var _0x414599;if(_0x5d8a82>=_0x44fc33){_0x5d8a82=_0x44fc33;_0x414599=0xc8;}else{_0x414599=0xce;}_0x10f7b2['status'](_0x414599);return _0x10f7b2['set'](_0x32d0('0x23'),_0x28085c+'-'+_0x5d8a82+'/'+_0x44fc33)[_0x32d0('0x1e')](_0x5c1a3a);}return null;};}function patchUpdates(_0x4ab4cc){return function(_0x2328de){try{jsonpatch['apply'](_0x2328de,_0x4ab4cc,!![]);}catch(_0x469a77){return BPromise[_0x32d0('0x24')](_0x469a77);}return _0x2328de[_0x32d0('0x25')]();};}function saveUpdates(_0x3c4077,_0x1a1360){return function(_0x59edbe){if(_0x59edbe){return _0x59edbe['update'](_0x3c4077)['then'](function(_0x470e56){return _0x470e56;});}return null;};}function removeEntity(_0x28db9e,_0x2cba62){return function(_0x3b3ef2){if(_0x3b3ef2){return _0x3b3ef2[_0x32d0('0x26')]()['then'](function(){_0x28db9e['status'](0xcc)[_0x32d0('0x1d')]();});}};}function handleEntityNotFound(_0x323f1c,_0x5a504a){return function(_0x161ad1){if(!_0x161ad1){_0x323f1c[_0x32d0('0x1b')](0x194);}return _0x161ad1;};}function handleError(_0x3ed44d,_0x4e44d2){_0x4e44d2=_0x4e44d2||0x1f4;return function(_0x4a7daf){logger['error'](_0x4a7daf[_0x32d0('0x27')]);if(_0x4a7daf['name']){delete _0x4a7daf['name'];}_0x3ed44d[_0x32d0('0x1c')](_0x4e44d2)[_0x32d0('0x28')](_0x4a7daf);};}exports['index']=function(_0x1a9aab,_0x5024cb){var _0x20425b={},_0x22bfd5={},_0x3be31f={'count':0x0,'rows':[]};var _0xf2b01e=_[_0x32d0('0x29')](db[_0x32d0('0x2a')][_0x32d0('0x2b')],function(_0x1403f1){return{'name':_0x1403f1['fieldName'],'type':_0x1403f1[_0x32d0('0x2c')][_0x32d0('0x2d')]};});_0x22bfd5['model']=_['map'](_0xf2b01e,_0x32d0('0x2e'));_0x22bfd5[_0x32d0('0x2f')]=_['keys'](_0x1a9aab[_0x32d0('0x2f')]);_0x22bfd5[_0x32d0('0x30')]=_['intersection'](_0x22bfd5[_0x32d0('0x31')],_0x22bfd5[_0x32d0('0x2f')]);_0x20425b[_0x32d0('0x32')]=_[_0x32d0('0x33')](_0x22bfd5[_0x32d0('0x31')],qs[_0x32d0('0x34')](_0x1a9aab['query'][_0x32d0('0x34')]));_0x20425b[_0x32d0('0x32')]=_0x20425b[_0x32d0('0x32')][_0x32d0('0x35')]?_0x20425b[_0x32d0('0x32')]:_0x22bfd5['model'];if(!_0x1a9aab[_0x32d0('0x2f')]['hasOwnProperty'](_0x32d0('0x36'))){_0x20425b[_0x32d0('0x20')]=qs[_0x32d0('0x20')](_0x1a9aab['query'][_0x32d0('0x20')]);_0x20425b['offset']=qs[_0x32d0('0x1f')](_0x1a9aab[_0x32d0('0x2f')][_0x32d0('0x1f')]);}_0x20425b[_0x32d0('0x37')]=qs[_0x32d0('0x38')](_0x1a9aab[_0x32d0('0x2f')][_0x32d0('0x38')]);_0x20425b[_0x32d0('0x39')]=qs[_0x32d0('0x30')](_['pick'](_0x1a9aab[_0x32d0('0x2f')],_0x22bfd5[_0x32d0('0x30')]),_0xf2b01e);if(_0x1a9aab['query']['filter']){_0x20425b[_0x32d0('0x39')]=_[_0x32d0('0x3a')](_0x20425b[_0x32d0('0x39')],{'$or':_[_0x32d0('0x29')](_0xf2b01e,function(_0x1c2c86){if(_0x1c2c86[_0x32d0('0x2c')]!==_0x32d0('0x3b')){var _0x354952={};_0x354952[_0x1c2c86[_0x32d0('0x2e')]]={'$like':'%'+_0x1a9aab[_0x32d0('0x2f')][_0x32d0('0x3c')]+'%'};return _0x354952;}})});}_0x20425b=_['merge']({},_0x20425b,_0x1a9aab[_0x32d0('0x3d')]);var _0x53d95a={'where':_0x20425b[_0x32d0('0x39')]};return db[_0x32d0('0x2a')]['count'](_0x53d95a)[_0x32d0('0x3e')](function(_0x10b0d6){_0x3be31f[_0x32d0('0x22')]=_0x10b0d6;if(_0x1a9aab[_0x32d0('0x2f')][_0x32d0('0x3f')]){_0x20425b[_0x32d0('0x40')]=[{'all':!![]}];}return db[_0x32d0('0x2a')][_0x32d0('0x41')](_0x20425b);})[_0x32d0('0x3e')](function(_0x5ac195){_0x3be31f['rows']=_0x5ac195;return _0x3be31f;})['then'](respondWithFilteredResult(_0x5024cb,_0x20425b))['catch'](handleError(_0x5024cb,null));};exports[_0x32d0('0x42')]=function(_0x5e067e,_0x39512f){var _0x25a7a5={'raw':!![],'where':{'id':_0x5e067e['params']['id']}},_0x704932={};_0x704932[_0x32d0('0x31')]=_['keys'](db['WhatsappTransferReport']['rawAttributes']);_0x704932[_0x32d0('0x2f')]=_[_0x32d0('0x43')](_0x5e067e['query']);_0x704932[_0x32d0('0x30')]=_['intersection'](_0x704932[_0x32d0('0x31')],_0x704932[_0x32d0('0x2f')]);_0x25a7a5['attributes']=_[_0x32d0('0x33')](_0x704932[_0x32d0('0x31')],qs['fields'](_0x5e067e['query']['fields']));_0x25a7a5[_0x32d0('0x32')]=_0x25a7a5[_0x32d0('0x32')][_0x32d0('0x35')]?_0x25a7a5[_0x32d0('0x32')]:_0x704932[_0x32d0('0x31')];if(_0x5e067e[_0x32d0('0x2f')][_0x32d0('0x3f')]){_0x25a7a5[_0x32d0('0x40')]=[{'all':!![]}];}_0x25a7a5=_[_0x32d0('0x3a')]({},_0x25a7a5,_0x5e067e[_0x32d0('0x3d')]);return db['WhatsappTransferReport'][_0x32d0('0x44')](_0x25a7a5)['then'](handleEntityNotFound(_0x39512f,null))['then'](respondWithResult(_0x39512f,null))['catch'](handleError(_0x39512f,null));};exports[_0x32d0('0x45')]=function(_0x8fd8d7,_0x351038){return db[_0x32d0('0x2a')][_0x32d0('0x45')](_0x8fd8d7[_0x32d0('0x46')],{})[_0x32d0('0x3e')](respondWithResult(_0x351038,0xc9))[_0x32d0('0x47')](handleError(_0x351038,null));};exports['update']=function(_0x279864,_0x4bea70){if(_0x279864['body']['id']){delete _0x279864['body']['id'];}return db[_0x32d0('0x2a')]['find']({'where':{'id':_0x279864[_0x32d0('0x48')]['id']}})[_0x32d0('0x3e')](handleEntityNotFound(_0x4bea70,null))[_0x32d0('0x3e')](saveUpdates(_0x279864['body'],null))[_0x32d0('0x3e')](respondWithResult(_0x4bea70,null))['catch'](handleError(_0x4bea70,null));};exports[_0x32d0('0x26')]=function(_0x40575f,_0x486aa9){return db[_0x32d0('0x2a')][_0x32d0('0x44')]({'where':{'id':_0x40575f['params']['id']}})[_0x32d0('0x3e')](handleEntityNotFound(_0x486aa9,null))[_0x32d0('0x3e')](removeEntity(_0x486aa9,null))[_0x32d0('0x47')](handleError(_0x486aa9,null));};exports['describe']=function(_0x1143ce,_0x512500){return db['WhatsappTransferReport']['describe']()[_0x32d0('0x3e')](respondWithResult(_0x512500,null))['catch'](handleError(_0x512500,null));};
\ No newline at end of file
+var _0x0895=['fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','WhatsappTransferReport','rawAttributes'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x0895,0x1a0));var _0x5089=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0895[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5089('0x0'));var rimraf=require(_0x5089('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5089('0x2'));var rp=require(_0x5089('0x3'));var moment=require('moment');var BPromise=require(_0x5089('0x4'));var Mustache=require('mustache');var util=require(_0x5089('0x5'));var path=require(_0x5089('0x6'));var sox=require(_0x5089('0x7'));var csv=require('to-csv');var ejs=require(_0x5089('0x8'));var fs=require('fs');var fs_extra=require(_0x5089('0x9'));var _=require(_0x5089('0xa'));var squel=require(_0x5089('0xb'));var crypto=require(_0x5089('0xc'));var jsforce=require(_0x5089('0xd'));var deskjs=require(_0x5089('0xe'));var toCsv=require(_0x5089('0xf'));var querystring=require(_0x5089('0x10'));var Papa=require(_0x5089('0x11'));var Redis=require('ioredis');var authService=require(_0x5089('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5089('0x13'));var hardwareService=require(_0x5089('0x14'));var logger=require(_0x5089('0x15'))(_0x5089('0x16'));var utils=require(_0x5089('0x17'));var config=require(_0x5089('0x18'));var licenseUtil=require(_0x5089('0x19'));var db=require(_0x5089('0x1a'))['db'];function respondWithStatusCode(_0x43ff52,_0x4c66df){_0x4c66df=_0x4c66df||0xcc;return function(_0x1ea63f){if(_0x1ea63f){return _0x43ff52['sendStatus'](_0x4c66df);}return _0x43ff52[_0x5089('0x1b')](_0x4c66df)[_0x5089('0x1c')]();};}function respondWithResult(_0x313ae9,_0x442e1f){_0x442e1f=_0x442e1f||0xc8;return function(_0x64b798){if(_0x64b798){return _0x313ae9[_0x5089('0x1b')](_0x442e1f)[_0x5089('0x1d')](_0x64b798);}};}function respondWithFilteredResult(_0x547e1e,_0x2282b4){return function(_0x1c7942){if(_0x1c7942){var _0x1c6e7d=typeof _0x2282b4[_0x5089('0x1e')]==='undefined'&&typeof _0x2282b4[_0x5089('0x1f')]==='undefined';var _0x269127=_0x1c7942['count'];var _0x56c3e9=_0x1c6e7d?0x0:_0x2282b4['offset'];var _0x508ba4=_0x1c6e7d?_0x1c7942[_0x5089('0x20')]:_0x2282b4[_0x5089('0x1e')]+_0x2282b4[_0x5089('0x1f')];var _0x2f4e7b;if(_0x508ba4>=_0x269127){_0x508ba4=_0x269127;_0x2f4e7b=0xc8;}else{_0x2f4e7b=0xce;}_0x547e1e['status'](_0x2f4e7b);return _0x547e1e['set'](_0x5089('0x21'),_0x56c3e9+'-'+_0x508ba4+'/'+_0x269127)[_0x5089('0x1d')](_0x1c7942);}return null;};}function patchUpdates(_0x3329d7){return function(_0x4f5d77){try{jsonpatch[_0x5089('0x22')](_0x4f5d77,_0x3329d7,!![]);}catch(_0x48814c){return BPromise['reject'](_0x48814c);}return _0x4f5d77[_0x5089('0x23')]();};}function saveUpdates(_0x9fe3c2,_0x2b995f){return function(_0x5061ea){if(_0x5061ea){return _0x5061ea[_0x5089('0x24')](_0x9fe3c2)['then'](function(_0x31353f){return _0x31353f;});}return null;};}function removeEntity(_0x332de7,_0x428ac5){return function(_0x5671ac){if(_0x5671ac){return _0x5671ac[_0x5089('0x25')]()[_0x5089('0x26')](function(){_0x332de7[_0x5089('0x1b')](0xcc)[_0x5089('0x1c')]();});}};}function handleEntityNotFound(_0x18f25f,_0x400414){return function(_0x229c98){if(!_0x229c98){_0x18f25f['sendStatus'](0x194);}return _0x229c98;};}function handleError(_0x125b96,_0x2eacc1){_0x2eacc1=_0x2eacc1||0x1f4;return function(_0x2409a3){logger[_0x5089('0x27')](_0x2409a3[_0x5089('0x28')]);if(_0x2409a3[_0x5089('0x29')]){delete _0x2409a3[_0x5089('0x29')];}_0x125b96[_0x5089('0x1b')](_0x2eacc1)['send'](_0x2409a3);};}exports[_0x5089('0x2a')]=function(_0x10b3c3,_0x1455fd){var _0x12a5d3={},_0x6a746c={},_0x4fc2db={'count':0x0,'rows':[]};var _0x589050=_[_0x5089('0x2b')](db[_0x5089('0x2c')][_0x5089('0x2d')],function(_0x12f9e7){return{'name':_0x12f9e7[_0x5089('0x2e')],'type':_0x12f9e7['type']['key']};});_0x6a746c[_0x5089('0x2f')]=_[_0x5089('0x2b')](_0x589050,_0x5089('0x29'));_0x6a746c['query']=_[_0x5089('0x30')](_0x10b3c3[_0x5089('0x31')]);_0x6a746c[_0x5089('0x32')]=_[_0x5089('0x33')](_0x6a746c[_0x5089('0x2f')],_0x6a746c[_0x5089('0x31')]);_0x12a5d3[_0x5089('0x34')]=_[_0x5089('0x33')](_0x6a746c[_0x5089('0x2f')],qs['fields'](_0x10b3c3[_0x5089('0x31')][_0x5089('0x35')]));_0x12a5d3[_0x5089('0x34')]=_0x12a5d3[_0x5089('0x34')][_0x5089('0x36')]?_0x12a5d3['attributes']:_0x6a746c[_0x5089('0x2f')];if(!_0x10b3c3['query'][_0x5089('0x37')](_0x5089('0x38'))){_0x12a5d3['limit']=qs['limit'](_0x10b3c3['query'][_0x5089('0x1f')]);_0x12a5d3[_0x5089('0x1e')]=qs[_0x5089('0x1e')](_0x10b3c3[_0x5089('0x31')][_0x5089('0x1e')]);}_0x12a5d3[_0x5089('0x39')]=qs['sort'](_0x10b3c3[_0x5089('0x31')][_0x5089('0x3a')]);_0x12a5d3[_0x5089('0x3b')]=qs[_0x5089('0x32')](_[_0x5089('0x3c')](_0x10b3c3[_0x5089('0x31')],_0x6a746c['filters']),_0x589050);if(_0x10b3c3[_0x5089('0x31')]['filter']){_0x12a5d3[_0x5089('0x3b')]=_[_0x5089('0x3d')](_0x12a5d3['where'],{'$or':_[_0x5089('0x2b')](_0x589050,function(_0x58c964){if(_0x58c964[_0x5089('0x3e')]!==_0x5089('0x3f')){var _0xd37cd8={};_0xd37cd8[_0x58c964[_0x5089('0x29')]]={'$like':'%'+_0x10b3c3[_0x5089('0x31')][_0x5089('0x40')]+'%'};return _0xd37cd8;}})});}_0x12a5d3=_[_0x5089('0x3d')]({},_0x12a5d3,_0x10b3c3[_0x5089('0x41')]);var _0x4da388={'where':_0x12a5d3['where']};return db[_0x5089('0x2c')][_0x5089('0x20')](_0x4da388)[_0x5089('0x26')](function(_0x544867){_0x4fc2db[_0x5089('0x20')]=_0x544867;if(_0x10b3c3[_0x5089('0x31')]['includeAll']){_0x12a5d3['include']=[{'all':!![]}];}return db[_0x5089('0x2c')][_0x5089('0x42')](_0x12a5d3);})[_0x5089('0x26')](function(_0x19424b){_0x4fc2db[_0x5089('0x43')]=_0x19424b;return _0x4fc2db;})[_0x5089('0x26')](respondWithFilteredResult(_0x1455fd,_0x12a5d3))[_0x5089('0x44')](handleError(_0x1455fd,null));};exports[_0x5089('0x45')]=function(_0x8ab5a6,_0x248268){var _0x5ba4ab={'raw':!![],'where':{'id':_0x8ab5a6[_0x5089('0x46')]['id']}},_0xe658f5={};_0xe658f5[_0x5089('0x2f')]=_[_0x5089('0x30')](db[_0x5089('0x2c')][_0x5089('0x2d')]);_0xe658f5[_0x5089('0x31')]=_['keys'](_0x8ab5a6[_0x5089('0x31')]);_0xe658f5[_0x5089('0x32')]=_[_0x5089('0x33')](_0xe658f5[_0x5089('0x2f')],_0xe658f5[_0x5089('0x31')]);_0x5ba4ab['attributes']=_[_0x5089('0x33')](_0xe658f5['model'],qs[_0x5089('0x35')](_0x8ab5a6['query'][_0x5089('0x35')]));_0x5ba4ab['attributes']=_0x5ba4ab[_0x5089('0x34')][_0x5089('0x36')]?_0x5ba4ab[_0x5089('0x34')]:_0xe658f5[_0x5089('0x2f')];if(_0x8ab5a6['query'][_0x5089('0x47')]){_0x5ba4ab[_0x5089('0x48')]=[{'all':!![]}];}_0x5ba4ab=_[_0x5089('0x3d')]({},_0x5ba4ab,_0x8ab5a6[_0x5089('0x41')]);return db['WhatsappTransferReport'][_0x5089('0x49')](_0x5ba4ab)['then'](handleEntityNotFound(_0x248268,null))['then'](respondWithResult(_0x248268,null))[_0x5089('0x44')](handleError(_0x248268,null));};exports[_0x5089('0x4a')]=function(_0x3688b7,_0x353c81){return db[_0x5089('0x2c')][_0x5089('0x4a')](_0x3688b7['body'],{})[_0x5089('0x26')](respondWithResult(_0x353c81,0xc9))[_0x5089('0x44')](handleError(_0x353c81,null));};exports[_0x5089('0x24')]=function(_0x158a51,_0x334c3e){if(_0x158a51['body']['id']){delete _0x158a51[_0x5089('0x4b')]['id'];}return db[_0x5089('0x2c')][_0x5089('0x49')]({'where':{'id':_0x158a51[_0x5089('0x46')]['id']}})[_0x5089('0x26')](handleEntityNotFound(_0x334c3e,null))[_0x5089('0x26')](saveUpdates(_0x158a51[_0x5089('0x4b')],null))['then'](respondWithResult(_0x334c3e,null))[_0x5089('0x44')](handleError(_0x334c3e,null));};exports['destroy']=function(_0x1bef63,_0x2d72cd){return db[_0x5089('0x2c')][_0x5089('0x49')]({'where':{'id':_0x1bef63[_0x5089('0x46')]['id']}})[_0x5089('0x26')](handleEntityNotFound(_0x2d72cd,null))[_0x5089('0x26')](removeEntity(_0x2d72cd,null))[_0x5089('0x44')](handleError(_0x2d72cd,null));};exports[_0x5089('0x4c')]=function(_0x120e6d,_0x100041){return db[_0x5089('0x2c')]['describe']()[_0x5089('0x26')](respondWithResult(_0x100041,null))['catch'](handleError(_0x100041,null));};
\ No newline at end of file
index 955be95..9e10732 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbf9=['./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x35d1f9,_0xee484c){var _0x2d7877=function(_0x52117d){while(--_0x52117d){_0x35d1f9['push'](_0x35d1f9['shift']());}};_0x2d7877(++_0xee484c);}(_0xcbf9,0x13e));var _0x9cbf=function(_0x35be1c,_0x45a7ef){_0x35be1c=_0x35be1c-0x0;var _0x1d99e1=_0xcbf9[_0x35be1c];return _0x1d99e1;};'use strict';var _=require('lodash');var util=require(_0x9cbf('0x0'));var logger=require(_0x9cbf('0x1'))('api');var moment=require(_0x9cbf('0x2'));var BPromise=require(_0x9cbf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cbf('0x4'));var rimraf=require(_0x9cbf('0x5'));var config=require(_0x9cbf('0x6'));var attributes=require(_0x9cbf('0x7'));module[_0x9cbf('0x8')]=function(_0x27e4e5,_0x99cc8c){return _0x27e4e5[_0x9cbf('0x9')](_0x9cbf('0xa'),attributes,{'tableName':_0x9cbf('0xb'),'paranoid':![],'indexes':[{'name':_0x9cbf('0xc'),'fields':[_0x9cbf('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d61=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','uniqueid','lodash'];(function(_0x14e425,_0x35cab6){var _0x30e0a1=function(_0xaf2c47){while(--_0xaf2c47){_0x14e425['push'](_0x14e425['shift']());}};_0x30e0a1(++_0x35cab6);}(_0x2d61,0x133));var _0x12d6=function(_0xa51aed,_0x1fe3d6){_0xa51aed=_0xa51aed-0x0;var _0x14b28c=_0x2d61[_0xa51aed];return _0x14b28c;};'use strict';var _=require(_0x12d6('0x0'));var util=require(_0x12d6('0x1'));var logger=require(_0x12d6('0x2'))(_0x12d6('0x3'));var moment=require(_0x12d6('0x4'));var BPromise=require(_0x12d6('0x5'));var rp=require(_0x12d6('0x6'));var fs=require('fs');var path=require(_0x12d6('0x7'));var rimraf=require(_0x12d6('0x8'));var config=require(_0x12d6('0x9'));var attributes=require(_0x12d6('0xa'));module[_0x12d6('0xb')]=function(_0x4a49b6,_0x163a71){return _0x4a49b6[_0x12d6('0xc')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x12d6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 7dfaa4c..e5b8dbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57e1=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result'];(function(_0x5650b4,_0x2723ba){var _0x297a62=function(_0x4ceedf){while(--_0x4ceedf){_0x5650b4['push'](_0x5650b4['shift']());}};_0x297a62(++_0x2723ba);}(_0x57e1,0x199));var _0x157e=function(_0x5a2436,_0x11375a){_0x5a2436=_0x5a2436-0x0;var _0x2d8468=_0x57e1[_0x5a2436];return _0x2d8468;};'use strict';var _=require(_0x157e('0x0'));var util=require('util');var moment=require(_0x157e('0x1'));var BPromise=require(_0x157e('0x2'));var rs=require(_0x157e('0x3'));var fs=require('fs');var Redis=require(_0x157e('0x4'));var db=require(_0x157e('0x5'))['db'];var utils=require(_0x157e('0x6'));var logger=require('../../config/logger')(_0x157e('0x7'));var config=require(_0x157e('0x8'));var jayson=require(_0x157e('0x9'));var client=jayson[_0x157e('0xa')][_0x157e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45d235,_0x5efc15,_0xa0bf6){return new BPromise(function(_0x56ee9,_0x4b8ce6){return client[_0x157e('0xc')](_0x45d235,_0xa0bf6)[_0x157e('0xd')](function(_0x4a8754){logger['info'](_0x157e('0xe'),_0x5efc15,'request\x20sent');logger[_0x157e('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5efc15,_0x157e('0x10'),JSON[_0x157e('0x11')](_0x4a8754));if(_0x4a8754['error']){if(_0x4a8754[_0x157e('0x12')][_0x157e('0x13')]===0x1f4){logger['error'](_0x157e('0xe'),_0x5efc15,_0x4a8754['error'][_0x157e('0x14')]);return _0x4b8ce6(_0x4a8754[_0x157e('0x12')][_0x157e('0x14')]);}logger[_0x157e('0x12')](_0x157e('0xe'),_0x5efc15,_0x4a8754[_0x157e('0x12')][_0x157e('0x14')]);return _0x56ee9(_0x4a8754[_0x157e('0x12')][_0x157e('0x14')]);}else{logger[_0x157e('0x15')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5efc15,'request\x20sent');_0x56ee9(_0x4a8754[_0x157e('0x16')][_0x157e('0x14')]);}})[_0x157e('0x17')](function(_0x6764fe){logger[_0x157e('0x12')](_0x157e('0xe'),_0x5efc15,_0x6764fe);_0x4b8ce6(_0x6764fe);});});}
\ No newline at end of file
+var _0x0c9f=['client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x4ae67f,_0x34081f){var _0xb981a9=function(_0x597650){while(--_0x597650){_0x4ae67f['push'](_0x4ae67f['shift']());}};_0xb981a9(++_0x34081f);}(_0x0c9f,0x199));var _0xf0c9=function(_0x364bb5,_0x1c403d){_0x364bb5=_0x364bb5-0x0;var _0x4adf3f=_0x0c9f[_0x364bb5];return _0x4adf3f;};'use strict';var _=require(_0xf0c9('0x0'));var util=require(_0xf0c9('0x1'));var moment=require(_0xf0c9('0x2'));var BPromise=require(_0xf0c9('0x3'));var rs=require(_0xf0c9('0x4'));var fs=require('fs');var Redis=require(_0xf0c9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0c9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0c9('0x7'));var jayson=require(_0xf0c9('0x8'));var client=jayson[_0xf0c9('0x9')][_0xf0c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fe9dd,_0x5cd87d,_0x659b1b){return new BPromise(function(_0x390ea9,_0x3a7c1f){return client['request'](_0x4fe9dd,_0x659b1b)[_0xf0c9('0xb')](function(_0x3888e9){logger[_0xf0c9('0xc')](_0xf0c9('0xd'),_0x5cd87d,'request\x20sent');logger[_0xf0c9('0xe')](_0xf0c9('0xf'),_0x5cd87d,_0xf0c9('0x10'),JSON[_0xf0c9('0x11')](_0x3888e9));if(_0x3888e9[_0xf0c9('0x12')]){if(_0x3888e9[_0xf0c9('0x12')][_0xf0c9('0x13')]===0x1f4){logger[_0xf0c9('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5cd87d,_0x3888e9[_0xf0c9('0x12')][_0xf0c9('0x14')]);return _0x3a7c1f(_0x3888e9[_0xf0c9('0x12')]['message']);}logger[_0xf0c9('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5cd87d,_0x3888e9[_0xf0c9('0x12')][_0xf0c9('0x14')]);return _0x390ea9(_0x3888e9[_0xf0c9('0x12')][_0xf0c9('0x14')]);}else{logger['info'](_0xf0c9('0xd'),_0x5cd87d,_0xf0c9('0x10'));_0x390ea9(_0x3888e9[_0xf0c9('0x15')][_0xf0c9('0x14')]);}})['catch'](function(_0x4e1d7a){logger[_0xf0c9('0x12')](_0xf0c9('0xd'),_0x5cd87d,_0x4e1d7a);_0x3a7c1f(_0x4e1d7a);});});}
\ No newline at end of file
index 1b8d2be..06f87b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1670=['online','join','Offline\x20apps:','status','None','App\x20Ready!','catch','log','error','exit','lodash','./mysqldb','./config/license','./config/environment','./config/logger','app','./config/pm2','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','number','exitCode','length','name','Online\x20apps:','map','filter'];(function(_0xec79f2,_0xcec653){var _0xf93a9a=function(_0x356e74){while(--_0x356e74){_0xec79f2['push'](_0xec79f2['shift']());}};_0xf93a9a(++_0xcec653);}(_0x1670,0x9a));var _0x0167=function(_0x544f55,_0x37cdab){_0x544f55=_0x544f55-0x0;var _0x55bbe6=_0x1670[_0x544f55];return _0x55bbe6;};'use strict';var _=require(_0x0167('0x0'));var db=require(_0x0167('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x0167('0x2'));var rpc=require('./rpc');var config=require(_0x0167('0x3'));var logger=require(_0x0167('0x4'))(_0x0167('0x5'));var pm2=require(_0x0167('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0x0167('0x7'));var whatsapp=require(_0x0167('0x8'));var transcribe=require(_0x0167('0x9'));var provider=require(_0x0167('0xa'));function main(){return db[_0x0167('0xb')][_0x0167('0xc')]()[_0x0167('0xd')](function(){if(config[_0x0167('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0x0167('0xf')]();})[_0x0167('0xd')](function(){return rpc[_0x0167('0x10')]();})[_0x0167('0xd')](function(_0x338288){logger[_0x0167('0x11')](_0x338288);return chat[_0x0167('0x12')]();})[_0x0167('0xd')](function(){return whatsapp[_0x0167('0x12')]();})[_0x0167('0xd')](function(){return schedule[_0x0167('0x12')]();})[_0x0167('0xd')](function(){return transcribe[_0x0167('0x12')]();})[_0x0167('0xd')](function(){return provider['start']();})[_0x0167('0xd')](function(_0x4e2c53){logger[_0x0167('0x11')](_0x4e2c53);return pm2['start'](pm2Config);})[_0x0167('0xd')](function(_0x39e644){var _0x3fc778=_0x39e644['filter'](function(_0x50c1a3){return typeof _0x50c1a3['exitCode']===_0x0167('0x13')&&_0x50c1a3[_0x0167('0x14')]>=0x0;});if(_0x3fc778['length']>0x0){throw new Error(_0x3fc778[_0x0167('0x15')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x3fc778,function(_0x38f934){return'\x22'+_0x38f934['pm2_env'][_0x0167('0x16')]+'\x22';}));}logger['info'](_0x0167('0x17'),_[_0x0167('0x18')](_[_0x0167('0x19')](_0x39e644,{'status':_0x0167('0x1a')}),_0x0167('0x16'))[_0x0167('0x1b')]());logger[_0x0167('0x11')](_0x0167('0x1c'),_[_0x0167('0x18')](_[_0x0167('0x19')](_0x39e644,function(_0x221d7c){return _0x221d7c[_0x0167('0x1d')]!=='online';}),_0x0167('0x16'))[_0x0167('0x1b')]()||_0x0167('0x1e'));console['log'](_0x0167('0x1f'));})[_0x0167('0x20')](function(_0x43d6bc){console[_0x0167('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x43d6bc);logger[_0x0167('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x43d6bc);process[_0x0167('0x23')](0x1);});}main();
\ No newline at end of file
+var _0x4cfd=['./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe'];(function(_0x48620f,_0x4ed352){var _0x4520b3=function(_0xc8246b){while(--_0xc8246b){_0x48620f['push'](_0x48620f['shift']());}};_0x4520b3(++_0x4ed352);}(_0x4cfd,0x170));var _0xd4cf=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x4cfd[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0xd4cf('0x0'));var db=require(_0xd4cf('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xd4cf('0x2'));var rpc=require(_0xd4cf('0x3'));var config=require(_0xd4cf('0x4'));var logger=require(_0xd4cf('0x5'))(_0xd4cf('0x6'));var pm2=require(_0xd4cf('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xd4cf('0x8'));var chat=require(_0xd4cf('0x9'));var whatsapp=require(_0xd4cf('0xa'));var transcribe=require(_0xd4cf('0xb'));var provider=require(_0xd4cf('0xc'));function main(){return db[_0xd4cf('0xd')]['sync']()[_0xd4cf('0xe')](function(){if(config[_0xd4cf('0xf')]){return seedDb[_0xd4cf('0x10')]();}})[_0xd4cf('0xe')](function(){return checkLicense[_0xd4cf('0x10')]();})[_0xd4cf('0xe')](function(){return rpc[_0xd4cf('0x11')]();})['then'](function(_0x38ac7c){logger[_0xd4cf('0x12')](_0x38ac7c);return chat[_0xd4cf('0x13')]();})[_0xd4cf('0xe')](function(){return whatsapp[_0xd4cf('0x13')]();})['then'](function(){return schedule['start']();})[_0xd4cf('0xe')](function(){return transcribe[_0xd4cf('0x13')]();})['then'](function(){return provider[_0xd4cf('0x13')]();})['then'](function(_0xe4fdaa){logger['info'](_0xe4fdaa);return pm2[_0xd4cf('0x13')](pm2Config);})[_0xd4cf('0xe')](function(_0x51c61e){var _0x3248dd=_0x51c61e[_0xd4cf('0x14')](function(_0x2f8607){return typeof _0x2f8607[_0xd4cf('0x15')]===_0xd4cf('0x16')&&_0x2f8607[_0xd4cf('0x15')]>=0x0;});if(_0x3248dd['length']>0x0){throw new Error(_0x3248dd[_0xd4cf('0x17')]+_0xd4cf('0x18')+_[_0xd4cf('0x19')](_0x3248dd,function(_0x11b06a){return'\x22'+_0x11b06a[_0xd4cf('0x1a')][_0xd4cf('0x1b')]+'\x22';}));}logger[_0xd4cf('0x12')](_0xd4cf('0x1c'),_[_0xd4cf('0x19')](_[_0xd4cf('0x14')](_0x51c61e,{'status':_0xd4cf('0x1d')}),_0xd4cf('0x1b'))[_0xd4cf('0x1e')]());logger[_0xd4cf('0x12')](_0xd4cf('0x1f'),_[_0xd4cf('0x19')](_[_0xd4cf('0x14')](_0x51c61e,function(_0x2bef15){return _0x2bef15[_0xd4cf('0x20')]!=='online';}),_0xd4cf('0x1b'))['join']()||'None');console[_0xd4cf('0x21')](_0xd4cf('0x22'));})[_0xd4cf('0x23')](function(_0x1aa6de){console[_0xd4cf('0x21')](_0xd4cf('0x24'),_0x1aa6de);logger['error'](_0xd4cf('0x25'),_0x1aa6de);process['exit'](0x1);});}main();
\ No newline at end of file
index a749d2b..ccbd9e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1ff=['apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','splice','unshift','encryptString','join','promisify','secret','secrets','session','payload','options','verify','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','util','role','fullname','name','internal','email','userpic','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','phoneBarEnableDtmfTone','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','closed','then','status','json','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','find','pass','Wrong\x20credentials.','user','Unknown\x20authorization\x20format','getUuid','apikey','sub','isEqual','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User','User\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil'];(function(_0x488a0c,_0x70aeb4){var _0x274322=function(_0x543889){while(--_0x543889){_0x488a0c['push'](_0x488a0c['shift']());}};_0x274322(++_0x70aeb4);}(_0xd1ff,0x93));var _0xfd1f=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0xd1ff[_0x1793de];return _0x4f0309;};'use strict';var db=require(_0xfd1f('0x0'))['db'];var config=require(_0xfd1f('0x1'));var hardwareConf=require(_0xfd1f('0x2'));var licenseUtil=require(_0xfd1f('0x3'));var encryptor=require(_0xfd1f('0x4'));var _=require(_0xfd1f('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xfd1f('0x6'));var compose=require(_0xfd1f('0x7'));var basicAuth=require(_0xfd1f('0x8'));var crypto=require(_0xfd1f('0x9'));var BPromise=require('bluebird');var util=require(_0xfd1f('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xfd1f('0xb'),_0xfd1f('0xc'),_0xfd1f('0xd'),_0xfd1f('0xe'),_0xfd1f('0xf'),_0xfd1f('0x10'),'permissions','md5secret','voicePause',_0xfd1f('0x11'),'mailPause',_0xfd1f('0x12'),_0xfd1f('0x13'),_0xfd1f('0x14'),_0xfd1f('0x15'),_0xfd1f('0x16'),_0xfd1f('0x17'),_0xfd1f('0x18'),'crudPermissions',_0xfd1f('0x19'),_0xfd1f('0x1a'),'alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording',_0xfd1f('0x1b'),'phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired',_0xfd1f('0x1c'),_0xfd1f('0x1d'),'hotdesk','interface',_0xfd1f('0x1e'),_0xfd1f('0x1f'),_0xfd1f('0x20'),_0xfd1f('0x21'),'downloadVoiceRecordings',_0xfd1f('0x22'),'downloadAttachments',_0xfd1f('0x23'),'selectRecallMeCampaign'];exports[_0xfd1f('0x24')]=function(){return this[_0xfd1f('0x25')](!![])[_0xfd1f('0x26')](function(_0x473652,_0x2ef90f,_0x2025f1){if(_0x473652['user']){_0x2025f1();}else{return db[_0xfd1f('0x27')][_0xfd1f('0x28')]({'where':{'id':_0x473652[_0xfd1f('0x29')]['id']},'attributes':['id',_0xfd1f('0x2a'),'disposition'],'raw':!![]})[_0xfd1f('0x2b')](function(_0x4eedb1){if(_0x4eedb1&&_0x4eedb1['closed']){return _0x2ef90f[_0xfd1f('0x2c')](_0x4eedb1['disposition']==='unmanaged'?0x195:0x193)[_0xfd1f('0x2d')]({'message':_0x4eedb1[_0xfd1f('0x2e')]===_0xfd1f('0x2f')?_0xfd1f('0x30'):_0xfd1f('0x31')});}else{_0x2025f1();}})[_0xfd1f('0x32')](function(_0x5bc5e7){_0x2025f1(_0x5bc5e7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xcd5448){return compose()['use'](function(_0x6d5f6a,_0x3b3ae8,_0x5d4ef4){var _0x5c5c49;if(_0x6d5f6a[_0xfd1f('0x33')][_0xfd1f('0x34')]){if(_['startsWith'](_0x6d5f6a[_0xfd1f('0x33')][_0xfd1f('0x34')],_0xfd1f('0x35'))){var _0x231cd5=basicAuth(_0x6d5f6a);db['User'][_0xfd1f('0x36')]({'where':{'name':_0x231cd5['name']}})['then'](function(_0x66d5f9){if(!_0x66d5f9||!_0x66d5f9['authenticate'](_0x231cd5[_0xfd1f('0x37')])){return _0x3b3ae8[_0xfd1f('0x2c')](0x191)[_0xfd1f('0x2d')]({'message':_0xfd1f('0x38')});}_0x6d5f6a[_0xfd1f('0x39')]={'id':_0x66d5f9['id']};_0x5d4ef4();})['catch'](function(_0x53fcde){_0x5d4ef4(_0x53fcde);});}else if(_['startsWith'](_0x6d5f6a[_0xfd1f('0x33')]['authorization'],'Bearer')){validateJwt(_0x6d5f6a,_0x3b3ae8,_0x5d4ef4);}else{if(_0xcd5448){_0x5d4ef4();}else{return _0x3b3ae8[_0xfd1f('0x2c')](0x193)[_0xfd1f('0x2d')]({'message':_0xfd1f('0x3a')});}}}else if(_0x6d5f6a['query']['apikey']){try{var _0x1c00b0={'audience':hardwareConf[_0xfd1f('0x3b')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x6d5f6a['query'][_0xfd1f('0x3c')],_0x1c00b0)[_0xfd1f('0x2b')](function(_0x7fe710){return db['User'][_0xfd1f('0x36')]({'where':{'id':_0x7fe710[_0xfd1f('0x3d')]}})[_0xfd1f('0x2b')](function(_0x135897){_0x5c5c49=_0x135897;return db['Setting'][_0xfd1f('0x28')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0xfd1f('0x2b')](function(_0x34727b){if(!_0x5c5c49||!_[_0xfd1f('0x3e')](_0x5c5c49[_0xfd1f('0x3f')],_0x7fe710[_0xfd1f('0x40')])){return _0x3b3ae8[_0xfd1f('0x2c')](0x191)[_0xfd1f('0x2d')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x5c5c49[_0xfd1f('0x41')]){return _0x3b3ae8[_0xfd1f('0x2c')](0x191)[_0xfd1f('0x2d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5c5c49[_0xfd1f('0x42')]){if(_0x34727b[_0xfd1f('0x43')]>0x0){if(moment(_0x5c5c49[_0xfd1f('0x44')])[_0xfd1f('0x45')](_0x34727b[_0xfd1f('0x43')],_0xfd1f('0x46'))>moment()){return _0x3b3ae8[_0xfd1f('0x2c')](0x191)[_0xfd1f('0x2d')]({'message':_0xfd1f('0x47')});}}else{return _0x3b3ae8['status'](0x191)[_0xfd1f('0x2d')]({'message':_0xfd1f('0x47')});}}_0x6d5f6a['user']={'id':_0x5c5c49['id']};_0x5d4ef4();});})[_0xfd1f('0x32')](function(){return _0x3b3ae8['status'](0x191)[_0xfd1f('0x2d')]({'message':_0xfd1f('0x47')});});}catch(_0xb19025){_0x5d4ef4(_0xb19025);}}else if(_0xcd5448){_0x5d4ef4();}else{return _0x3b3ae8[_0xfd1f('0x2c')](0x193)[_0xfd1f('0x2d')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x4425f8,_0xd00991,_0x1b133d){if(_0x4425f8[_0xfd1f('0x39')]){db[_0xfd1f('0x48')][_0xfd1f('0x36')]({'where':{'id':_0x4425f8['user']['id']},'attributes':userAttributes})[_0xfd1f('0x2b')](function(_0x263df0){if(!_0x263df0){return _0xd00991[_0xfd1f('0x2c')](0x194)[_0xfd1f('0x2d')]({'message':_0xfd1f('0x49')});}_0x4425f8[_0xfd1f('0x39')]=_0x263df0;_0x1b133d();})[_0xfd1f('0x32')](function(_0x40032c){_0x1b133d(_0x40032c);});}else if(_0xcd5448){_0x1b133d();}else{return _0xd00991[_0xfd1f('0x2c')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xfd1f('0x26')](function(_0x5e20be,_0x324f82,_0x4802bd){return licenseUtil[_0xfd1f('0x4a')]()['then'](function(_0x201444){if(_0x201444[_0xfd1f('0x4b')]){_0x4802bd();}else{return _0x324f82[_0xfd1f('0x2c')](0x193)['json']({'message':_0xfd1f('0x4c')});}})[_0xfd1f('0x32')](function(_0x44e5d7){_0x4802bd(_0x44e5d7);});});};exports[_0xfd1f('0x4d')]=function isWebrtcLicence(){return compose()[_0xfd1f('0x26')](function(_0x4db6a8,_0x163034,_0x283f6a){return licenseUtil[_0xfd1f('0x4a')]()[_0xfd1f('0x2b')](function(_0x569e80){if(_0x569e80[_0xfd1f('0x4e')]){_0x283f6a();}else{return _0x163034[_0xfd1f('0x2c')](0x193)['json']({'message':'Forbidden'});}})[_0xfd1f('0x32')](function(_0x3af633){_0x283f6a(_0x3af633);});});};exports[_0xfd1f('0x4f')]=function(_0x33310c,_0x3556a4,_0x2cb774){_0x33310c[_0xfd1f('0x4f')]=!![];return _0x2cb774();};exports[_0xfd1f('0x50')]=function signToken(_0x1ea6e3){return signJwt(_0x1ea6e3);};exports[_0xfd1f('0x51')]=function(_0xa0397,_0x207367){if(!_0xa0397[_0xfd1f('0x39')]){return _0x207367[_0xfd1f('0x2c')](0x194)['json']({'message':_0xfd1f('0x52')});}var _0x38dce2={'payload':{'id':_0xa0397['user']['id'],'role':_0xa0397[_0xfd1f('0x39')][_0xfd1f('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x38dce2)['then'](function(_0x43a1d6){_0x207367[_0xfd1f('0x53')](_0xfd1f('0x54'),_0x43a1d6);_0x207367['redirect'](_0xfd1f('0x55'));})[_0xfd1f('0x32')](function(_0x520276){return _0x207367[_0xfd1f('0x2c')](0x1f4)[_0xfd1f('0x56')](_0x520276);});};exports[_0xfd1f('0x57')]=function(_0x5aff2a){if(_[_0xfd1f('0x58')](_0x5aff2a[_0xfd1f('0x3f')])||_[_0xfd1f('0x58')](_0x5aff2a[_0xfd1f('0x59')])){return null;}else{return createJwt(_0x5aff2a);}};exports[_0xfd1f('0x5a')]=function(_0x11a856){_0x11a856[_0xfd1f('0x3f')]=generateNonce();_0x11a856[_0xfd1f('0x59')]=generateIssuedAt();return createJwt(_0x11a856);};exports['regenerateApiKey']=function(_0x189ce4,_0x298231){var _0x381abf=_0x189ce4['query']['apikey'];if(_0x381abf){var _0x2ac179={'nonce':_0x298231[_0xfd1f('0x3f')],'iat':_0x298231[_0xfd1f('0x59')],'audience':hardwareConf[_0xfd1f('0x3b')](),'issuer':hardwareConf[_0xfd1f('0x3b')]()};return verifyJwt(_0x381abf,_0x2ac179)[_0xfd1f('0x2b')](function(){return generateApiKey(_0x298231);});}else{throw{'message':_0xfd1f('0x5b')};}};exports[_0xfd1f('0x5c')]=function(_0x5ec7c6){var _0x498130=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x498130[_0xfd1f('0x5d')](_0x5ec7c6))throw new db[(_0xfd1f('0x5e'))][(_0xfd1f('0x5f'))](_0xfd1f('0x60'));return;};exports['validatePasswordHistory']=function(_0x2583cd,_0x15d5c6,_0x5960d6){var _0x1c4cd1=encryptor[_0xfd1f('0x61')](_0x15d5c6)['split'](',');for(var _0x4d52ac=0x0;_0x4d52ac<_0x5960d6;_0x4d52ac++){if(!_0x1c4cd1[_0x4d52ac])break;if(_0x2583cd[_0xfd1f('0x62')]()===_0x1c4cd1[_0x4d52ac]['toLowerCase']()){var _0x5627eb=util[_0xfd1f('0x63')](_0xfd1f('0x64'),_0x5960d6);if(_0x5960d6===0x1){_0x5627eb='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0xfd1f('0x5f'))](_0x5627eb);}}return;};exports[_0xfd1f('0x65')]=function(_0x3c7349,_0x4567e5){var _0x5d28f1=_0x4567e5?encryptor[_0xfd1f('0x61')](_0x4567e5)[_0xfd1f('0x66')](','):[];if(_0x5d28f1['length']===0x5){_0x5d28f1[_0xfd1f('0x67')](-0x1,0x1);}_0x5d28f1[_0xfd1f('0x68')](_0x3c7349);return encryptor[_0xfd1f('0x69')](_0x5d28f1[_0xfd1f('0x6a')](','));};function signJwt(_0x1248e5){var _0x11b647=BPromise[_0xfd1f('0x6b')](jwt['sign'],{'context':jwt});var _0x266d4d=_0x1248e5[_0xfd1f('0x6c')]||config[_0xfd1f('0x6d')][_0xfd1f('0x6e')];return new BPromise(function(_0x225c5e,_0x507e02){_0x11b647(_0x1248e5[_0xfd1f('0x6f')],_0x266d4d,_0x1248e5[_0xfd1f('0x70')])[_0xfd1f('0x2b')](function(_0x4ad527){_0x225c5e(_0x4ad527);})['catch'](function(_0x16ca96){_0x507e02(_0x16ca96);});});}function verifyJwt(_0x285190,_0x30a2eb,_0x1d5995){var _0x99dba6=BPromise[_0xfd1f('0x6b')](jwt[_0xfd1f('0x71')],{'context':jwt});var _0x56ae86=_0x1d5995||config[_0xfd1f('0x6d')][_0xfd1f('0x6e')];return new BPromise(function(_0x50ef1a,_0x561533){_0x99dba6(_0x285190,_0x56ae86,_0x30a2eb)[_0xfd1f('0x2b')](function(_0x2ffa4c){_0x50ef1a(_0x2ffa4c);})[_0xfd1f('0x32')](function(_0x38d270){_0x561533(_0x38d270);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xfd1f('0x72')](_0xfd1f('0x73'));}function generateIssuedAt(){return Math['floor'](Date[_0xfd1f('0x74')]()/0x3e8)[_0xfd1f('0x72')]();}function createJwt(_0x1e1d9c){var _0x4b363f={'payload':{'iat':_0x1e1d9c[_0xfd1f('0x59')],'nonce':_0x1e1d9c[_0xfd1f('0x3f')]},'options':{'algorithm':_0xfd1f('0x75'),'subject':_0x1e1d9c['id'][_0xfd1f('0x72')](),'issuer':hardwareConf[_0xfd1f('0x3b')](),'audience':hardwareConf[_0xfd1f('0x3b')]()}};return signJwt(_0x4b363f)[_0xfd1f('0x2b')](function(_0x13ab4d){return{'iat':_0x1e1d9c[_0xfd1f('0x59')],'nonce':_0x1e1d9c[_0xfd1f('0x3f')],'token':_0x13ab4d};});}
\ No newline at end of file
+var _0x93a6=['openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isAuthenticated','use','user','ChatInteraction','params','then','closed','status','unmanaged','json','disposition','Unmanaged.','catch','headers','authorization','startsWith','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','findOne','allowedLoginAttempts','blockDuration','isEqual','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','decryptString','length','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','toString','hex','floor','now','apiKeyNonce','HS512','../../mysqldb','../../config/license/hardware','../encryptor','lodash','jsonwebtoken','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause'];(function(_0x94ba8d,_0xd53c4c){var _0x406a50=function(_0x391faa){while(--_0x391faa){_0x94ba8d['push'](_0x94ba8d['shift']());}};_0x406a50(++_0xd53c4c);}(_0x93a6,0x65));var _0x693a=function(_0x417baa,_0x3923d0){_0x417baa=_0x417baa-0x0;var _0x42724f=_0x93a6[_0x417baa];return _0x42724f;};'use strict';var db=require(_0x693a('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x693a('0x1'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x693a('0x2'));var _=require(_0x693a('0x3'));var jwt=require(_0x693a('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x693a('0x5'));var crypto=require(_0x693a('0x6'));var BPromise=require(_0x693a('0x7'));var util=require(_0x693a('0x8'));var moment=require(_0x693a('0x9'));var validateJwt=expressJwt({'secret':config[_0x693a('0xa')][_0x693a('0xb')]});var userAttributes=['id',_0x693a('0xc'),_0x693a('0xd'),_0x693a('0xe'),_0x693a('0xf'),_0x693a('0x10'),_0x693a('0x11'),_0x693a('0x12'),_0x693a('0x13'),_0x693a('0x14'),_0x693a('0x15'),_0x693a('0x16'),_0x693a('0x17'),_0x693a('0x18'),_0x693a('0x19'),_0x693a('0x1a'),_0x693a('0x1b'),_0x693a('0x1c'),_0x693a('0x1d'),'crudPermissions',_0x693a('0x1e'),'passwordResetAt',_0x693a('0x1f'),_0x693a('0x20'),_0x693a('0x21'),'phoneBarDnd',_0x693a('0x22'),_0x693a('0x23'),'phoneBarEnableSettings','phoneBarExpires',_0x693a('0x24'),'phoneBarRemoteControl',_0x693a('0x25'),_0x693a('0x26'),_0x693a('0x27'),_0x693a('0x28'),_0x693a('0x29'),_0x693a('0x2a'),_0x693a('0x2b'),_0x693a('0x2c'),_0x693a('0x2d'),_0x693a('0x2e'),_0x693a('0x2f'),_0x693a('0x30')];exports['isChatInteractionAuthorized']=function(){return this[_0x693a('0x31')](!![])[_0x693a('0x32')](function(_0x4e289c,_0x44dc50,_0x48490f){if(_0x4e289c[_0x693a('0x33')]){_0x48490f();}else{return db[_0x693a('0x34')]['findOne']({'where':{'id':_0x4e289c[_0x693a('0x35')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x693a('0x36')](function(_0x14c690){if(_0x14c690&&_0x14c690[_0x693a('0x37')]){return _0x44dc50[_0x693a('0x38')](_0x14c690['disposition']===_0x693a('0x39')?0x195:0x193)[_0x693a('0x3a')]({'message':_0x14c690[_0x693a('0x3b')]==='unmanaged'?_0x693a('0x3c'):'Forbidden.'});}else{_0x48490f();}})[_0x693a('0x3d')](function(_0x1188fa){_0x48490f(_0x1188fa);});}});};exports['isAuthenticated']=function isAuthenticated(_0x2f9fbc){return compose()['use'](function(_0x27fc8c,_0x529611,_0x5da247){var _0x107e67;if(_0x27fc8c[_0x693a('0x3e')][_0x693a('0x3f')]){if(_[_0x693a('0x40')](_0x27fc8c[_0x693a('0x3e')]['authorization'],'Basic')){var _0x3e301a=basicAuth(_0x27fc8c);db[_0x693a('0x41')][_0x693a('0x42')]({'where':{'name':_0x3e301a['name']}})[_0x693a('0x36')](function(_0x4b920d){if(!_0x4b920d||!_0x4b920d[_0x693a('0x43')](_0x3e301a[_0x693a('0x44')])){return _0x529611[_0x693a('0x38')](0x191)['json']({'message':_0x693a('0x45')});}_0x27fc8c['user']={'id':_0x4b920d['id']};_0x5da247();})[_0x693a('0x3d')](function(_0x3dfdcd){_0x5da247(_0x3dfdcd);});}else if(_[_0x693a('0x40')](_0x27fc8c['headers']['authorization'],_0x693a('0x46'))){validateJwt(_0x27fc8c,_0x529611,_0x5da247);}else{if(_0x2f9fbc){_0x5da247();}else{return _0x529611[_0x693a('0x38')](0x193)[_0x693a('0x3a')]({'message':_0x693a('0x47')});}}}else if(_0x27fc8c[_0x693a('0x48')]['apikey']){try{var _0x3373ce={'audience':hardwareConf[_0x693a('0x49')](),'issuer':hardwareConf[_0x693a('0x49')]()};verifyJwt(_0x27fc8c['query'][_0x693a('0x4a')],_0x3373ce)[_0x693a('0x36')](function(_0x2df651){return db[_0x693a('0x41')][_0x693a('0x42')]({'where':{'id':_0x2df651['sub']}})[_0x693a('0x36')](function(_0xd843c8){_0x107e67=_0xd843c8;return db['Setting'][_0x693a('0x4b')]({'where':{'id':0x1},'attributes':[_0x693a('0x4c'),_0x693a('0x4d')],'raw':!![]});})[_0x693a('0x36')](function(_0x2fed7f){if(!_0x107e67||!_[_0x693a('0x4e')](_0x107e67['apiKeyNonce'],_0x2df651['nonce'])){return _0x529611[_0x693a('0x38')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x107e67['disabled']){return _0x529611['status'](0x191)[_0x693a('0x3a')]({'message':_0x693a('0x4f')});}if(_0x107e67[_0x693a('0x50')]){if(_0x2fed7f['blockDuration']>0x0){if(moment(_0x107e67[_0x693a('0x51')])[_0x693a('0x52')](_0x2fed7f[_0x693a('0x4d')],'minutes')>moment()){return _0x529611[_0x693a('0x38')](0x191)['json']({'message':_0x693a('0x4f')});}}else{return _0x529611[_0x693a('0x38')](0x191)[_0x693a('0x3a')]({'message':_0x693a('0x4f')});}}_0x27fc8c[_0x693a('0x33')]={'id':_0x107e67['id']};_0x5da247();});})[_0x693a('0x3d')](function(){return _0x529611[_0x693a('0x38')](0x191)[_0x693a('0x3a')]({'message':_0x693a('0x4f')});});}catch(_0x2ac79f){_0x5da247(_0x2ac79f);}}else if(_0x2f9fbc){_0x5da247();}else{return _0x529611[_0x693a('0x38')](0x193)[_0x693a('0x3a')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x39141a,_0x13068f,_0x2f4dda){if(_0x39141a[_0x693a('0x33')]){db[_0x693a('0x41')]['find']({'where':{'id':_0x39141a[_0x693a('0x33')]['id']},'attributes':userAttributes})[_0x693a('0x36')](function(_0x40b3ea){if(!_0x40b3ea){return _0x13068f['status'](0x194)['json']({'message':_0x693a('0x53')});}_0x39141a[_0x693a('0x33')]=_0x40b3ea;_0x2f4dda();})[_0x693a('0x3d')](function(_0x2c1741){_0x2f4dda(_0x2c1741);});}else if(_0x2f9fbc){_0x2f4dda();}else{return _0x13068f['status'](0x194)[_0x693a('0x3a')]({'message':_0x693a('0x54')});}});};exports[_0x693a('0x55')]=function canUpdate(){return compose()[_0x693a('0x32')](function(_0x2ec097,_0x222219,_0x45b917){return licenseUtil[_0x693a('0x56')]()[_0x693a('0x36')](function(_0x1898c6){if(_0x1898c6[_0x693a('0x57')]){_0x45b917();}else{return _0x222219[_0x693a('0x38')](0x193)['json']({'message':_0x693a('0x58')});}})['catch'](function(_0x4ca097){_0x45b917(_0x4ca097);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x693a('0x32')](function(_0x1d4860,_0x4df1dd,_0xb86a9e){return licenseUtil[_0x693a('0x56')]()['then'](function(_0x36db3b){if(_0x36db3b[_0x693a('0x59')]){_0xb86a9e();}else{return _0x4df1dd[_0x693a('0x38')](0x193)[_0x693a('0x3a')]({'message':_0x693a('0x58')});}})['catch'](function(_0x303a87){_0xb86a9e(_0x303a87);});});};exports[_0x693a('0x5a')]=function(_0x5902d5,_0x44c816,_0x53a068){_0x5902d5[_0x693a('0x5a')]=!![];return _0x53a068();};exports['signToken']=function signToken(_0x5d339e){return signJwt(_0x5d339e);};exports['setTokenCookie']=function(_0x39d49c,_0x244de8){if(!_0x39d49c[_0x693a('0x33')]){return _0x244de8[_0x693a('0x38')](0x194)[_0x693a('0x3a')]({'message':_0x693a('0x5b')});}var _0x513412={'payload':{'id':_0x39d49c[_0x693a('0x33')]['id'],'role':_0x39d49c[_0x693a('0x33')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x513412)['then'](function(_0x1f02bf){_0x244de8[_0x693a('0x5c')](_0x693a('0x5d'),_0x1f02bf);_0x244de8['redirect'](_0x693a('0x5e'));})['catch'](function(_0x357703){return _0x244de8[_0x693a('0x38')](0x1f4)[_0x693a('0x5f')](_0x357703);});};exports[_0x693a('0x60')]=function(_0x423f3f){if(_[_0x693a('0x61')](_0x423f3f['apiKeyNonce'])||_['isNil'](_0x423f3f[_0x693a('0x62')])){return null;}else{return createJwt(_0x423f3f);}};exports['generateApiKey']=function(_0x2b2dd9){_0x2b2dd9['apiKeyNonce']=generateNonce();_0x2b2dd9['apiKeyIat']=generateIssuedAt();return createJwt(_0x2b2dd9);};exports[_0x693a('0x63')]=function(_0x5a47d1,_0x2263e1){var _0x55602e=_0x5a47d1[_0x693a('0x48')][_0x693a('0x4a')];if(_0x55602e){var _0xe9f792={'nonce':_0x2263e1['apiKeyNonce'],'iat':_0x2263e1[_0x693a('0x62')],'audience':hardwareConf[_0x693a('0x49')](),'issuer':hardwareConf[_0x693a('0x49')]()};return verifyJwt(_0x55602e,_0xe9f792)[_0x693a('0x36')](function(){return generateApiKey(_0x2263e1);});}else{throw{'message':_0x693a('0x64')};}};exports['validatePasswordPattern']=function(_0x5b0d58){var _0xb08d8f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xb08d8f[_0x693a('0x65')](_0x5b0d58))throw new db[(_0x693a('0x66'))][(_0x693a('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x693a('0x68')]=function(_0x38884a,_0x5c4518,_0x1d3302){var _0x3570ab=encryptor['decryptString'](_0x5c4518)[_0x693a('0x69')](',');for(var _0x104a67=0x0;_0x104a67<_0x1d3302;_0x104a67++){if(!_0x3570ab[_0x104a67])break;if(_0x38884a[_0x693a('0x6a')]()===_0x3570ab[_0x104a67][_0x693a('0x6a')]()){var _0x511d6c=util['format'](_0x693a('0x6b'),_0x1d3302);if(_0x1d3302===0x1){_0x511d6c=_0x693a('0x6c');}throw new db[(_0x693a('0x66'))]['ValidationError'](_0x511d6c);}}return;};exports['updatePasswordsHistory']=function(_0x5fbd8d,_0x1dabff){var _0x28982a=_0x1dabff?encryptor[_0x693a('0x6d')](_0x1dabff)['split'](','):[];if(_0x28982a[_0x693a('0x6e')]===0x5){_0x28982a['splice'](-0x1,0x1);}_0x28982a[_0x693a('0x6f')](_0x5fbd8d);return encryptor[_0x693a('0x70')](_0x28982a[_0x693a('0x71')](','));};function signJwt(_0x423607){var _0x517165=BPromise[_0x693a('0x72')](jwt[_0x693a('0x73')],{'context':jwt});var _0x5a34e5=_0x423607[_0x693a('0x74')]||config[_0x693a('0xa')][_0x693a('0xb')];return new BPromise(function(_0x28113b,_0x52ed98){_0x517165(_0x423607[_0x693a('0x75')],_0x5a34e5,_0x423607[_0x693a('0x76')])[_0x693a('0x36')](function(_0x5df14d){_0x28113b(_0x5df14d);})[_0x693a('0x3d')](function(_0x28af64){_0x52ed98(_0x28af64);});});}function verifyJwt(_0x1b3e14,_0x3c2f30,_0x524262){var _0x17523c=BPromise[_0x693a('0x72')](jwt[_0x693a('0x77')],{'context':jwt});var _0x1dea84=_0x524262||config['secrets'][_0x693a('0xb')];return new BPromise(function(_0x43571e,_0x13912f){_0x17523c(_0x1b3e14,_0x1dea84,_0x3c2f30)['then'](function(_0x1da1cb){_0x43571e(_0x1da1cb);})['catch'](function(_0x17e870){_0x13912f(_0x17e870);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x693a('0x78')](_0x693a('0x79'));}function generateIssuedAt(){return Math[_0x693a('0x7a')](Date[_0x693a('0x7b')]()/0x3e8)[_0x693a('0x78')]();}function createJwt(_0x464657){var _0x18d61f={'payload':{'iat':_0x464657[_0x693a('0x62')],'nonce':_0x464657[_0x693a('0x7c')]},'options':{'algorithm':_0x693a('0x7d'),'subject':_0x464657['id'][_0x693a('0x78')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x18d61f)['then'](function(_0xec17b6){return{'iat':_0x464657[_0x693a('0x62')],'nonce':_0x464657[_0x693a('0x7c')],'token':_0xec17b6};});}
\ No newline at end of file
index dffb99d..c1957ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x079a=['crypto','bluebird','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','write','end','final','binary','close','unlink','createDecipher','encryptString','secret','createCipher','utf8','base64','decryptString'];(function(_0x12e1e9,_0x364c19){var _0x43d4a2=function(_0x25f0cb){while(--_0x25f0cb){_0x12e1e9['push'](_0x12e1e9['shift']());}};_0x43d4a2(++_0x364c19);}(_0x079a,0xd2));var _0xa079=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x079a[_0x2e4e19];return _0x9ba20b;};'use strict';var crypto=require(_0xa079('0x0'));var fs=require('fs');var BPromise=require(_0xa079('0x1'));var _=require('lodash');var config=require(_0xa079('0x2'));var logger=require(_0xa079('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xa079('0x4')][_0xa079('0x5')],'algorithm':_0xa079('0x6')};const fileOptions={'algorithm':_0xa079('0x7')};if(config[_0xa079('0x8')]&&config['encrypt'][_0xa079('0x9')]){var isSupported=isAlgorithmSupported(config[_0xa079('0x8')][_0xa079('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0xa079('0x8')][_0xa079('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xa079('0xa')](',\x20');logger[_0xa079('0xb')](config[_0xa079('0x8')][_0xa079('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x20d181){return AES_SUPPORTED_RX[_0xa079('0xc')](_0x20d181);}function getSupportedCiphers(){return crypto[_0xa079('0xd')]()[_0xa079('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x660d6f){return getSupportedCiphers()[_0xa079('0xf')](_0x660d6f)>-0x1;}function combineOptions(_0xcdd430){var _0x451b3c={};for(var _0x3b7985 in fileOptions){if(fileOptions[_0xa079('0x10')](_0x3b7985)){_0x451b3c[_0x3b7985]=fileOptions[_0x3b7985];}}if(_0xcdd430){for(var _0x31aa19 in _0xcdd430){if(_0xcdd430[_0xa079('0x10')](_0x31aa19)){_0x451b3c[_0x31aa19]=_0xcdd430[_0x31aa19];}}}return _0x451b3c;}exports[_0xa079('0x11')]=function(_0x1813d9,_0x375acb,_0x532f64,_0xdd6b73){return new BPromise(function(_0x12113e,_0x106101){_0xdd6b73=combineOptions(_0xdd6b73);var _0x1d4f56=new Buffer(_0x532f64);var _0x229cd1=fs[_0xa079('0x12')](_0x1813d9);var _0x21bd98=fs[_0xa079('0x13')](_0x375acb);var _0x56f669=crypto['createCipher'](_0xdd6b73[_0xa079('0x9')],_0x1d4f56);_0x229cd1['on'](_0xa079('0x14'),function(_0x5193b0){var _0x58360c=new Buffer(_0x56f669[_0xa079('0x15')](_0x5193b0),'binary');_0x21bd98[_0xa079('0x16')](_0x58360c);});_0x229cd1['on'](_0xa079('0x17'),function(){try{var _0x49fe41=new Buffer(_0x56f669[_0xa079('0x18')](_0xa079('0x19')),_0xa079('0x19'));_0x21bd98[_0xa079('0x16')](_0x49fe41);_0x21bd98[_0xa079('0x17')]();_0x21bd98['on'](_0xa079('0x1a'),function(){return _0x12113e(_0x375acb);});}catch(_0x1e5384){fs[_0xa079('0x1b')](_0x375acb);return _0x106101(_0x1e5384);}});});};exports['decryptFile']=function(_0x12abe9,_0x3fae5c,_0x1ebb26,_0x6b91c3){return new BPromise(function(_0x26b42e,_0x2e8fd1){_0x6b91c3=combineOptions(_0x6b91c3);var _0x3b2222=new Buffer(_0x1ebb26);var _0x5d4e39=fs['createReadStream'](_0x12abe9);var _0x139004=fs[_0xa079('0x13')](_0x3fae5c);var _0x5d8d91=crypto[_0xa079('0x1c')](_0x6b91c3[_0xa079('0x9')],_0x3b2222);_0x5d4e39['on'](_0xa079('0x14'),function(_0x585ee0){var _0x3d7877=new Buffer(_0x5d8d91[_0xa079('0x15')](_0x585ee0),_0xa079('0x19'));_0x139004[_0xa079('0x16')](_0x3d7877);});_0x5d4e39['on'](_0xa079('0x17'),function(){try{var _0x4f623a=new Buffer(_0x5d8d91[_0xa079('0x18')]('binary'),_0xa079('0x19'));_0x139004[_0xa079('0x16')](_0x4f623a);_0x139004[_0xa079('0x17')]();_0x139004['on'](_0xa079('0x1a'),function(){return _0x26b42e(_0x3fae5c);});}catch(_0x578032){fs['unlink'](_0x3fae5c);return _0x2e8fd1(_0x578032);}});});};exports[_0xa079('0x1d')]=function(_0x545573,_0x499bae,_0x34787c){var _0x55a0f0=_0x34787c||stringOptions[_0xa079('0x9')];var _0x4e097a=_0x499bae||stringOptions[_0xa079('0x1e')];var _0x2b133b=crypto[_0xa079('0x1f')](_0x55a0f0,_0x4e097a);var _0x26883d=_0x2b133b[_0xa079('0x15')](_0x545573,_0xa079('0x20'),_0xa079('0x21'));_0x26883d+=_0x2b133b[_0xa079('0x18')](_0xa079('0x21'));return _0x26883d;};exports[_0xa079('0x22')]=function(_0x2a12c8,_0x465019,_0x2bbd32){var _0x544ffe=_0x2bbd32||stringOptions[_0xa079('0x9')];var _0x3cc965=_0x465019||stringOptions[_0xa079('0x1e')];var _0x2be355=crypto[_0xa079('0x1c')](_0x544ffe,_0x3cc965);var _0x295c0e=_0x2be355[_0xa079('0x15')](_0x2a12c8,_0xa079('0x21'),_0xa079('0x20'));_0x295c0e+=_0x2be355[_0xa079('0x18')](_0xa079('0x20'));return _0x295c0e;};
\ No newline at end of file
+var _0xd9b1=['data','binary','write','end','final','close','unlink','update','encryptString','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createCipher'];(function(_0x48a1c4,_0x8362d7){var _0xd59098=function(_0x2ed9ab){while(--_0x2ed9ab){_0x48a1c4['push'](_0x48a1c4['shift']());}};_0xd59098(++_0x8362d7);}(_0xd9b1,0xb7));var _0x1d9b=function(_0x40d46d,_0x211ec6){_0x40d46d=_0x40d46d-0x0;var _0x4affd5=_0xd9b1[_0x40d46d];return _0x4affd5;};'use strict';var crypto=require(_0x1d9b('0x0'));var fs=require('fs');var BPromise=require(_0x1d9b('0x1'));var _=require(_0x1d9b('0x2'));var config=require(_0x1d9b('0x3'));var logger=require('../../config/logger')(_0x1d9b('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x1d9b('0x5')][_0x1d9b('0x6')],'algorithm':_0x1d9b('0x7')};const fileOptions={'algorithm':_0x1d9b('0x8')};if(config[_0x1d9b('0x9')]&&config[_0x1d9b('0x9')][_0x1d9b('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x1d9b('0xa')]=config[_0x1d9b('0x9')][_0x1d9b('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1d9b('0xb')](',\x20');logger[_0x1d9b('0xc')](config[_0x1d9b('0x9')][_0x1d9b('0xa')],_0x1d9b('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x2b6050){return AES_SUPPORTED_RX[_0x1d9b('0xe')](_0x2b6050);}function getSupportedCiphers(){return crypto[_0x1d9b('0xf')]()[_0x1d9b('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x2cca8e){return getSupportedCiphers()[_0x1d9b('0x11')](_0x2cca8e)>-0x1;}function combineOptions(_0x2f05d5){var _0x4e27a8={};for(var _0x441563 in fileOptions){if(fileOptions[_0x1d9b('0x12')](_0x441563)){_0x4e27a8[_0x441563]=fileOptions[_0x441563];}}if(_0x2f05d5){for(var _0x54fda9 in _0x2f05d5){if(_0x2f05d5[_0x1d9b('0x12')](_0x54fda9)){_0x4e27a8[_0x54fda9]=_0x2f05d5[_0x54fda9];}}}return _0x4e27a8;}exports[_0x1d9b('0x13')]=function(_0x4119b9,_0x5ddd7e,_0x251d56,_0x169470){return new BPromise(function(_0xbccb25,_0x45d18d){_0x169470=combineOptions(_0x169470);var _0x2ea18a=new Buffer(_0x251d56);var _0x178c03=fs['createReadStream'](_0x4119b9);var _0x52f984=fs['createWriteStream'](_0x5ddd7e);var _0x30a062=crypto[_0x1d9b('0x14')](_0x169470[_0x1d9b('0xa')],_0x2ea18a);_0x178c03['on'](_0x1d9b('0x15'),function(_0x1e41a6){var _0x2f953f=new Buffer(_0x30a062['update'](_0x1e41a6),_0x1d9b('0x16'));_0x52f984[_0x1d9b('0x17')](_0x2f953f);});_0x178c03['on'](_0x1d9b('0x18'),function(){try{var _0x3a394f=new Buffer(_0x30a062[_0x1d9b('0x19')]('binary'),'binary');_0x52f984[_0x1d9b('0x17')](_0x3a394f);_0x52f984[_0x1d9b('0x18')]();_0x52f984['on'](_0x1d9b('0x1a'),function(){return _0xbccb25(_0x5ddd7e);});}catch(_0x2e603a){fs[_0x1d9b('0x1b')](_0x5ddd7e);return _0x45d18d(_0x2e603a);}});});};exports['decryptFile']=function(_0x3b4a2d,_0x36ea91,_0x4f42ef,_0x5598ff){return new BPromise(function(_0x16b2fb,_0x1287ca){_0x5598ff=combineOptions(_0x5598ff);var _0x15b7a0=new Buffer(_0x4f42ef);var _0x4e1a83=fs['createReadStream'](_0x3b4a2d);var _0xf26250=fs['createWriteStream'](_0x36ea91);var _0x4b3a34=crypto['createDecipher'](_0x5598ff[_0x1d9b('0xa')],_0x15b7a0);_0x4e1a83['on']('data',function(_0x23d647){var _0x2c1146=new Buffer(_0x4b3a34[_0x1d9b('0x1c')](_0x23d647),_0x1d9b('0x16'));_0xf26250[_0x1d9b('0x17')](_0x2c1146);});_0x4e1a83['on']('end',function(){try{var _0x389c6f=new Buffer(_0x4b3a34[_0x1d9b('0x19')]('binary'),_0x1d9b('0x16'));_0xf26250[_0x1d9b('0x17')](_0x389c6f);_0xf26250[_0x1d9b('0x18')]();_0xf26250['on'](_0x1d9b('0x1a'),function(){return _0x16b2fb(_0x36ea91);});}catch(_0x13d2fe){fs[_0x1d9b('0x1b')](_0x36ea91);return _0x1287ca(_0x13d2fe);}});});};exports[_0x1d9b('0x1d')]=function(_0x298135,_0x2c43d0,_0xfcac7e){var _0x56099f=_0xfcac7e||stringOptions[_0x1d9b('0xa')];var _0x4ec657=_0x2c43d0||stringOptions['secret'];var _0x24a2a7=crypto[_0x1d9b('0x14')](_0x56099f,_0x4ec657);var _0x337d5f=_0x24a2a7[_0x1d9b('0x1c')](_0x298135,_0x1d9b('0x1e'),_0x1d9b('0x1f'));_0x337d5f+=_0x24a2a7[_0x1d9b('0x19')](_0x1d9b('0x1f'));return _0x337d5f;};exports[_0x1d9b('0x20')]=function(_0x3af389,_0x2d996f,_0x50f775){var _0x1ee313=_0x50f775||stringOptions['algorithm'];var _0x341d9f=_0x2d996f||stringOptions[_0x1d9b('0x21')];var _0x2b5a5a=crypto['createDecipher'](_0x1ee313,_0x341d9f);var _0x1be5e1=_0x2b5a5a[_0x1d9b('0x1c')](_0x3af389,'base64',_0x1d9b('0x1e'));_0x1be5e1+=_0x2b5a5a[_0x1d9b('0x19')](_0x1d9b('0x1e'));return _0x1be5e1;};
\ No newline at end of file
index 45550e5..f46f80e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10c6=['%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push'];(function(_0x9709ce,_0x5765af){var _0x414c87=function(_0x51149b){while(--_0x51149b){_0x9709ce['push'](_0x9709ce['shift']());}};_0x414c87(++_0x5765af);}(_0x10c6,0x118));var _0x610c=function(_0x3a6fb4,_0x2bf46f){_0x3a6fb4=_0x3a6fb4-0x0;var _0x4cbe4d=_0x10c6[_0x3a6fb4];return _0x4cbe4d;};'use strict';var util=require(_0x610c('0x0'));var path=require('path');var _=require(_0x610c('0x1'));var csv=require(_0x610c('0x2'));var fs=require('fs');var BPromise=require(_0x610c('0x3'));var zipdir=require(_0x610c('0x4'));var rimraf=require(_0x610c('0x5'));var db=require(_0x610c('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x610c('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x610c('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x55d777,_0x188c2a){var _0x59c44d={'status':_0x55d777};var _0x3144ff={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x188c2a){_0x59c44d['savename']=_0x188c2a;}return db['AnalyticExtractedReport'][_0x610c('0x9')](_0x59c44d,_0x3144ff);}function main(){var _0x458d20=0x1388;var _0x5561dd;logger[_0x610c('0xa')](util[_0x610c('0xb')](_0x610c('0xc'),EXTRACTED_REPORT_ID,_0x610c('0xd')));return db[_0x610c('0xe')][_0x610c('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x610c('0x10'),_0x610c('0x11')]})[_0x610c('0x12')](function(_0x31eae2){if(_0x31eae2){_0x5561dd=_0x31eae2;_0x458d20=_0x5561dd['splitSizeCsv']||0x1388;}})[_0x610c('0x12')](function(){return dbH[_0x610c('0x13')][_0x610c('0x14')](util[_0x610c('0xb')](_0x610c('0x15'),QUERY),{'type':dbH[_0x610c('0x13')][_0x610c('0x16')][_0x610c('0x17')]});})[_0x610c('0x12')](function(_0x1e4536){if(!_0x1e4536[0x0][_0x610c('0x18')]){return analyticExtractedReport(_0x610c('0x19'));}var _0x2b7437=[];var _0x22fbc7=0x0;if(_0x5561dd[_0x610c('0x10')]){if(_0x1e4536&&_0x1e4536[_0x610c('0x1a')]){var _0x54c64e=_['range'](_0x1e4536[0x0]['num']/_0x458d20);var _0xe290a3=Number['isInteger'](_0x1e4536[0x0][_0x610c('0x18')]/_0x458d20)?_0x1e4536[0x0][_0x610c('0x18')]%_0x458d20:0x0;_0x54c64e['forEach'](function(_0x391d9a){if(_0x391d9a>0x0){_0x22fbc7+=_0x458d20;}_0x2b7437[_0x610c('0x1b')](dbH['sequelize'][_0x610c('0x14')](util[_0x610c('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x458d20,_0x22fbc7),{'type':dbH[_0x610c('0x13')][_0x610c('0x16')][_0x610c('0x17')]}));});if(_0xe290a3>0x0){_0x22fbc7+=_0x458d20;_0x2b7437['push'](dbH[_0x610c('0x13')][_0x610c('0x14')](util[_0x610c('0xb')](_0x610c('0x1c'),QUERY,_0xe290a3,_0x22fbc7),{'type':dbH[_0x610c('0x13')]['QueryTypes'][_0x610c('0x17')]}));}}}else{_0x2b7437[_0x610c('0x1b')](dbH[_0x610c('0x13')]['query'](QUERY,{'type':dbH[_0x610c('0x13')][_0x610c('0x16')][_0x610c('0x17')]}));}var _0x40902e=path[_0x610c('0x1d')](PATH);var _0x5d9ae9=path[_0x610c('0x1e')](PATH,'.csv');var _0x48a04f=_0x5561dd['split']&&_0x2b7437[_0x610c('0x1a')]>0x1;var _0x430cdf=[];if(!fs['existsSync'](path[_0x610c('0x1f')](_0x40902e,_0x5d9ae9))&&_0x48a04f){fs['mkdirSync'](path['join'](_0x40902e,_0x5d9ae9));}return BPromise[_0x610c('0x20')](_0x2b7437,function(_0x42d627){_0x430cdf[_0x610c('0x1b')](_0x42d627);})[_0x610c('0x12')](function(){for(var _0x1c8856=0x0;_0x1c8856<_0x430cdf[_0x610c('0x1a')];_0x1c8856+=0x1){var _0x4ab49e;var _0x8f563b=_0x430cdf[_0x1c8856];if(_0x48a04f){_0x4ab49e=path[_0x610c('0x1f')](_0x40902e,_0x5d9ae9,util[_0x610c('0xb')](_0x610c('0x21'),_0x5d9ae9,_0x1c8856,_0x610c('0x22')));}else{_0x4ab49e=path['join'](_0x40902e,util['format']('%s.%s',_0x5d9ae9,_0x610c('0x22')));}fs[_0x610c('0x23')](_0x4ab49e,csv(_0x8f563b));}})[_0x610c('0x12')](function(){if(_0x48a04f){return new Promise(function(_0x59f13a){zipdir(path[_0x610c('0x1f')](_0x40902e,_0x5d9ae9),{'saveTo':path[_0x610c('0x1f')](_0x40902e,util[_0x610c('0xb')](_0x610c('0x24'),_0x5d9ae9,_0x610c('0x25')))},function(_0x30b767,_0x49c7cf){rimraf(path[_0x610c('0x1f')](_0x40902e,_0x5d9ae9),function(){});_0x59f13a(_0x610c('0x26'));});});}})[_0x610c('0x12')](function(){logger['info'](util[_0x610c('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x610c('0xd')));return analyticExtractedReport(_0x610c('0x27'),_0x48a04f?util[_0x610c('0xb')]('%s.%s',_0x5d9ae9,_0x48a04f?_0x610c('0x25'):_0x610c('0x22')):null);});})[_0x610c('0x28')](function(_0x4de19a){logger[_0x610c('0xa')](util[_0x610c('0xb')](_0x610c('0x29'),EXTRACTED_REPORT_ID,_0x610c('0xd')),util['inspect'](_0x4de19a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x610c('0x2a'));})[_0x610c('0x2b')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xd96d=['push','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','inspect','exit','util','path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','isInteger','forEach'];(function(_0x15eab7,_0x49bed6){var _0x1f15c6=function(_0x33acb0){while(--_0x33acb0){_0x15eab7['push'](_0x15eab7['shift']());}};_0x1f15c6(++_0x49bed6);}(_0xd96d,0x1e1));var _0xdd96=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xd96d[_0xa1e3e3];return _0xc980e9;};'use strict';var util=require(_0xdd96('0x0'));var path=require(_0xdd96('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xdd96('0x2'));var zipdir=require(_0xdd96('0x3'));var rimraf=require(_0xdd96('0x4'));var db=require(_0xdd96('0x5'))['db'];var dbH=require(_0xdd96('0x5'))[_0xdd96('0x6')];var logger=require(_0xdd96('0x7'))(_0xdd96('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xdd96('0x9')][0x2]);var QUERY=process[_0xdd96('0x9')][0x3];var PATH=process[_0xdd96('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x422fbc,_0x5d26bd){var _0x250df2={'status':_0x422fbc};var _0x19f534={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d26bd){_0x250df2['savename']=_0x5d26bd;}return db[_0xdd96('0xa')][_0xdd96('0xb')](_0x250df2,_0x19f534);}function main(){var _0x581da3=0x1388;var _0x37480b;logger['info'](util[_0xdd96('0xc')](_0xdd96('0xd'),EXTRACTED_REPORT_ID,_0xdd96('0xe')));return db[_0xdd96('0xf')][_0xdd96('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdd96('0x11'),_0xdd96('0x12')]})[_0xdd96('0x13')](function(_0x8a94b9){if(_0x8a94b9){_0x37480b=_0x8a94b9;_0x581da3=_0x37480b[_0xdd96('0x12')]||0x1388;}})[_0xdd96('0x13')](function(){return dbH[_0xdd96('0x14')][_0xdd96('0x15')](util[_0xdd96('0xc')](_0xdd96('0x16'),QUERY),{'type':dbH[_0xdd96('0x14')]['QueryTypes'][_0xdd96('0x17')]});})[_0xdd96('0x13')](function(_0x3ecc00){if(!_0x3ecc00[0x0][_0xdd96('0x18')]){return analyticExtractedReport(_0xdd96('0x19'));}var _0x5ad189=[];var _0x56844d=0x0;if(_0x37480b['split']){if(_0x3ecc00&&_0x3ecc00[_0xdd96('0x1a')]){var _0xdd8f84=_['range'](_0x3ecc00[0x0][_0xdd96('0x18')]/_0x581da3);var _0x57ea03=Number[_0xdd96('0x1b')](_0x3ecc00[0x0][_0xdd96('0x18')]/_0x581da3)?_0x3ecc00[0x0][_0xdd96('0x18')]%_0x581da3:0x0;_0xdd8f84[_0xdd96('0x1c')](function(_0x3e2ff4){if(_0x3e2ff4>0x0){_0x56844d+=_0x581da3;}_0x5ad189[_0xdd96('0x1d')](dbH[_0xdd96('0x14')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x581da3,_0x56844d),{'type':dbH['sequelize'][_0xdd96('0x1e')][_0xdd96('0x17')]}));});if(_0x57ea03>0x0){_0x56844d+=_0x581da3;_0x5ad189['push'](dbH['sequelize'][_0xdd96('0x15')](util[_0xdd96('0xc')](_0xdd96('0x1f'),QUERY,_0x57ea03,_0x56844d),{'type':dbH[_0xdd96('0x14')]['QueryTypes']['SELECT']}));}}}else{_0x5ad189[_0xdd96('0x1d')](dbH[_0xdd96('0x14')][_0xdd96('0x15')](QUERY,{'type':dbH[_0xdd96('0x14')][_0xdd96('0x1e')][_0xdd96('0x17')]}));}var _0x182cc3=path[_0xdd96('0x20')](PATH);var _0x2cfb00=path[_0xdd96('0x21')](PATH,_0xdd96('0x22'));var _0x1c8325=_0x37480b[_0xdd96('0x11')]&&_0x5ad189[_0xdd96('0x1a')]>0x1;var _0x5e580a=[];if(!fs[_0xdd96('0x23')](path[_0xdd96('0x24')](_0x182cc3,_0x2cfb00))&&_0x1c8325){fs[_0xdd96('0x25')](path[_0xdd96('0x24')](_0x182cc3,_0x2cfb00));}return BPromise[_0xdd96('0x26')](_0x5ad189,function(_0x121499){_0x5e580a[_0xdd96('0x1d')](_0x121499);})[_0xdd96('0x13')](function(){for(var _0x13d699=0x0;_0x13d699<_0x5e580a[_0xdd96('0x1a')];_0x13d699+=0x1){var _0x339537;var _0x558cb6=_0x5e580a[_0x13d699];if(_0x1c8325){_0x339537=path['join'](_0x182cc3,_0x2cfb00,util[_0xdd96('0xc')](_0xdd96('0x27'),_0x2cfb00,_0x13d699,_0xdd96('0x28')));}else{_0x339537=path[_0xdd96('0x24')](_0x182cc3,util[_0xdd96('0xc')](_0xdd96('0x29'),_0x2cfb00,_0xdd96('0x28')));}fs[_0xdd96('0x2a')](_0x339537,csv(_0x558cb6));}})[_0xdd96('0x13')](function(){if(_0x1c8325){return new Promise(function(_0x1bfdc5){zipdir(path['join'](_0x182cc3,_0x2cfb00),{'saveTo':path[_0xdd96('0x24')](_0x182cc3,util['format'](_0xdd96('0x29'),_0x2cfb00,_0xdd96('0x2b')))},function(_0x2d4735,_0x456cd3){rimraf(path[_0xdd96('0x24')](_0x182cc3,_0x2cfb00),function(){});_0x1bfdc5(_0xdd96('0x2c'));});});}})[_0xdd96('0x13')](function(){logger['info'](util['format'](_0xdd96('0x2d'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xdd96('0x2e'),_0x1c8325?util[_0xdd96('0xc')](_0xdd96('0x29'),_0x2cfb00,_0x1c8325?'zip':_0xdd96('0x28')):null);});})[_0xdd96('0x2f')](function(_0xde3d44){logger[_0xdd96('0x30')](util[_0xdd96('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xdd96('0xe')),util[_0xdd96('0x31')](_0xde3d44,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xdd96('0x32')](EXIT_CODE);});}main();
\ No newline at end of file
index 0c2e0fa..67e3603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8942=['/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','tableHeader','map','pick','toString','value','length','auto','body','push','concat','forEach','format','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','find','split','splitSizePdf','then','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','basename','.pdf','existsSync','mkdirSync','join','each','flatten','%s%d.%s','pdf','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','catch','inspect','Failed'];(function(_0x2f6601,_0x278de0){var _0x368923=function(_0x4f5a5a){while(--_0x4f5a5a){_0x2f6601['push'](_0x2f6601['shift']());}};_0x368923(++_0x278de0);}(_0x8942,0x1bc));var _0x2894=function(_0x4940b5,_0x6f44ef){_0x4940b5=_0x4940b5-0x0;var _0x1472bb=_0x8942[_0x4940b5];return _0x1472bb;};'use strict';var _=require(_0x2894('0x0'));var fs=require('fs');var util=require(_0x2894('0x1'));var path=require(_0x2894('0x2'));var moment=require(_0x2894('0x3'));var htmlToPdfmake=require(_0x2894('0x4'));var PdfPrinter=require(_0x2894('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0x2894('0x6'));var JSDOM=require(_0x2894('0x7'))[_0x2894('0x8')];var window=new JSDOM('')[_0x2894('0x9')];var BPromise=require(_0x2894('0xa'));var db=require(_0x2894('0xb'))['db'];var dbH=require(_0x2894('0xb'))[_0x2894('0xc')];var logger=require(_0x2894('0xd'))(_0x2894('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x2894('0xf')][0x2]);var QUERY=process[_0x2894('0xf')][0x3];var PATH=process[_0x2894('0xf')][0x4];var NAME=process[_0x2894('0xf')][0x5];var FORMAT=_0x2894('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b9e3a,_0x462b0f){var _0x3102b8={'status':_0x5b9e3a};var _0x3517ff={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x462b0f){_0x3102b8['savename']=_0x462b0f;}return db[_0x2894('0x11')]['update'](_0x3102b8,_0x3517ff);}function getHeaders(_0x181284){return _['map'](_0x181284,function(_0x5da7e1){return{'text':_0x5da7e1,'style':_0x2894('0x12')};});}function getRows(_0x331e59,_0x52e712){return _[_0x2894('0x13')](_0x52e712,function(_0x6e8dba){return _(_0x6e8dba)[_0x2894('0x14')](_0x331e59)[_0x2894('0x13')](function(_0x5185bf){return _0x5185bf?_[_0x2894('0x15')](_0x5185bf):'';})[_0x2894('0x16')]();});}function createTable(_0x256ff7,_0x23fa48){var _0x9552a5={'widths':_['fill'](Array(_0x256ff7[_0x2894('0x17')]),0x91),'heights':function(_0x531d2b){return _0x531d2b===0x0?_0x2894('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x24f7ca=getHeaders(_0x256ff7);_0x9552a5[_0x2894('0x19')][_0x2894('0x1a')](_0x24f7ca);var _0x2bede1=getRows(_0x256ff7,_0x23fa48);_0x9552a5['body']=_0x9552a5['body'][_0x2894('0x1b')](_0x2bede1);return _0x9552a5;}function createTables(_0x1e0bc4){var _0x54859a=[];var _0x3fcb7e=_['chunk'](Object['keys'](_0x1e0bc4[0x0]),0x5);_0x3fcb7e[_0x2894('0x1c')](function(_0x28ab0f){_0x54859a[_0x2894('0x1a')](createTable(_0x28ab0f,_0x1e0bc4));});return _0x54859a;}function getPDFDocDefinition(_0x47b983){var _0xe1589d=util[_0x2894('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x2894('0x1e')])[_0x2894('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x2894('0x1f')])['format'](FORMAT));var _0x595f99=[];for(var _0x381d53=0x0;_0x381d53<_0x47b983[_0x2894('0x17')];_0x381d53++){var _0x33b2dd=[];if(_0x381d53===0x0){_0x33b2dd['push']({'text':_0xe1589d,'style':_0x2894('0x20')});}var _0x3c1f41={'table':_0x47b983[_0x381d53]};if(_0x381d53>0x0){_0x3c1f41[_0x2894('0x21')]=_0x2894('0x22');_0x3c1f41[_0x2894('0x23')]=[0x0,0x46,0x0,0x0];}_0x33b2dd[_0x2894('0x1a')](_0x3c1f41);_0x595f99[_0x2894('0x1a')](_0x33b2dd);}return{'pageSize':'A4','pageOrientation':_0x2894('0x24'),'content':_0x595f99,'footer':function(_0x34a843,_0x4fcdbf){return{'text':_0x34a843[_0x2894('0x15')]()+_0x2894('0x25')+_0x4fcdbf,'style':_0x2894('0x26')};},'defaultStyle':{'font':_0x2894('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x2894('0x28')},'footer':{'alignment':_0x2894('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5672ae){var _0x220f1e=0x1388;var _0xb338cf;if(!_0x5672ae[0x0][_0x2894('0x2a')]){return analyticExtractedReport('Empty');}return db['Setting'][_0x2894('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2894('0x2c'),_0x2894('0x2d')]})['then'](function(_0x3c14e4){if(_0x3c14e4){_0xb338cf=_0x3c14e4;_0x220f1e=_0xb338cf[_0x2894('0x2d')]||0x3e8;}})[_0x2894('0x2e')](function(){var _0x540831=[];var _0xc3b830=0x0;if(_0xb338cf[_0x2894('0x2c')]){if(_0x5672ae&&_0x5672ae[_0x2894('0x17')]){var _0x2ddaf4=_['range'](_0x5672ae[0x0][_0x2894('0x2a')]/_0x220f1e);var _0x1313f0=Number['isInteger'](_0x5672ae[0x0][_0x2894('0x2a')]/_0x220f1e)?_0x5672ae[0x0][_0x2894('0x2a')]%_0x220f1e:0x0;_0x2ddaf4[_0x2894('0x1c')](function(_0x2721d6){if(_0x2721d6>0x0){_0xc3b830+=_0x220f1e;}_0x540831[_0x2894('0x1a')](dbH[_0x2894('0x2f')]['query'](util[_0x2894('0x1d')](_0x2894('0x30'),QUERY,_0x220f1e,_0xc3b830),{'type':dbH['sequelize']['QueryTypes'][_0x2894('0x31')]}));});if(_0x1313f0>0x0){_0xc3b830+=_0x220f1e;_0x540831['push'](dbH[_0x2894('0x2f')]['query'](util[_0x2894('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1313f0,_0xc3b830),{'type':dbH[_0x2894('0x2f')]['QueryTypes']['SELECT']}));}}}else{_0x540831[_0x2894('0x1a')](dbH[_0x2894('0x2f')][_0x2894('0x32')](QUERY,{'type':dbH[_0x2894('0x2f')]['QueryTypes'][_0x2894('0x31')]}));}var _0x458a5f=path['dirname'](PATH);var _0x2b2a3c=path[_0x2894('0x33')](PATH,_0x2894('0x34'));var _0x13cb0e=_0xb338cf[_0x2894('0x2c')]&&_0x540831[_0x2894('0x17')]>0x1;var _0x8170d4=[];if(!fs[_0x2894('0x35')](path['join'](_0x458a5f,_0x2b2a3c))&&_0x13cb0e){fs[_0x2894('0x36')](path[_0x2894('0x37')](_0x458a5f,_0x2b2a3c));}return BPromise[_0x2894('0x38')](_0x540831,function(_0x1a6f04){_0x8170d4[_0x2894('0x1a')](_0x1a6f04);})[_0x2894('0x2e')](function(){var _0x46d3ee=[];for(var _0x99bed7=0x0;_0x99bed7<_0x8170d4['length'];_0x99bed7+=0x1){var _0x20e784=_0x8170d4[_0x99bed7];var _0x4ca4ad=createTables(_[_0x2894('0x39')](_0x20e784));var _0x4487b9;var _0x2ba2c1=getPDFDocDefinition(_0x4ca4ad);var _0x21e140=getPDFPrinter();var _0xdb69d8=_0x21e140['createPdfKitDocument'](_0x2ba2c1);if(_0x13cb0e){_0x4487b9=path['join'](_0x458a5f,_0x2b2a3c,util[_0x2894('0x1d')](_0x2894('0x3a'),_0x2b2a3c,_0x99bed7,_0x2894('0x3b')));}else{_0x4487b9=path[_0x2894('0x37')](_0x458a5f,util[_0x2894('0x1d')]('%s.%s',_0x2b2a3c,_0x2894('0x3b')));}_0x46d3ee[_0x2894('0x1a')](writePDFDocument(_0xdb69d8,_0x4487b9));}return Promise['all'](_0x46d3ee);})['then'](function(){if(_0x13cb0e){return new Promise(function(_0x59a6d7){zipdir(path['join'](_0x458a5f,_0x2b2a3c),{'saveTo':path['join'](_0x458a5f,util[_0x2894('0x1d')](_0x2894('0x3c'),_0x2b2a3c,_0x2894('0x3d')))},function(){rimraf(path['join'](_0x458a5f,_0x2b2a3c),function(){});_0x59a6d7('zip\x20finished');});});}})['then'](function(){if(!_0x13cb0e)return;rimraf(path[_0x2894('0x37')](_0x458a5f,_0x2b2a3c),function(){});})['then'](function(){logger[_0x2894('0x3e')](util[_0x2894('0x1d')](_0x2894('0x3f'),EXTRACTED_REPORT_ID,_0x2894('0x40')));return analyticExtractedReport('Completed',_0x13cb0e?util['format'](_0x2894('0x3c'),_0x2b2a3c,_0x13cb0e?_0x2894('0x3d'):_0x2894('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x2894('0x1d')](_0x2894('0x41'),EXTRACTED_REPORT_ID,_0x2894('0x40')));return db[_0x2894('0x11')][_0x2894('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x2894('0x2e')](function(_0x9f8f05){EXTRACTED_REPORT=_0x9f8f05;return dbH[_0x2894('0x2f')][_0x2894('0x32')](util[_0x2894('0x1d')](_0x2894('0x43'),QUERY),{'type':dbH[_0x2894('0x2f')][_0x2894('0x44')][_0x2894('0x31')]});})[_0x2894('0x2e')](extractReport)[_0x2894('0x45')](function(_0x4838dc){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2894('0x40')),util[_0x2894('0x46')](_0x4838dc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2894('0x47'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1209c1=new PdfPrinter({'Arial':{'normal':__dirname+_0x2894('0x48'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x2894('0x49')}});return _0x1209c1;}function getPDFDocDefinitionFromHTML(_0x17fcac,_0x2e3140){var _0x472a7f=util[_0x2894('0x1d')](_0x2894('0x4a'),_0x2e3140[_0x2894('0x4b')],_0x2e3140[_0x2894('0x4c')]);var _0x3d0fab=moment()[_0x2894('0x1d')](_0x2894('0x4d'))[_0x2894('0x15')]();var _0x1d7deb=htmlToPdfmake(_0x17fcac,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1d7deb],'defaultStyle':{'font':_0x2894('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x2894('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x2894('0x4e')}},'header':function(){return[{'text':_0x2894('0x4f'),'style':'header'}];},'footer':function(_0x545aa7,_0x403868){return[{'text':util[_0x2894('0x1d')](_0x2894('0x50'),_0x472a7f,_0x545aa7,_0x403868,_0x3d0fab),'style':'footer'}];}};}function writePDFDocument(_0x5743b7,_0x4ddf5a){return new Promise(function(_0x5eaffb,_0x2562ac){var _0x180a0c=_0x5743b7['pipe'](fs['createWriteStream'](_0x4ddf5a));_0x180a0c['on']('finish',function(){_0x5eaffb(_0x2894('0x51'));});_0x180a0c['on'](_0x2894('0x52'),function(_0x4cc158){_0x2562ac(_0x4cc158);});_0x5743b7[_0x2894('0x53')]();});}exports[_0x2894('0x54')]=function(_0x578b48,_0x262c9f){var _0x52c918=getPDFPrinter();var _0x3e22ae=getPDFDocDefinitionFromHTML(_0x578b48,_0x262c9f);var _0x3db81a=_0x52c918[_0x2894('0x55')](_0x3e22ae);return writePDFDocument(_0x3db81a,_0x262c9f[_0x2894('0x2')])[_0x2894('0x45')](function(_0x2ee3d9){throw _0x2ee3d9;});};
\ No newline at end of file
+var _0x88af=['../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','pick','toString','value','fill','length','auto','body','concat','chunk','keys','forEach','push','format','name','endDate','header','before','margin','\x20/\x20','footer','Arial','black','right','num','Empty','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','basename','existsSync','join','each','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','window','bluebird','../../mysqldb','dbH'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x88af,0x157));var _0xf88a=function(_0x463697,_0xccfdc4){_0x463697=_0x463697-0x0;var _0x33cfe1=_0x88af[_0x463697];return _0x33cfe1;};'use strict';var _=require(_0xf88a('0x0'));var fs=require('fs');var util=require(_0xf88a('0x1'));var path=require(_0xf88a('0x2'));var moment=require(_0xf88a('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xf88a('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0xf88a('0x5')];var BPromise=require(_0xf88a('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf88a('0x7'))[_0xf88a('0x8')];var logger=require(_0xf88a('0x9'))(_0xf88a('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf88a('0xb')][0x2]);var QUERY=process[_0xf88a('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xf88a('0xb')][0x5];var FORMAT=_0xf88a('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x56ea29,_0x558d44){var _0x55b930={'status':_0x56ea29};var _0x5d402f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x558d44){_0x55b930[_0xf88a('0xd')]=_0x558d44;}return db[_0xf88a('0xe')]['update'](_0x55b930,_0x5d402f);}function getHeaders(_0x10712f){return _['map'](_0x10712f,function(_0x30be1d){return{'text':_0x30be1d,'style':_0xf88a('0xf')};});}function getRows(_0x11fd21,_0x38152a){return _['map'](_0x38152a,function(_0x342a90){return _(_0x342a90)[_0xf88a('0x10')](_0x11fd21)['map'](function(_0x19330e){return _0x19330e?_[_0xf88a('0x11')](_0x19330e):'';})[_0xf88a('0x12')]();});}function createTable(_0x555af8,_0x19b0ce){var _0x141256={'widths':_[_0xf88a('0x13')](Array(_0x555af8[_0xf88a('0x14')]),0x91),'heights':function(_0x15b3a8){return _0x15b3a8===0x0?_0xf88a('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x107383=getHeaders(_0x555af8);_0x141256[_0xf88a('0x16')]['push'](_0x107383);var _0x5abb9f=getRows(_0x555af8,_0x19b0ce);_0x141256['body']=_0x141256[_0xf88a('0x16')][_0xf88a('0x17')](_0x5abb9f);return _0x141256;}function createTables(_0x25a0ff){var _0x273a63=[];var _0x50484d=_[_0xf88a('0x18')](Object[_0xf88a('0x19')](_0x25a0ff[0x0]),0x5);_0x50484d[_0xf88a('0x1a')](function(_0x2d94e9){_0x273a63[_0xf88a('0x1b')](createTable(_0x2d94e9,_0x25a0ff));});return _0x273a63;}function getPDFDocDefinition(_0x527752){var _0x4f1b86=util[_0xf88a('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xf88a('0x1d')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xf88a('0x1e')])[_0xf88a('0x1c')](FORMAT));var _0x2d0272=[];for(var _0x35ffb9=0x0;_0x35ffb9<_0x527752['length'];_0x35ffb9++){var _0x18ed5c=[];if(_0x35ffb9===0x0){_0x18ed5c[_0xf88a('0x1b')]({'text':_0x4f1b86,'style':_0xf88a('0x1f')});}var _0x16974d={'table':_0x527752[_0x35ffb9]};if(_0x35ffb9>0x0){_0x16974d['pageBreak']=_0xf88a('0x20');_0x16974d[_0xf88a('0x21')]=[0x0,0x46,0x0,0x0];}_0x18ed5c[_0xf88a('0x1b')](_0x16974d);_0x2d0272[_0xf88a('0x1b')](_0x18ed5c);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x2d0272,'footer':function(_0x55dc36,_0x4032da){return{'text':_0x55dc36[_0xf88a('0x11')]()+_0xf88a('0x22')+_0x4032da,'style':_0xf88a('0x23')};},'defaultStyle':{'font':_0xf88a('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf88a('0x25')},'footer':{'alignment':_0xf88a('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x513eb3){var _0x2a2478=0x1388;var _0x5b8d76;if(!_0x513eb3[0x0][_0xf88a('0x27')]){return analyticExtractedReport(_0xf88a('0x28'));}return db['Setting'][_0xf88a('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf88a('0x2a'),_0xf88a('0x2b')]})[_0xf88a('0x2c')](function(_0x3b919c){if(_0x3b919c){_0x5b8d76=_0x3b919c;_0x2a2478=_0x5b8d76[_0xf88a('0x2b')]||0x3e8;}})[_0xf88a('0x2c')](function(){var _0x30294a=[];var _0x46adb2=0x0;if(_0x5b8d76[_0xf88a('0x2a')]){if(_0x513eb3&&_0x513eb3[_0xf88a('0x14')]){var _0x380132=_[_0xf88a('0x2d')](_0x513eb3[0x0][_0xf88a('0x27')]/_0x2a2478);var _0x5bed2c=Number[_0xf88a('0x2e')](_0x513eb3[0x0][_0xf88a('0x27')]/_0x2a2478)?_0x513eb3[0x0]['num']%_0x2a2478:0x0;_0x380132[_0xf88a('0x1a')](function(_0x48d96d){if(_0x48d96d>0x0){_0x46adb2+=_0x2a2478;}_0x30294a[_0xf88a('0x1b')](dbH[_0xf88a('0x2f')][_0xf88a('0x30')](util[_0xf88a('0x1c')](_0xf88a('0x31'),QUERY,_0x2a2478,_0x46adb2),{'type':dbH[_0xf88a('0x2f')]['QueryTypes'][_0xf88a('0x32')]}));});if(_0x5bed2c>0x0){_0x46adb2+=_0x2a2478;_0x30294a[_0xf88a('0x1b')](dbH[_0xf88a('0x2f')][_0xf88a('0x30')](util[_0xf88a('0x1c')](_0xf88a('0x31'),QUERY,_0x5bed2c,_0x46adb2),{'type':dbH[_0xf88a('0x2f')][_0xf88a('0x33')][_0xf88a('0x32')]}));}}}else{_0x30294a[_0xf88a('0x1b')](dbH[_0xf88a('0x2f')][_0xf88a('0x30')](QUERY,{'type':dbH['sequelize'][_0xf88a('0x33')]['SELECT']}));}var _0x16af16=path['dirname'](PATH);var _0x3ce520=path[_0xf88a('0x34')](PATH,'.pdf');var _0x5afea2=_0x5b8d76[_0xf88a('0x2a')]&&_0x30294a[_0xf88a('0x14')]>0x1;var _0x243cf5=[];if(!fs[_0xf88a('0x35')](path[_0xf88a('0x36')](_0x16af16,_0x3ce520))&&_0x5afea2){fs['mkdirSync'](path[_0xf88a('0x36')](_0x16af16,_0x3ce520));}return BPromise[_0xf88a('0x37')](_0x30294a,function(_0x209bf2){_0x243cf5[_0xf88a('0x1b')](_0x209bf2);})[_0xf88a('0x2c')](function(){var _0x306de7=[];for(var _0x5c77e7=0x0;_0x5c77e7<_0x243cf5['length'];_0x5c77e7+=0x1){var _0x2c45fa=_0x243cf5[_0x5c77e7];var _0x5a086b=createTables(_['flatten'](_0x2c45fa));var _0x3f9d20;var _0x2ba29d=getPDFDocDefinition(_0x5a086b);var _0x5e5b5d=getPDFPrinter();var _0x9cce36=_0x5e5b5d[_0xf88a('0x38')](_0x2ba29d);if(_0x5afea2){_0x3f9d20=path[_0xf88a('0x36')](_0x16af16,_0x3ce520,util['format'](_0xf88a('0x39'),_0x3ce520,_0x5c77e7,'pdf'));}else{_0x3f9d20=path[_0xf88a('0x36')](_0x16af16,util[_0xf88a('0x1c')](_0xf88a('0x3a'),_0x3ce520,_0xf88a('0x3b')));}_0x306de7[_0xf88a('0x1b')](writePDFDocument(_0x9cce36,_0x3f9d20));}return Promise[_0xf88a('0x3c')](_0x306de7);})[_0xf88a('0x2c')](function(){if(_0x5afea2){return new Promise(function(_0x5c7969){zipdir(path[_0xf88a('0x36')](_0x16af16,_0x3ce520),{'saveTo':path[_0xf88a('0x36')](_0x16af16,util[_0xf88a('0x1c')](_0xf88a('0x3a'),_0x3ce520,'zip'))},function(){rimraf(path[_0xf88a('0x36')](_0x16af16,_0x3ce520),function(){});_0x5c7969(_0xf88a('0x3d'));});});}})['then'](function(){if(!_0x5afea2)return;rimraf(path[_0xf88a('0x36')](_0x16af16,_0x3ce520),function(){});})[_0xf88a('0x2c')](function(){logger[_0xf88a('0x3e')](util['format'](_0xf88a('0x3f'),EXTRACTED_REPORT_ID,_0xf88a('0x40')));return analyticExtractedReport(_0xf88a('0x41'),_0x5afea2?util[_0xf88a('0x1c')]('%s.%s',_0x3ce520,_0x5afea2?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf88a('0x3e')](util[_0xf88a('0x1c')](_0xf88a('0x42'),EXTRACTED_REPORT_ID,_0xf88a('0x40')));return db[_0xf88a('0xe')][_0xf88a('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf88a('0x2c')](function(_0x310fd2){EXTRACTED_REPORT=_0x310fd2;return dbH[_0xf88a('0x2f')][_0xf88a('0x30')](util[_0xf88a('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xf88a('0x2f')][_0xf88a('0x33')]['SELECT']});})[_0xf88a('0x2c')](extractReport)[_0xf88a('0x44')](function(_0x27d892){logger[_0xf88a('0x3e')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf88a('0x40')),util[_0xf88a('0x45')](_0x27d892,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf88a('0x46'));})['finally'](function(){process[_0xf88a('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x52d1de=new PdfPrinter({'Arial':{'normal':__dirname+_0xf88a('0x48'),'bold':__dirname+_0xf88a('0x49'),'italics':__dirname+_0xf88a('0x4a'),'bolditalics':__dirname+_0xf88a('0x4b')}});return _0x52d1de;}function getPDFDocDefinitionFromHTML(_0x5d0d69,_0x4c5837){var _0x23ff5e=util[_0xf88a('0x1c')](_0xf88a('0x4c'),_0x4c5837[_0xf88a('0x4d')],_0x4c5837[_0xf88a('0x4e')]);var _0x339380=moment()[_0xf88a('0x1c')](_0xf88a('0x4f'))['toString']();var _0x265290=htmlToPdfmake(_0x5d0d69,{'window':window,'tableAutoSize':!![]});return{'content':[_0x265290],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf88a('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf88a('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf88a('0x50')}},'header':function(){return[{'text':_0xf88a('0x51'),'style':_0xf88a('0x1f')}];},'footer':function(_0x53270d,_0x4f48f4){return[{'text':util[_0xf88a('0x1c')](_0xf88a('0x52'),_0x23ff5e,_0x53270d,_0x4f48f4,_0x339380),'style':'footer'}];}};}function writePDFDocument(_0x18cf22,_0x2b51c2){return new Promise(function(_0x8f877e,_0x377492){var _0x4b47b9=_0x18cf22[_0xf88a('0x53')](fs[_0xf88a('0x54')](_0x2b51c2));_0x4b47b9['on'](_0xf88a('0x55'),function(){_0x8f877e('finish');});_0x4b47b9['on']('error',function(_0x26d6c6){_0x377492(_0x26d6c6);});_0x18cf22[_0xf88a('0x56')]();});}exports[_0xf88a('0x57')]=function(_0xbb8962,_0x2c06cd){var _0xe60582=getPDFPrinter();var _0x114760=getPDFDocDefinitionFromHTML(_0xbb8962,_0x2c06cd);var _0x6e7399=_0xe60582[_0xf88a('0x38')](_0x114760);return writePDFDocument(_0x6e7399,_0x2c06cd['path'])[_0xf88a('0x44')](function(_0xd578ec){throw _0xd578ec;});};
\ No newline at end of file
index 96aba9e..6fa9416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2652=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','join','mkdirSync','each','length','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','isInteger'];(function(_0x5e2a2b,_0x25abe0){var _0x326d1c=function(_0xf77a58){while(--_0xf77a58){_0x5e2a2b['push'](_0x5e2a2b['shift']());}};_0x326d1c(++_0x25abe0);}(_0x2652,0x1e1));var _0x2265=function(_0x362043,_0x47f3d4){_0x362043=_0x362043-0x0;var _0x4433be=_0x2652[_0x362043];return _0x4433be;};'use strict';var util=require(_0x2265('0x0'));var path=require(_0x2265('0x1'));var _=require(_0x2265('0x2'));var fs=require('fs');var json2xls=require(_0x2265('0x3'));var BPromise=require(_0x2265('0x4'));var zipdir=require(_0x2265('0x5'));var rimraf=require(_0x2265('0x6'));var db=require(_0x2265('0x7'))['db'];var dbH=require(_0x2265('0x7'))[_0x2265('0x8')];var logger=require(_0x2265('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2265('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x42a98b,_0x5536fd){var _0xd3b591={'status':_0x42a98b};var _0x5452f4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5536fd){_0xd3b591[_0x2265('0xb')]=_0x5536fd;}return db[_0x2265('0xc')][_0x2265('0xd')](_0xd3b591,_0x5452f4);}function main(){var _0x2e2553=0x1388;var _0x310cbd;logger['info'](util[_0x2265('0xe')](_0x2265('0xf'),EXTRACTED_REPORT_ID,_0x2265('0x10')));return db[_0x2265('0x11')][_0x2265('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2265('0x13'),_0x2265('0x14')]})[_0x2265('0x15')](function(_0x241f12){if(_0x241f12){_0x310cbd=_0x241f12;_0x2e2553=_0x310cbd[_0x2265('0x14')]||0x1388;}})[_0x2265('0x15')](function(){return dbH[_0x2265('0x16')][_0x2265('0x17')](util[_0x2265('0xe')](_0x2265('0x18'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x2265('0x19')]});})['then'](function(_0x1a0c73){if(!_0x1a0c73[0x0][_0x2265('0x1a')]){return analyticExtractedReport(_0x2265('0x1b'));}var _0x31c0e4=[];var _0x598a17=0x0;if(_0x310cbd[_0x2265('0x13')]){if(_0x1a0c73&&_0x1a0c73['length']){var _0x58d3d1=_['range'](_0x1a0c73[0x0][_0x2265('0x1a')]/_0x2e2553);var _0x298752=Number[_0x2265('0x1c')](_0x1a0c73[0x0]['num']/_0x2e2553)?_0x1a0c73[0x0][_0x2265('0x1a')]%_0x2e2553:0x0;_0x58d3d1['forEach'](function(_0x29485c){if(_0x29485c>0x0){_0x598a17+=_0x2e2553;}_0x31c0e4[_0x2265('0x1d')](dbH[_0x2265('0x16')][_0x2265('0x17')](util[_0x2265('0xe')](_0x2265('0x1e'),QUERY,_0x2e2553,_0x598a17),{'type':dbH[_0x2265('0x16')][_0x2265('0x1f')][_0x2265('0x19')]}));});if(_0x298752>0x0){_0x598a17+=_0x2e2553;_0x31c0e4['push'](dbH[_0x2265('0x16')]['query'](util[_0x2265('0xe')](_0x2265('0x1e'),QUERY,_0x298752,_0x598a17),{'type':dbH['sequelize'][_0x2265('0x1f')][_0x2265('0x19')]}));}}}else{_0x31c0e4[_0x2265('0x1d')](dbH['sequelize'][_0x2265('0x17')](QUERY,{'type':dbH[_0x2265('0x16')][_0x2265('0x1f')]['SELECT']}));}var _0x2b3c55=path[_0x2265('0x20')](PATH);var _0x31500e=path[_0x2265('0x21')](PATH,_0x2265('0x22'));var _0x17165c=_0x310cbd[_0x2265('0x13')]&&_0x31c0e4['length']>0x1;var _0x5703a1=[];if(!fs['existsSync'](path[_0x2265('0x23')](_0x2b3c55,_0x31500e))&&_0x17165c){fs[_0x2265('0x24')](path['join'](_0x2b3c55,_0x31500e));}return BPromise[_0x2265('0x25')](_0x31c0e4,function(_0x5d059f){_0x5703a1[_0x2265('0x1d')](_0x5d059f);})[_0x2265('0x15')](function(){for(var _0x48419e=0x0;_0x48419e<_0x5703a1[_0x2265('0x26')];_0x48419e+=0x1){var _0x1f9392;var _0x4f5e5c=_0x5703a1[_0x48419e];if(_0x17165c){_0x1f9392=path[_0x2265('0x23')](_0x2b3c55,_0x31500e,util['format'](_0x2265('0x27'),_0x31500e,_0x48419e,_0x2265('0x28')));}else{_0x1f9392=path[_0x2265('0x23')](_0x2b3c55,util[_0x2265('0xe')](_0x2265('0x29'),_0x31500e,_0x2265('0x28')));}fs[_0x2265('0x2a')](_0x1f9392,json2xls(_0x4f5e5c),_0x2265('0x2b'));}})[_0x2265('0x15')](function(){if(_0x17165c){return new Promise(function(_0x336853){zipdir(path['join'](_0x2b3c55,_0x31500e),{'saveTo':path[_0x2265('0x23')](_0x2b3c55,util[_0x2265('0xe')](_0x2265('0x29'),_0x31500e,_0x2265('0x2c')))},function(_0x54c3bb,_0x444db3){rimraf(path['join'](_0x2b3c55,_0x31500e),function(){});_0x336853(_0x2265('0x2d'));});});}})[_0x2265('0x15')](function(){logger[_0x2265('0x2e')](util[_0x2265('0xe')](_0x2265('0x2f'),EXTRACTED_REPORT_ID,_0x2265('0x10')));return analyticExtractedReport(_0x2265('0x30'),_0x17165c?util[_0x2265('0xe')](_0x2265('0x29'),_0x31500e,_0x17165c?_0x2265('0x2c'):_0x2265('0x28')):null);});})[_0x2265('0x31')](function(_0x29688c){logger[_0x2265('0x2e')](util[_0x2265('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2265('0x10')),util['inspect'](_0x29688c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2265('0x32')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xfa6d=['QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','mkdirSync','join','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','inspect','exit','util','path','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfa6d,0x105));var _0xdfa6=function(_0x37c24c,_0x327da0){_0x37c24c=_0x37c24c-0x0;var _0x146a12=_0xfa6d[_0x37c24c];return _0x146a12;};'use strict';var util=require(_0xdfa6('0x0'));var path=require(_0xdfa6('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xdfa6('0x2'));var rimraf=require(_0xdfa6('0x3'));var db=require(_0xdfa6('0x4'))['db'];var dbH=require(_0xdfa6('0x4'))[_0xdfa6('0x5')];var logger=require(_0xdfa6('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xdfa6('0x7')][0x3];var PATH=process[_0xdfa6('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x124f6d,_0x22af17){var _0x11b5bd={'status':_0x124f6d};var _0x5dc092={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x22af17){_0x11b5bd[_0xdfa6('0x8')]=_0x22af17;}return db[_0xdfa6('0x9')]['update'](_0x11b5bd,_0x5dc092);}function main(){var _0x5e744b=0x1388;var _0x437821;logger[_0xdfa6('0xa')](util['format'](_0xdfa6('0xb'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xdfa6('0xc')][_0xdfa6('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdfa6('0xe'),_0xdfa6('0xf')]})[_0xdfa6('0x10')](function(_0x2266d0){if(_0x2266d0){_0x437821=_0x2266d0;_0x5e744b=_0x437821[_0xdfa6('0xf')]||0x1388;}})[_0xdfa6('0x10')](function(){return dbH[_0xdfa6('0x11')][_0xdfa6('0x12')](util[_0xdfa6('0x13')](_0xdfa6('0x14'),QUERY),{'type':dbH['sequelize'][_0xdfa6('0x15')][_0xdfa6('0x16')]});})[_0xdfa6('0x10')](function(_0x469d5d){if(!_0x469d5d[0x0][_0xdfa6('0x17')]){return analyticExtractedReport(_0xdfa6('0x18'));}var _0x1ff2fb=[];var _0x41e492=0x0;if(_0x437821[_0xdfa6('0xe')]){if(_0x469d5d&&_0x469d5d[_0xdfa6('0x19')]){var _0x4f86e1=_[_0xdfa6('0x1a')](_0x469d5d[0x0][_0xdfa6('0x17')]/_0x5e744b);var _0x51b272=Number[_0xdfa6('0x1b')](_0x469d5d[0x0][_0xdfa6('0x17')]/_0x5e744b)?_0x469d5d[0x0]['num']%_0x5e744b:0x0;_0x4f86e1[_0xdfa6('0x1c')](function(_0x45b945){if(_0x45b945>0x0){_0x41e492+=_0x5e744b;}_0x1ff2fb[_0xdfa6('0x1d')](dbH['sequelize']['query'](util['format'](_0xdfa6('0x1e'),QUERY,_0x5e744b,_0x41e492),{'type':dbH[_0xdfa6('0x11')][_0xdfa6('0x15')][_0xdfa6('0x16')]}));});if(_0x51b272>0x0){_0x41e492+=_0x5e744b;_0x1ff2fb['push'](dbH[_0xdfa6('0x11')][_0xdfa6('0x12')](util[_0xdfa6('0x13')](_0xdfa6('0x1e'),QUERY,_0x51b272,_0x41e492),{'type':dbH[_0xdfa6('0x11')][_0xdfa6('0x15')]['SELECT']}));}}}else{_0x1ff2fb[_0xdfa6('0x1d')](dbH[_0xdfa6('0x11')][_0xdfa6('0x12')](QUERY,{'type':dbH[_0xdfa6('0x11')][_0xdfa6('0x15')]['SELECT']}));}var _0x1c4bfd=path['dirname'](PATH);var _0x468fce=path[_0xdfa6('0x1f')](PATH,_0xdfa6('0x20'));var _0x139c0a=_0x437821[_0xdfa6('0xe')]&&_0x1ff2fb[_0xdfa6('0x19')]>0x1;var _0x4073e6=[];if(!fs[_0xdfa6('0x21')](path['join'](_0x1c4bfd,_0x468fce))&&_0x139c0a){fs[_0xdfa6('0x22')](path[_0xdfa6('0x23')](_0x1c4bfd,_0x468fce));}return BPromise['each'](_0x1ff2fb,function(_0x36da89){_0x4073e6[_0xdfa6('0x1d')](_0x36da89);})[_0xdfa6('0x10')](function(){for(var _0x4508ca=0x0;_0x4508ca<_0x4073e6['length'];_0x4508ca+=0x1){var _0x3c90a8;var _0x3056db=_0x4073e6[_0x4508ca];if(_0x139c0a){_0x3c90a8=path['join'](_0x1c4bfd,_0x468fce,util['format'](_0xdfa6('0x24'),_0x468fce,_0x4508ca,_0xdfa6('0x25')));}else{_0x3c90a8=path[_0xdfa6('0x23')](_0x1c4bfd,util[_0xdfa6('0x13')](_0xdfa6('0x26'),_0x468fce,_0xdfa6('0x25')));}fs[_0xdfa6('0x27')](_0x3c90a8,json2xls(_0x3056db),_0xdfa6('0x28'));}})[_0xdfa6('0x10')](function(){if(_0x139c0a){return new Promise(function(_0x501011){zipdir(path[_0xdfa6('0x23')](_0x1c4bfd,_0x468fce),{'saveTo':path['join'](_0x1c4bfd,util['format']('%s.%s',_0x468fce,_0xdfa6('0x29')))},function(_0x54ead4,_0x230211){rimraf(path[_0xdfa6('0x23')](_0x1c4bfd,_0x468fce),function(){});_0x501011('zip\x20finished');});});}})[_0xdfa6('0x10')](function(){logger['info'](util['format'](_0xdfa6('0x2a'),EXTRACTED_REPORT_ID,_0xdfa6('0x2b')));return analyticExtractedReport('Completed',_0x139c0a?util['format'](_0xdfa6('0x26'),_0x468fce,_0x139c0a?_0xdfa6('0x29'):_0xdfa6('0x25')):null);});})[_0xdfa6('0x2c')](function(_0x4b1209){logger['info'](util[_0xdfa6('0x13')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xdfa6('0x2b')),util[_0xdfa6('0x2d')](_0x4b1209,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xdfa6('0x2e')](EXIT_CODE);});}main();
\ No newline at end of file
index 5b22f06..a44feaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefa7=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','destroy','bulkCreate','error','rewrite','lodash','util','models','Interval','findAll','IntervalId','then','uniq','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','VoiceExtensionId','type','inbound','context','outbound','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','intervals','tag','CDR(tag)=','length','callerID','ExecIf'];(function(_0x48a167,_0x2466db){var _0x5402ab=function(_0x2894){while(--_0x2894){_0x48a167['push'](_0x48a167['shift']());}};_0x5402ab(++_0x2466db);}(_0xefa7,0xa8));var _0x7efa=function(_0x4e9323,_0x443d8f){_0x4e9323=_0x4e9323-0x0;var _0x583f56=_0xefa7[_0x4e9323];return _0x583f56;};'use strict';var _=require(_0x7efa('0x0'));var util=require(_0x7efa('0x1'));function rewrite(_0x232bc1,_0x3166db){var _0x58cd2f=this;return _0x232bc1[_0x7efa('0x2')][_0x7efa('0x3')]['findAll']({'raw':!![]})['then'](function(_0xc08273){_0x58cd2f['intervals']=_0xc08273;return _0x232bc1['models']['VoiceExtension'][_0x7efa('0x4')]({'where':{'IntervalId':_0x3166db[_0x7efa('0x5')]},'raw':!![]});})[_0x7efa('0x6')](function(_0x985bbc){return _0x232bc1[_0x7efa('0x2')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x7efa('0x7')](_[_0x7efa('0x8')](_0x985bbc,_0x7efa('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x7efa('0x6')](function(_0x43c691){var _0x54bcd6=_[_0x7efa('0xa')](_0x43c691,{'priority':'1'});var _0x5fa364=_[_0x7efa('0xa')](_0x43c691,{'isApp':0x1});var _0xed9621=_[_0x7efa('0xb')](_0x5fa364,_0x7efa('0x9'));var _0xe670c1=[_0x7efa('0xc'),_0x7efa('0xd')];var _0x24cc26=[];var _0x3fe1d1=[];for(var _0x534357 in _0xed9621){if(_0xed9621[_0x7efa('0xe')](_0x534357)){_0x58cd2f[_0x7efa('0xf')]=0x2;_0x58cd2f[_0x7efa('0x10')]=[];_0x58cd2f[_0x7efa('0x11')]=_[_0x7efa('0x12')](_0x54bcd6,{'exten':_0xed9621[_0x534357][0x0]['exten']});_0x58cd2f['extensions'][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0]['type'],'app':_0x7efa('0x14'),'appdata':util[_0x7efa('0x15')](_0x7efa('0x16'),_0xed9621[_0x534357][0x0]['type']),'context':_0xed9621[_0x534357][0x0]['context'],'exten':_0xed9621[_0x534357][0x0]['exten'],'priority':_0x58cd2f['priority']++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});if(_0xed9621[_0x534357][0x0][_0x7efa('0x18')]===_0x7efa('0x19')){_0x58cd2f[_0x7efa('0x10')][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':'CDR(routeid)='+_0xed9621[_0x534357][0x0][_0x7efa('0x17')],'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x58cd2f['priority']++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});}else if(_0xed9621[_0x534357][0x0][_0x7efa('0x18')]===_0x7efa('0x1b')){if(_0x58cd2f[_0x7efa('0x11')]){_0x58cd2f['extensions'][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':'CDR(destination)='+(_0x58cd2f[_0x7efa('0x11')][_0x7efa('0x1c')]?_0x7efa('0x1d')+_0x58cd2f[_0x7efa('0x11')][_0x7efa('0x1c')]+'}':_0x7efa('0x1e')),'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x58cd2f[_0x7efa('0xf')]++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});}_0x58cd2f[_0x7efa('0x10')]['push']({'type':_0xed9621[_0x534357][0x0]['type'],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x1f')+_0xed9621[_0x534357][0x0][_0x7efa('0x17')],'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x58cd2f[_0x7efa('0xf')]++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});var _0x561018=_0x58cd2f['priority']++;_0x58cd2f[_0x7efa('0x10')]['push']({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':'ExecIf','appdata':_0x7efa('0x20')+(_0x561018+0x2)+'):Goto('+(_0x561018+0x1)+')','context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x561018,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});if(_0x58cd2f[_0x7efa('0x11')]){_0x58cd2f[_0x7efa('0x10')][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x58cd2f[_0x7efa('0x11')][_0x7efa('0x1c')]?_0x7efa('0x21')+_0x58cd2f[_0x7efa('0x11')][_0x7efa('0x1c')]+'}':_0x7efa('0x22'),'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0]['exten'],'priority':_0x58cd2f[_0x7efa('0xf')]++,'VoiceExtensionId':_0xed9621[_0x534357][0x0]['VoiceExtensionId']});}_0x58cd2f[_0x7efa('0x10')][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x23')+_0xed9621[_0x534357][0x0][_0x7efa('0x17')],'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0]['exten'],'priority':_0x58cd2f[_0x7efa('0xf')]++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});if(_0x58cd2f[_0x7efa('0x11')]&&_0x58cd2f[_0x7efa('0x11')]['hasOwnProperty']('recordingFormat')&&_0x58cd2f['extension'][_0x7efa('0x24')]!==_0x7efa('0x25')){_0x58cd2f[_0x7efa('0x10')][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x26'),'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x58cd2f[_0x7efa('0xf')]++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});_0x58cd2f[_0x7efa('0x10')][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x27')+_0x58cd2f[_0x7efa('0x11')][_0x7efa('0x24')]||_0x7efa('0x28'),'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x58cd2f[_0x7efa('0xf')]++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});}}_0x58cd2f['extensions'][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x29'),'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x58cd2f[_0x7efa('0xf')]++,'VoiceExtensionId':_0xed9621[_0x534357][0x0]['VoiceExtensionId']});_0x58cd2f[_0x7efa('0x10')][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x2a'),'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x58cd2f['priority']++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});_0x58cd2f['extensions'][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x2b'),'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'exten':_0xed9621[_0x534357][0x0][_0x7efa('0x9')],'priority':_0x58cd2f[_0x7efa('0xf')]++,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});for(var _0x409482=0x0,_0x3bad92=0x0;_0x409482<_0xed9621[_0x534357]['length'];_0x409482+=0x1,_0x3bad92=0x0){var _0x45634a=_0xed9621[_0x534357][_0x409482];if(_0x45634a[_0x7efa('0x18')]){_0x45634a[_0x7efa('0x18')]=_0x45634a['type'][_0x7efa('0x2c')]();}var _0x5485c6=[];var _0x182547=[];delete _0x45634a['id'];delete _0x45634a[_0x7efa('0x2d')];delete _0x45634a[_0x7efa('0x2e')];var _0x5a4145=_0x45634a[_0x7efa('0x2f')]!=='*,*,*,*'?[_0x45634a[_0x7efa('0x2f')]]:_0x45634a[_0x7efa('0x5')]?_['map'](_[_0x7efa('0xa')](_0x58cd2f[_0x7efa('0x30')],{'IntervalId':_0x45634a['IntervalId']}),'interval'):[];if(_0x45634a[_0x7efa('0xe')](_0x7efa('0x31'))){if(_0x45634a[_0x7efa('0x31')]&&_0x45634a['tag']!=='--'){_0x5485c6[_0x7efa('0x13')]({'type':_0x45634a[_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x32')+_0x45634a['tag'],'context':_0x45634a[_0x7efa('0x1a')],'exten':_0x45634a[_0x7efa('0x9')],'priority':_0x5a4145[_0x7efa('0x33')]+_0x58cd2f[_0x7efa('0xf')]+_0x3bad92++,'VoiceExtensionId':_0x45634a[_0x7efa('0x17')]});}}if(_0x45634a[_0x7efa('0x18')]===_0x7efa('0x1b')&&_0x45634a[_0x7efa('0xe')](_0x7efa('0x34'))){if(_0x45634a[_0x7efa('0x34')]){_0x5485c6['push']({'type':_0x45634a[_0x7efa('0x18')],'app':_0x7efa('0x35'),'appdata':_0x7efa('0x36')+_0x45634a[_0x7efa('0x34')]+')','context':_0x45634a[_0x7efa('0x1a')],'exten':_0x45634a[_0x7efa('0x9')],'priority':_0x5a4145[_0x7efa('0x33')]+_0x58cd2f[_0x7efa('0xf')]+_0x3bad92++,'VoiceExtensionId':_0x45634a[_0x7efa('0x17')]});}else{_0x5485c6['push']({'type':_0x45634a[_0x7efa('0x18')],'app':_0x7efa('0x35'),'appdata':_0x7efa('0x37'),'context':_0x45634a['context'],'exten':_0x45634a[_0x7efa('0x9')],'priority':_0x5a4145[_0x7efa('0x33')]+_0x58cd2f['priority']+_0x3bad92++,'VoiceExtensionId':_0x45634a['VoiceExtensionId']});}}if(_0x45634a['hasOwnProperty'](_0x7efa('0x38'))){if(_0xe670c1[_0x7efa('0x39')](_0x45634a[_0x7efa('0x3a')][_0x7efa('0x2c')]())>=0x0&&_0x45634a[_0x7efa('0x3b')]!=='custom'){if(_0x45634a[_0x7efa('0x38')]){_0x5485c6[_0x7efa('0x13')]({'type':_0x45634a[_0x7efa('0x18')],'app':_0x7efa('0x35'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x45634a[_0x7efa('0x1a')],'exten':_0x45634a[_0x7efa('0x9')],'priority':_0x5a4145[_0x7efa('0x33')]+_0x58cd2f[_0x7efa('0xf')]+_0x3bad92++,'VoiceExtensionId':_0x45634a[_0x7efa('0x17')]});_0x5485c6['push']({'type':_0x45634a[_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x3c'),'context':_0x45634a[_0x7efa('0x1a')],'exten':_0x45634a[_0x7efa('0x9')],'priority':_0x5a4145[_0x7efa('0x33')]+_0x58cd2f[_0x7efa('0xf')]+_0x3bad92++,'VoiceExtensionId':_0x45634a['VoiceExtensionId']});}else{_0x5485c6[_0x7efa('0x13')]({'type':_0x45634a[_0x7efa('0x18')],'app':_0x7efa('0x35'),'appdata':_0x7efa('0x3d'),'context':_0x45634a[_0x7efa('0x1a')],'exten':_0x45634a['exten'],'priority':_0x5a4145['length']+_0x58cd2f[_0x7efa('0xf')]+_0x3bad92++,'VoiceExtensionId':_0x45634a['VoiceExtensionId']});_0x5485c6[_0x7efa('0x13')]({'type':_0x45634a[_0x7efa('0x18')],'app':_0x7efa('0x14'),'appdata':_0x7efa('0x3e'),'context':_0x45634a[_0x7efa('0x1a')],'exten':_0x45634a[_0x7efa('0x9')],'priority':_0x5a4145[_0x7efa('0x33')]+_0x58cd2f[_0x7efa('0xf')]+_0x3bad92++,'VoiceExtensionId':_0x45634a['VoiceExtensionId']});}}}for(var _0x4211ce=0x0;_0x4211ce<_0x5a4145[_0x7efa('0x33')];_0x4211ce+=0x1){var _0x3619d0=_0x58cd2f[_0x7efa('0xf')]+_0x5a4145[_0x7efa('0x33')];var _0x1327f7=_0x4211ce===_0x5a4145[_0x7efa('0x33')]-0x1?_0x58cd2f['priority']+_0x5485c6['length']+_0x182547['length']+0x2:_0x58cd2f[_0x7efa('0xf')]+_0x4211ce+0x1;_0x5485c6['splice'](_0x4211ce,0x0,{'type':_0x45634a[_0x7efa('0x18')],'app':_0x7efa('0x3f'),'appdata':_0x5a4145[_0x4211ce]+'?'+_0x45634a[_0x7efa('0x1a')]+_0x7efa('0x40')+_0x3619d0+':'+_0x45634a[_0x7efa('0x1a')]+',${EXTEN},'+_0x1327f7,'exten':_0x45634a[_0x7efa('0x9')],'context':_0x45634a[_0x7efa('0x1a')],'priority':_0x58cd2f[_0x7efa('0xf')]+_0x4211ce,'VoiceExtensionId':_0xed9621[_0x534357][0x0][_0x7efa('0x17')]});}_0x45634a[_0x7efa('0xf')]=_0x5485c6[_0x7efa('0x33')]?_[_0x7efa('0x41')](_0x5485c6)[_0x7efa('0xf')]+0x1:_0x58cd2f[_0x7efa('0xf')];_0x58cd2f[_0x7efa('0xf')]=(_0x182547['length']?_['last'](_0x182547)[_0x7efa('0xf')]:_0x45634a[_0x7efa('0xf')])+0x1;_0x58cd2f[_0x7efa('0x10')]=_[_0x7efa('0x42')](_0x58cd2f[_0x7efa('0x10')],_0x5485c6,[_0x45634a],_0x182547);}_0x58cd2f[_0x7efa('0x10')][_0x7efa('0x13')]({'type':_0xed9621[_0x534357][0x0][_0x7efa('0x18')],'app':_0x7efa('0x43'),'exten':_0xed9621[_0x534357][0x0]['exten'],'context':_0xed9621[_0x534357][0x0][_0x7efa('0x1a')],'priority':_0x58cd2f[_0x7efa('0xf')],'VoiceExtensionId':_0xed9621[_0x534357][0x0]['VoiceExtensionId']});_0x24cc26['push'](_0xed9621[_0x534357][0x0][_0x7efa('0x17')]);_0x3fe1d1=_['concat'](_0x3fe1d1,_0x58cd2f['extensions']);}}return _0x232bc1[_0x7efa('0x44')](function(_0xe5a04d){return _0x232bc1[_0x7efa('0x2')][_0x7efa('0x45')][_0x7efa('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x24cc26}},'transaction':_0xe5a04d})[_0x7efa('0x6')](function(_0x4a1049){return _0x232bc1['models'][_0x7efa('0x45')][_0x7efa('0x47')](_['sortBy'](_0x3fe1d1,_0x7efa('0xf')),{'transaction':_0xe5a04d});});});})['catch'](function(_0x135d58){console[_0x7efa('0x48')](_0x135d58);});}exports[_0x7efa('0x49')]=rewrite;
\ No newline at end of file
+var _0xbd1c=['rewrite','lodash','util','models','findAll','then','intervals','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','context','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error'];(function(_0x57c494,_0x1964aa){var _0x25ffaa=function(_0x4d8eee){while(--_0x4d8eee){_0x57c494['push'](_0x57c494['shift']());}};_0x25ffaa(++_0x1964aa);}(_0xbd1c,0x8b));var _0xcbd1=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xbd1c[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xcbd1('0x0'));var util=require(_0xcbd1('0x1'));function rewrite(_0x2e57e8,_0x46343d){var _0x5dcd2f=this;return _0x2e57e8[_0xcbd1('0x2')]['Interval'][_0xcbd1('0x3')]({'raw':!![]})[_0xcbd1('0x4')](function(_0x4fcf24){_0x5dcd2f[_0xcbd1('0x5')]=_0x4fcf24;return _0x2e57e8[_0xcbd1('0x2')]['VoiceExtension'][_0xcbd1('0x3')]({'where':{'IntervalId':_0x46343d[_0xcbd1('0x6')]},'raw':!![]});})[_0xcbd1('0x4')](function(_0x3ce53c){return _0x2e57e8[_0xcbd1('0x2')]['VoiceExtension'][_0xcbd1('0x3')]({'where':{'exten':{'$in':_[_0xcbd1('0x7')](_[_0xcbd1('0x8')](_0x3ce53c,_0xcbd1('0x9')))}},'order':[{'raw':_0xcbd1('0xa')}],'raw':!![]});})['then'](function(_0x14f7f7){var _0x598d54=_[_0xcbd1('0xb')](_0x14f7f7,{'priority':'1'});var _0x3edfc3=_['filter'](_0x14f7f7,{'isApp':0x1});var _0x19d13c=_['groupBy'](_0x3edfc3,_0xcbd1('0x9'));var _0x1fbbb3=['queue','playback'];var _0x3ea51b=[];var _0x229a29=[];for(var _0x1b1a75 in _0x19d13c){if(_0x19d13c['hasOwnProperty'](_0x1b1a75)){_0x5dcd2f[_0xcbd1('0xc')]=0x2;_0x5dcd2f[_0xcbd1('0xd')]=[];_0x5dcd2f[_0xcbd1('0xe')]=_[_0xcbd1('0xf')](_0x598d54,{'exten':_0x19d13c[_0x1b1a75][0x0]['exten']});_0x5dcd2f[_0xcbd1('0xd')][_0xcbd1('0x10')]({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':_0xcbd1('0x12'),'appdata':util[_0xcbd1('0x13')](_0xcbd1('0x14'),_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')]),'context':_0x19d13c[_0x1b1a75][0x0]['context'],'exten':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x9')],'priority':_0x5dcd2f['priority']++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')]});if(_0x19d13c[_0x1b1a75][0x0]['type']===_0xcbd1('0x16')){_0x5dcd2f[_0xcbd1('0xd')]['push']({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':'Set','appdata':_0xcbd1('0x17')+_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')],'context':_0x19d13c[_0x1b1a75][0x0]['context'],'exten':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x9')],'priority':_0x5dcd2f['priority']++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0]['VoiceExtensionId']});}else if(_0x19d13c[_0x1b1a75][0x0]['type']===_0xcbd1('0x18')){if(_0x5dcd2f[_0xcbd1('0xe')]){_0x5dcd2f[_0xcbd1('0xd')][_0xcbd1('0x10')]({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':_0xcbd1('0x12'),'appdata':_0xcbd1('0x19')+(_0x5dcd2f[_0xcbd1('0xe')][_0xcbd1('0x1a')]?'${EXTEN:'+_0x5dcd2f['extension'][_0xcbd1('0x1a')]+'}':'${EXTEN}'),'context':_0x19d13c[_0x1b1a75][0x0]['context'],'exten':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x9')],'priority':_0x5dcd2f['priority']++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0]['VoiceExtensionId']});}_0x5dcd2f[_0xcbd1('0xd')]['push']({'type':_0x19d13c[_0x1b1a75][0x0]['type'],'app':_0xcbd1('0x12'),'appdata':_0xcbd1('0x17')+_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')],'context':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x1b')],'exten':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x9')],'priority':_0x5dcd2f['priority']++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0]['VoiceExtensionId']});var _0x16c46c=_0x5dcd2f[_0xcbd1('0xc')]++;_0x5dcd2f[_0xcbd1('0xd')]['push']({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':_0xcbd1('0x1c'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x16c46c+0x2)+_0xcbd1('0x1d')+(_0x16c46c+0x1)+')','context':_0x19d13c[_0x1b1a75][0x0]['context'],'exten':_0x19d13c[_0x1b1a75][0x0]['exten'],'priority':_0x16c46c,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')]});if(_0x5dcd2f[_0xcbd1('0xe')]){_0x5dcd2f[_0xcbd1('0xd')][_0xcbd1('0x10')]({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':'Set','appdata':_0x5dcd2f[_0xcbd1('0xe')][_0xcbd1('0x1a')]?_0xcbd1('0x1e')+_0x5dcd2f['extension'][_0xcbd1('0x1a')]+'}':_0xcbd1('0x1f'),'context':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x1b')],'exten':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x9')],'priority':_0x5dcd2f['priority']++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')]});}_0x5dcd2f['extensions']['push']({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':'Set','appdata':_0xcbd1('0x20')+_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')],'context':_0x19d13c[_0x1b1a75][0x0]['context'],'exten':_0x19d13c[_0x1b1a75][0x0]['exten'],'priority':_0x5dcd2f['priority']++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0]['VoiceExtensionId']});if(_0x5dcd2f['extension']&&_0x5dcd2f['extension'][_0xcbd1('0x21')](_0xcbd1('0x22'))&&_0x5dcd2f['extension'][_0xcbd1('0x22')]!==_0xcbd1('0x23')){_0x5dcd2f['extensions'][_0xcbd1('0x10')]({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':_0xcbd1('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x19d13c[_0x1b1a75][0x0]['context'],'exten':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x9')],'priority':_0x5dcd2f['priority']++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')]});_0x5dcd2f[_0xcbd1('0xd')][_0xcbd1('0x10')]({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':'Set','appdata':_0xcbd1('0x24')+_0x5dcd2f[_0xcbd1('0xe')]['recordingFormat']||_0xcbd1('0x25'),'context':_0x19d13c[_0x1b1a75][0x0]['context'],'exten':_0x19d13c[_0x1b1a75][0x0]['exten'],'priority':_0x5dcd2f[_0xcbd1('0xc')]++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0]['VoiceExtensionId']});}}_0x5dcd2f[_0xcbd1('0xd')][_0xcbd1('0x10')]({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':_0xcbd1('0x12'),'appdata':_0xcbd1('0x26'),'context':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x1b')],'exten':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x9')],'priority':_0x5dcd2f[_0xcbd1('0xc')]++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')]});_0x5dcd2f['extensions'][_0xcbd1('0x10')]({'type':_0x19d13c[_0x1b1a75][0x0]['type'],'app':_0xcbd1('0x12'),'appdata':_0xcbd1('0x27'),'context':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x1b')],'exten':_0x19d13c[_0x1b1a75][0x0]['exten'],'priority':_0x5dcd2f[_0xcbd1('0xc')]++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')]});_0x5dcd2f['extensions'][_0xcbd1('0x10')]({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':'Set','appdata':_0xcbd1('0x28'),'context':_0x19d13c[_0x1b1a75][0x0]['context'],'exten':_0x19d13c[_0x1b1a75][0x0]['exten'],'priority':_0x5dcd2f['priority']++,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x15')]});for(var _0x392f3d=0x0,_0x1fcef=0x0;_0x392f3d<_0x19d13c[_0x1b1a75][_0xcbd1('0x29')];_0x392f3d+=0x1,_0x1fcef=0x0){var _0x302d9d=_0x19d13c[_0x1b1a75][_0x392f3d];if(_0x302d9d[_0xcbd1('0x11')]){_0x302d9d[_0xcbd1('0x11')]=_0x302d9d[_0xcbd1('0x11')][_0xcbd1('0x2a')]();}var _0x790f1b=[];var _0x593b97=[];delete _0x302d9d['id'];delete _0x302d9d[_0xcbd1('0x2b')];delete _0x302d9d[_0xcbd1('0x2c')];var _0x45eab5=_0x302d9d[_0xcbd1('0x2d')]!==_0xcbd1('0x2e')?[_0x302d9d['interval']]:_0x302d9d[_0xcbd1('0x6')]?_[_0xcbd1('0x8')](_[_0xcbd1('0xb')](_0x5dcd2f[_0xcbd1('0x5')],{'IntervalId':_0x302d9d[_0xcbd1('0x6')]}),_0xcbd1('0x2d')):[];if(_0x302d9d[_0xcbd1('0x21')](_0xcbd1('0x2f'))){if(_0x302d9d[_0xcbd1('0x2f')]&&_0x302d9d[_0xcbd1('0x2f')]!=='--'){_0x790f1b[_0xcbd1('0x10')]({'type':_0x302d9d['type'],'app':_0xcbd1('0x12'),'appdata':_0xcbd1('0x30')+_0x302d9d['tag'],'context':_0x302d9d[_0xcbd1('0x1b')],'exten':_0x302d9d[_0xcbd1('0x9')],'priority':_0x45eab5[_0xcbd1('0x29')]+_0x5dcd2f[_0xcbd1('0xc')]+_0x1fcef++,'VoiceExtensionId':_0x302d9d[_0xcbd1('0x15')]});}}if(_0x302d9d[_0xcbd1('0x11')]==='outbound'&&_0x302d9d[_0xcbd1('0x21')](_0xcbd1('0x31'))){if(_0x302d9d[_0xcbd1('0x31')]){_0x790f1b[_0xcbd1('0x10')]({'type':_0x302d9d[_0xcbd1('0x11')],'app':_0xcbd1('0x1c'),'appdata':_0xcbd1('0x32')+_0x302d9d[_0xcbd1('0x31')]+')','context':_0x302d9d[_0xcbd1('0x1b')],'exten':_0x302d9d[_0xcbd1('0x9')],'priority':_0x45eab5['length']+_0x5dcd2f[_0xcbd1('0xc')]+_0x1fcef++,'VoiceExtensionId':_0x302d9d[_0xcbd1('0x15')]});}else{_0x790f1b[_0xcbd1('0x10')]({'type':_0x302d9d[_0xcbd1('0x11')],'app':_0xcbd1('0x1c'),'appdata':_0xcbd1('0x33'),'context':_0x302d9d[_0xcbd1('0x1b')],'exten':_0x302d9d[_0xcbd1('0x9')],'priority':_0x45eab5[_0xcbd1('0x29')]+_0x5dcd2f['priority']+_0x1fcef++,'VoiceExtensionId':_0x302d9d[_0xcbd1('0x15')]});}}if(_0x302d9d['hasOwnProperty'](_0xcbd1('0x34'))){if(_0x1fbbb3['indexOf'](_0x302d9d[_0xcbd1('0x35')][_0xcbd1('0x2a')]())>=0x0&&_0x302d9d[_0xcbd1('0x36')]!=='custom'){if(_0x302d9d[_0xcbd1('0x34')]){_0x790f1b[_0xcbd1('0x10')]({'type':_0x302d9d[_0xcbd1('0x11')],'app':_0xcbd1('0x1c'),'appdata':_0xcbd1('0x37'),'context':_0x302d9d['context'],'exten':_0x302d9d[_0xcbd1('0x9')],'priority':_0x45eab5[_0xcbd1('0x29')]+_0x5dcd2f['priority']+_0x1fcef++,'VoiceExtensionId':_0x302d9d[_0xcbd1('0x15')]});_0x790f1b[_0xcbd1('0x10')]({'type':_0x302d9d[_0xcbd1('0x11')],'app':_0xcbd1('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x302d9d[_0xcbd1('0x1b')],'exten':_0x302d9d['exten'],'priority':_0x45eab5[_0xcbd1('0x29')]+_0x5dcd2f[_0xcbd1('0xc')]+_0x1fcef++,'VoiceExtensionId':_0x302d9d[_0xcbd1('0x15')]});}else{_0x790f1b[_0xcbd1('0x10')]({'type':_0x302d9d[_0xcbd1('0x11')],'app':_0xcbd1('0x1c'),'appdata':_0xcbd1('0x38'),'context':_0x302d9d['context'],'exten':_0x302d9d['exten'],'priority':_0x45eab5[_0xcbd1('0x29')]+_0x5dcd2f[_0xcbd1('0xc')]+_0x1fcef++,'VoiceExtensionId':_0x302d9d['VoiceExtensionId']});_0x790f1b[_0xcbd1('0x10')]({'type':_0x302d9d[_0xcbd1('0x11')],'app':_0xcbd1('0x12'),'appdata':_0xcbd1('0x39'),'context':_0x302d9d['context'],'exten':_0x302d9d[_0xcbd1('0x9')],'priority':_0x45eab5['length']+_0x5dcd2f[_0xcbd1('0xc')]+_0x1fcef++,'VoiceExtensionId':_0x302d9d[_0xcbd1('0x15')]});}}}for(var _0x1ec653=0x0;_0x1ec653<_0x45eab5[_0xcbd1('0x29')];_0x1ec653+=0x1){var _0x1c7606=_0x5dcd2f[_0xcbd1('0xc')]+_0x45eab5['length'];var _0x5586f0=_0x1ec653===_0x45eab5[_0xcbd1('0x29')]-0x1?_0x5dcd2f[_0xcbd1('0xc')]+_0x790f1b[_0xcbd1('0x29')]+_0x593b97[_0xcbd1('0x29')]+0x2:_0x5dcd2f[_0xcbd1('0xc')]+_0x1ec653+0x1;_0x790f1b['splice'](_0x1ec653,0x0,{'type':_0x302d9d[_0xcbd1('0x11')],'app':'GotoIfTime','appdata':_0x45eab5[_0x1ec653]+'?'+_0x302d9d[_0xcbd1('0x1b')]+_0xcbd1('0x3a')+_0x1c7606+':'+_0x302d9d['context']+_0xcbd1('0x3a')+_0x5586f0,'exten':_0x302d9d[_0xcbd1('0x9')],'context':_0x302d9d['context'],'priority':_0x5dcd2f[_0xcbd1('0xc')]+_0x1ec653,'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0]['VoiceExtensionId']});}_0x302d9d[_0xcbd1('0xc')]=_0x790f1b['length']?_['last'](_0x790f1b)['priority']+0x1:_0x5dcd2f[_0xcbd1('0xc')];_0x5dcd2f[_0xcbd1('0xc')]=(_0x593b97[_0xcbd1('0x29')]?_[_0xcbd1('0x3b')](_0x593b97)[_0xcbd1('0xc')]:_0x302d9d[_0xcbd1('0xc')])+0x1;_0x5dcd2f[_0xcbd1('0xd')]=_[_0xcbd1('0x3c')](_0x5dcd2f[_0xcbd1('0xd')],_0x790f1b,[_0x302d9d],_0x593b97);}_0x5dcd2f['extensions']['push']({'type':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x11')],'app':_0xcbd1('0x3d'),'exten':_0x19d13c[_0x1b1a75][0x0][_0xcbd1('0x9')],'context':_0x19d13c[_0x1b1a75][0x0]['context'],'priority':_0x5dcd2f['priority'],'VoiceExtensionId':_0x19d13c[_0x1b1a75][0x0]['VoiceExtensionId']});_0x3ea51b['push'](_0x19d13c[_0x1b1a75][0x0]['VoiceExtensionId']);_0x229a29=_[_0xcbd1('0x3c')](_0x229a29,_0x5dcd2f[_0xcbd1('0xd')]);}}return _0x2e57e8[_0xcbd1('0x3e')](function(_0x577827){return _0x2e57e8[_0xcbd1('0x2')]['VoiceExtension'][_0xcbd1('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x3ea51b}},'transaction':_0x577827})[_0xcbd1('0x4')](function(_0x14f69f){return _0x2e57e8[_0xcbd1('0x2')]['VoiceExtension'][_0xcbd1('0x40')](_[_0xcbd1('0x41')](_0x229a29,_0xcbd1('0xc')),{'transaction':_0x577827});});});})[_0xcbd1('0x42')](function(_0x4c5f3b){console[_0xcbd1('0x43')](_0x4c5f3b);});}exports[_0xcbd1('0x44')]=rewrite;
\ No newline at end of file
index 445414b..2fe8da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x623a=['createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','squel','ioredis','../../../mysqldb','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','Duplicate\x20Contact','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','VoiceQueue','findAll','outbound','dialCheckDuplicateType','then','get','always','sequelize','query','onlyIfOpen','all','BlackLists','Lists','CampaignId','Campaign','CmList','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','emit','contact:csv_','resolve','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!'];(function(_0x1c767f,_0x41e5e1){var _0x3ca962=function(_0x2f18d8){while(--_0x2f18d8){_0x1c767f['push'](_0x1c767f['shift']());}};_0x3ca962(++_0x41e5e1);}(_0x623a,0x75));var _0xa623=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x623a[_0x1e7b16];return _0x37fadc;};'use strict';var BPromise=require('bluebird');var util=require(_0xa623('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0xa623('0x1'));var Papa=require('papaparse');var Redis=require(_0xa623('0x2'));var db=require(_0xa623('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0xa623('0x4'))(_0xa623('0x5'));config[_0xa623('0x6')]=_['defaults'](config[_0xa623('0x6')],{'host':_0xa623('0x7'),'port':0x18eb});var socket=require(_0xa623('0x8'))(new Redis(config[_0xa623('0x6')]));require(_0xa623('0x9'))[_0xa623('0xa')](socket);try{if(!process[_0xa623('0xb')][0x2]||process[_0xa623('0xb')][0x2]===_0xa623('0xc')||process[_0xa623('0xb')][0x2]===_0xa623('0xd')){throw new Error(_0xa623('0xe'));}var FILEPATH=process[_0xa623('0xb')][0x2];if(!process['argv'][0x3]||process[_0xa623('0xb')][0x3]==='undefined'||process[_0xa623('0xb')][0x3]==='null'||!process[_0xa623('0xb')][0x4]||process[_0xa623('0xb')][0x4]==='undefined'||process['argv'][0x4]===_0xa623('0xd')){throw new Error(_0xa623('0xf'));}var FIELDS=_[_0xa623('0x10')](process['argv'][0x3][_0xa623('0x11')](','),process['argv'][0x4][_0xa623('0x11')](','));if(!process[_0xa623('0xb')][0x5]||process['argv'][0x5]===_0xa623('0xc')||process[_0xa623('0xb')][0x5]===_0xa623('0xd')){throw new Error(_0xa623('0x12'));}var LISTID=process[_0xa623('0xb')][0x5];var COMPANYID=process[_0xa623('0xb')][0x6]&&process['argv'][0x6]!=='undefined'&&process['argv'][0x6]!==_0xa623('0xd')?process[_0xa623('0xb')][0x6]:null;var DUPLICATES=process[_0xa623('0xb')][0x7]&&process['argv'][0x7]!==_0xa623('0xc')&&process[_0xa623('0xb')][0x7]!==_0xa623('0xd')?process[_0xa623('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0xa623('0xb')][0x8]===_0xa623('0xc')||process[_0xa623('0xb')][0x8]===_0xa623('0xd')){throw new Error(_0xa623('0x13'));}var SOCKET_TIMESTAMP=process[_0xa623('0xb')][0x8];}catch(_0x454b7c){logger[_0xa623('0x14')](_0x454b7c);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x3c6fc4,_0x21d5f5,_0x3a337f,_0x2d310e){var _0x97670f={'message':_0x21d5f5};_0x97670f[_0x3c6fc4]=!![];if(_0x3a337f){_0x97670f[_0xa623('0x15')]=_0x3a337f;}if(_0x2d310e){_0x97670f[_0xa623('0x16')]=_0x2d310e;}return _0x97670f;}function isEmail(_0x5eeeb4){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xa623('0x17')](_0x5eeeb4);}function checkRow(_0x4e10da,_0x40d397,_0x2024d0){return new BPromise(function(_0x43e886,_0x3ec958){if(_[_0xa623('0x18')](_0x4e10da)){return _0x3ec958(handleCheckRowError('error',_0xa623('0x19'),null,_0x2024d0));}if(_0x4e10da[_0xa623('0x1a')]&&_0x4e10da[_0xa623('0x1a')][_0xa623('0x1b')]){var _0xc8e446=_[_0xa623('0x1c')](_0x4e10da[_0xa623('0x1a')],_0xa623('0x1d'))['join'](';');return _0x3ec958(handleCheckRowError(_0xa623('0x14'),_0xc8e446,null,_0x2024d0));}var _0x4a952e={};for(var _0x20fe92 in FIELDS){if(FIELDS[_0xa623('0x1e')](_0x20fe92)&&FIELDS[_0x20fe92]){_0x4a952e[_0x20fe92]=_0x4e10da[_0xa623('0x1f')][0x0][FIELDS[_0x20fe92]]||_0x4e10da[_0xa623('0x1f')][0x0]['\ufeff'+FIELDS[_0x20fe92]];}}if(!_0x4a952e[_0xa623('0x20')]){return _0x3ec958(handleCheckRowError(_0xa623('0x14'),'firstName\x20not\x20specified!',null,_0x2024d0));}if(!_0x4a952e[_0xa623('0x21')]){return _0x3ec958(handleCheckRowError(_0xa623('0x14'),_0xa623('0x22'),null,_0x2024d0));}if(_0x4a952e['birthDate']){var _0x46b453=moment(_0x4a952e['birthDate'],_0xa623('0x23'));if(!_0x46b453[_0xa623('0x24')]()){return _0x3ec958(handleCheckRowError(_0xa623('0x14'),_0xa623('0x25'),null,_0x2024d0));}}if(_0x4a952e[_0xa623('0x26')]){if(!isEmail(_0x4a952e[_0xa623('0x26')])){return _0x3ec958(handleCheckRowError(_0xa623('0x14'),_0xa623('0x27'),null,_0x2024d0));}}_0x4a952e[_0xa623('0x28')]=LISTID;_0x4a952e['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xa623('0x1b')]&&_0x40d397){var _0x3b0454={};for(var _0x111515=0x0,_0x72b783=DUPLICATES[_0xa623('0x1b')];_0x111515<_0x72b783;_0x111515+=0x1){_0x3b0454[DUPLICATES[_0x111515]]=_0x4a952e[DUPLICATES[_0x111515]];}var _0x579392=_['find'](_0x40d397,_0x3b0454);if(_0x579392){return _0x3ec958(handleCheckRowError('duplicate',_0xa623('0x29'),_0x579392,_0x2024d0));}}return db[_0xa623('0x2a')][_0xa623('0x2b')](_0x4a952e,{'raw':!![],'hooks':![],'fields':_[_0xa623('0x2c')](_0x4a952e)})['then'](function(_0x5c09f1){if(DUPLICATES&&DUPLICATES['length']&&_0x40d397){_0x40d397[_0xa623('0x2d')](_[_0xa623('0x2e')](_0x4a952e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5c09f1['id'];return _0x43e886();})[_0xa623('0x2f')](function(_0x1c9cb3){return _0x3ec958(handleCheckRowError(_0xa623('0x14'),_0xa623('0x30')+(_0x1c9cb3[_0xa623('0x1d')]||JSON['stringify'](_0x1c9cb3)),null,_0x2024d0));});});}function checkHopper(){function _0x244c7e(){return function(_0x3344c0){logger[_0xa623('0x14')](_0xa623('0x31'),_0xa623('0x32'),util['inspect'](_0x3344c0,{'showHidden':![],'depth':null}));};}var _0x62acc4=function(_0x1481e0,_0x59cc7c){var _0x3869e8=squel[_0xa623('0x33')]()[_0xa623('0x34')](_0xa623('0x35'))[_0xa623('0x36')](['phone',_0xa623('0x37'),_0xa623('0x38'),_0xa623('0x28'),_0x59cc7c,_0xa623('0x39'),_0xa623('0x3a')],squel['select']()[_0xa623('0x3b')](_0xa623('0x21'),_0xa623('0x21'))['field'](_0xa623('0x3c'),_0xa623('0x37'))[_0xa623('0x3b')]('id','ContactId')[_0xa623('0x3b')](LISTID[_0xa623('0x3d')](),_0xa623('0x28'))[_0xa623('0x3b')](_0x1481e0['id'][_0xa623('0x3d')](),_0x59cc7c)['field'](_0xa623('0x3c'),_0xa623('0x39'))['field'](_0xa623('0x3c'),_0xa623('0x3a'))[_0xa623('0x3e')](_0xa623('0x3f'))[_0xa623('0x40')](_0xa623('0x41'))['where'](_0xa623('0x42'),LISTID['toString']())[_0xa623('0x40')](_0xa623('0x43'))['where'](_0xa623('0x44'),squel[_0xa623('0x45')]()[_0xa623('0x3b')](_0xa623('0x21'))[_0xa623('0x3e')]('cm_hopper')[_0xa623('0x40')](_0x59cc7c+_0xa623('0x46'),_0x1481e0['id'][_0xa623('0x3d')]())))[_0xa623('0x3d')]();return _0x3869e8;};var _0x3beac0=function(_0x47c64f,_0x11b84d){var _0x15d4f1=squel[_0xa623('0x33')]()[_0xa623('0x34')](_0xa623('0x35'))[_0xa623('0x36')]([_0xa623('0x21'),'scheduledAt',_0xa623('0x38'),_0xa623('0x28'),_0x11b84d,'createdAt',_0xa623('0x3a')],squel[_0xa623('0x45')]()[_0xa623('0x3b')](_0xa623('0x21'),_0xa623('0x21'))[_0xa623('0x3b')]('NOW()','scheduledAt')[_0xa623('0x3b')]('id',_0xa623('0x38'))[_0xa623('0x3b')](LISTID[_0xa623('0x3d')](),_0xa623('0x28'))['field'](_0x47c64f['id']['toString'](),_0x11b84d)[_0xa623('0x3b')]('NOW()','createdAt')[_0xa623('0x3b')](_0xa623('0x3c'),_0xa623('0x3a'))[_0xa623('0x3e')](_0xa623('0x3f'))[_0xa623('0x40')](_0xa623('0x41'))[_0xa623('0x40')](_0xa623('0x42'),LISTID['toString']())[_0xa623('0x40')](_0xa623('0x47'),squel[_0xa623('0x48')](hopperContacts))[_0xa623('0x40')](_0xa623('0x43'))[_0xa623('0x40')](_0xa623('0x44'),squel[_0xa623('0x45')]()[_0xa623('0x3b')]('calleridnum')['from'](_0xa623('0x49'))[_0xa623('0x40')](_0x11b84d+_0xa623('0x46'),_0x47c64f['id'][_0xa623('0x3d')]()))['where'](_0xa623('0x44'),squel[_0xa623('0x45')]()[_0xa623('0x3b')](_0xa623('0x21'))[_0xa623('0x3e')](_0xa623('0x35'))['where'](_0x11b84d+_0xa623('0x46'),_0x47c64f['id']['toString']())))['toString']();return _0x15d4f1;};function _0x6f020f(_0x1d9060,_0x5326c5){var _0x4a67d8=squel[_0xa623('0x33')]()[_0xa623('0x34')](_0xa623('0x35'))[_0xa623('0x36')]([_0xa623('0x21'),'scheduledAt',_0xa623('0x38'),_0xa623('0x28'),_0x5326c5,_0xa623('0x39'),_0xa623('0x3a')],squel['select']()[_0xa623('0x3b')](_0xa623('0x21'),_0xa623('0x21'))[_0xa623('0x3b')](_0xa623('0x3c'),_0xa623('0x37'))[_0xa623('0x3b')]('id',_0xa623('0x38'))['field'](LISTID['toString'](),'ListId')[_0xa623('0x3b')](_0x1d9060['id'][_0xa623('0x3d')](),_0x5326c5)['field'](_0xa623('0x3c'),_0xa623('0x39'))[_0xa623('0x3b')]('NOW()',_0xa623('0x3a'))[_0xa623('0x3e')](_0xa623('0x3f'))['where'](_0xa623('0x41'))['where'](_0xa623('0x42'),LISTID[_0xa623('0x3d')]())['where']('id\x20IN\x20?',squel[_0xa623('0x48')](hopperContacts))['where'](_0xa623('0x43')))[_0xa623('0x3d')]();return _0x4a67d8;}function _0x51ce11(_0x3a5f52,_0x2eecf8){var _0x5fbe56=squel[_0xa623('0x33')]()[_0xa623('0x34')]('cm_hopper_black')[_0xa623('0x36')](['phone',_0xa623('0x38'),_0xa623('0x28'),_0x2eecf8,'createdAt',_0xa623('0x3a')],squel[_0xa623('0x45')]()[_0xa623('0x3b')]('phone',_0xa623('0x21'))['field']('id',_0xa623('0x38'))[_0xa623('0x3b')](LISTID[_0xa623('0x3d')](),_0xa623('0x28'))[_0xa623('0x3b')](_0x3a5f52['id'][_0xa623('0x3d')](),_0x2eecf8)[_0xa623('0x3b')](_0xa623('0x3c'),_0xa623('0x39'))['field'](_0xa623('0x3c'),_0xa623('0x3a'))[_0xa623('0x3e')](_0xa623('0x3f'))[_0xa623('0x40')](_0xa623('0x41'))[_0xa623('0x40')](_0xa623('0x42'),LISTID[_0xa623('0x3d')]())[_0xa623('0x40')](_0xa623('0x47'),squel['str'](hopperContacts))[_0xa623('0x40')](_0xa623('0x43')))['toString']();return _0x5fbe56;}return db[_0xa623('0x4a')][_0xa623('0x4b')]({'where':{'type':_0xa623('0x4c')},'attributes':['id',_0xa623('0x4d')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xa623('0x4e')](function(_0x38d93b){var _0x1d48ed=[];if(_0x38d93b){var _0x303fe4;for(var _0x452095=0x0,_0x552d46;_0x452095<_0x38d93b[_0xa623('0x1b')];_0x452095+=0x1){_0x552d46=_0x38d93b[_0x452095][_0xa623('0x4f')]({'plain':!![]});switch(_0x552d46[_0xa623('0x4d')]){case _0xa623('0x50'):_0x1d48ed[_0xa623('0x2d')](db[_0xa623('0x51')][_0xa623('0x52')](_0x3beac0(_0x552d46,'VoiceQueueId'))[_0xa623('0x4e')](function(){})[_0xa623('0x2f')](_0x244c7e()));break;case _0xa623('0x53'):_0x1d48ed[_0xa623('0x2d')](db['sequelize']['query'](_0x62acc4(_0x552d46,'VoiceQueueId'))['then'](function(){})[_0xa623('0x2f')](_0x244c7e()));break;default:_0x1d48ed[_0xa623('0x2d')](db[_0xa623('0x51')][_0xa623('0x52')](_0x6f020f(_0x552d46,'VoiceQueueId'))['then'](function(){})[_0xa623('0x2f')](_0x244c7e()));}}}return _0x1d48ed;})[_0xa623('0x54')]()[_0xa623('0x4e')](function(){return db[_0xa623('0x4a')][_0xa623('0x4b')]({'where':{'type':_0xa623('0x4c')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xa623('0x55'),'where':{'id':LISTID}}]})[_0xa623('0x4e')](function(_0x1dda17){var _0x47d323=[];if(_0x1dda17){var _0x5b6cd0;for(var _0x2eb96e=0x0,_0x164578;_0x2eb96e<_0x1dda17[_0xa623('0x1b')];_0x2eb96e+=0x1){_0x164578=_0x1dda17[_0x2eb96e][_0xa623('0x4f')]({'plain':!![]});_0x47d323[_0xa623('0x2d')](db['sequelize'][_0xa623('0x52')](_0x51ce11(_0x164578,'VoiceQueueId'))[_0xa623('0x4e')](function(){})[_0xa623('0x2f')](_0x244c7e()));}}return _0x47d323;})[_0xa623('0x54')]();})[_0xa623('0x4e')](function(){return db['Campaign'][_0xa623('0x4b')]({'attributes':['id',_0xa623('0x4d')],'include':[{'model':db['CmList'],'as':_0xa623('0x56'),'where':{'id':LISTID}}]})[_0xa623('0x4e')](function(_0x5b129c){var _0x3d5fc2=[];if(_0x5b129c){for(var _0x397d4c=0x0,_0xc58f7f;_0x397d4c<_0x5b129c[_0xa623('0x1b')];_0x397d4c+=0x1){_0xc58f7f=_0x5b129c[_0x397d4c][_0xa623('0x4f')]({'plain':!![]});switch(_0xc58f7f[_0xa623('0x4d')]){case _0xa623('0x50'):_0x3d5fc2[_0xa623('0x2d')](db['sequelize'][_0xa623('0x52')](_0x3beac0(_0xc58f7f,_0xa623('0x57')))[_0xa623('0x4e')](function(){})[_0xa623('0x2f')](_0x244c7e()));break;case'onlyIfOpen':_0x3d5fc2[_0xa623('0x2d')](db[_0xa623('0x51')][_0xa623('0x52')](_0x62acc4(_0xc58f7f,_0xa623('0x57')))[_0xa623('0x4e')](function(){})['catch'](_0x244c7e()));break;default:_0x3d5fc2[_0xa623('0x2d')](db['sequelize'][_0xa623('0x52')](_0x6f020f(_0xc58f7f,_0xa623('0x57')))['then'](function(){})[_0xa623('0x2f')](_0x244c7e()));}}}return _0x3d5fc2;})['all']();})[_0xa623('0x4e')](function(){return db[_0xa623('0x58')][_0xa623('0x4b')]({'attributes':['id'],'include':[{'model':db[_0xa623('0x59')],'as':_0xa623('0x55'),'where':{'id':LISTID}}]})[_0xa623('0x4e')](function(_0x199cd1){var _0x3a776d=[];if(_0x199cd1){for(var _0x401834=0x0,_0x390513;_0x401834<_0x199cd1['length'];_0x401834+=0x1){_0x390513=_0x199cd1[_0x401834][_0xa623('0x4f')]({'plain':!![]});_0x3a776d[_0xa623('0x2d')](db[_0xa623('0x51')][_0xa623('0x52')](_0x51ce11(_0x390513,_0xa623('0x57')))[_0xa623('0x4e')](function(){})[_0xa623('0x2f')](_0x244c7e()));}}return _0x3a776d;})[_0xa623('0x54')]();})[_0xa623('0x2f')](function(_0x4b1b64){logger['error'](_0xa623('0x5a'),_0xa623('0x5b'),_0x4b1b64[_0xa623('0x1d')]);});}var processPromises=function(_0x2bb64e){return BPromise[_0xa623('0x54')](promises)[_0xa623('0x4e')](function(_0x161f5c){})[_0xa623('0x2f')](function(_0x5d60cb){logger[_0xa623('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0xa623('0x5c')](_0x5d60cb));})[_0xa623('0x5d')](function(){socket[_0xa623('0x5e')](_0xa623('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2bb64e){return _0x2bb64e['resume']();}});};var endCsv=function(){return BPromise[_0xa623('0x60')]()[_0xa623('0x4e')](function(){if(hopperContacts){return checkHopper();}})[_0xa623('0x4e')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa623('0x61')](FILEPATH);}catch(_0x5be68e){logger[_0xa623('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xa623('0x5c')](_0x5be68e));}finally{process[_0xa623('0x62')](0x0);}});};process['on'](_0xa623('0x63'),function(){logger['info'](_0xa623('0x64'));endCsv();});function main(){return BPromise[_0xa623('0x60')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa623('0x11')](',');return db[_0xa623('0x2a')][_0xa623('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x40625a){var _0x52fe42=fs[_0xa623('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa623('0x66')](_0x52fe42,{'header':!![],'skipEmptyLines':!![],'step':function(_0x437378,_0x16842d){total+=0x1;var _0x51428e=total;promises[_0xa623('0x2d')](checkRow(_0x437378,_0x40625a,_0x51428e)[_0xa623('0x4e')](function(){success+=0x1;})[_0xa623('0x2f')](function(_0x44a858){if(_0x44a858[_0xa623('0x14')]){errors+=0x1;delete _0x44a858[_0xa623('0x14')];}else if(_0x44a858[_0xa623('0x67')]){duplicates+=0x1;delete _0x44a858[_0xa623('0x67')];}rows[_0xa623('0x2d')](_0x44a858);}));if(total%0xc8===0x0){_0x16842d[_0xa623('0x68')]();return processPromises(_0x16842d);}},'complete':function(){return processPromises()[_0xa623('0x4e')](function(){logger[_0xa623('0x69')](_0xa623('0x6a'));endCsv();});},'error':function(_0x11fde9,_0x473dad){logger['info'](_0xa623('0x6b'),JSON[_0xa623('0x5c')](_0x11fde9));endCsv();}});})['catch'](function(_0x276b5f){logger[_0xa623('0x14')](_0xa623('0x6c'),JSON[_0xa623('0x5c')](_0x276b5f));});}main();
\ No newline at end of file
+var _0x083c=['updatedAt','select','field','NOW()','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','ContactId','id\x20IN\x20?','calleridnum','cm_hopper_final','str','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','outbound','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','all','stringify','contact:csv_','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','createdAt'];(function(_0x116d46,_0x43f703){var _0x14c653=function(_0x21bfd9){while(--_0x21bfd9){_0x116d46['push'](_0x116d46['shift']());}};_0x14c653(++_0x43f703);}(_0x083c,0x1dc));var _0xc083=function(_0xd79494,_0x1fcda7){_0xd79494=_0xd79494-0x0;var _0x1c1698=_0x083c[_0xd79494];return _0x1c1698;};'use strict';var BPromise=require(_0xc083('0x0'));var util=require(_0xc083('0x1'));var _=require(_0xc083('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xc083('0x3'));var Redis=require('ioredis');var db=require(_0xc083('0x4'))['db'];var config=require(_0xc083('0x5'));var logger=require(_0xc083('0x6'))('api');config[_0xc083('0x7')]=_[_0xc083('0x8')](config['redis'],{'host':_0xc083('0x9'),'port':0x18eb});var socket=require(_0xc083('0xa'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0xc083('0xb')](socket);try{if(!process[_0xc083('0xc')][0x2]||process[_0xc083('0xc')][0x2]===_0xc083('0xd')||process[_0xc083('0xc')][0x2]===_0xc083('0xe')){throw new Error(_0xc083('0xf'));}var FILEPATH=process[_0xc083('0xc')][0x2];if(!process[_0xc083('0xc')][0x3]||process[_0xc083('0xc')][0x3]===_0xc083('0xd')||process[_0xc083('0xc')][0x3]===_0xc083('0xe')||!process[_0xc083('0xc')][0x4]||process[_0xc083('0xc')][0x4]===_0xc083('0xd')||process['argv'][0x4]===_0xc083('0xe')){throw new Error(_0xc083('0x10'));}var FIELDS=_['zipObject'](process[_0xc083('0xc')][0x3][_0xc083('0x11')](','),process['argv'][0x4]['split'](','));if(!process[_0xc083('0xc')][0x5]||process[_0xc083('0xc')][0x5]===_0xc083('0xd')||process[_0xc083('0xc')][0x5]===_0xc083('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xc083('0xc')][0x6]&&process['argv'][0x6]!==_0xc083('0xd')&&process[_0xc083('0xc')][0x6]!==_0xc083('0xe')?process[_0xc083('0xc')][0x6]:null;var DUPLICATES=process[_0xc083('0xc')][0x7]&&process[_0xc083('0xc')][0x7]!==_0xc083('0xd')&&process['argv'][0x7]!==_0xc083('0xe')?process['argv'][0x7]:null;if(!process[_0xc083('0xc')][0x8]||process['argv'][0x8]===_0xc083('0xd')||process['argv'][0x8]===_0xc083('0xe')){throw new Error(_0xc083('0x12'));}var SOCKET_TIMESTAMP=process[_0xc083('0xc')][0x8];}catch(_0x39e52e){logger[_0xc083('0x13')](_0x39e52e);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x562c75,_0x3f47cc,_0xccb60e,_0x26778e){var _0x2dc0aa={'message':_0x3f47cc};_0x2dc0aa[_0x562c75]=!![];if(_0xccb60e){_0x2dc0aa['contact']=_0xccb60e;}if(_0x26778e){_0x2dc0aa[_0xc083('0x14')]=_0x26778e;}return _0x2dc0aa;}function isEmail(_0x3af64d){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3af64d);}function checkRow(_0x469691,_0x2fa42a,_0x4c645b){return new BPromise(function(_0x427dd8,_0x2476fc){if(_[_0xc083('0x15')](_0x469691)){return _0x2476fc(handleCheckRowError(_0xc083('0x13'),_0xc083('0x16'),null,_0x4c645b));}if(_0x469691['errors']&&_0x469691[_0xc083('0x17')][_0xc083('0x18')]){var _0x2d97f3=_['map'](_0x469691['errors'],_0xc083('0x19'))[_0xc083('0x1a')](';');return _0x2476fc(handleCheckRowError(_0xc083('0x13'),_0x2d97f3,null,_0x4c645b));}var _0x2a4bde={};for(var _0x2aa6d4 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2aa6d4)&&FIELDS[_0x2aa6d4]){_0x2a4bde[_0x2aa6d4]=_0x469691[_0xc083('0x1b')][0x0][FIELDS[_0x2aa6d4]]||_0x469691[_0xc083('0x1b')][0x0]['\ufeff'+FIELDS[_0x2aa6d4]];}}if(!_0x2a4bde[_0xc083('0x1c')]){return _0x2476fc(handleCheckRowError(_0xc083('0x13'),_0xc083('0x1d'),null,_0x4c645b));}if(!_0x2a4bde[_0xc083('0x1e')]){return _0x2476fc(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x4c645b));}if(_0x2a4bde['birthDate']){var _0x561e9c=moment(_0x2a4bde[_0xc083('0x1f')],_0xc083('0x20'));if(!_0x561e9c[_0xc083('0x21')]()){return _0x2476fc(handleCheckRowError(_0xc083('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4c645b));}}if(_0x2a4bde['email']){if(!isEmail(_0x2a4bde[_0xc083('0x22')])){return _0x2476fc(handleCheckRowError(_0xc083('0x13'),_0xc083('0x23'),null,_0x4c645b));}}_0x2a4bde['ListId']=LISTID;_0x2a4bde[_0xc083('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2fa42a){var _0x12536b={};for(var _0x2b7240=0x0,_0x4412de=DUPLICATES[_0xc083('0x18')];_0x2b7240<_0x4412de;_0x2b7240+=0x1){_0x12536b[DUPLICATES[_0x2b7240]]=_0x2a4bde[DUPLICATES[_0x2b7240]];}var _0x46fc8b=_[_0xc083('0x25')](_0x2fa42a,_0x12536b);if(_0x46fc8b){return _0x2476fc(handleCheckRowError('duplicate',_0xc083('0x26'),_0x46fc8b,_0x4c645b));}}return db[_0xc083('0x27')]['create'](_0x2a4bde,{'raw':!![],'hooks':![],'fields':_[_0xc083('0x28')](_0x2a4bde)})[_0xc083('0x29')](function(_0x1f390c){if(DUPLICATES&&DUPLICATES[_0xc083('0x18')]&&_0x2fa42a){_0x2fa42a[_0xc083('0x2a')](_[_0xc083('0x2b')](_0x2a4bde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1f390c['id'];return _0x427dd8();})[_0xc083('0x2c')](function(_0x4e9f20){return _0x2476fc(handleCheckRowError(_0xc083('0x13'),_0xc083('0x2d')+(_0x4e9f20[_0xc083('0x19')]||JSON['stringify'](_0x4e9f20)),null,_0x4c645b));});});}function checkHopper(){function _0x4100cb(){return function(_0x1a33ac){logger[_0xc083('0x13')](_0xc083('0x2e'),_0xc083('0x2f'),util[_0xc083('0x30')](_0x1a33ac,{'showHidden':![],'depth':null}));};}var _0x4cb85f=function(_0x410d3a,_0x2f4216){var _0x37d2a4=squel['insert']()[_0xc083('0x31')](_0xc083('0x32'))[_0xc083('0x33')]([_0xc083('0x1e'),_0xc083('0x34'),'ContactId','ListId',_0x2f4216,_0xc083('0x35'),_0xc083('0x36')],squel[_0xc083('0x37')]()[_0xc083('0x38')]('phone',_0xc083('0x1e'))[_0xc083('0x38')](_0xc083('0x39'),_0xc083('0x34'))[_0xc083('0x38')]('id','ContactId')['field'](LISTID[_0xc083('0x3a')](),_0xc083('0x3b'))[_0xc083('0x38')](_0x410d3a['id'][_0xc083('0x3a')](),_0x2f4216)[_0xc083('0x38')]('NOW()',_0xc083('0x35'))['field']('NOW()',_0xc083('0x36'))[_0xc083('0x3c')](_0xc083('0x3d'))['where'](_0xc083('0x3e'))[_0xc083('0x3f')](_0xc083('0x40'),LISTID['toString']())[_0xc083('0x3f')](_0xc083('0x41'))[_0xc083('0x3f')](_0xc083('0x42'),squel[_0xc083('0x37')]()[_0xc083('0x38')]('phone')[_0xc083('0x3c')](_0xc083('0x32'))['where'](_0x2f4216+_0xc083('0x43'),_0x410d3a['id'][_0xc083('0x3a')]())))[_0xc083('0x3a')]();return _0x37d2a4;};var _0x5965ec=function(_0x3e36c7,_0x32326c){var _0x3af8bc=squel[_0xc083('0x44')]()[_0xc083('0x31')](_0xc083('0x32'))[_0xc083('0x33')]([_0xc083('0x1e'),_0xc083('0x34'),'ContactId',_0xc083('0x3b'),_0x32326c,_0xc083('0x35'),_0xc083('0x36')],squel[_0xc083('0x37')]()['field']('phone',_0xc083('0x1e'))[_0xc083('0x38')](_0xc083('0x39'),_0xc083('0x34'))[_0xc083('0x38')]('id',_0xc083('0x45'))[_0xc083('0x38')](LISTID[_0xc083('0x3a')](),'ListId')['field'](_0x3e36c7['id']['toString'](),_0x32326c)[_0xc083('0x38')](_0xc083('0x39'),'createdAt')[_0xc083('0x38')](_0xc083('0x39'),_0xc083('0x36'))[_0xc083('0x3c')](_0xc083('0x3d'))[_0xc083('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0xc083('0x40'),LISTID['toString']())['where'](_0xc083('0x46'),squel['str'](hopperContacts))[_0xc083('0x3f')](_0xc083('0x41'))[_0xc083('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc083('0x37')]()[_0xc083('0x38')](_0xc083('0x47'))['from'](_0xc083('0x48'))[_0xc083('0x3f')](_0x32326c+_0xc083('0x43'),_0x3e36c7['id']['toString']()))['where'](_0xc083('0x42'),squel[_0xc083('0x37')]()[_0xc083('0x38')](_0xc083('0x1e'))[_0xc083('0x3c')]('cm_hopper')['where'](_0x32326c+_0xc083('0x43'),_0x3e36c7['id'][_0xc083('0x3a')]())))[_0xc083('0x3a')]();return _0x3af8bc;};function _0x51fb21(_0x93a87,_0x304611){var _0x532378=squel[_0xc083('0x44')]()[_0xc083('0x31')](_0xc083('0x32'))[_0xc083('0x33')](['phone',_0xc083('0x34'),_0xc083('0x45'),_0xc083('0x3b'),_0x304611,_0xc083('0x35'),_0xc083('0x36')],squel[_0xc083('0x37')]()[_0xc083('0x38')](_0xc083('0x1e'),'phone')['field'](_0xc083('0x39'),_0xc083('0x34'))[_0xc083('0x38')]('id',_0xc083('0x45'))[_0xc083('0x38')](LISTID['toString'](),'ListId')[_0xc083('0x38')](_0x93a87['id'][_0xc083('0x3a')](),_0x304611)[_0xc083('0x38')]('NOW()',_0xc083('0x35'))[_0xc083('0x38')](_0xc083('0x39'),_0xc083('0x36'))[_0xc083('0x3c')]('cm_contacts')['where'](_0xc083('0x3e'))[_0xc083('0x3f')](_0xc083('0x40'),LISTID[_0xc083('0x3a')]())['where'](_0xc083('0x46'),squel[_0xc083('0x49')](hopperContacts))[_0xc083('0x3f')](_0xc083('0x41')))[_0xc083('0x3a')]();return _0x532378;}function _0x232139(_0x336ff1,_0x334a59){var _0x5ccb30=squel[_0xc083('0x44')]()[_0xc083('0x31')](_0xc083('0x4a'))[_0xc083('0x33')]([_0xc083('0x1e'),_0xc083('0x45'),'ListId',_0x334a59,_0xc083('0x35'),_0xc083('0x36')],squel[_0xc083('0x37')]()[_0xc083('0x38')](_0xc083('0x1e'),_0xc083('0x1e'))[_0xc083('0x38')]('id',_0xc083('0x45'))[_0xc083('0x38')](LISTID['toString'](),_0xc083('0x3b'))[_0xc083('0x38')](_0x336ff1['id']['toString'](),_0x334a59)['field'](_0xc083('0x39'),_0xc083('0x35'))[_0xc083('0x38')]('NOW()',_0xc083('0x36'))[_0xc083('0x3c')](_0xc083('0x3d'))[_0xc083('0x3f')]('deletedAt\x20IS\x20NULL')[_0xc083('0x3f')]('ListId\x20=\x20?',LISTID[_0xc083('0x3a')]())['where']('id\x20IN\x20?',squel[_0xc083('0x49')](hopperContacts))[_0xc083('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0xc083('0x3a')]();return _0x5ccb30;}return db[_0xc083('0x4b')][_0xc083('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0xc083('0x4d')],'include':[{'model':db[_0xc083('0x4e')],'as':_0xc083('0x4f'),'where':{'id':LISTID}}]})[_0xc083('0x29')](function(_0x34cc28){var _0xd06492=[];if(_0x34cc28){var _0x35c700;for(var _0x143d0a=0x0,_0x42d64f;_0x143d0a<_0x34cc28[_0xc083('0x18')];_0x143d0a+=0x1){_0x42d64f=_0x34cc28[_0x143d0a][_0xc083('0x50')]({'plain':!![]});switch(_0x42d64f['dialCheckDuplicateType']){case _0xc083('0x51'):_0xd06492['push'](db[_0xc083('0x52')][_0xc083('0x53')](_0x5965ec(_0x42d64f,_0xc083('0x54')))[_0xc083('0x29')](function(){})[_0xc083('0x2c')](_0x4100cb()));break;case'onlyIfOpen':_0xd06492[_0xc083('0x2a')](db[_0xc083('0x52')]['query'](_0x4cb85f(_0x42d64f,_0xc083('0x54')))[_0xc083('0x29')](function(){})[_0xc083('0x2c')](_0x4100cb()));break;default:_0xd06492[_0xc083('0x2a')](db[_0xc083('0x52')][_0xc083('0x53')](_0x51fb21(_0x42d64f,_0xc083('0x54')))[_0xc083('0x29')](function(){})[_0xc083('0x2c')](_0x4100cb()));}}}return _0xd06492;})['all']()[_0xc083('0x29')](function(){return db[_0xc083('0x4b')][_0xc083('0x4c')]({'where':{'type':_0xc083('0x55')},'attributes':['id'],'include':[{'model':db[_0xc083('0x4e')],'as':_0xc083('0x56'),'where':{'id':LISTID}}]})[_0xc083('0x29')](function(_0x475eeb){var _0x256c8f=[];if(_0x475eeb){var _0x5b40ee;for(var _0x5e61d8=0x0,_0x5ac0e5;_0x5e61d8<_0x475eeb[_0xc083('0x18')];_0x5e61d8+=0x1){_0x5ac0e5=_0x475eeb[_0x5e61d8][_0xc083('0x50')]({'plain':!![]});_0x256c8f['push'](db[_0xc083('0x52')][_0xc083('0x53')](_0x232139(_0x5ac0e5,_0xc083('0x54')))[_0xc083('0x29')](function(){})['catch'](_0x4100cb()));}}return _0x256c8f;})['all']();})[_0xc083('0x29')](function(){return db[_0xc083('0x57')]['findAll']({'attributes':['id',_0xc083('0x4d')],'include':[{'model':db[_0xc083('0x4e')],'as':_0xc083('0x4f'),'where':{'id':LISTID}}]})[_0xc083('0x29')](function(_0x57a048){var _0x2ffead=[];if(_0x57a048){for(var _0x5c70c0=0x0,_0x455e15;_0x5c70c0<_0x57a048[_0xc083('0x18')];_0x5c70c0+=0x1){_0x455e15=_0x57a048[_0x5c70c0]['get']({'plain':!![]});switch(_0x455e15['dialCheckDuplicateType']){case _0xc083('0x51'):_0x2ffead['push'](db['sequelize'][_0xc083('0x53')](_0x5965ec(_0x455e15,_0xc083('0x58')))[_0xc083('0x29')](function(){})[_0xc083('0x2c')](_0x4100cb()));break;case'onlyIfOpen':_0x2ffead['push'](db[_0xc083('0x52')]['query'](_0x4cb85f(_0x455e15,'CampaignId'))[_0xc083('0x29')](function(){})['catch'](_0x4100cb()));break;default:_0x2ffead[_0xc083('0x2a')](db[_0xc083('0x52')][_0xc083('0x53')](_0x51fb21(_0x455e15,_0xc083('0x58')))[_0xc083('0x29')](function(){})[_0xc083('0x2c')](_0x4100cb()));}}}return _0x2ffead;})['all']();})[_0xc083('0x29')](function(){return db[_0xc083('0x57')][_0xc083('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xc083('0x4e')],'as':_0xc083('0x56'),'where':{'id':LISTID}}]})[_0xc083('0x29')](function(_0x3ec2ed){var _0x35a3d9=[];if(_0x3ec2ed){for(var _0x1b1d0d=0x0,_0x356098;_0x1b1d0d<_0x3ec2ed[_0xc083('0x18')];_0x1b1d0d+=0x1){_0x356098=_0x3ec2ed[_0x1b1d0d][_0xc083('0x50')]({'plain':!![]});_0x35a3d9[_0xc083('0x2a')](db['sequelize'][_0xc083('0x53')](_0x232139(_0x356098,_0xc083('0x58')))[_0xc083('0x29')](function(){})[_0xc083('0x2c')](_0x4100cb()));}}return _0x35a3d9;})['all']();})['catch'](function(_0x533dcd){logger[_0xc083('0x13')](_0xc083('0x59'),_0xc083('0x5a'),_0x533dcd[_0xc083('0x19')]);});}var processPromises=function(_0x2d8ca6){return BPromise[_0xc083('0x5b')](promises)['then'](function(_0x32a899){})['catch'](function(_0x1e364c){logger[_0xc083('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0xc083('0x5c')](_0x1e364c));})['finally'](function(){socket['emit'](_0xc083('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2d8ca6){return _0x2d8ca6['resume']();}});};var endCsv=function(){return BPromise[_0xc083('0x5e')]()[_0xc083('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0xc083('0x29')](function(){socket[_0xc083('0x5f')](_0xc083('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x21b1f6){logger['error'](_0xc083('0x60'),JSON[_0xc083('0x5c')](_0x21b1f6));}finally{process[_0xc083('0x61')](0x0);}});};process['on'](_0xc083('0x62'),function(){logger[_0xc083('0x63')](_0xc083('0x64'));endCsv();});function main(){return BPromise[_0xc083('0x5e')]()[_0xc083('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc083('0x11')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc083('0x29')](function(_0x390dea){var _0x48c29b=fs[_0xc083('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x48c29b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x329dff,_0x362db7){total+=0x1;var _0x41c5e=total;promises[_0xc083('0x2a')](checkRow(_0x329dff,_0x390dea,_0x41c5e)['then'](function(){success+=0x1;})[_0xc083('0x2c')](function(_0x196d4a){if(_0x196d4a[_0xc083('0x13')]){errors+=0x1;delete _0x196d4a[_0xc083('0x13')];}else if(_0x196d4a[_0xc083('0x66')]){duplicates+=0x1;delete _0x196d4a[_0xc083('0x66')];}rows[_0xc083('0x2a')](_0x196d4a);}));if(total%0xc8===0x0){_0x362db7[_0xc083('0x67')]();return processPromises(_0x362db7);}},'complete':function(){return processPromises()['then'](function(){logger[_0xc083('0x63')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x197b55,_0x1e4c47){logger[_0xc083('0x63')](_0xc083('0x68'),JSON[_0xc083('0x5c')](_0x197b55));endCsv();}});})[_0xc083('0x2c')](function(_0x9c369e){logger[_0xc083('0x13')](_0xc083('0x69'),JSON['stringify'](_0x9c369e));});}main();
\ No newline at end of file
index 4d345a3..a1ba3ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48f0=['uncaughtException','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','ListId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.createdAt','scheduledat','cm_hopper_black','concat','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','push','code','message','sequelize','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','query','spread','all','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','length','then','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','binding','socket_timestamp','server/files/tmp','keys','includes','header',',utcOffset','writeFileSync','parse','data','rows','errors','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x48f0,0x141));var _0x048f=function(_0x1c8f2e,_0x18f8e4){_0x1c8f2e=_0x1c8f2e-0x0;var _0xb97cf5=_0x48f0[_0x1c8f2e];return _0xb97cf5;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x048f('0x0'));var Papa=require(_0x048f('0x1'));var util=require(_0x048f('0x2'));var BPromise=require(_0x048f('0x3'));var moment=require(_0x048f('0x4'));var squel=require('squel');var Redis=require(_0x048f('0x5'));var db=require(_0x048f('0x6'))['db'];var config=require(_0x048f('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0x048f('0x8'))(_0x048f('0x9'));config[_0x048f('0xa')]=_['defaults'](config[_0x048f('0xa')],{'host':_0x048f('0xb'),'port':0x18eb});var socket=require(_0x048f('0xc'))(new Redis(config[_0x048f('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x048f('0xd')](_0x048f('0xe'));function isEmail(_0x4d49cf){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x048f('0xf')](_0x4d49cf);}function selectNotIn(_0x7e52c6,_0x5178e6,_0x1b2422,_0x276f11,_0x492cd7){return squel[_0x048f('0x10')]()[_0x048f('0x11')](_0x048f('0x12'))[_0x048f('0x13')](_0x276f11)[_0x048f('0x14')](_0x5178e6,null,_0x5178e6+_0x048f('0x15')+_0x276f11+'.'+_0x1b2422)[_0x048f('0x16')](_0x276f11+'.'+_0x1b2422+'\x20=\x20'+_0x7e52c6+'.'+_0x1b2422)[_0x048f('0x16')](_0x5178e6+'.dialCheckDuplicateType\x20IN\x20('+_0x492cd7[_0x048f('0x14')]()+')');}function insertCmHopper(_0x38d3f8,_0x28fa07,_0x1aaa54,_0x1275ce,_0x43824d){var _0x52bd6d=['cm_contacts.phone',_0x048f('0x17'),_0x048f('0x18'),_0x048f('0x19'),_0x28fa07+'.'+_0x1275ce,'cm_contacts.createdAt',_0x048f('0x1a'),_0x048f('0x1b'),_0x048f('0x1c'),'\x22'+_0x43824d+'\x22'];return squel[_0x048f('0x1d')]()[_0x048f('0x1e')](_0x048f('0x1f'))[_0x048f('0x20')]([_0x048f('0x12'),'scheduledat',_0x048f('0x21'),'ListId',_0x1275ce,_0x048f('0x22'),_0x048f('0x23'),_0x048f('0x24'),_0x048f('0x25'),_0x048f('0x26')],squel[_0x048f('0x10')]()[_0x048f('0x27')](_0x52bd6d)['from'](_0x28fa07)[_0x048f('0x14')](_0x048f('0x28'),null,_0x048f('0x29')+_0x28fa07+_0x048f('0x2a'))[_0x048f('0x14')](_0x1aaa54,null,_0x1aaa54+'.id\x20=\x20'+_0x28fa07+'.'+_0x1275ce)[_0x048f('0x16')](_0x28fa07+_0x048f('0x2b'),_0x38d3f8)[_0x048f('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x048f('0x16')](_0x048f('0x2c'),selectNotIn(_0x28fa07,_0x1aaa54,_0x1275ce,_0x048f('0x1f'),[_0x048f('0x2d'),_0x048f('0x2e')]))[_0x048f('0x16')](_0x048f('0x2c'),selectNotIn(_0x28fa07,_0x1aaa54,_0x1275ce,_0x048f('0x1f'),[_0x048f('0x2d')])))[_0x048f('0x2f')]();}function insertCmHopperBlack(_0x13ccde,_0x5eb9cb,_0x79e8d3,_0xc6cadb){var _0x502440=['cm_contacts.phone','cm_contacts.id',_0x048f('0x19'),_0x5eb9cb+'.'+_0xc6cadb,'cm_contacts.createdAt',_0x048f('0x1a')];return squel[_0x048f('0x1d')]()[_0x048f('0x1e')]('cm_hopper_black')['fromQuery']([_0x048f('0x12'),_0x048f('0x21'),_0x048f('0x30'),_0xc6cadb,'createdAt','updatedAt'],squel[_0x048f('0x10')]()[_0x048f('0x27')](_0x502440)[_0x048f('0x13')](_0x5eb9cb)[_0x048f('0x14')](_0x048f('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x5eb9cb+_0x048f('0x2a'))[_0x048f('0x14')](_0x79e8d3,null,_0x79e8d3+'.id\x20=\x20'+_0x5eb9cb+'.'+_0xc6cadb)[_0x048f('0x16')](_0x5eb9cb+_0x048f('0x2b'),_0x13ccde)[_0x048f('0x16')](_0x048f('0x31'),NOW)[_0x048f('0x16')](_0x048f('0x2c'),squel[_0x048f('0x10')]()['field'](_0x048f('0x12'))['from']('cm_hopper_black')[_0x048f('0x16')](_0x048f('0x32'),_0x13ccde)[_0x048f('0x16')](_0xc6cadb+_0x048f('0x33'),_0x5eb9cb+'.'+_0xc6cadb)))['toString']();}function insertTzCmHopper(_0x53e502,_0x71a791,_0x1c45e8,_0x187153,_0x1499e0,_0x54f90e){var _0x218a8e=[_0x048f('0x34'),_0x048f('0x35')+_0x54f90e+_0x048f('0x36'),_0x048f('0x18'),'cm_contacts.ListId',_0x71a791+'.'+_0x187153,_0x048f('0x37'),_0x048f('0x1a'),_0x048f('0x1b'),_0x048f('0x1c'),'\x22'+_0x1499e0+'\x22'];var _0x536c2d=squel[_0x048f('0x1d')]()['into'](_0x048f('0x1f'))[_0x048f('0x20')](['phone',_0x048f('0x38'),_0x048f('0x21'),_0x048f('0x30'),_0x187153,'createdAt',_0x048f('0x23'),'priority','UserId',_0x048f('0x26')],squel[_0x048f('0x10')]()[_0x048f('0x27')](_0x218a8e)[_0x048f('0x13')](_0x71a791)[_0x048f('0x14')](_0x048f('0x28'),null,_0x048f('0x29')+_0x71a791+_0x048f('0x2a'))[_0x048f('0x14')](_0x1c45e8,null,_0x1c45e8+_0x048f('0x15')+_0x71a791+'.'+_0x187153)[_0x048f('0x14')](_0x54f90e,null,_0x54f90e+_0x048f('0x15')+_0x71a791+'.'+_0x187153)[_0x048f('0x16')](_0x71a791+_0x048f('0x2b'),_0x53e502)[_0x048f('0x16')](_0x048f('0x31'),NOW)[_0x048f('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x71a791,_0x1c45e8,_0x187153,'cm_hopper',[_0x048f('0x2d'),_0x048f('0x2e')]))[_0x048f('0x16')](_0x048f('0x2c'),selectNotIn(_0x71a791,_0x1c45e8,_0x187153,_0x048f('0x1f'),['\x22always\x22'])))[_0x048f('0x2f')]();return _0x536c2d;}function insertTzCmHopperBlack(_0xd0971a,_0xdbf75a,_0x2aaccd,_0x24d647){var _0x28152d=[_0x048f('0x34'),_0x048f('0x18'),_0x048f('0x19'),_0xdbf75a+'.'+_0x24d647,_0x048f('0x37'),_0x048f('0x1a')];return squel[_0x048f('0x1d')]()[_0x048f('0x1e')](_0x048f('0x39'))[_0x048f('0x20')]([_0x048f('0x12'),_0x048f('0x21'),_0x048f('0x30'),_0x24d647,_0x048f('0x22'),_0x048f('0x23')],squel['select']()[_0x048f('0x27')](_0x28152d)['from'](_0xdbf75a)[_0x048f('0x14')]('cm_contacts',null,_0x048f('0x29')+_0xdbf75a+_0x048f('0x2a'))[_0x048f('0x14')](_0x2aaccd,null,_0x2aaccd+_0x048f('0x15')+_0xdbf75a+'.'+_0x24d647)[_0x048f('0x16')](_0xdbf75a+_0x048f('0x2b'),_0xd0971a)['where'](_0x048f('0x31'),NOW)['where'](_0x048f('0x2c'),squel[_0x048f('0x10')]()[_0x048f('0x11')](_0x048f('0x12'))['from'](_0x048f('0x39'))[_0x048f('0x16')](_0x048f('0x32'),_0xd0971a)['where'](_0x24d647+'\x20=\x20?',_0xdbf75a+'.'+_0x24d647)))[_0x048f('0x2f')]();}function insertCmContact(_0xe3fd9e,_0x2d18ed,_0x437c08,_0x5686f5){var _0xd8f244=_[_0x048f('0x3a')](_['keys'](_0x5686f5),['ListId',_0x048f('0x3b'),'createdAt',_0x048f('0x23')]);return squel['insert']()[_0x048f('0x1e')](_0x048f('0x28'))[_0x048f('0x20')](_0xd8f244,squel[_0x048f('0x10')]()['fields'](_0xd8f244)[_0x048f('0x13')](_0x2d18ed)[_0x048f('0x16')]('('+_0x437c08[_0x048f('0x14')](',')+')\x20NOT\x20IN\x20?',squel[_0x048f('0x10')]()['fields'](_0x437c08)[_0x048f('0x13')](_0x048f('0x28'))['where'](_0x048f('0x32'),_0xe3fd9e)[_0x048f('0x16')]('deletedAt\x20IS\x20NULL'))[_0x048f('0x16')](_0x048f('0x3c'),squel[_0x048f('0x10')]()[_0x048f('0x11')](_0x048f('0x3d'),_0x048f('0x3e'))[_0x048f('0x13')](_0x2d18ed)[_0x048f('0x3f')](_0x437c08[_0x048f('0x14')](','))))[_0x048f('0x2f')]();}function handleStop(){logger[_0x048f('0x40')](_0x048f('0x41'));stopped=!![];}function handleUncaughtException(_0x16ca99){logger[_0x048f('0x42')](_0x16ca99['message']);process[_0x048f('0x43')](0x1);}function handleError(_0x5d06a0,_0x56e1f5){stats['errors'][_0x048f('0x44')]({'name':_0x56e1f5[_0x048f('0x45')],'message':_0x56e1f5[_0x048f('0x46')],'row':_0x5d06a0});}function handleQuery(_0x247c15){logger[_0x048f('0x40')](_0x247c15);return db[_0x048f('0x47')]['query'](_0x247c15)['spread'](function(_0x569cf4){results['push'](_0x569cf4);})[_0x048f('0x48')](function(_0x57e137){logger[_0x048f('0x42')](_0x57e137[_0x048f('0x46')]);});}function updateTzCampaigns(_0x43ccb0){return new Promise(function(_0x11d13c,_0xd69233){var _0x49caf0=squel[_0x048f('0x10')]()[_0x048f('0x27')]([_0x048f('0x49'),_0x048f('0x4a')])[_0x048f('0x13')](_0x048f('0x4b'))['join']('campaigns_has_cm_lists',null,_0x048f('0x4c'))['where'](_0x048f('0x4d')+_0x43ccb0);db[_0x048f('0x47')][_0x048f('0x4e')](_0x49caf0['toString']())[_0x048f('0x4f')](function(_0x5e3ac0){var _0x442001=[];for(var _0x38d6d8=0x0;_0x38d6d8<_0x5e3ac0['length'];_0x38d6d8++){_0x442001[_0x048f('0x44')](getTimezoneData(_0x5e3ac0[_0x38d6d8],tmp_campaigns));}BPromise[_0x048f('0x50')](_0x442001)['then'](function(){_0x11d13c({'val':0x1});});})[_0x048f('0x48')](function(_0x5e94d5){logger[_0x048f('0x42')](_0x5e94d5['message']);_0x11d13c({'val':0x0});});});}function updateTzVoiceQueues(_0x3e7f52){return new Promise(function(_0x38149d,_0x5678ef){var _0x497b32=squel[_0x048f('0x10')]()[_0x048f('0x27')]([_0x048f('0x51'),_0x048f('0x52')])['from'](_0x048f('0x53'))[_0x048f('0x14')]('voice_queues_has_cm_lists',null,_0x048f('0x54'))[_0x048f('0x16')](_0x048f('0x55')+_0x3e7f52);db['sequelize'][_0x048f('0x4e')](_0x497b32[_0x048f('0x2f')]())[_0x048f('0x4f')](function(_0x3e8dec){var _0x6f7220=[];for(var _0x338c4a=0x0;_0x338c4a<_0x3e8dec[_0x048f('0x56')];_0x338c4a++){_0x6f7220['push'](getTimezoneData(_0x3e8dec[_0x338c4a],tmp_voice_queues));}BPromise['all'](_0x6f7220)[_0x048f('0x57')](function(){_0x38149d({'val':0x1});});})['catch'](function(_0x54608a){logger['error'](_0x54608a[_0x048f('0x46')]);_0x38149d({'val':0x0});});});}function getTimezoneData(_0x1a4d8b,_0x4cf1e0){return new Promise(function(_0x42aa2e,_0xb17660){var _0x59da51=shared[_0x048f('0x58')];var _0x3bb2d1=_0x59da51[_0x1a4d8b[_0x048f('0x59')]];if(_[_0x048f('0x5a')](_0x3bb2d1)){_0x42aa2e({'ret':0x1});}else{var _0xc17c83=_0x3bb2d1[_0x048f('0x5b')];var _0x1925e8=squel['insert']()['into'](_0x4cf1e0)[_0x048f('0x5c')]('id',_0x1a4d8b['id'])[_0x048f('0x5c')](_0x048f('0x5d'),_0xc17c83)[_0x048f('0x5c')](_0x048f('0x59'),_0x1a4d8b[_0x048f('0x59')])[_0x048f('0x2f')]();return db[_0x048f('0x47')][_0x048f('0x4e')](_0x1925e8)[_0x048f('0x4f')](function(_0x361977){_0x42aa2e({'ret':0x1});})[_0x048f('0x48')](function(_0x4511bd){logger[_0x048f('0x42')](_0x4511bd['message']);_0xb17660({'ret':0x1});});}});}function handleTZQuery(_0x134403){logger[_0x048f('0x40')](_0x134403);return db[_0x048f('0x47')]['query'](_0x134403)[_0x048f('0x4f')](function(_0x4696f9){})[_0x048f('0x48')](function(_0x4c53a7){logger[_0x048f('0x42')](_0x4c53a7[_0x048f('0x46')]);});}function main(_0x4463e7,_0x10d665,_0x26d7ca,_0x29d4c3){logger['info'](_0x048f('0x5e'),_0x4463e7,JSON[_0x048f('0x5f')](_0x10d665));process[_0x048f('0x60')]('start');var _0x2eed0f=_0x10d665[_0x048f('0x61')];var _0x1ab60a=_0x10d665[_0x048f('0x62')];var _0x10cfa4=path[_0x048f('0x14')](config['root'],_0x048f('0x63'),_0x1ab60a+'.csv');hasTZ=_[_0x048f('0x64')](_0x2eed0f)[_0x048f('0x65')](_0x048f('0x59'));var _0x2f2857=_[_0x048f('0x64')](_0x2eed0f)['join']();logger[_0x048f('0x40')](_0x048f('0x66'),_0x2f2857);if(hasTZ)_0x2f2857+=_0x048f('0x67');fs[_0x048f('0x68')](_0x10cfa4,_0x2f2857+'\x0a');Papa[_0x048f('0x69')](fs['createReadStream'](_0x4463e7),{'header':!![],'skipEmptyLines':!![],'step':function(_0x59fac2,_0x38d115){try{for(var _0x5583b2=0x0,_0x5c8329=[];_0x5583b2<_0x59fac2[_0x048f('0x6a')]['length'];_0x5583b2++){stats[_0x048f('0x6b')]+=0x1;if(_0x59fac2[_0x048f('0x6c')][_0x5583b2]){handleError(_0x59fac2[_0x048f('0x6a')][_0x5583b2],_0x59fac2[_0x048f('0x6c')][_0x5583b2]);}else{var _0x5d24a4=[];for(var _0x45a923 in _0x2eed0f){if(_0x2eed0f[_0x048f('0x6d')](_0x45a923)){if(_0x59fac2['data'][_0x5583b2][_0x2eed0f[_0x45a923]]){var _0x5cc4a5=_[_0x048f('0x6e')](_0x59fac2['data'][_0x5583b2][_0x2eed0f[_0x45a923]][_0x048f('0x6f')](/"/g,'\x27'));switch(_0x45a923){case _0x048f('0x38'):var _0x5912ee=moment(_0x5cc4a5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5912ee[_0x048f('0x70')]()){_0x5c8329[_0x048f('0x44')]('\x22'+_0x5cc4a5+'\x22');}else{_0x5d24a4[_0x048f('0x44')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x048f('0x24'):var _0x3ca7a6=parseInt(_0x5cc4a5);_0x5cc4a5=_[_0x048f('0x71')](_0x3ca7a6)||_0x3ca7a6<0x0||_0x3ca7a6>0x4?_0x29d4c3?0x3:0x2:_0x3ca7a6;_0x5c8329[_0x048f('0x44')]('\x22'+_0x5cc4a5+'\x22');break;case _0x048f('0x25'):var _0x2fab91=parseInt(_0x5cc4a5);if(_[_0x048f('0x72')](_0x2fab91)&&_[_0x048f('0x65')](_0x26d7ca,_0x2fab91)){_0x5c8329[_0x048f('0x44')]('\x22'+_0x2fab91+'\x22');}else{_0x5d24a4[_0x048f('0x44')](_0x048f('0x73'));}break;case'email':if(isEmail(_0x5cc4a5)){_0x5c8329['push']('\x22'+_0x5cc4a5+'\x22');}else{_0x5d24a4[_0x048f('0x44')](_0x048f('0x74'));}break;case _0x048f('0x75'):var _0x29e8c1=moment(_0x5cc4a5,'YYYY-MM-DD',!![]);if(_0x29e8c1[_0x048f('0x70')]()){_0x5c8329[_0x048f('0x44')]('\x22'+_0x5cc4a5+'\x22');}else{_0x5d24a4[_0x048f('0x44')](_0x048f('0x76'));}break;case _0x048f('0x59'):var _0x33ab58=shared[_0x048f('0x58')];var _0xc1811f=_0x33ab58[_0x5cc4a5];if(!_['isNil'](_0xc1811f)){var _0x185d5e=_0xc1811f[_0x048f('0x5b')];_0x5c8329[_0x048f('0x44')]('\x22'+_0x5cc4a5+'\x22');_0x5c8329[_0x048f('0x44')]('\x22'+_0x185d5e+'\x22');}break;default:_0x5c8329[_0x048f('0x44')]('\x22'+_0x5cc4a5+'\x22');}}else{switch(_0x45a923){case'firstName':case _0x048f('0x12'):_0x5d24a4[_0x048f('0x44')](_0x45a923+_0x048f('0x77'));break;default:_0x5c8329['push']('\x22\x22');}}}}if(_0x5d24a4['length']){handleError(_0x59fac2['data'][_0x5583b2],{'code':'SystemRow','message':_0x5d24a4[_0x048f('0x14')]()});}else{fs['appendFileSync'](_0x10cfa4,_0x5c8329[_0x048f('0x14')]()+'\x0a');}_0x5c8329=[];}if(!(stats[_0x048f('0x6b')]%0xc8)){socket['emit'](_0x048f('0x78')+_0x1ab60a,stats);stats[_0x048f('0x6c')]=[];}}if(stopped){logger[_0x048f('0x40')](_0x048f('0x79'));_0x38d115[_0x048f('0x7a')]();}}catch(_0x32532c){handleError(_0x59fac2[_0x048f('0x6a')][_0x5583b2],{'code':'SystemError','message':_0x32532c['message']});logger[_0x048f('0x42')](_0x048f('0x7b'),_0x32532c['message']);}},'complete':function(){try{var _0x3e229b=[];var _0x34e32c=[];var _0x2305b5=_0x048f('0x28');if(_0x10d665['duplicates']&&_0x10d665[_0x048f('0x7c')][_0x048f('0x56')]){_0x2305b5=_0x048f('0x7d')+_0x1ab60a;_0x3e229b[_0x048f('0x44')](_0x048f('0x7e')+_0x2305b5+_0x048f('0x7f'));}tmp_campaigns=_0x048f('0x80')+_0x1ab60a;tmp_voice_queues=_0x048f('0x81')+_0x1ab60a;_0x34e32c['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0x048f('0x82'));_0x34e32c[_0x048f('0x44')](_0x048f('0x7e')+tmp_voice_queues+_0x048f('0x82'));BPromise[_0x048f('0x83')](_0x34e32c,handleTZQuery)[_0x048f('0x57')](function(_0x4ac0f6){updateTzCampaigns(_0x10d665[_0x048f('0x30')])['then'](function(_0x368841){updateTzVoiceQueues(_0x10d665[_0x048f('0x30')])[_0x048f('0x57')](function(_0x2da9f0){var _0x2847fe=util[_0x048f('0xd')](_0x048f('0x84'),_0x10cfa4,_0x2305b5,_0x2f2857,_0x10d665[_0x048f('0x30')],_0x10d665[_0x048f('0x3b')]||null,NOW,NOW);if(_[_0x048f('0x5a')](_0x2eed0f[_0x048f('0x38')])){_0x2847fe+=_0x048f('0x85');}_0x3e229b[_0x048f('0x44')](_0x2847fe);if(_0x10d665['duplicates']&&_0x10d665[_0x048f('0x7c')][_0x048f('0x56')]){_0x3e229b[_0x048f('0x44')](insertCmContact(_0x10d665[_0x048f('0x30')],_0x2305b5,_0x10d665[_0x048f('0x7c')],_0x2eed0f));_0x3e229b[_0x048f('0x44')]('DROP\x20TABLE\x20'+_0x2305b5+';');}if(hasTZ){_0x3e229b[_0x048f('0x44')](insertTzCmHopper(_0x10d665['ListId'],_0x048f('0x86'),_0x048f('0x53'),_0x048f('0x87'),_0x29d4c3,tmp_voice_queues));_0x3e229b['push'](insertTzCmHopperBlack(_0x10d665['ListId'],'voice_queues_has_cm_blacklists',_0x048f('0x53'),_0x048f('0x87')));_0x3e229b[_0x048f('0x44')](insertTzCmHopper(_0x10d665[_0x048f('0x30')],'campaigns_has_cm_lists',_0x048f('0x4b'),_0x048f('0x88'),_0x29d4c3,tmp_campaigns));_0x3e229b[_0x048f('0x44')](insertTzCmHopperBlack(_0x10d665[_0x048f('0x30')],_0x048f('0x89'),_0x048f('0x4b'),_0x048f('0x88')));}else{_0x3e229b[_0x048f('0x44')](insertCmHopper(_0x10d665[_0x048f('0x30')],'voice_queues_has_cm_lists',_0x048f('0x53'),_0x048f('0x87'),_0x29d4c3));_0x3e229b[_0x048f('0x44')](insertCmHopperBlack(_0x10d665[_0x048f('0x30')],_0x048f('0x8a'),_0x048f('0x53'),_0x048f('0x87')));_0x3e229b['push'](insertCmHopper(_0x10d665[_0x048f('0x30')],_0x048f('0x8b'),_0x048f('0x4b'),'CampaignId',_0x29d4c3));_0x3e229b[_0x048f('0x44')](insertCmHopperBlack(_0x10d665[_0x048f('0x30')],'campaigns_has_cm_blacklists',_0x048f('0x4b'),'CampaignId'));}_0x3e229b[_0x048f('0x44')](_0x048f('0x8c')+tmp_campaigns+';');_0x3e229b['push']('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x048f('0x83')](_0x3e229b,handleQuery)[_0x048f('0x57')](function(_0x58792f){stats[_0x048f('0x8d')]=!![];stats[_0x048f('0x8e')]=_0x10d665['duplicates']&&_0x10d665['duplicates']['length']?results[0x2][_0x048f('0x8e')]:results[0x0]['affectedRows'];socket[_0x048f('0x8f')](_0x048f('0x78')+_0x1ab60a,stats);fs[_0x048f('0x90')](_0x4463e7);fs[_0x048f('0x90')](_0x10cfa4);process['exit'](0x0);})[_0x048f('0x48')](function(_0x3305f1){logger[_0x048f('0x42')](_0x3305f1[_0x048f('0x46')]);process[_0x048f('0x43')](0x1);});});});});}catch(_0x201789){logger['error'](_0x048f('0x91'),_0x201789['message']);process[_0x048f('0x43')](0x1);}},'error':function(_0x4cca68,_0x45a7f2,_0x4fbad7,_0x3433e6){throw new Error(_0x3433e6);}});}function validate(){if(process[_0x048f('0x92')]&&process[_0x048f('0x92')][_0x048f('0x56')]<0x4){throw new Error(_0x048f('0x93'));}var _0x448993=path[_0x048f('0x14')](config[_0x048f('0x94')],_0x048f('0x63'),process['argv'][0x2]);if(!fs[_0x048f('0x95')](_0x448993)){throw new Error(_0x048f('0x96'));}var _0x46c6f7={};try{_0x46c6f7=JSON['parse'](process[_0x048f('0x92')][0x3]);if(!_0x46c6f7['binding']){throw new Error(_0x048f('0x97'));}if(!_0x46c6f7[_0x048f('0x61')]['phone']){throw new Error(_0x048f('0x98'));}if(!_0x46c6f7[_0x048f('0x61')][_0x048f('0x99')]){throw new Error(_0x048f('0x9a'));}var _0x4f1bdb=0x0;if(_0x46c6f7['binding']['UserId']){_0x4f1bdb=0x1;}if(!_0x46c6f7[_0x048f('0x30')]){throw new Error(_0x048f('0x9b'));}}catch(_0x342aa1){throw new Error(_0x048f('0x9c'));}var _0x4edca0=[];try{_0x4edca0=_['map'](JSON[_0x048f('0x69')](process[_0x048f('0x92')][0x4]),'id');}catch(_0xbf652c){logger[_0x048f('0x40')](_0x048f('0x9d'));}main(_0x448993,_0x46c6f7,_0x4edca0,_0x4f1bdb);}validate();process['on'](_0x048f('0x9e'),handleStop);process['on'](_0x048f('0x9f'),handleUncaughtException);
\ No newline at end of file
+var _0x497f=[')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','errors','push','code','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','then','timezones','utcOffset','offset','set','dialTimezone','main','stringify','send','start','binding','socket_timestamp','root','.csv','header',',utcOffset','writeFileSync','parse','data','rows','hasOwnProperty','trim','isValid','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','isNil','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','each','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','emit','unlink','exit','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','server/files/tmp','file\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ListId','createdAt','priority','recallme','cm_contacts','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_hopper_black','ContactId','updatedAt','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','concat','keys'];(function(_0x3afcfd,_0x4cd8fc){var _0xe7fde2=function(_0x52b570){while(--_0x52b570){_0x3afcfd['push'](_0x3afcfd['shift']());}};_0xe7fde2(++_0x4cd8fc);}(_0x497f,0x100));var _0xf497=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x497f[_0x2f3794];return _0x1c9fbe;};'use strict';var fs=require('fs');var path=require(_0xf497('0x0'));var _=require('lodash');var Papa=require(_0xf497('0x1'));var util=require(_0xf497('0x2'));var BPromise=require(_0xf497('0x3'));var moment=require(_0xf497('0x4'));var squel=require(_0xf497('0x5'));var Redis=require('ioredis');var db=require(_0xf497('0x6'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0xf497('0x7'))('import');config[_0xf497('0x8')]=_[_0xf497('0x9')](config[_0xf497('0x8')],{'host':_0xf497('0xa'),'port':0x18eb});var socket=require(_0xf497('0xb'))(new Redis(config[_0xf497('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xf497('0xc'));function isEmail(_0x581b26){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xf497('0xd')](_0x581b26);}function selectNotIn(_0x355383,_0x21df15,_0x3c0a0c,_0x5e3b18,_0x48cf93){return squel[_0xf497('0xe')]()[_0xf497('0xf')](_0xf497('0x10'))[_0xf497('0x11')](_0x5e3b18)[_0xf497('0x12')](_0x21df15,null,_0x21df15+_0xf497('0x13')+_0x5e3b18+'.'+_0x3c0a0c)[_0xf497('0x14')](_0x5e3b18+'.'+_0x3c0a0c+_0xf497('0x15')+_0x355383+'.'+_0x3c0a0c)[_0xf497('0x14')](_0x21df15+_0xf497('0x16')+_0x48cf93[_0xf497('0x12')]()+')');}function insertCmHopper(_0x35b4d7,_0x121456,_0x18bb9e,_0x4528d1,_0x422532){var _0x664fae=[_0xf497('0x17'),_0xf497('0x18'),_0xf497('0x19'),'cm_contacts.ListId',_0x121456+'.'+_0x4528d1,_0xf497('0x1a'),_0xf497('0x1b'),_0xf497('0x1c'),_0xf497('0x1d'),'\x22'+_0x422532+'\x22'];return squel[_0xf497('0x1e')]()[_0xf497('0x1f')]('cm_hopper')[_0xf497('0x20')]([_0xf497('0x10'),_0xf497('0x21'),'ContactId',_0xf497('0x22'),_0x4528d1,_0xf497('0x23'),'updatedAt',_0xf497('0x24'),'UserId',_0xf497('0x25')],squel[_0xf497('0xe')]()['fields'](_0x664fae)[_0xf497('0x11')](_0x121456)[_0xf497('0x12')](_0xf497('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x121456+'.CmListId')[_0xf497('0x12')](_0x18bb9e,null,_0x18bb9e+_0xf497('0x13')+_0x121456+'.'+_0x4528d1)[_0xf497('0x14')](_0x121456+'.CmListId\x20=\x20?',_0x35b4d7)[_0xf497('0x14')](_0xf497('0x27'),NOW)[_0xf497('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x121456,_0x18bb9e,_0x4528d1,_0xf497('0x28'),['\x22always\x22',_0xf497('0x29')]))[_0xf497('0x14')](_0xf497('0x2a'),selectNotIn(_0x121456,_0x18bb9e,_0x4528d1,_0xf497('0x28'),[_0xf497('0x2b')])))[_0xf497('0x2c')]();}function insertCmHopperBlack(_0x23a420,_0x5c03a8,_0x4d9d80,_0x3e78ac){var _0x26296f=[_0xf497('0x17'),_0xf497('0x19'),_0xf497('0x2d'),_0x5c03a8+'.'+_0x3e78ac,_0xf497('0x1a'),_0xf497('0x1b')];return squel[_0xf497('0x1e')]()[_0xf497('0x1f')](_0xf497('0x2e'))['fromQuery']([_0xf497('0x10'),_0xf497('0x2f'),'ListId',_0x3e78ac,'createdAt',_0xf497('0x30')],squel[_0xf497('0xe')]()[_0xf497('0x31')](_0x26296f)[_0xf497('0x11')](_0x5c03a8)['join'](_0xf497('0x26'),null,_0xf497('0x32')+_0x5c03a8+'.CmListId')[_0xf497('0x12')](_0x4d9d80,null,_0x4d9d80+_0xf497('0x13')+_0x5c03a8+'.'+_0x3e78ac)[_0xf497('0x14')](_0x5c03a8+_0xf497('0x33'),_0x23a420)[_0xf497('0x14')](_0xf497('0x27'),NOW)[_0xf497('0x14')](_0xf497('0x2a'),squel[_0xf497('0xe')]()['field'](_0xf497('0x10'))[_0xf497('0x11')]('cm_hopper_black')[_0xf497('0x14')](_0xf497('0x34'),_0x23a420)['where'](_0x3e78ac+_0xf497('0x35'),_0x5c03a8+'.'+_0x3e78ac)))[_0xf497('0x2c')]();}function insertTzCmHopper(_0x274281,_0x29cdc5,_0x486f95,_0x1f695b,_0x14782b,_0x32c4b7){var _0x346b9c=[_0xf497('0x17'),_0xf497('0x36')+_0x32c4b7+_0xf497('0x37'),'cm_contacts.id',_0xf497('0x2d'),_0x29cdc5+'.'+_0x1f695b,_0xf497('0x1a'),_0xf497('0x1b'),_0xf497('0x1c'),'cm_contacts.UserId','\x22'+_0x14782b+'\x22'];var _0x5228b7=squel['insert']()[_0xf497('0x1f')]('cm_hopper')['fromQuery']([_0xf497('0x10'),_0xf497('0x21'),_0xf497('0x2f'),_0xf497('0x22'),_0x1f695b,_0xf497('0x23'),_0xf497('0x30'),_0xf497('0x24'),'UserId',_0xf497('0x25')],squel[_0xf497('0xe')]()['fields'](_0x346b9c)[_0xf497('0x11')](_0x29cdc5)[_0xf497('0x12')](_0xf497('0x26'),null,_0xf497('0x32')+_0x29cdc5+'.CmListId')[_0xf497('0x12')](_0x486f95,null,_0x486f95+_0xf497('0x13')+_0x29cdc5+'.'+_0x1f695b)[_0xf497('0x12')](_0x32c4b7,null,_0x32c4b7+_0xf497('0x13')+_0x29cdc5+'.'+_0x1f695b)['where'](_0x29cdc5+'.CmListId\x20=\x20?',_0x274281)[_0xf497('0x14')](_0xf497('0x27'),NOW)[_0xf497('0x14')](_0xf497('0x2a'),selectNotIn(_0x29cdc5,_0x486f95,_0x1f695b,_0xf497('0x28'),[_0xf497('0x2b'),'\x22onlyIfOpen\x22']))[_0xf497('0x14')](_0xf497('0x2a'),selectNotIn(_0x29cdc5,_0x486f95,_0x1f695b,'cm_hopper',[_0xf497('0x2b')])))[_0xf497('0x2c')]();return _0x5228b7;}function insertTzCmHopperBlack(_0x5a4937,_0x9b440,_0x1507bc,_0x4761ed){var _0x28cd4a=['cm_contacts.phone',_0xf497('0x19'),_0xf497('0x2d'),_0x9b440+'.'+_0x4761ed,_0xf497('0x1a'),_0xf497('0x1b')];return squel[_0xf497('0x1e')]()['into']('cm_hopper_black')[_0xf497('0x20')]([_0xf497('0x10'),'ContactId',_0xf497('0x22'),_0x4761ed,'createdAt',_0xf497('0x30')],squel[_0xf497('0xe')]()[_0xf497('0x31')](_0x28cd4a)['from'](_0x9b440)[_0xf497('0x12')]('cm_contacts',null,_0xf497('0x32')+_0x9b440+'.CmListId')['join'](_0x1507bc,null,_0x1507bc+_0xf497('0x13')+_0x9b440+'.'+_0x4761ed)[_0xf497('0x14')](_0x9b440+_0xf497('0x33'),_0x5a4937)[_0xf497('0x14')](_0xf497('0x27'),NOW)[_0xf497('0x14')](_0xf497('0x2a'),squel['select']()['field']('phone')['from']('cm_hopper_black')[_0xf497('0x14')]('ListId\x20=\x20?',_0x5a4937)[_0xf497('0x14')](_0x4761ed+'\x20=\x20?',_0x9b440+'.'+_0x4761ed)))['toString']();}function insertCmContact(_0x3a91ae,_0x4bc423,_0x1a51dd,_0x445c48){var _0x40d891=_[_0xf497('0x38')](_[_0xf497('0x39')](_0x445c48),[_0xf497('0x22'),'CompanyId',_0xf497('0x23'),_0xf497('0x30')]);return squel[_0xf497('0x1e')]()[_0xf497('0x1f')](_0xf497('0x26'))[_0xf497('0x20')](_0x40d891,squel[_0xf497('0xe')]()['fields'](_0x40d891)[_0xf497('0x11')](_0x4bc423)[_0xf497('0x14')]('('+_0x1a51dd[_0xf497('0x12')](',')+_0xf497('0x3a'),squel[_0xf497('0xe')]()[_0xf497('0x31')](_0x1a51dd)[_0xf497('0x11')](_0xf497('0x26'))[_0xf497('0x14')]('ListId\x20=\x20?',_0x3a91ae)[_0xf497('0x14')]('deletedAt\x20IS\x20NULL'))[_0xf497('0x14')](_0xf497('0x3b'),squel[_0xf497('0xe')]()['field'](_0xf497('0x3c'),_0xf497('0x3d'))[_0xf497('0x11')](_0x4bc423)['group'](_0x1a51dd['join'](','))))[_0xf497('0x2c')]();}function handleStop(){logger[_0xf497('0x3e')](_0xf497('0x3f'));stopped=!![];}function handleUncaughtException(_0x318696){logger[_0xf497('0x40')](_0x318696[_0xf497('0x41')]);process['exit'](0x1);}function handleError(_0x484095,_0x34a55a){stats[_0xf497('0x42')][_0xf497('0x43')]({'name':_0x34a55a[_0xf497('0x44')],'message':_0x34a55a[_0xf497('0x41')],'row':_0x484095});}function handleQuery(_0x2769b1){logger[_0xf497('0x3e')](_0x2769b1);return db[_0xf497('0x45')][_0xf497('0x46')](_0x2769b1)[_0xf497('0x47')](function(_0x26105a){results[_0xf497('0x43')](_0x26105a);})['catch'](function(_0x22b21a){logger[_0xf497('0x40')](_0x22b21a[_0xf497('0x41')]);});}function updateTzCampaigns(_0x39dc82){return new Promise(function(_0x1f860,_0x52b06d){var _0x5e5866=squel[_0xf497('0xe')]()[_0xf497('0x31')]([_0xf497('0x48'),_0xf497('0x49')])[_0xf497('0x11')](_0xf497('0x4a'))['join'](_0xf497('0x4b'),null,_0xf497('0x4c'))['where'](_0xf497('0x4d')+_0x39dc82);db['sequelize'][_0xf497('0x46')](_0x5e5866['toString']())['spread'](function(_0x1f5f8c){var _0xbcf941=[];for(var _0x3484c4=0x0;_0x3484c4<_0x1f5f8c[_0xf497('0x4e')];_0x3484c4++){_0xbcf941[_0xf497('0x43')](getTimezoneData(_0x1f5f8c[_0x3484c4],tmp_campaigns));}BPromise[_0xf497('0x4f')](_0xbcf941)['then'](function(){_0x1f860({'val':0x1});});})[_0xf497('0x50')](function(_0x3ff174){logger['error'](_0x3ff174['message']);_0x1f860({'val':0x0});});});}function updateTzVoiceQueues(_0x4dce31){return new Promise(function(_0x1673c5,_0x4fc477){var _0x11e734=squel[_0xf497('0xe')]()['fields']([_0xf497('0x51'),_0xf497('0x52')])[_0xf497('0x11')]('voice_queues')[_0xf497('0x12')](_0xf497('0x53'),null,_0xf497('0x54'))[_0xf497('0x14')](_0xf497('0x55')+_0x4dce31);db[_0xf497('0x45')][_0xf497('0x46')](_0x11e734[_0xf497('0x2c')]())[_0xf497('0x47')](function(_0x3231f1){var _0x3a3fb7=[];for(var _0x24b702=0x0;_0x24b702<_0x3231f1[_0xf497('0x4e')];_0x24b702++){_0x3a3fb7[_0xf497('0x43')](getTimezoneData(_0x3231f1[_0x24b702],tmp_voice_queues));}BPromise['all'](_0x3a3fb7)[_0xf497('0x56')](function(){_0x1673c5({'val':0x1});});})[_0xf497('0x50')](function(_0x105421){logger[_0xf497('0x40')](_0x105421['message']);_0x1673c5({'val':0x0});});});}function getTimezoneData(_0x26a6e7,_0x3c7db4){return new Promise(function(_0x4f370d,_0x2a82f4){var _0x4f9f70=shared[_0xf497('0x57')];var _0x3161b5=_0x4f9f70[_0x26a6e7['dialTimezone']];if(_['isNil'](_0x3161b5)){_0x4f370d({'ret':0x1});}else{var _0x5297af=_0x3161b5[_0xf497('0x58')];var _0x5e1a47=squel['insert']()['into'](_0x3c7db4)['set']('id',_0x26a6e7['id'])['set'](_0xf497('0x59'),_0x5297af)[_0xf497('0x5a')](_0xf497('0x5b'),_0x26a6e7[_0xf497('0x5b')])[_0xf497('0x2c')]();return db[_0xf497('0x45')][_0xf497('0x46')](_0x5e1a47)[_0xf497('0x47')](function(_0xac442d){_0x4f370d({'ret':0x1});})[_0xf497('0x50')](function(_0x3eaac7){logger['error'](_0x3eaac7[_0xf497('0x41')]);_0x2a82f4({'ret':0x1});});}});}function handleTZQuery(_0x5600fa){logger[_0xf497('0x3e')](_0x5600fa);return db['sequelize']['query'](_0x5600fa)[_0xf497('0x47')](function(_0x1cc43b){})['catch'](function(_0x427d53){logger[_0xf497('0x40')](_0x427d53[_0xf497('0x41')]);});}function main(_0x50b8d7,_0x256edb,_0x1ecfb8,_0x2091ab){logger[_0xf497('0x3e')](_0xf497('0x5c'),_0x50b8d7,JSON[_0xf497('0x5d')](_0x256edb));process[_0xf497('0x5e')](_0xf497('0x5f'));var _0x1ade2c=_0x256edb[_0xf497('0x60')];var _0x1ab4ad=_0x256edb[_0xf497('0x61')];var _0x379c6a=path[_0xf497('0x12')](config[_0xf497('0x62')],'server/files/tmp',_0x1ab4ad+_0xf497('0x63'));hasTZ=_[_0xf497('0x39')](_0x1ade2c)['includes'](_0xf497('0x5b'));var _0x297ff6=_['keys'](_0x1ade2c)[_0xf497('0x12')]();logger['info'](_0xf497('0x64'),_0x297ff6);if(hasTZ)_0x297ff6+=_0xf497('0x65');fs[_0xf497('0x66')](_0x379c6a,_0x297ff6+'\x0a');Papa[_0xf497('0x67')](fs['createReadStream'](_0x50b8d7),{'header':!![],'skipEmptyLines':!![],'step':function(_0x49fc62,_0x53aeb0){try{for(var _0xbd004=0x0,_0x22313d=[];_0xbd004<_0x49fc62[_0xf497('0x68')][_0xf497('0x4e')];_0xbd004++){stats[_0xf497('0x69')]+=0x1;if(_0x49fc62[_0xf497('0x42')][_0xbd004]){handleError(_0x49fc62[_0xf497('0x68')][_0xbd004],_0x49fc62[_0xf497('0x42')][_0xbd004]);}else{var _0x14cc72=[];for(var _0x317865 in _0x1ade2c){if(_0x1ade2c[_0xf497('0x6a')](_0x317865)){if(_0x49fc62[_0xf497('0x68')][_0xbd004][_0x1ade2c[_0x317865]]){var _0x3bd3e1=_[_0xf497('0x6b')](_0x49fc62['data'][_0xbd004][_0x1ade2c[_0x317865]]['replace'](/"/g,'\x27'));switch(_0x317865){case _0xf497('0x21'):var _0x16b3cd=moment(_0x3bd3e1,_0xf497('0xc'),!![]);if(_0x16b3cd[_0xf497('0x6c')]()){_0x22313d[_0xf497('0x43')]('\x22'+_0x3bd3e1+'\x22');}else{_0x14cc72['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x548af7=parseInt(_0x3bd3e1);_0x3bd3e1=_[_0xf497('0x6d')](_0x548af7)||_0x548af7<0x0||_0x548af7>0x4?_0x2091ab?0x3:0x2:_0x548af7;_0x22313d[_0xf497('0x43')]('\x22'+_0x3bd3e1+'\x22');break;case'UserId':var _0x23fcf0=parseInt(_0x3bd3e1);if(_['isNumber'](_0x23fcf0)&&_[_0xf497('0x6e')](_0x1ecfb8,_0x23fcf0)){_0x22313d['push']('\x22'+_0x23fcf0+'\x22');}else{_0x14cc72[_0xf497('0x43')](_0xf497('0x6f'));}break;case _0xf497('0x70'):if(isEmail(_0x3bd3e1)){_0x22313d['push']('\x22'+_0x3bd3e1+'\x22');}else{_0x14cc72[_0xf497('0x43')](_0xf497('0x71'));}break;case _0xf497('0x72'):var _0x1b49a4=moment(_0x3bd3e1,_0xf497('0x73'),!![]);if(_0x1b49a4[_0xf497('0x6c')]()){_0x22313d['push']('\x22'+_0x3bd3e1+'\x22');}else{_0x14cc72[_0xf497('0x43')](_0xf497('0x74'));}break;case _0xf497('0x5b'):var _0x1dadd5=shared[_0xf497('0x57')];var _0x527b21=_0x1dadd5[_0x3bd3e1];if(!_[_0xf497('0x75')](_0x527b21)){var _0x20359f=_0x527b21[_0xf497('0x58')];_0x22313d[_0xf497('0x43')]('\x22'+_0x3bd3e1+'\x22');_0x22313d[_0xf497('0x43')]('\x22'+_0x20359f+'\x22');}break;default:_0x22313d['push']('\x22'+_0x3bd3e1+'\x22');}}else{switch(_0x317865){case _0xf497('0x76'):case _0xf497('0x10'):_0x14cc72[_0xf497('0x43')](_0x317865+_0xf497('0x77'));break;default:_0x22313d['push']('\x22\x22');}}}}if(_0x14cc72[_0xf497('0x4e')]){handleError(_0x49fc62['data'][_0xbd004],{'code':_0xf497('0x78'),'message':_0x14cc72[_0xf497('0x12')]()});}else{fs[_0xf497('0x79')](_0x379c6a,_0x22313d[_0xf497('0x12')]()+'\x0a');}_0x22313d=[];}if(!(stats[_0xf497('0x69')]%0xc8)){socket['emit'](_0xf497('0x7a')+_0x1ab4ad,stats);stats[_0xf497('0x42')]=[];}}if(stopped){logger[_0xf497('0x3e')](_0xf497('0x7b'));_0x53aeb0['abort']();}}catch(_0x883ba7){handleError(_0x49fc62[_0xf497('0x68')][_0xbd004],{'code':_0xf497('0x7c'),'message':_0x883ba7[_0xf497('0x41')]});logger[_0xf497('0x40')](_0xf497('0x7d'),_0x883ba7[_0xf497('0x41')]);}},'complete':function(){try{var _0x32bbca=[];var _0x3c26a8=[];var _0x48ff4d=_0xf497('0x26');if(_0x256edb['duplicates']&&_0x256edb['duplicates'][_0xf497('0x4e')]){_0x48ff4d=_0xf497('0x7e')+_0x1ab4ad;_0x32bbca[_0xf497('0x43')](_0xf497('0x7f')+_0x48ff4d+_0xf497('0x80'));}tmp_campaigns='campaigns_'+_0x1ab4ad;tmp_voice_queues='voice_queues_'+_0x1ab4ad;_0x3c26a8[_0xf497('0x43')](_0xf497('0x7f')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x3c26a8[_0xf497('0x43')](_0xf497('0x7f')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xf497('0x81')](_0x3c26a8,handleTZQuery)[_0xf497('0x56')](function(_0x469b84){updateTzCampaigns(_0x256edb[_0xf497('0x22')])[_0xf497('0x56')](function(_0x348d56){updateTzVoiceQueues(_0x256edb[_0xf497('0x22')])[_0xf497('0x56')](function(_0x2d18f0){var _0x26c0c7=util[_0xf497('0x82')](_0xf497('0x83'),_0x379c6a,_0x48ff4d,_0x297ff6,_0x256edb[_0xf497('0x22')],_0x256edb[_0xf497('0x84')]||null,NOW,NOW);if(_[_0xf497('0x75')](_0x1ade2c[_0xf497('0x21')])){_0x26c0c7+=_0xf497('0x85');}_0x32bbca[_0xf497('0x43')](_0x26c0c7);if(_0x256edb[_0xf497('0x86')]&&_0x256edb[_0xf497('0x86')][_0xf497('0x4e')]){_0x32bbca[_0xf497('0x43')](insertCmContact(_0x256edb['ListId'],_0x48ff4d,_0x256edb[_0xf497('0x86')],_0x1ade2c));_0x32bbca[_0xf497('0x43')](_0xf497('0x87')+_0x48ff4d+';');}if(hasTZ){_0x32bbca[_0xf497('0x43')](insertTzCmHopper(_0x256edb[_0xf497('0x22')],_0xf497('0x53'),_0xf497('0x88'),_0xf497('0x89'),_0x2091ab,tmp_voice_queues));_0x32bbca['push'](insertTzCmHopperBlack(_0x256edb[_0xf497('0x22')],_0xf497('0x8a'),'voice_queues','VoiceQueueId'));_0x32bbca['push'](insertTzCmHopper(_0x256edb['ListId'],'campaigns_has_cm_lists',_0xf497('0x4a'),'CampaignId',_0x2091ab,tmp_campaigns));_0x32bbca[_0xf497('0x43')](insertTzCmHopperBlack(_0x256edb[_0xf497('0x22')],_0xf497('0x8b'),_0xf497('0x4a'),_0xf497('0x8c')));}else{_0x32bbca[_0xf497('0x43')](insertCmHopper(_0x256edb[_0xf497('0x22')],_0xf497('0x53'),_0xf497('0x88'),_0xf497('0x89'),_0x2091ab));_0x32bbca[_0xf497('0x43')](insertCmHopperBlack(_0x256edb[_0xf497('0x22')],'voice_queues_has_cm_blacklists','voice_queues',_0xf497('0x89')));_0x32bbca[_0xf497('0x43')](insertCmHopper(_0x256edb[_0xf497('0x22')],_0xf497('0x4b'),_0xf497('0x4a'),'CampaignId',_0x2091ab));_0x32bbca['push'](insertCmHopperBlack(_0x256edb[_0xf497('0x22')],_0xf497('0x8b'),'campaigns',_0xf497('0x8c')));}_0x32bbca[_0xf497('0x43')](_0xf497('0x87')+tmp_campaigns+';');_0x32bbca['push'](_0xf497('0x87')+tmp_voice_queues+';');BPromise['each'](_0x32bbca,handleQuery)['then'](function(_0x1f2af3){stats[_0xf497('0x8d')]=!![];stats[_0xf497('0x8e')]=_0x256edb[_0xf497('0x86')]&&_0x256edb[_0xf497('0x86')]['length']?results[0x2]['affectedRows']:results[0x0][_0xf497('0x8e')];socket[_0xf497('0x8f')](_0xf497('0x7a')+_0x1ab4ad,stats);fs[_0xf497('0x90')](_0x50b8d7);fs[_0xf497('0x90')](_0x379c6a);process['exit'](0x0);})['catch'](function(_0x44b50f){logger['error'](_0x44b50f[_0xf497('0x41')]);process['exit'](0x1);});});});});}catch(_0x509687){logger[_0xf497('0x40')]('complete',_0x509687[_0xf497('0x41')]);process[_0xf497('0x91')](0x1);}},'error':function(_0x394765,_0x1e005b,_0x47e828,_0x364fd0){throw new Error(_0x364fd0);}});}function validate(){if(process[_0xf497('0x92')]&&process['argv'][_0xf497('0x4e')]<0x4){throw new Error(_0xf497('0x93'));}var _0x5aea73=path[_0xf497('0x12')](config[_0xf497('0x62')],_0xf497('0x94'),process['argv'][0x2]);if(!fs['existsSync'](_0x5aea73)){throw new Error(_0xf497('0x95'));}var _0xac7de={};try{_0xac7de=JSON[_0xf497('0x67')](process[_0xf497('0x92')][0x3]);if(!_0xac7de[_0xf497('0x60')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0xac7de[_0xf497('0x60')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0xac7de[_0xf497('0x60')][_0xf497('0x76')]){throw new Error(_0xf497('0x96'));}var _0x8448ec=0x0;if(_0xac7de[_0xf497('0x60')]['UserId']){_0x8448ec=0x1;}if(!_0xac7de[_0xf497('0x22')]){throw new Error(_0xf497('0x97'));}}catch(_0x269026){throw new Error(_0xf497('0x98'));}var _0x508d76=[];try{_0x508d76=_[_0xf497('0x99')](JSON['parse'](process[_0xf497('0x92')][0x4]),'id');}catch(_0x5674ce){logger[_0xf497('0x3e')](_0xf497('0x9a'));}main(_0x5aea73,_0xac7de,_0x508d76,_0x8448ec);}validate();process['on'](_0xf497('0x9b'),handleStop);process['on'](_0xf497('0x9c'),handleUncaughtException);
\ No newline at end of file
index 88a1117..1e9f869 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc065=['getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','Duration','Billable\x20Time'];(function(_0x23c642,_0x3c8028){var _0x5078ff=function(_0x14c380){while(--_0x14c380){_0x23c642['push'](_0x23c642['shift']());}};_0x5078ff(++_0x3c8028);}(_0xc065,0x1ef));var _0x5c06=function(_0x2b1617,_0x3fea81){_0x2b1617=_0x2b1617-0x0;var _0x365d36=_0xc065[_0x2b1617];return _0x365d36;};'use strict';exports[_0x5c06('0x0')]=function(_0x4048c6,_0x19e572){var _0x2a03eb=[{'type':_0x5c06('0x1'),'content':_0x5c06('0x2'),'variableName':null}];switch(_0x4048c6[_0x5c06('0x3')]()){case _0x5c06('0x4'):switch(_0x19e572[_0x5c06('0x3')]()){case _0x5c06('0x5'):_0x2a03eb[_0x5c06('0x6')]({'type':'variable','content':'','variableName':_0x5c06('0x7')});_0x2a03eb['push']({'type':_0x5c06('0x8'),'content':'','variableName':_0x5c06('0x9')});break;case _0x5c06('0xa'):_0x2a03eb[_0x5c06('0x6')]({'type':_0x5c06('0x1'),'content':_0x5c06('0xb'),'variableName':null});_0x2a03eb['push']({'type':_0x5c06('0x8'),'content':'','variableName':_0x5c06('0xc')});break;}}return _0x2a03eb;};exports[_0x5c06('0xd')]=function(_0x5c525d,_0x34735a){var _0x1856f3=[];switch(_0x5c525d[_0x5c06('0x3')]()){case _0x5c06('0x4'):switch(_0x34735a['toLowerCase']()){case'inbound':_0x1856f3=[{'type':'string','content':_0x5c06('0xe'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x5c06('0xf'),'keyType':_0x5c06('0x8'),'variableName':_0x5c06('0x9')},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x11'),'keyType':_0x5c06('0x8'),'variableName':_0x5c06('0x12')},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x13'),'keyType':'variable','variableName':_0x5c06('0x14')},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x15'),'keyType':_0x5c06('0x8'),'variableName':'queue'},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x16'),'keyType':'variable','variableName':_0x5c06('0x17')},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x18'),'keyType':_0x5c06('0x8'),'variableName':_0x5c06('0x19')},{'type':_0x5c06('0x1'),'content':_0x5c06('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x1b'),'keyType':_0x5c06('0x8'),'variableName':_0x5c06('0x1c')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0x5c06('0x8'),'variableName':'destcalleridnum'},{'type':_0x5c06('0x1'),'content':_0x5c06('0x1d'),'key':null,'keyType':null,'variableName':null},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x1e'),'keyType':_0x5c06('0x8'),'variableName':_0x5c06('0x19')},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x1f'),'keyType':_0x5c06('0x8'),'variableName':_0x5c06('0x20')},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x21'),'keyType':_0x5c06('0x8'),'variableName':_0x5c06('0x22')},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x23'),'keyType':_0x5c06('0x8'),'variableName':_0x5c06('0x24')},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x25'),'keyType':'variable','variableName':'talktime'}];break;case'outbound':_0x1856f3=[{'type':_0x5c06('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x26'),'keyType':_0x5c06('0x8'),'keyContent':'','variableName':_0x5c06('0xc')},{'type':'keyValue','content':'','key':_0x5c06('0x27'),'keyType':_0x5c06('0x8'),'keyContent':'','variableName':'membername'},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x16'),'keyType':'variable','keyContent':'','variableName':_0x5c06('0x17')},{'type':'keyValue','content':'','key':_0x5c06('0x18'),'keyType':_0x5c06('0x8'),'keyContent':'','variableName':_0x5c06('0x28')},{'type':_0x5c06('0x1'),'content':_0x5c06('0x1d')},{'type':'keyValue','content':'','key':_0x5c06('0x29'),'keyType':_0x5c06('0x8'),'keyContent':'','variableName':'answertime'},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x2a'),'keyType':_0x5c06('0x8'),'keyContent':'','variableName':'endtime'},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x2b'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0x5c06('0x10'),'content':'','key':_0x5c06('0x2c'),'keyType':_0x5c06('0x8'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x1856f3;};
\ No newline at end of file
+var _0x3d79=['Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','string','Outbound\x20Call','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt'];(function(_0x16a7bc,_0x3ee4fb){var _0x54e51d=function(_0x37aa57){while(--_0x37aa57){_0x16a7bc['push'](_0x16a7bc['shift']());}};_0x54e51d(++_0x3ee4fb);}(_0x3d79,0x181));var _0x93d7=function(_0x5979f9,_0x57f9ad){_0x5979f9=_0x5979f9-0x0;var _0x1b583a=_0x3d79[_0x5979f9];return _0x1b583a;};'use strict';exports[_0x93d7('0x0')]=function(_0x1b6d73,_0xd21e7){var _0x49dc1a=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1b6d73[_0x93d7('0x1')]()){case _0x93d7('0x2'):switch(_0xd21e7[_0x93d7('0x1')]()){case _0x93d7('0x3'):_0x49dc1a[_0x93d7('0x4')]({'type':_0x93d7('0x5'),'content':'','variableName':'queue'});_0x49dc1a['push']({'type':_0x93d7('0x5'),'content':'','variableName':_0x93d7('0x6')});break;case _0x93d7('0x7'):_0x49dc1a['push']({'type':_0x93d7('0x8'),'content':_0x93d7('0x9'),'variableName':null});_0x49dc1a[_0x93d7('0x4')]({'type':_0x93d7('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x49dc1a;};exports['getDescriptions']=function(_0x3fc61b,_0x3272d5){var _0xcba730=[];switch(_0x3fc61b[_0x93d7('0x1')]()){case'voice':switch(_0x3272d5[_0x93d7('0x1')]()){case _0x93d7('0x3'):_0xcba730=[{'type':_0x93d7('0x8'),'content':_0x93d7('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0xc'),'keyType':_0x93d7('0x5'),'variableName':'calleridnum'},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0xd'),'keyType':_0x93d7('0x5'),'variableName':_0x93d7('0xe')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0xf'),'keyType':'variable','variableName':'destexten'},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x10'),'keyType':_0x93d7('0x5'),'variableName':_0x93d7('0x11')},{'type':'keyValue','content':'','key':_0x93d7('0x12'),'keyType':_0x93d7('0x5'),'variableName':_0x93d7('0x13')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x14'),'keyType':_0x93d7('0x5'),'variableName':_0x93d7('0x15')},{'type':'string','content':_0x93d7('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x93d7('0xb'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0x93d7('0x17')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x18'),'keyType':_0x93d7('0x5'),'variableName':'destcalleridnum'},{'type':_0x93d7('0x8'),'content':_0x93d7('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x93d7('0x1a'),'keyType':'variable','variableName':_0x93d7('0x15')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x1b'),'keyType':_0x93d7('0x5'),'variableName':_0x93d7('0x1c')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x1d'),'keyType':_0x93d7('0x5'),'variableName':_0x93d7('0x1e')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x1f'),'keyType':_0x93d7('0x5'),'variableName':_0x93d7('0x20')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x21'),'keyType':_0x93d7('0x5'),'variableName':_0x93d7('0x22')}];break;case _0x93d7('0x7'):_0xcba730=[{'type':_0x93d7('0x8'),'content':_0x93d7('0xa'),'variableName':null},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x23'),'keyType':_0x93d7('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x24'),'keyType':_0x93d7('0x5'),'keyContent':'','variableName':_0x93d7('0x25')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x12'),'keyType':_0x93d7('0x5'),'keyContent':'','variableName':_0x93d7('0x13')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x14'),'keyType':_0x93d7('0x5'),'keyContent':'','variableName':_0x93d7('0x26')},{'type':_0x93d7('0x8'),'content':_0x93d7('0x19')},{'type':'keyValue','content':'','key':_0x93d7('0x27'),'keyType':'variable','keyContent':'','variableName':_0x93d7('0x28')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x29'),'keyType':_0x93d7('0x5'),'keyContent':'','variableName':_0x93d7('0x2a')},{'type':_0x93d7('0xb'),'content':'','key':_0x93d7('0x2b'),'keyType':_0x93d7('0x5'),'keyContent':'','variableName':_0x93d7('0x2c')},{'type':_0x93d7('0xb'),'content':'','key':'Billable\x20Time','keyType':_0x93d7('0x5'),'keyContent':'','variableName':_0x93d7('0x2d')}];break;}}return _0xcba730;};
\ No newline at end of file
index ffe1c23..634b82d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4702=['upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','Interaction','findOne','update','info','error','tracked','query','clone','body','html','phone','fax','mobile','lodash','../../config/logger','mail-interactions','whatsapp-interactions','InteractionId'];(function(_0x8eac1c,_0x4369d6){var _0x77e112=function(_0x3123ad){while(--_0x3123ad){_0x8eac1c['push'](_0x8eac1c['shift']());}};_0x77e112(++_0x4369d6);}(_0x4702,0x19b));var _0x2470=function(_0x2107f7,_0x5d654e){_0x2107f7=_0x2107f7-0x0;var _0x5df621=_0x4702[_0x2107f7];return _0x5df621;};'use strict';var _=require(_0x2470('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x2470('0x1'))('openchannel-interactions'),'mail':require(_0x2470('0x1'))(_0x2470('0x2')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x2470('0x1'))('sms-interactions'),'chat':require(_0x2470('0x1'))('chat-interactions'),'whatsapp':require(_0x2470('0x1'))(_0x2470('0x3'))};function getInteractionId(_0xc63bc3,_0x2495b5,_0x3d6333){if(_0xc63bc3&&_0xc63bc3[_['upperFirst'](_0x3d6333)+_0x2470('0x4')]){return _0xc63bc3[_[_0x2470('0x5')](_0x3d6333)+_0x2470('0x4')];}else if(_0xc63bc3&&_0xc63bc3['id']){return _0xc63bc3['id'];}else if(_0x2495b5&&_0x2495b5['id']){return _0x2495b5['id'];}else{return _0x2470('0x6');}}function log(_0x580ce2,_0x294e97,_0x2cc2ee,_0x3eca22,_0x2fd4ab,_0x453419){loggers[_0x2fd4ab[_0x2470('0x7')]()][_0x580ce2](_0x2470('0x8'),_0x453419[_0x2470('0x9')](),_0x294e97?_0x294e97['id']:null,_0x294e97?_0x294e97['name']:null,_0x294e97?_0x294e97[_0x2470('0xa')]:null,getInteractionId(_0x2cc2ee,_0x3eca22,_0x2fd4ab),_0x2cc2ee?JSON[_0x2470('0xb')](_0x2cc2ee):_0x2470('0xc'));}function updateUser(_0x3f65f7,_0x185802,_0x1739a4,_0xe86b25,_0x346e36){db[_[_0x2470('0x5')](_0xe86b25)+_0x2470('0xd')][_0x2470('0xe')]({'where':{'id':getInteractionId(_0x185802,_0x1739a4,_0xe86b25)}})['then'](function(_0x5d50d3){if(_0x5d50d3){return _0x5d50d3[_0x2470('0xf')]({'UserId':_0x3f65f7?_0x3f65f7['id']:null});}})['then'](function(_0xa41734){if(_0xa41734){log(_0x2470('0x10'),_0x3f65f7,_0x185802,_0x1739a4,_0xe86b25,_0x346e36);}})['catch'](function(){log(_0x2470('0x11'),_0x3f65f7,_0x185802,_0x1739a4,_0xe86b25,_0x346e36);});}exports[_0x2470('0x12')]=function(_0x3fa567,_0x26bf99){return function(_0x51b74a,_0x37f5cd,_0x325f96){var _0x1cdef7=_0x51b74a['user'];var _0x2d86be={};var _0x2a1533=_0x51b74a[_0x2470('0x13')];if(_0x2d86be){_0x2d86be=_[_0x2470('0x14')](_0x51b74a[_0x2470('0x15')]);_0x2d86be=_['omit'](_0x2d86be,[_0x2470('0x15'),_0x2470('0x16'),_0x2470('0x17'),_0x2470('0x18'),_0x2470('0x19')]);}updateUser(_0x1cdef7,_0x2d86be,_0x2a1533,_0x3fa567,_0x26bf99);_0x325f96(null);};};
\ No newline at end of file
+var _0xe5bd=['role','stringify','null','findOne','then','update','error','tracked','user','query','body','phone','fax','mobile','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name'];(function(_0x3c9fd1,_0x56e07a){var _0x196e02=function(_0x57f60b){while(--_0x57f60b){_0x3c9fd1['push'](_0x3c9fd1['shift']());}};_0x196e02(++_0x56e07a);}(_0xe5bd,0xde));var _0xde5b=function(_0xdcd7ef,_0x2d7087){_0xdcd7ef=_0xdcd7ef-0x0;var _0x44a587=_0xe5bd[_0xdcd7ef];return _0x44a587;};'use strict';var _=require('lodash');var db=require(_0xde5b('0x0'))['db'];var loggers={'openchannel':require(_0xde5b('0x1'))('openchannel-interactions'),'mail':require(_0xde5b('0x1'))(_0xde5b('0x2')),'fax':require('../../config/logger')(_0xde5b('0x3')),'sms':require(_0xde5b('0x1'))('sms-interactions'),'chat':require('../../config/logger')(_0xde5b('0x4')),'whatsapp':require(_0xde5b('0x1'))(_0xde5b('0x5'))};function getInteractionId(_0xd5746b,_0x4f1ca6,_0x11107d){if(_0xd5746b&&_0xd5746b[_['upperFirst'](_0x11107d)+_0xde5b('0x6')]){return _0xd5746b[_[_0xde5b('0x7')](_0x11107d)+_0xde5b('0x6')];}else if(_0xd5746b&&_0xd5746b['id']){return _0xd5746b['id'];}else if(_0x4f1ca6&&_0x4f1ca6['id']){return _0x4f1ca6['id'];}else{return _0xde5b('0x8');}}function log(_0xd49acd,_0x3481f1,_0x29dffb,_0x72f6f7,_0x258893,_0x9d7200){loggers[_0x258893[_0xde5b('0x9')]()][_0xd49acd](_0xde5b('0xa'),_0x9d7200['toUpperCase'](),_0x3481f1?_0x3481f1['id']:null,_0x3481f1?_0x3481f1[_0xde5b('0xb')]:null,_0x3481f1?_0x3481f1[_0xde5b('0xc')]:null,getInteractionId(_0x29dffb,_0x72f6f7,_0x258893),_0x29dffb?JSON[_0xde5b('0xd')](_0x29dffb):_0xde5b('0xe'));}function updateUser(_0x2aa952,_0x493bf7,_0x1a9098,_0x48d3d8,_0x32018b){db[_[_0xde5b('0x7')](_0x48d3d8)+'Interaction'][_0xde5b('0xf')]({'where':{'id':getInteractionId(_0x493bf7,_0x1a9098,_0x48d3d8)}})[_0xde5b('0x10')](function(_0x15e0a5){if(_0x15e0a5){return _0x15e0a5[_0xde5b('0x11')]({'UserId':_0x2aa952?_0x2aa952['id']:null});}})['then'](function(_0x5d1ccf){if(_0x5d1ccf){log('info',_0x2aa952,_0x493bf7,_0x1a9098,_0x48d3d8,_0x32018b);}})['catch'](function(){log(_0xde5b('0x12'),_0x2aa952,_0x493bf7,_0x1a9098,_0x48d3d8,_0x32018b);});}exports[_0xde5b('0x13')]=function(_0x4a585e,_0x35cb2b){return function(_0x5b7dc8,_0x5661fd,_0x4f29d7){var _0x4d41a5=_0x5b7dc8[_0xde5b('0x14')];var _0xb00fc={};var _0x15e545=_0x5b7dc8[_0xde5b('0x15')];if(_0xb00fc){_0xb00fc=_['clone'](_0x5b7dc8[_0xde5b('0x16')]);_0xb00fc=_['omit'](_0xb00fc,[_0xde5b('0x16'),'html',_0xde5b('0x17'),_0xde5b('0x18'),_0xde5b('0x19')]);}updateUser(_0x4d41a5,_0xb00fc,_0x15e545,_0x4a585e,_0x35cb2b);_0x4f29d7(null);};};
\ No newline at end of file
index 9048ab0..cf65feb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51bd=['json','format','catch','users','User','admin','user','isUserLimit','crypto','../../mysqldb','../../config/environment','data1','license','split','createDecipher','%s:%s:%s','update','utf8','parse','use','License','then','count','status'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x51bd,0x110));var _0xd51b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x51bd[_0x122ef9];return _0x42fba0;};'use strict';var crypto=require(_0xd51b('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0xd51b('0x1'))['db'];var config=require(_0xd51b('0x2'));function getValueFromLicense(_0x2acf43,_0xdb5253){if(_0x2acf43&&_0xdb5253){if(_0xdb5253[_0xd51b('0x3')]&&_0xdb5253[_0xd51b('0x4')]){var _0x5d784c=_0xdb5253['data1'];var _0x46656d=_0xdb5253[_0xd51b('0x4')];var _0x5e8cb1=_0x5d784c[_0xd51b('0x5')]('-')[0x4];var _0x2a29d3=_0x5d784c['split']('-')[0x0];var _0x1803dc=crypto[_0xd51b('0x6')]('aes-256-ctr',util['format'](_0xd51b('0x7'),_0x5e8cb1,_0x5d784c,_0x2a29d3));var _0x132b5a=_0x1803dc[_0xd51b('0x8')](_0x46656d,'base64',_0xd51b('0x9'));_0x132b5a+=_0x1803dc['final'](_0xd51b('0x9'));var _0x13f47d=JSON[_0xd51b('0xa')](_0x132b5a);return _0x13f47d['hasOwnProperty'](_0x2acf43)?_0x13f47d[_0x2acf43]:null;}}return null;}function isLimit(_0x357c6c,_0x318466,_0x1eb5b0,_0x471d19){var _0x30729c=_0x318466;return compose()[_0xd51b('0xb')](function(_0x2fa0e3,_0x2320e6,_0x1c5511){return db[_0xd51b('0xc')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xd51b('0xd')](function(_0x34a06d){var _0x2e1cf4=getValueFromLicense(_0x357c6c,_0x34a06d);return _0x2e1cf4?_0x2e1cf4:_0x30729c;})[_0xd51b('0xd')](function(_0x273cbb){_0x30729c=_0x273cbb;return _0x1eb5b0[_0xd51b('0xe')](_0x471d19);})[_0xd51b('0xd')](function(_0x3e94c9){if(_0x3e94c9>=_0x30729c){return _0x2320e6[_0xd51b('0xf')](0x193)[_0xd51b('0x10')]({'message':util[_0xd51b('0x11')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x357c6c)});}_0x1c5511();})[_0xd51b('0x12')](function(_0x45bb60){_0x1c5511(_0x45bb60);});});}function isUserLimit(){return isLimit(_0xd51b('0x13'),0x1,db[_0xd51b('0x14')],{'where':{'$or':[{'role':_0xd51b('0x15')},{'role':_0xd51b('0x16')}]}});}exports[_0xd51b('0x17')]=isUserLimit;
\ No newline at end of file
+var _0x8093=['parse','hasOwnProperty','use','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','final','utf8'];(function(_0x187684,_0x131dd4){var _0x393c49=function(_0x5e21c7){while(--_0x5e21c7){_0x187684['push'](_0x187684['shift']());}};_0x393c49(++_0x131dd4);}(_0x8093,0x112));var _0x3809=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x8093[_0x2d91c6];return _0x3a8d19;};'use strict';var crypto=require(_0x3809('0x0'));var util=require(_0x3809('0x1'));var compose=require('composable-middleware');var db=require(_0x3809('0x2'))['db'];var config=require(_0x3809('0x3'));function getValueFromLicense(_0x3d1b10,_0x305b9f){if(_0x3d1b10&&_0x305b9f){if(_0x305b9f[_0x3809('0x4')]&&_0x305b9f[_0x3809('0x5')]){var _0x15e12f=_0x305b9f[_0x3809('0x4')];var _0x3d8e95=_0x305b9f[_0x3809('0x5')];var _0x2d1108=_0x15e12f[_0x3809('0x6')]('-')[0x4];var _0x3efdfe=_0x15e12f[_0x3809('0x6')]('-')[0x0];var _0x3b74d0=crypto[_0x3809('0x7')]('aes-256-ctr',util[_0x3809('0x8')](_0x3809('0x9'),_0x2d1108,_0x15e12f,_0x3efdfe));var _0xc6b4b4=_0x3b74d0[_0x3809('0xa')](_0x3d8e95,_0x3809('0xb'),'utf8');_0xc6b4b4+=_0x3b74d0[_0x3809('0xc')](_0x3809('0xd'));var _0x1d3afa=JSON[_0x3809('0xe')](_0xc6b4b4);return _0x1d3afa[_0x3809('0xf')](_0x3d1b10)?_0x1d3afa[_0x3d1b10]:null;}}return null;}function isLimit(_0x77afdd,_0xf47093,_0x35ebd9,_0x2a4914){var _0x1ca870=_0xf47093;return compose()[_0x3809('0x10')](function(_0x4879d0,_0x21582b,_0x2f30cf){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x3809('0x11')](function(_0x4d7a54){var _0x508681=getValueFromLicense(_0x77afdd,_0x4d7a54);return _0x508681?_0x508681:_0x1ca870;})[_0x3809('0x11')](function(_0x2677a2){_0x1ca870=_0x2677a2;return _0x35ebd9['count'](_0x2a4914);})['then'](function(_0x5942e4){if(_0x5942e4>=_0x1ca870){return _0x21582b[_0x3809('0x12')](0x193)['json']({'message':util['format'](_0x3809('0x13'),_0x77afdd)});}_0x2f30cf();})[_0x3809('0x14')](function(_0x7f2f54){_0x2f30cf(_0x7f2f54);});});}function isUserLimit(){return isLimit(_0x3809('0x15'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x3809('0x16')}]}});}exports[_0x3809('0x17')]=isUserLimit;
\ No newline at end of file
index 73395af..e674130 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa313=['pop','utcOffset','add','hours','minutes','seconds','lodash','moment','sqlOperator','startsWith','[$or]','and','[$and]','replace','split','slice','match','indexOf','map','DATE','$eq','operator','$between','value','includes','$gt','format','YYYY-MM-DD','castTo','text','CAST(','field','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','start','shift'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa313,0x179));var _0x3a31=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0xa313[_0x212579];return _0x55d50e;};'use strict';var _=require(_0x3a31('0x0'));var moment=require(_0x3a31('0x1'));exports['parseSearch']=function(_0x5bbc35){var _0x4ff489={'conditions':[]};_0x4ff489[_0x3a31('0x2')]=_[_0x3a31('0x3')](_0x5bbc35,_0x3a31('0x4'))?'or':_0x3a31('0x5');var _0x3a7dcc=_0x5bbc35['replace'](_0x3a31('0x6'),'')[_0x3a31('0x7')]('[$or]','')['split']('||');for(var _0x1a226a=0x0;_0x1a226a<_0x3a7dcc['length'];_0x1a226a++){var _0x16eb4a=_0x3a7dcc[_0x1a226a][_0x3a31('0x8')](':=');var _0x14bb93=_0x16eb4a[0x0];var _0x282609=_0x16eb4a[_0x3a31('0x9')](0x1);_0x282609['forEach'](function(_0x56de1c){var _0x5873b3=_0x56de1c[_0x3a31('0x8')]('[')['shift']();var _0x4c739a=_0x56de1c[_0x3a31('0xa')](/\[(.*?)\]/g);_0x4c739a['forEach'](function(_0x3b5390){var _0x1624ec=_0x3b5390['split']('[')['filter'](function(_0xe8fe8b){return _0xe8fe8b[_0x3a31('0xb')](']')>-0x1;})[_0x3a31('0xc')](function(_0x2bafe4){return _0x2bafe4[_0x3a31('0x8')](']')[0x0];})[0x0];_0x4ff489['conditions']['push']({'field':_0x14bb93,'operator':_0x5873b3,'value':_0x1624ec});});});}return _0x4ff489;};exports['buildExpression']=function(_0xa8e029,_0x4038fb,_0x8dd8d0){var _0x5f573e={};if(_0x4038fb===_0x3a31('0xd')){if(_0x8dd8d0['operator']===_0x3a31('0xe')){_0x8dd8d0[_0x3a31('0xf')]=_0x3a31('0x10');_0x8dd8d0[_0x3a31('0x11')]+=','+_0x8dd8d0[_0x3a31('0x11')];}else if(_[_0x3a31('0x12')]([_0x3a31('0x13'),'$lte'],_0x8dd8d0[_0x3a31('0xf')])){_0x8dd8d0[_0x3a31('0x11')]=moment(_0x8dd8d0[_0x3a31('0x11')])['add'](0x1,'days')[_0x3a31('0x14')](_0x3a31('0x15'));}}if(_0x8dd8d0['castTo']){_0x4038fb=_0x8dd8d0[_0x3a31('0x16')];_0x5f573e[_0x3a31('0x17')]=_0x3a31('0x18')+_0xa8e029+'.'+_0x8dd8d0[_0x3a31('0x19')]+'\x20AS\x20'+_0x8dd8d0['castTo']+')\x20'+parseOperator(_0x8dd8d0[_0x3a31('0xf')]);}else{_0x5f573e[_0x3a31('0x17')]=_0xa8e029+'.'+_0x8dd8d0['field']+'\x20'+parseOperator(_0x8dd8d0[_0x3a31('0xf')]);}if(_[_0x3a31('0x12')](['$ne',_0x3a31('0x1a')],_0x8dd8d0[_0x3a31('0xf')]))_0x5f573e[_0x3a31('0x17')]='('+_0x5f573e[_0x3a31('0x17')]+_0x3a31('0x1b')+_0xa8e029+'.'+_0x8dd8d0[_0x3a31('0x19')]+'\x20IS\x20NULL)';_0x5f573e[_0x3a31('0x11')]=parseValue(_0x4038fb,_0x8dd8d0['operator'],_0x8dd8d0[_0x3a31('0x11')]);return _0x5f573e;};function parseOperator(_0x3a765e){var _0x47b242;switch(_0x3a765e){case _0x3a31('0x1c'):_0x47b242=_0x3a31('0x1d');break;case _0x3a31('0x1a'):_0x47b242=_0x3a31('0x1e');break;case _0x3a31('0xe'):_0x47b242=_0x3a31('0x1f');break;case _0x3a31('0x20'):_0x47b242=_0x3a31('0x21');break;case _0x3a31('0x22'):case _0x3a31('0x23'):case _0x3a31('0x24'):_0x47b242=_0x3a31('0x25');break;case _0x3a31('0x26'):_0x47b242=_0x3a31('0x27');break;case'$gt':_0x47b242=_0x3a31('0x28');break;case _0x3a31('0x29'):_0x47b242=_0x3a31('0x2a');break;case _0x3a31('0x2b'):_0x47b242=_0x3a31('0x2c');break;case'$between':_0x47b242='BETWEEN\x20?\x20AND\x20?';break;}return _0x47b242;}function parseValue(_0x100d77,_0x2301c3,_0x153860){var _0x370ad7={'start':undefined,'end':undefined};switch(_0x2301c3){case _0x3a31('0x1c'):case'$notIn':_0x370ad7[_0x3a31('0x2d')]=_0x153860[_0x3a31('0x8')](',');break;case _0x3a31('0x22'):_0x370ad7[_0x3a31('0x2d')]='%'+_0x153860+'%';break;case _0x3a31('0x23'):_0x370ad7[_0x3a31('0x2d')]=_0x153860+'%';break;case _0x3a31('0x24'):_0x370ad7[_0x3a31('0x2d')]='%'+_0x153860;break;case'$between':var _0x34e097=_0x153860[_0x3a31('0x8')](',');var _0x153860=_0x34e097[_0x3a31('0x2e')]();var _0x42133b=_0x34e097[_0x3a31('0x2f')]();if(_0x100d77===_0x3a31('0xd')){_0x153860=moment(_0x153860)['utcOffset'](0x0,!![])['format']();_0x42133b=moment(_0x42133b)[_0x3a31('0x30')](0x0,!![])[_0x3a31('0x31')](0x17,_0x3a31('0x32'))[_0x3a31('0x31')](0x3b,_0x3a31('0x33'))[_0x3a31('0x31')](0x3b,_0x3a31('0x34'))[_0x3a31('0x14')]();}_0x370ad7={'start':_0x153860,'end':_0x42133b};break;default:_0x370ad7[_0x3a31('0x2d')]=_0x153860;break;}return _0x370ad7;}
\ No newline at end of file
+var _0xa145=['$notIn','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','>\x20?','$lte','$gte','start','pop','DATE','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','shift','filter','indexOf','map','conditions','operator','$eq','$between','value','includes','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$ne'];(function(_0xa90e10,_0x377ff7){var _0xe61724=function(_0x3695b4){while(--_0x3695b4){_0xa90e10['push'](_0xa90e10['shift']());}};_0xe61724(++_0x377ff7);}(_0xa145,0x113));var _0x5a14=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xa145[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x5a14('0x0'));var moment=require(_0x5a14('0x1'));exports[_0x5a14('0x2')]=function(_0x386997){var _0x571b4d={'conditions':[]};_0x571b4d[_0x5a14('0x3')]=_[_0x5a14('0x4')](_0x386997,_0x5a14('0x5'))?'or':_0x5a14('0x6');var _0x97537a=_0x386997[_0x5a14('0x7')]('[$and]','')[_0x5a14('0x7')](_0x5a14('0x5'),'')[_0x5a14('0x8')]('||');for(var _0x28dc86=0x0;_0x28dc86<_0x97537a[_0x5a14('0x9')];_0x28dc86++){var _0x331e51=_0x97537a[_0x28dc86][_0x5a14('0x8')](':=');var _0x20c05c=_0x331e51[0x0];var _0x171633=_0x331e51[_0x5a14('0xa')](0x1);_0x171633[_0x5a14('0xb')](function(_0x5f0cee){var _0x6bdec5=_0x5f0cee[_0x5a14('0x8')]('[')[_0x5a14('0xc')]();var _0x3bb296=_0x5f0cee['match'](/\[(.*?)\]/g);_0x3bb296['forEach'](function(_0x1f3028){var _0x51d687=_0x1f3028[_0x5a14('0x8')]('[')[_0x5a14('0xd')](function(_0x1e9d44){return _0x1e9d44[_0x5a14('0xe')](']')>-0x1;})[_0x5a14('0xf')](function(_0xb2c05a){return _0xb2c05a[_0x5a14('0x8')](']')[0x0];})[0x0];_0x571b4d[_0x5a14('0x10')]['push']({'field':_0x20c05c,'operator':_0x6bdec5,'value':_0x51d687});});});}return _0x571b4d;};exports['buildExpression']=function(_0xdde064,_0x461fd3,_0xa4530f){var _0x4afe6a={};if(_0x461fd3==='DATE'){if(_0xa4530f[_0x5a14('0x11')]===_0x5a14('0x12')){_0xa4530f['operator']=_0x5a14('0x13');_0xa4530f[_0x5a14('0x14')]+=','+_0xa4530f[_0x5a14('0x14')];}else if(_[_0x5a14('0x15')](['$gt','$lte'],_0xa4530f['operator'])){_0xa4530f['value']=moment(_0xa4530f[_0x5a14('0x14')])[_0x5a14('0x16')](0x1,_0x5a14('0x17'))[_0x5a14('0x18')]('YYYY-MM-DD');}}if(_0xa4530f[_0x5a14('0x19')]){_0x461fd3=_0xa4530f[_0x5a14('0x19')];_0x4afe6a[_0x5a14('0x1a')]=_0x5a14('0x1b')+_0xdde064+'.'+_0xa4530f[_0x5a14('0x1c')]+_0x5a14('0x1d')+_0xa4530f[_0x5a14('0x19')]+')\x20'+parseOperator(_0xa4530f['operator']);}else{_0x4afe6a[_0x5a14('0x1a')]=_0xdde064+'.'+_0xa4530f[_0x5a14('0x1c')]+'\x20'+parseOperator(_0xa4530f[_0x5a14('0x11')]);}if(_['includes']([_0x5a14('0x1e'),_0x5a14('0x1f')],_0xa4530f['operator']))_0x4afe6a[_0x5a14('0x1a')]='('+_0x4afe6a[_0x5a14('0x1a')]+'\x20OR\x20'+_0xdde064+'.'+_0xa4530f[_0x5a14('0x1c')]+_0x5a14('0x20');_0x4afe6a[_0x5a14('0x14')]=parseValue(_0x461fd3,_0xa4530f[_0x5a14('0x11')],_0xa4530f[_0x5a14('0x14')]);return _0x4afe6a;};function parseOperator(_0x4ac1f3){var _0x3a5dd3;switch(_0x4ac1f3){case'$in':_0x3a5dd3=_0x5a14('0x21');break;case _0x5a14('0x1f'):_0x3a5dd3=_0x5a14('0x22');break;case'$eq':_0x3a5dd3='=\x20?';break;case _0x5a14('0x1e'):_0x3a5dd3=_0x5a14('0x23');break;case _0x5a14('0x24'):case _0x5a14('0x25'):case _0x5a14('0x26'):_0x3a5dd3=_0x5a14('0x27');break;case'$lt':_0x3a5dd3=_0x5a14('0x28');break;case _0x5a14('0x29'):_0x3a5dd3=_0x5a14('0x2a');break;case _0x5a14('0x2b'):_0x3a5dd3='<=\x20?';break;case _0x5a14('0x2c'):_0x3a5dd3='>=\x20?';break;case'$between':_0x3a5dd3='BETWEEN\x20?\x20AND\x20?';break;}return _0x3a5dd3;}function parseValue(_0x63117,_0x49f786,_0xb47641){var _0x4e0a37={'start':undefined,'end':undefined};switch(_0x49f786){case'$in':case _0x5a14('0x1f'):_0x4e0a37[_0x5a14('0x2d')]=_0xb47641['split'](',');break;case _0x5a14('0x24'):_0x4e0a37['start']='%'+_0xb47641+'%';break;case'$startsWith':_0x4e0a37[_0x5a14('0x2d')]=_0xb47641+'%';break;case'$endsWith':_0x4e0a37[_0x5a14('0x2d')]='%'+_0xb47641;break;case _0x5a14('0x13'):var _0x35c69f=_0xb47641[_0x5a14('0x8')](',');var _0xb47641=_0x35c69f[_0x5a14('0xc')]();var _0x41e71f=_0x35c69f[_0x5a14('0x2e')]();if(_0x63117===_0x5a14('0x2f')){_0xb47641=moment(_0xb47641)[_0x5a14('0x30')](0x0,!![])[_0x5a14('0x18')]();_0x41e71f=moment(_0x41e71f)['utcOffset'](0x0,!![])[_0x5a14('0x16')](0x17,_0x5a14('0x31'))['add'](0x3b,'minutes')[_0x5a14('0x16')](0x3b,_0x5a14('0x32'))['format']();}_0x4e0a37={'start':_0xb47641,'end':_0x41e71f};break;default:_0x4e0a37[_0x5a14('0x2d')]=_0xb47641;break;}return _0x4e0a37;}
\ No newline at end of file
index b6969be..fc070ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2123=['subtract','name','uniqueid','isArray','sort','map','priority','cast','col','substr','DESC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','where','pick','filter','object','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte'];(function(_0x98feb4,_0x27180b){var _0x591542=function(_0x2eb899){while(--_0x2eb899){_0x98feb4['push'](_0x98feb4['shift']());}};_0x591542(++_0x27180b);}(_0x2123,0x190));var _0x3212=function(_0x4910de,_0x465e9f){_0x4910de=_0x4910de-0x0;var _0x1ad8d3=_0x2123[_0x4910de];return _0x1ad8d3;};'use strict';var _=require(_0x3212('0x0'));var sequelize=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3424c2){var _0x7158b8=['ne'];try{var _0x2ff863=JSON[_0x3212('0x3')](_0x3424c2);var _0x2e951f=Object[_0x3212('0x4')](_0x2ff863)[0x0];return _0x7158b8[_0x3212('0x5')](_0x2e951f);}catch(_0x37058e){return![];}}function getOperatorValue(_0x265328){var _0x5d9d36=JSON[_0x3212('0x3')](_0x265328);var _0x2b1302=Object[_0x3212('0x4')](_0x5d9d36)[0x0];var _0x4b35e9=_0x5d9d36[_0x2b1302];return{['$'+_0x2b1302]:_0x4b35e9};}exports[_0x3212('0x6')]=function(_0x56c38f){var _0x313265=null;if(_0x56c38f){_0x313265=_0x56c38f[_0x3212('0x7')](',');}return _0x313265;};exports[_0x3212('0x8')]=function(_0x1db498,_0x54f331){var _0x4a46c2={};if(!_[_0x3212('0x9')](_0x1db498)){_[_0x3212('0xa')](_0x1db498,function(_0x1a3b2f,_0x23f7e3){try{if(_0x54f331){var _0x9c01c3=_[_0x3212('0xb')](_0x54f331,{'name':_0x23f7e3})||{};if(hasSequelizeOperator(_0x1a3b2f)){_0x4a46c2[_0x23f7e3]=getOperatorValue(_0x1a3b2f);}else if(_0x9c01c3[_0x3212('0xc')]===_0x3212('0xd')&&_[_0x3212('0xe')](_0x1a3b2f)){var _0x2d5fce=JSON[_0x3212('0x3')](_0x1a3b2f);var _0x2e4cf0={'$gte':moment(moment(_0x2d5fce[_0x3212('0xf')])[_0x3212('0x10')](_0x3212('0x11')))[_0x3212('0x12')]()[_0x3212('0x10')](),'$lte':moment(moment(_0x2d5fce[_0x3212('0x13')])[_0x3212('0x10')](_0x3212('0x11')))[_0x3212('0x12')]()[_0x3212('0x14')](0x1,'s')['format']()};_0x4a46c2[_0x23f7e3]=_0x2e4cf0;}else if(_0x9c01c3[_0x3212('0x15')]===_0x3212('0x16')){_0x4a46c2[_0x23f7e3]=_0x1a3b2f;}else{_0x4a46c2[_0x23f7e3]=_[_0x3212('0x17')](_0x1a3b2f)?_0x1a3b2f:JSON[_0x3212('0x3')](_0x1a3b2f);}}else{_0x4a46c2[_0x23f7e3]=_[_0x3212('0x17')](_0x1a3b2f)?_0x1a3b2f:JSON[_0x3212('0x3')](_0x1a3b2f);}}catch(_0x21954a){_0x4a46c2[_0x23f7e3]=_0x1a3b2f['split'](',');}});}return _0x4a46c2;};exports['limit']=function(_0x1cad7b){_0x1cad7b=parseInt(_0x1cad7b,0xa);if(!_0x1cad7b||_0x1cad7b<0x0){_0x1cad7b=LIMIT_VALUE;}return _0x1cad7b;};exports['offset']=function(_0x2380e8){_0x2380e8=parseInt(_0x2380e8,0xa);if(!_0x2380e8||_0x2380e8<0x0){_0x2380e8=0x0;}return _0x2380e8;};exports[_0x3212('0x18')]=function(_0xb0b717){var _0x28a4cd,_0x27ccad=null;if(_0xb0b717){_0x28a4cd=_0xb0b717['split'](',');_0x27ccad=_[_0x3212('0x19')](_0x28a4cd,function(_0x462094){if(_0x462094['indexOf']('-')===0x0){return[_0x462094===_0x3212('0x1a')?sequelize[_0x3212('0x1b')](sequelize[_0x3212('0x1c')]('priority'),'unsigned'):_0x462094[_0x3212('0x1d')](0x1),_0x3212('0x1e')];}else{return[_0x462094===_0x3212('0x1a')?sequelize[_0x3212('0x1b')](sequelize[_0x3212('0x1c')](_0x3212('0x1a')),'unsigned'):_0x462094,'ASC'];}});}return _0x27ccad;};exports[_0x3212('0x1f')]=function(_0x47cfdc,_0x24cdf3){if(_[_0x3212('0x9')](_0x47cfdc)){return _0x47cfdc;}if(_[_0x3212('0x17')](_0x47cfdc)){for(var _0x5bb0a5=0x0;_0x5bb0a5<_0x47cfdc[_0x3212('0x20')];_0x5bb0a5+=0x1){_0x47cfdc[_0x5bb0a5]=this[_0x3212('0x1f')](_0x47cfdc[_0x5bb0a5],_0x24cdf3);}return _0x47cfdc;}if(!_[_0x3212('0x21')](_0x47cfdc)){return _0x47cfdc;}if(_['isString'](_0x24cdf3)){_0x24cdf3=[_0x24cdf3];}if(!_[_0x3212('0x17')](_0x24cdf3)){return _0x47cfdc;}for(var _0x35b4eb=0x0;_0x35b4eb<_0x24cdf3[_0x3212('0x20')];_0x35b4eb+=0x1){_[_0x3212('0x22')](_0x47cfdc,_0x24cdf3[_0x35b4eb]);}for(var _0x21f003 in _0x47cfdc){if(_0x47cfdc[_0x3212('0x23')](_0x21f003)){_0x47cfdc[_0x21f003]=this[_0x3212('0x1f')](_0x47cfdc[_0x21f003],_0x24cdf3);}}return _0x47cfdc;};exports[_0x3212('0x24')]=function(_0x1de338){return _0x1de338[_0x3212('0x25')](RegExp(_0x3212('0x26')))?!![]:![];};exports[_0x3212('0x27')]=function(_0x57613f){return _0x57613f[_0x3212('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x3212('0x28')]=function(_0x4726fb){var _0x1cbab5=[];_0x4726fb[_0x3212('0x7')](/[ ,]+/)[_0x3212('0x29')](function(_0x3a7883){_0x3a7883=_0x3a7883['replace'](/([^:]")"+/g,'$1');_0x3a7883='+'+_0x3a7883+'*';var _0x3cbd1a=/[ `!@#$%^&*()_\-?~]/;if(_0x3a7883['match'](_0x3cbd1a))_0x3a7883='\x22'+_0x3a7883+'\x22';_0x1cbab5[_0x3212('0x2a')](_0x3a7883);});return _0x1cbab5['join']('\x20');};exports[_0x3212('0x2b')]=function(_0x4ddc8f,_0x4d17bb,_0x38f56a){var _0x571ae0={},_0x294422={};if(_0x4d17bb[_0x3212('0x2c')][_0x3212('0x2d')]){_0x4d17bb['query']['id']=_0x4d17bb[_0x3212('0x2c')][_0x3212('0x2d')];delete _0x4d17bb[_0x3212('0x2c')]['$id'];}_0x571ae0[_0x3212('0x2e')]=_[_0x3212('0x19')](_0x4ddc8f,_0x3212('0x15'));_0x571ae0[_0x3212('0x2c')]=_[_0x3212('0x4')](_0x4d17bb['query']);_0x571ae0[_0x3212('0x8')]=_[_0x3212('0x2f')](_0x571ae0[_0x3212('0x2e')],_0x571ae0['query']);_0x294422[_0x3212('0x30')]=_[_0x3212('0x2f')](_0x571ae0[_0x3212('0x2e')],this[_0x3212('0x6')](_0x4d17bb['query'][_0x3212('0x6')]));_0x294422[_0x3212('0x30')]=_0x294422[_0x3212('0x30')][_0x3212('0x20')]?_0x294422['attributes']:_0x571ae0['model'];if(!_0x4d17bb['query']['hasOwnProperty'](_0x3212('0x31'))){_0x294422[_0x3212('0x32')]=this[_0x3212('0x32')](_0x4d17bb[_0x3212('0x2c')]['limit']);_0x294422[_0x3212('0x33')]=this[_0x3212('0x33')](_0x4d17bb[_0x3212('0x2c')][_0x3212('0x33')]);}_0x294422['order']=this['sort'](_0x4d17bb[_0x3212('0x2c')][_0x3212('0x18')]);_0x294422[_0x3212('0x34')]=this[_0x3212('0x8')](_[_0x3212('0x35')](_0x4d17bb[_0x3212('0x2c')],_0x571ae0[_0x3212('0x8')]),_0x4ddc8f);if(_0x4d17bb['query'][_0x3212('0x36')]){var _0x3768a=_0x4ddc8f;var _0x3e1e84=_0x4d17bb[_0x3212('0x2c')]['filter'];if(typeof _0x3e1e84===_0x3212('0x37')){_0x3768a=_[_0x3212('0x36')](_0x4ddc8f,function(_0x1c71f7){return _[_0x3212('0x5')](_0x3e1e84['columns'],_0x1c71f7[_0x3212('0x15')]);});_0x3e1e84=_0x3e1e84['value'];}_0x294422[_0x3212('0x34')]=_[_0x3212('0x38')](_0x294422[_0x3212('0x34')],{'$or':_[_0x3212('0x19')](_0x3768a,function(_0x9a24e3){if(_0x9a24e3[_0x3212('0xc')]!==_0x3212('0x39')){if(_0x38f56a){return sequelize[_0x3212('0x34')](sequelize['fn']('lower',sequelize[_0x3212('0x1c')](_0x9a24e3[_0x3212('0x15')])),{'$like':sequelize['fn'](_0x3212('0x3a'),'%'+_0x4d17bb[_0x3212('0x2c')][_0x3212('0x36')]+'%')});}else{var _0x36ccb2={};_0x36ccb2[_0x9a24e3[_0x3212('0x15')]]={'$like':'%'+_0x4d17bb['query'][_0x3212('0x36')]+'%'};return _0x36ccb2;}}})});}_0x294422=_[_0x3212('0x38')]({},_0x294422,_0x4d17bb[_0x3212('0x3b')]);return _0x294422;};
\ No newline at end of file
+var _0xf072=['DESC','unsigned','ASC','omit','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','pick','filter','object','includes','columns','where','merge','type','lower','col','options','lodash','sequelize','moment','parse','keys','fields','split','filters','forOwn','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','sort','map','cast','priority','substr'];(function(_0xbc3542,_0x4de021){var _0x1c88ff=function(_0x1d1fb4){while(--_0x1d1fb4){_0xbc3542['push'](_0xbc3542['shift']());}};_0x1c88ff(++_0x4de021);}(_0xf072,0x1cf));var _0x2f07=function(_0x1f74ab,_0x9d5e67){_0x1f74ab=_0x1f74ab-0x0;var _0x37b4cf=_0xf072[_0x1f74ab];return _0x37b4cf;};'use strict';var _=require(_0x2f07('0x0'));var sequelize=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4f62b0){var _0x3c1c25=['ne'];try{var _0x5f20e3=JSON[_0x2f07('0x3')](_0x4f62b0);var _0x432696=Object[_0x2f07('0x4')](_0x5f20e3)[0x0];return _0x3c1c25['includes'](_0x432696);}catch(_0x1d5a33){return![];}}function getOperatorValue(_0x14d6e6){var _0x3643bb=JSON[_0x2f07('0x3')](_0x14d6e6);var _0x235418=Object[_0x2f07('0x4')](_0x3643bb)[0x0];var _0x33b99c=_0x3643bb[_0x235418];return{['$'+_0x235418]:_0x33b99c};}exports[_0x2f07('0x5')]=function(_0x4746c2){var _0x2e167=null;if(_0x4746c2){_0x2e167=_0x4746c2[_0x2f07('0x6')](',');}return _0x2e167;};exports[_0x2f07('0x7')]=function(_0x1a3848,_0x18fe13){var _0x14e237={};if(!_['isEmpty'](_0x1a3848)){_[_0x2f07('0x8')](_0x1a3848,function(_0x2f464b,_0x1d0812){try{if(_0x18fe13){var _0x3525be=_['find'](_0x18fe13,{'name':_0x1d0812})||{};if(hasSequelizeOperator(_0x2f464b)){_0x14e237[_0x1d0812]=getOperatorValue(_0x2f464b);}else if(_0x3525be['type']===_0x2f07('0x9')&&_[_0x2f07('0xa')](_0x2f464b)){var _0x58549c=JSON[_0x2f07('0x3')](_0x2f464b);var _0x34dbd4={'$gte':moment(moment(_0x58549c[_0x2f07('0xb')])['format'](_0x2f07('0xc')))[_0x2f07('0xd')]()[_0x2f07('0xe')](),'$lte':moment(moment(_0x58549c[_0x2f07('0xf')])[_0x2f07('0xe')](_0x2f07('0xc')))['utc']()[_0x2f07('0x10')](0x1,'s')['format']()};_0x14e237[_0x1d0812]=_0x34dbd4;}else if(_0x3525be[_0x2f07('0x11')]===_0x2f07('0x12')){_0x14e237[_0x1d0812]=_0x2f464b;}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}catch(_0x1a6135){_0x14e237[_0x1d0812]=_0x2f464b[_0x2f07('0x6')](',');}});}return _0x14e237;};exports['limit']=function(_0x15c3dd){_0x15c3dd=parseInt(_0x15c3dd,0xa);if(!_0x15c3dd||_0x15c3dd<0x0){_0x15c3dd=LIMIT_VALUE;}return _0x15c3dd;};exports['offset']=function(_0x3cd3c0){_0x3cd3c0=parseInt(_0x3cd3c0,0xa);if(!_0x3cd3c0||_0x3cd3c0<0x0){_0x3cd3c0=0x0;}return _0x3cd3c0;};exports[_0x2f07('0x14')]=function(_0x119b68){var _0xd944d6,_0x2ef47d=null;if(_0x119b68){_0xd944d6=_0x119b68['split'](',');_0x2ef47d=_[_0x2f07('0x15')](_0xd944d6,function(_0x5a0146){if(_0x5a0146['indexOf']('-')===0x0){return[_0x5a0146==='priority'?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),'unsigned'):_0x5a0146[_0x2f07('0x18')](0x1),_0x2f07('0x19')];}else{return[_0x5a0146===_0x2f07('0x17')?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),_0x2f07('0x1a')):_0x5a0146,_0x2f07('0x1b')];}});}return _0x2ef47d;};exports['omit']=function(_0x111376,_0x113916){if(_['isEmpty'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x13')](_0x111376)){for(var _0x1c9ca1=0x0;_0x1c9ca1<_0x111376['length'];_0x1c9ca1+=0x1){_0x111376[_0x1c9ca1]=this[_0x2f07('0x1c')](_0x111376[_0x1c9ca1],_0x113916);}return _0x111376;}if(!_['isObject'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x1d')](_0x113916)){_0x113916=[_0x113916];}if(!_[_0x2f07('0x13')](_0x113916)){return _0x111376;}for(var _0x27bd72=0x0;_0x27bd72<_0x113916[_0x2f07('0x1e')];_0x27bd72+=0x1){_[_0x2f07('0x1f')](_0x111376,_0x113916[_0x27bd72]);}for(var _0x139ea8 in _0x111376){if(_0x111376[_0x2f07('0x20')](_0x139ea8)){_0x111376[_0x139ea8]=this[_0x2f07('0x1c')](_0x111376[_0x139ea8],_0x113916);}}return _0x111376;};exports[_0x2f07('0x21')]=function(_0x468cd8){return _0x468cd8[_0x2f07('0x22')](RegExp(_0x2f07('0x23')))?!![]:![];};exports['isEmail']=function(_0x1accef){return _0x1accef[_0x2f07('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x2f07('0x24')]=function(_0x571839){var _0x36d4b8=[];_0x571839[_0x2f07('0x6')](/[ ,]+/)[_0x2f07('0x25')](function(_0x5ad0de){_0x5ad0de=_0x5ad0de[_0x2f07('0x26')](/([^:]")"+/g,'$1');_0x5ad0de='+'+_0x5ad0de+'*';var _0x368e3d=/[ `!@#$%^&*()_\-?~]/;if(_0x5ad0de[_0x2f07('0x22')](_0x368e3d))_0x5ad0de='\x22'+_0x5ad0de+'\x22';_0x36d4b8[_0x2f07('0x27')](_0x5ad0de);});return _0x36d4b8[_0x2f07('0x28')]('\x20');};exports[_0x2f07('0x29')]=function(_0x3fed73,_0x5c7593,_0x1decd1){var _0x5b0407={},_0x3496eb={};if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')]){_0x5c7593[_0x2f07('0x2a')]['id']=_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];delete _0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];}_0x5b0407[_0x2f07('0x2c')]=_[_0x2f07('0x15')](_0x3fed73,_0x2f07('0x11'));_0x5b0407[_0x2f07('0x2a')]=_[_0x2f07('0x4')](_0x5c7593[_0x2f07('0x2a')]);_0x5b0407[_0x2f07('0x7')]=_[_0x2f07('0x2d')](_0x5b0407['model'],_0x5b0407['query']);_0x3496eb[_0x2f07('0x2e')]=_[_0x2f07('0x2d')](_0x5b0407[_0x2f07('0x2c')],this['fields'](_0x5c7593['query'][_0x2f07('0x5')]));_0x3496eb['attributes']=_0x3496eb[_0x2f07('0x2e')][_0x2f07('0x1e')]?_0x3496eb[_0x2f07('0x2e')]:_0x5b0407[_0x2f07('0x2c')];if(!_0x5c7593[_0x2f07('0x2a')]['hasOwnProperty'](_0x2f07('0x2f'))){_0x3496eb['limit']=this[_0x2f07('0x30')](_0x5c7593['query'][_0x2f07('0x30')]);_0x3496eb['offset']=this['offset'](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x31')]);}_0x3496eb['order']=this[_0x2f07('0x14')](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x14')]);_0x3496eb['where']=this[_0x2f07('0x7')](_[_0x2f07('0x32')](_0x5c7593[_0x2f07('0x2a')],_0x5b0407[_0x2f07('0x7')]),_0x3fed73);if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x33')]){var _0x1a0ef2=_0x3fed73;var _0x1a9645=_0x5c7593['query'][_0x2f07('0x33')];if(typeof _0x1a9645===_0x2f07('0x34')){_0x1a0ef2=_[_0x2f07('0x33')](_0x3fed73,function(_0x3f1b6b){return _[_0x2f07('0x35')](_0x1a9645[_0x2f07('0x36')],_0x3f1b6b[_0x2f07('0x11')]);});_0x1a9645=_0x1a9645['value'];}_0x3496eb[_0x2f07('0x37')]=_[_0x2f07('0x38')](_0x3496eb[_0x2f07('0x37')],{'$or':_[_0x2f07('0x15')](_0x1a0ef2,function(_0x3db7ad){if(_0x3db7ad[_0x2f07('0x39')]!=='VIRTUAL'){if(_0x1decd1){return sequelize[_0x2f07('0x37')](sequelize['fn'](_0x2f07('0x3a'),sequelize[_0x2f07('0x3b')](_0x3db7ad[_0x2f07('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x5c7593['query'][_0x2f07('0x33')]+'%')});}else{var _0x437e94={};_0x437e94[_0x3db7ad[_0x2f07('0x11')]]={'$like':'%'+_0x5c7593[_0x2f07('0x2a')]['filter']+'%'};return _0x437e94;}}})});}_0x3496eb=_[_0x2f07('0x38')]({},_0x3496eb,_0x5c7593[_0x2f07('0x3c')]);return _0x3496eb;};
\ No newline at end of file
index ff5b0fa..3a58cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
+var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x4186c3,_0x1c0521){var _0x23ff6c=function(_0x459a01){while(--_0x459a01){_0x4186c3['push'](_0x4186c3['shift']());}};_0x23ff6c(++_0x1c0521);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
index 7005009..99d575f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5963=['update','hex','substring','lodash','crypto','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','createHash','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','md5'];(function(_0x97ec0e,_0x10eb67){var _0x1fd9dd=function(_0x187652){while(--_0x187652){_0x97ec0e['push'](_0x97ec0e['shift']());}};_0x1fd9dd(++_0x10eb67);}(_0x5963,0x161));var _0x3596=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5963[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x3596('0x0'));var os=require('os');var crypto=require(_0x3596('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x3596('0x2')];var config=require(_0x3596('0x3'));function getInterfaces(){var _0x524e53=[];var _0x388751=os[_0x3596('0x4')]();var _0x573e2f=_[_0x3596('0x5')](_[_0x3596('0x6')](_0x388751));for(var _0x148bae=0x0;_0x148bae<_0x573e2f[_0x3596('0x7')];_0x148bae++){var _0x112efa=_0x388751[_0x573e2f[_0x148bae]][_0x3596('0x8')](function(_0x43ec40){return _0x43ec40[_0x3596('0x9')]==='IPv4'&&_0x43ec40['internal']===![];});_0x524e53=_0x524e53[_0x3596('0xa')](_0x112efa);}return _0x524e53;}function getFirstInterface(){var _0x5c6ed5=_[_0x3596('0xb')](getInterfaces());return{'macAddress':_0x5c6ed5&&_0x5c6ed5[_0x3596('0xc')]?_0x5c6ed5[_0x3596('0xc')]:_0x3596('0xd'),'ipAddress':_0x5c6ed5&&_0x5c6ed5['address']?_0x5c6ed5[_0x3596('0xe')]:'127.0.0.1'};}exports[_0x3596('0xf')]=getFirstInterface;function getCPUhash(){var _0x2641d1=_[_0x3596('0x5')](os[_0x3596('0x10')]()[_0x3596('0x11')](function(_0x177d3d){return _0x177d3d['model'];}))['join'](':');return crypto[_0x3596('0x12')]('md5')['update'](_0x2641d1)[_0x3596('0x13')]('hex');}exports[_0x3596('0x14')]=function(){var _0x31306b=os[_0x3596('0x15')]();var _0x2a2f8b=/[0-9a-f-]{36}/;if(config[_0x3596('0x16')]&&_0x2a2f8b[_0x3596('0x17')](config[_0x3596('0x16')])){return config[_0x3596('0x16')];}else if(_0x31306b===_0x3596('0x18')){return exec(_0x3596('0x19'),{'encoding':_0x3596('0x1a')})[_0x3596('0x1b')]('\x0d\x0a','');}else{var _0x33e88d=getFirstInterface();var _0x5cef8f=getCPUhash();var _0x41b4da=_0x5cef8f+'|'+os[_0x3596('0x1c')]()+'|'+_0x33e88d[_0x3596('0x1d')]+'|'+_0x33e88d[_0x3596('0x1e')];var _0xf26921=crypto[_0x3596('0x12')](_0x3596('0x1f'))[_0x3596('0x20')](_0x41b4da)['digest'](_0x3596('0x21'));return _0xf26921['substring'](0x0,0x8)+'-'+_0xf26921[_0x3596('0x22')](0x8,0xc)+'-'+_0xf26921['substring'](0xc,0x10)+'-'+_0xf26921[_0x3596('0x22')](0x10,0x14)+'-'+_0xf26921['substring'](0x14);}};
\ No newline at end of file
+var _0x3b86=['address','getFirstInterface','cpus','map','model','createHash','update','digest','hex','getUuid','platform','licenseToken','test','utf8','replace','hostname','macAddress','substring','lodash','crypto','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','00:00:00:00:00:00'];(function(_0x44d843,_0x24f9b3){var _0x3e5e0b=function(_0x3f92d7){while(--_0x3f92d7){_0x44d843['push'](_0x44d843['shift']());}};_0x3e5e0b(++_0x24f9b3);}(_0x3b86,0xf2));var _0x63b8=function(_0x3fc1b9,_0x5219b9){_0x3fc1b9=_0x3fc1b9-0x0;var _0x6c21c2=_0x3b86[_0x3fc1b9];return _0x6c21c2;};'use strict';var _=require(_0x63b8('0x0'));var os=require('os');var crypto=require(_0x63b8('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x63b8('0x2'))[_0x63b8('0x3')];var config=require('../environment');function getInterfaces(){var _0x2c5eb8=[];var _0x234077=os[_0x63b8('0x4')]();var _0x3a1d93=_[_0x63b8('0x5')](_[_0x63b8('0x6')](_0x234077));for(var _0x48f4db=0x0;_0x48f4db<_0x3a1d93[_0x63b8('0x7')];_0x48f4db++){var _0x1d03ec=_0x234077[_0x3a1d93[_0x48f4db]][_0x63b8('0x8')](function(_0xa6cfc7){return _0xa6cfc7['family']===_0x63b8('0x9')&&_0xa6cfc7[_0x63b8('0xa')]===![];});_0x2c5eb8=_0x2c5eb8[_0x63b8('0xb')](_0x1d03ec);}return _0x2c5eb8;}function getFirstInterface(){var _0x177825=_[_0x63b8('0xc')](getInterfaces());return{'macAddress':_0x177825&&_0x177825['mac']?_0x177825['mac']:_0x63b8('0xd'),'ipAddress':_0x177825&&_0x177825[_0x63b8('0xe')]?_0x177825['address']:'127.0.0.1'};}exports[_0x63b8('0xf')]=getFirstInterface;function getCPUhash(){var _0x1f0088=_[_0x63b8('0x5')](os[_0x63b8('0x10')]()[_0x63b8('0x11')](function(_0x12a631){return _0x12a631[_0x63b8('0x12')];}))['join'](':');return crypto[_0x63b8('0x13')]('md5')[_0x63b8('0x14')](_0x1f0088)[_0x63b8('0x15')](_0x63b8('0x16'));}exports[_0x63b8('0x17')]=function(){var _0x95c16c=os[_0x63b8('0x18')]();var _0x17d9e0=/[0-9a-f-]{36}/;if(config[_0x63b8('0x19')]&&_0x17d9e0[_0x63b8('0x1a')](config['licenseToken'])){return config[_0x63b8('0x19')];}else if(_0x95c16c==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x63b8('0x1b')})[_0x63b8('0x1c')]('\x0d\x0a','');}else{var _0x5e784a=getFirstInterface();var _0xe628a2=getCPUhash();var _0x1eb661=_0xe628a2+'|'+os[_0x63b8('0x1d')]()+'|'+_0x5e784a[_0x63b8('0x1e')]+'|'+_0x5e784a['ipAddress'];var _0x9a9c6c=crypto[_0x63b8('0x13')]('md5')[_0x63b8('0x14')](_0x1eb661)[_0x63b8('0x15')](_0x63b8('0x16'));return _0x9a9c6c[_0x63b8('0x1f')](0x0,0x8)+'-'+_0x9a9c6c[_0x63b8('0x1f')](0x8,0xc)+'-'+_0x9a9c6c[_0x63b8('0x1f')](0xc,0x10)+'-'+_0x9a9c6c[_0x63b8('0x1f')](0x10,0x14)+'-'+_0x9a9c6c[_0x63b8('0x1f')](0x14);}};
\ No newline at end of file
index 420fb96..0681691 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bb9=['message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','error'];(function(_0x132877,_0x418481){var _0x4f0cda=function(_0x5cc9a8){while(--_0x5cc9a8){_0x132877['push'](_0x132877['shift']());}};_0x4f0cda(++_0x418481);}(_0x8bb9,0x13e));var _0x98bb=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x8bb9[_0x445101];return _0x3c3d04;};'use strict';var util=require('util');var moment=require(_0x98bb('0x0'));var rp=require(_0x98bb('0x1'));var BPromise=require(_0x98bb('0x2'));var pkginfo=require(_0x98bb('0x3'))(module,_0x98bb('0x4'));var db=require(_0x98bb('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x98bb('0x6'));var logger=require(_0x98bb('0x7'))(_0x98bb('0x8'));var HOST=_0x98bb('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x41cbbd){return new BPromise(function(_0x3e6d9e,_0x55857f){var _0x3dacad=util[_0x98bb('0xa')](_0x98bb('0xb'),HOST,_0x41cbbd,module[_0x98bb('0xc')][_0x98bb('0x4')]);if(oldToken){_0x3dacad=util[_0x98bb('0xa')](_0x98bb('0xd'),HOST,_0x41cbbd,module[_0x98bb('0xc')][_0x98bb('0x4')],oldToken);}var _0x5881fe={'uri':_0x3dacad,'method':_0x98bb('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x5881fe)[_0x98bb('0xf')](function(_0x3b9655){_0x3e6d9e(_0x3b9655);})[_0x98bb('0x10')](function(_0x24e4ac){_0x55857f(_0x24e4ac);});});}function manageLicense(_0x1bf45c,_0x17aa67){var _0x4d4ca0=_0x17aa67[_0x98bb('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x4d4ca0[_0x98bb('0x12')]!==_0x1bf45c&&!_0x4d4ca0['data2']){oldToken=_0x4d4ca0[_0x98bb('0x12')];}httpRequest(_0x1bf45c)[_0x98bb('0xf')](function(_0x124443){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x124443['active']){isOldTokenSent=![];if(!_0x4d4ca0['license']&&_0x4d4ca0[_0x98bb('0x8')]!=_0x124443[_0x98bb('0x8')]||_0x4d4ca0[_0x98bb('0x8')]&&_0x4d4ca0['data2']){logger[_0x98bb('0x13')](_0x98bb('0x14'));}if(_0x4d4ca0[_0x98bb('0x8')]&&!_0x4d4ca0[_0x98bb('0x15')]&&_0x4d4ca0['license']!=_0x124443[_0x98bb('0x8')]){logger[_0x98bb('0x13')](_0x98bb('0x16'));}if(_0x4d4ca0[_0x98bb('0x8')]&&!_0x4d4ca0[_0x98bb('0x15')]&&_0x4d4ca0[_0x98bb('0x8')]==_0x124443[_0x98bb('0x8')]){return _0x17aa67;}return _0x17aa67[_0x98bb('0x17')]({'data1':_0x1bf45c,'data2':null,'license':_0x124443[_0x98bb('0x8')]});}else{if(_0x124443[_0x98bb('0x8')]||_0x4d4ca0[_0x98bb('0x8')]){if(!_0x4d4ca0[_0x98bb('0x15')]){if(_0x4d4ca0[_0x98bb('0x12')]==_0x1bf45c){GRAY_PERIOD_REASON='Disabled';logger[_0x98bb('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x98bb('0x13')](_0x98bb('0x18'),_0x4d4ca0[_0x98bb('0x12')],_0x1bf45c);}logger['info'](_0x98bb('0x19'),GRAY_PERIOD_REASON[_0x98bb('0x1a')](),moment()[_0x98bb('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x17aa67['update']({'data2':encryptor[_0x98bb('0x1b')](moment()['format'](_0x98bb('0x1c')))});}else{if(moment()[_0x98bb('0x1d')](encryptor[_0x98bb('0x1e')](_0x4d4ca0['data2']),_0x98bb('0x1f'))>DAYS){logger[_0x98bb('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0x98bb('0xa')](_0x98bb('0x1c')));isOldTokenSent=![];return _0x17aa67['update']({'data1':_0x1bf45c,'data2':null,'license':null});}}}else{if(_0x4d4ca0[_0x98bb('0x12')]!=_0x1bf45c){logger[_0x98bb('0x13')](_0x98bb('0x18'),_0x4d4ca0[_0x98bb('0x12')],_0x1bf45c);return _0x17aa67[_0x98bb('0x17')]({'data1':_0x1bf45c,'data2':null,'license':null});}}}return _0x17aa67;})[_0x98bb('0xf')](function(_0x3e6205){_0x17aa67=_0x3e6205;})['catch'](function(_0x3ce14d){logger[_0x98bb('0x20')](_0x3ce14d[_0x98bb('0x21')]);})[_0x98bb('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x17aa67);},TIME);});}function defaultLicense(){var _0x32a553=hardware[_0x98bb('0x23')]();if(_0x32a553){return db[_0x98bb('0x24')][_0x98bb('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x32a553}})['spread'](function(_0x39738f,_0x14629f){logger[_0x98bb('0x13')](_0x98bb('0x26'),_0x32a553);manageLicense(_0x32a553,_0x39738f);})[_0x98bb('0x10')](function(_0x146f6b){logger['error'](_0x146f6b['message']);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0x1c0c=['NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','moment','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data2','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x331660,_0x58cfcc){var _0x16d7b7=function(_0xaa91ae){while(--_0xaa91ae){_0x331660['push'](_0x331660['shift']());}};_0x16d7b7(++_0x58cfcc);}(_0x1c0c,0x19c));var _0xc1c0=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x1c0c[_0x3ff085];return _0x2b68c3;};'use strict';var util=require('util');var moment=require(_0xc1c0('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0xc1c0('0x1'))(module,_0xc1c0('0x2'));var db=require(_0xc1c0('0x3'))['db'];var encryptor=require(_0xc1c0('0x4'));var hardware=require(_0xc1c0('0x5'));var logger=require('../logger')('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x391395){return new BPromise(function(_0xfc38a0,_0x706351){var _0x404e43=util['format'](_0xc1c0('0x6'),HOST,_0x391395,module[_0xc1c0('0x7')][_0xc1c0('0x2')]);if(oldToken){_0x404e43=util[_0xc1c0('0x8')](_0xc1c0('0x9'),HOST,_0x391395,module[_0xc1c0('0x7')]['version'],oldToken);}var _0x1ebcdd={'uri':_0x404e43,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x1ebcdd)[_0xc1c0('0xa')](function(_0x297ceb){_0xfc38a0(_0x297ceb);})[_0xc1c0('0xb')](function(_0x6ed816){_0x706351(_0x6ed816);});});}function manageLicense(_0x142823,_0x158e85){var _0x122445=_0x158e85[_0xc1c0('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x122445['data1']!==_0x142823&&!_0x122445[_0xc1c0('0xd')]){oldToken=_0x122445['data1'];}httpRequest(_0x142823)[_0xc1c0('0xa')](function(_0x48166b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x48166b['active']){isOldTokenSent=![];if(!_0x122445[_0xc1c0('0xe')]&&_0x122445[_0xc1c0('0xe')]!=_0x48166b[_0xc1c0('0xe')]||_0x122445['license']&&_0x122445[_0xc1c0('0xd')]){logger[_0xc1c0('0xf')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x122445['license']&&!_0x122445['data2']&&_0x122445['license']!=_0x48166b[_0xc1c0('0xe')]){logger[_0xc1c0('0xf')](_0xc1c0('0x10'));}if(_0x122445[_0xc1c0('0xe')]&&!_0x122445['data2']&&_0x122445[_0xc1c0('0xe')]==_0x48166b[_0xc1c0('0xe')]){return _0x158e85;}return _0x158e85['update']({'data1':_0x142823,'data2':null,'license':_0x48166b[_0xc1c0('0xe')]});}else{if(_0x48166b[_0xc1c0('0xe')]||_0x122445[_0xc1c0('0xe')]){if(!_0x122445[_0xc1c0('0xd')]){if(_0x122445[_0xc1c0('0x11')]==_0x142823){GRAY_PERIOD_REASON=_0xc1c0('0x12');logger['info'](_0xc1c0('0x13'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xc1c0('0xf')](_0xc1c0('0x14'),_0x122445[_0xc1c0('0x11')],_0x142823);}logger[_0xc1c0('0xf')](_0xc1c0('0x15'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xc1c0('0x16')));return _0x158e85['update']({'data2':encryptor[_0xc1c0('0x17')](moment()[_0xc1c0('0x8')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xc1c0('0x18')](encryptor[_0xc1c0('0x19')](_0x122445[_0xc1c0('0xd')]),_0xc1c0('0x1a'))>DAYS){logger[_0xc1c0('0xf')]('DEMO\x20START\x20AT\x20%s',moment()[_0xc1c0('0x8')](_0xc1c0('0x16')));isOldTokenSent=![];return _0x158e85['update']({'data1':_0x142823,'data2':null,'license':null});}}}else{if(_0x122445[_0xc1c0('0x11')]!=_0x142823){logger[_0xc1c0('0xf')](_0xc1c0('0x14'),_0x122445['data1'],_0x142823);return _0x158e85['update']({'data1':_0x142823,'data2':null,'license':null});}}}return _0x158e85;})['then'](function(_0x34679e){_0x158e85=_0x34679e;})[_0xc1c0('0xb')](function(_0x5a2df3){logger['error'](_0x5a2df3[_0xc1c0('0x1b')]);})[_0xc1c0('0x1c')](function(){setTimeout(function(){manageLicense(hardware[_0xc1c0('0x1d')](),_0x158e85);},TIME);});}function defaultLicense(){var _0x3becaf=hardware[_0xc1c0('0x1d')]();if(_0x3becaf){return db[_0xc1c0('0x1e')][_0xc1c0('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x3becaf}})[_0xc1c0('0x20')](function(_0x2d4f53,_0x20bd30){logger['info'](_0xc1c0('0x21'),_0x3becaf);manageLicense(_0x3becaf,_0x2d4f53);})[_0xc1c0('0xb')](function(_0x40c64a){logger[_0xc1c0('0x22')](_0x40c64a[_0xc1c0('0x1b')]);});}}exports[_0xc1c0('0x23')]=defaultLicense;
\ No newline at end of file
index e4bbe6f..76394f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x667c=['then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','changed','disabled','message','User','findAll','role','COUNT','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','find','defaults'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x667c,0x17b));var _0xc667=function(_0x39a0da,_0x5abf14){_0x39a0da=_0x39a0da-0x0;var _0x59dcdd=_0x667c[_0x39a0da];return _0x59dcdd;};'use strict';var util=require('util');var _=require(_0xc667('0x0'));var moment=require(_0xc667('0x1'));var BPromise=require(_0xc667('0x2'));var hardware=require(_0xc667('0x3'));var encryptor=require(_0xc667('0x4'));var db=require(_0xc667('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc667('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc667('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc667('0x8'),'machineUuid':hardware[_0xc667('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x560342){return new BPromise(function(_0xe901f9,_0xb96f51){return db[_0xc667('0xa')][_0xc667('0xb')](_[_0xc667('0xc')](_0x560342,{'raw':!![],'where':{'id':0x1}}))[_0xc667('0xd')](function(_0x19e8fc){return checkLicense(_0x19e8fc,null);})['then'](function(_0x2938c3){_0xe901f9(_0x2938c3);return;})[_0xc667('0xe')](function(_0x52625f){_0xb96f51(_0x52625f);});});}function checkLicense(_0x492af9,_0x3b16e1){if(!_0x492af9){demoLicense[_0xc667('0xf')]=_0x492af9[_0xc667('0x10')];return demoLicense;}try{var _0x52c807=_0x3b16e1||_0x492af9[_0xc667('0x11')];if(_[_0xc667('0x12')](_0x52c807)){throw new Error(_0xc667('0x13'));}var _0x43aaaa=_0x492af9['data1'];var _0x4ff758=_0x492af9['data2'];var _0x4383d6=_0x43aaaa[_0xc667('0x14')]('-')[0x4];var _0x52d974=_0x43aaaa['split']('-')[0x0];var _0x5bf2a4=encryptor[_0xc667('0x15')](_0x52c807,util[_0xc667('0x16')](_0xc667('0x17'),_0x4383d6,_0x43aaaa,_0x52d974));var _0x2d0b42=JSON[_0xc667('0x18')](_0x5bf2a4);_0x2d0b42[_0xc667('0x19')]=![];_0x2d0b42[_0xc667('0xf')]=_0x43aaaa;_0x2d0b42[_0xc667('0x1a')]=hardware['getUuid']();if(_0x4ff758){var _0x3b9b6a=encryptor[_0xc667('0x15')](_0x4ff758);_0x2d0b42[_0xc667('0x1b')]=_0x3b9b6a;_0x2d0b42[_0xc667('0x1c')]=moment(_0x3b9b6a)[_0xc667('0x1d')](0x7,_0xc667('0x1e'))[_0xc667('0x16')]();_0x2d0b42['grayReason']=_0x2d0b42[_0xc667('0xf')]!=_0x2d0b42[_0xc667('0x1a')]?_0xc667('0x1f'):_0xc667('0x20');}return _0x2d0b42;}catch(_0x2b02cb){breakingLicense[_0xc667('0xf')]=_0x492af9[_0xc667('0x10')];breakingLicense[_0xc667('0x21')]=_0x2b02cb[_0xc667('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x371a7d,_0x4dff22){getLicense()[_0xc667('0xd')](function(_0x36ebe3){return db[_0xc667('0x22')][_0xc667('0x23')]({'attributes':[_0xc667('0x24'),[db['sequelize']['fn'](_0xc667('0x25'),db['sequelize']['col']('role')),_0xc667('0x26')]],'group':_0xc667('0x24'),'where':{'role':{'$or':[_0xc667('0x27'),_0xc667('0x28'),_0xc667('0x29')]}},'raw':!![]})[_0xc667('0xd')](function(_0x40fc95){var _0x463404={'user':_0x36ebe3[_0xc667('0x2a')]||0x0,'telephone':_0x36ebe3[_0xc667('0x2b')]||0x0};_0x40fc95[_0xc667('0x2c')](function(_0x3d2448){var _0x36155d=_0x3d2448[_0xc667('0x24')]===_0xc667('0x27')?_0xc667('0x28'):_0x3d2448[_0xc667('0x24')];_0x463404[_0x36155d]-=_0x3d2448['count'];if(_0x463404[_0x36155d]<0x0)_0x463404[_0x36155d]=0x0;});_0x371a7d(_0x463404);return;});})['catch'](function(_0x42aed0){_0x4dff22(_0x42aed0);});});}function checkUserLimits(_0x24c73d){return new BPromise(function(_0x9260d3,_0x3e9f02){getLimits()[_0xc667('0xd')](function(_0x5b5e0c){var _0x54ac21=_[_0xc667('0x2d')](_[_0xc667('0x2e')](_0x24c73d,_0xc667('0x24')),['admin',_0xc667('0x28'),_0xc667('0x29')]);var _0x58878c=(_0x54ac21[_0xc667('0x27')]||0x0)+(_0x54ac21[_0xc667('0x28')]||0x0);var _0x3c3dd8=_0x54ac21[_0xc667('0x29')]||0x0;if(_0x58878c>_0x5b5e0c[_0xc667('0x28')])return _0x3e9f02(_0xc667('0x2f'));if(_0x3c3dd8>_0x5b5e0c[_0xc667('0x29')])return _0x3e9f02('License\x20limit\x20reached\x20for\x20telephones');return _0x9260d3();})['catch'](function(_0xfee9b4){_0x3e9f02(_0xfee9b4);});});}module[_0xc667('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x7211=['disabled','message','findAll','role','COUNT','count','admin','user','users','telephones','catch','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','find','defaults','then','data1','isEmpty','data2','split','format','%s:%s:%s','parse','demo','uuid','decryptString','gray','deadline','days','grayReason','machineUuid'];(function(_0x3e557f,_0x366bc4){var _0x31181e=function(_0x264cf5){while(--_0x264cf5){_0x3e557f['push'](_0x3e557f['shift']());}};_0x31181e(++_0x366bc4);}(_0x7211,0x1bd));var _0x1721=function(_0x4c949a,_0x30587c){_0x4c949a=_0x4c949a-0x0;var _0x45c972=_0x7211[_0x4c949a];return _0x45c972;};'use strict';var util=require(_0x1721('0x0'));var _=require(_0x1721('0x1'));var moment=require(_0x1721('0x2'));var BPromise=require(_0x1721('0x3'));var hardware=require(_0x1721('0x4'));var encryptor=require(_0x1721('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1721('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1721('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1721('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1721('0x8'),'machineUuid':hardware[_0x1721('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x344244){return new BPromise(function(_0x29e348,_0x24adc2){return db['License'][_0x1721('0xa')](_[_0x1721('0xb')](_0x344244,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x344d4b){return checkLicense(_0x344d4b,null);})[_0x1721('0xc')](function(_0x361a78){_0x29e348(_0x361a78);return;})['catch'](function(_0x54a9d2){_0x24adc2(_0x54a9d2);});});}function checkLicense(_0xab5896,_0x52d871){if(!_0xab5896){demoLicense['uuid']=_0xab5896[_0x1721('0xd')];return demoLicense;}try{var _0x501389=_0x52d871||_0xab5896['license'];if(_[_0x1721('0xe')](_0x501389)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x41aa16=_0xab5896[_0x1721('0xd')];var _0x1008e2=_0xab5896[_0x1721('0xf')];var _0x1d93f0=_0x41aa16[_0x1721('0x10')]('-')[0x4];var _0x5c1e02=_0x41aa16[_0x1721('0x10')]('-')[0x0];var _0x1ad2e3=encryptor['decryptString'](_0x501389,util[_0x1721('0x11')](_0x1721('0x12'),_0x1d93f0,_0x41aa16,_0x5c1e02));var _0x44bac4=JSON[_0x1721('0x13')](_0x1ad2e3);_0x44bac4[_0x1721('0x14')]=![];_0x44bac4[_0x1721('0x15')]=_0x41aa16;_0x44bac4['machineUuid']=hardware['getUuid']();if(_0x1008e2){var _0x1fd0f6=encryptor[_0x1721('0x16')](_0x1008e2);_0x44bac4[_0x1721('0x17')]=_0x1fd0f6;_0x44bac4[_0x1721('0x18')]=moment(_0x1fd0f6)['add'](0x7,_0x1721('0x19'))[_0x1721('0x11')]();_0x44bac4[_0x1721('0x1a')]=_0x44bac4[_0x1721('0x15')]!=_0x44bac4[_0x1721('0x1b')]?'changed':_0x1721('0x1c');}return _0x44bac4;}catch(_0x42e16d){breakingLicense[_0x1721('0x15')]=_0xab5896[_0x1721('0xd')];breakingLicense['message']=_0x42e16d[_0x1721('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x332232,_0x132c78){getLicense()[_0x1721('0xc')](function(_0x4b4b61){return db['User'][_0x1721('0x1e')]({'attributes':[_0x1721('0x1f'),[db['sequelize']['fn'](_0x1721('0x20'),db['sequelize']['col'](_0x1721('0x1f'))),_0x1721('0x21')]],'group':_0x1721('0x1f'),'where':{'role':{'$or':[_0x1721('0x22'),_0x1721('0x23'),'telephone']}},'raw':!![]})[_0x1721('0xc')](function(_0x5b79fc){var _0x4bc1f0={'user':_0x4b4b61[_0x1721('0x24')]||0x0,'telephone':_0x4b4b61[_0x1721('0x25')]||0x0};_0x5b79fc['forEach'](function(_0x407b96){var _0x1d7c26=_0x407b96['role']==='admin'?_0x1721('0x23'):_0x407b96[_0x1721('0x1f')];_0x4bc1f0[_0x1d7c26]-=_0x407b96[_0x1721('0x21')];if(_0x4bc1f0[_0x1d7c26]<0x0)_0x4bc1f0[_0x1d7c26]=0x0;});_0x332232(_0x4bc1f0);return;});})[_0x1721('0x26')](function(_0x1a67b3){_0x132c78(_0x1a67b3);});});}function checkUserLimits(_0x34d820){return new BPromise(function(_0x24a345,_0x82e28a){getLimits()[_0x1721('0xc')](function(_0x3d8ee5){var _0x2dffc4=_['pick'](_[_0x1721('0x27')](_0x34d820,'role'),[_0x1721('0x22'),_0x1721('0x23'),'telephone']);var _0x4e3968=(_0x2dffc4[_0x1721('0x22')]||0x0)+(_0x2dffc4[_0x1721('0x23')]||0x0);var _0x29acbb=_0x2dffc4['telephone']||0x0;if(_0x4e3968>_0x3d8ee5[_0x1721('0x23')])return _0x82e28a(_0x1721('0x28'));if(_0x29acbb>_0x3d8ee5['telephone'])return _0x82e28a(_0x1721('0x29'));return _0x24a345();})[_0x1721('0x26')](function(_0x51ccd4){_0x82e28a(_0x51ccd4);});});}module[_0x1721('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 133ba40..f863571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d25=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7d25,0x8a));var _0x57d2=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x7d25[_0x36884e];return _0x1cc367;};'use strict';module['exports']={'DOMAIN':_0x57d2('0x0'),'SESSION_SECRET':_0x57d2('0x1'),'GOOGLE_ID':_0x57d2('0x2'),'GOOGLE_SECRET':_0x57d2('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0x47c5=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x2794b2,_0x3616b6){var _0xc0e97e=function(_0x26d46e){while(--_0x26d46e){_0x2794b2['push'](_0x2794b2['shift']());}};_0xc0e97e(++_0x3616b6);}(_0x47c5,0x165));var _0x547c=function(_0x3b68b9,_0x4ee15a){_0x3b68b9=_0x3b68b9-0x0;var _0x16973f=_0x47c5[_0x3b68b9];return _0x16973f;};'use strict';module[_0x547c('0x0')]={'DOMAIN':_0x547c('0x1'),'SESSION_SECRET':_0x547c('0x2'),'GOOGLE_ID':_0x547c('0x3'),'GOOGLE_SECRET':_0x547c('0x4'),'DEBUG':''};
\ No newline at end of file
index 492f096..f11a94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a31=['exports','../utils/loggers','fileLogger'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0x3a31,0x85));var _0x13a3=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3a31[_0x501510];return _0x1e6ee5;};'use strict';var fileLogger=require(_0x13a3('0x0'))[_0x13a3('0x1')];module[_0x13a3('0x2')]=fileLogger;
\ No newline at end of file
+var _0x7b38=['exports','../utils/loggers','fileLogger'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0x7b38,0xb2));var _0x87b3=function(_0x2546e6,_0x1550f2){_0x2546e6=_0x2546e6-0x0;var _0x4ef144=_0x7b38[_0x2546e6];return _0x4ef144;};'use strict';var fileLogger=require(_0x87b3('0x0'))[_0x87b3('0x1')];module[_0x87b3('0x2')]=fileLogger;
\ No newline at end of file
index d955d6e..302e6e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f70=['../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','../../services/express/index.js','ami','join'];(function(_0x122d2b,_0x51696){var _0x3ebab7=function(_0x248d34){while(--_0x248d34){_0x122d2b['push'](_0x122d2b['shift']());}};_0x3ebab7(++_0x51696);}(_0x2f70,0x11c));var _0x02f7=function(_0x507dc0,_0x1f2f73){_0x507dc0=_0x507dc0-0x0;var _0x23b844=_0x2f70[_0x507dc0];return _0x23b844;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x02f7('0x0'),'script':path['join'](__dirname,_0x02f7('0x1'))},{'name':_0x02f7('0x2'),'script':path[_0x02f7('0x3')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path['join'](__dirname,_0x02f7('0x4'))},{'name':_0x02f7('0x5'),'script':path[_0x02f7('0x3')](__dirname,_0x02f7('0x6'))},{'name':_0x02f7('0x7'),'script':path[_0x02f7('0x3')](__dirname,_0x02f7('0x8'))},{'name':_0x02f7('0x9'),'script':path[_0x02f7('0x3')](__dirname,_0x02f7('0xa'))}]};module[_0x02f7('0xb')]=config;
\ No newline at end of file
+var _0x2cc1=['exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x33d2fd,_0x18bd4e){var _0x1c5533=function(_0x34bd36){while(--_0x34bd36){_0x33d2fd['push'](_0x33d2fd['shift']());}};_0x1c5533(++_0x18bd4e);}(_0x2cc1,0x6a));var _0x12cc=function(_0x537bcd,_0x13bae1){_0x537bcd=_0x537bcd-0x0;var _0x6cc881=_0x2cc1[_0x537bcd];return _0x6cc881;};'use strict';var path=require(_0x12cc('0x0'));var os=require('os');var config={'apps':[{'name':_0x12cc('0x1'),'script':path[_0x12cc('0x2')](__dirname,_0x12cc('0x3'))},{'name':_0x12cc('0x4'),'script':path['join'](__dirname,_0x12cc('0x5'))},{'name':_0x12cc('0x6'),'script':path[_0x12cc('0x2')](__dirname,_0x12cc('0x7'))},{'name':_0x12cc('0x8'),'script':path[_0x12cc('0x2')](__dirname,_0x12cc('0x9'))},{'name':_0x12cc('0xa'),'script':path[_0x12cc('0x2')](__dirname,_0x12cc('0xb'))},{'name':_0x12cc('0xc'),'script':path['join'](__dirname,_0x12cc('0xd'))}]};module[_0x12cc('0xe')]=config;
\ No newline at end of file
index 5b77b7d..52695d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ad4=['start','then','stop','disconnect','restart','list','describe','delete','dump','pm2','bluebird','connected'];(function(_0x1792c6,_0x5e5f01){var _0x250b50=function(_0x54429b){while(--_0x54429b){_0x1792c6['push'](_0x1792c6['shift']());}};_0x250b50(++_0x5e5f01);}(_0x2ad4,0xbd));var _0x42ad=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0x2ad4[_0x2134b7];return _0x6c5914;};'use strict';var pm2=require(_0x42ad('0x0'));var BPromise=require(_0x42ad('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x488a20,_0x502392){return pm2['connect'](function(_0x146bdc){if(_0x146bdc){return _0x502392(_0x146bdc);}return _0x488a20(_0x42ad('0x2'));});});};exports[_0x42ad('0x3')]=function(_0x1f5459){return connect()[_0x42ad('0x4')](function(){return new BPromise(function(_0x490932,_0x247410){return pm2[_0x42ad('0x3')](_0x1f5459,function(_0x379e3b,_0xad5186){if(_0x379e3b){return _0x247410(_0x379e3b);}pm2['disconnect']();return _0x490932(_0xad5186);});});});};exports[_0x42ad('0x5')]=function(_0x288dac){return connect()[_0x42ad('0x4')](function(){return new BPromise(function(_0x2024ba,_0x5dfd84){return pm2[_0x42ad('0x5')](_0x288dac,function(_0x34ddde,_0x51a9c8){if(_0x34ddde){return _0x5dfd84(_0x34ddde);}pm2[_0x42ad('0x6')]();return _0x2024ba(_0x51a9c8);});});});};exports[_0x42ad('0x7')]=function(_0x1c4820){return connect()[_0x42ad('0x4')](function(){return new BPromise(function(_0x3ee7e8,_0x4e4232){return pm2[_0x42ad('0x7')](_0x1c4820,function(_0x4e9cbe,_0x4e4b03){if(_0x4e9cbe){return _0x4e4232(_0x4e9cbe);}pm2[_0x42ad('0x6')]();return _0x3ee7e8(_0x4e4b03);});});});};exports[_0x42ad('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2f7702,_0x302abf){return pm2['list'](function(_0x2d0d1c,_0x235405){if(_0x2d0d1c){return _0x302abf(_0x2d0d1c);}pm2['disconnect']();return _0x2f7702(_0x235405);});});});};exports[_0x42ad('0x9')]=function(_0x463236){return connect()[_0x42ad('0x4')](function(){return new BPromise(function(_0x2d9889,_0x1ebf7d){return pm2[_0x42ad('0x9')](_0x463236,function(_0x1e0a8c,_0x1e358f){if(_0x1e0a8c){return _0x1ebf7d(_0x1e0a8c);}pm2[_0x42ad('0x6')]();return _0x2d9889(_0x1e358f);});});});};exports['delete']=function(_0x257e85){return connect()[_0x42ad('0x4')](function(){return new BPromise(function(_0x3171ce,_0x2deb85){return pm2[_0x42ad('0xa')](_0x257e85,function(_0x508a0c,_0x1e749b){if(_0x508a0c){return _0x2deb85(_0x508a0c);}pm2[_0x42ad('0x6')]();return _0x3171ce(_0x1e749b);});});});};exports[_0x42ad('0xb')]=function(){return connect()[_0x42ad('0x4')](function(){return new BPromise(function(_0x238344,_0x133cbc){return pm2[_0x42ad('0xb')](function(_0x40abc7){if(_0x40abc7){return _0x133cbc(_0x40abc7);}return _0x238344('saved');});});});};
\ No newline at end of file
+var _0x3eae=['list','describe','delete','dump','pm2','bluebird','connected','start','disconnect','stop','then','restart'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0x3eae,0x1cc));var _0xe3ea=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x3eae[_0x3c4062];return _0x3f5bf3;};'use strict';var pm2=require(_0xe3ea('0x0'));var BPromise=require(_0xe3ea('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x342b0c,_0xc0d6f6){return pm2['connect'](function(_0x2d26bd){if(_0x2d26bd){return _0xc0d6f6(_0x2d26bd);}return _0x342b0c(_0xe3ea('0x2'));});});};exports[_0xe3ea('0x3')]=function(_0x2d785b){return connect()['then'](function(){return new BPromise(function(_0x4aee09,_0x4164ed){return pm2['start'](_0x2d785b,function(_0x19fc3f,_0x5e66a9){if(_0x19fc3f){return _0x4164ed(_0x19fc3f);}pm2[_0xe3ea('0x4')]();return _0x4aee09(_0x5e66a9);});});});};exports[_0xe3ea('0x5')]=function(_0x40cdea){return connect()[_0xe3ea('0x6')](function(){return new BPromise(function(_0xc4743f,_0x50660c){return pm2[_0xe3ea('0x5')](_0x40cdea,function(_0x169ce2,_0x2ab86d){if(_0x169ce2){return _0x50660c(_0x169ce2);}pm2[_0xe3ea('0x4')]();return _0xc4743f(_0x2ab86d);});});});};exports[_0xe3ea('0x7')]=function(_0x5d8dbb){return connect()[_0xe3ea('0x6')](function(){return new BPromise(function(_0x5085c7,_0x32b92b){return pm2[_0xe3ea('0x7')](_0x5d8dbb,function(_0x1e8f59,_0x102e05){if(_0x1e8f59){return _0x32b92b(_0x1e8f59);}pm2[_0xe3ea('0x4')]();return _0x5085c7(_0x102e05);});});});};exports[_0xe3ea('0x8')]=function(){return connect()[_0xe3ea('0x6')](function(){return new BPromise(function(_0xcd11de,_0x37398a){return pm2['list'](function(_0x5173be,_0x44eb7b){if(_0x5173be){return _0x37398a(_0x5173be);}pm2['disconnect']();return _0xcd11de(_0x44eb7b);});});});};exports[_0xe3ea('0x9')]=function(_0x36c0d3){return connect()['then'](function(){return new BPromise(function(_0xfccdca,_0x150c60){return pm2[_0xe3ea('0x9')](_0x36c0d3,function(_0x3ca5b3,_0x1f241e){if(_0x3ca5b3){return _0x150c60(_0x3ca5b3);}pm2['disconnect']();return _0xfccdca(_0x1f241e);});});});};exports['delete']=function(_0x39f753){return connect()[_0xe3ea('0x6')](function(){return new BPromise(function(_0x1f3cae,_0x596e40){return pm2[_0xe3ea('0xa')](_0x39f753,function(_0x402106,_0xcdffbc){if(_0x402106){return _0x596e40(_0x402106);}pm2[_0xe3ea('0x4')]();return _0x1f3cae(_0xcdffbc);});});});};exports[_0xe3ea('0xb')]=function(){return connect()[_0xe3ea('0x6')](function(){return new BPromise(function(_0xcb2444,_0x45b508){return pm2[_0xe3ea('0xb')](function(_0xc4470f){if(_0xc4470f){return _0x45b508(_0xc4470f);}return _0xcb2444('saved');});});});};
\ No newline at end of file
index 24bc9d1..28f9ba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3164=['localhost','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','minutes','then','map','info','join','update','system','timeout','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','lodash','moment','../logger','schedule','redis','defaults'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x3164,0x123));var _0x4316=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0x3164[_0x118139];return _0x2fece9;};'use strict';var _=require(_0x4316('0x0'));var moment=require(_0x4316('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x4316('0x2'))(_0x4316('0x3'));config[_0x4316('0x4')]=_[_0x4316('0x5')](config[_0x4316('0x4')],{'host':_0x4316('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x20bfdf=0x0;var _0x3ff8c8=[];return db['Setting'][_0x4316('0x7')]({'raw':!![],'attributes':['id',_0x4316('0x8')],'where':{'id':0x1}})['then'](function(_0x3e377b){_0x20bfdf=_0x3e377b[_0x4316('0x8')];if(_0x20bfdf){return db[_0x4316('0x9')][_0x4316('0xa')]({'raw':!![],'attributes':['id',_0x4316('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3e377b[_0x4316('0x8')],_0x4316('0xc'))}}});}else{return[];}})[_0x4316('0xd')](function(_0x17700b){if(_0x17700b&&_0x17700b['length']){_0x3ff8c8=_[_0x4316('0xe')](_0x17700b||[],'id');logger[_0x4316('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3ff8c8[_0x4316('0x10')]());return db[_0x4316('0x9')][_0x4316('0x11')]({'closeReason':_0x4316('0x12'),'disposition':_0x4316('0x13'),'closed':!![],'closedAt':moment()[_0x4316('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3ff8c8}});}})[_0x4316('0xd')](function(){if(_0x3ff8c8&&_0x3ff8c8[_0x4316('0x15')]){logger[_0x4316('0xf')](_0x4316('0x16'),_0x3ff8c8['join']());for(var _0x28c662=0x0;_0x28c662<_0x3ff8c8[_0x4316('0x15')];_0x28c662++){io[_0x4316('0x17')]('chatInteraction:update',{'id':_0x3ff8c8[_0x28c662],'closed':!![]});}}})[_0x4316('0x18')](function(_0x40593e){logger[_0x4316('0x19')]('[CHAT]\x20Error\x20closing\x20interactions',_0x40593e?util[_0x4316('0x1a')](_0x40593e,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xabe5=['../../config/environment','../../mysqldb','../logger','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','subtract','minutes','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util'];(function(_0x46e0c0,_0x532ba3){var _0x5ca1d8=function(_0x50b3b5){while(--_0x50b3b5){_0x46e0c0['push'](_0x46e0c0['shift']());}};_0x5ca1d8(++_0x532ba3);}(_0xabe5,0xf4));var _0x5abe=function(_0x292cfd,_0x49f709){_0x292cfd=_0x292cfd-0x0;var _0x8abd26=_0xabe5[_0x292cfd];return _0x8abd26;};'use strict';var _=require(_0x5abe('0x0'));var moment=require(_0x5abe('0x1'));var Redis=require(_0x5abe('0x2'));var util=require(_0x5abe('0x3'));var config=require(_0x5abe('0x4'));var db=require(_0x5abe('0x5'))['db'];var logger=require(_0x5abe('0x6'))('schedule');config['redis']=_[_0x5abe('0x7')](config[_0x5abe('0x8')],{'host':_0x5abe('0x9'),'port':0x18eb});var io=require(_0x5abe('0xa'))(new Redis(config[_0x5abe('0x8')]));function closeInteractions(){var _0x1a8446=0x0;var _0x4d126f=[];return db[_0x5abe('0xb')][_0x5abe('0xc')]({'raw':!![],'attributes':['id',_0x5abe('0xd')],'where':{'id':0x1}})[_0x5abe('0xe')](function(_0x5a1f77){_0x1a8446=_0x5a1f77[_0x5abe('0xd')];if(_0x1a8446){return db[_0x5abe('0xf')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5abe('0x10')](_0x5a1f77[_0x5abe('0xd')],_0x5abe('0x11'))}}});}else{return[];}})[_0x5abe('0xe')](function(_0x4cdac5){if(_0x4cdac5&&_0x4cdac5[_0x5abe('0x12')]){_0x4d126f=_['map'](_0x4cdac5||[],'id');logger['info'](_0x5abe('0x13'),_0x4d126f[_0x5abe('0x14')]());return db[_0x5abe('0xf')][_0x5abe('0x15')]({'closeReason':_0x5abe('0x16'),'disposition':_0x5abe('0x17'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4d126f}});}})['then'](function(){if(_0x4d126f&&_0x4d126f[_0x5abe('0x12')]){logger['info'](_0x5abe('0x18'),_0x4d126f[_0x5abe('0x14')]());for(var _0xfe1187=0x0;_0xfe1187<_0x4d126f[_0x5abe('0x12')];_0xfe1187++){io['emit'](_0x5abe('0x19'),{'id':_0x4d126f[_0xfe1187],'closed':!![]});}}})[_0x5abe('0x1a')](function(_0x2a367f){logger[_0x5abe('0x1b')](_0x5abe('0x1c'),_0x2a367f?util[_0x5abe('0x1d')](_0x2a367f,{'showHidden':![],'depth':null}):'');});}exports[_0x5abe('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index c3492ba..8a78d15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f82=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x4f82,0x7f));var _0x24f8=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4f82[_0x565c49];return _0x20ca34;};'use strict';function start(){var _0x796a57=require(_0x24f8('0x0'));return _0x796a57[_0x24f8('0x1')]();}module[_0x24f8('0x2')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0x0f3a=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4ea6af,_0x4aa32e){var _0x4cb1e6=function(_0xc9edd0){while(--_0xc9edd0){_0x4ea6af['push'](_0x4ea6af['shift']());}};_0x4cb1e6(++_0x4aa32e);}(_0x0f3a,0x87));var _0xa0f3=function(_0x33c2b9,_0x4af1b4){_0x33c2b9=_0x33c2b9-0x0;var _0x102572=_0x0f3a[_0x33c2b9];return _0x102572;};'use strict';function start(){var _0x1a959d=require(_0xa0f3('0x0'));return _0x1a959d['startAllRefreshIntervals']();}module[_0xa0f3('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
index 164e569..34f3ed5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd475=['MailAccount','service','Smtp','host','port','secure','auth','user','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','../../files/reports','%s.%s','basename','extname','join','existsSync','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','attachments','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','toRun','index','cron','active','isBetween','startAt','start','add\x20cron','stop\x20cron','endAt','update\x20cron','run','util','lodash','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xd475,0x1ec));var _0x5d47=function(_0x3f7971,_0x385d53){_0x3f7971=_0x3f7971-0x0;var _0xd9c6e4=_0xd475[_0x3f7971];return _0xd9c6e4;};'use strict';var fs=require('fs');var util=require(_0x5d47('0x0'));var path=require('path');var _=require(_0x5d47('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x5d47('0x2'));var BPromise=require(_0x5d47('0x3'));var logger=require('../logger')(_0x5d47('0x4'));var db=require(_0x5d47('0x5'))['db'];var analyticCustomReportController=require(_0x5d47('0x6'));var analyticDefaultReportController=require(_0x5d47('0x7'));var client=jayson[_0x5d47('0x8')][_0x5d47('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5a0296,_0x27e9db){return function(){logger['info'](_0x5d47('0xa'),_0x5a0296[_0x5d47('0xb')]);var _0x30884a=!![];var _0x5ee9dc={'tls':{'rejectUnauthorized':![]}};if(_0x5a0296[_0x5d47('0xc')]['Smtp']['service']){_0x5ee9dc[_0x5d47('0xd')]=_0x5a0296[_0x5d47('0xc')][_0x5d47('0xe')][_0x5d47('0xd')];}else{_0x5ee9dc[_0x5d47('0xf')]=_0x5a0296[_0x5d47('0xc')][_0x5d47('0xe')][_0x5d47('0xf')];_0x5ee9dc[_0x5d47('0x10')]=_0x5a0296[_0x5d47('0xc')][_0x5d47('0xe')][_0x5d47('0x10')];_0x5ee9dc[_0x5d47('0x11')]=_0x5a0296[_0x5d47('0xc')]['Smtp'][_0x5d47('0x11')];}if(_0x5a0296['MailAccount']['Smtp']['authentication']){_0x5ee9dc[_0x5d47('0x12')]={'user':_0x5a0296[_0x5d47('0xc')][_0x5d47('0xe')][_0x5d47('0x13')],'pass':_0x5a0296[_0x5d47('0xc')]['Smtp']['pass']};}var _0x579163={'account':_0x5ee9dc,'message':{'from':util[_0x5d47('0x14')](_0x5d47('0x15'),_0x5a0296['MailAccount']['name'],_0x5a0296[_0x5d47('0xc')]['email']||_0x5a0296[_0x5d47('0xc')]['Smtp']['user']),'to':_0x5a0296[_0x5d47('0xb')],'cc':_0x5a0296['cc'],'bcc':_0x5a0296[_0x5d47('0x16')],'subject':util[_0x5d47('0x14')](_0x5d47('0x17'),_0x27e9db[_0x5d47('0x18')],_0x5a0296[_0x5d47('0x19')],_0x5a0296['subtractUnit'])}};var _0x85aa3b=path['join'](__dirname,_0x5d47('0x1a'));var _0x5dba8f=_0x27e9db['savename'];var _0x5f3f83=util['format'](_0x5d47('0x1b'),path[_0x5d47('0x1c')](_0x27e9db['savename'],path[_0x5d47('0x1d')](_0x27e9db['savename'])),'zip');var _0x4a9073=path[_0x5d47('0x1e')](_0x85aa3b,_0x5dba8f);var _0x3bd035=path[_0x5d47('0x1e')](_0x85aa3b,_0x5f3f83);if(fs[_0x5d47('0x1f')](_0x4a9073)){_0x27e9db['status']=_0x5d47('0x20');_0x579163[_0x5d47('0x21')]['attachments']=[{'filename':_0x5dba8f,'path':_0x4a9073}];_0x579163['message']['text']=util[_0x5d47('0x14')](_0x5d47('0x22'),JSON[_0x5d47('0x23')](_0x27e9db,null,0x2));}else if(fs[_0x5d47('0x1f')](_0x3bd035)){_0x27e9db[_0x5d47('0x24')]='Sent';_0x579163[_0x5d47('0x21')][_0x5d47('0x25')]=[{'filename':_0x5f3f83,'path':_0x3bd035}];}else{_0x579163[_0x5d47('0x21')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5a0296[_0x5d47('0x26')]){_0x30884a=![];logger[_0x5d47('0x27')](_0x5d47('0x28'));}}if(_0x30884a){return client[_0x5d47('0x29')](_0x5d47('0x2a'),_0x579163)[_0x5d47('0x2b')](function(_0x5abdea){if(_0x5abdea[_0x5d47('0x2c')]){return logger[_0x5d47('0x2c')](_0x5d47('0x2d'),JSON[_0x5d47('0x23')](_0x5abdea));}return logger[_0x5d47('0x27')]('email\x20sent');})[_0x5d47('0x2e')](function(_0x411d69){return logger[_0x5d47('0x2c')](_0x5d47('0x2d'),JSON[_0x5d47('0x23')](_0x411d69));});}};}function handleError(){return function(_0x5a1a1a){return logger[_0x5d47('0x2c')](JSON['stringify'](_0x5a1a1a));};}function handleResult(_0x537ae8){return function(_0x3bb410){logger['info'](_0x5d47('0x2f'),JSON[_0x5d47('0x23')](_0x3bb410));if(_0x537ae8[_0x5d47('0xc')]&&_0x537ae8[_0x5d47('0xc')][_0x5d47('0xe')]&&!_['isNil'](_0x537ae8[_0x5d47('0xb')])){setTimeout(handleSendEmail(_0x537ae8,_0x3bb410),0x3c*0x3e8);}};}function handleJob(_0x56e1e0){return function(){try{if(_[_0x5d47('0x30')](_0x56e1e0['subtractNumber'])){return logger[_0x5d47('0x27')](_0x5d47('0x31'));}if(_[_0x5d47('0x30')](_0x56e1e0[_0x5d47('0x32')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x3f0a90={'startDate':moment()[_0x5d47('0x33')](_0x56e1e0[_0x5d47('0x19')],_0x56e1e0[_0x5d47('0x32')])[_0x5d47('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x5d47('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x5d47('0x34'),'output':_0x56e1e0['output'],'name':_0x56e1e0[_0x5d47('0x18')]};if(!_[_0x5d47('0x30')](_0x56e1e0[_0x5d47('0x35')])){logger[_0x5d47('0x27')](_0x5d47('0x36'),_0x56e1e0[_0x5d47('0x35')]);return analyticDefaultReportController[_0x5d47('0x37')]({'id':_0x56e1e0[_0x5d47('0x35')]},_0x3f0a90)[_0x5d47('0x2b')](handleResult(_0x56e1e0))['catch'](handleError());}if(!_[_0x5d47('0x30')](_0x56e1e0[_0x5d47('0x38')])){logger[_0x5d47('0x27')](_0x5d47('0x39'),_0x56e1e0[_0x5d47('0x38')]);return analyticCustomReportController[_0x5d47('0x37')]({'id':_0x56e1e0[_0x5d47('0x38')]},_0x3f0a90)[_0x5d47('0x2b')](handleResult(_0x56e1e0))['catch'](handleError());}}catch(_0x4864ff){logger[_0x5d47('0x2c')](JSON['stringify'](_0x4864ff));}return logger[_0x5d47('0x27')](_0x5d47('0x3a'));};}function getJobs(_0x48e7a8){var _0x51d8d2={};if(_0x48e7a8){_0x51d8d2['id']=_0x48e7a8;}return db[_0x5d47('0x3b')][_0x5d47('0x3c')]({'where':_0x51d8d2,'include':[{'model':db[_0x5d47('0xc')],'attributes':['id',_0x5d47('0x18'),_0x5d47('0xb')],'include':[{'model':db[_0x5d47('0x3d')],'as':_0x5d47('0xe')}]}]})[_0x5d47('0x2b')](function(_0x42655b){var _0x2dc8e9=_['keys'](manager[_0x5d47('0x3e')]);var _0x2cf1ad=_[_0x5d47('0x3f')](_0x42655b,function(_0x4bcd04){return _0x4bcd04['id'][_0x5d47('0x40')]();});var _0x581da9=_[_0x5d47('0x41')](_0x42655b,function(_0x4c42a6){return _0x4c42a6['id'][_0x5d47('0x40')]();});var _0x3a5709=_0x48e7a8?_0x2cf1ad:_[_0x5d47('0x42')](_0x2cf1ad,_0x2dc8e9);var _0x1f38c5=_[_0x5d47('0x43')](_0x2cf1ad,_0x2dc8e9);var _0x2eb0b4=_[_0x5d47('0x42')](_0x2dc8e9,_0x2cf1ad);var _0x43c2fd;var _0x102335;for(_0x43c2fd=0x0;_0x43c2fd<_0x2eb0b4[_0x5d47('0x44')]&&!_0x48e7a8;_0x43c2fd+=0x1){_0x102335=_0x2eb0b4[_0x43c2fd][_0x5d47('0x40')]();if(manager[_0x5d47('0x45')](_0x102335)){manager[_0x5d47('0x46')](_0x102335);manager[_0x5d47('0x47')](_0x102335);logger[_0x5d47('0x27')]('delete\x20cron',_0x102335);}}logger[_0x5d47('0x27')](_0x5d47('0x48'),JSON[_0x5d47('0x23')](_0x3a5709));for(_0x43c2fd=0x0;_0x43c2fd<_0x3a5709[_0x5d47('0x44')];_0x43c2fd+=0x1){_0x102335=_0x3a5709[_0x43c2fd]['toString']();logger[_0x5d47('0x27')](_0x5d47('0x49'),_0x102335);if(_0x48e7a8){logger[_0x5d47('0x27')]('my\x20id',_0x48e7a8);logger[_0x5d47('0x27')](JSON[_0x5d47('0x23')](_0x581da9[_0x102335]));BPromise['resolve']()[_0x5d47('0x2b')](handleJob(_0x581da9[_0x102335]));logger['info']('run\x20job',_0x581da9[_0x102335][_0x5d47('0x18')],_0x581da9[_0x102335][_0x5d47('0x4a')]);}else if(_0x581da9[_0x102335][_0x5d47('0x4a')]&&_0x581da9[_0x102335][_0x5d47('0x4b')]&&moment()[_0x5d47('0x4c')](_0x581da9[_0x102335][_0x5d47('0x4d')],_0x581da9[_0x102335]['endAt'])){manager['add'](_0x102335,_0x581da9[_0x102335]['cron'],handleJob(_0x581da9[_0x102335]));manager[_0x5d47('0x4e')](_0x102335);logger['info'](_0x5d47('0x4f'),_0x581da9[_0x102335]['name'],_0x581da9[_0x102335][_0x5d47('0x4a')]);}else if(manager[_0x5d47('0x45')](_0x102335)){manager['stop'](_0x102335);manager['deleteJob'](_0x102335);logger[_0x5d47('0x27')](_0x5d47('0x50'),_0x581da9[_0x102335][_0x5d47('0x18')],_0x581da9[_0x102335]['cron']);}}for(_0x43c2fd=0x0,_0x102335;_0x43c2fd<_0x1f38c5[_0x5d47('0x44')]&&!_0x48e7a8;_0x43c2fd+=0x1){_0x102335=_0x1f38c5[_0x43c2fd]['toString']();if(manager[_0x5d47('0x45')](_0x102335)){if(_0x581da9[_0x102335][_0x5d47('0x4a')]&&_0x581da9[_0x102335][_0x5d47('0x4b')]&&moment()['isBetween'](_0x581da9[_0x102335][_0x5d47('0x4d')],_0x581da9[_0x102335][_0x5d47('0x51')])){manager['update'](_0x102335,_0x581da9[_0x102335]['cron'],handleJob(_0x581da9[_0x102335]));logger[_0x5d47('0x27')](_0x5d47('0x52'),_0x581da9[_0x102335][_0x5d47('0x18')],_0x581da9[_0x102335][_0x5d47('0x4a')]);}else{manager['stop'](_0x102335);manager[_0x5d47('0x47')](_0x102335);logger[_0x5d47('0x27')](_0x5d47('0x50'),_0x581da9[_0x102335][_0x5d47('0x18')],_0x581da9[_0x102335][_0x5d47('0x4a')]);}}}})[_0x5d47('0x2e')](function(_0x476f72){logger[_0x5d47('0x2c')](JSON[_0x5d47('0x23')](_0x476f72));});}exports[_0x5d47('0x53')]=function(_0x2006a7){return getJobs(_0x2006a7);};exports[_0x5d47('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x58c1=['sendIfEmpty','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','active','isBetween','startAt','endAt','add','add\x20cron','cron','update\x20cron','stop\x20cron','run','start','util','path','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports','savename','%s.%s','basename','extname','zip','join','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x4f8368,_0x161067){var _0x79714e=function(_0x3121ca){while(--_0x3121ca){_0x4f8368['push'](_0x4f8368['shift']());}};_0x79714e(++_0x161067);}(_0x58c1,0x1da));var _0x158c=function(_0x26aa16,_0x3661f8){_0x26aa16=_0x26aa16-0x0;var _0x5e8740=_0x58c1[_0x26aa16];return _0x5e8740;};'use strict';var fs=require('fs');var util=require(_0x158c('0x0'));var path=require(_0x158c('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x158c('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x158c('0x3'));var logger=require(_0x158c('0x4'))(_0x158c('0x5'));var db=require(_0x158c('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x158c('0x7'));var client=jayson[_0x158c('0x8')][_0x158c('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x55ca94,_0x20d502){return function(){logger[_0x158c('0xa')](_0x158c('0xb'),_0x55ca94[_0x158c('0xc')]);var _0x3082d3=!![];var _0x58832d=_0x55ca94[_0x158c('0xd')][_0x158c('0xe')]();var _0x49f610={'account':_0x58832d,'message':{'from':util[_0x158c('0xf')]('\x22%s\x22\x20<%s>',_0x55ca94[_0x158c('0xd')]['name'],_0x55ca94[_0x158c('0xd')][_0x158c('0xc')]||_0x55ca94[_0x158c('0xd')][_0x158c('0x10')][_0x158c('0x11')]),'to':_0x55ca94['email'],'cc':_0x55ca94['cc'],'bcc':_0x55ca94[_0x158c('0x12')],'subject':util['format'](_0x158c('0x13'),_0x20d502['name'],_0x55ca94[_0x158c('0x14')],_0x55ca94['subtractUnit'])}};var _0x409a42=path['join'](__dirname,_0x158c('0x15'));var _0x4f4d7b=_0x20d502[_0x158c('0x16')];var _0x3ca30c=util['format'](_0x158c('0x17'),path[_0x158c('0x18')](_0x20d502[_0x158c('0x16')],path[_0x158c('0x19')](_0x20d502[_0x158c('0x16')])),_0x158c('0x1a'));var _0x421163=path[_0x158c('0x1b')](_0x409a42,_0x4f4d7b);var _0x3ed5b1=path[_0x158c('0x1b')](_0x409a42,_0x3ca30c);if(fs['existsSync'](_0x421163)){_0x20d502[_0x158c('0x1c')]=_0x158c('0x1d');_0x49f610[_0x158c('0x1e')][_0x158c('0x1f')]=[{'filename':_0x4f4d7b,'path':_0x421163}];_0x49f610[_0x158c('0x1e')][_0x158c('0x20')]=util[_0x158c('0xf')](_0x158c('0x21'),JSON[_0x158c('0x22')](_0x20d502,null,0x2));}else if(fs['existsSync'](_0x3ed5b1)){_0x20d502[_0x158c('0x1c')]=_0x158c('0x1d');_0x49f610[_0x158c('0x1e')][_0x158c('0x1f')]=[{'filename':_0x3ca30c,'path':_0x3ed5b1}];}else{_0x49f610[_0x158c('0x1e')][_0x158c('0x20')]=_0x158c('0x23');if(!_0x55ca94[_0x158c('0x24')]){_0x3082d3=![];logger[_0x158c('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3082d3){return client[_0x158c('0x25')](_0x158c('0x26'),_0x49f610)[_0x158c('0x27')](function(_0x250040){if(_0x250040[_0x158c('0x28')]){return logger[_0x158c('0x28')](_0x158c('0x29'),JSON[_0x158c('0x22')](_0x250040));}return logger[_0x158c('0xa')]('email\x20sent');})[_0x158c('0x2a')](function(_0x4b6d9f){return logger[_0x158c('0x28')](_0x158c('0x29'),JSON[_0x158c('0x22')](_0x4b6d9f));});}};}function handleError(){return function(_0x3ce16e){return logger[_0x158c('0x28')](JSON[_0x158c('0x22')](_0x3ce16e));};}function handleResult(_0x20401e){return function(_0xbffc7f){logger[_0x158c('0xa')](_0x158c('0x2b'),JSON['stringify'](_0xbffc7f));if(_0x20401e[_0x158c('0xd')]&&_0x20401e[_0x158c('0xd')][_0x158c('0x10')]&&!_[_0x158c('0x2c')](_0x20401e[_0x158c('0xc')])){setTimeout(handleSendEmail(_0x20401e,_0xbffc7f),0x3c*0x3e8);}};}function handleJob(_0x507687){return function(){try{if(_[_0x158c('0x2c')](_0x507687[_0x158c('0x14')])){return logger['info'](_0x158c('0x2d'));}if(_[_0x158c('0x2c')](_0x507687[_0x158c('0x2e')])){return logger[_0x158c('0xa')]('subtractUnit\x20null\x20or\x20undefined');}var _0x220c02={'startDate':moment()['subtract'](_0x507687[_0x158c('0x14')],_0x507687[_0x158c('0x2e')])['format'](_0x158c('0x2f')),'endDate':moment()[_0x158c('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x158c('0x30'),'output':_0x507687['output'],'name':_0x507687[_0x158c('0x31')]};if(!_[_0x158c('0x2c')](_0x507687[_0x158c('0x32')])){logger[_0x158c('0xa')](_0x158c('0x33'),_0x507687[_0x158c('0x32')]);return analyticDefaultReportController[_0x158c('0x34')]({'id':_0x507687[_0x158c('0x32')]},_0x220c02)[_0x158c('0x27')](handleResult(_0x507687))['catch'](handleError());}if(!_['isNil'](_0x507687['CustomReportId'])){logger[_0x158c('0xa')](_0x158c('0x35'),_0x507687[_0x158c('0x36')]);return analyticCustomReportController['runReport']({'id':_0x507687[_0x158c('0x36')]},_0x220c02)[_0x158c('0x27')](handleResult(_0x507687))[_0x158c('0x2a')](handleError());}}catch(_0x503f22){logger[_0x158c('0x28')](JSON[_0x158c('0x22')](_0x503f22));}return logger[_0x158c('0xa')](_0x158c('0x37'));};}function getJobs(_0x1c9580){var _0x1174e0={};if(_0x1c9580){_0x1174e0['id']=_0x1c9580;}return db[_0x158c('0x38')]['findAll']({'where':_0x1174e0,'include':[{'model':db[_0x158c('0xd')],'attributes':['id','name',_0x158c('0xc')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x158c('0x39')],'as':_0x158c('0x39')}]}]}]})[_0x158c('0x27')](function(_0x35aa5f){var _0x34db37=_[_0x158c('0x3a')](manager[_0x158c('0x3b')]);var _0x203252=_[_0x158c('0x3c')](_0x35aa5f,function(_0x2f408a){return _0x2f408a['id'][_0x158c('0x3d')]();});var _0x4805dc=_[_0x158c('0x3e')](_0x35aa5f,function(_0x37feac){return _0x37feac['id'][_0x158c('0x3d')]();});var _0x252542=_0x1c9580?_0x203252:_[_0x158c('0x3f')](_0x203252,_0x34db37);var _0x564bd3=_[_0x158c('0x40')](_0x203252,_0x34db37);var _0x2a022e=_[_0x158c('0x3f')](_0x34db37,_0x203252);var _0x42b09a;var _0x2f84d2;for(_0x42b09a=0x0;_0x42b09a<_0x2a022e[_0x158c('0x41')]&&!_0x1c9580;_0x42b09a+=0x1){_0x2f84d2=_0x2a022e[_0x42b09a][_0x158c('0x3d')]();if(manager[_0x158c('0x42')](_0x2f84d2)){manager[_0x158c('0x43')](_0x2f84d2);manager[_0x158c('0x44')](_0x2f84d2);logger[_0x158c('0xa')](_0x158c('0x45'),_0x2f84d2);}}logger[_0x158c('0xa')](_0x158c('0x46'),JSON[_0x158c('0x22')](_0x252542));for(_0x42b09a=0x0;_0x42b09a<_0x252542[_0x158c('0x41')];_0x42b09a+=0x1){_0x2f84d2=_0x252542[_0x42b09a][_0x158c('0x3d')]();logger[_0x158c('0xa')]('index',_0x2f84d2);if(_0x1c9580){logger[_0x158c('0xa')](_0x158c('0x47'),_0x1c9580);logger[_0x158c('0xa')](JSON[_0x158c('0x22')](_0x4805dc[_0x2f84d2]));BPromise[_0x158c('0x48')]()[_0x158c('0x27')](handleJob(_0x4805dc[_0x2f84d2]));logger[_0x158c('0xa')](_0x158c('0x49'),_0x4805dc[_0x2f84d2][_0x158c('0x31')],_0x4805dc[_0x2f84d2]['cron']);}else if(_0x4805dc[_0x2f84d2]['cron']&&_0x4805dc[_0x2f84d2][_0x158c('0x4a')]&&moment()[_0x158c('0x4b')](_0x4805dc[_0x2f84d2][_0x158c('0x4c')],_0x4805dc[_0x2f84d2][_0x158c('0x4d')])){manager[_0x158c('0x4e')](_0x2f84d2,_0x4805dc[_0x2f84d2]['cron'],handleJob(_0x4805dc[_0x2f84d2]));manager['start'](_0x2f84d2);logger[_0x158c('0xa')](_0x158c('0x4f'),_0x4805dc[_0x2f84d2][_0x158c('0x31')],_0x4805dc[_0x2f84d2][_0x158c('0x50')]);}else if(manager[_0x158c('0x42')](_0x2f84d2)){manager[_0x158c('0x43')](_0x2f84d2);manager[_0x158c('0x44')](_0x2f84d2);logger['info']('stop\x20cron',_0x4805dc[_0x2f84d2]['name'],_0x4805dc[_0x2f84d2][_0x158c('0x50')]);}}for(_0x42b09a=0x0,_0x2f84d2;_0x42b09a<_0x564bd3[_0x158c('0x41')]&&!_0x1c9580;_0x42b09a+=0x1){_0x2f84d2=_0x564bd3[_0x42b09a][_0x158c('0x3d')]();if(manager[_0x158c('0x42')](_0x2f84d2)){if(_0x4805dc[_0x2f84d2]['cron']&&_0x4805dc[_0x2f84d2]['active']&&moment()[_0x158c('0x4b')](_0x4805dc[_0x2f84d2][_0x158c('0x4c')],_0x4805dc[_0x2f84d2]['endAt'])){manager['update'](_0x2f84d2,_0x4805dc[_0x2f84d2][_0x158c('0x50')],handleJob(_0x4805dc[_0x2f84d2]));logger[_0x158c('0xa')](_0x158c('0x51'),_0x4805dc[_0x2f84d2]['name'],_0x4805dc[_0x2f84d2][_0x158c('0x50')]);}else{manager['stop'](_0x2f84d2);manager['deleteJob'](_0x2f84d2);logger[_0x158c('0xa')](_0x158c('0x52'),_0x4805dc[_0x2f84d2][_0x158c('0x31')],_0x4805dc[_0x2f84d2][_0x158c('0x50')]);}}}})[_0x158c('0x2a')](function(_0x465429){logger[_0x158c('0x28')](JSON['stringify'](_0x465429));});}exports[_0x158c('0x53')]=function(_0x2044c4){return getJobs(_0x2044c4);};exports[_0x158c('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index ffa78dd..66bf913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a00=['lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','then','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Neutral','FAILED','resolve','Sentiment\x20Analysis\x20not\x20requested','Transcript\x20not\x20available','Sentiment','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','all','catch'];(function(_0x246052,_0x409e3d){var _0x4ca2d3=function(_0x31c19b){while(--_0x31c19b){_0x246052['push'](_0x246052['shift']());}};_0x4ca2d3(++_0x409e3d);}(_0x6a00,0xc9));var _0x06a0=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6a00[_0x4243a3];return _0x1b2a33;};var _=require(_0x06a0('0x0'));var AWS=require(_0x06a0('0x1'));var rp=require('request-promise');var util=require(_0x06a0('0x2'));var BPromise=require(_0x06a0('0x3'));var db=require(_0x06a0('0x4'))['db'];var logger=require(_0x06a0('0x5'))(_0x06a0('0x6'));function getTranscriptionJob(_0x47fa1f,_0x4a423e,_0x34c32c,_0x3b042f){return new Promise(function(_0x1de0c2,_0xa49954){var _0xa78ab8=new AWS[(_0x06a0('0x7'))]({'accessKeyId':_0x4a423e,'secretAccessKey':_0x47fa1f,'region':_0x34c32c});_0xa78ab8['getTranscriptionJob']({'TranscriptionJobName':_0x3b042f},function(_0xac416d,_0x22d146){if(_0xac416d){return _0xa49954(_0xac416d);}else{return _0x1de0c2(_0x22d146);}});});}function sentiment(_0x91eaab,_0x35af04,_0x38a7d3,_0x26c616,_0x4109fd){return new Promise(function(_0x1a3df3,_0x469f3d){var _0x380d12=new AWS[(_0x06a0('0x8'))]({'accessKeyId':_0x35af04,'secretAccessKey':_0x91eaab,'region':_0x38a7d3});_0x380d12['detectSentiment']({'Text':_0x26c616,'LanguageCode':_0x4109fd['substring'](0x0,0x2)},function(_0x2155d6,_0x4103c8){if(_0x2155d6){return _0x469f3d(_0x2155d6);}else{return _0x1a3df3(_0x4103c8);}});});}function checkTranscribeJob(_0x43279d,_0x1d2b7f,_0x688bf0){var _0x177234;return new BPromise(function(_0x2f9712,_0x33f494){logger['info'](util[_0x06a0('0x9')](_0x06a0('0xa'),_0x43279d['id'],_0x43279d[_0x06a0('0xb')]));return getTranscriptionJob(_0x688bf0['data1'],_0x688bf0[_0x06a0('0xc')],_0x1d2b7f[_0x06a0('0xd')],_0x43279d[_0x06a0('0xb')])['then'](function(_0x4083e7){logger[_0x06a0('0xe')](util['format'](_0x06a0('0xf'),_0x43279d['id'],_0x43279d[_0x06a0('0xb')],_0x4083e7[_0x06a0('0x10')][_0x06a0('0x11')]));if(!_0x43279d[_0x06a0('0x12')]){switch(_0x4083e7['TranscriptionJob'][_0x06a0('0x11')]){case _0x06a0('0x13'):var _0x35e239={'transcribeStatus':_0x4083e7[_0x06a0('0x10')][_0x06a0('0x11')],'fileUri':_0x4083e7[_0x06a0('0x10')][_0x06a0('0x14')][_0x06a0('0x15')]};logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x43279d['id']));return rp({'uri':_0x4083e7[_0x06a0('0x10')][_0x06a0('0x14')][_0x06a0('0x15')],'json':!![]})[_0x06a0('0x16')](function(_0x422603){logger[_0x06a0('0xe')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x43279d['id']));if(_0x422603&&_0x422603[_0x06a0('0x17')]&&_0x422603[_0x06a0('0x17')]['transcripts']&&_0x422603[_0x06a0('0x17')][_0x06a0('0x18')][_0x06a0('0x19')]){_0x35e239['fileText']='';for(var _0x98ae05=0x0;_0x98ae05<_0x422603[_0x06a0('0x17')]['transcripts']['length'];_0x98ae05++){_0x35e239['fileText']+=_0x422603[_0x06a0('0x17')][_0x06a0('0x18')][_0x98ae05][_0x06a0('0x1a')]+'';}}return _0x43279d[_0x06a0('0x1b')](_0x35e239);})[_0x06a0('0x16')](function(){logger[_0x06a0('0xe')](util[_0x06a0('0x9')](_0x06a0('0x1c'),_0x43279d['id']));if(!_0x43279d[_0x06a0('0x1d')]){throw new db['Sequelize'][(_0x06a0('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1d2b7f[_0x06a0('0x1f')]||!_0x1d2b7f[_0x06a0('0x20')]||!_0x1d2b7f[_0x06a0('0x21')]||!_0x1d2b7f[_0x06a0('0x22')]||!_0x1d2b7f[_0x06a0('0x23')]){throw new db[(_0x06a0('0x24'))][(_0x06a0('0x1e'))](_0x06a0('0x25'));}if(!_0x35e239[_0x06a0('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x1d2b7f[_0x06a0('0x20')]===_0x688bf0['id']){return _0x688bf0;}else{return db[_0x06a0('0x26')][_0x06a0('0x27')]({'where':{'id':_settings[_0x06a0('0x20')]}});}})[_0x06a0('0x16')](function(_0x485e26){if(!_0x485e26){throw new db[(_0x06a0('0x24'))]['ValidationError'](_0x06a0('0x28'));}if(!_0x485e26[_0x06a0('0x29')]||!_0x485e26['data2']){throw new db['Sequelize'][(_0x06a0('0x1e'))](_0x06a0('0x2a'));}_0x177234=_0x485e26;logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x43279d['id']));return sentiment(_0x177234[_0x06a0('0x29')],_0x177234['data2'],_0x1d2b7f[_0x06a0('0x21')],_0x35e239[_0x06a0('0x12')],_0x1d2b7f['language']);})[_0x06a0('0x16')](function(_0x12ffdb){logger['info'](util[_0x06a0('0x9')](_0x06a0('0x2b'),_0x43279d['id']));return _0x43279d['update']({'sentiment':_0x12ffdb['Sentiment'],'sPositive':_0x12ffdb[_0x06a0('0x2c')][_0x06a0('0x2d')],'sNegative':_0x12ffdb['SentimentScore'][_0x06a0('0x2e')],'sMixed':_0x12ffdb[_0x06a0('0x2c')]['Mixed'],'sNeutral':_0x12ffdb[_0x06a0('0x2c')][_0x06a0('0x2f')]});})[_0x06a0('0x16')](function(){logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x43279d['id']));_0x2f9712();});case _0x06a0('0x30'):return _0x43279d[_0x06a0('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x4083e7[_0x06a0('0x10')]['FailureReason']})[_0x06a0('0x16')](function(){logger[_0x06a0('0xe')](util[_0x06a0('0x9')](_0x06a0('0x1c'),_0x43279d['id']));_0x2f9712();});default:logger[_0x06a0('0xe')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x43279d['id']));break;}}else{return BPromise[_0x06a0('0x31')]()[_0x06a0('0x16')](function(){if(!_0x43279d[_0x06a0('0x1d')]){throw new db[(_0x06a0('0x24'))][(_0x06a0('0x1e'))](_0x06a0('0x32'));}if(!_0x1d2b7f[_0x06a0('0x1f')]||!_0x1d2b7f['sentimentAccountId']||!_0x1d2b7f['sentimentRegion']||!_0x1d2b7f[_0x06a0('0x22')]||!_0x1d2b7f['bucket']){throw new db['Sequelize']['ValidationError'](_0x06a0('0x25'));}if(!_0x43279d['fileText']){throw new Error(_0x06a0('0x33'));}if(_0x1d2b7f[_0x06a0('0x20')]===_0x688bf0['id']){return _0x688bf0;}else{return db[_0x06a0('0x26')][_0x06a0('0x27')]({'where':{'id':_settings[_0x06a0('0x20')]}});}})[_0x06a0('0x16')](function(_0x5ce0dd){if(!_0x5ce0dd){throw new db['Sequelize'][(_0x06a0('0x1e'))](_0x06a0('0x28'));}if(!_0x5ce0dd[_0x06a0('0x29')]||!_0x5ce0dd['data2']){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x177234=_0x5ce0dd;logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x43279d['id']));return sentiment(_0x177234['data1'],_0x177234['data2'],_0x1d2b7f[_0x06a0('0x21')],_0x43279d['fileText'],_0x1d2b7f[_0x06a0('0x22')]);})['then'](function(_0x208681){logger[_0x06a0('0xe')](util['format'](_0x06a0('0x2b'),_0x43279d['id']));return _0x43279d['update']({'sentiment':_0x208681[_0x06a0('0x34')],'sPositive':_0x208681[_0x06a0('0x2c')][_0x06a0('0x2d')],'sNegative':_0x208681[_0x06a0('0x2c')][_0x06a0('0x2e')],'sMixed':_0x208681[_0x06a0('0x2c')]['Mixed'],'sNeutral':_0x208681[_0x06a0('0x2c')][_0x06a0('0x2f')],'transcribeStatus':'COMPLETED'});})[_0x06a0('0x16')](function(){logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x43279d['id']));_0x2f9712();});}})['catch'](function(_0x4121f6){if(_0x4121f6){if(!_0x4121f6[_0x06a0('0x35')]||_0x4121f6[_0x06a0('0x35')]!==_0x06a0('0x36')){logger[_0x06a0('0x37')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x43279d['id']),util[_0x06a0('0x38')](_0x4121f6,{'showHidden':![],'depth':null}));}}_0x2f9712();});});}function checkTranscribe(){var _0x42921a;var _0x1b7ca7;var _0x423bc0;return db[_0x06a0('0x39')][_0x06a0('0x3a')]({'where':{'transcribeStatus':_0x06a0('0x3b')}})[_0x06a0('0x16')](function(_0x3cddf6){if(!_0x3cddf6||!_0x3cddf6['length']){throw new db[(_0x06a0('0x24'))][(_0x06a0('0x1e'))](_0x06a0('0x3c'));}_0x42921a=_0x3cddf6;return db[_0x06a0('0x3d')][_0x06a0('0x27')]({'where':{'id':0x1}});})[_0x06a0('0x16')](function(_0x4e9351){if(!_0x4e9351){throw new db['Sequelize'][(_0x06a0('0x1e'))](_0x06a0('0x3e'));}_0x1b7ca7=_0x4e9351;if(!_0x1b7ca7[_0x06a0('0x6')]||!_0x1b7ca7[_0x06a0('0x3f')]||!_0x1b7ca7[_0x06a0('0xd')]||!_0x1b7ca7['language']||!_0x1b7ca7[_0x06a0('0x23')]){throw new db['Sequelize'][(_0x06a0('0x1e'))](_0x06a0('0x40'));}return db[_0x06a0('0x26')]['findOne']({'where':{'id':_0x1b7ca7[_0x06a0('0x3f')]}});})[_0x06a0('0x16')](function(_0x207989){if(!_0x207989){throw new db[(_0x06a0('0x24'))][(_0x06a0('0x1e'))](_0x06a0('0x28'));}if(!_0x207989['data1']||!_0x207989[_0x06a0('0xc')]){throw new db['Sequelize']['ValidationError'](_0x06a0('0x2a'));}_0x423bc0=_0x207989;var _0x1ddc6b=[];_0x42921a['forEach'](function(_0x438406){_0x1ddc6b['push'](checkTranscribeJob(_0x438406,_0x1b7ca7,_0x423bc0));});return BPromise[_0x06a0('0x41')](_0x1ddc6b);})[_0x06a0('0x42')](function(_0x3ae8a9){if(_0x3ae8a9){if(!_0x3ae8a9[_0x06a0('0x35')]||_0x3ae8a9[_0x06a0('0x35')]!==_0x06a0('0x36')){logger['error'](util[_0x06a0('0x38')](_0x3ae8a9,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x1d90=['resolve','sentiment','sentimentAccountId','bucket','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Positive','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','SequelizeValidationError','start','lodash','request-promise','bluebird','../../config/logger','transcribe','TranscribeService','detectSentiment','substring','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','results','transcripts','length','fileText','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed'];(function(_0x40d728,_0x190ef2){var _0x207740=function(_0x116913){while(--_0x116913){_0x40d728['push'](_0x40d728['shift']());}};_0x207740(++_0x190ef2);}(_0x1d90,0x13e));var _0x01d9=function(_0x208aee,_0x17ac5b){_0x208aee=_0x208aee-0x0;var _0x4a5846=_0x1d90[_0x208aee];return _0x4a5846;};var _=require(_0x01d9('0x0'));var AWS=require('aws-sdk');var rp=require(_0x01d9('0x1'));var util=require('util');var BPromise=require(_0x01d9('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x01d9('0x3'))(_0x01d9('0x4'));function getTranscriptionJob(_0x47e13e,_0x2f2e27,_0x405f55,_0xc03631){return new Promise(function(_0x549267,_0x500fb7){var _0x1664eb=new AWS[(_0x01d9('0x5'))]({'accessKeyId':_0x2f2e27,'secretAccessKey':_0x47e13e,'region':_0x405f55});_0x1664eb['getTranscriptionJob']({'TranscriptionJobName':_0xc03631},function(_0xef9d5b,_0x479447){if(_0xef9d5b){return _0x500fb7(_0xef9d5b);}else{return _0x549267(_0x479447);}});});}function sentiment(_0x497d40,_0x45a579,_0x2b8e06,_0x332f6a,_0x553073){return new Promise(function(_0x2745e4,_0x2a7727){var _0x2d1ca0=new AWS['Comprehend']({'accessKeyId':_0x45a579,'secretAccessKey':_0x497d40,'region':_0x2b8e06});_0x2d1ca0[_0x01d9('0x6')]({'Text':_0x332f6a,'LanguageCode':_0x553073[_0x01d9('0x7')](0x0,0x2)},function(_0x5fc001,_0x2b0a92){if(_0x5fc001){return _0x2a7727(_0x5fc001);}else{return _0x2745e4(_0x2b0a92);}});});}function checkTranscribeJob(_0xf99df2,_0x3c43c5,_0x411e2e){var _0x2895dd;return new BPromise(function(_0x2325c5,_0x3254a5){logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xf99df2['id'],_0xf99df2[_0x01d9('0xa')]));return getTranscriptionJob(_0x411e2e[_0x01d9('0xb')],_0x411e2e[_0x01d9('0xc')],_0x3c43c5[_0x01d9('0xd')],_0xf99df2['transcribeName'])[_0x01d9('0xe')](function(_0x5bc7fc){logger[_0x01d9('0x8')](util[_0x01d9('0x9')](_0x01d9('0xf'),_0xf99df2['id'],_0xf99df2['transcribeName'],_0x5bc7fc[_0x01d9('0x10')][_0x01d9('0x11')]));if(!_0xf99df2['fileText']){switch(_0x5bc7fc[_0x01d9('0x10')][_0x01d9('0x11')]){case _0x01d9('0x12'):var _0x4aceee={'transcribeStatus':_0x5bc7fc['TranscriptionJob'][_0x01d9('0x11')],'fileUri':_0x5bc7fc['TranscriptionJob']['Transcript'][_0x01d9('0x13')]};logger[_0x01d9('0x8')](util[_0x01d9('0x9')](_0x01d9('0x14'),_0xf99df2['id']));return rp({'uri':_0x5bc7fc['TranscriptionJob'][_0x01d9('0x15')][_0x01d9('0x13')],'json':!![]})['then'](function(_0x216a49){logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xf99df2['id']));if(_0x216a49&&_0x216a49[_0x01d9('0x16')]&&_0x216a49[_0x01d9('0x16')][_0x01d9('0x17')]&&_0x216a49[_0x01d9('0x16')]['transcripts'][_0x01d9('0x18')]){_0x4aceee['fileText']='';for(var _0x294b95=0x0;_0x294b95<_0x216a49[_0x01d9('0x16')][_0x01d9('0x17')][_0x01d9('0x18')];_0x294b95++){_0x4aceee[_0x01d9('0x19')]+=_0x216a49[_0x01d9('0x16')][_0x01d9('0x17')][_0x294b95][_0x01d9('0x1a')]+'';}}return _0xf99df2[_0x01d9('0x1b')](_0x4aceee);})[_0x01d9('0xe')](function(){logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xf99df2['id']));if(!_0xf99df2[_0x01d9('0x1c')]){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x1f'));}if(!_0x3c43c5['sentiment']||!_0x3c43c5['sentimentAccountId']||!_0x3c43c5[_0x01d9('0x20')]||!_0x3c43c5[_0x01d9('0x21')]||!_0x3c43c5['bucket']){throw new db[(_0x01d9('0x1d'))]['ValidationError'](_0x01d9('0x22'));}if(!_0x4aceee[_0x01d9('0x19')]){throw new Error('Transcript\x20not\x20available');}if(_0x3c43c5['sentimentAccountId']===_0x411e2e['id']){return _0x411e2e;}else{return db[_0x01d9('0x23')][_0x01d9('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x01d9('0xe')](function(_0x5dae9f){if(!_0x5dae9f){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5dae9f[_0x01d9('0xb')]||!_0x5dae9f[_0x01d9('0xc')]){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x2895dd=_0x5dae9f;logger['info'](util[_0x01d9('0x9')](_0x01d9('0x25'),_0xf99df2['id']));return sentiment(_0x2895dd[_0x01d9('0xb')],_0x2895dd['data2'],_0x3c43c5[_0x01d9('0x20')],_0x4aceee[_0x01d9('0x19')],_0x3c43c5[_0x01d9('0x21')]);})[_0x01d9('0xe')](function(_0x2f6152){logger[_0x01d9('0x8')](util[_0x01d9('0x9')](_0x01d9('0x26'),_0xf99df2['id']));return _0xf99df2[_0x01d9('0x1b')]({'sentiment':_0x2f6152[_0x01d9('0x27')],'sPositive':_0x2f6152[_0x01d9('0x28')]['Positive'],'sNegative':_0x2f6152[_0x01d9('0x28')][_0x01d9('0x29')],'sMixed':_0x2f6152[_0x01d9('0x28')][_0x01d9('0x2a')],'sNeutral':_0x2f6152[_0x01d9('0x28')][_0x01d9('0x2b')]});})[_0x01d9('0xe')](function(){logger['info'](util[_0x01d9('0x9')](_0x01d9('0x2c'),_0xf99df2['id']));_0x2325c5();});case _0x01d9('0x2d'):return _0xf99df2[_0x01d9('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x5bc7fc[_0x01d9('0x10')]['FailureReason']})['then'](function(){logger['info'](util[_0x01d9('0x9')](_0x01d9('0x2c'),_0xf99df2['id']));_0x2325c5();});default:logger['info'](util[_0x01d9('0x9')](_0x01d9('0x2e'),_0xf99df2['id']));break;}}else{return BPromise[_0x01d9('0x2f')]()[_0x01d9('0xe')](function(){if(!_0xf99df2['tempSentiment']){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3c43c5[_0x01d9('0x30')]||!_0x3c43c5[_0x01d9('0x31')]||!_0x3c43c5[_0x01d9('0x20')]||!_0x3c43c5[_0x01d9('0x21')]||!_0x3c43c5[_0x01d9('0x32')]){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x22'));}if(!_0xf99df2['fileText']){throw new Error(_0x01d9('0x33'));}if(_0x3c43c5[_0x01d9('0x31')]===_0x411e2e['id']){return _0x411e2e;}else{return db[_0x01d9('0x23')][_0x01d9('0x24')]({'where':{'id':_settings[_0x01d9('0x31')]}});}})[_0x01d9('0xe')](function(_0xa84480){if(!_0xa84480){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x34'));}if(!_0xa84480[_0x01d9('0xb')]||!_0xa84480[_0x01d9('0xc')]){throw new db['Sequelize'][(_0x01d9('0x1e'))](_0x01d9('0x35'));}_0x2895dd=_0xa84480;logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xf99df2['id']));return sentiment(_0x2895dd['data1'],_0x2895dd[_0x01d9('0xc')],_0x3c43c5['sentimentRegion'],_0xf99df2[_0x01d9('0x19')],_0x3c43c5[_0x01d9('0x21')]);})['then'](function(_0x35a8f2){logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xf99df2['id']));return _0xf99df2['update']({'sentiment':_0x35a8f2[_0x01d9('0x27')],'sPositive':_0x35a8f2['SentimentScore'][_0x01d9('0x36')],'sNegative':_0x35a8f2[_0x01d9('0x28')][_0x01d9('0x29')],'sMixed':_0x35a8f2[_0x01d9('0x28')][_0x01d9('0x2a')],'sNeutral':_0x35a8f2[_0x01d9('0x28')][_0x01d9('0x2b')],'transcribeStatus':_0x01d9('0x12')});})[_0x01d9('0xe')](function(){logger[_0x01d9('0x8')](util['format'](_0x01d9('0x2c'),_0xf99df2['id']));_0x2325c5();});}})['catch'](function(_0x40f86c){if(_0x40f86c){if(!_0x40f86c[_0x01d9('0x37')]||_0x40f86c[_0x01d9('0x37')]!=='SequelizeValidationError'){logger[_0x01d9('0x38')](util['format'](_0x01d9('0x39'),_0xf99df2['id']),util[_0x01d9('0x3a')](_0x40f86c,{'showHidden':![],'depth':null}));}}_0x2325c5();});});}function checkTranscribe(){var _0x39a325;var _0x51ebf7;var _0x27cea2;return db[_0x01d9('0x3b')][_0x01d9('0x3c')]({'where':{'transcribeStatus':_0x01d9('0x3d')}})['then'](function(_0x80801b){if(!_0x80801b||!_0x80801b[_0x01d9('0x18')]){throw new db['Sequelize']['ValidationError'](_0x01d9('0x3e'));}_0x39a325=_0x80801b;return db[_0x01d9('0x3f')][_0x01d9('0x24')]({'where':{'id':0x1}});})['then'](function(_0x3e92cb){if(!_0x3e92cb){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x40'));}_0x51ebf7=_0x3e92cb;if(!_0x51ebf7[_0x01d9('0x4')]||!_0x51ebf7[_0x01d9('0x41')]||!_0x51ebf7['transcribeRegion']||!_0x51ebf7[_0x01d9('0x21')]||!_0x51ebf7['bucket']){throw new db['Sequelize'][(_0x01d9('0x1e'))](_0x01d9('0x42'));}return db['CloudProvider'][_0x01d9('0x24')]({'where':{'id':_0x51ebf7[_0x01d9('0x41')]}});})[_0x01d9('0xe')](function(_0x5a8595){if(!_0x5a8595){throw new db[(_0x01d9('0x1d'))]['ValidationError'](_0x01d9('0x34'));}if(!_0x5a8595[_0x01d9('0xb')]||!_0x5a8595[_0x01d9('0xc')]){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x35'));}_0x27cea2=_0x5a8595;var _0x1d6b41=[];_0x39a325[_0x01d9('0x43')](function(_0xe8cf19){_0x1d6b41[_0x01d9('0x44')](checkTranscribeJob(_0xe8cf19,_0x51ebf7,_0x27cea2));});return BPromise[_0x01d9('0x45')](_0x1d6b41);})[_0x01d9('0x46')](function(_0x576725){if(_0x576725){if(!_0x576725[_0x01d9('0x37')]||_0x576725[_0x01d9('0x37')]!==_0x01d9('0x47')){logger['error'](util['inspect'](_0x576725,{'showHidden':![],'depth':null}));}}});}exports[_0x01d9('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 8b2c3b3..8abb529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebc0=['length','map','info','join','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','findAll','lastMsgAt'];(function(_0x21a672,_0x16c837){var _0x56eea9=function(_0x53ef05){while(--_0x53ef05){_0x21a672['push'](_0x21a672['shift']());}};_0x56eea9(++_0x16c837);}(_0xebc0,0xe5));var _0x0ebc=function(_0x51c125,_0xfbdcf4){_0x51c125=_0x51c125-0x0;var _0x4fcd53=_0xebc0[_0x51c125];return _0x4fcd53;};'use strict';var _=require(_0x0ebc('0x0'));var moment=require(_0x0ebc('0x1'));var Redis=require(_0x0ebc('0x2'));var util=require('util');var config=require(_0x0ebc('0x3'));var db=require(_0x0ebc('0x4'))['db'];var logger=require(_0x0ebc('0x5'))(_0x0ebc('0x6'));config[_0x0ebc('0x7')]=_[_0x0ebc('0x8')](config[_0x0ebc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0ebc('0x7')]));function closeInteractions(){var _0x534602=[];return db['WhatsappInteraction'][_0x0ebc('0x9')]({'raw':!![],'attributes':['id',_0x0ebc('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})['then'](function(_0xf1b94f){if(_0xf1b94f&&_0xf1b94f[_0x0ebc('0xb')]){_0x534602=_[_0x0ebc('0xc')](_0xf1b94f||[],'id');logger[_0x0ebc('0xd')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x534602[_0x0ebc('0xe')]());return db[_0x0ebc('0xf')][_0x0ebc('0x10')]({'closeReason':_0x0ebc('0x11'),'disposition':_0x0ebc('0x12'),'closed':!![],'closedAt':moment()[_0x0ebc('0x13')](_0x0ebc('0x14'))},{'where':{'id':_0x534602}});}})[_0x0ebc('0x15')](function(){if(_0x534602&&_0x534602[_0x0ebc('0xb')]){logger[_0x0ebc('0xd')](_0x0ebc('0x16'),_0x534602[_0x0ebc('0xe')]());for(var _0x4b9580=0x0;_0x4b9580<_0x534602[_0x0ebc('0xb')];_0x4b9580++){io[_0x0ebc('0x17')](_0x0ebc('0x18'),{'id':_0x534602[_0x4b9580],'closed':!![]});}}})[_0x0ebc('0x19')](function(_0x334b39){logger[_0x0ebc('0x1a')](_0x0ebc('0x1b'),_0x334b39?util[_0x0ebc('0x1c')](_0x334b39,{'showHidden':![],'depth':null}):'');});}exports[_0x0ebc('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x0bfc=['util','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','inspect','start','lodash','ioredis'];(function(_0x52666f,_0x4ebdd0){var _0x463720=function(_0x15896b){while(--_0x15896b){_0x52666f['push'](_0x52666f['shift']());}};_0x463720(++_0x4ebdd0);}(_0x0bfc,0x132));var _0xc0bf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0bfc[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xc0bf('0x0'));var moment=require('moment');var Redis=require(_0xc0bf('0x1'));var util=require(_0xc0bf('0x2'));var config=require('../../config/environment');var db=require(_0xc0bf('0x3'))['db'];var logger=require(_0xc0bf('0x4'))(_0xc0bf('0x5'));config[_0xc0bf('0x6')]=_[_0xc0bf('0x7')](config[_0xc0bf('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc0bf('0x8'))(new Redis(config[_0xc0bf('0x6')]));function closeInteractions(){var _0x1cb7a1=[];return db[_0xc0bf('0x9')][_0xc0bf('0xa')]({'raw':!![],'attributes':['id',_0xc0bf('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xc0bf('0xc')](0x18,_0xc0bf('0xd'))}}})['then'](function(_0x525e66){if(_0x525e66&&_0x525e66[_0xc0bf('0xe')]){_0x1cb7a1=_['map'](_0x525e66||[],'id');logger[_0xc0bf('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x1cb7a1[_0xc0bf('0x10')]());return db[_0xc0bf('0x9')][_0xc0bf('0x11')]({'closeReason':_0xc0bf('0x12'),'disposition':_0xc0bf('0x13'),'closed':!![],'closedAt':moment()[_0xc0bf('0x14')](_0xc0bf('0x15'))},{'where':{'id':_0x1cb7a1}});}})['then'](function(){if(_0x1cb7a1&&_0x1cb7a1[_0xc0bf('0xe')]){logger[_0xc0bf('0xf')](_0xc0bf('0x16'),_0x1cb7a1[_0xc0bf('0x10')]());for(var _0x1ef4d7=0x0;_0x1ef4d7<_0x1cb7a1['length'];_0x1ef4d7++){io['emit'](_0xc0bf('0x17'),{'id':_0x1cb7a1[_0x1ef4d7],'closed':!![]});}}})[_0xc0bf('0x18')](function(_0x55caa4){logger[_0xc0bf('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x55caa4?util[_0xc0bf('0x1a')](_0x55caa4,{'showHidden':![],'depth':null}):'');});}exports[_0xc0bf('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index eba6564..957a689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09ab=['Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy','then','log','bulkCreate','finished\x20populating','contacts2','CmHopper','hopper2','catch','util','../mysqldb','push'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x09ab,0xb1));var _0xb09a=function(_0xb9cbcd,_0x8df75d){_0xb9cbcd=_0xb9cbcd-0x0;var _0x1a7102=_0x09ab[_0xb9cbcd];return _0x1a7102;};'use strict';var util=require(_0xb09a('0x0'));var db=require(_0xb09a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb09a('0x2')]({'id':i,'firstName':_0xb09a('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xb09a('0x4')+i+_0xb09a('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb09a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb09a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb09a('0x6')](),'updatedAt':Date[_0xb09a('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xb09a('0x7')+i,'phone':0xf879fb460+i,'email':_0xb09a('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb09a('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb09a('0x6')](),'updatedAt':Date[_0xb09a('0x6')]()});}db[_0xb09a('0x8')][_0xb09a('0x9')]({'where':{}})['then'](function(){return db['CmContact']['bulkCreate'](contacts);})[_0xb09a('0xa')](function(){console[_0xb09a('0xb')]('finished\x20populating','contacts1');return db['CmHopper']['destroy']({'where':{}});})[_0xb09a('0xa')](function(){return db['CmHopper'][_0xb09a('0xc')](hopper);})[_0xb09a('0xa')](function(){console[_0xb09a('0xb')]('finished\x20populating','hopper1');return db['CmContact']['bulkCreate'](contacts2);})[_0xb09a('0xa')](function(){console[_0xb09a('0xb')](_0xb09a('0xd'),_0xb09a('0xe'));return db[_0xb09a('0xf')][_0xb09a('0xc')](hopper2);})[_0xb09a('0xa')](function(){console[_0xb09a('0xb')](_0xb09a('0xd'),_0xb09a('0x10'));})[_0xb09a('0x11')](function(_0x142ef3){console[_0xb09a('0xb')](_0x142ef3);});
\ No newline at end of file
+var _0xb66b=['now','@xcally.com','CmContact','bulkCreate','then','finished\x20populating','contacts1','CmHopper','destroy','log','hopper1','contacts2','hopper2','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo'];(function(_0x3286cc,_0x38c738){var _0x4a22f1=function(_0x20de2b){while(--_0x20de2b){_0x3286cc['push'](_0x3286cc['shift']());}};_0x4a22f1(++_0x38c738);}(_0xb66b,0x163));var _0xbb66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb66b[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require(_0xbb66('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xbb66('0x1')]({'id':i,'firstName':_0xbb66('0x2')+i,'lastName':_0xbb66('0x3')+i,'phone':0xf879fb460+i,'email':_0xbb66('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xbb66('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xbb66('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbb66('0x5')](),'updatedAt':Date[_0xbb66('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xbb66('0x1')]({'id':i,'firstName':_0xbb66('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xbb66('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xbb66('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbb66('0x5')](),'updatedAt':Date[_0xbb66('0x5')]()});}db[_0xbb66('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0xbb66('0x7')][_0xbb66('0x8')](contacts);})[_0xbb66('0x9')](function(){console['log'](_0xbb66('0xa'),_0xbb66('0xb'));return db[_0xbb66('0xc')][_0xbb66('0xd')]({'where':{}});})[_0xbb66('0x9')](function(){return db[_0xbb66('0xc')][_0xbb66('0x8')](hopper);})['then'](function(){console[_0xbb66('0xe')]('finished\x20populating',_0xbb66('0xf'));return db[_0xbb66('0x7')][_0xbb66('0x8')](contacts2);})[_0xbb66('0x9')](function(){console['log'](_0xbb66('0xa'),_0xbb66('0x10'));return db[_0xbb66('0xc')][_0xbb66('0x8')](hopper2);})[_0xbb66('0x9')](function(){console['log'](_0xbb66('0xa'),_0xbb66('0x11'));})['catch'](function(_0x8292c2){console[_0xbb66('0xe')](_0x8292c2);});
\ No newline at end of file
index 0a383cc..62f8b69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d5c=['%s%s','agent','format','%s%s@xcally.com','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','log','add\x20user','catch','util','push'];(function(_0x48f3fc,_0x3e6995){var _0x2d9e42=function(_0x3fc2fe){while(--_0x3fc2fe){_0x48f3fc['push'](_0x48f3fc['shift']());}};_0x2d9e42(++_0x3e6995);}(_0x0d5c,0x141));var _0xc0d5=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0x0d5c[_0x54b062];return _0x255e41;};'use strict';var util=require(_0xc0d5('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc0d5('0x1')]({'name':util['format'](_0xc0d5('0x2'),_0xc0d5('0x3'),i),'fullname':util[_0xc0d5('0x4')](_0xc0d5('0x2'),_0xc0d5('0x3'),i),'email':util[_0xc0d5('0x4')](_0xc0d5('0x5'),_0xc0d5('0x3'),i),'role':'agent','password':_0xc0d5('0x6'),'internal':0xfa0+i,'type':_0xc0d5('0x7'),'transport':[_0xc0d5('0x8'),'ws',_0xc0d5('0x9')],'disallow':['all'],'allow':[_0xc0d5('0xa')],'defaultuser':util[_0xc0d5('0x4')]('%s%s',_0xc0d5('0x3'),i),'encryption':_0xc0d5('0xb'),'avpf':'yes','force_avp':_0xc0d5('0xb'),'icesupport':_0xc0d5('0xb'),'dtlsenable':_0xc0d5('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xc0d5('0xc'),'dtlssetup':_0xc0d5('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0xc0d5('0x4')](_0xc0d5('0x2'),_0xc0d5('0x3'),i),0xfa0+i)});}db[_0xc0d5('0xe')][_0xc0d5('0xf')](users)['then'](function(){console[_0xc0d5('0x10')](_0xc0d5('0x11'));})[_0xc0d5('0x12')](function(_0x5f33b0){console[_0xc0d5('0x10')](_0x5f33b0);});
\ No newline at end of file
+var _0xb38e=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','log','util','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','password','friend','udp','wss'];(function(_0x275995,_0x169d1e){var _0x300b62=function(_0x2bd262){while(--_0x2bd262){_0x275995['push'](_0x275995['shift']());}};_0x300b62(++_0x169d1e);}(_0xb38e,0x137));var _0xeb38=function(_0x122799,_0x2664f2){_0x122799=_0x122799-0x0;var _0x4a6efa=_0xb38e[_0x122799];return _0x4a6efa;};'use strict';var util=require(_0xeb38('0x0'));var db=require(_0xeb38('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xeb38('0x2')]({'name':util[_0xeb38('0x3')]('%s%s',_0xeb38('0x4'),i),'fullname':util[_0xeb38('0x3')](_0xeb38('0x5'),_0xeb38('0x4'),i),'email':util[_0xeb38('0x3')](_0xeb38('0x6'),_0xeb38('0x4'),i),'role':_0xeb38('0x4'),'password':_0xeb38('0x7'),'internal':0xfa0+i,'type':_0xeb38('0x8'),'transport':[_0xeb38('0x9'),'ws',_0xeb38('0xa')],'disallow':[_0xeb38('0xb')],'allow':[_0xeb38('0xc')],'defaultuser':util[_0xeb38('0x3')]('%s%s',_0xeb38('0x4'),i),'encryption':'yes','avpf':'yes','force_avp':_0xeb38('0xd'),'icesupport':_0xeb38('0xd'),'dtlsenable':_0xeb38('0xd'),'dtlsverify':'no','dtlscertfile':_0xeb38('0xe'),'dtlsprivatekey':_0xeb38('0xf'),'dtlssetup':_0xeb38('0x10'),'callerid':util[_0xeb38('0x3')](_0xeb38('0x11'),util[_0xeb38('0x3')](_0xeb38('0x5'),_0xeb38('0x4'),i),0xfa0+i)});}db[_0xeb38('0x12')]['bulkCreate'](users)[_0xeb38('0x13')](function(){console['log'](_0xeb38('0x14'));})[_0xeb38('0x15')](function(_0x438f9e){console[_0xeb38('0x16')](_0x438f9e);});
\ No newline at end of file
index 44d3c32..76034cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x633b=['join','default','connection','setMaxListeners','address','request','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','UserProfileResource','resourceId','map','where','format','length','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','ChatQueues','SmsQueues','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','chat','fax','mail','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log'];(function(_0x1de9b7,_0x5abe01){var _0x4ef2ba=function(_0x229bd3){while(--_0x229bd3){_0x1de9b7['push'](_0x1de9b7['shift']());}};_0x4ef2ba(++_0x5abe01);}(_0x633b,0xd8));var _0xb633=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x633b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb633('0x0'));var util=require(_0xb633('0x1'));var BPromise=require(_0xb633('0x2'));var db=require(_0xb633('0x3'))['db'];var config=require(_0xb633('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xb633('0x5'),'model':db[_0xb633('0x6')],'attributes':['id',_0xb633('0x7'),_0xb633('0x8')],'raw':!![],'where':{'role':_0xb633('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb633('0x7')],'where':{'role':_0xb633('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xb633('0x7')],'where':{'role':_0xb633('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xb633('0xb')],'where':{'type':_0xb633('0xc')}};function getAssociatedResources(_0x331680,_0x26c666,_0x3d4b30){return db[_0xb633('0xd')][_0xb633('0xe')]({'where':{'name':_0x331680,'userProfileId':_0x26c666},'raw':!![]})[_0xb633('0xf')](function(_0x5ce24b){if(_0x5ce24b){if(_0x5ce24b[_0xb633('0x10')]){switch(_0x331680){case _0xb633('0x11'):case'ChatQueues':case _0xb633('0x12'):case'SmsQueues':case _0xb633('0x13'):case _0xb633('0x14'):case _0xb633('0x15'):return db[_0x3d4b30]['findAll'](queryQueues);case _0xb633('0x16'):return db[_0x3d4b30][_0xb633('0x17')](queryTelephones);case _0xb633('0x18'):return db[_0x3d4b30]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x3d4b30][_0xb633('0x17')](queryCampaigns);}}else{return db[_0xb633('0x19')]['findAll']({'attributes':[_0xb633('0x1a')],'where':{'sectionId':_0x5ce24b['id']},'raw':!![]})[_0xb633('0xf')](function(_0x1bbab8){if(_0x1bbab8){var _0x215128={'where':{'id':_[_0xb633('0x1b')](_0x1bbab8,_0xb633('0x1a'))},'raw':!![]};switch(_0x3d4b30){case'User':_0x215128['where'][_0xb633('0x8')]=_0xb633('0xa');break;case'Campaign':_0x215128[_0xb633('0x1c')]['type']=_0xb633('0xc');break;}return db[_0x3d4b30]['findAll'](_0x215128);}else{return[];}});}}else{return[];}})['then'](function(_0x3fc86b){return _0x3fc86b;});}function joinOrLeaveQueues(_0x9fb5de,_0x1f181f,_0xd5d83d,_0x32dbba){_0x9fb5de[_0x1f181f](util[_0xb633('0x1d')]('%s:queue:%s',_0xd5d83d,_0x32dbba[_0xb633('0x7')]));if(_0x32dbba[_0xb633('0x5')]){for(var _0x1bb40b=0x0;_0x1bb40b<_0x32dbba[_0xb633('0x5')][_0xb633('0x1e')];_0x1bb40b+=0x1){_0x9fb5de[_0x1f181f](util[_0xb633('0x1d')]('user:%s',_0x32dbba[_0xb633('0x5')][_0x1bb40b][_0xb633('0x7')]));}}}function joinOrLeave(_0x52e011,_0x58684f,_0x393f52){var _0x4a7269;if(_0x52e011['handshake'][_0xb633('0x1f')]['id']){db[_0xb633('0x6')][_0xb633('0x20')]({'attributes':['id',_0xb633('0x7'),_0xb633('0x8'),_0xb633('0x21')],'where':{'id':_0x52e011['handshake'][_0xb633('0x1f')]['id']},'include':[{'model':db[_0xb633('0x22')],'as':_0xb633('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x25')],'as':_0xb633('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x27')],'as':_0xb633('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x2a')],'as':_0xb633('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xb633('0xf')](function(_0x3e47d1){if(_0x3e47d1){_0x4a7269=_0x3e47d1;_0x52e011[_0x58684f](util[_0xb633('0x1d')](_0xb633('0x2c'),_0x3e47d1[_0xb633('0x7')]));var _0x3a66b6=[];switch(_0x3e47d1[_0xb633('0x8')]){case _0xb633('0x2d'):_0x52e011[_0x58684f](_0xb633('0x2e'));_0x52e011[_0x58684f]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xb633('0x2f'))){delete queryQueues[_0xb633('0x2f')];}_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x31')]['findAll'](queryQueues));_0x3a66b6['push'](db[_0xb633('0x32')]['findAll'](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x33')]['findAll'](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x34')][_0xb633('0x17')](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x35')][_0xb633('0x17')](queryQueues));_0x3a66b6['push'](db[_0xb633('0x36')][_0xb633('0x17')](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x37')][_0xb633('0x17')](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x6')][_0xb633('0x17')](queryTelephones));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x38')][_0xb633('0x17')](queryTrunks));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x39')][_0xb633('0x17')](queryCampaigns));_0x3a66b6['push'](db[_0xb633('0x6')][_0xb633('0x17')](queryAgents));break;case _0xb633('0x3a'):_0x52e011[_0x58684f](_0xb633('0x2e'));_0x52e011[_0x58684f](_0xb633('0x3b'));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x11'),_0x3e47d1[_0xb633('0x21')],'VoiceQueue'));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x3c'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x32')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x12'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x33')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x3d'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x34')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x13'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x35')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x14'),_0x3e47d1['userProfileId'],_0xb633('0x36')));_0x3a66b6['push'](getAssociatedResources(_0xb633('0x15'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x37')));_0x3a66b6['push'](getAssociatedResources(_0xb633('0x16'),_0x3e47d1[_0xb633('0x21')],'User'));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x18'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x38')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x3e'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x39')));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x6')][_0xb633('0x17')](queryAgents));break;case _0xb633('0x9'):_0x52e011[_0x58684f](_0xb633('0x2e'));_0x52e011[_0x58684f](_0xb633('0x3b'));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x3f')]({'attributes':['id','name']}));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x40')]({'attributes':['id',_0xb633('0x7')]}));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x41')]({'attributes':['id','name']}));_0x3a66b6['push'](_0x3e47d1[_0xb633('0x42')]({'attributes':['id','name']}));_0x3a66b6['push'](_0x3e47d1['getMailQueues']({'attributes':['id','name']}));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x43')]({'attributes':['id',_0xb633('0x7')]}));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x44')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x3a66b6);}})[_0xb633('0xf')](function(_0xff1f58){if(_0xff1f58&&_0xff1f58[_0xb633('0x1e')]){for(var _0x2d7340=0x0;_0x2d7340<_0xff1f58[_0xb633('0x1e')];_0x2d7340+=0x1){for(var _0x262086=0x0;_0x262086<_0xff1f58[_0x2d7340][_0xb633('0x1e')];_0x262086+=0x1){switch(_0x2d7340){case 0x0:joinOrLeaveQueues(_0x52e011,_0x58684f,'voice',_0xff1f58[_0x2d7340][_0x262086]);break;case 0x1:joinOrLeaveQueues(_0x52e011,_0x58684f,_0xb633('0x45'),_0xff1f58[_0x2d7340][_0x262086]);break;case 0x2:joinOrLeaveQueues(_0x52e011,_0x58684f,_0xb633('0x46'),_0xff1f58[_0x2d7340][_0x262086]);break;case 0x3:joinOrLeaveQueues(_0x52e011,_0x58684f,'sms',_0xff1f58[_0x2d7340][_0x262086]);break;case 0x4:joinOrLeaveQueues(_0x52e011,_0x58684f,_0xb633('0x47'),_0xff1f58[_0x2d7340][_0x262086]);break;case 0x5:joinOrLeaveQueues(_0x52e011,_0x58684f,'openchannel',_0xff1f58[_0x2d7340][_0x262086]);break;case 0x6:joinOrLeaveQueues(_0x52e011,_0x58684f,'whatsapp',_0xff1f58[_0x2d7340][_0x262086]);break;case 0x7:if(_0x4a7269[_0xb633('0x8')]!==_0xb633('0x9'))_0x52e011[_0x58684f](util['format'](_0xb633('0x48'),_0xff1f58[_0x2d7340][_0x262086][_0xb633('0x7')]));break;case 0x8:if(_0x4a7269[_0xb633('0x8')]!==_0xb633('0x9'))_0x52e011[_0x58684f](util[_0xb633('0x1d')](_0xb633('0x49'),_0xff1f58[_0x2d7340][_0x262086][_0xb633('0x7')]));break;case 0x9:if(_0x4a7269[_0xb633('0x8')]!==_0xb633('0x9'))_0x52e011[_0x58684f](util[_0xb633('0x1d')]('campaign:%s:%s',_0xff1f58[_0x2d7340][_0x262086][_0xb633('0xb')],_0xff1f58[_0x2d7340][_0x262086][_0xb633('0x7')]));break;case 0xa:_0x52e011[_0x58684f](util[_0xb633('0x1d')]('user:%s',_0xff1f58[_0x2d7340][_0x262086]['name']));break;}}}}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0x55b7de=_[_0xb633('0x1b')](_0x4a7269[_0xb633('0x23')],'id');return _0x4a7269[_0xb633('0x4b')](_0x55b7de)[_0xb633('0xf')](function(){for(var _0x2693cb=0x0;_0x2693cb<_0x55b7de[_0xb633('0x1e')];_0x2693cb+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x4d'),{'ChatInteractionId':Number(_0x55b7de[_0x2693cb]),'UserId':Number(_0x4a7269['id'])});}});}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0x9715cb=_[_0xb633('0x1b')](_0x4a7269[_0xb633('0x4e')],'id');return _0x4a7269[_0xb633('0x4f')](_0x9715cb)[_0xb633('0xf')](function(){for(var _0x221e78=0x0;_0x221e78<_0x9715cb[_0xb633('0x1e')];_0x221e78+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x50'),{'MailInteractionId':Number(_0x9715cb[_0x221e78]),'UserId':Number(_0x4a7269['id'])});}});}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0x773da=_['map'](_0x4a7269['FaxInteractions'],'id');return _0x4a7269['removeFaxInteractions'](_0x773da)[_0xb633('0xf')](function(){for(var _0x4ec5d1=0x0;_0x4ec5d1<_0x773da[_0xb633('0x1e')];_0x4ec5d1+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x51'),{'FaxInteractionId':Number(_0x773da[_0x4ec5d1]),'UserId':Number(_0x4a7269['id'])});}});}})['then'](function(){if(_0x58684f===_0xb633('0x4a')){var _0x53e905=_['map'](_0x4a7269[_0xb633('0x28')],'id');return _0x4a7269[_0xb633('0x52')](_0x53e905)['then'](function(){for(var _0x42d9b4=0x0;_0x42d9b4<_0x53e905[_0xb633('0x1e')];_0x42d9b4+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x53'),{'SmsInteractionId':Number(_0x53e905[_0x42d9b4]),'UserId':Number(_0x4a7269['id'])});}});}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0xbd331e=_[_0xb633('0x1b')](_0x4a7269[_0xb633('0x54')],'id');return _0x4a7269[_0xb633('0x55')](_0xbd331e)[_0xb633('0xf')](function(){for(var _0x2dce97=0x0;_0x2dce97<_0xbd331e[_0xb633('0x1e')];_0x2dce97+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x56'),{'OpenchannelInteractionId':Number(_0xbd331e[_0x2dce97]),'UserId':Number(_0x4a7269['id'])});}});}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0x4606dd=_['map'](_0x4a7269['WhatsappInteractions'],'id');return _0x4a7269[_0xb633('0x57')](_0x4606dd)[_0xb633('0xf')](function(){for(var _0x35496c=0x0;_0x35496c<_0x4606dd[_0xb633('0x1e')];_0x35496c+=0x1){_0x393f52['emit'](_0xb633('0x58'),{'WhatsappInteractionId':Number(_0x4606dd[_0x35496c]),'UserId':Number(_0x4a7269['id'])});}});}})['catch'](function(_0x6f830e){_0x52e011[_0xb633('0x59')](_0x6f830e);});}}function onDisconnect(_0x18a3f9,_0x108843){joinOrLeave(_0x18a3f9,_0xb633('0x4a'),_0x108843);}function onConnect(_0x55a724){joinOrLeave(_0x55a724,_0xb633('0x5a'));}exports[_0xb633('0x5b')]=function(_0xba0f43){_0xba0f43['on'](_0xb633('0x5c'),function(_0x4bd993){_0x4bd993[_0xb633('0x5d')](0x0);_0x4bd993[_0xb633('0x5e')]=_0x4bd993['request'][_0xb633('0x5c')]['remoteAddress']+':'+_0x4bd993[_0xb633('0x5f')]['connection'][_0xb633('0x60')];_0x4bd993['connectedAt']=new Date();_0x4bd993[_0xb633('0x59')]=function(_0x30ce50){console[_0xb633('0x59')](_0xb633('0x61')+_0x4bd993[_0xb633('0x62')][_0xb633('0x7')]+'['+_0x4bd993['address']+']',_0x30ce50);};_0x4bd993['on'](_0xb633('0x63'),function(){onDisconnect(_0x4bd993,_0xba0f43);_0x4bd993[_0xb633('0x59')](_0xb633('0x64'));});onConnect(_0x4bd993);_0x4bd993[_0xb633('0x59')](_0xb633('0x65'));});};
\ No newline at end of file
+var _0x8f25=['chat','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','connection','remoteAddress','request','remotePort','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','map','User','Campaign','where','format','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','VoiceQueues','MailQueues','Trunks','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice'];(function(_0x20237d,_0x506c3d){var _0x5a5b92=function(_0xdca92d){while(--_0xdca92d){_0x20237d['push'](_0x20237d['shift']());}};_0x5a5b92(++_0x506c3d);}(_0x8f25,0x14b));var _0x58f2=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8f25[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x58f2('0x0'));var util=require(_0x58f2('0x1'));var BPromise=require(_0x58f2('0x2'));var db=require(_0x58f2('0x3'))['db'];var config=require(_0x58f2('0x4'));var queryQueues={'attributes':['id',_0x58f2('0x5')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name',_0x58f2('0x6')],'raw':!![],'where':{'role':_0x58f2('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x58f2('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x58f2('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x58f2('0x5')],'where':{'role':_0x58f2('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x58f2('0x5'),_0x58f2('0x8')],'where':{'type':_0x58f2('0x9')}};function getAssociatedResources(_0xbe19cb,_0x30feef,_0x4b56c1){return db[_0x58f2('0xa')][_0x58f2('0xb')]({'where':{'name':_0xbe19cb,'userProfileId':_0x30feef},'raw':!![]})[_0x58f2('0xc')](function(_0x4242a6){if(_0x4242a6){if(_0x4242a6[_0x58f2('0xd')]){switch(_0xbe19cb){case'VoiceQueues':case _0x58f2('0xe'):case _0x58f2('0xf'):case _0x58f2('0x10'):case'MailQueues':case _0x58f2('0x11'):case _0x58f2('0x12'):return db[_0x4b56c1]['findAll'](queryQueues);case _0x58f2('0x13'):return db[_0x4b56c1][_0x58f2('0x14')](queryTelephones);case'Trunks':return db[_0x4b56c1][_0x58f2('0x14')](queryTrunks);case _0x58f2('0x15'):return db[_0x4b56c1][_0x58f2('0x14')](queryCampaigns);}}else{return db[_0x58f2('0x16')][_0x58f2('0x14')]({'attributes':[_0x58f2('0x17')],'where':{'sectionId':_0x4242a6['id']},'raw':!![]})[_0x58f2('0xc')](function(_0x1d3f73){if(_0x1d3f73){var _0x371e73={'where':{'id':_[_0x58f2('0x18')](_0x1d3f73,_0x58f2('0x17'))},'raw':!![]};switch(_0x4b56c1){case _0x58f2('0x19'):_0x371e73['where'][_0x58f2('0x6')]='telephone';break;case _0x58f2('0x1a'):_0x371e73[_0x58f2('0x1b')]['type']='ivr';break;}return db[_0x4b56c1]['findAll'](_0x371e73);}else{return[];}});}}else{return[];}})['then'](function(_0x2e6fa1){return _0x2e6fa1;});}function joinOrLeaveQueues(_0x16523e,_0x48ddb2,_0xf66efd,_0x28370e){_0x16523e[_0x48ddb2](util[_0x58f2('0x1c')]('%s:queue:%s',_0xf66efd,_0x28370e[_0x58f2('0x5')]));if(_0x28370e[_0x58f2('0x1d')]){for(var _0x4c537f=0x0;_0x4c537f<_0x28370e[_0x58f2('0x1d')][_0x58f2('0x1e')];_0x4c537f+=0x1){_0x16523e[_0x48ddb2](util['format'](_0x58f2('0x1f'),_0x28370e[_0x58f2('0x1d')][_0x4c537f][_0x58f2('0x5')]));}}}function joinOrLeave(_0x32ff95,_0x16fa72,_0x4084a4){var _0x2e83cf;if(_0x32ff95[_0x58f2('0x20')][_0x58f2('0x21')]['id']){db[_0x58f2('0x19')][_0x58f2('0x22')]({'attributes':['id',_0x58f2('0x5'),_0x58f2('0x6'),_0x58f2('0x23')],'where':{'id':_0x32ff95[_0x58f2('0x20')][_0x58f2('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x58f2('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x58f2('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x26')],'as':_0x58f2('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x28')],'as':_0x58f2('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x2a')],'as':_0x58f2('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x58f2('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x58f2('0xc')](function(_0x4b2b78){if(_0x4b2b78){_0x2e83cf=_0x4b2b78;_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x1f'),_0x4b2b78[_0x58f2('0x5')]));var _0x48b1f6=[];switch(_0x4b2b78['role']){case _0x58f2('0x2d'):_0x32ff95[_0x16fa72]('voice:inbound');_0x32ff95[_0x16fa72](_0x58f2('0x2e'));if(queryQueues[_0x58f2('0x2f')](_0x58f2('0x30'))){delete queryQueues[_0x58f2('0x30')];}_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x32')]['findAll'](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x33')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x34')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x35')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x36')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x37')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x38')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x19')]['findAll'](queryTelephones));_0x48b1f6['push'](db[_0x58f2('0x39')][_0x58f2('0x14')](queryTrunks));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x1a')]['findAll'](queryCampaigns));_0x48b1f6[_0x58f2('0x31')](db['User']['findAll'](queryAgents));break;case _0x58f2('0x3a'):_0x32ff95[_0x16fa72](_0x58f2('0x3b'));_0x32ff95[_0x16fa72]('voice:outbound');_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3c'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x32')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0xe'),_0x4b2b78[_0x58f2('0x23')],'ChatQueue'));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('FaxQueues',_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x34')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x10'),_0x4b2b78['userProfileId'],_0x58f2('0x35')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3d'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x36')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x11'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x37')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('WhatsappQueues',_0x4b2b78['userProfileId'],_0x58f2('0x38')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('Telephones',_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x19')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3e'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x39')));_0x48b1f6['push'](getAssociatedResources(_0x58f2('0x15'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x1a')));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x19')][_0x58f2('0x14')](queryAgents));break;case'agent':_0x32ff95[_0x16fa72](_0x58f2('0x3b'));_0x32ff95[_0x16fa72]('voice:outbound');_0x48b1f6[_0x58f2('0x31')](_0x4b2b78['getVoiceQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x3f')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78['getFaxQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x40')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78['getMailQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x41')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78[_0x58f2('0x42')]({'attributes':['id',_0x58f2('0x5')]}));break;}return BPromise[_0x58f2('0x43')](_0x48b1f6);}})[_0x58f2('0xc')](function(_0x5e151b){if(_0x5e151b&&_0x5e151b[_0x58f2('0x1e')]){for(var _0x1d499b=0x0;_0x1d499b<_0x5e151b[_0x58f2('0x1e')];_0x1d499b+=0x1){for(var _0x537061=0x0;_0x537061<_0x5e151b[_0x1d499b][_0x58f2('0x1e')];_0x537061+=0x1){switch(_0x1d499b){case 0x0:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x44'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x1:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x45'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x2:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x46'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x3:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x47'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x4:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x48'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x5:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x49'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x6:joinOrLeaveQueues(_0x32ff95,_0x16fa72,'whatsapp',_0x5e151b[_0x1d499b][_0x537061]);break;case 0x7:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')]('telephone:%s',_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0x8:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util['format'](_0x58f2('0x4a'),_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0x9:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x4b'),_0x5e151b[_0x1d499b][_0x537061]['type'],_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0xa:_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x1f'),_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;}}}}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x5da2ee=_[_0x58f2('0x18')](_0x2e83cf[_0x58f2('0x24')],'id');return _0x2e83cf[_0x58f2('0x4d')](_0x5da2ee)['then'](function(){for(var _0x316f19=0x0;_0x316f19<_0x5da2ee[_0x58f2('0x1e')];_0x316f19+=0x1){_0x4084a4['emit'](_0x58f2('0x4e'),{'ChatInteractionId':Number(_0x5da2ee[_0x316f19]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x39d15d=_[_0x58f2('0x18')](_0x2e83cf[_0x58f2('0x25')],'id');return _0x2e83cf[_0x58f2('0x4f')](_0x39d15d)['then'](function(){for(var _0x5ace9f=0x0;_0x5ace9f<_0x39d15d[_0x58f2('0x1e')];_0x5ace9f+=0x1){_0x4084a4['emit'](_0x58f2('0x50'),{'MailInteractionId':Number(_0x39d15d[_0x5ace9f]),'UserId':Number(_0x2e83cf['id'])});}});}})['then'](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x241b79=_['map'](_0x2e83cf[_0x58f2('0x27')],'id');return _0x2e83cf['removeFaxInteractions'](_0x241b79)[_0x58f2('0xc')](function(){for(var _0x110d7b=0x0;_0x110d7b<_0x241b79[_0x58f2('0x1e')];_0x110d7b+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x52'),{'FaxInteractionId':Number(_0x241b79[_0x110d7b]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x544e61=_[_0x58f2('0x18')](_0x2e83cf['SmsInteractions'],'id');return _0x2e83cf[_0x58f2('0x53')](_0x544e61)[_0x58f2('0xc')](function(){for(var _0x4c54ae=0x0;_0x4c54ae<_0x544e61[_0x58f2('0x1e')];_0x4c54ae+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x54'),{'SmsInteractionId':Number(_0x544e61[_0x4c54ae]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x325755=_[_0x58f2('0x18')](_0x2e83cf['OpenchannelInteractions'],'id');return _0x2e83cf['removeOpenchannelInteractions'](_0x325755)[_0x58f2('0xc')](function(){for(var _0x59bfa9=0x0;_0x59bfa9<_0x325755[_0x58f2('0x1e')];_0x59bfa9+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x55'),{'OpenchannelInteractionId':Number(_0x325755[_0x59bfa9]),'UserId':Number(_0x2e83cf['id'])});}});}})['then'](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x550dd9=_['map'](_0x2e83cf[_0x58f2('0x2c')],'id');return _0x2e83cf['removeWhatsappInteractions'](_0x550dd9)[_0x58f2('0xc')](function(){for(var _0x431677=0x0;_0x431677<_0x550dd9[_0x58f2('0x1e')];_0x431677+=0x1){_0x4084a4['emit'](_0x58f2('0x56'),{'WhatsappInteractionId':Number(_0x550dd9[_0x431677]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0x57')](function(_0x371ccb){_0x32ff95[_0x58f2('0x58')](_0x371ccb);});}}function onDisconnect(_0x560e62,_0xcdc1e0){joinOrLeave(_0x560e62,'leave',_0xcdc1e0);}function onConnect(_0x5ccaeb){joinOrLeave(_0x5ccaeb,_0x58f2('0x59'));}exports['default']=function(_0x175f3f){_0x175f3f['on'](_0x58f2('0x5a'),function(_0x3a1418){_0x3a1418['setMaxListeners'](0x0);_0x3a1418['address']=_0x3a1418['request'][_0x58f2('0x5a')][_0x58f2('0x5b')]+':'+_0x3a1418[_0x58f2('0x5c')]['connection'][_0x58f2('0x5d')];_0x3a1418['connectedAt']=new Date();_0x3a1418[_0x58f2('0x58')]=function(_0x50d1ce){console[_0x58f2('0x58')](_0x58f2('0x5e')+_0x3a1418[_0x58f2('0x5f')][_0x58f2('0x5')]+'['+_0x3a1418[_0x58f2('0x60')]+']',_0x50d1ce);};_0x3a1418['on'](_0x58f2('0x61'),function(){onDisconnect(_0x3a1418,_0x175f3f);_0x3a1418[_0x58f2('0x58')](_0x58f2('0x62'));});onConnect(_0x3a1418);_0x3a1418[_0x58f2('0x58')](_0x58f2('0x63'));});};
\ No newline at end of file
index a1953a9..30b2d6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a59=['Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','get','motionChannel','event','direction','resolve','ContactId','undefined','query','Sequelize','QueryTypes','SELECT','UserId','interface','format','SIP/%s','name','agent','channel','incomingmessage','catch','offlineMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','closed','substatus','AfterUpdate','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','util','../../mysqldb','../logger','triggers','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','SmsMessage'];(function(_0x1e63af,_0x33689c){var _0x297503=function(_0x3ab7f9){while(--_0x3ab7f9){_0x1e63af['push'](_0x1e63af['shift']());}};_0x297503(++_0x33689c);}(_0x3a59,0xc5));var _0x93a5=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x3a59[_0x20cf8a];return _0x54e165;};'use strict';var util=require(_0x93a5('0x0'));var db=require(_0x93a5('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x93a5('0x2'))(_0x93a5('0x3'));var client=jayson['client'][_0x93a5('0x4')]({'port':0x232a});var triggers=[{'channel':_0x93a5('0x5'),'model':'ChatInteraction','event':_0x93a5('0x6'),'condition':_0x93a5('0x7'),'callback':afterCreate},{'channel':'Chat','model':_0x93a5('0x8'),'event':_0x93a5('0x9'),'condition':_0x93a5('0xa'),'callback':afterUpdate},{'channel':_0x93a5('0x5'),'model':_0x93a5('0xb'),'event':_0x93a5('0x6'),'condition':_0x93a5('0xc'),'callback':afterCreateMessage},{'channel':_0x93a5('0x5'),'model':_0x93a5('0xd'),'event':_0x93a5('0x6'),'condition':_0x93a5('0xc'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':_0x93a5('0x6'),'condition':_0x93a5('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0x93a5('0xe'),'event':_0x93a5('0x9'),'condition':_0x93a5('0xa'),'callback':afterUpdate},{'channel':'Sms','model':_0x93a5('0xf'),'event':_0x93a5('0x6'),'condition':_0x93a5('0xc'),'callback':afterCreateMessage},{'channel':_0x93a5('0x10'),'model':'WhatsappInteraction','event':_0x93a5('0x6'),'condition':_0x93a5('0x7'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x93a5('0x9'),'condition':_0x93a5('0xa'),'callback':afterUpdate},{'channel':_0x93a5('0x10'),'model':_0x93a5('0x11'),'event':'afterCreate','condition':_0x93a5('0xc'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':'afterCreate','condition':_0x93a5('0x7'),'callback':afterCreate},{'channel':_0x93a5('0x12'),'model':_0x93a5('0x13'),'event':_0x93a5('0x9'),'condition':_0x93a5('0xa'),'callback':afterUpdate},{'channel':_0x93a5('0x12'),'model':_0x93a5('0x14'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x93a5('0x15'),'event':_0x93a5('0x6'),'condition':_0x93a5('0x7'),'callback':afterCreate},{'channel':_0x93a5('0x16'),'model':'MailInteraction','event':_0x93a5('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x93a5('0x16'),'model':_0x93a5('0x17'),'event':_0x93a5('0x6'),'condition':_0x93a5('0xc'),'callback':afterCreateMessage},{'channel':_0x93a5('0x18'),'model':_0x93a5('0x19'),'event':_0x93a5('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x93a5('0x18'),'model':_0x93a5('0x19'),'event':_0x93a5('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x93a5('0x18'),'model':_0x93a5('0x1a'),'event':_0x93a5('0x6'),'condition':_0x93a5('0xc'),'callback':afterCreateMessage}];function request(_0x2604b9){return client[_0x93a5('0x1b')](_0x93a5('0x1c'),_0x2604b9)[_0x93a5('0x1d')](function(_0x7b91b9){logger['info'](_0x93a5('0x1e'),_0x93a5('0x1c'),_0x7b91b9);if(_0x7b91b9[_0x93a5('0x1f')]){if(_0x7b91b9[_0x93a5('0x1f')]['code']===0x1f4){logger[_0x93a5('0x1f')](_0x93a5('0x1e'),_0x93a5('0x1c'),_0x7b91b9[_0x93a5('0x1f')]);}}})['catch'](function(_0x249326){logger['error'](_0x93a5('0x1e'),_0x93a5('0x1c'),_0x249326);});}function afterCreateMessage(_0x193f3c){return function(_0x49051){_0x49051=_0x49051[_0x93a5('0x20')]({'plain':!![]});_0x49051['channel']=_0x193f3c;_0x49051[_0x93a5('0x21')]=_0x193f3c;_0x49051[_0x93a5('0x22')]=_0x49051[_0x93a5('0x23')];Promise[_0x93a5('0x24')]()[_0x93a5('0x1d')](function(){if(typeof _0x49051[_0x93a5('0x25')]===_0x93a5('0x26'))return null;var _0x25865f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49051[_0x93a5('0x25')];return db['sequelize'][_0x93a5('0x27')](_0x25865f,{'type':db[_0x93a5('0x28')][_0x93a5('0x29')][_0x93a5('0x2a')],'raw':!![]});})[_0x93a5('0x1d')](function(_0x28b1ab){if(_0x28b1ab){_0x49051['contact']=_0x28b1ab[0x0];}if(typeof _0x49051['UserId']===_0x93a5('0x26'))return;return getAgent(_0x49051[_0x93a5('0x2b')]);})[_0x93a5('0x1d')](function(_0x30faa6){if(_0x30faa6){_0x49051[_0x93a5('0x2c')]=util[_0x93a5('0x2d')](_0x93a5('0x2e'),_0x30faa6[_0x93a5('0x2f')]);_0x49051[_0x93a5('0x30')]=_0x30faa6;_0x49051[_0x93a5('0x31')]=_0x193f3c;return request({'event':_0x93a5('0x32'),'message':_0x49051});}else{return request({'event':'outgoingmessage','message':_0x49051});}})[_0x93a5('0x33')](function(_0x4957d8){logger[_0x93a5('0x1f')](_0x93a5('0x1e'),'AfterCreateMessage',_0x4957d8);});};}function afterCreateOfflineMessage(_0x770d17){return function(_0x538ced){_0x538ced=_0x538ced['get']({'plain':!![]});_0x538ced['channel']=_0x770d17;_0x538ced['motionChannel']=_0x770d17;_0x538ced[_0x93a5('0x22')]=_0x93a5('0x34');return request({'event':_0x538ced['event'],'message':_0x538ced});};}function afterCreate(_0x30b369,_0x5061df){return function(_0x3a8ae1){_0x3a8ae1=_0x3a8ae1[_0x93a5('0x20')]({'plain':!![]});_0x3a8ae1[_0x93a5('0x31')]=_0x30b369;_0x3a8ae1[_0x93a5('0x21')]=_0x30b369;_0x3a8ae1[_0x93a5('0x22')]='opened';Promise[_0x93a5('0x24')]()[_0x93a5('0x1d')](function(){var _0x1f6ea5=_0x93a5('0x35')+_0x3a8ae1[_0x93a5('0x25')];return db[_0x93a5('0x36')][_0x93a5('0x27')](_0x1f6ea5,{'type':db[_0x93a5('0x28')][_0x93a5('0x29')][_0x93a5('0x2a')],'raw':!![]});})[_0x93a5('0x1d')](function(_0x502384){if(_0x502384){_0x3a8ae1[_0x93a5('0x37')]=_0x502384[0x0];}if(typeof _0x3a8ae1[_0x93a5('0x2b')]===_0x93a5('0x26'))return;return getAgent(_0x3a8ae1[_0x93a5('0x2b')]);})[_0x93a5('0x1d')](function(_0x30a689){if(_0x30a689){_0x3a8ae1['interface']=util[_0x93a5('0x2d')](_0x93a5('0x2e'),_0x30a689[_0x93a5('0x2f')]);_0x3a8ae1['agent']=_0x30a689;}return request({'event':_0x5061df,'message':_0x3a8ae1});})[_0x93a5('0x33')](function(_0x206c1b){logger[_0x93a5('0x1f')]('Trigger,\x20%s','AfterCreate',_0x206c1b);});};}function afterUpdate(_0x10450d){return function(_0x2802e4){var _0xd209e1=_0x2802e4['changed'](_0x93a5('0x38'))&&_0x2802e4[_0x93a5('0x38')];var _0x2d833d=_0x2802e4['changed']('substatus');if(_0xd209e1||_0x2d833d){var _0x1a6a6f=_0xd209e1?'closedinteraction':_0x93a5('0x39');var _0x43a1bf=_0x2802e4[_0x93a5('0x20')]({'plain':!![]});_0x43a1bf['channel']=_0x10450d;_0x43a1bf['motionChannel']=_0x10450d;_0x43a1bf[_0x93a5('0x22')]=_0xd209e1?_0x93a5('0x38'):_0x93a5('0x39');var _0x1498f9=_0x93a5('0x35')+_0x43a1bf[_0x93a5('0x25')];return db[_0x93a5('0x36')][_0x93a5('0x27')](_0x1498f9,{'type':db[_0x93a5('0x28')][_0x93a5('0x29')][_0x93a5('0x2a')],'raw':!![]})[_0x93a5('0x1d')](function(_0x2a0772){if(_0x2a0772){_0x43a1bf['contact']=_0x2a0772[0x0];}if(typeof _0x43a1bf[_0x93a5('0x2b')]==='undefined')return;return getAgent(_0x43a1bf[_0x93a5('0x2b')]);})[_0x93a5('0x1d')](function(_0x4dc0b2){if(_0x4dc0b2){_0x43a1bf[_0x93a5('0x2c')]=util[_0x93a5('0x2d')]('SIP/%s',_0x4dc0b2[_0x93a5('0x2f')]);_0x43a1bf[_0x93a5('0x30')]=_0x4dc0b2;}return request({'event':_0x1a6a6f,'message':_0x43a1bf});})['catch'](function(_0x2c9e3c){logger[_0x93a5('0x1f')](_0x93a5('0x1e'),_0x93a5('0x3a'),_0x2c9e3c);});}};}function getAgent(_0x2a7599){return db[_0x93a5('0x3b')][_0x93a5('0x3c')]({'where':{'id':_0x2a7599},'attributes':['id',_0x93a5('0x2f'),_0x93a5('0x3d'),_0x93a5('0x3e'),_0x93a5('0x3f')],'raw':!![]})[_0x93a5('0x1d')](function(_0x5a9663){return _0x5a9663;});}exports[_0x93a5('0x40')]=function(){for(var _0x41a6cd=0x0;_0x41a6cd<triggers[_0x93a5('0x41')];_0x41a6cd+=0x1){if(db[_0x93a5('0x42')](triggers[_0x41a6cd]['model'])){db[triggers[_0x41a6cd][_0x93a5('0x43')]][_0x93a5('0x44')](triggers[_0x41a6cd]['event'],triggers[_0x41a6cd][_0x93a5('0x45')](triggers[_0x41a6cd]['channel'][_0x93a5('0x46')](),triggers[_0x41a6cd]['condition']));}}};
\ No newline at end of file
+var _0x2a27=['EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','QueryTypes','contact','UserId','interface','format','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','sequelize','SIP/%s','AfterCreate','changed','closed','substatus','AfterUpdate','find','fullname','email','internal','length','hasOwnProperty','model','hook','callback','toLowerCase','util','../../mysqldb','../logger','triggers','http','Chat','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','request'];(function(_0x3e30ae,_0x28a8d4){var _0x598772=function(_0x3171c4){while(--_0x3171c4){_0x3e30ae['push'](_0x3e30ae['shift']());}};_0x598772(++_0x28a8d4);}(_0x2a27,0x19b));var _0x72a2=function(_0x545687,_0x26aac8){_0x545687=_0x545687-0x0;var _0x576345=_0x2a27[_0x545687];return _0x576345;};'use strict';var util=require(_0x72a2('0x0'));var db=require(_0x72a2('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x72a2('0x2'))(_0x72a2('0x3'));var client=jayson['client'][_0x72a2('0x4')]({'port':0x232a});var triggers=[{'channel':_0x72a2('0x5'),'model':'ChatInteraction','event':'afterCreate','condition':_0x72a2('0x6'),'callback':afterCreate},{'channel':_0x72a2('0x5'),'model':_0x72a2('0x7'),'event':_0x72a2('0x8'),'condition':_0x72a2('0x9'),'callback':afterUpdate},{'channel':_0x72a2('0x5'),'model':_0x72a2('0xa'),'event':_0x72a2('0xb'),'condition':_0x72a2('0xc'),'callback':afterCreateMessage},{'channel':_0x72a2('0x5'),'model':_0x72a2('0xd'),'event':_0x72a2('0xb'),'condition':_0x72a2('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x72a2('0xe'),'model':_0x72a2('0xf'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x72a2('0xe'),'model':_0x72a2('0xf'),'event':_0x72a2('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x72a2('0xe'),'model':'SmsMessage','event':_0x72a2('0xb'),'condition':_0x72a2('0xc'),'callback':afterCreateMessage},{'channel':_0x72a2('0x10'),'model':_0x72a2('0x11'),'event':_0x72a2('0xb'),'condition':_0x72a2('0x6'),'callback':afterCreate},{'channel':_0x72a2('0x10'),'model':_0x72a2('0x11'),'event':_0x72a2('0x8'),'condition':_0x72a2('0x9'),'callback':afterUpdate},{'channel':_0x72a2('0x10'),'model':_0x72a2('0x12'),'event':_0x72a2('0xb'),'condition':_0x72a2('0xc'),'callback':afterCreateMessage},{'channel':_0x72a2('0x13'),'model':_0x72a2('0x14'),'event':_0x72a2('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x72a2('0x13'),'model':_0x72a2('0x14'),'event':_0x72a2('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x72a2('0x15'),'event':'afterCreate','condition':_0x72a2('0xc'),'callback':afterCreateMessage},{'channel':_0x72a2('0x16'),'model':'MailInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x72a2('0x16'),'model':_0x72a2('0x17'),'event':'afterUpdate','condition':_0x72a2('0x9'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x72a2('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x72a2('0x18'),'model':'OpenchannelInteraction','event':_0x72a2('0xb'),'condition':_0x72a2('0x6'),'callback':afterCreate},{'channel':_0x72a2('0x18'),'model':_0x72a2('0x19'),'event':_0x72a2('0x8'),'condition':_0x72a2('0x9'),'callback':afterUpdate},{'channel':_0x72a2('0x18'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0x72a2('0xc'),'callback':afterCreateMessage}];function request(_0xb694eb){return client[_0x72a2('0x1a')](_0x72a2('0x1b'),_0xb694eb)[_0x72a2('0x1c')](function(_0x453103){logger['info'](_0x72a2('0x1d'),'EventManager',_0x453103);if(_0x453103['error']){if(_0x453103[_0x72a2('0x1e')][_0x72a2('0x1f')]===0x1f4){logger['error'](_0x72a2('0x1d'),_0x72a2('0x1b'),_0x453103[_0x72a2('0x1e')]);}}})[_0x72a2('0x20')](function(_0x30ff71){logger['error'](_0x72a2('0x1d'),_0x72a2('0x1b'),_0x30ff71);});}function afterCreateMessage(_0x5b56e5){return function(_0x5220fc){_0x5220fc=_0x5220fc[_0x72a2('0x21')]({'plain':!![]});_0x5220fc[_0x72a2('0x22')]=_0x5b56e5;_0x5220fc[_0x72a2('0x23')]=_0x5b56e5;_0x5220fc[_0x72a2('0x24')]=_0x5220fc[_0x72a2('0x25')];Promise[_0x72a2('0x26')]()[_0x72a2('0x1c')](function(){if(typeof _0x5220fc[_0x72a2('0x27')]===_0x72a2('0x28'))return null;var _0x562361=_0x72a2('0x29')+_0x5220fc[_0x72a2('0x27')];return db['sequelize'][_0x72a2('0x2a')](_0x562361,{'type':db[_0x72a2('0x2b')][_0x72a2('0x2c')]['SELECT'],'raw':!![]});})[_0x72a2('0x1c')](function(_0x49ecda){if(_0x49ecda){_0x5220fc[_0x72a2('0x2d')]=_0x49ecda[0x0];}if(typeof _0x5220fc[_0x72a2('0x2e')]===_0x72a2('0x28'))return;return getAgent(_0x5220fc[_0x72a2('0x2e')]);})['then'](function(_0x30705b){if(_0x30705b){_0x5220fc[_0x72a2('0x2f')]=util[_0x72a2('0x30')]('SIP/%s',_0x30705b[_0x72a2('0x31')]);_0x5220fc[_0x72a2('0x32')]=_0x30705b;_0x5220fc[_0x72a2('0x22')]=_0x5b56e5;return request({'event':_0x72a2('0x33'),'message':_0x5220fc});}else{return request({'event':_0x72a2('0x34'),'message':_0x5220fc});}})[_0x72a2('0x20')](function(_0x51272e){logger['error']('Trigger,\x20%s',_0x72a2('0x35'),_0x51272e);});};}function afterCreateOfflineMessage(_0x13d4be){return function(_0x29db23){_0x29db23=_0x29db23[_0x72a2('0x21')]({'plain':!![]});_0x29db23['channel']=_0x13d4be;_0x29db23[_0x72a2('0x23')]=_0x13d4be;_0x29db23[_0x72a2('0x24')]=_0x72a2('0x36');return request({'event':_0x29db23[_0x72a2('0x24')],'message':_0x29db23});};}function afterCreate(_0x3642b7,_0x3bb664){return function(_0x2999ba){_0x2999ba=_0x2999ba[_0x72a2('0x21')]({'plain':!![]});_0x2999ba['channel']=_0x3642b7;_0x2999ba['motionChannel']=_0x3642b7;_0x2999ba[_0x72a2('0x24')]=_0x72a2('0x37');Promise['resolve']()[_0x72a2('0x1c')](function(){var _0xfa5d8=_0x72a2('0x29')+_0x2999ba[_0x72a2('0x27')];return db[_0x72a2('0x38')][_0x72a2('0x2a')](_0xfa5d8,{'type':db[_0x72a2('0x2b')][_0x72a2('0x2c')]['SELECT'],'raw':!![]});})[_0x72a2('0x1c')](function(_0xbd22d){if(_0xbd22d){_0x2999ba[_0x72a2('0x2d')]=_0xbd22d[0x0];}if(typeof _0x2999ba[_0x72a2('0x2e')]==='undefined')return;return getAgent(_0x2999ba[_0x72a2('0x2e')]);})[_0x72a2('0x1c')](function(_0x34e0ef){if(_0x34e0ef){_0x2999ba[_0x72a2('0x2f')]=util[_0x72a2('0x30')](_0x72a2('0x39'),_0x34e0ef['name']);_0x2999ba[_0x72a2('0x32')]=_0x34e0ef;}return request({'event':_0x3bb664,'message':_0x2999ba});})[_0x72a2('0x20')](function(_0x58aee2){logger[_0x72a2('0x1e')]('Trigger,\x20%s',_0x72a2('0x3a'),_0x58aee2);});};}function afterUpdate(_0x1df6ce){return function(_0x401062){var _0x3dd943=_0x401062[_0x72a2('0x3b')](_0x72a2('0x3c'))&&_0x401062[_0x72a2('0x3c')];var _0x25202e=_0x401062[_0x72a2('0x3b')]('substatus');if(_0x3dd943||_0x25202e){var _0x37caca=_0x3dd943?_0x72a2('0x9'):_0x72a2('0x3d');var _0x2d8feb=_0x401062['get']({'plain':!![]});_0x2d8feb[_0x72a2('0x22')]=_0x1df6ce;_0x2d8feb[_0x72a2('0x23')]=_0x1df6ce;_0x2d8feb['event']=_0x3dd943?'closed':_0x72a2('0x3d');var _0x3a7e92=_0x72a2('0x29')+_0x2d8feb['ContactId'];return db[_0x72a2('0x38')][_0x72a2('0x2a')](_0x3a7e92,{'type':db[_0x72a2('0x2b')][_0x72a2('0x2c')]['SELECT'],'raw':!![]})[_0x72a2('0x1c')](function(_0x4af2e3){if(_0x4af2e3){_0x2d8feb[_0x72a2('0x2d')]=_0x4af2e3[0x0];}if(typeof _0x2d8feb['UserId']===_0x72a2('0x28'))return;return getAgent(_0x2d8feb[_0x72a2('0x2e')]);})[_0x72a2('0x1c')](function(_0x4176a0){if(_0x4176a0){_0x2d8feb[_0x72a2('0x2f')]=util[_0x72a2('0x30')]('SIP/%s',_0x4176a0[_0x72a2('0x31')]);_0x2d8feb['agent']=_0x4176a0;}return request({'event':_0x37caca,'message':_0x2d8feb});})['catch'](function(_0x1cd874){logger[_0x72a2('0x1e')](_0x72a2('0x1d'),_0x72a2('0x3e'),_0x1cd874);});}};}function getAgent(_0xe0b78a){return db['User'][_0x72a2('0x3f')]({'where':{'id':_0xe0b78a},'attributes':['id','name',_0x72a2('0x40'),_0x72a2('0x41'),_0x72a2('0x42')],'raw':!![]})[_0x72a2('0x1c')](function(_0x41d38a){return _0x41d38a;});}exports['default']=function(){for(var _0x4b52aa=0x0;_0x4b52aa<triggers[_0x72a2('0x43')];_0x4b52aa+=0x1){if(db[_0x72a2('0x44')](triggers[_0x4b52aa][_0x72a2('0x45')])){db[triggers[_0x4b52aa]['model']][_0x72a2('0x46')](triggers[_0x4b52aa][_0x72a2('0x24')],triggers[_0x4b52aa][_0x72a2('0x47')](triggers[_0x4b52aa][_0x72a2('0x22')][_0x72a2('0x48')](),triggers[_0x4b52aa]['condition']));}}};
\ No newline at end of file
index 3244228..e1ad0bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeea=['isValidChannel','toLowerCase','includes','isUndefined','blockedAt','updateAttributes','getLicense','role','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','chat','sms','openchannel','getChannels'];(function(_0x163beb,_0x4de43b){var _0x53cb8a=function(_0x142972){while(--_0x142972){_0x163beb['push'](_0x163beb['shift']());}};_0x53cb8a(++_0x4de43b);}(_0xaeea,0xb6));var _0xaaee=function(_0x3c4fcd,_0x57cf88){_0x3c4fcd=_0x3c4fcd-0x0;var _0x4511af=_0xaeea[_0x3c4fcd];return _0x4511af;};'use strict';var _=require(_0xaaee('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0xaaee('0x1'));var channels=[_0xaaee('0x2'),'mail',_0xaaee('0x3'),'fax',_0xaaee('0x4'),'whatsapp',_0xaaee('0x5')];exports[_0xaaee('0x6')]=function(){return channels;};exports[_0xaaee('0x7')]=function(_0x5886c4){_0x5886c4=_0x5886c4[_0xaaee('0x8')]();return _[_0xaaee('0x9')](channels,_0x5886c4);};exports['clearBlockUser']=function(_0x51a478,_0x283369,_0x37a8ce,_0x186e3c){var _0x3245f9={'loginAttempts':_0x283369,'blocked':_0x37a8ce};if(!_[_0xaaee('0xa')](_0x186e3c)){_0x3245f9[_0xaaee('0xb')]=_0x186e3c;}return _0x51a478[_0xaaee('0xc')](_0x3245f9);};exports[_0xaaee('0xd')]=function(_0x2d6277){return new BPromise(function(_0x3d8934,_0x34f4cb){var _0x10cc4e=0x0;if(_0x2d6277[_0xaaee('0xe')]!=='agent'){_0x3d8934(_0x2d6277);}db['User'][_0xaaee('0xf')]({'where':{'role':_0xaaee('0x10'),'online':!![],'id':{'$ne':_0x2d6277['id']}}})[_0xaaee('0x11')](function(_0x55bb20){_0x10cc4e=_0x55bb20;return util[_0xaaee('0xd')]();})['then'](function(_0x887d66){if(_0x887d66&&_0x887d66[_0xaaee('0x12')]&&_0x10cc4e>=_0x887d66[_0xaaee('0x12')]){throw Error(_0xaaee('0x13'));}_0x3d8934(_0x2d6277);})[_0xaaee('0x14')](function(_0x2ecee0){_0x34f4cb(_0x2ecee0);});});};
\ No newline at end of file
+var _0x5fc6=['updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb','voice','mail','chat','fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','blockedAt'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5fc6,0xfa));var _0x65fc=function(_0x487f2c,_0x1bb88f){_0x487f2c=_0x487f2c-0x0;var _0xa640=_0x5fc6[_0x487f2c];return _0xa640;};'use strict';var _=require('lodash');var BPromise=require(_0x65fc('0x0'));var db=require(_0x65fc('0x1'))['db'];var util=require('./license/util');var channels=[_0x65fc('0x2'),_0x65fc('0x3'),_0x65fc('0x4'),_0x65fc('0x5'),_0x65fc('0x6'),'whatsapp',_0x65fc('0x7')];exports[_0x65fc('0x8')]=function(){return channels;};exports[_0x65fc('0x9')]=function(_0x26d0d8){_0x26d0d8=_0x26d0d8[_0x65fc('0xa')]();return _[_0x65fc('0xb')](channels,_0x26d0d8);};exports['clearBlockUser']=function(_0x166881,_0x5e62b1,_0x386144,_0x1e72be){var _0x211f8b={'loginAttempts':_0x5e62b1,'blocked':_0x386144};if(!_[_0x65fc('0xc')](_0x1e72be)){_0x211f8b[_0x65fc('0xd')]=_0x1e72be;}return _0x166881[_0x65fc('0xe')](_0x211f8b);};exports[_0x65fc('0xf')]=function(_0x1b84f6){return new BPromise(function(_0x5e29e8,_0x4aec33){var _0x3e0d5d=0x0;if(_0x1b84f6[_0x65fc('0x10')]!==_0x65fc('0x11')){_0x5e29e8(_0x1b84f6);}db[_0x65fc('0x12')][_0x65fc('0x13')]({'where':{'role':_0x65fc('0x11'),'online':!![],'id':{'$ne':_0x1b84f6['id']}}})[_0x65fc('0x14')](function(_0x1e602b){_0x3e0d5d=_0x1e602b;return util[_0x65fc('0xf')]();})['then'](function(_0x39c637){if(_0x39c637&&_0x39c637[_0x65fc('0x15')]&&_0x3e0d5d>=_0x39c637[_0x65fc('0x15')]){throw Error(_0x65fc('0x16'));}_0x5e29e8(_0x1b84f6);})[_0x65fc('0x17')](function(_0x3d1b88){_0x4aec33(_0x3d1b88);});});};
\ No newline at end of file
index 504c9ba..9a45ff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd99=['404','status','render','json','send','exports'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xbd99,0x1df));var _0x9bd9=function(_0xcd9720,_0x2e27d6){_0xcd9720=_0xcd9720-0x0;var _0x50f82d=_0xbd99[_0xcd9720];return _0x50f82d;};'use strict';module[_0x9bd9('0x0')][0x194]=function pageNotFound(_0x64d782,_0x4af32e){var _0x5f1b5f=_0x9bd9('0x1');var _0x5d50d9=0x194;var _0x8b7dff={'status':_0x5d50d9};_0x4af32e[_0x9bd9('0x2')](_0x8b7dff[_0x9bd9('0x2')]);_0x4af32e[_0x9bd9('0x3')](_0x5f1b5f,{},function(_0x42b0f5,_0x1d9c56){if(_0x42b0f5){return _0x4af32e[_0x9bd9('0x2')](_0x8b7dff['status'])[_0x9bd9('0x4')](_0x8b7dff);}_0x4af32e[_0x9bd9('0x5')](_0x1d9c56);});};
\ No newline at end of file
+var _0x6a11=['exports','404','status','render','json','send'];(function(_0x2cc7f3,_0x274a69){var _0x36a930=function(_0x299576){while(--_0x299576){_0x2cc7f3['push'](_0x2cc7f3['shift']());}};_0x36a930(++_0x274a69);}(_0x6a11,0xc0));var _0x16a1=function(_0x17a4f2,_0x529fb9){_0x17a4f2=_0x17a4f2-0x0;var _0x15fa30=_0x6a11[_0x17a4f2];return _0x15fa30;};'use strict';module[_0x16a1('0x0')][0x194]=function pageNotFound(_0x5de5a9,_0x3d1d0a){var _0x18d3d0=_0x16a1('0x1');var _0x304bc5=0x194;var _0x861567={'status':_0x304bc5};_0x3d1d0a[_0x16a1('0x2')](_0x861567[_0x16a1('0x2')]);_0x3d1d0a[_0x16a1('0x3')](_0x18d3d0,{},function(_0x5dc59e,_0x340dd5){if(_0x5dc59e){return _0x3d1d0a[_0x16a1('0x2')](_0x861567['status'])[_0x16a1('0x4')](_0x861567);}_0x3d1d0a[_0x16a1('0x5')](_0x340dd5);});};
\ No newline at end of file
index 22df2f1..32039a5 100644 (file)
@@ -49,7 +49,7 @@ Migration.prototype.dropTable = function(table) {
   this.sequence.enqueue(function() {
     return _this.queryInterface
       .dropTable(table, {
-        force: true
+        force: true,
       })
       .then(function() {
         logger.info('table dropped %s', table);
@@ -65,7 +65,7 @@ Migration.prototype.addIndex = function(table, column, indexName) {
   this.sequence.enqueue(function() {
     return _this.queryInterface
       .addIndex(table, column, {
-        indexName: indexName
+        indexName: indexName,
       })
       .then(function() {
         logger.info('addIndex %s %s %s', table, column.join(','), indexName);
@@ -116,7 +116,7 @@ Migration.prototype.removeColumn = function(table, column) {
         logger.info(
           util.inspect(err, {
             showHidden: false,
-            depth: null
+            depth: null,
           })
         );
       });
@@ -129,13 +129,18 @@ Migration.prototype.renameColumn = function(table, oldColumn, newColumn) {
     return _this.queryInterface
       .renameColumn(table, oldColumn, newColumn)
       .then(function() {
-        logger.info('Renamed column from %s to %s on %s', oldColumn, newColumn, table);
+        logger.info(
+          'Renamed column from %s to %s on %s',
+          oldColumn,
+          newColumn,
+          table
+        );
       })
       .catch(function(err) {
         logger.info(
           util.inspect(err, {
             showHidden: false,
-            depth: null
+            depth: null,
           })
         );
       });
@@ -153,6 +158,73 @@ module.exports = {
     return new BPromise(function(resolve) {
       var migration = new Migration(queryInterface);
 
+      // START mail_servers_out
+      migration.query(
+        'UPDATE `mail_servers_out` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = 'smtp.office365.com', T1.port = 587, T1.secure = 0, T1.service = NULL" +
+        " WHERE T2.provider = 'outlook365'"
+      );
+
+      migration.query(
+        'UPDATE `mail_servers_out` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = 'smtp-mail.outlook.com', T1.port = 587, T1.secure = 0, T1.service = NULL" +
+        " WHERE T2.provider = 'hotmail'"
+      );
+
+      migration.query(
+        'UPDATE `mail_servers_out` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = 'smtp.mail.yahoo.com', T1.port = 587, T1.secure = 0, T1.service = NULL" +
+        " WHERE T2.provider = 'yahoo'"
+      );
+
+      migration.query(
+        'UPDATE `mail_servers_out` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = 'smtp.gmail.com', T1.port = 587, T1.secure = 0, T1.service = NULL" +
+        " WHERE T2.provider = 'gmail'"
+      );
+      // END mail_servers_out
+
+      // START mail_servers_in
+      migration.query(
+        'UPDATE `mail_servers_in` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = '127.0.0.1', T1.port = 993, T1.user = 'username', T1.password = 'password'" +
+        " WHERE T2.service = 1"
+      );
+
+      migration.query(
+        'UPDATE `mail_servers_in` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = 'outlook.office365.com', T1.port = 993, T1.service = NULL" +
+        " WHERE T2.provider = 'outlook365' AND T2.service = 0"
+      );
+
+      migration.query(
+        'UPDATE `mail_servers_in` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = 'imap-mail.outlook.com', T1.port = 993, T1.service = NULL" +
+        " WHERE T2.provider = 'hotmail' AND T2.service = 0"
+      );
+
+      migration.query(
+        'UPDATE `mail_servers_in` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = 'imap.mail.yahoo.com', T1.port = 993, T1.service = NULL" +
+        " WHERE T2.provider = 'yahoo' AND T2.service = 0"
+      );
+
+      migration.query(
+        'UPDATE `mail_servers_in` T1' +
+        ' JOIN `mail_accounts` T2 ON (T1.MailAccountId = T2.id)' +
+        " SET T1.host = 'imap.gmail.com', T1.port = 993, T1.service = NULL" +
+        " WHERE T2.provider = 'gmail' AND T2.service = 0"
+      );
+      // END mail_servers_in
+
       // START FINAL
       migration.final(resolve);
       // END FINAL
@@ -161,5 +233,5 @@ module.exports = {
 
   down: function(queryInterface, Sequelize) {
     // var migration = new Migration(queryInterface);
-  }
+  },
 };
\ No newline at end of file
diff --git a/server/migrations/2.5.49.js b/server/migrations/2.5.49.js
new file mode 100644 (file)
index 0000000..99a8015
--- /dev/null
@@ -0,0 +1,170 @@
+'use strict';
+
+var BPromise = require('bluebird');
+var util = require('util');
+
+var logger = require('../config/logger')('migration');
+
+var Sequence = function() {};
+
+Sequence.prototype.enqueue = function(fn) {
+  this.tail = this.tail ? this.tail.finally(fn) : fn();
+};
+
+var Migration = function(queryInterface) {
+  this.queryInterface = queryInterface;
+  this.sequence = new Sequence();
+};
+
+Migration.prototype.changeColumn = function(table, column, type) {
+  var _this = this;
+  this.sequence.enqueue(function() {
+    return _this.queryInterface
+      .changeColumn(table, column, type)
+      .then(function() {
+        logger.info('Changed column %s in table %s', column, table);
+      })
+      .catch(function(err) {
+        logger.info(JSON.stringify(err));
+      });
+  });
+};
+
+Migration.prototype.addColumn = function(table, column, type) {
+  var _this = this;
+  this.sequence.enqueue(function() {
+    return _this.queryInterface
+      .addColumn(table, column, type)
+      .then(function() {
+        logger.info('Added column %s to %s', column, table);
+      })
+      .catch(function(err) {
+        logger.info(JSON.stringify(err));
+      });
+  });
+};
+
+Migration.prototype.dropTable = function(table) {
+  var _this = this;
+  this.sequence.enqueue(function() {
+    return _this.queryInterface
+      .dropTable(table, {
+        force: true,
+      })
+      .then(function() {
+        logger.info('table dropped %s', table);
+      })
+      .catch(function(err) {
+        logger.info(JSON.stringify(err));
+      });
+  });
+};
+
+Migration.prototype.addIndex = function(table, column, indexName) {
+  var _this = this;
+  this.sequence.enqueue(function() {
+    return _this.queryInterface
+      .addIndex(table, column, {
+        indexName: indexName,
+      })
+      .then(function() {
+        logger.info('addIndex %s %s %s', table, column.join(','), indexName);
+      })
+      .catch(function(err) {
+        logger.info(JSON.stringify(err));
+      });
+  });
+};
+
+Migration.prototype.removeIndex = function(table, indexName) {
+  var _this = this;
+  this.sequence.enqueue(function() {
+    return _this.queryInterface
+      .removeIndex(table, indexName)
+      .then(function() {
+        logger.info('removeIndex %s %s', table, indexName);
+      })
+      .catch(function(err) {
+        logger.info(JSON.stringify(err));
+      });
+  });
+};
+
+Migration.prototype.query = function(sql) {
+  var _this = this;
+  this.sequence.enqueue(function() {
+    return _this.queryInterface.sequelize
+      .query(sql)
+      .then(function() {
+        logger.info('query %s', sql);
+      })
+      .catch(function(err) {
+        logger.info(JSON.stringify(err));
+      });
+  });
+};
+
+Migration.prototype.removeColumn = function(table, column) {
+  var _this = this;
+  this.sequence.enqueue(function() {
+    return _this.queryInterface
+      .removeColumn(table, column)
+      .then(function() {
+        logger.info('Removed column %s from %s', column, table);
+      })
+      .catch(function(err) {
+        logger.info(
+          util.inspect(err, {
+            showHidden: false,
+            depth: null,
+          })
+        );
+      });
+  });
+};
+
+Migration.prototype.renameColumn = function(table, oldColumn, newColumn) {
+  var _this = this;
+  this.sequence.enqueue(function() {
+    return _this.queryInterface
+      .renameColumn(table, oldColumn, newColumn)
+      .then(function() {
+        logger.info(
+          'Renamed column from %s to %s on %s',
+          oldColumn,
+          newColumn,
+          table
+        );
+      })
+      .catch(function(err) {
+        logger.info(
+          util.inspect(err, {
+            showHidden: false,
+            depth: null,
+          })
+        );
+      });
+  });
+};
+
+Migration.prototype.final = function(resolve) {
+  this.sequence.enqueue(function() {
+    return resolve();
+  });
+};
+
+module.exports = {
+  up: function(queryInterface, Sequelize) {
+    return new BPromise(function(resolve) {
+      var migration = new Migration(queryInterface);
+
+      // START FINAL
+      migration.final(resolve);
+      // END FINAL
+    });
+  },
+
+  down: function(queryInterface, Sequelize) {
+    // var migration = new Migration(queryInterface);
+  },
+};
\ No newline at end of file
index c03b08d..39e8610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x148b=['Contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','FaxAccount','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','VoiceChanSpy','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailServerIn','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','Applications','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','DashboardItem','Items','FaxAccountId','Exntensions','TagId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatInternalMessage','ChatGroupId','JscriptySessions','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CampaignId','All','OneAll','AutomationAllId','Condition','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','AnalyticMetric','MetricId','SalesforceAccount','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','Description','Field','FieldId','VariableId','Subjects','Subject','Variable','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','ChatQueueReport','ToId','SessionId','ProjectId','user_has_square_projects','team_has_chat_queues','team_has_whatsapp_queues','TrunkId','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromUserId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','exports','../config/environment','lodash','determine','sequelize','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','xcall','utf8','username','password','options','database','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','CmCustomField','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','TeamVoiceQueue','TeamVoicePrefix','UserVoicePrefix','UserSetting','User','hasOne','cascade','UserId','userSetting','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','FaxInteraction','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0x148b,0xd3));var _0xb148=function(_0x278d4b,_0x4e4c43){_0x278d4b=_0x278d4b-0x0;var _0x549875=_0x148b[_0x278d4b];return _0x549875;};'use strict';var config=require(_0xb148('0x0'));var Sequelize=require('sequelize');var _=require(_0xb148('0x1'));var jstz=require('jstz');var timezone=jstz[_0xb148('0x2')]();config[_0xb148('0x3')]=_[_0xb148('0x4')](config[_0xb148('0x3')],{'database':_0xb148('0x5'),'username':'xcall','password':_0xb148('0x6'),'options':{'host':_0xb148('0x7'),'port':0xcea,'dialect':_0xb148('0x8'),'dialectOptions':{'charset':_0xb148('0x9')},'logging':![],'timezone':timezone[_0xb148('0xa')](),'define':{'charset':'utf8','collate':_0xb148('0xb')}}});config[_0xb148('0xc')]=_[_0xb148('0x4')](config[_0xb148('0xc')],{'database':_0xb148('0x5'),'username':_0xb148('0xd'),'password':_0xb148('0x6'),'options':{'host':_0xb148('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xb148('0x9')},'logging':![],'timezone':timezone[_0xb148('0xa')](),'define':{'charset':_0xb148('0xe'),'collate':_0xb148('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0xb148('0x3')][_0xb148('0xf')],config[_0xb148('0x3')][_0xb148('0x10')],config[_0xb148('0x3')][_0xb148('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb148('0xc')][_0xb148('0x12')],config[_0xb148('0xc')][_0xb148('0xf')],config[_0xb148('0xc')][_0xb148('0x10')],config[_0xb148('0xc')][_0xb148('0x11')])};db['User']=db[_0xb148('0x3')][_0xb148('0x13')]('../api/user/user.model');db['VoiceChanSpy']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x14'));db[_0xb148('0x15')]=db[_0xb148('0x3')]['import'](_0xb148('0x16'));db[_0xb148('0x17')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x18'));db[_0xb148('0x19')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x1a'));db['VoiceQueue']=db['sequelize']['import'](_0xb148('0x1b'));db[_0xb148('0x1c')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x1d'));db[_0xb148('0x1e')]=db['sequelize'][_0xb148('0x13')]('../api/screenRecording/screenRecording.model');db[_0xb148('0x1f')]=db['sequelize'][_0xb148('0x13')]('../api/voiceMail/voiceMail.model');db[_0xb148('0x20')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x21'));db[_0xb148('0x22')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x23'));db['VoiceDialReport']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x24'));db[_0xb148('0x25')]=db[_0xb148('0x3')]['import'](_0xb148('0x26'));db['VoiceQueueReport']=db[_0xb148('0x3')][_0xb148('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0xb148('0x3')]['import'](_0xb148('0x27'));db[_0xb148('0x28')]=db['sequelize'][_0xb148('0x13')]('../api/trunk/trunk.model');db[_0xb148('0x29')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x2a'));db['UserVoiceQueueRt']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x2b'));db[_0xb148('0x2c')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x2d'));db[_0xb148('0x2e')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x2f'));db[_0xb148('0x30')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0xb148('0x31')]=db[_0xb148('0x3')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0xb148('0x32')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0xb148('0x33')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x34'));db['UserWhatsappQueue']=db[_0xb148('0x3')]['import'](_0xb148('0x35'));db['MailServerIn']=db[_0xb148('0x3')][_0xb148('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0xb148('0x36')]=db['sequelize'][_0xb148('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0xb148('0x37')]=db['sequelize']['import'](_0xb148('0x38'));db[_0xb148('0x39')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x3a'));db[_0xb148('0x3b')]=db[_0xb148('0x3')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0xb148('0x3c')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x3d'));db[_0xb148('0x3e')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/mailMessage/mailMessage.model');db[_0xb148('0x3f')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/mailApplication/mailApplication.model');db[_0xb148('0x40')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x41'));db['Dashboard']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x42'));db['DashboardItem']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x43'));db['FaxAccount']=db['sequelize'][_0xb148('0x13')](_0xb148('0x44'));db[_0xb148('0x45')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x46'));db['FaxInteraction']=db[_0xb148('0x3')]['import'](_0xb148('0x47'));db[_0xb148('0x48')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x49'));db[_0xb148('0x4a')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x4b'));db['FaxQueueReport']=db['sequelize'][_0xb148('0x13')](_0xb148('0x4c'));db[_0xb148('0x4d')]=db[_0xb148('0x3')]['import'](_0xb148('0x4e'));db[_0xb148('0x4f')]=db[_0xb148('0x3')]['import'](_0xb148('0x50'));db['SmsInteraction']=db[_0xb148('0x3')]['import'](_0xb148('0x51'));db[_0xb148('0x52')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x53'));db[_0xb148('0x54')]=db[_0xb148('0x3')]['import'](_0xb148('0x55'));db[_0xb148('0x56')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x57'));db[_0xb148('0x58')]=db['sequelize'][_0xb148('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0xb148('0x59')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x5a'));db['OpenchannelMessage']=db[_0xb148('0x3')]['import'](_0xb148('0x5b'));db['OpenchannelQueue']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x5c'));db[_0xb148('0x5d')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0xb148('0x5e')]=db[_0xb148('0x3')]['import'](_0xb148('0x5f'));db[_0xb148('0x60')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x61'));db[_0xb148('0x62')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x63'));db[_0xb148('0x64')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x65'));db[_0xb148('0x66')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xb148('0x67')]=db['sequelize'][_0xb148('0x13')]('../api/chatQueue/chatQueue.model');db[_0xb148('0x68')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x69'));db[_0xb148('0x6a')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x6b'));db[_0xb148('0x6c')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x6d'));db[_0xb148('0x6e')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x6f'));db[_0xb148('0x70')]=db[_0xb148('0x3')]['import']('../api/cmHopper/cmHopper.model');db[_0xb148('0x71')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x72'));db[_0xb148('0x73')]=db[_0xb148('0x3')]['import'](_0xb148('0x74'));db['CmHopperHistory']=db[_0xb148('0x3')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0xb148('0x75')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xb148('0x76')]=db['sequelize'][_0xb148('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0xb148('0x77')]=db[_0xb148('0x3')]['import']('../api/action/action.model');db[_0xb148('0x78')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/automation/automation.model');db[_0xb148('0x79')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x7a'));db[_0xb148('0x7b')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x7c'));db['Condition']=db[_0xb148('0x3')]['import'](_0xb148('0x7d'));db[_0xb148('0x7e')]=db[_0xb148('0x3')]['import'](_0xb148('0x7f'));db[_0xb148('0x80')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x81'));db['Cdr']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x82'));db[_0xb148('0x83')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x84'));db[_0xb148('0x85')]=db['sequelize']['import'](_0xb148('0x86'));db[_0xb148('0x87')]=db[_0xb148('0x3')]['import'](_0xb148('0x88'));db[_0xb148('0x89')]=db['sequelize']['import'](_0xb148('0x8a'));db[_0xb148('0x8b')]=db['sequelize'][_0xb148('0x13')]('../api/template/template.model');db[_0xb148('0x8c')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x8d'));db['Variable']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x8e'));db['Integration']=db['sequelize']['import'](_0xb148('0x8f'));db[_0xb148('0x90')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/integrationReport/integrationReport.model');db[_0xb148('0x91')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x92'));db['AnalyticDefaultReport']=db[_0xb148('0x3')]['import'](_0xb148('0x93'));db['AnalyticExtractedReport']=db[_0xb148('0x3')]['import'](_0xb148('0x94'));db['AnalyticMetric']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x95'));db['AnalyticFieldReport']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x96'));db[_0xb148('0x97')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x98'));db['SalesforceAccount']=db['sequelize'][_0xb148('0x13')](_0xb148('0x99'));db[_0xb148('0x9a')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x9b'));db[_0xb148('0x9c')]=db[_0xb148('0x3')]['import'](_0xb148('0x9d'));db[_0xb148('0x9e')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0x9f'));db[_0xb148('0xa0')]=db[_0xb148('0x3')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xb148('0xa1')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xb148('0xa2')]=db[_0xb148('0x3')]['import'](_0xb148('0xa3'));db[_0xb148('0xa4')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xb148('0xa5')]=db['sequelize'][_0xb148('0x13')](_0xb148('0xa6'));db[_0xb148('0xa7')]=db['sequelize'][_0xb148('0x13')](_0xb148('0xa8'));db[_0xb148('0xa9')]=db[_0xb148('0x3')]['import'](_0xb148('0xaa'));db[_0xb148('0xab')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xac'));db['ZendeskAccount']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xad'));db['ZendeskConfiguration']=db[_0xb148('0x3')][_0xb148('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xb148('0xae')]=db['sequelize'][_0xb148('0x13')](_0xb148('0xaf'));db[_0xb148('0xb0')]=db[_0xb148('0x3')]['import'](_0xb148('0xb1'));db[_0xb148('0xb2')]=db['sequelize']['import'](_0xb148('0xb3'));db[_0xb148('0xb4')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xb5'));db[_0xb148('0xb6')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xb7'));db[_0xb148('0xb8')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xb148('0xb9')]=db['sequelize'][_0xb148('0x13')](_0xb148('0xba'));db[_0xb148('0xbb')]=db[_0xb148('0x3')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xbc'));db[_0xb148('0xbd')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xbe'));db[_0xb148('0xbf')]=db[_0xb148('0x3')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xc0'));db['Dynamics365Field']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xc1'));db['FreshsalesAccount']=db['sequelize'][_0xb148('0x13')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xb148('0xc2')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xc3'));db[_0xb148('0xc4')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xc5'));db[_0xb148('0xc6')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x8f'));db[_0xb148('0xc7')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xc8'));db['ChatQueueReport']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xc9'));db['ChatInternalMessage']=db[_0xb148('0x3')][_0xb148('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xb148('0xca')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xcb'));db[_0xb148('0xcc')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xb148('0xcd')]=db[_0xb148('0x3')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xb148('0xce')]=db['sequelize'][_0xb148('0x13')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db['sequelize'][_0xb148('0x13')](_0xb148('0xcf'));db[_0xb148('0xd0')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xd1'));db[_0xb148('0xd2')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0xb148('0xd3')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xd4'));db[_0xb148('0xd5')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xd6'));db['SquareProject']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xd7'));db[_0xb148('0xd8')]=db[_0xb148('0x3')]['import'](_0xb148('0xd9'));db[_0xb148('0xda')]=db['sequelize'][_0xb148('0x13')]('../api/squareMessage/squareMessage.model');db[_0xb148('0xdb')]=db[_0xb148('0x3')]['import'](_0xb148('0xdc'));db[_0xb148('0xdd')]=db[_0xb148('0x3')]['import'](_0xb148('0xde'));db[_0xb148('0xdf')]=db[_0xb148('0x3')]['import'](_0xb148('0xe0'));db[_0xb148('0xe1')]=db['sequelize'][_0xb148('0x13')]('../api/migration/migration.model');db[_0xb148('0xe2')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xe3'));db['Plugin']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xe4'));db[_0xb148('0xe5')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xe6'));db[_0xb148('0xe7')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xe8'));db[_0xb148('0xe9')]=db[_0xb148('0x3')]['import'](_0xb148('0xea'));db[_0xb148('0xeb')]=db['sequelize'][_0xb148('0x13')](_0xb148('0xec'));db[_0xb148('0xed')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xee'));db[_0xb148('0xef')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xf0'));db[_0xb148('0xf1')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xf2'));db[_0xb148('0xf3')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/userProfile/userProfile.model');db[_0xb148('0xf4')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xf5'));db['UserProfileResource']=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xf6'));db[_0xb148('0xf7')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/userNotification/userNotification.model');db[_0xb148('0xf8')]=db[_0xb148('0x3')][_0xb148('0x13')](_0xb148('0xf9'));db[_0xb148('0xfa')]=db[_0xb148('0x3')]['import'](_0xb148('0xfb'));db['WhatsappInteraction']=db[_0xb148('0x3')][_0xb148('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xb148('0xfc')]=db['sequelize'][_0xb148('0x13')](_0xb148('0xfd'));db[_0xb148('0xfe')]=db[_0xb148('0x3')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xb148('0xff')]=db['sequelize'][_0xb148('0x13')](_0xb148('0x100'));db[_0xb148('0x101')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0xb148('0x102')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0xb148('0x103')]=db['sequelize'][_0xb148('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xb148('0x104')]=db[_0xb148('0x3')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xb148('0x105')]=db[_0xb148('0x3')][_0xb148('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xb148('0x106')]=db['sequelize'][_0xb148('0x13')]('../api/user-setting/user-setting.model');db[_0xb148('0x107')][_0xb148('0x108')](db['VoiceMail'],{'as':_0xb148('0x1f'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x107')][_0xb148('0x108')](db[_0xb148('0x106')],{'as':_0xb148('0x10b'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x107')][_0xb148('0x10c')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0xb148('0x10a')});db['User'][_0xb148('0x10c')](db[_0xb148('0x10d')],{'as':_0xb148('0x10e'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x107')][_0xb148('0x10c')](db[_0xb148('0x17')],{'as':_0xb148('0x10f'),'onDelete':_0xb148('0x109'),'hooks':!![]});db[_0xb148('0x107')]['hasMany'](db['CmHopperFinal'],{'as':_0xb148('0x110'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x107')][_0xb148('0x10c')](db[_0xb148('0x111')],{'as':'HopperHistory','foreignKey':_0xb148('0x10a')});db['User'][_0xb148('0x10c')](db[_0xb148('0x75')],{'as':_0xb148('0x75'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x107')][_0xb148('0x10c')](db[_0xb148('0x59')],{'as':_0xb148('0x112'),'foreignKey':'UserId'});db[_0xb148('0x107')][_0xb148('0x10c')](db[_0xb148('0x62')],{'as':_0xb148('0x113'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x107')][_0xb148('0x10c')](db[_0xb148('0x114')],{'as':'SmsInteractions','foreignKey':_0xb148('0x10a')});db['User']['hasMany'](db[_0xb148('0x115')],{'as':'FaxInteractions','foreignKey':_0xb148('0x10a')});db[_0xb148('0x107')][_0xb148('0x10c')](db['MailInteraction'],{'as':_0xb148('0x116'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x107')][_0xb148('0x10c')](db[_0xb148('0x117')],{'as':_0xb148('0x118'),'foreignKey':'UserId'});db[_0xb148('0x107')][_0xb148('0x10c')](db[_0xb148('0xf7')],{'as':_0xb148('0x119'),'foreignKey':_0xb148('0x11a')});db[_0xb148('0x107')][_0xb148('0x11b')](db[_0xb148('0xf3')],{'as':_0xb148('0xf3'),'foreignKey':_0xb148('0x11c')});db[_0xb148('0x107')]['belongsToMany'](db['ChatGroup'],{'as':_0xb148('0x11d'),'through':_0xb148('0x11e')});db['User'][_0xb148('0x11f')](db[_0xb148('0x6e')],{'as':_0xb148('0x120'),'through':'cm_user_has_contacts'});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0xef')],{'as':'Lists','through':_0xb148('0x121')});db[_0xb148('0x107')][_0xb148('0x11f')](db['Team'],{'through':_0xb148('0x122')});db[_0xb148('0x107')][_0xb148('0x11f')](db['MailInteraction'],{'as':_0xb148('0x116'),'through':_0xb148('0x123')});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x62')],{'as':_0xb148('0x113'),'through':_0xb148('0x124')});db['User'][_0xb148('0x11f')](db[_0xb148('0x115')],{'as':_0xb148('0x125'),'through':_0xb148('0x126')});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x114')],{'as':_0xb148('0x127'),'through':_0xb148('0x128')});db[_0xb148('0x107')]['belongsToMany'](db[_0xb148('0x59')],{'as':_0xb148('0x112'),'through':'user_has_openchannel_interactions'});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x117')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x129')],{'as':_0xb148('0x12a'),'through':_0xb148('0x2c'),'required':![]});db[_0xb148('0x107')]['belongsToMany'](db[_0xb148('0xf1')],{'as':_0xb148('0x12b'),'through':_0xb148('0x105'),'required':![]});db['User'][_0xb148('0x11f')](db['MailQueue'],{'as':_0xb148('0x12c'),'through':_0xb148('0x30'),'required':![]});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x67')],{'as':'ChatQueues','through':_0xb148('0x2e'),'required':![],'hooks':!![]});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x4a')],{'as':_0xb148('0x12d'),'through':_0xb148('0x31'),'required':![]});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x54')],{'as':_0xb148('0x12e'),'through':_0xb148('0x32'),'required':![]});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x12f')],{'as':_0xb148('0x130'),'through':_0xb148('0x33'),'required':![]});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x101')],{'as':_0xb148('0x131'),'through':_0xb148('0x132'),'required':![]});db['User'][_0xb148('0x11f')](db[_0xb148('0xef')],{'through':_0xb148('0x121')});db['User'][_0xb148('0x11f')](db[_0xb148('0x5d')],{'as':_0xb148('0x133'),'through':'user_has_chat_websites'});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x134')],{'as':_0xb148('0x135'),'through':'user_has_fax_accounts'});db['User'][_0xb148('0x11f')](db['MailAccount'],{'as':_0xb148('0x136'),'through':_0xb148('0x137')});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x56')],{'as':_0xb148('0x138'),'through':_0xb148('0x139')});db['User'][_0xb148('0x11f')](db[_0xb148('0x4d')],{'as':_0xb148('0x13a'),'through':_0xb148('0x13b')});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0xf8')],{'as':_0xb148('0x13c'),'through':_0xb148('0x13d')});db[_0xb148('0x107')][_0xb148('0x11f')](db[_0xb148('0x13e')],{'as':_0xb148('0x13f'),'through':'user_has_square_projects'});db[_0xb148('0x140')]['hasMany'](db[_0xb148('0x17')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0xb148('0x141')});db['VoiceContext'][_0xb148('0x10c')](db[_0xb148('0x17')],{'onDelete':_0xb148('0x109')});db[_0xb148('0x17')][_0xb148('0x10c')](db[_0xb148('0x17')],{'as':'Applications','onDelete':_0xb148('0x109')});db[_0xb148('0x19')]['belongsToMany'](db[_0xb148('0x87')],{'as':_0xb148('0x142'),'through':_0xb148('0x143')});db['VoiceQueue'][_0xb148('0x10c')](db[_0xb148('0x10d')],{'as':_0xb148('0x144'),'foreignKey':_0xb148('0x145')});db['VoiceQueue'][_0xb148('0x10c')](db[_0xb148('0x70')],{'as':_0xb148('0x146'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xb148('0x10c')](db[_0xb148('0x73')],{'as':_0xb148('0x110'),'foreignKey':'VoiceQueueId'});db[_0xb148('0x129')][_0xb148('0x10c')](db[_0xb148('0x111')],{'as':_0xb148('0x147'),'foreignKey':_0xb148('0x145')});db[_0xb148('0x129')]['hasMany'](db['ReportAgentPreview'],{'as':_0xb148('0x75'),'foreignKey':_0xb148('0x145')});db['VoiceQueue'][_0xb148('0x10c')](db[_0xb148('0x71')],{'as':_0xb148('0x148'),'foreignKey':_0xb148('0x145')});db[_0xb148('0x129')]['hasMany'](db[_0xb148('0xcd')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xb148('0x129')][_0xb148('0x11b')](db[_0xb148('0x28')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0xb148('0x129')][_0xb148('0x11b')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0xb148('0x149')});db[_0xb148('0x129')][_0xb148('0x11b')](db[_0xb148('0x7e')],{'as':_0xb148('0x7e'),'foreignKey':_0xb148('0x14a')});db[_0xb148('0x129')]['belongsTo'](db[_0xb148('0x80')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xb148('0x129')][_0xb148('0x11f')](db[_0xb148('0xef')],{'as':'Lists','through':_0xb148('0x14b')});db['VoiceQueue'][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x14c'),'through':_0xb148('0x2c')});db[_0xb148('0x129')][_0xb148('0x11f')](db[_0xb148('0xdb')],{'as':_0xb148('0x14d'),'through':_0xb148('0x103')});db[_0xb148('0x129')][_0xb148('0x11f')](db[_0xb148('0xef')],{'as':_0xb148('0x14e'),'through':_0xb148('0x14f')});db[_0xb148('0x1c')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x107'),'foreignKey':'UserId'});db[_0xb148('0x1e')][_0xb148('0x11b')](db['User'],{'as':_0xb148('0x107'),'foreignKey':'UserId'});db[_0xb148('0x1f')][_0xb148('0x10c')](db[_0xb148('0x20')],{'as':_0xb148('0x150'),'onDelete':'cascade','foreignKey':_0xb148('0x151'),'sourceKey':_0xb148('0x152')});db[_0xb148('0x20')][_0xb148('0x11b')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0xb148('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':_0xb148('0x153'),'foreignKey':_0xb148('0x154'),'constraints':![]});db[_0xb148('0x22')]['hasMany'](db['VoiceAgentReport'],{'as':_0xb148('0x155'),'foreignKey':'uniqueid','constraints':![]});db[_0xb148('0x22')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x107'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x22')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xb148('0x156')});db[_0xb148('0x157')][_0xb148('0x11b')](db[_0xb148('0x37')],{'as':_0xb148('0x37'),'foreignKey':_0xb148('0x158')});db[_0xb148('0x157')][_0xb148('0x11b')](db[_0xb148('0x102')],{'as':_0xb148('0x102'),'foreignKey':_0xb148('0x159'),'onDelete':_0xb148('0x15a')});db[_0xb148('0x36')][_0xb148('0x11b')](db['MailAccount'],{'as':_0xb148('0x37'),'foreignKey':_0xb148('0x158')});db[_0xb148('0x36')]['belongsTo'](db['CloudProvider'],{'as':_0xb148('0x102'),'foreignKey':_0xb148('0x159'),'onDelete':_0xb148('0x15a')});db['MailAccount'][_0xb148('0x108')](db[_0xb148('0x157')],{'as':_0xb148('0x15b'),'onDelete':'cascade'});db[_0xb148('0x37')][_0xb148('0x108')](db[_0xb148('0x36')],{'as':_0xb148('0x15c'),'onDelete':_0xb148('0x109')});db[_0xb148('0x37')][_0xb148('0x10c')](db[_0xb148('0x7b')],{'as':_0xb148('0x15d'),'foreignKey':_0xb148('0x158'),'onDelete':_0xb148('0x109')});db[_0xb148('0x37')][_0xb148('0x10c')](db[_0xb148('0x79')],{'as':_0xb148('0x15e'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xb148('0x10c')](db[_0xb148('0x3e')],{'as':_0xb148('0x150'),'foreignKey':'MailAccountId'});db[_0xb148('0x37')][_0xb148('0x10c')](db[_0xb148('0x3c')],{'as':_0xb148('0x15f')});db[_0xb148('0x37')][_0xb148('0x10c')](db[_0xb148('0x3f')],{'as':_0xb148('0x160')});db[_0xb148('0x37')][_0xb148('0x11b')](db['CmList'],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db['MailAccount'][_0xb148('0x11b')](db[_0xb148('0x8b')],{'as':_0xb148('0x8b'),'foreignKey':_0xb148('0x163')});db[_0xb148('0x37')]['belongsTo'](db[_0xb148('0x80')],{'as':_0xb148('0x164'),'foreignKey':_0xb148('0x165')});db[_0xb148('0x37')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':'Agents','through':_0xb148('0x137')});db[_0xb148('0x39')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x14c'),'through':_0xb148('0x30')});db[_0xb148('0x39')][_0xb148('0x11f')](db[_0xb148('0xdb')],{'through':_0xb148('0x166'),'as':_0xb148('0x14d')});db['MailInteraction'][_0xb148('0x10c')](db[_0xb148('0x3e')],{'as':_0xb148('0x150'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x167')});db[_0xb148('0x3c')]['belongsTo'](db[_0xb148('0x37')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x158')});db[_0xb148('0x3c')]['belongsTo'](db['CmContact'],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db[_0xb148('0x3c')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x16a'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x3c')][_0xb148('0x11f')](db[_0xb148('0x89')],{'through':'mail_interaction_has_tags','as':_0xb148('0x16b')});db['MailInteraction'][_0xb148('0x11f')](db['Tag'],{'through':_0xb148('0x16c'),'as':_0xb148('0x16d')});db[_0xb148('0x3c')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x16e'),'through':_0xb148('0x123'),'foreignKey':_0xb148('0x167')});db[_0xb148('0x3e')][_0xb148('0x10c')](db['Attachment'],{'as':_0xb148('0x16f'),'onDelete':'cascade'});db[_0xb148('0x3e')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x107')});db[_0xb148('0x3e')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x169')});db[_0xb148('0x3e')][_0xb148('0x11b')](db[_0xb148('0x3c')],{'as':_0xb148('0x170'),'foreignKey':_0xb148('0x167')});db[_0xb148('0x3e')][_0xb148('0x11b')](db[_0xb148('0x37')],{'as':_0xb148('0x168'),'foreignKey':'MailAccountId'});db['MailMessage']['belongsTo'](db[_0xb148('0x5d')],{'as':_0xb148('0x5d'),'foreignKey':_0xb148('0x171')});db[_0xb148('0x3e')][_0xb148('0x11b')](db[_0xb148('0x66')],{'as':_0xb148('0x66'),'foreignKey':_0xb148('0x172')});db[_0xb148('0x3f')][_0xb148('0x11b')](db['User'],{'onDelete':_0xb148('0x15a')});db[_0xb148('0x3f')][_0xb148('0x11b')](db['MailQueue'],{'onDelete':'restrict'});db[_0xb148('0x3f')][_0xb148('0x11b')](db[_0xb148('0x37')],{'onDelete':_0xb148('0x15a')});db[_0xb148('0x3f')]['belongsTo'](db[_0xb148('0x7e')],{'onDelete':'restrict','foreignKey':_0xb148('0x14a')});db[_0xb148('0x3f')][_0xb148('0x11b')](db[_0xb148('0x89')],{'onDelete':_0xb148('0x15a'),'foreignKey':'TagId'});db[_0xb148('0x40')][_0xb148('0x11b')](db[_0xb148('0x37')],{});db[_0xb148('0x40')][_0xb148('0x11b')](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db[_0xb148('0x40')]['belongsTo'](db[_0xb148('0x6e')],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db[_0xb148('0x40')][_0xb148('0x11b')](db['MailInteraction'],{});db[_0xb148('0x40')][_0xb148('0x11b')](db['MailMessage'],{});db[_0xb148('0x40')][_0xb148('0x11b')](db[_0xb148('0x107')],{});db['MailQueueReport'][_0xb148('0x11b')](db[_0xb148('0x39')],{});db['Dashboard'][_0xb148('0x10c')](db[_0xb148('0x173')],{'as':_0xb148('0x174'),'onDelete':_0xb148('0x109')});db[_0xb148('0x134')]['hasMany'](db[_0xb148('0x7b')],{'as':_0xb148('0x15d'),'foreignKey':_0xb148('0x175'),'onDelete':_0xb148('0x109')});db['FaxAccount'][_0xb148('0x10c')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xb148('0x175')});db[_0xb148('0x134')][_0xb148('0x10c')](db['FaxInteraction'],{'as':_0xb148('0x15f')});db[_0xb148('0x134')]['hasMany'](db[_0xb148('0x45')],{'as':_0xb148('0x160')});db[_0xb148('0x134')][_0xb148('0x10c')](db[_0xb148('0x17')],{'as':_0xb148('0x176'),'onDelete':_0xb148('0x109')});db['FaxAccount'][_0xb148('0x10c')](db[_0xb148('0x48')],{'as':_0xb148('0x150')});db[_0xb148('0x134')][_0xb148('0x11b')](db[_0xb148('0x28')],{'as':_0xb148('0x28')});db[_0xb148('0x134')][_0xb148('0x11b')](db[_0xb148('0xef')],{'as':'List','foreignKey':_0xb148('0x162')});db[_0xb148('0x134')][_0xb148('0x11b')](db[_0xb148('0x80')],{'as':_0xb148('0x164'),'foreignKey':_0xb148('0x165')});db[_0xb148('0x134')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xb148('0x45')]['belongsTo'](db[_0xb148('0x107')],{'onDelete':'restrict'});db[_0xb148('0x45')][_0xb148('0x11b')](db['FaxQueue'],{'onDelete':_0xb148('0x15a')});db[_0xb148('0x45')][_0xb148('0x11b')](db[_0xb148('0x134')],{'onDelete':_0xb148('0x15a')});db[_0xb148('0x45')]['belongsTo'](db['Tag'],{'onDelete':_0xb148('0x15a'),'foreignKey':_0xb148('0x177')});db[_0xb148('0x115')][_0xb148('0x10c')](db[_0xb148('0x48')],{'as':_0xb148('0x150'),'onDelete':_0xb148('0x109'),'foreignKey':'FaxInteractionId'});db[_0xb148('0x115')]['belongsTo'](db[_0xb148('0x134')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x175')});db[_0xb148('0x115')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db['FaxInteraction'][_0xb148('0x11b')](db['User'],{'as':_0xb148('0x16a'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x115')]['belongsToMany'](db['Tag'],{'through':_0xb148('0x178'),'as':'Tags'});db[_0xb148('0x115')][_0xb148('0x11f')](db[_0xb148('0x89')],{'through':_0xb148('0x178'),'as':_0xb148('0x16d')});db[_0xb148('0x115')][_0xb148('0x11f')](db['User'],{'as':_0xb148('0x16e'),'through':_0xb148('0x126'),'foreignKey':'FaxInteractionId'});db[_0xb148('0x48')][_0xb148('0x11b')](db[_0xb148('0x107')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x107')});db[_0xb148('0x48')]['belongsTo'](db[_0xb148('0x115')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0xb148('0x48')]['belongsTo'](db['CmContact'],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x169')});db[_0xb148('0x48')][_0xb148('0x11b')](db['Attachment'],{'as':_0xb148('0xe2'),'foreignKey':_0xb148('0x179')});db[_0xb148('0x48')][_0xb148('0x11b')](db[_0xb148('0x134')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x175')});db[_0xb148('0x4a')][_0xb148('0x11f')](db['User'],{'as':_0xb148('0x14c'),'through':_0xb148('0x31')});db[_0xb148('0x4a')][_0xb148('0x11f')](db[_0xb148('0xdb')],{'through':_0xb148('0x17a'),'as':'Teams'});db[_0xb148('0x17b')]['belongsTo'](db[_0xb148('0x134')],{});db['FaxQueueReport'][_0xb148('0x11b')](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db['FaxQueueReport'][_0xb148('0x11b')](db['CmContact'],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db['FaxQueueReport'][_0xb148('0x11b')](db['FaxInteraction'],{});db['FaxQueueReport'][_0xb148('0x11b')](db[_0xb148('0x48')],{});db[_0xb148('0x17b')]['belongsTo'](db[_0xb148('0x107')],{});db[_0xb148('0x17b')]['belongsTo'](db[_0xb148('0x4a')],{});db[_0xb148('0x4d')][_0xb148('0x10c')](db[_0xb148('0x7b')],{'as':_0xb148('0x15d'),'foreignKey':_0xb148('0x17c'),'onDelete':_0xb148('0x109')});db[_0xb148('0x4d')]['hasMany'](db['CannedAnswer'],{'as':_0xb148('0x15e'),'foreignKey':'SmsAccountId'});db[_0xb148('0x4d')][_0xb148('0x10c')](db[_0xb148('0x52')],{'as':_0xb148('0x150'),'foreignKey':_0xb148('0x17c')});db[_0xb148('0x4d')][_0xb148('0x10c')](db['SmsInteraction'],{'as':_0xb148('0x15f')});db['SmsAccount'][_0xb148('0x10c')](db[_0xb148('0x4f')],{'as':'Applications'});db['SmsAccount']['belongsTo'](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db['SmsAccount'][_0xb148('0x11b')](db['Pause'],{'as':_0xb148('0x164'),'foreignKey':_0xb148('0x165')});db[_0xb148('0x4d')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x14c'),'through':_0xb148('0x13b')});db['SmsApplication'][_0xb148('0x11b')](db[_0xb148('0x107')],{'onDelete':_0xb148('0x15a')});db[_0xb148('0x4f')][_0xb148('0x11b')](db[_0xb148('0x54')],{'onDelete':_0xb148('0x15a')});db['SmsApplication'][_0xb148('0x11b')](db[_0xb148('0x4d')],{'onDelete':_0xb148('0x15a')});db[_0xb148('0x4f')]['belongsTo'](db[_0xb148('0x7e')],{'onDelete':'restrict','foreignKey':_0xb148('0x14a')});db['SmsApplication'][_0xb148('0x11b')](db[_0xb148('0x89')],{'onDelete':'restrict','foreignKey':_0xb148('0x177')});db[_0xb148('0x114')][_0xb148('0x10c')](db[_0xb148('0x52')],{'as':_0xb148('0x150'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x17d')});db[_0xb148('0x114')][_0xb148('0x11b')](db['SmsAccount'],{'as':'Account','foreignKey':_0xb148('0x17c')});db['SmsInteraction'][_0xb148('0x11b')](db['CmContact'],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db[_0xb148('0x114')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x16a'),'foreignKey':_0xb148('0x10a')});db[_0xb148('0x114')]['belongsToMany'](db[_0xb148('0x89')],{'through':_0xb148('0x17e'),'as':_0xb148('0x16b')});db['SmsInteraction'][_0xb148('0x11f')](db[_0xb148('0x89')],{'through':_0xb148('0x17e'),'as':_0xb148('0x16d')});db[_0xb148('0x114')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x16e'),'through':_0xb148('0x128'),'foreignKey':_0xb148('0x17d')});db[_0xb148('0x52')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':'User'});db[_0xb148('0x52')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'onDelete':'cascade','as':_0xb148('0x169')});db[_0xb148('0x52')][_0xb148('0x11b')](db[_0xb148('0x114')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x170'),'foreignKey':_0xb148('0x17d')});db['SmsMessage'][_0xb148('0x11b')](db['SmsAccount'],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x17c')});db[_0xb148('0x54')]['belongsToMany'](db['User'],{'as':_0xb148('0x14c'),'through':'UserSmsQueue','foreignKey':_0xb148('0x17f')});db['SmsQueue'][_0xb148('0x11f')](db['Team'],{'through':_0xb148('0x180'),'as':'Teams'});db[_0xb148('0x56')]['hasMany'](db['Disposition'],{'as':_0xb148('0x15d'),'foreignKey':_0xb148('0x181'),'onDelete':_0xb148('0x109')});db[_0xb148('0x56')]['hasMany'](db['CannedAnswer'],{'as':_0xb148('0x15e'),'foreignKey':_0xb148('0x181')});db[_0xb148('0x56')][_0xb148('0x10c')](db[_0xb148('0x59')],{'as':_0xb148('0x15f'),'foreignKey':_0xb148('0x181')});db[_0xb148('0x56')][_0xb148('0x10c')](db[_0xb148('0x182')],{'as':_0xb148('0x150'),'foreignKey':_0xb148('0x181')});db[_0xb148('0x56')]['hasMany'](db['OpenchannelApplication'],{'as':_0xb148('0x160'),'foreignKey':_0xb148('0x181')});db['OpenchannelAccount']['belongsTo'](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db[_0xb148('0x56')][_0xb148('0x11b')](db[_0xb148('0x80')],{'as':_0xb148('0x164'),'foreignKey':_0xb148('0x165')});db['OpenchannelAccount']['belongsToMany'](db[_0xb148('0x107')],{'as':'Agents','through':_0xb148('0x139')});db['OpenchannelApplication']['belongsTo'](db[_0xb148('0x107')],{'onDelete':_0xb148('0x15a')});db[_0xb148('0x58')][_0xb148('0x11b')](db[_0xb148('0x12f')],{'onDelete':_0xb148('0x15a'),'foreignKey':_0xb148('0x183')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0xb148('0x15a'),'foreignKey':_0xb148('0x181')});db[_0xb148('0x58')][_0xb148('0x11b')](db[_0xb148('0x7e')],{'onDelete':_0xb148('0x15a'),'foreignKey':'IntervalId'});db[_0xb148('0x58')][_0xb148('0x11b')](db['Tag'],{'onDelete':_0xb148('0x15a'),'foreignKey':_0xb148('0x177')});db[_0xb148('0x59')][_0xb148('0x10c')](db[_0xb148('0x182')],{'as':_0xb148('0x150'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x184')});db['OpenchannelInteraction'][_0xb148('0x11b')](db['OpenchannelAccount'],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x181')});db[_0xb148('0x59')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db[_0xb148('0x59')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x16a'),'foreignKey':_0xb148('0x10a')});db['OpenchannelInteraction'][_0xb148('0x11f')](db['Tag'],{'through':_0xb148('0x185'),'as':_0xb148('0x16b')});db[_0xb148('0x59')][_0xb148('0x11f')](db[_0xb148('0x89')],{'through':_0xb148('0x185'),'as':_0xb148('0x16d')});db['OpenchannelInteraction'][_0xb148('0x11f')](db['User'],{'as':_0xb148('0x16e'),'through':_0xb148('0x186'),'foreignKey':_0xb148('0x184')});db[_0xb148('0x182')][_0xb148('0x11b')](db['User'],{'onDelete':_0xb148('0x109'),'as':'User'});db[_0xb148('0x182')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x169')});db['OpenchannelMessage'][_0xb148('0x11b')](db[_0xb148('0x59')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x170'),'foreignKey':_0xb148('0x184')});db[_0xb148('0x182')]['belongsTo'](db[_0xb148('0xe2')],{'as':_0xb148('0xe2'),'foreignKey':_0xb148('0x179')});db['OpenchannelMessage'][_0xb148('0x11b')](db[_0xb148('0x56')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x181')});db[_0xb148('0x12f')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':'Agents','through':_0xb148('0x33'),'foreignKey':'OpenchannelQueueId'});db[_0xb148('0x12f')]['belongsToMany'](db[_0xb148('0xdb')],{'through':_0xb148('0x187'),'as':_0xb148('0x14d')});db[_0xb148('0x5d')][_0xb148('0x10c')](db['Disposition'],{'as':_0xb148('0x15d'),'foreignKey':_0xb148('0x171'),'onDelete':_0xb148('0x109')});db[_0xb148('0x5d')]['hasMany'](db[_0xb148('0x79')],{'as':_0xb148('0x15e'),'foreignKey':_0xb148('0x171')});db['ChatWebsite'][_0xb148('0x10c')](db[_0xb148('0x6a')],{'as':'ProactiveActions'});db['ChatWebsite'][_0xb148('0x10c')](db[_0xb148('0x62')],{'as':_0xb148('0x15f')});db[_0xb148('0x5d')][_0xb148('0x10c')](db[_0xb148('0x60')],{'as':'Applications'});db['ChatWebsite'][_0xb148('0x10c')](db[_0xb148('0x64')],{'as':_0xb148('0x150')});db[_0xb148('0x5d')]['belongsTo'](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':'ListId'});db[_0xb148('0x5d')][_0xb148('0x11b')](db[_0xb148('0x7e')],{'as':_0xb148('0x7e'),'foreignKey':'IntervalId'});db[_0xb148('0x5d')][_0xb148('0x11b')](db[_0xb148('0x37')],{'as':'MailAccount','foreignKey':_0xb148('0x158')});db[_0xb148('0x5d')]['belongsTo'](db[_0xb148('0x80')],{'as':_0xb148('0x164'),'foreignKey':_0xb148('0x165')});db[_0xb148('0x5d')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x14c'),'through':_0xb148('0x188')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0xb148('0x5e')][_0xb148('0x11b')](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db['OpenchannelQueueReport']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0xb148('0x11b')](db[_0xb148('0x59')],{});db['OpenchannelQueueReport'][_0xb148('0x11b')](db[_0xb148('0x182')],{});db['OpenchannelQueueReport'][_0xb148('0x11b')](db[_0xb148('0x107')],{});db[_0xb148('0x5e')][_0xb148('0x11b')](db['OpenchannelQueue'],{});db[_0xb148('0x60')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x189'),'foreignKey':_0xb148('0x10a'),'onDelete':_0xb148('0x15a')});db['ChatApplication']['belongsTo'](db[_0xb148('0x67')],{'as':_0xb148('0x18a'),'foreignKey':_0xb148('0x18b'),'onDelete':'restrict'});db['ChatApplication'][_0xb148('0x11b')](db[_0xb148('0x5d')],{'as':_0xb148('0x18c'),'foreignKey':'ChatWebsiteId','onDelete':_0xb148('0x15a')});db[_0xb148('0x60')][_0xb148('0x11b')](db[_0xb148('0x89')],{'onDelete':_0xb148('0x15a'),'foreignKey':'TagId'});db['ChatInteraction'][_0xb148('0x10c')](db[_0xb148('0x64')],{'as':_0xb148('0x150'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x18d')});db[_0xb148('0x62')][_0xb148('0x11b')](db['ChatWebsite'],{'as':_0xb148('0x168'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0xb148('0x6e')],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db['ChatInteraction']['belongsTo'](db[_0xb148('0x107')],{'as':_0xb148('0x16a'),'foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0xb148('0x18e'),'as':'Tags'});db[_0xb148('0x62')][_0xb148('0x11f')](db[_0xb148('0x89')],{'through':_0xb148('0x18e'),'as':'ThroughTags'});db[_0xb148('0x62')]['belongsToMany'](db['User'],{'as':'Users','through':_0xb148('0x124'),'foreignKey':'ChatInteractionId'});db[_0xb148('0x64')][_0xb148('0x11b')](db[_0xb148('0x107')],{'onDelete':_0xb148('0x109'),'as':'User'});db['ChatMessage'][_0xb148('0x11b')](db[_0xb148('0x6e')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x169'),'foreignKey':'ContactId'});db[_0xb148('0x64')][_0xb148('0x11b')](db[_0xb148('0x62')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x170'),'foreignKey':_0xb148('0x18d')});db['ChatMessage'][_0xb148('0x11b')](db[_0xb148('0xe2')],{'as':_0xb148('0xe2'),'foreignKey':_0xb148('0x179')});db[_0xb148('0x64')]['belongsTo'](db[_0xb148('0x5d')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x171')});db['ChatOfflineMessage']['hasMany'](db[_0xb148('0xe2')],{'as':_0xb148('0x16f'),'foreignKey':_0xb148('0x172'),'onDelete':_0xb148('0x109'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xb148('0x6e')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db[_0xb148('0x66')][_0xb148('0x11b')](db[_0xb148('0x5d')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x171')});db[_0xb148('0x67')][_0xb148('0x11f')](db['User'],{'as':_0xb148('0x14c'),'through':_0xb148('0x2e'),'hooks':!![]});db[_0xb148('0x67')][_0xb148('0x11f')](db[_0xb148('0xdb')],{'through':'team_has_chat_queues','as':'Teams'});db[_0xb148('0x68')]['hasMany'](db[_0xb148('0x18f')],{'as':_0xb148('0x150'),'foreignKey':_0xb148('0x190'),'onDelete':_0xb148('0x109')});db['ChatGroup'][_0xb148('0x11f')](db['User'],{'as':'Members','through':_0xb148('0x11e')});db['ChatProactiveAction'][_0xb148('0x11b')](db[_0xb148('0x5d')],{'as':_0xb148('0x18c'),'foreignKey':_0xb148('0x171')});db[_0xb148('0x6c')]['hasMany'](db[_0xb148('0x6e')],{'as':_0xb148('0x120'),'foreignKey':'CompanyId'});db[_0xb148('0x6e')]['hasMany'](db[_0xb148('0x70')],{'as':'Hoppers','foreignKey':_0xb148('0x156')});db['CmContact'][_0xb148('0x10c')](db[_0xb148('0x73')],{'as':_0xb148('0x110'),'foreignKey':'ContactId'});db[_0xb148('0x6e')][_0xb148('0x10c')](db['CmHopperHistory'],{'as':_0xb148('0x147'),'foreignKey':'ContactId'});db[_0xb148('0x6e')]['hasMany'](db[_0xb148('0x75')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0xb148('0x6e')][_0xb148('0x10c')](db[_0xb148('0xcd')],{'as':_0xb148('0x191'),'foreignKey':_0xb148('0x156')});db[_0xb148('0x6e')][_0xb148('0x10c')](db[_0xb148('0x59')],{'as':'OpenchannelInteractions','foreignKey':_0xb148('0x156'),'onDelete':_0xb148('0x15a')});db[_0xb148('0x6e')][_0xb148('0x10c')](db[_0xb148('0x62')],{'as':'ChatInteractions','foreignKey':_0xb148('0x156'),'onDelete':_0xb148('0x15a')});db['CmContact']['hasMany'](db[_0xb148('0x114')],{'as':_0xb148('0x127'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xb148('0x6e')][_0xb148('0x10c')](db['FaxInteraction'],{'as':_0xb148('0x125'),'foreignKey':_0xb148('0x156'),'onDelete':_0xb148('0x15a')});db[_0xb148('0x6e')][_0xb148('0x10c')](db['MailInteraction'],{'as':_0xb148('0x116'),'foreignKey':_0xb148('0x156'),'onDelete':_0xb148('0x15a')});db[_0xb148('0x6e')][_0xb148('0x11b')](db[_0xb148('0x6c')],{'as':_0xb148('0x192'),'foreignKey':_0xb148('0x193')});db['CmContact'][_0xb148('0x11b')](db[_0xb148('0xef')],{'as':'List','foreignKey':_0xb148('0x162'),'onDelete':'cascade'});db[_0xb148('0x6e')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':'Users','through':_0xb148('0x194')});db[_0xb148('0x6e')]['belongsToMany'](db['Tag'],{'as':_0xb148('0x16b'),'through':_0xb148('0x195')});db[_0xb148('0x6e')]['belongsToMany'](db[_0xb148('0x89')],{'through':_0xb148('0x195'),'as':_0xb148('0x16d')});db[_0xb148('0x70')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'as':'Contact','foreignKey':_0xb148('0x156'),'onDelete':_0xb148('0x109')});db['CmHopper']['belongsTo'](db[_0xb148('0xef')],{'as':'List','foreignKey':_0xb148('0x162'),'onDelete':_0xb148('0x109')});db['CmHopper'][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':'Agent','foreignKey':_0xb148('0x10a')});db[_0xb148('0x70')]['belongsTo'](db[_0xb148('0x129')],{'as':_0xb148('0x18a'),'foreignKey':_0xb148('0x145'),'onDelete':_0xb148('0x109')});db['CmHopper'][_0xb148('0x11b')](db[_0xb148('0xdf')],{'as':_0xb148('0xdf'),'foreignKey':_0xb148('0x196'),'onDelete':_0xb148('0x109')});db[_0xb148('0x70')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':'Owner','foreignKey':'OwnerId'});db[_0xb148('0x71')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156'),'onDelete':'cascade'});db['CmHopperBlack'][_0xb148('0x11b')](db['CmList'],{'as':'List','foreignKey':_0xb148('0x162'),'onDelete':_0xb148('0x109')});db[_0xb148('0x71')][_0xb148('0x11b')](db[_0xb148('0x129')],{'as':_0xb148('0x18a'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xb148('0x71')][_0xb148('0x11b')](db[_0xb148('0xdf')],{'as':_0xb148('0xdf'),'foreignKey':'CampaignId','onDelete':_0xb148('0x109')});db[_0xb148('0x78')]['hasMany'](db['Condition'],{'as':{'plural':_0xb148('0x197'),'singular':_0xb148('0x198')},'foreignKey':_0xb148('0x199'),'onDelete':_0xb148('0x109'),'hooks':!![]});db[_0xb148('0x78')][_0xb148('0x10c')](db[_0xb148('0x19a')],{'as':{'plural':'Any','singular':_0xb148('0x19b')},'foreignKey':_0xb148('0x19c'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0xb148('0x77')],{'as':_0xb148('0x19d'),'foreignKey':_0xb148('0x19e'),'onDelete':_0xb148('0x109'),'hooks':!![]});db['Disposition'][_0xb148('0x10c')](db[_0xb148('0x7b')],{'as':_0xb148('0x15d'),'foreignKey':'ParentId','onDelete':_0xb148('0x109')});db[_0xb148('0x7e')][_0xb148('0x10c')](db[_0xb148('0x7e')],{'as':_0xb148('0x19f'),'foreignKey':'IntervalId','onDelete':_0xb148('0x109'),'hooks':!![],'required':![]});db['Interval'][_0xb148('0x10c')](db[_0xb148('0x17')],{'as':_0xb148('0x10f'),'foreignKey':_0xb148('0x14a'),'onDelete':_0xb148('0x15a')});db['Interval'][_0xb148('0x10c')](db[_0xb148('0x3f')],{'as':'MailApplications','foreignKey':'IntervalId'});db['Interval'][_0xb148('0x10c')](db['ChatApplication'],{'as':_0xb148('0x1a0'),'foreignKey':_0xb148('0x14a')});db[_0xb148('0x7e')][_0xb148('0x10c')](db['FaxApplication'],{'as':_0xb148('0x1a1'),'foreignKey':'IntervalId'});db['Interval'][_0xb148('0x10c')](db[_0xb148('0x4f')],{'as':_0xb148('0x1a2'),'foreignKey':_0xb148('0x14a')});db[_0xb148('0x85')][_0xb148('0x11b')](db['MailAccount'],{});db[_0xb148('0x85')]['belongsTo'](db[_0xb148('0x1a3')],{'foreignKey':_0xb148('0x1a4')});db[_0xb148('0x85')]['belongsTo'](db[_0xb148('0x91')],{'foreignKey':_0xb148('0x1a5')});db['Sound'][_0xb148('0x11f')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xb148('0x143'),'onDelete':'restrict'});db[_0xb148('0x89')][_0xb148('0x11f')](db[_0xb148('0x6e')],{'through':'cm_contact_has_tags'});db['Tag'][_0xb148('0x11f')](db[_0xb148('0x62')],{'through':_0xb148('0x18e')});db['Tag'][_0xb148('0x11f')](db[_0xb148('0x3c')],{'through':_0xb148('0x16c')});db[_0xb148('0x89')][_0xb148('0x11f')](db[_0xb148('0x114')],{'through':'sms_interaction_has_tags'});db['Tag'][_0xb148('0x11f')](db[_0xb148('0x115')],{'through':_0xb148('0x178')});db[_0xb148('0x89')][_0xb148('0x11f')](db[_0xb148('0x59')],{'through':_0xb148('0x185')});db[_0xb148('0x89')]['belongsToMany'](db[_0xb148('0x117')],{'through':_0xb148('0x1a6')});db[_0xb148('0x8c')][_0xb148('0x10c')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0xb148('0x1a7')},'foreignKey':_0xb148('0x1a8'),'onDelete':_0xb148('0x109'),'hooks':!![]});db[_0xb148('0x8c')]['hasMany'](db[_0xb148('0x19a')],{'as':{'plural':_0xb148('0x1a9'),'singular':_0xb148('0x1aa')},'foreignKey':_0xb148('0x1ab'),'onDelete':_0xb148('0x109'),'hooks':!![]});db[_0xb148('0x8c')][_0xb148('0x10c')](db[_0xb148('0x77')],{'as':'Actions','foreignKey':_0xb148('0x1ac'),'onDelete':_0xb148('0x109'),'hooks':!![]});db[_0xb148('0x91')][_0xb148('0x10c')](db[_0xb148('0x1ad')],{'as':_0xb148('0x1ae'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1a5'),'hooks':!![]});db['AnalyticDefaultReport'][_0xb148('0x10c')](db[_0xb148('0x1ad')],{'as':_0xb148('0x1ae'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1a4')});db[_0xb148('0x1af')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0xb148('0x1b0')});db['AnalyticFieldReport'][_0xb148('0x11b')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xb148('0x1b1')]['hasMany'](db[_0xb148('0x9a')],{'as':_0xb148('0x1b2'),'onDelete':'cascade','foreignKey':_0xb148('0x1b3')});db[_0xb148('0x9a')][_0xb148('0x10c')](db[_0xb148('0x9c')],{'as':'Subjects','onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0x9a')][_0xb148('0x10c')](db[_0xb148('0x9c')],{'as':_0xb148('0x1b5'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0x9a')][_0xb148('0x10c')](db[_0xb148('0x9c')],{'as':'Fields','onDelete':_0xb148('0x109'),'foreignKey':'FieldId'});db[_0xb148('0x9a')][_0xb148('0x11b')](db['SalesforceAccount'],{'as':_0xb148('0x168'),'foreignKey':'AccountId'});db['SalesforceField'][_0xb148('0x10c')](db[_0xb148('0x9c')],{'as':'Subject','foreignKey':_0xb148('0x1b4')});db['SalesforceField']['hasMany'](db[_0xb148('0x9c')],{'as':_0xb148('0x1b7'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0x9c')][_0xb148('0x10c')](db[_0xb148('0x9c')],{'as':_0xb148('0x1b8'),'foreignKey':_0xb148('0x1b9')});db[_0xb148('0x9c')][_0xb148('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0xb148('0x1ba')});db[_0xb148('0x9e')][_0xb148('0x10c')](db[_0xb148('0xa0')],{'as':_0xb148('0x1b2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xb148('0xa0')][_0xb148('0x10c')](db[_0xb148('0xa1')],{'as':_0xb148('0x1bb'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0xa0')][_0xb148('0x10c')](db[_0xb148('0xa1')],{'as':_0xb148('0x1b5'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b6')});db['SugarcrmConfiguration'][_0xb148('0x10c')](db[_0xb148('0xa1')],{'as':_0xb148('0x1ae'),'onDelete':'cascade','foreignKey':_0xb148('0x1b9')});db[_0xb148('0xa0')][_0xb148('0x11b')](db[_0xb148('0x9e')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x1b3')});db['SugarcrmField'][_0xb148('0x10c')](db['SugarcrmField'],{'as':_0xb148('0x1bc'),'foreignKey':_0xb148('0x1b4')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':'Description','foreignKey':_0xb148('0x1b6')});db[_0xb148('0xa1')][_0xb148('0x10c')](db[_0xb148('0xa1')],{'as':'Field','foreignKey':'FieldId'});db[_0xb148('0xa1')][_0xb148('0x11b')](db['Variable'],{'as':_0xb148('0x1bd'),'foreignKey':_0xb148('0x1ba')});db['DeskAccount'][_0xb148('0x10c')](db[_0xb148('0xa4')],{'as':_0xb148('0x1b2'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xa4')][_0xb148('0x10c')](db[_0xb148('0xa5')],{'as':_0xb148('0x1bb'),'onDelete':_0xb148('0x109'),'foreignKey':'SubjectId'});db[_0xb148('0xa4')][_0xb148('0x10c')](db[_0xb148('0xa5')],{'as':_0xb148('0x1b5'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0xa4')][_0xb148('0x10c')](db['DeskField'],{'as':_0xb148('0x1ae'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b9')});db['DeskConfiguration'][_0xb148('0x11b')](db[_0xb148('0xa2')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xa4')][_0xb148('0x11f')](db[_0xb148('0x89')],{'through':'int_desk_configuration_has_tags'});db[_0xb148('0xa5')][_0xb148('0x10c')](db[_0xb148('0xa5')],{'as':_0xb148('0x1bc'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0xa5')][_0xb148('0x10c')](db['DeskField'],{'as':_0xb148('0x1b7'),'foreignKey':_0xb148('0x1b6')});db['DeskField'][_0xb148('0x10c')](db[_0xb148('0xa5')],{'as':_0xb148('0x1b8'),'foreignKey':_0xb148('0x1b9')});db[_0xb148('0xa5')][_0xb148('0x11b')](db[_0xb148('0x1bd')],{'as':_0xb148('0x1bd'),'foreignKey':_0xb148('0x1ba')});db[_0xb148('0xa7')][_0xb148('0x10c')](db[_0xb148('0xa9')],{'as':'Configurations','onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xa9')][_0xb148('0x10c')](db[_0xb148('0xab')],{'as':_0xb148('0x1bb'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0xa9')]['hasMany'](db['ZohoField'],{'as':_0xb148('0x1b5'),'onDelete':_0xb148('0x109'),'foreignKey':'DescriptionId'});db[_0xb148('0xa9')][_0xb148('0x10c')](db[_0xb148('0xab')],{'as':_0xb148('0x1ae'),'onDelete':'cascade','foreignKey':_0xb148('0x1b9')});db['ZohoConfiguration'][_0xb148('0x11b')](db['ZohoAccount'],{'as':'Account','foreignKey':_0xb148('0x1b3')});db['ZohoField'][_0xb148('0x10c')](db[_0xb148('0xab')],{'as':'Subject','foreignKey':_0xb148('0x1b4')});db[_0xb148('0xab')][_0xb148('0x10c')](db[_0xb148('0xab')],{'as':_0xb148('0x1b7'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0xab')]['hasMany'](db[_0xb148('0xab')],{'as':_0xb148('0x1b8'),'foreignKey':_0xb148('0x1b9')});db[_0xb148('0xab')][_0xb148('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0xb148('0x1ba')});db[_0xb148('0x1be')][_0xb148('0x10c')](db[_0xb148('0x1bf')],{'as':_0xb148('0x1b2'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0x1bf')]['hasMany'](db['ZendeskField'],{'as':_0xb148('0x1bb'),'foreignKey':_0xb148('0x1b4')});db['ZendeskConfiguration'][_0xb148('0x10c')](db[_0xb148('0xae')],{'as':_0xb148('0x1b5'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0x1bf')][_0xb148('0x10c')](db[_0xb148('0xae')],{'as':'Fields','foreignKey':_0xb148('0x1b9')});db[_0xb148('0x1bf')]['belongsTo'](db[_0xb148('0x1be')],{'as':'Account','foreignKey':_0xb148('0x1b3')});db[_0xb148('0x1bf')]['belongsToMany'](db[_0xb148('0x89')],{'through':_0xb148('0x1c0')});db[_0xb148('0xae')][_0xb148('0x10c')](db[_0xb148('0xae')],{'as':'Subject','foreignKey':_0xb148('0x1b4')});db[_0xb148('0xae')][_0xb148('0x10c')](db[_0xb148('0xae')],{'as':_0xb148('0x1b7'),'foreignKey':'DescriptionId'});db[_0xb148('0xae')]['hasMany'](db[_0xb148('0xae')],{'as':_0xb148('0x1b8'),'foreignKey':_0xb148('0x1b9')});db['ZendeskField'][_0xb148('0x11b')](db[_0xb148('0x1bd')],{'as':'Variable','foreignKey':_0xb148('0x1ba')});db[_0xb148('0xb0')][_0xb148('0x10c')](db[_0xb148('0xb2')],{'as':_0xb148('0x1b2'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xb2')][_0xb148('0x10c')](db[_0xb148('0xb4')],{'as':_0xb148('0x1bb'),'onDelete':'cascade','foreignKey':_0xb148('0x1b4')});db[_0xb148('0xb2')]['hasMany'](db[_0xb148('0xb4')],{'as':_0xb148('0x1b5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xb148('0xb2')][_0xb148('0x10c')](db[_0xb148('0xb4')],{'as':_0xb148('0x1ae'),'onDelete':_0xb148('0x109'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0xb148('0x11b')](db[_0xb148('0xb0')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xb2')][_0xb148('0x11f')](db[_0xb148('0x89')],{'through':_0xb148('0x1c1')});db['FreshdeskField'][_0xb148('0x10c')](db[_0xb148('0xb4')],{'as':_0xb148('0x1bc'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0xb4')][_0xb148('0x10c')](db[_0xb148('0xb4')],{'as':_0xb148('0x1b7'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0xb4')][_0xb148('0x10c')](db[_0xb148('0xb4')],{'as':_0xb148('0x1b8'),'foreignKey':_0xb148('0x1b9')});db[_0xb148('0xb4')]['belongsTo'](db['Variable'],{'as':_0xb148('0x1bd'),'foreignKey':_0xb148('0x1ba')});db[_0xb148('0xb6')][_0xb148('0x10c')](db['VtigerConfiguration'],{'as':_0xb148('0x1b2'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xb8')][_0xb148('0x10c')](db[_0xb148('0xb9')],{'as':_0xb148('0x1bb'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0xb8')][_0xb148('0x10c')](db[_0xb148('0xb9')],{'as':_0xb148('0x1b5'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0xb8')][_0xb148('0x10c')](db[_0xb148('0xb9')],{'as':_0xb148('0x1ae'),'foreignKey':'FieldId'});db[_0xb148('0xb8')]['belongsTo'](db[_0xb148('0xb6')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xb9')][_0xb148('0x10c')](db['VtigerField'],{'as':_0xb148('0x1bc'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db[_0xb148('0xb9')],{'as':'Description','foreignKey':_0xb148('0x1b6')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':_0xb148('0x1b9')});db[_0xb148('0xb9')][_0xb148('0x11b')](db[_0xb148('0x1bd')],{'as':_0xb148('0x1bd'),'foreignKey':_0xb148('0x1ba')});db[_0xb148('0xbb')]['hasMany'](db['ServicenowConfiguration'],{'as':_0xb148('0x1b2'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0x1c2')]['hasMany'](db['ServicenowField'],{'as':_0xb148('0x1bb'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0x1c2')][_0xb148('0x10c')](db['ServicenowField'],{'as':_0xb148('0x1b5'),'foreignKey':'DescriptionId'});db[_0xb148('0x1c2')]['hasMany'](db[_0xb148('0xbd')],{'as':_0xb148('0x1ae'),'foreignKey':_0xb148('0x1b9')});db[_0xb148('0x1c2')][_0xb148('0x11b')](db[_0xb148('0xbb')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xbd')][_0xb148('0x10c')](db['ServicenowField'],{'as':_0xb148('0x1bc'),'foreignKey':_0xb148('0x1b4')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':_0xb148('0x1b7'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0xbd')]['hasMany'](db[_0xb148('0xbd')],{'as':_0xb148('0x1b8'),'foreignKey':_0xb148('0x1b9')});db[_0xb148('0xbd')][_0xb148('0x11b')](db[_0xb148('0x1bd')],{'as':'Variable','foreignKey':_0xb148('0x1ba')});db[_0xb148('0xbf')][_0xb148('0x10c')](db[_0xb148('0x1c3')],{'as':'Configurations','onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xbf')][_0xb148('0x11b')](db['CloudProvider'],{'as':_0xb148('0x102'),'foreignKey':_0xb148('0x159')});db[_0xb148('0x1c3')]['hasMany'](db[_0xb148('0x1c4')],{'as':'Subjects','onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0x1c3')][_0xb148('0x10c')](db[_0xb148('0x1c4')],{'as':_0xb148('0x1b5'),'onDelete':_0xb148('0x109'),'foreignKey':'DescriptionId'});db[_0xb148('0x1c3')][_0xb148('0x10c')](db['Dynamics365Field'],{'as':_0xb148('0x1ae'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xb148('0x1c3')]['belongsTo'](db['Dynamics365Account'],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0x1c4')][_0xb148('0x10c')](db['Dynamics365Field'],{'as':_0xb148('0x1bc'),'foreignKey':_0xb148('0x1b4')});db[_0xb148('0x1c4')][_0xb148('0x10c')](db[_0xb148('0x1c4')],{'as':_0xb148('0x1b7'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0x1c4')][_0xb148('0x10c')](db[_0xb148('0x1c4')],{'as':_0xb148('0x1b8'),'foreignKey':_0xb148('0x1b9')});db[_0xb148('0x1c4')][_0xb148('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0xb148('0x1ba')});db[_0xb148('0x1c5')][_0xb148('0x10c')](db[_0xb148('0xc2')],{'as':_0xb148('0x1b2'),'onDelete':_0xb148('0x109'),'foreignKey':'AccountId'});db[_0xb148('0xc2')][_0xb148('0x10c')](db[_0xb148('0xc4')],{'as':_0xb148('0x1bb'),'foreignKey':'SubjectId'});db[_0xb148('0xc2')][_0xb148('0x10c')](db[_0xb148('0xc4')],{'as':_0xb148('0x1b5'),'foreignKey':_0xb148('0x1b6')});db[_0xb148('0xc2')][_0xb148('0x10c')](db[_0xb148('0xc4')],{'as':_0xb148('0x1ae'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0xb148('0x11b')](db[_0xb148('0x1c5')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x1b3')});db[_0xb148('0xc4')][_0xb148('0x10c')](db[_0xb148('0xc4')],{'as':_0xb148('0x1bc'),'foreignKey':'SubjectId'});db['FreshsalesField'][_0xb148('0x10c')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xb148('0x1b6')});db[_0xb148('0xc4')][_0xb148('0x10c')](db['FreshsalesField'],{'as':_0xb148('0x1b8'),'foreignKey':_0xb148('0x1b9')});db[_0xb148('0xc4')][_0xb148('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0xb148('0x1ba')});db['ChatQueueReport'][_0xb148('0x11b')](db[_0xb148('0x5d')],{});db['ChatQueueReport'][_0xb148('0x11b')](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db[_0xb148('0x1c6')][_0xb148('0x11b')](db['CmContact'],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db['ChatQueueReport'][_0xb148('0x11b')](db[_0xb148('0x62')],{});db['ChatQueueReport'][_0xb148('0x11b')](db['ChatMessage'],{});db[_0xb148('0x1c6')][_0xb148('0x11b')](db[_0xb148('0x107')],{});db[_0xb148('0x1c6')][_0xb148('0x11b')](db[_0xb148('0x67')],{});db[_0xb148('0x18f')][_0xb148('0x11b')](db[_0xb148('0x107')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0xb148('0x18f')][_0xb148('0x11b')](db[_0xb148('0x107')],{'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1c7')});db[_0xb148('0xcd')][_0xb148('0x10c')](db[_0xb148('0xcc')],{'foreignKey':_0xb148('0x1c8'),'onDelete':_0xb148('0x109')});db['JscriptySessionReport']['hasMany'](db[_0xb148('0xca')],{'foreignKey':_0xb148('0x1c8'),'onDelete':_0xb148('0x109')});db['SmsQueueReport'][_0xb148('0x11b')](db[_0xb148('0x4d')],{});db[_0xb148('0xce')][_0xb148('0x11b')](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db[_0xb148('0xce')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'as':'Contact','foreignKey':_0xb148('0x156')});db[_0xb148('0xce')][_0xb148('0x11b')](db[_0xb148('0x114')],{});db[_0xb148('0xce')][_0xb148('0x11b')](db[_0xb148('0x52')],{});db['SmsQueueReport'][_0xb148('0x11b')](db['User'],{});db[_0xb148('0xce')][_0xb148('0x11b')](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db[_0xb148('0xcd')],{'foreignKey':'ProjectId'});db[_0xb148('0xd2')]['hasMany'](db[_0xb148('0xcc')],{'foreignKey':_0xb148('0x1c9')});db[_0xb148('0xd2')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xb148('0x1c9')});db[_0xb148('0x13e')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x16e'),'through':_0xb148('0x1ca')});db[_0xb148('0xdb')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x14c'),'through':'user_has_teams'});db[_0xb148('0xdb')][_0xb148('0x11f')](db['VoiceQueue'],{'through':_0xb148('0x103'),'as':_0xb148('0x12a')});db[_0xb148('0xdb')]['belongsToMany'](db[_0xb148('0x39')],{'through':_0xb148('0x166'),'as':_0xb148('0x12c')});db['Team'][_0xb148('0x11f')](db[_0xb148('0x67')],{'through':_0xb148('0x1cb'),'as':'ChatQueues'});db['Team']['belongsToMany'](db['FaxQueue'],{'through':_0xb148('0x17a'),'as':_0xb148('0x12d')});db[_0xb148('0xdb')][_0xb148('0x11f')](db[_0xb148('0x54')],{'through':_0xb148('0x180'),'as':'SmsQueues'});db[_0xb148('0xdb')][_0xb148('0x11f')](db[_0xb148('0x12f')],{'through':_0xb148('0x187'),'as':'OpenchannelQueues'});db[_0xb148('0xdb')]['belongsToMany'](db['WhatsappQueue'],{'through':_0xb148('0x1cc'),'as':_0xb148('0x131')});db[_0xb148('0xdb')][_0xb148('0x11f')](db[_0xb148('0xf1')],{'through':_0xb148('0x104'),'as':_0xb148('0x12b')});db[_0xb148('0xdf')][_0xb148('0x10c')](db[_0xb148('0x70')],{'as':'Hoppers','foreignKey':_0xb148('0x196')});db[_0xb148('0xdf')][_0xb148('0x10c')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xb148('0x196')});db[_0xb148('0xdf')][_0xb148('0x10c')](db[_0xb148('0x111')],{'as':_0xb148('0x147'),'foreignKey':_0xb148('0x196')});db['Campaign'][_0xb148('0x10c')](db[_0xb148('0x71')],{'as':_0xb148('0x148'),'foreignKey':_0xb148('0x196')});db[_0xb148('0xdf')][_0xb148('0x11b')](db[_0xb148('0x28')],{'as':_0xb148('0x28'),'foreignKey':_0xb148('0x1cd')});db[_0xb148('0xdf')][_0xb148('0x11b')](db[_0xb148('0x28')],{'as':_0xb148('0x1ce'),'foreignKey':_0xb148('0x149')});db[_0xb148('0xdf')][_0xb148('0x11b')](db['Interval'],{'as':_0xb148('0x7e'),'foreignKey':_0xb148('0x14a')});db['Campaign']['belongsTo'](db[_0xb148('0x13e')],{'as':_0xb148('0x13e'),'foreignKey':_0xb148('0x1cf')});db['Campaign'][_0xb148('0x11f')](db['CmList'],{'as':'Lists','through':'campaigns_has_cm_lists'});db['Campaign']['belongsToMany'](db[_0xb148('0xef')],{'as':_0xb148('0x14e'),'through':_0xb148('0x1d0')});db['Attachment'][_0xb148('0x11b')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0xb148('0x172')});db[_0xb148('0xe5')][_0xb148('0x11b')](db[_0xb148('0x3e')],{});db[_0xb148('0xe5')][_0xb148('0x11b')](db[_0xb148('0x3c')],{});db[_0xb148('0xe5')]['belongsTo'](db[_0xb148('0x37')],{'foreignKey':_0xb148('0x1d1'),'as':_0xb148('0x1d2')});db['MailTransferReport'][_0xb148('0x11b')](db[_0xb148('0x107')],{'foreignKey':'FromUserId','as':_0xb148('0x1d3')});db[_0xb148('0xe5')][_0xb148('0x11b')](db[_0xb148('0x107')],{'foreignKey':_0xb148('0x1d4'),'as':'ToAgent'});db[_0xb148('0xe5')]['belongsTo'](db['MailQueue'],{'foreignKey':_0xb148('0x1d5'),'as':_0xb148('0x1d6')});db[_0xb148('0xe5')][_0xb148('0x11b')](db['MailAccount'],{'foreignKey':_0xb148('0x1d7'),'as':_0xb148('0x1d8')});db[_0xb148('0xe7')][_0xb148('0x11b')](db[_0xb148('0x64')],{});db[_0xb148('0xe7')][_0xb148('0x11b')](db[_0xb148('0x62')],{});db['ChatTransferReport'][_0xb148('0x11b')](db[_0xb148('0x5d')],{'foreignKey':'FromChatWebsiteId','as':_0xb148('0x1d2')});db['ChatTransferReport'][_0xb148('0x11b')](db['User'],{'foreignKey':_0xb148('0x1d9'),'as':_0xb148('0x1d3')});db[_0xb148('0xe7')][_0xb148('0x11b')](db['User'],{'foreignKey':_0xb148('0x1d4'),'as':_0xb148('0x1da')});db[_0xb148('0xe7')][_0xb148('0x11b')](db[_0xb148('0x67')],{'foreignKey':_0xb148('0x1db'),'as':'ToQueue'});db[_0xb148('0xe7')][_0xb148('0x11b')](db[_0xb148('0x5d')],{'foreignKey':_0xb148('0x1dc'),'as':_0xb148('0x1d8')});db[_0xb148('0xe9')][_0xb148('0x11b')](db[_0xb148('0x48')],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db[_0xb148('0xe9')][_0xb148('0x11b')](db[_0xb148('0x134')],{'foreignKey':_0xb148('0x1dd'),'as':'FromAccount'});db[_0xb148('0xe9')][_0xb148('0x11b')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xb148('0xe9')][_0xb148('0x11b')](db[_0xb148('0x107')],{'foreignKey':'ToUserId','as':_0xb148('0x1da')});db[_0xb148('0xe9')][_0xb148('0x11b')](db[_0xb148('0x4a')],{'foreignKey':_0xb148('0x1de'),'as':_0xb148('0x1d6')});db[_0xb148('0xe9')][_0xb148('0x11b')](db[_0xb148('0x134')],{'foreignKey':'ToFaxAccountId','as':_0xb148('0x1d8')});db[_0xb148('0xeb')][_0xb148('0x11b')](db[_0xb148('0x182')],{});db[_0xb148('0xeb')][_0xb148('0x11b')](db[_0xb148('0x59')],{});db[_0xb148('0xeb')][_0xb148('0x11b')](db[_0xb148('0x56')],{'foreignKey':_0xb148('0x1df'),'as':_0xb148('0x1d2')});db[_0xb148('0xeb')][_0xb148('0x11b')](db[_0xb148('0x107')],{'foreignKey':_0xb148('0x1d9'),'as':_0xb148('0x1d3')});db[_0xb148('0xeb')][_0xb148('0x11b')](db['User'],{'foreignKey':_0xb148('0x1d4'),'as':_0xb148('0x1da')});db[_0xb148('0xeb')][_0xb148('0x11b')](db[_0xb148('0x12f')],{'foreignKey':_0xb148('0x1e0'),'as':_0xb148('0x1d6')});db[_0xb148('0xeb')]['belongsTo'](db[_0xb148('0x56')],{'foreignKey':_0xb148('0x1e1'),'as':_0xb148('0x1d8')});db[_0xb148('0xed')][_0xb148('0x11b')](db[_0xb148('0x52')],{});db[_0xb148('0xed')][_0xb148('0x11b')](db[_0xb148('0x114')],{});db[_0xb148('0xed')][_0xb148('0x11b')](db[_0xb148('0x4d')],{'foreignKey':_0xb148('0x1e2'),'as':_0xb148('0x1d2')});db['SmsTransferReport'][_0xb148('0x11b')](db[_0xb148('0x107')],{'foreignKey':_0xb148('0x1d9'),'as':'FromAgent'});db[_0xb148('0xed')][_0xb148('0x11b')](db[_0xb148('0x107')],{'foreignKey':'ToUserId','as':_0xb148('0x1da')});db['SmsTransferReport']['belongsTo'](db['SmsQueue'],{'foreignKey':_0xb148('0x1e3'),'as':_0xb148('0x1d6')});db['SmsTransferReport'][_0xb148('0x11b')](db[_0xb148('0x4d')],{'foreignKey':_0xb148('0x1e4'),'as':_0xb148('0x1d8')});db[_0xb148('0xef')][_0xb148('0x10c')](db[_0xb148('0x7b')],{'as':_0xb148('0x15d'),'foreignKey':_0xb148('0x162'),'onDelete':_0xb148('0x109')});db[_0xb148('0xef')][_0xb148('0x10c')](db[_0xb148('0x76')],{'as':_0xb148('0x1e5'),'foreignKey':_0xb148('0x162')});db[_0xb148('0xef')][_0xb148('0x10c')](db[_0xb148('0x6e')],{'as':_0xb148('0x120'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x162')});db['CmList'][_0xb148('0x10c')](db['CmHopperFinal'],{'as':_0xb148('0x110'),'foreignKey':_0xb148('0x162')});db[_0xb148('0xef')][_0xb148('0x10c')](db[_0xb148('0x111')],{'as':'HopperHistory','foreignKey':_0xb148('0x162')});db[_0xb148('0xef')][_0xb148('0x10c')](db[_0xb148('0x75')],{'as':_0xb148('0x75'),'foreignKey':'ListId'});db[_0xb148('0xef')][_0xb148('0x11f')](db[_0xb148('0x129')],{'as':_0xb148('0x1e6'),'through':_0xb148('0x14b')});db[_0xb148('0xef')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x14c'),'through':_0xb148('0x121')});db[_0xb148('0xf1')][_0xb148('0x10c')](db[_0xb148('0x17')],{'as':_0xb148('0x10f'),'onDelete':'cascade'});db[_0xb148('0xf1')][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x14c'),'through':_0xb148('0x105')});db[_0xb148('0xf1')][_0xb148('0x11f')](db[_0xb148('0xdb')],{'through':'TeamVoicePrefix','as':_0xb148('0x14d')});db[_0xb148('0xf3')]['hasMany'](db['User'],{'as':_0xb148('0x16e'),'foreignKey':_0xb148('0x11c')});db[_0xb148('0xf3')][_0xb148('0x10c')](db[_0xb148('0xf4')],{'as':_0xb148('0x1e7'),'foreignKey':'userProfileId','onDelete':_0xb148('0x109')});db['UserProfileSection'][_0xb148('0x10c')](db[_0xb148('0x1e8')],{'as':_0xb148('0x1e9'),'foreignKey':_0xb148('0x1ea'),'onDelete':_0xb148('0x109')});db[_0xb148('0xf8')][_0xb148('0x10c')](db[_0xb148('0x7b')],{'as':_0xb148('0x15d'),'foreignKey':'WhatsappAccountId','onDelete':_0xb148('0x109')});db['WhatsappAccount']['hasMany'](db[_0xb148('0x79')],{'as':_0xb148('0x15e'),'foreignKey':_0xb148('0x1eb')});db[_0xb148('0xf8')]['hasMany'](db[_0xb148('0xfc')],{'as':_0xb148('0x150'),'foreignKey':_0xb148('0x1eb')});db[_0xb148('0xf8')]['hasMany'](db[_0xb148('0x117')],{'as':_0xb148('0x15f')});db[_0xb148('0xf8')][_0xb148('0x10c')](db[_0xb148('0xfa')],{'as':'Applications'});db[_0xb148('0xf8')][_0xb148('0x11b')](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db['WhatsappAccount'][_0xb148('0x11b')](db[_0xb148('0x80')],{'as':_0xb148('0x164'),'foreignKey':_0xb148('0x165')});db[_0xb148('0xf8')][_0xb148('0x11f')](db['User'],{'as':_0xb148('0x14c'),'through':_0xb148('0x13d')});db['WhatsappApplication']['belongsTo'](db['User'],{'onDelete':_0xb148('0x15a')});db[_0xb148('0xfa')][_0xb148('0x11b')](db['WhatsappQueue'],{'onDelete':_0xb148('0x15a')});db[_0xb148('0xfa')][_0xb148('0x11b')](db[_0xb148('0xf8')],{'onDelete':_0xb148('0x15a')});db[_0xb148('0xfa')]['belongsTo'](db[_0xb148('0x7e')],{'onDelete':_0xb148('0x15a'),'foreignKey':_0xb148('0x14a')});db[_0xb148('0xfa')][_0xb148('0x11b')](db[_0xb148('0x89')],{'onDelete':_0xb148('0x15a'),'foreignKey':_0xb148('0x177')});db[_0xb148('0x117')][_0xb148('0x10c')](db['WhatsappMessage'],{'as':_0xb148('0x150'),'onDelete':_0xb148('0x109'),'foreignKey':_0xb148('0x1ec')});db[_0xb148('0x117')][_0xb148('0x11b')](db[_0xb148('0xf8')],{'as':'Account','foreignKey':_0xb148('0x1eb')});db[_0xb148('0x117')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db['WhatsappInteraction'][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x16a'),'foreignKey':_0xb148('0x10a')});db['WhatsappInteraction']['belongsToMany'](db[_0xb148('0x89')],{'through':_0xb148('0x1a6'),'as':_0xb148('0x16b')});db[_0xb148('0x117')][_0xb148('0x11f')](db[_0xb148('0x89')],{'through':_0xb148('0x1a6'),'as':_0xb148('0x16d')});db['WhatsappInteraction'][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x16e'),'through':_0xb148('0x1ed'),'foreignKey':'WhatsappInteractionId'});db[_0xb148('0xfc')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x107')});db[_0xb148('0xfc')][_0xb148('0x11b')](db[_0xb148('0x6e')],{'onDelete':_0xb148('0x109'),'as':_0xb148('0x169')});db[_0xb148('0xfc')][_0xb148('0x11b')](db['WhatsappInteraction'],{'onDelete':_0xb148('0x109'),'as':'Interaction','foreignKey':_0xb148('0x1ec')});db[_0xb148('0xfc')][_0xb148('0x11b')](db[_0xb148('0xf8')],{'as':_0xb148('0x168'),'foreignKey':_0xb148('0x1eb')});db['WhatsappQueueReport'][_0xb148('0x11b')](db['WhatsappAccount'],{});db[_0xb148('0xfe')]['belongsTo'](db[_0xb148('0xef')],{'as':_0xb148('0x161'),'foreignKey':_0xb148('0x162')});db['WhatsappQueueReport']['belongsTo'](db[_0xb148('0x6e')],{'as':_0xb148('0x169'),'foreignKey':_0xb148('0x156')});db[_0xb148('0xfe')]['belongsTo'](db[_0xb148('0x117')],{});db[_0xb148('0xfe')][_0xb148('0x11b')](db[_0xb148('0x101')],{});db['WhatsappQueueReport'][_0xb148('0x11b')](db['WhatsappMessage'],{});db[_0xb148('0xfe')]['belongsTo'](db[_0xb148('0x107')],{});db[_0xb148('0xff')][_0xb148('0x11b')](db['WhatsappMessage'],{});db[_0xb148('0xff')][_0xb148('0x11b')](db[_0xb148('0x117')],{});db['WhatsappTransferReport'][_0xb148('0x11b')](db[_0xb148('0xf8')],{'foreignKey':_0xb148('0x1ee'),'as':_0xb148('0x1d2')});db[_0xb148('0xff')][_0xb148('0x11b')](db['WhatsappAccount'],{'foreignKey':_0xb148('0x1ef'),'as':_0xb148('0x1d8')});db[_0xb148('0xff')][_0xb148('0x11b')](db[_0xb148('0x101')],{'foreignKey':_0xb148('0x1f0'),'as':_0xb148('0x1d6')});db[_0xb148('0xff')]['belongsTo'](db[_0xb148('0x107')],{'foreignKey':_0xb148('0x1d9'),'as':_0xb148('0x1d3')});db['WhatsappTransferReport'][_0xb148('0x11b')](db[_0xb148('0x107')],{'foreignKey':_0xb148('0x1d4'),'as':_0xb148('0x1da')});db['WhatsappQueue'][_0xb148('0x11f')](db[_0xb148('0x107')],{'as':_0xb148('0x14c'),'through':_0xb148('0x132'),'foreignKey':'WhatsappQueueId'});db[_0xb148('0x101')][_0xb148('0x11f')](db['Team'],{'through':_0xb148('0x1cc'),'as':_0xb148('0x14d')});db[_0xb148('0x106')][_0xb148('0x11b')](db[_0xb148('0x107')],{'as':_0xb148('0x1f1'),'foreignKey':_0xb148('0x10a'),'onDelete':_0xb148('0x109'),'hooks':!![]});db[_0xb148('0x102')][_0xb148('0x108')](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0xb148('0x15a')});db[_0xb148('0x102')][_0xb148('0x108')](db[_0xb148('0x157')],{'as':_0xb148('0x15b'),'onDelete':_0xb148('0x15a')});db[_0xb148('0x102')][_0xb148('0x108')](db[_0xb148('0x36')],{'as':_0xb148('0x15c'),'onDelete':'restrict'});module[_0xb148('0x1f2')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x5ec0=['Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','BlackLists','voice_queues_has_cm_blacklists','VoiceRecording','mailbox','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','Contact','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Messages','Interactions','List','ListId','Agents','team_has_mail_queues','Teams','MailInteractionId','Account','ContactId','Owner','Tag','mail_interaction_has_tags','Users','ChatWebsiteId','DashboardItem','Items','FaxAccountId','FaxMessage','TagId','FaxInteractionId','fax_interaction_has_tags','Tags','ThroughTags','Interaction','Attachment','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','chat_group_has_users','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','ParentId','MailApplications','FaxApplications','Schedule','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Trigger','TriggerId','Fields','DefaultReportId','MetricId','Configurations','AccountId','SalesforceField','Subjects','Subject','SubjectId','DescriptionId','Field','FieldId','VariableId','Descriptions','Description','DeskAccount','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','ServicenowField','Dynamics365Field','FromId','ToId','SessionId','ProjectId','ChatQueues','SmsQueues','team_has_openchannel_queues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','ChatOfflineMessageId','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailAccountId','ToAccount','FromUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','UserProfileSections','Resources','WhatsappAccountId','WhatsappApplication','whatsapp_interaction_has_tags','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','defaultsDeep','xC@LL1234','utf8mb4','sequelizeHistory','motion2','xcall','127.0.0.1','mysql','name','utf8_general_ci','password','options','database','username','User','import','VoiceContext','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Extensions','CmHopperHistory','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserChatQueue','FaxQueue','FaxQueues','WhatsappQueues','ChatWebsites','FaxAccounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5ec0,0xaf));var _0x05ec=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5ec0[_0x4b369d];return _0x571a98;};'use strict';var config=require(_0x05ec('0x0'));var Sequelize=require(_0x05ec('0x1'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz['determine']();config[_0x05ec('0x1')]=_[_0x05ec('0x2')](config[_0x05ec('0x1')],{'database':'motion2','username':'xcall','password':_0x05ec('0x3'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x05ec('0x4')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x05ec('0x2')](config[_0x05ec('0x5')],{'database':_0x05ec('0x6'),'username':_0x05ec('0x7'),'password':'xC@LL1234','options':{'host':_0x05ec('0x8'),'port':0xcea,'dialect':_0x05ec('0x9'),'dialectOptions':{'charset':_0x05ec('0x4')},'logging':![],'timezone':timezone[_0x05ec('0xa')](),'define':{'charset':'utf8','collate':_0x05ec('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x05ec('0x1')]['database'],config[_0x05ec('0x1')]['username'],config[_0x05ec('0x1')][_0x05ec('0xc')],config[_0x05ec('0x1')][_0x05ec('0xd')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x05ec('0xe')],config[_0x05ec('0x5')][_0x05ec('0xf')],config[_0x05ec('0x5')][_0x05ec('0xc')],config['sequelizeHistory'][_0x05ec('0xd')])};db[_0x05ec('0x10')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/user/user.model');db['VoiceChanSpy']=db['sequelize']['import']('../api/voiceChanSpy/voiceChanSpy.model');db[_0x05ec('0x12')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/voiceContext/voiceContext.model');db[_0x05ec('0x13')]=db[_0x05ec('0x1')]['import']('../api/voiceExtension/voiceExtension.model');db[_0x05ec('0x14')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x15'));db[_0x05ec('0x16')]=db[_0x05ec('0x1')]['import'](_0x05ec('0x17'));db['VoiceRecording']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x18'));db[_0x05ec('0x19')]=db['sequelize'][_0x05ec('0x11')]('../api/screenRecording/screenRecording.model');db[_0x05ec('0x1a')]=db[_0x05ec('0x1')]['import'](_0x05ec('0x1b'));db[_0x05ec('0x1c')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x1d'));db[_0x05ec('0x1e')]=db[_0x05ec('0x1')]['import']('../api/voiceCallReport/voiceCallReport.model');db[_0x05ec('0x1f')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x20'));db[_0x05ec('0x21')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x22'));db['VoiceQueueReport']=db[_0x05ec('0x1')]['import'](_0x05ec('0x23'));db[_0x05ec('0x24')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x25'));db[_0x05ec('0x26')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x27'));db[_0x05ec('0x28')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x29'));db['UserVoiceQueueRt']=db[_0x05ec('0x1')]['import'](_0x05ec('0x2a'));db[_0x05ec('0x2b')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x2c'));db['UserChatQueue']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x2d'));db[_0x05ec('0x2e')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x2f'));db[_0x05ec('0x30')]=db[_0x05ec('0x1')]['import'](_0x05ec('0x31'));db[_0x05ec('0x32')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x33'));db[_0x05ec('0x34')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x35'));db[_0x05ec('0x36')]=db[_0x05ec('0x1')]['import'](_0x05ec('0x37'));db[_0x05ec('0x38')]=db['sequelize']['import']('../api/mailServerIn/mailServerIn.model');db[_0x05ec('0x39')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/mailServerOut/mailServerOut.model');db[_0x05ec('0x3a')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x3b'));db[_0x05ec('0x3c')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x3d'));db[_0x05ec('0x3e')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x3f'));db[_0x05ec('0x40')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x41'));db[_0x05ec('0x42')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x43'));db[_0x05ec('0x44')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x45'));db[_0x05ec('0x46')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x47'));db['DashboardItem']=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/dashboardItem/dashboardItem.model');db[_0x05ec('0x48')]=db['sequelize'][_0x05ec('0x11')]('../api/faxAccount/faxAccount.model');db[_0x05ec('0x49')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x4a'));db[_0x05ec('0x4b')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x4c'));db['FaxMessage']=db[_0x05ec('0x1')]['import'](_0x05ec('0x4d'));db['FaxQueue']=db[_0x05ec('0x1')]['import'](_0x05ec('0x4e'));db['FaxQueueReport']=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/faxQueueReport/faxQueueReport.model');db[_0x05ec('0x4f')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x50'));db[_0x05ec('0x51')]=db[_0x05ec('0x1')]['import']('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x05ec('0x1')]['import']('../api/smsMessage/smsMessage.model');db[_0x05ec('0x52')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x53'));db[_0x05ec('0x54')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/openchannelAccount/openchannelAccount.model');db[_0x05ec('0x55')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x56'));db['OpenchannelInteraction']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x57'));db[_0x05ec('0x58')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x59'));db[_0x05ec('0x5a')]=db['sequelize']['import']('../api/openchannelQueue/openchannelQueue.model');db[_0x05ec('0x5b')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x5c'));db[_0x05ec('0x5d')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x5e'));db[_0x05ec('0x5f')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/chatApplication/chatApplication.model');db[_0x05ec('0x60')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x61'));db[_0x05ec('0x62')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x63'));db[_0x05ec('0x64')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x65'));db[_0x05ec('0x66')]=db[_0x05ec('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x05ec('0x67')]=db['sequelize'][_0x05ec('0x11')]('../api/chatGroup/chatGroup.model');db[_0x05ec('0x68')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db['sequelize']['import'](_0x05ec('0x69'));db[_0x05ec('0x6a')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x6b'));db[_0x05ec('0x6c')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x6d'));db['CmHopperBlack']=db['sequelize']['import'](_0x05ec('0x6e'));db[_0x05ec('0x6f')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x70'));db['CmHopperHistory']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x71'));db[_0x05ec('0x72')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x73'));db['CmCustomField']=db['sequelize']['import'](_0x05ec('0x74'));db['Action']=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x75'));db[_0x05ec('0x76')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x77'));db[_0x05ec('0x78')]=db[_0x05ec('0x1')]['import'](_0x05ec('0x79'));db[_0x05ec('0x7a')]=db[_0x05ec('0x1')]['import'](_0x05ec('0x7b'));db[_0x05ec('0x7c')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x7d'));db[_0x05ec('0x7e')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x7f'));db[_0x05ec('0x80')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/pause/pause.model');db[_0x05ec('0x81')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x82'));db['VoiceQueuesLog']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x83'));db['Schedule']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x84'));db[_0x05ec('0x85')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x86'));db['Tag']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x87'));db[_0x05ec('0x88')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x89'));db['Trigger']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x8a'));db[_0x05ec('0x8b')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x8c'));db[_0x05ec('0x8d')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x8e'));db[_0x05ec('0x8f')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x90'));db[_0x05ec('0x91')]=db[_0x05ec('0x1')]['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x05ec('0x92')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x93'));db[_0x05ec('0x94')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x95'));db[_0x05ec('0x96')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x97'));db[_0x05ec('0x98')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x99'));db['AnalyticTreeReport']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x9a'));db[_0x05ec('0x9b')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x05ec('0x9c')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x9d'));db['SalesforceField']=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x9e'));db[_0x05ec('0x9f')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xa0'));db[_0x05ec('0xa1')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xa2'));db[_0x05ec('0xa3')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xa4'));db['DeskAccount']=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/intDeskAccount/intDeskAccount.model');db[_0x05ec('0xa5')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x05ec('0xa6')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xa7'));db[_0x05ec('0xa8')]=db[_0x05ec('0x1')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x05ec('0xa9')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xaa'));db['ZohoField']=db['sequelize'][_0x05ec('0x11')]('../api/intZohoField/intZohoField.model');db[_0x05ec('0xab')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xac'));db[_0x05ec('0xad')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xae'));db[_0x05ec('0xaf')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/intZendeskField/intZendeskField.model');db[_0x05ec('0xb0')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xb1'));db[_0x05ec('0xb2')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xb3'));db[_0x05ec('0xb4')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xb5'));db[_0x05ec('0xb6')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xb7'));db[_0x05ec('0xb8')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xb9'));db['VtigerField']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xba'));db[_0x05ec('0xbb')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xbc'));db[_0x05ec('0xbd')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xbe'));db['ServicenowField']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xbf'));db[_0x05ec('0xc0')]=db[_0x05ec('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0x05ec('0xc1')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xc2'));db['Dynamics365Field']=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xc3'));db[_0x05ec('0xc4')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xc5'));db[_0x05ec('0xc6')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xc7'));db[_0x05ec('0xc8')]=db['sequelize'][_0x05ec('0x11')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0x05ec('0x1')]['import'](_0x05ec('0x8e'));db[_0x05ec('0xc9')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/network/network.model');db[_0x05ec('0xca')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xcb'));db[_0x05ec('0xcc')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xcd'));db[_0x05ec('0xce')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xcf'));db[_0x05ec('0xd0')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xd1'));db[_0x05ec('0xd2')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xd3'));db[_0x05ec('0xd4')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xd5'));db[_0x05ec('0xd6')]=db['sequelize'][_0x05ec('0x11')]('../api/squareReport/squareReport.model');db[_0x05ec('0xd7')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xd8'));db[_0x05ec('0xd9')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xda'));db[_0x05ec('0xdb')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xdc'));db[_0x05ec('0xdd')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xde'));db[_0x05ec('0xdf')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xe0'));db[_0x05ec('0xe1')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/squareRecording/squareRecording.model');db[_0x05ec('0xe2')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xe3'));db[_0x05ec('0xe4')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xe5'));db['License']=db['sequelize'][_0x05ec('0x11')](_0x05ec('0xe6'));db[_0x05ec('0xe7')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xe8'));db[_0x05ec('0xe9')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xea'));db['Attachment']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xeb'));db[_0x05ec('0xec')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/plugin/plugin.model');db[_0x05ec('0xed')]=db[_0x05ec('0x1')]['import'](_0x05ec('0xee'));db[_0x05ec('0xef')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xf0'));db[_0x05ec('0xf1')]=db['sequelize'][_0x05ec('0x11')]('../api/faxTransferReport/faxTransferReport.model');db[_0x05ec('0xf2')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xf3'));db[_0x05ec('0xf4')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/smsTransferReport/smsTransferReport.model');db[_0x05ec('0xf5')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xf6'));db[_0x05ec('0xf7')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xf8'));db['UserProfile']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xf9'));db[_0x05ec('0xfa')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xfb'));db[_0x05ec('0xfc')]=db['sequelize']['import'](_0x05ec('0xfd'));db['UserNotification']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0xfe'));db[_0x05ec('0xff')]=db[_0x05ec('0x1')]['import'](_0x05ec('0x100'));db['WhatsappApplication']=db[_0x05ec('0x1')]['import'](_0x05ec('0x101'));db[_0x05ec('0x102')]=db[_0x05ec('0x1')][_0x05ec('0x11')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x05ec('0x103')]=db['sequelize']['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x05ec('0x104')]=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x105'));db['WhatsappTransferReport']=db[_0x05ec('0x1')][_0x05ec('0x11')](_0x05ec('0x106'));db[_0x05ec('0x107')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x108'));db[_0x05ec('0x109')]=db[_0x05ec('0x1')]['import']('../api/cloudProvider/cloudProvider.model');db[_0x05ec('0x10a')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x10b'));db['TeamVoicePrefix']=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x10c'));db[_0x05ec('0x10d')]=db[_0x05ec('0x1')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x05ec('0x10e')]=db['sequelize'][_0x05ec('0x11')](_0x05ec('0x10f'));db[_0x05ec('0x10')][_0x05ec('0x110')](db[_0x05ec('0x1a')],{'as':_0x05ec('0x1a'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x112')});db['User']['hasOne'](db[_0x05ec('0x10e')],{'as':_0x05ec('0x113'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0x05ec('0x114')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x05ec('0x112')});db[_0x05ec('0x10')][_0x05ec('0x114')](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':_0x05ec('0x112')});db['User'][_0x05ec('0x114')](db['VoiceExtension'],{'as':_0x05ec('0x115'),'onDelete':_0x05ec('0x111'),'hooks':!![]});db[_0x05ec('0x10')][_0x05ec('0x114')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'UserId'});db['User'][_0x05ec('0x114')](db[_0x05ec('0x116')],{'as':_0x05ec('0x117'),'foreignKey':_0x05ec('0x112')});db[_0x05ec('0x10')][_0x05ec('0x114')](db[_0x05ec('0x72')],{'as':_0x05ec('0x72'),'foreignKey':'UserId'});db['User'][_0x05ec('0x114')](db[_0x05ec('0x118')],{'as':_0x05ec('0x119'),'foreignKey':_0x05ec('0x112')});db[_0x05ec('0x10')][_0x05ec('0x114')](db[_0x05ec('0x60')],{'as':_0x05ec('0x11a'),'foreignKey':_0x05ec('0x112')});db['User'][_0x05ec('0x114')](db[_0x05ec('0x11b')],{'as':_0x05ec('0x11c'),'foreignKey':_0x05ec('0x112')});db[_0x05ec('0x10')][_0x05ec('0x114')](db[_0x05ec('0x4b')],{'as':'FaxInteractions','foreignKey':_0x05ec('0x112')});db[_0x05ec('0x10')][_0x05ec('0x114')](db[_0x05ec('0x3e')],{'as':_0x05ec('0x11d'),'foreignKey':_0x05ec('0x112')});db[_0x05ec('0x10')][_0x05ec('0x114')](db[_0x05ec('0x102')],{'as':_0x05ec('0x11e'),'foreignKey':_0x05ec('0x112')});db['User'][_0x05ec('0x114')](db[_0x05ec('0x11f')],{'as':_0x05ec('0x120'),'foreignKey':_0x05ec('0x121')});db[_0x05ec('0x10')][_0x05ec('0x122')](db['UserProfile'],{'as':_0x05ec('0x123'),'foreignKey':_0x05ec('0x124')});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x67')],{'as':_0x05ec('0x126'),'through':'chat_group_has_users'});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x127'),'through':'cm_user_has_contacts'});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0xf5')],{'as':'Lists','through':_0x05ec('0x128')});db[_0x05ec('0x10')]['belongsToMany'](db[_0x05ec('0xe4')],{'through':_0x05ec('0x129')});db['User'][_0x05ec('0x125')](db['MailInteraction'],{'as':'MailInteractions','through':_0x05ec('0x12a')});db[_0x05ec('0x10')][_0x05ec('0x125')](db['ChatInteraction'],{'as':_0x05ec('0x11a'),'through':_0x05ec('0x12b')});db[_0x05ec('0x10')][_0x05ec('0x125')](db['FaxInteraction'],{'as':_0x05ec('0x12c'),'through':_0x05ec('0x12d')});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x11b')],{'as':'SmsInteractions','through':_0x05ec('0x12e')});db['User'][_0x05ec('0x125')](db[_0x05ec('0x118')],{'as':_0x05ec('0x119'),'through':_0x05ec('0x12f')});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x102')],{'as':_0x05ec('0x11e'),'through':_0x05ec('0x130')});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x16')],{'as':_0x05ec('0x131'),'through':_0x05ec('0x2b'),'required':![]});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0xf7')],{'as':_0x05ec('0x132'),'through':'UserVoicePrefix','required':![]});db[_0x05ec('0x10')]['belongsToMany'](db[_0x05ec('0x3c')],{'as':_0x05ec('0x133'),'through':_0x05ec('0x2e'),'required':![]});db[_0x05ec('0x10')]['belongsToMany'](db[_0x05ec('0x66')],{'as':'ChatQueues','through':_0x05ec('0x134'),'required':![],'hooks':!![]});db['User'][_0x05ec('0x125')](db[_0x05ec('0x135')],{'as':_0x05ec('0x136'),'through':'UserFaxQueue','required':![]});db['User'][_0x05ec('0x125')](db[_0x05ec('0x52')],{'as':'SmsQueues','through':_0x05ec('0x32'),'required':![]});db[_0x05ec('0x10')]['belongsToMany'](db[_0x05ec('0x5a')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x107')],{'as':_0x05ec('0x137'),'through':_0x05ec('0x36'),'required':![]});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0xf5')],{'through':_0x05ec('0x128')});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x5b')],{'as':_0x05ec('0x138'),'through':'user_has_chat_websites'});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x48')],{'as':_0x05ec('0x139'),'through':'user_has_fax_accounts'});db['User'][_0x05ec('0x125')](db[_0x05ec('0x3a')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x54')],{'as':_0x05ec('0x13a'),'through':'user_has_openchannel_accounts'});db[_0x05ec('0x10')][_0x05ec('0x125')](db[_0x05ec('0x4f')],{'as':_0x05ec('0x13b'),'through':_0x05ec('0x13c')});db[_0x05ec('0x10')][_0x05ec('0x125')](db['WhatsappAccount'],{'as':_0x05ec('0x13d'),'through':'user_has_whatsapp_accounts'});db['User'][_0x05ec('0x125')](db[_0x05ec('0xdf')],{'as':_0x05ec('0x13e'),'through':_0x05ec('0x13f')});db[_0x05ec('0x140')]['hasMany'](db[_0x05ec('0x13')],{'as':_0x05ec('0x141'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x142')});db['VoiceContext'][_0x05ec('0x114')](db[_0x05ec('0x13')],{'onDelete':_0x05ec('0x111')});db['VoiceExtension']['hasMany'](db[_0x05ec('0x13')],{'as':_0x05ec('0x143'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0x14')]['belongsToMany'](db['Sound'],{'as':_0x05ec('0x144'),'through':_0x05ec('0x145')});db[_0x05ec('0x16')]['hasMany'](db[_0x05ec('0x146')],{'as':_0x05ec('0x147'),'foreignKey':_0x05ec('0x148')});db[_0x05ec('0x16')][_0x05ec('0x114')](db['CmHopper'],{'as':_0x05ec('0x149'),'foreignKey':_0x05ec('0x148')});db[_0x05ec('0x16')]['hasMany'](db['CmHopperFinal'],{'as':_0x05ec('0x14a'),'foreignKey':_0x05ec('0x148')});db[_0x05ec('0x16')][_0x05ec('0x114')](db['CmHopperHistory'],{'as':_0x05ec('0x14b'),'foreignKey':'VoiceQueueId'});db[_0x05ec('0x16')]['hasMany'](db[_0x05ec('0x72')],{'as':_0x05ec('0x72'),'foreignKey':'VoiceQueueId'});db[_0x05ec('0x16')][_0x05ec('0x114')](db[_0x05ec('0x14c')],{'as':_0x05ec('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x05ec('0x16')][_0x05ec('0x114')](db[_0x05ec('0xd2')],{'as':_0x05ec('0x14e'),'foreignKey':_0x05ec('0x148')});db[_0x05ec('0x16')][_0x05ec('0x122')](db[_0x05ec('0x26')],{'as':'Trunk','foreignKey':_0x05ec('0x14f')});db[_0x05ec('0x16')][_0x05ec('0x122')](db[_0x05ec('0x26')],{'as':_0x05ec('0x150'),'foreignKey':_0x05ec('0x151')});db[_0x05ec('0x16')]['belongsTo'](db[_0x05ec('0x7e')],{'as':_0x05ec('0x7e'),'foreignKey':_0x05ec('0x152')});db[_0x05ec('0x16')][_0x05ec('0x122')](db[_0x05ec('0x80')],{'as':_0x05ec('0x153'),'foreignKey':_0x05ec('0x154')});db[_0x05ec('0x16')]['belongsToMany'](db[_0x05ec('0xf5')],{'as':_0x05ec('0x155'),'through':_0x05ec('0x156')});db[_0x05ec('0x16')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':'Agents','through':_0x05ec('0x2b')});db['VoiceQueue'][_0x05ec('0x125')](db[_0x05ec('0xe4')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0x05ec('0x157'),'through':_0x05ec('0x158')});db[_0x05ec('0x159')][_0x05ec('0x122')](db['User'],{'as':_0x05ec('0x10'),'foreignKey':'UserId'});db[_0x05ec('0x19')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'as':_0x05ec('0x10'),'foreignKey':_0x05ec('0x112')});db['VoiceMail'][_0x05ec('0x114')](db[_0x05ec('0x1c')],{'as':'Messages','onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x05ec('0x15a')});db['VoiceMailMessage'][_0x05ec('0x122')](db[_0x05ec('0x1a')],{'foreignKey':_0x05ec('0x15b'),'targetKey':_0x05ec('0x15a')});db[_0x05ec('0x1e')][_0x05ec('0x114')](db[_0x05ec('0x15c')],{'as':_0x05ec('0x15d'),'foreignKey':_0x05ec('0x15e'),'constraints':![]});db[_0x05ec('0x1e')][_0x05ec('0x114')](db[_0x05ec('0x21')],{'as':'AgentReports','foreignKey':_0x05ec('0x15e'),'constraints':![]});db[_0x05ec('0x1e')]['belongsTo'](db[_0x05ec('0x10')],{'as':_0x05ec('0x10'),'foreignKey':_0x05ec('0x112')});db[_0x05ec('0x1e')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x15f'),'foreignKey':'ContactId'});db[_0x05ec('0x38')]['belongsTo'](db[_0x05ec('0x3a')],{'as':_0x05ec('0x3a'),'foreignKey':_0x05ec('0x160')});db['MailServerIn'][_0x05ec('0x122')](db[_0x05ec('0x109')],{'as':'CloudProvider','foreignKey':_0x05ec('0x161'),'onDelete':'restrict'});db['MailServerOut'][_0x05ec('0x122')](db[_0x05ec('0x3a')],{'as':_0x05ec('0x3a'),'foreignKey':_0x05ec('0x160')});db['MailServerOut'][_0x05ec('0x122')](db[_0x05ec('0x109')],{'as':_0x05ec('0x109'),'foreignKey':_0x05ec('0x161'),'onDelete':_0x05ec('0x162')});db[_0x05ec('0x3a')]['hasOne'](db[_0x05ec('0x38')],{'as':_0x05ec('0x163'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0x3a')]['hasOne'](db['MailServerOut'],{'as':_0x05ec('0x164'),'onDelete':'cascade'});db[_0x05ec('0x3a')][_0x05ec('0x114')](db['Disposition'],{'as':_0x05ec('0x165'),'foreignKey':'MailAccountId','onDelete':_0x05ec('0x111')});db['MailAccount'][_0x05ec('0x114')](db[_0x05ec('0x78')],{'as':_0x05ec('0x166'),'foreignKey':_0x05ec('0x160')});db[_0x05ec('0x3a')]['hasMany'](db[_0x05ec('0x40')],{'as':_0x05ec('0x167'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x05ec('0x114')](db['MailInteraction'],{'as':_0x05ec('0x168')});db[_0x05ec('0x3a')]['hasMany'](db[_0x05ec('0x42')],{'as':_0x05ec('0x143')});db[_0x05ec('0x3a')][_0x05ec('0x122')](db['CmList'],{'as':_0x05ec('0x169'),'foreignKey':_0x05ec('0x16a')});db[_0x05ec('0x3a')][_0x05ec('0x122')](db['Template'],{'as':_0x05ec('0x88'),'foreignKey':'TemplateId'});db['MailAccount']['belongsTo'](db[_0x05ec('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x05ec('0x154')});db[_0x05ec('0x3a')]['belongsToMany'](db[_0x05ec('0x10')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x05ec('0x3c')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':_0x05ec('0x2e')});db['MailQueue']['belongsToMany'](db[_0x05ec('0xe4')],{'through':_0x05ec('0x16c'),'as':_0x05ec('0x16d')});db[_0x05ec('0x3e')][_0x05ec('0x114')](db[_0x05ec('0x40')],{'as':_0x05ec('0x167'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x16e')});db['MailInteraction']['belongsTo'](db[_0x05ec('0x3a')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x160')});db[_0x05ec('0x3e')][_0x05ec('0x122')](db['CmContact'],{'as':'Contact','foreignKey':_0x05ec('0x170')});db[_0x05ec('0x3e')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'as':_0x05ec('0x171'),'foreignKey':_0x05ec('0x112')});db[_0x05ec('0x3e')][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x173'),'as':'Tags'});db['MailInteraction'][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x05ec('0x3e')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x174'),'through':_0x05ec('0x12a'),'foreignKey':_0x05ec('0x16e')});db[_0x05ec('0x40')][_0x05ec('0x114')](db['Attachment'],{'as':'Attachments','onDelete':_0x05ec('0x111')});db[_0x05ec('0x40')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'as':'User'});db[_0x05ec('0x40')][_0x05ec('0x122')](db['CmContact'],{'onDelete':_0x05ec('0x111'),'as':'Contact'});db[_0x05ec('0x40')][_0x05ec('0x122')](db[_0x05ec('0x3e')],{'as':'Interaction','foreignKey':_0x05ec('0x16e')});db['MailMessage'][_0x05ec('0x122')](db[_0x05ec('0x3a')],{'as':'Account','foreignKey':_0x05ec('0x160')});db[_0x05ec('0x40')][_0x05ec('0x122')](db[_0x05ec('0x5b')],{'as':_0x05ec('0x5b'),'foreignKey':_0x05ec('0x175')});db[_0x05ec('0x40')][_0x05ec('0x122')](db['ChatOfflineMessage'],{'as':_0x05ec('0x64'),'foreignKey':'ChatOfflineMessageId'});db[_0x05ec('0x42')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'onDelete':'restrict'});db['MailApplication'][_0x05ec('0x122')](db[_0x05ec('0x3c')],{'onDelete':'restrict'});db['MailApplication'][_0x05ec('0x122')](db[_0x05ec('0x3a')],{'onDelete':_0x05ec('0x162')});db[_0x05ec('0x42')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0x05ec('0x152')});db[_0x05ec('0x42')][_0x05ec('0x122')](db[_0x05ec('0x172')],{'onDelete':_0x05ec('0x162'),'foreignKey':'TagId'});db[_0x05ec('0x44')]['belongsTo'](db['MailAccount'],{});db[_0x05ec('0x44')]['belongsTo'](db[_0x05ec('0xf5')],{'as':_0x05ec('0x169'),'foreignKey':'ListId'});db['MailQueueReport'][_0x05ec('0x122')](db['CmContact'],{'as':'Contact','foreignKey':_0x05ec('0x170')});db['MailQueueReport']['belongsTo'](db[_0x05ec('0x3e')],{});db[_0x05ec('0x44')][_0x05ec('0x122')](db[_0x05ec('0x40')],{});db[_0x05ec('0x44')]['belongsTo'](db[_0x05ec('0x10')],{});db['MailQueueReport'][_0x05ec('0x122')](db['MailQueue'],{});db[_0x05ec('0x46')][_0x05ec('0x114')](db[_0x05ec('0x176')],{'as':_0x05ec('0x177'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0x48')][_0x05ec('0x114')](db[_0x05ec('0x7a')],{'as':_0x05ec('0x165'),'foreignKey':_0x05ec('0x178'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0x48')][_0x05ec('0x114')](db[_0x05ec('0x78')],{'as':_0x05ec('0x166'),'foreignKey':'FaxAccountId'});db[_0x05ec('0x48')][_0x05ec('0x114')](db['FaxInteraction'],{'as':'Interactions'});db['FaxAccount'][_0x05ec('0x114')](db[_0x05ec('0x49')],{'as':_0x05ec('0x143')});db[_0x05ec('0x48')][_0x05ec('0x114')](db[_0x05ec('0x13')],{'as':'Exntensions','onDelete':_0x05ec('0x111')});db[_0x05ec('0x48')]['hasMany'](db[_0x05ec('0x179')],{'as':_0x05ec('0x167')});db[_0x05ec('0x48')][_0x05ec('0x122')](db[_0x05ec('0x26')],{'as':_0x05ec('0x26')});db[_0x05ec('0x48')]['belongsTo'](db[_0x05ec('0xf5')],{'as':_0x05ec('0x169'),'foreignKey':_0x05ec('0x16a')});db[_0x05ec('0x48')][_0x05ec('0x122')](db['Pause'],{'as':_0x05ec('0x153'),'foreignKey':_0x05ec('0x154')});db[_0x05ec('0x48')][_0x05ec('0x125')](db['User'],{'as':_0x05ec('0x16b'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0x05ec('0x122')](db[_0x05ec('0x10')],{'onDelete':_0x05ec('0x162')});db[_0x05ec('0x49')][_0x05ec('0x122')](db[_0x05ec('0x135')],{'onDelete':_0x05ec('0x162')});db[_0x05ec('0x49')][_0x05ec('0x122')](db[_0x05ec('0x48')],{'onDelete':'restrict'});db[_0x05ec('0x49')][_0x05ec('0x122')](db[_0x05ec('0x172')],{'onDelete':_0x05ec('0x162'),'foreignKey':_0x05ec('0x17a')});db['FaxInteraction'][_0x05ec('0x114')](db[_0x05ec('0x179')],{'as':'Messages','onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x17b')});db[_0x05ec('0x4b')]['belongsTo'](db[_0x05ec('0x48')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x178')});db[_0x05ec('0x4b')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x15f'),'foreignKey':'ContactId'});db[_0x05ec('0x4b')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'as':_0x05ec('0x171'),'foreignKey':'UserId'});db[_0x05ec('0x4b')][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x17c'),'as':_0x05ec('0x17d')});db[_0x05ec('0x4b')][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x17c'),'as':_0x05ec('0x17e')});db[_0x05ec('0x4b')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x174'),'through':'user_has_fax_interactions','foreignKey':_0x05ec('0x17b')});db['FaxMessage'][_0x05ec('0x122')](db['User'],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x10')});db[_0x05ec('0x179')][_0x05ec('0x122')](db['FaxInteraction'],{'as':_0x05ec('0x17f'),'foreignKey':_0x05ec('0x17b')});db[_0x05ec('0x179')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'onDelete':'cascade','as':_0x05ec('0x15f')});db[_0x05ec('0x179')]['belongsTo'](db[_0x05ec('0x180')],{'as':_0x05ec('0x180'),'foreignKey':_0x05ec('0x181')});db[_0x05ec('0x179')]['belongsTo'](db[_0x05ec('0x48')],{'as':'Account','foreignKey':_0x05ec('0x178')});db['FaxQueue'][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':_0x05ec('0x30')});db[_0x05ec('0x135')]['belongsToMany'](db[_0x05ec('0xe4')],{'through':_0x05ec('0x182'),'as':'Teams'});db[_0x05ec('0x183')][_0x05ec('0x122')](db[_0x05ec('0x48')],{});db[_0x05ec('0x183')][_0x05ec('0x122')](db[_0x05ec('0xf5')],{'as':_0x05ec('0x169'),'foreignKey':_0x05ec('0x16a')});db[_0x05ec('0x183')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x15f'),'foreignKey':_0x05ec('0x170')});db[_0x05ec('0x183')]['belongsTo'](db[_0x05ec('0x4b')],{});db[_0x05ec('0x183')][_0x05ec('0x122')](db['FaxMessage'],{});db[_0x05ec('0x183')]['belongsTo'](db[_0x05ec('0x10')],{});db['FaxQueueReport']['belongsTo'](db[_0x05ec('0x135')],{});db[_0x05ec('0x4f')][_0x05ec('0x114')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x05ec('0x184'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0x4f')][_0x05ec('0x114')](db['CannedAnswer'],{'as':_0x05ec('0x166'),'foreignKey':_0x05ec('0x184')});db[_0x05ec('0x4f')][_0x05ec('0x114')](db[_0x05ec('0x185')],{'as':_0x05ec('0x167'),'foreignKey':'SmsAccountId'});db[_0x05ec('0x4f')][_0x05ec('0x114')](db[_0x05ec('0x11b')],{'as':_0x05ec('0x168')});db[_0x05ec('0x4f')][_0x05ec('0x114')](db[_0x05ec('0x51')],{'as':'Applications'});db[_0x05ec('0x4f')][_0x05ec('0x122')](db[_0x05ec('0xf5')],{'as':'List','foreignKey':_0x05ec('0x16a')});db['SmsAccount'][_0x05ec('0x122')](db[_0x05ec('0x80')],{'as':_0x05ec('0x153'),'foreignKey':_0x05ec('0x154')});db[_0x05ec('0x4f')]['belongsToMany'](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':'user_has_sms_accounts'});db[_0x05ec('0x51')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'onDelete':_0x05ec('0x162')});db[_0x05ec('0x51')][_0x05ec('0x122')](db[_0x05ec('0x52')],{'onDelete':'restrict'});db[_0x05ec('0x51')][_0x05ec('0x122')](db[_0x05ec('0x4f')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0x05ec('0x7e')],{'onDelete':_0x05ec('0x162'),'foreignKey':_0x05ec('0x152')});db[_0x05ec('0x51')][_0x05ec('0x122')](db['Tag'],{'onDelete':_0x05ec('0x162'),'foreignKey':_0x05ec('0x17a')});db[_0x05ec('0x11b')][_0x05ec('0x114')](db[_0x05ec('0x185')],{'as':_0x05ec('0x167'),'onDelete':_0x05ec('0x111'),'foreignKey':'SmsInteractionId'});db[_0x05ec('0x11b')][_0x05ec('0x122')](db[_0x05ec('0x4f')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x05ec('0x11b')]['belongsTo'](db[_0x05ec('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db[_0x05ec('0x11b')]['belongsTo'](db[_0x05ec('0x10')],{'as':_0x05ec('0x171'),'foreignKey':_0x05ec('0x112')});db[_0x05ec('0x11b')][_0x05ec('0x125')](db['Tag'],{'through':_0x05ec('0x186'),'as':_0x05ec('0x17d')});db[_0x05ec('0x11b')][_0x05ec('0x125')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x05ec('0x17e')});db[_0x05ec('0x11b')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x174'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x05ec('0x185')]['belongsTo'](db[_0x05ec('0x10')],{'as':_0x05ec('0x10')});db[_0x05ec('0x185')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x15f')});db[_0x05ec('0x185')][_0x05ec('0x122')](db['SmsInteraction'],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x17f'),'foreignKey':_0x05ec('0x187')});db[_0x05ec('0x185')]['belongsTo'](db[_0x05ec('0x4f')],{'as':_0x05ec('0x16f'),'foreignKey':'SmsAccountId'});db[_0x05ec('0x52')]['belongsToMany'](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':_0x05ec('0x32'),'foreignKey':_0x05ec('0x188')});db[_0x05ec('0x52')][_0x05ec('0x125')](db[_0x05ec('0xe4')],{'through':_0x05ec('0x189'),'as':'Teams'});db[_0x05ec('0x54')][_0x05ec('0x114')](db['Disposition'],{'as':_0x05ec('0x165'),'foreignKey':_0x05ec('0x18a'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0x54')]['hasMany'](db['CannedAnswer'],{'as':_0x05ec('0x166'),'foreignKey':'OpenchannelAccountId'});db[_0x05ec('0x54')][_0x05ec('0x114')](db[_0x05ec('0x118')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x05ec('0x54')][_0x05ec('0x114')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0x05ec('0x18a')});db[_0x05ec('0x54')]['hasMany'](db[_0x05ec('0x55')],{'as':_0x05ec('0x143'),'foreignKey':_0x05ec('0x18a')});db['OpenchannelAccount'][_0x05ec('0x122')](db['CmList'],{'as':_0x05ec('0x169'),'foreignKey':'ListId'});db[_0x05ec('0x54')][_0x05ec('0x122')](db['Pause'],{'as':_0x05ec('0x153'),'foreignKey':_0x05ec('0x154')});db[_0x05ec('0x54')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':_0x05ec('0x18b')});db[_0x05ec('0x55')]['belongsTo'](db[_0x05ec('0x10')],{'onDelete':_0x05ec('0x162')});db['OpenchannelApplication']['belongsTo'](db[_0x05ec('0x5a')],{'onDelete':_0x05ec('0x162'),'foreignKey':_0x05ec('0x18c')});db[_0x05ec('0x55')][_0x05ec('0x122')](db['OpenchannelAccount'],{'onDelete':_0x05ec('0x162'),'foreignKey':_0x05ec('0x18a')});db[_0x05ec('0x55')]['belongsTo'](db[_0x05ec('0x7e')],{'onDelete':_0x05ec('0x162'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x05ec('0x122')](db[_0x05ec('0x172')],{'onDelete':_0x05ec('0x162'),'foreignKey':_0x05ec('0x17a')});db['OpenchannelInteraction']['hasMany'](db[_0x05ec('0x58')],{'as':_0x05ec('0x167'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x18d')});db[_0x05ec('0x118')][_0x05ec('0x122')](db['OpenchannelAccount'],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x18a')});db[_0x05ec('0x118')][_0x05ec('0x122')](db['CmContact'],{'as':'Contact','foreignKey':_0x05ec('0x170')});db[_0x05ec('0x118')]['belongsTo'](db['User'],{'as':_0x05ec('0x171'),'foreignKey':'UserId'});db[_0x05ec('0x118')][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x18e'),'as':'Tags'});db[_0x05ec('0x118')][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':'openchannel_interaction_has_tags','as':_0x05ec('0x17e')});db[_0x05ec('0x118')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x174'),'through':_0x05ec('0x12f'),'foreignKey':_0x05ec('0x18d')});db['OpenchannelMessage']['belongsTo'](db['User'],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x10')});db[_0x05ec('0x58')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x15f')});db[_0x05ec('0x58')][_0x05ec('0x122')](db[_0x05ec('0x118')],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x17f'),'foreignKey':_0x05ec('0x18d')});db[_0x05ec('0x58')][_0x05ec('0x122')](db[_0x05ec('0x180')],{'as':_0x05ec('0x180'),'foreignKey':_0x05ec('0x181')});db[_0x05ec('0x58')][_0x05ec('0x122')](db[_0x05ec('0x54')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x18a')});db['OpenchannelQueue'][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':'Agents','through':_0x05ec('0x34'),'foreignKey':_0x05ec('0x18c')});db[_0x05ec('0x5a')]['belongsToMany'](db[_0x05ec('0xe4')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x05ec('0x5b')][_0x05ec('0x114')](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x05ec('0x111')});db[_0x05ec('0x5b')]['hasMany'](db[_0x05ec('0x78')],{'as':_0x05ec('0x166'),'foreignKey':'ChatWebsiteId'});db[_0x05ec('0x5b')][_0x05ec('0x114')](db[_0x05ec('0x68')],{'as':_0x05ec('0x18f')});db[_0x05ec('0x5b')][_0x05ec('0x114')](db[_0x05ec('0x60')],{'as':_0x05ec('0x168')});db['ChatWebsite'][_0x05ec('0x114')](db[_0x05ec('0x5f')],{'as':'Applications'});db[_0x05ec('0x5b')][_0x05ec('0x114')](db[_0x05ec('0x62')],{'as':'Messages'});db[_0x05ec('0x5b')][_0x05ec('0x122')](db['CmList'],{'as':_0x05ec('0x169'),'foreignKey':_0x05ec('0x16a')});db[_0x05ec('0x5b')][_0x05ec('0x122')](db[_0x05ec('0x7e')],{'as':_0x05ec('0x7e'),'foreignKey':_0x05ec('0x152')});db[_0x05ec('0x5b')][_0x05ec('0x122')](db[_0x05ec('0x3a')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x05ec('0x5b')][_0x05ec('0x122')](db[_0x05ec('0x80')],{'as':_0x05ec('0x153'),'foreignKey':_0x05ec('0x154')});db[_0x05ec('0x5b')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':'user_has_chat_websites'});db[_0x05ec('0x5d')][_0x05ec('0x122')](db['OpenchannelAccount'],{});db[_0x05ec('0x5d')]['belongsTo'](db[_0x05ec('0xf5')],{'as':'List','foreignKey':_0x05ec('0x16a')});db[_0x05ec('0x5d')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x15f'),'foreignKey':'ContactId'});db[_0x05ec('0x5d')][_0x05ec('0x122')](db[_0x05ec('0x118')],{});db[_0x05ec('0x5d')][_0x05ec('0x122')](db[_0x05ec('0x58')],{});db[_0x05ec('0x5d')][_0x05ec('0x122')](db[_0x05ec('0x10')],{});db['OpenchannelQueueReport'][_0x05ec('0x122')](db['OpenchannelQueue'],{});db[_0x05ec('0x5f')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'as':'Agent','foreignKey':_0x05ec('0x112'),'onDelete':_0x05ec('0x162')});db[_0x05ec('0x5f')][_0x05ec('0x122')](db[_0x05ec('0x66')],{'as':_0x05ec('0x190'),'foreignKey':_0x05ec('0x191'),'onDelete':_0x05ec('0x162')});db[_0x05ec('0x5f')][_0x05ec('0x122')](db['ChatWebsite'],{'as':_0x05ec('0x192'),'foreignKey':'ChatWebsiteId','onDelete':_0x05ec('0x162')});db[_0x05ec('0x5f')][_0x05ec('0x122')](db[_0x05ec('0x172')],{'onDelete':_0x05ec('0x162'),'foreignKey':_0x05ec('0x17a')});db[_0x05ec('0x60')][_0x05ec('0x114')](db[_0x05ec('0x62')],{'as':_0x05ec('0x167'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x193')});db[_0x05ec('0x60')][_0x05ec('0x122')](db[_0x05ec('0x5b')],{'as':_0x05ec('0x16f'),'foreignKey':'ChatWebsiteId'});db[_0x05ec('0x60')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x15f'),'foreignKey':_0x05ec('0x170')});db['ChatInteraction']['belongsTo'](db['User'],{'as':_0x05ec('0x171'),'foreignKey':_0x05ec('0x112')});db['ChatInteraction'][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x194'),'as':'Tags'});db[_0x05ec('0x60')]['belongsToMany'](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x05ec('0x17e')});db[_0x05ec('0x60')]['belongsToMany'](db['User'],{'as':_0x05ec('0x174'),'through':_0x05ec('0x12b'),'foreignKey':_0x05ec('0x193')});db[_0x05ec('0x62')]['belongsTo'](db[_0x05ec('0x10')],{'onDelete':'cascade','as':_0x05ec('0x10')});db[_0x05ec('0x62')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x15f'),'foreignKey':_0x05ec('0x170')});db[_0x05ec('0x62')][_0x05ec('0x122')](db[_0x05ec('0x60')],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x17f'),'foreignKey':_0x05ec('0x193')});db['ChatMessage']['belongsTo'](db[_0x05ec('0x180')],{'as':_0x05ec('0x180'),'foreignKey':'AttachmentId'});db[_0x05ec('0x62')]['belongsTo'](db[_0x05ec('0x5b')],{'as':'Account','foreignKey':_0x05ec('0x175')});db['ChatOfflineMessage'][_0x05ec('0x114')](db['Attachment'],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x05ec('0x111'),'hooks':!![]});db[_0x05ec('0x64')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x15f'),'foreignKey':_0x05ec('0x170')});db[_0x05ec('0x64')]['belongsTo'](db[_0x05ec('0x5b')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x175')});db[_0x05ec('0x66')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':_0x05ec('0x134'),'hooks':!![]});db[_0x05ec('0x66')][_0x05ec('0x125')](db[_0x05ec('0xe4')],{'through':_0x05ec('0x195'),'as':'Teams'});db[_0x05ec('0x67')]['hasMany'](db[_0x05ec('0xcc')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0x05ec('0x111')});db['ChatGroup']['belongsToMany'](db[_0x05ec('0x10')],{'as':_0x05ec('0x147'),'through':_0x05ec('0x196')});db[_0x05ec('0x68')]['belongsTo'](db['ChatWebsite'],{'as':_0x05ec('0x192'),'foreignKey':_0x05ec('0x175')});db['CmCompany'][_0x05ec('0x114')](db[_0x05ec('0x6a')],{'as':'Contacts','foreignKey':_0x05ec('0x197')});db[_0x05ec('0x6a')]['hasMany'](db[_0x05ec('0x6c')],{'as':'Hoppers','foreignKey':_0x05ec('0x170')});db[_0x05ec('0x6a')][_0x05ec('0x114')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x05ec('0x170')});db[_0x05ec('0x6a')]['hasMany'](db[_0x05ec('0x116')],{'as':_0x05ec('0x14b'),'foreignKey':_0x05ec('0x170')});db['CmContact'][_0x05ec('0x114')](db['ReportAgentPreview'],{'as':_0x05ec('0x72'),'foreignKey':'ContactId'});db[_0x05ec('0x6a')]['hasMany'](db[_0x05ec('0xd2')],{'as':_0x05ec('0x14e'),'foreignKey':_0x05ec('0x170')});db[_0x05ec('0x6a')][_0x05ec('0x114')](db[_0x05ec('0x118')],{'as':_0x05ec('0x119'),'foreignKey':_0x05ec('0x170'),'onDelete':_0x05ec('0x162')});db['CmContact'][_0x05ec('0x114')](db[_0x05ec('0x60')],{'as':_0x05ec('0x11a'),'foreignKey':'ContactId','onDelete':_0x05ec('0x162')});db['CmContact']['hasMany'](db[_0x05ec('0x11b')],{'as':_0x05ec('0x11c'),'foreignKey':_0x05ec('0x170'),'onDelete':_0x05ec('0x162')});db['CmContact']['hasMany'](db[_0x05ec('0x4b')],{'as':'FaxInteractions','foreignKey':_0x05ec('0x170'),'onDelete':_0x05ec('0x162')});db[_0x05ec('0x6a')][_0x05ec('0x114')](db[_0x05ec('0x3e')],{'as':_0x05ec('0x11d'),'foreignKey':_0x05ec('0x170'),'onDelete':_0x05ec('0x162')});db['CmContact']['belongsTo'](db['CmCompany'],{'as':'Company','foreignKey':_0x05ec('0x197')});db[_0x05ec('0x6a')][_0x05ec('0x122')](db[_0x05ec('0xf5')],{'as':_0x05ec('0x169'),'foreignKey':'ListId','onDelete':'cascade'});db['CmContact'][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':'Users','through':_0x05ec('0x198')});db[_0x05ec('0x6a')]['belongsToMany'](db[_0x05ec('0x172')],{'as':_0x05ec('0x17d'),'through':_0x05ec('0x199')});db['CmContact'][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x199'),'as':_0x05ec('0x17e')});db['CmHopper'][_0x05ec('0x122')](db['CmContact'],{'as':'Contact','foreignKey':_0x05ec('0x170'),'onDelete':_0x05ec('0x111')});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0x05ec('0x169'),'foreignKey':_0x05ec('0x16a'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0x6c')]['belongsTo'](db[_0x05ec('0x10')],{'as':'Agent','foreignKey':_0x05ec('0x112')});db[_0x05ec('0x6c')]['belongsTo'](db[_0x05ec('0x16')],{'as':_0x05ec('0x190'),'foreignKey':_0x05ec('0x148'),'onDelete':'cascade'});db[_0x05ec('0x6c')]['belongsTo'](db[_0x05ec('0xe7')],{'as':_0x05ec('0xe7'),'foreignKey':_0x05ec('0x19a'),'onDelete':'cascade'});db[_0x05ec('0x6c')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'as':_0x05ec('0x171'),'foreignKey':'OwnerId'});db[_0x05ec('0x14c')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x15f'),'foreignKey':_0x05ec('0x170'),'onDelete':'cascade'});db[_0x05ec('0x14c')]['belongsTo'](db['CmList'],{'as':_0x05ec('0x169'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x05ec('0x14c')][_0x05ec('0x122')](db[_0x05ec('0x16')],{'as':'Queue','foreignKey':_0x05ec('0x148'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x05ec('0xe7')],{'as':_0x05ec('0xe7'),'foreignKey':_0x05ec('0x19a'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0x76')][_0x05ec('0x114')](db[_0x05ec('0x7c')],{'as':{'plural':'All','singular':_0x05ec('0x19b')},'foreignKey':_0x05ec('0x19c'),'onDelete':_0x05ec('0x111'),'hooks':!![]});db['Automation'][_0x05ec('0x114')](db['Condition'],{'as':{'plural':_0x05ec('0x19d'),'singular':_0x05ec('0x19e')},'foreignKey':'AutomationAnyId','onDelete':_0x05ec('0x111'),'hooks':!![]});db[_0x05ec('0x76')][_0x05ec('0x114')](db[_0x05ec('0x19f')],{'as':_0x05ec('0x1a0'),'foreignKey':_0x05ec('0x1a1'),'onDelete':_0x05ec('0x111'),'hooks':!![]});db[_0x05ec('0x7a')][_0x05ec('0x114')](db['Disposition'],{'as':_0x05ec('0x165'),'foreignKey':_0x05ec('0x1a2'),'onDelete':_0x05ec('0x111')});db['Interval']['hasMany'](db[_0x05ec('0x7e')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x05ec('0x111'),'hooks':!![],'required':![]});db[_0x05ec('0x7e')][_0x05ec('0x114')](db[_0x05ec('0x13')],{'as':'Extensions','foreignKey':_0x05ec('0x152'),'onDelete':_0x05ec('0x162')});db[_0x05ec('0x7e')]['hasMany'](db[_0x05ec('0x42')],{'as':_0x05ec('0x1a3'),'foreignKey':_0x05ec('0x152')});db[_0x05ec('0x7e')][_0x05ec('0x114')](db[_0x05ec('0x5f')],{'as':'ChatApplications','foreignKey':_0x05ec('0x152')});db['Interval'][_0x05ec('0x114')](db[_0x05ec('0x49')],{'as':_0x05ec('0x1a4'),'foreignKey':_0x05ec('0x152')});db[_0x05ec('0x7e')][_0x05ec('0x114')](db[_0x05ec('0x51')],{'as':'SmsApplications','foreignKey':_0x05ec('0x152')});db[_0x05ec('0x1a5')]['belongsTo'](db['MailAccount'],{});db[_0x05ec('0x1a5')]['belongsTo'](db[_0x05ec('0x92')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0x05ec('0x122')](db['AnalyticCustomReport'],{'foreignKey':_0x05ec('0x1a6')});db[_0x05ec('0x85')][_0x05ec('0x125')](db[_0x05ec('0x14')],{'as':_0x05ec('0x1a7'),'through':_0x05ec('0x145'),'onDelete':_0x05ec('0x162')});db[_0x05ec('0x172')]['belongsToMany'](db[_0x05ec('0x6a')],{'through':_0x05ec('0x199')});db['Tag'][_0x05ec('0x125')](db[_0x05ec('0x60')],{'through':_0x05ec('0x194')});db[_0x05ec('0x172')]['belongsToMany'](db[_0x05ec('0x3e')],{'through':_0x05ec('0x173')});db[_0x05ec('0x172')][_0x05ec('0x125')](db[_0x05ec('0x11b')],{'through':_0x05ec('0x186')});db[_0x05ec('0x172')]['belongsToMany'](db[_0x05ec('0x4b')],{'through':'fax_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x05ec('0x118')],{'through':_0x05ec('0x18e')});db[_0x05ec('0x172')]['belongsToMany'](db[_0x05ec('0x102')],{'through':'whatsapp_interaction_has_tags'});db['Trigger']['hasMany'](db[_0x05ec('0x7c')],{'as':{'plural':_0x05ec('0x1a8'),'singular':_0x05ec('0x1a9')},'foreignKey':_0x05ec('0x1aa'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x05ec('0x114')](db[_0x05ec('0x7c')],{'as':{'plural':_0x05ec('0x1ab'),'singular':'AnyCondition'},'foreignKey':_0x05ec('0x1ac'),'onDelete':_0x05ec('0x111'),'hooks':!![]});db[_0x05ec('0x1ad')][_0x05ec('0x114')](db[_0x05ec('0x19f')],{'as':_0x05ec('0x1a0'),'foreignKey':_0x05ec('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0x05ec('0x91')]['hasMany'](db[_0x05ec('0x98')],{'as':_0x05ec('0x1af'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1a6'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x05ec('0x98')],{'as':_0x05ec('0x1af'),'onDelete':'cascade','foreignKey':_0x05ec('0x1b0')});db['AnalyticMetric'][_0x05ec('0x114')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x05ec('0x111'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x05ec('0x122')](db[_0x05ec('0x96')],{'foreignKey':_0x05ec('0x1b1')});db[_0x05ec('0x9b')][_0x05ec('0x114')](db[_0x05ec('0x9c')],{'as':_0x05ec('0x1b2'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b3')});db['SalesforceConfiguration'][_0x05ec('0x114')](db[_0x05ec('0x1b4')],{'as':_0x05ec('0x1b5'),'onDelete':_0x05ec('0x111'),'foreignKey':'SubjectId'});db[_0x05ec('0x9c')][_0x05ec('0x114')](db[_0x05ec('0x1b4')],{'as':'Descriptions','onDelete':_0x05ec('0x111'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0x05ec('0x114')](db[_0x05ec('0x1b4')],{'as':'Fields','onDelete':_0x05ec('0x111'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x05ec('0x122')](db[_0x05ec('0x9b')],{'as':'Account','foreignKey':_0x05ec('0x1b3')});db[_0x05ec('0x1b4')][_0x05ec('0x114')](db['SalesforceField'],{'as':_0x05ec('0x1b6'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0x1b4')][_0x05ec('0x114')](db['SalesforceField'],{'as':'Description','foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0x1b4')][_0x05ec('0x114')](db['SalesforceField'],{'as':_0x05ec('0x1b9'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0x1b4')][_0x05ec('0x122')](db[_0x05ec('0x8b')],{'as':_0x05ec('0x8b'),'foreignKey':_0x05ec('0x1bb')});db[_0x05ec('0x9f')][_0x05ec('0x114')](db[_0x05ec('0xa1')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x05ec('0xa1')][_0x05ec('0x114')](db['SugarcrmField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['SugarcrmConfiguration'][_0x05ec('0x114')](db[_0x05ec('0xa3')],{'as':_0x05ec('0x1bc'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xa1')][_0x05ec('0x114')](db[_0x05ec('0xa3')],{'as':_0x05ec('0x1af'),'onDelete':_0x05ec('0x111'),'foreignKey':'FieldId'});db[_0x05ec('0xa1')][_0x05ec('0x122')](db[_0x05ec('0x9f')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x1b3')});db[_0x05ec('0xa3')][_0x05ec('0x114')](db[_0x05ec('0xa3')],{'as':_0x05ec('0x1b6'),'foreignKey':'SubjectId'});db[_0x05ec('0xa3')]['hasMany'](db['SugarcrmField'],{'as':_0x05ec('0x1bd'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xa3')]['hasMany'](db[_0x05ec('0xa3')],{'as':'Field','foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0xa3')]['belongsTo'](db[_0x05ec('0x8b')],{'as':_0x05ec('0x8b'),'foreignKey':_0x05ec('0x1bb')});db[_0x05ec('0x1be')][_0x05ec('0x114')](db[_0x05ec('0xa5')],{'as':_0x05ec('0x1b2'),'onDelete':'cascade','foreignKey':_0x05ec('0x1b3')});db[_0x05ec('0xa5')]['hasMany'](db['DeskField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x05ec('0x1b7')});db['DeskConfiguration'][_0x05ec('0x114')](db[_0x05ec('0xa6')],{'as':_0x05ec('0x1bc'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b8')});db['DeskConfiguration'][_0x05ec('0x114')](db[_0x05ec('0xa6')],{'as':_0x05ec('0x1af'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0xa5')][_0x05ec('0x122')](db[_0x05ec('0x1be')],{'as':'Account','foreignKey':'AccountId'});db[_0x05ec('0xa5')][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x1bf')});db[_0x05ec('0xa6')]['hasMany'](db[_0x05ec('0xa6')],{'as':_0x05ec('0x1b6'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0xa6')]['hasMany'](db[_0x05ec('0xa6')],{'as':_0x05ec('0x1bd'),'foreignKey':_0x05ec('0x1b8')});db['DeskField'][_0x05ec('0x114')](db[_0x05ec('0xa6')],{'as':_0x05ec('0x1b9'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0xa6')][_0x05ec('0x122')](db['Variable'],{'as':_0x05ec('0x8b'),'foreignKey':_0x05ec('0x1bb')});db[_0x05ec('0xa8')]['hasMany'](db[_0x05ec('0xa9')],{'as':_0x05ec('0x1b2'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b3')});db['ZohoConfiguration']['hasMany'](db[_0x05ec('0x1c0')],{'as':_0x05ec('0x1b5'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b7')});db['ZohoConfiguration'][_0x05ec('0x114')](db['ZohoField'],{'as':_0x05ec('0x1bc'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xa9')]['hasMany'](db['ZohoField'],{'as':_0x05ec('0x1af'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1ba')});db['ZohoConfiguration']['belongsTo'](db[_0x05ec('0xa8')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x1b3')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x05ec('0x1c0')][_0x05ec('0x114')](db[_0x05ec('0x1c0')],{'as':_0x05ec('0x1bd'),'foreignKey':'DescriptionId'});db['ZohoField']['hasMany'](db[_0x05ec('0x1c0')],{'as':'Field','foreignKey':'FieldId'});db['ZohoField'][_0x05ec('0x122')](db[_0x05ec('0x8b')],{'as':_0x05ec('0x8b'),'foreignKey':'VariableId'});db[_0x05ec('0xab')]['hasMany'](db[_0x05ec('0xad')],{'as':_0x05ec('0x1b2'),'onDelete':'cascade','foreignKey':_0x05ec('0x1b3')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x05ec('0x1b5'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0xad')][_0x05ec('0x114')](db[_0x05ec('0xaf')],{'as':_0x05ec('0x1bc'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xad')][_0x05ec('0x114')](db[_0x05ec('0xaf')],{'as':_0x05ec('0x1af'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0xad')]['belongsTo'](db[_0x05ec('0xab')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x1b3')});db['ZendeskConfiguration'][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x1c1')});db[_0x05ec('0xaf')][_0x05ec('0x114')](db[_0x05ec('0xaf')],{'as':_0x05ec('0x1b6'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0xaf')]['hasMany'](db['ZendeskField'],{'as':_0x05ec('0x1bd'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xaf')][_0x05ec('0x114')](db['ZendeskField'],{'as':_0x05ec('0x1b9'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0xaf')][_0x05ec('0x122')](db['Variable'],{'as':_0x05ec('0x8b'),'foreignKey':_0x05ec('0x1bb')});db[_0x05ec('0xb0')][_0x05ec('0x114')](db['FreshdeskConfiguration'],{'as':_0x05ec('0x1b2'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b3')});db['FreshdeskConfiguration'][_0x05ec('0x114')](db[_0x05ec('0xb4')],{'as':_0x05ec('0x1b5'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0xb2')][_0x05ec('0x114')](db[_0x05ec('0xb4')],{'as':_0x05ec('0x1bc'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0x05ec('0x114')](db['FreshdeskField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x05ec('0x1ba')});db['FreshdeskConfiguration']['belongsTo'](db[_0x05ec('0xb0')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x1b3')});db[_0x05ec('0xb2')][_0x05ec('0x125')](db[_0x05ec('0x172')],{'through':_0x05ec('0x1c2')});db[_0x05ec('0xb4')][_0x05ec('0x114')](db[_0x05ec('0xb4')],{'as':_0x05ec('0x1b6'),'foreignKey':'SubjectId'});db[_0x05ec('0xb4')][_0x05ec('0x114')](db[_0x05ec('0xb4')],{'as':'Description','foreignKey':_0x05ec('0x1b8')});db['FreshdeskField'][_0x05ec('0x114')](db[_0x05ec('0xb4')],{'as':_0x05ec('0x1b9'),'foreignKey':_0x05ec('0x1ba')});db['FreshdeskField'][_0x05ec('0x122')](db[_0x05ec('0x8b')],{'as':_0x05ec('0x8b'),'foreignKey':_0x05ec('0x1bb')});db[_0x05ec('0xb6')][_0x05ec('0x114')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x05ec('0x1b3')});db[_0x05ec('0xb8')]['hasMany'](db[_0x05ec('0x1c3')],{'as':_0x05ec('0x1b5'),'foreignKey':'SubjectId'});db[_0x05ec('0xb8')][_0x05ec('0x114')](db[_0x05ec('0x1c3')],{'as':_0x05ec('0x1bc'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xb8')]['hasMany'](db[_0x05ec('0x1c3')],{'as':_0x05ec('0x1af'),'foreignKey':_0x05ec('0x1ba')});db['VtigerConfiguration'][_0x05ec('0x122')](db['VtigerAccount'],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x1b3')});db[_0x05ec('0x1c3')][_0x05ec('0x114')](db[_0x05ec('0x1c3')],{'as':_0x05ec('0x1b6'),'foreignKey':'SubjectId'});db[_0x05ec('0x1c3')][_0x05ec('0x114')](db[_0x05ec('0x1c3')],{'as':_0x05ec('0x1bd'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0x1c3')][_0x05ec('0x114')](db[_0x05ec('0x1c3')],{'as':_0x05ec('0x1b9'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0x1c3')][_0x05ec('0x122')](db[_0x05ec('0x8b')],{'as':_0x05ec('0x8b'),'foreignKey':_0x05ec('0x1bb')});db[_0x05ec('0xbb')][_0x05ec('0x114')](db[_0x05ec('0xbd')],{'as':_0x05ec('0x1b2'),'onDelete':_0x05ec('0x111'),'foreignKey':'AccountId'});db[_0x05ec('0xbd')]['hasMany'](db['ServicenowField'],{'as':'Subjects','foreignKey':_0x05ec('0x1b7')});db['ServicenowConfiguration'][_0x05ec('0x114')](db['ServicenowField'],{'as':_0x05ec('0x1bc'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xbd')][_0x05ec('0x114')](db[_0x05ec('0x1c4')],{'as':'Fields','foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0xbd')][_0x05ec('0x122')](db['ServicenowAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x05ec('0x1c4')][_0x05ec('0x114')](db[_0x05ec('0x1c4')],{'as':_0x05ec('0x1b6'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0x1c4')]['hasMany'](db[_0x05ec('0x1c4')],{'as':_0x05ec('0x1bd'),'foreignKey':'DescriptionId'});db[_0x05ec('0x1c4')][_0x05ec('0x114')](db[_0x05ec('0x1c4')],{'as':_0x05ec('0x1b9'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0x1c4')]['belongsTo'](db[_0x05ec('0x8b')],{'as':_0x05ec('0x8b'),'foreignKey':_0x05ec('0x1bb')});db[_0x05ec('0xc0')][_0x05ec('0x114')](db[_0x05ec('0xc1')],{'as':_0x05ec('0x1b2'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b3')});db[_0x05ec('0xc0')][_0x05ec('0x122')](db[_0x05ec('0x109')],{'as':_0x05ec('0x109'),'foreignKey':_0x05ec('0x161')});db[_0x05ec('0xc1')][_0x05ec('0x114')](db[_0x05ec('0x1c5')],{'as':'Subjects','onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0xc1')]['hasMany'](db[_0x05ec('0x1c5')],{'as':'Descriptions','onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xc1')][_0x05ec('0x114')](db[_0x05ec('0x1c5')],{'as':_0x05ec('0x1af'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0xc1')][_0x05ec('0x122')](db[_0x05ec('0xc0')],{'as':_0x05ec('0x16f'),'foreignKey':'AccountId'});db[_0x05ec('0x1c5')][_0x05ec('0x114')](db['Dynamics365Field'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x05ec('0x1c5')][_0x05ec('0x114')](db[_0x05ec('0x1c5')],{'as':'Description','foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0x1c5')][_0x05ec('0x114')](db[_0x05ec('0x1c5')],{'as':_0x05ec('0x1b9'),'foreignKey':_0x05ec('0x1ba')});db['Dynamics365Field'][_0x05ec('0x122')](db[_0x05ec('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db[_0x05ec('0xc4')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x05ec('0x1b2'),'onDelete':_0x05ec('0x111'),'foreignKey':'AccountId'});db[_0x05ec('0xc6')][_0x05ec('0x114')](db[_0x05ec('0xc8')],{'as':_0x05ec('0x1b5'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0xc6')][_0x05ec('0x114')](db['FreshsalesField'],{'as':_0x05ec('0x1bc'),'foreignKey':_0x05ec('0x1b8')});db[_0x05ec('0xc6')][_0x05ec('0x114')](db[_0x05ec('0xc8')],{'as':_0x05ec('0x1af'),'foreignKey':_0x05ec('0x1ba')});db[_0x05ec('0xc6')]['belongsTo'](db[_0x05ec('0xc4')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x1b3')});db[_0x05ec('0xc8')][_0x05ec('0x114')](db[_0x05ec('0xc8')],{'as':_0x05ec('0x1b6'),'foreignKey':_0x05ec('0x1b7')});db[_0x05ec('0xc8')][_0x05ec('0x114')](db['FreshsalesField'],{'as':_0x05ec('0x1bd'),'foreignKey':'DescriptionId'});db[_0x05ec('0xc8')]['hasMany'](db[_0x05ec('0xc8')],{'as':_0x05ec('0x1b9'),'foreignKey':_0x05ec('0x1ba')});db['FreshsalesField'][_0x05ec('0x122')](db[_0x05ec('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db[_0x05ec('0xca')][_0x05ec('0x122')](db[_0x05ec('0x5b')],{});db[_0x05ec('0xca')][_0x05ec('0x122')](db['CmList'],{'as':'List','foreignKey':_0x05ec('0x16a')});db[_0x05ec('0xca')]['belongsTo'](db[_0x05ec('0x6a')],{'as':'Contact','foreignKey':_0x05ec('0x170')});db[_0x05ec('0xca')][_0x05ec('0x122')](db[_0x05ec('0x60')],{});db[_0x05ec('0xca')][_0x05ec('0x122')](db['ChatMessage'],{});db[_0x05ec('0xca')][_0x05ec('0x122')](db['User'],{});db[_0x05ec('0xca')][_0x05ec('0x122')](db[_0x05ec('0x66')],{});db[_0x05ec('0xcc')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'onDelete':'cascade','foreignKey':_0x05ec('0x1c6')});db['ChatInternalMessage'][_0x05ec('0x122')](db[_0x05ec('0x10')],{'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x1c7')});db[_0x05ec('0xd2')][_0x05ec('0x114')](db[_0x05ec('0xd0')],{'foreignKey':'SessionId','onDelete':_0x05ec('0x111')});db[_0x05ec('0xd2')][_0x05ec('0x114')](db[_0x05ec('0xce')],{'foreignKey':_0x05ec('0x1c8'),'onDelete':_0x05ec('0x111')});db['SmsQueueReport'][_0x05ec('0x122')](db[_0x05ec('0x4f')],{});db[_0x05ec('0xd4')]['belongsTo'](db[_0x05ec('0xf5')],{'as':_0x05ec('0x169'),'foreignKey':_0x05ec('0x16a')});db[_0x05ec('0xd4')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x15f'),'foreignKey':_0x05ec('0x170')});db[_0x05ec('0xd4')]['belongsTo'](db[_0x05ec('0x11b')],{});db[_0x05ec('0xd4')][_0x05ec('0x122')](db[_0x05ec('0x185')],{});db[_0x05ec('0xd4')][_0x05ec('0x122')](db[_0x05ec('0x10')],{});db['SmsQueueReport'][_0x05ec('0x122')](db['SmsQueue'],{});db['JscriptyProject'][_0x05ec('0x114')](db[_0x05ec('0xd2')],{'foreignKey':_0x05ec('0x1c9')});db['JscriptyProject'][_0x05ec('0x114')](db[_0x05ec('0xd0')],{'foreignKey':_0x05ec('0x1c9')});db[_0x05ec('0xd9')][_0x05ec('0x114')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db['SquareProject'][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x174'),'through':_0x05ec('0x13f')});db['Team'][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':'Agents','through':_0x05ec('0x129')});db[_0x05ec('0xe4')][_0x05ec('0x125')](db[_0x05ec('0x16')],{'through':_0x05ec('0x10a'),'as':_0x05ec('0x131')});db[_0x05ec('0xe4')][_0x05ec('0x125')](db[_0x05ec('0x3c')],{'through':_0x05ec('0x16c'),'as':_0x05ec('0x133')});db[_0x05ec('0xe4')][_0x05ec('0x125')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x05ec('0x1ca')});db[_0x05ec('0xe4')][_0x05ec('0x125')](db[_0x05ec('0x135')],{'through':_0x05ec('0x182'),'as':'FaxQueues'});db[_0x05ec('0xe4')][_0x05ec('0x125')](db['SmsQueue'],{'through':_0x05ec('0x189'),'as':_0x05ec('0x1cb')});db[_0x05ec('0xe4')][_0x05ec('0x125')](db['OpenchannelQueue'],{'through':_0x05ec('0x1cc'),'as':_0x05ec('0x1cd')});db[_0x05ec('0xe4')]['belongsToMany'](db[_0x05ec('0x107')],{'through':_0x05ec('0x1ce'),'as':_0x05ec('0x137')});db[_0x05ec('0xe4')]['belongsToMany'](db[_0x05ec('0xf7')],{'through':_0x05ec('0x1cf'),'as':'VoicePrefixes'});db[_0x05ec('0xe7')][_0x05ec('0x114')](db['CmHopper'],{'as':_0x05ec('0x149'),'foreignKey':_0x05ec('0x19a')});db[_0x05ec('0xe7')][_0x05ec('0x114')](db['CmHopperFinal'],{'as':_0x05ec('0x14a'),'foreignKey':_0x05ec('0x19a')});db[_0x05ec('0xe7')]['hasMany'](db[_0x05ec('0x116')],{'as':_0x05ec('0x14b'),'foreignKey':_0x05ec('0x19a')});db['Campaign'][_0x05ec('0x114')](db[_0x05ec('0x14c')],{'as':_0x05ec('0x14d'),'foreignKey':_0x05ec('0x19a')});db[_0x05ec('0xe7')][_0x05ec('0x122')](db[_0x05ec('0x26')],{'as':_0x05ec('0x26'),'foreignKey':_0x05ec('0x14f')});db['Campaign'][_0x05ec('0x122')](db[_0x05ec('0x26')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x05ec('0xe7')]['belongsTo'](db['Interval'],{'as':_0x05ec('0x7e'),'foreignKey':_0x05ec('0x152')});db[_0x05ec('0xe7')][_0x05ec('0x122')](db[_0x05ec('0xdf')],{'as':'SquareProject','foreignKey':_0x05ec('0x1d0')});db[_0x05ec('0xe7')][_0x05ec('0x125')](db[_0x05ec('0xf5')],{'as':_0x05ec('0x155'),'through':_0x05ec('0x1d1')});db[_0x05ec('0xe7')][_0x05ec('0x125')](db[_0x05ec('0xf5')],{'as':_0x05ec('0x157'),'through':_0x05ec('0x1d2')});db['Attachment']['belongsTo'](db[_0x05ec('0x64')],{'as':'ChatOfflineMessage','foreignKey':_0x05ec('0x1d3')});db[_0x05ec('0xed')][_0x05ec('0x122')](db[_0x05ec('0x40')],{});db['MailTransferReport']['belongsTo'](db[_0x05ec('0x3e')],{});db[_0x05ec('0xed')][_0x05ec('0x122')](db[_0x05ec('0x3a')],{'foreignKey':_0x05ec('0x1d4'),'as':_0x05ec('0x1d5')});db[_0x05ec('0xed')]['belongsTo'](db[_0x05ec('0x10')],{'foreignKey':'FromUserId','as':_0x05ec('0x1d6')});db[_0x05ec('0xed')][_0x05ec('0x122')](db['User'],{'foreignKey':'ToUserId','as':_0x05ec('0x1d7')});db[_0x05ec('0xed')][_0x05ec('0x122')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x05ec('0xed')][_0x05ec('0x122')](db['MailAccount'],{'foreignKey':_0x05ec('0x1d8'),'as':_0x05ec('0x1d9')});db[_0x05ec('0xef')][_0x05ec('0x122')](db[_0x05ec('0x62')],{});db[_0x05ec('0xef')][_0x05ec('0x122')](db[_0x05ec('0x60')],{});db[_0x05ec('0xef')][_0x05ec('0x122')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x05ec('0x1d5')});db[_0x05ec('0xef')]['belongsTo'](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1da'),'as':_0x05ec('0x1d6')});db[_0x05ec('0xef')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x05ec('0x1d7')});db[_0x05ec('0xef')][_0x05ec('0x122')](db[_0x05ec('0x66')],{'foreignKey':_0x05ec('0x1db'),'as':_0x05ec('0x1dc')});db[_0x05ec('0xef')][_0x05ec('0x122')](db[_0x05ec('0x5b')],{'foreignKey':_0x05ec('0x1dd'),'as':_0x05ec('0x1d9')});db[_0x05ec('0xf1')][_0x05ec('0x122')](db[_0x05ec('0x179')],{});db[_0x05ec('0xf1')][_0x05ec('0x122')](db[_0x05ec('0x4b')],{});db[_0x05ec('0xf1')]['belongsTo'](db[_0x05ec('0x48')],{'foreignKey':_0x05ec('0x1de'),'as':_0x05ec('0x1d5')});db['FaxTransferReport']['belongsTo'](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1da'),'as':_0x05ec('0x1d6')});db[_0x05ec('0xf1')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1df'),'as':'ToAgent'});db[_0x05ec('0xf1')][_0x05ec('0x122')](db[_0x05ec('0x135')],{'foreignKey':_0x05ec('0x1e0'),'as':_0x05ec('0x1dc')});db[_0x05ec('0xf1')][_0x05ec('0x122')](db['FaxAccount'],{'foreignKey':_0x05ec('0x1e1'),'as':_0x05ec('0x1d9')});db['OpenchannelTransferReport'][_0x05ec('0x122')](db['OpenchannelMessage'],{});db[_0x05ec('0xf2')][_0x05ec('0x122')](db[_0x05ec('0x118')],{});db['OpenchannelTransferReport'][_0x05ec('0x122')](db[_0x05ec('0x54')],{'foreignKey':'FromOpenchannelAccountId','as':_0x05ec('0x1d5')});db[_0x05ec('0xf2')]['belongsTo'](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1da'),'as':_0x05ec('0x1d6')});db['OpenchannelTransferReport'][_0x05ec('0x122')](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1df'),'as':_0x05ec('0x1d7')});db['OpenchannelTransferReport'][_0x05ec('0x122')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':_0x05ec('0x1dc')});db[_0x05ec('0xf2')]['belongsTo'](db[_0x05ec('0x54')],{'foreignKey':_0x05ec('0x1e2'),'as':_0x05ec('0x1d9')});db['SmsTransferReport'][_0x05ec('0x122')](db[_0x05ec('0x185')],{});db['SmsTransferReport']['belongsTo'](db[_0x05ec('0x11b')],{});db[_0x05ec('0xf4')][_0x05ec('0x122')](db[_0x05ec('0x4f')],{'foreignKey':_0x05ec('0x1e3'),'as':_0x05ec('0x1d5')});db[_0x05ec('0xf4')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1da'),'as':_0x05ec('0x1d6')});db['SmsTransferReport'][_0x05ec('0x122')](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1df'),'as':_0x05ec('0x1d7')});db['SmsTransferReport'][_0x05ec('0x122')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x05ec('0xf4')][_0x05ec('0x122')](db[_0x05ec('0x4f')],{'foreignKey':_0x05ec('0x1e4'),'as':_0x05ec('0x1d9')});db['CmList'][_0x05ec('0x114')](db[_0x05ec('0x7a')],{'as':'Dispositions','foreignKey':_0x05ec('0x16a'),'onDelete':'cascade'});db[_0x05ec('0xf5')][_0x05ec('0x114')](db[_0x05ec('0x1e5')],{'as':'CustomFields','foreignKey':'ListId'});db[_0x05ec('0xf5')]['hasMany'](db[_0x05ec('0x6a')],{'as':_0x05ec('0x127'),'onDelete':_0x05ec('0x111'),'foreignKey':_0x05ec('0x16a')});db[_0x05ec('0xf5')][_0x05ec('0x114')](db[_0x05ec('0x6f')],{'as':'HopperFinals','foreignKey':_0x05ec('0x16a')});db['CmList']['hasMany'](db[_0x05ec('0x116')],{'as':_0x05ec('0x117'),'foreignKey':_0x05ec('0x16a')});db[_0x05ec('0xf5')][_0x05ec('0x114')](db[_0x05ec('0x72')],{'as':_0x05ec('0x72'),'foreignKey':_0x05ec('0x16a')});db[_0x05ec('0xf5')][_0x05ec('0x125')](db[_0x05ec('0x16')],{'as':'Queues','through':_0x05ec('0x156')});db['CmList']['belongsToMany'](db['User'],{'as':_0x05ec('0x16b'),'through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x05ec('0x13')],{'as':_0x05ec('0x115'),'onDelete':_0x05ec('0x111')});db[_0x05ec('0xf7')][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':_0x05ec('0x10d')});db[_0x05ec('0xf7')]['belongsToMany'](db[_0x05ec('0xe4')],{'through':_0x05ec('0x1cf'),'as':_0x05ec('0x16d')});db[_0x05ec('0x123')][_0x05ec('0x114')](db[_0x05ec('0x10')],{'as':'Users','foreignKey':_0x05ec('0x124')});db[_0x05ec('0x123')][_0x05ec('0x114')](db[_0x05ec('0xfa')],{'as':_0x05ec('0x1e6'),'foreignKey':'userProfileId','onDelete':_0x05ec('0x111')});db['UserProfileSection']['hasMany'](db[_0x05ec('0xfc')],{'as':_0x05ec('0x1e7'),'foreignKey':'sectionId','onDelete':_0x05ec('0x111')});db[_0x05ec('0xff')][_0x05ec('0x114')](db[_0x05ec('0x7a')],{'as':_0x05ec('0x165'),'foreignKey':_0x05ec('0x1e8'),'onDelete':'cascade'});db[_0x05ec('0xff')][_0x05ec('0x114')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x05ec('0x1e8')});db[_0x05ec('0xff')]['hasMany'](db['WhatsappMessage'],{'as':_0x05ec('0x167'),'foreignKey':_0x05ec('0x1e8')});db['WhatsappAccount']['hasMany'](db[_0x05ec('0x102')],{'as':_0x05ec('0x168')});db['WhatsappAccount'][_0x05ec('0x114')](db['WhatsappApplication'],{'as':_0x05ec('0x143')});db[_0x05ec('0xff')][_0x05ec('0x122')](db[_0x05ec('0xf5')],{'as':_0x05ec('0x169'),'foreignKey':_0x05ec('0x16a')});db['WhatsappAccount'][_0x05ec('0x122')](db['Pause'],{'as':_0x05ec('0x153'),'foreignKey':_0x05ec('0x154')});db['WhatsappAccount'][_0x05ec('0x125')](db[_0x05ec('0x10')],{'as':_0x05ec('0x16b'),'through':'user_has_whatsapp_accounts'});db[_0x05ec('0x1e9')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'onDelete':'restrict'});db[_0x05ec('0x1e9')][_0x05ec('0x122')](db[_0x05ec('0x107')],{'onDelete':'restrict'});db[_0x05ec('0x1e9')]['belongsTo'](db[_0x05ec('0xff')],{'onDelete':'restrict'});db[_0x05ec('0x1e9')]['belongsTo'](db['Interval'],{'onDelete':_0x05ec('0x162'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0x05ec('0x122')](db[_0x05ec('0x172')],{'onDelete':_0x05ec('0x162'),'foreignKey':_0x05ec('0x17a')});db['WhatsappInteraction'][_0x05ec('0x114')](db[_0x05ec('0x103')],{'as':_0x05ec('0x167'),'onDelete':_0x05ec('0x111'),'foreignKey':'WhatsappInteractionId'});db[_0x05ec('0x102')][_0x05ec('0x122')](db[_0x05ec('0xff')],{'as':_0x05ec('0x16f'),'foreignKey':_0x05ec('0x1e8')});db[_0x05ec('0x102')][_0x05ec('0x122')](db[_0x05ec('0x6a')],{'as':_0x05ec('0x15f'),'foreignKey':_0x05ec('0x170')});db[_0x05ec('0x102')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'as':'Owner','foreignKey':'UserId'});db[_0x05ec('0x102')]['belongsToMany'](db[_0x05ec('0x172')],{'through':'whatsapp_interaction_has_tags','as':_0x05ec('0x17d')});db[_0x05ec('0x102')]['belongsToMany'](db[_0x05ec('0x172')],{'through':_0x05ec('0x1ea'),'as':'ThroughTags'});db[_0x05ec('0x102')][_0x05ec('0x125')](db['User'],{'as':_0x05ec('0x174'),'through':_0x05ec('0x130'),'foreignKey':_0x05ec('0x1eb')});db[_0x05ec('0x103')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'as':'User'});db[_0x05ec('0x103')]['belongsTo'](db[_0x05ec('0x6a')],{'onDelete':'cascade','as':_0x05ec('0x15f')});db[_0x05ec('0x103')]['belongsTo'](db[_0x05ec('0x102')],{'onDelete':_0x05ec('0x111'),'as':_0x05ec('0x17f'),'foreignKey':_0x05ec('0x1eb')});db[_0x05ec('0x103')][_0x05ec('0x122')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x05ec('0x1e8')});db[_0x05ec('0x104')][_0x05ec('0x122')](db[_0x05ec('0xff')],{});db[_0x05ec('0x104')][_0x05ec('0x122')](db['CmList'],{'as':_0x05ec('0x169'),'foreignKey':'ListId'});db[_0x05ec('0x104')]['belongsTo'](db[_0x05ec('0x6a')],{'as':'Contact','foreignKey':_0x05ec('0x170')});db[_0x05ec('0x104')][_0x05ec('0x122')](db[_0x05ec('0x102')],{});db[_0x05ec('0x104')]['belongsTo'](db[_0x05ec('0x107')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x05ec('0x103')],{});db[_0x05ec('0x104')][_0x05ec('0x122')](db[_0x05ec('0x10')],{});db[_0x05ec('0x1ec')][_0x05ec('0x122')](db['WhatsappMessage'],{});db[_0x05ec('0x1ec')][_0x05ec('0x122')](db['WhatsappInteraction'],{});db[_0x05ec('0x1ec')]['belongsTo'](db[_0x05ec('0xff')],{'foreignKey':_0x05ec('0x1ed'),'as':_0x05ec('0x1d5')});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x05ec('0x1ee'),'as':_0x05ec('0x1d9')});db[_0x05ec('0x1ec')][_0x05ec('0x122')](db[_0x05ec('0x107')],{'foreignKey':_0x05ec('0x1ef'),'as':'ToQueue'});db[_0x05ec('0x1ec')][_0x05ec('0x122')](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1da'),'as':'FromAgent'});db[_0x05ec('0x1ec')]['belongsTo'](db[_0x05ec('0x10')],{'foreignKey':_0x05ec('0x1df'),'as':_0x05ec('0x1d7')});db[_0x05ec('0x107')]['belongsToMany'](db['User'],{'as':_0x05ec('0x16b'),'through':_0x05ec('0x36'),'foreignKey':_0x05ec('0x1f0')});db[_0x05ec('0x107')]['belongsToMany'](db['Team'],{'through':_0x05ec('0x1ce'),'as':_0x05ec('0x16d')});db[_0x05ec('0x10e')][_0x05ec('0x122')](db['User'],{'as':_0x05ec('0x1f1'),'foreignKey':'UserId','onDelete':_0x05ec('0x111'),'hooks':!![]});db[_0x05ec('0x109')][_0x05ec('0x110')](db['Dynamics365Account'],{'as':_0x05ec('0xc0'),'onDelete':'restrict'});db[_0x05ec('0x109')][_0x05ec('0x110')](db[_0x05ec('0x38')],{'as':'Imap','onDelete':'restrict'});db['CloudProvider'][_0x05ec('0x110')](db[_0x05ec('0x39')],{'as':_0x05ec('0x164'),'onDelete':_0x05ec('0x162')});module[_0x05ec('0x1f2')]={'db':db,'dbH':dbH};
\ No newline at end of file
index db3dd66..b3ed312 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/messages','./api/team','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsQueue','./api/openchannelAccount'];(function(_0x3fd19f,_0x318a65){var _0x582a9d=function(_0x212a10){while(--_0x212a10){_0x3fd19f['push'](_0x3fd19f['shift']());}};_0x582a9d(++_0x318a65);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x16fb9f,_0x56b57b){_0x16fb9f=_0x16fb9f-0x0;var _0x516f53=_0xd6d6[_0x16fb9f];return _0x516f53;};'use strict';var path=require(_0x6d6d('0x0'));var express=require(_0x6d6d('0x1'));var errors=require(_0x6d6d('0x2'));var config=require(_0x6d6d('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x6d6d('0x4')];var clientSideLogs=require(_0x6d6d('0x5'));exports[_0x6d6d('0x6')]=function(_0x2a838a){return setupLoggers(_0x2a838a)[_0x6d6d('0x7')](function(){_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x9'),require('./api/user'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xa'),require(_0x6d6d('0xb')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xc'),require(_0x6d6d('0xd')));_0x2a838a[_0x6d6d('0x8')]('/api/voice/extensions',require('./api/voiceExtension'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xe'),require(_0x6d6d('0xf')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x10'),require('./api/voiceQueue'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x11'),require('./api/voiceRecording'));_0x2a838a['use'](_0x6d6d('0x12'),require(_0x6d6d('0x13')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x14'),require(_0x6d6d('0x15')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x16'),require(_0x6d6d('0x17')));_0x2a838a['use'](_0x6d6d('0x18'),require(_0x6d6d('0x19')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x1a'),require(_0x6d6d('0x1b')));_0x2a838a['use'](_0x6d6d('0x1c'),require('./api/voiceAgentReport'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x1d'),require(_0x6d6d('0x1e')));_0x2a838a['use']('/api/members/reports',require(_0x6d6d('0x1f')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x20'),require(_0x6d6d('0x21')));_0x2a838a['use']('/api/voice/transfers/reports',require(_0x6d6d('0x22')));_0x2a838a['use'](_0x6d6d('0x23'),require(_0x6d6d('0x24')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x25'),require(_0x6d6d('0x26')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x27'),require(_0x6d6d('0x28')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x29'),require(_0x6d6d('0x2a')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x2b'),require(_0x6d6d('0x2c')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x2d'),require(_0x6d6d('0x2e')));_0x2a838a['use'](_0x6d6d('0x2f'),require(_0x6d6d('0x30')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x31'),require(_0x6d6d('0x32')));_0x2a838a[_0x6d6d('0x8')]('/api/dashboards',require(_0x6d6d('0x33')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x34'),require(_0x6d6d('0x35')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x36'),require(_0x6d6d('0x37')));_0x2a838a['use'](_0x6d6d('0x38'),require(_0x6d6d('0x39')));_0x2a838a['use']('/api/fax/interactions',require(_0x6d6d('0x3a')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x3b'),require('./api/faxMessage'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x3c'),require(_0x6d6d('0x3d')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x3e'),require(_0x6d6d('0x3f')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x40'),require(_0x6d6d('0x41')));_0x2a838a[_0x6d6d('0x8')]('/api/sms/applications',require(_0x6d6d('0x42')));_0x2a838a['use'](_0x6d6d('0x43'),require(_0x6d6d('0x44')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x45'),require('./api/smsMessage'));_0x2a838a[_0x6d6d('0x8')]('/api/sms/queues',require(_0x6d6d('0x46')));_0x2a838a[_0x6d6d('0x8')]('/api/openchannel/accounts',require(_0x6d6d('0x47')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x48'),require(_0x6d6d('0x49')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x4a'),require(_0x6d6d('0x4b')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x4c'),require(_0x6d6d('0x4d')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x4e'),require(_0x6d6d('0x4f')));_0x2a838a[_0x6d6d('0x8')]('/api/chat/websites',require(_0x6d6d('0x50')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x51'),require(_0x6d6d('0x52')));_0x2a838a['use']('/api/chat/applications',require(_0x6d6d('0x53')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x54'),require('./api/chatInteraction'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x55'),require(_0x6d6d('0x56')));_0x2a838a[_0x6d6d('0x8')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x2a838a['use'](_0x6d6d('0x57'),require(_0x6d6d('0x58')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x59'),require('./api/chatGroup'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x5a'),require(_0x6d6d('0x5b')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x5c'),require(_0x6d6d('0x5d')));_0x2a838a['use'](_0x6d6d('0x5e'),require(_0x6d6d('0x5f')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x60'),require(_0x6d6d('0x61')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x62'),require('./api/cmHopperBlack'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x63'),require(_0x6d6d('0x64')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x65'),require('./api/cmHopperHistory'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x66'),require('./api/cmCustomField'));_0x2a838a[_0x6d6d('0x8')]('/api/actions',require(_0x6d6d('0x67')));_0x2a838a[_0x6d6d('0x8')]('/api/automations',require(_0x6d6d('0x68')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x69'),require(_0x6d6d('0x6a')));_0x2a838a[_0x6d6d('0x8')]('/api/dispositions',require('./api/disposition'));_0x2a838a[_0x6d6d('0x8')]('/api/conditions',require('./api/condition'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x6b'),require(_0x6d6d('0x6c')));_0x2a838a['use'](_0x6d6d('0x6d'),require('./api/pause'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x6e'),require(_0x6d6d('0x6f')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x70'),require(_0x6d6d('0x71')));_0x2a838a[_0x6d6d('0x8')]('/api/schedules',require(_0x6d6d('0x72')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x73'),require(_0x6d6d('0x74')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x75'),require(_0x6d6d('0x76')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x77'),require('./api/template'));_0x2a838a['use'](_0x6d6d('0x78'),require(_0x6d6d('0x79')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x7a'),require(_0x6d6d('0x7b')));_0x2a838a['use'](_0x6d6d('0x7c'),require(_0x6d6d('0x7d')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x7e'),require(_0x6d6d('0x7f')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x80'),require(_0x6d6d('0x81')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x82'),require(_0x6d6d('0x83')));_0x2a838a[_0x6d6d('0x8')]('/api/analytics/extracted_reports',require(_0x6d6d('0x84')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x85'),require(_0x6d6d('0x86')));_0x2a838a[_0x6d6d('0x8')]('/api/analytics/field_reports',require(_0x6d6d('0x87')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x88'),require('./api/analyticTreeReport'));_0x2a838a['use'](_0x6d6d('0x89'),require('./api/intSalesforceAccount'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x8a'),require(_0x6d6d('0x8b')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x8c'),require(_0x6d6d('0x8d')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x8e'),require(_0x6d6d('0x8f')));_0x2a838a[_0x6d6d('0x8')]('/api/integrations/sugarcrm/configurations',require(_0x6d6d('0x90')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x91'),require(_0x6d6d('0x92')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x93'),require(_0x6d6d('0x94')));_0x2a838a['use']('/api/integrations/desk/configurations',require(_0x6d6d('0x95')));_0x2a838a[_0x6d6d('0x8')]('/api/integrations/desk/fields',require(_0x6d6d('0x96')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x97'),require(_0x6d6d('0x98')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x99'),require(_0x6d6d('0x9a')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x9b'),require(_0x6d6d('0x9c')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x9d'),require(_0x6d6d('0x9e')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0x9f'),require('./api/intZendeskConfiguration'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xa0'),require('./api/intZendeskField'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xa1'),require(_0x6d6d('0xa2')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xa3'),require(_0x6d6d('0xa4')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xa5'),require(_0x6d6d('0xa6')));_0x2a838a['use']('/api/integrations/vtiger/accounts',require(_0x6d6d('0xa7')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xa8'),require('./api/intVtigerConfiguration'));_0x2a838a['use'](_0x6d6d('0xa9'),require('./api/intVtigerField'));_0x2a838a[_0x6d6d('0x8')]('/api/integrations/servicenow/accounts',require(_0x6d6d('0xaa')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xab'),require(_0x6d6d('0xac')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xad'),require('./api/intServicenowField'));_0x2a838a[_0x6d6d('0x8')]('/api/integrations/dynamics365/accounts',require(_0x6d6d('0xae')));_0x2a838a['use'](_0x6d6d('0xaf'),require(_0x6d6d('0xb0')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xb1'),require(_0x6d6d('0xb2')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xb3'),require('./api/intFreshsalesAccount'));_0x2a838a['use'](_0x6d6d('0xb4'),require('./api/intFreshsalesConfiguration'));_0x2a838a[_0x6d6d('0x8')]('/api/integrations/freshsales/fields',require(_0x6d6d('0xb5')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xb6'),require(_0x6d6d('0xb7')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xb8'),require('./api/chatQueueReport'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xb9'),require(_0x6d6d('0xba')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xbb'),require(_0x6d6d('0xbc')));_0x2a838a[_0x6d6d('0x8')]('/api/jscripty/questions/reports',require(_0x6d6d('0xbd')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xbe'),require(_0x6d6d('0xbf')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xc0'),require(_0x6d6d('0xc1')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xc2'),require(_0x6d6d('0xc3')));_0x2a838a[_0x6d6d('0x8')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x2a838a[_0x6d6d('0x8')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x2a838a['use'](_0x6d6d('0xc4'),require(_0x6d6d('0xc5')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xc6'),require(_0x6d6d('0xc7')));_0x2a838a[_0x6d6d('0x8')]('/api/square/projects',require('./api/squareProject'));_0x2a838a[_0x6d6d('0x8')]('/api/square/recordings',require('./api/squareRecording'));_0x2a838a['use'](_0x6d6d('0xc8'),require('./api/squareMessage'));_0x2a838a[_0x6d6d('0x8')]('/api/teams',require(_0x6d6d('0xc9')));_0x2a838a[_0x6d6d('0x8')]('/api/license',require('./api/license'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xca'),require(_0x6d6d('0xcb')));_0x2a838a[_0x6d6d('0x8')]('/api/migrations',require(_0x6d6d('0xcc')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xcd'),require(_0x6d6d('0xce')));_0x2a838a['use'](_0x6d6d('0xcf'),require('./api/plugin'));_0x2a838a['use']('/api/mail/reports/transfer',require(_0x6d6d('0xd0')));_0x2a838a['use'](_0x6d6d('0xd1'),require(_0x6d6d('0xd2')));_0x2a838a[_0x6d6d('0x8')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xd3'),require('./api/openchannelTransferReport'));_0x2a838a['use'](_0x6d6d('0xd4'),require(_0x6d6d('0xd5')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xd6'),require(_0x6d6d('0xd7')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xd8'),require('./api/voicePrefix'));_0x2a838a['use']('/api/userProfiles',require('./api/userProfile'));_0x2a838a['use']('/api/userProfile/sections',require(_0x6d6d('0xd9')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xda'),require(_0x6d6d('0xdb')));_0x2a838a['use']('/api/userNotifications',require('./api/userNotification'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xdc'),require(_0x6d6d('0xdd')));_0x2a838a[_0x6d6d('0x8')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xde'),require('./api/whatsappInteraction'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xdf'),require(_0x6d6d('0xe0')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xe1'),require('./api/whatsappQueueReport'));_0x2a838a[_0x6d6d('0x8')]('/api/whatsapp/reports/transfer',require(_0x6d6d('0xe2')));_0x2a838a['use'](_0x6d6d('0xe3'),require('./api/whatsappQueue'));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xe4'),require(_0x6d6d('0xe5')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xe6'),require(_0x6d6d('0xe7')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xe8'),require(_0x6d6d('0xe9')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xea'),require(_0x6d6d('0xeb')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xec'),require(_0x6d6d('0xed')));_0x2a838a[_0x6d6d('0x8')]('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x2a838a[_0x6d6d('0x8')]('/api/jira',require(_0x6d6d('0xee')));_0x2a838a[_0x6d6d('0x8')]('/api/rpc',require('./api/rpc'));_0x2a838a[_0x6d6d('0x8')]('/api/version',require(_0x6d6d('0xef')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xf0'),require(_0x6d6d('0xf1')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xf2'),require(_0x6d6d('0xf3')));_0x2a838a[_0x6d6d('0x8')]('/api/webbar',require(_0x6d6d('0xf4')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xf5'),clientSideLogs);_0x2a838a['use']('/apidoc',express[_0x6d6d('0xf6')](path[_0x6d6d('0xf7')](config[_0x6d6d('0xf8')],'/apidoc')));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xf9'),express['static'](path[_0x6d6d('0xf7')](config[_0x6d6d('0xf8')],_0x6d6d('0xf9'))));_0x2a838a[_0x6d6d('0x8')](_0x6d6d('0xfa'),express['static'](path[_0x6d6d('0xf7')](config[_0x6d6d('0xf8')],'/demo')));_0x2a838a['use'](_0x6d6d('0xfb'),express[_0x6d6d('0xf6')](path[_0x6d6d('0xf7')](config[_0x6d6d('0xf8')],'snippet',_0x6d6d('0xfc'))));_0x2a838a['use'](_0x6d6d('0xfd'),express[_0x6d6d('0xf6')](path[_0x6d6d('0xf7')](config[_0x6d6d('0xf8')],_0x6d6d('0xfe'))));_0x2a838a[_0x6d6d('0xff')](_0x6d6d('0x100'))[_0x6d6d('0x101')](errors[0x194]);_0x2a838a[_0x6d6d('0xff')]('/*')[_0x6d6d('0x101')](function(_0x179bbe,_0x2809b1){_0x2809b1[_0x6d6d('0x102')](path[_0x6d6d('0x103')](_0x2a838a[_0x6d6d('0x101')](_0x6d6d('0x104'))+_0x6d6d('0x105')));});return _0x2a838a;});};
\ No newline at end of file
+var _0x7da7=['resolve','appPath','/index.html','path','express','./errors','setupLoggers','./api/client-side-logs','then','/api/users','./api/user','/api/voice/chanspy','use','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatProactiveAction','/api/cm/companies','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','/api/integrations','./api/integration','./api/integrationReport','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','./api/version','/api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','/www','/snippet','root','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile'];(function(_0x4b1315,_0x52afab){var _0x489dd8=function(_0x196c06){while(--_0x196c06){_0x4b1315['push'](_0x4b1315['shift']());}};_0x489dd8(++_0x52afab);}(_0x7da7,0x10d));var _0x77da=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x7da7[_0x30abff];return _0x4c571e;};'use strict';var path=require(_0x77da('0x0'));var express=require(_0x77da('0x1'));var errors=require(_0x77da('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x77da('0x3')];var clientSideLogs=require(_0x77da('0x4'));exports['default']=function(_0x3a9fa6){return setupLoggers(_0x3a9fa6)[_0x77da('0x5')](function(){_0x3a9fa6['use'](_0x77da('0x6'),require(_0x77da('0x7')));_0x3a9fa6['use'](_0x77da('0x8'),require('./api/voiceChanSpy'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xa'),require(_0x77da('0xb')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xc'),require('./api/voiceExtension'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xd'),require(_0x77da('0xe')));_0x3a9fa6['use'](_0x77da('0xf'),require(_0x77da('0x10')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x11'),require('./api/voiceRecording'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x12'),require(_0x77da('0x13')));_0x3a9fa6['use']('/api/voice/mails',require(_0x77da('0x14')));_0x3a9fa6[_0x77da('0x9')]('/api/voice/mails/messages',require(_0x77da('0x15')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x16'),require(_0x77da('0x17')));_0x3a9fa6['use'](_0x77da('0x18'),require('./api/voiceDialReport'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x19'),require(_0x77da('0x1a')));_0x3a9fa6[_0x77da('0x9')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x3a9fa6['use']('/api/members/reports',require(_0x77da('0x1b')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x1c'),require(_0x77da('0x1d')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x1e'),require(_0x77da('0x1f')));_0x3a9fa6[_0x77da('0x9')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x20'),require('./api/mailAccount'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x21'),require(_0x77da('0x22')));_0x3a9fa6['use']('/api/mail/substatuses',require(_0x77da('0x23')));_0x3a9fa6['use'](_0x77da('0x24'),require(_0x77da('0x25')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x26'),require(_0x77da('0x27')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x28'),require('./api/mailApplication'));_0x3a9fa6['use'](_0x77da('0x29'),require(_0x77da('0x2a')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x2b'),require('./api/dashboard'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x2c'),require(_0x77da('0x2d')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x2e'),require('./api/faxAccount'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x2f'),require(_0x77da('0x30')));_0x3a9fa6[_0x77da('0x9')]('/api/fax/interactions',require('./api/faxInteraction'));_0x3a9fa6['use'](_0x77da('0x31'),require(_0x77da('0x32')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x33'),require(_0x77da('0x34')));_0x3a9fa6['use'](_0x77da('0x35'),require(_0x77da('0x36')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x37'),require(_0x77da('0x38')));_0x3a9fa6[_0x77da('0x9')]('/api/sms/applications',require(_0x77da('0x39')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x3a'),require(_0x77da('0x3b')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x3c'),require(_0x77da('0x3d')));_0x3a9fa6[_0x77da('0x9')]('/api/sms/queues',require('./api/smsQueue'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x3e'),require('./api/openchannelAccount'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x3f'),require(_0x77da('0x40')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x41'),require(_0x77da('0x42')));_0x3a9fa6[_0x77da('0x9')]('/api/openchannel/messages',require(_0x77da('0x43')));_0x3a9fa6['use']('/api/openchannel/queues',require('./api/openchannelQueue'));_0x3a9fa6[_0x77da('0x9')]('/api/chat/websites',require(_0x77da('0x44')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x45'),require(_0x77da('0x46')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x47'),require(_0x77da('0x48')));_0x3a9fa6['use'](_0x77da('0x49'),require(_0x77da('0x4a')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x4b'),require(_0x77da('0x4c')));_0x3a9fa6[_0x77da('0x9')]('/api/chat/offline_messages',require(_0x77da('0x4d')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x4e'),require('./api/chatQueue'));_0x3a9fa6[_0x77da('0x9')]('/api/chat/groups',require('./api/chatGroup'));_0x3a9fa6['use']('/api/chat/proactive_actions',require(_0x77da('0x4f')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x50'),require('./api/cmCompany'));_0x3a9fa6[_0x77da('0x9')]('/api/cm/contacts',require(_0x77da('0x51')));_0x3a9fa6['use'](_0x77da('0x52'),require(_0x77da('0x53')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x54'),require(_0x77da('0x55')));_0x3a9fa6['use'](_0x77da('0x56'),require(_0x77da('0x57')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x58'),require(_0x77da('0x59')));_0x3a9fa6[_0x77da('0x9')]('/api/cm/custom_fields',require(_0x77da('0x5a')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x5b'),require(_0x77da('0x5c')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x5d'),require('./api/automation'));_0x3a9fa6[_0x77da('0x9')]('/api/canned_answers',require(_0x77da('0x5e')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x5f'),require('./api/disposition'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x60'),require(_0x77da('0x61')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x62'),require(_0x77da('0x63')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x64'),require(_0x77da('0x65')));_0x3a9fa6['use'](_0x77da('0x66'),require(_0x77da('0x67')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x68'),require(_0x77da('0x69')));_0x3a9fa6[_0x77da('0x9')]('/api/schedules',require('./api/schedule'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x6a'),require(_0x77da('0x6b')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x6c'),require(_0x77da('0x6d')));_0x3a9fa6['use'](_0x77da('0x6e'),require(_0x77da('0x6f')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x70'),require('./api/trigger'));_0x3a9fa6[_0x77da('0x9')]('/api/variables',require('./api/variable'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x71'),require(_0x77da('0x72')));_0x3a9fa6[_0x77da('0x9')]('/api/integrations/reports',require(_0x77da('0x73')));_0x3a9fa6[_0x77da('0x9')]('/api/analytics/custom_reports',require(_0x77da('0x74')));_0x3a9fa6[_0x77da('0x9')]('/api/analytics/default_reports',require(_0x77da('0x75')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x76'),require(_0x77da('0x77')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x78'),require(_0x77da('0x79')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x7a'),require(_0x77da('0x7b')));_0x3a9fa6['use'](_0x77da('0x7c'),require('./api/analyticTreeReport'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x7d'),require(_0x77da('0x7e')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x7f'),require(_0x77da('0x80')));_0x3a9fa6[_0x77da('0x9')]('/api/integrations/salesforce/fields',require(_0x77da('0x81')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x82'),require(_0x77da('0x83')));_0x3a9fa6['use'](_0x77da('0x84'),require(_0x77da('0x85')));_0x3a9fa6[_0x77da('0x9')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x86'),require(_0x77da('0x87')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x88'),require('./api/intDeskConfiguration'));_0x3a9fa6['use'](_0x77da('0x89'),require(_0x77da('0x8a')));_0x3a9fa6['use'](_0x77da('0x8b'),require(_0x77da('0x8c')));_0x3a9fa6[_0x77da('0x9')]('/api/integrations/zoho/configurations',require(_0x77da('0x8d')));_0x3a9fa6[_0x77da('0x9')]('/api/integrations/zoho/fields',require(_0x77da('0x8e')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x8f'),require(_0x77da('0x90')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x91'),require(_0x77da('0x92')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x93'),require('./api/intZendeskField'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x94'),require(_0x77da('0x95')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x96'),require(_0x77da('0x97')));_0x3a9fa6['use'](_0x77da('0x98'),require(_0x77da('0x99')));_0x3a9fa6[_0x77da('0x9')]('/api/integrations/vtiger/accounts',require(_0x77da('0x9a')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x9b'),require(_0x77da('0x9c')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x9d'),require(_0x77da('0x9e')));_0x3a9fa6['use'](_0x77da('0x9f'),require('./api/intServicenowAccount'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xa0'),require(_0x77da('0xa1')));_0x3a9fa6['use'](_0x77da('0xa2'),require(_0x77da('0xa3')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xa4'),require('./api/intDynamics365Account'));_0x3a9fa6['use']('/api/integrations/dynamics365/configurations',require(_0x77da('0xa5')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xa6'),require(_0x77da('0xa7')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xa8'),require(_0x77da('0xa9')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xaa'),require(_0x77da('0xab')));_0x3a9fa6['use'](_0x77da('0xac'),require(_0x77da('0xad')));_0x3a9fa6['use']('/api/networks',require(_0x77da('0xae')));_0x3a9fa6['use'](_0x77da('0xaf'),require(_0x77da('0xb0')));_0x3a9fa6[_0x77da('0x9')]('/api/chat/internal/messages',require(_0x77da('0xb1')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xb2'),require(_0x77da('0xb3')));_0x3a9fa6[_0x77da('0x9')]('/api/jscripty/questions/reports',require(_0x77da('0xb4')));_0x3a9fa6[_0x77da('0x9')]('/api/jscripty/sessions/reports',require(_0x77da('0xb5')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xb6'),require(_0x77da('0xb7')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xb8'),require(_0x77da('0xb9')));_0x3a9fa6['use'](_0x77da('0xba'),require('./api/squareReportDetail'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xbb'),require(_0x77da('0xbc')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xbd'),require(_0x77da('0xbe')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xbf'),require(_0x77da('0xc0')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xc1'),require(_0x77da('0xc2')));_0x3a9fa6['use'](_0x77da('0xc3'),require(_0x77da('0xc4')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xc5'),require('./api/squareMessage'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xc6'),require(_0x77da('0xc7')));_0x3a9fa6['use'](_0x77da('0xc8'),require('./api/license'));_0x3a9fa6['use'](_0x77da('0xc9'),require(_0x77da('0xca')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xcb'),require(_0x77da('0xcc')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xcd'),require(_0x77da('0xce')));_0x3a9fa6[_0x77da('0x9')]('/api/plugins',require(_0x77da('0xcf')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xd0'),require(_0x77da('0xd1')));_0x3a9fa6[_0x77da('0x9')]('/api/chat/reports/transfer',require(_0x77da('0xd2')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xd3'),require(_0x77da('0xd4')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xd5'),require(_0x77da('0xd6')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xd7'),require(_0x77da('0xd8')));_0x3a9fa6['use']('/api/cm/lists',require('./api/cmList'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xd9'),require(_0x77da('0xda')));_0x3a9fa6['use']('/api/userProfiles',require(_0x77da('0xdb')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xdc'),require(_0x77da('0xdd')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xde'),require(_0x77da('0xdf')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xe0'),require(_0x77da('0xe1')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xe2'),require(_0x77da('0xe3')));_0x3a9fa6['use']('/api/whatsapp/applications',require(_0x77da('0xe4')));_0x3a9fa6['use']('/api/whatsapp/interactions',require(_0x77da('0xe5')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xe6'),require('./api/whatsappMessage'));_0x3a9fa6['use'](_0x77da('0xe7'),require('./api/whatsappQueueReport'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xe8'),require('./api/whatsappTransferReport'));_0x3a9fa6[_0x77da('0x9')]('/api/whatsapp/queues',require(_0x77da('0xe9')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xea'),require(_0x77da('0xeb')));_0x3a9fa6['use'](_0x77da('0xec'),require(_0x77da('0xed')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xee'),require(_0x77da('0xef')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xf0'),require('./api/authLocal'));_0x3a9fa6['use'](_0x77da('0xf1'),require(_0x77da('0xf2')));_0x3a9fa6[_0x77da('0x9')]('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x3a9fa6['use']('/api/jira',require(_0x77da('0xf3')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xf4'),require('./api/rpc'));_0x3a9fa6[_0x77da('0x9')]('/api/version',require(_0x77da('0xf5')));_0x3a9fa6['use'](_0x77da('0xf6'),require('./api/system'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xf7'),require('./api/pm2'));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xf8'),require(_0x77da('0xf9')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xfa'),clientSideLogs);_0x3a9fa6[_0x77da('0x9')](_0x77da('0xfb'),express[_0x77da('0xfc')](path[_0x77da('0xfd')](config['root'],'/apidoc')));_0x3a9fa6['use'](_0x77da('0xfe'),express[_0x77da('0xfc')](path[_0x77da('0xfd')](config['root'],_0x77da('0xfe'))));_0x3a9fa6['use']('/demo',express[_0x77da('0xfc')](path[_0x77da('0xfd')](config['root'],'/demo')));_0x3a9fa6[_0x77da('0x9')](_0x77da('0xff'),express[_0x77da('0xfc')](path['join'](config[_0x77da('0x100')],'snippet',_0x77da('0x101'))));_0x3a9fa6[_0x77da('0x9')](_0x77da('0x102'),express[_0x77da('0xfc')](path[_0x77da('0xfd')](config[_0x77da('0x100')],'/server/files/plugins')));_0x3a9fa6[_0x77da('0x103')](_0x77da('0x104'))[_0x77da('0x105')](errors[0x194]);_0x3a9fa6[_0x77da('0x103')]('/*')['get'](function(_0x33ad4f,_0x4bfbc7){_0x4bfbc7[_0x77da('0x106')](path[_0x77da('0x107')](_0x3a9fa6[_0x77da('0x105')](_0x77da('0x108'))+_0x77da('0x109')));});return _0x3a9fa6;});};
\ No newline at end of file
index 27fed7c..ec138c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x829d=['../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','lodash','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc'];(function(_0x22d7fe,_0x27b7d0){var _0xed2353=function(_0x45f8dd){while(--_0x45f8dd){_0x22d7fe['push'](_0x22d7fe['shift']());}};_0xed2353(++_0x27b7d0);}(_0x829d,0x11f));var _0xd829=function(_0x5de84f,_0x5638c9){_0x5de84f=_0x5de84f-0x0;var _0x11c4f4=_0x829d[_0x5de84f];return _0x11c4f4;};'use strict';var jayson=require('jayson/promise');var _=require(_0xd829('0x0'));var config=require('../config/environment');exports[_0xd829('0x1')]=function(){return new Promise(function(_0x7c5110,_0x439b96){var _0x1f69ee={};_0x1f69ee=_['merge'](_0x1f69ee,require('../api/user/user.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x3')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x4')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/voiceRecording/voiceRecording.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x5')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x6')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x7')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x8')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/memberReport/memberReport.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/trunk/trunk.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x9')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0xa')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0xb')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0xc')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0xd')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0xe')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0xf')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/faxAccount/faxAccount.rpc'));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x10')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/faxInteraction/faxInteraction.rpc'));_0x1f69ee=_['merge'](_0x1f69ee,require('../api/faxMessage/faxMessage.rpc'));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x11')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x12')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/smsAccount/smsAccount.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x13')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x14')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x15')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x16')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x17')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1f69ee=_['merge'](_0x1f69ee,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x18')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x19')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x1a')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/chatQueue/chatQueue.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/cmContact/cmContact.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/cmHopper/cmHopper.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x1b')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x1c')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x1d')));_0x1f69ee=_['merge'](_0x1f69ee,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/interval/interval.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/pause/pause.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/sound/sound.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x1e')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x1f')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x20')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x21')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x22')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x23')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x24')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x25')));_0x1f69ee=_['merge'](_0x1f69ee,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x26')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x27')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x28')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x29')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x2a')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x2b')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x2c')));_0x1f69ee=_['merge'](_0x1f69ee,require(_0xd829('0x2d')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x2e')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x2f')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/squareRecording/squareRecording.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x30')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/campaign/campaign.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x31')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/plugin/plugin.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x32')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x33')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x34')));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1f69ee=_[_0xd829('0x2')](_0x1f69ee,require(_0xd829('0x35')));var _0x67110=jayson[_0xd829('0x36')](_0x1f69ee)[_0xd829('0x37')]();var _0x18406f=config[_0xd829('0x38')]['port']||config[_0xd829('0x39')]+0x1;var _0x5c8f67=config[_0xd829('0x38')]['ip']||_0xd829('0x3a');_0x67110['on']('error',function(_0x445daa){return _0x439b96(_0x445daa);});_0x67110[_0xd829('0x1')](_0x18406f,_0x5c8f67,function(){console[_0xd829('0x3b')](_0xd829('0x3c'),_0x5c8f67,_0x18406f);require('../config/triggers')[_0xd829('0x3d')]();return _0x7c5110('RPC\x20listening\x20on\x20'+_0x5c8f67+':'+_0x18406f);});});};
\ No newline at end of file
+var _0xdc5b=['../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc5b,0x87));var _0xbdc5=function(_0x39adeb,_0x4f42ce){_0x39adeb=_0x39adeb-0x0;var _0x1d6962=_0xdc5b[_0x39adeb];return _0x1d6962;};'use strict';var jayson=require(_0xbdc5('0x0'));var _=require(_0xbdc5('0x1'));var config=require(_0xbdc5('0x2'));exports[_0xbdc5('0x3')]=function(){return new Promise(function(_0x3a3288,_0x5b3d1f){var _0x5dc336={};_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x5')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x6')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x7')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x8')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x9')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0xa')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/memberReport/memberReport.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0xb')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0xc')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0xd')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0xe')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0xf')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x10')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x11')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x12')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x13')));_0x5dc336=_['merge'](_0x5dc336,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x14')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x15')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x16')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x17')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x18')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x19')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x1a')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x1b')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/smsMessage/smsMessage.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/smsQueue/smsQueue.rpc'));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x1c')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x1d')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x1e')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x1f')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x20')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x21')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/chatMessage/chatMessage.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x22')));_0x5dc336=_['merge'](_0x5dc336,require('../api/cmContact/cmContact.rpc'));_0x5dc336=_['merge'](_0x5dc336,require('../api/cmHopper/cmHopper.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x23')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x24')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x25')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x26')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x27')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x28')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x29')));_0x5dc336=_['merge'](_0x5dc336,require('../api/trigger/trigger.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x2a')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x2b')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x2c')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x2d')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x2e')));_0x5dc336=_['merge'](_0x5dc336,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x2f')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x30')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x31')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x32')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x33')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x34')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x35')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x36')));_0x5dc336=_['merge'](_0x5dc336,require('../api/squareOdbc/squareOdbc.rpc'));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x37')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x38')));_0x5dc336=_['merge'](_0x5dc336,require('../api/squareMessage/squareMessage.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/campaign/campaign.rpc'));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x39')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x3a')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require(_0xbdc5('0x3b')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x3c')));_0x5dc336=_['merge'](_0x5dc336,require(_0xbdc5('0x3d')));_0x5dc336=_[_0xbdc5('0x4')](_0x5dc336,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x577838=jayson[_0xbdc5('0x3e')](_0x5dc336)[_0xbdc5('0x3f')]();var _0x1b8b21=config[_0xbdc5('0x40')][_0xbdc5('0x41')]||config[_0xbdc5('0x41')]+0x1;var _0xbc8e74=config[_0xbdc5('0x40')]['ip']||_0xbdc5('0x42');_0x577838['on']('error',function(_0x424d0b){return _0x5b3d1f(_0x424d0b);});_0x577838['listen'](_0x1b8b21,_0xbc8e74,function(){console[_0xbdc5('0x43')](_0xbdc5('0x44'),_0xbc8e74,_0x1b8b21);require(_0xbdc5('0x45'))[_0xbdc5('0x46')]();return _0x3a3288(_0xbdc5('0x47')+_0xbc8e74+':'+_0x1b8b21);});});};
\ No newline at end of file
index 1b83de5..6ea949a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe54=['setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','agi','AGI','WAIT','error','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./error','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension'];(function(_0xc92e40,_0x32d13d){var _0x5ee0f2=function(_0x4cb2cc){while(--_0x4cb2cc){_0xc92e40['push'](_0xc92e40['shift']());}};_0x5ee0f2(++_0x32d13d);}(_0xbe54,0x9e));var _0x4be5=function(_0x4d2197,_0x59753){_0x4d2197=_0x4d2197-0x0;var _0x525f87=_0xbe54[_0x4d2197];return _0x525f87;};'use strict';var util=require(_0x4be5('0x0'));var _=require(_0x4be5('0x1'));var EventEmitter=require('events')[_0x4be5('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x4be5('0x3'));function AGIChannel(_0x5d7ad1){var _0x5933b2=this,_0x47f992=new AGIReply(),_0x5e0437=![],_0x107a04={};EventEmitter['call'](_0x5933b2);_0x5d7ad1[_0x4be5('0x4')](_0x4be5('0x5'));_0x5d7ad1[_0x4be5('0x6')](0x8*0x3c*0x3c*0x3e8);_0x47f992['setEncoding'](_0x4be5('0x5'));_0x47f992['on'](_0x4be5('0x7'),function(_0xfc18d){for(var _0x3db3c7 in _0xfc18d){_0x5933b2[_0x3db3c7]=_0xfc18d[_0x3db3c7];}_0x5933b2[_0x4be5('0x8')](_0x4be5('0x9'));});_0x47f992['on']('line',function(_0x40da86){if(_0x40da86[_0x4be5('0xa')]()==_0x4be5('0xb')){_0x5933b2[_0x4be5('0x8')](_0x4be5('0xb'));return;}if(_0x40da86[_0x4be5('0xc')](0x0,0xb)==_0x4be5('0xd')){_0x5e0437=!![];}if(_0x5e0437){_0x107a04['rx']+=_0x40da86+'\x0a';if(_0x40da86['search'](_0x4be5('0xe'))!=-0x1){_0x5e0437=![];}}else{_0x107a04['rx']=_0x40da86;}if(_0x5e0437){return;}if(typeof _0x107a04['cb']==_0x4be5('0xf')){var _0x49d58a=_0x107a04['rx'][_0x4be5('0xc')](0x0,0x3),_0x33e2b4=null,_0x25010b=null;_0x49d58a=parseInt(_0x49d58a);if(isNaN(_0x49d58a)){_0x107a04['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4be5('0x10')});return;}if(_0x49d58a!=0xc8){_0x107a04['cb'](null,{'code':_0x49d58a,'result':-0x1,'extra':'KO'});return;}_0x33e2b4=_0x107a04['rx'][_0x4be5('0xc')](0x4)[_0x4be5('0x11')](_0x4be5('0x12'),'');if(_0x33e2b4[_0x4be5('0x13')]('\x20')!=-0x1){_0x33e2b4=_0x33e2b4[_0x4be5('0x14')](0x0,_0x33e2b4[_0x4be5('0x13')]('\x20'));}if(_[_0x4be5('0x15')](_0x33e2b4,'-1')){_0x33e2b4=parseInt(_0x33e2b4);}_0x25010b=_0x107a04['rx'][_0x4be5('0x16')]('\x20');if(_0x25010b[_0x4be5('0x17')]==0x3){_0x25010b=_0x25010b[0x2][_0x4be5('0xc')](0x1,_0x25010b[0x2][_0x4be5('0x17')]-0x1);}else if(_0x25010b[_0x4be5('0x17')]>0x3){var _0x228780=/\((.+)\)/;var _0xde3513=_0x107a04['rx'][_0x4be5('0x18')](_0x228780);if(_0xde3513){_0x25010b=_0xde3513[0x1];}else{_0x25010b=null;}}else{_0x25010b=null;}_0x107a04['cb'](null,{'code':_0x49d58a,'result':_0x33e2b4,'extra':_0x25010b});}});_0x5d7ad1['on']('error',function(_0x491d87){_0x5933b2[_0x4be5('0x8')]('error',new AGIError(_0x4be5('0x19'),_0x491d87[_0x4be5('0x1a')]));});_0x5d7ad1['on'](_0x4be5('0x1b'),function(){_0x5933b2['emit'](_0x4be5('0x1b'),new AGIError(_0x4be5('0x1c')));});_0x5d7ad1['on'](_0x4be5('0x1d'),function(){_0x5933b2[_0x4be5('0x8')](_0x4be5('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x5d7ad1[_0x4be5('0x1e')]();});_0x5d7ad1['pipe'](_0x47f992);this[_0x4be5('0x1f')]=function(_0x861cd6,_0x1af404){var _0x861cd6=_0x861cd6||'',_0x1af404=typeof _0x1af404==_0x4be5('0xf')?_0x1af404:new Function();_0x107a04={'tx':_0x861cd6,'rx':'','cb':_0x1af404};_0x5d7ad1[_0x4be5('0x20')](_0x861cd6+'\x0a');},this[_0x4be5('0x1b')]=function(){_0x5d7ad1['destroy']();};}util[_0x4be5('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x4be5('0x22')][_0x4be5('0x23')]=function(_0x1dd639){return this[_0x4be5('0x1f')][_0x4be5('0x24')](this,_0x1dd639);};AGIChannel['prototype'][_0x4be5('0x25')]=function(){return this[_0x4be5('0x23')](_0x4be5('0x26'));};AGIChannel[_0x4be5('0x22')]['getData']=function(_0x5c5a11,_0x56d833,_0x5aa4f9){_0x5c5a11=_0x5c5a11===undefined?_0x4be5('0x27'):_0x5c5a11;_0x56d833=_0x56d833===undefined?'5':_0x56d833;_0x5aa4f9=_0x5aa4f9===undefined?'1':_0x5aa4f9;return this[_0x4be5('0x23')](util[_0x4be5('0x28')](_0x4be5('0x29'),_0x5c5a11,_0x56d833*0x3e8,_0x5aa4f9));};AGIChannel[_0x4be5('0x22')][_0x4be5('0x2a')]=function(_0x12ccf3){_0x12ccf3=_0x12ccf3||_0x4be5('0x2b');return this[_0x4be5('0x23')](util['format']('VERBOSE\x20\x22%s\x22',_0x12ccf3));};AGIChannel[_0x4be5('0x22')][_0x4be5('0x2c')]=function(_0x54ee51,_0x4fc605){if(_[_0x4be5('0x2d')](_0x4fc605)){return this[_0x4be5('0x23')](util['format'](_0x4be5('0x2e'),_0x54ee51,_0x4fc605[_0x4be5('0x2f')](',')));}return this['sendRequest'](util['format'](_0x4be5('0x2e'),_0x54ee51,_0x4fc605));};AGIChannel[_0x4be5('0x22')][_0x4be5('0x30')]=function(_0x43e0b7){return this[_0x4be5('0x23')](util[_0x4be5('0x28')]('SET\x20CONTEXT\x20%s',_0x43e0b7));};AGIChannel[_0x4be5('0x22')]['setExtension']=function(_0x215032){return this[_0x4be5('0x23')](util[_0x4be5('0x28')](_0x4be5('0x31'),_0x215032));};AGIChannel[_0x4be5('0x22')]['setPriority']=function(_0x550d8f){return this[_0x4be5('0x23')](util[_0x4be5('0x28')]('SET\x20PRIORITY\x20%s',_0x550d8f));};AGIChannel[_0x4be5('0x22')][_0x4be5('0xb')]=function(){return this[_0x4be5('0x23')](_0x4be5('0x32'));};AGIChannel[_0x4be5('0x22')][_0x4be5('0x33')]=function(_0x14e682,_0x350243){var _0x5deae6=_[_0x4be5('0x34')](_0x350243)||_['isNumber'](_0x350243)?_0x350243['toString']():_0x350243;return this[_0x4be5('0x23')](util['format'](_0x4be5('0x35'),_0x14e682,_0x5deae6?_0x5deae6['toString']()[_0x4be5('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4be5('0x22')]['sayNumber']=function(_0x807116,_0xd6ad7c){return this['sendRequest'](util[_0x4be5('0x28')](_0x4be5('0x36'),_0x807116,_0xd6ad7c));};AGIChannel['prototype'][_0x4be5('0x37')]=function(_0x56c844,_0x387675){return this['sendRequest'](util[_0x4be5('0x28')](_0x4be5('0x38'),_0x56c844,_0x387675));};AGIChannel[_0x4be5('0x22')][_0x4be5('0x39')]=function(_0x59380c,_0x3d2d07){return this[_0x4be5('0x23')](util[_0x4be5('0x28')](_0x4be5('0x3a'),_0x59380c,_0x3d2d07));};AGIChannel[_0x4be5('0x22')][_0x4be5('0x3b')]=function(_0x5acdc2,_0x1b8f22,_0x4b80e5){_0x1b8f22=_0x1b8f22||this[_0x4be5('0x3c')];_0x4b80e5=_0x4b80e5||0x1;this[_0x4be5('0x30')](_0x5acdc2);this[_0x4be5('0x3d')](_0x1b8f22);this['setPriority'](_0x4b80e5);return this[_0x4be5('0x2a')](util[_0x4be5('0x28')](_0x4be5('0x3e'),_0x5acdc2,_0x1b8f22,_0x4b80e5));};AGIChannel['prototype'][_0x4be5('0x3f')]=function(_0x375071){return this[_0x4be5('0x23')](util[_0x4be5('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x375071));};AGIChannel[_0x4be5('0x22')][_0x4be5('0x40')]=function(_0x480999,_0x3aa759,_0x522c89,_0x1350c6,_0x4b2ceb,_0x1a3e9d){_0x3aa759=_0x3aa759||'wav';_0x522c89=_0x522c89||'';_0x1350c6=_0x1350c6===undefined?-0x1:_0x1350c6==='-1'?-0x1:_0x1350c6*0x3e8;_0x4b2ceb=_0x4b2ceb===undefined?'':'s='+_0x4b2ceb;_0x1a3e9d=_0x1a3e9d?_0x4be5('0x41'):'';return this['sendRequest'](util[_0x4be5('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x480999,_0x3aa759,_0x522c89,_0x1350c6,_0x1a3e9d,_0x4b2ceb));};AGIChannel[_0x4be5('0x22')]['streamFile']=function(_0xffd900,_0xc93f3d){_0xc93f3d=_0xc93f3d||'';return this[_0x4be5('0x23')](util[_0x4be5('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xffd900,_0xc93f3d));};AGIChannel['prototype'][_0x4be5('0x42')]=function(_0x52ef84){return this[_0x4be5('0x2c')](_0x4be5('0x43'),_0x52ef84);};AGIChannel[_0x4be5('0x22')]['wait']=function(_0x2beac5){return this[_0x4be5('0x2c')](_0x4be5('0x44'),_0x2beac5);};AGIChannel[_0x4be5('0x22')][_0x4be5('0x45')]=function(_0x52aa4f,_0x2d6a98){this['noop'](util[_0x4be5('0x28')](_0x4be5('0x46'),_0x52aa4f['id'],_0x52aa4f[_0x4be5('0x47')],_0x2d6a98));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4be5('0x48')]=AGIChannel;
\ No newline at end of file
+var _0xd641=['exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','replace','result=','indexOf','substr','startsWith','length','match','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','destroy','pipe','command','function','write','prototype','sendRequest','sync','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setPriority','HANGUP','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','label'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd641,0xd9));var _0x1d64=function(_0xd37b73,_0x149eef){_0xd37b73=_0xd37b73-0x0;var _0x5c6378=_0xd641[_0xd37b73];return _0x5c6378;};'use strict';var util=require(_0x1d64('0x0'));var _=require(_0x1d64('0x1'));var EventEmitter=require(_0x1d64('0x2'))[_0x1d64('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x1d64('0x4'));function AGIChannel(_0xe24ff5){var _0x5c7968=this,_0x1e53a6=new AGIReply(),_0x2948f2=![],_0xe7a7d7={};EventEmitter[_0x1d64('0x5')](_0x5c7968);_0xe24ff5[_0x1d64('0x6')](_0x1d64('0x7'));_0xe24ff5[_0x1d64('0x8')](0x8*0x3c*0x3c*0x3e8);_0x1e53a6['setEncoding'](_0x1d64('0x7'));_0x1e53a6['on'](_0x1d64('0x9'),function(_0x8c82c5){for(var _0x5226cb in _0x8c82c5){_0x5c7968[_0x5226cb]=_0x8c82c5[_0x5226cb];}_0x5c7968[_0x1d64('0xa')](_0x1d64('0xb'));});_0x1e53a6['on'](_0x1d64('0xc'),function(_0x6dee96){if(_0x6dee96[_0x1d64('0xd')]()==_0x1d64('0xe')){_0x5c7968[_0x1d64('0xa')]('hangup');return;}if(_0x6dee96[_0x1d64('0xf')](0x0,0xb)=='520-Invalid'){_0x2948f2=!![];}if(_0x2948f2){_0xe7a7d7['rx']+=_0x6dee96+'\x0a';if(_0x6dee96['search'](_0x1d64('0x10'))!=-0x1){_0x2948f2=![];}}else{_0xe7a7d7['rx']=_0x6dee96;}if(_0x2948f2){return;}if(typeof _0xe7a7d7['cb']=='function'){var _0x5073f2=_0xe7a7d7['rx'][_0x1d64('0xf')](0x0,0x3),_0x6b45e0=null,_0x1e73c9=null;_0x5073f2=parseInt(_0x5073f2);if(isNaN(_0x5073f2)){_0xe7a7d7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x5073f2!=0xc8){_0xe7a7d7['cb'](null,{'code':_0x5073f2,'result':-0x1,'extra':'KO'});return;}_0x6b45e0=_0xe7a7d7['rx']['substring'](0x4)[_0x1d64('0x11')](_0x1d64('0x12'),'');if(_0x6b45e0[_0x1d64('0x13')]('\x20')!=-0x1){_0x6b45e0=_0x6b45e0[_0x1d64('0x14')](0x0,_0x6b45e0['indexOf']('\x20'));}if(_[_0x1d64('0x15')](_0x6b45e0,'-1')){_0x6b45e0=parseInt(_0x6b45e0);}_0x1e73c9=_0xe7a7d7['rx']['split']('\x20');if(_0x1e73c9[_0x1d64('0x16')]==0x3){_0x1e73c9=_0x1e73c9[0x2][_0x1d64('0xf')](0x1,_0x1e73c9[0x2][_0x1d64('0x16')]-0x1);}else if(_0x1e73c9[_0x1d64('0x16')]>0x3){var _0x36652=/\((.+)\)/;var _0x132f9c=_0xe7a7d7['rx'][_0x1d64('0x17')](_0x36652);if(_0x132f9c){_0x1e73c9=_0x132f9c[0x1];}else{_0x1e73c9=null;}}else{_0x1e73c9=null;}_0xe7a7d7['cb'](null,{'code':_0x5073f2,'result':_0x6b45e0,'extra':_0x1e73c9});}});_0xe24ff5['on']('error',function(_0x44a30c){_0x5c7968[_0x1d64('0xa')]('error',new AGIError(_0x1d64('0x18'),_0x44a30c[_0x1d64('0x19')]));});_0xe24ff5['on'](_0x1d64('0x1a'),function(){_0x5c7968[_0x1d64('0xa')](_0x1d64('0x1a'),new AGIError(_0x1d64('0x1b')));});_0xe24ff5['on']('timeout',function(){_0x5c7968['emit']('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0xe24ff5[_0x1d64('0x1c')]();});_0xe24ff5[_0x1d64('0x1d')](_0x1e53a6);this[_0x1d64('0x1e')]=function(_0x25f216,_0x2c82f6){var _0x25f216=_0x25f216||'',_0x2c82f6=typeof _0x2c82f6==_0x1d64('0x1f')?_0x2c82f6:new Function();_0xe7a7d7={'tx':_0x25f216,'rx':'','cb':_0x2c82f6};_0xe24ff5[_0x1d64('0x20')](_0x25f216+'\x0a');},this[_0x1d64('0x1a')]=function(){_0xe24ff5[_0x1d64('0x1c')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1d64('0x21')][_0x1d64('0x22')]=function(_0x5512d4){return this[_0x1d64('0x1e')][_0x1d64('0x23')](this,_0x5512d4);};AGIChannel[_0x1d64('0x21')]['answer']=function(){return this['sendRequest'](_0x1d64('0x24'));};AGIChannel['prototype']['getData']=function(_0x303ae7,_0x3615c6,_0x41b7b1){_0x303ae7=_0x303ae7===undefined?'beep':_0x303ae7;_0x3615c6=_0x3615c6===undefined?'5':_0x3615c6;_0x41b7b1=_0x41b7b1===undefined?'1':_0x41b7b1;return this['sendRequest'](util[_0x1d64('0x25')](_0x1d64('0x26'),_0x303ae7,_0x3615c6*0x3e8,_0x41b7b1));};AGIChannel[_0x1d64('0x21')][_0x1d64('0x27')]=function(_0x492ac3){_0x492ac3=_0x492ac3||_0x1d64('0x28');return this[_0x1d64('0x22')](util[_0x1d64('0x25')](_0x1d64('0x29'),_0x492ac3));};AGIChannel['prototype'][_0x1d64('0x2a')]=function(_0x42d60c,_0x2e34aa){if(_['isArray'](_0x2e34aa)){return this[_0x1d64('0x22')](util[_0x1d64('0x25')](_0x1d64('0x2b'),_0x42d60c,_0x2e34aa[_0x1d64('0x2c')](',')));}return this[_0x1d64('0x22')](util[_0x1d64('0x25')]('EXEC\x20%s\x20%s',_0x42d60c,_0x2e34aa));};AGIChannel[_0x1d64('0x21')][_0x1d64('0x2d')]=function(_0x34355d){return this[_0x1d64('0x22')](util[_0x1d64('0x25')]('SET\x20CONTEXT\x20%s',_0x34355d));};AGIChannel[_0x1d64('0x21')]['setExtension']=function(_0x48c619){return this['sendRequest'](util[_0x1d64('0x25')]('SET\x20EXTENSION\x20%s',_0x48c619));};AGIChannel[_0x1d64('0x21')][_0x1d64('0x2e')]=function(_0x4d5395){return this[_0x1d64('0x22')](util['format']('SET\x20PRIORITY\x20%s',_0x4d5395));};AGIChannel[_0x1d64('0x21')][_0x1d64('0xe')]=function(){return this[_0x1d64('0x22')](_0x1d64('0x2f'));};AGIChannel['prototype']['setVariable']=function(_0x153004,_0xae7663){var _0xe0b35f=_[_0x1d64('0x30')](_0xae7663)||_['isNumber'](_0xae7663)?_0xae7663[_0x1d64('0x31')]():_0xae7663;return this[_0x1d64('0x22')](util[_0x1d64('0x25')](_0x1d64('0x32'),_0x153004,_0xe0b35f?_0xe0b35f[_0x1d64('0x31')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1d64('0x21')][_0x1d64('0x33')]=function(_0x1da36c,_0xc37494){return this[_0x1d64('0x22')](util[_0x1d64('0x25')](_0x1d64('0x34'),_0x1da36c,_0xc37494));};AGIChannel[_0x1d64('0x21')]['sayDigits']=function(_0xc7af92,_0x3d825c){return this[_0x1d64('0x22')](util[_0x1d64('0x25')](_0x1d64('0x35'),_0xc7af92,_0x3d825c));};AGIChannel['prototype'][_0x1d64('0x36')]=function(_0x4c923e,_0xa893d3){return this['sendRequest'](util['format'](_0x1d64('0x37'),_0x4c923e,_0xa893d3));};AGIChannel[_0x1d64('0x21')][_0x1d64('0x38')]=function(_0x21ab26,_0x2184cd,_0x2e319c){_0x2184cd=_0x2184cd||this[_0x1d64('0x39')];_0x2e319c=_0x2e319c||0x1;this[_0x1d64('0x2d')](_0x21ab26);this[_0x1d64('0x3a')](_0x2184cd);this[_0x1d64('0x2e')](_0x2e319c);return this[_0x1d64('0x27')](util[_0x1d64('0x25')](_0x1d64('0x3b'),_0x21ab26,_0x2184cd,_0x2e319c));};AGIChannel[_0x1d64('0x21')][_0x1d64('0x3c')]=function(_0x3d91f3){return this[_0x1d64('0x22')](util[_0x1d64('0x25')](_0x1d64('0x3d'),_0x3d91f3));};AGIChannel[_0x1d64('0x21')][_0x1d64('0x3e')]=function(_0x1b2d0b,_0x51fa1b,_0x5caf0d,_0xb2c565,_0x15a3f1,_0x2978c4){_0x51fa1b=_0x51fa1b||_0x1d64('0x3f');_0x5caf0d=_0x5caf0d||'';_0xb2c565=_0xb2c565===undefined?-0x1:_0xb2c565==='-1'?-0x1:_0xb2c565*0x3e8;_0x15a3f1=_0x15a3f1===undefined?'':'s='+_0x15a3f1;_0x2978c4=_0x2978c4?_0x1d64('0x40'):'';return this[_0x1d64('0x22')](util['format'](_0x1d64('0x41'),_0x1b2d0b,_0x51fa1b,_0x5caf0d,_0xb2c565,_0x2978c4,_0x15a3f1));};AGIChannel[_0x1d64('0x21')]['streamFile']=function(_0x45d753,_0x3b9e55){_0x3b9e55=_0x3b9e55||'';return this['sendRequest'](util[_0x1d64('0x25')](_0x1d64('0x42'),_0x45d753,_0x3b9e55));};AGIChannel[_0x1d64('0x21')][_0x1d64('0x43')]=function(_0x18acc7){return this[_0x1d64('0x2a')](_0x1d64('0x44'),_0x18acc7);};AGIChannel['prototype']['wait']=function(_0x4b89ea){return this[_0x1d64('0x2a')](_0x1d64('0x45'),_0x4b89ea);};AGIChannel[_0x1d64('0x21')]['error']=function(_0x39768c,_0x45489d){this[_0x1d64('0x27')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x39768c['id'],_0x39768c[_0x1d64('0x46')],_0x45489d));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1d64('0x47')]=AGIChannel;
\ No newline at end of file
index 5403d20..57dc632 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa930=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','apply','message','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.'];(function(_0x6d97b6,_0x17f11e){var _0x2a6d62=function(_0x1662d3){while(--_0x1662d3){_0x6d97b6['push'](_0x6d97b6['shift']());}};_0x2a6d62(++_0x17f11e);}(_0xa930,0x8d));var _0x0a93=function(_0x269c03,_0xf860b9){_0x269c03=_0x269c03-0x0;var _0xaff1da=_0xa930[_0x269c03];return _0xaff1da;};'use strict';var util=require(_0x0a93('0x0'));var error={'E_AGI_UNDEFINED':_0x0a93('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x0a93('0x2'),'E_AGI_SERVER_CLOSE':_0x0a93('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x0a93('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x0a93('0x5'),'E_AGI_SOCKET_ERROR':_0x0a93('0x6'),'E_AGI_SOCKET_CLOSE':_0x0a93('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x0a93('0x8'),'E_AGI_COMMAND_EMPTY':_0x0a93('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5cc120){var _0x5cc120=_0x5cc120||null,_0x239926=_0x239926||[],_0x5ddd79=0x1,_0x505dd6='';if(!error[_0x5cc120]){_0x5cc120=_0x0a93('0xa');}_0x239926['push'](error[_0x5cc120]);while(arguments[_0x5ddd79]){_0x239926[_0x0a93('0xb')](arguments[_0x5ddd79]);_0x5ddd79++;}_0x505dd6=util[_0x0a93('0xc')][_0x0a93('0xd')](util,_0x239926);this[_0x0a93('0xe')]=_0x505dd6;this[_0x0a93('0xf')]=_0x5cc120;}module['exports']=AGIError;
\ No newline at end of file
+var _0x9de4=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply'];(function(_0x560571,_0x17f93b){var _0xd8ea14=function(_0x353360){while(--_0x353360){_0x560571['push'](_0x560571['shift']());}};_0xd8ea14(++_0x17f93b);}(_0x9de4,0x112));var _0x49de=function(_0x366c4c,_0x549b95){_0x366c4c=_0x366c4c-0x0;var _0x2f9187=_0x9de4[_0x366c4c];return _0x2f9187;};'use strict';var util=require(_0x49de('0x0'));var error={'E_AGI_UNDEFINED':_0x49de('0x1'),'E_AGI_ARGUMENT_PORT':_0x49de('0x2'),'E_AGI_SERVER_ERROR':_0x49de('0x3'),'E_AGI_SERVER_CLOSE':_0x49de('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x49de('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x49de('0x6'),'E_AGI_SOCKET_ERROR':_0x49de('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x49de('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x49de('0x9'),'E_AGI_IVR_ENTRY':_0x49de('0xa')};function AGIError(_0x497761){var _0x497761=_0x497761||null,_0x5d8a7a=_0x5d8a7a||[],_0x35989c=0x1,_0x12cf27='';if(!error[_0x497761]){_0x497761='E_AGI_UNDEFINED';}_0x5d8a7a[_0x49de('0xb')](error[_0x497761]);while(arguments[_0x35989c]){_0x5d8a7a[_0x49de('0xb')](arguments[_0x35989c]);_0x35989c++;}_0x12cf27=util[_0x49de('0xc')][_0x49de('0xd')](util,_0x5d8a7a);this['message']=_0x12cf27;this[_0x49de('0xe')]=_0x497761;}module[_0x49de('0xf')]=AGIError;
\ No newline at end of file
index addb94e..d144033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6242=['addVertex','addEdge','size','relations','getVertex','traverseBFS','stop\x20traverse','length','info','no\x20edge/s\x20available','condition','agicommand','vswitch','target','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','vertices','edges','numberOfEdges','prototype'];(function(_0x166e5b,_0x4bc475){var _0x487733=function(_0x4dfd5e){while(--_0x4dfd5e){_0x166e5b['push'](_0x166e5b['shift']());}};_0x487733(++_0x4bc475);}(_0x6242,0x1a8));var _0x2624=function(_0x532730,_0x16b3c3){_0x532730=_0x532730-0x0;var _0x2c1bf8=_0x6242[_0x532730];return _0x2c1bf8;};'use strict';var _=require('lodash');var logger=require(_0x2624('0x0'))(_0x2624('0x1'));var verticesWithRetry=[_0x2624('0x2'),_0x2624('0x3'),'getsecretdigits'];var Graph=function(){this[_0x2624('0x4')]={};this[_0x2624('0x5')]={};this[_0x2624('0x6')]=0x0;};Graph[_0x2624('0x7')][_0x2624('0x8')]=function(_0x1ab7e8){this['vertices'][_0x1ab7e8['id']]=_0x1ab7e8;this['edges'][_0x1ab7e8['id']]=[];};Graph['prototype'][_0x2624('0x9')]=function(_0x1c1ff2,_0x5d8216,_0x473c4e){this[_0x2624('0x5')][_0x1c1ff2]['push']({'target':_0x5d8216,'condition':_0x473c4e});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0x2624('0xa')](this[_0x2624('0x4')]);};Graph[_0x2624('0x7')][_0x2624('0xb')]=function(){return this[_0x2624('0x6')];};Graph['prototype'][_0x2624('0xc')]=function(_0x49c01a){return this[_0x2624('0x4')][_0x49c01a];};Graph[_0x2624('0x7')][_0x2624('0xd')]=function(_0x5b9a41,_0xb22d86){if(!this[_0x2624('0x4')][_0x5b9a41]){return logger['info']('no\x20vertex\x20found');}var _0x3c4c61=_0xb22d86(this[_0x2624('0x4')][_0x5b9a41]);if(!_0x3c4c61){return logger['info'](_0x2624('0xe'));}if(this[_0x2624('0x5')][_0x5b9a41][_0x2624('0xf')]===0x0){return logger[_0x2624('0x10')](_0x2624('0x11'));}for(var _0x2ca130=0x0,_0x5149cb=[],_0x2a882a=![];_0x2ca130<this[_0x2624('0x5')][_0x5b9a41]['length'];_0x2ca130+=0x1){if(this['edges'][_0x5b9a41][_0x2ca130][_0x2624('0x12')]){_0x5149cb=this[_0x2624('0x5')][_0x5b9a41][_0x2ca130][_0x2624('0x12')]['split'](',');for(var _0xea7bc4=0x0;_0xea7bc4<_0x5149cb[_0x2624('0xf')];_0xea7bc4+=0x1){if(this[_0x2624('0x4')][_0x5b9a41][_0x2624('0x13')]===_0x2624('0x14')&&_0x5149cb[_0xea7bc4]==='-'){_0x2a882a=this[_0x2624('0x5')][_0x5b9a41][_0x2ca130][_0x2624('0x15')];logger['info']('default',_0x5149cb[_0xea7bc4],this['edges'][_0x5b9a41][_0x2ca130]['target']);}else if(this[_0x2624('0x4')][_0x5b9a41]['agicommand']===_0x2624('0x2')&&_0x5149cb[_0xea7bc4]==='i'){_0x2a882a=this['edges'][_0x5b9a41][_0x2ca130][_0x2624('0x15')];logger['info'](_0x2624('0x16'),_0x5149cb[_0xea7bc4],this[_0x2624('0x5')][_0x5b9a41][_0x2ca130]['target']);}if(_0x5149cb[_0xea7bc4]===_0x3c4c61){return this[_0x2624('0xd')](this[_0x2624('0x5')][_0x5b9a41][_0x2ca130][_0x2624('0x15')],_0xb22d86);}}}else{return this[_0x2624('0xd')](this[_0x2624('0x5')][_0x5b9a41][_0x2ca130][_0x2624('0x15')],_0xb22d86);}}if(_0x5149cb['length']){if(this[_0x2624('0x4')][_0x5b9a41][_0x2624('0x13')]==='vswitch'){if(_0x2a882a){return this[_0x2624('0xd')](_0x2a882a,_0xb22d86);}return logger[_0x2624('0x10')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x2624('0x17')](verticesWithRetry,this['vertices'][_0x5b9a41][_0x2624('0x13')])){if(_0x3c4c61==='-'){return logger[_0x2624('0x10')](_0x2624('0x18'));}if(_0x2a882a&&_0x3c4c61!=='t'){return this['traverseBFS'](_0x2a882a,_0xb22d86);}return this[_0x2624('0xd')](_0x5b9a41,_0xb22d86);}return logger[_0x2624('0x10')](_0x2624('0x19'));}};module[_0x2624('0x1a')]=Graph;
\ No newline at end of file
+var _0xfac9=['no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','default','target','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','traverseBFS','info'];(function(_0x5778d6,_0x1a1490){var _0xd2054b=function(_0x3102bb){while(--_0x3102bb){_0x5778d6['push'](_0x5778d6['shift']());}};_0xd2054b(++_0x1a1490);}(_0xfac9,0x1d0));var _0x9fac=function(_0x38ea0b,_0x3b2ddb){_0x38ea0b=_0x38ea0b-0x0;var _0x575d0a=_0xfac9[_0x38ea0b];return _0x575d0a;};'use strict';var _=require(_0x9fac('0x0'));var logger=require('../../../config/logger')(_0x9fac('0x1'));var verticesWithRetry=[_0x9fac('0x2'),'getdigits',_0x9fac('0x3')];var Graph=function(){this[_0x9fac('0x4')]={};this[_0x9fac('0x5')]={};this[_0x9fac('0x6')]=0x0;};Graph[_0x9fac('0x7')][_0x9fac('0x8')]=function(_0x2229b4){this[_0x9fac('0x4')][_0x2229b4['id']]=_0x2229b4;this[_0x9fac('0x5')][_0x2229b4['id']]=[];};Graph[_0x9fac('0x7')][_0x9fac('0x9')]=function(_0x5c5982,_0x4dd67d,_0x523780){this[_0x9fac('0x5')][_0x5c5982][_0x9fac('0xa')]({'target':_0x4dd67d,'condition':_0x523780});this[_0x9fac('0x6')]+=0x1;};Graph[_0x9fac('0x7')]['size']=function(){return _[_0x9fac('0xb')](this[_0x9fac('0x4')]);};Graph[_0x9fac('0x7')][_0x9fac('0xc')]=function(){return this[_0x9fac('0x6')];};Graph['prototype'][_0x9fac('0xd')]=function(_0x2b1242){return this[_0x9fac('0x4')][_0x2b1242];};Graph[_0x9fac('0x7')][_0x9fac('0xe')]=function(_0x514912,_0x5d7bf7){if(!this[_0x9fac('0x4')][_0x514912]){return logger[_0x9fac('0xf')](_0x9fac('0x10'));}var _0x4f194e=_0x5d7bf7(this['vertices'][_0x514912]);if(!_0x4f194e){return logger[_0x9fac('0xf')]('stop\x20traverse');}if(this['edges'][_0x514912][_0x9fac('0x11')]===0x0){return logger[_0x9fac('0xf')](_0x9fac('0x12'));}for(var _0x215291=0x0,_0x527575=[],_0xfee210=![];_0x215291<this[_0x9fac('0x5')][_0x514912]['length'];_0x215291+=0x1){if(this[_0x9fac('0x5')][_0x514912][_0x215291][_0x9fac('0x13')]){_0x527575=this[_0x9fac('0x5')][_0x514912][_0x215291][_0x9fac('0x13')][_0x9fac('0x14')](',');for(var _0x5b2d90=0x0;_0x5b2d90<_0x527575[_0x9fac('0x11')];_0x5b2d90+=0x1){if(this[_0x9fac('0x4')][_0x514912][_0x9fac('0x15')]===_0x9fac('0x16')&&_0x527575[_0x5b2d90]==='-'){_0xfee210=this['edges'][_0x514912][_0x215291]['target'];logger[_0x9fac('0xf')](_0x9fac('0x17'),_0x527575[_0x5b2d90],this[_0x9fac('0x5')][_0x514912][_0x215291][_0x9fac('0x18')]);}else if(this[_0x9fac('0x4')][_0x514912]['agicommand']===_0x9fac('0x2')&&_0x527575[_0x5b2d90]==='i'){_0xfee210=this[_0x9fac('0x5')][_0x514912][_0x215291][_0x9fac('0x18')];logger[_0x9fac('0xf')](_0x9fac('0x19'),_0x527575[_0x5b2d90],this['edges'][_0x514912][_0x215291]['target']);}if(_0x527575[_0x5b2d90]===_0x4f194e){return this['traverseBFS'](this[_0x9fac('0x5')][_0x514912][_0x215291][_0x9fac('0x18')],_0x5d7bf7);}}}else{return this[_0x9fac('0xe')](this[_0x9fac('0x5')][_0x514912][_0x215291][_0x9fac('0x18')],_0x5d7bf7);}}if(_0x527575[_0x9fac('0x11')]){if(this[_0x9fac('0x4')][_0x514912][_0x9fac('0x15')]===_0x9fac('0x16')){if(_0xfee210){return this[_0x9fac('0xe')](_0xfee210,_0x5d7bf7);}return logger[_0x9fac('0xf')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x9fac('0x1a')](verticesWithRetry,this[_0x9fac('0x4')][_0x514912][_0x9fac('0x15')])){if(_0x4f194e==='-'){return logger[_0x9fac('0xf')](_0x9fac('0x1b'));}if(_0xfee210&&_0x4f194e!=='t'){return this['traverseBFS'](_0xfee210,_0x5d7bf7);}return this[_0x9fac('0xe')](_0x514912,_0x5d7bf7);}return logger[_0x9fac('0xf')](_0x9fac('0x1c'));}};module[_0x9fac('0x1d')]=Graph;
\ No newline at end of file
index b44508f..a006fe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3850=['evtHangup','toJson','mxGraphModel','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','then','catch','createSquareReport','indexOf','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','production','start','debug','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','isUndefined','result','agicommand\x20not\x20found','finally','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','nextTick','stack','log','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x1867f6,_0xaddd14){var _0x2755f2=function(_0x2dd9a4){while(--_0x2dd9a4){_0x1867f6['push'](_0x1867f6['shift']());}};_0x2755f2(++_0xaddd14);}(_0x3850,0x1f2));var _0x0385=function(_0x20d43a,_0x2b1f4f){_0x20d43a=_0x20d43a-0x0;var _0x1fef13=_0x3850[_0x20d43a];return _0x1fef13;};'use strict';var parser=require('xml2json');var _=require(_0x0385('0x0'));var syncho=require(_0x0385('0x1'));var util=require(_0x0385('0x2'));var moment=require(_0x0385('0x3'));var config=require(_0x0385('0x4'));var logger=require(_0x0385('0x5'))(_0x0385('0x6'));var utilLicense=require(_0x0385('0x7'));var rpc=require('./rpc');var mailRpc=require(_0x0385('0x8'));var Graph=require(_0x0385('0x9'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0385('0x6')]=_['defaults'](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x5a8924){process[_0x0385('0xa')](function(){syncho(function(){try{setChannelVariables(_0x5a8924);agiHandler(_0x5a8924);}catch(_0x6538ff){logger['error'](_0x6538ff[_0x0385('0xb')]);}});});}function listeningHandler(){console[_0x0385('0xc')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x0385('0x6')][_0x0385('0xd')]);logger[_0x0385('0xe')](util['format'](_0x0385('0xf'),config[_0x0385('0x6')]['ip'],config[_0x0385('0x6')][_0x0385('0xd')]));}function errorHandler(_0x3e8080){if(_0x3e8080&&_0x3e8080[_0x0385('0x10')]&&_0x3e8080[_0x0385('0x11')]){logger[_0x0385('0x12')](util[_0x0385('0x13')](_0x0385('0x14'),_0x3e8080['name'],_0x3e8080[_0x0385('0x11')]));}else{logger[_0x0385('0x12')](util['format'](_0x0385('0x15'),_0x3e8080[_0x0385('0xb')]));}}function closeHandler(){logger[_0x0385('0xe')](util['format'](_0x0385('0x16'),this[_0x0385('0x17')],this[_0x0385('0x18')],this[_0x0385('0x19')],this[_0x0385('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x296169){logger[_0x0385('0x12')](_0x296169[_0x0385('0xb')]);}}function timeoutHandler(){logger[_0x0385('0xe')](util[_0x0385('0x13')](_0x0385('0x1b'),this[_0x0385('0x17')],this[_0x0385('0x18')],this[_0x0385('0x19')],this[_0x0385('0x1a')],this[_0x0385('0x1c')]));}function hangupHandler(){logger['info'](util[_0x0385('0x13')](_0x0385('0x1d'),this[_0x0385('0x17')],this[_0x0385('0x18')],this[_0x0385('0x19')],this['dnid'],this[_0x0385('0x1c')]));this[_0x0385('0x1e')]=!![];}function getRoot(_0x1abbaf){return parser[_0x0385('0x1f')](_0x1abbaf,{'object':!![]})[_0x0385('0x20')]['root'];}function addVertex(_0x5aafc9,_0x196e1b,_0x2fc01b){_0x196e1b['agicommand']=_0x2fc01b;if(_0x196e1b['hasOwnProperty'](_0x0385('0x21'))){_0x196e1b[_0x0385('0x22')]=parseInt(_0x196e1b[_0x0385('0x21')],0xa);}_0x5aafc9[_0x0385('0x23')](_[_0x0385('0x24')](_0x196e1b,_0x0385('0x25')));}function initGraph(_0x53fec7,_0x4094cb){var _0x36c65c=new Graph();for(var _0x508a72 in _0x53fec7){if(_0x53fec7[_0x0385('0x26')](_0x508a72)){if(_[_0x0385('0x27')](_0x53fec7[_0x508a72])){for(var _0x3f28da=0x0;_0x3f28da<_0x53fec7[_0x508a72]['length'];_0x3f28da+=0x1){addVertex(_0x36c65c,_0x53fec7[_0x508a72][_0x3f28da],_0x508a72);}}else{addVertex(_0x36c65c,_0x53fec7[_0x508a72],_0x508a72);}}}for(var _0x426fee=0x0;_0x426fee<_0x4094cb[_0x0385('0x28')];_0x426fee+=0x1){if(_0x4094cb[_0x426fee][_0x0385('0x29')]&&_0x4094cb[_0x426fee][_0x0385('0x2a')]){_0x36c65c[_0x0385('0x2b')](_0x4094cb[_0x426fee]['source'],_0x4094cb[_0x426fee][_0x0385('0x2a')],_0x4094cb[_0x426fee][_0x0385('0x2c')]);}}return _0x36c65c;}function getSquareProject(_0x305457,_0xf965e3){rpc['getSquareProject'](_0x305457)[_0x0385('0x2d')](function(_0x27768a){_0xf965e3(null,_0x27768a);})[_0x0385('0x2e')](function(_0x5d4312){_0xf965e3(null,_0x5d4312);});}function createSquareReport(_0x528ff8,_0x2d2b19){rpc[_0x0385('0x2f')](_0x528ff8)[_0x0385('0x2d')](function(_0x486c62){if(_0x2d2b19){_0x2d2b19(null,_0x486c62);}})[_0x0385('0x2e')](function(_0x38ea8c){if(_0x2d2b19){_0x2d2b19(null,_0x38ea8c);}});}function setChannelVariables(_0x1e3f09){for(var _0x2b73f1 in _0x1e3f09){if(_0x1e3f09[_0x0385('0x26')](_0x2b73f1)){if(_0x2b73f1[_0x0385('0x30')]('agi_')===0x0){_0x1e3f09[_0x2b73f1[_0x0385('0x31')](0x4)]=_0x1e3f09[_0x2b73f1];delete _0x1e3f09[_0x2b73f1];}}}}function getLogFromObject(_0x517c62){return util[_0x0385('0x32')](_0x517c62,{'showHidden':![],'depth':null});}function agiHandler(_0x376435){var _0x58ef73,_0x54a101,_0xfacb9e,_0x4dda80,_0xdf034b;logger['debug'](_0x0385('0x33'),JSON[_0x0385('0x34')](_0x376435,null,0x2));logger[_0x0385('0xe')](util['format'](_0x0385('0x35'),_0x376435[_0x0385('0x17')],_0x376435[_0x0385('0x18')],_0x376435[_0x0385('0x19')],_0x376435['dnid'],_0x376435[_0x0385('0x1c')]));_0x376435['on'](_0x0385('0x12'),errorHandler);_0x376435['on'](_0x0385('0x36'),closeHandler);_0x376435['on']('timeout',timeoutHandler);_0x376435[_0x0385('0x1e')]=![];_0x376435['on'](_0x0385('0x37'),hangupHandler);var _0x318d6f=getSquareProject['sync'](null,_0x376435[_0x0385('0x17')]);if(_0x318d6f){if(_0x318d6f[_0x0385('0x38')]){_0x58ef73=getRoot(_0x318d6f[_0x0385('0x38')]);if(_0x58ef73&&_0x58ef73[_0x0385('0x39')]){logger[_0x0385('0x3a')](_0x0385('0x3b'),JSON[_0x0385('0x34')](_0x58ef73,null,0x2));_0x376435[_0x0385('0x3c')]=moment()[_0x0385('0x13')](_0x0385('0x3d'));_0x54a101=initGraph(_[_0x0385('0x24')](_0x58ef73,_0x0385('0x25')),_0x58ef73[_0x0385('0x25')]);_0xfacb9e=new Vertices(_0x376435,rpc,mailRpc);logger[_0x0385('0xe')](util[_0x0385('0x13')](_0x0385('0x3e'),_0x376435[_0x0385('0x17')],_0x376435[_0x0385('0x18')],_0x376435[_0x0385('0x19')],_0x376435[_0x0385('0x1a')],_0x376435[_0x0385('0x1c')]));_0x54a101[_0x0385('0x3f')](_0x58ef73[_0x0385('0x39')]['id'],function(_0x3aafc0){try{_0x3aafc0=_0xfacb9e['clear'](_0x3aafc0);logger['debug'](_0x0385('0x40'),JSON['stringify'](_0x3aafc0,null,0x2));if(_0x3aafc0[_0x0385('0x41')]==='gotoc'){logger['info'](_0x0385('0x42'));_0x376435['context']=_0x3aafc0[_0x0385('0x43')]||_0x376435[_0x0385('0x43')];_0x376435[_0x0385('0x44')]=_0x3aafc0[_0x0385('0x44')];_0x376435[_0x0385('0x45')]=_0x3aafc0[_0x0385('0x45')]?_0x3aafc0[_0x0385('0x45')]-0x1:0x1;return null;}else if(_0x3aafc0&&_0xfacb9e[_0x3aafc0['agicommand']]){_0xdf034b=_0xfacb9e[_0x3aafc0['agicommand']](_0x3aafc0);logger['info'](_0x0385('0x46'),JSON[_0x0385('0x34')](_0xdf034b,null,0x2));if(_0xdf034b&&_0xdf034b['code']===AGI_CODE_SUCCESS&&_0xdf034b['result']!==AGI_RESULT_ERROR&&!_0x376435[_0x0385('0x1e')]){logger[_0x0385('0x3a')]('response',getLogFromObject(_0xdf034b));return _[_0x0385('0x47')](_0xdf034b['result'])?null:_0xdf034b[_0x0385('0x48')]['toString']();}else{logger['error']('response',getLogFromObject(_0xdf034b));return null;}}else{logger[_0x0385('0x12')](_0x0385('0x49'));return null;}}catch(_0x1b989d){logger[_0x0385('0x12')](_0x1b989d[_0x0385('0xb')]);return null;}});if(_0x58ef73[_0x0385('0x4a')]){logger['info'](util[_0x0385('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x376435['arg_1'],_0x376435['calleridname'],_0x376435[_0x0385('0x19')],_0x376435[_0x0385('0x1a')],_0x376435['uniqueid']));_0x54a101[_0x0385('0x3f')](_0x58ef73['finally']['id'],function(_0x3f4d98){try{_0x3f4d98=_0xfacb9e[_0x0385('0x4b')](_0x3f4d98);logger[_0x0385('0x3a')](_0x0385('0x40'),JSON[_0x0385('0x34')](_0x3f4d98,null,0x2));if(_0x3f4d98&&_0xfacb9e[_0x3f4d98[_0x0385('0x41')]]){_0xdf034b=_0xfacb9e[_0x3f4d98['agicommand']](_0x3f4d98);if(_0xdf034b){logger[_0x0385('0x3a')](_0x0385('0x46'),getLogFromObject(_0xdf034b));return _[_0x0385('0x47')](_0xdf034b[_0x0385('0x48')])?null:_0xdf034b[_0x0385('0x48')]['toString']();}else{logger[_0x0385('0x12')](_0x0385('0x46'),getLogFromObject(_0xdf034b));return null;}}else{logger[_0x0385('0x12')]('agicommand\x20not\x20found');return null;}}catch(_0x1bc4e5){logger[_0x0385('0x12')](_0x1bc4e5['stack']);return null;}});}logger['info'](util[_0x0385('0x13')](_0x0385('0x4c'),_0x376435['arg_1'],_0x376435[_0x0385('0x18')],_0x376435['callerid'],_0x376435[_0x0385('0x1a')],_0x376435[_0x0385('0x1c')]));logger[_0x0385('0xe')](util[_0x0385('0x13')](_0x0385('0x4d'),_0x376435[_0x0385('0x43')],_0x376435[_0x0385('0x44')],parseInt(_0x376435[_0x0385('0x45')],0xa)+0x1));_0x376435[_0x0385('0x4e')](_0x376435[_0x0385('0x43')],_0x376435[_0x0385('0x44')],parseInt(_0x376435[_0x0385('0x45')],0xa)+0x1);_0x376435[_0x0385('0x36')]();}}else{logger[_0x0385('0x12')](util['format']('Project\x20%s\x20not\x20published',_0x376435[_0x0385('0x17')]));_0x376435[_0x0385('0x4e')](_0x376435[_0x0385('0x43')],_0x376435[_0x0385('0x44')],parseInt(_0x376435['priority'],0xa)+0x1);_0x376435[_0x0385('0x36')]();}}else{logger[_0x0385('0x12')](util['format'](_0x0385('0x4f'),_0x376435[_0x0385('0x17')]));_0x376435['continueAt'](_0x376435[_0x0385('0x43')],_0x376435[_0x0385('0x44')],parseInt(_0x376435['priority'],0xa)+0x1);_0x376435[_0x0385('0x36')]();}}function main(){var _0x30224a;return utilLicense[_0x0385('0x50')]()[_0x0385('0x2d')](function(_0x244426){if(_0x244426){if(_0x244426[_0x0385('0x51')]){if(_0x244426['callysquare']&&_0x244426[_0x0385('0x52')]>0x0){logger[_0x0385('0xe')](util[_0x0385('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x244426['callysquare']));_0x30224a=_0x244426['callysquare'];}else{logger[_0x0385('0xe')](_0x0385('0x53'));}}else{logger['info'](_0x0385('0x54'));_0x30224a=-0x1;}}})[_0x0385('0x2e')](function(_0x23f1a7){logger[_0x0385('0x12')](_0x0385('0x55'),_0x23f1a7[_0x0385('0xb')]);})[_0x0385('0x4a')](function(){var _0x4824e1=require(_0x0385('0x56'))(config[_0x0385('0x6')][_0x0385('0xd')],config[_0x0385('0x6')]['ip'],_0x30224a);_0x4824e1['on'](_0x0385('0x12'),errorHandler);_0x4824e1['on'](_0x0385('0x57'),listeningHandler);_0x4824e1['on']('connection',connectionHandler);_0x4824e1['on'](_0x0385('0x36'),closeHandler);});}main();
\ No newline at end of file
+var _0x840a=['toJson','mxGraphModel','root','agicommand','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','getSquareProject','then','createSquareReport','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','agicommand\x20not\x20found','finally','traverseBFS','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','./server','listening','connection','lodash','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./graph','127.0.0.1','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','name','message','[%s]\x20%s','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','info','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup'];(function(_0x181478,_0x3138d4){var _0xfce542=function(_0x267b4a){while(--_0x267b4a){_0x181478['push'](_0x181478['shift']());}};_0xfce542(++_0x3138d4);}(_0x840a,0x1df));var _0xa840=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x840a[_0x2641f9];return _0x585741;};'use strict';var parser=require('xml2json');var _=require(_0xa840('0x0'));var syncho=require(_0xa840('0x1'));var util=require('util');var moment=require('moment');var config=require(_0xa840('0x2'));var logger=require(_0xa840('0x3'))(_0xa840('0x4'));var utilLicense=require(_0xa840('0x5'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xa840('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xa840('0x4')]=_['defaults'](config['agi'],{'ip':_0xa840('0x7'),'port':0x11dd});function connectionHandler(_0x3a237a){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3a237a);agiHandler(_0x3a237a);}catch(_0x2bcf9c){logger[_0xa840('0x8')](_0x2bcf9c[_0xa840('0x9')]);}});});}function listeningHandler(){console['log'](_0xa840('0xa'),config[_0xa840('0x4')][_0xa840('0xb')]);logger['info'](util[_0xa840('0xc')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi'][_0xa840('0xb')]));}function errorHandler(_0x14f962){if(_0x14f962&&_0x14f962[_0xa840('0xd')]&&_0x14f962[_0xa840('0xe')]){logger[_0xa840('0x8')](util['format'](_0xa840('0xf'),_0x14f962['name'],_0x14f962[_0xa840('0xe')]));}else{logger[_0xa840('0x8')](util[_0xa840('0xc')](_0xa840('0x10'),_0x14f962[_0xa840('0x9')]));}}function closeHandler(){logger['info'](util[_0xa840('0xc')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xa840('0x11')],this[_0xa840('0x12')],this[_0xa840('0x13')],this[_0xa840('0x14')],this[_0xa840('0x15')]));try{createSquareReport(this);}catch(_0x3c776d){logger['error'](_0x3c776d[_0xa840('0x9')]);}}function timeoutHandler(){logger[_0xa840('0x16')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xa840('0x12')],this[_0xa840('0x13')],this['dnid'],this[_0xa840('0x15')]));}function hangupHandler(){logger[_0xa840('0x16')](util['format'](_0xa840('0x17'),this[_0xa840('0x11')],this[_0xa840('0x12')],this[_0xa840('0x13')],this['dnid'],this[_0xa840('0x15')]));this[_0xa840('0x18')]=!![];}function getRoot(_0x141515){return parser[_0xa840('0x19')](_0x141515,{'object':!![]})[_0xa840('0x1a')][_0xa840('0x1b')];}function addVertex(_0x46d451,_0x125d5e,_0x4c1c56){_0x125d5e[_0xa840('0x1c')]=_0x4c1c56;if(_0x125d5e['hasOwnProperty']('retry')){_0x125d5e[_0xa840('0x1d')]=parseInt(_0x125d5e['retry'],0xa);}_0x46d451[_0xa840('0x1e')](_[_0xa840('0x1f')](_0x125d5e,_0xa840('0x20')));}function initGraph(_0x567ed7,_0x1a0702){var _0x5a5b05=new Graph();for(var _0x444d39 in _0x567ed7){if(_0x567ed7['hasOwnProperty'](_0x444d39)){if(_['isArray'](_0x567ed7[_0x444d39])){for(var _0x2c3f30=0x0;_0x2c3f30<_0x567ed7[_0x444d39][_0xa840('0x21')];_0x2c3f30+=0x1){addVertex(_0x5a5b05,_0x567ed7[_0x444d39][_0x2c3f30],_0x444d39);}}else{addVertex(_0x5a5b05,_0x567ed7[_0x444d39],_0x444d39);}}}for(var _0x32aad2=0x0;_0x32aad2<_0x1a0702['length'];_0x32aad2+=0x1){if(_0x1a0702[_0x32aad2][_0xa840('0x22')]&&_0x1a0702[_0x32aad2][_0xa840('0x23')]){_0x5a5b05[_0xa840('0x24')](_0x1a0702[_0x32aad2][_0xa840('0x22')],_0x1a0702[_0x32aad2][_0xa840('0x23')],_0x1a0702[_0x32aad2]['value']);}}return _0x5a5b05;}function getSquareProject(_0xd94c08,_0x2fded7){rpc[_0xa840('0x25')](_0xd94c08)[_0xa840('0x26')](function(_0x15e5ac){_0x2fded7(null,_0x15e5ac);})['catch'](function(_0x415690){_0x2fded7(null,_0x415690);});}function createSquareReport(_0x577430,_0x134ccb){rpc[_0xa840('0x27')](_0x577430)[_0xa840('0x26')](function(_0x2301e6){if(_0x134ccb){_0x134ccb(null,_0x2301e6);}})['catch'](function(_0x17fe52){if(_0x134ccb){_0x134ccb(null,_0x17fe52);}});}function setChannelVariables(_0x4b4c05){for(var _0x5548af in _0x4b4c05){if(_0x4b4c05[_0xa840('0x28')](_0x5548af)){if(_0x5548af[_0xa840('0x29')](_0xa840('0x2a'))===0x0){_0x4b4c05[_0x5548af[_0xa840('0x2b')](0x4)]=_0x4b4c05[_0x5548af];delete _0x4b4c05[_0x5548af];}}}}function getLogFromObject(_0x3bbaa2){return util['inspect'](_0x3bbaa2,{'showHidden':![],'depth':null});}function agiHandler(_0x30a78c){var _0x390f26,_0x4a1b55,_0x57231c,_0x5dc5e4,_0x2109b3;logger[_0xa840('0x2c')](_0xa840('0x2d'),JSON[_0xa840('0x2e')](_0x30a78c,null,0x2));logger[_0xa840('0x16')](util['format'](_0xa840('0x2f'),_0x30a78c[_0xa840('0x11')],_0x30a78c['calleridname'],_0x30a78c['callerid'],_0x30a78c['dnid'],_0x30a78c[_0xa840('0x15')]));_0x30a78c['on'](_0xa840('0x8'),errorHandler);_0x30a78c['on']('close',closeHandler);_0x30a78c['on'](_0xa840('0x30'),timeoutHandler);_0x30a78c['evtHangup']=![];_0x30a78c['on'](_0xa840('0x31'),hangupHandler);var _0x55ca9c=getSquareProject[_0xa840('0x32')](null,_0x30a78c[_0xa840('0x11')]);if(_0x55ca9c){if(_0x55ca9c[_0xa840('0x33')]){_0x390f26=getRoot(_0x55ca9c[_0xa840('0x33')]);if(_0x390f26&&_0x390f26[_0xa840('0x34')]){logger[_0xa840('0x2c')](_0xa840('0x1b'),JSON['stringify'](_0x390f26,null,0x2));_0x30a78c['joinAt']=moment()[_0xa840('0xc')](_0xa840('0x35'));_0x4a1b55=initGraph(_['omit'](_0x390f26,_0xa840('0x20')),_0x390f26[_0xa840('0x20')]);_0x57231c=new Vertices(_0x30a78c,rpc,mailRpc);logger[_0xa840('0x16')](util[_0xa840('0xc')](_0xa840('0x36'),_0x30a78c['arg_1'],_0x30a78c[_0xa840('0x12')],_0x30a78c[_0xa840('0x13')],_0x30a78c['dnid'],_0x30a78c[_0xa840('0x15')]));_0x4a1b55['traverseBFS'](_0x390f26['start']['id'],function(_0x3246eb){try{_0x3246eb=_0x57231c[_0xa840('0x37')](_0x3246eb);logger[_0xa840('0x2c')](_0xa840('0x38'),JSON[_0xa840('0x2e')](_0x3246eb,null,0x2));if(_0x3246eb[_0xa840('0x1c')]===_0xa840('0x39')){logger[_0xa840('0x16')](_0xa840('0x3a'));_0x30a78c[_0xa840('0x3b')]=_0x3246eb[_0xa840('0x3b')]||_0x30a78c['context'];_0x30a78c[_0xa840('0x3c')]=_0x3246eb['extension'];_0x30a78c[_0xa840('0x3d')]=_0x3246eb[_0xa840('0x3d')]?_0x3246eb['priority']-0x1:0x1;return null;}else if(_0x3246eb&&_0x57231c[_0x3246eb[_0xa840('0x1c')]]){_0x2109b3=_0x57231c[_0x3246eb[_0xa840('0x1c')]](_0x3246eb);logger[_0xa840('0x16')](_0xa840('0x3e'),JSON['stringify'](_0x2109b3,null,0x2));if(_0x2109b3&&_0x2109b3[_0xa840('0x3f')]===AGI_CODE_SUCCESS&&_0x2109b3['result']!==AGI_RESULT_ERROR&&!_0x30a78c['evtHangup']){logger[_0xa840('0x2c')]('response',getLogFromObject(_0x2109b3));return _['isUndefined'](_0x2109b3[_0xa840('0x40')])?null:_0x2109b3[_0xa840('0x40')]['toString']();}else{logger['error'](_0xa840('0x3e'),getLogFromObject(_0x2109b3));return null;}}else{logger[_0xa840('0x8')](_0xa840('0x41'));return null;}}catch(_0x180f79){logger[_0xa840('0x8')](_0x180f79[_0xa840('0x9')]);return null;}});if(_0x390f26[_0xa840('0x42')]){logger[_0xa840('0x16')](util[_0xa840('0xc')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x30a78c['arg_1'],_0x30a78c[_0xa840('0x12')],_0x30a78c[_0xa840('0x13')],_0x30a78c[_0xa840('0x14')],_0x30a78c['uniqueid']));_0x4a1b55[_0xa840('0x43')](_0x390f26[_0xa840('0x42')]['id'],function(_0x47b852){try{_0x47b852=_0x57231c[_0xa840('0x37')](_0x47b852);logger['debug'](_0xa840('0x38'),JSON[_0xa840('0x2e')](_0x47b852,null,0x2));if(_0x47b852&&_0x57231c[_0x47b852['agicommand']]){_0x2109b3=_0x57231c[_0x47b852[_0xa840('0x1c')]](_0x47b852);if(_0x2109b3){logger[_0xa840('0x2c')]('response',getLogFromObject(_0x2109b3));return _[_0xa840('0x44')](_0x2109b3[_0xa840('0x40')])?null:_0x2109b3[_0xa840('0x40')]['toString']();}else{logger[_0xa840('0x8')](_0xa840('0x3e'),getLogFromObject(_0x2109b3));return null;}}else{logger[_0xa840('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x1740ff){logger[_0xa840('0x8')](_0x1740ff[_0xa840('0x9')]);return null;}});}logger[_0xa840('0x16')](util[_0xa840('0xc')](_0xa840('0x45'),_0x30a78c[_0xa840('0x11')],_0x30a78c[_0xa840('0x12')],_0x30a78c[_0xa840('0x13')],_0x30a78c[_0xa840('0x14')],_0x30a78c['uniqueid']));logger[_0xa840('0x16')](util[_0xa840('0xc')](_0xa840('0x46'),_0x30a78c['context'],_0x30a78c[_0xa840('0x3c')],parseInt(_0x30a78c[_0xa840('0x3d')],0xa)+0x1));_0x30a78c[_0xa840('0x47')](_0x30a78c['context'],_0x30a78c[_0xa840('0x3c')],parseInt(_0x30a78c[_0xa840('0x3d')],0xa)+0x1);_0x30a78c[_0xa840('0x48')]();}}else{logger[_0xa840('0x8')](util[_0xa840('0xc')](_0xa840('0x49'),_0x30a78c[_0xa840('0x11')]));_0x30a78c['continueAt'](_0x30a78c[_0xa840('0x3b')],_0x30a78c['extension'],parseInt(_0x30a78c[_0xa840('0x3d')],0xa)+0x1);_0x30a78c['close']();}}else{logger[_0xa840('0x8')](util[_0xa840('0xc')](_0xa840('0x4a'),_0x30a78c['arg_1']));_0x30a78c[_0xa840('0x47')](_0x30a78c[_0xa840('0x3b')],_0x30a78c[_0xa840('0x3c')],parseInt(_0x30a78c['priority'],0xa)+0x1);_0x30a78c['close']();}}function main(){var _0x55abf7;return utilLicense['getLicense']()[_0xa840('0x26')](function(_0xac0acf){if(_0xac0acf){if(_0xac0acf[_0xa840('0x4b')]){if(_0xac0acf['callysquare']&&_0xac0acf[_0xa840('0x4c')]>0x0){logger[_0xa840('0x16')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0xac0acf[_0xa840('0x4c')]));_0x55abf7=_0xac0acf[_0xa840('0x4c')];}else{logger['info'](_0xa840('0x4d'));}}else{logger[_0xa840('0x16')](_0xa840('0x4e'));_0x55abf7=-0x1;}}})[_0xa840('0x4f')](function(_0x1652d7){logger[_0xa840('0x8')](_0xa840('0x50'),_0x1652d7[_0xa840('0x9')]);})[_0xa840('0x42')](function(){var _0x16390b=require(_0xa840('0x51'))(config['agi'][_0xa840('0xb')],config[_0xa840('0x4')]['ip'],_0x55abf7);_0x16390b['on'](_0xa840('0x8'),errorHandler);_0x16390b['on'](_0xa840('0x52'),listeningHandler);_0x16390b['on'](_0xa840('0x53'),connectionHandler);_0x16390b['on']('close',closeHandler);});}main();
\ No newline at end of file
index f424673..acadd61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fa8=['message','result','catch','sendMailMessage','SendMail','bluebird','then','error'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0x2fa8,0xa5));var _0x82fa=function(_0x3be12b,_0x1c073b){_0x3be12b=_0x3be12b-0x0;var _0x122bf3=_0x2fa8[_0x3be12b];return _0x122bf3;};'use strict';var BPromise=require(_0x82fa('0x0'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x1bf939,_0x3f4fdc){return new BPromise(function(_0x370cd3,_0x208d50){return client['request'](_0x1bf939,_0x3f4fdc)[_0x82fa('0x1')](function(_0x22c190){if(_0x22c190[_0x82fa('0x2')]){return _0x208d50(_0x22c190[_0x82fa('0x2')][_0x82fa('0x3')]);}else{return _0x370cd3(_0x22c190[_0x82fa('0x4')]);}})[_0x82fa('0x5')](function(_0x541af7){return _0x208d50(_0x541af7);});});}exports[_0x82fa('0x6')]=function(_0x466f44,_0x3d393c){return request(_0x82fa('0x7'),{'account':_0x466f44,'message':_0x3d393c});};
\ No newline at end of file
+var _0xed86=['sendMailMessage','SendMail','bluebird','request','then','error','result','catch'];(function(_0x26b844,_0x4b4670){var _0x5f5276=function(_0x120f56){while(--_0x120f56){_0x26b844['push'](_0x26b844['shift']());}};_0x5f5276(++_0x4b4670);}(_0xed86,0x1ba));var _0x6ed8=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xed86[_0x5783f4];return _0x28e380;};'use strict';var BPromise=require(_0x6ed8('0x0'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x4dadbe,_0xab647a){return new BPromise(function(_0x4dfd55,_0x328876){return client[_0x6ed8('0x1')](_0x4dadbe,_0xab647a)[_0x6ed8('0x2')](function(_0x1efed0){if(_0x1efed0[_0x6ed8('0x3')]){return _0x328876(_0x1efed0[_0x6ed8('0x3')]['message']);}else{return _0x4dfd55(_0x1efed0[_0x6ed8('0x4')]);}})[_0x6ed8('0x5')](function(_0xff3af){return _0x328876(_0xff3af);});});}exports[_0x6ed8('0x6')]=function(_0x424539,_0x2a6eda){return request(_0x6ed8('0x7'),{'account':_0x424539,'message':_0x2a6eda});};
\ No newline at end of file
index baaad4e..99c8765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09ac=['_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','substring','length','indexOf','slice','trim','emit','headers','exports','stream','Transform'];(function(_0x29e298,_0x2f5fe8){var _0x1efa54=function(_0x308f11){while(--_0x308f11){_0x29e298['push'](_0x29e298['shift']());}};_0x1efa54(++_0x2f5fe8);}(_0x09ac,0x14e));var _0xc09a=function(_0x18d36f,_0x31b65f){_0x18d36f=_0x18d36f-0x0;var _0x10034d=_0x09ac[_0x18d36f];return _0x10034d;};'use strict';var util=require('util');var Transform=require(_0xc09a('0x0'))[_0xc09a('0x1')];function AGIReply(_0x1d7340){Transform['call'](this,_0x1d7340);this[_0xc09a('0x2')]='';this[_0xc09a('0x3')]=![];}util[_0xc09a('0x4')](AGIReply,Transform);AGIReply[_0xc09a('0x5')]['_transform']=function(_0x316fbf,_0x3c8766,_0x4ab14a){var _0x4992d3='\x0a',_0x5db0b9=['\x0a\x0a',_0xc09a('0x6')],_0x209af2=-0x1,_0x3c5c92=-0x1,_0x142dc7='',_0x4d968b=0x0,_0x2a1264='',_0x665f14='';this[_0xc09a('0x2')]+=_0x316fbf[_0xc09a('0x7')]();_0x2a1264=this[_0xc09a('0x2')];if(!this[_0xc09a('0x3')]){_0x4d968b=0x0;while(_0x5db0b9[_0x4d968b]){while((_0x3c5c92=_0x2a1264['indexOf'](_0x5db0b9[_0x4d968b]))!=-0x1){_0x142dc7=_0x5db0b9[_0x4d968b];_0x665f14=_0x2a1264[_0xc09a('0x8')](0x0,_0x3c5c92);_0x2a1264=_0x2a1264[_0xc09a('0x8')](_0x3c5c92+_0x142dc7[_0xc09a('0x9')]);var _0x11be5e=_0x665f14['split'](_0x4992d3),_0x6ec065=0x0,_0x1a2558={},_0x3d8828='',_0x1e7c6a='',_0x1fecca=-0x1;while(_0x11be5e[_0x6ec065]){_0x1fecca=_0x11be5e[_0x6ec065][_0xc09a('0xa')](':');if(_0x1fecca!=-0x1){_0x3d8828=_0x11be5e[_0x6ec065][_0xc09a('0xb')](0x0,_0x1fecca)[_0xc09a('0xc')]();_0x1e7c6a=_0x11be5e[_0x6ec065][_0xc09a('0xb')](_0x1fecca+0x1)[_0xc09a('0xc')]();if(_0x3d8828['length']>0x0){_0x1a2558[_0x3d8828]=_0x1e7c6a;}}else{}_0x6ec065++;}this[_0xc09a('0xd')](_0xc09a('0xe'),_0x1a2558);this[_0xc09a('0x3')]=!![];}_0x4d968b++;}this[_0xc09a('0x2')]=_0x2a1264;}else{while((_0x209af2=_0x2a1264[_0xc09a('0xa')](_0x4992d3))!=-0x1){_0x665f14=_0x2a1264[_0xc09a('0x8')](0x0,_0x209af2);this[_0xc09a('0xd')]('line',_0x665f14);_0x2a1264=_0x2a1264[_0xc09a('0x8')](_0x209af2+_0x4992d3[_0xc09a('0x9')]);}this[_0xc09a('0x2')]=_0x2a1264;}_0x4ab14a();};module[_0xc09a('0xf')]=AGIReply;
\ No newline at end of file
+var _0xa45c=['_inBody','prototype','_localBuffer','toString','indexOf','substring','split','trim','length','emit','headers','util','stream','call'];(function(_0x56fe80,_0x185e4c){var _0x48f28d=function(_0x403097){while(--_0x403097){_0x56fe80['push'](_0x56fe80['shift']());}};_0x48f28d(++_0x185e4c);}(_0xa45c,0x6d));var _0xca45=function(_0x4346bf,_0x4ddc61){_0x4346bf=_0x4346bf-0x0;var _0x3541f9=_0xa45c[_0x4346bf];return _0x3541f9;};'use strict';var util=require(_0xca45('0x0'));var Transform=require(_0xca45('0x1'))['Transform'];function AGIReply(_0x5c97e0){Transform[_0xca45('0x2')](this,_0x5c97e0);this['_localBuffer']='';this[_0xca45('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xca45('0x4')]['_transform']=function(_0x4d45e6,_0x33a162,_0x3803d6){var _0x18d789='\x0a',_0x15628b=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x578a7b=-0x1,_0x1a8b9c=-0x1,_0x276897='',_0x7ceab1=0x0,_0x307649='',_0x312400='';this[_0xca45('0x5')]+=_0x4d45e6[_0xca45('0x6')]();_0x307649=this[_0xca45('0x5')];if(!this[_0xca45('0x3')]){_0x7ceab1=0x0;while(_0x15628b[_0x7ceab1]){while((_0x1a8b9c=_0x307649[_0xca45('0x7')](_0x15628b[_0x7ceab1]))!=-0x1){_0x276897=_0x15628b[_0x7ceab1];_0x312400=_0x307649[_0xca45('0x8')](0x0,_0x1a8b9c);_0x307649=_0x307649[_0xca45('0x8')](_0x1a8b9c+_0x276897['length']);var _0x643942=_0x312400[_0xca45('0x9')](_0x18d789),_0x360ee9=0x0,_0x44a6cc={},_0x17ebf7='',_0x580c43='',_0x3044b1=-0x1;while(_0x643942[_0x360ee9]){_0x3044b1=_0x643942[_0x360ee9][_0xca45('0x7')](':');if(_0x3044b1!=-0x1){_0x17ebf7=_0x643942[_0x360ee9]['slice'](0x0,_0x3044b1)[_0xca45('0xa')]();_0x580c43=_0x643942[_0x360ee9]['slice'](_0x3044b1+0x1)[_0xca45('0xa')]();if(_0x17ebf7[_0xca45('0xb')]>0x0){_0x44a6cc[_0x17ebf7]=_0x580c43;}}else{}_0x360ee9++;}this[_0xca45('0xc')](_0xca45('0xd'),_0x44a6cc);this[_0xca45('0x3')]=!![];}_0x7ceab1++;}this[_0xca45('0x5')]=_0x307649;}else{while((_0x578a7b=_0x307649[_0xca45('0x7')](_0x18d789))!=-0x1){_0x312400=_0x307649['substring'](0x0,_0x578a7b);this[_0xca45('0xc')]('line',_0x312400);_0x307649=_0x307649['substring'](_0x578a7b+_0x18d789[_0xca45('0xb')]);}this[_0xca45('0x5')]=_0x307649;}_0x3803d6();};module['exports']=AGIReply;
\ No newline at end of file
index fa34caf..05166ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe002=['moment','lodash','jayson/promise','client','http','request','then','error','result','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','ShowSound','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xe002,0xf7));var _0x2e00=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0xe002[_0x578275];return _0xf78041;};'use strict';var BPromise=require(_0x2e00('0x0'));var moment=require(_0x2e00('0x1'));var _=require(_0x2e00('0x2'));var util=require('util');var jayson=require(_0x2e00('0x3'));var client=jayson[_0x2e00('0x4')][_0x2e00('0x5')]({'port':0x2329});function request(_0x5ea0f5,_0x34f964){return new BPromise(function(_0xba44f2,_0x2cb0ac){return client[_0x2e00('0x6')](_0x5ea0f5,_0x34f964)[_0x2e00('0x7')](function(_0x120155){if(_0x120155[_0x2e00('0x8')]){return _0x2cb0ac(_0x120155[_0x2e00('0x8')]['message']);}else{return _0xba44f2(_0x120155[_0x2e00('0x9')]);}})[_0x2e00('0xa')](function(_0x4d0161){return _0x2cb0ac(_0x4d0161);});});}exports[_0x2e00('0xb')]=function(_0x32b5f7){return request(_0x2e00('0xc'),{'options':{'raw':![],'where':{'name':_0x32b5f7},'attributes':[_0x2e00('0xd')]}});};exports['getMailAccountById']=function(_0x5dc42f){return request(_0x2e00('0xe'),{'options':{'raw':![],'where':{'id':_0x5dc42f},'include':[{'model':_0x2e00('0xf'),'as':_0x2e00('0x10')}],'attributes':['id','name',_0x2e00('0x11')]}});};exports[_0x2e00('0x12')]=function(_0x16a84b){return request(_0x2e00('0xc'),{'options':{'where':{'id':_0x16a84b},'attributes':[_0x2e00('0x13')]}});};exports['getVoiceQueueById']=function(_0x49d5f5){return request(_0x2e00('0x14'),{'options':{'where':{'id':_0x49d5f5},'attributes':[_0x2e00('0x13')]}});};exports[_0x2e00('0x15')]=function(_0x24c603){return request(_0x2e00('0x16'),{'options':{'where':{'id':_0x24c603},'attributes':['name']}});};exports[_0x2e00('0x17')]=function(_0x53a6fa){return request(_0x2e00('0x18'),{'options':{'where':{'id':_0x53a6fa},'attributes':[_0x2e00('0x19')]}});};exports['getUserById']=function(_0x5b46b4){return request(_0x2e00('0x1a'),{'options':{'where':{'id':_0x5b46b4},'attributes':[_0x2e00('0x13')]}});};exports[_0x2e00('0x1b')]=function(_0x4be341){return request(_0x2e00('0x1c'),{'options':{'where':{'phone':_0x4be341[_0x2e00('0x1d')]},'attributes':['id']}});};exports['getTrunkById']=function(_0xa19ca1){return request(_0x2e00('0x1e'),{'options':{'where':{'id':_0xa19ca1},'attributes':[_0x2e00('0x13')]}});};exports['getSoundById']=function(_0x280804){return request(_0x2e00('0x1f'),{'options':{'where':{'id':_0x280804},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x4fcc7a){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4fcc7a},'include':[{'model':_0x2e00('0x20'),'as':_0x2e00('0x21')}]}});};exports[_0x2e00('0x22')]=function(_0x5f2e5d){return request(_0x2e00('0x23'),{'options':{'where':{'id':_0x5f2e5d},'attributes':['id',_0x2e00('0x13')]}});};exports[_0x2e00('0x24')]=function(_0x465af0){return request(_0x2e00('0x25'),{'body':_0x465af0});};exports[_0x2e00('0x26')]=function(_0x415b6f){return request(_0x2e00('0x27'),{'body':_0x415b6f});};exports[_0x2e00('0x28')]=function(_0x172967){return request(_0x2e00('0x29'),{'body':_[_0x2e00('0x2a')](_0x172967,{'project_name':_0x172967[_0x2e00('0x2b')],'prev_project_name':_0x172967[_0x2e00('0x2c')]||'','is_subproject':_0x172967[_0x2e00('0x2c')]?!![]:![],'leaveAt':moment()[_0x2e00('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x2e00('0x2e')]=function(_0x102faa){return request(_0x2e00('0x2f'),{'body':_0x102faa});};exports['createSquareMessage']=function(_0x378ea8){return request(_0x2e00('0x30'),{'body':_0x378ea8});};exports[_0x2e00('0x31')]=function(_0x3e9a6c){return request(_0x2e00('0x32'),{'options':{'raw':![],'where':{'phone':_0x3e9a6c['phone'],'ListId':_0x3e9a6c[_0x2e00('0x33')]}}})['then'](function(_0x133967){if(_0x133967){return _0x133967;}return request('CreateCmContact',{'body':_0x3e9a6c});});};exports[_0x2e00('0x34')]=function(_0x5e9eed){return request(_0x2e00('0x35'),{'options':{'where':{'id':_0x5e9eed},'attributes':[_0x2e00('0x13')]}});};exports[_0x2e00('0x36')]=function(_0x5bc611,_0x2eebed){return request(_0x2e00('0x37'),{'body':{'interface':_0x2eebed},'options':{'where':_0x5bc611}});};exports[_0x2e00('0x38')]=function(_0x35c411,_0x3b849e,_0x4b1fbd){return request(_0x2e00('0x39'),{'body':{'type':_0x3b849e,'uniqueid':_0x4b1fbd},'options':{'where':_0x35c411}});};exports[_0x2e00('0x3a')]=function(_0x2b78bc){return request(_0x2e00('0x3b'),{'body':{},'options':{'where':_0x2b78bc}});};exports[_0x2e00('0x3c')]=function(_0x6ffcd6){return request(_0x2e00('0x3d'),{'body':{},'options':{'where':_0x6ffcd6}});};
\ No newline at end of file
+var _0xa14a=['ShowMailAccount','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Intervals','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','util','jayson/promise','http','request','then','error','message','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById'];(function(_0x5a9841,_0x950566){var _0xb4f748=function(_0xdecea8){while(--_0xdecea8){_0x5a9841['push'](_0x5a9841['shift']());}};_0xb4f748(++_0x950566);}(_0xa14a,0x64));var _0xaa14=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xa14a[_0x2aec52];return _0x3b8835;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xaa14('0x0'));var util=require(_0xaa14('0x1'));var jayson=require(_0xaa14('0x2'));var client=jayson['client'][_0xaa14('0x3')]({'port':0x2329});function request(_0x2295a5,_0x10b8e2){return new BPromise(function(_0x4c8327,_0x42f2b1){return client[_0xaa14('0x4')](_0x2295a5,_0x10b8e2)[_0xaa14('0x5')](function(_0x246e62){if(_0x246e62[_0xaa14('0x6')]){return _0x42f2b1(_0x246e62[_0xaa14('0x6')][_0xaa14('0x7')]);}else{return _0x4c8327(_0x246e62['result']);}})[_0xaa14('0x8')](function(_0x5819e8){return _0x42f2b1(_0x5819e8);});});}exports[_0xaa14('0x9')]=function(){return request(_0xaa14('0xa'),{'options':{'raw':![],'attributes':['id',_0xaa14('0xb'),'production']}});};exports[_0xaa14('0xc')]=function(_0x75561e){return request(_0xaa14('0xd'),{'options':{'raw':![],'where':{'name':_0x75561e},'attributes':[_0xaa14('0xe')]}});};exports[_0xaa14('0xf')]=function(_0x5a240c){return request(_0xaa14('0x10'),{'options':{'raw':![],'where':{'id':_0x5a240c},'include':[{'model':'MailServerOut','as':_0xaa14('0x11'),'include':[{'model':_0xaa14('0x12'),'as':_0xaa14('0x12')}]}],'attributes':['id','name',_0xaa14('0x13')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x505b59){return request(_0xaa14('0xd'),{'options':{'where':{'id':_0x505b59},'attributes':[_0xaa14('0xb')]}});};exports[_0xaa14('0x14')]=function(_0x3a9a2a){return request(_0xaa14('0x15'),{'options':{'where':{'id':_0x3a9a2a},'attributes':[_0xaa14('0xb')]}});};exports[_0xaa14('0x16')]=function(_0x427273){return request(_0xaa14('0x17'),{'options':{'where':{'id':_0x427273},'attributes':[_0xaa14('0xb')]}});};exports[_0xaa14('0x18')]=function(_0x4d8722){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x4d8722},'attributes':[_0xaa14('0x19')]}});};exports[_0xaa14('0x1a')]=function(_0x215de2){return request(_0xaa14('0x1b'),{'options':{'where':{'id':_0x215de2},'attributes':[_0xaa14('0xb')]}});};exports[_0xaa14('0x1c')]=function(_0x12f6f6){return request(_0xaa14('0x1d'),{'options':{'where':{'phone':_0x12f6f6[_0xaa14('0x1e')]},'attributes':['id']}});};exports[_0xaa14('0x1f')]=function(_0x13d487){return request('ShowTrunk',{'options':{'where':{'id':_0x13d487},'attributes':[_0xaa14('0xb')]}});};exports[_0xaa14('0x20')]=function(_0x288b12){return request(_0xaa14('0x21'),{'options':{'where':{'id':_0x288b12},'attributes':[_0xaa14('0x22')]}});};exports[_0xaa14('0x23')]=function(_0x5a78bb){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x5a78bb},'include':[{'model':'Interval','as':_0xaa14('0x24')}]}});};exports['getSmsAccountById']=function(_0x595b27){return request(_0xaa14('0x25'),{'options':{'where':{'id':_0x595b27},'attributes':['id',_0xaa14('0xb')]}});};exports['createSmsMessage']=function(_0x16146f){return request('CreateSmsMessage',{'body':_0x16146f});};exports[_0xaa14('0x26')]=function(_0x9cff62){return request(_0xaa14('0x27'),{'body':_0x9cff62});};exports['createSquareReport']=function(_0x14f783){return request(_0xaa14('0x28'),{'body':_[_0xaa14('0x29')](_0x14f783,{'project_name':_0x14f783[_0xaa14('0x2a')],'prev_project_name':_0x14f783[_0xaa14('0x2b')]||'','is_subproject':_0x14f783[_0xaa14('0x2b')]?!![]:![],'leaveAt':moment()[_0xaa14('0x2c')](_0xaa14('0x2d'))})});};exports['createSquareRecording']=function(_0x9d3115){return request('CreateSquareRecording',{'body':_0x9d3115});};exports[_0xaa14('0x2e')]=function(_0x54d3a6){return request(_0xaa14('0x2f'),{'body':_0x54d3a6});};exports[_0xaa14('0x30')]=function(_0x2c078e){return request(_0xaa14('0x31'),{'options':{'raw':![],'where':{'phone':_0x2c078e[_0xaa14('0x1e')],'ListId':_0x2c078e[_0xaa14('0x32')]}}})[_0xaa14('0x5')](function(_0x3302b6){if(_0x3302b6){return _0x3302b6;}return request('CreateCmContact',{'body':_0x2c078e});});};exports[_0xaa14('0x33')]=function(_0x213d0e){return request(_0xaa14('0x34'),{'options':{'where':{'id':_0x213d0e},'attributes':['name']}});};exports[_0xaa14('0x35')]=function(_0x28955a,_0x50d766){return request('LoginUser',{'body':{'interface':_0x50d766},'options':{'where':_0x28955a}});};exports['agentPause']=function(_0x239e72,_0x362d08,_0x9e686d){return request(_0xaa14('0x36'),{'body':{'type':_0x362d08,'uniqueid':_0x9e686d},'options':{'where':_0x239e72}});};exports[_0xaa14('0x37')]=function(_0x5601b6){return request('UnpauseUser',{'body':{},'options':{'where':_0x5601b6}});};exports[_0xaa14('0x38')]=function(_0x2e52c0){return request(_0xaa14('0x39'),{'body':{},'options':{'where':_0x2e52c0}});};
\ No newline at end of file
index 1ccfed0..7712b88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d87=['./lex','exports'];(function(_0x12419e,_0x1c13c3){var _0x25e1bd=function(_0x3edb50){while(--_0x3edb50){_0x12419e['push'](_0x12419e['shift']());}};_0x25e1bd(++_0x1c13c3);}(_0x4d87,0xf0));var _0x74d8=function(_0x25878a,_0x4344c4){_0x25878a=_0x25878a-0x0;var _0x57ba9e=_0x4d87[_0x25878a];return _0x57ba9e;};var polly=require('./polly');var lex=require(_0x74d8('0x0'));module[_0x74d8('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xab9f=['exports','./polly'];(function(_0x26c501,_0x542e64){var _0x2c48fc=function(_0x54c6b7){while(--_0x54c6b7){_0x26c501['push'](_0x26c501['shift']());}};_0x2c48fc(++_0x542e64);}(_0xab9f,0x1bd));var _0xfab9=function(_0xb7da3a,_0x457c8a){_0xb7da3a=_0xb7da3a-0x0;var _0xbe5362=_0xab9f[_0xb7da3a];return _0xbe5362;};var polly=require(_0xfab9('0x0'));var lex=require('./lex');module[_0xfab9('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index bb6536d..15adde8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['exports','./lib/api'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x153f,0x15b));var _0xf153=function(_0x542915,_0x4584f5){_0x542915=_0x542915-0x0;var _0x10e6df=_0x153f[_0x542915];return _0x10e6df;};'use strict';var lex=require(_0xf153('0x0'));module[_0xf153('0x1')]=function(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c){return lex(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c);};
\ No newline at end of file
+var _0x6c76=['./lib/api','exports'];(function(_0x5bb0dc,_0x2ecc84){var _0x2517cd=function(_0x228ed5){while(--_0x228ed5){_0x5bb0dc['push'](_0x5bb0dc['shift']());}};_0x2517cd(++_0x2ecc84);}(_0x6c76,0x184));var _0x66c7=function(_0x570e1d,_0x255d85){_0x570e1d=_0x570e1d-0x0;var _0x3130a5=_0x6c76[_0x570e1d];return _0x3130a5;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);};
\ No newline at end of file
index 68d3e67..783b36e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x1dcb61,_0x1c0ef4){var _0x19199a=function(_0x219aee){while(--_0x219aee){_0x1dcb61['push'](_0x1dcb61['shift']());}};_0x19199a(++_0x1c0ef4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
+var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x58cddd,_0x47b41d){var _0x5085c0=function(_0x202eff){while(--_0x202eff){_0x58cddd['push'](_0x58cddd['shift']());}};_0x5085c0(++_0x47b41d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
index f2f4e20..4bbda45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf38e=['exports','./lib/api'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf38e,0x1dd));var _0xef38=function(_0x1e3312,_0x424ba8){_0x1e3312=_0x1e3312-0x0;var _0x275855=_0xf38e[_0x1e3312];return _0x275855;};'use strict';var polly=require(_0xef38('0x0'));module[_0xef38('0x1')]=function(_0x509c45,_0x575fdc,_0x990aa1,_0x5e132c,_0x269920,_0x4445de,_0x380b12){return polly(_0x509c45,_0x575fdc,_0x990aa1,_0x5e132c,_0x269920,_0x4445de,_0x380b12);};
\ No newline at end of file
+var _0x2351=['exports','./lib/api'];(function(_0x1c545c,_0x12f309){var _0x4d588d=function(_0x3feca3){while(--_0x3feca3){_0x1c545c['push'](_0x1c545c['shift']());}};_0x4d588d(++_0x12f309);}(_0x2351,0x6d));var _0x1235=function(_0x25bd9d,_0xef2dd5){_0x25bd9d=_0x25bd9d-0x0;var _0x22aa42=_0x2351[_0x25bd9d];return _0x22aa42;};'use strict';var polly=require(_0x1235('0x0'));module[_0x1235('0x1')]=function(_0x40cd34,_0x18f06e,_0x47e525,_0x1a6770,_0x1480ba,_0x3d9956,_0x322b8c){return polly(_0x40cd34,_0x18f06e,_0x47e525,_0x1a6770,_0x1480ba,_0x3d9956,_0x322b8c);};
\ No newline at end of file
index 15bdffd..097c592 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30b3=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x30b3,0x1b6));var _0x330b=function(_0x275d4b,_0x53a574){_0x275d4b=_0x275d4b-0x0;var _0x13f34b=_0x30b3[_0x275d4b];return _0x13f34b;};'use strict';var fs=require('fs');var path=require(_0x330b('0x0'));var BPromise=require(_0x330b('0x1'));var rs=require(_0x330b('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x2a0b9f,_0x1d2434,_0x4dd353){return new BPromise(function(_0x5dd90d,_0x13d4bc){_0x2a0b9f[_0x330b('0x3')](_0x1d2434,function(_0xe36b02,_0x213268){if(_0xe36b02){_0x13d4bc(_0xe36b02);}else if(_0x213268){if(_0x213268[_0x330b('0x4')]instanceof Buffer){fs[_0x330b('0x5')](_0x4dd353,_0x213268[_0x330b('0x4')],function(_0x28401a){if(_0x28401a){_0x13d4bc(_0x28401a);}else{_0x5dd90d();}});}else{_0x13d4bc(new Error(_0x330b('0x6')));}}else{_0x13d4bc(new Error(_0x330b('0x7')));}});});}module[_0x330b('0x8')]=function(_0x462603,_0x3c808c,_0x29f245,_0x583e23,_0x293d31,_0x335b29,_0x33a61e){var _0x5c3349=new AWS[(_0x330b('0x9'))]({'accessKeyId':_0x462603,'secretAccessKey':_0x3c808c,'region':_0x29f245});var _0x594095={'Text':_0x293d31,'TextType':_0x335b29||_0x330b('0xa'),'OutputFormat':_0x330b('0xb'),'VoiceId':_0x583e23};return pollyResult(_0x5c3349,_0x594095,_0x33a61e);};
\ No newline at end of file
+var _0xb891=['text','mp3','bluebird','randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','Polly'];(function(_0x38cdd0,_0x511d51){var _0x51394=function(_0x197d39){while(--_0x197d39){_0x38cdd0['push'](_0x38cdd0['shift']());}};_0x51394(++_0x511d51);}(_0xb891,0x1f2));var _0x1b89=function(_0x38e5c7,_0x1049a5){_0x38e5c7=_0x38e5c7-0x0;var _0x383525=_0xb891[_0x38e5c7];return _0x383525;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x1b89('0x0'));var rs=require(_0x1b89('0x1'));var AWS=require(_0x1b89('0x2'));function pollyResult(_0x36645a,_0x1f5a75,_0x3deafe){return new BPromise(function(_0x3382b1,_0x43b1b8){_0x36645a['synthesizeSpeech'](_0x1f5a75,function(_0x59df56,_0x44343d){if(_0x59df56){_0x43b1b8(_0x59df56);}else if(_0x44343d){if(_0x44343d[_0x1b89('0x3')]instanceof Buffer){fs['writeFile'](_0x3deafe,_0x44343d[_0x1b89('0x3')],function(_0x3be393){if(_0x3be393){_0x43b1b8(_0x3be393);}else{_0x3382b1();}});}else{_0x43b1b8(new Error(_0x1b89('0x4')));}}else{_0x43b1b8(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x27a9bb,_0x12fde9,_0x1e2cc3,_0x156f82,_0x2aa94d,_0x5eb3d4,_0x2cc12b){var _0x3127cd=new AWS[(_0x1b89('0x5'))]({'accessKeyId':_0x27a9bb,'secretAccessKey':_0x12fde9,'region':_0x1e2cc3});var _0x1bf204={'Text':_0x2aa94d,'TextType':_0x5eb3d4||_0x1b89('0x6'),'OutputFormat':_0x1b89('0x7'),'VoiceId':_0x156f82};return pollyResult(_0x3127cd,_0x1bf204,_0x2cc12b);};
\ No newline at end of file
index 918acbe..a9d81b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf878=['./lib/api','exports'];(function(_0x3a55d6,_0x50e0ae){var _0x433244=function(_0x20b819){while(--_0x20b819){_0x3a55d6['push'](_0x3a55d6['shift']());}};_0x433244(++_0x50e0ae);}(_0xf878,0x1d6));var _0x8f87=function(_0x389f98,_0x6d248b){_0x389f98=_0x389f98-0x0;var _0x542f93=_0xf878[_0x389f98];return _0x542f93;};'use strict';var asr=require(_0x8f87('0x0'));module[_0x8f87('0x1')]=function(_0x54c4dc,_0x5562c8,_0x3f21db,_0x348614){return asr(_0x54c4dc,_0x5562c8,_0x3f21db);};
\ No newline at end of file
+var _0x3d90=['./lib/api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d90,0x183));var _0x03d9=function(_0x2801c5,_0xb543b3){_0x2801c5=_0x2801c5-0x0;var _0x538cfa=_0x3d90[_0x2801c5];return _0x538cfa;};'use strict';var asr=require(_0x03d9('0x0'));module['exports']=function(_0x45f4d6,_0x294f66,_0x4e06f7,_0x2e34eb){return asr(_0x45f4d6,_0x294f66,_0x4e06f7);};
\ No newline at end of file
index 4ba43f8..acfaa07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x447b=['key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x447b,0xe4));var _0xb447=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0x447b[_0x54fbff];return _0x5cf619;};'use strict';var url=require(_0xb447('0x0'));var BPromise=require(_0xb447('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xb447('0x2')]=function(_0x253864,_0x2a45d2,_0x2108f4){return new BPromise(function(_0xf3dd0a,_0xf8a88b){var _0x161c5d;if(typeof _0x253864!==_0xb447('0x3')||_0x253864[_0xb447('0x4')]===0x0){return _0xf8a88b(_0xb447('0x5'));}if(typeof _0x2a45d2!=='string'||_0x2a45d2['length']===0x0){return _0xf8a88b(_0xb447('0x6'));}if(typeof _0x2108f4!=='undefined'&&(typeof _0x2108f4!==_0xb447('0x3')||_0x2108f4[_0xb447('0x4')]===0x0)){return _0xf8a88b(_0xb447('0x7'));}try{_0x161c5d=fs[_0xb447('0x8')](_0x253864)[_0xb447('0x9')]('base64');}catch(_0x374dfc){return _0xf8a88b(_0x374dfc);}return _0xf3dd0a({'method':_0xb447('0xa'),'uri':host+_0xb447('0xb')+_0x2a45d2,'body':{'config':{'encoding':_0xb447('0xc'),'sampleRateHertz':'8000','languageCode':_0x2108f4},'audio':{'content':_0x161c5d}},'json':!![]});});};
\ No newline at end of file
+var _0x68fc=['string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x68fc,0xa5));var _0xc68f=function(_0x7a1a94,_0x34e977){_0x7a1a94=_0x7a1a94-0x0;var _0x1321be=_0x68fc[_0x7a1a94];return _0x1321be;};'use strict';var url=require(_0xc68f('0x0'));var BPromise=require(_0xc68f('0x1'));var fs=require('fs');var host=_0xc68f('0x2');module['exports']=function(_0x49aa95,_0x26513f,_0x506fb5){return new BPromise(function(_0xe70787,_0x593648){var _0x5899ea;if(typeof _0x49aa95!==_0xc68f('0x3')||_0x49aa95[_0xc68f('0x4')]===0x0){return _0x593648(_0xc68f('0x5'));}if(typeof _0x26513f!==_0xc68f('0x3')||_0x26513f['length']===0x0){return _0x593648('key\x20should\x20be\x20a\x20string');}if(typeof _0x506fb5!==_0xc68f('0x6')&&(typeof _0x506fb5!==_0xc68f('0x3')||_0x506fb5[_0xc68f('0x4')]===0x0)){return _0x593648(_0xc68f('0x7'));}try{_0x5899ea=fs[_0xc68f('0x8')](_0x49aa95)[_0xc68f('0x9')](_0xc68f('0xa'));}catch(_0x3bd373){return _0x593648(_0x3bd373);}return _0xe70787({'method':_0xc68f('0xb'),'uri':host+_0xc68f('0xc')+_0x26513f,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xc68f('0xd'),'languageCode':_0x506fb5},'audio':{'content':_0x5899ea}},'json':!![]});});};
\ No newline at end of file
index eb740ff..10cb4be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdb1=['./asr','exports'];(function(_0x49fc47,_0x24cd5f){var _0x204186=function(_0x45ccf){while(--_0x45ccf){_0x49fc47['push'](_0x49fc47['shift']());}};_0x204186(++_0x24cd5f);}(_0xfdb1,0xd0));var _0x1fdb=function(_0x4b98ba,_0x476929){_0x4b98ba=_0x4b98ba-0x0;var _0x325a12=_0xfdb1[_0x4b98ba];return _0x325a12;};var asr=require(_0x1fdb('0x0'));module[_0x1fdb('0x1')]={'asr':asr};
\ No newline at end of file
+var asr=require('./asr');module['exports']={'asr':asr};
\ No newline at end of file
index 4f104d4..2a12e45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa060=['MP3','text:synthesize','then','generate','googleCloudTTS\x20path','split','googleTTS','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','CustomAction','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','google-tts-api','parse','util','./aws','./sestek','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','end','WHAT_EVER','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','base64','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice'];(function(_0x3ce341,_0x2f1d3b){var _0x52cbc9=function(_0x456dc0){while(--_0x456dc0){_0x3ce341['push'](_0x3ce341['shift']());}};_0x52cbc9(++_0x2f1d3b);}(_0xa060,0xd9));var _0x0a06=function(_0x30243b,_0x101c73){_0x30243b=_0x30243b-0x0;var _0x30f06d=_0xa060[_0x30243b];return _0x30f06d;};'use strict';var apiai=require(_0x0a06('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x0a06('0x1'));var fs=require('fs');var http=require(_0x0a06('0x2'));var https=require(_0x0a06('0x3'));var md5=require(_0x0a06('0x4'));var path=require(_0x0a06('0x5'));var querystring=require(_0x0a06('0x6'));var rp=require(_0x0a06('0x7'));var rs=require(_0x0a06('0x8'));var sox=require('sox');var tts=require(_0x0a06('0x9'));var urlParse=require('url')[_0x0a06('0xa')];var util=require(_0x0a06('0xb'));var aws=require(_0x0a06('0xc'));var google=require('./google');var sestek=require(_0x0a06('0xd'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x0a06('0xe'));var ISPEECH_API=_0x0a06('0xf');function downloadFile(_0x1fc2c3,_0x25819){return new BPromise(function(_0x286f71,_0x3d14c9){var _0x54a297=urlParse(_0x1fc2c3);var _0x433b40=_0x54a297[_0x0a06('0x10')]===_0x0a06('0x11')?https:http;var _0x50ecdf={'host':_0x54a297[_0x0a06('0x12')],'path':_0x54a297[_0x0a06('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x433b40[_0x0a06('0x13')](_0x50ecdf,function(_0x46d48b){if(_0x46d48b[_0x0a06('0x14')]!==0xc8){logger[_0x0a06('0x15')]('request\x20to\x20'+_0x1fc2c3+_0x0a06('0x16')+_0x46d48b[_0x0a06('0x14')]+'\x20('+_0x46d48b['statusMessage']+')');_0x3d14c9(new Error(_0x0a06('0x17')+_0x1fc2c3+_0x0a06('0x16')+_0x46d48b[_0x0a06('0x14')]+'\x20('+_0x46d48b[_0x0a06('0x18')]+')'));return;}var _0x2b617f=fs[_0x0a06('0x19')](_0x25819);_0x2b617f['on'](_0x0a06('0x1a'),function(){logger[_0x0a06('0x1b')](_0x0a06('0x1c'));_0x2b617f[_0x0a06('0x1d')](_0x286f71);});_0x2b617f['on']('error',function(_0x433234){fs[_0x0a06('0x1e')](_0x25819);logger['error']('download\x20error',_0x433234);_0x3d14c9(_0x433234);});_0x46d48b[_0x0a06('0x1f')](_0x2b617f);})['on']('error',function(_0x4ddd56){logger['error'](_0x4ddd56);_0x3d14c9(_0x4ddd56);})[_0x0a06('0x20')]();});}function uploadFile(_0x504454){return new BPromise(function(_0x4273f7,_0x1d31f5){var _0x1ffbc7=urlParse(_0x504454);var _0x41ac19=_0x1ffbc7['protocol']===_0x0a06('0x11')?https:http;var _0x123e61={'host':_0x1ffbc7[_0x0a06('0x12')],'path':_0x1ffbc7[_0x0a06('0x5')],'headers':{'user-agent':_0x0a06('0x21')}};_0x41ac19[_0x0a06('0x13')](_0x123e61,function(_0x4a795f){if(_0x4a795f[_0x0a06('0x14')]!==0xc8){_0x1d31f5(new Error('request\x20to\x20'+_0x504454+_0x0a06('0x16')+_0x4a795f['statusCode']+'\x20('+_0x4a795f['statusMessage']+')'));return;}var _0x1c5975='';_0x4a795f['on'](_0x0a06('0x22'),function(_0x5a836e){_0x1c5975+=_0x5a836e;});_0x4a795f['on'](_0x0a06('0x20'),function(){_0x4273f7(_0x1c5975);});})['on'](_0x0a06('0x15'),function(_0x369ddd){_0x1d31f5(_0x369ddd);})[_0x0a06('0x20')]();});}function convertFile(_0x4442e6,_0x21065a){return new BPromise(function(_0x17de92,_0xd9dd64){var _0x37cb85=sox[_0x0a06('0x23')](_0x4442e6,_0x21065a,{'sampleRate':0x1f40,'format':_0x0a06('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x37cb85['on'](_0x0a06('0x15'),function(_0x41d1bc){logger['error'](_0x0a06('0x25'),_0x41d1bc);_0xd9dd64(_0x41d1bc);});_0x37cb85['on'](_0x0a06('0x20'),function(){logger[_0x0a06('0x1b')](_0x0a06('0x26'));_0x17de92();});_0x37cb85[_0x0a06('0x27')]();});}function base64Decode(_0x544bad,_0x2e9a47){var _0x90784e=path[_0x0a06('0x28')](__dirname,_0x0a06('0x29'),rs['generate'](0x4)+_0x0a06('0x2a'));fs[_0x0a06('0x2b')](_0x90784e,_0x544bad,_0x0a06('0x2c'));return convertFile(_0x90784e,_0x2e9a47)['then'](function(){try{fs[_0x0a06('0x1e')](_0x90784e);fs[_0x0a06('0x2d')](_0x2e9a47,_0x0a06('0x2e'));}catch(_0x254886){logger[_0x0a06('0x15')](_0x254886);}return _0x2e9a47['split']('.')[0x0];});}function base64Encode(_0x519103){var _0x5e9fdd=fs[_0x0a06('0x2f')](_0x519103);return new Buffer(_0x5e9fdd)[_0x0a06('0x30')](_0x0a06('0x2c'));}exports[_0x0a06('0x31')]=function(_0x182af0,_0x1dc0df,_0x57331f,_0x1da81d,_0x5ec57a,_0x41f5a9){var _0x481629,_0xcade2e;var _0x4fefff=_0x0a06('0x32');var _0x1d2261=_0x0a06('0x33')+_0x182af0;var _0x238be2={};if(_0x1dc0df===_0x0a06('0x34')){_0x238be2[_0x0a06('0x35')]={'ssml':_0x57331f};}else{_0x238be2[_0x0a06('0x35')]={'text':_0x57331f};};_0x238be2[_0x0a06('0x36')]={'languageCode':_0x1da81d,'ssmlGender':_0x5ec57a};_0x238be2['audioConfig']={'audioEncoding':_0x0a06('0x37'),'sampleRateHertz':0x1f40};var _0x13cfbc={'url':_0x4fefff+_0x0a06('0x38')+_0x1d2261,'method':'POST','json':!![],'body':_0x238be2};return rp(_0x13cfbc)['then'](function(_0x10ed12){return new BPromise(function(_0x1fa9c6,_0x4c4844){_0x481629=path[_0x0a06('0x28')](__dirname,_0x0a06('0x29'),rs['generate'](0x4)+'.mp3');var _0x2196dc=Buffer['from'](_0x10ed12['audioContent'],_0x0a06('0x2c'));return fs['writeFile'](_0x481629,_0x2196dc,function(_0x40ed07){_0x4c4844(_0x40ed07);},function(_0xf0a5d1){fs[_0x0a06('0x2d')](_0x481629,_0x0a06('0x2e'));_0x1fa9c6(_0xf0a5d1);});});})[_0x0a06('0x39')](function(_0x103df7){_0xcade2e=path[_0x0a06('0x28')](__dirname,_0x0a06('0x29'),rs[_0x0a06('0x3a')](0x4)+'.wav');return convertFile(_0x481629,_0xcade2e);})['then'](function(){try{fs[_0x0a06('0x1e')](_0x481629);fs['chmodSync'](_0xcade2e,_0x0a06('0x2e'));}catch(_0x2d0e09){logger[_0x0a06('0x15')](_0x2d0e09);}logger[_0x0a06('0x1b')](_0x0a06('0x3b'),_0xcade2e[_0x0a06('0x3c')]('.')[0x0]);return _0xcade2e[_0x0a06('0x3c')]('.')[0x0];});};exports[_0x0a06('0x3d')]=function(_0x116fd5,_0x255a46){var _0x1342cb='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5b78df,_0x299630;var _0x5aea78;var _0xdc1a5c={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x1342cb,'headers':{'Content-Type':_0x0a06('0x3e')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x0a06('0x3f'),JSON[_0x0a06('0x40')]([_0x116fd5,_0x255a46||'en',![],_0x0a06('0x41')]),null,_0x0a06('0x42')]]]))};return rp(_0xdc1a5c)[_0x0a06('0x39')](function(_0x17b389){try{_0x5aea78=eval(_0x17b389[_0x0a06('0x43')](0x5))[0x0][0x2];}catch(_0x5f2446){throw new Error(_0x0a06('0x44')+_0x17b389['data']);}if(!_0x5aea78){if(_0x116fd5[_0x0a06('0x45')]>0xc8){throw new Error(_0x0a06('0x46'));}else{throw new Error(_0x0a06('0x47')+_0x255a46+_0x0a06('0x48'));}}try{_0x5aea78=eval(_0x5aea78)[0x0];}catch(_0x5cfee2){throw new Error(_0x0a06('0x44')+res[_0x0a06('0x22')]);}const _0x5b5e70=_0x5aea78;_0x5b78df=path[_0x0a06('0x28')](__dirname,_0x0a06('0x29'),rs[_0x0a06('0x3a')](0x4)+_0x0a06('0x49'));fs[_0x0a06('0x2b')](_0x5b78df,_0x5aea78,{'encoding':_0x0a06('0x2c')});_0x299630=path[_0x0a06('0x28')](__dirname,_0x0a06('0x29'),rs[_0x0a06('0x3a')](0x4)+_0x0a06('0x2a'));return convertFile(_0x5b78df,_0x299630);})[_0x0a06('0x39')](function(){try{fs[_0x0a06('0x1e')](_0x5b78df);fs[_0x0a06('0x2d')](_0x299630,_0x0a06('0x2e'));}catch(_0x3c3e8e){logger[_0x0a06('0x15')](_0x3c3e8e);}logger[_0x0a06('0x1b')]('goggleTTS\x20path',_0x299630[_0x0a06('0x3c')]('.')[0x0]);return _0x299630[_0x0a06('0x3c')]('.')[0x0];});};exports[_0x0a06('0x4a')]=function(_0x462718,_0x2df6a7,_0x481265){return google[_0x0a06('0x4b')](_0x462718,_0x2df6a7,_0x481265)[_0x0a06('0x39')](function(_0x49ab30){logger['info'](_0x49ab30['uri']);return rp(_0x49ab30);})[_0x0a06('0x39')](function(_0x21145f){var _0x509b25='';var _0x1b896b=0x0;try{fs[_0x0a06('0x1e')](_0x462718);}catch(_0x407cd9){logger[_0x0a06('0x15')](_0x407cd9);}if(_0x21145f&&_0x21145f[_0x0a06('0x4c')]){_0x509b25=_0x21145f[_0x0a06('0x4c')][_0x0a06('0x4d')](function(_0x2e95a1){return _0x2e95a1&&_0x2e95a1[_0x0a06('0x4e')][0x0]&&_0x2e95a1[_0x0a06('0x4e')][0x0][_0x0a06('0x4f')]?_0x2e95a1[_0x0a06('0x4e')][0x0][_0x0a06('0x4f')]:'';})[_0x0a06('0x50')]('\x0a');_0x1b896b=_0x21145f[_0x0a06('0x4c')][_0x0a06('0x4d')](function(_0xe7f21d){return _0xe7f21d&&_0xe7f21d[_0x0a06('0x4e')][0x0]&&_0xe7f21d[_0x0a06('0x4e')][0x0][_0x0a06('0x51')]?_0xe7f21d[_0x0a06('0x4e')][0x0][_0x0a06('0x51')]:0x0;})[_0x0a06('0x50')]('\x0a');}logger['info'](_0x0a06('0x52'),_0x509b25);logger['info'](_0x0a06('0x53'),_0x1b896b);return{'transcript':_0x509b25,'confidence':_0x1b896b};})[_0x0a06('0x54')](function(_0xd11498){logger['error'](_0x0a06('0x55'),_0xd11498[_0x0a06('0x14')],_0xd11498[_0x0a06('0x56')],_0xd11498[_0x0a06('0x57')]);});};exports[_0x0a06('0x58')]=function(_0x34be75,_0x54dd01,_0x2e5428,_0x159b7e){var _0x570394=apiai(_0x54dd01,{'language':_0x159b7e||'en'});return _0x570394[_0x0a06('0x59')](_0x2e5428,{'sessionId':md5(_0x34be75)})['then'](function(_0x1b53c3){logger[_0x0a06('0x1b')](JSON[_0x0a06('0x40')](_0x1b53c3));return{'source':_0x1b53c3['result']['source'],'resolvedQuery':_0x1b53c3[_0x0a06('0x5a')][_0x0a06('0x5b')],'action':_0x1b53c3[_0x0a06('0x5a')][_0x0a06('0x5c')],'actionIncomplete':_0x1b53c3['result'][_0x0a06('0x5d')],'speech':_0x1b53c3['result'][_0x0a06('0x5e')][_0x0a06('0x5f')],'score':_0x1b53c3[_0x0a06('0x5a')][_0x0a06('0x60')],'statusCode':_0x1b53c3[_0x0a06('0x61')]['code'],'endConversation':_0x1b53c3['result'][_0x0a06('0x62')][_0x0a06('0x63')]||![],'isFallbackIntent':_0x1b53c3[_0x0a06('0x5a')][_0x0a06('0x62')]['isFallbackIntent']};});};exports[_0x0a06('0x64')]=function(_0x5d5f07,_0x1f49e1,_0x22ec5f,_0x2992ff,_0x387e55,_0x3bbd9f){var _0x4f921f=_0x2992ff[_0x0a06('0x65')](/\\n/g,'\x0a');var _0x4df5ff={'credentials':{'private_key':_0x4f921f,'client_email':_0x22ec5f}};var _0x466b27=new dialogflow[(_0x0a06('0x66'))](_0x4df5ff);var _0x4be4db=_0x466b27[_0x0a06('0x67')](_0x1f49e1,md5(_0x5d5f07));var _0x3b506d={'session':_0x4be4db,'queryInput':{'text':{'text':_0x387e55,'languageCode':_0x3bbd9f}}};return _0x466b27[_0x0a06('0x68')](_0x3b506d)['then'](function(_0x51d444){if(_0x51d444&&_0x51d444[_0x0a06('0x45')]){logger[_0x0a06('0x1b')](_0x0a06('0x69'),JSON['stringify'](_0x51d444));var _0x39ec59=_0x51d444[0x0];if(_0x39ec59){var _0xf2167c={'action':_0x39ec59[_0x0a06('0x6a')][_0x0a06('0x5c')],'allRequiredParamsPresent':_0x39ec59[_0x0a06('0x6a')][_0x0a06('0x6b')],'endConversation':_0x39ec59[_0x0a06('0x6a')][_0x0a06('0x6c')]&&_0x39ec59[_0x0a06('0x6a')]['diagnosticInfo'][_0x0a06('0x6d')]?_0x39ec59[_0x0a06('0x6a')][_0x0a06('0x6c')][_0x0a06('0x6d')]['end_conversation'][_0x0a06('0x6e')]:![],'fulfillmentText':_0x39ec59[_0x0a06('0x6a')][_0x0a06('0x6f')],'intentName':_0x39ec59[_0x0a06('0x6a')]['intent'][_0x0a06('0x56')],'intentDisplayName':_0x39ec59[_0x0a06('0x6a')][_0x0a06('0x70')][_0x0a06('0x71')],'isFallbackIntent':_0x39ec59[_0x0a06('0x6a')]['intent'][_0x0a06('0x72')],'languageCode':_0x39ec59['queryResult'][_0x0a06('0x73')],'queryText':_0x39ec59[_0x0a06('0x6a')][_0x0a06('0x74')],'responseId':_0x39ec59[_0x0a06('0x75')],'score':_0x39ec59['queryResult'][_0x0a06('0x76')],'speech':_0x39ec59[_0x0a06('0x6a')][_0x0a06('0x6f')],'providerResponse':JSON[_0x0a06('0x40')](_0x51d444)};return _0xf2167c;}}});};exports['tildeASR']=function(_0x5d4ee4,_0x16be4d,_0x5651d9,_0x1ec023){return tilde[_0x0a06('0x4b')](_0x5d4ee4,_0x16be4d,_0x5651d9,_0x1ec023)[_0x0a06('0x39')](function(_0x562ed4){try{fs['unlink'](_0x5d4ee4);}catch(_0x303078){logger[_0x0a06('0x15')](_0x303078);}logger['info'](_0x0a06('0x77'),_0x562ed4[_0x0a06('0x4f')]);logger[_0x0a06('0x1b')](_0x0a06('0x78'),_0x562ed4[_0x0a06('0x51')]);return _0x562ed4;});};exports[_0x0a06('0x79')]=function(_0x1b77de,_0x1d5c0d,_0x24210d,_0x40ac26,_0x43b1f1,_0x635c6f){var _0x1218fa=path[_0x0a06('0x28')](__dirname,'tmp',rs[_0x0a06('0x3a')](0x4)+'.mp3');var _0xbd4ef5;return aws['polly'](_0x1b77de,_0x1d5c0d,_0x24210d,_0x40ac26,_0x43b1f1,_0x635c6f,_0x1218fa)[_0x0a06('0x39')](function(){_0xbd4ef5=path[_0x0a06('0x28')](__dirname,_0x0a06('0x29'),rs['generate'](0x4)+_0x0a06('0x2a'));return convertFile(_0x1218fa,_0xbd4ef5);})['then'](function(){try{fs['unlink'](_0x1218fa);fs[_0x0a06('0x2d')](_0xbd4ef5,_0x0a06('0x2e'));}catch(_0x51193c){logger[_0x0a06('0x15')](_0x51193c);}return _0xbd4ef5[_0x0a06('0x3c')]('.')[0x0];});};exports[_0x0a06('0x7a')]=function(_0x55d1a5,_0x4d51c7,_0x1a1ff9,_0xe1251a,_0xd11889,_0x6e1081){return aws['lex'](_0x55d1a5,_0x4d51c7,_0x1a1ff9,_0xe1251a,_0xd11889,_0x6e1081)[_0x0a06('0x39')](function(_0x499214){logger[_0x0a06('0x1b')](JSON[_0x0a06('0x40')](_0x499214));return _0x499214;});};exports['ispeechTTS']=function(_0x37e423,_0x36b739,_0x113d9d,_0x4f71f4){var _0x327d22=util[_0x0a06('0x7b')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x37e423,encodeURIComponent(_0x36b739),_0x113d9d,_0x4f71f4);var _0x2cbbf8=path[_0x0a06('0x28')](__dirname,_0x0a06('0x29'),rs[_0x0a06('0x3a')](0x4)+_0x0a06('0x49'));var _0x45c632;return downloadFile(_0x327d22,_0x2cbbf8)['then'](function(){_0x45c632=path['resolve'](__dirname,'tmp',rs[_0x0a06('0x3a')](0x4)+_0x0a06('0x2a'));return convertFile(_0x2cbbf8,_0x45c632);})[_0x0a06('0x39')](function(){try{fs[_0x0a06('0x1e')](_0x2cbbf8);fs[_0x0a06('0x2d')](_0x45c632,_0x0a06('0x2e'));}catch(_0x2ec930){logger[_0x0a06('0x15')](_0x2ec930);}return _0x45c632[_0x0a06('0x3c')]('.')[0x0];});};exports['ispeechASR']=function(_0x267078,_0x4e30f8,_0x418f89,_0x3075e2){var _0x549d9f=util[_0x0a06('0x7b')](_0x0a06('0x7c'),ISPEECH_API,_0x4e30f8,_0x418f89,base64Encode(_0x267078),_0x3075e2?util[_0x0a06('0x7b')](_0x0a06('0x7d'),encodeURIComponent(_0x3075e2)):_0x0a06('0x7e'));return uploadFile(_0x549d9f)[_0x0a06('0x39')](function(_0x12903e){return querystring[_0x0a06('0xa')](_0x12903e);});};exports[_0x0a06('0x7f')]=function(_0x2b116a,_0x3c79a2){return sestek[_0x0a06('0x80')](_0x2b116a,_0x3c79a2)[_0x0a06('0x39')](function(_0x1b922a){logger[_0x0a06('0x1b')](JSON[_0x0a06('0x40')](_0x1b922a));var _0x3fa687={'speech':_0x1b922a[_0x0a06('0x81')],'action':_0x1b922a['channelData']?_0x1b922a['channelData'][_0x0a06('0x82')]:undefined,'actiondata':_0x1b922a[_0x0a06('0x83')]?_0x1b922a[_0x0a06('0x83')]['CustomActionData']:undefined};if(_0x1b922a[_0x0a06('0x83')]&&_0x1b922a[_0x0a06('0x83')][_0x0a06('0x84')]){return base64Decode(_0x1b922a[_0x0a06('0x83')][_0x0a06('0x84')][_0x0a06('0x85')],path[_0x0a06('0x28')](__dirname,_0x0a06('0x29'),rs['generate'](0x4)+_0x0a06('0x2a')))[_0x0a06('0x39')](function(_0x5f2a3b){_0x3fa687[_0x0a06('0x86')]=_0x5f2a3b;return _0x3fa687;});}return _0x3fa687;});};exports[_0x0a06('0x87')]=function(){return __dirname;};
\ No newline at end of file
+var _0x3088=['detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','sestekNDA','nda','text','channelData','CustomAction','audiofile','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','unlink','download\x20error','pipe','end','WHAT_EVER','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','base64','then','chmodSync','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','name','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','replace','SessionsClient','sessionPath'];(function(_0x137f49,_0xb32f69){var _0x37e612=function(_0x4f885c){while(--_0x4f885c){_0x137f49['push'](_0x137f49['shift']());}};_0x37e612(++_0xb32f69);}(_0x3088,0x130));var _0x8308=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x3088[_0xfedc72];return _0x2c7c78;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x8308('0x0'));var dialogflow=require(_0x8308('0x1'));var fs=require('fs');var http=require(_0x8308('0x2'));var https=require(_0x8308('0x3'));var md5=require(_0x8308('0x4'));var path=require(_0x8308('0x5'));var querystring=require(_0x8308('0x6'));var rp=require(_0x8308('0x7'));var rs=require(_0x8308('0x8'));var sox=require(_0x8308('0x9'));var tts=require(_0x8308('0xa'));var urlParse=require(_0x8308('0xb'))[_0x8308('0xc')];var util=require('util');var aws=require(_0x8308('0xd'));var google=require(_0x8308('0xe'));var sestek=require(_0x8308('0xf'));var tilde=require(_0x8308('0x10'));var logger=require(_0x8308('0x11'))(_0x8308('0x12'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2935ef,_0x35ee47){return new BPromise(function(_0x4e6353,_0x5cb209){var _0xa1c3aa=urlParse(_0x2935ef);var _0x522322=_0xa1c3aa[_0x8308('0x13')]===_0x8308('0x14')?https:http;var _0x406650={'host':_0xa1c3aa[_0x8308('0x15')],'path':_0xa1c3aa[_0x8308('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x522322[_0x8308('0x16')](_0x406650,function(_0xafd209){if(_0xafd209[_0x8308('0x17')]!==0xc8){logger[_0x8308('0x18')](_0x8308('0x19')+_0x2935ef+_0x8308('0x1a')+_0xafd209['statusCode']+'\x20('+_0xafd209[_0x8308('0x1b')]+')');_0x5cb209(new Error(_0x8308('0x19')+_0x2935ef+_0x8308('0x1a')+_0xafd209[_0x8308('0x17')]+'\x20('+_0xafd209['statusMessage']+')'));return;}var _0x5884a9=fs[_0x8308('0x1c')](_0x35ee47);_0x5884a9['on'](_0x8308('0x1d'),function(){logger[_0x8308('0x1e')]('finish\x20download\x20file');_0x5884a9[_0x8308('0x1f')](_0x4e6353);});_0x5884a9['on'](_0x8308('0x18'),function(_0x313965){fs[_0x8308('0x20')](_0x35ee47);logger[_0x8308('0x18')](_0x8308('0x21'),_0x313965);_0x5cb209(_0x313965);});_0xafd209[_0x8308('0x22')](_0x5884a9);})['on'](_0x8308('0x18'),function(_0x344876){logger[_0x8308('0x18')](_0x344876);_0x5cb209(_0x344876);})[_0x8308('0x23')]();});}function uploadFile(_0x126b7d){return new BPromise(function(_0x24019f,_0x533a91){var _0x34c08e=urlParse(_0x126b7d);var _0x5aec9f=_0x34c08e[_0x8308('0x13')]===_0x8308('0x14')?https:http;var _0x504017={'host':_0x34c08e[_0x8308('0x15')],'path':_0x34c08e[_0x8308('0x5')],'headers':{'user-agent':_0x8308('0x24')}};_0x5aec9f[_0x8308('0x16')](_0x504017,function(_0x16169f){if(_0x16169f['statusCode']!==0xc8){_0x533a91(new Error(_0x8308('0x19')+_0x126b7d+'\x20failed,\x20status\x20code\x20=\x20'+_0x16169f[_0x8308('0x17')]+'\x20('+_0x16169f['statusMessage']+')'));return;}var _0x418c39='';_0x16169f['on'](_0x8308('0x25'),function(_0x3cc6ed){_0x418c39+=_0x3cc6ed;});_0x16169f['on']('end',function(){_0x24019f(_0x418c39);});})['on'](_0x8308('0x18'),function(_0x4f230e){_0x533a91(_0x4f230e);})[_0x8308('0x23')]();});}function convertFile(_0x401ef1,_0x5e119e){return new BPromise(function(_0x433d2d,_0x5da32f){var _0x342c80=sox['transcode'](_0x401ef1,_0x5e119e,{'sampleRate':0x1f40,'format':_0x8308('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x342c80['on'](_0x8308('0x18'),function(_0xb5fb75){logger[_0x8308('0x18')](_0x8308('0x27'),_0xb5fb75);_0x5da32f(_0xb5fb75);});_0x342c80['on']('end',function(){logger[_0x8308('0x1e')](_0x8308('0x28'));_0x433d2d();});_0x342c80[_0x8308('0x29')]();});}function base64Decode(_0xd00d84,_0xf3acf){var _0x4fa7c9=path[_0x8308('0x2a')](__dirname,_0x8308('0x2b'),rs['generate'](0x4)+_0x8308('0x2c'));fs[_0x8308('0x2d')](_0x4fa7c9,_0xd00d84,_0x8308('0x2e'));return convertFile(_0x4fa7c9,_0xf3acf)[_0x8308('0x2f')](function(){try{fs[_0x8308('0x20')](_0x4fa7c9);fs[_0x8308('0x30')](_0xf3acf,'777');}catch(_0x53a833){logger[_0x8308('0x18')](_0x53a833);}return _0xf3acf[_0x8308('0x31')]('.')[0x0];});}function base64Encode(_0x43d7f6){var _0x2879ff=fs[_0x8308('0x32')](_0x43d7f6);return new Buffer(_0x2879ff)['toString'](_0x8308('0x2e'));}exports[_0x8308('0x33')]=function(_0x177c46,_0x2dee23,_0x4e1f7b,_0x25ba6e,_0x22e6d1,_0x2e6432){var _0x5a30ae,_0x266311;var _0x5e679f=_0x8308('0x34');var _0x5c6bc4=_0x8308('0x35')+_0x177c46;var _0x4af499={};if(_0x2dee23==='ssml'){_0x4af499[_0x8308('0x36')]={'ssml':_0x4e1f7b};}else{_0x4af499[_0x8308('0x36')]={'text':_0x4e1f7b};};_0x4af499[_0x8308('0x37')]={'languageCode':_0x25ba6e,'ssmlGender':_0x22e6d1};_0x4af499[_0x8308('0x38')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3e0033={'url':_0x5e679f+_0x8308('0x39')+_0x5c6bc4,'method':_0x8308('0x3a'),'json':!![],'body':_0x4af499};return rp(_0x3e0033)[_0x8308('0x2f')](function(_0x3f5a26){return new BPromise(function(_0x3ec159,_0x323c27){_0x5a30ae=path[_0x8308('0x2a')](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+_0x8308('0x3c'));var _0x596f6e=Buffer[_0x8308('0x3d')](_0x3f5a26[_0x8308('0x3e')],_0x8308('0x2e'));return fs[_0x8308('0x3f')](_0x5a30ae,_0x596f6e,function(_0x9a1617){_0x323c27(_0x9a1617);},function(_0x51ee97){fs['chmodSync'](_0x5a30ae,_0x8308('0x40'));_0x3ec159(_0x51ee97);});});})[_0x8308('0x2f')](function(_0x8f901f){_0x266311=path[_0x8308('0x2a')](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+_0x8308('0x2c'));return convertFile(_0x5a30ae,_0x266311);})[_0x8308('0x2f')](function(){try{fs[_0x8308('0x20')](_0x5a30ae);fs[_0x8308('0x30')](_0x266311,_0x8308('0x40'));}catch(_0x47fce2){logger[_0x8308('0x18')](_0x47fce2);}logger[_0x8308('0x1e')](_0x8308('0x41'),_0x266311[_0x8308('0x31')]('.')[0x0]);return _0x266311[_0x8308('0x31')]('.')[0x0];});};exports[_0x8308('0x42')]=function(_0x42c12a,_0x4231f4){var _0x30e230=_0x8308('0x43');var _0x123abd,_0x449876;var _0x7a49fd;var _0x3cdaaa={'encoding':_0x8308('0x44'),'method':_0x8308('0x3a'),'timeout':0x2710,'url':_0x30e230,'headers':{'Content-Type':_0x8308('0x45')},'body':_0x8308('0x46')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x8308('0x47')]([_0x42c12a,_0x4231f4||'en',![],_0x8308('0x48')]),null,_0x8308('0x49')]]]))};return rp(_0x3cdaaa)['then'](function(_0x2be85f){try{_0x7a49fd=eval(_0x2be85f[_0x8308('0x4a')](0x5))[0x0][0x2];}catch(_0x36f526){throw new Error(_0x8308('0x4b')+_0x2be85f[_0x8308('0x25')]);}if(!_0x7a49fd){if(_0x42c12a[_0x8308('0x4c')]>0xc8){throw new Error(_0x8308('0x4d'));}else{throw new Error(_0x8308('0x4e')+_0x4231f4+'\x22\x20might\x20not\x20exist');}}try{_0x7a49fd=eval(_0x7a49fd)[0x0];}catch(_0x22dbbb){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x8308('0x25')]);}const _0x3b9c1b=_0x7a49fd;_0x123abd=path[_0x8308('0x2a')](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+_0x8308('0x3c'));fs['writeFileSync'](_0x123abd,_0x7a49fd,{'encoding':_0x8308('0x2e')});_0x449876=path['resolve'](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+_0x8308('0x2c'));return convertFile(_0x123abd,_0x449876);})[_0x8308('0x2f')](function(){try{fs['unlink'](_0x123abd);fs[_0x8308('0x30')](_0x449876,_0x8308('0x40'));}catch(_0x54cd2d){logger[_0x8308('0x18')](_0x54cd2d);}logger[_0x8308('0x1e')](_0x8308('0x4f'),_0x449876[_0x8308('0x31')]('.')[0x0]);return _0x449876['split']('.')[0x0];});};exports['googleASR']=function(_0x402d8e,_0x50ea09,_0x47d6cf){return google['asr'](_0x402d8e,_0x50ea09,_0x47d6cf)[_0x8308('0x2f')](function(_0x1c0c4c){logger['info'](_0x1c0c4c[_0x8308('0x50')]);return rp(_0x1c0c4c);})['then'](function(_0x3845ba){var _0x46c122='';var _0x47a6b5=0x0;try{fs['unlink'](_0x402d8e);}catch(_0x3982a1){logger[_0x8308('0x18')](_0x3982a1);}if(_0x3845ba&&_0x3845ba[_0x8308('0x51')]){_0x46c122=_0x3845ba['results']['map'](function(_0x98b7d0){return _0x98b7d0&&_0x98b7d0['alternatives'][0x0]&&_0x98b7d0[_0x8308('0x52')][0x0][_0x8308('0x53')]?_0x98b7d0[_0x8308('0x52')][0x0][_0x8308('0x53')]:'';})[_0x8308('0x54')]('\x0a');_0x47a6b5=_0x3845ba[_0x8308('0x51')][_0x8308('0x55')](function(_0x591b3e){return _0x591b3e&&_0x591b3e[_0x8308('0x52')][0x0]&&_0x591b3e[_0x8308('0x52')][0x0][_0x8308('0x56')]?_0x591b3e[_0x8308('0x52')][0x0]['confidence']:0x0;})[_0x8308('0x54')]('\x0a');}logger[_0x8308('0x1e')](_0x8308('0x57'),_0x46c122);logger['info'](_0x8308('0x58'),_0x47a6b5);return{'transcript':_0x46c122,'confidence':_0x47a6b5};})['catch'](function(_0xf937b5){logger[_0x8308('0x18')]('[%s]\x20%s:%s',_0xf937b5['statusCode'],_0xf937b5[_0x8308('0x59')],_0xf937b5['message']);});};exports[_0x8308('0x5a')]=function(_0x1dd5b1,_0x1e2a25,_0x5eb6c8,_0x5683cf){var _0x52ba1a=apiai(_0x1e2a25,{'language':_0x5683cf||'en'});return _0x52ba1a[_0x8308('0x5b')](_0x5eb6c8,{'sessionId':md5(_0x1dd5b1)})[_0x8308('0x2f')](function(_0x2e723f){logger[_0x8308('0x1e')](JSON[_0x8308('0x47')](_0x2e723f));return{'source':_0x2e723f['result'][_0x8308('0x5c')],'resolvedQuery':_0x2e723f[_0x8308('0x5d')][_0x8308('0x5e')],'action':_0x2e723f[_0x8308('0x5d')][_0x8308('0x5f')],'actionIncomplete':_0x2e723f[_0x8308('0x5d')][_0x8308('0x60')],'speech':_0x2e723f[_0x8308('0x5d')][_0x8308('0x61')][_0x8308('0x62')],'score':_0x2e723f[_0x8308('0x5d')][_0x8308('0x63')],'statusCode':_0x2e723f[_0x8308('0x64')][_0x8308('0x65')],'endConversation':_0x2e723f[_0x8308('0x5d')][_0x8308('0x66')]['endConversation']||![],'isFallbackIntent':_0x2e723f['result'][_0x8308('0x66')][_0x8308('0x67')]};});};exports['googleDialogflowV2']=function(_0x4353dd,_0x547f43,_0x1c4317,_0x1e7002,_0x517018,_0x18b88e){var _0x3d1368=_0x1e7002[_0x8308('0x68')](/\\n/g,'\x0a');var _0x17fe11={'credentials':{'private_key':_0x3d1368,'client_email':_0x1c4317}};var _0x14f598=new dialogflow[(_0x8308('0x69'))](_0x17fe11);var _0x11e208=_0x14f598[_0x8308('0x6a')](_0x547f43,md5(_0x4353dd));var _0x2ee252={'session':_0x11e208,'queryInput':{'text':{'text':_0x517018,'languageCode':_0x18b88e}}};return _0x14f598[_0x8308('0x6b')](_0x2ee252)[_0x8308('0x2f')](function(_0x11da5a){if(_0x11da5a&&_0x11da5a[_0x8308('0x4c')]){logger['info'](_0x8308('0x6c'),JSON[_0x8308('0x47')](_0x11da5a));var _0x59c898=_0x11da5a[0x0];if(_0x59c898){var _0x5c97e6={'action':_0x59c898[_0x8308('0x6d')]['action'],'allRequiredParamsPresent':_0x59c898[_0x8308('0x6d')][_0x8308('0x6e')],'endConversation':_0x59c898[_0x8308('0x6d')][_0x8308('0x6f')]&&_0x59c898[_0x8308('0x6d')]['diagnosticInfo'][_0x8308('0x70')]?_0x59c898[_0x8308('0x6d')][_0x8308('0x6f')][_0x8308('0x70')]['end_conversation'][_0x8308('0x71')]:![],'fulfillmentText':_0x59c898[_0x8308('0x6d')][_0x8308('0x72')],'intentName':_0x59c898[_0x8308('0x6d')][_0x8308('0x73')][_0x8308('0x59')],'intentDisplayName':_0x59c898[_0x8308('0x6d')][_0x8308('0x73')]['displayName'],'isFallbackIntent':_0x59c898['queryResult'][_0x8308('0x73')]['isFallback'],'languageCode':_0x59c898['queryResult'][_0x8308('0x74')],'queryText':_0x59c898[_0x8308('0x6d')][_0x8308('0x75')],'responseId':_0x59c898[_0x8308('0x76')],'score':_0x59c898[_0x8308('0x6d')][_0x8308('0x77')],'speech':_0x59c898['queryResult'][_0x8308('0x72')],'providerResponse':JSON[_0x8308('0x47')](_0x11da5a)};return _0x5c97e6;}}});};exports[_0x8308('0x78')]=function(_0x53d01d,_0xad466d,_0x325a0b,_0x283bf5){return tilde[_0x8308('0x79')](_0x53d01d,_0xad466d,_0x325a0b,_0x283bf5)['then'](function(_0x3e541b){try{fs[_0x8308('0x20')](_0x53d01d);}catch(_0x4fe071){logger[_0x8308('0x18')](_0x4fe071);}logger[_0x8308('0x1e')](_0x8308('0x7a'),_0x3e541b[_0x8308('0x53')]);logger[_0x8308('0x1e')](_0x8308('0x7b'),_0x3e541b['confidence']);return _0x3e541b;});};exports[_0x8308('0x7c')]=function(_0xfb8aeb,_0x511584,_0x355ce9,_0x1f0064,_0x5d350d,_0x5e6c46){var _0x206f26=path['resolve'](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+'.mp3');var _0x286a77;return aws[_0x8308('0x7d')](_0xfb8aeb,_0x511584,_0x355ce9,_0x1f0064,_0x5d350d,_0x5e6c46,_0x206f26)[_0x8308('0x2f')](function(){_0x286a77=path[_0x8308('0x2a')](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+_0x8308('0x2c'));return convertFile(_0x206f26,_0x286a77);})[_0x8308('0x2f')](function(){try{fs[_0x8308('0x20')](_0x206f26);fs[_0x8308('0x30')](_0x286a77,'777');}catch(_0x243064){logger[_0x8308('0x18')](_0x243064);}return _0x286a77[_0x8308('0x31')]('.')[0x0];});};exports[_0x8308('0x7e')]=function(_0x9faa7c,_0x2dfd88,_0x4e44a0,_0x2ce971,_0x504570,_0x2d11e1){return aws[_0x8308('0x7f')](_0x9faa7c,_0x2dfd88,_0x4e44a0,_0x2ce971,_0x504570,_0x2d11e1)['then'](function(_0x4daab8){logger[_0x8308('0x1e')](JSON[_0x8308('0x47')](_0x4daab8));return _0x4daab8;});};exports[_0x8308('0x80')]=function(_0x5cdb18,_0x56a45c,_0x2bf123,_0x248101){var _0x408ab5=util['format'](_0x8308('0x81'),ISPEECH_API,_0x5cdb18,encodeURIComponent(_0x56a45c),_0x2bf123,_0x248101);var _0xd7962a=path['resolve'](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+'.mp3');var _0x12e6a3;return downloadFile(_0x408ab5,_0xd7962a)[_0x8308('0x2f')](function(){_0x12e6a3=path[_0x8308('0x2a')](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+_0x8308('0x2c'));return convertFile(_0xd7962a,_0x12e6a3);})[_0x8308('0x2f')](function(){try{fs[_0x8308('0x20')](_0xd7962a);fs[_0x8308('0x30')](_0x12e6a3,_0x8308('0x40'));}catch(_0x38e0fe){logger[_0x8308('0x18')](_0x38e0fe);}return _0x12e6a3[_0x8308('0x31')]('.')[0x0];});};exports['ispeechASR']=function(_0x1b8ebe,_0x1bf82f,_0x194b53,_0x53b3a5){var _0x4c37a4=util[_0x8308('0x82')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x1bf82f,_0x194b53,base64Encode(_0x1b8ebe),_0x53b3a5?util[_0x8308('0x82')]('model=%s',encodeURIComponent(_0x53b3a5)):'freeform=3');return uploadFile(_0x4c37a4)[_0x8308('0x2f')](function(_0x32e219){return querystring[_0x8308('0xc')](_0x32e219);});};exports[_0x8308('0x83')]=function(_0x1c14ed,_0x451db0){return sestek[_0x8308('0x84')](_0x1c14ed,_0x451db0)[_0x8308('0x2f')](function(_0x37dd7d){logger[_0x8308('0x1e')](JSON[_0x8308('0x47')](_0x37dd7d));var _0x51917d={'speech':_0x37dd7d[_0x8308('0x85')],'action':_0x37dd7d[_0x8308('0x86')]?_0x37dd7d[_0x8308('0x86')][_0x8308('0x87')]:undefined,'actiondata':_0x37dd7d['channelData']?_0x37dd7d[_0x8308('0x86')]['CustomActionData']:undefined};if(_0x37dd7d[_0x8308('0x86')]&&_0x37dd7d[_0x8308('0x86')]['AudioFromTts']){return base64Decode(_0x37dd7d[_0x8308('0x86')]['AudioFromTts']['Data'],path[_0x8308('0x2a')](__dirname,_0x8308('0x2b'),rs[_0x8308('0x3b')](0x4)+_0x8308('0x2c')))[_0x8308('0x2f')](function(_0x1c28bd){_0x51917d[_0x8308('0x88')]=_0x1c28bd;return _0x51917d;});}return _0x51917d;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
index d6ed4a3..61e2ca6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68b3=['./nda','exports'];(function(_0x5b8307,_0x188302){var _0x3f6c88=function(_0x723ca2){while(--_0x723ca2){_0x5b8307['push'](_0x5b8307['shift']());}};_0x3f6c88(++_0x188302);}(_0x68b3,0x1ec));var _0x368b=function(_0x32c76b,_0x3f48c1){_0x32c76b=_0x32c76b-0x0;var _0xeb84c2=_0x68b3[_0x32c76b];return _0xeb84c2;};var nda=require(_0x368b('0x0'));module[_0x368b('0x1')]={'nda':nda};
\ No newline at end of file
+var _0xc55e=['./nda','exports'];(function(_0x2c3b19,_0x370231){var _0x1e4d0e=function(_0x3b73b4){while(--_0x3b73b4){_0x2c3b19['push'](_0x2c3b19['shift']());}};_0x1e4d0e(++_0x370231);}(_0xc55e,0x146));var _0xec55=function(_0x464c05,_0x170587){_0x464c05=_0x464c05-0x0;var _0x2d30b9=_0xc55e[_0x464c05];return _0x2d30b9;};var nda=require(_0xec55('0x0'));module[_0xec55('0x1')]={'nda':nda};
\ No newline at end of file
index 5e57770..fe907ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24b3=['/token','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve'];(function(_0x48331d,_0x408218){var _0x1ee50a=function(_0x1b1bfe){while(--_0x1b1bfe){_0x48331d['push'](_0x48331d['shift']());}};_0x1ee50a(++_0x408218);}(_0x24b3,0xd3));var _0x324b=function(_0x2abfb0,_0x17cec6){_0x2abfb0=_0x2abfb0-0x0;var _0x2203aa=_0x24b3[_0x2abfb0];return _0x2203aa;};'use strict';var rp=require(_0x324b('0x0'));var url=require(_0x324b('0x1'));var logger=require(_0x324b('0x2'))('agi');module[_0x324b('0x3')]=function(_0x5691ab,_0x49ce20){var _0x51f113={'method':_0x324b('0x4'),'uri':url[_0x324b('0x5')](_0x49ce20['ndauth_url'],_0x324b('0x6')),'form':{'grant_type':'password','username':_0x49ce20['username'],'password':_0x49ce20['password']},'json':!![]};return rp(_0x51f113)[_0x324b('0x7')](function(_0x39d42c){var _0x7da7d0={'method':'POST','uri':url['resolve'](_0x49ce20['ndassistant_url'],_0x324b('0x8')),'body':{'type':_0x49ce20['ndaactivity_type']||_0x324b('0x9'),'channelId':_0x324b('0xa'),'conversation':{'id':_0x5691ab[_0x324b('0xb')]},'from':{'id':_0x5691ab[_0x324b('0xc')],'name':_0x5691ab[_0x324b('0xd')]},'recipient':{'id':_0x5691ab[_0x324b('0xe')],'name':_0x5691ab[_0x324b('0xf')]},'text':_0x49ce20[_0x324b('0x10')],'channelData':{}},'headers':{'Authorization':_0x324b('0x11')+_0x39d42c[_0x324b('0x12')]},'json':!![]};if(_0x49ce20['project']){_0x7da7d0[_0x324b('0x13')][_0x324b('0x14')][_0x324b('0x15')]=_0x49ce20[_0x324b('0x16')];}if(_0x49ce20[_0x324b('0x17')]=='1'){_0x7da7d0[_0x324b('0x13')][_0x324b('0x14')][_0x324b('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x324b('0x19')};}if(_0x49ce20[_0x324b('0x1a')]){_0x7da7d0['body'][_0x324b('0x14')]['CustomAction']=_0x49ce20[_0x324b('0x1a')];if(_0x49ce20[_0x324b('0x1b')]){_0x7da7d0['body'][_0x324b('0x14')][_0x324b('0x1c')]=_0x49ce20[_0x324b('0x1b')];}}logger[_0x324b('0x1d')](JSON[_0x324b('0x1e')](_0x7da7d0));return rp(_0x7da7d0);});};
\ No newline at end of file
+var _0x3306=['AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','/token','password','username','then','ndassistant_url','ndaactivity_type','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','body','channelData','ProjectName','project','ndagenerate_audio'];(function(_0x2f5045,_0x50d5b2){var _0x33f7d8=function(_0x24c640){while(--_0x24c640){_0x2f5045['push'](_0x2f5045['shift']());}};_0x33f7d8(++_0x50d5b2);}(_0x3306,0x107));var _0x6330=function(_0x412333,_0x570efc){_0x412333=_0x412333-0x0;var _0x37ec68=_0x3306[_0x412333];return _0x37ec68;};'use strict';var rp=require(_0x6330('0x0'));var url=require(_0x6330('0x1'));var logger=require(_0x6330('0x2'))(_0x6330('0x3'));module['exports']=function(_0x29210d,_0x440976){var _0x31a936={'method':_0x6330('0x4'),'uri':url[_0x6330('0x5')](_0x440976['ndauth_url'],_0x6330('0x6')),'form':{'grant_type':_0x6330('0x7'),'username':_0x440976[_0x6330('0x8')],'password':_0x440976[_0x6330('0x7')]},'json':!![]};return rp(_0x31a936)[_0x6330('0x9')](function(_0x4561f7){var _0x274386={'method':_0x6330('0x4'),'uri':url[_0x6330('0x5')](_0x440976[_0x6330('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x440976[_0x6330('0xb')]||'message','channelId':_0x6330('0xc'),'conversation':{'id':_0x29210d[_0x6330('0xd')]},'from':{'id':_0x29210d[_0x6330('0xe')],'name':_0x29210d[_0x6330('0xf')]},'recipient':{'id':_0x29210d[_0x6330('0x10')],'name':_0x29210d[_0x6330('0x11')]},'text':_0x440976[_0x6330('0x12')],'channelData':{}},'headers':{'Authorization':_0x6330('0x13')+_0x4561f7['access_token']},'json':!![]};if(_0x440976['project']){_0x274386[_0x6330('0x14')][_0x6330('0x15')][_0x6330('0x16')]=_0x440976[_0x6330('0x17')];}if(_0x440976[_0x6330('0x18')]=='1'){_0x274386['body'][_0x6330('0x15')][_0x6330('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6330('0x1a')};}if(_0x440976[_0x6330('0x1b')]){_0x274386['body']['channelData'][_0x6330('0x1c')]=_0x440976[_0x6330('0x1b')];if(_0x440976[_0x6330('0x1d')]){_0x274386['body'][_0x6330('0x15')][_0x6330('0x1e')]=_0x440976['custom_action_data'];}}logger['info'](JSON[_0x6330('0x1f')](_0x274386));return rp(_0x274386);});};
\ No newline at end of file
index 98c7634..67eb719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcec5=['./lib/api'];(function(_0x2e4b3e,_0x28a86f){var _0x4adfa2=function(_0x2ae422){while(--_0x2ae422){_0x2e4b3e['push'](_0x2e4b3e['shift']());}};_0x4adfa2(++_0x28a86f);}(_0xcec5,0x13d));var _0x5cec=function(_0x4036b0,_0x43c621){_0x4036b0=_0x4036b0-0x0;var _0x139797=_0xcec5[_0x4036b0];return _0x139797;};'use strict';var asr=require(_0x5cec('0x0'));module['exports']=function(_0x3df6b0,_0x5db346,_0xa3de1e,_0x4c3659){return asr(_0x3df6b0,_0x5db346,_0xa3de1e,_0x4c3659);};
\ No newline at end of file
+var _0xe077=['./lib/api'];(function(_0x5b4a2d,_0x170494){var _0x147784=function(_0x5d4719){while(--_0x5d4719){_0x5b4a2d['push'](_0x5b4a2d['shift']());}};_0x147784(++_0x170494);}(_0xe077,0x1b1));var _0x7e07=function(_0x2b4cb4,_0x18a0ad){_0x2b4cb4=_0x2b4cb4-0x0;var _0x112fb6=_0xe077[_0x2b4cb4];return _0x112fb6;};'use strict';var asr=require(_0x7e07('0x0'));module['exports']=function(_0x2fb461,_0x4f41b6,_0x36a98e,_0x2bf2f2){return asr(_0x2fb461,_0x4f41b6,_0x36a98e,_0x2bf2f2);};
\ No newline at end of file
index 53da450..fd36206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5241=['open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isObject'];(function(_0x2cf3e4,_0x50ff08){var _0x377352=function(_0x389a63){while(--_0x389a63){_0x2cf3e4['push'](_0x2cf3e4['shift']());}};_0x377352(++_0x50ff08);}(_0x5241,0x16a));var _0x1524=function(_0x2f22ed,_0x1e46b8){_0x2f22ed=_0x2f22ed-0x0;var _0xf25a19=_0x5241[_0x2f22ed];return _0xf25a19;};'use strict';var BPromise=require(_0x1524('0x0'));var _=require(_0x1524('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x1524('0x2'));var crypto=require(_0x1524('0x3'));var logger=require(_0x1524('0x4'))('agi');module['exports']=function(_0x56d33d,_0x305a65,_0x2e2c35,_0x3f0151){return new BPromise(function(_0x51bac5,_0x3661fb){logger[_0x1524('0x5')](_0x1524('0x6'),_0x3f0151||_0x1524('0x7'));var _0x427593=new WebSocket(_0x3f0151||_0x1524('0x7'),{'perMessageDeflate':![]});var _0x4cf645='';var _0xc9e67d='0';var _0x17f77e='1';var _0x392e35=_0x1524('0x8');function _0x28b2d4(_0x2d6760){var _0x5c4137=crypto[_0x1524('0x9')](_0x1524('0xa'));_0x5c4137['update'](_0x2d6760);return _0x5c4137[_0x1524('0xb')](_0x1524('0xc'));}function _0xac6a80(){try{logger['info'](_0x1524('0xd'));var _0x31162f=moment()[_0x1524('0xe')]();var _0x497bb5=_0x28b2d4(_0x31162f+_0x305a65+_0x2e2c35);_0x427593[_0x1524('0xf')](JSON[_0x1524('0x10')]({'appID':_0x305a65,'timestamp':_0x31162f,'appKey':_0x497bb5}));var _0x302c88=fs[_0x1524('0x11')](_0x56d33d);_0x302c88['on'](_0x1524('0x12'),function(_0xf34d17){_0x427593['send'](_0xf34d17);});_0x302c88['on'](_0x1524('0x13'),function(){_0x427593[_0x1524('0xf')]('EOS');});}catch(_0x463ac8){logger[_0x1524('0x14')](_0x1524('0x15'),JSON[_0x1524('0x10')](_0x463ac8));_0x427593[_0x1524('0x16')]();}}function _0x59f451(_0x2fbbc0){try{if(_0x2fbbc0){var _0x195f67=JSON[_0x1524('0x17')](_0x2fbbc0);switch(_0x195f67[_0x1524('0x18')]){case 0x0:if(_0x195f67[_0x1524('0x19')]){if(_0x195f67[_0x1524('0x19')][_0x1524('0x1a')]){logger[_0x1524('0x5')](_0x1524('0x1b'),JSON[_0x1524('0x10')](_0x195f67[_0x1524('0x19')][_0x1524('0x1c')]));_0x4cf645=_0x195f67[_0x1524('0x19')][_0x1524('0x1c')][0x0][_0x1524('0x1d')];_0xc9e67d=_0x195f67[_0x1524('0x19')][_0x1524('0x1c')][0x0][_0x1524('0x1e')];_0x17f77e='0';_0x392e35='Success.';_0x427593[_0x1524('0x16')]();}}break;case 0x1:logger[_0x1524('0x5')](_0x1524('0x8'));_0x17f77e='1';_0x392e35=_0x1524('0x8');break;case 0x2:logger[_0x1524('0x5')](_0x1524('0x1f'));_0x17f77e='2';_0x392e35=_0x1524('0x1f');break;case 0x9:logger[_0x1524('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x17f77e='9';_0x392e35=_0x1524('0x20');break;case 0xa:logger[_0x1524('0x5')](_0x1524('0x21'));_0x17f77e='10';_0x392e35='Authentication\x20failed.';break;case 0xb:logger[_0x1524('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x17f77e='11';_0x392e35=_0x1524('0x22');}}}catch(_0x51e0cc){logger[_0x1524('0x14')](_0x1524('0x23'),JSON[_0x1524('0x10')](_0x51e0cc));_0x427593[_0x1524('0x16')]();}}function _0x5ba3fb(){logger[_0x1524('0x5')](_0x1524('0x24'));_0x51bac5({'transcript':_0x4cf645,'confidence':_0xc9e67d,'status':_0x17f77e,'status_message':_0x392e35});}function _0x893acf(_0x26dfcc){logger[_0x1524('0x14')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x26dfcc)){logger[_0x1524('0x14')](_[_0x1524('0x25')](_0x26dfcc)?JSON['stringify'](_0x26dfcc):_0x26dfcc);}}_0x427593['on'](_0x1524('0x26'),_0xac6a80);_0x427593['on'](_0x1524('0x27'),_0x59f451);_0x427593['on'](_0x1524('0x13'),_0x5ba3fb);_0x427593['on']('error',_0x893acf);});};
\ No newline at end of file
+var _0x49ec=['moment','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','digest','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird'];(function(_0x1ae048,_0x3ed9f0){var _0x10ad82=function(_0x1076ee){while(--_0x1076ee){_0x1ae048['push'](_0x1ae048['shift']());}};_0x10ad82(++_0x3ed9f0);}(_0x49ec,0x102));var _0xc49e=function(_0x404a80,_0x302cab){_0x404a80=_0x404a80-0x0;var _0x4e0e1a=_0x49ec[_0x404a80];return _0x4e0e1a;};'use strict';var BPromise=require(_0xc49e('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc49e('0x1'));var crypto=require('crypto');var logger=require(_0xc49e('0x2'))(_0xc49e('0x3'));module[_0xc49e('0x4')]=function(_0x2472a5,_0x2f6833,_0x32510a,_0x357faf){return new BPromise(function(_0x23bf3b,_0x30fc85){logger[_0xc49e('0x5')]('Tilde\x20URI',_0x357faf||_0xc49e('0x6'));var _0x4b5a45=new WebSocket(_0x357faf||_0xc49e('0x6'),{'perMessageDeflate':![]});var _0x219836='';var _0x4af506='0';var _0x178059='1';var _0x591a5b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2f35e3(_0xa486c9){var _0x3f2e32=crypto[_0xc49e('0x7')](_0xc49e('0x8'));_0x3f2e32['update'](_0xa486c9);return _0x3f2e32[_0xc49e('0x9')]('hex');}function _0x3f03f3(){try{logger[_0xc49e('0x5')](_0xc49e('0xa'));var _0x42b242=moment()['unix']();var _0x331b8e=_0x2f35e3(_0x42b242+_0x2f6833+_0x32510a);_0x4b5a45[_0xc49e('0xb')](JSON[_0xc49e('0xc')]({'appID':_0x2f6833,'timestamp':_0x42b242,'appKey':_0x331b8e}));var _0x113ecd=fs[_0xc49e('0xd')](_0x2472a5);_0x113ecd['on'](_0xc49e('0xe'),function(_0x1cefd1){_0x4b5a45['send'](_0x1cefd1);});_0x113ecd['on']('close',function(){_0x4b5a45[_0xc49e('0xb')](_0xc49e('0xf'));});}catch(_0x3fadc9){logger[_0xc49e('0x10')](_0xc49e('0x11'),JSON[_0xc49e('0xc')](_0x3fadc9));_0x4b5a45[_0xc49e('0x12')]();}}function _0x15dce9(_0x5bf869){try{if(_0x5bf869){var _0x48171b=JSON[_0xc49e('0x13')](_0x5bf869);switch(_0x48171b[_0xc49e('0x14')]){case 0x0:if(_0x48171b[_0xc49e('0x15')]){if(_0x48171b[_0xc49e('0x15')][_0xc49e('0x16')]){logger[_0xc49e('0x5')](_0xc49e('0x17'),JSON['stringify'](_0x48171b[_0xc49e('0x15')][_0xc49e('0x18')]));_0x219836=_0x48171b[_0xc49e('0x15')][_0xc49e('0x18')][0x0][_0xc49e('0x19')];_0x4af506=_0x48171b[_0xc49e('0x15')]['hypotheses'][0x0][_0xc49e('0x1a')];_0x178059='0';_0x591a5b='Success.';_0x4b5a45['terminate']();}}break;case 0x1:logger[_0xc49e('0x5')](_0xc49e('0x1b'));_0x178059='1';_0x591a5b=_0xc49e('0x1b');break;case 0x2:logger[_0xc49e('0x5')](_0xc49e('0x1c'));_0x178059='2';_0x591a5b=_0xc49e('0x1c');break;case 0x9:logger[_0xc49e('0x5')](_0xc49e('0x1d'));_0x178059='9';_0x591a5b=_0xc49e('0x1d');break;case 0xa:logger[_0xc49e('0x5')](_0xc49e('0x1e'));_0x178059='10';_0x591a5b=_0xc49e('0x1e');break;case 0xb:logger['info'](_0xc49e('0x1f'));_0x178059='11';_0x591a5b=_0xc49e('0x1f');}}}catch(_0x54e09a){logger[_0xc49e('0x10')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xc49e('0xc')](_0x54e09a));_0x4b5a45[_0xc49e('0x12')]();}}function _0x21cb95(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x23bf3b({'transcript':_0x219836,'confidence':_0x4af506,'status':_0x178059,'status_message':_0x591a5b});}function _0x283efc(_0x1f25e6){logger['error'](_0xc49e('0x20'));if(!_[_0xc49e('0x21')](_0x1f25e6)){logger[_0xc49e('0x10')](_[_0xc49e('0x22')](_0x1f25e6)?JSON[_0xc49e('0xc')](_0x1f25e6):_0x1f25e6);}}_0x4b5a45['on'](_0xc49e('0x23'),_0x3f03f3);_0x4b5a45['on'](_0xc49e('0x24'),_0x15dce9);_0x4b5a45['on']('close',_0x21cb95);_0x4b5a45['on'](_0xc49e('0x10'),_0x283efc);});};
\ No newline at end of file
index 5efea85..00dc3b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b4c=['exports'];(function(_0x242b15,_0x546fe1){var _0x40443a=function(_0x4ed34f){while(--_0x4ed34f){_0x242b15['push'](_0x242b15['shift']());}};_0x40443a(++_0x546fe1);}(_0x1b4c,0x10e));var _0xc1b4=function(_0x2a217b,_0xb039df){_0x2a217b=_0x2a217b-0x0;var _0x29a6ac=_0x1b4c[_0x2a217b];return _0x29a6ac;};var asr=require('./asr');module[_0xc1b4('0x0')]={'asr':asr};
\ No newline at end of file
+var _0xa117=['exports','./asr'];(function(_0x780ce4,_0x14412c){var _0x424bfb=function(_0x427900){while(--_0x427900){_0x780ce4['push'](_0x780ce4['shift']());}};_0x424bfb(++_0x14412c);}(_0xa117,0x1d5));var _0x7a11=function(_0x111a83,_0x145ec6){_0x111a83=_0x111a83-0x0;var _0x35f303=_0xa117[_0x111a83];return _0x35f303;};var asr=require(_0x7a11('0x0'));module[_0x7a11('0x1')]={'asr':asr};
\ No newline at end of file
index 5b654a7..c21ca62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x004a=['E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','./error','./channel','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','emit'];(function(_0x157a8a,_0x34d072){var _0x5bf33f=function(_0x4fc182){while(--_0x4fc182){_0x157a8a['push'](_0x157a8a['shift']());}};_0x5bf33f(++_0x34d072);}(_0x004a,0x17f));var _0xa004=function(_0x54c51e,_0x2a7547){_0x54c51e=_0x54c51e-0x0;var _0x527506=_0x004a[_0x54c51e];return _0x527506;};'use strict';var util=require(_0xa004('0x0'));var net=require(_0xa004('0x1'));var EventEmitter=require(_0xa004('0x2'))['EventEmitter'];var AGIError=require(_0xa004('0x3'));var AGIChannel=require(_0xa004('0x4'));var AGIServer=function(_0x5afea9,_0x9e7b3c,_0x56ab10){var _0xb10543=this,_0x5afea9=_0x5afea9||0x11dd,_0x9e7b3c=_0x9e7b3c||'127.0.0.1',_0x20a5a6=null,_0x106c34=0x0;EventEmitter[_0xa004('0x5')](_0xb10543);function _0x8817d7(){if(!_0x5afea9){_0xb10543['emit'](_0xa004('0x6'),new AGIError(_0xa004('0x7')));return![];}_0x20a5a6=net[_0xa004('0x8')]();_0x20a5a6[_0xa004('0x9')](_0x5afea9,_0x9e7b3c);_0x20a5a6['on'](_0xa004('0xa'),function(){_0xb10543['emit'](_0xa004('0xa'));});_0x20a5a6['on'](_0xa004('0xb'),function(_0x20b8b4){_0x20a5a6['getConnections'](function(_0x37c7c7,_0x1d7757){if(_0x37c7c7){_0xb10543[_0xa004('0xc')]('error',new AGIError(_0xa004('0xd'),_0x37c7c7));}else if(_0x56ab10&&_0x56ab10<0x0){_0xb10543[_0xa004('0xc')](_0xa004('0x6'),new AGIError(_0xa004('0xe')));_0x20b8b4[_0xa004('0xf')]();}else if(_0x56ab10&&_0x56ab10>0x0&&_0x56ab10<_0x1d7757){_0x106c34+=0x1;_0xb10543['emit'](_0xa004('0x6'),new AGIError(_0xa004('0x10'),_0x106c34));_0x20b8b4['destroy']();}else{var _0x3ce18d=new AGIChannel(_0x20b8b4);_0x3ce18d['on']('ready',function(){_0xb10543[_0xa004('0xc')](_0xa004('0xb'),_0x3ce18d);});}});});_0x20a5a6['on'](_0xa004('0x6'),function(_0xbb0839){_0xb10543[_0xa004('0xc')]('error',new AGIError('E_AGI_SERVER_ERROR',_0xbb0839[_0xa004('0x11')]));});_0x20a5a6['on'](_0xa004('0x12'),function(){_0xb10543['emit'](_0xa004('0x12'),new AGIError(_0xa004('0x13')));});}process[_0xa004('0x14')](function(){_0x8817d7();});};util[_0xa004('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x11967f,_0x442c33,_0x1b36c3){return new AGIServer(_0x11967f,_0x442c33,_0x1b36c3);};
\ No newline at end of file
+var _0xe2e9=['listen','listening','emit','connection','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','inherits','util','net','EventEmitter','./error','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xe2e9,0x19b));var _0x9e2e=function(_0x1e909d,_0x4a8f3d){_0x1e909d=_0x1e909d-0x0;var _0x4762cd=_0xe2e9[_0x1e909d];return _0x4762cd;};'use strict';var util=require(_0x9e2e('0x0'));var net=require(_0x9e2e('0x1'));var EventEmitter=require('events')[_0x9e2e('0x2')];var AGIError=require(_0x9e2e('0x3'));var AGIChannel=require(_0x9e2e('0x4'));var AGIServer=function(_0x3f007b,_0x3ddfc3,_0x3690d9){var _0x4ff655=this,_0x3f007b=_0x3f007b||0x11dd,_0x3ddfc3=_0x3ddfc3||_0x9e2e('0x5'),_0x7caa3d=null,_0x2b271b=0x0;EventEmitter[_0x9e2e('0x6')](_0x4ff655);function _0x46bcf9(){if(!_0x3f007b){_0x4ff655['emit'](_0x9e2e('0x7'),new AGIError(_0x9e2e('0x8')));return![];}_0x7caa3d=net['createServer']();_0x7caa3d[_0x9e2e('0x9')](_0x3f007b,_0x3ddfc3);_0x7caa3d['on'](_0x9e2e('0xa'),function(){_0x4ff655[_0x9e2e('0xb')](_0x9e2e('0xa'));});_0x7caa3d['on'](_0x9e2e('0xc'),function(_0x3c757c){_0x7caa3d[_0x9e2e('0xd')](function(_0x53559d,_0x456768){if(_0x53559d){_0x4ff655[_0x9e2e('0xb')](_0x9e2e('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x53559d));}else if(_0x3690d9&&_0x3690d9<0x0){_0x4ff655[_0x9e2e('0xb')](_0x9e2e('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x3c757c[_0x9e2e('0xe')]();}else if(_0x3690d9&&_0x3690d9>0x0&&_0x3690d9<_0x456768){_0x2b271b+=0x1;_0x4ff655[_0x9e2e('0xb')](_0x9e2e('0x7'),new AGIError(_0x9e2e('0xf'),_0x2b271b));_0x3c757c[_0x9e2e('0xe')]();}else{var _0x249b84=new AGIChannel(_0x3c757c);_0x249b84['on']('ready',function(){_0x4ff655[_0x9e2e('0xb')](_0x9e2e('0xc'),_0x249b84);});}});});_0x7caa3d['on'](_0x9e2e('0x7'),function(_0x3cb097){_0x4ff655[_0x9e2e('0xb')](_0x9e2e('0x7'),new AGIError(_0x9e2e('0x10'),_0x3cb097[_0x9e2e('0x11')]));});_0x7caa3d['on'](_0x9e2e('0x12'),function(){_0x4ff655[_0x9e2e('0xb')](_0x9e2e('0x12'),new AGIError(_0x9e2e('0x13')));});}process['nextTick'](function(){_0x46bcf9();});};util[_0x9e2e('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x7401e4,_0x5b0fc1,_0x1cde7b){return new AGIServer(_0x7401e4,_0x5b0fc1,_0x1cde7b);};
\ No newline at end of file
index e6eef7e..18acd73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4a0=['getVariable','rpc','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getUser','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervalById','IntervalId','interval','Intervals','format','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','uniqueid','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','utcOffset','scheduledat','minutes','insertContact','timezones','add','agent','agentPause','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','awsPolly','aws_access_key_id','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','googleASR','google_asr_language','tildeASR','appid','uri','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','stringify','split','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','grammar','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','bot','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','providerResponse','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','opts','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20found','getData','response','maxdigit','test','extra','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','getIntervals','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','operation','math\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_CODE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','authentication','auth','user','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','replaceAll','util','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4a0,0x1c7));var _0x0c4a=function(_0x32e391,_0x116908){_0x32e391=_0x32e391-0x0;var _0x1cbdae=_0xc4a0[_0x32e391];return _0x1cbdae;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x0c4a('0x0'));var _=require('lodash');var sh=require(_0x0c4a('0x1'));var odbc=require(_0x0c4a('0x2'))();var rs=require(_0x0c4a('0x3'));var moment=require(_0x0c4a('0x4'));var Mustache=require('mustache');var rp=require(_0x0c4a('0x5'));var logger=require(_0x0c4a('0x6'))(_0x0c4a('0x7'));var config=require('../../config/environment');var shared=require(_0x0c4a('0x8'));var scripts=require(_0x0c4a('0x9'));var FILES_PATH=_0x0c4a('0xa');var recursiveMapAttributes=[_0x0c4a('0xb'),_0x0c4a('0xc')];var verticesWithRetry=[_0x0c4a('0xd'),_0x0c4a('0xe'),_0x0c4a('0xf')];var AGIVertices=function(_0x50698c,_0x40a798,_0x26e608){this[_0x0c4a('0x10')]=_0x50698c;this['rpc']=_0x40a798;this['mailRpc']=_0x26e608;};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x12')]=function(_0x54d7e3,_0x52579c){this[_0x0c4a('0x13')][_0x0c4a('0x14')](_0x54d7e3)[_0x0c4a('0x15')](function(_0x2a86f0){_0x52579c(null,_0x2a86f0?_0x2a86f0[_0x0c4a('0x16')]:![]);})[_0x0c4a('0x17')](function(_0x264110){_0x52579c(_0x264110);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x18')]=function(_0x26ae55,_0x5cf900){this[_0x0c4a('0x13')]['getVoiceQueueById'](_0x26ae55)[_0x0c4a('0x15')](function(_0x54a623){_0x5cf900(null,_0x54a623?_0x54a623[_0x0c4a('0x16')]:![]);})['catch'](function(_0x55b465){_0x5cf900(_0x55b465);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x19')]=function(_0x3a2c1a,_0x4de379){this['rpc']['getSquareProjectById'](_0x3a2c1a)['then'](function(_0x368206){_0x4de379(null,_0x368206?_0x368206['name']:![]);})[_0x0c4a('0x17')](function(_0x15bf89){_0x4de379(_0x15bf89);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x80b1c9,_0x355186){this[_0x0c4a('0x13')]['getSquareOdbcById'](_0x80b1c9)[_0x0c4a('0x15')](function(_0x5e5a60){_0x355186(null,_0x5e5a60?_0x5e5a60['dsn']:![]);})[_0x0c4a('0x17')](function(_0x30ac4b){_0x355186(_0x30ac4b);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1a')]=function(_0x2876ca,_0x45fbf3){this[_0x0c4a('0x13')]['getUserById'](_0x2876ca)[_0x0c4a('0x15')](function(_0xf11186){_0x45fbf3(null,_0xf11186?_0xf11186[_0x0c4a('0x16')]:![]);})[_0x0c4a('0x17')](function(_0x33ee52){_0x45fbf3(_0x33ee52);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1b')]=function(_0x1331ec,_0xae901c){this[_0x0c4a('0x13')]['getTrunkById'](_0x1331ec)[_0x0c4a('0x15')](function(_0x38db3a){_0xae901c(null,_0x38db3a?_0x38db3a[_0x0c4a('0x16')]:![]);})[_0x0c4a('0x17')](function(_0x342cb7){_0xae901c(_0x342cb7);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1c')]=function(_0x2c85e7,_0x160911){var _0x21ea2c=this;this['rpc'][_0x0c4a('0x1d')](_0x2c85e7)[_0x0c4a('0x15')](function(_0x386926){_0x160911(null,_0x386926?_0x21ea2c[_0x0c4a('0x1e')](_0x386926[_0x0c4a('0x1f')]):![]);})[_0x0c4a('0x17')](function(_0x290e8d){_0x160911(_0x290e8d);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x20')]=function(_0x47c12d,_0x2d6f22){this[_0x0c4a('0x13')][_0x0c4a('0x21')](_0x47c12d)['then'](function(_0x386295){_0x2d6f22(null,_0x386295?_0x386295:![]);})[_0x0c4a('0x17')](function(_0x3b83e3){_0x2d6f22(_0x3b83e3);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x22')]=function(_0x91cebf,_0x54735b,_0x517bac){this[_0x0c4a('0x23')][_0x0c4a('0x22')](_0x91cebf,_0x54735b)[_0x0c4a('0x15')](function(){_0x517bac(null);})[_0x0c4a('0x17')](function(_0x2c9608){_0x517bac(_0x2c9608);});};AGIVertices[_0x0c4a('0x11')]['getIntervals']=function(_0x3fc466,_0x4a8cac){this[_0x0c4a('0x13')][_0x0c4a('0x24')](_0x3fc466)[_0x0c4a('0x15')](function(_0x467f82){if(_0x467f82){if(_0x467f82[_0x0c4a('0x25')]){_0x4a8cac(null,[_0x467f82[_0x0c4a('0x26')]]);}else{_0x4a8cac(null,_['map'](_0x467f82[_0x0c4a('0x27')],_0x0c4a('0x26')));}}else{_0x4a8cac(null,![]);}})[_0x0c4a('0x17')](function(_0x512e7e){_0x4a8cac(_0x512e7e);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1e')]=function(_0x1fdb9b){return util[_0x0c4a('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x1fdb9b);};AGIVertices['prototype'][_0x0c4a('0x29')]=function(_0x4494bd,_0x4b612b,_0x5ab027){odbc[_0x0c4a('0x2a')](_0x4494bd,function(_0x1671f8){if(_0x1671f8){logger[_0x0c4a('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1671f8);_0x5ab027(_0x1671f8);}else{logger[_0x0c4a('0x2c')](_0x0c4a('0x2d'));odbc['query'](_0x4b612b,function(_0x23f3f6,_0x12997b){if(_0x23f3f6){logger[_0x0c4a('0x2c')](_0x0c4a('0x2e'),_0x4b612b);_0x5ab027(_0x23f3f6);}else{logger[_0x0c4a('0x2c')](_0x0c4a('0x2f'),_0x4b612b);odbc[_0x0c4a('0x30')](function(_0x452605){if(_0x452605){logger[_0x0c4a('0x2b')](_0x0c4a('0x31'),_0x452605);}_0x5ab027(null,_0x12997b);});}});}});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x32')]=function(_0x2bd7a5,_0x525411){this[_0x0c4a('0x13')][_0x0c4a('0x33')](_0x2bd7a5)['then'](function(_0x27f2c2){_0x525411(null,_0x27f2c2?_0x27f2c2:![]);})['catch'](function(_0x5f21d1){_0x525411(_0x5f21d1);});};AGIVertices['prototype'][_0x0c4a('0x34')]=function(_0x3fcfe1,_0x556c94){this[_0x0c4a('0x13')][_0x0c4a('0x34')](_0x3fcfe1)[_0x0c4a('0x15')](function(_0x1b274a){_0x556c94(null,_0x1b274a);})[_0x0c4a('0x17')](function(_0x1f534e){_0x556c94(_0x1f534e);});};AGIVertices[_0x0c4a('0x11')]['createSquareDetailsReport']=function(_0x50cf6f,_0x6944d1,_0x5859d3){this[_0x0c4a('0x13')][_0x0c4a('0x35')]({'uniqueid':this['channel']['uniqueid'],'node':_0x50cf6f[_0x0c4a('0x36')],'application':_0x50cf6f[_0x0c4a('0x37')],'data':_0x6944d1||null,'project_name':this[_0x0c4a('0x10')][_0x0c4a('0x38')],'callerid':this['channel'][_0x0c4a('0x39')]})[_0x0c4a('0x15')](function(_0x3b4041){if(_0x5859d3){_0x5859d3(null,_0x3b4041);}})['catch'](function(_0x57f6cd){if(_0x5859d3){_0x5859d3(_0x57f6cd);}});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x3a')]=function(_0x34a124,_0x2d429e,_0xa98e72,_0x2eefed){this[_0x0c4a('0x13')][_0x0c4a('0x3a')]({'uniqueid':this[_0x0c4a('0x10')]['uniqueid'],'callerid':this[_0x0c4a('0x10')][_0x0c4a('0x39')],'calleridname':this['channel'][_0x0c4a('0x3b')],'context':this[_0x0c4a('0x10')][_0x0c4a('0x3c')],'extension':this[_0x0c4a('0x10')]['extension'],'priority':this[_0x0c4a('0x10')][_0x0c4a('0x3d')],'accountcode':this[_0x0c4a('0x10')][_0x0c4a('0x3e')],'dnid':this[_0x0c4a('0x10')][_0x0c4a('0x3f')],'projectName':this['channel']['arg_1'],'saveName':_0x2d429e,'filename':_0x34a124[_0x0c4a('0x40')]||_0x2d429e,'savePath':_0xa98e72})[_0x0c4a('0x15')](function(_0x3511da){_0x2eefed(null,_0x3511da);})['catch'](function(_0x523e56){_0x2eefed(_0x523e56);});};AGIVertices[_0x0c4a('0x11')]['createSquareMessage']=function(_0x27f40f,_0x689bd7,_0x3eb331,_0x4400b2,_0x16e77e){this[_0x0c4a('0x13')][_0x0c4a('0x41')]({'uniqueid':this['channel'][_0x0c4a('0x42')],'body':_0x27f40f,'direction':_0x689bd7,'providerName':_0x3eb331,'providerResponse':_0x4400b2})['then'](function(_0x1ea9a3){if(_0x16e77e){_0x16e77e(null,_0x1ea9a3);}})[_0x0c4a('0x17')](function(_0x5e942f){if(_0x16e77e){_0x16e77e(_0x5e942f);}});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x43')]=function(_0x1dc9b3,_0x43ec47){var _0x3bf3b2=this;var _0x17e892=0x0;var _0x406bd4={'firstName':_['isEmpty'](_0x1dc9b3[_0x0c4a('0x16')])||_[_0x0c4a('0x44')](_0x1dc9b3[_0x0c4a('0x16')])?_0x0c4a('0x45')+Math[_0x0c4a('0x46')]():_0x1dc9b3[_0x0c4a('0x16')],'lastName':_[_0x0c4a('0x47')](_0x1dc9b3[_0x0c4a('0x48')])||_[_0x0c4a('0x44')](_0x1dc9b3[_0x0c4a('0x48')])?null:_0x1dc9b3['lastName'],'phone':_0x1dc9b3[_0x0c4a('0x49')],'ListId':_0x1dc9b3[_0x0c4a('0x4a')],'scheduledat':_0x1dc9b3[_0x0c4a('0x4b')],'callbackUniqueid':this[_0x0c4a('0x10')][_0x0c4a('0x42')],'tags':_0x0c4a('0x4c'),'description':'Callback\x20scheduled\x20at\x20'+_0x1dc9b3[_0x0c4a('0x4b')][_0x0c4a('0x4d')](),'priority':_0x1dc9b3[_0x0c4a('0x4e')]};if(_[_0x0c4a('0x4f')](_0x1dc9b3,_0x0c4a('0x50'))){if(!_[_0x0c4a('0x44')](_0x1dc9b3[_0x0c4a('0x50')])){var _0x545492=_0x1dc9b3[_0x0c4a('0x50')];if(_0x1dc9b3[_0x0c4a('0x50')]==_0x0c4a('0x51')){this[_0x0c4a('0x13')]['getContactByPhone']({'phone':_0x1dc9b3[_0x0c4a('0x49')]})[_0x0c4a('0x15')](function(_0x2a35f7){if(!_[_0x0c4a('0x44')](_0x2a35f7)){var _0x35045a=_0x2a35f7[_0x0c4a('0x50')];if(!_[_0x0c4a('0x44')](_0x35045a)){var _0x1e1e17=shared['timezones'][_0x35045a];if(!_[_0x0c4a('0x44')](_0x1e1e17)){var _0xe66c65=-0x1*_0x1e1e17[_0x0c4a('0x52')];_0x406bd4[_0x0c4a('0x53')]=moment(_0x1dc9b3[_0x0c4a('0x53')])['add'](_0xe66c65,_0x0c4a('0x54'));_0x406bd4[_0x0c4a('0x50')]=_0x35045a;_0x406bd4[_0x0c4a('0x52')]=_0x1e1e17[_0x0c4a('0x52')];_0x3bf3b2[_0x0c4a('0x55')](_0x406bd4,_0x1dc9b3,_0x43ec47);}else{_0x3bf3b2[_0x0c4a('0x55')](_0x406bd4,_0x1dc9b3,_0x43ec47);}}else{_0x3bf3b2[_0x0c4a('0x55')](_0x406bd4,_0x1dc9b3,_0x43ec47);}}else{_0x3bf3b2[_0x0c4a('0x55')](_0x406bd4,_0x1dc9b3,_0x43ec47);}});}else{var _0x17e892=shared[_0x0c4a('0x56')][_0x545492];if(!_[_0x0c4a('0x44')](_0x17e892)){var _0x24b5e1=-0x1*_0x17e892[_0x0c4a('0x52')];_0x406bd4[_0x0c4a('0x53')]=moment(_0x1dc9b3['scheduledat'])[_0x0c4a('0x57')](_0x24b5e1,'minutes');_0x406bd4[_0x0c4a('0x50')]=_0x545492;_0x406bd4[_0x0c4a('0x52')]=_0x17e892['utcOffset'];_0x3bf3b2['insertContact'](_0x406bd4,_0x1dc9b3,_0x43ec47);}else{_0x3bf3b2[_0x0c4a('0x55')](_0x406bd4,_0x1dc9b3,_0x43ec47);}}}else{_0x3bf3b2[_0x0c4a('0x55')](_0x406bd4,_0x1dc9b3,_0x43ec47);}}else{_0x3bf3b2[_0x0c4a('0x55')](_0x406bd4,_0x1dc9b3,_0x43ec47);}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x55')]=function(_0x1f3792,_0x2e4b19,_0xa8d25e){this[_0x0c4a('0x13')]['createCmContact'](_0x1f3792)[_0x0c4a('0x15')](function(_0x49dfeb){_0xa8d25e(null,_0x49dfeb);})[_0x0c4a('0x17')](function(_0x466b51){_0xa8d25e(_0x466b51);});};AGIVertices['prototype']['getPause']=function(_0x1c788f,_0x5a0902){this[_0x0c4a('0x13')]['getPauseById'](_0x1c788f)[_0x0c4a('0x15')](function(_0x311147){_0x5a0902(null,_0x311147?_0x311147[_0x0c4a('0x16')]:![]);})[_0x0c4a('0x17')](function(_0x4e0acf){_0x5a0902(_0x4e0acf);});};AGIVertices[_0x0c4a('0x11')]['agentPause']=function(_0x82cb71,_0x37ab66,_0x351144){var _0x1b727b={'role':_0x0c4a('0x58')};_0x1b727b[_0x82cb71]=this[_0x0c4a('0x10')][_0x0c4a('0x39')];this[_0x0c4a('0x13')][_0x0c4a('0x59')](_0x1b727b,_0x37ab66,this[_0x0c4a('0x10')][_0x0c4a('0x42')])[_0x0c4a('0x15')](function(_0x678bbb){_0x351144(null,_[_0x0c4a('0x44')](_0x678bbb)?![]:!![]);})['catch'](function(_0x1833ee){logger[_0x0c4a('0x2b')](_0x1833ee);_0x351144(null,![]);});};AGIVertices[_0x0c4a('0x11')]['agentUnpause']=function(_0x288649,_0x3f0bf8){var _0x4cb255={'role':_0x0c4a('0x58')};_0x4cb255[_0x288649]=this['channel']['callerid'];this['rpc'][_0x0c4a('0x5a')](_0x4cb255)[_0x0c4a('0x15')](function(_0x484f9c){_0x3f0bf8(null,_[_0x0c4a('0x44')](_0x484f9c)?![]:!![]);})[_0x0c4a('0x17')](function(_0x47476e){logger[_0x0c4a('0x2b')](_0x47476e);_0x3f0bf8(null,![]);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x5b')]=function(_0x1c1a0d,_0x4be00b){var _0x21e4ac={'role':_0x0c4a('0x58')};_0x21e4ac[_0x1c1a0d]=this[_0x0c4a('0x10')][_0x0c4a('0x39')];this['rpc'][_0x0c4a('0x5b')](_0x21e4ac)[_0x0c4a('0x15')](function(_0x56550e){_0x4be00b(null,_[_0x0c4a('0x44')](_0x56550e)?![]:!![]);})[_0x0c4a('0x17')](function(_0x53240b){logger[_0x0c4a('0x2b')](_0x53240b);_0x4be00b(null,![]);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x5c')]=function(_0x52ca7a,_0x3ee386){var _0x415590={'role':'agent'};_0x415590[_0x52ca7a]=this[_0x0c4a('0x10')][_0x0c4a('0x39')];var _0x4dde2e=_0x52ca7a!='internal'?util[_0x0c4a('0x28')](_0x0c4a('0x5d'),_0x0c4a('0x5e'),this[_0x0c4a('0x10')][_0x0c4a('0x39')]):undefined;this[_0x0c4a('0x13')][_0x0c4a('0x5c')](_0x415590,_0x4dde2e)[_0x0c4a('0x15')](function(_0x59a254){_0x3ee386(null,_[_0x0c4a('0x44')](_0x59a254)?![]:!![]);})[_0x0c4a('0x17')](function(_0x4ec31){logger[_0x0c4a('0x2b')](_0x4ec31);_0x3ee386(null,![]);});};AGIVertices[_0x0c4a('0x11')]['shellCommand']=function(_0x4cc8a8,_0x39a838){sh['exec'](_[_0x0c4a('0x5f')](_0x4cc8a8),function(_0x1a14c6,_0x5542a7){var _0xd0d58=_0x5542a7[_0x0c4a('0x60')](/(\r\n|\n|\r)/gm,'');_0x39a838(null,_0xd0d58);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x61')]=function(_0x217c90,_0x49353e){scripts[_0x0c4a('0x61')](_0x217c90[_0x0c4a('0x62')],_0x217c90[_0x0c4a('0x63')]||'text',_0x217c90[_0x0c4a('0x64')],_0x217c90['languageCode']||_0x0c4a('0x65'),_0x217c90['ssmlGender']||_0x0c4a('0x66'),_0x217c90[_0x0c4a('0x67')]||_0x0c4a('0x68'))['then'](function(_0x11641d){_0x49353e(null,_0x11641d);})['catch'](function(_0x59a57b){_0x49353e(_0x59a57b);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x69')]=function(_0x2c344d,_0x23a688){scripts[_0x0c4a('0x69')](_0x2c344d[_0x0c4a('0x64')],_0x2c344d[_0x0c4a('0x6a')]||'en',0x1)[_0x0c4a('0x15')](function(_0x12115d){_0x23a688(null,_0x12115d);})[_0x0c4a('0x17')](function(_0x5e74d3){_0x23a688(_0x5e74d3);});};AGIVertices[_0x0c4a('0x11')]['restAPI']=function(_0xda0bb5,_0x4c4eb1){var _0x286e1d={'uri':_0xda0bb5[_0x0c4a('0x6b')],'method':_0xda0bb5[_0x0c4a('0x6c')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xda0bb5[_0x0c4a('0x6d')])===_0x0c4a('0x6e')&&parseInt(_0xda0bb5[_0x0c4a('0x6d')])>=0x1?parseInt(_0xda0bb5[_0x0c4a('0x6d')])*0x3e8:0x5*0x3e8};if(_[_0x0c4a('0x6f')](['POST',_0x0c4a('0x70')],_0x286e1d[_0x0c4a('0x6c')][_0x0c4a('0x71')]())){try{_0x286e1d[_0x0c4a('0x72')]=_0xda0bb5[_0x0c4a('0xc')]?JSON[_0x0c4a('0x73')](_0xda0bb5[_0x0c4a('0xc')]):{};}catch(_0x3ef103){logger['error'](_0x0c4a('0x74'),_0x3ef103);}}try{_0x286e1d[_0x0c4a('0x75')]=_0xda0bb5[_0x0c4a('0xb')]?JSON[_0x0c4a('0x73')](_0xda0bb5[_0x0c4a('0xb')]):{};}catch(_0x4be889){logger[_0x0c4a('0x2b')](_0x0c4a('0x76'),_0x4be889);}if(_0xda0bb5[_0x0c4a('0x77')]){try{var _0x42347d=require(_0xda0bb5[_0x0c4a('0x77')])[_0x0c4a('0x78')](this,_0x286e1d);_0x286e1d['uri']=Mustache[_0x0c4a('0x79')](_0xda0bb5['url'],_0x42347d,{},['$$','$$']);if(_0x286e1d['headers']){_0x286e1d[_0x0c4a('0x75')]=JSON[_0x0c4a('0x73')](Mustache[_0x0c4a('0x79')](JSON['stringify'](_0x286e1d[_0x0c4a('0x75')]),_0x42347d,{},['$$','$$']));}if(_0x286e1d[_0x0c4a('0x72')]){_0x286e1d[_0x0c4a('0x72')]=JSON[_0x0c4a('0x73')](Mustache[_0x0c4a('0x79')](JSON['stringify'](_0x286e1d['body']),_0x42347d,{},['$$','$$']));}}catch(_0x164155){logger[_0x0c4a('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x164155);}}rp(_0x286e1d)[_0x0c4a('0x15')](function(_0x3edb1c){var _0x199ef6={'statusCode':_0x3edb1c['statusCode']||0xc8,'statusMessage':_0x3edb1c['statusMessage']||'OK','headers':_0x3edb1c[_0x0c4a('0x75')]||{},'body':_0x3edb1c[_0x0c4a('0x72')]||{}};_0x4c4eb1(null,_0x199ef6);})[_0x0c4a('0x17')](function(_0x34be08){var _0x59704e={'statusCode':_0x34be08[_0x0c4a('0x7a')]||0x1f4,'statusMessage':_0x34be08['message']||_0x0c4a('0x7b'),'headers':_0x34be08[_0x0c4a('0x7c')][_0x0c4a('0x75')]||{},'body':_0x34be08[_0x0c4a('0x7c')]['body']||{}};_0x4c4eb1(null,_0x59704e);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x7d')]=function(_0x1d557f,_0x215ed0){scripts[_0x0c4a('0x7d')](this[_0x0c4a('0x10')][_0x0c4a('0x42')],_0x1d557f[_0x0c4a('0x7e')],_0x1d557f[_0x0c4a('0x64')],_0x1d557f[_0x0c4a('0x7f')]||'en')[_0x0c4a('0x15')](function(_0x18cd64){_0x215ed0(null,_0x18cd64);})[_0x0c4a('0x17')](function(_0x4df8c9){_0x215ed0(_0x4df8c9);});};AGIVertices[_0x0c4a('0x11')]['googleDialogflowV2']=function(_0x5ce417,_0x5e284e){scripts['googleDialogflowV2'](this[_0x0c4a('0x10')][_0x0c4a('0x42')],_0x5ce417['dialogflowV2_project_id'],_0x5ce417[_0x0c4a('0x80')],_0x5ce417[_0x0c4a('0x81')],_0x5ce417[_0x0c4a('0x64')],_0x5ce417['dialogflowV2_language']||'en')[_0x0c4a('0x15')](function(_0x262e52){_0x5e284e(null,_0x262e52);})[_0x0c4a('0x17')](function(_0x415897){_0x5e284e(_0x415897);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x82')]=function(_0x430774,_0x2aadf2){scripts[_0x0c4a('0x82')](this[_0x0c4a('0x10')],_0x430774)['then'](function(_0x41ddbb){_0x2aadf2(null,_0x41ddbb);})[_0x0c4a('0x17')](function(_0x3a8cfa){_0x2aadf2(_0x3a8cfa);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x83')]=function(_0x1f0341,_0x348ee2){scripts['ispeechTTS'](_0x1f0341[_0x0c4a('0x7e')],_0x1f0341[_0x0c4a('0x64')],_0x1f0341[_0x0c4a('0x84')]||'en-US',_0x1f0341['speed'])['then'](function(_0x3140fa){_0x348ee2(null,_0x3140fa);})['catch'](function(_0x35d7a1){_0x348ee2(_0x35d7a1);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x85')]=function(_0x25874d,_0x166908,_0x1e350a){scripts[_0x0c4a('0x85')](_0x166908,_0x25874d[_0x0c4a('0x7e')],_0x25874d[_0x0c4a('0x86')]||'en-US',this['isConfigured'](_0x25874d['model'])?_0x25874d['model']:undefined)[_0x0c4a('0x15')](function(_0x653aab){_0x1e350a(null,_0x653aab);})[_0x0c4a('0x17')](function(_0x1f48f5){_0x1e350a(_0x1f48f5);});};AGIVertices['prototype']['awsPolly']=function(_0x3d38d0,_0x394b69){scripts[_0x0c4a('0x87')](_0x3d38d0[_0x0c4a('0x88')],_0x3d38d0['aws_secret_access_key'],_0x3d38d0['aws_polly_region'],_0x3d38d0[_0x0c4a('0x89')]||_0x0c4a('0x8a'),_0x3d38d0[_0x0c4a('0x64')],_0x3d38d0[_0x0c4a('0x8b')]||_0x0c4a('0x64'))[_0x0c4a('0x15')](function(_0x45d1b1){_0x394b69(null,_0x45d1b1);})[_0x0c4a('0x17')](function(_0x384ac9){_0x394b69(_0x384ac9);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x8c')]=function(_0x3457e8,_0x259b7a){scripts[_0x0c4a('0x8c')](this['channel'][_0x0c4a('0x42')],_0x3457e8[_0x0c4a('0x88')],_0x3457e8[_0x0c4a('0x8d')],_0x3457e8['aws_lex_region'],_0x3457e8[_0x0c4a('0x64')],_0x3457e8['aws_bot_name'])[_0x0c4a('0x15')](function(_0x357be0){_0x259b7a(null,_0x357be0);})['catch'](function(_0x20dc2e){_0x259b7a(_0x20dc2e);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x8e')]=function(_0x179542,_0x2b3350,_0x264bb6){scripts[_0x0c4a('0x8e')](_0x2b3350,_0x179542[_0x0c4a('0x7e')],_0x179542[_0x0c4a('0x8f')]||'en-US')[_0x0c4a('0x15')](function(_0x5ec324){_0x264bb6(null,_0x5ec324);})[_0x0c4a('0x17')](function(_0x7a8195){_0x264bb6(_0x7a8195);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x90')]=function(_0x1aa2ee,_0x32e3f1,_0x36bc38){scripts['tildeASR'](_0x32e3f1,_0x1aa2ee[_0x0c4a('0x91')],_0x1aa2ee['appsecret'],_0x1aa2ee[_0x0c4a('0x92')])[_0x0c4a('0x15')](function(_0x547212){_0x36bc38(null,_0x547212);})['catch'](function(_0x4e2aee){_0x36bc38(_0x4e2aee);});};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x93')]=function(_0x390039){var _0x4bab31=_[_0x0c4a('0x6f')](verticesWithRetry,_0x390039['agicommand'])?_0x390039:_[_0x0c4a('0x94')](_0x390039);for(var _0x1fb944 in _0x4bab31){if(_0x4bab31[_0x0c4a('0x95')](_0x1fb944)){if(_0x4bab31[_0x1fb944]&&_[_0x0c4a('0x96')](_0x4bab31[_0x1fb944])){if(_['includes'](recursiveMapAttributes,_0x1fb944)){_0x4bab31[_0x1fb944]=this[_0x0c4a('0x97')](_0x4bab31[_0x1fb944]);}else{_0x4bab31[_0x1fb944]=this[_0x0c4a('0x98')](_0x4bab31[_0x1fb944]);}}}}return _0x4bab31;};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x99')]=function(_0x50ee7b){for(var _0x14a298 in _0x50ee7b){if(_0x50ee7b[_0x0c4a('0x95')](_0x14a298)){if(_[_0x0c4a('0x9a')](_0x50ee7b[_0x14a298])){this[_0x0c4a('0x99')](_0x50ee7b[_0x14a298]);}else if(_[_0x0c4a('0x9b')](_0x50ee7b[_0x14a298])){for(var _0x31a258=0x0;_0x31a258<_0x50ee7b[_0x14a298][_0x0c4a('0x9c')];_0x31a258++){this[_0x0c4a('0x99')](_0x50ee7b[_0x14a298][_0x31a258]);}}else if(_[_0x0c4a('0x96')](_0x50ee7b[_0x14a298])){_0x50ee7b[_0x14a298]=this[_0x0c4a('0x98')](_0x50ee7b[_0x14a298]);}}}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x9d')]=function(_0x3d45e8,_0x2ee879){for(var _0x294fff in _0x3d45e8){if(_0x3d45e8[_0x0c4a('0x95')](_0x294fff)){if(_[_0x0c4a('0x9a')](_0x3d45e8[_0x294fff])){if(!_[_0x0c4a('0x47')](_0x3d45e8[_0x294fff])){this[_0x0c4a('0x9d')](_0x3d45e8[_0x294fff],util[_0x0c4a('0x28')]('%s.%s',_0x2ee879,_0x294fff));}}else if(_[_0x0c4a('0x9b')](_0x3d45e8[_0x294fff])){for(var _0x392499=0x0;_0x392499<_0x3d45e8[_0x294fff]['length'];_0x392499++){this[_0x0c4a('0x9d')](_0x3d45e8[_0x294fff][_0x392499],util['format'](_0x0c4a('0x9e'),_0x2ee879,_0x294fff+'['+_0x392499+']'));}}else{if(!_[_0x0c4a('0x44')](_0x3d45e8[_0x294fff])){this['channel']['setVariable'](util[_0x0c4a('0x28')]('%s.%s',_0x2ee879,_0x294fff),_0x3d45e8[_0x294fff]);}}}}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x97')]=function(_0x55817a){try{var _0x29161a=JSON[_0x0c4a('0x73')](_0x55817a);this[_0x0c4a('0x99')](_0x29161a);return JSON[_0x0c4a('0x9f')](_0x29161a);}catch(_0x40a61a){return this[_0x0c4a('0x98')](_0x55817a);}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x98')]=function(_0x15d7ad){var _0x40ee12=_0x15d7ad['split']('{');for(var _0x500571=0x1;_0x500571<_0x40ee12[_0x0c4a('0x9c')];_0x500571+=0x1){var _0x4382f6=_0x40ee12[_0x500571][_0x0c4a('0xa0')]('}');if(_0x4382f6[_0x0c4a('0x9c')]>0x1){_0x15d7ad=_0x15d7ad['replaceAll']('{'+_0x4382f6[0x0]+'}',this[_0x0c4a('0x10')]['getVariable'](_0x4382f6[0x0])['extra']||_0x4382f6[0x0]);}}if(_0x40ee12[_0x0c4a('0x9c')]===0x1){return _0x15d7ad[_0x0c4a('0x4d')]();}return this[_0x0c4a('0x98')](_0x15d7ad);};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xa1')]=function(_0x55c729,_0x132a3d){var _0x5175e4=this[_0x0c4a('0x10')]['getVariable'](_0x55c729);if(_0x5175e4[_0x0c4a('0xa2')]===-0x1){return _0x5175e4;}logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0xa3'),_0x132a3d,_0x5175e4['extra']));return this['channel'][_0x0c4a('0xa4')](_0x132a3d,_0x5175e4['extra']);};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xa5')]=function(_0x2b1936){return _0x2b1936&&_0x2b1936!=='0'&&_0x2b1936!=='-1'&&_0x2b1936!=='';};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xa6')]=function(_0x5cc366){this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x5cc366,'-');_0x5cc366[_0x0c4a('0xa7')]=_0x5cc366[_0x0c4a('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0c4a('0x11')]['mrcpsynth']=function(_0x50f841){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0xa8'),_0x50f841[_0x0c4a('0x36')]));if(!this['isConfigured'](_0x50f841[_0x0c4a('0x64')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xaa'));}var _0xf92b74='\x22'+_0x50f841[_0x0c4a('0x64')]+'\x22';if(this[_0x0c4a('0xa5')](_0x50f841['options'])){_0xf92b74+=','+_0x50f841['options'];}var _0x13f9ac=this[_0x0c4a('0x10')][_0x0c4a('0xab')](_0x0c4a('0xac'),_0xf92b74);if(_0x13f9ac[_0x0c4a('0xa2')]===-0x1){return _0x13f9ac;}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0xad'),_0xf92b74));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xae')]=function(_0xac9d91){logger['info'](util['format'](_0x0c4a('0xaf'),_0xac9d91[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0xac9d91['grammar'])){return this['channel'][_0x0c4a('0xa9')](_0x0c4a('0xb0'));}var _0x443d9d=_0xac9d91['grammar'];if(this['isConfigured'](_0xac9d91[_0x0c4a('0x7c')])){_0x443d9d+=','+_0xac9d91[_0x0c4a('0x7c')];}var _0x47993a=this[_0x0c4a('0x10')][_0x0c4a('0xab')](_0x0c4a('0xb1'),_0x443d9d);if(_0x47993a[_0x0c4a('0xa2')]===-0x1){return _0x47993a;}var _0xf4a8bf=this['getAndSetVariable'](_0x0c4a('0xb2'),_0x0c4a('0xb3'));if(_0xf4a8bf[_0x0c4a('0xa2')]===-0x1){return _0xf4a8bf;}var _0x280627=this[_0x0c4a('0xa1')](_0x0c4a('0xb4'),_0x0c4a('0xb5'));if(_0x280627['result']===-0x1){return _0x280627;}var _0x215f10=this[_0x0c4a('0xa1')]('RECOG_INSTANCE()',_0x0c4a('0xb6'));if(_0x215f10[_0x0c4a('0xa2')]===-0x1){return _0x215f10;}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0xb7'),_0x443d9d));};AGIVertices['prototype'][_0x0c4a('0x7')]=function(_0x28d469){logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0xb8'),_0x28d469[_0x0c4a('0x36')]));return this[_0x0c4a('0x10')]['agi']([_0x28d469[_0x0c4a('0xb9')],_0x28d469[_0x0c4a('0xba')]]);};AGIVertices[_0x0c4a('0x11')]['answer']=function(_0x16ceda){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0xbb'),_0x16ceda[_0x0c4a('0x36')]));if(this['isConfigured'](_0x16ceda['timeout'])){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0xbc'),_0x16ceda['timeout']));var _0x4bf24c=this[_0x0c4a('0x10')][_0x0c4a('0xbd')](_0x16ceda[_0x0c4a('0x6d')]);if(_0x4bf24c[_0x0c4a('0xa2')]===-0x1){return _0x4bf24c;}}return this['channel']['answer']();};AGIVertices[_0x0c4a('0x11')]['callback']=function(_0x28263e){logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0xbe'),_0x28263e['label']));if(!this[_0x0c4a('0xa5')](_0x28263e[_0x0c4a('0x4a')])){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x28263e,_0x0c4a('0xbf'));}_0x28263e[_0x0c4a('0x4b')]=moment();if(this[_0x0c4a('0xa5')](_0x28263e[_0x0c4a('0xc0')])){_0x28263e['scheduledAt']=moment()[_0x0c4a('0x57')](_0x28263e[_0x0c4a('0xc0')],_0x0c4a('0x54'));}if(!this[_0x0c4a('0xa5')](_0x28263e['callback_priority'])){_0x28263e['callback_priority']=0x2;}this[_0x0c4a('0x43')][_0x0c4a('0x78')](this,_0x28263e);return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0xc1'),_0x28263e[_0x0c4a('0x49')],_0x28263e[_0x0c4a('0x4a')],_0x28263e['scheduledAt']));};AGIVertices[_0x0c4a('0x11')]['custom_app']=function(_0x1f90fc){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0xc2'),_0x1f90fc[_0x0c4a('0x36')]));var _0x58f18b=this[_0x0c4a('0x10')]['exec'](_0x1f90fc[_0x0c4a('0xc3')],_0x1f90fc['options']);if(_0x58f18b[_0x0c4a('0xa2')]===-0x1){return _0x58f18b;}return this['channel']['noop'](util['format'](_0x0c4a('0xc4'),_0x1f90fc[_0x0c4a('0xc3')],_0x1f90fc[_0x0c4a('0x7c')]));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xc5')]=function(_0xb9ad30){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0xc6'),_0xb9ad30['label']));if(!this[_0x0c4a('0xa5')](_0xb9ad30[_0x0c4a('0x64')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xaa'));}var _0x5e0ff2='\x22'+_0xb9ad30[_0x0c4a('0x64')]+'\x22';if(this[_0x0c4a('0xa5')](_0xb9ad30['options'])){_0x5e0ff2+=','+_0xb9ad30[_0x0c4a('0x7c')];}var _0x32a9f2=this['channel'][_0x0c4a('0xab')]('MRCPSynth',_0x5e0ff2);if(_0x32a9f2[_0x0c4a('0xa2')]===-0x1){return _0x32a9f2;}return this['channel'][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0xad'),_0x5e0ff2));};AGIVertices[_0x0c4a('0x11')]['sestektts']=function(_0x5e784d){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0xc7'),_0x5e784d[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x5e784d['text'])){return this['channel'][_0x0c4a('0xa9')](_0x0c4a('0xaa'));}var _0x33a5e7='\x22'+_0x5e784d[_0x0c4a('0x64')]+'\x22';if(this[_0x0c4a('0xa5')](_0x5e784d['options'])){_0x33a5e7+=','+_0x5e784d['options'];}var _0x130b40=this[_0x0c4a('0x10')][_0x0c4a('0xab')](_0x0c4a('0xac'),_0x33a5e7);if(_0x130b40['result']===-0x1){return _0x130b40;}return this['channel'][_0x0c4a('0xa9')](util['format'](_0x0c4a('0xad'),_0x33a5e7));};AGIVertices['prototype'][_0x0c4a('0xc8')]=function(_0x281dab){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x281dab['label']));if(!this[_0x0c4a('0xa5')](_0x281dab[_0x0c4a('0xc9')])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0xb0'));}var _0x211e4a=_0x281dab[_0x0c4a('0xc9')];if(this[_0x0c4a('0xa5')](_0x281dab[_0x0c4a('0x7c')])){_0x211e4a+=','+_0x281dab[_0x0c4a('0x7c')];}var _0x43167e=this['channel'][_0x0c4a('0xab')](_0x0c4a('0xb1'),_0x211e4a);if(_0x43167e[_0x0c4a('0xa2')]===-0x1){return _0x43167e;}var _0x519184=this[_0x0c4a('0xa1')](_0x0c4a('0xb2'),_0x0c4a('0xca'));if(_0x519184[_0x0c4a('0xa2')]===-0x1){return _0x519184;}var _0x389c59=this[_0x0c4a('0xa1')](_0x0c4a('0xb4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x389c59[_0x0c4a('0xa2')]===-0x1){return _0x389c59;}var _0xfecfa5=this[_0x0c4a('0xa1')]('RECOG_INSTANCE()',_0x0c4a('0xcb'));if(_0xfecfa5[_0x0c4a('0xa2')]===-0x1){return _0xfecfa5;}return this[_0x0c4a('0x10')]['noop'](util[_0x0c4a('0x28')](_0x0c4a('0xb7'),_0x211e4a));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xcc')]=function(_0x36930f){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0xcd'),_0x36930f[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x36930f[_0x0c4a('0xc9')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('no\x20grammar\x20configured');}var _0x1e99c0=_0x36930f['grammar'];if(this['isConfigured'](_0x36930f[_0x0c4a('0x7c')])){_0x1e99c0+=','+_0x36930f[_0x0c4a('0x7c')];}var _0xa5edb4=this['channel']['exec'](_0x0c4a('0xb1'),_0x1e99c0);if(_0xa5edb4[_0x0c4a('0xa2')]===-0x1){return _0xa5edb4;}var _0x2a0cc0=this[_0x0c4a('0xa1')](_0x0c4a('0xb2'),'SESTEK_ASR_CONFIDENCE');if(_0x2a0cc0[_0x0c4a('0xa2')]===-0x1){return _0x2a0cc0;}var _0x720081=this['getAndSetVariable']('RECOG_INPUT()',_0x0c4a('0xce'));if(_0x720081[_0x0c4a('0xa2')]===-0x1){return _0x720081;}var _0x3ac3b3=this[_0x0c4a('0xa1')](_0x0c4a('0xcf'),'SESTEK_ASR_INSTANCE');if(_0x3ac3b3['result']===-0x1){return _0x3ac3b3;}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0xb7'),_0x1e99c0));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xd0')]=function(_0x4b9d71){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0xd1'),_0x4b9d71['label']));if(!this[_0x0c4a('0xa5')](_0x4b9d71[_0x0c4a('0xd2')])){return this['channel']['error'](_0x4b9d71,_0x0c4a('0xd3'));}var _0x2996e2=this[_0x0c4a('0xd4')][_0x0c4a('0x78')](this,_0x4b9d71[_0x0c4a('0xd2')]);if(!_0x2996e2){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x4b9d71,_0x0c4a('0xd5'));}if(!this['isConfigured'](_0x4b9d71[_0x0c4a('0xd6')])){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x4b9d71,_0x0c4a('0xd7'));}var _0x3f8273=_0x4b9d71[_0x0c4a('0xd6')][_0x0c4a('0x60')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0xd8'),_0x3f8273));var _0x3c0495=this[_0x0c4a('0x29')][_0x0c4a('0x78')](this,_0x2996e2,_0x3f8273);this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x4b9d71,_0x3f8273);if(!this['isConfigured'](_0x4b9d71[_0x0c4a('0xd9')])){return this['channel'][_0x0c4a('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5474ba=this[_0x0c4a('0x12')][_0x0c4a('0x78')](this,_0x4b9d71[_0x0c4a('0xd9')]);if(!_0x5474ba){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x4b9d71,_0x0c4a('0xda'));}var _0x5106a2=this;_0x3c0495[_0x0c4a('0xdb')](function(_0x4864a5,_0x129941){Object['keys'](_0x4864a5)['forEach'](function(_0x576403){_0x5106a2[_0x0c4a('0x10')][_0x0c4a('0xa4')](util[_0x0c4a('0x28')]('%s[%s][%s]',_0x5474ba,_0x129941,_0x576403),_0x4864a5[_0x576403]);});});this[_0x0c4a('0x10')]['setVariable'](util[_0x0c4a('0x28')](_0x0c4a('0xdc'),_0x5474ba),_0x3c0495['length']);return this['channel'][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0xdd'),_0x5474ba));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xde')]=function(_0x384067){logger[_0x0c4a('0xdf')](util[_0x0c4a('0x28')](_0x0c4a('0xe0'),_0x384067[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x384067[_0x0c4a('0xe1')])){return this['channel'][_0x0c4a('0x2b')](_0x384067,_0x0c4a('0xe2'));}var _0x3317f5=this[_0x0c4a('0x1a')][_0x0c4a('0x78')](this,_0x384067['sip_id']);if(!_0x3317f5){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x384067,_0x0c4a('0xe3'));}var _0x165ab4=this[_0x0c4a('0x10')][_0x0c4a('0xab')](_0x0c4a('0xe4'),[util['format'](_0x0c4a('0xe5'),_0x3317f5),_0x384067[_0x0c4a('0x6d')],_0x384067['opts'],_0x384067[_0x0c4a('0x6b')]]);if(_0x165ab4[_0x0c4a('0xa2')]===-0x1){return _0x165ab4;}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')]('Executed\x20command\x20%s',_0x0c4a('0xe4')));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xe6')]=function(_0x37950c){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0xe7'),_0x37950c['label']));if(!this[_0x0c4a('0xa5')](_0x37950c[_0x0c4a('0x7e')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xe8'));}if(!this[_0x0c4a('0xa5')](_0x37950c[_0x0c4a('0x64')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x37950c);this[_0x0c4a('0x41')](_0x37950c[_0x0c4a('0x64')],'in','','');this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')]('Trying\x20Dialogflow:\x20%s',_0x37950c[_0x0c4a('0x64')]));var _0x1da252=this['googleDialogflow'][_0x0c4a('0x78')](this,_0x37950c);if(_0x1da252){for(var _0x1e6a4e in _0x1da252){if(_0x1da252['hasOwnProperty'](_0x1e6a4e)){this[_0x0c4a('0x10')][_0x0c4a('0xa4')](util[_0x0c4a('0x28')](_0x0c4a('0xe9'),_0x1e6a4e[_0x0c4a('0x71')]()),_0x1da252[_0x1e6a4e]);}}this[_0x0c4a('0x41')](_0x1da252[_0x0c4a('0xea')],_0x0c4a('0xeb'),'dialogflow','');return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0xec'),_0x1da252[_0x0c4a('0xea')]));}return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x37950c,_0x0c4a('0xed'));};AGIVertices[_0x0c4a('0x11')]['dialogflowV2']=function(_0x23ec86){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0xee'),_0x23ec86['label']));if(!this[_0x0c4a('0xa5')](_0x23ec86[_0x0c4a('0xef')])){return this['channel'][_0x0c4a('0xa9')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x23ec86['client_email'])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xf0'));}if(!this[_0x0c4a('0xa5')](_0x23ec86[_0x0c4a('0x81')])){return this['channel'][_0x0c4a('0xa9')](_0x0c4a('0xf1'));}if(!this[_0x0c4a('0xa5')](_0x23ec86[_0x0c4a('0xf2')])){return this[_0x0c4a('0x10')]['noop']('no\x20anguage\x20configured');}if(!this[_0x0c4a('0xa5')](_0x23ec86[_0x0c4a('0x64')])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0xaa'));}this['channel'][_0x0c4a('0xf3')]=!![];this[_0x0c4a('0x35')](_0x23ec86);this[_0x0c4a('0x41')](_0x23ec86[_0x0c4a('0x64')],'in','','');this['channel']['noop'](util[_0x0c4a('0x28')](_0x0c4a('0xf4'),_0x23ec86[_0x0c4a('0x64')]));var _0x2f9d85=this[_0x0c4a('0xf5')][_0x0c4a('0x78')](this,_0x23ec86);if(_0x2f9d85){for(var _0x3c2d1e in _0x2f9d85){if(_0x2f9d85[_0x0c4a('0x95')](_0x3c2d1e)){if(_0x3c2d1e!==_0x0c4a('0xf6')){this['channel'][_0x0c4a('0xa4')](util[_0x0c4a('0x28')](_0x0c4a('0xe9'),_0x3c2d1e[_0x0c4a('0x71')]()),_0x2f9d85[_0x3c2d1e]);}}}this[_0x0c4a('0x41')](_0x2f9d85['speech'],'out',_0x0c4a('0xf7'),_0x2f9d85['providerResponse']);return this[_0x0c4a('0x10')]['noop'](util['format']('DialogflowV2\x20Result\x20%s',_0x2f9d85[_0x0c4a('0xea')]));}return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x23ec86,_0x0c4a('0xf8'));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xf9')]=function(_0x42cfc0){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0xfa'),_0x42cfc0[_0x0c4a('0x36')]));if(!this['isConfigured'](_0x42cfc0[_0x0c4a('0xfb')])){return this['channel'][_0x0c4a('0xa9')](_0x0c4a('0xfc'));}if(!this[_0x0c4a('0xa5')](_0x42cfc0[_0x0c4a('0xfd')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('no\x20username\x20configured');}if(!this[_0x0c4a('0xa5')](_0x42cfc0[_0x0c4a('0xfe')])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0xff'));}if(!this[_0x0c4a('0xa5')](_0x42cfc0[_0x0c4a('0x100')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xaa'));}this[_0x0c4a('0x10')][_0x0c4a('0xf3')]=!![];this[_0x0c4a('0x35')](_0x42cfc0);this[_0x0c4a('0x41')](_0x42cfc0['text'],'in','','');this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x101'),_0x42cfc0[_0x0c4a('0x64')]));var _0x49dd89=this[_0x0c4a('0x82')][_0x0c4a('0x78')](this,_0x42cfc0);if(_0x49dd89){for(var _0x28d98f in _0x49dd89){if(_0x49dd89['hasOwnProperty'](_0x28d98f)){this[_0x0c4a('0x10')][_0x0c4a('0xa4')](util[_0x0c4a('0x28')](_0x0c4a('0x102'),_0x28d98f[_0x0c4a('0x71')]()),_0x49dd89[_0x28d98f]);}}this['createSquareMessage'](_0x49dd89[_0x0c4a('0xea')],_0x0c4a('0xeb'),'sesteknda','');if(_0x49dd89[_0x0c4a('0x103')]){this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x104'),_0x49dd89['audiofile']));var _0x59cb2c=this[_0x0c4a('0x10')]['streamFile'](_0x49dd89[_0x0c4a('0x103')]);try{fs[_0x0c4a('0x105')](_0x49dd89[_0x0c4a('0x103')]+_0x0c4a('0x106'));}catch(_0xb7072){logger[_0x0c4a('0x2b')](_0xb7072);}return _0x59cb2c;}else{return this[_0x0c4a('0x10')]['noop'](util['format']('SestekNDA\x20Result\x20%s',_0x49dd89[_0x0c4a('0xea')]));}}return this['channel'][_0x0c4a('0x2b')](_0x42cfc0,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x107')]=function(_0x342f5f){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x108'),_0x342f5f[_0x0c4a('0x36')]));return this['channel']['noop'](_0x0c4a('0x107'));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x109')]=function(_0x3535be){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x10a'),_0x3535be[_0x0c4a('0x36')]));var _0x47700a='';if(_0x3535be['trunk_id']){if(!this[_0x0c4a('0xa5')](_0x3535be['trunk_id'])){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x3535be,_0x0c4a('0x10b'));}else{var _0x56e7da=parseInt(_0x3535be[_0x0c4a('0x10c')],0xa);if(isNaN(_0x56e7da)){_0x47700a=_0x3535be[_0x0c4a('0x10c')];}else{_0x47700a=this['getTrunk'][_0x0c4a('0x78')](this,_0x3535be['trunk_id']);if(!_0x47700a){return this[_0x0c4a('0x10')]['error'](_0x3535be,_0x0c4a('0x10d'));}}}}else if(_0x3535be['trunk_name']){_0x47700a=_0x3535be[_0x0c4a('0x10e')];}else{return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x3535be,_0x0c4a('0x10b'));}var _0xc445bc=this[_0x0c4a('0x10')]['exec'](_0x0c4a('0xe4'),[util[_0x0c4a('0x28')]('SIP/%s/%s',_0x47700a,_0x3535be['phone']),_0x3535be[_0x0c4a('0x6d')],_0x3535be[_0x0c4a('0x10f')],_0x3535be['url']]);if(_0xc445bc[_0x0c4a('0xa2')]===-0x1){return _0xc445bc;}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x110'),_0x0c4a('0xe4')));};AGIVertices[_0x0c4a('0x11')]['finally']=function(_0x5722c5){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x111'),_0x5722c5[_0x0c4a('0x36')]));return this[_0x0c4a('0x10')]['noop']('finally');};AGIVertices['prototype'][_0x0c4a('0xe')]=function(_0x13fdb9){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x112'),_0x13fdb9[_0x0c4a('0x36')]));if(_0x13fdb9[_0x0c4a('0xa7')]===0x0){return this['maxRetry'](_0x13fdb9);}_0x13fdb9[_0x0c4a('0xa7')]-=0x1;if(!this[_0x0c4a('0xa5')](_0x13fdb9['file_id'])){return this['channel'][_0x0c4a('0x2b')](_0x13fdb9,'no\x20file\x20audio\x20selected');}var _0x50e87c=this[_0x0c4a('0x1c')][_0x0c4a('0x78')](this,_0x13fdb9['file_id']);if(!_0x50e87c){return this[_0x0c4a('0x10')]['error'](_0x13fdb9,_0x0c4a('0x113'));}if(!this[_0x0c4a('0xa5')](_0x13fdb9['variable_id'])){return this['channel'][_0x0c4a('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x55a251=this[_0x0c4a('0x10')][_0x0c4a('0x114')](_0x50e87c,_0x13fdb9[_0x0c4a('0x115')],_0x13fdb9[_0x0c4a('0x116')]);var _0x50efca=_0x55a251[_0x0c4a('0xa2')]?_0x55a251[_0x0c4a('0xa2')][_0x0c4a('0x4d')]():'';logger[_0x0c4a('0x2c')](_0x0c4a('0x117'),JSON['stringify'](_0x55a251));if(_0x55a251['result']===-0x1){this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x13fdb9,_0x50efca);return _0x55a251;}else if(_0x55a251[_0x0c4a('0x118')]===_0x0c4a('0x6d')){_0x55a251[_0x0c4a('0xa2')]=_0x50efca[_0x0c4a('0x9c')]>=parseInt(_0x13fdb9[_0x0c4a('0x119')])?'x':'i';}else{_0x55a251[_0x0c4a('0xa2')]=_0x50efca[_0x0c4a('0x9c')]>=parseInt(_0x13fdb9[_0x0c4a('0x119')])&&_0x50efca[_0x0c4a('0x9c')]<=parseInt(_0x13fdb9[_0x0c4a('0x116')])?'x':'i';}var _0x169df3=this[_0x0c4a('0x12')][_0x0c4a('0x78')](this,_0x13fdb9[_0x0c4a('0xd9')]);if(!_0x169df3){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x13fdb9,'no\x20variable\x20found');}this[_0x0c4a('0x10')][_0x0c4a('0xa4')](_0x169df3,_0x50efca);if(this[_0x0c4a('0xa5')](_0x13fdb9[_0x0c4a('0x11a')])){var _0x5695bc=parseInt(_0x13fdb9[_0x0c4a('0x11a')],0xa);var _0x22b78a=rs[_0x0c4a('0x11b')]({'charset':'*','length':_0x5695bc});var _0x89fe41=_0x50efca[_0x0c4a('0x9c')];if(_0x89fe41>0x0){if(_0x89fe41>_0x5695bc){this[_0x0c4a('0x35')]['sync'](this,_0x13fdb9,_0x13fdb9['hiddendigitspos']===_0x0c4a('0x11c')?_0x22b78a+_0x50efca[_0x0c4a('0x11d')](_0x5695bc):_0x50efca['substr'](0x0,_0x89fe41-_0x5695bc)+_0x22b78a);}else{this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x13fdb9,rs['generate']({'charset':'*','length':_0x89fe41}));}}else{this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x13fdb9,'');}}else{this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x13fdb9,_0x50efca);}return _0x55a251;};AGIVertices['prototype'][_0x0c4a('0xf')]=function(_0x2d832a){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0x11e'),_0x2d832a['label']));return this[_0x0c4a('0xe')](_0x2d832a);};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x11f')]=function(_0x2157f8){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x120'),_0x2157f8[_0x0c4a('0x36')]));this['createSquareDetailsReport'][_0x0c4a('0x78')](this,_0x2157f8,_0x2157f8[_0x0c4a('0x121')]);return this[_0x0c4a('0x10')]['noop'](util[_0x0c4a('0x28')](_0x0c4a('0x122'),_0x2157f8[_0x0c4a('0x121')]));};AGIVertices[_0x0c4a('0x11')]['awspolly']=function(_0x2b1673){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x123'),_0x2b1673['label']));if(!this[_0x0c4a('0xa5')](_0x2b1673['aws_access_key_id'])||!this[_0x0c4a('0xa5')](_0x2b1673[_0x0c4a('0x8d')])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0x124'));}if(!this[_0x0c4a('0xa5')](_0x2b1673[_0x0c4a('0x64')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('no\x20text\x20configured');}this['channel'][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x125'),_0x2b1673[_0x0c4a('0x64')]));var _0x3d49ff=this['awsPolly'][_0x0c4a('0x78')](this,_0x2b1673);if(_0x3d49ff){this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x126'),_0x3d49ff));var _0x29623e=this[_0x0c4a('0x10')][_0x0c4a('0x127')](_0x3d49ff);try{fs[_0x0c4a('0x105')](_0x3d49ff+'.wav');}catch(_0x739d5c){logger[_0x0c4a('0x2b')](_0x739d5c);}return _0x29623e;}return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x2b1673,_0x0c4a('0x128'));};AGIVertices[_0x0c4a('0x11')]['awslex']=function(_0x80a282){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0x129'),_0x80a282[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x80a282[_0x0c4a('0x88')])||!this[_0x0c4a('0xa5')](_0x80a282['aws_secret_access_key'])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0x124'));}if(!this[_0x0c4a('0xa5')](_0x80a282[_0x0c4a('0x12a')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0x12b'));}if(!this['isConfigured'](_0x80a282[_0x0c4a('0x64')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xaa'));}this[_0x0c4a('0x10')][_0x0c4a('0xf3')]=!![];this[_0x0c4a('0x35')](_0x80a282);this[_0x0c4a('0x41')](_0x80a282[_0x0c4a('0x64')],'in','','');this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x12c'),_0x80a282[_0x0c4a('0x64')]));var _0x1dc62d=this[_0x0c4a('0x8c')][_0x0c4a('0x78')](this,_0x80a282);if(_0x1dc62d){for(var _0x2a60fc in _0x1dc62d){if(_0x1dc62d[_0x0c4a('0x95')](_0x2a60fc)&&_['isString'](_0x1dc62d[_0x2a60fc])){this['channel'][_0x0c4a('0xa4')](util['format'](_0x0c4a('0x12d'),_0x2a60fc[_0x0c4a('0x71')]()),_0x1dc62d[_0x2a60fc]);}}if(_[_0x0c4a('0x44')](_0x1dc62d['message'])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0x12e'));}else{this[_0x0c4a('0x41')](_0x1dc62d[_0x0c4a('0x12f')],'out',_0x0c4a('0x130'),'');return this['channel'][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x131'),_0x1dc62d['message']));}}return this['channel']['error'](_0x80a282,_0x0c4a('0x132'));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x133')]=function(_0x38b5c7){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x38b5c7['label'],_0x38b5c7[_0x0c4a('0x6d')]));if(!this[_0x0c4a('0xa5')](_0x38b5c7[_0x0c4a('0x7e')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xe8'));}var _0x4cd1e7=_0x0c4a('0x134');var _0xd12f3=util['format'](_0x0c4a('0x135'),FILES_PATH,rs[_0x0c4a('0x11b')](0x4));var _0x564058=util[_0x0c4a('0x28')](_0x0c4a('0x9e'),_0xd12f3,_0x4cd1e7);var _0x75f20f=!![];if(_0x38b5c7[_0x0c4a('0x136')]===_0x0c4a('0x137')){_0x75f20f=![];}var _0x2641d9=this[_0x0c4a('0x10')]['recordFile'](_0xd12f3,_0x4cd1e7,_0x38b5c7[_0x0c4a('0x138')],_0x38b5c7[_0x0c4a('0x6d')],undefined,_0x75f20f);if(_0x2641d9['result']!==-0x1){this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x139'),_0x564058));var _0x3a0ee6=this[_0x0c4a('0x8e')]['sync'](this,_0x38b5c7,_0x564058);if(_0x3a0ee6){for(var _0x3d7a05 in _0x3a0ee6){if(_0x3a0ee6[_0x0c4a('0x95')](_0x3d7a05)){this['channel']['setVariable'](util[_0x0c4a('0x28')]('GOOGLE_ASR_%s',_0x3d7a05['toUpperCase']()),_0x3a0ee6[_0x3d7a05]);}}return this['channel'][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x13a'),JSON[_0x0c4a('0x9f')](_0x3a0ee6)));}}return _0x2641d9;};AGIVertices['prototype'][_0x0c4a('0x13b')]=function(_0x87b362){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0x13c'),_0x87b362[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x87b362[_0x0c4a('0x91')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0x13d'));}if(!this[_0x0c4a('0xa5')](_0x87b362[_0x0c4a('0x13e')])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0x13f'));}var _0x13dbc0=_0x0c4a('0x134');var _0x3b43bb=util[_0x0c4a('0x28')](_0x0c4a('0x135'),FILES_PATH,rs[_0x0c4a('0x11b')](0x4));var _0x547dde=util['format']('%s.%s',_0x3b43bb,_0x13dbc0);var _0x4a467c=!![];if(_0x87b362[_0x0c4a('0x136')]===_0x0c4a('0x137')){_0x4a467c=![];}var _0xd7480=this[_0x0c4a('0x10')][_0x0c4a('0x140')](_0x3b43bb,_0x13dbc0,_0x87b362['intKey'],_0x87b362[_0x0c4a('0x6d')],undefined,_0x4a467c);if(_0xd7480[_0x0c4a('0xa2')]!==-0x1){this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x141'),_0x547dde));var _0x257439=this[_0x0c4a('0x90')][_0x0c4a('0x78')](this,_0x87b362,_0x547dde);if(_0x257439){for(var _0x3b55f4 in _0x257439){if(_0x257439[_0x0c4a('0x95')](_0x3b55f4)){this['channel'][_0x0c4a('0xa4')](util[_0x0c4a('0x28')](_0x0c4a('0x142'),_0x3b55f4[_0x0c4a('0x71')]()),_0x257439[_0x3b55f4]);}}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')]('TildeASR\x20Result\x20%s',JSON[_0x0c4a('0x9f')](_0x257439)));}}return _0xd7480;};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x143')]=function(_0x5885ce){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x144'),_0x5885ce[_0x0c4a('0x36')]));return this[_0x0c4a('0x10')][_0x0c4a('0x145')](_0x5885ce[_0x0c4a('0x3c')],_0x5885ce[_0x0c4a('0x146')],_0x5885ce[_0x0c4a('0x3d')]);};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x147')]=function(_0x4e418b){logger['info'](util['format'](_0x0c4a('0x148'),_0x4e418b['label']));if(!this[_0x0c4a('0xa5')](_0x4e418b[_0x0c4a('0x149')])){return this[_0x0c4a('0x10')]['error'](_0x4e418b,_0x0c4a('0x14a'));}try{var _0x37339d=eval(_0x4e418b[_0x0c4a('0x149')])?_0x0c4a('0x14b'):'false';this[_0x0c4a('0x10')]['noop'](util[_0x0c4a('0x28')](_0x0c4a('0x14c'),_0x4e418b[_0x0c4a('0x149')],_0x37339d));return{'code':0xc8,'result':_0x37339d};}catch(_0x2f9403){return{'code':0xc8,'result':_0x0c4a('0x14d')};}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x14e')]=function(_0x2b72a7){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x14f'),_0x2b72a7[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x2b72a7['interval_id'])){return this['channel'][_0x0c4a('0x2b')](_0x2b72a7,_0x0c4a('0x150'));}var _0x37ef83=this[_0x0c4a('0x151')]['sync'](this,_0x2b72a7[_0x0c4a('0x152')]);if(!_0x37ef83){return this['channel']['error'](_0x2b72a7,_0x0c4a('0x153'));}for(var _0x514b54=0x0;_0x514b54<_0x37ef83[_0x0c4a('0x9c')];_0x514b54+=0x1){var _0x1499fd=this[_0x0c4a('0x10')][_0x0c4a('0x12')](util[_0x0c4a('0x28')](_0x0c4a('0x154'),_0x37ef83[_0x514b54]));if(_0x1499fd[_0x0c4a('0xa2')]===-0x1){return _0x1499fd;}logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0x155'),_0x37ef83[_0x514b54],_0x1499fd[_0x0c4a('0x118')]));if(_0x1499fd[_0x0c4a('0x118')]===_0x0c4a('0x14b')){logger[_0x0c4a('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x37ef83[_0x514b54],_0x0c4a('0x14b')));this['channel'][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x155'),_0x37ef83[_0x514b54],_0x0c4a('0x14b')));return{'code':0xc8,'result':'true'};}else{logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x155'),_0x37ef83[_0x514b54],_0x0c4a('0x14d')));this[_0x0c4a('0x10')]['noop'](util[_0x0c4a('0x28')](_0x0c4a('0x155'),_0x37ef83[_0x514b54],_0x0c4a('0x14d')));}}return{'code':0xc8,'result':_0x0c4a('0x14d')};};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x156')]=function(_0x195744){logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0x157'),_0x195744['label']));return this[_0x0c4a('0x10')][_0x0c4a('0x156')]();};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x158')]=function(_0x40a632){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x159'),_0x40a632[_0x0c4a('0x36')]));if(!this['isConfigured'](_0x40a632[_0x0c4a('0x7e')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('no\x20key\x20configured');}var _0x1ecbcb=_0x0c4a('0x134');var _0x43c379=util['format'](_0x0c4a('0x135'),FILES_PATH,rs[_0x0c4a('0x11b')](0x4));var _0x40a2ac=util[_0x0c4a('0x28')](_0x0c4a('0x9e'),_0x43c379,_0x1ecbcb);var _0x6e5daa=!![];if(_0x40a632[_0x0c4a('0x136')]===_0x0c4a('0x137')){_0x6e5daa=![];}var _0x31406f=this[_0x0c4a('0x10')][_0x0c4a('0x140')](_0x43c379,_0x1ecbcb,_0x40a632['intKey'],_0x40a632[_0x0c4a('0x6d')],undefined,_0x6e5daa);if(_0x31406f[_0x0c4a('0xa2')]!==-0x1){this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x15a'),_0x40a2ac));var _0xc0c911=this['ispeechASR'][_0x0c4a('0x78')](this,_0x40a632,_0x40a2ac);if(_0xc0c911){for(var _0x2c430c in _0xc0c911){if(_0xc0c911['hasOwnProperty'](_0x2c430c)){this[_0x0c4a('0x10')][_0x0c4a('0xa4')](util[_0x0c4a('0x28')]('ISPEECH_ASR_%s',_0x2c430c[_0x0c4a('0x71')]()),_0xc0c911[_0x2c430c]);}}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x15b'),JSON[_0x0c4a('0x9f')](_0xc0c911)));}}return _0x31406f;};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x15c')]=function(_0x28b857){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x28b857[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x28b857[_0x0c4a('0x7e')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x28b857[_0x0c4a('0x64')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('no\x20text\x20configured');}this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x15d'),_0x28b857[_0x0c4a('0x64')]));var _0x3a6028=this[_0x0c4a('0x83')][_0x0c4a('0x78')](this,_0x28b857);if(_0x3a6028){this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format']('ispeech\x20%s\x20file\x20created',_0x3a6028));var _0x8781cb=this[_0x0c4a('0x10')][_0x0c4a('0x127')](_0x3a6028,_0x28b857['intKey']);try{fs[_0x0c4a('0x105')](_0x3a6028+'.wav');}catch(_0x2ad96f){logger[_0x0c4a('0x2b')](_0x2ad96f);}return _0x8781cb;}return this['channel']['error'](_0x28b857,_0x0c4a('0x15e'));};AGIVertices[_0x0c4a('0x11')]['login']=function(_0x3afa3f){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3afa3f[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x3afa3f[_0x0c4a('0x15f')])){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x3afa3f,_0x0c4a('0x160'));}logger['info'](util[_0x0c4a('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0c4a('0x10')]['callerid'],_0x3afa3f[_0x0c4a('0x15f')]));var _0x4421cf=this[_0x0c4a('0x5c')][_0x0c4a('0x78')](this,_0x3afa3f['findBy']);if(_0x4421cf){logger['info'](util['format'](_0x0c4a('0x161'),this['channel']['callerid'],_0x3afa3f[_0x0c4a('0x15f')]));this[_0x0c4a('0x10')]['noop'](util[_0x0c4a('0x28')](_0x0c4a('0x161'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x3afa3f[_0x0c4a('0x15f')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x162'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x3afa3f['findBy']));this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x3afa3f[_0x0c4a('0x15f')]));return{'code':0xc8,'result':_0x0c4a('0x163')};}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x164')]=function(_0x400b74){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x165'),_0x400b74[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x400b74[_0x0c4a('0x15f')])){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x400b74,'no\x20find\x20by\x20configured');}logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0x166'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x400b74[_0x0c4a('0x15f')]));var _0x1562bf=this[_0x0c4a('0x5b')][_0x0c4a('0x78')](this,_0x400b74[_0x0c4a('0x15f')]);if(_0x1562bf){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x161'),this['channel'][_0x0c4a('0x39')],_0x400b74[_0x0c4a('0x15f')]));this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x161'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x400b74[_0x0c4a('0x15f')]));return{'code':0xc8,'result':_0x0c4a('0x167')};}else{logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x162'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x400b74[_0x0c4a('0x15f')]));this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x162'),this['channel']['callerid'],_0x400b74[_0x0c4a('0x15f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x168')]=function(_0x299415){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x299415['label']));if(!this[_0x0c4a('0xa5')](_0x299415[_0x0c4a('0x169')])){return this['channel'][_0x0c4a('0x2b')](_0x299415,'no\x20operation\x20configured');}this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x16a'),_0x299415[_0x0c4a('0x169')]));var _0x28a59d=eval(_0x299415[_0x0c4a('0x169')]);if(!this[_0x0c4a('0xa5')](_0x299415['variable_id'])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0x16b'));}var _0x593f8e=this[_0x0c4a('0x12')][_0x0c4a('0x78')](this,_0x299415[_0x0c4a('0xd9')]);if(!_0x593f8e){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x299415,_0x0c4a('0xda'));}if(_['isArray'](_0x28a59d)){var _0x3c036e=this;_0x28a59d[_0x0c4a('0xdb')](function(_0x1bc97d,_0x341ab3){_0x3c036e['channel'][_0x0c4a('0xa4')](util[_0x0c4a('0x28')](_0x0c4a('0x16c'),_0x593f8e,_0x341ab3),_0x1bc97d);});return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x16d'),_0x593f8e));}else{return this[_0x0c4a('0x10')][_0x0c4a('0xa4')](_0x593f8e,_0x28a59d);}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xd')]=function(_0x160b61){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x16e'),_0x160b61[_0x0c4a('0x36')]));if(_0x160b61['retry']===0x0){return this[_0x0c4a('0xa6')](_0x160b61);}_0x160b61[_0x0c4a('0xa7')]-=0x1;if(!this[_0x0c4a('0xa5')](_0x160b61[_0x0c4a('0x16f')])){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x160b61,_0x0c4a('0x170'));}var _0x3efda6=this['getSound'][_0x0c4a('0x78')](this,_0x160b61[_0x0c4a('0x16f')]);if(!_0x3efda6){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x160b61,_0x0c4a('0x113'));}var _0x5f35aa=this['channel']['getData'](_0x3efda6,_0x160b61[_0x0c4a('0x115')],_0x160b61['digit']);var _0x356751=_0x5f35aa[_0x0c4a('0xa2')];if(_0x5f35aa[_0x0c4a('0xa2')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x160b61,'-1');return _0x5f35aa;}else if(_0x5f35aa[_0x0c4a('0x118')]===_0x0c4a('0x6d')){_0x5f35aa[_0x0c4a('0xa2')]=_0x5f35aa[_0x0c4a('0xa2')]['length']>0x0?_0x5f35aa[_0x0c4a('0xa2')]:'t';}else if(_[_0x0c4a('0x47')](_0x5f35aa[_0x0c4a('0xa2')])){_0x5f35aa[_0x0c4a('0xa2')]='#';_0x356751='#';}if(!this[_0x0c4a('0xa5')](_0x160b61[_0x0c4a('0xd9')])){this['channel'][_0x0c4a('0xa9')](_0x0c4a('0x16b'));}else{var _0x1c5712=this[_0x0c4a('0x12')]['sync'](this,_0x160b61[_0x0c4a('0xd9')]);if(!_0x1c5712){return this['channel']['error'](_0x160b61,_0x0c4a('0xda'));}this[_0x0c4a('0x10')][_0x0c4a('0xa4')](_0x1c5712,_0x356751);}this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x160b61,_0x356751);return _0x5f35aa;};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0xa9')]=function(_0x43a020){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0x171'),_0x43a020[_0x0c4a('0x36')]));return this['channel']['noop'](_0x43a020[_0x0c4a('0x172')]||_0x43a020['label']);};AGIVertices['prototype'][_0x0c4a('0x173')]=function(_0xb0378c){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0xb0378c[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0xb0378c['findBy'])){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0xb0378c,'no\x20find\x20by\x20configured');}logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x166'),this['channel'][_0x0c4a('0x39')],_0xb0378c[_0x0c4a('0x15f')]));var _0x14cc86=this[_0x0c4a('0x174')][_0x0c4a('0x78')](this,_0xb0378c[_0x0c4a('0x175')]);var _0x5312b9=this['agentPause'][_0x0c4a('0x78')](this,_0xb0378c[_0x0c4a('0x15f')],_0x14cc86);if(_0x5312b9){logger[_0x0c4a('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0xb0378c['findBy']));this['channel']['noop'](util[_0x0c4a('0x28')](_0x0c4a('0x161'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0xb0378c['findBy']));return{'code':0xc8,'result':_0x0c4a('0x167')};}else{logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0xb0378c[_0x0c4a('0x15f')]));this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x161'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0xb0378c[_0x0c4a('0x15f')]));return{'code':0xc8,'result':_0x0c4a('0x163')};}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x176')]=function(_0x444637){logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0x177'),_0x444637['label']));if(!this['isConfigured'](_0x444637[_0x0c4a('0x16f')])){return this[_0x0c4a('0x10')]['error'](_0x444637,'no\x20file\x20audio\x20selected');}var _0x3c2228=this[_0x0c4a('0x1c')][_0x0c4a('0x78')](this,_0x444637[_0x0c4a('0x16f')]);if(!_0x3c2228){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x444637,_0x0c4a('0x113'));}var _0x270938=this[_0x0c4a('0x10')][_0x0c4a('0xab')](_0x0c4a('0x178'),[_0x3c2228,_0x444637[_0x0c4a('0x10f')]]);if(_0x270938[_0x0c4a('0xa2')]===-0x1){return _0x270938;}return this[_0x0c4a('0x10')]['noop'](util['format'](_0x0c4a('0xc4'),_0x0c4a('0x178'),_0x3c2228));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x179')]=function(_0x2eed75){logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0x17a'),_0x2eed75[_0x0c4a('0x36')]));if(!this['isConfigured'](_0x2eed75['queue_id'])){return this['channel'][_0x0c4a('0x2b')](_0x2eed75,_0x0c4a('0x17b'));}var _0x5b7f56='';var _0x2314f5=parseInt(_0x2eed75[_0x0c4a('0x17c')],0xa);if(isNaN(_0x2314f5)){_0x5b7f56=_0x2eed75[_0x0c4a('0x17c')];}else{_0x5b7f56=this['getVoiceQueue'][_0x0c4a('0x78')](this,_0x2eed75['queue_id']);if(!_0x5b7f56){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x2eed75,_0x0c4a('0x17d'));}}var _0x580cf5='';if(this[_0x0c4a('0xa5')](_0x2eed75[_0x0c4a('0x16f')])){var _0x14e329=this['getSound'][_0x0c4a('0x78')](this,_0x2eed75[_0x0c4a('0x16f')]);if(_0x14e329){_0x580cf5=_0x14e329;}}this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x2eed75,_0x5b7f56);if(_0x2eed75[_0x0c4a('0x10f')][_0x0c4a('0x17e')]('x')<0x0){_0x2eed75[_0x0c4a('0x10f')]+='x';}if(_0x2eed75['opts'][_0x0c4a('0x17e')]('X')<0x0){_0x2eed75[_0x0c4a('0x10f')]+='X';}this[_0x0c4a('0x10')]['setVariable'](_0x0c4a('0x17f'),_0x5b7f56?_0x5b7f56[_0x0c4a('0x180')]():'');var _0x1fc22a=this[_0x0c4a('0x10')][_0x0c4a('0xab')](_0x0c4a('0x181'),[_0x5b7f56,_0x2eed75['opts'],_0x2eed75['url'],_0x580cf5,_0x2eed75['timeout'],_0x2eed75[_0x0c4a('0x7')],_0x2eed75[_0x0c4a('0x182')],_0x2eed75[_0x0c4a('0x183')],'',_0x2eed75['position']]);if(_0x1fc22a[_0x0c4a('0xa2')]===-0x1){return _0x1fc22a;}return this[_0x0c4a('0x10')]['noop'](util[_0x0c4a('0x28')]('Executed\x20command\x20%s\x20%s',_0x0c4a('0x181'),_0x5b7f56));};AGIVertices['prototype'][_0x0c4a('0x184')]=function(_0x44fd42){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x185'),_0x44fd42[_0x0c4a('0x36')]));var _0x2ec315=_0x44fd42[_0x0c4a('0x186')]||_0x0c4a('0x134');var _0x4e815c=util[_0x0c4a('0x28')](_0x0c4a('0x187'),this[_0x0c4a('0x10')][_0x0c4a('0x42')],rs[_0x0c4a('0x11b')](0x5));var _0x19162c=util[_0x0c4a('0x28')](_0x0c4a('0x188'),FILES_PATH,_0x4e815c,_0x2ec315);var _0x4001c7=util[_0x0c4a('0x28')](_0x0c4a('0x135'),FILES_PATH,_0x4e815c);this[_0x0c4a('0x3a')][_0x0c4a('0x78')](this,_0x44fd42,_0x4e815c,_0x19162c);this[_0x0c4a('0x10')][_0x0c4a('0xa4')](_0x0c4a('0x189'),_0x4e815c);logger[_0x0c4a('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x4001c7,_0x2ec315,_0x44fd42[_0x0c4a('0x18a')],_0x44fd42['timeout']);return this[_0x0c4a('0x10')][_0x0c4a('0x140')](_0x4001c7,_0x2ec315,_0x44fd42[_0x0c4a('0x18a')],_0x44fd42[_0x0c4a('0x6d')],undefined,!![]);};AGIVertices[_0x0c4a('0x11')]['restapi']=function(_0x442436){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x18b'),_0x442436['label']));if(!this[_0x0c4a('0xa5')](_0x442436[_0x0c4a('0x6b')])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0x18c'));}var _0x452b1c=this['restAPI'][_0x0c4a('0x78')](this,_0x442436);logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x18d'),util['inspect'](_0x452b1c,{'showHidden':![],'depth':null})));if(!this[_0x0c4a('0xa5')](_0x442436[_0x0c4a('0xd9')])){return this['channel'][_0x0c4a('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x852e4=this['getVariable'][_0x0c4a('0x78')](this,_0x442436[_0x0c4a('0xd9')]);if(!_0x852e4){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x442436,_0x0c4a('0xda'));}this['channel']['setVariable'](util[_0x0c4a('0x28')](_0x0c4a('0x18e'),_0x852e4),_0x452b1c['statusCode']?_0x452b1c['statusCode']:'200');this[_0x0c4a('0x10')][_0x0c4a('0xa4')](util[_0x0c4a('0x28')]('%s_STATUS_MESSAGE',_0x852e4),_0x452b1c[_0x0c4a('0x18f')]?_0x452b1c[_0x0c4a('0x18f')]:'OK');if(_0x452b1c[_0x0c4a('0x72')]){try{this[_0x0c4a('0x9d')](_0x452b1c['body'],_0x852e4);}catch(_0xeda2a6){logger[_0x0c4a('0x2b')](util[_0x0c4a('0x28')](_0x0c4a('0x190'),_0x852e4));}}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0xdd'),_0x852e4));};AGIVertices['prototype'][_0x0c4a('0x191')]=function(_0x1c5361){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1c5361[_0x0c4a('0x36')]));return this[_0x0c4a('0x10')][_0x0c4a('0x192')](_0x1c5361['digits'][_0x0c4a('0x60')](/\s+/g,''),_0x1c5361[_0x0c4a('0x18a')]);};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x193')]=function(_0x52c042){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x194'),_0x52c042['label']));return this[_0x0c4a('0x10')][_0x0c4a('0x195')](_0x52c042['number'][_0x0c4a('0x60')](/\s+/g,''),_0x52c042['escape_digits']);};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x196')]=function(_0x17f09e){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x197'),_0x17f09e[_0x0c4a('0x36')]));return this[_0x0c4a('0x10')][_0x0c4a('0x198')](_0x17f09e[_0x0c4a('0x64')],_0x17f09e[_0x0c4a('0x18a')]);};AGIVertices[_0x0c4a('0x11')]['sendMail']=function(_0x30505e){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x199'),_0x30505e['label']));if(!this[_0x0c4a('0xa5')](_0x30505e[_0x0c4a('0x19a')])){return this[_0x0c4a('0x10')]['noop'](_0x0c4a('0x19b'));}var _0x137ab7=this['getMailAccount'][_0x0c4a('0x78')](this,_0x30505e[_0x0c4a('0x19a')]);if(!_0x137ab7||!_0x137ab7[_0x0c4a('0x19c')]){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x30505e,_0x0c4a('0x19d'));}var _0x3d1fc1={'from':util[_0x0c4a('0x28')](_0x0c4a('0x19e'),_0x137ab7['name'],_0x137ab7[_0x0c4a('0x19f')]||_0x137ab7[_0x0c4a('0x19c')]['user']),'to':_0x30505e['to']||'','cc':_0x30505e['cc']||'','bcc':_0x30505e[_0x0c4a('0x1a0')]||'','subject':_0x30505e[_0x0c4a('0x1a1')],'html':_0x30505e['text'],'text':_0x30505e[_0x0c4a('0x64')]};var _0x2863f0={'tls':{'rejectUnauthorized':![]}};if(_0x137ab7[_0x0c4a('0x19c')][_0x0c4a('0x1a2')]){_0x2863f0[_0x0c4a('0x1a2')]=_0x137ab7[_0x0c4a('0x19c')][_0x0c4a('0x1a2')];}else{_0x2863f0[_0x0c4a('0x1a3')]=_0x137ab7[_0x0c4a('0x19c')]['host'];_0x2863f0[_0x0c4a('0x1a4')]=_0x137ab7['Smtp']['port'];_0x2863f0[_0x0c4a('0x1a5')]=_0x137ab7[_0x0c4a('0x19c')][_0x0c4a('0x1a5')];}if(_0x137ab7['Smtp'][_0x0c4a('0x1a6')]){_0x2863f0[_0x0c4a('0x1a7')]={'user':_0x137ab7[_0x0c4a('0x19c')][_0x0c4a('0x1a8')],'pass':_0x137ab7['Smtp'][_0x0c4a('0x1a9')]};}if(this[_0x0c4a('0xa5')](_0x30505e['template_id'])){}logger[_0x0c4a('0xdf')](_0x0c4a('0x1aa'),JSON['stringify'](_0x3d1fc1));this[_0x0c4a('0x35')]['sync'](this,_0x30505e,_0x30505e[_0x0c4a('0x19a')]);this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x1ab'),_0x137ab7['name']));this[_0x0c4a('0x22')]['sync'](this,_0x2863f0,_0x3d1fc1);return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0x1ac'));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1ad')]=function(_0x2eaeff){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x1ae'),_0x2eaeff[_0x0c4a('0x36')]));return this['channel'][_0x0c4a('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype']['sendSMS']=function(_0x1b786b){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x1af'),_0x1b786b[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x1b786b[_0x0c4a('0x1b0')])){return this[_0x0c4a('0x10')]['noop']('no\x20sms\x20account\x20configured');}var _0x920703=this[_0x0c4a('0x32')][_0x0c4a('0x78')](this,_0x1b786b['sms_account_id']);if(!_0x920703){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x1b786b,'no\x20sms\x20account\x20found');}var _0x212625={'body':_0x1b786b['sms_text'],'phone':_0x1b786b['to']||'','SmsAccountId':_0x920703['id']};logger[_0x0c4a('0xdf')](_0x0c4a('0x1b1'),JSON[_0x0c4a('0x9f')](_0x212625));this[_0x0c4a('0x35')][_0x0c4a('0x78')](this,_0x1b786b,_0x1b786b[_0x0c4a('0x1b0')]);this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x1b2'),_0x920703[_0x0c4a('0x16')]));this[_0x0c4a('0x34')][_0x0c4a('0x78')](this,_0x212625);return this['channel'][_0x0c4a('0xa9')](_0x0c4a('0x1b3'));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1b4')]=function(_0x1f394e){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x1b5'),_0x1f394e[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x1f394e[_0x0c4a('0xd9')])){return this['channel'][_0x0c4a('0x2b')](_0x1f394e,_0x0c4a('0x1b6'));}var _0x395d0e=this[_0x0c4a('0x12')]['sync'](this,_0x1f394e['variable_id']);if(!_0x395d0e){return this['channel'][_0x0c4a('0x2b')](_0x1f394e,'no\x20variable\x20found');}return this[_0x0c4a('0x10')][_0x0c4a('0xa4')](_0x395d0e,_0x1f394e['variable_value']);};AGIVertices['prototype'][_0x0c4a('0x1b7')]=function(_0x1bd5e3){logger['info'](util['format'](_0x0c4a('0x1b8'),_0x1bd5e3[_0x0c4a('0x36')]));this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('START\x20CALLY\x20SQUARE');if(_0x1bd5e3['answer']===_0x0c4a('0x1b9')){this[_0x0c4a('0x10')]['noop'](_0x0c4a('0x1ba'));return this[_0x0c4a('0x10')][_0x0c4a('0x1bb')]();}return this['channel'][_0x0c4a('0xa9')]('Skipped\x20Answer');};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1bc')]=function(_0x42257f){logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0x1bd'),_0x42257f[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x42257f[_0x0c4a('0x1be')])){return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x42257f,_0x0c4a('0x1bf'));}var _0x581848=this[_0x0c4a('0x19')][_0x0c4a('0x78')](this,_0x42257f[_0x0c4a('0x1be')]);if(!this['isConfigured'](_0x581848)){return this['channel'][_0x0c4a('0x2b')](_0x42257f,util[_0x0c4a('0x28')](_0x0c4a('0x1c0'),_0x42257f[_0x0c4a('0x1be')]));}if(_0x581848===this[_0x0c4a('0x10')]['arg_1']){return this[_0x0c4a('0x10')]['error'](_0x42257f,_0x0c4a('0x1c1'));}this[_0x0c4a('0x35')]['sync'](this,_0x42257f,_0x581848);var _0x20164c=this[_0x0c4a('0x10')][_0x0c4a('0xab')](_0x0c4a('0x1c2'),util[_0x0c4a('0x28')](_0x0c4a('0x1c3'),config[_0x0c4a('0x7')]['host']||_0x0c4a('0x1c4'),_0x581848,this[_0x0c4a('0x10')]['arg_1']));if(_0x20164c[_0x0c4a('0xa2')]===-0x1){return _0x20164c;}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0xc4'),_0x0c4a('0x1c2'),_0x581848));};AGIVertices['prototype'][_0x0c4a('0x1c5')]=function(_0x56ffbd){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x1c6'),_0x56ffbd['label']));var _0x5be397=this[_0x0c4a('0x1c7')][_0x0c4a('0x78')](this,_0x56ffbd[_0x0c4a('0xb9')]);this[_0x0c4a('0x35')]['sync'](this,_0x56ffbd,_0x56ffbd[_0x0c4a('0xb9')]);if(this[_0x0c4a('0xa5')](_0x56ffbd[_0x0c4a('0xd9')])){var _0x41534f=this[_0x0c4a('0x12')][_0x0c4a('0x78')](this,_0x56ffbd['variable_id']);if(_0x41534f){this[_0x0c4a('0x10')][_0x0c4a('0xa4')](_0x41534f,_0x5be397);return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x1c8'),_0x56ffbd['command'],_0x41534f));}}return this[_0x0c4a('0x10')]['noop'](util['format'](_0x0c4a('0x1c9'),_0x56ffbd[_0x0c4a('0xb9')]));};AGIVertices[_0x0c4a('0x11')]['google_cloud_tts']=function(_0x1b14b8){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x1ca'),_0x1b14b8['label']));_0x1b14b8[_0x0c4a('0x64')]=_0x1b14b8[_0x0c4a('0x64')][_0x0c4a('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0c4a('0xa5')](_0x1b14b8[_0x0c4a('0x62')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x1b14b8['text'])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xaa'));}this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x1cb'),_0x1b14b8[_0x0c4a('0x64')]));var _0x41212c=this[_0x0c4a('0x61')]['sync'](this,_0x1b14b8);if(_0x41212c){this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x1cc'),_0x41212c));var _0x59c215=this[_0x0c4a('0x10')][_0x0c4a('0x127')](_0x41212c);try{fs[_0x0c4a('0x105')](_0x41212c+_0x0c4a('0x106'));}catch(_0x350595){logger[_0x0c4a('0x2b')](_0x350595);}return _0x59c215;}return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x1b14b8,_0x0c4a('0x1cd'));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1ce')]=function(_0x106f74){logger[_0x0c4a('0x2c')](util['format'](_0x0c4a('0x1cf'),_0x106f74[_0x0c4a('0x36')]));_0x106f74['text']=_0x106f74[_0x0c4a('0x64')][_0x0c4a('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0c4a('0xa5')](_0x106f74[_0x0c4a('0x64')])){return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](_0x0c4a('0xaa'));}this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util['format'](_0x0c4a('0x1d0'),_0x106f74[_0x0c4a('0x64')]));var _0x311c5f=this[_0x0c4a('0x69')][_0x0c4a('0x78')](this,_0x106f74);if(_0x311c5f){this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0x1d1'),_0x311c5f));var _0x2568cd=this[_0x0c4a('0x10')]['streamFile'](_0x311c5f);try{fs[_0x0c4a('0x105')](_0x311c5f+'.wav');}catch(_0x85cf12){logger[_0x0c4a('0x2b')](_0x85cf12);}return _0x2568cd;}return this[_0x0c4a('0x10')][_0x0c4a('0x2b')](_0x106f74,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x0c4a('0x1d2')]=function(_0x59db44){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x1d3'),_0x59db44[_0x0c4a('0x36')]));if(!this['isConfigured'](_0x59db44[_0x0c4a('0x15f')])){return this['channel'][_0x0c4a('0x2b')](_0x59db44,_0x0c4a('0x160'));}logger['info'](util[_0x0c4a('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x59db44['findBy']));var _0x5cd3a5=this['agentUnpause']['sync'](this,_0x59db44[_0x0c4a('0x15f')]);if(_0x5cd3a5){logger[_0x0c4a('0x2c')](util[_0x0c4a('0x28')](_0x0c4a('0x161'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x59db44['findBy']));this['channel']['noop'](util['format'](_0x0c4a('0x161'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x59db44['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0x162'),this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x59db44[_0x0c4a('0x15f')]));this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0c4a('0x10')][_0x0c4a('0x39')],_0x59db44['findBy']));return{'code':0xc8,'result':_0x0c4a('0x163')};}};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1d4')]=function(_0x252f58){logger['info'](util[_0x0c4a('0x28')](_0x0c4a('0x1d5'),_0x252f58[_0x0c4a('0x36')]));var _0x15cc2b=this['channel'][_0x0c4a('0xab')]('VOICEMAIL',[_0x252f58[_0x0c4a('0x1d6')],_0x252f58[_0x0c4a('0x7c')]]);if(_0x15cc2b[_0x0c4a('0xa2')]===-0x1){return _0x15cc2b;}return this[_0x0c4a('0x10')][_0x0c4a('0xa9')](util[_0x0c4a('0x28')](_0x0c4a('0xc4'),'VOICEMAIL',_0x252f58[_0x0c4a('0x1d6')]));};AGIVertices[_0x0c4a('0x11')][_0x0c4a('0x1d7')]=function(_0x107f5f){logger['info'](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x107f5f[_0x0c4a('0x36')]));if(!this[_0x0c4a('0xa5')](_0x107f5f[_0x0c4a('0xd9')])){return this[_0x0c4a('0x10')]['error'](_0x107f5f,_0x0c4a('0x1b6'));}var _0x732ca4=this['getVariable'][_0x0c4a('0x78')](this,_0x107f5f['variable_id']);if(!_0x732ca4){return this['channel']['error'](_0x107f5f,_0x0c4a('0xda'));}var _0x470438=this[_0x0c4a('0x10')][_0x0c4a('0x12')](_0x732ca4);return{'code':0xc8,'result':_0x470438[_0x0c4a('0x118')]?_0x470438[_0x0c4a('0x118')]:'-'};};String[_0x0c4a('0x11')][_0x0c4a('0x1d8')]=function(_0x457016,_0x3b1bd6){return this[_0x0c4a('0xa0')](_0x457016)['join'](_0x3b1bd6);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0x2ca5=['Executed\x20command\x20MRCPRecog\x20%s','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','add','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','maxdigit','mindigit','variable_id','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','true','false','condition','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','response','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','Executed\x20command\x20%s\x20%s','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','lodash','shelljs','odbc','moment','../../config/logger','agi','../../config/environment','rawHeaders','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','isEmpty','lastName','list_id','scheduledAt','callback','toString','getPause','getPauseById','agentPause','agent','agentUnpause','callerid','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','awsLex','aws_bot_name','googleASR','google_asr_language','appid','appsecret','uri','clone','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','hasOwnProperty','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','options','result','mrcprecog','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2ca5,0x108));var _0x52ca=function(_0x4b01b7,_0x183b04){_0x4b01b7=_0x4b01b7-0x0;var _0x2ed185=_0x2ca5[_0x4b01b7];return _0x2ed185;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x52ca('0x0'));var sh=require(_0x52ca('0x1'));var odbc=require(_0x52ca('0x2'))();var rs=require('randomstring');var moment=require(_0x52ca('0x3'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0x52ca('0x4'))(_0x52ca('0x5'));var config=require(_0x52ca('0x6'));var shared=require('../../config/environment/shared');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x52ca('0x7'),'rawBody'];var verticesWithRetry=['menu',_0x52ca('0x8'),_0x52ca('0x9')];var AGIVertices=function(_0x7cd0a2,_0xa98586,_0x477e8b){this[_0x52ca('0xa')]=_0x7cd0a2;this[_0x52ca('0xb')]=_0xa98586;this['mailRpc']=_0x477e8b;};AGIVertices[_0x52ca('0xc')][_0x52ca('0xd')]=function(_0x278f12,_0x492021){this[_0x52ca('0xb')][_0x52ca('0xe')](_0x278f12)[_0x52ca('0xf')](function(_0x308473){_0x492021(null,_0x308473?_0x308473['name']:![]);})[_0x52ca('0x10')](function(_0x3471f8){_0x492021(_0x3471f8);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x11')]=function(_0x2194e8,_0x3f4d10){this[_0x52ca('0xb')][_0x52ca('0x12')](_0x2194e8)[_0x52ca('0xf')](function(_0x5a8f4d){_0x3f4d10(null,_0x5a8f4d?_0x5a8f4d['name']:![]);})[_0x52ca('0x10')](function(_0x83f3bb){_0x3f4d10(_0x83f3bb);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x13')]=function(_0xe88ca7,_0x1b886f){this[_0x52ca('0xb')][_0x52ca('0x14')](_0xe88ca7)[_0x52ca('0xf')](function(_0x3cd529){_0x1b886f(null,_0x3cd529?_0x3cd529[_0x52ca('0x15')]:![]);})['catch'](function(_0x328ae3){_0x1b886f(_0x328ae3);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x16')]=function(_0xd1d8fa,_0x3fc685){this[_0x52ca('0xb')][_0x52ca('0x17')](_0xd1d8fa)[_0x52ca('0xf')](function(_0x41f4f3){_0x3fc685(null,_0x41f4f3?_0x41f4f3[_0x52ca('0x18')]:![]);})[_0x52ca('0x10')](function(_0x493c98){_0x3fc685(_0x493c98);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x19')]=function(_0x3d8473,_0x1e5d58){this[_0x52ca('0xb')][_0x52ca('0x1a')](_0x3d8473)[_0x52ca('0xf')](function(_0x508844){_0x1e5d58(null,_0x508844?_0x508844[_0x52ca('0x15')]:![]);})[_0x52ca('0x10')](function(_0x3719ad){_0x1e5d58(_0x3719ad);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x1b')]=function(_0x26daa1,_0x350316){this[_0x52ca('0xb')]['getTrunkById'](_0x26daa1)['then'](function(_0x303464){_0x350316(null,_0x303464?_0x303464['name']:![]);})[_0x52ca('0x10')](function(_0x1b67d8){_0x350316(_0x1b67d8);});};AGIVertices['prototype'][_0x52ca('0x1c')]=function(_0x2d8944,_0x8f2ac6){var _0x2c04be=this;this['rpc'][_0x52ca('0x1d')](_0x2d8944)[_0x52ca('0xf')](function(_0x551dea){_0x8f2ac6(null,_0x551dea?_0x2c04be['getSoundPath'](_0x551dea[_0x52ca('0x1e')]):![]);})['catch'](function(_0x1b1d8f){_0x8f2ac6(_0x1b1d8f);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x1f')]=function(_0x38c00d,_0x1ce123){this[_0x52ca('0xb')][_0x52ca('0x20')](_0x38c00d)[_0x52ca('0xf')](function(_0x4945ed){_0x1ce123(null,_0x4945ed?_0x4945ed:![]);})['catch'](function(_0x1c3fbc){_0x1ce123(_0x1c3fbc);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x21')]=function(_0x14e830,_0x547006,_0x411270){this[_0x52ca('0x22')][_0x52ca('0x21')](_0x14e830,_0x547006)[_0x52ca('0xf')](function(){_0x411270(null);})[_0x52ca('0x10')](function(_0x54cb4b){_0x411270(_0x54cb4b);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x23')]=function(_0x31cd5f,_0x3d6ef3){this[_0x52ca('0xb')]['getIntervalById'](_0x31cd5f)[_0x52ca('0xf')](function(_0x3368fc){if(_0x3368fc){if(_0x3368fc[_0x52ca('0x24')]){_0x3d6ef3(null,[_0x3368fc[_0x52ca('0x25')]]);}else{_0x3d6ef3(null,_[_0x52ca('0x26')](_0x3368fc[_0x52ca('0x27')],_0x52ca('0x25')));}}else{_0x3d6ef3(null,![]);}})['catch'](function(_0x3d1148){_0x3d6ef3(_0x3d1148);});};AGIVertices['prototype'][_0x52ca('0x28')]=function(_0xb75a93){return util[_0x52ca('0x29')](_0x52ca('0x2a'),FILES_PATH,_0xb75a93);};AGIVertices[_0x52ca('0xc')]['getQueryOdbc']=function(_0x39b7f0,_0xc1205e,_0x8b20ed){odbc['open'](_0x39b7f0,function(_0x1b41c4){if(_0x1b41c4){logger[_0x52ca('0x2b')](_0x52ca('0x2c'),_0x1b41c4);_0x8b20ed(_0x1b41c4);}else{logger[_0x52ca('0x2d')](_0x52ca('0x2e'));odbc[_0x52ca('0x2f')](_0xc1205e,function(_0x4ea08f,_0x2a2301){if(_0x4ea08f){logger[_0x52ca('0x2d')]('Error\x20executing\x20query\x20%s',_0xc1205e);_0x8b20ed(_0x4ea08f);}else{logger[_0x52ca('0x2d')](_0x52ca('0x30'),_0xc1205e);odbc[_0x52ca('0x31')](function(_0x156f68){if(_0x156f68){logger[_0x52ca('0x2b')](_0x52ca('0x32'),_0x156f68);}_0x8b20ed(null,_0x2a2301);});}});}});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x33')]=function(_0xea976c,_0x4e5ed3){this[_0x52ca('0xb')]['getSmsAccountById'](_0xea976c)[_0x52ca('0xf')](function(_0x110ca7){_0x4e5ed3(null,_0x110ca7?_0x110ca7:![]);})[_0x52ca('0x10')](function(_0x1f8001){_0x4e5ed3(_0x1f8001);});};AGIVertices['prototype']['createSmsMessage']=function(_0x519944,_0x51775e){this[_0x52ca('0xb')][_0x52ca('0x34')](_0x519944)[_0x52ca('0xf')](function(_0x216f52){_0x51775e(null,_0x216f52);})['catch'](function(_0x5b4139){_0x51775e(_0x5b4139);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x35')]=function(_0xd756d9,_0x2afa53,_0x8aab4d){this[_0x52ca('0xb')][_0x52ca('0x35')]({'uniqueid':this[_0x52ca('0xa')][_0x52ca('0x36')],'node':_0xd756d9[_0x52ca('0x37')],'application':_0xd756d9[_0x52ca('0x38')],'data':_0x2afa53||null,'project_name':this['channel'][_0x52ca('0x39')],'callerid':this['channel']['callerid']})[_0x52ca('0xf')](function(_0x38d7ea){if(_0x8aab4d){_0x8aab4d(null,_0x38d7ea);}})[_0x52ca('0x10')](function(_0x591432){if(_0x8aab4d){_0x8aab4d(_0x591432);}});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x3a')]=function(_0x366133,_0x260410,_0x4c3ce4,_0xd7532c){this[_0x52ca('0xb')]['createSquareRecording']({'uniqueid':this[_0x52ca('0xa')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this['channel'][_0x52ca('0x3b')],'context':this[_0x52ca('0xa')][_0x52ca('0x3c')],'extension':this['channel'][_0x52ca('0x3d')],'priority':this[_0x52ca('0xa')][_0x52ca('0x3e')],'accountcode':this[_0x52ca('0xa')][_0x52ca('0x3f')],'dnid':this[_0x52ca('0xa')][_0x52ca('0x40')],'projectName':this[_0x52ca('0xa')][_0x52ca('0x39')],'saveName':_0x260410,'filename':_0x366133[_0x52ca('0x41')]||_0x260410,'savePath':_0x4c3ce4})[_0x52ca('0xf')](function(_0x4cf6b1){_0xd7532c(null,_0x4cf6b1);})[_0x52ca('0x10')](function(_0x30e765){_0xd7532c(_0x30e765);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x42')]=function(_0x3b3781,_0x383bef,_0x3a5191,_0x1241f0,_0x531ab0){this['rpc']['createSquareMessage']({'uniqueid':this['channel']['uniqueid'],'body':_0x3b3781,'direction':_0x383bef,'providerName':_0x3a5191,'providerResponse':_0x1241f0})[_0x52ca('0xf')](function(_0x1b36b3){if(_0x531ab0){_0x531ab0(null,_0x1b36b3);}})[_0x52ca('0x10')](function(_0x1db1d8){if(_0x531ab0){_0x531ab0(_0x1db1d8);}});};AGIVertices['prototype'][_0x52ca('0x43')]=function(_0x45a42,_0x3e4b9e){this['rpc'][_0x52ca('0x43')]({'firstName':_['isEmpty'](_0x45a42[_0x52ca('0x15')])||_[_0x52ca('0x44')](_0x45a42[_0x52ca('0x15')])?_0x52ca('0x45')+Math['random']():_0x45a42['name'],'lastName':_[_0x52ca('0x46')](_0x45a42[_0x52ca('0x47')])||_[_0x52ca('0x44')](_0x45a42[_0x52ca('0x47')])?null:_0x45a42[_0x52ca('0x47')],'phone':_0x45a42['phone'],'ListId':_0x45a42[_0x52ca('0x48')],'scheduledat':_0x45a42[_0x52ca('0x49')],'callbackUniqueid':this[_0x52ca('0xa')][_0x52ca('0x36')],'tags':_0x52ca('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x45a42['scheduledAt'][_0x52ca('0x4b')](),'priority':_0x45a42['callback_priority']})['then'](function(_0xa72738){_0x3e4b9e(null,_0xa72738);})[_0x52ca('0x10')](function(_0x2a89f4){_0x3e4b9e(_0x2a89f4);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x4c')]=function(_0x358fa8,_0x1e6e43){this[_0x52ca('0xb')][_0x52ca('0x4d')](_0x358fa8)[_0x52ca('0xf')](function(_0x51330a){_0x1e6e43(null,_0x51330a?_0x51330a[_0x52ca('0x15')]:![]);})[_0x52ca('0x10')](function(_0x478622){_0x1e6e43(_0x478622);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x4e')]=function(_0x1f4167,_0x1bf145,_0x2b0d67){var _0x407df5={'role':_0x52ca('0x4f')};_0x407df5[_0x1f4167]=this['channel']['callerid'];this[_0x52ca('0xb')][_0x52ca('0x4e')](_0x407df5,_0x1bf145,this[_0x52ca('0xa')][_0x52ca('0x36')])[_0x52ca('0xf')](function(_0x537f53){_0x2b0d67(null,_[_0x52ca('0x44')](_0x537f53)?![]:!![]);})[_0x52ca('0x10')](function(_0x4cfe65){logger['error'](_0x4cfe65);_0x2b0d67(null,![]);});};AGIVertices['prototype'][_0x52ca('0x50')]=function(_0x463f96,_0x132861){var _0x2e355a={'role':_0x52ca('0x4f')};_0x2e355a[_0x463f96]=this[_0x52ca('0xa')][_0x52ca('0x51')];this['rpc'][_0x52ca('0x50')](_0x2e355a)[_0x52ca('0xf')](function(_0xb6ee0e){_0x132861(null,_[_0x52ca('0x44')](_0xb6ee0e)?![]:!![]);})[_0x52ca('0x10')](function(_0xf44946){logger[_0x52ca('0x2b')](_0xf44946);_0x132861(null,![]);});};AGIVertices['prototype'][_0x52ca('0x52')]=function(_0x3db43f,_0x355a23){var _0x172dd3={'role':_0x52ca('0x4f')};_0x172dd3[_0x3db43f]=this[_0x52ca('0xa')][_0x52ca('0x51')];this[_0x52ca('0xb')][_0x52ca('0x52')](_0x172dd3)['then'](function(_0x51092c){_0x355a23(null,_['isNil'](_0x51092c)?![]:!![]);})[_0x52ca('0x10')](function(_0x3b31cc){logger[_0x52ca('0x2b')](_0x3b31cc);_0x355a23(null,![]);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x53')]=function(_0x8df664,_0x2865db){var _0x25b1fe={'role':_0x52ca('0x4f')};_0x25b1fe[_0x8df664]=this[_0x52ca('0xa')]['callerid'];var _0x157701=_0x8df664!='internal'?util[_0x52ca('0x29')](_0x52ca('0x54'),_0x52ca('0x55'),this[_0x52ca('0xa')]['callerid']):undefined;this['rpc'][_0x52ca('0x53')](_0x25b1fe,_0x157701)['then'](function(_0x3fe8f9){_0x2865db(null,_[_0x52ca('0x44')](_0x3fe8f9)?![]:!![]);})[_0x52ca('0x10')](function(_0x3fd8f9){logger[_0x52ca('0x2b')](_0x3fd8f9);_0x2865db(null,![]);});};AGIVertices[_0x52ca('0xc')]['shellCommand']=function(_0x5b4a94,_0x36c7ce){sh[_0x52ca('0x56')](_[_0x52ca('0x57')](_0x5b4a94),function(_0x207f87,_0x13ac6a){var _0x9b0080=_0x13ac6a[_0x52ca('0x58')](/(\r\n|\n|\r)/gm,'');_0x36c7ce(null,_0x9b0080);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x59')]=function(_0xab57b0,_0x571b1c){scripts[_0x52ca('0x59')](_0xab57b0[_0x52ca('0x5a')],_0xab57b0['google_cloud_tts_text_type']||_0x52ca('0x5b'),_0xab57b0['text'],_0xab57b0[_0x52ca('0x5c')]||'en-US',_0xab57b0[_0x52ca('0x5d')]||_0x52ca('0x5e'),_0xab57b0[_0x52ca('0x5f')]||_0x52ca('0x60'))[_0x52ca('0xf')](function(_0x28e172){_0x571b1c(null,_0x28e172);})[_0x52ca('0x10')](function(_0x42c5a9){_0x571b1c(_0x42c5a9);});};AGIVertices['prototype'][_0x52ca('0x61')]=function(_0x1b208a,_0x4fa10f){scripts['googleTTS'](_0x1b208a['text'],_0x1b208a['google_tts_language']||'en',0x1)[_0x52ca('0xf')](function(_0x58f742){_0x4fa10f(null,_0x58f742);})[_0x52ca('0x10')](function(_0x35b8f5){_0x4fa10f(_0x35b8f5);});};AGIVertices['prototype'][_0x52ca('0x62')]=function(_0x5b63ed,_0x324e1d){var _0x3259f3={'uri':_0x5b63ed[_0x52ca('0x63')],'method':_0x5b63ed[_0x52ca('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5b63ed[_0x52ca('0x65')])===_0x52ca('0x66')&&parseInt(_0x5b63ed['timeout'])>=0x1?parseInt(_0x5b63ed[_0x52ca('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x52ca('0x67')]([_0x52ca('0x68'),_0x52ca('0x69')],_0x3259f3[_0x52ca('0x64')][_0x52ca('0x6a')]())){try{_0x3259f3[_0x52ca('0x6b')]=_0x5b63ed['rawBody']?JSON[_0x52ca('0x6c')](_0x5b63ed[_0x52ca('0x6d')]):{};}catch(_0x2cc55f){logger[_0x52ca('0x2b')](_0x52ca('0x6e'),_0x2cc55f);}}try{_0x3259f3[_0x52ca('0x6f')]=_0x5b63ed['rawHeaders']?JSON[_0x52ca('0x6c')](_0x5b63ed['rawHeaders']):{};}catch(_0x59b88f){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x59b88f);}if(_0x5b63ed[_0x52ca('0x70')]){try{var _0x21ef9b=require(_0x5b63ed[_0x52ca('0x70')])['sync'](this,_0x3259f3);_0x3259f3['uri']=Mustache[_0x52ca('0x71')](_0x5b63ed[_0x52ca('0x63')],_0x21ef9b,{},['$$','$$']);if(_0x3259f3[_0x52ca('0x6f')]){_0x3259f3[_0x52ca('0x6f')]=JSON[_0x52ca('0x6c')](Mustache[_0x52ca('0x71')](JSON['stringify'](_0x3259f3[_0x52ca('0x6f')]),_0x21ef9b,{},['$$','$$']));}if(_0x3259f3['body']){_0x3259f3[_0x52ca('0x6b')]=JSON[_0x52ca('0x6c')](Mustache[_0x52ca('0x71')](JSON[_0x52ca('0x72')](_0x3259f3[_0x52ca('0x6b')]),_0x21ef9b,{},['$$','$$']));}}catch(_0x53133b){logger[_0x52ca('0x2b')](_0x52ca('0x73'),_0x53133b);}}rp(_0x3259f3)['then'](function(_0x1282a1){var _0x2658f8={'statusCode':_0x1282a1[_0x52ca('0x74')]||0xc8,'statusMessage':_0x1282a1[_0x52ca('0x75')]||'OK','headers':_0x1282a1[_0x52ca('0x6f')]||{},'body':_0x1282a1[_0x52ca('0x6b')]||{}};_0x324e1d(null,_0x2658f8);})[_0x52ca('0x10')](function(_0xd1a14d){var _0x4ceed5={'statusCode':_0xd1a14d[_0x52ca('0x74')]||0x1f4,'statusMessage':_0xd1a14d[_0x52ca('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0xd1a14d['options'][_0x52ca('0x6f')]||{},'body':_0xd1a14d['options'][_0x52ca('0x6b')]||{}};_0x324e1d(null,_0x4ceed5);});};AGIVertices['prototype'][_0x52ca('0x77')]=function(_0x22a8a3,_0xbb4286){scripts[_0x52ca('0x77')](this[_0x52ca('0xa')]['uniqueid'],_0x22a8a3[_0x52ca('0x78')],_0x22a8a3[_0x52ca('0x5b')],_0x22a8a3[_0x52ca('0x79')]||'en')[_0x52ca('0xf')](function(_0x3b9dee){_0xbb4286(null,_0x3b9dee);})[_0x52ca('0x10')](function(_0x5842d){_0xbb4286(_0x5842d);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x7a')]=function(_0x5350f5,_0x56fb5d){scripts[_0x52ca('0x7a')](this['channel'][_0x52ca('0x36')],_0x5350f5[_0x52ca('0x7b')],_0x5350f5[_0x52ca('0x7c')],_0x5350f5['private_key'],_0x5350f5[_0x52ca('0x5b')],_0x5350f5[_0x52ca('0x7d')]||'en')['then'](function(_0x231ff8){_0x56fb5d(null,_0x231ff8);})[_0x52ca('0x10')](function(_0x2080e7){_0x56fb5d(_0x2080e7);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x7e')]=function(_0x479d04,_0x3a47a6){scripts[_0x52ca('0x7e')](this[_0x52ca('0xa')],_0x479d04)[_0x52ca('0xf')](function(_0xfc616f){_0x3a47a6(null,_0xfc616f);})[_0x52ca('0x10')](function(_0x4c0c1d){_0x3a47a6(_0x4c0c1d);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x7f')]=function(_0x47618e,_0x594499){scripts[_0x52ca('0x7f')](_0x47618e[_0x52ca('0x78')],_0x47618e[_0x52ca('0x5b')],_0x47618e['ispeech_tts_language']||_0x52ca('0x80'),_0x47618e[_0x52ca('0x81')])['then'](function(_0x28c479){_0x594499(null,_0x28c479);})['catch'](function(_0x47d33e){_0x594499(_0x47d33e);});};AGIVertices[_0x52ca('0xc')]['ispeechASR']=function(_0x881e6d,_0x3305ac,_0x11bd99){scripts[_0x52ca('0x82')](_0x3305ac,_0x881e6d[_0x52ca('0x78')],_0x881e6d[_0x52ca('0x83')]||_0x52ca('0x80'),this[_0x52ca('0x84')](_0x881e6d[_0x52ca('0x85')])?_0x881e6d[_0x52ca('0x85')]:undefined)[_0x52ca('0xf')](function(_0x3ad0f4){_0x11bd99(null,_0x3ad0f4);})[_0x52ca('0x10')](function(_0x3b1f7e){_0x11bd99(_0x3b1f7e);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x86')]=function(_0x57cd56,_0x419eb2){scripts[_0x52ca('0x86')](_0x57cd56[_0x52ca('0x87')],_0x57cd56[_0x52ca('0x88')],_0x57cd56['aws_polly_region'],_0x57cd56[_0x52ca('0x89')]||_0x52ca('0x8a'),_0x57cd56[_0x52ca('0x5b')],_0x57cd56['aws_text_type']||'text')[_0x52ca('0xf')](function(_0x306c59){_0x419eb2(null,_0x306c59);})[_0x52ca('0x10')](function(_0x6e2411){_0x419eb2(_0x6e2411);});};AGIVertices[_0x52ca('0xc')][_0x52ca('0x8b')]=function(_0x18edc1,_0x424152){scripts[_0x52ca('0x8b')](this['channel'][_0x52ca('0x36')],_0x18edc1[_0x52ca('0x87')],_0x18edc1[_0x52ca('0x88')],_0x18edc1['aws_lex_region'],_0x18edc1[_0x52ca('0x5b')],_0x18edc1[_0x52ca('0x8c')])[_0x52ca('0xf')](function(_0x414fc2){_0x424152(null,_0x414fc2);})[_0x52ca('0x10')](function(_0xedbb67){_0x424152(_0xedbb67);});};AGIVertices['prototype'][_0x52ca('0x8d')]=function(_0x447d2c,_0x395a61,_0x1ffc6d){scripts[_0x52ca('0x8d')](_0x395a61,_0x447d2c[_0x52ca('0x78')],_0x447d2c[_0x52ca('0x8e')]||_0x52ca('0x80'))[_0x52ca('0xf')](function(_0x59fe48){_0x1ffc6d(null,_0x59fe48);})[_0x52ca('0x10')](function(_0x2c5072){_0x1ffc6d(_0x2c5072);});};AGIVertices[_0x52ca('0xc')]['tildeASR']=function(_0x2361c6,_0x22982a,_0x18edca){scripts['tildeASR'](_0x22982a,_0x2361c6[_0x52ca('0x8f')],_0x2361c6[_0x52ca('0x90')],_0x2361c6[_0x52ca('0x91')])[_0x52ca('0xf')](function(_0x52bb4b){_0x18edca(null,_0x52bb4b);})[_0x52ca('0x10')](function(_0x2aa88e){_0x18edca(_0x2aa88e);});};AGIVertices['prototype']['clear']=function(_0xb083da){var _0x18e673=_[_0x52ca('0x67')](verticesWithRetry,_0xb083da[_0x52ca('0x38')])?_0xb083da:_[_0x52ca('0x92')](_0xb083da);for(var _0x1f0ec6 in _0x18e673){if(_0x18e673['hasOwnProperty'](_0x1f0ec6)){if(_0x18e673[_0x1f0ec6]&&_['isString'](_0x18e673[_0x1f0ec6])){if(_[_0x52ca('0x67')](recursiveMapAttributes,_0x1f0ec6)){_0x18e673[_0x1f0ec6]=this[_0x52ca('0x93')](_0x18e673[_0x1f0ec6]);}else{_0x18e673[_0x1f0ec6]=this[_0x52ca('0x94')](_0x18e673[_0x1f0ec6]);}}}}return _0x18e673;};AGIVertices[_0x52ca('0xc')][_0x52ca('0x95')]=function(_0x5a6982){for(var _0xeda7a5 in _0x5a6982){if(_0x5a6982['hasOwnProperty'](_0xeda7a5)){if(_['isPlainObject'](_0x5a6982[_0xeda7a5])){this[_0x52ca('0x95')](_0x5a6982[_0xeda7a5]);}else if(_[_0x52ca('0x96')](_0x5a6982[_0xeda7a5])){for(var _0x3bc9b3=0x0;_0x3bc9b3<_0x5a6982[_0xeda7a5][_0x52ca('0x97')];_0x3bc9b3++){this[_0x52ca('0x95')](_0x5a6982[_0xeda7a5][_0x3bc9b3]);}}else if(_[_0x52ca('0x98')](_0x5a6982[_0xeda7a5])){_0x5a6982[_0xeda7a5]=this['replaceAllVariables'](_0x5a6982[_0xeda7a5]);}}}};AGIVertices[_0x52ca('0xc')][_0x52ca('0x99')]=function(_0xd78d3f,_0x33799d){for(var _0x22739c in _0xd78d3f){if(_0xd78d3f[_0x52ca('0x9a')](_0x22739c)){if(_['isPlainObject'](_0xd78d3f[_0x22739c])){if(!_[_0x52ca('0x46')](_0xd78d3f[_0x22739c])){this[_0x52ca('0x99')](_0xd78d3f[_0x22739c],util[_0x52ca('0x29')](_0x52ca('0x9b'),_0x33799d,_0x22739c));}}else if(_[_0x52ca('0x96')](_0xd78d3f[_0x22739c])){for(var _0x4a0a5e=0x0;_0x4a0a5e<_0xd78d3f[_0x22739c]['length'];_0x4a0a5e++){this[_0x52ca('0x99')](_0xd78d3f[_0x22739c][_0x4a0a5e],util[_0x52ca('0x29')](_0x52ca('0x9b'),_0x33799d,_0x22739c+'['+_0x4a0a5e+']'));}}else{if(!_[_0x52ca('0x44')](_0xd78d3f[_0x22739c])){this[_0x52ca('0xa')][_0x52ca('0x9c')](util[_0x52ca('0x29')](_0x52ca('0x9b'),_0x33799d,_0x22739c),_0xd78d3f[_0x22739c]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x1346c6){try{var _0x1ba36a=JSON[_0x52ca('0x6c')](_0x1346c6);this['recursiveNodeIndex'](_0x1ba36a);return JSON[_0x52ca('0x72')](_0x1ba36a);}catch(_0x3c8d2e){return this['replaceAllVariables'](_0x1346c6);}};AGIVertices[_0x52ca('0xc')][_0x52ca('0x94')]=function(_0x5652ee){var _0x3b6130=_0x5652ee['split']('{');for(var _0x5efe99=0x1;_0x5efe99<_0x3b6130[_0x52ca('0x97')];_0x5efe99+=0x1){var _0x4e0c30=_0x3b6130[_0x5efe99][_0x52ca('0x9d')]('}');if(_0x4e0c30[_0x52ca('0x97')]>0x1){_0x5652ee=_0x5652ee[_0x52ca('0x9e')]('{'+_0x4e0c30[0x0]+'}',this[_0x52ca('0xa')][_0x52ca('0xd')](_0x4e0c30[0x0])[_0x52ca('0x9f')]||_0x4e0c30[0x0]);}}if(_0x3b6130['length']===0x1){return _0x5652ee['toString']();}return this[_0x52ca('0x94')](_0x5652ee);};AGIVertices['prototype'][_0x52ca('0xa0')]=function(_0x149bb6,_0x4843b8){var _0x5dde77=this[_0x52ca('0xa')]['getVariable'](_0x149bb6);if(_0x5dde77['result']===-0x1){return _0x5dde77;}logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0xa1'),_0x4843b8,_0x5dde77[_0x52ca('0x9f')]));return this[_0x52ca('0xa')][_0x52ca('0x9c')](_0x4843b8,_0x5dde77[_0x52ca('0x9f')]);};AGIVertices[_0x52ca('0xc')][_0x52ca('0x84')]=function(_0x3e4d32){return _0x3e4d32&&_0x3e4d32!=='0'&&_0x3e4d32!=='-1'&&_0x3e4d32!=='';};AGIVertices['prototype'][_0x52ca('0xa2')]=function(_0x24ca6c){this['createSquareDetailsReport'][_0x52ca('0xa3')](this,_0x24ca6c,'-');_0x24ca6c[_0x52ca('0xa4')]=_0x24ca6c[_0x52ca('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x52ca('0xc')][_0x52ca('0xa5')]=function(_0x23bd31){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0xa6'),_0x23bd31[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x23bd31[_0x52ca('0x5b')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xa8'));}var _0x100656='\x22'+_0x23bd31['text']+'\x22';if(this[_0x52ca('0x84')](_0x23bd31[_0x52ca('0xa9')])){_0x100656+=','+_0x23bd31[_0x52ca('0xa9')];}var _0x2ca66a=this['channel'][_0x52ca('0x56')]('MRCPSynth',_0x100656);if(_0x2ca66a[_0x52ca('0xaa')]===-0x1){return _0x2ca66a;}return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x100656));};AGIVertices[_0x52ca('0xc')][_0x52ca('0xab')]=function(_0x3b3ded){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x3b3ded['label']));if(!this[_0x52ca('0x84')](_0x3b3ded['grammar'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')]('no\x20grammar\x20configured');}var _0xeea2f3=_0x3b3ded[_0x52ca('0xac')];if(this[_0x52ca('0x84')](_0x3b3ded[_0x52ca('0xa9')])){_0xeea2f3+=','+_0x3b3ded[_0x52ca('0xa9')];}var _0x57e4fa=this['channel']['exec'](_0x52ca('0xad'),_0xeea2f3);if(_0x57e4fa[_0x52ca('0xaa')]===-0x1){return _0x57e4fa;}var _0x305360=this[_0x52ca('0xa0')](_0x52ca('0xae'),_0x52ca('0xaf'));if(_0x305360[_0x52ca('0xaa')]===-0x1){return _0x305360;}var _0x20211a=this['getAndSetVariable'](_0x52ca('0xb0'),'MRCP_RECOG_TRANSCRIPT');if(_0x20211a[_0x52ca('0xaa')]===-0x1){return _0x20211a;}var _0x401681=this[_0x52ca('0xa0')](_0x52ca('0xb1'),_0x52ca('0xb2'));if(_0x401681[_0x52ca('0xaa')]===-0x1){return _0x401681;}return this['channel'][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0xb3'),_0xeea2f3));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x5')]=function(_0x362d2c){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x362d2c[_0x52ca('0x37')]));return this[_0x52ca('0xa')][_0x52ca('0x5')]([_0x362d2c['command'],_0x362d2c[_0x52ca('0xb4')]]);};AGIVertices[_0x52ca('0xc')][_0x52ca('0xb5')]=function(_0x39c799){logger[_0x52ca('0x2d')](util['format'](_0x52ca('0xb6'),_0x39c799[_0x52ca('0x37')]));if(this['isConfigured'](_0x39c799[_0x52ca('0x65')])){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0xb7'),_0x39c799[_0x52ca('0x65')]));var _0x8c2e5b=this[_0x52ca('0xa')][_0x52ca('0xb8')](_0x39c799[_0x52ca('0x65')]);if(_0x8c2e5b[_0x52ca('0xaa')]===-0x1){return _0x8c2e5b;}}return this['channel'][_0x52ca('0xb5')]();};AGIVertices[_0x52ca('0xc')][_0x52ca('0x4a')]=function(_0x21fcec){logger[_0x52ca('0x2d')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x21fcec[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x21fcec['list_id'])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x21fcec,'no\x20list\x20selected');}_0x21fcec[_0x52ca('0x49')]=moment();if(this[_0x52ca('0x84')](_0x21fcec['delay'])){_0x21fcec[_0x52ca('0x49')]=moment()[_0x52ca('0xb9')](_0x21fcec[_0x52ca('0xba')],_0x52ca('0xbb'));}if(!this[_0x52ca('0x84')](_0x21fcec[_0x52ca('0xbc')])){_0x21fcec[_0x52ca('0xbc')]=0x2;}this[_0x52ca('0x43')][_0x52ca('0xa3')](this,_0x21fcec);return this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0xbd'),_0x21fcec[_0x52ca('0xbe')],_0x21fcec[_0x52ca('0x48')],_0x21fcec[_0x52ca('0x49')]));};AGIVertices[_0x52ca('0xc')][_0x52ca('0xbf')]=function(_0xc74768){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0xc74768['label']));var _0x5f275a=this[_0x52ca('0xa')]['exec'](_0xc74768[_0x52ca('0xc0')],_0xc74768[_0x52ca('0xa9')]);if(_0x5f275a[_0x52ca('0xaa')]===-0x1){return _0x5f275a;}return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')]('Executed\x20command\x20%s\x20%s',_0xc74768[_0x52ca('0xc0')],_0xc74768[_0x52ca('0xa9')]));};AGIVertices[_0x52ca('0xc')][_0x52ca('0xc1')]=function(_0x392696){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0xc2'),_0x392696[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x392696[_0x52ca('0x5b')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xa8'));}var _0x5a43bd='\x22'+_0x392696[_0x52ca('0x5b')]+'\x22';if(this[_0x52ca('0x84')](_0x392696[_0x52ca('0xa9')])){_0x5a43bd+=','+_0x392696[_0x52ca('0xa9')];}var _0x34c9a9=this[_0x52ca('0xa')][_0x52ca('0x56')](_0x52ca('0xc3'),_0x5a43bd);if(_0x34c9a9[_0x52ca('0xaa')]===-0x1){return _0x34c9a9;}return this['channel'][_0x52ca('0xa7')](util['format'](_0x52ca('0xc4'),_0x5a43bd));};AGIVertices[_0x52ca('0xc')][_0x52ca('0xc5')]=function(_0x205857){logger[_0x52ca('0x2d')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x205857[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x205857[_0x52ca('0x5b')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xa8'));}var _0x426e62='\x22'+_0x205857[_0x52ca('0x5b')]+'\x22';if(this[_0x52ca('0x84')](_0x205857[_0x52ca('0xa9')])){_0x426e62+=','+_0x205857[_0x52ca('0xa9')];}var _0x426d1c=this[_0x52ca('0xa')]['exec']('MRCPSynth',_0x426e62);if(_0x426d1c[_0x52ca('0xaa')]===-0x1){return _0x426d1c;}return this['channel']['noop'](util[_0x52ca('0x29')](_0x52ca('0xc4'),_0x426e62));};AGIVertices[_0x52ca('0xc')]['lumenvoxasr']=function(_0x3261ed){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3261ed[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x3261ed[_0x52ca('0xac')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xc6'));}var _0x2db762=_0x3261ed['grammar'];if(this[_0x52ca('0x84')](_0x3261ed[_0x52ca('0xa9')])){_0x2db762+=','+_0x3261ed[_0x52ca('0xa9')];}var _0x2a756d=this[_0x52ca('0xa')]['exec'](_0x52ca('0xad'),_0x2db762);if(_0x2a756d[_0x52ca('0xaa')]===-0x1){return _0x2a756d;}var _0x25de29=this[_0x52ca('0xa0')](_0x52ca('0xae'),_0x52ca('0xc7'));if(_0x25de29[_0x52ca('0xaa')]===-0x1){return _0x25de29;}var _0x39103f=this[_0x52ca('0xa0')](_0x52ca('0xb0'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x39103f[_0x52ca('0xaa')]===-0x1){return _0x39103f;}var _0x4f2b4e=this[_0x52ca('0xa0')]('RECOG_INSTANCE()',_0x52ca('0xc8'));if(_0x4f2b4e[_0x52ca('0xaa')]===-0x1){return _0x4f2b4e;}return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2db762));};AGIVertices[_0x52ca('0xc')]['sestekasr']=function(_0x6c1088){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x6c1088[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x6c1088[_0x52ca('0xac')])){return this['channel'][_0x52ca('0xa7')](_0x52ca('0xc6'));}var _0x4300b4=_0x6c1088['grammar'];if(this[_0x52ca('0x84')](_0x6c1088[_0x52ca('0xa9')])){_0x4300b4+=','+_0x6c1088[_0x52ca('0xa9')];}var _0x42fecb=this['channel'][_0x52ca('0x56')](_0x52ca('0xad'),_0x4300b4);if(_0x42fecb[_0x52ca('0xaa')]===-0x1){return _0x42fecb;}var _0x3f5815=this[_0x52ca('0xa0')](_0x52ca('0xae'),_0x52ca('0xc9'));if(_0x3f5815[_0x52ca('0xaa')]===-0x1){return _0x3f5815;}var _0xed8156=this[_0x52ca('0xa0')](_0x52ca('0xb0'),_0x52ca('0xca'));if(_0xed8156[_0x52ca('0xaa')]===-0x1){return _0xed8156;}var _0x1f8f17=this['getAndSetVariable'](_0x52ca('0xb1'),_0x52ca('0xcb'));if(_0x1f8f17['result']===-0x1){return _0x1f8f17;}return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0xb3'),_0x4300b4));};AGIVertices['prototype'][_0x52ca('0xcc')]=function(_0x217184){logger[_0x52ca('0x2d')](util['format'](_0x52ca('0xcd'),_0x217184[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x217184['odbc_id'])){return this['channel'][_0x52ca('0x2b')](_0x217184,_0x52ca('0xce'));}var _0x2a0f38=this[_0x52ca('0x16')][_0x52ca('0xa3')](this,_0x217184['odbc_id']);if(!_0x2a0f38){return this[_0x52ca('0xa')]['error'](_0x217184,'no\x20odbc\x20database\x20found');}if(!this[_0x52ca('0x84')](_0x217184['query'])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x217184,'no\x20query\x20configured');}var _0x393eed=_0x217184[_0x52ca('0x2f')][_0x52ca('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x52ca('0xa')]['noop'](util['format'](_0x52ca('0xcf'),_0x393eed));var _0x18de39=this[_0x52ca('0xd0')][_0x52ca('0xa3')](this,_0x2a0f38,_0x393eed);this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x217184,_0x393eed);if(!this[_0x52ca('0x84')](_0x217184['variable_id'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xd1'));}var _0x663b3c=this[_0x52ca('0xd')][_0x52ca('0xa3')](this,_0x217184['variable_id']);if(!_0x663b3c){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x217184,'no\x20variable\x20found');}var _0x4775df=this;_0x18de39['forEach'](function(_0x153f9e,_0x43658d){Object[_0x52ca('0xd2')](_0x153f9e)['forEach'](function(_0x416f1a){_0x4775df[_0x52ca('0xa')][_0x52ca('0x9c')](util['format'](_0x52ca('0xd3'),_0x663b3c,_0x43658d,_0x416f1a),_0x153f9e[_0x416f1a]);});});this[_0x52ca('0xa')][_0x52ca('0x9c')](util['format'](_0x52ca('0xd4'),_0x663b3c),_0x18de39['length']);return this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')](_0x52ca('0xd5'),_0x663b3c));};AGIVertices[_0x52ca('0xc')]['dial']=function(_0x3ff233){logger[_0x52ca('0xd6')](util[_0x52ca('0x29')](_0x52ca('0xd7'),_0x3ff233['label']));if(!this[_0x52ca('0x84')](_0x3ff233[_0x52ca('0xd8')])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x3ff233,_0x52ca('0xd9'));}var _0x19e565=this[_0x52ca('0x19')]['sync'](this,_0x3ff233[_0x52ca('0xd8')]);if(!_0x19e565){return this[_0x52ca('0xa')]['error'](_0x3ff233,_0x52ca('0xda'));}var _0x424bc9=this['channel'][_0x52ca('0x56')](_0x52ca('0xdb'),[util[_0x52ca('0x29')](_0x52ca('0xdc'),_0x19e565),_0x3ff233[_0x52ca('0x65')],_0x3ff233['opts'],_0x3ff233[_0x52ca('0x63')]]);if(_0x424bc9[_0x52ca('0xaa')]===-0x1){return _0x424bc9;}return this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x52d5ac){logger['info'](util['format'](_0x52ca('0xdd'),_0x52d5ac['label']));if(!this[_0x52ca('0x84')](_0x52d5ac['key'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xde'));}if(!this[_0x52ca('0x84')](_0x52d5ac[_0x52ca('0x5b')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xa8'));}this['channel'][_0x52ca('0xdf')]=!![];this[_0x52ca('0x35')](_0x52d5ac);this[_0x52ca('0x42')](_0x52d5ac[_0x52ca('0x5b')],'in','','');this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')](_0x52ca('0xe0'),_0x52d5ac[_0x52ca('0x5b')]));var _0x2acc7e=this[_0x52ca('0x77')][_0x52ca('0xa3')](this,_0x52d5ac);if(_0x2acc7e){for(var _0x1ad364 in _0x2acc7e){if(_0x2acc7e[_0x52ca('0x9a')](_0x1ad364)){this[_0x52ca('0xa')]['setVariable'](util[_0x52ca('0x29')]('DIALOGFLOW_%s',_0x1ad364['toUpperCase']()),_0x2acc7e[_0x1ad364]);}}this[_0x52ca('0x42')](_0x2acc7e[_0x52ca('0xe1')],_0x52ca('0xe2'),_0x52ca('0xe3'),'');return this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0xe4'),_0x2acc7e['speech']));}return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x52d5ac,_0x52ca('0xe5'));};AGIVertices['prototype'][_0x52ca('0xe6')]=function(_0x3db60d){logger[_0x52ca('0x2d')](util['format'](_0x52ca('0xe7'),_0x3db60d[_0x52ca('0x37')]));if(!this['isConfigured'](_0x3db60d[_0x52ca('0x7b')])){return this['channel'][_0x52ca('0xa7')]('no\x20project_id\x20configured');}if(!this[_0x52ca('0x84')](_0x3db60d['client_email'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xe8'));}if(!this[_0x52ca('0x84')](_0x3db60d[_0x52ca('0xe9')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xea'));}if(!this[_0x52ca('0x84')](_0x3db60d[_0x52ca('0x7d')])){return this['channel'][_0x52ca('0xa7')](_0x52ca('0xeb'));}if(!this[_0x52ca('0x84')](_0x3db60d['text'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xa8'));}this[_0x52ca('0xa')][_0x52ca('0xdf')]=!![];this['createSquareDetailsReport'](_0x3db60d);this[_0x52ca('0x42')](_0x3db60d[_0x52ca('0x5b')],'in','','');this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0xec'),_0x3db60d[_0x52ca('0x5b')]));var _0x5bad49=this[_0x52ca('0x7a')][_0x52ca('0xa3')](this,_0x3db60d);if(_0x5bad49){for(var _0xf02c4 in _0x5bad49){if(_0x5bad49[_0x52ca('0x9a')](_0xf02c4)){if(_0xf02c4!==_0x52ca('0xed')){this[_0x52ca('0xa')][_0x52ca('0x9c')](util[_0x52ca('0x29')]('DIALOGFLOW_%s',_0xf02c4[_0x52ca('0x6a')]()),_0x5bad49[_0xf02c4]);}}}this[_0x52ca('0x42')](_0x5bad49[_0x52ca('0xe1')],_0x52ca('0xe2'),_0x52ca('0xe6'),_0x5bad49[_0x52ca('0xed')]);return this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0xee'),_0x5bad49[_0x52ca('0xe1')]));}return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x3db60d,_0x52ca('0xef'));};AGIVertices['prototype'][_0x52ca('0xf0')]=function(_0xee2657){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0xf1'),_0xee2657['label']));if(!this['isConfigured'](_0xee2657[_0x52ca('0xf2')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xf3'));}if(!this['isConfigured'](_0xee2657['username'])){return this['channel'][_0x52ca('0xa7')]('no\x20username\x20configured');}if(!this['isConfigured'](_0xee2657[_0x52ca('0xf4')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xf5'));}if(!this[_0x52ca('0x84')](_0xee2657[_0x52ca('0xf6')])){return this['channel'][_0x52ca('0xa7')]('no\x20text\x20configured');}this[_0x52ca('0xa')]['bot']=!![];this['createSquareDetailsReport'](_0xee2657);this[_0x52ca('0x42')](_0xee2657[_0x52ca('0x5b')],'in','','');this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format']('Trying\x20SestekNDA:\x20%s',_0xee2657[_0x52ca('0x5b')]));var _0x11a004=this[_0x52ca('0x7e')][_0x52ca('0xa3')](this,_0xee2657);if(_0x11a004){for(var _0x1e33ec in _0x11a004){if(_0x11a004['hasOwnProperty'](_0x1e33ec)){this[_0x52ca('0xa')][_0x52ca('0x9c')](util['format'](_0x52ca('0xf7'),_0x1e33ec['toUpperCase']()),_0x11a004[_0x1e33ec]);}}this['createSquareMessage'](_0x11a004['speech'],_0x52ca('0xe2'),_0x52ca('0xf0'),'');if(_0x11a004['audiofile']){this['channel'][_0x52ca('0xa7')](util[_0x52ca('0x29')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x11a004[_0x52ca('0xf8')]));var _0x2bcd79=this[_0x52ca('0xa')][_0x52ca('0xf9')](_0x11a004[_0x52ca('0xf8')]);try{fs[_0x52ca('0xfa')](_0x11a004[_0x52ca('0xf8')]+_0x52ca('0xfb'));}catch(_0x37e202){logger[_0x52ca('0x2b')](_0x37e202);}return _0x2bcd79;}else{return this['channel']['noop'](util[_0x52ca('0x29')](_0x52ca('0xfc'),_0x11a004[_0x52ca('0xe1')]));}}return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0xee2657,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x52ca('0xc')][_0x52ca('0xfd')]=function(_0x281d90){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20END\x20(%s)\x20block',_0x281d90['label']));return this['channel'][_0x52ca('0xa7')](_0x52ca('0xfd'));};AGIVertices[_0x52ca('0xc')][_0x52ca('0xfe')]=function(_0x4f92e3){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0xff'),_0x4f92e3[_0x52ca('0x37')]));var _0x28f5ed='';if(_0x4f92e3[_0x52ca('0x100')]){if(!this[_0x52ca('0x84')](_0x4f92e3[_0x52ca('0x100')])){return this[_0x52ca('0xa')]['error'](_0x4f92e3,_0x52ca('0x101'));}else{var _0x299329=parseInt(_0x4f92e3[_0x52ca('0x100')],0xa);if(isNaN(_0x299329)){_0x28f5ed=_0x4f92e3[_0x52ca('0x100')];}else{_0x28f5ed=this['getTrunk'][_0x52ca('0xa3')](this,_0x4f92e3[_0x52ca('0x100')]);if(!_0x28f5ed){return this['channel'][_0x52ca('0x2b')](_0x4f92e3,'no\x20trunk\x20found');}}}}else if(_0x4f92e3[_0x52ca('0x102')]){_0x28f5ed=_0x4f92e3[_0x52ca('0x102')];}else{return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x4f92e3,_0x52ca('0x101'));}var _0x130aba=this['channel'][_0x52ca('0x56')](_0x52ca('0xdb'),[util[_0x52ca('0x29')]('SIP/%s/%s',_0x28f5ed,_0x4f92e3[_0x52ca('0xbe')]),_0x4f92e3[_0x52ca('0x65')],_0x4f92e3['opts'],_0x4f92e3[_0x52ca('0x63')]]);if(_0x130aba[_0x52ca('0xaa')]===-0x1){return _0x130aba;}return this['channel'][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x103'),_0x52ca('0xdb')));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x104')]=function(_0x40148e){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x40148e['label']));return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0x104'));};AGIVertices['prototype']['getdigits']=function(_0x55ae59){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x105'),_0x55ae59[_0x52ca('0x37')]));if(_0x55ae59[_0x52ca('0xa4')]===0x0){return this[_0x52ca('0xa2')](_0x55ae59);}_0x55ae59[_0x52ca('0xa4')]-=0x1;if(!this['isConfigured'](_0x55ae59[_0x52ca('0x106')])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x55ae59,'no\x20file\x20audio\x20selected');}var _0x19775f=this['getSound']['sync'](this,_0x55ae59[_0x52ca('0x106')]);if(!_0x19775f){return this['channel'][_0x52ca('0x2b')](_0x55ae59,_0x52ca('0x107'));}if(!this[_0x52ca('0x84')](_0x55ae59['variable_id'])){return this[_0x52ca('0xa')][_0x52ca('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x17838c=this[_0x52ca('0xa')]['getData'](_0x19775f,_0x55ae59['response'],_0x55ae59[_0x52ca('0x108')]);var _0x5b095f=_0x17838c[_0x52ca('0xaa')]?_0x17838c[_0x52ca('0xaa')][_0x52ca('0x4b')]():'';logger[_0x52ca('0x2d')]('test',JSON['stringify'](_0x17838c));if(_0x17838c['result']===-0x1){this[_0x52ca('0x35')]['sync'](this,_0x55ae59,_0x5b095f);return _0x17838c;}else if(_0x17838c[_0x52ca('0x9f')]==='timeout'){_0x17838c[_0x52ca('0xaa')]=_0x5b095f['length']>=parseInt(_0x55ae59[_0x52ca('0x109')])?'x':'i';}else{_0x17838c[_0x52ca('0xaa')]=_0x5b095f[_0x52ca('0x97')]>=parseInt(_0x55ae59[_0x52ca('0x109')])&&_0x5b095f['length']<=parseInt(_0x55ae59[_0x52ca('0x108')])?'x':'i';}var _0x3e5d9a=this[_0x52ca('0xd')]['sync'](this,_0x55ae59[_0x52ca('0x10a')]);if(!_0x3e5d9a){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x55ae59,_0x52ca('0x10b'));}this[_0x52ca('0xa')][_0x52ca('0x9c')](_0x3e5d9a,_0x5b095f);if(this[_0x52ca('0x84')](_0x55ae59[_0x52ca('0x10c')])){var _0x3eccdc=parseInt(_0x55ae59[_0x52ca('0x10c')],0xa);var _0x5bf1c9=rs[_0x52ca('0x10d')]({'charset':'*','length':_0x3eccdc});var _0x22c8d1=_0x5b095f['length'];if(_0x22c8d1>0x0){if(_0x22c8d1>_0x3eccdc){this[_0x52ca('0x35')]['sync'](this,_0x55ae59,_0x55ae59[_0x52ca('0x10e')]===_0x52ca('0x10f')?_0x5bf1c9+_0x5b095f[_0x52ca('0x110')](_0x3eccdc):_0x5b095f[_0x52ca('0x110')](0x0,_0x22c8d1-_0x3eccdc)+_0x5bf1c9);}else{this['createSquareDetailsReport']['sync'](this,_0x55ae59,rs[_0x52ca('0x10d')]({'charset':'*','length':_0x22c8d1}));}}else{this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x55ae59,'');}}else{this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x55ae59,_0x5b095f);}return _0x17838c;};AGIVertices[_0x52ca('0xc')][_0x52ca('0x9')]=function(_0x37fdd0){logger['info'](util[_0x52ca('0x29')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x37fdd0[_0x52ca('0x37')]));return this[_0x52ca('0x8')](_0x37fdd0);};AGIVertices[_0x52ca('0xc')][_0x52ca('0x111')]=function(_0x44c658){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x112'),_0x44c658['label']));this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x44c658,_0x44c658[_0x52ca('0x113')]);return this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')](_0x52ca('0x114'),_0x44c658[_0x52ca('0x113')]));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x115')]=function(_0xd88eb3){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0xd88eb3['label']));if(!this[_0x52ca('0x84')](_0xd88eb3[_0x52ca('0x87')])||!this['isConfigured'](_0xd88eb3['aws_secret_access_key'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0xd88eb3['text'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')]('no\x20text\x20configured');}this['channel'][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x116'),_0xd88eb3[_0x52ca('0x5b')]));var _0x28fd72=this[_0x52ca('0x86')][_0x52ca('0xa3')](this,_0xd88eb3);if(_0x28fd72){this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x117'),_0x28fd72));var _0x5c52a0=this[_0x52ca('0xa')][_0x52ca('0xf9')](_0x28fd72);try{fs['unlink'](_0x28fd72+_0x52ca('0xfb'));}catch(_0xd8ccca){logger[_0x52ca('0x2b')](_0xd8ccca);}return _0x5c52a0;}return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0xd88eb3,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x52ca('0xc')][_0x52ca('0x118')]=function(_0x5dd76e){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x119'),_0x5dd76e['label']));if(!this[_0x52ca('0x84')](_0x5dd76e[_0x52ca('0x87')])||!this['isConfigured'](_0x5dd76e[_0x52ca('0x88')])){return this[_0x52ca('0xa')]['noop'](_0x52ca('0x11a'));}if(!this[_0x52ca('0x84')](_0x5dd76e[_0x52ca('0x8c')])){return this[_0x52ca('0xa')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x52ca('0x84')](_0x5dd76e[_0x52ca('0x5b')])){return this[_0x52ca('0xa')]['noop'](_0x52ca('0xa8'));}this[_0x52ca('0xa')][_0x52ca('0xdf')]=!![];this['createSquareDetailsReport'](_0x5dd76e);this[_0x52ca('0x42')](_0x5dd76e[_0x52ca('0x5b')],'in','','');this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')](_0x52ca('0x11b'),_0x5dd76e['text']));var _0x3e97ac=this[_0x52ca('0x8b')]['sync'](this,_0x5dd76e);if(_0x3e97ac){for(var _0x1b5233 in _0x3e97ac){if(_0x3e97ac['hasOwnProperty'](_0x1b5233)&&_[_0x52ca('0x98')](_0x3e97ac[_0x1b5233])){this[_0x52ca('0xa')]['setVariable'](util[_0x52ca('0x29')]('AWS_LEX_%s',_0x1b5233[_0x52ca('0x6a')]()),_0x3e97ac[_0x1b5233]);}}if(_['isNil'](_0x3e97ac[_0x52ca('0x76')])){return this['channel'][_0x52ca('0xa7')](_0x52ca('0x11c'));}else{this[_0x52ca('0x42')](_0x3e97ac['message'],_0x52ca('0xe2'),_0x52ca('0x11d'),'');return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x11e'),_0x3e97ac[_0x52ca('0x76')]));}}return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x5dd76e,_0x52ca('0x11f'));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x120')]=function(_0x148243){logger[_0x52ca('0x2d')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x148243['label'],_0x148243['timeout']));if(!this[_0x52ca('0x84')](_0x148243[_0x52ca('0x78')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xde'));}var _0x2d066d=_0x52ca('0x121');var _0x5b3723=util[_0x52ca('0x29')](_0x52ca('0x122'),FILES_PATH,rs[_0x52ca('0x10d')](0x4));var _0x320dac=util[_0x52ca('0x29')]('%s.%s',_0x5b3723,_0x2d066d);var _0x13e177=!![];if(_0x148243[_0x52ca('0x123')]===_0x52ca('0x124')){_0x13e177=![];}var _0x4f2a1e=this[_0x52ca('0xa')][_0x52ca('0x125')](_0x5b3723,_0x2d066d,_0x148243[_0x52ca('0x126')],_0x148243[_0x52ca('0x65')],undefined,_0x13e177);if(_0x4f2a1e[_0x52ca('0xaa')]!==-0x1){this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0x127'),_0x320dac));var _0x3bc8dc=this[_0x52ca('0x8d')]['sync'](this,_0x148243,_0x320dac);if(_0x3bc8dc){for(var _0x39921c in _0x3bc8dc){if(_0x3bc8dc[_0x52ca('0x9a')](_0x39921c)){this[_0x52ca('0xa')][_0x52ca('0x9c')](util[_0x52ca('0x29')](_0x52ca('0x128'),_0x39921c['toUpperCase']()),_0x3bc8dc[_0x39921c]);}}return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x129'),JSON['stringify'](_0x3bc8dc)));}}return _0x4f2a1e;};AGIVertices[_0x52ca('0xc')][_0x52ca('0x12a')]=function(_0x1a6cd6){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x12b'),_0x1a6cd6[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x1a6cd6['appid'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0x12c'));}if(!this[_0x52ca('0x84')](_0x1a6cd6[_0x52ca('0x90')])){return this[_0x52ca('0xa')]['noop'](_0x52ca('0x12d'));}var _0x388880=_0x52ca('0x121');var _0x47f098=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x52ca('0x10d')](0x4));var _0x59b05f=util[_0x52ca('0x29')]('%s.%s',_0x47f098,_0x388880);var _0x29dbb1=!![];if(_0x1a6cd6[_0x52ca('0x123')]===_0x52ca('0x124')){_0x29dbb1=![];}var _0x25f756=this['channel'][_0x52ca('0x125')](_0x47f098,_0x388880,_0x1a6cd6[_0x52ca('0x126')],_0x1a6cd6[_0x52ca('0x65')],undefined,_0x29dbb1);if(_0x25f756['result']!==-0x1){this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x12e'),_0x59b05f));var _0x594101=this[_0x52ca('0x12f')][_0x52ca('0xa3')](this,_0x1a6cd6,_0x59b05f);if(_0x594101){for(var _0x4de5f5 in _0x594101){if(_0x594101['hasOwnProperty'](_0x4de5f5)){this[_0x52ca('0xa')]['setVariable'](util['format'](_0x52ca('0x130'),_0x4de5f5[_0x52ca('0x6a')]()),_0x594101[_0x4de5f5]);}}return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x131'),JSON[_0x52ca('0x72')](_0x594101)));}}return _0x25f756;};AGIVertices['prototype'][_0x52ca('0x132')]=function(_0x323df7){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x133'),_0x323df7[_0x52ca('0x37')]));return this[_0x52ca('0xa')]['continueAt'](_0x323df7[_0x52ca('0x3c')],_0x323df7['extension'],_0x323df7['priority']);};AGIVertices[_0x52ca('0xc')]['gotoif']=function(_0x1fcfc6){logger['info'](util[_0x52ca('0x29')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x1fcfc6[_0x52ca('0x37')]));if(!this['isConfigured'](_0x1fcfc6['condition'])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x1fcfc6,'no\x20condition\x20configured');}try{var _0x7ca504=eval(_0x1fcfc6['condition'])?_0x52ca('0x134'):_0x52ca('0x135');this['channel']['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x1fcfc6[_0x52ca('0x136')],_0x7ca504));return{'code':0xc8,'result':_0x7ca504};}catch(_0x21004c){return{'code':0xc8,'result':_0x52ca('0x135')};}};AGIVertices['prototype']['gotoiftime']=function(_0x230d52){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x230d52[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x230d52[_0x52ca('0x137')])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x230d52,_0x52ca('0x138'));}var _0x2dc2b9=this[_0x52ca('0x23')]['sync'](this,_0x230d52[_0x52ca('0x137')]);if(!_0x2dc2b9){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x230d52,_0x52ca('0x139'));}for(var _0x51ec26=0x0;_0x51ec26<_0x2dc2b9[_0x52ca('0x97')];_0x51ec26+=0x1){var _0x2b10f1=this['channel'][_0x52ca('0xd')](util[_0x52ca('0x29')]('IFTIME(%s?true:false)',_0x2dc2b9[_0x51ec26]));if(_0x2b10f1['result']===-0x1){return _0x2b10f1;}logger[_0x52ca('0x2d')](util['format'](_0x52ca('0x13a'),_0x2dc2b9[_0x51ec26],_0x2b10f1['extra']));if(_0x2b10f1[_0x52ca('0x9f')]===_0x52ca('0x134')){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x13a'),_0x2dc2b9[_0x51ec26],_0x52ca('0x134')));this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')]('IFTIME\x20%s\x20%s',_0x2dc2b9[_0x51ec26],'true'));return{'code':0xc8,'result':_0x52ca('0x134')};}else{logger['info'](util[_0x52ca('0x29')]('IFTIME\x20%s\x20%s',_0x2dc2b9[_0x51ec26],'false'));this['channel']['noop'](util[_0x52ca('0x29')](_0x52ca('0x13a'),_0x2dc2b9[_0x51ec26],_0x52ca('0x135')));}}return{'code':0xc8,'result':_0x52ca('0x135')};};AGIVertices[_0x52ca('0xc')][_0x52ca('0x13b')]=function(_0x2beddd){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x13c'),_0x2beddd[_0x52ca('0x37')]));return this[_0x52ca('0xa')]['hangup']();};AGIVertices[_0x52ca('0xc')][_0x52ca('0x13d')]=function(_0x23c20b){logger[_0x52ca('0x2d')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x23c20b[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x23c20b['key'])){return this[_0x52ca('0xa')]['noop']('no\x20key\x20configured');}var _0x408077=_0x52ca('0x121');var _0x10031b=util[_0x52ca('0x29')](_0x52ca('0x122'),FILES_PATH,rs[_0x52ca('0x10d')](0x4));var _0x2c20c2=util['format'](_0x52ca('0x9b'),_0x10031b,_0x408077);var _0x23fcf7=!![];if(_0x23c20b['beep']===_0x52ca('0x124')){_0x23fcf7=![];}var _0x359fd7=this[_0x52ca('0xa')][_0x52ca('0x125')](_0x10031b,_0x408077,_0x23c20b['intKey'],_0x23c20b[_0x52ca('0x65')],undefined,_0x23fcf7);if(_0x359fd7[_0x52ca('0xaa')]!==-0x1){this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x13e'),_0x2c20c2));var _0x1c3274=this[_0x52ca('0x82')]['sync'](this,_0x23c20b,_0x2c20c2);if(_0x1c3274){for(var _0x5292f4 in _0x1c3274){if(_0x1c3274[_0x52ca('0x9a')](_0x5292f4)){this[_0x52ca('0xa')]['setVariable'](util[_0x52ca('0x29')](_0x52ca('0x13f'),_0x5292f4[_0x52ca('0x6a')]()),_0x1c3274[_0x5292f4]);}}return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x140'),JSON[_0x52ca('0x72')](_0x1c3274)));}}return _0x359fd7;};AGIVertices[_0x52ca('0xc')][_0x52ca('0x141')]=function(_0x78c1f2){logger['info'](util[_0x52ca('0x29')](_0x52ca('0x142'),_0x78c1f2['label']));if(!this[_0x52ca('0x84')](_0x78c1f2['key'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')]('no\x20key\x20configured');}if(!this[_0x52ca('0x84')](_0x78c1f2[_0x52ca('0x5b')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xa8'));}this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0x143'),_0x78c1f2[_0x52ca('0x5b')]));var _0x55d365=this[_0x52ca('0x7f')]['sync'](this,_0x78c1f2);if(_0x55d365){this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x13e'),_0x55d365));var _0x83b375=this[_0x52ca('0xa')][_0x52ca('0xf9')](_0x55d365,_0x78c1f2[_0x52ca('0x126')]);try{fs[_0x52ca('0xfa')](_0x55d365+_0x52ca('0xfb'));}catch(_0x5f4706){logger[_0x52ca('0x2b')](_0x5f4706);}return _0x83b375;}return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x78c1f2,_0x52ca('0x144'));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x145')]=function(_0x2c0eae){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x2c0eae[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x2c0eae[_0x52ca('0x146')])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x2c0eae,'no\x20find\x20by\x20configured');}logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x52ca('0xa')]['callerid'],_0x2c0eae[_0x52ca('0x146')]));var _0x54dd89=this[_0x52ca('0x53')][_0x52ca('0xa3')](this,_0x2c0eae['findBy']);if(_0x54dd89){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x147'),this[_0x52ca('0xa')][_0x52ca('0x51')],_0x2c0eae[_0x52ca('0x146')]));this['channel'][_0x52ca('0xa7')](util[_0x52ca('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x52ca('0xa')]['callerid'],_0x2c0eae[_0x52ca('0x146')]));return{'code':0xc8,'result':'success'};}else{logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x148'),this['channel'][_0x52ca('0x51')],_0x2c0eae[_0x52ca('0x146')]));this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x148'),this['channel'][_0x52ca('0x51')],_0x2c0eae[_0x52ca('0x146')]));return{'code':0xc8,'result':_0x52ca('0x149')};}};AGIVertices[_0x52ca('0xc')][_0x52ca('0x14a')]=function(_0x166b6a){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x14b'),_0x166b6a[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x166b6a[_0x52ca('0x146')])){return this['channel']['error'](_0x166b6a,_0x52ca('0x14c'));}logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x52ca('0xa')]['callerid'],_0x166b6a['findBy']));var _0x51d2e9=this[_0x52ca('0x52')][_0x52ca('0xa3')](this,_0x166b6a[_0x52ca('0x146')]);if(_0x51d2e9){logger[_0x52ca('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x52ca('0xa')][_0x52ca('0x51')],_0x166b6a[_0x52ca('0x146')]));this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x147'),this[_0x52ca('0xa')][_0x52ca('0x51')],_0x166b6a[_0x52ca('0x146')]));return{'code':0xc8,'result':_0x52ca('0x14d')};}else{logger['info'](util[_0x52ca('0x29')](_0x52ca('0x148'),this[_0x52ca('0xa')][_0x52ca('0x51')],_0x166b6a['findBy']));this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')](_0x52ca('0x148'),this['channel'][_0x52ca('0x51')],_0x166b6a[_0x52ca('0x146')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x52ca('0x14e')]=function(_0x12535a){logger['info'](util[_0x52ca('0x29')](_0x52ca('0x14f'),_0x12535a['label']));if(!this['isConfigured'](_0x12535a['operation'])){return this['channel']['error'](_0x12535a,_0x52ca('0x150'));}this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x151'),_0x12535a[_0x52ca('0x152')]));var _0xcd1385=eval(_0x12535a['operation']);if(!this[_0x52ca('0x84')](_0x12535a['variable_id'])){return this['channel'][_0x52ca('0xa7')](_0x52ca('0xd1'));}var _0x18c631=this[_0x52ca('0xd')]['sync'](this,_0x12535a[_0x52ca('0x10a')]);if(!_0x18c631){return this['channel'][_0x52ca('0x2b')](_0x12535a,_0x52ca('0x10b'));}if(_['isArray'](_0xcd1385)){var _0x5b0a1e=this;_0xcd1385['forEach'](function(_0x5b309e,_0x535888){_0x5b0a1e['channel'][_0x52ca('0x9c')](util[_0x52ca('0x29')]('%s[%s]',_0x18c631,_0x535888),_0x5b309e);});return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')]('variable\x20%s[key]\x20set',_0x18c631));}else{return this[_0x52ca('0xa')][_0x52ca('0x9c')](_0x18c631,_0xcd1385);}};AGIVertices['prototype']['menu']=function(_0x998b11){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x153'),_0x998b11['label']));if(_0x998b11[_0x52ca('0xa4')]===0x0){return this['maxRetry'](_0x998b11);}_0x998b11[_0x52ca('0xa4')]-=0x1;if(!this['isConfigured'](_0x998b11[_0x52ca('0x106')])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x998b11,_0x52ca('0x154'));}var _0x279368=this[_0x52ca('0x1c')]['sync'](this,_0x998b11[_0x52ca('0x106')]);if(!_0x279368){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x998b11,'no\x20file\x20audio\x20found');}var _0x212885=this[_0x52ca('0xa')][_0x52ca('0x155')](_0x279368,_0x998b11[_0x52ca('0x156')],_0x998b11[_0x52ca('0x157')]);var _0xdd76d=_0x212885[_0x52ca('0xaa')];if(_0x212885[_0x52ca('0xaa')]===-0x1){this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x998b11,'-1');return _0x212885;}else if(_0x212885[_0x52ca('0x9f')]==='timeout'){_0x212885[_0x52ca('0xaa')]=_0x212885[_0x52ca('0xaa')]['length']>0x0?_0x212885[_0x52ca('0xaa')]:'t';}else if(_[_0x52ca('0x46')](_0x212885[_0x52ca('0xaa')])){_0x212885[_0x52ca('0xaa')]='#';_0xdd76d='#';}if(!this[_0x52ca('0x84')](_0x998b11[_0x52ca('0x10a')])){this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xd1'));}else{var _0xbb9e08=this[_0x52ca('0xd')][_0x52ca('0xa3')](this,_0x998b11[_0x52ca('0x10a')]);if(!_0xbb9e08){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x998b11,_0x52ca('0x10b'));}this[_0x52ca('0xa')][_0x52ca('0x9c')](_0xbb9e08,_0xdd76d);}this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x998b11,_0xdd76d);return _0x212885;};AGIVertices[_0x52ca('0xc')][_0x52ca('0xa7')]=function(_0x52176c){logger['info'](util[_0x52ca('0x29')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x52176c[_0x52ca('0x37')]));return this[_0x52ca('0xa')]['noop'](_0x52176c[_0x52ca('0x158')]||_0x52176c[_0x52ca('0x37')]);};AGIVertices[_0x52ca('0xc')]['pause']=function(_0x492684){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x159'),_0x492684[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x492684[_0x52ca('0x146')])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x492684,_0x52ca('0x14c'));}logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x15a'),this[_0x52ca('0xa')][_0x52ca('0x51')],_0x492684[_0x52ca('0x146')]));var _0x1c48ae=this[_0x52ca('0x4c')][_0x52ca('0xa3')](this,_0x492684['pause_id']);var _0x4e0e7c=this['agentPause']['sync'](this,_0x492684[_0x52ca('0x146')],_0x1c48ae);if(_0x4e0e7c){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x147'),this[_0x52ca('0xa')]['callerid'],_0x492684['findBy']));this['channel'][_0x52ca('0xa7')](util['format'](_0x52ca('0x147'),this[_0x52ca('0xa')][_0x52ca('0x51')],_0x492684[_0x52ca('0x146')]));return{'code':0xc8,'result':_0x52ca('0x14d')};}else{logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x148'),this[_0x52ca('0xa')][_0x52ca('0x51')],_0x492684[_0x52ca('0x146')]));this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x52ca('0xa')][_0x52ca('0x51')],_0x492684['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x52ca('0xc')][_0x52ca('0x15b')]=function(_0x4fc28c){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x15c'),_0x4fc28c[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x4fc28c[_0x52ca('0x106')])){return this['channel'][_0x52ca('0x2b')](_0x4fc28c,'no\x20file\x20audio\x20selected');}var _0x2e97e1=this[_0x52ca('0x1c')][_0x52ca('0xa3')](this,_0x4fc28c[_0x52ca('0x106')]);if(!_0x2e97e1){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x4fc28c,_0x52ca('0x107'));}var _0x2ca074=this[_0x52ca('0xa')][_0x52ca('0x56')](_0x52ca('0x15d'),[_0x2e97e1,_0x4fc28c[_0x52ca('0x15e')]]);if(_0x2ca074['result']===-0x1){return _0x2ca074;}return this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')]('Executed\x20command\x20%s\x20%s',_0x52ca('0x15d'),_0x2e97e1));};AGIVertices['prototype'][_0x52ca('0x15f')]=function(_0x4befba){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4befba[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x4befba[_0x52ca('0x160')])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x4befba,_0x52ca('0x161'));}var _0x1700f4='';var _0x5c5039=parseInt(_0x4befba['queue_id'],0xa);if(isNaN(_0x5c5039)){_0x1700f4=_0x4befba[_0x52ca('0x160')];}else{_0x1700f4=this[_0x52ca('0x11')][_0x52ca('0xa3')](this,_0x4befba['queue_id']);if(!_0x1700f4){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x4befba,_0x52ca('0x162'));}}var _0x1f756d='';if(this[_0x52ca('0x84')](_0x4befba[_0x52ca('0x106')])){var _0x5200c8=this[_0x52ca('0x1c')][_0x52ca('0xa3')](this,_0x4befba['file_id']);if(_0x5200c8){_0x1f756d=_0x5200c8;}}this[_0x52ca('0x35')]['sync'](this,_0x4befba,_0x1700f4);if(_0x4befba['opts'][_0x52ca('0x163')]('x')<0x0){_0x4befba[_0x52ca('0x15e')]+='x';}if(_0x4befba[_0x52ca('0x15e')]['indexOf']('X')<0x0){_0x4befba[_0x52ca('0x15e')]+='X';}this[_0x52ca('0xa')]['setVariable'](_0x52ca('0x164'),_0x1700f4?_0x1700f4['toLowerCase']():'');var _0x7370d8=this[_0x52ca('0xa')][_0x52ca('0x56')](_0x52ca('0x165'),[_0x1700f4,_0x4befba[_0x52ca('0x15e')],_0x4befba[_0x52ca('0x63')],_0x1f756d,_0x4befba['timeout'],_0x4befba[_0x52ca('0x5')],_0x4befba[_0x52ca('0x166')],_0x4befba[_0x52ca('0x167')],'',_0x4befba[_0x52ca('0x168')]]);if(_0x7370d8[_0x52ca('0xaa')]===-0x1){return _0x7370d8;}return this['channel'][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x169'),'QUEUE',_0x1700f4));};AGIVertices[_0x52ca('0xc')]['record']=function(_0x439518){logger['info'](util[_0x52ca('0x29')](_0x52ca('0x16a'),_0x439518['label']));var _0x3e4183=_0x439518[_0x52ca('0x16b')]||_0x52ca('0x121');var _0x3883fe=util[_0x52ca('0x29')](_0x52ca('0x16c'),this[_0x52ca('0xa')][_0x52ca('0x36')],rs[_0x52ca('0x10d')](0x5));var _0x382f30=util['format'](_0x52ca('0x16d'),FILES_PATH,_0x3883fe,_0x3e4183);var _0x2faf4=util[_0x52ca('0x29')](_0x52ca('0x122'),FILES_PATH,_0x3883fe);this['createSquareRecording'][_0x52ca('0xa3')](this,_0x439518,_0x3883fe,_0x382f30);this[_0x52ca('0xa')][_0x52ca('0x9c')](_0x52ca('0x16e'),_0x3883fe);logger[_0x52ca('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x2faf4,_0x3e4183,_0x439518[_0x52ca('0x16f')],_0x439518[_0x52ca('0x65')]);return this[_0x52ca('0xa')][_0x52ca('0x125')](_0x2faf4,_0x3e4183,_0x439518['escape_digits'],_0x439518['timeout'],undefined,!![]);};AGIVertices[_0x52ca('0xc')][_0x52ca('0x170')]=function(_0x14a060){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x171'),_0x14a060['label']));if(!this[_0x52ca('0x84')](_0x14a060[_0x52ca('0x63')])){return this['channel'][_0x52ca('0xa7')](_0x52ca('0x172'));}var _0xd80aca=this['restAPI'][_0x52ca('0xa3')](this,_0x14a060);logger['info'](util['format'](_0x52ca('0x173'),util[_0x52ca('0x174')](_0xd80aca,{'showHidden':![],'depth':null})));if(!this[_0x52ca('0x84')](_0x14a060['variable_id'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x477743=this[_0x52ca('0xd')][_0x52ca('0xa3')](this,_0x14a060[_0x52ca('0x10a')]);if(!_0x477743){return this['channel']['error'](_0x14a060,_0x52ca('0x10b'));}this[_0x52ca('0xa')][_0x52ca('0x9c')](util[_0x52ca('0x29')](_0x52ca('0x175'),_0x477743),_0xd80aca[_0x52ca('0x74')]?_0xd80aca[_0x52ca('0x74')]:_0x52ca('0x176'));this[_0x52ca('0xa')]['setVariable'](util[_0x52ca('0x29')](_0x52ca('0x177'),_0x477743),_0xd80aca[_0x52ca('0x75')]?_0xd80aca[_0x52ca('0x75')]:'OK');if(_0xd80aca[_0x52ca('0x6b')]){try{this[_0x52ca('0x99')](_0xd80aca[_0x52ca('0x6b')],_0x477743);}catch(_0x17458b){logger[_0x52ca('0x2b')](util[_0x52ca('0x29')](_0x52ca('0x178'),_0x477743));}}return this['channel'][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0xd5'),_0x477743));};AGIVertices[_0x52ca('0xc')]['saydigits']=function(_0x482e34){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x179'),_0x482e34[_0x52ca('0x37')]));return this[_0x52ca('0xa')][_0x52ca('0x17a')](_0x482e34[_0x52ca('0x17b')]['replace'](/\s+/g,''),_0x482e34[_0x52ca('0x16f')]);};AGIVertices[_0x52ca('0xc')][_0x52ca('0x17c')]=function(_0x16e4ec){logger['info'](util['format'](_0x52ca('0x17d'),_0x16e4ec['label']));return this[_0x52ca('0xa')][_0x52ca('0x17e')](_0x16e4ec[_0x52ca('0x66')][_0x52ca('0x58')](/\s+/g,''),_0x16e4ec[_0x52ca('0x16f')]);};AGIVertices[_0x52ca('0xc')][_0x52ca('0x17f')]=function(_0x449180){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x180'),_0x449180[_0x52ca('0x37')]));return this[_0x52ca('0xa')][_0x52ca('0x181')](_0x449180['text'],_0x449180[_0x52ca('0x16f')]);};AGIVertices[_0x52ca('0xc')][_0x52ca('0x182')]=function(_0x356d39){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x183'),_0x356d39['label']));if(!this[_0x52ca('0x84')](_0x356d39['account_id'])){return this['channel'][_0x52ca('0xa7')](_0x52ca('0x184'));}var _0x79e37=this[_0x52ca('0x1f')][_0x52ca('0xa3')](this,_0x356d39['account_id']);if(!_0x79e37||!_0x79e37[_0x52ca('0x185')]){return this[_0x52ca('0xa')]['error'](_0x356d39,'no\x20mail\x20account\x20found');}var _0x9f940={'from':util['format'](_0x52ca('0x186'),_0x79e37[_0x52ca('0x15')],_0x79e37[_0x52ca('0x187')]||_0x79e37[_0x52ca('0x185')][_0x52ca('0x188')]),'to':_0x356d39['to']||'','cc':_0x356d39['cc']||'','bcc':_0x356d39[_0x52ca('0x189')]||'','subject':_0x356d39['subject'],'html':_0x356d39['text'],'text':_0x356d39[_0x52ca('0x5b')]};if(this[_0x52ca('0x84')](_0x356d39[_0x52ca('0x18a')])){}logger[_0x52ca('0xd6')](_0x52ca('0x18b'),JSON[_0x52ca('0x72')](_0x9f940));this['createSquareDetailsReport']['sync'](this,_0x356d39,_0x356d39['account_id']);this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x18c'),_0x79e37[_0x52ca('0x15')]));this[_0x52ca('0x21')]['sync'](this,_0x79e37[_0x52ca('0x18d')],_0x9f940);return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0x18e'));};AGIVertices[_0x52ca('0xc')]['sendFax']=function(_0x36edd4){logger['info'](util[_0x52ca('0x29')](_0x52ca('0x18f'),_0x36edd4[_0x52ca('0x37')]));return this[_0x52ca('0xa')][_0x52ca('0xa7')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x52ca('0xc')][_0x52ca('0x190')]=function(_0x373d1b){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x191'),_0x373d1b['label']));if(!this[_0x52ca('0x84')](_0x373d1b[_0x52ca('0x192')])){return this[_0x52ca('0xa')][_0x52ca('0xa7')]('no\x20sms\x20account\x20configured');}var _0x27bc6d=this[_0x52ca('0x33')][_0x52ca('0xa3')](this,_0x373d1b[_0x52ca('0x192')]);if(!_0x27bc6d){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x373d1b,_0x52ca('0x193'));}var _0x4ce260={'body':_0x373d1b[_0x52ca('0x194')],'phone':_0x373d1b['to']||'','SmsAccountId':_0x27bc6d['id']};logger[_0x52ca('0xd6')]('sendSMS\x20message',JSON[_0x52ca('0x72')](_0x4ce260));this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x373d1b,_0x373d1b[_0x52ca('0x192')]);this['channel'][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x195'),_0x27bc6d[_0x52ca('0x15')]));this[_0x52ca('0x34')][_0x52ca('0xa3')](this,_0x4ce260);return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0x196'));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x197')]=function(_0x22c33b){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x198'),_0x22c33b[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x22c33b[_0x52ca('0x10a')])){return this[_0x52ca('0xa')]['error'](_0x22c33b,_0x52ca('0x199'));}var _0x6ac8e4=this['getVariable'][_0x52ca('0xa3')](this,_0x22c33b['variable_id']);if(!_0x6ac8e4){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x22c33b,_0x52ca('0x10b'));}return this[_0x52ca('0xa')][_0x52ca('0x9c')](_0x6ac8e4,_0x22c33b[_0x52ca('0x19a')]);};AGIVertices[_0x52ca('0xc')][_0x52ca('0x19b')]=function(_0x349898){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x19c'),_0x349898[_0x52ca('0x37')]));this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0x19d'));if(_0x349898[_0x52ca('0xb5')]==='yes'){this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0x19e'));return this[_0x52ca('0xa')][_0x52ca('0xb5')]();}return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0x19f'));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x1a0')]=function(_0x50bc52){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x1a1'),_0x50bc52[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x50bc52[_0x52ca('0x1a2')])){return this[_0x52ca('0xa')]['error'](_0x50bc52,'no\x20subproject\x20selected');}var _0x102233=this[_0x52ca('0x13')][_0x52ca('0xa3')](this,_0x50bc52[_0x52ca('0x1a2')]);if(!this[_0x52ca('0x84')](_0x102233)){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x50bc52,util[_0x52ca('0x29')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x50bc52[_0x52ca('0x1a2')]));}if(_0x102233===this[_0x52ca('0xa')][_0x52ca('0x39')]){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x50bc52,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x50bc52,_0x102233);var _0x25af27=this[_0x52ca('0xa')][_0x52ca('0x56')](_0x52ca('0x1a3'),util[_0x52ca('0x29')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x52ca('0x5')]['host']||_0x52ca('0x1a4'),_0x102233,this[_0x52ca('0xa')][_0x52ca('0x39')]));if(_0x25af27['result']===-0x1){return _0x25af27;}return this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0x169'),_0x52ca('0x1a3'),_0x102233));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x1a5')]=function(_0x1a8c4a){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x1a6'),_0x1a8c4a[_0x52ca('0x37')]));var _0x55af06=this[_0x52ca('0x1a7')]['sync'](this,_0x1a8c4a[_0x52ca('0x1a8')]);this[_0x52ca('0x35')][_0x52ca('0xa3')](this,_0x1a8c4a,_0x1a8c4a[_0x52ca('0x1a8')]);if(this['isConfigured'](_0x1a8c4a[_0x52ca('0x10a')])){var _0x50f669=this['getVariable'][_0x52ca('0xa3')](this,_0x1a8c4a[_0x52ca('0x10a')]);if(_0x50f669){this[_0x52ca('0xa')][_0x52ca('0x9c')](_0x50f669,_0x55af06);return this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x1a9'),_0x1a8c4a[_0x52ca('0x1a8')],_0x50f669));}}return this['channel']['noop'](util[_0x52ca('0x29')](_0x52ca('0x1aa'),_0x1a8c4a[_0x52ca('0x1a8')]));};AGIVertices[_0x52ca('0xc')]['google_cloud_tts']=function(_0x3de14d){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x1ab'),_0x3de14d[_0x52ca('0x37')]));_0x3de14d[_0x52ca('0x5b')]=_0x3de14d[_0x52ca('0x5b')][_0x52ca('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x52ca('0x84')](_0x3de14d['apiKey'])){return this[_0x52ca('0xa')]['noop'](_0x52ca('0x1ac'));}if(!this[_0x52ca('0x84')](_0x3de14d['text'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xa8'));}this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0x1ad'),_0x3de14d[_0x52ca('0x5b')]));var _0x307f5e=this[_0x52ca('0x59')][_0x52ca('0xa3')](this,_0x3de14d);if(_0x307f5e){this[_0x52ca('0xa')][_0x52ca('0xa7')](util['format'](_0x52ca('0x1ae'),_0x307f5e));var _0xbed386=this[_0x52ca('0xa')][_0x52ca('0xf9')](_0x307f5e);try{fs[_0x52ca('0xfa')](_0x307f5e+_0x52ca('0xfb'));}catch(_0x40d3ee){logger['error'](_0x40d3ee);}return _0xbed386;}return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x3de14d,_0x52ca('0x1af'));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x1b0')]=function(_0x2b7972){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x1b1'),_0x2b7972['label']));_0x2b7972[_0x52ca('0x5b')]=_0x2b7972['text'][_0x52ca('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2b7972['text'])){return this[_0x52ca('0xa')][_0x52ca('0xa7')](_0x52ca('0xa8'));}this[_0x52ca('0xa')][_0x52ca('0xa7')](util[_0x52ca('0x29')](_0x52ca('0x1b2'),_0x2b7972['text']));var _0x54c97d=this['googleTTS'][_0x52ca('0xa3')](this,_0x2b7972);if(_0x54c97d){this[_0x52ca('0xa')]['noop'](util['format'](_0x52ca('0x1b3'),_0x54c97d));var _0x34e957=this[_0x52ca('0xa')]['streamFile'](_0x54c97d);try{fs[_0x52ca('0xfa')](_0x54c97d+_0x52ca('0xfb'));}catch(_0x465ad5){logger[_0x52ca('0x2b')](_0x465ad5);}return _0x34e957;}return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x2b7972,_0x52ca('0x1b4'));};AGIVertices[_0x52ca('0xc')]['unpause']=function(_0x5812cd){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')](_0x52ca('0x1b5'),_0x5812cd[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x5812cd[_0x52ca('0x146')])){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x5812cd,'no\x20find\x20by\x20configured');}logger[_0x52ca('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x52ca('0xa')][_0x52ca('0x51')],_0x5812cd[_0x52ca('0x146')]));var _0x2cbc3f=this[_0x52ca('0x50')]['sync'](this,_0x5812cd[_0x52ca('0x146')]);if(_0x2cbc3f){logger['info'](util[_0x52ca('0x29')](_0x52ca('0x147'),this[_0x52ca('0xa')][_0x52ca('0x51')],_0x5812cd['findBy']));this['channel'][_0x52ca('0xa7')](util['format'](_0x52ca('0x147'),this[_0x52ca('0xa')]['callerid'],_0x5812cd[_0x52ca('0x146')]));return{'code':0xc8,'result':_0x52ca('0x14d')};}else{logger[_0x52ca('0x2d')](util['format'](_0x52ca('0x148'),this[_0x52ca('0xa')][_0x52ca('0x51')],_0x5812cd[_0x52ca('0x146')]));this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')](_0x52ca('0x148'),this['channel'][_0x52ca('0x51')],_0x5812cd[_0x52ca('0x146')]));return{'code':0xc8,'result':_0x52ca('0x149')};}};AGIVertices['prototype']['voicemail']=function(_0x5dffbd){logger[_0x52ca('0x2d')](util[_0x52ca('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x5dffbd['label']));var _0x2bf52d=this[_0x52ca('0xa')][_0x52ca('0x56')](_0x52ca('0x1b6'),[_0x5dffbd[_0x52ca('0x1b7')],_0x5dffbd[_0x52ca('0xa9')]]);if(_0x2bf52d['result']===-0x1){return _0x2bf52d;}return this[_0x52ca('0xa')]['noop'](util[_0x52ca('0x29')](_0x52ca('0x169'),'VOICEMAIL',_0x5dffbd[_0x52ca('0x1b7')]));};AGIVertices[_0x52ca('0xc')][_0x52ca('0x1b8')]=function(_0x2d9fda){logger[_0x52ca('0x2d')](util['format'](_0x52ca('0x1b9'),_0x2d9fda[_0x52ca('0x37')]));if(!this[_0x52ca('0x84')](_0x2d9fda[_0x52ca('0x10a')])){return this[_0x52ca('0xa')]['error'](_0x2d9fda,'no\x20variable\x20selected');}var _0x5bf6b6=this[_0x52ca('0xd')][_0x52ca('0xa3')](this,_0x2d9fda['variable_id']);if(!_0x5bf6b6){return this[_0x52ca('0xa')][_0x52ca('0x2b')](_0x2d9fda,'no\x20variable\x20found');}var _0x2900f8=this[_0x52ca('0xa')][_0x52ca('0xd')](_0x5bf6b6);return{'code':0xc8,'result':_0x2900f8[_0x52ca('0x9f')]?_0x2900f8[_0x52ca('0x9f')]:'-'};};String[_0x52ca('0xc')][_0x52ca('0x9e')]=function(_0x598f59,_0xbb562c){return this[_0x52ca('0x9d')](_0x598f59)['join'](_0xbb562c);};module[_0x52ca('0x1ba')]=AGIVertices;
\ No newline at end of file
index d0f1f24..7221d9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1678=['attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','saveUnpause','stringify','[ACW][STOP]\x20%s','acw','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer'];(function(_0x596ba8,_0x358056){var _0x352766=function(_0x49bd24){while(--_0x49bd24){_0x596ba8['push'](_0x596ba8['shift']());}};_0x352766(++_0x358056);}(_0x1678,0x14d));var _0x8167=function(_0x16ba81,_0x425d62){_0x16ba81=_0x16ba81-0x0;var _0x1e7019=_0x1678[_0x16ba81];return _0x1e7019;};'use strict';var util=require('util');var _=require(_0x8167('0x0'));var moment=require(_0x8167('0x1'));var ami=require(_0x8167('0x2'));var logger=require(_0x8167('0x3'))('acw');var RpcUser=require(_0x8167('0x4'));var RpcVoiceAgentReport=require(_0x8167('0x5'));function Acw(_0x3ecd0c){this[_0x8167('0x6')]=_0x3ecd0c['voiceQueues'];this['agents']=_0x3ecd0c[_0x8167('0x7')];this[_0x8167('0x8')]=_0x3ecd0c[_0x8167('0x8')];this[_0x8167('0x9')]={};ami['on'](_0x8167('0xa'),this[_0x8167('0xb')][_0x8167('0xc')](this));ami['on'](_0x8167('0xd'),this[_0x8167('0xe')]['bind'](this));ami['on'](_0x8167('0xf'),this[_0x8167('0x10')][_0x8167('0xc')](this));ami['on'](_0x8167('0x11'),this[_0x8167('0x12')][_0x8167('0xc')](this));ami['on'](_0x8167('0x13'),this[_0x8167('0x14')]['bind'](this));ami['on'](_0x8167('0x15'),this[_0x8167('0x16')][_0x8167('0xc')](this));ami['on'](_0x8167('0x17'),this[_0x8167('0x18')][_0x8167('0xc')](this));}function getDiff(_0x900fc9){var _0x1079e5=moment()[_0x8167('0x19')](0x0);var _0x40eddf=moment(_0x900fc9)[_0x8167('0x19')](0x0);return _0x1079e5['diff'](_0x40eddf,_0x8167('0x1a'));}Acw[_0x8167('0x1b')][_0x8167('0x1c')]=function(_0x35f30f){try{var _0x51d518=this;var _0x2b3306=this[_0x8167('0x9')][_0x35f30f][_0x8167('0x1d')];var _0x4f5580=this[_0x8167('0x9')][_0x35f30f]['queue'];var _0x2d5f98=this[_0x8167('0x6')][_0x4f5580];var _0xd483ec=![];var _0x199a14=_0x8167('0x1e');if(_0x2d5f98['mandatoryDisposition']){if(_0x2d5f98[_0x8167('0x1f')]['name']){_0xd483ec=!![];_0x199a14=_0x2d5f98['mandatoryDispositionPause'][_0x8167('0x20')];}}ami[_0x8167('0x21')]({'action':_0x8167('0x22'),'interface':_0x2b3306,'paused':!![],'reason':_0x199a14})[_0x8167('0x23')](function(_0x59fff8){if(_0x51d518['agents'][_0x2b3306]){return RpcUser[_0x8167('0x24')](_0x51d518[_0x8167('0x7')][_0x2b3306]['id'])[_0x8167('0x23')](function(_0x281e1b){if(_0x281e1b&&!_0x281e1b['voicePause']){logger[_0x8167('0x25')](_0x8167('0x26'),_0x35f30f,_0x2b3306,_0x4f5580);var _0x29dad6=_0x51d518[_0x8167('0x9')][_0x35f30f][_0x8167('0x27')]&&_0x51d518[_0x8167('0x9')][_0x35f30f][_0x8167('0x28')]?_0x51d518[_0x8167('0x9')][_0x35f30f][_0x8167('0x28')]:_0x35f30f;return RpcUser[_0x8167('0x29')](_0x51d518[_0x8167('0x7')][_0x2b3306],_0x199a14,_0x29dad6)[_0x8167('0x23')](function(_0x5e33c1){if(!_0xd483ec){_0x51d518[_0x8167('0x8')][_0x2b3306]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x35f30f,_0x51d518[_0x8167('0x6')][_0x4f5580][_0x8167('0x2a')],_0x2b3306,_0x4f5580);_0x51d518['timers'][_0x2b3306][_0x8167('0x2b')]=setTimeout(_0x51d518[_0x8167('0x2c')][_0x8167('0xc')](_0x51d518,_0x2b3306),_0x51d518[_0x8167('0x6')][_0x4f5580]['acwTimeout']*0x3e8);_0x51d518[_0x8167('0x8')][_0x2b3306][_0x8167('0x2d')]=moment()[_0x8167('0x2e')](_0x8167('0x2f'));_0x51d518[_0x8167('0x8')][_0x2b3306][_0x8167('0x30')]=_0x35f30f;_0x51d518[_0x8167('0x8')][_0x2b3306][_0x8167('0x31')]=_0x4f5580;_0x51d518[_0x8167('0x8')][_0x2b3306]['updateAcw']=function(){var _0x4cab24=getDiff(_0x51d518[_0x8167('0x8')][_0x2b3306][_0x8167('0x2d')]);clearTimeout(_0x51d518[_0x8167('0x8')][_0x2b3306][_0x8167('0x2b')]);_0x51d518[_0x8167('0x8')][_0x2b3306][_0x8167('0x2b')]=![];RpcVoiceAgentReport[_0x8167('0x32')]({'acwtime':_0x4cab24},_0x51d518[_0x8167('0x8')][_0x2b3306]['uniqueid'],_0x2b3306)[_0x8167('0x23')](function(_0x27c462){logger['info'](_0x8167('0x33'),_0x35f30f,_0x4cab24,_0x27c462);})[_0x8167('0x34')](function(_0x221950){logger['error'](_0x8167('0x35'),_0x35f30f,_0x221950);});delete _0x51d518[_0x8167('0x8')][_0x2b3306];};}});}else{logger[_0x8167('0x25')](_0x8167('0x36'),_0x35f30f,_0x2b3306,_0x4f5580);}});}})['catch'](function(_0x14143c){logger[_0x8167('0x37')](_0x8167('0x38'),_0x35f30f,_0x51d518[_0x8167('0x6')][_0x4f5580][_0x8167('0x2a')],_0x2b3306,_0x4f5580);})[_0x8167('0x39')](function(){delete _0x51d518['channels'][_0x35f30f];});}catch(_0x577b9d){logger[_0x8167('0x37')]('[ACW][START]\x20%s',_0x577b9d[_0x8167('0x3a')]);}};Acw[_0x8167('0x1b')]['stopAcw']=function(_0x291967){try{var _0x445ae6=this;if(_0x445ae6[_0x8167('0x8')][_0x291967]){_0x445ae6['timers'][_0x291967][_0x8167('0x2b')]=![];var _0x4ab970=_0x445ae6['timers'][_0x291967][_0x8167('0x30')];var _0x56439f=_0x445ae6[_0x8167('0x8')][_0x291967]['queue'];var _0xf406fc=_0x445ae6[_0x8167('0x6')][_0x56439f]['acwTimeout'];logger[_0x8167('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x4ab970,_0x291967);RpcUser[_0x8167('0x3b')](this[_0x8167('0x7')][_0x291967]);RpcVoiceAgentReport['update']({'acwtime':_0xf406fc,'agentacw':!![]},_0x4ab970,_0x291967)['then'](function(_0x380608){logger[_0x8167('0x25')](_0x8167('0x33'),_0x4ab970,_0xf406fc,_0x380608);})[_0x8167('0x34')](function(_0x1d6257){logger[_0x8167('0x37')]('[%s][UPDATE][ERRORS:%s]',_0x4ab970,_0x1d6257);});}else{logger[_0x8167('0x37')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x291967);if(_0x445ae6['timers']){logger[_0x8167('0x25')]('[ACW][TIMERS]',JSON[_0x8167('0x3c')](_0x445ae6[_0x8167('0x8')]));}}}catch(_0x3551d9){logger[_0x8167('0x37')](_0x8167('0x3d'),_0x3551d9[_0x8167('0x3a')]);}};Acw[_0x8167('0x1b')][_0x8167('0xb')]=function(_0x59c693){try{if(this[_0x8167('0x6')][_0x59c693[_0x8167('0x31')]]&&(this[_0x8167('0x6')][_0x59c693[_0x8167('0x31')]][_0x8167('0x3e')]||this[_0x8167('0x6')][_0x59c693[_0x8167('0x31')]][_0x8167('0x3f')])){if(this[_0x8167('0x7')][_0x59c693['interface']]){this[_0x8167('0x9')][_0x59c693[_0x8167('0x30')]]={'queue':_0x59c693[_0x8167('0x31')],'interface':_0x59c693['interface'],'destlinkedid':_0x59c693[_0x8167('0x28')]};}}}catch(_0x37bf15){logger[_0x8167('0x37')](_0x8167('0x40'),_0x37bf15['message']);}};Acw[_0x8167('0x1b')]['syncAgentConnectPreview']=function(_0x58de85){try{if(this[_0x8167('0x6')][_0x58de85[_0x8167('0x31')]]&&(this[_0x8167('0x6')][_0x58de85[_0x8167('0x31')]]['acw']||this[_0x8167('0x6')][_0x58de85['queue']][_0x8167('0x3f')])){if(this['agents'][_0x58de85['interface']]){this['channels'][_0x58de85[_0x8167('0x30')]]={'queue':_0x58de85[_0x8167('0x31')],'interface':_0x58de85['interface']};}}}catch(_0x4bbadc){logger[_0x8167('0x37')](_0x8167('0x41'),_0x4bbadc[_0x8167('0x3a')]);}};Acw[_0x8167('0x1b')][_0x8167('0xe')]=function(_0xfbbc76){try{if(this[_0x8167('0x9')][_0xfbbc76[_0x8167('0x30')]]&&_[_0x8167('0x42')](this['channels'][_0xfbbc76[_0x8167('0x30')]][_0x8167('0x27')])){logger[_0x8167('0x25')](_0x8167('0x43'),_0xfbbc76[_0x8167('0x30')]);this[_0x8167('0x1c')](_0xfbbc76[_0x8167('0x30')]);}else if(this['channels'][_0xfbbc76['linkedid']]&&_['isUndefined'](this[_0x8167('0x9')][_0xfbbc76[_0x8167('0x44')]]['attended'])){logger[_0x8167('0x25')](_0x8167('0x45'),_0xfbbc76[_0x8167('0x44')]);this[_0x8167('0x1c')](_0xfbbc76['linkedid']);}}catch(_0x4bc9da){logger[_0x8167('0x37')](_0x8167('0x46'),_0x4bc9da[_0x8167('0x3a')]);}};Acw['prototype'][_0x8167('0x10')]=function(_0x510264){try{if(this[_0x8167('0x9')][_0x510264[_0x8167('0x30')]]&&this[_0x8167('0x9')][_0x510264['uniqueid']][_0x8167('0x27')]){logger[_0x8167('0x25')](_0x8167('0x47'),_0x510264[_0x8167('0x30')]);this[_0x8167('0x1c')](_0x510264[_0x8167('0x30')]);}else if(this['channels'][_0x510264[_0x8167('0x44')]]&&this[_0x8167('0x9')][_0x510264[_0x8167('0x44')]][_0x8167('0x27')]){logger[_0x8167('0x25')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x510264[_0x8167('0x44')]);this['startAcw'](_0x510264['linkedid']);}}catch(_0x529383){logger[_0x8167('0x37')](_0x8167('0x48'),_0x529383['message']);}};Acw['prototype'][_0x8167('0x14')]=function(_0x273587){try{if(!_[_0x8167('0x49')](this[_0x8167('0x9')][_0x273587[_0x8167('0x4a')]])){this[_0x8167('0x1c')](_0x273587['transfereeuniqueid']);if(this[_0x8167('0x9')][_0x273587[_0x8167('0x4b')]]){this[_0x8167('0x9')][_0x273587['secondtransfereruniqueid']][_0x8167('0x27')]=!![];this[_0x8167('0x9')][_0x273587[_0x8167('0x4c')]]=this[_0x8167('0x9')][_0x273587['secondtransfereruniqueid']];delete this[_0x8167('0x9')][_0x273587[_0x8167('0x4b')]];}}else if(!_[_0x8167('0x49')](this[_0x8167('0x9')][_0x273587[_0x8167('0x4c')]])){this['startAcw'](_0x273587[_0x8167('0x4c')]);if(this['channels'][_0x273587[_0x8167('0x4d')]]){this[_0x8167('0x9')][_0x273587[_0x8167('0x4d')]][_0x8167('0x27')]=!![];this['channels'][_0x273587[_0x8167('0x4a')]]=this['channels'][_0x273587['origtransfereruniqueid']];delete this[_0x8167('0x9')][_0x273587[_0x8167('0x4d')]];}}}catch(_0x4df2fc){logger[_0x8167('0x37')](_0x8167('0x4e'),_0x4df2fc[_0x8167('0x3a')]);}};Acw[_0x8167('0x1b')]['syncBlindTransfer']=function(_0x5921ac){try{if(this['channels'][_0x5921ac[_0x8167('0x4f')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x8167('0x3c')](_0x5921ac[_0x8167('0x4f')]));this[_0x8167('0x1c')](_0x5921ac[_0x8167('0x4f')]);}else if(this[_0x8167('0x9')][_0x5921ac[_0x8167('0x50')]]){logger[_0x8167('0x25')](_0x8167('0x51'),JSON[_0x8167('0x3c')](_0x5921ac[_0x8167('0x50')]));this[_0x8167('0x1c')](_0x5921ac[_0x8167('0x50')]);}}catch(_0x2e622c){logger[_0x8167('0x37')](_0x8167('0x52'),_0x2e622c[_0x8167('0x3a')]);}};Acw[_0x8167('0x1b')][_0x8167('0x12')]=function(_0x43fd05){try{if(this[_0x8167('0x6')][_0x43fd05['queue']]&&this[_0x8167('0x6')][_0x43fd05[_0x8167('0x31')]][_0x8167('0x53')]===_0x8167('0x54')){if(this['agents'][_0x43fd05[_0x8167('0x1d')]]){logger[_0x8167('0x25')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x43fd05[_0x8167('0x30')],_0x43fd05[_0x8167('0x1d')],_0x43fd05[_0x8167('0x31')]);return RpcUser[_0x8167('0x29')](this[_0x8167('0x7')][_0x43fd05[_0x8167('0x1d')]],_0x8167('0x55'),_0x43fd05[_0x8167('0x30')]);}}}catch(_0x29887a){logger[_0x8167('0x37')](_0x8167('0x56'),_0x29887a[_0x8167('0x3a')]);}};module[_0x8167('0x57')]=Acw;
\ No newline at end of file
+var _0x95df=['transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','hanguprequest','syncHangupRequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','custom:agentConnectPreview','milliseconds','diff','prototype','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','attended','destlinkedid','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer'];(function(_0x18e2e0,_0x3dd831){var _0x32c5bc=function(_0x5c2cf4){while(--_0x5c2cf4){_0x18e2e0['push'](_0x18e2e0['shift']());}};_0x32c5bc(++_0x3dd831);}(_0x95df,0x151));var _0xf95d=function(_0x25e5f8,_0x4b2fc6){_0x25e5f8=_0x25e5f8-0x0;var _0x541adc=_0x95df[_0x25e5f8];return _0x541adc;};'use strict';var util=require('util');var _=require(_0xf95d('0x0'));var moment=require(_0xf95d('0x1'));var ami=require(_0xf95d('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0xf95d('0x3'));var RpcVoiceAgentReport=require(_0xf95d('0x4'));function Acw(_0x3089b8){this[_0xf95d('0x5')]=_0x3089b8[_0xf95d('0x5')];this[_0xf95d('0x6')]=_0x3089b8['agents'];this['timers']=_0x3089b8['timers'];this[_0xf95d('0x7')]={};ami['on'](_0xf95d('0x8'),this['syncAgentConnect']['bind'](this));ami['on'](_0xf95d('0x9'),this[_0xf95d('0xa')][_0xf95d('0xb')](this));ami['on']('hangup',this[_0xf95d('0xc')][_0xf95d('0xb')](this));ami['on'](_0xf95d('0xd'),this[_0xf95d('0xe')][_0xf95d('0xb')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xf95d('0xb')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on'](_0xf95d('0xf'),this['syncAgentConnectPreview'][_0xf95d('0xb')](this));}function getDiff(_0x2df24a){var _0x4e572e=moment()[_0xf95d('0x10')](0x0);var _0x1ac5e5=moment(_0x2df24a)[_0xf95d('0x10')](0x0);return _0x4e572e[_0xf95d('0x11')](_0x1ac5e5,'seconds');}Acw[_0xf95d('0x12')][_0xf95d('0x13')]=function(_0x362209){try{var _0x4a0af5=this;var _0x513d3a=this[_0xf95d('0x7')][_0x362209]['interface'];var _0x269785=this[_0xf95d('0x7')][_0x362209][_0xf95d('0x14')];var _0x4762c3=this['voiceQueues'][_0x269785];var _0x45dbb3=![];var _0x5c5c37=_0xf95d('0x15');if(_0x4762c3[_0xf95d('0x16')]){if(_0x4762c3[_0xf95d('0x17')]['name']){_0x45dbb3=!![];_0x5c5c37=_0x4762c3[_0xf95d('0x17')][_0xf95d('0x18')];}}ami[_0xf95d('0x19')]({'action':_0xf95d('0x1a'),'interface':_0x513d3a,'paused':!![],'reason':_0x5c5c37})['then'](function(_0x5a974c){if(_0x4a0af5[_0xf95d('0x6')][_0x513d3a]){return RpcUser['getAgent'](_0x4a0af5[_0xf95d('0x6')][_0x513d3a]['id'])[_0xf95d('0x1b')](function(_0x11abbb){if(_0x11abbb&&!_0x11abbb[_0xf95d('0x1c')]){logger[_0xf95d('0x1d')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x362209,_0x513d3a,_0x269785);var _0x32b7f7=_0x4a0af5[_0xf95d('0x7')][_0x362209][_0xf95d('0x1e')]&&_0x4a0af5[_0xf95d('0x7')][_0x362209]['destlinkedid']?_0x4a0af5[_0xf95d('0x7')][_0x362209][_0xf95d('0x1f')]:_0x362209;return RpcUser['savePause'](_0x4a0af5['agents'][_0x513d3a],_0x5c5c37,_0x32b7f7)[_0xf95d('0x1b')](function(_0x5324cb){if(!_0x45dbb3){_0x4a0af5[_0xf95d('0x20')][_0x513d3a]={};logger[_0xf95d('0x1d')](_0xf95d('0x21'),_0x362209,_0x4a0af5['voiceQueues'][_0x269785][_0xf95d('0x22')],_0x513d3a,_0x269785);_0x4a0af5[_0xf95d('0x20')][_0x513d3a][_0xf95d('0x23')]=setTimeout(_0x4a0af5[_0xf95d('0x24')][_0xf95d('0xb')](_0x4a0af5,_0x513d3a),_0x4a0af5['voiceQueues'][_0x269785][_0xf95d('0x22')]*0x3e8);_0x4a0af5[_0xf95d('0x20')][_0x513d3a][_0xf95d('0x25')]=moment()[_0xf95d('0x26')](_0xf95d('0x27'));_0x4a0af5[_0xf95d('0x20')][_0x513d3a][_0xf95d('0x28')]=_0x362209;_0x4a0af5[_0xf95d('0x20')][_0x513d3a][_0xf95d('0x14')]=_0x269785;_0x4a0af5[_0xf95d('0x20')][_0x513d3a][_0xf95d('0x29')]=function(){var _0x29ac32=getDiff(_0x4a0af5['timers'][_0x513d3a][_0xf95d('0x25')]);clearTimeout(_0x4a0af5[_0xf95d('0x20')][_0x513d3a][_0xf95d('0x23')]);_0x4a0af5[_0xf95d('0x20')][_0x513d3a][_0xf95d('0x23')]=![];RpcVoiceAgentReport[_0xf95d('0x2a')]({'acwtime':_0x29ac32},_0x4a0af5[_0xf95d('0x20')][_0x513d3a][_0xf95d('0x28')],_0x513d3a)[_0xf95d('0x1b')](function(_0x526f38){logger[_0xf95d('0x1d')](_0xf95d('0x2b'),_0x362209,_0x29ac32,_0x526f38);})[_0xf95d('0x2c')](function(_0x5a22a3){logger[_0xf95d('0x2d')]('[%s][UPDATE][ERRORS:%s]',_0x362209,_0x5a22a3);});delete _0x4a0af5[_0xf95d('0x20')][_0x513d3a];};}});}else{logger[_0xf95d('0x1d')](_0xf95d('0x2e'),_0x362209,_0x513d3a,_0x269785);}});}})[_0xf95d('0x2c')](function(_0x350155){logger[_0xf95d('0x2d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x362209,_0x4a0af5[_0xf95d('0x5')][_0x269785][_0xf95d('0x22')],_0x513d3a,_0x269785);})[_0xf95d('0x2f')](function(){delete _0x4a0af5[_0xf95d('0x7')][_0x362209];});}catch(_0x1a7e9d){logger[_0xf95d('0x2d')]('[ACW][START]\x20%s',_0x1a7e9d[_0xf95d('0x30')]);}};Acw[_0xf95d('0x12')][_0xf95d('0x24')]=function(_0x248330){try{var _0x6cadde=this;if(_0x6cadde[_0xf95d('0x20')][_0x248330]){_0x6cadde['timers'][_0x248330][_0xf95d('0x23')]=![];var _0x2c75eb=_0x6cadde['timers'][_0x248330][_0xf95d('0x28')];var _0x450c83=_0x6cadde[_0xf95d('0x20')][_0x248330][_0xf95d('0x14')];var _0x243e8f=_0x6cadde['voiceQueues'][_0x450c83][_0xf95d('0x22')];logger[_0xf95d('0x1d')](_0xf95d('0x31'),_0x2c75eb,_0x248330);RpcUser[_0xf95d('0x32')](this[_0xf95d('0x6')][_0x248330]);RpcVoiceAgentReport[_0xf95d('0x2a')]({'acwtime':_0x243e8f,'agentacw':!![]},_0x2c75eb,_0x248330)[_0xf95d('0x1b')](function(_0x7d0723){logger[_0xf95d('0x1d')](_0xf95d('0x2b'),_0x2c75eb,_0x243e8f,_0x7d0723);})[_0xf95d('0x2c')](function(_0x38519a){logger[_0xf95d('0x2d')](_0xf95d('0x33'),_0x2c75eb,_0x38519a);});}else{logger[_0xf95d('0x2d')](_0xf95d('0x34'),_0x248330);if(_0x6cadde[_0xf95d('0x20')]){logger[_0xf95d('0x1d')]('[ACW][TIMERS]',JSON[_0xf95d('0x35')](_0x6cadde['timers']));}}}catch(_0x5b72b3){logger[_0xf95d('0x2d')](_0xf95d('0x36'),_0x5b72b3[_0xf95d('0x30')]);}};Acw[_0xf95d('0x12')]['syncAgentConnect']=function(_0x1b8953){try{if(this[_0xf95d('0x5')][_0x1b8953[_0xf95d('0x14')]]&&(this[_0xf95d('0x5')][_0x1b8953[_0xf95d('0x14')]][_0xf95d('0x37')]||this[_0xf95d('0x5')][_0x1b8953['queue']]['mandatoryDisposition'])){if(this['agents'][_0x1b8953[_0xf95d('0x38')]]){this[_0xf95d('0x7')][_0x1b8953['uniqueid']]={'queue':_0x1b8953[_0xf95d('0x14')],'interface':_0x1b8953[_0xf95d('0x38')],'destlinkedid':_0x1b8953[_0xf95d('0x1f')]};}}}catch(_0xebf4d3){logger[_0xf95d('0x2d')](_0xf95d('0x39'),_0xebf4d3[_0xf95d('0x30')]);}};Acw[_0xf95d('0x12')][_0xf95d('0x3a')]=function(_0x11aba2){try{if(this['voiceQueues'][_0x11aba2['queue']]&&(this[_0xf95d('0x5')][_0x11aba2[_0xf95d('0x14')]][_0xf95d('0x37')]||this[_0xf95d('0x5')][_0x11aba2[_0xf95d('0x14')]][_0xf95d('0x16')])){if(this[_0xf95d('0x6')][_0x11aba2[_0xf95d('0x38')]]){this[_0xf95d('0x7')][_0x11aba2[_0xf95d('0x28')]]={'queue':_0x11aba2[_0xf95d('0x14')],'interface':_0x11aba2[_0xf95d('0x38')]};}}}catch(_0xf8cd65){logger[_0xf95d('0x2d')]('[ACW][syncAgentConnectPreview]\x20%s',_0xf8cd65[_0xf95d('0x30')]);}};Acw[_0xf95d('0x12')]['syncHangupRequest']=function(_0x5f50b0){try{if(this[_0xf95d('0x7')][_0x5f50b0['uniqueid']]&&_[_0xf95d('0x3b')](this['channels'][_0x5f50b0[_0xf95d('0x28')]][_0xf95d('0x1e')])){logger[_0xf95d('0x1d')](_0xf95d('0x3c'),_0x5f50b0[_0xf95d('0x28')]);this[_0xf95d('0x13')](_0x5f50b0['uniqueid']);}else if(this[_0xf95d('0x7')][_0x5f50b0['linkedid']]&&_[_0xf95d('0x3b')](this[_0xf95d('0x7')][_0x5f50b0['linkedid']][_0xf95d('0x1e')])){logger[_0xf95d('0x1d')]('[%s][HANGUP:LINKEDID]',_0x5f50b0[_0xf95d('0x3d')]);this[_0xf95d('0x13')](_0x5f50b0['linkedid']);}}catch(_0x17710f){logger[_0xf95d('0x2d')]('[ACW][syncHangupRequest]\x20%s',_0x17710f[_0xf95d('0x30')]);}};Acw[_0xf95d('0x12')][_0xf95d('0xc')]=function(_0xf58490){try{if(this[_0xf95d('0x7')][_0xf58490['uniqueid']]&&this[_0xf95d('0x7')][_0xf58490[_0xf95d('0x28')]][_0xf95d('0x1e')]){logger['info'](_0xf95d('0x3e'),_0xf58490[_0xf95d('0x28')]);this[_0xf95d('0x13')](_0xf58490[_0xf95d('0x28')]);}else if(this['channels'][_0xf58490[_0xf95d('0x3d')]]&&this[_0xf95d('0x7')][_0xf58490[_0xf95d('0x3d')]][_0xf95d('0x1e')]){logger['info'](_0xf95d('0x3f'),_0xf58490[_0xf95d('0x3d')]);this['startAcw'](_0xf58490[_0xf95d('0x3d')]);}}catch(_0x5a739f){logger[_0xf95d('0x2d')](_0xf95d('0x40'),_0x5a739f[_0xf95d('0x30')]);}};Acw[_0xf95d('0x12')][_0xf95d('0x41')]=function(_0x16cc8e){try{if(!_['isNil'](this[_0xf95d('0x7')][_0x16cc8e[_0xf95d('0x42')]])){this['startAcw'](_0x16cc8e[_0xf95d('0x42')]);if(this[_0xf95d('0x7')][_0x16cc8e['secondtransfereruniqueid']]){this[_0xf95d('0x7')][_0x16cc8e['secondtransfereruniqueid']][_0xf95d('0x1e')]=!![];this[_0xf95d('0x7')][_0x16cc8e[_0xf95d('0x43')]]=this[_0xf95d('0x7')][_0x16cc8e[_0xf95d('0x44')]];delete this[_0xf95d('0x7')][_0x16cc8e[_0xf95d('0x44')]];}}else if(!_[_0xf95d('0x45')](this[_0xf95d('0x7')][_0x16cc8e['transfertargetuniqueid']])){this['startAcw'](_0x16cc8e[_0xf95d('0x43')]);if(this[_0xf95d('0x7')][_0x16cc8e[_0xf95d('0x46')]]){this[_0xf95d('0x7')][_0x16cc8e['origtransfereruniqueid']][_0xf95d('0x1e')]=!![];this[_0xf95d('0x7')][_0x16cc8e['transfereeuniqueid']]=this[_0xf95d('0x7')][_0x16cc8e[_0xf95d('0x46')]];delete this[_0xf95d('0x7')][_0x16cc8e['origtransfereruniqueid']];}}}catch(_0x467f72){logger[_0xf95d('0x2d')](_0xf95d('0x47'),_0x467f72[_0xf95d('0x30')]);}};Acw['prototype'][_0xf95d('0x48')]=function(_0x4003de){try{if(this[_0xf95d('0x7')][_0x4003de['transfereruniqueid']]){logger[_0xf95d('0x1d')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xf95d('0x35')](_0x4003de[_0xf95d('0x49')]));this[_0xf95d('0x13')](_0x4003de[_0xf95d('0x49')]);}else if(this[_0xf95d('0x7')][_0x4003de['transfererlinkedid']]){logger[_0xf95d('0x1d')](_0xf95d('0x4a'),JSON['stringify'](_0x4003de['transfererlinkedid']));this[_0xf95d('0x13')](_0x4003de[_0xf95d('0x4b')]);}}catch(_0x47f818){logger['error'](_0xf95d('0x4c'),_0x47f818[_0xf95d('0x30')]);}};Acw[_0xf95d('0x12')][_0xf95d('0xe')]=function(_0x3956c1){try{if(this['voiceQueues'][_0x3956c1['queue']]&&this[_0xf95d('0x5')][_0x3956c1[_0xf95d('0x14')]]['autopause']===_0xf95d('0x4d')){if(this[_0xf95d('0x6')][_0x3956c1['interface']]){logger['info'](_0xf95d('0x4e'),_0x3956c1[_0xf95d('0x28')],_0x3956c1['interface'],_0x3956c1[_0xf95d('0x14')]);return RpcUser[_0xf95d('0x4f')](this[_0xf95d('0x6')][_0x3956c1[_0xf95d('0x38')]],'Auto-Pause',_0x3956c1['uniqueid']);}}}catch(_0x49daa5){logger[_0xf95d('0x2d')](_0xf95d('0x50'),_0x49daa5[_0xf95d('0x30')]);}};module[_0xf95d('0x51')]=Acw;
\ No newline at end of file
index 596499c..a766e58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x4a6e61,_0x2698d8){var _0x128c78=function(_0x5079f7){while(--_0x5079f7){_0x4a6e61['push'](_0x4a6e61['shift']());}};_0x128c78(++_0x2698d8);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c27b6,_0x2192cb){_0x3c27b6=_0x3c27b6-0x0;var _0x2a5f55=_0xb10b[_0x3c27b6];return _0x2a5f55;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami;
\ No newline at end of file
+var _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x2c0c4f,_0x5caee5){var _0x4d44da=function(_0x3d82aa){while(--_0x3d82aa){_0x2c0c4f['push'](_0x2c0c4f['shift']());}};_0x4d44da(++_0x5caee5);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b8240,_0x4cf6d6){_0x3b8240=_0x3b8240-0x0;var _0x39edd4=_0xb10b[_0x3b8240];return _0x39edd4;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami;
\ No newline at end of file
index 22f6df4..b1cabee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x120e13,_0x8b6fa5){var _0x29c941=function(_0x5d2fac){while(--_0x5d2fac){_0x120e13['push'](_0x120e13['shift']());}};_0x29c941(++_0x8b6fa5);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x18a01c,_0xd1a13a){_0x18a01c=_0x18a01c-0x0;var _0x2b0cd6=_0xbdb7[_0x18a01c];return _0x2b0cd6;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client;
\ No newline at end of file
+var _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x2164da,_0x16cd0b){var _0x12da0d=function(_0x5e5160){while(--_0x5e5160){_0x2164da['push'](_0x2164da['shift']());}};_0x12da0d(++_0x16cd0b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client;
\ No newline at end of file
index db8e33b..605cf38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x159a=['queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','dialCutDigit','substring','prototype','getQueue','util','lodash','moment','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x159a,0x1ec));var _0xa159=function(_0x2ba425,_0x58d262){_0x2ba425=_0x2ba425-0x0;var _0x5dee4f=_0x159a[_0x2ba425];return _0x5dee4f;};'use strict';var util=require(_0xa159('0x0'));var _=require(_0xa159('0x1'));var moment=require(_0xa159('0x2'));function checkNameSurname(_0x1a38aa,_0x1f04b3,_0x1a7ec7){var _0xa4a715='';if(!_['isNil'](_0x1f04b3)&&_0xa159('0x3')===typeof _0x1f04b3){_0xa4a715+=_0x1f04b3;}if(!_['isNil'](_0x1a7ec7)&&_0xa159('0x3')===typeof _0x1a7ec7){_0xa4a715+='\x20'+_0x1a7ec7;}if(_0xa4a715!==''){return _0xa4a715;}return _0x1a38aa;}function Action(_0xc209f2,_0x121c69,_0x52d6dd){this[_0xa159('0x4')]=_0xc209f2;this[_0xa159('0x5')]=_0x52d6dd||undefined;this[_0xa159('0x6')]=checkNameSurname(_0x121c69[_0xa159('0x7')][_0xa159('0x8')],_0x121c69['Contact'][_0xa159('0x9')],_0x121c69[_0xa159('0x7')][_0xa159('0xa')]);this[_0xa159('0xb')]=_0x121c69[_0xa159('0x7')][_0xa159('0x8')];this[_0xa159('0xc')]=_0xc209f2['name'];this[_0xa159('0xd')]=_0x121c69['active']||![];this[_0xa159('0xe')]=_0xc209f2['type'];this['dialQueueTimeout']=_0xc209f2[_0xa159('0xf')]||0x3;this[_0xa159('0x10')]=_0x121c69[_0xa159('0x10')];this['countbusyretry']=_0x121c69[_0xa159('0x11')];this[_0xa159('0x12')]=_0x121c69[_0xa159('0x12')];this[_0xa159('0x13')]=_0x121c69[_0xa159('0x13')];this[_0xa159('0x14')]=_0x121c69[_0xa159('0x14')];this['countdropretry']=_0x121c69[_0xa159('0x15')];this[_0xa159('0x16')]=_0x121c69[_0xa159('0x16')];this[_0xa159('0x17')]=_0x121c69[_0xa159('0x17')];this[_0xa159('0x18')]=_0x121c69[_0xa159('0x18')];this[_0xa159('0x19')]=_0x121c69[_0xa159('0x19')];this[_0xa159('0x1a')]=_0x121c69[_0xa159('0x1a')];this[_0xa159('0x1b')]=_0x121c69['UserId'];this[_0xa159('0x1c')]=_0x121c69[_0xa159('0x1c')];this[_0xa159('0x1d')]=_0x121c69[_0xa159('0x1d')];this['idHopper']=_0x121c69['id'];this[_0xa159('0x1e')]=_0x121c69[_0xa159('0x7')][_0xa159('0x9')]||'';this[_0xa159('0x1f')]=moment()[_0xa159('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa159('0x21')]=_0x121c69[_0xa159('0x21')];this[_0xa159('0x22')]=_0x121c69[_0xa159('0x22')];this['callbackat']=_0x121c69[_0xa159('0x23')];this['recallme']=_0x121c69['recallme'];this[_0xa159('0x24')]='';this[_0xa159('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0xa159('0x20')]('\x22%s\x22\x20<%s>',this[_0xa159('0x6')],this[_0xa159('0x4')][_0xa159('0x26')]>0x0?this[_0xa159('0xb')][_0xa159('0x27')](this['voiceQueue'][_0xa159('0x26')]):this['number']);};Action[_0xa159('0x28')][_0xa159('0x29')]=function(){return this[_0xa159('0xc')];};module['exports']=Action;
\ No newline at end of file
+var _0x51eb=['ContactFirstName','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','number','substring','getQueue','exports','moment','string','isNil','uniqueid','name','Contact','phone','firstName','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x439db8,_0x3ec9d3){var _0x18e407=function(_0x453426){while(--_0x453426){_0x439db8['push'](_0x439db8['shift']());}};_0x18e407(++_0x3ec9d3);}(_0x51eb,0xe2));var _0xb51e=function(_0x441a87,_0x427f07){_0x441a87=_0x441a87-0x0;var _0x32ca3a=_0x51eb[_0x441a87];return _0x32ca3a;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xb51e('0x0'));function checkNameSurname(_0x3fde61,_0x3dcef4,_0xefe742){var _0x509827='';if(!_['isNil'](_0x3dcef4)&&_0xb51e('0x1')===typeof _0x3dcef4){_0x509827+=_0x3dcef4;}if(!_[_0xb51e('0x2')](_0xefe742)&&_0xb51e('0x1')===typeof _0xefe742){_0x509827+='\x20'+_0xefe742;}if(_0x509827!==''){return _0x509827;}return _0x3fde61;}function Action(_0x9b7767,_0x469358,_0xa42451){this['voiceQueue']=_0x9b7767;this[_0xb51e('0x3')]=_0xa42451||undefined;this[_0xb51e('0x4')]=checkNameSurname(_0x469358[_0xb51e('0x5')][_0xb51e('0x6')],_0x469358['Contact'][_0xb51e('0x7')],_0x469358[_0xb51e('0x5')]['lastName']);this['number']=_0x469358[_0xb51e('0x5')][_0xb51e('0x6')];this[_0xb51e('0x8')]=_0x9b7767[_0xb51e('0x4')];this[_0xb51e('0x9')]=_0x469358[_0xb51e('0x9')]||![];this[_0xb51e('0xa')]=_0x9b7767[_0xb51e('0xa')];this['dialQueueTimeout']=_0x9b7767['dialQueueTimeout']||0x3;this['scheduledat']=_0x469358[_0xb51e('0xb')];this[_0xb51e('0xc')]=_0x469358[_0xb51e('0xc')];this[_0xb51e('0xd')]=_0x469358[_0xb51e('0xd')];this[_0xb51e('0xe')]=_0x469358['countnoanswerretry'];this['countnosuchnumberretry']=_0x469358[_0xb51e('0xf')];this['countdropretry']=_0x469358[_0xb51e('0x10')];this[_0xb51e('0x11')]=_0x469358[_0xb51e('0x11')];this[_0xb51e('0x12')]=_0x469358['countmachineretry'];this[_0xb51e('0x13')]=_0x469358[_0xb51e('0x13')];this[_0xb51e('0x14')]=_0x469358['ContactId'];this[_0xb51e('0x15')]=_0x469358[_0xb51e('0x15')];this[_0xb51e('0x16')]=_0x469358[_0xb51e('0x16')];this[_0xb51e('0x17')]=_0x469358[_0xb51e('0x17')];this[_0xb51e('0x18')]=_0x469358[_0xb51e('0x18')];this[_0xb51e('0x19')]=_0x469358['id'];this[_0xb51e('0x1a')]=_0x469358[_0xb51e('0x5')][_0xb51e('0x7')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x469358[_0xb51e('0x1b')];this['callbackuniqueid']=_0x469358[_0xb51e('0x1c')];this[_0xb51e('0x1d')]=_0x469358[_0xb51e('0x1d')];this['recallme']=_0x469358[_0xb51e('0x1e')];this['originatecalleridnum']='';this[_0xb51e('0x1f')]='';}Action[_0xb51e('0x20')][_0xb51e('0x21')]=function(){return util[_0xb51e('0x22')](_0xb51e('0x23'),this[_0xb51e('0x4')],this[_0xb51e('0x24')][_0xb51e('0x25')]>0x0?this[_0xb51e('0x26')][_0xb51e('0x27')](this['voiceQueue'][_0xb51e('0x25')]):this[_0xb51e('0x26')]);};Action[_0xb51e('0x20')][_0xb51e('0x28')]=function(){return this[_0xb51e('0x8')];};module[_0xb51e('0x29')]=Action;
\ No newline at end of file
index 4dc6dd7..5287c24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3442=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback'];(function(_0x2662c3,_0xc7d942){var _0x9cb567=function(_0x540cbf){while(--_0x540cbf){_0x2662c3['push'](_0x2662c3['shift']());}};_0x9cb567(++_0xc7d942);}(_0x3442,0x15a));var _0x2344=function(_0x4a9ca1,_0x5d6086){_0x4a9ca1=_0x4a9ca1-0x0;var _0x5c2acd=_0x3442[_0x4a9ca1];return _0x5c2acd;};'use strict';var util=require('util');var _=require(_0x2344('0x0'));var moment=require(_0x2344('0x1'));function getSeconds(_0x1d03be,_0x3c6c49){var _0x32b160=moment(_0x1d03be)[_0x2344('0x2')](0x0);var _0x22b868=moment(_0x3c6c49)['milliseconds'](0x0);return _0x32b160[_0x2344('0x3')](_0x22b868,_0x2344('0x4'));}function AgentComplete(_0x4e1967,_0x38c574){this[_0x2344('0x5')]=0x4;this[_0x2344('0x6')]=_0x2344('0x7');this[_0x2344('0x8')]=_0x4e1967[_0x2344('0x8')];this[_0x2344('0x9')]=_0x4e1967[_0x2344('0x9')];this[_0x2344('0xa')]=_0x4e1967['type']===_0x2344('0xb')?_0x2344('0xc'):_0x4e1967[_0x2344('0x9')];this[_0x2344('0xd')]=_0x4e1967[_0x2344('0xd')];this[_0x2344('0xe')]=_0x4e1967['countcongestionretry'];this[_0x2344('0xf')]=_0x4e1967[_0x2344('0xf')];this[_0x2344('0x10')]=_0x4e1967[_0x2344('0xd')]+_0x4e1967[_0x2344('0xe')]+_0x4e1967[_0x2344('0xf')]+_0x4e1967['countnosuchnumberretry']+_0x4e1967[_0x2344('0x11')]+_0x4e1967[_0x2344('0x12')]+_0x4e1967[_0x2344('0x13')]+_0x4e1967[_0x2344('0x14')];this[_0x2344('0x15')]=_0x4e1967[_0x2344('0x15')];this[_0x2344('0x11')]=_0x4e1967[_0x2344('0x11')];this['countabandonedretry']=_0x4e1967['countabandonedretry'];this['countmachineretry']=_0x4e1967['countmachineretry'];this['countagentrejectretry']=_0x4e1967[_0x2344('0x14')];this[_0x2344('0x16')]=_0x38c574[_0x2344('0x16')];this[_0x2344('0x17')]=_0x4e1967[_0x2344('0x18')];this[_0x2344('0x19')]=_0x4e1967['number'];this[_0x2344('0x1a')]=_0x4e1967[_0x2344('0x1a')];this['responsetime']=_0x4e1967[_0x2344('0x1b')];this['answertime']=_0x4e1967[_0x2344('0x1c')];this[_0x2344('0x1d')]=moment()[_0x2344('0x1e')](_0x2344('0x1f'));this[_0x2344('0x20')]=getSeconds(_0x4e1967[_0x2344('0x1b')],_0x4e1967['starttime']);this[_0x2344('0x21')]=getSeconds(_0x4e1967[_0x2344('0x1c')],_0x4e1967['responsetime']);this[_0x2344('0x22')]=getSeconds(this[_0x2344('0x1d')],_0x4e1967['answertime']);this[_0x2344('0xc')]=_0x38c574[_0x2344('0xc')];this['membername']=_0x38c574[_0x2344('0x23')];this[_0x2344('0x24')]=_0x38c574[_0x2344('0x24')];this[_0x2344('0x25')]=_0x4e1967['callback'];this[_0x2344('0x26')]=_0x4e1967[_0x2344('0x26')];this[_0x2344('0x27')]=_0x4e1967[_0x2344('0x27')];this[_0x2344('0x28')]=_0x4e1967[_0x2344('0x28')];this[_0x2344('0x29')]=_0x4e1967[_0x2344('0x29')];this['ListId']=_0x4e1967[_0x2344('0x2a')];this[_0x2344('0x2b')]=_0x4e1967[_0x2344('0x2b')];this[_0x2344('0x2c')]=_0x4e1967[_0x2344('0x2c')];this['CampaignId']=_0x4e1967[_0x2344('0x2d')];this[_0x2344('0x2e')]=_0x4e1967['originatecalleridnum']||'';this[_0x2344('0x2f')]=_0x4e1967[_0x2344('0x2f')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0x1082=['countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','membername','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','queue','countbusyretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x1082,0x11c));var _0x2108=function(_0x48db8c,_0x4a1555){_0x48db8c=_0x48db8c-0x0;var _0x232929=_0x1082[_0x48db8c];return _0x232929;};'use strict';var util=require(_0x2108('0x0'));var _=require(_0x2108('0x1'));var moment=require(_0x2108('0x2'));function getSeconds(_0x5460ff,_0x4b7b1d){var _0x282963=moment(_0x5460ff)[_0x2108('0x3')](0x0);var _0x3a9e8b=moment(_0x4b7b1d)[_0x2108('0x3')](0x0);return _0x282963[_0x2108('0x4')](_0x3a9e8b,_0x2108('0x5'));}function AgentComplete(_0x15c564,_0x40b92d){this[_0x2108('0x6')]=0x4;this[_0x2108('0x7')]=_0x2108('0x8');this[_0x2108('0x9')]=_0x15c564[_0x2108('0x9')];this['type']=_0x15c564[_0x2108('0xa')];this['campaigntype']=_0x15c564[_0x2108('0xa')]==='outbound'?_0x2108('0xb'):_0x15c564[_0x2108('0xa')];this[_0x2108('0xc')]=_0x15c564[_0x2108('0xc')];this['countcongestionretry']=_0x15c564['countcongestionretry'];this['countnoanswerretry']=_0x15c564[_0x2108('0xd')];this['countglobal']=_0x15c564['countbusyretry']+_0x15c564['countcongestionretry']+_0x15c564[_0x2108('0xd')]+_0x15c564['countnosuchnumberretry']+_0x15c564[_0x2108('0xe')]+_0x15c564[_0x2108('0xf')]+_0x15c564[_0x2108('0x10')]+_0x15c564[_0x2108('0x11')];this[_0x2108('0x12')]=_0x15c564['countnosuchnumberretry'];this[_0x2108('0xe')]=_0x15c564[_0x2108('0xe')];this[_0x2108('0xf')]=_0x15c564[_0x2108('0xf')];this['countmachineretry']=_0x15c564[_0x2108('0x10')];this[_0x2108('0x11')]=_0x15c564['countagentrejectretry'];this['uniqueid']=_0x40b92d[_0x2108('0x13')];this[_0x2108('0x14')]=_0x15c564[_0x2108('0x15')];this[_0x2108('0x16')]=_0x15c564[_0x2108('0x17')];this[_0x2108('0x18')]=_0x15c564[_0x2108('0x18')];this[_0x2108('0x19')]=_0x15c564[_0x2108('0x19')];this[_0x2108('0x1a')]=_0x15c564[_0x2108('0x1a')];this['endtime']=moment()[_0x2108('0x1b')](_0x2108('0x1c'));this[_0x2108('0x1d')]=getSeconds(_0x15c564['responsetime'],_0x15c564['starttime']);this['holdtime']=getSeconds(_0x15c564[_0x2108('0x1a')],_0x15c564[_0x2108('0x19')]);this[_0x2108('0x1e')]=getSeconds(this[_0x2108('0x1f')],_0x15c564['answertime']);this['queue']=_0x40b92d[_0x2108('0xb')];this[_0x2108('0x20')]=_0x40b92d['membername'];this['reason']=_0x40b92d['reason'];this[_0x2108('0x21')]=_0x15c564[_0x2108('0x21')];this[_0x2108('0x22')]=_0x15c564[_0x2108('0x22')];this[_0x2108('0x23')]=_0x15c564[_0x2108('0x23')];this[_0x2108('0x24')]=_0x15c564[_0x2108('0x24')];this['ContactId']=_0x15c564['ContactId'];this[_0x2108('0x25')]=_0x15c564[_0x2108('0x25')];this[_0x2108('0x26')]=_0x15c564[_0x2108('0x26')];this[_0x2108('0x27')]=_0x15c564[_0x2108('0x27')];this[_0x2108('0x28')]=_0x15c564[_0x2108('0x28')];this['originatecalleridnum']=_0x15c564['originatecalleridnum']||'';this[_0x2108('0x29')]=_0x15c564[_0x2108('0x29')]||'';}module[_0x2108('0x2a')]=AgentComplete;
\ No newline at end of file
index 1b162d5..19f45a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2494=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry'];(function(_0x3a57de,_0x1830fe){var _0x3da9fa=function(_0x972e0d){while(--_0x972e0d){_0x3a57de['push'](_0x3a57de['shift']());}};_0x3da9fa(++_0x1830fe);}(_0x2494,0x82));var _0x4249=function(_0x16be3c,_0x443d9b){_0x16be3c=_0x16be3c-0x0;var _0x3d8672=_0x2494[_0x16be3c];return _0x3d8672;};'use strict';var util=require(_0x4249('0x0'));var _=require('lodash');var moment=require(_0x4249('0x1'));function getSeconds(_0x3072d7,_0x3cdee4){var _0x3f9dc6=moment(_0x3072d7)[_0x4249('0x2')](0x0);var _0x3fbecf=moment(_0x3cdee4)['milliseconds'](0x0);return _0x3f9dc6['diff'](_0x3fbecf,_0x4249('0x3'));}function Final(_0x49ac67){this[_0x4249('0x4')]=_0x49ac67[_0x4249('0x4')];this[_0x4249('0x5')]=_0x49ac67['scheduledat'];this[_0x4249('0x6')]=_0x49ac67[_0x4249('0x6')];this[_0x4249('0x7')]=_0x49ac67['type']==='outbound'?_0x4249('0x8'):_0x49ac67[_0x4249('0x6')];this[_0x4249('0x9')]=_0x49ac67[_0x4249('0x9')];this[_0x4249('0xa')]=_0x49ac67[_0x4249('0xa')];this[_0x4249('0xb')]=_0x49ac67['countnoanswerretry'];this['countglobal']=_0x49ac67[_0x4249('0x9')]+_0x49ac67['countcongestionretry']+_0x49ac67[_0x4249('0xb')]+_0x49ac67[_0x4249('0xc')]+_0x49ac67['countdropretry']+_0x49ac67[_0x4249('0xd')]+_0x49ac67[_0x4249('0xe')]+_0x49ac67['countagentrejectretry'];this[_0x4249('0xc')]=_0x49ac67[_0x4249('0xc')];this[_0x4249('0xf')]=_0x49ac67[_0x4249('0xf')];this[_0x4249('0xd')]=_0x49ac67[_0x4249('0xd')];this['countmachineretry']=_0x49ac67[_0x4249('0xe')];this[_0x4249('0x10')]=_0x49ac67['countagentrejectretry'];this[_0x4249('0x8')]=_0x49ac67['queue'];this['calleridname']=_0x49ac67['calleridname'];this[_0x4249('0x11')]=_0x49ac67[_0x4249('0x11')];this[_0x4249('0x12')]=_0x49ac67[_0x4249('0x12')];this[_0x4249('0x13')]=_0x49ac67['responsetime'];this['endtime']=_0x49ac67[_0x4249('0x13')];this[_0x4249('0x14')]=_0x49ac67[_0x4249('0x14')]||0x0;this['holdtime']=_0x49ac67[_0x4249('0x15')]||0x0;this[_0x4249('0x16')]=_0x49ac67['talktime']||0x0;this[_0x4249('0x17')]=_0x49ac67['callback'];this[_0x4249('0x18')]=_0x49ac67[_0x4249('0x18')];this[_0x4249('0x19')]=_0x49ac67[_0x4249('0x19')];this[_0x4249('0x1a')]=_0x49ac67[_0x4249('0x1a')];this[_0x4249('0x1b')]=_0x49ac67[_0x4249('0x1b')];this[_0x4249('0x1c')]=_0x49ac67[_0x4249('0x1c')];this[_0x4249('0x1d')]=_0x49ac67[_0x4249('0x1d')];this[_0x4249('0x1e')]=_0x49ac67[_0x4249('0x1e')];this[_0x4249('0x1f')]=_0x49ac67[_0x4249('0x1f')];this[_0x4249('0x20')]=_0x49ac67[_0x4249('0x20')]||'';this[_0x4249('0x21')]=_0x49ac67[_0x4249('0x21')]||'';}module[_0x4249('0x22')]=Final;
\ No newline at end of file
+var _0xcb99=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xcb99,0x8b));var _0x9cb9=function(_0x285db,_0x4f4926){_0x285db=_0x285db-0x0;var _0x2ebec6=_0xcb99[_0x285db];return _0x2ebec6;};'use strict';var util=require(_0x9cb9('0x0'));var _=require('lodash');var moment=require(_0x9cb9('0x1'));function getSeconds(_0x52af95,_0x480364){var _0x3a2f21=moment(_0x52af95)[_0x9cb9('0x2')](0x0);var _0x124c48=moment(_0x480364)['milliseconds'](0x0);return _0x3a2f21[_0x9cb9('0x3')](_0x124c48,_0x9cb9('0x4'));}function Final(_0x544d32){this[_0x9cb9('0x5')]=_0x544d32['uniqueid'];this[_0x9cb9('0x6')]=_0x544d32[_0x9cb9('0x6')];this[_0x9cb9('0x7')]=_0x544d32[_0x9cb9('0x7')];this[_0x9cb9('0x8')]=_0x544d32[_0x9cb9('0x7')]===_0x9cb9('0x9')?_0x9cb9('0xa'):_0x544d32['type'];this['countbusyretry']=_0x544d32[_0x9cb9('0xb')];this[_0x9cb9('0xc')]=_0x544d32[_0x9cb9('0xc')];this['countnoanswerretry']=_0x544d32[_0x9cb9('0xd')];this[_0x9cb9('0xe')]=_0x544d32['countbusyretry']+_0x544d32['countcongestionretry']+_0x544d32[_0x9cb9('0xd')]+_0x544d32[_0x9cb9('0xf')]+_0x544d32[_0x9cb9('0x10')]+_0x544d32[_0x9cb9('0x11')]+_0x544d32['countmachineretry']+_0x544d32[_0x9cb9('0x12')];this[_0x9cb9('0xf')]=_0x544d32[_0x9cb9('0xf')];this[_0x9cb9('0x10')]=_0x544d32[_0x9cb9('0x10')];this[_0x9cb9('0x11')]=_0x544d32[_0x9cb9('0x11')];this[_0x9cb9('0x13')]=_0x544d32[_0x9cb9('0x13')];this[_0x9cb9('0x12')]=_0x544d32[_0x9cb9('0x12')];this[_0x9cb9('0xa')]=_0x544d32[_0x9cb9('0xa')];this[_0x9cb9('0x14')]=_0x544d32[_0x9cb9('0x14')];this[_0x9cb9('0x15')]=_0x544d32[_0x9cb9('0x15')];this[_0x9cb9('0x16')]=_0x544d32['starttime'];this['responsetime']=_0x544d32[_0x9cb9('0x17')];this['endtime']=_0x544d32['responsetime'];this['ringtime']=_0x544d32[_0x9cb9('0x18')]||0x0;this['holdtime']=_0x544d32[_0x9cb9('0x19')]||0x0;this[_0x9cb9('0x1a')]=_0x544d32[_0x9cb9('0x1a')]||0x0;this[_0x9cb9('0x1b')]=_0x544d32[_0x9cb9('0x1b')];this[_0x9cb9('0x1c')]=_0x544d32[_0x9cb9('0x1c')];this[_0x9cb9('0x1d')]=_0x544d32[_0x9cb9('0x1d')];this[_0x9cb9('0x1e')]=_0x544d32[_0x9cb9('0x1e')];this[_0x9cb9('0x1f')]=_0x544d32[_0x9cb9('0x1f')];this[_0x9cb9('0x20')]=_0x544d32['ListId'];this['UserId']=_0x544d32[_0x9cb9('0x21')];this[_0x9cb9('0x22')]=_0x544d32[_0x9cb9('0x22')];this[_0x9cb9('0x23')]=_0x544d32[_0x9cb9('0x23')];this[_0x9cb9('0x24')]=_0x544d32[_0x9cb9('0x24')]||'';this[_0x9cb9('0x25')]=_0x544d32[_0x9cb9('0x25')]||'';}module['exports']=Final;
\ No newline at end of file
index 393f121..b09dd22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12b8=['ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0x12b8,0x1d1));var _0x812b=function(_0x3370aa,_0x282cfc){_0x3370aa=_0x3370aa-0x0;var _0xa5801a=_0x12b8[_0x3370aa];return _0xa5801a;};'use strict';var util=require(_0x812b('0x0'));var _=require(_0x812b('0x1'));var moment=require(_0x812b('0x2'));function getSeconds(_0x11f5db,_0x5f368a){var _0x82f26f=moment(_0x11f5db)['milliseconds'](0x0);var _0x4febde=moment(_0x5f368a)[_0x812b('0x3')](0x0);return _0x82f26f[_0x812b('0x4')](_0x4febde,_0x812b('0x5'));}function Hangup(_0x542de4,_0x2a07c3){this['state']=0x4;this['statedesc']=_0x812b('0x6');this[_0x812b('0x7')]=_0x542de4[_0x812b('0x7')];this[_0x812b('0x8')]=_0x542de4['type'];this[_0x812b('0x9')]=_0x542de4[_0x812b('0x8')]===_0x812b('0xa')?_0x812b('0xb'):_0x542de4['type'];this[_0x812b('0xc')]=_0x542de4[_0x812b('0xc')];this['countcongestionretry']=_0x542de4[_0x812b('0xd')];this['countnoanswerretry']=_0x542de4['countnoanswerretry'];this[_0x812b('0xe')]=_0x542de4[_0x812b('0xc')]+_0x542de4['countcongestionretry']+_0x542de4['countnoanswerretry']+_0x542de4[_0x812b('0xf')]+_0x542de4[_0x812b('0x10')]+_0x542de4['countabandonedretry']+_0x542de4[_0x812b('0x11')]+_0x542de4[_0x812b('0x12')];this[_0x812b('0xf')]=_0x542de4[_0x812b('0xf')];this['countdropretry']=_0x542de4[_0x812b('0x10')];this[_0x812b('0x13')]=_0x542de4[_0x812b('0x13')];this[_0x812b('0x11')]=_0x542de4[_0x812b('0x11')];this[_0x812b('0x12')]=_0x542de4[_0x812b('0x12')];this[_0x812b('0x14')]=_0x2a07c3[_0x812b('0x14')];this[_0x812b('0x15')]=_0x542de4[_0x812b('0x16')];this[_0x812b('0x17')]=_0x542de4[_0x812b('0x18')];this['starttime']=_0x542de4['starttime'];this[_0x812b('0x19')]=_0x542de4['responsetime'];this[_0x812b('0x1a')]=moment()['format'](_0x812b('0x1b'));this[_0x812b('0x1c')]=getSeconds(_0x542de4[_0x812b('0x19')],_0x542de4[_0x812b('0x1d')]);this[_0x812b('0x1e')]=0x0;this[_0x812b('0x1f')]=getSeconds(this[_0x812b('0x1a')],_0x542de4[_0x812b('0x19')]);this[_0x812b('0xb')]=_0x542de4[_0x812b('0xb')];this[_0x812b('0x20')]=_0x812b('0x21');this[_0x812b('0x22')]=_0x2a07c3[_0x812b('0x23')];this[_0x812b('0x24')]=_0x542de4[_0x812b('0x24')];this[_0x812b('0x25')]=_0x542de4[_0x812b('0x25')];this[_0x812b('0x26')]=_0x542de4[_0x812b('0x26')];this[_0x812b('0x27')]=_0x542de4['recallme'];this[_0x812b('0x28')]=_0x542de4[_0x812b('0x28')];this[_0x812b('0x29')]=_0x542de4['ListId'];this['UserId']=_0x542de4[_0x812b('0x2a')];this[_0x812b('0x2b')]=_0x542de4[_0x812b('0x2b')];this['CampaignId']=_0x542de4[_0x812b('0x2c')];}module[_0x812b('0x2d')]=Hangup;
\ No newline at end of file
+var _0x80e8=['starttime','responsetime','format','ringtime','holdtime','talktime','endtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','state','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','number'];(function(_0xb5fc3e,_0x234703){var _0x2efc3c=function(_0x4e4e44){while(--_0x4e4e44){_0xb5fc3e['push'](_0xb5fc3e['shift']());}};_0x2efc3c(++_0x234703);}(_0x80e8,0x1ab));var _0x880e=function(_0x1d7eaa,_0x59746a){_0x1d7eaa=_0x1d7eaa-0x0;var _0x343f77=_0x80e8[_0x1d7eaa];return _0x343f77;};'use strict';var util=require(_0x880e('0x0'));var _=require(_0x880e('0x1'));var moment=require(_0x880e('0x2'));function getSeconds(_0x309599,_0x2af1c8){var _0x521b95=moment(_0x309599)['milliseconds'](0x0);var _0x188a36=moment(_0x2af1c8)[_0x880e('0x3')](0x0);return _0x521b95['diff'](_0x188a36,_0x880e('0x4'));}function Hangup(_0x8c5979,_0x5c7803){this[_0x880e('0x5')]=0x4;this['statedesc']=_0x880e('0x6');this['scheduledat']=_0x8c5979['scheduledat'];this[_0x880e('0x7')]=_0x8c5979['type'];this[_0x880e('0x8')]=_0x8c5979[_0x880e('0x7')]===_0x880e('0x9')?_0x880e('0xa'):_0x8c5979['type'];this[_0x880e('0xb')]=_0x8c5979['countbusyretry'];this[_0x880e('0xc')]=_0x8c5979[_0x880e('0xc')];this['countnoanswerretry']=_0x8c5979[_0x880e('0xd')];this[_0x880e('0xe')]=_0x8c5979[_0x880e('0xb')]+_0x8c5979[_0x880e('0xc')]+_0x8c5979[_0x880e('0xd')]+_0x8c5979[_0x880e('0xf')]+_0x8c5979[_0x880e('0x10')]+_0x8c5979[_0x880e('0x11')]+_0x8c5979['countmachineretry']+_0x8c5979[_0x880e('0x12')];this[_0x880e('0xf')]=_0x8c5979[_0x880e('0xf')];this[_0x880e('0x10')]=_0x8c5979[_0x880e('0x10')];this[_0x880e('0x11')]=_0x8c5979[_0x880e('0x11')];this[_0x880e('0x13')]=_0x8c5979[_0x880e('0x13')];this[_0x880e('0x12')]=_0x8c5979['countagentrejectretry'];this[_0x880e('0x14')]=_0x5c7803['uniqueid'];this[_0x880e('0x15')]=_0x8c5979['name'];this[_0x880e('0x16')]=_0x8c5979[_0x880e('0x17')];this[_0x880e('0x18')]=_0x8c5979[_0x880e('0x18')];this[_0x880e('0x19')]=_0x8c5979['responsetime'];this['endtime']=moment()[_0x880e('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x880e('0x1b')]=getSeconds(_0x8c5979[_0x880e('0x19')],_0x8c5979['starttime']);this[_0x880e('0x1c')]=0x0;this[_0x880e('0x1d')]=getSeconds(this[_0x880e('0x1e')],_0x8c5979[_0x880e('0x19')]);this[_0x880e('0xa')]=_0x8c5979[_0x880e('0xa')];this['membername']='IVR';this['reason']=_0x5c7803['cause-txt'];this['callback']=_0x8c5979[_0x880e('0x1f')];this[_0x880e('0x20')]=_0x8c5979[_0x880e('0x20')];this[_0x880e('0x21')]=_0x8c5979[_0x880e('0x21')];this[_0x880e('0x22')]=_0x8c5979[_0x880e('0x22')];this[_0x880e('0x23')]=_0x8c5979[_0x880e('0x23')];this[_0x880e('0x24')]=_0x8c5979['ListId'];this['UserId']=_0x8c5979[_0x880e('0x25')];this['VoiceQueueId']=_0x8c5979[_0x880e('0x26')];this['CampaignId']=_0x8c5979[_0x880e('0x27')];}module[_0x880e('0x28')]=Hangup;
\ No newline at end of file
index 8a12555..670bc75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ce5=['countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry'];(function(_0x1dce33,_0x350e08){var _0x1fb0ef=function(_0x5125b6){while(--_0x5125b6){_0x1dce33['push'](_0x1dce33['shift']());}};_0x1fb0ef(++_0x350e08);}(_0x3ce5,0x1ef));var _0x53ce=function(_0x57015c,_0x5c1999){_0x57015c=_0x57015c-0x0;var _0x14bbe3=_0x3ce5[_0x57015c];return _0x14bbe3;};'use strict';var util=require(_0x53ce('0x0'));var _=require('lodash');var moment=require(_0x53ce('0x1'));function getSeconds(_0x1da472,_0xfeee1d){var _0x5de27d=moment(_0x1da472)[_0x53ce('0x2')](0x0);var _0x587ece=moment(_0xfeee1d)[_0x53ce('0x2')](0x0);return _0x5de27d[_0x53ce('0x3')](_0x587ece,_0x53ce('0x4'));}function History(_0xfdc1f3){this[_0x53ce('0x5')]=_0xfdc1f3[_0x53ce('0x5')];this[_0x53ce('0x6')]=_0xfdc1f3['scheduledat']||undefined;this[_0x53ce('0x7')]=_0xfdc1f3['type'];this[_0x53ce('0x8')]=_0xfdc1f3['type']==='outbound'?_0x53ce('0x9'):_0xfdc1f3[_0x53ce('0x7')];this['countbusyretry']=_0xfdc1f3[_0x53ce('0xa')];this[_0x53ce('0xb')]=_0xfdc1f3[_0x53ce('0xb')];this['countnoanswerretry']=_0xfdc1f3['countnoanswerretry'];this[_0x53ce('0xc')]=_0xfdc1f3[_0x53ce('0xa')]+_0xfdc1f3[_0x53ce('0xb')]+_0xfdc1f3[_0x53ce('0xd')]+_0xfdc1f3[_0x53ce('0xe')]+_0xfdc1f3[_0x53ce('0xf')]+_0xfdc1f3['countabandonedretry']+_0xfdc1f3[_0x53ce('0x10')]+_0xfdc1f3[_0x53ce('0x11')];this['countnosuchnumberretry']=_0xfdc1f3[_0x53ce('0xe')];this[_0x53ce('0xf')]=_0xfdc1f3['countdropretry'];this[_0x53ce('0x12')]=_0xfdc1f3['countabandonedretry'];this[_0x53ce('0x10')]=_0xfdc1f3[_0x53ce('0x10')];this[_0x53ce('0x11')]=_0xfdc1f3[_0x53ce('0x11')];this[_0x53ce('0x9')]=_0xfdc1f3[_0x53ce('0x9')];this[_0x53ce('0x13')]=_0xfdc1f3['name'];this[_0x53ce('0x14')]=_0xfdc1f3['number'];this['starttime']=_0xfdc1f3[_0x53ce('0x15')];this[_0x53ce('0x16')]=_0xfdc1f3[_0x53ce('0x16')];this[_0x53ce('0x17')]=_0xfdc1f3[_0x53ce('0x16')];this[_0x53ce('0x18')]=getSeconds(_0xfdc1f3[_0x53ce('0x16')],_0xfdc1f3['starttime']);this[_0x53ce('0x19')]=0x0;this[_0x53ce('0x1a')]=0x0;this[_0x53ce('0x1b')]=_0xfdc1f3['callback'];this[_0x53ce('0x1c')]=_0xfdc1f3[_0x53ce('0x1c')];this[_0x53ce('0x1d')]=_0xfdc1f3[_0x53ce('0x1d')];this[_0x53ce('0x1e')]=_0xfdc1f3[_0x53ce('0x1e')];this[_0x53ce('0x1f')]=_0xfdc1f3[_0x53ce('0x1f')];this[_0x53ce('0x20')]=_0xfdc1f3['ListId'];this[_0x53ce('0x21')]=_0xfdc1f3[_0x53ce('0x21')];this[_0x53ce('0x22')]=_0xfdc1f3[_0x53ce('0x22')];this[_0x53ce('0x23')]=_0xfdc1f3[_0x53ce('0x23')];this[_0x53ce('0x24')]=_0xfdc1f3[_0x53ce('0x24')]||'';this[_0x53ce('0x25')]=_0xfdc1f3[_0x53ce('0x25')]||'';}module[_0x53ce('0x26')]=History;
\ No newline at end of file
+var _0x2182=['number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','name','calleridnum'];(function(_0x4610c4,_0xf7c3bd){var _0x4607f7=function(_0x234880){while(--_0x234880){_0x4610c4['push'](_0x4610c4['shift']());}};_0x4607f7(++_0xf7c3bd);}(_0x2182,0xea));var _0x2218=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2182[_0x167cc1];return _0x10bc4b;};'use strict';var util=require(_0x2218('0x0'));var _=require(_0x2218('0x1'));var moment=require(_0x2218('0x2'));function getSeconds(_0x212e5b,_0x564b8e){var _0x41395e=moment(_0x212e5b)['milliseconds'](0x0);var _0x2fdb57=moment(_0x564b8e)[_0x2218('0x3')](0x0);return _0x41395e[_0x2218('0x4')](_0x2fdb57,_0x2218('0x5'));}function History(_0xf3271d){this[_0x2218('0x6')]=_0xf3271d[_0x2218('0x6')];this[_0x2218('0x7')]=_0xf3271d[_0x2218('0x7')]||undefined;this[_0x2218('0x8')]=_0xf3271d['type'];this[_0x2218('0x9')]=_0xf3271d[_0x2218('0x8')]===_0x2218('0xa')?_0x2218('0xb'):_0xf3271d['type'];this[_0x2218('0xc')]=_0xf3271d[_0x2218('0xc')];this[_0x2218('0xd')]=_0xf3271d[_0x2218('0xd')];this['countnoanswerretry']=_0xf3271d[_0x2218('0xe')];this[_0x2218('0xf')]=_0xf3271d[_0x2218('0xc')]+_0xf3271d[_0x2218('0xd')]+_0xf3271d[_0x2218('0xe')]+_0xf3271d['countnosuchnumberretry']+_0xf3271d[_0x2218('0x10')]+_0xf3271d['countabandonedretry']+_0xf3271d[_0x2218('0x11')]+_0xf3271d[_0x2218('0x12')];this[_0x2218('0x13')]=_0xf3271d[_0x2218('0x13')];this[_0x2218('0x10')]=_0xf3271d[_0x2218('0x10')];this[_0x2218('0x14')]=_0xf3271d[_0x2218('0x14')];this[_0x2218('0x11')]=_0xf3271d[_0x2218('0x11')];this[_0x2218('0x12')]=_0xf3271d[_0x2218('0x12')];this[_0x2218('0xb')]=_0xf3271d[_0x2218('0xb')];this[_0x2218('0x15')]=_0xf3271d[_0x2218('0x16')];this[_0x2218('0x17')]=_0xf3271d[_0x2218('0x18')];this[_0x2218('0x19')]=_0xf3271d[_0x2218('0x19')];this[_0x2218('0x1a')]=_0xf3271d['responsetime'];this[_0x2218('0x1b')]=_0xf3271d[_0x2218('0x1a')];this[_0x2218('0x1c')]=getSeconds(_0xf3271d[_0x2218('0x1a')],_0xf3271d[_0x2218('0x19')]);this[_0x2218('0x1d')]=0x0;this[_0x2218('0x1e')]=0x0;this[_0x2218('0x1f')]=_0xf3271d[_0x2218('0x1f')];this[_0x2218('0x20')]=_0xf3271d[_0x2218('0x20')];this[_0x2218('0x21')]=_0xf3271d[_0x2218('0x21')];this[_0x2218('0x22')]=_0xf3271d[_0x2218('0x22')];this[_0x2218('0x23')]=_0xf3271d[_0x2218('0x23')];this[_0x2218('0x24')]=_0xf3271d['ListId'];this[_0x2218('0x25')]=_0xf3271d[_0x2218('0x25')];this[_0x2218('0x26')]=_0xf3271d['VoiceQueueId'];this['CampaignId']=_0xf3271d[_0x2218('0x27')];this[_0x2218('0x28')]=_0xf3271d['originatecalleridnum']||'';this[_0x2218('0x29')]=_0xf3271d['originatecalleridname']||'';}module[_0x2218('0x2a')]=History;
\ No newline at end of file
index 59b7e4e..aa47e56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1a7=['countdropretry','dialGlobalMaxRetry','dialMachineRetryFrequency','ContactId','syncHangup','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','[syncHangupIvr][createHistory]','dialQueueProject','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','droptime','responsetime','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','preview','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','interval','indexOf','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','dialPreviewRecallmeReminder','\x5cw{0,','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','trim','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','busyFactor','[getDataPredictive]','Unknown\x20Predictive','abandonmentRate','[CatchErlangB]','agentBusyFactor','outboundQueuePauses','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./hangup','env','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','newexten','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','message','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','name','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','strategy','answered','pTalking','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','startPredictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','sendMessageOneNotActive','talking','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]'];(function(_0x4357e2,_0x15e627){var _0x5d8787=function(_0x4c4537){while(--_0x4c4537){_0x4357e2['push'](_0x4357e2['shift']());}};_0x5d8787(++_0x15e627);}(_0xc1a7,0x115));var _0x7c1a=function(_0x15b1ec,_0x15ee62){_0x15b1ec=_0x15b1ec-0x0;var _0x33320c=_0xc1a7[_0x15b1ec];return _0x33320c;};'use strict';var util=require(_0x7c1a('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x7c1a('0x1'));var moment=require(_0x7c1a('0x2'));var rr=require('rr');var md5=require(_0x7c1a('0x3'));var Redis=require(_0x7c1a('0x4'));var ut=require(_0x7c1a('0x5'));var config=require(_0x7c1a('0x6'));var logger=require(_0x7c1a('0x7'))('dialer');var loggerBooked=require(_0x7c1a('0x7'))(_0x7c1a('0x8'));var loggerPredictive=require(_0x7c1a('0x7'))(_0x7c1a('0x9'));var loggerPredictiveCalls=require(_0x7c1a('0x7'))(_0x7c1a('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x7c1a('0xb'));var ami=require(_0x7c1a('0xc'));config['redis']=_[_0x7c1a('0xd')](config[_0x7c1a('0xe')],{'host':_0x7c1a('0xf'),'port':0x18eb});var io=require(_0x7c1a('0x10'))(new Redis(config[_0x7c1a('0xe')]));var cmHopper=require(_0x7c1a('0x11'));var cmHopperHistory=require(_0x7c1a('0x12'));var cmHopperBlack=require(_0x7c1a('0x13'));var voiceQueueRt=require(_0x7c1a('0x14'));var RpcSetting=require(_0x7c1a('0x15'));var Action=require(_0x7c1a('0x16'));var History=require(_0x7c1a('0x17'));var Final=require(_0x7c1a('0x18'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x7c1a('0x19'));var ipAgi=process[_0x7c1a('0x1a')]['XCALLY_IP_AGI']||_0x7c1a('0x1b');var strategy={'rrmemory':_0x7c1a('0x1c'),'roundrobin':_0x7c1a('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x7c1a('0x1e')][_0x7c1a('0x1f')]=function(_0x1693fe){this[_0x7c1a('0x20')]=this[_0x7c1a('0x20')]?this[_0x7c1a('0x20')][_0x7c1a('0x21')](_0x1693fe):_0x1693fe();};function Dialer(_0x1e930f,_0x4929fa){this[_0x7c1a('0x22')]=new Sequence();this['preview']=_0x4929fa;this[_0x7c1a('0x23')]=_0x1e930f['voiceQueues'];this[_0x7c1a('0x24')]=_0x1e930f[_0x7c1a('0x24')];this[_0x7c1a('0x25')]=_0x1e930f[_0x7c1a('0x25')];this[_0x7c1a('0x26')]=_0x1e930f[_0x7c1a('0x26')];this[_0x7c1a('0x27')]=config[_0x7c1a('0x27')]||0x2;this[_0x7c1a('0x28')]={};this[_0x7c1a('0x29')]={};this[_0x7c1a('0x2a')]={};this[_0x7c1a('0x2b')]={};this[_0x7c1a('0x2c')]={};this['startPredictive']={};this[_0x7c1a('0x2d')]={};this[_0x7c1a('0x2e')]={};this[_0x7c1a('0x2f')]={};this[_0x7c1a('0x30')]={};ami['on'](_0x7c1a('0x31'),this['syncAgentConnect'][_0x7c1a('0x32')](this));ami['on'](_0x7c1a('0x33'),this[_0x7c1a('0x34')][_0x7c1a('0x32')](this));ami['on']('originateresponse',this[_0x7c1a('0x35')][_0x7c1a('0x32')](this));ami['on'](_0x7c1a('0x36'),this[_0x7c1a('0x37')][_0x7c1a('0x32')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x7c1a('0x32')](this));ami['on'](_0x7c1a('0x38'),this['syncHangup'][_0x7c1a('0x32')](this));ami['on'](_0x7c1a('0x39'),this[_0x7c1a('0x3a')][_0x7c1a('0x32')](this));ami['on']('varset',this['syncVarSet'][_0x7c1a('0x32')](this));ami['on'](_0x7c1a('0x3b'),this[_0x7c1a('0x3c')][_0x7c1a('0x32')](this));ami['on'](_0x7c1a('0x3d'),this[_0x7c1a('0x3e')][_0x7c1a('0x32')](this));this[_0x7c1a('0x3f')]();this[_0x7c1a('0x40')]();RpcSetting[_0x7c1a('0x41')]()[_0x7c1a('0x42')](function(_0x46ef9c){previewRecallmeReminderInterval=_0x46ef9c[_0x7c1a('0x43')];});}function isNotNull(_0x3b0f15){return _0x3b0f15!==null&&!_[_0x7c1a('0x44')](_0x3b0f15);}function checkIsLoggedIn(_0x3a1093,_0x41f45b){return function(){if(_0x41f45b<=0x0){_0x3a1093['message']=_0x7c1a('0x45');throw _0x3a1093['name']+_0x7c1a('0x46');}};}function isActive(_0x3782af){return _0x3782af;}function checkIsActive(_0xce88e9,_0x155b5b){return function(){if(!isActive(_0x155b5b)){_0xce88e9[_0x7c1a('0x47')]='NOT_ACTIVE';throw _0xce88e9['name']+_0x7c1a('0x48');}};}function checkInterval(_0x1e1daf){return function(){if(!isNotNull(_0x1e1daf[_0x7c1a('0x49')])){_0x1e1daf[_0x7c1a('0x47')]=_0x7c1a('0x4a');throw _0x1e1daf['name']+_0x7c1a('0x4b');}if(!isNotNull(_0x1e1daf[_0x7c1a('0x49')][_0x7c1a('0x4c')])){_0x1e1daf['message']=_0x7c1a('0x4a');throw _0x1e1daf[_0x7c1a('0x4d')]+_0x7c1a('0x4b');}if(!isNotNull(_[_0x7c1a('0x4e')](_0x1e1daf[_0x7c1a('0x49')]['Intervals']))){_0x1e1daf[_0x7c1a('0x47')]=_0x7c1a('0x4a');throw _0x1e1daf[_0x7c1a('0x4d')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x29902c,_0x289539,_0x1d50f6){return{'action':_0x29902c,'response':_0x289539,'message':_0x1d50f6,'stack':_0x1d50f6};}function myreject(_0x24bbe1){return function(_0x458161){return _0x24bbe1(msgResponse(_0x7c1a('0x4f'),_0x7c1a('0x50'),JSON['stringify'](_0x458161)));};}function getSeconds(_0x8a6b5f,_0x2cff4f){var _0x377711=moment(_0x8a6b5f)['milliseconds'](0x0);var _0xfd6077=moment(_0x2cff4f)[_0x7c1a('0x51')](0x0);return _0x377711[_0x7c1a('0x52')](_0xfd6077,_0x7c1a('0x53'));}function emit(_0xa688c0,_0x2d3f91,_0x3f1344){io['to'](_0xa688c0)[_0x7c1a('0x54')](_0x2d3f91,_0x3f1344);}function emitVoiceQueueSummary(_0x53e0b2){if(_0x53e0b2[_0x7c1a('0x55')]==='outbound'){var _0x39046c={'id':_0x53e0b2['id'],'name':_0x53e0b2[_0x7c1a('0x4d')],'strategy':_0x53e0b2[_0x7c1a('0x56')],'answered':_0x53e0b2[_0x7c1a('0x57')],'available':_0x53e0b2['available'],'loggedIn':_0x53e0b2['loggedIn'],'pTalking':_0x53e0b2[_0x7c1a('0x58')],'sumBillable':_0x53e0b2[_0x7c1a('0x59')],'sumDuration':_0x53e0b2[_0x7c1a('0x5a')],'sumHoldTime':_0x53e0b2[_0x7c1a('0x5b')]||0x0,'talking':_0x53e0b2['talking'],'total':_0x53e0b2['total'],'type':_0x53e0b2['type'],'unmanaged':_0x53e0b2[_0x7c1a('0x5c')],'abandoned':_0x53e0b2[_0x7c1a('0x5d')],'waiting':_0x53e0b2[_0x7c1a('0x5e')],'loggedInDb':_0x53e0b2[_0x7c1a('0x5f')],'dialActive':_0x53e0b2[_0x7c1a('0x60')],'dialMethod':_0x53e0b2[_0x7c1a('0x61')],'dialOriginateCallerIdName':_0x53e0b2[_0x7c1a('0x62')],'dialOriginateCallerIdNumber':_0x53e0b2[_0x7c1a('0x63')],'dialOriginateTimeout':_0x53e0b2['dialOriginateTimeout'],'dialPrefix':_0x53e0b2[_0x7c1a('0x64')],'outboundAnswerAgiCallsDay':_0x53e0b2[_0x7c1a('0x65')],'outboundAnswerCallsDay':_0x53e0b2[_0x7c1a('0x66')],'outboundBlacklistCallsDay':_0x53e0b2['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x53e0b2[_0x7c1a('0x67')],'outboundCongestionCallsDay':_0x53e0b2[_0x7c1a('0x68')],'outboundDropCallsDayACS':_0x53e0b2[_0x7c1a('0x69')],'outboundDropCallsDayCallersExit':_0x53e0b2['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x53e0b2[_0x7c1a('0x6a')],'outboundNoAnswerCallsDay':_0x53e0b2[_0x7c1a('0x6b')],'outboundNoSuchCallsDay':_0x53e0b2[_0x7c1a('0x6c')],'outboundOriginateFailureCallsDay':_0x53e0b2[_0x7c1a('0x6d')],'outboundReCallsDay':_0x53e0b2[_0x7c1a('0x6e')],'outboundRejectCallsDay':_0x53e0b2[_0x7c1a('0x6f')],'outboundUnknownCallsDay':_0x53e0b2[_0x7c1a('0x70')],'predictiveIntervalAnsweredCalls':_0x53e0b2[_0x7c1a('0x71')],'predictiveIntervalAvgHoldtime':_0x53e0b2[_0x7c1a('0x72')],'predictiveIntervalAvgTalktime':_0x53e0b2[_0x7c1a('0x73')],'predictiveIntervalDroppedCallsCallersExit':_0x53e0b2[_0x7c1a('0x74')],'predictiveIntervalDroppedCallsTimeout':_0x53e0b2[_0x7c1a('0x75')],'predictiveIntervalErlangCalls':_0x53e0b2[_0x7c1a('0x76')],'predictiveIntervalErlangCallsDroppedCalls':_0x53e0b2[_0x7c1a('0x77')],'predictiveIntervalHitRate':_0x53e0b2[_0x7c1a('0x78')],'predictiveIntervalMultiplicativeFactor':_0x53e0b2[_0x7c1a('0x79')],'predictiveIntervalPauses':_0x53e0b2[_0x7c1a('0x7a')],'predictiveIntervalAvailable':_0x53e0b2['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x53e0b2[_0x7c1a('0x7b')],'message':_0x53e0b2[_0x7c1a('0x47')],'originated':_0x53e0b2['originated'],'erlangCalls':_0x53e0b2[_0x7c1a('0x7c')],'erlangCallToSecond':_0x53e0b2[_0x7c1a('0x7d')],'erlangAbandonmentRate':_0x53e0b2[_0x7c1a('0x7e')],'erlangBusyFactor':_0x53e0b2[_0x7c1a('0x7f')],'startPredictive':_0x53e0b2['startPredictive'],'startProgressive':_0x53e0b2[_0x7c1a('0x2d')]};if(_0x53e0b2[_0x7c1a('0x80')]){_0x39046c[_0x7c1a('0x80')]={'id':_0x53e0b2[_0x7c1a('0x80')]['id'],'name':_0x53e0b2[_0x7c1a('0x80')][_0x7c1a('0x4d')],'active':_0x53e0b2[_0x7c1a('0x80')]['active'],'callerid':_0x53e0b2[_0x7c1a('0x80')]['callerid']};}if(_0x53e0b2[_0x7c1a('0x49')]){_0x39046c[_0x7c1a('0x49')]={'id':_0x53e0b2[_0x7c1a('0x49')]['id'],'name':_0x53e0b2[_0x7c1a('0x49')][_0x7c1a('0x4d')]};}var _0x40a81a=md5(JSON['stringify'](_0x39046c));if(_0x53e0b2[_0x7c1a('0x3')]!==_0x40a81a){_0x53e0b2['md5']=_0x40a81a;emit(util[_0x7c1a('0x81')](_0x7c1a('0x82'),_0x39046c[_0x7c1a('0x4d')]),_0x7c1a('0x83'),_0x39046c);}}}function emitCampaignSummary(_0x4aedfb){if(_0x4aedfb['type']===_0x7c1a('0x84')){emit(util['format'](_0x7c1a('0x85'),_0x4aedfb[_0x7c1a('0x4d')]),'campaign:save',_0x4aedfb);}}function checkGetDataPredictive(_0x2b4dcb){if(isNotNull(_0x2b4dcb)&&!_['isEmpty'](_0x2b4dcb)){loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x87'));loggerPredictive[_0x7c1a('0x86')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b4dcb[_0x7c1a('0x7b')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b4dcb['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x88'),_0x2b4dcb['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x89'),_0x2b4dcb['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x8a'),_0x2b4dcb[_0x7c1a('0x72')]);loggerPredictive[_0x7c1a('0x86')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b4dcb[_0x7c1a('0x73')]);loggerPredictive['info'](_0x7c1a('0x8b'));if(_0x2b4dcb[_0x7c1a('0x7b')]>0x0){if(!_['isUndefined'](_0x2b4dcb[_0x7c1a('0x73')])&&_0x2b4dcb['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x8c'));if(!_[_0x7c1a('0x44')](_0x2b4dcb[_0x7c1a('0x72')])&&_0x2b4dcb[_0x7c1a('0x72')]>0x0){return!![];}loggerPredictive[_0x7c1a('0x86')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x7c1a('0x86')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x8d'));}return![];}function mergeDataErlangB(_0x3554a9){return function(_0x59fa09){loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x8e'));loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x8f'),_0x59fa09[_0x7c1a('0x7c')]);loggerPredictive[_0x7c1a('0x86')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59fa09[_0x7c1a('0x7d')]);loggerPredictive['info'](_0x7c1a('0x90'),_0x59fa09[_0x7c1a('0x7e')]);loggerPredictive['info'](_0x7c1a('0x91'),_0x59fa09['erlangBusyFactor']);loggerPredictive['info'](_0x7c1a('0x90'),_0x59fa09[_0x7c1a('0x7e')]);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x8b'));_[_0x7c1a('0x92')](_0x3554a9,_0x59fa09);};}function getDiff(_0x17ee28){var _0xa22c73=moment()[_0x7c1a('0x51')](0x0);var _0xf35aef=moment(_0x17ee28)[_0x7c1a('0x51')](0x0);return _0xa22c73['diff'](_0xf35aef,_0x7c1a('0x53'));}function ifInterval(_0x307d5f,_0x1f65b7){if(_[_0x7c1a('0x44')](_0x1f65b7)){return![];}return getDiff(_0x1f65b7)<_0x307d5f*0x3c;}function freeVariablesPredictive(_0x13405b){if(isNotNull(_0x13405b)){if(!_['isUndefined'](_0x13405b[_0x7c1a('0x2d')])){_0x13405b['startProgressive']=undefined;loggerPredictive['info'](_0x13405b[_0x7c1a('0x4d')],_0x7c1a('0x93'));}if(!_['isUndefined'](_0x13405b['startPredictive'])){_0x13405b[_0x7c1a('0x94')]=undefined;loggerPredictive['info'](_0x13405b[_0x7c1a('0x4d')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x7c1a('0x44')](_0x13405b[_0x7c1a('0x95')])){clearInterval(_0x13405b[_0x7c1a('0x95')]);_0x13405b['handlePredictive']=undefined;loggerPredictive[_0x7c1a('0x86')](_0x13405b[_0x7c1a('0x4d')],_0x7c1a('0x96'));}}}function erlangb(_0x593731,_0x2f21a8){if(_0x2f21a8===0x0){return 0x0;}var _0x84ad64=0x1;for(var _0x1b48a3=0x1;_0x1b48a3<=_0x2f21a8;_0x1b48a3+=0x1){_0x84ad64=0x1+_0x84ad64*_0x1b48a3/_0x593731;}return 0x1/_0x84ad64;}function isVoiceQueueOutbound(_0x380b99){return _0x380b99===_0x7c1a('0x97');}function isNotPreview(_0x1008b8){return _0x1008b8!=='preview';}function isCampaignIvr(_0x21d784){return _0x21d784==='ivr';}function getCallerId(_0x48f8da,_0x4be030,_0x29ff2d){if(!_['isUndefined'](_0x29ff2d)&&typeof _0x29ff2d===_0x7c1a('0x98')&&!_[_0x7c1a('0x4e')](_0x29ff2d)){if(!_['isUndefined'](_0x4be030)&&typeof _0x4be030===_0x7c1a('0x98')&&!_[_0x7c1a('0x4e')](_0x4be030)){return util[_0x7c1a('0x81')](_0x7c1a('0x99'),_0x4be030,_0x29ff2d);}return util[_0x7c1a('0x81')](_0x7c1a('0x99'),_0x29ff2d,_0x29ff2d);}if(!_[_0x7c1a('0x44')](_0x48f8da)&&typeof _0x48f8da===_0x7c1a('0x98')&&!_[_0x7c1a('0x4e')](_0x48f8da)){return _0x48f8da;}return _0x7c1a('0x9a');}function loggerCatchQueueSummary(_0x5f3a21,_0x3a24f3){return function(_0x4f248c){freeVariablesPredictive(_0x3a24f3);emitVoiceQueueSummary(_0x3a24f3);emitCampaignSummary(_0x3a24f3);loggerSyncQueueSummary['error'](_0x5f3a21,util[_0x7c1a('0x9b')](_0x4f248c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2dbe88,_0x192999){return function(_0x46a93b){loggerPredictive[_0x7c1a('0x9c')](_0x192999[_0x7c1a('0x4d')],_0x2dbe88);loggerPredictive[_0x7c1a('0x9c')](_0x46a93b[_0x7c1a('0x9d')]);freeVariablesPredictive(_0x192999);};}function loggerCatch(_0x20b45a){return function(_0x3e5d36){logger[_0x7c1a('0x9c')](_0x20b45a,util['inspect'](_0x3e5d36,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2a8a49){return _0x2a8a49&&!_['isUndefined'](_0x2a8a49)&&_0x2a8a49[_0x7c1a('0x9e')]>0x0;}function decremetOriginate(_0x5f55b6){if(!_[_0x7c1a('0x44')](_0x5f55b6)&&_0x5f55b6!==null){if(typeof _0x5f55b6[_0x7c1a('0x9f')]!==_0x7c1a('0xa0')){if(_0x5f55b6[_0x7c1a('0x9f')]>0x0){_0x5f55b6['originated']-=0x1;}else{logger[_0x7c1a('0x9c')](_0x7c1a('0xa1'));}}}else{logger[_0x7c1a('0x9c')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0xe2e0cc,_0x2bfddc,_0xa3f794){if(_0x2bfddc>_0xa3f794){for(var _0x4dd11b=0x0;_0x4dd11b<_0x2bfddc-_0xa3f794;_0x4dd11b+=0x1){decremetOriginate(_0xe2e0cc);}}}function loggerGetContactDialer(_0x233e33,_0x27c643,_0x298b08){return function(_0x48990e){checkContactLowerLimitOriginate(_0x27c643,_0x298b08,0x0);logger['error'](_0x233e33,util[_0x7c1a('0x9b')](_0x48990e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2ce747){return function(_0x166341){if(isNotNull(_0x166341)&&isNotNull(_0x166341[0x0])){if(_0x166341[0x0][_0x7c1a('0xa2')]>0x0){_0x2ce747['message']='RESCHEDULED_CONTACTS';logger[_0x7c1a('0x86')]('[getContactDialer2][ReScheduled]'+_0x2ce747['name'],_0x166341[0x0][_0x7c1a('0xa2')],'contacts');}else{_0x2ce747['message']='AVAILABLE_CONTACTS_FINISHED';logger['info']('[getContactDialer2][Empty]'+_0x2ce747[_0x7c1a('0x4d')]);}}};}function notSendMessagesQueue(_0x19cdf9){if(_0x19cdf9[_0x7c1a('0xa3')]){freeVariablesPredictive(_0x19cdf9);if(_0x19cdf9[_0x7c1a('0x9f')]===0x0&&_0x19cdf9[_0x7c1a('0xa4')]===0x0&&_0x19cdf9[_0x7c1a('0x5e')]===0x0&&(_0x19cdf9['pTalking']||0x0)===0x0){_0x19cdf9[_0x7c1a('0xa3')]=![];_0x19cdf9[_0x7c1a('0xa5')]=0x0;_0x19cdf9[_0x7c1a('0x47')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x7c1a('0xa6'),_0x19cdf9['name'],_0x7c1a('0xa7'));}else{_0x19cdf9['message']=_0x7c1a('0xa8');loggerSyncQueueSummary['error'](_0x7c1a('0xa6'),_0x19cdf9[_0x7c1a('0x4d')],_0x7c1a('0xa9'));}emitVoiceQueueSummary(_0x19cdf9);}}function notSendMessagesCampaign(_0x2389c9){if(_0x2389c9[_0x7c1a('0xa3')]){if(_0x2389c9[_0x7c1a('0x9f')]===0x0){_0x2389c9['sendMessageOneNotActive']=![];_0x2389c9[_0x7c1a('0x47')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x7c1a('0x9c')](_0x7c1a('0xaa'),_0x2389c9[_0x7c1a('0x4d')],_0x7c1a('0xa7'));}else{_0x2389c9[_0x7c1a('0x47')]=_0x7c1a('0xa8');loggerSyncQueueSummary[_0x7c1a('0x9c')](_0x7c1a('0xaa'),_0x2389c9[_0x7c1a('0x4d')],_0x7c1a('0xa9'));}emitCampaignSummary(_0x2389c9);}}function createObjHistory(_0x36a22f,_0x5e65d1,_0x4d4618,_0x132316,_0x1c9700){_0x36a22f[_0x7c1a('0x47')]=_0x4d4618;var _0x599729=new Action(_0x36a22f,_0x5e65d1);var _0x13b189=new History(_0x599729);_0x13b189[_0x7c1a('0xab')]=_0x132316;_0x13b189['statedesc']=_0x1c9700;_0x13b189[_0x7c1a('0xac')]=_0x599729[_0x7c1a('0xad')];return _0x13b189;}Dialer['prototype'][_0x7c1a('0x40')]=function(){var _0x3b909e=this;setInterval(function(){_0x3b909e[_0x7c1a('0xae')](_0x3b909e['uniqueId'],_0x7c1a('0xaf'));_0x3b909e[_0x7c1a('0xae')](_0x3b909e[_0x7c1a('0x29')],_0x7c1a('0xb0'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x3fd8e7,_0x8c7076){var _0x25959b=this;for(var _0x3caca2 in _0x3fd8e7){if(typeof _0x3fd8e7[_0x3caca2]!==_0x7c1a('0xa0')){this['sequence'][_0x7c1a('0x1f')](function(){if(!_['isNil'](_0x3fd8e7[_0x3caca2])){return ami[_0x7c1a('0xb1')]({'action':'status','channel':_0x3fd8e7[_0x3caca2][_0x7c1a('0xb2')]})[_0x7c1a('0xb3')](function(_0x59b15c){if(_0x59b15c[_0x7c1a('0x47')]===_0x7c1a('0xb4')){setTimeout(function(){if(_0x3fd8e7[_0x3caca2]&&_0x3fd8e7[_0x3caca2][_0x7c1a('0x55')]!==_0x7c1a('0x84')){_0x25959b[_0x7c1a('0xb5')](_0x25959b[_0x7c1a('0x23')][_0x3fd8e7[_0x3caca2][_0x7c1a('0xb6')]]);logger[_0x7c1a('0x9c')](_0x7c1a('0xb7'),_0x8c7076,_0x3caca2,_0x3fd8e7[_0x3caca2][_0x7c1a('0xb6')]);delete _0x3fd8e7[_0x3caca2];}if(_0x3fd8e7[_0x3caca2]&&_0x3fd8e7[_0x3caca2][_0x7c1a('0x55')]===_0x7c1a('0x84')){_0x25959b[_0x7c1a('0xb5')](_0x25959b[_0x7c1a('0x24')][_0x3fd8e7[_0x3caca2][_0x7c1a('0xb6')]]);logger[_0x7c1a('0x9c')](_0x7c1a('0xb8'),_0x8c7076,_0x3caca2,_0x3fd8e7[_0x3caca2][_0x7c1a('0xb6')]);delete _0x3fd8e7[_0x3caca2];}},0x2328);}});}});}}};Dialer['prototype'][_0x7c1a('0xb9')]=function(_0xa43021){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopper[_0x7c1a('0xb9')](_0xa43021))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xbb')));};Dialer[_0x7c1a('0x1e')]['checkIsBlackList']=function(_0x46c95b){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopperBlack[_0x7c1a('0xbc')](_0x46c95b))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xbd')));};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xbe')]=function(_0x1ae836){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopperBlack[_0x7c1a('0xbe')](_0x1ae836))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xbf')));};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xc0')]=function(_0x13beae){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopperHistory[_0x7c1a('0xc1')](_0x13beae))['catch'](loggerCatch(_0x7c1a('0xc2')));};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xc3')]=function(_0x5b8e7b){return BPromise['resolve']()['then'](cmHopper[_0x7c1a('0xc3')](_0x5b8e7b))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xc4')));};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xc5')]=function(_0x4a1d99,_0x5f7716,_0x2a8fdd){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopper[_0x7c1a('0xc5')](_0x4a1d99,_0x5f7716,_0x2a8fdd))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xc6')));};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xc7')]=function(_0x19bb4a,_0x277a55,_0x22469c,_0x178bde,_0x470a37){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopper['getContactDialer'](_0x19bb4a,_0x277a55,_0x22469c,_0x178bde))[_0x7c1a('0xb3')](function(_0x2587bd){_0x470a37[_0x7c1a('0xc8')]-=_0x22469c;_0x470a37['temp']=_0x470a37[_0x7c1a('0xc8')]>0x0?_0x470a37['temp']:0x0;loggerCatch(_0x7c1a('0xc9'))(_0x2587bd);});};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xca')]=function(_0x11bf82,_0x25030e,_0x2be2ec,_0x27b94d){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopper[_0x7c1a('0xca')](_0x11bf82,_0x25030e,_0x2be2ec))[_0x7c1a('0xb3')](function(_0x102c09){_0x27b94d['temp']-=_0x25030e;_0x27b94d[_0x7c1a('0xc8')]=_0x27b94d['temp']>0x0?_0x27b94d[_0x7c1a('0xc8')]:0x0;loggerCatch(_0x7c1a('0xcb'))(_0x102c09);});};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xcc')]=function(_0x2f5399){return BPromise[_0x7c1a('0xba')]()['then'](voiceQueueRt[_0x7c1a('0xcc')](_0x2f5399))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xcd')));};Dialer['prototype'][_0x7c1a('0xce')]=function(_0x3d0bca){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopper['moveContactManagedDialer'](_0x3d0bca))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xcf')));};Dialer[_0x7c1a('0x1e')]['createHistory']=function(_0x181d14){return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopperHistory[_0x7c1a('0xd0')](_0x181d14))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xd1')));};Dialer['prototype'][_0x7c1a('0xb5')]=function(_0x486b17){if(!_[_0x7c1a('0x44')](_0x486b17)&&_0x486b17!==null){if(typeof _0x486b17[_0x7c1a('0x9f')]!==_0x7c1a('0xa0')){if(_0x486b17[_0x7c1a('0x9f')]>0x0){_0x486b17[_0x7c1a('0x9f')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x7c1a('0x9c')](_0x7c1a('0xd2'));}};Dialer[_0x7c1a('0x1e')]['loggerHandler']=function(_0x2f3c8f,_0x14311c){var _0x38f7a5=this;return function(_0x3ec7e9){_0x38f7a5[_0x7c1a('0xb5')](_0x14311c);logger['error'](_0x2f3c8f,util[_0x7c1a('0x9b')](_0x3ec7e9,{'showHidden':![],'depth':null}));};};Dialer[_0x7c1a('0x1e')]['emptyContact']=function(_0x404200,_0x58c078,_0x264d0d){var _0x4f264a={'state':0x19,'statedesc':_0x7c1a('0xd3')};this[_0x7c1a('0xb5')](_0x58c078);this[_0x7c1a('0xd4')](_[_0x7c1a('0x92')](_0x4f264a,_[_0x7c1a('0xd5')](_0x264d0d,['ContactId',_0x7c1a('0xd6'),_0x7c1a('0xd7'),_0x7c1a('0xd8'),_0x7c1a('0xd9')])),_0x7c1a('0xda'),_0x7c1a('0xdb'));logger[_0x7c1a('0x9c')](_0x404200);};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xdc')]=function(_0x167d4a){return _0x167d4a===_0x7c1a('0xdd');};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xde')]=function(_0x3021b8){return!_[_0x7c1a('0x44')](_0x3021b8)&&_0x3021b8&&!_['isUndefined'](_0x3021b8['name'])&&!_[_0x7c1a('0x44')](_0x3021b8[_0x7c1a('0xdf')])&&_0x3021b8[_0x7c1a('0xdf')]&&(this[_0x7c1a('0x26')][util[_0x7c1a('0x81')](_0x7c1a('0xe0'),_0x3021b8[_0x7c1a('0x4d')])][_0x7c1a('0xe1')]===_0x7c1a('0xe2')||this[_0x7c1a('0x26')][util[_0x7c1a('0x81')]('SIP/%s',_0x3021b8[_0x7c1a('0x4d')])][_0x7c1a('0xe1')]===_0x7c1a('0xe3'));};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xd4')]=function(_0x77776e,_0x709db1,_0x381618){this[_0x7c1a('0xd0')](_0x77776e)[_0x7c1a('0xb3')](loggerCatch(_0x709db1));this['moveContactManagedDialer'](_0x77776e)[_0x7c1a('0xb3')](loggerCatch(_0x381618));};Dialer[_0x7c1a('0x1e')][_0x7c1a('0xe4')]=function(_0x2a6344){var _0x11d327=this[_0x7c1a('0x2b')][_0x2a6344[_0x7c1a('0xe5')]];var _0x7b6c63;if(!_['isNil'](_0x2a6344)&&!_[_0x7c1a('0xe6')](_0x2a6344[_0x7c1a('0xe7')])&&!_[_0x7c1a('0xe6')](_0x2a6344[_0x7c1a('0xe7')][_0x7c1a('0xe8')])&&_0x2a6344[_0x7c1a('0xe9')]===_0x7c1a('0xea')&&_0x11d327){if(_0x11d327[_0x7c1a('0x55')]!==_0x7c1a('0x84')&&this[_0x7c1a('0x23')][_0x11d327['queue']][_0x7c1a('0xeb')]&&_0x2a6344[_0x7c1a('0xec')]===_0x7c1a('0xed')){delete this[_0x7c1a('0x2b')][_0x2a6344[_0x7c1a('0xe5')]];this[_0x7c1a('0xb5')](this[_0x7c1a('0x23')][_0x11d327[_0x7c1a('0xb6')]]);this[_0x7c1a('0x23')][_0x11d327[_0x7c1a('0xb6')]][_0x7c1a('0x66')]+=0x1;this[_0x7c1a('0x23')][_0x11d327[_0x7c1a('0xb6')]]['outboundAnswerAgiCallsDay']+=0x1;_0x7b6c63=new Hangup(_0x11d327,_0x2a6344);_0x7b6c63[_0x7c1a('0xab')]=0x12;_0x7b6c63[_0x7c1a('0xee')]=_0x7c1a('0xef');_0x7b6c63[_0x7c1a('0xf0')]=_0x7c1a('0xf1');ami[_0x7c1a('0x54')](_0x7c1a('0xf2'),ut[_0x7c1a('0xf3')](_0x7b6c63,_0x7c1a('0xf4')));this['saveInDb'](_0x7b6c63,_0x7c1a('0xf5'),_0x7c1a('0xf6'));}if(_0x11d327[_0x7c1a('0x55')]!==_0x7c1a('0x84')&&this[_0x7c1a('0x23')][_0x11d327[_0x7c1a('0xb6')]][_0x7c1a('0xeb')]&&_0x2a6344[_0x7c1a('0xec')]===_0x7c1a('0xf7')){var _0x40fe7c=this;return new BPromise(function(_0x32abc0,_0x29aa98){delete _0x40fe7c[_0x7c1a('0x2b')][_0x2a6344['uniqueid']];_0x40fe7c[_0x7c1a('0xb5')](_0x40fe7c['voiceQueues'][_0x11d327['queue']]);_0x40fe7c[_0x7c1a('0x23')][_0x11d327[_0x7c1a('0xb6')]][_0x7c1a('0x66')]+=0x1;_0x40fe7c[_0x7c1a('0x23')][_0x11d327[_0x7c1a('0xb6')]][_0x7c1a('0x65')]+=0x1;var _0x2f8f62=_0x40fe7c[_0x7c1a('0x23')][_0x11d327[_0x7c1a('0xb6')]];var _0x2eb784=new Hangup(_0x11d327,_0x2a6344);_0x2eb784['state']=0x13;_0x2eb784[_0x7c1a('0xee')]=_0x7c1a('0xf8');_0x2eb784[_0x7c1a('0xf0')]=_0x7c1a('0xf1');_0x2eb784['countmachineretry']+=0x1;_0x2eb784[_0x7c1a('0xf9')]+=0x1;_0x2eb784[_0x7c1a('0xf4')]=!![];ami[_0x7c1a('0x54')](_0x7c1a('0xf2'),ut[_0x7c1a('0xf3')](_0x2eb784,_0x7c1a('0xf4')));_0x40fe7c[_0x7c1a('0xd0')](_0x2eb784)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xfa')));if(_0x2eb784[_0x7c1a('0xfb')]+_0x2eb784[_0x7c1a('0xfc')]+_0x2eb784[_0x7c1a('0xfd')]+_0x2eb784[_0x7c1a('0xfe')]+_0x2eb784['countdropretry']+_0x2eb784[_0x7c1a('0xff')]+_0x2eb784[_0x7c1a('0x100')]+_0x2eb784[_0x7c1a('0x101')]>=_0x2f8f62['dialGlobalMaxRetry']){_0x40fe7c[_0x7c1a('0x102')](_0x2eb784,_0x32abc0,_0x29aa98,_0x7c1a('0x103'));}else{if(_0x2eb784['countmachineretry']>=_0x2f8f62[_0x7c1a('0x104')]){_0x40fe7c[_0x7c1a('0x105')](_0x2eb784,_0x32abc0,_0x29aa98,_0x7c1a('0x106'));}else{_0x40fe7c[_0x7c1a('0xc3')]({'active':![],'countmachineretry':_0x2eb784[_0x7c1a('0x100')],'scheduledat':moment()[_0x7c1a('0x107')](_0x2f8f62['dialMachineRetryFrequency'],_0x7c1a('0x108'))[_0x7c1a('0x81')](_0x7c1a('0x109')),'ContactId':_0x2eb784['ContactId'],'ListId':_0x2eb784[_0x7c1a('0xd6')],'VoiceQueueId':_0x2eb784[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x2eb784['CampaignId']||undefined})['catch'](loggerCatch(_0x7c1a('0x10a')));_0x32abc0({'reschedule':0x1});}}});}if(_0x11d327[_0x7c1a('0x55')]===_0x7c1a('0x84')&&this[_0x7c1a('0x24')][_0x11d327[_0x7c1a('0xb6')]][_0x7c1a('0xeb')]&&_0x2a6344[_0x7c1a('0xec')]===_0x7c1a('0xed')){delete this[_0x7c1a('0x2b')][_0x2a6344[_0x7c1a('0xe5')]];this[_0x7c1a('0xb5')](this[_0x7c1a('0x24')][_0x11d327['queue']]);_0x7b6c63=new Hangup(_0x11d327,_0x2a6344);_0x7b6c63[_0x7c1a('0xab')]=0x12;_0x7b6c63[_0x7c1a('0xee')]=_0x7c1a('0xef');_0x7b6c63[_0x7c1a('0xf0')]='AMD';ami[_0x7c1a('0x54')](_0x7c1a('0xf2'),ut[_0x7c1a('0xf3')](_0x7b6c63,_0x7c1a('0xf4')));this[_0x7c1a('0xd4')](_0x7b6c63,_0x7c1a('0x10b'),_0x7c1a('0x10c'));}if(_0x11d327[_0x7c1a('0x55')]===_0x7c1a('0x84')&&this['campaigns'][_0x11d327[_0x7c1a('0xb6')]]['dialAMDActive']&&_0x2a6344[_0x7c1a('0xec')]===_0x7c1a('0xf7')){var _0x40fe7c=this;return new BPromise(function(_0x1b2a69,_0x590ecd){delete _0x40fe7c[_0x7c1a('0x2b')][_0x2a6344[_0x7c1a('0xe5')]];_0x40fe7c[_0x7c1a('0xb5')](_0x40fe7c['campaigns'][_0x11d327[_0x7c1a('0xb6')]]);_0x40fe7c[_0x7c1a('0x24')][_0x11d327[_0x7c1a('0xb6')]]['outboundAnswerCallsDay']+=0x1;_0x40fe7c[_0x7c1a('0x24')][_0x11d327['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x3cd1d8=_0x40fe7c[_0x7c1a('0x24')][_0x11d327[_0x7c1a('0xb6')]];var _0x7bfd1e=new Hangup(_0x11d327,_0x2a6344);_0x7bfd1e[_0x7c1a('0xab')]=0x13;_0x7bfd1e[_0x7c1a('0xee')]='Machine';_0x7bfd1e[_0x7c1a('0xf0')]=_0x7c1a('0xf1');_0x7bfd1e[_0x7c1a('0x100')]+=0x1;_0x7bfd1e[_0x7c1a('0xf9')]+=0x1;_0x7bfd1e[_0x7c1a('0xf4')]=!![];ami['emit'](_0x7c1a('0xf2'),ut[_0x7c1a('0xf3')](_0x7bfd1e,_0x7c1a('0xf4')));_0x40fe7c[_0x7c1a('0xd0')](_0x7bfd1e)['catch'](loggerCatch(_0x7c1a('0xfa')));if(_0x7bfd1e['countbusyretry']+_0x7bfd1e[_0x7c1a('0xfc')]+_0x7bfd1e[_0x7c1a('0xfd')]+_0x7bfd1e[_0x7c1a('0xfe')]+_0x7bfd1e[_0x7c1a('0x10d')]+_0x7bfd1e['countabandonedretry']+_0x7bfd1e[_0x7c1a('0x100')]+_0x7bfd1e[_0x7c1a('0x101')]>=_0x3cd1d8[_0x7c1a('0x10e')]){_0x40fe7c[_0x7c1a('0x102')](_0x7bfd1e,_0x1b2a69,_0x590ecd,_0x7c1a('0x103'));}else{if(_0x7bfd1e[_0x7c1a('0x100')]>=_0x3cd1d8[_0x7c1a('0x104')]){_0x40fe7c[_0x7c1a('0x105')](_0x7bfd1e,_0x1b2a69,_0x590ecd,_0x7c1a('0x106'));}else{_0x40fe7c[_0x7c1a('0xc3')]({'active':![],'countmachineretry':_0x7bfd1e[_0x7c1a('0x100')],'scheduledat':moment()[_0x7c1a('0x107')](_0x3cd1d8[_0x7c1a('0x10f')],_0x7c1a('0x108'))[_0x7c1a('0x81')](_0x7c1a('0x109')),'ContactId':_0x7bfd1e[_0x7c1a('0x110')],'ListId':_0x7bfd1e['ListId'],'VoiceQueueId':_0x7bfd1e[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x7bfd1e[_0x7c1a('0xd9')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1b2a69({'reschedule':0x1});}}});}}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x111')]=function(_0x1f6530){var _0x94c17c=this['uniqueId'][_0x1f6530[_0x7c1a('0xe5')]];var _0x28b24e=this;var _0x453706;if(_0x94c17c&&_0x94c17c[_0x7c1a('0x55')]==='ivr'){delete this[_0x7c1a('0x2b')][_0x1f6530['uniqueid']];this['updateOriginated'](this[_0x7c1a('0x24')][_0x94c17c[_0x7c1a('0xb6')]]);this['campaigns'][_0x94c17c[_0x7c1a('0xb6')]][_0x7c1a('0x112')]+=0x1;_0x453706=new Hangup(_0x94c17c,_0x1f6530);this[_0x7c1a('0xd0')](_0x453706)[_0x7c1a('0xb3')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x453706)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x113')));}if(_0x94c17c&&_0x94c17c[_0x7c1a('0x55')]!==_0x7c1a('0x84')&&isNotNull(this[_0x7c1a('0x23')][_0x94c17c[_0x7c1a('0xb6')]]['dialQueueProject'])){delete this['uniqueId'][_0x1f6530[_0x7c1a('0xe5')]];this['updateOriginated'](this[_0x7c1a('0x23')][_0x94c17c[_0x7c1a('0xb6')]]);this['voiceQueues'][_0x94c17c[_0x7c1a('0xb6')]][_0x7c1a('0x66')]+=0x1;this[_0x7c1a('0x23')][_0x94c17c[_0x7c1a('0xb6')]][_0x7c1a('0x65')]+=0x1;_0x453706=new Hangup(_0x94c17c,_0x1f6530);_0x453706[_0x7c1a('0xab')]=0x10;_0x453706[_0x7c1a('0xee')]=_0x7c1a('0x114');_0x453706['membername']='AGI';this['createHistory'](_0x453706)['catch'](loggerCatch(_0x7c1a('0x115')));this[_0x7c1a('0xce')](_0x453706)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x113')));}if(_0x94c17c&&_0x94c17c[_0x7c1a('0x55')]!==_0x7c1a('0x84')&&!isNotNull(this['voiceQueues'][_0x94c17c['queue']][_0x7c1a('0x116')])){delete this['uniqueId'][_0x1f6530['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x94c17c[_0x7c1a('0xb6')]]);this[_0x7c1a('0x23')][_0x94c17c[_0x7c1a('0xb6')]][_0x7c1a('0x70')]+=0x1;_0x453706=new Hangup(_0x94c17c,_0x1f6530);_0x453706['state']=0xc;_0x453706[_0x7c1a('0xee')]=_0x1f6530[_0x7c1a('0x117')];_0x453706[_0x7c1a('0xf0')]=_0x7c1a('0x118');this[_0x7c1a('0xd0')](_0x453706)['catch'](loggerCatch(_0x7c1a('0x115')));this['moveContactManagedDialer'](_0x453706)['catch'](loggerCatch(_0x7c1a('0x113')));}};Dialer[_0x7c1a('0x1e')]['syncAgentComplete']=function(_0x1f539c){var _0x44ddf3=this[_0x7c1a('0x2b')][_0x1f539c[_0x7c1a('0xe5')]];var _0x15d7ac=this;if(this[_0x7c1a('0x23')][_0x1f539c[_0x7c1a('0xb6')]]){if(_0x44ddf3&&_0x44ddf3['type']!==_0x7c1a('0x84')){delete this[_0x7c1a('0x2b')][_0x1f539c[_0x7c1a('0xe5')]];this[_0x7c1a('0x23')][_0x1f539c[_0x7c1a('0xb6')]]['outboundAnswerCallsDay']+=0x1;var _0x3da805=new AgentComplete(_0x44ddf3,_0x1f539c);if(_0x1f539c[_0x7c1a('0x119')]===_0x7c1a('0x11a')){_0x3da805[_0x7c1a('0x11b')]=this[_0x7c1a('0x23')][_0x1f539c['queue']][_0x7c1a('0x11c')]&&this['voiceQueues'][_0x1f539c[_0x7c1a('0xb6')]][_0x7c1a('0x11d')]?moment()[_0x7c1a('0x81')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x7c1a('0xd0')](_0x3da805)[_0x7c1a('0xb3')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x7c1a('0xce')](_0x3da805)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x11e')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x55a6e2){if(this[_0x7c1a('0x23')][_0x55a6e2[_0x7c1a('0xb6')]]){if(this[_0x7c1a('0x2b')][_0x55a6e2[_0x7c1a('0xe5')]]&&this[_0x7c1a('0x2b')][_0x55a6e2['uniqueid']][_0x7c1a('0x55')]!==_0x7c1a('0x84')){this[_0x7c1a('0xb5')](this['voiceQueues'][_0x55a6e2['queue']]);this[_0x7c1a('0x2b')][_0x55a6e2[_0x7c1a('0xe5')]][_0x7c1a('0x11f')]=moment()[_0x7c1a('0x81')](_0x7c1a('0x109'));}}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x120')]=function(_0x2cff6c){this[_0x7c1a('0xd0')](_0x2cff6c)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x121')));this[_0x7c1a('0xce')](_0x2cff6c)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x7c1a('0x1e')]['syncQueueCallerAbandon']=function(_0x3f224c){var _0x105035=this[_0x7c1a('0x2b')][_0x3f224c[_0x7c1a('0xe5')]];var _0x3e8585=this;if(this[_0x7c1a('0x23')][_0x3f224c[_0x7c1a('0xb6')]]){if(_0x105035&&_0x105035['type']!==_0x7c1a('0x84')){delete this[_0x7c1a('0x2b')][_0x3f224c['uniqueid']];this[_0x7c1a('0xb5')](this[_0x7c1a('0x23')][_0x3f224c[_0x7c1a('0xb6')]]);_0x105035[_0x7c1a('0x122')]=moment()['format'](_0x7c1a('0x109'));var _0xcd25ee=new QueueCallerAbandon(_0x105035,_0x3f224c);if(getSeconds(_0x105035['droptime'],_0x105035[_0x7c1a('0x123')])>=_0x105035['dialQueueTimeout']){this[_0x7c1a('0x23')][_0x3f224c[_0x7c1a('0xb6')]][_0x7c1a('0x75')]+=0x1;this[_0x7c1a('0x23')][_0x3f224c[_0x7c1a('0xb6')]][_0x7c1a('0x6a')]+=0x1;this[_0x7c1a('0x23')][_0x3f224c[_0x7c1a('0xb6')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xcd25ee[_0x7c1a('0xab')]=0xa;_0xcd25ee[_0x7c1a('0xee')]='Drop';_0xcd25ee['dropreason']='TIMEOUT';_0xcd25ee[_0x7c1a('0x11b')]=this[_0x7c1a('0x23')][_0x3f224c['queue']][_0x7c1a('0x11c')]?moment()['format'](_0x7c1a('0x109')):undefined;_0xcd25ee['countdropretry']+=0x1;_0xcd25ee[_0x7c1a('0xf9')]+=0x1;if(_0xcd25ee['countdropretry']>=this['voiceQueues'][_0x3f224c[_0x7c1a('0xb6')]][_0x7c1a('0x124')]){this[_0x7c1a('0x120')](_0xcd25ee);}else{this['rescheduleContact']({'active':![],'countdropretry':_0xcd25ee[_0x7c1a('0x10d')],'scheduledat':moment()[_0x7c1a('0x107')](this['voiceQueues'][_0x3f224c[_0x7c1a('0xb6')]][_0x7c1a('0x125')],_0x7c1a('0x108'))[_0x7c1a('0x81')](_0x7c1a('0x109')),'ContactId':_0x105035[_0x7c1a('0x110')],'ListId':_0x105035[_0x7c1a('0xd6')],'VoiceQueueId':_0x105035[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x105035[_0x7c1a('0xd9')]||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x126')));var _0xcbf78d=new History(_0xcd25ee);_0xcbf78d[_0x7c1a('0xab')]=0xa;_0xcbf78d[_0x7c1a('0xee')]=_0x7c1a('0x127');_0xcbf78d[_0x7c1a('0xad')]=moment()['format'](_0x7c1a('0x109'));_0xcbf78d[_0x7c1a('0xac')]=_0xcbf78d[_0x7c1a('0xad')];_0xcbf78d[_0x7c1a('0x128')]=_0xcd25ee[_0x7c1a('0x128')];_0xcbf78d[_0x7c1a('0x129')]=_0xcd25ee[_0x7c1a('0x129')];this[_0x7c1a('0xd0')](_0xcbf78d)[_0x7c1a('0xb3')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x7c1a('0x23')][_0x3f224c[_0x7c1a('0xb6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x7c1a('0x23')][_0x3f224c[_0x7c1a('0xb6')]]['outboundDropCallsDayCallersExit']+=0x1;_0xcd25ee['state']=0xb;_0xcd25ee[_0x7c1a('0xee')]=_0x7c1a('0x12a');_0xcd25ee[_0x7c1a('0x12b')]=_0x7c1a('0x12c');_0xcd25ee[_0x7c1a('0xff')]+=0x1;_0xcd25ee['countglobal']+=0x1;if(_0xcd25ee['countabandonedretry']>=this[_0x7c1a('0x23')][_0x3f224c[_0x7c1a('0xb6')]][_0x7c1a('0x12d')]){this['queueCallerAbandonCreateState'](_0xcd25ee);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0xcd25ee[_0x7c1a('0xff')],'scheduledat':moment()[_0x7c1a('0x107')](this[_0x7c1a('0x23')][_0x3f224c['queue']][_0x7c1a('0x12e')],_0x7c1a('0x108'))[_0x7c1a('0x81')](_0x7c1a('0x109')),'ContactId':_0x105035[_0x7c1a('0x110')],'ListId':_0x105035[_0x7c1a('0xd6')],'VoiceQueueId':_0x105035[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x105035[_0x7c1a('0xd9')]||undefined})['catch'](loggerCatch(_0x7c1a('0x12f')));var _0xcbf78d=new History(_0xcd25ee);_0xcbf78d[_0x7c1a('0xab')]=0xb;_0xcbf78d['statedesc']=_0x7c1a('0x12a');_0xcbf78d[_0x7c1a('0xad')]=moment()[_0x7c1a('0x81')](_0x7c1a('0x109'));_0xcbf78d['endtime']=_0xcbf78d[_0x7c1a('0xad')];_0xcbf78d[_0x7c1a('0x128')]=_0xcd25ee[_0x7c1a('0x128')];_0xcbf78d['calleridnum']=_0xcd25ee[_0x7c1a('0x129')];this['createHistory'](_0xcbf78d)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x130')));}}}}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x3a')]=function(_0x4c1a4f){if(this['actions'][_0x4c1a4f[_0x7c1a('0xe5')]]){this[_0x7c1a('0x29')][_0x4c1a4f[_0x7c1a('0xe5')]]['channel']=_0x4c1a4f['channel'];}if(this['uniqueId'][_0x4c1a4f['uniqueid']]){this[_0x7c1a('0x2b')][_0x4c1a4f['uniqueid']]['channel']=_0x4c1a4f[_0x7c1a('0xb2')];}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x3c')]=function(_0x3102ad){if(strategy[this['voiceQueues'][this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]['strategy']]==='roundrobin'){if(this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]]&&_['isNil'](this[_0x7c1a('0x29')][_0x3102ad['actionid']][_0x7c1a('0x132')])&&_0x3102ad[_0x7c1a('0xe1')]==='1'&&_0x3102ad[_0x7c1a('0x133')]==='0'){if(this[_0x7c1a('0x25')][_0x3102ad[_0x7c1a('0x134')]]){if(!this['agents'][_0x3102ad[_0x7c1a('0x134')]][_0x7c1a('0x132')]){this['agents'][_0x3102ad[_0x7c1a('0x134')]][_0x7c1a('0x132')]=!![];this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]][_0x7c1a('0x132')]=!![];this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]][_0x7c1a('0x134')]=_0x3102ad[_0x7c1a('0x134')];}}}}else if((strategy[this[_0x7c1a('0x23')][this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]][_0x7c1a('0xb6')]][_0x7c1a('0x56')]]||_0x7c1a('0x1c'))===_0x7c1a('0x1c')){if(this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]]){if(this[_0x7c1a('0x25')][_0x3102ad[_0x7c1a('0x134')]]){this[_0x7c1a('0x29')][_0x3102ad['actionid']][_0x7c1a('0x134')]=_0x3102ad['stateinterface'];if(_[_0x7c1a('0xe6')](this[_0x7c1a('0x2f')][this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]]['queue']])){this[_0x7c1a('0x2f')][this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]=[];}this[_0x7c1a('0x2f')][this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]][_0x7c1a('0xb6')]][_0x7c1a('0x135')](_[_0x7c1a('0x92')](_[_0x7c1a('0xd5')](this[_0x7c1a('0x29')][_0x3102ad[_0x7c1a('0x131')]],[_0x7c1a('0x136'),_0x7c1a('0x134')]),{'status':_0x3102ad['status'],'paused':_0x3102ad[_0x7c1a('0x133')]}));}}}};function unlockQueueStatus(_0x5b65b7,_0x49a829){setTimeout(function(){if(_['isUndefined'](_0x5b65b7[_0x7c1a('0x137')])){loggerBooked[_0x7c1a('0x9c')](_0x7c1a('0x138'),_0x49a829);}_0x5b65b7[_0x7c1a('0x137')]=!![];loggerBooked[_0x7c1a('0x86')](_0x7c1a('0x139'),_0x49a829,JSON[_0x7c1a('0x13a')](_[_0x7c1a('0xd5')](_0x5b65b7,[_0x7c1a('0x4d'),_0x7c1a('0x137')])));},0x1f3);}Dialer['prototype'][_0x7c1a('0x3e')]=function(_0x338a6b){var _0x55bb6b=this;var _0x391bc0=_0x55bb6b['voiceQueues'][_0x55bb6b['actions'][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]];if(strategy[this[_0x7c1a('0x23')][this['actions'][_0x338a6b['actionid']][_0x7c1a('0xb6')]][_0x7c1a('0x56')]]==='roundrobin'){if(this['actions'][_0x338a6b[_0x7c1a('0x131')]]&&this['actions'][_0x338a6b['actionid']][_0x7c1a('0x134')]){this['preview'][_0x7c1a('0x13b')](this['actions'][_0x338a6b[_0x7c1a('0x131')]]['idHopper'],this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]]['stateinterface'])[_0x7c1a('0xb3')](function(_0xd1917f){logger[_0x7c1a('0x9c')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x7c1a('0x9b')](_0xd1917f,{'showHidden':![],'depth':null}));})['finally'](function(){_0x55bb6b[_0x7c1a('0xb5')](_0x55bb6b[_0x7c1a('0x23')][_0x55bb6b[_0x7c1a('0x29')][_0x338a6b['actionid']][_0x7c1a('0xb6')]]);_0x55bb6b[_0x7c1a('0x25')][_0x55bb6b['actions'][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0x134')]]['locked']=![];delete _0x55bb6b[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]];unlockQueueStatus(_0x391bc0);});}else{this[_0x7c1a('0xb5')](this['voiceQueues'][this['actions'][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]);this[_0x7c1a('0xc3')]({'active':![],'ContactId':this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]]['ContactId'],'ListId':this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]]['ListId'],'VoiceQueueId':this['actions'][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xd8')]||undefined,'CampaignId':this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]]['CampaignId']||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x13c')));delete this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]];unlockQueueStatus(_0x391bc0);}}else if((strategy[this['voiceQueues'][this['actions'][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]][_0x7c1a('0x56')]]||_0x7c1a('0x1c'))==='rrmemory'){var _0x5d99e0;if(this[_0x7c1a('0x29')][_0x338a6b['actionid']]&&!_['isEmpty'](this[_0x7c1a('0x2f')][this['actions'][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]])){if(this['queueBookedRR'][_0x55bb6b[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]){this['queueBookedRR'][_0x55bb6b[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]=this[_0x7c1a('0x30')][this['actions'][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]?this[_0x7c1a('0x30')][this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]:this[_0x7c1a('0x2f')][this[_0x7c1a('0x29')][_0x338a6b['actionid']][_0x7c1a('0xb6')]]?this[_0x7c1a('0x2f')][this['actions'][_0x338a6b[_0x7c1a('0x131')]]['queue']]['_rr']||0x0:0x0;}this['queueBooked'][this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]]['queue']][_0x7c1a('0x13d')]=this[_0x7c1a('0x30')][this['actions'][_0x338a6b['actionid']][_0x7c1a('0xb6')]];for(var _0x1715e2=0x0;_0x1715e2<this[_0x7c1a('0x2f')][this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]][_0x7c1a('0x9e')];_0x1715e2+=0x1){_0x5d99e0=rr(this['queueBooked'][this['actions'][_0x338a6b['actionid']]['queue']]);this['queueBookedRR'][_0x55bb6b[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]=this['queueBooked'][this[_0x7c1a('0x29')][_0x338a6b['actionid']][_0x7c1a('0xb6')]][_0x7c1a('0x13d')];if(_0x5d99e0['status']==='1'&&_0x5d99e0[_0x7c1a('0x133')]==='0'){break;}}if(!_[_0x7c1a('0xe6')](_0x5d99e0)){this[_0x7c1a('0x25')][_0x5d99e0[_0x7c1a('0x134')]][_0x7c1a('0x13e')]=_[_0x7c1a('0x44')](this[_0x7c1a('0x25')][_0x5d99e0['stateinterface']][_0x7c1a('0x13e')])?!![]:this[_0x7c1a('0x25')][_0x5d99e0[_0x7c1a('0x134')]][_0x7c1a('0x13e')];}loggerBooked[_0x7c1a('0x86')](_0x7c1a('0x13f'),_0x338a6b[_0x7c1a('0x131')],_0x7c1a('0x140'),JSON[_0x7c1a('0x13a')](_[_0x7c1a('0xd5')](this['agents'][_0x5d99e0['stateinterface']],['name',_0x7c1a('0x13e')])),'contactAgent-idHopper:\x20',JSON[_0x7c1a('0x13a')](_0x5d99e0[_0x7c1a('0x136')]));if(!_[_0x7c1a('0xe6')](_0x5d99e0)&&_0x5d99e0[_0x7c1a('0xe1')]==='1'&&_0x5d99e0[_0x7c1a('0x133')]==='0'&&this[_0x7c1a('0x25')][_0x5d99e0['stateinterface']][_0x7c1a('0x13e')]){this[_0x7c1a('0x25')][_0x5d99e0[_0x7c1a('0x134')]][_0x7c1a('0x13e')]=![];this[_0x7c1a('0x2f')][_0x55bb6b[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]=[];this[_0x7c1a('0x141')][_0x7c1a('0x13b')](_0x5d99e0[_0x7c1a('0x136')],_0x5d99e0[_0x7c1a('0x134')])[_0x7c1a('0xb3')](function(_0x5ab177){logger[_0x7c1a('0x9c')](_0x7c1a('0x142'),util[_0x7c1a('0x9b')](_0x5ab177,{'showHidden':![],'depth':null}));})[_0x7c1a('0x21')](function(){_0x55bb6b[_0x7c1a('0xb5')](_0x55bb6b['voiceQueues'][_0x55bb6b['actions'][_0x338a6b[_0x7c1a('0x131')]]['queue']]);setTimeout(function(){_0x55bb6b[_0x7c1a('0x25')][_0x5d99e0[_0x7c1a('0x134')]][_0x7c1a('0x13e')]=!![];loggerBooked[_0x7c1a('0x86')](_0x7c1a('0x143'),_0x338a6b[_0x7c1a('0x131')],_0x7c1a('0x140'),JSON[_0x7c1a('0x13a')](_[_0x7c1a('0xd5')](_0x55bb6b[_0x7c1a('0x25')][_0x5d99e0[_0x7c1a('0x134')]],['name','unlockRR'])),_0x7c1a('0x144'),JSON[_0x7c1a('0x13a')](_0x5d99e0[_0x7c1a('0x136')]));},0xc7);delete _0x55bb6b[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]];unlockQueueStatus(_0x391bc0,_0x338a6b[_0x7c1a('0x131')]);});}else{loggerBooked[_0x7c1a('0x86')](_0x7c1a('0x145'));this[_0x7c1a('0xb5')](this['voiceQueues'][this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x7c1a('0x29')][_0x338a6b['actionid']]['ContactId'],'ListId':this[_0x7c1a('0x29')][_0x338a6b['actionid']][_0x7c1a('0xd6')],'VoiceQueueId':this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xd8')]||undefined,'CampaignId':this['actions'][_0x338a6b['actionid']][_0x7c1a('0xd9')]||undefined})['catch'](loggerCatch(_0x7c1a('0x13c')));delete this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]];unlockQueueStatus(_0x391bc0);}}else{loggerBooked[_0x7c1a('0x86')](_0x7c1a('0x146'));this[_0x7c1a('0xb5')](this[_0x7c1a('0x23')][this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xb6')]]);this[_0x7c1a('0xc3')]({'active':![],'ContactId':this['actions'][_0x338a6b['actionid']][_0x7c1a('0x110')],'ListId':this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xd6')],'VoiceQueueId':this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x7c1a('0x29')][_0x338a6b['actionid']]['CampaignId']||undefined})[_0x7c1a('0xb3')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this['actions'][_0x338a6b[_0x7c1a('0x131')]];unlockQueueStatus(_0x391bc0);}}else{loggerBooked[_0x7c1a('0x86')](_0x7c1a('0x147'));this[_0x7c1a('0xb5')](this[_0x7c1a('0x23')][this['actions'][_0x338a6b[_0x7c1a('0x131')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x7c1a('0x29')][_0x338a6b['actionid']][_0x7c1a('0x110')],'ListId':this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xd6')],'VoiceQueueId':this['actions'][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xd8')]||undefined,'CampaignId':this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]][_0x7c1a('0xd9')]||undefined})['catch'](loggerCatch(_0x7c1a('0x148')));delete this[_0x7c1a('0x29')][_0x338a6b[_0x7c1a('0x131')]];unlockQueueStatus(_0x391bc0);}};Dialer['prototype'][_0x7c1a('0x3f')]=function(){var _0x41c592=this;return BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](cmHopper[_0x7c1a('0x149')]({}))[_0x7c1a('0x42')](function(){setInterval(function(){_0x41c592[_0x7c1a('0x14a')]();},0x3e8);});};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x14b')]=function(_0x5d4f79){var _0x4464dc=this;return function(){if(!_0x4464dc[_0x7c1a('0xde')](_0x5d4f79['Trunk'])){if(!_0x4464dc['isTrunkReachable'](_0x5d4f79[_0x7c1a('0x14c')])){_0x5d4f79[_0x7c1a('0x47')]='TRUNK_IS_NOT_REACHABLE';throw _0x5d4f79[_0x7c1a('0x4d')]+_0x7c1a('0x14d');}}};};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x14e')]=function(_0x2adde7,_0x4b3b5a,_0x1e9c83,_0x81c0d5){var _0x37b2b0=this;return function(){var _0x43912c=!![];return _0x37b2b0[_0x7c1a('0x14f')](_0x2adde7,_0x4b3b5a,_0x1e9c83,_0x81c0d5,_0x43912c);};};Dialer[_0x7c1a('0x1e')]['checkIfTimeIntervals']=function(_0x5612ef,_0x1e41ab,_0x4df699,_0x17b791){var _0x56609d=this;return function(){var _0x5bc7a3=![];return _0x56609d[_0x7c1a('0x14f')](_0x5612ef[_0x7c1a('0x4c')],_0x1e41ab,_0x4df699,_0x17b791,_0x5bc7a3);};};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x14f')]=function(_0x13fc98,_0xa05090,_0xb557a1,_0x25f4f8,_0x31c449){var _0x5ee5f8=[];return new BPromise(function(_0x1d3f48,_0x3b39c8){if(!isNotNull(_0x13fc98)){_0x25f4f8[_0x7c1a('0x47')]=_0x7c1a('0x4a');return _0x3b39c8(msgResponse(_0x7c1a('0x14f'),_0x7c1a('0x150'),_0xb557a1+_0x7c1a('0x151')));}if(_[_0x7c1a('0x4e')](_0x13fc98)){_0x25f4f8[_0x7c1a('0x47')]=_0x7c1a('0x152');return _0x3b39c8(msgResponse(_0x7c1a('0x14f'),_0x7c1a('0x150'),_0xb557a1+_0x7c1a('0x153')));}if(_0xa05090&&_[_0x7c1a('0x44')](config[_0x7c1a('0x154')][_0xa05090])){_0x25f4f8[_0x7c1a('0x47')]='TIMEZONE_UNKNOW';return _0x3b39c8(msgResponse(_0x7c1a('0x14f'),'Failure',_0xb557a1+_0x7c1a('0x155')+_0xa05090));}if(_[_0x7c1a('0x156')](_0x13fc98)){for(var _0x998075=0x0;_0x998075<_0x13fc98[_0x7c1a('0x9e')];_0x998075+=0x1){_0x5ee5f8[_0x7c1a('0x135')](ami[_0x7c1a('0xb1')]({'action':_0x7c1a('0x157'),'command':util[_0x7c1a('0x81')]('iftime\x20%s,%s',_0x13fc98[_0x998075][_0x7c1a('0x158')],!_[_0x7c1a('0x44')](config['timezones'][_0xa05090])?_0xa05090:'')})['then'](function(_0x2a6f5d){return _0x2a6f5d['content'][_0x7c1a('0x159')]('true')>=0x0;})[_0x7c1a('0xb3')](myreject(_0x3b39c8)));}}else{_0x5ee5f8[_0x7c1a('0x135')](ami[_0x7c1a('0xb1')]({'action':_0x7c1a('0x157'),'command':util['format']('iftime\x20%s,%s',_0x13fc98,!_[_0x7c1a('0x44')](config[_0x7c1a('0x154')][_0xa05090])?_0xa05090:'')})[_0x7c1a('0x42')](function(_0xda13c3){return _0xda13c3[_0x7c1a('0x15a')][_0x7c1a('0x159')]('true')>=0x0;})['catch'](myreject(_0x3b39c8)));}BPromise[_0x7c1a('0x15b')](_0x5ee5f8)[_0x7c1a('0x42')](function(_0xa7fa61){var _0x52565e=_[_0x7c1a('0x15c')](_0xa7fa61);if(_0x52565e){return _0x1d3f48(_0x52565e);}else{_0x25f4f8[_0x7c1a('0x47')]=_0x31c449?_0x7c1a('0x15d'):'INTERVAL_IS_OVERTIME';return _0x3b39c8(msgResponse(_0x7c1a('0x15e'),_0x7c1a('0x150'),_0x7c1a('0x15f')+_0x31c449+'\x20'+_0xb557a1+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x13fc98,{'showHidden':![],'depth':null})+_0x7c1a('0x160')+_0xa05090));}})[_0x7c1a('0xb3')](function(_0x4f5d3a){return _0x3b39c8(msgResponse(_0x7c1a('0x14f'),'Failure',JSON[_0x7c1a('0x13a')](_0x4f5d3a)));});});};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x161')]=function(_0x2f8260){var _0x17ddb2=this;return function(){switch(_0x2f8260[_0x7c1a('0x61')]){case'progressive':freeVariablesPredictive(_0x2f8260);_0x17ddb2[_0x7c1a('0x162')](_0x2f8260,0x1);break;case _0x7c1a('0x163'):freeVariablesPredictive(_0x2f8260);_0x17ddb2[_0x7c1a('0x162')](_0x2f8260,_0x2f8260[_0x7c1a('0x164')]);break;case _0x7c1a('0x9'):_0x17ddb2[_0x7c1a('0x9')](_0x2f8260);break;case _0x7c1a('0x8'):freeVariablesPredictive(_0x2f8260);_0x17ddb2[_0x7c1a('0x162')](_0x2f8260,0x1);break;default:freeVariablesPredictive(_0x2f8260);logger['error'](_0x7c1a('0x165'),_0x2f8260[_0x7c1a('0x4d')],'method\x20not\x20recognized');}};};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x166')]=function(_0x4a00c5){return BPromise[_0x7c1a('0xba')]()['then'](cmHopper[_0x7c1a('0x167')](_0x4a00c5['id'],previewRecallmeReminderInterval))['then'](function(_0x7f642f){for(var _0x5653f0=0x0;_0x5653f0<_0x7f642f[_0x7c1a('0x9e')];_0x5653f0++){var _0x4227bb=_0x7f642f[_0x5653f0]['Agent']['name'];if(_0x4227bb)io['to'](util['format']('user:%s',_0x4227bb))[_0x7c1a('0x54')](_0x7c1a('0x168'),{'hopper':_0x7f642f[_0x5653f0]});}})[_0x7c1a('0xb3')](function(_0x4ed786){});};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x169')]=function(_0x34f66e){var _0x32579d=this;return function(){_0x32579d[_0x7c1a('0x16a')](_0x34f66e);};};Dialer[_0x7c1a('0x1e')]['syncQueueSummary']=function(_0x5ea7a9){var _0x3bd361=this;if(isNotPreview(_0x5ea7a9[_0x7c1a('0x61')])){if(isVoiceQueueOutbound(_0x5ea7a9['type'])&&isActive(_0x5ea7a9[_0x7c1a('0x60')])){_0x5ea7a9[_0x7c1a('0xa3')]=!![];BPromise[_0x7c1a('0xba')]()['then'](checkIsLoggedIn(_0x5ea7a9,_0x5ea7a9[_0x7c1a('0x16b')]))['then'](checkIsActive(_0x5ea7a9,_0x5ea7a9[_0x7c1a('0x60')]))[_0x7c1a('0x42')](checkInterval(_0x5ea7a9))[_0x7c1a('0x42')](_0x3bd361[_0x7c1a('0x14b')](_0x5ea7a9))[_0x7c1a('0x42')](_0x3bd361[_0x7c1a('0x14e')](_0x5ea7a9[_0x7c1a('0x16c')],_0x5ea7a9[_0x7c1a('0x16d')],_0x5ea7a9[_0x7c1a('0x4d')],_0x5ea7a9))[_0x7c1a('0x42')](_0x3bd361[_0x7c1a('0x16e')](_0x5ea7a9[_0x7c1a('0x49')],_0x5ea7a9['dialTimezone'],_0x5ea7a9['name'],_0x5ea7a9))[_0x7c1a('0x42')](_0x3bd361['checkDialMethod'](_0x5ea7a9))[_0x7c1a('0xb3')](loggerCatchQueueSummary('[syncQueueSummary]',_0x5ea7a9));}else{notSendMessagesQueue(_0x5ea7a9);}}else{freeVariablesPredictive(_0x5ea7a9);if(_0x5ea7a9[_0x7c1a('0x16f')]){_0x3bd361[_0x7c1a('0x166')](_0x5ea7a9);}}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x14a')]=function(){var _0x173d27=this;var _0x42d818;for(var _0x2823be in this[_0x7c1a('0x24')]){if(typeof this[_0x7c1a('0x24')][_0x2823be]!==_0x7c1a('0xa0')){_0x42d818=this['campaigns'][_0x2823be];if(isCampaignIvr(_0x42d818[_0x7c1a('0x55')])&&isActive(_0x42d818[_0x7c1a('0xdf')])){_0x42d818[_0x7c1a('0xa3')]=!![];BPromise[_0x7c1a('0xba')]()[_0x7c1a('0x42')](checkIsActive(_0x42d818,_0x42d818['active']))[_0x7c1a('0x42')](checkInterval(_0x42d818))[_0x7c1a('0x42')](_0x173d27[_0x7c1a('0x14b')](_0x42d818))[_0x7c1a('0x42')](_0x173d27[_0x7c1a('0x14e')](_0x42d818[_0x7c1a('0x16c')],_0x42d818[_0x7c1a('0x16d')],_0x42d818[_0x7c1a('0x4d')],_0x42d818))[_0x7c1a('0x42')](_0x173d27[_0x7c1a('0x16e')](_0x42d818[_0x7c1a('0x49')],_0x42d818[_0x7c1a('0x16d')],_0x42d818['name'],_0x42d818))[_0x7c1a('0x42')](_0x173d27['launchHandleIvr'](_0x42d818))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x42d818));}else{notSendMessagesCampaign(_0x42d818);}}}};function getCallerIdRandom(_0x294882,_0x216f8f){var _0x5907e2;var _0x384e67;var _0x2170a0;if(_0x216f8f<=0x0){_0x216f8f=0x1;}_0x5907e2=new RegExp(_0x7c1a('0x170')+_0x216f8f+'}$');_0x384e67=Math['pow'](0xa,_0x216f8f-0x1);_0x2170a0=Math['pow'](0xa,_0x216f8f)-0x1;return util[_0x7c1a('0x81')]('%s',_[_0x7c1a('0x171')](_0x294882,_0x5907e2,_[_0x7c1a('0x172')](_0x384e67,_0x2170a0)));}function extractCalleridName(_0x4afeea){var _0x2e5208=_0x4afeea['match'](/"(.*?)"/);return _0x2e5208?_0x2e5208[0x1]:_0x4afeea;}function extractCalleridNumber(_0x11ebde){var _0x15b9ed=_0x11ebde[_0x7c1a('0x173')](/<(.*?)>/);return _0x15b9ed?_0x15b9ed[0x1]:_0x11ebde;}Dialer[_0x7c1a('0x1e')][_0x7c1a('0x174')]=function(_0xde80e8,_0x1492e2){var _0x1d3ac2=this;var _0x15a5b7=uuid['v4']();this[_0x7c1a('0x29')][_0x15a5b7]=new Action(_0xde80e8,_0x1492e2,_0x15a5b7);return new BPromise(function(_0x5805f0,_0x5a0dfa){if(_['isUndefined'](_0xde80e8)&&typeof _0xde80e8!==_0x7c1a('0x175')){return _0x5a0dfa(msgResponse('originate',_0x7c1a('0x150'),_0x7c1a('0x176')));}if(_[_0x7c1a('0x44')](_0x1492e2['Contact']['phone'])||_0x1492e2[_0x7c1a('0x177')][_0x7c1a('0x178')]===null){return _0x5a0dfa(msgResponse(_0x7c1a('0x179'),'Failure',_0x7c1a('0x17a')));}var _0x407ed9={'XMD-CALLERID':_0x1d3ac2[_0x7c1a('0x29')][_0x15a5b7][_0x7c1a('0x17b')](),'XMD-AGI':_0xde80e8[_0x7c1a('0x116')]?util[_0x7c1a('0x81')](_0x7c1a('0x17c'),ipAgi,_0xde80e8[_0x7c1a('0x116')]):'NONE','XMD-AGIAFTER':_0xde80e8[_0x7c1a('0x11c')]?util[_0x7c1a('0x81')]('\x22agi://%s/square,%s\x22',ipAgi,_0xde80e8[_0x7c1a('0x11c')]):_0x7c1a('0x17d'),'XMD-QUEUE':_0xde80e8[_0x7c1a('0x55')]===_0x7c1a('0x97')?util[_0x7c1a('0x81')](_0x7c1a('0x17e'),_0xde80e8[_0x7c1a('0x4d')],_0xde80e8['dialQueueOptions']||'',_0xde80e8[_0x7c1a('0x11d')]?'c':'',_0xde80e8[_0x7c1a('0x17f')]||0x3):'NONE','XMD-CONTACTID':_0x1492e2[_0x7c1a('0x110')],'XMD-CDRTYPE':_0x7c1a('0x180'),'CALLERID(all)':_0x1d3ac2[_0x7c1a('0x29')][_0x15a5b7]['getCaller'](),'XMD-AMD':_0xde80e8[_0x7c1a('0xeb')]?_0x7c1a('0x181'):_0x7c1a('0x17d'),'XMD-DESTINATION':_0x7c1a('0xea')};if(_0xde80e8[_0x7c1a('0xeb')]){_0x407ed9[_0x7c1a('0x182')]=_0xde80e8['dialAMDInitialSilence']||0x9c4;_0x407ed9['XMD-AMDGREETING']=_0xde80e8[_0x7c1a('0x183')]||0x5dc;_0x407ed9['XMD-AMDAFTERGREETINGSILENCE']=_0xde80e8[_0x7c1a('0x184')]||0x320;_0x407ed9[_0x7c1a('0x185')]=_0xde80e8[_0x7c1a('0x186')]||0x1388;_0x407ed9['XMD-AMDMINWORDLENGTH']=_0xde80e8[_0x7c1a('0x187')]||0x64;_0x407ed9['XMD-AMDBETWEENWORDSSILENCE']=_0xde80e8['dialAMDBetweenWordsSilence']||0x32;_0x407ed9[_0x7c1a('0x188')]=_0xde80e8['dialAMDMaximumNumberOfWords']||0x3;_0x407ed9[_0x7c1a('0x189')]=_0xde80e8['dialAMDSilenceThreshold']||0x100;_0x407ed9['XMD-AMDMAXIMUMWORDLENGTH']=_0xde80e8[_0x7c1a('0x18a')]||0x1388;}if(_0xde80e8['type']==='outbound'){_0x407ed9[_0x7c1a('0x18b')]=_0x1492e2[_0x7c1a('0xd8')];}else{_0x407ed9[_0x7c1a('0x18c')]=_0x1492e2[_0x7c1a('0xd9')];}for(var _0x292273 in _0x1492e2[_0x7c1a('0x177')]){if(typeof _0x1492e2[_0x7c1a('0x177')][_0x292273]!==_0x7c1a('0xa0')){if(isNotNull(_0x1492e2[_0x7c1a('0x177')][_0x292273])&&_0x292273!=='id'&&_0x292273!==_0x7c1a('0x18d')&&_0x292273!==_0x7c1a('0x18e')&&_0x292273!==_0x7c1a('0x18f')){_0x407ed9[util['format'](_0x7c1a('0x190'),'XMD-',_[_0x7c1a('0x191')](_0x292273))]=_0x1492e2[_0x7c1a('0x177')][_0x292273];}}}var _0x3e1d09=_0x1d3ac2['isTrunkReachable'](_0xde80e8[_0x7c1a('0x80')])?getCallerId(_0xde80e8[_0x7c1a('0x80')][_0x7c1a('0x192')],_0xde80e8[_0x7c1a('0x62')],_0xde80e8['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0xde80e8[_0x7c1a('0x63')],_0xde80e8[_0x7c1a('0x193')]):_0xde80e8[_0x7c1a('0x63')]):getCallerId(_[_0x7c1a('0xe6')](_0xde80e8[_0x7c1a('0x14c')])?_0xde80e8[_0x7c1a('0x80')][_0x7c1a('0x192')]:_0xde80e8['TrunkBackup']['callerid'],_0xde80e8[_0x7c1a('0x62')],_0xde80e8[_0x7c1a('0x193')]>0x0?getCallerIdRandom(_0xde80e8[_0x7c1a('0x63')],_0xde80e8[_0x7c1a('0x193')]):_0xde80e8[_0x7c1a('0x63')]);if(_0x3e1d09){_0x407ed9[_0x7c1a('0x194')]=_0x1d3ac2['actions'][_0x15a5b7][_0x7c1a('0x195')]=extractCalleridName(_0x3e1d09);_0x407ed9[_0x7c1a('0x196')]=_0x1d3ac2[_0x7c1a('0x29')][_0x15a5b7]['originatecalleridnum']=extractCalleridNumber(_0x3e1d09);}return ami[_0x7c1a('0xb1')]({'actionid':_0x15a5b7,'action':_0x7c1a('0x179'),'channel':_0x1d3ac2['isTrunkReachable'](_0xde80e8[_0x7c1a('0x80')])?util[_0x7c1a('0x81')](_0x7c1a('0x197'),_0xde80e8['Trunk']['name'],isNotNull(_0xde80e8[_0x7c1a('0x64')])?_0xde80e8[_0x7c1a('0x64')]['trim']()||'':'',_0xde80e8[_0x7c1a('0x198')]>0x0?_0x1492e2[_0x7c1a('0x177')][_0x7c1a('0x178')][_0x7c1a('0x199')](_0xde80e8[_0x7c1a('0x198')]):_0x1492e2[_0x7c1a('0x177')][_0x7c1a('0x178')]):util[_0x7c1a('0x81')](_0x7c1a('0x197'),_[_0x7c1a('0xe6')](_0xde80e8[_0x7c1a('0x14c')])?_0xde80e8[_0x7c1a('0x80')][_0x7c1a('0x4d')]:_0xde80e8[_0x7c1a('0x14c')]['name'],isNotNull(_0xde80e8[_0x7c1a('0x64')])?_0xde80e8[_0x7c1a('0x64')][_0x7c1a('0x19a')]()||'':'',_0xde80e8[_0x7c1a('0x198')]>0x0?_0x1492e2[_0x7c1a('0x177')]['phone'][_0x7c1a('0x199')](_0xde80e8[_0x7c1a('0x198')]):_0x1492e2['Contact'][_0x7c1a('0x178')]),'callerid':_0x3e1d09,'Exten':_0x7c1a('0xea'),'Context':'from-sip','Priority':'1','variable':_0x407ed9,'timeout':(_0xde80e8[_0x7c1a('0x19b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x15a5b7})[_0x7c1a('0x42')](function(_0x3b692d){return _0x5805f0(_0x3b692d);})[_0x7c1a('0xb3')](function(_0x32f8b0){_0xde80e8['outboundOriginateFailureCallsDay']+=0x1;var _0x452931=new History(_0x1d3ac2[_0x7c1a('0x29')][_0x15a5b7]);logger[_0x7c1a('0x9c')](util[_0x7c1a('0x81')](_0x7c1a('0x19c'),JSON['stringify'](_0x32f8b0)));_0x452931[_0x7c1a('0xab')]=0xe;_0x452931[_0x7c1a('0xee')]=_0x7c1a('0x19d');_0x452931[_0x7c1a('0xad')]=moment()[_0x7c1a('0x81')](_0x7c1a('0x109'));_0x452931[_0x7c1a('0xac')]=_0x452931[_0x7c1a('0xad')];_0x1d3ac2[_0x7c1a('0xd0')](_0x452931)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x19e')));_0x1d3ac2['moveContactManagedDialer'](_0x452931)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x19e')))['finally'](function(){delete _0x1d3ac2['actions'][_0x15a5b7];return _0x5a0dfa(msgResponse(_0x7c1a('0x179'),'Error',_0x7c1a('0x19f')));});});});};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x35')]=function(_0x58eabe){var _0x34ce75=this[_0x7c1a('0x29')][_0x58eabe[_0x7c1a('0x131')]];if(_0x34ce75){delete this[_0x7c1a('0x29')][_0x58eabe[_0x7c1a('0x131')]];_0x34ce75[_0x7c1a('0x123')]=moment()[_0x7c1a('0x81')](_0x7c1a('0x109'));var _0x53150a=_0x34ce75[_0x7c1a('0x55')]==='ivr'?this['campaigns'][_0x34ce75[_0x7c1a('0xb6')]]:this[_0x7c1a('0x23')][_0x34ce75[_0x7c1a('0x1a0')]()];if(!this[_0x7c1a('0xdc')](_0x58eabe['response'])){this['updateOriginated'](_0x53150a);return this[_0x7c1a('0x1a1')](_0x34ce75,_0x53150a,_0x58eabe)['catch'](loggerCatch(_0x7c1a('0x1a2')));}this[_0x7c1a('0x2b')][_0x58eabe[_0x7c1a('0xe5')]]=_0x34ce75;}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x1a3')]=function(_0x58840d,_0x4ca4fe,_0x4a7248){var _0x3eb7f6=new History(_0x4ca4fe);if(_0x3eb7f6[_0x7c1a('0xfb')]+_0x3eb7f6[_0x7c1a('0xfc')]+_0x3eb7f6[_0x7c1a('0xfd')]+_0x3eb7f6['countnosuchnumberretry']+_0x3eb7f6[_0x7c1a('0x10d')]+_0x3eb7f6[_0x7c1a('0xff')]+_0x3eb7f6[_0x7c1a('0x100')]+_0x3eb7f6['countagentrejectretry']>=_0x4a7248[_0x7c1a('0x10e')]-0x1){return!![];}switch(_0x58840d){case 0x3:if(_0x3eb7f6[_0x7c1a('0xfd')]>=_0x4a7248['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x7c1a('0xc3')]({'active':![],'countnoanswerretry':_0x3eb7f6[_0x7c1a('0xfd')]+=0x1,'scheduledat':moment()[_0x7c1a('0x107')](_0x4a7248[_0x7c1a('0x1a4')],_0x7c1a('0x108'))['format'](_0x7c1a('0x109')),'ContactId':_0x3eb7f6['ContactId'],'ListId':_0x3eb7f6[_0x7c1a('0xd6')],'VoiceQueueId':_0x3eb7f6[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x3eb7f6[_0x7c1a('0xd9')]||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1a5')));break;case 0x5:if(_0x3eb7f6['countbusyretry']>=_0x4a7248[_0x7c1a('0x1a6')]-0x1){return!![];}this[_0x7c1a('0xc3')]({'active':![],'countbusyretry':_0x3eb7f6[_0x7c1a('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x4a7248[_0x7c1a('0x1a7')],'minutes')[_0x7c1a('0x81')](_0x7c1a('0x109')),'ContactId':_0x3eb7f6[_0x7c1a('0x110')],'ListId':_0x3eb7f6[_0x7c1a('0xd6')],'VoiceQueueId':_0x3eb7f6[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x3eb7f6['CampaignId']||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1a8')));break;case 0x8:if(_0x3eb7f6[_0x7c1a('0xfc')]>=_0x4a7248[_0x7c1a('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x3eb7f6[_0x7c1a('0xfc')]+=0x1,'scheduledat':moment()['add'](_0x4a7248['dialCongestionRetryFrequency'],_0x7c1a('0x108'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3eb7f6[_0x7c1a('0x110')],'ListId':_0x3eb7f6['ListId'],'VoiceQueueId':_0x3eb7f6[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x3eb7f6[_0x7c1a('0xd9')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3eb7f6['countnosuchnumberretry']>=_0x4a7248[_0x7c1a('0x1aa')]-0x1){return!![];}else{this[_0x7c1a('0xc3')]({'active':![],'countnosuchnumberretry':_0x3eb7f6[_0x7c1a('0xfe')]+=0x1,'scheduledat':moment()[_0x7c1a('0x107')](_0x4a7248[_0x7c1a('0x1ab')],_0x7c1a('0x108'))['format'](_0x7c1a('0x109')),'ContactId':_0x3eb7f6['ContactId'],'ListId':_0x3eb7f6[_0x7c1a('0xd6')],'VoiceQueueId':_0x3eb7f6['VoiceQueueId']||undefined,'CampaignId':_0x3eb7f6[_0x7c1a('0xd9')]||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1ac')));}break;case 0xa:if(_0x3eb7f6[_0x7c1a('0x10d')]>=_0x4a7248['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x3eb7f6[_0x7c1a('0x10d')]+=0x1,'scheduledat':moment()[_0x7c1a('0x107')](_0x4a7248[_0x7c1a('0x125')],'minutes')[_0x7c1a('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3eb7f6[_0x7c1a('0x110')],'ListId':_0x3eb7f6[_0x7c1a('0xd6')],'VoiceQueueId':_0x3eb7f6[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x3eb7f6[_0x7c1a('0xd9')]||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x126')));break;case 0xb:if(_0x3eb7f6['countabandonedretry']>=_0x4a7248['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x7c1a('0xc3')]({'active':![],'countabandonedretry':_0x3eb7f6[_0x7c1a('0xff')]+=0x1,'scheduledat':moment()[_0x7c1a('0x107')](_0x4a7248[_0x7c1a('0x12e')],_0x7c1a('0x108'))[_0x7c1a('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3eb7f6[_0x7c1a('0x110')],'ListId':_0x3eb7f6['ListId'],'VoiceQueueId':_0x3eb7f6['VoiceQueueId']||undefined,'CampaignId':_0x3eb7f6[_0x7c1a('0xd9')]||undefined})[_0x7c1a('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3eb7f6['countmachineretry']>=_0x4a7248[_0x7c1a('0x104')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x3eb7f6[_0x7c1a('0x100')]+=0x1,'scheduledat':moment()['add'](_0x4a7248[_0x7c1a('0x10f')],_0x7c1a('0x108'))[_0x7c1a('0x81')](_0x7c1a('0x109')),'ContactId':_0x3eb7f6['ContactId'],'ListId':_0x3eb7f6[_0x7c1a('0xd6')],'VoiceQueueId':_0x3eb7f6[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x3eb7f6[_0x7c1a('0xd9')]||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x10a')));break;case 0x14:if(_0x3eb7f6['countagentrejectretry']>=_0x4a7248[_0x7c1a('0x1ad')]-0x1){return!![];}this[_0x7c1a('0xc3')]({'active':![],'countagentrejectretry':_0x3eb7f6[_0x7c1a('0x101')]+=0x1,'scheduledat':moment()['add'](_0x4a7248[_0x7c1a('0x1ae')],_0x7c1a('0x108'))[_0x7c1a('0x81')](_0x7c1a('0x109')),'ContactId':_0x3eb7f6['ContactId'],'ListId':_0x3eb7f6[_0x7c1a('0xd6')],'VoiceQueueId':_0x3eb7f6[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x3eb7f6[_0x7c1a('0xd9')]||undefined})[_0x7c1a('0xb3')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x7c1a('0x1a1')]=function(_0x1566f3,_0x4c6c16,_0x20d871){var _0x9ab576=this;var _0x32109a=new History(_0x1566f3);return new BPromise(function(_0x55d5e3,_0x30aa1c){if(_[_0x7c1a('0x44')](_0x4c6c16)&&typeof _0x4c6c16!=='object'){return _0x30aa1c(msgResponse(_0x7c1a('0x1af'),_0x7c1a('0x150'),_0x7c1a('0x1b0')));}if(_['isUndefined'](_0x20d871)&&typeof _0x20d871!=='object'){return _0x30aa1c(msgResponse(_0x7c1a('0x1af'),'Failure',_0x7c1a('0x1b1')));}switch(_0x20d871[_0x7c1a('0x119')]){case'0':_0x4c6c16[_0x7c1a('0x6c')]+=0x1;_0x32109a[_0x7c1a('0xab')]=0x0;_0x32109a[_0x7c1a('0xee')]='NoSuchNumber';_0x32109a[_0x7c1a('0xfe')]+=0x1;_0x32109a[_0x7c1a('0xf9')]+=0x1;ami[_0x7c1a('0x54')](_0x7c1a('0x1b2'),ut['buildObj'](_0x1566f3,_0x7c1a('0x1b3')));_0x9ab576['createHistory'](_0x32109a)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0xfa')));if(_0x9ab576['checkRetriveMax'](0x0,_0x1566f3,_0x4c6c16)){if(_0x32109a['countnosuchnumberretry']>=_0x4c6c16[_0x7c1a('0x1aa')]){_0x9ab576[_0x7c1a('0x105')](_0x32109a,_0x55d5e3,_0x30aa1c,'reason\x200\x20no\x20such\x20number....');}else{_0x9ab576[_0x7c1a('0x102')](_0x32109a,_0x55d5e3,_0x30aa1c,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x4c6c16['outboundNoAnswerCallsDay']+=0x1;_0x32109a[_0x7c1a('0xab')]=0x3;_0x32109a[_0x7c1a('0xee')]='NoAnswer';_0x32109a[_0x7c1a('0xfd')]+=0x1;_0x32109a[_0x7c1a('0xf9')]+=0x1;ami[_0x7c1a('0x54')](_0x7c1a('0x1b4'),ut[_0x7c1a('0xf3')](_0x1566f3,'noanswer'));_0x9ab576['createHistory'](_0x32109a)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1b5')));if(_0x9ab576[_0x7c1a('0x1a3')](0x3,_0x1566f3,_0x4c6c16)){if(_0x32109a[_0x7c1a('0xfd')]>=_0x4c6c16[_0x7c1a('0x1b6')]){_0x9ab576[_0x7c1a('0x105')](_0x32109a,_0x55d5e3,_0x30aa1c,_0x7c1a('0x1b7'));}else{_0x9ab576['stateGlobal'](_0x32109a,_0x55d5e3,_0x30aa1c,_0x7c1a('0x1b7'));}}break;case'5':_0x4c6c16[_0x7c1a('0x67')]+=0x1;_0x32109a['state']=0x5;_0x32109a[_0x7c1a('0xee')]='Busy';_0x32109a[_0x7c1a('0xfb')]+=0x1;_0x32109a[_0x7c1a('0xf9')]+=0x1;ami[_0x7c1a('0x54')](_0x7c1a('0x1b8'),ut[_0x7c1a('0xf3')](_0x1566f3,_0x7c1a('0x1b9')));_0x9ab576[_0x7c1a('0xd0')](_0x32109a)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1ba')));if(_0x9ab576[_0x7c1a('0x1a3')](0x5,_0x1566f3,_0x4c6c16)){if(_0x32109a['countbusyretry']>=_0x4c6c16[_0x7c1a('0x1a6')]){_0x9ab576[_0x7c1a('0x105')](_0x32109a,_0x55d5e3,_0x30aa1c,_0x7c1a('0x1bb'));}else{_0x9ab576[_0x7c1a('0x102')](_0x32109a,_0x55d5e3,_0x30aa1c,_0x7c1a('0x1bb'));}}break;case'8':_0x4c6c16[_0x7c1a('0x68')]+=0x1;_0x32109a[_0x7c1a('0xab')]=0x8;_0x32109a[_0x7c1a('0xee')]='Congestion';_0x32109a[_0x7c1a('0xfc')]+=0x1;_0x32109a[_0x7c1a('0xf9')]+=0x1;ami[_0x7c1a('0x54')](_0x7c1a('0x1bc'),ut['buildObj'](_0x1566f3,_0x7c1a('0x1bd')));_0x9ab576[_0x7c1a('0xd0')](_0x32109a)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1be')));if(_0x9ab576[_0x7c1a('0x1a3')](0x8,_0x1566f3,_0x4c6c16)){if(_0x32109a[_0x7c1a('0xfc')]>=_0x4c6c16[_0x7c1a('0x1a9')]){_0x9ab576[_0x7c1a('0x105')](_0x32109a,_0x55d5e3,_0x30aa1c,'reason\x208\x20congestion');}else{_0x9ab576['stateGlobal'](_0x32109a,_0x55d5e3,_0x30aa1c,_0x7c1a('0x1bf'));}}break;case'11':_0x4c6c16[_0x7c1a('0x1c0')]+=0x1;_0x32109a[_0x7c1a('0xab')]=0xb;_0x32109a[_0x7c1a('0xee')]='Abandoned';_0x32109a[_0x7c1a('0xff')]+=0x1;_0x32109a[_0x7c1a('0xf9')]+=0x1;_0x9ab576[_0x7c1a('0xd0')](_0x32109a)[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x130')));if(_0x9ab576[_0x7c1a('0x1a3')](0xb,_0x1566f3,_0x4c6c16)){if(_0x32109a[_0x7c1a('0xff')]>=_0x4c6c16[_0x7c1a('0x12d')]){_0x9ab576[_0x7c1a('0x105')](_0x32109a,_0x55d5e3,_0x30aa1c,_0x7c1a('0x1c1'));}else{_0x9ab576['stateGlobal'](_0x32109a,_0x55d5e3,_0x30aa1c,_0x7c1a('0x1c1'));}}break;case'20':_0x4c6c16[_0x7c1a('0x6f')]+=0x1;_0x32109a[_0x7c1a('0xab')]=0x14;_0x32109a[_0x7c1a('0xee')]=_0x7c1a('0x1c2');_0x32109a['countagentrejectretry']+=0x1;_0x32109a['countglobal']+=0x1;ami[_0x7c1a('0x54')](_0x7c1a('0x1c3'),ut[_0x7c1a('0xf3')](_0x1566f3,_0x7c1a('0x1c4')));_0x9ab576['createHistory'](_0x32109a)['catch'](loggerCatch(_0x7c1a('0x1c5')));if(_0x9ab576[_0x7c1a('0x1a3')](0x14,_0x1566f3,_0x4c6c16)){if(_0x32109a[_0x7c1a('0x101')]>=_0x4c6c16[_0x7c1a('0x1ad')]){_0x9ab576['createStateFinal'](_0x32109a,_0x55d5e3,_0x30aa1c,'reason\x2020\x20agentreject');}else{_0x9ab576[_0x7c1a('0x102')](_0x32109a,_0x55d5e3,_0x30aa1c,_0x7c1a('0x1c6'));}}break;default:_0x4c6c16[_0x7c1a('0x70')]+=0x1;_0x32109a[_0x7c1a('0xab')]=0xc;_0x32109a['statedesc']=_0x20d871['reason'];_0x9ab576['createHistory'](_0x32109a)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x9ab576['checkRetriveMax'](_0x20d871[_0x7c1a('0x119')],_0x1566f3,_0x4c6c16)){if(_0x32109a[_0x7c1a('0xfb')]+_0x32109a[_0x7c1a('0xfc')]+_0x32109a[_0x7c1a('0xfd')]+_0x32109a[_0x7c1a('0xfe')]+_0x32109a['countdropretry']+_0x32109a['countabandonedretry']+_0x32109a[_0x7c1a('0x100')]+_0x32109a[_0x7c1a('0x101')]>=_0x4c6c16[_0x7c1a('0x10e')]){_0x9ab576['stateGlobal'](_0x32109a,_0x55d5e3,_0x30aa1c,_0x20d871['reason']);}else{_0x9ab576[_0x7c1a('0x105')](_0x32109a,_0x55d5e3,_0x30aa1c,_0x20d871[_0x7c1a('0x119')]);}}}});};Dialer['prototype'][_0x7c1a('0x102')]=function(_0x5eb3fa,_0x2d415,_0x360718,_0x41744c){var _0x1c84b8=new Final(_0x5eb3fa);_0x1c84b8[_0x7c1a('0xab')]=0xf;_0x1c84b8[_0x7c1a('0xee')]=_0x7c1a('0x1c7');this['createStateFinal'](_0x1c84b8,_0x2d415,_0x360718,_0x41744c);};Dialer['prototype'][_0x7c1a('0x105')]=function(_0x428612,_0x42659a,_0x564772,_0x56c03a){this[_0x7c1a('0xce')](_0x428612)['then'](function(){return _0x42659a(msgResponse(_0x7c1a('0x1af'),_0x7c1a('0xdd'),_0x56c03a));})[_0x7c1a('0xb3')](function(){return _0x564772(msgResponse(_0x7c1a('0x1c8'),_0x7c1a('0x150'),'contact\x20not\x20moved'));});};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x9')]=function(_0x11605d){var _0x3ac6c2=_0x11605d[_0x7c1a('0x1c9')]/0x64;var _0x5154d4=_0x11605d[_0x7c1a('0x6a')]/(_0x11605d[_0x7c1a('0x6a')]+_0x11605d[_0x7c1a('0x66')]);var _0x15d443=Math[_0x7c1a('0x1ca')](_0x11605d[_0x7c1a('0x1cb')]*(_0x11605d[_0x7c1a('0x1cc')]/0x64));var _0x14f987=Math[_0x7c1a('0x1ca')](_0x11605d['predictiveIntervalAvailable']*(_0x11605d[_0x7c1a('0x1cd')]/0x64));var _0x56757c=_0x11605d[_0x7c1a('0xa5')]+_0x11605d['talking'];var _0x4a660d=Math[_0x7c1a('0x1ce')](_0x11605d[_0x7c1a('0x7c')]*_0x11605d['erlangAbandonmentRate']*_0x11605d['predictiveIntervalHitRate']*_0x11605d['predictiveIntervalMultiplicativeFactor']);if(_[_0x7c1a('0x44')](_0x11605d[_0x7c1a('0x2d')])){if(!_[_0x7c1a('0x44')](_0x11605d[_0x7c1a('0x94')])){_0x11605d[_0x7c1a('0x94')]=undefined;loggerPredictive[_0x7c1a('0x9c')](_0x7c1a('0x1cf'),_0x7c1a('0x1d0'));}if(!_[_0x7c1a('0x44')](_0x11605d[_0x7c1a('0x95')])){loggerPredictive['error'](_0x7c1a('0x1cf'),_0x7c1a('0x1d1'));clearInterval(_0x11605d['handlePredictive']);_0x11605d['handlePredictive']=undefined;}_0x11605d['startProgressive']=moment()['format'](_0x7c1a('0x109'));loggerPredictive['info'](_0x11605d['name'],_0x7c1a('0x1d2'),_0x11605d[_0x7c1a('0x2d')]);this[_0x7c1a('0x162')](_0x11605d,0x1);}else if(ifInterval(_0x11605d[_0x7c1a('0x1d3')],_0x11605d[_0x7c1a('0x2d')])){this[_0x7c1a('0x162')](_0x11605d,0x1);loggerPredictiveCalls[_0x7c1a('0x86')]('[startMethodPredictive][StartProgressive][Loop]',_0x11605d[_0x7c1a('0x2d')],_0x11605d[_0x7c1a('0x4d')]);_0x11605d[_0x7c1a('0x7c')]=0x0;_0x11605d[_0x7c1a('0x77')]=0x0;}else if(_0x3ac6c2<_0x5154d4&&_0x11605d['dialPredictiveOptimization']===_0x7c1a('0x1d4')){freeVariablesPredictive(_0x11605d);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x1d5'),_0x7c1a('0x1d6'),_0x5154d4,_0x7c1a('0x2d'),_0x11605d[_0x7c1a('0x4d')]);}else if(_0x4a660d<_0x11605d[_0x7c1a('0x77')]&&_0x11605d[_0x7c1a('0x1d7')]===_0x7c1a('0x1d4')){freeVariablesPredictive(_0x11605d);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x1d8'),_0x7c1a('0x1d9'),_0x4a660d,_0x7c1a('0x1da'),_0x11605d[_0x7c1a('0x77')],_0x7c1a('0x2d'),_0x11605d['name']);}else if(!ifInterval(_0x11605d[_0x7c1a('0x1d3')],_0x11605d[_0x7c1a('0x2d')])&&_[_0x7c1a('0x44')](_0x11605d['startPredictive'])&&!_[_0x7c1a('0x44')](_0x11605d[_0x7c1a('0x2d')])){_0x11605d[_0x7c1a('0x94')]=moment()[_0x7c1a('0x81')](_0x7c1a('0x109'));loggerPredictive['info'](_0x11605d['name'],_0x7c1a('0x1db'),_0x11605d[_0x7c1a('0x94')]);this['averageHandleTime'](_0x11605d[_0x7c1a('0x1d3')])[_0x7c1a('0x42')](this[_0x7c1a('0x1dc')](_0x11605d))[_0x7c1a('0x42')](mergeDataErlangB(_0x11605d))['then'](this['startMethodPredictive'](_0x11605d))[_0x7c1a('0xb3')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x11605d));}else if(!ifInterval(_0x11605d['dialPredictiveInterval'],_0x11605d['startPredictive'])){_0x11605d[_0x7c1a('0x77')]=0x0;_0x11605d[_0x7c1a('0x94')]=moment()['format'](_0x7c1a('0x109'));loggerPredictive['info'](_0x11605d[_0x7c1a('0x4d')],_0x7c1a('0x1dd'),_0x11605d['startPredictive']);clearInterval(_0x11605d[_0x7c1a('0x95')]);_0x11605d[_0x7c1a('0x95')]=undefined;this[_0x7c1a('0xc0')](_0x11605d['dialPredictiveInterval'])[_0x7c1a('0x42')](this[_0x7c1a('0x1dc')](_0x11605d))['then'](mergeDataErlangB(_0x11605d))[_0x7c1a('0x42')](this[_0x7c1a('0x1de')](_0x11605d))[_0x7c1a('0xb3')](loggerCatchPredictive(_0x7c1a('0x1df'),_0x11605d));}else if(_0x11605d[_0x7c1a('0x1cb')]&&_0x56757c<_0x11605d['predictiveIntervalAvailable']-_0x14f987){freeVariablesPredictive(_0x11605d);loggerPredictive['info'](_0x11605d[_0x7c1a('0x4d')],_0x7c1a('0x1e0'),_0x56757c,')\x20are\x20less\x20than\x20threshold\x20(',_0x11605d[_0x7c1a('0x1cb')],'-',_0x14f987,'=',_0x11605d[_0x7c1a('0x1cb')]-_0x14f987,')');}else if(_0x11605d[_0x7c1a('0x1cb')]&&_0x56757c>_0x11605d['predictiveIntervalAvailable']+_0x15d443){freeVariablesPredictive(_0x11605d);loggerPredictive[_0x7c1a('0x86')](_0x11605d['name'],_0x7c1a('0x1e0'),_0x56757c,')\x20are\x20more\x20than\x20threshold\x20(',_0x11605d[_0x7c1a('0x1cb')],'+',_0x15d443,'=',_0x11605d['predictiveIntervalAvailable']+_0x15d443,')');}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x1dc')]=function(_0x20e00f){var _0x2324b3=this;return function(_0x4374ec){return new BPromise(function(_0xc3e729,_0x2b2d18){_[_0x7c1a('0x92')](_0x20e00f,_0x4374ec[0x0]);if(checkGetDataPredictive(_0x4374ec[0x0])){var _0x2cb06e=_0x20e00f[_0x7c1a('0x1cb')]=_0x20e00f['talking']+_0x20e00f['available'];var _0x4c611c=_0x20e00f[_0x7c1a('0x1d3')]*0x3c;var _0x698f39=_0x4374ec[0x0][_0x7c1a('0x73')]+_0x4374ec[0x0][_0x7c1a('0x72')];var _0x944e63=(_0x4374ec[0x0]['predictiveIntervalAnsweredCalls']+_0x4374ec[0x0][_0x7c1a('0x75')]+_0x4374ec[0x0][_0x7c1a('0x74')])/_0x4374ec[0x0][_0x7c1a('0x7b')];_0x20e00f[_0x7c1a('0x78')]=_0x944e63>0x0?_0x944e63:0x1;switch(_0x20e00f[_0x7c1a('0x1d7')]){case _0x7c1a('0x1d4'):var _0x406e0d=_0x20e00f[_0x7c1a('0x1c9')]/0x64;return _0x2324b3['abandonmentRate'](_0x2cb06e,_0x4c611c,_0x698f39,_0x944e63,_0x406e0d)[_0x7c1a('0x42')](function(_0x46a365){return _0xc3e729(_0x46a365);});case'agentBusyFactor':var _0x4bd22b=_0x20e00f[_0x7c1a('0x1c9')]/0x64;return _0x2324b3[_0x7c1a('0x1e1')](_0x2cb06e,_0x4c611c,_0x698f39,_0x944e63,_0x4bd22b)[_0x7c1a('0x42')](function(_0x1e21b9){return _0xc3e729(_0x1e21b9);});default:return _0x2b2d18(msgResponse(_0x7c1a('0x1e2'),'Failure',_0x7c1a('0x1e3')));}}else{return _0x2b2d18(msgResponse(_0x7c1a('0x1e2'),_0x7c1a('0x150'),'check\x20failure'));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0xa09428){var _0x4edf8d=this;return function(_0x3d9d8b){return new BPromise(function(_0x2dd7bc,_0x493453){_[_0x7c1a('0x92')](_0xa09428,_0x3d9d8b[0x0]);if(checkGetDataPredictive(_0x3d9d8b[0x0])){loggerPredictive['info'](JSON['stringify'](_0x3d9d8b[0x0]));if(_0xa09428[_0x7c1a('0x1d7')]==='dropRate'){return _0x4edf8d[_0x7c1a('0xcc')](_0xa09428['id'])[_0x7c1a('0x42')](function(_0x1c0a62){var _0x2be5b0=_0xa09428['loggedIn']-_0x1c0a62[0x0]['outboundQueuePauses'];var _0xf19ceb=_0xa09428[_0x7c1a('0x1d3')]*0x3c;var _0x5e8a31=_0x3d9d8b[0x0][_0x7c1a('0x73')]+_0x3d9d8b[0x0][_0x7c1a('0x72')];var _0x51dd8e=(_0x3d9d8b[0x0][_0x7c1a('0x71')]+_0x3d9d8b[0x0][_0x7c1a('0x75')]+_0x3d9d8b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3d9d8b[0x0][_0x7c1a('0x7b')];var _0x52320e=_0xa09428[_0x7c1a('0x1c9')]/0x64;_0xa09428[_0x7c1a('0x7a')]=_0x1c0a62[0x0]['outboundQueuePauses']||0x0;_0xa09428[_0x7c1a('0x78')]=_0x51dd8e>0x0?_0x51dd8e:0x1;return _0x4edf8d[_0x7c1a('0x1e4')](_0x2be5b0,_0xf19ceb,_0x5e8a31,_0x51dd8e,_0x52320e);})['then'](function(_0x6ea054){return _0x2dd7bc(_0x6ea054);})[_0x7c1a('0xb3')](function(_0x139cf3){return _0x493453(msgResponse(_0x7c1a('0x1e5'),_0x7c1a('0x150'),JSON[_0x7c1a('0x13a')](_0x139cf3)));});}if(_0xa09428[_0x7c1a('0x1d7')]===_0x7c1a('0x1e6')){return _0x4edf8d[_0x7c1a('0xcc')](_0xa09428['id'])[_0x7c1a('0x42')](function(_0x495ead){var _0x5babcc=_0xa09428[_0x7c1a('0x16b')]-_0x495ead[0x0]['outboundQueuePauses'];var _0x4fdded=_0xa09428['dialPredictiveInterval']*0x3c;var _0x24a0c5=_0x3d9d8b[0x0][_0x7c1a('0x73')]+_0x3d9d8b[0x0][_0x7c1a('0x72')];var _0x3b5efc=(_0x3d9d8b[0x0][_0x7c1a('0x71')]+_0x3d9d8b[0x0][_0x7c1a('0x75')]+_0x3d9d8b[0x0][_0x7c1a('0x74')])/_0x3d9d8b[0x0][_0x7c1a('0x7b')];var _0x53ca0d=_0xa09428['dialPredictiveOptimizationPercentage']/0x64;_0xa09428[_0x7c1a('0x7a')]=_0x495ead[0x0][_0x7c1a('0x1e7')]||0x0;_0xa09428['predictiveIntervalHitRate']=_0x3b5efc>0x0?_0x3b5efc:0x1;return _0x4edf8d[_0x7c1a('0x1e1')](_0x5babcc,_0x4fdded,_0x24a0c5,_0x3b5efc,_0x53ca0d);})[_0x7c1a('0x42')](function(_0x24b343){return _0x2dd7bc(_0x24b343);})[_0x7c1a('0xb3')](function(_0x43e498){return _0x493453(msgResponse('[CatchErlangB]',_0x7c1a('0x150'),JSON[_0x7c1a('0x13a')](_0x43e498)));});}}else{return _0x493453(msgResponse(_0x7c1a('0x1e2'),_0x7c1a('0x150'),_0x7c1a('0x1e8')));}});};};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x1de')]=function(_0x79598){var _0x3e6650=this;return function(){var _0xb791b0=0x0;var _0x3121dc=Math[_0x7c1a('0x1ce')](_0x79598[_0x7c1a('0x7d')]*0x3e8);if(_0x3121dc>0x0){_0x3121dc=_0x3121dc<0x64?0x64:_0x3121dc;loggerPredictive[_0x7c1a('0x86')](_0x79598[_0x7c1a('0x4d')],_0x7c1a('0x1e9'),_0x3121dc,_0x7c1a('0x51'));_0x79598[_0x7c1a('0x95')]=setInterval(function(){_0x3e6650[_0x7c1a('0x95')](_0x79598);loggerPredictiveCalls[_0x7c1a('0x86')](_0x7c1a('0x1ea'),_0xb791b0+=0x1);},_0x3121dc);}else{loggerPredictive[_0x7c1a('0x86')](_0x79598[_0x7c1a('0x4d')],_0x7c1a('0x1eb'));}};};Dialer['prototype'][_0x7c1a('0x1ec')]=function(_0x15ec42,_0x497118){var _0xd41f0=this;return function(_0x2e391a){if(_[_0x7c1a('0x4e')](_0x2e391a)){if(_[_0x7c1a('0xe6')](_0x497118[_0x7c1a('0xd7')])||!_0x497118[_0x7c1a('0x1ed')]){if(_0x15ec42[_0x7c1a('0x61')]===_0x7c1a('0x8')){_0x15ec42[_0x7c1a('0x137')]=_[_0x7c1a('0x44')](_0x15ec42['queueStatusComplete'])?!![]:_0x15ec42['queueStatusComplete'];var _0x4e7898=uuid['v4']();_0xd41f0['actions'][_0x4e7898]=new Action(_0x15ec42,_0x497118,_0x4e7898);loggerBooked['info']('[booked][checkContactBlack]',_0x4e7898,_0x7c1a('0x1ee'),JSON[_0x7c1a('0x13a')](_0x15ec42[_0x7c1a('0x137')]),_0x7c1a('0x1ef'),_0x15ec42['name']);if(_0x15ec42[_0x7c1a('0x137')]){_0x15ec42['queueStatusComplete']=![];_0xd41f0[_0x7c1a('0x2f')][_0xd41f0[_0x7c1a('0x29')][_0x4e7898][_0x7c1a('0xb6')]]=[];ami[_0x7c1a('0xb1')]({'actionid':_0x4e7898,'action':'queuestatus','queue':_0x15ec42['name']})[_0x7c1a('0xb3')](function(){_0xd41f0['updateOriginated'](_0x15ec42);_0xd41f0['rescheduleContact']({'active':![],'ContactId':_0xd41f0[_0x7c1a('0x29')][_0x4e7898][_0x7c1a('0x110')],'ListId':_0xd41f0[_0x7c1a('0x29')][_0x4e7898][_0x7c1a('0xd6')],'VoiceQueueId':_0xd41f0['actions'][_0x4e7898][_0x7c1a('0xd8')]||undefined,'CampaignId':_0xd41f0[_0x7c1a('0x29')][_0x4e7898][_0x7c1a('0xd9')]||undefined})['catch'](loggerCatch(_0x7c1a('0x1f0')));delete _0xd41f0[_0x7c1a('0x29')][_0x4e7898];});}else{loggerBooked['info'](_0x7c1a('0x1f1'),JSON['stringify'](_0x15ec42[_0x7c1a('0x137')]),_0x7c1a('0x1ef'),_0x15ec42[_0x7c1a('0x4d')]);_0xd41f0[_0x7c1a('0xb5')](_0x15ec42);_0xd41f0[_0x7c1a('0xc3')]({'active':![],'ContactId':_0xd41f0['actions'][_0x4e7898][_0x7c1a('0x110')],'ListId':_0xd41f0['actions'][_0x4e7898][_0x7c1a('0xd6')],'VoiceQueueId':_0xd41f0[_0x7c1a('0x29')][_0x4e7898][_0x7c1a('0xd8')]||undefined,'CampaignId':_0xd41f0[_0x7c1a('0x29')][_0x4e7898][_0x7c1a('0xd9')]||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1f0')));delete _0xd41f0['actions'][_0x4e7898];}}else{return _0xd41f0['actionOriginate'](_0x15ec42,_0x497118);}}else{if(getDiff(_0x497118[_0x7c1a('0x1f2')])<_0x15ec42[_0x7c1a('0x1f3')]*0x3c){if(_0x497118['Agent']&&!_0x497118[_0x7c1a('0x1f4')][_0x7c1a('0x1f5')]){_0xd41f0[_0x7c1a('0x141')][_0x7c1a('0x13b')](_0x497118['id'])[_0x7c1a('0x21')](function(){_0xd41f0[_0x7c1a('0xb5')](_0x15ec42);});}else{_0xd41f0[_0x7c1a('0xc5')]({'active':![]},_0x497118['id'],0x1)['finally'](function(){_0xd41f0['updateOriginated'](_0x15ec42);});}}else{_0x15ec42[_0x7c1a('0x6e')]+=0x1;_0xd41f0['updateOriginated'](_0x15ec42);if(_0x15ec42['dialRecallInQueue']){_0xd41f0[_0x7c1a('0xc3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x497118['ContactId'],'ListId':_0x497118[_0x7c1a('0xd6')],'VoiceQueueId':_0x497118[_0x7c1a('0xd8')]||undefined,'CampaignId':_0x497118['CampaignId']||undefined})[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1f6')));_0xd41f0[_0x7c1a('0xd0')](createObjHistory(_0x15ec42,_0x497118,_0x7c1a('0x1f7'),0x17,_0x7c1a('0x1f8')))[_0x7c1a('0xb3')](loggerCatch(_0x7c1a('0x1f9')));}else{_0xd41f0[_0x7c1a('0xd4')](createObjHistory(_0x15ec42,_0x497118,_0x7c1a('0x1fa'),0x16,'RecallFailedTimeout'),_0x7c1a('0x1fb'),_0x7c1a('0x1fc'));}}}}else{_0x15ec42[_0x7c1a('0x1fd')]+=0x1;_0xd41f0[_0x7c1a('0xd4')](createObjHistory(_0x15ec42,_0x497118,_0x7c1a('0x1fe'),0xd,_0x7c1a('0x1ff')),'[Originate][historyBlacklist]',_0x7c1a('0x200'));throw _0x7c1a('0x201');}};};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x16a')]=function(_0x45264){var _0x1b609=this;var _0x1bb4e8=_0x45264['limitCalls']-_0x45264[_0x7c1a('0x9f')]-_0x45264[_0x7c1a('0xc8')];emitCampaignSummary(_0x45264);if(_0x1bb4e8>0x0){if(_0x1bb4e8>this[_0x7c1a('0x27')]){_0x1bb4e8=this['maxNumberOriginate'];}_0x45264[_0x7c1a('0xc8')]+=_0x1bb4e8;this[_0x7c1a('0xca')](_0x45264['id'],_0x1bb4e8,_0x45264[_0x7c1a('0x202')],_0x45264)['then'](function(_0x1486de){_0x45264[_0x7c1a('0xc8')]-=_0x1bb4e8;_0x45264[_0x7c1a('0xc8')]=_0x45264['temp']>0x0?_0x45264[_0x7c1a('0xc8')]:0x0;if(!checkContactEmpty(_0x1486de)){_0x45264[_0x7c1a('0x47')]=_0x7c1a('0x203');logger[_0x7c1a('0x86')](_0x7c1a('0x204')+_0x45264['name']);}else{_0x45264[_0x7c1a('0x9f')]+=_0x1486de[_0x7c1a('0x9e')];_0x45264['message']='RUNNING';for(var _0x49ca94=0x0;_0x49ca94<_0x1486de[_0x7c1a('0x9e')];_0x49ca94+=0x1){_0x45264[_0x7c1a('0x205')]+=0x1;if(_['isNil'](_0x1486de[_0x49ca94])||_['isNil'](_0x1486de[_0x49ca94][_0x7c1a('0x177')])||_[_0x7c1a('0xe6')](_0x1486de[_0x49ca94][_0x7c1a('0x177')][_0x7c1a('0x178')])){_0x1b609[_0x7c1a('0x206')](_0x7c1a('0x207'),_0x45264,_0x1486de[_0x49ca94]);}else{_0x1b609['checkIsBlackListIvr'](_[_0x7c1a('0xd5')](_0x1486de[_0x49ca94],['CampaignId',_0x7c1a('0x208')]))[_0x7c1a('0x42')](_0x1b609[_0x7c1a('0x1ec')](_0x45264,_0x1486de[_0x49ca94]))[_0x7c1a('0xb3')](_0x1b609[_0x7c1a('0x209')](_0x7c1a('0x20a'),_0x45264));}}}})[_0x7c1a('0xb3')](loggerGetContactDialer(_0x7c1a('0x20b'),_0x45264,_0x1bb4e8));}};Dialer['prototype'][_0x7c1a('0x162')]=function(_0x51d59a,_0x3537d8){var _0xd7bc9e=this;var _0x3f7a80=[];var _0x12bf57=_0x3537d8>=0x1?_0x3537d8:0x1;if(_0x51d59a[_0x7c1a('0x61')]===_0x7c1a('0x8')){_0x12bf57=0x1;}var _0x2c6e99=Math[_0x7c1a('0x1ce')](_0x51d59a[_0x7c1a('0xa5')]*_0x12bf57)-_0x51d59a['originated']-_0x51d59a[_0x7c1a('0xc8')];emitVoiceQueueSummary(_0x51d59a);if(_0x51d59a['dialLimitQueue']>0x0){var _0x1079da=_0x51d59a[_0x7c1a('0x20c')]-_0x51d59a['originated']-_0x51d59a['talking']-_0x51d59a[_0x7c1a('0xc8')]-_0x51d59a[_0x7c1a('0x58')];if(_0x2c6e99>_0x1079da){_0x2c6e99=_0x1079da;}}if(_0x2c6e99>0x0){if(_0x51d59a[_0x7c1a('0x61')]===_0x7c1a('0x8')){_0x2c6e99=0x1;}if(_0x2c6e99>this[_0x7c1a('0x27')]){_0x2c6e99=this[_0x7c1a('0x27')];}_0x51d59a[_0x7c1a('0xc8')]+=_0x2c6e99;for(var _0x57825d in this[_0x7c1a('0x25')]){if(typeof this[_0x7c1a('0x25')][_0x57825d]!==_0x7c1a('0xa0')){if(this[_0x7c1a('0x25')][_0x57825d]['state']===_0x7c1a('0x20d')&&this[_0x7c1a('0x25')][_0x57825d][_0x7c1a('0xe1')]==='reachable'){_0x3f7a80[_0x7c1a('0x135')](this[_0x7c1a('0x25')][_0x57825d]['id']);}}}this[_0x7c1a('0xc7')](_0x51d59a['id'],_0x3f7a80,_0x2c6e99,_0x51d59a[_0x7c1a('0x202')],_0x51d59a)[_0x7c1a('0x42')](function(_0x1cd9fb){_0x51d59a[_0x7c1a('0xc8')]-=_0x2c6e99;_0x51d59a[_0x7c1a('0xc8')]=_0x51d59a[_0x7c1a('0xc8')]>0x0?_0x51d59a[_0x7c1a('0xc8')]:0x0;if(!checkContactEmpty(_0x1cd9fb)){_0xd7bc9e[_0x7c1a('0xb9')](_0x51d59a)[_0x7c1a('0x42')](sendMessageReschedule(_0x51d59a))['catch'](loggerCatch(_0x7c1a('0xbb')));}else{_0x51d59a['originated']+=_0x1cd9fb[_0x7c1a('0x9e')];_0x51d59a[_0x7c1a('0x47')]=_0x51d59a[_0x7c1a('0x61')]===_0x7c1a('0x8')?'ACTIVE':_0x7c1a('0x20e');for(var _0x549cef=0x0;_0x549cef<_0x1cd9fb[_0x7c1a('0x9e')];_0x549cef+=0x1){if(_[_0x7c1a('0xe6')](_0x1cd9fb[_0x549cef])||_[_0x7c1a('0xe6')](_0x1cd9fb[_0x549cef][_0x7c1a('0x177')])||_[_0x7c1a('0xe6')](_0x1cd9fb[_0x549cef][_0x7c1a('0x177')]['phone'])){_0xd7bc9e['emptyContact'](_0x7c1a('0x207'),_0x51d59a,_0x1cd9fb[_0x549cef]);}else{_0xd7bc9e[_0x7c1a('0xbc')](_[_0x7c1a('0xd5')](_0x1cd9fb[_0x549cef],[_0x7c1a('0xd8'),_0x7c1a('0x208')]))[_0x7c1a('0x42')](_0xd7bc9e[_0x7c1a('0x1ec')](_0x51d59a,_0x1cd9fb[_0x549cef]))[_0x7c1a('0xb3')](_0xd7bc9e[_0x7c1a('0x209')](_0x7c1a('0x207'),_0x51d59a));}}}})[_0x7c1a('0xb3')](loggerGetContactDialer(_0x7c1a('0x20f'),_0x51d59a,_0x2c6e99));}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x95')]=function(_0x260946){if(_0x260946[_0x7c1a('0x20c')]>0x0){var _0x13bfd4=_0x260946['dialLimitQueue']-_0x260946[_0x7c1a('0x9f')]-_0x260946['talking'];if(_0x13bfd4>0x0){this['tryOriginatePredictive'](_0x260946);}else{loggerPredictiveCalls[_0x7c1a('0x86')](_0x7c1a('0x210'));}}else{this[_0x7c1a('0x211')](_0x260946);}};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x211')]=function(_0x5e9799){var _0x494e03=this;var _0x35a94a=[];_0x5e9799[_0x7c1a('0x9f')]+=0x1;for(var _0xc4082b in this[_0x7c1a('0x25')]){if(typeof this[_0x7c1a('0x25')][_0xc4082b]!=='undefined'){if(this[_0x7c1a('0x25')][_0xc4082b][_0x7c1a('0xab')]==='not_inuse'&&this[_0x7c1a('0x25')][_0xc4082b][_0x7c1a('0xe1')]===_0x7c1a('0xe2')){_0x35a94a[_0x7c1a('0x135')](this[_0x7c1a('0x25')][_0xc4082b]['id']);}}}this[_0x7c1a('0xc7')](_0x5e9799['id'],_0x35a94a,0x1,_0x5e9799['dialOrderByScheduledAt'],_0x5e9799)[_0x7c1a('0x42')](function(_0x43c114){if(!checkContactEmpty(_0x43c114)){checkContactLowerLimitOriginate(_0x5e9799,0x1,0x0);_0x494e03['countReScheduled'](_0x5e9799)[_0x7c1a('0x42')](sendMessageReschedule(_0x5e9799))['catch'](loggerCatch(_0x7c1a('0xbb')));}else{_0x5e9799[_0x7c1a('0x47')]=_0x7c1a('0x20e');if(_[_0x7c1a('0xe6')](_0x43c114[0x0])||_[_0x7c1a('0xe6')](_0x43c114[0x0][_0x7c1a('0x177')])||_[_0x7c1a('0xe6')](_0x43c114[0x0][_0x7c1a('0x177')][_0x7c1a('0x178')])){_0x494e03['emptyContact'](_0x7c1a('0x207'),_0x5e9799,_0x43c114[0x0]);}else{_0x494e03[_0x7c1a('0xbc')](_[_0x7c1a('0xd5')](_0x43c114[0x0],[_0x7c1a('0xd8'),'Contact.phone']))[_0x7c1a('0x42')](_0x494e03[_0x7c1a('0x1ec')](_0x5e9799,_0x43c114[0x0]))[_0x7c1a('0xb3')](_0x494e03[_0x7c1a('0x209')](_0x7c1a('0x212'),_0x5e9799));}}})['catch'](loggerGetContactDialer(_0x7c1a('0x213'),_0x5e9799,0x1));emitVoiceQueueSummary(_0x5e9799);};Dialer[_0x7c1a('0x1e')][_0x7c1a('0x1e4')]=function(_0x2d5d3b,_0x140a69,_0x4772e2,_0x52ead5,_0x360c97,_0x3f511d){loggerPredictive[_0x7c1a('0x86')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x7c1a('0x214'),_0x2d5d3b);loggerPredictive['info'](_0x7c1a('0x215'),_0x140a69);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x216'),_0x4772e2);loggerPredictive['info'](_0x7c1a('0x217'),_0x52ead5);loggerPredictive[_0x7c1a('0x86')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x360c97);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x8b'));return new BPromise(function(_0x2bf2e4,_0x1bd368){if(_0x2d5d3b<=0x0||isNaN(_0x2d5d3b)){return _0x1bd368(msgResponse('[abandonmentRate]',_0x7c1a('0x50'),'m\x20=\x20'+_0x2d5d3b));}if(_0x4772e2<=0x0||isNaN(_0x4772e2)){return _0x1bd368(msgResponse(_0x7c1a('0x218'),'Error','Ts\x20=\x20'+_0x4772e2));}if(_0x52ead5<=0x0||isNaN(_0x52ead5)){return _0x1bd368(msgResponse(_0x7c1a('0x218'),_0x7c1a('0x50'),_0x7c1a('0x219')+_0x52ead5));}if(_0x140a69<=0x0||isNaN(_0x140a69)){return _0x1bd368(msgResponse(_0x7c1a('0x218'),'Error','interval\x20=\x20'+_0x140a69));}if(_0x360c97<=0x0||isNaN(_0x360c97)){return _0x1bd368(msgResponse(_0x7c1a('0x218'),_0x7c1a('0x50'),_0x7c1a('0x21a')+_0x360c97));}_0x3f511d=_0x3f511d||0x0;var _0x4abfc9=0x1/_0x4772e2;var _0x4eeb68=0x0;var _0x13b806=0x0;var _0x35c67f=0x0;var _0x140322=0x0;for(var _0x4c2f98=0x0;_0x35c67f<_0x360c97;_0x4c2f98+=0x1){_0x13b806=_0x4c2f98/_0x140a69;_0x4eeb68=(_0x52ead5*_0x13b806+_0x3f511d)/_0x4abfc9;_0x35c67f=erlangb(_0x4eeb68,_0x2d5d3b);_0x140322=_0x4eeb68/_0x2d5d3b*(0x1-erlangb(_0x4eeb68,_0x2d5d3b));}return _0x2bf2e4({'erlangCalls':_0x4c2f98,'erlangCallToSecond':_0x140a69/_0x4c2f98,'erlangAbandonmentRate':_0x35c67f,'erlangBusyFactor':_0x140322});});};Dialer[_0x7c1a('0x1e')]['busyFactor']=function(_0x4e66a8,_0xe61985,_0x3c40fe,_0x41aeb0,_0xb939ea,_0x2638fb){loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x21b'));loggerPredictive['info'](_0x7c1a('0x214'),_0x4e66a8);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x215'),_0xe61985);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x216'),_0x3c40fe);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x217'),_0x41aeb0);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x21c'),_0xb939ea);loggerPredictive[_0x7c1a('0x86')](_0x7c1a('0x8b'));return new BPromise(function(_0x496f20,_0x91f592){if(_0x4e66a8<=0x0||isNaN(_0x4e66a8)){return _0x91f592(msgResponse('[busyFactor]','Error',_0x7c1a('0x21d')+_0x4e66a8));}if(_0x3c40fe<=0x0||isNaN(_0x3c40fe)){return _0x91f592(msgResponse(_0x7c1a('0x21e'),_0x7c1a('0x50'),_0x7c1a('0x21f')+_0x3c40fe));}if(_0x41aeb0<=0x0||isNaN(_0x41aeb0)){return _0x91f592(msgResponse(_0x7c1a('0x21e'),_0x7c1a('0x50'),_0x7c1a('0x219')+_0x41aeb0));}if(_0xe61985<=0x0||isNaN(_0xe61985)){return _0x91f592(msgResponse('[busyFactor]',_0x7c1a('0x50'),'interval\x20=\x20'+_0xe61985));}if(_0xb939ea<=0x0||isNaN(_0xb939ea)){return _0x91f592(msgResponse(_0x7c1a('0x21e'),_0x7c1a('0x50'),_0x7c1a('0x220')+_0xb939ea));}_0x2638fb=_0x2638fb||0x0;var _0x4bd472=0x1/_0x3c40fe;var _0x16f6cf=0x0;var _0x40bffd=0x0;var _0x171e01=0x0;var _0x3343ef=0x0;for(var _0x48926e=0x0;_0x3343ef<_0xb939ea;_0x48926e+=0x1){_0x40bffd=_0x48926e/_0xe61985;_0x16f6cf=(_0x41aeb0*_0x40bffd+_0x2638fb)/_0x4bd472;_0x171e01=erlangb(_0x16f6cf,_0x4e66a8);_0x3343ef=_0x16f6cf/_0x4e66a8*(0x1-erlangb(_0x16f6cf,_0x4e66a8));}return _0x496f20({'erlangCalls':_0x48926e,'erlangCallToSecond':_0xe61985/_0x48926e,'erlangAbandonmentRate':_0x171e01,'erlangBusyFactor':_0x3343ef});});};module[_0x7c1a('0x221')]=Dialer;
\ No newline at end of file
+var _0xed6b=['checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','unmonitored','saveInDb','uniqueid','amdstatus','exten','dialAMDActive','HANGUP','statedesc','membername','AMD','emit','buildObj','amd','[syncHangupInAMD][createHistory]','value','MACHINE','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','countnoanswerretry','createStateFinal','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','agiafterat','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','syncNewExten','channel','locked','paused','stateinterface','actionid','rrmemory','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','iftime\x20%s,%s','interval','timezones','command','content','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','handlePower','method\x20not\x20recognized','checkPreviewRecallReminder','Agent','user:dialPreviewRecallReminder','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','trim','substring','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','voicePause','unlockContact','dialRecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','reachable','[handlePredictive][limitChannel]','tryOriginatePredictive','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/setting','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','isEmpty','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','unmanaged','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','undefined','sequence','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20'];(function(_0x1b4e88,_0x392683){var _0x3e56f7=function(_0x2b38b2){while(--_0x2b38b2){_0x1b4e88['push'](_0x1b4e88['shift']());}};_0x3e56f7(++_0x392683);}(_0xed6b,0x15f));var _0xbed6=function(_0x2f541c,_0x8b5ae7){_0x2f541c=_0x2f541c-0x0;var _0x51ef26=_0xed6b[_0x2f541c];return _0x51ef26;};'use strict';var util=require(_0xbed6('0x0'));var _=require(_0xbed6('0x1'));var BPromise=require(_0xbed6('0x2'));var uuid=require('uuid');var moment=require(_0xbed6('0x3'));var rr=require('rr');var md5=require(_0xbed6('0x4'));var Redis=require(_0xbed6('0x5'));var ut=require(_0xbed6('0x6'));var config=require(_0xbed6('0x7'));var logger=require(_0xbed6('0x8'))(_0xbed6('0x9'));var loggerBooked=require(_0xbed6('0x8'))(_0xbed6('0xa'));var loggerPredictive=require(_0xbed6('0x8'))(_0xbed6('0xb'));var loggerPredictiveCalls=require('../../../config/logger')(_0xbed6('0xc'));var loggerSyncQueueSummary=require(_0xbed6('0x8'))(_0xbed6('0xd'));var ami=require(_0xbed6('0xe'));config['redis']=_['defaults'](config[_0xbed6('0xf')],{'host':_0xbed6('0x10'),'port':0x18eb});var io=require(_0xbed6('0x11'))(new Redis(config['redis']));var cmHopper=require(_0xbed6('0x12'));var cmHopperHistory=require(_0xbed6('0x13'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xbed6('0x14'));var RpcSetting=require(_0xbed6('0x15'));var Action=require(_0xbed6('0x16'));var History=require('./history');var Final=require(_0xbed6('0x17'));var AgentComplete=require(_0xbed6('0x18'));var QueueCallerAbandon=require(_0xbed6('0x19'));var Hangup=require(_0xbed6('0x1a'));var ipAgi=process[_0xbed6('0x1b')][_0xbed6('0x1c')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xbed6('0x1d')][_0xbed6('0x1e')]=function(_0x37341f){this[_0xbed6('0x1f')]=this[_0xbed6('0x1f')]?this[_0xbed6('0x1f')][_0xbed6('0x20')](_0x37341f):_0x37341f();};function Dialer(_0x228c9c,_0x418774){this['sequence']=new Sequence();this[_0xbed6('0x21')]=_0x418774;this[_0xbed6('0x22')]=_0x228c9c[_0xbed6('0x22')];this[_0xbed6('0x23')]=_0x228c9c[_0xbed6('0x23')];this[_0xbed6('0x24')]=_0x228c9c[_0xbed6('0x24')];this[_0xbed6('0x25')]=_0x228c9c[_0xbed6('0x25')];this[_0xbed6('0x26')]=config[_0xbed6('0x26')]||0x2;this['channels']={};this[_0xbed6('0x27')]={};this[_0xbed6('0x28')]={};this[_0xbed6('0x29')]={};this[_0xbed6('0x2a')]={};this[_0xbed6('0x2b')]={};this[_0xbed6('0x2c')]={};this[_0xbed6('0x2d')]={};this[_0xbed6('0x2e')]={};this[_0xbed6('0x2f')]={};ami['on'](_0xbed6('0x30'),this['syncAgentConnect'][_0xbed6('0x31')](this));ami['on'](_0xbed6('0x32'),this[_0xbed6('0x33')][_0xbed6('0x31')](this));ami['on']('originateresponse',this[_0xbed6('0x34')][_0xbed6('0x31')](this));ami['on'](_0xbed6('0x35'),this[_0xbed6('0x36')]['bind'](this));ami['on'](_0xbed6('0x37'),this[_0xbed6('0xd')]['bind'](this));ami['on'](_0xbed6('0x38'),this[_0xbed6('0x39')][_0xbed6('0x31')](this));ami['on'](_0xbed6('0x3a'),this['syncNewExten']['bind'](this));ami['on'](_0xbed6('0x3b'),this[_0xbed6('0x3c')][_0xbed6('0x31')](this));ami['on'](_0xbed6('0x3d'),this[_0xbed6('0x3e')][_0xbed6('0x31')](this));ami['on'](_0xbed6('0x3f'),this[_0xbed6('0x40')][_0xbed6('0x31')](this));this['loopCampaigns']();this[_0xbed6('0x41')]();RpcSetting[_0xbed6('0x42')]()[_0xbed6('0x43')](function(_0x1b253d){previewRecallmeReminderInterval=_0x1b253d[_0xbed6('0x44')];});}function isNotNull(_0x4e3726){return _0x4e3726!==null&&!_[_0xbed6('0x45')](_0x4e3726);}function checkIsLoggedIn(_0x24332c,_0x374e5e){return function(){if(_0x374e5e<=0x0){_0x24332c[_0xbed6('0x46')]=_0xbed6('0x47');throw _0x24332c[_0xbed6('0x48')]+_0xbed6('0x49');}};}function isActive(_0x540a73){return _0x540a73;}function checkIsActive(_0x371a93,_0x5c0faa){return function(){if(!isActive(_0x5c0faa)){_0x371a93[_0xbed6('0x46')]=_0xbed6('0x4a');throw _0x371a93[_0xbed6('0x48')]+_0xbed6('0x4b');}};}function checkInterval(_0x5a00bb){return function(){if(!isNotNull(_0x5a00bb[_0xbed6('0x4c')])){_0x5a00bb[_0xbed6('0x46')]=_0xbed6('0x4d');throw _0x5a00bb[_0xbed6('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x5a00bb[_0xbed6('0x4c')]['Intervals'])){_0x5a00bb[_0xbed6('0x46')]=_0xbed6('0x4d');throw _0x5a00bb['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xbed6('0x4e')](_0x5a00bb['Interval'][_0xbed6('0x4f')]))){_0x5a00bb[_0xbed6('0x46')]=_0xbed6('0x4d');throw _0x5a00bb[_0xbed6('0x48')]+_0xbed6('0x50');}};}function msgResponse(_0x50dd58,_0x543316,_0x128604){return{'action':_0x50dd58,'response':_0x543316,'message':_0x128604,'stack':_0x128604};}function myreject(_0x442f9c){return function(_0x39d6d1){return _0x442f9c(msgResponse(_0xbed6('0x51'),_0xbed6('0x52'),JSON[_0xbed6('0x53')](_0x39d6d1)));};}function getSeconds(_0x40f83f,_0x350cbd){var _0x5232c6=moment(_0x40f83f)[_0xbed6('0x54')](0x0);var _0x833de1=moment(_0x350cbd)['milliseconds'](0x0);return _0x5232c6[_0xbed6('0x55')](_0x833de1,_0xbed6('0x56'));}function emit(_0x2e47f0,_0x3fcb85,_0x2f5fa5){io['to'](_0x2e47f0)['emit'](_0x3fcb85,_0x2f5fa5);}function emitVoiceQueueSummary(_0x1fd3ab){if(_0x1fd3ab[_0xbed6('0x57')]===_0xbed6('0x58')){var _0x24c7ac={'id':_0x1fd3ab['id'],'name':_0x1fd3ab[_0xbed6('0x48')],'strategy':_0x1fd3ab[_0xbed6('0x59')],'answered':_0x1fd3ab[_0xbed6('0x5a')],'available':_0x1fd3ab[_0xbed6('0x5b')],'loggedIn':_0x1fd3ab[_0xbed6('0x5c')],'pTalking':_0x1fd3ab[_0xbed6('0x5d')],'sumBillable':_0x1fd3ab['sumBillable'],'sumDuration':_0x1fd3ab[_0xbed6('0x5e')],'sumHoldTime':_0x1fd3ab['sumHoldTime']||0x0,'talking':_0x1fd3ab[_0xbed6('0x5f')],'total':_0x1fd3ab[_0xbed6('0x60')],'type':_0x1fd3ab[_0xbed6('0x57')],'unmanaged':_0x1fd3ab[_0xbed6('0x61')],'abandoned':_0x1fd3ab[_0xbed6('0x62')],'waiting':_0x1fd3ab[_0xbed6('0x63')],'loggedInDb':_0x1fd3ab['loggedInDb'],'dialActive':_0x1fd3ab['dialActive'],'dialMethod':_0x1fd3ab[_0xbed6('0x64')],'dialOriginateCallerIdName':_0x1fd3ab[_0xbed6('0x65')],'dialOriginateCallerIdNumber':_0x1fd3ab['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1fd3ab['dialOriginateTimeout'],'dialPrefix':_0x1fd3ab[_0xbed6('0x66')],'outboundAnswerAgiCallsDay':_0x1fd3ab['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1fd3ab['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1fd3ab[_0xbed6('0x67')],'outboundBusyCallsDay':_0x1fd3ab[_0xbed6('0x68')],'outboundCongestionCallsDay':_0x1fd3ab[_0xbed6('0x69')],'outboundDropCallsDayACS':_0x1fd3ab[_0xbed6('0x6a')],'outboundDropCallsDayCallersExit':_0x1fd3ab[_0xbed6('0x6b')],'outboundDropCallsDayTimeout':_0x1fd3ab[_0xbed6('0x6c')],'outboundNoAnswerCallsDay':_0x1fd3ab[_0xbed6('0x6d')],'outboundNoSuchCallsDay':_0x1fd3ab[_0xbed6('0x6e')],'outboundOriginateFailureCallsDay':_0x1fd3ab[_0xbed6('0x6f')],'outboundReCallsDay':_0x1fd3ab[_0xbed6('0x70')],'outboundRejectCallsDay':_0x1fd3ab[_0xbed6('0x71')],'outboundUnknownCallsDay':_0x1fd3ab[_0xbed6('0x72')],'predictiveIntervalAnsweredCalls':_0x1fd3ab['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1fd3ab[_0xbed6('0x73')],'predictiveIntervalAvgTalktime':_0x1fd3ab[_0xbed6('0x74')],'predictiveIntervalDroppedCallsCallersExit':_0x1fd3ab[_0xbed6('0x75')],'predictiveIntervalDroppedCallsTimeout':_0x1fd3ab['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1fd3ab['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1fd3ab['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1fd3ab[_0xbed6('0x76')],'predictiveIntervalMultiplicativeFactor':_0x1fd3ab['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1fd3ab[_0xbed6('0x77')],'predictiveIntervalAvailable':_0x1fd3ab[_0xbed6('0x78')],'predictiveIntervalTotalCalls':_0x1fd3ab[_0xbed6('0x79')],'message':_0x1fd3ab[_0xbed6('0x46')],'originated':_0x1fd3ab[_0xbed6('0x7a')],'erlangCalls':_0x1fd3ab[_0xbed6('0x7b')],'erlangCallToSecond':_0x1fd3ab['erlangCallToSecond'],'erlangAbandonmentRate':_0x1fd3ab[_0xbed6('0x7c')],'erlangBusyFactor':_0x1fd3ab[_0xbed6('0x7d')],'startPredictive':_0x1fd3ab['startPredictive'],'startProgressive':_0x1fd3ab[_0xbed6('0x2c')]};if(_0x1fd3ab['Trunk']){_0x24c7ac[_0xbed6('0x7e')]={'id':_0x1fd3ab['Trunk']['id'],'name':_0x1fd3ab[_0xbed6('0x7e')]['name'],'active':_0x1fd3ab[_0xbed6('0x7e')][_0xbed6('0x7f')],'callerid':_0x1fd3ab[_0xbed6('0x7e')]['callerid']};}if(_0x1fd3ab[_0xbed6('0x4c')]){_0x24c7ac['Interval']={'id':_0x1fd3ab[_0xbed6('0x4c')]['id'],'name':_0x1fd3ab[_0xbed6('0x4c')]['name']};}var _0x832a0d=md5(JSON[_0xbed6('0x53')](_0x24c7ac));if(_0x1fd3ab[_0xbed6('0x4')]!==_0x832a0d){_0x1fd3ab[_0xbed6('0x4')]=_0x832a0d;emit(util['format'](_0xbed6('0x80'),_0x24c7ac[_0xbed6('0x48')]),_0xbed6('0x81'),_0x24c7ac);}}}function emitCampaignSummary(_0x5c6727){if(_0x5c6727[_0xbed6('0x57')]===_0xbed6('0x82')){emit(util[_0xbed6('0x83')](_0xbed6('0x84'),_0x5c6727['name']),'campaign:save',_0x5c6727);}}function checkGetDataPredictive(_0x2353d1){if(isNotNull(_0x2353d1)&&!_[_0xbed6('0x4e')](_0x2353d1)){loggerPredictive[_0xbed6('0x85')](_0xbed6('0x86'));loggerPredictive[_0xbed6('0x85')](_0xbed6('0x87'),_0x2353d1['predictiveIntervalTotalCalls']);loggerPredictive[_0xbed6('0x85')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2353d1[_0xbed6('0x88')]);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x89'),_0x2353d1['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x8a'),_0x2353d1[_0xbed6('0x75')]);loggerPredictive['info'](_0xbed6('0x8b'),_0x2353d1[_0xbed6('0x73')]);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x8c'),_0x2353d1[_0xbed6('0x74')]);loggerPredictive['info'](_0xbed6('0x8d'));if(_0x2353d1[_0xbed6('0x79')]>0x0){if(!_[_0xbed6('0x45')](_0x2353d1['predictiveIntervalAvgTalktime'])&&_0x2353d1[_0xbed6('0x74')]>0x0){return!![];}loggerPredictive[_0xbed6('0x85')](_0xbed6('0x8e'));if(!_[_0xbed6('0x45')](_0x2353d1[_0xbed6('0x73')])&&_0x2353d1[_0xbed6('0x73')]>0x0){return!![];}loggerPredictive[_0xbed6('0x85')](_0xbed6('0x8f'));}else{loggerPredictive[_0xbed6('0x85')](_0xbed6('0x90'));}}else{loggerPredictive[_0xbed6('0x85')](_0xbed6('0x91'));}return![];}function mergeDataErlangB(_0x270e3e){return function(_0x75ad83){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xbed6('0x85')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x75ad83[_0xbed6('0x7b')]);loggerPredictive[_0xbed6('0x85')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x75ad83[_0xbed6('0x92')]);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x93'),_0x75ad83[_0xbed6('0x7c')]);loggerPredictive['info'](_0xbed6('0x94'),_0x75ad83[_0xbed6('0x7d')]);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x93'),_0x75ad83[_0xbed6('0x7c')]);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x8d'));_[_0xbed6('0x95')](_0x270e3e,_0x75ad83);};}function getDiff(_0x1a3912){var _0x53f912=moment()['milliseconds'](0x0);var _0x4b21ed=moment(_0x1a3912)[_0xbed6('0x54')](0x0);return _0x53f912['diff'](_0x4b21ed,_0xbed6('0x56'));}function ifInterval(_0xaa58f1,_0x20fe06){if(_['isUndefined'](_0x20fe06)){return![];}return getDiff(_0x20fe06)<_0xaa58f1*0x3c;}function freeVariablesPredictive(_0x49e1b6){if(isNotNull(_0x49e1b6)){if(!_['isUndefined'](_0x49e1b6[_0xbed6('0x2c')])){_0x49e1b6[_0xbed6('0x2c')]=undefined;loggerPredictive[_0xbed6('0x85')](_0x49e1b6['name'],_0xbed6('0x96'));}if(!_[_0xbed6('0x45')](_0x49e1b6[_0xbed6('0x2b')])){_0x49e1b6[_0xbed6('0x2b')]=undefined;loggerPredictive[_0xbed6('0x85')](_0x49e1b6['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xbed6('0x45')](_0x49e1b6[_0xbed6('0x97')])){clearInterval(_0x49e1b6[_0xbed6('0x97')]);_0x49e1b6['handlePredictive']=undefined;loggerPredictive['info'](_0x49e1b6['name'],_0xbed6('0x98'));}}}function erlangb(_0x45cda6,_0x5b0df9){if(_0x5b0df9===0x0){return 0x0;}var _0x49d7d5=0x1;for(var _0x2ead15=0x1;_0x2ead15<=_0x5b0df9;_0x2ead15+=0x1){_0x49d7d5=0x1+_0x49d7d5*_0x2ead15/_0x45cda6;}return 0x1/_0x49d7d5;}function isVoiceQueueOutbound(_0x498da1){return _0x498da1==='outbound';}function isNotPreview(_0x3f1906){return _0x3f1906!==_0xbed6('0x21');}function isCampaignIvr(_0x136542){return _0x136542===_0xbed6('0x82');}function getCallerId(_0xf9c47c,_0xbfd0ed,_0x28c1dd){if(!_['isUndefined'](_0x28c1dd)&&typeof _0x28c1dd==='string'&&!_[_0xbed6('0x4e')](_0x28c1dd)){if(!_['isUndefined'](_0xbfd0ed)&&typeof _0xbfd0ed===_0xbed6('0x99')&&!_[_0xbed6('0x4e')](_0xbfd0ed)){return util[_0xbed6('0x83')](_0xbed6('0x9a'),_0xbfd0ed,_0x28c1dd);}return util[_0xbed6('0x83')](_0xbed6('0x9a'),_0x28c1dd,_0x28c1dd);}if(!_[_0xbed6('0x45')](_0xf9c47c)&&typeof _0xf9c47c===_0xbed6('0x99')&&!_[_0xbed6('0x4e')](_0xf9c47c)){return _0xf9c47c;}return _0xbed6('0x9b');}function loggerCatchQueueSummary(_0x45c771,_0x45b3c6){return function(_0x16215a){freeVariablesPredictive(_0x45b3c6);emitVoiceQueueSummary(_0x45b3c6);emitCampaignSummary(_0x45b3c6);loggerSyncQueueSummary[_0xbed6('0x9c')](_0x45c771,util[_0xbed6('0x9d')](_0x16215a,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2a0fe5,_0x1ef1bc){return function(_0x4d0244){loggerPredictive[_0xbed6('0x9c')](_0x1ef1bc[_0xbed6('0x48')],_0x2a0fe5);loggerPredictive['error'](_0x4d0244['stack']);freeVariablesPredictive(_0x1ef1bc);};}function loggerCatch(_0x2b13be){return function(_0x248a5d){logger[_0xbed6('0x9c')](_0x2b13be,util[_0xbed6('0x9d')](_0x248a5d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5f221a){return _0x5f221a&&!_[_0xbed6('0x45')](_0x5f221a)&&_0x5f221a['length']>0x0;}function decremetOriginate(_0x43be55){if(!_[_0xbed6('0x45')](_0x43be55)&&_0x43be55!==null){if(typeof _0x43be55[_0xbed6('0x7a')]!=='undefined'){if(_0x43be55['originated']>0x0){_0x43be55[_0xbed6('0x7a')]-=0x1;}else{logger[_0xbed6('0x9c')](_0xbed6('0x9e'));}}}else{logger[_0xbed6('0x9c')](_0xbed6('0x9f'));}}function checkContactLowerLimitOriginate(_0x587cf3,_0x7add0b,_0xeb9fa9){if(_0x7add0b>_0xeb9fa9){for(var _0x45b96a=0x0;_0x45b96a<_0x7add0b-_0xeb9fa9;_0x45b96a+=0x1){decremetOriginate(_0x587cf3);}}}function loggerGetContactDialer(_0x44b119,_0x40c15e,_0x470de7){return function(_0x3a922e){checkContactLowerLimitOriginate(_0x40c15e,_0x470de7,0x0);logger[_0xbed6('0x9c')](_0x44b119,util[_0xbed6('0x9d')](_0x3a922e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4b9901){return function(_0x123aa1){if(isNotNull(_0x123aa1)&&isNotNull(_0x123aa1[0x0])){if(_0x123aa1[0x0][_0xbed6('0xa0')]>0x0){_0x4b9901[_0xbed6('0x46')]='RESCHEDULED_CONTACTS';logger['info']('[getContactDialer2][ReScheduled]'+_0x4b9901['name'],_0x123aa1[0x0][_0xbed6('0xa0')],_0xbed6('0xa1'));}else{_0x4b9901['message']=_0xbed6('0xa2');logger[_0xbed6('0x85')]('[getContactDialer2][Empty]'+_0x4b9901['name']);}}};}function notSendMessagesQueue(_0x5ee2a9){if(_0x5ee2a9['sendMessageOneNotActive']){freeVariablesPredictive(_0x5ee2a9);if(_0x5ee2a9['originated']===0x0&&_0x5ee2a9['talking']===0x0&&_0x5ee2a9[_0xbed6('0x63')]===0x0&&(_0x5ee2a9[_0xbed6('0x5d')]||0x0)===0x0){_0x5ee2a9[_0xbed6('0xa3')]=![];_0x5ee2a9[_0xbed6('0x5b')]=0x0;_0x5ee2a9['message']=_0xbed6('0x4a');loggerSyncQueueSummary[_0xbed6('0x9c')](_0xbed6('0xa4'),_0x5ee2a9[_0xbed6('0x48')],_0xbed6('0xa5'));}else{_0x5ee2a9[_0xbed6('0x46')]=_0xbed6('0xa6');loggerSyncQueueSummary[_0xbed6('0x9c')](_0xbed6('0xa4'),_0x5ee2a9[_0xbed6('0x48')],_0xbed6('0xa7'));}emitVoiceQueueSummary(_0x5ee2a9);}}function notSendMessagesCampaign(_0x2e0804){if(_0x2e0804[_0xbed6('0xa3')]){if(_0x2e0804[_0xbed6('0x7a')]===0x0){_0x2e0804[_0xbed6('0xa3')]=![];_0x2e0804['message']='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2e0804[_0xbed6('0x48')],_0xbed6('0xa5'));}else{_0x2e0804[_0xbed6('0x46')]=_0xbed6('0xa6');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2e0804[_0xbed6('0x48')],'is\x20disactive');}emitCampaignSummary(_0x2e0804);}}function createObjHistory(_0x353360,_0x230553,_0x11d291,_0x52981b,_0x205020){_0x353360[_0xbed6('0x46')]=_0x11d291;var _0x1845ef=new Action(_0x353360,_0x230553);var _0x1b8853=new History(_0x1845ef);_0x1b8853[_0xbed6('0xa8')]=_0x52981b;_0x1b8853['statedesc']=_0x205020;_0x1b8853[_0xbed6('0xa9')]=_0x1845ef[_0xbed6('0xaa')];return _0x1b8853;}Dialer[_0xbed6('0x1d')][_0xbed6('0x41')]=function(){var _0x41d4f4=this;setInterval(function(){_0x41d4f4[_0xbed6('0xab')](_0x41d4f4[_0xbed6('0x29')],_0xbed6('0xac'));_0x41d4f4[_0xbed6('0xab')](_0x41d4f4['actions'],_0xbed6('0xad'));},0x32c8);};Dialer[_0xbed6('0x1d')][_0xbed6('0xab')]=function(_0x2fec49,_0x57b323){var _0xbb749d=this;for(var _0x11caa7 in _0x2fec49){if(typeof _0x2fec49[_0x11caa7]!==_0xbed6('0xae')){this[_0xbed6('0xaf')][_0xbed6('0x1e')](function(){if(!_[_0xbed6('0xb0')](_0x2fec49[_0x11caa7])){return ami[_0xbed6('0xb1')]({'action':_0xbed6('0xb2'),'channel':_0x2fec49[_0x11caa7]['channel']})[_0xbed6('0xb3')](function(_0xb1f987){if(_0xb1f987[_0xbed6('0x46')]===_0xbed6('0xb4')){setTimeout(function(){if(_0x2fec49[_0x11caa7]&&_0x2fec49[_0x11caa7][_0xbed6('0x57')]!==_0xbed6('0x82')){_0xbb749d[_0xbed6('0xb5')](_0xbb749d[_0xbed6('0x22')][_0x2fec49[_0x11caa7][_0xbed6('0xb6')]]);logger[_0xbed6('0x9c')]('[Dialer][checkChannel]',_0x57b323,_0x11caa7,_0x2fec49[_0x11caa7][_0xbed6('0xb6')]);delete _0x2fec49[_0x11caa7];}if(_0x2fec49[_0x11caa7]&&_0x2fec49[_0x11caa7][_0xbed6('0x57')]===_0xbed6('0x82')){_0xbb749d[_0xbed6('0xb5')](_0xbb749d[_0xbed6('0x23')][_0x2fec49[_0x11caa7][_0xbed6('0xb6')]]);logger[_0xbed6('0x9c')](_0xbed6('0xb7'),_0x57b323,_0x11caa7,_0x2fec49[_0x11caa7]['queue']);delete _0x2fec49[_0x11caa7];}},0x2328);}});}});}}};Dialer[_0xbed6('0x1d')][_0xbed6('0xb8')]=function(_0x38cc9e){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopper['countReScheduled'](_0x38cc9e))[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xba')));};Dialer[_0xbed6('0x1d')][_0xbed6('0xbb')]=function(_0x4af8cc){return BPromise[_0xbed6('0xb9')]()['then'](cmHopperBlack[_0xbed6('0xbb')](_0x4af8cc))[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xbc')));};Dialer['prototype'][_0xbed6('0xbd')]=function(_0x195e1a){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopperBlack[_0xbed6('0xbd')](_0x195e1a))[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xbe')));};Dialer[_0xbed6('0x1d')][_0xbed6('0xbf')]=function(_0x13fa83){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopperHistory[_0xbed6('0xc0')](_0x13fa83))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xbed6('0x1d')][_0xbed6('0xc1')]=function(_0x46838d){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopper['rescheduleContact'](_0x46838d))[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xc2')));};Dialer[_0xbed6('0x1d')]['unlockContact']=function(_0x512e82,_0x5567a0,_0x425767){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopper['unlockContact'](_0x512e82,_0x5567a0,_0x425767))[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xc3')));};Dialer['prototype'][_0xbed6('0xc4')]=function(_0x5c5984,_0x3408b0,_0x5e6efa,_0xe5b00d,_0x5c0078){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopper[_0xbed6('0xc4')](_0x5c5984,_0x3408b0,_0x5e6efa,_0xe5b00d))[_0xbed6('0xb3')](function(_0x38784a){_0x5c0078['temp']-=_0x5e6efa;_0x5c0078['temp']=_0x5c0078[_0xbed6('0xc5')]>0x0?_0x5c0078['temp']:0x0;loggerCatch(_0xbed6('0xc6'))(_0x38784a);});};Dialer[_0xbed6('0x1d')][_0xbed6('0xc7')]=function(_0x1f0146,_0x17b894,_0x4bb110,_0x2ac627){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopper[_0xbed6('0xc7')](_0x1f0146,_0x17b894,_0x4bb110))[_0xbed6('0xb3')](function(_0x50cb91){_0x2ac627[_0xbed6('0xc5')]-=_0x17b894;_0x2ac627['temp']=_0x2ac627[_0xbed6('0xc5')]>0x0?_0x2ac627[_0xbed6('0xc5')]:0x0;loggerCatch(_0xbed6('0xc8'))(_0x50cb91);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x1ff97f){return BPromise['resolve']()[_0xbed6('0x43')](voiceQueueRt[_0xbed6('0xc9')](_0x1ff97f))[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xca')));};Dialer[_0xbed6('0x1d')][_0xbed6('0xcb')]=function(_0x2728fc){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopper[_0xbed6('0xcb')](_0x2728fc))[_0xbed6('0xb3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xbed6('0x1d')]['createHistory']=function(_0x22f359){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopperHistory[_0xbed6('0xcc')](_0x22f359))[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xcd')));};Dialer[_0xbed6('0x1d')]['updateOriginated']=function(_0x18ff73){if(!_[_0xbed6('0x45')](_0x18ff73)&&_0x18ff73!==null){if(typeof _0x18ff73[_0xbed6('0x7a')]!=='undefined'){if(_0x18ff73[_0xbed6('0x7a')]>0x0){_0x18ff73['originated']-=0x1;}else{logger[_0xbed6('0x9c')](_0xbed6('0xce'));}}}else{logger[_0xbed6('0x9c')](_0xbed6('0xcf'));}};Dialer['prototype'][_0xbed6('0xd0')]=function(_0x15497c,_0x4c5d89){var _0x1be7c9=this;return function(_0x286239){_0x1be7c9['updateOriginated'](_0x4c5d89);logger[_0xbed6('0x9c')](_0x15497c,util['inspect'](_0x286239,{'showHidden':![],'depth':null}));};};Dialer[_0xbed6('0x1d')][_0xbed6('0xd1')]=function(_0xc07a6a,_0x1655c9,_0x50c511){var _0x4c137f={'state':0x19,'statedesc':_0xbed6('0xd2')};this['updateOriginated'](_0x1655c9);this['saveInDb'](_[_0xbed6('0x95')](_0x4c137f,_[_0xbed6('0xd3')](_0x50c511,[_0xbed6('0xd4'),_0xbed6('0xd5'),'UserId',_0xbed6('0xd6'),_0xbed6('0xd7')])),_0xbed6('0xd8'),_0xbed6('0xd9'));logger['error'](_0xc07a6a);};Dialer[_0xbed6('0x1d')][_0xbed6('0xda')]=function(_0x19b5a9){return _0x19b5a9==='Success';};Dialer['prototype'][_0xbed6('0xdb')]=function(_0x7bbace){return!_[_0xbed6('0x45')](_0x7bbace)&&_0x7bbace&&!_['isUndefined'](_0x7bbace[_0xbed6('0x48')])&&!_[_0xbed6('0x45')](_0x7bbace['active'])&&_0x7bbace[_0xbed6('0x7f')]&&(this[_0xbed6('0x25')][util['format']('SIP/%s',_0x7bbace['name'])][_0xbed6('0xb2')]==='reachable'||this[_0xbed6('0x25')][util[_0xbed6('0x83')](_0xbed6('0xdc'),_0x7bbace[_0xbed6('0x48')])][_0xbed6('0xb2')]===_0xbed6('0xdd'));};Dialer[_0xbed6('0x1d')][_0xbed6('0xde')]=function(_0x1326ec,_0x23217c,_0x4a399b){this['createHistory'](_0x1326ec)[_0xbed6('0xb3')](loggerCatch(_0x23217c));this[_0xbed6('0xcb')](_0x1326ec)[_0xbed6('0xb3')](loggerCatch(_0x4a399b));};Dialer[_0xbed6('0x1d')][_0xbed6('0x3c')]=function(_0x1a658b){var _0x82f8d9=this[_0xbed6('0x29')][_0x1a658b[_0xbed6('0xdf')]];var _0x9e2475;if(!_[_0xbed6('0xb0')](_0x1a658b)&&!_[_0xbed6('0xb0')](_0x1a658b['variable'])&&!_[_0xbed6('0xb0')](_0x1a658b['variable'][_0xbed6('0xe0')])&&_0x1a658b[_0xbed6('0xe1')]==='xcally-motion-dialer'&&_0x82f8d9){if(_0x82f8d9[_0xbed6('0x57')]!==_0xbed6('0x82')&&this[_0xbed6('0x22')][_0x82f8d9[_0xbed6('0xb6')]][_0xbed6('0xe2')]&&_0x1a658b['value']===_0xbed6('0xe3')){delete this['uniqueId'][_0x1a658b[_0xbed6('0xdf')]];this['updateOriginated'](this[_0xbed6('0x22')][_0x82f8d9['queue']]);this[_0xbed6('0x22')][_0x82f8d9[_0xbed6('0xb6')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x82f8d9[_0xbed6('0xb6')]]['outboundAnswerAgiCallsDay']+=0x1;_0x9e2475=new Hangup(_0x82f8d9,_0x1a658b);_0x9e2475[_0xbed6('0xa8')]=0x12;_0x9e2475[_0xbed6('0xe4')]='HangupInAMD';_0x9e2475[_0xbed6('0xe5')]=_0xbed6('0xe6');ami[_0xbed6('0xe7')]('custom:amd',ut[_0xbed6('0xe8')](_0x9e2475,_0xbed6('0xe9')));this['saveInDb'](_0x9e2475,_0xbed6('0xea'),'[syncHangupInAMD]');}if(_0x82f8d9[_0xbed6('0x57')]!==_0xbed6('0x82')&&this[_0xbed6('0x22')][_0x82f8d9[_0xbed6('0xb6')]][_0xbed6('0xe2')]&&_0x1a658b[_0xbed6('0xeb')]===_0xbed6('0xec')){var _0x24db25=this;return new BPromise(function(_0xd9ce3a,_0x2df74b){delete _0x24db25[_0xbed6('0x29')][_0x1a658b[_0xbed6('0xdf')]];_0x24db25[_0xbed6('0xb5')](_0x24db25[_0xbed6('0x22')][_0x82f8d9[_0xbed6('0xb6')]]);_0x24db25[_0xbed6('0x22')][_0x82f8d9[_0xbed6('0xb6')]][_0xbed6('0xed')]+=0x1;_0x24db25[_0xbed6('0x22')][_0x82f8d9[_0xbed6('0xb6')]][_0xbed6('0xee')]+=0x1;var _0x3c577c=_0x24db25[_0xbed6('0x22')][_0x82f8d9[_0xbed6('0xb6')]];var _0x5a9eca=new Hangup(_0x82f8d9,_0x1a658b);_0x5a9eca['state']=0x13;_0x5a9eca[_0xbed6('0xe4')]=_0xbed6('0xef');_0x5a9eca['membername']='AMD';_0x5a9eca[_0xbed6('0xf0')]+=0x1;_0x5a9eca[_0xbed6('0xf1')]+=0x1;_0x5a9eca[_0xbed6('0xe9')]=!![];ami[_0xbed6('0xe7')](_0xbed6('0xf2'),ut[_0xbed6('0xe8')](_0x5a9eca,_0xbed6('0xe9')));_0x24db25['createHistory'](_0x5a9eca)['catch'](loggerCatch(_0xbed6('0xf3')));if(_0x5a9eca[_0xbed6('0xf4')]+_0x5a9eca['countcongestionretry']+_0x5a9eca['countnoanswerretry']+_0x5a9eca[_0xbed6('0xf5')]+_0x5a9eca[_0xbed6('0xf6')]+_0x5a9eca['countabandonedretry']+_0x5a9eca[_0xbed6('0xf0')]+_0x5a9eca[_0xbed6('0xf7')]>=_0x3c577c[_0xbed6('0xf8')]){_0x24db25[_0xbed6('0xf9')](_0x5a9eca,_0xd9ce3a,_0x2df74b,_0xbed6('0xfa'));}else{if(_0x5a9eca[_0xbed6('0xf0')]>=_0x3c577c[_0xbed6('0xfb')]){_0x24db25['createStateFinal'](_0x5a9eca,_0xd9ce3a,_0x2df74b,_0xbed6('0xfc'));}else{_0x24db25['rescheduleContact']({'active':![],'countmachineretry':_0x5a9eca[_0xbed6('0xf0')],'scheduledat':moment()[_0xbed6('0xfd')](_0x3c577c[_0xbed6('0xfe')],'minutes')[_0xbed6('0x83')](_0xbed6('0xff')),'ContactId':_0x5a9eca[_0xbed6('0xd4')],'ListId':_0x5a9eca[_0xbed6('0xd5')],'VoiceQueueId':_0x5a9eca[_0xbed6('0xd6')]||undefined,'CampaignId':_0x5a9eca['CampaignId']||undefined})['catch'](loggerCatch(_0xbed6('0x100')));_0xd9ce3a({'reschedule':0x1});}}});}if(_0x82f8d9['type']==='ivr'&&this[_0xbed6('0x23')][_0x82f8d9[_0xbed6('0xb6')]][_0xbed6('0xe2')]&&_0x1a658b[_0xbed6('0xeb')]===_0xbed6('0xe3')){delete this['uniqueId'][_0x1a658b['uniqueid']];this[_0xbed6('0xb5')](this[_0xbed6('0x23')][_0x82f8d9['queue']]);_0x9e2475=new Hangup(_0x82f8d9,_0x1a658b);_0x9e2475['state']=0x12;_0x9e2475['statedesc']=_0xbed6('0x101');_0x9e2475[_0xbed6('0xe5')]='AMD';ami['emit'](_0xbed6('0xf2'),ut[_0xbed6('0xe8')](_0x9e2475,_0xbed6('0xe9')));this[_0xbed6('0xde')](_0x9e2475,_0xbed6('0x102'),_0xbed6('0x103'));}if(_0x82f8d9[_0xbed6('0x57')]===_0xbed6('0x82')&&this[_0xbed6('0x23')][_0x82f8d9[_0xbed6('0xb6')]][_0xbed6('0xe2')]&&_0x1a658b[_0xbed6('0xeb')]==='MACHINE'){var _0x24db25=this;return new BPromise(function(_0x5af8b5,_0x380a79){delete _0x24db25[_0xbed6('0x29')][_0x1a658b[_0xbed6('0xdf')]];_0x24db25[_0xbed6('0xb5')](_0x24db25[_0xbed6('0x23')][_0x82f8d9['queue']]);_0x24db25[_0xbed6('0x23')][_0x82f8d9['queue']]['outboundAnswerCallsDay']+=0x1;_0x24db25[_0xbed6('0x23')][_0x82f8d9[_0xbed6('0xb6')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x182dea=_0x24db25[_0xbed6('0x23')][_0x82f8d9[_0xbed6('0xb6')]];var _0xe8ea69=new Hangup(_0x82f8d9,_0x1a658b);_0xe8ea69[_0xbed6('0xa8')]=0x13;_0xe8ea69[_0xbed6('0xe4')]=_0xbed6('0xef');_0xe8ea69[_0xbed6('0xe5')]=_0xbed6('0xe6');_0xe8ea69[_0xbed6('0xf0')]+=0x1;_0xe8ea69[_0xbed6('0xf1')]+=0x1;_0xe8ea69[_0xbed6('0xe9')]=!![];ami[_0xbed6('0xe7')]('custom:amd',ut[_0xbed6('0xe8')](_0xe8ea69,_0xbed6('0xe9')));_0x24db25[_0xbed6('0xcc')](_0xe8ea69)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xf3')));if(_0xe8ea69['countbusyretry']+_0xe8ea69[_0xbed6('0x104')]+_0xe8ea69[_0xbed6('0x105')]+_0xe8ea69[_0xbed6('0xf5')]+_0xe8ea69['countdropretry']+_0xe8ea69['countabandonedretry']+_0xe8ea69[_0xbed6('0xf0')]+_0xe8ea69[_0xbed6('0xf7')]>=_0x182dea[_0xbed6('0xf8')]){_0x24db25[_0xbed6('0xf9')](_0xe8ea69,_0x5af8b5,_0x380a79,_0xbed6('0xfa'));}else{if(_0xe8ea69[_0xbed6('0xf0')]>=_0x182dea[_0xbed6('0xfb')]){_0x24db25[_0xbed6('0x106')](_0xe8ea69,_0x5af8b5,_0x380a79,_0xbed6('0xfc'));}else{_0x24db25[_0xbed6('0xc1')]({'active':![],'countmachineretry':_0xe8ea69['countmachineretry'],'scheduledat':moment()[_0xbed6('0xfd')](_0x182dea[_0xbed6('0xfe')],_0xbed6('0x107'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe8ea69[_0xbed6('0xd4')],'ListId':_0xe8ea69['ListId'],'VoiceQueueId':_0xe8ea69[_0xbed6('0xd6')]||undefined,'CampaignId':_0xe8ea69['CampaignId']||undefined})[_0xbed6('0xb3')](loggerCatch('[rescheduleContact][Machine]'));_0x5af8b5({'reschedule':0x1});}}});}}};Dialer[_0xbed6('0x1d')][_0xbed6('0x39')]=function(_0x5094b1){var _0x1471ff=this[_0xbed6('0x29')][_0x5094b1['uniqueid']];var _0xa70827=this;var _0x5af820;if(_0x1471ff&&_0x1471ff[_0xbed6('0x57')]==='ivr'){delete this['uniqueId'][_0x5094b1[_0xbed6('0xdf')]];this[_0xbed6('0xb5')](this['campaigns'][_0x1471ff[_0xbed6('0xb6')]]);this[_0xbed6('0x23')][_0x1471ff[_0xbed6('0xb6')]][_0xbed6('0x108')]+=0x1;_0x5af820=new Hangup(_0x1471ff,_0x5094b1);this[_0xbed6('0xcc')](_0x5af820)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x109')));this[_0xbed6('0xcb')](_0x5af820)[_0xbed6('0xb3')](loggerCatch('[syncHangupIvr]'));}if(_0x1471ff&&_0x1471ff[_0xbed6('0x57')]!=='ivr'&&isNotNull(this[_0xbed6('0x22')][_0x1471ff[_0xbed6('0xb6')]][_0xbed6('0x10a')])){delete this[_0xbed6('0x29')][_0x5094b1['uniqueid']];this[_0xbed6('0xb5')](this[_0xbed6('0x22')][_0x1471ff[_0xbed6('0xb6')]]);this['voiceQueues'][_0x1471ff[_0xbed6('0xb6')]][_0xbed6('0xed')]+=0x1;this[_0xbed6('0x22')][_0x1471ff[_0xbed6('0xb6')]][_0xbed6('0xee')]+=0x1;_0x5af820=new Hangup(_0x1471ff,_0x5094b1);_0x5af820[_0xbed6('0xa8')]=0x10;_0x5af820[_0xbed6('0xe4')]=_0xbed6('0x10b');_0x5af820[_0xbed6('0xe5')]=_0xbed6('0x10c');this['createHistory'](_0x5af820)[_0xbed6('0xb3')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xbed6('0xcb')](_0x5af820)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x10d')));}if(_0x1471ff&&_0x1471ff[_0xbed6('0x57')]!==_0xbed6('0x82')&&!isNotNull(this[_0xbed6('0x22')][_0x1471ff[_0xbed6('0xb6')]][_0xbed6('0x10a')])){delete this[_0xbed6('0x29')][_0x5094b1[_0xbed6('0xdf')]];this[_0xbed6('0xb5')](this['voiceQueues'][_0x1471ff['queue']]);this[_0xbed6('0x22')][_0x1471ff[_0xbed6('0xb6')]]['outboundUnknownCallsDay']+=0x1;_0x5af820=new Hangup(_0x1471ff,_0x5094b1);_0x5af820[_0xbed6('0xa8')]=0xc;_0x5af820[_0xbed6('0xe4')]=_0x5094b1['cause-txt'];_0x5af820[_0xbed6('0xe5')]='Unknow';this['createHistory'](_0x5af820)[_0xbed6('0xb3')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xbed6('0xcb')](_0x5af820)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x10d')));}};Dialer['prototype'][_0xbed6('0x36')]=function(_0x1e9005){var _0x1ed728=this[_0xbed6('0x29')][_0x1e9005[_0xbed6('0xdf')]];var _0xb9b05d=this;if(this[_0xbed6('0x22')][_0x1e9005[_0xbed6('0xb6')]]){if(_0x1ed728&&_0x1ed728[_0xbed6('0x57')]!==_0xbed6('0x82')){delete this[_0xbed6('0x29')][_0x1e9005[_0xbed6('0xdf')]];this[_0xbed6('0x22')][_0x1e9005['queue']][_0xbed6('0xed')]+=0x1;var _0x2daacf=new AgentComplete(_0x1ed728,_0x1e9005);if(_0x1e9005[_0xbed6('0x10e')]==='agent'){_0x2daacf['agiafterat']=this[_0xbed6('0x22')][_0x1e9005['queue']][_0xbed6('0x10f')]&&this[_0xbed6('0x22')][_0x1e9005[_0xbed6('0xb6')]][_0xbed6('0x110')]?moment()[_0xbed6('0x83')](_0xbed6('0xff')):undefined;}this['createHistory'](_0x2daacf)[_0xbed6('0xb3')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xbed6('0xcb')](_0x2daacf)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x111')));}}};Dialer[_0xbed6('0x1d')][_0xbed6('0x112')]=function(_0x5a0024){if(this[_0xbed6('0x22')][_0x5a0024[_0xbed6('0xb6')]]){if(this[_0xbed6('0x29')][_0x5a0024['uniqueid']]&&this[_0xbed6('0x29')][_0x5a0024[_0xbed6('0xdf')]][_0xbed6('0x57')]!==_0xbed6('0x82')){this[_0xbed6('0xb5')](this['voiceQueues'][_0x5a0024[_0xbed6('0xb6')]]);this[_0xbed6('0x29')][_0x5a0024[_0xbed6('0xdf')]][_0xbed6('0x113')]=moment()[_0xbed6('0x83')](_0xbed6('0xff'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x335505){this[_0xbed6('0xcc')](_0x335505)['catch'](loggerCatch(_0xbed6('0x114')));this[_0xbed6('0xcb')](_0x335505)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x115')));};Dialer['prototype'][_0xbed6('0x33')]=function(_0x34b8ff){var _0x51e8b4=this['uniqueId'][_0x34b8ff[_0xbed6('0xdf')]];var _0x10e858=this;if(this['voiceQueues'][_0x34b8ff[_0xbed6('0xb6')]]){if(_0x51e8b4&&_0x51e8b4['type']!==_0xbed6('0x82')){delete this[_0xbed6('0x29')][_0x34b8ff[_0xbed6('0xdf')]];this[_0xbed6('0xb5')](this['voiceQueues'][_0x34b8ff[_0xbed6('0xb6')]]);_0x51e8b4[_0xbed6('0x116')]=moment()[_0xbed6('0x83')](_0xbed6('0xff'));var _0x389845=new QueueCallerAbandon(_0x51e8b4,_0x34b8ff);if(getSeconds(_0x51e8b4['droptime'],_0x51e8b4['responsetime'])>=_0x51e8b4['dialQueueTimeout']){this[_0xbed6('0x22')][_0x34b8ff[_0xbed6('0xb6')]][_0xbed6('0x117')]+=0x1;this[_0xbed6('0x22')][_0x34b8ff[_0xbed6('0xb6')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xbed6('0x22')][_0x34b8ff[_0xbed6('0xb6')]][_0xbed6('0x118')]+=0x1;_0x389845['state']=0xa;_0x389845['statedesc']='Drop';_0x389845[_0xbed6('0x119')]=_0xbed6('0x11a');_0x389845[_0xbed6('0x11b')]=this[_0xbed6('0x22')][_0x34b8ff[_0xbed6('0xb6')]][_0xbed6('0x10f')]?moment()[_0xbed6('0x83')](_0xbed6('0xff')):undefined;_0x389845[_0xbed6('0xf6')]+=0x1;_0x389845[_0xbed6('0xf1')]+=0x1;if(_0x389845[_0xbed6('0xf6')]>=this[_0xbed6('0x22')][_0x34b8ff[_0xbed6('0xb6')]]['dialDropMaxRetry']){this[_0xbed6('0x11c')](_0x389845);}else{this[_0xbed6('0xc1')]({'active':![],'countdropretry':_0x389845['countdropretry'],'scheduledat':moment()['add'](this[_0xbed6('0x22')][_0x34b8ff['queue']][_0xbed6('0x11d')],_0xbed6('0x107'))['format'](_0xbed6('0xff')),'ContactId':_0x51e8b4[_0xbed6('0xd4')],'ListId':_0x51e8b4['ListId'],'VoiceQueueId':_0x51e8b4[_0xbed6('0xd6')]||undefined,'CampaignId':_0x51e8b4[_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x11e')));var _0x2c3d61=new History(_0x389845);_0x2c3d61[_0xbed6('0xa8')]=0xa;_0x2c3d61[_0xbed6('0xe4')]=_0xbed6('0x11f');_0x2c3d61[_0xbed6('0xaa')]=moment()[_0xbed6('0x83')](_0xbed6('0xff'));_0x2c3d61[_0xbed6('0xa9')]=_0x2c3d61[_0xbed6('0xaa')];_0x2c3d61[_0xbed6('0x120')]=_0x389845[_0xbed6('0x120')];_0x2c3d61[_0xbed6('0x121')]=_0x389845['calleridnum'];this[_0xbed6('0xcc')](_0x2c3d61)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x122')));}}else{this['voiceQueues'][_0x34b8ff[_0xbed6('0xb6')]][_0xbed6('0x75')]+=0x1;this[_0xbed6('0x22')][_0x34b8ff[_0xbed6('0xb6')]][_0xbed6('0x6b')]+=0x1;_0x389845[_0xbed6('0xa8')]=0xb;_0x389845['statedesc']=_0xbed6('0x123');_0x389845[_0xbed6('0x119')]=_0xbed6('0x124');_0x389845[_0xbed6('0x125')]+=0x1;_0x389845[_0xbed6('0xf1')]+=0x1;if(_0x389845[_0xbed6('0x125')]>=this[_0xbed6('0x22')][_0x34b8ff[_0xbed6('0xb6')]][_0xbed6('0x126')]){this['queueCallerAbandonCreateState'](_0x389845);}else{this[_0xbed6('0xc1')]({'active':![],'countabandonedretry':_0x389845['countabandonedretry'],'scheduledat':moment()[_0xbed6('0xfd')](this[_0xbed6('0x22')][_0x34b8ff[_0xbed6('0xb6')]][_0xbed6('0x127')],_0xbed6('0x107'))[_0xbed6('0x83')](_0xbed6('0xff')),'ContactId':_0x51e8b4['ContactId'],'ListId':_0x51e8b4[_0xbed6('0xd5')],'VoiceQueueId':_0x51e8b4['VoiceQueueId']||undefined,'CampaignId':_0x51e8b4[_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x128')));var _0x2c3d61=new History(_0x389845);_0x2c3d61[_0xbed6('0xa8')]=0xb;_0x2c3d61[_0xbed6('0xe4')]='Abandoned';_0x2c3d61[_0xbed6('0xaa')]=moment()[_0xbed6('0x83')](_0xbed6('0xff'));_0x2c3d61[_0xbed6('0xa9')]=_0x2c3d61[_0xbed6('0xaa')];_0x2c3d61['calleridname']=_0x389845[_0xbed6('0x120')];_0x2c3d61['calleridnum']=_0x389845[_0xbed6('0x121')];this[_0xbed6('0xcc')](_0x2c3d61)[_0xbed6('0xb3')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xbed6('0x1d')][_0xbed6('0x129')]=function(_0x252728){if(this[_0xbed6('0x27')][_0x252728[_0xbed6('0xdf')]]){this['actions'][_0x252728[_0xbed6('0xdf')]]['channel']=_0x252728[_0xbed6('0x12a')];}if(this[_0xbed6('0x29')][_0x252728[_0xbed6('0xdf')]]){this['uniqueId'][_0x252728[_0xbed6('0xdf')]]['channel']=_0x252728['channel'];}};Dialer['prototype']['syncQueueMember']=function(_0x6935e5){if(strategy[this[_0xbed6('0x22')][this['actions'][_0x6935e5['actionid']][_0xbed6('0xb6')]][_0xbed6('0x59')]]==='roundrobin'){if(this[_0xbed6('0x27')][_0x6935e5['actionid']]&&_[_0xbed6('0xb0')](this[_0xbed6('0x27')][_0x6935e5['actionid']][_0xbed6('0x12b')])&&_0x6935e5[_0xbed6('0xb2')]==='1'&&_0x6935e5[_0xbed6('0x12c')]==='0'){if(this[_0xbed6('0x24')][_0x6935e5[_0xbed6('0x12d')]]){if(!this[_0xbed6('0x24')][_0x6935e5[_0xbed6('0x12d')]][_0xbed6('0x12b')]){this[_0xbed6('0x24')][_0x6935e5['stateinterface']][_0xbed6('0x12b')]=!![];this['actions'][_0x6935e5['actionid']][_0xbed6('0x12b')]=!![];this[_0xbed6('0x27')][_0x6935e5[_0xbed6('0x12e')]][_0xbed6('0x12d')]=_0x6935e5['stateinterface'];}}}}else if((strategy[this[_0xbed6('0x22')][this[_0xbed6('0x27')][_0x6935e5['actionid']][_0xbed6('0xb6')]][_0xbed6('0x59')]]||_0xbed6('0x12f'))==='rrmemory'){if(this['actions'][_0x6935e5['actionid']]){if(this[_0xbed6('0x24')][_0x6935e5[_0xbed6('0x12d')]]){this[_0xbed6('0x27')][_0x6935e5[_0xbed6('0x12e')]]['stateinterface']=_0x6935e5['stateinterface'];if(_[_0xbed6('0xb0')](this[_0xbed6('0x2e')][this[_0xbed6('0x27')][_0x6935e5[_0xbed6('0x12e')]][_0xbed6('0xb6')]])){this['queueBooked'][this[_0xbed6('0x27')][_0x6935e5[_0xbed6('0x12e')]]['queue']]=[];}this['queueBooked'][this[_0xbed6('0x27')][_0x6935e5['actionid']]['queue']][_0xbed6('0x130')](_[_0xbed6('0x95')](_[_0xbed6('0xd3')](this[_0xbed6('0x27')][_0x6935e5[_0xbed6('0x12e')]],[_0xbed6('0x131'),_0xbed6('0x12d')]),{'status':_0x6935e5[_0xbed6('0xb2')],'paused':_0x6935e5[_0xbed6('0x12c')]}));}}}};function unlockQueueStatus(_0x1adda1,_0x49eb01){setTimeout(function(){if(_[_0xbed6('0x45')](_0x1adda1[_0xbed6('0x132')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x49eb01);}_0x1adda1[_0xbed6('0x132')]=!![];loggerBooked[_0xbed6('0x85')](_0xbed6('0x133'),_0x49eb01,JSON['stringify'](_['pick'](_0x1adda1,[_0xbed6('0x48'),_0xbed6('0x132')])));},0x1f3);}Dialer[_0xbed6('0x1d')]['syncQueueStatusComplete']=function(_0x33ba8a){var _0x3026a4=this;var _0x55d8ca=_0x3026a4[_0xbed6('0x22')][_0x3026a4[_0xbed6('0x27')][_0x33ba8a['actionid']]['queue']];if(strategy[this[_0xbed6('0x22')][this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]][_0xbed6('0x59')]]===_0xbed6('0x134')){if(this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]]&&this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]]['stateinterface']){this[_0xbed6('0x21')][_0xbed6('0x135')](this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0x131')],this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0x12d')])[_0xbed6('0xb3')](function(_0xb01a02){logger[_0xbed6('0x9c')](_0xbed6('0x136'),util[_0xbed6('0x9d')](_0xb01a02,{'showHidden':![],'depth':null}));})[_0xbed6('0x20')](function(){_0x3026a4[_0xbed6('0xb5')](_0x3026a4[_0xbed6('0x22')][_0x3026a4[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]]['queue']]);_0x3026a4[_0xbed6('0x24')][_0x3026a4[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0x12d')]][_0xbed6('0x12b')]=![];delete _0x3026a4['actions'][_0x33ba8a[_0xbed6('0x12e')]];unlockQueueStatus(_0x55d8ca);});}else{this[_0xbed6('0xb5')](this[_0xbed6('0x22')][this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd4')],'ListId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd5')],'VoiceQueueId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd6')]||undefined,'CampaignId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd7')]||undefined})['catch'](loggerCatch(_0xbed6('0x137')));delete this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]];unlockQueueStatus(_0x55d8ca);}}else if((strategy[this[_0xbed6('0x22')][this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]['strategy']]||_0xbed6('0x12f'))==='rrmemory'){var _0x1ca71b;if(this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]]&&!_[_0xbed6('0x4e')](this['queueBooked'][this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0xb6')]])){if(this[_0xbed6('0x2f')][_0x3026a4[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0xb6')]]){this['queueBookedRR'][_0x3026a4[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]=this[_0xbed6('0x2f')][this['actions'][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]?this[_0xbed6('0x2f')][this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]]['queue']]:this[_0xbed6('0x2e')][this['actions'][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]?this[_0xbed6('0x2e')][this['actions'][_0x33ba8a[_0xbed6('0x12e')]]['queue']]['_rr']||0x0:0x0;}this[_0xbed6('0x2e')][this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]]['queue']]['_rr']=this[_0xbed6('0x2f')][this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]]['queue']];for(var _0x5bf628=0x0;_0x5bf628<this[_0xbed6('0x2e')][this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]['length'];_0x5bf628+=0x1){_0x1ca71b=rr(this[_0xbed6('0x2e')][this['actions'][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]);this[_0xbed6('0x2f')][_0x3026a4['actions'][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]=this[_0xbed6('0x2e')][this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]][_0xbed6('0x138')];if(_0x1ca71b[_0xbed6('0xb2')]==='1'&&_0x1ca71b[_0xbed6('0x12c')]==='0'){break;}}if(!_['isNil'](_0x1ca71b)){this[_0xbed6('0x24')][_0x1ca71b[_0xbed6('0x12d')]]['unlockRR']=_[_0xbed6('0x45')](this['agents'][_0x1ca71b[_0xbed6('0x12d')]][_0xbed6('0x139')])?!![]:this[_0xbed6('0x24')][_0x1ca71b['stateinterface']][_0xbed6('0x139')];}loggerBooked[_0xbed6('0x85')](_0xbed6('0x13a'),_0x33ba8a[_0xbed6('0x12e')],_0xbed6('0x13b'),JSON['stringify'](_['pick'](this[_0xbed6('0x24')][_0x1ca71b[_0xbed6('0x12d')]],[_0xbed6('0x48'),'unlockRR'])),'contactAgent-idHopper:\x20',JSON[_0xbed6('0x53')](_0x1ca71b[_0xbed6('0x131')]));if(!_[_0xbed6('0xb0')](_0x1ca71b)&&_0x1ca71b['status']==='1'&&_0x1ca71b[_0xbed6('0x12c')]==='0'&&this[_0xbed6('0x24')][_0x1ca71b[_0xbed6('0x12d')]]['unlockRR']){this[_0xbed6('0x24')][_0x1ca71b[_0xbed6('0x12d')]][_0xbed6('0x139')]=![];this[_0xbed6('0x2e')][_0x3026a4[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]=[];this[_0xbed6('0x21')][_0xbed6('0x135')](_0x1ca71b[_0xbed6('0x131')],_0x1ca71b[_0xbed6('0x12d')])['catch'](function(_0x18c5b4){logger['error'](_0xbed6('0x136'),util[_0xbed6('0x9d')](_0x18c5b4,{'showHidden':![],'depth':null}));})[_0xbed6('0x20')](function(){_0x3026a4[_0xbed6('0xb5')](_0x3026a4[_0xbed6('0x22')][_0x3026a4[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xb6')]]);setTimeout(function(){_0x3026a4['agents'][_0x1ca71b[_0xbed6('0x12d')]][_0xbed6('0x139')]=!![];loggerBooked[_0xbed6('0x85')]('[booked][RR][finaly]',_0x33ba8a[_0xbed6('0x12e')],'Agent:\x20',JSON['stringify'](_[_0xbed6('0xd3')](_0x3026a4['agents'][_0x1ca71b['stateinterface']],[_0xbed6('0x48'),_0xbed6('0x139')])),_0xbed6('0x13c'),JSON[_0xbed6('0x53')](_0x1ca71b['idHopper']));},0xc7);delete _0x3026a4[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]];unlockQueueStatus(_0x55d8ca,_0x33ba8a[_0xbed6('0x12e')]);});}else{loggerBooked[_0xbed6('0x85')]('[booked][unlock]');this['updateOriginated'](this[_0xbed6('0x22')][this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]]['ContactId'],'ListId':this['actions'][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd5')],'VoiceQueueId':this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0xd6')]||undefined,'CampaignId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd7')]||undefined})['catch'](loggerCatch(_0xbed6('0x137')));delete this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]];unlockQueueStatus(_0x55d8ca);}}else{loggerBooked[_0xbed6('0x85')](_0xbed6('0x13d'));this[_0xbed6('0xb5')](this['voiceQueues'][this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0xd4')],'ListId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd5')],'VoiceQueueId':this[_0xbed6('0x27')][_0x33ba8a['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]];unlockQueueStatus(_0x55d8ca);}}else{loggerBooked[_0xbed6('0x85')](_0xbed6('0x13e'));this[_0xbed6('0xb5')](this[_0xbed6('0x22')][this[_0xbed6('0x27')][_0x33ba8a['actionid']]['queue']]);this[_0xbed6('0xc1')]({'active':![],'ContactId':this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0xd4')],'ListId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd5')],'VoiceQueueId':this[_0xbed6('0x27')][_0x33ba8a['actionid']][_0xbed6('0xd6')]||undefined,'CampaignId':this[_0xbed6('0x27')][_0x33ba8a[_0xbed6('0x12e')]][_0xbed6('0xd7')]||undefined})['catch'](loggerCatch(_0xbed6('0x13f')));delete this[_0xbed6('0x27')][_0x33ba8a['actionid']];unlockQueueStatus(_0x55d8ca);}};Dialer[_0xbed6('0x1d')][_0xbed6('0x140')]=function(){var _0x380c3b=this;return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopper[_0xbed6('0x141')]({}))[_0xbed6('0x43')](function(){setInterval(function(){_0x380c3b[_0xbed6('0x142')]();},0x3e8);});};Dialer['prototype'][_0xbed6('0x143')]=function(_0x4680ca){var _0x5f5658=this;return function(){if(!_0x5f5658[_0xbed6('0xdb')](_0x4680ca[_0xbed6('0x7e')])){if(!_0x5f5658[_0xbed6('0xdb')](_0x4680ca[_0xbed6('0x144')])){_0x4680ca['message']=_0xbed6('0x145');throw _0x4680ca[_0xbed6('0x48')]+_0xbed6('0x146');}}};};Dialer[_0xbed6('0x1d')][_0xbed6('0x147')]=function(_0x4d45a9,_0x46a06e,_0x22825e,_0x8c1d0e){var _0x4c96f9=this;return function(){var _0x57dac6=!![];return _0x4c96f9[_0xbed6('0x148')](_0x4d45a9,_0x46a06e,_0x22825e,_0x8c1d0e,_0x57dac6);};};Dialer[_0xbed6('0x1d')]['checkIfTimeIntervals']=function(_0x217140,_0xd85f2d,_0x1ee56a,_0x411e3f){var _0x29216d=this;return function(){var _0x39ded3=![];return _0x29216d['ifTime'](_0x217140[_0xbed6('0x4f')],_0xd85f2d,_0x1ee56a,_0x411e3f,_0x39ded3);};};Dialer[_0xbed6('0x1d')]['ifTime']=function(_0x54ff6f,_0x20239d,_0xaa466b,_0x3a53d9,_0x2eb90f){var _0x134bd3=[];return new BPromise(function(_0xec15ee,_0x17d82b){if(!isNotNull(_0x54ff6f)){_0x3a53d9[_0xbed6('0x46')]='INTERVAL_IS_NULL';return _0x17d82b(msgResponse('ifTime',_0xbed6('0x149'),_0xaa466b+_0xbed6('0x14a')));}if(_[_0xbed6('0x4e')](_0x54ff6f)){_0x3a53d9['message']='INTERVAL_IS_EMPTY';return _0x17d82b(msgResponse(_0xbed6('0x148'),_0xbed6('0x149'),_0xaa466b+_0xbed6('0x14b')));}if(_0x20239d&&_['isUndefined'](config['timezones'][_0x20239d])){_0x3a53d9[_0xbed6('0x46')]=_0xbed6('0x14c');return _0x17d82b(msgResponse(_0xbed6('0x148'),_0xbed6('0x149'),_0xaa466b+_0xbed6('0x14d')+_0x20239d));}if(_[_0xbed6('0x14e')](_0x54ff6f)){for(var _0x14a19d=0x0;_0x14a19d<_0x54ff6f[_0xbed6('0x14f')];_0x14a19d+=0x1){_0x134bd3[_0xbed6('0x130')](ami[_0xbed6('0xb1')]({'action':'command','command':util[_0xbed6('0x83')](_0xbed6('0x150'),_0x54ff6f[_0x14a19d][_0xbed6('0x151')],!_[_0xbed6('0x45')](config[_0xbed6('0x152')][_0x20239d])?_0x20239d:'')})[_0xbed6('0x43')](function(_0x48dc32){return _0x48dc32['content']['indexOf']('true')>=0x0;})[_0xbed6('0xb3')](myreject(_0x17d82b)));}}else{_0x134bd3[_0xbed6('0x130')](ami['Action']({'action':_0xbed6('0x153'),'command':util[_0xbed6('0x83')]('iftime\x20%s,%s',_0x54ff6f,!_[_0xbed6('0x45')](config[_0xbed6('0x152')][_0x20239d])?_0x20239d:'')})[_0xbed6('0x43')](function(_0x4b01ea){return _0x4b01ea[_0xbed6('0x154')]['indexOf'](_0xbed6('0x155'))>=0x0;})[_0xbed6('0xb3')](myreject(_0x17d82b)));}BPromise[_0xbed6('0x156')](_0x134bd3)[_0xbed6('0x43')](function(_0x323f72){var _0x4c7428=_[_0xbed6('0x157')](_0x323f72);if(_0x4c7428){return _0xec15ee(_0x4c7428);}else{_0x3a53d9['message']=_0x2eb90f?_0xbed6('0x158'):_0xbed6('0x159');return _0x17d82b(msgResponse(_0xbed6('0x15a'),_0xbed6('0x149'),'Global:\x20'+_0x2eb90f+'\x20'+_0xaa466b+_0xbed6('0x15b')+util[_0xbed6('0x9d')](_0x54ff6f,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x20239d));}})[_0xbed6('0xb3')](function(_0x5a55d1){return _0x17d82b(msgResponse(_0xbed6('0x148'),_0xbed6('0x149'),JSON[_0xbed6('0x53')](_0x5a55d1)));});});};Dialer[_0xbed6('0x1d')][_0xbed6('0x15c')]=function(_0x42e0be){var _0x49c1b2=this;return function(){switch(_0x42e0be[_0xbed6('0x64')]){case'progressive':freeVariablesPredictive(_0x42e0be);_0x49c1b2['handlePower'](_0x42e0be,0x1);break;case'power':freeVariablesPredictive(_0x42e0be);_0x49c1b2['handlePower'](_0x42e0be,_0x42e0be['dialPowerLevel']);break;case'predictive':_0x49c1b2['predictive'](_0x42e0be);break;case'booked':freeVariablesPredictive(_0x42e0be);_0x49c1b2[_0xbed6('0x15d')](_0x42e0be,0x1);break;default:freeVariablesPredictive(_0x42e0be);logger[_0xbed6('0x9c')]('Queue',_0x42e0be[_0xbed6('0x48')],_0xbed6('0x15e'));}};};Dialer['prototype'][_0xbed6('0x15f')]=function(_0x4748e9){return BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](cmHopper['handlePreviewRecallNotifications'](_0x4748e9['id'],previewRecallmeReminderInterval))['then'](function(_0x5e39cb){for(var _0x5950f8=0x0;_0x5950f8<_0x5e39cb['length'];_0x5950f8++){var _0x2a65bc=_0x5e39cb[_0x5950f8][_0xbed6('0x160')][_0xbed6('0x48')];if(_0x2a65bc)io['to'](util[_0xbed6('0x83')]('user:%s',_0x2a65bc))['emit'](_0xbed6('0x161'),{'hopper':_0x5e39cb[_0x5950f8]});}})[_0xbed6('0xb3')](function(_0x3b8118){});};Dialer[_0xbed6('0x1d')]['launchHandleIvr']=function(_0x28e11c){var _0x90ad9d=this;return function(){_0x90ad9d[_0xbed6('0x162')](_0x28e11c);};};Dialer['prototype'][_0xbed6('0xd')]=function(_0x23b99f){var _0x1a8415=this;if(isNotPreview(_0x23b99f[_0xbed6('0x64')])){if(isVoiceQueueOutbound(_0x23b99f[_0xbed6('0x57')])&&isActive(_0x23b99f[_0xbed6('0x163')])){_0x23b99f[_0xbed6('0xa3')]=!![];BPromise[_0xbed6('0xb9')]()[_0xbed6('0x43')](checkIsLoggedIn(_0x23b99f,_0x23b99f[_0xbed6('0x5c')]))[_0xbed6('0x43')](checkIsActive(_0x23b99f,_0x23b99f['dialActive']))[_0xbed6('0x43')](checkInterval(_0x23b99f))[_0xbed6('0x43')](_0x1a8415['checkIsTrunkReachable'](_0x23b99f))['then'](_0x1a8415[_0xbed6('0x147')](_0x23b99f[_0xbed6('0x164')],_0x23b99f[_0xbed6('0x165')],_0x23b99f[_0xbed6('0x48')],_0x23b99f))['then'](_0x1a8415['checkIfTimeIntervals'](_0x23b99f['Interval'],_0x23b99f[_0xbed6('0x165')],_0x23b99f[_0xbed6('0x48')],_0x23b99f))['then'](_0x1a8415[_0xbed6('0x15c')](_0x23b99f))[_0xbed6('0xb3')](loggerCatchQueueSummary(_0xbed6('0x166'),_0x23b99f));}else{notSendMessagesQueue(_0x23b99f);}}else{freeVariablesPredictive(_0x23b99f);if(_0x23b99f[_0xbed6('0x167')]){_0x1a8415['checkPreviewRecallReminder'](_0x23b99f);}}};Dialer[_0xbed6('0x1d')][_0xbed6('0x142')]=function(){var _0x148a02=this;var _0x1158a6;for(var _0x9a12d1 in this[_0xbed6('0x23')]){if(typeof this[_0xbed6('0x23')][_0x9a12d1]!==_0xbed6('0xae')){_0x1158a6=this['campaigns'][_0x9a12d1];if(isCampaignIvr(_0x1158a6[_0xbed6('0x57')])&&isActive(_0x1158a6[_0xbed6('0x7f')])){_0x1158a6[_0xbed6('0xa3')]=!![];BPromise['resolve']()[_0xbed6('0x43')](checkIsActive(_0x1158a6,_0x1158a6[_0xbed6('0x7f')]))[_0xbed6('0x43')](checkInterval(_0x1158a6))['then'](_0x148a02[_0xbed6('0x143')](_0x1158a6))[_0xbed6('0x43')](_0x148a02[_0xbed6('0x147')](_0x1158a6[_0xbed6('0x164')],_0x1158a6['dialTimezone'],_0x1158a6[_0xbed6('0x48')],_0x1158a6))['then'](_0x148a02[_0xbed6('0x168')](_0x1158a6[_0xbed6('0x4c')],_0x1158a6[_0xbed6('0x165')],_0x1158a6[_0xbed6('0x48')],_0x1158a6))[_0xbed6('0x43')](_0x148a02[_0xbed6('0x169')](_0x1158a6))[_0xbed6('0xb3')](loggerCatchQueueSummary(_0xbed6('0x16a'),_0x1158a6));}else{notSendMessagesCampaign(_0x1158a6);}}}};function getCallerIdRandom(_0x5f85f7,_0x490430){var _0x336474;var _0x178bed;var _0x5d5f6c;if(_0x490430<=0x0){_0x490430=0x1;}_0x336474=new RegExp(_0xbed6('0x16b')+_0x490430+'}$');_0x178bed=Math[_0xbed6('0x16c')](0xa,_0x490430-0x1);_0x5d5f6c=Math[_0xbed6('0x16c')](0xa,_0x490430)-0x1;return util[_0xbed6('0x83')]('%s',_['replace'](_0x5f85f7,_0x336474,_[_0xbed6('0x16d')](_0x178bed,_0x5d5f6c)));}function extractCalleridName(_0x1e04dd){var _0x3d28c2=_0x1e04dd[_0xbed6('0x16e')](/"(.*?)"/);return _0x3d28c2?_0x3d28c2[0x1]:_0x1e04dd;}function extractCalleridNumber(_0x80da4a){var _0x2eb5af=_0x80da4a['match'](/<(.*?)>/);return _0x2eb5af?_0x2eb5af[0x1]:_0x80da4a;}Dialer[_0xbed6('0x1d')]['actionOriginate']=function(_0x143047,_0x4fe5a2){var _0x56934d=this;var _0x451740=uuid['v4']();this['actions'][_0x451740]=new Action(_0x143047,_0x4fe5a2,_0x451740);return new BPromise(function(_0x4c61bf,_0x22a40c){if(_[_0xbed6('0x45')](_0x143047)&&typeof _0x143047!==_0xbed6('0x16f')){return _0x22a40c(msgResponse(_0xbed6('0x170'),_0xbed6('0x149'),_0xbed6('0x171')));}if(_[_0xbed6('0x45')](_0x4fe5a2[_0xbed6('0x172')][_0xbed6('0x173')])||_0x4fe5a2[_0xbed6('0x172')]['phone']===null){return _0x22a40c(msgResponse('originate','Failure',_0xbed6('0x174')));}var _0x1a8924={'XMD-CALLERID':_0x56934d[_0xbed6('0x27')][_0x451740][_0xbed6('0x175')](),'XMD-AGI':_0x143047['dialQueueProject']?util[_0xbed6('0x83')](_0xbed6('0x176'),ipAgi,_0x143047['dialQueueProject']):_0xbed6('0x177'),'XMD-AGIAFTER':_0x143047[_0xbed6('0x10f')]?util[_0xbed6('0x83')]('\x22agi://%s/square,%s\x22',ipAgi,_0x143047[_0xbed6('0x10f')]):'NONE','XMD-QUEUE':_0x143047[_0xbed6('0x57')]===_0xbed6('0x58')?util[_0xbed6('0x83')]('\x22%s,%s%s,,,%s\x22',_0x143047['name'],_0x143047[_0xbed6('0x178')]||'',_0x143047[_0xbed6('0x110')]?'c':'',_0x143047['dialQueueTimeout']||0x3):_0xbed6('0x177'),'XMD-CONTACTID':_0x4fe5a2['ContactId'],'XMD-CDRTYPE':_0xbed6('0x9'),'CALLERID(all)':_0x56934d['actions'][_0x451740]['getCaller'](),'XMD-AMD':_0x143047[_0xbed6('0xe2')]?_0xbed6('0x179'):_0xbed6('0x177'),'XMD-DESTINATION':_0xbed6('0x17a')};if(_0x143047[_0xbed6('0xe2')]){_0x1a8924[_0xbed6('0x17b')]=_0x143047[_0xbed6('0x17c')]||0x9c4;_0x1a8924[_0xbed6('0x17d')]=_0x143047[_0xbed6('0x17e')]||0x5dc;_0x1a8924[_0xbed6('0x17f')]=_0x143047['dialAMDAfterGreetingSilence']||0x320;_0x1a8924['XMD-AMDTOTALANALYSISTIME']=_0x143047['dialAMDTotalAnalysisTime']||0x1388;_0x1a8924['XMD-AMDMINWORDLENGTH']=_0x143047[_0xbed6('0x180')]||0x64;_0x1a8924[_0xbed6('0x181')]=_0x143047['dialAMDBetweenWordsSilence']||0x32;_0x1a8924['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x143047['dialAMDMaximumNumberOfWords']||0x3;_0x1a8924['XMD-AMDSILENCETHRESHOLD']=_0x143047[_0xbed6('0x182')]||0x100;_0x1a8924[_0xbed6('0x183')]=_0x143047['dialAMDMaximumWordLength']||0x1388;}if(_0x143047[_0xbed6('0x57')]===_0xbed6('0x58')){_0x1a8924[_0xbed6('0x184')]=_0x4fe5a2[_0xbed6('0xd6')];}else{_0x1a8924['XMD-CAMPAIGNID']=_0x4fe5a2[_0xbed6('0xd7')];}for(var _0x64ee4e in _0x4fe5a2[_0xbed6('0x172')]){if(typeof _0x4fe5a2[_0xbed6('0x172')][_0x64ee4e]!==_0xbed6('0xae')){if(isNotNull(_0x4fe5a2['Contact'][_0x64ee4e])&&_0x64ee4e!=='id'&&_0x64ee4e!==_0xbed6('0x185')&&_0x64ee4e!==_0xbed6('0x186')&&_0x64ee4e!==_0xbed6('0x187')){_0x1a8924[util[_0xbed6('0x83')](_0xbed6('0x188'),'XMD-',_[_0xbed6('0x189')](_0x64ee4e))]=_0x4fe5a2[_0xbed6('0x172')][_0x64ee4e];}}}var _0x1d92d6=_0x56934d[_0xbed6('0xdb')](_0x143047[_0xbed6('0x7e')])?getCallerId(_0x143047[_0xbed6('0x7e')][_0xbed6('0x18a')],_0x143047[_0xbed6('0x65')],_0x143047[_0xbed6('0x18b')]>0x0?getCallerIdRandom(_0x143047[_0xbed6('0x18c')],_0x143047[_0xbed6('0x18b')]):_0x143047[_0xbed6('0x18c')]):getCallerId(_[_0xbed6('0xb0')](_0x143047['TrunkBackup'])?_0x143047[_0xbed6('0x7e')][_0xbed6('0x18a')]:_0x143047[_0xbed6('0x144')][_0xbed6('0x18a')],_0x143047[_0xbed6('0x65')],_0x143047[_0xbed6('0x18b')]>0x0?getCallerIdRandom(_0x143047[_0xbed6('0x18c')],_0x143047[_0xbed6('0x18b')]):_0x143047[_0xbed6('0x18c')]);if(_0x1d92d6){_0x1a8924[_0xbed6('0x18d')]=_0x56934d[_0xbed6('0x27')][_0x451740][_0xbed6('0x18e')]=extractCalleridName(_0x1d92d6);_0x1a8924[_0xbed6('0x18f')]=_0x56934d['actions'][_0x451740][_0xbed6('0x190')]=extractCalleridNumber(_0x1d92d6);}return ami[_0xbed6('0xb1')]({'actionid':_0x451740,'action':_0xbed6('0x170'),'channel':_0x56934d[_0xbed6('0xdb')](_0x143047[_0xbed6('0x7e')])?util[_0xbed6('0x83')](_0xbed6('0x191'),_0x143047['Trunk'][_0xbed6('0x48')],isNotNull(_0x143047[_0xbed6('0x66')])?_0x143047[_0xbed6('0x66')]['trim']()||'':'',_0x143047[_0xbed6('0x192')]>0x0?_0x4fe5a2[_0xbed6('0x172')][_0xbed6('0x173')]['substring'](_0x143047[_0xbed6('0x192')]):_0x4fe5a2[_0xbed6('0x172')][_0xbed6('0x173')]):util['format']('SIP/%s/%s%s',_[_0xbed6('0xb0')](_0x143047[_0xbed6('0x144')])?_0x143047[_0xbed6('0x7e')][_0xbed6('0x48')]:_0x143047[_0xbed6('0x144')][_0xbed6('0x48')],isNotNull(_0x143047[_0xbed6('0x66')])?_0x143047[_0xbed6('0x66')][_0xbed6('0x193')]()||'':'',_0x143047[_0xbed6('0x192')]>0x0?_0x4fe5a2['Contact']['phone'][_0xbed6('0x194')](_0x143047[_0xbed6('0x192')]):_0x4fe5a2[_0xbed6('0x172')][_0xbed6('0x173')]),'callerid':_0x1d92d6,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x1a8924,'timeout':(_0x143047[_0xbed6('0x195')]||0x1e)*0x3e8,'async':!![],'channelid':_0x451740})[_0xbed6('0x43')](function(_0x35ddc6){return _0x4c61bf(_0x35ddc6);})[_0xbed6('0xb3')](function(_0x41e5ef){_0x143047[_0xbed6('0x6f')]+=0x1;var _0x2a5572=new History(_0x56934d[_0xbed6('0x27')][_0x451740]);logger[_0xbed6('0x9c')](util[_0xbed6('0x83')](_0xbed6('0x196'),JSON[_0xbed6('0x53')](_0x41e5ef)));_0x2a5572[_0xbed6('0xa8')]=0xe;_0x2a5572[_0xbed6('0xe4')]=_0xbed6('0x197');_0x2a5572['starttime']=moment()[_0xbed6('0x83')](_0xbed6('0xff'));_0x2a5572[_0xbed6('0xa9')]=_0x2a5572['starttime'];_0x56934d[_0xbed6('0xcc')](_0x2a5572)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x198')));_0x56934d[_0xbed6('0xcb')](_0x2a5572)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x198')))[_0xbed6('0x20')](function(){delete _0x56934d[_0xbed6('0x27')][_0x451740];return _0x22a40c(msgResponse('originate',_0xbed6('0x52'),_0xbed6('0x199')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x1a2c8e){var _0x4064b5=this[_0xbed6('0x27')][_0x1a2c8e['actionid']];if(_0x4064b5){delete this[_0xbed6('0x27')][_0x1a2c8e[_0xbed6('0x12e')]];_0x4064b5[_0xbed6('0x19a')]=moment()[_0xbed6('0x83')](_0xbed6('0xff'));var _0x4acb15=_0x4064b5[_0xbed6('0x57')]===_0xbed6('0x82')?this[_0xbed6('0x23')][_0x4064b5[_0xbed6('0xb6')]]:this[_0xbed6('0x22')][_0x4064b5[_0xbed6('0x19b')]()];if(!this['isSuccess'](_0x1a2c8e['response'])){this[_0xbed6('0xb5')](_0x4acb15);return this[_0xbed6('0x19c')](_0x4064b5,_0x4acb15,_0x1a2c8e)['catch'](loggerCatch(_0xbed6('0x19d')));}this[_0xbed6('0x29')][_0x1a2c8e['uniqueid']]=_0x4064b5;}};Dialer[_0xbed6('0x1d')][_0xbed6('0x19e')]=function(_0x20da0c,_0x211c1c,_0x1727f8){var _0x19bc78=new History(_0x211c1c);if(_0x19bc78['countbusyretry']+_0x19bc78[_0xbed6('0x104')]+_0x19bc78[_0xbed6('0x105')]+_0x19bc78['countnosuchnumberretry']+_0x19bc78[_0xbed6('0xf6')]+_0x19bc78['countabandonedretry']+_0x19bc78[_0xbed6('0xf0')]+_0x19bc78['countagentrejectretry']>=_0x1727f8['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x20da0c){case 0x3:if(_0x19bc78[_0xbed6('0x105')]>=_0x1727f8[_0xbed6('0x19f')]-0x1){return!![];}this[_0xbed6('0xc1')]({'active':![],'countnoanswerretry':_0x19bc78[_0xbed6('0x105')]+=0x1,'scheduledat':moment()[_0xbed6('0xfd')](_0x1727f8['dialNoAnswerRetryFrequency'],_0xbed6('0x107'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x19bc78[_0xbed6('0xd4')],'ListId':_0x19bc78['ListId'],'VoiceQueueId':_0x19bc78[_0xbed6('0xd6')]||undefined,'CampaignId':_0x19bc78['CampaignId']||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x1a0')));break;case 0x5:if(_0x19bc78[_0xbed6('0xf4')]>=_0x1727f8[_0xbed6('0x1a1')]-0x1){return!![];}this[_0xbed6('0xc1')]({'active':![],'countbusyretry':_0x19bc78['countbusyretry']+=0x1,'scheduledat':moment()[_0xbed6('0xfd')](_0x1727f8[_0xbed6('0x1a2')],'minutes')['format'](_0xbed6('0xff')),'ContactId':_0x19bc78[_0xbed6('0xd4')],'ListId':_0x19bc78[_0xbed6('0xd5')],'VoiceQueueId':_0x19bc78['VoiceQueueId']||undefined,'CampaignId':_0x19bc78[_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x1a3')));break;case 0x8:if(_0x19bc78[_0xbed6('0x104')]>=_0x1727f8[_0xbed6('0x1a4')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x19bc78[_0xbed6('0x104')]+=0x1,'scheduledat':moment()[_0xbed6('0xfd')](_0x1727f8[_0xbed6('0x1a5')],_0xbed6('0x107'))[_0xbed6('0x83')](_0xbed6('0xff')),'ContactId':_0x19bc78['ContactId'],'ListId':_0x19bc78[_0xbed6('0xd5')],'VoiceQueueId':_0x19bc78['VoiceQueueId']||undefined,'CampaignId':_0x19bc78[_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x1a6')));break;case 0x0:if(_0x19bc78[_0xbed6('0xf5')]>=_0x1727f8['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xbed6('0xc1')]({'active':![],'countnosuchnumberretry':_0x19bc78['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xbed6('0xfd')](_0x1727f8['dialNoSuchNumberRetryFrequency'],_0xbed6('0x107'))[_0xbed6('0x83')](_0xbed6('0xff')),'ContactId':_0x19bc78[_0xbed6('0xd4')],'ListId':_0x19bc78['ListId'],'VoiceQueueId':_0x19bc78[_0xbed6('0xd6')]||undefined,'CampaignId':_0x19bc78[_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x1a7')));}break;case 0xa:if(_0x19bc78[_0xbed6('0xf6')]>=_0x1727f8[_0xbed6('0x1a8')]-0x1){return!![];}this[_0xbed6('0xc1')]({'active':![],'countdropretry':_0x19bc78[_0xbed6('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x1727f8[_0xbed6('0x11d')],'minutes')[_0xbed6('0x83')](_0xbed6('0xff')),'ContactId':_0x19bc78[_0xbed6('0xd4')],'ListId':_0x19bc78['ListId'],'VoiceQueueId':_0x19bc78[_0xbed6('0xd6')]||undefined,'CampaignId':_0x19bc78['CampaignId']||undefined})[_0xbed6('0xb3')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x19bc78[_0xbed6('0x125')]>=_0x1727f8[_0xbed6('0x126')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x19bc78[_0xbed6('0x125')]+=0x1,'scheduledat':moment()['add'](_0x1727f8[_0xbed6('0x127')],'minutes')[_0xbed6('0x83')](_0xbed6('0xff')),'ContactId':_0x19bc78[_0xbed6('0xd4')],'ListId':_0x19bc78[_0xbed6('0xd5')],'VoiceQueueId':_0x19bc78['VoiceQueueId']||undefined,'CampaignId':_0x19bc78['CampaignId']||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x128')));break;case 0x13:if(_0x19bc78['countmachineretry']>=_0x1727f8[_0xbed6('0xfb')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x19bc78['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x1727f8[_0xbed6('0xfe')],'minutes')[_0xbed6('0x83')](_0xbed6('0xff')),'ContactId':_0x19bc78['ContactId'],'ListId':_0x19bc78[_0xbed6('0xd5')],'VoiceQueueId':_0x19bc78[_0xbed6('0xd6')]||undefined,'CampaignId':_0x19bc78[_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x100')));break;case 0x14:if(_0x19bc78[_0xbed6('0xf7')]>=_0x1727f8[_0xbed6('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x19bc78['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xbed6('0xfd')](_0x1727f8[_0xbed6('0x1aa')],_0xbed6('0x107'))[_0xbed6('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x19bc78[_0xbed6('0xd4')],'ListId':_0x19bc78[_0xbed6('0xd5')],'VoiceQueueId':_0x19bc78[_0xbed6('0xd6')]||undefined,'CampaignId':_0x19bc78[_0xbed6('0xd7')]||undefined})['catch'](loggerCatch(_0xbed6('0x1ab')));break;default:return!![];}};Dialer['prototype'][_0xbed6('0x19c')]=function(_0xc79cf,_0x3985d1,_0x292901){var _0x1cdcba=this;var _0x444c70=new History(_0xc79cf);return new BPromise(function(_0x32816e,_0x43c264){if(_[_0xbed6('0x45')](_0x3985d1)&&typeof _0x3985d1!==_0xbed6('0x16f')){return _0x43c264(msgResponse(_0xbed6('0x1ac'),'Failure',_0xbed6('0x1ad')));}if(_['isUndefined'](_0x292901)&&typeof _0x292901!==_0xbed6('0x16f')){return _0x43c264(msgResponse(_0xbed6('0x1ac'),_0xbed6('0x149'),_0xbed6('0x1ae')));}switch(_0x292901[_0xbed6('0x10e')]){case'0':_0x3985d1['outboundNoSuchCallsDay']+=0x1;_0x444c70[_0xbed6('0xa8')]=0x0;_0x444c70['statedesc']='NoSuchNumber';_0x444c70[_0xbed6('0xf5')]+=0x1;_0x444c70[_0xbed6('0xf1')]+=0x1;ami['emit'](_0xbed6('0x1af'),ut[_0xbed6('0xe8')](_0xc79cf,_0xbed6('0x1b0')));_0x1cdcba[_0xbed6('0xcc')](_0x444c70)[_0xbed6('0xb3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1cdcba[_0xbed6('0x19e')](0x0,_0xc79cf,_0x3985d1)){if(_0x444c70[_0xbed6('0xf5')]>=_0x3985d1['dialNoSuchNumberMaxRetry']){_0x1cdcba['createStateFinal'](_0x444c70,_0x32816e,_0x43c264,'reason\x200\x20no\x20such\x20number....');}else{_0x1cdcba['stateGlobal'](_0x444c70,_0x32816e,_0x43c264,_0xbed6('0x1b1'));}}break;case'3':_0x3985d1[_0xbed6('0x6d')]+=0x1;_0x444c70[_0xbed6('0xa8')]=0x3;_0x444c70['statedesc']='NoAnswer';_0x444c70['countnoanswerretry']+=0x1;_0x444c70[_0xbed6('0xf1')]+=0x1;ami[_0xbed6('0xe7')](_0xbed6('0x1b2'),ut['buildObj'](_0xc79cf,_0xbed6('0x1b3')));_0x1cdcba[_0xbed6('0xcc')](_0x444c70)[_0xbed6('0xb3')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1cdcba['checkRetriveMax'](0x3,_0xc79cf,_0x3985d1)){if(_0x444c70[_0xbed6('0x105')]>=_0x3985d1[_0xbed6('0x19f')]){_0x1cdcba[_0xbed6('0x106')](_0x444c70,_0x32816e,_0x43c264,_0xbed6('0x1b4'));}else{_0x1cdcba[_0xbed6('0xf9')](_0x444c70,_0x32816e,_0x43c264,_0xbed6('0x1b4'));}}break;case'5':_0x3985d1[_0xbed6('0x68')]+=0x1;_0x444c70[_0xbed6('0xa8')]=0x5;_0x444c70[_0xbed6('0xe4')]=_0xbed6('0x1b5');_0x444c70[_0xbed6('0xf4')]+=0x1;_0x444c70[_0xbed6('0xf1')]+=0x1;ami[_0xbed6('0xe7')](_0xbed6('0x1b6'),ut[_0xbed6('0xe8')](_0xc79cf,_0xbed6('0x1b7')));_0x1cdcba[_0xbed6('0xcc')](_0x444c70)['catch'](loggerCatch(_0xbed6('0x1b8')));if(_0x1cdcba['checkRetriveMax'](0x5,_0xc79cf,_0x3985d1)){if(_0x444c70[_0xbed6('0xf4')]>=_0x3985d1[_0xbed6('0x1a1')]){_0x1cdcba[_0xbed6('0x106')](_0x444c70,_0x32816e,_0x43c264,'reason\x205\x20busy');}else{_0x1cdcba[_0xbed6('0xf9')](_0x444c70,_0x32816e,_0x43c264,'reason\x205\x20busy');}}break;case'8':_0x3985d1[_0xbed6('0x69')]+=0x1;_0x444c70[_0xbed6('0xa8')]=0x8;_0x444c70[_0xbed6('0xe4')]=_0xbed6('0x1b9');_0x444c70[_0xbed6('0x104')]+=0x1;_0x444c70[_0xbed6('0xf1')]+=0x1;ami['emit'](_0xbed6('0x1ba'),ut['buildObj'](_0xc79cf,_0xbed6('0x1bb')));_0x1cdcba[_0xbed6('0xcc')](_0x444c70)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x1bc')));if(_0x1cdcba[_0xbed6('0x19e')](0x8,_0xc79cf,_0x3985d1)){if(_0x444c70[_0xbed6('0x104')]>=_0x3985d1['dialCongestionMaxRetry']){_0x1cdcba[_0xbed6('0x106')](_0x444c70,_0x32816e,_0x43c264,_0xbed6('0x1bd'));}else{_0x1cdcba[_0xbed6('0xf9')](_0x444c70,_0x32816e,_0x43c264,_0xbed6('0x1bd'));}}break;case'11':_0x3985d1[_0xbed6('0x1be')]+=0x1;_0x444c70[_0xbed6('0xa8')]=0xb;_0x444c70['statedesc']=_0xbed6('0x123');_0x444c70[_0xbed6('0x125')]+=0x1;_0x444c70['countglobal']+=0x1;_0x1cdcba[_0xbed6('0xcc')](_0x444c70)[_0xbed6('0xb3')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1cdcba[_0xbed6('0x19e')](0xb,_0xc79cf,_0x3985d1)){if(_0x444c70[_0xbed6('0x125')]>=_0x3985d1[_0xbed6('0x126')]){_0x1cdcba[_0xbed6('0x106')](_0x444c70,_0x32816e,_0x43c264,_0xbed6('0x1bf'));}else{_0x1cdcba[_0xbed6('0xf9')](_0x444c70,_0x32816e,_0x43c264,_0xbed6('0x1bf'));}}break;case'20':_0x3985d1[_0xbed6('0x71')]+=0x1;_0x444c70[_0xbed6('0xa8')]=0x14;_0x444c70[_0xbed6('0xe4')]='AgentReject';_0x444c70[_0xbed6('0xf7')]+=0x1;_0x444c70['countglobal']+=0x1;ami['emit'](_0xbed6('0x1c0'),ut[_0xbed6('0xe8')](_0xc79cf,_0xbed6('0x1c1')));_0x1cdcba[_0xbed6('0xcc')](_0x444c70)[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x1c2')));if(_0x1cdcba[_0xbed6('0x19e')](0x14,_0xc79cf,_0x3985d1)){if(_0x444c70['countagentrejectretry']>=_0x3985d1['dialAgentRejectMaxRetry']){_0x1cdcba[_0xbed6('0x106')](_0x444c70,_0x32816e,_0x43c264,_0xbed6('0x1c3'));}else{_0x1cdcba[_0xbed6('0xf9')](_0x444c70,_0x32816e,_0x43c264,'reason\x2020\x20agentreject');}}break;default:_0x3985d1['outboundUnknownCallsDay']+=0x1;_0x444c70[_0xbed6('0xa8')]=0xc;_0x444c70[_0xbed6('0xe4')]=_0x292901[_0xbed6('0x10e')];_0x1cdcba[_0xbed6('0xcc')](_0x444c70)[_0xbed6('0xb3')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1cdcba[_0xbed6('0x19e')](_0x292901[_0xbed6('0x10e')],_0xc79cf,_0x3985d1)){if(_0x444c70[_0xbed6('0xf4')]+_0x444c70[_0xbed6('0x104')]+_0x444c70[_0xbed6('0x105')]+_0x444c70['countnosuchnumberretry']+_0x444c70[_0xbed6('0xf6')]+_0x444c70['countabandonedretry']+_0x444c70[_0xbed6('0xf0')]+_0x444c70[_0xbed6('0xf7')]>=_0x3985d1[_0xbed6('0xf8')]){_0x1cdcba[_0xbed6('0xf9')](_0x444c70,_0x32816e,_0x43c264,_0x292901['reason']);}else{_0x1cdcba[_0xbed6('0x106')](_0x444c70,_0x32816e,_0x43c264,_0x292901[_0xbed6('0x10e')]);}}}});};Dialer[_0xbed6('0x1d')]['stateGlobal']=function(_0x4b92ba,_0x16ac59,_0x93151,_0x4d5feb){var _0x49d561=new Final(_0x4b92ba);_0x49d561[_0xbed6('0xa8')]=0xf;_0x49d561[_0xbed6('0xe4')]=_0xbed6('0x1c4');this[_0xbed6('0x106')](_0x49d561,_0x16ac59,_0x93151,_0x4d5feb);};Dialer['prototype']['createStateFinal']=function(_0x4e2023,_0x2db847,_0x1f3a32,_0x5113fe){this['moveContactManagedDialer'](_0x4e2023)['then'](function(){return _0x2db847(msgResponse(_0xbed6('0x1ac'),_0xbed6('0x1c5'),_0x5113fe));})[_0xbed6('0xb3')](function(){return _0x1f3a32(msgResponse('[moveContactManagedDialer][0]',_0xbed6('0x149'),_0xbed6('0x1c6')));});};Dialer[_0xbed6('0x1d')][_0xbed6('0xb')]=function(_0x53223d){var _0xc38451=_0x53223d[_0xbed6('0x1c7')]/0x64;var _0x2b7886=_0x53223d[_0xbed6('0x6c')]/(_0x53223d[_0xbed6('0x6c')]+_0x53223d['outboundAnswerCallsDay']);var _0x1bf8a9=Math[_0xbed6('0x1c8')](_0x53223d[_0xbed6('0x78')]*(_0x53223d['predictiveIntervalMaxThreshold']/0x64));var _0x2e3c96=Math[_0xbed6('0x1c8')](_0x53223d['predictiveIntervalAvailable']*(_0x53223d[_0xbed6('0x1c9')]/0x64));var _0x27d031=_0x53223d[_0xbed6('0x5b')]+_0x53223d['talking'];var _0x4590fb=Math['floor'](_0x53223d[_0xbed6('0x7b')]*_0x53223d['erlangAbandonmentRate']*_0x53223d[_0xbed6('0x76')]*_0x53223d[_0xbed6('0x1ca')]);if(_[_0xbed6('0x45')](_0x53223d[_0xbed6('0x2c')])){if(!_[_0xbed6('0x45')](_0x53223d['startPredictive'])){_0x53223d['startPredictive']=undefined;loggerPredictive[_0xbed6('0x9c')](_0xbed6('0x1cb'),_0xbed6('0x1cc'));}if(!_[_0xbed6('0x45')](_0x53223d[_0xbed6('0x97')])){loggerPredictive[_0xbed6('0x9c')](_0xbed6('0x1cb'),_0xbed6('0x1cd'));clearInterval(_0x53223d[_0xbed6('0x97')]);_0x53223d[_0xbed6('0x97')]=undefined;}_0x53223d['startProgressive']=moment()[_0xbed6('0x83')](_0xbed6('0xff'));loggerPredictive[_0xbed6('0x85')](_0x53223d[_0xbed6('0x48')],_0xbed6('0x1ce'),_0x53223d['startProgressive']);this['handlePower'](_0x53223d,0x1);}else if(ifInterval(_0x53223d[_0xbed6('0x1cf')],_0x53223d[_0xbed6('0x2c')])){this['handlePower'](_0x53223d,0x1);loggerPredictiveCalls[_0xbed6('0x85')]('[startMethodPredictive][StartProgressive][Loop]',_0x53223d[_0xbed6('0x2c')],_0x53223d[_0xbed6('0x48')]);_0x53223d[_0xbed6('0x7b')]=0x0;_0x53223d['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xc38451<_0x2b7886&&_0x53223d[_0xbed6('0x1d0')]===_0xbed6('0x1d1')){freeVariablesPredictive(_0x53223d);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xbed6('0x1d2'),_0x2b7886,'startProgressive',_0x53223d[_0xbed6('0x48')]);}else if(_0x4590fb<_0x53223d['predictiveIntervalErlangCallsDroppedCalls']&&_0x53223d[_0xbed6('0x1d0')]===_0xbed6('0x1d1')){freeVariablesPredictive(_0x53223d);loggerPredictive['info'](_0xbed6('0x1d3'),_0xbed6('0x1d4'),_0x4590fb,'Drop\x20in\x20this\x20interval',_0x53223d['predictiveIntervalErlangCallsDroppedCalls'],_0xbed6('0x2c'),_0x53223d['name']);}else if(!ifInterval(_0x53223d[_0xbed6('0x1cf')],_0x53223d['startProgressive'])&&_[_0xbed6('0x45')](_0x53223d[_0xbed6('0x2b')])&&!_[_0xbed6('0x45')](_0x53223d[_0xbed6('0x2c')])){_0x53223d[_0xbed6('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbed6('0x85')](_0x53223d[_0xbed6('0x48')],_0xbed6('0x1d5'),_0x53223d['startPredictive']);this[_0xbed6('0xbf')](_0x53223d['dialPredictiveInterval'])[_0xbed6('0x43')](this['getDataPredictive'](_0x53223d))[_0xbed6('0x43')](mergeDataErlangB(_0x53223d))[_0xbed6('0x43')](this[_0xbed6('0x1d6')](_0x53223d))[_0xbed6('0xb3')](loggerCatchPredictive(_0xbed6('0x1d7'),_0x53223d));}else if(!ifInterval(_0x53223d['dialPredictiveInterval'],_0x53223d[_0xbed6('0x2b')])){_0x53223d[_0xbed6('0x118')]=0x0;_0x53223d['startPredictive']=moment()['format'](_0xbed6('0xff'));loggerPredictive[_0xbed6('0x85')](_0x53223d[_0xbed6('0x48')],_0xbed6('0x1d8'),_0x53223d[_0xbed6('0x2b')]);clearInterval(_0x53223d[_0xbed6('0x97')]);_0x53223d[_0xbed6('0x97')]=undefined;this[_0xbed6('0xbf')](_0x53223d[_0xbed6('0x1cf')])[_0xbed6('0x43')](this[_0xbed6('0x1d9')](_0x53223d))[_0xbed6('0x43')](mergeDataErlangB(_0x53223d))[_0xbed6('0x43')](this[_0xbed6('0x1d6')](_0x53223d))[_0xbed6('0xb3')](loggerCatchPredictive(_0xbed6('0x1da'),_0x53223d));}else if(_0x53223d[_0xbed6('0x78')]&&_0x27d031<_0x53223d['predictiveIntervalAvailable']-_0x2e3c96){freeVariablesPredictive(_0x53223d);loggerPredictive[_0xbed6('0x85')](_0x53223d[_0xbed6('0x48')],_0xbed6('0x1db'),_0x27d031,_0xbed6('0x1dc'),_0x53223d[_0xbed6('0x78')],'-',_0x2e3c96,'=',_0x53223d['predictiveIntervalAvailable']-_0x2e3c96,')');}else if(_0x53223d[_0xbed6('0x78')]&&_0x27d031>_0x53223d['predictiveIntervalAvailable']+_0x1bf8a9){freeVariablesPredictive(_0x53223d);loggerPredictive[_0xbed6('0x85')](_0x53223d[_0xbed6('0x48')],_0xbed6('0x1db'),_0x27d031,')\x20are\x20more\x20than\x20threshold\x20(',_0x53223d[_0xbed6('0x78')],'+',_0x1bf8a9,'=',_0x53223d[_0xbed6('0x78')]+_0x1bf8a9,')');}};Dialer[_0xbed6('0x1d')][_0xbed6('0x1d9')]=function(_0x1d6de5){var _0x4f825b=this;return function(_0x2b8fc4){return new BPromise(function(_0x1371dc,_0x42ae99){_[_0xbed6('0x95')](_0x1d6de5,_0x2b8fc4[0x0]);if(checkGetDataPredictive(_0x2b8fc4[0x0])){var _0x4feee4=_0x1d6de5[_0xbed6('0x78')]=_0x1d6de5['talking']+_0x1d6de5[_0xbed6('0x5b')];var _0x3d4299=_0x1d6de5[_0xbed6('0x1cf')]*0x3c;var _0x3fb726=_0x2b8fc4[0x0]['predictiveIntervalAvgTalktime']+_0x2b8fc4[0x0][_0xbed6('0x73')];var _0x6ab602=(_0x2b8fc4[0x0][_0xbed6('0x88')]+_0x2b8fc4[0x0][_0xbed6('0x117')]+_0x2b8fc4[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2b8fc4[0x0][_0xbed6('0x79')];_0x1d6de5[_0xbed6('0x76')]=_0x6ab602>0x0?_0x6ab602:0x1;switch(_0x1d6de5[_0xbed6('0x1d0')]){case'dropRate':var _0x2278ce=_0x1d6de5[_0xbed6('0x1c7')]/0x64;return _0x4f825b[_0xbed6('0x1dd')](_0x4feee4,_0x3d4299,_0x3fb726,_0x6ab602,_0x2278ce)['then'](function(_0x3d694c){return _0x1371dc(_0x3d694c);});case _0xbed6('0x1de'):var _0x546548=_0x1d6de5[_0xbed6('0x1c7')]/0x64;return _0x4f825b[_0xbed6('0x1df')](_0x4feee4,_0x3d4299,_0x3fb726,_0x6ab602,_0x546548)[_0xbed6('0x43')](function(_0x3fd5ee){return _0x1371dc(_0x3fd5ee);});default:return _0x42ae99(msgResponse(_0xbed6('0x1e0'),_0xbed6('0x149'),_0xbed6('0x1e1')));}}else{return _0x42ae99(msgResponse(_0xbed6('0x1e0'),_0xbed6('0x149'),_0xbed6('0x1e2')));}});};};Dialer[_0xbed6('0x1d')][_0xbed6('0x1e3')]=function(_0xe19af5){var _0x5b4181=this;return function(_0x4d6579){return new BPromise(function(_0x2d3907,_0x3e5f07){_[_0xbed6('0x95')](_0xe19af5,_0x4d6579[0x0]);if(checkGetDataPredictive(_0x4d6579[0x0])){loggerPredictive[_0xbed6('0x85')](JSON[_0xbed6('0x53')](_0x4d6579[0x0]));if(_0xe19af5[_0xbed6('0x1d0')]===_0xbed6('0x1d1')){return _0x5b4181[_0xbed6('0xc9')](_0xe19af5['id'])['then'](function(_0x375b33){var _0x2856b2=_0xe19af5[_0xbed6('0x5c')]-_0x375b33[0x0][_0xbed6('0x1e4')];var _0x263c2a=_0xe19af5[_0xbed6('0x1cf')]*0x3c;var _0x2347f3=_0x4d6579[0x0]['predictiveIntervalAvgTalktime']+_0x4d6579[0x0]['predictiveIntervalAvgHoldtime'];var _0x5d9f57=(_0x4d6579[0x0][_0xbed6('0x88')]+_0x4d6579[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4d6579[0x0][_0xbed6('0x75')])/_0x4d6579[0x0][_0xbed6('0x79')];var _0x422681=_0xe19af5['dialPredictiveOptimizationPercentage']/0x64;_0xe19af5[_0xbed6('0x77')]=_0x375b33[0x0][_0xbed6('0x1e4')]||0x0;_0xe19af5[_0xbed6('0x76')]=_0x5d9f57>0x0?_0x5d9f57:0x1;return _0x5b4181[_0xbed6('0x1dd')](_0x2856b2,_0x263c2a,_0x2347f3,_0x5d9f57,_0x422681);})[_0xbed6('0x43')](function(_0x16a53f){return _0x2d3907(_0x16a53f);})['catch'](function(_0x1d13d2){return _0x3e5f07(msgResponse(_0xbed6('0x1e5'),_0xbed6('0x149'),JSON['stringify'](_0x1d13d2)));});}if(_0xe19af5[_0xbed6('0x1d0')]===_0xbed6('0x1de')){return _0x5b4181[_0xbed6('0xc9')](_0xe19af5['id'])['then'](function(_0xc92391){var _0x2f68f4=_0xe19af5[_0xbed6('0x5c')]-_0xc92391[0x0][_0xbed6('0x1e4')];var _0xecc219=_0xe19af5['dialPredictiveInterval']*0x3c;var _0x1205dd=_0x4d6579[0x0][_0xbed6('0x74')]+_0x4d6579[0x0][_0xbed6('0x73')];var _0xce7c3d=(_0x4d6579[0x0][_0xbed6('0x88')]+_0x4d6579[0x0][_0xbed6('0x117')]+_0x4d6579[0x0][_0xbed6('0x75')])/_0x4d6579[0x0][_0xbed6('0x79')];var _0x4a6e4d=_0xe19af5['dialPredictiveOptimizationPercentage']/0x64;_0xe19af5['predictiveIntervalPauses']=_0xc92391[0x0][_0xbed6('0x1e4')]||0x0;_0xe19af5['predictiveIntervalHitRate']=_0xce7c3d>0x0?_0xce7c3d:0x1;return _0x5b4181[_0xbed6('0x1df')](_0x2f68f4,_0xecc219,_0x1205dd,_0xce7c3d,_0x4a6e4d);})[_0xbed6('0x43')](function(_0x34bc00){return _0x2d3907(_0x34bc00);})[_0xbed6('0xb3')](function(_0x397a85){return _0x3e5f07(msgResponse(_0xbed6('0x1e5'),_0xbed6('0x149'),JSON[_0xbed6('0x53')](_0x397a85)));});}}else{return _0x3e5f07(msgResponse(_0xbed6('0x1e0'),_0xbed6('0x149'),_0xbed6('0x1e2')));}});};};Dialer[_0xbed6('0x1d')][_0xbed6('0x1d6')]=function(_0xeb7164){var _0x7da9b4=this;return function(){var _0x2e4141=0x0;var _0x515afd=Math[_0xbed6('0x1e6')](_0xeb7164[_0xbed6('0x92')]*0x3e8);if(_0x515afd>0x0){_0x515afd=_0x515afd<0x64?0x64:_0x515afd;loggerPredictive[_0xbed6('0x85')](_0xeb7164['name'],_0xbed6('0x1e7'),_0x515afd,'milliseconds');_0xeb7164[_0xbed6('0x97')]=setInterval(function(){_0x7da9b4[_0xbed6('0x97')](_0xeb7164);loggerPredictiveCalls[_0xbed6('0x85')](_0xbed6('0x1e8'),_0x2e4141+=0x1);},_0x515afd);}else{loggerPredictive['info'](_0xeb7164[_0xbed6('0x48')],_0xbed6('0x1e9'));}};};Dialer['prototype']['checkContactBlack']=function(_0x502f35,_0xd423b){var _0x21172a=this;return function(_0x9d1f71){if(_[_0xbed6('0x4e')](_0x9d1f71)){if(_[_0xbed6('0xb0')](_0xd423b[_0xbed6('0x1ea')])||!_0xd423b[_0xbed6('0x1eb')]){if(_0x502f35[_0xbed6('0x64')]===_0xbed6('0xa')){_0x502f35[_0xbed6('0x132')]=_[_0xbed6('0x45')](_0x502f35[_0xbed6('0x132')])?!![]:_0x502f35[_0xbed6('0x132')];var _0x238fa5=uuid['v4']();_0x21172a[_0xbed6('0x27')][_0x238fa5]=new Action(_0x502f35,_0xd423b,_0x238fa5);loggerBooked[_0xbed6('0x85')](_0xbed6('0x1ec'),_0x238fa5,_0xbed6('0x1ed'),JSON[_0xbed6('0x53')](_0x502f35[_0xbed6('0x132')]),_0xbed6('0x1ee'),_0x502f35[_0xbed6('0x48')]);if(_0x502f35[_0xbed6('0x132')]){_0x502f35[_0xbed6('0x132')]=![];_0x21172a['queueBooked'][_0x21172a[_0xbed6('0x27')][_0x238fa5][_0xbed6('0xb6')]]=[];ami['Action']({'actionid':_0x238fa5,'action':_0xbed6('0x1ef'),'queue':_0x502f35[_0xbed6('0x48')]})['catch'](function(){_0x21172a[_0xbed6('0xb5')](_0x502f35);_0x21172a[_0xbed6('0xc1')]({'active':![],'ContactId':_0x21172a[_0xbed6('0x27')][_0x238fa5][_0xbed6('0xd4')],'ListId':_0x21172a['actions'][_0x238fa5]['ListId'],'VoiceQueueId':_0x21172a['actions'][_0x238fa5][_0xbed6('0xd6')]||undefined,'CampaignId':_0x21172a[_0xbed6('0x27')][_0x238fa5][_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch(_0xbed6('0x1f0')));delete _0x21172a[_0xbed6('0x27')][_0x238fa5];});}else{loggerBooked[_0xbed6('0x85')](_0xbed6('0x1f1'),JSON['stringify'](_0x502f35[_0xbed6('0x132')]),_0xbed6('0x1ee'),_0x502f35[_0xbed6('0x48')]);_0x21172a[_0xbed6('0xb5')](_0x502f35);_0x21172a[_0xbed6('0xc1')]({'active':![],'ContactId':_0x21172a[_0xbed6('0x27')][_0x238fa5]['ContactId'],'ListId':_0x21172a[_0xbed6('0x27')][_0x238fa5][_0xbed6('0xd5')],'VoiceQueueId':_0x21172a[_0xbed6('0x27')][_0x238fa5][_0xbed6('0xd6')]||undefined,'CampaignId':_0x21172a[_0xbed6('0x27')][_0x238fa5][_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x21172a[_0xbed6('0x27')][_0x238fa5];}}else{return _0x21172a[_0xbed6('0x1f2')](_0x502f35,_0xd423b);}}else{if(getDiff(_0xd423b['scheduledat'])<_0x502f35[_0xbed6('0x1f3')]*0x3c){if(_0xd423b[_0xbed6('0x160')]&&!_0xd423b[_0xbed6('0x160')][_0xbed6('0x1f4')]){_0x21172a[_0xbed6('0x21')][_0xbed6('0x135')](_0xd423b['id'])[_0xbed6('0x20')](function(){_0x21172a[_0xbed6('0xb5')](_0x502f35);});}else{_0x21172a[_0xbed6('0x1f5')]({'active':![]},_0xd423b['id'],0x1)[_0xbed6('0x20')](function(){_0x21172a[_0xbed6('0xb5')](_0x502f35);});}}else{_0x502f35['outboundReCallsDay']+=0x1;_0x21172a[_0xbed6('0xb5')](_0x502f35);if(_0x502f35[_0xbed6('0x1f6')]){_0x21172a[_0xbed6('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xd423b[_0xbed6('0xd4')],'ListId':_0xd423b['ListId'],'VoiceQueueId':_0xd423b[_0xbed6('0xd6')]||undefined,'CampaignId':_0xd423b[_0xbed6('0xd7')]||undefined})[_0xbed6('0xb3')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x21172a[_0xbed6('0xcc')](createObjHistory(_0x502f35,_0xd423b,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0xbed6('0xb3')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x21172a['saveInDb'](createObjHistory(_0x502f35,_0xd423b,'RECALLFAILEDTIMEOUT',0x16,_0xbed6('0x1f7')),_0xbed6('0x1f8'),_0xbed6('0x1f9'));}}}}else{_0x502f35['outboundBlacklistCallsDay']+=0x1;_0x21172a['saveInDb'](createObjHistory(_0x502f35,_0xd423b,_0xbed6('0x1fa'),0xd,_0xbed6('0x1fb')),_0xbed6('0x1fc'),'[Originate][MoveBlacklist]');throw _0xbed6('0x1fd');}};};Dialer[_0xbed6('0x1d')]['handleIvr']=function(_0x51657c){var _0x32dac5=this;var _0x465095=_0x51657c['limitCalls']-_0x51657c[_0xbed6('0x7a')]-_0x51657c[_0xbed6('0xc5')];emitCampaignSummary(_0x51657c);if(_0x465095>0x0){if(_0x465095>this[_0xbed6('0x26')]){_0x465095=this['maxNumberOriginate'];}_0x51657c['temp']+=_0x465095;this[_0xbed6('0xc7')](_0x51657c['id'],_0x465095,_0x51657c[_0xbed6('0x1fe')],_0x51657c)[_0xbed6('0x43')](function(_0x1b835d){_0x51657c[_0xbed6('0xc5')]-=_0x465095;_0x51657c[_0xbed6('0xc5')]=_0x51657c[_0xbed6('0xc5')]>0x0?_0x51657c[_0xbed6('0xc5')]:0x0;if(!checkContactEmpty(_0x1b835d)){_0x51657c[_0xbed6('0x46')]=_0xbed6('0xa2');logger['info'](_0xbed6('0x1ff')+_0x51657c['name']);}else{_0x51657c['originated']+=_0x1b835d[_0xbed6('0x14f')];_0x51657c['message']=_0xbed6('0x200');for(var _0x446d44=0x0;_0x446d44<_0x1b835d['length'];_0x446d44+=0x1){_0x51657c[_0xbed6('0x201')]+=0x1;if(_['isNil'](_0x1b835d[_0x446d44])||_['isNil'](_0x1b835d[_0x446d44]['Contact'])||_[_0xbed6('0xb0')](_0x1b835d[_0x446d44][_0xbed6('0x172')][_0xbed6('0x173')])){_0x32dac5[_0xbed6('0xd1')](_0xbed6('0x202'),_0x51657c,_0x1b835d[_0x446d44]);}else{_0x32dac5[_0xbed6('0xbd')](_[_0xbed6('0xd3')](_0x1b835d[_0x446d44],[_0xbed6('0xd7'),_0xbed6('0x203')]))['then'](_0x32dac5[_0xbed6('0x204')](_0x51657c,_0x1b835d[_0x446d44]))[_0xbed6('0xb3')](_0x32dac5[_0xbed6('0xd0')](_0xbed6('0x205'),_0x51657c));}}}})[_0xbed6('0xb3')](loggerGetContactDialer('[getContactCampaign2]',_0x51657c,_0x465095));}};Dialer[_0xbed6('0x1d')][_0xbed6('0x15d')]=function(_0x148425,_0x30fa30){var _0xa9c505=this;var _0x1fbed8=[];var _0x5b87b0=_0x30fa30>=0x1?_0x30fa30:0x1;if(_0x148425[_0xbed6('0x64')]===_0xbed6('0xa')){_0x5b87b0=0x1;}var _0x545309=Math[_0xbed6('0x1e6')](_0x148425['available']*_0x5b87b0)-_0x148425[_0xbed6('0x7a')]-_0x148425[_0xbed6('0xc5')];emitVoiceQueueSummary(_0x148425);if(_0x148425[_0xbed6('0x206')]>0x0){var _0x43a472=_0x148425[_0xbed6('0x206')]-_0x148425[_0xbed6('0x7a')]-_0x148425[_0xbed6('0x5f')]-_0x148425['temp']-_0x148425[_0xbed6('0x5d')];if(_0x545309>_0x43a472){_0x545309=_0x43a472;}}if(_0x545309>0x0){if(_0x148425[_0xbed6('0x64')]===_0xbed6('0xa')){_0x545309=0x1;}if(_0x545309>this[_0xbed6('0x26')]){_0x545309=this[_0xbed6('0x26')];}_0x148425[_0xbed6('0xc5')]+=_0x545309;for(var _0x178e37 in this[_0xbed6('0x24')]){if(typeof this[_0xbed6('0x24')][_0x178e37]!==_0xbed6('0xae')){if(this['agents'][_0x178e37][_0xbed6('0xa8')]===_0xbed6('0x207')&&this['agents'][_0x178e37][_0xbed6('0xb2')]===_0xbed6('0x208')){_0x1fbed8['push'](this['agents'][_0x178e37]['id']);}}}this[_0xbed6('0xc4')](_0x148425['id'],_0x1fbed8,_0x545309,_0x148425[_0xbed6('0x1fe')],_0x148425)[_0xbed6('0x43')](function(_0x258e83){_0x148425[_0xbed6('0xc5')]-=_0x545309;_0x148425['temp']=_0x148425[_0xbed6('0xc5')]>0x0?_0x148425[_0xbed6('0xc5')]:0x0;if(!checkContactEmpty(_0x258e83)){_0xa9c505[_0xbed6('0xb8')](_0x148425)[_0xbed6('0x43')](sendMessageReschedule(_0x148425))[_0xbed6('0xb3')](loggerCatch('[countReScheduled]\x20'));}else{_0x148425[_0xbed6('0x7a')]+=_0x258e83['length'];_0x148425[_0xbed6('0x46')]=_0x148425[_0xbed6('0x64')]===_0xbed6('0xa')?_0xbed6('0x179'):_0xbed6('0x200');for(var _0x32ffca=0x0;_0x32ffca<_0x258e83[_0xbed6('0x14f')];_0x32ffca+=0x1){if(_[_0xbed6('0xb0')](_0x258e83[_0x32ffca])||_[_0xbed6('0xb0')](_0x258e83[_0x32ffca][_0xbed6('0x172')])||_[_0xbed6('0xb0')](_0x258e83[_0x32ffca][_0xbed6('0x172')][_0xbed6('0x173')])){_0xa9c505['emptyContact']('[actionOriginate]\x20',_0x148425,_0x258e83[_0x32ffca]);}else{_0xa9c505[_0xbed6('0xbb')](_[_0xbed6('0xd3')](_0x258e83[_0x32ffca],[_0xbed6('0xd6'),_0xbed6('0x203')]))[_0xbed6('0x43')](_0xa9c505['checkContactBlack'](_0x148425,_0x258e83[_0x32ffca]))[_0xbed6('0xb3')](_0xa9c505[_0xbed6('0xd0')](_0xbed6('0x202'),_0x148425));}}}})[_0xbed6('0xb3')](loggerGetContactDialer('[getContactDialer2]',_0x148425,_0x545309));}};Dialer['prototype'][_0xbed6('0x97')]=function(_0x1f0623){if(_0x1f0623[_0xbed6('0x206')]>0x0){var _0x3679f1=_0x1f0623[_0xbed6('0x206')]-_0x1f0623['originated']-_0x1f0623[_0xbed6('0x5f')];if(_0x3679f1>0x0){this['tryOriginatePredictive'](_0x1f0623);}else{loggerPredictiveCalls[_0xbed6('0x85')](_0xbed6('0x209'));}}else{this[_0xbed6('0x20a')](_0x1f0623);}};Dialer['prototype'][_0xbed6('0x20a')]=function(_0x43b928){var _0x1190d9=this;var _0x1a2b4c=[];_0x43b928[_0xbed6('0x7a')]+=0x1;for(var _0x327e5e in this[_0xbed6('0x24')]){if(typeof this[_0xbed6('0x24')][_0x327e5e]!==_0xbed6('0xae')){if(this['agents'][_0x327e5e]['state']===_0xbed6('0x207')&&this[_0xbed6('0x24')][_0x327e5e]['status']==='reachable'){_0x1a2b4c[_0xbed6('0x130')](this[_0xbed6('0x24')][_0x327e5e]['id']);}}}this['getContactDialer'](_0x43b928['id'],_0x1a2b4c,0x1,_0x43b928[_0xbed6('0x1fe')],_0x43b928)[_0xbed6('0x43')](function(_0x24054f){if(!checkContactEmpty(_0x24054f)){checkContactLowerLimitOriginate(_0x43b928,0x1,0x0);_0x1190d9['countReScheduled'](_0x43b928)['then'](sendMessageReschedule(_0x43b928))[_0xbed6('0xb3')](loggerCatch(_0xbed6('0xba')));}else{_0x43b928[_0xbed6('0x46')]=_0xbed6('0x200');if(_[_0xbed6('0xb0')](_0x24054f[0x0])||_[_0xbed6('0xb0')](_0x24054f[0x0][_0xbed6('0x172')])||_[_0xbed6('0xb0')](_0x24054f[0x0]['Contact'][_0xbed6('0x173')])){_0x1190d9['emptyContact'](_0xbed6('0x202'),_0x43b928,_0x24054f[0x0]);}else{_0x1190d9[_0xbed6('0xbb')](_[_0xbed6('0xd3')](_0x24054f[0x0],[_0xbed6('0xd6'),'Contact.phone']))[_0xbed6('0x43')](_0x1190d9[_0xbed6('0x204')](_0x43b928,_0x24054f[0x0]))[_0xbed6('0xb3')](_0x1190d9[_0xbed6('0xd0')]('[actionOriginatePredictive]\x20',_0x43b928));}}})[_0xbed6('0xb3')](loggerGetContactDialer('[getContactDialerPredictive]',_0x43b928,0x1));emitVoiceQueueSummary(_0x43b928);};Dialer[_0xbed6('0x1d')][_0xbed6('0x1dd')]=function(_0x482735,_0xc312d1,_0x252190,_0x269533,_0x1dcf38,_0x497f0d){loggerPredictive[_0xbed6('0x85')](_0xbed6('0x20b'));loggerPredictive[_0xbed6('0x85')](_0xbed6('0x20c'),_0x482735);loggerPredictive['info'](_0xbed6('0x20d'),_0xc312d1);loggerPredictive['info'](_0xbed6('0x20e'),_0x252190);loggerPredictive['info'](_0xbed6('0x20f'),_0x269533);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x210'),_0x1dcf38);loggerPredictive['info']('---------------------------');return new BPromise(function(_0xd253a0,_0x3df7ff){if(_0x482735<=0x0||isNaN(_0x482735)){return _0x3df7ff(msgResponse(_0xbed6('0x211'),_0xbed6('0x52'),_0xbed6('0x212')+_0x482735));}if(_0x252190<=0x0||isNaN(_0x252190)){return _0x3df7ff(msgResponse(_0xbed6('0x211'),'Error','Ts\x20=\x20'+_0x252190));}if(_0x269533<=0x0||isNaN(_0x269533)){return _0x3df7ff(msgResponse(_0xbed6('0x211'),_0xbed6('0x52'),_0xbed6('0x213')+_0x269533));}if(_0xc312d1<=0x0||isNaN(_0xc312d1)){return _0x3df7ff(msgResponse('[abandonmentRate]',_0xbed6('0x52'),_0xbed6('0x214')+_0xc312d1));}if(_0x1dcf38<=0x0||isNaN(_0x1dcf38)){return _0x3df7ff(msgResponse(_0xbed6('0x211'),_0xbed6('0x52'),'Amax\x20=\x20'+_0x1dcf38));}_0x497f0d=_0x497f0d||0x0;var _0x2ff7ca=0x1/_0x252190;var _0x3ccc50=0x0;var _0x126414=0x0;var _0x425048=0x0;var _0x3e1e93=0x0;for(var _0x34c974=0x0;_0x425048<_0x1dcf38;_0x34c974+=0x1){_0x126414=_0x34c974/_0xc312d1;_0x3ccc50=(_0x269533*_0x126414+_0x497f0d)/_0x2ff7ca;_0x425048=erlangb(_0x3ccc50,_0x482735);_0x3e1e93=_0x3ccc50/_0x482735*(0x1-erlangb(_0x3ccc50,_0x482735));}return _0xd253a0({'erlangCalls':_0x34c974,'erlangCallToSecond':_0xc312d1/_0x34c974,'erlangAbandonmentRate':_0x425048,'erlangBusyFactor':_0x3e1e93});});};Dialer['prototype'][_0xbed6('0x1df')]=function(_0x5c2b1f,_0x4d927c,_0xd8873d,_0x2b72ea,_0x3c2a06,_0x4c15a0){loggerPredictive[_0xbed6('0x85')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xbed6('0x85')](_0xbed6('0x20c'),_0x5c2b1f);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x20d'),_0x4d927c);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x20e'),_0xd8873d);loggerPredictive[_0xbed6('0x85')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b72ea);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x215'),_0x3c2a06);loggerPredictive[_0xbed6('0x85')](_0xbed6('0x8d'));return new BPromise(function(_0x2b99ad,_0x32c630){if(_0x5c2b1f<=0x0||isNaN(_0x5c2b1f)){return _0x32c630(msgResponse('[busyFactor]',_0xbed6('0x52'),_0xbed6('0x212')+_0x5c2b1f));}if(_0xd8873d<=0x0||isNaN(_0xd8873d)){return _0x32c630(msgResponse(_0xbed6('0x216'),_0xbed6('0x52'),_0xbed6('0x217')+_0xd8873d));}if(_0x2b72ea<=0x0||isNaN(_0x2b72ea)){return _0x32c630(msgResponse(_0xbed6('0x216'),_0xbed6('0x52'),_0xbed6('0x213')+_0x2b72ea));}if(_0x4d927c<=0x0||isNaN(_0x4d927c)){return _0x32c630(msgResponse(_0xbed6('0x216'),'Error',_0xbed6('0x214')+_0x4d927c));}if(_0x3c2a06<=0x0||isNaN(_0x3c2a06)){return _0x32c630(msgResponse(_0xbed6('0x216'),_0xbed6('0x52'),_0xbed6('0x218')+_0x3c2a06));}_0x4c15a0=_0x4c15a0||0x0;var _0xd88eb5=0x1/_0xd8873d;var _0x5032c5=0x0;var _0x2aa3c1=0x0;var _0x26b91a=0x0;var _0x45cb2d=0x0;for(var _0x387d26=0x0;_0x45cb2d<_0x3c2a06;_0x387d26+=0x1){_0x2aa3c1=_0x387d26/_0x4d927c;_0x5032c5=(_0x2b72ea*_0x2aa3c1+_0x4c15a0)/_0xd88eb5;_0x26b91a=erlangb(_0x5032c5,_0x5c2b1f);_0x45cb2d=_0x5032c5/_0x5c2b1f*(0x1-erlangb(_0x5032c5,_0x5c2b1f));}return _0x2b99ad({'erlangCalls':_0x387d26,'erlangCallToSecond':_0x4d927c/_0x387d26,'erlangAbandonmentRate':_0x26b91a,'erlangBusyFactor':_0x45cb2d});});};module[_0xbed6('0x219')]=Dialer;
\ No newline at end of file
index 50f5a02..3812f34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a40=['calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x2a40,0x17c));var _0x02a4=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x2a40[_0x3a73bc];return _0x32891b;};'use strict';var util=require(_0x02a4('0x0'));var _=require(_0x02a4('0x1'));var moment=require(_0x02a4('0x2'));function getSeconds(_0xfb4357,_0x3c8512){var _0x2384da=moment(_0xfb4357)[_0x02a4('0x3')](0x0);var _0x85aa64=moment(_0x3c8512)[_0x02a4('0x3')](0x0);return _0x2384da['diff'](_0x85aa64,_0x02a4('0x4'));}function QueueCallerAbandon(_0x1d5581,_0xf0c904){this[_0x02a4('0x5')]=_0x1d5581[_0x02a4('0x5')];this['type']=_0x1d5581[_0x02a4('0x6')];this[_0x02a4('0x7')]=_0x1d5581['type']===_0x02a4('0x8')?_0x02a4('0x9'):_0x1d5581[_0x02a4('0x6')];this['countbusyretry']=_0x1d5581['countbusyretry'];this[_0x02a4('0xa')]=_0x1d5581[_0x02a4('0xa')];this['countnoanswerretry']=_0x1d5581['countnoanswerretry'];this[_0x02a4('0xb')]=_0x1d5581['countbusyretry']+_0x1d5581['countcongestionretry']+_0x1d5581[_0x02a4('0xc')]+_0x1d5581[_0x02a4('0xd')]+_0x1d5581['countdropretry']+_0x1d5581['countabandonedretry']+_0x1d5581[_0x02a4('0xe')]+_0x1d5581[_0x02a4('0xf')];this[_0x02a4('0xd')]=_0x1d5581[_0x02a4('0xd')];this[_0x02a4('0x10')]=_0x1d5581[_0x02a4('0x10')];this[_0x02a4('0x11')]=_0x1d5581[_0x02a4('0x11')];this['countmachineretry']=_0x1d5581[_0x02a4('0xe')];this['countagentrejectretry']=_0x1d5581[_0x02a4('0xf')];this[_0x02a4('0x12')]=_0xf0c904[_0x02a4('0x12')];this[_0x02a4('0x13')]=_0x1d5581['name'];this[_0x02a4('0x14')]=_0x1d5581['number'];this[_0x02a4('0x15')]=_0x1d5581[_0x02a4('0x15')];this[_0x02a4('0x16')]=_0x1d5581['responsetime'];this['droptime']=_0x1d5581[_0x02a4('0x17')];this[_0x02a4('0x18')]=this[_0x02a4('0x17')];this[_0x02a4('0x19')]=getSeconds(_0x1d5581['responsetime'],_0x1d5581['starttime']);this[_0x02a4('0x1a')]=getSeconds(this[_0x02a4('0x17')],_0x1d5581[_0x02a4('0x16')]);this['talktime']=0x0;this['queue']=_0xf0c904['queue'];this[_0x02a4('0x1b')]=_0xf0c904['connectedlinename'];this[_0x02a4('0x1c')]=_0xf0c904[_0x02a4('0x1c')];this['callback']=_0x1d5581[_0x02a4('0x1d')];this['callbackuniqueid']=_0x1d5581[_0x02a4('0x1e')];this[_0x02a4('0x1f')]=_0x1d5581[_0x02a4('0x1f')];this[_0x02a4('0x20')]=_0x1d5581[_0x02a4('0x20')];this[_0x02a4('0x21')]=_0x1d5581[_0x02a4('0x21')];this[_0x02a4('0x22')]=_0x1d5581[_0x02a4('0x22')];this[_0x02a4('0x23')]=_0x1d5581['UserId'];this[_0x02a4('0x24')]=_0x1d5581['VoiceQueueId'];this['CampaignId']=_0x1d5581['CampaignId'];this[_0x02a4('0x25')]=_0x1d5581['originatecalleridnum']||'';this[_0x02a4('0x26')]=_0x1d5581[_0x02a4('0x26')]||'';}module[_0x02a4('0x27')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xcddb=['type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xcddb,0x7b));var _0xbcdd=function(_0x50f61d,_0x3e6387){_0x50f61d=_0x50f61d-0x0;var _0x2de2d1=_0xcddb[_0x50f61d];return _0x2de2d1;};'use strict';var util=require(_0xbcdd('0x0'));var _=require(_0xbcdd('0x1'));var moment=require(_0xbcdd('0x2'));function getSeconds(_0x36fd98,_0x52b5e7){var _0x110401=moment(_0x36fd98)[_0xbcdd('0x3')](0x0);var _0x3e68bd=moment(_0x52b5e7)[_0xbcdd('0x3')](0x0);return _0x110401[_0xbcdd('0x4')](_0x3e68bd,_0xbcdd('0x5'));}function QueueCallerAbandon(_0x5055b1,_0xd93248){this['scheduledat']=_0x5055b1['scheduledat'];this[_0xbcdd('0x6')]=_0x5055b1['type'];this[_0xbcdd('0x7')]=_0x5055b1['type']==='outbound'?_0xbcdd('0x8'):_0x5055b1[_0xbcdd('0x6')];this['countbusyretry']=_0x5055b1['countbusyretry'];this[_0xbcdd('0x9')]=_0x5055b1['countcongestionretry'];this[_0xbcdd('0xa')]=_0x5055b1[_0xbcdd('0xa')];this[_0xbcdd('0xb')]=_0x5055b1[_0xbcdd('0xc')]+_0x5055b1['countcongestionretry']+_0x5055b1['countnoanswerretry']+_0x5055b1[_0xbcdd('0xd')]+_0x5055b1[_0xbcdd('0xe')]+_0x5055b1[_0xbcdd('0xf')]+_0x5055b1['countmachineretry']+_0x5055b1[_0xbcdd('0x10')];this[_0xbcdd('0xd')]=_0x5055b1[_0xbcdd('0xd')];this[_0xbcdd('0xe')]=_0x5055b1[_0xbcdd('0xe')];this[_0xbcdd('0xf')]=_0x5055b1[_0xbcdd('0xf')];this[_0xbcdd('0x11')]=_0x5055b1[_0xbcdd('0x11')];this[_0xbcdd('0x10')]=_0x5055b1[_0xbcdd('0x10')];this[_0xbcdd('0x12')]=_0xd93248[_0xbcdd('0x12')];this[_0xbcdd('0x13')]=_0x5055b1[_0xbcdd('0x14')];this['calleridnum']=_0x5055b1[_0xbcdd('0x15')];this[_0xbcdd('0x16')]=_0x5055b1['starttime'];this['responsetime']=_0x5055b1[_0xbcdd('0x17')];this[_0xbcdd('0x18')]=_0x5055b1[_0xbcdd('0x18')];this['endtime']=this[_0xbcdd('0x18')];this[_0xbcdd('0x19')]=getSeconds(_0x5055b1['responsetime'],_0x5055b1[_0xbcdd('0x16')]);this[_0xbcdd('0x1a')]=getSeconds(this[_0xbcdd('0x18')],_0x5055b1[_0xbcdd('0x17')]);this[_0xbcdd('0x1b')]=0x0;this['queue']=_0xd93248[_0xbcdd('0x8')];this[_0xbcdd('0x1c')]=_0xd93248[_0xbcdd('0x1d')];this['reason']=_0xd93248[_0xbcdd('0x1e')];this['callback']=_0x5055b1[_0xbcdd('0x1f')];this['callbackuniqueid']=_0x5055b1[_0xbcdd('0x20')];this[_0xbcdd('0x21')]=_0x5055b1[_0xbcdd('0x21')];this['recallme']=_0x5055b1[_0xbcdd('0x22')];this['ContactId']=_0x5055b1[_0xbcdd('0x23')];this['ListId']=_0x5055b1[_0xbcdd('0x24')];this[_0xbcdd('0x25')]=_0x5055b1[_0xbcdd('0x25')];this['VoiceQueueId']=_0x5055b1[_0xbcdd('0x26')];this[_0xbcdd('0x27')]=_0x5055b1[_0xbcdd('0x27')];this[_0xbcdd('0x28')]=_0x5055b1[_0xbcdd('0x28')]||'';this[_0xbcdd('0x29')]=_0x5055b1[_0xbcdd('0x29')]||'';}module[_0xbcdd('0x2a')]=QueueCallerAbandon;
\ No newline at end of file
index 46c12b6..c5da592 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0xaf83e1,_0x49b726){var _0x33b4d4=function(_0x1eb01e){while(--_0x1eb01e){_0xaf83e1['push'](_0xaf83e1['shift']());}};_0x33b4d4(++_0x49b726);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x10abcb,_0x261bf9){var _0x4d30a5=function(_0x59df3c){while(--_0x59df3c){_0x10abcb['push'](_0x10abcb['shift']());}};_0x4d30a5(++_0x261bf9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
index 7e99926..90706d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c81=['checkTrunk','isValid','Trunk\x20Reachable','format','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','hangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','prototype','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend'];(function(_0x1e2c37,_0x4dd529){var _0x3c6756=function(_0x332704){while(--_0x332704){_0x1e2c37['push'](_0x1e2c37['shift']());}};_0x3c6756(++_0x4dd529);}(_0x3c81,0x102));var _0x13c8=function(_0xdadb44,_0xbd4300){_0xdadb44=_0xdadb44-0x0;var _0x5b43a3=_0x3c81[_0xdadb44];return _0x5b43a3;};'use strict';var util=require(_0x13c8('0x0'));var _=require(_0x13c8('0x1'));var BPromise=require('bluebird');var uuid=require(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x13c8('0x4'));var ami=require(_0x13c8('0x5'));var rpcDb=require(_0x13c8('0x6'));var Channel=require(_0x13c8('0x7'));var ut=require(_0x13c8('0x8'));var Action=require(_0x13c8('0x9'));var faxAccount=require(_0x13c8('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x13c8('0xb'));function Fax(_0x4905c3){this[_0x13c8('0xc')]={};this[_0x13c8('0xd')]=_0x4905c3[_0x13c8('0xd')];this[_0x13c8('0xe')]=_0x4905c3[_0x13c8('0xe')];this[_0x13c8('0xf')]={};ami['on'](_0x13c8('0x10'),this[_0x13c8('0x11')][_0x13c8('0x12')](this));ami['on'](_0x13c8('0x13'),this[_0x13c8('0x14')][_0x13c8('0x12')](this));ami['on'](_0x13c8('0x15'),this[_0x13c8('0x16')]['bind'](this));ami['on'](_0x13c8('0x17'),this[_0x13c8('0x18')][_0x13c8('0x12')](this));ami['on'](_0x13c8('0x19'),this['syncFaxStatus'][_0x13c8('0x12')](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x13c8('0x1a'),this['syncHangup'][_0x13c8('0x12')](this));ami['on'](_0x13c8('0x1b'),this[_0x13c8('0x1c')][_0x13c8('0x12')](this));}Fax['prototype'][_0x13c8('0x11')]=function(_0x408abc){if(_0x408abc[_0x13c8('0x1d')]===_0x13c8('0x1e')){for(var _0xce1ad2 in this[_0x13c8('0xd')]){if(this[_0x13c8('0xd')][_0x13c8('0x1f')](_0xce1ad2)){if(_0x408abc[_0x13c8('0x20')]===this[_0x13c8('0xd')][_0xce1ad2][_0x13c8('0x21')]){this['channels'][_0x408abc[_0x13c8('0x22')]]={};this[_0x13c8('0xc')][_0x408abc[_0x13c8('0x22')]][_0x13c8('0x23')]=_0x408abc['channel'];this[_0x13c8('0xc')][_0x408abc[_0x13c8('0x22')]]['id']=this[_0x13c8('0xd')][_0xce1ad2]['id'];this[_0x13c8('0xc')][_0x408abc[_0x13c8('0x22')]][_0x13c8('0x24')]=this['faxAccounts'][_0xce1ad2][_0x13c8('0x24')];logger[_0x13c8('0x25')](_0x408abc[_0x13c8('0x22')],_0x13c8('0x26'));}}}}if(this['actions'][_0x408abc[_0x13c8('0x22')]]){this[_0x13c8('0xc')][_0x408abc['uniqueid']]={};this['channels'][_0x408abc[_0x13c8('0x22')]][_0x13c8('0x23')]=_0x408abc['channel'];logger['info'](_0x408abc[_0x13c8('0x22')],_0x13c8('0x26'));}};Fax['prototype']['syncVarSet']=function(_0x196983){if(this['channels'][_0x196983['uniqueid']]){for(var _0x1c7dc4 in _0x196983[_0x13c8('0x27')]){if(_0x196983[_0x13c8('0x27')]['hasOwnProperty'](_0x1c7dc4)){this['channels'][_0x196983[_0x13c8('0x22')]][_0x1c7dc4]=_0x196983[_0x13c8('0x28')];}}}};Fax[_0x13c8('0x29')][_0x13c8('0x16')]=function(_0x138017){if(this[_0x13c8('0xc')][_0x138017[_0x13c8('0x22')]]){this['channels'][_0x138017[_0x13c8('0x22')]][_0x13c8('0x2a')]=_0x138017['channelstate'];this['channels'][_0x138017[_0x13c8('0x22')]][_0x13c8('0x2b')]=_0x138017['channelstatedesc'];}};Fax[_0x13c8('0x29')][_0x13c8('0x18')]=function(_0x47e0f8){if(this[_0x13c8('0xc')][_0x47e0f8[_0x13c8('0x22')]]){for(var _0xc4ae3a in _0x47e0f8[_0x13c8('0x27')]){if(_0x47e0f8[_0x13c8('0x27')][_0x13c8('0x1f')](_0xc4ae3a)){this[_0x13c8('0xc')][_0x47e0f8[_0x13c8('0x22')]][_0xc4ae3a]=_0x47e0f8['value'];}}}};Fax['prototype'][_0x13c8('0x2c')]=function(_0x37eaec){if(this['channels'][_0x37eaec[_0x13c8('0x22')]]){this['channels'][_0x37eaec[_0x13c8('0x22')]]['operation']=_0x37eaec[_0x13c8('0x2d')];this[_0x13c8('0xc')][_0x37eaec[_0x13c8('0x22')]][_0x13c8('0x2e')]=_0x37eaec[_0x13c8('0x2e')];this[_0x13c8('0xc')][_0x37eaec[_0x13c8('0x22')]]['localstationid']=_0x37eaec[_0x13c8('0x21')];this[_0x13c8('0xc')][_0x37eaec['uniqueid']][_0x13c8('0x2f')]=_0x37eaec[_0x13c8('0x2f')];logger[_0x13c8('0x25')](_0x37eaec['uniqueid'],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x13c8('0x30')]=function(_0x2c8218){var _0x21671a=this;if(this[_0x13c8('0xc')][_0x2c8218[_0x13c8('0x22')]]){var _0x412428=this[_0x13c8('0xc')][_0x2c8218[_0x13c8('0x22')]]['id'];this[_0x13c8('0xc')][_0x2c8218['uniqueid']]['remotestationid']=_0x2c8218[_0x13c8('0x31')];this[_0x13c8('0xc')][_0x2c8218[_0x13c8('0x22')]][_0x13c8('0x32')]=_0x2c8218['pagestransferred'];this[_0x13c8('0xc')][_0x2c8218['uniqueid']][_0x13c8('0x21')]=_0x2c8218[_0x13c8('0x21')];this[_0x13c8('0xc')][_0x2c8218[_0x13c8('0x22')]][_0x13c8('0x33')]=_0x2c8218[_0x13c8('0x33')];this[_0x13c8('0xc')][_0x2c8218[_0x13c8('0x22')]][_0x13c8('0x34')]=_0x2c8218[_0x13c8('0x34')];this[_0x13c8('0xc')][_0x2c8218[_0x13c8('0x22')]][_0x13c8('0x2f')]=_0x2c8218[_0x13c8('0x2f')];this[_0x13c8('0xc')][_0x2c8218[_0x13c8('0x22')]][_0x13c8('0x35')]=_0x2c8218[_0x13c8('0x35')];if(this[_0x13c8('0xc')][_0x2c8218[_0x13c8('0x22')]][_0x13c8('0x32')]>0x0){tiff2pdf(_0x2c8218[_0x13c8('0x2f')],_0x13c8('0x36'),function(_0x4030ca){logger[_0x13c8('0x25')](_0x2c8218['uniqueid'],_0x13c8('0x37'),_0x4030ca[_0x13c8('0x38')]);attachment[_0x13c8('0x39')]({'name':path[_0x13c8('0x3a')](_0x2c8218[_0x13c8('0x2f')])['name'],'basename':path['parse'](_0x2c8218[_0x13c8('0x2f')])[_0x13c8('0x24')]+_0x13c8('0x3b'),'type':'application/pdf'})['then'](function(_0x4d783c){faxAccount[_0x13c8('0x3c')](_0x412428,{'from':_0x2c8218['calleridnum'],'mapKey':_0x13c8('0x4'),'body':path['parse'](_0x2c8218[_0x13c8('0x2f')])[_0x13c8('0x24')]+_0x13c8('0x3b'),'AttachmentId':_0x4d783c['id']})[_0x13c8('0x3d')](function(_0x3fcc4d){logger[_0x13c8('0x3e')](_0x2c8218['uniqueid'],_0x13c8('0x3f'),JSON[_0x13c8('0x40')](_0x3fcc4d));});})['catch'](function(_0x2b4e45){logger[_0x13c8('0x3e')](_0x2c8218[_0x13c8('0x22')],_0x13c8('0x41'),JSON[_0x13c8('0x40')](_0x2b4e45));});});}logger['info'](_0x2c8218[_0x13c8('0x22')],_0x13c8('0x41'));}};Fax[_0x13c8('0x29')][_0x13c8('0x1c')]=function(_0x185d18){if(this['actions'][_0x185d18[_0x13c8('0x22')]]){_[_0x13c8('0x42')](this[_0x13c8('0xc')][_0x185d18[_0x13c8('0x22')]],_[_0x13c8('0x43')](_0x185d18,[_0x13c8('0x44'),_0x13c8('0x45')]));}};function updateStatus(_0xa1596b){if(_0xa1596b[_0x13c8('0x46')]){faxMessage[_0x13c8('0x47')](_0xa1596b[_0x13c8('0x46')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x13c8('0x48')](function(_0x3b90e4){ut[_0x13c8('0x49')](_0x13c8('0x4a'),_0x3b90e4);})[_0x13c8('0x3d')](function(_0x11aa65){ut['logger'](_0x13c8('0x4b'),_0x11aa65);});}else{ut[_0x13c8('0x49')](_0x13c8('0x4c'));}}Fax['prototype']['updateStatus']=function(_0x3d4863,_0x14a738,_0x55d353){var _0x199782=this;var _0x302fad={};if(_0x14a738){_0x302fad={'read':_0x14a738};}else{_0x302fad={'failMessage':_0x55d353};}if(this['actions'][_0x3d4863][_0x13c8('0x46')]){faxMessage['update'](this[_0x13c8('0xf')][_0x3d4863][_0x13c8('0x46')],_0x302fad)[_0x13c8('0x48')](function(_0x49b2f2){ut[_0x13c8('0x49')](_0x13c8('0x4d'),_0x49b2f2);})['catch'](function(_0x1c47ef){ut['logger'](_0x13c8('0x4e'),_0x1c47ef);})[_0x13c8('0x4f')](function(){delete _0x199782[_0x13c8('0xc')][_0x3d4863];delete _0x199782[_0x13c8('0xf')][_0x3d4863];});}else{ut[_0x13c8('0x49')]('[Fax][Message][NoUpdate2]');delete this[_0x13c8('0xc')][_0x3d4863];delete this['actions'][_0x3d4863];}};Fax['prototype']['syncHangup']=function(_0x53c8f5){var _0x539c84=this;if(this[_0x13c8('0xc')][_0x53c8f5[_0x13c8('0x22')]]){if(this[_0x13c8('0xf')][_0x53c8f5[_0x13c8('0x22')]]){this[_0x13c8('0xc')][_0x53c8f5[_0x13c8('0x22')]]['id']=this[_0x13c8('0xf')][_0x53c8f5['uniqueid']]['id'];this['channels'][_0x53c8f5[_0x13c8('0x22')]][_0x13c8('0x24')]=this[_0x13c8('0xf')][_0x53c8f5[_0x13c8('0x22')]][_0x13c8('0x24')];}logger[_0x13c8('0x25')](_0x53c8f5[_0x13c8('0x22')],this[_0x13c8('0xf')][_0x53c8f5['uniqueid']]?_0x13c8('0x50'):_0x13c8('0x51'),JSON['stringify'](this[_0x13c8('0xc')][_0x53c8f5[_0x13c8('0x22')]]));if(this[_0x13c8('0xf')][_0x53c8f5[_0x13c8('0x22')]]){if(this[_0x13c8('0xc')][_0x53c8f5[_0x13c8('0x22')]][_0x13c8('0x52')]>0x0&&this[_0x13c8('0xc')][_0x53c8f5[_0x13c8('0x22')]][_0x13c8('0x19')]===_0x13c8('0x53')){this[_0x13c8('0x54')](_0x53c8f5[_0x13c8('0x22')],!![]);}else{this[_0x13c8('0x54')](_0x53c8f5[_0x13c8('0x22')],![],this[_0x13c8('0xc')][_0x53c8f5['uniqueid']][_0x13c8('0x55')]?'SENDING\x20FAILED:\x20'+this[_0x13c8('0xc')][_0x53c8f5[_0x13c8('0x22')]]['faxstatusstring']:_0x13c8('0x56'));}}}};Fax[_0x13c8('0x29')]['send']=function(_0x38fd82){var _0x19330c=this;return new BPromise(function(_0x44c16d,_0x4c04dc){_0x19330c[_0x13c8('0x57')](_0x38fd82,_0x19330c[_0x13c8('0xd')][_0x38fd82[_0x13c8('0x58')]])[_0x13c8('0x48')](function(_0x179d56){ut[_0x13c8('0x49')](_0x13c8('0x59'),_0x179d56);_0x44c16d(ut['message'](_0x13c8('0x5a')));})[_0x13c8('0x3d')](function(_0x223cfd){ut[_0x13c8('0x49')](_0x13c8('0x5b'),_0x223cfd);updateStatus(_0x38fd82);_0x4c04dc(ut[_0x13c8('0x38')]('Fax\x20failed'));});});};Fax[_0x13c8('0x29')][_0x13c8('0x5c')]=function(_0x165ed0){var _0x541f00=this;return new BPromise(function(_0x54241e,_0x916946){var _0x34a690=_0x541f00[_0x13c8('0x5d')](_0x541f00[_0x13c8('0xd')][_0x165ed0[_0x13c8('0x58')]]['Trunk'],_0x165ed0);if(_0x34a690[_0x13c8('0x5e')]){_0x54241e(ut[_0x13c8('0x38')](_0x13c8('0x5f')));}else{_0x916946(ut[_0x13c8('0x38')](_0x34a690['message']));}});};function originate(_0x16b409,_0x2d552d,_0x258447){return new BPromise(function(_0x308482,_0x179a86){if(_0x258447){var _0x251cbb=util[_0x13c8('0x60')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x13c8('0x3a')](_0x16b409[_0x13c8('0x61')])[_0x13c8('0x24')],_0x16b409['path']);gs[_0x13c8('0x62')](_0x251cbb)[_0x13c8('0x48')](function(){_0x16b409['path']=util['format'](_0x13c8('0x63'),path['parse'](_0x16b409[_0x13c8('0x61')])['dir'],path[_0x13c8('0x3a')](_0x16b409[_0x13c8('0x61')])[_0x13c8('0x24')]);_0x2d552d[_0x13c8('0x64')]=_0x16b409[_0x13c8('0x61')];ut['logger'](_0x13c8('0x65'),'');ami[_0x13c8('0x66')](ut['variablesAction'](_0x16b409,_0x2d552d))[_0x13c8('0x48')](function(_0x7dbff0){_0x308482(_0x7dbff0);})[_0x13c8('0x3d')](function(_0x34e21a){_0x179a86(_0x34e21a);});})[_0x13c8('0x3d')](function(_0x2a4315){_0x179a86(_0x2a4315);});}else{ami[_0x13c8('0x66')](ut[_0x13c8('0x67')](_0x16b409,_0x2d552d))[_0x13c8('0x48')](function(_0x155b93){_0x308482(_0x155b93);})['catch'](function(_0xe58f91){_0x179a86(_0xe58f91);});}});}Fax[_0x13c8('0x29')]['execOriginate']=function(_0x58d5b2,_0x363406){var _0x1e119c=this;return new BPromise(function(_0xa70841,_0x19ce22){var _0x13df22=uuid['v4']();var _0x1a92d6=ut['addVariables'](_0x58d5b2,_0x363406);_0x1e119c[_0x13c8('0xf')][_0x13df22]=new Action(_0x13df22,_0x363406,_0x58d5b2);var _0x368f45=_0x1e119c[_0x13c8('0xf')][_0x13df22];if(path[_0x13c8('0x3a')](_0x58d5b2[_0x13c8('0x61')])['ext']===_0x13c8('0x3b')){originate(_0x368f45,_0x1a92d6,!![])[_0x13c8('0x48')](function(_0x564cc9){_0xa70841(_0x564cc9);})[_0x13c8('0x3d')](function(_0xdea3e6){_0x19ce22(_0xdea3e6);});}else{originate(_0x368f45,_0x1a92d6,![])['then'](function(_0xd4b67a){_0xa70841(_0xd4b67a);})['catch'](function(_0x461169){_0x19ce22(_0x461169);});}});};Fax['prototype'][_0x13c8('0x68')]=function(_0x260139){return!_[_0x13c8('0x69')](_0x260139)&&!_['isNil'](_0x260139[_0x13c8('0x24')])&&!_['isNil'](_0x260139['active'])&&_0x260139[_0x13c8('0x6a')]&&!_[_0x13c8('0x69')](this[_0x13c8('0xe')][util[_0x13c8('0x60')]('SIP/%s',_0x260139['name'])])&&!_[_0x13c8('0x69')](this['trunks'][util['format'](_0x13c8('0x6b'),_0x260139[_0x13c8('0x24')])][_0x13c8('0x2e')])&&(this[_0x13c8('0xe')][util['format'](_0x13c8('0x6b'),_0x260139['name'])]['status']===_0x13c8('0x6c')||this[_0x13c8('0xe')][util[_0x13c8('0x60')](_0x13c8('0x6b'),_0x260139[_0x13c8('0x24')])]['status']===_0x13c8('0x6d'));};Fax['prototype'][_0x13c8('0x5d')]=function(_0x4f56ef,_0x5277a2){if(!this[_0x13c8('0x68')](_0x4f56ef)){ut['logger'](_0x13c8('0x6e'),_[_0x13c8('0x69')](_0x4f56ef)?'':_0x4f56ef['name']+_0x13c8('0x6f'));return{'isValid':![],'message':_0x13c8('0x70')};}if(_[_0x13c8('0x69')](_0x5277a2[_0x13c8('0x4')])){ut[_0x13c8('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x13c8('0x40')](_0x5277a2));return{'isValid':![],'message':_0x13c8('0x71')};}if(_[_0x13c8('0x69')](_0x5277a2[_0x13c8('0x61')])){ut[_0x13c8('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x5277a2));return{'isValid':![],'message':_0x13c8('0x72')};}return{'isValid':!![],'message':_0x13c8('0x73')};};module[_0x13c8('0x74')]=Fax;
\ No newline at end of file
+var _0x2e54=['\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','format','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','exports','util','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','uniqueid','channel','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','localstationid','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','application/pdf','then','catch','error','stringify','\x20receiveFax\x20','merge','response','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20'];(function(_0x5a8d3d,_0x1c7464){var _0x517d8d=function(_0x35d0f3){while(--_0x35d0f3){_0x5a8d3d['push'](_0x5a8d3d['shift']());}};_0x517d8d(++_0x1c7464);}(_0x2e54,0x1dd));var _0x42e5=function(_0x4a3cf8,_0x2364af){_0x4a3cf8=_0x4a3cf8-0x0;var _0xa6a3f=_0x2e54[_0x4a3cf8];return _0xa6a3f;};'use strict';var util=require(_0x42e5('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x42e5('0x1'));var moment=require(_0x42e5('0x2'));var path=require(_0x42e5('0x3'));var tiff2pdf=require(_0x42e5('0x4'));var gs=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var ami=require('../ami');var rpcDb=require(_0x42e5('0x8'));var Channel=require(_0x42e5('0x9'));var ut=require(_0x42e5('0xa'));var Action=require('./action');var faxAccount=require(_0x42e5('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x42e5('0xc'));function Fax(_0x490b99){this[_0x42e5('0xd')]={};this[_0x42e5('0xe')]=_0x490b99[_0x42e5('0xe')];this[_0x42e5('0xf')]=_0x490b99[_0x42e5('0xf')];this[_0x42e5('0x10')]={};ami['on'](_0x42e5('0x11'),this[_0x42e5('0x12')][_0x42e5('0x13')](this));ami['on']('varset',this[_0x42e5('0x14')][_0x42e5('0x13')](this));ami['on']('newstate',this[_0x42e5('0x15')][_0x42e5('0x13')](this));ami['on'](_0x42e5('0x16'),this[_0x42e5('0x17')][_0x42e5('0x13')](this));ami['on'](_0x42e5('0x18'),this[_0x42e5('0x19')][_0x42e5('0x13')](this));ami['on'](_0x42e5('0x1a'),this[_0x42e5('0x1b')]['bind'](this));ami['on'](_0x42e5('0x1c'),this[_0x42e5('0x1d')][_0x42e5('0x13')](this));ami['on'](_0x42e5('0x1e'),this[_0x42e5('0x1f')][_0x42e5('0x13')](this));}Fax[_0x42e5('0x20')][_0x42e5('0x12')]=function(_0x16c753){if(_0x16c753[_0x42e5('0x21')]===_0x42e5('0x22')){for(var _0x38282d in this[_0x42e5('0xe')]){if(this[_0x42e5('0xe')]['hasOwnProperty'](_0x38282d)){if(_0x16c753[_0x42e5('0x23')]===this['faxAccounts'][_0x38282d]['localstationid']){this[_0x42e5('0xd')][_0x16c753[_0x42e5('0x24')]]={};this['channels'][_0x16c753[_0x42e5('0x24')]][_0x42e5('0x25')]=_0x16c753[_0x42e5('0x25')];this[_0x42e5('0xd')][_0x16c753[_0x42e5('0x24')]]['id']=this[_0x42e5('0xe')][_0x38282d]['id'];this[_0x42e5('0xd')][_0x16c753['uniqueid']]['name']=this[_0x42e5('0xe')][_0x38282d]['name'];logger[_0x42e5('0x26')](_0x16c753[_0x42e5('0x24')],_0x42e5('0x27'));}}}}if(this[_0x42e5('0x10')][_0x16c753[_0x42e5('0x24')]]){this['channels'][_0x16c753[_0x42e5('0x24')]]={};this[_0x42e5('0xd')][_0x16c753[_0x42e5('0x24')]][_0x42e5('0x25')]=_0x16c753[_0x42e5('0x25')];logger['info'](_0x16c753['uniqueid'],_0x42e5('0x27'));}};Fax['prototype']['syncVarSet']=function(_0x1b60be){if(this['channels'][_0x1b60be[_0x42e5('0x24')]]){for(var _0x2d9e65 in _0x1b60be[_0x42e5('0x28')]){if(_0x1b60be[_0x42e5('0x28')][_0x42e5('0x29')](_0x2d9e65)){this[_0x42e5('0xd')][_0x1b60be['uniqueid']][_0x2d9e65]=_0x1b60be[_0x42e5('0x2a')];}}}};Fax[_0x42e5('0x20')][_0x42e5('0x15')]=function(_0x2c53d4){if(this[_0x42e5('0xd')][_0x2c53d4[_0x42e5('0x24')]]){this[_0x42e5('0xd')][_0x2c53d4[_0x42e5('0x24')]][_0x42e5('0x2b')]=_0x2c53d4[_0x42e5('0x2b')];this[_0x42e5('0xd')][_0x2c53d4[_0x42e5('0x24')]][_0x42e5('0x2c')]=_0x2c53d4['channelstatedesc'];}};Fax[_0x42e5('0x20')][_0x42e5('0x17')]=function(_0x14c8fd){if(this[_0x42e5('0xd')][_0x14c8fd['uniqueid']]){for(var _0x539254 in _0x14c8fd[_0x42e5('0x28')]){if(_0x14c8fd['variable'][_0x42e5('0x29')](_0x539254)){this['channels'][_0x14c8fd[_0x42e5('0x24')]][_0x539254]=_0x14c8fd[_0x42e5('0x2a')];}}}};Fax[_0x42e5('0x20')]['syncFaxStatus']=function(_0x29b9fd){if(this[_0x42e5('0xd')][_0x29b9fd['uniqueid']]){this[_0x42e5('0xd')][_0x29b9fd['uniqueid']][_0x42e5('0x2d')]=_0x29b9fd[_0x42e5('0x2d')];this[_0x42e5('0xd')][_0x29b9fd[_0x42e5('0x24')]][_0x42e5('0x2e')]=_0x29b9fd[_0x42e5('0x2e')];this[_0x42e5('0xd')][_0x29b9fd['uniqueid']]['localstationid']=_0x29b9fd[_0x42e5('0x2f')];this[_0x42e5('0xd')][_0x29b9fd[_0x42e5('0x24')]]['filename']=_0x29b9fd['filename'];logger['info'](_0x29b9fd['uniqueid'],_0x42e5('0x30'));}};Fax[_0x42e5('0x20')][_0x42e5('0x1b')]=function(_0xedb7bc){var _0x2be00e=this;if(this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]]){var _0x11060d=this['channels'][_0xedb7bc[_0x42e5('0x24')]]['id'];this['channels'][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x31')]=_0xedb7bc[_0x42e5('0x31')];this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x32')]=_0xedb7bc[_0x42e5('0x32')];this['channels'][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x2f')]=_0xedb7bc['localstationid'];this[_0x42e5('0xd')][_0xedb7bc['uniqueid']]['resolution']=_0xedb7bc['resolution'];this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x33')]=_0xedb7bc[_0x42e5('0x33')];this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x34')]=_0xedb7bc['filename'];this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]]['calleridnum']=_0xedb7bc[_0x42e5('0x35')];if(this[_0x42e5('0xd')][_0xedb7bc['uniqueid']][_0x42e5('0x32')]>0x0){tiff2pdf(_0xedb7bc[_0x42e5('0x34')],_0x42e5('0x36'),function(_0x1d0482){logger[_0x42e5('0x26')](_0xedb7bc['uniqueid'],_0x42e5('0x37'),_0x1d0482[_0x42e5('0x38')]);attachment[_0x42e5('0x39')]({'name':path[_0x42e5('0x3a')](_0xedb7bc['filename'])[_0x42e5('0x3b')],'basename':path[_0x42e5('0x3a')](_0xedb7bc[_0x42e5('0x34')])[_0x42e5('0x3b')]+_0x42e5('0x3c'),'type':_0x42e5('0x3d')})[_0x42e5('0x3e')](function(_0xf8b9e1){faxAccount['notify'](_0x11060d,{'from':_0xedb7bc[_0x42e5('0x35')],'mapKey':'fax','body':path['parse'](_0xedb7bc[_0x42e5('0x34')])[_0x42e5('0x3b')]+_0x42e5('0x3c'),'AttachmentId':_0xf8b9e1['id']})[_0x42e5('0x3f')](function(_0x3229d6){logger[_0x42e5('0x40')](_0xedb7bc[_0x42e5('0x24')],'\x20notify\x20',JSON[_0x42e5('0x41')](_0x3229d6));});})[_0x42e5('0x3f')](function(_0x224395){logger[_0x42e5('0x40')](_0xedb7bc[_0x42e5('0x24')],_0x42e5('0x42'),JSON[_0x42e5('0x41')](_0x224395));});});}logger[_0x42e5('0x26')](_0xedb7bc['uniqueid'],_0x42e5('0x42'));}};Fax[_0x42e5('0x20')][_0x42e5('0x1f')]=function(_0x48757e){if(this[_0x42e5('0x10')][_0x48757e[_0x42e5('0x24')]]){_[_0x42e5('0x43')](this[_0x42e5('0xd')][_0x48757e[_0x42e5('0x24')]],_['pick'](_0x48757e,[_0x42e5('0x44'),'reason']));}};function updateStatus(_0x27cbca){if(_0x27cbca[_0x42e5('0x45')]){faxMessage[_0x42e5('0x46')](_0x27cbca['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x3e2747){ut[_0x42e5('0x47')](_0x42e5('0x48'),_0x3e2747);})[_0x42e5('0x3f')](function(_0x53edc8){ut[_0x42e5('0x47')](_0x42e5('0x49'),_0x53edc8);});}else{ut[_0x42e5('0x47')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x42e5('0x20')]['updateStatus']=function(_0x319088,_0x2583cd,_0x53e29b){var _0x2588e6=this;var _0x18509a={};if(_0x2583cd){_0x18509a={'read':_0x2583cd};}else{_0x18509a={'failMessage':_0x53e29b};}if(this[_0x42e5('0x10')][_0x319088][_0x42e5('0x45')]){faxMessage[_0x42e5('0x46')](this[_0x42e5('0x10')][_0x319088][_0x42e5('0x45')],_0x18509a)[_0x42e5('0x3e')](function(_0x1ddd4c){ut[_0x42e5('0x47')]('[Fax][Message][Updated]',_0x1ddd4c);})[_0x42e5('0x3f')](function(_0x384057){ut[_0x42e5('0x47')](_0x42e5('0x4a'),_0x384057);})[_0x42e5('0x4b')](function(){delete _0x2588e6['channels'][_0x319088];delete _0x2588e6[_0x42e5('0x10')][_0x319088];});}else{ut[_0x42e5('0x47')](_0x42e5('0x4c'));delete this[_0x42e5('0xd')][_0x319088];delete this['actions'][_0x319088];}};Fax['prototype']['syncHangup']=function(_0x37082e){var _0x4695c3=this;if(this['channels'][_0x37082e[_0x42e5('0x24')]]){if(this[_0x42e5('0x10')][_0x37082e[_0x42e5('0x24')]]){this[_0x42e5('0xd')][_0x37082e[_0x42e5('0x24')]]['id']=this[_0x42e5('0x10')][_0x37082e[_0x42e5('0x24')]]['id'];this[_0x42e5('0xd')][_0x37082e[_0x42e5('0x24')]]['name']=this[_0x42e5('0x10')][_0x37082e['uniqueid']][_0x42e5('0x3b')];}logger[_0x42e5('0x26')](_0x37082e[_0x42e5('0x24')],this[_0x42e5('0x10')][_0x37082e[_0x42e5('0x24')]]?_0x42e5('0x4d'):_0x42e5('0x4e'),JSON[_0x42e5('0x41')](this[_0x42e5('0xd')][_0x37082e[_0x42e5('0x24')]]));if(this[_0x42e5('0x10')][_0x37082e['uniqueid']]){if(this[_0x42e5('0xd')][_0x37082e['uniqueid']][_0x42e5('0x4f')]>0x0&&this['channels'][_0x37082e[_0x42e5('0x24')]][_0x42e5('0x18')]==='SUCCESS'){this[_0x42e5('0x50')](_0x37082e[_0x42e5('0x24')],!![]);}else{this['updateStatus'](_0x37082e[_0x42e5('0x24')],![],this[_0x42e5('0xd')][_0x37082e['uniqueid']][_0x42e5('0x51')]?_0x42e5('0x52')+this[_0x42e5('0xd')][_0x37082e['uniqueid']][_0x42e5('0x51')]:_0x42e5('0x53'));}}}};Fax[_0x42e5('0x20')][_0x42e5('0x54')]=function(_0x57368e){var _0x42db50=this;return new BPromise(function(_0x4a4327,_0x259291){_0x42db50[_0x42e5('0x55')](_0x57368e,_0x42db50[_0x42e5('0xe')][_0x57368e[_0x42e5('0x56')]])[_0x42e5('0x3e')](function(_0x3c6914){ut[_0x42e5('0x47')]('[Fax][execOriginate][success]',_0x3c6914);_0x4a4327(ut[_0x42e5('0x38')](_0x42e5('0x57')));})[_0x42e5('0x3f')](function(_0x93c05d){ut[_0x42e5('0x47')](_0x42e5('0x58'),_0x93c05d);updateStatus(_0x57368e);_0x259291(ut[_0x42e5('0x38')](_0x42e5('0x59')));});});};Fax[_0x42e5('0x20')]['checkAfterSend']=function(_0x1cf8e4){var _0x30d2b5=this;return new BPromise(function(_0x2af01f,_0x1163b2){var _0x5b1a5c=_0x30d2b5[_0x42e5('0x5a')](_0x30d2b5[_0x42e5('0xe')][_0x1cf8e4[_0x42e5('0x56')]][_0x42e5('0x5b')],_0x1cf8e4);if(_0x5b1a5c['isValid']){_0x2af01f(ut['message']('Trunk\x20Reachable'));}else{_0x1163b2(ut[_0x42e5('0x38')](_0x5b1a5c[_0x42e5('0x38')]));}});};function originate(_0x8c7c57,_0x2ce1d4,_0xb198d){return new BPromise(function(_0x14d111,_0x1cfe79){if(_0xb198d){var _0x3cc383=util[_0x42e5('0x5c')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x42e5('0x3a')](_0x8c7c57[_0x42e5('0x3')])[_0x42e5('0x3b')],_0x8c7c57[_0x42e5('0x3')]);gs[_0x42e5('0x5d')](_0x3cc383)[_0x42e5('0x3e')](function(){_0x8c7c57[_0x42e5('0x3')]=util[_0x42e5('0x5c')]('%s/%s.tif',path['parse'](_0x8c7c57[_0x42e5('0x3')])[_0x42e5('0x5e')],path['parse'](_0x8c7c57['path'])['name']);_0x2ce1d4[_0x42e5('0x5f')]=_0x8c7c57[_0x42e5('0x3')];ut['logger'](_0x42e5('0x60'),'');ami[_0x42e5('0x61')](ut['variablesAction'](_0x8c7c57,_0x2ce1d4))[_0x42e5('0x3e')](function(_0x14e1ee){_0x14d111(_0x14e1ee);})['catch'](function(_0x3517d0){_0x1cfe79(_0x3517d0);});})['catch'](function(_0x49945e){_0x1cfe79(_0x49945e);});}else{ami['Action'](ut['variablesAction'](_0x8c7c57,_0x2ce1d4))[_0x42e5('0x3e')](function(_0x234e29){_0x14d111(_0x234e29);})['catch'](function(_0x1be0ce){_0x1cfe79(_0x1be0ce);});}});}Fax[_0x42e5('0x20')][_0x42e5('0x55')]=function(_0x290010,_0x1d7c2a){var _0x3f813a=this;return new BPromise(function(_0x53f9df,_0x38e1a1){var _0xe0f6ab=uuid['v4']();var _0x51a05e=ut['addVariables'](_0x290010,_0x1d7c2a);_0x3f813a[_0x42e5('0x10')][_0xe0f6ab]=new Action(_0xe0f6ab,_0x1d7c2a,_0x290010);var _0xfa822e=_0x3f813a[_0x42e5('0x10')][_0xe0f6ab];if(path[_0x42e5('0x3a')](_0x290010[_0x42e5('0x3')])[_0x42e5('0x62')]===_0x42e5('0x3c')){originate(_0xfa822e,_0x51a05e,!![])['then'](function(_0x5a1b63){_0x53f9df(_0x5a1b63);})['catch'](function(_0x567a00){_0x38e1a1(_0x567a00);});}else{originate(_0xfa822e,_0x51a05e,![])[_0x42e5('0x3e')](function(_0x8b16b4){_0x53f9df(_0x8b16b4);})['catch'](function(_0x1908d6){_0x38e1a1(_0x1908d6);});}});};Fax['prototype'][_0x42e5('0x63')]=function(_0x2982a2){return!_[_0x42e5('0x64')](_0x2982a2)&&!_[_0x42e5('0x64')](_0x2982a2[_0x42e5('0x3b')])&&!_[_0x42e5('0x64')](_0x2982a2[_0x42e5('0x65')])&&_0x2982a2[_0x42e5('0x65')]&&!_[_0x42e5('0x64')](this[_0x42e5('0xf')][util[_0x42e5('0x5c')](_0x42e5('0x66'),_0x2982a2[_0x42e5('0x3b')])])&&!_[_0x42e5('0x64')](this[_0x42e5('0xf')][util[_0x42e5('0x5c')](_0x42e5('0x66'),_0x2982a2[_0x42e5('0x3b')])]['status'])&&(this[_0x42e5('0xf')][util[_0x42e5('0x5c')](_0x42e5('0x66'),_0x2982a2[_0x42e5('0x3b')])][_0x42e5('0x2e')]===_0x42e5('0x67')||this[_0x42e5('0xf')][util[_0x42e5('0x5c')]('SIP/%s',_0x2982a2[_0x42e5('0x3b')])][_0x42e5('0x2e')]===_0x42e5('0x68'));};Fax[_0x42e5('0x20')][_0x42e5('0x5a')]=function(_0x5b5073,_0x590cc8){if(!this[_0x42e5('0x63')](_0x5b5073)){ut[_0x42e5('0x47')](_0x42e5('0x69'),_[_0x42e5('0x64')](_0x5b5073)?'':_0x5b5073[_0x42e5('0x3b')]+_0x42e5('0x6a'));return{'isValid':![],'message':_0x42e5('0x6b')};}if(_[_0x42e5('0x64')](_0x590cc8[_0x42e5('0x7')])){ut['logger'](_0x42e5('0x6c'),JSON[_0x42e5('0x41')](_0x590cc8));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x42e5('0x64')](_0x590cc8[_0x42e5('0x3')])){ut[_0x42e5('0x47')](_0x42e5('0x6d'),JSON['stringify'](_0x590cc8));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x42e5('0x6e')]=Fax;
\ No newline at end of file
index c74a2a7..0b27229 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86d3=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x3d7c95,_0x26eee8){var _0x3b97a5=function(_0x5e30c3){while(--_0x5e30c3){_0x3d7c95['push'](_0x3d7c95['shift']());}};_0x3b97a5(++_0x26eee8);}(_0x86d3,0x90));var _0x386d=function(_0x176cbe,_0xfbbda6){_0x176cbe=_0x176cbe-0x0;var _0x1490cc=_0x86d3[_0x176cbe];return _0x1490cc;};'use strict';var util=require(_0x386d('0x0'));var BPromise=require(_0x386d('0x1'));var logger=require(_0x386d('0x2'))(_0x386d('0x3'));var _=require(_0x386d('0x4'));var faxAccount=require(_0x386d('0x5'));function loggerCatch(_0x1fb8b1){return function(_0x1d2106){logger[_0x386d('0x6')](_0x1fb8b1,util[_0x386d('0x7')](_0x1d2106,{'showHidden':![],'depth':null}));};}exports[_0x386d('0x8')]=function(_0x6ca75,_0x293278){return BPromise[_0x386d('0x9')]()[_0x386d('0xa')](faxAccount[_0x386d('0x8')](_0x6ca75,_0x293278))[_0x386d('0xb')](loggerCatch(_0x386d('0xc')));};
\ No newline at end of file
+var _0x4ad2=['catch','[Notify]\x20','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x18082,_0x1862e8){var _0x14792b=function(_0x12689a){while(--_0x12689a){_0x18082['push'](_0x18082['shift']());}};_0x14792b(++_0x1862e8);}(_0x4ad2,0xfe));var _0x24ad=function(_0x4c2568,_0x49780d){_0x4c2568=_0x4c2568-0x0;var _0x591801=_0x4ad2[_0x4c2568];return _0x591801;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require('lodash');var faxAccount=require(_0x24ad('0x0'));function loggerCatch(_0x25c9a6){return function(_0x57d456){logger[_0x24ad('0x1')](_0x25c9a6,util[_0x24ad('0x2')](_0x57d456,{'showHidden':![],'depth':null}));};}exports[_0x24ad('0x3')]=function(_0x593441,_0xca190a){return BPromise[_0x24ad('0x4')]()['then'](faxAccount[_0x24ad('0x3')](_0x593441,_0xca190a))[_0x24ad('0x5')](loggerCatch(_0x24ad('0x6')));};
\ No newline at end of file
index 47bfc65..68a17f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x41a05f,_0x3c943e){var _0x168176=function(_0x15e94d){while(--_0x15e94d){_0x41a05f['push'](_0x41a05f['shift']());}};_0x168176(++_0x3c943e);}(_0x5eb8,0x1e2));var _0x85eb=function(_0x520e16,_0x545cb6){_0x520e16=_0x520e16-0x0;var _0x4771b5=_0x5eb8[_0x520e16];return _0x4771b5;};'use strict';var util=require(_0x85eb('0x0'));var logger=require(_0x85eb('0x1'))(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var exec=require('child_process')['exec'];exports[_0x85eb('0x4')]=function(_0x463d75){return new BPromise(function(_0x3a1359,_0x15d75e){exec(_0x463d75,function(_0x58dcfb,_0x3b0b0b,_0x28774d){logger[_0x85eb('0x5')](_0x85eb('0x6'),_0x3b0b0b);if(_0x58dcfb){logger[_0x85eb('0x5')](_0x85eb('0x6'),_0x85eb('0x7'),util[_0x85eb('0x8')](_0x58dcfb,{'showHidden':![],'depth':null}),_0x3b0b0b,_0x28774d);_0x15d75e(_0x58dcfb);}_0x3a1359(_0x3b0b0b);});});};
\ No newline at end of file
+var _0xec5f=['info','Exec\x20gs','\x20Error\x20:','util','fax','bluebird','child_process','execute'];(function(_0x5e640c,_0xb7935){var _0x2d24a9=function(_0x253eda){while(--_0x253eda){_0x5e640c['push'](_0x5e640c['shift']());}};_0x2d24a9(++_0xb7935);}(_0xec5f,0x103));var _0xfec5=function(_0x70f654,_0x3e29c9){_0x70f654=_0x70f654-0x0;var _0x2f1970=_0xec5f[_0x70f654];return _0x2f1970;};'use strict';var util=require(_0xfec5('0x0'));var logger=require('../../../../config/logger')(_0xfec5('0x1'));var BPromise=require(_0xfec5('0x2'));var exec=require(_0xfec5('0x3'))['exec'];exports[_0xfec5('0x4')]=function(_0x22ecf9){return new BPromise(function(_0x1bf49d,_0x274358){exec(_0x22ecf9,function(_0x5b7410,_0x59c309,_0x4ca4ed){logger[_0xfec5('0x5')](_0xfec5('0x6'),_0x59c309);if(_0x5b7410){logger[_0xfec5('0x5')](_0xfec5('0x6'),_0xfec5('0x7'),util['inspect'](_0x5b7410,{'showHidden':![],'depth':null}),_0x59c309,_0x4ca4ed);_0x274358(_0x5b7410);}_0x1bf49d(_0x59c309);});});};
\ No newline at end of file
index 1dd9a38..a1d6b3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0ba=['gateway','faxdetect','localstationid','path','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','lodash','moment','../../../../config/logger','fax','message','info','inspect','addVariables','headerinfo','minrate','maxrate','modem'];(function(_0x1a34d2,_0x40f840){var _0xe15289=function(_0x44963c){while(--_0x44963c){_0x1a34d2['push'](_0x1a34d2['shift']());}};_0xe15289(++_0x40f840);}(_0xa0ba,0x184));var _0xaa0b=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0xa0ba[_0x3ad7ad];return _0x225a60;};'use strict';var util=require('util');var _=require(_0xaa0b('0x0'));var moment=require(_0xaa0b('0x1'));var logger=require(_0xaa0b('0x2'))(_0xaa0b('0x3'));exports[_0xaa0b('0x4')]=function(_0x50b8bc){return{'message':_0x50b8bc};};exports['logger']=function(_0x32df72,_0x2eec03){logger[_0xaa0b('0x5')](_0x32df72,util[_0xaa0b('0x6')](_0x2eec03,{'showHidden':![],'depth':null}));};exports[_0xaa0b('0x7')]=function(_0x628646,_0x3f08ee){var _0x2f39c5={'XMF-ECM':_0x3f08ee['ecm'],'XMF-HEADERINFO':_0x3f08ee[_0xaa0b('0x8')],'XMF-MINRATE':_0x3f08ee[_0xaa0b('0x9')],'XMF-MAXRATE':_0x3f08ee[_0xaa0b('0xa')],'XMF-MODEM':util['format']('\x22%s\x22',_0x3f08ee[_0xaa0b('0xb')]),'XMF-GATEWAY':_0x3f08ee[_0xaa0b('0xc')],'XMF-FAXDETECT':_0x3f08ee[_0xaa0b('0xd')],'XMF-T38TIMEOUT':_0x3f08ee['t38timeout'],'XMF-LOCALSTATIONID':_0x3f08ee[_0xaa0b('0xe')],'XMF-PATH':_0x628646[_0xaa0b('0xf')]};return _0x2f39c5;};exports['variablesAction']=function(_0x143b04,_0xbd87b3){return{'actionid':_0x143b04['uniqueid'],'action':'originate','channel':_0x143b04['channel'],'Exten':_0xaa0b('0x10'),'Context':_0xaa0b('0x11'),'Priority':'1','callerid':util['format'](_0xaa0b('0x12'),_0x143b04[_0xaa0b('0x8')]?_0x143b04['headerinfo']:'',_0x143b04[_0xaa0b('0xe')]),'variable':_0xbd87b3,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x143b04[_0xaa0b('0x13')]};};
\ No newline at end of file
+var _0x0ca4=['info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax','message','logger'];(function(_0x49784a,_0x28665f){var _0x3dcf85=function(_0x36d055){while(--_0x36d055){_0x49784a['push'](_0x49784a['shift']());}};_0x3dcf85(++_0x28665f);}(_0x0ca4,0x15a));var _0x40ca=function(_0x3a67e2,_0x5a4bf6){_0x3a67e2=_0x3a67e2-0x0;var _0xde57d8=_0x0ca4[_0x3a67e2];return _0xde57d8;};'use strict';var util=require(_0x40ca('0x0'));var _=require('lodash');var moment=require(_0x40ca('0x1'));var logger=require(_0x40ca('0x2'))(_0x40ca('0x3'));exports[_0x40ca('0x4')]=function(_0x97c92){return{'message':_0x97c92};};exports[_0x40ca('0x5')]=function(_0x597092,_0x112172){logger[_0x40ca('0x6')](_0x597092,util[_0x40ca('0x7')](_0x112172,{'showHidden':![],'depth':null}));};exports[_0x40ca('0x8')]=function(_0x38abec,_0x446439){var _0x463add={'XMF-ECM':_0x446439[_0x40ca('0x9')],'XMF-HEADERINFO':_0x446439[_0x40ca('0xa')],'XMF-MINRATE':_0x446439[_0x40ca('0xb')],'XMF-MAXRATE':_0x446439[_0x40ca('0xc')],'XMF-MODEM':util['format'](_0x40ca('0xd'),_0x446439[_0x40ca('0xe')]),'XMF-GATEWAY':_0x446439['gateway'],'XMF-FAXDETECT':_0x446439['faxdetect'],'XMF-T38TIMEOUT':_0x446439['t38timeout'],'XMF-LOCALSTATIONID':_0x446439[_0x40ca('0xf')],'XMF-PATH':_0x38abec[_0x40ca('0x10')]};return _0x463add;};exports[_0x40ca('0x11')]=function(_0x2809a5,_0x34ba69){return{'actionid':_0x2809a5[_0x40ca('0x12')],'action':_0x40ca('0x13'),'channel':_0x2809a5['channel'],'Exten':_0x40ca('0x14'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x40ca('0x15'),_0x2809a5[_0x40ca('0xa')]?_0x2809a5[_0x40ca('0xa')]:'',_0x2809a5['localstationid']),'variable':_0x34ba69,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2809a5[_0x40ca('0x12')]};};
\ No newline at end of file
index ecedffc..4e8266e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e89=['getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts'];(function(_0x11a741,_0x1e7097){var _0xa466f6=function(_0x15a8fc){while(--_0x15a8fc){_0x11a741['push'](_0x11a741['shift']());}};_0xa466f6(++_0x1e7097);}(_0x1e89,0x1c0));var _0x91e8=function(_0x2facf8,_0x3f1db9){_0x2facf8=_0x2facf8-0x0;var _0x13a2b1=_0x1e89[_0x2facf8];return _0x13a2b1;};'use strict';var BPromise=require(_0x91e8('0x0'));var util=require(_0x91e8('0x1'));var moment=require(_0x91e8('0x2'));var server=require(_0x91e8('0x3'));var Realtime=require('./realtime');var Report=require(_0x91e8('0x4'));var Acw=require('./acw');var Trigger=require(_0x91e8('0x5'));var Dialer=require(_0x91e8('0x6'));var Preview=require(_0x91e8('0x7'));var Fax=require(_0x91e8('0x8'));var user=require(_0x91e8('0x9'));var voiceQueue=require(_0x91e8('0xa'));var voiceQueueReport=require(_0x91e8('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x91e8('0xc'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x91e8('0xd'));var voiceExtension=require(_0x91e8('0xe'));var faxAccount=require(_0x91e8('0xf'));var zendesk=require(_0x91e8('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x91e8('0x11'));var freshdesk=require(_0x91e8('0x12'));var desk=require(_0x91e8('0x13'));var zoho=require(_0x91e8('0x14'));var vtiger=require(_0x91e8('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x91e8('0x16'));var dynamics365=require(_0x91e8('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x91e8('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x91e8('0x19')](_0x91e8('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x91e8('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user['getAgents']())[_0x91e8('0x1b')](realtime[_0x91e8('0x1c')]())['then'](user[_0x91e8('0x1d')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x1e')]())[_0x91e8('0x1b')](trunk[_0x91e8('0x1f')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x20')]())['then'](voiceQueue[_0x91e8('0x21')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x22')]())[_0x91e8('0x1b')](trigger[_0x91e8('0x23')]())[_0x91e8('0x1b')](realtime['initTriggers']())[_0x91e8('0x1b')](template[_0x91e8('0x24')]())['then'](realtime['initTemplates']())[_0x91e8('0x1b')](zendesk['getZendeskAccounts']())[_0x91e8('0x1b')](realtime[_0x91e8('0x25')]())[_0x91e8('0x1b')](salesforce[_0x91e8('0x26')]())['then'](realtime[_0x91e8('0x27')]())[_0x91e8('0x1b')](sugarcrm[_0x91e8('0x28')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x29')]())[_0x91e8('0x1b')](freshdesk[_0x91e8('0x2a')]())[_0x91e8('0x1b')](realtime['initFreshdeskAccounts']())[_0x91e8('0x1b')](desk[_0x91e8('0x2b')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x2c')]())[_0x91e8('0x1b')](zoho[_0x91e8('0x2d')]())['then'](realtime[_0x91e8('0x2e')]())[_0x91e8('0x1b')](vtiger[_0x91e8('0x2f')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x30')]())[_0x91e8('0x1b')](freshsales['getFreshsalesAccounts']())[_0x91e8('0x1b')](realtime['initFreshsalesAccounts']())[_0x91e8('0x1b')](servicenow['getServicenowAccounts']())[_0x91e8('0x1b')](realtime[_0x91e8('0x31')]())['then'](dynamics365['getDynamics365Accounts']())[_0x91e8('0x1b')](realtime['initDynamics365Accounts']())[_0x91e8('0x1b')](campaign[_0x91e8('0x32')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x33')]())['then'](voiceExtension[_0x91e8('0x34')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x35')]())['then'](faxAccount[_0x91e8('0x36')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x37')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x91e8('0x1b')](voiceQueueReport[_0x91e8('0x38')]())['then'](realtime[_0x91e8('0x39')]())[_0x91e8('0x1b')](cmHopperHistory[_0x91e8('0x3a')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x3b')]())[_0x91e8('0x1b')](cmHopperHistory[_0x91e8('0x3c')]())[_0x91e8('0x1b')](realtime['initCampaignHopperHistory']())[_0x91e8('0x1b')](voiceCallReport[_0x91e8('0x3d')]())[_0x91e8('0x1b')](realtime[_0x91e8('0x3e')]())[_0x91e8('0x3f')](function(_0x20d653){logger[_0x91e8('0x40')](_0x91e8('0x41'),util[_0x91e8('0x42')](_0x20d653,{'showHidden':![],'depth':null}));});}function main(){return server[_0x91e8('0x43')](realtime,preview,fax)['then'](function(_0x50e084){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x91e8('0x44')]();setInterval(initRealtime,0x1388);})[_0x91e8('0x3f')](function(_0x4d0b02){logger[_0x91e8('0x40')](_0x91e8('0x45'),util[_0x91e8('0x42')](_0x4d0b02,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x4700=['./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','moment','./report','./trigger','./dialer'];(function(_0xabbd65,_0x546d99){var _0x1d005a=function(_0x11694e){while(--_0x11694e){_0xabbd65['push'](_0xabbd65['shift']());}};_0x1d005a(++_0x546d99);}(_0x4700,0x81));var _0x0470=function(_0x32fcc6,_0x3d4c27){_0x32fcc6=_0x32fcc6-0x0;var _0x3a26c0=_0x4700[_0x32fcc6];return _0x3a26c0;};'use strict';var BPromise=require(_0x0470('0x0'));var util=require('util');var moment=require(_0x0470('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x0470('0x2'));var Acw=require('./acw');var Trigger=require(_0x0470('0x3'));var Dialer=require(_0x0470('0x4'));var Preview=require(_0x0470('0x5'));var Fax=require(_0x0470('0x6'));var user=require(_0x0470('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x0470('0x8'));var voiceCallReport=require(_0x0470('0x9'));var trunk=require('./rpc/trunk');var trigger=require(_0x0470('0xa'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x0470('0xb'));var voiceExtension=require(_0x0470('0xc'));var faxAccount=require(_0x0470('0xd'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x0470('0xe'));var sugarcrm=require(_0x0470('0xf'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x0470('0x10'));var zoho=require(_0x0470('0x11'));var vtiger=require(_0x0470('0x12'));var freshsales=require(_0x0470('0x13'));var servicenow=require(_0x0470('0x14'));var dynamics365=require(_0x0470('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x0470('0x16'))(_0x0470('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0470('0x18')](_0x0470('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0470('0x18')](_0x0470('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0470('0x1a')]()[_0x0470('0x1b')](user[_0x0470('0x1c')]())[_0x0470('0x1b')](realtime[_0x0470('0x1d')]())[_0x0470('0x1b')](user['getTelephones']())[_0x0470('0x1b')](realtime[_0x0470('0x1e')]())['then'](trunk[_0x0470('0x1f')]())[_0x0470('0x1b')](realtime[_0x0470('0x20')]())[_0x0470('0x1b')](voiceQueue[_0x0470('0x21')]())[_0x0470('0x1b')](realtime[_0x0470('0x22')]())['then'](trigger['getTriggers']())[_0x0470('0x1b')](realtime[_0x0470('0x23')]())['then'](template[_0x0470('0x24')]())[_0x0470('0x1b')](realtime[_0x0470('0x25')]())[_0x0470('0x1b')](zendesk['getZendeskAccounts']())[_0x0470('0x1b')](realtime[_0x0470('0x26')]())[_0x0470('0x1b')](salesforce[_0x0470('0x27')]())[_0x0470('0x1b')](realtime[_0x0470('0x28')]())[_0x0470('0x1b')](sugarcrm[_0x0470('0x29')]())[_0x0470('0x1b')](realtime[_0x0470('0x2a')]())[_0x0470('0x1b')](freshdesk[_0x0470('0x2b')]())[_0x0470('0x1b')](realtime['initFreshdeskAccounts']())[_0x0470('0x1b')](desk['getDeskAccounts']())[_0x0470('0x1b')](realtime['initDeskAccounts']())[_0x0470('0x1b')](zoho[_0x0470('0x2c')]())[_0x0470('0x1b')](realtime['initZohoAccounts']())[_0x0470('0x1b')](vtiger['getVtigerAccounts']())[_0x0470('0x1b')](realtime[_0x0470('0x2d')]())[_0x0470('0x1b')](freshsales[_0x0470('0x2e')]())[_0x0470('0x1b')](realtime[_0x0470('0x2f')]())[_0x0470('0x1b')](servicenow[_0x0470('0x30')]())[_0x0470('0x1b')](realtime[_0x0470('0x31')]())[_0x0470('0x1b')](dynamics365[_0x0470('0x32')]())[_0x0470('0x1b')](realtime[_0x0470('0x33')]())[_0x0470('0x1b')](campaign[_0x0470('0x34')]())[_0x0470('0x1b')](realtime['initCampaigns']())[_0x0470('0x1b')](voiceExtension[_0x0470('0x35')]())[_0x0470('0x1b')](realtime[_0x0470('0x36')]())[_0x0470('0x1b')](faxAccount[_0x0470('0x37')]())[_0x0470('0x1b')](realtime['initFaxAccounts']())[_0x0470('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x0470('0x1a')]()['then'](voiceQueueReport[_0x0470('0x38')]())[_0x0470('0x1b')](realtime[_0x0470('0x39')]())[_0x0470('0x1b')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0x0470('0x1b')](cmHopperHistory['getCampaignHopperHistory']())[_0x0470('0x1b')](realtime[_0x0470('0x3a')]())[_0x0470('0x1b')](voiceCallReport[_0x0470('0x3b')]())[_0x0470('0x1b')](realtime['initVoiceCallReports']())[_0x0470('0x3c')](function(_0x2b1ff4){logger[_0x0470('0x3d')](_0x0470('0x3e'),util[_0x0470('0x3f')](_0x2b1ff4,{'showHidden':![],'depth':null}));});}function main(){return server[_0x0470('0x40')](realtime,preview,fax)[_0x0470('0x1b')](function(_0x3fd1d4){return initRealtime();})[_0x0470('0x1b')](function(){return initParams();})[_0x0470('0x1b')](function(){report[_0x0470('0x41')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x158c33){logger[_0x0470('0x3d')](_0x0470('0x42'),util[_0x0470('0x3f')](_0x158c33,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index f3f1ded..8c1a7cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xedd9,0xfc));var _0x9edd=function(_0x5adaa2,_0x56da87){_0x5adaa2=_0x5adaa2-0x0;var _0xb461de=_0xedd9[_0x5adaa2];return _0xb461de;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent;
\ No newline at end of file
+var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x4f98f2,_0x35d270){var _0x595a12=function(_0x1c34e5){while(--_0x1c34e5){_0x4f98f2['push'](_0x4f98f2['shift']());}};_0x595a12(++_0x35d270);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent;
\ No newline at end of file
index 419b01a..1026282 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda96=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x2ac817,_0x47d76e){var _0x35e2b1=function(_0x311136){while(--_0x311136){_0x2ac817['push'](_0x2ac817['shift']());}};_0x35e2b1(++_0x47d76e);}(_0xda96,0x1a2));var _0x6da9=function(_0x2ea107,_0x321d46){_0x2ea107=_0x2ea107-0x0;var _0x4df250=_0xda96[_0x2ea107];return _0x4df250;};'use strict';function Campaign(_0x4431b5){this['id']=_0x4431b5['id']||0x0;this[_0x6da9('0x0')]=_0x4431b5[_0x6da9('0x0')]||'';this[_0x6da9('0x1')]=_0x4431b5[_0x6da9('0x1')]||'campaign';this[_0x6da9('0x2')]=0x0;this['temp']=0x0;this[_0x6da9('0x3')]=0x0;this[_0x6da9('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x6da9('0x5')]=_0x4431b5['active'];this[_0x6da9('0x6')]=_0x4431b5['limitCalls'];this[_0x6da9('0x7')]=_0x4431b5[_0x6da9('0x7')]||null;this['dialGlobalInterval']=_0x4431b5[_0x6da9('0x8')]?_0x4431b5[_0x6da9('0x8')]:null;this[_0x6da9('0x9')]=_0x4431b5[_0x6da9('0x9')];this[_0x6da9('0xa')]=_0x4431b5['dialOriginateCallerIdNumber'];this[_0x6da9('0xb')]=_0x4431b5['dialOriginateTimeout']||0x1e;this[_0x6da9('0xc')]=_0x4431b5[_0x6da9('0xc')];this[_0x6da9('0xd')]=_0x4431b5[_0x6da9('0xd')];this['dialBusyMaxRetry']=_0x4431b5[_0x6da9('0xe')];this[_0x6da9('0xf')]=_0x4431b5[_0x6da9('0xf')];this[_0x6da9('0x10')]=_0x4431b5['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x4431b5[_0x6da9('0x11')];this[_0x6da9('0x12')]=_0x4431b5['dialGlobalMaxRetry'];this[_0x6da9('0x13')]=_0x4431b5['dialNoSuchNumberMaxRetry']||0x3;this[_0x6da9('0x14')]=_0x4431b5[_0x6da9('0x14')]||0x96;this[_0x6da9('0x15')]=_0x4431b5[_0x6da9('0x15')]||0x3;this['dialDropRetryFrequency']=_0x4431b5[_0x6da9('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x4431b5['dialAbandonedMaxRetry']||0x3;this[_0x6da9('0x17')]=_0x4431b5[_0x6da9('0x17')]||0x96;this[_0x6da9('0x18')]=_0x4431b5[_0x6da9('0x18')]||0x3;this[_0x6da9('0x19')]=_0x4431b5['dialMachineRetryFrequency']||0x96;this[_0x6da9('0x1a')]=_0x4431b5[_0x6da9('0x1a')]||0x3;this[_0x6da9('0x1b')]=_0x4431b5[_0x6da9('0x1b')]||0x96;this[_0x6da9('0x1c')]=_0x4431b5[_0x6da9('0x1c')]||_0x6da9('0x1d');this[_0x6da9('0x1e')]=_0x4431b5[_0x6da9('0x1e')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x4431b5[_0x6da9('0x1f')]||undefined;this['dialCutDigit']=_0x4431b5[_0x6da9('0x20')]||undefined;this[_0x6da9('0x21')]=_0x4431b5[_0x6da9('0x21')]?_0x4431b5['TrunkBackup']:undefined;this[_0x6da9('0x22')]=_0x4431b5[_0x6da9('0x22')]?_0x4431b5['Trunk']:undefined;this[_0x6da9('0x23')]=_0x4431b5[_0x6da9('0x23')]?_0x4431b5[_0x6da9('0x23')]:undefined;this[_0x6da9('0x24')]=_0x4431b5[_0x6da9('0x24')]?_0x4431b5['SquareProject']:undefined;this['dialQueueProject']=_0x4431b5[_0x6da9('0x24')]?_0x4431b5[_0x6da9('0x24')][_0x6da9('0x0')]:undefined;this[_0x6da9('0x25')]=_0x4431b5[_0x6da9('0x25')]||![];this[_0x6da9('0x26')]=_0x4431b5[_0x6da9('0x26')];this['dialAMDGreeting']=_0x4431b5[_0x6da9('0x27')];this[_0x6da9('0x28')]=_0x4431b5[_0x6da9('0x28')];this['dialAMDTotalAnalysisTime']=_0x4431b5[_0x6da9('0x29')];this[_0x6da9('0x2a')]=_0x4431b5[_0x6da9('0x2a')];this[_0x6da9('0x2b')]=_0x4431b5['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x4431b5[_0x6da9('0x2c')];this[_0x6da9('0x2d')]=_0x4431b5[_0x6da9('0x2d')];this[_0x6da9('0x2e')]=_0x4431b5['dialAMDMaximumWordLength'];}module[_0x6da9('0x2f')]=Campaign;
\ No newline at end of file
+var _0xf0d7=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive'];(function(_0x2c05fb,_0x2feb35){var _0x3e1108=function(_0x760626){while(--_0x760626){_0x2c05fb['push'](_0x2c05fb['shift']());}};_0x3e1108(++_0x2feb35);}(_0xf0d7,0x96));var _0x7f0d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf0d7[_0xbca1b1];return _0x4e1686;};'use strict';function Campaign(_0x435bb2){this['id']=_0x435bb2['id']||0x0;this[_0x7f0d('0x0')]=_0x435bb2[_0x7f0d('0x0')]||'';this['type']=_0x435bb2[_0x7f0d('0x1')]||_0x7f0d('0x2');this[_0x7f0d('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x7f0d('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x435bb2[_0x7f0d('0x5')];this[_0x7f0d('0x6')]=_0x435bb2[_0x7f0d('0x6')];this['dialTimezone']=_0x435bb2['dialTimezone']||null;this['dialGlobalInterval']=_0x435bb2[_0x7f0d('0x7')]?_0x435bb2[_0x7f0d('0x7')]:null;this[_0x7f0d('0x8')]=_0x435bb2['dialOriginateCallerIdName'];this[_0x7f0d('0x9')]=_0x435bb2[_0x7f0d('0x9')];this[_0x7f0d('0xa')]=_0x435bb2[_0x7f0d('0xa')]||0x1e;this['dialCongestionMaxRetry']=_0x435bb2[_0x7f0d('0xb')];this['dialCongestionRetryFrequency']=_0x435bb2[_0x7f0d('0xc')];this['dialBusyMaxRetry']=_0x435bb2[_0x7f0d('0xd')];this[_0x7f0d('0xe')]=_0x435bb2[_0x7f0d('0xe')];this[_0x7f0d('0xf')]=_0x435bb2[_0x7f0d('0xf')];this[_0x7f0d('0x10')]=_0x435bb2['dialNoAnswerRetryFrequency'];this[_0x7f0d('0x11')]=_0x435bb2[_0x7f0d('0x11')];this[_0x7f0d('0x12')]=_0x435bb2[_0x7f0d('0x12')]||0x3;this[_0x7f0d('0x13')]=_0x435bb2[_0x7f0d('0x13')]||0x96;this[_0x7f0d('0x14')]=_0x435bb2[_0x7f0d('0x14')]||0x3;this[_0x7f0d('0x15')]=_0x435bb2[_0x7f0d('0x15')]||0x96;this[_0x7f0d('0x16')]=_0x435bb2[_0x7f0d('0x16')]||0x3;this[_0x7f0d('0x17')]=_0x435bb2[_0x7f0d('0x17')]||0x96;this[_0x7f0d('0x18')]=_0x435bb2[_0x7f0d('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x435bb2[_0x7f0d('0x19')]||0x96;this[_0x7f0d('0x1a')]=_0x435bb2['dialAgentRejectMaxRetry']||0x3;this[_0x7f0d('0x1b')]=_0x435bb2[_0x7f0d('0x1b')]||0x96;this[_0x7f0d('0x1c')]=_0x435bb2[_0x7f0d('0x1c')]||_0x7f0d('0x1d');this['dialPrefix']=_0x435bb2[_0x7f0d('0x1e')]||undefined;this[_0x7f0d('0x1f')]=_0x435bb2[_0x7f0d('0x1f')]||undefined;this['dialCutDigit']=_0x435bb2[_0x7f0d('0x20')]||undefined;this[_0x7f0d('0x21')]=_0x435bb2[_0x7f0d('0x21')]?_0x435bb2[_0x7f0d('0x21')]:undefined;this[_0x7f0d('0x22')]=_0x435bb2['Trunk']?_0x435bb2[_0x7f0d('0x22')]:undefined;this[_0x7f0d('0x23')]=_0x435bb2[_0x7f0d('0x23')]?_0x435bb2[_0x7f0d('0x23')]:undefined;this['SquareProject']=_0x435bb2[_0x7f0d('0x24')]?_0x435bb2[_0x7f0d('0x24')]:undefined;this['dialQueueProject']=_0x435bb2[_0x7f0d('0x24')]?_0x435bb2[_0x7f0d('0x24')][_0x7f0d('0x0')]:undefined;this[_0x7f0d('0x25')]=_0x435bb2[_0x7f0d('0x25')]||![];this[_0x7f0d('0x26')]=_0x435bb2[_0x7f0d('0x26')];this[_0x7f0d('0x27')]=_0x435bb2[_0x7f0d('0x27')];this[_0x7f0d('0x28')]=_0x435bb2[_0x7f0d('0x28')];this['dialAMDTotalAnalysisTime']=_0x435bb2['dialAMDTotalAnalysisTime'];this[_0x7f0d('0x29')]=_0x435bb2[_0x7f0d('0x29')];this[_0x7f0d('0x2a')]=_0x435bb2['dialAMDBetweenWordsSilence'];this[_0x7f0d('0x2b')]=_0x435bb2[_0x7f0d('0x2b')];this[_0x7f0d('0x2c')]=_0x435bb2[_0x7f0d('0x2c')];this['dialAMDMaximumWordLength']=_0x435bb2[_0x7f0d('0x2d')];}module[_0x7f0d('0x2e')]=Campaign;
\ No newline at end of file
index 64f0594..523694c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4d8=['endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','destinationchannel','calleridnum','connectedlinename','uniqueid','linkedid','exten','answered','answertime'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xc4d8[_0x4a7631];return _0x1a5a6f;};'use strict';function Channel(){this[_0x8c4d('0x0')]=null;this['channel']='';this[_0x8c4d('0x1')]='';this[_0x8c4d('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x8c4d('0x3')]=undefined;this['accountcode']=0x0;this['context']='';this[_0x8c4d('0x4')]=0x0;this[_0x8c4d('0x5')]=0x0;this[_0x8c4d('0x6')]=0x0;this[_0x8c4d('0x7')]=![];this[_0x8c4d('0x8')]=null;this[_0x8c4d('0x9')]=null;this[_0x8c4d('0xa')]=![];this[_0x8c4d('0xb')]=![];this[_0x8c4d('0xc')]='';this['lastdata']='';this[_0x8c4d('0xd')]=0x0;this[_0x8c4d('0xe')]=0x0;this[_0x8c4d('0xf')]=0x0;this[_0x8c4d('0x10')]=null;this['tag']=null;this['disposition']=null;this[_0x8c4d('0x11')]=![];this[_0x8c4d('0x12')]=null;this[_0x8c4d('0x13')]=null;this[_0x8c4d('0x14')]=[];this[_0x8c4d('0x15')]=undefined;this[_0x8c4d('0x16')]=undefined;this[_0x8c4d('0x17')]=undefined;this[_0x8c4d('0x18')]=0x0;}module['exports']=Channel;
\ No newline at end of file
+var _0x383b=['lastapplication','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','starttime','destinationchannel','calleridnum','calleridname','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned'];(function(_0x5cd2ab,_0x2d162b){var _0x4663db=function(_0x54a66d){while(--_0x54a66d){_0x5cd2ab['push'](_0x5cd2ab['shift']());}};_0x4663db(++_0x2d162b);}(_0x383b,0x89));var _0xb383=function(_0x164707,_0x946055){_0x164707=_0x164707-0x0;var _0x1bd278=_0x383b[_0x164707];return _0x1bd278;};'use strict';function Channel(){this[_0xb383('0x0')]=null;this['channel']='';this[_0xb383('0x1')]='';this[_0xb383('0x2')]=0x0;this[_0xb383('0x3')]='';this['connectedlinenum']=undefined;this[_0xb383('0x4')]=undefined;this['accountcode']=0x0;this[_0xb383('0x5')]='';this[_0xb383('0x6')]=0x0;this[_0xb383('0x7')]=0x0;this[_0xb383('0x8')]=0x0;this[_0xb383('0x9')]=![];this[_0xb383('0xa')]=null;this['endtime']=null;this[_0xb383('0xb')]=![];this[_0xb383('0xc')]=![];this[_0xb383('0xd')]='';this['lastdata']='';this['duration']=0x0;this[_0xb383('0xe')]=0x0;this[_0xb383('0xf')]=0x0;this[_0xb383('0x10')]=null;this[_0xb383('0x11')]=null;this['disposition']=null;this[_0xb383('0x12')]=![];this[_0xb383('0x13')]=null;this[_0xb383('0x14')]=null;this[_0xb383('0x15')]=[];this[_0xb383('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xb383('0x17')]=undefined;this[_0xb383('0x18')]=0x0;}module['exports']=Channel;
\ No newline at end of file
index b4bf62a..5b85f64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa745=['name','username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','exports'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0xa745,0x13f));var _0x5a74=function(_0xf8f7c8,_0x614d08){_0xf8f7c8=_0xf8f7c8-0x0;var _0x8b9da=_0xa745[_0xf8f7c8];return _0x8b9da;};'use strict';function DeskAccount(_0x1201b3){this['id']=_0x1201b3['id']||0x0;this[_0x5a74('0x0')]=_0x1201b3['name']||'';this['username']=_0x1201b3[_0x5a74('0x1')]||'';this[_0x5a74('0x2')]=_0x1201b3[_0x5a74('0x2')]||'';this['authType']=_0x1201b3['authType']||'';this[_0x5a74('0x3')]=_0x1201b3[_0x5a74('0x3')]||'';this[_0x5a74('0x4')]=_0x1201b3[_0x5a74('0x4')]||'';this[_0x5a74('0x5')]=_0x1201b3[_0x5a74('0x5')]||'';this[_0x5a74('0x6')]=_0x1201b3['token']||'';this[_0x5a74('0x7')]=_0x1201b3[_0x5a74('0x7')]||'';this[_0x5a74('0x8')]=_0x1201b3['type']||'';this[_0x5a74('0x9')]=_0x1201b3['serverUrl']||'';this['Configurations']=_0x1201b3['Configurations']||{};}module[_0x5a74('0xa')]=DeskAccount;
\ No newline at end of file
+var _0x5d2d=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','token','tokenSecret'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x5d2d,0x1c0));var _0xd5d2=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x5d2d[_0x29b609];return _0x54c952;};'use strict';function DeskAccount(_0x344103){this['id']=_0x344103['id']||0x0;this[_0xd5d2('0x0')]=_0x344103[_0xd5d2('0x0')]||'';this['username']=_0x344103[_0xd5d2('0x1')]||'';this[_0xd5d2('0x2')]=_0x344103[_0xd5d2('0x2')]||'';this[_0xd5d2('0x3')]=_0x344103[_0xd5d2('0x3')]||'';this[_0xd5d2('0x4')]=_0x344103[_0xd5d2('0x4')]||'';this[_0xd5d2('0x5')]=_0x344103[_0xd5d2('0x5')]||'';this['consumerSecret']=_0x344103['consumerSecret']||'';this[_0xd5d2('0x6')]=_0x344103[_0xd5d2('0x6')]||'';this[_0xd5d2('0x7')]=_0x344103[_0xd5d2('0x7')]||'';this[_0xd5d2('0x8')]=_0x344103[_0xd5d2('0x8')]||'';this[_0xd5d2('0x9')]=_0x344103[_0xd5d2('0x9')]||'';this[_0xd5d2('0xa')]=_0x344103[_0xd5d2('0xa')]||{};}module[_0xd5d2('0xb')]=DeskAccount;
\ No newline at end of file
index 93786fa..12aa505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5828=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x355543,_0x2338dd){var _0x468604=function(_0x4498e7){while(--_0x4498e7){_0x355543['push'](_0x355543['shift']());}};_0x468604(++_0x2338dd);}(_0x5828,0xb3));var _0x8582=function(_0xbb66a,_0x28bf42){_0xbb66a=_0xbb66a-0x0;var _0x5b69a5=_0x5828[_0xbb66a];return _0x5b69a5;};'use strict';function Dynamics365Account(_0x209fb3){this['id']=_0x209fb3['id']||0x0;this[_0x8582('0x0')]=_0x209fb3[_0x8582('0x0')]||'';this[_0x8582('0x1')]=_0x209fb3[_0x8582('0x1')]||'';this[_0x8582('0x2')]=_0x209fb3[_0x8582('0x2')]||'';this[_0x8582('0x3')]=_0x209fb3[_0x8582('0x3')]||'';this['tenantId']=_0x209fb3[_0x8582('0x4')]||'';this[_0x8582('0x5')]=_0x209fb3[_0x8582('0x5')]||'';this['clientSecret']=_0x209fb3[_0x8582('0x6')]||{};this[_0x8582('0x7')]=_0x209fb3[_0x8582('0x7')]||'';this['modernAuthentication']=_0x209fb3[_0x8582('0x8')]||![];this[_0x8582('0x9')]=_0x209fb3[_0x8582('0x9')]||{};this[_0x8582('0xa')]=_0x209fb3['CloudProvider']||{};}module[_0x8582('0xb')]=Dynamics365Account;
\ No newline at end of file
+var _0xcd8b=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xcd8b,0xfb));var _0xbcd8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xcd8b[_0x1b6186];return _0x186121;};'use strict';function Dynamics365Account(_0x1b0ec7){this['id']=_0x1b0ec7['id']||0x0;this[_0xbcd8('0x0')]=_0x1b0ec7['name']||'';this[_0xbcd8('0x1')]=_0x1b0ec7[_0xbcd8('0x1')]||'';this[_0xbcd8('0x2')]=_0x1b0ec7[_0xbcd8('0x2')]||'';this[_0xbcd8('0x3')]=_0x1b0ec7[_0xbcd8('0x3')]||'';this[_0xbcd8('0x4')]=_0x1b0ec7[_0xbcd8('0x4')]||'';this['clientId']=_0x1b0ec7[_0xbcd8('0x5')]||'';this[_0xbcd8('0x6')]=_0x1b0ec7[_0xbcd8('0x6')]||{};this[_0xbcd8('0x7')]=_0x1b0ec7[_0xbcd8('0x7')]||'';this[_0xbcd8('0x8')]=_0x1b0ec7[_0xbcd8('0x8')]||![];this[_0xbcd8('0x9')]=_0x1b0ec7['Configurations']||{};this[_0xbcd8('0xa')]=_0x1b0ec7[_0xbcd8('0xa')]||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
index 637e1ef..3e7f836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd517=['localstationid','minrate','maxrate','modem','v17,v27,v29','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x351765,_0x3f89e4){var _0x46586f=function(_0x390a35){while(--_0x390a35){_0x351765['push'](_0x351765['shift']());}};_0x46586f(++_0x3f89e4);}(_0xd517,0x182));var _0x7d51=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0xd517[_0x483ab9];return _0x35043b;};'use strict';function FaxAccount(_0x2bc212){this['id']=_0x2bc212['id']||0x0;this[_0x7d51('0x0')]=_0x2bc212[_0x7d51('0x0')]||'';this[_0x7d51('0x1')]=_0x2bc212[_0x7d51('0x1')];this[_0x7d51('0x2')]=_0x2bc212[_0x7d51('0x2')];this['headerinfo']=_0x2bc212[_0x7d51('0x3')];this[_0x7d51('0x4')]=_0x2bc212['localstationid'];this[_0x7d51('0x5')]=_0x2bc212[_0x7d51('0x5')]||0x960;this[_0x7d51('0x6')]=_0x2bc212[_0x7d51('0x6')]||0x3840;this['modem']=_0x2bc212[_0x7d51('0x7')]||_0x7d51('0x8');this['gateway']=_0x2bc212['gateway']||'no';this['faxdetect']=_0x2bc212['faxdetect']||'no';this[_0x7d51('0x9')]=_0x2bc212[_0x7d51('0x9')]||0x1388;this[_0x7d51('0xa')]=_0x2bc212[_0x7d51('0xa')]||'SIP';this[_0x7d51('0xb')]=_0x2bc212['Trunk']?_0x2bc212[_0x7d51('0xb')]:undefined;this['ListId']=_0x2bc212[_0x7d51('0xc')];this[_0x7d51('0xd')]=_0x2bc212[_0x7d51('0xd')];}module[_0x7d51('0xe')]=FaxAccount;
\ No newline at end of file
+var _0x8510=['tech','SIP','Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x162d46,_0x2e0069){var _0x14c130=function(_0x10d708){while(--_0x10d708){_0x162d46['push'](_0x162d46['shift']());}};_0x14c130(++_0x2e0069);}(_0x8510,0xba));var _0x0851=function(_0x406b98,_0x3dea6d){_0x406b98=_0x406b98-0x0;var _0x10545f=_0x8510[_0x406b98];return _0x10545f;};'use strict';function FaxAccount(_0x5123bb){this['id']=_0x5123bb['id']||0x0;this['name']=_0x5123bb[_0x0851('0x0')]||'';this['description']=_0x5123bb['description'];this['ecm']=_0x5123bb[_0x0851('0x1')];this[_0x0851('0x2')]=_0x5123bb[_0x0851('0x2')];this[_0x0851('0x3')]=_0x5123bb['localstationid'];this[_0x0851('0x4')]=_0x5123bb[_0x0851('0x4')]||0x960;this['maxrate']=_0x5123bb['maxrate']||0x3840;this['modem']=_0x5123bb['modem']||_0x0851('0x5');this[_0x0851('0x6')]=_0x5123bb[_0x0851('0x6')]||'no';this[_0x0851('0x7')]=_0x5123bb[_0x0851('0x7')]||'no';this[_0x0851('0x8')]=_0x5123bb[_0x0851('0x8')]||0x1388;this['tech']=_0x5123bb[_0x0851('0x9')]||_0x0851('0xa');this[_0x0851('0xb')]=_0x5123bb[_0x0851('0xb')]?_0x5123bb[_0x0851('0xb')]:undefined;this['ListId']=_0x5123bb[_0x0851('0xc')];this['key']=_0x5123bb[_0x0851('0xd')];}module[_0x0851('0xe')]=FaxAccount;
\ No newline at end of file
index c636948..5a22ac3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce01=['apiKey','token','remoteUri','serverUrl','Configurations','username'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xce01,0xa7));var _0x1ce0=function(_0x4e3390,_0x2be21b){_0x4e3390=_0x4e3390-0x0;var _0x23c011=_0xce01[_0x4e3390];return _0x23c011;};'use strict';function FreshdeskAccount(_0x2401d8){this['id']=_0x2401d8['id']||0x0;this['name']=_0x2401d8['name']||'';this['username']=_0x2401d8[_0x1ce0('0x0')]||'';this[_0x1ce0('0x1')]=_0x2401d8[_0x1ce0('0x2')]||'';this[_0x1ce0('0x3')]=_0x2401d8[_0x1ce0('0x3')]||'';this[_0x1ce0('0x4')]=_0x2401d8[_0x1ce0('0x4')]||'';this[_0x1ce0('0x5')]=_0x2401d8[_0x1ce0('0x5')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
+var _0x86fa=['Configurations','exports','name','username','serverUrl'];(function(_0x592df2,_0x58a88b){var _0x312088=function(_0x114dc8){while(--_0x114dc8){_0x592df2['push'](_0x592df2['shift']());}};_0x312088(++_0x58a88b);}(_0x86fa,0x1ce));var _0xa86f=function(_0xee4994,_0x49567b){_0xee4994=_0xee4994-0x0;var _0x405745=_0x86fa[_0xee4994];return _0x405745;};'use strict';function FreshdeskAccount(_0x4ee3c0){this['id']=_0x4ee3c0['id']||0x0;this['name']=_0x4ee3c0[_0xa86f('0x0')]||'';this[_0xa86f('0x1')]=_0x4ee3c0[_0xa86f('0x1')]||'';this['apiKey']=_0x4ee3c0['token']||'';this['remoteUri']=_0x4ee3c0['remoteUri']||'';this[_0xa86f('0x2')]=_0x4ee3c0[_0xa86f('0x2')]||'';this['Configurations']=_0x4ee3c0[_0xa86f('0x3')]||{};}module[_0xa86f('0x4')]=FreshdeskAccount;
\ No newline at end of file
index c92a8b3..aa25df1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6208=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x6208,0x17d));var _0x8620=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0x6208[_0x3fb9dd];return _0x20136a;};'use strict';function FreshsalesAccount(_0x31cb39){this['id']=_0x31cb39['id']||0x0;this['name']=_0x31cb39[_0x8620('0x0')]||'';this[_0x8620('0x1')]=_0x31cb39['username']||'';this[_0x8620('0x2')]=_0x31cb39['token']||'';this[_0x8620('0x3')]=_0x31cb39[_0x8620('0x3')]||'';this[_0x8620('0x4')]=_0x31cb39[_0x8620('0x4')]||'';this[_0x8620('0x5')]=_0x31cb39[_0x8620('0x5')]||{};}module[_0x8620('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0xad78=['token','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x3ff235,_0x428b4d){var _0x409302=function(_0x4ef822){while(--_0x4ef822){_0x3ff235['push'](_0x3ff235['shift']());}};_0x409302(++_0x428b4d);}(_0xad78,0x149));var _0x8ad7=function(_0x2a8733,_0x2d03ff){_0x2a8733=_0x2a8733-0x0;var _0x25dc0d=_0xad78[_0x2a8733];return _0x25dc0d;};'use strict';function FreshsalesAccount(_0x21ebea){this['id']=_0x21ebea['id']||0x0;this['name']=_0x21ebea['name']||'';this[_0x8ad7('0x0')]=_0x21ebea[_0x8ad7('0x0')]||'';this['apiKey']=_0x21ebea[_0x8ad7('0x1')]||'';this[_0x8ad7('0x2')]=_0x21ebea[_0x8ad7('0x2')]||'';this[_0x8ad7('0x3')]=_0x21ebea[_0x8ad7('0x3')]||'';this[_0x8ad7('0x4')]=_0x21ebea[_0x8ad7('0x4')]||{};}module[_0x8ad7('0x5')]=FreshsalesAccount;
\ No newline at end of file
index ec639e8..aa99b7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c8f=['motionChannel','voice','variables','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','assigned','lastAssignedTo'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x2c8f,0x13b));var _0xf2c8=function(_0x18475d,_0x4a9b84){_0x18475d=_0x18475d-0x0;var _0x49fd05=_0x2c8f[_0x18475d];return _0x49fd05;};'use strict';function QueueReport(){this['type']=_0xf2c8('0x0');this['uniqueid']='';this[_0xf2c8('0x1')]='';this[_0xf2c8('0x2')]='';this[_0xf2c8('0x3')]='';this[_0xf2c8('0x4')]=null;this[_0xf2c8('0x5')]=null;this[_0xf2c8('0x6')]=0x1;this[_0xf2c8('0x7')]=0x1;this[_0xf2c8('0x8')]=![];this[_0xf2c8('0x9')]=null;this[_0xf2c8('0xa')]=![];this[_0xf2c8('0xb')]=null;this[_0xf2c8('0xc')]=![];this[_0xf2c8('0xd')]=null;this[_0xf2c8('0xe')]=0x1;this['channel']='';this[_0xf2c8('0xf')]='';this[_0xf2c8('0x10')]='';this[_0xf2c8('0x11')]='';this[_0xf2c8('0x12')]='';this['exten']='';this[_0xf2c8('0x13')]='';this[_0xf2c8('0x14')]=0x0;this[_0xf2c8('0x15')]=![];this[_0xf2c8('0x16')]='';this[_0xf2c8('0x17')]=_0xf2c8('0x18');this['mohtime']=0x0;this[_0xf2c8('0x19')]={};}module['exports']=QueueReport;
\ No newline at end of file
+var _0x73e6=['connectedlinenum','context','priority','holdtime','lastAssignedTo','motionChannel','mohtime','exports','type','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerexit','originalposition','channel'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x73e6,0x14b));var _0x673e=function(_0x48bc29,_0x4df7f1){_0x48bc29=_0x48bc29-0x0;var _0x12e31a=_0x73e6[_0x48bc29];return _0x12e31a;};'use strict';function QueueReport(){this[_0x673e('0x0')]='inbound';this[_0x673e('0x1')]='';this['calleridnum']='';this[_0x673e('0x2')]='';this[_0x673e('0x3')]='';this[_0x673e('0x4')]=null;this[_0x673e('0x5')]=null;this['position']=0x1;this[_0x673e('0x6')]=0x1;this[_0x673e('0x7')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x673e('0x8')]=![];this['queuecallerexitAt']=null;this[_0x673e('0x9')]=0x1;this[_0x673e('0xa')]='';this[_0x673e('0xb')]='';this['connectedlinename']='';this['accountcode']='';this[_0x673e('0xc')]='';this['exten']='';this[_0x673e('0xd')]='';this[_0x673e('0xe')]=0x0;this['assigned']=![];this[_0x673e('0xf')]='';this[_0x673e('0x10')]='voice';this[_0x673e('0x11')]=0x0;this['variables']={};}module[_0x673e('0x12')]=QueueReport;
\ No newline at end of file
index cd4815f..1c74ee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d4=['integrationTab','Configurations','exports','name','username','remoteUri','clientId','clientSecret','securityToken'];(function(_0x6a9981,_0x163f4e){var _0x250d45=function(_0x27cc3b){while(--_0x27cc3b){_0x6a9981['push'](_0x6a9981['shift']());}};_0x250d45(++_0x163f4e);}(_0x77d4,0x108));var _0x477d=function(_0xa09b63,_0x4a0568){_0xa09b63=_0xa09b63-0x0;var _0x4e06d7=_0x77d4[_0xa09b63];return _0x4e06d7;};'use strict';function SalesforceAccount(_0x16582f){this['id']=_0x16582f['id']||0x0;this[_0x477d('0x0')]=_0x16582f['name']||'';this[_0x477d('0x1')]=_0x16582f['username']||'';this[_0x477d('0x2')]=_0x16582f[_0x477d('0x2')]||'';this['password']=_0x16582f['password']||'';this[_0x477d('0x3')]=_0x16582f[_0x477d('0x3')]||'';this[_0x477d('0x4')]=_0x16582f[_0x477d('0x4')]||'';this[_0x477d('0x5')]=_0x16582f[_0x477d('0x5')]||'';this['type']=_0x16582f['type']||_0x477d('0x6');this['serverUrl']=_0x16582f['serverUrl']||'';this[_0x477d('0x7')]=_0x16582f[_0x477d('0x7')]||{};}module[_0x477d('0x8')]=SalesforceAccount;
\ No newline at end of file
+var _0xda34=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','clientId','clientSecret','type'];(function(_0x9915b5,_0x548b24){var _0x551f2b=function(_0x514db8){while(--_0x514db8){_0x9915b5['push'](_0x9915b5['shift']());}};_0x551f2b(++_0x548b24);}(_0xda34,0x14e));var _0x4da3=function(_0x17fdad,_0x368f25){_0x17fdad=_0x17fdad-0x0;var _0x20eb8c=_0xda34[_0x17fdad];return _0x20eb8c;};'use strict';function SalesforceAccount(_0x5d3900){this['id']=_0x5d3900['id']||0x0;this['name']=_0x5d3900[_0x4da3('0x0')]||'';this[_0x4da3('0x1')]=_0x5d3900['username']||'';this[_0x4da3('0x2')]=_0x5d3900[_0x4da3('0x2')]||'';this['password']=_0x5d3900['password']||'';this[_0x4da3('0x3')]=_0x5d3900[_0x4da3('0x3')]||'';this[_0x4da3('0x4')]=_0x5d3900['clientSecret']||'';this['securityToken']=_0x5d3900['securityToken']||'';this['type']=_0x5d3900[_0x4da3('0x5')]||_0x4da3('0x6');this[_0x4da3('0x7')]=_0x5d3900['serverUrl']||'';this[_0x4da3('0x8')]=_0x5d3900['Configurations']||{};}module[_0x4da3('0x9')]=SalesforceAccount;
\ No newline at end of file
index edd2d14..6bec997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc3f=['exports','name','username','password','remoteUri','serverUrl'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xcc3f,0xc7));var _0xfcc3=function(_0x2fdf8d,_0x4d2218){_0x2fdf8d=_0x2fdf8d-0x0;var _0xf39a8f=_0xcc3f[_0x2fdf8d];return _0xf39a8f;};'use strict';function ServicenowAccount(_0x2edf27){this['id']=_0x2edf27['id']||0x0;this[_0xfcc3('0x0')]=_0x2edf27[_0xfcc3('0x0')]||'';this[_0xfcc3('0x1')]=_0x2edf27['username']||'';this[_0xfcc3('0x2')]=_0x2edf27[_0xfcc3('0x2')]||'';this[_0xfcc3('0x3')]=_0x2edf27[_0xfcc3('0x3')]||'';this[_0xfcc3('0x4')]=_0x2edf27[_0xfcc3('0x4')]||'';this['Configurations']=_0x2edf27['Configurations']||{};}module[_0xfcc3('0x5')]=ServicenowAccount;
\ No newline at end of file
+var _0xcf12=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x1ccaff,_0x21c873){var _0x1f58c3=function(_0x3422ae){while(--_0x3422ae){_0x1ccaff['push'](_0x1ccaff['shift']());}};_0x1f58c3(++_0x21c873);}(_0xcf12,0x1d7));var _0x2cf1=function(_0x5ae0fd,_0x2cb091){_0x5ae0fd=_0x5ae0fd-0x0;var _0x4a0d6e=_0xcf12[_0x5ae0fd];return _0x4a0d6e;};'use strict';function ServicenowAccount(_0x4144b0){this['id']=_0x4144b0['id']||0x0;this[_0x2cf1('0x0')]=_0x4144b0[_0x2cf1('0x0')]||'';this['username']=_0x4144b0[_0x2cf1('0x1')]||'';this[_0x2cf1('0x2')]=_0x4144b0['password']||'';this[_0x2cf1('0x3')]=_0x4144b0[_0x2cf1('0x3')]||'';this[_0x2cf1('0x4')]=_0x4144b0[_0x2cf1('0x4')]||'';this['Configurations']=_0x4144b0[_0x2cf1('0x5')]||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
index ca552e0..5ac332c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ecf=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0x5ecf,0x1c3));var _0xf5ec=function(_0x39cd93,_0x413e05){_0x39cd93=_0x39cd93-0x0;var _0x2ff981=_0x5ecf[_0x39cd93];return _0x2ff981;};'use strict';function SugarcrmAccount(_0x4c67b9){this['id']=_0x4c67b9['id']||0x0;this[_0xf5ec('0x0')]=_0x4c67b9[_0xf5ec('0x0')]||'';this[_0xf5ec('0x1')]=_0x4c67b9[_0xf5ec('0x1')]||'';this['password']=_0x4c67b9['password']||'';this[_0xf5ec('0x2')]=_0x4c67b9[_0xf5ec('0x2')]||'';this[_0xf5ec('0x3')]=_0x4c67b9[_0xf5ec('0x3')]||'';this[_0xf5ec('0x4')]=_0x4c67b9['Configurations']||{};}module[_0xf5ec('0x5')]=SugarcrmAccount;
\ No newline at end of file
+var _0x3491=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x3e1d97,_0xe83c60){var _0x33193a=function(_0x1ceba8){while(--_0x1ceba8){_0x3e1d97['push'](_0x3e1d97['shift']());}};_0x33193a(++_0xe83c60);}(_0x3491,0x11b));var _0x1349=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3491[_0x20a584];return _0x4b41a8;};'use strict';function SugarcrmAccount(_0x14fd54){this['id']=_0x14fd54['id']||0x0;this[_0x1349('0x0')]=_0x14fd54[_0x1349('0x0')]||'';this['username']=_0x14fd54[_0x1349('0x1')]||'';this[_0x1349('0x2')]=_0x14fd54['password']||'';this[_0x1349('0x3')]=_0x14fd54[_0x1349('0x3')]||'';this[_0x1349('0x4')]=_0x14fd54[_0x1349('0x4')]||'';this['Configurations']=_0x14fd54[_0x1349('0x5')]||{};}module[_0x1349('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 348da2a..f576785 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4003=['unknown','status','address','exports','name','accountcode','state'];(function(_0x54f634,_0x4a8120){var _0x551cd8=function(_0x2af29f){while(--_0x2af29f){_0x54f634['push'](_0x54f634['shift']());}};_0x551cd8(++_0x4a8120);}(_0x4003,0x1a1));var _0x3400=function(_0x320e1f,_0x1ada5e){_0x320e1f=_0x320e1f-0x0;var _0x1c7ae2=_0x4003[_0x320e1f];return _0x1c7ae2;};'use strict';function Telephone(_0x38ae7b){this['id']=_0x38ae7b['id']||0x0;this[_0x3400('0x0')]=_0x38ae7b['name']||'';this[_0x3400('0x1')]=_0x38ae7b[_0x3400('0x1')]||'';this[_0x3400('0x2')]=_0x3400('0x3');this['stateTime']=0x0;this[_0x3400('0x4')]=_0x3400('0x3');this[_0x3400('0x5')]='';}module[_0x3400('0x6')]=Telephone;
\ No newline at end of file
+var _0xe3af=['accountcode','state','unknown','stateTime','status','address','exports','name'];(function(_0x4f91f5,_0x4b0282){var _0x3cee50=function(_0x225804){while(--_0x225804){_0x4f91f5['push'](_0x4f91f5['shift']());}};_0x3cee50(++_0x4b0282);}(_0xe3af,0x18f));var _0xfe3a=function(_0x57db3a,_0x32dc3f){_0x57db3a=_0x57db3a-0x0;var _0x18dc71=_0xe3af[_0x57db3a];return _0x18dc71;};'use strict';function Telephone(_0x3ee29d){this['id']=_0x3ee29d['id']||0x0;this[_0xfe3a('0x0')]=_0x3ee29d[_0xfe3a('0x0')]||'';this[_0xfe3a('0x1')]=_0x3ee29d['accountcode']||'';this[_0xfe3a('0x2')]=_0xfe3a('0x3');this[_0xfe3a('0x4')]=0x0;this[_0xfe3a('0x5')]=_0xfe3a('0x3');this[_0xfe3a('0x6')]='';}module[_0xfe3a('0x7')]=Telephone;
\ No newline at end of file
index 63abaff..be13b70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','html'];(function(_0x413783,_0xdeff1d){var _0x4b70ce=function(_0x4bea2e){while(--_0x4bea2e){_0x413783['push'](_0x413783['shift']());}};_0x4b70ce(++_0xdeff1d);}(_0xb10b,0x12a));var _0xbb10=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0xb10b[_0x3792e6];return _0x441e44;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x81aa40,_0x1503dc){var _0x52afbf=function(_0x233934){while(--_0x233934){_0x81aa40['push'](_0x81aa40['shift']());}};_0x52afbf(++_0x1503dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index d530ae6..924c349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x2639aa,_0x4263b8){var _0x2ef6b7=function(_0x758a4b){while(--_0x758a4b){_0x2639aa['push'](_0x2639aa['shift']());}};_0x2ef6b7(++_0x4263b8);}(_0x4fc2,0x111));var _0x24fc=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x4fc2[_0x562faf];return _0x22c1f6;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x1d3a78,_0x4805b7){var _0x44483c=function(_0x3ecb99){while(--_0x3ecb99){_0x1d3a78['push'](_0x1d3a78['shift']());}};_0x44483c(++_0x4805b7);}(_0x4fc2,0x111));var _0x24fc=function(_0x509d2e,_0x307fde){_0x509d2e=_0x509d2e-0x0;var _0x292a85=_0x4fc2[_0x509d2e];return _0x292a85;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
index 60b39ec..d5e320f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54d7=['unknown','registry','indexOf','split','host','port','stateRegistry','registrationtime','address','defaultuser','active','name','state','stateTime','status'];(function(_0x3fa378,_0x267ce3){var _0x50ffba=function(_0xa8e41b){while(--_0xa8e41b){_0x3fa378['push'](_0x3fa378['shift']());}};_0x50ffba(++_0x267ce3);}(_0x54d7,0x172));var _0x754d=function(_0x37a4dc,_0x78191a){_0x37a4dc=_0x37a4dc-0x0;var _0x33057=_0x54d7[_0x37a4dc];return _0x33057;};'use strict';function Trunk(_0x482ff0){this['id']=_0x482ff0['id']||0x0;this[_0x754d('0x0')]=_0x482ff0[_0x754d('0x0')]||![];this[_0x754d('0x1')]=_0x482ff0[_0x754d('0x1')]||'';this[_0x754d('0x2')]='unknown';this[_0x754d('0x3')]=0x0;this[_0x754d('0x4')]=_0x754d('0x5');this[_0x754d('0x6')]=_0x482ff0[_0x754d('0x6')]&&_0x482ff0['registry'][_0x754d('0x7')](':')?_0x482ff0[_0x754d('0x6')][_0x754d('0x8')](':')[0x0]:'';this[_0x754d('0x9')]='';this[_0x754d('0xa')]='';this['domain']='';this['domainport']='';this['refresh']='';this[_0x754d('0xb')]=_0x754d('0x5');this[_0x754d('0xc')]='';this[_0x754d('0xd')]='';this[_0x754d('0xe')]=_0x482ff0[_0x754d('0xe')]||'';}module['exports']=Trunk;
\ No newline at end of file
+var _0x1ea3=['split','host','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x1ea3,0x1de));var _0x31ea=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x1ea3[_0x6cf19c];return _0xce14f3;};'use strict';function Trunk(_0x7bd7fc){this['id']=_0x7bd7fc['id']||0x0;this['active']=_0x7bd7fc[_0x31ea('0x0')]||![];this[_0x31ea('0x1')]=_0x7bd7fc[_0x31ea('0x1')]||'';this[_0x31ea('0x2')]=_0x31ea('0x3');this[_0x31ea('0x4')]=0x0;this[_0x31ea('0x5')]=_0x31ea('0x3');this[_0x31ea('0x6')]=_0x7bd7fc[_0x31ea('0x6')]&&_0x7bd7fc[_0x31ea('0x6')][_0x31ea('0x7')](':')?_0x7bd7fc['registry'][_0x31ea('0x8')](':')[0x0]:'';this[_0x31ea('0x9')]='';this[_0x31ea('0xa')]='';this[_0x31ea('0xb')]='';this['domainport']='';this[_0x31ea('0xc')]='';this[_0x31ea('0xd')]=_0x31ea('0x3');this[_0x31ea('0xe')]='';this[_0x31ea('0xf')]='';this[_0x31ea('0x10')]=_0x7bd7fc[_0x31ea('0x10')]||'';}module[_0x31ea('0x11')]=Trunk;
\ No newline at end of file
index 7aeb506..7f73731 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd451=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x33e93d,_0x1a8423){var _0x19e99d=function(_0x194faa){while(--_0x194faa){_0x33e93d['push'](_0x33e93d['shift']());}};_0x19e99d(++_0x1a8423);}(_0xd451,0x1b3));var _0x1d45=function(_0x1f8ab3,_0x865b3e){_0x1f8ab3=_0x1f8ab3-0x0;var _0x5369a0=_0xd451[_0x1f8ab3];return _0x5369a0;};'use strict';function voiceExtension(_0x53d105){this['id']=_0x53d105['id']||0x0;this[_0x1d45('0x0')]=_0x53d105[_0x1d45('0x0')]||'';this[_0x1d45('0x1')]=_0x53d105[_0x1d45('0x1')]||_0x1d45('0x2');this['mandatoryDisposition']=_0x53d105[_0x1d45('0x3')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x3ad0=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x53f113,_0x2b7a8a){var _0x5b39b2=function(_0x49f506){while(--_0x49f506){_0x53f113['push'](_0x53f113['shift']());}};_0x5b39b2(++_0x2b7a8a);}(_0x3ad0,0x8c));var _0x03ad=function(_0x1da472,_0x713a16){_0x1da472=_0x1da472-0x0;var _0x12ec17=_0x3ad0[_0x1da472];return _0x12ec17;};'use strict';function voiceExtension(_0x23dd62){this['id']=_0x23dd62['id']||0x0;this['exten']=_0x23dd62[_0x03ad('0x0')]||'';this[_0x03ad('0x1')]=_0x23dd62[_0x03ad('0x1')]||_0x03ad('0x2');this[_0x03ad('0x3')]=_0x23dd62[_0x03ad('0x3')]||![];}module[_0x03ad('0x4')]=voiceExtension;
\ No newline at end of file
index 2c42a53..4f76959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8f7=['dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xf8f7,0xc3));var _0x7f8f=function(_0x1ab757,_0x47749a){_0x1ab757=_0x1ab757-0x0;var _0x5152df=_0xf8f7[_0x1ab757];return _0x5152df;};'use strict';var statusDesc=[_0x7f8f('0x0'),_0x7f8f('0x1'),_0x7f8f('0x2'),_0x7f8f('0x3'),_0x7f8f('0x4'),_0x7f8f('0x5'),_0x7f8f('0x6'),_0x7f8f('0x7'),_0x7f8f('0x8')];var monitorFormat={'wav':_0x7f8f('0x9'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0x7f8f('0xa')};function VoiceQueue(_0x5225fe){this['id']=_0x5225fe['id']||0x0;this['name']=_0x5225fe[_0x7f8f('0xb')]||'';this[_0x7f8f('0xc')]=_0x5225fe[_0x7f8f('0xc')]||'';this['type']=_0x5225fe[_0x7f8f('0xd')]||_0x7f8f('0xe');this[_0x7f8f('0xf')]=0x0;this[_0x7f8f('0x10')]=0x0;this[_0x7f8f('0x11')]=0x0;this[_0x7f8f('0x12')]=0x0;this[_0x7f8f('0x13')]=0x0;this[_0x7f8f('0x14')]=0x0;this[_0x7f8f('0x15')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0x7f8f('0x16')]=0x0;this[_0x7f8f('0x17')]=_0x5225fe[_0x7f8f('0x17')]||![];this['acwTimeout']=_0x5225fe[_0x7f8f('0x18')]||0xa;this[_0x7f8f('0x19')]=_0x5225fe[_0x7f8f('0x19')]||'no';this[_0x7f8f('0x1a')]=!![];this[_0x7f8f('0x1b')]='';this['originated']=0x0;this[_0x7f8f('0x1c')]=0x0;this['dialTimezone']=_0x5225fe[_0x7f8f('0x1d')]||null;this[_0x7f8f('0x1e')]=_0x5225fe[_0x7f8f('0x1e')]?_0x5225fe['dialGlobalInterval']:null;this[_0x7f8f('0x1f')]=_0x5225fe[_0x7f8f('0x1f')];this[_0x7f8f('0x20')]=_0x5225fe[_0x7f8f('0x20')]||_0x7f8f('0x21');this['dialLimitChannel']=_0x5225fe['dialLimitChannel']||0x0;this[_0x7f8f('0x22')]=_0x5225fe[_0x7f8f('0x22')]||0x0;this[_0x7f8f('0x23')]=_0x5225fe[_0x7f8f('0x23')]||0x1;this['dialPredictiveOptimization']=_0x5225fe[_0x7f8f('0x24')]||_0x7f8f('0x25');this[_0x7f8f('0x26')]=_0x5225fe[_0x7f8f('0x26')]||0.03;this[_0x7f8f('0x27')]=_0x5225fe[_0x7f8f('0x27')]||0x258;this[_0x7f8f('0x28')]=_0x5225fe['dialOriginateCallerIdName']||_0x7f8f('0x29');this['dialOriginateCallerIdNumber']=_0x5225fe[_0x7f8f('0x2a')]||_0x7f8f('0x29');this['dialOriginateTimeout']=_0x5225fe[_0x7f8f('0x2b')]||0x1e;this[_0x7f8f('0x2c')]=_0x5225fe['dialQueueOptions']||_0x7f8f('0x2d');this[_0x7f8f('0x2e')]=_0x5225fe[_0x7f8f('0x2e')]||0x3;this[_0x7f8f('0x2f')]=_0x5225fe[_0x7f8f('0x2f')]||undefined;this['dialCongestionMaxRetry']=_0x5225fe[_0x7f8f('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x5225fe[_0x7f8f('0x31')]||0x96;this[_0x7f8f('0x32')]=_0x5225fe[_0x7f8f('0x32')]||0x3;this['dialBusyRetryFrequency']=_0x5225fe[_0x7f8f('0x33')]||0x96;this[_0x7f8f('0x34')]=_0x5225fe[_0x7f8f('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5225fe[_0x7f8f('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x5225fe[_0x7f8f('0x36')]||0x3;this[_0x7f8f('0x37')]=_0x5225fe[_0x7f8f('0x37')]||0x96;this[_0x7f8f('0x38')]=_0x5225fe[_0x7f8f('0x38')]||0x3;this[_0x7f8f('0x39')]=_0x5225fe['dialDropRetryFrequency']||0x96;this[_0x7f8f('0x3a')]=_0x5225fe[_0x7f8f('0x3a')]||0x3;this[_0x7f8f('0x3b')]=_0x5225fe[_0x7f8f('0x3b')]||0x96;this[_0x7f8f('0x3c')]=_0x5225fe[_0x7f8f('0x3c')]||0x3;this[_0x7f8f('0x3d')]=_0x5225fe[_0x7f8f('0x3d')]||0x96;this[_0x7f8f('0x3e')]=_0x5225fe['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x5225fe['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x5225fe[_0x7f8f('0x3f')]||0x4;this[_0x7f8f('0x40')]=_0x5225fe[_0x7f8f('0x40')]?_0x5225fe[_0x7f8f('0x40')]:undefined;this[_0x7f8f('0x41')]=_0x5225fe['TrunkBackup']?_0x5225fe['TrunkBackup']:undefined;this[_0x7f8f('0x42')]=_0x5225fe[_0x7f8f('0x42')]||undefined;this[_0x7f8f('0x43')]=_0x5225fe[_0x7f8f('0x43')]?_0x5225fe['Interval']:undefined;this[_0x7f8f('0x44')]=_0x5225fe['dialOrderByScheduledAt']||_0x7f8f('0x45');this[_0x7f8f('0x46')]=_0x5225fe['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x7f8f('0x47')]=_0x5225fe[_0x7f8f('0x47')]||undefined;this[_0x7f8f('0x48')]=strategy[_0x5225fe[_0x7f8f('0x48')]]||_0x7f8f('0x49');this[_0x7f8f('0x4a')]=!![];this[_0x7f8f('0x4b')]=_0x5225fe[_0x7f8f('0x4b')]||![];this[_0x7f8f('0x4c')]=_0x5225fe['dialAMDInitialSilence'];this[_0x7f8f('0x4d')]=_0x5225fe['dialAMDGreeting'];this[_0x7f8f('0x4e')]=_0x5225fe[_0x7f8f('0x4e')];this[_0x7f8f('0x4f')]=_0x5225fe[_0x7f8f('0x4f')];this[_0x7f8f('0x50')]=_0x5225fe[_0x7f8f('0x50')];this[_0x7f8f('0x51')]=_0x5225fe[_0x7f8f('0x51')];this[_0x7f8f('0x52')]=_0x5225fe[_0x7f8f('0x52')];this[_0x7f8f('0x53')]=_0x5225fe['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x5225fe[_0x7f8f('0x54')];this['outboundRejectCallsDay']=0x0;this[_0x7f8f('0x55')]=0x0;this[_0x7f8f('0x56')]=_0x5225fe[_0x7f8f('0x56')];this[_0x7f8f('0x57')]=0x0;this[_0x7f8f('0x58')]=0x0;this[_0x7f8f('0x59')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x7f8f('0x5a')]=0x0;this[_0x7f8f('0x5b')]=0x0;this[_0x7f8f('0x5c')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x7f8f('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x7f8f('0x5e')]=0x0;this[_0x7f8f('0x5f')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x7f8f('0x60')]=undefined;this[_0x7f8f('0x61')]=undefined;this[_0x7f8f('0x62')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x7f8f('0x63')]=0x0;this[_0x7f8f('0x64')]=0x0;this[_0x7f8f('0x65')]=0x0;this[_0x7f8f('0x66')]=0x0;this[_0x7f8f('0x67')]=0x0;this[_0x7f8f('0x68')]=0x0;this['predictiveIntervalMaxThreshold']=_0x5225fe['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x7f8f('0x69')]=_0x5225fe['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x7f8f('0x6a')]=0x0;this[_0x7f8f('0x6b')]=0x0;this[_0x7f8f('0x6c')]=0x1;this[_0x7f8f('0x6d')]=0x0;this[_0x7f8f('0x6e')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x5225fe[_0x7f8f('0x6f')]||0x1e;this[_0x7f8f('0x70')]=_0x5225fe[_0x7f8f('0x70')]||![];this[_0x7f8f('0x71')]=!!_0x5225fe[_0x7f8f('0x71')]||![];this['dialPreviewRecallmeReminder']=!!_0x5225fe['dialPreviewRecallmeReminder']||![];this[_0x7f8f('0x72')]=_0x5225fe['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x5225fe[_0x7f8f('0x73')]||![];this[_0x7f8f('0x74')]=_0x5225fe[_0x7f8f('0x74')]||![];this[_0x7f8f('0xc')]=monitorFormat[_0x5225fe['monitor_format']]?monitorFormat[_0x5225fe[_0x7f8f('0xc')]]:undefined;this['mandatoryDisposition']=_0x5225fe['mandatoryDisposition']||![];this[_0x7f8f('0x75')]=_0x5225fe['mandatoryDispositionPause']?_0x5225fe[_0x7f8f('0x75')]:undefined;}module[_0x7f8f('0x76')]=VoiceQueue;
\ No newline at end of file
+var _0x27f0=['dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','busy','unavailable','ringing','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','answered','sumDuration','sumHoldTime','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup'];(function(_0x16d8cb,_0x2b2b47){var _0x104aa3=function(_0xe2a47){while(--_0xe2a47){_0x16d8cb['push'](_0x16d8cb['shift']());}};_0x104aa3(++_0x2b2b47);}(_0x27f0,0x129));var _0x027f=function(_0x32116e,_0x260702){_0x32116e=_0x32116e-0x0;var _0x2f42e0=_0x27f0[_0x32116e];return _0x2f42e0;};'use strict';var statusDesc=[_0x027f('0x0'),_0x027f('0x1'),'inuse',_0x027f('0x2'),'invalid',_0x027f('0x3'),_0x027f('0x4'),'ringinuse','onhold'];var monitorFormat={'wav':_0x027f('0x5'),'wav49':_0x027f('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x027f('0x7'),'roundrobin':_0x027f('0x8')};function VoiceQueue(_0x359250){this['id']=_0x359250['id']||0x0;this[_0x027f('0x9')]=_0x359250[_0x027f('0x9')]||'';this[_0x027f('0xa')]=_0x359250[_0x027f('0xa')]||'';this[_0x027f('0xb')]=_0x359250[_0x027f('0xb')]||'inbound';this[_0x027f('0xc')]=0x0;this[_0x027f('0xd')]=0x0;this['total']=0x0;this[_0x027f('0xe')]=0x0;this[_0x027f('0xf')]=0x0;this[_0x027f('0x10')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x027f('0x11')]=0x0;this[_0x027f('0x12')]=0x0;this[_0x027f('0x13')]=0x0;this[_0x027f('0x14')]=_0x359250['acw']||![];this[_0x027f('0x15')]=_0x359250[_0x027f('0x15')]||0xa;this[_0x027f('0x16')]=_0x359250[_0x027f('0x16')]||'no';this[_0x027f('0x17')]=!![];this[_0x027f('0x18')]='';this[_0x027f('0x19')]=0x0;this[_0x027f('0x1a')]=0x0;this[_0x027f('0x1b')]=_0x359250[_0x027f('0x1b')]||null;this['dialGlobalInterval']=_0x359250['dialGlobalInterval']?_0x359250[_0x027f('0x1c')]:null;this['dialActive']=_0x359250[_0x027f('0x1d')];this[_0x027f('0x1e')]=_0x359250[_0x027f('0x1e')]||_0x027f('0x1f');this[_0x027f('0x20')]=_0x359250['dialLimitChannel']||0x0;this[_0x027f('0x21')]=_0x359250[_0x027f('0x21')]||0x0;this[_0x027f('0x22')]=_0x359250[_0x027f('0x22')]||0x1;this['dialPredictiveOptimization']=_0x359250[_0x027f('0x23')]||_0x027f('0x24');this[_0x027f('0x25')]=_0x359250['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x359250['dialPredictiveInterval']||0x258;this[_0x027f('0x26')]=_0x359250[_0x027f('0x26')]||'anonymous';this[_0x027f('0x27')]=_0x359250['dialOriginateCallerIdNumber']||'anonymous';this[_0x027f('0x28')]=_0x359250[_0x027f('0x28')]||0x1e;this[_0x027f('0x29')]=_0x359250[_0x027f('0x29')]||'tTxX';this['dialQueueTimeout']=_0x359250[_0x027f('0x2a')]||0x3;this['dialQueueProject']=_0x359250[_0x027f('0x2b')]||undefined;this[_0x027f('0x2c')]=_0x359250[_0x027f('0x2c')]||0x3;this[_0x027f('0x2d')]=_0x359250[_0x027f('0x2d')]||0x96;this[_0x027f('0x2e')]=_0x359250[_0x027f('0x2e')]||0x3;this[_0x027f('0x2f')]=_0x359250[_0x027f('0x2f')]||0x96;this[_0x027f('0x30')]=_0x359250[_0x027f('0x30')]||0x3;this[_0x027f('0x31')]=_0x359250[_0x027f('0x31')]||0x96;this[_0x027f('0x32')]=_0x359250['dialNoSuchNumberMaxRetry']||0x3;this[_0x027f('0x33')]=_0x359250[_0x027f('0x33')]||0x96;this[_0x027f('0x34')]=_0x359250['dialDropMaxRetry']||0x3;this[_0x027f('0x35')]=_0x359250[_0x027f('0x35')]||0x96;this['dialAbandonedMaxRetry']=_0x359250[_0x027f('0x36')]||0x3;this[_0x027f('0x37')]=_0x359250[_0x027f('0x37')]||0x96;this[_0x027f('0x38')]=_0x359250[_0x027f('0x38')]||0x3;this['dialMachineRetryFrequency']=_0x359250[_0x027f('0x39')]||0x96;this[_0x027f('0x3a')]=_0x359250['dialAgentRejectMaxRetry']||0x3;this[_0x027f('0x3b')]=_0x359250['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x359250[_0x027f('0x3c')]||0x4;this[_0x027f('0x3d')]=_0x359250[_0x027f('0x3d')]?_0x359250[_0x027f('0x3d')]:undefined;this[_0x027f('0x3e')]=_0x359250[_0x027f('0x3e')]?_0x359250[_0x027f('0x3e')]:undefined;this['dialPrefix']=_0x359250[_0x027f('0x3f')]||undefined;this[_0x027f('0x40')]=_0x359250[_0x027f('0x40')]?_0x359250[_0x027f('0x40')]:undefined;this['dialOrderByScheduledAt']=_0x359250[_0x027f('0x41')]||_0x027f('0x42');this[_0x027f('0x43')]=_0x359250[_0x027f('0x43')]||undefined;this[_0x027f('0x44')]=_0x359250['dialCutDigit']||undefined;this[_0x027f('0x45')]=strategy[_0x359250[_0x027f('0x45')]]||_0x027f('0x7');this[_0x027f('0x46')]=!![];this[_0x027f('0x47')]=_0x359250[_0x027f('0x47')]||![];this[_0x027f('0x48')]=_0x359250[_0x027f('0x48')];this[_0x027f('0x49')]=_0x359250[_0x027f('0x49')];this['dialAMDAfterGreetingSilence']=_0x359250[_0x027f('0x4a')];this[_0x027f('0x4b')]=_0x359250[_0x027f('0x4b')];this[_0x027f('0x4c')]=_0x359250[_0x027f('0x4c')];this[_0x027f('0x4d')]=_0x359250['dialAMDBetweenWordsSilence'];this[_0x027f('0x4e')]=_0x359250[_0x027f('0x4e')];this[_0x027f('0x4f')]=_0x359250[_0x027f('0x4f')];this['dialAMDMaximumWordLength']=_0x359250['dialAMDMaximumWordLength'];this[_0x027f('0x50')]=0x0;this['pTalking']=0x0;this[_0x027f('0x51')]=_0x359250[_0x027f('0x51')];this[_0x027f('0x52')]=0x0;this[_0x027f('0x53')]=0x0;this[_0x027f('0x54')]=0x0;this[_0x027f('0x55')]=0x0;this[_0x027f('0x56')]=0x0;this[_0x027f('0x57')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x027f('0x58')]=0x0;this[_0x027f('0x59')]=0x0;this[_0x027f('0x5a')]=0x0;this[_0x027f('0x5b')]=0x0;this[_0x027f('0x5c')]=0x0;this[_0x027f('0x5d')]=0x0;this[_0x027f('0x5e')]=0x0;this[_0x027f('0x5f')]=undefined;this[_0x027f('0x60')]=undefined;this[_0x027f('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x027f('0x62')]=0x0;this[_0x027f('0x63')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x027f('0x64')]=0x0;this[_0x027f('0x65')]=0x0;this[_0x027f('0x66')]=0x0;this[_0x027f('0x67')]=0x0;this[_0x027f('0x68')]=_0x359250[_0x027f('0x69')]||0x14;this['predictiveIntervalMinThreshold']=_0x359250[_0x027f('0x69')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x027f('0x6a')]=0x0;this[_0x027f('0x6b')]=0x1;this[_0x027f('0x6c')]=0x0;this[_0x027f('0x6d')]=0x0;this[_0x027f('0x6e')]=0x0;this['erlangBusyFactor']=0x0;this[_0x027f('0x6f')]=_0x359250[_0x027f('0x6f')]||0x1e;this[_0x027f('0x70')]=_0x359250[_0x027f('0x70')]||![];this[_0x027f('0x71')]=!!_0x359250['dialPreviewAutoRecallMe']||![];this[_0x027f('0x72')]=!!_0x359250[_0x027f('0x72')]||![];this[_0x027f('0x73')]=_0x359250[_0x027f('0x73')]||undefined;this['dialAgiAfterHangupClient']=_0x359250[_0x027f('0x74')]||![];this[_0x027f('0x75')]=_0x359250[_0x027f('0x75')]||![];this[_0x027f('0xa')]=monitorFormat[_0x359250['monitor_format']]?monitorFormat[_0x359250[_0x027f('0xa')]]:undefined;this[_0x027f('0x76')]=_0x359250[_0x027f('0x76')]||![];this[_0x027f('0x77')]=_0x359250[_0x027f('0x77')]?_0x359250[_0x027f('0x77')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
index 7c89d9a..8f9c417 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a78=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x436974,_0x78d896){var _0x2fbfc8=function(_0x35567a){while(--_0x35567a){_0x436974['push'](_0x436974['shift']());}};_0x2fbfc8(++_0x78d896);}(_0x9a78,0x1b6));var _0x89a7=function(_0x3319f0,_0x423ba6){_0x3319f0=_0x3319f0-0x0;var _0x53d755=_0x9a78[_0x3319f0];return _0x53d755;};'use strict';function VtigerAccount(_0xd53074){this['id']=_0xd53074['id']||0x0;this[_0x89a7('0x0')]=_0xd53074[_0x89a7('0x0')]||'';this[_0x89a7('0x1')]=_0xd53074[_0x89a7('0x1')]||'';this[_0x89a7('0x2')]=_0xd53074[_0x89a7('0x2')]||'';this[_0x89a7('0x3')]=_0xd53074[_0x89a7('0x3')]||'';this[_0x89a7('0x4')]=_0xd53074[_0x89a7('0x4')]||'';this[_0x89a7('0x5')]=_0xd53074[_0x89a7('0x5')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0xfa12=['name','accessKey','serverUrl','Configurations','exports'];(function(_0x41acda,_0x4f7fe7){var _0x3def7c=function(_0x4cde3e){while(--_0x4cde3e){_0x41acda['push'](_0x41acda['shift']());}};_0x3def7c(++_0x4f7fe7);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x15cbd5,_0x279193){_0x15cbd5=_0x15cbd5-0x0;var _0x529e77=_0xfa12[_0x15cbd5];return _0x529e77;};'use strict';function VtigerAccount(_0x4c64d3){this['id']=_0x4c64d3['id']||0x0;this[_0x2fa1('0x0')]=_0x4c64d3[_0x2fa1('0x0')]||'';this['username']=_0x4c64d3['username']||'';this[_0x2fa1('0x1')]=_0x4c64d3[_0x2fa1('0x1')]||'';this['remoteUri']=_0x4c64d3['remoteUri']||'';this[_0x2fa1('0x2')]=_0x4c64d3[_0x2fa1('0x2')]||'';this[_0x2fa1('0x3')]=_0x4c64d3['Configurations']||{};}module[_0x2fa1('0x4')]=VtigerAccount;
\ No newline at end of file
index 9fb6758..f102f4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd10c=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','Configurations'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xd10c,0x65));var _0xcd10=function(_0x4df639,_0x102a95){_0x4df639=_0x4df639-0x0;var _0xe30400=_0xd10c[_0x4df639];return _0xe30400;};'use strict';function ZendeskAccount(_0x4543a7){this['id']=_0x4543a7['id']||0x0;this[_0xcd10('0x0')]=_0x4543a7['name']||'';this[_0xcd10('0x1')]=_0x4543a7[_0xcd10('0x1')]||'';this[_0xcd10('0x2')]=_0x4543a7[_0xcd10('0x2')]||'';this[_0xcd10('0x3')]=_0x4543a7[_0xcd10('0x3')]||'';this['remoteUri']=_0x4543a7[_0xcd10('0x4')]||'';this[_0xcd10('0x5')]=_0x4543a7[_0xcd10('0x5')]||'';this[_0xcd10('0x6')]=_0x4543a7['type']||_0xcd10('0x7');this['serverUrl']=_0x4543a7['serverUrl']||'';this[_0xcd10('0x8')]=_0x4543a7[_0xcd10('0x8')]||{};}module[_0xcd10('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0xd6b7=['password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xd6b7,0x77));var _0x7d6b=function(_0x34424a,_0x5d07d5){_0x34424a=_0x34424a-0x0;var _0x5a1b87=_0xd6b7[_0x34424a];return _0x5a1b87;};'use strict';function ZendeskAccount(_0x3a08f0){this['id']=_0x3a08f0['id']||0x0;this[_0x7d6b('0x0')]=_0x3a08f0[_0x7d6b('0x0')]||'';this[_0x7d6b('0x1')]=_0x3a08f0['username']||'';this['password']=_0x3a08f0[_0x7d6b('0x2')]||'';this['token']=_0x3a08f0[_0x7d6b('0x3')]||'';this[_0x7d6b('0x4')]=_0x3a08f0[_0x7d6b('0x4')]||'';this[_0x7d6b('0x5')]=_0x3a08f0['authType']||'';this[_0x7d6b('0x6')]=_0x3a08f0['type']||_0x7d6b('0x7');this[_0x7d6b('0x8')]=_0x3a08f0['serverUrl']||'';this['Configurations']=_0x3a08f0[_0x7d6b('0x9')]||{};}module[_0x7d6b('0xa')]=ZendeskAccount;
\ No newline at end of file
index ce64e4c..6f8e210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6edd=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x288153,_0x189204){var _0x3f99f6=function(_0x46a433){while(--_0x46a433){_0x288153['push'](_0x288153['shift']());}};_0x3f99f6(++_0x189204);}(_0x6edd,0x1c2));var _0xd6ed=function(_0xacbc65,_0x3f26d6){_0xacbc65=_0xacbc65-0x0;var _0x389536=_0x6edd[_0xacbc65];return _0x389536;};'use strict';function ZohoAccount(_0x8388d4){this['id']=_0x8388d4['id']||0x0;this['name']=_0x8388d4[_0xd6ed('0x0')]||'';this[_0xd6ed('0x1')]=_0x8388d4[_0xd6ed('0x1')]||'';this[_0xd6ed('0x2')]=_0x8388d4[_0xd6ed('0x2')]||'';this['zone']=_0x8388d4[_0xd6ed('0x3')]||'';this[_0xd6ed('0x4')]=_0x8388d4[_0xd6ed('0x4')]||'';this[_0xd6ed('0x5')]=_0x8388d4[_0xd6ed('0x5')]||'';this[_0xd6ed('0x6')]=_0x8388d4[_0xd6ed('0x6')]||'';this[_0xd6ed('0x7')]=_0x8388d4[_0xd6ed('0x7')]||'';this[_0xd6ed('0x8')]=_0x8388d4['refreshToken']||'';this[_0xd6ed('0x9')]=_0x8388d4[_0xd6ed('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0x0aea=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x5c7883,_0x2d0e2e){var _0x2e4777=function(_0x86e0cc){while(--_0x86e0cc){_0x5c7883['push'](_0x5c7883['shift']());}};_0x2e4777(++_0x2d0e2e);}(_0x0aea,0x1ad));var _0xa0ae=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x0aea[_0x247fa1];return _0x244f35;};'use strict';function ZohoAccount(_0x1f0ec8){this['id']=_0x1f0ec8['id']||0x0;this['name']=_0x1f0ec8[_0xa0ae('0x0')]||'';this[_0xa0ae('0x1')]=_0x1f0ec8[_0xa0ae('0x1')]||'';this[_0xa0ae('0x2')]=_0x1f0ec8[_0xa0ae('0x2')]||'';this[_0xa0ae('0x3')]=_0x1f0ec8[_0xa0ae('0x3')]||'';this[_0xa0ae('0x4')]=_0x1f0ec8['clientId']||'';this[_0xa0ae('0x5')]=_0x1f0ec8['clientSecret']||'';this[_0xa0ae('0x6')]=_0x1f0ec8[_0xa0ae('0x6')]||'';this[_0xa0ae('0x7')]=_0x1f0ec8['code']||'';this[_0xa0ae('0x8')]=_0x1f0ec8[_0xa0ae('0x8')]||'';this[_0xa0ae('0x9')]=_0x1f0ec8[_0xa0ae('0x9')]||{};}module[_0xa0ae('0xa')]=ZohoAccount;
\ No newline at end of file
index 48f23ab..b14b7b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d02=['active','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','format','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','Agent','channelAgent','membername','SIP/%s','calleridname','phone','Contact','firstName'];(function(_0x298ca8,_0x58794c){var _0x5bc271=function(_0x91b8a1){while(--_0x91b8a1){_0x298ca8['push'](_0x298ca8['shift']());}};_0x5bc271(++_0x58794c);}(_0x1d02,0x113));var _0x21d0=function(_0x49a464,_0x526721){_0x49a464=_0x49a464-0x0;var _0x5a46dc=_0x1d02[_0x49a464];return _0x5a46dc;};'use strict';var util=require('util');var _=require(_0x21d0('0x0'));var moment=require(_0x21d0('0x1'));function checkNameSurname(_0x41ff83,_0x1e3b01,_0x35ced2){var _0x565f4c='';if(!_[_0x21d0('0x2')](_0x1e3b01)&&_0x21d0('0x3')===typeof _0x1e3b01){_0x565f4c+=_0x1e3b01;}if(!_[_0x21d0('0x2')](_0x35ced2)&&_0x21d0('0x3')===typeof _0x35ced2){_0x565f4c+='\x20'+_0x35ced2;}if(_0x565f4c!==''){return _0x565f4c;}return _0x41ff83;}function Action(_0x17b8c0,_0x51eb47,_0x18cb28,_0x1b29e0,_0x310a32){this[_0x21d0('0x4')]=_0x18cb28||undefined;this[_0x21d0('0x5')]=_0x17b8c0['id'];this['queue']=_0x51eb47[_0x21d0('0x6')];this['type']=_0x51eb47[_0x21d0('0x7')];this[_0x21d0('0x8')]=_0x21d0('0x9');this[_0x21d0('0xa')]=![];this['membername']=_[_0x21d0('0x2')](_0x17b8c0[_0x21d0('0xb')])?undefined:_0x17b8c0[_0x21d0('0xb')][_0x21d0('0x6')];this[_0x21d0('0xc')]=this[_0x21d0('0xd')]?util['format'](_0x21d0('0xe'),this['membername']):_0x1b29e0||undefined;this[_0x21d0('0xf')]=checkNameSurname(_0x17b8c0['Contact'][_0x21d0('0x10')],_0x17b8c0[_0x21d0('0x11')][_0x21d0('0x12')],_0x17b8c0[_0x21d0('0x11')]['lastName']);this[_0x21d0('0x13')]=_0x17b8c0['active']||![];this['calleridnum']=_0x17b8c0['Contact']['phone'];this['scheduledat']=_0x17b8c0['scheduledat'];this[_0x21d0('0x14')]=_0x17b8c0[_0x21d0('0x14')]||0x0;this[_0x21d0('0x15')]=_0x17b8c0['countcongestionretry']||0x0;this[_0x21d0('0x16')]=_0x17b8c0['countnoanswerretry']||0x0;this[_0x21d0('0x17')]=(_0x17b8c0['countbusyretry']||0x0)+(_0x17b8c0['countcongestionretry']||0x0)+(_0x17b8c0[_0x21d0('0x16')]||0x0)+(_0x17b8c0[_0x21d0('0x18')]||0x0)+(_0x17b8c0['countdropretry']||0x0)+(_0x17b8c0[_0x21d0('0x19')]||0x0)+(_0x17b8c0['countmachineretry']||0x0)+(_0x17b8c0[_0x21d0('0x1a')]||0x0);this[_0x21d0('0x18')]=_0x17b8c0[_0x21d0('0x18')]||0x0;this[_0x21d0('0x1b')]=_0x17b8c0[_0x21d0('0x1b')]||0x0;this[_0x21d0('0x19')]=_0x17b8c0['countabandonedretry']||0x0;this[_0x21d0('0x1c')]=_0x17b8c0['countmachineretry']||0x0;this[_0x21d0('0x1a')]=_0x17b8c0[_0x21d0('0x1a')]||0x0;this[_0x21d0('0x1d')]=_0x17b8c0['callback'];this[_0x21d0('0x1e')]=_0x17b8c0[_0x21d0('0x1e')];this['callbackat']=_0x17b8c0[_0x21d0('0x1f')];this[_0x21d0('0x20')]=_0x17b8c0[_0x21d0('0x20')];this['ContactId']=_0x17b8c0[_0x21d0('0x21')];this[_0x21d0('0x22')]=_0x17b8c0[_0x21d0('0x22')];this[_0x21d0('0x23')]=_[_0x21d0('0x2')](_0x17b8c0[_0x21d0('0xb')])?_0x17b8c0[_0x21d0('0x23')]:_0x17b8c0[_0x21d0('0xb')]['id'];this['VoiceQueueId']=_0x17b8c0[_0x21d0('0x24')];this['originatecalleridnum']='';this[_0x21d0('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0x21d0('0x26')](_0x21d0('0x27'),this[_0x21d0('0xf')],this[_0x21d0('0x28')]);};module[_0x21d0('0x29')]=Action;
\ No newline at end of file
+var _0x8bd5=['exports','lodash','string','isNil','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','format','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number'];(function(_0x3a71b6,_0x47066e){var _0x553635=function(_0x1ad76f){while(--_0x1ad76f){_0x3a71b6['push'](_0x3a71b6['shift']());}};_0x553635(++_0x47066e);}(_0x8bd5,0x135));var _0x58bd=function(_0x30ce61,_0x4e0527){_0x30ce61=_0x30ce61-0x0;var _0x4a3be2=_0x8bd5[_0x30ce61];return _0x4a3be2;};'use strict';var util=require('util');var _=require(_0x58bd('0x0'));var moment=require('moment');function checkNameSurname(_0x557943,_0x335995,_0x51d466){var _0x3aae9f='';if(!_['isNil'](_0x335995)&&_0x58bd('0x1')===typeof _0x335995){_0x3aae9f+=_0x335995;}if(!_[_0x58bd('0x2')](_0x51d466)&&_0x58bd('0x1')===typeof _0x51d466){_0x3aae9f+='\x20'+_0x51d466;}if(_0x3aae9f!==''){return _0x3aae9f;}return _0x557943;}function Action(_0x94624a,_0x216653,_0x2376f3,_0x4befb,_0x5f08a1){this[_0x58bd('0x3')]=_0x2376f3||undefined;this[_0x58bd('0x4')]=_0x94624a['id'];this['queue']=_0x216653[_0x58bd('0x5')];this['type']=_0x216653[_0x58bd('0x6')];this[_0x58bd('0x7')]=_0x58bd('0x8');this[_0x58bd('0x9')]=![];this[_0x58bd('0xa')]=_[_0x58bd('0x2')](_0x94624a[_0x58bd('0xb')])?undefined:_0x94624a['Agent'][_0x58bd('0x5')];this['channelAgent']=this[_0x58bd('0xa')]?util[_0x58bd('0xc')]('SIP/%s',this['membername']):_0x4befb||undefined;this['calleridname']=checkNameSurname(_0x94624a[_0x58bd('0xd')][_0x58bd('0xe')],_0x94624a[_0x58bd('0xd')]['firstName'],_0x94624a[_0x58bd('0xd')][_0x58bd('0xf')]);this[_0x58bd('0x10')]=_0x94624a[_0x58bd('0x10')]||![];this[_0x58bd('0x11')]=_0x94624a['Contact'][_0x58bd('0xe')];this[_0x58bd('0x12')]=_0x94624a['scheduledat'];this[_0x58bd('0x13')]=_0x94624a[_0x58bd('0x13')]||0x0;this[_0x58bd('0x14')]=_0x94624a[_0x58bd('0x14')]||0x0;this[_0x58bd('0x15')]=_0x94624a['countnoanswerretry']||0x0;this[_0x58bd('0x16')]=(_0x94624a[_0x58bd('0x13')]||0x0)+(_0x94624a[_0x58bd('0x14')]||0x0)+(_0x94624a[_0x58bd('0x15')]||0x0)+(_0x94624a[_0x58bd('0x17')]||0x0)+(_0x94624a[_0x58bd('0x18')]||0x0)+(_0x94624a[_0x58bd('0x19')]||0x0)+(_0x94624a['countmachineretry']||0x0)+(_0x94624a[_0x58bd('0x1a')]||0x0);this[_0x58bd('0x17')]=_0x94624a[_0x58bd('0x17')]||0x0;this['countdropretry']=_0x94624a[_0x58bd('0x18')]||0x0;this[_0x58bd('0x19')]=_0x94624a[_0x58bd('0x19')]||0x0;this[_0x58bd('0x1b')]=_0x94624a[_0x58bd('0x1b')]||0x0;this[_0x58bd('0x1a')]=_0x94624a[_0x58bd('0x1a')]||0x0;this[_0x58bd('0x1c')]=_0x94624a[_0x58bd('0x1c')];this['callbackuniqueid']=_0x94624a[_0x58bd('0x1d')];this[_0x58bd('0x1e')]=_0x94624a['callbackat'];this['recallme']=_0x94624a[_0x58bd('0x1f')];this[_0x58bd('0x20')]=_0x94624a[_0x58bd('0x20')];this[_0x58bd('0x21')]=_0x94624a[_0x58bd('0x21')];this['UserId']=_[_0x58bd('0x2')](_0x94624a[_0x58bd('0xb')])?_0x94624a[_0x58bd('0x22')]:_0x94624a['Agent']['id'];this[_0x58bd('0x23')]=_0x94624a['VoiceQueueId'];this[_0x58bd('0x24')]='';this[_0x58bd('0x25')]='';}Action[_0x58bd('0x26')][_0x58bd('0x27')]=function(){return util[_0x58bd('0xc')](_0x58bd('0x28'),this[_0x58bd('0x29')],this[_0x58bd('0x2a')]);};module[_0x58bd('0x2b')]=Action;
\ No newline at end of file
index 3e344e2..4619737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','info','BUSY','countbusyretry','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countcongestionretry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','substring','dialCutDigit','phone','dialPrefix','trim','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','isFailure','idContact','disableContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./action','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hanguprequest','syncHangupRequest','bind','dialend','syncDialEnd','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','stringify','format','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','syncCampaigns','hasOwnProperty','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','sendMessageOneNotActive','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid'];(function(_0x130b74,_0x27cb88){var _0x5d86fd=function(_0x482977){while(--_0x482977){_0x130b74['push'](_0x130b74['shift']());}};_0x5d86fd(++_0x27cb88);}(_0x5fc3,0xa8));var _0x35fc=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x5fc3[_0x506d83];return _0x335e8b;};'use strict';var util=require(_0x35fc('0x0'));var _=require(_0x35fc('0x1'));var BPromise=require('bluebird');var uuid=require(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var md5=require(_0x35fc('0x4'));var Redis=require(_0x35fc('0x5'));var config=require(_0x35fc('0x6'));var logger=require('../../../config/logger')(_0x35fc('0x7'));var loggerAction=require(_0x35fc('0x8'))(_0x35fc('0x9'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0x35fc('0xa'));var ut=require('./util/util');config[_0x35fc('0xb')]=_[_0x35fc('0xc')](config[_0x35fc('0xb')],{'host':_0x35fc('0xd'),'port':0x18eb});var io=require(_0x35fc('0xe'))(new Redis(config[_0x35fc('0xb')]));var Sequence=function(){};Sequence[_0x35fc('0xf')]['enqueue']=function(_0x1083a9){this[_0x35fc('0x10')]=this['tail']?this[_0x35fc('0x10')][_0x35fc('0x11')](_0x1083a9):_0x1083a9();};function Preview(_0x5021d4){this[_0x35fc('0x12')]=new Sequence();this[_0x35fc('0x13')]=_0x5021d4['voiceQueues'];this['trunks']=_0x5021d4[_0x35fc('0x14')];this['actions']={};this[_0x35fc('0x15')]=_0x5021d4[_0x35fc('0x15')];this[_0x35fc('0x16')]=0x0;ami['on'](_0x35fc('0x17'),this[_0x35fc('0x18')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x35fc('0x19'),this[_0x35fc('0x1a')][_0x35fc('0x1b')](this));ami['on'](_0x35fc('0x1c'),this[_0x35fc('0x1d')][_0x35fc('0x1b')](this));ami['on']('newexten',this[_0x35fc('0x1e')][_0x35fc('0x1b')](this));ami['on']('varset',this[_0x35fc('0x1f')][_0x35fc('0x1b')](this));ami['on'](_0x35fc('0x20'),this['syncAttendedTransfer'][_0x35fc('0x1b')](this));ami['on'](_0x35fc('0x21'),this[_0x35fc('0x22')]['bind'](this));this[_0x35fc('0x23')](this[_0x35fc('0x13')]);}function emit(_0x3229d1,_0x251a1f,_0x20ffde){io['to'](_0x3229d1)[_0x35fc('0x24')](_0x251a1f,_0x20ffde);}function emitCampaignPreview(_0x155016){if(_0x155016[_0x35fc('0x25')]===_0x35fc('0x26')){var _0x427eae={'id':_0x155016['id'],'name':_0x155016['name'],'strategy':_0x155016[_0x35fc('0x27')],'answered':_0x155016[_0x35fc('0x28')],'available':_0x155016[_0x35fc('0x29')],'loggedIn':_0x155016[_0x35fc('0x2a')],'pTalking':_0x155016[_0x35fc('0x2b')],'sumBillable':_0x155016['sumBillable'],'sumDuration':_0x155016[_0x35fc('0x2c')],'sumHoldTime':_0x155016[_0x35fc('0x2d')]||0x0,'talking':_0x155016['talking'],'total':_0x155016[_0x35fc('0x2e')],'type':_0x155016[_0x35fc('0x25')],'unmanaged':_0x155016[_0x35fc('0x2f')],'abandoned':_0x155016['abandoned'],'waiting':_0x155016[_0x35fc('0x30')],'loggedInDb':_0x155016['loggedInDb'],'dialActive':_0x155016[_0x35fc('0x31')],'dialMethod':_0x155016[_0x35fc('0x32')],'dialOriginateCallerIdName':_0x155016['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x155016['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x155016[_0x35fc('0x33')],'dialPrefix':_0x155016['dialPrefix'],'outboundAnswerAgiCallsDay':_0x155016[_0x35fc('0x34')],'outboundAnswerCallsDay':_0x155016[_0x35fc('0x35')],'outboundBlacklistCallsDay':_0x155016['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x155016[_0x35fc('0x36')],'outboundCongestionCallsDay':_0x155016[_0x35fc('0x37')],'outboundDropCallsDayACS':_0x155016[_0x35fc('0x38')],'outboundDropCallsDayCallersExit':_0x155016[_0x35fc('0x39')],'outboundDropCallsDayTimeout':_0x155016[_0x35fc('0x3a')],'outboundNoAnswerCallsDay':_0x155016[_0x35fc('0x3b')],'outboundNoSuchCallsDay':_0x155016[_0x35fc('0x3c')],'outboundOriginateFailureCallsDay':_0x155016[_0x35fc('0x3d')],'outboundReCallsDay':_0x155016['outboundReCallsDay'],'outboundRejectCallsDay':_0x155016[_0x35fc('0x3e')],'outboundUnknownCallsDay':_0x155016[_0x35fc('0x3f')],'outboundAbandonedCallsDay':_0x155016[_0x35fc('0x40')],'predictiveIntervalAnsweredCalls':_0x155016['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x155016[_0x35fc('0x41')],'predictiveIntervalAvgTalktime':_0x155016[_0x35fc('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x155016[_0x35fc('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x155016[_0x35fc('0x44')],'predictiveIntervalErlangCalls':_0x155016[_0x35fc('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x155016[_0x35fc('0x46')],'predictiveIntervalHitRate':_0x155016[_0x35fc('0x47')],'predictiveIntervalMultiplicativeFactor':_0x155016[_0x35fc('0x48')],'predictiveIntervalPauses':_0x155016[_0x35fc('0x49')],'predictiveIntervalAvailable':_0x155016[_0x35fc('0x4a')],'predictiveIntervalTotalCalls':_0x155016['predictiveIntervalTotalCalls'],'message':_0x155016['message'],'originated':_0x155016[_0x35fc('0x4b')],'erlangCalls':_0x155016['erlangCalls'],'erlangCallToSecond':_0x155016[_0x35fc('0x4c')],'erlangAbandonmentRate':_0x155016[_0x35fc('0x4d')],'erlangBusyFactor':_0x155016[_0x35fc('0x4e')],'startPredictive':_0x155016[_0x35fc('0x4f')],'startProgressive':_0x155016[_0x35fc('0x50')]};if(_0x155016[_0x35fc('0x51')]){_0x427eae['Trunk']={'id':_0x155016[_0x35fc('0x51')]['id'],'name':_0x155016[_0x35fc('0x51')][_0x35fc('0x52')],'active':_0x155016[_0x35fc('0x51')][_0x35fc('0x53')],'callerid':_0x155016[_0x35fc('0x51')]['callerid']};}if(_0x155016[_0x35fc('0x54')]){_0x427eae[_0x35fc('0x54')]={'id':_0x155016[_0x35fc('0x54')]['id'],'name':_0x155016['Interval'][_0x35fc('0x52')]};}var _0x48d223=md5(JSON[_0x35fc('0x55')](_0x427eae));if(_0x155016[_0x35fc('0x4')]!==_0x48d223){_0x155016[_0x35fc('0x4')]=_0x48d223;emit(util[_0x35fc('0x56')]('voice:queue:%s',_0x427eae['name']),'voice_queue:save',_0x427eae);}}}function emitVoiceQueueChannelRemove(_0x20f5fe){logger['info'](_0x35fc('0x57'),JSON['stringify'](_0x20f5fe));emit(util[_0x35fc('0x56')](_0x35fc('0x58'),_0x20f5fe[_0x35fc('0x52')]),_0x35fc('0x59'),_0x20f5fe);io[_0x35fc('0x24')](_0x35fc('0x5a'),_0x20f5fe);}function notSendMessagesQueue(_0x9fe7d6){if(_0x9fe7d6['sendMessageOneNotActive']){if(_0x9fe7d6[_0x35fc('0x4b')]===0x0&&_0x9fe7d6[_0x35fc('0x2b')]===0x0){_0x9fe7d6['sendMessageOneNotActive']=![];_0x9fe7d6[_0x35fc('0x29')]=0x0;_0x9fe7d6[_0x35fc('0x5b')]=0x0;_0x9fe7d6[_0x35fc('0x5c')]=_0x35fc('0x5d');ut[_0x35fc('0x5e')](_0x35fc('0x5f'),_0x9fe7d6['name']+_0x35fc('0x60'));}else{_0x9fe7d6[_0x35fc('0x5c')]=_0x35fc('0x61');ut['logger'](_0x35fc('0x5f'),_0x9fe7d6[_0x35fc('0x52')]+'\x20is\x20disactive');}emitCampaignPreview(_0x9fe7d6);}}Preview[_0x35fc('0xf')][_0x35fc('0x23')]=function(){var _0x43b77c=this;setInterval(function(){_0x43b77c[_0x35fc('0x62')]();},0x7cf);};Preview[_0x35fc('0xf')][_0x35fc('0x62')]=function(){var _0x211b70=this[_0x35fc('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x596e83 in _0x211b70){if(_0x211b70[_0x35fc('0x63')](_0x596e83)&&(_0x211b70[_0x596e83][_0x35fc('0x32')]==='preview'||_0x211b70[_0x596e83]['dialMethod']==='booked')&&_0x211b70[_0x596e83][_0x35fc('0x25')]===_0x35fc('0x26')){if(this['clockClearZombieChannels']>0x7){this[_0x35fc('0x16')]=0x0;this[_0x35fc('0x64')]();}}if(_0x211b70[_0x35fc('0x63')](_0x596e83)&&_0x211b70[_0x596e83][_0x35fc('0x32')]==='preview'&&_0x211b70[_0x596e83]['type']==='outbound'){if(_0x211b70[_0x596e83]['dialActive']){this['setMessage'](_0x211b70[_0x596e83]);if(_0x211b70[_0x596e83][_0x35fc('0x65')])this[_0x35fc('0x66')](_0x211b70[_0x596e83]);}else{notSendMessagesQueue(_0x211b70[_0x596e83]);}}}};Preview['prototype'][_0x35fc('0x67')]=function(_0x56cf1f){var _0x13d16c=this;this[_0x35fc('0x12')][_0x35fc('0x68')](function(){if(!_[_0x35fc('0x69')](_0x13d16c[_0x35fc('0x6a')][_0x56cf1f])){loggerAction['info'](_0x35fc('0x6b'),_0x56cf1f,_0x35fc('0x6c'),_0x13d16c['actions'][_0x56cf1f][_0x35fc('0x6d')],_0x35fc('0x6e'),JSON[_0x35fc('0x55')](_0x13d16c[_0x35fc('0x13')][_0x13d16c['actions'][_0x56cf1f][_0x35fc('0x6d')]]['originated']),'pTalking:\x20',JSON[_0x35fc('0x55')](_0x13d16c[_0x35fc('0x13')][_0x13d16c[_0x35fc('0x6a')][_0x56cf1f][_0x35fc('0x6d')]][_0x35fc('0x2b')]),JSON[_0x35fc('0x55')](_0x13d16c[_0x35fc('0x6a')][_0x56cf1f][_0x35fc('0x6f')]),JSON['stringify'](_[_0x35fc('0x70')](_0x13d16c[_0x35fc('0x6a')][_0x56cf1f],[_0x35fc('0x71'),_0x35fc('0x72'),_0x35fc('0x73'),_0x35fc('0x74')])));return ami[_0x35fc('0x75')]({'action':_0x35fc('0x76'),'channel':_0x13d16c[_0x35fc('0x6a')][_0x56cf1f][_0x35fc('0x77')]})[_0x35fc('0x78')](function(_0x224079){if(_0x224079[_0x35fc('0x5c')]===_0x35fc('0x79')){setTimeout(function(){if(_0x13d16c['actions'][_0x56cf1f]){ut['updateOriginated'](_0x13d16c[_0x35fc('0x13')][_0x13d16c[_0x35fc('0x6a')][_0x56cf1f][_0x35fc('0x6d')]],_0x35fc('0x7a'));if(_0x13d16c[_0x35fc('0x6a')][_0x56cf1f][_0x35fc('0x6f')]===!![]){ut['decrementTalkink'](_0x13d16c['campaignsPreview'][_0x13d16c[_0x35fc('0x6a')][_0x56cf1f][_0x35fc('0x6d')]],_0x35fc('0x7a'));ut[_0x35fc('0x7b')]('[Dialer][checkChannel][pTalking][Preview]'+_0x56cf1f,_0x13d16c[_0x35fc('0x6a')][_0x56cf1f][_0x35fc('0x6d')]);}ut['loggerError'](_0x35fc('0x7c')+_0x56cf1f,_0x13d16c[_0x35fc('0x6a')][_0x56cf1f]['queue']);delete _0x13d16c[_0x35fc('0x6a')][_0x56cf1f];}},0x2328);}});}});};Preview[_0x35fc('0xf')][_0x35fc('0x64')]=function(){var _0x18f18b=this;loggerAction['info']('[action]',_['size'](this[_0x35fc('0x6a')]));for(var _0x2ea8d6 in this['actions']){if(_0x18f18b[_0x35fc('0x6a')][_0x35fc('0x63')](_0x2ea8d6)){_0x18f18b[_0x35fc('0x67')](_0x2ea8d6);}}};Preview[_0x35fc('0xf')][_0x35fc('0x66')]=function(_0x538be0){var _0x2d9d45=this;rpcDb[_0x35fc('0x7d')](_0x538be0['id'],ut[_0x35fc('0x7e')](this['agents']))[_0x35fc('0x7f')](function(_0x1dbf5a){if(!_['isNil'](_0x1dbf5a)){for(var _0x35a676=0x0;_0x35a676<_0x1dbf5a[_0x35fc('0x80')];_0x35a676+=0x1){if(ut[_0x35fc('0x81')](_0x1dbf5a[_0x35a676][_0x35fc('0x82')])<_0x538be0[_0x35fc('0x83')]*0x3c){if(_0x1dbf5a[_0x35a676][_0x35fc('0x84')]&&!_0x1dbf5a[_0x35a676][_0x35fc('0x84')][_0x35fc('0x85')]){_0x2d9d45['run'](_0x1dbf5a[_0x35a676]['id'])[_0x35fc('0x7f')](ut[_0x35fc('0x86')](_0x35fc('0x87')))['catch'](ut[_0x35fc('0x86')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x1dbf5a[_0x35a676]['id']);}}else{var _0x5d4a39=new Action(_0x1dbf5a[_0x35a676],_0x538be0);_0x5d4a39[_0x35fc('0x88')]=moment()[_0x35fc('0x56')](_0x35fc('0x89'));_0x538be0[_0x35fc('0x8a')]+=0x1;ut[_0x35fc('0x8b')](_0x5d4a39,0x17,'RecallInQueue');if(_0x538be0['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x1dbf5a[_0x35a676]));rpcDb['createCustomerHistory'](_0x5d4a39,_0x35fc('0x8c'));}else{ut[_0x35fc('0x8b')](_0x5d4a39,0x16,_0x35fc('0x8d'));rpcDb[_0x35fc('0x8e')](_0x5d4a39,'[HistoryRecallClose]');rpcDb[_0x35fc('0x8f')](_0x5d4a39,_0x35fc('0x90'));}}}}})[_0x35fc('0x78')](ut[_0x35fc('0x86')](_0x35fc('0x91')));};Preview[_0x35fc('0xf')][_0x35fc('0x92')]=function(_0x2127e0){_0x2127e0[_0x35fc('0x93')]=!![];if(ut['IsNotLoggedIn'](_0x2127e0[_0x35fc('0x2a')])){_0x2127e0['message']=_0x35fc('0x94');}else if(!ut[_0x35fc('0x95')](_0x2127e0[_0x35fc('0x31')])){_0x2127e0[_0x35fc('0x5c')]='NOT_ACTIVE';}else if(!this[_0x35fc('0x96')](_0x2127e0['Trunk'])){if(!this['isTrunkReachable'](_0x2127e0['TrunkBackup'])){_0x2127e0[_0x35fc('0x5c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x2127e0[_0x35fc('0x5c')]='ACTIVE';}}else{_0x2127e0[_0x35fc('0x5c')]='ACTIVE';}emitCampaignPreview(_0x2127e0);};Preview[_0x35fc('0xf')][_0x35fc('0x97')]=function(_0x3400f0,_0x1d81a5,_0x5c2ec0){var _0x3d0ecc=this;var _0x1e2214=this[_0x35fc('0x6a')][_0x1d81a5];var _0x5df92d=this[_0x35fc('0x13')][_0x1e2214[_0x35fc('0x6d')]];var _0x37764b;if(_0x5df92d){switch(_0x5c2ec0){case'1':_0x5df92d[_0x35fc('0x3c')]+=0x1;_0x1e2214[_0x35fc('0x98')]+=0x1;_0x1e2214[_0x35fc('0x99')]=ut[_0x35fc('0x9a')](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0x0,'NoSuchNumber');ami[_0x35fc('0x24')](_0x35fc('0x9b'),ut[_0x35fc('0x9c')](_0x1e2214,'nosuchnumber'));rpcDb[_0x35fc('0x8e')](_0x1e2214,_0x35fc('0x9d'));if(ut['totalGlobal'](_0x1e2214)>=_0x5df92d['dialGlobalMaxRetry']){_0x37764b=ut[_0x35fc('0x9e')](_0x1e2214,0xf,'Global');rpcDb[_0x35fc('0x8f')](_0x37764b,_0x35fc('0x9f'));}else{if(_0x1e2214[_0x35fc('0x98')]>=_0x5df92d[_0x35fc('0xa0')]){rpcDb[_0x35fc('0x8f')](_0x1e2214,_0x35fc('0x9f'));}else{rpcDb[_0x35fc('0xa1')](ut[_0x35fc('0xa2')](_0x1e2214,_0x35fc('0x98'),_0x5df92d[_0x35fc('0xa3')]),_0x1e2214[_0x35fc('0xa4')],_0x1e2214[_0x35fc('0xa5')]);}}delete this[_0x35fc('0x6a')][_0x3400f0[_0x35fc('0xa6')]];break;case _0x35fc('0xa7'):var _0xd1e7ed=moment()[_0x35fc('0x56')](_0x35fc('0x89'));_0x1e2214[_0x35fc('0xa8')]=_0xd1e7ed;_0x1e2214[_0x35fc('0xa9')]=_0xd1e7ed;_0x1e2214['dialAnswer']=!![];_0x5df92d[_0x35fc('0x2b')]+=0x1;logger['info'](_0x35fc('0xaa'),_0x1e2214[_0x35fc('0xab')],_0x35fc('0xac'),_0x5df92d[_0x35fc('0x52')],_0x35fc('0xad'),_0x5df92d[_0x35fc('0x2b')]);ami[_0x35fc('0x24')](_0x35fc('0xae'),ut[_0x35fc('0x9c')](_0x1e2214,_0x35fc('0xaf'),this[_0x35fc('0x13')][_0x1e2214['queue']]));if(_0x5df92d[_0x35fc('0xb0')]){ami[_0x35fc('0x24')](_0x35fc('0xb1'),ut[_0x35fc('0xb2')](_0x1e2214));}break;case'16':ami[_0x35fc('0x24')](_0x35fc('0xb3'),ut['buildObj'](_0x1e2214,_0x35fc('0xb4'),this[_0x35fc('0x13')][_0x1e2214[_0x35fc('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x35fc('0x9c')](_0x1e2214,_0x35fc('0xb4')));_0x5df92d[_0x35fc('0x35')]+=0x1;_0x5df92d[_0x35fc('0x2e')]+=0x1;_0x5df92d[_0x35fc('0x28')]+=0x1;ut[_0x35fc('0xb5')](_0x5df92d,'[16]');_0x1e2214[_0x35fc('0x99')]=ut['totalGlobal'](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0x4,_0x35fc('0xb6'));rpcDb['createCustomerHistory'](_0x1e2214,_0x35fc('0xb7'));rpcDb[_0x35fc('0x8f')](_0x1e2214,_0x35fc('0xb8'));rpcDb[_0x35fc('0xb9')](_0x1e2214);_0x5df92d[_0x35fc('0x2c')]+=_0x1e2214[_0x35fc('0xba')];_0x5df92d[_0x35fc('0xbb')]+=_0x1e2214[_0x35fc('0xba')];logger[_0x35fc('0xbc')]('[syncHangup][talking][decrement]',_0x1e2214['uniqueid'],'\x20Queue',_0x5df92d['name'],_0x35fc('0xad'),_0x5df92d[_0x35fc('0x2b')]);delete this[_0x35fc('0x6a')][_0x3400f0[_0x35fc('0xa6')]];break;case _0x35fc('0xbd'):_0x5df92d['outboundBusyCallsDay']+=0x1;_0x1e2214[_0x35fc('0xbe')]+=0x1;_0x1e2214[_0x35fc('0x99')]=ut[_0x35fc('0x9a')](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0x5,'Busy');ami[_0x35fc('0x24')](_0x35fc('0xbf'),ut[_0x35fc('0x9c')](_0x1e2214,'busy'));rpcDb[_0x35fc('0x8e')](_0x1e2214,_0x35fc('0xc0'));if(ut[_0x35fc('0x9a')](_0x1e2214)>=_0x5df92d[_0x35fc('0xc1')]){_0x37764b=ut[_0x35fc('0x9e')](_0x1e2214,0xf,_0x35fc('0xc2'));rpcDb[_0x35fc('0x8f')](_0x37764b,_0x35fc('0xc3'));}else{if(_0x1e2214['countbusyretry']>=_0x5df92d[_0x35fc('0xc4')]){rpcDb[_0x35fc('0x8f')](_0x1e2214,_0x35fc('0xc0'));}else{rpcDb[_0x35fc('0xa1')](ut[_0x35fc('0xa2')](_0x1e2214,_0x35fc('0xbe'),_0x5df92d['dialBusyRetryFrequency']),_0x1e2214[_0x35fc('0xa4')],_0x1e2214['activeContact']);}}break;case'NOANSWER':_0x5df92d[_0x35fc('0x3b')]+=0x1;_0x1e2214['countnoanswerretry']+=0x1;_0x1e2214[_0x35fc('0x99')]=ut[_0x35fc('0x9a')](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0x3,'NoAnswer');ami[_0x35fc('0x24')](_0x35fc('0xc5'),ut[_0x35fc('0x9c')](_0x1e2214,_0x35fc('0xc6')));rpcDb[_0x35fc('0x8e')](_0x1e2214,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x1e2214)>=_0x5df92d['dialGlobalMaxRetry']){_0x37764b=ut[_0x35fc('0x9e')](_0x1e2214,0xf,'Global');rpcDb[_0x35fc('0x8f')](_0x37764b,_0x35fc('0xc7'));}else{if(_0x1e2214[_0x35fc('0xc8')]>=_0x5df92d[_0x35fc('0xc9')]){rpcDb['createCustomerFinal'](_0x1e2214,_0x35fc('0xca'));}else{rpcDb[_0x35fc('0xa1')](ut[_0x35fc('0xa2')](_0x1e2214,'countnoanswerretry',_0x5df92d[_0x35fc('0xcb')]),_0x1e2214[_0x35fc('0xa4')],_0x1e2214[_0x35fc('0xa5')]);}}break;case'CONGESTION':_0x5df92d['outboundCongestionCallsDay']+=0x1;_0x1e2214['countcongestionretry']+=0x1;_0x1e2214[_0x35fc('0x99')]=ut[_0x35fc('0x9a')](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0x8,_0x35fc('0xcc'));ami['emit'](_0x35fc('0xcd'),ut[_0x35fc('0x9c')](_0x1e2214,'congestion'));rpcDb['createCustomerHistory'](_0x1e2214,_0x35fc('0xce'));if(ut[_0x35fc('0x9a')](_0x1e2214)>=_0x5df92d[_0x35fc('0xc1')]){_0x37764b=ut['cloneAction'](_0x1e2214,0xf,'Global');rpcDb[_0x35fc('0x8f')](_0x37764b,_0x35fc('0xcf'));}else{if(_0x1e2214['countcongestionretry']>=_0x5df92d[_0x35fc('0xd0')]){rpcDb[_0x35fc('0x8f')](_0x1e2214,_0x35fc('0xce'));}else{rpcDb['rescheduleContact'](ut[_0x35fc('0xa2')](_0x1e2214,_0x35fc('0xd1'),_0x5df92d[_0x35fc('0xd2')]),_0x1e2214[_0x35fc('0xa4')],_0x1e2214['activeContact']);}}break;case _0x35fc('0xd3'):_0x5df92d[_0x35fc('0x3e')]+=0x1;_0x1e2214[_0x35fc('0xd4')]+=0x1;_0x1e2214['countglobal']=ut[_0x35fc('0x9a')](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0x14,_0x35fc('0xd5'));ami['emit'](_0x35fc('0xd6'),ut[_0x35fc('0x9c')](_0x1e2214,'agentreject'));rpcDb[_0x35fc('0x8e')](_0x1e2214,_0x35fc('0xd7'));if(ut[_0x35fc('0x9a')](_0x1e2214)>=_0x5df92d[_0x35fc('0xc1')]){_0x37764b=ut[_0x35fc('0x9e')](_0x1e2214,0x14,_0x35fc('0xd5'));rpcDb[_0x35fc('0x8f')](_0x37764b,_0x35fc('0xd8'));}else{if(_0x1e2214[_0x35fc('0xd4')]>=_0x5df92d['dialAgentRejectMaxRetry']){rpcDb[_0x35fc('0x8f')](_0x1e2214,_0x35fc('0xd8'));}else{rpcDb[_0x35fc('0xa1')](ut[_0x35fc('0xa2')](_0x1e2214,'countagentrejectretry',_0x5df92d[_0x35fc('0xd9')]),_0x1e2214[_0x35fc('0xa4')],_0x1e2214[_0x35fc('0xa5')]);}}break;case _0x35fc('0xda'):_0x5df92d[_0x35fc('0x40')]+=0x1;_0x1e2214[_0x35fc('0xdb')]+=0x1;_0x1e2214[_0x35fc('0x99')]=ut[_0x35fc('0x9a')](_0x1e2214);ut['logCustomer'](_0x1e2214,0xb,'Abandoned');rpcDb[_0x35fc('0x8e')](_0x1e2214,_0x35fc('0xdc'));if(ut[_0x35fc('0x9a')](_0x1e2214)>=_0x5df92d['dialGlobalMaxRetry']){_0x37764b=ut[_0x35fc('0x9e')](_0x1e2214,0xf,_0x35fc('0xc2'));rpcDb[_0x35fc('0x8f')](_0x37764b,_0x35fc('0xdc'));}else{if(_0x1e2214['countabandonedetry']>=_0x5df92d['dialAbandonedMaxRety']){rpcDb[_0x35fc('0x8f')](_0x1e2214,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x35fc('0xa1')](ut[_0x35fc('0xa2')](_0x1e2214,'countabandonedretry',_0x5df92d['dialAbandonedRetryFrequency']),_0x1e2214[_0x35fc('0xa4')],_0x1e2214[_0x35fc('0xa5')]);}}break;case'18':_0x5df92d[_0x35fc('0x3f')]+=0x1;_0x1e2214['countmachineretry']+=0x1;_0x1e2214[_0x35fc('0x99')]=ut[_0x35fc('0x9a')](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0x12,_0x3400f0['cause-txt']||_0x3400f0[_0x35fc('0xdd')]);ami[_0x35fc('0x24')](_0x35fc('0xde'),ut[_0x35fc('0x9c')](_0x1e2214,'amd'));rpcDb[_0x35fc('0x8e')](_0x1e2214,_0x35fc('0xdf'));if(ut[_0x35fc('0x9a')](_0x1e2214)>=_0x5df92d[_0x35fc('0xc1')]){_0x37764b=ut[_0x35fc('0x9e')](_0x1e2214,0xf,_0x35fc('0xc2'));rpcDb['createCustomerFinal'](_0x37764b,_0x35fc('0xdf'));}else{rpcDb[_0x35fc('0x8f')](_0x1e2214,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x35fc('0x6a')][_0x3400f0[_0x35fc('0xa6')]];break;case'19':_0x5df92d['outboundUnknownCallsDay']+=0x1;_0x1e2214[_0x35fc('0x99')]=ut[_0x35fc('0x9a')](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0x13,_0x3400f0[_0x35fc('0xe0')]||_0x3400f0[_0x35fc('0xdd')]);ami['emit'](_0x35fc('0xde'),ut[_0x35fc('0x9c')](_0x1e2214,_0x35fc('0xe1')));rpcDb['createCustomerHistory'](_0x1e2214,_0x35fc('0xe2'));if(ut['totalGlobal'](_0x1e2214)>=_0x5df92d['dialGlobalMaxRetry']){_0x37764b=ut[_0x35fc('0x9e')](_0x1e2214,0xf,_0x35fc('0xc2'));rpcDb[_0x35fc('0x8f')](_0x37764b,_0x35fc('0xe2'));}else{rpcDb[_0x35fc('0x8f')](_0x1e2214,'[callProgressDetectingCustomer][machine]');}delete this[_0x35fc('0x6a')][_0x3400f0[_0x35fc('0xa6')]];break;default:if(_0x1e2214[_0x35fc('0x6f')]){ut['decrementTalkink'](_0x5df92d,_0x35fc('0xe3'));ut[_0x35fc('0x7b')](_0x35fc('0xe4')+_0x5df92d[_0x35fc('0x52')],_0x3400f0);}_0x5df92d[_0x35fc('0x3f')]+=0x1;_0x1e2214['countglobal']=ut[_0x35fc('0x9a')](_0x1e2214);ut[_0x35fc('0x8b')](_0x1e2214,0xc,_0x3400f0['cause-txt']||_0x3400f0['dialstatus']);rpcDb[_0x35fc('0x8e')](_0x1e2214,_0x35fc('0xe5'));if(ut[_0x35fc('0x9a')](_0x1e2214)>=_0x5df92d[_0x35fc('0xc1')]){_0x37764b=ut[_0x35fc('0x9e')](_0x1e2214,0xf,_0x35fc('0xc2'));rpcDb[_0x35fc('0x8f')](_0x37764b,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x1e2214,_0x35fc('0xe6'));}delete this[_0x35fc('0x6a')][_0x3400f0[_0x35fc('0xa6')]];}if(!(_0x1e2214[_0x35fc('0x6f')]&&_0x5c2ec0==='16')){ut[_0x35fc('0xe7')](_0x5df92d,'[callProgressDetectingCustomer]');logger['info'](_0x35fc('0xe8'),_0x1e2214[_0x35fc('0xab')],_0x35fc('0xac'),_0x5df92d[_0x35fc('0x52')],'originated:\x20',_0x5df92d['originated']);}if(_0x5c2ec0!==_0x35fc('0xa7')){delete this[_0x35fc('0x6a')][_0x3400f0[_0x35fc('0xa6')]];delete this[_0x35fc('0x6a')][_0x3400f0['destlinkedid']];}}};Preview['prototype'][_0x35fc('0xe9')]=function(_0x41478c,_0x4a1545,_0x6382dd){if(_[_0x35fc('0xea')](_0x4a1545)&&_0x35fc('0xeb')!==typeof _0x4a1545){return;}if(_[_0x35fc('0xea')](_0x6382dd)&&_0x35fc('0xeb')!==typeof _0x6382dd){return;}switch(_0x6382dd[_0x35fc('0xec')]){case'0':ut[_0x35fc('0xed')](_0x41478c,0x0,_0x35fc('0xee'));rpcDb[_0x35fc('0xef')](_0x41478c,_0x35fc('0xf0'));break;case'3':ut[_0x35fc('0xed')](_0x41478c,0x3,_0x35fc('0xf1'));rpcDb[_0x35fc('0xef')](_0x41478c,_0x35fc('0xf2'));break;case'5':ut[_0x35fc('0xed')](_0x41478c,0x5,_0x35fc('0xf3'));rpcDb['createAgentHistory'](_0x41478c,_0x35fc('0xf4'));break;case'8':ut['logAgent'](_0x41478c,0x8,_0x35fc('0xcc'));rpcDb['createAgentHistory'](_0x41478c,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x35fc('0xed')](_0x41478c,0x16,_0x35fc('0xf5'));rpcDb[_0x35fc('0xef')](_0x41478c,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x35fc('0xed')](_0x41478c,0xc,_0x6382dd[_0x35fc('0xec')]);rpcDb[_0x35fc('0xef')](_0x41478c,_0x35fc('0xf6'));}ut[_0x35fc('0xe7')](_0x4a1545,_0x35fc('0xf7'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x41478c[_0x35fc('0xab')],'\x20Queue',_0x4a1545['name'],_0x35fc('0x6e'),_0x4a1545['originated']);delete this['actions'][_0x41478c['uniqueid']];};Preview[_0x35fc('0xf')]['checkInBlack']=function(_0x355154,_0x21d3a0,_0x406847,_0x4d4cf,_0x392212){var _0x201dfa=this;return new BPromise(function(_0x4ab6f9,_0x522ff2){if(_[_0x35fc('0x69')](_0x21d3a0)||_['isNil'](_0x21d3a0[_0x35fc('0xf8')])||_[_0x35fc('0x69')](_0x21d3a0['Contact']['phone'])||_['isNil'](_0x21d3a0[_0x35fc('0x73')])){_0x522ff2(ut[_0x35fc('0x5c')](_0x35fc('0xf9'),_0x4d4cf,_0x392212));return;}var _0x135e18=uuid['v4']();var _0x359e23=_0x201dfa[_0x35fc('0x13')][_0x21d3a0[_0x35fc('0x6c')][_0x35fc('0x52')]];var _0x4818ea=_0x406847?_0x201dfa['agents'][_0x406847]['id']:undefined;_0x201dfa['actions'][_0x135e18]=new Action(_0x21d3a0,_0x359e23,_0x135e18,_0x406847,_0x4818ea);var _0x4c163e=_0x201dfa[_0x35fc('0x6a')][_0x135e18];_0x4c163e['unlockAgent']=_0x4d4cf;_0x4c163e[_0x35fc('0xa5')]=_0x392212;_0x4c163e['lookAgent']=_0x406847;if(_[_0x35fc('0xfa')](_0x355154)){_0x201dfa[_0x35fc('0xfb')](_0x4c163e,_0x359e23,_0x21d3a0,_0x406847)['then'](function(_0x515bca){logger[_0x35fc('0xbc')](_0x35fc('0xfc'),_0x35fc('0xfd')+_0x4c163e[_0x35fc('0x6d')]+_0x35fc('0xfe')+_0x4c163e['idContact'],JSON['stringify'](_0x515bca));ami[_0x35fc('0x24')]('custom:agentcalled',ut[_0x35fc('0x9c')](_0x4c163e,'called',_0x201dfa[_0x35fc('0x13')][_0x4c163e[_0x35fc('0x6d')]]));_0x4ab6f9(ut[_0x35fc('0x5c')](_0x35fc('0xff')));})['catch'](function(_0x29a77a){ut['logger'](_0x35fc('0x100'),_0x29a77a);_0x522ff2(ut['message']('Call\x20failed',_0x4d4cf,_0x392212));});}else{_0x359e23[_0x35fc('0x101')]+=0x1;ut['logBlacklist'](_0x4c163e);rpcDb[_0x35fc('0x102')](_0x4c163e,_0x35fc('0x103'));delete _0x201dfa[_0x35fc('0x6a')][_0x135e18];_0x522ff2(ut[_0x35fc('0x5c')](_0x35fc('0x104'),_0x4d4cf,_0x392212));}});};Preview[_0x35fc('0xf')][_0x35fc('0x96')]=function(_0x154bc4){return!_[_0x35fc('0x69')](_0x154bc4)&&!_['isNil'](_0x154bc4[_0x35fc('0x52')])&&!_[_0x35fc('0x69')](_0x154bc4[_0x35fc('0x53')])&&_0x154bc4[_0x35fc('0x53')]&&!_[_0x35fc('0x69')](this[_0x35fc('0x14')][util[_0x35fc('0x56')](_0x35fc('0x105'),_0x154bc4['name'])])&&!_['isNil'](this['trunks'][util['format']('SIP/%s',_0x154bc4[_0x35fc('0x52')])][_0x35fc('0x76')])&&(this[_0x35fc('0x14')][util[_0x35fc('0x56')](_0x35fc('0x105'),_0x154bc4['name'])][_0x35fc('0x76')]===_0x35fc('0x106')||this[_0x35fc('0x14')][util[_0x35fc('0x56')](_0x35fc('0x105'),_0x154bc4['name'])][_0x35fc('0x76')]===_0x35fc('0x107'));};Preview[_0x35fc('0xf')]['run']=function(_0x471711,_0x3be965){var _0xc451ec=this;return new BPromise(function(_0x336b44,_0x715149){_0xc451ec[_0x35fc('0x108')](_0x471711,_0x3be965)[_0x35fc('0x7f')](function(_0x45df88){_0x336b44(_[_0x35fc('0x70')](_0x45df88,[_0x35fc('0x5c')]));})[_0x35fc('0x78')](function(_0x7b98b0){if(_0x7b98b0[_0x35fc('0x109')]){rpcDb[_0x35fc('0x10a')](_0x471711);}if(_0x7b98b0[_0x35fc('0x53')]){rpcDb['disableContact'](_0x471711);}_0x715149(_['pick'](_0x7b98b0,[_0x35fc('0x5c')]));});});};Preview[_0x35fc('0xf')][_0x35fc('0x108')]=function(_0xb0550a,_0x219be6){var _0x2723b1=this;return new BPromise(function(_0x2e02ca,_0x462893){var _0x295121,_0x17b462;rpcDb[_0x35fc('0x10b')](_0xb0550a)[_0x35fc('0x7f')](function(_0x3148f3){if(!_[_0x35fc('0x69')](_0x3148f3[0x0])){_0x17b462=_0x3148f3[0x0][_0x35fc('0x10c')]?![]:!![];_0x295121=_0x3148f3[0x0]['recallme']?!![]:![];_0x295121=_0x219be6?!![]:_0x295121;}var _0x31f580=_0x2723b1[_0x35fc('0x10d')](_0x3148f3);if(_0x31f580[_0x35fc('0x10e')]){rpcDb[_0x35fc('0x10f')](_[_0x35fc('0x70')](_0x3148f3[0x0],[_0x35fc('0x73'),_0x35fc('0x110')]))[_0x35fc('0x7f')](function(_0x5e828f){_0x2723b1['checkInBlack'](_0x5e828f,_0x3148f3[0x0],_0x219be6,_0x17b462,_0x295121)[_0x35fc('0x7f')](function(_0x2d4d10){_0x2e02ca(_0x2d4d10);})['catch'](function(_0xeb426d){_0x462893(_0xeb426d);});})[_0x35fc('0x78')](function(_0x43a794){ut[_0x35fc('0x5e')]('[Preview][checkIsBlackList]',_0x43a794);_0x462893(ut[_0x35fc('0x5c')](_0x35fc('0x111'),_0x17b462,_0x295121));});}else{_0x462893(ut[_0x35fc('0x5c')](_0x31f580[_0x35fc('0x5c')],_0x17b462,_0x295121));}})['catch'](function(_0x49ed6b){ut[_0x35fc('0x5e')]('[Preview][getContactPreview]',_0x49ed6b);_0x462893(ut[_0x35fc('0x5c')](_0x35fc('0x111'),![],!![]));});});};Preview[_0x35fc('0xf')]['validateContact']=function(_0x3a915d){if(_['isNil'](_0x3a915d)||_[_0x35fc('0xfa')](_0x3a915d)||!_[_0x35fc('0x69')](_0x3a915d[0x0]['Agent'])&&_[_0x35fc('0x69')](_0x3a915d[0x0][_0x35fc('0x84')][_0x35fc('0x52')])){ut[_0x35fc('0x5e')](_0x35fc('0x112'),_0x3a915d);return{'isValid':![],'message':_0x35fc('0x113')};}var _0x28dec3=this['campaignsPreview'][_0x3a915d[0x0]['Queue'][_0x35fc('0x52')]];_0x28dec3[_0x35fc('0x5c')]=_0x35fc('0x114');if(_[_0x35fc('0x69')](_0x28dec3)){ut[_0x35fc('0x5e')](_0x35fc('0x115'),_0x28dec3);return{'isValid':![],'message':_0x35fc('0x116')};}if(!this['isTrunkReachable'](_0x28dec3[_0x35fc('0x51')])){ut[_0x35fc('0x5e')](_0x35fc('0x117'),'campaign\x20Name:\x20'+_0x28dec3[_0x35fc('0x52')]+_0x35fc('0x118'));if(!this[_0x35fc('0x96')](_0x28dec3[_0x35fc('0x119')])){ut[_0x35fc('0x5e')](_0x35fc('0x117'),_0x28dec3[_0x35fc('0x52')]+_0x35fc('0x11a'));return{'isValid':![],'message':_0x35fc('0x11b')};}}if(!ut[_0x35fc('0x95')](_0x28dec3[_0x35fc('0x31')])){ut[_0x35fc('0x5e')](_0x35fc('0x11c'),_0x28dec3[_0x35fc('0x52')]+_0x35fc('0x11d'));return{'isValid':![],'message':_0x35fc('0x11e')+_0x28dec3[_0x35fc('0x52')]+_0x35fc('0x11d')};}return{'isValid':!![],'message':_0x35fc('0x11f')};};Preview['prototype'][_0x35fc('0xfb')]=function(_0x4f74ff,_0x28cbc8,_0x1f660b,_0x4dd4a2){var _0x1add46=this;return new BPromise(function(_0x3bfdb6,_0x462c30){var _0x1171ab=_0x4f74ff[_0x35fc('0xab')];var _0x1c6dd3=_0x1add46[_0x35fc('0x96')](_0x28cbc8[_0x35fc('0x51')])?util['format'](_0x35fc('0x120'),_0x28cbc8[_0x35fc('0x51')][_0x35fc('0x52')],_[_0x35fc('0x69')](_0x28cbc8['dialPrefix'])?'':_0x28cbc8['dialPrefix']['trim']()||'',_0x28cbc8['dialCutDigit']>0x0?_0x1f660b[_0x35fc('0xf8')]['phone'][_0x35fc('0x121')](_0x28cbc8[_0x35fc('0x122')]):_0x1f660b[_0x35fc('0xf8')][_0x35fc('0x123')]):util[_0x35fc('0x56')](_0x35fc('0x120'),_[_0x35fc('0x69')](_0x28cbc8[_0x35fc('0x119')])?_0x28cbc8[_0x35fc('0x51')][_0x35fc('0x52')]:_0x28cbc8[_0x35fc('0x119')][_0x35fc('0x52')],_[_0x35fc('0x69')](_0x28cbc8['dialPrefix'])?'':_0x28cbc8[_0x35fc('0x124')][_0x35fc('0x125')]()||'',_0x28cbc8[_0x35fc('0x122')]>0x0?_0x1f660b[_0x35fc('0xf8')]['phone'][_0x35fc('0x121')](_0x28cbc8[_0x35fc('0x122')]):_0x1f660b[_0x35fc('0xf8')][_0x35fc('0x123')]);var _0x304bb8=_0x1add46[_0x35fc('0x96')](_0x28cbc8[_0x35fc('0x51')])?ut[_0x35fc('0x126')](_0x28cbc8[_0x35fc('0x51')][_0x35fc('0x127')],_0x28cbc8[_0x35fc('0x128')],_0x28cbc8[_0x35fc('0x129')]>0x0?ut[_0x35fc('0x12a')](_0x28cbc8[_0x35fc('0x12b')],_0x28cbc8[_0x35fc('0x129')]):_0x28cbc8[_0x35fc('0x12b')]):ut[_0x35fc('0x126')](_[_0x35fc('0x69')](_0x28cbc8[_0x35fc('0x119')])?_0x28cbc8[_0x35fc('0x51')][_0x35fc('0x127')]:_0x28cbc8[_0x35fc('0x119')]['callerid'],_0x28cbc8[_0x35fc('0x128')],_0x28cbc8[_0x35fc('0x129')]>0x0?ut[_0x35fc('0x12a')](_0x28cbc8[_0x35fc('0x12b')],_0x28cbc8[_0x35fc('0x129')]):_0x28cbc8['dialOriginateCallerIdNumber']);if(_0x304bb8){_0x4f74ff[_0x35fc('0x12c')]=ut['extractCalleridName'](_0x304bb8);_0x4f74ff[_0x35fc('0x12d')]=ut[_0x35fc('0x12e')](_0x304bb8);}var _0x342681=ut[_0x35fc('0x12f')](_0x28cbc8,_0x1f660b,_0x1c6dd3,_0x304bb8,_0x1171ab,_0x4f74ff);_[_0x35fc('0x130')](_0x4f74ff,ut[_0x35fc('0x131')](_0x342681));_0x4f74ff[_0x35fc('0x88')]=moment()[_0x35fc('0x56')](_0x35fc('0x89'));ami[_0x35fc('0x75')](ut[_0x35fc('0x132')](_0x4f74ff,_0x28cbc8,_0x342681,_0x4f74ff[_0x35fc('0xa5')],_0x4dd4a2))[_0x35fc('0x7f')](function(_0x201c0e){_0x28cbc8[_0x35fc('0x4b')]+=0x1;logger[_0x35fc('0xbc')](_0x35fc('0x133'),_0x1171ab,_0x35fc('0xac'),_0x28cbc8[_0x35fc('0x52')],_0x35fc('0x6e'),_0x28cbc8['originated']);_0x3bfdb6(_0x201c0e);})[_0x35fc('0x78')](function(_0xb3afed){ut[_0x35fc('0xed')](_0x4f74ff,0xe,'OriginateError');rpcDb[_0x35fc('0xef')](_0x4f74ff,_0x35fc('0x134'));_0x462c30(_0xb3afed);});});};Preview['prototype']['syncNewExten']=function(_0x50285d){if(this[_0x35fc('0x6a')][_0x50285d[_0x35fc('0xa6')]]){this['actions'][_0x50285d[_0x35fc('0xa6')]][_0x35fc('0x77')]=_0x50285d[_0x35fc('0x77')];}};Preview[_0x35fc('0xf')][_0x35fc('0x18')]=function(_0x27dde4){var _0x4e614e=this;var _0x13534c=this[_0x35fc('0x6a')][_0x27dde4[_0x35fc('0x135')]];if(_0x13534c){if(_0x13534c[_0x35fc('0x136')]&&this[_0x35fc('0x15')][_0x13534c['lookAgent']]){ut[_0x35fc('0x137')](_0x13534c,this[_0x35fc('0x15')][_0x13534c['lookAgent']][_0x35fc('0x52')],this[_0x35fc('0x15')][_0x13534c[_0x35fc('0x136')]]['id']);}var _0x2e3674=_[_0x35fc('0x138')](_0x13534c);_0x2e3674[_0x35fc('0xa8')]=moment()[_0x35fc('0x56')](_0x35fc('0x89'));var _0x3cb6a7=_0x4e614e['campaignsPreview'][_0x13534c[_0x35fc('0x6d')]];if(ut[_0x35fc('0x139')](_0x27dde4['response'])){if(_0x13534c[_0x35fc('0xa4')]){rpcDb['unlockContact'](_0x13534c[_0x35fc('0x13a')]);}if(_0x13534c[_0x35fc('0xa5')]){rpcDb[_0x35fc('0x13b')](_0x13534c[_0x35fc('0x13a')]);}ami[_0x35fc('0x24')](_0x35fc('0x13c'),ut[_0x35fc('0x9c')](_0x13534c,_0x35fc('0x13d'),this['campaignsPreview'][_0x13534c[_0x35fc('0x6d')]]));this['callProgressDetectingAgent'](_0x2e3674,_0x3cb6a7,_0x27dde4);}else{_0x13534c[_0x35fc('0x88')]=moment()[_0x35fc('0x56')](_0x35fc('0x89'));ut[_0x35fc('0xed')](_0x2e3674,0x4,_0x35fc('0xb6'));rpcDb[_0x35fc('0xef')](_0x2e3674,_0x35fc('0x13e'));}}};Preview[_0x35fc('0xf')][_0x35fc('0x13f')]=function(_0x35a568){var _0x403ec8=this;var _0xcf2163=this[_0x35fc('0x6a')][_0x35a568[_0x35fc('0xa6')]];var _0x324c56;if(_0xcf2163){_0x324c56=this['campaignsPreview'][_0xcf2163[_0x35fc('0x6d')]];logger[_0x35fc('0xbc')](_0x35fc('0x140'),_0x35a568[_0x35fc('0xa6')],_0x35fc('0xac'),_0x324c56[_0x35fc('0x52')],_0x35fc('0xad'),_0x324c56['pTalking']);}if(this['actions'][_0x35a568['linkedid']]&&_0x35a568['linkedid']!==_0x35a568[_0x35fc('0xab')]){if(_0x35a568['cause']==='16'&&this[_0x35fc('0x6a')][_0x35a568[_0x35fc('0xa6')]][_0x35fc('0x6f')]){this[_0x35fc('0x97')](_0x35a568,_0x35a568[_0x35fc('0xa6')],_0x35a568[_0x35fc('0x141')]);}else if(this['actions'][_0x35a568[_0x35fc('0xa6')]]['dialAnswer']){logger[_0x35fc('0xbc')]('[syncHangup][talking][cause]',_0x35a568['linkedid'],_0x35a568[_0x35fc('0x141')],_0x35fc('0xac'),_0x324c56[_0x35fc('0x52')],'pTalking:\x20',_0x324c56['pTalking']);this['callProgressDetectingCustomer'](_0x35a568,_0x35a568['linkedid'],_0x35a568[_0x35fc('0x141')]);}}else if(_0xcf2163&&_[_0x35fc('0x69')](_0xcf2163[_0x35fc('0x142')])&&_0x324c56[_0x35fc('0x143')]&&_0x35a568[_0x35fc('0xa6')]===_0x35a568[_0x35fc('0xab')]&&_[_0x35fc('0x69')](_0x35a568[_0x35fc('0xec')])&&_0x35a568[_0x35fc('0x141')]==='16'&&_0x35a568['channelstate']==='6'&&_['isUndefined'](_0xcf2163[_0x35fc('0x144')])){if(_0xcf2163[_0x35fc('0xa4')]){rpcDb[_0x35fc('0x10a')](_0xcf2163[_0x35fc('0x13a')]);}if(_0xcf2163[_0x35fc('0xa5')]){rpcDb[_0x35fc('0x13b')](_0xcf2163['idContact']);}_0x35a568[_0x35fc('0xec')]='22';this[_0x35fc('0xe9')](_0xcf2163,_0x324c56,_0x35a568);}else if(_0xcf2163&&_0xcf2163[_0x35fc('0x144')]){if(_0x35a568['cause']==='16'&&this['actions'][_0x35a568[_0x35fc('0xa6')]][_0x35fc('0x6f')]){logger[_0x35fc('0xbc')]('[syncHangup][talking][transfer]',_0x35a568[_0x35fc('0xa6')],_0x35a568[_0x35fc('0x141')],_0x35fc('0xac'),_0x324c56['name'],_0x35fc('0xad'),_0x324c56['pTalking']);this[_0x35fc('0x97')](_0x35a568,_0x35a568['linkedid'],_0x35a568[_0x35fc('0x141')]);}else if(this[_0x35fc('0x6a')][_0x35a568['linkedid']][_0x35fc('0x6f')]){logger[_0x35fc('0xbc')]('[syncHangup][talking][cause]',_0x35a568[_0x35fc('0xa6')],_0x35a568[_0x35fc('0x141')],_0x35fc('0xac'),_0x324c56[_0x35fc('0x52')],_0x35fc('0xad'),_0x324c56[_0x35fc('0x2b')]);this['callProgressDetectingCustomer'](_0x35a568,_0x35a568[_0x35fc('0xa6')],_0x35a568[_0x35fc('0x141')]);}}};Preview[_0x35fc('0xf')][_0x35fc('0x1d')]=function(_0x347c7d){if(this['actions'][_0x347c7d[_0x35fc('0x145')]]&&_0x347c7d[_0x35fc('0x145')]!==_0x347c7d[_0x35fc('0x146')]){this[_0x35fc('0x97')](_0x347c7d,_0x347c7d[_0x35fc('0x145')],_0x347c7d[_0x35fc('0xdd')]);}};Preview[_0x35fc('0xf')][_0x35fc('0x1a')]=function(_0x46c67e){if(this['actions'][_0x46c67e[_0x35fc('0xa6')]]&&_0x46c67e[_0x35fc('0xa6')]!==_0x46c67e[_0x35fc('0xab')]&&!this['actions'][_0x46c67e[_0x35fc('0xa6')]]['dialAnswer']){if(_0x46c67e[_0x35fc('0x141')]==='1'){this[_0x35fc('0x97')](_0x46c67e,_0x46c67e['linkedid'],_0x46c67e[_0x35fc('0x141')]);}}};Preview[_0x35fc('0xf')][_0x35fc('0x147')]=function(_0x256958,_0x39faae,_0x14266f){if(this[_0x35fc('0x6a')][_0x256958]){if(_['isNil'](this[_0x35fc('0x6a')][_0x256958][_0x35fc('0x148')])){this[_0x35fc('0x6a')][_0x256958]['variables']={};}this['actions'][_0x256958][_0x35fc('0x148')][_0x39faae]=_0x14266f;}};Preview[_0x35fc('0xf')][_0x35fc('0x1f')]=function(_0x3b6fcc){try{if(!_[_0x35fc('0x69')](_0x3b6fcc)){if(ut[_0x35fc('0x149')](_[_0x35fc('0x14a')](_0x3b6fcc[_0x35fc('0x14b')])[0x0])){this[_0x35fc('0x147')](_0x3b6fcc[_0x35fc('0xab')],_[_0x35fc('0x14a')](_0x3b6fcc[_0x35fc('0x14b')])[0x0],_0x3b6fcc[_0x35fc('0x14c')]);}}}catch(_0x3c5524){logger[_0x35fc('0x14d')](_0x35fc('0x14e'),util[_0x35fc('0x14f')](_0x3c5524,{'showHidden':![],'depth':null}));}};Preview[_0x35fc('0xf')][_0x35fc('0x150')]=function(_0x4aec92){if(_0x4aec92){if(this[_0x35fc('0x6a')][_0x4aec92['transfertargetlinkedid']]){this['actions'][_0x4aec92[_0x35fc('0x151')]][_0x35fc('0x144')]=!![];}}};Preview[_0x35fc('0xf')][_0x35fc('0x22')]=function(_0x3b8560){if(_0x3b8560){if(this[_0x35fc('0x6a')][_0x3b8560[_0x35fc('0x152')]]){this[_0x35fc('0x6a')][_0x3b8560[_0x35fc('0x152')]][_0x35fc('0x144')]=!![];}}};module[_0x35fc('0x153')]=Preview;
\ No newline at end of file
+var _0x81bd=['[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','pick','unlock','unlockContact','execRun','getContactPreview','recallme','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','response','custom:agentringnoanswer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','../ami','./rpcDb','./action','defaults','localhost','socket.io-emitter','redis','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','name','active','callerid','Interval','stringify','voice:queue:%s','info','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','booked','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','agentReadyId','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','catch','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','ANSWER','responsetime','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]'];(function(_0x3a40b1,_0x3125f9){var _0x2a3376=function(_0x49769a){while(--_0x49769a){_0x3a40b1['push'](_0x3a40b1['shift']());}};_0x2a3376(++_0x3125f9);}(_0x81bd,0x7c));var _0xd81b=function(_0x55b86a,_0x9f9772){_0x55b86a=_0x55b86a-0x0;var _0x46f950=_0x81bd[_0x55b86a];return _0x46f950;};'use strict';var util=require(_0xd81b('0x0'));var _=require(_0xd81b('0x1'));var BPromise=require(_0xd81b('0x2'));var uuid=require(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var md5=require(_0xd81b('0x5'));var Redis=require(_0xd81b('0x6'));var config=require('../../../config/environment');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var loggerAction=require(_0xd81b('0x7'))('actionPreview');var ami=require(_0xd81b('0x9'));var rpcDb=require(_0xd81b('0xa'));var Action=require(_0xd81b('0xb'));var ut=require('./util/util');config['redis']=_[_0xd81b('0xc')](config['redis'],{'host':_0xd81b('0xd'),'port':0x18eb});var io=require(_0xd81b('0xe'))(new Redis(config[_0xd81b('0xf')]));var Sequence=function(){};Sequence[_0xd81b('0x10')][_0xd81b('0x11')]=function(_0x1ff60f){this[_0xd81b('0x12')]=this[_0xd81b('0x12')]?this[_0xd81b('0x12')][_0xd81b('0x13')](_0x1ff60f):_0x1ff60f();};function Preview(_0x215b92){this[_0xd81b('0x14')]=new Sequence();this[_0xd81b('0x15')]=_0x215b92['voiceQueues'];this[_0xd81b('0x16')]=_0x215b92['trunks'];this[_0xd81b('0x17')]={};this[_0xd81b('0x18')]=_0x215b92['agents'];this[_0xd81b('0x19')]=0x0;ami['on']('originateresponse',this[_0xd81b('0x1a')][_0xd81b('0x1b')](this));ami['on'](_0xd81b('0x1c'),this[_0xd81b('0x1d')][_0xd81b('0x1b')](this));ami['on']('hanguprequest',this[_0xd81b('0x1e')][_0xd81b('0x1b')](this));ami['on']('dialend',this[_0xd81b('0x1f')][_0xd81b('0x1b')](this));ami['on'](_0xd81b('0x20'),this[_0xd81b('0x21')][_0xd81b('0x1b')](this));ami['on'](_0xd81b('0x22'),this[_0xd81b('0x23')][_0xd81b('0x1b')](this));ami['on'](_0xd81b('0x24'),this[_0xd81b('0x25')][_0xd81b('0x1b')](this));ami['on'](_0xd81b('0x26'),this[_0xd81b('0x27')][_0xd81b('0x1b')](this));this[_0xd81b('0x28')](this[_0xd81b('0x15')]);}function emit(_0x5f101a,_0x4d566e,_0xc16ad0){io['to'](_0x5f101a)[_0xd81b('0x29')](_0x4d566e,_0xc16ad0);}function emitCampaignPreview(_0x34afe6){if(_0x34afe6['type']===_0xd81b('0x2a')){var _0x6571a6={'id':_0x34afe6['id'],'name':_0x34afe6['name'],'strategy':_0x34afe6[_0xd81b('0x2b')],'answered':_0x34afe6[_0xd81b('0x2c')],'available':_0x34afe6[_0xd81b('0x2d')],'loggedIn':_0x34afe6[_0xd81b('0x2e')],'pTalking':_0x34afe6[_0xd81b('0x2f')],'sumBillable':_0x34afe6[_0xd81b('0x30')],'sumDuration':_0x34afe6[_0xd81b('0x31')],'sumHoldTime':_0x34afe6[_0xd81b('0x32')]||0x0,'talking':_0x34afe6[_0xd81b('0x33')],'total':_0x34afe6[_0xd81b('0x34')],'type':_0x34afe6[_0xd81b('0x35')],'unmanaged':_0x34afe6[_0xd81b('0x36')],'abandoned':_0x34afe6['abandoned'],'waiting':_0x34afe6[_0xd81b('0x37')],'loggedInDb':_0x34afe6[_0xd81b('0x38')],'dialActive':_0x34afe6[_0xd81b('0x39')],'dialMethod':_0x34afe6[_0xd81b('0x3a')],'dialOriginateCallerIdName':_0x34afe6[_0xd81b('0x3b')],'dialOriginateCallerIdNumber':_0x34afe6[_0xd81b('0x3c')],'dialOriginateTimeout':_0x34afe6[_0xd81b('0x3d')],'dialPrefix':_0x34afe6[_0xd81b('0x3e')],'outboundAnswerAgiCallsDay':_0x34afe6[_0xd81b('0x3f')],'outboundAnswerCallsDay':_0x34afe6['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x34afe6[_0xd81b('0x40')],'outboundBusyCallsDay':_0x34afe6['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x34afe6['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x34afe6[_0xd81b('0x41')],'outboundDropCallsDayCallersExit':_0x34afe6[_0xd81b('0x42')],'outboundDropCallsDayTimeout':_0x34afe6['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x34afe6['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x34afe6[_0xd81b('0x43')],'outboundOriginateFailureCallsDay':_0x34afe6[_0xd81b('0x44')],'outboundReCallsDay':_0x34afe6[_0xd81b('0x45')],'outboundRejectCallsDay':_0x34afe6[_0xd81b('0x46')],'outboundUnknownCallsDay':_0x34afe6[_0xd81b('0x47')],'outboundAbandonedCallsDay':_0x34afe6[_0xd81b('0x48')],'predictiveIntervalAnsweredCalls':_0x34afe6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x34afe6[_0xd81b('0x49')],'predictiveIntervalAvgTalktime':_0x34afe6[_0xd81b('0x4a')],'predictiveIntervalDroppedCallsCallersExit':_0x34afe6['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x34afe6['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x34afe6[_0xd81b('0x4b')],'predictiveIntervalErlangCallsDroppedCalls':_0x34afe6[_0xd81b('0x4c')],'predictiveIntervalHitRate':_0x34afe6['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x34afe6['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x34afe6['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x34afe6[_0xd81b('0x4d')],'predictiveIntervalTotalCalls':_0x34afe6[_0xd81b('0x4e')],'message':_0x34afe6[_0xd81b('0x4f')],'originated':_0x34afe6[_0xd81b('0x50')],'erlangCalls':_0x34afe6[_0xd81b('0x51')],'erlangCallToSecond':_0x34afe6[_0xd81b('0x52')],'erlangAbandonmentRate':_0x34afe6[_0xd81b('0x53')],'erlangBusyFactor':_0x34afe6['erlangBusyFactor'],'startPredictive':_0x34afe6[_0xd81b('0x54')],'startProgressive':_0x34afe6['startProgressive']};if(_0x34afe6[_0xd81b('0x55')]){_0x6571a6[_0xd81b('0x55')]={'id':_0x34afe6[_0xd81b('0x55')]['id'],'name':_0x34afe6[_0xd81b('0x55')][_0xd81b('0x56')],'active':_0x34afe6[_0xd81b('0x55')][_0xd81b('0x57')],'callerid':_0x34afe6[_0xd81b('0x55')][_0xd81b('0x58')]};}if(_0x34afe6[_0xd81b('0x59')]){_0x6571a6[_0xd81b('0x59')]={'id':_0x34afe6[_0xd81b('0x59')]['id'],'name':_0x34afe6[_0xd81b('0x59')]['name']};}var _0x49deb8=md5(JSON[_0xd81b('0x5a')](_0x6571a6));if(_0x34afe6[_0xd81b('0x5')]!==_0x49deb8){_0x34afe6[_0xd81b('0x5')]=_0x49deb8;emit(util['format'](_0xd81b('0x5b'),_0x6571a6[_0xd81b('0x56')]),'voice_queue:save',_0x6571a6);}}}function emitVoiceQueueChannelRemove(_0x46f058){logger[_0xd81b('0x5c')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd81b('0x5a')](_0x46f058));emit(util['format'](_0xd81b('0x5b'),_0x46f058[_0xd81b('0x56')]),_0xd81b('0x5d'),_0x46f058);io[_0xd81b('0x29')]('voice_queue_presence:remove',_0x46f058);}function notSendMessagesQueue(_0x77bec8){if(_0x77bec8[_0xd81b('0x5e')]){if(_0x77bec8[_0xd81b('0x50')]===0x0&&_0x77bec8[_0xd81b('0x2f')]===0x0){_0x77bec8[_0xd81b('0x5e')]=![];_0x77bec8[_0xd81b('0x2d')]=0x0;_0x77bec8[_0xd81b('0x5f')]=0x0;_0x77bec8['message']=_0xd81b('0x60');ut[_0xd81b('0x61')](_0xd81b('0x62'),_0x77bec8['name']+_0xd81b('0x63'));}else{_0x77bec8[_0xd81b('0x4f')]=_0xd81b('0x64');ut[_0xd81b('0x61')](_0xd81b('0x62'),_0x77bec8['name']+_0xd81b('0x65'));}emitCampaignPreview(_0x77bec8);}}Preview[_0xd81b('0x10')][_0xd81b('0x28')]=function(){var _0x43ea38=this;setInterval(function(){_0x43ea38[_0xd81b('0x66')]();},0x7cf);};Preview[_0xd81b('0x10')][_0xd81b('0x66')]=function(){var _0x486f0d=this[_0xd81b('0x15')];this[_0xd81b('0x19')]+=0x1;for(var _0x1e3690 in _0x486f0d){if(_0x486f0d['hasOwnProperty'](_0x1e3690)&&(_0x486f0d[_0x1e3690][_0xd81b('0x3a')]===_0xd81b('0x8')||_0x486f0d[_0x1e3690][_0xd81b('0x3a')]===_0xd81b('0x67'))&&_0x486f0d[_0x1e3690][_0xd81b('0x35')]===_0xd81b('0x2a')){if(this[_0xd81b('0x19')]>0x7){this[_0xd81b('0x19')]=0x0;this['clearZombieChannels']();}}if(_0x486f0d['hasOwnProperty'](_0x1e3690)&&_0x486f0d[_0x1e3690][_0xd81b('0x3a')]===_0xd81b('0x8')&&_0x486f0d[_0x1e3690][_0xd81b('0x35')]===_0xd81b('0x2a')){if(_0x486f0d[_0x1e3690][_0xd81b('0x39')]){this[_0xd81b('0x68')](_0x486f0d[_0x1e3690]);if(_0x486f0d[_0x1e3690][_0xd81b('0x69')])this[_0xd81b('0x6a')](_0x486f0d[_0x1e3690]);}else{notSendMessagesQueue(_0x486f0d[_0x1e3690]);}}}};Preview[_0xd81b('0x10')][_0xd81b('0x6b')]=function(_0x41e2e6){var _0x38e436=this;this['sequence'][_0xd81b('0x11')](function(){if(!_[_0xd81b('0x6c')](_0x38e436[_0xd81b('0x17')][_0x41e2e6])){loggerAction[_0xd81b('0x5c')](_0xd81b('0x6d'),_0x41e2e6,_0xd81b('0x6e'),_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x6f')],_0xd81b('0x70'),JSON['stringify'](_0x38e436[_0xd81b('0x15')][_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x6f')]][_0xd81b('0x50')]),'pTalking:\x20',JSON[_0xd81b('0x5a')](_0x38e436[_0xd81b('0x15')][_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x6f')]][_0xd81b('0x2f')]),JSON[_0xd81b('0x5a')](_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x71')]),JSON[_0xd81b('0x5a')](_['pick'](_0x38e436['actions'][_0x41e2e6],[_0xd81b('0x72'),_0xd81b('0x73'),_0xd81b('0x74'),_0xd81b('0x75')])));return ami[_0xd81b('0x76')]({'action':_0xd81b('0x77'),'channel':_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x78')]})['catch'](function(_0x2db83b){if(_0x2db83b[_0xd81b('0x4f')]===_0xd81b('0x79')){setTimeout(function(){if(_0x38e436[_0xd81b('0x17')][_0x41e2e6]){ut[_0xd81b('0x7a')](_0x38e436['campaignsPreview'][_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x6f')]],'[clearZombieChannel]');if(_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x71')]===!![]){ut[_0xd81b('0x7b')](_0x38e436[_0xd81b('0x15')][_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x6f')]],_0xd81b('0x7c'));ut[_0xd81b('0x7d')](_0xd81b('0x7e')+_0x41e2e6,_0x38e436[_0xd81b('0x17')][_0x41e2e6][_0xd81b('0x6f')]);}ut['loggerError'](_0xd81b('0x7f')+_0x41e2e6,_0x38e436['actions'][_0x41e2e6][_0xd81b('0x6f')]);delete _0x38e436[_0xd81b('0x17')][_0x41e2e6];}},0x2328);}});}});};Preview[_0xd81b('0x10')][_0xd81b('0x80')]=function(){var _0x34d2a2=this;loggerAction[_0xd81b('0x5c')]('[action]',_[_0xd81b('0x81')](this[_0xd81b('0x17')]));for(var _0x51f5a1 in this['actions']){if(_0x34d2a2[_0xd81b('0x17')]['hasOwnProperty'](_0x51f5a1)){_0x34d2a2[_0xd81b('0x6b')](_0x51f5a1);}}};Preview['prototype'][_0xd81b('0x6a')]=function(_0x315a66){var _0x3d97ba=this;rpcDb['getContactRecallMe'](_0x315a66['id'],ut[_0xd81b('0x82')](this[_0xd81b('0x18')]))['then'](function(_0x3ea4d5){if(!_[_0xd81b('0x6c')](_0x3ea4d5)){for(var _0x5951ec=0x0;_0x5951ec<_0x3ea4d5[_0xd81b('0x83')];_0x5951ec+=0x1){if(ut['getDiff'](_0x3ea4d5[_0x5951ec][_0xd81b('0x84')])<_0x315a66[_0xd81b('0x85')]*0x3c){if(_0x3ea4d5[_0x5951ec][_0xd81b('0x86')]&&!_0x3ea4d5[_0x5951ec][_0xd81b('0x86')][_0xd81b('0x87')]){_0x3d97ba[_0xd81b('0x88')](_0x3ea4d5[_0x5951ec]['id'])[_0xd81b('0x89')](ut[_0xd81b('0x8a')](_0xd81b('0x8b')))[_0xd81b('0x8c')](ut['logger2'](_0xd81b('0x8b')));}else{rpcDb[_0xd81b('0x8d')](_0x3ea4d5[_0x5951ec]['id']);}}else{var _0x385841=new Action(_0x3ea4d5[_0x5951ec],_0x315a66);_0x385841[_0xd81b('0x8e')]=moment()[_0xd81b('0x8f')](_0xd81b('0x90'));_0x315a66[_0xd81b('0x45')]+=0x1;ut['logCustomer'](_0x385841,0x17,'RecallInQueue');if(_0x315a66['dialRecallInQueue']){rpcDb[_0xd81b('0x91')](ut[_0xd81b('0x92')](_0x3ea4d5[_0x5951ec]));rpcDb[_0xd81b('0x93')](_0x385841,_0xd81b('0x94'));}else{ut[_0xd81b('0x95')](_0x385841,0x16,_0xd81b('0x96'));rpcDb[_0xd81b('0x93')](_0x385841,'[HistoryRecallClose]');rpcDb[_0xd81b('0x97')](_0x385841,_0xd81b('0x98'));}}}}})[_0xd81b('0x8c')](ut[_0xd81b('0x8a')](_0xd81b('0x99')));};Preview[_0xd81b('0x10')][_0xd81b('0x68')]=function(_0x4ed17d){_0x4ed17d[_0xd81b('0x5e')]=!![];if(ut[_0xd81b('0x9a')](_0x4ed17d[_0xd81b('0x2e')])){_0x4ed17d[_0xd81b('0x4f')]=_0xd81b('0x9b');}else if(!ut[_0xd81b('0x9c')](_0x4ed17d[_0xd81b('0x39')])){_0x4ed17d[_0xd81b('0x4f')]=_0xd81b('0x60');}else if(!this[_0xd81b('0x9d')](_0x4ed17d[_0xd81b('0x55')])){if(!this[_0xd81b('0x9d')](_0x4ed17d['TrunkBackup'])){_0x4ed17d[_0xd81b('0x4f')]='TRUNK_IS_NOT_REACHABLE';}else{_0x4ed17d[_0xd81b('0x4f')]=_0xd81b('0x9e');}}else{_0x4ed17d[_0xd81b('0x4f')]=_0xd81b('0x9e');}emitCampaignPreview(_0x4ed17d);};Preview[_0xd81b('0x10')][_0xd81b('0x9f')]=function(_0x336d9c,_0x18f2ac,_0x10d6d2){var _0x36fb7a=this;var _0x5bcfd7=this[_0xd81b('0x17')][_0x18f2ac];var _0x344c32=this[_0xd81b('0x15')][_0x5bcfd7[_0xd81b('0x6f')]];var _0x7720d3;if(_0x344c32){switch(_0x10d6d2){case'1':_0x344c32['outboundNoSuchCallsDay']+=0x1;_0x5bcfd7['countnosuchnumberretry']+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut[_0xd81b('0xa1')](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0x0,_0xd81b('0xa2'));ami[_0xd81b('0x29')](_0xd81b('0xa3'),ut[_0xd81b('0xa4')](_0x5bcfd7,'nosuchnumber'));rpcDb[_0xd81b('0x93')](_0x5bcfd7,_0xd81b('0xa5'));if(ut[_0xd81b('0xa1')](_0x5bcfd7)>=_0x344c32[_0xd81b('0xa6')]){_0x7720d3=ut[_0xd81b('0xa7')](_0x5bcfd7,0xf,_0xd81b('0xa8'));rpcDb[_0xd81b('0x97')](_0x7720d3,_0xd81b('0xa9'));}else{if(_0x5bcfd7[_0xd81b('0xaa')]>=_0x344c32['dialNoSuchNumberMaxRetry']){rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xa9'));}else{rpcDb[_0xd81b('0xab')](ut[_0xd81b('0xac')](_0x5bcfd7,_0xd81b('0xaa'),_0x344c32['dialNoSuchNumberRetryFrequency']),_0x5bcfd7[_0xd81b('0xad')],_0x5bcfd7[_0xd81b('0xae')]);}}delete this['actions'][_0x336d9c[_0xd81b('0xaf')]];break;case _0xd81b('0xb0'):var _0x490ab9=moment()[_0xd81b('0x8f')](_0xd81b('0x90'));_0x5bcfd7[_0xd81b('0xb1')]=_0x490ab9;_0x5bcfd7['answertime']=_0x490ab9;_0x5bcfd7[_0xd81b('0x71')]=!![];_0x344c32[_0xd81b('0x2f')]+=0x1;logger[_0xd81b('0x5c')]('[syncHangup][talking][increment]',_0x5bcfd7['uniqueid'],_0xd81b('0xb2'),_0x344c32[_0xd81b('0x56')],_0xd81b('0xb3'),_0x344c32['pTalking']);ami[_0xd81b('0x29')](_0xd81b('0xb4'),ut[_0xd81b('0xa4')](_0x5bcfd7,_0xd81b('0xb5'),this['campaignsPreview'][_0x5bcfd7['queue']]));if(_0x344c32[_0xd81b('0xb6')]){ami[_0xd81b('0x29')](_0xd81b('0xb7'),ut[_0xd81b('0xb8')](_0x5bcfd7));}break;case'16':ami['emit'](_0xd81b('0xb9'),ut[_0xd81b('0xa4')](_0x5bcfd7,'complete',this[_0xd81b('0x15')][_0x5bcfd7['queue']]));emitVoiceQueueChannelRemove(ut[_0xd81b('0xa4')](_0x5bcfd7,_0xd81b('0xba')));_0x344c32['outboundAnswerCallsDay']+=0x1;_0x344c32[_0xd81b('0x34')]+=0x1;_0x344c32[_0xd81b('0x2c')]+=0x1;ut[_0xd81b('0x7b')](_0x344c32,_0xd81b('0xbb'));_0x5bcfd7[_0xd81b('0xa0')]=ut['totalGlobal'](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0x4,_0xd81b('0xbc'));rpcDb[_0xd81b('0x93')](_0x5bcfd7,_0xd81b('0xbd'));rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xbe'));rpcDb['crateCustomerReportQueue'](_0x5bcfd7);_0x344c32['sumDuration']+=_0x5bcfd7[_0xd81b('0xbf')];_0x344c32[_0xd81b('0x30')]+=_0x5bcfd7[_0xd81b('0xbf')];logger[_0xd81b('0x5c')]('[syncHangup][talking][decrement]',_0x5bcfd7[_0xd81b('0xc0')],_0xd81b('0xb2'),_0x344c32[_0xd81b('0x56')],_0xd81b('0xb3'),_0x344c32[_0xd81b('0x2f')]);delete this['actions'][_0x336d9c[_0xd81b('0xaf')]];break;case _0xd81b('0xc1'):_0x344c32[_0xd81b('0xc2')]+=0x1;_0x5bcfd7[_0xd81b('0xc3')]+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut[_0xd81b('0xa1')](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0x5,'Busy');ami[_0xd81b('0x29')](_0xd81b('0xc4'),ut[_0xd81b('0xa4')](_0x5bcfd7,_0xd81b('0xc5')));rpcDb[_0xd81b('0x93')](_0x5bcfd7,_0xd81b('0xc6'));if(ut['totalGlobal'](_0x5bcfd7)>=_0x344c32[_0xd81b('0xa6')]){_0x7720d3=ut['cloneAction'](_0x5bcfd7,0xf,_0xd81b('0xa8'));rpcDb[_0xd81b('0x97')](_0x7720d3,_0xd81b('0xc7'));}else{if(_0x5bcfd7['countbusyretry']>=_0x344c32[_0xd81b('0xc8')]){rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xc6'));}else{rpcDb[_0xd81b('0xab')](ut[_0xd81b('0xac')](_0x5bcfd7,_0xd81b('0xc3'),_0x344c32['dialBusyRetryFrequency']),_0x5bcfd7[_0xd81b('0xad')],_0x5bcfd7['activeContact']);}}break;case'NOANSWER':_0x344c32[_0xd81b('0xc9')]+=0x1;_0x5bcfd7[_0xd81b('0xca')]+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut['totalGlobal'](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0x3,_0xd81b('0xcb'));ami[_0xd81b('0x29')](_0xd81b('0xcc'),ut[_0xd81b('0xa4')](_0x5bcfd7,_0xd81b('0xcd')));rpcDb['createCustomerHistory'](_0x5bcfd7,_0xd81b('0xce'));if(ut[_0xd81b('0xa1')](_0x5bcfd7)>=_0x344c32[_0xd81b('0xa6')]){_0x7720d3=ut[_0xd81b('0xa7')](_0x5bcfd7,0xf,_0xd81b('0xa8'));rpcDb[_0xd81b('0x97')](_0x7720d3,_0xd81b('0xcf'));}else{if(_0x5bcfd7[_0xd81b('0xca')]>=_0x344c32[_0xd81b('0xd0')]){rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xce'));}else{rpcDb[_0xd81b('0xab')](ut[_0xd81b('0xac')](_0x5bcfd7,_0xd81b('0xca'),_0x344c32[_0xd81b('0xd1')]),_0x5bcfd7['unlockAgent'],_0x5bcfd7[_0xd81b('0xae')]);}}break;case'CONGESTION':_0x344c32[_0xd81b('0xd2')]+=0x1;_0x5bcfd7[_0xd81b('0xd3')]+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut[_0xd81b('0xa1')](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0x8,_0xd81b('0xd4'));ami['emit'](_0xd81b('0xd5'),ut[_0xd81b('0xa4')](_0x5bcfd7,_0xd81b('0xd6')));rpcDb[_0xd81b('0x93')](_0x5bcfd7,_0xd81b('0xd7'));if(ut[_0xd81b('0xa1')](_0x5bcfd7)>=_0x344c32[_0xd81b('0xa6')]){_0x7720d3=ut[_0xd81b('0xa7')](_0x5bcfd7,0xf,_0xd81b('0xa8'));rpcDb[_0xd81b('0x97')](_0x7720d3,_0xd81b('0xd8'));}else{if(_0x5bcfd7[_0xd81b('0xd3')]>=_0x344c32['dialCongestionMaxRetry']){rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xd7'));}else{rpcDb[_0xd81b('0xab')](ut[_0xd81b('0xac')](_0x5bcfd7,_0xd81b('0xd3'),_0x344c32['dialBusyRetryFrequency']),_0x5bcfd7[_0xd81b('0xad')],_0x5bcfd7[_0xd81b('0xae')]);}}break;case _0xd81b('0xd9'):_0x344c32[_0xd81b('0x46')]+=0x1;_0x5bcfd7[_0xd81b('0xda')]+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut['totalGlobal'](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0x14,'AgentReject');ami[_0xd81b('0x29')](_0xd81b('0xdb'),ut[_0xd81b('0xa4')](_0x5bcfd7,_0xd81b('0xdc')));rpcDb['createCustomerHistory'](_0x5bcfd7,_0xd81b('0xdd'));if(ut[_0xd81b('0xa1')](_0x5bcfd7)>=_0x344c32['dialGlobalMaxRetry']){_0x7720d3=ut[_0xd81b('0xa7')](_0x5bcfd7,0x14,_0xd81b('0xde'));rpcDb[_0xd81b('0x97')](_0x7720d3,_0xd81b('0xdf'));}else{if(_0x5bcfd7[_0xd81b('0xda')]>=_0x344c32['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x5bcfd7,_0xd81b('0xdf'));}else{rpcDb['rescheduleContact'](ut[_0xd81b('0xac')](_0x5bcfd7,'countagentrejectretry',_0x344c32['dialAgentRejectRetryFrequency']),_0x5bcfd7[_0xd81b('0xad')],_0x5bcfd7[_0xd81b('0xae')]);}}break;case'ABANDONED':_0x344c32['outboundAbandonedCallsDay']+=0x1;_0x5bcfd7[_0xd81b('0xe0')]+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut['totalGlobal'](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0xb,_0xd81b('0xe1'));rpcDb[_0xd81b('0x93')](_0x5bcfd7,_0xd81b('0xe2'));if(ut['totalGlobal'](_0x5bcfd7)>=_0x344c32[_0xd81b('0xa6')]){_0x7720d3=ut[_0xd81b('0xa7')](_0x5bcfd7,0xf,_0xd81b('0xa8'));rpcDb['createCustomerFinal'](_0x7720d3,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x5bcfd7[_0xd81b('0xe3')]>=_0x344c32[_0xd81b('0xe4')]){rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xe2'));}else{rpcDb[_0xd81b('0xab')](ut['scheduledAt'](_0x5bcfd7,'countabandonedretry',_0x344c32[_0xd81b('0xe5')]),_0x5bcfd7[_0xd81b('0xad')],_0x5bcfd7['activeContact']);}}break;case'18':_0x344c32['outboundUnknownCallsDay']+=0x1;_0x5bcfd7[_0xd81b('0xe6')]+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut[_0xd81b('0xa1')](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0x12,_0x336d9c[_0xd81b('0xe7')]||_0x336d9c[_0xd81b('0xe8')]);ami[_0xd81b('0x29')](_0xd81b('0xe9'),ut[_0xd81b('0xa4')](_0x5bcfd7,_0xd81b('0xea')));rpcDb['createCustomerHistory'](_0x5bcfd7,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xd81b('0xa1')](_0x5bcfd7)>=_0x344c32[_0xd81b('0xa6')]){_0x7720d3=ut[_0xd81b('0xa7')](_0x5bcfd7,0xf,_0xd81b('0xa8'));rpcDb[_0xd81b('0x97')](_0x7720d3,_0xd81b('0xeb'));}else{rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xeb'));}delete this[_0xd81b('0x17')][_0x336d9c[_0xd81b('0xaf')]];break;case'19':_0x344c32[_0xd81b('0x47')]+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut[_0xd81b('0xa1')](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0x13,_0x336d9c[_0xd81b('0xe7')]||_0x336d9c['dialstatus']);ami[_0xd81b('0x29')](_0xd81b('0xe9'),ut[_0xd81b('0xa4')](_0x5bcfd7,'amd'));rpcDb[_0xd81b('0x93')](_0x5bcfd7,_0xd81b('0xec'));if(ut[_0xd81b('0xa1')](_0x5bcfd7)>=_0x344c32[_0xd81b('0xa6')]){_0x7720d3=ut[_0xd81b('0xa7')](_0x5bcfd7,0xf,'Global');rpcDb[_0xd81b('0x97')](_0x7720d3,_0xd81b('0xec'));}else{rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xec'));}delete this[_0xd81b('0x17')][_0x336d9c[_0xd81b('0xaf')]];break;default:if(_0x5bcfd7[_0xd81b('0x71')]){ut[_0xd81b('0x7b')](_0x344c32,_0xd81b('0xed'));ut[_0xd81b('0x7d')](_0xd81b('0xee')+_0x344c32[_0xd81b('0x56')],_0x336d9c);}_0x344c32['outboundUnknownCallsDay']+=0x1;_0x5bcfd7[_0xd81b('0xa0')]=ut[_0xd81b('0xa1')](_0x5bcfd7);ut[_0xd81b('0x95')](_0x5bcfd7,0xc,_0x336d9c['cause-txt']||_0x336d9c[_0xd81b('0xe8')]);rpcDb[_0xd81b('0x93')](_0x5bcfd7,_0xd81b('0xef'));if(ut[_0xd81b('0xa1')](_0x5bcfd7)>=_0x344c32['dialGlobalMaxRetry']){_0x7720d3=ut[_0xd81b('0xa7')](_0x5bcfd7,0xf,'Global');rpcDb['createCustomerFinal'](_0x7720d3,_0xd81b('0xf0'));}else{rpcDb[_0xd81b('0x97')](_0x5bcfd7,_0xd81b('0xf0'));}delete this[_0xd81b('0x17')][_0x336d9c['linkedid']];}if(!(_0x5bcfd7['dialAnswer']&&_0x10d6d2==='16')){ut['updateOriginated'](_0x344c32,_0xd81b('0xf1'));logger[_0xd81b('0x5c')](_0xd81b('0xf2'),_0x5bcfd7[_0xd81b('0xc0')],_0xd81b('0xb2'),_0x344c32[_0xd81b('0x56')],_0xd81b('0x70'),_0x344c32[_0xd81b('0x50')]);}if(_0x10d6d2!==_0xd81b('0xb0')){delete this[_0xd81b('0x17')][_0x336d9c[_0xd81b('0xaf')]];delete this[_0xd81b('0x17')][_0x336d9c[_0xd81b('0xf3')]];}}};Preview[_0xd81b('0x10')][_0xd81b('0xf4')]=function(_0x3c4589,_0x14c4c1,_0x28af19){if(_[_0xd81b('0xf5')](_0x14c4c1)&&_0xd81b('0xf6')!==typeof _0x14c4c1){return;}if(_['isUndefined'](_0x28af19)&&_0xd81b('0xf6')!==typeof _0x28af19){return;}switch(_0x28af19[_0xd81b('0xf7')]){case'0':ut[_0xd81b('0xf8')](_0x3c4589,0x0,_0xd81b('0xa2'));rpcDb[_0xd81b('0xf9')](_0x3c4589,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xd81b('0xf8')](_0x3c4589,0x3,_0xd81b('0xcb'));rpcDb['createAgentHistory'](_0x3c4589,_0xd81b('0xfa'));break;case'5':ut[_0xd81b('0xf8')](_0x3c4589,0x5,_0xd81b('0xfb'));rpcDb[_0xd81b('0xf9')](_0x3c4589,_0xd81b('0xfc'));break;case'8':ut[_0xd81b('0xf8')](_0x3c4589,0x8,_0xd81b('0xd4'));rpcDb[_0xd81b('0xf9')](_0x3c4589,_0xd81b('0xfd'));break;case'22':ut[_0xd81b('0xf8')](_0x3c4589,0x16,_0xd81b('0xfe'));rpcDb[_0xd81b('0xf9')](_0x3c4589,_0xd81b('0xff'));break;default:ut[_0xd81b('0xf8')](_0x3c4589,0xc,_0x28af19['reason']);rpcDb[_0xd81b('0xf9')](_0x3c4589,'[callProgressDetectingAgent][logCongestion]');}ut[_0xd81b('0x7a')](_0x14c4c1,_0xd81b('0x100'));logger[_0xd81b('0x5c')]('[originated][decrement][callProgressDetectingAgent]',_0x3c4589[_0xd81b('0xc0')],_0xd81b('0xb2'),_0x14c4c1[_0xd81b('0x56')],_0xd81b('0x70'),_0x14c4c1['originated']);delete this[_0xd81b('0x17')][_0x3c4589[_0xd81b('0xc0')]];};Preview[_0xd81b('0x10')][_0xd81b('0x101')]=function(_0x441e6b,_0x2977fb,_0x1fb144,_0x55384e,_0x4dc5b1){var _0x2e48b5=this;return new BPromise(function(_0x1ff660,_0x1431b0){if(_['isNil'](_0x2977fb)||_[_0xd81b('0x6c')](_0x2977fb['Contact'])||_[_0xd81b('0x6c')](_0x2977fb[_0xd81b('0x102')][_0xd81b('0x103')])||_[_0xd81b('0x6c')](_0x2977fb[_0xd81b('0x74')])){_0x1431b0(ut[_0xd81b('0x4f')](_0xd81b('0x104'),_0x55384e,_0x4dc5b1));return;}var _0x429904=uuid['v4']();var _0x6211e3=_0x2e48b5['campaignsPreview'][_0x2977fb[_0xd81b('0x6e')][_0xd81b('0x56')]];var _0x14650e=_0x1fb144?_0x2e48b5['agents'][_0x1fb144]['id']:undefined;_0x2e48b5['actions'][_0x429904]=new Action(_0x2977fb,_0x6211e3,_0x429904,_0x1fb144,_0x14650e);var _0x4d44d7=_0x2e48b5[_0xd81b('0x17')][_0x429904];_0x4d44d7[_0xd81b('0xad')]=_0x55384e;_0x4d44d7[_0xd81b('0xae')]=_0x4dc5b1;_0x4d44d7[_0xd81b('0x105')]=_0x1fb144;if(_[_0xd81b('0x106')](_0x441e6b)){_0x2e48b5[_0xd81b('0x107')](_0x4d44d7,_0x6211e3,_0x2977fb,_0x1fb144)[_0xd81b('0x89')](function(_0x564aea){logger[_0xd81b('0x5c')](_0xd81b('0x108'),_0xd81b('0x109')+_0x4d44d7[_0xd81b('0x6f')]+'\x20IdHopper:\x20'+_0x4d44d7[_0xd81b('0x10a')],JSON['stringify'](_0x564aea));ami[_0xd81b('0x29')](_0xd81b('0x10b'),ut[_0xd81b('0xa4')](_0x4d44d7,'called',_0x2e48b5[_0xd81b('0x15')][_0x4d44d7[_0xd81b('0x6f')]]));_0x1ff660(ut['message'](_0xd81b('0x10c')));})['catch'](function(_0x19c6c4){ut[_0xd81b('0x61')](_0xd81b('0x10d'),_0x19c6c4);_0x1431b0(ut['message'](_0xd81b('0x10e'),_0x55384e,_0x4dc5b1));});}else{_0x6211e3[_0xd81b('0x40')]+=0x1;ut[_0xd81b('0x10f')](_0x4d44d7);rpcDb[_0xd81b('0x110')](_0x4d44d7,_0xd81b('0x111'));delete _0x2e48b5[_0xd81b('0x17')][_0x429904];_0x1431b0(ut['message'](_0xd81b('0x112'),_0x55384e,_0x4dc5b1));}});};Preview[_0xd81b('0x10')][_0xd81b('0x9d')]=function(_0x535de5){return!_[_0xd81b('0x6c')](_0x535de5)&&!_[_0xd81b('0x6c')](_0x535de5[_0xd81b('0x56')])&&!_[_0xd81b('0x6c')](_0x535de5[_0xd81b('0x57')])&&_0x535de5[_0xd81b('0x57')]&&!_[_0xd81b('0x6c')](this['trunks'][util['format']('SIP/%s',_0x535de5[_0xd81b('0x56')])])&&!_[_0xd81b('0x6c')](this['trunks'][util[_0xd81b('0x8f')]('SIP/%s',_0x535de5['name'])][_0xd81b('0x77')])&&(this[_0xd81b('0x16')][util[_0xd81b('0x8f')](_0xd81b('0x113'),_0x535de5[_0xd81b('0x56')])][_0xd81b('0x77')]===_0xd81b('0x114')||this[_0xd81b('0x16')][util[_0xd81b('0x8f')](_0xd81b('0x113'),_0x535de5[_0xd81b('0x56')])][_0xd81b('0x77')]===_0xd81b('0x115'));};Preview[_0xd81b('0x10')][_0xd81b('0x88')]=function(_0x501100,_0x442464){var _0x29e0f9=this;return new BPromise(function(_0x50863a,_0x2c18bf){_0x29e0f9['execRun'](_0x501100,_0x442464)[_0xd81b('0x89')](function(_0x531fde){_0x50863a(_[_0xd81b('0x116')](_0x531fde,[_0xd81b('0x4f')]));})[_0xd81b('0x8c')](function(_0x3d7330){if(_0x3d7330[_0xd81b('0x117')]){rpcDb[_0xd81b('0x118')](_0x501100);}if(_0x3d7330[_0xd81b('0x57')]){rpcDb[_0xd81b('0x8d')](_0x501100);}_0x2c18bf(_[_0xd81b('0x116')](_0x3d7330,[_0xd81b('0x4f')]));});});};Preview[_0xd81b('0x10')][_0xd81b('0x119')]=function(_0x5ab9e9,_0x8cda4b){var _0x12b97d=this;return new BPromise(function(_0x22dd20,_0x2ea321){var _0x305014,_0x2ea58f;rpcDb[_0xd81b('0x11a')](_0x5ab9e9)[_0xd81b('0x89')](function(_0x282942){if(!_[_0xd81b('0x6c')](_0x282942[0x0])){_0x2ea58f=_0x282942[0x0]['recallme']?![]:!![];_0x305014=_0x282942[0x0][_0xd81b('0x11b')]?!![]:![];_0x305014=_0x8cda4b?!![]:_0x305014;}var _0x141208=_0x12b97d['validateContact'](_0x282942);if(_0x141208[_0xd81b('0x11c')]){rpcDb['checkIsBlackList'](_[_0xd81b('0x116')](_0x282942[0x0],[_0xd81b('0x74'),'Contact.phone']))[_0xd81b('0x89')](function(_0x1ff8fa){_0x12b97d[_0xd81b('0x101')](_0x1ff8fa,_0x282942[0x0],_0x8cda4b,_0x2ea58f,_0x305014)[_0xd81b('0x89')](function(_0x4f1614){_0x22dd20(_0x4f1614);})[_0xd81b('0x8c')](function(_0x3a248d){_0x2ea321(_0x3a248d);});})[_0xd81b('0x8c')](function(_0x40fcf0){ut[_0xd81b('0x61')](_0xd81b('0x11d'),_0x40fcf0);_0x2ea321(ut['message'](_0xd81b('0x11e'),_0x2ea58f,_0x305014));});}else{_0x2ea321(ut[_0xd81b('0x4f')](_0x141208[_0xd81b('0x4f')],_0x2ea58f,_0x305014));}})['catch'](function(_0x4b1439){ut[_0xd81b('0x61')](_0xd81b('0x11f'),_0x4b1439);_0x2ea321(ut[_0xd81b('0x4f')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xd81b('0x10')][_0xd81b('0x120')]=function(_0x3458f9){if(_[_0xd81b('0x6c')](_0x3458f9)||_[_0xd81b('0x106')](_0x3458f9)||!_[_0xd81b('0x6c')](_0x3458f9[0x0]['Agent'])&&_[_0xd81b('0x6c')](_0x3458f9[0x0][_0xd81b('0x86')]['name'])){ut[_0xd81b('0x61')](_0xd81b('0x121'),_0x3458f9);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x36dd5e=this[_0xd81b('0x15')][_0x3458f9[0x0][_0xd81b('0x6e')][_0xd81b('0x56')]];_0x36dd5e[_0xd81b('0x4f')]=_0xd81b('0x9e');if(_[_0xd81b('0x6c')](_0x36dd5e)){ut['logger'](_0xd81b('0x122'),_0x36dd5e);return{'isValid':![],'message':_0xd81b('0x123')};}if(!this['isTrunkReachable'](_0x36dd5e[_0xd81b('0x55')])){ut[_0xd81b('0x61')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xd81b('0x124')+_0x36dd5e[_0xd81b('0x56')]+_0xd81b('0x125'));if(!this[_0xd81b('0x9d')](_0x36dd5e[_0xd81b('0x126')])){ut['logger'](_0xd81b('0x127'),_0x36dd5e[_0xd81b('0x56')]+_0xd81b('0x128'));return{'isValid':![],'message':_0xd81b('0x129')};}}if(!ut[_0xd81b('0x9c')](_0x36dd5e[_0xd81b('0x39')])){ut[_0xd81b('0x61')](_0xd81b('0x12a'),_0x36dd5e[_0xd81b('0x56')]+_0xd81b('0x12b'));return{'isValid':![],'message':_0xd81b('0x124')+_0x36dd5e['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xd81b('0x12c')};};Preview[_0xd81b('0x10')][_0xd81b('0x107')]=function(_0x5549d9,_0x2e373f,_0x1312f0,_0x2f9027){var _0x5375d8=this;return new BPromise(function(_0x2c9fed,_0x290971){var _0x4d4cff=_0x5549d9[_0xd81b('0xc0')];var _0x2f87da=_0x5375d8[_0xd81b('0x9d')](_0x2e373f[_0xd81b('0x55')])?util[_0xd81b('0x8f')](_0xd81b('0x12d'),_0x2e373f[_0xd81b('0x55')]['name'],_[_0xd81b('0x6c')](_0x2e373f[_0xd81b('0x3e')])?'':_0x2e373f['dialPrefix'][_0xd81b('0x12e')]()||'',_0x2e373f['dialCutDigit']>0x0?_0x1312f0[_0xd81b('0x102')][_0xd81b('0x103')][_0xd81b('0x12f')](_0x2e373f[_0xd81b('0x130')]):_0x1312f0[_0xd81b('0x102')][_0xd81b('0x103')]):util[_0xd81b('0x8f')]('SIP/%s/%s%s',_[_0xd81b('0x6c')](_0x2e373f['TrunkBackup'])?_0x2e373f['Trunk'][_0xd81b('0x56')]:_0x2e373f['TrunkBackup'][_0xd81b('0x56')],_[_0xd81b('0x6c')](_0x2e373f[_0xd81b('0x3e')])?'':_0x2e373f[_0xd81b('0x3e')]['trim']()||'',_0x2e373f['dialCutDigit']>0x0?_0x1312f0[_0xd81b('0x102')][_0xd81b('0x103')]['substring'](_0x2e373f[_0xd81b('0x130')]):_0x1312f0[_0xd81b('0x102')][_0xd81b('0x103')]);var _0x5749db=_0x5375d8[_0xd81b('0x9d')](_0x2e373f[_0xd81b('0x55')])?ut['getCallerId'](_0x2e373f[_0xd81b('0x55')][_0xd81b('0x58')],_0x2e373f[_0xd81b('0x3b')],_0x2e373f[_0xd81b('0x131')]>0x0?ut[_0xd81b('0x132')](_0x2e373f['dialOriginateCallerIdNumber'],_0x2e373f['dialRandomLastDigitCallerIdNumber']):_0x2e373f[_0xd81b('0x3c')]):ut[_0xd81b('0x133')](_[_0xd81b('0x6c')](_0x2e373f[_0xd81b('0x126')])?_0x2e373f['Trunk'][_0xd81b('0x58')]:_0x2e373f['TrunkBackup'][_0xd81b('0x58')],_0x2e373f[_0xd81b('0x3b')],_0x2e373f['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd81b('0x132')](_0x2e373f[_0xd81b('0x3c')],_0x2e373f[_0xd81b('0x131')]):_0x2e373f['dialOriginateCallerIdNumber']);if(_0x5749db){_0x5549d9[_0xd81b('0x134')]=ut[_0xd81b('0x135')](_0x5749db);_0x5549d9[_0xd81b('0x136')]=ut['extractCalleridNumber'](_0x5749db);}var _0x3cc12d=ut[_0xd81b('0x137')](_0x2e373f,_0x1312f0,_0x2f87da,_0x5749db,_0x4d4cff,_0x5549d9);_[_0xd81b('0x138')](_0x5549d9,ut[_0xd81b('0x139')](_0x3cc12d));_0x5549d9[_0xd81b('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0xd81b('0x76')](ut[_0xd81b('0x13a')](_0x5549d9,_0x2e373f,_0x3cc12d,_0x5549d9[_0xd81b('0xae')],_0x2f9027))[_0xd81b('0x89')](function(_0x490100){_0x2e373f[_0xd81b('0x50')]+=0x1;logger[_0xd81b('0x5c')](_0xd81b('0x13b'),_0x4d4cff,'\x20Queue',_0x2e373f[_0xd81b('0x56')],_0xd81b('0x70'),_0x2e373f[_0xd81b('0x50')]);_0x2c9fed(_0x490100);})['catch'](function(_0x586156){ut['logAgent'](_0x5549d9,0xe,_0xd81b('0x13c'));rpcDb['createAgentHistory'](_0x5549d9,_0xd81b('0x13d'));_0x290971(_0x586156);});});};Preview[_0xd81b('0x10')][_0xd81b('0x21')]=function(_0x5b7284){if(this['actions'][_0x5b7284[_0xd81b('0xaf')]]){this['actions'][_0x5b7284[_0xd81b('0xaf')]][_0xd81b('0x78')]=_0x5b7284[_0xd81b('0x78')];}};Preview[_0xd81b('0x10')]['syncOriginateResponse']=function(_0x3ac7fd){var _0x1c7835=this;var _0x379ac0=this['actions'][_0x3ac7fd[_0xd81b('0x13e')]];if(_0x379ac0){if(_0x379ac0['lookAgent']&&this[_0xd81b('0x18')][_0x379ac0[_0xd81b('0x105')]]){ut['logLookAgent'](_0x379ac0,this[_0xd81b('0x18')][_0x379ac0[_0xd81b('0x105')]][_0xd81b('0x56')],this['agents'][_0x379ac0['lookAgent']]['id']);}var _0x1c10da=_[_0xd81b('0x13f')](_0x379ac0);_0x1c10da[_0xd81b('0xb1')]=moment()[_0xd81b('0x8f')](_0xd81b('0x90'));var _0x350afc=_0x1c7835[_0xd81b('0x15')][_0x379ac0['queue']];if(ut['isFailure'](_0x3ac7fd[_0xd81b('0x140')])){if(_0x379ac0[_0xd81b('0xad')]){rpcDb[_0xd81b('0x118')](_0x379ac0[_0xd81b('0x10a')]);}if(_0x379ac0['activeContact']){rpcDb[_0xd81b('0x8d')](_0x379ac0[_0xd81b('0x10a')]);}ami[_0xd81b('0x29')](_0xd81b('0x141'),ut[_0xd81b('0xa4')](_0x379ac0,'rejected',this['campaignsPreview'][_0x379ac0[_0xd81b('0x6f')]]));this[_0xd81b('0xf4')](_0x1c10da,_0x350afc,_0x3ac7fd);}else{_0x379ac0[_0xd81b('0x8e')]=moment()[_0xd81b('0x8f')](_0xd81b('0x90'));ut['logAgent'](_0x1c10da,0x4,'Answer');rpcDb[_0xd81b('0xf9')](_0x1c10da,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xd81b('0x10')][_0xd81b('0x1d')]=function(_0x2e008a){var _0x3ddf0b=this;var _0x2f2e19=this[_0xd81b('0x17')][_0x2e008a[_0xd81b('0xaf')]];var _0xad0a5b;if(_0x2f2e19){_0xad0a5b=this[_0xd81b('0x15')][_0x2f2e19[_0xd81b('0x6f')]];logger[_0xd81b('0x5c')](_0xd81b('0x142'),_0x2e008a[_0xd81b('0xaf')],_0xd81b('0xb2'),_0xad0a5b[_0xd81b('0x56')],_0xd81b('0xb3'),_0xad0a5b['pTalking']);}if(this[_0xd81b('0x17')][_0x2e008a['linkedid']]&&_0x2e008a[_0xd81b('0xaf')]!==_0x2e008a[_0xd81b('0xc0')]){if(_0x2e008a[_0xd81b('0x143')]==='16'&&this[_0xd81b('0x17')][_0x2e008a['linkedid']][_0xd81b('0x71')]){this['callProgressDetectingCustomer'](_0x2e008a,_0x2e008a[_0xd81b('0xaf')],_0x2e008a[_0xd81b('0x143')]);}else if(this['actions'][_0x2e008a[_0xd81b('0xaf')]]['dialAnswer']){logger[_0xd81b('0x5c')](_0xd81b('0x144'),_0x2e008a[_0xd81b('0xaf')],_0x2e008a[_0xd81b('0x143')],_0xd81b('0xb2'),_0xad0a5b[_0xd81b('0x56')],_0xd81b('0xb3'),_0xad0a5b[_0xd81b('0x2f')]);this[_0xd81b('0x9f')](_0x2e008a,_0x2e008a[_0xd81b('0xaf')],_0x2e008a[_0xd81b('0x143')]);}}else if(_0x2f2e19&&_[_0xd81b('0x6c')](_0x2f2e19['statedesc'])&&_0xad0a5b[_0xd81b('0x145')]&&_0x2e008a['linkedid']===_0x2e008a[_0xd81b('0xc0')]&&_[_0xd81b('0x6c')](_0x2e008a[_0xd81b('0xf7')])&&_0x2e008a[_0xd81b('0x143')]==='16'&&_0x2e008a[_0xd81b('0x146')]==='6'&&_[_0xd81b('0xf5')](_0x2f2e19[_0xd81b('0x147')])){if(_0x2f2e19['unlockAgent']){rpcDb[_0xd81b('0x118')](_0x2f2e19['idContact']);}if(_0x2f2e19[_0xd81b('0xae')]){rpcDb['disableContact'](_0x2f2e19[_0xd81b('0x10a')]);}_0x2e008a['reason']='22';this[_0xd81b('0xf4')](_0x2f2e19,_0xad0a5b,_0x2e008a);}else if(_0x2f2e19&&_0x2f2e19[_0xd81b('0x147')]){if(_0x2e008a[_0xd81b('0x143')]==='16'&&this[_0xd81b('0x17')][_0x2e008a['linkedid']][_0xd81b('0x71')]){logger[_0xd81b('0x5c')]('[syncHangup][talking][transfer]',_0x2e008a['linkedid'],_0x2e008a['cause'],_0xd81b('0xb2'),_0xad0a5b[_0xd81b('0x56')],_0xd81b('0xb3'),_0xad0a5b[_0xd81b('0x2f')]);this[_0xd81b('0x9f')](_0x2e008a,_0x2e008a[_0xd81b('0xaf')],_0x2e008a['cause']);}else if(this['actions'][_0x2e008a[_0xd81b('0xaf')]]['dialAnswer']){logger[_0xd81b('0x5c')](_0xd81b('0x144'),_0x2e008a[_0xd81b('0xaf')],_0x2e008a[_0xd81b('0x143')],_0xd81b('0xb2'),_0xad0a5b[_0xd81b('0x56')],_0xd81b('0xb3'),_0xad0a5b[_0xd81b('0x2f')]);this[_0xd81b('0x9f')](_0x2e008a,_0x2e008a[_0xd81b('0xaf')],_0x2e008a[_0xd81b('0x143')]);}}};Preview[_0xd81b('0x10')][_0xd81b('0x1f')]=function(_0x1efe61){if(this['actions'][_0x1efe61[_0xd81b('0xf3')]]&&_0x1efe61[_0xd81b('0xf3')]!==_0x1efe61[_0xd81b('0x148')]){this[_0xd81b('0x9f')](_0x1efe61,_0x1efe61[_0xd81b('0xf3')],_0x1efe61['dialstatus']);}};Preview[_0xd81b('0x10')]['syncHangupRequest']=function(_0x5509e6){if(this[_0xd81b('0x17')][_0x5509e6['linkedid']]&&_0x5509e6[_0xd81b('0xaf')]!==_0x5509e6[_0xd81b('0xc0')]&&!this[_0xd81b('0x17')][_0x5509e6['linkedid']][_0xd81b('0x71')]){if(_0x5509e6[_0xd81b('0x143')]==='1'){this[_0xd81b('0x9f')](_0x5509e6,_0x5509e6['linkedid'],_0x5509e6[_0xd81b('0x143')]);}}};Preview[_0xd81b('0x10')][_0xd81b('0x149')]=function(_0xad9c8f,_0x202d6a,_0x43637a){if(this['actions'][_0xad9c8f]){if(_[_0xd81b('0x6c')](this[_0xd81b('0x17')][_0xad9c8f][_0xd81b('0x14a')])){this[_0xd81b('0x17')][_0xad9c8f][_0xd81b('0x14a')]={};}this[_0xd81b('0x17')][_0xad9c8f][_0xd81b('0x14a')][_0x202d6a]=_0x43637a;}};Preview[_0xd81b('0x10')][_0xd81b('0x23')]=function(_0x5059a6){try{if(!_[_0xd81b('0x6c')](_0x5059a6)){if(ut[_0xd81b('0x14b')](_[_0xd81b('0x14c')](_0x5059a6[_0xd81b('0x14d')])[0x0])){this['addVariable'](_0x5059a6[_0xd81b('0xc0')],_[_0xd81b('0x14c')](_0x5059a6[_0xd81b('0x14d')])[0x0],_0x5059a6['value']);}}}catch(_0x369bc0){logger[_0xd81b('0x14e')](_0xd81b('0x14f'),util[_0xd81b('0x150')](_0x369bc0,{'showHidden':![],'depth':null}));}};Preview[_0xd81b('0x10')]['syncAttendedTransfer']=function(_0x2c59c1){if(_0x2c59c1){if(this[_0xd81b('0x17')][_0x2c59c1[_0xd81b('0x151')]]){this['actions'][_0x2c59c1[_0xd81b('0x151')]]['transfer']=!![];}}};Preview['prototype'][_0xd81b('0x27')]=function(_0x2312a5){if(_0x2312a5){if(this['actions'][_0x2312a5[_0xd81b('0x152')]]){this['actions'][_0x2312a5[_0xd81b('0x152')]][_0xd81b('0x147')]=!![];}}};module[_0xd81b('0x153')]=Preview;
\ No newline at end of file
index 764ef4e..c23e99f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93cf=['../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird'];(function(_0x318b4c,_0x55ade3){var _0x28a77a=function(_0x451e40){while(--_0x451e40){_0x318b4c['push'](_0x318b4c['shift']());}};_0x28a77a(++_0x55ade3);}(_0x93cf,0xda));var _0xf93c=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x93cf[_0x5447fd];return _0x15b28a;};'use strict';var util=require(_0xf93c('0x0'));var BPromise=require(_0xf93c('0x1'));var logger=require(_0xf93c('0x2'))(_0xf93c('0x3'));var _=require('lodash');var cmHopper=require(_0xf93c('0x4'));var cmHopperFinal=require(_0xf93c('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xf93c('0x6'));var agentReportPreview=require(_0xf93c('0x7'));var voiceQueueReport=require(_0xf93c('0x8'));function loggerCatch(_0x56171f){return function(_0x4b6bed){logger[_0xf93c('0x9')](_0x56171f,util[_0xf93c('0xa')](_0x4b6bed,{'showHidden':![],'depth':null}));};}function create(_0x3a79b2){return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopperHistory[_0xf93c('0xd')](_0x3a79b2))[_0xf93c('0xe')](loggerCatch(_0xf93c('0xf')));}function createAgent(_0x2c4e17){return BPromise['resolve']()[_0xf93c('0xc')](agentReportPreview['createHistory'](_0x2c4e17))[_0xf93c('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2981e0){return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopper[_0xf93c('0x10')](_0x2981e0,!![]))[_0xf93c('0xe')](loggerCatch(_0xf93c('0x11')));}exports['checkIsBlackList']=function(_0x42be57){return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopperBlack[_0xf93c('0x12')](_0x42be57))[_0xf93c('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xf93c('0x13')]=function(_0x42b6e4){return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopper[_0xf93c('0x13')](_0x42b6e4))[_0xf93c('0xe')](loggerCatch(_0xf93c('0x14')));};exports[_0xf93c('0xd')]=function(_0x54d41b,_0x41c254){create(_0x54d41b)[_0xf93c('0xe')](loggerCatch(_0x41c254));moveContact(_0x54d41b)[_0xf93c('0xe')](loggerCatch(_0x41c254));};exports[_0xf93c('0x15')]=function(_0x20bc5e,_0x515112){createAgent(_0x20bc5e)[_0xf93c('0xe')](loggerCatch(_0x515112));};exports[_0xf93c('0x16')]=function(_0x1d27e1,_0x37fa73){create(_0x1d27e1)['catch'](loggerCatch(_0x37fa73));};exports[_0xf93c('0x17')]=function(_0x552301,_0xd857e3){moveContact(_0x552301)[_0xf93c('0xe')](loggerCatch(_0xd857e3));};exports[_0xf93c('0x18')]=function(_0x3e8dba,_0x1289ef,_0x253822){if(_0x1289ef){_0x3e8dba['UserId']=null;}if(_0x253822){_0x3e8dba[_0xf93c('0x19')]=![];}return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopper['rescheduleContact'](_0x3e8dba))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0xf93c('0x1a')]=function(_0x2a84b3){return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopper[_0xf93c('0x1a')](_0x2a84b3))[_0xf93c('0xe')](loggerCatch(_0xf93c('0x1b')));};exports[_0xf93c('0x1c')]=function(_0x59b128){return BPromise['resolve']()['then'](cmHopper[_0xf93c('0x1c')]({'UserId':null},_0x59b128,0x1))['catch'](loggerCatch(_0xf93c('0x1d')));};exports[_0xf93c('0x1e')]=function(_0x4d93cd){return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopper[_0xf93c('0x1c')]({'active':![]},_0x4d93cd,0x1))['catch'](loggerCatch(_0xf93c('0x1f')));};exports['crateCustomerReportQueue']=function(_0x4db08e){var _0x2bc961={};_0x2bc961[_0xf93c('0x20')]=_0x4db08e[_0xf93c('0x20')];_0x2bc961[_0xf93c('0x21')]=_0x4db08e[_0xf93c('0x21')];_0x2bc961[_0xf93c('0x22')]=_0x4db08e[_0xf93c('0x22')];_0x2bc961[_0xf93c('0x23')]=_0x4db08e[_0xf93c('0x23')];_0x2bc961[_0xf93c('0x24')]=_0x4db08e[_0xf93c('0x24')];_0x2bc961[_0xf93c('0x25')]=_0x4db08e[_0xf93c('0x26')];_0x2bc961[_0xf93c('0x27')]=_0x4db08e['answertime'];_0x2bc961[_0xf93c('0x28')]=0x1;_0x2bc961['queuecallercompleteAt']=_0x4db08e[_0xf93c('0x29')];_0x2bc961['connectedlinename']=_0x4db08e[_0xf93c('0x2a')];_0x2bc961[_0xf93c('0x2b')]=_0xf93c('0x2c');_0x2bc961[_0xf93c('0x2d')]=_0xf93c('0x2e');_0x2bc961['holdtime']=0x0;_0x2bc961[_0xf93c('0x2f')]=0x1;_0x2bc961[_0xf93c('0x30')]=_0x4db08e[_0xf93c('0x2a')];_0x2bc961['queuecallerexitreason']=_0xf93c('0x31');return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](voiceQueueReport[_0xf93c('0x32')](_0x2bc961))[_0xf93c('0xe')](loggerCatch(_0xf93c('0x33')));};exports[_0xf93c('0x34')]=function(_0x51ab77,_0x1671ae){return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopper[_0xf93c('0x34')](_0x51ab77,_0x1671ae))[_0xf93c('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xf93c('0x35')]=function(_0x4ac8c7){return BPromise[_0xf93c('0xb')]()[_0xf93c('0xc')](cmHopper[_0xf93c('0x18')](_0x4ac8c7,!![],!![]))[_0xf93c('0xe')](loggerCatch(_0xf93c('0x36')));};
\ No newline at end of file
+var _0xee31=['unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xee31,0x1d5));var _0x1ee3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xee31[_0x2641f9];return _0x585741;};'use strict';var util=require('util');var BPromise=require(_0x1ee3('0x0'));var logger=require(_0x1ee3('0x1'))('preview');var _=require(_0x1ee3('0x2'));var cmHopper=require(_0x1ee3('0x3'));var cmHopperFinal=require(_0x1ee3('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1ee3('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x1ee3('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x5a9792){return function(_0x4e39cd){logger[_0x1ee3('0x7')](_0x5a9792,util['inspect'](_0x4e39cd,{'showHidden':![],'depth':null}));};}function create(_0x599485){return BPromise[_0x1ee3('0x8')]()[_0x1ee3('0x9')](cmHopperHistory['createHistory'](_0x599485))[_0x1ee3('0xa')](loggerCatch(_0x1ee3('0xb')));}function createAgent(_0x52e6ea){return BPromise[_0x1ee3('0x8')]()[_0x1ee3('0x9')](agentReportPreview[_0x1ee3('0xc')](_0x52e6ea))[_0x1ee3('0xa')](loggerCatch(_0x1ee3('0xb')));}function moveContact(_0x51382d){return BPromise['resolve']()[_0x1ee3('0x9')](cmHopper[_0x1ee3('0xd')](_0x51382d,!![]))[_0x1ee3('0xa')](loggerCatch(_0x1ee3('0xe')));}exports[_0x1ee3('0xf')]=function(_0x221997){return BPromise[_0x1ee3('0x8')]()[_0x1ee3('0x9')](cmHopperBlack['checkIsBlackList'](_0x221997))[_0x1ee3('0xa')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x238130){return BPromise[_0x1ee3('0x8')]()[_0x1ee3('0x9')](cmHopper['getContactPreview'](_0x238130))['catch'](loggerCatch(_0x1ee3('0x10')));};exports[_0x1ee3('0xc')]=function(_0x3fab13,_0x478787){create(_0x3fab13)[_0x1ee3('0xa')](loggerCatch(_0x478787));moveContact(_0x3fab13)[_0x1ee3('0xa')](loggerCatch(_0x478787));};exports[_0x1ee3('0x11')]=function(_0x2b92a2,_0x3ed3c3){createAgent(_0x2b92a2)[_0x1ee3('0xa')](loggerCatch(_0x3ed3c3));};exports[_0x1ee3('0x12')]=function(_0x3b2ec3,_0x144d22){create(_0x3b2ec3)['catch'](loggerCatch(_0x144d22));};exports[_0x1ee3('0x13')]=function(_0x16c817,_0x229df2){moveContact(_0x16c817)['catch'](loggerCatch(_0x229df2));};exports['rescheduleContact']=function(_0x46df2f,_0x1922ea,_0x3b8b9f){if(_0x1922ea){_0x46df2f[_0x1ee3('0x14')]=null;}if(_0x3b8b9f){_0x46df2f[_0x1ee3('0x15')]=![];}return BPromise[_0x1ee3('0x8')]()['then'](cmHopper[_0x1ee3('0x16')](_0x46df2f))['catch'](loggerCatch(_0x1ee3('0x17')));};exports[_0x1ee3('0x18')]=function(_0x38fb29){return BPromise[_0x1ee3('0x8')]()['then'](cmHopper[_0x1ee3('0x18')](_0x38fb29))['catch'](loggerCatch(_0x1ee3('0x19')));};exports[_0x1ee3('0x1a')]=function(_0x1842d9){return BPromise[_0x1ee3('0x8')]()[_0x1ee3('0x9')](cmHopper['unlockContact']({'UserId':null},_0x1842d9,0x1))['catch'](loggerCatch(_0x1ee3('0x1b')));};exports[_0x1ee3('0x1c')]=function(_0x1586a0){return BPromise[_0x1ee3('0x8')]()[_0x1ee3('0x9')](cmHopper[_0x1ee3('0x1a')]({'active':![]},_0x1586a0,0x1))[_0x1ee3('0xa')](loggerCatch(_0x1ee3('0x1d')));};exports[_0x1ee3('0x1e')]=function(_0x2024bd){var _0x406068={};_0x406068[_0x1ee3('0x1f')]=_0x2024bd['type'];_0x406068[_0x1ee3('0x20')]=_0x2024bd['uniqueid'];_0x406068[_0x1ee3('0x21')]=_0x2024bd[_0x1ee3('0x21')];_0x406068[_0x1ee3('0x22')]=_0x2024bd[_0x1ee3('0x22')];_0x406068['queue']=_0x2024bd[_0x1ee3('0x23')];_0x406068[_0x1ee3('0x24')]=_0x2024bd[_0x1ee3('0x25')];_0x406068[_0x1ee3('0x26')]=_0x2024bd['answertime'];_0x406068[_0x1ee3('0x27')]=0x1;_0x406068[_0x1ee3('0x28')]=_0x2024bd['endtime'];_0x406068['connectedlinename']=_0x2024bd['membername'];_0x406068[_0x1ee3('0x29')]=_0x1ee3('0x2a');_0x406068['exten']=_0x1ee3('0x2b');_0x406068[_0x1ee3('0x2c')]=0x0;_0x406068[_0x1ee3('0x2d')]=0x1;_0x406068[_0x1ee3('0x2e')]=_0x2024bd[_0x1ee3('0x2f')];_0x406068[_0x1ee3('0x30')]=_0x1ee3('0x31');return BPromise['resolve']()[_0x1ee3('0x9')](voiceQueueReport[_0x1ee3('0x32')](_0x406068))[_0x1ee3('0xa')](loggerCatch(_0x1ee3('0x33')));};exports[_0x1ee3('0x34')]=function(_0x45a680,_0x48385c){return BPromise[_0x1ee3('0x8')]()['then'](cmHopper[_0x1ee3('0x34')](_0x45a680,_0x48385c))['catch'](loggerCatch(_0x1ee3('0x35')));};exports['rescheduleContactInQueue']=function(_0x1a9b1d){return BPromise[_0x1ee3('0x8')]()[_0x1ee3('0x9')](cmHopper['rescheduleContact'](_0x1a9b1d,!![],!![]))['catch'](loggerCatch(_0x1ee3('0x36')));};
\ No newline at end of file
index adb65d0..248afd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0d4=['getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','state','endtime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','countglobal','callback','callbackat','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','loggerError','logger2','info','message'];(function(_0x39cb5c,_0x400e64){var _0x308542=function(_0x501555){while(--_0x501555){_0x39cb5c['push'](_0x39cb5c['shift']());}};_0x308542(++_0x400e64);}(_0xa0d4,0x115));var _0x4a0d=function(_0x1d80e8,_0xd69ea6){_0x1d80e8=_0x1d80e8-0x0;var _0x42e610=_0xa0d4[_0x1d80e8];return _0x42e610;};'use strict';var util=require('util');var _=require(_0x4a0d('0x0'));var moment=require('moment');var logger=require(_0x4a0d('0x1'))(_0x4a0d('0x2'));var ipAgi=process[_0x4a0d('0x3')][_0x4a0d('0x4')]||_0x4a0d('0x5');function getSeconds(_0x556d35,_0xb5938a){var _0x447455=moment(_0x556d35)[_0x4a0d('0x6')](0x0);var _0x238324=moment(_0xb5938a)['milliseconds'](0x0);return _0x447455[_0x4a0d('0x7')](_0x238324,'seconds');}exports[_0x4a0d('0x8')]=function(_0x1c7c57){return function(_0x8dc331){logger[_0x4a0d('0x9')](_0x1c7c57,util[_0x4a0d('0xa')](_0x8dc331,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1c0813,_0x1b06aa){logger['info'](_0x1c0813,util[_0x4a0d('0xa')](_0x1b06aa,{'showHidden':![],'depth':null}));};exports[_0x4a0d('0xb')]=function(_0x15e4bc,_0x298820){logger[_0x4a0d('0x9')](_0x15e4bc,util[_0x4a0d('0xa')](_0x298820,{'showHidden':![],'depth':null}));};exports[_0x4a0d('0xc')]=function(_0x529fe6){return function(_0x46a162){logger[_0x4a0d('0xd')](_0x529fe6,util[_0x4a0d('0xa')](_0x46a162,{'showHidden':![],'depth':null}));};};exports[_0x4a0d('0xe')]=function(_0x5edafd,_0x4f0a47,_0x47b601){return{'message':_0x5edafd,'unlock':_0x4f0a47,'active':_0x47b601};};exports[_0x4a0d('0xf')]=function(_0x48d869,_0x126fe2,_0x41d166){if(!_[_0x4a0d('0x10')](_0x41d166)&&_0x4a0d('0x11')===typeof _0x41d166&&!_[_0x4a0d('0x12')](_0x41d166)){if(!_[_0x4a0d('0x10')](_0x126fe2)&&_0x4a0d('0x11')===typeof _0x126fe2&&!_[_0x4a0d('0x12')](_0x126fe2)){return util[_0x4a0d('0x13')]('\x22%s\x22\x20<%s>',_0x126fe2,_0x41d166);}return util[_0x4a0d('0x13')](_0x4a0d('0x14'),_0x41d166,_0x41d166);}if(!_['isUndefined'](_0x48d869)&&'string'===typeof _0x48d869&&!_['isEmpty'](_0x48d869)){return _0x48d869;}return _0x4a0d('0x15');};exports[_0x4a0d('0x16')]=function(_0x3283ec){if(_[_0x4a0d('0x17')](_0x3283ec)){return![];}return _0x3283ec;};exports['addVariables']=function(_0x15ab22,_0x349cf8,_0x1ade76,_0x4fa25b,_0x42a3f6,_0xbd1620){var _0x21e719={'XMD-QUEUE':_0x349cf8[_0x4a0d('0x18')]?_0x349cf8[_0x4a0d('0x18')][_0x4a0d('0x19')]:'','XMD-CALLERID':_0x4fa25b,'XMD-CALLERID-PREVIEW':_0xbd1620?util[_0x4a0d('0x13')](_0x4a0d('0x14'),_0xbd1620[_0x4a0d('0x1a')],_0xbd1620[_0x4a0d('0x1b')]):_0x4fa25b,'XMD-DIALID':_0x42a3f6,'XMD-CONTACTID':_0x349cf8[_0x4a0d('0x1c')],'XMD-CDRTYPE':_0x4a0d('0x1d'),'CALLERID(all)':_0x4fa25b,'XMD-VOICEQUEUEID':_0x349cf8[_0x4a0d('0x1e')],'XMD-DIALCHANNEL':_0x1ade76,'XMD-DIALTIMEOUT':_0x15ab22[_0x4a0d('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x4a0d('0x13')](_0x4a0d('0x20'),_0x15ab22['dialQueueProject2']?'g':'',_[_0x4a0d('0x12')](_0x15ab22[_0x4a0d('0x21')])?'':_0x4a0d('0x22')),'XMD-DIALURL':_0x15ab22['dialPreviewUrl']||'','XMD-AGI':_0x15ab22['dialQueueProject']?util[_0x4a0d('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x15ab22[_0x4a0d('0x23')]):_0x4a0d('0x24'),'XMD-AGIAFTER':_0x15ab22[_0x4a0d('0x25')]?util[_0x4a0d('0x13')](_0x4a0d('0x26'),ipAgi,_0x15ab22[_0x4a0d('0x25')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0xbd1620?_0xbd1620[_0x4a0d('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0xbd1620?_0xbd1620[_0x4a0d('0x28')]:'','XMD-DESTINATION':_0x4a0d('0x29'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x4a0d('0x12')](_0x15ab22[_0x4a0d('0x21')])){_0x21e719[util[_0x4a0d('0x13')]('%s',_0x4a0d('0x2a'))]=_0x15ab22['monitor_format'];_0x21e719[util['format']('%s',_0x4a0d('0x2b'))]=_0x42a3f6;}if(_0x349cf8&&_0x349cf8['Contact']){for(var _0x44133b in _0x349cf8[_0x4a0d('0x2c')]){if(_0x349cf8['Contact'][_0x4a0d('0x2d')](_0x44133b)){if(!_['isNil'](_0x349cf8['Contact'][_0x44133b])&&_0x44133b!=='id'&&_0x44133b!==_0x4a0d('0x2e')&&_0x44133b!=='createdAt'&&_0x44133b!==_0x4a0d('0x2f')){_0x21e719[util[_0x4a0d('0x13')](_0x4a0d('0x30'),_0x4a0d('0x31'),_[_0x4a0d('0x32')](_0x44133b))]=_0x349cf8[_0x4a0d('0x2c')][_0x44133b];}}}}return _0x21e719;};exports[_0x4a0d('0x33')]=function(_0x4cfaf1){var _0x3565cf={};for(var _0x534d8d in _0x4cfaf1){if(_0x4cfaf1[_0x4a0d('0x2d')](_0x534d8d)){_0x3565cf[util[_0x4a0d('0x13')]('%s',_[_0x4a0d('0x34')](_0x534d8d))]=_0x4cfaf1[_0x534d8d];}}return{'variables':_0x3565cf};};exports[_0x4a0d('0x35')]=function(_0x1fc60e,_0x20794e){if(!_[_0x4a0d('0x17')](_0x1fc60e)){if(_0x1fc60e[_0x4a0d('0x2d')](_0x4a0d('0x36'))){if(_0x1fc60e[_0x4a0d('0x36')]>0x0){_0x1fc60e[_0x4a0d('0x36')]-=0x1;}else{logger[_0x4a0d('0x9')](_0x4a0d('0x37'),_0x20794e);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x20794e);}};exports['logBlacklist']=function(_0x41d20d){var _0x3462d3=moment()[_0x4a0d('0x13')](_0x4a0d('0x38'));_0x41d20d['state']=0xd;_0x41d20d[_0x4a0d('0x39')]=_0x4a0d('0x3a');_0x41d20d[_0x4a0d('0x3b')]=_0x3462d3;_0x41d20d[_0x4a0d('0x3c')]=_0x3462d3;_0x41d20d['endtime']=_0x3462d3;};exports[_0x4a0d('0x3d')]=function(_0x1d5932,_0x4f97b6,_0x42869d){var _0x2d4f23=moment()['format'](_0x4a0d('0x38'));_0x1d5932['state']=_0x4f97b6;_0x1d5932[_0x4a0d('0x39')]=_0x42869d;_0x1d5932[_0x4a0d('0x3c')]=_0x2d4f23;_0x1d5932[_0x4a0d('0x3e')]=getSeconds(_0x1d5932[_0x4a0d('0x3c')],_0x1d5932[_0x4a0d('0x3b')]);};exports[_0x4a0d('0x3f')]=function(_0x6749f,_0x176c7a,_0x22d6a5){_0x6749f[_0x4a0d('0x40')]=_0x176c7a;_0x6749f[_0x4a0d('0x41')]=_0x22d6a5;};exports[_0x4a0d('0x42')]=function(_0x281fea,_0x9f9279,_0x589201){var _0x2bb530=moment()[_0x4a0d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x281fea[_0x4a0d('0x43')]=_0x9f9279;_0x281fea[_0x4a0d('0x39')]=_0x589201;_0x281fea[_0x4a0d('0x3c')]=_0x281fea[_0x4a0d('0x3c')]?_0x281fea[_0x4a0d('0x3c')]:_0x2bb530;_0x281fea['endtime']=_0x281fea['endtime']?_0x281fea[_0x4a0d('0x44')]:_0x2bb530;_0x281fea['ringtime']=getSeconds(_0x281fea[_0x4a0d('0x3c')]||0x0,_0x281fea[_0x4a0d('0x3b')]||0x0);_0x281fea[_0x4a0d('0x45')]=_0x281fea[_0x4a0d('0x46')]?getSeconds(_0x281fea['endtime'],_0x281fea['answertime']):0x0;};exports[_0x4a0d('0x47')]=function(_0x3fbecb){return _0x3fbecb==='Failure';};exports[_0x4a0d('0x48')]=function(_0x3ffef7,_0x83ddbc,_0x42de8b,_0x3c27a2,_0x4dcb77){var _0x3d3a6b=_0x3c27a2?_0x4a0d('0x49'):_0x3ffef7['calleridname'];_0x3d3a6b=_0x4dcb77?_0x4a0d('0x4a'):_0x3d3a6b;return{'actionid':_0x3ffef7[_0x4a0d('0x4b')],'action':_0x4a0d('0x4c'),'channel':_0x3ffef7[_0x4a0d('0x4d')],'callerid':util[_0x4a0d('0x13')]('\x22%s\x22\x20<%s>',_0x3d3a6b,_0x3ffef7[_0x4a0d('0x1b')]),'Exten':_0x4a0d('0x29'),'Context':_0x4a0d('0x4e'),'Priority':'1','variable':_0x42de8b,'timeout':(_0x83ddbc[_0x4a0d('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3ffef7['uniqueid']};};exports[_0x4a0d('0x50')]=function(_0x592f90){return _0x592f90[_0x4a0d('0x51')]+_0x592f90[_0x4a0d('0x52')]+_0x592f90[_0x4a0d('0x53')]+_0x592f90['countagentrejectretry']+_0x592f90[_0x4a0d('0x54')];};exports[_0x4a0d('0x55')]=function(_0x442082){var _0x4e162d=_[_0x4a0d('0x56')](_0x442082);_0x4e162d[_0x4a0d('0x43')]=0xf;_0x4e162d[_0x4a0d('0x39')]=_0x4a0d('0x57');return _0x4e162d;};exports[_0x4a0d('0x58')]=function(_0x45629d,_0x51a90a,_0x4925d0){var _0x589876={};_0x589876[_0x51a90a]=_0x45629d[_0x51a90a];_0x589876[_0x4a0d('0x59')]=![];_0x589876[_0x4a0d('0x5a')]=moment()[_0x4a0d('0x5b')](_0x4925d0,_0x4a0d('0x5c'))['format'](_0x4a0d('0x38'));_0x589876['ContactId']=_0x45629d[_0x4a0d('0x1c')];_0x589876['ListId']=_0x45629d[_0x4a0d('0x5d')];_0x589876[_0x4a0d('0x1e')]=_0x45629d['VoiceQueueId']||undefined;return _0x589876;};exports[_0x4a0d('0x5e')]=function(_0xc67624,_0xd03dcc){if(!_[_0x4a0d('0x17')](_0xc67624)){if(_0xc67624[_0x4a0d('0x5f')]>0x0){_0xc67624['pTalking']-=0x1;}else{logger[_0x4a0d('0x9')](_0xd03dcc,_0x4a0d('0x60'));}}else{logger[_0x4a0d('0x9')](_0xd03dcc,_0x4a0d('0x61'));}};exports[_0x4a0d('0x62')]=function(_0x24d914){if(_0x24d914<=0x0){return!![];}return![];};exports[_0x4a0d('0x63')]=function(_0x146d26,_0x729f61,_0x3da5c5){_0x146d26[_0x4a0d('0x64')]=_0x729f61;_0x146d26[_0x4a0d('0x19')]=_0x146d26[_0x4a0d('0x65')];_0x146d26['interface']=_0x146d26['channelAgent'];_0x146d26[_0x4a0d('0x66')]=_0x4a0d('0x67');if(_0x3da5c5){_0x146d26['mandatoryDisposition']=_0x3da5c5[_0x4a0d('0x68')];}return _0x146d26;};exports[_0x4a0d('0x69')]=function(_0x3467e3){var _0x277213={};_0x277213[_0x4a0d('0x65')]=_0x3467e3['queue'];_0x277213[_0x4a0d('0x6a')]=_0x3467e3[_0x4a0d('0x4d')];_0x277213[_0x4a0d('0x4b')]=_0x3467e3['uniqueid'];return _0x277213;};exports[_0x4a0d('0x6b')]=function(_0x529b2c){var _0x1425de=[];for(var _0x5e8dc9 in _0x529b2c){if(_0x529b2c[_0x4a0d('0x2d')](_0x5e8dc9)){if(!_['isNil'](_0x529b2c[_0x5e8dc9])&&_0x529b2c[_0x5e8dc9][_0x4a0d('0x43')]===_0x4a0d('0x6c')&&_0x529b2c[_0x5e8dc9]['status']===_0x4a0d('0x6d')){_0x1425de[_0x4a0d('0x6e')](_0x529b2c[_0x5e8dc9]['id']);}}}return _0x1425de;};exports[_0x4a0d('0x6f')]=function(_0x2c3c13){var _0x5701df=moment()[_0x4a0d('0x6')](0x0);var _0x2543ba=moment(_0x2c3c13)[_0x4a0d('0x6')](0x0);return _0x5701df['diff'](_0x2543ba,_0x4a0d('0x70'));};exports[_0x4a0d('0x71')]=function(_0x5797e5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5797e5[_0x4a0d('0x1c')],'ListId':_0x5797e5[_0x4a0d('0x5d')],'VoiceQueueId':_0x5797e5[_0x4a0d('0x1e')]||undefined,'CampaignId':_0x5797e5[_0x4a0d('0x72')]||undefined};};exports[_0x4a0d('0x73')]=function(_0x2a95a6){if(_0x2a95a6===_0x4a0d('0x4b')||_0x2a95a6==='idContact'||_0x2a95a6===_0x4a0d('0x65')||_0x2a95a6===_0x4a0d('0x74')||_0x2a95a6===_0x4a0d('0x75')||_0x2a95a6===_0x4a0d('0x76')||_0x2a95a6===_0x4a0d('0x40')||_0x2a95a6===_0x4a0d('0x4d')||_0x2a95a6==='calleridname'||_0x2a95a6===_0x4a0d('0x59')||_0x2a95a6===_0x4a0d('0x1b')||_0x2a95a6===_0x4a0d('0x5a')||_0x2a95a6===_0x4a0d('0x51')||_0x2a95a6==='countcongestionretry'||_0x2a95a6===_0x4a0d('0x53')||_0x2a95a6===_0x4a0d('0x77')||_0x2a95a6===_0x4a0d('0x78')||_0x2a95a6==='callbackuniqueid'||_0x2a95a6===_0x4a0d('0x79')||_0x2a95a6==='recallme'||_0x2a95a6==='ContactId'||_0x2a95a6===_0x4a0d('0x5d')||_0x2a95a6==='UserId'||_0x2a95a6===_0x4a0d('0x1e')||_0x2a95a6==='sipcallid'||_0x2a95a6===_0x4a0d('0x7a')||_0x2a95a6==='xmd-queue'||_0x2a95a6===_0x4a0d('0x7b')||_0x2a95a6==='xmd-listid'||_0x2a95a6===_0x4a0d('0x7c')||_0x2a95a6===_0x4a0d('0x7d')||_0x2a95a6===_0x4a0d('0x7e')||_0x2a95a6==='xmd-dialid'||_0x2a95a6==='xmd-dialchannel'||_0x2a95a6==='xmd-contactid'||_0x2a95a6==='xmd-cdrtype'||_0x2a95a6==='xmd-callerid'||_0x2a95a6===_0x4a0d('0x7f')||_0x2a95a6===_0x4a0d('0x80')||_0x2a95a6==='rtpaudioqos'||_0x2a95a6===_0x4a0d('0x81')||_0x2a95a6==='rtpaudioqosjitter'||_0x2a95a6===_0x4a0d('0x82')||_0x2a95a6===_0x4a0d('0x83')||_0x2a95a6===_0x4a0d('0x84')||_0x2a95a6===_0x4a0d('0x85')||_0x2a95a6===_0x4a0d('0x86')||_0x2a95a6===_0x4a0d('0x87')||_0x2a95a6==='rtpaudioqosbridged'||_0x2a95a6===_0x4a0d('0x88')||_0x2a95a6===_0x4a0d('0x82')||_0x2a95a6===_0x4a0d('0x83')||_0x2a95a6===_0x4a0d('0x84')||_0x2a95a6==='rtpaudioqosrtt'||_0x2a95a6===_0x4a0d('0x86')||_0x2a95a6===_0x4a0d('0x89')||_0x2a95a6===_0x4a0d('0x8a')||_0x2a95a6==='state'||_0x2a95a6===_0x4a0d('0x39')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1edc75,_0x3fc85e){var _0x751796,_0x593b88,_0x1eca5a;if(_0x3fc85e<=0x0){_0x3fc85e=0x1;}_0x751796=new RegExp(_0x4a0d('0x8b')+_0x3fc85e+'}$');_0x593b88=Math['pow'](0xa,_0x3fc85e-0x1);_0x1eca5a=Math[_0x4a0d('0x8c')](0xa,_0x3fc85e)-0x1;return util[_0x4a0d('0x13')]('%s',_[_0x4a0d('0x8d')](_0x1edc75,_0x751796,_[_0x4a0d('0x8e')](_0x593b88,_0x1eca5a)));};exports[_0x4a0d('0x8f')]=function(_0x4740b5){var _0x5008dc=_0x4740b5[_0x4a0d('0x90')](/"(.*?)"/);return _0x5008dc?_0x5008dc[0x1]:_0x4740b5;};exports[_0x4a0d('0x91')]=function(_0x5e7521){var _0x82b720=_0x5e7521['match'](/<(.*?)>/);return _0x82b720?_0x82b720[0x1]:_0x5e7521;};
\ No newline at end of file
+var _0xdb54=['inspect','logger','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','XMD-','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','endtime','logAgent','state','responsetime','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildAcw','uniqueid','agentReadyId','not_inuse','status','reachable','push','milliseconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','env','127.0.0.1','diff','seconds','loggerCatch','error'];(function(_0x1b22a3,_0x595399){var _0x2e5d08=function(_0x8e826c){while(--_0x8e826c){_0x1b22a3['push'](_0x1b22a3['shift']());}};_0x2e5d08(++_0x595399);}(_0xdb54,0x11c));var _0x4db5=function(_0x194137,_0x2915f1){_0x194137=_0x194137-0x0;var _0x32196a=_0xdb54[_0x194137];return _0x32196a;};'use strict';var util=require(_0x4db5('0x0'));var _=require(_0x4db5('0x1'));var moment=require('moment');var logger=require(_0x4db5('0x2'))(_0x4db5('0x3'));var ipAgi=process[_0x4db5('0x4')]['XCALLY_IP_AGI']||_0x4db5('0x5');function getSeconds(_0x3b5e5e,_0x5906e9){var _0x500c0d=moment(_0x3b5e5e)['milliseconds'](0x0);var _0x24e3f2=moment(_0x5906e9)['milliseconds'](0x0);return _0x500c0d[_0x4db5('0x6')](_0x24e3f2,_0x4db5('0x7'));}exports[_0x4db5('0x8')]=function(_0x19c48d){return function(_0x4f2c03){logger[_0x4db5('0x9')](_0x19c48d,util[_0x4db5('0xa')](_0x4f2c03,{'showHidden':![],'depth':null}));};};exports[_0x4db5('0xb')]=function(_0x40f826,_0x26ccca){logger['info'](_0x40f826,util[_0x4db5('0xa')](_0x26ccca,{'showHidden':![],'depth':null}));};exports[_0x4db5('0xc')]=function(_0x4b1953,_0x1c7c07){logger['error'](_0x4b1953,util[_0x4db5('0xa')](_0x1c7c07,{'showHidden':![],'depth':null}));};exports[_0x4db5('0xd')]=function(_0x1cace0){return function(_0x38e7bc){logger['info'](_0x1cace0,util[_0x4db5('0xa')](_0x38e7bc,{'showHidden':![],'depth':null}));};};exports[_0x4db5('0xe')]=function(_0x9dea97,_0x1e220,_0x96c5c){return{'message':_0x9dea97,'unlock':_0x1e220,'active':_0x96c5c};};exports[_0x4db5('0xf')]=function(_0x39d7c3,_0x4c7242,_0x2e2d7e){if(!_[_0x4db5('0x10')](_0x2e2d7e)&&'string'===typeof _0x2e2d7e&&!_[_0x4db5('0x11')](_0x2e2d7e)){if(!_[_0x4db5('0x10')](_0x4c7242)&&_0x4db5('0x12')===typeof _0x4c7242&&!_[_0x4db5('0x11')](_0x4c7242)){return util[_0x4db5('0x13')](_0x4db5('0x14'),_0x4c7242,_0x2e2d7e);}return util[_0x4db5('0x13')](_0x4db5('0x14'),_0x2e2d7e,_0x2e2d7e);}if(!_[_0x4db5('0x10')](_0x39d7c3)&&_0x4db5('0x12')===typeof _0x39d7c3&&!_[_0x4db5('0x11')](_0x39d7c3)){return _0x39d7c3;}return _0x4db5('0x15');};exports[_0x4db5('0x16')]=function(_0x4bd771){if(_['isNil'](_0x4bd771)){return![];}return _0x4bd771;};exports[_0x4db5('0x17')]=function(_0x29639b,_0x472705,_0x38b50d,_0x1858c2,_0x7d65d5,_0xa301c7){var _0x3ed9fc={'XMD-QUEUE':_0x472705['Queue']?_0x472705['Queue']['name']:'','XMD-CALLERID':_0x1858c2,'XMD-CALLERID-PREVIEW':_0xa301c7?util[_0x4db5('0x13')](_0x4db5('0x14'),_0xa301c7[_0x4db5('0x18')],_0xa301c7[_0x4db5('0x19')]):_0x1858c2,'XMD-DIALID':_0x7d65d5,'XMD-CONTACTID':_0x472705[_0x4db5('0x1a')],'XMD-CDRTYPE':_0x4db5('0x1b'),'CALLERID(all)':_0x1858c2,'XMD-VOICEQUEUEID':_0x472705[_0x4db5('0x1c')],'XMD-DIALCHANNEL':_0x38b50d,'XMD-DIALTIMEOUT':_0x29639b[_0x4db5('0x1d')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x29639b[_0x4db5('0x1e')]?'g':'',_[_0x4db5('0x11')](_0x29639b['monitor_format'])?'':_0x4db5('0x1f')),'XMD-DIALURL':_0x29639b[_0x4db5('0x20')]||'','XMD-AGI':_0x29639b[_0x4db5('0x21')]?util[_0x4db5('0x13')](_0x4db5('0x22'),ipAgi,_0x29639b[_0x4db5('0x21')]):_0x4db5('0x23'),'XMD-AGIAFTER':_0x29639b[_0x4db5('0x1e')]?util[_0x4db5('0x13')](_0x4db5('0x22'),ipAgi,_0x29639b[_0x4db5('0x1e')]):_0x4db5('0x23'),'XMD-ORIGINATECALLERIDNUM':_0xa301c7?_0xa301c7[_0x4db5('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0xa301c7?_0xa301c7['originatecalleridname']:'','XMD-DESTINATION':_0x4db5('0x25'),'SIPADDHEADER':_0x4db5('0x26')};if(!_[_0x4db5('0x11')](_0x29639b[_0x4db5('0x27')])){_0x3ed9fc[util[_0x4db5('0x13')]('%s',_0x4db5('0x28'))]=_0x29639b[_0x4db5('0x27')];_0x3ed9fc[util[_0x4db5('0x13')]('%s',_0x4db5('0x29'))]=_0x7d65d5;}if(_0x472705&&_0x472705[_0x4db5('0x2a')]){for(var _0x4a09a5 in _0x472705['Contact']){if(_0x472705[_0x4db5('0x2a')][_0x4db5('0x2b')](_0x4a09a5)){if(!_[_0x4db5('0x2c')](_0x472705[_0x4db5('0x2a')][_0x4a09a5])&&_0x4a09a5!=='id'&&_0x4a09a5!==_0x4db5('0x2d')&&_0x4a09a5!==_0x4db5('0x2e')&&_0x4a09a5!==_0x4db5('0x2f')){_0x3ed9fc[util['format']('%s%s',_0x4db5('0x30'),_['toUpper'](_0x4a09a5))]=_0x472705[_0x4db5('0x2a')][_0x4a09a5];}}}}return _0x3ed9fc;};exports['toLowerVariables']=function(_0x577347){var _0x31634d={};for(var _0x41dcbe in _0x577347){if(_0x577347[_0x4db5('0x2b')](_0x41dcbe)){_0x31634d[util[_0x4db5('0x13')]('%s',_[_0x4db5('0x31')](_0x41dcbe))]=_0x577347[_0x41dcbe];}}return{'variables':_0x31634d};};exports[_0x4db5('0x32')]=function(_0x46a454,_0x474015){if(!_[_0x4db5('0x2c')](_0x46a454)){if(_0x46a454[_0x4db5('0x2b')](_0x4db5('0x33'))){if(_0x46a454['originated']>0x0){_0x46a454[_0x4db5('0x33')]-=0x1;}else{logger[_0x4db5('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x474015);}}}else{logger[_0x4db5('0x9')](_0x4db5('0x34'),_0x474015);}};exports[_0x4db5('0x35')]=function(_0x9af9fe){var _0x254595=moment()[_0x4db5('0x13')](_0x4db5('0x36'));_0x9af9fe['state']=0xd;_0x9af9fe[_0x4db5('0x37')]=_0x4db5('0x38');_0x9af9fe['starttime']=_0x254595;_0x9af9fe['responsetime']=_0x254595;_0x9af9fe[_0x4db5('0x39')]=_0x254595;};exports[_0x4db5('0x3a')]=function(_0x383f8c,_0x2df568,_0x4857e7){var _0x2dfc06=moment()['format'](_0x4db5('0x36'));_0x383f8c[_0x4db5('0x3b')]=_0x2df568;_0x383f8c[_0x4db5('0x37')]=_0x4857e7;_0x383f8c[_0x4db5('0x3c')]=_0x2dfc06;_0x383f8c[_0x4db5('0x3d')]=getSeconds(_0x383f8c[_0x4db5('0x3c')],_0x383f8c[_0x4db5('0x3e')]);};exports[_0x4db5('0x3f')]=function(_0x1d7172,_0x1038e7,_0x4f413e){_0x1d7172[_0x4db5('0x40')]=_0x1038e7;_0x1d7172[_0x4db5('0x41')]=_0x4f413e;};exports[_0x4db5('0x42')]=function(_0x208cb7,_0xf99cf2,_0xc32eb3){var _0x44fd38=moment()['format'](_0x4db5('0x36'));_0x208cb7[_0x4db5('0x3b')]=_0xf99cf2;_0x208cb7['statedesc']=_0xc32eb3;_0x208cb7[_0x4db5('0x3c')]=_0x208cb7[_0x4db5('0x3c')]?_0x208cb7[_0x4db5('0x3c')]:_0x44fd38;_0x208cb7[_0x4db5('0x39')]=_0x208cb7[_0x4db5('0x39')]?_0x208cb7[_0x4db5('0x39')]:_0x44fd38;_0x208cb7['ringtime']=getSeconds(_0x208cb7[_0x4db5('0x3c')]||0x0,_0x208cb7[_0x4db5('0x3e')]||0x0);_0x208cb7[_0x4db5('0x43')]=_0x208cb7['answertime']?getSeconds(_0x208cb7[_0x4db5('0x39')],_0x208cb7[_0x4db5('0x44')]):0x0;};exports[_0x4db5('0x45')]=function(_0xdb9826){return _0xdb9826===_0x4db5('0x46');};exports[_0x4db5('0x47')]=function(_0x3f8f18,_0x796e38,_0x2dcb59,_0x46e7c7,_0x3070fb){var _0x32bd3c=_0x46e7c7?_0x4db5('0x48'):_0x3f8f18[_0x4db5('0x18')];_0x32bd3c=_0x3070fb?_0x4db5('0x49'):_0x32bd3c;return{'actionid':_0x3f8f18['uniqueid'],'action':_0x4db5('0x4a'),'channel':_0x3f8f18[_0x4db5('0x4b')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x32bd3c,_0x3f8f18[_0x4db5('0x19')]),'Exten':_0x4db5('0x25'),'Context':_0x4db5('0x4c'),'Priority':'1','variable':_0x2dcb59,'timeout':(_0x796e38[_0x4db5('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3f8f18['uniqueid']};};exports[_0x4db5('0x4e')]=function(_0x4e7128){return _0x4e7128[_0x4db5('0x4f')]+_0x4e7128[_0x4db5('0x50')]+_0x4e7128['countnoanswerretry']+_0x4e7128[_0x4db5('0x51')]+_0x4e7128[_0x4db5('0x52')];};exports['cloneAction']=function(_0x45b5e6){var _0x4d3c94=_[_0x4db5('0x53')](_0x45b5e6);_0x4d3c94[_0x4db5('0x3b')]=0xf;_0x4d3c94[_0x4db5('0x37')]=_0x4db5('0x54');return _0x4d3c94;};exports[_0x4db5('0x55')]=function(_0x9edb24,_0x5ac8a2,_0x2d0918){var _0x9c4dc9={};_0x9c4dc9[_0x5ac8a2]=_0x9edb24[_0x5ac8a2];_0x9c4dc9[_0x4db5('0x56')]=![];_0x9c4dc9[_0x4db5('0x57')]=moment()[_0x4db5('0x58')](_0x2d0918,_0x4db5('0x59'))[_0x4db5('0x13')](_0x4db5('0x36'));_0x9c4dc9[_0x4db5('0x1a')]=_0x9edb24[_0x4db5('0x1a')];_0x9c4dc9[_0x4db5('0x5a')]=_0x9edb24[_0x4db5('0x5a')];_0x9c4dc9[_0x4db5('0x1c')]=_0x9edb24[_0x4db5('0x1c')]||undefined;return _0x9c4dc9;};exports[_0x4db5('0x5b')]=function(_0x2b6bb9,_0x5cc50d){if(!_['isNil'](_0x2b6bb9)){if(_0x2b6bb9['pTalking']>0x0){_0x2b6bb9[_0x4db5('0x5c')]-=0x1;}else{logger['error'](_0x5cc50d,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x4db5('0x9')](_0x5cc50d,_0x4db5('0x5d'));}};exports['IsNotLoggedIn']=function(_0x1c82e1){if(_0x1c82e1<=0x0){return!![];}return![];};exports['buildObj']=function(_0x53e47f,_0x500d81,_0x8e0090){_0x53e47f[_0x4db5('0x5e')]=_0x500d81;_0x53e47f['name']=_0x53e47f[_0x4db5('0x5f')];_0x53e47f[_0x4db5('0x60')]=_0x53e47f[_0x4db5('0x4b')];_0x53e47f[_0x4db5('0x61')]='voice';if(_0x8e0090){_0x53e47f[_0x4db5('0x62')]=_0x8e0090['mandatoryDisposition'];}return _0x53e47f;};exports[_0x4db5('0x63')]=function(_0x5d29cf){var _0x3052fb={};_0x3052fb['queue']=_0x5d29cf[_0x4db5('0x5f')];_0x3052fb[_0x4db5('0x60')]=_0x5d29cf[_0x4db5('0x4b')];_0x3052fb['uniqueid']=_0x5d29cf[_0x4db5('0x64')];return _0x3052fb;};exports[_0x4db5('0x65')]=function(_0xe0ba73){var _0x353a36=[];for(var _0x5c6069 in _0xe0ba73){if(_0xe0ba73[_0x4db5('0x2b')](_0x5c6069)){if(!_['isNil'](_0xe0ba73[_0x5c6069])&&_0xe0ba73[_0x5c6069][_0x4db5('0x3b')]===_0x4db5('0x66')&&_0xe0ba73[_0x5c6069][_0x4db5('0x67')]===_0x4db5('0x68')){_0x353a36[_0x4db5('0x69')](_0xe0ba73[_0x5c6069]['id']);}}}return _0x353a36;};exports['getDiff']=function(_0x5bd0b6){var _0xffd991=moment()[_0x4db5('0x6a')](0x0);var _0x44c0e0=moment(_0x5bd0b6)[_0x4db5('0x6a')](0x0);return _0xffd991[_0x4db5('0x6')](_0x44c0e0,'seconds');};exports[_0x4db5('0x6b')]=function(_0x2b45b9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2b45b9[_0x4db5('0x1a')],'ListId':_0x2b45b9['ListId'],'VoiceQueueId':_0x2b45b9[_0x4db5('0x1c')]||undefined,'CampaignId':_0x2b45b9[_0x4db5('0x6c')]||undefined};};exports[_0x4db5('0x6d')]=function(_0x29d8f5){if(_0x29d8f5===_0x4db5('0x64')||_0x29d8f5===_0x4db5('0x6e')||_0x29d8f5==='queue'||_0x29d8f5===_0x4db5('0x6f')||_0x29d8f5===_0x4db5('0x70')||_0x29d8f5==='dialAnswer'||_0x29d8f5===_0x4db5('0x40')||_0x29d8f5===_0x4db5('0x4b')||_0x29d8f5===_0x4db5('0x18')||_0x29d8f5===_0x4db5('0x56')||_0x29d8f5===_0x4db5('0x19')||_0x29d8f5===_0x4db5('0x57')||_0x29d8f5===_0x4db5('0x4f')||_0x29d8f5==='countcongestionretry'||_0x29d8f5===_0x4db5('0x71')||_0x29d8f5===_0x4db5('0x72')||_0x29d8f5===_0x4db5('0x73')||_0x29d8f5===_0x4db5('0x74')||_0x29d8f5===_0x4db5('0x75')||_0x29d8f5===_0x4db5('0x76')||_0x29d8f5===_0x4db5('0x1a')||_0x29d8f5==='ListId'||_0x29d8f5==='UserId'||_0x29d8f5===_0x4db5('0x1c')||_0x29d8f5===_0x4db5('0x77')||_0x29d8f5===_0x4db5('0x78')||_0x29d8f5===_0x4db5('0x79')||_0x29d8f5===_0x4db5('0x7a')||_0x29d8f5==='xmd-listid'||_0x29d8f5===_0x4db5('0x7b')||_0x29d8f5===_0x4db5('0x7c')||_0x29d8f5==='xmd-dialoptions'||_0x29d8f5===_0x4db5('0x7d')||_0x29d8f5===_0x4db5('0x7e')||_0x29d8f5===_0x4db5('0x7f')||_0x29d8f5==='xmd-cdrtype'||_0x29d8f5===_0x4db5('0x80')||_0x29d8f5==='xmd-agiafter'||_0x29d8f5===_0x4db5('0x81')||_0x29d8f5==='rtpaudioqos'||_0x29d8f5===_0x4db5('0x82')||_0x29d8f5==='rtpaudioqosjitter'||_0x29d8f5===_0x4db5('0x83')||_0x29d8f5==='rtpaudioqosloss'||_0x29d8f5===_0x4db5('0x84')||_0x29d8f5==='rtpaudioqosrtt'||_0x29d8f5===_0x4db5('0x85')||_0x29d8f5==='rtpaudioqos'||_0x29d8f5==='rtpaudioqosbridged'||_0x29d8f5===_0x4db5('0x86')||_0x29d8f5===_0x4db5('0x83')||_0x29d8f5===_0x4db5('0x87')||_0x29d8f5===_0x4db5('0x84')||_0x29d8f5===_0x4db5('0x88')||_0x29d8f5===_0x4db5('0x85')||_0x29d8f5===_0x4db5('0x89')||_0x29d8f5===_0x4db5('0x8a')||_0x29d8f5===_0x4db5('0x3b')||_0x29d8f5===_0x4db5('0x37')){return![];}return!![];};exports[_0x4db5('0x8b')]=function(_0x267bf6,_0x1b48dd){var _0x12926c,_0x46689a,_0x36671e;if(_0x1b48dd<=0x0){_0x1b48dd=0x1;}_0x12926c=new RegExp(_0x4db5('0x8c')+_0x1b48dd+'}$');_0x46689a=Math[_0x4db5('0x8d')](0xa,_0x1b48dd-0x1);_0x36671e=Math[_0x4db5('0x8d')](0xa,_0x1b48dd)-0x1;return util[_0x4db5('0x13')]('%s',_[_0x4db5('0x8e')](_0x267bf6,_0x12926c,_[_0x4db5('0x8f')](_0x46689a,_0x36671e)));};exports[_0x4db5('0x90')]=function(_0x53aae5){var _0x583a1e=_0x53aae5[_0x4db5('0x91')](/"(.*?)"/);return _0x583a1e?_0x583a1e[0x1]:_0x53aae5;};exports[_0x4db5('0x92')]=function(_0x13d6f0){var _0x6f50d1=_0x13d6f0['match'](/<(.*?)>/);return _0x6f50d1?_0x6f50d1[0x1]:_0x13d6f0;};
\ No newline at end of file
index 137b27b..393a31a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4875=['string','boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelredirect','queueadd'];(function(_0x5a8316,_0x36874b){var _0x325d0b=function(_0x1ea7c5){while(--_0x1ea7c5){_0x5a8316['push'](_0x5a8316['shift']());}};_0x325d0b(++_0x36874b);}(_0x4875,0x14f));var _0x5487=function(_0x11e8ac,_0xe2068f){_0x11e8ac=_0x11e8ac-0x0;var _0xc35fdf=_0x4875[_0x11e8ac];return _0xc35fdf;};'use strict';exports[_0x5487('0x0')]={'queue':{'type':_0x5487('0x1'),'required':!![]},'interface':{'type':_0x5487('0x1'),'required':!![]},'membername':{'type':_0x5487('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x5487('0x2'),'required':![]}};exports[_0x5487('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x5487('0x1'),'required':!![]}};exports[_0x5487('0x4')]={'interface':{'type':_0x5487('0x1'),'required':!![]},'paused':{'type':_0x5487('0x2')},'reason':{'type':'string','required':![]}};exports[_0x5487('0x5')]={'module':{'type':_0x5487('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x5487('0x1'),'required':!![]}};exports[_0x5487('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x5487('0x1')},'format':{'type':_0x5487('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x5487('0x1'),'required':!![]}};exports[_0x5487('0x7')]={'uniqueid':{'type':_0x5487('0x1'),'required':!![]},'exten':{'type':_0x5487('0x1'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0x8c2e=['number','boolean','queuepause','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x14d2b2,_0xeb9c73){var _0x43fbee=function(_0x5dcd01){while(--_0x5dcd01){_0x14d2b2['push'](_0x14d2b2['shift']());}};_0x43fbee(++_0xeb9c73);}(_0x8c2e,0x96));var _0xe8c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c2e[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0xe8c2('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xe8c2('0x1'),'required':!![]},'penalty':{'type':_0xe8c2('0x2'),'required':![]},'paused':{'type':_0xe8c2('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xe8c2('0x1'),'required':!![]},'interface':{'type':_0xe8c2('0x1'),'required':!![]}};exports[_0xe8c2('0x4')]={'interface':{'type':_0xe8c2('0x1'),'required':!![]},'paused':{'type':_0xe8c2('0x3')},'reason':{'type':_0xe8c2('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xe8c2('0x5')]={'uniqueid':{'type':_0xe8c2('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xe8c2('0x1'),'required':!![]},'filename':{'type':_0xe8c2('0x1')},'format':{'type':_0xe8c2('0x1')},'mixmonitorid':{'type':_0xe8c2('0x1')}};exports[_0xe8c2('0x6')]={'uniqueid':{'type':_0xe8c2('0x1'),'required':!![]}};exports[_0xe8c2('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xe8c2('0x1'),'required':!![]},'context':{'type':_0xe8c2('0x1')}};
\ No newline at end of file
index 260f15e..6495f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61fb=['dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','name','total','answered','sumDuration','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','mergeFromDatabase','initAgents','agents','length','isUndefined','prototype','initTelephones','telephones','initTrunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','seconds','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts'];(function(_0x6dab9,_0x5308f0){var _0x20c8da=function(_0xab1d53){while(--_0xab1d53){_0x6dab9['push'](_0x6dab9['shift']());}};_0x20c8da(++_0x5308f0);}(_0x61fb,0xad));var _0xb61f=function(_0x5aedf7,_0xb2ed87){_0x5aedf7=_0x5aedf7-0x0;var _0x2189b2=_0x61fb[_0x5aedf7];return _0x2189b2;};'use strict';var BPromise=require(_0xb61f('0x0'));var util=require(_0xb61f('0x1'));var _=require(_0xb61f('0x2'));var moment=require(_0xb61f('0x3'));var Agent=require('../model/agent');var Telephone=require(_0xb61f('0x4'));var Trunk=require(_0xb61f('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xb61f('0x6'));var Template=require(_0xb61f('0x7'));var Campaign=require(_0xb61f('0x8'));var VoiceExtension=require(_0xb61f('0x9'));var ZendeskAccount=require(_0xb61f('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xb61f('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xb61f('0xc'));var DeskAccount=require(_0xb61f('0xd'));var VtigerAccount=require(_0xb61f('0xe'));var ServicenowAccount=require(_0xb61f('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xb61f('0x10'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0xb61f('0x11')]={};this[_0xb61f('0x12')]={};this[_0xb61f('0x13')]={};this[_0xb61f('0x14')]={};this[_0xb61f('0x15')]={};this[_0xb61f('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb61f('0x17')]={};this[_0xb61f('0x18')]={};this[_0xb61f('0x19')]={};this[_0xb61f('0x1a')]={};this[_0xb61f('0x1b')]={};this['settings']={};this[_0xb61f('0x1c')]={};this['salesforceAccounts']={};this[_0xb61f('0x1d')]={};this[_0xb61f('0x1e')]={};this[_0xb61f('0x1f')]={};this[_0xb61f('0x20')]={};this[_0xb61f('0x21')]={};this[_0xb61f('0x22')]={};this[_0xb61f('0x23')]={};this[_0xb61f('0x24')]={};this[_0xb61f('0x25')]={};};function freeIsNotKey(_0x6e8e63,_0x5b2417,_0xc6dcbe){var _0x17194a=_[_0xb61f('0x26')](_0x6e8e63,function(_0x46ade4,_0x44d45e){return _0x46ade4[_0xc6dcbe];});for(var _0x12cb53 in _0x5b2417){if(_0x5b2417[_0xb61f('0x27')](_0x12cb53)){if(!_0x17194a[_0x12cb53]){delete _0x5b2417[_0x12cb53];}}}}function freeIsNotKeySip(_0x1da249,_0x5d3df1){var _0x3416c7=_['mapKeys'](_0x1da249,function(_0x54ecb5,_0x4a3388){return util[_0xb61f('0x28')](_0xb61f('0x29'),_0x54ecb5['name']);});for(var _0x331be4 in _0x5d3df1){if(_0x5d3df1[_0xb61f('0x27')](_0x331be4)){if(!_0x3416c7[_0x331be4]){delete _0x5d3df1[_0x331be4];}}}}function freeIsNotKeyAgent(_0x38a0ba,_0x388a72){var _0x284a6d=_[_0xb61f('0x26')](_0x38a0ba,function(_0x8a903f,_0x345865){var _0x2b77cf=_[_0xb61f('0x2a')](_0x8a903f[_0xb61f('0x2b')])?util['format'](_0xb61f('0x29'),_0x8a903f[_0xb61f('0x2c')]):_0x8a903f[_0xb61f('0x2b')];return _0x2b77cf;});for(var _0x344933 in _0x388a72){if(_0x388a72[_0xb61f('0x27')](_0x344933)){if(!_0x284a6d[_0x344933]){delete _0x388a72[_0x344933];}}}}function clearVoiceCallReports(_0xea7c67){_0xea7c67[_0xb61f('0x2d')]=0x0;_0xea7c67[_0xb61f('0x2e')]=0x0;_0xea7c67['sumHoldTime']=0x0;_0xea7c67[_0xb61f('0x2f')]=0x0;_0xea7c67['sumBillable']=0x0;}function clearCampaigns(_0x2249e0){if(!_[_0xb61f('0x30')](_0x2249e0)){for(var _0x573e18 in _0x2249e0){if(_0x2249e0[_0xb61f('0x27')](_0x573e18)){_0x2249e0[_0x573e18]['ivrTotalCallsDays']=0x0;_0x2249e0[_0x573e18][_0xb61f('0x31')]=0x0;}}}}function clearVoiceQueues(_0x55f44d){if(!_[_0xb61f('0x30')](_0x55f44d)){for(var _0x528a16 in _0x55f44d){if(_0x55f44d[_0xb61f('0x27')](_0x528a16)){_0x55f44d[_0x528a16][_0xb61f('0x2d')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x2e')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x32')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x33')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x34')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x2f')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x35')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x36')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x37')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x38')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x39')]=0x0;_0x55f44d[_0x528a16]['outboundNoSuchCallsDay']=0x0;_0x55f44d[_0x528a16]['outboundUnknownCallsDay']=0x0;_0x55f44d[_0x528a16][_0xb61f('0x3a')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x3b')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x3c')]=0x0;_0x55f44d[_0x528a16][_0xb61f('0x3d')]=0x0;_0x55f44d[_0x528a16]['outboundRejectCallsDay']=0x0;_0x55f44d[_0x528a16][_0xb61f('0x3e')]=0x0;_0x55f44d[_0x528a16]['outboundAnswerAgiCallsDay']=0x0;_0x55f44d[_0x528a16][_0xb61f('0x3f')]=0x0;_0x55f44d[_0x528a16]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0xb61f('0x40')]=function(_0x5e0c91,_0x144ce4){for(var _0x2ed8a7 in _0x144ce4){if(_0x5e0c91[_0xb61f('0x27')](_0x2ed8a7)){_0x5e0c91[_0x2ed8a7]=_0x144ce4[_0x2ed8a7];}}};Realtime['prototype'][_0xb61f('0x41')]=function(){var _0x117880=this;return function(_0x585fa8){if(_0x585fa8){freeIsNotKeyAgent(_0x585fa8,_0x117880[_0xb61f('0x42')]);for(var _0xc51654=0x0,_0x52c55d={},_0x3526e5={};_0xc51654<_0x585fa8[_0xb61f('0x43')];_0xc51654+=0x1){_0x52c55d=_0x585fa8[_0xc51654];var _0x14b7f0=_[_0xb61f('0x2a')](_0x52c55d[_0xb61f('0x2b')])?util[_0xb61f('0x28')]('SIP/%s',_0x52c55d[_0xb61f('0x2c')]):_0x52c55d[_0xb61f('0x2b')];if(_[_0xb61f('0x44')](_0x117880[_0xb61f('0x42')][_0x14b7f0])){_0x117880[_0xb61f('0x42')][_0x14b7f0]=new Agent(_0x52c55d);}else{_0x117880[_0xb61f('0x40')](_0x117880[_0xb61f('0x42')][_0x14b7f0],_0x52c55d);}}}return _0x117880[_0xb61f('0x42')];};};Realtime[_0xb61f('0x45')][_0xb61f('0x46')]=function(){var _0x28f926=this;return function(_0x593b21){if(_0x593b21){freeIsNotKeySip(_0x593b21,_0x28f926[_0xb61f('0x47')]);for(var _0x27a08f=0x0,_0x2039d3={},_0x2390a8={};_0x27a08f<_0x593b21[_0xb61f('0x43')];_0x27a08f+=0x1){_0x2039d3=_0x593b21[_0x27a08f];if(_[_0xb61f('0x44')](_0x28f926[_0xb61f('0x47')][util[_0xb61f('0x28')]('SIP/%s',_0x2039d3[_0xb61f('0x2c')])])){_0x28f926[_0xb61f('0x47')][util[_0xb61f('0x28')](_0xb61f('0x29'),_0x2039d3[_0xb61f('0x2c')])]=new Telephone(_0x2039d3);}else{_0x28f926[_0xb61f('0x40')](_0x28f926[_0xb61f('0x47')][util[_0xb61f('0x28')]('SIP/%s',_0x2039d3['name'])],_0x2039d3);}}}return _0x28f926['telephones'];};};Realtime[_0xb61f('0x45')][_0xb61f('0x48')]=function(){var _0x385590=this;return function(_0x13a06a){if(_0x13a06a){freeIsNotKeySip(_0x13a06a,_0x385590[_0xb61f('0x11')]);for(var _0x1eb9b8=0x0,_0x4c3a9f={},_0x58e17f={};_0x1eb9b8<_0x13a06a[_0xb61f('0x43')];_0x1eb9b8+=0x1){_0x4c3a9f=_0x13a06a[_0x1eb9b8];if(_[_0xb61f('0x44')](_0x385590[_0xb61f('0x11')][util['format'](_0xb61f('0x29'),_0x4c3a9f[_0xb61f('0x2c')])])){_0x385590[_0xb61f('0x11')][util[_0xb61f('0x28')](_0xb61f('0x29'),_0x4c3a9f['name'])]=new Trunk(_0x4c3a9f);}else{_0x385590['mergeFromDatabase'](_0x385590['trunks'][util[_0xb61f('0x28')](_0xb61f('0x29'),_0x4c3a9f[_0xb61f('0x2c')])],_0x4c3a9f);}}}return _0x385590[_0xb61f('0x11')];};};Realtime[_0xb61f('0x45')]['initVoiceQueues']=function(){var _0x5caade=this;return function(_0x894537){if(_0x894537){freeIsNotKey(_0x894537,_0x5caade[_0xb61f('0x12')],_0xb61f('0x2c'));for(var _0x279d87=0x0,_0xdf4b78={},_0x15b314={};_0x279d87<_0x894537['length'];_0x279d87+=0x1){_0xdf4b78=_0x894537[_0x279d87];if(_[_0xb61f('0x44')](_0x5caade[_0xb61f('0x12')][_0xdf4b78[_0xb61f('0x2c')]])){_0x5caade[_0xb61f('0x12')][_0xdf4b78[_0xb61f('0x2c')]]=new VoiceQueue(_0xdf4b78);}else{_0x5caade[_0xb61f('0x40')](_0x5caade[_0xb61f('0x12')][_0xdf4b78[_0xb61f('0x2c')]],_0xdf4b78);}}}return _0x5caade[_0xb61f('0x12')];};};Realtime['prototype'][_0xb61f('0x49')]=function(){var _0x536f10=this;return function(_0x457d64){if(_0x457d64){freeIsNotKey(_0x457d64,_0x536f10[_0xb61f('0x13')],'id');for(var _0x32b83b=0x0,_0x59f747={},_0xd7d091={};_0x32b83b<_0x457d64['length'];_0x32b83b+=0x1){_0x59f747=_0x457d64[_0x32b83b];if(_['isUndefined'](_0x536f10['triggers'][_0x59f747['id']])){_0x536f10[_0xb61f('0x13')][_0x59f747['id']]=new Trigger(_0x59f747);}else{_0x536f10['mergeFromDatabase'](_0x536f10[_0xb61f('0x13')][_0x59f747['id']],_0x59f747);}}}return _0x536f10[_0xb61f('0x13')];};};Realtime[_0xb61f('0x45')][_0xb61f('0x4a')]=function(){var _0x10e500=this;return function(_0x4e151d){if(_0x4e151d){freeIsNotKey(_0x4e151d,_0x10e500[_0xb61f('0x15')],'id');for(var _0x4ced6f=0x0,_0x2e826b={},_0x2f7303={};_0x4ced6f<_0x4e151d[_0xb61f('0x43')];_0x4ced6f+=0x1){_0x2e826b=_0x4e151d[_0x4ced6f];if(_[_0xb61f('0x44')](_0x10e500['templates'][_0x2e826b['id']])){_0x10e500[_0xb61f('0x15')][_0x2e826b['id']]=new Template(_0x2e826b);}else{_0x10e500[_0xb61f('0x40')](_0x10e500['templates'][_0x2e826b['id']],_0x2e826b);}}}return _0x10e500[_0xb61f('0x15')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x30edea=this;return function(_0x2f29c9){if(_0x2f29c9){freeIsNotKey(_0x2f29c9,_0x30edea['zendeskAccounts'],'id');for(var _0xb4876a=0x0,_0x108a5a={},_0xdec384={};_0xb4876a<_0x2f29c9[_0xb61f('0x43')];_0xb4876a+=0x1){_0x108a5a=_0x2f29c9[_0xb4876a];if(_[_0xb61f('0x44')](_0x30edea['zendeskAccounts'][_0x108a5a['id']])){_0x30edea[_0xb61f('0x1c')][_0x108a5a['id']]=new ZendeskAccount(_0x108a5a);}else{_0x30edea['mergeFromDatabase'](_0x30edea[_0xb61f('0x1c')][_0x108a5a['id']],_0x108a5a);}}}return _0x30edea[_0xb61f('0x1c')];};};Realtime[_0xb61f('0x45')]['initSalesforceAccounts']=function(){var _0x17beb1=this;return function(_0x1c59dc){if(_0x1c59dc){freeIsNotKey(_0x1c59dc,_0x17beb1[_0xb61f('0x4b')],'id');for(var _0x171f50=0x0,_0x288d2f={},_0x2fb74e={};_0x171f50<_0x1c59dc[_0xb61f('0x43')];_0x171f50+=0x1){_0x288d2f=_0x1c59dc[_0x171f50];if(_['isUndefined'](_0x17beb1[_0xb61f('0x4b')][_0x288d2f['id']])){_0x17beb1[_0xb61f('0x4b')][_0x288d2f['id']]=new SalesforceAccount(_0x288d2f);}else{_0x17beb1[_0xb61f('0x40')](_0x17beb1['salesforceAccounts'][_0x288d2f['id']],_0x288d2f);}}}return _0x17beb1[_0xb61f('0x4b')];};};Realtime[_0xb61f('0x45')]['initFreshdeskAccounts']=function(){var _0x5ed8e1=this;return function(_0x3d16d2){if(_0x3d16d2){freeIsNotKey(_0x3d16d2,_0x5ed8e1[_0xb61f('0x1e')],'id');for(var _0x150428=0x0,_0x51de30={},_0x461823={};_0x150428<_0x3d16d2['length'];_0x150428+=0x1){_0x51de30=_0x3d16d2[_0x150428];if(_[_0xb61f('0x44')](_0x5ed8e1['freshdeskAccounts'][_0x51de30['id']])){_0x5ed8e1[_0xb61f('0x1e')][_0x51de30['id']]=new FreshdeskAccount(_0x51de30);}else{_0x5ed8e1[_0xb61f('0x40')](_0x5ed8e1[_0xb61f('0x1e')][_0x51de30['id']],_0x51de30);}}}return _0x5ed8e1[_0xb61f('0x1e')];};};Realtime['prototype'][_0xb61f('0x4c')]=function(){var _0x49d47e=this;return function(_0x57373f){if(_0x57373f){freeIsNotKey(_0x57373f,_0x49d47e[_0xb61f('0x1f')],'id');for(var _0x383682=0x0,_0x4db1f9={},_0x64b0b5={};_0x383682<_0x57373f[_0xb61f('0x43')];_0x383682+=0x1){_0x4db1f9=_0x57373f[_0x383682];if(_[_0xb61f('0x44')](_0x49d47e[_0xb61f('0x1f')][_0x4db1f9['id']])){_0x49d47e['zohoAccounts'][_0x4db1f9['id']]=new ZohoAccount(_0x4db1f9);}else{_0x49d47e[_0xb61f('0x40')](_0x49d47e[_0xb61f('0x1f')][_0x4db1f9['id']],_0x4db1f9);}}}return _0x49d47e[_0xb61f('0x1f')];};};Realtime[_0xb61f('0x45')][_0xb61f('0x4d')]=function(){var _0x419063=this;return function(_0x300a69){if(_0x300a69){freeIsNotKey(_0x300a69,_0x419063[_0xb61f('0x20')],'id');for(var _0x32feff=0x0,_0x519121={},_0x39dd05={};_0x32feff<_0x300a69[_0xb61f('0x43')];_0x32feff+=0x1){_0x519121=_0x300a69[_0x32feff];if(_['isUndefined'](_0x419063[_0xb61f('0x20')][_0x519121['id']])){_0x419063[_0xb61f('0x20')][_0x519121['id']]=new DeskAccount(_0x519121);}else{_0x419063[_0xb61f('0x40')](_0x419063['deskAccounts'][_0x519121['id']],_0x519121);}}}return _0x419063[_0xb61f('0x20')];};};Realtime[_0xb61f('0x45')]['initSugarcrmAccounts']=function(){var _0x1112f6=this;return function(_0x4a1a04){if(_0x4a1a04){freeIsNotKey(_0x4a1a04,_0x1112f6[_0xb61f('0x1d')],'id');for(var _0x4ab3f2=0x0,_0x228584={},_0x40b6be={};_0x4ab3f2<_0x4a1a04[_0xb61f('0x43')];_0x4ab3f2+=0x1){_0x228584=_0x4a1a04[_0x4ab3f2];if(_[_0xb61f('0x44')](_0x1112f6[_0xb61f('0x1d')][_0x228584['id']])){_0x1112f6['sugarcrmAccounts'][_0x228584['id']]=new SugarcrmAccount(_0x228584);}else{_0x1112f6[_0xb61f('0x40')](_0x1112f6[_0xb61f('0x1d')][_0x228584['id']],_0x228584);}}}return _0x1112f6['sugarcrmAccounts'];};};Realtime[_0xb61f('0x45')]['initVtigerAccounts']=function(){var _0x3877c3=this;return function(_0x2c8d00){if(_0x2c8d00){freeIsNotKey(_0x2c8d00,_0x3877c3['vtigerAccounts'],'id');for(var _0x241a7e=0x0,_0x5f12eb={},_0x20302c={};_0x241a7e<_0x2c8d00['length'];_0x241a7e+=0x1){_0x5f12eb=_0x2c8d00[_0x241a7e];if(_['isUndefined'](_0x3877c3[_0xb61f('0x21')][_0x5f12eb['id']])){_0x3877c3[_0xb61f('0x21')][_0x5f12eb['id']]=new VtigerAccount(_0x5f12eb);}else{_0x3877c3[_0xb61f('0x40')](_0x3877c3['vtigerAccounts'][_0x5f12eb['id']],_0x5f12eb);}}}return _0x3877c3['vtigerAccounts'];};};Realtime[_0xb61f('0x45')][_0xb61f('0x4e')]=function(){var _0xd8e7aa=this;return function(_0x1d0869){if(_0x1d0869){freeIsNotKey(_0x1d0869,_0xd8e7aa[_0xb61f('0x22')],'id');for(var _0x58e529=0x0,_0x51310d={},_0x4c1692={};_0x58e529<_0x1d0869['length'];_0x58e529+=0x1){_0x51310d=_0x1d0869[_0x58e529];if(_[_0xb61f('0x44')](_0xd8e7aa[_0xb61f('0x22')][_0x51310d['id']])){_0xd8e7aa['servicenowAccounts'][_0x51310d['id']]=new ServicenowAccount(_0x51310d);}else{_0xd8e7aa['mergeFromDatabase'](_0xd8e7aa[_0xb61f('0x22')][_0x51310d['id']],_0x51310d);}}}return _0xd8e7aa[_0xb61f('0x22')];};};Realtime['prototype'][_0xb61f('0x4f')]=function(){var _0x4fef14=this;return function(_0x4f89b9){if(_0x4f89b9){freeIsNotKey(_0x4f89b9,_0x4fef14['dynamics365Accounts'],'id');for(var _0x5eae99=0x0,_0x147905={},_0x27764c={};_0x5eae99<_0x4f89b9[_0xb61f('0x43')];_0x5eae99+=0x1){_0x147905=_0x4f89b9[_0x5eae99];if(_[_0xb61f('0x44')](_0x4fef14[_0xb61f('0x23')][_0x147905['id']])){_0x4fef14[_0xb61f('0x23')][_0x147905['id']]=new Dynamics365Account(_0x147905);}else{_0x4fef14[_0xb61f('0x40')](_0x4fef14[_0xb61f('0x23')][_0x147905['id']],_0x147905);}}}return _0x4fef14[_0xb61f('0x23')];};};Realtime[_0xb61f('0x45')][_0xb61f('0x50')]=function(){var _0x3424aa=this;return function(_0x20cfc1){if(_0x20cfc1){freeIsNotKey(_0x20cfc1,_0x3424aa['freshsalesAccounts'],'id');for(var _0x5c4371=0x0,_0x5e2085={},_0x2adab1={};_0x5c4371<_0x20cfc1[_0xb61f('0x43')];_0x5c4371+=0x1){_0x5e2085=_0x20cfc1[_0x5c4371];if(_[_0xb61f('0x44')](_0x3424aa['freshsalesAccounts'][_0x5e2085['id']])){_0x3424aa['freshsalesAccounts'][_0x5e2085['id']]=new FreshsalesAccount(_0x5e2085);}else{_0x3424aa[_0xb61f('0x40')](_0x3424aa[_0xb61f('0x24')][_0x5e2085['id']],_0x5e2085);}}}return _0x3424aa[_0xb61f('0x24')];};};Realtime[_0xb61f('0x45')][_0xb61f('0x51')]=function(){var _0x4e07dd=this;return function(_0x53191c){for(var _0x5ca705=0x0;_0x5ca705<_0x53191c[_0xb61f('0x43')];_0x5ca705+=0x1){_['merge'](_0x4e07dd[_0xb61f('0x12')][_0x53191c[_0x5ca705]['name']],_0x53191c[_0x5ca705]);}return _0x4e07dd[_0xb61f('0x12')];};};Realtime['prototype'][_0xb61f('0x52')]=function(){var _0x35185d=this;return function(_0x273b24){clearVoiceQueues(_0x35185d[_0xb61f('0x12')]);if(_0x273b24){_0x273b24=_[_0xb61f('0x53')](_0x273b24,_0xb61f('0x54'));for(var _0x189e8e in _0x273b24){if(_0x273b24[_0xb61f('0x27')](_0x189e8e)){var _0x15bdb5={};for(var _0xf037fd=0x0;_0xf037fd<_0x273b24[_0x189e8e]['length'];_0xf037fd+=0x1){var _0x535ebf=_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x55')];if(_0x35185d[_0xb61f('0x12')][_0x535ebf]){if(_0x273b24[_0x189e8e][_0xf037fd]['queuecallerexit']){_0x35185d['voiceQueues'][_0x535ebf][_0xb61f('0x32')]+=0x1;}if(_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x56')]){_0x35185d['voiceQueues'][_0x535ebf][_0xb61f('0x33')]+=0x1;}_0x35185d[_0xb61f('0x12')][_0x535ebf]['sumHoldTime']+=moment(_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x57')])[_0xb61f('0x58')](moment(_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x59')]),'seconds')||0x0;if(_0xf037fd===_0x273b24[_0x189e8e][_0xb61f('0x43')]-0x1){_0x35185d[_0xb61f('0x12')][_0x535ebf][_0xb61f('0x2f')]+=moment(_0x273b24[_0x189e8e][_0xf037fd]['queuecallercompleteAt']||_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x5a')]||_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x5b')])[_0xb61f('0x58')](moment(_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x59')]),'seconds')||0x0;_0x35185d[_0xb61f('0x12')][_0x535ebf]['total']+=0x1;if(_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x5c')]){_0x35185d[_0xb61f('0x12')][_0x535ebf]['answered']+=0x1;_0x35185d[_0xb61f('0x12')][_0x535ebf]['sumBillable']+=moment(_0x273b24[_0x189e8e][_0xf037fd]['queuecallercompleteAt'])[_0xb61f('0x58')](moment(_0x273b24[_0x189e8e][_0xf037fd][_0xb61f('0x57')]),_0xb61f('0x5d'))||0x0;}}else{_0x35185d[_0xb61f('0x12')][_0x535ebf][_0xb61f('0x2f')]+=_0x35185d[_0xb61f('0x12')][_0x535ebf][_0xb61f('0x34')]||0x0;}}}}}}return _0x35185d[_0xb61f('0x12')];};};Realtime['prototype'][_0xb61f('0x5e')]=function(){var _0x178287=this;return function(_0x4b352d){clearVoiceCallReports(_0x178287[_0xb61f('0x16')]);if(_0x4b352d){for(var _0x355656=0x0;_0x355656<_0x4b352d[_0xb61f('0x43')];_0x355656+=0x1){_0x178287['outbound']['total']+=0x1;_0x178287['outbound'][_0xb61f('0x2f')]+=_0x4b352d[_0x355656][_0xb61f('0x5f')];if(_0x4b352d[_0x355656][_0xb61f('0x60')]==='ANSWERED'){_0x178287['outbound'][_0xb61f('0x2e')]+=0x1;_0x178287[_0xb61f('0x16')][_0xb61f('0x34')]+=_0x4b352d[_0x355656]['duration']-_0x4b352d[_0x355656]['billableseconds']||0x0;_0x178287[_0xb61f('0x16')]['sumBillable']+=_0x4b352d[_0x355656][_0xb61f('0x61')];}}}return _0x178287['outbound'];};};Realtime[_0xb61f('0x45')][_0xb61f('0x62')]=function(){var _0x2ea3c1=this;return function(_0x20b780){if(_0x20b780){freeIsNotKey(_0x20b780,_0x2ea3c1[_0xb61f('0x14')],_0xb61f('0x2c'));for(var _0x59774c=0x0,_0x11487b={};_0x59774c<_0x20b780[_0xb61f('0x43')];_0x59774c+=0x1){_0x11487b=_0x20b780[_0x59774c];if(_['isUndefined'](_0x2ea3c1[_0xb61f('0x14')][_0x11487b[_0xb61f('0x2c')]])){_0x2ea3c1['campaigns'][_0x11487b[_0xb61f('0x2c')]]=new Campaign(_0x11487b);}else{_0x2ea3c1['mergeFromDatabase'](_0x2ea3c1[_0xb61f('0x14')][_0x11487b['name']],_0x11487b);_0x2ea3c1[_0xb61f('0x14')][_0x11487b[_0xb61f('0x2c')]]['dialQueueProject']=_0x11487b[_0xb61f('0x63')]?_0x11487b['SquareProject'][_0xb61f('0x2c')]:undefined;}}}return _0x2ea3c1[_0xb61f('0x14')];};};Realtime[_0xb61f('0x45')][_0xb61f('0x64')]=function(){var _0x1198cf=this;return function(_0x29332a){if(_0x29332a){freeIsNotKey(_0x29332a,_0x1198cf[_0xb61f('0x17')],'id');for(var _0x3a8e37=0x0,_0x95d03c={};_0x3a8e37<_0x29332a[_0xb61f('0x43')];_0x3a8e37+=0x1){_0x95d03c=_0x29332a[_0x3a8e37];if(_[_0xb61f('0x44')](_0x1198cf['voiceExtensions'][_0x95d03c['id']])){_0x1198cf['voiceExtensions'][_0x95d03c['id']]=new VoiceExtension(_0x95d03c);}else{_0x1198cf[_0xb61f('0x40')](_0x1198cf[_0xb61f('0x17')][_0x95d03c['id']],_0x95d03c);}}}return _0x1198cf['voiceExtensions'];};};Realtime[_0xb61f('0x45')][_0xb61f('0x65')]=function(){var _0xd7fb03=this;return function(_0x4c3ace){clearCampaigns(_0xd7fb03[_0xb61f('0x14')]);for(var _0x56bd5e=0x0;_0x56bd5e<_0x4c3ace[_0xb61f('0x43')];_0x56bd5e+=0x1){_[_0xb61f('0x66')](_0xd7fb03[_0xb61f('0x14')][_0x4c3ace[_0x56bd5e]['name']],_0x4c3ace[_0x56bd5e]);}return _0xd7fb03['campaigns'];};};Realtime[_0xb61f('0x45')][_0xb61f('0x67')]=function(){var _0x120d0d=this;return function(_0x1cd7cb){if(_0x1cd7cb){freeIsNotKey(_0x1cd7cb,_0x120d0d[_0xb61f('0x25')],'id');for(var _0x185f57=0x0,_0x5cb68b={},_0x30cfa6={};_0x185f57<_0x1cd7cb[_0xb61f('0x43')];_0x185f57+=0x1){_0x5cb68b=_0x1cd7cb[_0x185f57];if(_[_0xb61f('0x44')](_0x120d0d[_0xb61f('0x25')][_0x5cb68b['id']])){_0x120d0d[_0xb61f('0x25')][_0x5cb68b['id']]=new FaxAccount(_0x5cb68b);}else{_0x120d0d[_0xb61f('0x40')](_0x120d0d[_0xb61f('0x25')][_0x5cb68b['id']],_0x5cb68b);}}}return _0x120d0d['faxAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
+var _0x9df7=['merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','name','interface','total','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','SIP/%s','mergeFromDatabase','isUndefined','telephones','initTrunks','length','initVoiceQueues','triggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initFreshsalesAccounts'];(function(_0x635e28,_0x4eecc1){var _0x5bb9dc=function(_0x4e4486){while(--_0x4e4486){_0x635e28['push'](_0x635e28['shift']());}};_0x5bb9dc(++_0x4eecc1);}(_0x9df7,0x168));var _0x79df=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x9df7[_0x13b392];return _0x39db24;};'use strict';var BPromise=require(_0x79df('0x0'));var util=require(_0x79df('0x1'));var _=require(_0x79df('0x2'));var moment=require(_0x79df('0x3'));var Agent=require(_0x79df('0x4'));var Telephone=require(_0x79df('0x5'));var Trunk=require(_0x79df('0x6'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x79df('0x7'));var Template=require(_0x79df('0x8'));var Campaign=require(_0x79df('0x9'));var VoiceExtension=require(_0x79df('0xa'));var ZendeskAccount=require(_0x79df('0xb'));var SalesforceAccount=require(_0x79df('0xc'));var FreshdeskAccount=require(_0x79df('0xd'));var SugarcrmAccount=require(_0x79df('0xe'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x79df('0xf'));var VtigerAccount=require(_0x79df('0x10'));var ServicenowAccount=require(_0x79df('0x11'));var Dynamics365Account=require(_0x79df('0x12'));var FreshsalesAccount=require(_0x79df('0x13'));var FaxAccount=require(_0x79df('0x14'));var Realtime=function(){this[_0x79df('0x15')]={};this['telephones']={};this[_0x79df('0x16')]={};this[_0x79df('0x17')]={};this['triggers']={};this['campaigns']={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x79df('0x18')]={};this[_0x79df('0x19')]={};this[_0x79df('0x1a')]={};this[_0x79df('0x1b')]={};this[_0x79df('0x1c')]={};this['settings']={};this[_0x79df('0x1d')]={};this[_0x79df('0x1e')]={};this['sugarcrmAccounts']={};this[_0x79df('0x1f')]={};this[_0x79df('0x20')]={};this['deskAccounts']={};this[_0x79df('0x21')]={};this[_0x79df('0x22')]={};this[_0x79df('0x23')]={};this[_0x79df('0x24')]={};this['faxAccounts']={};};function freeIsNotKey(_0x45e189,_0x6f5eb,_0x30fa8b){var _0x49841a=_[_0x79df('0x25')](_0x45e189,function(_0xc3122b,_0xae8f2e){return _0xc3122b[_0x30fa8b];});for(var _0x259f6b in _0x6f5eb){if(_0x6f5eb[_0x79df('0x26')](_0x259f6b)){if(!_0x49841a[_0x259f6b]){delete _0x6f5eb[_0x259f6b];}}}}function freeIsNotKeySip(_0x510347,_0x24c97f){var _0x187507=_['mapKeys'](_0x510347,function(_0xa5bda7,_0x11b7f9){return util[_0x79df('0x27')]('SIP/%s',_0xa5bda7[_0x79df('0x28')]);});for(var _0x598d0a in _0x24c97f){if(_0x24c97f[_0x79df('0x26')](_0x598d0a)){if(!_0x187507[_0x598d0a]){delete _0x24c97f[_0x598d0a];}}}}function freeIsNotKeyAgent(_0x447c56,_0x86bd17){var _0x565f2e=_['mapKeys'](_0x447c56,function(_0xb7f0fa,_0x3f3451){var _0x50f40c=_['isNil'](_0xb7f0fa[_0x79df('0x29')])?util['format']('SIP/%s',_0xb7f0fa['name']):_0xb7f0fa[_0x79df('0x29')];return _0x50f40c;});for(var _0x379b4d in _0x86bd17){if(_0x86bd17[_0x79df('0x26')](_0x379b4d)){if(!_0x565f2e[_0x379b4d]){delete _0x86bd17[_0x379b4d];}}}}function clearVoiceCallReports(_0x482d01){_0x482d01[_0x79df('0x2a')]=0x0;_0x482d01[_0x79df('0x2b')]=0x0;_0x482d01['sumHoldTime']=0x0;_0x482d01[_0x79df('0x2c')]=0x0;_0x482d01['sumBillable']=0x0;}function clearCampaigns(_0x31f2a7){if(!_[_0x79df('0x2d')](_0x31f2a7)){for(var _0x2fb9bb in _0x31f2a7){if(_0x31f2a7[_0x79df('0x26')](_0x2fb9bb)){_0x31f2a7[_0x2fb9bb][_0x79df('0x2e')]=0x0;_0x31f2a7[_0x2fb9bb][_0x79df('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x2a81c3){if(!_['isEmpty'](_0x2a81c3)){for(var _0x40a98d in _0x2a81c3){if(_0x2a81c3['hasOwnProperty'](_0x40a98d)){_0x2a81c3[_0x40a98d]['total']=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x2b')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x30')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x31')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x32')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x2c')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x33')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x34')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x35')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x36')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x37')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x38')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x39')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x3a')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x3b')]=0x0;_0x2a81c3[_0x40a98d]['outboundBlacklistCallsDay']=0x0;_0x2a81c3[_0x40a98d]['outboundOriginateFailureCallsDay']=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x3c')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x3d')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x34')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x3e')]=0x0;_0x2a81c3[_0x40a98d][_0x79df('0x3f')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0xb5379a,_0x18858d){for(var _0x433543 in _0x18858d){if(_0xb5379a[_0x79df('0x26')](_0x433543)){_0xb5379a[_0x433543]=_0x18858d[_0x433543];}}};Realtime[_0x79df('0x40')]['initAgents']=function(){var _0x568a7e=this;return function(_0x323bd4){if(_0x323bd4){freeIsNotKeyAgent(_0x323bd4,_0x568a7e[_0x79df('0x15')]);for(var _0x50d920=0x0,_0x2284e4={},_0x42563f={};_0x50d920<_0x323bd4['length'];_0x50d920+=0x1){_0x2284e4=_0x323bd4[_0x50d920];var _0x30293d=_['isNil'](_0x2284e4[_0x79df('0x29')])?util[_0x79df('0x27')](_0x79df('0x41'),_0x2284e4['name']):_0x2284e4[_0x79df('0x29')];if(_['isUndefined'](_0x568a7e[_0x79df('0x15')][_0x30293d])){_0x568a7e[_0x79df('0x15')][_0x30293d]=new Agent(_0x2284e4);}else{_0x568a7e[_0x79df('0x42')](_0x568a7e['agents'][_0x30293d],_0x2284e4);}}}return _0x568a7e[_0x79df('0x15')];};};Realtime[_0x79df('0x40')]['initTelephones']=function(){var _0x5aa2ce=this;return function(_0x3d1efc){if(_0x3d1efc){freeIsNotKeySip(_0x3d1efc,_0x5aa2ce['telephones']);for(var _0x1558bf=0x0,_0x2ae7f0={},_0x1a6a77={};_0x1558bf<_0x3d1efc['length'];_0x1558bf+=0x1){_0x2ae7f0=_0x3d1efc[_0x1558bf];if(_[_0x79df('0x43')](_0x5aa2ce['telephones'][util['format'](_0x79df('0x41'),_0x2ae7f0[_0x79df('0x28')])])){_0x5aa2ce['telephones'][util[_0x79df('0x27')]('SIP/%s',_0x2ae7f0[_0x79df('0x28')])]=new Telephone(_0x2ae7f0);}else{_0x5aa2ce[_0x79df('0x42')](_0x5aa2ce[_0x79df('0x44')][util[_0x79df('0x27')](_0x79df('0x41'),_0x2ae7f0['name'])],_0x2ae7f0);}}}return _0x5aa2ce[_0x79df('0x44')];};};Realtime[_0x79df('0x40')][_0x79df('0x45')]=function(){var _0x801f01=this;return function(_0x4a43a9){if(_0x4a43a9){freeIsNotKeySip(_0x4a43a9,_0x801f01[_0x79df('0x16')]);for(var _0x9359e3=0x0,_0x26cbb5={},_0x5be04d={};_0x9359e3<_0x4a43a9[_0x79df('0x46')];_0x9359e3+=0x1){_0x26cbb5=_0x4a43a9[_0x9359e3];if(_['isUndefined'](_0x801f01[_0x79df('0x16')][util['format']('SIP/%s',_0x26cbb5['name'])])){_0x801f01[_0x79df('0x16')][util['format'](_0x79df('0x41'),_0x26cbb5['name'])]=new Trunk(_0x26cbb5);}else{_0x801f01[_0x79df('0x42')](_0x801f01['trunks'][util[_0x79df('0x27')]('SIP/%s',_0x26cbb5[_0x79df('0x28')])],_0x26cbb5);}}}return _0x801f01[_0x79df('0x16')];};};Realtime[_0x79df('0x40')][_0x79df('0x47')]=function(){var _0x2abbf8=this;return function(_0x5058a1){if(_0x5058a1){freeIsNotKey(_0x5058a1,_0x2abbf8[_0x79df('0x17')],'name');for(var _0x19bc2f=0x0,_0x5f1775={},_0x3807b1={};_0x19bc2f<_0x5058a1['length'];_0x19bc2f+=0x1){_0x5f1775=_0x5058a1[_0x19bc2f];if(_[_0x79df('0x43')](_0x2abbf8['voiceQueues'][_0x5f1775[_0x79df('0x28')]])){_0x2abbf8[_0x79df('0x17')][_0x5f1775[_0x79df('0x28')]]=new VoiceQueue(_0x5f1775);}else{_0x2abbf8[_0x79df('0x42')](_0x2abbf8[_0x79df('0x17')][_0x5f1775[_0x79df('0x28')]],_0x5f1775);}}}return _0x2abbf8[_0x79df('0x17')];};};Realtime['prototype']['initTriggers']=function(){var _0x99c51a=this;return function(_0x47d758){if(_0x47d758){freeIsNotKey(_0x47d758,_0x99c51a['triggers'],'id');for(var _0x5436d8=0x0,_0x1414ff={},_0x2c7a24={};_0x5436d8<_0x47d758[_0x79df('0x46')];_0x5436d8+=0x1){_0x1414ff=_0x47d758[_0x5436d8];if(_[_0x79df('0x43')](_0x99c51a['triggers'][_0x1414ff['id']])){_0x99c51a[_0x79df('0x48')][_0x1414ff['id']]=new Trigger(_0x1414ff);}else{_0x99c51a[_0x79df('0x42')](_0x99c51a[_0x79df('0x48')][_0x1414ff['id']],_0x1414ff);}}}return _0x99c51a[_0x79df('0x48')];};};Realtime[_0x79df('0x40')][_0x79df('0x49')]=function(){var _0x61cc5f=this;return function(_0x326708){if(_0x326708){freeIsNotKey(_0x326708,_0x61cc5f[_0x79df('0x4a')],'id');for(var _0x509dbe=0x0,_0x190021={},_0x5ca243={};_0x509dbe<_0x326708[_0x79df('0x46')];_0x509dbe+=0x1){_0x190021=_0x326708[_0x509dbe];if(_[_0x79df('0x43')](_0x61cc5f[_0x79df('0x4a')][_0x190021['id']])){_0x61cc5f[_0x79df('0x4a')][_0x190021['id']]=new Template(_0x190021);}else{_0x61cc5f[_0x79df('0x42')](_0x61cc5f[_0x79df('0x4a')][_0x190021['id']],_0x190021);}}}return _0x61cc5f[_0x79df('0x4a')];};};Realtime[_0x79df('0x40')][_0x79df('0x4b')]=function(){var _0x80a390=this;return function(_0x89f376){if(_0x89f376){freeIsNotKey(_0x89f376,_0x80a390[_0x79df('0x1d')],'id');for(var _0x5c4ff1=0x0,_0x38d0bf={},_0x18c76f={};_0x5c4ff1<_0x89f376[_0x79df('0x46')];_0x5c4ff1+=0x1){_0x38d0bf=_0x89f376[_0x5c4ff1];if(_[_0x79df('0x43')](_0x80a390['zendeskAccounts'][_0x38d0bf['id']])){_0x80a390[_0x79df('0x1d')][_0x38d0bf['id']]=new ZendeskAccount(_0x38d0bf);}else{_0x80a390[_0x79df('0x42')](_0x80a390[_0x79df('0x1d')][_0x38d0bf['id']],_0x38d0bf);}}}return _0x80a390[_0x79df('0x1d')];};};Realtime[_0x79df('0x40')][_0x79df('0x4c')]=function(){var _0xc1a219=this;return function(_0x52a869){if(_0x52a869){freeIsNotKey(_0x52a869,_0xc1a219[_0x79df('0x1e')],'id');for(var _0x5f07fa=0x0,_0x41e853={},_0x1dfb8b={};_0x5f07fa<_0x52a869['length'];_0x5f07fa+=0x1){_0x41e853=_0x52a869[_0x5f07fa];if(_['isUndefined'](_0xc1a219[_0x79df('0x1e')][_0x41e853['id']])){_0xc1a219[_0x79df('0x1e')][_0x41e853['id']]=new SalesforceAccount(_0x41e853);}else{_0xc1a219[_0x79df('0x42')](_0xc1a219[_0x79df('0x1e')][_0x41e853['id']],_0x41e853);}}}return _0xc1a219[_0x79df('0x1e')];};};Realtime[_0x79df('0x40')][_0x79df('0x4d')]=function(){var _0x3d7be9=this;return function(_0x11b17a){if(_0x11b17a){freeIsNotKey(_0x11b17a,_0x3d7be9[_0x79df('0x1f')],'id');for(var _0x338d62=0x0,_0x21ff95={},_0x1f4d3a={};_0x338d62<_0x11b17a[_0x79df('0x46')];_0x338d62+=0x1){_0x21ff95=_0x11b17a[_0x338d62];if(_['isUndefined'](_0x3d7be9[_0x79df('0x1f')][_0x21ff95['id']])){_0x3d7be9[_0x79df('0x1f')][_0x21ff95['id']]=new FreshdeskAccount(_0x21ff95);}else{_0x3d7be9[_0x79df('0x42')](_0x3d7be9[_0x79df('0x1f')][_0x21ff95['id']],_0x21ff95);}}}return _0x3d7be9[_0x79df('0x1f')];};};Realtime[_0x79df('0x40')]['initZohoAccounts']=function(){var _0x5daee0=this;return function(_0x21e0b3){if(_0x21e0b3){freeIsNotKey(_0x21e0b3,_0x5daee0['zohoAccounts'],'id');for(var _0x31942a=0x0,_0x1ba83a={},_0x321ad7={};_0x31942a<_0x21e0b3[_0x79df('0x46')];_0x31942a+=0x1){_0x1ba83a=_0x21e0b3[_0x31942a];if(_['isUndefined'](_0x5daee0[_0x79df('0x20')][_0x1ba83a['id']])){_0x5daee0[_0x79df('0x20')][_0x1ba83a['id']]=new ZohoAccount(_0x1ba83a);}else{_0x5daee0[_0x79df('0x42')](_0x5daee0['zohoAccounts'][_0x1ba83a['id']],_0x1ba83a);}}}return _0x5daee0['zohoAccounts'];};};Realtime[_0x79df('0x40')][_0x79df('0x4e')]=function(){var _0x4e5c33=this;return function(_0x4a0ac2){if(_0x4a0ac2){freeIsNotKey(_0x4a0ac2,_0x4e5c33[_0x79df('0x4f')],'id');for(var _0x3663ae=0x0,_0x18a60b={},_0x5b2ba2={};_0x3663ae<_0x4a0ac2['length'];_0x3663ae+=0x1){_0x18a60b=_0x4a0ac2[_0x3663ae];if(_['isUndefined'](_0x4e5c33[_0x79df('0x4f')][_0x18a60b['id']])){_0x4e5c33[_0x79df('0x4f')][_0x18a60b['id']]=new DeskAccount(_0x18a60b);}else{_0x4e5c33[_0x79df('0x42')](_0x4e5c33[_0x79df('0x4f')][_0x18a60b['id']],_0x18a60b);}}}return _0x4e5c33[_0x79df('0x4f')];};};Realtime['prototype'][_0x79df('0x50')]=function(){var _0x2195d4=this;return function(_0x499b83){if(_0x499b83){freeIsNotKey(_0x499b83,_0x2195d4[_0x79df('0x51')],'id');for(var _0x2938ed=0x0,_0x4dbdc1={},_0x353db8={};_0x2938ed<_0x499b83[_0x79df('0x46')];_0x2938ed+=0x1){_0x4dbdc1=_0x499b83[_0x2938ed];if(_['isUndefined'](_0x2195d4[_0x79df('0x51')][_0x4dbdc1['id']])){_0x2195d4['sugarcrmAccounts'][_0x4dbdc1['id']]=new SugarcrmAccount(_0x4dbdc1);}else{_0x2195d4[_0x79df('0x42')](_0x2195d4[_0x79df('0x51')][_0x4dbdc1['id']],_0x4dbdc1);}}}return _0x2195d4[_0x79df('0x51')];};};Realtime[_0x79df('0x40')][_0x79df('0x52')]=function(){var _0x31081d=this;return function(_0x544f43){if(_0x544f43){freeIsNotKey(_0x544f43,_0x31081d[_0x79df('0x21')],'id');for(var _0x360631=0x0,_0x429e2a={},_0x4d78a4={};_0x360631<_0x544f43[_0x79df('0x46')];_0x360631+=0x1){_0x429e2a=_0x544f43[_0x360631];if(_[_0x79df('0x43')](_0x31081d[_0x79df('0x21')][_0x429e2a['id']])){_0x31081d['vtigerAccounts'][_0x429e2a['id']]=new VtigerAccount(_0x429e2a);}else{_0x31081d[_0x79df('0x42')](_0x31081d['vtigerAccounts'][_0x429e2a['id']],_0x429e2a);}}}return _0x31081d[_0x79df('0x21')];};};Realtime[_0x79df('0x40')]['initServicenowAccounts']=function(){var _0xc1c140=this;return function(_0xf4e31f){if(_0xf4e31f){freeIsNotKey(_0xf4e31f,_0xc1c140[_0x79df('0x22')],'id');for(var _0x486743=0x0,_0x5b511f={},_0x4e9d29={};_0x486743<_0xf4e31f[_0x79df('0x46')];_0x486743+=0x1){_0x5b511f=_0xf4e31f[_0x486743];if(_[_0x79df('0x43')](_0xc1c140[_0x79df('0x22')][_0x5b511f['id']])){_0xc1c140['servicenowAccounts'][_0x5b511f['id']]=new ServicenowAccount(_0x5b511f);}else{_0xc1c140[_0x79df('0x42')](_0xc1c140[_0x79df('0x22')][_0x5b511f['id']],_0x5b511f);}}}return _0xc1c140[_0x79df('0x22')];};};Realtime[_0x79df('0x40')]['initDynamics365Accounts']=function(){var _0x2dca9a=this;return function(_0x357ab2){if(_0x357ab2){freeIsNotKey(_0x357ab2,_0x2dca9a[_0x79df('0x23')],'id');for(var _0x3a1dde=0x0,_0x3df88f={},_0x1626ec={};_0x3a1dde<_0x357ab2[_0x79df('0x46')];_0x3a1dde+=0x1){_0x3df88f=_0x357ab2[_0x3a1dde];if(_[_0x79df('0x43')](_0x2dca9a[_0x79df('0x23')][_0x3df88f['id']])){_0x2dca9a['dynamics365Accounts'][_0x3df88f['id']]=new Dynamics365Account(_0x3df88f);}else{_0x2dca9a[_0x79df('0x42')](_0x2dca9a['dynamics365Accounts'][_0x3df88f['id']],_0x3df88f);}}}return _0x2dca9a[_0x79df('0x23')];};};Realtime[_0x79df('0x40')][_0x79df('0x53')]=function(){var _0x17d262=this;return function(_0x419db3){if(_0x419db3){freeIsNotKey(_0x419db3,_0x17d262[_0x79df('0x24')],'id');for(var _0x354442=0x0,_0x2b8c11={},_0x13b20e={};_0x354442<_0x419db3[_0x79df('0x46')];_0x354442+=0x1){_0x2b8c11=_0x419db3[_0x354442];if(_[_0x79df('0x43')](_0x17d262[_0x79df('0x24')][_0x2b8c11['id']])){_0x17d262[_0x79df('0x24')][_0x2b8c11['id']]=new FreshsalesAccount(_0x2b8c11);}else{_0x17d262[_0x79df('0x42')](_0x17d262['freshsalesAccounts'][_0x2b8c11['id']],_0x2b8c11);}}}return _0x17d262[_0x79df('0x24')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0xc7550b=this;return function(_0x74b864){for(var _0x1d57a0=0x0;_0x1d57a0<_0x74b864[_0x79df('0x46')];_0x1d57a0+=0x1){_[_0x79df('0x54')](_0xc7550b[_0x79df('0x17')][_0x74b864[_0x1d57a0][_0x79df('0x28')]],_0x74b864[_0x1d57a0]);}return _0xc7550b['voiceQueues'];};};Realtime[_0x79df('0x40')][_0x79df('0x55')]=function(){var _0x3a37f1=this;return function(_0x33a949){clearVoiceQueues(_0x3a37f1[_0x79df('0x17')]);if(_0x33a949){_0x33a949=_[_0x79df('0x56')](_0x33a949,'uniqueid');for(var _0x22ad3b in _0x33a949){if(_0x33a949[_0x79df('0x26')](_0x22ad3b)){var _0x320c77={};for(var _0x5c40eb=0x0;_0x5c40eb<_0x33a949[_0x22ad3b][_0x79df('0x46')];_0x5c40eb+=0x1){var _0xd40626=_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x57')];if(_0x3a37f1[_0x79df('0x17')][_0xd40626]){if(_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x58')]){_0x3a37f1['voiceQueues'][_0xd40626][_0x79df('0x30')]+=0x1;}if(_0x33a949[_0x22ad3b][_0x5c40eb]['queuecallerabandon']){_0x3a37f1[_0x79df('0x17')][_0xd40626][_0x79df('0x31')]+=0x1;}_0x3a37f1[_0x79df('0x17')][_0xd40626][_0x79df('0x32')]+=moment(_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x59')])['diff'](moment(_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x5a')]),_0x79df('0x5b'))||0x0;if(_0x5c40eb===_0x33a949[_0x22ad3b]['length']-0x1){_0x3a37f1[_0x79df('0x17')][_0xd40626][_0x79df('0x2c')]+=moment(_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x5c')]||_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x5d')]||_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x5e')])[_0x79df('0x5f')](moment(_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x5a')]),_0x79df('0x5b'))||0x0;_0x3a37f1['voiceQueues'][_0xd40626][_0x79df('0x2a')]+=0x1;if(_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x60')]){_0x3a37f1['voiceQueues'][_0xd40626][_0x79df('0x2b')]+=0x1;_0x3a37f1['voiceQueues'][_0xd40626]['sumBillable']+=moment(_0x33a949[_0x22ad3b][_0x5c40eb][_0x79df('0x5c')])[_0x79df('0x5f')](moment(_0x33a949[_0x22ad3b][_0x5c40eb]['queuecallerleaveAt']),_0x79df('0x5b'))||0x0;}}else{_0x3a37f1['voiceQueues'][_0xd40626][_0x79df('0x2c')]+=_0x3a37f1[_0x79df('0x17')][_0xd40626]['sumHoldTime']||0x0;}}}}}}return _0x3a37f1[_0x79df('0x17')];};};Realtime[_0x79df('0x40')][_0x79df('0x61')]=function(){var _0x44329f=this;return function(_0x1697a0){clearVoiceCallReports(_0x44329f[_0x79df('0x62')]);if(_0x1697a0){for(var _0x396808=0x0;_0x396808<_0x1697a0[_0x79df('0x46')];_0x396808+=0x1){_0x44329f['outbound']['total']+=0x1;_0x44329f[_0x79df('0x62')]['sumDuration']+=_0x1697a0[_0x396808][_0x79df('0x63')];if(_0x1697a0[_0x396808][_0x79df('0x64')]===_0x79df('0x65')){_0x44329f['outbound'][_0x79df('0x2b')]+=0x1;_0x44329f[_0x79df('0x62')]['sumHoldTime']+=_0x1697a0[_0x396808][_0x79df('0x63')]-_0x1697a0[_0x396808][_0x79df('0x66')]||0x0;_0x44329f['outbound'][_0x79df('0x33')]+=_0x1697a0[_0x396808][_0x79df('0x66')];}}}return _0x44329f['outbound'];};};Realtime[_0x79df('0x40')][_0x79df('0x67')]=function(){var _0x244a0c=this;return function(_0x4eecfd){if(_0x4eecfd){freeIsNotKey(_0x4eecfd,_0x244a0c[_0x79df('0x68')],_0x79df('0x28'));for(var _0x5607ac=0x0,_0x3890e3={};_0x5607ac<_0x4eecfd['length'];_0x5607ac+=0x1){_0x3890e3=_0x4eecfd[_0x5607ac];if(_[_0x79df('0x43')](_0x244a0c[_0x79df('0x68')][_0x3890e3[_0x79df('0x28')]])){_0x244a0c[_0x79df('0x68')][_0x3890e3[_0x79df('0x28')]]=new Campaign(_0x3890e3);}else{_0x244a0c[_0x79df('0x42')](_0x244a0c[_0x79df('0x68')][_0x3890e3[_0x79df('0x28')]],_0x3890e3);_0x244a0c[_0x79df('0x68')][_0x3890e3[_0x79df('0x28')]][_0x79df('0x69')]=_0x3890e3[_0x79df('0x6a')]?_0x3890e3[_0x79df('0x6a')][_0x79df('0x28')]:undefined;}}}return _0x244a0c[_0x79df('0x68')];};};Realtime['prototype'][_0x79df('0x6b')]=function(){var _0x41577d=this;return function(_0x4c96e6){if(_0x4c96e6){freeIsNotKey(_0x4c96e6,_0x41577d[_0x79df('0x18')],'id');for(var _0x40b0a7=0x0,_0x56a2ad={};_0x40b0a7<_0x4c96e6[_0x79df('0x46')];_0x40b0a7+=0x1){_0x56a2ad=_0x4c96e6[_0x40b0a7];if(_[_0x79df('0x43')](_0x41577d['voiceExtensions'][_0x56a2ad['id']])){_0x41577d['voiceExtensions'][_0x56a2ad['id']]=new VoiceExtension(_0x56a2ad);}else{_0x41577d[_0x79df('0x42')](_0x41577d[_0x79df('0x18')][_0x56a2ad['id']],_0x56a2ad);}}}return _0x41577d[_0x79df('0x18')];};};Realtime[_0x79df('0x40')]['initCampaignHopperHistory']=function(){var _0x587fb5=this;return function(_0x1f0497){clearCampaigns(_0x587fb5[_0x79df('0x68')]);for(var _0x20b03e=0x0;_0x20b03e<_0x1f0497[_0x79df('0x46')];_0x20b03e+=0x1){_[_0x79df('0x54')](_0x587fb5[_0x79df('0x68')][_0x1f0497[_0x20b03e][_0x79df('0x28')]],_0x1f0497[_0x20b03e]);}return _0x587fb5[_0x79df('0x68')];};};Realtime[_0x79df('0x40')][_0x79df('0x6c')]=function(){var _0x5336f2=this;return function(_0x514a2b){if(_0x514a2b){freeIsNotKey(_0x514a2b,_0x5336f2[_0x79df('0x6d')],'id');for(var _0x40ed4f=0x0,_0x46a2a5={},_0x88cc3e={};_0x40ed4f<_0x514a2b[_0x79df('0x46')];_0x40ed4f+=0x1){_0x46a2a5=_0x514a2b[_0x40ed4f];if(_['isUndefined'](_0x5336f2['faxAccounts'][_0x46a2a5['id']])){_0x5336f2[_0x79df('0x6d')][_0x46a2a5['id']]=new FaxAccount(_0x46a2a5);}else{_0x5336f2[_0x79df('0x42')](_0x5336f2['faxAccounts'][_0x46a2a5['id']],_0x46a2a5);}}}return _0x5336f2[_0x79df('0x6d')];};};module[_0x79df('0x6e')]=Realtime;
\ No newline at end of file
index df9c503..b229d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70bb=['connectedlinenum','lastAssignedTo','interface','format','queuecallercomplete','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','keys','getCallType','split','getAgentByInternal','calleridnum','outbound','internal','voiceCallReport','destination','type','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview','originatecalleridnum','channel','destinationchannel','calleridpreview','disposition','callerid','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','createdAt','exten','calleridname','connectedlinename','xcally-motion-dialer','create','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','accountcode','SIP/%s','length'];(function(_0x14ae0a,_0x3c5959){var _0x54b138=function(_0x1f06a6){while(--_0x1f06a6){_0x14ae0a['push'](_0x14ae0a['shift']());}};_0x54b138(++_0x3c5959);}(_0x70bb,0x1a7));var _0xb70b=function(_0x159902,_0x2f808c){_0x159902=_0x159902-0x0;var _0x128878=_0x70bb[_0x159902];return _0x128878;};'use strict';var _=require(_0xb70b('0x0'));var moment=require(_0xb70b('0x1'));var util=require(_0xb70b('0x2'));var config=require(_0xb70b('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xb70b('0x4'));var RpcVoiceQueueReport=require(_0xb70b('0x5'));var RpcVoiceRecording=require(_0xb70b('0x6'));var RpcVoiceTransferReport=require(_0xb70b('0x7'));var VoiceQueueReport=require(_0xb70b('0x8'));var VoiceCallReport=require(_0xb70b('0x9'));var VoiceAgentReport=require(_0xb70b('0xa'));var VoiceDialReport=require(_0xb70b('0xb'));var UserReport=require('./userReport');function Report(_0x4f9230){this[_0xb70b('0xc')]=_0x4f9230;this[_0xb70b('0xd')]=_0x4f9230['agents'];this[_0xb70b('0xe')]=_0x4f9230[_0xb70b('0xe')];}Report[_0xb70b('0xf')][_0xb70b('0x10')]=function(_0x3c0e80){var _0x5d7253=new VoiceQueueReport(this[_0xb70b('0xc')]);var _0x185c9a=new VoiceAgentReport(this['realtime']);var _0x1ceefd=new VoiceDialReport(this[_0xb70b('0xc')]);var _0x41c969=new VoiceCallReport(this['realtime']);var _0x3641cb=new UserReport(this[_0xb70b('0xc')]);if(config[_0xb70b('0x11')]&&config[_0xb70b('0x11')]['disabled']){ami['on'](_0xb70b('0x12'),this[_0xb70b('0x13')]['bind'](this));ami['on'](_0xb70b('0x14'),this['voiceCallReport'][_0xb70b('0x15')](this));ami['on'](_0xb70b('0x16'),this[_0xb70b('0x17')][_0xb70b('0x15')](this));ami['on'](_0xb70b('0x18'),this[_0xb70b('0x19')][_0xb70b('0x15')](this));ami['on'](_0xb70b('0x1a'),this[_0xb70b('0x1b')][_0xb70b('0x15')](this));ami['on'](_0xb70b('0x1c'),this[_0xb70b('0x1d')][_0xb70b('0x15')](this));}};Report['prototype'][_0xb70b('0x1e')]=function(_0x44012b){var _0x524b3a;_0x524b3a=_[_0xb70b('0x1f')](this[_0xb70b('0xd')],function(_0x385f5b){return _0x385f5b['accountcode']==_0x44012b||_0x385f5b[_0xb70b('0x20')]==_0x44012b;});if(_[_0xb70b('0x21')](_0x524b3a)){var _0x15c7ab=_['find'](this['telephones'],function(_0x3c71e0){return _0x3c71e0[_0xb70b('0x22')]==_0x44012b||_0x3c71e0[_0xb70b('0x20')]==_0x44012b;});if(_0x15c7ab){_0x524b3a=_[_0xb70b('0x1f')](this[_0xb70b('0xd')],function(_0x27cdd6){return _0x27cdd6['interface']==util['format'](_0xb70b('0x23'),_0x15c7ab['name']);});}}return _0x524b3a;};Report[_0xb70b('0xf')]['voiceQueueReport']=function(_0x637e88){for(var _0x234320=0x0;_0x234320<_0x637e88[_0xb70b('0x24')];_0x234320+=0x1){var _0x5ea7b4=this[_0xb70b('0x1e')](_0x637e88[_0x234320][_0xb70b('0x25')]);if(_0x5ea7b4){_0x637e88[_0x234320][_0xb70b('0x22')]=_0x5ea7b4[_0xb70b('0x22')];_0x637e88[_0x234320]['assigned']=!![];_0x637e88[_0x234320][_0xb70b('0x26')]=_0x5ea7b4[_0xb70b('0x20')];_0x637e88[_0x234320][_0xb70b('0x27')]=_[_0xb70b('0x21')](_0x5ea7b4[_0xb70b('0x27')])?util[_0xb70b('0x28')](_0xb70b('0x23'),_0x5ea7b4['name']):_0x5ea7b4[_0xb70b('0x27')];if(_0x637e88[_0x234320][_0xb70b('0x29')]){_0x637e88[_0x234320]['queuecallercompleteAt']=moment()[_0xb70b('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x637e88[_0x234320][_0xb70b('0x2a')]){_0x637e88[_0x234320][_0xb70b('0x2b')]=moment()['format'](_0xb70b('0x2c'));}RpcMemberReport[_0xb70b('0x13')](_0x637e88[_0x234320]);}RpcVoiceQueueReport['create'](_0x637e88[_0x234320]);}};function extractCalleridNumber(_0x73ce43){var _0x57912b=_0x73ce43['match'](/<(.*?)>/);return _0x57912b?_0x57912b[0x1]:_0x73ce43;}Report[_0xb70b('0xf')]['getAgentByInternal']=function(_0x4d0921){for(var _0xdb9202=0x0;_0xdb9202<Object[_0xb70b('0x2d')](this[_0xb70b('0xd')])[_0xb70b('0x24')];_0xdb9202++){var _0x4fc833=Object[_0xb70b('0x2d')](this[_0xb70b('0xd')])[_0xdb9202];var _0x6e6afe=this[_0xb70b('0xd')][_0x4fc833];if(_0x6e6afe['accountcode']===Number(_0x4d0921))return _0x6e6afe;}return null;};Report['prototype'][_0xb70b('0x2e')]=function(_0x139e53){var _0x55b376=_0x139e53['channel'][_0xb70b('0x2f')]('-')[0x0];var _0xfcbf6e=this['agents'][_0x55b376];if(!_0xfcbf6e)_0xfcbf6e=this[_0xb70b('0x30')](_0x139e53[_0xb70b('0x31')]);return!_0xfcbf6e?_0xb70b('0x32'):_0xb70b('0x33');};Report[_0xb70b('0xf')][_0xb70b('0x34')]=function(_0x4e3e57){_0x4e3e57[_0xb70b('0x35')]=_0x4e3e57['destination']||_0x4e3e57['exten'];if(_0x4e3e57[_0xb70b('0x36')]=='dialer'){_0x4e3e57[_0xb70b('0x37')]=_0xb70b('0x38');_0x4e3e57[_0xb70b('0x39')]=_0x4e3e57['queue'];if(_0x4e3e57[_0xb70b('0x3a')]=='from-voip-provider'){_0x4e3e57['accountcode']='';_0x4e3e57['destination']=extractCalleridNumber(_0x4e3e57['callerid']);}else if(_0x4e3e57[_0xb70b('0x3a')]==_0xb70b('0x3b')){if(_0x4e3e57[_0xb70b('0x35')]==_0xb70b('0x3c')){_0x4e3e57['destination']=extractCalleridNumber(_0x4e3e57['calleridpreview']);_0x4e3e57[_0xb70b('0x31')]=_0x4e3e57[_0xb70b('0x3d')];_0x4e3e57['destinationchannel']=[_0x4e3e57['channel'],_0x4e3e57[_0xb70b('0x3e')]=_0x4e3e57[_0xb70b('0x3f')]][0x0];_0x4e3e57['callerid']=_0x4e3e57[_0xb70b('0x40')];}else{_0x4e3e57[_0xb70b('0x35')]=_0x4e3e57[_0xb70b('0x31')];_0x4e3e57['calleridnum']=_0x4e3e57[_0xb70b('0x3d')];if(_0x4e3e57[_0xb70b('0x41')]=='ANSWERED'){_0x4e3e57['accountcode']=_0x4e3e57[_0xb70b('0x25')];}else{_0x4e3e57[_0xb70b('0x22')]='';}}}}else{_0x4e3e57[_0xb70b('0x42')]=util['format']('\x22%s\x22\x20<%s>',_0x4e3e57['calleridname'],_0x4e3e57[_0xb70b('0x31')]);}if(RpcVoiceTransferReport[_0xb70b('0x43')][_0x4e3e57[_0xb70b('0x44')]]){var _0x563da7=RpcVoiceTransferReport[_0xb70b('0x43')][_0x4e3e57[_0xb70b('0x44')]];_0x563da7[_0xb70b('0x45')]=_0x4e3e57[_0xb70b('0x46')];RpcVoiceTransferReport[_0xb70b('0x1b')](_0x563da7);delete RpcVoiceTransferReport[_0xb70b('0x43')][_0x4e3e57[_0xb70b('0x44')]];}if(_[_0xb70b('0x21')](_0x4e3e57[_0xb70b('0x36')])){_0x4e3e57[_0xb70b('0x36')]=this[_0xb70b('0x2e')](_0x4e3e57);}if(_[_0xb70b('0x21')](_0x4e3e57[_0xb70b('0x47')])){var _0x59597c=_0x4e3e57['channel'][_0xb70b('0x2f')]('-')[0x0];var _0x41dcc4=this[_0xb70b('0xd')][_0x59597c];if(!_0x41dcc4)_0x41dcc4=this[_0xb70b('0x30')](_0x4e3e57[_0xb70b('0x22')]);if(_0x41dcc4){_0x4e3e57[_0xb70b('0x47')]=_0x41dcc4['id'];_0x4e3e57[_0xb70b('0x48')]=_0x41dcc4['name'];}}RpcVoiceCallReport['create'](_0x4e3e57);if(_0x4e3e57[_0xb70b('0x49')]){for(var _0x1324fe=0x0;_0x1324fe<_0x4e3e57['monitors'][_0xb70b('0x24')];_0x1324fe+=0x1){_0x4e3e57['monitorFilename']=_0x4e3e57[_0xb70b('0x4a')][_0x1324fe]['filename'];_0x4e3e57['createdAt']=_0x4e3e57['monitors'][_0x1324fe][_0xb70b('0x4b')];if(_0x4e3e57[_0xb70b('0x4c')]==_0xb70b('0x3c')){_0x4e3e57[_0xb70b('0x31')]=_0x4e3e57[_0xb70b('0x25')];_0x4e3e57[_0xb70b('0x4d')]=_0x4e3e57[_0xb70b('0x4e')];_0x4e3e57[_0xb70b('0x25')]=_0x4e3e57[_0xb70b('0x22')];_0x4e3e57[_0xb70b('0x4e')]=_0x4e3e57[_0xb70b('0x48')];_0x4e3e57['exten']=_0x4e3e57['originatecalleridnum'];}else if(_0x4e3e57['exten']==_0xb70b('0x4f')){_0x4e3e57['calleridnum']=_0x4e3e57[_0xb70b('0x35')];_0x4e3e57[_0xb70b('0x4c')]=_0x4e3e57[_0xb70b('0x3d')];}RpcVoiceRecording[_0xb70b('0x50')](_0x4e3e57);}}};Report[_0xb70b('0xf')][_0xb70b('0x17')]=function(_0x438d29){if(_[_0xb70b('0x51')](_0x438d29)){_0x438d29[_0xb70b('0x52')](function(_0x525eb1){RpcVoiceAgentReport[_0xb70b('0x50')](_0x525eb1);});}else{RpcVoiceAgentReport[_0xb70b('0x50')](_0x438d29);}};Report['prototype'][_0xb70b('0x19')]=function(_0x52f075){RpcVoiceDialReport[_0xb70b('0x50')](_0x52f075);var _0x5d57cf;var _0x5447ac;var _0x14544c=_0x52f075[_0xb70b('0x3e')];if(_[_0xb70b('0x53')](_0x14544c,_0xb70b('0x54'))){_0x5447ac=_0x14544c[_0xb70b('0x55')](_0x14544c[_0xb70b('0x56')]('/')+0x1,_0x14544c['indexOf']('@'));_0x5d57cf=_['find'](this[_0xb70b('0xd')],function(_0x3d35f6){return _0x3d35f6[_0xb70b('0x57')]==_0x5447ac||_0x3d35f6[_0xb70b('0x58')]==_0x5447ac||_0x3d35f6[_0xb70b('0x22')]==_0x5447ac;});}else{_0x5447ac=_0x14544c[_0xb70b('0x55')](_0x14544c[_0xb70b('0x56')]('/')+0x1,_0x14544c[_0xb70b('0x59')]('-'));_0x5d57cf=this['findAgent'](_0x5447ac);}if(_0x5d57cf){_0x52f075[_0xb70b('0x27')]=_[_0xb70b('0x21')](_0x5d57cf[_0xb70b('0x27')])?util[_0xb70b('0x28')](_0xb70b('0x23'),_0x5d57cf[_0xb70b('0x20')]):_0x5d57cf[_0xb70b('0x27')];_0x52f075[_0xb70b('0x48')]=_0x5d57cf[_0xb70b('0x20')];_0x52f075[_0xb70b('0x22')]=_0x5d57cf['accountcode'];RpcMemberReport[_0xb70b('0x19')](_0x52f075);}};Report[_0xb70b('0xf')][_0xb70b('0x1b')]=function(_0x4e7cce){RpcVoiceTransferReport['transfers'][_0x4e7cce[_0xb70b('0x5a')]]=_0x4e7cce;};Report['prototype'][_0xb70b('0x1d')]=function(_0x7a45df){RpcVoiceTransferReport[_0xb70b('0x1d')](_0x7a45df);};module[_0xb70b('0x5b')]=Report;
\ No newline at end of file
+var _0xf43e=['disabled','voiceQueueReport','bind','custom:voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','find','accountcode','name','length','findAgent','connectedlinenum','assigned','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','channel','calleridnum','outbound','internal','voiceCallReport','exten','type','lastapplication','queue','lastdata','context','from-sip','destination','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','getCallType','membername','monitor','monitorFilename','monitors','filename','createdAt','connectedlinename','voiceAgentReport','forEach','startsWith','Local','indexOf','phone','substring','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','agents','telephones','prototype','sync','realtime'];(function(_0x533a2f,_0x985fc6){var _0x1903fd=function(_0x58fe22){while(--_0x58fe22){_0x533a2f['push'](_0x533a2f['shift']());}};_0x1903fd(++_0x985fc6);}(_0xf43e,0xfb));var _0xef43=function(_0x162672,_0x1e763e){_0x162672=_0x162672-0x0;var _0x50640e=_0xf43e[_0x162672];return _0x50640e;};'use strict';var _=require(_0xef43('0x0'));var moment=require(_0xef43('0x1'));var util=require(_0xef43('0x2'));var config=require(_0xef43('0x3'));var ami=require(_0xef43('0x4'));var RpcVoiceAgentReport=require(_0xef43('0x5'));var RpcVoiceCallReport=require(_0xef43('0x6'));var RpcVoiceDialReport=require(_0xef43('0x7'));var RpcMemberReport=require(_0xef43('0x8'));var RpcVoiceQueueReport=require(_0xef43('0x9'));var RpcVoiceRecording=require(_0xef43('0xa'));var RpcVoiceTransferReport=require(_0xef43('0xb'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xef43('0xc'));var VoiceAgentReport=require(_0xef43('0xd'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x5c8050){this['realtime']=_0x5c8050;this[_0xef43('0xe')]=_0x5c8050[_0xef43('0xe')];this[_0xef43('0xf')]=_0x5c8050['telephones'];}Report[_0xef43('0x10')][_0xef43('0x11')]=function(_0x288df7){var _0x377a6c=new VoiceQueueReport(this['realtime']);var _0x305e3f=new VoiceAgentReport(this[_0xef43('0x12')]);var _0xa9e62b=new VoiceDialReport(this[_0xef43('0x12')]);var _0x7e4a4d=new VoiceCallReport(this[_0xef43('0x12')]);var _0x3f336a=new UserReport(this[_0xef43('0x12')]);if(config['xdr']&&config['xdr'][_0xef43('0x13')]){ami['on']('custom:voiceQueueReport',this[_0xef43('0x14')][_0xef43('0x15')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0xef43('0x15')](this));ami['on'](_0xef43('0x16'),this['voiceAgentReport'][_0xef43('0x15')](this));ami['on']('custom:voiceDialReport',this[_0xef43('0x17')][_0xef43('0x15')](this));ami['on'](_0xef43('0x18'),this[_0xef43('0x19')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0xef43('0x15')](this));}};Report['prototype']['findAgent']=function(_0x4482e4){var _0x5456ef;_0x5456ef=_[_0xef43('0x1a')](this['agents'],function(_0x153db9){return _0x153db9[_0xef43('0x1b')]==_0x4482e4||_0x153db9[_0xef43('0x1c')]==_0x4482e4;});if(_['isNil'](_0x5456ef)){var _0x2c00b2=_[_0xef43('0x1a')](this[_0xef43('0xf')],function(_0x17bf4b){return _0x17bf4b[_0xef43('0x1b')]==_0x4482e4||_0x17bf4b[_0xef43('0x1c')]==_0x4482e4;});if(_0x2c00b2){_0x5456ef=_['find'](this[_0xef43('0xe')],function(_0x14ad65){return _0x14ad65['interface']==util['format']('SIP/%s',_0x2c00b2[_0xef43('0x1c')]);});}}return _0x5456ef;};Report[_0xef43('0x10')][_0xef43('0x14')]=function(_0x38f9fa){for(var _0xb98335=0x0;_0xb98335<_0x38f9fa[_0xef43('0x1d')];_0xb98335+=0x1){var _0x31cd6e=this[_0xef43('0x1e')](_0x38f9fa[_0xb98335][_0xef43('0x1f')]);if(_0x31cd6e){_0x38f9fa[_0xb98335]['accountcode']=_0x31cd6e[_0xef43('0x1b')];_0x38f9fa[_0xb98335][_0xef43('0x20')]=!![];_0x38f9fa[_0xb98335][_0xef43('0x21')]=_0x31cd6e[_0xef43('0x1c')];_0x38f9fa[_0xb98335]['interface']=_[_0xef43('0x22')](_0x31cd6e[_0xef43('0x23')])?util[_0xef43('0x24')](_0xef43('0x25'),_0x31cd6e['name']):_0x31cd6e[_0xef43('0x23')];if(_0x38f9fa[_0xb98335]['queuecallercomplete']){_0x38f9fa[_0xb98335][_0xef43('0x26')]=moment()[_0xef43('0x24')](_0xef43('0x27'));}if(_0x38f9fa[_0xb98335]['queuecallerexit']){_0x38f9fa[_0xb98335][_0xef43('0x28')]=moment()['format'](_0xef43('0x27'));}RpcMemberReport[_0xef43('0x14')](_0x38f9fa[_0xb98335]);}RpcVoiceQueueReport[_0xef43('0x29')](_0x38f9fa[_0xb98335]);}};function extractCalleridNumber(_0x47d705){var _0x468961=_0x47d705[_0xef43('0x2a')](/<(.*?)>/);return _0x468961?_0x468961[0x1]:_0x47d705;}Report['prototype'][_0xef43('0x2b')]=function(_0x4f1c5b){for(var _0x522063=0x0;_0x522063<Object[_0xef43('0x2c')](this[_0xef43('0xe')])[_0xef43('0x1d')];_0x522063++){var _0x2fba11=Object[_0xef43('0x2c')](this[_0xef43('0xe')])[_0x522063];var _0x3a929d=this[_0xef43('0xe')][_0x2fba11];if(_0x3a929d[_0xef43('0x1b')]===Number(_0x4f1c5b))return _0x3a929d;}return null;};Report[_0xef43('0x10')]['getCallType']=function(_0x2bdde6){var _0x608a2=_0x2bdde6[_0xef43('0x2d')]['split']('-')[0x0];var _0x4d3db4=this[_0xef43('0xe')][_0x608a2];if(!_0x4d3db4)_0x4d3db4=this['getAgentByInternal'](_0x2bdde6[_0xef43('0x2e')]);return!_0x4d3db4?_0xef43('0x2f'):_0xef43('0x30');};Report[_0xef43('0x10')][_0xef43('0x31')]=function(_0x18f500){_0x18f500['destination']=_0x18f500['destination']||_0x18f500[_0xef43('0x32')];if(_0x18f500[_0xef43('0x33')]=='dialer'){_0x18f500[_0xef43('0x34')]=_0xef43('0x35');_0x18f500[_0xef43('0x36')]=_0x18f500[_0xef43('0x35')];if(_0x18f500[_0xef43('0x37')]=='from-voip-provider'){_0x18f500[_0xef43('0x1b')]='';_0x18f500['destination']=extractCalleridNumber(_0x18f500['callerid']);}else if(_0x18f500[_0xef43('0x37')]==_0xef43('0x38')){if(_0x18f500[_0xef43('0x39')]==_0xef43('0x3a')){_0x18f500[_0xef43('0x39')]=extractCalleridNumber(_0x18f500[_0xef43('0x3b')]);_0x18f500['calleridnum']=_0x18f500[_0xef43('0x3c')];_0x18f500[_0xef43('0x3d')]=[_0x18f500[_0xef43('0x2d')],_0x18f500[_0xef43('0x2d')]=_0x18f500['destinationchannel']][0x0];_0x18f500[_0xef43('0x3e')]=_0x18f500[_0xef43('0x3b')];}else{_0x18f500[_0xef43('0x39')]=_0x18f500[_0xef43('0x2e')];_0x18f500[_0xef43('0x2e')]=_0x18f500['originatecalleridnum'];if(_0x18f500[_0xef43('0x3f')]==_0xef43('0x40')){_0x18f500['accountcode']=_0x18f500[_0xef43('0x1f')];}else{_0x18f500[_0xef43('0x1b')]='';}}}}else{_0x18f500[_0xef43('0x3e')]=util[_0xef43('0x24')](_0xef43('0x41'),_0x18f500[_0xef43('0x42')],_0x18f500[_0xef43('0x2e')]);}if(RpcVoiceTransferReport[_0xef43('0x43')][_0x18f500[_0xef43('0x44')]]){var _0x39738e=RpcVoiceTransferReport[_0xef43('0x43')][_0x18f500[_0xef43('0x44')]];_0x39738e[_0xef43('0x45')]=_0x18f500[_0xef43('0x46')];RpcVoiceTransferReport[_0xef43('0x19')](_0x39738e);delete RpcVoiceTransferReport[_0xef43('0x43')][_0x18f500[_0xef43('0x44')]];}if(_['isNil'](_0x18f500[_0xef43('0x33')])){_0x18f500[_0xef43('0x33')]=this[_0xef43('0x47')](_0x18f500);}if(_[_0xef43('0x22')](_0x18f500['UserId'])){var _0x27e0de=_0x18f500[_0xef43('0x2d')]['split']('-')[0x0];var _0x549f45=this[_0xef43('0xe')][_0x27e0de];if(!_0x549f45)_0x549f45=this['getAgentByInternal'](_0x18f500['accountcode']);if(_0x549f45){_0x18f500['UserId']=_0x549f45['id'];_0x18f500[_0xef43('0x48')]=_0x549f45[_0xef43('0x1c')];}}RpcVoiceCallReport[_0xef43('0x29')](_0x18f500);if(_0x18f500[_0xef43('0x49')]){for(var _0x345bf4=0x0;_0x345bf4<_0x18f500['monitors'][_0xef43('0x1d')];_0x345bf4+=0x1){_0x18f500[_0xef43('0x4a')]=_0x18f500[_0xef43('0x4b')][_0x345bf4][_0xef43('0x4c')];_0x18f500[_0xef43('0x4d')]=_0x18f500[_0xef43('0x4b')][_0x345bf4]['createdAt'];if(_0x18f500[_0xef43('0x32')]==_0xef43('0x3a')){_0x18f500[_0xef43('0x2e')]=_0x18f500[_0xef43('0x1f')];_0x18f500['calleridname']=_0x18f500[_0xef43('0x4e')];_0x18f500[_0xef43('0x1f')]=_0x18f500[_0xef43('0x1b')];_0x18f500[_0xef43('0x4e')]=_0x18f500[_0xef43('0x48')];_0x18f500['exten']=_0x18f500[_0xef43('0x3c')];}else if(_0x18f500[_0xef43('0x32')]=='xcally-motion-dialer'){_0x18f500[_0xef43('0x2e')]=_0x18f500['destination'];_0x18f500[_0xef43('0x32')]=_0x18f500[_0xef43('0x3c')];}RpcVoiceRecording['create'](_0x18f500);}}};Report[_0xef43('0x10')][_0xef43('0x4f')]=function(_0x3c7cf0){if(_['isArray'](_0x3c7cf0)){_0x3c7cf0[_0xef43('0x50')](function(_0xb73a16){RpcVoiceAgentReport[_0xef43('0x29')](_0xb73a16);});}else{RpcVoiceAgentReport[_0xef43('0x29')](_0x3c7cf0);}};Report[_0xef43('0x10')][_0xef43('0x17')]=function(_0x1e30c9){RpcVoiceDialReport[_0xef43('0x29')](_0x1e30c9);var _0x3814a8;var _0x2f78d3;var _0x4e7e1f=_0x1e30c9[_0xef43('0x2d')];if(_[_0xef43('0x51')](_0x4e7e1f,_0xef43('0x52'))){_0x2f78d3=_0x4e7e1f['substring'](_0x4e7e1f[_0xef43('0x53')]('/')+0x1,_0x4e7e1f[_0xef43('0x53')]('@'));_0x3814a8=_[_0xef43('0x1a')](this[_0xef43('0xe')],function(_0x15fadc){return _0x15fadc['mobile']==_0x2f78d3||_0x15fadc[_0xef43('0x54')]==_0x2f78d3||_0x15fadc[_0xef43('0x1b')]==_0x2f78d3;});}else{_0x2f78d3=_0x4e7e1f[_0xef43('0x55')](_0x4e7e1f[_0xef43('0x53')]('/')+0x1,_0x4e7e1f[_0xef43('0x56')]('-'));_0x3814a8=this['findAgent'](_0x2f78d3);}if(_0x3814a8){_0x1e30c9['interface']=_[_0xef43('0x22')](_0x3814a8[_0xef43('0x23')])?util['format'](_0xef43('0x25'),_0x3814a8[_0xef43('0x1c')]):_0x3814a8[_0xef43('0x23')];_0x1e30c9[_0xef43('0x48')]=_0x3814a8[_0xef43('0x1c')];_0x1e30c9[_0xef43('0x1b')]=_0x3814a8['accountcode'];RpcMemberReport[_0xef43('0x17')](_0x1e30c9);}};Report[_0xef43('0x10')][_0xef43('0x19')]=function(_0x20568d){RpcVoiceTransferReport[_0xef43('0x43')][_0x20568d[_0xef43('0x57')]]=_0x20568d;};Report[_0xef43('0x10')][_0xef43('0x58')]=function(_0x6ff17c){RpcVoiceTransferReport['attendedTransfer'](_0x6ff17c);};module[_0xef43('0x59')]=Report;
\ No newline at end of file
index 0bbeb3c..3eda64b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb68=['syncDeviceState','peerstatus','syncPeerStatus','then','catch','error','inspect','resolve','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','state','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','inuse','stateTime','format','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','telephone:%s','exports','lodash','moment','util','ioredis','../../../config/logger','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','registry','syncRegistry','bind','devicestatechange'];(function(_0x433ae7,_0x2176a7){var _0x2ef7cb=function(_0x491d46){while(--_0x491d46){_0x433ae7['push'](_0x433ae7['shift']());}};_0x2ef7cb(++_0x2176a7);}(_0xcb68,0x7f));var _0x8cb6=function(_0x1ab0a4,_0x30dd5e){_0x1ab0a4=_0x1ab0a4-0x0;var _0x951908=_0xcb68[_0x1ab0a4];return _0x951908;};'use strict';var _=require(_0x8cb6('0x0'));var moment=require(_0x8cb6('0x1'));var util=require(_0x8cb6('0x2'));var Redis=require(_0x8cb6('0x3'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0x8cb6('0x4'))('ami');var ami=require(_0x8cb6('0x5'));config[_0x8cb6('0x6')]=_[_0x8cb6('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8cb6('0x8'))(new Redis(config[_0x8cb6('0x6')]));function UserReport(_0x545d4d){this[_0x8cb6('0x9')]=_0x545d4d[_0x8cb6('0x9')];this[_0x8cb6('0xa')]=_0x545d4d['agents'];this[_0x8cb6('0xb')]=_0x545d4d[_0x8cb6('0xb')];ami['on'](_0x8cb6('0xc'),this['syncRegistry']['bind'](this));ami['on'](_0x8cb6('0xd'),this[_0x8cb6('0xe')][_0x8cb6('0xf')](this));ami['on'](_0x8cb6('0x10'),this[_0x8cb6('0x11')][_0x8cb6('0xf')](this));ami['on'](_0x8cb6('0x12'),this[_0x8cb6('0x13')][_0x8cb6('0xf')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0x8cb6('0x14')](ami['actionSipShowRegistry']())[_0x8cb6('0x15')](function(_0x56c8d7){logger[_0x8cb6('0x16')]('[userReport][sipshowregistry]',util[_0x8cb6('0x17')](_0x56c8d7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x8cb6('0x18')]()[_0x8cb6('0x14')](ami[_0x8cb6('0x19')]())[_0x8cb6('0x15')](function(_0x218aff){logger[_0x8cb6('0x16')](_0x8cb6('0x1a'),util[_0x8cb6('0x17')](_0x218aff,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x8cb6('0x18')]()[_0x8cb6('0x14')](ami[_0x8cb6('0x1b')]())['catch'](function(_0x29a7de){logger['error']('[userReport][sippeerstatus]',util[_0x8cb6('0x17')](_0x29a7de,{'showHidden':![],'depth':null}));});}UserReport[_0x8cb6('0x1c')][_0x8cb6('0x1d')]=function(){setInterval(function(){BPromise['resolve']()[_0x8cb6('0x14')](showSipRegistrations())['then'](listDeviceStates())[_0x8cb6('0x14')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x8cb6('0x1e')]=function(_0x4a603b){return _0x4a603b!==null&&!_[_0x8cb6('0x1f')](_0x4a603b);};UserReport[_0x8cb6('0x1c')][_0x8cb6('0x20')]=function(_0x59eb8f,_0x1d9c3a,_0x1fd43e){io['to'](_0x59eb8f)['emit'](_0x1d9c3a,_0x1fd43e);};UserReport[_0x8cb6('0x1c')][_0x8cb6('0xe')]=function(_0x4795d5){try{if(this[_0x8cb6('0x1e')](_0x4795d5)){logger[_0x8cb6('0x21')](_0x8cb6('0x22'),_0x4795d5[_0x8cb6('0x23')],_0x4795d5['state']);logger[_0x8cb6('0x24')](_0x8cb6('0x25'),util[_0x8cb6('0x17')](_0x4795d5,{'showHidden':![],'depth':null}));var _0x40f056=_[_0x8cb6('0x26')](this['trunks'],{'defaultuser':_0x4795d5[_0x8cb6('0x23')]});if(_0x40f056){_0x4795d5['stateRegistry']=_0x4795d5[_0x8cb6('0x27')];_['merge'](_0x40f056,_['omit'](_0x4795d5,[_0x8cb6('0x28'),_0x8cb6('0x29'),'username',_0x8cb6('0x27')]));logger[_0x8cb6('0x24')](_0x8cb6('0x2a'),util[_0x8cb6('0x17')](_0x40f056,{'showHidden':![],'depth':null}));this[_0x8cb6('0x20')](util['format'](_0x8cb6('0x2b'),_0x40f056[_0x8cb6('0x2c')]),'trunk:save',_0x40f056);}}}catch(_0x2223ec){logger[_0x8cb6('0x16')](_0x8cb6('0x25'),util[_0x8cb6('0x17')](_0x2223ec,{'showHidden':![],'depth':null}));}};UserReport[_0x8cb6('0x1c')]['syncDeviceState']=function(_0x58c36a){try{if(this['isNotNull'](_0x58c36a)){logger[_0x8cb6('0x21')](_0x8cb6('0x2d'),_0x58c36a['device'],_0x58c36a[_0x8cb6('0x27')]);logger[_0x8cb6('0x24')](_0x8cb6('0x2e'),util[_0x8cb6('0x17')](_0x58c36a,{'showHidden':![],'depth':null}));if(this['agents'][_0x58c36a[_0x8cb6('0x2f')]]){if(!this[_0x8cb6('0xa')][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x30')]||_0x58c36a[_0x8cb6('0x27')][_0x8cb6('0x31')]()==_0x8cb6('0x32')){this[_0x8cb6('0xa')][_0x58c36a['device']][_0x8cb6('0x30')]=![];if(this[_0x8cb6('0xa')][_0x58c36a[_0x8cb6('0x2f')]]['state']!==_0x58c36a['state'][_0x8cb6('0x31')]()){this[_0x8cb6('0xa')][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x33')]=_['toNumber'](moment()[_0x8cb6('0x34')]('x'));}this[_0x8cb6('0xa')][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x27')]=_0x58c36a['state'][_0x8cb6('0x31')]();this['agents'][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x35')](_0x58c36a);}}else if(this['telephones'][_0x58c36a[_0x8cb6('0x2f')]]){if(this['telephones'][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x27')]!==_0x58c36a[_0x8cb6('0x27')][_0x8cb6('0x31')]()){this['telephones'][_0x58c36a['device']][_0x8cb6('0x33')]=_[_0x8cb6('0x36')](moment()[_0x8cb6('0x34')]('x'));}this[_0x8cb6('0xb')][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x27')]=_0x58c36a['state']['toLowerCase']();logger[_0x8cb6('0x24')](_0x8cb6('0x37'),util[_0x8cb6('0x17')](this['telephones'][_0x58c36a[_0x8cb6('0x2f')]],{'showHidden':![],'depth':null}));this[_0x8cb6('0x20')](util[_0x8cb6('0x34')]('telephone:%s',this[_0x8cb6('0xb')][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x2c')]),_0x8cb6('0x38'),this[_0x8cb6('0xb')][_0x58c36a[_0x8cb6('0x2f')]]);}else if(this[_0x8cb6('0x9')][_0x58c36a[_0x8cb6('0x2f')]]){if(this[_0x8cb6('0x9')][_0x58c36a[_0x8cb6('0x2f')]]['state']!==_0x58c36a[_0x8cb6('0x27')][_0x8cb6('0x31')]()){this[_0x8cb6('0x9')][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x33')]=_[_0x8cb6('0x36')](moment()[_0x8cb6('0x34')]('x'));}this[_0x8cb6('0x9')][_0x58c36a[_0x8cb6('0x2f')]][_0x8cb6('0x27')]=_0x58c36a[_0x8cb6('0x27')][_0x8cb6('0x31')]();logger[_0x8cb6('0x24')](_0x8cb6('0x39'),util['inspect'](this[_0x8cb6('0x9')][_0x58c36a[_0x8cb6('0x2f')]],{'showHidden':![],'depth':null}));this[_0x8cb6('0x20')](util[_0x8cb6('0x34')](_0x8cb6('0x2b'),this[_0x8cb6('0x9')][_0x58c36a['device']][_0x8cb6('0x2c')]),'trunk:save',this[_0x8cb6('0x9')][_0x58c36a['device']]);}else if(_[_0x8cb6('0x3a')](_0x58c36a[_0x8cb6('0x2f')],_0x8cb6('0x3b'))){var _0x51702a=_0x58c36a[_0x8cb6('0x2f')];var _0x36660a=_0x51702a['substring'](_0x51702a['indexOf']('/')+0x1,_0x51702a[_0x8cb6('0x3c')]('@'));var _0x6e4486=_[_0x8cb6('0x26')](this[_0x8cb6('0xa')],function(_0x3174c5){return _0x3174c5[_0x8cb6('0x3d')]==_0x36660a||_0x3174c5[_0x8cb6('0x3e')]==_0x36660a||_0x3174c5[_0x8cb6('0x3f')]==_0x36660a;});if(_0x6e4486){if(_0x6e4486[_0x8cb6('0x27')]!==_0x58c36a['state'][_0x8cb6('0x31')]()){_0x6e4486[_0x8cb6('0x33')]=_[_0x8cb6('0x36')](moment()[_0x8cb6('0x34')]('x'));}_0x6e4486['state']=_0x58c36a[_0x8cb6('0x27')][_0x8cb6('0x31')]();_0x6e4486['local']=!![];_0x6e4486[_0x8cb6('0x35')](_0x58c36a);}}}}catch(_0x248526){logger[_0x8cb6('0x16')](_0x8cb6('0x2e'),util['inspect'](_0x248526,{'showHidden':![],'depth':null}));}};UserReport[_0x8cb6('0x1c')][_0x8cb6('0x13')]=function(_0x193491){try{if(this[_0x8cb6('0x1e')](_0x193491)&&this[_0x8cb6('0x1e')](_0x193491[_0x8cb6('0x12')])){logger[_0x8cb6('0x21')](_0x8cb6('0x40'),_0x193491['peer'],_0x193491[_0x8cb6('0x41')],_0x193491[_0x8cb6('0x12')]);logger[_0x8cb6('0x24')](_0x8cb6('0x42'),util[_0x8cb6('0x17')](_0x193491,{'showHidden':![],'depth':null}));if(this[_0x8cb6('0xa')][_0x193491['peer']]){if(!this[_0x8cb6('0xa')][_0x193491[_0x8cb6('0x43')]][_0x8cb6('0x30')]||_0x193491['peerstatus'][_0x8cb6('0x31')]()==_0x8cb6('0x44')){this[_0x8cb6('0xa')][_0x193491[_0x8cb6('0x43')]]['local']=![];this['agents'][_0x193491['peer']][_0x8cb6('0x45')]=_0x193491['peerstatus'][_0x8cb6('0x31')]();this['agents'][_0x193491[_0x8cb6('0x43')]][_0x8cb6('0x41')]=_0x193491[_0x8cb6('0x41')];this[_0x8cb6('0xa')][_0x193491[_0x8cb6('0x43')]]['updateStatusRealtime'](_0x193491);}}else if(this[_0x8cb6('0xb')][_0x193491[_0x8cb6('0x43')]]){this[_0x8cb6('0xb')][_0x193491[_0x8cb6('0x43')]][_0x8cb6('0x45')]=_0x193491[_0x8cb6('0x12')][_0x8cb6('0x31')]();this[_0x8cb6('0xb')][_0x193491[_0x8cb6('0x43')]]['address']=_0x193491['address'];logger[_0x8cb6('0x24')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x8cb6('0x17')](this[_0x8cb6('0xb')][_0x193491[_0x8cb6('0x43')]],{'showHidden':![],'depth':null}));this[_0x8cb6('0x20')](util['format'](_0x8cb6('0x46'),this[_0x8cb6('0xb')][_0x193491[_0x8cb6('0x43')]][_0x8cb6('0x2c')]),_0x8cb6('0x38'),this[_0x8cb6('0xb')][_0x193491[_0x8cb6('0x43')]]);}else if(this[_0x8cb6('0x9')][_0x193491[_0x8cb6('0x43')]]){this[_0x8cb6('0x9')][_0x193491[_0x8cb6('0x43')]][_0x8cb6('0x45')]=_0x193491[_0x8cb6('0x12')][_0x8cb6('0x31')]();this[_0x8cb6('0x9')][_0x193491['peer']][_0x8cb6('0x41')]=_0x193491['address'];logger[_0x8cb6('0x24')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x8cb6('0x17')](this[_0x8cb6('0x9')][_0x193491[_0x8cb6('0x43')]],{'showHidden':![],'depth':null}));this[_0x8cb6('0x20')](util[_0x8cb6('0x34')](_0x8cb6('0x2b'),this[_0x8cb6('0x9')][_0x193491[_0x8cb6('0x43')]][_0x8cb6('0x2c')]),'trunk:save',this['trunks'][_0x193491[_0x8cb6('0x43')]]);}}}catch(_0xb69c75){logger[_0x8cb6('0x16')](_0x8cb6('0x42'),util['inspect'](_0xb69c75,{'showHidden':![],'depth':null}));}};module[_0x8cb6('0x47')]=UserReport;
\ No newline at end of file
+var _0x0743=['syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','stateRegistry','state','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','mobile','phone','accountcode','info','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','../../../config/logger','ami','redis','defaults','localhost','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange'];(function(_0x38231c,_0x1a5931){var _0x5be4e8=function(_0x15bfb0){while(--_0x15bfb0){_0x38231c['push'](_0x38231c['shift']());}};_0x5be4e8(++_0x1a5931);}(_0x0743,0xd2));var _0x3074=function(_0x14ab7d,_0x24f1b8){_0x14ab7d=_0x14ab7d-0x0;var _0x4928b8=_0x0743[_0x14ab7d];return _0x4928b8;};'use strict';var _=require(_0x3074('0x0'));var moment=require(_0x3074('0x1'));var util=require('util');var Redis=require(_0x3074('0x2'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0x3074('0x3'))(_0x3074('0x4'));var ami=require('../ami');config[_0x3074('0x5')]=_[_0x3074('0x6')](config[_0x3074('0x5')],{'host':_0x3074('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x28da14){this[_0x3074('0x8')]=_0x28da14[_0x3074('0x8')];this['agents']=_0x28da14[_0x3074('0x9')];this['telephones']=_0x28da14[_0x3074('0xa')];ami['on']('registryentry',this[_0x3074('0xb')][_0x3074('0xc')](this));ami['on'](_0x3074('0xd'),this[_0x3074('0xb')][_0x3074('0xc')](this));ami['on'](_0x3074('0xe'),this[_0x3074('0xf')][_0x3074('0xc')](this));ami['on'](_0x3074('0x10'),this[_0x3074('0x11')][_0x3074('0xc')](this));return this[_0x3074('0x12')]();}function showSipRegistrations(){Promise[_0x3074('0x13')]()['then'](ami[_0x3074('0x14')]())[_0x3074('0x15')](function(_0x510722){logger[_0x3074('0x16')](_0x3074('0x17'),util[_0x3074('0x18')](_0x510722,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x3074('0x13')]()[_0x3074('0x19')](ami[_0x3074('0x1a')]())[_0x3074('0x15')](function(_0x28bb7d){logger[_0x3074('0x16')]('[userReport][devicestatelist]',util[_0x3074('0x18')](_0x28bb7d,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x3074('0x13')]()[_0x3074('0x19')](ami['actionSipPeerStatus']())['catch'](function(_0x4165bd){logger[_0x3074('0x16')](_0x3074('0x1b'),util[_0x3074('0x18')](_0x4165bd,{'showHidden':![],'depth':null}));});}UserReport[_0x3074('0x1c')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x3074('0x13')]()[_0x3074('0x19')](showSipRegistrations())[_0x3074('0x19')](listDeviceStates())[_0x3074('0x19')](showPeersStatus());},0x32c8);};UserReport[_0x3074('0x1c')][_0x3074('0x1d')]=function(_0x3743c4){return _0x3743c4!==null&&!_[_0x3074('0x1e')](_0x3743c4);};UserReport[_0x3074('0x1c')]['emit']=function(_0x3c3d3f,_0x45bb17,_0x5b5a04){io['to'](_0x3c3d3f)[_0x3074('0x1f')](_0x45bb17,_0x5b5a04);};UserReport[_0x3074('0x1c')][_0x3074('0xb')]=function(_0x2be437){try{if(this[_0x3074('0x1d')](_0x2be437)){logger['info'](_0x3074('0x20'),_0x2be437[_0x3074('0x21')],_0x2be437['state']);logger[_0x3074('0x22')](_0x3074('0x23'),util['inspect'](_0x2be437,{'showHidden':![],'depth':null}));var _0x2928dd=_[_0x3074('0x24')](this[_0x3074('0x8')],{'defaultuser':_0x2be437['username']});if(_0x2928dd){_0x2be437[_0x3074('0x25')]=_0x2be437[_0x3074('0x26')];_[_0x3074('0x27')](_0x2928dd,_[_0x3074('0x28')](_0x2be437,[_0x3074('0x29'),_0x3074('0x2a'),'username',_0x3074('0x26')]));logger[_0x3074('0x22')](_0x3074('0x2b'),util['inspect'](_0x2928dd,{'showHidden':![],'depth':null}));this[_0x3074('0x1f')](util[_0x3074('0x2c')](_0x3074('0x2d'),_0x2928dd[_0x3074('0x2e')]),_0x3074('0x2f'),_0x2928dd);}}}catch(_0x3e26e1){logger[_0x3074('0x16')](_0x3074('0x23'),util[_0x3074('0x18')](_0x3e26e1,{'showHidden':![],'depth':null}));}};UserReport[_0x3074('0x1c')][_0x3074('0xf')]=function(_0x1d394f){try{if(this[_0x3074('0x1d')](_0x1d394f)){logger['info'](_0x3074('0x30'),_0x1d394f[_0x3074('0x31')],_0x1d394f[_0x3074('0x26')]);logger[_0x3074('0x22')](_0x3074('0x32'),util[_0x3074('0x18')](_0x1d394f,{'showHidden':![],'depth':null}));if(this['agents'][_0x1d394f[_0x3074('0x31')]]){if(!this[_0x3074('0x9')][_0x1d394f[_0x3074('0x31')]]['local']||_0x1d394f['state'][_0x3074('0x33')]()==_0x3074('0x34')){this['agents'][_0x1d394f[_0x3074('0x31')]][_0x3074('0x35')]=![];if(this['agents'][_0x1d394f[_0x3074('0x31')]][_0x3074('0x26')]!==_0x1d394f[_0x3074('0x26')][_0x3074('0x33')]()){this[_0x3074('0x9')][_0x1d394f['device']][_0x3074('0x36')]=_[_0x3074('0x37')](moment()[_0x3074('0x2c')]('x'));}this[_0x3074('0x9')][_0x1d394f[_0x3074('0x31')]][_0x3074('0x26')]=_0x1d394f[_0x3074('0x26')][_0x3074('0x33')]();this[_0x3074('0x9')][_0x1d394f[_0x3074('0x31')]][_0x3074('0x38')](_0x1d394f);}}else if(this[_0x3074('0xa')][_0x1d394f[_0x3074('0x31')]]){if(this['telephones'][_0x1d394f[_0x3074('0x31')]][_0x3074('0x26')]!==_0x1d394f['state'][_0x3074('0x33')]()){this[_0x3074('0xa')][_0x1d394f[_0x3074('0x31')]][_0x3074('0x36')]=_['toNumber'](moment()['format']('x'));}this[_0x3074('0xa')][_0x1d394f['device']]['state']=_0x1d394f[_0x3074('0x26')][_0x3074('0x33')]();logger[_0x3074('0x22')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x3074('0x18')](this[_0x3074('0xa')][_0x1d394f[_0x3074('0x31')]],{'showHidden':![],'depth':null}));this[_0x3074('0x1f')](util['format'](_0x3074('0x39'),this[_0x3074('0xa')][_0x1d394f[_0x3074('0x31')]]['name']),_0x3074('0x3a'),this[_0x3074('0xa')][_0x1d394f[_0x3074('0x31')]]);}else if(this[_0x3074('0x8')][_0x1d394f['device']]){if(this['trunks'][_0x1d394f[_0x3074('0x31')]][_0x3074('0x26')]!==_0x1d394f[_0x3074('0x26')]['toLowerCase']()){this[_0x3074('0x8')][_0x1d394f['device']]['stateTime']=_[_0x3074('0x37')](moment()[_0x3074('0x2c')]('x'));}this[_0x3074('0x8')][_0x1d394f[_0x3074('0x31')]][_0x3074('0x26')]=_0x1d394f['state']['toLowerCase']();logger[_0x3074('0x22')](_0x3074('0x3b'),util['inspect'](this[_0x3074('0x8')][_0x1d394f[_0x3074('0x31')]],{'showHidden':![],'depth':null}));this[_0x3074('0x1f')](util[_0x3074('0x2c')]('trunk:%s',this['trunks'][_0x1d394f[_0x3074('0x31')]][_0x3074('0x2e')]),'trunk:save',this[_0x3074('0x8')][_0x1d394f[_0x3074('0x31')]]);}else if(_[_0x3074('0x3c')](_0x1d394f[_0x3074('0x31')],_0x3074('0x3d'))){var _0x485847=_0x1d394f[_0x3074('0x31')];var _0x1a7771=_0x485847['substring'](_0x485847['indexOf']('/')+0x1,_0x485847['indexOf']('@'));var _0xfb382d=_['find'](this[_0x3074('0x9')],function(_0x27bc38){return _0x27bc38[_0x3074('0x3e')]==_0x1a7771||_0x27bc38[_0x3074('0x3f')]==_0x1a7771||_0x27bc38[_0x3074('0x40')]==_0x1a7771;});if(_0xfb382d){if(_0xfb382d[_0x3074('0x26')]!==_0x1d394f[_0x3074('0x26')][_0x3074('0x33')]()){_0xfb382d[_0x3074('0x36')]=_[_0x3074('0x37')](moment()[_0x3074('0x2c')]('x'));}_0xfb382d['state']=_0x1d394f['state'][_0x3074('0x33')]();_0xfb382d['local']=!![];_0xfb382d[_0x3074('0x38')](_0x1d394f);}}}}catch(_0x57d4ad){logger[_0x3074('0x16')](_0x3074('0x32'),util[_0x3074('0x18')](_0x57d4ad,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x3074('0x11')]=function(_0x343960){try{if(this['isNotNull'](_0x343960)&&this['isNotNull'](_0x343960['peerstatus'])){logger[_0x3074('0x41')](_0x3074('0x42'),_0x343960[_0x3074('0x43')],_0x343960['address'],_0x343960[_0x3074('0x10')]);logger[_0x3074('0x22')](_0x3074('0x44'),util[_0x3074('0x18')](_0x343960,{'showHidden':![],'depth':null}));if(this[_0x3074('0x9')][_0x343960[_0x3074('0x43')]]){if(!this['agents'][_0x343960['peer']]['local']||_0x343960[_0x3074('0x10')]['toLowerCase']()==_0x3074('0x45')){this[_0x3074('0x9')][_0x343960[_0x3074('0x43')]]['local']=![];this[_0x3074('0x9')][_0x343960['peer']][_0x3074('0x46')]=_0x343960['peerstatus'][_0x3074('0x33')]();this[_0x3074('0x9')][_0x343960['peer']][_0x3074('0x47')]=_0x343960['address'];this['agents'][_0x343960['peer']]['updateStatusRealtime'](_0x343960);}}else if(this[_0x3074('0xa')][_0x343960[_0x3074('0x43')]]){this[_0x3074('0xa')][_0x343960[_0x3074('0x43')]][_0x3074('0x46')]=_0x343960[_0x3074('0x10')][_0x3074('0x33')]();this[_0x3074('0xa')][_0x343960['peer']][_0x3074('0x47')]=_0x343960[_0x3074('0x47')];logger[_0x3074('0x22')](_0x3074('0x48'),util[_0x3074('0x18')](this[_0x3074('0xa')][_0x343960[_0x3074('0x43')]],{'showHidden':![],'depth':null}));this[_0x3074('0x1f')](util[_0x3074('0x2c')](_0x3074('0x39'),this[_0x3074('0xa')][_0x343960['peer']][_0x3074('0x2e')]),_0x3074('0x3a'),this[_0x3074('0xa')][_0x343960[_0x3074('0x43')]]);}else if(this[_0x3074('0x8')][_0x343960[_0x3074('0x43')]]){this[_0x3074('0x8')][_0x343960['peer']][_0x3074('0x46')]=_0x343960['peerstatus']['toLowerCase']();this[_0x3074('0x8')][_0x343960[_0x3074('0x43')]][_0x3074('0x47')]=_0x343960[_0x3074('0x47')];logger[_0x3074('0x22')](_0x3074('0x49'),util[_0x3074('0x18')](this['trunks'][_0x343960['peer']],{'showHidden':![],'depth':null}));this[_0x3074('0x1f')](util[_0x3074('0x2c')](_0x3074('0x2d'),this['trunks'][_0x343960[_0x3074('0x43')]][_0x3074('0x2e')]),'trunk:save',this[_0x3074('0x8')][_0x343960[_0x3074('0x43')]]);}}}catch(_0x45c3a7){logger[_0x3074('0x16')](_0x3074('0x44'),util['inspect'](_0x45c3a7,{'showHidden':![],'depth':null}));}};module[_0x3074('0x4a')]=UserReport;
\ No newline at end of file
index 1acb084..c06b3b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x20f293,_0x113663){var _0x108c07=function(_0x579db7){while(--_0x579db7){_0x20f293['push'](_0x20f293['shift']());}};_0x108c07(++_0x113663);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport;
\ No newline at end of file
+var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x58fad2,_0xb39887){var _0x49f947=function(_0x1b22c2){while(--_0x1b22c2){_0x58fad2['push'](_0x58fad2['shift']());}};_0x49f947(++_0xb39887);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport;
\ No newline at end of file
index 6367574..36f1fbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee9=['[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','exports','lodash','moment','util','path','ioredis','../../../config/logger','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','newexten','syncNewChannel','varset','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','accountcode','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','user:%s','name','user:agentconnect','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','match','type','isNil','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','starttime','holdtime','diff','connectedlinename','destinationchannel','UserId','answertime','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','variable','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid'];(function(_0xfba431,_0x1a8aff){var _0x1f2fcc=function(_0x1dafa2){while(--_0x1dafa2){_0xfba431['push'](_0xfba431['shift']());}};_0x1f2fcc(++_0x1a8aff);}(_0xbee9,0xf9));var _0x9bee=function(_0x53257b,_0x1be635){_0x53257b=_0x53257b-0x0;var _0x150442=_0xbee9[_0x53257b];return _0x150442;};'use strict';var _=require(_0x9bee('0x0'));var moment=require(_0x9bee('0x1'));var util=require(_0x9bee('0x2'));var path=require(_0x9bee('0x3'));var Redis=require(_0x9bee('0x4'));var config=require('../../../config/environment');var logger=require(_0x9bee('0x5'))('ami');var ami=require(_0x9bee('0x6'));var Channel=require(_0x9bee('0x7'));var RpcSetting=require(_0x9bee('0x8'));var applications=[_0x9bee('0x9'),_0x9bee('0xa'),_0x9bee('0xb'),_0x9bee('0xc'),_0x9bee('0xd'),_0x9bee('0xe')];var dispositions=[_0x9bee('0xf'),_0x9bee('0x10'),_0x9bee('0x10'),_0x9bee('0xf'),'NO\x20ANSWER',_0x9bee('0xf'),_0x9bee('0x11'),_0x9bee('0x12'),_0x9bee('0x10'),_0x9bee('0x10'),_0x9bee('0x10')];config[_0x9bee('0x13')]=_[_0x9bee('0x14')](config[_0x9bee('0x13')],{'host':_0x9bee('0x15'),'port':0x18eb});var io=require(_0x9bee('0x16'))(new Redis(config[_0x9bee('0x13')]));function VoiceCallReport(_0x5bcbbc){this[_0x9bee('0x17')]=_0x5bcbbc['channels'];this[_0x9bee('0x18')]=_0x5bcbbc[_0x9bee('0x18')];this[_0x9bee('0x19')]={};ami['on']('coreshowchannel',this[_0x9bee('0x1a')][_0x9bee('0x1b')](this));ami['on'](_0x9bee('0x1c'),this['syncNewExten']['bind'](this));ami['on']('newchannel',this[_0x9bee('0x1d')]['bind'](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on'](_0x9bee('0x1e'),this['syncVarSet'][_0x9bee('0x1b')](this));ami['on'](_0x9bee('0x1f'),this[_0x9bee('0x20')]['bind'](this));ami['on'](_0x9bee('0x21'),this[_0x9bee('0x22')][_0x9bee('0x1b')](this));ami['on']('attendedtransfer',this[_0x9bee('0x23')][_0x9bee('0x1b')](this));ami['on'](_0x9bee('0x24'),this[_0x9bee('0x25')][_0x9bee('0x1b')](this));ami['on'](_0x9bee('0x26'),this[_0x9bee('0x27')][_0x9bee('0x1b')](this));ami['on'](_0x9bee('0x28'),this[_0x9bee('0x29')][_0x9bee('0x1b')](this));try{logger[_0x9bee('0x2a')](_0x9bee('0x2b'));ami[_0x9bee('0x2c')]();}catch(_0x5c2906){logger[_0x9bee('0x2d')](_0x9bee('0x2e'),util[_0x9bee('0x2f')](_0x5c2906,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x31')]=function(_0x27d65f){return _0x27d65f!==null&&!_['isUndefined'](_0x27d65f);};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x32')]=function(_0x4ed0e5,_0x370260,_0x494194){io['to'](_0x4ed0e5)[_0x9bee('0x32')](_0x370260,_0x494194);};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x22')]=function(_0x216d64){try{if(this[_0x9bee('0x31')](_0x216d64)){logger[_0x9bee('0x2a')](_0x9bee('0x33'),_0x216d64[_0x9bee('0x34')],_0x216d64[_0x9bee('0x35')],_0x216d64[_0x9bee('0x36')]);logger[_0x9bee('0x37')](_0x9bee('0x38'),_0x216d64[_0x9bee('0x34')],util['inspect'](_0x216d64,{'showHidden':![],'depth':null}));if(_0x216d64[_0x9bee('0x34')]===_0x216d64[_0x9bee('0x39')]){if(!_[_0x9bee('0x3a')](this[_0x9bee('0x17')][_0x216d64[_0x9bee('0x34')]])){_[_0x9bee('0x3b')](this[_0x9bee('0x17')][_0x216d64[_0x9bee('0x34')]],_[_0x9bee('0x3c')](_0x216d64,_[_0x9bee('0x3d')](this['channels'][_0x216d64[_0x9bee('0x34')]])));}}if(_0x216d64[_0x9bee('0x3e')]===_0x9bee('0x3f')){if(this[_0x9bee('0x18')][_0x216d64[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]){if(_0x216d64[_0x9bee('0x42')]==_0x9bee('0x43')){this[_0x9bee('0x18')][_0x216d64['channel']['split']('-')[0x0]][_0x9bee('0x44')]=_0x216d64[_0x9bee('0x45')];this[_0x9bee('0x32')](util[_0x9bee('0x46')]('user:%s',this[_0x9bee('0x18')][_0x216d64[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x9bee('0x18')][_0x216d64[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]][_0x9bee('0x47')],'destconnectedlinenum':_0x216d64[_0x9bee('0x45')]});}}}}}catch(_0x8980ed){logger[_0x9bee('0x2d')]('[%s][voiceCallReport][newcallerid]',_0x216d64[_0x9bee('0x34')],util['inspect'](_0x8980ed,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x1d')]=function(_0x3897cf){try{if(this[_0x9bee('0x31')](_0x3897cf)){logger[_0x9bee('0x37')](_0x9bee('0x48'),_0x3897cf[_0x9bee('0x34')],util[_0x9bee('0x2f')](_0x3897cf,{'showHidden':![],'depth':null}));if(this[_0x9bee('0x17')][_0x3897cf[_0x9bee('0x34')]])return;if(_0x3897cf[_0x9bee('0x40')]===_0x9bee('0x49'))return;if(_0x3897cf[_0x9bee('0x34')]!==_0x3897cf[_0x9bee('0x39')]&&!this[_0x9bee('0x19')][_0x3897cf[_0x9bee('0x39')]])return;logger[_0x9bee('0x2a')](_0x9bee('0x4a'),_0x3897cf[_0x9bee('0x34')],_0x3897cf[_0x9bee('0x3e')],_0x3897cf[_0x9bee('0x42')]);this[_0x9bee('0x17')][_0x3897cf['uniqueid']]=new Channel();this[_0x9bee('0x17')][_0x3897cf[_0x9bee('0x34')]]['starttime']=moment()[_0x9bee('0x46')](_0x9bee('0x4b'));this[_0x9bee('0x17')][_0x3897cf[_0x9bee('0x34')]][_0x9bee('0x4c')]=dispositions[_[_0x9bee('0x4d')](_0x3897cf[_0x9bee('0x4e')])];_[_0x9bee('0x3b')](this[_0x9bee('0x17')][_0x3897cf[_0x9bee('0x34')]],_[_0x9bee('0x3c')](_0x3897cf,_[_0x9bee('0x3d')](this[_0x9bee('0x17')][_0x3897cf[_0x9bee('0x34')]])));if(_0x3897cf[_0x9bee('0x3e')]==='from-sip'){if(this['agents'][_0x3897cf['channel'][_0x9bee('0x41')]('-')[0x0]]){if(_[_0x9bee('0x3a')](this['agents'][_0x3897cf[_0x9bee('0x40')]['split']('-')[0x0]][_0x9bee('0x44')])){this[_0x9bee('0x18')][_0x3897cf['channel'][_0x9bee('0x41')]('-')[0x0]][_0x9bee('0x44')]=_0x3897cf[_0x9bee('0x42')];logger[_0x9bee('0x37')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3897cf[_0x9bee('0x34')],util[_0x9bee('0x2f')]({'id':this[_0x9bee('0x18')][_0x3897cf[_0x9bee('0x40')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x9bee('0x18')][_0x3897cf[_0x9bee('0x40')]['split']('-')[0x0]][_0x9bee('0x47')],'destconnectedlinenum':_0x3897cf[_0x9bee('0x42')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x9bee('0x4f'),this[_0x9bee('0x18')][_0x3897cf[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]][_0x9bee('0x50')]),_0x9bee('0x51'),{'id':this[_0x9bee('0x18')][_0x3897cf[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3897cf[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]][_0x9bee('0x47')],'destconnectedlinenum':_0x3897cf['exten']});}}}}}catch(_0x3f90d1){logger['error']('[%s][voiceCallReport][newchannel]',_0x3897cf[_0x9bee('0x34')],util['inspect'](_0x3f90d1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9bee('0x1a')]=function(_0x91faaa){try{if(this['isNotNull'](_0x91faaa)){logger['debug'](_0x9bee('0x52'),_0x91faaa[_0x9bee('0x34')],util['inspect'](_0x91faaa,{'showHidden':![],'depth':null}));if(_0x91faaa[_0x9bee('0x40')]==='OutgoingSpoolFailed'||_0x91faaa[_0x9bee('0x42')]==='h')return;if(_0x91faaa[_0x9bee('0x34')]===_0x91faaa[_0x9bee('0x39')]||this[_0x9bee('0x19')][_0x91faaa['linkedid']]){_0x91faaa[_0x9bee('0x53')]=_0x91faaa[_0x9bee('0x53')][_0x9bee('0x54')]();_0x91faaa['applicationdata']=_0x91faaa[_0x9bee('0x55')]&&_0x91faaa['appdata']['startsWith'](_0x9bee('0x56'))?_0x91faaa[_0x9bee('0x55')]:(_0x91faaa[_0x9bee('0x55')]||_0x91faaa[_0x9bee('0x57')])['toLowerCase']();logger[_0x9bee('0x2a')](_0x9bee('0x58'),_0x91faaa[_0x9bee('0x34')],_0x91faaa[_0x9bee('0x53')],_0x91faaa[_0x9bee('0x57')]);if(_[_0x9bee('0x3a')](this['channels'][_0x91faaa[_0x9bee('0x34')]])){this['channels'][_0x91faaa[_0x9bee('0x34')]]=new Channel();this[_0x9bee('0x17')][_0x91faaa[_0x9bee('0x34')]]['starttime']=_0x91faaa[_0x9bee('0x59')]?moment()['subtract'](moment[_0x9bee('0x59')](_0x91faaa[_0x9bee('0x59')])[_0x9bee('0x5a')](),_0x9bee('0x5a'))[_0x9bee('0x46')](_0x9bee('0x4b')):moment()[_0x9bee('0x46')](_0x9bee('0x4b'));this[_0x9bee('0x17')][_0x91faaa[_0x9bee('0x34')]][_0x9bee('0x4c')]=_0x9bee('0xf');}_[_0x9bee('0x3b')](this[_0x9bee('0x17')][_0x91faaa['uniqueid']],_[_0x9bee('0x3c')](_0x91faaa,_[_0x9bee('0x3d')](this['channels'][_0x91faaa[_0x9bee('0x34')]])));if(_['includes'](applications,_0x91faaa[_0x9bee('0x53')])){this[_0x9bee('0x17')][_0x91faaa[_0x9bee('0x34')]]['lastapplication']=_0x91faaa['application'];this[_0x9bee('0x17')][_0x91faaa['uniqueid']]['lastdata']=_0x91faaa['applicationdata'];if(_0x91faaa[_0x9bee('0x53')]==='set'&&_['startsWith'](_0x91faaa[_0x9bee('0x57')][_0x9bee('0x54')](),'cdr(')){var _0x215e1=_0x91faaa[_0x9bee('0x57')][_0x9bee('0x41')]('=');var _0x476611=_0x215e1[0x0][_0x9bee('0x54')]()[_0x9bee('0x5b')](/cdr\((.*)\)/);if(_0x476611){if(_0x476611[0x1]===_0x9bee('0x5c')&&!_[_0x9bee('0x5d')](this['channels'][_0x91faaa[_0x9bee('0x34')]][_0x476611[0x1]]))return;this['channels'][_0x91faaa[_0x9bee('0x34')]][_0x476611[0x1]]=_0x215e1[0x1];}}else if(_0x91faaa['application']===_0x9bee('0xa')){this['channels'][_0x91faaa[_0x9bee('0x34')]][_0x9bee('0xa')]=_0x91faaa[_0x9bee('0x57')][_0x9bee('0x41')](',')[0x0];}}}}}catch(_0xc64206){logger[_0x9bee('0x2d')](_0x9bee('0x5e'),_0x91faaa['uniqueid'],util[_0x9bee('0x2f')](_0xc64206,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x5f')]=function(_0x27c21c){try{if(this['isNotNull'](_0x27c21c)){logger[_0x9bee('0x2a')](_0x9bee('0x60'),_0x27c21c[_0x9bee('0x34')],_0x27c21c[_0x9bee('0x39')],_0x27c21c[_0x9bee('0x35')],_0x27c21c['calleridnum']);logger[_0x9bee('0x37')](_0x9bee('0x61'),_0x27c21c[_0x9bee('0x34')],util['inspect'](_0x27c21c,{'showHidden':![],'depth':null}));if(_0x27c21c[_0x9bee('0x4e')]!=='6')return;if(_0x27c21c[_0x9bee('0x34')]!==_0x27c21c[_0x9bee('0x39')]){var _0x4de6c8=moment();if(this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]]){if(!this[_0x9bee('0x17')][_0x27c21c['linkedid']][_0x9bee('0x62')]){this[_0x9bee('0x17')][_0x27c21c['linkedid']][_0x9bee('0x62')]=!![];this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]]['answertime']=_0x4de6c8[_0x9bee('0x46')](_0x9bee('0x4b'));if(this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]][_0x9bee('0x63')]){this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]][_0x9bee('0x64')]=_0x4de6c8[_0x9bee('0x65')](this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]][_0x9bee('0x63')],_0x9bee('0x5a'));}}this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]]['linkedid']=_0x27c21c[_0x9bee('0x34')];if(_0x27c21c[_0x9bee('0x36')]!=='xcally-motion-preview'){this['channels'][_0x27c21c['linkedid']][_0x9bee('0x45')]=_0x27c21c[_0x9bee('0x36')];}this[_0x9bee('0x17')][_0x27c21c['linkedid']][_0x9bee('0x66')]=_0x27c21c[_0x9bee('0x35')];this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]][_0x9bee('0x67')]=_0x27c21c[_0x9bee('0x40')];this['channels'][_0x27c21c[_0x9bee('0x39')]]['disposition']=dispositions[_[_0x9bee('0x4d')](_0x27c21c[_0x9bee('0x4e')])];if(this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]){this['channels'][_0x27c21c[_0x9bee('0x39')]][_0x9bee('0x68')]=this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]['id'];this['channels'][_0x27c21c[_0x9bee('0x39')]]['membername']=this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]['name'];}}if(this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]]){if(!this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]][_0x9bee('0x62')]){this[_0x9bee('0x17')][_0x27c21c['uniqueid']][_0x9bee('0x62')]=!![];this[_0x9bee('0x17')][_0x27c21c['uniqueid']][_0x9bee('0x69')]=_0x4de6c8[_0x9bee('0x46')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]]['starttime']){this[_0x9bee('0x17')][_0x27c21c['uniqueid']][_0x9bee('0x64')]=_0x4de6c8['diff'](this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]]['starttime'],'seconds');}}if(_0x27c21c[_0x9bee('0x36')]!==_0x9bee('0x43')){this['channels'][_0x27c21c[_0x9bee('0x34')]][_0x9bee('0x45')]=_0x27c21c[_0x9bee('0x36')];}this['channels'][_0x27c21c['uniqueid']][_0x9bee('0x66')]=_0x27c21c[_0x9bee('0x35')];this['channels'][_0x27c21c[_0x9bee('0x34')]][_0x9bee('0x67')]=_0x27c21c[_0x9bee('0x40')];this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]][_0x9bee('0x4c')]=dispositions[_[_0x9bee('0x4d')](_0x27c21c[_0x9bee('0x4e')])];}}else{if(this[_0x9bee('0x17')][_0x27c21c['uniqueid']]){if(this[_0x9bee('0x18')][_0x27c21c['channel'][_0x9bee('0x41')]('-')[0x0]]){this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]][_0x9bee('0x68')]=this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]['id'];this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]][_0x9bee('0x6a')]=this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]][_0x9bee('0x50')];}}}if(_0x27c21c[_0x9bee('0x3e')]===_0x9bee('0x3f')){if(this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]){this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]][_0x9bee('0x44')]=_0x27c21c[_0x9bee('0x42')];var _0x265c02,_0x595191;if(this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]]){_0x265c02=this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]][_0x9bee('0x6b')];_0x595191=this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x34')]]['queue'];}else if(this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]]){_0x265c02=this['channels'][_0x27c21c[_0x9bee('0x39')]][_0x9bee('0x6b')];_0x595191=this[_0x9bee('0x17')][_0x27c21c[_0x9bee('0x39')]][_0x9bee('0xa')];}logger['debug'](_0x9bee('0x6c'),_0x27c21c[_0x9bee('0x34')],util['inspect']({'id':this[_0x9bee('0x18')][_0x27c21c['channel'][_0x9bee('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0x9bee('0x18')][_0x27c21c['channel']['split']('-')[0x0]][_0x9bee('0x47')],'destconnectedlinenum':_0x27c21c[_0x9bee('0x42')],'routealias':_0x265c02,'queue':_0x595191||undefined},{'showHidden':![],'depth':null}));this[_0x9bee('0x32')](util[_0x9bee('0x46')](_0x9bee('0x4f'),this[_0x9bee('0x18')][_0x27c21c['channel'][_0x9bee('0x41')]('-')[0x0]][_0x9bee('0x50')]),_0x9bee('0x51'),{'id':this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x9bee('0x18')][_0x27c21c[_0x9bee('0x40')]['split']('-')[0x0]][_0x9bee('0x47')],'destconnectedlinenum':_0x27c21c[_0x9bee('0x42')],'routealias':_0x265c02,'queue':_0x595191||undefined});}}}}catch(_0x94a82d){logger[_0x9bee('0x2d')](_0x9bee('0x6d'),_0x27c21c['uniqueid'],util['inspect'](_0x94a82d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x6e')]=function(_0x3faae1,_0x1137a3){try{if(this[_0x9bee('0x17')][_0x3faae1]){logger['info']('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x3faae1,_0x1137a3);this[_0x9bee('0x17')][_0x3faae1][_0x9bee('0x6f')]=!![];if(_[_0x9bee('0x70')](_0x1137a3,'.wav49')){_0x1137a3=_0x1137a3[_0x9bee('0x71')](_0x9bee('0x72'),_0x9bee('0x73'));}this[_0x9bee('0x17')][_0x3faae1][_0x9bee('0x74')]=_0x1137a3;var _0x33bc27=_[_0x9bee('0x75')](this['channels'][_0x3faae1]['monitors'],{'filename':_0x1137a3});if(_[_0x9bee('0x5d')](_0x33bc27)){this[_0x9bee('0x17')][_0x3faae1][_0x9bee('0x76')][_0x9bee('0x77')]({'filename':_0x1137a3,'createdAt':moment()[_0x9bee('0x46')](_0x9bee('0x4b')),'mixmonitorid':'','status':_0x9bee('0x78')});}}}catch(_0x5e1662){logger['error'](_0x9bee('0x79'),_0x3faae1,util[_0x9bee('0x2f')](_0x5e1662,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x7a')]=function(_0x2b2408){try{if(this[_0x9bee('0x31')](_0x2b2408)){logger['debug'](_0x9bee('0x7b'),_0x2b2408['uniqueid'],util[_0x9bee('0x2f')](_0x2b2408,{'showHidden':![],'depth':null}));if(this[_0x9bee('0x17')][_0x2b2408[_0x9bee('0x34')]]&&_0x2b2408[_0x9bee('0x40')]!=_0x9bee('0x49')){if(this[_0x9bee('0x31')](_0x2b2408['variable'])){if(this['isNotNull'](_0x2b2408['variable'][_0x9bee('0x7c')])){logger[_0x9bee('0x2a')](_0x9bee('0x7d'),_0x2b2408[_0x9bee('0x34')],_0x2b2408['value']);this[_0x9bee('0x6e')](_0x2b2408[_0x9bee('0x34')],_0x2b2408['value']);}else if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')][_0x9bee('0x7f')])){logger[_0x9bee('0x2a')](_0x9bee('0x80'),_0x2b2408[_0x9bee('0x34')],_0x2b2408[_0x9bee('0x81')]);this['channels'][_0x2b2408[_0x9bee('0x34')]][_0x9bee('0x36')]=_0x2b2408['value'];}else if(this[_0x9bee('0x31')](_0x2b2408['variable'][_0x9bee('0x82')])){logger[_0x9bee('0x2a')](_0x9bee('0x83'),_0x2b2408[_0x9bee('0x34')],_0x2b2408[_0x9bee('0x81')]);this[_0x9bee('0x17')][_0x2b2408[_0x9bee('0x34')]]['callerid']=_0x2b2408[_0x9bee('0x81')];}else if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')]['xmd-cdrtype'])){logger['info'](_0x9bee('0x84'),_0x2b2408['uniqueid'],_0x2b2408[_0x9bee('0x81')]);this[_0x9bee('0x17')][_0x2b2408['uniqueid']][_0x9bee('0x5c')]=_0x2b2408[_0x9bee('0x81')];}else if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')][_0x9bee('0x85')])){logger[_0x9bee('0x2a')](_0x9bee('0x86'),_0x2b2408[_0x9bee('0x34')],_0x2b2408[_0x9bee('0x81')]['split'](',')[0x0]);this[_0x9bee('0x17')][_0x2b2408['uniqueid']][_0x9bee('0xa')]=_0x2b2408[_0x9bee('0x81')]['split'](',')[0x0];}else if(this['isNotNull'](_0x2b2408[_0x9bee('0x7e')][_0x9bee('0x87')])){logger[_0x9bee('0x2a')](_0x9bee('0x88'),_0x2b2408[_0x9bee('0x34')],_0x2b2408['value']);this['channels'][_0x2b2408[_0x9bee('0x34')]][_0x9bee('0x89')]=_0x2b2408[_0x9bee('0x81')];}else if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')][_0x9bee('0x8a')])){logger['info'](_0x9bee('0x8b'),_0x2b2408[_0x9bee('0x34')],_0x2b2408[_0x9bee('0x81')]);this[_0x9bee('0x17')][_0x2b2408[_0x9bee('0x34')]]['destination']=_0x2b2408['value'];}else if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')]['xmd-callerid-preview'])){logger[_0x9bee('0x2a')](_0x9bee('0x8c'),_0x2b2408[_0x9bee('0x34')],_0x2b2408[_0x9bee('0x81')]);this[_0x9bee('0x17')][_0x2b2408[_0x9bee('0x34')]][_0x9bee('0x8d')]=_0x2b2408[_0x9bee('0x81')];}else if(this[_0x9bee('0x31')](_0x2b2408['variable'][_0x9bee('0x8e')])){logger[_0x9bee('0x2a')](_0x9bee('0x8f'),_0x2b2408[_0x9bee('0x34')],_0x2b2408[_0x9bee('0x81')]);this['channels'][_0x2b2408[_0x9bee('0x34')]]['queue']=_0x2b2408[_0x9bee('0x81')];}else if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')][_0x9bee('0x90')])){logger[_0x9bee('0x2a')](_0x9bee('0x91'),_0x2b2408[_0x9bee('0x34')],_0x2b2408[_0x9bee('0x81')]);this[_0x9bee('0x17')][_0x2b2408[_0x9bee('0x34')]][_0x9bee('0x92')]=_0x2b2408[_0x9bee('0x81')];}}}else if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')][_0x9bee('0x7c')])){if(_0x2b2408[_0x9bee('0x81')]){var _0x5f03b7=path[_0x9bee('0x93')](_0x2b2408[_0x9bee('0x81')])[_0x9bee('0x50')];logger[_0x9bee('0x2a')](_0x9bee('0x7d'),_0x5f03b7,_0x2b2408['value']);this['syncMixMonitorFilename'](_0x5f03b7,_0x2b2408[_0x9bee('0x81')]);}}else if(this[_0x9bee('0x17')][_0x2b2408[_0x9bee('0x39')]]){if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')])){if(this[_0x9bee('0x31')](_0x2b2408[_0x9bee('0x7e')][_0x9bee('0x90')])){logger['info'](_0x9bee('0x91'),_0x2b2408['linkedid'],_0x2b2408[_0x9bee('0x81')]);this[_0x9bee('0x17')][_0x2b2408[_0x9bee('0x39')]][_0x9bee('0x94')]=_0x2b2408['value'];}}}}}catch(_0x5da01a){logger[_0x9bee('0x2d')](_0x9bee('0x95'),_0x2b2408[_0x9bee('0x34')],util[_0x9bee('0x2f')](_0x5da01a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x20')]=function(_0x579d8c){try{if(this[_0x9bee('0x31')](_0x579d8c)){logger[_0x9bee('0x37')]('[%s][voiceCallReport][hangup]\x20event:',_0x579d8c[_0x9bee('0x34')],util[_0x9bee('0x2f')](_0x579d8c,{'showHidden':![],'depth':null}));if(this[_0x9bee('0x19')][_0x579d8c['linkedid']]){if(this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x39')]]){this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x39')]]['uniqueid']=_0x579d8c[_0x9bee('0x34')];this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x39')]][_0x9bee('0x62')]=this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x62')];this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x39')]][_0x9bee('0x69')]=this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x69')];this[_0x9bee('0x17')][this['blindTransfers'][_0x579d8c['linkedid']][_0x9bee('0x39')]][_0x9bee('0x67')]=this['channels'][this[_0x9bee('0x19')][_0x579d8c['linkedid']][_0x9bee('0x39')]][_0x9bee('0x40')];this['channels'][this[_0x9bee('0x19')][_0x579d8c['linkedid']]['linkedid']][_0x9bee('0x4c')]=this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x4c')];this['channels'][_0x579d8c[_0x9bee('0x34')]]=this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]]['linkedid']];delete this[_0x9bee('0x17')][this['blindTransfers'][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x39')]];}else if(this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x34')]]){this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x34')]][_0x9bee('0x34')]=[this['channels'][this['blindTransfers'][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x34')]][_0x9bee('0x39')],this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x34')]][_0x9bee('0x39')]=this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c['linkedid']][_0x9bee('0x34')]]['uniqueid']][0x0];this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]]['uniqueid']]['answered']=this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x62')];this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x34')]]['answertime']=this[_0x9bee('0x17')][_0x579d8c['uniqueid']][_0x9bee('0x69')];this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c['linkedid']][_0x9bee('0x34')]][_0x9bee('0x67')]=this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x34')]]['channel'];this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x34')]][_0x9bee('0x4c')]=this[_0x9bee('0x17')][_0x579d8c['uniqueid']][_0x9bee('0x4c')];this['channels'][_0x579d8c['uniqueid']]=this[_0x9bee('0x17')][this[_0x9bee('0x19')][_0x579d8c[_0x9bee('0x39')]][_0x9bee('0x34')]];delete this[_0x9bee('0x17')][this['blindTransfers'][_0x579d8c['linkedid']]['uniqueid']];}}if(this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]]){logger[_0x9bee('0x2a')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x579d8c[_0x9bee('0x34')],_0x579d8c['cause-txt']);var _0x27adde=moment();this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]]['endtime']=_0x27adde[_0x9bee('0x46')](_0x9bee('0x4b'));this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]]['duration']=_0x27adde[_0x9bee('0x65')](this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x63')],_0x9bee('0x5a'));if(this['channels'][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x62')]){this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x96')]=_0x27adde[_0x9bee('0x65')](this['channels'][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x69')],_0x9bee('0x5a'));this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x64')]=this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x59')]-this[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]]['billableseconds'];}if(_0x579d8c['context']===_0x9bee('0x3f')){if(this[_0x9bee('0x18')][_0x579d8c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]){this[_0x9bee('0x18')][_0x579d8c['channel'][_0x9bee('0x41')]('-')[0x0]]=_[_0x9bee('0x97')](this[_0x9bee('0x18')][_0x579d8c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]],[_0x9bee('0x44')]);logger[_0x9bee('0x37')](_0x9bee('0x98'),_0x579d8c[_0x9bee('0x34')],util[_0x9bee('0x2f')]({'id':this[_0x9bee('0x18')][_0x579d8c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0x9bee('0x18')][_0x579d8c['channel']['split']('-')[0x0]][_0x9bee('0x47')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x9bee('0x46')]('user:%s',this[_0x9bee('0x18')][_0x579d8c[_0x9bee('0x40')]['split']('-')[0x0]][_0x9bee('0x50')]),_0x9bee('0x99'),{'id':this['agents'][_0x579d8c['channel'][_0x9bee('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0x9bee('0x18')][_0x579d8c[_0x9bee('0x40')][_0x9bee('0x41')]('-')[0x0]][_0x9bee('0x47')]});for(var _0x5e9ffb=0x0;_0x5e9ffb<Object[_0x9bee('0x3d')](this[_0x9bee('0x18')])[_0x9bee('0x9a')];_0x5e9ffb++){var _0x432741=Object[_0x9bee('0x3d')](this['agents'])[_0x5e9ffb];var _0x2c348a=this[_0x9bee('0x18')][_0x432741];if(_0x2c348a[_0x9bee('0x47')]===Number(_0x579d8c[_0x9bee('0x45')])){this[_0x9bee('0x32')](util['format'](_0x9bee('0x4f'),_0x2c348a[_0x9bee('0x50')]),_0x9bee('0x99'),{'id':_0x2c348a['id'],'destaccountcode':_0x2c348a[_0x9bee('0x47')],'transfer':this['channels'][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x9b')]});break;}}}}var _0x10cc8d=this;Promise[_0x9bee('0x9c')]()['then'](function(){var _0x2e7cb1=_0x10cc8d[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]];if(typeof _0x2e7cb1[_0x9bee('0x9b')]===_0x9bee('0x9d'))return;if(_[_0x9bee('0x9e')](_0x2e7cb1[_0x9bee('0x76')]))return;return RpcSetting[_0x9bee('0x9f')]()[_0x9bee('0xa0')](function(_0x34c22c){if(!_0x34c22c[_0x9bee('0xa1')])return;return Promise['resolve']()[_0x9bee('0xa0')](function(){return ami[_0x9bee('0xa2')]({'action':'StopMixMonitor','channel':_0x2e7cb1[_0x9bee('0x40')]})['catch'](function(){});})[_0x9bee('0xa0')](function(){return ami[_0x9bee('0xa2')]({'action':_0x9bee('0xa3'),'channel':_0x2e7cb1[_0x9bee('0x67')]})[_0x9bee('0xa4')](function(){})['finally'](function(){var _0x453673=_0x10cc8d[_0x9bee('0x18')][_0x2e7cb1[_0x9bee('0x67')]['split']('-')[0x0]];if(!_0x453673)return;io[_0x9bee('0x32')](_0x9bee('0xa5'),{'agentId':_0x453673['id'],'uniqueid':_0x2e7cb1[_0x9bee('0x34')]});});});});})[_0x9bee('0xa0')](function(){if(_0x579d8c[_0x9bee('0xa6')]===_0x9bee('0xa7')){_0x10cc8d['blindTransfers'][_0x579d8c['uniqueid']]=_0x579d8c;}else{if(_0x10cc8d[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x5c')]===_0x9bee('0xa8')&&_0x10cc8d[_0x9bee('0x19')][_0x579d8c['uniqueid']]){_0x10cc8d[_0x9bee('0x17')][_0x579d8c['uniqueid']]['uniqueid']=[_0x10cc8d[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x39')],_0x10cc8d[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]][_0x9bee('0x39')]=_0x10cc8d[_0x9bee('0x17')][_0x579d8c['uniqueid']][_0x9bee('0x34')]][0x0];delete _0x10cc8d['blindTransfers'][_0x579d8c[_0x9bee('0x34')]];}}logger[_0x9bee('0x37')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x579d8c[_0x9bee('0x34')],util[_0x9bee('0x2f')](_0x10cc8d[_0x9bee('0x17')][_0x579d8c[_0x9bee('0x34')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceCallReport',_0x10cc8d['channels'][_0x579d8c[_0x9bee('0x34')]]);delete _0x10cc8d['channels'][_0x579d8c[_0x9bee('0x34')]];});}}}catch(_0x4e0f43){logger[_0x9bee('0x2d')]('[%s][voiceCallReport][hangup]',_0x579d8c['uniqueid'],util[_0x9bee('0x2f')](_0x4e0f43,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x23')]=function(_0x47c3c4){try{if(this[_0x9bee('0x31')](_0x47c3c4)){logger[_0x9bee('0x2a')](_0x9bee('0xa9'),_0x47c3c4[_0x9bee('0x34')],_0x47c3c4[_0x9bee('0xaa')],_0x47c3c4[_0x9bee('0xab')]);logger[_0x9bee('0x37')](_0x9bee('0xac'),_0x47c3c4[_0x9bee('0x34')],util[_0x9bee('0x2f')](_0x47c3c4,{'showHidden':![],'depth':null}));var _0x5e8fee;if(this['channels'][_0x47c3c4[_0x9bee('0xad')]]){this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xad')]][_0x9bee('0xae')]=_0x47c3c4[_0x9bee('0xaa')];this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xad')]][_0x9bee('0xaf')]=_0x47c3c4[_0x9bee('0xab')];if(this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb0')]]){_0x5e8fee=this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb0')]];this[_0x9bee('0x17')][_0x47c3c4['secondtransfereruniqueid']]=this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xad')]];this['channels'][_0x47c3c4[_0x9bee('0xad')]]=_0x5e8fee;}this['channels'][_0x47c3c4[_0x9bee('0xb0')]][_0x9bee('0x9b')]=_0x9bee('0xb1');}else if(this['channels'][_0x47c3c4[_0x9bee('0xb2')]]){this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb2')]][_0x9bee('0xae')]=_0x47c3c4['origtransferercalleridnum'];this['channels'][_0x47c3c4[_0x9bee('0xb2')]][_0x9bee('0xaf')]=_0x47c3c4['transfertargetcalleridnum'];if(this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb3')]]){_0x5e8fee=this['channels'][_0x47c3c4[_0x9bee('0xb3')]];this[_0x9bee('0x17')][_0x47c3c4['origtransfereruniqueid']]=this['channels'][_0x47c3c4[_0x9bee('0xb2')]];this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb2')]]=_0x5e8fee;}this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb2')]][_0x9bee('0x9b')]=_0x9bee('0xb1');}if((this['channels'][_0x47c3c4[_0x9bee('0xb3')]]||this['channels'][_0x47c3c4[_0x9bee('0xb4')]])&&this[_0x9bee('0x17')][_0x47c3c4['secondtransfereruniqueid']]){var _0x2d3955=_[_0x9bee('0xb5')]([this[_0x9bee('0x17')][_0x47c3c4['origtransfereruniqueid']],this['channels'][_0x47c3c4[_0x9bee('0xb4')]],this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb0')]]],function(_0x44fbe3){return _0x44fbe3&&_0x44fbe3[_0x9bee('0x5c')]===_0x9bee('0xa8')&&_0x44fbe3['routeid'];});if(_0x2d3955){if(this[_0x9bee('0x17')][_0x47c3c4['origtransfereruniqueid']])this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb3')]]['transferType']=_0x9bee('0xb1');if(this['channels'][_0x47c3c4['origtransfererlinkedid']])this[_0x9bee('0x17')][_0x47c3c4[_0x9bee('0xb4')]][_0x9bee('0x9b')]='ATTENDED';this['channels'][_0x47c3c4[_0x9bee('0xb0')]]['transferType']=_0x9bee('0xb1');}}}}catch(_0x152189){logger[_0x9bee('0x2d')](_0x9bee('0xb6'),_0x47c3c4['uniqueid'],util[_0x9bee('0x2f')](_0x152189,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x25')]=function(_0x3c5378){try{if(this['isNotNull'](_0x3c5378)){logger['info'](_0x9bee('0xb7'),_0x3c5378['uniqueid'],_0x3c5378[_0x9bee('0xb8')],_0x3c5378[_0x9bee('0xb9')]);logger['debug']('[%s][voiceCallReport][blindtransfer]\x20event:',_0x3c5378['uniqueid'],util[_0x9bee('0x2f')](_0x3c5378,{'showHidden':![],'depth':null}));if(this[_0x9bee('0x17')][_0x3c5378[_0x9bee('0xad')]]){this[_0x9bee('0x17')][_0x3c5378[_0x9bee('0xad')]][_0x9bee('0xae')]=_0x3c5378[_0x9bee('0xb8')];this[_0x9bee('0x17')][_0x3c5378[_0x9bee('0xad')]][_0x9bee('0xaf')]=_0x3c5378[_0x9bee('0xb9')];this[_0x9bee('0x17')][_0x3c5378[_0x9bee('0xad')]]['transferType']=_0x9bee('0xba');this[_0x9bee('0x20')]({'event':_0x9bee('0xa7'),'uniqueid':_0x3c5378[_0x9bee('0xad')],'linkedid':_0x3c5378[_0x9bee('0xbb')],'context':_0x3c5378['context'],'channel':_0x3c5378[_0x9bee('0xbc')]});}else{this['channels'][_0x3c5378[_0x9bee('0xbb')]]['transferType']='BLIND';this[_0x9bee('0x20')]({'event':_0x9bee('0xa7'),'uniqueid':_0x3c5378[_0x9bee('0xbb')],'linkedid':_0x3c5378[_0x9bee('0xad')],'context':_0x3c5378[_0x9bee('0x3e')],'channel':_0x3c5378['transfererchannel']});}}}catch(_0x51ff35){logger[_0x9bee('0x2d')](_0x9bee('0xbd'),_0x3c5378['uniqueid'],util['inspect'](_0x51ff35,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x27')]=function(_0x31a824){try{if(this[_0x9bee('0x31')](_0x31a824)){logger[_0x9bee('0x37')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x31a824['uniqueid'],util['inspect'](_0x31a824,{'showHidden':![],'depth':null}));if(this[_0x9bee('0x17')][_0x31a824[_0x9bee('0x34')]]){if(!_['isNil'](this['channels'][_0x31a824[_0x9bee('0x34')]][_0x9bee('0x69')])){this[_0x9bee('0x17')][_0x31a824['uniqueid']][_0x9bee('0xbe')]=moment()[_0x9bee('0x46')](_0x9bee('0x4b'));logger[_0x9bee('0x2a')](_0x9bee('0xbf'),_0x31a824[_0x9bee('0x34')],this[_0x9bee('0x17')][_0x31a824[_0x9bee('0x34')]][_0x9bee('0xbe')]);}}}}catch(_0xe5b7d4){logger[_0x9bee('0x2d')](_0x9bee('0xc0'),_0x31a824['uniqueid'],util[_0x9bee('0x2f')](_0xe5b7d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9bee('0x30')][_0x9bee('0x29')]=function(_0x39ba20){try{if(this['isNotNull'](_0x39ba20)){logger[_0x9bee('0x37')](_0x9bee('0xc1'),_0x39ba20[_0x9bee('0x34')],util['inspect'](_0x39ba20,{'showHidden':![],'depth':null}));if(this[_0x9bee('0x17')][_0x39ba20[_0x9bee('0x34')]]){if(!_[_0x9bee('0x5d')](this['channels'][_0x39ba20[_0x9bee('0x34')]][_0x9bee('0xbe')])){this[_0x9bee('0x17')][_0x39ba20[_0x9bee('0x34')]][_0x9bee('0xc2')]+=moment()[_0x9bee('0xc3')](0x0)['diff'](this[_0x9bee('0x17')][_0x39ba20[_0x9bee('0x34')]][_0x9bee('0xbe')],'seconds');logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x39ba20[_0x9bee('0x34')],this[_0x9bee('0x17')][_0x39ba20[_0x9bee('0x34')]][_0x9bee('0xc2')]);delete this[_0x9bee('0x17')][_0x39ba20[_0x9bee('0x34')]]['mohstarttime'];}}}}catch(_0x4d0249){logger['error']('[%s][voiceCallReport][musiconholdstop]',_0x39ba20[_0x9bee('0x34')],util[_0x9bee('0x2f')](_0x4d0249,{'showHidden':![],'depth':null}));}};module[_0x9bee('0xc4')]=VoiceCallReport;
\ No newline at end of file
+var _0xaddd=['transfercalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','set','queue','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','localhost','channels','agents','blindTransfers','newexten','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','uniqueid','merge','pick','keys','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','inspect','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newexten]\x20event:','application','appdata','CDR(routeAlias)','applicationdata','startsWith','toLowerCase','duration','subtract','seconds','includes','cdr(','match','type','isNil','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','diff','destinationchannel','toNumber','channelstate','UserId','connectedlinename','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','replace','.wav49','.WAV','find','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','billableseconds','user:agentcomplete','length','transferType','resolve','then','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','outbound','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension'];(function(_0x15d380,_0x30171b){var _0x452eff=function(_0x182ff2){while(--_0x182ff2){_0x15d380['push'](_0x15d380['shift']());}};_0x452eff(++_0x30171b);}(_0xaddd,0x18e));var _0xdadd=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0xaddd[_0x130705];return _0x1fa991;};'use strict';var _=require(_0xdadd('0x0'));var moment=require(_0xdadd('0x1'));var util=require('util');var path=require('path');var Redis=require(_0xdadd('0x2'));var config=require(_0xdadd('0x3'));var logger=require(_0xdadd('0x4'))('ami');var ami=require(_0xdadd('0x5'));var Channel=require(_0xdadd('0x6'));var RpcSetting=require('../rpc/setting');var applications=[_0xdadd('0x7'),_0xdadd('0x8'),'agi','dial',_0xdadd('0x9'),_0xdadd('0xa')];var dispositions=[_0xdadd('0xb'),_0xdadd('0xc'),_0xdadd('0xc'),_0xdadd('0xb'),_0xdadd('0xb'),_0xdadd('0xb'),_0xdadd('0xd'),'BUSY',_0xdadd('0xc'),_0xdadd('0xc'),'FAILED'];config['redis']=_['defaults'](config[_0xdadd('0xe')],{'host':_0xdadd('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdadd('0xe')]));function VoiceCallReport(_0x15de9f){this[_0xdadd('0x10')]=_0x15de9f['channels'];this[_0xdadd('0x11')]=_0x15de9f[_0xdadd('0x11')];this[_0xdadd('0x12')]={};ami['on']('coreshowchannel',this['syncNewExten']['bind'](this));ami['on'](_0xdadd('0x13'),this[_0xdadd('0x14')][_0xdadd('0x15')](this));ami['on'](_0xdadd('0x16'),this[_0xdadd('0x17')][_0xdadd('0x15')](this));ami['on'](_0xdadd('0x18'),this[_0xdadd('0x19')]['bind'](this));ami['on'](_0xdadd('0x1a'),this[_0xdadd('0x1b')][_0xdadd('0x15')](this));ami['on']('hangup',this[_0xdadd('0x1c')][_0xdadd('0x15')](this));ami['on'](_0xdadd('0x1d'),this[_0xdadd('0x1e')][_0xdadd('0x15')](this));ami['on'](_0xdadd('0x1f'),this['syncAttendedTransfer'][_0xdadd('0x15')](this));ami['on'](_0xdadd('0x20'),this[_0xdadd('0x21')][_0xdadd('0x15')](this));ami['on'](_0xdadd('0x22'),this[_0xdadd('0x23')][_0xdadd('0x15')](this));ami['on'](_0xdadd('0x24'),this[_0xdadd('0x25')][_0xdadd('0x15')](this));try{logger[_0xdadd('0x26')](_0xdadd('0x27'));ami[_0xdadd('0x28')]();}catch(_0x1eeb06){logger[_0xdadd('0x29')]('[voiceCallReport][coreshowchannels]',util['inspect'](_0x1eeb06,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xdadd('0x2a')][_0xdadd('0x2b')]=function(_0x2b893e){return _0x2b893e!==null&&!_[_0xdadd('0x2c')](_0x2b893e);};VoiceCallReport[_0xdadd('0x2a')][_0xdadd('0x2d')]=function(_0x14cb03,_0x1f226e,_0x39d5b0){io['to'](_0x14cb03)['emit'](_0x1f226e,_0x39d5b0);};VoiceCallReport[_0xdadd('0x2a')][_0xdadd('0x1e')]=function(_0x5cd624){try{if(this[_0xdadd('0x2b')](_0x5cd624)){logger[_0xdadd('0x26')](_0xdadd('0x2e'),_0x5cd624['uniqueid'],_0x5cd624[_0xdadd('0x2f')],_0x5cd624[_0xdadd('0x30')]);logger[_0xdadd('0x31')](_0xdadd('0x32'),_0x5cd624['uniqueid'],util['inspect'](_0x5cd624,{'showHidden':![],'depth':null}));if(_0x5cd624['uniqueid']===_0x5cd624[_0xdadd('0x33')]){if(!_[_0xdadd('0x2c')](this[_0xdadd('0x10')][_0x5cd624[_0xdadd('0x34')]])){_[_0xdadd('0x35')](this[_0xdadd('0x10')][_0x5cd624[_0xdadd('0x34')]],_[_0xdadd('0x36')](_0x5cd624,_[_0xdadd('0x37')](this[_0xdadd('0x10')][_0x5cd624[_0xdadd('0x34')]])));}}if(_0x5cd624['context']===_0xdadd('0x38')){if(this[_0xdadd('0x11')][_0x5cd624[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]){if(_0x5cd624[_0xdadd('0x3b')]==_0xdadd('0x3c')){this[_0xdadd('0x11')][_0x5cd624[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x3d')]=_0x5cd624[_0xdadd('0x3e')];this[_0xdadd('0x2d')](util[_0xdadd('0x3f')](_0xdadd('0x40'),this['agents'][_0x5cd624[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x41')]),_0xdadd('0x42'),{'destaccountcode':this[_0xdadd('0x11')][_0x5cd624[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x43')],'destconnectedlinenum':_0x5cd624[_0xdadd('0x3e')]});}}}}}catch(_0x311975){logger[_0xdadd('0x29')](_0xdadd('0x44'),_0x5cd624['uniqueid'],util['inspect'](_0x311975,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdadd('0x2a')][_0xdadd('0x17')]=function(_0x2a0d28){try{if(this['isNotNull'](_0x2a0d28)){logger[_0xdadd('0x31')]('[%s][voiceCallReport][newchannel]\x20event:',_0x2a0d28[_0xdadd('0x34')],util[_0xdadd('0x45')](_0x2a0d28,{'showHidden':![],'depth':null}));if(this['channels'][_0x2a0d28[_0xdadd('0x34')]])return;if(_0x2a0d28[_0xdadd('0x39')]===_0xdadd('0x46'))return;if(_0x2a0d28[_0xdadd('0x34')]!==_0x2a0d28['linkedid']&&!this[_0xdadd('0x12')][_0x2a0d28['linkedid']])return;logger[_0xdadd('0x26')](_0xdadd('0x47'),_0x2a0d28[_0xdadd('0x34')],_0x2a0d28[_0xdadd('0x48')],_0x2a0d28[_0xdadd('0x3b')]);this[_0xdadd('0x10')][_0x2a0d28[_0xdadd('0x34')]]=new Channel();this[_0xdadd('0x10')][_0x2a0d28[_0xdadd('0x34')]][_0xdadd('0x49')]=moment()[_0xdadd('0x3f')](_0xdadd('0x4a'));this[_0xdadd('0x10')][_0x2a0d28[_0xdadd('0x34')]][_0xdadd('0x4b')]=dispositions[_['toNumber'](_0x2a0d28['channelstate'])];_[_0xdadd('0x35')](this['channels'][_0x2a0d28[_0xdadd('0x34')]],_[_0xdadd('0x36')](_0x2a0d28,_['keys'](this[_0xdadd('0x10')][_0x2a0d28['uniqueid']])));if(_0x2a0d28[_0xdadd('0x48')]===_0xdadd('0x38')){if(this[_0xdadd('0x11')][_0x2a0d28[_0xdadd('0x39')]['split']('-')[0x0]]){if(_[_0xdadd('0x2c')](this[_0xdadd('0x11')][_0x2a0d28[_0xdadd('0x39')]['split']('-')[0x0]][_0xdadd('0x3d')])){this[_0xdadd('0x11')][_0x2a0d28[_0xdadd('0x39')]['split']('-')[0x0]][_0xdadd('0x3d')]=_0x2a0d28['exten'];logger[_0xdadd('0x31')](_0xdadd('0x4c'),_0x2a0d28['uniqueid'],util['inspect']({'id':this[_0xdadd('0x11')][_0x2a0d28[_0xdadd('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xdadd('0x11')][_0x2a0d28[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x43')],'destconnectedlinenum':_0x2a0d28[_0xdadd('0x3b')]},{'showHidden':![],'depth':null}));this[_0xdadd('0x2d')](util[_0xdadd('0x3f')](_0xdadd('0x40'),this[_0xdadd('0x11')][_0x2a0d28['channel'][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x41')]),'user:agentconnect',{'id':this['agents'][_0x2a0d28[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xdadd('0x11')][_0x2a0d28['channel']['split']('-')[0x0]][_0xdadd('0x43')],'destconnectedlinenum':_0x2a0d28['exten']});}}}}}catch(_0x58c063){logger['error']('[%s][voiceCallReport][newchannel]',_0x2a0d28[_0xdadd('0x34')],util[_0xdadd('0x45')](_0x58c063,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdadd('0x2a')]['syncNewExten']=function(_0x1558f9){try{if(this[_0xdadd('0x2b')](_0x1558f9)){logger['debug'](_0xdadd('0x4d'),_0x1558f9[_0xdadd('0x34')],util['inspect'](_0x1558f9,{'showHidden':![],'depth':null}));if(_0x1558f9[_0xdadd('0x39')]===_0xdadd('0x46')||_0x1558f9[_0xdadd('0x3b')]==='h')return;if(_0x1558f9[_0xdadd('0x34')]===_0x1558f9[_0xdadd('0x33')]||this[_0xdadd('0x12')][_0x1558f9[_0xdadd('0x33')]]){_0x1558f9[_0xdadd('0x4e')]=_0x1558f9['application']['toLowerCase']();var _0x58367a=_0x1558f9[_0xdadd('0x4f')]&&_0x1558f9[_0xdadd('0x4f')]['startsWith'](_0xdadd('0x50'))?_0x1558f9[_0xdadd('0x4f')]:_0x1558f9[_0xdadd('0x4f')]||_0x1558f9[_0xdadd('0x51')];_0x1558f9[_0xdadd('0x51')]=_0x1558f9[_0xdadd('0x4f')]&&_0x1558f9['appdata'][_0xdadd('0x52')](_0xdadd('0x50'))?_0x1558f9[_0xdadd('0x4f')]:(_0x1558f9[_0xdadd('0x4f')]||_0x1558f9['applicationdata'])[_0xdadd('0x53')]();logger[_0xdadd('0x26')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x1558f9['uniqueid'],_0x1558f9[_0xdadd('0x4e')],_0x1558f9[_0xdadd('0x51')]);if(_['isUndefined'](this[_0xdadd('0x10')][_0x1558f9[_0xdadd('0x34')]])){this[_0xdadd('0x10')][_0x1558f9[_0xdadd('0x34')]]=new Channel();this[_0xdadd('0x10')][_0x1558f9[_0xdadd('0x34')]][_0xdadd('0x49')]=_0x1558f9[_0xdadd('0x54')]?moment()[_0xdadd('0x55')](moment[_0xdadd('0x54')](_0x1558f9[_0xdadd('0x54')])[_0xdadd('0x56')](),_0xdadd('0x56'))[_0xdadd('0x3f')](_0xdadd('0x4a')):moment()[_0xdadd('0x3f')](_0xdadd('0x4a'));this[_0xdadd('0x10')][_0x1558f9[_0xdadd('0x34')]][_0xdadd('0x4b')]='NO\x20ANSWER';}_[_0xdadd('0x35')](this[_0xdadd('0x10')][_0x1558f9[_0xdadd('0x34')]],_[_0xdadd('0x36')](_0x1558f9,_[_0xdadd('0x37')](this[_0xdadd('0x10')][_0x1558f9[_0xdadd('0x34')]])));if(_[_0xdadd('0x57')](applications,_0x1558f9[_0xdadd('0x4e')])){this[_0xdadd('0x10')][_0x1558f9['uniqueid']]['lastapplication']=_0x1558f9['application'];this['channels'][_0x1558f9[_0xdadd('0x34')]]['lastdata']=_0x1558f9['applicationdata'];if(_0x1558f9[_0xdadd('0x4e')]===_0xdadd('0x7')&&_['startsWith'](_0x1558f9['applicationdata'][_0xdadd('0x53')](),_0xdadd('0x58'))){var _0x41eaf2=_0x1558f9[_0xdadd('0x51')]['split']('=');var _0x4f2406=_0x41eaf2[0x0][_0xdadd('0x53')]()[_0xdadd('0x59')](/cdr\((.*)\)/);if(_0x4f2406){if(_0x4f2406[0x1]===_0xdadd('0x5a')&&!_[_0xdadd('0x5b')](this[_0xdadd('0x10')][_0x1558f9[_0xdadd('0x34')]][_0x4f2406[0x1]]))return;this[_0xdadd('0x10')][_0x1558f9['uniqueid']][_0x4f2406[0x1]]=_0x41eaf2[0x1];}}else if(_0x1558f9[_0xdadd('0x4e')]===_0xdadd('0x8')){this[_0xdadd('0x10')][_0x1558f9['uniqueid']]['queue']=_0x58367a[_0xdadd('0x3a')](',')[0x0];}}}}}catch(_0xe24b05){logger[_0xdadd('0x29')]('[%s][voiceCallReport][newexten]',_0x1558f9[_0xdadd('0x34')],util[_0xdadd('0x45')](_0xe24b05,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdadd('0x19')]=function(_0x16e9aa){try{if(this[_0xdadd('0x2b')](_0x16e9aa)){logger[_0xdadd('0x26')](_0xdadd('0x5c'),_0x16e9aa[_0xdadd('0x34')],_0x16e9aa[_0xdadd('0x33')],_0x16e9aa[_0xdadd('0x2f')],_0x16e9aa[_0xdadd('0x30')]);logger[_0xdadd('0x31')]('[%s][voiceCallReport][newstate]\x20event:',_0x16e9aa[_0xdadd('0x34')],util[_0xdadd('0x45')](_0x16e9aa,{'showHidden':![],'depth':null}));if(_0x16e9aa['channelstate']!=='6')return;if(_0x16e9aa[_0xdadd('0x34')]!==_0x16e9aa['linkedid']){var _0x33db96=moment();if(this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]]){if(!this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]]['answered']){this[_0xdadd('0x10')][_0x16e9aa['linkedid']][_0xdadd('0x5d')]=!![];this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]][_0xdadd('0x5e')]=_0x33db96['format']('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]][_0xdadd('0x49')]){this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]][_0xdadd('0x5f')]=_0x33db96[_0xdadd('0x60')](this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]][_0xdadd('0x49')],_0xdadd('0x56'));}}this['channels'][_0x16e9aa[_0xdadd('0x33')]][_0xdadd('0x33')]=_0x16e9aa[_0xdadd('0x34')];if(_0x16e9aa[_0xdadd('0x30')]!==_0xdadd('0x3c')){this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]][_0xdadd('0x3e')]=_0x16e9aa['calleridnum'];}this[_0xdadd('0x10')][_0x16e9aa['linkedid']]['connectedlinename']=_0x16e9aa[_0xdadd('0x2f')];this['channels'][_0x16e9aa[_0xdadd('0x33')]][_0xdadd('0x61')]=_0x16e9aa[_0xdadd('0x39')];this['channels'][_0x16e9aa['linkedid']][_0xdadd('0x4b')]=dispositions[_[_0xdadd('0x62')](_0x16e9aa[_0xdadd('0x63')])];if(this[_0xdadd('0x11')][_0x16e9aa[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]){this[_0xdadd('0x10')][_0x16e9aa['linkedid']][_0xdadd('0x64')]=this['agents'][_0x16e9aa[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]['id'];this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]]['membername']=this[_0xdadd('0x11')][_0x16e9aa[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x41')];}}if(this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]]){if(!this['channels'][_0x16e9aa[_0xdadd('0x34')]]['answered']){this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]]['answered']=!![];this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]]['answertime']=_0x33db96[_0xdadd('0x3f')](_0xdadd('0x4a'));if(this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]][_0xdadd('0x49')]){this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]][_0xdadd('0x5f')]=_0x33db96[_0xdadd('0x60')](this['channels'][_0x16e9aa[_0xdadd('0x34')]][_0xdadd('0x49')],_0xdadd('0x56'));}}if(_0x16e9aa[_0xdadd('0x30')]!==_0xdadd('0x3c')){this['channels'][_0x16e9aa[_0xdadd('0x34')]][_0xdadd('0x3e')]=_0x16e9aa['calleridnum'];}this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]][_0xdadd('0x65')]=_0x16e9aa[_0xdadd('0x2f')];this['channels'][_0x16e9aa[_0xdadd('0x34')]][_0xdadd('0x61')]=_0x16e9aa[_0xdadd('0x39')];this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]][_0xdadd('0x4b')]=dispositions[_['toNumber'](_0x16e9aa[_0xdadd('0x63')])];}}else{if(this['channels'][_0x16e9aa[_0xdadd('0x34')]]){if(this[_0xdadd('0x11')][_0x16e9aa[_0xdadd('0x39')]['split']('-')[0x0]]){this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]]['UserId']=this['agents'][_0x16e9aa[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]['id'];this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]]['membername']=this[_0xdadd('0x11')][_0x16e9aa['channel'][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x41')];}}}if(_0x16e9aa['context']===_0xdadd('0x38')){if(this[_0xdadd('0x11')][_0x16e9aa[_0xdadd('0x39')]['split']('-')[0x0]]){this['agents'][_0x16e9aa['channel'][_0xdadd('0x3a')]('-')[0x0]]['destconnectedlinenum']=_0x16e9aa[_0xdadd('0x3b')];var _0x287c8c,_0x2e9a80;if(this['channels'][_0x16e9aa[_0xdadd('0x34')]]){_0x287c8c=this[_0xdadd('0x10')][_0x16e9aa['uniqueid']][_0xdadd('0x66')];_0x2e9a80=this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x34')]][_0xdadd('0x8')];}else if(this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]]){_0x287c8c=this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]]['routealias'];_0x2e9a80=this[_0xdadd('0x10')][_0x16e9aa[_0xdadd('0x33')]][_0xdadd('0x8')];}logger[_0xdadd('0x31')](_0xdadd('0x67'),_0x16e9aa['uniqueid'],util['inspect']({'id':this[_0xdadd('0x11')][_0x16e9aa[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xdadd('0x11')][_0x16e9aa['channel'][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x43')],'destconnectedlinenum':_0x16e9aa['exten'],'routealias':_0x287c8c,'queue':_0x2e9a80||undefined},{'showHidden':![],'depth':null}));this[_0xdadd('0x2d')](util['format']('user:%s',this[_0xdadd('0x11')][_0x16e9aa[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]['name']),_0xdadd('0x42'),{'id':this['agents'][_0x16e9aa[_0xdadd('0x39')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xdadd('0x11')][_0x16e9aa['channel'][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x43')],'destconnectedlinenum':_0x16e9aa[_0xdadd('0x3b')],'routealias':_0x287c8c,'queue':_0x2e9a80||undefined});}}}}catch(_0x68e8b2){logger[_0xdadd('0x29')](_0xdadd('0x68'),_0x16e9aa[_0xdadd('0x34')],util['inspect'](_0x68e8b2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdadd('0x69')]=function(_0x5be845,_0x23dec2){try{if(this['channels'][_0x5be845]){logger[_0xdadd('0x26')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x5be845,_0x23dec2);this[_0xdadd('0x10')][_0x5be845][_0xdadd('0x6a')]=!![];if(_[_0xdadd('0x6b')](_0x23dec2,'.wav49')){_0x23dec2=_0x23dec2[_0xdadd('0x6c')](_0xdadd('0x6d'),_0xdadd('0x6e'));}this['channels'][_0x5be845]['monitorFilename']=_0x23dec2;var _0x5a5549=_[_0xdadd('0x6f')](this['channels'][_0x5be845][_0xdadd('0x70')],{'filename':_0x23dec2});if(_['isNil'](_0x5a5549)){this['channels'][_0x5be845][_0xdadd('0x70')]['push']({'filename':_0x23dec2,'createdAt':moment()[_0xdadd('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xdadd('0x71')});}}}catch(_0x2b132d){logger[_0xdadd('0x29')](_0xdadd('0x72'),_0x5be845,util[_0xdadd('0x45')](_0x2b132d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdadd('0x2a')][_0xdadd('0x1b')]=function(_0x20b4f3){try{if(this[_0xdadd('0x2b')](_0x20b4f3)){logger['debug'](_0xdadd('0x73'),_0x20b4f3[_0xdadd('0x34')],util[_0xdadd('0x45')](_0x20b4f3,{'showHidden':![],'depth':null}));if(this[_0xdadd('0x10')][_0x20b4f3[_0xdadd('0x34')]]&&_0x20b4f3[_0xdadd('0x39')]!='OutgoingSpoolFailed'){if(this[_0xdadd('0x2b')](_0x20b4f3[_0xdadd('0x74')])){if(this[_0xdadd('0x2b')](_0x20b4f3[_0xdadd('0x74')][_0xdadd('0x75')])){logger[_0xdadd('0x26')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x20b4f3[_0xdadd('0x34')],_0x20b4f3['value']);this[_0xdadd('0x69')](_0x20b4f3[_0xdadd('0x34')],_0x20b4f3['value']);}else if(this[_0xdadd('0x2b')](_0x20b4f3[_0xdadd('0x74')][_0xdadd('0x76')])){logger['info'](_0xdadd('0x77'),_0x20b4f3[_0xdadd('0x34')],_0x20b4f3['value']);this[_0xdadd('0x10')][_0x20b4f3['uniqueid']][_0xdadd('0x30')]=_0x20b4f3[_0xdadd('0x78')];}else if(this['isNotNull'](_0x20b4f3['variable'][_0xdadd('0x79')])){logger[_0xdadd('0x26')](_0xdadd('0x7a'),_0x20b4f3[_0xdadd('0x34')],_0x20b4f3[_0xdadd('0x78')]);this[_0xdadd('0x10')][_0x20b4f3[_0xdadd('0x34')]][_0xdadd('0x7b')]=_0x20b4f3[_0xdadd('0x78')];}else if(this[_0xdadd('0x2b')](_0x20b4f3['variable'][_0xdadd('0x7c')])){logger['info'](_0xdadd('0x7d'),_0x20b4f3[_0xdadd('0x34')],_0x20b4f3['value']);this[_0xdadd('0x10')][_0x20b4f3[_0xdadd('0x34')]][_0xdadd('0x5a')]=_0x20b4f3[_0xdadd('0x78')];}else if(this[_0xdadd('0x2b')](_0x20b4f3[_0xdadd('0x74')][_0xdadd('0x7e')])){logger['info'](_0xdadd('0x7f'),_0x20b4f3[_0xdadd('0x34')],_0x20b4f3[_0xdadd('0x78')][_0xdadd('0x3a')](',')[0x0]);this['channels'][_0x20b4f3['uniqueid']]['queue']=_0x20b4f3[_0xdadd('0x78')][_0xdadd('0x3a')](',')[0x0];}else if(this[_0xdadd('0x2b')](_0x20b4f3['variable']['xmd-originatecalleridnum'])){logger[_0xdadd('0x26')](_0xdadd('0x80'),_0x20b4f3[_0xdadd('0x34')],_0x20b4f3[_0xdadd('0x78')]);this[_0xdadd('0x10')][_0x20b4f3['uniqueid']][_0xdadd('0x81')]=_0x20b4f3[_0xdadd('0x78')];}else if(this[_0xdadd('0x2b')](_0x20b4f3[_0xdadd('0x74')][_0xdadd('0x82')])){logger[_0xdadd('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x20b4f3['uniqueid'],_0x20b4f3[_0xdadd('0x78')]);this[_0xdadd('0x10')][_0x20b4f3[_0xdadd('0x34')]][_0xdadd('0x83')]=_0x20b4f3[_0xdadd('0x78')];}else if(this['isNotNull'](_0x20b4f3[_0xdadd('0x74')][_0xdadd('0x84')])){logger[_0xdadd('0x26')](_0xdadd('0x85'),_0x20b4f3[_0xdadd('0x34')],_0x20b4f3[_0xdadd('0x78')]);this[_0xdadd('0x10')][_0x20b4f3[_0xdadd('0x34')]][_0xdadd('0x86')]=_0x20b4f3[_0xdadd('0x78')];}else if(this[_0xdadd('0x2b')](_0x20b4f3[_0xdadd('0x74')][_0xdadd('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x20b4f3[_0xdadd('0x34')],_0x20b4f3[_0xdadd('0x78')]);this[_0xdadd('0x10')][_0x20b4f3['uniqueid']][_0xdadd('0x8')]=_0x20b4f3[_0xdadd('0x78')];}else if(this[_0xdadd('0x2b')](_0x20b4f3[_0xdadd('0x74')]['sipcallid'])){logger[_0xdadd('0x26')](_0xdadd('0x88'),_0x20b4f3[_0xdadd('0x34')],_0x20b4f3[_0xdadd('0x78')]);this[_0xdadd('0x10')][_0x20b4f3[_0xdadd('0x34')]][_0xdadd('0x89')]=_0x20b4f3[_0xdadd('0x78')];}}}else if(this['isNotNull'](_0x20b4f3[_0xdadd('0x74')][_0xdadd('0x75')])){if(_0x20b4f3[_0xdadd('0x78')]){var _0x18adc8=path[_0xdadd('0x8a')](_0x20b4f3[_0xdadd('0x78')])['name'];logger['info'](_0xdadd('0x8b'),_0x18adc8,_0x20b4f3[_0xdadd('0x78')]);this[_0xdadd('0x69')](_0x18adc8,_0x20b4f3[_0xdadd('0x78')]);}}else if(this[_0xdadd('0x10')][_0x20b4f3['linkedid']]){if(this[_0xdadd('0x2b')](_0x20b4f3['variable'])){if(this['isNotNull'](_0x20b4f3['variable']['sipcallid'])){logger[_0xdadd('0x26')](_0xdadd('0x88'),_0x20b4f3['linkedid'],_0x20b4f3['value']);this['channels'][_0x20b4f3[_0xdadd('0x33')]][_0xdadd('0x8c')]=_0x20b4f3[_0xdadd('0x78')];}}}}}catch(_0x1c0d82){logger[_0xdadd('0x29')](_0xdadd('0x8d'),_0x20b4f3[_0xdadd('0x34')],util[_0xdadd('0x45')](_0x1c0d82,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdadd('0x2a')][_0xdadd('0x1c')]=function(_0x283f21){try{if(this['isNotNull'](_0x283f21)){logger[_0xdadd('0x31')]('[%s][voiceCallReport][hangup]\x20event:',_0x283f21[_0xdadd('0x34')],util[_0xdadd('0x45')](_0x283f21,{'showHidden':![],'depth':null}));if(this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]]){if(this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x33')]]){this['channels'][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]]['linkedid']][_0xdadd('0x34')]=_0x283f21['uniqueid'];this[_0xdadd('0x10')][this['blindTransfers'][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x33')]][_0xdadd('0x5d')]=this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x5d')];this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x33')]][_0xdadd('0x5e')]=this['channels'][_0x283f21[_0xdadd('0x34')]]['answertime'];this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x33')]][_0xdadd('0x61')]=this[_0xdadd('0x10')][this['blindTransfers'][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x33')]][_0xdadd('0x39')];this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]]['linkedid']][_0xdadd('0x4b')]=this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x4b')];this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]]=this['channels'][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x33')]];delete this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x33')]];}else if(this[_0xdadd('0x10')][this['blindTransfers'][_0x283f21['linkedid']][_0xdadd('0x34')]]){this[_0xdadd('0x10')][this['blindTransfers'][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x34')]][_0xdadd('0x34')]=[this['channels'][this[_0xdadd('0x12')][_0x283f21['linkedid']][_0xdadd('0x34')]][_0xdadd('0x33')],this[_0xdadd('0x10')][this['blindTransfers'][_0x283f21[_0xdadd('0x33')]]['uniqueid']][_0xdadd('0x33')]=this['channels'][this['blindTransfers'][_0x283f21[_0xdadd('0x33')]]['uniqueid']][_0xdadd('0x34')]][0x0];this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x34')]][_0xdadd('0x5d')]=this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x5d')];this['channels'][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x34')]][_0xdadd('0x5e')]=this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x5e')];this['channels'][this['blindTransfers'][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x34')]]['destinationchannel']=this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]]['uniqueid']][_0xdadd('0x39')];this['channels'][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x34')]]['disposition']=this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x4b')];this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]]=this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21['linkedid']]['uniqueid']];delete this[_0xdadd('0x10')][this[_0xdadd('0x12')][_0x283f21[_0xdadd('0x33')]][_0xdadd('0x34')]];}}if(this[_0xdadd('0x10')][_0x283f21['uniqueid']]){logger[_0xdadd('0x26')](_0xdadd('0x8e'),_0x283f21[_0xdadd('0x34')],_0x283f21['cause-txt']);var _0x12fcca=moment();this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]]['endtime']=_0x12fcca['format'](_0xdadd('0x4a'));this['channels'][_0x283f21[_0xdadd('0x34')]]['duration']=_0x12fcca['diff'](this[_0xdadd('0x10')][_0x283f21['uniqueid']][_0xdadd('0x49')],_0xdadd('0x56'));if(this['channels'][_0x283f21['uniqueid']][_0xdadd('0x5d')]){this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x8f')]=_0x12fcca['diff'](this[_0xdadd('0x10')][_0x283f21['uniqueid']]['answertime'],_0xdadd('0x56'));this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x5f')]=this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x54')]-this[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]]['billableseconds'];}if(_0x283f21[_0xdadd('0x48')]==='from-sip'){if(this['agents'][_0x283f21[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]){this[_0xdadd('0x11')][_0x283f21[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]=_['omit'](this[_0xdadd('0x11')][_0x283f21[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]],[_0xdadd('0x3d')]);logger[_0xdadd('0x31')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x283f21[_0xdadd('0x34')],util[_0xdadd('0x45')]({'id':this['agents'][_0x283f21[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x283f21[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x43')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xdadd('0x3f')]('user:%s',this[_0xdadd('0x11')][_0x283f21[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]][_0xdadd('0x41')]),_0xdadd('0x90'),{'id':this['agents'][_0x283f21[_0xdadd('0x39')][_0xdadd('0x3a')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x283f21[_0xdadd('0x39')]['split']('-')[0x0]]['accountcode']});for(var _0x3af1c4=0x0;_0x3af1c4<Object[_0xdadd('0x37')](this['agents'])[_0xdadd('0x91')];_0x3af1c4++){var _0x526161=Object[_0xdadd('0x37')](this[_0xdadd('0x11')])[_0x3af1c4];var _0x275b56=this[_0xdadd('0x11')][_0x526161];if(_0x275b56[_0xdadd('0x43')]===Number(_0x283f21[_0xdadd('0x3e')])){this[_0xdadd('0x2d')](util[_0xdadd('0x3f')](_0xdadd('0x40'),_0x275b56[_0xdadd('0x41')]),_0xdadd('0x90'),{'id':_0x275b56['id'],'destaccountcode':_0x275b56['accountcode'],'transfer':this['channels'][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x92')]});break;}}}}var _0x2c4d04=this;Promise[_0xdadd('0x93')]()[_0xdadd('0x94')](function(){var _0x2394bd=_0x2c4d04[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]];if(typeof _0x2394bd['transferType']===_0xdadd('0x95'))return;if(_[_0xdadd('0x96')](_0x2394bd['monitors']))return;return RpcSetting[_0xdadd('0x97')]()['then'](function(_0x147ba5){if(!_0x147ba5[_0xdadd('0x98')])return;return Promise['resolve']()[_0xdadd('0x94')](function(){return ami[_0xdadd('0x99')]({'action':_0xdadd('0x9a'),'channel':_0x2394bd[_0xdadd('0x39')]})[_0xdadd('0x9b')](function(){});})[_0xdadd('0x94')](function(){return ami[_0xdadd('0x99')]({'action':_0xdadd('0x9a'),'channel':_0x2394bd['destinationchannel']})[_0xdadd('0x9b')](function(){})['finally'](function(){var _0x10820f=_0x2c4d04['agents'][_0x2394bd[_0xdadd('0x61')]['split']('-')[0x0]];if(!_0x10820f)return;io[_0xdadd('0x2d')](_0xdadd('0x9c'),{'agentId':_0x10820f['id'],'uniqueid':_0x2394bd['uniqueid']});});});});})['then'](function(){if(_0x283f21['event']===_0xdadd('0x9d')){_0x2c4d04[_0xdadd('0x12')][_0x283f21['uniqueid']]=_0x283f21;}else{if(_0x2c4d04[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]]['type']==='outbound'&&_0x2c4d04[_0xdadd('0x12')][_0x283f21['uniqueid']]){_0x2c4d04['channels'][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x34')]=[_0x2c4d04[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x33')],_0x2c4d04[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]][_0xdadd('0x33')]=_0x2c4d04[_0xdadd('0x10')][_0x283f21['uniqueid']][_0xdadd('0x34')]][0x0];delete _0x2c4d04[_0xdadd('0x12')][_0x283f21['uniqueid']];}}logger[_0xdadd('0x31')](_0xdadd('0x9e'),_0x283f21[_0xdadd('0x34')],util[_0xdadd('0x45')](_0x2c4d04[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]],{'showHidden':![],'depth':null}));ami[_0xdadd('0x2d')](_0xdadd('0x9f'),_0x2c4d04[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]]);delete _0x2c4d04[_0xdadd('0x10')][_0x283f21[_0xdadd('0x34')]];});}}}catch(_0x8651ee){logger[_0xdadd('0x29')](_0xdadd('0xa0'),_0x283f21['uniqueid'],util['inspect'](_0x8651ee,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0xb9b481){try{if(this[_0xdadd('0x2b')](_0xb9b481)){logger[_0xdadd('0x26')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0xb9b481[_0xdadd('0x34')],_0xb9b481[_0xdadd('0xa1')],_0xb9b481[_0xdadd('0xa2')]);logger[_0xdadd('0x31')](_0xdadd('0xa3'),_0xb9b481[_0xdadd('0x34')],util[_0xdadd('0x45')](_0xb9b481,{'showHidden':![],'depth':null}));var _0x459327;if(this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa4')]]){this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa4')]]['transfercalleridnum']=_0xb9b481[_0xdadd('0xa1')];this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa4')]][_0xdadd('0xa5')]=_0xb9b481[_0xdadd('0xa2')];if(this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa6')]]){_0x459327=this['channels'][_0xb9b481[_0xdadd('0xa6')]];this[_0xdadd('0x10')][_0xb9b481['secondtransfereruniqueid']]=this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa4')]];this[_0xdadd('0x10')][_0xb9b481['transfereeuniqueid']]=_0x459327;}this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa6')]][_0xdadd('0x92')]='ATTENDED';}else if(this['channels'][_0xb9b481['transfertargetuniqueid']]){this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa7')]]['transfercalleridnum']=_0xb9b481[_0xdadd('0xa1')];this['channels'][_0xb9b481[_0xdadd('0xa7')]][_0xdadd('0xa5')]=_0xb9b481[_0xdadd('0xa2')];if(this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa8')]]){_0x459327=this['channels'][_0xb9b481[_0xdadd('0xa8')]];this[_0xdadd('0x10')][_0xb9b481['origtransfereruniqueid']]=this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa7')]];this[_0xdadd('0x10')][_0xb9b481['transfertargetuniqueid']]=_0x459327;}this['channels'][_0xb9b481[_0xdadd('0xa7')]]['transferType']=_0xdadd('0xa9');}if((this[_0xdadd('0x10')][_0xb9b481['origtransfereruniqueid']]||this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xaa')]])&&this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa6')]]){var _0x394d71=_[_0xdadd('0xab')]([this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa8')]],this[_0xdadd('0x10')][_0xb9b481['origtransfererlinkedid']],this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa6')]]],function(_0xb7c8ec){return _0xb7c8ec&&_0xb7c8ec[_0xdadd('0x5a')]===_0xdadd('0xac')&&_0xb7c8ec[_0xdadd('0xad')];});if(_0x394d71){if(this[_0xdadd('0x10')][_0xb9b481['origtransfereruniqueid']])this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xa8')]][_0xdadd('0x92')]=_0xdadd('0xa9');if(this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xaa')]])this[_0xdadd('0x10')][_0xb9b481[_0xdadd('0xaa')]][_0xdadd('0x92')]=_0xdadd('0xa9');this['channels'][_0xb9b481[_0xdadd('0xa6')]]['transferType']='ATTENDED';}}}}catch(_0x50101f){logger[_0xdadd('0x29')](_0xdadd('0xae'),_0xb9b481['uniqueid'],util[_0xdadd('0x45')](_0x50101f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdadd('0x2a')][_0xdadd('0x21')]=function(_0x2fde1d){try{if(this[_0xdadd('0x2b')](_0x2fde1d)){logger['info'](_0xdadd('0xaf'),_0x2fde1d[_0xdadd('0x34')],_0x2fde1d[_0xdadd('0xb0')],_0x2fde1d[_0xdadd('0xb1')]);logger[_0xdadd('0x31')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x2fde1d[_0xdadd('0x34')],util['inspect'](_0x2fde1d,{'showHidden':![],'depth':null}));if(this[_0xdadd('0x10')][_0x2fde1d['transfereeuniqueid']]){this[_0xdadd('0x10')][_0x2fde1d[_0xdadd('0xa4')]][_0xdadd('0xb2')]=_0x2fde1d[_0xdadd('0xb0')];this[_0xdadd('0x10')][_0x2fde1d[_0xdadd('0xa4')]][_0xdadd('0xa5')]=_0x2fde1d[_0xdadd('0xb1')];this[_0xdadd('0x10')][_0x2fde1d[_0xdadd('0xa4')]]['transferType']=_0xdadd('0xb3');this[_0xdadd('0x1c')]({'event':_0xdadd('0x9d'),'uniqueid':_0x2fde1d[_0xdadd('0xa4')],'linkedid':_0x2fde1d['transfereruniqueid'],'context':_0x2fde1d[_0xdadd('0x48')],'channel':_0x2fde1d[_0xdadd('0xb4')]});}else{this[_0xdadd('0x10')][_0x2fde1d[_0xdadd('0xb5')]]['transferType']=_0xdadd('0xb3');this[_0xdadd('0x1c')]({'event':'BlindTransfer','uniqueid':_0x2fde1d[_0xdadd('0xb5')],'linkedid':_0x2fde1d[_0xdadd('0xa4')],'context':_0x2fde1d[_0xdadd('0x48')],'channel':_0x2fde1d[_0xdadd('0xb4')]});}}}catch(_0x23b860){logger['error'](_0xdadd('0xb6'),_0x2fde1d[_0xdadd('0x34')],util[_0xdadd('0x45')](_0x23b860,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xdadd('0x23')]=function(_0x3e2c4c){try{if(this[_0xdadd('0x2b')](_0x3e2c4c)){logger['debug']('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x3e2c4c['uniqueid'],util[_0xdadd('0x45')](_0x3e2c4c,{'showHidden':![],'depth':null}));if(this['channels'][_0x3e2c4c['uniqueid']]){if(!_[_0xdadd('0x5b')](this[_0xdadd('0x10')][_0x3e2c4c[_0xdadd('0x34')]]['answertime'])){this[_0xdadd('0x10')][_0x3e2c4c[_0xdadd('0x34')]][_0xdadd('0xb7')]=moment()[_0xdadd('0x3f')](_0xdadd('0x4a'));logger[_0xdadd('0x26')](_0xdadd('0xb8'),_0x3e2c4c['uniqueid'],this['channels'][_0x3e2c4c[_0xdadd('0x34')]][_0xdadd('0xb7')]);}}}}catch(_0x197d0d){logger[_0xdadd('0x29')](_0xdadd('0xb9'),_0x3e2c4c[_0xdadd('0x34')],util['inspect'](_0x197d0d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdadd('0x2a')][_0xdadd('0x25')]=function(_0x3461fe){try{if(this['isNotNull'](_0x3461fe)){logger[_0xdadd('0x31')](_0xdadd('0xba'),_0x3461fe[_0xdadd('0x34')],util['inspect'](_0x3461fe,{'showHidden':![],'depth':null}));if(this['channels'][_0x3461fe[_0xdadd('0x34')]]){if(!_[_0xdadd('0x5b')](this[_0xdadd('0x10')][_0x3461fe[_0xdadd('0x34')]][_0xdadd('0xb7')])){this[_0xdadd('0x10')][_0x3461fe[_0xdadd('0x34')]]['mohtime']+=moment()[_0xdadd('0xbb')](0x0)[_0xdadd('0x60')](this[_0xdadd('0x10')][_0x3461fe[_0xdadd('0x34')]][_0xdadd('0xb7')],_0xdadd('0x56'));logger[_0xdadd('0x26')](_0xdadd('0xbc'),_0x3461fe[_0xdadd('0x34')],this[_0xdadd('0x10')][_0x3461fe[_0xdadd('0x34')]][_0xdadd('0xbd')]);delete this[_0xdadd('0x10')][_0x3461fe['uniqueid']][_0xdadd('0xb7')];}}}}catch(_0x1cb80f){logger[_0xdadd('0x29')](_0xdadd('0xbe'),_0x3461fe['uniqueid'],util[_0xdadd('0x45')](_0x1cb80f,{'showHidden':![],'depth':null}));}};module[_0xdadd('0xbf')]=VoiceCallReport;
\ No newline at end of file
index 589a263..537b371 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90b1=['called','channel','substring','lastIndexOf','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','inspect','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','YYYY-MM-DD\x20HH:mm:ss','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','voice:outbound','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','outboundrouteid','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','answertime','answered','holdtime','billableseconds','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','appdata','applicationdata','startsWith','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','../../../config/logger','ami','../ami','redis','channels','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','format'];(function(_0x27bed4,_0xf17e71){var _0x412e9d=function(_0x2c4eb4){while(--_0x2c4eb4){_0x27bed4['push'](_0x27bed4['shift']());}};_0x412e9d(++_0xf17e71);}(_0x90b1,0x1bb));var _0x190b=function(_0x64fa5d,_0x4ba48d){_0x64fa5d=_0x64fa5d-0x0;var _0x39618c=_0x90b1[_0x64fa5d];return _0x39618c;};'use strict';var _=require(_0x190b('0x0'));var moment=require(_0x190b('0x1'));var util=require(_0x190b('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x190b('0x3'))(_0x190b('0x4'));var ami=require(_0x190b('0x5'));config[_0x190b('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x190b('0x6')]));function VoiceDialReport(_0x34a689){this[_0x190b('0x7')]=_0x34a689[_0x190b('0x8')];this[_0x190b('0x9')]=_0x34a689[_0x190b('0x9')];this[_0x190b('0xa')]={};this['variables']={};ami['on'](_0x190b('0xb'),this[_0x190b('0xc')][_0x190b('0xd')](this));ami['on'](_0x190b('0xe'),this[_0x190b('0xf')][_0x190b('0xd')](this));ami['on'](_0x190b('0x10'),this[_0x190b('0x11')]['bind'](this));ami['on'](_0x190b('0x12'),this[_0x190b('0x13')]['bind'](this));}VoiceDialReport[_0x190b('0x14')][_0x190b('0x15')]=function(_0x286c81){return _0x286c81!==null&&!_[_0x190b('0x16')](_0x286c81);};VoiceDialReport[_0x190b('0x14')][_0x190b('0x17')]=function(_0x2e12d4,_0x13544c,_0x1ff180){io['to'](_0x2e12d4)[_0x190b('0x17')](_0x13544c,_0x1ff180);};VoiceDialReport[_0x190b('0x14')][_0x190b('0xc')]=function(_0xab346){try{if(this[_0x190b('0x15')](_0xab346)){logger[_0x190b('0x18')](_0x190b('0x19'),_0xab346[_0x190b('0x1a')],util['inspect'](_0xab346,{'showHidden':![],'depth':null}));if(this[_0x190b('0x7')][_0xab346['uniqueid']]){_[_0x190b('0x1b')](this[_0x190b('0x7')][_0xab346[_0x190b('0x1a')]],{'starttime':moment()[_0x190b('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x190b('0x1d'),'interface':_0xab346[_0x190b('0x1e')][_0x190b('0x1f')](0x0,_0xab346[_0x190b('0x1e')][_0x190b('0x20')]('-')),'membername':_0xab346[_0x190b('0x1e')]['substring'](_0xab346[_0x190b('0x1e')][_0x190b('0x20')]('/')+0x1,_0xab346['channel'][_0x190b('0x20')]('-'))},_['omit'](_0xab346,['event',_0x190b('0x21')]));logger[_0x190b('0x22')](_0x190b('0x23'),_0xab346['uniqueid'],this[_0x190b('0x7')][_0xab346[_0x190b('0x1a')]][_0x190b('0x24')],this[_0x190b('0x7')][_0xab346[_0x190b('0x1a')]][_0x190b('0x25')]);logger[_0x190b('0x18')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0xab346['uniqueid'],util[_0x190b('0x26')](this[_0x190b('0x7')][_0xab346['uniqueid']],{'showHidden':![],'depth':null}));if(this['applications'][_0xab346[_0x190b('0x1a')]])_['merge'](this[_0x190b('0x7')][_0xab346[_0x190b('0x1a')]],this['applications'][_0xab346[_0x190b('0x1a')]]);this[_0x190b('0x17')]('voice:outbound',_0x190b('0x27'),this[_0x190b('0x7')][_0xab346[_0x190b('0x1a')]]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0xab346[_0x190b('0x1a')],util['inspect'](this[_0x190b('0x7')][_0xab346[_0x190b('0x1a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x190b('0x28'),this['channels'][_0xab346[_0x190b('0x1a')]]);}}}catch(_0x4ff5a6){logger[_0x190b('0x29')]('[%s][voiceDialReport][dialbegin]',_0xab346[_0x190b('0x1a')],util[_0x190b('0x26')](_0x4ff5a6,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x190b('0xf')]=function(_0x15fed4){try{if(this[_0x190b('0x15')](_0x15fed4)){logger[_0x190b('0x18')](_0x190b('0x2a'),_0x15fed4[_0x190b('0x1a')],util[_0x190b('0x26')](_0x15fed4,{'showHidden':![],'depth':null}));if(this[_0x190b('0x7')][_0x15fed4['uniqueid']]){this['channels'][_0x15fed4[_0x190b('0x1a')]][_0x190b('0x2b')]=_0x15fed4['dialstatus'];if(_0x15fed4[_0x190b('0x2b')]===_0x190b('0x2c')){this[_0x190b('0x7')][_0x15fed4[_0x190b('0x1a')]][_0x190b('0x2d')]=_0x15fed4[_0x190b('0x2d')];this[_0x190b('0x7')][_0x15fed4['uniqueid']]['connectedlinename']=_0x15fed4[_0x190b('0x2e')];this[_0x190b('0x7')][_0x15fed4[_0x190b('0x1a')]]['answertime']=moment()[_0x190b('0x1c')](_0x190b('0x2f'));this[_0x190b('0x7')][_0x15fed4['uniqueid']][_0x190b('0x30')]='connect';logger['info'](_0x190b('0x31'),_0x15fed4[_0x190b('0x1a')],_0x15fed4['channel'][_0x190b('0x1f')](_0x15fed4[_0x190b('0x1e')][_0x190b('0x20')]('/')+0x1,_0x15fed4['channel'][_0x190b('0x20')]('-')));logger[_0x190b('0x18')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x15fed4['uniqueid'],util[_0x190b('0x26')](this['channels'][_0x15fed4[_0x190b('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x190b('0x17')](_0x190b('0x32'),this[_0x190b('0x7')][_0x15fed4['uniqueid']]);}logger[_0x190b('0x18')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x15fed4[_0x190b('0x1a')],util[_0x190b('0x26')](this['channels'][_0x15fed4[_0x190b('0x1a')]],{'showHidden':![],'depth':null}));this[_0x190b('0x17')](_0x190b('0x33'),'voice_outbound_channel:save',this[_0x190b('0x7')][_0x15fed4['uniqueid']]);}}}catch(_0x550717){logger['error'](_0x190b('0x34'),_0x15fed4[_0x190b('0x1a')],util[_0x190b('0x26')](_0x550717,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x190b('0x14')]['syncVarSet']=function(_0x50729e){try{if(this[_0x190b('0x15')](_0x50729e)){logger['debug'](_0x190b('0x35'),_0x50729e[_0x190b('0x1a')],util['inspect'](_0x50729e,{'showHidden':![],'depth':null}));this[_0x190b('0x36')](_0x50729e[_0x190b('0x1a')],_[_0x190b('0x37')](_0x50729e['variable'])[0x0],_0x50729e[_0x190b('0x38')]);if(this[_0x190b('0x15')](_0x50729e['variable'])&&this[_0x190b('0x15')](_0x50729e['variable'][_0x190b('0x39')])){if(_[_0x190b('0x16')](this[_0x190b('0x7')][_0x50729e['uniqueid']])){this[_0x190b('0x7')][_0x50729e['uniqueid']]={'routeId':_0x50729e[_0x190b('0x38')],'variables':this[_0x190b('0x3a')][_0x50729e[_0x190b('0x1a')]],'motionChannel':_0x190b('0x3b')};logger[_0x190b('0x22')](_0x190b('0x3c'),_0x50729e[_0x190b('0x1a')],_0x50729e['variable'][_0x190b('0x39')],_[_0x190b('0x37')](_0x50729e[_0x190b('0x3d')])[0x0],_0x50729e['value']);logger[_0x190b('0x18')](_0x190b('0x3e'),_0x50729e[_0x190b('0x1a')],util[_0x190b('0x26')](this[_0x190b('0x7')][_0x50729e['uniqueid']],{'showHidden':![],'depth':null}));this[_0x190b('0x17')](_0x190b('0x33'),_0x190b('0x27'),this['channels'][_0x50729e[_0x190b('0x1a')]]);}}}}catch(_0x27591f){logger[_0x190b('0x29')]('[%s][voiceDialReport][varset]',_0x50729e['uniqueid'],util[_0x190b('0x26')](_0x27591f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x190b('0x14')][_0x190b('0x36')]=function(_0x9ade30,_0x3f5df3,_0x10aaeb){var _0x49654b=[_0x190b('0x3f'),_0x190b('0x40'),_0x190b('0x41'),'rtpaudioqosjitterbridged',_0x190b('0x42'),_0x190b('0x43'),_0x190b('0x44'),'rtpaudioqosrttbridged',_0x190b('0x45'),_0x190b('0x46'),_0x190b('0x47'),_0x190b('0x48'),_0x190b('0x49'),_0x190b('0x4a'),_0x190b('0x4b'),_0x190b('0x4c'),_0x190b('0x24'),_0x190b('0x4d'),_0x190b('0x4e')];if(!_['isNil'](_0x3f5df3)&&!_[_0x190b('0x4f')](_0x49654b,_0x3f5df3)){if(_['isUndefined'](this[_0x190b('0x3a')][_0x9ade30])){this[_0x190b('0x3a')][_0x9ade30]={};}this['variables'][_0x9ade30][_0x3f5df3]=_0x10aaeb;}};VoiceDialReport[_0x190b('0x14')][_0x190b('0x13')]=function(_0x306a4f){try{if(this[_0x190b('0x15')](_0x306a4f)){logger[_0x190b('0x18')](_0x190b('0x50'),_0x306a4f[_0x190b('0x1a')],util[_0x190b('0x26')](_0x306a4f,{'showHidden':![],'depth':null}));if(this['channels'][_0x306a4f[_0x190b('0x1a')]]){logger[_0x190b('0x22')](_0x190b('0x51'),_0x306a4f['uniqueid'],_0x306a4f[_0x190b('0x52')]);this['channels'][_0x306a4f['uniqueid']][_0x190b('0x53')]=moment()[_0x190b('0x1c')](_0x190b('0x2f'));this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x54')]=moment(this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x53')])[_0x190b('0x55')](this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x56')],_0x190b('0x57'));this['channels'][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x30')]=_0x190b('0x58');this[_0x190b('0x9')]['total']+=0x1;if(this['channels'][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x59')]){this['outbound'][_0x190b('0x5a')]+=0x1;this['channels'][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x5b')]=moment(this[_0x190b('0x7')][_0x306a4f['uniqueid']][_0x190b('0x59')])[_0x190b('0x55')](this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x56')],_0x190b('0x57'));this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x5c')]=moment(this['channels'][_0x306a4f['uniqueid']][_0x190b('0x53')])[_0x190b('0x55')](this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]]['answertime'],_0x190b('0x57'));this[_0x190b('0x9')]['sumHoldTime']+=this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x5b')]||0x0;this[_0x190b('0x9')][_0x190b('0x5d')]+=this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]][_0x190b('0x5c')];}this['outbound'][_0x190b('0x5e')]+=this['channels'][_0x306a4f['uniqueid']][_0x190b('0x54')];logger[_0x190b('0x18')](_0x190b('0x5f'),_0x306a4f['uniqueid'],util['inspect'](this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x190b('0x17')](_0x190b('0x60'),this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]]);logger[_0x190b('0x18')](_0x190b('0x61'),_0x306a4f['uniqueid'],util[_0x190b('0x26')](this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x190b('0x17')](_0x190b('0x62'),this['channels'][_0x306a4f[_0x190b('0x1a')]]);logger[_0x190b('0x18')](_0x190b('0x63'),_0x306a4f['uniqueid'],util[_0x190b('0x26')](this[_0x190b('0x7')][_0x306a4f[_0x190b('0x1a')]],{'showHidden':![],'depth':null}));this[_0x190b('0x17')]('voice:outbound',_0x190b('0x64'),this[_0x190b('0x9')]);logger[_0x190b('0x22')](_0x190b('0x65'),JSON['stringify'](this[_0x190b('0x7')][_0x306a4f['uniqueid']]));logger[_0x190b('0x18')](_0x190b('0x66'),_0x306a4f[_0x190b('0x1a')],util[_0x190b('0x26')](this['channels'][_0x306a4f[_0x190b('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0x190b('0x33'),'voice_outbound_channel:remove',this['channels'][_0x306a4f[_0x190b('0x1a')]]);delete this['channels'][_0x306a4f[_0x190b('0x1a')]];}else if(this[_0x190b('0x7')][_0x306a4f[_0x190b('0x67')]]){this[_0x190b('0x7')][_0x306a4f[_0x190b('0x67')]]['uniqueid']=this[_0x190b('0x7')][_0x306a4f[_0x190b('0x67')]][_0x190b('0x68')];}if(this['variables'][_0x306a4f[_0x190b('0x1a')]]){delete this[_0x190b('0x3a')][_0x306a4f['uniqueid']];}}}catch(_0x3b1835){logger[_0x190b('0x29')](_0x190b('0x69'),_0x306a4f['uniqueid'],util[_0x190b('0x26')](_0x3b1835,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x190b('0x14')][_0x190b('0x6a')]=function(_0x36d258){try{if(this['isNotNull'](_0x36d258)){logger[_0x190b('0x18')](_0x190b('0x6b'),_0x36d258[_0x190b('0x1a')],util['inspect'](_0x36d258,{'showHidden':![],'depth':null}));if(_0x36d258[_0x190b('0x6c')][_0x190b('0x6d')]()===_0x190b('0x6e')){_0x36d258['applicationdata']=(_0x36d258[_0x190b('0x6f')]||_0x36d258[_0x190b('0x70')])[_0x190b('0x6d')]();if(_[_0x190b('0x71')](_0x36d258[_0x190b('0x70')],'cdr(')){if(_['isUndefined'](this[_0x190b('0xa')][_0x36d258[_0x190b('0x1a')]]))this['applications'][_0x36d258[_0x190b('0x1a')]]={};logger[_0x190b('0x22')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x36d258['uniqueid'],_0x36d258[_0x190b('0x6c')],_0x36d258[_0x190b('0x70')]);var _0x4f1935=_0x36d258['applicationdata'][_0x190b('0x72')]('=');var _0x454402=_0x4f1935[0x0][_0x190b('0x73')](/cdr\((.*)\)/);if(_0x454402)this[_0x190b('0xa')][_0x36d258[_0x190b('0x1a')]][_0x454402[0x1]]=_0x4f1935[0x1];}}}}catch(_0x47c9c6){logger['error'](_0x190b('0x74'),_0x36d258['uniqueid'],util[_0x190b('0x26')](_0x47c9c6,{'showHidden':![],'depth':null}));}};module[_0x190b('0x75')]=VoiceDialReport;
\ No newline at end of file
+var _0xe14b=['total','answered','holdtime','answertime','billableseconds','endtime','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','application','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','variables','dialbegin','syncDialBegin','bind','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','uniqueid','inspect','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','info','membername','applications','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','ANSWER','connectedlinenum','connectedlinename','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','format','duration','diff','starttime','seconds','complete','outbound'];(function(_0x34c9f2,_0x28b272){var _0x14b3fc=function(_0x1fbcf2){while(--_0x1fbcf2){_0x34c9f2['push'](_0x34c9f2['shift']());}};_0x14b3fc(++_0x28b272);}(_0xe14b,0x93));var _0xbe14=function(_0x526e4b,_0x3c1bcb){_0x526e4b=_0x526e4b-0x0;var _0x189c6f=_0xe14b[_0x526e4b];return _0x189c6f;};'use strict';var _=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xbe14('0x2'));var logger=require(_0xbe14('0x3'))('ami');var ami=require(_0xbe14('0x4'));config['redis']=_['defaults'](config[_0xbe14('0x5')],{'host':_0xbe14('0x6'),'port':0x18eb});var io=require(_0xbe14('0x7'))(new Redis(config[_0xbe14('0x5')]));function VoiceDialReport(_0x1d9ade){this[_0xbe14('0x8')]=_0x1d9ade[_0xbe14('0x9')];this['outbound']=_0x1d9ade['outbound'];this['applications']={};this[_0xbe14('0xa')]={};ami['on'](_0xbe14('0xb'),this[_0xbe14('0xc')][_0xbe14('0xd')](this));ami['on']('dialend',this['syncDialEnd'][_0xbe14('0xd')](this));ami['on'](_0xbe14('0xe'),this['syncVarSet'][_0xbe14('0xd')](this));ami['on'](_0xbe14('0xf'),this[_0xbe14('0x10')][_0xbe14('0xd')](this));}VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x12')]=function(_0x23a730){return _0x23a730!==null&&!_[_0xbe14('0x13')](_0x23a730);};VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x14')]=function(_0x1e4826,_0x33fd54,_0x813399){io['to'](_0x1e4826)['emit'](_0x33fd54,_0x813399);};VoiceDialReport['prototype'][_0xbe14('0xc')]=function(_0x3dc4a9){try{if(this[_0xbe14('0x12')](_0x3dc4a9)){logger[_0xbe14('0x15')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x3dc4a9[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x3dc4a9,{'showHidden':![],'depth':null}));if(this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]]){_[_0xbe14('0x18')](this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]],{'starttime':moment()['format'](_0xbe14('0x19')),'lastevent':_0xbe14('0x1a'),'interface':_0x3dc4a9[_0xbe14('0x1b')][_0xbe14('0x1c')](0x0,_0x3dc4a9[_0xbe14('0x1b')][_0xbe14('0x1d')]('-')),'membername':_0x3dc4a9['channel'][_0xbe14('0x1c')](_0x3dc4a9[_0xbe14('0x1b')][_0xbe14('0x1d')]('/')+0x1,_0x3dc4a9[_0xbe14('0x1b')][_0xbe14('0x1d')]('-'))},_['omit'](_0x3dc4a9,[_0xbe14('0x1e'),'privilege']));logger[_0xbe14('0x1f')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x3dc4a9[_0xbe14('0x16')],this['channels'][_0x3dc4a9[_0xbe14('0x16')]][_0xbe14('0x20')],this['channels'][_0x3dc4a9[_0xbe14('0x16')]]['interface']);logger[_0xbe14('0x15')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3dc4a9[_0xbe14('0x16')],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));if(this[_0xbe14('0x21')][_0x3dc4a9[_0xbe14('0x16')]])_['merge'](this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]],this[_0xbe14('0x21')][_0x3dc4a9[_0xbe14('0x16')]]);this['emit'](_0xbe14('0x22'),_0xbe14('0x23'),this['channels'][_0x3dc4a9[_0xbe14('0x16')]]);logger[_0xbe14('0x15')](_0xbe14('0x24'),_0x3dc4a9[_0xbe14('0x16')],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));ami[_0xbe14('0x14')](_0xbe14('0x25'),this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]]);}}}catch(_0x3bf43c){logger[_0xbe14('0x26')](_0xbe14('0x27'),_0x3dc4a9[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x3bf43c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x28')]=function(_0x29e76a){try{if(this[_0xbe14('0x12')](_0x29e76a)){logger['debug'](_0xbe14('0x29'),_0x29e76a['uniqueid'],util['inspect'](_0x29e76a,{'showHidden':![],'depth':null}));if(this[_0xbe14('0x8')][_0x29e76a['uniqueid']]){this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]]['dialstatus']=_0x29e76a['dialstatus'];if(_0x29e76a['dialstatus']===_0xbe14('0x2a')){this[_0xbe14('0x8')][_0x29e76a['uniqueid']][_0xbe14('0x2b')]=_0x29e76a[_0xbe14('0x2b')];this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]][_0xbe14('0x2c')]=_0x29e76a['connectedlinename'];this['channels'][_0x29e76a[_0xbe14('0x16')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]][_0xbe14('0x2d')]=_0xbe14('0x2e');logger[_0xbe14('0x1f')](_0xbe14('0x2f'),_0x29e76a[_0xbe14('0x16')],_0x29e76a[_0xbe14('0x1b')][_0xbe14('0x1c')](_0x29e76a[_0xbe14('0x1b')][_0xbe14('0x1d')]('/')+0x1,_0x29e76a[_0xbe14('0x1b')]['lastIndexOf']('-')));logger['debug'](_0xbe14('0x30'),_0x29e76a[_0xbe14('0x16')],util[_0xbe14('0x17')](this['channels'][_0x29e76a[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));ami[_0xbe14('0x14')](_0xbe14('0x31'),this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]]);}logger[_0xbe14('0x15')](_0xbe14('0x32'),_0x29e76a[_0xbe14('0x16')],util[_0xbe14('0x17')](this['channels'][_0x29e76a[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));this[_0xbe14('0x14')](_0xbe14('0x22'),_0xbe14('0x23'),this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]]);}}}catch(_0x548d17){logger[_0xbe14('0x26')](_0xbe14('0x33'),_0x29e76a[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x548d17,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x38611d){try{if(this[_0xbe14('0x12')](_0x38611d)){logger[_0xbe14('0x15')]('[%s][voiceDialReport][varset]\x20event:',_0x38611d['uniqueid'],util[_0xbe14('0x17')](_0x38611d,{'showHidden':![],'depth':null}));this['addVariable'](_0x38611d['uniqueid'],_[_0xbe14('0x34')](_0x38611d[_0xbe14('0x35')])[0x0],_0x38611d[_0xbe14('0x36')]);if(this['isNotNull'](_0x38611d['variable'])&&this['isNotNull'](_0x38611d[_0xbe14('0x35')][_0xbe14('0x37')])){if(_[_0xbe14('0x13')](this['channels'][_0x38611d[_0xbe14('0x16')]])){this[_0xbe14('0x8')][_0x38611d[_0xbe14('0x16')]]={'routeId':_0x38611d[_0xbe14('0x36')],'variables':this['variables'][_0x38611d['uniqueid']],'motionChannel':_0xbe14('0x38')};logger[_0xbe14('0x1f')](_0xbe14('0x39'),_0x38611d[_0xbe14('0x16')],_0x38611d[_0xbe14('0x35')]['outboundrouteid'],_['keys'](_0x38611d[_0xbe14('0x35')])[0x0],_0x38611d[_0xbe14('0x36')]);logger[_0xbe14('0x15')](_0xbe14('0x3a'),_0x38611d['uniqueid'],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x38611d['uniqueid']],{'showHidden':![],'depth':null}));this[_0xbe14('0x14')](_0xbe14('0x22'),_0xbe14('0x23'),this[_0xbe14('0x8')][_0x38611d['uniqueid']]);}}}}catch(_0x594f65){logger[_0xbe14('0x26')](_0xbe14('0x3b'),_0x38611d['uniqueid'],util['inspect'](_0x594f65,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x3c')]=function(_0x3f7f5b,_0x1a8a3d,_0xdbc6e1){var _0xd04fd5=[_0xbe14('0x3d'),'rtpaudioqosbridged',_0xbe14('0x3e'),_0xbe14('0x3f'),_0xbe14('0x40'),_0xbe14('0x41'),_0xbe14('0x42'),'rtpaudioqosrttbridged',_0xbe14('0x43'),_0xbe14('0x44'),_0xbe14('0x45'),_0xbe14('0x46'),_0xbe14('0x47'),_0xbe14('0x48'),'memberinterface','memberlastcall',_0xbe14('0x20'),_0xbe14('0x49'),_0xbe14('0x4a')];if(!_['isNil'](_0x1a8a3d)&&!_['includes'](_0xd04fd5,_0x1a8a3d)){if(_[_0xbe14('0x13')](this[_0xbe14('0xa')][_0x3f7f5b])){this['variables'][_0x3f7f5b]={};}this[_0xbe14('0xa')][_0x3f7f5b][_0x1a8a3d]=_0xdbc6e1;}};VoiceDialReport[_0xbe14('0x11')]['syncHangup']=function(_0x28f995){try{if(this['isNotNull'](_0x28f995)){logger[_0xbe14('0x15')](_0xbe14('0x4b'),_0x28f995[_0xbe14('0x16')],util['inspect'](_0x28f995,{'showHidden':![],'depth':null}));if(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]){logger['info'](_0xbe14('0x4c'),_0x28f995[_0xbe14('0x16')],_0x28f995[_0xbe14('0x4d')]);this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]['endtime']=moment()[_0xbe14('0x4e')](_0xbe14('0x19'));this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x4f')]=moment(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]['endtime'])[_0xbe14('0x50')](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x51')],_0xbe14('0x52'));this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x2d')]=_0xbe14('0x53');this[_0xbe14('0x54')][_0xbe14('0x55')]+=0x1;if(this['channels'][_0x28f995['uniqueid']]['answertime']){this[_0xbe14('0x54')][_0xbe14('0x56')]+=0x1;this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x57')]=moment(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x58')])[_0xbe14('0x50')](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x51')],_0xbe14('0x52'));this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x59')]=moment(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x5a')])[_0xbe14('0x50')](this['channels'][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x58')],_0xbe14('0x52'));this[_0xbe14('0x54')][_0xbe14('0x5b')]+=this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x57')]||0x0;this[_0xbe14('0x54')][_0xbe14('0x5c')]+=this['channels'][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x59')];}this[_0xbe14('0x54')][_0xbe14('0x5d')]+=this[_0xbe14('0x8')][_0x28f995['uniqueid']][_0xbe14('0x4f')];logger[_0xbe14('0x15')](_0xbe14('0x5e'),_0x28f995[_0xbe14('0x16')],util[_0xbe14('0x17')](this['channels'][_0x28f995[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));ami[_0xbe14('0x14')](_0xbe14('0x5f'),this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]);logger[_0xbe14('0x15')](_0xbe14('0x60'),_0x28f995[_0xbe14('0x16')],util['inspect'](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));ami[_0xbe14('0x14')](_0xbe14('0x61'),this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]);logger[_0xbe14('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x28f995['uniqueid'],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));this[_0xbe14('0x14')](_0xbe14('0x22'),_0xbe14('0x62'),this[_0xbe14('0x54')]);logger[_0xbe14('0x1f')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON['stringify'](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]));logger[_0xbe14('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x28f995[_0xbe14('0x16')],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));this[_0xbe14('0x14')](_0xbe14('0x22'),_0xbe14('0x63'),this['channels'][_0x28f995[_0xbe14('0x16')]]);delete this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]];}else if(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x64')]]){this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x64')]]['uniqueid']=this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x64')]][_0xbe14('0x65')];}if(this[_0xbe14('0xa')][_0x28f995[_0xbe14('0x16')]]){delete this[_0xbe14('0xa')][_0x28f995[_0xbe14('0x16')]];}}}catch(_0xd756b2){logger['error'](_0xbe14('0x66'),_0x28f995[_0xbe14('0x16')],util[_0xbe14('0x17')](_0xd756b2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x67')]=function(_0x17576b){try{if(this['isNotNull'](_0x17576b)){logger[_0xbe14('0x15')](_0xbe14('0x68'),_0x17576b[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x17576b,{'showHidden':![],'depth':null}));if(_0x17576b['application'][_0xbe14('0x69')]()===_0xbe14('0x6a')){_0x17576b[_0xbe14('0x6b')]=(_0x17576b[_0xbe14('0x6c')]||_0x17576b[_0xbe14('0x6b')])[_0xbe14('0x69')]();if(_[_0xbe14('0x6d')](_0x17576b['applicationdata'],_0xbe14('0x6e'))){if(_['isUndefined'](this[_0xbe14('0x21')][_0x17576b['uniqueid']]))this[_0xbe14('0x21')][_0x17576b[_0xbe14('0x16')]]={};logger[_0xbe14('0x1f')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x17576b[_0xbe14('0x16')],_0x17576b[_0xbe14('0x6f')],_0x17576b[_0xbe14('0x6b')]);var _0x546f22=_0x17576b[_0xbe14('0x6b')][_0xbe14('0x70')]('=');var _0x1737a8=_0x546f22[0x0][_0xbe14('0x71')](/cdr\((.*)\)/);if(_0x1737a8)this['applications'][_0x17576b[_0xbe14('0x16')]][_0x1737a8[0x1]]=_0x546f22[0x1];}}}}catch(_0x39bc54){logger[_0xbe14('0x26')](_0xbe14('0x72'),_0x17576b[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x39bc54,{'showHidden':![],'depth':null}));}};module[_0xbe14('0x73')]=VoiceDialReport;
\ No newline at end of file
index b4a4cec..cd8e9fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0744=['syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','sequence','isNil','Action','No\x20such\x20channel','error','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','format','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','loggedIn','sumBillable','sumDuration','total','unmanaged','abandoned','Trunk','callerid','Interval','stringify','voice_queue:save','isNotNull','isUndefined','queues','catch','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','available','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','position','count','routealias','merge','push','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','startsWith','channel','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','transferuniqueid','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','queuestatus','CONTINUE','lastevent','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','[%s][voiceQueueReport][hangup]','sumHoldTime','diff','milliseconds','queuecallerjoinAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','BlindTransfer','mohstarttime','[%s][voiceQueueReport][musiconholdstart]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','toLowerCase','set','appdata','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','agents','channels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete'];(function(_0x543ddf,_0x2dff88){var _0x968702=function(_0x24bf0c){while(--_0x24bf0c){_0x543ddf['push'](_0x543ddf['shift']());}};_0x968702(++_0x2dff88);}(_0x0744,0x1bc));var _0x4074=function(_0x1f909a,_0x15d56f){_0x1f909a=_0x1f909a-0x0;var _0x543f16=_0x0744[_0x1f909a];return _0x543f16;};'use strict';var _=require(_0x4074('0x0'));var moment=require(_0x4074('0x1'));var util=require(_0x4074('0x2'));var md5=require(_0x4074('0x3'));var Redis=require(_0x4074('0x4'));var config=require(_0x4074('0x5'));var logger=require(_0x4074('0x6'))(_0x4074('0x7'));var ami=require(_0x4074('0x8'));var QueueReport=require(_0x4074('0x9'));config[_0x4074('0xa')]=_[_0x4074('0xb')](config[_0x4074('0xa')],{'host':_0x4074('0xc'),'port':0x18eb});var io=require(_0x4074('0xd'))(new Redis(config[_0x4074('0xa')]));var Sequence=function(){};Sequence[_0x4074('0xe')][_0x4074('0xf')]=function(_0x112bf7){this[_0x4074('0x10')]=this['tail']?this[_0x4074('0x10')][_0x4074('0x11')](_0x112bf7):_0x112bf7();};function VoiceQueueReport(_0x519d9d){this['sequence']=new Sequence();this['queueReports']={};this[_0x4074('0x12')]=_0x519d9d[_0x4074('0x12')];this[_0x4074('0x13')]=_0x519d9d['queueChannels'];this['voiceQueues']=_0x519d9d[_0x4074('0x14')];this[_0x4074('0x15')]=!![];this['campaigns']=_0x519d9d[_0x4074('0x16')];this[_0x4074('0x17')]={};ami['on'](_0x4074('0x18'),this[_0x4074('0x19')][_0x4074('0x1a')](this));ami['on'](_0x4074('0x1b'),this[_0x4074('0x1c')][_0x4074('0x1a')](this));ami['on'](_0x4074('0x1d'),this[_0x4074('0x1e')][_0x4074('0x1a')](this));ami['on'](_0x4074('0x1f'),this[_0x4074('0x20')][_0x4074('0x1a')](this));ami['on'](_0x4074('0x21'),this[_0x4074('0x22')]['bind'](this));ami['on']('agentcomplete',this[_0x4074('0x23')]['bind'](this));ami['on'](_0x4074('0x24'),this[_0x4074('0x25')][_0x4074('0x1a')](this));ami['on'](_0x4074('0x26'),this[_0x4074('0x27')][_0x4074('0x1a')](this));ami['on']('hangup',this[_0x4074('0x28')][_0x4074('0x1a')](this));ami['on'](_0x4074('0x29'),this['syncFullyBooted']['bind'](this));ami['on'](_0x4074('0x2a'),this[_0x4074('0x2b')][_0x4074('0x1a')](this));ami['on'](_0x4074('0x2c'),this[_0x4074('0x2d')][_0x4074('0x1a')](this));ami['on']('attendedtransfer',this[_0x4074('0x2e')][_0x4074('0x1a')](this));ami['on']('blindtransfer',this[_0x4074('0x2f')][_0x4074('0x1a')](this));this[_0x4074('0x30')]();this[_0x4074('0x31')]();}function clearChannels(_0x1d9e85){if(!_[_0x4074('0x32')](_0x1d9e85)){for(var _0x3ba8ce in _0x1d9e85){if(_0x1d9e85[_0x4074('0x33')](_0x3ba8ce)){delete _0x1d9e85[_0x3ba8ce];}}}}function clearCampaigns(_0x1142a1){if(!_[_0x4074('0x32')](_0x1142a1)){for(var _0x521550 in _0x1142a1){if(_0x1142a1[_0x4074('0x33')](_0x521550)){_0x1142a1[_0x521550]['originated']=0x0;}}}}function clearVoiceQueues(_0x16b99e){if(!_[_0x4074('0x32')](_0x16b99e)){for(var _0x521dfc in _0x16b99e){if(_0x16b99e[_0x4074('0x33')](_0x521dfc)){_0x16b99e[_0x521dfc][_0x4074('0x34')]=0x0;_0x16b99e[_0x521dfc][_0x4074('0x35')]=0x0;_0x16b99e[_0x521dfc][_0x4074('0x36')]=0x0;_0x16b99e[_0x521dfc][_0x4074('0x37')]=0x0;_0x16b99e[_0x521dfc][_0x4074('0x38')]=!![];}}}}function clearAgentBooked(_0x43b10e){if(!_[_0x4074('0x32')](_0x43b10e)){for(var _0x59f075 in _0x43b10e){if(_0x43b10e[_0x4074('0x33')](_0x59f075)){_0x43b10e[_0x59f075][_0x4074('0x39')]=!![];}}}}VoiceQueueReport[_0x4074('0xe')][_0x4074('0x3a')]=function(){var _0x27f1ab=this;for(var _0x422826 in this[_0x4074('0x13')]){if(this['channels'][_0x4074('0x33')](_0x422826)&&!this[_0x4074('0x13')][_0x422826][_0x4074('0x3b')]){this[_0x4074('0x3c')][_0x4074('0xf')](function(){if(!_[_0x4074('0x3d')](_0x27f1ab[_0x4074('0x13')][_0x422826])){return ami[_0x4074('0x3e')]({'action':'status','channel':_0x27f1ab[_0x4074('0x13')][_0x422826]['channel']})['catch'](function(_0xc84e7f){if(_0xc84e7f['message']===_0x4074('0x3f')){setTimeout(function(){if(_0x27f1ab['channels'][_0x422826]){delete _0x27f1ab[_0x4074('0x13')][_0x422826];logger[_0x4074('0x40')]('[%s][voiceQueueReport][checkChannel]',_0x422826,util[_0x4074('0x41')](_0xc84e7f,{'showHidden':![],'depth':null}));}if(_0x27f1ab[_0x4074('0x42')][_0x422826]){delete _0x27f1ab['queueReports'][_0x422826];logger['error'](_0x4074('0x43'),_0x422826,util[_0x4074('0x41')](_0xc84e7f,{'showHidden':![],'depth':null}));}if(_0x27f1ab[_0x4074('0x17')][_0x422826]){delete _0x27f1ab[_0x4074('0x17')][_0x422826];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x422826,util[_0x4074('0x41')](_0xc84e7f,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x44')]=function(){logger['error'](_0x4074('0x45'));clearChannels(this[_0x4074('0x13')]);this[_0x4074('0x46')](this[_0x4074('0x42')]);clearAgentBooked(this[_0x4074('0x12')]);clearVoiceQueues(this[_0x4074('0x14')]);clearCampaigns(this[_0x4074('0x16')]);};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x46')]=function(_0x2df00f){var _0x4fb79b=this;if(!_[_0x4074('0x32')](_0x2df00f)){for(var _0x4eaef6 in _0x2df00f){if(_0x2df00f[_0x4074('0x33')](_0x4eaef6)){_0x4fb79b['emitVoiceQueueChannelRemove'](_0x2df00f[_0x4eaef6],_0x4074('0x47'));delete _0x2df00f[_0x4eaef6];}}}};VoiceQueueReport[_0x4074('0xe')]['emit']=function(_0x42840d,_0x5285d7,_0x4311e0){io['to'](_0x42840d)[_0x4074('0x48')](_0x5285d7,_0x4311e0);};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x49')]=function(_0x11cb9f,_0x503748){logger[_0x4074('0x4a')](_0x4074('0x4b')+_0x503748+_0x4074('0x4c'),_0x11cb9f[_0x4074('0x4d')],util[_0x4074('0x41')](_0x11cb9f,{'showHidden':![],'depth':null}));this[_0x4074('0x48')](util['format'](_0x4074('0x4e'),_0x11cb9f[_0x4074('0x4f')]),_0x4074('0x50'),_0x11cb9f);io['emit'](_0x4074('0x51'),_0x11cb9f);};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x52')]=function(_0x1ba632,_0x1a6628){logger[_0x4074('0x4a')]('[%s][voiceQueueReport]['+_0x1a6628+_0x4074('0x53'),_0x1ba632[_0x4074('0x4d')],util[_0x4074('0x41')](_0x1ba632,{'showHidden':![],'depth':null}));if(_0x1ba632[_0x4074('0x54')]===_0x4074('0x55'))return;this[_0x4074('0x48')](util[_0x4074('0x56')](_0x4074('0x4e'),_0x1ba632[_0x4074('0x4f')]),'voice_queue_channel:remove',_0x1ba632);io['emit'](_0x4074('0x57'),_0x1ba632);};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x58')]=function(_0x423804,_0x1f4ad9){if(_0x423804[_0x4074('0x59')]===_0x4074('0x5a')){var _0x210d3b={'id':_0x423804['id'],'name':_0x423804[_0x4074('0x4f')],'strategy':_0x423804[_0x4074('0x5b')],'answered':_0x423804[_0x4074('0x5c')],'available':_0x423804['available'],'loggedIn':_0x423804[_0x4074('0x5d')],'pTalking':_0x423804[_0x4074('0x36')],'sumBillable':_0x423804[_0x4074('0x5e')],'sumDuration':_0x423804[_0x4074('0x5f')],'sumHoldTime':_0x423804['sumHoldTime']||0x0,'talking':_0x423804[_0x4074('0x35')],'total':_0x423804[_0x4074('0x60')],'type':_0x423804[_0x4074('0x59')],'unmanaged':_0x423804[_0x4074('0x61')],'abandoned':_0x423804[_0x4074('0x62')],'waiting':_0x423804['waiting']};if(_0x423804['Trunk']){_0x210d3b[_0x4074('0x63')]={'id':_0x423804[_0x4074('0x63')]['id'],'name':_0x423804['Trunk'][_0x4074('0x4f')],'active':_0x423804['Trunk']['active'],'callerid':_0x423804[_0x4074('0x63')][_0x4074('0x64')]};}if(_0x423804[_0x4074('0x65')]){_0x210d3b['Interval']={'id':_0x423804['Interval']['id'],'name':_0x423804[_0x4074('0x65')][_0x4074('0x4f')]};}var _0x3cce4a=md5(JSON[_0x4074('0x66')](_0x210d3b));if(_0x423804[_0x4074('0x3')]!==_0x3cce4a){_0x423804['md5']=_0x3cce4a;logger[_0x4074('0x4a')]('[voiceQueueReport]['+_0x1f4ad9+']\x20sending\x20voice_queue:save\x20event:',util[_0x4074('0x41')](_0x210d3b,{'showHidden':![],'depth':null}));this[_0x4074('0x48')](util[_0x4074('0x56')]('voice:queue:%s',_0x210d3b[_0x4074('0x4f')]),_0x4074('0x67'),_0x210d3b);}}};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x68')]=function(_0x228627){return _0x228627!==null&&!_[_0x4074('0x69')](_0x228627);};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x31')]=function(){var _0xec6db0=this;setInterval(function(){_0xec6db0[_0x4074('0x3a')]();ami[_0x4074('0x3e')]({'action':_0x4074('0x6a')})[_0x4074('0x6b')](function(_0x454bd7){logger['error']('[voiceQueueReport][queues]',util[_0x4074('0x41')](_0x454bd7,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x4074('0xe')]['loopQueueSummary']=function(){var _0x7f5a4d=this;setInterval(function(){if(_0x7f5a4d[_0x4074('0x15')]){return ami[_0x4074('0x3e')]({'action':_0x4074('0x18')})['then'](function(){_0x7f5a4d[_0x4074('0x15')]=![];})['catch'](function(_0x1df2c4){logger[_0x4074('0x40')](_0x4074('0x6c'),util[_0x4074('0x41')](_0x1df2c4,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x19')]=function(_0x5d3afb){try{if(this[_0x4074('0x68')](_0x5d3afb)&&this[_0x4074('0x68')](_0x5d3afb[_0x4074('0x6d')])){logger['debug'](_0x4074('0x6e'),util[_0x4074('0x41')](_0x5d3afb,{'showHidden':![],'depth':null}));if(this[_0x4074('0x14')][_0x5d3afb[_0x4074('0x6d')]]){logger[_0x4074('0x6f')](_0x4074('0x70'),_0x5d3afb[_0x4074('0x6d')]);var _0x191876=_['countBy'](this[_0x4074('0x13')],_0x4074('0x6d'))[_0x5d3afb[_0x4074('0x6d')]]||0x0;var _0x5b629d=_0x191876-_0x5d3afb[_0x4074('0x71')];if(this[_0x4074('0x14')][_0x5d3afb[_0x4074('0x6d')]][_0x4074('0x37')]!==_[_0x4074('0x72')](_0x5d3afb[_0x4074('0x71')])||this[_0x4074('0x14')][_0x5d3afb['queue']][_0x4074('0x5d')]!==_['toNumber'](_0x5d3afb[_0x4074('0x73')])||this[_0x4074('0x14')][_0x5d3afb[_0x4074('0x6d')]][_0x4074('0x74')]!==_[_0x4074('0x72')](_0x5d3afb[_0x4074('0x74')])||this[_0x4074('0x14')][_0x5d3afb['queue']][_0x4074('0x35')]!==_0x5b629d){this[_0x4074('0x14')][_0x5d3afb[_0x4074('0x6d')]][_0x4074('0x37')]=_[_0x4074('0x72')](_0x5d3afb[_0x4074('0x71')]);this[_0x4074('0x14')][_0x5d3afb['queue']][_0x4074('0x5d')]=_[_0x4074('0x72')](_0x5d3afb[_0x4074('0x73')]);this['voiceQueues'][_0x5d3afb[_0x4074('0x6d')]]['available']=_[_0x4074('0x72')](_0x5d3afb[_0x4074('0x74')]);this['voiceQueues'][_0x5d3afb[_0x4074('0x6d')]]['talking']=_0x5b629d>0x0?_0x5b629d:0x0;this[_0x4074('0x14')][_0x5d3afb[_0x4074('0x6d')]]['talking']=this[_0x4074('0x14')][_0x5d3afb[_0x4074('0x6d')]]['talking']>_[_0x4074('0x72')](_0x5d3afb[_0x4074('0x73')])?_[_0x4074('0x72')](_0x5d3afb['loggedin']):this[_0x4074('0x14')][_0x5d3afb[_0x4074('0x6d')]][_0x4074('0x35')];this['emitVoiceQueueSummary'](this[_0x4074('0x14')][_0x5d3afb['queue']],_0x4074('0x18'));}logger[_0x4074('0x4a')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x4074('0x41')](this[_0x4074('0x14')][_0x5d3afb[_0x4074('0x6d')]],{'showHidden':![],'depth':null}));ami['emit'](_0x4074('0x75'),this[_0x4074('0x14')][_0x5d3afb['queue']]);}}}catch(_0x2f6b8e){logger[_0x4074('0x40')](_0x4074('0x6c'),util[_0x4074('0x41')](_0x2f6b8e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4074('0x1c')]=function(_0x3b3670){logger['debug'](_0x4074('0x76'),util['inspect'](_0x3b3670,{'showHidden':![],'depth':null}));this[_0x4074('0x15')]=!![];};VoiceQueueReport[_0x4074('0xe')]['syncQueueCallerJoin']=function(_0x2c0296){try{if(this['isNotNull'](_0x2c0296)){logger[_0x4074('0x4a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2c0296[_0x4074('0x4d')],util[_0x4074('0x41')](_0x2c0296,{'showHidden':![],'depth':null}));if(_[_0x4074('0x69')](this[_0x4074('0x42')][_0x2c0296[_0x4074('0x4d')]]))this[_0x4074('0x42')][_0x2c0296[_0x4074('0x4d')]]=[];if(_[_0x4074('0x69')](this[_0x4074('0x13')][_0x2c0296[_0x4074('0x4d')]]))this['channels'][_0x2c0296[_0x4074('0x4d')]]={};var _0x2b8266=new QueueReport();_0x2b8266['name']=_0x2c0296[_0x4074('0x6d')];_0x2b8266[_0x4074('0x59')]=this['voiceQueues'][_0x2b8266['name']]&&this[_0x4074('0x14')][_0x2b8266[_0x4074('0x4f')]]['type']?this[_0x4074('0x14')][_0x2b8266[_0x4074('0x4f')]][_0x4074('0x59')]||_0x4074('0x5a'):_0x4074('0x5a');_0x2b8266[_0x4074('0x6d')]=_0x2c0296[_0x4074('0x6d')];_0x2b8266['queuecallerjoinAt']=moment()[_0x4074('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b8266[_0x4074('0x77')]=_0x2c0296['position'];_0x2b8266[_0x4074('0x78')]=_0x2c0296[_0x4074('0x78')];_0x2b8266['uniqueid']=_0x2c0296[_0x4074('0x4d')];_0x2b8266['routealias']=this['channels'][_0x2c0296[_0x4074('0x4d')]][_0x4074('0x79')];logger[_0x4074('0x6f')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2b8266[_0x4074('0x4f')],_0x2b8266[_0x4074('0x59')]);_[_0x4074('0x7a')](_0x2b8266,_['pick'](_0x2c0296,_['keys'](_0x2b8266)));this[_0x4074('0x42')][_0x2c0296['uniqueid']][_0x4074('0x7b')](_0x2b8266);this['channels'][_0x2c0296[_0x4074('0x4d')]]=_0x2b8266;this[_0x4074('0x49')](_0x2b8266,_0x4074('0x1d'));}}catch(_0x2eec2c){logger[_0x4074('0x40')](_0x4074('0x7c'),_0x2c0296[_0x4074('0x4d')],util[_0x4074('0x41')](_0x2eec2c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x20')]=function(_0x497d1c){try{if(this['isNotNull'](_0x497d1c)){logger[_0x4074('0x4a')](_0x4074('0x7d'),_0x497d1c[_0x4074('0x4d')],util['inspect'](_0x497d1c,{'showHidden':![],'depth':null}));if(this[_0x4074('0x42')][_0x497d1c[_0x4074('0x4d')]]){var _0x20ad0b=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x497d1c[_0x4074('0x4d')]]);_0x20ad0b[_0x4074('0x7f')]=![];_0x20ad0b[_0x4074('0x80')]=null;_0x20ad0b[_0x4074('0x81')]=_0x497d1c[_0x4074('0x81')];_0x20ad0b[_0x4074('0x82')]=_0x497d1c[_0x4074('0x82')];_0x20ad0b[_0x4074('0x1f')]=!![];_0x20ad0b[_0x4074('0x83')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x20ad0b['queuecallerexitreason']=_0x4074('0x84');_0x20ad0b[_0x4074('0x85')]=null;logger[_0x4074('0x6f')](_0x4074('0x86'),_0x20ad0b[_0x4074('0x4f')],_0x20ad0b['type']);this[_0x4074('0x13')][_0x497d1c[_0x4074('0x4d')]]=_0x20ad0b;this[_0x4074('0x52')](_0x20ad0b,_0x4074('0x1f'));}}}catch(_0x4353c5){logger[_0x4074('0x40')]('[%s][voiceQueueReport][queuecallerabandon]',_0x497d1c['uniqueid'],util[_0x4074('0x41')](_0x4353c5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x22')]=function(_0x4bdc24){try{if(this[_0x4074('0x68')](_0x4bdc24)){logger[_0x4074('0x4a')](_0x4074('0x87'),_0x4bdc24[_0x4074('0x4d')],util[_0x4074('0x41')](_0x4bdc24,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4bdc24[_0x4074('0x4d')]]){var _0x28edb0=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x4bdc24['uniqueid']]);_0x28edb0[_0x4074('0x88')]=moment()[_0x4074('0x56')](_0x4074('0x89'));_0x28edb0[_0x4074('0x8a')]=_0x4bdc24['connectedlinenum'];_0x28edb0[_0x4074('0x8b')]=_0x4bdc24[_0x4074('0x8b')];logger[_0x4074('0x6f')](_0x4074('0x8c'),_0x28edb0[_0x4074('0x4f')],_0x28edb0['type'],_0x4bdc24[_0x4074('0x8a')],_0x4bdc24[_0x4074('0x8b')]);this['channels'][_0x4bdc24[_0x4074('0x4d')]]=_0x28edb0;this[_0x4074('0x49')](_0x28edb0,_0x4074('0x21'));}}}catch(_0x5b5691){logger[_0x4074('0x40')](_0x4074('0x87'),_0x4bdc24[_0x4074('0x4d')],util['inspect'](_0x5b5691,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')]['syncAgentConnect']=function(_0x598727){try{if(this['isNotNull'](_0x598727)){logger[_0x4074('0x4a')](_0x4074('0x8d'),_0x598727[_0x4074('0x4d')],util[_0x4074('0x41')](_0x598727,{'showHidden':![],'depth':null}));if(this[_0x4074('0x42')][_0x598727[_0x4074('0x4d')]]){var _0x185000=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x598727['uniqueid']]);_0x185000['queuecallercomplete']=!![];_0x185000[_0x4074('0x54')]=_0x4074('0x8e');logger['info'](_0x4074('0x8f'),_0x185000['name'],_0x185000['type']);}}}catch(_0x3d9cb8){logger[_0x4074('0x40')](_0x4074('0x8d'),_0x598727['uniqueid'],util['inspect'](_0x3d9cb8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')]['syncAgentComplete']=function(_0x270a98){try{if(this[_0x4074('0x68')](_0x270a98)){logger[_0x4074('0x4a')]('[%s][voiceQueueReport][agentcomplete]',_0x270a98['uniqueid'],util[_0x4074('0x41')](_0x270a98,{'showHidden':![],'depth':null}));if(this[_0x4074('0x42')][_0x270a98[_0x4074('0x4d')]]){var _0x401700=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x270a98[_0x4074('0x4d')]]);_0x401700[_0x4074('0x1f')]=![];_0x401700[_0x4074('0x83')]=null;_0x401700[_0x4074('0x90')]=!![];_0x401700[_0x4074('0x85')]=_0x270a98[_0x4074('0x91')];_0x401700[_0x4074('0x81')]=_0x270a98[_0x4074('0x81')];_0x401700[_0x4074('0x7f')]=!![];_0x401700[_0x4074('0x92')]=![];_0x401700[_0x4074('0x93')]=null;if(!_0x401700[_0x4074('0x94')]){if(_0x270a98['reason']==_0x4074('0x94')){_0x401700[_0x4074('0x54')]=_0x4074('0x95');logger[_0x4074('0x6f')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x401700[_0x4074('0x4f')],_0x401700[_0x4074('0x59')]);}else{if(_[_0x4074('0x96')](_0x270a98[_0x4074('0x97')]['toLowerCase'](),_0x4074('0x98'))){if(this[_0x4074('0x42')][_0x270a98[_0x4074('0x99')]]){var _0x3b37e4=_['last'](this[_0x4074('0x42')][_0x270a98[_0x4074('0x99')]]);_0x3b37e4['queuecallercomplete']=![];_0x3b37e4[_0x4074('0x92')]=!![];_0x3b37e4[_0x4074('0x93')]=moment(_0x401700['queuecallerjoinAt'])[_0x4074('0x9a')](_0x270a98[_0x4074('0x81')],_0x4074('0x9b'))['format'](_0x4074('0x89'));_0x3b37e4[_0x4074('0x54')]=_0x4074('0x9c');_0x3b37e4['transfer']=!![];_0x3b37e4[_0x4074('0x9d')]='FORWARD';_0x3b37e4[_0x4074('0x9e')]=_0x270a98['destexten'];_0x3b37e4[_0x4074('0x9f')]=_0x270a98['uniqueid'];logger[_0x4074('0x6f')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3b37e4['name'],_0x3b37e4['type']);var _0x5be2ab=this[_0x4074('0x42')][_0x270a98['linkedid']];this[_0x4074('0x42')][_0x270a98[_0x4074('0x99')]]=this[_0x4074('0x42')][_0x270a98['uniqueid']];this[_0x4074('0x42')][_0x270a98[_0x4074('0x4d')]]=_0x5be2ab;}}else{_0x401700[_0x4074('0x54')]='COMPLETEDBY'+_0x270a98[_0x4074('0xa0')][_0x4074('0xa1')]();logger[_0x4074('0x6f')](_0x4074('0xa2'),_0x401700[_0x4074('0x4f')],_0x401700[_0x4074('0x59')],_0x401700['queuecallerexitreason']);}}}this[_0x4074('0x13')][_0x270a98['uniqueid']]=_0x401700;this['emitVoiceQueueChannelRemove'](_0x401700,_0x4074('0xa3'));}}}catch(_0x436dc1){logger[_0x4074('0x40')](_0x4074('0xa4'),_0x270a98[_0x4074('0x4d')],util['inspect'](_0x436dc1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')]['syncVarSet']=function(_0x567e50){try{if(this['isNotNull'](_0x567e50)){logger['debug'](_0x4074('0xa5'),_0x567e50[_0x4074('0x4d')],util[_0x4074('0x41')](_0x567e50,{'showHidden':![],'depth':null}));this[_0x4074('0xa6')](_0x567e50[_0x4074('0x4d')],_[_0x4074('0xa7')](_0x567e50[_0x4074('0xa8')])[0x0],_0x567e50[_0x4074('0xa9')]);if(this[_0x4074('0x42')][_0x567e50[_0x4074('0x4d')]]){var _0x529cd8=_['last'](this[_0x4074('0x42')][_0x567e50[_0x4074('0x4d')]]);if(_0x529cd8){if(this[_0x4074('0x68')](_0x567e50[_0x4074('0xa8')])&&this[_0x4074('0x68')](_0x567e50[_0x4074('0xa8')][_0x4074('0xaa')])){switch(_0x567e50[_0x4074('0xa9')]){case _0x4074('0xab'):_0x529cd8[_0x4074('0x92')]=![];_0x529cd8[_0x4074('0x93')]=null;break;case'TIMEOUT':_0x529cd8[_0x4074('0xac')]='timeout';_0x529cd8[_0x4074('0x92')]=!![];_0x529cd8[_0x4074('0x93')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x529cd8['queuecallerleaveAt']=moment()[_0x4074('0x56')](_0x4074('0x89'));logger[_0x4074('0x4a')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x567e50[_0x4074('0x4d')],util[_0x4074('0x41')](_0x529cd8,{'showHidden':![],'depth':null}));ami['emit'](_0x4074('0xad'),_0x529cd8);break;default:_0x529cd8[_0x4074('0x92')]=!![];_0x529cd8['queuecallerexitAt']=moment()[_0x4074('0x56')](_0x4074('0x89'));_0x529cd8[_0x4074('0x88')]=moment()[_0x4074('0x56')](_0x4074('0x89'));}_0x529cd8[_0x4074('0x1f')]=![];_0x529cd8[_0x4074('0x83')]=null;_0x529cd8[_0x4074('0x54')]=_0x567e50[_0x4074('0xa9')];this[_0x4074('0x13')][_0x567e50[_0x4074('0x4d')]]=_0x529cd8;this[_0x4074('0x52')](_0x529cd8,_0x4074('0x26'));}else if(this[_0x4074('0x68')](_0x567e50[_0x4074('0xa8')])&&this['isNotNull'](_0x567e50[_0x4074('0xa8')][_0x4074('0xae')])){if(!_0x529cd8[_0x4074('0x1f')]){_0x529cd8[_0x4074('0x92')]=!![];_0x529cd8[_0x4074('0x93')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x529cd8[_0x4074('0x54')]=_0x4074('0xaf');_0x529cd8[_0x4074('0x88')]=moment()[_0x4074('0x56')](_0x4074('0x89'));this[_0x4074('0x13')][_0x567e50[_0x4074('0x4d')]]=_0x529cd8;}}logger[_0x4074('0x6f')](_0x4074('0xb0'),_0x567e50[_0x4074('0x4d')],_0x529cd8[_0x4074('0x4f')],_0x529cd8[_0x4074('0x59')],_['keys'](_0x567e50['variable'])[0x0],_0x567e50['value']);_0x529cd8[_0x4074('0x17')]=this[_0x4074('0x17')][_0x567e50[_0x4074('0x4d')]];}}}}catch(_0x32e96a){logger[_0x4074('0x40')](_0x4074('0xa5'),_0x567e50[_0x4074('0x4d')],util[_0x4074('0x41')](_0x32e96a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')]['addVariable']=function(_0x412885,_0x10ad22,_0x3221b5){var _0x2c8b35=[_0x4074('0xb1'),'rtpaudioqosbridged',_0x4074('0xb2'),_0x4074('0xb3'),_0x4074('0xb4'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x4074('0xb5'),_0x4074('0xb6'),_0x4074('0xb7'),_0x4074('0xb8'),'bridgepvtcallid',_0x4074('0xb9'),_0x4074('0xba'),_0x4074('0xbb'),'memberlastcall','membername',_0x4074('0xbc'),_0x4074('0xbd')];if(!_[_0x4074('0x3d')](_0x10ad22)&&!_['includes'](_0x2c8b35,_0x10ad22)){if(_[_0x4074('0x69')](this['variables'][_0x412885])){this['variables'][_0x412885]={};}this['variables'][_0x412885][_0x10ad22]=_0x3221b5;}};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x28')]=function(_0x465eb8){try{if(this[_0x4074('0x68')](_0x465eb8)){logger[_0x4074('0x4a')](_0x4074('0xbe'),_0x465eb8[_0x4074('0x4d')],util[_0x4074('0x41')](_0x465eb8,{'showHidden':![],'depth':null}));if(this[_0x4074('0x42')][_0x465eb8[_0x4074('0x4d')]]){for(var _0x63001=0x0,_0x473b2b={};_0x63001<this[_0x4074('0x42')][_0x465eb8[_0x4074('0x4d')]]['length'];_0x63001+=0x1){_0x473b2b=this[_0x4074('0x42')][_0x465eb8['uniqueid']][_0x63001];if(this[_0x4074('0x14')][_0x473b2b[_0x4074('0x6d')]]){if(_0x473b2b[_0x4074('0x92')]&&_0x473b2b[_0x4074('0x94')]!=!![]){this[_0x4074('0x14')][_0x473b2b[_0x4074('0x6d')]][_0x4074('0x61')]+=0x1;}if(_0x473b2b[_0x4074('0x1f')]){this[_0x4074('0x14')][_0x473b2b[_0x4074('0x6d')]][_0x4074('0x62')]+=0x1;}this[_0x4074('0x14')][_0x473b2b[_0x4074('0x6d')]][_0x4074('0xbf')]+=moment(_0x473b2b['queuecallerleaveAt'])[_0x4074('0xc0')](_0x473b2b['queuecallerjoinAt'],_0x4074('0x9b'))||0x0;if(_0x63001===this[_0x4074('0x42')][_0x465eb8['uniqueid']]['length']-0x1){this['voiceQueues'][_0x473b2b['queue']][_0x4074('0x5f')]+=moment()[_0x4074('0xc1')](0x0)['diff'](_0x473b2b[_0x4074('0xc2')],_0x4074('0x9b'));this[_0x4074('0x14')][_0x473b2b[_0x4074('0x6d')]][_0x4074('0x60')]+=0x1;if(_0x473b2b['queuecallercomplete']){this['voiceQueues'][_0x473b2b['queue']][_0x4074('0x5c')]+=0x1;this[_0x4074('0x14')][_0x473b2b[_0x4074('0x6d')]][_0x4074('0x5e')]+=moment()['milliseconds'](0x0)[_0x4074('0xc0')](_0x473b2b[_0x4074('0x88')],_0x4074('0x9b'));_0x473b2b['queuecallercompleteAt']=moment()[_0x4074('0x56')](_0x4074('0x89'));_0x473b2b[_0x4074('0x92')]=![];_0x473b2b[_0x4074('0x93')]=null;}if(_0x473b2b[_0x4074('0x92')]&&_0x473b2b[_0x4074('0x94')]!=!![]){_0x473b2b[_0x4074('0xac')]=_0x4074('0x61');logger[_0x4074('0x4a')](_0x4074('0xc3'),_0x465eb8[_0x4074('0x4d')],util[_0x4074('0x41')](_0x473b2b,{'showHidden':![],'depth':null}));ami[_0x4074('0x48')](_0x4074('0xc4'),_0x473b2b);}if(_0x473b2b['queuecallerabandon']){_0x473b2b['lastevent']=_0x4074('0x62');logger[_0x4074('0x4a')](_0x4074('0xc5'),_0x465eb8[_0x4074('0x4d')],util['inspect'](_0x473b2b,{'showHidden':![],'depth':null}));ami['emit'](_0x4074('0xc6'),_0x473b2b);}}else{this[_0x4074('0x14')][_0x473b2b['queue']][_0x4074('0x5f')]+=this['voiceQueues'][_0x473b2b[_0x4074('0x6d')]][_0x4074('0xbf')];}logger['info'](_0x4074('0xc7'),_0x465eb8[_0x4074('0x4d')],_0x473b2b[_0x4074('0x4f')],_0x473b2b[_0x4074('0x59')],_0x465eb8[_0x4074('0xc8')]);this[_0x4074('0x13')][_0x465eb8[_0x4074('0x4d')]]=_0x473b2b;this[_0x4074('0x52')](_0x473b2b,_0x4074('0xc9'));this['emitVoiceQueueSummary'](this[_0x4074('0x14')][_0x473b2b[_0x4074('0x6d')]],'hangup');}}logger['debug'](_0x4074('0xca'),_0x465eb8[_0x4074('0x4d')],util['inspect'](this['queueReports'][_0x465eb8[_0x4074('0x4d')]],{'showHidden':![],'depth':null}));ami[_0x4074('0x48')](_0x4074('0xcb'),this[_0x4074('0x42')][_0x465eb8[_0x4074('0x4d')]]);if(_0x473b2b[_0x4074('0x54')]===_0x4074('0x55'))return;delete this[_0x4074('0x42')][_0x465eb8[_0x4074('0x4d')]];delete this[_0x4074('0x13')][_0x465eb8['uniqueid']];}if(this['variables'][_0x465eb8[_0x4074('0x4d')]]){delete this[_0x4074('0x17')][_0x465eb8[_0x4074('0x4d')]];}}}catch(_0xd587be){logger['error'](_0x4074('0xbe'),_0x465eb8[_0x4074('0x4d')],util['inspect'](_0xd587be,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x2e')]=function(_0x2b8812){try{if(this[_0x4074('0x68')](_0x2b8812)){logger['debug'](_0x4074('0xcc'),_0x2b8812['uniqueid'],util['inspect'](_0x2b8812,{'showHidden':![],'depth':null}));var _0xaa65da;var _0x9e20d8;var _0x21a48b;if(this[_0x4074('0x42')][_0x2b8812[_0x4074('0xcd')]]){_0xaa65da=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x2b8812[_0x4074('0xcd')]]);_0xaa65da[_0x4074('0x9e')]=_0x2b8812[_0x4074('0xce')];_0xaa65da[_0x4074('0x9f')]=_0x2b8812[_0x4074('0xcf')];_0xaa65da[_0x4074('0x54')]='ATTENDEDTRANSFER';_0xaa65da['transfer']=!![];_0xaa65da[_0x4074('0x9d')]='ATTENDED';if(this[_0x4074('0x42')][_0x2b8812[_0x4074('0xcf')]]){_0x21a48b=this[_0x4074('0x42')][_0x2b8812[_0x4074('0xcf')]];this[_0x4074('0x42')][_0x2b8812['secondtransfereruniqueid']]=this[_0x4074('0x42')][_0x2b8812[_0x4074('0xcd')]];this[_0x4074('0x42')][_0x2b8812['transfereeuniqueid']]=_0x21a48b;_0x9e20d8=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x2b8812['transfereeuniqueid']]);_0x9e20d8[_0x4074('0x3b')]=!![];}logger[_0x4074('0x6f')](_0x4074('0xd0'),_0x2b8812[_0x4074('0x4d')],_0xaa65da['name'],_0xaa65da['type'],_0xaa65da[_0x4074('0x9e')],_0xaa65da[_0x4074('0x9f')]);}else if(this[_0x4074('0x42')][_0x2b8812['transfertargetuniqueid']]){_0xaa65da=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x2b8812[_0x4074('0xd1')]]);_0xaa65da[_0x4074('0x9e')]=_0x2b8812[_0x4074('0xd2')];_0xaa65da[_0x4074('0x9f')]=_0x2b8812[_0x4074('0xd3')];_0xaa65da['queuecallerexitreason']=_0x4074('0x55');_0xaa65da[_0x4074('0x94')]=!![];_0xaa65da[_0x4074('0x9d')]='ATTENDED';if(this['queueReports'][_0x2b8812[_0x4074('0xd3')]]){_0x21a48b=this[_0x4074('0x42')][_0x2b8812[_0x4074('0xd3')]];this['queueReports'][_0x2b8812['origtransfereruniqueid']]=this[_0x4074('0x42')][_0x2b8812[_0x4074('0xd1')]];this[_0x4074('0x42')][_0x2b8812[_0x4074('0xd1')]]=_0x21a48b;_0x9e20d8=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x2b8812['transfertargetuniqueid']]);_0x9e20d8[_0x4074('0x3b')]=!![];}logger['info'](_0x4074('0xd0'),_0x2b8812['uniqueid'],_0xaa65da['name'],_0xaa65da[_0x4074('0x59')],_0xaa65da[_0x4074('0x9e')],_0xaa65da[_0x4074('0x9f')]);}else if(this[_0x4074('0x42')][_0x2b8812['origtransfereruniqueid']]){_0xaa65da=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x2b8812[_0x4074('0xd3')]]);_0xaa65da['transferexten']=_0x2b8812[_0x4074('0xd2')];_0xaa65da['transferuniqueid']=_0x2b8812['origtransfereruniqueid'];_0xaa65da[_0x4074('0x54')]='ATTENDEDTRANSFER';_0xaa65da[_0x4074('0x94')]=!![];_0xaa65da[_0x4074('0x9d')]='ATTENDED';}else if(this['queueReports'][_0x2b8812[_0x4074('0xcf')]]){_0xaa65da=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x2b8812[_0x4074('0xcf')]]);_0xaa65da[_0x4074('0x9e')]=_0x2b8812[_0x4074('0xce')];_0xaa65da[_0x4074('0x9f')]=_0x2b8812['secondtransfereruniqueid'];_0xaa65da[_0x4074('0x54')]=_0x4074('0x55');_0xaa65da[_0x4074('0x94')]=!![];_0xaa65da[_0x4074('0x9d')]=_0x4074('0xd4');}}}catch(_0x450b1f){logger[_0x4074('0x40')](_0x4074('0xcc'),_0x2b8812[_0x4074('0x4d')],util[_0x4074('0x41')](_0x450b1f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x2f')]=function(_0x425008){try{if(this[_0x4074('0x68')](_0x425008)){logger[_0x4074('0x4a')](_0x4074('0xd5'),_0x425008[_0x4074('0x4d')],util['inspect'](_0x425008,{'showHidden':![],'depth':null}));if(this[_0x4074('0x42')][_0x425008[_0x4074('0xcd')]]){var _0x1d86a0=_['last'](this['queueReports'][_0x425008[_0x4074('0xcd')]]);_0x1d86a0['queuecallerexitreason']=_0x4074('0xd6');_0x1d86a0[_0x4074('0x94')]=!![];_0x1d86a0['transfertype']=_0x4074('0xd7');_0x1d86a0[_0x4074('0x9e')]=_0x425008[_0x4074('0xd8')];_0x1d86a0[_0x4074('0x9f')]=_0x425008[_0x4074('0xcd')];logger['info']('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x425008[_0x4074('0x4d')],_0x1d86a0['name'],_0x1d86a0[_0x4074('0x59')],_0x1d86a0[_0x4074('0x9e')],_0x1d86a0[_0x4074('0x9f')]);this[_0x4074('0x28')]({'event':_0x4074('0xd9'),'uniqueid':_0x425008[_0x4074('0xcd')],'context':_0x425008['context'],'channel':_0x425008['transfererchannel']});}}}catch(_0x5beb77){logger[_0x4074('0x40')](_0x4074('0xd5'),_0x425008[_0x4074('0x4d')],util[_0x4074('0x41')](_0x5beb77,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStart']=function(_0x832055){try{if(this['isNotNull'](_0x832055)){logger[_0x4074('0x4a')]('[%s][voiceQueueReport][musiconholdstart]',_0x832055[_0x4074('0x4d')],util[_0x4074('0x41')](_0x832055,{'showHidden':![],'depth':null}));if(this[_0x4074('0x42')][_0x832055[_0x4074('0x4d')]]){var _0x2a72b2=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x832055[_0x4074('0x4d')]]);if(!_['isNil'](_0x2a72b2[_0x4074('0x88')])){_0x2a72b2[_0x4074('0xda')]=moment()[_0x4074('0x56')](_0x4074('0x89'));logger['info']('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x832055[_0x4074('0x4d')],_0x2a72b2[_0x4074('0xda')]);}}}}catch(_0x3d4e78){logger['error'](_0x4074('0xdb'),_0x832055[_0x4074('0x4d')],util['inspect'](_0x3d4e78,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')][_0x4074('0x2d')]=function(_0x55df22){try{if(this['isNotNull'](_0x55df22)){logger['debug']('[%s][voiceQueueReport][musiconholdstop]',_0x55df22[_0x4074('0x4d')],util[_0x4074('0x41')](_0x55df22,{'showHidden':![],'depth':null}));if(this[_0x4074('0x42')][_0x55df22['uniqueid']]){var _0x3647ee=_[_0x4074('0x7e')](this[_0x4074('0x42')][_0x55df22[_0x4074('0x4d')]]);if(!_[_0x4074('0x3d')](_0x3647ee[_0x4074('0xda')])){_0x3647ee[_0x4074('0xdc')]+=moment()['milliseconds'](0x0)[_0x4074('0xc0')](_0x3647ee[_0x4074('0xda')],_0x4074('0x9b'));logger[_0x4074('0x6f')](_0x4074('0xdd'),_0x55df22[_0x4074('0x4d')],_0x3647ee[_0x4074('0xdc')]);delete _0x3647ee[_0x4074('0xda')];}}}}catch(_0x1ebe5b){logger[_0x4074('0x40')](_0x4074('0xde'),_0x55df22[_0x4074('0x4d')],util['inspect'](_0x1ebe5b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4074('0xe')]['syncNewExten']=function(_0x4fbb2b){try{if(this[_0x4074('0x68')](_0x4fbb2b)){logger[_0x4074('0x4a')](_0x4074('0xdf'),_0x4fbb2b[_0x4074('0x4d')],util[_0x4074('0x41')](_0x4fbb2b,{'showHidden':![],'depth':null}));if(_0x4fbb2b['application'][_0x4074('0xe0')]()===_0x4074('0xe1')){_0x4fbb2b['applicationdata']=_0x4fbb2b[_0x4074('0xe2')]&&_0x4fbb2b[_0x4074('0xe2')][_0x4074('0x96')](_0x4074('0xe3'))?_0x4fbb2b['appdata']:(_0x4fbb2b['appdata']||_0x4fbb2b[_0x4074('0xe4')])['toLowerCase']();if(_['startsWith'](_0x4fbb2b[_0x4074('0xe4')][_0x4074('0xe0')](),_0x4074('0xe5'))){logger[_0x4074('0x6f')](_0x4074('0xe6'),_0x4fbb2b[_0x4074('0x4d')],_0x4fbb2b[_0x4074('0xe7')],_0x4fbb2b['applicationdata']);if(_[_0x4074('0x69')](this[_0x4074('0x13')][_0x4fbb2b[_0x4074('0x4d')]]))this[_0x4074('0x13')][_0x4fbb2b[_0x4074('0x4d')]]={};var _0x2d9132=_0x4fbb2b[_0x4074('0xe4')][_0x4074('0xe8')]('=');var _0x3e4e73=_0x2d9132[0x0][_0x4074('0xe0')]()[_0x4074('0xe9')](/cdr\((.*)\)/);if(_0x3e4e73)this[_0x4074('0x13')][_0x4fbb2b[_0x4074('0x4d')]][_0x3e4e73[0x1]]=_0x2d9132[0x1];}}}}catch(_0x19306e){logger[_0x4074('0x40')](_0x4074('0xea'),_0x4fbb2b[_0x4074('0x4d')],util['inspect'](_0x19306e,{'showHidden':![],'depth':null}));}};module[_0x4074('0xeb')]=VoiceQueueReport;
\ No newline at end of file
+var _0x3ba1=['localhost','prototype','enqueue','tail','agents','channels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','bind','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','unlockRR','clearZombieChannels','switch','sequence','isNil','status','channel','catch','message','No\x20such\x20channel','inspect','queueReports','error','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','type','inbound','strategy','loggedIn','pTalking','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','Action','then','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','emitVoiceQueueSummary','[voiceQueueReport][queuesummary]','syncQueueSummaryComplete','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerabandon','last','queuecallerleaveAt','connectedlinenum','connectedlinename','queuecallerleave','[%s][voiceQueueReport][queuecallerleave]','queuecallercomplete','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberinterface','memberlastcall','memberrealtime','includes','[%s][voiceQueueReport][hangup]','milliseconds','answered','diff','queuecallercompleteAt','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','origtransfererexten','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','util','md5','../../../config/environment','ami','../ami','../model/queueReport','defaults'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0x3ba1,0x1d3));var _0x13ba=function(_0x4bbe00,_0x1d2f14){_0x4bbe00=_0x4bbe00-0x0;var _0x3999d2=_0x3ba1[_0x4bbe00];return _0x3999d2;};'use strict';var _=require(_0x13ba('0x0'));var moment=require(_0x13ba('0x1'));var util=require(_0x13ba('0x2'));var md5=require(_0x13ba('0x3'));var Redis=require('ioredis');var config=require(_0x13ba('0x4'));var logger=require('../../../config/logger')(_0x13ba('0x5'));var ami=require(_0x13ba('0x6'));var QueueReport=require(_0x13ba('0x7'));config['redis']=_[_0x13ba('0x8')](config['redis'],{'host':_0x13ba('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x13ba('0xa')][_0x13ba('0xb')]=function(_0x2d5462){this['tail']=this[_0x13ba('0xc')]?this['tail']['finally'](_0x2d5462):_0x2d5462();};function VoiceQueueReport(_0x44b4fc){this['sequence']=new Sequence();this['queueReports']={};this[_0x13ba('0xd')]=_0x44b4fc[_0x13ba('0xd')];this[_0x13ba('0xe')]=_0x44b4fc['queueChannels'];this['voiceQueues']=_0x44b4fc[_0x13ba('0xf')];this[_0x13ba('0x10')]=!![];this[_0x13ba('0x11')]=_0x44b4fc['campaigns'];this['variables']={};ami['on'](_0x13ba('0x12'),this[_0x13ba('0x13')]['bind'](this));ami['on'](_0x13ba('0x14'),this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0x13ba('0x15'),this[_0x13ba('0x16')]['bind'](this));ami['on']('queuecallerabandon',this[_0x13ba('0x17')][_0x13ba('0x18')](this));ami['on']('queuecallerleave',this[_0x13ba('0x19')][_0x13ba('0x18')](this));ami['on'](_0x13ba('0x1a'),this[_0x13ba('0x1b')][_0x13ba('0x18')](this));ami['on'](_0x13ba('0x1c'),this[_0x13ba('0x1d')][_0x13ba('0x18')](this));ami['on'](_0x13ba('0x1e'),this[_0x13ba('0x1f')][_0x13ba('0x18')](this));ami['on'](_0x13ba('0x20'),this[_0x13ba('0x21')]['bind'](this));ami['on'](_0x13ba('0x22'),this[_0x13ba('0x23')][_0x13ba('0x18')](this));ami['on'](_0x13ba('0x24'),this[_0x13ba('0x25')]['bind'](this));ami['on'](_0x13ba('0x26'),this[_0x13ba('0x27')][_0x13ba('0x18')](this));ami['on'](_0x13ba('0x28'),this[_0x13ba('0x29')][_0x13ba('0x18')](this));ami['on'](_0x13ba('0x2a'),this[_0x13ba('0x2b')][_0x13ba('0x18')](this));this[_0x13ba('0x2c')]();this[_0x13ba('0x2d')]();}function clearChannels(_0x2d225b){if(!_[_0x13ba('0x2e')](_0x2d225b)){for(var _0x48ddc8 in _0x2d225b){if(_0x2d225b[_0x13ba('0x2f')](_0x48ddc8)){delete _0x2d225b[_0x48ddc8];}}}}function clearCampaigns(_0x23cf38){if(!_[_0x13ba('0x2e')](_0x23cf38)){for(var _0x409abf in _0x23cf38){if(_0x23cf38[_0x13ba('0x2f')](_0x409abf)){_0x23cf38[_0x409abf]['originated']=0x0;}}}}function clearVoiceQueues(_0x1fc7be){if(!_['isEmpty'](_0x1fc7be)){for(var _0x148ef4 in _0x1fc7be){if(_0x1fc7be[_0x13ba('0x2f')](_0x148ef4)){_0x1fc7be[_0x148ef4][_0x13ba('0x30')]=0x0;_0x1fc7be[_0x148ef4][_0x13ba('0x31')]=0x0;_0x1fc7be[_0x148ef4]['pTalking']=0x0;_0x1fc7be[_0x148ef4][_0x13ba('0x32')]=0x0;_0x1fc7be[_0x148ef4]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x3b3607){if(!_[_0x13ba('0x2e')](_0x3b3607)){for(var _0x437c0a in _0x3b3607){if(_0x3b3607['hasOwnProperty'](_0x437c0a)){_0x3b3607[_0x437c0a][_0x13ba('0x33')]=!![];}}}}VoiceQueueReport['prototype'][_0x13ba('0x34')]=function(){var _0x3c0816=this;for(var _0x3da804 in this['channels']){if(this[_0x13ba('0xe')]['hasOwnProperty'](_0x3da804)&&!this['channels'][_0x3da804][_0x13ba('0x35')]){this[_0x13ba('0x36')][_0x13ba('0xb')](function(){if(!_[_0x13ba('0x37')](_0x3c0816[_0x13ba('0xe')][_0x3da804])){return ami['Action']({'action':_0x13ba('0x38'),'channel':_0x3c0816[_0x13ba('0xe')][_0x3da804][_0x13ba('0x39')]})[_0x13ba('0x3a')](function(_0xe5dce1){if(_0xe5dce1[_0x13ba('0x3b')]===_0x13ba('0x3c')){setTimeout(function(){if(_0x3c0816['channels'][_0x3da804]){delete _0x3c0816[_0x13ba('0xe')][_0x3da804];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x3da804,util[_0x13ba('0x3d')](_0xe5dce1,{'showHidden':![],'depth':null}));}if(_0x3c0816[_0x13ba('0x3e')][_0x3da804]){delete _0x3c0816[_0x13ba('0x3e')][_0x3da804];logger[_0x13ba('0x3f')](_0x13ba('0x40'),_0x3da804,util[_0x13ba('0x3d')](_0xe5dce1,{'showHidden':![],'depth':null}));}if(_0x3c0816[_0x13ba('0x41')][_0x3da804]){delete _0x3c0816[_0x13ba('0x41')][_0x3da804];logger['error'](_0x13ba('0x42'),_0x3da804,util['inspect'](_0xe5dce1,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x23')]=function(){logger[_0x13ba('0x3f')](_0x13ba('0x43'));clearChannels(this[_0x13ba('0xe')]);this[_0x13ba('0x44')](this[_0x13ba('0x3e')]);clearAgentBooked(this[_0x13ba('0xd')]);clearVoiceQueues(this[_0x13ba('0xf')]);clearCampaigns(this[_0x13ba('0x11')]);};VoiceQueueReport['prototype'][_0x13ba('0x44')]=function(_0x24fabb){var _0x20e29f=this;if(!_[_0x13ba('0x2e')](_0x24fabb)){for(var _0x56a6ca in _0x24fabb){if(_0x24fabb[_0x13ba('0x2f')](_0x56a6ca)){_0x20e29f['emitVoiceQueueChannelRemove'](_0x24fabb[_0x56a6ca],_0x13ba('0x45'));delete _0x24fabb[_0x56a6ca];}}}};VoiceQueueReport['prototype'][_0x13ba('0x46')]=function(_0x3fa074,_0x445e08,_0x48f569){io['to'](_0x3fa074)[_0x13ba('0x46')](_0x445e08,_0x48f569);};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x47')]=function(_0x13dd50,_0x49d029){logger[_0x13ba('0x48')](_0x13ba('0x49')+_0x49d029+_0x13ba('0x4a'),_0x13dd50['uniqueid'],util[_0x13ba('0x3d')](_0x13dd50,{'showHidden':![],'depth':null}));this[_0x13ba('0x46')](util[_0x13ba('0x4b')](_0x13ba('0x4c'),_0x13dd50[_0x13ba('0x4d')]),_0x13ba('0x4e'),_0x13dd50);io[_0x13ba('0x46')](_0x13ba('0x4f'),_0x13dd50);};VoiceQueueReport['prototype'][_0x13ba('0x50')]=function(_0x36597f,_0x201611){logger[_0x13ba('0x48')]('[%s][voiceQueueReport]['+_0x201611+_0x13ba('0x51'),_0x36597f[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x36597f,{'showHidden':![],'depth':null}));if(_0x36597f[_0x13ba('0x53')]===_0x13ba('0x54'))return;this['emit'](util[_0x13ba('0x4b')](_0x13ba('0x4c'),_0x36597f[_0x13ba('0x4d')]),_0x13ba('0x55'),_0x36597f);io[_0x13ba('0x46')]('voice_queue_presence:remove',_0x36597f);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x36b5ff,_0x1f6096){if(_0x36b5ff[_0x13ba('0x56')]===_0x13ba('0x57')){var _0x2da883={'id':_0x36b5ff['id'],'name':_0x36b5ff[_0x13ba('0x4d')],'strategy':_0x36b5ff[_0x13ba('0x58')],'answered':_0x36b5ff['answered'],'available':_0x36b5ff['available'],'loggedIn':_0x36b5ff[_0x13ba('0x59')],'pTalking':_0x36b5ff[_0x13ba('0x5a')],'sumBillable':_0x36b5ff['sumBillable'],'sumDuration':_0x36b5ff[_0x13ba('0x5b')],'sumHoldTime':_0x36b5ff[_0x13ba('0x5c')]||0x0,'talking':_0x36b5ff[_0x13ba('0x31')],'total':_0x36b5ff[_0x13ba('0x5d')],'type':_0x36b5ff[_0x13ba('0x56')],'unmanaged':_0x36b5ff[_0x13ba('0x5e')],'abandoned':_0x36b5ff[_0x13ba('0x5f')],'waiting':_0x36b5ff[_0x13ba('0x32')]};if(_0x36b5ff[_0x13ba('0x60')]){_0x2da883[_0x13ba('0x60')]={'id':_0x36b5ff[_0x13ba('0x60')]['id'],'name':_0x36b5ff['Trunk'][_0x13ba('0x4d')],'active':_0x36b5ff[_0x13ba('0x60')][_0x13ba('0x61')],'callerid':_0x36b5ff[_0x13ba('0x60')][_0x13ba('0x62')]};}if(_0x36b5ff[_0x13ba('0x63')]){_0x2da883[_0x13ba('0x63')]={'id':_0x36b5ff['Interval']['id'],'name':_0x36b5ff[_0x13ba('0x63')][_0x13ba('0x4d')]};}var _0x587ad5=md5(JSON['stringify'](_0x2da883));if(_0x36b5ff[_0x13ba('0x3')]!==_0x587ad5){_0x36b5ff[_0x13ba('0x3')]=_0x587ad5;logger[_0x13ba('0x48')](_0x13ba('0x64')+_0x1f6096+_0x13ba('0x65'),util[_0x13ba('0x3d')](_0x2da883,{'showHidden':![],'depth':null}));this['emit'](util[_0x13ba('0x4b')](_0x13ba('0x4c'),_0x2da883[_0x13ba('0x4d')]),_0x13ba('0x66'),_0x2da883);}}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x67')]=function(_0x511bcd){return _0x511bcd!==null&&!_[_0x13ba('0x68')](_0x511bcd);};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x2d')]=function(){var _0x5d5fb9=this;setInterval(function(){_0x5d5fb9[_0x13ba('0x34')]();ami['Action']({'action':_0x13ba('0x69')})[_0x13ba('0x3a')](function(_0xc4d302){logger[_0x13ba('0x3f')](_0x13ba('0x6a'),util[_0x13ba('0x3d')](_0xc4d302,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x13ba('0xa')]['loopQueueSummary']=function(){var _0x2d5ebf=this;setInterval(function(){if(_0x2d5ebf[_0x13ba('0x10')]){return ami[_0x13ba('0x6b')]({'action':_0x13ba('0x12')})[_0x13ba('0x6c')](function(){_0x2d5ebf[_0x13ba('0x10')]=![];})[_0x13ba('0x3a')](function(_0x1642f3){logger[_0x13ba('0x3f')]('[voiceQueueReport][queuesummary]',util[_0x13ba('0x3d')](_0x1642f3,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x13')]=function(_0x4fd686){try{if(this[_0x13ba('0x67')](_0x4fd686)&&this[_0x13ba('0x67')](_0x4fd686[_0x13ba('0x6d')])){logger[_0x13ba('0x48')](_0x13ba('0x6e'),util[_0x13ba('0x3d')](_0x4fd686,{'showHidden':![],'depth':null}));if(this[_0x13ba('0xf')][_0x4fd686['queue']]){logger[_0x13ba('0x6f')](_0x13ba('0x70'),_0x4fd686[_0x13ba('0x6d')]);var _0x1d37c6=_[_0x13ba('0x71')](this['channels'],_0x13ba('0x6d'))[_0x4fd686[_0x13ba('0x6d')]]||0x0;var _0x514f0f=_0x1d37c6-_0x4fd686[_0x13ba('0x72')];if(this['voiceQueues'][_0x4fd686['queue']][_0x13ba('0x32')]!==_[_0x13ba('0x73')](_0x4fd686[_0x13ba('0x72')])||this[_0x13ba('0xf')][_0x4fd686[_0x13ba('0x6d')]][_0x13ba('0x59')]!==_[_0x13ba('0x73')](_0x4fd686[_0x13ba('0x74')])||this[_0x13ba('0xf')][_0x4fd686['queue']][_0x13ba('0x75')]!==_[_0x13ba('0x73')](_0x4fd686[_0x13ba('0x75')])||this[_0x13ba('0xf')][_0x4fd686['queue']][_0x13ba('0x31')]!==_0x514f0f){this[_0x13ba('0xf')][_0x4fd686['queue']][_0x13ba('0x32')]=_[_0x13ba('0x73')](_0x4fd686['callers']);this['voiceQueues'][_0x4fd686[_0x13ba('0x6d')]][_0x13ba('0x59')]=_[_0x13ba('0x73')](_0x4fd686[_0x13ba('0x74')]);this[_0x13ba('0xf')][_0x4fd686['queue']]['available']=_['toNumber'](_0x4fd686[_0x13ba('0x75')]);this[_0x13ba('0xf')][_0x4fd686[_0x13ba('0x6d')]][_0x13ba('0x31')]=_0x514f0f>0x0?_0x514f0f:0x0;this[_0x13ba('0xf')][_0x4fd686[_0x13ba('0x6d')]][_0x13ba('0x31')]=this[_0x13ba('0xf')][_0x4fd686[_0x13ba('0x6d')]][_0x13ba('0x31')]>_[_0x13ba('0x73')](_0x4fd686[_0x13ba('0x74')])?_[_0x13ba('0x73')](_0x4fd686[_0x13ba('0x74')]):this[_0x13ba('0xf')][_0x4fd686['queue']][_0x13ba('0x31')];this[_0x13ba('0x76')](this[_0x13ba('0xf')][_0x4fd686[_0x13ba('0x6d')]],'queuesummary');}logger[_0x13ba('0x48')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this['voiceQueues'][_0x4fd686['queue']],{'showHidden':![],'depth':null}));ami[_0x13ba('0x46')]('custom:queuesummary',this[_0x13ba('0xf')][_0x4fd686[_0x13ba('0x6d')]]);}}}catch(_0x57b568){logger['error'](_0x13ba('0x77'),util[_0x13ba('0x3d')](_0x57b568,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x78')]=function(_0x4ae125){logger[_0x13ba('0x48')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x13ba('0x3d')](_0x4ae125,{'showHidden':![],'depth':null}));this[_0x13ba('0x10')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x37a582){try{if(this[_0x13ba('0x67')](_0x37a582)){logger[_0x13ba('0x48')]('[%s][voiceQueueReport][queuecallerjoin]',_0x37a582[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x37a582,{'showHidden':![],'depth':null}));if(_[_0x13ba('0x68')](this[_0x13ba('0x3e')][_0x37a582['uniqueid']]))this[_0x13ba('0x3e')][_0x37a582[_0x13ba('0x52')]]=[];if(_['isUndefined'](this[_0x13ba('0xe')][_0x37a582[_0x13ba('0x52')]]))this[_0x13ba('0xe')][_0x37a582[_0x13ba('0x52')]]={};var _0x36bd6f=new QueueReport();_0x36bd6f['name']=_0x37a582['queue'];_0x36bd6f[_0x13ba('0x56')]=this[_0x13ba('0xf')][_0x36bd6f[_0x13ba('0x4d')]]&&this[_0x13ba('0xf')][_0x36bd6f[_0x13ba('0x4d')]][_0x13ba('0x56')]?this[_0x13ba('0xf')][_0x36bd6f[_0x13ba('0x4d')]][_0x13ba('0x56')]||'inbound':_0x13ba('0x57');_0x36bd6f['queue']=_0x37a582[_0x13ba('0x6d')];_0x36bd6f[_0x13ba('0x79')]=moment()[_0x13ba('0x4b')](_0x13ba('0x7a'));_0x36bd6f[_0x13ba('0x7b')]=_0x37a582[_0x13ba('0x7b')];_0x36bd6f[_0x13ba('0x7c')]=_0x37a582[_0x13ba('0x7c')];_0x36bd6f['uniqueid']=_0x37a582[_0x13ba('0x52')];_0x36bd6f['routealias']=this[_0x13ba('0xe')][_0x37a582[_0x13ba('0x52')]][_0x13ba('0x7d')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x36bd6f['name'],_0x36bd6f[_0x13ba('0x56')]);_['merge'](_0x36bd6f,_[_0x13ba('0x7e')](_0x37a582,_[_0x13ba('0x7f')](_0x36bd6f)));this[_0x13ba('0x3e')][_0x37a582['uniqueid']][_0x13ba('0x80')](_0x36bd6f);this['channels'][_0x37a582['uniqueid']]=_0x36bd6f;this[_0x13ba('0x47')](_0x36bd6f,'queuecallerjoin');}}catch(_0x2fdbd8){logger['error'](_0x13ba('0x81'),_0x37a582[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x2fdbd8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x17')]=function(_0x5ba931){try{if(this[_0x13ba('0x67')](_0x5ba931)){logger['debug'](_0x13ba('0x82'),_0x5ba931['uniqueid'],util[_0x13ba('0x3d')](_0x5ba931,{'showHidden':![],'depth':null}));if(this[_0x13ba('0x3e')][_0x5ba931['uniqueid']]){var _0x380015=_['last'](this['queueReports'][_0x5ba931['uniqueid']]);_0x380015['queuecallercomplete']=![];_0x380015['queuecallercompleteAt']=null;_0x380015['holdtime']=_0x5ba931[_0x13ba('0x83')];_0x380015['originalposition']=_0x5ba931[_0x13ba('0x84')];_0x380015['queuecallerabandon']=!![];_0x380015[_0x13ba('0x85')]=moment()[_0x13ba('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x380015[_0x13ba('0x53')]=_0x13ba('0x86');_0x380015[_0x13ba('0x87')]=null;logger['info'](_0x13ba('0x88'),_0x380015[_0x13ba('0x4d')],_0x380015[_0x13ba('0x56')]);this['channels'][_0x5ba931['uniqueid']]=_0x380015;this[_0x13ba('0x50')](_0x380015,_0x13ba('0x89'));}}}catch(_0x5c1a6a){logger[_0x13ba('0x3f')](_0x13ba('0x82'),_0x5ba931[_0x13ba('0x52')],util['inspect'](_0x5c1a6a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x19')]=function(_0x28c767){try{if(this[_0x13ba('0x67')](_0x28c767)){logger[_0x13ba('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x28c767[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x28c767,{'showHidden':![],'depth':null}));if(this[_0x13ba('0x3e')][_0x28c767[_0x13ba('0x52')]]){var _0x14b105=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x28c767[_0x13ba('0x52')]]);_0x14b105[_0x13ba('0x8b')]=moment()[_0x13ba('0x4b')](_0x13ba('0x7a'));_0x14b105[_0x13ba('0x8c')]=_0x28c767[_0x13ba('0x8c')];_0x14b105['connectedlinename']=_0x28c767['connectedlinename'];logger[_0x13ba('0x6f')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x14b105[_0x13ba('0x4d')],_0x14b105[_0x13ba('0x56')],_0x28c767[_0x13ba('0x8c')],_0x28c767[_0x13ba('0x8d')]);this['channels'][_0x28c767[_0x13ba('0x52')]]=_0x14b105;this['emitVoiceQueueChannelSave'](_0x14b105,_0x13ba('0x8e'));}}}catch(_0x47ce55){logger[_0x13ba('0x3f')](_0x13ba('0x8f'),_0x28c767[_0x13ba('0x52')],util['inspect'](_0x47ce55,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x1d')]=function(_0x360c23){try{if(this[_0x13ba('0x67')](_0x360c23)){logger[_0x13ba('0x48')]('[%s][voiceQueueReport][agentconnect]',_0x360c23['uniqueid'],util[_0x13ba('0x3d')](_0x360c23,{'showHidden':![],'depth':null}));if(this[_0x13ba('0x3e')][_0x360c23[_0x13ba('0x52')]]){var _0x5dfb94=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x360c23['uniqueid']]);_0x5dfb94[_0x13ba('0x90')]=!![];_0x5dfb94[_0x13ba('0x53')]=_0x13ba('0x91');logger[_0x13ba('0x6f')](_0x13ba('0x92'),_0x5dfb94[_0x13ba('0x4d')],_0x5dfb94['type']);}}}catch(_0x334b3e){logger[_0x13ba('0x3f')](_0x13ba('0x93'),_0x360c23[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x334b3e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x13ba('0x1b')]=function(_0x1ac4bc){try{if(this['isNotNull'](_0x1ac4bc)){logger[_0x13ba('0x48')](_0x13ba('0x94'),_0x1ac4bc[_0x13ba('0x52')],util['inspect'](_0x1ac4bc,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1ac4bc[_0x13ba('0x52')]]){var _0x337421=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x1ac4bc[_0x13ba('0x52')]]);_0x337421[_0x13ba('0x89')]=![];_0x337421[_0x13ba('0x85')]=null;_0x337421[_0x13ba('0x95')]=!![];_0x337421[_0x13ba('0x87')]=_0x1ac4bc[_0x13ba('0x96')];_0x337421['holdtime']=_0x1ac4bc[_0x13ba('0x83')];_0x337421[_0x13ba('0x90')]=!![];_0x337421[_0x13ba('0x97')]=![];_0x337421[_0x13ba('0x98')]=null;if(!_0x337421[_0x13ba('0x99')]){if(_0x1ac4bc['reason']==_0x13ba('0x99')){_0x337421[_0x13ba('0x53')]='COMPLETED';logger[_0x13ba('0x6f')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x337421['name'],_0x337421[_0x13ba('0x56')]);}else{if(_[_0x13ba('0x9a')](_0x1ac4bc[_0x13ba('0x39')][_0x13ba('0x9b')](),_0x13ba('0x9c'))){if(this[_0x13ba('0x3e')][_0x1ac4bc[_0x13ba('0x9d')]]){var _0xca425f=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x1ac4bc[_0x13ba('0x9d')]]);_0xca425f[_0x13ba('0x90')]=![];_0xca425f[_0x13ba('0x97')]=!![];_0xca425f[_0x13ba('0x98')]=moment(_0x337421[_0x13ba('0x79')])[_0x13ba('0x9e')](_0x1ac4bc[_0x13ba('0x83')],_0x13ba('0x9f'))[_0x13ba('0x4b')](_0x13ba('0x7a'));_0xca425f[_0x13ba('0x53')]=_0x13ba('0xa0');_0xca425f[_0x13ba('0x99')]=!![];_0xca425f[_0x13ba('0xa1')]=_0x13ba('0xa2');_0xca425f[_0x13ba('0xa3')]=_0x1ac4bc['destexten'];_0xca425f[_0x13ba('0xa4')]=_0x1ac4bc['uniqueid'];logger[_0x13ba('0x6f')](_0x13ba('0xa5'),_0xca425f[_0x13ba('0x4d')],_0xca425f[_0x13ba('0x56')]);var _0x1cca6a=this[_0x13ba('0x3e')][_0x1ac4bc[_0x13ba('0x9d')]];this[_0x13ba('0x3e')][_0x1ac4bc[_0x13ba('0x9d')]]=this[_0x13ba('0x3e')][_0x1ac4bc[_0x13ba('0x52')]];this[_0x13ba('0x3e')][_0x1ac4bc[_0x13ba('0x52')]]=_0x1cca6a;}}else{_0x337421[_0x13ba('0x53')]=_0x13ba('0xa6')+_0x1ac4bc[_0x13ba('0xa7')][_0x13ba('0xa8')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x337421[_0x13ba('0x4d')],_0x337421[_0x13ba('0x56')],_0x337421[_0x13ba('0x53')]);}}}this[_0x13ba('0xe')][_0x1ac4bc['uniqueid']]=_0x337421;this[_0x13ba('0x50')](_0x337421,_0x13ba('0x1a'));}}}catch(_0xc4f6b9){logger[_0x13ba('0x3f')](_0x13ba('0x94'),_0x1ac4bc[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0xc4f6b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x1f')]=function(_0x3196cb){try{if(this[_0x13ba('0x67')](_0x3196cb)){logger['debug'](_0x13ba('0xa9'),_0x3196cb['uniqueid'],util[_0x13ba('0x3d')](_0x3196cb,{'showHidden':![],'depth':null}));this[_0x13ba('0xaa')](_0x3196cb[_0x13ba('0x52')],_[_0x13ba('0x7f')](_0x3196cb[_0x13ba('0xab')])[0x0],_0x3196cb[_0x13ba('0xac')]);if(this[_0x13ba('0x3e')][_0x3196cb[_0x13ba('0x52')]]){var _0x5c73a7=_[_0x13ba('0x8a')](this['queueReports'][_0x3196cb['uniqueid']]);if(_0x5c73a7){if(this[_0x13ba('0x67')](_0x3196cb[_0x13ba('0xab')])&&this[_0x13ba('0x67')](_0x3196cb[_0x13ba('0xab')]['queuestatus'])){switch(_0x3196cb[_0x13ba('0xac')]){case _0x13ba('0xad'):_0x5c73a7[_0x13ba('0x97')]=![];_0x5c73a7[_0x13ba('0x98')]=null;break;case'TIMEOUT':_0x5c73a7['lastevent']=_0x13ba('0xae');_0x5c73a7[_0x13ba('0x97')]=!![];_0x5c73a7[_0x13ba('0x98')]=moment()['format'](_0x13ba('0x7a'));_0x5c73a7[_0x13ba('0x8b')]=moment()[_0x13ba('0x4b')](_0x13ba('0x7a'));logger[_0x13ba('0x48')](_0x13ba('0xaf'),_0x3196cb[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x5c73a7,{'showHidden':![],'depth':null}));ami[_0x13ba('0x46')](_0x13ba('0xb0'),_0x5c73a7);break;default:_0x5c73a7[_0x13ba('0x97')]=!![];_0x5c73a7[_0x13ba('0x98')]=moment()[_0x13ba('0x4b')](_0x13ba('0x7a'));_0x5c73a7[_0x13ba('0x8b')]=moment()[_0x13ba('0x4b')](_0x13ba('0x7a'));}_0x5c73a7[_0x13ba('0x89')]=![];_0x5c73a7[_0x13ba('0x85')]=null;_0x5c73a7[_0x13ba('0x53')]=_0x3196cb[_0x13ba('0xac')];this[_0x13ba('0xe')][_0x3196cb[_0x13ba('0x52')]]=_0x5c73a7;this[_0x13ba('0x50')](_0x5c73a7,_0x13ba('0x1e'));}else if(this[_0x13ba('0x67')](_0x3196cb['variable'])&&this[_0x13ba('0x67')](_0x3196cb[_0x13ba('0xab')][_0x13ba('0xb1')])){if(!_0x5c73a7[_0x13ba('0x89')]){_0x5c73a7[_0x13ba('0x97')]=!![];_0x5c73a7[_0x13ba('0x98')]=moment()[_0x13ba('0x4b')](_0x13ba('0x7a'));_0x5c73a7[_0x13ba('0x53')]=_0x13ba('0xb2');_0x5c73a7[_0x13ba('0x8b')]=moment()['format'](_0x13ba('0x7a'));this['channels'][_0x3196cb['uniqueid']]=_0x5c73a7;}}logger[_0x13ba('0x6f')](_0x13ba('0xb3'),_0x3196cb[_0x13ba('0x52')],_0x5c73a7[_0x13ba('0x4d')],_0x5c73a7[_0x13ba('0x56')],_[_0x13ba('0x7f')](_0x3196cb[_0x13ba('0xab')])[0x0],_0x3196cb[_0x13ba('0xac')]);_0x5c73a7[_0x13ba('0x41')]=this[_0x13ba('0x41')][_0x3196cb['uniqueid']];}}}}catch(_0x191694){logger[_0x13ba('0x3f')](_0x13ba('0xa9'),_0x3196cb['uniqueid'],util[_0x13ba('0x3d')](_0x191694,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')]['addVariable']=function(_0x5eee14,_0x49b9f7,_0xdb0c2b){var _0x1ccef1=[_0x13ba('0xb4'),_0x13ba('0xb5'),_0x13ba('0xb6'),_0x13ba('0xb7'),_0x13ba('0xb8'),_0x13ba('0xb9'),_0x13ba('0xba'),_0x13ba('0xbb'),_0x13ba('0xbc'),_0x13ba('0xbd'),'bridgepeer',_0x13ba('0xbe'),'membercalls','memberdynamic',_0x13ba('0xbf'),_0x13ba('0xc0'),_0x13ba('0x96'),'memberpenalty',_0x13ba('0xc1')];if(!_[_0x13ba('0x37')](_0x49b9f7)&&!_[_0x13ba('0xc2')](_0x1ccef1,_0x49b9f7)){if(_[_0x13ba('0x68')](this[_0x13ba('0x41')][_0x5eee14])){this[_0x13ba('0x41')][_0x5eee14]={};}this[_0x13ba('0x41')][_0x5eee14][_0x49b9f7]=_0xdb0c2b;}};VoiceQueueReport['prototype'][_0x13ba('0x21')]=function(_0x3ca13e){try{if(this[_0x13ba('0x67')](_0x3ca13e)){logger[_0x13ba('0x48')](_0x13ba('0xc3'),_0x3ca13e[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x3ca13e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3ca13e['uniqueid']]){for(var _0xb0bf83=0x0,_0x122f70={};_0xb0bf83<this[_0x13ba('0x3e')][_0x3ca13e[_0x13ba('0x52')]]['length'];_0xb0bf83+=0x1){_0x122f70=this[_0x13ba('0x3e')][_0x3ca13e[_0x13ba('0x52')]][_0xb0bf83];if(this['voiceQueues'][_0x122f70[_0x13ba('0x6d')]]){if(_0x122f70['queuecallerexit']&&_0x122f70['transfer']!=!![]){this[_0x13ba('0xf')][_0x122f70['queue']]['unmanaged']+=0x1;}if(_0x122f70[_0x13ba('0x89')]){this[_0x13ba('0xf')][_0x122f70[_0x13ba('0x6d')]]['abandoned']+=0x1;}this[_0x13ba('0xf')][_0x122f70[_0x13ba('0x6d')]][_0x13ba('0x5c')]+=moment(_0x122f70[_0x13ba('0x8b')])['diff'](_0x122f70[_0x13ba('0x79')],_0x13ba('0x9f'))||0x0;if(_0xb0bf83===this['queueReports'][_0x3ca13e['uniqueid']]['length']-0x1){this[_0x13ba('0xf')][_0x122f70[_0x13ba('0x6d')]][_0x13ba('0x5b')]+=moment()[_0x13ba('0xc4')](0x0)['diff'](_0x122f70[_0x13ba('0x79')],_0x13ba('0x9f'));this['voiceQueues'][_0x122f70[_0x13ba('0x6d')]][_0x13ba('0x5d')]+=0x1;if(_0x122f70[_0x13ba('0x90')]){this[_0x13ba('0xf')][_0x122f70['queue']][_0x13ba('0xc5')]+=0x1;this['voiceQueues'][_0x122f70['queue']]['sumBillable']+=moment()[_0x13ba('0xc4')](0x0)[_0x13ba('0xc6')](_0x122f70['queuecallerleaveAt'],_0x13ba('0x9f'));_0x122f70[_0x13ba('0xc7')]=moment()[_0x13ba('0x4b')](_0x13ba('0x7a'));_0x122f70[_0x13ba('0x97')]=![];_0x122f70['queuecallerexitAt']=null;}if(_0x122f70[_0x13ba('0x97')]&&_0x122f70[_0x13ba('0x99')]!=!![]){_0x122f70[_0x13ba('0xc8')]=_0x13ba('0x5e');logger['debug'](_0x13ba('0xc9'),_0x3ca13e[_0x13ba('0x52')],util['inspect'](_0x122f70,{'showHidden':![],'depth':null}));ami[_0x13ba('0x46')](_0x13ba('0xca'),_0x122f70);}if(_0x122f70['queuecallerabandon']){_0x122f70[_0x13ba('0xc8')]=_0x13ba('0x5f');logger[_0x13ba('0x48')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x3ca13e['uniqueid'],util['inspect'](_0x122f70,{'showHidden':![],'depth':null}));ami[_0x13ba('0x46')](_0x13ba('0xcb'),_0x122f70);}}else{this[_0x13ba('0xf')][_0x122f70[_0x13ba('0x6d')]]['sumDuration']+=this[_0x13ba('0xf')][_0x122f70[_0x13ba('0x6d')]][_0x13ba('0x5c')];}logger[_0x13ba('0x6f')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x3ca13e[_0x13ba('0x52')],_0x122f70[_0x13ba('0x4d')],_0x122f70[_0x13ba('0x56')],_0x3ca13e['cause-txt']);this[_0x13ba('0xe')][_0x3ca13e[_0x13ba('0x52')]]=_0x122f70;this[_0x13ba('0x50')](_0x122f70,'hangup');this['emitVoiceQueueSummary'](this[_0x13ba('0xf')][_0x122f70[_0x13ba('0x6d')]],'hangup');}}logger[_0x13ba('0x48')](_0x13ba('0xcc'),_0x3ca13e[_0x13ba('0x52')],util[_0x13ba('0x3d')](this[_0x13ba('0x3e')][_0x3ca13e[_0x13ba('0x52')]],{'showHidden':![],'depth':null}));ami[_0x13ba('0x46')](_0x13ba('0xcd'),this[_0x13ba('0x3e')][_0x3ca13e['uniqueid']]);if(_0x122f70[_0x13ba('0x53')]===_0x13ba('0x54'))return;delete this[_0x13ba('0x3e')][_0x3ca13e[_0x13ba('0x52')]];delete this[_0x13ba('0xe')][_0x3ca13e[_0x13ba('0x52')]];}if(this[_0x13ba('0x41')][_0x3ca13e[_0x13ba('0x52')]]){delete this[_0x13ba('0x41')][_0x3ca13e[_0x13ba('0x52')]];}}}catch(_0x47526d){logger[_0x13ba('0x3f')](_0x13ba('0xc3'),_0x3ca13e[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x47526d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x29')]=function(_0x144f55){try{if(this[_0x13ba('0x67')](_0x144f55)){logger[_0x13ba('0x48')](_0x13ba('0xce'),_0x144f55[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x144f55,{'showHidden':![],'depth':null}));var _0x4bd4e0;var _0x7f9783;var _0x1f399c;if(this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xcf')]]){_0x4bd4e0=_['last'](this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xcf')]]);_0x4bd4e0[_0x13ba('0xa3')]=_0x144f55[_0x13ba('0xd0')];_0x4bd4e0['transferuniqueid']=_0x144f55[_0x13ba('0xd1')];_0x4bd4e0[_0x13ba('0x53')]=_0x13ba('0x54');_0x4bd4e0[_0x13ba('0x99')]=!![];_0x4bd4e0[_0x13ba('0xa1')]='ATTENDED';if(this['queueReports'][_0x144f55[_0x13ba('0xd1')]]){_0x1f399c=this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd1')]];this['queueReports'][_0x144f55[_0x13ba('0xd1')]]=this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xcf')]];this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xcf')]]=_0x1f399c;_0x7f9783=_[_0x13ba('0x8a')](this['queueReports'][_0x144f55[_0x13ba('0xcf')]]);_0x7f9783[_0x13ba('0x35')]=!![];}logger[_0x13ba('0x6f')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x144f55[_0x13ba('0x52')],_0x4bd4e0[_0x13ba('0x4d')],_0x4bd4e0[_0x13ba('0x56')],_0x4bd4e0[_0x13ba('0xa3')],_0x4bd4e0['transferuniqueid']);}else if(this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd2')]]){_0x4bd4e0=_['last'](this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd2')]]);_0x4bd4e0[_0x13ba('0xa3')]=_0x144f55['origtransfererexten'];_0x4bd4e0[_0x13ba('0xa4')]=_0x144f55[_0x13ba('0xd3')];_0x4bd4e0['queuecallerexitreason']=_0x13ba('0x54');_0x4bd4e0[_0x13ba('0x99')]=!![];_0x4bd4e0[_0x13ba('0xa1')]=_0x13ba('0xd4');if(this['queueReports'][_0x144f55['origtransfereruniqueid']]){_0x1f399c=this[_0x13ba('0x3e')][_0x144f55['origtransfereruniqueid']];this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd3')]]=this['queueReports'][_0x144f55[_0x13ba('0xd2')]];this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd2')]]=_0x1f399c;_0x7f9783=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd2')]]);_0x7f9783['switch']=!![];}logger[_0x13ba('0x6f')](_0x13ba('0xd5'),_0x144f55[_0x13ba('0x52')],_0x4bd4e0[_0x13ba('0x4d')],_0x4bd4e0['type'],_0x4bd4e0[_0x13ba('0xa3')],_0x4bd4e0['transferuniqueid']);}else if(this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd3')]]){_0x4bd4e0=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd3')]]);_0x4bd4e0[_0x13ba('0xa3')]=_0x144f55[_0x13ba('0xd6')];_0x4bd4e0[_0x13ba('0xa4')]=_0x144f55['origtransfereruniqueid'];_0x4bd4e0[_0x13ba('0x53')]=_0x13ba('0x54');_0x4bd4e0[_0x13ba('0x99')]=!![];_0x4bd4e0[_0x13ba('0xa1')]='ATTENDED';}else if(this[_0x13ba('0x3e')][_0x144f55[_0x13ba('0xd1')]]){_0x4bd4e0=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x144f55['secondtransfereruniqueid']]);_0x4bd4e0[_0x13ba('0xa3')]=_0x144f55[_0x13ba('0xd0')];_0x4bd4e0[_0x13ba('0xa4')]=_0x144f55[_0x13ba('0xd1')];_0x4bd4e0['queuecallerexitreason']=_0x13ba('0x54');_0x4bd4e0[_0x13ba('0x99')]=!![];_0x4bd4e0['transfertype']=_0x13ba('0xd4');}}}catch(_0x1f5d5d){logger[_0x13ba('0x3f')](_0x13ba('0xce'),_0x144f55[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x1f5d5d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x2b')]=function(_0xc1ecb9){try{if(this[_0x13ba('0x67')](_0xc1ecb9)){logger['debug']('[%s][voiceQueueReport][blindtransfer]',_0xc1ecb9[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0xc1ecb9,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xc1ecb9['transfereeuniqueid']]){var _0x36b3c6=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0xc1ecb9[_0x13ba('0xcf')]]);_0x36b3c6['queuecallerexitreason']=_0x13ba('0xd7');_0x36b3c6[_0x13ba('0x99')]=!![];_0x36b3c6['transfertype']=_0x13ba('0xd8');_0x36b3c6[_0x13ba('0xa3')]=_0xc1ecb9[_0x13ba('0xd9')];_0x36b3c6[_0x13ba('0xa4')]=_0xc1ecb9[_0x13ba('0xcf')];logger[_0x13ba('0x6f')](_0x13ba('0xda'),_0xc1ecb9[_0x13ba('0x52')],_0x36b3c6[_0x13ba('0x4d')],_0x36b3c6[_0x13ba('0x56')],_0x36b3c6[_0x13ba('0xa3')],_0x36b3c6[_0x13ba('0xa4')]);this[_0x13ba('0x21')]({'event':'BlindTransfer','uniqueid':_0xc1ecb9[_0x13ba('0xcf')],'context':_0xc1ecb9[_0x13ba('0xdb')],'channel':_0xc1ecb9[_0x13ba('0xdc')]});}}}catch(_0x1f1bcd){logger[_0x13ba('0x3f')](_0x13ba('0xdd'),_0xc1ecb9['uniqueid'],util[_0x13ba('0x3d')](_0x1f1bcd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')]['syncMusicOnHoldStart']=function(_0x91f04d){try{if(this[_0x13ba('0x67')](_0x91f04d)){logger[_0x13ba('0x48')](_0x13ba('0xde'),_0x91f04d['uniqueid'],util[_0x13ba('0x3d')](_0x91f04d,{'showHidden':![],'depth':null}));if(this[_0x13ba('0x3e')][_0x91f04d[_0x13ba('0x52')]]){var _0x4b433d=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x91f04d[_0x13ba('0x52')]]);if(!_[_0x13ba('0x37')](_0x4b433d[_0x13ba('0x8b')])){_0x4b433d[_0x13ba('0xdf')]=moment()[_0x13ba('0x4b')](_0x13ba('0x7a'));logger[_0x13ba('0x6f')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x91f04d[_0x13ba('0x52')],_0x4b433d[_0x13ba('0xdf')]);}}}}catch(_0xfe36d0){logger[_0x13ba('0x3f')]('[%s][voiceQueueReport][musiconholdstart]',_0x91f04d[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0xfe36d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0x27')]=function(_0x211975){try{if(this[_0x13ba('0x67')](_0x211975)){logger['debug'](_0x13ba('0xe0'),_0x211975[_0x13ba('0x52')],util[_0x13ba('0x3d')](_0x211975,{'showHidden':![],'depth':null}));if(this[_0x13ba('0x3e')][_0x211975[_0x13ba('0x52')]]){var _0x13858d=_[_0x13ba('0x8a')](this[_0x13ba('0x3e')][_0x211975[_0x13ba('0x52')]]);if(!_['isNil'](_0x13858d[_0x13ba('0xdf')])){_0x13858d[_0x13ba('0xe1')]+=moment()[_0x13ba('0xc4')](0x0)['diff'](_0x13858d[_0x13ba('0xdf')],_0x13ba('0x9f'));logger['info'](_0x13ba('0xe2'),_0x211975['uniqueid'],_0x13858d['mohtime']);delete _0x13858d[_0x13ba('0xdf')];}}}}catch(_0xa9badf){logger['error'](_0x13ba('0xe0'),_0x211975['uniqueid'],util[_0x13ba('0x3d')](_0xa9badf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13ba('0xa')][_0x13ba('0xe3')]=function(_0x2277d2){try{if(this[_0x13ba('0x67')](_0x2277d2)){logger[_0x13ba('0x48')](_0x13ba('0xe4'),_0x2277d2[_0x13ba('0x52')],util['inspect'](_0x2277d2,{'showHidden':![],'depth':null}));if(_0x2277d2[_0x13ba('0xe5')][_0x13ba('0x9b')]()==='set'){_0x2277d2[_0x13ba('0xe6')]=_0x2277d2[_0x13ba('0xe7')]&&_0x2277d2[_0x13ba('0xe7')][_0x13ba('0x9a')](_0x13ba('0xe8'))?_0x2277d2[_0x13ba('0xe7')]:(_0x2277d2['appdata']||_0x2277d2[_0x13ba('0xe6')])[_0x13ba('0x9b')]();if(_[_0x13ba('0x9a')](_0x2277d2[_0x13ba('0xe6')][_0x13ba('0x9b')](),_0x13ba('0xe9'))){logger[_0x13ba('0x6f')](_0x13ba('0xea'),_0x2277d2[_0x13ba('0x52')],_0x2277d2[_0x13ba('0xe5')],_0x2277d2[_0x13ba('0xe6')]);if(_[_0x13ba('0x68')](this[_0x13ba('0xe')][_0x2277d2['uniqueid']]))this['channels'][_0x2277d2[_0x13ba('0x52')]]={};var _0x54a0d7=_0x2277d2[_0x13ba('0xe6')][_0x13ba('0xeb')]('=');var _0x2337d5=_0x54a0d7[0x0][_0x13ba('0x9b')]()[_0x13ba('0xec')](/cdr\((.*)\)/);if(_0x2337d5)this[_0x13ba('0xe')][_0x2277d2['uniqueid']][_0x2337d5[0x1]]=_0x54a0d7[0x1];}}}}catch(_0x24310f){logger[_0x13ba('0x3f')]('[%s][voiceQueueReport][newexten]',_0x2277d2[_0x13ba('0x52')],util['inspect'](_0x24310f,{'showHidden':![],'depth':null}));}};module[_0x13ba('0xed')]=VoiceQueueReport;
\ No newline at end of file
index fc7b3eb..40e70a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b6=['Request','CreateReportAgentPreview','../client','campaign','queue'];(function(_0x1ed8d0,_0x7684b5){var _0x2b2826=function(_0x570b3c){while(--_0x570b3c){_0x1ed8d0['push'](_0x1ed8d0['shift']());}};_0x2b2826(++_0x7684b5);}(_0x32b6,0x1e2));var _0x632b=function(_0x3cbe70,_0x14715a){_0x3cbe70=_0x3cbe70-0x0;var _0x4d93f0=_0x32b6[_0x3cbe70];return _0x4d93f0;};'use strict';var client=require(_0x632b('0x0'));exports['createHistory']=function(_0x359b2c){return function(){_0x359b2c[_0x632b('0x1')]=_0x359b2c[_0x632b('0x2')];return client[_0x632b('0x3')](_0x632b('0x4'),{'body':_0x359b2c,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
+var _0xf4ef=['campaign','CreateReportAgentPreview','../client'];(function(_0x2831d7,_0x493266){var _0x3a2534=function(_0x45192a){while(--_0x45192a){_0x2831d7['push'](_0x2831d7['shift']());}};_0x3a2534(++_0x493266);}(_0xf4ef,0x1e8));var _0xff4e=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0xf4ef[_0x100682];return _0xcb6e87;};'use strict';var client=require(_0xff4e('0x0'));exports['createHistory']=function(_0x475e92){return function(){_0x475e92[_0xff4e('0x1')]=_0x475e92['queue'];return client['Request'](_0xff4e('0x2'),{'body':_0x475e92,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index d5110c5..2d0ba13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe172=['create','Request','CreateAttachment','../client'];(function(_0x566e0f,_0x45e242){var _0x347da6=function(_0xe66f74){while(--_0xe66f74){_0x566e0f['push'](_0x566e0f['shift']());}};_0x347da6(++_0x45e242);}(_0xe172,0x1bb));var _0x2e17=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xe172[_0x5ddaac];return _0x2a9c58;};'use strict';var client=require(_0x2e17('0x0'));exports[_0x2e17('0x1')]=function(_0x48a99f){return client[_0x2e17('0x2')](_0x2e17('0x3'),{'body':_0x48a99f,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0x0e16=['create','Request','CreateAttachment','../client'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0e16,0x183));var _0x60e1=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x0e16[_0x433a86];return _0x23000c;};'use strict';var client=require(_0x60e1('0x0'));exports[_0x60e1('0x1')]=function(_0x44a182){return client[_0x60e1('0x2')](_0x60e1('0x3'),{'body':_0x44a182,'log':_0x60e1('0x3')});};
\ No newline at end of file
index 6b6f2f5..e7aa037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x1bd0c4,_0x2405e0){var _0x13a3af=function(_0xe18df9){while(--_0xe18df9){_0x1bd0c4['push'](_0x1bd0c4['shift']());}};_0x13a3af(++_0x2405e0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'active','limitCalls','dialOriginateCallerIdName',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'dialGlobalMaxRetry','dialNoSuchNumberMaxRetry',_0xac4a('0xe'),_0xac4a('0xf'),_0xac4a('0x10'),'dialAbandonedMaxRetry',_0xac4a('0x11'),_0xac4a('0x12'),_0xac4a('0x13'),'dialAgentRejectMaxRetry',_0xac4a('0x14'),'dialTimezone',_0xac4a('0x15'),'dialAMDActive',_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x18'),'dialAMDTotalAnalysisTime',_0xac4a('0x19'),_0xac4a('0x1a'),_0xac4a('0x1b'),_0xac4a('0x1c'),_0xac4a('0x1d'),_0xac4a('0x1e'),_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21')],'include':[{'model':_0xac4a('0x22'),'as':_0xac4a('0x22'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0x23')]},{'model':_0xac4a('0x22'),'as':_0xac4a('0x24'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x25'),_0xac4a('0x23')]},{'model':_0xac4a('0x26'),'as':_0xac4a('0x26'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xac4a('0x27'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x28')]}]},{'model':'SquareProject','as':_0xac4a('0x29'),'attributes':['id',_0xac4a('0x4')]}]},'log':_0xac4a('0x2a')});};};
\ No newline at end of file
+var _0x1261=['Interval','interval','SquareProject','getCampaign','getCampaigns','Request','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','TrunkBackup','callerid'];(function(_0x426541,_0x4648d6){var _0x3631e4=function(_0x36aa14){while(--_0x36aa14){_0x426541['push'](_0x426541['shift']());}};_0x3631e4(++_0x4648d6);}(_0x1261,0x144));var _0x1126=function(_0x19997d,_0x2c92a4){_0x19997d=_0x19997d-0x0;var _0x49be7f=_0x1261[_0x19997d];return _0x49be7f;};'use strict';var client=require('../client');exports[_0x1126('0x0')]=function(){return function(){return client[_0x1126('0x1')](_0x1126('0x2'),{'options':{'raw':![],'attributes':['id',_0x1126('0x3'),_0x1126('0x4'),_0x1126('0x5'),_0x1126('0x6'),_0x1126('0x7'),_0x1126('0x8'),_0x1126('0x9'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x1126('0xa'),_0x1126('0xb'),'dialNoAnswerMaxRetry',_0x1126('0xc'),_0x1126('0xd'),_0x1126('0xe'),_0x1126('0xf'),_0x1126('0x10'),'dialDropRetryFrequency',_0x1126('0x11'),_0x1126('0x12'),_0x1126('0x13'),'dialMachineRetryFrequency',_0x1126('0x14'),'dialAgentRejectRetryFrequency','dialTimezone',_0x1126('0x15'),'dialAMDActive',_0x1126('0x16'),_0x1126('0x17'),_0x1126('0x18'),_0x1126('0x19'),_0x1126('0x1a'),_0x1126('0x1b'),_0x1126('0x1c'),_0x1126('0x1d'),_0x1126('0x1e'),'dialOrderByScheduledAt','dialPrefix',_0x1126('0x1f'),_0x1126('0x20')],'include':[{'model':_0x1126('0x21'),'as':'Trunk','attributes':['id',_0x1126('0x3'),'callerid',_0x1126('0x5')]},{'model':_0x1126('0x21'),'as':_0x1126('0x22'),'attributes':['id','name',_0x1126('0x23'),_0x1126('0x5')]},{'model':'Interval','as':'Interval','attributes':['id',_0x1126('0x3')],'include':[{'model':_0x1126('0x24'),'as':'Intervals','attributes':['id','name',_0x1126('0x25')]}]},{'model':'SquareProject','as':_0x1126('0x26'),'attributes':['id',_0x1126('0x3')]}]},'log':_0x1126('0x27')});};};
\ No newline at end of file
index a310d39..1ef9f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd327=['CreateCmContact','getContacts','Request','GetCmContact','../client','createContact'];(function(_0x45650b,_0x1d6e92){var _0x186b02=function(_0x132274){while(--_0x132274){_0x45650b['push'](_0x45650b['shift']());}};_0x186b02(++_0x1d6e92);}(_0xd327,0xac));var _0x7d32=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd327[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7d32('0x0'));exports[_0x7d32('0x1')]=function(_0x1a3e96){return function(){return client['Request'](_0x7d32('0x2'),{'body':_0x1a3e96,'log':'CreateCmContact'});};};exports[_0x7d32('0x3')]=function(_0x3386d0){return function(){return client[_0x7d32('0x4')](_0x7d32('0x5'),{'options':_0x3386d0,'log':_0x7d32('0x5')});};};
\ No newline at end of file
+var _0xe5c6=['../client','createContact','Request','CreateCmContact','getContacts','GetCmContact'];(function(_0x1795ea,_0xe043c1){var _0x518895=function(_0x1280e6){while(--_0x1280e6){_0x1795ea['push'](_0x1795ea['shift']());}};_0x518895(++_0xe043c1);}(_0xe5c6,0x1c2));var _0x6e5c=function(_0x11d138,_0x42b14e){_0x11d138=_0x11d138-0x0;var _0x2491d3=_0xe5c6[_0x11d138];return _0x2491d3;};'use strict';var client=require(_0x6e5c('0x0'));exports[_0x6e5c('0x1')]=function(_0x3a63c5){return function(){return client[_0x6e5c('0x2')](_0x6e5c('0x3'),{'body':_0x3a63c5,'log':_0x6e5c('0x3')});};};exports[_0x6e5c('0x4')]=function(_0x1898b3){return function(){return client[_0x6e5c('0x2')](_0x6e5c('0x5'),{'options':_0x1898b3,'log':'GetCmContact'});};};
\ No newline at end of file
index 9013464..f9187e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc909=['getContactDialerIvr','campaign','queue','MoveContactManagedDialer','ContactId','ListId','countReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','name','voicePause','db.CmHopper.UserId','resetActiveCalls','handlePreviewRecallNotifications','../client','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','rescheduleContact','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat','ASC'];(function(_0x58cb8f,_0x5629ac){var _0x5468c2=function(_0x47d8e3){while(--_0x47d8e3){_0x58cb8f['push'](_0x58cb8f['shift']());}};_0x5468c2(++_0x5629ac);}(_0xc909,0xbd));var _0x9c90=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0xc909[_0x59befa];return _0x1dd63d;};'use strict';var client=require(_0x9c90('0x0'));var moment=require('moment');var _=require('lodash');exports[_0x9c90('0x1')]=function(_0x4cdc29,_0x3fce9a){return function(){return client[_0x9c90('0x2')](_0x9c90('0x3'),{'options':{'where':{'VoiceQueueId':_0x4cdc29},'include':[{'model':_0x9c90('0x4'),'as':_0x9c90('0x5')}],'limit':_0x3fce9a,'raw':![]},'log':_0x9c90('0x6')});};};exports[_0x9c90('0x7')]=function(_0x161067,_0x395968,_0x4b9c2d){return function(){return client['Request'](_0x9c90('0x8'),{'body':_0x161067,'options':{'where':{'VoiceQueueId':_0x395968,'scheduledat':{'$lte':moment()[_0x9c90('0x9')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x4b9c2d},'log':'UpdateCmHopper'});};};exports[_0x9c90('0xa')]=function(_0x8cfe22){return function(){return client[_0x9c90('0x2')](_0x9c90('0x8'),{'body':_0x8cfe22,'options':{'where':{'ContactId':_0x8cfe22['ContactId'],'ListId':_0x8cfe22['ListId'],'VoiceQueueId':_0x8cfe22[_0x9c90('0xb')],'CampaignId':_0x8cfe22[_0x9c90('0xc')]}},'log':_0x9c90('0xa')});};};exports[_0x9c90('0xd')]=function(_0x2199ba,_0x2483c7,_0x49de41){return function(){return client[_0x9c90('0x2')](_0x9c90('0xe'),{'options':{'where':{'VoiceQueueId':_0x2199ba,'ListId':_0x2483c7,'ContactId':_0x49de41}},'log':_0x9c90('0xe')});};};exports['getContactDialer']=function(_0x302da0,_0x1e09b1,_0x1006fa,_0x1d7514){return function(){return client[_0x9c90('0x2')](_0x9c90('0xf'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x302da0,'active':![],'scheduledat':{'$lte':moment()[_0x9c90('0x9')](_0x9c90('0x10'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x1e09b1}}]},'order':[[_0x9c90('0x11'),_0x9c90('0x12')],[_0x9c90('0x13'),_0x1d7514],['id',_0x9c90('0x14')]],'raw':!![],'limit':_0x1006fa},'log':'GetContactDialer'});};};exports[_0x9c90('0x15')]=function(_0x4768dc,_0x32c7e0,_0x29ca93){return function(){return client['Request'](_0x9c90('0xf'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x4768dc,'active':![],'scheduledat':{'$lte':moment()[_0x9c90('0x9')](_0x9c90('0x10'))}},'include':[{'model':_0x9c90('0x4'),'as':'Contact'}],'order':[[_0x9c90('0x11'),_0x9c90('0x12')],[_0x9c90('0x13'),_0x29ca93],['id',_0x9c90('0x14')]],'raw':!![],'limit':_0x32c7e0},'log':'GetContactDialerIvr'});};};exports['moveContactManagedDialer']=function(_0x696e9c,_0x394539){return function(){_0x696e9c[_0x9c90('0x16')]=_0x696e9c[_0x9c90('0x17')];return client[_0x9c90('0x2')](_0x9c90('0x18'),{'body':_0x696e9c,'options':{'where':{'ContactId':_0x696e9c[_0x9c90('0x19')],'ListId':_0x696e9c[_0x9c90('0x1a')],'VoiceQueueId':_0x696e9c['VoiceQueueId'],'CampaignId':_0x696e9c[_0x9c90('0xc')],'active':_0x394539?undefined:!![]}},'log':_0x9c90('0x18')});};};exports['countReScheduled']=function(_0x58e444){return function(){return client['Request']('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x58e444['id']?_0x58e444['id']||null:null}},'log':_0x9c90('0x1b')});};};exports[_0x9c90('0x1c')]=function(_0x5043b3){return function(){return client['Request'](_0x9c90('0x1d'),{'options':{'where':{'id':_0x5043b3},'include':[{'model':'CmContact','as':_0x9c90('0x5')},{'model':_0x9c90('0x1e'),'as':_0x9c90('0x1f'),'attributes':['id','name']},{'model':_0x9c90('0x20'),'as':_0x9c90('0x21'),'attributes':['id','name']}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x9c90('0x22')]=function(_0x7cf4c,_0x179545,_0x35458e){return function(){return client[_0x9c90('0x2')](_0x9c90('0x8'),{'body':_0x7cf4c,'options':{'where':{'id':_0x179545},'limit':_0x35458e},'log':_0x9c90('0x8')});};};exports[_0x9c90('0x23')]=function(_0x436548,_0x17a2ac){return function(){return client[_0x9c90('0x2')](_0x9c90('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x436548,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x9c90('0x9')](_0x9c90('0x10'))},'UserId':{'$in':_0x17a2ac}},'order':[[_0x9c90('0x11'),_0x9c90('0x12')],['scheduledat',_0x9c90('0x12')],['id','ASC']],'include':[{'model':_0x9c90('0x4'),'as':'Contact'},{'model':_0x9c90('0x1e'),'as':_0x9c90('0x1f'),'attributes':['id',_0x9c90('0x25'),_0x9c90('0x26')]}],'group':_0x9c90('0x27'),'raw':!![]},'log':'GetContactDialer'});};};exports[_0x9c90('0x28')]=function(_0x373239){return function(){return client[_0x9c90('0x2')]('ResetActiveCalls',{'body':_0x373239,'options':{},'log':'ResetActiveCalls'});};};exports[_0x9c90('0x29')]=function(_0x3eac26,_0x41f986){return function(){return client[_0x9c90('0x2')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueId':_0x3eac26,'interval':_0x41f986}},'log':_0x9c90('0x29')});};};
\ No newline at end of file
+var _0x41b0=['ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','handlePreviewRecallNotifications','moment','lodash','getContacts','Request','CmContact','Contact','getCmHopper','updateContacts','format','YYYY-MM-DD\x20HH:mm:ss','UpdateCmHopper','ContactId','ListId','VoiceQueueId','rescheduleContact','destroyContact','DestroyCmHopper','getContactDialer','priority','DESC','ASC','GetContactDialer','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','unlockContact','getContactRecallMe','GetContactRecallMe','scheduledat','db.CmHopper.UserId'];(function(_0xedc260,_0x31e7c6){var _0x38b4e3=function(_0x18ac70){while(--_0x18ac70){_0xedc260['push'](_0xedc260['shift']());}};_0x38b4e3(++_0x31e7c6);}(_0x41b0,0x122));var _0x041b=function(_0x2d460c,_0x4f08c0){_0x2d460c=_0x2d460c-0x0;var _0xf6fc4c=_0x41b0[_0x2d460c];return _0xf6fc4c;};'use strict';var client=require('../client');var moment=require(_0x041b('0x0'));var _=require(_0x041b('0x1'));exports[_0x041b('0x2')]=function(_0x2db3c8,_0x1bc97f){return function(){return client[_0x041b('0x3')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x2db3c8},'include':[{'model':_0x041b('0x4'),'as':_0x041b('0x5')}],'limit':_0x1bc97f,'raw':![]},'log':_0x041b('0x6')});};};exports[_0x041b('0x7')]=function(_0x14ce0c,_0x478f4e,_0x2539dd){return function(){return client[_0x041b('0x3')]('UpdateCmHopper',{'body':_0x14ce0c,'options':{'where':{'VoiceQueueId':_0x478f4e,'scheduledat':{'$lte':moment()[_0x041b('0x8')](_0x041b('0x9'))}},'limit':_0x2539dd},'log':'UpdateCmHopper'});};};exports['rescheduleContact']=function(_0x388939){return function(){return client['Request'](_0x041b('0xa'),{'body':_0x388939,'options':{'where':{'ContactId':_0x388939[_0x041b('0xb')],'ListId':_0x388939[_0x041b('0xc')],'VoiceQueueId':_0x388939[_0x041b('0xd')],'CampaignId':_0x388939['CampaignId']}},'log':_0x041b('0xe')});};};exports[_0x041b('0xf')]=function(_0x26ce36,_0x286903,_0x2e4828){return function(){return client[_0x041b('0x3')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x26ce36,'ListId':_0x286903,'ContactId':_0x2e4828}},'log':_0x041b('0x10')});};};exports[_0x041b('0x11')]=function(_0x1300bd,_0x508f3c,_0x49c583,_0x509d5a){return function(){return client[_0x041b('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1300bd,'active':![],'scheduledat':{'$lte':moment()[_0x041b('0x8')](_0x041b('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x508f3c}}]},'order':[[_0x041b('0x12'),_0x041b('0x13')],['scheduledat',_0x509d5a],['id',_0x041b('0x14')]],'raw':!![],'limit':_0x49c583},'log':_0x041b('0x15')});};};exports[_0x041b('0x16')]=function(_0x3f793e,_0x496191,_0x56d382){return function(){return client[_0x041b('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x3f793e,'active':![],'scheduledat':{'$lte':moment()[_0x041b('0x8')](_0x041b('0x9'))}},'include':[{'model':'CmContact','as':'Contact'}],'order':[['priority',_0x041b('0x13')],['scheduledat',_0x56d382],['id',_0x041b('0x14')]],'raw':!![],'limit':_0x496191},'log':_0x041b('0x17')});};};exports[_0x041b('0x18')]=function(_0x3a78b5,_0x303283){return function(){_0x3a78b5[_0x041b('0x19')]=_0x3a78b5['queue'];return client[_0x041b('0x3')](_0x041b('0x1a'),{'body':_0x3a78b5,'options':{'where':{'ContactId':_0x3a78b5[_0x041b('0xb')],'ListId':_0x3a78b5[_0x041b('0xc')],'VoiceQueueId':_0x3a78b5['VoiceQueueId'],'CampaignId':_0x3a78b5['CampaignId'],'active':_0x303283?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports['countReScheduled']=function(_0x5d4f57){return function(){return client[_0x041b('0x3')](_0x041b('0x1b'),{'options':{'where':{'VoiceQueueId':_0x5d4f57['id']?_0x5d4f57['id']||null:null}},'log':'countReScheduled'});};};exports[_0x041b('0x1c')]=function(_0x5afe0c){return function(){return client[_0x041b('0x3')](_0x041b('0x1d'),{'options':{'where':{'id':_0x5afe0c},'include':[{'model':_0x041b('0x4'),'as':_0x041b('0x5')},{'model':_0x041b('0x1e'),'as':_0x041b('0x1f'),'attributes':['id',_0x041b('0x20')]},{'model':'VoiceQueue','as':'Queue','attributes':['id',_0x041b('0x20')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x041b('0x21')]=function(_0x20d87c,_0xcde26d,_0x4e4aba){return function(){return client[_0x041b('0x3')](_0x041b('0xa'),{'body':_0x20d87c,'options':{'where':{'id':_0xcde26d},'limit':_0x4e4aba},'log':'UpdateCmHopper'});};};exports[_0x041b('0x22')]=function(_0x3ba655,_0x5f19c5){return function(){return client[_0x041b('0x3')](_0x041b('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3ba655,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x041b('0x8')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x5f19c5}},'order':[['priority',_0x041b('0x13')],[_0x041b('0x24'),_0x041b('0x13')],['id',_0x041b('0x14')]],'include':[{'model':_0x041b('0x4'),'as':'Contact'},{'model':_0x041b('0x1e'),'as':_0x041b('0x1f'),'attributes':['id','name','voicePause']}],'group':_0x041b('0x25'),'raw':!![]},'log':_0x041b('0x15')});};};exports['resetActiveCalls']=function(_0x48f2a7){return function(){return client[_0x041b('0x3')](_0x041b('0x26'),{'body':_0x48f2a7,'options':{},'log':_0x041b('0x26')});};};exports['handlePreviewRecallNotifications']=function(_0xbac56c,_0x1933bc){return function(){return client[_0x041b('0x3')](_0x041b('0x27'),{'body':{'where':{'voiceQueueId':_0xbac56c,'interval':_0x1933bc}},'log':_0x041b('0x28')});};};
\ No newline at end of file
index f0fca8b..3d5b98b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d3=['phone','GetCmHopperBlackIvr','../client','checkIsBlackList','GetCmHopperBlack','VoiceQueueId','Request','CampaignId','Contact'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x69d3,0xda));var _0x369d=function(_0x4778b9,_0x4719bf){_0x4778b9=_0x4778b9-0x0;var _0x22bfef=_0x69d3[_0x4778b9];return _0x22bfef;};'use strict';var client=require(_0x369d('0x0'));exports[_0x369d('0x1')]=function(_0xf1a301){return function(){return client['Request'](_0x369d('0x2'),{'options':{'where':{'VoiceQueueId':_0xf1a301[_0x369d('0x3')],'phone':_0xf1a301['Contact']['phone']},'raw':![]},'log':_0x369d('0x2')});};};exports['checkIsBlackListIvr']=function(_0x56c175){return function(){return client[_0x369d('0x4')](_0x369d('0x2'),{'options':{'where':{'CampaignId':_0x56c175[_0x369d('0x5')],'phone':_0x56c175[_0x369d('0x6')][_0x369d('0x7')]},'raw':![]},'log':_0x369d('0x8')});};};
\ No newline at end of file
+var _0x5eb8=['Request','GetCmHopperBlack','VoiceQueueId','Contact','phone','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr'];(function(_0x70bf5f,_0xed0601){var _0x4bb80c=function(_0x2ce751){while(--_0x2ce751){_0x70bf5f['push'](_0x70bf5f['shift']());}};_0x4bb80c(++_0xed0601);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0x5eb8[_0x5a6961];return _0x4af0a6;};'use strict';var client=require('../client');exports['checkIsBlackList']=function(_0x16de3e){return function(){return client[_0x85eb('0x0')](_0x85eb('0x1'),{'options':{'where':{'VoiceQueueId':_0x16de3e[_0x85eb('0x2')],'phone':_0x16de3e[_0x85eb('0x3')][_0x85eb('0x4')]},'raw':![]},'log':_0x85eb('0x1')});};};exports[_0x85eb('0x5')]=function(_0x3c5798){return function(){return client[_0x85eb('0x0')](_0x85eb('0x1'),{'options':{'where':{'CampaignId':_0x3c5798[_0x85eb('0x6')],'phone':_0x3c5798['Contact'][_0x85eb('0x4')]},'raw':![]},'log':_0x85eb('0x7')});};};
\ No newline at end of file
index 2fbdb96..ddfcda6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66e6=['CreateCmHopperFinal','../client','campaign','queue'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x66e6,0x171));var _0x666e=function(_0x4fed4d,_0x1e7f8b){_0x4fed4d=_0x4fed4d-0x0;var _0x4babd0=_0x66e6[_0x4fed4d];return _0x4babd0;};'use strict';var client=require(_0x666e('0x0'));exports['createContact']=function(_0x4f1fc6){return function(){_0x4f1fc6[_0x666e('0x1')]=_0x4f1fc6[_0x666e('0x2')];return client['Request'](_0x666e('0x3'),{'body':_0x4f1fc6,'log':_0x666e('0x3')});};};
\ No newline at end of file
+var _0x3358=['createContact','campaign','queue','Request','CreateCmHopperFinal','../client'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x3358,0x137));var _0x8335=function(_0x7f0f84,_0x420e7f){_0x7f0f84=_0x7f0f84-0x0;var _0x57da4b=_0x3358[_0x7f0f84];return _0x57da4b;};'use strict';var client=require(_0x8335('0x0'));exports[_0x8335('0x1')]=function(_0x3f0841){return function(){_0x3f0841[_0x8335('0x2')]=_0x3f0841[_0x8335('0x3')];return client[_0x8335('0x4')](_0x8335('0x5'),{'body':_0x3f0841,'log':_0x8335('0x5')});};};
\ No newline at end of file
index 43f03f4..3ccc76c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b30=['startOf','endOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','createHistory','campaign','queue','CreateCmHopperHistory','Request','format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory'];(function(_0x3d6540,_0x21f738){var _0x5274ab=function(_0x248dd4){while(--_0x248dd4){_0x3d6540['push'](_0x3d6540['shift']());}};_0x5274ab(++_0x21f738);}(_0x6b30,0x1e6));var _0x06b3=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0x6b30[_0x9729d7];return _0x3c4ac6;};'use strict';var client=require('../client');var moment=require('moment');exports[_0x06b3('0x0')]=function(_0x4443a2){return function(){_0x4443a2[_0x06b3('0x1')]=_0x4443a2[_0x06b3('0x2')];return client['Request'](_0x06b3('0x3'),{'body':_0x4443a2,'log':'CreateCmHopperHistory'});};};exports['avgHandleTime']=function(_0x307928){return function(){return client[_0x06b3('0x4')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x307928,'minutes')[_0x06b3('0x5')](_0x06b3('0x6')),moment()['format'](_0x06b3('0x6'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports[_0x06b3('0x7')]=function(_0x3fd115){return function(){return client['Request'](_0x06b3('0x8'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x06b3('0x9')]('day')[_0x06b3('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x06b3('0xa')](_0x06b3('0xb'))['format'](_0x06b3('0x6'))]},'campaigntype':_0x06b3('0x2')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0x06b3('0xc')]=function(_0x1077e4){return function(){return client['Request'](_0x06b3('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x06b3('0x9')](_0x06b3('0xb'))[_0x06b3('0x5')](_0x06b3('0x6')),moment()[_0x06b3('0xa')](_0x06b3('0xb'))[_0x06b3('0x5')](_0x06b3('0x6'))]},'campaigntype':_0x06b3('0xe')},'raw':![]},'log':_0x06b3('0xd')});};};
\ No newline at end of file
+var _0xb3c4=['getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','getCampaignHopperHistory','GetCampaignHopperHistory','day','ivr','../client','createHistory','campaign','queue','CreateCmHopperHistory','Request','AvgHandleTime','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory'];(function(_0x2f5c50,_0x3023cb){var _0x2015e0=function(_0x21b7cf){while(--_0x21b7cf){_0x2f5c50['push'](_0x2f5c50['shift']());}};_0x2015e0(++_0x3023cb);}(_0xb3c4,0x1f4));var _0x4b3c=function(_0x431c07,_0x1f3c46){_0x431c07=_0x431c07-0x0;var _0x12864a=_0xb3c4[_0x431c07];return _0x12864a;};'use strict';var client=require(_0x4b3c('0x0'));var moment=require('moment');exports[_0x4b3c('0x1')]=function(_0x93752e){return function(){_0x93752e[_0x4b3c('0x2')]=_0x93752e[_0x4b3c('0x3')];return client['Request'](_0x4b3c('0x4'),{'body':_0x93752e,'log':_0x4b3c('0x4')});};};exports['avgHandleTime']=function(_0x503229){return function(){return client[_0x4b3c('0x5')](_0x4b3c('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x503229,'minutes')[_0x4b3c('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x4b3c('0x7')](_0x4b3c('0x8'))]}},'raw':![]},'log':_0x4b3c('0x9')});};};exports[_0x4b3c('0xa')]=function(_0x2b78f9){return function(){return client['Request'](_0x4b3c('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x4b3c('0xc')]('day')[_0x4b3c('0x7')](_0x4b3c('0x8')),moment()['endOf']('day')[_0x4b3c('0x7')](_0x4b3c('0x8'))]},'campaigntype':_0x4b3c('0x3')},'raw':![]},'log':_0x4b3c('0xb')});};};exports[_0x4b3c('0xd')]=function(_0x3ac473){return function(){return client[_0x4b3c('0x5')](_0x4b3c('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x4b3c('0xc')]('day')['format'](_0x4b3c('0x8')),moment()['endOf'](_0x4b3c('0xf'))[_0x4b3c('0x7')](_0x4b3c('0x8'))]},'campaigntype':_0x4b3c('0x10')},'raw':![]},'log':_0x4b3c('0xe')});};};
\ No newline at end of file
index e5f67c7..69456d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59ac=['faxdetect','tech','ListId','Trunk','active','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name','ecm','headerinfo','minrate','maxrate','modem','gateway'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x59ac,0x73));var _0xc59a=function(_0x41161f,_0x2655f6){_0x41161f=_0x41161f-0x0;var _0x3eb7f7=_0x59ac[_0x41161f];return _0x3eb7f7;};'use strict';var client=require(_0xc59a('0x0'));exports[_0xc59a('0x1')]=function(){return function(){return client[_0xc59a('0x2')](_0xc59a('0x3'),{'options':{'raw':![],'attributes':['id',_0xc59a('0x4'),'description',_0xc59a('0x5'),_0xc59a('0x6'),'localstationid',_0xc59a('0x7'),_0xc59a('0x8'),_0xc59a('0x9'),_0xc59a('0xa'),_0xc59a('0xb'),'t38timeout',_0xc59a('0xc'),'TrunkId',_0xc59a('0xd'),'key'],'include':[{'model':_0xc59a('0xe'),'as':'Trunk','attributes':['id',_0xc59a('0x4'),'callerid',_0xc59a('0xf')]}]},'log':'getFaxAccount'});};};exports[_0xc59a('0x10')]=function(_0x5aeadc,_0x3cfa84){return client[_0xc59a('0x2')](_0xc59a('0x11'),{'account':{'id':_0x5aeadc},'body':_0x3cfa84,'log':'NotifyFaxAccount'});};
\ No newline at end of file
+var _0x5a3c=['Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','name','description','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','key'];(function(_0x10abc8,_0x2a4aa8){var _0x1d0099=function(_0x4d8391){while(--_0x4d8391){_0x10abc8['push'](_0x10abc8['shift']());}};_0x1d0099(++_0x2a4aa8);}(_0x5a3c,0x176));var _0xc5a3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5a3c[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0xc5a3('0x0'));exports[_0xc5a3('0x1')]=function(){return function(){return client[_0xc5a3('0x2')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0xc5a3('0x3'),_0xc5a3('0x4'),'ecm',_0xc5a3('0x5'),_0xc5a3('0x6'),_0xc5a3('0x7'),_0xc5a3('0x8'),_0xc5a3('0x9'),_0xc5a3('0xa'),_0xc5a3('0xb'),_0xc5a3('0xc'),_0xc5a3('0xd'),_0xc5a3('0xe'),_0xc5a3('0xf'),_0xc5a3('0x10')],'include':[{'model':_0xc5a3('0x11'),'as':_0xc5a3('0x11'),'attributes':['id','name',_0xc5a3('0x12'),_0xc5a3('0x13')]}]},'log':_0xc5a3('0x14')});};};exports[_0xc5a3('0x15')]=function(_0x264554,_0x408c07){return client[_0xc5a3('0x2')](_0xc5a3('0x16'),{'account':{'id':_0x264554},'body':_0x408c07,'log':_0xc5a3('0x16')});};
\ No newline at end of file
index 1156360..fea77fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41f4=['update','UpdateFaxMessage'];(function(_0x3633da,_0x5a3c9c){var _0x223e80=function(_0x1f9309){while(--_0x1f9309){_0x3633da['push'](_0x3633da['shift']());}};_0x223e80(++_0x5a3c9c);}(_0x41f4,0xa0));var _0x441f=function(_0x1aa4d3,_0x7e831d){_0x1aa4d3=_0x1aa4d3-0x0;var _0x23941b=_0x41f4[_0x1aa4d3];return _0x23941b;};'use strict';var client=require('../client');exports[_0x441f('0x0')]=function(_0x4f37bd,_0x507dc0){return client['Request'](_0x441f('0x1'),{'body':_0x507dc0,'options':{'where':{'AttachmentId':_0x4f37bd}},'log':_0x441f('0x1')});};
\ No newline at end of file
+var _0xe804=['../client','update','UpdateFaxMessage'];(function(_0x6f05d2,_0x50cdfe){var _0x103911=function(_0x1988cc){while(--_0x1988cc){_0x6f05d2['push'](_0x6f05d2['shift']());}};_0x103911(++_0x50cdfe);}(_0xe804,0x7e));var _0x4e80=function(_0x5510db,_0x910873){_0x5510db=_0x5510db-0x0;var _0x5aa43d=_0xe804[_0x5510db];return _0x5aa43d;};'use strict';var client=require(_0x4e80('0x0'));exports[_0x4e80('0x1')]=function(_0x3261cb,_0xdd7b59){return client['Request']('UpdateFaxMessage',{'body':_0xdd7b59,'options':{'where':{'AttachmentId':_0x3261cb}},'log':_0x4e80('0x2')});};
\ No newline at end of file
index 69c6a44..12c047a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d9d=['GetDeskAccount','name','username','password','authType','type','serverUrl','Configurations','DeskField','Subjects','Variable','Descriptions','content','key','keyType','keyContent','variableName','Fields','idField','Tag','../../client','getDeskAccounts'];(function(_0x4071b3,_0x2f7c41){var _0x59943b=function(_0x1db40f){while(--_0x1db40f){_0x4071b3['push'](_0x4071b3['shift']());}};_0x59943b(++_0x2f7c41);}(_0x2d9d,0x106));var _0xd2d9=function(_0x1d7b16,_0x168739){_0x1d7b16=_0x1d7b16-0x0;var _0x59d484=_0x2d9d[_0x1d7b16];return _0x59d484;};'use strict';var client=require(_0xd2d9('0x0'));exports[_0xd2d9('0x1')]=function(){return function(_0x1b3916){return client['Request'](_0xd2d9('0x2'),{'options':{'raw':![],'attributes':['id',_0xd2d9('0x3'),'description',_0xd2d9('0x4'),_0xd2d9('0x5'),'remoteUri',_0xd2d9('0x6'),_0xd2d9('0x7'),_0xd2d9('0x8')],'include':[{'model':'DeskConfiguration','as':_0xd2d9('0x9'),'attributes':['id',_0xd2d9('0x3')],'include':[{'model':_0xd2d9('0xa'),'as':_0xd2d9('0xb'),'attributes':['id',_0xd2d9('0x7'),'content','variableName'],'include':[{'model':_0xd2d9('0xc'),'as':'Variable','attributes':['id',_0xd2d9('0x3')]}]},{'model':_0xd2d9('0xa'),'as':_0xd2d9('0xd'),'attributes':['id',_0xd2d9('0x7'),_0xd2d9('0xe'),_0xd2d9('0xf'),_0xd2d9('0x10'),_0xd2d9('0x11'),_0xd2d9('0x12')],'include':[{'model':_0xd2d9('0xc'),'as':_0xd2d9('0xc'),'attributes':['id',_0xd2d9('0x3')]}]},{'model':_0xd2d9('0xa'),'as':_0xd2d9('0x13'),'attributes':['id','type','content',_0xd2d9('0x14'),'nameField','customField',_0xd2d9('0x12')],'include':[{'model':_0xd2d9('0xc'),'as':'Variable','attributes':['id',_0xd2d9('0x3')]}]},{'model':_0xd2d9('0x15'),'as':'Tags','attributes':['id','name']}]}]},'log':_0xd2d9('0x2')});};};
\ No newline at end of file
+var _0xa792=['../../client','getDeskAccounts','GetDeskAccount','name','description','password','remoteUri','authType','DeskConfiguration','Configurations','DeskField','type','content','variableName','Variable','Descriptions','key','keyType','Fields','nameField','customField','Tag'];(function(_0x4e2af6,_0x922a5f){var _0x7ca6ef=function(_0x43ace1){while(--_0x43ace1){_0x4e2af6['push'](_0x4e2af6['shift']());}};_0x7ca6ef(++_0x922a5f);}(_0xa792,0xf2));var _0x2a79=function(_0x504691,_0x2d34f4){_0x504691=_0x504691-0x0;var _0x24364c=_0xa792[_0x504691];return _0x24364c;};'use strict';var client=require(_0x2a79('0x0'));exports[_0x2a79('0x1')]=function(){return function(_0x18d8f8){return client['Request'](_0x2a79('0x2'),{'options':{'raw':![],'attributes':['id',_0x2a79('0x3'),_0x2a79('0x4'),'username',_0x2a79('0x5'),_0x2a79('0x6'),_0x2a79('0x7'),'type','serverUrl'],'include':[{'model':_0x2a79('0x8'),'as':_0x2a79('0x9'),'attributes':['id',_0x2a79('0x3')],'include':[{'model':_0x2a79('0xa'),'as':'Subjects','attributes':['id',_0x2a79('0xb'),_0x2a79('0xc'),_0x2a79('0xd')],'include':[{'model':_0x2a79('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':_0x2a79('0xa'),'as':_0x2a79('0xf'),'attributes':['id',_0x2a79('0xb'),'content',_0x2a79('0x10'),_0x2a79('0x11'),'keyContent',_0x2a79('0xd')],'include':[{'model':_0x2a79('0xe'),'as':'Variable','attributes':['id',_0x2a79('0x3')]}]},{'model':_0x2a79('0xa'),'as':_0x2a79('0x12'),'attributes':['id',_0x2a79('0xb'),_0x2a79('0xc'),'idField',_0x2a79('0x13'),_0x2a79('0x14'),_0x2a79('0xd')],'include':[{'model':_0x2a79('0xe'),'as':_0x2a79('0xe'),'attributes':['id',_0x2a79('0x3')]}]},{'model':_0x2a79('0x15'),'as':'Tags','attributes':['id',_0x2a79('0x3')]}]}]},'log':_0x2a79('0x2')});};};
\ No newline at end of file
index 61a2755..cf52555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['customField','CloudProvider','data2','data5','data7','../../client','getDynamics365Accounts','Request','GetDynamics365Account','name','username','password','remoteUri','clientId','description','modernAuthentication','ticketType','Subjects','type','content','variableName','Variable','Dynamics365Field','key','keyType','idField','nameField'];(function(_0x3ad763,_0x575ed1){var _0x59cb84=function(_0x348f7f){while(--_0x348f7f){_0x3ad763['push'](_0x3ad763['shift']());}};_0x59cb84(++_0x575ed1);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x50388b,_0x276225){_0x50388b=_0x50388b-0x0;var _0x6037b=_0xbdb7[_0x50388b];return _0x6037b;};'use strict';var client=require(_0x7bdb('0x0'));exports[_0x7bdb('0x1')]=function(){return function(_0x44467d){return client[_0x7bdb('0x2')](_0x7bdb('0x3'),{'options':{'raw':![],'attributes':['id',_0x7bdb('0x4'),_0x7bdb('0x5'),_0x7bdb('0x6'),_0x7bdb('0x7'),'tenantId',_0x7bdb('0x8'),'clientSecret','serverUrl',_0x7bdb('0x9'),_0x7bdb('0xa')],'include':[{'model':'Dynamics365Configuration','as':'Configurations','attributes':['id',_0x7bdb('0x4'),_0x7bdb('0xb'),'moduleCreate'],'include':[{'model':'Dynamics365Field','as':_0x7bdb('0xc'),'attributes':['id',_0x7bdb('0xd'),_0x7bdb('0xe'),_0x7bdb('0xf')],'include':[{'model':_0x7bdb('0x10'),'as':_0x7bdb('0x10'),'attributes':['id',_0x7bdb('0x4')]}]},{'model':_0x7bdb('0x11'),'as':'Descriptions','attributes':['id','type','content',_0x7bdb('0x12'),_0x7bdb('0x13'),'keyContent',_0x7bdb('0xf')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x7bdb('0x4')]}]},{'model':_0x7bdb('0x11'),'as':'Fields','attributes':['id','type','content',_0x7bdb('0x14'),_0x7bdb('0x15'),_0x7bdb('0x16'),_0x7bdb('0xf')],'include':[{'model':_0x7bdb('0x10'),'as':_0x7bdb('0x10'),'attributes':['id',_0x7bdb('0x4')]}]}]},{'model':_0x7bdb('0x17'),'as':'CloudProvider','attributes':['id',_0x7bdb('0x18'),_0x7bdb('0x19'),_0x7bdb('0x1a')]}]},'log':_0x7bdb('0x3')});};};
\ No newline at end of file
+var _0xa9e0=['key','keyType','keyContent','Dynamics365Field','Fields','idField','customField','CloudProvider','data2','data7','GetDynamics365Account','../../client','getDynamics365Accounts','name','password','remoteUri','tenantId','clientId','clientSecret','description','modernAuthentication','Dynamics365Configuration','ticketType','Subjects','type','content','variableName','Variable'];(function(_0x37e343,_0x5dbfea){var _0xf688dc=function(_0x3b4766){while(--_0x3b4766){_0x37e343['push'](_0x37e343['shift']());}};_0xf688dc(++_0x5dbfea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(_0x29929c){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x0a9e('0x2'),'username',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'serverUrl',_0x0a9e('0x8'),_0x0a9e('0x9')],'include':[{'model':_0x0a9e('0xa'),'as':'Configurations','attributes':['id','name',_0x0a9e('0xb'),'moduleCreate'],'include':[{'model':'Dynamics365Field','as':_0x0a9e('0xc'),'attributes':['id',_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf')],'include':[{'model':_0x0a9e('0x10'),'as':_0x0a9e('0x10'),'attributes':['id','name']}]},{'model':'Dynamics365Field','as':'Descriptions','attributes':['id','type',_0x0a9e('0xe'),_0x0a9e('0x11'),_0x0a9e('0x12'),_0x0a9e('0x13'),_0x0a9e('0xf')],'include':[{'model':_0x0a9e('0x10'),'as':'Variable','attributes':['id',_0x0a9e('0x2')]}]},{'model':_0x0a9e('0x14'),'as':_0x0a9e('0x15'),'attributes':['id',_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0x16'),'nameField',_0x0a9e('0x17'),'variableName'],'include':[{'model':_0x0a9e('0x10'),'as':'Variable','attributes':['id',_0x0a9e('0x2')]}]}]},{'model':_0x0a9e('0x18'),'as':'CloudProvider','attributes':['id',_0x0a9e('0x19'),'data5',_0x0a9e('0x1a')]}]},'log':_0x0a9e('0x1b')});};};
\ No newline at end of file
index b2e7902..f37cfec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c81=['Request','GetFreshdeskAccount','serverUrl','FreshdeskConfiguration','Configurations','name','Tag','FreshdeskField','type','variableName','Variable','Descriptions','content','key','keyType','keyContent','Fields','nameField','../../client','getFreshdeskAccounts'];(function(_0x4135e7,_0x14f68b){var _0x3032f9=function(_0x2b0e42){while(--_0x2b0e42){_0x4135e7['push'](_0x4135e7['shift']());}};_0x3032f9(++_0x14f68b);}(_0x3c81,0x102));var _0x13c8=function(_0x5360f7,_0x59693f){_0x5360f7=_0x5360f7-0x0;var _0x1886de=_0x3c81[_0x5360f7];return _0x1886de;};'use strict';var client=require(_0x13c8('0x0'));exports[_0x13c8('0x1')]=function(){return function(_0x48c35b){return client[_0x13c8('0x2')](_0x13c8('0x3'),{'options':{'raw':![],'attributes':['id','name','username','apiKey','remoteUri',_0x13c8('0x4')],'include':[{'model':_0x13c8('0x5'),'as':_0x13c8('0x6'),'attributes':['id',_0x13c8('0x7')],'include':[{'model':_0x13c8('0x8'),'attributes':['id',_0x13c8('0x7')]},{'model':_0x13c8('0x9'),'as':'Subjects','attributes':['id',_0x13c8('0xa'),'content',_0x13c8('0xb')],'include':[{'model':_0x13c8('0xc'),'as':_0x13c8('0xc'),'attributes':['id',_0x13c8('0x7')]}]},{'model':_0x13c8('0x9'),'as':_0x13c8('0xd'),'attributes':['id',_0x13c8('0xa'),_0x13c8('0xe'),_0x13c8('0xf'),_0x13c8('0x10'),_0x13c8('0x11'),_0x13c8('0xb')],'include':[{'model':_0x13c8('0xc'),'as':_0x13c8('0xc'),'attributes':['id','name']}]},{'model':_0x13c8('0x9'),'as':_0x13c8('0x12'),'attributes':['id',_0x13c8('0xa'),_0x13c8('0xe'),'idField',_0x13c8('0x13'),'customField','variableName'],'include':[{'model':'Variable','as':_0x13c8('0xc'),'attributes':['id','name']}]}]}]},'log':_0x13c8('0x3')});};};
\ No newline at end of file
+var _0x26f9=['content','Variable','key','keyType','keyContent','Fields','variableName','../../client','getFreshdeskAccounts','Request','username','apiKey','serverUrl','FreshdeskConfiguration','Configurations','name','Tag','FreshdeskField','Subjects','type'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x26f9,0x16f));var _0x926f=function(_0x449746,_0x16fda7){_0x449746=_0x449746-0x0;var _0x5be1de=_0x26f9[_0x449746];return _0x5be1de;};'use strict';var client=require(_0x926f('0x0'));exports[_0x926f('0x1')]=function(){return function(_0x4fdca2){return client[_0x926f('0x2')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id','name',_0x926f('0x3'),_0x926f('0x4'),'remoteUri',_0x926f('0x5')],'include':[{'model':_0x926f('0x6'),'as':_0x926f('0x7'),'attributes':['id',_0x926f('0x8')],'include':[{'model':_0x926f('0x9'),'attributes':['id',_0x926f('0x8')]},{'model':_0x926f('0xa'),'as':_0x926f('0xb'),'attributes':['id',_0x926f('0xc'),_0x926f('0xd'),'variableName'],'include':[{'model':_0x926f('0xe'),'as':'Variable','attributes':['id',_0x926f('0x8')]}]},{'model':_0x926f('0xa'),'as':'Descriptions','attributes':['id',_0x926f('0xc'),_0x926f('0xd'),_0x926f('0xf'),_0x926f('0x10'),_0x926f('0x11'),'variableName'],'include':[{'model':_0x926f('0xe'),'as':_0x926f('0xe'),'attributes':['id',_0x926f('0x8')]}]},{'model':_0x926f('0xa'),'as':_0x926f('0x12'),'attributes':['id',_0x926f('0xc'),_0x926f('0xd'),'idField','nameField','customField',_0x926f('0x13')],'include':[{'model':_0x926f('0xe'),'as':_0x926f('0xe'),'attributes':['id',_0x926f('0x8')]}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
index fdee93a..1b649cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd101=['serverUrl','Configurations','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','GetFreshsalesccount','../../client','Request','GetFreshsalesAccount','name','username','apiKey','remoteUri'];(function(_0x777664,_0x367a79){var _0x277e16=function(_0x2d9046){while(--_0x2d9046){_0x777664['push'](_0x777664['shift']());}};_0x277e16(++_0x367a79);}(_0xd101,0xc1));var _0x1d10=function(_0x3afc30,_0x56bc16){_0x3afc30=_0x3afc30-0x0;var _0x4e8b51=_0xd101[_0x3afc30];return _0x4e8b51;};'use strict';var client=require(_0x1d10('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x2ced74){return client[_0x1d10('0x1')](_0x1d10('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d10('0x3'),_0x1d10('0x4'),_0x1d10('0x5'),_0x1d10('0x6'),_0x1d10('0x7')],'include':[{'model':'FreshsalesConfiguration','as':_0x1d10('0x8'),'attributes':['id',_0x1d10('0x3')],'include':[{'model':_0x1d10('0x9'),'as':_0x1d10('0xa'),'attributes':['id',_0x1d10('0xb'),_0x1d10('0xc'),_0x1d10('0xd')],'include':[{'model':_0x1d10('0xe'),'as':_0x1d10('0xe'),'attributes':['id',_0x1d10('0x3')]}]},{'model':_0x1d10('0x9'),'as':_0x1d10('0xf'),'attributes':['id',_0x1d10('0xb'),_0x1d10('0xc'),_0x1d10('0x10'),_0x1d10('0x11'),_0x1d10('0x12'),'variableName'],'include':[{'model':_0x1d10('0xe'),'as':_0x1d10('0xe'),'attributes':['id',_0x1d10('0x3')]}]}]}]},'log':_0x1d10('0x13')});};};
\ No newline at end of file
+var _0x444e=['FreshsalesField','type','variableName','Variable','content','key','keyContent','GetFreshsalesccount','../../client','GetFreshsalesAccount','username','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','name'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0x444e,0xe8));var _0xe444=function(_0x3a0f43,_0x3f1676){_0x3a0f43=_0x3a0f43-0x0;var _0xbef07a=_0x444e[_0x3a0f43];return _0xbef07a;};'use strict';var client=require(_0xe444('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x17e44e){return client['Request'](_0xe444('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xe444('0x2'),'apiKey',_0xe444('0x3'),_0xe444('0x4')],'include':[{'model':_0xe444('0x5'),'as':_0xe444('0x6'),'attributes':['id',_0xe444('0x7')],'include':[{'model':_0xe444('0x8'),'as':'Subjects','attributes':['id',_0xe444('0x9'),'content',_0xe444('0xa')],'include':[{'model':'Variable','as':_0xe444('0xb'),'attributes':['id',_0xe444('0x7')]}]},{'model':_0xe444('0x8'),'as':'Descriptions','attributes':['id','type',_0xe444('0xc'),_0xe444('0xd'),'keyType',_0xe444('0xe'),'variableName'],'include':[{'model':'Variable','as':_0xe444('0xb'),'attributes':['id','name']}]}]}]},'log':_0xe444('0xf')});};};
\ No newline at end of file
index 5ef2d50..08d04bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa282=['additionalSearchAccount','additionalSearchContact','additionalSearchLead','Variable','Descriptions','../../client','Request','name','username','password','remoteUri','clientId','securityToken','type','SalesforceConfiguration','Configurations','moduleSearch','ticketType','leadId'];(function(_0x3aa718,_0x4cc430){var _0xd1dcb0=function(_0x470e1c){while(--_0x470e1c){_0x3aa718['push'](_0x3aa718['shift']());}};_0xd1dcb0(++_0x4cc430);}(_0xa282,0x77));var _0x2a28=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xa282[_0x21549c];return _0x426cbd;};'use strict';var client=require(_0x2a28('0x0'));exports['getSalesforceAccounts']=function(){return function(_0xc46895){return client[_0x2a28('0x1')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0x2a28('0x2'),_0x2a28('0x3'),_0x2a28('0x4'),_0x2a28('0x5'),_0x2a28('0x6'),'clientSecret',_0x2a28('0x7'),'serverUrl',_0x2a28('0x8')],'include':[{'model':_0x2a28('0x9'),'as':_0x2a28('0xa'),'attributes':['id',_0x2a28('0x2'),_0x2a28('0xb'),'moduleCreate',_0x2a28('0xc'),_0x2a28('0xd'),_0x2a28('0xe'),_0x2a28('0xf'),_0x2a28('0x10')],'include':[{'model':'SalesforceField','as':'Subjects','include':[{'model':_0x2a28('0x11'),'as':_0x2a28('0x11'),'attributes':['id',_0x2a28('0x2')]}]},{'model':'SalesforceField','as':_0x2a28('0x12'),'include':[{'model':_0x2a28('0x11'),'as':_0x2a28('0x11'),'attributes':['id','name']}]},{'model':'SalesforceField','as':'Fields','include':[{'model':_0x2a28('0x11'),'as':'Variable','attributes':['id',_0x2a28('0x2')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x2e54=['Variable','Descriptions','Fields','Request','GetSalesforceAccount','name','username','remoteUri','clientId','clientSecret','securityToken','serverUrl','Configurations','moduleCreate','ticketType','leadId','additionalSearchContact','additionalSearchLead','SalesforceField'];(function(_0x4776cc,_0x3a715e){var _0x427bda=function(_0x36b1c7){while(--_0x36b1c7){_0x4776cc['push'](_0x4776cc['shift']());}};_0x427bda(++_0x3a715e);}(_0x2e54,0xc1));var _0x42e5=function(_0x5a3bff,_0x52d07c){_0x5a3bff=_0x5a3bff-0x0;var _0x148b4e=_0x2e54[_0x5a3bff];return _0x148b4e;};'use strict';var client=require('../../client');exports['getSalesforceAccounts']=function(){return function(_0x18f58f){return client[_0x42e5('0x0')](_0x42e5('0x1'),{'options':{'raw':![],'attributes':['id',_0x42e5('0x2'),_0x42e5('0x3'),'password',_0x42e5('0x4'),_0x42e5('0x5'),_0x42e5('0x6'),_0x42e5('0x7'),_0x42e5('0x8'),'type'],'include':[{'model':'SalesforceConfiguration','as':_0x42e5('0x9'),'attributes':['id',_0x42e5('0x2'),'moduleSearch',_0x42e5('0xa'),_0x42e5('0xb'),_0x42e5('0xc'),'additionalSearchAccount',_0x42e5('0xd'),_0x42e5('0xe')],'include':[{'model':_0x42e5('0xf'),'as':'Subjects','include':[{'model':_0x42e5('0x10'),'as':'Variable','attributes':['id',_0x42e5('0x2')]}]},{'model':_0x42e5('0xf'),'as':_0x42e5('0x11'),'include':[{'model':_0x42e5('0x10'),'as':_0x42e5('0x10'),'attributes':['id','name']}]},{'model':_0x42e5('0xf'),'as':_0x42e5('0x12'),'include':[{'model':_0x42e5('0x10'),'as':_0x42e5('0x10'),'attributes':['id',_0x42e5('0x2')]}]}]}]},'log':_0x42e5('0x1')});};};
\ No newline at end of file
index 0b5b98c..08e0625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['Descriptions','content','key','keyType','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','Request','GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','Configurations','ServicenowField','Subjects','type','variableName','Variable'];(function(_0x2ee5e2,_0xc8bb0a){var _0x48920f=function(_0x399841){while(--_0x399841){_0x2ee5e2['push'](_0x2ee5e2['shift']());}};_0x48920f(++_0xc8bb0a);}(_0x4975,0x86));var _0x5497=function(_0x10926b,_0x30717d){_0x10926b=_0x10926b-0x0;var _0x3c7a00=_0x4975[_0x10926b];return _0x3c7a00;};'use strict';var client=require(_0x5497('0x0'));exports['getServicenowAccounts']=function(){return function(_0x474989){return client[_0x5497('0x1')](_0x5497('0x2'),{'options':{'raw':![],'attributes':['id',_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9')],'include':[{'model':'ServicenowConfiguration','as':_0x5497('0xa'),'attributes':['id','name'],'include':[{'model':_0x5497('0xb'),'as':_0x5497('0xc'),'attributes':['id',_0x5497('0xd'),'content',_0x5497('0xe')],'include':[{'model':'Variable','as':_0x5497('0xf'),'attributes':['id',_0x5497('0x3')]}]},{'model':_0x5497('0xb'),'as':_0x5497('0x10'),'attributes':['id',_0x5497('0xd'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0x5497('0xf'),'attributes':['id',_0x5497('0x3')]}]},{'model':_0x5497('0xb'),'as':_0x5497('0x14'),'attributes':['id',_0x5497('0xd'),_0x5497('0x11'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),_0x5497('0xe')],'include':[{'model':'Variable','as':_0x5497('0xf'),'attributes':['id','name']}]}]}]},'log':_0x5497('0x18')});};};
\ No newline at end of file
+var _0x3f8a=['Configurations','ServicenowField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','nameField','../../client','getServicenowAccounts','Request','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration'];(function(_0x57a64b,_0x190489){var _0x1387f7=function(_0x512999){while(--_0x512999){_0x57a64b['push'](_0x57a64b['shift']());}};_0x1387f7(++_0x190489);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x311a70,_0xc12dbb){_0x311a70=_0x311a70-0x0;var _0x2a4abb=_0x3f8a[_0x311a70];return _0x2a4abb;};'use strict';var client=require(_0xa3f8('0x0'));exports[_0xa3f8('0x1')]=function(){return function(_0x29d753){return client[_0xa3f8('0x2')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id',_0xa3f8('0x3'),_0xa3f8('0x4'),_0xa3f8('0x5'),_0xa3f8('0x6'),_0xa3f8('0x7'),_0xa3f8('0x8'),_0xa3f8('0x9')],'include':[{'model':_0xa3f8('0xa'),'as':_0xa3f8('0xb'),'attributes':['id',_0xa3f8('0x3')],'include':[{'model':_0xa3f8('0xc'),'as':_0xa3f8('0xd'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id','name']}]},{'model':_0xa3f8('0xc'),'as':_0xa3f8('0x12'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),'key',_0xa3f8('0x13'),_0xa3f8('0x14'),_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id',_0xa3f8('0x3')]}]},{'model':_0xa3f8('0xc'),'as':_0xa3f8('0x15'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),_0xa3f8('0x16'),_0xa3f8('0x17'),'customField',_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id',_0xa3f8('0x3')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
index 743e526..01d6a2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['serverUrl','SugarcrmConfiguration','SugarcrmField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','remoteUri'];(function(_0x3e76d8,_0x35c413){var _0x42c25b=function(_0x4396bc){while(--_0x4396bc){_0x3e76d8['push'](_0x3e76d8['shift']());}};_0x42c25b(++_0x35c413);}(_0x1967,0x173));var _0x7196=function(_0x2eee68,_0x558822){_0x2eee68=_0x2eee68-0x0;var _0x1cf6d8=_0x1967[_0x2eee68];return _0x1cf6d8;};'use strict';var client=require('../../client');exports[_0x7196('0x0')]=function(){return function(_0xdb72bb){return client[_0x7196('0x1')](_0x7196('0x2'),{'options':{'raw':![],'attributes':['id',_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7')],'include':[{'model':_0x7196('0x8'),'as':'Configurations','attributes':['id',_0x7196('0x3')],'include':[{'model':_0x7196('0x9'),'as':_0x7196('0xa'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd')],'include':[{'model':'Variable','as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0xb'),'content','key',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0x12'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0x13'),'nameField',_0x7196('0x14'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id','name']}]}]}]},'log':_0x7196('0x2')});};};
\ No newline at end of file
+var _0x2ef3=['SugarcrmField','Descriptions','keyType','keyContent','Fields','idField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','password','remoteUri','SugarcrmConfiguration','Configurations','Subjects','type','content','variableName','Variable'];(function(_0xfc0bc,_0x432c2e){var _0x2d9484=function(_0x1474da){while(--_0x1474da){_0xfc0bc['push'](_0xfc0bc['shift']());}};_0x2d9484(++_0x432c2e);}(_0x2ef3,0xba));var _0x32ef=function(_0x4e663d,_0x1bf836){_0x4e663d=_0x4e663d-0x0;var _0x41f051=_0x2ef3[_0x4e663d];return _0x41f051;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(_0x47513a){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),'username',_0x32ef('0x5'),_0x32ef('0x6'),'serverUrl'],'include':[{'model':_0x32ef('0x7'),'as':_0x32ef('0x8'),'attributes':['id','name'],'include':[{'model':'SugarcrmField','as':_0x32ef('0x9'),'attributes':['id',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':_0x32ef('0xd'),'attributes':['id',_0x32ef('0x4')]}]},{'model':_0x32ef('0xe'),'as':_0x32ef('0xf'),'attributes':['id',_0x32ef('0xa'),'content','key',_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':'Variable','attributes':['id',_0x32ef('0x4')]}]},{'model':'SugarcrmField','as':_0x32ef('0x12'),'attributes':['id','type',_0x32ef('0xb'),_0x32ef('0x13'),'nameField','customField',_0x32ef('0xc')],'include':[{'model':'Variable','as':_0x32ef('0xd'),'attributes':['id',_0x32ef('0x4')]}]}]}]},'log':_0x32ef('0x3')});};};
\ No newline at end of file
index fa5f52b..14fe100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4abb=['username','accessKey','remoteUri','Configurations','VtigerField','Subjects','type','content','variableName','Variable','key','keyType','idField','../../client','getVtigerAccounts','GetVtigerAccount','name','description'];(function(_0x63ade5,_0x2c2938){var _0x202824=function(_0x3cdad7){while(--_0x3cdad7){_0x63ade5['push'](_0x63ade5['shift']());}};_0x202824(++_0x2c2938);}(_0x4abb,0x8b));var _0xb4ab=function(_0x25cd9f,_0xf96897){_0x25cd9f=_0x25cd9f-0x0;var _0x5a8d8d=_0x4abb[_0x25cd9f];return _0x5a8d8d;};'use strict';var client=require(_0xb4ab('0x0'));exports[_0xb4ab('0x1')]=function(){return function(_0xc62a0b){return client['Request'](_0xb4ab('0x2'),{'options':{'raw':![],'attributes':['id',_0xb4ab('0x3'),_0xb4ab('0x4'),_0xb4ab('0x5'),_0xb4ab('0x6'),_0xb4ab('0x7'),'serverUrl'],'include':[{'model':'VtigerConfiguration','as':_0xb4ab('0x8'),'attributes':['id','name'],'include':[{'model':_0xb4ab('0x9'),'as':_0xb4ab('0xa'),'attributes':['id',_0xb4ab('0xb'),_0xb4ab('0xc'),_0xb4ab('0xd')],'include':[{'model':_0xb4ab('0xe'),'as':_0xb4ab('0xe'),'attributes':['id',_0xb4ab('0x3')]}]},{'model':_0xb4ab('0x9'),'as':'Descriptions','attributes':['id',_0xb4ab('0xb'),_0xb4ab('0xc'),_0xb4ab('0xf'),_0xb4ab('0x10'),'keyContent',_0xb4ab('0xd')],'include':[{'model':_0xb4ab('0xe'),'as':_0xb4ab('0xe'),'attributes':['id',_0xb4ab('0x3')]}]},{'model':_0xb4ab('0x9'),'as':'Fields','attributes':['id','type',_0xb4ab('0xc'),_0xb4ab('0x11'),'nameField','customField','variableName'],'include':[{'model':_0xb4ab('0xe'),'as':'Variable','attributes':['id',_0xb4ab('0x3')]}]}]}]},'log':_0xb4ab('0x2')});};};
\ No newline at end of file
+var _0xe0fb=['idField','nameField','customField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','description','username','Configurations','VtigerField','Subjects','type','content','variableName','Variable','key','keyType','keyContent','Fields'];(function(_0xba9f86,_0x1e988b){var _0x2a25ce=function(_0x1f47e1){while(--_0x1f47e1){_0xba9f86['push'](_0xba9f86['shift']());}};_0x2a25ce(++_0x1e988b);}(_0xe0fb,0x96));var _0xbe0f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe0fb[_0xfae23b];return _0x200640;};'use strict';var client=require(_0xbe0f('0x0'));exports[_0xbe0f('0x1')]=function(){return function(_0x20e31e){return client[_0xbe0f('0x2')](_0xbe0f('0x3'),{'options':{'raw':![],'attributes':['id',_0xbe0f('0x4'),_0xbe0f('0x5'),_0xbe0f('0x6'),'accessKey','remoteUri','serverUrl'],'include':[{'model':'VtigerConfiguration','as':_0xbe0f('0x7'),'attributes':['id',_0xbe0f('0x4')],'include':[{'model':_0xbe0f('0x8'),'as':_0xbe0f('0x9'),'attributes':['id',_0xbe0f('0xa'),_0xbe0f('0xb'),_0xbe0f('0xc')],'include':[{'model':'Variable','as':_0xbe0f('0xd'),'attributes':['id','name']}]},{'model':_0xbe0f('0x8'),'as':'Descriptions','attributes':['id',_0xbe0f('0xa'),_0xbe0f('0xb'),_0xbe0f('0xe'),_0xbe0f('0xf'),_0xbe0f('0x10'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xbe0f('0x4')]}]},{'model':_0xbe0f('0x8'),'as':_0xbe0f('0x11'),'attributes':['id','type','content',_0xbe0f('0x12'),_0xbe0f('0x13'),_0xbe0f('0x14'),_0xbe0f('0xc')],'include':[{'model':_0xbe0f('0xd'),'as':_0xbe0f('0xd'),'attributes':['id',_0xbe0f('0x4')]}]}]}]},'log':_0xbe0f('0x3')});};};
\ No newline at end of file
index 03be80e..a762842 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bb4=['remoteUri','serverUrl','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','type','variableName','Variable','Descriptions','key','keyType','content','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','token'];(function(_0x166a7f,_0xb37be8){var _0x2718bd=function(_0x2dd5bc){while(--_0x2dd5bc){_0x166a7f['push'](_0x166a7f['shift']());}};_0x2718bd(++_0xb37be8);}(_0x3bb4,0xa2));var _0x43bb=function(_0x2dba75,_0x3d92ee){_0x2dba75=_0x2dba75-0x0;var _0x28e03d=_0x3bb4[_0x2dba75];return _0x28e03d;};'use strict';var client=require(_0x43bb('0x0'));exports[_0x43bb('0x1')]=function(){return function(_0x13206f){return client[_0x43bb('0x2')](_0x43bb('0x3'),{'options':{'raw':![],'attributes':['id',_0x43bb('0x4'),'username','password',_0x43bb('0x5'),_0x43bb('0x6'),'authType',_0x43bb('0x7'),'type'],'include':[{'model':_0x43bb('0x8'),'as':_0x43bb('0x9'),'attributes':['id','name'],'include':[{'model':_0x43bb('0xa'),'attributes':['id',_0x43bb('0x4')]},{'model':_0x43bb('0xb'),'as':_0x43bb('0xc'),'attributes':['id',_0x43bb('0xd'),'content',_0x43bb('0xe')],'include':[{'model':_0x43bb('0xf'),'as':_0x43bb('0xf'),'attributes':['id',_0x43bb('0x4')]}]},{'model':_0x43bb('0xb'),'as':_0x43bb('0x10'),'attributes':['id',_0x43bb('0xd'),'content',_0x43bb('0x11'),_0x43bb('0x12'),'keyContent',_0x43bb('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x43bb('0x4')]}]},{'model':_0x43bb('0xb'),'as':'Fields','attributes':['id','type',_0x43bb('0x13'),'idField','nameField',_0x43bb('0x14'),_0x43bb('0xe')],'include':[{'model':'Variable','as':_0x43bb('0xf'),'attributes':['id','name']}]}]}]},'log':_0x43bb('0x3')});};};
\ No newline at end of file
+var _0xb046=['Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','../../client','Request','GetZendeskAccount','username','token','remoteUri','serverUrl','type','ZendeskConfiguration','name','Tag','ZendeskField','Subjects','content','variableName','Variable'];(function(_0x2803af,_0x2bb475){var _0x5cd13a=function(_0x5a32f1){while(--_0x5a32f1){_0x2803af['push'](_0x2803af['shift']());}};_0x5cd13a(++_0x2bb475);}(_0xb046,0xb0));var _0x6b04=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb046[_0x1fc122];return _0xa2cb13;};'use strict';var client=require(_0x6b04('0x0'));exports['getZendeskAccounts']=function(){return function(_0x5959d6){return client[_0x6b04('0x1')](_0x6b04('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x6b04('0x3'),'password',_0x6b04('0x4'),_0x6b04('0x5'),'authType',_0x6b04('0x6'),_0x6b04('0x7')],'include':[{'model':_0x6b04('0x8'),'as':'Configurations','attributes':['id',_0x6b04('0x9')],'include':[{'model':_0x6b04('0xa'),'attributes':['id','name']},{'model':_0x6b04('0xb'),'as':_0x6b04('0xc'),'attributes':['id',_0x6b04('0x7'),_0x6b04('0xd'),_0x6b04('0xe')],'include':[{'model':'Variable','as':_0x6b04('0xf'),'attributes':['id',_0x6b04('0x9')]}]},{'model':_0x6b04('0xb'),'as':_0x6b04('0x10'),'attributes':['id',_0x6b04('0x7'),_0x6b04('0xd'),_0x6b04('0x11'),_0x6b04('0x12'),_0x6b04('0x13'),'variableName'],'include':[{'model':_0x6b04('0xf'),'as':_0x6b04('0xf'),'attributes':['id','name']}]},{'model':'ZendeskField','as':_0x6b04('0x14'),'attributes':['id',_0x6b04('0x7'),_0x6b04('0xd'),_0x6b04('0x15'),_0x6b04('0x16'),_0x6b04('0x17'),_0x6b04('0xe')],'include':[{'model':_0x6b04('0xf'),'as':_0x6b04('0xf'),'attributes':['id',_0x6b04('0x9')]}]}]}]},'log':_0x6b04('0x2')});};};
\ No newline at end of file
index c3e722d..7dee174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65c7=['Fields','idField','nameField','customField','../../client','getZohoAccounts','Request','GetZohoAccount','name','host','zone','clientId','clientSecret','serverUrl','code','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent'];(function(_0xfd495c,_0x4a3c1a){var _0x561dd8=function(_0x83e915){while(--_0x83e915){_0xfd495c['push'](_0xfd495c['shift']());}};_0x561dd8(++_0x4a3c1a);}(_0x65c7,0xee));var _0x765c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x65c7[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x765c('0x0'));exports[_0x765c('0x1')]=function(){return function(_0x25eb29){return client[_0x765c('0x2')](_0x765c('0x3'),{'options':{'raw':![],'attributes':['id',_0x765c('0x4'),'description',_0x765c('0x5'),_0x765c('0x6'),_0x765c('0x7'),_0x765c('0x8'),_0x765c('0x9'),_0x765c('0xa'),'refreshToken'],'include':[{'model':'ZohoConfiguration','as':'Configurations','attributes':['id',_0x765c('0x4'),_0x765c('0xb'),_0x765c('0xc'),'description'],'include':[{'model':_0x765c('0xd'),'as':_0x765c('0xe'),'attributes':['id',_0x765c('0xf'),_0x765c('0x10'),_0x765c('0x11')],'include':[{'model':_0x765c('0x12'),'as':_0x765c('0x12'),'attributes':['id','name']}]},{'model':'ZohoField','as':_0x765c('0x13'),'attributes':['id',_0x765c('0xf'),_0x765c('0x10'),'key',_0x765c('0x14'),_0x765c('0x15'),_0x765c('0x11')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x765c('0x4')]}]},{'model':_0x765c('0xd'),'as':_0x765c('0x16'),'attributes':['id',_0x765c('0xf'),'content',_0x765c('0x17'),_0x765c('0x18'),_0x765c('0x19'),_0x765c('0x11')],'include':[{'model':_0x765c('0x12'),'as':_0x765c('0x12'),'attributes':['id',_0x765c('0x4')]}]}]}]},'log':_0x765c('0x3')});};};
\ No newline at end of file
+var _0x230d=['idField','getZohoAccounts','Request','GetZohoAccount','name','description','zone','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleSearch','content','variableName','Variable','ZohoField','key','keyType','keyContent','Fields'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x230d,0xdd));var _0xd230=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x230d[_0x42cae2];return _0x5f256f;};'use strict';var client=require('../../client');exports[_0xd230('0x0')]=function(){return function(_0x541135){return client[_0xd230('0x1')](_0xd230('0x2'),{'options':{'raw':![],'attributes':['id',_0xd230('0x3'),_0xd230('0x4'),'host',_0xd230('0x5'),'clientId',_0xd230('0x6'),_0xd230('0x7'),_0xd230('0x8'),_0xd230('0x9')],'include':[{'model':_0xd230('0xa'),'as':_0xd230('0xb'),'attributes':['id','name','moduleCreate',_0xd230('0xc'),_0xd230('0x4')],'include':[{'model':'ZohoField','as':'Subjects','attributes':['id','type',_0xd230('0xd'),_0xd230('0xe')],'include':[{'model':'Variable','as':_0xd230('0xf'),'attributes':['id','name']}]},{'model':_0xd230('0x10'),'as':'Descriptions','attributes':['id','type',_0xd230('0xd'),_0xd230('0x11'),_0xd230('0x12'),_0xd230('0x13'),_0xd230('0xe')],'include':[{'model':'Variable','as':_0xd230('0xf'),'attributes':['id',_0xd230('0x3')]}]},{'model':'ZohoField','as':_0xd230('0x14'),'attributes':['id','type','content',_0xd230('0x15'),'nameField','customField',_0xd230('0xe')],'include':[{'model':_0xd230('0xf'),'as':_0xd230('0xf'),'attributes':['id',_0xd230('0x3')]}]}]}]},'log':_0xd230('0x2')});};};
\ No newline at end of file
index 286c145..71c0e98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd02c=['toNumber','voiceDialReport','voice','TALKING','starttime','endtime','diff','outbound','agent','uniqueid','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','isNil','interface','SIP/%s','seconds','inbound','calleridnum','exten','queue','accountcode'];(function(_0x1a6208,_0x2f830f){var _0x366534=function(_0x48cc10){while(--_0x48cc10){_0x1a6208['push'](_0x1a6208['shift']());}};_0x366534(++_0x2f830f);}(_0xd02c,0x1ba));var _0xcd02=function(_0x43b571,_0x384e1f){_0x43b571=_0x43b571-0x0;var _0x271559=_0xd02c[_0x43b571];return _0x271559;};'use strict';var moment=require(_0xcd02('0x0'));var _=require(_0xcd02('0x1'));var util=require(_0xcd02('0x2'));var client=require(_0xcd02('0x3'));exports['voiceQueueReport']=function(_0x4c3341){var _0x5ab881=_0x4c3341[_0xcd02('0x4')]||_0x4c3341[_0xcd02('0x5')];return client[_0xcd02('0x6')](_0xcd02('0x7'),{'body':{'channel':'voice','membername':_0x4c3341['lastAssignedTo'],'interface':_[_0xcd02('0x8')](_0x4c3341[_0xcd02('0x9')])?util['format'](_0xcd02('0xa'),_0x4c3341['lastAssignedTo']):_0x4c3341['interface'],'type':'TALKING','enterAt':_0x4c3341['queuecallerleaveAt'],'exitAt':_0x5ab881,'duration':moment(_0x5ab881)['diff'](_0x4c3341['queuecallerleaveAt'],_0xcd02('0xb')),'data1':_0xcd02('0xc'),'data2':_0x4c3341[_0xcd02('0xd')],'data3':_0x4c3341[_0xcd02('0xe')],'data4':null,'data5':_0x4c3341[_0xcd02('0xf')],'role':'agent','internal':_0x4c3341[_0xcd02('0x10')]?_[_0xcd02('0x11')](_0x4c3341['accountcode']):undefined,'uniqueid':_0x4c3341['uniqueid']},'log':'CreateMemberReport'});};exports[_0xcd02('0x12')]=function(_0x38c318){return client[_0xcd02('0x6')](_0xcd02('0x7'),{'body':{'channel':_0xcd02('0x13'),'membername':_0x38c318['membername'],'interface':_0x38c318[_0xcd02('0x9')],'type':_0xcd02('0x14'),'enterAt':_0x38c318[_0xcd02('0x15')],'exitAt':_0x38c318[_0xcd02('0x16')],'duration':moment(_0x38c318[_0xcd02('0x16')])[_0xcd02('0x17')](_0x38c318['starttime'],_0xcd02('0xb'))>=0x0?moment(_0x38c318['endtime'])[_0xcd02('0x17')](_0x38c318[_0xcd02('0x15')],'seconds'):null,'data1':_0xcd02('0x18'),'data2':_0x38c318['accountcode'],'data3':_0x38c318[_0xcd02('0xe')],'data4':_0x38c318['dialstring']||null,'role':_0xcd02('0x19'),'internal':_0x38c318[_0xcd02('0x10')]?_['toNumber'](_0x38c318[_0xcd02('0x10')]):undefined,'uniqueid':_0x38c318[_0xcd02('0x1a')]},'log':_0xcd02('0x7')});};
\ No newline at end of file
+var _0xfce1=['voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','format','SIP/%s','interface','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','toNumber','uniqueid','voiceDialReport','membername','endtime','starttime','diff','outbound','accountcode','dialstring','agent','util','../client'];(function(_0x5659f4,_0x3a072a){var _0x18e9a5=function(_0x4816e1){while(--_0x4816e1){_0x5659f4['push'](_0x5659f4['shift']());}};_0x18e9a5(++_0x3a072a);}(_0xfce1,0x166));var _0x1fce=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xfce1[_0x16d10f];return _0x50c823;};'use strict';var moment=require('moment');var _=require('lodash');var util=require(_0x1fce('0x0'));var client=require(_0x1fce('0x1'));exports[_0x1fce('0x2')]=function(_0x5463e5){var _0x665ee5=_0x5463e5['queuecallercompleteAt']||_0x5463e5[_0x1fce('0x3')];return client[_0x1fce('0x4')](_0x1fce('0x5'),{'body':{'channel':_0x1fce('0x6'),'membername':_0x5463e5[_0x1fce('0x7')],'interface':_[_0x1fce('0x8')](_0x5463e5['interface'])?util[_0x1fce('0x9')](_0x1fce('0xa'),_0x5463e5['lastAssignedTo']):_0x5463e5[_0x1fce('0xb')],'type':_0x1fce('0xc'),'enterAt':_0x5463e5[_0x1fce('0xd')],'exitAt':_0x665ee5,'duration':moment(_0x665ee5)['diff'](_0x5463e5[_0x1fce('0xd')],_0x1fce('0xe')),'data1':_0x1fce('0xf'),'data2':_0x5463e5[_0x1fce('0x10')],'data3':_0x5463e5[_0x1fce('0x11')],'data4':null,'data5':_0x5463e5[_0x1fce('0x12')],'role':'agent','internal':_0x5463e5['accountcode']?_[_0x1fce('0x13')](_0x5463e5['accountcode']):undefined,'uniqueid':_0x5463e5[_0x1fce('0x14')]},'log':_0x1fce('0x5')});};exports[_0x1fce('0x15')]=function(_0x2d52b7){return client[_0x1fce('0x4')](_0x1fce('0x5'),{'body':{'channel':_0x1fce('0x6'),'membername':_0x2d52b7[_0x1fce('0x16')],'interface':_0x2d52b7[_0x1fce('0xb')],'type':_0x1fce('0xc'),'enterAt':_0x2d52b7['starttime'],'exitAt':_0x2d52b7[_0x1fce('0x17')],'duration':moment(_0x2d52b7[_0x1fce('0x17')])['diff'](_0x2d52b7[_0x1fce('0x18')],_0x1fce('0xe'))>=0x0?moment(_0x2d52b7[_0x1fce('0x17')])[_0x1fce('0x19')](_0x2d52b7['starttime'],'seconds'):null,'data1':_0x1fce('0x1a'),'data2':_0x2d52b7[_0x1fce('0x1b')],'data3':_0x2d52b7['exten'],'data4':_0x2d52b7[_0x1fce('0x1c')]||null,'role':_0x1fce('0x1d'),'internal':_0x2d52b7[_0x1fce('0x1b')]?_['toNumber'](_0x2d52b7[_0x1fce('0x1b')]):undefined,'uniqueid':_0x2d52b7[_0x1fce('0x14')]},'log':_0x1fce('0x5')});};
\ No newline at end of file
index 8a8d07b..33183e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x112a=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x20f1cd,_0x29fb30){var _0x12b80f=function(_0x36928a){while(--_0x36928a){_0x20f1cd['push'](_0x20f1cd['shift']());}};_0x12b80f(++_0x29fb30);}(_0x112a,0x115));var _0xa112=function(_0x252279,_0x125366){_0x252279=_0x252279-0x0;var _0x5ae0e8=_0x112a[_0x252279];return _0x5ae0e8;};'use strict';var client=require(_0xa112('0x0'));exports[_0xa112('0x1')]=function(){return client[_0xa112('0x2')](_0xa112('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa112('0x4'),_0xa112('0x5')]},'log':_0xa112('0x6')});};
\ No newline at end of file
+var _0x1a4d=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','ShowSetting'];(function(_0x321890,_0x1a63d7){var _0x45350f=function(_0x40ffc4){while(--_0x40ffc4){_0x321890['push'](_0x321890['shift']());}};_0x45350f(++_0x1a63d7);}(_0x1a4d,0x189));var _0xd1a4=function(_0x2a84a2,_0x10d3f1){_0x2a84a2=_0x2a84a2-0x0;var _0x11d91c=_0x1a4d[_0x2a84a2];return _0x11d91c;};'use strict';var client=require(_0xd1a4('0x0'));exports[_0xd1a4('0x1')]=function(){return client['Request'](_0xd1a4('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd1a4('0x3'),_0xd1a4('0x4')]},'log':_0xd1a4('0x5')});};
\ No newline at end of file
index fc67385..5aefc84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38fd=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x4ee27f,_0x13f7a1){var _0x34dd47=function(_0x69708c){while(--_0x69708c){_0x4ee27f['push'](_0x4ee27f['shift']());}};_0x34dd47(++_0x13f7a1);}(_0x38fd,0x117));var _0xd38f=function(_0x283566,_0x45cc7e){_0x283566=_0x283566-0x0;var _0x7dc901=_0x38fd[_0x283566];return _0x7dc901;};'use strict';var client=require(_0xd38f('0x0'));exports[_0xd38f('0x1')]=function(_0x40e1ec){return function(_0x506ad2){return client[_0xd38f('0x2')](_0xd38f('0x3'),{'options':{'raw':!![],'attributes':['id',_0xd38f('0x4'),_0xd38f('0x5')]},'log':'GetTemplate'});};};
\ No newline at end of file
+var _0xdaa8=['../client','getTemplates'];(function(_0x2d242e,_0x1d15bc){var _0x39db01=function(_0x445d89){while(--_0x445d89){_0x2d242e['push'](_0x2d242e['shift']());}};_0x39db01(++_0x1d15bc);}(_0xdaa8,0xe4));var _0x8daa=function(_0x4c7911,_0x4ae3fc){_0x4c7911=_0x4c7911-0x0;var _0x21591d=_0xdaa8[_0x4c7911];return _0x21591d;};'use strict';var client=require(_0x8daa('0x0'));exports[_0x8daa('0x1')]=function(_0x1b558c){return function(_0x1ccee1){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':'GetTemplate'});};};
\ No newline at end of file
index b9ef556..39495c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e2d=['status','AllConditions','field','operator','value','Condition','Action','Actions','action','data1','data3','data5','data6','../client','Request','GetTrigger','name'];(function(_0x486a30,_0x1ebf40){var _0x39520d=function(_0xb54c94){while(--_0xb54c94){_0x486a30['push'](_0x486a30['shift']());}};_0x39520d(++_0x1ebf40);}(_0x0e2d,0x10c));var _0xd0e2=function(_0x2a8b91,_0x25f7f0){_0x2a8b91=_0x2a8b91-0x0;var _0x5ad7c3=_0x0e2d[_0x2a8b91];return _0x5ad7c3;};'use strict';var client=require(_0xd0e2('0x0'));exports['getTriggers']=function(_0x3e1007){return function(_0x4d2778){return client[_0xd0e2('0x1')](_0xd0e2('0x2'),{'options':{'raw':![],'attributes':['id',_0xd0e2('0x3'),'channel',_0xd0e2('0x4')],'include':[{'model':'Condition','as':_0xd0e2('0x5'),'attributes':['id',_0xd0e2('0x6'),_0xd0e2('0x7'),_0xd0e2('0x8')]},{'model':_0xd0e2('0x9'),'as':'AnyConditions','attributes':['id',_0xd0e2('0x6'),_0xd0e2('0x7'),_0xd0e2('0x8')]},{'model':_0xd0e2('0xa'),'as':_0xd0e2('0xb'),'attributes':['id',_0xd0e2('0xc'),_0xd0e2('0xd'),'data2',_0xd0e2('0xe'),'data4',_0xd0e2('0xf'),_0xd0e2('0x10'),'data7']}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0x55b6=['status','Condition','AllConditions','operator','value','AnyConditions','Actions','action','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name'];(function(_0xd73d53,_0x598443){var _0x560148=function(_0x3c8918){while(--_0x3c8918){_0xd73d53['push'](_0xd73d53['shift']());}};_0x560148(++_0x598443);}(_0x55b6,0x19d));var _0x655b=function(_0x3bab6e,_0x42ded4){_0x3bab6e=_0x3bab6e-0x0;var _0x2e393a=_0x55b6[_0x3bab6e];return _0x2e393a;};'use strict';var client=require(_0x655b('0x0'));exports[_0x655b('0x1')]=function(_0x5b1a39){return function(_0x1baf38){return client[_0x655b('0x2')](_0x655b('0x3'),{'options':{'raw':![],'attributes':['id',_0x655b('0x4'),'channel',_0x655b('0x5')],'include':[{'model':_0x655b('0x6'),'as':_0x655b('0x7'),'attributes':['id','field',_0x655b('0x8'),_0x655b('0x9')]},{'model':_0x655b('0x6'),'as':_0x655b('0xa'),'attributes':['id','field',_0x655b('0x8'),'value']},{'model':'Action','as':_0x655b('0xb'),'attributes':['id',_0x655b('0xc'),'data1',_0x655b('0xd'),_0x655b('0xe'),_0x655b('0xf'),_0x655b('0x10'),_0x655b('0x11'),_0x655b('0x12')]}]},'log':_0x655b('0x3')});};};
\ No newline at end of file
index b3773fa..0b0de8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa181=['../client','getTrunks','Request','GetTrunk','name','registry','defaultuser'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa181,0x10a));var _0x1a18=function(_0x380ab3,_0x3c9226){_0x380ab3=_0x380ab3-0x0;var _0x15a3b6=_0xa181[_0x380ab3];return _0x15a3b6;};'use strict';var client=require(_0x1a18('0x0'));exports[_0x1a18('0x1')]=function(_0x3ff652){return function(_0x5b86f5){return client[_0x1a18('0x2')](_0x1a18('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1a18('0x4'),_0x1a18('0x5'),_0x1a18('0x6')]},'log':_0x1a18('0x3')});};};
\ No newline at end of file
+var _0xd96b=['getTrunks','Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x20693d,_0x41ca17){var _0xd0c83e=function(_0x2d250d){while(--_0x2d250d){_0x20693d['push'](_0x20693d['shift']());}};_0xd0c83e(++_0x41ca17);}(_0xd96b,0x109));var _0xbd96=function(_0x48fa45,_0x1cb909){_0x48fa45=_0x48fa45-0x0;var _0x2b2c44=_0xd96b[_0x48fa45];return _0x2b2c44;};'use strict';var client=require(_0xbd96('0x0'));exports[_0xbd96('0x1')]=function(_0x1c7df3){return function(_0x5b7d31){return client[_0xbd96('0x2')](_0xbd96('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xbd96('0x4'),_0xbd96('0x5'),_0xbd96('0x6')]},'log':_0xbd96('0x3')});};};
\ No newline at end of file
index 9e27624..abc88ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x4a14c7,_0x4a02ee){var _0x4c2368=function(_0xfb53b9){while(--_0xfb53b9){_0x4a14c7['push'](_0x4a14c7['shift']());}};_0x4c2368(++_0x4a02ee);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});};
\ No newline at end of file
+var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x4ce462,_0x3fd44f){var _0x58a7cb=function(_0x3b8a63){while(--_0x3b8a63){_0x4ce462['push'](_0x4ce462['shift']());}};_0x58a7cb(++_0x3fd44f);}(_0xedd9,0xfc));var _0x9edd=function(_0x2c14e7,_0x43e49b){_0x2c14e7=_0x2c14e7-0x0;var _0x2f1ba4=_0xedd9[_0x2c14e7];return _0x2f1ba4;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});};
\ No newline at end of file
index 3be2347..9eb7517 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa8=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x1c0058,_0x25d0cf){var _0x480919=function(_0x25c458){while(--_0x25c458){_0x1c0058['push'](_0x1c0058['shift']());}};_0x480919(++_0x25d0cf);}(_0x6aa8,0x135));var _0x86aa=function(_0x2d8044,_0x14866f){_0x2d8044=_0x2d8044-0x0;var _0x3f1c71=_0x6aa8[_0x2d8044];return _0x3f1c71;};'use strict';var client=require(_0x86aa('0x0'));exports[_0x86aa('0x1')]=function(_0x19e831){return client[_0x86aa('0x2')](_0x86aa('0x3'),{'body':_0x19e831,'log':_0x86aa('0x3')});};exports['update']=function(_0x4e9557,_0x13d0ac,_0x134cc2){return client[_0x86aa('0x2')](_0x86aa('0x4'),{'body':_0x4e9557,'options':{'where':{'uniqueid':_0x13d0ac,'interface':_0x134cc2,'agentcomplete':!![]}},'log':_0x86aa('0x4')});};
\ No newline at end of file
+var _0x5dd6=['UpdateVoiceAgentReport','create','CreateVoiceAgentReport','update','Request'];(function(_0x1b15c6,_0x33f069){var _0x12145e=function(_0x1ae942){while(--_0x1ae942){_0x1b15c6['push'](_0x1b15c6['shift']());}};_0x12145e(++_0x33f069);}(_0x5dd6,0x155));var _0x65dd=function(_0x3edf96,_0x11e492){_0x3edf96=_0x3edf96-0x0;var _0x128e0e=_0x5dd6[_0x3edf96];return _0x128e0e;};'use strict';var client=require('../client');exports[_0x65dd('0x0')]=function(_0x660fbc){return client['Request']('CreateVoiceAgentReport',{'body':_0x660fbc,'log':_0x65dd('0x1')});};exports[_0x65dd('0x2')]=function(_0x1866c3,_0x2464b0,_0x5efe4b){return client[_0x65dd('0x3')]('UpdateVoiceAgentReport',{'body':_0x1866c3,'options':{'where':{'uniqueid':_0x2464b0,'interface':_0x5efe4b,'agentcomplete':!![]}},'log':_0x65dd('0x4')});};
\ No newline at end of file
index 257d024..b4b3fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5312=['getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','duration','GetVoiceCallReports','moment','lodash','../client','create','CreateVoiceCallReport','context','callerid','DOCUMENTATION'];(function(_0x354c31,_0x39c5a6){var _0x50a443=function(_0x51237b){while(--_0x51237b){_0x354c31['push'](_0x354c31['shift']());}};_0x50a443(++_0x39c5a6);}(_0x5312,0x13b));var _0x2531=function(_0xe1e7fe,_0x5d6131){_0xe1e7fe=_0xe1e7fe-0x0;var _0x1b860f=_0x5312[_0xe1e7fe];return _0x1b860f;};'use strict';var moment=require(_0x2531('0x0'));var util=require('util');var _=require(_0x2531('0x1'));var client=require(_0x2531('0x2'));exports[_0x2531('0x3')]=function(_0xa8a133){return client['Request'](_0x2531('0x4'),{'body':_['merge'](_0xa8a133,{'source':_0xa8a133['calleridnum'],'destinationcontext':_0xa8a133[_0x2531('0x5')],'callerid':_0xa8a133[_0x2531('0x6')],'amaflags':_0x2531('0x7')}),'log':_0x2531('0x4')});};exports[_0x2531('0x8')]=function(){return function(){return client[_0x2531('0x9')](_0x2531('0xa'),{'options':{'where':{'type':[_0x2531('0xb')],'createdAt':{'$between':[moment()[_0x2531('0xc')](_0x2531('0xd'))[_0x2531('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x2531('0xd'))[_0x2531('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x2531('0xf'),'billableseconds']},'log':_0x2531('0x10')});};};
\ No newline at end of file
+var _0x19f5=['CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create'];(function(_0x3209f2,_0x5c51e2){var _0x56aabc=function(_0x429ab1){while(--_0x429ab1){_0x3209f2['push'](_0x3209f2['shift']());}};_0x56aabc(++_0x5c51e2);}(_0x19f5,0x9d));var _0x519f=function(_0x3b84ad,_0xeaac06){_0x3b84ad=_0x3b84ad-0x0;var _0x31c6f8=_0x19f5[_0x3b84ad];return _0x31c6f8;};'use strict';var moment=require(_0x519f('0x0'));var util=require('util');var _=require(_0x519f('0x1'));var client=require(_0x519f('0x2'));exports[_0x519f('0x3')]=function(_0x42247b){return client['Request'](_0x519f('0x4'),{'body':_[_0x519f('0x5')](_0x42247b,{'source':_0x42247b['calleridnum'],'destinationcontext':_0x42247b[_0x519f('0x6')],'callerid':_0x42247b[_0x519f('0x7')],'amaflags':_0x519f('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x519f('0x9')]=function(){return function(){return client[_0x519f('0xa')](_0x519f('0xb'),{'options':{'where':{'type':[_0x519f('0xc')],'createdAt':{'$between':[moment()[_0x519f('0xd')](_0x519f('0xe'))[_0x519f('0xf')](_0x519f('0x10')),moment()[_0x519f('0x11')](_0x519f('0xe'))[_0x519f('0xf')](_0x519f('0x10'))]}},'attributes':[_0x519f('0x12'),_0x519f('0x13'),_0x519f('0x14'),_0x519f('0x15')]},'log':_0x519f('0x16')});};};
\ No newline at end of file
index 278de71..3979b75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad22=['Request','CreateVoiceDialReport','../client','create'];(function(_0x4ef62a,_0x58ac1e){var _0x3dd078=function(_0x298cfe){while(--_0x298cfe){_0x4ef62a['push'](_0x4ef62a['shift']());}};_0x3dd078(++_0x58ac1e);}(_0xad22,0x196));var _0x2ad2=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0xad22[_0x30a31e];return _0x170879;};'use strict';var client=require(_0x2ad2('0x0'));exports[_0x2ad2('0x1')]=function(_0x5a0d7a){return client[_0x2ad2('0x2')]('CreateVoiceDialReport',{'body':_0x5a0d7a,'log':_0x2ad2('0x3')});};
\ No newline at end of file
+var _0x600f=['CreateVoiceDialReport','../client','Request'];(function(_0x43f207,_0x3044b1){var _0x4098f7=function(_0x5668e0){while(--_0x5668e0){_0x43f207['push'](_0x43f207['shift']());}};_0x4098f7(++_0x3044b1);}(_0x600f,0x190));var _0xf600=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x600f[_0x355ce8];return _0x1db8b8;};'use strict';var client=require(_0xf600('0x0'));exports['create']=function(_0x4179a0){return client[_0xf600('0x1')](_0xf600('0x2'),{'body':_0x4179a0,'log':_0xf600('0x2')});};
\ No newline at end of file
index b74fdf3..0149fea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eaa=['recordingFormat','../client','getVoiceExtensions','exten'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0xd7ca56,_0xfe462d){_0xd7ca56=_0xd7ca56-0x0;var _0x29c00f=_0x0eaa[_0xd7ca56];return _0x29c00f;};'use strict';var client=require(_0xa0ea('0x0'));exports[_0xa0ea('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xa0ea('0x2'),_0xa0ea('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
+var _0x2cbd=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x54b4a0,_0x580de7){var _0x5b8bcf=function(_0x15ee42){while(--_0x15ee42){_0x54b4a0['push'](_0x54b4a0['shift']());}};_0x5b8bcf(++_0x580de7);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x2cbd[_0x128bef];return _0x1ba862;};'use strict';var client=require(_0xd2cb('0x0'));exports[_0xd2cb('0x1')]=function(){return function(){return client['Request'](_0xd2cb('0x2'),{'options':{'raw':!![],'attributes':['id',_0xd2cb('0x3'),_0xd2cb('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index 87e6a78..a2dc203 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb374=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0xb374,0x113));var _0x4b37=function(_0x37f120,_0xf000bd){_0x37f120=_0x37f120-0x0;var _0x4c2430=_0xb374[_0x37f120];return _0x4c2430;};'use strict';var client=require(_0x4b37('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x4b37('0x1'),{'options':{'raw':![],'attributes':['id',_0x4b37('0x2'),_0x4b37('0x3'),_0x4b37('0x4'),_0x4b37('0x5'),_0x4b37('0x6'),'type',_0x4b37('0x7'),_0x4b37('0x8'),_0x4b37('0x9'),_0x4b37('0xa'),'dialPowerLevel',_0x4b37('0xb'),_0x4b37('0xc'),_0x4b37('0xd'),_0x4b37('0xe'),_0x4b37('0xf'),_0x4b37('0x10'),_0x4b37('0x11'),_0x4b37('0x12'),_0x4b37('0x13'),'dialCongestionMaxRetry',_0x4b37('0x14'),_0x4b37('0x15'),_0x4b37('0x16'),_0x4b37('0x17'),_0x4b37('0x18'),'dialGlobalMaxRetry','dialTimezone',_0x4b37('0x19'),_0x4b37('0x1a'),_0x4b37('0x1b'),_0x4b37('0x1c'),_0x4b37('0x1d'),_0x4b37('0x1e'),_0x4b37('0x1f'),_0x4b37('0x20'),_0x4b37('0x21'),_0x4b37('0x22'),_0x4b37('0x23'),_0x4b37('0x24'),'dialAMDMaximumWordLength',_0x4b37('0x25'),_0x4b37('0x26'),'dialRecallInQueue',_0x4b37('0x27'),_0x4b37('0x28'),'dialAgiAfterHangupClient','dialQueueProject2',_0x4b37('0x6'),_0x4b37('0x29'),_0x4b37('0x2a'),_0x4b37('0x2b'),_0x4b37('0x2c'),_0x4b37('0x2d'),_0x4b37('0x2e'),_0x4b37('0x2f'),'dialAbandonedMaxRetry',_0x4b37('0x30'),'dialMachineMaxRetry',_0x4b37('0x31'),_0x4b37('0x32'),_0x4b37('0x33'),'mandatoryDisposition',_0x4b37('0x34'),_0x4b37('0x35'),_0x4b37('0x36'),_0x4b37('0x37')],'include':[{'model':_0x4b37('0x38'),'as':_0x4b37('0x38'),'attributes':['id',_0x4b37('0x2'),_0x4b37('0x39'),_0x4b37('0x3a')]},{'model':_0x4b37('0x3b'),'as':'mandatoryDispositionPause','attributes':['id',_0x4b37('0x2')]},{'model':_0x4b37('0x38'),'as':_0x4b37('0x3c'),'attributes':['id',_0x4b37('0x2'),'callerid',_0x4b37('0x3a')]},{'model':_0x4b37('0x3d'),'as':_0x4b37('0x3d'),'attributes':['id',_0x4b37('0x2')],'include':[{'model':_0x4b37('0x3d'),'as':_0x4b37('0x3e'),'attributes':['id',_0x4b37('0x2'),_0x4b37('0x3f')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
+var _0xf95c=['dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','Pause','mandatoryDispositionPause','active','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber'];(function(_0x13806e,_0x57852a){var _0x406993=function(_0x45330c){while(--_0x45330c){_0x13806e['push'](_0x13806e['shift']());}};_0x406993(++_0x57852a);}(_0xf95c,0x10e));var _0xcf95=function(_0x25f8e5,_0x209ec1){_0x25f8e5=_0x25f8e5-0x0;var _0x491768=_0xf95c[_0x25f8e5];return _0x491768;};'use strict';var client=require('../client');exports[_0xcf95('0x0')]=function(){return function(){return client[_0xcf95('0x1')](_0xcf95('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xcf95('0x3'),_0xcf95('0x4'),_0xcf95('0x5'),_0xcf95('0x6'),_0xcf95('0x7'),_0xcf95('0x8'),_0xcf95('0x9'),'dialLimitChannel',_0xcf95('0xa'),_0xcf95('0xb'),_0xcf95('0xc'),_0xcf95('0xd'),_0xcf95('0xe'),_0xcf95('0xf'),_0xcf95('0x10'),_0xcf95('0x11'),_0xcf95('0x12'),_0xcf95('0x13'),_0xcf95('0x14'),_0xcf95('0x15'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0xcf95('0x16'),'dialNoAnswerMaxRetry',_0xcf95('0x17'),_0xcf95('0x18'),_0xcf95('0x19'),_0xcf95('0x1a'),_0xcf95('0x1b'),_0xcf95('0x1c'),_0xcf95('0x1d'),_0xcf95('0x1e'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0xcf95('0x1f'),_0xcf95('0x20'),_0xcf95('0x21'),_0xcf95('0x22'),_0xcf95('0x23'),_0xcf95('0x24'),_0xcf95('0x25'),_0xcf95('0x26'),_0xcf95('0x27'),_0xcf95('0x28'),'dialAgiAfterHangupAgent',_0xcf95('0x29'),_0xcf95('0x2a'),_0xcf95('0x6'),_0xcf95('0x2b'),_0xcf95('0x2c'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0xcf95('0x2d'),'dialDropMaxRetry',_0xcf95('0x2e'),'dialAbandonedMaxRetry',_0xcf95('0x2f'),_0xcf95('0x30'),_0xcf95('0x31'),_0xcf95('0x32'),'dialAgentRejectRetryFrequency',_0xcf95('0x33'),_0xcf95('0x34'),_0xcf95('0x35'),_0xcf95('0x36'),'dialPreviewRecallmeReminder'],'include':[{'model':_0xcf95('0x37'),'as':_0xcf95('0x37'),'attributes':['id',_0xcf95('0x38'),_0xcf95('0x39'),'active']},{'model':_0xcf95('0x3a'),'as':_0xcf95('0x3b'),'attributes':['id',_0xcf95('0x38')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0xcf95('0x38'),_0xcf95('0x39'),_0xcf95('0x3c')]},{'model':_0xcf95('0x3d'),'as':'Interval','attributes':['id',_0xcf95('0x38')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0xcf95('0x3e')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
index fc4def6..bde436f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x5bc93d,_0x24a9b0){var _0x5a5f83=function(_0x4842cf){while(--_0x4842cf){_0x5bc93d['push'](_0x5bc93d['shift']());}};_0x5a5f83(++_0x24a9b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x566164,_0x39a497){var _0x105021=function(_0x332980){while(--_0x332980){_0x566164['push'](_0x566164['shift']());}};_0x105021(++_0x39a497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
index c822ed3..e35aaf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa27f=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x45ae8f,_0x16693){var _0x5128fb=function(_0x14e562){while(--_0x14e562){_0x45ae8f['push'](_0x45ae8f['shift']());}};_0x5128fb(++_0x16693);}(_0xa27f,0x195));var _0xfa27=function(_0xe3ff69,_0x35b27d){_0xe3ff69=_0xe3ff69-0x0;var _0x60c234=_0xa27f[_0xe3ff69];return _0x60c234;};'use strict';var client=require(_0xfa27('0x0'));exports[_0xfa27('0x1')]=function(_0x3cf2b9){return function(){return client[_0xfa27('0x2')](_0xfa27('0x3'),{'options':{'where':{'VoiceQueueId':_0x3cf2b9,'paused':!![]},'raw':!![]},'log':_0xfa27('0x1')});};};
\ No newline at end of file
+var _0xaf08=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x35a8b7,_0x1752e2){var _0x172483=function(_0x371453){while(--_0x371453){_0x35a8b7['push'](_0x35a8b7['shift']());}};_0x172483(++_0x1752e2);}(_0xaf08,0xd8));var _0x8af0=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0xaf08[_0x5575cd];return _0x4979a0;};'use strict';var client=require(_0x8af0('0x0'));exports[_0x8af0('0x1')]=function(_0x189ff9){return function(){return client[_0x8af0('0x2')](_0x8af0('0x3'),{'options':{'where':{'VoiceQueueId':_0x189ff9,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index 2bc611a..0cd2834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x57dc3c,_0x509590){var _0x3c7d97=function(_0x5248e6){while(--_0x5248e6){_0x57dc3c['push'](_0x57dc3c['shift']());}};_0x3c7d97(++_0x509590);}(_0x7a54,0x106));var _0x47a5=function(_0x5d062d,_0x4a24b4){_0x5d062d=_0x5d062d-0x0;var _0x9696e=_0x7a54[_0x5d062d];return _0x9696e;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
+var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x253e5b,_0x5ad049){var _0x51a16d=function(_0x472f8d){while(--_0x472f8d){_0x253e5b['push'](_0x253e5b['shift']());}};_0x51a16d(++_0x5ad049);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
index f32491c..72608ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1302=['transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1302,0x11e));var _0x2130=function(_0x373cc4,_0x2646e5){_0x373cc4=_0x373cc4-0x0;var _0x52b09a=_0x1302[_0x373cc4];return _0x52b09a;};'use strict';var client=require(_0x2130('0x0'));exports[_0x2130('0x1')]={};exports[_0x2130('0x2')]=function(_0x439013){return client[_0x2130('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x439013[_0x2130('0x4')],'transfererchannel':_0x439013[_0x2130('0x5')],'transferercalleridnum':_0x439013[_0x2130('0x6')],'transferercalleridname':_0x439013[_0x2130('0x7')],'transfererconnectedlinenum':_0x439013[_0x2130('0x8')],'transfererconnectedlinename':_0x439013[_0x2130('0x9')],'transfereraccountcode':_0x439013[_0x2130('0xa')],'transferercontext':_0x439013[_0x2130('0xb')],'transfererexten':_0x439013[_0x2130('0xc')],'transfererlinkedid':_0x439013[_0x2130('0xd')],'transfereechannel':_0x439013[_0x2130('0xe')],'transfereecalleridnum':_0x439013[_0x2130('0xf')],'transfereecalleridname':_0x439013['transfereecalleridname'],'transfereeconnectedlinenum':_0x439013[_0x2130('0x10')],'transfereeconnectedlinename':_0x439013['transfereeconnectedlinename'],'transfereeaccountcode':_0x439013[_0x2130('0x11')],'transfereecontext':_0x439013['transfereecontext'],'transfereeexten':_0x439013[_0x2130('0x12')],'transfereelinkedid':_0x439013[_0x2130('0x13')],'isexternal':_0x439013['isexternal'],'context':_0x439013[_0x2130('0x14')],'extension':_0x439013[_0x2130('0x15')],'type':_0x2130('0x16')},'log':_0x2130('0x17')});};exports['attendedTransfer']=function(_0x358892){return client['Request'](_0x2130('0x17'),{'body':{'result':_0x358892['result'],'transfererchannel':_0x358892[_0x2130('0x18')],'transferercalleridnum':_0x358892['origtransferercalleridnum'],'transferercalleridname':_0x358892[_0x2130('0x19')],'transfererconnectedlinenum':_0x358892[_0x2130('0x1a')],'transfererconnectedlinename':_0x358892[_0x2130('0x1b')],'transfereraccountcode':_0x358892['origtransfereraccountcode'],'transferercontext':_0x358892['secondtransferercontext'],'transfererexten':_0x358892[_0x2130('0x1c')],'transfererlinkedid':_0x358892[_0x2130('0x1d')],'transfereechannel':_0x358892[_0x2130('0x1e')],'transfereecalleridnum':_0x358892[_0x2130('0x1f')],'transfereecalleridname':_0x358892[_0x2130('0x20')],'transfereeconnectedlinenum':_0x358892['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x358892[_0x2130('0x21')],'transfereeaccountcode':_0x358892[_0x2130('0x22')],'transfereecontext':_0x358892[_0x2130('0x23')],'transfereeexten':_0x358892[_0x2130('0x24')],'transfereelinkedid':_0x358892[_0x2130('0x25')],'isexternal':_0x358892[_0x2130('0x26')],'context':_0x358892[_0x2130('0x27')],'extension':_0x358892[_0x2130('0x28')],'type':_0x2130('0x29')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0x8fa3=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x8fa3,0x15b));var _0x38fa=function(_0x2b0a93,_0x143777){_0x2b0a93=_0x2b0a93-0x0;var _0x5eba97=_0x8fa3[_0x2b0a93];return _0x5eba97;};'use strict';var client=require(_0x38fa('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x523628){return client[_0x38fa('0x1')](_0x38fa('0x2'),{'body':{'result':_0x523628[_0x38fa('0x3')],'transfererchannel':_0x523628[_0x38fa('0x4')],'transferercalleridnum':_0x523628['transferercalleridnum'],'transferercalleridname':_0x523628[_0x38fa('0x5')],'transfererconnectedlinenum':_0x523628[_0x38fa('0x6')],'transfererconnectedlinename':_0x523628[_0x38fa('0x7')],'transfereraccountcode':_0x523628['transfereraccountcode'],'transferercontext':_0x523628[_0x38fa('0x8')],'transfererexten':_0x523628[_0x38fa('0x9')],'transfererlinkedid':_0x523628[_0x38fa('0xa')],'transfereechannel':_0x523628[_0x38fa('0xb')],'transfereecalleridnum':_0x523628[_0x38fa('0xc')],'transfereecalleridname':_0x523628[_0x38fa('0xd')],'transfereeconnectedlinenum':_0x523628[_0x38fa('0xe')],'transfereeconnectedlinename':_0x523628['transfereeconnectedlinename'],'transfereeaccountcode':_0x523628[_0x38fa('0xf')],'transfereecontext':_0x523628[_0x38fa('0x10')],'transfereeexten':_0x523628['transfereeexten'],'transfereelinkedid':_0x523628[_0x38fa('0x11')],'isexternal':_0x523628[_0x38fa('0x12')],'context':_0x523628[_0x38fa('0x13')],'extension':_0x523628[_0x38fa('0x14')],'type':_0x38fa('0x15')},'log':_0x38fa('0x2')});};exports[_0x38fa('0x16')]=function(_0x1ea135){return client['Request'](_0x38fa('0x2'),{'body':{'result':_0x1ea135[_0x38fa('0x3')],'transfererchannel':_0x1ea135[_0x38fa('0x17')],'transferercalleridnum':_0x1ea135[_0x38fa('0x18')],'transferercalleridname':_0x1ea135['origtransferercalleridname'],'transfererconnectedlinenum':_0x1ea135['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1ea135[_0x38fa('0x19')],'transfereraccountcode':_0x1ea135['origtransfereraccountcode'],'transferercontext':_0x1ea135[_0x38fa('0x1a')],'transfererexten':_0x1ea135[_0x38fa('0x1b')],'transfererlinkedid':_0x1ea135[_0x38fa('0x1c')],'transfereechannel':_0x1ea135[_0x38fa('0x1d')],'transfereecalleridnum':_0x1ea135[_0x38fa('0x1e')],'transfereecalleridname':_0x1ea135[_0x38fa('0x1f')],'transfereeconnectedlinenum':_0x1ea135[_0x38fa('0x20')],'transfereeconnectedlinename':_0x1ea135['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1ea135['transfertargetaccountcode'],'transfereecontext':_0x1ea135[_0x38fa('0x21')],'transfereeexten':_0x1ea135[_0x38fa('0x22')],'transfereelinkedid':_0x1ea135[_0x38fa('0x23')],'isexternal':_0x1ea135[_0x38fa('0x12')],'context':_0x1ea135[_0x38fa('0x24')],'extension':_0x1ea135[_0x38fa('0x25')],'type':'attended'},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index a18bbab..39234cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','find','voiceQueues','omit','undefined','values','channels','length','voicechannel','uniqueid','filename','wav','MixMonitor','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','map','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','context','trunks','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','../../../config/environment','../ami','listen','format','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','Action','then','message','catch','error','action','Command','content','hasOwnProperty','strategy'];(function(_0x30c3e9,_0x547cf7){var _0xdbedc=function(_0x329b16){while(--_0x329b16){_0x30c3e9['push'](_0x30c3e9['shift']());}};_0xdbedc(++_0x547cf7);}(_0x6d38,0x1ef));var _0x86d3=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x6d38[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var jayson=require(_0x86d3('0x1'));var schema=require(_0x86d3('0x2'));var BPromise=require('bluebird');var moment=require('moment');var config=require(_0x86d3('0x3'));var properties=require('../properties');var ami=require(_0x86d3('0x4'));exports[_0x86d3('0x5')]=function(_0x2501dd,_0x4ef557,_0x2d8272){return new BPromise(function(_0xfbbc15,_0x33d4aa){var _0x2eaa15={'QueuePause':function(_0x47e654){return new Promise(function(_0x552b07,_0x2aea31){var _0x3ab01e=util[_0x86d3('0x6')]('%s/%s','SIP',_0x47e654[_0x86d3('0x7')]);if(_0x2501dd[_0x86d3('0x8')]&&_0x2501dd['timers'][_0x3ab01e]&&_0x2501dd['timers'][_0x3ab01e][_0x86d3('0x9')]){_0x2501dd[_0x86d3('0x8')][_0x3ab01e]['updateAcw']();}if(_0x2501dd[_0x86d3('0xa')][_0x3ab01e]){_0x2501dd['agents'][_0x3ab01e][_0x86d3('0xb')]({'statePause':_0x47e654[_0x86d3('0xc')]?!![]:![]});}_0x552b07({'code':0xc8,'message':_0x86d3('0xd')});});},'Reload':function(_0x26d64c){var _0xe1b3d7=this;return new Promise(function(_0x1b8d0a,_0xbbca86){if(ami[_0x86d3('0xe')]()==![]){return _0xbbca86(_0xe1b3d7['error'](0x1f4,[config[_0x86d3('0xf')]['ip'],config[_0x86d3('0xf')][_0x86d3('0x10')],_0x86d3('0x11')][_0x86d3('0x12')]('\x20')));}_0x26d64c=_[_0x86d3('0x13')](_0x26d64c,_[_0x86d3('0x14')](properties[_0x86d3('0x15')]));_0x26d64c['action']=_0x86d3('0x16');return ami[_0x86d3('0x17')](_0x26d64c)[_0x86d3('0x18')](function(_0xa26ea2){_0x1b8d0a({'code':0xc8,'message':_0xa26ea2[_0x86d3('0x19')]});})[_0x86d3('0x1a')](function(_0x33e459){_0xbbca86(_0xe1b3d7[_0x86d3('0x1b')](0x1f5,_0x33e459[_0x86d3('0x19')]));});});},'Command':function(_0x5e9ecc){var _0x191ba5=this;return new Promise(function(_0x57c340,_0x6ced9e){if(ami['isConnected']()==![]){return _0x6ced9e(_0x191ba5['error'](0x1f4,[config[_0x86d3('0xf')]['ip'],config[_0x86d3('0xf')][_0x86d3('0x10')],_0x86d3('0x11')]['join']('\x20')));}_0x5e9ecc=_[_0x86d3('0x13')](_0x5e9ecc,'command');_0x5e9ecc[_0x86d3('0x1c')]=_0x86d3('0x1d');return ami[_0x86d3('0x17')](_0x5e9ecc)['then'](function(_0x39d819){_0x57c340({'code':0xc8,'message':_0x39d819[_0x86d3('0x1e')]});})[_0x86d3('0x1a')](function(_0x4bf5b8){_0x6ced9e(_0x191ba5['error'](0x1f5,_0x4bf5b8[_0x86d3('0x19')]));});});},'VoiceQueues':function(_0x4d5668){return new Promise(function(_0x3c93d3,_0x1bea5e){var _0x3dfecd=[];for(var _0x3c5fe4 in _0x2501dd['voiceQueues']){if(_0x2501dd['voiceQueues'][_0x86d3('0x1f')](_0x3c5fe4)){var _0x611764=_0x2501dd['voiceQueues'][_0x3c5fe4];var _0x14e325={'id':_0x611764['id'],'name':_0x611764['name'],'strategy':_0x611764[_0x86d3('0x20')],'answered':_0x611764[_0x86d3('0x21')],'available':_0x611764[_0x86d3('0x22')],'loggedIn':_0x611764[_0x86d3('0x23')],'pTalking':_0x611764[_0x86d3('0x24')],'sumBillable':_0x611764[_0x86d3('0x25')],'sumDuration':_0x611764[_0x86d3('0x26')],'sumHoldTime':_0x611764[_0x86d3('0x27')]||0x0,'talking':_0x611764[_0x86d3('0x28')],'total':_0x611764[_0x86d3('0x29')],'type':_0x611764[_0x86d3('0x2a')],'unmanaged':_0x611764[_0x86d3('0x2b')],'abandoned':_0x611764[_0x86d3('0x2c')],'waiting':_0x611764[_0x86d3('0x2d')],'loggedInDb':_0x611764['loggedInDb']};if(_0x611764[_0x86d3('0x2a')]===_0x86d3('0x2e')){_0x14e325[_0x86d3('0x2f')]=_0x611764[_0x86d3('0x2f')];_0x14e325[_0x86d3('0x30')]=_0x611764[_0x86d3('0x30')];_0x14e325['dialOriginateCallerIdName']=_0x611764[_0x86d3('0x31')];_0x14e325['dialOriginateCallerIdNumber']=_0x611764['dialOriginateCallerIdNumber'];_0x14e325[_0x86d3('0x32')]=_0x611764[_0x86d3('0x32')];_0x14e325[_0x86d3('0x33')]=_0x611764['dialPrefix'];_0x14e325[_0x86d3('0x34')]=_0x611764[_0x86d3('0x34')];_0x14e325['outboundAnswerAgiCallsDay']=_0x611764[_0x86d3('0x35')];_0x14e325[_0x86d3('0x36')]=_0x611764[_0x86d3('0x36')];_0x14e325[_0x86d3('0x37')]=_0x611764[_0x86d3('0x37')];_0x14e325[_0x86d3('0x38')]=_0x611764[_0x86d3('0x38')];_0x14e325[_0x86d3('0x39')]=_0x611764['outboundCongestionCallsDay'];_0x14e325['outboundDropCallsDayACS']=_0x611764['outboundDropCallsDayACS'];_0x14e325[_0x86d3('0x3a')]=_0x611764['outboundDropCallsDayCallersExit'];_0x14e325[_0x86d3('0x3b')]=_0x611764['outboundDropCallsDayTimeout'];_0x14e325[_0x86d3('0x3c')]=_0x611764[_0x86d3('0x3c')];_0x14e325[_0x86d3('0x3d')]=_0x611764[_0x86d3('0x3d')];_0x14e325[_0x86d3('0x3e')]=_0x611764[_0x86d3('0x3e')];_0x14e325[_0x86d3('0x3f')]=_0x611764['outboundReCallsDay'];_0x14e325[_0x86d3('0x40')]=_0x611764[_0x86d3('0x40')];_0x14e325['outboundUnknownCallsDay']=_0x611764[_0x86d3('0x41')];_0x14e325[_0x86d3('0x42')]=_0x611764[_0x86d3('0x42')];_0x14e325[_0x86d3('0x43')]=_0x611764['predictiveIntervalAvgHoldtime'];_0x14e325[_0x86d3('0x44')]=_0x611764[_0x86d3('0x44')];_0x14e325[_0x86d3('0x45')]=_0x611764['predictiveIntervalDroppedCallsCallersExit'];_0x14e325[_0x86d3('0x46')]=_0x611764[_0x86d3('0x46')];_0x14e325[_0x86d3('0x47')]=_0x611764[_0x86d3('0x47')];_0x14e325[_0x86d3('0x48')]=_0x611764[_0x86d3('0x48')];_0x14e325[_0x86d3('0x49')]=_0x611764[_0x86d3('0x49')];_0x14e325['predictiveIntervalMultiplicativeFactor']=_0x611764[_0x86d3('0x4a')];_0x14e325[_0x86d3('0x4b')]=_0x611764[_0x86d3('0x4b')];_0x14e325[_0x86d3('0x4c')]=_0x611764['predictiveIntervalAvailable'];_0x14e325[_0x86d3('0x4d')]=_0x611764[_0x86d3('0x4d')];_0x14e325[_0x86d3('0x19')]=_0x611764[_0x86d3('0x19')];_0x14e325['originated']=_0x611764['originated'];_0x14e325[_0x86d3('0x4e')]=_0x611764['erlangCalls'];_0x14e325['erlangCallToSecond']=_0x611764[_0x86d3('0x4f')];_0x14e325[_0x86d3('0x50')]=_0x611764[_0x86d3('0x50')];_0x14e325[_0x86d3('0x51')]=_0x611764[_0x86d3('0x51')];_0x14e325['startPredictive']=_0x611764[_0x86d3('0x52')];_0x14e325[_0x86d3('0x53')]=_0x611764[_0x86d3('0x53')];}if(_0x611764['Trunk']){_0x14e325[_0x86d3('0x54')]={'id':_0x611764[_0x86d3('0x54')]['id'],'name':_0x611764['Trunk'][_0x86d3('0x7')],'active':_0x611764[_0x86d3('0x54')]['active'],'callerid':_0x611764['Trunk']['callerid']};}if(_0x611764[_0x86d3('0x55')]){_0x14e325[_0x86d3('0x55')]={'id':_0x611764[_0x86d3('0x55')]['id'],'name':_0x611764[_0x86d3('0x55')][_0x86d3('0x7')]};}_0x3dfecd[_0x86d3('0x56')](_0x14e325);}}_0x3c93d3({'count':_0x3dfecd['length'],'rows':_0x3dfecd});});},'UpdateVoiceQueue':function(_0x37ead6){return new Promise(function(_0x879842,_0x5d9dad){var _0x2f0bf6=_[_0x86d3('0x57')](_0x2501dd[_0x86d3('0x58')],{'id':parseInt(_0x37ead6['id'])});var _0xf3619=_[_0x86d3('0x59')](_0x37ead6,['id']);if(_0x2f0bf6){for(var _0x25c253 in _0xf3619){if(typeof _0xf3619[_0x25c253]!=='undefined'&&typeof _0x2f0bf6[_0x25c253]!==_0x86d3('0x5a')){_0x2f0bf6[_0x25c253]=_0xf3619[_0x25c253];}}_0x879842(_0x2f0bf6);}else{_0x5d9dad();}});},'VoiceChannels':function(_0x474310){return new Promise(function(_0x4da8d3,_0x31fb3a){var _0x412d0e=_[_0x86d3('0x5b')](_0x2501dd[_0x86d3('0x5c')]);_0x4da8d3({'count':_0x412d0e[_0x86d3('0x5d')],'rows':_0x412d0e});});},'VoiceChannelMixMonitor':function(_0x48f8a2){var _0x97c5b8=this;return new Promise(function(_0x3e6620,_0x3226b5){if(ami[_0x86d3('0xe')]()==![]){return _0x3226b5(_0x97c5b8[_0x86d3('0x1b')](0x1f4,[config[_0x86d3('0xf')]['ip'],config[_0x86d3('0xf')][_0x86d3('0x10')],_0x86d3('0x11')][_0x86d3('0x12')]('\x20')));}var _0x118552=schema(properties[_0x86d3('0x5e')])['validate'](_0x48f8a2);if(_0x118552[_0x86d3('0x5d')]>0x0){return _0x3226b5(_0x97c5b8[_0x86d3('0x1b')](0x1f4,_['map'](_0x118552,_0x86d3('0x19'))[_0x86d3('0x12')](',\x20')));}var _0x197047=_[_0x86d3('0x57')](_0x2501dd[_0x86d3('0x5c')],{'uniqueid':_0x48f8a2[_0x86d3('0x5f')]});if(_0x197047&&_0x197047['channel']){var _0x4cd179=util['format']('%s.%s',_0x48f8a2[_0x86d3('0x60')]||_0x48f8a2[_0x86d3('0x5f')],_0x48f8a2[_0x86d3('0x6')]||_0x86d3('0x61'));return ami[_0x86d3('0x17')]({'action':_0x86d3('0x62'),'channel':_0x197047[_0x86d3('0x63')],'file':_0x4cd179,'options':'ai(mixmonitorid)'})[_0x86d3('0x18')](function(_0x335f96){var _0x64ac1c=_[_0x86d3('0x57')](_0x197047[_0x86d3('0x64')],{'filename':_0x86d3('0x65')+_0x4cd179[_0x86d3('0x66')]()});if(_['isNil'](_0x64ac1c)){_0x197047[_0x86d3('0x64')]['push']({'filename':_0x86d3('0x65')+_0x4cd179[_0x86d3('0x66')](),'createdAt':moment()[_0x86d3('0x6')](_0x86d3('0x67')),'mixmonitorid':_0x335f96[_0x86d3('0x68')],'status':'rec'});}else{_0x64ac1c[_0x86d3('0x68')]=_0x335f96[_0x86d3('0x68')];_0x64ac1c[_0x86d3('0x69')]='rec';}_0x3e6620({'code':0xc8,'message':[_0x48f8a2['uniqueid'],'MixMonitor\x20Success',_0x335f96[_0x86d3('0x68')]]['join']('\x20'),'mixmonitorid':_0x335f96[_0x86d3('0x68')]});})[_0x86d3('0x1a')](function(_0x1fbd25){_0x3226b5(_0x97c5b8[_0x86d3('0x1b')](0x1f5,[_0x48f8a2['uniqueid'],_0x1fbd25['message']['toLowerCase']()][_0x86d3('0x12')]('\x20')));});}else{return _0x3226b5(_0x97c5b8[_0x86d3('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3561c5){var _0x37fe22=this;return new Promise(function(_0xa085b2,_0x4584e5){if(ami[_0x86d3('0xe')]()==![]){return _0x4584e5(_0x37fe22['error'](0x1f4,[config[_0x86d3('0xf')]['ip'],config[_0x86d3('0xf')][_0x86d3('0x10')],_0x86d3('0x11')]['join']('\x20')));}var _0x50c142=schema(properties[_0x86d3('0x5e')])['validate'](_0x3561c5);if(_0x50c142[_0x86d3('0x5d')]>0x0){return _0x4584e5(_0x37fe22[_0x86d3('0x1b')](0x1f4,_[_0x86d3('0x6a')](_0x50c142,_0x86d3('0x19'))[_0x86d3('0x12')](',\x20')));}var _0x4029a4=_[_0x86d3('0x57')](_0x2501dd['channels'],{'uniqueid':_0x3561c5['uniqueid']});if(_0x4029a4){return BPromise[_0x86d3('0x6b')]()['then'](function(){if(_0x4029a4['channel']){return ami['Action']({'action':_0x86d3('0x6c'),'channel':_0x4029a4['channel'],'mixmonitorid':_0x3561c5[_0x86d3('0x68')]})['catch'](function(_0x1d8010){});}})[_0x86d3('0x18')](function(){if(_0x4029a4[_0x86d3('0x6d')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x4029a4[_0x86d3('0x6d')],'mixmonitorid':_0x3561c5[_0x86d3('0x68')]})[_0x86d3('0x1a')](function(_0x202c2a){});}})[_0x86d3('0x18')](function(_0x1952af){var _0x24daf3=_[_0x86d3('0x57')](_0x4029a4[_0x86d3('0x64')],{'mixmonitorid':_0x3561c5[_0x86d3('0x68')]});if(_0x24daf3){_0x24daf3[_0x86d3('0x69')]=_0x86d3('0x6e');}})[_0x86d3('0x18')](function(){var _0xf0dbbb=util[_0x86d3('0x6')](_0x86d3('0x6f'),_0x3561c5[_0x86d3('0x60')]||_0x3561c5[_0x86d3('0x5f')],_0x3561c5['format']||_0x86d3('0x61'));var _0x365802=_[_0x86d3('0x57')](_0x4029a4['monitors'],{'filename':_0x86d3('0x65')+_0xf0dbbb[_0x86d3('0x66')]()});if(_0x365802){_0x365802[_0x86d3('0x69')]=_0x86d3('0x6e');}})['then'](function(){_0xa085b2({'code':0xc8,'message':[_0x3561c5[_0x86d3('0x5f')],'StopMixMonitor\x20Success'][_0x86d3('0x12')]('\x20')});})[_0x86d3('0x1a')](function(_0x2cea1a){_0x4584e5(_0x37fe22[_0x86d3('0x1b')](0x1f5,[_0x3561c5[_0x86d3('0x5f')],_0x2cea1a['message'][_0x86d3('0x66')]()]['join']('\x20')));});}else{return _0x4584e5(_0x37fe22[_0x86d3('0x1b')](0x1f5,_0x86d3('0x70')));}});},'VoiceQueuesChannels':function(_0x5866fe){return new Promise(function(_0x2fdd03,_0x341d4d){var _0x2b0855=_[_0x86d3('0x5b')](_0x2501dd[_0x86d3('0x71')]);_0x2fdd03({'count':_0x2b0855[_0x86d3('0x5d')],'rows':_0x2b0855});});},'VoiceQueuesChannel':function(_0x379799){var _0x5ee4a3=this;return new Promise(function(_0x19f9e1,_0x1a1a3e){var _0x279951=schema(properties[_0x86d3('0x72')])[_0x86d3('0x2')](_0x379799);if(_0x279951['length']>0x0){return _0x1a1a3e(_0x5ee4a3[_0x86d3('0x1b')](0x1f4,_[_0x86d3('0x6a')](_0x279951,'message')[_0x86d3('0x12')](',\x20')));}var _0x42a16c=_[_0x86d3('0x57')](_0x2501dd[_0x86d3('0x71')],{'uniqueid':_0x379799[_0x86d3('0x5f')]});if(_0x42a16c){_0x19f9e1(_0x42a16c);}else{return _0x1a1a3e(_0x5ee4a3[_0x86d3('0x1b')](0x1f5,_0x86d3('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x447ae6){var _0x2be56e=this;return new Promise(function(_0x42982e,_0x34826f){if(ami[_0x86d3('0xe')]()==![]){return _0x34826f(_0x2be56e[_0x86d3('0x1b')](0x1f4,[config[_0x86d3('0xf')]['ip'],config['asterisk'][_0x86d3('0x10')],_0x86d3('0x11')][_0x86d3('0x12')]('\x20')));}var _0x31d64a=schema(properties['voicequeuechannelhangup'])[_0x86d3('0x2')](_0x447ae6);if(_0x31d64a[_0x86d3('0x5d')]>0x0){return _0x34826f(_0x2be56e[_0x86d3('0x1b')](0x1f4,_[_0x86d3('0x6a')](_0x31d64a,'message')['join'](',\x20')));}var _0x234497=_['find'](_0x2501dd[_0x86d3('0x71')],{'uniqueid':_0x447ae6['uniqueid']});if(_0x234497&&_0x234497['channel']){return ami[_0x86d3('0x17')]({'action':_0x86d3('0x73'),'channel':_0x234497[_0x86d3('0x63')]})[_0x86d3('0x18')](function(_0x121dca){_0x42982e({'code':0xc8,'message':[_0x447ae6['uniqueid'],_0x121dca[_0x86d3('0x19')][_0x86d3('0x66')]()]['join']('\x20')});})[_0x86d3('0x1a')](function(_0x33872f){_0x34826f(_0x2be56e['error'](0x1f5,[_0x447ae6[_0x86d3('0x5f')],_0x33872f['message'][_0x86d3('0x66')]()]['join']('\x20')));});}else{return _0x34826f(_0x2be56e['error'](0x1f5,_0x86d3('0x70')));}});},'VoiceQueuesChannelRedirect':function(_0x555d95){var _0xe39649=this;return new Promise(function(_0x18ac89,_0xc84385){if(ami[_0x86d3('0xe')]()==![]){return _0xc84385(_0xe39649[_0x86d3('0x1b')](0x1f4,[config[_0x86d3('0xf')]['ip'],config[_0x86d3('0xf')][_0x86d3('0x10')],'ami\x20disconnected'][_0x86d3('0x12')]('\x20')));}var _0x158f56=schema(properties[_0x86d3('0x74')])[_0x86d3('0x2')](_0x555d95);if(_0x158f56[_0x86d3('0x5d')]>0x0){return _0xc84385(_0xe39649['error'](0x1f4,_[_0x86d3('0x6a')](_0x158f56,_0x86d3('0x19'))[_0x86d3('0x12')](',\x20')));}var _0x302240=_[_0x86d3('0x57')](_0x2501dd[_0x86d3('0x71')],{'uniqueid':_0x555d95[_0x86d3('0x5f')]});if(_0x302240&&_0x302240['channel']){return ami[_0x86d3('0x17')]({'action':'Redirect','channel':_0x302240[_0x86d3('0x63')],'exten':_0x555d95['exten'],'context':_0x555d95['context']||_0x302240[_0x86d3('0x75')],'priority':0x1})[_0x86d3('0x18')](function(_0x4ea504){_0x18ac89({'code':0xc8,'message':[_0x555d95[_0x86d3('0x5f')],_0x4ea504[_0x86d3('0x19')][_0x86d3('0x66')]()][_0x86d3('0x12')]('\x20')});})[_0x86d3('0x1a')](function(_0x11d8c7){_0xc84385(_0xe39649[_0x86d3('0x1b')](0x1f5,[_0x555d95['uniqueid'],_0x11d8c7['message'][_0x86d3('0x66')]()][_0x86d3('0x12')]('\x20')));});}else{return _0xc84385(_0xe39649[_0x86d3('0x1b')](0x1f5,_0x86d3('0x70')));}});},'Agents':function(_0xbbdd46){return new Promise(function(_0x320165,_0x592068){var _0x3afd85=_[_0x86d3('0x5b')](_0x2501dd[_0x86d3('0xa')]);_0x320165({'count':_0x3afd85[_0x86d3('0x5d')],'rows':_0x3afd85});});},'Telephones':function(_0x159251){return new Promise(function(_0x4870b4,_0x3cbab3){var _0x2a9b06=_[_0x86d3('0x5b')](_0x2501dd['telephones']);_0x4870b4({'count':_0x2a9b06[_0x86d3('0x5d')],'rows':_0x2a9b06});});},'Trunks':function(_0x458526){return new Promise(function(_0x4b871b,_0x584a57){var _0x36ee46=_[_0x86d3('0x5b')](_0x2501dd[_0x86d3('0x76')]);_0x4b871b({'count':_0x36ee46['length'],'rows':_0x36ee46});});},'OutboundChannels':function(_0xddfc55){return new Promise(function(_0x389afe,_0xdca95d){var _0x422509=_[_0x86d3('0x5b')](_0x2501dd['outboundChannels']);_0x389afe({'count':_0x422509[_0x86d3('0x5d')],'rows':_0x422509});});},'Outbound':function(_0x1aaf08){return new Promise(function(_0x47fa9d,_0x33d5e3){_0x47fa9d(_0x2501dd[_0x86d3('0x2e')]);});},'Campaigns':function(_0x1ddd75){return new Promise(function(_0x34ce50,_0x4cc6ec){var _0x4362e4=_[_0x86d3('0x5b')](_0x2501dd[_0x86d3('0x77')]);_0x34ce50({'count':_0x4362e4[_0x86d3('0x5d')],'rows':_0x4362e4});});},'VoiceQueuesPreview':function(_0x44af1c){var _0x593dca=this;return new Promise(function(_0x37b080,_0x2fc26e){_0x4ef557[_0x86d3('0x78')](_0x44af1c['id'])[_0x86d3('0x18')](function(_0x1093a1){_0x37b080({'code':0xc8,'message':_0x1093a1[_0x86d3('0x19')]});})[_0x86d3('0x1a')](function(_0x32ca51){_0x2fc26e(_0x593dca[_0x86d3('0x1b')](0x1f4,_0x32ca51[_0x86d3('0x19')]));});});},'EventManager':function(_0x537e2c){var _0x5908ab=this;return new Promise(function(_0x11dcc1,_0x22b67b){if(!_0x537e2c['event']){return _0x22b67b(_0x5908ab[_0x86d3('0x1b')](0x1f4,_0x86d3('0x79')));}ami[_0x86d3('0x7a')](_0x86d3('0x7b')+_0x537e2c[_0x86d3('0x7c')],_0x537e2c[_0x86d3('0x19')]);_0x11dcc1({'code':0xc8,'message':_0x537e2c});});},'FaxAccounts':function(_0x1a6369){return new Promise(function(_0x419240,_0x3d7e6f){var _0x49e8bc=_['values'](_0x2501dd['faxAccounts']);_0x419240({'count':_0x49e8bc['length'],'rows':_0x49e8bc});});},'SendFax':function(_0xad83bf){var _0x2514c1=this;return new Promise(function(_0x28a509,_0x3d2b13){_0x2d8272[_0x86d3('0x7d')](_0xad83bf)[_0x86d3('0x18')](function(_0x20f006){_0x28a509({'code':0xc8,'message':_0x20f006['message']});})[_0x86d3('0x1a')](function(_0xcf1fc8){_0x3d2b13(_0x2514c1[_0x86d3('0x1b')](0x1f4,_0xcf1fc8[_0x86d3('0x19')]));});});},'CheckAfterSend':function(_0x557034){var _0xe239b5=this;return new Promise(function(_0x5d5314,_0x441a7d){_0x2d8272[_0x86d3('0x7e')](_0x557034)[_0x86d3('0x18')](function(_0x23de37){_0x5d5314({'code':0xc8,'message':_0x23de37[_0x86d3('0x19')]});})['catch'](function(_0x559130){_0x441a7d(_0xe239b5[_0x86d3('0x1b')](0x1f4,_0x559130['message']));});});}};var _0x3cadd9=jayson['server'](_0x2eaa15)[_0x86d3('0x7f')]();_0x3cadd9['on']('error',function(_0x4c9067){return _0x33d4aa(_0x4c9067);});_0x3cadd9[_0x86d3('0x5')](0x232a,_0x86d3('0x80'),function(){console[_0x86d3('0x81')](_0x86d3('0x82'),0x232a);return _0xfbbc15(_0x86d3('0x83')+0x232a);});});};
\ No newline at end of file
+var _0xdbb1=['asterisk','username','join','pick','keys','action','Reload','then','message','catch','ami\x20disconnected','command','Command','Action','content','voiceQueues','strategy','answered','loggedIn','pTalking','sumBillable','talking','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','omit','undefined','values','length','voicechannel','validate','map','channels','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','bluebird','../properties','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbb1,0x105));var _0x1dbb=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xdbb1[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x1dbb('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0x1dbb('0x1'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x1dbb('0x2'));var ami=require('../ami');exports[_0x1dbb('0x3')]=function(_0xd53e45,_0x550e25,_0x55df0f){return new BPromise(function(_0xd43ce8,_0x38259d){var _0x2070a8={'QueuePause':function(_0x7c2269){return new Promise(function(_0x5e622c,_0x3ffb54){var _0xf42424=util['format'](_0x1dbb('0x4'),_0x1dbb('0x5'),_0x7c2269[_0x1dbb('0x6')]);if(_0xd53e45[_0x1dbb('0x7')]&&_0xd53e45[_0x1dbb('0x7')][_0xf42424]&&_0xd53e45[_0x1dbb('0x7')][_0xf42424][_0x1dbb('0x8')]){_0xd53e45[_0x1dbb('0x7')][_0xf42424][_0x1dbb('0x9')]();}if(_0xd53e45[_0x1dbb('0xa')][_0xf42424]){_0xd53e45[_0x1dbb('0xa')][_0xf42424]['updateStatusRealtime']({'statePause':_0x7c2269[_0x1dbb('0xb')]?!![]:![]});}_0x5e622c({'code':0xc8,'message':_0x1dbb('0xc')});});},'Reload':function(_0x332380){var _0xd3fea1=this;return new Promise(function(_0x539f2c,_0x506db4){if(ami[_0x1dbb('0xd')]()==![]){return _0x506db4(_0xd3fea1[_0x1dbb('0xe')](0x1f4,[config[_0x1dbb('0xf')]['ip'],config[_0x1dbb('0xf')][_0x1dbb('0x10')],'ami\x20disconnected'][_0x1dbb('0x11')]('\x20')));}_0x332380=_[_0x1dbb('0x12')](_0x332380,_[_0x1dbb('0x13')](properties['module']));_0x332380[_0x1dbb('0x14')]=_0x1dbb('0x15');return ami['Action'](_0x332380)[_0x1dbb('0x16')](function(_0x376daa){_0x539f2c({'code':0xc8,'message':_0x376daa[_0x1dbb('0x17')]});})[_0x1dbb('0x18')](function(_0xb21bc5){_0x506db4(_0xd3fea1[_0x1dbb('0xe')](0x1f5,_0xb21bc5[_0x1dbb('0x17')]));});});},'Command':function(_0x239082){var _0x58aa43=this;return new Promise(function(_0x550dd4,_0x4802ba){if(ami[_0x1dbb('0xd')]()==![]){return _0x4802ba(_0x58aa43[_0x1dbb('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x1dbb('0xf')][_0x1dbb('0x10')],_0x1dbb('0x19')][_0x1dbb('0x11')]('\x20')));}_0x239082=_[_0x1dbb('0x12')](_0x239082,_0x1dbb('0x1a'));_0x239082[_0x1dbb('0x14')]=_0x1dbb('0x1b');return ami[_0x1dbb('0x1c')](_0x239082)[_0x1dbb('0x16')](function(_0x2a2458){_0x550dd4({'code':0xc8,'message':_0x2a2458[_0x1dbb('0x1d')]});})[_0x1dbb('0x18')](function(_0x429253){_0x4802ba(_0x58aa43[_0x1dbb('0xe')](0x1f5,_0x429253[_0x1dbb('0x17')]));});});},'VoiceQueues':function(_0x2945ec){return new Promise(function(_0xc33a9f,_0x18f188){var _0x57a9f0=[];for(var _0x44eff7 in _0xd53e45['voiceQueues']){if(_0xd53e45[_0x1dbb('0x1e')]['hasOwnProperty'](_0x44eff7)){var _0x72cfed=_0xd53e45[_0x1dbb('0x1e')][_0x44eff7];var _0x346372={'id':_0x72cfed['id'],'name':_0x72cfed[_0x1dbb('0x6')],'strategy':_0x72cfed[_0x1dbb('0x1f')],'answered':_0x72cfed[_0x1dbb('0x20')],'available':_0x72cfed['available'],'loggedIn':_0x72cfed[_0x1dbb('0x21')],'pTalking':_0x72cfed[_0x1dbb('0x22')],'sumBillable':_0x72cfed[_0x1dbb('0x23')],'sumDuration':_0x72cfed['sumDuration'],'sumHoldTime':_0x72cfed['sumHoldTime']||0x0,'talking':_0x72cfed[_0x1dbb('0x24')],'total':_0x72cfed['total'],'type':_0x72cfed['type'],'unmanaged':_0x72cfed[_0x1dbb('0x25')],'abandoned':_0x72cfed[_0x1dbb('0x26')],'waiting':_0x72cfed[_0x1dbb('0x27')],'loggedInDb':_0x72cfed[_0x1dbb('0x28')]};if(_0x72cfed[_0x1dbb('0x29')]===_0x1dbb('0x2a')){_0x346372[_0x1dbb('0x2b')]=_0x72cfed[_0x1dbb('0x2b')];_0x346372[_0x1dbb('0x2c')]=_0x72cfed['dialMethod'];_0x346372['dialOriginateCallerIdName']=_0x72cfed[_0x1dbb('0x2d')];_0x346372[_0x1dbb('0x2e')]=_0x72cfed[_0x1dbb('0x2e')];_0x346372['dialOriginateTimeout']=_0x72cfed['dialOriginateTimeout'];_0x346372[_0x1dbb('0x2f')]=_0x72cfed[_0x1dbb('0x2f')];_0x346372[_0x1dbb('0x30')]=_0x72cfed['temp'];_0x346372['outboundAnswerAgiCallsDay']=_0x72cfed[_0x1dbb('0x31')];_0x346372[_0x1dbb('0x32')]=_0x72cfed['outboundAnswerCallsDay'];_0x346372[_0x1dbb('0x33')]=_0x72cfed[_0x1dbb('0x33')];_0x346372[_0x1dbb('0x34')]=_0x72cfed[_0x1dbb('0x34')];_0x346372['outboundCongestionCallsDay']=_0x72cfed[_0x1dbb('0x35')];_0x346372[_0x1dbb('0x36')]=_0x72cfed[_0x1dbb('0x36')];_0x346372[_0x1dbb('0x37')]=_0x72cfed[_0x1dbb('0x37')];_0x346372[_0x1dbb('0x38')]=_0x72cfed['outboundDropCallsDayTimeout'];_0x346372[_0x1dbb('0x39')]=_0x72cfed[_0x1dbb('0x39')];_0x346372['outboundNoSuchCallsDay']=_0x72cfed[_0x1dbb('0x3a')];_0x346372[_0x1dbb('0x3b')]=_0x72cfed[_0x1dbb('0x3b')];_0x346372[_0x1dbb('0x3c')]=_0x72cfed[_0x1dbb('0x3c')];_0x346372['outboundRejectCallsDay']=_0x72cfed[_0x1dbb('0x3d')];_0x346372[_0x1dbb('0x3e')]=_0x72cfed[_0x1dbb('0x3e')];_0x346372[_0x1dbb('0x3f')]=_0x72cfed[_0x1dbb('0x3f')];_0x346372[_0x1dbb('0x40')]=_0x72cfed['predictiveIntervalAvgHoldtime'];_0x346372[_0x1dbb('0x41')]=_0x72cfed[_0x1dbb('0x41')];_0x346372['predictiveIntervalDroppedCallsCallersExit']=_0x72cfed[_0x1dbb('0x42')];_0x346372[_0x1dbb('0x43')]=_0x72cfed[_0x1dbb('0x43')];_0x346372[_0x1dbb('0x44')]=_0x72cfed[_0x1dbb('0x44')];_0x346372[_0x1dbb('0x45')]=_0x72cfed[_0x1dbb('0x45')];_0x346372[_0x1dbb('0x46')]=_0x72cfed[_0x1dbb('0x46')];_0x346372[_0x1dbb('0x47')]=_0x72cfed[_0x1dbb('0x47')];_0x346372[_0x1dbb('0x48')]=_0x72cfed[_0x1dbb('0x48')];_0x346372['predictiveIntervalAvailable']=_0x72cfed[_0x1dbb('0x49')];_0x346372[_0x1dbb('0x4a')]=_0x72cfed[_0x1dbb('0x4a')];_0x346372[_0x1dbb('0x17')]=_0x72cfed[_0x1dbb('0x17')];_0x346372[_0x1dbb('0x4b')]=_0x72cfed[_0x1dbb('0x4b')];_0x346372[_0x1dbb('0x4c')]=_0x72cfed[_0x1dbb('0x4c')];_0x346372[_0x1dbb('0x4d')]=_0x72cfed[_0x1dbb('0x4d')];_0x346372[_0x1dbb('0x4e')]=_0x72cfed[_0x1dbb('0x4e')];_0x346372['erlangBusyFactor']=_0x72cfed[_0x1dbb('0x4f')];_0x346372[_0x1dbb('0x50')]=_0x72cfed[_0x1dbb('0x50')];_0x346372[_0x1dbb('0x51')]=_0x72cfed['startProgressive'];}if(_0x72cfed[_0x1dbb('0x52')]){_0x346372[_0x1dbb('0x52')]={'id':_0x72cfed[_0x1dbb('0x52')]['id'],'name':_0x72cfed[_0x1dbb('0x52')][_0x1dbb('0x6')],'active':_0x72cfed[_0x1dbb('0x52')][_0x1dbb('0x53')],'callerid':_0x72cfed[_0x1dbb('0x52')]['callerid']};}if(_0x72cfed[_0x1dbb('0x54')]){_0x346372[_0x1dbb('0x54')]={'id':_0x72cfed[_0x1dbb('0x54')]['id'],'name':_0x72cfed[_0x1dbb('0x54')][_0x1dbb('0x6')]};}_0x57a9f0[_0x1dbb('0x55')](_0x346372);}}_0xc33a9f({'count':_0x57a9f0['length'],'rows':_0x57a9f0});});},'UpdateVoiceQueue':function(_0x4541bc){return new Promise(function(_0x4a8507,_0x11ae4c){var _0xa2942d=_['find'](_0xd53e45[_0x1dbb('0x1e')],{'id':parseInt(_0x4541bc['id'])});var _0x4349a6=_[_0x1dbb('0x56')](_0x4541bc,['id']);if(_0xa2942d){for(var _0x13972d in _0x4349a6){if(typeof _0x4349a6[_0x13972d]!==_0x1dbb('0x57')&&typeof _0xa2942d[_0x13972d]!=='undefined'){_0xa2942d[_0x13972d]=_0x4349a6[_0x13972d];}}_0x4a8507(_0xa2942d);}else{_0x11ae4c();}});},'VoiceChannels':function(_0x3ac569){return new Promise(function(_0x163437,_0x1406a4){var _0x436b78=_[_0x1dbb('0x58')](_0xd53e45['channels']);_0x163437({'count':_0x436b78[_0x1dbb('0x59')],'rows':_0x436b78});});},'VoiceChannelMixMonitor':function(_0x520fe4){var _0x5bad3f=this;return new Promise(function(_0x1273a0,_0x5dd627){if(ami[_0x1dbb('0xd')]()==![]){return _0x5dd627(_0x5bad3f[_0x1dbb('0xe')](0x1f4,[config[_0x1dbb('0xf')]['ip'],config[_0x1dbb('0xf')][_0x1dbb('0x10')],_0x1dbb('0x19')]['join']('\x20')));}var _0x16cf4f=schema(properties[_0x1dbb('0x5a')])[_0x1dbb('0x5b')](_0x520fe4);if(_0x16cf4f[_0x1dbb('0x59')]>0x0){return _0x5dd627(_0x5bad3f[_0x1dbb('0xe')](0x1f4,_[_0x1dbb('0x5c')](_0x16cf4f,'message')['join'](',\x20')));}var _0xc071cc=_['find'](_0xd53e45[_0x1dbb('0x5d')],{'uniqueid':_0x520fe4[_0x1dbb('0x5e')]});if(_0xc071cc&&_0xc071cc[_0x1dbb('0x5f')]){var _0x4c3b99=util[_0x1dbb('0x60')](_0x1dbb('0x61'),_0x520fe4[_0x1dbb('0x62')]||_0x520fe4[_0x1dbb('0x5e')],_0x520fe4['format']||_0x1dbb('0x63'));return ami[_0x1dbb('0x1c')]({'action':_0x1dbb('0x64'),'channel':_0xc071cc[_0x1dbb('0x5f')],'file':_0x4c3b99,'options':_0x1dbb('0x65')})[_0x1dbb('0x16')](function(_0x191a13){var _0x7a64a3=_[_0x1dbb('0x66')](_0xc071cc[_0x1dbb('0x67')],{'filename':_0x1dbb('0x68')+_0x4c3b99[_0x1dbb('0x69')]()});if(_[_0x1dbb('0x6a')](_0x7a64a3)){_0xc071cc[_0x1dbb('0x67')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x4c3b99[_0x1dbb('0x69')](),'createdAt':moment()['format'](_0x1dbb('0x6b')),'mixmonitorid':_0x191a13[_0x1dbb('0x6c')],'status':_0x1dbb('0x6d')});}else{_0x7a64a3[_0x1dbb('0x6c')]=_0x191a13[_0x1dbb('0x6c')];_0x7a64a3[_0x1dbb('0x6e')]=_0x1dbb('0x6d');}_0x1273a0({'code':0xc8,'message':[_0x520fe4[_0x1dbb('0x5e')],_0x1dbb('0x6f'),_0x191a13[_0x1dbb('0x6c')]][_0x1dbb('0x11')]('\x20'),'mixmonitorid':_0x191a13['mixmonitorid']});})[_0x1dbb('0x18')](function(_0x46b18e){_0x5dd627(_0x5bad3f['error'](0x1f5,[_0x520fe4[_0x1dbb('0x5e')],_0x46b18e[_0x1dbb('0x17')][_0x1dbb('0x69')]()]['join']('\x20')));});}else{return _0x5dd627(_0x5bad3f[_0x1dbb('0xe')](0x1f5,_0x1dbb('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x1d8594){var _0xeb117b=this;return new Promise(function(_0x453726,_0x18ecbc){if(ami[_0x1dbb('0xd')]()==![]){return _0x18ecbc(_0xeb117b[_0x1dbb('0xe')](0x1f4,[config[_0x1dbb('0xf')]['ip'],config[_0x1dbb('0xf')][_0x1dbb('0x10')],_0x1dbb('0x19')][_0x1dbb('0x11')]('\x20')));}var _0x1fd605=schema(properties[_0x1dbb('0x5a')])[_0x1dbb('0x5b')](_0x1d8594);if(_0x1fd605[_0x1dbb('0x59')]>0x0){return _0x18ecbc(_0xeb117b['error'](0x1f4,_[_0x1dbb('0x5c')](_0x1fd605,_0x1dbb('0x17'))[_0x1dbb('0x11')](',\x20')));}var _0x1d8b95=_[_0x1dbb('0x66')](_0xd53e45[_0x1dbb('0x5d')],{'uniqueid':_0x1d8594[_0x1dbb('0x5e')]});if(_0x1d8b95){return BPromise[_0x1dbb('0x71')]()[_0x1dbb('0x16')](function(){if(_0x1d8b95[_0x1dbb('0x5f')]){return ami[_0x1dbb('0x1c')]({'action':'StopMixMonitor','channel':_0x1d8b95['channel'],'mixmonitorid':_0x1d8594[_0x1dbb('0x6c')]})[_0x1dbb('0x18')](function(_0x341b1b){});}})[_0x1dbb('0x16')](function(){if(_0x1d8b95['destinationchannel']){return ami['Action']({'action':_0x1dbb('0x72'),'channel':_0x1d8b95[_0x1dbb('0x73')],'mixmonitorid':_0x1d8594[_0x1dbb('0x6c')]})[_0x1dbb('0x18')](function(_0x2e42dc){});}})[_0x1dbb('0x16')](function(_0x2b2746){var _0x5b7de7=_[_0x1dbb('0x66')](_0x1d8b95[_0x1dbb('0x67')],{'mixmonitorid':_0x1d8594[_0x1dbb('0x6c')]});if(_0x5b7de7){_0x5b7de7[_0x1dbb('0x6e')]='stop';}})[_0x1dbb('0x16')](function(){var _0x7e4e28=util[_0x1dbb('0x60')](_0x1dbb('0x61'),_0x1d8594[_0x1dbb('0x62')]||_0x1d8594[_0x1dbb('0x5e')],_0x1d8594[_0x1dbb('0x60')]||_0x1dbb('0x63'));var _0x30a6ef=_['find'](_0x1d8b95[_0x1dbb('0x67')],{'filename':_0x1dbb('0x68')+_0x7e4e28[_0x1dbb('0x69')]()});if(_0x30a6ef){_0x30a6ef[_0x1dbb('0x6e')]=_0x1dbb('0x74');}})['then'](function(){_0x453726({'code':0xc8,'message':[_0x1d8594[_0x1dbb('0x5e')],_0x1dbb('0x75')]['join']('\x20')});})[_0x1dbb('0x18')](function(_0x2c4a2e){_0x18ecbc(_0xeb117b[_0x1dbb('0xe')](0x1f5,[_0x1d8594[_0x1dbb('0x5e')],_0x2c4a2e[_0x1dbb('0x17')][_0x1dbb('0x69')]()][_0x1dbb('0x11')]('\x20')));});}else{return _0x18ecbc(_0xeb117b['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0xaa3950){return new Promise(function(_0x30d7dc,_0x16fd57){var _0x44d430=_[_0x1dbb('0x58')](_0xd53e45[_0x1dbb('0x76')]);_0x30d7dc({'count':_0x44d430['length'],'rows':_0x44d430});});},'VoiceQueuesChannel':function(_0x3d62d9){var _0x51999d=this;return new Promise(function(_0x5a2713,_0x2d8e37){var _0x3aac00=schema(properties[_0x1dbb('0x77')])[_0x1dbb('0x5b')](_0x3d62d9);if(_0x3aac00[_0x1dbb('0x59')]>0x0){return _0x2d8e37(_0x51999d[_0x1dbb('0xe')](0x1f4,_[_0x1dbb('0x5c')](_0x3aac00,_0x1dbb('0x17'))['join'](',\x20')));}var _0x2bf585=_[_0x1dbb('0x66')](_0xd53e45[_0x1dbb('0x76')],{'uniqueid':_0x3d62d9[_0x1dbb('0x5e')]});if(_0x2bf585){_0x5a2713(_0x2bf585);}else{return _0x2d8e37(_0x51999d['error'](0x1f5,_0x1dbb('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x5f1076){var _0x44bf98=this;return new Promise(function(_0x44549d,_0x5e0bbd){if(ami[_0x1dbb('0xd')]()==![]){return _0x5e0bbd(_0x44bf98[_0x1dbb('0xe')](0x1f4,[config[_0x1dbb('0xf')]['ip'],config[_0x1dbb('0xf')][_0x1dbb('0x10')],'ami\x20disconnected'][_0x1dbb('0x11')]('\x20')));}var _0x2752c1=schema(properties[_0x1dbb('0x78')])[_0x1dbb('0x5b')](_0x5f1076);if(_0x2752c1[_0x1dbb('0x59')]>0x0){return _0x5e0bbd(_0x44bf98[_0x1dbb('0xe')](0x1f4,_['map'](_0x2752c1,_0x1dbb('0x17'))['join'](',\x20')));}var _0x520f45=_[_0x1dbb('0x66')](_0xd53e45['queueChannels'],{'uniqueid':_0x5f1076[_0x1dbb('0x5e')]});if(_0x520f45&&_0x520f45[_0x1dbb('0x5f')]){return ami[_0x1dbb('0x1c')]({'action':_0x1dbb('0x79'),'channel':_0x520f45[_0x1dbb('0x5f')]})[_0x1dbb('0x16')](function(_0x4f60b4){_0x44549d({'code':0xc8,'message':[_0x5f1076[_0x1dbb('0x5e')],_0x4f60b4[_0x1dbb('0x17')][_0x1dbb('0x69')]()][_0x1dbb('0x11')]('\x20')});})[_0x1dbb('0x18')](function(_0x59d7c3){_0x5e0bbd(_0x44bf98['error'](0x1f5,[_0x5f1076[_0x1dbb('0x5e')],_0x59d7c3[_0x1dbb('0x17')]['toLowerCase']()][_0x1dbb('0x11')]('\x20')));});}else{return _0x5e0bbd(_0x44bf98[_0x1dbb('0xe')](0x1f5,_0x1dbb('0x70')));}});},'VoiceQueuesChannelRedirect':function(_0x541051){var _0x57f8c5=this;return new Promise(function(_0x2968f5,_0x29be95){if(ami[_0x1dbb('0xd')]()==![]){return _0x29be95(_0x57f8c5[_0x1dbb('0xe')](0x1f4,[config[_0x1dbb('0xf')]['ip'],config[_0x1dbb('0xf')][_0x1dbb('0x10')],_0x1dbb('0x19')][_0x1dbb('0x11')]('\x20')));}var _0x986f4f=schema(properties['voicequeuechannelredirect'])[_0x1dbb('0x5b')](_0x541051);if(_0x986f4f[_0x1dbb('0x59')]>0x0){return _0x29be95(_0x57f8c5[_0x1dbb('0xe')](0x1f4,_[_0x1dbb('0x5c')](_0x986f4f,_0x1dbb('0x17'))[_0x1dbb('0x11')](',\x20')));}var _0x2c6b00=_[_0x1dbb('0x66')](_0xd53e45[_0x1dbb('0x76')],{'uniqueid':_0x541051['uniqueid']});if(_0x2c6b00&&_0x2c6b00[_0x1dbb('0x5f')]){return ami['Action']({'action':_0x1dbb('0x7a'),'channel':_0x2c6b00['channel'],'exten':_0x541051[_0x1dbb('0x7b')],'context':_0x541051[_0x1dbb('0x7c')]||_0x2c6b00['context'],'priority':0x1})[_0x1dbb('0x16')](function(_0x1232ce){_0x2968f5({'code':0xc8,'message':[_0x541051[_0x1dbb('0x5e')],_0x1232ce[_0x1dbb('0x17')][_0x1dbb('0x69')]()]['join']('\x20')});})[_0x1dbb('0x18')](function(_0x3a2536){_0x29be95(_0x57f8c5[_0x1dbb('0xe')](0x1f5,[_0x541051[_0x1dbb('0x5e')],_0x3a2536[_0x1dbb('0x17')][_0x1dbb('0x69')]()]['join']('\x20')));});}else{return _0x29be95(_0x57f8c5[_0x1dbb('0xe')](0x1f5,_0x1dbb('0x70')));}});},'Agents':function(_0x2939a0){return new Promise(function(_0x471573,_0x5a5cb5){var _0x23b2aa=_[_0x1dbb('0x58')](_0xd53e45[_0x1dbb('0xa')]);_0x471573({'count':_0x23b2aa[_0x1dbb('0x59')],'rows':_0x23b2aa});});},'Telephones':function(_0x20b43a){return new Promise(function(_0x3e9bba,_0xec8c13){var _0x3e22a7=_[_0x1dbb('0x58')](_0xd53e45[_0x1dbb('0x7d')]);_0x3e9bba({'count':_0x3e22a7[_0x1dbb('0x59')],'rows':_0x3e22a7});});},'Trunks':function(_0x3e0274){return new Promise(function(_0x5eb878,_0x2e3fd8){var _0x3270de=_[_0x1dbb('0x58')](_0xd53e45['trunks']);_0x5eb878({'count':_0x3270de[_0x1dbb('0x59')],'rows':_0x3270de});});},'OutboundChannels':function(_0x36ada9){return new Promise(function(_0x298141,_0x5339d9){var _0x5264ef=_[_0x1dbb('0x58')](_0xd53e45[_0x1dbb('0x7e')]);_0x298141({'count':_0x5264ef[_0x1dbb('0x59')],'rows':_0x5264ef});});},'Outbound':function(_0x6bb668){return new Promise(function(_0x34d856,_0x49274e){_0x34d856(_0xd53e45[_0x1dbb('0x2a')]);});},'Campaigns':function(_0x1cd71c){return new Promise(function(_0x24921d,_0x43ee89){var _0x492c33=_[_0x1dbb('0x58')](_0xd53e45[_0x1dbb('0x7f')]);_0x24921d({'count':_0x492c33[_0x1dbb('0x59')],'rows':_0x492c33});});},'VoiceQueuesPreview':function(_0x24dca8){var _0x373ee8=this;return new Promise(function(_0x3c0dc4,_0x5d3fe4){_0x550e25['run'](_0x24dca8['id'])[_0x1dbb('0x16')](function(_0x1c459e){_0x3c0dc4({'code':0xc8,'message':_0x1c459e[_0x1dbb('0x17')]});})[_0x1dbb('0x18')](function(_0x44fd09){_0x5d3fe4(_0x373ee8[_0x1dbb('0xe')](0x1f4,_0x44fd09['message']));});});},'EventManager':function(_0x52e5b0){var _0x21db27=this;return new Promise(function(_0xc01d4c,_0x43a488){if(!_0x52e5b0[_0x1dbb('0x80')]){return _0x43a488(_0x21db27['error'](0x1f4,_0x1dbb('0x81')));}ami[_0x1dbb('0x82')]('custom:'+_0x52e5b0[_0x1dbb('0x80')],_0x52e5b0[_0x1dbb('0x17')]);_0xc01d4c({'code':0xc8,'message':_0x52e5b0});});},'FaxAccounts':function(_0x4cac08){return new Promise(function(_0x52bb25,_0x3c4d97){var _0x311d6d=_[_0x1dbb('0x58')](_0xd53e45['faxAccounts']);_0x52bb25({'count':_0x311d6d['length'],'rows':_0x311d6d});});},'SendFax':function(_0x4653d9){var _0x4ecc56=this;return new Promise(function(_0x446cbf,_0x2a7b73){_0x55df0f[_0x1dbb('0x83')](_0x4653d9)[_0x1dbb('0x16')](function(_0x467b90){_0x446cbf({'code':0xc8,'message':_0x467b90[_0x1dbb('0x17')]});})[_0x1dbb('0x18')](function(_0x19657e){_0x2a7b73(_0x4ecc56['error'](0x1f4,_0x19657e['message']));});});},'CheckAfterSend':function(_0x17d5c7){var _0x5ec2d7=this;return new Promise(function(_0xfb92a2,_0x99b718){_0x55df0f[_0x1dbb('0x84')](_0x17d5c7)[_0x1dbb('0x16')](function(_0x31e859){_0xfb92a2({'code':0xc8,'message':_0x31e859[_0x1dbb('0x17')]});})[_0x1dbb('0x18')](function(_0x1a96c3){_0x99b718(_0x5ec2d7[_0x1dbb('0xe')](0x1f4,_0x1a96c3['message']));});});}};var _0x4f2c36=jayson[_0x1dbb('0x85')](_0x2070a8)['http']();_0x4f2c36['on'](_0x1dbb('0xe'),function(_0x458b6e){return _0x38259d(_0x458b6e);});_0x4f2c36[_0x1dbb('0x3')](0x232a,_0x1dbb('0x86'),function(){console[_0x1dbb('0x87')](_0x1dbb('0x88'),0x232a);return _0xd43ce8(_0x1dbb('0x89')+0x232a);});});};
\ No newline at end of file
index 2a5f3e3..145e35e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','format','user:%s','name','trigger:%s','action'];(function(_0x8052e5,_0x5823a3){var _0x16418c=function(_0x39ffc7){while(--_0x39ffc7){_0x8052e5['push'](_0x8052e5['shift']());}};_0x16418c(++_0x5823a3);}(_0x4ea3,0x70));var _0x34ea=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ea3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x34ea('0x0'));var BPromise=require(_0x34ea('0x1'));var Redis=require(_0x34ea('0x2'));var util=require(_0x34ea('0x3'));var config=require('../../../../config/environment');var logger=require(_0x34ea('0x4'))('trigger');var cmContactRpc=require(_0x34ea('0x5'));config['redis']=_['defaults'](config[_0x34ea('0x6')],{'host':_0x34ea('0x7'),'port':0x18eb});var io=require(_0x34ea('0x8'))(new Redis(config[_0x34ea('0x6')]));function emit(_0x40434e,_0x18b461,_0x22b09e,_0x5bec7c,_0x341727){logger[_0x34ea('0x9')](_0x34ea('0xa'),_0x40434e,_0x18b461['id'],_0x22b09e,_0x5bec7c,JSON['stringify'](_0x341727));io['to'](_0x22b09e)[_0x34ea('0xb')](_0x5bec7c,_0x341727);}exports[_0x34ea('0xc')]=function(_0x5126de,_0x4a76b1,_0x5bd8b6,_0x346287){var _0x167667,_0x58bb0d;var _0x11229e={};var _0x29a5c8=Number(_0x5bd8b6[_0x34ea('0xd')]);var _0x233b11=_0x5bd8b6[_0x34ea('0xe')]?Boolean(Number(_0x5bd8b6[_0x34ea('0xe')])):![];var _0x37e1b4;var _0x36af43=![];if(!_[_0x34ea('0xf')](_0x5bd8b6[_0x34ea('0x10')])){if(_0x5bd8b6[_0x34ea('0x10')]=='1')_0x36af43=!![];}if(!_0x36af43){if(_0x346287['xmd-contactid']){_0x11229e['id']=_0x346287[_0x34ea('0x11')];}}if(!_0x11229e['id']){_0x11229e[_0x34ea('0x12')]=_0x29a5c8;_0x37e1b4=_0x5bd8b6[_0x34ea('0x13')]&&_0x5bd8b6[_0x34ea('0x13')]!=='0'?_0x5bd8b6[_0x34ea('0x13')]['split'](','):[_0x34ea('0x14')];_0x11229e[_0x34ea('0x15')]=_[_0x34ea('0x16')](_0x37e1b4,function(_0x305576){var _0x5f420f={};_0x5f420f[_0x305576]=_0x346287[_0x34ea('0x17')]?_0x346287[_0x34ea('0x18')]:_0x346287[_0x34ea('0x19')];return _0x5f420f;});}var _0x5340a4=['id',_0x34ea('0x1a'),_0x34ea('0x1b'),_0x34ea('0x14'),_0x34ea('0x1c'),'fax',_0x34ea('0x12'),_0x34ea('0x1d'),_0x34ea('0x1e'),_0x34ea('0x1f')];var _0x4fc1a2=_['union'](_0x5340a4,_0x37e1b4);BPromise[_0x34ea('0x20')]()[_0x34ea('0x21')](cmContactRpc[_0x34ea('0x22')]({'attributes':_0x4fc1a2,'where':_0x11229e}))['then'](function(_0x5197a2){_0x58bb0d=_0x5197a2;if(!_[_0x34ea('0x23')](_0x58bb0d)){if(_0x58bb0d[_0x34ea('0x24')]===0x1){_0x167667=_0x58bb0d[0x0];logger[_0x34ea('0x9')](_0x34ea('0x25'),_0x346287[_0x34ea('0x26')],_0x4a76b1['id'],_0x167667['id']);}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x346287[_0x34ea('0x26')],_0x4a76b1['id'],_[_0x34ea('0x16')](_0x58bb0d,'id')[_0x34ea('0x27')](','));}return;}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x346287['uniqueid'],_0x4a76b1['id']);var _0x564d1b={'ListId':_0x29a5c8};var _0x142709=_0x5bd8b6[_0x34ea('0x28')]&&_0x5bd8b6[_0x34ea('0x28')]!=='0'?_0x5bd8b6[_0x34ea('0x28')]:'phone';if(_0x233b11){logger[_0x34ea('0x9')](_0x34ea('0x29'),_0x346287[_0x34ea('0x26')],_0x4a76b1['id']);_0x564d1b[_0x142709]=_['isNil'](_0x346287['routeId'])?_0x346287['calleridnum']:_0x346287['destcalleridnum'];if(_[_0x34ea('0xf')](_0x346287[_0x34ea('0x17')])){_0x564d1b[_0x34ea('0x1a')]=_0x346287[_0x34ea('0x2a')]&&_0x346287['calleridname']!==_0x34ea('0x2b')?_0x346287['calleridname']:_0x34ea('0x2c');}else{_0x564d1b['firstName']=_0x346287[_0x34ea('0x2d')]&&_0x346287[_0x34ea('0x2d')]!==_0x34ea('0x2b')?_0x346287['destcalleridname']:_0x34ea('0x2c');}return BPromise[_0x34ea('0x20')]()['then'](cmContactRpc[_0x34ea('0x2e')](_0x564d1b))['then'](function(_0x1392b6){_0x167667=_0x1392b6;_0x58bb0d[_0x34ea('0x2f')](_0x1392b6);if(_0x167667){logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x346287['uniqueid'],_0x4a76b1['id'],_0x167667['id']);}return;});}else{logger[_0x34ea('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x346287[_0x34ea('0x26')],_0x4a76b1['id']);_0x564d1b[_0x142709]=_[_0x34ea('0xf')](_0x346287['routeId'])?_0x346287[_0x34ea('0x19')]:_0x346287[_0x34ea('0x18')];if(_[_0x34ea('0xf')](_0x346287[_0x34ea('0x17')])){_0x564d1b['firstName']=_0x346287['calleridname']&&_0x346287['calleridname']!==_0x34ea('0x2b')?_0x346287[_0x34ea('0x2a')]:_0x34ea('0x2c');}else{_0x564d1b['firstName']=_0x346287['destcalleridname']&&_0x346287['destcalleridname']!==_0x34ea('0x2b')?_0x346287[_0x34ea('0x2d')]:'Unknown';}_0x167667=_0x564d1b;_0x58bb0d[_0x34ea('0x2f')](_0x564d1b);return;}}})[_0x34ea('0x21')](function(){if(_0x5126de){emit(_0x346287[_0x34ea('0x26')],_0x4a76b1,util[_0x34ea('0x30')](_0x34ea('0x31'),_0x5126de[_0x34ea('0x32')]),util['format'](_0x34ea('0x33'),_0x5bd8b6[_0x34ea('0x34')][_0x34ea('0x35')]()),{'evt':_[_0x34ea('0x36')](_0x346287,{'autoCreate':_0x233b11}),'contact':_0x167667===undefined?{}:_0x167667,'contacts':_0x58bb0d['length']===0x0?undefined:_0x58bb0d});}});};
\ No newline at end of file
+var _0x3e74=['scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','merge','lodash','ioredis','util','../../../../config/environment','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','data1','data2','isNil','data5','ListId','data3','$or','map','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt'];(function(_0x3e7acb,_0x5e7b53){var _0x424971=function(_0x44d9fa){while(--_0x44d9fa){_0x3e7acb['push'](_0x3e7acb['shift']());}};_0x424971(++_0x5e7b53);}(_0x3e74,0x175));var _0x43e7=function(_0x52ada0,_0x4086c9){_0x52ada0=_0x52ada0-0x0;var _0x2d51d0=_0x3e74[_0x52ada0];return _0x2d51d0;};'use strict';var _=require(_0x43e7('0x0'));var BPromise=require('bluebird');var Redis=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var config=require(_0x43e7('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x43e7('0x4'));config['redis']=_[_0x43e7('0x5')](config[_0x43e7('0x6')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config[_0x43e7('0x6')]));function emit(_0x503698,_0x45a0d1,_0x3491d6,_0x2ede2d,_0x8528fc){logger[_0x43e7('0x9')]('[CM][%s][%s]',_0x503698,_0x45a0d1['id'],_0x3491d6,_0x2ede2d,JSON[_0x43e7('0xa')](_0x8528fc));io['to'](_0x3491d6)['emit'](_0x2ede2d,_0x8528fc);}exports['exec']=function(_0x39c8bd,_0x4139c9,_0x5c34f4,_0x2803d9){var _0x513707,_0xf7c520;var _0x37302c={};var _0x4ebc8e=Number(_0x5c34f4[_0x43e7('0xb')]);var _0xc960ea=_0x5c34f4[_0x43e7('0xc')]?Boolean(Number(_0x5c34f4[_0x43e7('0xc')])):![];var _0x4e008c;var _0x583d85=![];if(!_[_0x43e7('0xd')](_0x5c34f4[_0x43e7('0xe')])){if(_0x5c34f4[_0x43e7('0xe')]=='1')_0x583d85=!![];}if(!_0x583d85){if(_0x2803d9['xmd-contactid']){_0x37302c['id']=_0x2803d9['xmd-contactid'];}}if(!_0x37302c['id']){_0x37302c[_0x43e7('0xf')]=_0x4ebc8e;_0x4e008c=_0x5c34f4[_0x43e7('0x10')]&&_0x5c34f4[_0x43e7('0x10')]!=='0'?_0x5c34f4[_0x43e7('0x10')]['split'](','):['phone'];_0x37302c[_0x43e7('0x11')]=_[_0x43e7('0x12')](_0x4e008c,function(_0x273a32){var _0x5d346f={};_0x5d346f[_0x273a32]=_0x2803d9['routeId']?_0x2803d9[_0x43e7('0x13')]:_0x2803d9[_0x43e7('0x14')];return _0x5d346f;});}var _0x9037d3=['id',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),_0x43e7('0x19'),_0x43e7('0xf'),_0x43e7('0x1a'),_0x43e7('0x1b'),_0x43e7('0x1c')];var _0x4b5d64=_[_0x43e7('0x1d')](_0x9037d3,_0x4e008c);BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x1f')]({'attributes':_0x4b5d64,'where':_0x37302c}))[_0x43e7('0x20')](function(_0x3945bb){_0xf7c520=_0x3945bb;if(!_[_0x43e7('0x21')](_0xf7c520)){if(_0xf7c520[_0x43e7('0x22')]===0x1){_0x513707=_0xf7c520[0x0];logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_[_0x43e7('0x12')](_0xf7c520,'id')['join'](','));}return;}else{logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);var _0x5c5e67={'ListId':_0x4ebc8e};var _0x1af208=_0x5c34f4[_0x43e7('0x24')]&&_0x5c34f4[_0x43e7('0x24')]!=='0'?_0x5c34f4[_0x43e7('0x24')]:'phone';if(_0xc960ea){logger['info'](_0x43e7('0x25'),_0x2803d9['uniqueid'],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])?_0x2803d9[_0x43e7('0x14')]:_0x2803d9[_0x43e7('0x13')];if(_['isNil'](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x27')]:_0x43e7('0x29');}else{_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x2a')]&&_0x2803d9[_0x43e7('0x2a')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x2a')]:_0x43e7('0x29');}return BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x2b')](_0x5c5e67))[_0x43e7('0x20')](function(_0x3b8f78){_0x513707=_0x3b8f78;_0xf7c520[_0x43e7('0x2c')](_0x3b8f78);if(_0x513707){logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}return;});}else{logger[_0x43e7('0x9')](_0x43e7('0x2d'),_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_['isNil'](_0x2803d9['routeId'])?_0x2803d9['calleridnum']:_0x2803d9[_0x43e7('0x13')];if(_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!=='<unknown>'?_0x2803d9['calleridname']:'Unknown';}else{_0x5c5e67['firstName']=_0x2803d9['destcalleridname']&&_0x2803d9['destcalleridname']!=='<unknown>'?_0x2803d9[_0x43e7('0x2a')]:'Unknown';}_0x513707=_0x5c5e67;_0xf7c520[_0x43e7('0x2c')](_0x5c5e67);return;}}})[_0x43e7('0x20')](function(){if(_0x39c8bd){emit(_0x2803d9[_0x43e7('0x23')],_0x4139c9,util[_0x43e7('0x2e')](_0x43e7('0x2f'),_0x39c8bd[_0x43e7('0x30')]),util[_0x43e7('0x2e')]('trigger:%s',_0x5c34f4['action']['toLowerCase']()),{'evt':_[_0x43e7('0x31')](_0x2803d9,{'autoCreate':_0xc960ea}),'contact':_0x513707===undefined?{}:_0x513707,'contacts':_0xf7c520[_0x43e7('0x22')]===0x0?undefined:_0xf7c520});}});};
\ No newline at end of file
index 8417574..668ba5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a4d=['format','name','trigger:%s:%s','jscripty','user:%s','interface','trigger:%s','exec','integration','accounts','queue','urlforward','merge','search','AllConditions','every','checkConditions','some','AnyConditions','channel','field','account','ChatWebsiteId','value','AccountId','interaction','message','event','operator','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','exports','util','lodash','url','mustache','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','checkTriggers','status','checkTrigger','variables','Actions','length','action','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','600','data6','winApplication','winArguments'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9a4d,0xa8));var _0xd9a4=function(_0x4323be,_0x4127a9){_0x4323be=_0x4323be-0x0;var _0x51e495=_0x9a4d[_0x4323be];return _0x51e495;};'use strict';var util=require(_0xd9a4('0x0'));var _=require(_0xd9a4('0x1'));var url=require(_0xd9a4('0x2'));var Mustache=require(_0xd9a4('0x3'));var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0xd9a4('0x4'));var script=require(_0xd9a4('0x5'));var config=require(_0xd9a4('0x6'));var logger=require(_0xd9a4('0x7'))(_0xd9a4('0x8'));var ami=require('../ami');config[_0xd9a4('0x9')]=_[_0xd9a4('0xa')](config[_0xd9a4('0x9')],{'host':_0xd9a4('0xb'),'port':0x18eb});var io=require(_0xd9a4('0xc'))(new Redis(config[_0xd9a4('0x9')]));var operators={'equals':function(_0x535532,_0x444149){return _0x535532==_0x444149;},'not_equals':function(_0x297439,_0x45d15b){return _0x297439!=_0x45d15b;}};var barAndWebActions=[_0xd9a4('0xd'),'url',_0xd9a4('0xe')];function Trigger(_0x3c0e79){this[_0xd9a4('0xf')]=_0x3c0e79[_0xd9a4('0xf')];this[_0xd9a4('0x10')]=_0x3c0e79['agents'];this[_0xd9a4('0x11')]=_0x3c0e79[_0xd9a4('0x11')];this[_0xd9a4('0x12')]=_0x3c0e79['templates'];this[_0xd9a4('0x13')]=_0x3c0e79[_0xd9a4('0x13')];this[_0xd9a4('0x14')]=_0x3c0e79[_0xd9a4('0x14')];this[_0xd9a4('0x15')]=_0x3c0e79[_0xd9a4('0x15')];this[_0xd9a4('0x16')]=_0x3c0e79[_0xd9a4('0x16')];this[_0xd9a4('0x17')]=_0x3c0e79['sugarcrmAccounts'];this[_0xd9a4('0x18')]=_0x3c0e79[_0xd9a4('0x18')];this['deskAccounts']=_0x3c0e79[_0xd9a4('0x19')];this[_0xd9a4('0x1a')]=_0x3c0e79[_0xd9a4('0x1a')];this[_0xd9a4('0x1b')]=_0x3c0e79[_0xd9a4('0x1b')];this['dynamics365Accounts']=_0x3c0e79[_0xd9a4('0x1c')];this[_0xd9a4('0x1d')]=_0x3c0e79[_0xd9a4('0x1d')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xd9a4('0x15')],'sugarcrm':this[_0xd9a4('0x17')],'zoho':this[_0xd9a4('0x18')],'desk':this[_0xd9a4('0x19')],'vtiger':this[_0xd9a4('0x1a')],'dynamics365':this[_0xd9a4('0x1c')],'freshsales':this[_0xd9a4('0x1d')],'servicenow':this[_0xd9a4('0x1b')]};ami['on']('custom:agentcalled',this['syncCustomEvent']['bind'](this));ami['on'](_0xd9a4('0x1e'),this[_0xd9a4('0x1f')]['bind'](this));ami['on'](_0xd9a4('0x20'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x22'),this[_0xd9a4('0x1f')]['bind'](this));ami['on'](_0xd9a4('0x23'),this['syncCustomEvent'][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x24'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x25'),this[_0xd9a4('0x1f')]['bind'](this));ami['on'](_0xd9a4('0x26'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x27'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x28'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x29'),this['syncCustomEvent'][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x2a'),this[_0xd9a4('0x1f')]['bind'](this));ami['on'](_0xd9a4('0x2b'),this['syncAgentDial'][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x2c'),this['syncAgentDial'][_0xd9a4('0x21')](this));ami['on']('custom:dialend',this[_0xd9a4('0x2d')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x2e'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x2f'),this['syncCustomEvent'][_0xd9a4('0x21')](this));ami['on']('custom:substatus',this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0xd9a4('0x31'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x32'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x33'),this['syncCustomEvent'][_0xd9a4('0x21')](this));ami['on'](_0xd9a4('0x34'),this[_0xd9a4('0x1f')][_0xd9a4('0x21')](this));}Trigger[_0xd9a4('0x35')][_0xd9a4('0x36')]=function(_0x228457,_0x49d760,_0x2d4542){logger[_0xd9a4('0x37')](_0x228457,_0x49d760,JSON[_0xd9a4('0x38')](_0x2d4542));io['to'](_0x228457)['emit'](_0x49d760,_0x2d4542);};Trigger['prototype'][_0xd9a4('0x1f')]=function(_0x440836){var _0x55c04d=_[_0xd9a4('0x39')](_0x440836);if(typeof _0x55c04d[_0xd9a4('0x3a')]===_0xd9a4('0x3b')){_0x55c04d[_0xd9a4('0x3a')]='voice';}this[_0xd9a4('0x3c')](_0x55c04d);};Trigger[_0xd9a4('0x35')]['syncAgentDial']=function(_0x87b604){if(this['agents'][_0x87b604['interface']]){this[_0xd9a4('0x1f')](_0x87b604);}};Trigger[_0xd9a4('0x35')][_0xd9a4('0x3c')]=function(_0x47ff19){var _0x50b70f;for(var _0x410548 in this['triggers']){if(this[_0xd9a4('0xf')]['hasOwnProperty'](_0x410548)){if(this['triggers'][_0x410548][_0xd9a4('0x3d')]){_0x50b70f=this[_0xd9a4('0x3e')](this[_0xd9a4('0xf')][_0x410548],_0x47ff19);if(_0x50b70f){_['merge'](_0x47ff19,_0x47ff19[_0xd9a4('0x3f')]);for(var _0x1eeec8=0x0,_0x22ff92,_0x20f341,_0x4de6f8;_0x1eeec8<this[_0xd9a4('0xf')][_0x410548][_0xd9a4('0x40')][_0xd9a4('0x41')];_0x1eeec8+=0x1){_0x22ff92=this['triggers'][_0x410548][_0xd9a4('0x40')][_0x1eeec8];if(this[_0xd9a4('0x10')][_0x47ff19['interface']]){switch(_0x22ff92[_0xd9a4('0x42')][_0xd9a4('0x43')]()){case'contactmanager':break;case _0xd9a4('0x44'):case _0xd9a4('0x45'):var _0x3209ed={};switch(barAndWebActions[_0x22ff92[_0xd9a4('0x46')]]){case _0xd9a4('0xd'):_0x3209ed[_0xd9a4('0x47')]=_0x22ff92[_0xd9a4('0x48')];_0x3209ed[_0xd9a4('0x49')]=this[_0xd9a4('0x12')][_0x22ff92[_0xd9a4('0x48')]]?Mustache[_0xd9a4('0x4a')](this[_0xd9a4('0x12')][_0x22ff92[_0xd9a4('0x48')]][_0xd9a4('0x49')],_0x47ff19):_0xd9a4('0x4b');break;case'url':_0x3209ed[_0xd9a4('0x4c')]=this[_0xd9a4('0x4d')](_0x22ff92[_0xd9a4('0x48')],_0x47ff19,_[_0xd9a4('0x4e')](_0x22ff92[_0xd9a4('0x4f')])?!![]:parseInt(_0x22ff92[_0xd9a4('0x4f')],0xa));if(_[_0xd9a4('0x4e')](_0x22ff92[_0xd9a4('0x50')])){_0x3209ed[_0xd9a4('0x51')]='0';}else{_0x3209ed[_0xd9a4('0x52')]=_0x22ff92[_0xd9a4('0x50')];_0x3209ed['windowWidth']=_[_0xd9a4('0x4e')](_0x22ff92[_0xd9a4('0x53')])?_0xd9a4('0x54'):_0x22ff92[_0xd9a4('0x53')];_0x3209ed[_0xd9a4('0x55')]=_['isNil'](_0x22ff92['data6'])?_0xd9a4('0x56'):_0x22ff92[_0xd9a4('0x57')];}break;case _0xd9a4('0xe'):_0x3209ed[_0xd9a4('0x58')]=_0x22ff92[_0xd9a4('0x48')]?Mustache['render'](_0x22ff92[_0xd9a4('0x48')],_0x47ff19):'';_0x3209ed[_0xd9a4('0x59')]=_0x22ff92[_0xd9a4('0x4f')]?Mustache[_0xd9a4('0x4a')](_0x22ff92[_0xd9a4('0x4f')],_0x47ff19):'';break;}this['emit'](util[_0xd9a4('0x5a')]('user:%s',this['agents'][_0x47ff19['interface']][_0xd9a4('0x5b')]),util['format'](_0xd9a4('0x5c'),_0x22ff92[_0xd9a4('0x42')]['toLowerCase'](),barAndWebActions[_0x22ff92[_0xd9a4('0x46')]]),_['merge'](_0x3209ed,_0x47ff19));break;case _0xd9a4('0x5d'):this[_0xd9a4('0x36')](util[_0xd9a4('0x5a')](_0xd9a4('0x5e'),this[_0xd9a4('0x10')][_0x47ff19[_0xd9a4('0x5f')]][_0xd9a4('0x5b')]),util[_0xd9a4('0x5a')](_0xd9a4('0x60'),_0x22ff92[_0xd9a4('0x42')][_0xd9a4('0x43')]()),_['merge']({'ProjectId':parseInt(_0x22ff92['data1'],0xa)},_0x47ff19));break;default:this[_0xd9a4('0x36')](util[_0xd9a4('0x5a')]('user:%s',this[_0xd9a4('0x10')][_0x47ff19[_0xd9a4('0x5f')]][_0xd9a4('0x5b')]),util[_0xd9a4('0x5a')](_0xd9a4('0x60'),_0x22ff92[_0xd9a4('0x42')][_0xd9a4('0x43')]()),_['merge']({},_0x22ff92,_0x47ff19));}}switch(_0x22ff92[_0xd9a4('0x42')]['toLowerCase']()){case'contactmanager':cmContact[_0xd9a4('0x61')](this[_0xd9a4('0x10')][_0x47ff19[_0xd9a4('0x5f')]],this[_0xd9a4('0xf')][_0x410548],_0x22ff92,_0x47ff19);break;case _0xd9a4('0x62'):integration[_0xd9a4('0x61')](_0x22ff92,_0x47ff19,this[_0xd9a4('0x63')],this[_0xd9a4('0x10')][_0x47ff19[_0xd9a4('0x5f')]],this[_0xd9a4('0x11')][_0x47ff19[_0xd9a4('0x64')]],this['voiceExtensions'][_0x47ff19['routeId']]);break;case _0xd9a4('0x65'):urlforward[_0xd9a4('0x61')](_0x22ff92,_0x47ff19);break;case'script':script[_0xd9a4('0x61')](_0x22ff92,_0x47ff19);break;}}}}}}};Trigger['prototype'][_0xd9a4('0x4d')]=function(_0x5a12ea,_0xdd5c58,_0x45279c){var _0x1a69dc=url['parse'](Mustache[_0xd9a4('0x4a')](_0x5a12ea,_0xdd5c58),!![]);if(_0x45279c){_[_0xd9a4('0x66')](_0x1a69dc['query'],_0xdd5c58);}delete _0x1a69dc[_0xd9a4('0x67')];var _0x459ff1=url['format'](_0x1a69dc);_0x459ff1=_0x459ff1['replace'](/\/\?/g,'?');return _0x459ff1;};Trigger[_0xd9a4('0x35')][_0xd9a4('0x3e')]=function(_0x296235,_0x178a8f){var _0x5c6c31=!![];var _0x31dc43=!![];var _0x3d6f1b=![];if(_0x296235['channel']===_0x178a8f[_0xd9a4('0x3a')]){_0x3d6f1b=!![];}if(_0x296235[_0xd9a4('0x68')]['length']){_0x5c6c31=_[_0xd9a4('0x69')](_0x296235[_0xd9a4('0x68')],this[_0xd9a4('0x6a')](_0x178a8f,_0x296235['channel']));}if(_0x296235['AnyConditions'][_0xd9a4('0x41')]){_0x31dc43=_[_0xd9a4('0x6b')](_0x296235[_0xd9a4('0x6c')],this[_0xd9a4('0x6a')](_0x178a8f,_0x296235[_0xd9a4('0x6d')]));}return _0x3d6f1b&&_0x5c6c31&&_0x31dc43;};Trigger[_0xd9a4('0x35')][_0xd9a4('0x6a')]=function(_0x2486bf,_0x1036e2){return function(_0x19493d){switch(_0x19493d[_0xd9a4('0x6e')]){case _0xd9a4('0x6f'):if(_0x2486bf[_0xd9a4('0x6d')]===_0x1036e2){if(_0x1036e2==='chat'){return _0x2486bf[_0xd9a4('0x70')]?operators[_0x19493d['operator']](Number(_0x19493d[_0xd9a4('0x71')]),_0x2486bf[_0xd9a4('0x70')]):![];}else{return _0x2486bf[_['upperFirst'](_0x1036e2)+_0xd9a4('0x72')]?operators[_0x19493d['operator']](Number(_0x19493d['value']),_0x2486bf[_['upperFirst'](_0x1036e2)+_0xd9a4('0x72')]):![];}}break;case _0xd9a4('0x73'):case _0xd9a4('0x74'):if(_0x2486bf[_0xd9a4('0x6d')]===_0x1036e2){return _0x2486bf[_0xd9a4('0x75')]?operators[_0x19493d['operator']](_0x19493d['value'],_0x2486bf['event']):![];}break;case _0xd9a4('0x64'):return _0x2486bf[_0xd9a4('0x64')]?operators[_0x19493d[_0xd9a4('0x76')]](_0x19493d[_0xd9a4('0x71')],_0x2486bf[_0xd9a4('0x64')]):![];case _0xd9a4('0x77'):return _0x2486bf[_0xd9a4('0x78')]?operators[_0x19493d['operator']](_0x19493d['value'],_0x2486bf[_0xd9a4('0x78')]):![];case _0xd9a4('0x79'):return _0x2486bf['lastevent']?operators[_0x19493d[_0xd9a4('0x76')]](_0x19493d['value'],_0x2486bf[_0xd9a4('0x79')]):![];case'routeId':return _0x2486bf[_0xd9a4('0x7a')]?operators[_0x19493d['operator']](_0x19493d[_0xd9a4('0x71')],_0x2486bf[_0xd9a4('0x7a')]):![];case _0xd9a4('0x7b'):if(_0x19493d['value']===_0xd9a4('0x7c'))_0x19493d[_0xd9a4('0x71')]=null;return typeof _0x2486bf[_0xd9a4('0x7d')]!=='undefined'?operators[_0x19493d[_0xd9a4('0x76')]](_0x19493d[_0xd9a4('0x71')],_0x2486bf['substatus']):![];case _0xd9a4('0x7e'):if(_0x2486bf[_0xd9a4('0x6d')]===_0x1036e2){return _0x19493d[_0xd9a4('0x71')]===_0xd9a4('0x7f')&&_0x19493d[_0xd9a4('0x76')]==='equals'?!![]:![];}break;}return![];};};module[_0xd9a4('0x80')]=Trigger;
\ No newline at end of file
+var _0x109b=['equals','util','lodash','url','mustache','ioredis','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','motionChannel','voice','checkTriggers','interface','triggers','status','checkTrigger','merge','variables','length','Actions','contactmanager','motionbar','data1','popup','data2','html','render','uri','buildUri','isNil','data3','location','data4','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','toLowerCase','jscripty','trigger:%s','exec','integration','routeId','urlforward','parse','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','some','chat','ChatWebsiteId','upperFirst','AccountId','operator','value','message','event','queue','agent','membername','lastevent','mailSubstatus','null','substatus','created'];(function(_0x3e3ebc,_0x55035e){var _0x4e4549=function(_0x36a08c){while(--_0x36a08c){_0x3e3ebc['push'](_0x3e3ebc['shift']());}};_0x4e4549(++_0x55035e);}(_0x109b,0x175));var _0xb109=function(_0x107706,_0x4617e3){_0x107706=_0x107706-0x0;var _0x2d1772=_0x109b[_0x107706];return _0x2d1772;};'use strict';var util=require(_0xb109('0x0'));var _=require(_0xb109('0x1'));var url=require(_0xb109('0x2'));var Mustache=require(_0xb109('0x3'));var Redis=require(_0xb109('0x4'));var urlforward=require(_0xb109('0x5'));var integration=require(_0xb109('0x6'));var cmContact=require('./cmContact');var script=require(_0xb109('0x7'));var config=require(_0xb109('0x8'));var logger=require(_0xb109('0x9'))(_0xb109('0xa'));var ami=require(_0xb109('0xb'));config[_0xb109('0xc')]=_['defaults'](config[_0xb109('0xc')],{'host':_0xb109('0xd'),'port':0x18eb});var io=require(_0xb109('0xe'))(new Redis(config[_0xb109('0xc')]));var operators={'equals':function(_0x5d12ec,_0x49006c){return _0x5d12ec==_0x49006c;},'not_equals':function(_0x544688,_0x3a0ab3){return _0x544688!=_0x3a0ab3;}};var barAndWebActions=['popup','url','winapp'];function Trigger(_0x16b15b){this['triggers']=_0x16b15b['triggers'];this['agents']=_0x16b15b[_0xb109('0xf')];this[_0xb109('0x10')]=_0x16b15b['voiceQueues'];this[_0xb109('0x11')]=_0x16b15b[_0xb109('0x11')];this[_0xb109('0x12')]=_0x16b15b[_0xb109('0x12')];this[_0xb109('0x13')]=_0x16b15b[_0xb109('0x13')];this[_0xb109('0x14')]=_0x16b15b[_0xb109('0x14')];this[_0xb109('0x15')]=_0x16b15b[_0xb109('0x15')];this[_0xb109('0x16')]=_0x16b15b[_0xb109('0x16')];this[_0xb109('0x17')]=_0x16b15b[_0xb109('0x17')];this[_0xb109('0x18')]=_0x16b15b[_0xb109('0x18')];this[_0xb109('0x19')]=_0x16b15b[_0xb109('0x19')];this[_0xb109('0x1a')]=_0x16b15b[_0xb109('0x1a')];this[_0xb109('0x1b')]=_0x16b15b['dynamics365Accounts'];this['freshsalesAccounts']=_0x16b15b[_0xb109('0x1c')];this[_0xb109('0x1d')]={'zendesk':this[_0xb109('0x13')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xb109('0x14')],'sugarcrm':this[_0xb109('0x16')],'zoho':this['zohoAccounts'],'desk':this[_0xb109('0x18')],'vtiger':this[_0xb109('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xb109('0x1c')],'servicenow':this[_0xb109('0x1a')]};ami['on'](_0xb109('0x1e'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on'](_0xb109('0x21'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on']('custom:agentringnoanswer',this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on'](_0xb109('0x22'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on'](_0xb109('0x23'),this[_0xb109('0x1f')]['bind'](this));ami['on'](_0xb109('0x24'),this[_0xb109('0x1f')]['bind'](this));ami['on'](_0xb109('0x25'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on']('custom:agentcongestion',this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on'](_0xb109('0x26'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on']('custom:amd',this['syncCustomEvent'][_0xb109('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0xb109('0x1f')]['bind'](this));ami['on'](_0xb109('0x27'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on'](_0xb109('0x28'),this['syncAgentDial']['bind'](this));ami['on'](_0xb109('0x29'),this[_0xb109('0x2a')][_0xb109('0x20')](this));ami['on'](_0xb109('0x2b'),this['syncAgentDial']['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0xb109('0x20')](this));ami['on'](_0xb109('0x2c'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on'](_0xb109('0x2d'),this['syncCustomEvent'][_0xb109('0x20')](this));ami['on'](_0xb109('0x2e'),this['syncCustomEvent'][_0xb109('0x20')](this));ami['on'](_0xb109('0x2f'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on'](_0xb109('0x30'),this[_0xb109('0x1f')]['bind'](this));ami['on'](_0xb109('0x31'),this[_0xb109('0x1f')][_0xb109('0x20')](this));ami['on']('custom:offlineMessage',this['syncCustomEvent'][_0xb109('0x20')](this));}Trigger[_0xb109('0x32')][_0xb109('0x33')]=function(_0x131980,_0x379fd0,_0x3ce5dd){logger[_0xb109('0x34')](_0x131980,_0x379fd0,JSON[_0xb109('0x35')](_0x3ce5dd));io['to'](_0x131980)[_0xb109('0x33')](_0x379fd0,_0x3ce5dd);};Trigger[_0xb109('0x32')][_0xb109('0x1f')]=function(_0x27ad74){var _0x4a81c1=_['clone'](_0x27ad74);if(typeof _0x4a81c1[_0xb109('0x36')]==='undefined'){_0x4a81c1[_0xb109('0x36')]=_0xb109('0x37');}this[_0xb109('0x38')](_0x4a81c1);};Trigger[_0xb109('0x32')][_0xb109('0x2a')]=function(_0x20da54){if(this[_0xb109('0xf')][_0x20da54[_0xb109('0x39')]]){this[_0xb109('0x1f')](_0x20da54);}};Trigger[_0xb109('0x32')]['checkTriggers']=function(_0x4ed04d){var _0xae827b;for(var _0x11e0c3 in this['triggers']){if(this[_0xb109('0x3a')]['hasOwnProperty'](_0x11e0c3)){if(this['triggers'][_0x11e0c3][_0xb109('0x3b')]){_0xae827b=this[_0xb109('0x3c')](this['triggers'][_0x11e0c3],_0x4ed04d);if(_0xae827b){_[_0xb109('0x3d')](_0x4ed04d,_0x4ed04d[_0xb109('0x3e')]);for(var _0x36fc3f=0x0,_0xfda292,_0x2185cf,_0x301d6d;_0x36fc3f<this['triggers'][_0x11e0c3]['Actions'][_0xb109('0x3f')];_0x36fc3f+=0x1){_0xfda292=this[_0xb109('0x3a')][_0x11e0c3][_0xb109('0x40')][_0x36fc3f];if(this['agents'][_0x4ed04d['interface']]){switch(_0xfda292['action']['toLowerCase']()){case _0xb109('0x41'):break;case _0xb109('0x42'):case'browser':var _0x1db147={};switch(barAndWebActions[_0xfda292[_0xb109('0x43')]]){case _0xb109('0x44'):_0x1db147['TemplateId']=_0xfda292[_0xb109('0x45')];_0x1db147[_0xb109('0x46')]=this[_0xb109('0x11')][_0xfda292[_0xb109('0x45')]]?Mustache[_0xb109('0x47')](this[_0xb109('0x11')][_0xfda292['data2']][_0xb109('0x46')],_0x4ed04d):'template\x20not\x20found';break;case _0xb109('0x2'):_0x1db147[_0xb109('0x48')]=this[_0xb109('0x49')](_0xfda292[_0xb109('0x45')],_0x4ed04d,_[_0xb109('0x4a')](_0xfda292[_0xb109('0x4b')])?!![]:parseInt(_0xfda292['data3'],0xa));if(_[_0xb109('0x4a')](_0xfda292['data4'])){_0x1db147[_0xb109('0x4c')]='0';}else{_0x1db147['uriLocation']=_0xfda292[_0xb109('0x4d')];_0x1db147[_0xb109('0x4e')]=_[_0xb109('0x4a')](_0xfda292[_0xb109('0x4f')])?_0xb109('0x50'):_0xfda292[_0xb109('0x4f')];_0x1db147[_0xb109('0x51')]=_[_0xb109('0x4a')](_0xfda292[_0xb109('0x52')])?_0xb109('0x53'):_0xfda292[_0xb109('0x52')];}break;case'winapp':_0x1db147[_0xb109('0x54')]=_0xfda292['data2']?Mustache[_0xb109('0x47')](_0xfda292['data2'],_0x4ed04d):'';_0x1db147[_0xb109('0x55')]=_0xfda292[_0xb109('0x4b')]?Mustache[_0xb109('0x47')](_0xfda292['data3'],_0x4ed04d):'';break;}this['emit'](util[_0xb109('0x56')](_0xb109('0x57'),this[_0xb109('0xf')][_0x4ed04d['interface']][_0xb109('0x58')]),util[_0xb109('0x56')](_0xb109('0x59'),_0xfda292[_0xb109('0x5a')][_0xb109('0x5b')](),barAndWebActions[_0xfda292[_0xb109('0x43')]]),_['merge'](_0x1db147,_0x4ed04d));break;case _0xb109('0x5c'):this[_0xb109('0x33')](util[_0xb109('0x56')](_0xb109('0x57'),this['agents'][_0x4ed04d[_0xb109('0x39')]]['name']),util[_0xb109('0x56')](_0xb109('0x5d'),_0xfda292[_0xb109('0x5a')]['toLowerCase']()),_['merge']({'ProjectId':parseInt(_0xfda292[_0xb109('0x43')],0xa)},_0x4ed04d));break;default:this['emit'](util[_0xb109('0x56')](_0xb109('0x57'),this[_0xb109('0xf')][_0x4ed04d['interface']][_0xb109('0x58')]),util['format']('trigger:%s',_0xfda292[_0xb109('0x5a')][_0xb109('0x5b')]()),_['merge']({},_0xfda292,_0x4ed04d));}}switch(_0xfda292[_0xb109('0x5a')][_0xb109('0x5b')]()){case _0xb109('0x41'):cmContact[_0xb109('0x5e')](this['agents'][_0x4ed04d[_0xb109('0x39')]],this['triggers'][_0x11e0c3],_0xfda292,_0x4ed04d);break;case _0xb109('0x5f'):integration[_0xb109('0x5e')](_0xfda292,_0x4ed04d,this[_0xb109('0x1d')],this[_0xb109('0xf')][_0x4ed04d['interface']],this['voiceQueues'][_0x4ed04d['queue']],this[_0xb109('0x12')][_0x4ed04d[_0xb109('0x60')]]);break;case _0xb109('0x61'):urlforward['exec'](_0xfda292,_0x4ed04d);break;case'script':script['exec'](_0xfda292,_0x4ed04d);break;}}}}}}};Trigger[_0xb109('0x32')][_0xb109('0x49')]=function(_0x42dc8d,_0x4d5a36,_0x125b0b){var _0x55a49d=url[_0xb109('0x62')](Mustache[_0xb109('0x47')](_0x42dc8d,_0x4d5a36),!![]);if(_0x125b0b){_[_0xb109('0x3d')](_0x55a49d['query'],_0x4d5a36);}delete _0x55a49d[_0xb109('0x63')];var _0x1bea79=url[_0xb109('0x56')](_0x55a49d);_0x1bea79=_0x1bea79[_0xb109('0x64')](/\/\?/g,'?');return _0x1bea79;};Trigger[_0xb109('0x32')]['checkTrigger']=function(_0x56de6d,_0x364a61){var _0x2389a4=!![];var _0x568323=!![];var _0x3b72cb=![];if(_0x56de6d[_0xb109('0x65')]===_0x364a61[_0xb109('0x36')]){_0x3b72cb=!![];}if(_0x56de6d['AllConditions'][_0xb109('0x3f')]){_0x2389a4=_[_0xb109('0x66')](_0x56de6d[_0xb109('0x67')],this[_0xb109('0x68')](_0x364a61,_0x56de6d[_0xb109('0x65')]));}if(_0x56de6d[_0xb109('0x69')][_0xb109('0x3f')]){_0x568323=_[_0xb109('0x6a')](_0x56de6d['AnyConditions'],this[_0xb109('0x68')](_0x364a61,_0x56de6d[_0xb109('0x65')]));}return _0x3b72cb&&_0x2389a4&&_0x568323;};Trigger['prototype'][_0xb109('0x68')]=function(_0x3d66ed,_0x3c921b){return function(_0x152c00){switch(_0x152c00['field']){case'account':if(_0x3d66ed['channel']===_0x3c921b){if(_0x3c921b===_0xb109('0x6b')){return _0x3d66ed['ChatWebsiteId']?operators[_0x152c00['operator']](Number(_0x152c00['value']),_0x3d66ed[_0xb109('0x6c')]):![];}else{return _0x3d66ed[_[_0xb109('0x6d')](_0x3c921b)+_0xb109('0x6e')]?operators[_0x152c00[_0xb109('0x6f')]](Number(_0x152c00[_0xb109('0x70')]),_0x3d66ed[_[_0xb109('0x6d')](_0x3c921b)+_0xb109('0x6e')]):![];}}break;case'interaction':case _0xb109('0x71'):if(_0x3d66ed['channel']===_0x3c921b){return _0x3d66ed[_0xb109('0x72')]?operators[_0x152c00['operator']](_0x152c00[_0xb109('0x70')],_0x3d66ed[_0xb109('0x72')]):![];}break;case _0xb109('0x73'):return _0x3d66ed['queue']?operators[_0x152c00[_0xb109('0x6f')]](_0x152c00[_0xb109('0x70')],_0x3d66ed['queue']):![];case _0xb109('0x74'):return _0x3d66ed['membername']?operators[_0x152c00[_0xb109('0x6f')]](_0x152c00[_0xb109('0x70')],_0x3d66ed[_0xb109('0x75')]):![];case _0xb109('0x76'):return _0x3d66ed[_0xb109('0x76')]?operators[_0x152c00[_0xb109('0x6f')]](_0x152c00[_0xb109('0x70')],_0x3d66ed['lastevent']):![];case _0xb109('0x60'):return _0x3d66ed['routeId']?operators[_0x152c00[_0xb109('0x6f')]](_0x152c00[_0xb109('0x70')],_0x3d66ed[_0xb109('0x60')]):![];case _0xb109('0x77'):if(_0x152c00[_0xb109('0x70')]===_0xb109('0x78'))_0x152c00[_0xb109('0x70')]=null;return typeof _0x3d66ed['substatus']!=='undefined'?operators[_0x152c00[_0xb109('0x6f')]](_0x152c00[_0xb109('0x70')],_0x3d66ed[_0xb109('0x79')]):![];case'offlineMessage':if(_0x3d66ed[_0xb109('0x65')]===_0x3c921b){return _0x152c00['value']===_0xb109('0x7a')&&_0x152c00['operator']===_0xb109('0x7b')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
index 862c493..ddd3885 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0x5fc3[_0x4fd109];return _0x30f0a6;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});};
\ No newline at end of file
+var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x4ad743,_0x18d578){_0x4ad743=_0x4ad743-0x0;var _0x260882=_0xe14b[_0x4ad743];return _0x260882;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});};
\ No newline at end of file
index db34b76..688493a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f3e=['destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','replace','%2b','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','string','type','nameField','customField','idField','substring','indexOf','content','ticketType','incident','assign','getString','Subjects','Fields','phonecall','/contacts(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','modernAuthentication','remoteUri','data7','CloudProvider','data2','resolve','data5','POST','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','GET','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound'];(function(_0x1ce1e5,_0x245834){var _0x2ff5e8=function(_0x228d2e){while(--_0x228d2e){_0x1ce1e5['push'](_0x1ce1e5['shift']());}};_0x2ff5e8(++_0x245834);}(_0x1f3e,0x9f));var _0xe1f3=function(_0x2720ec,_0x5e1ead){_0x2720ec=_0x2720ec-0x0;var _0x5995f9=_0x1f3e[_0x2720ec];return _0x5995f9;};'use strict';var _=require(_0xe1f3('0x0'));var rp=require(_0xe1f3('0x1'));var util=require('util');var intUtil=require(_0xe1f3('0x2'));var md5=require(_0xe1f3('0x3'));var Redis=require(_0xe1f3('0x4'));var logger=require('../../../../config/logger')(_0xe1f3('0x5'));var config=require(_0xe1f3('0x6'));config[_0xe1f3('0x7')]=_[_0xe1f3('0x8')](config['redis'],{'host':_0xe1f3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe1f3('0x7')]));function getAuthToken(_0x258396,_0x48bd03,_0x194c8d){if(_0x258396[_0xe1f3('0xa')]){_0x258396[_0xe1f3('0xb')]=_0x258396['CloudProvider'][_0xe1f3('0xc')];_0x258396['tenantId']=_0x258396[_0xe1f3('0xd')][_0xe1f3('0xe')];return Promise[_0xe1f3('0xf')](_0x258396['CloudProvider'][_0xe1f3('0x10')]);}var _0xc3f5={'method':_0xe1f3('0x11'),'uri':_0x48bd03,'form':{'client_id':_0x258396['clientId'],'resource':_0x258396[_0xe1f3('0xb')],'username':_0x258396[_0xe1f3('0x12')],'password':_0x258396['password'],'grant_type':_0xe1f3('0x13'),'client_secret':_0x258396[_0xe1f3('0x14')]},'json':!![]};return rp(_0xc3f5)[_0xe1f3('0x15')](function(_0xa244d4){return _0xa244d4[_0xe1f3('0x16')];})[_0xe1f3('0x17')](function(_0x5cfe75){logger[_0xe1f3('0x18')]('['+[_0x194c8d['toUpperCase']()]+_0xe1f3('0x19'));return _0x5cfe75['message'];});}function getUser(_0x591d4e,_0x83a49d,_0x517e6e,_0x192aa4,_0x5a2afa,_0x107db3){return new Promise(function(_0x4037e6,_0x440c8a){return getAuthToken(_0x83a49d,_0x192aa4,_0x107db3)[_0xe1f3('0x15')](function(_0xf57bd9){var _0x2794a4={'method':_0xe1f3('0x1a'),'uri':_0x5a2afa+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xe1f3('0x1b')+_0xf57bd9,'OData-Version':_0xe1f3('0x1c')},'json':!![]};return rp(_0x2794a4);})[_0xe1f3('0x15')](function(_0xb2221e){var _0x7777ba=_0xb2221e[_0xe1f3('0x1d')];var _0x5dece3=![];var _0x4e2f86=null;if(!_['isNil'](_0x517e6e)){if(intUtil[_0xe1f3('0x1e')](_0x517e6e[_0xe1f3('0x1f')])){_0x591d4e[_0xe1f3('0x20')]=_0x517e6e['email'];for(_0x4e2f86=0x0;_0x4e2f86<_0x7777ba[_0xe1f3('0x21')];_0x4e2f86++){if(_0x7777ba[_0x4e2f86][_0xe1f3('0x22')]===_0x517e6e[_0xe1f3('0x1f')]&&!_0x7777ba[_0x4e2f86][_0xe1f3('0x23')]){_0x5dece3=!![];logger[_0xe1f3('0x24')]('['+[_0x107db3[_0xe1f3('0x25')]()]+_0xe1f3('0x26')+_0x7777ba[_0x4e2f86][_0xe1f3('0x27')]+'!');_0x591d4e[_0xe1f3('0x28')]=_0x7777ba[_0x4e2f86][_0xe1f3('0x27')];}}}}if(!_0x5dece3){logger[_0xe1f3('0x24')]('['+[_0x107db3[_0xe1f3('0x25')]()]+_0xe1f3('0x29'));_0x591d4e[_0xe1f3('0x20')]=_0x83a49d['username'];for(_0x4e2f86=0x0;_0x4e2f86<_0x7777ba[_0xe1f3('0x21')];_0x4e2f86++){if(_0x7777ba[_0x4e2f86][_0xe1f3('0x22')]===_0x83a49d[_0xe1f3('0x12')]){_0x591d4e[_0xe1f3('0x28')]=_0x7777ba[_0x4e2f86]['systemuserid'];}}}_0x4037e6(_0x591d4e);})['catch'](function(_0x2e8d00){_0x440c8a(_0x2e8d00[_0xe1f3('0x2a')]);});});}function createEndUser(_0x3eee8b,_0x43098d,_0x55f3a7,_0x259365,_0x5d458a,_0x484c03){return new Promise(function(_0x4c35bd,_0x585851){return getAuthToken(_0x43098d,_0x55f3a7,_0x484c03)[_0xe1f3('0x15')](function(_0x88529b){var _0x54f682=_0x484c03[_0xe1f3('0x2b')]()===_0xe1f3('0x2c')?_0x5d458a[_0xe1f3('0x2d')]:_0x5d458a[_0xe1f3('0x2e')];var _0x25eb75={'method':_0xe1f3('0x11'),'uri':_0x259365+_0xe1f3('0x2f'),'body':{'telephone1':_0x54f682,'fullname':_0x54f682,'firstname':_0x54f682,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe1f3('0x30')+_0x3eee8b['userId']+')'},'headers':{'Authorization':_0xe1f3('0x1b')+_0x88529b,'OData-Version':_0xe1f3('0x1c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x25eb75);})[_0xe1f3('0x15')](function(_0x49f9b3){var _0x3a4cd8=_0x49f9b3[_0xe1f3('0x31')][_0xe1f3('0x32')];var _0x143bb4=_0x3a4cd8['substring'](_0x3a4cd8[_0xe1f3('0x33')]('(')+0x1,_0x3a4cd8['lastIndexOf'](')'));_0x3eee8b[_0xe1f3('0x34')]=_0x143bb4;_0x4c35bd(_0x3eee8b);})['catch'](function(_0x31d09c){_0x585851(_0x31d09c['message']);});});}function getEndUser(_0x3bf6da,_0x7a2aa0,_0x30b18d,_0xd495be,_0x5b8401,_0x4afaa0,_0x6f9a51){var _0x49cf2b=_0x4afaa0[_0xe1f3('0x2b')]()===_0xe1f3('0x2c')?_0x5b8401['destcalleridnum']:_0x5b8401[_0xe1f3('0x2e')];return getAuthToken(_0x7a2aa0,_0x30b18d,_0x4afaa0)['then'](function(_0x27e4de){var _0x157b40={'method':_0xe1f3('0x1a'),'uri':_0xd495be+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x49cf2b[_0xe1f3('0x35')]('+',_0xe1f3('0x36'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x27e4de,'If-None-Match':null,'OData-Version':_0xe1f3('0x1c')},'json':!![]};return rp(_0x157b40);})['then'](function(_0x269872){var _0x253263=![];if(!_0x269872)return _0x253263;var _0x8c3055=_0x269872['value'];for(var _0x338046=0x0;_0x338046<_0x8c3055[_0xe1f3('0x21')];_0x338046++){if(_0x8c3055[_0x338046][_0xe1f3('0x37')]===_0x49cf2b){_0x253263=!![];_0x3bf6da[_0xe1f3('0x34')]=_0x8c3055[_0x338046][_0xe1f3('0x38')];}}return _0x253263;})[_0xe1f3('0x15')](function(_0x425a31){if(_0x425a31)return _0x3bf6da;if(_0x6f9a51===_0xe1f3('0x39')){logger[_0xe1f3('0x24')]('['+[_0x4afaa0[_0xe1f3('0x25')]()]+_0xe1f3('0x3a'));return _0x3bf6da;}return createEndUser(_0x3bf6da,_0x7a2aa0,_0x30b18d,_0xd495be,_0x5b8401,_0x4afaa0)[_0xe1f3('0x15')](function(_0x59b6f3){logger['info']('['+[_0x4afaa0['toUpperCase']()]+']\x20Enduser\x20created!',_0x59b6f3[_0xe1f3('0x34')]);return _0x59b6f3;});});}function getCustomFields(_0x127aa7,_0x36f2f0,_0x441e21){var _0x2eaf08={};if(_0x127aa7[_0xe1f3('0x21')]>0x0){_['forEach'](_0x127aa7,function(_0x9d94a1){if(_[_0xe1f3('0x3b')]([_0xe1f3('0x3c'),'picklist'],_0x9d94a1[_0xe1f3('0x3d')])&&_0x9d94a1[_0xe1f3('0x3e')]&&!_0x9d94a1[_0xe1f3('0x3f')]){var _0x1aa296=_0x9d94a1[_0xe1f3('0x40')][_0xe1f3('0x2b')]();var _0x28536d=_0x1aa296[_0xe1f3('0x41')](0x0,_0x1aa296[_0xe1f3('0x42')]('_'));var _0x1e3ab6=_0x1aa296[_0xe1f3('0x41')](_0x1aa296[_0xe1f3('0x42')]('_')+0x1);if(_0x28536d===_0x441e21){_0x2eaf08[_0x1e3ab6]=_0x9d94a1[_0xe1f3('0x43')];}}});}return _0x2eaf08;}function getTicket(_0x73dcb2,_0x21ce21,_0xb48fe1,_0x5e0682,_0x2080b0,_0x38bd1c,_0x28bc3f){return new Promise(function(_0x5efd3b,_0x11b299){var _0x351071;return getAuthToken(_0x21ce21,_0xb48fe1,_0x28bc3f)[_0xe1f3('0x15')](function(_0x462ee9){if(_0x38bd1c[_0xe1f3('0x44')]===_0xe1f3('0x45')){_0x351071={'method':_0xe1f3('0x11'),'uri':_0x5e0682+'incidents','body':Object[_0xe1f3('0x46')]({},{'title':intUtil[_0xe1f3('0x47')](_0x38bd1c[_0xe1f3('0x48')],_0x2080b0,'\x20'),'description':intUtil[_0xe1f3('0x47')](_0x38bd1c['Descriptions'],_0x2080b0,'\x0a'),'customerid_contact@odata.bind':_0x73dcb2[_0xe1f3('0x34')]?'/contacts('+_0x73dcb2[_0xe1f3('0x34')]+')':undefined,'ownerid@odata.bind':_0xe1f3('0x30')+_0x73dcb2[_0xe1f3('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x38bd1c[_0xe1f3('0x49')],_0x2080b0,_0x38bd1c[_0xe1f3('0x44')])),'headers':{'Authorization':_0xe1f3('0x1b')+_0x462ee9,'OData-Version':_0xe1f3('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x38bd1c[_0xe1f3('0x44')]===_0xe1f3('0x4a')){var _0x41e5c2=_0x73dcb2[_0xe1f3('0x34')]?[{'partyid_systemuser@odata.bind':_0xe1f3('0x30')+_0x73dcb2[_0xe1f3('0x28')]+')','participationtypemask':_0x73dcb2['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xe1f3('0x4b')+_0x73dcb2[_0xe1f3('0x34')]+')','participationtypemask':_0x73dcb2[_0xe1f3('0x4c')]===_0xe1f3('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xe1f3('0x30')+_0x73dcb2[_0xe1f3('0x28')]+')','participationtypemask':_0x73dcb2[_0xe1f3('0x4c')]===_0xe1f3('0x4d')?0x2:0x1}];_0x351071={'method':_0xe1f3('0x11'),'uri':_0x5e0682+'phonecalls','body':Object[_0xe1f3('0x46')]({},{'subject':intUtil[_0xe1f3('0x47')](_0x38bd1c[_0xe1f3('0x48')],_0x2080b0,'\x20'),'phonenumber':String(_0x2080b0[_0xe1f3('0x2e')]),'description':intUtil[_0xe1f3('0x47')](_0x38bd1c['Descriptions'],_0x2080b0,'\x0a'),'regardingobjectid_contact@odata.bind':_0x73dcb2['enduserId']?_0xe1f3('0x4b')+_0x73dcb2['enduserId']+')':undefined,'ownerid@odata.bind':_0xe1f3('0x30')+_0x73dcb2[_0xe1f3('0x28')]+')','directioncode':_0x73dcb2[_0xe1f3('0x4c')]===_0xe1f3('0x4d')?![]:!![],'phonecall_activity_parties':_0x41e5c2},getCustomFields(_0x38bd1c[_0xe1f3('0x49')],_0x2080b0,_0x38bd1c['ticketType'])),'headers':{'Authorization':_0xe1f3('0x1b')+_0x462ee9,'OData-Version':_0xe1f3('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x351071);})[_0xe1f3('0x15')](function(_0x1f492f){var _0x31ec52=_0x1f492f['headers'][_0xe1f3('0x32')];var _0x4a2765=_0x31ec52[_0xe1f3('0x41')](_0x31ec52[_0xe1f3('0x33')]('(')+0x1,_0x31ec52[_0xe1f3('0x33')](')'));_0x73dcb2[_0xe1f3('0x4e')]=_0x4a2765;_0x5efd3b(_0x73dcb2);})[_0xe1f3('0x17')](function(_0x37d1bc){_0x11b299(_0x37d1bc[_0xe1f3('0x2a')]);});});}function emit(_0x190b89,_0x313ada,_0x8ba888,_0x2429fe){var _0x31970d={'uri':util[_0xe1f3('0x4f')](_0xe1f3('0x50'),_0x190b89,_0x8ba888,_0x2429fe)};io['to'](util[_0xe1f3('0x4f')](_0xe1f3('0x51'),_0x313ada))[_0xe1f3('0x52')]('trigger:browser:url',_0x31970d);}exports['cs']=function(_0x3435d1,_0x11a6b,_0x228510,_0x4d2b34,_0x48bb39,_0x503fe0,_0x3b5b7a,_0x562f07){var _0xdc9a14={};_0x503fe0['remoteUri']=_0x503fe0['modernAuthentication']?intUtil[_0xe1f3('0x53')](_0x503fe0[_0xe1f3('0xd')][_0xe1f3('0xc')]):intUtil[_0xe1f3('0x53')](_0x503fe0[_0xe1f3('0xb')]);_0x503fe0[_0xe1f3('0x54')]=intUtil[_0xe1f3('0x53')](_0x503fe0[_0xe1f3('0x54')]);_0xdc9a14[_0xe1f3('0x4c')]=_0x562f07==='queue'||_0x562f07==='unmanaged'?_0xe1f3('0x4d'):'outbound';var _0x3bb689=_0x503fe0['modernAuthentication']?util['format'](_0xe1f3('0x55'),_0x503fe0[_0xe1f3('0xd')]['data7']):util[_0xe1f3('0x4f')]('%s/api/data/v9.0/',_0x503fe0[_0xe1f3('0xb')]);var _0x1092d5=util[_0xe1f3('0x4f')](_0xe1f3('0x56'),_0x503fe0[_0xe1f3('0x57')]);var _0x26e617=util[_0xe1f3('0x4f')](_0xe1f3('0x58'),_0x503fe0[_0xe1f3('0x54')],_0x11a6b[_0xe1f3('0x59')],md5(_0x11a6b[_0xe1f3('0x59')]));if(_0x48bb39&&_0x48bb39['monitor_format']){logger[_0xe1f3('0x24')]('[QUEUE]',_0xe1f3('0x5a'));_0x11a6b[_0xe1f3('0x5b')]=_0x26e617;}else if(_0x3b5b7a&&_0x3b5b7a[_0xe1f3('0x5c')]&&_0x3b5b7a[_0xe1f3('0x5c')]!=='none'){logger[_0xe1f3('0x24')](_0xe1f3('0x5d'),_0xe1f3('0x5a'));_0x11a6b[_0xe1f3('0x5b')]=_0x26e617;}else{_0x11a6b[_0xe1f3('0x5b')]='';}return getUser(_0xdc9a14,_0x503fe0,_0x4d2b34,_0x1092d5,_0x3bb689,_0x562f07)['then'](function(_0x4411ce){logger[_0xe1f3('0x24')]('['+_0x562f07[_0xe1f3('0x25')]()+_0xe1f3('0x5e'),_0x4411ce[_0xe1f3('0x28')]);logger[_0xe1f3('0x24')]('['+_0x562f07[_0xe1f3('0x25')]()+']\x20The\x20User\x20email\x20is:',_0x4411ce[_0xe1f3('0x20')]);return getEndUser(_0x4411ce,_0x503fe0,_0x1092d5,_0x3bb689,_0x11a6b,_0x562f07,_0x228510[_0xe1f3('0x5f')]);})['then'](function(_0x5f5749){logger[_0xe1f3('0x24')]('['+_0x562f07[_0xe1f3('0x25')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x5f5749['enduserId']);logger['info']('['+_0x562f07[_0xe1f3('0x25')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x11a6b[_0xe1f3('0x2e')]);return getTicket(_0x5f5749,_0x503fe0,_0x1092d5,_0x3bb689,_0x11a6b,_0x228510,_0x562f07);})['then'](function(_0x28594f){logger[_0xe1f3('0x24')](util[_0xe1f3('0x4f')]('['+_0x562f07[_0xe1f3('0x25')]()+_0xe1f3('0x60'),_0x228510[_0xe1f3('0x44')],_0x28594f[_0xe1f3('0x4e')]));logger[_0xe1f3('0x24')](util[_0xe1f3('0x4f')]('['+_0x562f07[_0xe1f3('0x25')]()+_0xe1f3('0x61'),_0x562f07));if(_0x562f07!==_0xe1f3('0x62')){logger[_0xe1f3('0x24')]('['+_0x562f07['toUpperCase']()+']',_0xe1f3('0x63'));emit(_0x503fe0['remoteUri'],_0x4d2b34[_0xe1f3('0x64')],_0x228510[_0xe1f3('0x44')],_0x28594f['ticketId']);}})[_0xe1f3('0x17')](function(_0x4475a0){logger['error']('['+_0x562f07[_0xe1f3('0x25')]()+_0xe1f3('0x65'),_0x4475a0[_0xe1f3('0x2a')]);});};
\ No newline at end of file
+var _0x853c=['CloudProvider','tenantId','data2','data5','POST','clientId','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','value','validateEmail','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','idField','indexOf','content','incident','incidents','getString','Descriptions','/contacts(','ticketType','phonecall','callDirection','queue','phonecalls','assign','Subjects','Fields','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20email\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri'];(function(_0x4b289f,_0x1e4499){var _0x5cdc53=function(_0x45b1a1){while(--_0x45b1a1){_0x4b289f['push'](_0x4b289f['shift']());}};_0x5cdc53(++_0x1e4499);}(_0x853c,0xcb));var _0xc853=function(_0x38c5bc,_0x3dc17f){_0x38c5bc=_0x38c5bc-0x0;var _0xd7472b=_0x853c[_0x38c5bc];return _0xd7472b;};'use strict';var _=require('lodash');var rp=require(_0xc853('0x0'));var util=require(_0xc853('0x1'));var intUtil=require(_0xc853('0x2'));var md5=require(_0xc853('0x3'));var Redis=require(_0xc853('0x4'));var logger=require(_0xc853('0x5'))(_0xc853('0x6'));var config=require(_0xc853('0x7'));config[_0xc853('0x8')]=_[_0xc853('0x9')](config[_0xc853('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xc853('0xa'))(new Redis(config[_0xc853('0x8')]));function getAuthToken(_0x1104e7,_0x292834,_0x95ed90){if(_0x1104e7[_0xc853('0xb')]){_0x1104e7[_0xc853('0xc')]=_0x1104e7[_0xc853('0xd')]['data7'];_0x1104e7[_0xc853('0xe')]=_0x1104e7[_0xc853('0xd')][_0xc853('0xf')];return Promise['resolve'](_0x1104e7[_0xc853('0xd')][_0xc853('0x10')]);}var _0x18b6f9={'method':_0xc853('0x11'),'uri':_0x292834,'form':{'client_id':_0x1104e7[_0xc853('0x12')],'resource':_0x1104e7[_0xc853('0xc')],'username':_0x1104e7['username'],'password':_0x1104e7[_0xc853('0x13')],'grant_type':_0xc853('0x13'),'client_secret':_0x1104e7['clientSecret']},'json':!![]};return rp(_0x18b6f9)[_0xc853('0x14')](function(_0x3c3938){return _0x3c3938[_0xc853('0x15')];})[_0xc853('0x16')](function(_0x689050){logger[_0xc853('0x17')]('['+[_0x95ed90[_0xc853('0x18')]()]+_0xc853('0x19'));return _0x689050[_0xc853('0x1a')];});}function getUser(_0x34343d,_0xc61c19,_0x12f80e,_0x2db413,_0x1d435d,_0x3c2f15){return new Promise(function(_0x48bd3a,_0x2da470){return getAuthToken(_0xc61c19,_0x2db413,_0x3c2f15)['then'](function(_0xeb5284){var _0x31da25={'method':'GET','uri':_0x1d435d+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xc853('0x1b')+_0xeb5284,'OData-Version':_0xc853('0x1c')},'json':!![]};return rp(_0x31da25);})[_0xc853('0x14')](function(_0x4e1809){var _0xc74df0=_0x4e1809[_0xc853('0x1d')];var _0x16c992=![];var _0xc9044c=null;if(!_['isNil'](_0x12f80e)){if(intUtil[_0xc853('0x1e')](_0x12f80e[_0xc853('0x1f')])){_0x34343d['userEmail']=_0x12f80e[_0xc853('0x1f')];for(_0xc9044c=0x0;_0xc9044c<_0xc74df0[_0xc853('0x20')];_0xc9044c++){if(_0xc74df0[_0xc9044c]['internalemailaddress']===_0x12f80e[_0xc853('0x1f')]&&!_0xc74df0[_0xc9044c][_0xc853('0x21')]){_0x16c992=!![];logger[_0xc853('0x22')]('['+[_0x3c2f15[_0xc853('0x18')]()]+_0xc853('0x23')+_0xc74df0[_0xc9044c][_0xc853('0x24')]+'!');_0x34343d[_0xc853('0x25')]=_0xc74df0[_0xc9044c]['systemuserid'];}}}}if(!_0x16c992){logger[_0xc853('0x22')]('['+[_0x3c2f15[_0xc853('0x18')]()]+_0xc853('0x26'));_0x34343d[_0xc853('0x27')]=_0xc61c19[_0xc853('0x28')];for(_0xc9044c=0x0;_0xc9044c<_0xc74df0['length'];_0xc9044c++){if(_0xc74df0[_0xc9044c][_0xc853('0x29')]===_0xc61c19[_0xc853('0x28')]){_0x34343d[_0xc853('0x25')]=_0xc74df0[_0xc9044c][_0xc853('0x24')];}}}_0x48bd3a(_0x34343d);})[_0xc853('0x16')](function(_0x26cace){_0x2da470(_0x26cace[_0xc853('0x1a')]);});});}function createEndUser(_0x493f3b,_0x4e7d09,_0xb8c81f,_0x11ceb2,_0x48b8ff,_0x265330){return new Promise(function(_0x2c5cc2,_0x33c050){return getAuthToken(_0x4e7d09,_0xb8c81f,_0x265330)['then'](function(_0x2a4689){var _0x26a7c3=_0x265330[_0xc853('0x2a')]()===_0xc853('0x2b')?_0x48b8ff[_0xc853('0x2c')]:_0x48b8ff[_0xc853('0x2d')];var _0xa42706={'method':_0xc853('0x11'),'uri':_0x11ceb2+_0xc853('0x2e'),'body':{'telephone1':_0x26a7c3,'fullname':_0x26a7c3,'firstname':_0x26a7c3,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc853('0x2f')+_0x493f3b[_0xc853('0x25')]+')'},'headers':{'Authorization':_0xc853('0x1b')+_0x2a4689,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xa42706);})['then'](function(_0x40375b){var _0x3422fe=_0x40375b[_0xc853('0x30')]['odata-entityid'];var _0x53a007=_0x3422fe[_0xc853('0x31')](_0x3422fe[_0xc853('0x32')]('(')+0x1,_0x3422fe[_0xc853('0x32')](')'));_0x493f3b['enduserId']=_0x53a007;_0x2c5cc2(_0x493f3b);})['catch'](function(_0x20b925){_0x33c050(_0x20b925[_0xc853('0x1a')]);});});}function getEndUser(_0x49ac26,_0x147146,_0x12a524,_0x4cf130,_0x138f2f,_0x25a49d,_0x5b78fb){var _0x1bfac5=_0x25a49d[_0xc853('0x2a')]()===_0xc853('0x2b')?_0x138f2f[_0xc853('0x2c')]:_0x138f2f[_0xc853('0x2d')];return getAuthToken(_0x147146,_0x12a524,_0x25a49d)[_0xc853('0x14')](function(_0x2bedcb){var _0x5c072a={'method':_0xc853('0x33'),'uri':_0x4cf130+_0xc853('0x34')+_0x1bfac5[_0xc853('0x35')]('+',_0xc853('0x36'))+'\x27','headers':{'Authorization':_0xc853('0x1b')+_0x2bedcb,'If-None-Match':null,'OData-Version':_0xc853('0x1c')},'json':!![]};return rp(_0x5c072a);})['then'](function(_0x2b562c){var _0x5190c2=![];if(!_0x2b562c)return _0x5190c2;var _0x1d97b=_0x2b562c['value'];for(var _0x37a2a6=0x0;_0x37a2a6<_0x1d97b[_0xc853('0x20')];_0x37a2a6++){if(_0x1d97b[_0x37a2a6][_0xc853('0x37')]===_0x1bfac5){_0x5190c2=!![];_0x49ac26[_0xc853('0x38')]=_0x1d97b[_0x37a2a6][_0xc853('0x39')];}}return _0x5190c2;})[_0xc853('0x14')](function(_0x55a442){if(_0x55a442)return _0x49ac26;if(_0x5b78fb===_0xc853('0x3a')){logger[_0xc853('0x22')]('['+[_0x25a49d['toUpperCase']()]+_0xc853('0x3b'));return _0x49ac26;}return createEndUser(_0x49ac26,_0x147146,_0x12a524,_0x4cf130,_0x138f2f,_0x25a49d)[_0xc853('0x14')](function(_0x1d01ab){logger[_0xc853('0x22')]('['+[_0x25a49d[_0xc853('0x18')]()]+_0xc853('0x3c'),_0x1d01ab[_0xc853('0x38')]);return _0x1d01ab;});});}function getCustomFields(_0x365b56,_0x52b01f,_0x201c17){var _0x2f6bb1={};if(_0x365b56[_0xc853('0x20')]>0x0){_[_0xc853('0x3d')](_0x365b56,function(_0x27db48){if(_[_0xc853('0x3e')]([_0xc853('0x3f'),_0xc853('0x40')],_0x27db48[_0xc853('0x41')])&&_0x27db48['nameField']&&!_0x27db48[_0xc853('0x42')]){var _0xa6c212=_0x27db48[_0xc853('0x43')][_0xc853('0x2a')]();var _0x1ba160=_0xa6c212[_0xc853('0x31')](0x0,_0xa6c212[_0xc853('0x44')]('_'));var _0x44a90d=_0xa6c212[_0xc853('0x31')](_0xa6c212[_0xc853('0x44')]('_')+0x1);if(_0x1ba160===_0x201c17){_0x2f6bb1[_0x44a90d]=_0x27db48[_0xc853('0x45')];}}});}return _0x2f6bb1;}function getTicket(_0x5908d6,_0x3fad09,_0x3209d9,_0x570536,_0x3e7664,_0x37cb7d,_0x568138){return new Promise(function(_0x49c7bb,_0x44c04e){var _0x574df3;return getAuthToken(_0x3fad09,_0x3209d9,_0x568138)[_0xc853('0x14')](function(_0x3d67f4){if(_0x37cb7d['ticketType']===_0xc853('0x46')){_0x574df3={'method':_0xc853('0x11'),'uri':_0x570536+_0xc853('0x47'),'body':Object['assign']({},{'title':intUtil[_0xc853('0x48')](_0x37cb7d['Subjects'],_0x3e7664,'\x20'),'description':intUtil[_0xc853('0x48')](_0x37cb7d[_0xc853('0x49')],_0x3e7664,'\x0a'),'customerid_contact@odata.bind':_0x5908d6[_0xc853('0x38')]?_0xc853('0x4a')+_0x5908d6[_0xc853('0x38')]+')':undefined,'ownerid@odata.bind':_0xc853('0x2f')+_0x5908d6[_0xc853('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x37cb7d['Fields'],_0x3e7664,_0x37cb7d['ticketType'])),'headers':{'Authorization':_0xc853('0x1b')+_0x3d67f4,'OData-Version':_0xc853('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x37cb7d[_0xc853('0x4b')]===_0xc853('0x4c')){var _0x595770=_0x5908d6['enduserId']?[{'partyid_systemuser@odata.bind':_0xc853('0x2f')+_0x5908d6[_0xc853('0x25')]+')','participationtypemask':_0x5908d6[_0xc853('0x4d')]===_0xc853('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0xc853('0x4a')+_0x5908d6[_0xc853('0x38')]+')','participationtypemask':_0x5908d6[_0xc853('0x4d')]===_0xc853('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xc853('0x2f')+_0x5908d6[_0xc853('0x25')]+')','participationtypemask':_0x5908d6[_0xc853('0x4d')]===_0xc853('0x4e')?0x2:0x1}];_0x574df3={'method':_0xc853('0x11'),'uri':_0x570536+_0xc853('0x4f'),'body':Object[_0xc853('0x50')]({},{'subject':intUtil['getString'](_0x37cb7d[_0xc853('0x51')],_0x3e7664,'\x20'),'phonenumber':String(_0x3e7664['calleridnum']),'description':intUtil[_0xc853('0x48')](_0x37cb7d[_0xc853('0x49')],_0x3e7664,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5908d6[_0xc853('0x38')]?_0xc853('0x4a')+_0x5908d6[_0xc853('0x38')]+')':undefined,'ownerid@odata.bind':_0xc853('0x2f')+_0x5908d6[_0xc853('0x25')]+')','directioncode':_0x5908d6[_0xc853('0x4d')]===_0xc853('0x4e')?![]:!![],'phonecall_activity_parties':_0x595770},getCustomFields(_0x37cb7d[_0xc853('0x52')],_0x3e7664,_0x37cb7d[_0xc853('0x4b')])),'headers':{'Authorization':_0xc853('0x1b')+_0x3d67f4,'OData-Version':_0xc853('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x574df3);})[_0xc853('0x14')](function(_0x3fc4a8){var _0x53f566=_0x3fc4a8[_0xc853('0x30')][_0xc853('0x53')];var _0x217770=_0x53f566[_0xc853('0x31')](_0x53f566[_0xc853('0x32')]('(')+0x1,_0x53f566[_0xc853('0x32')](')'));_0x5908d6['ticketId']=_0x217770;_0x49c7bb(_0x5908d6);})['catch'](function(_0x2bf58e){_0x44c04e(_0x2bf58e[_0xc853('0x1a')]);});});}function emit(_0x4ff79a,_0x3683b5,_0x5cbeda,_0x3d5639){var _0x299377={'uri':util[_0xc853('0x54')](_0xc853('0x55'),_0x4ff79a,_0x5cbeda,_0x3d5639)};io['to'](util[_0xc853('0x54')](_0xc853('0x56'),_0x3683b5))[_0xc853('0x57')](_0xc853('0x58'),_0x299377);}exports['cs']=function(_0x2b12fc,_0x53a63d,_0x261c87,_0x46147f,_0x44f996,_0x4ab433,_0x292bef,_0x20677f){var _0x3ef0fd={};_0x4ab433[_0xc853('0xc')]=_0x4ab433[_0xc853('0xb')]?intUtil[_0xc853('0x59')](_0x4ab433[_0xc853('0xd')][_0xc853('0x5a')]):intUtil['stripTrailingSlash'](_0x4ab433[_0xc853('0xc')]);_0x4ab433[_0xc853('0x5b')]=intUtil['stripTrailingSlash'](_0x4ab433[_0xc853('0x5b')]);_0x3ef0fd[_0xc853('0x4d')]=_0x20677f===_0xc853('0x4e')||_0x20677f===_0xc853('0x5c')?_0xc853('0x4e'):_0xc853('0x2b');var _0x9dc77d=_0x4ab433['modernAuthentication']?util['format']('%s/api/data/v9.0/',_0x4ab433[_0xc853('0xd')][_0xc853('0x5a')]):util[_0xc853('0x54')](_0xc853('0x5d'),_0x4ab433['remoteUri']);var _0x28c67c=util['format'](_0xc853('0x5e'),_0x4ab433[_0xc853('0xe')]);var _0x4976e7=util[_0xc853('0x54')](_0xc853('0x5f'),_0x4ab433[_0xc853('0x5b')],_0x53a63d[_0xc853('0x60')],md5(_0x53a63d[_0xc853('0x60')]));if(_0x44f996&&_0x44f996[_0xc853('0x61')]){logger[_0xc853('0x22')](_0xc853('0x62'),_0xc853('0x63'));_0x53a63d[_0xc853('0x64')]=_0x4976e7;}else if(_0x292bef&&_0x292bef[_0xc853('0x65')]&&_0x292bef[_0xc853('0x65')]!==_0xc853('0x66')){logger[_0xc853('0x22')]('[OUTBOUND]',_0xc853('0x63'));_0x53a63d[_0xc853('0x64')]=_0x4976e7;}else{_0x53a63d[_0xc853('0x64')]='';}return getUser(_0x3ef0fd,_0x4ab433,_0x46147f,_0x28c67c,_0x9dc77d,_0x20677f)['then'](function(_0x471b2b){logger[_0xc853('0x22')]('['+_0x20677f['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x471b2b[_0xc853('0x25')]);logger['info']('['+_0x20677f[_0xc853('0x18')]()+_0xc853('0x67'),_0x471b2b[_0xc853('0x27')]);return getEndUser(_0x471b2b,_0x4ab433,_0x28c67c,_0x9dc77d,_0x53a63d,_0x20677f,_0x261c87['moduleCreate']);})[_0xc853('0x14')](function(_0x4fb47d){logger['info']('['+_0x20677f['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x4fb47d[_0xc853('0x38')]);logger[_0xc853('0x22')]('['+_0x20677f[_0xc853('0x18')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x53a63d['calleridnum']);return getTicket(_0x4fb47d,_0x4ab433,_0x28c67c,_0x9dc77d,_0x53a63d,_0x261c87,_0x20677f);})['then'](function(_0x3041eb){logger['info'](util[_0xc853('0x54')]('['+_0x20677f[_0xc853('0x18')]()+_0xc853('0x68'),_0x261c87['ticketType'],_0x3041eb[_0xc853('0x69')]));logger[_0xc853('0x22')](util['format']('['+_0x20677f[_0xc853('0x18')]()+_0xc853('0x6a'),_0x20677f));if(_0x20677f!=='unmanaged'){logger[_0xc853('0x22')]('['+_0x20677f['toUpperCase']()+']',_0xc853('0x6b'));emit(_0x4ab433['remoteUri'],_0x46147f['name'],_0x261c87['ticketType'],_0x3041eb[_0xc853('0x69')]);}})[_0xc853('0x16')](function(_0x2a1ee2){logger[_0xc853('0x17')]('['+_0x20677f[_0xc853('0x18')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2a1ee2[_0xc853('0x1a')]);});};
\ No newline at end of file
index d70577a..48af41b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbffa=['idField','push','variable','variableName','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]','unmanaged','lastevent','toUpperCase','lodash','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','Fields','custom_fields','keyBy','value','format','POST','then','%s/api/v2/agents','remoteUri','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20created.','toString','base64','[HTTP]','GET','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type'];(function(_0x29215d,_0x39143f){var _0x265037=function(_0x3e07ff){while(--_0x3e07ff){_0x29215d['push'](_0x29215d['shift']());}};_0x265037(++_0x39143f);}(_0xbffa,0xd6));var _0xabff=function(_0x392b08,_0x8ba113){_0x392b08=_0x392b08-0x0;var _0x5bc150=_0xbffa[_0x392b08];return _0x5bc150;};'use strict';var _=require(_0xabff('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0xabff('0x1'));var intUtil=require(_0xabff('0x2'));var config=require(_0xabff('0x3'));var logger=require(_0xabff('0x4'))(_0xabff('0x5'));config[_0xabff('0x6')]=_[_0xabff('0x7')](config[_0xabff('0x6')],{'host':_0xabff('0x8'),'port':0x18eb});var io=require(_0xabff('0x9'))(new Redis(config[_0xabff('0x6')]));var headers={'Content-Type':_0xabff('0xa'),'Accept':'application/json'};function emit(_0xfb50a3,_0x15da83,_0x473d7a){io['to'](_0xfb50a3)[_0xabff('0xb')](_0x15da83,_0x473d7a);}function getTicket(_0x54a5be,_0x48e7fb,_0x906a2d,_0x1fe876,_0x4e38d0){logger[_0xabff('0xc')]('Creating\x20new\x20ticket...');var _0x392386=_[_0xabff('0xd')]({'responder_id':_0x48e7fb['id'],'requester_id':_0x906a2d['id'],'name':util['format']('Caller\x20-\x20%s',_0x4e38d0[_0xabff('0xe')]),'phone':_0x4e38d0[_0xabff('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xabff('0x10')](_0x1fe876[_0xabff('0x11')],_0x4e38d0,'\x20'),'description':intUtil[_0xabff('0x10')](_0x1fe876[_0xabff('0x12')],_0x4e38d0,'<br>'),'tags':getTags(_0x1fe876[_0xabff('0x13')],'name')},getCustomFields(_0x1fe876[_0xabff('0x14')],_0x4e38d0));_0x392386[_0xabff('0x15')]=_['mapValues'](_[_0xabff('0x16')](_0x392386[_0xabff('0x15')],'id'),_0xabff('0x17'));return request({'uri':util[_0xabff('0x18')]('%s/api/v2/tickets',_0x54a5be['remoteUri']),'method':_0xabff('0x19'),'body':_0x392386})[_0xabff('0x1a')](function(_0x55c3c2){logger['info']('Ticket\x20created!');return _0x55c3c2;});}function getUser(_0x102d67,_0x18198f){if(intUtil['validateEmail'](_0x18198f)){return request({'uri':util[_0xabff('0x18')](_0xabff('0x1b'),_0x102d67[_0xabff('0x1c')]),'qs':{'email':_0x18198f}})[_0xabff('0x1a')](function(_0x23a20e){if(_0x23a20e['length']){logger[_0xabff('0xc')]('Agent\x20found!');return _[_0xabff('0x1d')](_0x23a20e,function(_0x3fae05){return _0x3fae05[_0xabff('0x1e')][_0xabff('0x1f')]===_0x18198f;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xabff('0x18')](_0xabff('0x20'),_0x102d67['remoteUri'])})[_0xabff('0x1a')](function(_0x107a79){logger['info'](_0xabff('0x21'));return _0x107a79;});}});}else{logger[_0xabff('0xc')](_0xabff('0x22'));return request({'uri':util['format'](_0xabff('0x20'),_0x102d67[_0xabff('0x1c')])})[_0xabff('0x1a')](function(_0x43b619){logger[_0xabff('0xc')](_0xabff('0x21'));return _0x43b619;});}}function getEndUser(_0x3c53b5,_0x148c36,_0x277bbc){logger[_0xabff('0xc')](_0xabff('0x23'),_0x277bbc);return request({'uri':util[_0xabff('0x18')](_0xabff('0x24'),_0x3c53b5[_0xabff('0x1c')]),'qs':{'phone':_0x277bbc}})[_0xabff('0x1a')](function(_0x1acbf7){if(_0x1acbf7[_0xabff('0x25')]){logger[_0xabff('0xc')](_0xabff('0x26'));return _['find'](_0x1acbf7,{'phone':_0x277bbc});}else{logger[_0xabff('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xabff('0x18')](_0xabff('0x24'),_0x3c53b5['remoteUri']),'method':_0xabff('0x19'),'body':{'name':_0x148c36,'phone':_0x277bbc}})[_0xabff('0x1a')](function(_0x11a581){logger[_0xabff('0xc')](_0xabff('0x27'));return _0x11a581;});}});}function getAuth(_0x25f39b){return util[_0xabff('0x18')]('Basic\x20%s',new Buffer(_0x25f39b['apiKey']+':X')[_0xabff('0x28')](_0xabff('0x29')));}function request(_0x349c1b){logger['debug'](_0xabff('0x2a'),JSON['stringify'](_0x349c1b));return rp(_[_0xabff('0x7')](_0x349c1b,{'method':_0xabff('0x2b'),'headers':headers,'json':!![]}));}function getTags(_0x3df26f,_0x3e4e6b){var _0x43aa73=[];if(_0x3df26f&&_0x3df26f[_0xabff('0x25')]>0x0){_0x43aa73=_['map'](_0x3df26f,_0x3e4e6b);}return _0x43aa73;}function getCustomFields(_0x2d0b15,_0x121ea4){var _0x574652=[];var _0x52ba18={'custom_fields':[]};if(_0x2d0b15[_0xabff('0x25')]>0x0){_[_0xabff('0x2c')](_0x2d0b15,function(_0x1f28d7){if(_[_0xabff('0x2d')]([_0xabff('0x2e'),_0xabff('0x2f')],_0x1f28d7['type'])&&_0x1f28d7[_0xabff('0x30')]&&!_0x1f28d7[_0xabff('0x31')]){_0x52ba18[_0x1f28d7[_0xabff('0x30')][_0xabff('0x32')]()]=_0x1f28d7[_0xabff('0x33')][_0xabff('0x28')]();}else if(_[_0xabff('0x2d')]([_0xabff('0x2e'),'picklist'],_0x1f28d7[_0xabff('0x34')])&&_0x1f28d7[_0xabff('0x35')]&&_0x1f28d7[_0xabff('0x31')]){_0x52ba18['custom_fields'][_0xabff('0x36')]({'id':_0x1f28d7['idField'],'value':_0x1f28d7[_0xabff('0x33')][_0xabff('0x28')]()});}else if(_0x1f28d7[_0xabff('0x34')]===_0xabff('0x37')&&_0x1f28d7[_0xabff('0x38')]&&_0x1f28d7[_0xabff('0x35')]&&_0x1f28d7[_0xabff('0x31')]){_0x121ea4[_0x1f28d7[_0xabff('0x38')]]&&_0x52ba18[_0xabff('0x15')][_0xabff('0x36')]({'id':_0x1f28d7[_0xabff('0x35')],'value':_0x121ea4[_0x1f28d7[_0xabff('0x38')]][_0xabff('0x28')]()});}else if(_0x1f28d7[_0xabff('0x34')]===_0xabff('0x39')&&_0x1f28d7[_0xabff('0x3a')]&&_0x1f28d7[_0xabff('0x3a')][_0xabff('0x3b')]&&_0x1f28d7['idField']&&_0x1f28d7[_0xabff('0x31')]){_0x121ea4[_0x1f28d7[_0xabff('0x3a')][_0xabff('0x3b')][_0xabff('0x32')]()]&&_0x52ba18[_0xabff('0x15')][_0xabff('0x36')]({'id':_0x1f28d7[_0xabff('0x35')],'value':_0x121ea4[_0x1f28d7[_0xabff('0x3a')][_0xabff('0x3b')]['toLowerCase']()][_0xabff('0x28')]()});}});}return _0x52ba18;}exports['queue']=function(_0x5e6cb0,_0xc7c27a,_0x39bc5a,_0x30c1da,_0xa6c393,_0x2be925){var _0x404d7b,_0x1289e2;_0x2be925[_0xabff('0x1c')]=intUtil[_0xabff('0x3c')](_0x2be925[_0xabff('0x1c')]);_0x2be925[_0xabff('0x3d')]=intUtil[_0xabff('0x3c')](_0x2be925[_0xabff('0x3d')]);if(_0xa6c393&&_0xa6c393[_0xabff('0x3e')]){logger[_0xabff('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0xc7c27a[_0xabff('0x3f')]=util['format'](_0xabff('0x40'),_0x2be925['serverUrl'],_0xc7c27a[_0xabff('0x41')],md5(_0xc7c27a[_0xabff('0x41')]));}else{_0xc7c27a[_0xabff('0x3f')]='';}headers[_0xabff('0x42')]=getAuth(_0x2be925);return getUser(_0x2be925,_0x30c1da[_0xabff('0x1f')])['then'](function(_0x105ed6){_0x404d7b=_0x105ed6;logger[_0xabff('0xc')](_0xabff('0x43'),_0x404d7b['id']);return getEndUser(_0x2be925,_0xc7c27a[_0xabff('0xe')],_0xc7c27a['calleridnum']);})[_0xabff('0x1a')](function(_0x40491b){_0x1289e2=_0x40491b;logger[_0xabff('0xc')](_0xabff('0x44'),_0x1289e2['id']);return getTicket(_0x2be925,_0x404d7b,_0x1289e2,_0x39bc5a,_0xc7c27a);})[_0xabff('0x1a')](function(_0x2c21fc){if(_0x2c21fc&&_0x2c21fc['id']){logger[_0xabff('0xc')](_0xabff('0x45'));logger[_0xabff('0xc')](_0xabff('0x46'),_0x2c21fc['id']);logger[_0xabff('0xc')](_0xabff('0x47'),_0xabff('0x48'));emit(util[_0xabff('0x18')](_0xabff('0x49'),_0x30c1da[_0xabff('0x3b')]),_0xabff('0x4a'),{'uri':util[_0xabff('0x18')](_0xabff('0x4b'),_0x2be925['remoteUri'],_0x2c21fc['id'])});}})[_0xabff('0x4c')](function(_0xa42e8f){logger[_0xabff('0x4d')](_0xabff('0x47'),JSON[_0xabff('0x4e')](_0xa42e8f));});};exports[_0xabff('0x4f')]=function(_0x2e4ae4,_0x26dbc9,_0x280d25,_0x151528,_0x42c062,_0x1e6cea,_0x25242b){var _0x5872e6,_0x5e7fd6;_0x1e6cea[_0xabff('0x1c')]=intUtil['stripTrailingSlash'](_0x1e6cea[_0xabff('0x1c')]);_0x1e6cea[_0xabff('0x3d')]=intUtil[_0xabff('0x3c')](_0x1e6cea[_0xabff('0x3d')]);if(_0x25242b&&_0x25242b[_0xabff('0x50')]&&_0x25242b[_0xabff('0x50')]!==_0xabff('0x51')){logger[_0xabff('0xc')]('[OUTBOUND]',_0xabff('0x52'));_0x26dbc9[_0xabff('0x3f')]=util[_0xabff('0x18')](_0xabff('0x40'),_0x1e6cea[_0xabff('0x3d')],_0x26dbc9['uniqueid'],md5(_0x26dbc9['uniqueid']));}headers['Authorization']=getAuth(_0x1e6cea);return getUser(_0x1e6cea,_0x151528['email'])['then'](function(_0x773374){_0x5872e6=_0x773374;logger[_0xabff('0xc')](_0xabff('0x43'),_0x5872e6['id']);return getEndUser(_0x1e6cea,_0x26dbc9[_0xabff('0x53')],_0x26dbc9[_0xabff('0x54')]);})[_0xabff('0x1a')](function(_0x2e164a){_0x5e7fd6=_0x2e164a;logger[_0xabff('0xc')]('The\x20Enduser\x20ID\x20is:',_0x5e7fd6['id']);return getTicket(_0x1e6cea,_0x5872e6,_0x5e7fd6,_0x280d25,_0x26dbc9);})['then'](function(_0x3296c5){if(_0x3296c5&&_0x3296c5['id']){logger[_0xabff('0xc')]('Ticket\x20created!');logger[_0xabff('0xc')](_0xabff('0x46'),_0x3296c5['id']);logger[_0xabff('0xc')]('[OUTBOUND]',_0xabff('0x48'));emit(util[_0xabff('0x18')](_0xabff('0x49'),_0x151528[_0xabff('0x3b')]),'trigger:browser:url',{'uri':util[_0xabff('0x18')]('%s/helpdesk/tickets/%d',_0x1e6cea['remoteUri'],_0x3296c5['id'])});}})[_0xabff('0x4c')](function(_0x5c0fc3){logger[_0xabff('0x4d')](_0xabff('0x55'),JSON[_0xabff('0x4e')](_0x5c0fc3));});};exports[_0xabff('0x56')]=function(_0x2143dd,_0x3b0757,_0x414eb9,_0x481867,_0x23153c,_0x5c704b){var _0x37d64a,_0xe95ade;_0x5c704b[_0xabff('0x1c')]=intUtil[_0xabff('0x3c')](_0x5c704b['remoteUri']);_0x5c704b['serverUrl']=intUtil[_0xabff('0x3c')](_0x5c704b['serverUrl']);if(_0x23153c&&_0x23153c[_0xabff('0x3e')]){logger[_0xabff('0xc')]('['+_0x3b0757[_0xabff('0x57')][_0xabff('0x58')]()+']',_0xabff('0x52'));_0x3b0757['recordingURL']=util[_0xabff('0x18')](_0xabff('0x40'),_0x5c704b['serverUrl'],_0x3b0757['uniqueid'],md5(_0x3b0757[_0xabff('0x41')]));}else{_0x3b0757[_0xabff('0x3f')]='';}headers[_0xabff('0x42')]=getAuth(_0x5c704b);return getUser(_0x5c704b,'')[_0xabff('0x1a')](function(_0x501132){_0x37d64a=_0x501132;logger['info'](_0xabff('0x43'),_0x37d64a['id']);return getEndUser(_0x5c704b,_0x3b0757[_0xabff('0xe')],_0x3b0757[_0xabff('0xf')]);})['then'](function(_0x111f15){_0xe95ade=_0x111f15;logger[_0xabff('0xc')](_0xabff('0x44'),_0xe95ade['id']);return getTicket(_0x5c704b,_0x37d64a,_0xe95ade,_0x414eb9,_0x3b0757);})['then'](function(_0x49833e){if(_0x49833e){logger[_0xabff('0xc')]('Ticket\x20created!');logger[_0xabff('0xc')](_0xabff('0x46'),_0x49833e['id']);}})[_0xabff('0x4c')](function(_0x11c370){logger['error']('['+_0x3b0757[_0xabff('0x57')]['toUpperCase']()+']',JSON[_0xabff('0x4e')](_0x11c370));});};
\ No newline at end of file
+var _0x066f=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','Authorization','The\x20User\x20ID\x20is:','error','lastevent','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','info','merge','format','Caller\x20-\x20%s','calleridnum','getString','Descriptions','<br>','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','push','idField','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x066f,0x1f2));var _0xf066=function(_0x383e68,_0x221fd7){_0x383e68=_0x383e68-0x0;var _0x2c0277=_0x066f[_0x383e68];return _0x2c0277;};'use strict';var _=require('lodash');var rp=require(_0xf066('0x0'));var md5=require(_0xf066('0x1'));var util=require(_0xf066('0x2'));var Redis=require(_0xf066('0x3'));var intUtil=require(_0xf066('0x4'));var config=require(_0xf066('0x5'));var logger=require(_0xf066('0x6'))(_0xf066('0x7'));config[_0xf066('0x8')]=_['defaults'](config[_0xf066('0x8')],{'host':_0xf066('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf066('0x8')]));var headers={'Content-Type':'application/json','Accept':_0xf066('0xa')};function emit(_0x334db8,_0x59f5f1,_0x378bb4){io['to'](_0x334db8)['emit'](_0x59f5f1,_0x378bb4);}function getTicket(_0x4b3204,_0x3e5380,_0x333147,_0x34ba05,_0x2ff5f7){logger[_0xf066('0xb')]('Creating\x20new\x20ticket...');var _0x578515=_[_0xf066('0xc')]({'responder_id':_0x3e5380['id'],'requester_id':_0x333147['id'],'name':util[_0xf066('0xd')](_0xf066('0xe'),_0x2ff5f7['calleridname']),'phone':_0x2ff5f7[_0xf066('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf066('0x10')](_0x34ba05['Subjects'],_0x2ff5f7,'\x20'),'description':intUtil[_0xf066('0x10')](_0x34ba05[_0xf066('0x11')],_0x2ff5f7,_0xf066('0x12')),'tags':getTags(_0x34ba05[_0xf066('0x13')],'name')},getCustomFields(_0x34ba05[_0xf066('0x14')],_0x2ff5f7));_0x578515[_0xf066('0x15')]=_[_0xf066('0x16')](_[_0xf066('0x17')](_0x578515[_0xf066('0x15')],'id'),_0xf066('0x18'));return request({'uri':util[_0xf066('0xd')](_0xf066('0x19'),_0x4b3204[_0xf066('0x1a')]),'method':'POST','body':_0x578515})[_0xf066('0x1b')](function(_0x276d3e){logger[_0xf066('0xb')](_0xf066('0x1c'));return _0x276d3e;});}function getUser(_0x4c2774,_0xc69e9e){if(intUtil[_0xf066('0x1d')](_0xc69e9e)){return request({'uri':util[_0xf066('0xd')]('%s/api/v2/agents',_0x4c2774[_0xf066('0x1a')]),'qs':{'email':_0xc69e9e}})[_0xf066('0x1b')](function(_0x1eddaa){if(_0x1eddaa[_0xf066('0x1e')]){logger['info'](_0xf066('0x1f'));return _[_0xf066('0x20')](_0x1eddaa,function(_0x34ef83){return _0x34ef83[_0xf066('0x21')][_0xf066('0x22')]===_0xc69e9e;});}else{logger['info'](_0xf066('0x23'));return request({'uri':util[_0xf066('0xd')](_0xf066('0x24'),_0x4c2774['remoteUri'])})[_0xf066('0x1b')](function(_0x554b38){logger[_0xf066('0xb')](_0xf066('0x25'));return _0x554b38;});}});}else{logger[_0xf066('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf066('0xd')]('%s/api/v2/agents/me',_0x4c2774[_0xf066('0x1a')])})['then'](function(_0x4eddd1){logger[_0xf066('0xb')](_0xf066('0x25'));return _0x4eddd1;});}}function getEndUser(_0x1aadcc,_0x4fe51c,_0x30c26f){logger[_0xf066('0xb')]('Searching\x20enduser\x20with\x20phone',_0x30c26f);return request({'uri':util[_0xf066('0xd')]('%s/api/v2/contacts',_0x1aadcc[_0xf066('0x1a')]),'qs':{'phone':_0x30c26f}})[_0xf066('0x1b')](function(_0x5677b7){if(_0x5677b7[_0xf066('0x1e')]){logger[_0xf066('0xb')](_0xf066('0x26'));return _[_0xf066('0x20')](_0x5677b7,{'phone':_0x30c26f});}else{logger[_0xf066('0xb')](_0xf066('0x27'));return request({'uri':util['format']('%s/api/v2/contacts',_0x1aadcc[_0xf066('0x1a')]),'method':_0xf066('0x28'),'body':{'name':_0x4fe51c,'phone':_0x30c26f}})[_0xf066('0x1b')](function(_0x22aa00){logger[_0xf066('0xb')](_0xf066('0x29'));return _0x22aa00;});}});}function getAuth(_0xc8e83c){return util[_0xf066('0xd')](_0xf066('0x2a'),new Buffer(_0xc8e83c[_0xf066('0x2b')]+':X')['toString'](_0xf066('0x2c')));}function request(_0x26b3e7){logger[_0xf066('0x2d')](_0xf066('0x2e'),JSON[_0xf066('0x2f')](_0x26b3e7));return rp(_[_0xf066('0x30')](_0x26b3e7,{'method':_0xf066('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x154b3a,_0x257dae){var _0xba6d19=[];if(_0x154b3a&&_0x154b3a[_0xf066('0x1e')]>0x0){_0xba6d19=_[_0xf066('0x32')](_0x154b3a,_0x257dae);}return _0xba6d19;}function getCustomFields(_0x209970,_0x555cb0){var _0x3b5a53=[];var _0x57dff2={'custom_fields':[]};if(_0x209970[_0xf066('0x1e')]>0x0){_[_0xf066('0x33')](_0x209970,function(_0x55fda6){if(_[_0xf066('0x34')]([_0xf066('0x35'),_0xf066('0x36')],_0x55fda6[_0xf066('0x37')])&&_0x55fda6['nameField']&&!_0x55fda6[_0xf066('0x38')]){_0x57dff2[_0x55fda6[_0xf066('0x39')][_0xf066('0x3a')]()]=_0x55fda6[_0xf066('0x3b')][_0xf066('0x3c')]();}else if(_[_0xf066('0x34')]([_0xf066('0x35'),_0xf066('0x36')],_0x55fda6[_0xf066('0x37')])&&_0x55fda6['idField']&&_0x55fda6[_0xf066('0x38')]){_0x57dff2[_0xf066('0x15')][_0xf066('0x3d')]({'id':_0x55fda6[_0xf066('0x3e')],'value':_0x55fda6[_0xf066('0x3b')][_0xf066('0x3c')]()});}else if(_0x55fda6[_0xf066('0x37')]===_0xf066('0x3f')&&_0x55fda6[_0xf066('0x40')]&&_0x55fda6[_0xf066('0x3e')]&&_0x55fda6[_0xf066('0x38')]){_0x555cb0[_0x55fda6[_0xf066('0x40')]]&&_0x57dff2[_0xf066('0x15')][_0xf066('0x3d')]({'id':_0x55fda6[_0xf066('0x3e')],'value':_0x555cb0[_0x55fda6[_0xf066('0x40')]][_0xf066('0x3c')]()});}else if(_0x55fda6['type']===_0xf066('0x41')&&_0x55fda6[_0xf066('0x42')]&&_0x55fda6[_0xf066('0x42')][_0xf066('0x43')]&&_0x55fda6[_0xf066('0x3e')]&&_0x55fda6['customField']){_0x555cb0[_0x55fda6['Variable']['name'][_0xf066('0x3a')]()]&&_0x57dff2[_0xf066('0x15')][_0xf066('0x3d')]({'id':_0x55fda6[_0xf066('0x3e')],'value':_0x555cb0[_0x55fda6[_0xf066('0x42')][_0xf066('0x43')]['toLowerCase']()][_0xf066('0x3c')]()});}});}return _0x57dff2;}exports[_0xf066('0x44')]=function(_0x47e3ba,_0x2bfaa7,_0x5d63de,_0x4f4209,_0x43d041,_0x46d669){var _0x17e526,_0x3290bb;_0x46d669['remoteUri']=intUtil[_0xf066('0x45')](_0x46d669[_0xf066('0x1a')]);_0x46d669['serverUrl']=intUtil[_0xf066('0x45')](_0x46d669[_0xf066('0x46')]);if(_0x43d041&&_0x43d041[_0xf066('0x47')]){logger[_0xf066('0xb')](_0xf066('0x48'),_0xf066('0x49'));_0x2bfaa7[_0xf066('0x4a')]=util['format'](_0xf066('0x4b'),_0x46d669[_0xf066('0x46')],_0x2bfaa7[_0xf066('0x4c')],md5(_0x2bfaa7[_0xf066('0x4c')]));}else{_0x2bfaa7[_0xf066('0x4a')]='';}headers['Authorization']=getAuth(_0x46d669);return getUser(_0x46d669,_0x4f4209['email'])[_0xf066('0x1b')](function(_0x4b5e60){_0x17e526=_0x4b5e60;logger[_0xf066('0xb')]('The\x20User\x20ID\x20is:',_0x17e526['id']);return getEndUser(_0x46d669,_0x2bfaa7[_0xf066('0x4d')],_0x2bfaa7['calleridnum']);})[_0xf066('0x1b')](function(_0x15dbcc){_0x3290bb=_0x15dbcc;logger[_0xf066('0xb')](_0xf066('0x4e'),_0x3290bb['id']);return getTicket(_0x46d669,_0x17e526,_0x3290bb,_0x5d63de,_0x2bfaa7);})[_0xf066('0x1b')](function(_0x5f0f9a){if(_0x5f0f9a&&_0x5f0f9a['id']){logger[_0xf066('0xb')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f0f9a['id']);logger[_0xf066('0xb')](_0xf066('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf066('0xd')](_0xf066('0x4f'),_0x4f4209[_0xf066('0x43')]),_0xf066('0x50'),{'uri':util[_0xf066('0xd')](_0xf066('0x51'),_0x46d669['remoteUri'],_0x5f0f9a['id'])});}})[_0xf066('0x52')](function(_0xaec534){logger['error']('[QUEUE]',JSON[_0xf066('0x2f')](_0xaec534));});};exports[_0xf066('0x53')]=function(_0x2549b8,_0x5334cc,_0x181400,_0x392bff,_0x214a68,_0x5a9ade,_0x1a11f8){var _0xe329e6,_0x468df3;_0x5a9ade[_0xf066('0x1a')]=intUtil[_0xf066('0x45')](_0x5a9ade['remoteUri']);_0x5a9ade['serverUrl']=intUtil[_0xf066('0x45')](_0x5a9ade['serverUrl']);if(_0x1a11f8&&_0x1a11f8[_0xf066('0x54')]&&_0x1a11f8['recordingFormat']!==_0xf066('0x55')){logger[_0xf066('0xb')](_0xf066('0x56'),_0xf066('0x49'));_0x5334cc[_0xf066('0x4a')]=util[_0xf066('0xd')](_0xf066('0x4b'),_0x5a9ade[_0xf066('0x46')],_0x5334cc[_0xf066('0x4c')],md5(_0x5334cc[_0xf066('0x4c')]));}headers['Authorization']=getAuth(_0x5a9ade);return getUser(_0x5a9ade,_0x392bff['email'])[_0xf066('0x1b')](function(_0x365ec0){_0xe329e6=_0x365ec0;logger['info']('The\x20User\x20ID\x20is:',_0xe329e6['id']);return getEndUser(_0x5a9ade,_0x5334cc['destcalleridname'],_0x5334cc['destcalleridnum']);})['then'](function(_0x2de395){_0x468df3=_0x2de395;logger['info']('The\x20Enduser\x20ID\x20is:',_0x468df3['id']);return getTicket(_0x5a9ade,_0xe329e6,_0x468df3,_0x181400,_0x5334cc);})[_0xf066('0x1b')](function(_0x23a6a9){if(_0x23a6a9&&_0x23a6a9['id']){logger[_0xf066('0xb')](_0xf066('0x1c'));logger[_0xf066('0xb')](_0xf066('0x57'),_0x23a6a9['id']);logger[_0xf066('0xb')](_0xf066('0x56'),_0xf066('0x58'));emit(util[_0xf066('0xd')](_0xf066('0x4f'),_0x392bff[_0xf066('0x43')]),_0xf066('0x50'),{'uri':util[_0xf066('0xd')](_0xf066('0x51'),_0x5a9ade[_0xf066('0x1a')],_0x23a6a9['id'])});}})[_0xf066('0x52')](function(_0x232728){logger['error'](_0xf066('0x56'),JSON[_0xf066('0x2f')](_0x232728));});};exports[_0xf066('0x59')]=function(_0x50f169,_0x36442a,_0xc95814,_0x564763,_0x4ee98f,_0x4f0ca8){var _0x55cc91,_0x5d0f6e;_0x4f0ca8['remoteUri']=intUtil[_0xf066('0x45')](_0x4f0ca8[_0xf066('0x1a')]);_0x4f0ca8[_0xf066('0x46')]=intUtil[_0xf066('0x45')](_0x4f0ca8[_0xf066('0x46')]);if(_0x4ee98f&&_0x4ee98f['monitor_format']){logger[_0xf066('0xb')]('['+_0x36442a['lastevent'][_0xf066('0x5a')]()+']','Recording\x20is\x20enabled!');_0x36442a[_0xf066('0x4a')]=util[_0xf066('0xd')](_0xf066('0x4b'),_0x4f0ca8[_0xf066('0x46')],_0x36442a[_0xf066('0x4c')],md5(_0x36442a['uniqueid']));}else{_0x36442a['recordingURL']='';}headers[_0xf066('0x5b')]=getAuth(_0x4f0ca8);return getUser(_0x4f0ca8,'')[_0xf066('0x1b')](function(_0xae6a51){_0x55cc91=_0xae6a51;logger[_0xf066('0xb')](_0xf066('0x5c'),_0x55cc91['id']);return getEndUser(_0x4f0ca8,_0x36442a[_0xf066('0x4d')],_0x36442a[_0xf066('0xf')]);})[_0xf066('0x1b')](function(_0x1cd92b){_0x5d0f6e=_0x1cd92b;logger[_0xf066('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5d0f6e['id']);return getTicket(_0x4f0ca8,_0x55cc91,_0x5d0f6e,_0xc95814,_0x36442a);})['then'](function(_0x2e2821){if(_0x2e2821){logger[_0xf066('0xb')](_0xf066('0x1c'));logger[_0xf066('0xb')](_0xf066('0x57'),_0x2e2821['id']);}})['catch'](function(_0x390373){logger[_0xf066('0x5d')]('['+_0x36442a[_0xf066('0x5e')]['toUpperCase']()+']',JSON[_0xf066('0x2f')](_0x390373));});};
\ No newline at end of file
index 13e72fa..4d0a2f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab53=['Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','util','moment','bluebird','./util','../../../../config/environment','defaults','redis','localhost','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','GET','Getting\x20user\x20list','agentEmail','User\x20found:','userId','Admin\x20selected','userEmail','adminEmail','catch','error','message','/api/lookup?q=','&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0xab53,0xa6));var _0x3ab5=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xab53[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require(_0x3ab5('0x0'));var rp=require('request-promise');var md5=require(_0x3ab5('0x1'));var util=require(_0x3ab5('0x2'));var moment=require(_0x3ab5('0x3'));var Promise=require(_0x3ab5('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3ab5('0x5'));var config=require(_0x3ab5('0x6'));var logger=require('../../../../config/logger')('freshsales');config['redis']=_[_0x3ab5('0x7')](config[_0x3ab5('0x8')],{'host':_0x3ab5('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3ab5('0x8')]));function getAdminId(_0x3c8d29,_0x1aa96a,_0x459c70,_0x3d45d3){return new Promise(function(_0x386d29,_0x262c65){var _0x1cb222=![];var _0x129277={'method':'GET','uri':_0x3d45d3+_0x3ab5('0xa'),'json':!![]};_0x129277[_0x3ab5('0xb')]=_0x459c70;logger[_0x3ab5('0xc')](_0x3ab5('0xd'));return rp(_0x129277)[_0x3ab5('0xe')](function(_0x4ca7e4){if(_0x4ca7e4){var _0x45a66c=_0x4ca7e4[_0x3ab5('0xf')];var _0x2a7dbc=null;for(_0x2a7dbc=0x0;_0x2a7dbc<_0x45a66c[_0x3ab5('0x10')];_0x2a7dbc++){if(_0x45a66c[_0x2a7dbc][_0x3ab5('0x11')]===_0x3c8d29['adminEmail']){_0x3c8d29[_0x3ab5('0x12')]=_0x45a66c[_0x2a7dbc]['id'];_0x1cb222=!![];}}if(_0x1cb222){logger[_0x3ab5('0xc')](_0x3ab5('0x13'),_0x3c8d29['adminId']);_0x386d29(_0x3c8d29);}else{_0x262c65({'statusCode':0x194,'message':_0x3ab5('0x14')});}}else{_0x262c65({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x9864de){logger['error']('['+[_0x1aa96a[_0x3ab5('0x15')]()]+']',_0x9864de['message']);_0x262c65(_0x9864de);});});}function getUser(_0xa7c08d,_0x5f4cba,_0x17a8f7){return function(_0x9b9620){return new Promise(function(_0x456646,_0xb82c6b){var _0x4b558f={'method':_0x3ab5('0x16'),'uri':_0x17a8f7+'/api/selector/owners','json':!![]};_0x4b558f[_0x3ab5('0xb')]=_0x5f4cba;logger['info'](_0x3ab5('0x17'));return rp(_0x4b558f)[_0x3ab5('0xe')](function(_0x1071d0){if(_0x1071d0){var _0x4f0862=_0x1071d0[_0x3ab5('0xf')];var _0xed5d67=![];var _0x14a81d=null;if(_0x9b9620['agentEmail']!==null){logger[_0x3ab5('0xc')]('Getting\x20user\x20with\x20email',_0x9b9620[_0x3ab5('0x18')]);_0x9b9620['userEmail']=_0x9b9620[_0x3ab5('0x18')];for(_0x14a81d=0x0;_0x14a81d<_0x4f0862[_0x3ab5('0x10')];_0x14a81d++){if(_0x4f0862[_0x14a81d]['email']===_0x9b9620[_0x3ab5('0x18')]){_0xed5d67=!![];_0x9b9620['userId']=_0x4f0862[_0x14a81d]['id'];logger['info'](_0x3ab5('0x19'),_0x9b9620[_0x3ab5('0x1a')]);}}}if(!_0xed5d67){logger[_0x3ab5('0xc')](_0x3ab5('0x1b'));_0x9b9620[_0x3ab5('0x1c')]=_0x9b9620[_0x3ab5('0x1d')];_0x9b9620['userId']=_0x9b9620[_0x3ab5('0x12')];_0xed5d67=!![];}if(_0xed5d67){_0x456646(_0x9b9620);}else{_0xb82c6b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xb82c6b({'statusCode':0x194,'message':_0x3ab5('0x14')});}})[_0x3ab5('0x1e')](function(_0x43faef){logger[_0x3ab5('0x1f')]('['+[_0xa7c08d[_0x3ab5('0x15')]()]+']',_0x43faef[_0x3ab5('0x20')]);_0xb82c6b(_0x43faef);});});};}function searchContact(_0x1e597f,_0x4d97fd,_0x434264,_0x310e75){return new Promise(function(_0x33e7a9,_0x46d61a){var _0x30b213={'method':_0x3ab5('0x16'),'headers':_0x4d97fd,'uri':_0x1e597f+_0x3ab5('0x21')+_0x310e75+_0x3ab5('0x22')+_0x434264+'&entities=contact','json':!![]};rp(_0x30b213)[_0x3ab5('0xe')](function(_0xb93c7f){var _0x23f084=_['find'](_0xb93c7f[_0x3ab5('0x23')][_0x3ab5('0x23')],[_0x434264,_0x310e75]);_0x33e7a9(_0x23f084);})[_0x3ab5('0x1e')](function(_0xaa6f90){_0x46d61a(_0xaa6f90);});});}function getEndUser(_0x3beebc,_0x2b989b,_0xf472fa){return function(_0x5756f8){return new Promise(function(_0x652453,_0x15e975){logger[_0x3ab5('0xc')](util[_0x3ab5('0x24')](_0x3ab5('0x25'),_0x5756f8[_0x3ab5('0x26')]));searchContact(_0xf472fa,_0x2b989b,'mobile_number',_0x5756f8[_0x3ab5('0x26')])[_0x3ab5('0xe')](function(_0x281824){if(_0x281824){_0x5756f8['endUserId']=_0x281824['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x5756f8[_0x3ab5('0x27')]);return _0x652453(_0x5756f8);}searchContact(_0xf472fa,_0x2b989b,_0x3ab5('0x28'),_0x5756f8[_0x3ab5('0x26')])[_0x3ab5('0xe')](function(_0x1403e4){if(_0x1403e4){_0x5756f8[_0x3ab5('0x27')]=_0x1403e4['id'];logger['info'](_0x3ab5('0x29'),_0x5756f8[_0x3ab5('0x27')]);return _0x652453(_0x5756f8);}createEndUser(_0x5756f8,_0x3beebc,_0x2b989b,_0xf472fa)[_0x3ab5('0xe')](function(_0x6053cd){logger['info']('Contact\x20created:',_0x6053cd[_0x3ab5('0x27')]);return _0x652453(_0x6053cd);});});})['catch'](function(_0x2cf1d5){_0x15e975(_0x2cf1d5);});});};}function createEndUser(_0x40f7ec,_0x17e6e9,_0x4c43d9,_0x31ebf0){return new Promise(function(_0x56de22,_0x18ce99){var _0x4089b8=moment();var _0x3768ce={'method':_0x3ab5('0x2a'),'uri':_0x31ebf0+_0x3ab5('0x2b'),'body':{'contact':{'last_name':_0x40f7ec[_0x3ab5('0x26')],'work_number':_0x40f7ec[_0x3ab5('0x26')],'mobile_number':_0x40f7ec[_0x3ab5('0x26')],'owner_id':_0x40f7ec['userId'],'created_at':_0x4089b8[_0x3ab5('0x24')](_0x3ab5('0x2c'))}},'json':!![]};_0x3768ce['headers']=_0x4c43d9;logger[_0x3ab5('0xc')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3768ce)[_0x3ab5('0xe')](function(_0x1f0fc2){_0x40f7ec[_0x3ab5('0x27')]=_0x1f0fc2['contact']['id'];_0x56de22(_0x40f7ec);})[_0x3ab5('0x1e')](function(_0x2be3d1){logger['error']('['+[_0x17e6e9['toUpperCase']()]+']',_0x2be3d1[_0x3ab5('0x20')]);_0x18ce99(_0x2be3d1[_0x3ab5('0x20')]);});});}function getTicket(_0xaf487e,_0x4bf455,_0xb2a0d4,_0x16d2de,_0x18cc6b){return function(_0x3ae688){logger['info'](_0x3ab5('0x2d'));return new Promise(function(_0x543db7,_0x3ea2d5){var _0x310378=moment();var _0x5d7141={'method':_0x3ab5('0x2a'),'uri':_0xb2a0d4+_0x3ab5('0x2e'),'body':{'title':intUtil['getString'](_0x16d2de['Subjects'],_0x18cc6b,'\x20'),'description':intUtil[_0x3ab5('0x2f')](_0x16d2de[_0x3ab5('0x30')],_0x18cc6b,'\x0a'),'owner_id':_0x3ae688[_0x3ab5('0x1a')],'creater_id':_0x3ae688[_0x3ab5('0x12')],'targetable_id':_0x3ae688[_0x3ab5('0x27')],'targetable_type':_0x3ab5('0x31'),'created_at':_0x310378[_0x3ab5('0x24')](_0x3ab5('0x2c')),'due_date':_0x310378[_0x3ab5('0x32')](0x1e,'m')[_0x3ab5('0x24')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x5d7141[_0x3ab5('0xb')]=_0x4bf455;return rp(_0x5d7141)[_0x3ab5('0xe')](function(_0xabbbfe){_0x3ae688[_0x3ab5('0x33')]=_0xabbbfe[_0x3ab5('0x34')]['id'];logger[_0x3ab5('0xc')](_0x3ab5('0x35'),_0x3ae688[_0x3ab5('0x33')]);_0x543db7(_0x3ae688);})[_0x3ab5('0x1e')](function(_0x53a91d){logger['error']('['+[_0xaf487e[_0x3ab5('0x15')]()]+']',_0x53a91d[_0x3ab5('0x20')]);_0x3ea2d5(_0x53a91d[_0x3ab5('0x20')]);});});};}function emit(_0x52d625,_0x18144b,_0x153a2b){var _0x325871={'uri':_0x52d625+_0x3ab5('0x36')+_0x153a2b};io['to'](util[_0x3ab5('0x24')](_0x3ab5('0x37'),_0x18144b))[_0x3ab5('0x38')](_0x3ab5('0x39'),_0x325871);}exports['cs']=function(_0x145bd0,_0x4e7789,_0x534d3d,_0x3f8636,_0x3aa644,_0x16c8a0,_0x1aa73b,_0x98723){var _0x39b83d={};var _0x9a31de={'Authorization':_0x3ab5('0x3a')+_0x16c8a0['apiKey']};_0x16c8a0[_0x3ab5('0x3b')]=intUtil[_0x3ab5('0x3c')](_0x16c8a0[_0x3ab5('0x3b')]);_0x16c8a0[_0x3ab5('0x3d')]=intUtil[_0x3ab5('0x3c')](_0x16c8a0['serverUrl']);var _0x44fb4e=_0x16c8a0[_0x3ab5('0x3b')];_0x39b83d[_0x3ab5('0x1d')]=_0x16c8a0[_0x3ab5('0x3e')];_0x39b83d[_0x3ab5('0x26')]=_0x98723[_0x3ab5('0x3f')]()===_0x3ab5('0x40')?_0x4e7789[_0x3ab5('0x41')]:_0x4e7789[_0x3ab5('0x42')];_0x39b83d[_0x3ab5('0x43')]=_0x98723==='queue'||_0x98723===_0x3ab5('0x44')?_0x3ab5('0x45'):_0x3ab5('0x40');if(_0x3f8636){_0x39b83d[_0x3ab5('0x18')]=_0x3f8636[_0x3ab5('0x11')];}var _0xac0319=util[_0x3ab5('0x24')](_0x3ab5('0x46'),_0x16c8a0[_0x3ab5('0x3d')],_0x4e7789[_0x3ab5('0x47')],md5(_0x4e7789[_0x3ab5('0x47')]));if(_0x3aa644&&_0x3aa644[_0x3ab5('0x48')]){logger[_0x3ab5('0xc')](_0x3ab5('0x49'),'Recording\x20is\x20enabled!');_0x4e7789[_0x3ab5('0x4a')]=_0xac0319;}else if(_0x1aa73b&&_0x1aa73b[_0x3ab5('0x4b')]&&_0x1aa73b[_0x3ab5('0x4b')]!==_0x3ab5('0x4c')){logger[_0x3ab5('0xc')](_0x3ab5('0x4d'),_0x3ab5('0x4e'));_0x4e7789['recordingURL']=_0xac0319;}else{_0x4e7789[_0x3ab5('0x4a')]='';}return getAdminId(_0x39b83d,_0x98723,_0x9a31de,_0x44fb4e)[_0x3ab5('0xe')](getUser(_0x98723,_0x9a31de,_0x44fb4e))['then'](getEndUser(_0x98723,_0x9a31de,_0x44fb4e))[_0x3ab5('0xe')](getTicket(_0x98723,_0x9a31de,_0x44fb4e,_0x534d3d,_0x4e7789))['then'](function(_0x2925f9){logger[_0x3ab5('0xc')](util[_0x3ab5('0x24')](_0x3ab5('0x4f'),_0x2925f9['ticketId']));if(_0x98723!==_0x3ab5('0x44')){logger[_0x3ab5('0xc')]('['+[_0x98723[_0x3ab5('0x15')]()]+']',_0x3ab5('0x50'));emit(_0x44fb4e,_0x3f8636['name'],_0x2925f9[_0x3ab5('0x27')]);}})['catch'](function(_0x499119){logger[_0x3ab5('0x1f')]('['+[_0x98723[_0x3ab5('0x15')]()]+_0x3ab5('0x51'),util['inspect'](_0x499119,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xddeb=['userEmail','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','/api/selector/owners','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','email','userId','Admin\x20selected'];(function(_0x1ae3b2,_0x211ced){var _0x493197=function(_0x5bc981){while(--_0x5bc981){_0x1ae3b2['push'](_0x1ae3b2['shift']());}};_0x493197(++_0x211ced);}(_0xddeb,0x18d));var _0xbdde=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xddeb[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0xbdde('0x0'));var rp=require(_0xbdde('0x1'));var md5=require(_0xbdde('0x2'));var util=require(_0xbdde('0x3'));var moment=require('moment');var Promise=require(_0xbdde('0x4'));var Redis=require(_0xbdde('0x5'));var intUtil=require('./util');var config=require(_0xbdde('0x6'));var logger=require(_0xbdde('0x7'))(_0xbdde('0x8'));config[_0xbdde('0x9')]=_[_0xbdde('0xa')](config[_0xbdde('0x9')],{'host':_0xbdde('0xb'),'port':0x18eb});var io=require(_0xbdde('0xc'))(new Redis(config[_0xbdde('0x9')]));function getAdminId(_0x393908,_0x1b4d6a,_0x2e01dc,_0x4b8b33){return new Promise(function(_0x567811,_0x4d3cfe){var _0x19b471=![];var _0x114695={'method':_0xbdde('0xd'),'uri':_0x4b8b33+'/api/selector/owners','json':!![]};_0x114695[_0xbdde('0xe')]=_0x2e01dc;logger[_0xbdde('0xf')](_0xbdde('0x10'));return rp(_0x114695)[_0xbdde('0x11')](function(_0x56cb5e){if(_0x56cb5e){var _0x4e5d7c=_0x56cb5e['users'];var _0x1cefd4=null;for(_0x1cefd4=0x0;_0x1cefd4<_0x4e5d7c['length'];_0x1cefd4++){if(_0x4e5d7c[_0x1cefd4]['email']===_0x393908[_0xbdde('0x12')]){_0x393908[_0xbdde('0x13')]=_0x4e5d7c[_0x1cefd4]['id'];_0x19b471=!![];}}if(_0x19b471){logger[_0xbdde('0xf')](_0xbdde('0x14'),_0x393908[_0xbdde('0x13')]);_0x567811(_0x393908);}else{_0x4d3cfe({'statusCode':0x194,'message':_0xbdde('0x15')});}}else{_0x4d3cfe({'statusCode':0x194,'message':_0xbdde('0x15')});}})[_0xbdde('0x16')](function(_0x455928){logger[_0xbdde('0x17')]('['+[_0x1b4d6a[_0xbdde('0x18')]()]+']',_0x455928['message']);_0x4d3cfe(_0x455928);});});}function getUser(_0x2b9010,_0x487b88,_0x3ae33b){return function(_0x589b7b){return new Promise(function(_0x513af0,_0x20b480){var _0xb169f1={'method':_0xbdde('0xd'),'uri':_0x3ae33b+_0xbdde('0x19'),'json':!![]};_0xb169f1[_0xbdde('0xe')]=_0x487b88;logger[_0xbdde('0xf')](_0xbdde('0x1a'));return rp(_0xb169f1)['then'](function(_0x47afab){if(_0x47afab){var _0x10d043=_0x47afab[_0xbdde('0x1b')];var _0x718601=![];var _0x379f65=null;if(_0x589b7b['agentEmail']!==null){logger[_0xbdde('0xf')](_0xbdde('0x1c'),_0x589b7b[_0xbdde('0x1d')]);_0x589b7b['userEmail']=_0x589b7b['agentEmail'];for(_0x379f65=0x0;_0x379f65<_0x10d043['length'];_0x379f65++){if(_0x10d043[_0x379f65][_0xbdde('0x1e')]===_0x589b7b['agentEmail']){_0x718601=!![];_0x589b7b[_0xbdde('0x1f')]=_0x10d043[_0x379f65]['id'];logger[_0xbdde('0xf')]('User\x20found:',_0x589b7b[_0xbdde('0x1f')]);}}}if(!_0x718601){logger[_0xbdde('0xf')](_0xbdde('0x20'));_0x589b7b[_0xbdde('0x21')]=_0x589b7b[_0xbdde('0x12')];_0x589b7b[_0xbdde('0x1f')]=_0x589b7b[_0xbdde('0x13')];_0x718601=!![];}if(_0x718601){_0x513af0(_0x589b7b);}else{_0x20b480({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x20b480({'statusCode':0x194,'message':_0xbdde('0x15')});}})[_0xbdde('0x16')](function(_0x6dabcd){logger[_0xbdde('0x17')]('['+[_0x2b9010[_0xbdde('0x18')]()]+']',_0x6dabcd['message']);_0x20b480(_0x6dabcd);});});};}function searchContact(_0x45da0d,_0x4e5d11,_0x5892d1,_0xcb6eb3){return new Promise(function(_0x474b54,_0x438dae){var _0x498eb7={'method':_0xbdde('0xd'),'headers':_0x4e5d11,'uri':_0x45da0d+'/api/lookup?q='+_0xcb6eb3+'&f='+_0x5892d1+_0xbdde('0x22'),'json':!![]};rp(_0x498eb7)[_0xbdde('0x11')](function(_0x42c8b9){var _0x4b8be2=_[_0xbdde('0x23')](_0x42c8b9[_0xbdde('0x24')][_0xbdde('0x24')],[_0x5892d1,_0xcb6eb3]);_0x474b54(_0x4b8be2);})['catch'](function(_0x25a9d1){_0x438dae(_0x25a9d1);});});}function getEndUser(_0xbb1502,_0x59563d,_0x31ad04){return function(_0x15be0a){return new Promise(function(_0x474c30,_0x21b318){logger[_0xbdde('0xf')](util[_0xbdde('0x25')](_0xbdde('0x26'),_0x15be0a[_0xbdde('0x27')]));searchContact(_0x31ad04,_0x59563d,_0xbdde('0x28'),_0x15be0a['contactNumber'])[_0xbdde('0x11')](function(_0x5d3431){if(_0x5d3431){_0x15be0a[_0xbdde('0x29')]=_0x5d3431['id'];logger['info'](_0xbdde('0x2a'),_0x15be0a[_0xbdde('0x29')]);return _0x474c30(_0x15be0a);}searchContact(_0x31ad04,_0x59563d,_0xbdde('0x2b'),_0x15be0a[_0xbdde('0x27')])[_0xbdde('0x11')](function(_0x5c96ce){if(_0x5c96ce){_0x15be0a[_0xbdde('0x29')]=_0x5c96ce['id'];logger['info'](_0xbdde('0x2c'),_0x15be0a[_0xbdde('0x29')]);return _0x474c30(_0x15be0a);}createEndUser(_0x15be0a,_0xbb1502,_0x59563d,_0x31ad04)[_0xbdde('0x11')](function(_0x18171b){logger[_0xbdde('0xf')](_0xbdde('0x2d'),_0x18171b[_0xbdde('0x29')]);return _0x474c30(_0x18171b);});});})['catch'](function(_0x49d4c2){_0x21b318(_0x49d4c2);});});};}function createEndUser(_0x36649a,_0x2ebfd2,_0x47104e,_0x4fffc1){return new Promise(function(_0x4f7757,_0x26c8e3){var _0x4587fe=moment();var _0x2d81b7={'method':_0xbdde('0x2e'),'uri':_0x4fffc1+_0xbdde('0x2f'),'body':{'contact':{'last_name':_0x36649a[_0xbdde('0x27')],'work_number':_0x36649a[_0xbdde('0x27')],'mobile_number':_0x36649a[_0xbdde('0x27')],'owner_id':_0x36649a[_0xbdde('0x1f')],'created_at':_0x4587fe[_0xbdde('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x2d81b7[_0xbdde('0xe')]=_0x47104e;logger[_0xbdde('0xf')](_0xbdde('0x30'));return rp(_0x2d81b7)[_0xbdde('0x11')](function(_0x3bc4ee){_0x36649a[_0xbdde('0x29')]=_0x3bc4ee[_0xbdde('0x31')]['id'];_0x4f7757(_0x36649a);})[_0xbdde('0x16')](function(_0x47f6c2){logger[_0xbdde('0x17')]('['+[_0x2ebfd2[_0xbdde('0x18')]()]+']',_0x47f6c2[_0xbdde('0x32')]);_0x26c8e3(_0x47f6c2['message']);});});}function getTicket(_0x30e1b0,_0x1dd3eb,_0x442fda,_0x20b3a4,_0x1f5ed9){return function(_0x5b5748){logger[_0xbdde('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x598c3e,_0x18e3d0){var _0x546d08=moment();var _0x35563a={'method':_0xbdde('0x2e'),'uri':_0x442fda+'/api/tasks','body':{'title':intUtil[_0xbdde('0x33')](_0x20b3a4['Subjects'],_0x1f5ed9,'\x20'),'description':intUtil[_0xbdde('0x33')](_0x20b3a4[_0xbdde('0x34')],_0x1f5ed9,'\x0a'),'owner_id':_0x5b5748[_0xbdde('0x1f')],'creater_id':_0x5b5748['adminId'],'targetable_id':_0x5b5748['endUserId'],'targetable_type':_0xbdde('0x35'),'created_at':_0x546d08[_0xbdde('0x25')](_0xbdde('0x36')),'due_date':_0x546d08[_0xbdde('0x37')](0x1e,'m')[_0xbdde('0x25')](_0xbdde('0x36'))},'json':!![]};_0x35563a[_0xbdde('0xe')]=_0x1dd3eb;return rp(_0x35563a)[_0xbdde('0x11')](function(_0x594fef){_0x5b5748['ticketId']=_0x594fef[_0xbdde('0x38')]['id'];logger[_0xbdde('0xf')](_0xbdde('0x39'),_0x5b5748[_0xbdde('0x3a')]);_0x598c3e(_0x5b5748);})[_0xbdde('0x16')](function(_0x29ba0e){logger[_0xbdde('0x17')]('['+[_0x30e1b0[_0xbdde('0x18')]()]+']',_0x29ba0e[_0xbdde('0x32')]);_0x18e3d0(_0x29ba0e['message']);});});};}function emit(_0x11403b,_0x335ed3,_0x1f7ff9){var _0x17bc47={'uri':_0x11403b+'/contacts/'+_0x1f7ff9};io['to'](util[_0xbdde('0x25')](_0xbdde('0x3b'),_0x335ed3))[_0xbdde('0x3c')](_0xbdde('0x3d'),_0x17bc47);}exports['cs']=function(_0x4609a3,_0x3c9494,_0x327c43,_0x2828ec,_0x23ac04,_0x2eb7fe,_0x5dffbe,_0x53e3bb){var _0x2ddeaa={};var _0x14f9db={'Authorization':_0xbdde('0x3e')+_0x2eb7fe[_0xbdde('0x3f')]};_0x2eb7fe[_0xbdde('0x40')]=intUtil[_0xbdde('0x41')](_0x2eb7fe[_0xbdde('0x40')]);_0x2eb7fe[_0xbdde('0x42')]=intUtil[_0xbdde('0x41')](_0x2eb7fe[_0xbdde('0x42')]);var _0x59a54e=_0x2eb7fe[_0xbdde('0x40')];_0x2ddeaa[_0xbdde('0x12')]=_0x2eb7fe[_0xbdde('0x43')];_0x2ddeaa['contactNumber']=_0x53e3bb[_0xbdde('0x44')]()===_0xbdde('0x45')?_0x3c9494['destcalleridnum']:_0x3c9494[_0xbdde('0x46')];_0x2ddeaa[_0xbdde('0x47')]=_0x53e3bb===_0xbdde('0x48')||_0x53e3bb===_0xbdde('0x49')?_0xbdde('0x48'):_0xbdde('0x45');if(_0x2828ec){_0x2ddeaa[_0xbdde('0x1d')]=_0x2828ec[_0xbdde('0x1e')];}var _0x74cb71=util[_0xbdde('0x25')](_0xbdde('0x4a'),_0x2eb7fe[_0xbdde('0x42')],_0x3c9494['uniqueid'],md5(_0x3c9494[_0xbdde('0x4b')]));if(_0x23ac04&&_0x23ac04[_0xbdde('0x4c')]){logger[_0xbdde('0xf')]('[QUEUE]',_0xbdde('0x4d'));_0x3c9494[_0xbdde('0x4e')]=_0x74cb71;}else if(_0x5dffbe&&_0x5dffbe['recordingFormat']&&_0x5dffbe[_0xbdde('0x4f')]!==_0xbdde('0x50')){logger[_0xbdde('0xf')](_0xbdde('0x51'),_0xbdde('0x4d'));_0x3c9494[_0xbdde('0x4e')]=_0x74cb71;}else{_0x3c9494[_0xbdde('0x4e')]='';}return getAdminId(_0x2ddeaa,_0x53e3bb,_0x14f9db,_0x59a54e)[_0xbdde('0x11')](getUser(_0x53e3bb,_0x14f9db,_0x59a54e))[_0xbdde('0x11')](getEndUser(_0x53e3bb,_0x14f9db,_0x59a54e))[_0xbdde('0x11')](getTicket(_0x53e3bb,_0x14f9db,_0x59a54e,_0x327c43,_0x3c9494))[_0xbdde('0x11')](function(_0x2d3826){logger[_0xbdde('0xf')](util[_0xbdde('0x25')](_0xbdde('0x52'),_0x2d3826[_0xbdde('0x3a')]));if(_0x53e3bb!==_0xbdde('0x49')){logger[_0xbdde('0xf')]('['+[_0x53e3bb[_0xbdde('0x18')]()]+']',_0xbdde('0x53'));emit(_0x59a54e,_0x2828ec['name'],_0x2d3826['endUserId']);}})[_0xbdde('0x16')](function(_0x57a1a7){logger['error']('['+[_0x53e3bb[_0xbdde('0x18')]()]+_0xbdde('0x54'),util[_0xbdde('0x55')](_0x57a1a7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 90bacff..57b21e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b89=['[EXEC]','util','./zendesk','./freshdesk','./zoho','./desk','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','data1','toLowerCase','data2','find','data3','queue','outbound','log','unmanaged','freshsales','unknown\x20integration','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','error'];(function(_0x2920c1,_0x1f1276){var _0x5b5a17=function(_0x23de09){while(--_0x23de09){_0x2920c1['push'](_0x2920c1['shift']());}};_0x5b5a17(++_0x1f1276);}(_0x3b89,0xe1));var _0x93b8=function(_0x2d5334,_0x5c2925){_0x2d5334=_0x2d5334-0x0;var _0x5c8d1d=_0x3b89[_0x2d5334];return _0x5c8d1d;};'use strict';var _=require('lodash');var util=require(_0x93b8('0x0'));var zendesk=require(_0x93b8('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x93b8('0x2'));var zoho=require(_0x93b8('0x3'));var desk=require(_0x93b8('0x4'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x93b8('0x5'));var freshsales=require(_0x93b8('0x6'));var integrations=[_0x93b8('0x7'),_0x93b8('0x8'),_0x93b8('0x9'),_0x93b8('0xa'),_0x93b8('0xb'),_0x93b8('0xc'),_0x93b8('0xd'),_0x93b8('0xe'),'freshsales',_0x93b8('0xf')];exports['exec']=function(_0x31f476,_0x1f5653,_0x1c23b7,_0x34a207,_0x5868af,_0x373b42){if(_0x1c23b7){if(_['includes'](integrations,_0x31f476[_0x93b8('0x10')][_0x93b8('0x11')]())){try{var _0x2ba713=null;var _0x118f45='';var _0x5975a0=_0x1c23b7[_0x31f476[_0x93b8('0x10')]['toLowerCase']()];if(_0x5975a0){var _0xcf87d8=_0x5975a0[_0x31f476[_0x93b8('0x12')]];if(_0xcf87d8){var _0x5a3213=_[_0x93b8('0x13')](_0xcf87d8['Configurations'],{'id':parseInt(_0x31f476[_0x93b8('0x14')],0xa)});if(_0x5a3213){if(_0x34a207){if(_0x5868af&&_0x1f5653[_0x93b8('0x15')]){_0x118f45=_0x93b8('0x15');}else if(_0x1f5653['routeId']){_0x118f45=_0x93b8('0x16');}else{console[_0x93b8('0x17')]('EVENT\x20UNKNOWN',_0x1f5653);}}else{_0x118f45=_0x93b8('0x18');}switch(_0x31f476[_0x93b8('0x10')][_0x93b8('0x11')]()){case _0x93b8('0x7'):zendesk[_0x118f45](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42);break;case _0x93b8('0x8'):salesforce[_0x118f45](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42);break;case _0x93b8('0x9'):sugarcrm[_0x118f45](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42);break;case _0x93b8('0xa'):freshdesk[_0x118f45](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42);break;case _0x93b8('0xb'):zoho[_0x118f45](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42);break;case _0x93b8('0xc'):desk[_0x118f45](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42);break;case _0x93b8('0xd'):vtiger[_0x118f45](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42);break;case _0x93b8('0x19'):freshsales['cs'](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42,_0x118f45);break;case _0x93b8('0xf'):servicenow['cs'](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42,_0x118f45);break;case _0x93b8('0xe'):dynamics365['cs'](_0x31f476,_0x1f5653,_0x5a3213,_0x34a207,_0x5868af,_0xcf87d8,_0x373b42,_0x118f45);break;default:console[_0x93b8('0x17')](_0x93b8('0x1a'));}}else{_0x2ba713=require(_0x93b8('0x1b'))(_0x31f476['data1'][_0x93b8('0x11')]());_0x2ba713['error']('[EXEC]',util[_0x93b8('0x1c')](_0x93b8('0x1d'),_0x31f476['data1'][_0x93b8('0x11')](),_0x31f476[_0x93b8('0x14')]));}}else{_0x2ba713=require('../../../../config/logger')(_0x31f476['data1'][_0x93b8('0x11')]());_0x2ba713[_0x93b8('0x1e')](_0x93b8('0x1f'),util[_0x93b8('0x1c')]('%s\x20account\x20#%s\x20not\x20found',_0x31f476[_0x93b8('0x10')][_0x93b8('0x11')](),_0x31f476[_0x93b8('0x12')]));}}else{}}catch(_0x2c2bb2){console[_0x93b8('0x1e')](_0x2c2bb2);}}}};
\ No newline at end of file
+var _0xa8a4=['./freshsales','zendesk','salesforce','zoho','desk','vtiger','freshsales','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','freshdesk','servicenow','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./dynamics365'];(function(_0x40eb8e,_0x2f83aa){var _0x41baeb=function(_0x324172){while(--_0x324172){_0x40eb8e['push'](_0x40eb8e['shift']());}};_0x41baeb(++_0x2f83aa);}(_0xa8a4,0x190));var _0x4a8a=function(_0x26d9af,_0x2757ec){_0x26d9af=_0x26d9af-0x0;var _0x2a3df0=_0xa8a4[_0x26d9af];return _0x2a3df0;};'use strict';var _=require(_0x4a8a('0x0'));var util=require(_0x4a8a('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x4a8a('0x2'));var sugarcrm=require(_0x4a8a('0x3'));var freshdesk=require(_0x4a8a('0x4'));var zoho=require(_0x4a8a('0x5'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x4a8a('0x6'));var freshsales=require(_0x4a8a('0x7'));var integrations=[_0x4a8a('0x8'),_0x4a8a('0x9'),'sugarcrm','freshdesk',_0x4a8a('0xa'),_0x4a8a('0xb'),_0x4a8a('0xc'),'dynamics365',_0x4a8a('0xd'),'servicenow'];exports[_0x4a8a('0xe')]=function(_0x4024fa,_0x47c339,_0x2cb980,_0x333514,_0x20fff4,_0x57fd1d){if(_0x2cb980){if(_[_0x4a8a('0xf')](integrations,_0x4024fa[_0x4a8a('0x10')][_0x4a8a('0x11')]())){try{var _0x423543=null;var _0x2e9a6b='';var _0x59b4ee=_0x2cb980[_0x4024fa[_0x4a8a('0x10')]['toLowerCase']()];if(_0x59b4ee){var _0x36b82f=_0x59b4ee[_0x4024fa[_0x4a8a('0x12')]];if(_0x36b82f){var _0x24f04b=_[_0x4a8a('0x13')](_0x36b82f[_0x4a8a('0x14')],{'id':parseInt(_0x4024fa[_0x4a8a('0x15')],0xa)});if(_0x24f04b){if(_0x333514){if(_0x20fff4&&_0x47c339['queue']){_0x2e9a6b=_0x4a8a('0x16');}else if(_0x47c339[_0x4a8a('0x17')]){_0x2e9a6b='outbound';}else{console[_0x4a8a('0x18')](_0x4a8a('0x19'),_0x47c339);}}else{_0x2e9a6b=_0x4a8a('0x1a');}switch(_0x4024fa[_0x4a8a('0x10')][_0x4a8a('0x11')]()){case _0x4a8a('0x8'):zendesk[_0x2e9a6b](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d);break;case _0x4a8a('0x9'):salesforce[_0x2e9a6b](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d);break;case _0x4a8a('0x1b'):sugarcrm[_0x2e9a6b](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d);break;case _0x4a8a('0x1c'):freshdesk[_0x2e9a6b](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d);break;case _0x4a8a('0xa'):zoho[_0x2e9a6b](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d);break;case _0x4a8a('0xb'):desk[_0x2e9a6b](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d);break;case _0x4a8a('0xc'):vtiger[_0x2e9a6b](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d);break;case'freshsales':freshsales['cs'](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d,_0x2e9a6b);break;case _0x4a8a('0x1d'):servicenow['cs'](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d,_0x2e9a6b);break;case _0x4a8a('0x1e'):dynamics365['cs'](_0x4024fa,_0x47c339,_0x24f04b,_0x333514,_0x20fff4,_0x36b82f,_0x57fd1d,_0x2e9a6b);break;default:console[_0x4a8a('0x18')](_0x4a8a('0x1f'));}}else{_0x423543=require(_0x4a8a('0x20'))(_0x4024fa[_0x4a8a('0x10')][_0x4a8a('0x11')]());_0x423543[_0x4a8a('0x21')](_0x4a8a('0x22'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x4024fa[_0x4a8a('0x10')][_0x4a8a('0x11')](),_0x4024fa[_0x4a8a('0x15')]));}}else{_0x423543=require(_0x4a8a('0x20'))(_0x4024fa[_0x4a8a('0x10')][_0x4a8a('0x11')]());_0x423543['error']('[EXEC]',util[_0x4a8a('0x23')](_0x4a8a('0x24'),_0x4024fa['data1']['toLowerCase'](),_0x4024fa[_0x4a8a('0x12')]));}}else{}}catch(_0x2c12c9){console[_0x4a8a('0x21')](_0x2c12c9);}}}};
\ No newline at end of file
index 277d2e9..fbda074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0fc=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','Case','ContactId','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','sobject','User','find','execute','then','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','length','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','attributes','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','No\x20Company','create','forEach','includes','picklist','idField','toString','variableName','type','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','Recording\x20is\x20enabled!'];(function(_0x118595,_0x5ed2a1){var _0x549b06=function(_0x3da6ba){while(--_0x3da6ba){_0x118595['push'](_0x118595['shift']());}};_0x549b06(++_0x5ed2a1);}(_0xa0fc,0x9e));var _0xca0f=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa0fc[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xca0f('0x0'));var rp=require(_0xca0f('0x1'));var moment=require('moment');var BPromise=require(_0xca0f('0x2'));var md5=require('md5');var jsforce=require(_0xca0f('0x3'));var util=require(_0xca0f('0x4'));var Redis=require(_0xca0f('0x5'));var intUtil=require(_0xca0f('0x6'));var config=require(_0xca0f('0x7'));var logger=require('../../../../config/logger')('salesforce');config[_0xca0f('0x8')]=_[_0xca0f('0x9')](config['redis'],{'host':_0xca0f('0xa'),'port':0x18eb});var io=require(_0xca0f('0xb'))(new Redis(config[_0xca0f('0x8')]));function emit(_0x351662,_0x364a7c,_0x12c544){io['to'](_0x351662)[_0xca0f('0xc')](_0x364a7c,_0x12c544);}function getTicket(_0x378e1e,_0x49a5fd,_0x161791,_0x3123be,_0x4fb815,_0x255722,_0x38be0f,_0x5ba5a4){var _0x469af5=Object[_0xca0f('0xd')]({},{'OwnerId':_0x49a5fd['id'],'Subject':intUtil[_0xca0f('0xe')](_0x3123be[_0xca0f('0xf')],_0x4fb815,'\x20'),'Description':intUtil['getString'](_0x3123be['Descriptions'],_0x4fb815,'\x0a')},getCustomFields(_0x255722,_0x4fb815));if(_0x161791){if(_0x3123be[_0xca0f('0x10')]===_0xca0f('0x11')){_0x469af5['ActivityDate']=moment[_0xca0f('0x12')]();_0x469af5[_0xca0f('0x13')]=![];_0x469af5[_0xca0f('0x14')]=![];if(_0x161791[_0xca0f('0x15')]===_0xca0f('0x16')||_0x161791[_0xca0f('0x15')]==='lead'){_0x469af5[_0xca0f('0x17')]=_0x161791['id'];}else if(_0x161791[_0xca0f('0x15')]===_0xca0f('0x18')){_0x469af5['WhatId']=_0x161791['id'];}}else if(_0x3123be['ticketType']===_0xca0f('0x19')){if(_0x161791['endUserType']===_0xca0f('0x16')){_0x469af5[_0xca0f('0x1a')]=_0x161791['id'];}else if(_0x161791[_0xca0f('0x15')]===_0xca0f('0x18')){_0x469af5[_0xca0f('0x1b')]=_0x161791['id'];}else if(_0x161791['endUserType']===_0xca0f('0x1c')&&_0x3123be[_0xca0f('0x1d')]){_0x469af5[_0x3123be[_0xca0f('0x1d')]]=_0x161791['id'];}else{logger['info'](_0xca0f('0x1e'));}}}return _0x38be0f['sobject'](_0x3123be[_0xca0f('0x10')])['create'](_0x469af5);}function getUser(_0x549d3f,_0x285033,_0x181726){if(!_[_0xca0f('0x1f')](_0x285033)&&intUtil['validateEmail'](_0x285033)){var _0x532b6e={'Email':_0x285033};var _0x379797={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x181726[_0xca0f('0x20')](_0xca0f('0x21'))[_0xca0f('0x22')](_0x532b6e,_0x379797)[_0xca0f('0x23')]()[_0xca0f('0x24')](function(_0x5cdc0f){if(_0x5cdc0f['length']){var _0x5b2ff7=_['find'](_0x5cdc0f,function(_0x3709b3){return _0x3709b3['Email']===_0x285033;});if(_0x5b2ff7){logger[_0xca0f('0x25')](_0xca0f('0x26'),_0x285033);return BPromise[_0xca0f('0x27')]({'id':_0x5b2ff7['Id'],'name':_0x5b2ff7[_0xca0f('0x28')]});}}else{logger[_0xca0f('0x25')](_0xca0f('0x29'),_0x285033);return _0x181726[_0xca0f('0x2a')]()[_0xca0f('0x24')](function(_0x5d8f35){return BPromise[_0xca0f('0x27')]({'id':_0x5d8f35[_0xca0f('0x2b')],'name':_0x5d8f35[_0xca0f('0x2c')]});});}});}else{logger[_0xca0f('0x25')](_0xca0f('0x29'),_0x285033);return _0x181726[_0xca0f('0x2a')]()['then'](function(_0x40f7e5){return BPromise[_0xca0f('0x27')]({'id':_0x40f7e5[_0xca0f('0x2b')],'name':_0x40f7e5[_0xca0f('0x2c')]});});}}function getEndUser(_0x237f68,_0x377537,_0x2e6668,_0x5be8ea,_0x305ad6){var _0x13eb17={'$or':{'Phone':_0x5be8ea}};var _0x14023e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xca0f('0x27')]()[_0xca0f('0x24')](function(){logger[_0xca0f('0x25')](_0xca0f('0x2d'),_0x5be8ea,_0x377537[_0xca0f('0x2e')]);switch(_0x377537[_0xca0f('0x2e')]){case _0xca0f('0x2f'):var _0x2555a6=_[_0xca0f('0x30')](_0x13eb17);if(_0x377537[_0xca0f('0x31')]){var _0x1bab41={};_0x1bab41[_0x377537[_0xca0f('0x31')]]=_0x5be8ea;_[_0xca0f('0x32')](_0x2555a6['$or'],_0x1bab41);}return _0x305ad6[_0xca0f('0x20')]('Contact')[_0xca0f('0x22')](_0x2555a6,_0x14023e)[_0xca0f('0x23')]()[_0xca0f('0x24')](function(_0x1f67d4){if(_0x1f67d4&&_0x1f67d4[_0xca0f('0x33')]){return _0x1f67d4;}else{var _0x4bbbb5=_[_0xca0f('0x30')](_0x13eb17);if(_0x377537[_0xca0f('0x34')]){var _0x3a34a8={};_0x3a34a8[_0x377537['additionalSearchLead']]=_0x5be8ea;_[_0xca0f('0x32')](_0x4bbbb5[_0xca0f('0x35')],_0x3a34a8);}return _0x305ad6[_0xca0f('0x20')](_0xca0f('0x36'))[_0xca0f('0x22')](_0x4bbbb5,_0x14023e);}});case _0xca0f('0x37'):var _0x17ffff=_[_0xca0f('0x30')](_0x13eb17);if(_0x377537[_0xca0f('0x38')]){var _0x1bab41={};_0x1bab41[_0x377537[_0xca0f('0x38')]]=_0x5be8ea;_[_0xca0f('0x32')](_0x17ffff[_0xca0f('0x35')],_0x1bab41);}return _0x305ad6['sobject'](_0xca0f('0x39'))[_0xca0f('0x22')](_0x17ffff,_0x14023e)['execute']()[_0xca0f('0x24')](function(_0x368d1b){if(_0x368d1b&&_0x368d1b[_0xca0f('0x33')]){return _0x368d1b;}else{var _0x23706b=_[_0xca0f('0x30')](_0x13eb17);if(_0x377537[_0xca0f('0x31')]){var _0xdff2f={};_0xdff2f[_0x377537[_0xca0f('0x31')]]=_0x5be8ea;_['merge'](_0x23706b[_0xca0f('0x35')],_0xdff2f);}return _0x305ad6['sobject'](_0xca0f('0x3a'))[_0xca0f('0x22')](_0x23706b,_0x14023e)[_0xca0f('0x24')](function(_0xfd3f2){if(_0xfd3f2&&_0xfd3f2['length']){return _0xfd3f2;}else{var _0x2191e5=_[_0xca0f('0x30')](_0x13eb17);if(_0x377537['additionalSearchLead']){var _0x1ca8e3={};_0x1ca8e3[_0x377537[_0xca0f('0x34')]]=_0x5be8ea;_['merge'](_0x2191e5[_0xca0f('0x35')],_0x1ca8e3);}return _0x305ad6[_0xca0f('0x20')]('Lead')['find'](_0x2191e5,_0x14023e);}});}});case _0xca0f('0x16'):var _0x2555a6=_[_0xca0f('0x30')](_0x13eb17);if(_0x377537['additionalSearchContact']){var _0x1bab41={};_0x1bab41[_0x377537[_0xca0f('0x31')]]=_0x5be8ea;_[_0xca0f('0x32')](_0x2555a6[_0xca0f('0x35')],_0x1bab41);}return _0x305ad6[_0xca0f('0x20')]('Contact')['find'](_0x2555a6,_0x14023e)[_0xca0f('0x23')]();case _0xca0f('0x1c'):var _0xe8511a=_[_0xca0f('0x30')](_0x13eb17);if(_0x377537[_0xca0f('0x34')]){var _0x1bab41={};_0x1bab41[_0x377537[_0xca0f('0x34')]]=_0x5be8ea;_[_0xca0f('0x32')](_0xe8511a[_0xca0f('0x35')],_0x1bab41);}return _0x305ad6['sobject'](_0xca0f('0x36'))['find'](_0xe8511a,_0x14023e);case _0xca0f('0x18'):var _0x17ffff=_[_0xca0f('0x30')](_0x13eb17);if(_0x377537[_0xca0f('0x38')]){var _0x1bab41={};_0x1bab41[_0x377537[_0xca0f('0x38')]]=_0x5be8ea;_['merge'](_0x17ffff[_0xca0f('0x35')],_0x1bab41);}return _0x305ad6[_0xca0f('0x20')](_0xca0f('0x39'))['find'](_0x17ffff,_0x14023e);default:return null;}})[_0xca0f('0x24')](function(_0x4f20fc){if(_0x4f20fc&&_0x4f20fc[_0xca0f('0x33')]){var _0x134a90=_[_0xca0f('0x3b')](_0x4f20fc);if(_0x134a90){return BPromise[_0xca0f('0x27')]({'id':_0x134a90['Id'],'name':_0x134a90['Name'],'phone':_0x134a90[_0xca0f('0x3c')],'endUserType':_0x134a90[_0xca0f('0x3d')]['type']['toLowerCase']()});}}})[_0xca0f('0x24')](function(_0x3e284f){if(_0x3e284f){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x3e284f[_0xca0f('0x15')],_0x5be8ea);return BPromise['resolve'](_0x3e284f);}else{logger[_0xca0f('0x25')](_0xca0f('0x3e'),_0x5be8ea);var _0x554da4={'Phone':_0x5be8ea};if(_0x377537[_0xca0f('0x3f')]){if(_0x377537[_0xca0f('0x3f')]===_0xca0f('0x16')){logger[_0xca0f('0x25')](_0xca0f('0x40'),_0x5be8ea,_0x377537[_0xca0f('0x3f')]);_0x554da4[_0xca0f('0x41')]=_0x2e6668!==_0xca0f('0x42')?_0x2e6668:util[_0xca0f('0x43')]('Caller\x20-\x20%s',_0x5be8ea);}else if(_0x377537[_0xca0f('0x3f')]===_0xca0f('0x1c')){logger[_0xca0f('0x25')](_0xca0f('0x40'),_0x5be8ea,_0x377537[_0xca0f('0x3f')]);_0x554da4[_0xca0f('0x41')]=_0x2e6668!=='<unknown>'?_0x2e6668:util[_0xca0f('0x43')](_0xca0f('0x44'),_0x5be8ea);_0x554da4['Company']=_0xca0f('0x45');}else if(_0x377537[_0xca0f('0x3f')]===_0xca0f('0x18')){logger[_0xca0f('0x25')](_0xca0f('0x40'),_0x5be8ea,_0x377537[_0xca0f('0x3f')]);_0x554da4[_0xca0f('0x28')]=_0x2e6668!==_0xca0f('0x42')?_0x2e6668:util[_0xca0f('0x43')](_0xca0f('0x44'),_0x5be8ea);}else{return null;}}return _0x305ad6[_0xca0f('0x20')](_['upperFirst'](_0x377537[_0xca0f('0x3f')]))[_0xca0f('0x46')](_0x554da4)[_0xca0f('0x24')](function(_0x19b139){return BPromise['resolve']({'id':_0x19b139['id'],'endUserType':_0x377537['moduleCreate']});});}});}function getCustomFields(_0x457499,_0x2be5ac){var _0xd6c001={};if(_0x457499[_0xca0f('0x33')]>0x0){_[_0xca0f('0x47')](_0x457499,function(_0x2da0e9){if(_[_0xca0f('0x48')](['string',_0xca0f('0x49')],_0x2da0e9['type'])&&_0x2da0e9[_0xca0f('0x4a')]){_0xd6c001[_0x2da0e9[_0xca0f('0x4a')]]=_0x2da0e9['content'][_0xca0f('0x4b')]();}else if(_0x2da0e9['type']==='variable'&&_0x2da0e9[_0xca0f('0x4c')]&&_0x2da0e9['idField']){_0x2be5ac[_0x2da0e9[_0xca0f('0x4c')]]&&(_0xd6c001[_0x2da0e9[_0xca0f('0x4a')]]=_0x2be5ac[_0x2da0e9[_0xca0f('0x4c')]][_0xca0f('0x4b')]());}else if(_0x2da0e9[_0xca0f('0x4d')]===_0xca0f('0x4e')&&_0x2da0e9[_0xca0f('0x4f')]&&_0x2da0e9[_0xca0f('0x4f')][_0xca0f('0x50')]&&_0x2da0e9['idField']){_0x2be5ac[_0x2da0e9[_0xca0f('0x4f')]['name'][_0xca0f('0x51')]()]&&(_0xd6c001[_0x2da0e9[_0xca0f('0x4a')]]=_0x2be5ac[_0x2da0e9[_0xca0f('0x4f')][_0xca0f('0x50')][_0xca0f('0x51')]()]['toString']());}});}return _0xd6c001;}function getConnection(_0x3bb15d){var _0x402cd4=_0x3bb15d[_0xca0f('0x52')][_0xca0f('0x53')](_0x3bb15d['securityToken']);var _0x416ce8=new jsforce[(_0xca0f('0x54'))]({'oauth2':{'loginUrl':_0x3bb15d[_0xca0f('0x55')]||_0xca0f('0x56'),'clientId':_0x3bb15d[_0xca0f('0x57')],'clientSecret':_0x3bb15d['clientSecret']}});return _0x416ce8[_0xca0f('0x58')](_0x3bb15d[_0xca0f('0x59')],_0x402cd4)[_0xca0f('0x24')](function(){logger['info'](_0xca0f('0x5a'));return _0x416ce8;});}exports[_0xca0f('0x5b')]=function(_0x28a04e,_0x23d325,_0xb84080,_0x508e46,_0x4ae48d,_0x45d3d1){var _0x2f3e77,_0x3e8200,_0x419872,_0x27bde6;_0x45d3d1[_0xca0f('0x5c')]=intUtil['stripTrailingSlash'](_0x45d3d1[_0xca0f('0x5c')]);_0x45d3d1['remoteUri']=intUtil['stripTrailingSlash'](_0x45d3d1[_0xca0f('0x55')]);if(_0x4ae48d&&_0x4ae48d['monitor_format']){logger[_0xca0f('0x25')]('[QUEUE]',_0xca0f('0x5d'));_0x23d325[_0xca0f('0x5e')]=util[_0xca0f('0x43')](_0xca0f('0x5f'),_0x45d3d1[_0xca0f('0x5c')],_0x23d325[_0xca0f('0x60')],md5(_0x23d325['uniqueid']));}else{_0x23d325[_0xca0f('0x5e')]='';}return getConnection(_0x45d3d1)[_0xca0f('0x24')](function(_0x373f52){_0x27bde6=_0x373f52;return getUser(_0x45d3d1,_0x508e46[_0xca0f('0x61')],_0x27bde6);})['then'](function(_0x5bda1){_0x2f3e77=_0x5bda1;return getEndUser(_0x45d3d1,_0xb84080,_0x23d325[_0xca0f('0x62')],_0x23d325[_0xca0f('0x63')],_0x27bde6);})[_0xca0f('0x24')](function(_0x515e00){_0x3e8200=_0x515e00;return getTicket(_0x45d3d1,_0x2f3e77,_0x3e8200,_0xb84080,_0x23d325,_0xb84080[_0xca0f('0x64')],_0x27bde6,_0xca0f('0x5b'));})['then'](function(_0x118c4a){_0x419872=_0x118c4a;logger[_0xca0f('0x25')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x419872['id']);logger['info'](_0xca0f('0x65'),_0x419872['id'],_0x508e46[_0xca0f('0x50')],_0x45d3d1[_0xca0f('0x4d')]);switch(_0x45d3d1[_0xca0f('0x4d')]){case _0xca0f('0x66'):emit(util[_0xca0f('0x43')]('user:%s',_0x508e46['name']),_0xca0f('0x67'),{'recordId':_0x419872['id']});break;case _0xca0f('0x68'):emit(util['format']('user:%s',_0x508e46[_0xca0f('0x50')]),_0xca0f('0x69'),{'uri':util[_0xca0f('0x43')](_0xca0f('0x6a'),_0x27bde6[_0xca0f('0x6b')],_0x419872['id'])});break;default:logger[_0xca0f('0x6c')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xca0f('0x6d')](function(_0x1f7db5){logger['error'](_0xca0f('0x6e'),_0x1f7db5);});};exports[_0xca0f('0x6f')]=function(_0x377d35,_0x12e379,_0x5e64ea,_0x45751e,_0xa84c7,_0x2dff6a,_0x2bfd45){var _0x21cd3d,_0x42bb98,_0x13a4bc,_0x164849;_0x2dff6a[_0xca0f('0x5c')]=intUtil[_0xca0f('0x70')](_0x2dff6a[_0xca0f('0x5c')]);_0x2dff6a[_0xca0f('0x55')]=intUtil[_0xca0f('0x70')](_0x2dff6a['remoteUri']);if(_0x2bfd45&&_0x2bfd45[_0xca0f('0x71')]&&_0x2bfd45[_0xca0f('0x71')]!==_0xca0f('0x72')){logger[_0xca0f('0x25')](_0xca0f('0x73'),_0xca0f('0x5d'));_0x12e379[_0xca0f('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dff6a[_0xca0f('0x5c')],_0x12e379[_0xca0f('0x60')],md5(_0x12e379[_0xca0f('0x60')]));}return getConnection(_0x2dff6a)['then'](function(_0x588789){_0x164849=_0x588789;return getUser(_0x2dff6a,_0x45751e[_0xca0f('0x61')],_0x164849);})['then'](function(_0x29bb71){_0x21cd3d=_0x29bb71;return getEndUser(_0x2dff6a,_0x5e64ea,_0x12e379['destcalleridname'],_0x12e379[_0xca0f('0x74')],_0x164849);})[_0xca0f('0x24')](function(_0xb0f915){_0x42bb98=_0xb0f915;return getTicket(_0x2dff6a,_0x21cd3d,_0x42bb98,_0x5e64ea,_0x12e379,_0x5e64ea[_0xca0f('0x64')],_0x164849,_0xca0f('0x6f'));})[_0xca0f('0x24')](function(_0x3421d0){_0x13a4bc=_0x3421d0;logger[_0xca0f('0x25')](_0xca0f('0x75'),_0x13a4bc['id']);logger[_0xca0f('0x25')](_0xca0f('0x76'),_0x13a4bc['id'],_0x45751e[_0xca0f('0x50')],_0x2dff6a['type']);switch(_0x2dff6a['type']){case _0xca0f('0x66'):emit(util[_0xca0f('0x43')](_0xca0f('0x77'),_0x45751e['name']),'trigger:salesforce:display',{'recordId':_0x13a4bc['id']});break;case _0xca0f('0x68'):emit(util['format'](_0xca0f('0x77'),_0x45751e['name']),_0xca0f('0x69'),{'uri':util[_0xca0f('0x43')]('%s/%s/e',_0x164849['instanceUrl'],_0x13a4bc['id'])});break;default:logger['error'](_0xca0f('0x73'),_0xca0f('0x78'));}})[_0xca0f('0x6d')](function(_0x52ef27){logger[_0xca0f('0x6c')]('[OUTBOUND]',_0x52ef27);});};exports['unmanaged']=function(_0x4a0d1d,_0x425d78,_0x2f0fc2,_0x294eba,_0x67a11f,_0x4442da){var _0x43bcc3,_0x17eb6b,_0x5ee0c9,_0x505b22;_0x4442da[_0xca0f('0x5c')]=intUtil[_0xca0f('0x70')](_0x4442da[_0xca0f('0x5c')]);_0x4442da[_0xca0f('0x55')]=intUtil['stripTrailingSlash'](_0x4442da[_0xca0f('0x55')]);if(_0x67a11f&&_0x67a11f[_0xca0f('0x79')]){logger[_0xca0f('0x25')]('['+_0x425d78['lastevent'][_0xca0f('0x7a')]()+']',_0xca0f('0x5d'));_0x425d78['recordingURL']=util[_0xca0f('0x43')](_0xca0f('0x5f'),_0x4442da['serverUrl'],_0x425d78[_0xca0f('0x60')],md5(_0x425d78[_0xca0f('0x60')]));}else{_0x425d78['recordingURL']='';}return getConnection(_0x4442da)[_0xca0f('0x24')](function(_0x5dd592){_0x505b22=_0x5dd592;if(!_[_0xca0f('0x1f')](_0x294eba)){return getUser(_0x4442da,_0x294eba[_0xca0f('0x50')],_0x505b22);}else{return getUser(_0x4442da,null,_0x505b22);}})[_0xca0f('0x24')](function(_0x5ce990){_0x43bcc3=_0x5ce990;return getEndUser(_0x4442da,_0x2f0fc2,_0x425d78['calleridname'],_0x425d78['calleridnum'],_0x505b22);})[_0xca0f('0x24')](function(_0x5c53fc){_0x17eb6b=_0x5c53fc;return getTicket(_0x4442da,_0x43bcc3,_0x17eb6b,_0x2f0fc2,_0x425d78,_0x2f0fc2['Fields'],_0x505b22);})[_0xca0f('0x24')](function(_0x44de43){_0x5ee0c9=_0x44de43;logger[_0xca0f('0x25')]('['+_0x425d78[_0xca0f('0x7b')][_0xca0f('0x7a')]()+_0xca0f('0x7c'),_0x5ee0c9['id']);logger[_0xca0f('0x25')]('['+_0x425d78[_0xca0f('0x7b')][_0xca0f('0x7a')]()+_0xca0f('0x7d'),_0x4442da['type']);})[_0xca0f('0x6d')](function(_0x4ec1e8){logger[_0xca0f('0x6c')]('['+_0x425d78['lastevent'][_0xca0f('0x7a')]()+']',_0x4ec1e8);});};
\ No newline at end of file
+var _0x28ab=['WhoId','account','WhatId','ticketType','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','length','Email','Name','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','resolve','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Phone','attributes','type','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','<unknown>','Caller\x20-\x20%s','LastName','format','No\x20Company','upperFirst','forEach','string','picklist','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','queue','serverUrl','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','stripTrailingSlash','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','emit','Descriptions','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead'];(function(_0x397370,_0x21bb43){var _0x330b1b=function(_0x2491c9){while(--_0x2491c9){_0x397370['push'](_0x397370['shift']());}};_0x330b1b(++_0x21bb43);}(_0x28ab,0x68));var _0xb28a=function(_0x4cd96f,_0x196d45){_0x4cd96f=_0x4cd96f-0x0;var _0x1fb7cf=_0x28ab[_0x4cd96f];return _0x1fb7cf;};'use strict';var _=require(_0xb28a('0x0'));var rp=require(_0xb28a('0x1'));var moment=require(_0xb28a('0x2'));var BPromise=require(_0xb28a('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xb28a('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xb28a('0x5'));var logger=require(_0xb28a('0x6'))(_0xb28a('0x7'));config['redis']=_[_0xb28a('0x8')](config[_0xb28a('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb28a('0xa'))(new Redis(config[_0xb28a('0x9')]));function emit(_0x5d7647,_0x3d372d,_0x2375c7){io['to'](_0x5d7647)[_0xb28a('0xb')](_0x3d372d,_0x2375c7);}function getTicket(_0x14c813,_0x487e2,_0x4507ff,_0x2f9c5d,_0x316cbe,_0x4a66aa,_0x599df4,_0x13655d){var _0x57585e=Object['assign']({},{'OwnerId':_0x487e2['id'],'Subject':intUtil['getString'](_0x2f9c5d['Subjects'],_0x316cbe,'\x20'),'Description':intUtil['getString'](_0x2f9c5d[_0xb28a('0xc')],_0x316cbe,'\x0a')},getCustomFields(_0x4a66aa,_0x316cbe));if(_0x4507ff){if(_0x2f9c5d['ticketType']===_0xb28a('0xd')){_0x57585e[_0xb28a('0xe')]=moment[_0xb28a('0xf')]();_0x57585e['IsReminderSet']=![];_0x57585e[_0xb28a('0x10')]=![];if(_0x4507ff[_0xb28a('0x11')]===_0xb28a('0x12')||_0x4507ff[_0xb28a('0x11')]===_0xb28a('0x13')){_0x57585e[_0xb28a('0x14')]=_0x4507ff['id'];}else if(_0x4507ff[_0xb28a('0x11')]===_0xb28a('0x15')){_0x57585e[_0xb28a('0x16')]=_0x4507ff['id'];}}else if(_0x2f9c5d[_0xb28a('0x17')]===_0xb28a('0x18')){if(_0x4507ff[_0xb28a('0x11')]===_0xb28a('0x12')){_0x57585e[_0xb28a('0x19')]=_0x4507ff['id'];}else if(_0x4507ff[_0xb28a('0x11')]===_0xb28a('0x15')){_0x57585e['AccountId']=_0x4507ff['id'];}else if(_0x4507ff[_0xb28a('0x11')]===_0xb28a('0x13')&&_0x2f9c5d[_0xb28a('0x1a')]){_0x57585e[_0x2f9c5d['leadId']]=_0x4507ff['id'];}else{logger[_0xb28a('0x1b')](_0xb28a('0x1c'));}}}return _0x599df4[_0xb28a('0x1d')](_0x2f9c5d['ticketType'])[_0xb28a('0x1e')](_0x57585e);}function getUser(_0x343475,_0x25bcf8,_0x202cc1){if(!_[_0xb28a('0x1f')](_0x25bcf8)&&intUtil['validateEmail'](_0x25bcf8)){var _0x31db61={'Email':_0x25bcf8};var _0x253e3d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x202cc1[_0xb28a('0x1d')](_0xb28a('0x20'))[_0xb28a('0x21')](_0x31db61,_0x253e3d)[_0xb28a('0x22')]()['then'](function(_0x386800){if(_0x386800[_0xb28a('0x23')]){var _0x4c8eed=_['find'](_0x386800,function(_0x5640aa){return _0x5640aa[_0xb28a('0x24')]===_0x25bcf8;});if(_0x4c8eed){logger[_0xb28a('0x1b')]('Agent\x20%s\x20found.',_0x25bcf8);return BPromise['resolve']({'id':_0x4c8eed['Id'],'name':_0x4c8eed[_0xb28a('0x25')]});}}else{logger[_0xb28a('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x25bcf8);return _0x202cc1['identity']()['then'](function(_0xb12701){return BPromise['resolve']({'id':_0xb12701[_0xb28a('0x26')],'name':_0xb12701['display_name']});});}});}else{logger[_0xb28a('0x1b')](_0xb28a('0x27'),_0x25bcf8);return _0x202cc1[_0xb28a('0x28')]()[_0xb28a('0x29')](function(_0x295942){return BPromise[_0xb28a('0x2a')]({'id':_0x295942['user_id'],'name':_0x295942[_0xb28a('0x2b')]});});}}function getEndUser(_0x2ed506,_0x398015,_0x54368a,_0x84340a,_0x5f01d7){var _0x1fba8b={'$or':{'Phone':_0x84340a}};var _0x34322d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb28a('0x2a')]()[_0xb28a('0x29')](function(){logger['info'](_0xb28a('0x2c'),_0x84340a,_0x398015[_0xb28a('0x2d')]);switch(_0x398015[_0xb28a('0x2d')]){case _0xb28a('0x2e'):var _0x4cc257=_[_0xb28a('0x2f')](_0x1fba8b);if(_0x398015[_0xb28a('0x30')]){var _0x336163={};_0x336163[_0x398015[_0xb28a('0x30')]]=_0x84340a;_[_0xb28a('0x31')](_0x4cc257[_0xb28a('0x32')],_0x336163);}return _0x5f01d7[_0xb28a('0x1d')](_0xb28a('0x33'))['find'](_0x4cc257,_0x34322d)[_0xb28a('0x22')]()[_0xb28a('0x29')](function(_0x336f3f){if(_0x336f3f&&_0x336f3f[_0xb28a('0x23')]){return _0x336f3f;}else{var _0x4a739d=_[_0xb28a('0x2f')](_0x1fba8b);if(_0x398015['additionalSearchLead']){var _0x3197fe={};_0x3197fe[_0x398015[_0xb28a('0x34')]]=_0x84340a;_[_0xb28a('0x31')](_0x4a739d[_0xb28a('0x32')],_0x3197fe);}return _0x5f01d7[_0xb28a('0x1d')](_0xb28a('0x35'))[_0xb28a('0x21')](_0x4a739d,_0x34322d);}});case _0xb28a('0x36'):var _0x3bfab8=_[_0xb28a('0x2f')](_0x1fba8b);if(_0x398015[_0xb28a('0x37')]){var _0x336163={};_0x336163[_0x398015['additionalSearchAccount']]=_0x84340a;_[_0xb28a('0x31')](_0x3bfab8[_0xb28a('0x32')],_0x336163);}return _0x5f01d7['sobject']('Account')['find'](_0x3bfab8,_0x34322d)[_0xb28a('0x22')]()[_0xb28a('0x29')](function(_0x443fe0){if(_0x443fe0&&_0x443fe0['length']){return _0x443fe0;}else{var _0x1d05fc=_[_0xb28a('0x2f')](_0x1fba8b);if(_0x398015[_0xb28a('0x30')]){var _0xba7aeb={};_0xba7aeb[_0x398015['additionalSearchContact']]=_0x84340a;_[_0xb28a('0x31')](_0x1d05fc[_0xb28a('0x32')],_0xba7aeb);}return _0x5f01d7['sobject'](_0xb28a('0x33'))[_0xb28a('0x21')](_0x1d05fc,_0x34322d)['then'](function(_0x3fc869){if(_0x3fc869&&_0x3fc869['length']){return _0x3fc869;}else{var _0x5f4af4=_['cloneDeep'](_0x1fba8b);if(_0x398015[_0xb28a('0x34')]){var _0x83c7ac={};_0x83c7ac[_0x398015['additionalSearchLead']]=_0x84340a;_['merge'](_0x5f4af4[_0xb28a('0x32')],_0x83c7ac);}return _0x5f01d7[_0xb28a('0x1d')](_0xb28a('0x35'))[_0xb28a('0x21')](_0x5f4af4,_0x34322d);}});}});case _0xb28a('0x12'):var _0x4cc257=_[_0xb28a('0x2f')](_0x1fba8b);if(_0x398015[_0xb28a('0x30')]){var _0x336163={};_0x336163[_0x398015['additionalSearchContact']]=_0x84340a;_['merge'](_0x4cc257[_0xb28a('0x32')],_0x336163);}return _0x5f01d7[_0xb28a('0x1d')](_0xb28a('0x33'))[_0xb28a('0x21')](_0x4cc257,_0x34322d)[_0xb28a('0x22')]();case _0xb28a('0x13'):var _0x19b6ad=_[_0xb28a('0x2f')](_0x1fba8b);if(_0x398015[_0xb28a('0x34')]){var _0x336163={};_0x336163[_0x398015[_0xb28a('0x34')]]=_0x84340a;_[_0xb28a('0x31')](_0x19b6ad[_0xb28a('0x32')],_0x336163);}return _0x5f01d7[_0xb28a('0x1d')](_0xb28a('0x35'))[_0xb28a('0x21')](_0x19b6ad,_0x34322d);case _0xb28a('0x15'):var _0x3bfab8=_[_0xb28a('0x2f')](_0x1fba8b);if(_0x398015[_0xb28a('0x37')]){var _0x336163={};_0x336163[_0x398015[_0xb28a('0x37')]]=_0x84340a;_[_0xb28a('0x31')](_0x3bfab8['$or'],_0x336163);}return _0x5f01d7[_0xb28a('0x1d')]('Account')[_0xb28a('0x21')](_0x3bfab8,_0x34322d);default:return null;}})[_0xb28a('0x29')](function(_0x480936){if(_0x480936&&_0x480936[_0xb28a('0x23')]){var _0x11d1fa=_['first'](_0x480936);if(_0x11d1fa){return BPromise[_0xb28a('0x2a')]({'id':_0x11d1fa['Id'],'name':_0x11d1fa[_0xb28a('0x25')],'phone':_0x11d1fa[_0xb28a('0x38')],'endUserType':_0x11d1fa[_0xb28a('0x39')][_0xb28a('0x3a')]['toLowerCase']()});}}})[_0xb28a('0x29')](function(_0x53c91d){if(_0x53c91d){logger[_0xb28a('0x1b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x53c91d[_0xb28a('0x11')],_0x84340a);return BPromise[_0xb28a('0x2a')](_0x53c91d);}else{logger[_0xb28a('0x1b')](_0xb28a('0x3b'),_0x84340a);var _0xc1b25a={'Phone':_0x84340a};if(_0x398015[_0xb28a('0x3c')]){if(_0x398015[_0xb28a('0x3c')]===_0xb28a('0x12')){logger['info'](_0xb28a('0x3d'),_0x84340a,_0x398015[_0xb28a('0x3c')]);_0xc1b25a['LastName']=_0x54368a!==_0xb28a('0x3e')?_0x54368a:util['format'](_0xb28a('0x3f'),_0x84340a);}else if(_0x398015[_0xb28a('0x3c')]===_0xb28a('0x13')){logger[_0xb28a('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x84340a,_0x398015[_0xb28a('0x3c')]);_0xc1b25a[_0xb28a('0x40')]=_0x54368a!==_0xb28a('0x3e')?_0x54368a:util[_0xb28a('0x41')](_0xb28a('0x3f'),_0x84340a);_0xc1b25a['Company']=_0xb28a('0x42');}else if(_0x398015['moduleCreate']==='account'){logger[_0xb28a('0x1b')](_0xb28a('0x3d'),_0x84340a,_0x398015[_0xb28a('0x3c')]);_0xc1b25a['Name']=_0x54368a!==_0xb28a('0x3e')?_0x54368a:util[_0xb28a('0x41')](_0xb28a('0x3f'),_0x84340a);}else{return null;}}return _0x5f01d7[_0xb28a('0x1d')](_[_0xb28a('0x43')](_0x398015[_0xb28a('0x3c')]))[_0xb28a('0x1e')](_0xc1b25a)[_0xb28a('0x29')](function(_0x384f58){return BPromise['resolve']({'id':_0x384f58['id'],'endUserType':_0x398015[_0xb28a('0x3c')]});});}});}function getCustomFields(_0x3f6e3b,_0x4cb9ec){var _0x25b537={};if(_0x3f6e3b['length']>0x0){_[_0xb28a('0x44')](_0x3f6e3b,function(_0x406948){if(_['includes']([_0xb28a('0x45'),_0xb28a('0x46')],_0x406948[_0xb28a('0x3a')])&&_0x406948[_0xb28a('0x47')]){_0x25b537[_0x406948[_0xb28a('0x47')]]=_0x406948[_0xb28a('0x48')][_0xb28a('0x49')]();}else if(_0x406948['type']===_0xb28a('0x4a')&&_0x406948[_0xb28a('0x4b')]&&_0x406948[_0xb28a('0x47')]){_0x4cb9ec[_0x406948[_0xb28a('0x4b')]]&&(_0x25b537[_0x406948[_0xb28a('0x47')]]=_0x4cb9ec[_0x406948[_0xb28a('0x4b')]][_0xb28a('0x49')]());}else if(_0x406948[_0xb28a('0x3a')]==='customVariable'&&_0x406948[_0xb28a('0x4c')]&&_0x406948[_0xb28a('0x4c')][_0xb28a('0x4d')]&&_0x406948[_0xb28a('0x47')]){_0x4cb9ec[_0x406948['Variable']['name'][_0xb28a('0x4e')]()]&&(_0x25b537[_0x406948[_0xb28a('0x47')]]=_0x4cb9ec[_0x406948['Variable'][_0xb28a('0x4d')]['toLowerCase']()]['toString']());}});}return _0x25b537;}function getConnection(_0x46e6fc){var _0x2cb4db=_0x46e6fc[_0xb28a('0x4f')][_0xb28a('0x50')](_0x46e6fc[_0xb28a('0x51')]);var _0x2ae186=new jsforce[(_0xb28a('0x52'))]({'oauth2':{'loginUrl':_0x46e6fc['remoteUri']||_0xb28a('0x53'),'clientId':_0x46e6fc[_0xb28a('0x54')],'clientSecret':_0x46e6fc[_0xb28a('0x55')]}});return _0x2ae186[_0xb28a('0x56')](_0x46e6fc['username'],_0x2cb4db)[_0xb28a('0x29')](function(){logger[_0xb28a('0x1b')]('Connection\x20established.');return _0x2ae186;});}exports[_0xb28a('0x57')]=function(_0x24637d,_0x4a7553,_0x2a5dac,_0x5a54a1,_0x4f72c3,_0x31c985){var _0xd21496,_0x2b3d82,_0x2aaf2,_0x3e5958;_0x31c985[_0xb28a('0x58')]=intUtil['stripTrailingSlash'](_0x31c985[_0xb28a('0x58')]);_0x31c985['remoteUri']=intUtil['stripTrailingSlash'](_0x31c985[_0xb28a('0x59')]);if(_0x4f72c3&&_0x4f72c3[_0xb28a('0x5a')]){logger['info'](_0xb28a('0x5b'),_0xb28a('0x5c'));_0x4a7553['recordingURL']=util[_0xb28a('0x41')](_0xb28a('0x5d'),_0x31c985[_0xb28a('0x58')],_0x4a7553[_0xb28a('0x5e')],md5(_0x4a7553[_0xb28a('0x5e')]));}else{_0x4a7553[_0xb28a('0x5f')]='';}return getConnection(_0x31c985)['then'](function(_0x2d4317){_0x3e5958=_0x2d4317;return getUser(_0x31c985,_0x5a54a1['email'],_0x3e5958);})[_0xb28a('0x29')](function(_0xf8a318){_0xd21496=_0xf8a318;return getEndUser(_0x31c985,_0x2a5dac,_0x4a7553[_0xb28a('0x60')],_0x4a7553[_0xb28a('0x61')],_0x3e5958);})[_0xb28a('0x29')](function(_0x2e601b){_0x2b3d82=_0x2e601b;return getTicket(_0x31c985,_0xd21496,_0x2b3d82,_0x2a5dac,_0x4a7553,_0x2a5dac['Fields'],_0x3e5958,_0xb28a('0x57'));})[_0xb28a('0x29')](function(_0x593e3e){_0x2aaf2=_0x593e3e;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x2aaf2['id']);logger[_0xb28a('0x1b')](_0xb28a('0x62'),_0x2aaf2['id'],_0x5a54a1[_0xb28a('0x4d')],_0x31c985[_0xb28a('0x3a')]);switch(_0x31c985['type']){case _0xb28a('0x63'):emit(util[_0xb28a('0x41')](_0xb28a('0x64'),_0x5a54a1[_0xb28a('0x4d')]),_0xb28a('0x65'),{'recordId':_0x2aaf2['id']});break;case _0xb28a('0x66'):emit(util[_0xb28a('0x41')](_0xb28a('0x64'),_0x5a54a1[_0xb28a('0x4d')]),_0xb28a('0x67'),{'uri':util[_0xb28a('0x41')](_0xb28a('0x68'),_0x3e5958[_0xb28a('0x69')],_0x2aaf2['id'])});break;default:logger[_0xb28a('0x6a')](_0xb28a('0x6b'));}})[_0xb28a('0x6c')](function(_0x5cd4f9){logger['error'](_0xb28a('0x5b'),_0x5cd4f9);});};exports['outbound']=function(_0x260b34,_0x1f80b1,_0x307f4f,_0xfe5e6f,_0x54c147,_0x289203,_0x5b3254){var _0x5d5264,_0xd54064,_0x4db0ea,_0x29c4a4;_0x289203['serverUrl']=intUtil['stripTrailingSlash'](_0x289203[_0xb28a('0x58')]);_0x289203[_0xb28a('0x59')]=intUtil['stripTrailingSlash'](_0x289203['remoteUri']);if(_0x5b3254&&_0x5b3254['recordingFormat']&&_0x5b3254['recordingFormat']!==_0xb28a('0x6d')){logger['info'](_0xb28a('0x6e'),_0xb28a('0x5c'));_0x1f80b1['recordingURL']=util[_0xb28a('0x41')](_0xb28a('0x5d'),_0x289203[_0xb28a('0x58')],_0x1f80b1['uniqueid'],md5(_0x1f80b1[_0xb28a('0x5e')]));}return getConnection(_0x289203)[_0xb28a('0x29')](function(_0x5b866e){_0x29c4a4=_0x5b866e;return getUser(_0x289203,_0xfe5e6f[_0xb28a('0x6f')],_0x29c4a4);})[_0xb28a('0x29')](function(_0x53fbce){_0x5d5264=_0x53fbce;return getEndUser(_0x289203,_0x307f4f,_0x1f80b1[_0xb28a('0x70')],_0x1f80b1[_0xb28a('0x71')],_0x29c4a4);})['then'](function(_0x35c913){_0xd54064=_0x35c913;return getTicket(_0x289203,_0x5d5264,_0xd54064,_0x307f4f,_0x1f80b1,_0x307f4f[_0xb28a('0x72')],_0x29c4a4,_0xb28a('0x73'));})[_0xb28a('0x29')](function(_0x5af8b1){_0x4db0ea=_0x5af8b1;logger[_0xb28a('0x1b')](_0xb28a('0x74'),_0x4db0ea['id']);logger[_0xb28a('0x1b')](_0xb28a('0x75'),_0x4db0ea['id'],_0xfe5e6f[_0xb28a('0x4d')],_0x289203[_0xb28a('0x3a')]);switch(_0x289203[_0xb28a('0x3a')]){case _0xb28a('0x63'):emit(util[_0xb28a('0x41')](_0xb28a('0x64'),_0xfe5e6f[_0xb28a('0x4d')]),_0xb28a('0x65'),{'recordId':_0x4db0ea['id']});break;case'newTab':emit(util[_0xb28a('0x41')]('user:%s',_0xfe5e6f[_0xb28a('0x4d')]),_0xb28a('0x67'),{'uri':util[_0xb28a('0x41')]('%s/%s/e',_0x29c4a4[_0xb28a('0x69')],_0x4db0ea['id'])});break;default:logger[_0xb28a('0x6a')](_0xb28a('0x6e'),_0xb28a('0x76'));}})[_0xb28a('0x6c')](function(_0x4a16cf){logger[_0xb28a('0x6a')](_0xb28a('0x6e'),_0x4a16cf);});};exports['unmanaged']=function(_0x5f4ee1,_0x487118,_0x27c3f2,_0x47c699,_0x2a769d,_0x528b02){var _0x403cf0,_0x156a55,_0x5de253,_0x1e8e99;_0x528b02[_0xb28a('0x58')]=intUtil[_0xb28a('0x77')](_0x528b02[_0xb28a('0x58')]);_0x528b02[_0xb28a('0x59')]=intUtil['stripTrailingSlash'](_0x528b02[_0xb28a('0x59')]);if(_0x2a769d&&_0x2a769d[_0xb28a('0x5a')]){logger[_0xb28a('0x1b')]('['+_0x487118['lastevent']['toUpperCase']()+']',_0xb28a('0x5c'));_0x487118['recordingURL']=util[_0xb28a('0x41')](_0xb28a('0x5d'),_0x528b02[_0xb28a('0x58')],_0x487118[_0xb28a('0x5e')],md5(_0x487118[_0xb28a('0x5e')]));}else{_0x487118[_0xb28a('0x5f')]='';}return getConnection(_0x528b02)[_0xb28a('0x29')](function(_0x52334f){_0x1e8e99=_0x52334f;if(!_[_0xb28a('0x1f')](_0x47c699)){return getUser(_0x528b02,_0x47c699[_0xb28a('0x4d')],_0x1e8e99);}else{return getUser(_0x528b02,null,_0x1e8e99);}})['then'](function(_0x41343e){_0x403cf0=_0x41343e;return getEndUser(_0x528b02,_0x27c3f2,_0x487118[_0xb28a('0x60')],_0x487118['calleridnum'],_0x1e8e99);})[_0xb28a('0x29')](function(_0x4bfcea){_0x156a55=_0x4bfcea;return getTicket(_0x528b02,_0x403cf0,_0x156a55,_0x27c3f2,_0x487118,_0x27c3f2['Fields'],_0x1e8e99);})[_0xb28a('0x29')](function(_0x5f3902){_0x5de253=_0x5f3902;logger['info']('['+_0x487118[_0xb28a('0x78')][_0xb28a('0x79')]()+_0xb28a('0x7a'),_0x5de253['id']);logger['info']('['+_0x487118['lastevent'][_0xb28a('0x79')]()+_0xb28a('0x7b'),_0x528b02[_0xb28a('0x3a')]);})[_0xb28a('0x6c')](function(_0x476f44){logger[_0xb28a('0x6a')]('['+_0x487118[_0xb28a('0x78')]['toUpperCase']()+']',_0x476f44);});};
\ No newline at end of file
index d5625fa..e12e939 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x025a=['ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','toUpperCase','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','then','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','includes','string','type','customField','nameField','content','toString','picklist','idField','variable','variableName','toLowerCase','customVariable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','getString','Descriptions','ticketNumber','number','label','label_entry','Incident','ticketId','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5'];(function(_0x3ed02c,_0xb947b5){var _0x214a4a=function(_0x5202de){while(--_0x5202de){_0x3ed02c['push'](_0x3ed02c['shift']());}};_0x214a4a(++_0xb947b5);}(_0x025a,0x66));var _0xa025=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0x025a[_0x3e6b2f];return _0x323215;};'use strict';var _=require(_0xa025('0x0'));var Promise=require(_0xa025('0x1'));var rp=require(_0xa025('0x2'));var util=require('util');var md5=require(_0xa025('0x3'));var Redis=require(_0xa025('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xa025('0x5'))('servicenow');config[_0xa025('0x6')]=_[_0xa025('0x7')](config[_0xa025('0x6')],{'host':_0xa025('0x8'),'port':0x18eb});var io=require(_0xa025('0x9'))(new Redis(config['redis']));function getAdminUser(_0x4145ae,_0xcdf287,_0x89f3f2,_0xd5bbda,_0x5c53c7,_0x2559be){return new Promise(function(_0xa9b27d,_0x315e27){var _0x121aa1={'method':_0xa025('0xa'),'uri':_0xd5bbda+_0xa025('0xb')+'&'+_0x5c53c7+'&'+_0x2559be,'auth':_0xcdf287,'json':!![]};return rp(_0x121aa1)['then'](function(_0x3aa7a7){if(_0x3aa7a7[_0xa025('0xc')][_0xa025('0xd')]>0x0){_0x89f3f2['adminId']=_0x3aa7a7[_0xa025('0xc')][0x0][_0xa025('0xe')];}logger['info']('['+[_0x4145ae[_0xa025('0xf')]()]+'],\x20getAdminUser\x20crm',_0x89f3f2);_0xa9b27d(_0x89f3f2);})[_0xa025('0x10')](function(_0x3173e3){logger[_0xa025('0x11')]('['+[_0x4145ae[_0xa025('0xf')]()]+']',_0x3173e3[_0xa025('0x12')]);_0x315e27(_0x3173e3['message']);});});}function getUser(_0xa1b64f,_0x5e56d3,_0x1824ea,_0x4e6897,_0x12e235){return function(_0x4a09aa){logger[_0xa025('0x13')]('['+[_0xa1b64f[_0xa025('0xf')]()]+_0xa025('0x14'),_0x4a09aa);return new Promise(function(_0x4c83ad,_0x4dee37){if(intUtil[_0xa025('0x15')](_0x4a09aa[_0xa025('0x16')])){var _0x28f50f={'method':_0xa025('0xa'),'uri':_0x1824ea+'sys_user?sysparm_query=email%3D'+_0x4a09aa['userEmail']+'&'+_0x4e6897+'&'+_0x12e235,'auth':_0x5e56d3,'json':!![]};logger[_0xa025('0x13')]('['+[_0xa1b64f[_0xa025('0xf')]()]+'],\x20getUser\x20rp\x20obj',_0x28f50f);return rp(_0x28f50f)[_0xa025('0x17')](function(_0x97c8c6){logger[_0xa025('0x13')]('['+[_0xa1b64f['toUpperCase']()]+_0xa025('0x18'),_0x97c8c6);if(_0x97c8c6[_0xa025('0xc')][_0xa025('0xd')]>0x0&&String(_0x97c8c6[_0xa025('0xc')][0x0][_0xa025('0x19')])===_0xa025('0x1a')){_0x4a09aa[_0xa025('0x1b')]=_0x97c8c6[_0xa025('0xc')][0x0][_0xa025('0xe')];}else{_0x4a09aa[_0xa025('0x1b')]=_0x4a09aa[_0xa025('0x1c')];_0x4a09aa[_0xa025('0x16')]=_0x4a09aa[_0xa025('0x1d')];}logger[_0xa025('0x13')]('['+[_0xa1b64f['toUpperCase']()]+_0xa025('0x1e'),_0x4a09aa);_0x4c83ad(_0x4a09aa);})[_0xa025('0x10')](function(_0xf39ac2){logger[_0xa025('0x11')]('['+[_0xa1b64f['toUpperCase']()]+']',_0xf39ac2['message']);_0x4dee37(_0xf39ac2[_0xa025('0x12')]);});}else{logger[_0xa025('0x13')]('['+[_0xa1b64f[_0xa025('0xf')]()]+']\x20using\x20admin\x20profile');_0x4a09aa[_0xa025('0x1b')]=_0x4a09aa['adminId'];_0x4a09aa['userEmail']=_0x4a09aa[_0xa025('0x1d')];_0x4c83ad(_0x4a09aa);}});};}function createEndUser(_0x27651c,_0x48850d,_0x551f90,_0xaabfbe,_0x1c047b){logger['info']('['+[_0x27651c['toUpperCase']()]+_0xa025('0x1f'),_0x551f90);return new Promise(function(_0x282400,_0x33e217){var _0xaa8a75={'method':_0xa025('0x20'),'uri':_0xaabfbe+_0xa025('0x21')+_0x1c047b,'body':{'user_name':_0x551f90[_0xa025('0x22')],'roles':_0xa025('0x23'),'first_name':_0x551f90[_0xa025('0x22')],'active':_0xa025('0x1a'),'date_format':_0xa025('0x24'),'phone':_0x551f90['endUserNumber']},'auth':_0x48850d,'json':!![]};return rp(_0xaa8a75)[_0xa025('0x17')](function(_0x2cbc89){logger[_0xa025('0x13')]('['+[_0x27651c[_0xa025('0xf')]()]+_0xa025('0x25'),_0x2cbc89['result']);_0x551f90['endUserId']=_0x2cbc89[_0xa025('0xc')][_0xa025('0xe')];_0x282400(_0x551f90);})[_0xa025('0x10')](function(_0x202706){logger[_0xa025('0x11')]('['+[_0x27651c['toUpperCase']()]+']',_0x202706[_0xa025('0x12')]);_0x33e217(_0x202706[_0xa025('0x12')]);});});}function getEndUser(_0x1c72ee,_0x46fb56,_0x35b3b9,_0x594dc9,_0x43d2d6){return function(_0xe7a13b){logger['info']('['+[_0x1c72ee[_0xa025('0xf')]()]+_0xa025('0x26'),_0xe7a13b);return new Promise(function(_0x3e5263,_0x557692){var _0x569857={'method':_0xa025('0xa'),'uri':_0x35b3b9+_0xa025('0x27')+_0xe7a13b[_0xa025('0x22')]+'&'+_0x594dc9+'&'+_0x43d2d6,'auth':_0x46fb56,'json':!![]};return rp(_0x569857)['then'](function(_0x511052){if(_0x511052[_0xa025('0xc')][_0xa025('0xd')]>0x0){_0xe7a13b[_0xa025('0x28')]=_0x511052[_0xa025('0xc')][0x0]['sys_id'];logger['info']('['+[_0x1c72ee['toUpperCase']()]+'],\x20getEndUser\x20crm',_0xe7a13b);_0x3e5263(_0xe7a13b);}else{return createEndUser(_0x1c72ee,_0x46fb56,_0xe7a13b,_0x35b3b9,_0x594dc9)[_0xa025('0x17')](function(_0x2dbbf4){logger['info']('['+[_0x1c72ee[_0xa025('0xf')]()]+_0xa025('0x29'),_0x2dbbf4);_0x3e5263(_0x2dbbf4);});}})[_0xa025('0x10')](function(_0x175c76){logger[_0xa025('0x11')]('['+[_0x1c72ee['toUpperCase']()]+']',_0x175c76[_0xa025('0x12')]);_0x557692(_0x175c76[_0xa025('0x12')]);});});};}function getCustomFields(_0x4a7d56,_0x4f81d0){var _0x2163bf={};if(_0x4a7d56[_0xa025('0xd')]>0x0){_['forEach'](_0x4a7d56,function(_0x4d5e80){if(_[_0xa025('0x2a')]([_0xa025('0x2b'),'picklist'],_0x4d5e80[_0xa025('0x2c')])&&_0x4d5e80['nameField']&&!_0x4d5e80[_0xa025('0x2d')]){_0x2163bf[_0x4d5e80[_0xa025('0x2e')]['toLowerCase']()]=_0x4d5e80[_0xa025('0x2f')][_0xa025('0x30')]();}else if(_[_0xa025('0x2a')]([_0xa025('0x2b'),_0xa025('0x31')],_0x4d5e80[_0xa025('0x2c')])&&_0x4d5e80['idField']&&_0x4d5e80[_0xa025('0x2d')]){_0x2163bf[_0x4d5e80[_0xa025('0x32')]['toLowerCase']()]=_0x4d5e80[_0xa025('0x2f')][_0xa025('0x30')]();}else if(_0x4d5e80[_0xa025('0x2c')]===_0xa025('0x33')&&_0x4d5e80[_0xa025('0x34')]&&_0x4d5e80['idField']&&_0x4d5e80[_0xa025('0x2d')]){_0x2163bf[_0x4d5e80[_0xa025('0x32')][_0xa025('0x35')]()]=_0x4f81d0[_0x4d5e80[_0xa025('0x34')]]['toString']();}else if(_0x4d5e80[_0xa025('0x2c')]===_0xa025('0x36')&&_0x4d5e80['Variable']&&_0x4d5e80['Variable']['name']&&_0x4d5e80[_0xa025('0x32')]&&_0x4d5e80[_0xa025('0x2d')]){_0x2163bf[_0x4d5e80[_0xa025('0x32')][_0xa025('0x35')]()]=_0x4f81d0[_0x4d5e80['Variable'][_0xa025('0x37')][_0xa025('0x35')]()][_0xa025('0x30')]();}});}return _0x2163bf;}function getTicket(_0x51c67c,_0x362188,_0x1ca6cf,_0x2b1369,_0x502b78,_0x29177e){return function(_0x24db57){logger['info']('['+[_0x51c67c[_0xa025('0xf')]()]+_0xa025('0x38'),_0x24db57);return new Promise(function(_0x2833c4,_0x1f938d){var _0x5e1df8=_0x51c67c[_0xa025('0x35')]()===_0xa025('0x39')?_0x24db57[_0xa025('0x1b')]:_0x24db57[_0xa025('0x28')];var _0x3c9a9a={'method':_0xa025('0x20'),'uri':_0x1ca6cf+_0xa025('0x3a')+'?'+_0x29177e,'body':Object[_0xa025('0x3b')]({},{'active':_0xa025('0x1a'),'caller_id':_0x5e1df8,'assigned_to':_0x24db57['userId'],'short_description':intUtil['getString'](_0x2b1369[_0xa025('0x3c')],_0x502b78,'\x20'),'description':intUtil[_0xa025('0x3d')](_0x2b1369[_0xa025('0x3e')],_0x502b78,'\x0a')},getCustomFields(_0x2b1369['Fields'],_0x502b78)),'auth':_0x362188,'json':!![]};return rp(_0x3c9a9a)[_0xa025('0x17')](function(_0x2bfaab){logger[_0xa025('0x13')]('['+[_0x51c67c[_0xa025('0xf')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x2bfaab[_0xa025('0xc')]);_0x24db57['ticketId']=_0x2bfaab[_0xa025('0xc')][_0xa025('0xe')];_0x24db57[_0xa025('0x3f')]=_0x2bfaab[_0xa025('0xc')][_0xa025('0x40')];logger[_0xa025('0x13')]('['+[_0x51c67c['toUpperCase']()]+']\x20getTicket\x20crm',_0x24db57);_0x2833c4(_0x24db57);})[_0xa025('0x10')](function(_0x3997f9){logger[_0xa025('0x11')]('['+[_0x51c67c['toUpperCase']()]+']',_0x3997f9[_0xa025('0x12')]);_0x1f938d(_0x3997f9[_0xa025('0x12')]);});});};}function createRemoteTag(_0x394a04,_0x3032be,_0x3f907d,_0xed1be6){return new Promise(function(_0x1df54f,_0x438e0c){var _0x4815ae={'method':'POST','uri':_0x3f907d+_0xa025('0x41')+'?'+_0xed1be6,'body':{'short_description':_0x394a04,'global':!![],'active':!![],'name':_0x394a04},'auth':_0x3032be,'json':!![]};return rp(_0x4815ae)['then'](function(_0x4e961f){var _0x52fc36=_0x4e961f['result'][_0xa025('0xe')];_0x1df54f(_0x52fc36);});});}function getRemoteTag(_0x565731,_0x2707e4,_0x4c0e03,_0x5de128,_0x330693){return new Promise(function(_0xacfa49,_0x38990d){var _0x3dc257={'method':'GET','uri':_0x4c0e03+'label'+'?sysparm_query=name%3D'+_0x565731+'&'+_0x5de128,'auth':_0x2707e4,'json':!![]};return rp(_0x3dc257)['then'](function(_0x33c47e){if(_0x33c47e[_0xa025('0xc')]['length']>0x0){var _0x376b22=_0x33c47e[_0xa025('0xc')][0x0][_0xa025('0xe')];_0xacfa49(_0x376b22);}else{return createRemoteTag(_0x565731,_0x2707e4,_0x4c0e03,_0x5de128)['then'](function(_0x1c59e5){_0xacfa49(_0x1c59e5);});}});});}function assignTagToIncident(_0x288c64,_0x1340f6,_0x3d7eab,_0x52384d,_0x154843){return new Promise(function(_0x50575c,_0x4dc6d9){var _0x479bc5={'method':_0xa025('0x20'),'uri':_0x3d7eab+_0xa025('0x42')+'?'+_0x154843,'body':{'label':_0x288c64,'table':_0xa025('0x3a'),'id_type':_0xa025('0x43'),'table_key':_0x52384d[_0xa025('0x44')],'title':'Incident\x20-\x20'+_0x52384d['ticketNumber'],'id_display':_0x52384d['ticketNumber']},'auth':_0x1340f6,'json':!![]};return rp(_0x479bc5)['then'](function(_0x8ed859){_0x50575c();})[_0xa025('0x10')](function(){_0x50575c();});});}function manageTags(_0x2de0bb,_0x2f8eb9,_0x26bfa4,_0x50686e,_0x196cd4,_0xeb38d7,_0x4890d6){return new Promise(function(_0xc06cc8,_0x360adc){var _0x1e585c=[];_0x2f8eb9[_0xa025('0x45')](function(_0x4140d5){_0x1e585c[_0xa025('0x46')](getRemoteTag(_0x4140d5,_0x26bfa4,_0x50686e,_0xeb38d7,_0x4890d6));});return Promise[_0xa025('0x47')](_0x1e585c)[_0xa025('0x17')](function(_0x5a6b7a){if(_0x5a6b7a[_0xa025('0xd')]){logger[_0xa025('0x13')]('['+[_0x2de0bb[_0xa025('0xf')]()]+_0xa025('0x48'),_0x5a6b7a);var _0x3d68ea=[];_0x5a6b7a['forEach'](function(_0x4d1469){_0x3d68ea[_0xa025('0x46')](assignTagToIncident(_0x4d1469,_0x26bfa4,_0x50686e,_0x196cd4,_0xeb38d7));});return Promise[_0xa025('0x47')](_0x3d68ea)[_0xa025('0x17')](function(){_0xc06cc8();})[_0xa025('0x10')](function(){_0xc06cc8();});}else{_0xc06cc8();}});});}function getTags(_0x3af05e,_0x4fc4e7,_0x4187e9,_0x2ea089,_0x9fe76c,_0x2ddfb6){return function(_0x56a0ca){return new Promise(function(_0x427712,_0x48f856){var _0x25d59c=[];var _0x13c963=_0x2ea089[_0xa025('0x49')];if(_0x13c963&&_0x13c963[_0xa025('0xd')]>0x0){_0x25d59c=_[_0xa025('0x4a')](_0x13c963,'name');}if(_0x25d59c[_0xa025('0xd')]>0x0){return manageTags(_0x3af05e,_0x25d59c,_0x4fc4e7,_0x4187e9,_0x56a0ca,_0x9fe76c,_0x2ddfb6)[_0xa025('0x17')](function(){_0x427712(_0x56a0ca);});}else{_0x427712(_0x56a0ca);}});};}function emit(_0x5bf5a7,_0x258acc,_0x3743f4){var _0x3635a1=_0xa025('0x4b')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xa025('0x4c')+'%255EORDERBYDESCnumber';var _0x524792={'uri':_0x5bf5a7+_0xa025('0x4d')+_0x3743f4+_0x3635a1};io['to'](util[_0xa025('0x4e')](_0xa025('0x4f'),_0x258acc))[_0xa025('0x50')](_0xa025('0x51'),_0x524792);}exports['cs']=function(_0x17a93a,_0x24718a,_0x5c59b0,_0x3cb05a,_0x44251f,_0x853f44,_0x1964b6,_0x1736c9){var _0x2ebf07={};var _0x5d1afb={'user':_0x853f44[_0xa025('0x52')],'pass':_0x853f44['password']};var _0x363b03=_0xa025('0x53');var _0x1b66ed=_0xa025('0x54');_0x853f44[_0xa025('0x55')]=intUtil[_0xa025('0x56')](_0x853f44[_0xa025('0x55')]);_0x853f44[_0xa025('0x57')]=intUtil[_0xa025('0x56')](_0x853f44[_0xa025('0x57')]);var _0x5d06e0=util[_0xa025('0x4e')](_0xa025('0x58'),_0x853f44[_0xa025('0x55')]);_0x2ebf07['userEmail']=!_['isNil'](_0x3cb05a)?_0x3cb05a[_0xa025('0x59')]:null;_0x2ebf07['adminEmail']=_0x853f44['email'];_0x2ebf07['endUserNumber']=_0x1736c9[_0xa025('0x35')]()===_0xa025('0x39')?_0x24718a[_0xa025('0x5a')]:_0x24718a[_0xa025('0x5b')];_0x2ebf07[_0xa025('0x5c')]=_0x1736c9===_0xa025('0x5d')||_0x1736c9===_0xa025('0x5e')?'queue':_0xa025('0x39');var _0x2d6ea9=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x853f44[_0xa025('0x57')],_0x24718a[_0xa025('0x5f')],md5(_0x24718a[_0xa025('0x5f')]));if(_0x44251f&&_0x44251f[_0xa025('0x60')]){logger[_0xa025('0x13')]('[QUEUE]',_0xa025('0x61'));_0x24718a['recordingURL']=_0x2d6ea9;}else if(_0x1964b6&&_0x1964b6[_0xa025('0x62')]&&_0x1964b6[_0xa025('0x62')]!==_0xa025('0x63')){logger[_0xa025('0x13')](_0xa025('0x64'),_0xa025('0x61'));_0x24718a[_0xa025('0x65')]=_0x2d6ea9;}else{_0x24718a['recordingURL']='';}return getAdminUser(_0x1736c9,_0x5d1afb,_0x2ebf07,_0x5d06e0,_0x1b66ed,_0x363b03)[_0xa025('0x17')](getUser(_0x1736c9,_0x5d1afb,_0x5d06e0,_0x1b66ed,_0x363b03))[_0xa025('0x17')](getEndUser(_0x1736c9,_0x5d1afb,_0x5d06e0,_0x1b66ed,_0x363b03))['then'](getTicket(_0x1736c9,_0x5d1afb,_0x5d06e0,_0x5c59b0,_0x24718a,_0x1b66ed))[_0xa025('0x17')](function(_0x511d1f){logger[_0xa025('0x13')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x511d1f[_0xa025('0x44')]));logger[_0xa025('0x13')](util[_0xa025('0x4e')](_0xa025('0x66'),_0x1736c9));if(_0x1736c9!==_0xa025('0x5e')){logger[_0xa025('0x13')]('['+[_0x1736c9[_0xa025('0xf')]()]+']',_0xa025('0x67'));emit(_0x853f44[_0xa025('0x55')],_0x3cb05a[_0xa025('0x37')],_0x511d1f[_0xa025('0x44')]);}})[_0xa025('0x10')](function(_0x5aeeaf){logger[_0xa025('0x11')]('['+[_0x1736c9[_0xa025('0xf')]()]+_0xa025('0x68'),util[_0xa025('0x69')](_0x5aeeaf,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x0ded=['info','toUpperCase','catch','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','content','toString','idField','toLowerCase','variable','customField','variableName','customVariable','Variable','name','outbound','userId','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','inspect','bluebird','request-promise','util','servicenow','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0ded,0x12b));var _0xd0de=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0ded[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var Promise=require(_0xd0de('0x0'));var rp=require(_0xd0de('0x1'));var util=require(_0xd0de('0x2'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xd0de('0x3'));config[_0xd0de('0x4')]=_['defaults'](config[_0xd0de('0x4')],{'host':_0xd0de('0x5'),'port':0x18eb});var io=require(_0xd0de('0x6'))(new Redis(config['redis']));function getAdminUser(_0x3384e5,_0x5a255b,_0x52fbf4,_0x5f074c,_0x39f76c,_0x110a0d){return new Promise(function(_0x54bbc2,_0x367df1){var _0x248c00={'method':_0xd0de('0x7'),'uri':_0x5f074c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x39f76c+'&'+_0x110a0d,'auth':_0x5a255b,'json':!![]};return rp(_0x248c00)[_0xd0de('0x8')](function(_0xaae267){if(_0xaae267[_0xd0de('0x9')][_0xd0de('0xa')]>0x0){_0x52fbf4[_0xd0de('0xb')]=_0xaae267[_0xd0de('0x9')][0x0][_0xd0de('0xc')];}logger[_0xd0de('0xd')]('['+[_0x3384e5[_0xd0de('0xe')]()]+'],\x20getAdminUser\x20crm',_0x52fbf4);_0x54bbc2(_0x52fbf4);})[_0xd0de('0xf')](function(_0x249b0e){logger['error']('['+[_0x3384e5[_0xd0de('0xe')]()]+']',_0x249b0e[_0xd0de('0x10')]);_0x367df1(_0x249b0e[_0xd0de('0x10')]);});});}function getUser(_0x261606,_0x763834,_0x5877c5,_0x4afd8d,_0x180391){return function(_0x1105aa){logger['info']('['+[_0x261606[_0xd0de('0xe')]()]+'],\x20getUser\x20input\x20crm',_0x1105aa);return new Promise(function(_0x56bbc1,_0x3985ab){if(intUtil[_0xd0de('0x11')](_0x1105aa[_0xd0de('0x12')])){var _0x41e2bf={'method':_0xd0de('0x7'),'uri':_0x5877c5+_0xd0de('0x13')+_0x1105aa[_0xd0de('0x12')]+'&'+_0x4afd8d+'&'+_0x180391,'auth':_0x763834,'json':!![]};logger[_0xd0de('0xd')]('['+[_0x261606[_0xd0de('0xe')]()]+_0xd0de('0x14'),_0x41e2bf);return rp(_0x41e2bf)['then'](function(_0x43c309){logger[_0xd0de('0xd')]('['+[_0x261606[_0xd0de('0xe')]()]+_0xd0de('0x15'),_0x43c309);if(_0x43c309[_0xd0de('0x9')][_0xd0de('0xa')]>0x0&&String(_0x43c309[_0xd0de('0x9')][0x0]['active'])==='true'){_0x1105aa['userId']=_0x43c309[_0xd0de('0x9')][0x0][_0xd0de('0xc')];}else{_0x1105aa['userId']=_0x1105aa['adminId'];_0x1105aa['userEmail']=_0x1105aa[_0xd0de('0x16')];}logger[_0xd0de('0xd')]('['+[_0x261606[_0xd0de('0xe')]()]+_0xd0de('0x17'),_0x1105aa);_0x56bbc1(_0x1105aa);})[_0xd0de('0xf')](function(_0x143ba0){logger[_0xd0de('0x18')]('['+[_0x261606[_0xd0de('0xe')]()]+']',_0x143ba0[_0xd0de('0x10')]);_0x3985ab(_0x143ba0[_0xd0de('0x10')]);});}else{logger[_0xd0de('0xd')]('['+[_0x261606[_0xd0de('0xe')]()]+_0xd0de('0x19'));_0x1105aa['userId']=_0x1105aa[_0xd0de('0xb')];_0x1105aa[_0xd0de('0x12')]=_0x1105aa[_0xd0de('0x16')];_0x56bbc1(_0x1105aa);}});};}function createEndUser(_0x3eb159,_0x542e52,_0xa3e26d,_0x9a850b,_0x2b18c9){logger[_0xd0de('0xd')]('['+[_0x3eb159[_0xd0de('0xe')]()]+_0xd0de('0x1a'),_0xa3e26d);return new Promise(function(_0x3731eb,_0x7f8cf0){var _0x19d130={'method':_0xd0de('0x1b'),'uri':_0x9a850b+_0xd0de('0x1c')+_0x2b18c9,'body':{'user_name':_0xa3e26d[_0xd0de('0x1d')],'roles':'user','first_name':_0xa3e26d['endUserNumber'],'active':_0xd0de('0x1e'),'date_format':'System','phone':_0xa3e26d['endUserNumber']},'auth':_0x542e52,'json':!![]};return rp(_0x19d130)[_0xd0de('0x8')](function(_0x1b33be){logger[_0xd0de('0xd')]('['+[_0x3eb159[_0xd0de('0xe')]()]+_0xd0de('0x1f'),_0x1b33be[_0xd0de('0x9')]);_0xa3e26d[_0xd0de('0x20')]=_0x1b33be[_0xd0de('0x9')][_0xd0de('0xc')];_0x3731eb(_0xa3e26d);})[_0xd0de('0xf')](function(_0x4d00f9){logger[_0xd0de('0x18')]('['+[_0x3eb159[_0xd0de('0xe')]()]+']',_0x4d00f9[_0xd0de('0x10')]);_0x7f8cf0(_0x4d00f9['message']);});});}function getEndUser(_0x5c3ffa,_0x444f6b,_0x22d58c,_0x29c5be,_0x5abe82){return function(_0x152eca){logger[_0xd0de('0xd')]('['+[_0x5c3ffa['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x152eca);return new Promise(function(_0x2c27dc,_0xd9eee2){var _0x427c0a={'method':_0xd0de('0x7'),'uri':_0x22d58c+_0xd0de('0x21')+_0x152eca[_0xd0de('0x1d')]+'&'+_0x29c5be+'&'+_0x5abe82,'auth':_0x444f6b,'json':!![]};return rp(_0x427c0a)[_0xd0de('0x8')](function(_0x1faf7c){if(_0x1faf7c[_0xd0de('0x9')]['length']>0x0){_0x152eca[_0xd0de('0x20')]=_0x1faf7c[_0xd0de('0x9')][0x0][_0xd0de('0xc')];logger['info']('['+[_0x5c3ffa[_0xd0de('0xe')]()]+_0xd0de('0x22'),_0x152eca);_0x2c27dc(_0x152eca);}else{return createEndUser(_0x5c3ffa,_0x444f6b,_0x152eca,_0x22d58c,_0x29c5be)[_0xd0de('0x8')](function(_0x56b8fd){logger[_0xd0de('0xd')]('['+[_0x5c3ffa[_0xd0de('0xe')]()]+_0xd0de('0x23'),_0x56b8fd);_0x2c27dc(_0x56b8fd);});}})[_0xd0de('0xf')](function(_0x84a06f){logger[_0xd0de('0x18')]('['+[_0x5c3ffa[_0xd0de('0xe')]()]+']',_0x84a06f['message']);_0xd9eee2(_0x84a06f[_0xd0de('0x10')]);});});};}function getCustomFields(_0x5ba74c,_0x2f286a){var _0x49e917={};if(_0x5ba74c[_0xd0de('0xa')]>0x0){_[_0xd0de('0x24')](_0x5ba74c,function(_0x2afe90){if(_[_0xd0de('0x25')]([_0xd0de('0x26'),_0xd0de('0x27')],_0x2afe90[_0xd0de('0x28')])&&_0x2afe90[_0xd0de('0x29')]&&!_0x2afe90['customField']){_0x49e917[_0x2afe90[_0xd0de('0x29')]['toLowerCase']()]=_0x2afe90[_0xd0de('0x2a')][_0xd0de('0x2b')]();}else if(_['includes'](['string','picklist'],_0x2afe90[_0xd0de('0x28')])&&_0x2afe90[_0xd0de('0x2c')]&&_0x2afe90['customField']){_0x49e917[_0x2afe90[_0xd0de('0x2c')][_0xd0de('0x2d')]()]=_0x2afe90[_0xd0de('0x2a')][_0xd0de('0x2b')]();}else if(_0x2afe90['type']===_0xd0de('0x2e')&&_0x2afe90['variableName']&&_0x2afe90[_0xd0de('0x2c')]&&_0x2afe90[_0xd0de('0x2f')]){_0x49e917[_0x2afe90['idField'][_0xd0de('0x2d')]()]=_0x2f286a[_0x2afe90[_0xd0de('0x30')]][_0xd0de('0x2b')]();}else if(_0x2afe90['type']===_0xd0de('0x31')&&_0x2afe90[_0xd0de('0x32')]&&_0x2afe90[_0xd0de('0x32')][_0xd0de('0x33')]&&_0x2afe90['idField']&&_0x2afe90[_0xd0de('0x2f')]){_0x49e917[_0x2afe90[_0xd0de('0x2c')]['toLowerCase']()]=_0x2f286a[_0x2afe90['Variable'][_0xd0de('0x33')][_0xd0de('0x2d')]()][_0xd0de('0x2b')]();}});}return _0x49e917;}function getTicket(_0x5e679e,_0x58b98b,_0x450bcb,_0x2a19dd,_0x14e754,_0x3ea19f){return function(_0x511ad4){logger[_0xd0de('0xd')]('['+[_0x5e679e[_0xd0de('0xe')]()]+']\x20getTicket\x20input\x20crm',_0x511ad4);return new Promise(function(_0x3c0ddf,_0x18ad26){var _0x472e00=_0x5e679e['toLowerCase']()===_0xd0de('0x34')?_0x511ad4[_0xd0de('0x35')]:_0x511ad4[_0xd0de('0x20')];var _0x8973e7={'method':'POST','uri':_0x450bcb+'incident'+'?'+_0x3ea19f,'body':Object[_0xd0de('0x36')]({},{'active':'true','caller_id':_0x472e00,'assigned_to':_0x511ad4['userId'],'short_description':intUtil[_0xd0de('0x37')](_0x2a19dd[_0xd0de('0x38')],_0x14e754,'\x20'),'description':intUtil['getString'](_0x2a19dd[_0xd0de('0x39')],_0x14e754,'\x0a')},getCustomFields(_0x2a19dd[_0xd0de('0x3a')],_0x14e754)),'auth':_0x58b98b,'json':!![]};return rp(_0x8973e7)['then'](function(_0x478bab){logger['info']('['+[_0x5e679e[_0xd0de('0xe')]()]+_0xd0de('0x3b'),_0x478bab[_0xd0de('0x9')]);_0x511ad4[_0xd0de('0x3c')]=_0x478bab[_0xd0de('0x9')][_0xd0de('0xc')];_0x511ad4[_0xd0de('0x3d')]=_0x478bab[_0xd0de('0x9')][_0xd0de('0x3e')];logger['info']('['+[_0x5e679e['toUpperCase']()]+_0xd0de('0x3f'),_0x511ad4);_0x3c0ddf(_0x511ad4);})['catch'](function(_0x7d2fe8){logger[_0xd0de('0x18')]('['+[_0x5e679e[_0xd0de('0xe')]()]+']',_0x7d2fe8[_0xd0de('0x10')]);_0x18ad26(_0x7d2fe8[_0xd0de('0x10')]);});});};}function createRemoteTag(_0x7d4525,_0x429173,_0x3666bd,_0x266753){return new Promise(function(_0x103fa1,_0x4dcfda){var _0x3e3dbe={'method':'POST','uri':_0x3666bd+_0xd0de('0x40')+'?'+_0x266753,'body':{'short_description':_0x7d4525,'global':!![],'active':!![],'name':_0x7d4525},'auth':_0x429173,'json':!![]};return rp(_0x3e3dbe)[_0xd0de('0x8')](function(_0x36742f){var _0x202827=_0x36742f['result'][_0xd0de('0xc')];_0x103fa1(_0x202827);});});}function getRemoteTag(_0x4ab188,_0x41f5d6,_0x1601b0,_0x44fa0a,_0x541903){return new Promise(function(_0x1e070f,_0x349086){var _0x8fb3cb={'method':'GET','uri':_0x1601b0+_0xd0de('0x40')+'?sysparm_query=name%3D'+_0x4ab188+'&'+_0x44fa0a,'auth':_0x41f5d6,'json':!![]};return rp(_0x8fb3cb)['then'](function(_0x457ac9){if(_0x457ac9['result'][_0xd0de('0xa')]>0x0){var _0x13c627=_0x457ac9[_0xd0de('0x9')][0x0]['sys_id'];_0x1e070f(_0x13c627);}else{return createRemoteTag(_0x4ab188,_0x41f5d6,_0x1601b0,_0x44fa0a)['then'](function(_0x30b2c2){_0x1e070f(_0x30b2c2);});}});});}function assignTagToIncident(_0x505e3e,_0x171115,_0x294489,_0x50f516,_0xdd9a0c){return new Promise(function(_0x6b1616,_0x29eaa1){var _0x53d0a8={'method':_0xd0de('0x1b'),'uri':_0x294489+_0xd0de('0x41')+'?'+_0xdd9a0c,'body':{'label':_0x505e3e,'table':_0xd0de('0x42'),'id_type':_0xd0de('0x43'),'table_key':_0x50f516['ticketId'],'title':_0xd0de('0x44')+_0x50f516[_0xd0de('0x3d')],'id_display':_0x50f516['ticketNumber']},'auth':_0x171115,'json':!![]};return rp(_0x53d0a8)[_0xd0de('0x8')](function(_0x10a8ba){_0x6b1616();})[_0xd0de('0xf')](function(){_0x6b1616();});});}function manageTags(_0x2480b5,_0x3fcc09,_0x55dc64,_0x1bddea,_0x185409,_0x57c56e,_0x54c565){return new Promise(function(_0x3bcaa0,_0x26dbb1){var _0x58ca32=[];_0x3fcc09[_0xd0de('0x24')](function(_0x37812f){_0x58ca32['push'](getRemoteTag(_0x37812f,_0x55dc64,_0x1bddea,_0x57c56e,_0x54c565));});return Promise[_0xd0de('0x45')](_0x58ca32)[_0xd0de('0x8')](function(_0xe2bef0){if(_0xe2bef0[_0xd0de('0xa')]){logger['info']('['+[_0x2480b5[_0xd0de('0xe')]()]+_0xd0de('0x46'),_0xe2bef0);var _0x7195d5=[];_0xe2bef0[_0xd0de('0x24')](function(_0x26340c){_0x7195d5[_0xd0de('0x47')](assignTagToIncident(_0x26340c,_0x55dc64,_0x1bddea,_0x185409,_0x57c56e));});return Promise[_0xd0de('0x45')](_0x7195d5)[_0xd0de('0x8')](function(){_0x3bcaa0();})['catch'](function(){_0x3bcaa0();});}else{_0x3bcaa0();}});});}function getTags(_0x1cf011,_0x47c486,_0xf314f4,_0x5b7a00,_0x210b9c,_0x552757){return function(_0x5ecf07){return new Promise(function(_0x1d5470,_0x12c4c8){var _0x3d1352=[];var _0x5b549e=_0x5b7a00[_0xd0de('0x48')];if(_0x5b549e&&_0x5b549e[_0xd0de('0xa')]>0x0){_0x3d1352=_['map'](_0x5b549e,'name');}if(_0x3d1352[_0xd0de('0xa')]>0x0){return manageTags(_0x1cf011,_0x3d1352,_0x47c486,_0xf314f4,_0x5ecf07,_0x210b9c,_0x552757)[_0xd0de('0x8')](function(){_0x1d5470(_0x5ecf07);});}else{_0x1d5470(_0x5ecf07);}});};}function emit(_0xec1d24,_0x1a832d,_0xf3ad32){var _0x5df5b9='%26sysparm_record_target%3Dincident'+_0xd0de('0x49')+_0xd0de('0x4a')+'%255EORDERBYDESCnumber';var _0x1ef1e3={'uri':_0xec1d24+_0xd0de('0x4b')+_0xf3ad32+_0x5df5b9};io['to'](util[_0xd0de('0x4c')]('user:%s',_0x1a832d))[_0xd0de('0x4d')](_0xd0de('0x4e'),_0x1ef1e3);}exports['cs']=function(_0x1f38be,_0x1a40b5,_0x5c8db8,_0x435cd3,_0x1d9000,_0x5c40e0,_0x4db2af,_0x390873){var _0x1bfcb0={};var _0xf263c4={'user':_0x5c40e0[_0xd0de('0x4f')],'pass':_0x5c40e0[_0xd0de('0x50')]};var _0x439ec3=_0xd0de('0x51');var _0xc4f9a3=_0xd0de('0x52');_0x5c40e0['remoteUri']=intUtil[_0xd0de('0x53')](_0x5c40e0[_0xd0de('0x54')]);_0x5c40e0[_0xd0de('0x55')]=intUtil[_0xd0de('0x53')](_0x5c40e0[_0xd0de('0x55')]);var _0x532080=util[_0xd0de('0x4c')](_0xd0de('0x56'),_0x5c40e0[_0xd0de('0x54')]);_0x1bfcb0['userEmail']=!_[_0xd0de('0x57')](_0x435cd3)?_0x435cd3[_0xd0de('0x58')]:null;_0x1bfcb0['adminEmail']=_0x5c40e0[_0xd0de('0x58')];_0x1bfcb0[_0xd0de('0x1d')]=_0x390873[_0xd0de('0x2d')]()===_0xd0de('0x34')?_0x1a40b5[_0xd0de('0x59')]:_0x1a40b5['calleridnum'];_0x1bfcb0[_0xd0de('0x5a')]=_0x390873===_0xd0de('0x5b')||_0x390873===_0xd0de('0x5c')?_0xd0de('0x5b'):'outbound';var _0x149d46=util[_0xd0de('0x4c')](_0xd0de('0x5d'),_0x5c40e0[_0xd0de('0x55')],_0x1a40b5[_0xd0de('0x5e')],md5(_0x1a40b5['uniqueid']));if(_0x1d9000&&_0x1d9000[_0xd0de('0x5f')]){logger[_0xd0de('0xd')](_0xd0de('0x60'),_0xd0de('0x61'));_0x1a40b5[_0xd0de('0x62')]=_0x149d46;}else if(_0x4db2af&&_0x4db2af['recordingFormat']&&_0x4db2af['recordingFormat']!==_0xd0de('0x63')){logger[_0xd0de('0xd')](_0xd0de('0x64'),_0xd0de('0x61'));_0x1a40b5[_0xd0de('0x62')]=_0x149d46;}else{_0x1a40b5[_0xd0de('0x62')]='';}return getAdminUser(_0x390873,_0xf263c4,_0x1bfcb0,_0x532080,_0xc4f9a3,_0x439ec3)[_0xd0de('0x8')](getUser(_0x390873,_0xf263c4,_0x532080,_0xc4f9a3,_0x439ec3))[_0xd0de('0x8')](getEndUser(_0x390873,_0xf263c4,_0x532080,_0xc4f9a3,_0x439ec3))[_0xd0de('0x8')](getTicket(_0x390873,_0xf263c4,_0x532080,_0x5c8db8,_0x1a40b5,_0xc4f9a3))[_0xd0de('0x8')](function(_0xec7324){logger[_0xd0de('0xd')](util['format'](_0xd0de('0x65'),_0xec7324['ticketId']));logger['info'](util[_0xd0de('0x4c')](_0xd0de('0x66'),_0x390873));if(_0x390873!==_0xd0de('0x5c')){logger[_0xd0de('0xd')]('['+[_0x390873[_0xd0de('0xe')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5c40e0[_0xd0de('0x54')],_0x435cd3[_0xd0de('0x33')],_0xec7324[_0xd0de('0x3c')]);}})['catch'](function(_0x40ceca){logger[_0xd0de('0x18')]('['+[_0x390873[_0xd0de('0xe')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xd0de('0x67')](_0x40ceca,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 092a0d1..a7fb9aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1900=['[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','lastevent','toUpperCase','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','POST','info','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_minutes','parent_id','parent_type','name','direction','length','forEach','variableName','push','idField','set_entry','stringify','Calls','Basic\x20%s','apiKey','toString','base64','JSON','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','Contacts','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','type','string','toLowerCase','customField','custom_fields','content','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','uri','%s/service/v4_1/rest.php','monitor_format'];(function(_0x198bed,_0x5f04ba){var _0x3e5600=function(_0x201336){while(--_0x201336){_0x198bed['push'](_0x198bed['shift']());}};_0x3e5600(++_0x5f04ba);}(_0x1900,0x99));var _0x0190=function(_0x3b64a1,_0x25e298){_0x3b64a1=_0x3b64a1-0x0;var _0x3de574=_0x1900[_0x3b64a1];return _0x3de574;};'use strict';var _=require(_0x0190('0x0'));var rp=require('request-promise');var BPromise=require(_0x0190('0x1'));var md5=require(_0x0190('0x2'));var util=require(_0x0190('0x3'));var Redis=require(_0x0190('0x4'));var intUtil=require(_0x0190('0x5'));var config=require(_0x0190('0x6'));var logger=require(_0x0190('0x7'))('sugarcrm');config[_0x0190('0x8')]=_[_0x0190('0x9')](config[_0x0190('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0190('0x8')]));var def={'method':_0x0190('0xa'),'json':!![]};function emit(_0x41d784,_0x5b8aa4,_0x85984a){io['to'](_0x41d784)['emit'](_0x5b8aa4,_0x85984a);}function getTicket(_0x5af239,_0x4801b2,_0x567320,_0x498199,_0x1cc04a,_0x136050,_0x4cb8f4,_0x3ac2ef){logger[_0x0190('0xb')]('Creating\x20new\x20ticket...');var _0x57bc16=new Date();var _0x193427=[{'name':'name','value':intUtil[_0x0190('0xc')](_0x498199[_0x0190('0xd')],_0x1cc04a,'\x20')},{'name':_0x0190('0xe'),'value':_0x4801b2['id']},{'name':_0x0190('0xf'),'value':_0x4801b2['id']},{'name':_0x0190('0x10'),'value':intUtil[_0x0190('0xc')](_0x498199[_0x0190('0x11')],_0x1cc04a,'\x0a')},{'name':_0x0190('0x12'),'value':_0x57bc16['toISOString']()[_0x0190('0x13')](0x0,0x13)[_0x0190('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x0190('0x15'),'value':'15'},{'name':_0x0190('0x16'),'value':_0x567320['id']},{'name':_0x0190('0x17'),'value':'Contacts'},{'name':'parent_name','value':_0x567320[_0x0190('0x18')]},{'name':_0x0190('0x19'),'value':_0x3ac2ef}];if(_0x136050[_0x0190('0x1a')]){_[_0x0190('0x1b')](_0x136050,function(_0x2c1af9){if(_0x1cc04a[_0x2c1af9[_0x0190('0x1c')]]){_0x193427[_0x0190('0x1d')]({'name':_0x2c1af9[_0x0190('0x1e')],'value':_0x1cc04a[_0x2c1af9['variableName']]});}});}return request({'form':{'method':_0x0190('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x0190('0x20')]({'session':_0x4cb8f4['id'],'module_name':_0x0190('0x21'),'name_value_list':_0x193427})}});}function getAuth(_0x296b68){return util['format'](_0x0190('0x22'),new Buffer(_0x296b68[_0x0190('0x23')]+':X')[_0x0190('0x24')](_0x0190('0x25')));}function getServerInfo(_0x2711c0){return request({'form':{'method':'get_server_info','input_type':_0x0190('0x26'),'response_type':'JSON','rest_data':JSON[_0x0190('0x20')]({'session':_0x2711c0['id']})}});}function getUser(_0x3af8a3,_0x5dfdd8,_0x7934de){if(!_[_0x0190('0x27')](_0x5dfdd8)){logger[_0x0190('0xb')]('Getting\x20agent\x20with\x20name',_0x5dfdd8);return request({'form':{'method':_0x0190('0x28'),'input_type':_0x0190('0x26'),'response_type':_0x0190('0x26'),'rest_data':JSON['stringify']({'session':_0x7934de['id'],'module_name':_0x0190('0x29'),'query':util['format'](_0x0190('0x2a'),_0x5dfdd8),'order_by':'','offset':'0','select_fields':['id',_0x0190('0x18'),_0x0190('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0190('0x2c')](function(_0xbec0cf){if(_0xbec0cf[_0x0190('0x2d')][_0x0190('0x1a')]){var _0xdb07d8=_[_0x0190('0x2e')](_0xbec0cf['entry_list'],function(_0x19fd37){return _0x19fd37[_0x0190('0x2f')][_0x0190('0x2b')][_0x0190('0x30')]===_0x5dfdd8;});if(_0xdb07d8){logger[_0x0190('0xb')](_0x0190('0x31'));return BPromise['resolve']({'id':_0xdb07d8[_0x0190('0x2f')]['id'][_0x0190('0x30')],'name':_0xdb07d8[_0x0190('0x2f')][_0x0190('0x18')][_0x0190('0x30')]});}}logger[_0x0190('0xb')](_0x0190('0x32'));return BPromise[_0x0190('0x33')]({'id':_0x7934de[_0x0190('0x2f')][_0x0190('0x34')]['value'],'name':_0x7934de[_0x0190('0x2f')]['user_name']['value']});});}else{logger[_0x0190('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x0190('0x33')]({'id':_0x7934de[_0x0190('0x2f')][_0x0190('0x34')][_0x0190('0x30')],'name':_0x7934de[_0x0190('0x2f')][_0x0190('0x2b')][_0x0190('0x30')]});}}function getEndUser(_0x18d632,_0x38b293,_0x4abaf6,_0x1f610a){logger[_0x0190('0xb')](_0x0190('0x35'),_0x4abaf6);return request({'form':{'method':'get_entry_list','input_type':_0x0190('0x26'),'response_type':'JSON','rest_data':JSON[_0x0190('0x20')]({'session':_0x1f610a['id'],'module_name':_0x0190('0x36'),'query':util[_0x0190('0x37')](_0x0190('0x38'),_0x4abaf6),'order_by':'','offset':'0','select_fields':['id','name',_0x0190('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0190('0x2c')](function(_0x388d56){if(_0x388d56[_0x0190('0x2d')]['length']){var _0x572897=_[_0x0190('0x2e')](_0x388d56['entry_list'],function(_0x74e145){return _0x74e145['name_value_list']['phone_home'][_0x0190('0x30')]===_0x4abaf6;});if(_0x572897){logger[_0x0190('0xb')](_0x0190('0x3a'));return BPromise['resolve']({'id':_0x572897['name_value_list']['id'][_0x0190('0x30')],'name':_0x572897[_0x0190('0x2f')]['name'][_0x0190('0x30')],'phone':_0x572897[_0x0190('0x2f')]['phone_home'][_0x0190('0x30')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x0190('0x1f'),'input_type':_0x0190('0x26'),'response_type':_0x0190('0x26'),'rest_data':JSON['stringify']({'session':_0x1f610a['id'],'module_name':_0x0190('0x36'),'name_value_list':[{'name':_0x0190('0x3b'),'value':_0x38b293!==_0x0190('0x3c')?_0x38b293:util[_0x0190('0x37')](_0x0190('0x3d'),_0x4abaf6)},{'name':_0x0190('0x39'),'value':_0x4abaf6}]})}})['then'](function(_0x5742b3){logger['info'](_0x0190('0x3e'));return BPromise[_0x0190('0x33')]({'id':_0x5742b3['id'],'name':_0x5742b3['entry_list'][_0x0190('0x3b')]['value'],'phone':_0x5742b3['entry_list'][_0x0190('0x39')][_0x0190('0x30')]});});}});}function request(_0x1c3497){logger[_0x0190('0x3f')]('[HTTP]',JSON[_0x0190('0x20')](_0x1c3497));return rp(_[_0x0190('0x40')](def,_0x1c3497));}function getTags(_0x5bec5f,_0x20ddc3){var _0x5c626b=[];if(_0x5bec5f&&_0x5bec5f[_0x0190('0x1a')]>0x0){_0x5c626b=_[_0x0190('0x41')](_0x5bec5f,_0x20ddc3);}return _0x5c626b;}function getCustomFields(_0x107051,_0x5b0d85){var _0x4af58c=[];var _0x2b4fde={'custom_fields':[]};if(_0x107051[_0x0190('0x1a')]>0x0){_[_0x0190('0x1b')](_0x107051,function(_0x577e66){if(_0x577e66[_0x0190('0x42')]===_0x0190('0x43')&&_0x577e66['nameField']&&!_0x577e66['customField']){_0x2b4fde[_0x577e66['nameField'][_0x0190('0x44')]()]=_0x577e66['content'][_0x0190('0x24')]();}else if(_0x577e66['type']==='string'&&_0x577e66[_0x0190('0x1e')]&&_0x577e66[_0x0190('0x45')]){_0x2b4fde[_0x0190('0x46')][_0x0190('0x1d')]({'id':_0x577e66['idField'],'value':_0x577e66[_0x0190('0x47')]['toString']()});}else if(_0x577e66[_0x0190('0x42')]==='variable'&&_0x577e66[_0x0190('0x1c')]&&_0x577e66[_0x0190('0x1e')]&&_0x577e66[_0x0190('0x45')]){_0x5b0d85[_0x577e66[_0x0190('0x1c')]]&&_0x2b4fde[_0x0190('0x46')][_0x0190('0x1d')]({'id':_0x577e66[_0x0190('0x1e')],'value':_0x5b0d85[_0x577e66['variableName']][_0x0190('0x24')]()});}else if(_0x577e66[_0x0190('0x42')]===_0x0190('0x48')&&_0x577e66[_0x0190('0x49')]&&_0x577e66[_0x0190('0x49')]['name']&&_0x577e66[_0x0190('0x1e')]&&_0x577e66[_0x0190('0x45')]){_0x5b0d85[_0x577e66[_0x0190('0x49')][_0x0190('0x18')][_0x0190('0x44')]()]&&_0x2b4fde[_0x0190('0x46')][_0x0190('0x1d')]({'id':_0x577e66['idField'],'value':_0x5b0d85[_0x577e66['Variable'][_0x0190('0x18')][_0x0190('0x44')]()][_0x0190('0x24')]()});}});}return _0x2b4fde;}function getConnection(_0x32bd3d){return request({'method':_0x0190('0xa'),'form':{'method':_0x0190('0x4a'),'input_type':_0x0190('0x26'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x32bd3d[_0x0190('0x4b')],'password':_0x32bd3d[_0x0190('0x4c')],'encryption':'PLAIN'},'application':_0x0190('0x4d')})}})['then'](function(_0x39e03d){var _0xc2648b=_0x39e03d;if(_0xc2648b['id']){def[_0x0190('0x4e')]=_0xc2648b['id'];return BPromise[_0x0190('0x33')](_0xc2648b);}else{throw new Error(util['format'](_0x0190('0x4f'),_0x32bd3d['id']));}});}function setRelationship(_0x5a15db,_0x57376b,_0x4a7664,_0x123ef3){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5a15db['id'],'module_name':_0x0190('0x21'),'module_id':_0x4a7664['id'],'link_field_name':_0x123ef3,'related_ids':[_0x57376b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0190('0x50')]=function(_0xd64476,_0x3c2551,_0x4f1157,_0x26e65e,_0x184cf2,_0x3e22d9){var _0x3c2f68,_0x407e1d,_0x4ba05e,_0x574f2f;_0x3e22d9[_0x0190('0x51')]=intUtil['stripTrailingSlash'](_0x3e22d9[_0x0190('0x51')]);_0x3e22d9['serverUrl']=intUtil['stripTrailingSlash'](_0x3e22d9['serverUrl']);def[_0x0190('0x52')]=util[_0x0190('0x37')](_0x0190('0x53'),_0x3e22d9[_0x0190('0x51')]);if(_0x184cf2&&_0x184cf2[_0x0190('0x54')]){logger['info'](_0x0190('0x55'),_0x0190('0x56'));_0x3c2551['recordingURL']=util[_0x0190('0x37')](_0x0190('0x57'),_0x3e22d9[_0x0190('0x58')],_0x3c2551[_0x0190('0x59')],md5(_0x3c2551['uniqueid']));}else{_0x3c2551[_0x0190('0x5a')]='';}return getConnection(_0x3e22d9)[_0x0190('0x2c')](function(_0xd3a391){_0x574f2f=_0xd3a391;return getUser(_0x3e22d9,_0x26e65e[_0x0190('0x18')],_0x574f2f);})['then'](function(_0x1abc27){_0x3c2f68=_0x1abc27;logger[_0x0190('0xb')](_0x0190('0x5b'),_0x3c2f68['id']);return getEndUser(_0x3e22d9,_0x3c2551[_0x0190('0x5c')],_0x3c2551[_0x0190('0x5d')],_0x574f2f);})['then'](function(_0x5546de){_0x407e1d=_0x5546de;logger[_0x0190('0xb')](_0x0190('0x5e'),_0x407e1d['id']);return getTicket(_0x3e22d9,_0x3c2f68,_0x407e1d,_0x4f1157,_0x3c2551,_0x4f1157[_0x0190('0x5f')],_0x574f2f,_0x0190('0x60'));})[_0x0190('0x2c')](function(_0x345b2e){_0x4ba05e=_0x345b2e;logger['info'](_0x0190('0x61'));logger['info'](_0x0190('0x62'),_0x4ba05e['id']);return setRelationship(_0x574f2f,_0x3c2f68,_0x4ba05e,_0x0190('0x63'));})[_0x0190('0x2c')](function(){return setRelationship(_0x574f2f,_0x407e1d,_0x4ba05e,_0x0190('0x64'));})[_0x0190('0x2c')](function(){return getServerInfo(_0x574f2f);})['then'](function(_0x216d37){var _0x238e25=parseInt(_0x216d37[_0x0190('0x65')][_0x0190('0x66')](0x0));var _0x1d2591=util[_0x0190('0x37')](_0x0190('0x67'),_0x3e22d9[_0x0190('0x51')],_0x4ba05e['id']);if(_0x238e25>0x6){_0x1d2591=util['format'](_0x0190('0x68'),_0x3e22d9[_0x0190('0x51')],_0x4ba05e['id']);}logger[_0x0190('0xb')](_0x0190('0x55'),_0x0190('0x69'));emit(util[_0x0190('0x37')](_0x0190('0x6a'),_0x26e65e['name']),_0x0190('0x6b'),{'uri':_0x1d2591});})[_0x0190('0x6c')](function(_0x1a833c){logger[_0x0190('0x6d')](_0x0190('0x55'),JSON[_0x0190('0x20')](_0x1a833c));});};exports[_0x0190('0x6e')]=function(_0x52f396,_0x39a30e,_0x2a6eb2,_0x104230,_0x3ccc90,_0x333d9f,_0x547d0d){var _0x2f2639,_0x21e4b0,_0x38170f,_0x29e146;_0x333d9f[_0x0190('0x51')]=intUtil[_0x0190('0x6f')](_0x333d9f['remoteUri']);_0x333d9f['serverUrl']=intUtil[_0x0190('0x6f')](_0x333d9f[_0x0190('0x58')]);def['uri']=util[_0x0190('0x37')](_0x0190('0x53'),_0x333d9f['remoteUri']);if(_0x547d0d&&_0x547d0d['recordingFormat']&&_0x547d0d[_0x0190('0x70')]!=='none'){logger[_0x0190('0xb')](_0x0190('0x71'),_0x0190('0x56'));_0x39a30e['recordingURL']=util[_0x0190('0x37')](_0x0190('0x57'),_0x333d9f['serverUrl'],_0x39a30e[_0x0190('0x59')],md5(_0x39a30e[_0x0190('0x59')]));}return getConnection(_0x333d9f)[_0x0190('0x2c')](function(_0x191915){_0x29e146=_0x191915;return getUser(_0x333d9f,_0x104230['name'],_0x29e146);})[_0x0190('0x2c')](function(_0x124e9a){_0x2f2639=_0x124e9a;logger[_0x0190('0xb')](_0x0190('0x5b'),_0x2f2639['id']);return getEndUser(_0x333d9f,_0x39a30e[_0x0190('0x72')],_0x39a30e[_0x0190('0x73')],_0x29e146);})[_0x0190('0x2c')](function(_0x1f3fa7){_0x21e4b0=_0x1f3fa7;logger[_0x0190('0xb')]('The\x20Enduser\x20ID\x20is:',_0x21e4b0['id']);return getTicket(_0x333d9f,_0x2f2639,_0x21e4b0,_0x2a6eb2,_0x39a30e,_0x2a6eb2[_0x0190('0x5f')],_0x29e146,_0x0190('0x74'));})['then'](function(_0x2a1535){_0x38170f=_0x2a1535;logger['info'](_0x0190('0x61'));logger[_0x0190('0xb')](_0x0190('0x62'),_0x38170f['id']);return setRelationship(_0x29e146,_0x2f2639,_0x38170f,'users');})[_0x0190('0x2c')](function(){return setRelationship(_0x29e146,_0x21e4b0,_0x38170f,_0x0190('0x64'));})[_0x0190('0x2c')](function(){return getServerInfo(_0x29e146);})[_0x0190('0x2c')](function(_0x30d0d4){var _0x19db80=parseInt(_0x30d0d4[_0x0190('0x65')][_0x0190('0x66')](0x0));var _0x12984a=util[_0x0190('0x37')](_0x0190('0x67'),_0x333d9f[_0x0190('0x51')],_0x38170f['id']);if(_0x19db80>0x6){_0x12984a=util[_0x0190('0x37')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x333d9f[_0x0190('0x51')],_0x38170f['id']);}logger[_0x0190('0xb')]('[OUTBOUND]',_0x0190('0x69'));emit(util[_0x0190('0x37')](_0x0190('0x6a'),_0x104230[_0x0190('0x18')]),_0x0190('0x6b'),{'uri':_0x12984a});})[_0x0190('0x6c')](function(_0x4393af){logger[_0x0190('0x6d')](_0x0190('0x71'),JSON[_0x0190('0x20')](_0x4393af));});};exports['unmanaged']=function(_0x13f430,_0x20eb3e,_0x98625f,_0x98124b,_0x1234cd,_0x2946d4){var _0x5d868b,_0x25372e,_0x42aa0a,_0x1208fe;_0x2946d4['remoteUri']=intUtil[_0x0190('0x6f')](_0x2946d4[_0x0190('0x51')]);_0x2946d4[_0x0190('0x58')]=intUtil['stripTrailingSlash'](_0x2946d4[_0x0190('0x58')]);def[_0x0190('0x52')]=util['format'](_0x0190('0x53'),_0x2946d4['remoteUri']);if(_0x1234cd&&_0x1234cd[_0x0190('0x54')]){logger[_0x0190('0xb')]('['+_0x20eb3e[_0x0190('0x75')][_0x0190('0x76')]()+']',_0x0190('0x56'));_0x20eb3e[_0x0190('0x5a')]=util['format'](_0x0190('0x57'),_0x2946d4[_0x0190('0x58')],_0x20eb3e[_0x0190('0x59')],md5(_0x20eb3e[_0x0190('0x59')]));}else{_0x20eb3e['recordingURL']='';}return getConnection(_0x2946d4)[_0x0190('0x2c')](function(_0x534494){_0x1208fe=_0x534494;if(!_['isNil'](_0x98124b)){return getUser(_0x2946d4,_0x98124b[_0x0190('0x18')],_0x1208fe);}else{return getUser(_0x2946d4,null,_0x1208fe);}})['then'](function(_0x3c4c68){_0x5d868b=_0x3c4c68;logger[_0x0190('0xb')](_0x0190('0x5b'),_0x5d868b['id']);return getEndUser(_0x2946d4,_0x20eb3e[_0x0190('0x5c')],_0x20eb3e['calleridnum'],_0x1208fe);})[_0x0190('0x2c')](function(_0x8b5ff1){_0x25372e=_0x8b5ff1;logger[_0x0190('0xb')](_0x0190('0x5e'),_0x25372e['id']);return getTicket(_0x2946d4,_0x5d868b,_0x25372e,_0x98625f,_0x20eb3e,_0x98625f[_0x0190('0x5f')],_0x1208fe,'Inbound');})['then'](function(_0x1b31ea){_0x42aa0a=_0x1b31ea;logger[_0x0190('0xb')](_0x0190('0x61'));logger[_0x0190('0xb')](_0x0190('0x62'),_0x42aa0a['id']);return setRelationship(_0x1208fe,_0x5d868b,_0x42aa0a,'users');})[_0x0190('0x2c')](function(){return setRelationship(_0x1208fe,_0x25372e,_0x42aa0a,_0x0190('0x64'));})[_0x0190('0x2c')](function(){return getServerInfo(_0x1208fe);})[_0x0190('0x6c')](function(_0x1967b3){logger[_0x0190('0x6d')]('['+_0x20eb3e[_0x0190('0x75')][_0x0190('0x76')]()+']',JSON[_0x0190('0x20')](_0x1967b3));});};
\ No newline at end of file
+var _0x7a71=['uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','charAt','%s/service/v4_1/rest.php','lastevent','toUpperCase','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','info','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','debug','merge','map','type','string','customField','nameField','toLowerCase','content','custom_fields','push','variable','customVariable','Variable','login','username','password','PLAIN','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash'];(function(_0x3df482,_0x363c8d){var _0x2b99c2=function(_0x4943c9){while(--_0x4943c9){_0x3df482['push'](_0x3df482['shift']());}};_0x2b99c2(++_0x363c8d);}(_0x7a71,0x1a5));var _0x17a7=function(_0x144709,_0x525ecc){_0x144709=_0x144709-0x0;var _0x1ddae7=_0x7a71[_0x144709];return _0x1ddae7;};'use strict';var _=require('lodash');var rp=require(_0x17a7('0x0'));var BPromise=require(_0x17a7('0x1'));var md5=require(_0x17a7('0x2'));var util=require(_0x17a7('0x3'));var Redis=require(_0x17a7('0x4'));var intUtil=require(_0x17a7('0x5'));var config=require(_0x17a7('0x6'));var logger=require(_0x17a7('0x7'))(_0x17a7('0x8'));config[_0x17a7('0x9')]=_[_0x17a7('0xa')](config['redis'],{'host':_0x17a7('0xb'),'port':0x18eb});var io=require(_0x17a7('0xc'))(new Redis(config[_0x17a7('0x9')]));var def={'method':_0x17a7('0xd'),'json':!![]};function emit(_0x14ba0a,_0x33f242,_0x25ea43){io['to'](_0x14ba0a)[_0x17a7('0xe')](_0x33f242,_0x25ea43);}function getTicket(_0x3cd05c,_0x1e0399,_0x5d2916,_0x100137,_0x466c0d,_0x4a2501,_0x194831,_0x418788){logger['info'](_0x17a7('0xf'));var _0x48bbc9=new Date();var _0x40c4f0=[{'name':_0x17a7('0x10'),'value':intUtil['getString'](_0x100137['Subjects'],_0x466c0d,'\x20')},{'name':_0x17a7('0x11'),'value':_0x1e0399['id']},{'name':_0x17a7('0x12'),'value':_0x1e0399['id']},{'name':_0x17a7('0x13'),'value':intUtil[_0x17a7('0x14')](_0x100137[_0x17a7('0x15')],_0x466c0d,'\x0a')},{'name':_0x17a7('0x16'),'value':_0x48bbc9[_0x17a7('0x17')]()[_0x17a7('0x18')](0x0,0x13)[_0x17a7('0x19')]('T','\x20')},{'name':_0x17a7('0x1a'),'value':'0'},{'name':_0x17a7('0x1b'),'value':'15'},{'name':'parent_id','value':_0x5d2916['id']},{'name':_0x17a7('0x1c'),'value':'Contacts'},{'name':_0x17a7('0x1d'),'value':_0x5d2916['name']},{'name':_0x17a7('0x1e'),'value':_0x418788}];if(_0x4a2501[_0x17a7('0x1f')]){_[_0x17a7('0x20')](_0x4a2501,function(_0x21b71f){if(_0x466c0d[_0x21b71f[_0x17a7('0x21')]]){_0x40c4f0['push']({'name':_0x21b71f[_0x17a7('0x22')],'value':_0x466c0d[_0x21b71f[_0x17a7('0x21')]]});}});}return request({'form':{'method':_0x17a7('0x23'),'input_type':_0x17a7('0x24'),'response_type':_0x17a7('0x24'),'rest_data':JSON[_0x17a7('0x25')]({'session':_0x194831['id'],'module_name':_0x17a7('0x26'),'name_value_list':_0x40c4f0})}});}function getAuth(_0x1289bc){return util[_0x17a7('0x27')](_0x17a7('0x28'),new Buffer(_0x1289bc[_0x17a7('0x29')]+':X')[_0x17a7('0x2a')](_0x17a7('0x2b')));}function getServerInfo(_0x267120){return request({'form':{'method':_0x17a7('0x2c'),'input_type':_0x17a7('0x24'),'response_type':_0x17a7('0x24'),'rest_data':JSON[_0x17a7('0x25')]({'session':_0x267120['id']})}});}function getUser(_0x12ddf3,_0x5832dd,_0x536094){if(!_[_0x17a7('0x2d')](_0x5832dd)){logger['info'](_0x17a7('0x2e'),_0x5832dd);return request({'form':{'method':_0x17a7('0x2f'),'input_type':_0x17a7('0x24'),'response_type':_0x17a7('0x24'),'rest_data':JSON['stringify']({'session':_0x536094['id'],'module_name':'Employees','query':util['format'](_0x17a7('0x30'),_0x5832dd),'order_by':'','offset':'0','select_fields':['id',_0x17a7('0x10'),_0x17a7('0x31')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x17a7('0x32')](function(_0x87155){if(_0x87155[_0x17a7('0x33')][_0x17a7('0x1f')]){var _0x1e14d7=_[_0x17a7('0x34')](_0x87155[_0x17a7('0x33')],function(_0x265b19){return _0x265b19[_0x17a7('0x35')]['user_name'][_0x17a7('0x36')]===_0x5832dd;});if(_0x1e14d7){logger[_0x17a7('0x37')]('Agent\x20found!');return BPromise[_0x17a7('0x38')]({'id':_0x1e14d7[_0x17a7('0x35')]['id'][_0x17a7('0x36')],'name':_0x1e14d7[_0x17a7('0x35')]['name'][_0x17a7('0x36')]});}}logger['info'](_0x17a7('0x39'));return BPromise['resolve']({'id':_0x536094[_0x17a7('0x35')][_0x17a7('0x3a')][_0x17a7('0x36')],'name':_0x536094[_0x17a7('0x35')]['user_name'][_0x17a7('0x36')]});});}else{logger[_0x17a7('0x37')](_0x17a7('0x3b'));return BPromise[_0x17a7('0x38')]({'id':_0x536094[_0x17a7('0x35')]['user_id']['value'],'name':_0x536094[_0x17a7('0x35')]['user_name'][_0x17a7('0x36')]});}}function getEndUser(_0x21f466,_0x2f1a72,_0x3c2493,_0x39fc53){logger[_0x17a7('0x37')](_0x17a7('0x3c'),_0x3c2493);return request({'form':{'method':_0x17a7('0x2f'),'input_type':'JSON','response_type':_0x17a7('0x24'),'rest_data':JSON[_0x17a7('0x25')]({'session':_0x39fc53['id'],'module_name':_0x17a7('0x3d'),'query':util[_0x17a7('0x27')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x3c2493),'order_by':'','offset':'0','select_fields':['id',_0x17a7('0x10'),_0x17a7('0x3e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x17a7('0x32')](function(_0x5c2cf9){if(_0x5c2cf9[_0x17a7('0x33')][_0x17a7('0x1f')]){var _0x497102=_[_0x17a7('0x34')](_0x5c2cf9[_0x17a7('0x33')],function(_0x48642b){return _0x48642b[_0x17a7('0x35')][_0x17a7('0x3e')]['value']===_0x3c2493;});if(_0x497102){logger[_0x17a7('0x37')](_0x17a7('0x3f'));return BPromise[_0x17a7('0x38')]({'id':_0x497102['name_value_list']['id'][_0x17a7('0x36')],'name':_0x497102[_0x17a7('0x35')][_0x17a7('0x10')][_0x17a7('0x36')],'phone':_0x497102[_0x17a7('0x35')][_0x17a7('0x3e')][_0x17a7('0x36')]});}}else{logger[_0x17a7('0x37')](_0x17a7('0x40'));return request({'form':{'method':'set_entry','input_type':_0x17a7('0x24'),'response_type':_0x17a7('0x24'),'rest_data':JSON[_0x17a7('0x25')]({'session':_0x39fc53['id'],'module_name':_0x17a7('0x3d'),'name_value_list':[{'name':_0x17a7('0x41'),'value':_0x2f1a72!==_0x17a7('0x42')?_0x2f1a72:util[_0x17a7('0x27')](_0x17a7('0x43'),_0x3c2493)},{'name':_0x17a7('0x3e'),'value':_0x3c2493}]})}})['then'](function(_0x5d3007){logger[_0x17a7('0x37')]('Enduser\x20created.');return BPromise[_0x17a7('0x38')]({'id':_0x5d3007['id'],'name':_0x5d3007[_0x17a7('0x33')][_0x17a7('0x41')][_0x17a7('0x36')],'phone':_0x5d3007[_0x17a7('0x33')][_0x17a7('0x3e')][_0x17a7('0x36')]});});}});}function request(_0x1dac4d){logger[_0x17a7('0x44')]('[HTTP]',JSON[_0x17a7('0x25')](_0x1dac4d));return rp(_[_0x17a7('0x45')](def,_0x1dac4d));}function getTags(_0x53742e,_0x1a2264){var _0x2b40cd=[];if(_0x53742e&&_0x53742e['length']>0x0){_0x2b40cd=_[_0x17a7('0x46')](_0x53742e,_0x1a2264);}return _0x2b40cd;}function getCustomFields(_0x517864,_0x531193){var _0x4cd1e4=[];var _0x5a965a={'custom_fields':[]};if(_0x517864['length']>0x0){_[_0x17a7('0x20')](_0x517864,function(_0x29609d){if(_0x29609d[_0x17a7('0x47')]===_0x17a7('0x48')&&_0x29609d['nameField']&&!_0x29609d[_0x17a7('0x49')]){_0x5a965a[_0x29609d[_0x17a7('0x4a')][_0x17a7('0x4b')]()]=_0x29609d[_0x17a7('0x4c')][_0x17a7('0x2a')]();}else if(_0x29609d['type']===_0x17a7('0x48')&&_0x29609d[_0x17a7('0x22')]&&_0x29609d[_0x17a7('0x49')]){_0x5a965a[_0x17a7('0x4d')][_0x17a7('0x4e')]({'id':_0x29609d[_0x17a7('0x22')],'value':_0x29609d['content'][_0x17a7('0x2a')]()});}else if(_0x29609d['type']===_0x17a7('0x4f')&&_0x29609d[_0x17a7('0x21')]&&_0x29609d[_0x17a7('0x22')]&&_0x29609d[_0x17a7('0x49')]){_0x531193[_0x29609d['variableName']]&&_0x5a965a['custom_fields'][_0x17a7('0x4e')]({'id':_0x29609d['idField'],'value':_0x531193[_0x29609d[_0x17a7('0x21')]][_0x17a7('0x2a')]()});}else if(_0x29609d[_0x17a7('0x47')]===_0x17a7('0x50')&&_0x29609d[_0x17a7('0x51')]&&_0x29609d[_0x17a7('0x51')]['name']&&_0x29609d[_0x17a7('0x22')]&&_0x29609d[_0x17a7('0x49')]){_0x531193[_0x29609d[_0x17a7('0x51')][_0x17a7('0x10')]['toLowerCase']()]&&_0x5a965a[_0x17a7('0x4d')][_0x17a7('0x4e')]({'id':_0x29609d[_0x17a7('0x22')],'value':_0x531193[_0x29609d[_0x17a7('0x51')][_0x17a7('0x10')]['toLowerCase']()][_0x17a7('0x2a')]()});}});}return _0x5a965a;}function getConnection(_0x3df172){return request({'method':_0x17a7('0xd'),'form':{'method':_0x17a7('0x52'),'input_type':'JSON','response_type':_0x17a7('0x24'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3df172[_0x17a7('0x53')],'password':_0x3df172[_0x17a7('0x54')],'encryption':_0x17a7('0x55')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x150481){var _0x42218a=_0x150481;if(_0x42218a['id']){def[_0x17a7('0x56')]=_0x42218a['id'];return BPromise['resolve'](_0x42218a);}else{throw new Error(util[_0x17a7('0x27')]('Account\x20%d\x20is\x20not\x20valid',_0x3df172['id']));}});}function setRelationship(_0x32ed1b,_0x436837,_0x2ac2df,_0x397427){return request({'form':{'method':_0x17a7('0x57'),'input_type':_0x17a7('0x24'),'response_type':_0x17a7('0x24'),'rest_data':JSON['stringify']({'session':_0x32ed1b['id'],'module_name':_0x17a7('0x26'),'module_id':_0x2ac2df['id'],'link_field_name':_0x397427,'related_ids':[_0x436837['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x17a7('0x58')]=function(_0x113e60,_0x4646d2,_0x1176de,_0x1ac038,_0x34b113,_0x381d3a){var _0x1c5b14,_0x38ec9a,_0x10b0e3,_0x4a0fec;_0x381d3a[_0x17a7('0x59')]=intUtil[_0x17a7('0x5a')](_0x381d3a[_0x17a7('0x59')]);_0x381d3a['serverUrl']=intUtil[_0x17a7('0x5a')](_0x381d3a['serverUrl']);def[_0x17a7('0x5b')]=util[_0x17a7('0x27')]('%s/service/v4_1/rest.php',_0x381d3a[_0x17a7('0x59')]);if(_0x34b113&&_0x34b113[_0x17a7('0x5c')]){logger[_0x17a7('0x37')](_0x17a7('0x5d'),_0x17a7('0x5e'));_0x4646d2[_0x17a7('0x5f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x381d3a[_0x17a7('0x60')],_0x4646d2[_0x17a7('0x61')],md5(_0x4646d2[_0x17a7('0x61')]));}else{_0x4646d2[_0x17a7('0x5f')]='';}return getConnection(_0x381d3a)['then'](function(_0x2416c2){_0x4a0fec=_0x2416c2;return getUser(_0x381d3a,_0x1ac038[_0x17a7('0x10')],_0x4a0fec);})[_0x17a7('0x32')](function(_0x5c6390){_0x1c5b14=_0x5c6390;logger[_0x17a7('0x37')](_0x17a7('0x62'),_0x1c5b14['id']);return getEndUser(_0x381d3a,_0x4646d2[_0x17a7('0x63')],_0x4646d2[_0x17a7('0x64')],_0x4a0fec);})[_0x17a7('0x32')](function(_0x2623c1){_0x38ec9a=_0x2623c1;logger[_0x17a7('0x37')](_0x17a7('0x65'),_0x38ec9a['id']);return getTicket(_0x381d3a,_0x1c5b14,_0x38ec9a,_0x1176de,_0x4646d2,_0x1176de[_0x17a7('0x66')],_0x4a0fec,_0x17a7('0x67'));})[_0x17a7('0x32')](function(_0x2429b4){_0x10b0e3=_0x2429b4;logger[_0x17a7('0x37')](_0x17a7('0x68'));logger[_0x17a7('0x37')]('The\x20Ticket\x20ID\x20is:',_0x10b0e3['id']);return setRelationship(_0x4a0fec,_0x1c5b14,_0x10b0e3,_0x17a7('0x69'));})[_0x17a7('0x32')](function(){return setRelationship(_0x4a0fec,_0x38ec9a,_0x10b0e3,_0x17a7('0x6a'));})[_0x17a7('0x32')](function(){return getServerInfo(_0x4a0fec);})[_0x17a7('0x32')](function(_0x5102d7){var _0x5c3e5f=parseInt(_0x5102d7[_0x17a7('0x6b')]['charAt'](0x0));var _0x211068=util[_0x17a7('0x27')](_0x17a7('0x6c'),_0x381d3a['remoteUri'],_0x10b0e3['id']);if(_0x5c3e5f>0x6){_0x211068=util[_0x17a7('0x27')](_0x17a7('0x6d'),_0x381d3a[_0x17a7('0x59')],_0x10b0e3['id']);}logger[_0x17a7('0x37')](_0x17a7('0x5d'),_0x17a7('0x6e'));emit(util[_0x17a7('0x27')](_0x17a7('0x6f'),_0x1ac038['name']),_0x17a7('0x70'),{'uri':_0x211068});})[_0x17a7('0x71')](function(_0x367344){logger[_0x17a7('0x72')](_0x17a7('0x5d'),JSON[_0x17a7('0x25')](_0x367344));});};exports[_0x17a7('0x73')]=function(_0x2627b2,_0x26d8a7,_0x561e16,_0x4c5576,_0x414b40,_0x494394,_0x5b4682){var _0x454340,_0x1d402c,_0x187e36,_0xf2ea35;_0x494394[_0x17a7('0x59')]=intUtil[_0x17a7('0x5a')](_0x494394[_0x17a7('0x59')]);_0x494394[_0x17a7('0x60')]=intUtil[_0x17a7('0x5a')](_0x494394[_0x17a7('0x60')]);def[_0x17a7('0x5b')]=util[_0x17a7('0x27')]('%s/service/v4_1/rest.php',_0x494394[_0x17a7('0x59')]);if(_0x5b4682&&_0x5b4682[_0x17a7('0x74')]&&_0x5b4682[_0x17a7('0x74')]!==_0x17a7('0x75')){logger[_0x17a7('0x37')](_0x17a7('0x76'),_0x17a7('0x5e'));_0x26d8a7['recordingURL']=util[_0x17a7('0x27')](_0x17a7('0x77'),_0x494394[_0x17a7('0x60')],_0x26d8a7[_0x17a7('0x61')],md5(_0x26d8a7['uniqueid']));}return getConnection(_0x494394)[_0x17a7('0x32')](function(_0xd48061){_0xf2ea35=_0xd48061;return getUser(_0x494394,_0x4c5576[_0x17a7('0x10')],_0xf2ea35);})[_0x17a7('0x32')](function(_0x126b95){_0x454340=_0x126b95;logger[_0x17a7('0x37')](_0x17a7('0x62'),_0x454340['id']);return getEndUser(_0x494394,_0x26d8a7[_0x17a7('0x78')],_0x26d8a7[_0x17a7('0x79')],_0xf2ea35);})[_0x17a7('0x32')](function(_0x42b269){_0x1d402c=_0x42b269;logger[_0x17a7('0x37')]('The\x20Enduser\x20ID\x20is:',_0x1d402c['id']);return getTicket(_0x494394,_0x454340,_0x1d402c,_0x561e16,_0x26d8a7,_0x561e16[_0x17a7('0x66')],_0xf2ea35,_0x17a7('0x7a'));})[_0x17a7('0x32')](function(_0x11dbec){_0x187e36=_0x11dbec;logger[_0x17a7('0x37')]('Ticket\x20created!');logger[_0x17a7('0x37')](_0x17a7('0x7b'),_0x187e36['id']);return setRelationship(_0xf2ea35,_0x454340,_0x187e36,'users');})[_0x17a7('0x32')](function(){return setRelationship(_0xf2ea35,_0x1d402c,_0x187e36,_0x17a7('0x6a'));})[_0x17a7('0x32')](function(){return getServerInfo(_0xf2ea35);})[_0x17a7('0x32')](function(_0x7b6ec9){var _0x927898=parseInt(_0x7b6ec9['version'][_0x17a7('0x7c')](0x0));var _0x51a07c=util[_0x17a7('0x27')](_0x17a7('0x6c'),_0x494394[_0x17a7('0x59')],_0x187e36['id']);if(_0x927898>0x6){_0x51a07c=util[_0x17a7('0x27')](_0x17a7('0x6d'),_0x494394['remoteUri'],_0x187e36['id']);}logger[_0x17a7('0x37')](_0x17a7('0x76'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x17a7('0x27')](_0x17a7('0x6f'),_0x4c5576[_0x17a7('0x10')]),_0x17a7('0x70'),{'uri':_0x51a07c});})[_0x17a7('0x71')](function(_0x4fe844){logger[_0x17a7('0x72')](_0x17a7('0x76'),JSON['stringify'](_0x4fe844));});};exports['unmanaged']=function(_0x2d295f,_0x1d4451,_0x1ab589,_0x431ed8,_0x2fec96,_0x57dcb8){var _0x4337f9,_0x20f6d1,_0x559ef6,_0x5a6c81;_0x57dcb8['remoteUri']=intUtil[_0x17a7('0x5a')](_0x57dcb8[_0x17a7('0x59')]);_0x57dcb8[_0x17a7('0x60')]=intUtil['stripTrailingSlash'](_0x57dcb8[_0x17a7('0x60')]);def[_0x17a7('0x5b')]=util[_0x17a7('0x27')](_0x17a7('0x7d'),_0x57dcb8[_0x17a7('0x59')]);if(_0x2fec96&&_0x2fec96[_0x17a7('0x5c')]){logger['info']('['+_0x1d4451[_0x17a7('0x7e')][_0x17a7('0x7f')]()+']',_0x17a7('0x5e'));_0x1d4451[_0x17a7('0x5f')]=util[_0x17a7('0x27')](_0x17a7('0x77'),_0x57dcb8[_0x17a7('0x60')],_0x1d4451['uniqueid'],md5(_0x1d4451['uniqueid']));}else{_0x1d4451['recordingURL']='';}return getConnection(_0x57dcb8)[_0x17a7('0x32')](function(_0x1fbf89){_0x5a6c81=_0x1fbf89;if(!_[_0x17a7('0x2d')](_0x431ed8)){return getUser(_0x57dcb8,_0x431ed8[_0x17a7('0x10')],_0x5a6c81);}else{return getUser(_0x57dcb8,null,_0x5a6c81);}})['then'](function(_0x1ad25a){_0x4337f9=_0x1ad25a;logger[_0x17a7('0x37')](_0x17a7('0x62'),_0x4337f9['id']);return getEndUser(_0x57dcb8,_0x1d4451[_0x17a7('0x63')],_0x1d4451[_0x17a7('0x64')],_0x5a6c81);})[_0x17a7('0x32')](function(_0x1ef2c1){_0x20f6d1=_0x1ef2c1;logger[_0x17a7('0x37')](_0x17a7('0x65'),_0x20f6d1['id']);return getTicket(_0x57dcb8,_0x4337f9,_0x20f6d1,_0x1ab589,_0x1d4451,_0x1ab589['Fields'],_0x5a6c81,'Inbound');})[_0x17a7('0x32')](function(_0x46f8bd){_0x559ef6=_0x46f8bd;logger[_0x17a7('0x37')](_0x17a7('0x68'));logger['info'](_0x17a7('0x7b'),_0x559ef6['id']);return setRelationship(_0x5a6c81,_0x4337f9,_0x559ef6,_0x17a7('0x69'));})[_0x17a7('0x32')](function(){return setRelationship(_0x5a6c81,_0x20f6d1,_0x559ef6,_0x17a7('0x6a'));})[_0x17a7('0x32')](function(){return getServerInfo(_0x5a6c81);})['catch'](function(_0x290aad){logger['error']('['+_0x1d4451[_0x17a7('0x7e')]['toUpperCase']()+']',JSON['stringify'](_0x290aad));});};
\ No newline at end of file
index 5089f54..8dde781 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26e8=['%s:\x20%s','variableName','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','getString','sortBy','length','type','string','push','content','variable','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','keyContent','key'];(function(_0x48e9bf,_0x52ebde){var _0x364d02=function(_0x45fbd7){while(--_0x45fbd7){_0x48e9bf['push'](_0x48e9bf['shift']());}};_0x364d02(++_0x52ebde);}(_0x26e8,0x168));var _0x826e=function(_0x348efb,_0x3fdb02){_0x348efb=_0x348efb-0x0;var _0x3f7332=_0x26e8[_0x348efb];return _0x3f7332;};'use strict';var _=require('lodash');var util=require('util');exports[_0x826e('0x0')]=function(_0x11a832,_0x41d768,_0x17d038){var _0x5a2aa9=[];if(_0x11a832['length']>0x0){var _0x2b855d=_[_0x826e('0x1')](_0x11a832,['id']);for(var _0x8a6fa6=0x0;_0x8a6fa6<_0x2b855d[_0x826e('0x2')];_0x8a6fa6++){var _0x385d0e=_0x2b855d[_0x8a6fa6];if(_0x385d0e[_0x826e('0x3')]===_0x826e('0x4')){_0x5a2aa9[_0x826e('0x5')](_0x385d0e[_0x826e('0x6')]);}else if(_0x385d0e[_0x826e('0x3')]===_0x826e('0x7')&&_0x385d0e['variableName']){_0x41d768[_0x385d0e['variableName']]&&_0x5a2aa9[_0x826e('0x5')](_0x41d768[_0x385d0e['variableName']][_0x826e('0x8')]());}else if(_0x385d0e[_0x826e('0x3')]===_0x826e('0x9')&&_0x385d0e[_0x826e('0xa')]&&_0x385d0e[_0x826e('0xa')][_0x826e('0xb')]){_0x41d768[_0x385d0e[_0x826e('0xa')][_0x826e('0xb')][_0x826e('0xc')]()]&&_0x5a2aa9[_0x826e('0x5')](_0x41d768[_0x385d0e[_0x826e('0xa')]['name']['toLowerCase']()][_0x826e('0x8')]());}else if(_0x385d0e[_0x826e('0x3')]===_0x826e('0xd')){if(_0x385d0e[_0x826e('0xe')]===_0x826e('0x4')&&_0x385d0e['key']){_0x5a2aa9['push'](util[_0x826e('0xf')]('%s:\x20%s',_0x385d0e['key'],_0x385d0e[_0x826e('0x10')]));}else if(_0x385d0e[_0x826e('0xe')]===_0x826e('0x7')&&_0x385d0e['variableName']&&_0x385d0e[_0x826e('0x11')]){_0x41d768[_0x385d0e['variableName']]&&_0x5a2aa9['push'](util[_0x826e('0xf')](_0x826e('0x12'),_0x385d0e[_0x826e('0x11')],_0x41d768[_0x385d0e[_0x826e('0x13')]]));}else if(_0x385d0e[_0x826e('0xe')]===_0x826e('0x9')&&_0x385d0e[_0x826e('0xa')]&&_0x385d0e[_0x826e('0xa')]['name']&&_0x385d0e['key']){_0x41d768[_0x385d0e[_0x826e('0xa')][_0x826e('0xb')]['toLowerCase']()]&&_0x5a2aa9[_0x826e('0x5')](util['format'](_0x826e('0x12'),_0x385d0e['key'],_0x41d768[_0x385d0e[_0x826e('0xa')]['name'][_0x826e('0xc')]()]));}}}}return _0x5a2aa9[_0x826e('0x14')](_0x17d038);};exports[_0x826e('0x15')]=function(_0x4956b3){var _0x33cac0=_0x4956b3[_0x826e('0x16')](-0x1);if(_0x33cac0==='/'){_0x4956b3=_0x4956b3[_0x826e('0x17')](0x0,_0x4956b3[_0x826e('0x18')](_0x33cac0));}return _0x4956b3;};exports['validateEmail']=function(_0x510f65){if(!_[_0x826e('0x19')](_0x510f65)&&_0x510f65!==''){var _0x3af3f3=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x3af3f3[_0x826e('0x1a')](String(_0x510f65)[_0x826e('0xc')]());}else{return![];}};
\ No newline at end of file
+var _0x5a3c=['test','lodash','util','getString','length','sortBy','string','push','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','keyContent','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil'];(function(_0x14e1cb,_0xd3465e){var _0x18a337=function(_0x3b97f3){while(--_0x3b97f3){_0x14e1cb['push'](_0x14e1cb['shift']());}};_0x18a337(++_0xd3465e);}(_0x5a3c,0x16d));var _0xc5a3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5a3c[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc5a3('0x0'));var util=require(_0xc5a3('0x1'));exports[_0xc5a3('0x2')]=function(_0x53cbb1,_0x3c2816,_0x3bd628){var _0xcc5850=[];if(_0x53cbb1[_0xc5a3('0x3')]>0x0){var _0x2353f3=_[_0xc5a3('0x4')](_0x53cbb1,['id']);for(var _0xbd5734=0x0;_0xbd5734<_0x2353f3[_0xc5a3('0x3')];_0xbd5734++){var _0x2b4312=_0x2353f3[_0xbd5734];if(_0x2b4312['type']===_0xc5a3('0x5')){_0xcc5850[_0xc5a3('0x6')](_0x2b4312['content']);}else if(_0x2b4312[_0xc5a3('0x7')]===_0xc5a3('0x8')&&_0x2b4312[_0xc5a3('0x9')]){_0x3c2816[_0x2b4312[_0xc5a3('0x9')]]&&_0xcc5850[_0xc5a3('0x6')](_0x3c2816[_0x2b4312[_0xc5a3('0x9')]][_0xc5a3('0xa')]());}else if(_0x2b4312[_0xc5a3('0x7')]===_0xc5a3('0xb')&&_0x2b4312[_0xc5a3('0xc')]&&_0x2b4312[_0xc5a3('0xc')][_0xc5a3('0xd')]){_0x3c2816[_0x2b4312[_0xc5a3('0xc')][_0xc5a3('0xd')][_0xc5a3('0xe')]()]&&_0xcc5850[_0xc5a3('0x6')](_0x3c2816[_0x2b4312['Variable'][_0xc5a3('0xd')][_0xc5a3('0xe')]()]['toString']());}else if(_0x2b4312['type']===_0xc5a3('0xf')){if(_0x2b4312[_0xc5a3('0x10')]===_0xc5a3('0x5')&&_0x2b4312[_0xc5a3('0x11')]){_0xcc5850[_0xc5a3('0x6')](util[_0xc5a3('0x12')]('%s:\x20%s',_0x2b4312[_0xc5a3('0x11')],_0x2b4312[_0xc5a3('0x13')]));}else if(_0x2b4312[_0xc5a3('0x10')]===_0xc5a3('0x8')&&_0x2b4312[_0xc5a3('0x9')]&&_0x2b4312[_0xc5a3('0x11')]){_0x3c2816[_0x2b4312[_0xc5a3('0x9')]]&&_0xcc5850[_0xc5a3('0x6')](util[_0xc5a3('0x12')]('%s:\x20%s',_0x2b4312['key'],_0x3c2816[_0x2b4312['variableName']]));}else if(_0x2b4312[_0xc5a3('0x10')]===_0xc5a3('0xb')&&_0x2b4312[_0xc5a3('0xc')]&&_0x2b4312[_0xc5a3('0xc')][_0xc5a3('0xd')]&&_0x2b4312[_0xc5a3('0x11')]){_0x3c2816[_0x2b4312[_0xc5a3('0xc')][_0xc5a3('0xd')][_0xc5a3('0xe')]()]&&_0xcc5850['push'](util[_0xc5a3('0x12')](_0xc5a3('0x14'),_0x2b4312[_0xc5a3('0x11')],_0x3c2816[_0x2b4312[_0xc5a3('0xc')]['name'][_0xc5a3('0xe')]()]));}}}}return _0xcc5850[_0xc5a3('0x15')](_0x3bd628);};exports[_0xc5a3('0x16')]=function(_0x30843d){var _0x1c5238=_0x30843d['slice'](-0x1);if(_0x1c5238==='/'){_0x30843d=_0x30843d[_0xc5a3('0x17')](0x0,_0x30843d[_0xc5a3('0x18')](_0x1c5238));}return _0x30843d;};exports[_0xc5a3('0x19')]=function(_0xd399b){if(!_[_0xc5a3('0x1a')](_0xd399b)&&_0xd399b!==''){var _0x48d1f0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x48d1f0[_0xc5a3('0x1b')](String(_0xd399b)[_0xc5a3('0xe')]());}else{return![];}};
\ No newline at end of file
index c910c05..9f781c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x66c8ee,_0x50072e){var _0x1fe277=function(_0x456b84){while(--_0x456b84){_0x66c8ee['push'](_0x66c8ee['shift']());}};_0x1fe277(++_0x50072e);}(_0x34e8,0x12c));var _0x834e=function(_0x4329f4,_0xd4ddf3){_0x4329f4=_0x4329f4-0x0;var _0x4c57ec=_0x34e8[_0x4329f4];return _0x4c57ec;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});};
\ No newline at end of file
+var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
index 3eea970..c72fb94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46a8=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','format','%s/tickets.json','remoteUri','merge','Tags','name','Subjects','getString','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','base64','[HTTP]','stringify','GET','forEach','type','nameField','customField','toLowerCase','content','includes','string','picklist','idField','push','toString','variable','variableName','customVariable','Variable','custom_fields','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x46a8,0x103));var _0x846a=function(_0x551e2e,_0x56d217){_0x551e2e=_0x551e2e-0x0;var _0x3927e7=_0x46a8[_0x551e2e];return _0x3927e7;};'use strict';var _=require(_0x846a('0x0'));var rp=require(_0x846a('0x1'));var md5=require(_0x846a('0x2'));var util=require(_0x846a('0x3'));var Redis=require(_0x846a('0x4'));var intUtil=require(_0x846a('0x5'));var config=require('../../../../config/environment');var logger=require(_0x846a('0x6'))(_0x846a('0x7'));config[_0x846a('0x8')]=_[_0x846a('0x9')](config[_0x846a('0x8')],{'host':_0x846a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x846a('0x8')]));function emit(_0x2730d5,_0x58cd8a,_0x3ec1ca){io['to'](_0x2730d5)[_0x846a('0xb')](_0x58cd8a,_0x3ec1ca);}var headers={'Content-Type':_0x846a('0xc'),'Accept':_0x846a('0xc')};function getTicket(_0x3a55da,_0x11ae2c,_0x25c9ab,_0x35bcbd,_0x2c7c72){logger[_0x846a('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x846a('0xe')](_0x846a('0xf'),_0x3a55da[_0x846a('0x10')]),'method':'POST','body':{'ticket':_[_0x846a('0x11')]({'requester_id':_0x25c9ab['id'],'submitter_id':_0x11ae2c?_0x11ae2c['id']:undefined,'assignee_id':_0x11ae2c?_0x11ae2c['id']:undefined,'tags':getTags(_0x35bcbd[_0x846a('0x12')],_0x846a('0x13')),'subject':intUtil['getString'](_0x35bcbd[_0x846a('0x14')],_0x2c7c72,'\x20'),'description':intUtil[_0x846a('0x15')](_0x35bcbd['Descriptions'],_0x2c7c72,'\x0a'),'comment':{'public':![],'body':intUtil[_0x846a('0x15')](_0x35bcbd[_0x846a('0x16')],_0x2c7c72,'\x0a')}},getCustomFields(_0x35bcbd['Fields'],_0x2c7c72))}})[_0x846a('0x17')](function(_0x58e76e){logger[_0x846a('0xd')](_0x846a('0x18'));return _0x58e76e[_0x846a('0x19')];});}function getUser(_0x3ab7e,_0x1ffafa){if(intUtil['validateEmail'](_0x1ffafa)){logger[_0x846a('0xd')](_0x846a('0x1a'),_0x1ffafa);return request({'uri':util['format'](_0x846a('0x1b'),_0x3ab7e[_0x846a('0x10')]),'qs':{'query':util['format'](_0x846a('0x1c'),_0x1ffafa)}})[_0x846a('0x17')](function(_0x354dbd){if(_0x354dbd[_0x846a('0x1d')]){logger[_0x846a('0xd')](_0x846a('0x1e'));return _[_0x846a('0x1f')](_0x354dbd[_0x846a('0x20')],{'email':_0x1ffafa,'role':_0x846a('0x21')});}else{logger[_0x846a('0xd')](_0x846a('0x22'));return request({'uri':util[_0x846a('0xe')]('%s/users/me.json',_0x3ab7e['remoteUri'])})[_0x846a('0x17')](function(_0x672b41){logger[_0x846a('0xd')]('Admin\x20account\x20selected.');return _0x672b41[_0x846a('0x23')];});}});}else{logger[_0x846a('0xd')](_0x846a('0x22'));return request({'uri':util['format'](_0x846a('0x24'),_0x3ab7e['remoteUri'])})[_0x846a('0x17')](function(_0x14d710){logger['info']('Admin\x20account\x20selected.');return _0x14d710[_0x846a('0x23')];});}}function getEndUser(_0x110213,_0x38ce8e,_0x4c4394){logger[_0x846a('0xd')](_0x846a('0x25'),_0x4c4394);return request({'uri':util['format'](_0x846a('0x1b'),_0x110213[_0x846a('0x10')]),'qs':{'query':util[_0x846a('0xe')](_0x846a('0x26'),_0x4c4394)}})[_0x846a('0x17')](function(_0xc7d3b3){var _0x3c8e03;if(_0xc7d3b3[_0x846a('0x20')][_0x846a('0x27')]){_0xc7d3b3[_0x846a('0x20')]=_[_0x846a('0x28')](_0xc7d3b3[_0x846a('0x20')],{'suspended':![],'role':_0x846a('0x29')});if(_0xc7d3b3[_0x846a('0x20')][_0x846a('0x27')]){_0x3c8e03=_[_0x846a('0x2a')](_0xc7d3b3[_0x846a('0x20')]);}}if(_0x3c8e03){logger[_0x846a('0xd')]('Enduser\x20found!');return _0x3c8e03;}else{logger[_0x846a('0xd')](_0x846a('0x2b'));return request({'uri':util['format'](_0x846a('0x2c'),_0x110213[_0x846a('0x10')]),'method':_0x846a('0x2d'),'body':{'user':{'role':_0x846a('0x29'),'name':util[_0x846a('0xe')]('Caller\x20-\x20%s',_0x38ce8e||_0x4c4394),'phone':_0x4c4394}}})[_0x846a('0x17')](function(_0x385c63){logger[_0x846a('0xd')](_0x846a('0x2e'));return _0x385c63[_0x846a('0x23')];});}});}function getAuth(_0x2801d0){var _0x1110cd;if(_0x2801d0[_0x846a('0x2f')]===_0x846a('0x30')){_0x1110cd=util[_0x846a('0xe')]('%s:%s',_0x2801d0[_0x846a('0x31')],_0x2801d0[_0x846a('0x30')]);}else if(_0x2801d0[_0x846a('0x2f')]===_0x846a('0x32')){_0x1110cd=util[_0x846a('0xe')](_0x846a('0x33'),_0x2801d0[_0x846a('0x31')],_0x2801d0[_0x846a('0x32')]);}return util[_0x846a('0xe')](_0x846a('0x34'),new Buffer(_0x1110cd)['toString'](_0x846a('0x35')));}function request(_0x3a2a38){logger['debug'](_0x846a('0x36'),JSON[_0x846a('0x37')](_0x3a2a38));return rp(_['defaults'](_0x3a2a38,{'method':_0x846a('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x85545,_0x1fe6ed){var _0x33e34d=[];if(_0x85545&&_0x85545['length']>0x0){_0x33e34d=_['map'](_0x85545,_0x1fe6ed);}return _0x33e34d;}function getCustomFields(_0x4ae06f,_0x3ab270){var _0x18246f=[];var _0x26f65b={'custom_fields':[]};if(_0x4ae06f['length']>0x0){_[_0x846a('0x39')](_0x4ae06f,function(_0x21a373){if(_['includes'](['string','picklist'],_0x21a373[_0x846a('0x3a')])&&_0x21a373[_0x846a('0x3b')]&&!_0x21a373[_0x846a('0x3c')]){_0x26f65b[_0x21a373[_0x846a('0x3b')][_0x846a('0x3d')]()]=_0x21a373[_0x846a('0x3e')]['toString']();}else if(_[_0x846a('0x3f')]([_0x846a('0x40'),_0x846a('0x41')],_0x21a373['type'])&&_0x21a373[_0x846a('0x42')]&&_0x21a373[_0x846a('0x3c')]){_0x26f65b['custom_fields'][_0x846a('0x43')]({'id':_0x21a373['idField'],'value':_0x21a373[_0x846a('0x3e')][_0x846a('0x44')]()});}else if(_0x21a373['type']===_0x846a('0x45')&&_0x21a373[_0x846a('0x46')]&&_0x21a373[_0x846a('0x42')]&&_0x21a373[_0x846a('0x3c')]){_0x3ab270[_0x21a373['variableName']]&&_0x26f65b['custom_fields'][_0x846a('0x43')]({'id':_0x21a373[_0x846a('0x42')],'value':_0x3ab270[_0x21a373['variableName']][_0x846a('0x44')]()});}else if(_0x21a373['type']===_0x846a('0x47')&&_0x21a373[_0x846a('0x48')]&&_0x21a373['Variable'][_0x846a('0x13')]&&_0x21a373[_0x846a('0x42')]&&_0x21a373['customField']){_0x3ab270[_0x21a373[_0x846a('0x48')][_0x846a('0x13')][_0x846a('0x3d')]()]&&_0x26f65b[_0x846a('0x49')][_0x846a('0x43')]({'id':_0x21a373[_0x846a('0x42')],'value':_0x3ab270[_0x21a373['Variable']['name'][_0x846a('0x3d')]()][_0x846a('0x44')]()});}});}return _0x26f65b;}exports[_0x846a('0x4a')]=function(_0x1b9d97,_0x59062f,_0x458ad1,_0x4a1e15,_0x2a1c15,_0x2a7746){var _0x479933,_0x4f0dc0;_0x2a7746[_0x846a('0x10')]=intUtil['stripTrailingSlash'](_0x2a7746['remoteUri']);_0x2a7746[_0x846a('0x4b')]=intUtil[_0x846a('0x4c')](_0x2a7746[_0x846a('0x4b')]);if(_0x2a1c15&&_0x2a1c15[_0x846a('0x4d')]){logger[_0x846a('0xd')](_0x846a('0x4e'),'Recording\x20is\x20enabled!');_0x59062f[_0x846a('0x4f')]=util['format'](_0x846a('0x50'),_0x2a7746[_0x846a('0x4b')],_0x59062f[_0x846a('0x51')],md5(_0x59062f[_0x846a('0x51')]));}else{_0x59062f[_0x846a('0x4f')]='';}headers[_0x846a('0x52')]=getAuth(_0x2a7746);return getUser(_0x2a7746,_0x4a1e15[_0x846a('0x53')])['then'](function(_0x299ea1){_0x479933=_0x299ea1;logger[_0x846a('0xd')](_0x846a('0x54'),_0x479933['id']);return getEndUser(_0x2a7746,_0x59062f[_0x846a('0x55')],_0x59062f['calleridnum']);})[_0x846a('0x17')](function(_0x157a23){_0x4f0dc0=_0x157a23;logger[_0x846a('0xd')](_0x846a('0x56'),_0x4f0dc0['id']);return getTicket(_0x2a7746,_0x479933,_0x4f0dc0,_0x458ad1,_0x59062f);})['then'](function(_0x409c3f){if(_0x409c3f){logger[_0x846a('0xd')](_0x846a('0x57'),_0x409c3f['id']);switch(_0x2a7746[_0x846a('0x3a')]){case'integrationTab':logger[_0x846a('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x846a('0xe')](_0x846a('0x58'),_0x2a7746[_0x846a('0x10')],_0x479933['id'],_0x409c3f['id']),'method':_0x846a('0x2d')});case'newTab':logger[_0x846a('0xd')](_0x846a('0x4e'),_0x846a('0x59'));emit(util[_0x846a('0xe')](_0x846a('0x5a'),_0x4a1e15[_0x846a('0x13')]),_0x846a('0x5b'),{'uri':util[_0x846a('0xe')](_0x846a('0x5c'),_0x2a7746[_0x846a('0x10')][_0x846a('0x5d')]('/api/v2',''),_0x409c3f['id'])});break;default:logger[_0x846a('0x5e')](_0x846a('0x4e'),_0x846a('0x5f'));}}})[_0x846a('0x60')](function(_0x3eafd7){logger['error'](_0x846a('0x61'),util['inspect'](_0x3eafd7,{'showHidden':!![],'depth':null}));});};exports[_0x846a('0x62')]=function(_0x3872fc,_0x3dc55a,_0x487282,_0x58c855,_0x33991f,_0x2f23b3,_0xdaf8cd){var _0x6bd4ad,_0x266315;_0x2f23b3['remoteUri']=intUtil[_0x846a('0x4c')](_0x2f23b3[_0x846a('0x10')]);_0x2f23b3['serverUrl']=intUtil[_0x846a('0x4c')](_0x2f23b3[_0x846a('0x4b')]);if(_0xdaf8cd&&_0xdaf8cd['recordingFormat']&&_0xdaf8cd[_0x846a('0x63')]!=='none'){logger['info'](_0x846a('0x64'),_0x846a('0x65'));_0x3dc55a[_0x846a('0x4f')]=util[_0x846a('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f23b3[_0x846a('0x4b')],_0x3dc55a[_0x846a('0x51')],md5(_0x3dc55a[_0x846a('0x51')]));}headers[_0x846a('0x52')]=getAuth(_0x2f23b3);return getUser(_0x2f23b3,_0x58c855['email'])[_0x846a('0x17')](function(_0x1af19c){_0x6bd4ad=_0x1af19c;logger[_0x846a('0xd')]('The\x20User\x20ID\x20is:',_0x6bd4ad['id']);return getEndUser(_0x2f23b3,_0x3dc55a[_0x846a('0x66')],_0x3dc55a[_0x846a('0x67')]);})[_0x846a('0x17')](function(_0x5cc82c){_0x266315=_0x5cc82c;logger[_0x846a('0xd')]('The\x20Enduser\x20ID\x20is:',_0x266315['id']);return getTicket(_0x2f23b3,_0x6bd4ad,_0x266315,_0x487282,_0x3dc55a);})['then'](function(_0x3b7531){if(_0x3b7531){logger[_0x846a('0xd')](_0x846a('0x57'),_0x3b7531['id']);switch(_0x2f23b3['type']){case _0x846a('0x68'):logger[_0x846a('0xd')](_0x846a('0x64'),_0x846a('0x69'));return request({'uri':util[_0x846a('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2f23b3[_0x846a('0x10')],_0x6bd4ad['id'],_0x3b7531['id']),'method':'POST'});case'newTab':logger['info']('[OUTBOUND]',_0x846a('0x59'));emit(util[_0x846a('0xe')](_0x846a('0x5a'),_0x58c855[_0x846a('0x13')]),'trigger:browser:url',{'uri':util[_0x846a('0xe')](_0x846a('0x5c'),_0x2f23b3['remoteUri']['replace']('/api/v2',''),_0x3b7531['id'])});break;default:logger[_0x846a('0x5e')](_0x846a('0x64'),_0x846a('0x5f'));}}})[_0x846a('0x60')](function(_0x3dd7b8){logger[_0x846a('0x5e')](_0x846a('0x6a'),util[_0x846a('0x6b')](_0x3dd7b8,{'showHidden':!![],'depth':null}));});};exports[_0x846a('0x6c')]=function(_0xb3c995,_0x3acf9d,_0x20584e,_0x59c8aa,_0x20d3cb,_0x1f3ee9){var _0x8c2a32,_0x3b47ee;_0x1f3ee9[_0x846a('0x10')]=intUtil[_0x846a('0x4c')](_0x1f3ee9[_0x846a('0x10')]);_0x1f3ee9[_0x846a('0x4b')]=intUtil['stripTrailingSlash'](_0x1f3ee9['serverUrl']);if(_0x20d3cb&&_0x20d3cb[_0x846a('0x4d')]){logger[_0x846a('0xd')]('['+_0x3acf9d[_0x846a('0x6d')][_0x846a('0x6e')]()+']',_0x846a('0x65'));_0x3acf9d['recordingURL']=util[_0x846a('0xe')](_0x846a('0x50'),_0x1f3ee9[_0x846a('0x4b')],_0x3acf9d[_0x846a('0x51')],md5(_0x3acf9d[_0x846a('0x51')]));}else{_0x3acf9d[_0x846a('0x4f')]='';}headers[_0x846a('0x52')]=getAuth(_0x1f3ee9);return getUser(_0x1f3ee9)[_0x846a('0x17')](function(_0xbb1ade){_0x8c2a32=_0xbb1ade;logger[_0x846a('0xd')]('The\x20User\x20ID\x20is:',_0x8c2a32['id']);return getEndUser(_0x1f3ee9,_0x3acf9d[_0x846a('0x55')],_0x3acf9d[_0x846a('0x6f')]);})[_0x846a('0x17')](function(_0x4d66e6){_0x3b47ee=_0x4d66e6;logger[_0x846a('0xd')](_0x846a('0x56'),_0x3b47ee['id']);return getTicket(_0x1f3ee9,_0x8c2a32,_0x3b47ee,_0x20584e,_0x3acf9d);})['then'](function(_0x5b4877){if(_0x5b4877){logger[_0x846a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5b4877['id']);}})[_0x846a('0x60')](function(_0x3c1f52){logger[_0x846a('0x5e')]('['+_0x3acf9d[_0x846a('0x6d')]['toUpperCase']()+']'+_0x846a('0x70'),util['inspect'](_0x3c1f52,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x370f=['includes','type','nameField','customField','toString','string','picklist','push','idField','variable','variableName','custom_fields','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:browser:url','inspect','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','Subjects','getString','Descriptions','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','base64','debug','[HTTP]','stringify','GET','map','forEach'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x370f,0x1f2));var _0xf370=function(_0x472260,_0x55e796){_0x472260=_0x472260-0x0;var _0x5c890b=_0x370f[_0x472260];return _0x5c890b;};'use strict';var _=require('lodash');var rp=require(_0xf370('0x0'));var md5=require(_0xf370('0x1'));var util=require('util');var Redis=require(_0xf370('0x2'));var intUtil=require(_0xf370('0x3'));var config=require(_0xf370('0x4'));var logger=require(_0xf370('0x5'))(_0xf370('0x6'));config[_0xf370('0x7')]=_[_0xf370('0x8')](config[_0xf370('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf370('0x9'))(new Redis(config[_0xf370('0x7')]));function emit(_0x494eeb,_0x18b8d2,_0x7495d2){io['to'](_0x494eeb)[_0xf370('0xa')](_0x18b8d2,_0x7495d2);}var headers={'Content-Type':_0xf370('0xb'),'Accept':_0xf370('0xb')};function getTicket(_0x4d453c,_0x52a9fc,_0xbe979b,_0x4717c5,_0x5bf7d8){logger['info'](_0xf370('0xc'));return request({'uri':util[_0xf370('0xd')](_0xf370('0xe'),_0x4d453c[_0xf370('0xf')]),'method':_0xf370('0x10'),'body':{'ticket':_[_0xf370('0x11')]({'requester_id':_0xbe979b['id'],'submitter_id':_0x52a9fc?_0x52a9fc['id']:undefined,'assignee_id':_0x52a9fc?_0x52a9fc['id']:undefined,'tags':getTags(_0x4717c5['Tags'],_0xf370('0x12')),'subject':intUtil['getString'](_0x4717c5[_0xf370('0x13')],_0x5bf7d8,'\x20'),'description':intUtil[_0xf370('0x14')](_0x4717c5[_0xf370('0x15')],_0x5bf7d8,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf370('0x14')](_0x4717c5[_0xf370('0x15')],_0x5bf7d8,'\x0a')}},getCustomFields(_0x4717c5['Fields'],_0x5bf7d8))}})['then'](function(_0x2c1a80){logger[_0xf370('0x16')](_0xf370('0x17'));return _0x2c1a80[_0xf370('0x18')];});}function getUser(_0x590cff,_0x1ce919){if(intUtil[_0xf370('0x19')](_0x1ce919)){logger[_0xf370('0x16')](_0xf370('0x1a'),_0x1ce919);return request({'uri':util['format'](_0xf370('0x1b'),_0x590cff[_0xf370('0xf')]),'qs':{'query':util['format'](_0xf370('0x1c'),_0x1ce919)}})[_0xf370('0x1d')](function(_0x57e431){if(_0x57e431[_0xf370('0x1e')]){logger[_0xf370('0x16')]('Agent\x20found!');return _['find'](_0x57e431['results'],{'email':_0x1ce919,'role':'agent'});}else{logger[_0xf370('0x16')](_0xf370('0x1f'));return request({'uri':util['format']('%s/users/me.json',_0x590cff[_0xf370('0xf')])})['then'](function(_0x44e3ad){logger[_0xf370('0x16')]('Admin\x20account\x20selected.');return _0x44e3ad['user'];});}});}else{logger['info'](_0xf370('0x1f'));return request({'uri':util[_0xf370('0xd')](_0xf370('0x20'),_0x590cff[_0xf370('0xf')])})[_0xf370('0x1d')](function(_0x3de4bb){logger['info'](_0xf370('0x21'));return _0x3de4bb['user'];});}}function getEndUser(_0xe59956,_0x48a68f,_0x5091ec){logger[_0xf370('0x16')](_0xf370('0x22'),_0x5091ec);return request({'uri':util[_0xf370('0xd')](_0xf370('0x1b'),_0xe59956[_0xf370('0xf')]),'qs':{'query':util[_0xf370('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x5091ec)}})[_0xf370('0x1d')](function(_0x4fd0d6){var _0x3926d3;if(_0x4fd0d6[_0xf370('0x23')][_0xf370('0x24')]){_0x4fd0d6[_0xf370('0x23')]=_[_0xf370('0x25')](_0x4fd0d6[_0xf370('0x23')],{'suspended':![],'role':_0xf370('0x26')});if(_0x4fd0d6[_0xf370('0x23')][_0xf370('0x24')]){_0x3926d3=_[_0xf370('0x27')](_0x4fd0d6[_0xf370('0x23')]);}}if(_0x3926d3){logger['info'](_0xf370('0x28'));return _0x3926d3;}else{logger[_0xf370('0x16')](_0xf370('0x29'));return request({'uri':util[_0xf370('0xd')](_0xf370('0x2a'),_0xe59956[_0xf370('0xf')]),'method':_0xf370('0x10'),'body':{'user':{'role':'end-user','name':util[_0xf370('0xd')](_0xf370('0x2b'),_0x48a68f||_0x5091ec),'phone':_0x5091ec}}})[_0xf370('0x1d')](function(_0x12be80){logger[_0xf370('0x16')](_0xf370('0x2c'));return _0x12be80['user'];});}});}function getAuth(_0x21b2ca){var _0xca8d6d;if(_0x21b2ca[_0xf370('0x2d')]===_0xf370('0x2e')){_0xca8d6d=util[_0xf370('0xd')](_0xf370('0x2f'),_0x21b2ca[_0xf370('0x30')],_0x21b2ca[_0xf370('0x2e')]);}else if(_0x21b2ca[_0xf370('0x2d')]===_0xf370('0x31')){_0xca8d6d=util[_0xf370('0xd')]('%s/token:%s',_0x21b2ca[_0xf370('0x30')],_0x21b2ca[_0xf370('0x31')]);}return util[_0xf370('0xd')]('Basic\x20%s',new Buffer(_0xca8d6d)['toString'](_0xf370('0x32')));}function request(_0x270a35){logger[_0xf370('0x33')](_0xf370('0x34'),JSON[_0xf370('0x35')](_0x270a35));return rp(_['defaults'](_0x270a35,{'method':_0xf370('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x675064,_0x37a878){var _0xfe14ee=[];if(_0x675064&&_0x675064[_0xf370('0x24')]>0x0){_0xfe14ee=_[_0xf370('0x37')](_0x675064,_0x37a878);}return _0xfe14ee;}function getCustomFields(_0x14f863,_0x78504b){var _0x1aaff3=[];var _0x2177bb={'custom_fields':[]};if(_0x14f863[_0xf370('0x24')]>0x0){_[_0xf370('0x38')](_0x14f863,function(_0x69405b){if(_[_0xf370('0x39')](['string','picklist'],_0x69405b[_0xf370('0x3a')])&&_0x69405b[_0xf370('0x3b')]&&!_0x69405b[_0xf370('0x3c')]){_0x2177bb[_0x69405b[_0xf370('0x3b')]['toLowerCase']()]=_0x69405b['content'][_0xf370('0x3d')]();}else if(_[_0xf370('0x39')]([_0xf370('0x3e'),_0xf370('0x3f')],_0x69405b[_0xf370('0x3a')])&&_0x69405b['idField']&&_0x69405b['customField']){_0x2177bb['custom_fields'][_0xf370('0x40')]({'id':_0x69405b[_0xf370('0x41')],'value':_0x69405b['content'][_0xf370('0x3d')]()});}else if(_0x69405b[_0xf370('0x3a')]===_0xf370('0x42')&&_0x69405b[_0xf370('0x43')]&&_0x69405b['idField']&&_0x69405b[_0xf370('0x3c')]){_0x78504b[_0x69405b['variableName']]&&_0x2177bb[_0xf370('0x44')][_0xf370('0x40')]({'id':_0x69405b['idField'],'value':_0x78504b[_0x69405b[_0xf370('0x43')]][_0xf370('0x3d')]()});}else if(_0x69405b['type']===_0xf370('0x45')&&_0x69405b['Variable']&&_0x69405b['Variable'][_0xf370('0x12')]&&_0x69405b[_0xf370('0x41')]&&_0x69405b[_0xf370('0x3c')]){_0x78504b[_0x69405b[_0xf370('0x46')]['name'][_0xf370('0x47')]()]&&_0x2177bb[_0xf370('0x44')][_0xf370('0x40')]({'id':_0x69405b['idField'],'value':_0x78504b[_0x69405b['Variable'][_0xf370('0x12')]['toLowerCase']()]['toString']()});}});}return _0x2177bb;}exports[_0xf370('0x48')]=function(_0x5e726f,_0x411ba6,_0x102311,_0x5a1554,_0x1247d4,_0x4ad348){var _0x2a4b1c,_0x28865e;_0x4ad348['remoteUri']=intUtil['stripTrailingSlash'](_0x4ad348['remoteUri']);_0x4ad348['serverUrl']=intUtil[_0xf370('0x49')](_0x4ad348[_0xf370('0x4a')]);if(_0x1247d4&&_0x1247d4['monitor_format']){logger[_0xf370('0x16')](_0xf370('0x4b'),'Recording\x20is\x20enabled!');_0x411ba6[_0xf370('0x4c')]=util[_0xf370('0xd')](_0xf370('0x4d'),_0x4ad348[_0xf370('0x4a')],_0x411ba6[_0xf370('0x4e')],md5(_0x411ba6['uniqueid']));}else{_0x411ba6[_0xf370('0x4c')]='';}headers['Authorization']=getAuth(_0x4ad348);return getUser(_0x4ad348,_0x5a1554[_0xf370('0x4f')])[_0xf370('0x1d')](function(_0x179f0a){_0x2a4b1c=_0x179f0a;logger[_0xf370('0x16')](_0xf370('0x50'),_0x2a4b1c['id']);return getEndUser(_0x4ad348,_0x411ba6[_0xf370('0x51')],_0x411ba6[_0xf370('0x52')]);})[_0xf370('0x1d')](function(_0x3f433e){_0x28865e=_0x3f433e;logger[_0xf370('0x16')]('The\x20Enduser\x20ID\x20is:',_0x28865e['id']);return getTicket(_0x4ad348,_0x2a4b1c,_0x28865e,_0x102311,_0x411ba6);})[_0xf370('0x1d')](function(_0x443b49){if(_0x443b49){logger[_0xf370('0x16')]('The\x20Ticket\x20ID\x20is:',_0x443b49['id']);switch(_0x4ad348[_0xf370('0x3a')]){case'integrationTab':logger[_0xf370('0x16')](_0xf370('0x4b'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xf370('0x53'),_0x4ad348[_0xf370('0xf')],_0x2a4b1c['id'],_0x443b49['id']),'method':_0xf370('0x10')});case _0xf370('0x54'):logger[_0xf370('0x16')](_0xf370('0x4b'),_0xf370('0x55'));emit(util['format'](_0xf370('0x56'),_0x5a1554[_0xf370('0x12')]),'trigger:browser:url',{'uri':util[_0xf370('0xd')](_0xf370('0x57'),_0x4ad348[_0xf370('0xf')][_0xf370('0x58')](_0xf370('0x59'),''),_0x443b49['id'])});break;default:logger[_0xf370('0x5a')](_0xf370('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xf370('0x5b')](function(_0x4c1ab9){logger[_0xf370('0x5a')](_0xf370('0x5c'),util['inspect'](_0x4c1ab9,{'showHidden':!![],'depth':null}));});};exports[_0xf370('0x5d')]=function(_0x509a64,_0x1e6391,_0x39326f,_0x5451fe,_0x4fcf76,_0x234b51,_0x16593d){var _0xb45cf,_0x593ebe;_0x234b51[_0xf370('0xf')]=intUtil[_0xf370('0x49')](_0x234b51['remoteUri']);_0x234b51[_0xf370('0x4a')]=intUtil[_0xf370('0x49')](_0x234b51[_0xf370('0x4a')]);if(_0x16593d&&_0x16593d[_0xf370('0x5e')]&&_0x16593d[_0xf370('0x5e')]!==_0xf370('0x5f')){logger[_0xf370('0x16')](_0xf370('0x60'),'Recording\x20is\x20enabled!');_0x1e6391[_0xf370('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x234b51[_0xf370('0x4a')],_0x1e6391['uniqueid'],md5(_0x1e6391['uniqueid']));}headers[_0xf370('0x61')]=getAuth(_0x234b51);return getUser(_0x234b51,_0x5451fe[_0xf370('0x4f')])['then'](function(_0xe59ac7){_0xb45cf=_0xe59ac7;logger['info'](_0xf370('0x50'),_0xb45cf['id']);return getEndUser(_0x234b51,_0x1e6391[_0xf370('0x62')],_0x1e6391[_0xf370('0x63')]);})['then'](function(_0x2308ab){_0x593ebe=_0x2308ab;logger[_0xf370('0x16')](_0xf370('0x64'),_0x593ebe['id']);return getTicket(_0x234b51,_0xb45cf,_0x593ebe,_0x39326f,_0x1e6391);})[_0xf370('0x1d')](function(_0x2dd5f7){if(_0x2dd5f7){logger['info'](_0xf370('0x65'),_0x2dd5f7['id']);switch(_0x234b51[_0xf370('0x3a')]){case'integrationTab':logger[_0xf370('0x16')](_0xf370('0x60'),_0xf370('0x66'));return request({'uri':util[_0xf370('0xd')](_0xf370('0x53'),_0x234b51[_0xf370('0xf')],_0xb45cf['id'],_0x2dd5f7['id']),'method':_0xf370('0x10')});case _0xf370('0x54'):logger[_0xf370('0x16')](_0xf370('0x60'),_0xf370('0x55'));emit(util[_0xf370('0xd')](_0xf370('0x56'),_0x5451fe['name']),_0xf370('0x67'),{'uri':util[_0xf370('0xd')](_0xf370('0x57'),_0x234b51[_0xf370('0xf')][_0xf370('0x58')](_0xf370('0x59'),''),_0x2dd5f7['id'])});break;default:logger[_0xf370('0x5a')](_0xf370('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xf370('0x5b')](function(_0x3a9f30){logger[_0xf370('0x5a')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf370('0x68')](_0x3a9f30,{'showHidden':!![],'depth':null}));});};exports[_0xf370('0x69')]=function(_0x466988,_0x40094a,_0x192409,_0x5d7c97,_0x15ab06,_0x5253d0){var _0x3e9602,_0x106c2f;_0x5253d0['remoteUri']=intUtil[_0xf370('0x49')](_0x5253d0[_0xf370('0xf')]);_0x5253d0[_0xf370('0x4a')]=intUtil['stripTrailingSlash'](_0x5253d0[_0xf370('0x4a')]);if(_0x15ab06&&_0x15ab06[_0xf370('0x6a')]){logger[_0xf370('0x16')]('['+_0x40094a[_0xf370('0x6b')][_0xf370('0x6c')]()+']',_0xf370('0x6d'));_0x40094a[_0xf370('0x4c')]=util[_0xf370('0xd')](_0xf370('0x4d'),_0x5253d0[_0xf370('0x4a')],_0x40094a[_0xf370('0x4e')],md5(_0x40094a[_0xf370('0x4e')]));}else{_0x40094a[_0xf370('0x4c')]='';}headers['Authorization']=getAuth(_0x5253d0);return getUser(_0x5253d0)[_0xf370('0x1d')](function(_0x4594d0){_0x3e9602=_0x4594d0;logger['info'](_0xf370('0x50'),_0x3e9602['id']);return getEndUser(_0x5253d0,_0x40094a[_0xf370('0x51')],_0x40094a[_0xf370('0x52')]);})[_0xf370('0x1d')](function(_0x59f068){_0x106c2f=_0x59f068;logger[_0xf370('0x16')](_0xf370('0x64'),_0x106c2f['id']);return getTicket(_0x5253d0,_0x3e9602,_0x106c2f,_0x192409,_0x40094a);})['then'](function(_0x37368a){if(_0x37368a){logger[_0xf370('0x16')](_0xf370('0x65'),_0x37368a['id']);}})[_0xf370('0x5b')](function(_0x18f73f){logger[_0xf370('0x5a')]('['+_0x40094a['lastevent'][_0xf370('0x6c')]()+']'+_0xf370('0x6e'),util[_0xf370('0x68')](_0x18f73f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 706a89a..0fbf6e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bdd=['[OUTBOUND]','/api/voice/recordings/','com','destcalleridnum','Outbound','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','GET','ActiveUsers','then','isArrayLikeObject','users','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Contacts','nothing','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','enduserType','Who_Id','Full_Name','Last_Name','Leads','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','starttime','YYYY-MM-DDTHH:mm:ss','format','Call_Result','Called','complete','connect','rejected','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','details','err','queue','stripTrailingSlash','host','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none'];(function(_0x2c0246,_0x2e4693){var _0x270418=function(_0x18ca8f){while(--_0x18ca8f){_0x2c0246['push'](_0x2c0246['shift']());}};_0x270418(++_0x2e4693);}(_0x1bdd,0x143));var _0xd1bd=function(_0x1372f3,_0x49cc3a){_0x1372f3=_0x1372f3-0x0;var _0x36a400=_0x1bdd[_0x1372f3];return _0x36a400;};'use strict';var _=require(_0xd1bd('0x0'));var rp=require(_0xd1bd('0x1'));var md5=require(_0xd1bd('0x2'));var util=require(_0xd1bd('0x3'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xd1bd('0x4'));var BPromise=require(_0xd1bd('0x5'));var config=require(_0xd1bd('0x6'));var logger=require(_0xd1bd('0x7'))(_0xd1bd('0x8'));config['redis']=_[_0xd1bd('0x9')](config[_0xd1bd('0xa')],{'host':_0xd1bd('0xb'),'port':0x18eb});var io=require(_0xd1bd('0xc'))(new Redis(config[_0xd1bd('0xa')]));function emit(_0x45cccc,_0x225277,_0x354476){io['to'](_0x45cccc)[_0xd1bd('0xd')](_0x225277,_0x354476);}function request(_0x523146){logger[_0xd1bd('0xe')](_0xd1bd('0xf'),JSON[_0xd1bd('0x10')](_0x523146));return rp(_0x523146);}function getCustomFields(_0x17e252,_0x51063b){var _0x343d47={};if(_0x17e252[_0xd1bd('0x11')]>0x0){_[_0xd1bd('0x12')](_0x17e252,function(_0x4ff6f9){if(_[_0xd1bd('0x13')]([_0xd1bd('0x14'),_0xd1bd('0x15')],_0x4ff6f9['type'])&&_0x4ff6f9[_0xd1bd('0x16')]){_0x343d47[_0x4ff6f9[_0xd1bd('0x16')]]=_0x4ff6f9[_0xd1bd('0x17')][_0xd1bd('0x18')]();}else if(_0x4ff6f9[_0xd1bd('0x19')]===_0xd1bd('0x1a')&&_0x4ff6f9[_0xd1bd('0x1b')]&&_0x4ff6f9[_0xd1bd('0x16')]&&_0x51063b[_0x4ff6f9[_0xd1bd('0x1b')]]){_0x343d47[_0x4ff6f9[_0xd1bd('0x16')]]=_0x51063b[_0x4ff6f9[_0xd1bd('0x1b')]]['toString']();}else if(_0x4ff6f9[_0xd1bd('0x19')]==='customVariable'&&_0x4ff6f9[_0xd1bd('0x1c')]&&_0x4ff6f9[_0xd1bd('0x1c')][_0xd1bd('0x1d')]&&_0x4ff6f9['idField']&&_0x51063b[_0x4ff6f9[_0xd1bd('0x1c')][_0xd1bd('0x1d')][_0xd1bd('0x1e')]()]){_0x343d47[_0x4ff6f9[_0xd1bd('0x16')]]=_0x51063b[_0x4ff6f9[_0xd1bd('0x1c')]['name'][_0xd1bd('0x1e')]()][_0xd1bd('0x18')]();}});}return _0x343d47;}function getName(_0x3370de){if(_0x3370de[_0xd1bd('0x1f')]('\x20')>0x0){var _0x45ea84=_0x3370de[_0xd1bd('0x20')](/ (.+)/);if(_0x45ea84[0x1]){return _0x45ea84;}}return[_0x3370de,_0x3370de];}var accountsTokens={};function getAccessToken(_0x526701){return new Promise(function(_0x3ec599,_0xaa69a){if(!_[_0xd1bd('0x21')](accountsTokens[_0x526701['id']])&&!_[_0xd1bd('0x21')](accountsTokens[_0x526701['id']][_0xd1bd('0x22')])){if(moment()['isBefore'](accountsTokens[_0x526701['id']][_0xd1bd('0x23')])){_0x3ec599(accountsTokens[_0x526701['id']]['access_token']);}}var _0x2f37bb;switch(_0x526701['zone']){case'US':_0x2f37bb=_0xd1bd('0x24');break;case'AU':_0x2f37bb=_0xd1bd('0x25');break;case'EU':_0x2f37bb='https://accounts.zoho.eu';break;case'IN':_0x2f37bb=_0xd1bd('0x26');break;case'CN':_0x2f37bb=_0xd1bd('0x27');break;default:_0x2f37bb=_0xd1bd('0x28');break;}var _0x1f2b04={'method':_0xd1bd('0x29'),'uri':_0x2f37bb+_0xd1bd('0x2a'),'qs':{'refresh_token':_0x526701[_0xd1bd('0x2b')],'client_id':_0x526701[_0xd1bd('0x2c')],'client_secret':_0x526701[_0xd1bd('0x2d')],'grant_type':_0xd1bd('0x2e')},'json':!![]};return rp(_0x1f2b04)['then'](function(_0x551ba4){accountsTokens[_0x526701['id']]={'access_token':_0x551ba4[_0xd1bd('0x22')],'expires_in':moment()[_0xd1bd('0x2f')](_0x551ba4[_0xd1bd('0x23')],'seconds')};_0x3ec599(_0x551ba4[_0xd1bd('0x22')]);})[_0xd1bd('0x30')](function(_0x399bfd){logger[_0xd1bd('0x31')](_0xd1bd('0x32'),_0x399bfd[_0xd1bd('0x33')]);_0xaa69a(_0x399bfd);});});}function getUser(_0x230990,_0x5e6219,_0xd47911,_0x2d9aa7){logger['info']('Search\x20user');return request({'method':_0xd1bd('0x34'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x5e6219),'qs':{'type':_0xd1bd('0x35')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x230990},'json':!![]})[_0xd1bd('0x36')](function(_0x56744a){if(_0x56744a['users']){var _0x4aaf6c=-0x1;if(_[_0xd1bd('0x37')](_0x56744a['users'])){if(!_['isNil'](_0x2d9aa7)){_0x4aaf6c=_['findIndex'](_0x56744a[_0xd1bd('0x38')],function(_0x516398){return _0x516398[_0xd1bd('0x39')]===_0x2d9aa7;});}if(_0x4aaf6c>=0x0){logger[_0xd1bd('0x3a')](_0xd1bd('0x3b'));}else{logger[_0xd1bd('0x3a')](_0xd1bd('0x3c'));_0x4aaf6c=_['findIndex'](_0x56744a[_0xd1bd('0x38')],function(_0x373855){return _0x373855[_0xd1bd('0x3d')]['name']===_0xd1bd('0x3e');});}return _0x56744a[_0xd1bd('0x38')][_0x4aaf6c];}else{if(_0x56744a['user']['profile'][_0xd1bd('0x1d')]===_0xd1bd('0x3e')){logger['info'](_0xd1bd('0x3c'));user=_0x56744a[_0xd1bd('0x3f')];return user;}else{logger[_0xd1bd('0x31')](_0xd1bd('0x40'),JSON[_0xd1bd('0x10')](_0x56744a));throw new Error(_0xd1bd('0x41')+JSON[_0xd1bd('0x10')](_0x56744a));}}}else{logger[_0xd1bd('0x31')](_0xd1bd('0x40'),JSON[_0xd1bd('0x10')](_0x56744a));throw new Error(_0xd1bd('0x41')+JSON[_0xd1bd('0x10')](_0x56744a));}})['catch'](function(_0x33f9e6){console[_0xd1bd('0x31')](_0x33f9e6);});}function getZohoUser(_0x35c493,_0xe81139){return new BPromise(function(_0x2911e4,_0xc2d824){request(_0x35c493)['then'](function(_0x6ab232){var _0x303829=null;if(_0x6ab232){_0x303829=_0x6ab232[_0xd1bd('0x42')][0x0];_0x303829['enduserType']=_0xe81139;}_0x2911e4(_0x303829);})['catch'](function(_0x311caf){_0xc2d824(_0x311caf);});});}function createEndUser(_0x3b337e,_0x42da23,_0x3e5934,_0x19e887,_0x4d107b,_0x2a8ac8){var _0x3e5934=getName(_0x3e5934);return request({'method':_0xd1bd('0x29'),'uri':_0xd1bd('0x43')+_0x42da23+_0xd1bd('0x44')+_[_0xd1bd('0x45')](_0x2a8ac8[_0xd1bd('0x46')])+'s','body':{'data':[{'Last_Name':_0x3e5934[0x1],'First_Name':_0x3e5934[0x0],'Phone':_0x19e887,'Owner':{'name':!_['isNil'](_0x4d107b[_0xd1bd('0x47')][_0xd1bd('0x1d')])?_0x4d107b[_0xd1bd('0x47')]['name']:!_['isNil'](_0x4d107b['first_name'])?_0x4d107b[_0xd1bd('0x48')]+'\x20'+_0x4d107b[_0xd1bd('0x49')]:_0x4d107b[_0xd1bd('0x49')],'id':_0x4d107b['id']}}]},'headers':{'Authorization':_0xd1bd('0x4a')+_0x3b337e},'json':!![]})['then'](function(_0x10ff98){if(_0x10ff98&&_0x10ff98['data'][0x0][_0xd1bd('0x4b')]===_0xd1bd('0x4c')){var _0x4fba38=_0x10ff98[_0xd1bd('0x42')][0x0]['details'];_0x4fba38['enduserType']=_['startCase'](_0x2a8ac8[_0xd1bd('0x46')])+'s';return _0x4fba38;}logger[_0xd1bd('0x31')]('The\x20failing\x20result\x20is',JSON[_0xd1bd('0x10')](data));throw new Error(_0xd1bd('0x4d')+JSON['stringify'](data));})[_0xd1bd('0x30')](function(_0x5ab851){console[_0xd1bd('0x4e')]('CREATE\x20ERROR',_0x5ab851);});}function getEndUser(_0x54b2c3,_0x4eb1b2,_0x4ca49c,_0xa09baf,_0x2bb0a8,_0x57bcb7,_0x2db8af){var _0x35bf63={'method':_0xd1bd('0x34'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x54b2c3},'json':!![]};switch(_0x2db8af[_0xd1bd('0x4f')]){case _0xd1bd('0x50'):_0x35bf63[_0xd1bd('0x51')]=_0xd1bd('0x43')+_0x4eb1b2+_0xd1bd('0x52')+_0x2bb0a8+'))';return getZohoUser(_0x35bf63,'Contacts')['then'](function(_0x4efd3a){if(_0x4efd3a)return _0x4efd3a;_0x35bf63['uri']=_0xd1bd('0x43')+_0x4eb1b2+_0xd1bd('0x53')+_0x2bb0a8+'))';return getZohoUser(_0x35bf63,'Leads')[_0xd1bd('0x36')](function(_0x329195){if(_0x329195)return _0x329195;if(_0x2db8af['moduleCreate']!='nothing'){return createEndUser(_0x54b2c3,_0x4eb1b2,_0xa09baf,_0x2bb0a8,_0x57bcb7,_0x2db8af);}else{return{};}});});break;case'contact':_0x35bf63[_0xd1bd('0x51')]=_0xd1bd('0x43')+_0x4eb1b2+_0xd1bd('0x52')+_0x2bb0a8+'))';return getZohoUser(_0x35bf63,_0xd1bd('0x54'))['then'](function(_0x2b7ccb){if(_0x2b7ccb)return _0x2b7ccb;if(_0x2db8af[_0xd1bd('0x46')]!='nothing'){return createEndUser(_0x54b2c3,_0x4eb1b2,_0xa09baf,_0x2bb0a8,_0x57bcb7,_0x2db8af);}else{return{};}});break;case'lead':_0x35bf63['uri']='https://www.zohoapis.'+_0x4eb1b2+_0xd1bd('0x53')+_0x2bb0a8+'))';return getZohoUser(_0x35bf63,'Leads')[_0xd1bd('0x36')](function(_0x5469a1){if(_0x5469a1)return _0x5469a1;if(_0x2db8af[_0xd1bd('0x46')]!=_0xd1bd('0x55')){return createEndUser(_0x54b2c3,_0x4eb1b2,_0xa09baf,_0x2bb0a8,_0x57bcb7,_0x2db8af);}else{return{};}});break;}}function getCall(_0x15d32e,_0x21b16a,_0x3c093d,_0x545152,_0x2929fa,_0x48024c,_0x47b127,_0x419b82){logger[_0xd1bd('0x3a')](_0xd1bd('0x56'));var _0x4892f9={};_0x4892f9[_0xd1bd('0x57')]={'name':!_[_0xd1bd('0x21')](_0x545152['role'][_0xd1bd('0x1d')])&&!_[_0xd1bd('0x21')](_0x545152[_0xd1bd('0x3d')][_0xd1bd('0x1d')])&&_0x545152[_0xd1bd('0x3d')][_0xd1bd('0x1d')]===_0xd1bd('0x58')?_0x545152[_0xd1bd('0x47')][_0xd1bd('0x1d')]:!_[_0xd1bd('0x21')](_0x545152[_0xd1bd('0x48')])?_0x545152[_0xd1bd('0x48')]+'\x20'+_0x545152[_0xd1bd('0x49')]:_0x545152[_0xd1bd('0x49')],'id':_0x545152['id']};_0x4892f9[_0xd1bd('0x59')]=intUtil['getString'](_0x48024c[_0xd1bd('0x5a')],_0x47b127,'\x20');_0x4892f9[_0xd1bd('0x5b')]=intUtil[_0xd1bd('0x5c')](_0x48024c[_0xd1bd('0x5d')],_0x47b127,'\x0a');if(_0x2929fa[_0xd1bd('0x5e')]==='Contacts'){_0x4892f9[_0xd1bd('0x5f')]={'name':!_['isNil'](_0x2929fa['Full_Name'])?_0x2929fa[_0xd1bd('0x60')]:!_[_0xd1bd('0x21')](_0x2929fa['First_Name'])?_0x2929fa['First_Name']+'\x20'+_0x2929fa[_0xd1bd('0x61')]:_0x2929fa[_0xd1bd('0x61')],'id':_0x2929fa['id']};}if(_0x2929fa[_0xd1bd('0x5e')]===_0xd1bd('0x62')){_0x4892f9['What_Id']={'name':!_[_0xd1bd('0x21')](_0x2929fa[_0xd1bd('0x60')])?_0x2929fa[_0xd1bd('0x60')]:!_[_0xd1bd('0x21')](_0x2929fa[_0xd1bd('0x63')])?_0x2929fa[_0xd1bd('0x63')]+'\x20'+_0x2929fa[_0xd1bd('0x61')]:_0x2929fa[_0xd1bd('0x61')],'id':_0x2929fa['id']};_0x4892f9[_0xd1bd('0x64')]=_[_0xd1bd('0x45')](_0x2929fa[_0xd1bd('0x5e')]);}if(_0x47b127[_0xd1bd('0x65')]){_0x4892f9[_0xd1bd('0x66')]=moment[_0xd1bd('0x67')](parseInt(_0x47b127[_0xd1bd('0x65')])*0x3e8)['format'](_0xd1bd('0x68'));}else if(_0x47b127[_0xd1bd('0x69')]&&_0x47b127[_0xd1bd('0x6a')]){_0x4892f9[_0xd1bd('0x66')]=moment['utc'](moment(_0x47b127[_0xd1bd('0x6a')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x47b127[_0xd1bd('0x6b')],_0xd1bd('0x6c'))))[_0xd1bd('0x6d')](_0xd1bd('0x68'));}switch(_0x47b127['lastevent']){case'called':_0x4892f9[_0xd1bd('0x6e')]=_0xd1bd('0x6f');break;case _0xd1bd('0x70'):case _0xd1bd('0x71'):_0x4892f9[_0xd1bd('0x6e')]='Answered';break;case _0xd1bd('0x72'):_0x4892f9['Call_Result']='Rejected';break;case'abandoned':_0x4892f9[_0xd1bd('0x6e')]=_0xd1bd('0x73');break;case _0xd1bd('0x74'):_0x4892f9[_0xd1bd('0x6e')]=_0xd1bd('0x75');default:}_0x4892f9[_0xd1bd('0x76')]=(_0x419b82==='outbound'?moment(_0x47b127['starttime'])['format'](_0xd1bd('0x6c')):moment(_0x47b127[_0xd1bd('0x77')])[_0xd1bd('0x6d')](_0xd1bd('0x6c')))||moment()[_0xd1bd('0x6d')](_0xd1bd('0x6c'));_0x4892f9[_0xd1bd('0x78')]=_0x419b82||_0xd1bd('0x79');_0x4892f9=_[_0xd1bd('0x7a')](_0x4892f9,getCustomFields(_0x48024c[_0xd1bd('0x7b')],_0x47b127));return request({'method':_0xd1bd('0x29'),'uri':_0xd1bd('0x43')+_0x21b16a+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x15d32e},'body':{'data':[_0x4892f9]},'json':!![]})[_0xd1bd('0x36')](function(_0x5c27f2){if(_0x5c27f2&&_0x5c27f2[_0xd1bd('0x42')][0x0]['code']==='SUCCESS'){logger[_0xd1bd('0x3a')](_0xd1bd('0x7c'));return{'id':_0x5c27f2[_0xd1bd('0x42')][0x0][_0xd1bd('0x7d')]['id']};}})[_0xd1bd('0x30')](function(_0x2ca27e){logger[_0xd1bd('0x3a')](_0xd1bd('0x7e'),_0x2ca27e[_0xd1bd('0x33')]);console[_0xd1bd('0x4e')]('err',_0x2ca27e);});}exports[_0xd1bd('0x7f')]=function(_0x48c3b0,_0x457f13,_0x2b65b0,_0x4ce419,_0x1c9354,_0x4e0cf0){var _0x51a2d1,_0x10a46a,_0x160d84;_0x4e0cf0['host']=intUtil[_0xd1bd('0x80')](_0x4e0cf0[_0xd1bd('0x81')]);_0x4e0cf0[_0xd1bd('0x82')]=intUtil['stripTrailingSlash'](_0x4e0cf0['serverUrl']);if(_0x1c9354&&_0x1c9354['monitor_format']){logger['info'](_0xd1bd('0x83'),_0xd1bd('0x84'));_0x457f13['recordingURL']=_0x4e0cf0[_0xd1bd('0x82')]+'/api/voice/recordings/'+_0x457f13[_0xd1bd('0x85')]+_0xd1bd('0x86')+md5(_0x457f13[_0xd1bd('0x85')]);}else{_0x457f13[_0xd1bd('0x87')]='';}var _0x3564f3=_0x4e0cf0[_0xd1bd('0x81')]===_0xd1bd('0x88')?'eu':'com';return getAccessToken(_0x4e0cf0)[_0xd1bd('0x36')](function(_0x630b9b){_0x160d84=_0x630b9b;return getUser(_0x160d84,_0x3564f3,_0x4e0cf0,_0x4ce419['email']);})[_0xd1bd('0x36')](function(_0x49827f){_0x51a2d1=_0x49827f;logger[_0xd1bd('0x3a')](_0xd1bd('0x89'),_0x51a2d1['id']);return getEndUser(_0x160d84,_0x3564f3,_0x4e0cf0,_0x457f13[_0xd1bd('0x8a')],_0x457f13[_0xd1bd('0x8b')],_0x51a2d1,_0x2b65b0);})[_0xd1bd('0x36')](function(_0x59238f){_0x10a46a=_0x59238f;return getCall(_0x160d84,_0x3564f3,_0x4e0cf0,_0x51a2d1,_0x10a46a,_0x2b65b0,_0x457f13,'Inbound');})['then'](function(_0x47f276){if(_0x47f276){logger['info'](_0xd1bd('0x8c'),_0x47f276['id']);logger[_0xd1bd('0x3a')](_0xd1bd('0x83'),_0xd1bd('0x8d'));emit(util[_0xd1bd('0x6d')](_0xd1bd('0x8e'),_0x4ce419[_0xd1bd('0x1d')]),_0xd1bd('0x8f'),{'uri':_0xd1bd('0x90')+_0x4e0cf0[_0xd1bd('0x81')]+_0xd1bd('0x91')+_0x47f276['id']});}})[_0xd1bd('0x30')](function(_0x1359ea){logger[_0xd1bd('0x31')](_0xd1bd('0x83'),JSON[_0xd1bd('0x10')](_0x1359ea));});};exports['outbound']=function(_0x5cbf6,_0x3e045d,_0x4d1ca9,_0x5874c9,_0x34d472,_0x4052e0,_0x1cf0af){var _0x5f32f2,_0x1749b1,_0x4d988d;_0x4052e0[_0xd1bd('0x81')]=intUtil['stripTrailingSlash'](_0x4052e0[_0xd1bd('0x81')]);_0x4052e0[_0xd1bd('0x82')]=intUtil[_0xd1bd('0x80')](_0x4052e0[_0xd1bd('0x82')]);if(_0x1cf0af&&_0x1cf0af[_0xd1bd('0x92')]&&_0x1cf0af[_0xd1bd('0x92')]!==_0xd1bd('0x93')){logger[_0xd1bd('0x3a')](_0xd1bd('0x94'),_0xd1bd('0x84'));_0x3e045d[_0xd1bd('0x87')]=_0x4052e0[_0xd1bd('0x82')]+_0xd1bd('0x95')+_0x3e045d[_0xd1bd('0x85')]+_0xd1bd('0x86')+md5(_0x3e045d['uniqueid']);}var _0x513d42=_0x4052e0[_0xd1bd('0x81')]===_0xd1bd('0x88')?'eu':_0xd1bd('0x96');return getAccessToken(_0x4052e0)[_0xd1bd('0x36')](function(_0x5af817){_0x4d988d=_0x5af817;return getUser(_0x4d988d,_0x513d42,_0x4052e0,_0x5874c9[_0xd1bd('0x39')]);})[_0xd1bd('0x36')](function(_0x3b3bff){_0x5f32f2=_0x3b3bff;logger['info']('The\x20User\x20ID\x20is:',_0x5f32f2['id']);return getEndUser(_0x4d988d,_0x513d42,_0x4052e0,_0x3e045d['destcalleridname'],_0x3e045d[_0xd1bd('0x97')],_0x5f32f2,_0x4d1ca9);})['then'](function(_0x4a8a0d){_0x1749b1=_0x4a8a0d;return getCall(_0x4d988d,_0x513d42,_0x4052e0,_0x5f32f2,_0x1749b1,_0x4d1ca9,_0x3e045d,_0xd1bd('0x98'));})[_0xd1bd('0x36')](function(_0x45592a){if(_0x45592a){logger['info']('The\x20Call\x20ID\x20is:',_0x45592a['id']);logger[_0xd1bd('0x3a')](_0xd1bd('0x94'),_0xd1bd('0x8d'));emit(util[_0xd1bd('0x6d')](_0xd1bd('0x8e'),_0x5874c9[_0xd1bd('0x1d')]),_0xd1bd('0x8f'),{'uri':'https://crm.'+_0x4052e0[_0xd1bd('0x81')]+_0xd1bd('0x91')+_0x45592a['id']});}})[_0xd1bd('0x30')](function(_0x5d2431){logger[_0xd1bd('0x31')]('[OUTBOUND]',JSON[_0xd1bd('0x10')](_0x5d2431));});};exports[_0xd1bd('0x99')]=function(_0x33ec7a,_0x4f7cbe,_0x1716b8,_0x1117fe,_0x14a1cd,_0x2184ea){var _0x2a28b9,_0x2cf5c7,_0xf58e37;_0x2184ea[_0xd1bd('0x81')]=intUtil[_0xd1bd('0x80')](_0x2184ea['host']);_0x2184ea[_0xd1bd('0x82')]=intUtil[_0xd1bd('0x80')](_0x2184ea[_0xd1bd('0x82')]);if(_0x14a1cd&&_0x14a1cd[_0xd1bd('0x9a')]){logger['info']('['+_0x4f7cbe[_0xd1bd('0x9b')][_0xd1bd('0x9c')]()+']',_0xd1bd('0x84'));_0x4f7cbe[_0xd1bd('0x87')]=_0x2184ea[_0xd1bd('0x82')]+'/api/voice/recordings/'+_0x4f7cbe['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x4f7cbe[_0xd1bd('0x85')]);}else{_0x4f7cbe['recordingURL']='';}var _0x2f6d90=_0x2184ea[_0xd1bd('0x81')]===_0xd1bd('0x88')?'eu':'com';return getAccessToken(_0x2184ea)[_0xd1bd('0x36')](function(_0xd3c6b7){_0xf58e37=_0xd3c6b7;return getUser(_0xf58e37,_0x2f6d90,_0x2184ea);})[_0xd1bd('0x36')](function(_0xff94e1){_0x2a28b9=_0xff94e1;logger[_0xd1bd('0x3a')](_0xd1bd('0x89'),_0x2a28b9['id']);return getEndUser(_0xf58e37,_0x2f6d90,_0x2184ea,_0x4f7cbe[_0xd1bd('0x8a')],_0x4f7cbe[_0xd1bd('0x8b')],_0x2a28b9,_0x1716b8);})['then'](function(_0x54c114){_0x2cf5c7=_0x54c114;return getCall(_0xf58e37,_0x2f6d90,_0x2184ea,_0x2a28b9,_0x2cf5c7,_0x1716b8,_0x4f7cbe,_0xd1bd('0x79'));})[_0xd1bd('0x36')](function(_0x4b104d){if(_0x4b104d){logger[_0xd1bd('0x3a')](_0xd1bd('0x8c'),_0x4b104d['id']);}})['catch'](function(_0x3ac3ab){logger[_0xd1bd('0x31')]('['+_0x4f7cbe['lastevent'][_0xd1bd('0x9c')]()+']',JSON[_0xd1bd('0x10')](_0x3ac3ab));});};
\ No newline at end of file
+var _0x043d=['https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','expires_in','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','first_name','last_name','code','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','Contacts','nothing','lead','Leads','Creating\x20new\x20call...','Owner','role','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','Called','complete','connect','Call_Result','Answered','Rejected','Abandoned','Timeout','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','POST','/crm/v2/Calls','SUCCESS','Call\x20created!','err','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','com','destcalleridnum','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','stringify','length','forEach','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu'];(function(_0x2d798f,_0x8a8c06){var _0x1086c4=function(_0x474074){while(--_0x474074){_0x2d798f['push'](_0x2d798f['shift']());}};_0x1086c4(++_0x8a8c06);}(_0x043d,0x1ba));var _0xd043=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0x043d[_0x9c8b4a];return _0x198bef;};'use strict';var _=require(_0xd043('0x0'));var rp=require(_0xd043('0x1'));var md5=require(_0xd043('0x2'));var util=require(_0xd043('0x3'));var intUtil=require(_0xd043('0x4'));var moment=require(_0xd043('0x5'));var Redis=require(_0xd043('0x6'));var BPromise=require(_0xd043('0x7'));var config=require(_0xd043('0x8'));var logger=require(_0xd043('0x9'))(_0xd043('0xa'));config[_0xd043('0xb')]=_[_0xd043('0xc')](config[_0xd043('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xd043('0xd'))(new Redis(config[_0xd043('0xb')]));function emit(_0x499cd5,_0x334726,_0x4d5003){io['to'](_0x499cd5)[_0xd043('0xe')](_0x334726,_0x4d5003);}function request(_0x14881c){logger[_0xd043('0xf')]('[HTTP]',JSON[_0xd043('0x10')](_0x14881c));return rp(_0x14881c);}function getCustomFields(_0x1c6fe8,_0x43973e){var _0x195961={};if(_0x1c6fe8[_0xd043('0x11')]>0x0){_[_0xd043('0x12')](_0x1c6fe8,function(_0x559029){if(_['includes']([_0xd043('0x13'),'picklist'],_0x559029[_0xd043('0x14')])&&_0x559029[_0xd043('0x15')]){_0x195961[_0x559029[_0xd043('0x15')]]=_0x559029[_0xd043('0x16')][_0xd043('0x17')]();}else if(_0x559029[_0xd043('0x14')]===_0xd043('0x18')&&_0x559029[_0xd043('0x19')]&&_0x559029[_0xd043('0x15')]&&_0x43973e[_0x559029[_0xd043('0x19')]]){_0x195961[_0x559029[_0xd043('0x15')]]=_0x43973e[_0x559029[_0xd043('0x19')]][_0xd043('0x17')]();}else if(_0x559029[_0xd043('0x14')]===_0xd043('0x1a')&&_0x559029[_0xd043('0x1b')]&&_0x559029[_0xd043('0x1b')][_0xd043('0x1c')]&&_0x559029['idField']&&_0x43973e[_0x559029[_0xd043('0x1b')][_0xd043('0x1c')][_0xd043('0x1d')]()]){_0x195961[_0x559029[_0xd043('0x15')]]=_0x43973e[_0x559029['Variable'][_0xd043('0x1c')][_0xd043('0x1d')]()][_0xd043('0x17')]();}});}return _0x195961;}function getName(_0xf88303){if(_0xf88303['indexOf']('\x20')>0x0){var _0x24a37a=_0xf88303[_0xd043('0x1e')](/ (.+)/);if(_0x24a37a[0x1]){return _0x24a37a;}}return[_0xf88303,_0xf88303];}var accountsTokens={};function getAccessToken(_0x2d7758){return new Promise(function(_0x15e2dd,_0x1d8bbd){if(!_['isNil'](accountsTokens[_0x2d7758['id']])&&!_[_0xd043('0x1f')](accountsTokens[_0x2d7758['id']][_0xd043('0x20')])){if(moment()[_0xd043('0x21')](accountsTokens[_0x2d7758['id']]['expires_in'])){_0x15e2dd(accountsTokens[_0x2d7758['id']]['access_token']);}}var _0x10eadb;switch(_0x2d7758[_0xd043('0x22')]){case'US':_0x10eadb=_0xd043('0x23');break;case'AU':_0x10eadb=_0xd043('0x24');break;case'EU':_0x10eadb=_0xd043('0x25');break;case'IN':_0x10eadb=_0xd043('0x26');break;case'CN':_0x10eadb=_0xd043('0x27');break;default:_0x10eadb=_0xd043('0x25');break;}var _0x88798e={'method':'POST','uri':_0x10eadb+_0xd043('0x28'),'qs':{'refresh_token':_0x2d7758[_0xd043('0x29')],'client_id':_0x2d7758['clientId'],'client_secret':_0x2d7758[_0xd043('0x2a')],'grant_type':_0xd043('0x2b')},'json':!![]};return rp(_0x88798e)[_0xd043('0x2c')](function(_0x3a7ea9){accountsTokens[_0x2d7758['id']]={'access_token':_0x3a7ea9[_0xd043('0x20')],'expires_in':moment()['add'](_0x3a7ea9[_0xd043('0x2d')],_0xd043('0x2e'))};_0x15e2dd(_0x3a7ea9['access_token']);})['catch'](function(_0x4f9992){logger[_0xd043('0x2f')](_0xd043('0x30'),_0x4f9992[_0xd043('0x31')]);_0x1d8bbd(_0x4f9992);});});}function getUser(_0x2f1de2,_0x583d5c,_0x1728fe,_0x15a803){logger[_0xd043('0x32')](_0xd043('0x33'));return request({'method':_0xd043('0x34'),'uri':util[_0xd043('0x35')]('https://www.zohoapis.%s/crm/v2/users',_0x583d5c),'qs':{'type':_0xd043('0x36')},'headers':{'Authorization':_0xd043('0x37')+_0x2f1de2},'json':!![]})[_0xd043('0x2c')](function(_0x1ff97b){if(_0x1ff97b['users']){var _0x17940a=-0x1;if(_['isArrayLikeObject'](_0x1ff97b[_0xd043('0x38')])){if(!_[_0xd043('0x1f')](_0x15a803)){_0x17940a=_[_0xd043('0x39')](_0x1ff97b['users'],function(_0x3fb29b){return _0x3fb29b[_0xd043('0x3a')]===_0x15a803;});}if(_0x17940a>=0x0){logger['info'](_0xd043('0x3b'));}else{logger[_0xd043('0x32')](_0xd043('0x3c'));_0x17940a=_[_0xd043('0x39')](_0x1ff97b['users'],function(_0x14d7a2){return _0x14d7a2[_0xd043('0x3d')][_0xd043('0x1c')]===_0xd043('0x3e');});}return _0x1ff97b['users'][_0x17940a];}else{if(_0x1ff97b[_0xd043('0x3f')][_0xd043('0x3d')]['name']==='Administrator'){logger[_0xd043('0x32')]('Using\x20the\x20admin\x20account!');user=_0x1ff97b[_0xd043('0x3f')];return user;}else{logger['error'](_0xd043('0x40'),JSON['stringify'](_0x1ff97b));throw new Error(_0xd043('0x41')+JSON[_0xd043('0x10')](_0x1ff97b));}}}else{logger[_0xd043('0x2f')](_0xd043('0x40'),JSON[_0xd043('0x10')](_0x1ff97b));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xd043('0x10')](_0x1ff97b));}})[_0xd043('0x42')](function(_0x4f788c){console[_0xd043('0x2f')](_0x4f788c);});}function getZohoUser(_0x1a610f,_0x1052c0){return new BPromise(function(_0x3364f7,_0x235855){request(_0x1a610f)[_0xd043('0x2c')](function(_0x1bb4cc){var _0x259391=null;if(_0x1bb4cc){_0x259391=_0x1bb4cc[_0xd043('0x43')][0x0];_0x259391[_0xd043('0x44')]=_0x1052c0;}_0x3364f7(_0x259391);})[_0xd043('0x42')](function(_0x22a46c){_0x235855(_0x22a46c);});});}function createEndUser(_0x3769fd,_0x1ba03b,_0x5bc483,_0x4b6549,_0x27f4b6,_0x44c4dd){var _0x5bc483=getName(_0x5bc483);return request({'method':'POST','uri':_0xd043('0x45')+_0x1ba03b+_0xd043('0x46')+_[_0xd043('0x47')](_0x44c4dd['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5bc483[0x1],'First_Name':_0x5bc483[0x0],'Phone':_0x4b6549,'Owner':{'name':!_[_0xd043('0x1f')](_0x27f4b6['role'][_0xd043('0x1c')])?_0x27f4b6['role'][_0xd043('0x1c')]:!_[_0xd043('0x1f')](_0x27f4b6['first_name'])?_0x27f4b6[_0xd043('0x48')]+'\x20'+_0x27f4b6[_0xd043('0x49')]:_0x27f4b6[_0xd043('0x49')],'id':_0x27f4b6['id']}}]},'headers':{'Authorization':_0xd043('0x37')+_0x3769fd},'json':!![]})[_0xd043('0x2c')](function(_0x329bef){if(_0x329bef&&_0x329bef['data'][0x0][_0xd043('0x4a')]==='SUCCESS'){var _0x5eac82=_0x329bef[_0xd043('0x43')][0x0][_0xd043('0x4b')];_0x5eac82[_0xd043('0x44')]=_[_0xd043('0x47')](_0x44c4dd[_0xd043('0x4c')])+'s';return _0x5eac82;}logger['error'](_0xd043('0x40'),JSON[_0xd043('0x10')](data));throw new Error(_0xd043('0x4d')+JSON['stringify'](data));})[_0xd043('0x42')](function(_0x1ac3d2){console[_0xd043('0x4e')](_0xd043('0x4f'),_0x1ac3d2);});}function getEndUser(_0x34ad3c,_0x19d66a,_0xfcf5e0,_0x3fcdc1,_0x23e631,_0x443118,_0x1d26ca){var _0x5c247c={'method':'GET','uri':'','headers':{'Authorization':_0xd043('0x37')+_0x34ad3c},'json':!![]};switch(_0x1d26ca[_0xd043('0x50')]){case _0xd043('0x51'):_0x5c247c['uri']=_0xd043('0x45')+_0x19d66a+_0xd043('0x52')+_0x23e631+'))';return getZohoUser(_0x5c247c,'Contacts')['then'](function(_0x2a6c5c){if(_0x2a6c5c)return _0x2a6c5c;_0x5c247c[_0xd043('0x53')]=_0xd043('0x45')+_0x19d66a+_0xd043('0x54')+_0x23e631+'))';return getZohoUser(_0x5c247c,'Leads')['then'](function(_0x908d61){if(_0x908d61)return _0x908d61;if(_0x1d26ca['moduleCreate']!='nothing'){return createEndUser(_0x34ad3c,_0x19d66a,_0x3fcdc1,_0x23e631,_0x443118,_0x1d26ca);}else{return{};}});});break;case _0xd043('0x55'):_0x5c247c[_0xd043('0x53')]='https://www.zohoapis.'+_0x19d66a+_0xd043('0x52')+_0x23e631+'))';return getZohoUser(_0x5c247c,_0xd043('0x56'))[_0xd043('0x2c')](function(_0x540477){if(_0x540477)return _0x540477;if(_0x1d26ca[_0xd043('0x4c')]!=_0xd043('0x57')){return createEndUser(_0x34ad3c,_0x19d66a,_0x3fcdc1,_0x23e631,_0x443118,_0x1d26ca);}else{return{};}});break;case _0xd043('0x58'):_0x5c247c['uri']=_0xd043('0x45')+_0x19d66a+_0xd043('0x54')+_0x23e631+'))';return getZohoUser(_0x5c247c,_0xd043('0x59'))[_0xd043('0x2c')](function(_0xc06c6f){if(_0xc06c6f)return _0xc06c6f;if(_0x1d26ca[_0xd043('0x4c')]!=_0xd043('0x57')){return createEndUser(_0x34ad3c,_0x19d66a,_0x3fcdc1,_0x23e631,_0x443118,_0x1d26ca);}else{return{};}});break;}}function getCall(_0x57055d,_0x311c4e,_0x5053f4,_0x5e9d0e,_0x122718,_0xe36643,_0x29c848,_0x1cf8cd){logger['info'](_0xd043('0x5a'));var _0x4d9703={};_0x4d9703[_0xd043('0x5b')]={'name':!_[_0xd043('0x1f')](_0x5e9d0e[_0xd043('0x5c')][_0xd043('0x1c')])&&!_[_0xd043('0x1f')](_0x5e9d0e[_0xd043('0x3d')]['name'])&&_0x5e9d0e[_0xd043('0x3d')][_0xd043('0x1c')]===_0xd043('0x5d')?_0x5e9d0e[_0xd043('0x5c')][_0xd043('0x1c')]:!_[_0xd043('0x1f')](_0x5e9d0e['first_name'])?_0x5e9d0e[_0xd043('0x48')]+'\x20'+_0x5e9d0e[_0xd043('0x49')]:_0x5e9d0e[_0xd043('0x49')],'id':_0x5e9d0e['id']};_0x4d9703[_0xd043('0x5e')]=intUtil[_0xd043('0x5f')](_0xe36643[_0xd043('0x60')],_0x29c848,'\x20');_0x4d9703[_0xd043('0x61')]=intUtil[_0xd043('0x5f')](_0xe36643[_0xd043('0x62')],_0x29c848,'\x0a');if(_0x122718[_0xd043('0x44')]===_0xd043('0x56')){_0x4d9703[_0xd043('0x63')]={'name':!_[_0xd043('0x1f')](_0x122718[_0xd043('0x64')])?_0x122718[_0xd043('0x64')]:!_[_0xd043('0x1f')](_0x122718[_0xd043('0x65')])?_0x122718[_0xd043('0x65')]+'\x20'+_0x122718[_0xd043('0x66')]:_0x122718['Last_Name'],'id':_0x122718['id']};}if(_0x122718['enduserType']==='Leads'){_0x4d9703[_0xd043('0x67')]={'name':!_['isNil'](_0x122718['Full_Name'])?_0x122718['Full_Name']:!_['isNil'](_0x122718[_0xd043('0x65')])?_0x122718[_0xd043('0x65')]+'\x20'+_0x122718[_0xd043('0x66')]:_0x122718[_0xd043('0x66')],'id':_0x122718['id']};_0x4d9703[_0xd043('0x68')]=_[_0xd043('0x47')](_0x122718[_0xd043('0x44')]);}if(_0x29c848[_0xd043('0x69')]){_0x4d9703['Call_Duration']=moment[_0xd043('0x6a')](parseInt(_0x29c848[_0xd043('0x69')])*0x3e8)['format'](_0xd043('0x6b'));}else if(_0x29c848[_0xd043('0x6c')]&&_0x29c848[_0xd043('0x6d')]){_0x4d9703['Call_Duration']=moment[_0xd043('0x6a')](moment(_0x29c848[_0xd043('0x6d')],_0xd043('0x6e'))[_0xd043('0x6f')](moment(_0x29c848['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0xd043('0x35')](_0xd043('0x6b'));}switch(_0x29c848[_0xd043('0x70')]){case'called':_0x4d9703['Call_Result']=_0xd043('0x71');break;case _0xd043('0x72'):case _0xd043('0x73'):_0x4d9703[_0xd043('0x74')]=_0xd043('0x75');break;case'rejected':_0x4d9703[_0xd043('0x74')]=_0xd043('0x76');break;case'abandoned':_0x4d9703[_0xd043('0x74')]=_0xd043('0x77');break;case'timeout':_0x4d9703[_0xd043('0x74')]=_0xd043('0x78');default:}_0x4d9703['Call_Start_Time']=(_0x1cf8cd===_0xd043('0x79')?moment(_0x29c848[_0xd043('0x7a')])[_0xd043('0x35')](_0xd043('0x6e')):moment(_0x29c848[_0xd043('0x7b')])['format'](_0xd043('0x6e')))||moment()['format'](_0xd043('0x6e'));_0x4d9703[_0xd043('0x7c')]=_0x1cf8cd||_0xd043('0x7d');_0x4d9703=_[_0xd043('0x7e')](_0x4d9703,getCustomFields(_0xe36643[_0xd043('0x7f')],_0x29c848));return request({'method':_0xd043('0x80'),'uri':_0xd043('0x45')+_0x311c4e+_0xd043('0x81'),'headers':{'Authorization':_0xd043('0x37')+_0x57055d},'body':{'data':[_0x4d9703]},'json':!![]})['then'](function(_0x4bc73e){if(_0x4bc73e&&_0x4bc73e[_0xd043('0x43')][0x0][_0xd043('0x4a')]===_0xd043('0x82')){logger[_0xd043('0x32')](_0xd043('0x83'));return{'id':_0x4bc73e[_0xd043('0x43')][0x0]['details']['id']};}})[_0xd043('0x42')](function(_0x4571ef){logger[_0xd043('0x32')](_0xd043('0x84'),_0x4571ef[_0xd043('0x31')]);console[_0xd043('0x4e')](_0xd043('0x84'),_0x4571ef);});}exports['queue']=function(_0x250d49,_0x2bee43,_0x485374,_0x1fc98e,_0x58f9e8,_0x16de43){var _0x1dd437,_0x3bb5a7,_0x332085;_0x16de43['host']=intUtil['stripTrailingSlash'](_0x16de43[_0xd043('0x85')]);_0x16de43[_0xd043('0x86')]=intUtil[_0xd043('0x87')](_0x16de43[_0xd043('0x86')]);if(_0x58f9e8&&_0x58f9e8[_0xd043('0x88')]){logger['info'](_0xd043('0x89'),_0xd043('0x8a'));_0x2bee43[_0xd043('0x8b')]=_0x16de43['serverUrl']+_0xd043('0x8c')+_0x2bee43[_0xd043('0x8d')]+_0xd043('0x8e')+md5(_0x2bee43[_0xd043('0x8d')]);}else{_0x2bee43[_0xd043('0x8b')]='';}var _0x33cc97=_0x16de43[_0xd043('0x85')]===_0xd043('0x8f')?'eu':'com';return getAccessToken(_0x16de43)['then'](function(_0x13d216){_0x332085=_0x13d216;return getUser(_0x332085,_0x33cc97,_0x16de43,_0x1fc98e['email']);})[_0xd043('0x2c')](function(_0x3aca39){_0x1dd437=_0x3aca39;logger[_0xd043('0x32')](_0xd043('0x90'),_0x1dd437['id']);return getEndUser(_0x332085,_0x33cc97,_0x16de43,_0x2bee43[_0xd043('0x91')],_0x2bee43[_0xd043('0x92')],_0x1dd437,_0x485374);})[_0xd043('0x2c')](function(_0x7fdaae){_0x3bb5a7=_0x7fdaae;return getCall(_0x332085,_0x33cc97,_0x16de43,_0x1dd437,_0x3bb5a7,_0x485374,_0x2bee43,_0xd043('0x7d'));})['then'](function(_0x11e202){if(_0x11e202){logger[_0xd043('0x32')](_0xd043('0x93'),_0x11e202['id']);logger[_0xd043('0x32')](_0xd043('0x89'),_0xd043('0x94'));emit(util['format'](_0xd043('0x95'),_0x1fc98e[_0xd043('0x1c')]),_0xd043('0x96'),{'uri':_0xd043('0x97')+_0x16de43[_0xd043('0x85')]+_0xd043('0x98')+_0x11e202['id']});}})[_0xd043('0x42')](function(_0x29c3bb){logger['error'](_0xd043('0x89'),JSON[_0xd043('0x10')](_0x29c3bb));});};exports['outbound']=function(_0x4c49f4,_0x319470,_0x5b44e6,_0x11f889,_0x1017f9,_0x2f6fe5,_0x4f5efa){var _0x5df6de,_0x439058,_0x5f78b4;_0x2f6fe5[_0xd043('0x85')]=intUtil['stripTrailingSlash'](_0x2f6fe5[_0xd043('0x85')]);_0x2f6fe5[_0xd043('0x86')]=intUtil[_0xd043('0x87')](_0x2f6fe5[_0xd043('0x86')]);if(_0x4f5efa&&_0x4f5efa['recordingFormat']&&_0x4f5efa[_0xd043('0x99')]!==_0xd043('0x9a')){logger[_0xd043('0x32')](_0xd043('0x9b'),_0xd043('0x8a'));_0x319470[_0xd043('0x8b')]=_0x2f6fe5[_0xd043('0x86')]+_0xd043('0x8c')+_0x319470['uniqueid']+_0xd043('0x8e')+md5(_0x319470['uniqueid']);}var _0x5d0efb=_0x2f6fe5['host']===_0xd043('0x8f')?'eu':_0xd043('0x9c');return getAccessToken(_0x2f6fe5)[_0xd043('0x2c')](function(_0x5e1ba0){_0x5f78b4=_0x5e1ba0;return getUser(_0x5f78b4,_0x5d0efb,_0x2f6fe5,_0x11f889[_0xd043('0x3a')]);})[_0xd043('0x2c')](function(_0x18c0ca){_0x5df6de=_0x18c0ca;logger['info'](_0xd043('0x90'),_0x5df6de['id']);return getEndUser(_0x5f78b4,_0x5d0efb,_0x2f6fe5,_0x319470['destcalleridname'],_0x319470[_0xd043('0x9d')],_0x5df6de,_0x5b44e6);})[_0xd043('0x2c')](function(_0x327de1){_0x439058=_0x327de1;return getCall(_0x5f78b4,_0x5d0efb,_0x2f6fe5,_0x5df6de,_0x439058,_0x5b44e6,_0x319470,'Outbound');})[_0xd043('0x2c')](function(_0x3de454){if(_0x3de454){logger[_0xd043('0x32')](_0xd043('0x93'),_0x3de454['id']);logger[_0xd043('0x32')](_0xd043('0x9b'),_0xd043('0x94'));emit(util['format'](_0xd043('0x95'),_0x11f889['name']),_0xd043('0x96'),{'uri':_0xd043('0x97')+_0x2f6fe5['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x3de454['id']});}})[_0xd043('0x42')](function(_0xa8712b){logger[_0xd043('0x2f')](_0xd043('0x9b'),JSON['stringify'](_0xa8712b));});};exports[_0xd043('0x9e')]=function(_0x29a877,_0x519f36,_0x42cfe7,_0x4e2805,_0x1b69d7,_0x3ff646){var _0x55f428,_0x456dd1,_0x348b94;_0x3ff646[_0xd043('0x85')]=intUtil['stripTrailingSlash'](_0x3ff646[_0xd043('0x85')]);_0x3ff646[_0xd043('0x86')]=intUtil[_0xd043('0x87')](_0x3ff646[_0xd043('0x86')]);if(_0x1b69d7&&_0x1b69d7[_0xd043('0x88')]){logger[_0xd043('0x32')]('['+_0x519f36[_0xd043('0x70')][_0xd043('0x9f')]()+']','Recording\x20is\x20enabled!');_0x519f36[_0xd043('0x8b')]=_0x3ff646[_0xd043('0x86')]+_0xd043('0x8c')+_0x519f36[_0xd043('0x8d')]+_0xd043('0x8e')+md5(_0x519f36[_0xd043('0x8d')]);}else{_0x519f36[_0xd043('0x8b')]='';}var _0x4eacd8=_0x3ff646[_0xd043('0x85')]===_0xd043('0x8f')?'eu':_0xd043('0x9c');return getAccessToken(_0x3ff646)[_0xd043('0x2c')](function(_0x1983f1){_0x348b94=_0x1983f1;return getUser(_0x348b94,_0x4eacd8,_0x3ff646);})[_0xd043('0x2c')](function(_0x5040b4){_0x55f428=_0x5040b4;logger[_0xd043('0x32')](_0xd043('0x90'),_0x55f428['id']);return getEndUser(_0x348b94,_0x4eacd8,_0x3ff646,_0x519f36[_0xd043('0x91')],_0x519f36[_0xd043('0x92')],_0x55f428,_0x42cfe7);})['then'](function(_0xa17048){_0x456dd1=_0xa17048;return getCall(_0x348b94,_0x4eacd8,_0x3ff646,_0x55f428,_0x456dd1,_0x42cfe7,_0x519f36,'Inbound');})[_0xd043('0x2c')](function(_0x4ad937){if(_0x4ad937){logger[_0xd043('0x32')](_0xd043('0x93'),_0x4ad937['id']);}})['catch'](function(_0x3f4e05){logger[_0xd043('0x2f')]('['+_0x519f36[_0xd043('0x70')]['toUpperCase']()+']',JSON['stringify'](_0x3f4e05));});};
\ No newline at end of file
index 81265f5..31f2cf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x041a=['data2','Script','data3','render','error','format','info','shelljs','mustache','../../../../config/logger','trigger','exec'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x041a,0x17b));var _0xa041=function(_0x98ac1f,_0x2effb0){_0x98ac1f=_0x98ac1f-0x0;var _0x1579d1=_0x041a[_0x98ac1f];return _0x1579d1;};'use strict';var util=require('util');var sh=require(_0xa041('0x0'));var Mustache=require(_0xa041('0x1'));var logger=require(_0xa041('0x2'))(_0xa041('0x3'));exports[_0xa041('0x4')]=function(_0x1d217f,_0x1e4553){var _0x497e4a=_0x1d217f[_0xa041('0x5')]?_0x1d217f[_0xa041('0x5')]:_0xa041('0x6');var _0x50d594=_0x1d217f[_0xa041('0x7')]?Mustache[_0xa041('0x8')](_0x1d217f[_0xa041('0x7')],_0x1e4553):_0x1e4553;sh[_0xa041('0x4')](_0x50d594,function(_0x369318,_0x47f3ab,_0x252b84){if(_0x369318!==0x0){logger[_0xa041('0x9')](util[_0xa041('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x497e4a,_0x50d594,_0x369318,_0x252b84));}else{logger[_0xa041('0xb')](util[_0xa041('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x497e4a,_0x50d594,_0x47f3ab));}});};
\ No newline at end of file
+var _0x52a7=['data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger','exec','Script'];(function(_0x4a8ec5,_0x2d3f57){var _0x4cd4b1=function(_0x21ed1e){while(--_0x21ed1e){_0x4a8ec5['push'](_0x4a8ec5['shift']());}};_0x4cd4b1(++_0x2d3f57);}(_0x52a7,0xa2));var _0x752a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x52a7[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0x752a('0x0'));var sh=require(_0x752a('0x1'));var Mustache=require(_0x752a('0x2'));var logger=require(_0x752a('0x3'))(_0x752a('0x4'));exports[_0x752a('0x5')]=function(_0x1e4020,_0x566985){var _0x3af2d2=_0x1e4020['data2']?_0x1e4020['data2']:_0x752a('0x6');var _0x52f572=_0x1e4020[_0x752a('0x7')]?Mustache[_0x752a('0x8')](_0x1e4020['data3'],_0x566985):_0x566985;sh[_0x752a('0x5')](_0x52f572,function(_0x1514b8,_0x234bd9,_0x203ff8){if(_0x1514b8!==0x0){logger[_0x752a('0x9')](util[_0x752a('0xa')](_0x752a('0xb'),_0x3af2d2,_0x52f572,_0x1514b8,_0x203ff8));}else{logger[_0x752a('0xc')](util[_0x752a('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x3af2d2,_0x52f572,_0x234bd9));}});};
\ No newline at end of file
index 2f92554..b76fddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5c7=['mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','GET','DELETE','POST','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','request-promise','util','lodash'];(function(_0x456176,_0x32304b){var _0x1a1709=function(_0x31a562){while(--_0x31a562){_0x456176['push'](_0x456176['shift']());}};_0x1a1709(++_0x32304b);}(_0xd5c7,0xeb));var _0x7d5c=function(_0x464c1d,_0x47a56b){_0x464c1d=_0x464c1d-0x0;var _0x3482cb=_0xd5c7[_0x464c1d];return _0x3482cb;};'use strict';var rp=require(_0x7d5c('0x0'));var util=require(_0x7d5c('0x1'));var _=require(_0x7d5c('0x2'));var Mustache=require(_0x7d5c('0x3'));var logger=require(_0x7d5c('0x4'))(_0x7d5c('0x5'));exports['exec']=function(_0x3fce7f,_0x59b34a){var _0x49bd62,_0x352093;var _0x1a3099={'method':_0x3fce7f[_0x7d5c('0x6')][_0x7d5c('0x7')](),'uri':Mustache[_0x7d5c('0x8')](_0x3fce7f[_0x7d5c('0x9')],_0x59b34a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3fce7f[_0x7d5c('0xa')])===_0x7d5c('0xb')&&parseInt(_0x3fce7f['data5'])>=0x1&&parseInt(_0x3fce7f[_0x7d5c('0xa')])<=0xa?parseInt(_0x3fce7f[_0x7d5c('0xa')])*0x3e8:0x5*0x3e8};try{_0x1a3099[_0x7d5c('0xc')]=_0x3fce7f[_0x7d5c('0xd')]?JSON[_0x7d5c('0xe')](Mustache[_0x7d5c('0x8')](_0x3fce7f[_0x7d5c('0xd')],_0x59b34a)):{};}catch(_0x1eba0b){logger[_0x7d5c('0xf')](_0x1eba0b['stack']);}switch(_0x3fce7f['data1'][_0x7d5c('0x7')]()){case _0x7d5c('0x10'):case _0x7d5c('0x11'):_0x49bd62=null;_0x1a3099['qs']=_0x59b34a;break;case _0x7d5c('0x12'):case _0x7d5c('0x13'):if(_0x3fce7f['data7']){try{_0x49bd62=JSON[_0x7d5c('0xe')](Mustache[_0x7d5c('0x8')](_0x3fce7f[_0x7d5c('0x14')],_0x59b34a));_0x1a3099[_0x7d5c('0x15')]=_0x49bd62;}catch(_0x5528d9){logger[_0x7d5c('0xf')](_0x5528d9[_0x7d5c('0x16')]);logger[_0x7d5c('0xf')](_0x7d5c('0x17'));}}else{_0x49bd62=_0x59b34a;_0x1a3099[_0x7d5c('0x15')]=_0x49bd62;}break;}logger[_0x7d5c('0x18')](util[_0x7d5c('0x19')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x3fce7f['data1'],_0x3fce7f[_0x7d5c('0x9')],JSON[_0x7d5c('0x1a')](_0x1a3099)));rp(_0x1a3099)[_0x7d5c('0x1b')](function(_0x5575c9){_0x49bd62=!_[_0x7d5c('0x1c')](_0x49bd62)?_0x7d5c('0x1d')+_0x49bd62:'';_0x352093=typeof _0x5575c9[_0x7d5c('0x15')]===_0x7d5c('0x1e')?JSON[_0x7d5c('0x1a')](_0x5575c9[_0x7d5c('0x15')]):_0x5575c9[_0x7d5c('0x15')];logger['info'](util[_0x7d5c('0x19')](_0x7d5c('0x1f'),_0x3fce7f[_0x7d5c('0x6')],_0x3fce7f[_0x7d5c('0x9')],_0x5575c9[_0x7d5c('0x20')],_0x352093));})['catch'](function(_0x4bfc3e){logger[_0x7d5c('0xf')](util[_0x7d5c('0x19')](_0x7d5c('0x21'),_0x3fce7f[_0x7d5c('0x6')],_0x3fce7f[_0x7d5c('0x9')],_0x4bfc3e[_0x7d5c('0x20')],_0x4bfc3e['name'],_0x4bfc3e['message']));});};
\ No newline at end of file
+var _0x220d=['stack','GET','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data5','headers','data6','parse'];(function(_0x26f866,_0x1900bc){var _0x1abef3=function(_0x3217de){while(--_0x3217de){_0x26f866['push'](_0x26f866['shift']());}};_0x1abef3(++_0x1900bc);}(_0x220d,0x126));var _0xd220=function(_0x3f2186,_0x2e059a){_0x3f2186=_0x3f2186-0x0;var _0x33273a=_0x220d[_0x3f2186];return _0x33273a;};'use strict';var rp=require(_0xd220('0x0'));var util=require('util');var _=require(_0xd220('0x1'));var Mustache=require(_0xd220('0x2'));var logger=require(_0xd220('0x3'))(_0xd220('0x4'));exports['exec']=function(_0x19e5a2,_0x1df17f){var _0x3ff957,_0x4dbe1f;var _0x5c4ff3={'method':_0x19e5a2[_0xd220('0x5')][_0xd220('0x6')](),'uri':Mustache[_0xd220('0x7')](_0x19e5a2['data2'],_0x1df17f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x19e5a2[_0xd220('0x8')])==='number'&&parseInt(_0x19e5a2[_0xd220('0x8')])>=0x1&&parseInt(_0x19e5a2[_0xd220('0x8')])<=0xa?parseInt(_0x19e5a2['data5'])*0x3e8:0x5*0x3e8};try{_0x5c4ff3[_0xd220('0x9')]=_0x19e5a2[_0xd220('0xa')]?JSON[_0xd220('0xb')](Mustache[_0xd220('0x7')](_0x19e5a2['data6'],_0x1df17f)):{};}catch(_0x87696){logger['error'](_0x87696[_0xd220('0xc')]);}switch(_0x19e5a2[_0xd220('0x5')][_0xd220('0x6')]()){case _0xd220('0xd'):case'DELETE':_0x3ff957=null;_0x5c4ff3['qs']=_0x1df17f;break;case _0xd220('0xe'):case _0xd220('0xf'):if(_0x19e5a2[_0xd220('0x10')]){try{_0x3ff957=JSON[_0xd220('0xb')](Mustache[_0xd220('0x7')](_0x19e5a2[_0xd220('0x10')],_0x1df17f));_0x5c4ff3[_0xd220('0x11')]=_0x3ff957;}catch(_0x92d2da){logger[_0xd220('0x12')](_0x92d2da['stack']);logger['error'](_0xd220('0x13'));}}else{_0x3ff957=_0x1df17f;_0x5c4ff3[_0xd220('0x11')]=_0x3ff957;}break;}logger[_0xd220('0x14')](util[_0xd220('0x15')](_0xd220('0x16'),_0x19e5a2[_0xd220('0x5')],_0x19e5a2[_0xd220('0x17')],JSON[_0xd220('0x18')](_0x5c4ff3)));rp(_0x5c4ff3)[_0xd220('0x19')](function(_0x216ea1){_0x3ff957=!_[_0xd220('0x1a')](_0x3ff957)?_0xd220('0x1b')+_0x3ff957:'';_0x4dbe1f=typeof _0x216ea1[_0xd220('0x11')]===_0xd220('0x1c')?JSON['stringify'](_0x216ea1[_0xd220('0x11')]):_0x216ea1['body'];logger[_0xd220('0x14')](util[_0xd220('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x19e5a2[_0xd220('0x5')],_0x19e5a2[_0xd220('0x17')],_0x216ea1['statusCode'],_0x4dbe1f));})[_0xd220('0x1d')](function(_0x90c850){logger[_0xd220('0x12')](util['format'](_0xd220('0x1e'),_0x19e5a2[_0xd220('0x5')],_0x19e5a2[_0xd220('0x17')],_0x90c850[_0xd220('0x1f')],_0x90c850[_0xd220('0x20')],_0x90c850[_0xd220('0x21')]));});};
\ No newline at end of file
index fe8e0a1..fd8511a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf535=['client','http','Request','request','then','debug','rpc','error','result','catch','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x303972,_0x17bd09){var _0x2da5a3=function(_0x4b32d1){while(--_0x4b32d1){_0x303972['push'](_0x303972['shift']());}};_0x2da5a3(++_0x17bd09);}(_0xf535,0x1bc));var _0x5f53=function(_0x2b0288,_0xefe3ed){_0x2b0288=_0x2b0288-0x0;var _0x4bd806=_0xf535[_0x2b0288];return _0x4bd806;};'use strict';var jayson=require(_0x5f53('0x0'));var BPromise=require(_0x5f53('0x1'));var logger=require(_0x5f53('0x2'))(_0x5f53('0x3'));var client=jayson[_0x5f53('0x4')][_0x5f53('0x5')]({'port':0x2329});client[_0x5f53('0x6')]=function(_0x1111fb,_0x87e1d2){return new BPromise(function(_0x39a5d3,_0x33db5d){return client[_0x5f53('0x7')](_0x1111fb,_0x87e1d2)[_0x5f53('0x8')](function(_0x468704){logger[_0x5f53('0x9')](_0x5f53('0xa'),_0x5f53('0x3'),_0x1111fb,_0x87e1d2,_0x468704);if(_0x468704['error']){logger[_0x5f53('0xb')](_0x5f53('0xa'),_0x5f53('0x3'),_0x1111fb,_0x468704[_0x5f53('0xb')]['message'],_0x87e1d2);return _0x33db5d(_0x468704[_0x5f53('0xb')]['message']);}else{return _0x39a5d3(_0x468704[_0x5f53('0xc')]);}})[_0x5f53('0xd')](function(_0x5b3a16){logger[_0x5f53('0xb')](_0x5f53('0xa'),_0x5f53('0x3'),_0x1111fb,_0x5b3a16,_0x87e1d2);return _0x33db5d(_0x5b3a16);});});};module['exports']=client;
\ No newline at end of file
+var _0xc819=['request','then','debug','rpc','routing','error','message','result','catch','jayson/promise','client','http','Request'];(function(_0x59c279,_0x569642){var _0x3a4fa1=function(_0x3a4a41){while(--_0x3a4a41){_0x59c279['push'](_0x59c279['shift']());}};_0x3a4fa1(++_0x569642);}(_0xc819,0x134));var _0x9c81=function(_0x928df6,_0x4ca915){_0x928df6=_0x928df6-0x0;var _0x4822b7=_0xc819[_0x928df6];return _0x4822b7;};'use strict';var jayson=require(_0x9c81('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson[_0x9c81('0x1')][_0x9c81('0x2')]({'port':0x2329});client[_0x9c81('0x3')]=function(_0x1461d1,_0x1430ba){return new BPromise(function(_0x5e0e0b,_0x1334c3){return client[_0x9c81('0x4')](_0x1461d1,_0x1430ba)[_0x9c81('0x5')](function(_0x48fc7d){logger[_0x9c81('0x6')](_0x9c81('0x7'),_0x9c81('0x8'),_0x1461d1,_0x1430ba,_0x48fc7d);if(_0x48fc7d[_0x9c81('0x9')]){logger[_0x9c81('0x9')]('rpc',_0x9c81('0x8'),_0x1461d1,_0x48fc7d[_0x9c81('0x9')][_0x9c81('0xa')],_0x1430ba);return _0x1334c3(_0x48fc7d[_0x9c81('0x9')][_0x9c81('0xa')]);}else{return _0x5e0e0b(_0x48fc7d[_0x9c81('0xb')]);}})[_0x9c81('0xc')](function(_0x36818f){logger[_0x9c81('0x9')]('rpc',_0x9c81('0x8'),_0x1461d1,_0x36818f,_0x1430ba);return _0x1334c3(_0x36818f);});});};module['exports']=client;
\ No newline at end of file
index ae6ae98..8190f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1914=['./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts','refresh','listen','catch','Email\x20service\x20initialization','./server'];(function(_0x44c171,_0x1f6c9c){var _0xfd0c71=function(_0x295ba0){while(--_0x295ba0){_0x44c171['push'](_0x44c171['shift']());}};_0xfd0c71(++_0x1f6c9c);}(_0x1914,0x1b9));var _0x4191=function(_0x1cc089,_0x1e081b){_0x1cc089=_0x1cc089-0x0;var _0x4c5943=_0x1914[_0x1cc089];return _0x4c5943;};'use strict';var server=require(_0x4191('0x0'));var Realtime=require(_0x4191('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x4191('0x2'));var setting=require(_0x4191('0x3'));var logger=require(_0x4191('0x4'))(_0x4191('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x4191('0x6')](mailAccount[_0x4191('0x7')]())['then'](realtime[_0x4191('0x8')]())[_0x4191('0x6')](function(){email[_0x4191('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x4191('0xa')](realtime,email)[_0x4191('0x6')](function(){return initRealtime();})[_0x4191('0x6')](function(){return setting['getSettings']();})[_0x4191('0x6')](function(_0x1383b1){return setInterval(initRealtime,_0x1383b1['loginMailFrequency']*0x3e8);})[_0x4191('0xb')](function(_0x29ae24){logger['error'](_0x4191('0xc'),_0x29ae24);});}main();
\ No newline at end of file
+var _0x0db9=['getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x0db9,0x19a));var _0x90db=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x0db9[_0x5e238b];return _0x389bea;};'use strict';var server=require(_0x90db('0x0'));var Realtime=require(_0x90db('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x90db('0x2'));var setting=require('./rpc/setting');var logger=require(_0x90db('0x3'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x90db('0x4')]()[_0x90db('0x5')](mailAccount[_0x90db('0x6')]())[_0x90db('0x5')](realtime[_0x90db('0x7')]())[_0x90db('0x5')](function(){email[_0x90db('0x8')](realtime[_0x90db('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x90db('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0x90db('0xa')]();})[_0x90db('0x5')](function(_0x48d85c){return setInterval(initRealtime,_0x48d85c[_0x90db('0xb')]*0x3e8);})[_0x90db('0xc')](function(_0x32afb0){logger[_0x90db('0xd')](_0x90db('0xe'),_0x32afb0);});}main();
\ No newline at end of file
index 54be2b9..9ed2d8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a41=['messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','moment','bluebird','md5','../../../config/environment','email','defaults','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','total','isNil','stringify','mailAccount:update','active','provider','custom','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','disabled'];(function(_0xd41199,_0x372d54){var _0x523e84=function(_0x5370e9){while(--_0x5370e9){_0xd41199['push'](_0xd41199['shift']());}};_0x523e84(++_0x372d54);}(_0x6a41,0x83));var _0x16a4=function(_0x42bda2,_0x4106ca){_0x42bda2=_0x42bda2-0x0;var _0x625d2d=_0x6a41[_0x42bda2];return _0x625d2d;};'use strict';var _=require(_0x16a4('0x0'));var moment=require(_0x16a4('0x1'));var BPromise=require(_0x16a4('0x2'));var md5=require(_0x16a4('0x3'));var Redis=require('ioredis');var config=require(_0x16a4('0x4'));var logger=require('../../../config/logger')(_0x16a4('0x5'));config['redis']=_[_0x16a4('0x6')](config[_0x16a4('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x16a4('0x8'))(new Redis(config[_0x16a4('0x7')]));var EmailImap=require(_0x16a4('0x9'));var EmailSmtp=require(_0x16a4('0xa'));var mailAccount=require(_0x16a4('0xb'));var md5Accounts={};function EmailChannel(_0x338cf5){logger[_0x16a4('0xc')](_0x16a4('0xd'));this[_0x16a4('0xe')]=_0x338cf5[_0x16a4('0xe')];this[_0x16a4('0xf')]={};this[_0x16a4('0x10')]=new EmailSmtp();}EmailChannel[_0x16a4('0x11')][_0x16a4('0x12')]=function(_0xa0634b){var _0x4bd44f=this['mailAccounts'][_0xa0634b];var _0x59e906={'id':_0x4bd44f['id'],'name':_0x4bd44f[_0x16a4('0x13')],'key':_0x4bd44f[_0x16a4('0x14')],'active':_0x4bd44f['active'],'Imap':{'status':_0x4bd44f[_0x16a4('0x15')][_0x16a4('0x16')],'messageStatus':_0x4bd44f[_0x16a4('0x15')]['messageStatus'],'total':_0x4bd44f['Imap'][_0x16a4('0x17')]}};if(_[_0x16a4('0x18')](md5Accounts[_0xa0634b])){md5Accounts[_0xa0634b]={};}var _0x3e30f4=md5(JSON[_0x16a4('0x19')](_0x59e906));if(md5Accounts[_0xa0634b][_0x16a4('0x3')]!==_0x3e30f4){md5Accounts[_0xa0634b]['md5']=_0x3e30f4;io[_0x16a4('0x12')](_0x16a4('0x1a'),_0x59e906);}};EmailChannel[_0x16a4('0x11')]['refresh']=function(_0x13ff41){for(var _0x5315e5 in _0x13ff41){if(_0x13ff41['hasOwnProperty'](_0x5315e5)){if(_0x13ff41[_0x5315e5][_0x16a4('0x15')]&&_0x13ff41[_0x5315e5][_0x16a4('0x1b')]){var _0x581d36=_0x13ff41[_0x5315e5][_0x16a4('0x15')];if(!_0x581d36['service']&&_0x13ff41[_0x5315e5][_0x16a4('0x1c')]!==_0x16a4('0x1d'))_0x581d36['service']=_0x13ff41[_0x5315e5][_0x16a4('0x1c')];if(!this[_0x16a4('0xf')][_0x16a4('0x1e')](_0x581d36['id'])){this[_0x16a4('0xf')][_0x581d36['id']]=new EmailImap(_0x581d36,_0x13ff41[_0x5315e5][_0x16a4('0x5')]);this[_0x16a4('0xf')][_0x581d36['id']]['on'](_0x16a4('0x1f'),this[_0x16a4('0x20')][_0x16a4('0x21')](this,_0x5315e5));this['imapAccounts'][_0x581d36['id']]['on']('email',this[_0x16a4('0x22')][_0x16a4('0x21')](this,_0x5315e5));this['imapAccounts'][_0x581d36['id']]['on']('end',this[_0x16a4('0x23')]['bind'](this,_0x5315e5));this[_0x16a4('0xf')][_0x581d36['id']]['on']('error',this['handleImapError']['bind'](this,_0x5315e5));}}else{if(_[_0x16a4('0x18')](this[_0x16a4('0xe')][_0x5315e5][_0x16a4('0x15')])){this[_0x16a4('0xe')][_0x5315e5][_0x16a4('0x15')]={};}this[_0x16a4('0xe')][_0x5315e5][_0x16a4('0x15')][_0x16a4('0x16')]=_0x16a4('0x24');this[_0x16a4('0xe')][_0x5315e5][_0x16a4('0x15')][_0x16a4('0x25')]='';this[_0x16a4('0x12')](_0x5315e5);}}}};EmailChannel['prototype'][_0x16a4('0x20')]=function(_0x363408,_0x51a9e8){if(this[_0x16a4('0xe')][_0x363408]){this[_0x16a4('0xe')][_0x363408][_0x16a4('0x15')][_0x16a4('0x16')]=_0x16a4('0x26');this[_0x16a4('0xe')][_0x363408]['Imap'][_0x16a4('0x25')]=_0x51a9e8[_0x16a4('0x13')];if(_0x51a9e8[_0x16a4('0x27')]){this[_0x16a4('0xe')][_0x363408][_0x16a4('0x15')][_0x16a4('0x17')]=_0x51a9e8[_0x16a4('0x27')][_0x16a4('0x17')];}return this[_0x16a4('0x12')](_0x363408);}};EmailChannel[_0x16a4('0x11')]['handleImapEmail']=function(_0x59921a,_0x138a46){logger[_0x16a4('0xc')](_0x16a4('0x28'),_0x138a46[_0x16a4('0x29')],_0x138a46[_0x16a4('0x2a')],_0x138a46[_0x16a4('0x2b')],_0x59921a);if(this[_0x16a4('0xe')][_0x59921a]){return mailAccount['notify'](_0x59921a,_0x138a46)[_0x16a4('0x2c')](function(_0x4298d6){if(_0x4298d6){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x16a4('0x2d')](function(_0x3d3c18){logger[_0x16a4('0x2e')](_0x16a4('0x2f'),JSON['stringify'](_0x3d3c18));});}};EmailChannel[_0x16a4('0x11')]['handleImapEnd']=function(_0x36bca5){if(this[_0x16a4('0xe')][_0x36bca5]&&this[_0x16a4('0xe')][_0x36bca5][_0x16a4('0x15')]){if(this[_0x16a4('0xf')][this['mailAccounts'][_0x36bca5][_0x16a4('0x15')]['id']]){delete this[_0x16a4('0xf')][this['mailAccounts'][_0x36bca5][_0x16a4('0x15')]['id']];}this[_0x16a4('0xe')][_0x36bca5][_0x16a4('0x15')][_0x16a4('0x30')]=moment();this['emit'](_0x36bca5);}};EmailChannel[_0x16a4('0x11')][_0x16a4('0x31')]=function(_0x5898fd,_0x2655a2){if(this[_0x16a4('0xe')][_0x5898fd]){this['mailAccounts'][_0x5898fd][_0x16a4('0x15')][_0x16a4('0x16')]=_0x16a4('0x2e');this['mailAccounts'][_0x5898fd][_0x16a4('0x15')][_0x16a4('0x25')]=_0x2655a2;return this[_0x16a4('0x12')](_0x5898fd);}};EmailChannel[_0x16a4('0x11')][_0x16a4('0x32')]=function(_0x5e1c7b,_0x27bf70){return this[_0x16a4('0x10')][_0x16a4('0x33')](_0x5e1c7b,_0x27bf70);};EmailChannel[_0x16a4('0x11')][_0x16a4('0x34')]=function(_0x281576){var _0x5b87bf=this;if(this[_0x16a4('0xe')][_0x281576['id']]){if(_[_0x16a4('0x18')](this['mailAccounts'][_0x281576['id']][_0x16a4('0x35')])){this[_0x16a4('0xe')][_0x281576['id']][_0x16a4('0x35')]={};}this[_0x16a4('0xe')][_0x281576['id']][_0x16a4('0x35')]['lastSync']=moment();return new BPromise(function(_0x2c8052,_0x373da9){return _0x5b87bf[_0x16a4('0x10')][_0x16a4('0x36')](_0x281576)['then'](function(_0x2d97d1){_0x5b87bf['mailAccounts'][_0x281576['id']]['Smtp']['status']=_0x16a4('0x37');_0x5b87bf[_0x16a4('0xe')][_0x281576['id']]['Smtp'][_0x16a4('0x25')]='';_0x5b87bf[_0x16a4('0x12')](_0x281576['id']);_0x2c8052(_0x2d97d1);})[_0x16a4('0x2d')](function(_0x58b132){_0x5b87bf[_0x16a4('0xe')][_0x281576['id']][_0x16a4('0x35')][_0x16a4('0x16')]=_0x16a4('0x2e');_0x5b87bf[_0x16a4('0xe')][_0x281576['id']]['Smtp'][_0x16a4('0x25')]=_0x58b132;_0x5b87bf['emit'](_0x281576['id']);_0x373da9(_0x58b132);});});}return this[_0x16a4('0x10')][_0x16a4('0x36')](_0x281576);};module['exports']=EmailChannel;
\ No newline at end of file
+var _0x81b0=['name','key','status','Imap','total','isNil','stringify','mailAccount:update','hasOwnProperty','active','service','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','verifySmtp','Smtp','verify','catch','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit'];(function(_0x992172,_0x5b3614){var _0x258c34=function(_0x27d648){while(--_0x27d648){_0x992172['push'](_0x992172['shift']());}};_0x258c34(++_0x5b3614);}(_0x81b0,0x1bc));var _0x081b=function(_0x4ae056,_0x1d730e){_0x4ae056=_0x4ae056-0x0;var _0x57b50a=_0x81b0[_0x4ae056];return _0x57b50a;};'use strict';var _=require(_0x081b('0x0'));var moment=require(_0x081b('0x1'));var BPromise=require(_0x081b('0x2'));var md5=require(_0x081b('0x3'));var Redis=require(_0x081b('0x4'));var config=require(_0x081b('0x5'));var logger=require('../../../config/logger')(_0x081b('0x6'));config[_0x081b('0x7')]=_[_0x081b('0x8')](config[_0x081b('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x081b('0x9'))(new Redis(config[_0x081b('0x7')]));var EmailImap=require(_0x081b('0xa'));var EmailSmtp=require(_0x081b('0xb'));var mailAccount=require(_0x081b('0xc'));var md5Accounts={};function EmailChannel(_0x5beeed){logger[_0x081b('0xd')](_0x081b('0xe'));this['mailAccounts']=_0x5beeed[_0x081b('0xf')];this[_0x081b('0x10')]={};this[_0x081b('0x11')]=new EmailSmtp();}EmailChannel[_0x081b('0x12')][_0x081b('0x13')]=function(_0x3b8398){var _0x2c6c95=this[_0x081b('0xf')][_0x3b8398];var _0x2a087e={'id':_0x2c6c95['id'],'name':_0x2c6c95[_0x081b('0x14')],'key':_0x2c6c95[_0x081b('0x15')],'active':_0x2c6c95['active'],'Imap':{'status':_0x2c6c95['Imap'][_0x081b('0x16')],'messageStatus':_0x2c6c95[_0x081b('0x17')]['messageStatus'],'total':_0x2c6c95[_0x081b('0x17')][_0x081b('0x18')]}};if(_[_0x081b('0x19')](md5Accounts[_0x3b8398])){md5Accounts[_0x3b8398]={};}var _0x3889ec=md5(JSON[_0x081b('0x1a')](_0x2a087e));if(md5Accounts[_0x3b8398][_0x081b('0x3')]!==_0x3889ec){md5Accounts[_0x3b8398][_0x081b('0x3')]=_0x3889ec;io[_0x081b('0x13')](_0x081b('0x1b'),_0x2a087e);}};EmailChannel[_0x081b('0x12')]['refresh']=function(_0x586bc9){for(var _0xcab766 in _0x586bc9){if(_0x586bc9[_0x081b('0x1c')](_0xcab766)){if(_0x586bc9[_0xcab766][_0x081b('0x17')]&&_0x586bc9[_0xcab766][_0x081b('0x1d')]){var _0x367a53=_0x586bc9[_0xcab766][_0x081b('0x17')];if(!_0x367a53[_0x081b('0x1e')]&&_0x586bc9[_0xcab766]['provider']!==_0x081b('0x1f'))_0x367a53[_0x081b('0x1e')]=_0x586bc9[_0xcab766]['provider'];if(!this[_0x081b('0x10')][_0x081b('0x1c')](_0x367a53['id'])){this[_0x081b('0x10')][_0x367a53['id']]=new EmailImap(_0x367a53,_0x586bc9[_0xcab766][_0x081b('0x6')]);this['imapAccounts'][_0x367a53['id']]['on'](_0x081b('0x20'),this[_0x081b('0x21')][_0x081b('0x22')](this,_0xcab766));this[_0x081b('0x10')][_0x367a53['id']]['on']('email',this[_0x081b('0x23')][_0x081b('0x22')](this,_0xcab766));this['imapAccounts'][_0x367a53['id']]['on'](_0x081b('0x24'),this[_0x081b('0x25')]['bind'](this,_0xcab766));this[_0x081b('0x10')][_0x367a53['id']]['on'](_0x081b('0x26'),this[_0x081b('0x27')][_0x081b('0x22')](this,_0xcab766));}}else{if(_[_0x081b('0x19')](this[_0x081b('0xf')][_0xcab766]['Imap'])){this[_0x081b('0xf')][_0xcab766][_0x081b('0x17')]={};}this[_0x081b('0xf')][_0xcab766][_0x081b('0x17')][_0x081b('0x16')]=_0x081b('0x28');this['mailAccounts'][_0xcab766][_0x081b('0x17')][_0x081b('0x29')]='';this[_0x081b('0x13')](_0xcab766);}}}};EmailChannel['prototype'][_0x081b('0x21')]=function(_0x2175f0,_0x5311fa){if(this['mailAccounts'][_0x2175f0]){this[_0x081b('0xf')][_0x2175f0][_0x081b('0x17')]['status']=_0x081b('0x2a');this[_0x081b('0xf')][_0x2175f0]['Imap'][_0x081b('0x29')]=_0x5311fa[_0x081b('0x14')];if(_0x5311fa['messages']){this['mailAccounts'][_0x2175f0][_0x081b('0x17')][_0x081b('0x18')]=_0x5311fa[_0x081b('0x2b')][_0x081b('0x18')];}return this['emit'](_0x2175f0);}};EmailChannel[_0x081b('0x12')]['handleImapEmail']=function(_0x254fb2,_0x4c1605){logger[_0x081b('0xd')](_0x081b('0x2c'),_0x4c1605[_0x081b('0x2d')],_0x4c1605[_0x081b('0x2e')],_0x4c1605['from'],_0x254fb2);if(this[_0x081b('0xf')][_0x254fb2]){return mailAccount[_0x081b('0x2f')](_0x254fb2,_0x4c1605)[_0x081b('0x30')](function(_0x2e30de){if(_0x2e30de){logger['info'](_0x081b('0x31'));}})['catch'](function(_0x3c1c15){logger[_0x081b('0x26')](_0x081b('0x32'),JSON[_0x081b('0x1a')](_0x3c1c15));});}};EmailChannel[_0x081b('0x12')][_0x081b('0x25')]=function(_0x1254b0){if(this[_0x081b('0xf')][_0x1254b0]&&this['mailAccounts'][_0x1254b0][_0x081b('0x17')]){if(this[_0x081b('0x10')][this[_0x081b('0xf')][_0x1254b0]['Imap']['id']]){delete this[_0x081b('0x10')][this[_0x081b('0xf')][_0x1254b0][_0x081b('0x17')]['id']];}this[_0x081b('0xf')][_0x1254b0]['Imap'][_0x081b('0x33')]=moment();this['emit'](_0x1254b0);}};EmailChannel[_0x081b('0x12')][_0x081b('0x27')]=function(_0x3d31bc,_0x5732c7){if(this['mailAccounts'][_0x3d31bc]){this[_0x081b('0xf')][_0x3d31bc][_0x081b('0x17')][_0x081b('0x16')]='error';this['mailAccounts'][_0x3d31bc][_0x081b('0x17')][_0x081b('0x29')]=_0x5732c7;return this[_0x081b('0x13')](_0x3d31bc);}};EmailChannel['prototype'][_0x081b('0x34')]=function(_0x48005c,_0x15151c){return this[_0x081b('0x11')]['send'](_0x48005c,_0x15151c);};EmailChannel['prototype'][_0x081b('0x35')]=function(_0x3e2dea){var _0x47549d=this;if(this[_0x081b('0xf')][_0x3e2dea['id']]){if(_[_0x081b('0x19')](this[_0x081b('0xf')][_0x3e2dea['id']][_0x081b('0x36')])){this['mailAccounts'][_0x3e2dea['id']][_0x081b('0x36')]={};}this[_0x081b('0xf')][_0x3e2dea['id']][_0x081b('0x36')]['lastSync']=moment();return new BPromise(function(_0x5d1d8c,_0x1bde45){return _0x47549d[_0x081b('0x11')][_0x081b('0x37')](_0x3e2dea)[_0x081b('0x30')](function(_0x1f77f5){_0x47549d[_0x081b('0xf')][_0x3e2dea['id']][_0x081b('0x36')][_0x081b('0x16')]='verified';_0x47549d[_0x081b('0xf')][_0x3e2dea['id']][_0x081b('0x36')][_0x081b('0x29')]='';_0x47549d['emit'](_0x3e2dea['id']);_0x5d1d8c(_0x1f77f5);})[_0x081b('0x38')](function(_0x2e3d21){_0x47549d[_0x081b('0xf')][_0x3e2dea['id']][_0x081b('0x36')][_0x081b('0x16')]=_0x081b('0x26');_0x47549d[_0x081b('0xf')][_0x3e2dea['id']][_0x081b('0x36')][_0x081b('0x29')]=_0x2e3d21;_0x47549d[_0x081b('0x13')](_0x3e2dea['id']);_0x1bde45(_0x2e3d21);});});}return this[_0x081b('0x11')][_0x081b('0x37')](_0x3e2dea);};module[_0x081b('0x39')]=EmailChannel;
\ No newline at end of file
index ede5a84..55cb008 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['host','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','email','stringify','textCode','upperFirst','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','INBOX','account','getAccount','once','handleReady','end','handleEnd','bind','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','password','port','tls','autotls','required','modernAuthentication','xoauth2','CloudProvider','data5'];(function(_0x37dfb8,_0xb561a9){var _0x231879=function(_0x48f936){while(--_0x48f936){_0x37dfb8['push'](_0x37dfb8['shift']());}};_0x231879(++_0xb561a9);}(_0x4819,0xcd));var _0x9481=function(_0x5301a0,_0x562072){_0x5301a0=_0x5301a0-0x0;var _0x3edb89=_0x4819[_0x5301a0];return _0x3edb89;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var Imap=require(_0x9481('0x1'));var simpleParser=require(_0x9481('0x2'))[_0x9481('0x3')];var Iconv=require(_0x9481('0x4'))[_0x9481('0x5')];var EventEmitter=require(_0x9481('0x6'))[_0x9481('0x7')];var utils=require(_0x9481('0x8'));var logger=require(_0x9481('0x9'))('email');function EmailImap(_0x4d9e3a,_0x5def07){this['mailbox']=_0x9481('0xa');this[_0x9481('0xb')]=this[_0x9481('0xc')](_0x4d9e3a,_0x5def07);this[_0x9481('0x1')]=new Imap(this[_0x9481('0xb')]);this['imap'][_0x9481('0xd')]('ready',this[_0x9481('0xe')]['bind'](this));this[_0x9481('0x1')][_0x9481('0xd')](_0x9481('0xf'),this[_0x9481('0x10')][_0x9481('0x11')](this));this[_0x9481('0x1')]['on'](_0x9481('0x12'),this[_0x9481('0x13')][_0x9481('0x11')](this));this['imap']['connect']();}util[_0x9481('0x14')](EmailImap,EventEmitter);EmailImap[_0x9481('0x15')][_0x9481('0xc')]=function(_0x28fcb6,_0x3d23c2){var _0xc7a0b5={'connTimeout':_0x28fcb6[_0x9481('0x16')]?_0x28fcb6['connTimeout']*0x3e8:0x2710,'authTimeout':_0x28fcb6[_0x9481('0x17')]?_0x28fcb6[_0x9481('0x17')]*0x3e8:0x1388};if(_['isNil'](_0x28fcb6[_0x9481('0x18')])){if(_0x28fcb6['authentication']){_0xc7a0b5[_0x9481('0x19')]=_0x28fcb6[_0x9481('0x19')];_0xc7a0b5[_0x9481('0x1a')]=_0x28fcb6[_0x9481('0x1a')];}_0xc7a0b5['host']=_0x28fcb6['host'];_0xc7a0b5[_0x9481('0x1b')]=_0x28fcb6['port']||0x3e1;if(_0x28fcb6['tls']){_0xc7a0b5[_0x9481('0x1c')]=!![];}else{_0xc7a0b5[_0x9481('0x1c')]=![];_0xc7a0b5[_0x9481('0x1d')]=_0x9481('0x1e');}}else{if(_0x28fcb6[_0x9481('0x1f')]){_0xc7a0b5[_0x9481('0x20')]=utils['generateXOAuth2Token'](_0x28fcb6[_0x9481('0x21')][_0x9481('0x22')],_0x28fcb6[_0x9481('0x19')]);_0xc7a0b5[_0x9481('0x19')]=_0x28fcb6[_0x9481('0x19')];}else{_0xc7a0b5['user']=_0x28fcb6[_0x9481('0x19')];_0xc7a0b5[_0x9481('0x1a')]=_0x28fcb6['password'];}_0xc7a0b5[_0x9481('0x23')]=utils[_0x9481('0x24')](_0x28fcb6[_0x9481('0x18')]);_0xc7a0b5[_0x9481('0x1b')]=0x3e1;_0xc7a0b5[_0x9481('0x1c')]=!![];}_0xc7a0b5['email']=_0x3d23c2||_0x28fcb6[_0x9481('0x19')]||_0x9481('0x25');return _0xc7a0b5;};EmailImap['prototype']['handleReady']=function(){this[_0x9481('0x1')][_0x9481('0x26')](this['mailbox'],![],this[_0x9481('0x27')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x27')]=function(_0x5a1300,_0x14f03e){if(_0x5a1300){this[_0x9481('0x13')](_0x5a1300,!![]);}else{this[_0x9481('0x28')]('box',_0x14f03e);this[_0x9481('0x29')]();}};EmailImap['prototype'][_0x9481('0x2a')]=function(_0xe153ab){if(_0xe153ab){this[_0x9481('0x13')](_0xe153ab,!![]);}else{this[_0x9481('0x1')][_0x9481('0xf')]();}};EmailImap['prototype'][_0x9481('0x29')]=function(){this[_0x9481('0x1')][_0x9481('0x2b')](['UNSEEN'],this['handleReadUnseen'][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x2c')]=function(_0x2b33f8,_0x5d9926){if(_0x2b33f8){this['handleError'](_0x2b33f8,!![]);}else{if(_0x5d9926['length']){try{var _0x29e6b6=this['imap'][_0x9481('0x2d')](_0x5d9926,{'bodies':'','markSeen':!![]});_0x29e6b6['on']('message',this[_0x9481('0x2e')][_0x9481('0x11')](this));_0x29e6b6[_0x9481('0xd')](_0x9481('0x12'),this[_0x9481('0x2f')]['bind'](this));_0x29e6b6[_0x9481('0xd')](_0x9481('0xf'),this[_0x9481('0x30')]['bind'](this));}catch(_0x30063f){logger[_0x9481('0x12')](_0x30063f);}}else{this[_0x9481('0x1')][_0x9481('0x31')](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));}}};EmailImap['prototype'][_0x9481('0x2e')]=function(_0x53af85){_0x53af85['on'](_0x9481('0x32'),this[_0x9481('0x33')][_0x9481('0x11')](this));_0x53af85[_0x9481('0xd')](_0x9481('0x34'),this[_0x9481('0x35')]['bind'](this));_0x53af85[_0x9481('0xd')](_0x9481('0xf'),this['handleMessageEnd']['bind'](this));};EmailImap[_0x9481('0x15')]['handleMessageBody']=function(_0x224b88){simpleParser(_0x224b88,{'Iconv':Iconv},this[_0x9481('0x36')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')]['handleMessageAttributes']=function(){};EmailImap[_0x9481('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x9481('0x15')]['handleSimpleParser']=function(_0x2ce972,_0x4d6a13){if(_0x2ce972){logger[_0x9481('0x12')](_0x2ce972);}else{var _0x22e916=this;utils[_0x9481('0x37')](this[_0x9481('0xb')],_0x4d6a13,function(_0x97dc3e){_0x22e916[_0x9481('0x28')](_0x9481('0x38'),_0x97dc3e);});}};EmailImap['prototype'][_0x9481('0x30')]=function(){this[_0x9481('0x1')][_0x9481('0x31')](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x2f')]=function(_0x4e081d){this[_0x9481('0x13')](_0x4e081d);this[_0x9481('0x1')]['closeBox'](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x10')]=function(){this[_0x9481('0x28')]('end');};EmailImap[_0x9481('0x15')]['handleError']=function(_0x23811a,_0xcc7f31){logger['error']('handleError',this[_0x9481('0xb')][_0x9481('0x38')],JSON[_0x9481('0x39')](_0x23811a));var _0x4c4caf='';if(_0x23811a){if(_0x23811a[_0x9481('0x3a')]){_0x4c4caf=_0x23811a[_0x9481('0x3a')];}else{for(var _0x5502ad in _0x23811a){if(_0x23811a['hasOwnProperty'](_0x5502ad)){_0x4c4caf+=_[_0x9481('0x3b')](_0x5502ad)+':\x20'+_0x23811a[_0x5502ad]+'\x0a';}}}}if(_0xcc7f31){this['imap'][_0x9481('0xf')]();}else{this[_0x9481('0x28')](_0x9481('0x12'),_0x4c4caf);this[_0x9481('0x28')](_0x9481('0xf'));}};module['exports']=EmailImap;
\ No newline at end of file
+var _0x90ec=['handleReadUnseen','length','fetch','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','emit','stringify','textCode','hasOwnProperty','exports','lodash','util','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','INBOX','account','imap','once','ready','handleReady','bind','handleEnd','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','authentication','password','host','port','tls','autotls','required','openBox','mailbox','handleOpenBox','handleError','box','readUnseen','end','UNSEEN'];(function(_0x3a778b,_0x1c7ecc){var _0x5d05ec=function(_0x367f8e){while(--_0x367f8e){_0x3a778b['push'](_0x3a778b['shift']());}};_0x5d05ec(++_0x1c7ecc);}(_0x90ec,0x1d4));var _0xc90e=function(_0x521790,_0x4174ed){_0x521790=_0x521790-0x0;var _0x168e2a=_0x90ec[_0x521790];return _0x168e2a;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var Imap=require('imap');var simpleParser=require(_0xc90e('0x2'))[_0xc90e('0x3')];var Iconv=require(_0xc90e('0x4'))[_0xc90e('0x5')];var EventEmitter=require(_0xc90e('0x6'))['EventEmitter'];var utils=require(_0xc90e('0x7'));var logger=require(_0xc90e('0x8'))(_0xc90e('0x9'));function EmailImap(_0x54a0a8,_0x259c62){this['mailbox']=_0xc90e('0xa');this[_0xc90e('0xb')]=this['getAccount'](_0x54a0a8,_0x259c62);this[_0xc90e('0xc')]=new Imap(this[_0xc90e('0xb')]);this[_0xc90e('0xc')][_0xc90e('0xd')](_0xc90e('0xe'),this[_0xc90e('0xf')][_0xc90e('0x10')](this));this[_0xc90e('0xc')][_0xc90e('0xd')]('end',this[_0xc90e('0x11')]['bind'](this));this['imap']['on']('error',this['handleError'][_0xc90e('0x10')](this));this[_0xc90e('0xc')]['connect']();}util[_0xc90e('0x12')](EmailImap,EventEmitter);EmailImap[_0xc90e('0x13')]['getAccount']=function(_0x1ab6fb,_0x40e989){var _0x274876={'connTimeout':_0x1ab6fb[_0xc90e('0x14')]?_0x1ab6fb[_0xc90e('0x14')]*0x3e8:0x2710,'authTimeout':_0x1ab6fb[_0xc90e('0x15')]?_0x1ab6fb['authTimeout']*0x3e8:0x1388};if(_0x1ab6fb[_0xc90e('0x16')]){_0x274876[_0xc90e('0x17')]=_0x1ab6fb['user'];_0x274876[_0xc90e('0x9')]=_0x40e989||_0x1ab6fb['user']||_0xc90e('0x18');if(_0x1ab6fb[_0xc90e('0x19')]){_0x274876['xoauth2']=utils[_0xc90e('0x1a')](_0x1ab6fb[_0xc90e('0x1b')][_0xc90e('0x1c')],_0x1ab6fb['user']);}else{_0x274876['password']=_0x1ab6fb['password'];}}else{if(_0x1ab6fb[_0xc90e('0x1d')]){_0x274876[_0xc90e('0x17')]=_0x1ab6fb[_0xc90e('0x17')];_0x274876[_0xc90e('0x1e')]=_0x1ab6fb[_0xc90e('0x1e')];}}_0x274876['host']=_0x1ab6fb[_0xc90e('0x1f')];_0x274876['port']=_0x1ab6fb[_0xc90e('0x20')]||0x3e1;if(_0x1ab6fb[_0xc90e('0x21')]){_0x274876['tls']=!![];}else{_0x274876[_0xc90e('0x21')]=![];_0x274876[_0xc90e('0x22')]=_0xc90e('0x23');}return _0x274876;};EmailImap[_0xc90e('0x13')][_0xc90e('0xf')]=function(){this[_0xc90e('0xc')][_0xc90e('0x24')](this[_0xc90e('0x25')],![],this[_0xc90e('0x26')]['bind'](this));};EmailImap[_0xc90e('0x13')][_0xc90e('0x26')]=function(_0x25223e,_0x380f3f){if(_0x25223e){this[_0xc90e('0x27')](_0x25223e,!![]);}else{this['emit'](_0xc90e('0x28'),_0x380f3f);this[_0xc90e('0x29')]();}};EmailImap[_0xc90e('0x13')]['handleCloseBox']=function(_0x3a30c7){if(_0x3a30c7){this[_0xc90e('0x27')](_0x3a30c7,!![]);}else{this[_0xc90e('0xc')][_0xc90e('0x2a')]();}};EmailImap[_0xc90e('0x13')][_0xc90e('0x29')]=function(){this['imap']['search']([_0xc90e('0x2b')],this['handleReadUnseen'][_0xc90e('0x10')](this));};EmailImap[_0xc90e('0x13')][_0xc90e('0x2c')]=function(_0x404eef,_0x2c9ced){if(_0x404eef){this[_0xc90e('0x27')](_0x404eef,!![]);}else{if(_0x2c9ced[_0xc90e('0x2d')]){try{var _0x50e0d7=this[_0xc90e('0xc')][_0xc90e('0x2e')](_0x2c9ced,{'bodies':'','markSeen':!![]});_0x50e0d7['on']('message',this[_0xc90e('0x2f')]['bind'](this));_0x50e0d7[_0xc90e('0xd')](_0xc90e('0x30'),this[_0xc90e('0x31')][_0xc90e('0x10')](this));_0x50e0d7[_0xc90e('0xd')](_0xc90e('0x2a'),this[_0xc90e('0x32')][_0xc90e('0x10')](this));}catch(_0x89462e){logger['error'](_0x89462e);}}else{this['imap'][_0xc90e('0x33')](!![],this[_0xc90e('0x34')][_0xc90e('0x10')](this));}}};EmailImap[_0xc90e('0x13')][_0xc90e('0x2f')]=function(_0x314644){_0x314644['on'](_0xc90e('0x35'),this[_0xc90e('0x36')][_0xc90e('0x10')](this));_0x314644[_0xc90e('0xd')]('attributes',this[_0xc90e('0x37')][_0xc90e('0x10')](this));_0x314644[_0xc90e('0xd')](_0xc90e('0x2a'),this['handleMessageEnd']['bind'](this));};EmailImap['prototype'][_0xc90e('0x36')]=function(_0x11d990){simpleParser(_0x11d990,{'Iconv':Iconv},this[_0xc90e('0x38')][_0xc90e('0x10')](this));};EmailImap[_0xc90e('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0xc90e('0x13')][_0xc90e('0x39')]=function(){};EmailImap[_0xc90e('0x13')][_0xc90e('0x38')]=function(_0x3f21cd,_0x24c5bd){if(_0x3f21cd){logger[_0xc90e('0x30')](_0x3f21cd);}else{var _0x1a4e39=this;utils[_0xc90e('0x3a')](this[_0xc90e('0xb')],_0x24c5bd,function(_0x39f241){_0x1a4e39[_0xc90e('0x3b')](_0xc90e('0x9'),_0x39f241);});}};EmailImap['prototype'][_0xc90e('0x32')]=function(){this[_0xc90e('0xc')]['closeBox'](!![],this['handleCloseBox'][_0xc90e('0x10')](this));};EmailImap['prototype'][_0xc90e('0x31')]=function(_0x2c8829){this['handleError'](_0x2c8829);this[_0xc90e('0xc')]['closeBox'](!![],this['handleCloseBox'][_0xc90e('0x10')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0xc90e('0x3b')](_0xc90e('0x2a'));};EmailImap['prototype'][_0xc90e('0x27')]=function(_0x16d90b,_0x238a47){logger[_0xc90e('0x30')](_0xc90e('0x27'),this[_0xc90e('0xb')][_0xc90e('0x9')],JSON[_0xc90e('0x3c')](_0x16d90b));var _0x486bc7='';if(_0x16d90b){if(_0x16d90b[_0xc90e('0x3d')]){_0x486bc7=_0x16d90b['textCode'];}else{for(var _0x4abac6 in _0x16d90b){if(_0x16d90b[_0xc90e('0x3e')](_0x4abac6)){_0x486bc7+=_['upperFirst'](_0x4abac6)+':\x20'+_0x16d90b[_0x4abac6]+'\x0a';}}}}if(_0x238a47){this[_0xc90e('0xc')]['end']();}else{this[_0xc90e('0x3b')](_0xc90e('0x30'),_0x486bc7);this[_0xc90e('0x3b')](_0xc90e('0x2a'));}};module[_0xc90e('0x3f')]=EmailImap;
\ No newline at end of file
index f28ba2c..9e3d1d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3ab=['nodemailer','prototype','createTransport','compile','toString','verify','Not\x20verifired'];(function(_0x5c942a,_0x135e75){var _0x5790f9=function(_0x342656){while(--_0x342656){_0x5c942a['push'](_0x5c942a['shift']());}};_0x5790f9(++_0x135e75);}(_0xd3ab,0x13b));var _0xbd3a=function(_0x117581,_0x3c07cf){_0x117581=_0x117581-0x0;var _0xb25574=_0xd3ab[_0x117581];return _0xb25574;};'use strict';var nodemailer=require(_0xbd3a('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xbd3a('0x1')]['send']=function(_0x83f150,_0x378855){return new Promise(function(_0x171b2c,_0x374b38){var _0x284ef5=nodemailer[_0xbd3a('0x2')](_0x83f150);_0x284ef5['use'](_0xbd3a('0x3'),inlineBase64());_0x284ef5['sendMail'](_0x378855,function(_0x37ea93,_0x4d1fb6){if(_0x37ea93){_0x374b38(_0x37ea93[_0xbd3a('0x4')]());}else{_0x171b2c(_0x4d1fb6);}});});};EmailSmtp[_0xbd3a('0x1')][_0xbd3a('0x5')]=function(_0x1f3f94){return new Promise(function(_0x10af01,_0x450eb8){var _0x3dd8ee=nodemailer[_0xbd3a('0x2')](_0x1f3f94);_0x3dd8ee[_0xbd3a('0x5')](function(_0x34d5e2,_0x254e0f){if(_0x34d5e2){_0x450eb8(_0x34d5e2[_0xbd3a('0x4')]());}else{if(_0x254e0f){_0x10af01(_0x254e0f);}else{_0x450eb8(_0xbd3a('0x6'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
+var _0x514c=['toString','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x514c,0x19a));var _0xc514=function(_0xbeffa0,_0x298019){_0xbeffa0=_0xbeffa0-0x0;var _0x225c25=_0x514c[_0xbeffa0];return _0x225c25;};'use strict';var nodemailer=require(_0xc514('0x0'));var inlineBase64=require(_0xc514('0x1'));function EmailSmtp(){}EmailSmtp[_0xc514('0x2')][_0xc514('0x3')]=function(_0x20307a,_0x5387bc){return new Promise(function(_0x10f44d,_0x4185c0){var _0x198415=nodemailer[_0xc514('0x4')](_0x20307a);_0x198415[_0xc514('0x5')](_0xc514('0x6'),inlineBase64());_0x198415[_0xc514('0x7')](_0x5387bc,function(_0x1015db,_0x501e09){if(_0x1015db){_0x4185c0(_0x1015db[_0xc514('0x8')]());}else{_0x10f44d(_0x501e09);}});});};EmailSmtp[_0xc514('0x2')][_0xc514('0x9')]=function(_0xa3f147){return new Promise(function(_0x15f797,_0x1f5a79){var _0x1da4d7=nodemailer[_0xc514('0x4')](_0xa3f147);_0x1da4d7['verify'](function(_0x133d39,_0x45ce07){if(_0x133d39){_0x1f5a79(_0x133d39[_0xc514('0x8')]());}else{if(_0x45ce07){_0x15f797(_0x45ce07);}else{_0x1f5a79(_0xc514('0xa'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index 477e51d..54873e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f12=['info','messageId','first','Attachments','push','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','generateXOAuth2Token','auth=Bearer\x20','base64','lodash','randomstring','util','node-tnef','../../../config/logger','email','head','address','generate','value','name','indexOf','split','length','Anonymous','isEmpty','@xcally.com','html','test','replace','includes','<img','attachments','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originCc','originTo','bcc','type','attachment','attachment-','format','%s-%s','join','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef'];(function(_0x834af9,_0x1c435f){var _0x2e1e8b=function(_0x53e1cb){while(--_0x53e1cb){_0x834af9['push'](_0x834af9['shift']());}};_0x2e1e8b(++_0x1c435f);}(_0x7f12,0x1c7));var _0x27f1=function(_0x5eac26,_0xa9726d){_0x5eac26=_0x5eac26-0x0;var _0x276b6d=_0x7f12[_0x5eac26];return _0x276b6d;};'use strict';var _=require(_0x27f1('0x0'));var moment=require('moment');var random=require(_0x27f1('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x27f1('0x2'));var tnef=require(_0x27f1('0x3'));var logger=require(_0x27f1('0x4'))(_0x27f1('0x5'));var config=require('../../../config/environment');function getAddress(_0x45eda4){var _0x5c9aff=_[_0x27f1('0x6')](_0x45eda4['value']);return _0x5c9aff&&_0x5c9aff[_0x27f1('0x7')]?_0x5c9aff[_0x27f1('0x7')]:'anonymous'+random[_0x27f1('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x27d1ee){var _0x306114=_[_0x27f1('0x6')](_0x27d1ee[_0x27f1('0x9')]);if(_0x306114&&_0x306114[_0x27f1('0xa')]){if(_0x306114['name']==_0x306114['address']){return _0x306114[_0x27f1('0xa')]['substring'](0x0,_0x306114['name'][_0x27f1('0xb')]('@'));}var _0x40ee48=_0x306114[_0x27f1('0xa')][_0x27f1('0xc')](/\s+/);return _0x40ee48[_0x27f1('0xd')]>0x1?_0x40ee48['slice'](0x0,-0x1)['join']('\x20'):_0x306114[_0x27f1('0xa')];}return _0x27f1('0xe');}function getLastName(_0x520688){var _0x2db612=_[_0x27f1('0x6')](_0x520688[_0x27f1('0x9')]);if(_0x2db612&&_0x2db612[_0x27f1('0xa')]){var _0x31ea76=_0x2db612['name'][_0x27f1('0xc')](/\s+/);return _0x31ea76['length']>0x1?_0x31ea76['pop']():'';}return'';}function getMails(_0x41a2b8,_0x3bc834){var _0xddf6b4='';for(var _0x1f012f=0x0;_0x1f012f<_0x3bc834[_0x27f1('0x9')]['length'];_0x1f012f+=0x1){if(_0x3bc834['value'][_0x1f012f][_0x27f1('0x7')]!==_0x41a2b8){if(!_[_0x27f1('0xf')](_0xddf6b4)){_0xddf6b4+=',';}_0xddf6b4+=_0x3bc834['value'][_0x1f012f][_0x27f1('0xa')]||_0x3bc834['value'][_0x1f012f]['address']||'';_0xddf6b4+='\x20<';_0xddf6b4+=_0x3bc834['value'][_0x1f012f][_0x27f1('0x7')]?_0x3bc834['value'][_0x1f012f][_0x27f1('0x7')]:'anonymous'+random[_0x27f1('0x8')](0x6)+_0x27f1('0x10');_0xddf6b4+='>';}}return _0xddf6b4;}function parseEmail(_0x26e60d,_0x40a2dc,_0x2769df){if(_0x40a2dc[_0x27f1('0x11')]){var _0x1b087a=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x1b087a[_0x27f1('0x12')](_0x40a2dc[_0x27f1('0x11')])){_0x40a2dc[_0x27f1('0x11')]=_0x40a2dc['html'][_0x27f1('0x13')](_0x1b087a,'');}if(_0x40a2dc[_0x27f1('0x11')][_0x27f1('0x14')](_0x27f1('0x15'))){var _0x4f8723=[];_0x40a2dc[_0x27f1('0x16')]['forEach'](_0x1ca398=>{_0x4f8723['push'](_0x1ca398[_0x27f1('0x17')]);});var _0xc029d6=/<img.*? _SRC(.*?)[^>]+>/g;var _0x2f22b7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5fcd3a=_0x40a2dc[_0x27f1('0x11')][_0x27f1('0x13')](_0x2f22b7,_0x27f1('0x18'));var _0x472209=_0x5fcd3a[_0x27f1('0x13')](_0xc029d6,_0x27f1('0x19'));for(let _0x32946f=0x0;_0x32946f<_0x4f8723[_0x27f1('0xd')];_0x32946f++){var _0x3426c5=_0x472209['replace'](_0x27f1('0x19'),_0x27f1('0x1a')+_0x4f8723[_0x32946f]+_0x27f1('0x1b'));_0x472209=_0x3426c5;}_0x40a2dc['html']=_0x472209;}_0x2769df[_0x27f1('0x1c')]=_0x40a2dc[_0x27f1('0x11')];}else{_0x2769df[_0x27f1('0x1c')]=_0x40a2dc[_0x27f1('0x1d')];}if(_0x2769df['body']){_0x2769df[_0x27f1('0x1c')]=_0x2769df[_0x27f1('0x1c')][_0x27f1('0x13')](/<a\s+/gi,_0x27f1('0x1e'));}if(_0x40a2dc['to']){_0x2769df[_0x27f1('0x1f')]['originTo']=getMails(null,_0x40a2dc['to']);var _0x5c6e2a=getMails(_0x26e60d[_0x27f1('0x5')],_0x40a2dc['to']);if(!_[_0x27f1('0xf')](_0x5c6e2a)){_0x2769df[_0x27f1('0x1f')]['cc']+=_0x5c6e2a;}}if(_0x40a2dc['cc']){_0x2769df[_0x27f1('0x1f')][_0x27f1('0x20')]=getMails(null,_0x40a2dc['cc']);var _0x326d33=getMails(_0x26e60d[_0x27f1('0x5')],_0x40a2dc['cc']);if(!_[_0x27f1('0xf')](_0x326d33)){if(!_[_0x27f1('0xf')](_0x2769df[_0x27f1('0x1f')]['cc'])){_0x2769df[_0x27f1('0x1f')]['cc']+=',';}_0x2769df[_0x27f1('0x1f')]['cc']+=_0x326d33;}}if(!_[_0x27f1('0x14')](_0x2769df[_0x27f1('0x1f')][_0x27f1('0x21')],_0x26e60d['email'])&&!_[_0x27f1('0x14')](_0x2769df['message']['originCc'],_0x26e60d['email'])){_0x2769df[_0x27f1('0x1f')][_0x27f1('0x22')]=_0x26e60d[_0x27f1('0x5')];}if(_0x40a2dc[_0x27f1('0x16')]&&_0x40a2dc['attachments'][_0x27f1('0xd')]){_0x2769df[_0x27f1('0x1f')]['attach']=_0x40a2dc[_0x27f1('0x16')][_0x27f1('0xd')];for(var _0x5cbded=0x0,_0x56f5ab,_0x510769,_0x5cfeb1;_0x5cbded<_0x40a2dc[_0x27f1('0x16')][_0x27f1('0xd')];_0x5cbded+=0x1){if(_0x40a2dc['attachments'][_0x5cbded][_0x27f1('0x23')]===_0x27f1('0x24')){_0x5cfeb1=_0x40a2dc[_0x27f1('0x16')][_0x5cbded][_0x27f1('0x17')]||_0x27f1('0x25')+_0x5cbded;_0x56f5ab=util[_0x27f1('0x26')](_0x27f1('0x27'),Date['now'](),_0x5cfeb1);_0x510769=path[_0x27f1('0x28')](config['root'],'server/files/attachments/',_0x56f5ab);fs[_0x27f1('0x29')](_0x510769,_0x40a2dc[_0x27f1('0x16')][_0x5cbded][_0x27f1('0x2a')]);_0x2769df[_0x27f1('0x1f')][_0x27f1('0x16')]['push']({'name':_0x5cfeb1,'basename':_0x56f5ab,'type':_0x40a2dc[_0x27f1('0x16')][_0x5cbded][_0x27f1('0x2b')],'filepath':_0x510769});}}}if(_0x40a2dc['headerLines']&&_0x40a2dc[_0x27f1('0x2c')][_0x27f1('0xd')]>0x0){var _0x2a76eb=['Auto-Submitted:\x20auto-replied',_0x27f1('0x2d'),_0x27f1('0x2e')];for(var _0x20b516=0x0;_0x20b516<_0x40a2dc[_0x27f1('0x2c')]['length'];_0x20b516++){var _0x34c7e2=_[_0x27f1('0xb')](_0x2a76eb,_0x40a2dc[_0x27f1('0x2c')][_0x20b516][_0x27f1('0x2f')]);if(_0x34c7e2>=0x0){_0x2769df[_0x27f1('0x30')]=!![];}}}return _0x2769df;}exports[_0x27f1('0x31')]=function(_0x2aff72,_0x2cb0ea,_0x458327){var _0x158bae={'from':getAddress(_0x2cb0ea[_0x27f1('0x32')]),'firstName':getFirstName(_0x2cb0ea['from']),'lastName':getLastName(_0x2cb0ea[_0x27f1('0x32')]),'mapKey':_0x27f1('0x5'),'message':{'from':getMails(_0x2aff72['email'],_0x2cb0ea[_0x27f1('0x32')]),'to':_0x2aff72[_0x27f1('0x5')],'cc':'','subject':_0x2cb0ea['subject']||'','messageId':_0x2cb0ea['messageId'],'inReplyTo':_0x2cb0ea[_0x27f1('0x33')],'sentAt':moment(_0x2cb0ea[_0x27f1('0x34')])['format'](_0x27f1('0x35')),'attach':![],'attachments':[]}};if(!_0x2cb0ea[_0x27f1('0x11')]&&!_0x2cb0ea['textAsHtml']){var _0x4b8c42=_[_0x27f1('0x36')](_0x2cb0ea[_0x27f1('0x16')],{'contentType':_0x27f1('0x37')});if(_0x4b8c42[_0x27f1('0xd')]){logger[_0x27f1('0x38')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x2cb0ea[_0x27f1('0x39')]));tnef['parseBuffer'](_[_0x27f1('0x3a')](_0x4b8c42)[_0x27f1('0x2a')],function(_0x325a40,_0xd2594a){if(_0xd2594a){_0x2cb0ea[_0x27f1('0x11')]=_0xd2594a['BodyHTML']||'<p>Empty\x20message</p>';if(_0xd2594a[_0x27f1('0x3b')]){for(var _0x1a5652=0x0;_0x1a5652<_0xd2594a[_0x27f1('0x3b')][_0x27f1('0xd')];_0x1a5652++){var _0x5e06cc=_0xd2594a['Attachments'][_0x1a5652];_0x158bae[_0x27f1('0x1f')][_0x27f1('0x16')][_0x27f1('0x3c')]({'filename':_0x5e06cc['Title'],'content':Buffer[_0x27f1('0x32')](_0x5e06cc[_0x27f1('0x3d')])});}}}_0x458327(parseEmail(_0x2aff72,_0x2cb0ea,_0x158bae));});}else{_0x2cb0ea[_0x27f1('0x11')]='<p>Empty\x20message</p>';_0x458327(parseEmail(_0x2aff72,_0x2cb0ea,_0x158bae));}}else{_0x458327(parseEmail(_0x2aff72,_0x2cb0ea,_0x158bae));}};exports[_0x27f1('0x3e')]=function(_0x371f68){switch(_0x371f68){case _0x27f1('0x3f'):return _0x27f1('0x40');case _0x27f1('0x41'):return _0x27f1('0x42');case'hotmail':return _0x27f1('0x43');case _0x27f1('0x44'):return _0x27f1('0x45');}return'127.0.0.1';};exports[_0x27f1('0x46')]=function(_0x18f737,_0x20e104){var _0x4096b1=['user='+(_0x20e104||''),_0x27f1('0x47')+_0x18f737,'',''];return Buffer[_0x27f1('0x32')](_0x4096b1[_0x27f1('0x28')]('\ 1'),'utf-8')['toString'](_0x27f1('0x48'));};
\ No newline at end of file
+var _0x31cd=['attachments','forEach','push','filename','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','isEmpty','originCc','originTo','bcc','attach','type','attachment','format','%s-%s','now','server/files/attachments/','writeFileSync','content','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','parseBuffer','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','join','utf-8','toString','base64','lodash','path','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice','length','pop','test','html','replace','includes','<img'];(function(_0x321f6c,_0x5627aa){var _0x34c3f9=function(_0x50a9bf){while(--_0x50a9bf){_0x321f6c['push'](_0x321f6c['shift']());}};_0x34c3f9(++_0x5627aa);}(_0x31cd,0x105));var _0xd31c=function(_0x5e85dc,_0x525150){_0x5e85dc=_0x5e85dc-0x0;var _0x567cda=_0x31cd[_0x5e85dc];return _0x567cda;};'use strict';var _=require(_0xd31c('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xd31c('0x1'));var util=require('util');var tnef=require(_0xd31c('0x2'));var logger=require(_0xd31c('0x3'))(_0xd31c('0x4'));var config=require('../../../config/environment');function getAddress(_0x30f4b9){var _0x28bc00=_[_0xd31c('0x5')](_0x30f4b9[_0xd31c('0x6')]);return _0x28bc00&&_0x28bc00[_0xd31c('0x7')]?_0x28bc00['address']:_0xd31c('0x8')+random[_0xd31c('0x9')](0x6)+_0xd31c('0xa');}function getFirstName(_0x476652){var _0x3fa5fe=_[_0xd31c('0x5')](_0x476652[_0xd31c('0x6')]);if(_0x3fa5fe&&_0x3fa5fe['name']){if(_0x3fa5fe[_0xd31c('0xb')]==_0x3fa5fe[_0xd31c('0x7')]){return _0x3fa5fe[_0xd31c('0xb')][_0xd31c('0xc')](0x0,_0x3fa5fe[_0xd31c('0xb')][_0xd31c('0xd')]('@'));}var _0x137e8e=_0x3fa5fe[_0xd31c('0xb')][_0xd31c('0xe')](/\s+/);return _0x137e8e['length']>0x1?_0x137e8e[_0xd31c('0xf')](0x0,-0x1)['join']('\x20'):_0x3fa5fe[_0xd31c('0xb')];}return'Anonymous';}function getLastName(_0x56aefb){var _0x226ce0=_[_0xd31c('0x5')](_0x56aefb['value']);if(_0x226ce0&&_0x226ce0[_0xd31c('0xb')]){var _0x6d64eb=_0x226ce0[_0xd31c('0xb')]['split'](/\s+/);return _0x6d64eb[_0xd31c('0x10')]>0x1?_0x6d64eb[_0xd31c('0x11')]():'';}return'';}function getMails(_0xbec8c8,_0xafd0b){var _0x10a3e3='';for(var _0x17f335=0x0;_0x17f335<_0xafd0b[_0xd31c('0x6')][_0xd31c('0x10')];_0x17f335+=0x1){if(_0xafd0b['value'][_0x17f335]['address']!==_0xbec8c8){if(!_['isEmpty'](_0x10a3e3)){_0x10a3e3+=',';}_0x10a3e3+=_0xafd0b[_0xd31c('0x6')][_0x17f335]['name']||_0xafd0b[_0xd31c('0x6')][_0x17f335]['address']||'';_0x10a3e3+='\x20<';_0x10a3e3+=_0xafd0b[_0xd31c('0x6')][_0x17f335][_0xd31c('0x7')]?_0xafd0b[_0xd31c('0x6')][_0x17f335]['address']:_0xd31c('0x8')+random[_0xd31c('0x9')](0x6)+_0xd31c('0xa');_0x10a3e3+='>';}}return _0x10a3e3;}function parseEmail(_0x2c8403,_0x31263b,_0x5d6021){if(_0x31263b['html']){var _0x5d5bff=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x5d5bff[_0xd31c('0x12')](_0x31263b[_0xd31c('0x13')])){_0x31263b[_0xd31c('0x13')]=_0x31263b['html'][_0xd31c('0x14')](_0x5d5bff,'');}if(_0x31263b['html'][_0xd31c('0x15')](_0xd31c('0x16'))){var _0x113199=[];_0x31263b[_0xd31c('0x17')][_0xd31c('0x18')](_0x2eb1c3=>{_0x113199[_0xd31c('0x19')](_0x2eb1c3[_0xd31c('0x1a')]);});var _0x3cef97=/<img.*? _SRC(.*?)[^>]+>/g;var _0x5a0d64=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x56f45d=_0x31263b[_0xd31c('0x13')][_0xd31c('0x14')](_0x5a0d64,'_SRC');var _0x313aaa=_0x56f45d[_0xd31c('0x14')](_0x3cef97,_0xd31c('0x1b'));for(let _0x160508=0x0;_0x160508<_0x113199['length'];_0x160508++){var _0x471293=_0x313aaa[_0xd31c('0x14')](_0xd31c('0x1b'),_0xd31c('0x1c')+_0x113199[_0x160508]+'\x20]</span>');_0x313aaa=_0x471293;}_0x31263b[_0xd31c('0x13')]=_0x313aaa;}_0x5d6021['body']=_0x31263b[_0xd31c('0x13')];}else{_0x5d6021[_0xd31c('0x1d')]=_0x31263b[_0xd31c('0x1e')];}if(_0x5d6021['body']){_0x5d6021[_0xd31c('0x1d')]=_0x5d6021[_0xd31c('0x1d')]['replace'](/<a\s+/gi,_0xd31c('0x1f'));}if(_0x31263b['to']){_0x5d6021[_0xd31c('0x20')]['originTo']=getMails(null,_0x31263b['to']);var _0x432ceb=getMails(_0x2c8403['email'],_0x31263b['to']);if(!_[_0xd31c('0x21')](_0x432ceb)){_0x5d6021[_0xd31c('0x20')]['cc']+=_0x432ceb;}}if(_0x31263b['cc']){_0x5d6021['message'][_0xd31c('0x22')]=getMails(null,_0x31263b['cc']);var _0x113c97=getMails(_0x2c8403[_0xd31c('0x4')],_0x31263b['cc']);if(!_[_0xd31c('0x21')](_0x113c97)){if(!_[_0xd31c('0x21')](_0x5d6021['message']['cc'])){_0x5d6021[_0xd31c('0x20')]['cc']+=',';}_0x5d6021[_0xd31c('0x20')]['cc']+=_0x113c97;}}if(!_[_0xd31c('0x15')](_0x5d6021[_0xd31c('0x20')][_0xd31c('0x23')],_0x2c8403[_0xd31c('0x4')])&&!_['includes'](_0x5d6021[_0xd31c('0x20')]['originCc'],_0x2c8403['email'])){_0x5d6021['message'][_0xd31c('0x24')]=_0x2c8403[_0xd31c('0x4')];}if(_0x31263b[_0xd31c('0x17')]&&_0x31263b['attachments']['length']){_0x5d6021[_0xd31c('0x20')][_0xd31c('0x25')]=_0x31263b['attachments'][_0xd31c('0x10')];for(var _0xd40c61=0x0,_0x5ace3d,_0x26b675,_0x212fc2;_0xd40c61<_0x31263b[_0xd31c('0x17')]['length'];_0xd40c61+=0x1){if(_0x31263b[_0xd31c('0x17')][_0xd40c61][_0xd31c('0x26')]===_0xd31c('0x27')){_0x212fc2=_0x31263b[_0xd31c('0x17')][_0xd40c61][_0xd31c('0x1a')]||'attachment-'+_0xd40c61;_0x5ace3d=util[_0xd31c('0x28')](_0xd31c('0x29'),Date[_0xd31c('0x2a')](),_0x212fc2);_0x26b675=path['join'](config['root'],_0xd31c('0x2b'),_0x5ace3d);fs[_0xd31c('0x2c')](_0x26b675,_0x31263b[_0xd31c('0x17')][_0xd40c61][_0xd31c('0x2d')]);_0x5d6021['message']['attachments'][_0xd31c('0x19')]({'name':_0x212fc2,'basename':_0x5ace3d,'type':_0x31263b[_0xd31c('0x17')][_0xd40c61]['contentType'],'filepath':_0x26b675});}}}if(_0x31263b[_0xd31c('0x2e')]&&_0x31263b[_0xd31c('0x2e')][_0xd31c('0x10')]>0x0){var _0x2cf96c=['Auto-Submitted:\x20auto-replied',_0xd31c('0x2f'),_0xd31c('0x30')];for(var _0x4dc187=0x0;_0x4dc187<_0x31263b[_0xd31c('0x2e')][_0xd31c('0x10')];_0x4dc187++){var _0x1e9c96=_[_0xd31c('0xd')](_0x2cf96c,_0x31263b[_0xd31c('0x2e')][_0x4dc187][_0xd31c('0x31')]);if(_0x1e9c96>=0x0){_0x5d6021[_0xd31c('0x32')]=!![];}}}return _0x5d6021;}exports[_0xd31c('0x33')]=function(_0x594a61,_0x19cecb,_0x3a546e){var _0x3ad57b={'from':getAddress(_0x19cecb['from']),'firstName':getFirstName(_0x19cecb[_0xd31c('0x34')]),'lastName':getLastName(_0x19cecb[_0xd31c('0x34')]),'mapKey':_0xd31c('0x4'),'message':{'from':getMails(_0x594a61[_0xd31c('0x4')],_0x19cecb[_0xd31c('0x34')]),'to':_0x594a61[_0xd31c('0x4')],'cc':'','subject':_0x19cecb['subject']||'','messageId':_0x19cecb['messageId'],'inReplyTo':_0x19cecb[_0xd31c('0x35')],'sentAt':moment(_0x19cecb[_0xd31c('0x36')])[_0xd31c('0x28')](_0xd31c('0x37')),'attach':![],'attachments':[]}};if(!_0x19cecb[_0xd31c('0x13')]&&!_0x19cecb[_0xd31c('0x1e')]){var _0x20b25e=_['filter'](_0x19cecb[_0xd31c('0x17')],{'contentType':_0xd31c('0x38')});if(_0x20b25e['length']){logger[_0xd31c('0x39')](util[_0xd31c('0x28')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x19cecb['messageId']));tnef[_0xd31c('0x3a')](_['first'](_0x20b25e)[_0xd31c('0x2d')],function(_0x1820e1,_0x530249){if(_0x530249){_0x19cecb[_0xd31c('0x13')]=_0x530249[_0xd31c('0x3b')]||_0xd31c('0x3c');if(_0x530249[_0xd31c('0x3d')]){for(var _0x224a37=0x0;_0x224a37<_0x530249[_0xd31c('0x3d')][_0xd31c('0x10')];_0x224a37++){var _0x32c66e=_0x530249[_0xd31c('0x3d')][_0x224a37];_0x3ad57b['message'][_0xd31c('0x17')][_0xd31c('0x19')]({'filename':_0x32c66e[_0xd31c('0x3e')],'content':Buffer['from'](_0x32c66e[_0xd31c('0x3f')])});}}}_0x3a546e(parseEmail(_0x594a61,_0x19cecb,_0x3ad57b));});}else{_0x19cecb[_0xd31c('0x13')]=_0xd31c('0x3c');_0x3a546e(parseEmail(_0x594a61,_0x19cecb,_0x3ad57b));}}else{_0x3a546e(parseEmail(_0x594a61,_0x19cecb,_0x3ad57b));}};exports[_0xd31c('0x40')]=function(_0x2967f4,_0x1cd313){var _0x21ffef=[_0xd31c('0x41')+(_0x1cd313||''),_0xd31c('0x42')+_0x2967f4,'',''];return Buffer[_0xd31c('0x34')](_0x21ffef[_0xd31c('0x43')]('\ 1'),_0xd31c('0x44'))[_0xd31c('0x45')](_0xd31c('0x46'));};
\ No newline at end of file
index 502b482..f33e152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe698=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x2391cf,_0x2593e9){var _0x11f9e5=function(_0xed220d){while(--_0xed220d){_0x2391cf['push'](_0x2391cf['shift']());}};_0x11f9e5(++_0x2593e9);}(_0xe698,0x9e));var _0x8e69=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe698[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x8e69('0x0'));function MailAccount(_0x361fb9){this['id']=_0x361fb9['id']||0x0;this[_0x8e69('0x1')]=_0x361fb9[_0x8e69('0x1')]||_0x8e69('0x2');this[_0x8e69('0x3')]=_0x361fb9['key']||_0x8e69('0x4');this['active']=_0x361fb9[_0x8e69('0x5')]||![];this[_0x8e69('0x6')]=_0x361fb9[_0x8e69('0x6')]||[];this[_0x8e69('0x7')]=_0x361fb9[_0x8e69('0x7')]||[];}module[_0x8e69('0x8')]=MailAccount;
\ No newline at end of file
+var _0xa6e7=['Imap','Smtp','name','Service','key','SERV','active'];(function(_0x6c75da,_0x1b96d6){var _0x5f5d21=function(_0x5ef793){while(--_0x5ef793){_0x6c75da['push'](_0x6c75da['shift']());}};_0x5f5d21(++_0x1b96d6);}(_0xa6e7,0xcd));var _0x7a6e=function(_0x1943d5,_0x16fed5){_0x1943d5=_0x1943d5-0x0;var _0x3f02ef=_0xa6e7[_0x1943d5];return _0x3f02ef;};'use strict';var _=require('lodash');function MailAccount(_0x5666f3){this['id']=_0x5666f3['id']||0x0;this[_0x7a6e('0x0')]=_0x5666f3[_0x7a6e('0x0')]||_0x7a6e('0x1');this[_0x7a6e('0x2')]=_0x5666f3['key']||_0x7a6e('0x3');this[_0x7a6e('0x4')]=_0x5666f3[_0x7a6e('0x4')]||![];this[_0x7a6e('0x5')]=_0x5666f3[_0x7a6e('0x5')]||[];this[_0x7a6e('0x6')]=_0x5666f3[_0x7a6e('0x6')]||[];}module['exports']=MailAccount;
\ No newline at end of file
index 17bee48..f1a64e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d87=['prototype','initMailAccounts','isUndefined','merge','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x59e98a,_0x2333fb){var _0x369456=function(_0x438754){while(--_0x438754){_0x59e98a['push'](_0x59e98a['shift']());}};_0x369456(++_0x2333fb);}(_0x0d87,0x12e));var _0x70d8=function(_0x315b3c,_0x316af8){_0x315b3c=_0x315b3c-0x0;var _0xe33b56=_0x0d87[_0x315b3c];return _0xe33b56;};'use strict';var _=require('lodash');var MailAccount=require(_0x70d8('0x0'));var Realtime=function(){this[_0x70d8('0x1')]={};};function freeIsNotKey(_0x1f065d,_0x5af8ca,_0x3a04d7){var _0xf36cbe=_[_0x70d8('0x2')](_0x1f065d,function(_0x4bb54b,_0x586013){return _0x4bb54b[_0x3a04d7];});for(var _0x58783f in _0x5af8ca){if(_0x5af8ca[_0x70d8('0x3')](_0x58783f)){if(!_0xf36cbe[_0x58783f]){delete _0x5af8ca[_0x58783f];}}}}Realtime[_0x70d8('0x4')]['mergeFromDatabase']=function(_0x3ec035,_0x1fe44){for(var _0x1e0afc in _0x1fe44){if(_0x3ec035['hasOwnProperty'](_0x1e0afc)){_0x3ec035[_0x1e0afc]=_0x1fe44[_0x1e0afc];}}};Realtime['prototype'][_0x70d8('0x5')]=function(){var _0x49bf3b=this;return function(_0x37a873){if(_0x37a873){freeIsNotKey(_0x37a873,_0x49bf3b[_0x70d8('0x1')],'id');for(var _0x84c59d=0x0,_0x3bab0d={},_0x26516f={};_0x84c59d<_0x37a873['length'];_0x84c59d+=0x1){_0x3bab0d=_0x37a873[_0x84c59d];if(_[_0x70d8('0x6')](_0x49bf3b[_0x70d8('0x1')][_0x3bab0d['id']])){_0x49bf3b[_0x70d8('0x1')][_0x3bab0d['id']]=new MailAccount(_0x3bab0d);}else{_[_0x70d8('0x7')](_0x49bf3b[_0x70d8('0x1')][_0x3bab0d['id']],_0x3bab0d);}}}return _0x49bf3b[_0x70d8('0x1')];};};module[_0x70d8('0x8')]=Realtime;
\ No newline at end of file
+var _0x3aa3=['mergeFromDatabase','initMailAccounts','length','mailAccounts','merge','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty'];(function(_0x382dc3,_0x263461){var _0x559f07=function(_0x474e37){while(--_0x474e37){_0x382dc3['push'](_0x382dc3['shift']());}};_0x559f07(++_0x263461);}(_0x3aa3,0x1d2));var _0x33aa=function(_0x38f737,_0x54f685){_0x38f737=_0x38f737-0x0;var _0x7afda3=_0x3aa3[_0x38f737];return _0x7afda3;};'use strict';var _=require(_0x33aa('0x0'));var MailAccount=require(_0x33aa('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1a5da6,_0x28e624,_0x21ab3f){var _0x3984ef=_[_0x33aa('0x2')](_0x1a5da6,function(_0x367f53,_0xd0ed05){return _0x367f53[_0x21ab3f];});for(var _0xa23c7f in _0x28e624){if(_0x28e624[_0x33aa('0x3')](_0xa23c7f)){if(!_0x3984ef[_0xa23c7f]){delete _0x28e624[_0xa23c7f];}}}}Realtime['prototype'][_0x33aa('0x4')]=function(_0x8df61a,_0xa6c4a5){for(var _0x2b5e92 in _0xa6c4a5){if(_0x8df61a[_0x33aa('0x3')](_0x2b5e92)){_0x8df61a[_0x2b5e92]=_0xa6c4a5[_0x2b5e92];}}};Realtime['prototype'][_0x33aa('0x5')]=function(){var _0x323d5f=this;return function(_0x25ffa6){if(_0x25ffa6){freeIsNotKey(_0x25ffa6,_0x323d5f['mailAccounts'],'id');for(var _0x5a3322=0x0,_0xb9e447={},_0x1f3606={};_0x5a3322<_0x25ffa6[_0x33aa('0x6')];_0x5a3322+=0x1){_0xb9e447=_0x25ffa6[_0x5a3322];if(_['isUndefined'](_0x323d5f[_0x33aa('0x7')][_0xb9e447['id']])){_0x323d5f['mailAccounts'][_0xb9e447['id']]=new MailAccount(_0xb9e447);}else{_[_0x33aa('0x8')](_0x323d5f['mailAccounts'][_0xb9e447['id']],_0xb9e447);}}}return _0x323d5f[_0x33aa('0x7')];};};module[_0x33aa('0x9')]=Realtime;
\ No newline at end of file
index e5c6d93..c4c5706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7c=['type','data5','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','email','key','ListId','TemplateId','CloudProvider','Smtp'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6f7c,0x137));var _0xc6f7=function(_0x32a508,_0x100d80){_0x32a508=_0x32a508-0x0;var _0x79a121=_0x6f7c[_0x32a508];return _0x79a121;};'use strict';var client=require(_0xc6f7('0x0'));exports[_0xc6f7('0x1')]=function(){return function(){return client[_0xc6f7('0x2')](_0xc6f7('0x3'),{'options':{'attributes':['id',_0xc6f7('0x4'),_0xc6f7('0x5'),_0xc6f7('0x6'),_0xc6f7('0x7'),'active',_0xc6f7('0x8'),_0xc6f7('0x9'),_0xc6f7('0xa')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0xc6f7('0xb'),'attributes':['id','name',_0xc6f7('0x6'),'type','data5'],'as':_0xc6f7('0xb')}]},{'model':'MailServerOut','as':_0xc6f7('0xc'),'include':[{'model':_0xc6f7('0xb'),'attributes':['id',_0xc6f7('0x4'),_0xc6f7('0x6'),_0xc6f7('0xd'),_0xc6f7('0xe')],'as':_0xc6f7('0xb')}]}]},'log':_0xc6f7('0xf')});};};exports[_0xc6f7('0x10')]=function(_0x488805,_0x1572ae){return client['Request'](_0xc6f7('0x11'),{'account':{'id':_0x488805},'body':_0x1572ae,'log':_0xc6f7('0x11')});};
\ No newline at end of file
+var _0xe864=['provider','service','email','active','key','ListId','TemplateId','MailServerIn','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name'];(function(_0x31300c,_0x2823e1){var _0x462408=function(_0x1a7388){while(--_0x1a7388){_0x31300c['push'](_0x31300c['shift']());}};_0x462408(++_0x2823e1);}(_0xe864,0x14b));var _0x4e86=function(_0x89f53f,_0x503e47){_0x89f53f=_0x89f53f-0x0;var _0x378b14=_0xe864[_0x89f53f];return _0x378b14;};'use strict';var client=require(_0x4e86('0x0'));exports[_0x4e86('0x1')]=function(){return function(){return client[_0x4e86('0x2')](_0x4e86('0x3'),{'options':{'attributes':['id',_0x4e86('0x4'),_0x4e86('0x5'),_0x4e86('0x6'),_0x4e86('0x7'),_0x4e86('0x8'),_0x4e86('0x9'),_0x4e86('0xa'),_0x4e86('0xb')],'raw':![],'include':[{'model':_0x4e86('0xc'),'as':'Imap','include':[{'model':_0x4e86('0xd'),'attributes':['id',_0x4e86('0x4'),'service',_0x4e86('0xe'),_0x4e86('0xf')],'as':_0x4e86('0xd')}]},{'model':_0x4e86('0x10'),'as':_0x4e86('0x11'),'include':[{'model':_0x4e86('0xd'),'attributes':['id','name','service',_0x4e86('0xe'),'data5'],'as':_0x4e86('0xd')}]}]},'log':_0x4e86('0x12')});};};exports[_0x4e86('0x13')]=function(_0x237856,_0x24b061){return client[_0x4e86('0x2')](_0x4e86('0x14'),{'account':{'id':_0x237856},'body':_0x24b061,'log':'NotifyMailAccount'});};
\ No newline at end of file
index 8a0e585..bdec94b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55d4=['../client','Request','loginMailFrequency'];(function(_0x785803,_0x2e6ed3){var _0x5d535b=function(_0x3740e8){while(--_0x3740e8){_0x785803['push'](_0x785803['shift']());}};_0x5d535b(++_0x2e6ed3);}(_0x55d4,0x15c));var _0x455d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x55d4[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x455d('0x0'));exports['getSettings']=function(){return client[_0x455d('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x455d('0x2')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0xb375=['ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x445024,_0x36dca6){var _0x5ab19a=function(_0x598957){while(--_0x598957){_0x445024['push'](_0x445024['shift']());}};_0x5ab19a(++_0x36dca6);}(_0xb375,0x1af));var _0x5b37=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb375[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x5b37('0x0'));exports['getSettings']=function(){return client['Request'](_0x5b37('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5b37('0x2')]},'log':_0x5b37('0x3')});};
\ No newline at end of file
index 33e46ea..8e61596 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
index e6256cb..4c8c335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe845=['default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','redis','defaults','adapter','socket.io-redis','../../config/triggers'];(function(_0x5f6a8a,_0x45f474){var _0x2cce4d=function(_0x590b80){while(--_0x590b80){_0x5f6a8a['push'](_0x5f6a8a['shift']());}};_0x2cce4d(++_0x45f474);}(_0xe845,0xfb));var _0x5e84=function(_0x17c732,_0x2edd3a){_0x17c732=_0x17c732-0x0;var _0x5b3ed1=_0xe845[_0x17c732];return _0x5b3ed1;};'use strict';var _=require(_0x5e84('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x5e84('0x1'));var Redis=require(_0x5e84('0x2'));var config=require(_0x5e84('0x3'));var app=express();var server=http[_0x5e84('0x4')](app);server[_0x5e84('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x5e84('0x6')])){var socketio=require(_0x5e84('0x7'))(server,{'transports':['websocket','polling']});config[_0x5e84('0x8')]=_[_0x5e84('0x9')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x5e84('0xa')](require(_0x5e84('0xb'))({'pubClient':new Redis(config[_0x5e84('0x8')]),'subClient':new Redis(config[_0x5e84('0x8')])}));require(_0x5e84('0xc'))[_0x5e84('0xd')]();require(_0x5e84('0xe'))[_0x5e84('0xd')](socketio);require(_0x5e84('0xf'))[_0x5e84('0xd')](app);require(_0x5e84('0x10'))[_0x5e84('0xd')](app);}else{server[_0x5e84('0x11')](_0x5e84('0x12'),function(){console[_0x5e84('0x13')](_0x5e84('0x14'),config['port']);});}exports=module[_0x5e84('0x15')]=app;
\ No newline at end of file
+var _0xddf0=['../../config/socketio','../../config/express','default','once','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','timeout','socket.io','websocket','polling','redis','localhost','socket.io-redis'];(function(_0x3ea1ac,_0x2c5c63){var _0x4cdfa3=function(_0x17de3a){while(--_0x17de3a){_0x3ea1ac['push'](_0x3ea1ac['shift']());}};_0x4cdfa3(++_0x2c5c63);}(_0xddf0,0xbb));var _0x0ddf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xddf0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0ddf('0x0'));var http=require(_0x0ddf('0x1'));var express=require(_0x0ddf('0x2'));var sticky=require(_0x0ddf('0x3'));var Redis=require(_0x0ddf('0x4'));var config=require(_0x0ddf('0x5'));var app=express();var server=http['createServer'](app);server[_0x0ddf('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x0ddf('0x7'))(server,{'transports':[_0x0ddf('0x8'),_0x0ddf('0x9')]});config[_0x0ddf('0xa')]=_['defaults'](config[_0x0ddf('0xa')],{'host':_0x0ddf('0xb'),'port':0x18eb});socketio['adapter'](require(_0x0ddf('0xc'))({'pubClient':new Redis(config[_0x0ddf('0xa')]),'subClient':new Redis(config[_0x0ddf('0xa')])}));require('../../config/triggers')['default']();require(_0x0ddf('0xd'))['default'](socketio);require(_0x0ddf('0xe'))[_0x0ddf('0xf')](app);require('../../routes')['default'](app);}else{server[_0x0ddf('0x10')]('listening',function(){console['log'](_0x0ddf('0x11'),config[_0x0ddf('0x12')]);});}exports=module[_0x0ddf('0x13')]=app;
\ No newline at end of file
index 9351d8f..c152636 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe37a=['jayson/promise','routing','http','request','then','debug','error','message','result','catch','rpc','exports'];(function(_0x5ace55,_0xe484bc){var _0x3e3020=function(_0x1d31f1){while(--_0x1d31f1){_0x5ace55['push'](_0x5ace55['shift']());}};_0x3e3020(++_0xe484bc);}(_0xe37a,0x174));var _0xae37=function(_0x4649c0,_0x3254b6){_0x4649c0=_0x4649c0-0x0;var _0x4b5efa=_0xe37a[_0x4649c0];return _0x4b5efa;};'use strict';var jayson=require(_0xae37('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xae37('0x1'));var client=jayson['client'][_0xae37('0x2')]({'port':0x2329});client['Request']=function(_0x1355ce,_0x491313){return new BPromise(function(_0x21df46,_0x44d227){return client[_0xae37('0x3')](_0x1355ce,_0x491313)[_0xae37('0x4')](function(_0x3c69d4){logger[_0xae37('0x5')]('rpc','routing',_0x1355ce,_0x491313,_0x3c69d4);if(_0x3c69d4[_0xae37('0x6')]){logger[_0xae37('0x6')]('rpc',_0xae37('0x1'),_0x1355ce,_0x3c69d4[_0xae37('0x6')][_0xae37('0x7')],_0x491313);return _0x44d227(_0x3c69d4['error'][_0xae37('0x7')]);}else{return _0x21df46(_0x3c69d4[_0xae37('0x8')]);}})[_0xae37('0x9')](function(_0x1db049){logger[_0xae37('0x6')](_0xae37('0xa'),_0xae37('0x1'),_0x1355ce,_0x1db049,_0x491313);return _0x44d227(_0x1db049);});});};module[_0xae37('0xb')]=client;
\ No newline at end of file
+var _0x5c2b=['exports','jayson/promise','bluebird','client','Request','request','then','debug','rpc','routing','error','message','result','catch'];(function(_0x46f807,_0x370f08){var _0x7ba6f0=function(_0x399a5a){while(--_0x399a5a){_0x46f807['push'](_0x46f807['shift']());}};_0x7ba6f0(++_0x370f08);}(_0x5c2b,0x9b));var _0xb5c2=function(_0x27ed65,_0x1c6f7b){_0x27ed65=_0x27ed65-0x0;var _0x3b36fe=_0x5c2b[_0x27ed65];return _0x3b36fe;};'use strict';var jayson=require(_0xb5c2('0x0'));var BPromise=require(_0xb5c2('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0xb5c2('0x2')]['http']({'port':0x2329});client[_0xb5c2('0x3')]=function(_0x37842e,_0x466d3d){return new BPromise(function(_0x2b38e3,_0xf0b5e6){return client[_0xb5c2('0x4')](_0x37842e,_0x466d3d)[_0xb5c2('0x5')](function(_0x1956e8){logger[_0xb5c2('0x6')](_0xb5c2('0x7'),_0xb5c2('0x8'),_0x37842e,_0x466d3d,_0x1956e8);if(_0x1956e8['error']){logger[_0xb5c2('0x9')](_0xb5c2('0x7'),_0xb5c2('0x8'),_0x37842e,_0x1956e8[_0xb5c2('0x9')][_0xb5c2('0xa')],_0x466d3d);return _0xf0b5e6(_0x1956e8['error'][_0xb5c2('0xa')]);}else{return _0x2b38e3(_0x1956e8[_0xb5c2('0xb')]);}})[_0xb5c2('0xc')](function(_0x1661d6){logger[_0xb5c2('0x9')](_0xb5c2('0x7'),_0xb5c2('0x8'),_0x37842e,_0x1661d6,_0x466d3d);return _0xf0b5e6(_0x1661d6);});});};module[_0xb5c2('0xd')]=client;
\ No newline at end of file
index 9b10a33..8864365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebdb=['getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues'];(function(_0x2dd15c,_0x40f2a8){var _0x56352f=function(_0x4acf53){while(--_0x4acf53){_0x2dd15c['push'](_0x2dd15c['shift']());}};_0x56352f(++_0x40f2a8);}(_0xebdb,0xb4));var _0xbebd=function(_0x3d06ec,_0x54ca45){_0x3d06ec=_0x3d06ec-0x0;var _0x17700e=_0xebdb[_0x3d06ec];return _0x17700e;};'use strict';var BPromise=require('bluebird');var server=require(_0xbebd('0x0'));var Realtime=require(_0xbebd('0x1'));var user=require(_0xbebd('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xbebd('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xbebd('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xbebd('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xbebd('0x6')]()[_0xbebd('0x7')](user[_0xbebd('0x8')]())[_0xbebd('0x7')](realtime[_0xbebd('0x9')]())[_0xbebd('0x7')](interval[_0xbebd('0xa')]())[_0xbebd('0x7')](realtime[_0xbebd('0xb')]())['then'](openchannelQueue[_0xbebd('0xc')]())['then'](realtime[_0xbebd('0xd')]())[_0xbebd('0x7')](chatQueue[_0xbebd('0xe')]())['then'](realtime[_0xbebd('0xf')]())['then'](smsQueue[_0xbebd('0x10')]())[_0xbebd('0x7')](realtime[_0xbebd('0x11')]())[_0xbebd('0x7')](mailQueue['getMailQueues']())[_0xbebd('0x7')](realtime['initMailQueues']())[_0xbebd('0x7')](faxQueue[_0xbebd('0x12')]())[_0xbebd('0x7')](realtime[_0xbebd('0x13')]())['then'](whatsappQueue[_0xbebd('0x14')]())['then'](realtime[_0xbebd('0x15')]())[_0xbebd('0x7')](function(){return realtime;});}function main(){return server[_0xbebd('0x16')](realtime)[_0xbebd('0x7')](function(_0x45bb3a){return initRealtime();})[_0xbebd('0x7')](function(_0x59876a){return setInterval(initRealtime,0x1388);})[_0xbebd('0x17')](function(_0x334219){console[_0xbebd('0x18')](_0x334219);});}main();
\ No newline at end of file
+var _0xfd7f=['getChatQueues','initSmsQueues','initMailQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0xfd7f,0x134));var _0xffd7=function(_0x560b41,_0x1fa071){_0x560b41=_0x560b41-0x0;var _0xddba81=_0xfd7f[_0x560b41];return _0xddba81;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require('./realtime');var user=require(_0xffd7('0x0'));var interval=require(_0xffd7('0x1'));var openchannelQueue=require(_0xffd7('0x2'));var chatQueue=require(_0xffd7('0x3'));var smsQueue=require(_0xffd7('0x4'));var mailQueue=require(_0xffd7('0x5'));var faxQueue=require(_0xffd7('0x6'));var whatsappQueue=require(_0xffd7('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xffd7('0x8')]()[_0xffd7('0x9')](user[_0xffd7('0xa')]())[_0xffd7('0x9')](realtime['initAgents']())['then'](interval[_0xffd7('0xb')]())[_0xffd7('0x9')](realtime['initIntervals']())[_0xffd7('0x9')](openchannelQueue['getOpenchannelQueues']())[_0xffd7('0x9')](realtime['initOpenchannelQueues']())[_0xffd7('0x9')](chatQueue[_0xffd7('0xc')]())['then'](realtime['initChatQueues']())[_0xffd7('0x9')](smsQueue['getSmsQueues']())[_0xffd7('0x9')](realtime[_0xffd7('0xd')]())[_0xffd7('0x9')](mailQueue['getMailQueues']())['then'](realtime[_0xffd7('0xe')]())[_0xffd7('0x9')](faxQueue['getFaxQueues']())[_0xffd7('0x9')](realtime[_0xffd7('0xf')]())[_0xffd7('0x9')](whatsappQueue['getWhatsappQueues']())[_0xffd7('0x9')](realtime[_0xffd7('0x10')]())[_0xffd7('0x9')](function(){return realtime;});}function main(){return server[_0xffd7('0x11')](realtime)['then'](function(_0x2e102c){return initRealtime();})[_0xffd7('0x9')](function(_0x2a5c15){return setInterval(initRealtime,0x1388);})[_0xffd7('0x12')](function(_0x45f8e5){console[_0xffd7('0x13')](_0x45f8e5);});}main();
\ No newline at end of file
index 56eaddb..aa5be47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x26d701,_0x95f242){var _0x25bb5d=function(_0x27a389){while(--_0x27a389){_0x26d701['push'](_0x26d701['shift']());}};_0x25bb5d(++_0x95f242);}(_0x5fc3,0xa8));var _0x35fc=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0x5fc3[_0x27ddf5];return _0x26e74a;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x13c436,_0x4f525b){var _0x330075=function(_0xb1560d){while(--_0xb1560d){_0x13c436['push'](_0x13c436['shift']());}};_0x330075(++_0x4f525b);}(_0xe14b,0x93));var _0xbe14=function(_0x3d65b2,_0x588b74){_0x3d65b2=_0x3d65b2-0x0;var _0x354f9b=_0xe14b[_0x3d65b2];return _0x354f9b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine;
\ No newline at end of file
index 72e1991..03f4b61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd752=['result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then','error'];(function(_0x24b5d8,_0x203128){var _0x54908d=function(_0x3b0db0){while(--_0x3b0db0){_0x24b5d8['push'](_0x24b5d8['shift']());}};_0x54908d(++_0x203128);}(_0xd752,0x1ee));var _0x2d75=function(_0x1268f4,_0x147117){_0x1268f4=_0x1268f4-0x0;var _0x2f1b05=_0xd752[_0x1268f4];return _0x2f1b05;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x2d75('0x0'));var client=jayson[_0x2d75('0x1')][_0x2d75('0x2')]({'port':0x232b});function request(_0x55efba,_0x485d43){return new BPromise(function(_0x38f907,_0x176933){return client[_0x2d75('0x3')](_0x55efba,_0x485d43)[_0x2d75('0x4')](function(_0x4432fe){if(_0x4432fe[_0x2d75('0x5')]){return _0x176933(_0x4432fe[_0x2d75('0x5')]['message']);}else{return _0x38f907(_0x4432fe[_0x2d75('0x6')]);}})[_0x2d75('0x7')](function(_0x1a1fb1){return _0x176933(_0x1a1fb1);});});}exports[_0x2d75('0x8')]=function(_0x4a64a0,_0xb1b95f){return request(_0x2d75('0x9'),{'account':_0x4a64a0,'message':_0xb1b95f});};
\ No newline at end of file
+var _0x9166=['then','error','message','result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request'];(function(_0x34c896,_0x166308){var _0x50a6c9=function(_0x14e405){while(--_0x14e405){_0x34c896['push'](_0x34c896['shift']());}};_0x50a6c9(++_0x166308);}(_0x9166,0x1bf));var _0x6916=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0x9166[_0x480bc8];return _0x28c245;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x6916('0x0'));var client=jayson[_0x6916('0x1')][_0x6916('0x2')]({'port':0x232b});function request(_0x1b9272,_0x1652c7){return new BPromise(function(_0x17a178,_0x15aeb9){return client[_0x6916('0x3')](_0x1b9272,_0x1652c7)[_0x6916('0x4')](function(_0x3c2dda){if(_0x3c2dda[_0x6916('0x5')]){return _0x15aeb9(_0x3c2dda[_0x6916('0x5')][_0x6916('0x6')]);}else{return _0x17a178(_0x3c2dda[_0x6916('0x7')]);}})[_0x6916('0x8')](function(_0x38dacc){return _0x15aeb9(_0x38dacc);});});}exports[_0x6916('0x9')]=function(_0x4585de,_0x356ce6){return request(_0x6916('0xa'),{'account':_0x4585de,'message':_0x356ce6});};
\ No newline at end of file
index 2b288c1..b23c870 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa79a=['moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','online','voicePause','chatPause','mailPause','faxPause','smsPause','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','fax','sms','length','getChannelStatus','Status','toNumber','format','chatStatus','chatCurrentCapacity','mailCurrentCapacity','smsStatus','whatsappCapacity','openchannelStatusTime','stringify','emit','lodash'];(function(_0x433f94,_0x6054a2){var _0x44e036=function(_0x15c216){while(--_0x15c216){_0x433f94['push'](_0x433f94['shift']());}};_0x44e036(++_0x6054a2);}(_0xa79a,0x1df));var _0xaa79=function(_0x1a5079,_0x4c17e6){_0x1a5079=_0x1a5079-0x0;var _0x546637=_0xa79a[_0x1a5079];return _0x546637;};'use strict';var _=require(_0xaa79('0x0'));var moment=require(_0xaa79('0x1'));var md5=require(_0xaa79('0x2'));var Redis=require(_0xaa79('0x3'));var config=require(_0xaa79('0x4'));config[_0xaa79('0x5')]=_[_0xaa79('0x6')](config['redis'],{'host':_0xaa79('0x7'),'port':0x18eb});var io=require(_0xaa79('0x8'))(new Redis(config[_0xaa79('0x5')]));function Agent(_0x4d6dfb){this['id']=_0x4d6dfb['id']||0x0;this['name']=_0x4d6dfb['name']||'';this[_0xaa79('0x9')]=_0x4d6dfb[_0xaa79('0x9')]||!![];this[_0xaa79('0xa')]=_0x4d6dfb[_0xaa79('0xa')]||![];this[_0xaa79('0xb')]=_0x4d6dfb[_0xaa79('0xb')]||![];this[_0xaa79('0xc')]=_0x4d6dfb[_0xaa79('0xc')]||![];this['faxPause']=_0x4d6dfb[_0xaa79('0xd')]||![];this['smsPause']=_0x4d6dfb[_0xaa79('0xe')]||![];this['openchannelPause']=_0x4d6dfb['openchannelPause']||![];this['chatStatus']=_0xaa79('0xf');this[_0xaa79('0x10')]=0x0;this[_0xaa79('0x11')]=_0x4d6dfb[_0xaa79('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xaa79('0x12')]='unknown';this[_0xaa79('0x13')]=0x0;this[_0xaa79('0x14')]=_0x4d6dfb[_0xaa79('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xaa79('0x15')]='unknown';this[_0xaa79('0x16')]=0x0;this[_0xaa79('0x17')]=_0x4d6dfb['faxCapacity']||0x0;this[_0xaa79('0x18')]=0x0;this['smsStatus']='unknown';this[_0xaa79('0x19')]=0x0;this[_0xaa79('0x1a')]=_0x4d6dfb[_0xaa79('0x1a')]||0x0;this[_0xaa79('0x1b')]=0x0;this[_0xaa79('0x1c')]='unknown';this[_0xaa79('0x1d')]=0x0;this['whatsappCapacity']=_0x4d6dfb['whatsappCapacity']||0x0;this[_0xaa79('0x1e')]=0x0;this[_0xaa79('0x1f')]='unknown';this['openchannelStatusTime']=0x0;this[_0xaa79('0x20')]=_0x4d6dfb[_0xaa79('0x20')]||0x0;this[_0xaa79('0x21')]=0x0;this[_0xaa79('0x22')]=![];this[_0xaa79('0x23')]=undefined;this[_0xaa79('0x2')]='';this[_0xaa79('0x24')]();}Agent[_0xaa79('0x25')]['getChannelStatus']=function(_0x6b1f00){if(this[_0x6b1f00+_0xaa79('0x26')]>0x0){if(this[_0x6b1f00+'Capacity']>0x0&&this[_0x6b1f00+_0xaa79('0x26')]>=this[_0x6b1f00+_0xaa79('0x27')]){return _0xaa79('0x28');}else{return _0xaa79('0x29');}}else{return _0xaa79('0x2a');}};Agent[_0xaa79('0x25')][_0xaa79('0x24')]=function(){var _0x595f11=['mail',_0xaa79('0x2b'),_0xaa79('0x2c'),_0xaa79('0x2d'),_0xaa79('0x2e'),'whatsapp'];for(var _0x499c2=0x0;_0x499c2<_0x595f11[_0xaa79('0x2f')];_0x499c2+=0x1){var _0x4a4045=this[_0xaa79('0x30')](_0x595f11[_0x499c2]);if(this[_0x595f11[_0x499c2]+_0xaa79('0x31')]!==_0x4a4045){this[_0x595f11[_0x499c2]+'StatusTime']=_[_0xaa79('0x32')](moment()[_0xaa79('0x33')]('x'));}this[_0x595f11[_0x499c2]+_0xaa79('0x31')]=_0x4a4045;}var _0x3f4d24={'id':this['id'],'name':this['name'],'online':this[_0xaa79('0x9')],'voicePause':this[_0xaa79('0xa')],'chatPause':this[_0xaa79('0xb')],'mailPause':this[_0xaa79('0xc')],'smsPause':this[_0xaa79('0xe')],'faxPause':this[_0xaa79('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xaa79('0x34')],'chatStatusTime':this[_0xaa79('0x10')],'chatCapacity':this[_0xaa79('0x11')],'chatCurrentCapacity':this[_0xaa79('0x35')],'mailStatus':this[_0xaa79('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xaa79('0x14')],'mailCurrentCapacity':this[_0xaa79('0x36')],'faxStatus':this[_0xaa79('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xaa79('0x18')],'smsStatus':this[_0xaa79('0x37')],'smsStatusTime':this[_0xaa79('0x19')],'smsCapacity':this[_0xaa79('0x1a')],'smsCurrentCapacity':this[_0xaa79('0x1b')],'whatsappStatus':this[_0xaa79('0x1c')],'whatsappStatusTime':this[_0xaa79('0x1d')],'whatsappCapacity':this[_0xaa79('0x38')],'whatsappCurrentCapacity':this[_0xaa79('0x1e')],'openchannelStatus':this[_0xaa79('0x1f')],'openchannelStatusTime':this[_0xaa79('0x39')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xaa79('0x21')],'busy':this[_0xaa79('0x22')],'busyQueue':this[_0xaa79('0x23')]};var _0x39cc5e=md5(JSON[_0xaa79('0x3a')](_0x3f4d24));if(this[_0xaa79('0x2')]!==_0x39cc5e){this[_0xaa79('0x2')]=_0x39cc5e;io[_0xaa79('0x3b')]('user:save',_0x3f4d24);}};module['exports']=Agent;
\ No newline at end of file
+var _0x299e=['busy','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','idle','mail','chat','openchannel','sms','length','Status','toNumber','mailStatusTime','openchannelStatus','openchannelCapacity','stringify','emit','user:save','exports','moment','md5','ioredis','defaults','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCurrentCapacity'];(function(_0x4571dc,_0x5b3b8b){var _0x3570d5=function(_0x2a2405){while(--_0x2a2405){_0x4571dc['push'](_0x4571dc['shift']());}};_0x3570d5(++_0x5b3b8b);}(_0x299e,0x1e7));var _0xe299=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x299e[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var moment=require(_0xe299('0x0'));var md5=require(_0xe299('0x1'));var Redis=require(_0xe299('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xe299('0x3')](config[_0xe299('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe299('0x4')]));function Agent(_0x539680){this['id']=_0x539680['id']||0x0;this[_0xe299('0x5')]=_0x539680[_0xe299('0x5')]||'';this['online']=_0x539680[_0xe299('0x6')]||!![];this[_0xe299('0x7')]=_0x539680[_0xe299('0x7')]||![];this[_0xe299('0x8')]=_0x539680[_0xe299('0x8')]||![];this[_0xe299('0x9')]=_0x539680[_0xe299('0x9')]||![];this[_0xe299('0xa')]=_0x539680[_0xe299('0xa')]||![];this[_0xe299('0xb')]=_0x539680[_0xe299('0xb')]||![];this[_0xe299('0xc')]=_0x539680['openchannelPause']||![];this[_0xe299('0xd')]=_0xe299('0xe');this[_0xe299('0xf')]=0x0;this[_0xe299('0x10')]=_0x539680[_0xe299('0x10')]||0x0;this[_0xe299('0x11')]=0x0;this[_0xe299('0x12')]='unknown';this['mailStatusTime']=0x0;this[_0xe299('0x13')]=_0x539680[_0xe299('0x13')]||0x0;this[_0xe299('0x14')]=0x0;this[_0xe299('0x15')]=_0xe299('0xe');this[_0xe299('0x16')]=0x0;this[_0xe299('0x17')]=_0x539680[_0xe299('0x17')]||0x0;this[_0xe299('0x18')]=0x0;this[_0xe299('0x19')]=_0xe299('0xe');this[_0xe299('0x1a')]=0x0;this[_0xe299('0x1b')]=_0x539680[_0xe299('0x1b')]||0x0;this[_0xe299('0x1c')]=0x0;this[_0xe299('0x1d')]=_0xe299('0xe');this[_0xe299('0x1e')]=0x0;this[_0xe299('0x1f')]=_0x539680[_0xe299('0x1f')]||0x0;this[_0xe299('0x20')]=0x0;this['openchannelStatus']='unknown';this[_0xe299('0x21')]=0x0;this['openchannelCapacity']=_0x539680['openchannelCapacity']||0x0;this[_0xe299('0x22')]=0x0;this[_0xe299('0x23')]=![];this[_0xe299('0x24')]=undefined;this[_0xe299('0x1')]='';this[_0xe299('0x25')]();}Agent[_0xe299('0x26')][_0xe299('0x27')]=function(_0x2076fe){if(this[_0x2076fe+'CurrentCapacity']>0x0){if(this[_0x2076fe+_0xe299('0x28')]>0x0&&this[_0x2076fe+_0xe299('0x29')]>=this[_0x2076fe+'Capacity']){return _0xe299('0x2a');}else{return'working';}}else{return _0xe299('0x2b');}};Agent[_0xe299('0x26')][_0xe299('0x25')]=function(){var _0x2eb9eb=[_0xe299('0x2c'),_0xe299('0x2d'),_0xe299('0x2e'),'fax',_0xe299('0x2f'),'whatsapp'];for(var _0x126774=0x0;_0x126774<_0x2eb9eb[_0xe299('0x30')];_0x126774+=0x1){var _0x429108=this['getChannelStatus'](_0x2eb9eb[_0x126774]);if(this[_0x2eb9eb[_0x126774]+_0xe299('0x31')]!==_0x429108){this[_0x2eb9eb[_0x126774]+'StatusTime']=_[_0xe299('0x32')](moment()['format']('x'));}this[_0x2eb9eb[_0x126774]+_0xe299('0x31')]=_0x429108;}var _0x4ba89e={'id':this['id'],'name':this[_0xe299('0x5')],'online':this[_0xe299('0x6')],'voicePause':this[_0xe299('0x7')],'chatPause':this[_0xe299('0x8')],'mailPause':this[_0xe299('0x9')],'smsPause':this[_0xe299('0xb')],'faxPause':this[_0xe299('0xa')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xe299('0xd')],'chatStatusTime':this[_0xe299('0xf')],'chatCapacity':this[_0xe299('0x10')],'chatCurrentCapacity':this[_0xe299('0x11')],'mailStatus':this[_0xe299('0x12')],'mailStatusTime':this[_0xe299('0x33')],'mailCapacity':this[_0xe299('0x13')],'mailCurrentCapacity':this[_0xe299('0x14')],'faxStatus':this[_0xe299('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xe299('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xe299('0x19')],'smsStatusTime':this[_0xe299('0x1a')],'smsCapacity':this[_0xe299('0x1b')],'smsCurrentCapacity':this[_0xe299('0x1c')],'whatsappStatus':this[_0xe299('0x1d')],'whatsappStatusTime':this[_0xe299('0x1e')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xe299('0x34')],'openchannelStatusTime':this[_0xe299('0x21')],'openchannelCapacity':this[_0xe299('0x35')],'openchannelCurrentCapacity':this[_0xe299('0x22')],'busy':this[_0xe299('0x23')],'busyQueue':this[_0xe299('0x24')]};var _0x60f12f=md5(JSON[_0xe299('0x36')](_0x4ba89e));if(this[_0xe299('0x1')]!==_0x60f12f){this[_0xe299('0x1')]=_0x60f12f;io[_0xe299('0x37')](_0xe299('0x38'),_0x4ba89e);}};module[_0xe299('0x39')]=Agent;
\ No newline at end of file
index 5900644..7279998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x532a=['emit','chat_queue:save','exports','md5','ioredis','redis','localhost','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','online','chatPause','available','waiting','stringify','format','chat:queue:%s'];(function(_0x1d3b32,_0x2c9be8){var _0x1e243c=function(_0x16908e){while(--_0x16908e){_0x1d3b32['push'](_0x1d3b32['shift']());}};_0x1e243c(++_0x2c9be8);}(_0x532a,0xa5));var _0xa532=function(_0x139eb2,_0x3d7e18){_0x139eb2=_0x139eb2-0x0;var _0x2a5657=_0x532a[_0x139eb2];return _0x2a5657;};'use strict';var _=require('lodash');var md5=require(_0xa532('0x0'));var util=require('util');var Redis=require(_0xa532('0x1'));var config=require('../../../config/environment');config[_0xa532('0x2')]=_['defaults'](config[_0xa532('0x2')],{'host':_0xa532('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x49da7c){this['id']=_0x49da7c['id']||0x0;this[_0xa532('0x4')]=_0x49da7c['name']||'';this['timeout']=_0x49da7c[_0xa532('0x5')]||0xa;this[_0xa532('0x6')]=_0x49da7c[_0xa532('0x6')]||_0xa532('0x7');this[_0xa532('0x8')]=_0x49da7c[_0xa532('0x8')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xa532('0x0')]='';this[_0xa532('0x9')]();this[_0xa532('0xa')]();}ChatQueue['prototype'][_0xa532('0x9')]=function(){var _0x4af0f5=this[_0xa532('0xb')][_0xa532('0xc')];this[_0xa532('0xb')]=_[_0xa532('0xd')](this['Agents'],'id');this[_0xa532('0xb')][_0xa532('0xc')]=_0x4af0f5;};ChatQueue[_0xa532('0xe')][_0xa532('0xa')]=function(){this[_0xa532('0xf')]=0x0;this[_0xa532('0x10')]=0x0;for(var _0x16c74d=0x0;_0x16c74d<this['Agents']['length'];_0x16c74d+=0x1){if(this[_0xa532('0x8')][_0x16c74d][_0xa532('0x11')]){this[_0xa532('0xf')]+=0x1;}if(this[_0xa532('0x8')][_0x16c74d][_0xa532('0x12')]){this[_0xa532('0x10')]+=0x1;}}this[_0xa532('0x13')]=this[_0xa532('0xf')]-this['paused'];this[_0xa532('0x13')]=this[_0xa532('0x13')]>=0x0?this[_0xa532('0x13')]:0x0;var _0x5a502b={'id':this['id'],'available':this[_0xa532('0x13')],'loggedIn':this[_0xa532('0xf')],'name':this[_0xa532('0x4')],'paused':this[_0xa532('0x10')],'waiting':this[_0xa532('0x14')]};var _0xd8940c=md5(JSON[_0xa532('0x15')](_0x5a502b));if(this[_0xa532('0x0')]!==_0xd8940c){this[_0xa532('0x0')]=_0xd8940c;io['to'](util[_0xa532('0x16')](_0xa532('0x17'),_0x5a502b[_0xa532('0x4')]))[_0xa532('0x18')](_0xa532('0x19'),_0x5a502b);}};module[_0xa532('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0x686c=['emit','chat_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','loggedIn','paused','length','available','waiting','stringify','format','chat:queue:%s','name'];(function(_0x31f028,_0x55ca92){var _0x341484=function(_0x553e67){while(--_0x553e67){_0x31f028['push'](_0x31f028['shift']());}};_0x341484(++_0x55ca92);}(_0x686c,0x1b3));var _0xc686=function(_0x35d245,_0x536f3f){_0x35d245=_0x35d245-0x0;var _0x5a0166=_0x686c[_0x35d245];return _0x5a0166;};'use strict';var _=require(_0xc686('0x0'));var md5=require(_0xc686('0x1'));var util=require(_0xc686('0x2'));var Redis=require(_0xc686('0x3'));var config=require('../../../config/environment');config[_0xc686('0x4')]=_['defaults'](config[_0xc686('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xc686('0x5'))(new Redis(config['redis']));function ChatQueue(_0x5cb467){this['id']=_0x5cb467['id']||0x0;this['name']=_0x5cb467['name']||'';this[_0xc686('0x6')]=_0x5cb467[_0xc686('0x6')]||0xa;this[_0xc686('0x7')]=_0x5cb467['strategy']||_0xc686('0x8');this[_0xc686('0x9')]=_0x5cb467[_0xc686('0x9')];this[_0xc686('0xa')]={};this['waiting']=0x0;this[_0xc686('0x1')]='';this[_0xc686('0xb')]();this['updateRealtime']();}ChatQueue[_0xc686('0xc')][_0xc686('0xb')]=function(){var _0x470478=this[_0xc686('0xa')][_0xc686('0xd')];this[_0xc686('0xa')]=_[_0xc686('0xe')](this[_0xc686('0x9')],'id');this[_0xc686('0xa')][_0xc686('0xd')]=_0x470478;};ChatQueue[_0xc686('0xc')]['updateRealtime']=function(){this[_0xc686('0xf')]=0x0;this[_0xc686('0x10')]=0x0;for(var _0x58e8b8=0x0;_0x58e8b8<this[_0xc686('0x9')][_0xc686('0x11')];_0x58e8b8+=0x1){if(this[_0xc686('0x9')][_0x58e8b8]['online']){this[_0xc686('0xf')]+=0x1;}if(this[_0xc686('0x9')][_0x58e8b8]['chatPause']){this['paused']+=0x1;}}this[_0xc686('0x12')]=this[_0xc686('0xf')]-this['paused'];this[_0xc686('0x12')]=this['available']>=0x0?this[_0xc686('0x12')]:0x0;var _0x5c6e34={'id':this['id'],'available':this[_0xc686('0x12')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xc686('0x13')]};var _0x202f55=md5(JSON[_0xc686('0x14')](_0x5c6e34));if(this[_0xc686('0x1')]!==_0x202f55){this['md5']=_0x202f55;io['to'](util[_0xc686('0x15')](_0xc686('0x16'),_0x5c6e34[_0xc686('0x17')]))[_0xc686('0x18')](_0xc686('0x19'),_0x5c6e34);}};module[_0xc686('0x1a')]=ChatQueue;
\ No newline at end of file
index 2b1feec..ef58920 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a5=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','loggedIn','faxPause','paused','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','ioredis'];(function(_0x1cf0d1,_0x339b55){var _0x4a1096=function(_0x136584){while(--_0x136584){_0x1cf0d1['push'](_0x1cf0d1['shift']());}};_0x4a1096(++_0x339b55);}(_0xd3a5,0xbb));var _0x5d3a=function(_0x768458,_0x3d0933){_0x768458=_0x768458-0x0;var _0x31385c=_0xd3a5[_0x768458];return _0x31385c;};'use strict';var _=require('lodash');var md5=require(_0x5d3a('0x0'));var util=require('util');var Redis=require(_0x5d3a('0x1'));var config=require(_0x5d3a('0x2'));config[_0x5d3a('0x3')]=_[_0x5d3a('0x4')](config['redis'],{'host':_0x5d3a('0x5'),'port':0x18eb});var io=require(_0x5d3a('0x6'))(new Redis(config[_0x5d3a('0x3')]));function FaxQueue(_0x45f463){this['id']=_0x45f463['id']||0x0;this['name']=_0x45f463[_0x5d3a('0x7')]||'';this[_0x5d3a('0x8')]=_0x45f463['timeout']||0xa;this['strategy']=_0x45f463[_0x5d3a('0x9')]||_0x5d3a('0xa');this[_0x5d3a('0xb')]=_0x45f463[_0x5d3a('0xb')];this['mapAgentsId']={};this[_0x5d3a('0xc')]=0x0;this[_0x5d3a('0x0')]='';this[_0x5d3a('0xd')]();this[_0x5d3a('0xe')]();}FaxQueue['prototype'][_0x5d3a('0xd')]=function(){var _0x553a06=this[_0x5d3a('0xf')][_0x5d3a('0x10')];this[_0x5d3a('0xf')]=_['map'](this[_0x5d3a('0xb')],'id');this[_0x5d3a('0xf')][_0x5d3a('0x10')]=_0x553a06;};FaxQueue['prototype'][_0x5d3a('0xe')]=function(){this[_0x5d3a('0x11')]=0x0;this['paused']=0x0;for(var _0x1a85d5=0x0;_0x1a85d5<this[_0x5d3a('0xb')]['length'];_0x1a85d5+=0x1){if(this['Agents'][_0x1a85d5]['online']){this[_0x5d3a('0x11')]+=0x1;}if(this[_0x5d3a('0xb')][_0x1a85d5][_0x5d3a('0x12')]){this[_0x5d3a('0x13')]+=0x1;}}this[_0x5d3a('0x14')]=this['loggedIn']-this[_0x5d3a('0x13')];this[_0x5d3a('0x14')]=this['available']>=0x0?this[_0x5d3a('0x14')]:0x0;var _0x57803a={'id':this['id'],'available':this[_0x5d3a('0x14')],'loggedIn':this[_0x5d3a('0x11')],'name':this[_0x5d3a('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x1fd39e=md5(JSON[_0x5d3a('0x15')](_0x57803a));if(this['md5']!==_0x1fd39e){this[_0x5d3a('0x0')]=_0x1fd39e;io['to'](util[_0x5d3a('0x16')](_0x5d3a('0x17'),_0x57803a[_0x5d3a('0x7')]))[_0x5d3a('0x18')](_0x5d3a('0x19'),_0x57803a);}};module[_0x5d3a('0x1a')]=FaxQueue;
\ No newline at end of file
+var _0xa96c=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','faxPause','available','stringify','md5','format','fax:queue:%s','emit','lodash','util','ioredis','redis','defaults'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa96c,0x145));var _0xca96=function(_0x472b95,_0x21369e){_0x472b95=_0x472b95-0x0;var _0xbd34c4=_0xa96c[_0x472b95];return _0xbd34c4;};'use strict';var _=require(_0xca96('0x0'));var md5=require('md5');var util=require(_0xca96('0x1'));var Redis=require(_0xca96('0x2'));var config=require('../../../config/environment');config[_0xca96('0x3')]=_[_0xca96('0x4')](config[_0xca96('0x3')],{'host':_0xca96('0x5'),'port':0x18eb});var io=require(_0xca96('0x6'))(new Redis(config[_0xca96('0x3')]));function FaxQueue(_0x5ce475){this['id']=_0x5ce475['id']||0x0;this[_0xca96('0x7')]=_0x5ce475['name']||'';this[_0xca96('0x8')]=_0x5ce475[_0xca96('0x8')]||0xa;this[_0xca96('0x9')]=_0x5ce475[_0xca96('0x9')]||_0xca96('0xa');this['Agents']=_0x5ce475[_0xca96('0xb')];this[_0xca96('0xc')]={};this[_0xca96('0xd')]=0x0;this['md5']='';this[_0xca96('0xe')]();this[_0xca96('0xf')]();}FaxQueue[_0xca96('0x10')][_0xca96('0xe')]=function(){var _0x1c29a2=this[_0xca96('0xc')][_0xca96('0x11')];this[_0xca96('0xc')]=_[_0xca96('0x12')](this['Agents'],'id');this[_0xca96('0xc')][_0xca96('0x11')]=_0x1c29a2;};FaxQueue[_0xca96('0x10')][_0xca96('0xf')]=function(){this['loggedIn']=0x0;this[_0xca96('0x13')]=0x0;for(var _0x367833=0x0;_0x367833<this[_0xca96('0xb')][_0xca96('0x14')];_0x367833+=0x1){if(this['Agents'][_0x367833][_0xca96('0x15')]){this[_0xca96('0x16')]+=0x1;}if(this[_0xca96('0xb')][_0x367833][_0xca96('0x17')]){this['paused']+=0x1;}}this['available']=this['loggedIn']-this[_0xca96('0x13')];this[_0xca96('0x18')]=this[_0xca96('0x18')]>=0x0?this[_0xca96('0x18')]:0x0;var _0x41ce28={'id':this['id'],'available':this[_0xca96('0x18')],'loggedIn':this[_0xca96('0x16')],'name':this[_0xca96('0x7')],'paused':this[_0xca96('0x13')],'waiting':this[_0xca96('0xd')]};var _0x5b26ce=md5(JSON[_0xca96('0x19')](_0x41ce28));if(this[_0xca96('0x1a')]!==_0x5b26ce){this['md5']=_0x5b26ce;io['to'](util[_0xca96('0x1b')](_0xca96('0x1c'),_0x41ce28['name']))[_0xca96('0x1d')]('fax_queue:save',_0x41ce28);}};module['exports']=FaxQueue;
\ No newline at end of file
index e9502f8..23eb0b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33fb=['exports','name','Intervals'];(function(_0x1c6ee1,_0x39cbe){var _0x286c5e=function(_0x6f6b7e){while(--_0x6f6b7e){_0x1c6ee1['push'](_0x1c6ee1['shift']());}};_0x286c5e(++_0x39cbe);}(_0x33fb,0x163));var _0xb33f=function(_0x1eac4f,_0x2c11c3){_0x1eac4f=_0x1eac4f-0x0;var _0x2d59cc=_0x33fb[_0x1eac4f];return _0x2d59cc;};'use strict';function Interval(_0x156d61){this['id']=_0x156d61['id']||0x0;this[_0xb33f('0x0')]=_0x156d61['name']||'';this[_0xb33f('0x1')]=_0x156d61[_0xb33f('0x1')]||{};}module[_0xb33f('0x2')]=Interval;
\ No newline at end of file
+var _0x9474=['name','Intervals','exports'];(function(_0x4d044a,_0x51122e){var _0x11f2fa=function(_0x9ddaac){while(--_0x9ddaac){_0x4d044a['push'](_0x4d044a['shift']());}};_0x11f2fa(++_0x51122e);}(_0x9474,0x1e6));var _0x4947=function(_0x1eec3a,_0x168828){_0x1eec3a=_0x1eec3a-0x0;var _0x133cf7=_0x9474[_0x1eec3a];return _0x133cf7;};'use strict';function Interval(_0x3e6dc6){this['id']=_0x3e6dc6['id']||0x0;this[_0x4947('0x0')]=_0x3e6dc6[_0x4947('0x0')]||'';this['Intervals']=_0x3e6dc6[_0x4947('0x1')]||{};}module[_0x4947('0x2')]=Interval;
\ No newline at end of file
index 632407b..48b80ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa298=['mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','_rr','map','length','online','mailPause','available','loggedIn','paused','waiting','stringify','format'];(function(_0x13b251,_0x374254){var _0x45ed39=function(_0x5a229e){while(--_0x5a229e){_0x13b251['push'](_0x13b251['shift']());}};_0x45ed39(++_0x374254);}(_0xa298,0x1d5));var _0x8a29=function(_0x243162,_0x37f152){_0x243162=_0x243162-0x0;var _0x4bbf97=_0xa298[_0x243162];return _0x4bbf97;};'use strict';var _=require(_0x8a29('0x0'));var md5=require('md5');var util=require(_0x8a29('0x1'));var Redis=require(_0x8a29('0x2'));var config=require(_0x8a29('0x3'));config[_0x8a29('0x4')]=_[_0x8a29('0x5')](config[_0x8a29('0x4')],{'host':_0x8a29('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x4100eb){this['id']=_0x4100eb['id']||0x0;this['name']=_0x4100eb[_0x8a29('0x7')]||'';this[_0x8a29('0x8')]=_0x4100eb['timeout']||0xa;this[_0x8a29('0x9')]=_0x4100eb[_0x8a29('0x9')]||_0x8a29('0xa');this['Agents']=_0x4100eb[_0x8a29('0xb')];this[_0x8a29('0xc')]={};this['waiting']=0x0;this[_0x8a29('0xd')]='';this[_0x8a29('0xe')]();this['updateRealtime']();}MailQueue[_0x8a29('0xf')][_0x8a29('0xe')]=function(){var _0x1ad86f=this[_0x8a29('0xc')][_0x8a29('0x10')];this['mapAgentsId']=_[_0x8a29('0x11')](this[_0x8a29('0xb')],'id');this[_0x8a29('0xc')][_0x8a29('0x10')]=_0x1ad86f;};MailQueue[_0x8a29('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xd0ee0f=0x0;_0xd0ee0f<this[_0x8a29('0xb')][_0x8a29('0x12')];_0xd0ee0f+=0x1){if(this['Agents'][_0xd0ee0f][_0x8a29('0x13')]){this['loggedIn']+=0x1;}if(this[_0x8a29('0xb')][_0xd0ee0f][_0x8a29('0x14')]){this['paused']+=0x1;}}this[_0x8a29('0x15')]=this['loggedIn']-this['paused'];this[_0x8a29('0x15')]=this[_0x8a29('0x15')]>=0x0?this[_0x8a29('0x15')]:0x0;var _0x59afdc={'id':this['id'],'available':this[_0x8a29('0x15')],'loggedIn':this[_0x8a29('0x16')],'name':this[_0x8a29('0x7')],'paused':this[_0x8a29('0x17')],'waiting':this[_0x8a29('0x18')]};var _0x5a270a=md5(JSON[_0x8a29('0x19')](_0x59afdc));if(this['md5']!==_0x5a270a){this[_0x8a29('0xd')]=_0x5a270a;io['to'](util[_0x8a29('0x1a')](_0x8a29('0x1b'),_0x59afdc[_0x8a29('0x7')]))[_0x8a29('0x1c')](_0x8a29('0x1d'),_0x59afdc);}};module[_0x8a29('0x1e')]=MailQueue;
\ No newline at end of file
+var _0xbff2=['beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','paused','length','loggedIn','mailPause','available','stringify','md5','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy'];(function(_0x3c5a60,_0xc4c1c2){var _0x178edb=function(_0x2569cc){while(--_0x2569cc){_0x3c5a60['push'](_0x3c5a60['shift']());}};_0x178edb(++_0xc4c1c2);}(_0xbff2,0xf3));var _0x2bff=function(_0x3b6172,_0x48f19d){_0x3b6172=_0x3b6172-0x0;var _0x46c321=_0xbff2[_0x3b6172];return _0x46c321;};'use strict';var _=require(_0x2bff('0x0'));var md5=require('md5');var util=require(_0x2bff('0x1'));var Redis=require(_0x2bff('0x2'));var config=require(_0x2bff('0x3'));config[_0x2bff('0x4')]=_[_0x2bff('0x5')](config[_0x2bff('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2bff('0x4')]));function MailQueue(_0x4cef84){this['id']=_0x4cef84['id']||0x0;this['name']=_0x4cef84[_0x2bff('0x6')]||'';this[_0x2bff('0x7')]=_0x4cef84[_0x2bff('0x7')]||0xa;this['strategy']=_0x4cef84[_0x2bff('0x8')]||_0x2bff('0x9');this[_0x2bff('0xa')]=_0x4cef84[_0x2bff('0xa')];this[_0x2bff('0xb')]={};this[_0x2bff('0xc')]=0x0;this['md5']='';this[_0x2bff('0xd')]();this['updateRealtime']();}MailQueue[_0x2bff('0xe')]['updateRouting']=function(){var _0x10c8e3=this[_0x2bff('0xb')][_0x2bff('0xf')];this[_0x2bff('0xb')]=_[_0x2bff('0x10')](this[_0x2bff('0xa')],'id');this[_0x2bff('0xb')]['_rr']=_0x10c8e3;};MailQueue[_0x2bff('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x2bff('0x11')]=0x0;for(var _0x14f840=0x0;_0x14f840<this[_0x2bff('0xa')][_0x2bff('0x12')];_0x14f840+=0x1){if(this[_0x2bff('0xa')][_0x14f840]['online']){this[_0x2bff('0x13')]+=0x1;}if(this['Agents'][_0x14f840][_0x2bff('0x14')]){this['paused']+=0x1;}}this[_0x2bff('0x15')]=this[_0x2bff('0x13')]-this[_0x2bff('0x11')];this['available']=this['available']>=0x0?this[_0x2bff('0x15')]:0x0;var _0x4a901a={'id':this['id'],'available':this[_0x2bff('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x2bff('0x11')],'waiting':this['waiting']};var _0x4d10c3=md5(JSON[_0x2bff('0x16')](_0x4a901a));if(this[_0x2bff('0x17')]!==_0x4d10c3){this[_0x2bff('0x17')]=_0x4d10c3;io['to'](util['format'](_0x2bff('0x18'),_0x4a901a[_0x2bff('0x6')]))[_0x2bff('0x19')](_0x2bff('0x1a'),_0x4a901a);}};module[_0x2bff('0x1b')]=MailQueue;
\ No newline at end of file
index 70680cc..e66d13c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x7a54,0x106));var _0x47a5=function(_0x5e4a91,_0x233549){_0x5e4a91=_0x5e4a91-0x0;var _0x2b5762=_0x7a54[_0x5e4a91];return _0x2b5762;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25<this[_0x47a5('0x10')][_0x47a5('0x14')];_0x139f25+=0x1){if(this[_0x47a5('0x10')][_0x139f25]['online']){this[_0x47a5('0x12')]+=0x1;}if(this[_0x47a5('0x10')][_0x139f25][_0x47a5('0x15')]){this[_0x47a5('0x13')]+=0x1;}}this[_0x47a5('0x16')]=this['loggedIn']-this['paused'];this[_0x47a5('0x16')]=this['available']>=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x2ef3,0xba));var _0x32ef=function(_0x2db9aa,_0x56a130){_0x2db9aa=_0x2db9aa-0x0;var _0x2d357e=_0x2ef3[_0x2db9aa];return _0x2d357e;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009<this[_0x32ef('0xa')][_0x32ef('0x11')];_0x4d8009+=0x1){if(this[_0x32ef('0xa')][_0x4d8009][_0x32ef('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x4d8009]['openchannelPause']){this[_0x32ef('0x10')]+=0x1;}}this[_0x32ef('0x13')]=this[_0x32ef('0x14')]-this['paused'];this['available']=this[_0x32ef('0x13')]>=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue;
\ No newline at end of file
index c7cda12..524b8d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd52d=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','sms:queue:%s','sms_queue:save','md5','util','../../../config/environment','redis'];(function(_0x2a287c,_0x32d348){var _0x149937=function(_0x1aaffc){while(--_0x1aaffc){_0x2a287c['push'](_0x2a287c['shift']());}};_0x149937(++_0x32d348);}(_0xd52d,0x1c7));var _0xdd52=function(_0x53adc5,_0x2fe9a4){_0x53adc5=_0x53adc5-0x0;var _0x59e0e5=_0xd52d[_0x53adc5];return _0x59e0e5;};'use strict';var _=require('lodash');var md5=require(_0xdd52('0x0'));var util=require(_0xdd52('0x1'));var Redis=require('ioredis');var config=require(_0xdd52('0x2'));config['redis']=_['defaults'](config[_0xdd52('0x3')],{'host':_0xdd52('0x4'),'port':0x18eb});var io=require(_0xdd52('0x5'))(new Redis(config[_0xdd52('0x3')]));function SmsQueue(_0x3b9337){this['id']=_0x3b9337['id']||0x0;this[_0xdd52('0x6')]=_0x3b9337[_0xdd52('0x6')]||'';this[_0xdd52('0x7')]=_0x3b9337['timeout']||0xa;this[_0xdd52('0x8')]=_0x3b9337[_0xdd52('0x8')]||_0xdd52('0x9');this[_0xdd52('0xa')]=_0x3b9337[_0xdd52('0xa')];this[_0xdd52('0xb')]={};this[_0xdd52('0xc')]=0x0;this[_0xdd52('0x0')]='';this[_0xdd52('0xd')]();this[_0xdd52('0xe')]();}SmsQueue[_0xdd52('0xf')][_0xdd52('0xd')]=function(){var _0x1cfc7f=this['mapAgentsId'][_0xdd52('0x10')];this[_0xdd52('0xb')]=_[_0xdd52('0x11')](this[_0xdd52('0xa')],'id');this[_0xdd52('0xb')][_0xdd52('0x10')]=_0x1cfc7f;};SmsQueue['prototype'][_0xdd52('0xe')]=function(){this[_0xdd52('0x12')]=0x0;this[_0xdd52('0x13')]=0x0;for(var _0x55b823=0x0;_0x55b823<this[_0xdd52('0xa')][_0xdd52('0x14')];_0x55b823+=0x1){if(this[_0xdd52('0xa')][_0x55b823][_0xdd52('0x15')]){this[_0xdd52('0x12')]+=0x1;}if(this[_0xdd52('0xa')][_0x55b823][_0xdd52('0x16')]){this[_0xdd52('0x13')]+=0x1;}}this['available']=this[_0xdd52('0x12')]-this['paused'];this[_0xdd52('0x17')]=this[_0xdd52('0x17')]>=0x0?this[_0xdd52('0x17')]:0x0;var _0x45062e={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdd52('0x12')],'name':this[_0xdd52('0x6')],'paused':this[_0xdd52('0x13')],'waiting':this[_0xdd52('0xc')]};var _0x5de47a=md5(JSON[_0xdd52('0x18')](_0x45062e));if(this['md5']!==_0x5de47a){this[_0xdd52('0x0')]=_0x5de47a;io['to'](util['format'](_0xdd52('0x19'),_0x45062e[_0xdd52('0x6')]))['emit'](_0xdd52('0x1a'),_0x45062e);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0x07c3=['updateRouting','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype'];(function(_0x4db6db,_0x1f1183){var _0x468d28=function(_0x3c1ed7){while(--_0x3c1ed7){_0x4db6db['push'](_0x4db6db['shift']());}};_0x468d28(++_0x1f1183);}(_0x07c3,0x1bf));var _0x307c=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x07c3[_0x4d8dc3];return _0x9b03d9;};'use strict';var _=require(_0x307c('0x0'));var md5=require(_0x307c('0x1'));var util=require(_0x307c('0x2'));var Redis=require(_0x307c('0x3'));var config=require(_0x307c('0x4'));config[_0x307c('0x5')]=_[_0x307c('0x6')](config[_0x307c('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x307c('0x7'))(new Redis(config[_0x307c('0x5')]));function SmsQueue(_0x27515b){this['id']=_0x27515b['id']||0x0;this[_0x307c('0x8')]=_0x27515b[_0x307c('0x8')]||'';this[_0x307c('0x9')]=_0x27515b[_0x307c('0x9')]||0xa;this[_0x307c('0xa')]=_0x27515b[_0x307c('0xa')]||_0x307c('0xb');this[_0x307c('0xc')]=_0x27515b[_0x307c('0xc')];this[_0x307c('0xd')]={};this[_0x307c('0xe')]=0x0;this[_0x307c('0x1')]='';this['updateRouting']();this[_0x307c('0xf')]();}SmsQueue[_0x307c('0x10')][_0x307c('0x11')]=function(){var _0x2af63f=this['mapAgentsId']['_rr'];this[_0x307c('0xd')]=_['map'](this[_0x307c('0xc')],'id');this[_0x307c('0xd')]['_rr']=_0x2af63f;};SmsQueue[_0x307c('0x10')][_0x307c('0xf')]=function(){this[_0x307c('0x12')]=0x0;this[_0x307c('0x13')]=0x0;for(var _0x4193d8=0x0;_0x4193d8<this[_0x307c('0xc')][_0x307c('0x14')];_0x4193d8+=0x1){if(this[_0x307c('0xc')][_0x4193d8][_0x307c('0x15')]){this[_0x307c('0x12')]+=0x1;}if(this[_0x307c('0xc')][_0x4193d8][_0x307c('0x16')]){this['paused']+=0x1;}}this[_0x307c('0x17')]=this[_0x307c('0x12')]-this[_0x307c('0x13')];this[_0x307c('0x17')]=this[_0x307c('0x17')]>=0x0?this[_0x307c('0x17')]:0x0;var _0x3e05e2={'id':this['id'],'available':this[_0x307c('0x17')],'loggedIn':this[_0x307c('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x307c('0xe')]};var _0x4aa3c8=md5(JSON[_0x307c('0x18')](_0x3e05e2));if(this['md5']!==_0x4aa3c8){this['md5']=_0x4aa3c8;io['to'](util[_0x307c('0x19')](_0x307c('0x1a'),_0x3e05e2['name']))[_0x307c('0x1b')](_0x307c('0x1c'),_0x3e05e2);}};module['exports']=SmsQueue;
\ No newline at end of file
index d1ae2a9..0a7af31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb930=['length','online','whatsappPause','available','paused','format','emit','whatsapp_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn'];(function(_0x591104,_0x5a2cae){var _0x430243=function(_0x11d803){while(--_0x11d803){_0x591104['push'](_0x591104['shift']());}};_0x430243(++_0x5a2cae);}(_0xb930,0x158));var _0x0b93=function(_0x385e48,_0x2c2bd8){_0x385e48=_0x385e48-0x0;var _0x113747=_0xb930[_0x385e48];return _0x113747;};'use strict';var _=require(_0x0b93('0x0'));var md5=require(_0x0b93('0x1'));var util=require(_0x0b93('0x2'));var Redis=require('ioredis');var config=require(_0x0b93('0x3'));config[_0x0b93('0x4')]=_[_0x0b93('0x5')](config[_0x0b93('0x4')],{'host':_0x0b93('0x6'),'port':0x18eb});var io=require(_0x0b93('0x7'))(new Redis(config[_0x0b93('0x4')]));function WhatsappQueue(_0x4c27f8){this['id']=_0x4c27f8['id']||0x0;this[_0x0b93('0x8')]=_0x4c27f8[_0x0b93('0x8')]||'';this['timeout']=_0x4c27f8['timeout']||0xa;this[_0x0b93('0x9')]=_0x4c27f8[_0x0b93('0x9')]||_0x0b93('0xa');this['Agents']=_0x4c27f8['Agents'];this[_0x0b93('0xb')]={};this[_0x0b93('0xc')]=0x0;this[_0x0b93('0x1')]='';this[_0x0b93('0xd')]();this[_0x0b93('0xe')]();}WhatsappQueue[_0x0b93('0xf')][_0x0b93('0xd')]=function(){var _0x363b43=this['mapAgentsId']['_rr'];this[_0x0b93('0xb')]=_[_0x0b93('0x10')](this[_0x0b93('0x11')],'id');this['mapAgentsId'][_0x0b93('0x12')]=_0x363b43;};WhatsappQueue[_0x0b93('0xf')][_0x0b93('0xe')]=function(){this[_0x0b93('0x13')]=0x0;this['paused']=0x0;for(var _0x1a4395=0x0;_0x1a4395<this['Agents'][_0x0b93('0x14')];_0x1a4395+=0x1){if(this[_0x0b93('0x11')][_0x1a4395][_0x0b93('0x15')]){this[_0x0b93('0x13')]+=0x1;}if(this['Agents'][_0x1a4395][_0x0b93('0x16')]){this['paused']+=0x1;}}this[_0x0b93('0x17')]=this[_0x0b93('0x13')]-this[_0x0b93('0x18')];this['available']=this['available']>=0x0?this['available']:0x0;var _0x1578d8={'id':this['id'],'available':this[_0x0b93('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x0b93('0x8')],'paused':this[_0x0b93('0x18')],'waiting':this[_0x0b93('0xc')]};var _0x2b7e47=md5(JSON['stringify'](_0x1578d8));if(this[_0x0b93('0x1')]!==_0x2b7e47){this[_0x0b93('0x1')]=_0x2b7e47;io['to'](util[_0x0b93('0x19')]('whatsapp:queue:%s',_0x1578d8[_0x0b93('0x8')]))[_0x0b93('0x1a')](_0x0b93('0x1b'),_0x1578d8);}};module['exports']=WhatsappQueue;
\ No newline at end of file
+var _0x1f73=['redis','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','paused','Agents','length','whatsappPause','available','format','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x69fbf8,_0x1ae0ab){var _0x670a8d=function(_0xbef3ec){while(--_0xbef3ec){_0x69fbf8['push'](_0x69fbf8['shift']());}};_0x670a8d(++_0x1ae0ab);}(_0x1f73,0x1e9));var _0x31f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1f73[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x31f7('0x0'));var md5=require(_0x31f7('0x1'));var util=require(_0x31f7('0x2'));var Redis=require(_0x31f7('0x3'));var config=require(_0x31f7('0x4'));config[_0x31f7('0x5')]=_['defaults'](config[_0x31f7('0x5')],{'host':_0x31f7('0x6'),'port':0x18eb});var io=require(_0x31f7('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x89d4da){this['id']=_0x89d4da['id']||0x0;this[_0x31f7('0x8')]=_0x89d4da[_0x31f7('0x8')]||'';this[_0x31f7('0x9')]=_0x89d4da[_0x31f7('0x9')]||0xa;this[_0x31f7('0xa')]=_0x89d4da[_0x31f7('0xa')]||'beepall';this['Agents']=_0x89d4da['Agents'];this[_0x31f7('0xb')]={};this[_0x31f7('0xc')]=0x0;this[_0x31f7('0x1')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x31f7('0xd')][_0x31f7('0xe')]=function(){var _0x31bf5f=this[_0x31f7('0xb')][_0x31f7('0xf')];this[_0x31f7('0xb')]=_[_0x31f7('0x10')](this['Agents'],'id');this[_0x31f7('0xb')][_0x31f7('0xf')]=_0x31bf5f;};WhatsappQueue[_0x31f7('0xd')][_0x31f7('0x11')]=function(){this[_0x31f7('0x12')]=0x0;this[_0x31f7('0x13')]=0x0;for(var _0x2e5ffc=0x0;_0x2e5ffc<this[_0x31f7('0x14')][_0x31f7('0x15')];_0x2e5ffc+=0x1){if(this[_0x31f7('0x14')][_0x2e5ffc]['online']){this[_0x31f7('0x12')]+=0x1;}if(this[_0x31f7('0x14')][_0x2e5ffc][_0x31f7('0x16')]){this[_0x31f7('0x13')]+=0x1;}}this[_0x31f7('0x17')]=this['loggedIn']-this[_0x31f7('0x13')];this[_0x31f7('0x17')]=this['available']>=0x0?this['available']:0x0;var _0xc826ba={'id':this['id'],'available':this['available'],'loggedIn':this[_0x31f7('0x12')],'name':this[_0x31f7('0x8')],'paused':this[_0x31f7('0x13')],'waiting':this[_0x31f7('0xc')]};var _0x4ef540=md5(JSON['stringify'](_0xc826ba));if(this[_0x31f7('0x1')]!==_0x4ef540){this[_0x31f7('0x1')]=_0x4ef540;io['to'](util[_0x31f7('0x18')]('whatsapp:queue:%s',_0xc826ba[_0x31f7('0x8')]))['emit'](_0x31f7('0x19'),_0xc826ba);}};module['exports']=WhatsappQueue;
\ No newline at end of file
index 6ab8163..1f3b6a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
index 49044d1..57d6799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6431=['update','updateChatInteraction','Request','AddTagsToChatInteraction'];(function(_0x450f09,_0x59561d){var _0x4e22ec=function(_0x516748){while(--_0x516748){_0x450f09['push'](_0x450f09['shift']());}};_0x4e22ec(++_0x59561d);}(_0x6431,0xf8));var _0x1643=function(_0x4dab58,_0x78bb16){_0x4dab58=_0x4dab58-0x0;var _0x552cec=_0x6431[_0x4dab58];return _0x552cec;};'use strict';var client=require('../client');exports[_0x1643('0x0')]=function(_0x50afdb,_0x42fc70){return client['Request']('UpdateChatInteraction',{'body':_0x42fc70,'options':{'where':{'id':_0x50afdb}},'log':_0x1643('0x1')});};exports['addTags']=function(_0x18367d,_0x4dacc2){return client[_0x1643('0x2')](_0x1643('0x3'),{'body':_0x4dacc2,'options':{'where':{'id':_0x18367d}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0xe79c=['Request','UpdateChatInteraction','addTagsToChatInteraction','update'];(function(_0x2e9876,_0x18a186){var _0x23e723=function(_0x48fa60){while(--_0x48fa60){_0x2e9876['push'](_0x2e9876['shift']());}};_0x23e723(++_0x18a186);}(_0xe79c,0x1ef));var _0xce79=function(_0x3ac403,_0x5e69d9){_0x3ac403=_0x3ac403-0x0;var _0x41f0e8=_0xe79c[_0x3ac403];return _0x41f0e8;};'use strict';var client=require('../client');exports[_0xce79('0x0')]=function(_0x38d862,_0x6cd876){return client[_0xce79('0x1')](_0xce79('0x2'),{'body':_0x6cd876,'options':{'where':{'id':_0x38d862}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x569fdd,_0x1e8841){return client[_0xce79('0x1')]('AddTagsToChatInteraction',{'body':_0x1e8841,'options':{'where':{'id':_0x569fdd}},'log':_0xce79('0x3')});};
\ No newline at end of file
index 8bd70d0..038019d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6853=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0xffa65c,_0x3aa2f3){var _0x2157ad=function(_0x2f348d){while(--_0x2f348d){_0xffa65c['push'](_0xffa65c['shift']());}};_0x2157ad(++_0x3aa2f3);}(_0x6853,0x12b));var _0x3685=function(_0x49df6e,_0x3056f2){_0x49df6e=_0x49df6e-0x0;var _0x42b3aa=_0x6853[_0x49df6e];return _0x42b3aa;};'use strict';var client=require(_0x3685('0x0'));exports[_0x3685('0x1')]=function(_0x4a9bc8){return client[_0x3685('0x2')](_0x3685('0x3'),{'body':_0x4a9bc8,'log':_0x3685('0x4')});};
\ No newline at end of file
+var _0xf8b1=['../client','create','CreateChatMessage','createChatMessage'];(function(_0x1d930e,_0x20d8b8){var _0x5bbd66=function(_0x3c7488){while(--_0x3c7488){_0x1d930e['push'](_0x1d930e['shift']());}};_0x5bbd66(++_0x20d8b8);}(_0xf8b1,0x12c));var _0x1f8b=function(_0x53800e,_0x1ade43){_0x53800e=_0x53800e-0x0;var _0x449d7a=_0xf8b1[_0x53800e];return _0x449d7a;};'use strict';var client=require(_0x1f8b('0x0'));exports[_0x1f8b('0x1')]=function(_0x58950e){return client['Request'](_0x1f8b('0x2'),{'body':_0x58950e,'log':_0x1f8b('0x3')});};
\ No newline at end of file
index 572ff18..8ea71a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3148=['getChatQueues','GetChatQueue','name','timeout','strategy','Agents','online','chatPause','../client'];(function(_0x2709df,_0x12b272){var _0x2e0ca5=function(_0x18fe8b){while(--_0x18fe8b){_0x2709df['push'](_0x2709df['shift']());}};_0x2e0ca5(++_0x12b272);}(_0x3148,0x1d3));var _0x8314=function(_0x3b9c74,_0x3feb38){_0x3b9c74=_0x3b9c74-0x0;var _0x10f564=_0x3148[_0x3b9c74];return _0x10f564;};'use strict';var client=require(_0x8314('0x0'));exports[_0x8314('0x1')]=function(){return function(){return client['Request'](_0x8314('0x2'),{'options':{'raw':![],'attributes':['id',_0x8314('0x3'),_0x8314('0x4'),_0x8314('0x5')],'include':[{'model':'User','as':_0x8314('0x6'),'attributes':['id',_0x8314('0x3'),_0x8314('0x7'),_0x8314('0x8')]}]},'log':_0x8314('0x1')});};};
\ No newline at end of file
+var _0x374c=['getChatQueues','Request','GetChatQueue','name','timeout','User','online'];(function(_0x386306,_0x1363c9){var _0xcb23d=function(_0x1fc525){while(--_0x1fc525){_0x386306['push'](_0x386306['shift']());}};_0xcb23d(++_0x1363c9);}(_0x374c,0x1e3));var _0xc374=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x374c[_0x341e0f];return _0x59555a;};'use strict';var client=require('../client');exports[_0xc374('0x0')]=function(){return function(){return client[_0xc374('0x1')](_0xc374('0x2'),{'options':{'raw':![],'attributes':['id',_0xc374('0x3'),_0xc374('0x4'),'strategy'],'include':[{'model':_0xc374('0x5'),'as':'Agents','attributes':['id',_0xc374('0x3'),_0xc374('0x6'),'chatPause']}]},'log':_0xc374('0x0')});};};
\ No newline at end of file
index b50e845..7eb1616 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5712=['update','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x54daf5,_0x528643){var _0xf70158=function(_0x4902d6){while(--_0x4902d6){_0x54daf5['push'](_0x54daf5['shift']());}};_0xf70158(++_0x528643);}(_0x5712,0x140));var _0x2571=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5712[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x2571('0x0'));exports[_0x2571('0x1')]=function(_0x247ab0){return client[_0x2571('0x2')](_0x2571('0x3'),{'body':_0x247ab0,'log':_0x2571('0x3')});};exports[_0x2571('0x4')]=function(_0x1b044e,_0x102dd6){return client[_0x2571('0x2')]('UpdateChatQueueReport',{'body':_0x102dd6,'options':{'where':{'uniqueid':_0x1b044e},'order':[['id','DESC']],'limit':0x1},'log':_0x2571('0x5')});};
\ No newline at end of file
+var _0x3657=['UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport','update','Request'];(function(_0x115ac7,_0x39bc68){var _0x32f711=function(_0x221cf0){while(--_0x221cf0){_0x115ac7['push'](_0x115ac7['shift']());}};_0x32f711(++_0x39bc68);}(_0x3657,0x183));var _0x7365=function(_0x438e18,_0x52e2c5){_0x438e18=_0x438e18-0x0;var _0x50c6ea=_0x3657[_0x438e18];return _0x50c6ea;};'use strict';var client=require(_0x7365('0x0'));exports[_0x7365('0x1')]=function(_0x363ec1){return client['Request'](_0x7365('0x2'),{'body':_0x363ec1,'log':_0x7365('0x2')});};exports[_0x7365('0x3')]=function(_0x27a6f1,_0x551019){return client[_0x7365('0x4')](_0x7365('0x5'),{'body':_0x551019,'options':{'where':{'uniqueid':_0x27a6f1},'order':[['id',_0x7365('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
index 77a3ed7..5429225 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3ba39c,_0x2b71ec){var _0x32a3a8=function(_0x328cf7){while(--_0x328cf7){_0x3ba39c['push'](_0x3ba39c['shift']());}};_0x32a3a8(++_0x2b71ec);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3e4f00,_0x2c3955){var _0x54472c=function(_0x18a570){while(--_0x18a570){_0x3e4f00['push'](_0x3e4f00['shift']());}};_0x54472c(++_0x2c3955);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index 9fb2dce..503da4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d35=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x515e2b,_0xb4a2b5){var _0xc74bef=function(_0x43d02b){while(--_0x43d02b){_0x515e2b['push'](_0x515e2b['shift']());}};_0xc74bef(++_0xb4a2b5);}(_0x4d35,0x1d3));var _0x54d3=function(_0x1121df,_0x35a8b6){_0x1121df=_0x1121df-0x0;var _0x461216=_0x4d35[_0x1121df];return _0x461216;};'use strict';var client=require(_0x54d3('0x0'));exports[_0x54d3('0x1')]=function(_0x55a73e){return client[_0x54d3('0x2')](_0x54d3('0x3'),{'body':_0x55a73e,'log':_0x54d3('0x4')});};
\ No newline at end of file
+var _0x3eda=['Request','../client','create'];(function(_0x15d9bc,_0x513b46){var _0x5868fe=function(_0x1696d0){while(--_0x1696d0){_0x15d9bc['push'](_0x15d9bc['shift']());}};_0x5868fe(++_0x513b46);}(_0x3eda,0xb2));var _0xa3ed=function(_0x53f82d,_0x117b0c){_0x53f82d=_0x53f82d-0x0;var _0xf15d57=_0x3eda[_0x53f82d];return _0xf15d57;};'use strict';var client=require(_0xa3ed('0x0'));exports[_0xa3ed('0x1')]=function(_0x5257c2){return client[_0xa3ed('0x2')]('CreateFaxMessage',{'body':_0x5257c2,'log':'createFaxMessage'});};
\ No newline at end of file
index cdf0814..490ceae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d2=['name','timeout','strategy','online','../client','getFaxQueues','GetFaxQueue'];(function(_0x30ab5b,_0x13fb3c){var _0x5ccd15=function(_0x1c59d6){while(--_0x1c59d6){_0x30ab5b['push'](_0x30ab5b['shift']());}};_0x5ccd15(++_0x13fb3c);}(_0xd1d2,0x1ee));var _0x2d1d=function(_0x3855fd,_0x26003f){_0x3855fd=_0x3855fd-0x0;var _0x226a53=_0xd1d2[_0x3855fd];return _0x226a53;};'use strict';var client=require(_0x2d1d('0x0'));exports[_0x2d1d('0x1')]=function(){return function(){return client['Request'](_0x2d1d('0x2'),{'options':{'raw':![],'attributes':['id',_0x2d1d('0x3'),_0x2d1d('0x4'),_0x2d1d('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x2d1d('0x3'),_0x2d1d('0x6'),'faxPause']}]},'log':_0x2d1d('0x1')});};};
\ No newline at end of file
+var _0x309e=['name','strategy','User','Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x309e,0xde));var _0xe309=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x309e[_0x4b055c];return _0x4b62bb;};'use strict';var client=require(_0xe309('0x0'));exports[_0xe309('0x1')]=function(){return function(){return client['Request'](_0xe309('0x2'),{'options':{'raw':![],'attributes':['id',_0xe309('0x3'),'timeout',_0xe309('0x4')],'include':[{'model':_0xe309('0x5'),'as':_0xe309('0x6'),'attributes':['id','name',_0xe309('0x7'),_0xe309('0x8')]}]},'log':_0xe309('0x1')});};};
\ No newline at end of file
index 6abb1f0..7d1a7b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x923f=['UpdateFaxQueueReport','DESC','Request','CreateFaxQueueReport','update'];(function(_0x5719d2,_0x329d96){var _0x460ce2=function(_0x2b13d8){while(--_0x2b13d8){_0x5719d2['push'](_0x5719d2['shift']());}};_0x460ce2(++_0x329d96);}(_0x923f,0xfc));var _0xf923=function(_0x38d3c2,_0x35fe27){_0x38d3c2=_0x38d3c2-0x0;var _0x5f3d8c=_0x923f[_0x38d3c2];return _0x5f3d8c;};'use strict';var client=require('../client');exports['create']=function(_0x4fc633){return client[_0xf923('0x0')](_0xf923('0x1'),{'body':_0x4fc633,'log':_0xf923('0x1')});};exports[_0xf923('0x2')]=function(_0x2f659b,_0x32fac7){return client[_0xf923('0x0')](_0xf923('0x3'),{'body':_0x32fac7,'options':{'where':{'uniqueid':_0x2f659b},'order':[['id',_0xf923('0x4')]],'limit':0x1},'log':_0xf923('0x3')});};
\ No newline at end of file
+var _0xe432=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x2b0074,_0x42d50b){var _0x25b012=function(_0x53d3b9){while(--_0x53d3b9){_0x2b0074['push'](_0x2b0074['shift']());}};_0x25b012(++_0x42d50b);}(_0xe432,0xb5));var _0x2e43=function(_0x1091a8,_0x2dc938){_0x1091a8=_0x1091a8-0x0;var _0x4c08a2=_0xe432[_0x1091a8];return _0x4c08a2;};'use strict';var client=require(_0x2e43('0x0'));exports[_0x2e43('0x1')]=function(_0x5c390b){return client[_0x2e43('0x2')](_0x2e43('0x3'),{'body':_0x5c390b,'log':_0x2e43('0x3')});};exports[_0x2e43('0x4')]=function(_0x1c1c3f,_0x5625d7){return client[_0x2e43('0x2')]('UpdateFaxQueueReport',{'body':_0x5625d7,'options':{'where':{'uniqueid':_0x1c1c3f},'order':[['id','DESC']],'limit':0x1},'log':_0x2e43('0x5')});};
\ No newline at end of file
index e837303..3dea4f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf983=['GetInterval','Interval','name','interval','getIntervals','../client','Request'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xf983,0xc2));var _0x3f98=function(_0x43576f,_0x1356ed){_0x43576f=_0x43576f-0x0;var _0x4d2466=_0xf983[_0x43576f];return _0x4d2466;};'use strict';var client=require(_0x3f98('0x0'));exports['getIntervals']=function(){return function(){return client[_0x3f98('0x1')](_0x3f98('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x3f98('0x3'),'as':'Intervals','attributes':['id',_0x3f98('0x4'),_0x3f98('0x5')]}]},'log':_0x3f98('0x6')});};};
\ No newline at end of file
+var _0x5051=['Intervals','../client','getIntervals','Request','GetInterval','name'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x5051,0xa3));var _0x1505=function(_0x194f2d,_0x4f2a27){_0x194f2d=_0x194f2d-0x0;var _0x3bb1bd=_0x5051[_0x194f2d];return _0x3bb1bd;};'use strict';var client=require(_0x1505('0x0'));exports[_0x1505('0x1')]=function(){return function(){return client[_0x1505('0x2')](_0x1505('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1505('0x4')],'include':[{'model':'Interval','as':_0x1505('0x5'),'attributes':['id',_0x1505('0x4'),'interval']}]},'log':_0x1505('0x1')});};};
\ No newline at end of file
index 6a894fe..ab43cdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5430=['Request','UpdateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5430,0x10c));var _0x0543=function(_0x326b47,_0x1c5af5){_0x326b47=_0x326b47-0x0;var _0x31d20a=_0x5430[_0x326b47];return _0x31d20a;};'use strict';var client=require(_0x0543('0x0'));exports[_0x0543('0x1')]=function(_0xa1b1a7,_0x4078bf){return client[_0x0543('0x2')](_0x0543('0x3'),{'body':_0x4078bf,'options':{'where':{'id':_0xa1b1a7}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x1c5ab7,_0x4ee416){return client['Request'](_0x0543('0x4'),{'body':_0x4ee416,'options':{'where':{'id':_0x1c5ab7}},'log':_0x0543('0x5')});};
\ No newline at end of file
+var _0xb44a=['AddTagsToMailInteraction','addTagsToChatInteraction','Request','addTags'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xb44a,0x1c2));var _0xab44=function(_0x4370c7,_0x5dbfb0){_0x4370c7=_0x4370c7-0x0;var _0xce78a9=_0xb44a[_0x4370c7];return _0xce78a9;};'use strict';var client=require('../client');exports['update']=function(_0x93bb2f,_0x492c1a){return client[_0xab44('0x0')]('UpdateMailInteraction',{'body':_0x492c1a,'options':{'where':{'id':_0x93bb2f}},'log':'updateMailInteraction'});};exports[_0xab44('0x1')]=function(_0x5c93b4,_0x1b9e05){return client[_0xab44('0x0')](_0xab44('0x2'),{'body':_0x1b9e05,'options':{'where':{'id':_0x5c93b4}},'log':_0xab44('0x3')});};
\ No newline at end of file
index 9ced86b..693a7d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef06=['Request','CreateMailMessage','createMailMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef06,0xb7));var _0x6ef0=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0xef06[_0x40927b];return _0x2635e8;};'use strict';var client=require('../client');exports[_0x6ef0('0x0')]=function(_0x446907){return client[_0x6ef0('0x1')](_0x6ef0('0x2'),{'body':_0x446907,'log':_0x6ef0('0x3')});};
\ No newline at end of file
+var _0x0cd3=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x514299,_0x44a553){var _0x453188=function(_0x518bc4){while(--_0x518bc4){_0x514299['push'](_0x514299['shift']());}};_0x453188(++_0x44a553);}(_0x0cd3,0x165));var _0x30cd=function(_0x1817c0,_0x469ba7){_0x1817c0=_0x1817c0-0x0;var _0x411ace=_0x0cd3[_0x1817c0];return _0x411ace;};'use strict';var client=require(_0x30cd('0x0'));exports[_0x30cd('0x1')]=function(_0x401c75){return client[_0x30cd('0x2')](_0x30cd('0x3'),{'body':_0x401c75,'log':_0x30cd('0x4')});};
\ No newline at end of file
index f77882e..07192c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc076=['../client','Request','GetMailQueue','name','timeout','strategy','User','Agents','mailPause'];(function(_0x28f399,_0x505781){var _0x55fcf2=function(_0x2d27fa){while(--_0x2d27fa){_0x28f399['push'](_0x28f399['shift']());}};_0x55fcf2(++_0x505781);}(_0xc076,0x120));var _0x6c07=function(_0x4de177,_0x29df8a){_0x4de177=_0x4de177-0x0;var _0x3e4052=_0xc076[_0x4de177];return _0x3e4052;};'use strict';var client=require(_0x6c07('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x6c07('0x1')](_0x6c07('0x2'),{'options':{'raw':![],'attributes':['id',_0x6c07('0x3'),_0x6c07('0x4'),_0x6c07('0x5')],'include':[{'model':_0x6c07('0x6'),'as':_0x6c07('0x7'),'attributes':['id','name','online',_0x6c07('0x8')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0x92b3=['name','timeout','strategy','User','Agents','online','mailPause','getMailQueues','../client','Request'];(function(_0xe502ca,_0x1cc7cc){var _0x514270=function(_0x320cc9){while(--_0x320cc9){_0xe502ca['push'](_0xe502ca['shift']());}};_0x514270(++_0x1cc7cc);}(_0x92b3,0xa8));var _0x392b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x92b3[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x392b('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x392b('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x392b('0x2'),_0x392b('0x3'),_0x392b('0x4')],'include':[{'model':_0x392b('0x5'),'as':_0x392b('0x6'),'attributes':['id','name',_0x392b('0x7'),_0x392b('0x8')]}]},'log':_0x392b('0x9')});};};
\ No newline at end of file
index b6e289b..95ea3ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04cd=['create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x04cd,0x91));var _0xd04c=function(_0x343f05,_0x202282){_0x343f05=_0x343f05-0x0;var _0x3d975c=_0x04cd[_0x343f05];return _0x3d975c;};'use strict';var client=require('../client');exports[_0xd04c('0x0')]=function(_0x58457c){return client[_0xd04c('0x1')](_0xd04c('0x2'),{'body':_0x58457c,'log':_0xd04c('0x2')});};exports['update']=function(_0x21f620,_0x1566d0){return client[_0xd04c('0x1')](_0xd04c('0x3'),{'body':_0x1566d0,'options':{'where':{'uniqueid':_0x21f620},'order':[['id',_0xd04c('0x4')]],'limit':0x1},'log':_0xd04c('0x3')});};
\ No newline at end of file
+var _0x23cb=['../client','CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC'];(function(_0x417955,_0x4ed8c8){var _0x3a94ef=function(_0xa3a38d){while(--_0xa3a38d){_0x417955['push'](_0x417955['shift']());}};_0x3a94ef(++_0x4ed8c8);}(_0x23cb,0x15c));var _0xb23c=function(_0x3c5b20,_0x4b0336){_0x3c5b20=_0x3c5b20-0x0;var _0x217352=_0x23cb[_0x3c5b20];return _0x217352;};'use strict';var client=require(_0xb23c('0x0'));exports['create']=function(_0x55f55c){return client['Request'](_0xb23c('0x1'),{'body':_0x55f55c,'log':'CreateMailQueueReport'});};exports[_0xb23c('0x2')]=function(_0x359e12,_0x594f66){return client[_0xb23c('0x3')](_0xb23c('0x4'),{'body':_0x594f66,'options':{'where':{'uniqueid':_0x359e12},'order':[['id',_0xb23c('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
index 15fdbfd..bbab130 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','Request','addTagsToChatInteraction'];(function(_0x569148,_0x118d6e){var _0x40505a=function(_0x5bd5c9){while(--_0x5bd5c9){_0x569148['push'](_0x569148['shift']());}};_0x40505a(++_0x118d6e);}(_0x7880,0xf8));var _0x0788=function(_0x5edb22,_0x136394){_0x5edb22=_0x5edb22-0x0;var _0x3f9dba=_0x7880[_0x5edb22];return _0x3f9dba;};'use strict';var client=require('../client');exports['update']=function(_0x14fb58,_0x301d2e){return client['Request'](_0x0788('0x0'),{'body':_0x301d2e,'options':{'where':{'id':_0x14fb58}},'log':_0x0788('0x1')});};exports['addTags']=function(_0x133026,_0x4d9026){return client[_0x0788('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x4d9026,'options':{'where':{'id':_0x133026}},'log':_0x0788('0x3')});};
\ No newline at end of file
+var _0x7b0d=['updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x65747e,_0x1ea320){var _0xa8a17d=function(_0x305419){while(--_0x305419){_0x65747e['push'](_0x65747e['shift']());}};_0xa8a17d(++_0x1ea320);}(_0x7b0d,0x1b0));var _0xd7b0=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7b0d[_0x138f59];return _0x3d114d;};'use strict';var client=require(_0xd7b0('0x0'));exports[_0xd7b0('0x1')]=function(_0x3ae4b0,_0x749143){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x749143,'options':{'where':{'id':_0x3ae4b0}},'log':_0xd7b0('0x2')});};exports[_0xd7b0('0x3')]=function(_0x4418bf,_0x58a6b3){return client[_0xd7b0('0x4')](_0xd7b0('0x5'),{'body':_0x58a6b3,'options':{'where':{'id':_0x4418bf}},'log':_0xd7b0('0x6')});};
\ No newline at end of file
index b3ad08d..a07a985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ae7=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x440dac,_0x5e93a7){var _0x395c76=function(_0x128712){while(--_0x128712){_0x440dac['push'](_0x440dac['shift']());}};_0x395c76(++_0x5e93a7);}(_0x7ae7,0xe0));var _0x77ae=function(_0x589656,_0x1b87ca){_0x589656=_0x589656-0x0;var _0x5e3e8d=_0x7ae7[_0x589656];return _0x5e3e8d;};'use strict';var client=require(_0x77ae('0x0'));exports[_0x77ae('0x1')]=function(_0x59c67a){return client[_0x77ae('0x2')](_0x77ae('0x3'),{'body':_0x59c67a,'log':_0x77ae('0x4')});};
\ No newline at end of file
+var _0x8531=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5ea783,_0x204eb8){var _0x5e6758=function(_0x5a3dc0){while(--_0x5a3dc0){_0x5ea783['push'](_0x5ea783['shift']());}};_0x5e6758(++_0x204eb8);}(_0x8531,0x1a8));var _0x1853=function(_0x366e51,_0x3a0178){_0x366e51=_0x366e51-0x0;var _0x4e23e3=_0x8531[_0x366e51];return _0x4e23e3;};'use strict';var client=require(_0x1853('0x0'));exports[_0x1853('0x1')]=function(_0xc25e9){return client[_0x1853('0x2')](_0x1853('0x3'),{'body':_0xc25e9,'log':_0x1853('0x4')});};
\ No newline at end of file
index d4488f0..6e79913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50f0=['../client','getOpenchannelQueues','GetOpenchannelQueue','name','timeout','strategy','User','Agents','openchannelPause'];(function(_0x1ff3cc,_0x114bec){var _0x104317=function(_0x33fa4e){while(--_0x33fa4e){_0x1ff3cc['push'](_0x1ff3cc['shift']());}};_0x104317(++_0x114bec);}(_0x50f0,0x1cb));var _0x050f=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x50f0[_0x1283d4];return _0x433643;};'use strict';var client=require(_0x050f('0x0'));exports[_0x050f('0x1')]=function(){return function(){return client['Request'](_0x050f('0x2'),{'options':{'raw':![],'attributes':['id',_0x050f('0x3'),_0x050f('0x4'),_0x050f('0x5')],'include':[{'model':_0x050f('0x6'),'as':_0x050f('0x7'),'attributes':['id',_0x050f('0x3'),'online',_0x050f('0x8')]}]},'log':_0x050f('0x1')});};};
\ No newline at end of file
+var _0xc0dc=['Request','GetOpenchannelQueue','name','strategy','Agents','online','../client','getOpenchannelQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0dc,0xf6));var _0xcc0d=function(_0x9c7848,_0xd5a94d){_0x9c7848=_0x9c7848-0x0;var _0x436a53=_0xc0dc[_0x9c7848];return _0x436a53;};'use strict';var client=require(_0xcc0d('0x0'));exports[_0xcc0d('0x1')]=function(){return function(){return client[_0xcc0d('0x2')](_0xcc0d('0x3'),{'options':{'raw':![],'attributes':['id',_0xcc0d('0x4'),'timeout',_0xcc0d('0x5')],'include':[{'model':'User','as':_0xcc0d('0x6'),'attributes':['id',_0xcc0d('0x4'),_0xcc0d('0x7'),'openchannelPause']}]},'log':_0xcc0d('0x1')});};};
\ No newline at end of file
index 91c62b9..a87e4b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb1e=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x3749b4,_0x535b89){var _0x5790cf=function(_0x9885c9){while(--_0x9885c9){_0x3749b4['push'](_0x3749b4['shift']());}};_0x5790cf(++_0x535b89);}(_0xbb1e,0x1bd));var _0xebb1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbb1e[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require('../client');exports[_0xebb1('0x0')]=function(_0x36ee21){return client[_0xebb1('0x1')]('CreateOpenchannelQueueReport',{'body':_0x36ee21,'log':_0xebb1('0x2')});};exports[_0xebb1('0x3')]=function(_0x13490a,_0x414a02){return client[_0xebb1('0x1')](_0xebb1('0x4'),{'body':_0x414a02,'options':{'where':{'uniqueid':_0x13490a},'order':[['id',_0xebb1('0x5')]],'limit':0x1},'log':_0xebb1('0x4')});};
\ No newline at end of file
+var _0x91a4=['update','UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x91a4,0x11c));var _0x491a=function(_0x2fa2b0,_0x2f2ac0){_0x2fa2b0=_0x2fa2b0-0x0;var _0x233974=_0x91a4[_0x2fa2b0];return _0x233974;};'use strict';var client=require(_0x491a('0x0'));exports[_0x491a('0x1')]=function(_0x295805){return client[_0x491a('0x2')](_0x491a('0x3'),{'body':_0x295805,'log':_0x491a('0x3')});};exports[_0x491a('0x4')]=function(_0xf09a5f,_0x142f32){return client[_0x491a('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x142f32,'options':{'where':{'uniqueid':_0xf09a5f},'order':[['id','DESC']],'limit':0x1},'log':_0x491a('0x5')});};
\ No newline at end of file
index 1652d49..e6394c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x581a=['addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x581a,0x127));var _0xa581=function(_0x11e01c,_0x573575){_0x11e01c=_0x11e01c-0x0;var _0x23ec50=_0x581a[_0x11e01c];return _0x23ec50;};'use strict';var client=require(_0xa581('0x0'));exports[_0xa581('0x1')]=function(_0x5795e7,_0x3fc8f8){return client[_0xa581('0x2')](_0xa581('0x3'),{'body':_0x3fc8f8,'options':{'where':{'id':_0x5795e7}},'log':_0xa581('0x4')});};exports[_0xa581('0x5')]=function(_0x4e64cc,_0x4e65d7){return client[_0xa581('0x2')]('AddTagsToSmsInteraction',{'body':_0x4e65d7,'options':{'where':{'id':_0x4e64cc}},'log':_0xa581('0x6')});};
\ No newline at end of file
+var _0x4677=['Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4677,0x155));var _0x7467=function(_0x413a56,_0x45488b){_0x413a56=_0x413a56-0x0;var _0x2f4d3e=_0x4677[_0x413a56];return _0x2f4d3e;};'use strict';var client=require(_0x7467('0x0'));exports['update']=function(_0x349b3c,_0x2ea452){return client[_0x7467('0x1')]('UpdateSmsInteraction',{'body':_0x2ea452,'options':{'where':{'id':_0x349b3c}},'log':_0x7467('0x2')});};exports[_0x7467('0x3')]=function(_0x22a57e,_0xe227ce){return client[_0x7467('0x1')](_0x7467('0x4'),{'body':_0xe227ce,'options':{'where':{'id':_0x22a57e}},'log':_0x7467('0x5')});};
\ No newline at end of file
index 8d24053..a7868cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5106=['CreateSmsMessage','../client','create'];(function(_0x43328c,_0x1c3b1f){var _0x5448e8=function(_0x47e9ec){while(--_0x47e9ec){_0x43328c['push'](_0x43328c['shift']());}};_0x5448e8(++_0x1c3b1f);}(_0x5106,0xc7));var _0x6510=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5106[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x6510('0x0'));exports[_0x6510('0x1')]=function(_0x5f2159){return client['Request'](_0x6510('0x2'),{'body':_0x5f2159,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0x998b=['CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x163428,_0x17bcf5){var _0xa88008=function(_0x285dc4){while(--_0x285dc4){_0x163428['push'](_0x163428['shift']());}};_0xa88008(++_0x17bcf5);}(_0x998b,0x1b2));var _0xb998=function(_0x27af5b,_0x3646b2){_0x27af5b=_0x27af5b-0x0;var _0x5cc545=_0x998b[_0x27af5b];return _0x5cc545;};'use strict';var client=require(_0xb998('0x0'));exports[_0xb998('0x1')]=function(_0x3b0e8d){return client['Request'](_0xb998('0x2'),{'body':_0x3b0e8d,'log':_0xb998('0x3')});};
\ No newline at end of file
index 61c99d2..89cd660 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x19c167,_0x33a5bb){var _0x20ac22=function(_0x2aebe3){while(--_0x2aebe3){_0x19c167['push'](_0x19c167['shift']());}};_0x20ac22(++_0x33a5bb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x2c1ca5,_0x1b0af0){var _0x2adbe4=function(_0x1d88e3){while(--_0x1d88e3){_0x2c1ca5['push'](_0x2c1ca5['shift']());}};_0x2adbe4(++_0x1b0af0);}(_0x70e0,0x17b));var _0x070e=function(_0x1dcc5d,_0x1dafa6){_0x1dcc5d=_0x1dcc5d-0x0;var _0x52a458=_0x70e0[_0x1dcc5d];return _0x52a458;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};};
\ No newline at end of file
index deeb684..1193d61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x781a5e,_0x17273c){var _0x6896f2=function(_0x2bb94d){while(--_0x2bb94d){_0x781a5e['push'](_0x781a5e['shift']());}};_0x6896f2(++_0x17273c);}(_0x70e0,0x17b));var _0x070e=function(_0x3d2f04,_0x2af699){_0x3d2f04=_0x3d2f04-0x0;var _0x453593=_0x70e0[_0x3d2f04];return _0x453593;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});};
\ No newline at end of file
+var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x1cfe2e,_0x1ebbcd){var _0x39233f=function(_0x48831a){while(--_0x48831a){_0x1cfe2e['push'](_0x1cfe2e['shift']());}};_0x39233f(++_0x1ebbcd);}(_0xedd9,0xfc));var _0x9edd=function(_0x435b57,_0x46defc){_0x435b57=_0x435b57-0x0;var _0x2f02b5=_0xedd9[_0x435b57];return _0x2f02b5;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});};
\ No newline at end of file
index e56a259..bda316c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x3def55,_0x53ce57){var _0xf4cb7d=function(_0x4518e7){while(--_0x4518e7){_0x3def55['push'](_0x3def55['shift']());}};_0xf4cb7d(++_0x53ce57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
+var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0xa61e49,_0x2f2364){var _0x28a38e=function(_0x372693){while(--_0x372693){_0xa61e49['push'](_0xa61e49['shift']());}};_0x28a38e(++_0x2f2364);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
index 5855068..a38eff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x292c=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x23c0d2,_0x27dcc2){var _0x1846ad=function(_0x437145){while(--_0x437145){_0x23c0d2['push'](_0x23c0d2['shift']());}};_0x1846ad(++_0x27dcc2);}(_0x292c,0x66));var _0xc292=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0x292c[_0x27530d];return _0x59e561;};'use strict';var client=require(_0xc292('0x0'));exports['update']=function(_0x286dcb,_0x379366){return client[_0xc292('0x1')](_0xc292('0x2'),{'body':_0x379366,'options':{'where':{'id':_0x286dcb}},'log':_0xc292('0x3')});};exports['addTags']=function(_0x1f14f9,_0x536154){return client['Request'](_0xc292('0x4'),{'body':_0x536154,'options':{'where':{'id':_0x1f14f9}},'log':_0xc292('0x5')});};
\ No newline at end of file
+var _0x6657=['Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x53be66,_0x9ec3be){var _0x9e5520=function(_0x5c4742){while(--_0x5c4742){_0x53be66['push'](_0x53be66['shift']());}};_0x9e5520(++_0x9ec3be);}(_0x6657,0x17f));var _0x7665=function(_0x53b4dc,_0x51f549){_0x53b4dc=_0x53b4dc-0x0;var _0x3b2b68=_0x6657[_0x53b4dc];return _0x3b2b68;};'use strict';var client=require(_0x7665('0x0'));exports['update']=function(_0x1b588b,_0x43c954){return client[_0x7665('0x1')](_0x7665('0x2'),{'body':_0x43c954,'options':{'where':{'id':_0x1b588b}},'log':'updateWhatsappInteraction'});};exports[_0x7665('0x3')]=function(_0x2ed8cb,_0x26acc4){return client[_0x7665('0x1')](_0x7665('0x4'),{'body':_0x26acc4,'options':{'where':{'id':_0x2ed8cb}},'log':_0x7665('0x5')});};
\ No newline at end of file
index 2d288a2..46f1e1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f04=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x2a9cf3,_0x11bef3){var _0x22c80a=function(_0x556743){while(--_0x556743){_0x2a9cf3['push'](_0x2a9cf3['shift']());}};_0x22c80a(++_0x11bef3);}(_0x4f04,0x192));var _0x44f0=function(_0x22645a,_0x15cd19){_0x22645a=_0x22645a-0x0;var _0x24b81e=_0x4f04[_0x22645a];return _0x24b81e;};'use strict';var client=require(_0x44f0('0x0'));exports[_0x44f0('0x1')]=function(_0x2def92){return client[_0x44f0('0x2')](_0x44f0('0x3'),{'body':_0x2def92,'log':_0x44f0('0x4')});};
\ No newline at end of file
+var _0x7124=['CreateWhatsappMessage','../client','Request'];(function(_0x3c3b0b,_0x59ad40){var _0x47e7e6=function(_0x460a5c){while(--_0x460a5c){_0x3c3b0b['push'](_0x3c3b0b['shift']());}};_0x47e7e6(++_0x59ad40);}(_0x7124,0x85));var _0x4712=function(_0x3f4bc1,_0x15ace5){_0x3f4bc1=_0x3f4bc1-0x0;var _0x46fcf6=_0x7124[_0x3f4bc1];return _0x46fcf6;};'use strict';var client=require(_0x4712('0x0'));exports['create']=function(_0x568ba0){return client[_0x4712('0x1')](_0x4712('0x2'),{'body':_0x568ba0,'log':'createWhatsappMessage'});};
\ No newline at end of file
index 1f49b60..7fa3fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2b=['whatsappPause','../client','getWhatsappQueues','name','timeout','strategy','User','Agents','online'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x5f2b,0xf4));var _0xb5f2=function(_0xb94ddc,_0x480a4d){_0xb94ddc=_0xb94ddc-0x0;var _0x656a6b=_0x5f2b[_0xb94ddc];return _0x656a6b;};'use strict';var client=require(_0xb5f2('0x0'));exports[_0xb5f2('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xb5f2('0x2'),_0xb5f2('0x3'),_0xb5f2('0x4')],'include':[{'model':_0xb5f2('0x5'),'as':_0xb5f2('0x6'),'attributes':['id','name',_0xb5f2('0x7'),_0xb5f2('0x8')]}]},'log':_0xb5f2('0x1')});};};
\ No newline at end of file
+var _0xa67b=['User','Agents','name','online','whatsappPause','../client','GetWhatsappQueue','timeout','strategy'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa67b,0x176));var _0xba67=function(_0x2563d0,_0x3185a0){_0x2563d0=_0x2563d0-0x0;var _0x4d9422=_0xa67b[_0x2563d0];return _0x4d9422;};'use strict';var client=require(_0xba67('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0xba67('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xba67('0x2'),_0xba67('0x3')],'include':[{'model':_0xba67('0x4'),'as':_0xba67('0x5'),'attributes':['id',_0xba67('0x6'),_0xba67('0x7'),_0xba67('0x8')]}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
index 5ac4b52..9b13688 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6ed=['UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x477b5b,_0x57826a){var _0xd233ef=function(_0x55129a){while(--_0x55129a){_0x477b5b['push'](_0x477b5b['shift']());}};_0xd233ef(++_0x57826a);}(_0xb6ed,0x146));var _0xdb6e=function(_0x3051f4,_0x392c4e){_0x3051f4=_0x3051f4-0x0;var _0x395ff6=_0xb6ed[_0x3051f4];return _0x395ff6;};'use strict';var client=require(_0xdb6e('0x0'));exports[_0xdb6e('0x1')]=function(_0x20c519){return client[_0xdb6e('0x2')]('CreateWhatsappQueueReport',{'body':_0x20c519,'log':_0xdb6e('0x3')});};exports['update']=function(_0x4939fb,_0x1b6333){return client[_0xdb6e('0x2')](_0xdb6e('0x4'),{'body':_0x1b6333,'options':{'where':{'uniqueid':_0x4939fb},'order':[['id','DESC']],'limit':0x1},'log':_0xdb6e('0x4')});};
\ No newline at end of file
+var _0xff34=['../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0xff34,0x1a4));var _0x4ff3=function(_0x4e7544,_0x17891b){_0x4e7544=_0x4e7544-0x0;var _0x1c20ee=_0xff34[_0x4e7544];return _0x1c20ee;};'use strict';var client=require(_0x4ff3('0x0'));exports[_0x4ff3('0x1')]=function(_0x275d44){return client[_0x4ff3('0x2')](_0x4ff3('0x3'),{'body':_0x275d44,'log':_0x4ff3('0x3')});};exports[_0x4ff3('0x4')]=function(_0x42e0ee,_0x2296fa){return client[_0x4ff3('0x2')](_0x4ff3('0x5'),{'body':_0x2296fa,'options':{'where':{'uniqueid':_0x42e0ee},'order':[['id',_0x4ff3('0x6')]],'limit':0x1},'log':_0x4ff3('0x5')});};
\ No newline at end of file
index 38e8e6d..7b6be32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30bf=['util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','message','join','find','agents','timeout','createQueue','atimeout','channel','rules','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','validate','lodash'];(function(_0x10d2ff,_0x4a6aee){var _0x5ec65b=function(_0x5e27bd){while(--_0x5e27bd){_0x10d2ff['push'](_0x10d2ff['shift']());}};_0x5ec65b(++_0x4a6aee);}(_0x30bf,0x1c5));var _0xf30b=function(_0x1e3a03,_0x5319d7){_0x1e3a03=_0x1e3a03-0x0;var _0x26a722=_0x30bf[_0x1e3a03];return _0x26a722;};'use strict';var schema=require(_0xf30b('0x0'));var _=require(_0xf30b('0x1'));var util=require(_0xf30b('0x2'));var seqqueue=require(_0xf30b('0x3'));var logger=require(_0xf30b('0x4'))(_0xf30b('0x5'));var strategy=require(_0xf30b('0x6'));var queue=schema({'name':{'type':_0xf30b('0x7'),'required':!![],'message':_0xf30b('0x8')},'timeout':{'type':_0xf30b('0x9'),'message':_0xf30b('0xa')}});function writeLog(_0x114ef8,_0x44b619,_0x229331){return logger[_0xf30b('0xb')](util[_0xf30b('0xc')](_0xf30b('0xd'),_0x114ef8,_0x44b619[_0xf30b('0xe')],_0x229331));}function handleFindAgent(_0x59c9fa){return function(_0x38b540){return _0x38b540[_0xf30b('0xe')][_0xf30b('0xf')]()===_0x59c9fa[_0xf30b('0xf')]();};}exports['consequence']=function(_0x132d97,_0x288a20,_0x3de2fa,_0x374f9f){return function(_0x4b0fe7){try{var _0x2fce40={'name':_0x288a20[0x0],'timeout':_0x288a20[0x1]};var _0x533688=queue['validate'](_0x2fce40,{'typecast':!![]});if(_0x533688[_0xf30b('0x10')]){logger[_0xf30b('0x11')](_0xf30b('0x12'),_0x132d97,_['map'](_0x533688,_0xf30b('0x13'))[_0xf30b('0x14')](',\x20'));_0x4b0fe7['stop']();}else{var _0x3e3f39=_[_0xf30b('0x15')](_0x3de2fa[_0xf30b('0x16')],handleFindAgent(_0x2fce40[_0xf30b('0xe')]));if(_0x3e3f39){var _0x114c3f=(_0x2fce40[_0xf30b('0x17')]||0xa)*0x3e8;var _0x1ba297,_0x529b9c;var _0x410dd9=seqqueue[_0xf30b('0x18')](_0x114c3f);_0x410dd9['id']=_0x132d97;_0x410dd9[_0xf30b('0x19')]=_0x114c3f;_0x410dd9['channel']=_0x374f9f[_0xf30b('0x1a')];writeLog(_0x132d97,_0x3e3f39,util[_0xf30b('0xc')]('START:%s',_0x114c3f));_0x3de2fa[_0xf30b('0x1b')][_0x132d97]['on']('end',function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x132d97);clearTimeout(_0x529b9c);_0x529b9c=undefined;_0x410dd9[_0xf30b('0x1c')]();if(_0x3de2fa[_0xf30b('0x1b')][_0x132d97]){delete _0x3de2fa[_0xf30b('0x1b')][_0x132d97];}_0x4b0fe7[_0xf30b('0x1d')]();});_0x3de2fa['rules'][_0x132d97]['on'](_0xf30b('0x1e'),function(){if(_0x3de2fa[_0xf30b('0x1b')][_0x132d97]){delete _0x3de2fa['rules'][_0x132d97];}});_0x529b9c=setTimeout(function(){logger[_0xf30b('0xb')](_0xf30b('0x1f'),_0x132d97);clearTimeout(_0x529b9c);_0x410dd9[_0xf30b('0x1c')]();_0x4b0fe7['next']();},_0x114c3f);strategy[_0xf30b('0x20')](_0x410dd9,_0x3e3f39,_0x3de2fa,_0x374f9f);}else{logger[_0xf30b('0x11')](_0xf30b('0x21'),_0x132d97,_0x2fce40['name']);_0x4b0fe7['stop']();}}}catch(_0x29bb3a){console[_0xf30b('0x22')](_0x29bb3a);logger[_0xf30b('0x11')]('[%s][QUEUE]\x20%s',_0x132d97,_0x29bb3a['stack']);_0x4b0fe7[_0xf30b('0x1d')]();}};};
\ No newline at end of file
+var _0xf6e6=['format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','createQueue','channel','START:%s','rules','end','complete','[%s][AGENT]\x20ROUTING\x20END','agent','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info'];(function(_0x379190,_0x3da236){var _0x4ab8d8=function(_0xf2462d){while(--_0xf2462d){_0x379190['push'](_0x379190['shift']());}};_0x4ab8d8(++_0x3da236);}(_0xf6e6,0x116));var _0x6f6e=function(_0x32f072,_0x194fca){_0x32f072=_0x32f072-0x0;var _0x4f5aa2=_0xf6e6[_0x32f072];return _0x4f5aa2;};'use strict';var schema=require(_0x6f6e('0x0'));var _=require(_0x6f6e('0x1'));var util=require(_0x6f6e('0x2'));var seqqueue=require(_0x6f6e('0x3'));var logger=require('../../../../config/logger')(_0x6f6e('0x4'));var strategy=require(_0x6f6e('0x5'));var queue=schema({'name':{'type':_0x6f6e('0x6'),'required':!![],'message':_0x6f6e('0x7')},'timeout':{'type':'number','message':_0x6f6e('0x8')}});function writeLog(_0x4e63ff,_0x4c7dbb,_0x297018){return logger[_0x6f6e('0x9')](util[_0x6f6e('0xa')](_0x6f6e('0xb'),_0x4e63ff,_0x4c7dbb['name'],_0x297018));}function handleFindAgent(_0x5c136f){return function(_0x1ed44f){return _0x1ed44f[_0x6f6e('0xc')][_0x6f6e('0xd')]()===_0x5c136f[_0x6f6e('0xd')]();};}exports[_0x6f6e('0xe')]=function(_0xd84124,_0x46ee2d,_0x18f623,_0x45a6b6){return function(_0x4cd092){try{var _0x1fc1c6={'name':_0x46ee2d[0x0],'timeout':_0x46ee2d[0x1]};var _0x3d1452=queue[_0x6f6e('0x0')](_0x1fc1c6,{'typecast':!![]});if(_0x3d1452['length']){logger[_0x6f6e('0xf')](_0x6f6e('0x10'),_0xd84124,_[_0x6f6e('0x11')](_0x3d1452,_0x6f6e('0x12'))['join'](',\x20'));_0x4cd092[_0x6f6e('0x13')]();}else{var _0x33c40c=_[_0x6f6e('0x14')](_0x18f623[_0x6f6e('0x15')],handleFindAgent(_0x1fc1c6[_0x6f6e('0xc')]));if(_0x33c40c){var _0x2aa6de=(_0x1fc1c6['timeout']||0xa)*0x3e8;var _0x48e385,_0x218c37;var _0x4a0c6d=seqqueue[_0x6f6e('0x16')](_0x2aa6de);_0x4a0c6d['id']=_0xd84124;_0x4a0c6d['atimeout']=_0x2aa6de;_0x4a0c6d[_0x6f6e('0x17')]=_0x45a6b6[_0x6f6e('0x17')];writeLog(_0xd84124,_0x33c40c,util[_0x6f6e('0xa')](_0x6f6e('0x18'),_0x2aa6de));_0x18f623[_0x6f6e('0x19')][_0xd84124]['on'](_0x6f6e('0x1a'),function(){logger[_0x6f6e('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0xd84124);clearTimeout(_0x218c37);_0x218c37=undefined;_0x4a0c6d['close']();if(_0x18f623[_0x6f6e('0x19')][_0xd84124]){delete _0x18f623['rules'][_0xd84124];}_0x4cd092['stop']();});_0x18f623[_0x6f6e('0x19')][_0xd84124]['on'](_0x6f6e('0x1b'),function(){if(_0x18f623[_0x6f6e('0x19')][_0xd84124]){delete _0x18f623[_0x6f6e('0x19')][_0xd84124];}});_0x218c37=setTimeout(function(){logger[_0x6f6e('0x9')](_0x6f6e('0x1c'),_0xd84124);clearTimeout(_0x218c37);_0x4a0c6d['close']();_0x4cd092['next']();},_0x2aa6de);strategy[_0x6f6e('0x1d')](_0x4a0c6d,_0x33c40c,_0x18f623,_0x45a6b6);}else{logger[_0x6f6e('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0xd84124,_0x1fc1c6[_0x6f6e('0xc')]);_0x4cd092[_0x6f6e('0x13')]();}}}catch(_0x2718ce){console[_0x6f6e('0x1e')](_0x2718ce);logger[_0x6f6e('0xf')](_0x6f6e('0x1f'),_0xd84124,_0x2718ce['stack']);_0x4cd092['stop']();}};};
\ No newline at end of file
index 29bb661..d9a29ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc54=['message','channel','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xbc54,0x103));var _0x4bc5=function(_0x1f24a8,_0x4c1a27){_0x1f24a8=_0x1f24a8-0x0;var _0x1946de=_0xbc54[_0x1f24a8];return _0x1946de;};'use strict';var _=require('lodash');var moment=require(_0x4bc5('0x0'));var AWS=require(_0x4bc5('0x1'));var utils=require(_0x4bc5('0x2'));var logger=require(_0x4bc5('0x3'))('routing');var rpc={'chatMessage':require(_0x4bc5('0x4')),'openchannelMessage':require(_0x4bc5('0x5')),'mailMessage':require(_0x4bc5('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x4bc5('0x7')),'whatsappMessage':require(_0x4bc5('0x8'))};exports[_0x4bc5('0x9')]=function(_0x48d089,_0x12eef9){return function(_0x3bc070){try{if(!_['isNil'](this['interaction'][_0x4bc5('0xa')])){logger[_0x4bc5('0xb')]('[%s][AMAZONLEX]\x20%s',_0x48d089,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3bc070[_0x4bc5('0xc')]();}var _0x130e8e={'ContactId':this[_0x4bc5('0xd')]['id'],'sentAt':moment()[_0x4bc5('0xe')](_0x4bc5('0xf')),'direction':_0x4bc5('0x10')};if(this['channel']==='sms'||this['channel']===_0x4bc5('0x11')){_0x130e8e[_0x4bc5('0x12')]=this[_0x4bc5('0x13')][_0x4bc5('0x12')];}var _0x4b0ab6=this['channel'];if(_0x4b0ab6==='chat'){_0x130e8e[_0x4bc5('0x14')]=this[_0x4bc5('0x15')]['id'];}else{_0x130e8e[_[_0x4bc5('0x16')](_0x4b0ab6)+_0x4bc5('0x17')]=this[_0x4bc5('0x15')]['id'];}_0x130e8e[_['upperFirst'](_0x4b0ab6)+_0x4bc5('0x18')]=this[_0x4bc5('0x13')]['id'];if(this['interaction'][_0x4bc5('0x19')]){var _0x21b12d=_0x12eef9[0x4];if(!_[_0x4bc5('0x1a')](_0x21b12d)){_0x130e8e[_0x4bc5('0x1b')]=utils[_0x4bc5('0x1c')](_0x21b12d,this);return rpc[_0x4b0ab6+_0x4bc5('0x1d')][_0x4bc5('0x1e')](_0x130e8e)[_0x4bc5('0x1f')](function(_0x10c1ee){logger[_0x4bc5('0xb')](_0x4bc5('0x20'),_0x48d089,_0x130e8e[_0x4bc5('0x1b')]);})[_0x4bc5('0x21')](function(_0x5daeb5){logger[_0x4bc5('0x22')](_0x4bc5('0x20'),_0x48d089,JSON[_0x4bc5('0x23')](_0x5daeb5));})[_0x4bc5('0x24')](function(){logger['info'](_0x4bc5('0x25'),_0x48d089);_0x3bc070[_0x4bc5('0x26')]();});}else{logger['info'](_0x4bc5('0x27'),_0x48d089);_0x3bc070[_0x4bc5('0x26')]();}}else{var _0x3bb795=this;var _0x1f4d68=new AWS['LexRuntime']({'accessKeyId':_0x12eef9[0x0],'secretAccessKey':_0x12eef9[0x1],'region':_0x12eef9[0x2]});var _0x183e0e={'botAlias':_0x4bc5('0x28'),'botName':_0x12eef9[0x3],'inputText':this[_0x4bc5('0x29')][_0x4bc5('0x1b')],'userId':this[_0x4bc5('0x2a')]+':'+this[_0x4bc5('0x13')]['id'][_0x4bc5('0x2b')]()};_0x1f4d68[_0x4bc5('0x2c')](_0x183e0e,function(_0x4b64a9,_0x248206){if(_0x4b64a9){logger[_0x4bc5('0x22')]('[%s][AMAZONLEX]\x20%s',_0x48d089,_0x4b64a9[_0x4bc5('0x29')]);_0x3bc070[_0x4bc5('0xc')]();}else if(_0x248206&&_0x248206[_0x4bc5('0x29')]){_0x3bb795['body'][_0x4bc5('0x2d')]=_0x248206;_0x130e8e[_0x4bc5('0x1b')]=_0x248206[_0x4bc5('0x29')];_0x130e8e[_0x4bc5('0x2e')]=_0x4bc5('0x2d');_0x130e8e[_0x4bc5('0x2f')]=JSON[_0x4bc5('0x23')](_0x248206);return rpc[_0x4b0ab6+'Message']['create'](_0x130e8e)[_0x4bc5('0x1f')](function(_0x5c284f){logger[_0x4bc5('0xb')](_0x4bc5('0x20'),_0x48d089,_0x130e8e['body']);if(_0x248206[_0x4bc5('0x30')]==_0x4bc5('0x31')){_0x3bc070[_0x4bc5('0xc')]();}else{_0x3bc070[_0x4bc5('0x26')]();}})['catch'](function(_0x2d3c3e){logger[_0x4bc5('0x22')](_0x4bc5('0x20'),_0x48d089,JSON['stringify'](_0x2d3c3e));_0x3bc070['next']();});}else{_0x3bc070[_0x4bc5('0xc')]();}});}}catch(_0x438324){logger[_0x4bc5('0x22')](_0x4bc5('0x20'),_0x48d089,JSON['stringify'](_0x438324));_0x3bc070[_0x4bc5('0x26')]();}};};
\ No newline at end of file
+var _0x964a=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x2d7821,_0x24b7a5){var _0x5b6e27=function(_0x50beab){while(--_0x50beab){_0x2d7821['push'](_0x2d7821['shift']());}};_0x5b6e27(++_0x24b7a5);}(_0x964a,0x1d5));var _0xa964=function(_0x1de2a9,_0x23b34e){_0x1de2a9=_0x1de2a9-0x0;var _0x262bc9=_0x964a[_0x1de2a9];return _0x262bc9;};'use strict';var _=require(_0xa964('0x0'));var moment=require(_0xa964('0x1'));var AWS=require(_0xa964('0x2'));var utils=require(_0xa964('0x3'));var logger=require(_0xa964('0x4'))('routing');var rpc={'chatMessage':require(_0xa964('0x5')),'openchannelMessage':require(_0xa964('0x6')),'mailMessage':require(_0xa964('0x7')),'smsMessage':require(_0xa964('0x8')),'faxMessage':require(_0xa964('0x9')),'whatsappMessage':require(_0xa964('0xa'))};exports['consequence']=function(_0x329f3a,_0x18bb8c){return function(_0x44d8c7){try{if(!_[_0xa964('0xb')](this[_0xa964('0xc')][_0xa964('0xd')])){logger[_0xa964('0xe')](_0xa964('0xf'),_0x329f3a,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x44d8c7[_0xa964('0x10')]();}var _0x2844a5={'ContactId':this[_0xa964('0x11')]['id'],'sentAt':moment()[_0xa964('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa964('0x13')};if(this[_0xa964('0x14')]===_0xa964('0x15')||this[_0xa964('0x14')]===_0xa964('0x16')){_0x2844a5[_0xa964('0x17')]=this['interaction']['phone'];}var _0x1c2e50=this[_0xa964('0x14')];if(_0x1c2e50===_0xa964('0x18')){_0x2844a5[_0xa964('0x19')]=this[_0xa964('0x1a')]['id'];}else{_0x2844a5[_[_0xa964('0x1b')](_0x1c2e50)+'AccountId']=this[_0xa964('0x1a')]['id'];}_0x2844a5[_[_0xa964('0x1b')](_0x1c2e50)+'InteractionId']=this[_0xa964('0xc')]['id'];if(this[_0xa964('0xc')][_0xa964('0x1c')]){var _0x3690cf=_0x18bb8c[0x4];if(!_[_0xa964('0x1d')](_0x3690cf)){_0x2844a5['body']=utils[_0xa964('0x1e')](_0x3690cf,this);return rpc[_0x1c2e50+_0xa964('0x1f')][_0xa964('0x20')](_0x2844a5)[_0xa964('0x21')](function(_0x59ba4b){logger[_0xa964('0xe')]('[%s][AMAZONLEX]\x20%s',_0x329f3a,_0x2844a5[_0xa964('0x22')]);})[_0xa964('0x23')](function(_0x2d35c1){logger[_0xa964('0x24')](_0xa964('0xf'),_0x329f3a,JSON[_0xa964('0x25')](_0x2d35c1));})[_0xa964('0x26')](function(){logger[_0xa964('0xe')](_0xa964('0x27'),_0x329f3a);_0x44d8c7[_0xa964('0x28')]();});}else{logger['info'](_0xa964('0x29'),_0x329f3a);_0x44d8c7[_0xa964('0x28')]();}}else{var _0x58017c=this;var _0x5f51d0=new AWS[(_0xa964('0x2a'))]({'accessKeyId':_0x18bb8c[0x0],'secretAccessKey':_0x18bb8c[0x1],'region':_0x18bb8c[0x2]});var _0x1d9cd7={'botAlias':_0xa964('0x2b'),'botName':_0x18bb8c[0x3],'inputText':this[_0xa964('0x2c')]['body'],'userId':this[_0xa964('0x14')]+':'+this[_0xa964('0xc')]['id'][_0xa964('0x2d')]()};_0x5f51d0[_0xa964('0x2e')](_0x1d9cd7,function(_0x34508a,_0x339756){if(_0x34508a){logger[_0xa964('0x24')](_0xa964('0xf'),_0x329f3a,_0x34508a['message']);_0x44d8c7[_0xa964('0x10')]();}else if(_0x339756&&_0x339756[_0xa964('0x2c')]){_0x58017c[_0xa964('0x22')][_0xa964('0x2f')]=_0x339756;_0x2844a5[_0xa964('0x22')]=_0x339756[_0xa964('0x2c')];_0x2844a5[_0xa964('0x30')]=_0xa964('0x2f');_0x2844a5[_0xa964('0x31')]=JSON[_0xa964('0x25')](_0x339756);return rpc[_0x1c2e50+'Message'][_0xa964('0x20')](_0x2844a5)[_0xa964('0x21')](function(_0x169fc4){logger[_0xa964('0xe')](_0xa964('0xf'),_0x329f3a,_0x2844a5[_0xa964('0x22')]);if(_0x339756['dialogState']==_0xa964('0x32')){_0x44d8c7['next']();}else{_0x44d8c7['stop']();}})[_0xa964('0x23')](function(_0x5ec2dd){logger['error'](_0xa964('0xf'),_0x329f3a,JSON[_0xa964('0x25')](_0x5ec2dd));_0x44d8c7[_0xa964('0x10')]();});}else{_0x44d8c7[_0xa964('0x10')]();}});}}catch(_0x19b7f0){logger['error'](_0xa964('0xf'),_0x329f3a,JSON[_0xa964('0x25')](_0x19b7f0));_0x44d8c7['stop']();}};};
\ No newline at end of file
index 66da79d..84fcaf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c3f=['[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','channel','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','InteractionId','Smtp','service','host','port','secure','auth','user','pass','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','info','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x6c3f,0x1ab));var _0xf6c3=function(_0x317387,_0x56d494){_0x317387=_0x317387-0x0;var _0x28c044=_0x6c3f[_0x317387];return _0x28c044;};'use strict';var _=require(_0xf6c3('0x0'));var moment=require(_0xf6c3('0x1'));var utils=require(_0xf6c3('0x2'));var logger=require(_0xf6c3('0x3'))('routing');var rpc={'chatMessage':require(_0xf6c3('0x4')),'openchannelMessage':require(_0xf6c3('0x5')),'mailMessage':require(_0xf6c3('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf6c3('0x7')),'chatInteraction':require(_0xf6c3('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xf6c3('0x9')),'smsInteraction':require(_0xf6c3('0xa')),'faxInteraction':require(_0xf6c3('0xb')),'whatsappInteraction':require(_0xf6c3('0xc'))};var mailRpc=require(_0xf6c3('0xd'));exports[_0xf6c3('0xe')]=function(_0x521b53,_0x2c4969,_0x582452,_0x317461){return function(_0x2b064a){try{var _0x2d9dce=this['channel'];if(_0x2d9dce===_0xf6c3('0xf')&&_0x317461[_0xf6c3('0x10')][_0xf6c3('0x11')]){logger['info'](_0xf6c3('0x12'),_0x521b53,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x2b064a[_0xf6c3('0x13')]();}if(_0x2c4969[0x0]==='1'&&(_[_0xf6c3('0x14')](this[_0xf6c3('0x15')][_0xf6c3('0x16')])||!this[_0xf6c3('0x15')][_0xf6c3('0x16')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x521b53,'Autoreply\x20already\x20sent');return _0x2b064a['next']();}if(_0x2c4969[0x0]==='2'&&this[_0xf6c3('0x15')]['autoreplyExecuted']){logger['info'](_0xf6c3('0x17'),_0x521b53,'One\x20Time\x20already\x20sent');return _0x2b064a[_0xf6c3('0x13')]();}var _0x2f3cc9={'ContactId':this['contact']['id'],'sentAt':moment()[_0xf6c3('0x18')](_0xf6c3('0x19')),'direction':_0xf6c3('0x1a')};if(this['channel']===_0xf6c3('0xf')){_0x2f3cc9[_0xf6c3('0x10')]=utils[_0xf6c3('0x1b')](_0x2c4969[0x2],this);}else{_0x2f3cc9[_0xf6c3('0x10')]=utils[_0xf6c3('0x1b')](_0x2c4969[0x1],this);}if(this[_0xf6c3('0x1c')]){_0x2f3cc9['to']=this['message'][_0xf6c3('0x1d')]||'';if(this[_0xf6c3('0x1e')]===_0xf6c3('0xf')&&_0x2c4969[0x1]==='1'){_0x2f3cc9['cc']=this['message']['cc']||'';}_0x2f3cc9[_0xf6c3('0x1d')]=this[_0xf6c3('0x1c')]['to']||'';_0x2f3cc9[_0xf6c3('0x1f')]=this[_0xf6c3('0x1c')][_0xf6c3('0x1f')]||'';_0x2f3cc9[_0xf6c3('0x20')]=!![];if(this['message']['subject']){_0x2f3cc9[_0xf6c3('0x21')]='';_0x2f3cc9[_0xf6c3('0x21')]+=_[_0xf6c3('0x22')](this[_0xf6c3('0x1c')][_0xf6c3('0x21')],'Re:')?'':_0xf6c3('0x23');_0x2f3cc9['subject']+=this[_0xf6c3('0x1c')][_0xf6c3('0x21')];}}if(this[_0xf6c3('0x1e')]===_0xf6c3('0x24')){_0x2f3cc9[_0xf6c3('0x25')]=this[_0xf6c3('0x26')]['id'];}else{_0x2f3cc9[_[_0xf6c3('0x27')](this['channel'])+'AccountId']=this[_0xf6c3('0x26')]['id'];}_0x2f3cc9[_[_0xf6c3('0x27')](this['channel'])+_0xf6c3('0x28')]=this[_0xf6c3('0x15')]['id'];var _0x2f4468=this[_0xf6c3('0x15')];if(rpc[this[_0xf6c3('0x1e')]+'Message']){if(this[_0xf6c3('0x1e')]===_0xf6c3('0xf')){var _0x30adc2={'tls':{'rejectUnauthorized':![]}};if(this[_0xf6c3('0x26')][_0xf6c3('0x29')][_0xf6c3('0x2a')]){_0x30adc2['service']=this[_0xf6c3('0x26')][_0xf6c3('0x29')][_0xf6c3('0x2a')];}else{_0x30adc2['host']=this[_0xf6c3('0x26')][_0xf6c3('0x29')][_0xf6c3('0x2b')];_0x30adc2[_0xf6c3('0x2c')]=this[_0xf6c3('0x26')][_0xf6c3('0x29')]['port'];_0x30adc2[_0xf6c3('0x2d')]=this[_0xf6c3('0x26')][_0xf6c3('0x29')][_0xf6c3('0x2d')];}if(this[_0xf6c3('0x26')]['Smtp']['authentication']){_0x30adc2[_0xf6c3('0x2e')]={'user':this[_0xf6c3('0x26')][_0xf6c3('0x29')][_0xf6c3('0x2f')],'pass':this['account']['Smtp'][_0xf6c3('0x30')]};}_0x2f3cc9['inReplyTo']=this[_0xf6c3('0x1c')][_0xf6c3('0x31')];_0x2f3cc9[_0xf6c3('0x32')]=_0xf6c3('0x33')+_[_0xf6c3('0x34')](_0x2f3cc9['body'],_0xf6c3('0x35'),'<div')+_0xf6c3('0x36');_0x2f3cc9[_0xf6c3('0x37')]={'Auto-Submitted':_0xf6c3('0x38'),'X-Auto-Response-Suppress':_0xf6c3('0x39'),'Precedence':_0xf6c3('0x3a')};return mailRpc[_0xf6c3('0x3b')](_0x30adc2,_0x2f3cc9)[_0xf6c3('0x3c')](function(_0x27e87b){logger['info'](_0xf6c3('0x3d'),_0x521b53);_0x2f3cc9[_0xf6c3('0x31')]=_0x27e87b[_0xf6c3('0x1c')][_0xf6c3('0x31')];return rpc[_0x2d9dce+_0xf6c3('0x3e')][_0xf6c3('0x3f')](_0x2f3cc9);})['then'](function(_0x2c5134){logger[_0xf6c3('0x40')](_0xf6c3('0x12'),_0x521b53,JSON['stringify'](_0x2c5134));})['catch'](function(_0x5f08bb){logger[_0xf6c3('0x41')](_0xf6c3('0x42'),_0x521b53,JSON[_0xf6c3('0x43')](_0x5f08bb));})[_0xf6c3('0x44')](function(){Promise[_0xf6c3('0x45')]()['then'](function(){if(_0x2c4969[0x0]!=='2'||_0x2f4468[_0xf6c3('0x46')])return;return rpc[_0x2d9dce+'Interaction'][_0xf6c3('0x47')](_0x2f4468['id'],{'autoreplyExecuted':!![]})[_0xf6c3('0x3c')](function(_0x1acae6){logger[_0xf6c3('0x40')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x521b53,JSON[_0xf6c3('0x43')](_0x1acae6));})['catch'](function(_0x2f71d3){logger['error'](_0xf6c3('0x48'),_0x521b53,JSON['stringify'](_0x2f71d3));});})[_0xf6c3('0x3c')](function(){_0x2b064a[_0xf6c3('0x13')]();});});}else{return rpc[this[_0xf6c3('0x1e')]+_0xf6c3('0x3e')]['create'](_0x2f3cc9)[_0xf6c3('0x3c')](function(_0x3ec95d){logger['info'](_0xf6c3('0x12'),_0x521b53,_0x2f3cc9[_0xf6c3('0x10')]);})[_0xf6c3('0x49')](function(_0x174528){logger[_0xf6c3('0x41')](_0xf6c3('0x12'),_0x521b53,JSON[_0xf6c3('0x43')](_0x174528));})[_0xf6c3('0x44')](function(){Promise['resolve']()[_0xf6c3('0x3c')](function(){if(_0x2c4969[0x0]!=='2'||_0x2f4468[_0xf6c3('0x46')])return;return rpc[_0x2d9dce+'Interaction']['update'](_0x2f4468['id'],{'autoreplyExecuted':!![]})[_0xf6c3('0x3c')](function(_0x4390b3){logger[_0xf6c3('0x40')](_0xf6c3('0x17'),_0x521b53,JSON[_0xf6c3('0x43')](_0x4390b3));})[_0xf6c3('0x49')](function(_0x45cf47){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x521b53,JSON[_0xf6c3('0x43')](_0x45cf47));});})['then'](function(){_0x2b064a[_0xf6c3('0x13')]();});});}}}catch(_0x4eadfd){logger[_0xf6c3('0x41')]('[%s][AUTOREPLY]\x20%s',_0x521b53,JSON['stringify'](_0x4eadfd));_0x2b064a[_0xf6c3('0x4a')]();}};};
\ No newline at end of file
+var _0x4915=['../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','startsWith','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','All','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','finally','resolve','autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage'];(function(_0x777e47,_0xd9ebdb){var _0x5b3430=function(_0x1263b){while(--_0x1263b){_0x777e47['push'](_0x777e47['shift']());}};_0x5b3430(++_0xd9ebdb);}(_0x4915,0xc2));var _0x5491=function(_0xdb4e73,_0x30b446){_0xdb4e73=_0xdb4e73-0x0;var _0x4578b4=_0x4915[_0xdb4e73];return _0x4578b4;};'use strict';var _=require(_0x5491('0x0'));var moment=require(_0x5491('0x1'));var utils=require(_0x5491('0x2'));var logger=require(_0x5491('0x3'))(_0x5491('0x4'));var rpc={'chatMessage':require(_0x5491('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5491('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5491('0x7')),'chatInteraction':require(_0x5491('0x8')),'openchannelInteraction':require(_0x5491('0x9')),'mailInteraction':require(_0x5491('0xa')),'smsInteraction':require(_0x5491('0xb')),'faxInteraction':require(_0x5491('0xc')),'whatsappInteraction':require(_0x5491('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x5491('0xe')]=function(_0x564345,_0x21faff,_0x25b534,_0x31037d){return function(_0x12b5ec){try{var _0x495c42=this[_0x5491('0xf')];if(_0x495c42===_0x5491('0x10')&&_0x31037d[_0x5491('0x11')][_0x5491('0x12')]){logger[_0x5491('0x13')]('[%s][AUTOREPLY]\x20%s',_0x564345,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x12b5ec['next']();}if(_0x21faff[0x0]==='1'&&(_['isNil'](this[_0x5491('0x14')][_0x5491('0x15')])||!this['interaction'][_0x5491('0x15')])){logger[_0x5491('0x13')](_0x5491('0x16'),_0x564345,_0x5491('0x17'));return _0x12b5ec[_0x5491('0x18')]();}if(_0x21faff[0x0]==='2'&&this[_0x5491('0x14')]['autoreplyExecuted']){logger['info'](_0x5491('0x19'),_0x564345,_0x5491('0x1a'));return _0x12b5ec[_0x5491('0x18')]();}var _0x37d653={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x5491('0x1b')),'direction':'out'};if(this['channel']==='mail'){_0x37d653[_0x5491('0x11')]=utils[_0x5491('0x1c')](_0x21faff[0x2],this);}else{_0x37d653[_0x5491('0x11')]=utils[_0x5491('0x1c')](_0x21faff[0x1],this);}if(this[_0x5491('0x1d')]){_0x37d653['to']=this[_0x5491('0x1d')][_0x5491('0x1e')]||'';if(this[_0x5491('0xf')]===_0x5491('0x10')&&_0x21faff[0x1]==='1'){_0x37d653['cc']=this[_0x5491('0x1d')]['cc']||'';}_0x37d653['from']=this[_0x5491('0x1d')]['to']||'';_0x37d653['phone']=this[_0x5491('0x1d')][_0x5491('0x1f')]||'';_0x37d653[_0x5491('0x20')]=!![];if(this[_0x5491('0x1d')][_0x5491('0x21')]){_0x37d653[_0x5491('0x21')]='';_0x37d653[_0x5491('0x21')]+=_[_0x5491('0x22')](this[_0x5491('0x1d')]['subject'],'Re:')?'':'Re:\x20';_0x37d653[_0x5491('0x21')]+=this['message'][_0x5491('0x21')];}}if(this['channel']===_0x5491('0x23')){_0x37d653[_0x5491('0x24')]=this[_0x5491('0x25')]['id'];}else{_0x37d653[_[_0x5491('0x26')](this[_0x5491('0xf')])+_0x5491('0x27')]=this[_0x5491('0x25')]['id'];}_0x37d653[_[_0x5491('0x26')](this[_0x5491('0xf')])+_0x5491('0x28')]=this[_0x5491('0x14')]['id'];var _0x26641c=this[_0x5491('0x14')];if(rpc[this[_0x5491('0xf')]+_0x5491('0x29')]){if(this['channel']==='mail'){_0x37d653[_0x5491('0x2a')]=this[_0x5491('0x1d')][_0x5491('0x2b')];_0x37d653[_0x5491('0x2c')]=_0x5491('0x2d')+_[_0x5491('0x2e')](_0x37d653[_0x5491('0x11')],_0x5491('0x2f'),_0x5491('0x30'))+_0x5491('0x31');_0x37d653[_0x5491('0x32')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x5491('0x33'),'Precedence':'auto_reply'};return mailRpc[_0x5491('0x34')](this[_0x5491('0x25')][_0x5491('0x35')],_0x37d653)['then'](function(_0x12500c){logger[_0x5491('0x13')](_0x5491('0x36'),_0x564345);_0x37d653['messageId']=_0x12500c[_0x5491('0x1d')]['messageId'];return rpc[_0x495c42+'Message'][_0x5491('0x37')](_0x37d653);})[_0x5491('0x38')](function(_0x4ee1a3){logger[_0x5491('0x13')](_0x5491('0x16'),_0x564345,JSON[_0x5491('0x39')](_0x4ee1a3));})[_0x5491('0x3a')](function(_0x567abf){logger[_0x5491('0x3b')]('[RPC][%s][AUTOREPLY]\x20%s',_0x564345,JSON[_0x5491('0x39')](_0x567abf));})[_0x5491('0x3c')](function(){Promise[_0x5491('0x3d')]()['then'](function(){if(_0x21faff[0x0]!=='2'||_0x26641c[_0x5491('0x3e')])return;return rpc[_0x495c42+'Interaction'][_0x5491('0x3f')](_0x26641c['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5ef7dc){logger[_0x5491('0x13')](_0x5491('0x19'),_0x564345,JSON[_0x5491('0x39')](_0x5ef7dc));})[_0x5491('0x3a')](function(_0x1613c0){logger[_0x5491('0x3b')](_0x5491('0x40'),_0x564345,JSON[_0x5491('0x39')](_0x1613c0));});})[_0x5491('0x38')](function(){_0x12b5ec[_0x5491('0x18')]();});});}else{return rpc[this[_0x5491('0xf')]+'Message'][_0x5491('0x37')](_0x37d653)['then'](function(){logger[_0x5491('0x13')]('[%s][AUTOREPLY]\x20%s',_0x564345,_0x37d653['body']);})[_0x5491('0x3a')](function(_0x599491){logger[_0x5491('0x3b')](_0x5491('0x16'),_0x564345,JSON[_0x5491('0x39')](_0x599491));})[_0x5491('0x3c')](function(){Promise[_0x5491('0x3d')]()['then'](function(){if(_0x21faff[0x0]!=='2'||_0x26641c['autoreplyExecuted'])return;return rpc[_0x495c42+_0x5491('0x41')][_0x5491('0x3f')](_0x26641c['id'],{'autoreplyExecuted':!![]})[_0x5491('0x38')](function(_0x5d1c24){logger[_0x5491('0x13')](_0x5491('0x19'),_0x564345,JSON[_0x5491('0x39')](_0x5d1c24));})[_0x5491('0x3a')](function(_0x44133a){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x564345,JSON['stringify'](_0x44133a));});})[_0x5491('0x38')](function(){_0x12b5ec['next']();});});}}}catch(_0x1c8695){logger[_0x5491('0x3b')](_0x5491('0x16'),_0x564345,JSON['stringify'](_0x1c8695));_0x12b5ec[_0x5491('0x42')]();}};};
\ No newline at end of file
index aac452c..e98820f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99d2=['finally','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','then','interaction','catch','[%s][CLOSE]\x20%s'];(function(_0x307806,_0x4e44b5){var _0x53429c=function(_0x35616f){while(--_0x35616f){_0x307806['push'](_0x307806['shift']());}};_0x53429c(++_0x4e44b5);}(_0x99d2,0x1bc));var _0x299d=function(_0x940fd,_0x4a5c45){_0x940fd=_0x940fd-0x0;var _0x49c850=_0x99d2[_0x940fd];return _0x49c850;};'use strict';var moment=require(_0x299d('0x0'));var logger=require(_0x299d('0x1'))(_0x299d('0x2'));var rpc={'chatInteraction':require(_0x299d('0x3')),'openchannelInteraction':require(_0x299d('0x4')),'smsInteraction':require(_0x299d('0x5')),'mailInteraction':require(_0x299d('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x299d('0x7')]=function(_0x5e6025,_0x298164,_0x4fa27a,_0xfe7512){return function(_0x416d3e){try{logger[_0x299d('0x8')](_0x299d('0x9'),_0x5e6025,_0x298164[0x0]);var _0x354613={'closed':0x1,'closedAt':moment()[_0x299d('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x299d('0xb'),'disposition':_0x298164[0x0]};if(rpc[_0xfe7512[_0x299d('0xc')]+_0x299d('0xd')]){rpc[_0xfe7512[_0x299d('0xc')]+_0x299d('0xd')]['update'](_0xfe7512['interaction']['id'],_0x354613)[_0x299d('0xe')](function(_0x381871){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5e6025,_0xfe7512[_0x299d('0xf')]['id']);})[_0x299d('0x10')](function(_0x3ba994){logger['error'](_0x299d('0x11'),_0x5e6025,JSON['stringify'](_0x3ba994));})[_0x299d('0x12')](function(){_0x416d3e['stop']();});}}catch(_0x38688d){logger['error']('[%s][CLOSE]\x20%s',_0x5e6025,JSON[_0x299d('0x13')](_0x38688d));_0x416d3e[_0x299d('0x14')]();}};};
\ No newline at end of file
+var _0x532a=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','finally','stop','error','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/chatInteraction'];(function(_0x5cd036,_0x29264f){var _0x1bcf78=function(_0x5edb2a){while(--_0x5edb2a){_0x5cd036['push'](_0x5cd036['shift']());}};_0x1bcf78(++_0x29264f);}(_0x532a,0x66));var _0xa532=function(_0x49d27a,_0x166543){_0x49d27a=_0x49d27a-0x0;var _0x3f0b62=_0x532a[_0x49d27a];return _0x3f0b62;};'use strict';var moment=require(_0xa532('0x0'));var logger=require(_0xa532('0x1'))('routing');var rpc={'chatInteraction':require(_0xa532('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xa532('0x3')),'whatsappInteraction':require(_0xa532('0x4'))};exports[_0xa532('0x5')]=function(_0x21cede,_0x261e16,_0x40a104,_0xc8f463){return function(_0x4a95da){try{logger['info'](_0xa532('0x6'),_0x21cede,_0x261e16[0x0]);var _0x3dd0a8={'closed':0x1,'closedAt':moment()[_0xa532('0x7')](_0xa532('0x8')),'closeReason':_0xa532('0x9'),'disposition':_0x261e16[0x0]};if(rpc[_0xc8f463[_0xa532('0xa')]+_0xa532('0xb')]){rpc[_0xc8f463['channel']+'Interaction'][_0xa532('0xc')](_0xc8f463[_0xa532('0xd')]['id'],_0x3dd0a8)['then'](function(_0x292bdb){logger['info'](_0xa532('0xe'),_0x21cede,_0xc8f463[_0xa532('0xd')]['id']);})[_0xa532('0xf')](function(_0x2ff5fa){logger['error']('[%s][CLOSE]\x20%s',_0x21cede,JSON[_0xa532('0x10')](_0x2ff5fa));})[_0xa532('0x11')](function(){_0x4a95da[_0xa532('0x12')]();});}}catch(_0x576b12){logger[_0xa532('0x13')](_0xa532('0x14'),_0x21cede,JSON[_0xa532('0x10')](_0x576b12));_0x4a95da[_0xa532('0x12')]();}};};
\ No newline at end of file
index 1b581b5..6cd542c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27eb=['AccountId','upperFirst','interaction','created','isEmpty','body','getMustacheRender','Message','create','catch','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','then','dialogflow','result','speech','providerName','providerResponse','metadata','endConversation','error','message','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','whatsapp','chat','account'];(function(_0x2cc952,_0x5cb4e0){var _0x2b1c63=function(_0x183157){while(--_0x183157){_0x2cc952['push'](_0x2cc952['shift']());}};_0x2b1c63(++_0x5cb4e0);}(_0x27eb,0xd0));var _0xb27e=function(_0x3dc88f,_0x344f73){_0x3dc88f=_0x3dc88f-0x0;var _0x2cbeb7=_0x27eb[_0x3dc88f];return _0x2cbeb7;};'use strict';var _=require(_0xb27e('0x0'));var moment=require(_0xb27e('0x1'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xb27e('0x2'));var logger=require(_0xb27e('0x3'))(_0xb27e('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb27e('0x5')),'mailMessage':require(_0xb27e('0x6')),'smsMessage':require(_0xb27e('0x7')),'faxMessage':require(_0xb27e('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xb27e('0x9')]=function(_0x333512,_0x1e76db){return function(_0x45c0ea){try{if(!_[_0xb27e('0xa')](this['interaction'][_0xb27e('0xb')])){logger[_0xb27e('0xc')](_0xb27e('0xd'),_0x333512,_0xb27e('0xe'));return _0x45c0ea[_0xb27e('0xf')]();}var _0x51a872={'ContactId':this[_0xb27e('0x10')]['id'],'sentAt':moment()[_0xb27e('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xb27e('0x12')]==='sms'||this[_0xb27e('0x12')]===_0xb27e('0x13')){_0x51a872['phone']=this['interaction']['phone'];}var _0x12b9d3=this['channel'];if(_0x12b9d3===_0xb27e('0x14')){_0x51a872['ChatWebsiteId']=this[_0xb27e('0x15')]['id'];}else{_0x51a872[_['upperFirst'](_0x12b9d3)+_0xb27e('0x16')]=this[_0xb27e('0x15')]['id'];}_0x51a872[_[_0xb27e('0x17')](_0x12b9d3)+'InteractionId']=this[_0xb27e('0x18')]['id'];if(this[_0xb27e('0x18')][_0xb27e('0x19')]){var _0x188073=_0x1e76db[0x2];if(!_[_0xb27e('0x1a')](_0x188073)){_0x51a872[_0xb27e('0x1b')]=utils[_0xb27e('0x1c')](_0x188073,this);return rpc[_0x12b9d3+_0xb27e('0x1d')][_0xb27e('0x1e')](_0x51a872)['then'](function(_0x8be243){logger[_0xb27e('0xc')](_0xb27e('0xd'),_0x333512,_0x51a872['body']);})[_0xb27e('0x1f')](function(_0x47c65e){logger['error'](_0xb27e('0xd'),_0x333512,JSON[_0xb27e('0x20')](_0x47c65e));})['finally'](function(){logger[_0xb27e('0xc')](_0xb27e('0x21'),_0x333512);_0x45c0ea[_0xb27e('0x22')]();});}else{logger[_0xb27e('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x333512);_0x45c0ea[_0xb27e('0x22')]();}}else{var _0x5a3cdf=this;var _0x19c0f2=apiai(_0x1e76db[0x0],{'language':_0x1e76db[0x1]||'en'});return _0x19c0f2[_0xb27e('0x23')](this['message']['body'],{'sessionId':md5(this[_0xb27e('0x18')]['id'])})[_0xb27e('0x24')](function(_0x3703ab){_0x5a3cdf[_0xb27e('0x1b')][_0xb27e('0x25')]=_0x3703ab;_0x51a872['body']=_0x3703ab[_0xb27e('0x26')]['fulfillment'][_0xb27e('0x27')];_0x51a872[_0xb27e('0x28')]=_0xb27e('0x25');_0x51a872[_0xb27e('0x29')]=JSON[_0xb27e('0x20')](_0x3703ab);return rpc[_0x12b9d3+'Message'][_0xb27e('0x1e')](_0x51a872)['then'](function(_0x2839cf){logger[_0xb27e('0xc')](_0xb27e('0xd'),_0x333512,_0x51a872[_0xb27e('0x1b')]);if(_0x3703ab[_0xb27e('0x26')][_0xb27e('0x2a')][_0xb27e('0x2b')]){_0x45c0ea[_0xb27e('0xf')]();}else{_0x45c0ea[_0xb27e('0x22')]();}})['catch'](function(_0x377d79){logger[_0xb27e('0x2c')](_0xb27e('0xd'),_0x333512,JSON[_0xb27e('0x20')](_0x377d79));_0x45c0ea['next']();});})[_0xb27e('0x1f')](function(_0x28927a){logger[_0xb27e('0x2c')](_0xb27e('0xd'),_0x333512,_0x28927a[_0xb27e('0x2d')]);_0x45c0ea[_0xb27e('0xf')]();});}}catch(_0x26cd41){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x333512,JSON[_0xb27e('0x20')](_0x26cd41));_0x45c0ea['stop']();}};};
\ No newline at end of file
+var _0x77f7=['account','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','metadata','endConversation','next','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId'];(function(_0x3ce03c,_0x2e304d){var _0x2679a7=function(_0x2b5a0f){while(--_0x2b5a0f){_0x3ce03c['push'](_0x3ce03c['shift']());}};_0x2679a7(++_0x2e304d);}(_0x77f7,0xbd));var _0x777f=function(_0x11e26f,_0x37a754){_0x11e26f=_0x11e26f-0x0;var _0x10a9c5=_0x77f7[_0x11e26f];return _0x10a9c5;};'use strict';var _=require(_0x777f('0x0'));var moment=require(_0x777f('0x1'));var apiai=require(_0x777f('0x2'));var md5=require(_0x777f('0x3'));var utils=require(_0x777f('0x4'));var logger=require(_0x777f('0x5'))(_0x777f('0x6'));var rpc={'chatMessage':require(_0x777f('0x7')),'openchannelMessage':require(_0x777f('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x777f('0x9')),'whatsappMessage':require(_0x777f('0xa'))};exports[_0x777f('0xb')]=function(_0x16642d,_0xda8cb2){return function(_0x5bf11d){try{if(!_[_0x777f('0xc')](this[_0x777f('0xd')][_0x777f('0xe')])){logger[_0x777f('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x16642d,_0x777f('0x10'));return _0x5bf11d['next']();}var _0x26e215={'ContactId':this[_0x777f('0x11')]['id'],'sentAt':moment()['format'](_0x777f('0x12')),'direction':_0x777f('0x13')};if(this[_0x777f('0x14')]==='sms'||this[_0x777f('0x14')]===_0x777f('0x15')){_0x26e215[_0x777f('0x16')]=this[_0x777f('0xd')][_0x777f('0x16')];}var _0x151e24=this['channel'];if(_0x151e24===_0x777f('0x17')){_0x26e215[_0x777f('0x18')]=this['account']['id'];}else{_0x26e215[_[_0x777f('0x19')](_0x151e24)+_0x777f('0x1a')]=this[_0x777f('0x1b')]['id'];}_0x26e215[_[_0x777f('0x19')](_0x151e24)+_0x777f('0x1c')]=this[_0x777f('0xd')]['id'];if(this[_0x777f('0xd')]['created']){var _0x856923=_0xda8cb2[0x2];if(!_[_0x777f('0x1d')](_0x856923)){_0x26e215[_0x777f('0x1e')]=utils[_0x777f('0x1f')](_0x856923,this);return rpc[_0x151e24+_0x777f('0x20')][_0x777f('0x21')](_0x26e215)[_0x777f('0x22')](function(_0x4e1153){logger['info'](_0x777f('0x23'),_0x16642d,_0x26e215[_0x777f('0x1e')]);})[_0x777f('0x24')](function(_0x58aae1){logger[_0x777f('0x25')](_0x777f('0x23'),_0x16642d,JSON[_0x777f('0x26')](_0x58aae1));})[_0x777f('0x27')](function(){logger['info'](_0x777f('0x28'),_0x16642d);_0x5bf11d['stop']();});}else{logger[_0x777f('0xf')](_0x777f('0x29'),_0x16642d);_0x5bf11d[_0x777f('0x2a')]();}}else{var _0x38e32f=this;var _0x3a0c1d=apiai(_0xda8cb2[0x0],{'language':_0xda8cb2[0x1]||'en'});return _0x3a0c1d[_0x777f('0x2b')](this[_0x777f('0x2c')]['body'],{'sessionId':md5(this[_0x777f('0xd')]['id'])})[_0x777f('0x22')](function(_0x5089ba){_0x38e32f[_0x777f('0x1e')]['dialogflow']=_0x5089ba;_0x26e215[_0x777f('0x1e')]=_0x5089ba[_0x777f('0x2d')][_0x777f('0x2e')][_0x777f('0x2f')];_0x26e215[_0x777f('0x30')]=_0x777f('0x31');_0x26e215[_0x777f('0x32')]=JSON[_0x777f('0x26')](_0x5089ba);return rpc[_0x151e24+_0x777f('0x20')]['create'](_0x26e215)['then'](function(_0x16ca18){logger[_0x777f('0xf')](_0x777f('0x23'),_0x16642d,_0x26e215[_0x777f('0x1e')]);if(_0x5089ba[_0x777f('0x2d')][_0x777f('0x33')][_0x777f('0x34')]){_0x5bf11d['next']();}else{_0x5bf11d[_0x777f('0x2a')]();}})[_0x777f('0x24')](function(_0x5b78b8){logger[_0x777f('0x25')](_0x777f('0x23'),_0x16642d,JSON['stringify'](_0x5b78b8));_0x5bf11d['next']();});})[_0x777f('0x24')](function(_0x10e02e){logger[_0x777f('0x25')](_0x777f('0x23'),_0x16642d,_0x10e02e[_0x777f('0x2c')]);_0x5bf11d[_0x777f('0x35')]();});}}catch(_0x150ae6){logger[_0x777f('0x25')](_0x777f('0x23'),_0x16642d,JSON[_0x777f('0x26')](_0x150ae6));_0x5bf11d['stop']();}};};
\ No newline at end of file
index 9978a98..48fcb68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0567=['UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','getMustacheRender','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','replace','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','length','push','fulfillmentText','all','stop','dialogflow','moment','bluebird','../../../../config/logger','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify'];(function(_0x1782d1,_0x389af2){var _0x1d475b=function(_0x480124){while(--_0x480124){_0x1782d1['push'](_0x1782d1['shift']());}};_0x1d475b(++_0x389af2);}(_0x0567,0xc1));var _0x7056=function(_0x5e3e56,_0xd414d1){_0x5e3e56=_0x5e3e56-0x0;var _0x31666d=_0x0567[_0x5e3e56];return _0x31666d;};'use strict';var _=require('lodash');var dialogflow=require(_0x7056('0x0'));var md5=require('md5');var moment=require(_0x7056('0x1'));var Promise=require(_0x7056('0x2'));var logger=require(_0x7056('0x3'))('routing');var utils=require(_0x7056('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7056('0x5')),'mailMessage':require(_0x7056('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7056('0x7')),'whatsappMessage':require(_0x7056('0x8'))};function createMessage(_0x5a7f58,_0x2510b2,_0x30992f,_0x4ff26c){return new Promise(function(_0x37b93b,_0xdfaf91){var _0x271b91=_[_0x7056('0x9')](_0x30992f);_0x271b91['body']=_0x4ff26c;return rpc[_0x2510b2+_0x7056('0xa')]['create'](_0x271b91)['then'](function(){logger[_0x7056('0xb')](_0x7056('0xc'),_0x5a7f58,_0x271b91[_0x7056('0xd')]);_0x37b93b();})[_0x7056('0xe')](function(_0x3fb496){logger[_0x7056('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x5a7f58,JSON[_0x7056('0x10')](_0x3fb496));_0xdfaf91(_0x3fb496);});});}exports['consequence']=function(_0x51a4cb,_0xba0de9){return function(_0x2992b6){try{if(!_['isNil'](this['interaction'][_0x7056('0x11')])){logger[_0x7056('0xb')](_0x7056('0xc'),_0x51a4cb,_0x7056('0x12'));return _0x2992b6[_0x7056('0x13')]();}var _0x23d968={'ContactId':this[_0x7056('0x14')]['id'],'sentAt':moment()['format'](_0x7056('0x15')),'direction':_0x7056('0x16')};if(this[_0x7056('0x17')]==='sms'||this[_0x7056('0x17')]===_0x7056('0x18')){_0x23d968[_0x7056('0x19')]=this[_0x7056('0x1a')][_0x7056('0x19')];}var _0x3c92c2=this['channel'];if(_0x3c92c2===_0x7056('0x1b')){_0x23d968[_0x7056('0x1c')]=this[_0x7056('0x1d')]['id'];}else{_0x23d968[_['upperFirst'](_0x3c92c2)+_0x7056('0x1e')]=this['account']['id'];}_0x23d968[_[_0x7056('0x1f')](_0x3c92c2)+_0x7056('0x20')]=this[_0x7056('0x1a')]['id'];if(this['interaction'][_0x7056('0x21')]){var _0x134246=_0xba0de9[0x4];if(!_['isEmpty'](_0x134246)){_0x23d968[_0x7056('0xd')]=utils[_0x7056('0x22')](_0x134246,this);return rpc[_0x3c92c2+_0x7056('0xa')]['create'](_0x23d968)[_0x7056('0x23')](function(_0x271e1b){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x51a4cb,_0x23d968['body']);})['catch'](function(_0x4f08ec){logger[_0x7056('0xf')](_0x7056('0xc'),_0x51a4cb,JSON[_0x7056('0x10')](_0x4f08ec));})[_0x7056('0x24')](function(){logger[_0x7056('0xb')](_0x7056('0x25'),_0x51a4cb);_0x2992b6['stop']();});}else{logger[_0x7056('0xb')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x51a4cb);_0x2992b6['stop']();}}else{var _0x12181d=this;var _0x2d6756=_0xba0de9[0x2][_0x7056('0x26')](/\\n/g,'\x0a');var _0x444340={'credentials':{'private_key':_0x2d6756,'client_email':_0xba0de9[0x1]}};var _0x4086b9=new dialogflow[(_0x7056('0x27'))](_0x444340);var _0x18d879=_0x4086b9[_0x7056('0x28')](_0xba0de9[0x0],md5(_0x12181d[_0x7056('0x1a')]['id']));var _0x33ab69={'session':_0x18d879,'queryInput':{'text':{'text':_0x12181d[_0x7056('0x29')][_0x7056('0xd')],'languageCode':_0xba0de9[0x3]||'en'}}};return _0x4086b9[_0x7056('0x2a')](_0x33ab69)['then'](function(_0x4554a7){if(_0x4554a7&&_0x4554a7['length']){_0x12181d[_0x7056('0xd')][_0x7056('0x2b')]=_0x4554a7;var _0x47ed19=_0x4554a7[0x0];var _0x1ad452=_0x47ed19[_0x7056('0x2c')][_0x7056('0x2d')]&&_0x47ed19[_0x7056('0x2c')][_0x7056('0x2d')][_0x7056('0x2e')]?_0x47ed19[_0x7056('0x2c')][_0x7056('0x2d')][_0x7056('0x2e')]['end_conversation'][_0x7056('0x2f')]:![];_0x12181d['body'][_0x7056('0x30')]=_0x47ed19[_0x7056('0x2c')]['action'];_0x12181d[_0x7056('0xd')][_0x7056('0x31')]=_0x47ed19['queryResult']['allRequiredParamsPresent'];_0x12181d[_0x7056('0xd')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x47ed19[_0x7056('0x2c')]['diagnosticInfo']&&_0x47ed19[_0x7056('0x2c')][_0x7056('0x2d')][_0x7056('0x2e')]?_0x47ed19[_0x7056('0x2c')]['diagnosticInfo'][_0x7056('0x2e')][_0x7056('0x32')]['boolValue']:![];_0x12181d[_0x7056('0xd')][_0x7056('0x33')]=_0x47ed19[_0x7056('0x2c')][_0x7056('0x34')][_0x7056('0x35')];_0x12181d[_0x7056('0xd')][_0x7056('0x36')]=_0x47ed19[_0x7056('0x2c')][_0x7056('0x34')][_0x7056('0x37')];_0x12181d[_0x7056('0xd')][_0x7056('0x38')]=_0x47ed19[_0x7056('0x2c')]['intent'][_0x7056('0x39')];_0x12181d[_0x7056('0xd')][_0x7056('0x3a')]=_0x47ed19['queryResult'][_0x7056('0x3b')];_0x12181d[_0x7056('0xd')][_0x7056('0x3c')]=_0x47ed19[_0x7056('0x2c')][_0x7056('0x3d')];_0x12181d[_0x7056('0xd')]['DIALOGFLOWV2_SCORE']=_0x47ed19[_0x7056('0x2c')][_0x7056('0x3e')];_0x23d968[_0x7056('0x3f')]=_0x7056('0x2b');_0x23d968[_0x7056('0x40')]=JSON[_0x7056('0x10')](_0x4554a7);var _0x1ae2ce=[];for(var _0x5532f5=0x0;_0x5532f5<_0x4554a7[_0x7056('0x41')];_0x5532f5++){var _0x5a3a97=_0x4554a7[_0x5532f5];if(_0x5a3a97&&_0x5a3a97[_0x7056('0x2c')]&&_0x5a3a97[_0x7056('0x2c')]['fulfillmentText']){_0x1ae2ce[_0x7056('0x42')](createMessage(_0x51a4cb,_0x3c92c2,_0x23d968,_0x5a3a97['queryResult'][_0x7056('0x43')]));}}return Promise[_0x7056('0x44')](_0x1ae2ce)[_0x7056('0x23')](function(){if(_0x1ad452){_0x2992b6['next']();}else{_0x2992b6['stop']();}})[_0x7056('0xe')](function(_0x44a939){logger[_0x7056('0xf')](_0x7056('0xc'),_0x51a4cb,JSON[_0x7056('0x10')](_0x44a939));_0x2992b6[_0x7056('0x13')]();});}})['catch'](function(_0x4ca905){logger[_0x7056('0xf')](_0x7056('0xc'),_0x51a4cb,_0x4ca905[_0x7056('0x29')]);_0x2992b6[_0x7056('0x13')]();});}}catch(_0x2c211b){logger['error'](_0x7056('0xc'),_0x51a4cb,JSON[_0x7056('0x10')](_0x2c211b));_0x2992b6[_0x7056('0x45')]();}};};
\ No newline at end of file
+var _0xa496=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','error','stringify','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','push','fulfillmentText','all','md5','moment','bluebird','../../../../config/logger','./utils'];(function(_0x4a5a3e,_0x451c36){var _0x1e7d64=function(_0xbbb998){while(--_0xbbb998){_0x4a5a3e['push'](_0x4a5a3e['shift']());}};_0x1e7d64(++_0x451c36);}(_0xa496,0x1b7));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x6a49('0x0'));var moment=require(_0x6a49('0x1'));var Promise=require(_0x6a49('0x2'));var logger=require(_0x6a49('0x3'))('routing');var utils=require(_0x6a49('0x4'));var rpc={'chatMessage':require(_0x6a49('0x5')),'openchannelMessage':require(_0x6a49('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6a49('0x7')),'faxMessage':require(_0x6a49('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x4b1427,_0x1a6b10,_0x433c17,_0x4ba408){return new Promise(function(_0x19400f,_0x42b4be){var _0x16072d=_['clone'](_0x433c17);_0x16072d['body']=_0x4ba408;return rpc[_0x1a6b10+_0x6a49('0x9')][_0x6a49('0xa')](_0x16072d)[_0x6a49('0xb')](function(){logger[_0x6a49('0xc')](_0x6a49('0xd'),_0x4b1427,_0x16072d[_0x6a49('0xe')]);_0x19400f();})[_0x6a49('0xf')](function(_0x5a9b3f){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x4b1427,JSON['stringify'](_0x5a9b3f));_0x42b4be(_0x5a9b3f);});});}exports[_0x6a49('0x10')]=function(_0x38c7cf,_0x288a36){return function(_0x3030c3){try{if(!_[_0x6a49('0x11')](this[_0x6a49('0x12')][_0x6a49('0x13')])){logger[_0x6a49('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0x38c7cf,_0x6a49('0x14'));return _0x3030c3[_0x6a49('0x15')]();}var _0x533f9f={'ContactId':this[_0x6a49('0x16')]['id'],'sentAt':moment()[_0x6a49('0x17')](_0x6a49('0x18')),'direction':_0x6a49('0x19')};if(this[_0x6a49('0x1a')]==='sms'||this[_0x6a49('0x1a')]===_0x6a49('0x1b')){_0x533f9f['phone']=this['interaction']['phone'];}var _0x16304d=this[_0x6a49('0x1a')];if(_0x16304d==='chat'){_0x533f9f[_0x6a49('0x1c')]=this[_0x6a49('0x1d')]['id'];}else{_0x533f9f[_[_0x6a49('0x1e')](_0x16304d)+_0x6a49('0x1f')]=this[_0x6a49('0x1d')]['id'];}_0x533f9f[_['upperFirst'](_0x16304d)+_0x6a49('0x20')]=this[_0x6a49('0x12')]['id'];if(this[_0x6a49('0x12')][_0x6a49('0x21')]){var _0x138441=_0x288a36[0x4];if(!_[_0x6a49('0x22')](_0x138441)){_0x533f9f['body']=utils['getMustacheRender'](_0x138441,this);return rpc[_0x16304d+'Message']['create'](_0x533f9f)[_0x6a49('0xb')](function(_0x3c8a70){logger[_0x6a49('0xc')](_0x6a49('0xd'),_0x38c7cf,_0x533f9f[_0x6a49('0xe')]);})[_0x6a49('0xf')](function(_0x14cb89){logger[_0x6a49('0x23')](_0x6a49('0xd'),_0x38c7cf,JSON[_0x6a49('0x24')](_0x14cb89));})['finally'](function(){logger[_0x6a49('0xc')](_0x6a49('0x25'),_0x38c7cf);_0x3030c3[_0x6a49('0x26')]();});}else{logger[_0x6a49('0xc')](_0x6a49('0x27'),_0x38c7cf);_0x3030c3[_0x6a49('0x26')]();}}else{var _0x2b59b8=this;var _0xa625c6=_0x288a36[0x2]['replace'](/\\n/g,'\x0a');var _0x130a92={'credentials':{'private_key':_0xa625c6,'client_email':_0x288a36[0x1]}};var _0x438635=new dialogflow[(_0x6a49('0x28'))](_0x130a92);var _0x3ea34d=_0x438635[_0x6a49('0x29')](_0x288a36[0x0],md5(_0x2b59b8['interaction']['id']));var _0x20d7ec={'session':_0x3ea34d,'queryInput':{'text':{'text':_0x2b59b8[_0x6a49('0x2a')]['body'],'languageCode':_0x288a36[0x3]||'en'}}};return _0x438635[_0x6a49('0x2b')](_0x20d7ec)[_0x6a49('0xb')](function(_0x124ffc){if(_0x124ffc&&_0x124ffc['length']){_0x2b59b8[_0x6a49('0xe')][_0x6a49('0x2c')]=_0x124ffc;var _0x3b23d6=_0x124ffc[0x0];var _0x59c831=_0x3b23d6['queryResult'][_0x6a49('0x2d')]&&_0x3b23d6['queryResult']['diagnosticInfo']['fields']?_0x3b23d6[_0x6a49('0x2e')]['diagnosticInfo'][_0x6a49('0x2f')][_0x6a49('0x30')][_0x6a49('0x31')]:![];_0x2b59b8[_0x6a49('0xe')][_0x6a49('0x32')]=_0x3b23d6[_0x6a49('0x2e')][_0x6a49('0x33')];_0x2b59b8['body'][_0x6a49('0x34')]=_0x3b23d6['queryResult'][_0x6a49('0x35')];_0x2b59b8[_0x6a49('0xe')][_0x6a49('0x36')]=_0x3b23d6[_0x6a49('0x2e')][_0x6a49('0x2d')]&&_0x3b23d6[_0x6a49('0x2e')]['diagnosticInfo']['fields']?_0x3b23d6[_0x6a49('0x2e')]['diagnosticInfo']['fields']['end_conversation'][_0x6a49('0x31')]:![];_0x2b59b8[_0x6a49('0xe')][_0x6a49('0x37')]=_0x3b23d6['queryResult']['intent'][_0x6a49('0x38')];_0x2b59b8[_0x6a49('0xe')][_0x6a49('0x39')]=_0x3b23d6[_0x6a49('0x2e')]['intent'][_0x6a49('0x3a')];_0x2b59b8[_0x6a49('0xe')][_0x6a49('0x3b')]=_0x3b23d6[_0x6a49('0x2e')][_0x6a49('0x3c')][_0x6a49('0x3d')];_0x2b59b8[_0x6a49('0xe')][_0x6a49('0x3e')]=_0x3b23d6[_0x6a49('0x2e')][_0x6a49('0x3f')];_0x2b59b8['body'][_0x6a49('0x40')]=_0x3b23d6['queryResult'][_0x6a49('0x41')];_0x2b59b8['body'][_0x6a49('0x42')]=_0x3b23d6[_0x6a49('0x2e')][_0x6a49('0x43')];_0x533f9f[_0x6a49('0x44')]=_0x6a49('0x2c');_0x533f9f[_0x6a49('0x45')]=JSON[_0x6a49('0x24')](_0x124ffc);var _0x3e1dd3=[];for(var _0x425150=0x0;_0x425150<_0x124ffc[_0x6a49('0x46')];_0x425150++){var _0x675ecb=_0x124ffc[_0x425150];if(_0x675ecb&&_0x675ecb[_0x6a49('0x2e')]&&_0x675ecb[_0x6a49('0x2e')]['fulfillmentText']){_0x3e1dd3[_0x6a49('0x47')](createMessage(_0x38c7cf,_0x16304d,_0x533f9f,_0x675ecb[_0x6a49('0x2e')][_0x6a49('0x48')]));}}return Promise[_0x6a49('0x49')](_0x3e1dd3)[_0x6a49('0xb')](function(){if(_0x59c831){_0x3030c3['next']();}else{_0x3030c3[_0x6a49('0x26')]();}})['catch'](function(_0x2be1cc){logger[_0x6a49('0x23')](_0x6a49('0xd'),_0x38c7cf,JSON[_0x6a49('0x24')](_0x2be1cc));_0x3030c3['next']();});}})['catch'](function(_0x527e4b){logger[_0x6a49('0x23')]('[%s][DIALOGFLOWV2]\x20%s',_0x38c7cf,_0x527e4b[_0x6a49('0x2a')]);_0x3030c3[_0x6a49('0x15')]();});}}catch(_0x4e27a1){logger['error'](_0x6a49('0xd'),_0x38c7cf,JSON['stringify'](_0x4e27a1));_0x3030c3[_0x6a49('0x26')]();}};};
\ No newline at end of file
index b218900..99df892 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e9e=['priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition'];(function(_0x27bc26,_0x36deb5){var _0xd156e9=function(_0x377974){while(--_0x377974){_0x27bc26['push'](_0x27bc26['shift']());}};_0xd156e9(++_0x36deb5);}(_0x4e9e,0x1c3));var _0xe4e9=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0x4e9e[_0x358806];return _0x19fdcb;};'use strict';var schema=require(_0xe4e9('0x0'));var _=require('lodash');var htmlToText=require(_0xe4e9('0x1'));var utils=require(_0xe4e9('0x2'));var logger=require(_0xe4e9('0x3'))(_0xe4e9('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xe4e9('0x5')},'priorityTrue':{'type':'number','message':_0xe4e9('0x6')},'priorityFalse':{'type':_0xe4e9('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x5bb358,_0x2237a9){return function(_0x5e48f5){try{var _0x4c497a={'condition':htmlToText['fromString'](utils[_0xe4e9('0x8')](_0x2237a9[0x0],this),{'wordwrap':![]})[_0xe4e9('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2237a9[0x1],'priorityFalse':_0x2237a9[0x2]};var _0x25af7d=gotoif[_0xe4e9('0x0')](_0x4c497a,{'typecast':!![]});if(_0x25af7d[_0xe4e9('0xa')]){logger['error'](_0xe4e9('0xb'),_0x5bb358,_[_0xe4e9('0xc')](_0x25af7d,_0xe4e9('0xd'))[_0xe4e9('0xe')](',\x20'));_0x5e48f5[_0xe4e9('0xf')]();}else{try{var _0x36fda1=eval('('+_0x4c497a[_0xe4e9('0x10')]+')');var _0x365777=_0x36fda1?_0x4c497a[_0xe4e9('0x11')]:_0x4c497a['priorityFalse'];logger[_0xe4e9('0x12')](_0xe4e9('0x13'),_0x5bb358,_0x4c497a[_0xe4e9('0x10')],_0x36fda1,_0x365777||_0xe4e9('0x14'));if(_0x365777){var _0x3a48eb=_['findIndex'](_0x5e48f5[_0xe4e9('0x15')](),{'p':_0x365777});if(_0x3a48eb>=0x0){logger['info'](_0xe4e9('0x16'),_0x5bb358,_0x365777||'next',_0x3a48eb);_0x5e48f5['next'](_0x3a48eb);}else{logger[_0xe4e9('0x12')](_0xe4e9('0x17'),_0x5bb358,_0x365777||_0xe4e9('0x14'));_0x5e48f5[_0xe4e9('0xf')]();}}else{_0x5e48f5[_0xe4e9('0x14')]();}}catch(_0x2d2e85){logger[_0xe4e9('0x18')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5bb358,_0x2d2e85['message']);_0x5e48f5[_0xe4e9('0xf')]();}}}catch(_0x4a303a){logger[_0xe4e9('0x18')](_0xe4e9('0xb'),_0x5bb358,JSON[_0xe4e9('0x19')](_0x4a303a));_0x5e48f5[_0xe4e9('0xf')]();}};};
\ No newline at end of file
+var _0xa2f9=['string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','fromString','replace','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','message','stringify','lodash','html-to-text','routing'];(function(_0x2c9fa1,_0x46850f){var _0xb6e60b=function(_0x47ff49){while(--_0x47ff49){_0x2c9fa1['push'](_0x2c9fa1['shift']());}};_0xb6e60b(++_0x46850f);}(_0xa2f9,0xde));var _0x9a2f=function(_0x18f82b,_0x3ea7a0){_0x18f82b=_0x18f82b-0x0;var _0x5d8128=_0xa2f9[_0x18f82b];return _0x5d8128;};'use strict';var schema=require('validate');var _=require(_0x9a2f('0x0'));var htmlToText=require(_0x9a2f('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x9a2f('0x2'));var gotoif=schema({'condition':{'type':_0x9a2f('0x3'),'required':!![],'message':_0x9a2f('0x4')},'priorityTrue':{'type':_0x9a2f('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x9a2f('0x6')]=function(_0x2fb2ed,_0x394a24){return function(_0x5768dd){try{var _0x4f74e5={'condition':htmlToText[_0x9a2f('0x7')](utils['getMustacheRender'](_0x394a24[0x0],this),{'wordwrap':![]})[_0x9a2f('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x394a24[0x1],'priorityFalse':_0x394a24[0x2]};var _0x5a8b61=gotoif['validate'](_0x4f74e5,{'typecast':!![]});if(_0x5a8b61['length']){logger[_0x9a2f('0x9')](_0x9a2f('0xa'),_0x2fb2ed,_[_0x9a2f('0xb')](_0x5a8b61,'message')[_0x9a2f('0xc')](',\x20'));_0x5768dd[_0x9a2f('0xd')]();}else{try{var _0x56c8ab=eval('('+_0x4f74e5[_0x9a2f('0xe')]+')');var _0x32cc29=_0x56c8ab?_0x4f74e5[_0x9a2f('0xf')]:_0x4f74e5[_0x9a2f('0x10')];logger[_0x9a2f('0x11')](_0x9a2f('0x12'),_0x2fb2ed,_0x4f74e5[_0x9a2f('0xe')],_0x56c8ab,_0x32cc29||_0x9a2f('0x13'));if(_0x32cc29){var _0x5edfb2=_[_0x9a2f('0x14')](_0x5768dd['rules'](),{'p':_0x32cc29});if(_0x5edfb2>=0x0){logger[_0x9a2f('0x11')](_0x9a2f('0x15'),_0x2fb2ed,_0x32cc29||_0x9a2f('0x13'),_0x5edfb2);_0x5768dd[_0x9a2f('0x13')](_0x5edfb2);}else{logger[_0x9a2f('0x11')](_0x9a2f('0x16'),_0x2fb2ed,_0x32cc29||'next');_0x5768dd[_0x9a2f('0xd')]();}}else{_0x5768dd[_0x9a2f('0x13')]();}}catch(_0x62fcf3){logger[_0x9a2f('0x9')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2fb2ed,_0x62fcf3[_0x9a2f('0x17')]);_0x5768dd['stop']();}}}catch(_0x3a45fe){logger[_0x9a2f('0x9')]('[%s][GOTOIF]\x20%s',_0x2fb2ed,JSON[_0x9a2f('0x18')](_0x3a45fe));_0x5768dd[_0x9a2f('0xd')]();}};};
\ No newline at end of file
index 77ba3e0..90875d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26ae=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules'];(function(_0x1e3be4,_0x35865d){var _0x4b4e1c=function(_0x230324){while(--_0x230324){_0x1e3be4['push'](_0x1e3be4['shift']());}};_0x4b4e1c(++_0x35865d);}(_0x26ae,0xe0));var _0xe26a=function(_0x12decc,_0x2da602){_0x12decc=_0x12decc-0x0;var _0x374695=_0x26ae[_0x12decc];return _0x374695;};'use strict';var schema=require(_0xe26a('0x0'));var _=require(_0xe26a('0x1'));var logger=require('../../../../config/logger')(_0xe26a('0x2'));var gotop=schema({'priority':{'type':_0xe26a('0x3'),'required':!![],'message':_0xe26a('0x4')}});exports['consequence']=function(_0x1892d1,_0x5ebd98){return function(_0x3ad806){try{var _0x1fd879={'priority':_0x5ebd98[0x0]};var _0x1bed0c=gotop[_0xe26a('0x0')](_0x1fd879,{'typecast':!![]});if(_0x1bed0c[_0xe26a('0x5')]){logger[_0xe26a('0x6')](_0xe26a('0x7'),_0x1892d1,_[_0xe26a('0x8')](_0x1bed0c,_0xe26a('0x9'))[_0xe26a('0xa')](',\x20'));_0x3ad806[_0xe26a('0xb')]();}else{logger[_0xe26a('0xc')](_0xe26a('0xd'),_0x1892d1,_0x1fd879[_0xe26a('0xe')]);if(_0x1fd879[_0xe26a('0xe')]){var _0x4e1db8=_['findIndex'](_0x3ad806[_0xe26a('0xf')](),{'p':_0x1fd879[_0xe26a('0xe')]});if(_0x4e1db8>=0x0){logger[_0xe26a('0xc')](_0xe26a('0x10'),_0x1892d1,_0x1fd879['priority']||_0xe26a('0x11'),_0x4e1db8);_0x3ad806[_0xe26a('0x11')](_0x4e1db8);}else{logger[_0xe26a('0xc')](_0xe26a('0x12'),_0x1892d1,_0x1fd879[_0xe26a('0xe')]||_0xe26a('0x11'));_0x3ad806[_0xe26a('0xb')]();}}else{_0x3ad806['next']();}}}catch(_0xc60c23){logger['error'](_0xe26a('0x7'),_0x1892d1,JSON[_0xe26a('0x13')](_0xc60c23));_0x3ad806[_0xe26a('0xb')]();}};};
\ No newline at end of file
+var _0x212b=['routing','number','error','[%s][GOTOP]\x20%s','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','stop','validate'];(function(_0xe56a4f,_0x35a32a){var _0x4dded9=function(_0x39d53b){while(--_0x39d53b){_0xe56a4f['push'](_0xe56a4f['shift']());}};_0x4dded9(++_0x35a32a);}(_0x212b,0x74));var _0xb212=function(_0x486bdd,_0x382f71){_0x486bdd=_0x486bdd-0x0;var _0x4330f2=_0x212b[_0x486bdd];return _0x4330f2;};'use strict';var schema=require(_0xb212('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0xb212('0x1'));var gotop=schema({'priority':{'type':_0xb212('0x2'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x2b9b96,_0x5473d6){return function(_0x11185e){try{var _0x5f4ad7={'priority':_0x5473d6[0x0]};var _0x23ac5e=gotop[_0xb212('0x0')](_0x5f4ad7,{'typecast':!![]});if(_0x23ac5e['length']){logger[_0xb212('0x3')](_0xb212('0x4'),_0x2b9b96,_['map'](_0x23ac5e,_0xb212('0x5'))['join'](',\x20'));_0x11185e['stop']();}else{logger[_0xb212('0x6')](_0xb212('0x7'),_0x2b9b96,_0x5f4ad7[_0xb212('0x8')]);if(_0x5f4ad7[_0xb212('0x8')]){var _0x1854cf=_[_0xb212('0x9')](_0x11185e[_0xb212('0xa')](),{'p':_0x5f4ad7[_0xb212('0x8')]});if(_0x1854cf>=0x0){logger[_0xb212('0x6')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2b9b96,_0x5f4ad7[_0xb212('0x8')]||_0xb212('0xb'),_0x1854cf);_0x11185e['next'](_0x1854cf);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x2b9b96,_0x5f4ad7['priority']||_0xb212('0xb'));_0x11185e[_0xb212('0xc')]();}}else{_0x11185e[_0xb212('0xb')]();}}}catch(_0x5b3d6c){logger[_0xb212('0x3')](_0xb212('0x4'),_0x2b9b96,JSON['stringify'](_0x5b3d6c));_0x11185e['stop']();}};};
\ No newline at end of file
index 8ad27f4..1c36332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecf3=['upperFirst','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','error','stringify','stop','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account'];(function(_0x4ebc28,_0x503df7){var _0x527af5=function(_0x4e579a){while(--_0x4e579a){_0x4ebc28['push'](_0x4ebc28['shift']());}};_0x527af5(++_0x503df7);}(_0xecf3,0x66));var _0x3ecf=function(_0x2cf421,_0x29cdf8){_0x2cf421=_0x2cf421-0x0;var _0x2f935d=_0xecf3[_0x2cf421];return _0x2f935d;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x3ecf('0x0'))(_0x3ecf('0x1'));var rpc={'chatMessage':require(_0x3ecf('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3ecf('0x3')),'smsMessage':require(_0x3ecf('0x4')),'faxMessage':require(_0x3ecf('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3ecf('0x6')]=function(_0x245570,_0x4af095){return function(_0xe52550){try{var _0x4d13b8={'body':utils[_0x3ecf('0x7')](_0x4af095[0x0],this),'ContactId':this[_0x3ecf('0x8')]['id']};if(this[_0x3ecf('0x9')]===_0x3ecf('0xa')){_0x4d13b8[_0x3ecf('0xb')]=this[_0x3ecf('0xc')]['id'];}else{_0x4d13b8[_[_0x3ecf('0xd')](this[_0x3ecf('0x9')])+'AccountId']=this[_0x3ecf('0xc')]['id'];}_0x4d13b8[_[_0x3ecf('0xd')](this['channel'])+_0x3ecf('0xe')]=this[_0x3ecf('0xf')]['id'];if(rpc[this['channel']+_0x3ecf('0x10')]){return rpc[this['channel']+_0x3ecf('0x10')][_0x3ecf('0x11')](_0x4d13b8)['then'](function(_0x1bc3c7){logger[_0x3ecf('0x12')](_0x3ecf('0x13'),_0x245570,_0x4d13b8['body']);_0xe52550['next']();})['catch'](function(_0x5df0be){logger[_0x3ecf('0x14')](_0x3ecf('0x13'),_0x245570,JSON[_0x3ecf('0x15')](_0x5df0be));_0xe52550[_0x3ecf('0x16')]();});}}catch(_0x5dd720){logger['error']('[%s][MESSAGE]\x20%s',_0x245570,JSON[_0x3ecf('0x15')](_0x5dd720));_0xe52550[_0x3ecf('0x16')]();}};};
\ No newline at end of file
+var _0x86e7=['channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','create','then','info','body','next','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x86e7,0xf1));var _0x786e=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x86e7[_0x547456];return _0xc1fd7b;};'use strict';var _=require(_0x786e('0x0'));var utils=require(_0x786e('0x1'));var logger=require(_0x786e('0x2'))('routing');var rpc={'chatMessage':require(_0x786e('0x3')),'openchannelMessage':require(_0x786e('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x786e('0x5')),'faxMessage':require(_0x786e('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x537082,_0x1e271c){return function(_0xf48ca7){try{var _0x5c7ee9={'body':utils[_0x786e('0x7')](_0x1e271c[0x0],this),'ContactId':this[_0x786e('0x8')]['id']};if(this[_0x786e('0x9')]===_0x786e('0xa')){_0x5c7ee9[_0x786e('0xb')]=this[_0x786e('0xc')]['id'];}else{_0x5c7ee9[_[_0x786e('0xd')](this['channel'])+'AccountId']=this['account']['id'];}_0x5c7ee9[_['upperFirst'](this[_0x786e('0x9')])+_0x786e('0xe')]=this['interaction']['id'];if(rpc[this[_0x786e('0x9')]+_0x786e('0xf')]){return rpc[this[_0x786e('0x9')]+_0x786e('0xf')][_0x786e('0x10')](_0x5c7ee9)[_0x786e('0x11')](function(_0x321f87){logger[_0x786e('0x12')]('[%s][MESSAGE]\x20%s',_0x537082,_0x5c7ee9[_0x786e('0x13')]);_0xf48ca7[_0x786e('0x14')]();})['catch'](function(_0x46abb7){logger[_0x786e('0x15')](_0x786e('0x16'),_0x537082,JSON[_0x786e('0x17')](_0x46abb7));_0xf48ca7[_0x786e('0x18')]();});}}catch(_0x13cf0a){logger[_0x786e('0x15')](_0x786e('0x16'),_0x537082,JSON[_0x786e('0x17')](_0x13cf0a));_0xf48ca7[_0x786e('0x18')]();}};};
\ No newline at end of file
index f675015..afab921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x601e=['stringify','stop','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','error'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x601e,0x1da));var _0xe601=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x601e[_0x38c699];return _0x3b1ded;};'use strict';var utils=require(_0xe601('0x0'));var logger=require(_0xe601('0x1'))(_0xe601('0x2'));exports[_0xe601('0x3')]=function(_0x55336c,_0x3c7706){return function(_0xea3129){try{logger['info'](_0xe601('0x4'),_0x55336c,utils['getMustacheRender'](_0x3c7706[0x0],this));_0xea3129['next']();}catch(_0x388cb7){logger[_0xe601('0x5')](_0xe601('0x4'),_0x55336c,JSON[_0xe601('0x6')](_0x388cb7));_0xea3129[_0xe601('0x7')]();}};};
\ No newline at end of file
+var _0x45fb=['next','error','stringify','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x1ed262,_0xa2f29b){var _0x1b3b20=function(_0x2373dd){while(--_0x2373dd){_0x1ed262['push'](_0x1ed262['shift']());}};_0x1b3b20(++_0xa2f29b);}(_0x45fb,0x1e0));var _0xb45f=function(_0xedbe7e,_0x362cfc){_0xedbe7e=_0xedbe7e-0x0;var _0x57d673=_0x45fb[_0xedbe7e];return _0x57d673;};'use strict';var utils=require('./utils');var logger=require(_0xb45f('0x0'))(_0xb45f('0x1'));exports[_0xb45f('0x2')]=function(_0x20c084,_0x5e4211){return function(_0x59082d){try{logger[_0xb45f('0x3')](_0xb45f('0x4'),_0x20c084,utils[_0xb45f('0x5')](_0x5e4211[0x0],this));_0x59082d[_0xb45f('0x6')]();}catch(_0x154eab){logger[_0xb45f('0x7')]('[%s][NOOP]\x20%s',_0x20c084,JSON[_0xb45f('0x8')](_0x154eab));_0x59082d['stop']();}};};
\ No newline at end of file
index 1e5a2bc..0cd2b16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd150=['localhost','socket.io-emitter','queue_id','account','queue','from','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','body','contact','list','upperFirst','channel','InteractionId','interaction','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','error','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','length','find','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults'];(function(_0x1caadc,_0x426557){var _0x25fb0d=function(_0x4c6eed){while(--_0x4c6eed){_0x1caadc['push'](_0x1caadc['shift']());}};_0x25fb0d(++_0x426557);}(_0xd150,0x114));var _0x0d15=function(_0x5dec89,_0x593697){_0x5dec89=_0x5dec89-0x0;var _0x20f883=_0xd150[_0x5dec89];return _0x20f883;};'use strict';var schema=require(_0x0d15('0x0'));var _=require(_0x0d15('0x1'));var util=require(_0x0d15('0x2'));var seqqueue=require(_0x0d15('0x3'));var moment=require(_0x0d15('0x4'));var Redis=require(_0x0d15('0x5'));var config=require(_0x0d15('0x6'));var logger=require(_0x0d15('0x7'))(_0x0d15('0x8'));var strategy=require(_0x0d15('0x9'));config[_0x0d15('0xa')]=_[_0x0d15('0xb')](config[_0x0d15('0xa')],{'host':_0x0d15('0xc'),'port':0x18eb});var io=require(_0x0d15('0xd'))(new Redis(config[_0x0d15('0xa')]));var attributes=['id',_0x0d15('0xe'),_0x0d15('0xf'),_0x0d15('0x10'),_0x0d15('0x11'),'joinAt'];function emit(_0xc5fbb4,_0x1b00e9,_0x430186){io['to'](_0xc5fbb4)['emit'](_0x1b00e9,_0x430186);}function emitChannelQueueInteraction(_0xce4c01,_0x12a9b9,_0x179365,_0x50dca2,_0x25ac5d,_0x3feaa5,_0x244b82,_0x3414d3){var _0x47932a=_['clone'](_0x179365);_0x47932a['queue_id']=_0x3414d3;_0x47932a[_0x0d15('0x10')]=_0x12a9b9;_0x47932a[_0x0d15('0xf')]=_0x50dca2;_0x47932a['id']=_0x25ac5d;if(_0x3feaa5){_0x244b82[util[_0x0d15('0x12')]('%sQueuesWaitingInteractions',_0xce4c01)][_0x25ac5d]=_[_0x0d15('0x13')](_0x47932a,attributes);}else{delete _0x244b82[util[_0x0d15('0x12')](_0x0d15('0x14'),_0xce4c01)][_0x25ac5d];}emit(util[_0x0d15('0x12')](_0x0d15('0x15'),_0xce4c01,_0x12a9b9),util['format']('%s_queue_waiting_interaction:%s',_0xce4c01,_0x3feaa5?_0x0d15('0x16'):_0x0d15('0x17')),_['pick'](_0x47932a,attributes));}var rpc={'openchannelQueueReport':require(_0x0d15('0x18')),'mailQueueReport':require(_0x0d15('0x19')),'chatQueueReport':require(_0x0d15('0x1a')),'smsQueueReport':require(_0x0d15('0x1b')),'faxQueueReport':require(_0x0d15('0x1c')),'whatsappQueueReport':require(_0x0d15('0x1d'))};var queue=schema({'name':{'type':_0x0d15('0x1e'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x46a073,_0x3f364c,_0x4e9307,_0x54e8c2){if(_0x46a073&&_0x3f364c&&_0x4e9307){_0x3f364c['waiting']+=0x1;var _0x2c25de={'uniqueid':_0x46a073,'from':_0x4e9307[_0x0d15('0x1f')]?_0x4e9307[_0x0d15('0x1f')][_0x0d15('0x11')]:'','joinAt':moment()[_0x0d15('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e9307[_0x0d15('0x20')]?_0x4e9307['contact']['id']:null,'ListId':_0x4e9307[_0x0d15('0x21')]?_0x4e9307[_0x0d15('0x21')]['id']:null};_0x2c25de[_[_0x0d15('0x22')](_0x4e9307[_0x0d15('0x23')])+'QueueId']=_0x3f364c['id']||null;_0x2c25de[_[_0x0d15('0x22')](_0x4e9307['channel'])+_0x0d15('0x24')]=_0x4e9307[_0x0d15('0x25')]?_0x4e9307[_0x0d15('0x25')]['id']:null;_0x2c25de[_[_0x0d15('0x22')](_0x4e9307[_0x0d15('0x23')])+'MessageId']=_0x4e9307[_0x0d15('0x26')]?_0x4e9307[_0x0d15('0x26')]['id']:null;_0x2c25de[_[_0x0d15('0x22')](_0x4e9307[_0x0d15('0x23')])+(_0x4e9307['channel']!=='chat'?_0x0d15('0x27'):_0x0d15('0x28'))]=_0x4e9307['account']?_0x4e9307[_0x0d15('0xf')]['id']:null;logger[_0x0d15('0x29')](util[_0x0d15('0x12')](_0x0d15('0x2a'),_0x46a073,_0x3f364c[_0x0d15('0x2b')]));emitChannelQueueInteraction(_0x4e9307[_0x0d15('0x23')],_0x3f364c[_0x0d15('0x2b')],_0x2c25de,_0x4e9307[_0x0d15('0xf')][_0x0d15('0x2b')],_0x4e9307[_0x0d15('0x26')]['id'],!![],_0x54e8c2,_0x3f364c['id']);if(rpc[_0x4e9307[_0x0d15('0x23')]+_0x0d15('0x2c')]){return rpc[_0x4e9307[_0x0d15('0x23')]+_0x0d15('0x2c')]['create'](_0x2c25de)[_0x0d15('0x2d')](function(_0x489b58){logger['error'](_0x0d15('0x2e'));});}}}function stopRouting(_0x5ada02,_0x14bc5a,_0x222877,_0x4d2e78){if(_0x5ada02&&_0x14bc5a){_0x14bc5a[_0x0d15('0x2f')]-=0x1;var _0xe34be4={'leaveAt':moment()['format'](_0x0d15('0x30')),'acceptAt':moment()[_0x0d15('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x0d15('0x29')](util[_0x0d15('0x12')](_0x0d15('0x31'),_0x5ada02,_0x14bc5a[_0x0d15('0x2b')]));emitChannelQueueInteraction(_0x222877[_0x0d15('0x23')],_0x14bc5a[_0x0d15('0x2b')],_0x222877[_0x0d15('0x1f')],_0x222877[_0x0d15('0xf')][_0x0d15('0x2b')],_0x222877['message']['id'],![],_0x4d2e78,_0x14bc5a['id']);if(rpc[_0x222877[_0x0d15('0x23')]+_0x0d15('0x2c')]){return rpc[_0x222877[_0x0d15('0x23')]+'QueueReport'][_0x0d15('0x32')](_0x5ada02,_0xe34be4)[_0x0d15('0x2d')](function(_0x447f07){logger[_0x0d15('0x33')]('update\x20queue\x20report');});}}}function endRouting(_0x53acdd,_0x12771f,_0x48cee4,_0x28dae2){if(_0x53acdd&&_0x12771f){_0x12771f[_0x0d15('0x2f')]-=0x1;var _0x4ed879={'leaveAt':moment()[_0x0d15('0x12')](_0x0d15('0x30')),'exitAt':moment()['format'](_0x0d15('0x30')),'reason':'timeout'};logger['info'](util[_0x0d15('0x12')](_0x0d15('0x34'),_0x53acdd,_0x12771f[_0x0d15('0x2b')]));emitChannelQueueInteraction(_0x48cee4[_0x0d15('0x23')],_0x12771f[_0x0d15('0x2b')],_0x48cee4[_0x0d15('0x1f')],_0x48cee4[_0x0d15('0xf')][_0x0d15('0x2b')],_0x48cee4[_0x0d15('0x26')]['id'],![],_0x28dae2);if(rpc[_0x48cee4[_0x0d15('0x23')]+_0x0d15('0x2c')]){return rpc[_0x48cee4[_0x0d15('0x23')]+_0x0d15('0x2c')][_0x0d15('0x32')](_0x53acdd,_0x4ed879)[_0x0d15('0x2d')](function(_0x3169f7){logger[_0x0d15('0x33')](_0x0d15('0x35'));});}}}function handleFindQueue(_0x454d5d){return function(_0x34537a){return _0x34537a[_0x0d15('0x2b')][_0x0d15('0x36')]()===_0x454d5d[_0x0d15('0x36')]();};}exports['consequence']=function(_0x35093f,_0x4e7142,_0x339936,_0x897e92){return function(_0x61ae14){try{var _0x1782e0={'name':_0x4e7142[0x0],'timeout':_0x4e7142[0x1]};var _0x1cf43a=queue[_0x0d15('0x0')](_0x1782e0,{'typecast':!![]});if(_0x1cf43a[_0x0d15('0x37')]){logger['error']('[%s][QUEUE]\x20%s',_0x35093f,_['map'](_0x1cf43a,_0x0d15('0x26'))['join'](',\x20'));_0x61ae14['stop']();}else{var _0x26efbc=_[_0x0d15('0x38')](_0x339936[_0x897e92['channel']+'Queues'],handleFindQueue(_0x1782e0[_0x0d15('0x2b')]));if(_0x26efbc){startRouting(_0x35093f,_0x26efbc,_0x897e92,_0x339936);var _0x253400=(_0x26efbc[_0x0d15('0x39')]||0xa)*0x3e8;var _0x474d09=(_0x1782e0[_0x0d15('0x39')]||0x14)*0x3e8;var _0x32e421,_0x2c9fb1;if(_0x253400>_0x474d09){_0x474d09=_0x253400;}var _0x52fa0e=seqqueue[_0x0d15('0x3a')](_0x253400);_0x52fa0e['id']=_0x35093f;_0x52fa0e[_0x0d15('0x3b')]=_0x253400;_0x52fa0e[_0x0d15('0x3c')]=_0x474d09;_0x52fa0e[_0x0d15('0x23')]=_0x897e92[_0x0d15('0x23')];_0x339936[_0x0d15('0x3d')][_0x35093f]['on'](_0x0d15('0x3e'),function(){logger[_0x0d15('0x29')](_0x0d15('0x3f'),_0x35093f);stopRouting(_0x35093f,_0x26efbc,_0x897e92,_0x339936);clearTimeout(_0x32e421);_0x32e421=undefined;_0x52fa0e[_0x0d15('0x40')](!![]);if(_0x339936[_0x0d15('0x3d')][_0x35093f]){delete _0x339936['rules'][_0x35093f];}_0x61ae14[_0x0d15('0x41')]();});_0x339936[_0x0d15('0x3d')][_0x35093f]['on'](_0x0d15('0x42'),function(){if(_0x339936['rules'][_0x35093f]){delete _0x339936[_0x0d15('0x3d')][_0x35093f];}});_0x32e421=setTimeout(function(){logger[_0x0d15('0x29')](_0x0d15('0x43'),_0x35093f);endRouting(_0x35093f,_0x26efbc,_0x897e92,_0x339936);clearTimeout(_0x32e421);_0x52fa0e['close'](!![]);_0x61ae14[_0x0d15('0x44')]();},_0x474d09);switch(_0x26efbc['strategy']){case'rrmemory':strategy['rrmemory'](_0x52fa0e,_0x26efbc,_0x339936,_0x897e92);break;default:strategy[_0x0d15('0x45')](_0x52fa0e,_0x26efbc,_0x339936,_0x897e92);}}else{logger[_0x0d15('0x33')](_0x0d15('0x46'),_0x35093f,_0x1782e0[_0x0d15('0x2b')]);_0x61ae14[_0x0d15('0x41')]();}}}catch(_0x5a7688){console['log'](_0x5a7688);logger[_0x0d15('0x33')]('[%s][QUEUE]\x20%s',_0x35093f,_0x5a7688[_0x0d15('0x47')]);_0x61ae14[_0x0d15('0x41')]();}};};
\ No newline at end of file
+var _0xdc72=['QueueId','InteractionId','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','catch','waiting','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','error','timeout','update','update\x20queue\x20report','toLowerCase','consequence','map','join','Queues','createQueue','atimeout','qtimeout','rules','close','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','log','[%s][QUEUE]\x20%s','validate','lodash','seq-queue','ioredis','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','joinAt','clone','format','pick','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel'];(function(_0x1466d3,_0x548355){var _0x33a113=function(_0x4f25ee){while(--_0x4f25ee){_0x1466d3['push'](_0x1466d3['shift']());}};_0x33a113(++_0x548355);}(_0xdc72,0xf6));var _0x2dc7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdc72[_0x19950b];return _0x3c6b41;};'use strict';var schema=require(_0x2dc7('0x0'));var _=require(_0x2dc7('0x1'));var util=require('util');var seqqueue=require(_0x2dc7('0x2'));var moment=require('moment');var Redis=require(_0x2dc7('0x3'));var config=require('../../../../config/environment');var logger=require(_0x2dc7('0x4'))(_0x2dc7('0x5'));var strategy=require(_0x2dc7('0x6'));config['redis']=_[_0x2dc7('0x7')](config[_0x2dc7('0x8')],{'host':_0x2dc7('0x9'),'port':0x18eb});var io=require(_0x2dc7('0xa'))(new Redis(config['redis']));var attributes=['id',_0x2dc7('0xb'),_0x2dc7('0xc'),_0x2dc7('0xd'),'from',_0x2dc7('0xe')];function emit(_0x2bd402,_0x9d2fd9,_0x5e9c3a){io['to'](_0x2bd402)['emit'](_0x9d2fd9,_0x5e9c3a);}function emitChannelQueueInteraction(_0x244a85,_0x447d4c,_0x14eab8,_0x285969,_0x299683,_0x552f96,_0x1d609c,_0x512ed1){var _0x4a5705=_[_0x2dc7('0xf')](_0x14eab8);_0x4a5705[_0x2dc7('0xb')]=_0x512ed1;_0x4a5705['queue']=_0x447d4c;_0x4a5705[_0x2dc7('0xc')]=_0x285969;_0x4a5705['id']=_0x299683;if(_0x552f96){_0x1d609c[util[_0x2dc7('0x10')]('%sQueuesWaitingInteractions',_0x244a85)][_0x299683]=_[_0x2dc7('0x11')](_0x4a5705,attributes);}else{delete _0x1d609c[util['format']('%sQueuesWaitingInteractions',_0x244a85)][_0x299683];}emit(util[_0x2dc7('0x10')]('%s:queue:%s',_0x244a85,_0x447d4c),util[_0x2dc7('0x10')](_0x2dc7('0x12'),_0x244a85,_0x552f96?'save':_0x2dc7('0x13')),_[_0x2dc7('0x11')](_0x4a5705,attributes));}var rpc={'openchannelQueueReport':require(_0x2dc7('0x14')),'mailQueueReport':require(_0x2dc7('0x15')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x2dc7('0x16')),'faxQueueReport':require(_0x2dc7('0x17')),'whatsappQueueReport':require(_0x2dc7('0x18'))};var queue=schema({'name':{'type':_0x2dc7('0x19'),'required':!![],'message':_0x2dc7('0x1a')},'timeout':{'type':_0x2dc7('0x1b'),'message':_0x2dc7('0x1c')}});function startRouting(_0x5adc87,_0x43c784,_0x2672c9,_0xbd24bc){if(_0x5adc87&&_0x43c784&&_0x2672c9){_0x43c784['waiting']+=0x1;var _0x5abc5a={'uniqueid':_0x5adc87,'from':_0x2672c9[_0x2dc7('0x1d')]?_0x2672c9['body']['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2672c9['contact']?_0x2672c9[_0x2dc7('0x1e')]['id']:null,'ListId':_0x2672c9[_0x2dc7('0x1f')]?_0x2672c9[_0x2dc7('0x1f')]['id']:null};_0x5abc5a[_[_0x2dc7('0x20')](_0x2672c9[_0x2dc7('0x21')])+_0x2dc7('0x22')]=_0x43c784['id']||null;_0x5abc5a[_[_0x2dc7('0x20')](_0x2672c9[_0x2dc7('0x21')])+_0x2dc7('0x23')]=_0x2672c9['interaction']?_0x2672c9['interaction']['id']:null;_0x5abc5a[_[_0x2dc7('0x20')](_0x2672c9[_0x2dc7('0x21')])+_0x2dc7('0x24')]=_0x2672c9[_0x2dc7('0x25')]?_0x2672c9[_0x2dc7('0x25')]['id']:null;_0x5abc5a[_[_0x2dc7('0x20')](_0x2672c9[_0x2dc7('0x21')])+(_0x2672c9[_0x2dc7('0x21')]!==_0x2dc7('0x26')?_0x2dc7('0x27'):_0x2dc7('0x28'))]=_0x2672c9[_0x2dc7('0xc')]?_0x2672c9[_0x2dc7('0xc')]['id']:null;logger[_0x2dc7('0x29')](util[_0x2dc7('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x5adc87,_0x43c784[_0x2dc7('0x2a')]));emitChannelQueueInteraction(_0x2672c9[_0x2dc7('0x21')],_0x43c784['name'],_0x5abc5a,_0x2672c9['account'][_0x2dc7('0x2a')],_0x2672c9[_0x2dc7('0x25')]['id'],!![],_0xbd24bc,_0x43c784['id']);if(rpc[_0x2672c9[_0x2dc7('0x21')]+_0x2dc7('0x2b')]){return rpc[_0x2672c9[_0x2dc7('0x21')]+_0x2dc7('0x2b')]['create'](_0x5abc5a)[_0x2dc7('0x2c')](function(_0x40e3fb){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x4ed6c5,_0x5ccc6a,_0x78fb22,_0x38d4b9){if(_0x4ed6c5&&_0x5ccc6a){_0x5ccc6a[_0x2dc7('0x2d')]-=0x1;var _0xfb9eaf={'leaveAt':moment()[_0x2dc7('0x10')](_0x2dc7('0x2e')),'acceptAt':moment()['format'](_0x2dc7('0x2e')),'reason':'accepted'};logger[_0x2dc7('0x29')](util[_0x2dc7('0x10')](_0x2dc7('0x2f'),_0x4ed6c5,_0x5ccc6a[_0x2dc7('0x2a')]));emitChannelQueueInteraction(_0x78fb22[_0x2dc7('0x21')],_0x5ccc6a[_0x2dc7('0x2a')],_0x78fb22[_0x2dc7('0x1d')],_0x78fb22[_0x2dc7('0xc')][_0x2dc7('0x2a')],_0x78fb22[_0x2dc7('0x25')]['id'],![],_0x38d4b9,_0x5ccc6a['id']);if(rpc[_0x78fb22[_0x2dc7('0x21')]+'QueueReport']){return rpc[_0x78fb22[_0x2dc7('0x21')]+'QueueReport']['update'](_0x4ed6c5,_0xfb9eaf)['catch'](function(_0x2ac7a6){logger[_0x2dc7('0x30')]('update\x20queue\x20report');});}}}function endRouting(_0x5430d7,_0x426799,_0x237ec7,_0x557a72){if(_0x5430d7&&_0x426799){_0x426799[_0x2dc7('0x2d')]-=0x1;var _0x44336b={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x2dc7('0x10')](_0x2dc7('0x2e')),'reason':_0x2dc7('0x31')};logger[_0x2dc7('0x29')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x5430d7,_0x426799[_0x2dc7('0x2a')]));emitChannelQueueInteraction(_0x237ec7[_0x2dc7('0x21')],_0x426799[_0x2dc7('0x2a')],_0x237ec7[_0x2dc7('0x1d')],_0x237ec7[_0x2dc7('0xc')]['name'],_0x237ec7[_0x2dc7('0x25')]['id'],![],_0x557a72);if(rpc[_0x237ec7['channel']+_0x2dc7('0x2b')]){return rpc[_0x237ec7[_0x2dc7('0x21')]+_0x2dc7('0x2b')][_0x2dc7('0x32')](_0x5430d7,_0x44336b)['catch'](function(_0x4dd74b){logger[_0x2dc7('0x30')](_0x2dc7('0x33'));});}}}function handleFindQueue(_0x30a2c4){return function(_0x21c7b2){return _0x21c7b2[_0x2dc7('0x2a')][_0x2dc7('0x34')]()===_0x30a2c4['toLowerCase']();};}exports[_0x2dc7('0x35')]=function(_0x5d5a4d,_0x260905,_0xec0c2e,_0x3d4793){return function(_0x74ea9f){try{var _0x901fa2={'name':_0x260905[0x0],'timeout':_0x260905[0x1]};var _0x1702b9=queue[_0x2dc7('0x0')](_0x901fa2,{'typecast':!![]});if(_0x1702b9['length']){logger[_0x2dc7('0x30')]('[%s][QUEUE]\x20%s',_0x5d5a4d,_[_0x2dc7('0x36')](_0x1702b9,_0x2dc7('0x25'))[_0x2dc7('0x37')](',\x20'));_0x74ea9f['stop']();}else{var _0x452d32=_['find'](_0xec0c2e[_0x3d4793[_0x2dc7('0x21')]+_0x2dc7('0x38')],handleFindQueue(_0x901fa2[_0x2dc7('0x2a')]));if(_0x452d32){startRouting(_0x5d5a4d,_0x452d32,_0x3d4793,_0xec0c2e);var _0x1b3e2a=(_0x452d32[_0x2dc7('0x31')]||0xa)*0x3e8;var _0x36d0d3=(_0x901fa2[_0x2dc7('0x31')]||0x14)*0x3e8;var _0x2e49f7,_0x446c27;if(_0x1b3e2a>_0x36d0d3){_0x36d0d3=_0x1b3e2a;}var _0x289a6e=seqqueue[_0x2dc7('0x39')](_0x1b3e2a);_0x289a6e['id']=_0x5d5a4d;_0x289a6e[_0x2dc7('0x3a')]=_0x1b3e2a;_0x289a6e[_0x2dc7('0x3b')]=_0x36d0d3;_0x289a6e[_0x2dc7('0x21')]=_0x3d4793['channel'];_0xec0c2e[_0x2dc7('0x3c')][_0x5d5a4d]['on']('end',function(){logger[_0x2dc7('0x29')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x5d5a4d);stopRouting(_0x5d5a4d,_0x452d32,_0x3d4793,_0xec0c2e);clearTimeout(_0x2e49f7);_0x2e49f7=undefined;_0x289a6e[_0x2dc7('0x3d')](!![]);if(_0xec0c2e[_0x2dc7('0x3c')][_0x5d5a4d]){delete _0xec0c2e['rules'][_0x5d5a4d];}_0x74ea9f['stop']();});_0xec0c2e[_0x2dc7('0x3c')][_0x5d5a4d]['on']('complete',function(){if(_0xec0c2e['rules'][_0x5d5a4d]){delete _0xec0c2e[_0x2dc7('0x3c')][_0x5d5a4d];}});_0x2e49f7=setTimeout(function(){logger[_0x2dc7('0x29')](_0x2dc7('0x3e'),_0x5d5a4d);endRouting(_0x5d5a4d,_0x452d32,_0x3d4793,_0xec0c2e);clearTimeout(_0x2e49f7);_0x289a6e[_0x2dc7('0x3d')](!![]);_0x74ea9f['next']();},_0x36d0d3);switch(_0x452d32[_0x2dc7('0x3f')]){case _0x2dc7('0x40'):strategy[_0x2dc7('0x40')](_0x289a6e,_0x452d32,_0xec0c2e,_0x3d4793);break;default:strategy[_0x2dc7('0x41')](_0x289a6e,_0x452d32,_0xec0c2e,_0x3d4793);}}else{logger[_0x2dc7('0x30')](_0x2dc7('0x42'),_0x5d5a4d,_0x901fa2[_0x2dc7('0x2a')]);_0x74ea9f[_0x2dc7('0x43')]();}}}catch(_0x4d6d98){console[_0x2dc7('0x44')](_0x4d6d98);logger[_0x2dc7('0x30')](_0x2dc7('0x45'),_0x5d5a4d,_0x4d6d98['stack']);_0x74ea9f[_0x2dc7('0x43')]();}};};
\ No newline at end of file
index f607e6c..f89995b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf277=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','showNotification','notificationId',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','isNil','realtime','agents'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xf277,0xed));var _0x7f27=function(_0x2740c2,_0x35ead0){_0x2740c2=_0x2740c2-0x0;var _0x158556=_0xf277[_0x2740c2];return _0x158556;};'use strict';var _=require(_0x7f27('0x0'));var uuid=require(_0x7f27('0x1'));var util=require(_0x7f27('0x2'));var logger=require(_0x7f27('0x3'))(_0x7f27('0x4'));var Agent=function(_0xd0882a,_0x117c9b,_0x1e0770,_0x2c5c68){this['notificationId']=uuid['v4']();this[_0x7f27('0x5')]=_0xd0882a;this[_0x7f27('0x6')]=_0x117c9b;this['realtime']=_0x1e0770;this[_0x7f27('0x4')]=_0x2c5c68;this['squeue'][_0x7f27('0x7')](this[_0x7f27('0x8')][_0x7f27('0x9')](this),this[_0x7f27('0xa')][_0x7f27('0x9')](this));this['squeue']['on'](_0x7f27('0xb'),this['handleTimeout'][_0x7f27('0x9')](this));this[_0x7f27('0x5')]['on'](_0x7f27('0xc'),this[_0x7f27('0xd')][_0x7f27('0x9')](this));};Agent[_0x7f27('0xe')]['push']=function(){this[_0x7f27('0x5')][_0x7f27('0x7')](this[_0x7f27('0x8')]['bind'](this),this[_0x7f27('0xa')]['bind'](this));};Agent[_0x7f27('0xe')][_0x7f27('0xd')]=function(){this[_0x7f27('0xa')](!![]);};Agent[_0x7f27('0xe')][_0x7f27('0x8')]=function(_0xc9648){logger[_0x7f27('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x7f27('0x5')]['id'],this[_0x7f27('0x6')]['id']);if(_[_0x7f27('0x10')](this[_0x7f27('0x11')][_0x7f27('0x12')][this[_0x7f27('0x6')]['id']])){logger[_0x7f27('0xf')](_0x7f27('0x13'),this[_0x7f27('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x7f27('0x7')][_0x7f27('0x9')](this),0x3e8);}else{if(this['routing'][_0x7f27('0x14')]||util[_0x7f27('0x15')](this[_0x7f27('0x5')]['id'],this[_0x7f27('0x11')][_0x7f27('0x12')][this[_0x7f27('0x6')]['id']],this[_0x7f27('0x5')][_0x7f27('0x16')],![])){this[_0x7f27('0x11')][_0x7f27('0x12')][this[_0x7f27('0x6')]['id']][_0x7f27('0x17')]=!![];this[_0x7f27('0x11')]['agents'][this[_0x7f27('0x6')]['id']]['busyQueue']=undefined;util[_0x7f27('0x18')](this[_0x7f27('0x19')],this[_0x7f27('0x5')]['id'],this[_0x7f27('0x11')][_0x7f27('0x12')][this[_0x7f27('0x6')]['id']],null,this[_0x7f27('0x4')]);util['writeLog'](this[_0x7f27('0x5')]['id'],this[_0x7f27('0x11')]['agents'][this[_0x7f27('0x6')]['id']],'RINGING'+(this[_0x7f27('0x4')][_0x7f27('0x14')]?_0x7f27('0x1a'):''));}else{logger[_0x7f27('0xf')](_0x7f27('0x1b'),this['squeue']['id'],this[_0x7f27('0x6')]['id']);setTimeout(this[_0x7f27('0x7')][_0x7f27('0x9')](this),0x3e8);}}};Agent[_0x7f27('0xe')][_0x7f27('0xa')]=function(_0x1e937c){if(_[_0x7f27('0x10')](this['realtime']['agents'][this[_0x7f27('0x6')]['id']])){return logger[_0x7f27('0xf')](_0x7f27('0x13'),this['squeue']['id'],this[_0x7f27('0x6')]['id']);}else{logger[_0x7f27('0xf')](_0x7f27('0x1c'),this['squeue']['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this[_0x7f27('0x5')]['id'],this[_0x7f27('0x11')]['agents'][this[_0x7f27('0x6')]['id']],null,this[_0x7f27('0x4')]);this[_0x7f27('0x11')]['agents'][this[_0x7f27('0x6')]['id']][_0x7f27('0x17')]=![];this[_0x7f27('0x11')][_0x7f27('0x12')][this[_0x7f27('0x6')]['id']][_0x7f27('0x1d')]=undefined;util['writeLog'](this[_0x7f27('0x5')]['id'],this['realtime'][_0x7f27('0x12')][this['agent']['id']],_0x1e937c?_0x7f27('0x1e'):_0x7f27('0x1f'));}if(!_0x1e937c){setTimeout(this['push'][_0x7f27('0x9')](this),0x3e8);}};function agent(_0x2631c3,_0x2e155c,_0x588f21,_0x46fd23){return new Agent(_0x2631c3,_0x2e155c,_0x588f21,_0x46fd23);}module['exports']=agent;
\ No newline at end of file
+var _0xb324=['realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','showNotification',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busyQueue','writeLog','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','agent'];(function(_0x2dad61,_0x10420e){var _0x45d9c0=function(_0x470d1e){while(--_0x470d1e){_0x2dad61['push'](_0x2dad61['shift']());}};_0x45d9c0(++_0x10420e);}(_0xb324,0x7b));var _0x4b32=function(_0x17a99f,_0x16f260){_0x17a99f=_0x17a99f-0x0;var _0x7fac92=_0xb324[_0x17a99f];return _0x7fac92;};'use strict';var _=require('lodash');var uuid=require(_0x4b32('0x0'));var util=require('./util');var logger=require(_0x4b32('0x1'))(_0x4b32('0x2'));var Agent=function(_0x169d38,_0x5bcec4,_0x53944e,_0x85662c){this[_0x4b32('0x3')]=uuid['v4']();this['squeue']=_0x169d38;this[_0x4b32('0x4')]=_0x5bcec4;this[_0x4b32('0x5')]=_0x53944e;this['routing']=_0x85662c;this[_0x4b32('0x6')][_0x4b32('0x7')](this[_0x4b32('0x8')][_0x4b32('0x9')](this),this[_0x4b32('0xa')][_0x4b32('0x9')](this));this[_0x4b32('0x6')]['on'](_0x4b32('0xb'),this[_0x4b32('0xa')][_0x4b32('0x9')](this));this['squeue']['on'](_0x4b32('0xc'),this[_0x4b32('0xd')]['bind'](this));};Agent['prototype'][_0x4b32('0x7')]=function(){this[_0x4b32('0x6')][_0x4b32('0x7')](this['handleRun']['bind'](this),this[_0x4b32('0xa')]['bind'](this));};Agent['prototype'][_0x4b32('0xd')]=function(){this[_0x4b32('0xa')](!![]);};Agent['prototype'][_0x4b32('0x8')]=function(_0x46ba81){logger[_0x4b32('0xe')](_0x4b32('0xf'),this[_0x4b32('0x6')]['id'],this[_0x4b32('0x4')]['id']);if(_[_0x4b32('0x10')](this['realtime'][_0x4b32('0x11')][this['agent']['id']])){logger[_0x4b32('0xe')](_0x4b32('0x12'),this[_0x4b32('0x6')]['id'],this[_0x4b32('0x4')]['id']);setTimeout(this[_0x4b32('0x7')][_0x4b32('0x9')](this),0x3e8);}else{if(this[_0x4b32('0x2')][_0x4b32('0x13')]||util[_0x4b32('0x14')](this[_0x4b32('0x6')]['id'],this[_0x4b32('0x5')][_0x4b32('0x11')][this[_0x4b32('0x4')]['id']],this['squeue'][_0x4b32('0x15')],![])){this['realtime'][_0x4b32('0x11')][this[_0x4b32('0x4')]['id']][_0x4b32('0x16')]=!![];this[_0x4b32('0x5')][_0x4b32('0x11')][this[_0x4b32('0x4')]['id']]['busyQueue']=undefined;util[_0x4b32('0x17')](this[_0x4b32('0x3')],this[_0x4b32('0x6')]['id'],this[_0x4b32('0x5')]['agents'][this[_0x4b32('0x4')]['id']],null,this[_0x4b32('0x2')]);util['writeLog'](this[_0x4b32('0x6')]['id'],this[_0x4b32('0x5')][_0x4b32('0x11')][this[_0x4b32('0x4')]['id']],'RINGING'+(this[_0x4b32('0x2')][_0x4b32('0x13')]?_0x4b32('0x18'):''));}else{logger[_0x4b32('0xe')](_0x4b32('0x19'),this[_0x4b32('0x6')]['id'],this[_0x4b32('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent['prototype'][_0x4b32('0xa')]=function(_0x432cfb){if(_[_0x4b32('0x10')](this[_0x4b32('0x5')][_0x4b32('0x11')][this[_0x4b32('0x4')]['id']])){return logger['info'](_0x4b32('0x12'),this['squeue']['id'],this['agent']['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x4b32('0x6')]['id'],this[_0x4b32('0x4')]['id']);util[_0x4b32('0x1a')](this[_0x4b32('0x3')],this['squeue']['id'],this[_0x4b32('0x5')][_0x4b32('0x11')][this[_0x4b32('0x4')]['id']],null,this[_0x4b32('0x2')]);this[_0x4b32('0x5')][_0x4b32('0x11')][this[_0x4b32('0x4')]['id']][_0x4b32('0x16')]=![];this[_0x4b32('0x5')][_0x4b32('0x11')][this['agent']['id']][_0x4b32('0x1b')]=undefined;util[_0x4b32('0x1c')](this[_0x4b32('0x6')]['id'],this['realtime'][_0x4b32('0x11')][this[_0x4b32('0x4')]['id']],_0x432cfb?_0x4b32('0x1d'):_0x4b32('0x1e'));}if(!_0x432cfb){setTimeout(this['push'][_0x4b32('0x9')](this),0x3e8);}};function agent(_0x562813,_0x1a9d40,_0x49db5d,_0x2643bc){return new Agent(_0x562813,_0x1a9d40,_0x49db5d,_0x2643bc);}module[_0x4b32('0x1f')]=agent;
\ No newline at end of file
index faaef67..40093bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x510e=['TIMEOUT','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','Agents','length','isNil','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','showNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP'];(function(_0xbb0463,_0x5b9cbf){var _0x51091d=function(_0x59a328){while(--_0x59a328){_0xbb0463['push'](_0xbb0463['shift']());}};_0x51091d(++_0x5b9cbf);}(_0x510e,0x1ed));var _0xe510=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x510e[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0xe510('0x0'));var uuid=require(_0xe510('0x1'));var util=require(_0xe510('0x2'));var logger=require(_0xe510('0x3'))(_0xe510('0x4'));var Beepall=function(_0x511b97,_0x31d884,_0x2a9a5b,_0x3cd0a5){this['notificationId']=uuid['v4']();this[_0xe510('0x5')]=_0x511b97;this[_0xe510('0x6')]=_0x31d884;this[_0xe510('0x7')]=_0x2a9a5b;this[_0xe510('0x4')]=_0x3cd0a5;this[_0xe510('0x5')][_0xe510('0x8')](this[_0xe510('0x9')][_0xe510('0xa')](this),this[_0xe510('0xb')][_0xe510('0xa')](this));this[_0xe510('0x5')]['on'](_0xe510('0xc'),this[_0xe510('0xb')][_0xe510('0xa')](this));this['squeue']['on'](_0xe510('0xd'),this[_0xe510('0xe')][_0xe510('0xa')](this));};Beepall[_0xe510('0xf')][_0xe510('0x8')]=function(){this[_0xe510('0x5')]['push'](this[_0xe510('0x9')][_0xe510('0xa')](this),this[_0xe510('0xb')][_0xe510('0xa')](this));};Beepall[_0xe510('0xf')][_0xe510('0xe')]=function(_0xed4536){this[_0xe510('0xb')](!![]);};Beepall[_0xe510('0xf')][_0xe510('0x9')]=function(_0x2c92d8){var _0x1ebbdd=!![];if(!_['isNil'](this[_0xe510('0x6')])&&!_['isNil'](this['queue'][_0xe510('0x10')])&&this[_0xe510('0x6')][_0xe510('0x10')][_0xe510('0x11')]>0x0){for(var _0x9b92b0=0x0,_0x1754e;_0x9b92b0<this[_0xe510('0x6')][_0xe510('0x10')]['length'];_0x9b92b0+=0x1){_0x1754e=this[_0xe510('0x6')][_0xe510('0x10')][_0x9b92b0]['id'];if(_[_0xe510('0x12')](this[_0xe510('0x7')][_0xe510('0x13')][_0x1754e])){logger[_0xe510('0x14')](_0xe510('0x15'),this['squeue']['id'],_0x1754e);}else{if(util[_0xe510('0x16')](this[_0xe510('0x5')]['id'],this['realtime'][_0xe510('0x13')][_0x1754e],this[_0xe510('0x5')]['channel'],!![])){_0x1ebbdd=![];util[_0xe510('0x17')](this[_0xe510('0x5')]['id'],this['realtime'][_0xe510('0x13')][_0x1754e],_0xe510('0x18'));this[_0xe510('0x7')][_0xe510('0x13')][_0x1754e][_0xe510('0x19')]=!![];this['realtime'][_0xe510('0x13')][_0x1754e]['busyQueue']=this['queue']['name'];util[_0xe510('0x1a')](this[_0xe510('0x1b')],this['squeue']['id'],this[_0xe510('0x7')]['agents'][_0x1754e],this[_0xe510('0x6')],this[_0xe510('0x4')]);}}}if(_0x1ebbdd){logger[_0xe510('0x14')](_0xe510('0x1c'),this[_0xe510('0x5')]['id']);setTimeout(this[_0xe510('0x8')][_0xe510('0xa')](this),0x3e8);}}else{logger[_0xe510('0x14')](_0xe510('0x1d'),this[_0xe510('0x5')]['id']);setTimeout(this[_0xe510('0x8')]['bind'](this),0x3e8);}};Beepall[_0xe510('0xf')][_0xe510('0xb')]=function(_0x49a33f){if(!_['isNil'](this[_0xe510('0x6')])&&!_[_0xe510('0x12')](this['queue'][_0xe510('0x10')])){for(var _0x40008f=0x0,_0x99cd01;_0x40008f<this[_0xe510('0x6')][_0xe510('0x10')]['length'];_0x40008f+=0x1){_0x99cd01=this[_0xe510('0x6')][_0xe510('0x10')][_0x40008f]['id'];if(_[_0xe510('0x12')](this[_0xe510('0x7')][_0xe510('0x13')][_0x99cd01])){logger[_0xe510('0x14')](_0xe510('0x15'),this[_0xe510('0x5')]['id'],_0x99cd01);}else{util[_0xe510('0x1e')](this[_0xe510('0x1b')],this['squeue']['id'],this[_0xe510('0x7')][_0xe510('0x13')][_0x99cd01],this[_0xe510('0x6')],this[_0xe510('0x4')]);util[_0xe510('0x17')](this[_0xe510('0x5')]['id'],this[_0xe510('0x7')][_0xe510('0x13')][_0x99cd01],_0x49a33f?_0xe510('0x1f'):_0xe510('0x20'));this[_0xe510('0x7')][_0xe510('0x13')][_0x99cd01][_0xe510('0x19')]=![];this[_0xe510('0x7')][_0xe510('0x13')][_0x99cd01][_0xe510('0x21')]=undefined;}}}if(!_0x49a33f){setTimeout(this[_0xe510('0x8')]['bind'](this),0x3e8);}};function beepall(_0x3943b4,_0x32daa9,_0x56c356,_0x54950f){return new Beepall(_0x3943b4,_0x32daa9,_0x56c356,_0x54950f);}module[_0xe510('0x22')]=beepall;
\ No newline at end of file
+var _0x49df=['prototype','hideNotification','writeLog','STOP','exports','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','bind','handleTimeout','drained','handleDrained','handleRun','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','name','showNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x49df,0xad));var _0xf49d=function(_0x56b540,_0x37f450){_0x56b540=_0x56b540-0x0;var _0xf62ffc=_0x49df[_0x56b540];return _0xf62ffc;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xf49d('0x0'));var logger=require(_0xf49d('0x1'))(_0xf49d('0x2'));var Beepall=function(_0x21eb98,_0x3d07cf,_0x1ff84c,_0x44b37e){this['notificationId']=uuid['v4']();this[_0xf49d('0x3')]=_0x21eb98;this[_0xf49d('0x4')]=_0x3d07cf;this[_0xf49d('0x5')]=_0x1ff84c;this[_0xf49d('0x2')]=_0x44b37e;this[_0xf49d('0x3')][_0xf49d('0x6')](this['handleRun'][_0xf49d('0x7')](this),this[_0xf49d('0x8')][_0xf49d('0x7')](this));this['squeue']['on']('timeout',this[_0xf49d('0x8')]['bind'](this));this['squeue']['on'](_0xf49d('0x9'),this[_0xf49d('0xa')][_0xf49d('0x7')](this));};Beepall['prototype'][_0xf49d('0x6')]=function(){this[_0xf49d('0x3')]['push'](this[_0xf49d('0xb')]['bind'](this),this['handleTimeout'][_0xf49d('0x7')](this));};Beepall['prototype'][_0xf49d('0xa')]=function(_0x26be7f){this[_0xf49d('0x8')](!![]);};Beepall['prototype'][_0xf49d('0xb')]=function(_0x3a03b4){var _0x3bf84f=!![];if(!_['isNil'](this[_0xf49d('0x4')])&&!_[_0xf49d('0xc')](this[_0xf49d('0x4')][_0xf49d('0xd')])&&this['queue'][_0xf49d('0xd')][_0xf49d('0xe')]>0x0){for(var _0x349c20=0x0,_0x13b846;_0x349c20<this[_0xf49d('0x4')][_0xf49d('0xd')][_0xf49d('0xe')];_0x349c20+=0x1){_0x13b846=this[_0xf49d('0x4')]['Agents'][_0x349c20]['id'];if(_[_0xf49d('0xc')](this[_0xf49d('0x5')][_0xf49d('0xf')][_0x13b846])){logger[_0xf49d('0x10')](_0xf49d('0x11'),this[_0xf49d('0x3')]['id'],_0x13b846);}else{if(util[_0xf49d('0x12')](this[_0xf49d('0x3')]['id'],this[_0xf49d('0x5')][_0xf49d('0xf')][_0x13b846],this[_0xf49d('0x3')]['channel'],!![])){_0x3bf84f=![];util['writeLog'](this[_0xf49d('0x3')]['id'],this[_0xf49d('0x5')]['agents'][_0x13b846],'RINGING');this[_0xf49d('0x5')][_0xf49d('0xf')][_0x13b846]['busy']=!![];this['realtime'][_0xf49d('0xf')][_0x13b846]['busyQueue']=this[_0xf49d('0x4')][_0xf49d('0x13')];util[_0xf49d('0x14')](this[_0xf49d('0x15')],this['squeue']['id'],this[_0xf49d('0x5')][_0xf49d('0xf')][_0x13b846],this[_0xf49d('0x4')],this[_0xf49d('0x2')]);}}}if(_0x3bf84f){logger[_0xf49d('0x10')](_0xf49d('0x16'),this[_0xf49d('0x3')]['id']);setTimeout(this[_0xf49d('0x6')][_0xf49d('0x7')](this),0x3e8);}}else{logger[_0xf49d('0x10')]('[%s][QUEUE]\x20EMPTY',this['squeue']['id']);setTimeout(this[_0xf49d('0x6')][_0xf49d('0x7')](this),0x3e8);}};Beepall[_0xf49d('0x17')][_0xf49d('0x8')]=function(_0x43e868){if(!_[_0xf49d('0xc')](this[_0xf49d('0x4')])&&!_['isNil'](this[_0xf49d('0x4')][_0xf49d('0xd')])){for(var _0x17eb47=0x0,_0x280fd4;_0x17eb47<this[_0xf49d('0x4')][_0xf49d('0xd')][_0xf49d('0xe')];_0x17eb47+=0x1){_0x280fd4=this[_0xf49d('0x4')][_0xf49d('0xd')][_0x17eb47]['id'];if(_[_0xf49d('0xc')](this['realtime']['agents'][_0x280fd4])){logger[_0xf49d('0x10')](_0xf49d('0x11'),this['squeue']['id'],_0x280fd4);}else{util[_0xf49d('0x18')](this[_0xf49d('0x15')],this[_0xf49d('0x3')]['id'],this['realtime'][_0xf49d('0xf')][_0x280fd4],this[_0xf49d('0x4')],this[_0xf49d('0x2')]);util[_0xf49d('0x19')](this[_0xf49d('0x3')]['id'],this[_0xf49d('0x5')][_0xf49d('0xf')][_0x280fd4],_0x43e868?_0xf49d('0x1a'):'TIMEOUT');this[_0xf49d('0x5')][_0xf49d('0xf')][_0x280fd4]['busy']=![];this[_0xf49d('0x5')][_0xf49d('0xf')][_0x280fd4]['busyQueue']=undefined;}}}if(!_0x43e868){setTimeout(this[_0xf49d('0x6')][_0xf49d('0x7')](this),0x3e8);}};function beepall(_0x577d6e,_0x1589e6,_0x11b59a,_0x637c64){return new Beepall(_0x577d6e,_0x1589e6,_0x11b59a,_0x637c64);}module[_0xf49d('0x1b')]=beepall;
\ No newline at end of file
index a6725c5..0194adf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd858=['./beepall','./agent','exports'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0xd858,0xbc));var _0x8d85=function(_0x22463c,_0x155b51){_0x22463c=_0x22463c-0x0;var _0x54106f=_0xd858[_0x22463c];return _0x54106f;};'use strict';module[_0x8d85('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x8d85('0x1')),'agent':require(_0x8d85('0x2'))};
\ No newline at end of file
+var _0x78b6=['./agent','exports','./rrmemory'];(function(_0x35fa69,_0x423f25){var _0x35a0f8=function(_0x28975a){while(--_0x28975a){_0x35fa69['push'](_0x35fa69['shift']());}};_0x35a0f8(++_0x423f25);}(_0x78b6,0x157));var _0x678b=function(_0x35c4c9,_0x2cdabb){_0x35c4c9=_0x35c4c9-0x0;var _0x36e68b=_0x78b6[_0x35c4c9];return _0x36e68b;};'use strict';module[_0x678b('0x0')]={'rrmemory':require(_0x678b('0x1')),'beepall':require('./beepall'),'agent':require(_0x678b('0x2'))};
\ No newline at end of file
index f37a3d3..c839559 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cb6=['RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','TIMEOUT','busyQueue','exports','uuid','../../../../../config/logger','routing','squeue','queue','realtime','intervals','handleRun','bind','handleTimeout','module','timeout','drained','handleDrained','push','prototype','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','mapAgentsId','isNil','done','busy','name','notificationId','writeLog'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x2cb6,0xc0));var _0x62cb=function(_0x4957f2,_0x5b4d29){_0x4957f2=_0x4957f2-0x0;var _0x1d9732=_0x2cb6[_0x4957f2];return _0x1d9732;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x62cb('0x0'));var util=require('./util');var logger=require(_0x62cb('0x1'))(_0x62cb('0x2'));var RRMemory=function(_0x302266,_0x340c01,_0xdb70b7,_0x107870){this['notificationId']=uuid['v4']();this[_0x62cb('0x3')]=_0x302266;this[_0x62cb('0x4')]=_0x340c01;this[_0x62cb('0x5')]=_0xdb70b7;this[_0x62cb('0x2')]=_0x107870;this[_0x62cb('0x6')]={};this[_0x62cb('0x3')]['push'](this[_0x62cb('0x7')][_0x62cb('0x8')](this),this[_0x62cb('0x9')]['bind'](this),this[_0x62cb('0xa')]);this['squeue']['on'](_0x62cb('0xb'),this[_0x62cb('0x9')]['bind'](this));this[_0x62cb('0x3')]['on'](_0x62cb('0xc'),this[_0x62cb('0xd')]['bind'](this));};RRMemory['prototype'][_0x62cb('0xe')]=function(){this[_0x62cb('0x3')]['push'](this['handleRun']['bind'](this),this[_0x62cb('0x9')][_0x62cb('0x8')](this));};RRMemory['prototype'][_0x62cb('0xd')]=function(_0x1540c1){this[_0x62cb('0x9')](!![]);};RRMemory[_0x62cb('0xf')][_0x62cb('0x10')]=function(_0x29f5a1){if(util[_0x62cb('0x11')](this[_0x62cb('0x3')]['id'],this['realtime'][_0x62cb('0x12')][this[_0x62cb('0x13')]],this[_0x62cb('0x3')][_0x62cb('0x14')],!![])){logger[_0x62cb('0x15')](_0x62cb('0x16'),this['squeue']['id'],this[_0x62cb('0x13')]);clearInterval(this[_0x62cb('0x6')][this[_0x62cb('0x13')]]);_0x29f5a1['done']();setTimeout(this[_0x62cb('0xe')][_0x62cb('0x8')](this),0x3e8);}};RRMemory[_0x62cb('0xf')][_0x62cb('0x7')]=function(_0x3dcd41){this[_0x62cb('0x13')]=rr(this['queue'][_0x62cb('0x17')]);logger[_0x62cb('0x15')]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0x62cb('0x3')]['id'],this['agentId']);if(_[_0x62cb('0x18')](this[_0x62cb('0x5')][_0x62cb('0x12')][this['agentId']])){logger[_0x62cb('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x62cb('0x3')]['id'],this[_0x62cb('0x13')]);_0x3dcd41[_0x62cb('0x19')]();setTimeout(this['push'][_0x62cb('0x8')](this),0x3e8);}else{if(util[_0x62cb('0x11')](this['squeue']['id'],this[_0x62cb('0x5')][_0x62cb('0x12')][this[_0x62cb('0x13')]],this[_0x62cb('0x3')]['channel'],!![])){this[_0x62cb('0x5')][_0x62cb('0x12')][this['agentId']][_0x62cb('0x1a')]=!![];this['realtime'][_0x62cb('0x12')][this[_0x62cb('0x13')]]['busyQueue']=this[_0x62cb('0x4')][_0x62cb('0x1b')];util['showNotification'](this[_0x62cb('0x1c')],this['squeue']['id'],this[_0x62cb('0x5')][_0x62cb('0x12')][this[_0x62cb('0x13')]],this[_0x62cb('0x4')],this['routing']);util[_0x62cb('0x1d')](this[_0x62cb('0x3')]['id'],this['realtime'][_0x62cb('0x12')][this['agentId']],_0x62cb('0x1e'));this['intervals'][this[_0x62cb('0x13')]]=setInterval(this[_0x62cb('0x10')][_0x62cb('0x8')](this,_0x3dcd41),0x3e8);}else{logger[_0x62cb('0x15')](_0x62cb('0x1f'),this[_0x62cb('0x3')]['id'],this[_0x62cb('0x13')]);_0x3dcd41[_0x62cb('0x19')]();setTimeout(this[_0x62cb('0xe')][_0x62cb('0x8')](this),0x3e8);}}};RRMemory[_0x62cb('0xf')][_0x62cb('0x9')]=function(_0x2b6d9d){logger[_0x62cb('0x15')](_0x62cb('0x20'),this[_0x62cb('0x3')]['id'],this['agentId']);if(_[_0x62cb('0x18')](this[_0x62cb('0x5')][_0x62cb('0x12')][this[_0x62cb('0x13')]])){logger[_0x62cb('0x15')](_0x62cb('0x21'),this[_0x62cb('0x3')]['id'],this[_0x62cb('0x13')]);}else{clearInterval(this[_0x62cb('0x6')][this[_0x62cb('0x13')]]);util['hideNotification'](this['notificationId'],this['squeue']['id'],this[_0x62cb('0x5')][_0x62cb('0x12')][this[_0x62cb('0x13')]],this['queue'],this[_0x62cb('0x2')]);util[_0x62cb('0x1d')](this[_0x62cb('0x3')]['id'],this['realtime']['agents'][this[_0x62cb('0x13')]],_0x62cb('0x22'));this['realtime']['agents'][this[_0x62cb('0x13')]][_0x62cb('0x1a')]=![];this[_0x62cb('0x5')]['agents'][this[_0x62cb('0x13')]][_0x62cb('0x23')]=undefined;}if(!_0x2b6d9d){setTimeout(this[_0x62cb('0xe')][_0x62cb('0x8')](this),0x3e8);}};function rrmemory(_0x251b66,_0x2dde3c,_0x40875b,_0x5749ee){return new RRMemory(_0x251b66,_0x2dde3c,_0x40875b,_0x5749ee);}module[_0x62cb('0x24')]=rrmemory;
\ No newline at end of file
+var _0x203b=['name','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','TIMEOUT','exports','lodash','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','bind','module','timeout','handleTimeout','drained','handleDrained','prototype','push','handleRun','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','intervals','done','mapAgentsId','busy','busyQueue'];(function(_0x20efe6,_0x2d6285){var _0x2680c2=function(_0x1c969b){while(--_0x1c969b){_0x20efe6['push'](_0x20efe6['shift']());}};_0x2680c2(++_0x2d6285);}(_0x203b,0x1b8));var _0xb203=function(_0x4de864,_0x581d15){_0x4de864=_0x4de864-0x0;var _0x20c83d=_0x203b[_0x4de864];return _0x20c83d;};'use strict';var rr=require('rr');var _=require(_0xb203('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0xb203('0x1'))(_0xb203('0x2'));var RRMemory=function(_0x242296,_0x43bd14,_0x26150,_0x2f2fb6){this[_0xb203('0x3')]=uuid['v4']();this['squeue']=_0x242296;this[_0xb203('0x4')]=_0x43bd14;this[_0xb203('0x5')]=_0x26150;this[_0xb203('0x2')]=_0x2f2fb6;this['intervals']={};this[_0xb203('0x6')]['push'](this['handleRun'][_0xb203('0x7')](this),this['handleTimeout'][_0xb203('0x7')](this),this[_0xb203('0x8')]);this['squeue']['on'](_0xb203('0x9'),this[_0xb203('0xa')][_0xb203('0x7')](this));this[_0xb203('0x6')]['on'](_0xb203('0xb'),this[_0xb203('0xc')]['bind'](this));};RRMemory[_0xb203('0xd')][_0xb203('0xe')]=function(){this[_0xb203('0x6')][_0xb203('0xe')](this[_0xb203('0xf')]['bind'](this),this[_0xb203('0xa')][_0xb203('0x7')](this));};RRMemory[_0xb203('0xd')]['handleDrained']=function(_0x24e0c7){this['handleTimeout'](!![]);};RRMemory[_0xb203('0xd')][_0xb203('0x10')]=function(_0x8ab335){if(util[_0xb203('0x11')](this['squeue']['id'],this['realtime'][_0xb203('0x12')][this[_0xb203('0x13')]],this[_0xb203('0x6')][_0xb203('0x14')],!![])){logger[_0xb203('0x15')](_0xb203('0x16'),this[_0xb203('0x6')]['id'],this[_0xb203('0x13')]);clearInterval(this[_0xb203('0x17')][this[_0xb203('0x13')]]);_0x8ab335[_0xb203('0x18')]();setTimeout(this['push'][_0xb203('0x7')](this),0x3e8);}};RRMemory[_0xb203('0xd')][_0xb203('0xf')]=function(_0x497bf5){this[_0xb203('0x13')]=rr(this[_0xb203('0x4')][_0xb203('0x19')]);logger['info']('[%s][QUEUE]\x20try\x20with\x20%s',this[_0xb203('0x6')]['id'],this[_0xb203('0x13')]);if(_['isNil'](this[_0xb203('0x5')]['agents'][this[_0xb203('0x13')]])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb203('0x6')]['id'],this['agentId']);_0x497bf5[_0xb203('0x18')]();setTimeout(this[_0xb203('0xe')]['bind'](this),0x3e8);}else{if(util[_0xb203('0x11')](this[_0xb203('0x6')]['id'],this['realtime'][_0xb203('0x12')][this['agentId']],this[_0xb203('0x6')][_0xb203('0x14')],!![])){this[_0xb203('0x5')]['agents'][this[_0xb203('0x13')]][_0xb203('0x1a')]=!![];this[_0xb203('0x5')][_0xb203('0x12')][this[_0xb203('0x13')]][_0xb203('0x1b')]=this[_0xb203('0x4')][_0xb203('0x1c')];util[_0xb203('0x1d')](this[_0xb203('0x3')],this[_0xb203('0x6')]['id'],this[_0xb203('0x5')][_0xb203('0x12')][this['agentId']],this['queue'],this[_0xb203('0x2')]);util[_0xb203('0x1e')](this[_0xb203('0x6')]['id'],this[_0xb203('0x5')]['agents'][this[_0xb203('0x13')]],_0xb203('0x1f'));this['intervals'][this[_0xb203('0x13')]]=setInterval(this['handleCheckReject']['bind'](this,_0x497bf5),0x3e8);}else{logger[_0xb203('0x15')](_0xb203('0x20'),this['squeue']['id'],this[_0xb203('0x13')]);_0x497bf5[_0xb203('0x18')]();setTimeout(this[_0xb203('0xe')][_0xb203('0x7')](this),0x3e8);}}};RRMemory[_0xb203('0xd')][_0xb203('0xa')]=function(_0x861111){logger['info'](_0xb203('0x21'),this['squeue']['id'],this[_0xb203('0x13')]);if(_[_0xb203('0x22')](this['realtime']['agents'][this[_0xb203('0x13')]])){logger[_0xb203('0x15')](_0xb203('0x23'),this[_0xb203('0x6')]['id'],this[_0xb203('0x13')]);}else{clearInterval(this['intervals'][this[_0xb203('0x13')]]);util[_0xb203('0x24')](this[_0xb203('0x3')],this['squeue']['id'],this[_0xb203('0x5')][_0xb203('0x12')][this[_0xb203('0x13')]],this[_0xb203('0x4')],this[_0xb203('0x2')]);util['writeLog'](this['squeue']['id'],this['realtime']['agents'][this[_0xb203('0x13')]],_0xb203('0x25'));this[_0xb203('0x5')][_0xb203('0x12')][this['agentId']][_0xb203('0x1a')]=![];this[_0xb203('0x5')][_0xb203('0x12')][this[_0xb203('0x13')]][_0xb203('0x1b')]=undefined;}if(!_0x861111){setTimeout(this[_0xb203('0xe')][_0xb203('0x7')](this),0x3e8);}};function rrmemory(_0x20df5d,_0x5eede3,_0x3bf3c1,_0x7a9e77){return new RRMemory(_0x20df5d,_0x5eede3,_0x3bf3c1,_0x7a9e77);}module[_0xb203('0x26')]=rrmemory;
\ No newline at end of file
index 0502a88..9f69dd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0424=['localhost','socket.io-emitter','format','user:%s','name','emit','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','notification:%s','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','OFFLINE','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','../utils','mustache','ioredis','../../../../../config/environment','routing','redis'];(function(_0xf98f2a,_0x231423){var _0xdd6dd6=function(_0x424c28){while(--_0x424c28){_0xf98f2a['push'](_0xf98f2a['shift']());}};_0xdd6dd6(++_0x231423);}(_0x0424,0x159));var _0x4042=function(_0x40aaa4,_0x3b22f4){_0x40aaa4=_0x40aaa4-0x0;var _0x4e21e5=_0x0424[_0x40aaa4];return _0x4e21e5;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x4042('0x0'));var Mustache=require(_0x4042('0x1'));var Redis=require(_0x4042('0x2'));var config=require(_0x4042('0x3'));var logger=require('../../../../../config/logger')(_0x4042('0x4'));config['redis']=_['defaults'](config[_0x4042('0x5')],{'host':_0x4042('0x6'),'port':0x18eb});var io=require(_0x4042('0x7'))(new Redis(config[_0x4042('0x5')]));function emit(_0x3abaf1,_0xa5310f,_0x10ec07){io['to'](_0x3abaf1)['emit'](_0xa5310f,_0x10ec07);}function sendNotification(_0x509772,_0x280cd6,_0x117143,_0x103e4a,_0x4b92d2,_0x341152){io['to'](util[_0x4042('0x8')](_0x4042('0x9'),_0x103e4a[_0x4042('0xa')]))[_0x4042('0xb')](_0x4042('0xc'),_0x103e4a);var _0x380aa0=_0x341152||{};var _0x3b5a73=_0x117143['split']('.');var _0x2c06ae={'uniqueid':_0x280cd6,'channel':_0x3b5a73[0x0],'id':_0x3b5a73[0x1],'title':_0x3b5a73[0x0]+_0x4042('0xd'),'interactionId':_0x3b5a73[0x2],'queue':_0x4b92d2?_0x4b92d2['name']:null,'sound':_0x380aa0[_0x4042('0xe')][_0x4042('0xf')],'shake':_0x380aa0[_0x4042('0xe')][_0x4042('0x10')]};try{if(!_0x380aa0[_0x4042('0x11')]){_0x380aa0[_0x4042('0x11')]={};}if(_0x4b92d2){_0x380aa0[_0x4042('0x11')]['queue']=_0x4b92d2;}else if(_0x380aa0[_0x4042('0x11')][_0x4042('0x12')]){delete _0x380aa0['body'][_0x4042('0x12')];}_0x2c06ae[_0x4042('0x13')]=utils[_0x4042('0x14')](_0x380aa0[_0x4042('0xe')][_0x4042('0x15')],_0x380aa0);}catch(_0x4532b7){_0x2c06ae[_0x4042('0x13')]=_0x4042('0x16');logger[_0x4042('0x17')](util['format'](_0x4042('0x18'),_0x280cd6,_0x4532b7['message']));}io['to'](util[_0x4042('0x8')]('user:%s',_0x103e4a[_0x4042('0xa')]))[_0x4042('0xb')](util[_0x4042('0x8')](_0x4042('0x19'),_0x509772?'save':_0x4042('0x1a')),_0x2c06ae);}function writeLog(_0x4561e3,_0x14d36c,_0xd1ddb){return logger['info'](util[_0x4042('0x8')](_0x4042('0x1b'),_0x4561e3,_0x14d36c[_0x4042('0xa')],_0xd1ddb));}exports[_0x4042('0x1c')]=function(_0x352631,_0x548093,_0x1f9d4a,_0x6d12a5){if(_0x548093['busy']){writeLog(_0x352631,_0x548093,_0x4042('0x1d'));return![];}if(!_0x548093['online']){writeLog(_0x352631,_0x548093,_0x4042('0x1e'));return![];}if(_0x548093[_0x1f9d4a+_0x4042('0x1f')]){writeLog(_0x352631,_0x548093,_0x4042('0x20'));return![];}if(_0x6d12a5&&_0x548093['hasOwnProperty'](_0x1f9d4a+_0x4042('0x21'))&&_0x548093[_0x4042('0x22')](_0x1f9d4a+_0x4042('0x23'))){if(_0x548093[_0x1f9d4a+_0x4042('0x21')]>0x0&&_0x548093[_0x1f9d4a+_0x4042('0x23')]>=_0x548093[_0x1f9d4a+'Capacity']){writeLog(_0x352631,_0x548093,_0x1f9d4a['toUpperCase']()+_0x4042('0x24'));return![];}}return!![];};exports[_0x4042('0x25')]=function(_0x26542c,_0x3e5c02,_0x332fe3,_0x473a0d,_0x5eb84b){return sendNotification(!![],_0x26542c,_0x3e5c02,_0x332fe3,_0x473a0d,_0x5eb84b);};exports[_0x4042('0x26')]=function(_0x1e9bd7,_0x4a6a6e,_0xae26c2,_0x89e16,_0xe924fe){return sendNotification(![],_0x1e9bd7,_0x4a6a6e,_0xae26c2,_0x89e16,_0xe924fe);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x4819=['format','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','online','OFFLINE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction','notificationSound','account','notificationShake','body','queue','msg','notificationTemplate'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x4819,0xcd));var _0x9481=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x4819[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var utils=require(_0x9481('0x1'));var Mustache=require(_0x9481('0x2'));var Redis=require(_0x9481('0x3'));var config=require(_0x9481('0x4'));var logger=require(_0x9481('0x5'))(_0x9481('0x6'));config[_0x9481('0x7')]=_[_0x9481('0x8')](config[_0x9481('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9481('0x9'))(new Redis(config['redis']));function emit(_0x54cc78,_0x14e05a,_0x6c6a08){io['to'](_0x54cc78)[_0x9481('0xa')](_0x14e05a,_0x6c6a08);}function sendNotification(_0x3278ff,_0x15d895,_0x4c7d9c,_0x1818cf,_0x521d18,_0x2fabf1){io['to'](util['format'](_0x9481('0xb'),_0x1818cf[_0x9481('0xc')]))[_0x9481('0xa')](_0x9481('0xd'),_0x1818cf);var _0xe84f77=_0x2fabf1||{};var _0x29515a=_0x4c7d9c[_0x9481('0xe')]('.');var _0xe410c3={'uniqueid':_0x15d895,'channel':_0x29515a[0x0],'id':_0x29515a[0x1],'title':_0x29515a[0x0]+_0x9481('0xf'),'interactionId':_0x29515a[0x2],'queue':_0x521d18?_0x521d18['name']:null,'sound':_0xe84f77['account'][_0x9481('0x10')],'shake':_0xe84f77[_0x9481('0x11')][_0x9481('0x12')]};try{if(!_0xe84f77[_0x9481('0x13')]){_0xe84f77[_0x9481('0x13')]={};}if(_0x521d18){_0xe84f77[_0x9481('0x13')][_0x9481('0x14')]=_0x521d18;}else if(_0xe84f77['body'][_0x9481('0x14')]){delete _0xe84f77[_0x9481('0x13')]['queue'];}_0xe410c3[_0x9481('0x15')]=utils['getMustacheRender'](_0xe84f77[_0x9481('0x11')][_0x9481('0x16')],_0xe84f77);}catch(_0x2bc12a){_0xe410c3[_0x9481('0x15')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x9481('0x17')]('[%s][QUEUE]\x20%s',_0x15d895,_0x2bc12a['message']));}io['to'](util[_0x9481('0x17')](_0x9481('0xb'),_0x1818cf[_0x9481('0xc')]))[_0x9481('0xa')](util[_0x9481('0x17')](_0x9481('0x18'),_0x3278ff?'save':_0x9481('0x19')),_0xe410c3);}function writeLog(_0x272a84,_0x45f9df,_0x615e02){return logger[_0x9481('0x1a')](util['format'](_0x9481('0x1b'),_0x272a84,_0x45f9df[_0x9481('0xc')],_0x615e02));}exports['isAgentAvailable']=function(_0x2bcf37,_0xd1cd1a,_0x352b3a,_0x1809d2){if(_0xd1cd1a[_0x9481('0x1c')]){writeLog(_0x2bcf37,_0xd1cd1a,'BUSY');return![];}if(!_0xd1cd1a[_0x9481('0x1d')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x9481('0x1e'));return![];}if(_0xd1cd1a[_0x352b3a+'Pause']){writeLog(_0x2bcf37,_0xd1cd1a,'PAUSE');return![];}if(_0x1809d2&&_0xd1cd1a[_0x9481('0x1f')](_0x352b3a+_0x9481('0x20'))&&_0xd1cd1a['hasOwnProperty'](_0x352b3a+_0x9481('0x21'))){if(_0xd1cd1a[_0x352b3a+_0x9481('0x20')]>0x0&&_0xd1cd1a[_0x352b3a+_0x9481('0x21')]>=_0xd1cd1a[_0x352b3a+_0x9481('0x20')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x352b3a['toUpperCase']()+_0x9481('0x22'));return![];}}return!![];};exports[_0x9481('0x23')]=function(_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff){return sendNotification(!![],_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff);};exports[_0x9481('0x24')]=function(_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff){return sendNotification(![],_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff);};exports[_0x9481('0x25')]=writeLog;
\ No newline at end of file
index 14aa700..3deacb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x225c=['../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','body','validate','shelljs'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x225c,0x106));var _0xc225=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x225c[_0x14add3];return _0x4a174f;};'use strict';var schema=require(_0xc225('0x0'));var sh=require(_0xc225('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xc225('0x2'))('routing');var system=schema({'command':{'type':_0xc225('0x3'),'required':!![],'message':_0xc225('0x4')}});exports[_0xc225('0x5')]=function(_0x41eccd,_0x7a87bf){return function(_0x26044b){try{var _0x22d294={'command':_0x7a87bf[0x0]};var _0x54be3a=system[_0xc225('0x0')](_0x22d294,{'typecast':!![]});if(_0x54be3a[_0xc225('0x6')]){logger[_0xc225('0x7')](_0xc225('0x8'),_0x41eccd,_[_0xc225('0x9')](_0x54be3a,'message')[_0xc225('0xa')](',\x20'));logger['info'](_0xc225('0xb'),_0x41eccd);_0x26044b[_0xc225('0xc')]();}else{var _0x238dbf=this;var _0x52727e=utils[_0xc225('0xd')](_0x7a87bf[0x0],this);logger[_0xc225('0xe')](_0xc225('0xf'),_0x41eccd,_0x52727e);sh[_0xc225('0x10')](_[_0xc225('0x11')](_0x52727e),function(_0x5797e3,_0x34f8c9){logger[_0xc225('0xe')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x41eccd,_0x5797e3);if(_0x5797e3==0x0){var _0x57189b=_0x34f8c9[_0xc225('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xc225('0x13')](_0x7a87bf[0x1])||_[_0xc225('0x14')](_0x7a87bf[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x41eccd);_0x238dbf['body'][_0x7a87bf[0x1]]=_0x57189b;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x41eccd,_0x7a87bf[0x1],_0x57189b);_0x238dbf[_0xc225('0x15')][_0x7a87bf[0x1]]=_0x57189b;}}_0x26044b[_0xc225('0xc')]();});}}catch(_0x40b1a6){logger['error'](_0xc225('0x8'),_0x41eccd,_['isObject'](_0x40b1a6)?JSON['stringify'](_0x40b1a6):_0x40b1a6);logger[_0xc225('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x41eccd);_0x26044b[_0xc225('0xc')]();}};};
\ No newline at end of file
+var _0x5329=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','next','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','map','message','join'];(function(_0x13b34f,_0x36832e){var _0x6a5546=function(_0x3b73fe){while(--_0x3b73fe){_0x13b34f['push'](_0x13b34f['shift']());}};_0x6a5546(++_0x36832e);}(_0x5329,0xab));var _0x9532=function(_0x3c08a3,_0x35a3fb){_0x3c08a3=_0x3c08a3-0x0;var _0x4fa807=_0x5329[_0x3c08a3];return _0x4fa807;};'use strict';var schema=require('validate');var sh=require(_0x9532('0x0'));var _=require(_0x9532('0x1'));var utils=require(_0x9532('0x2'));var logger=require(_0x9532('0x3'))(_0x9532('0x4'));var system=schema({'command':{'type':_0x9532('0x5'),'required':!![],'message':_0x9532('0x6')}});exports['consequence']=function(_0x344ada,_0x17744c){return function(_0x3dd680){try{var _0x4842d5={'command':_0x17744c[0x0]};var _0x9fff65=system['validate'](_0x4842d5,{'typecast':!![]});if(_0x9fff65[_0x9532('0x7')]){logger['error']('[%s][SYSTEM]\x20%s',_0x344ada,_[_0x9532('0x8')](_0x9fff65,_0x9532('0x9'))[_0x9532('0xa')](',\x20'));logger['info'](_0x9532('0xb'),_0x344ada);_0x3dd680['next']();}else{var _0x1a0c99=this;var _0x25ca77=utils[_0x9532('0xc')](_0x17744c[0x0],this);logger[_0x9532('0xd')](_0x9532('0xe'),_0x344ada,_0x25ca77);sh[_0x9532('0xf')](_[_0x9532('0x10')](_0x25ca77),function(_0x234e8f,_0x1cd30c){logger['info'](_0x9532('0x11'),_0x344ada,_0x234e8f);if(_0x234e8f==0x0){var _0x2e6bb2=_0x1cd30c[_0x9532('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x9532('0x13')](_0x17744c[0x1])||_[_0x9532('0x14')](_0x17744c[0x1])){logger[_0x9532('0xd')](_0x9532('0x15'),_0x344ada);_0x1a0c99[_0x9532('0x16')][_0x17744c[0x1]]=_0x2e6bb2;}else{logger[_0x9532('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x344ada,_0x17744c[0x1],_0x2e6bb2);_0x1a0c99[_0x9532('0x16')][_0x17744c[0x1]]=_0x2e6bb2;}}_0x3dd680['next']();});}}catch(_0x29b02b){logger[_0x9532('0x17')]('[%s][SYSTEM]\x20%s',_0x344ada,_[_0x9532('0x18')](_0x29b02b)?JSON['stringify'](_0x29b02b):_0x29b02b);logger[_0x9532('0xd')](_0x9532('0xb'),_0x344ada);_0x3dd680[_0x9532('0x19')]();}};};
\ No newline at end of file
index 6f398df..efbd33f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa028=['then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','error','isObject','stringify','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction'];(function(_0x188d41,_0x4fb9a3){var _0xbd968e=function(_0x1b79e5){while(--_0x1b79e5){_0x188d41['push'](_0x188d41['shift']());}};_0xbd968e(++_0x4fb9a3);}(_0xa028,0x6e));var _0x8a02=function(_0x452d81,_0x401d3f){_0x452d81=_0x452d81-0x0;var _0x151f8d=_0xa028[_0x452d81];return _0x151f8d;};'use strict';var schema=require('validate');var _=require(_0x8a02('0x0'));var rpc={'chatInteraction':require(_0x8a02('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x8a02('0x2')),'mailInteraction':require(_0x8a02('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x8a02('0x4'))};var logger=require(_0x8a02('0x5'))(_0x8a02('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x8a02('0x7')}});exports[_0x8a02('0x8')]=function(_0xc81798,_0x580b87,_0x32b7bf,_0x521010){return function(_0x722915){try{var _0x45f010={'tag':_0x580b87[0x0]};var _0x1ed170=tag[_0x8a02('0x9')](_0x45f010,{'typecast':!![]});if(_0x1ed170[_0x8a02('0xa')]){logger['error'](_0x8a02('0xb'),_0xc81798,_[_0x8a02('0xc')](_0x1ed170,_0x8a02('0xd'))[_0x8a02('0xe')](',\x20'));logger[_0x8a02('0xf')](_0x8a02('0x10'),_0xc81798);_0x722915[_0x8a02('0x11')]();}else{var _0x24488d={'ids':[_0x580b87[0x0]]};if(rpc[_0x521010[_0x8a02('0x12')]+_0x8a02('0x13')]){rpc[_0x521010[_0x8a02('0x12')]+_0x8a02('0x13')]['addTags'](_0x521010['interaction']['id'],_0x24488d)[_0x8a02('0x14')](function(_0x974454){logger['info'](_0x8a02('0x15'),_0xc81798,_0x580b87[0x1],_0x521010[_0x8a02('0x12')],_0x521010[_0x8a02('0x16')]['id']);})['catch'](function(_0xafadba){logger['error'](_0x8a02('0xb'),_0xc81798,JSON['stringify'](_0xafadba));logger[_0x8a02('0xf')](_0x8a02('0x10'),_0xc81798);})['finally'](function(){_0x722915['next']();});}}}catch(_0x1ee23d){logger[_0x8a02('0x17')](_0x8a02('0xb'),_0xc81798,_[_0x8a02('0x18')](_0x1ee23d)?JSON[_0x8a02('0x19')](_0x1ee23d):_0x1ee23d);logger[_0x8a02('0xf')](_0x8a02('0x10'),_0xc81798);_0x722915[_0x8a02('0x11')]();}};};
\ No newline at end of file
+var _0xebfe=['interaction','then','catch','stringify','next','isObject','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','addTags'];(function(_0x18e43e,_0x5ce070){var _0x33f483=function(_0x3c7d92){while(--_0x3c7d92){_0x18e43e['push'](_0x18e43e['shift']());}};_0x33f483(++_0x5ce070);}(_0xebfe,0x100));var _0xeebf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xebfe[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require('validate');var _=require(_0xeebf('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xeebf('0x1')),'smsInteraction':require(_0xeebf('0x2')),'mailInteraction':require(_0xeebf('0x3')),'faxInteraction':require(_0xeebf('0x4')),'whatsappInteraction':require(_0xeebf('0x5'))};var logger=require(_0xeebf('0x6'))(_0xeebf('0x7'));var tag=schema({'tag':{'type':_0xeebf('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xeebf('0x9')]=function(_0x3eef6f,_0x2f22c8,_0x4d9ab7,_0x22fa71){return function(_0x5550b4){try{var _0x1a6bf2={'tag':_0x2f22c8[0x0]};var _0x1506ec=tag['validate'](_0x1a6bf2,{'typecast':!![]});if(_0x1506ec[_0xeebf('0xa')]){logger[_0xeebf('0xb')](_0xeebf('0xc'),_0x3eef6f,_[_0xeebf('0xd')](_0x1506ec,_0xeebf('0xe'))['join'](',\x20'));logger[_0xeebf('0xf')](_0xeebf('0x10'),_0x3eef6f);_0x5550b4['next']();}else{var _0x399068={'ids':[_0x2f22c8[0x0]]};if(rpc[_0x22fa71[_0xeebf('0x11')]+'Interaction']){rpc[_0x22fa71[_0xeebf('0x11')]+'Interaction'][_0xeebf('0x12')](_0x22fa71[_0xeebf('0x13')]['id'],_0x399068)[_0xeebf('0x14')](function(_0x4ac75d){logger[_0xeebf('0xf')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3eef6f,_0x2f22c8[0x1],_0x22fa71[_0xeebf('0x11')],_0x22fa71[_0xeebf('0x13')]['id']);})[_0xeebf('0x15')](function(_0x3d781f){logger[_0xeebf('0xb')]('[%s][TAG]\x20%s',_0x3eef6f,JSON[_0xeebf('0x16')](_0x3d781f));logger[_0xeebf('0xf')](_0xeebf('0x10'),_0x3eef6f);})['finally'](function(){_0x5550b4[_0xeebf('0x17')]();});}}}catch(_0x1124ed){logger[_0xeebf('0xb')](_0xeebf('0xc'),_0x3eef6f,_[_0xeebf('0x18')](_0x1124ed)?JSON[_0xeebf('0x16')](_0x1124ed):_0x1124ed);logger['info'](_0xeebf('0x10'),_0x3eef6f);_0x5550b4['next']();}};};
\ No newline at end of file
index f105fc5..2dfdede 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x995c=['request-promise','../../../../config/logger','routing','lodash','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','utf8','POST','application/json-rpc','then','parse','result','logged','&serviceId=','&sessionId=','&data=','stringify','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','info','next'];(function(_0x27f616,_0xf48a6d){var _0x5ebae0=function(_0x323d0a){while(--_0x323d0a){_0x27f616['push'](_0x27f616['shift']());}};_0x5ebae0(++_0xf48a6d);}(_0x995c,0x1a0));var _0xc995=function(_0x2fcc7b,_0x18bd62){_0x2fcc7b=_0x2fcc7b-0x0;var _0x36738b=_0x995c[_0x2fcc7b];return _0x36738b;};'use strict';var rp=require(_0xc995('0x0'));var logger=require(_0xc995('0x1'))(_0xc995('0x2'));var _=require(_0xc995('0x3'));var arr=[];exports[_0xc995('0x4')]=function(_0x4ec8f0,_0x46c43f){return function(_0x3431af){var _0x1e0e9e=_0x46c43f[0xa];var _0xd527cd=_0x46c43f[0xb];var _0x50c6c0=_0x46c43f[0xc];var _0xd69d73=_0x46c43f[0xd];var _0x5e4776=_0x46c43f[0xe];var _0x257724=_0x46c43f[0xf][_0xc995('0x5')](/\n/g,'\x20-\x20');var _0x11c226=_0x46c43f[0x10][_0xc995('0x5')](/\n/g,'\x20');if(!arr[_0xc995('0x6')](_0xd527cd)){arr[_0xc995('0x7')](_0xd527cd);var _0x465cf=_0x46c43f[0x3];var _0x1d6059=_0x46c43f[0x4];var _0x376d9a=_0x46c43f[0x1];var _0x1c712f=_0x46c43f[0x0];var _0x1b7cdf={};_0x1b7cdf[_0xc995('0x8')]=_0x46c43f[0x8]+_0xc995('0x9')+_0x50c6c0+'|'+_0x1e0e9e+'|'+_0xd69d73+'|'+_0xd527cd+'|'+_0x5e4776;_0x1b7cdf[_0xc995('0xa')]=_0x46c43f[0x7]+_0xc995('0x9')+_0x50c6c0+'|'+_0x1e0e9e+'|'+_0xd69d73+'|'+_0xd527cd+'|'+_0x5e4776+'|'+_0x257724+'|'+_0x11c226;_0x1b7cdf[_0xc995('0xb')]=_0x46c43f[0x9];var _0x951c08={};_0x951c08[_0xc995('0xc')]='2.0';_0x951c08[_0xc995('0xd')]=_0xc995('0xe');var _0x311af=[];_0x311af[_0xc995('0x7')](_0x46c43f[0x2]);_0x311af[_0xc995('0x7')](_0x46c43f[0x5]);_0x311af['push'](_0x46c43f[0x6]);_0x951c08['params']=_0x311af;_0x951c08['id']=0x1;var _0x58f6fb=JSON['stringify'](_0x951c08);var _0x2cd1ff={'encoding':_0xc995('0xf'),'method':_0xc995('0x10'),'timeout':0x2710,'url':_0x465cf,'headers':{'Content-Type':_0xc995('0x11')},'body':_0x58f6fb};return rp(_0x2cd1ff)[_0xc995('0x12')](function(_0x485b65){const _0x248340=JSON[_0xc995('0x13')](_0x485b65);if(!_0x248340[_0xc995('0x14')][_0xc995('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x12384e=_0xd527cd;var _0x28a2d4='channelId='+_0x376d9a+_0xc995('0x16')+_0x1c712f+_0xc995('0x17')+_0x12384e+_0xc995('0x18')+JSON[_0xc995('0x19')](_0x1b7cdf);var _0x47e056=_0x1d6059+'?'+_0x28a2d4;return rp(_0x47e056);})[_0xc995('0x12')](function(_0x4d90e4){logger['info'](_0xc995('0x1a'),_0x4ec8f0,_0x4d90e4);_0x3431af[_0xc995('0x1b')]();})[_0xc995('0x1c')](function(_0x5cb173){logger[_0xc995('0x1d')]('[%s][TVOX]\x20%s',_0x4ec8f0,_['isObject'](_0x5cb173)?JSON['stringify'](_0x5cb173):_0x5cb173);_0x3431af[_0xc995('0x1b')]();});}else{logger[_0xc995('0x1e')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x4ec8f0);_0x3431af[_0xc995('0x1f')]();}};};
\ No newline at end of file
+var _0x5a23=['application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stop','catch','error','[%s][TVOX]\x20%s','info','../../../../config/logger','lodash','consequence','\x20-\x20','replace','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','params','stringify','utf8','POST'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5a23,0xc9));var _0x35a2=function(_0x91aee4,_0x30d609){_0x91aee4=_0x91aee4-0x0;var _0x506346=_0x5a23[_0x91aee4];return _0x506346;};'use strict';var rp=require('request-promise');var logger=require(_0x35a2('0x0'))('routing');var _=require(_0x35a2('0x1'));var arr=[];exports[_0x35a2('0x2')]=function(_0x518c8b,_0x1b1e20){return function(_0x265f18){var _0x2f7dfe=_0x1b1e20[0xa];var _0x23252c=_0x1b1e20[0xb];var _0xe137d4=_0x1b1e20[0xc];var _0x369a67=_0x1b1e20[0xd];var _0x1d517d=_0x1b1e20[0xe];var _0x189a31=_0x1b1e20[0xf]['replace'](/\n/g,_0x35a2('0x3'));var _0x1494f5=_0x1b1e20[0x10][_0x35a2('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x23252c)){arr[_0x35a2('0x5')](_0x23252c);var _0x27951b=_0x1b1e20[0x3];var _0x3e9019=_0x1b1e20[0x4];var _0x2e1419=_0x1b1e20[0x1];var _0x140ea0=_0x1b1e20[0x0];var _0x480838={};_0x480838[_0x35a2('0x6')]=_0x1b1e20[0x8]+_0x35a2('0x7')+_0xe137d4+'|'+_0x2f7dfe+'|'+_0x369a67+'|'+_0x23252c+'|'+_0x1d517d;_0x480838['urlOnRing']=_0x1b1e20[0x7]+_0x35a2('0x7')+_0xe137d4+'|'+_0x2f7dfe+'|'+_0x369a67+'|'+_0x23252c+'|'+_0x1d517d+'|'+_0x189a31+'|'+_0x1494f5;_0x480838[_0x35a2('0x8')]=_0x1b1e20[0x9];var _0x37674c={};_0x37674c[_0x35a2('0x9')]=_0x35a2('0xa');_0x37674c[_0x35a2('0xb')]='login';var _0x49f1b=[];_0x49f1b[_0x35a2('0x5')](_0x1b1e20[0x2]);_0x49f1b[_0x35a2('0x5')](_0x1b1e20[0x5]);_0x49f1b[_0x35a2('0x5')](_0x1b1e20[0x6]);_0x37674c[_0x35a2('0xc')]=_0x49f1b;_0x37674c['id']=0x1;var _0x1dbbea=JSON[_0x35a2('0xd')](_0x37674c);var _0x411c4c={'encoding':_0x35a2('0xe'),'method':_0x35a2('0xf'),'timeout':0x2710,'url':_0x27951b,'headers':{'Content-Type':_0x35a2('0x10')},'body':_0x1dbbea};return rp(_0x411c4c)[_0x35a2('0x11')](function(_0x668b8e){const _0x509309=JSON[_0x35a2('0x12')](_0x668b8e);if(!_0x509309[_0x35a2('0x13')][_0x35a2('0x14')]){throw new Error(_0x35a2('0x15'));}var _0x4b6501=_0x23252c;var _0x1a2135=_0x35a2('0x16')+_0x2e1419+_0x35a2('0x17')+_0x140ea0+_0x35a2('0x18')+_0x4b6501+_0x35a2('0x19')+JSON['stringify'](_0x480838);var _0x2c0152=_0x3e9019+'?'+_0x1a2135;return rp(_0x2c0152);})['then'](function(_0x410ed5){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x518c8b,_0x410ed5);_0x265f18[_0x35a2('0x1a')]();})[_0x35a2('0x1b')](function(_0x51328e){logger[_0x35a2('0x1c')](_0x35a2('0x1d'),_0x518c8b,_['isObject'](_0x51328e)?JSON[_0x35a2('0xd')](_0x51328e):_0x51328e);_0x265f18[_0x35a2('0x1a')]();});}else{logger[_0x35a2('0x1e')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x518c8b);_0x265f18['next']();}};};
\ No newline at end of file
index 4f5bf28..09b18ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x139e16,_0x5cd4f0){var _0x4b412c=function(_0x4c1874){while(--_0x4c1874){_0x139e16['push'](_0x139e16['shift']());}};_0x4b412c(++_0x5cd4f0);}(_0xe706,0xa3));var _0x6e70=function(_0x5bbae4,_0x2a4a4e){_0x5bbae4=_0x5bbae4-0x0;var _0x338a50=_0xe706[_0x5bbae4];return _0x338a50;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
+var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x35c79b,_0x4b6b3e){var _0x3b3e0a=function(_0x32df3c){while(--_0x32df3c){_0x35c79b['push'](_0x35c79b['shift']());}};_0x3b3e0a(++_0x4b6b3e);}(_0xe706,0xa3));var _0x6e70=function(_0x4bf83e,_0x429223){_0x4bf83e=_0x4bf83e-0x0;var _0x5647c9=_0xe706[_0x4bf83e];return _0x5647c9;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
index b762cc8..207b08b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4f=['mail','push','slice','dialogflow','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','name','paused','waiting','mailQueues','available','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','channel'];(function(_0x3afc42,_0x207872){var _0x3b3438=function(_0x52b59a){while(--_0x52b59a){_0x3afc42['push'](_0x3afc42['shift']());}};_0x3b3438(++_0x207872);}(_0xee4f,0xad));var _0xfee4=function(_0x700f7c,_0x4782ff){_0x700f7c=_0x700f7c-0x0;var _0x28e45b=_0xee4f[_0x700f7c];return _0x28e45b;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0xfee4('0x1'));var BPromise=require(_0xfee4('0x2'));var uuid=require(_0xfee4('0x3'));var utils=require('./applications/utils');var config=require(_0xfee4('0x4'));var logger=require('../../../config/logger')(_0xfee4('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xfee4('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xfee4('0x7'))};var RuleEngine=require(_0xfee4('0x8'));function getId(_0x34908a,_0x4d3c71,_0x52fc6e){return util[_0xfee4('0x9')](_0xfee4('0xa'),_0x34908a,_0x4d3c71||0x0,_0x52fc6e||0x0);}function getIntervals(_0xa77876,_0x4dc812){var _0x53f260=[];if(!_[_0xfee4('0xb')](_0x4dc812[_0xfee4('0xc')])&&!_[_0xfee4('0xb')](_0xa77876[_0x4dc812['IntervalId']])&&!_[_0xfee4('0xb')](_0xa77876[_0x4dc812[_0xfee4('0xc')]][_0xfee4('0xd')])){_0x53f260=_[_0xfee4('0xe')](_0xa77876[_0x4dc812[_0xfee4('0xc')]][_0xfee4('0xd')],_0xfee4('0xf'));}else if(!_['isNil'](_0x4dc812[_0xfee4('0xf')])){_0x53f260=[_0x4dc812[_0xfee4('0xf')]];}return _0x53f260;}exports['listen']=function(_0xaf0d7f){_0xaf0d7f[_0xfee4('0x10')]={};return new BPromise(function(_0xe0f907,_0x26a75b){var _0x38749e={'Start':function(_0x453635){var _0x24868c=this;return new Promise(function(_0x55440a,_0x193535){if(_0x453635){try{var _0x251403=[];var _0x437979=getId(_0x453635['channel'],_0x453635[_0xfee4('0x11')]?_0x453635['message']['id']:0x0,_0x453635['interaction']?_0x453635[_0xfee4('0x12')]['id']:0x0);if(_0x453635[_0xfee4('0x13')]&&_[_0xfee4('0x14')](_0x453635[_0xfee4('0x13')])&&_0x453635[_0xfee4('0x13')][_0xfee4('0x15')]){for(var _0x9555c=0x0;_0x9555c<_0x453635[_0xfee4('0x13')][_0xfee4('0x15')];_0x9555c+=0x1){var _0x5826da=_0x453635[_0xfee4('0x13')][_0x9555c];if(fs[_0xfee4('0x16')](path[_0xfee4('0x17')](__dirname,_0xfee4('0x13'),_0x5826da[_0xfee4('0x18')]+_0xfee4('0x19')))){var _0x57012c=[];switch(_0x5826da[_0xfee4('0x18')][_0xfee4('0x1a')]()){case _0xfee4('0x1b'):var _0x1a2761=_0x5826da[_0xfee4('0x1c')][_0xfee4('0x1d')](',');if(_0x453635[_0xfee4('0x1e')]===_0xfee4('0x1f')){_0x57012c[_0xfee4('0x20')](_0x1a2761[0x0]);_0x57012c[_0xfee4('0x20')](_0x1a2761[0x1]);_0x57012c['push'](_0x1a2761['slice'](0x2,_0x1a2761['length'])['join'](','));}else{_0x57012c['push'](_0x1a2761[0x0]);_0x57012c[_0xfee4('0x20')](_0x1a2761[_0xfee4('0x21')](0x1,_0x1a2761[_0xfee4('0x15')])[_0xfee4('0x17')](','));}break;case _0xfee4('0x22'):var _0x1eb0b9=_0x5826da[_0xfee4('0x1c')][_0xfee4('0x1d')](',');_0x57012c['push'](_0x1eb0b9[0x0]);_0x57012c[_0xfee4('0x20')](_0x1eb0b9[0x1]);_0x57012c['push'](_0x1eb0b9['slice'](0x2,_0x1eb0b9[_0xfee4('0x15')])[_0xfee4('0x17')](','));break;case'dialogflowv2':var _0x49f138=_0x5826da[_0xfee4('0x1c')]['split'](',');_0x57012c['push'](_0x49f138[0x0]);_0x57012c[_0xfee4('0x20')](_0x49f138[0x1]);_0x57012c[_0xfee4('0x20')](_0x49f138[0x2]);_0x57012c['push'](_0x49f138[0x3]);_0x57012c[_0xfee4('0x20')](_0x49f138['slice'](0x4,_0x49f138[_0xfee4('0x15')])[_0xfee4('0x17')](','));break;case _0xfee4('0x23'):var _0x48b196=_0x5826da[_0xfee4('0x1c')][_0xfee4('0x1d')](',');_0x57012c[_0xfee4('0x20')](_0x48b196[0x0]);_0x57012c[_0xfee4('0x20')](_0x48b196[0x1]);_0x57012c['push'](_0x48b196[0x2]);_0x57012c[_0xfee4('0x20')](_0x48b196[0x3]);_0x57012c['push'](_0x48b196[_0xfee4('0x21')](0x4,_0x48b196[_0xfee4('0x15')])['join'](','));break;case _0xfee4('0x11'):_0x57012c[_0xfee4('0x20')](_0x5826da['appdata']);break;case _0xfee4('0x24'):_0x57012c['push'](_0x5826da[_0xfee4('0x25')]);_0x57012c[_0xfee4('0x20')](_0x5826da[_0xfee4('0x1c')]);break;case _0xfee4('0x26'):var _0x335365=utils[_0xfee4('0x27')](_0x453635['account'][_0xfee4('0x28')],_0x453635);var _0x5efde5=_0x5826da[_0xfee4('0x1c')]['split'](',');_0x57012c[_0xfee4('0x20')](_0x5efde5[0x0]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0x1]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0x2]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0x3]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0x4]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0x5]);_0x57012c['push'](_0x5efde5[0x6]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0x7]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0x8]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0x9]);_0x57012c[_0xfee4('0x20')](_0x5efde5[0xa]);_0x57012c[_0xfee4('0x20')](_0x453635[_0xfee4('0x12')]['id']);_0x57012c[_0xfee4('0x20')](_0x453635['message']['id']);_0x57012c[_0xfee4('0x20')](_0x5826da[_0xfee4('0x29')]);_0x57012c[_0xfee4('0x20')](_0x453635['interaction']['ContactId']);_0x57012c[_0xfee4('0x20')](_0x453635[_0xfee4('0x2a')][_0xfee4('0x2a')]);_0x57012c['push'](_0x335365);break;default:_0x57012c=_['isNil'](_0x5826da['appdata'])?[]:_0x5826da[_0xfee4('0x1c')][_0xfee4('0x1d')](',');}var _0xcbede8={'id':util[_0xfee4('0x9')]('%s:%s:%s',_0x437979,_0x5826da['id'],_0x5826da['app']),'condition':require(_0xfee4('0x2b'))[_0xfee4('0x2c')](_0x437979,getIntervals(_0xaf0d7f[_0xfee4('0x2d')],_0x5826da),_0xaf0d7f),'consequence':require(_0xfee4('0x2e')+_0x5826da[_0xfee4('0x18')])[_0xfee4('0x2f')](_0x437979,_0x57012c,_0xaf0d7f,_0x453635),'p':_0x5826da[_0xfee4('0x30')]||0x0};logger[_0xfee4('0x31')](_0xfee4('0x32'),_0xcbede8['id'],_0xfee4('0x33'),getIntervals(_0xaf0d7f['intervals'],_0x5826da)[_0xfee4('0x17')](_0xfee4('0x34')));_0x251403[_0xfee4('0x20')](_0xcbede8);}else{logger[_0xfee4('0x35')](_0xfee4('0x36'),path[_0xfee4('0x17')](__dirname,_0xfee4('0x13'),_0x5826da[_0xfee4('0x18')]+_0xfee4('0x19')));}}_0xaf0d7f[_0xfee4('0x10')][_0x437979]=new RuleEngine(_0x251403);_0xaf0d7f[_0xfee4('0x10')][_0x437979][_0xfee4('0x37')](_0x453635,function(_0x95eb60){logger['info'](_0xfee4('0x38'),JSON[_0xfee4('0x39')](_0x95eb60[_0xfee4('0x3a')]));if(_0xaf0d7f[_0xfee4('0x10')][_0x437979]){_0xaf0d7f[_0xfee4('0x10')][_0x437979][_0xfee4('0x3b')](_0xfee4('0x3c'));}});return _0x55440a({'code':0xc8,'message':_0x453635});}else{logger[_0xfee4('0x31')](_0xfee4('0x3d'));return _0x55440a({'code':0xc8,'message':_0x453635});}}catch(_0x4b9093){logger[_0xfee4('0x35')](_0x4b9093[_0xfee4('0x3e')]);return _0x193535(_0x24868c['error'](0x1f4,_0x4b9093));}}return _0x193535(_0xfee4('0x3f'));});},'AcceptMessage':function(_0x163558){var _0x5212bc=this;return new Promise(function(_0x5c205b,_0x3460ad){if(_0x163558['agent']&&_0x163558[_0xfee4('0x40')]['id']){if(_0xaf0d7f[_0xfee4('0x41')][_0x163558[_0xfee4('0x40')]['id']]){_0xaf0d7f[_0xfee4('0x41')][_0x163558[_0xfee4('0x40')]['id']][_0xfee4('0x42')]=![];_0xaf0d7f[_0xfee4('0x41')][_0x163558['agent']['id']][_0xfee4('0x43')]=undefined;}}if(_0x163558['message']&&_0x163558['message']['id']){try{var _0x48b5e9=getId(_0x163558[_0xfee4('0x1e')],_0x163558[_0xfee4('0x11')]?_0x163558[_0xfee4('0x11')]['id']:0x0,_0x163558['interaction']?_0x163558[_0xfee4('0x12')]['id']:0x0);if(_0xaf0d7f[_0xfee4('0x10')][_0x48b5e9]){_0xaf0d7f[_0xfee4('0x10')][_0x48b5e9]['emit'](_0xfee4('0x44'));if(rpc[_0x163558['channel']+_0xfee4('0x45')]){rpc[_0x163558[_0xfee4('0x1e')]+_0xfee4('0x45')][_0xfee4('0x46')](_0x48b5e9,{'UserId':_0x163558['message'][_0xfee4('0x47')]})[_0xfee4('0x48')](function(_0x5764e4){logger[_0xfee4('0x35')](_0xfee4('0x49'));});}}return _0x5c205b({'code':0xc8,'message':_0x163558});}catch(_0x5dae6c){logger[_0xfee4('0x35')](_0x5dae6c['stack']);return _0x3460ad(_0x5212bc[_0xfee4('0x35')](0x1f4,_0x5dae6c));}}logger['error'](_0xfee4('0x4a'));return _0x3460ad(_0x5212bc[_0xfee4('0x35')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x3c099d){var _0x6e9b85=this;return new Promise(function(_0x32ceca,_0x48043b){if(_0x3c099d[_0xfee4('0x40')]&&_0x3c099d['agent']['id']){try{if(_0xaf0d7f[_0xfee4('0x41')][_0x3c099d[_0xfee4('0x40')]['id']]){_0xaf0d7f[_0xfee4('0x41')][_0x3c099d['agent']['id']][_0xfee4('0x42')]=![];_0xaf0d7f[_0xfee4('0x41')][_0x3c099d[_0xfee4('0x40')]['id']]['busyQueue']=undefined;}return _0x32ceca({'code':0xc8,'message':_0x3c099d});}catch(_0x16a18e){logger[_0xfee4('0x35')](_0x16a18e[_0xfee4('0x3e')]);return _0x48043b(_0x6e9b85['error'](0x1f4,_0x16a18e));}}logger['error'](_0xfee4('0x4a'));return _0x48043b(_0x6e9b85[_0xfee4('0x35')](0x1f4,_0xfee4('0x4a')));});},'AbandonInteraction':function(_0x260d96){var _0x5d51d4=this;return new Promise(function(_0xd6c79c,_0x15b2f9){if(_0x260d96[_0xfee4('0x1e')]&&_0x260d96[_0xfee4('0x12')]&&_0x260d96['interaction']['id']){try{var _0x887e43=getId(_0x260d96[_0xfee4('0x1e')],_0x260d96[_0xfee4('0x11')]?_0x260d96[_0xfee4('0x11')]['id']:0x0,_0x260d96['interaction']?_0x260d96[_0xfee4('0x12')]['id']:0x0);if(_0xaf0d7f[_0xfee4('0x10')][_0x887e43]){_0xaf0d7f[_0xfee4('0x10')][_0x887e43][_0xfee4('0x3b')](_0xfee4('0x44'));}return _0xd6c79c({'code':0xc8,'message':_0x260d96});}catch(_0x35a75b){logger[_0xfee4('0x35')](_0x35a75b[_0xfee4('0x3e')]);return _0x15b2f9(_0x5d51d4[_0xfee4('0x35')](0x1f4,_0x35a75b));}}logger['error'](_0xfee4('0x4a'));return _0x15b2f9(_0x5d51d4['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x2fd9a2){var _0x224cec=this;return new Promise(function(_0x2b9975,_0x2908bb){if(_0xaf0d7f[_0xfee4('0x41')]['hasOwnProperty'](_0x2fd9a2['id'])){for(var _0xb15c11 in _0x2fd9a2['capacity']){if(_0x2fd9a2[_0xfee4('0x4b')]['hasOwnProperty'](_0xb15c11)){if(_0xaf0d7f[_0xfee4('0x41')][_0x2fd9a2['id']][_0xfee4('0x4c')](_0xb15c11+_0xfee4('0x4d'))){_0xaf0d7f[_0xfee4('0x41')][_0x2fd9a2['id']][_0xb15c11+_0xfee4('0x4d')]=parseInt(_0x2fd9a2[_0xfee4('0x4b')][_0xb15c11],0xa);}}}_0xaf0d7f[_0xfee4('0x41')][_0x2fd9a2['id']][_0xfee4('0x4e')]();return _0x2b9975({'code':0xc8,'message':_0xaf0d7f[_0xfee4('0x41')][_0x2fd9a2['id']]});}else{return _0x2908bb(_0x224cec[_0xfee4('0x35')](0x1f4,_0xfee4('0x4f')));}});},'Agents':function(_0x39f8ba){return new Promise(function(_0x54bb7c,_0x2e5a3c){var _0x5ea8fd=_[_0xfee4('0x50')](_0xaf0d7f['agents']);_0x54bb7c({'count':_0x5ea8fd[_0xfee4('0x15')],'rows':_0x5ea8fd});});},'ChatQueues':function(_0x301089){return new Promise(function(_0x5840c5,_0x3665c0){var _0xc9de95=[];for(var _0x320859 in _0xaf0d7f[_0xfee4('0x51')]){if(_0xaf0d7f[_0xfee4('0x51')][_0xfee4('0x4c')](_0x320859)){var _0x6d719d=_0xaf0d7f[_0xfee4('0x51')][_0x320859];var _0x2a4055={'id':_0x6d719d['id'],'available':_0x6d719d['available'],'loggedIn':_0x6d719d['loggedIn'],'name':_0x6d719d[_0xfee4('0x52')],'paused':_0x6d719d[_0xfee4('0x53')],'waiting':_0x6d719d[_0xfee4('0x54')]};_0xc9de95['push'](_0x2a4055);}}_0x5840c5({'count':_0xc9de95[_0xfee4('0x15')],'rows':_0xc9de95});});},'MailQueues':function(_0x368ae4){return new Promise(function(_0x3169c8,_0x6a7471){var _0x2f127a=[];for(var _0x4d7f55 in _0xaf0d7f[_0xfee4('0x55')]){if(_0xaf0d7f['mailQueues']['hasOwnProperty'](_0x4d7f55)){var _0x5172c8=_0xaf0d7f[_0xfee4('0x55')][_0x4d7f55];var _0x53f536={'id':_0x5172c8['id'],'available':_0x5172c8[_0xfee4('0x56')],'loggedIn':_0x5172c8[_0xfee4('0x57')],'name':_0x5172c8[_0xfee4('0x52')],'paused':_0x5172c8[_0xfee4('0x53')],'waiting':_0x5172c8[_0xfee4('0x54')]};_0x2f127a[_0xfee4('0x20')](_0x53f536);}}_0x3169c8({'count':_0x2f127a[_0xfee4('0x15')],'rows':_0x2f127a});});},'OpenchannelQueues':function(_0x509424){return new Promise(function(_0x3c94e3,_0x462553){var _0x39cabf=[];for(var _0x1f3072 in _0xaf0d7f['openchannelQueues']){if(_0xaf0d7f[_0xfee4('0x58')][_0xfee4('0x4c')](_0x1f3072)){var _0x389fd3=_0xaf0d7f[_0xfee4('0x58')][_0x1f3072];var _0x3969b1={'id':_0x389fd3['id'],'available':_0x389fd3[_0xfee4('0x56')],'loggedIn':_0x389fd3['loggedIn'],'name':_0x389fd3[_0xfee4('0x52')],'paused':_0x389fd3[_0xfee4('0x53')],'waiting':_0x389fd3[_0xfee4('0x54')]};_0x39cabf[_0xfee4('0x20')](_0x3969b1);}}_0x3c94e3({'count':_0x39cabf[_0xfee4('0x15')],'rows':_0x39cabf});});},'SmsQueues':function(_0x5767c8){return new Promise(function(_0x15d0a8,_0x3355f1){var _0x224023=[];for(var _0x1f3ff7 in _0xaf0d7f[_0xfee4('0x59')]){if(_0xaf0d7f['smsQueues'][_0xfee4('0x4c')](_0x1f3ff7)){var _0x142ab4=_0xaf0d7f[_0xfee4('0x59')][_0x1f3ff7];var _0xdf46bf={'id':_0x142ab4['id'],'available':_0x142ab4['available'],'loggedIn':_0x142ab4['loggedIn'],'name':_0x142ab4['name'],'paused':_0x142ab4[_0xfee4('0x53')],'waiting':_0x142ab4['waiting']};_0x224023[_0xfee4('0x20')](_0xdf46bf);}}_0x15d0a8({'count':_0x224023[_0xfee4('0x15')],'rows':_0x224023});});},'FaxQueues':function(_0x2c7785){return new Promise(function(_0x544086,_0x3b1fb9){var _0x46d367=[];for(var _0x161178 in _0xaf0d7f[_0xfee4('0x5a')]){if(_0xaf0d7f[_0xfee4('0x5a')]['hasOwnProperty'](_0x161178)){var _0x530a48=_0xaf0d7f['faxQueues'][_0x161178];var _0x5448c2={'id':_0x530a48['id'],'available':_0x530a48[_0xfee4('0x56')],'loggedIn':_0x530a48['loggedIn'],'name':_0x530a48[_0xfee4('0x52')],'paused':_0x530a48['paused'],'waiting':_0x530a48['waiting']};_0x46d367[_0xfee4('0x20')](_0x5448c2);}}_0x544086({'count':_0x46d367[_0xfee4('0x15')],'rows':_0x46d367});});},'WhatsappQueues':function(_0x29ecb8){return new Promise(function(_0x1f4cdf,_0x865579){var _0x330994=[];for(var _0x4975d8 in _0xaf0d7f[_0xfee4('0x5b')]){if(_0xaf0d7f[_0xfee4('0x5b')][_0xfee4('0x4c')](_0x4975d8)){var _0x363b60=_0xaf0d7f[_0xfee4('0x5b')][_0x4975d8];var _0x134014={'id':_0x363b60['id'],'available':_0x363b60[_0xfee4('0x56')],'loggedIn':_0x363b60[_0xfee4('0x57')],'name':_0x363b60['name'],'paused':_0x363b60[_0xfee4('0x53')],'waiting':_0x363b60[_0xfee4('0x54')]};_0x330994[_0xfee4('0x20')](_0x134014);}}_0x1f4cdf({'count':_0x330994[_0xfee4('0x15')],'rows':_0x330994});});},'ChatQueuesWaitingInteractions':function(_0x5dd054){return new Promise(function(_0x5d372f,_0x40fcbb){var _0x5cda27=_[_0xfee4('0x50')](_0xaf0d7f[_0xfee4('0x5c')]);_0x5d372f({'count':_0x5cda27['length'],'rows':_0x5cda27});});},'MailQueuesWaitingInteractions':function(_0x4b1275){return new Promise(function(_0x10dec8,_0x1a0371){var _0x35997d=_['values'](_0xaf0d7f[_0xfee4('0x5d')]);_0x10dec8({'count':_0x35997d['length'],'rows':_0x35997d});});},'OpenchannelQueuesWaitingInteractions':function(_0x41b625){return new Promise(function(_0x4ab79b,_0x190116){var _0x2f1fe6=_[_0xfee4('0x50')](_0xaf0d7f[_0xfee4('0x5e')]);_0x4ab79b({'count':_0x2f1fe6['length'],'rows':_0x2f1fe6});});},'SmsQueuesWaitingInteractions':function(_0x23924d){return new Promise(function(_0x4c7a29,_0x304310){var _0x231e3a=_['values'](_0xaf0d7f[_0xfee4('0x5f')]);_0x4c7a29({'count':_0x231e3a[_0xfee4('0x15')],'rows':_0x231e3a});});},'FaxQueuesWaitingInteractions':function(_0x5b8994){return new Promise(function(_0x28ffbd,_0x5eb8d9){var _0x4fa046=_[_0xfee4('0x50')](_0xaf0d7f[_0xfee4('0x60')]);_0x28ffbd({'count':_0x4fa046[_0xfee4('0x15')],'rows':_0x4fa046});});},'WhatsappQueuesWaitingInteractions':function(_0x5b5bad){return new Promise(function(_0x9ee756,_0xdb71a9){var _0x31d344=_[_0xfee4('0x50')](_0xaf0d7f['whatsappQueuesWaitingInteractions']);_0x9ee756({'count':_0x31d344['length'],'rows':_0x31d344});});}};var _0x40276e=jayson[_0xfee4('0x61')](_0x38749e)[_0xfee4('0x62')]();_0x40276e['on'](_0xfee4('0x35'),function(_0x37a490){logger[_0xfee4('0x35')](JSON[_0xfee4('0x39')](_0x37a490));return _0x26a75b(_0x37a490);});_0x40276e[_0xfee4('0x63')](0x232c,'127.0.0.1',function(){console['log'](_0xfee4('0x64'),0x232c);return _0xe0f907(_0xfee4('0x65')+0x232c);});});};
\ No newline at end of file
+var _0xe600=['CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','isArray','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','error','stack','agent','agents','busy','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x0e60('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x0e60('0x1'));var BPromise=require(_0x0e60('0x2'));var uuid=require(_0x0e60('0x3'));var utils=require(_0x0e60('0x4'));var config=require(_0x0e60('0x5'));var logger=require(_0x0e60('0x6'))(_0x0e60('0x7'));var rpc={'openchannelQueueReport':require(_0x0e60('0x8')),'mailQueueReport':require(_0x0e60('0x9')),'chatQueueReport':require(_0x0e60('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x0e60('0xb')),'whatsappQueueReport':require(_0x0e60('0xc'))};var RuleEngine=require(_0x0e60('0xd'));function getId(_0x30eaed,_0x5ba123,_0x3577c5){return util[_0x0e60('0xe')](_0x0e60('0xf'),_0x30eaed,_0x5ba123||0x0,_0x3577c5||0x0);}function getIntervals(_0x420063,_0x300dfb){var _0x1659e4=[];if(!_['isNil'](_0x300dfb[_0x0e60('0x10')])&&!_[_0x0e60('0x11')](_0x420063[_0x300dfb[_0x0e60('0x10')]])&&!_[_0x0e60('0x11')](_0x420063[_0x300dfb[_0x0e60('0x10')]][_0x0e60('0x12')])){_0x1659e4=_[_0x0e60('0x13')](_0x420063[_0x300dfb[_0x0e60('0x10')]]['Intervals'],_0x0e60('0x14'));}else if(!_[_0x0e60('0x11')](_0x300dfb[_0x0e60('0x14')])){_0x1659e4=[_0x300dfb[_0x0e60('0x14')]];}return _0x1659e4;}exports[_0x0e60('0x15')]=function(_0x37bf95){_0x37bf95['rules']={};return new BPromise(function(_0x4192dd,_0x508fd0){var _0x91cd1={'Start':function(_0x128887){var _0x170890=this;return new Promise(function(_0x5ab4ba,_0x2a8b5a){if(_0x128887){try{var _0x3f2d13=[];var _0xdb7760=getId(_0x128887[_0x0e60('0x16')],_0x128887[_0x0e60('0x17')]?_0x128887['message']['id']:0x0,_0x128887[_0x0e60('0x18')]?_0x128887[_0x0e60('0x18')]['id']:0x0);if(_0x128887['applications']&&_[_0x0e60('0x19')](_0x128887[_0x0e60('0x1a')])&&_0x128887[_0x0e60('0x1a')]['length']){for(var _0xc1a7b9=0x0;_0xc1a7b9<_0x128887['applications'][_0x0e60('0x1b')];_0xc1a7b9+=0x1){var _0x30c6a5=_0x128887[_0x0e60('0x1a')][_0xc1a7b9];if(fs[_0x0e60('0x1c')](path[_0x0e60('0x1d')](__dirname,_0x0e60('0x1a'),_0x30c6a5[_0x0e60('0x1e')]+_0x0e60('0x1f')))){var _0x352633=[];switch(_0x30c6a5[_0x0e60('0x1e')][_0x0e60('0x20')]()){case _0x0e60('0x21'):var _0x300c66=_0x30c6a5[_0x0e60('0x22')][_0x0e60('0x23')](',');if(_0x128887[_0x0e60('0x16')]===_0x0e60('0x24')){_0x352633[_0x0e60('0x25')](_0x300c66[0x0]);_0x352633[_0x0e60('0x25')](_0x300c66[0x1]);_0x352633['push'](_0x300c66[_0x0e60('0x26')](0x2,_0x300c66[_0x0e60('0x1b')])['join'](','));}else{_0x352633[_0x0e60('0x25')](_0x300c66[0x0]);_0x352633['push'](_0x300c66[_0x0e60('0x26')](0x1,_0x300c66['length'])['join'](','));}break;case _0x0e60('0x27'):var _0x39dae2=_0x30c6a5['appdata']['split'](',');_0x352633[_0x0e60('0x25')](_0x39dae2[0x0]);_0x352633['push'](_0x39dae2[0x1]);_0x352633[_0x0e60('0x25')](_0x39dae2['slice'](0x2,_0x39dae2['length'])[_0x0e60('0x1d')](','));break;case _0x0e60('0x28'):var _0x2a282d=_0x30c6a5['appdata'][_0x0e60('0x23')](',');_0x352633['push'](_0x2a282d[0x0]);_0x352633[_0x0e60('0x25')](_0x2a282d[0x1]);_0x352633[_0x0e60('0x25')](_0x2a282d[0x2]);_0x352633[_0x0e60('0x25')](_0x2a282d[0x3]);_0x352633['push'](_0x2a282d[_0x0e60('0x26')](0x4,_0x2a282d[_0x0e60('0x1b')])[_0x0e60('0x1d')](','));break;case'amazonlex':var _0x17e210=_0x30c6a5[_0x0e60('0x22')][_0x0e60('0x23')](',');_0x352633[_0x0e60('0x25')](_0x17e210[0x0]);_0x352633[_0x0e60('0x25')](_0x17e210[0x1]);_0x352633['push'](_0x17e210[0x2]);_0x352633[_0x0e60('0x25')](_0x17e210[0x3]);_0x352633['push'](_0x17e210[_0x0e60('0x26')](0x4,_0x17e210['length'])[_0x0e60('0x1d')](','));break;case _0x0e60('0x17'):_0x352633[_0x0e60('0x25')](_0x30c6a5['appdata']);break;case _0x0e60('0x29'):_0x352633[_0x0e60('0x25')](_0x30c6a5[_0x0e60('0x2a')]);_0x352633[_0x0e60('0x25')](_0x30c6a5[_0x0e60('0x22')]);break;case _0x0e60('0x2b'):var _0x9302fe=utils[_0x0e60('0x2c')](_0x128887[_0x0e60('0x2d')][_0x0e60('0x2e')],_0x128887);var _0x2533a9=_0x30c6a5[_0x0e60('0x22')]['split'](',');_0x352633[_0x0e60('0x25')](_0x2533a9[0x0]);_0x352633[_0x0e60('0x25')](_0x2533a9[0x1]);_0x352633[_0x0e60('0x25')](_0x2533a9[0x2]);_0x352633[_0x0e60('0x25')](_0x2533a9[0x3]);_0x352633['push'](_0x2533a9[0x4]);_0x352633['push'](_0x2533a9[0x5]);_0x352633[_0x0e60('0x25')](_0x2533a9[0x6]);_0x352633['push'](_0x2533a9[0x7]);_0x352633[_0x0e60('0x25')](_0x2533a9[0x8]);_0x352633['push'](_0x2533a9[0x9]);_0x352633[_0x0e60('0x25')](_0x2533a9[0xa]);_0x352633[_0x0e60('0x25')](_0x128887[_0x0e60('0x18')]['id']);_0x352633[_0x0e60('0x25')](_0x128887[_0x0e60('0x17')]['id']);_0x352633[_0x0e60('0x25')](_0x30c6a5[_0x0e60('0x2f')]);_0x352633[_0x0e60('0x25')](_0x128887[_0x0e60('0x18')][_0x0e60('0x30')]);_0x352633[_0x0e60('0x25')](_0x128887[_0x0e60('0x31')]['body']);_0x352633[_0x0e60('0x25')](_0x9302fe);break;default:_0x352633=_['isNil'](_0x30c6a5[_0x0e60('0x22')])?[]:_0x30c6a5[_0x0e60('0x22')]['split'](',');}var _0x482583={'id':util[_0x0e60('0xe')](_0x0e60('0x32'),_0xdb7760,_0x30c6a5['id'],_0x30c6a5['app']),'condition':require(_0x0e60('0x33'))[_0x0e60('0x34')](_0xdb7760,getIntervals(_0x37bf95['intervals'],_0x30c6a5),_0x37bf95),'consequence':require(_0x0e60('0x35')+_0x30c6a5[_0x0e60('0x1e')])[_0x0e60('0x36')](_0xdb7760,_0x352633,_0x37bf95,_0x128887),'p':_0x30c6a5[_0x0e60('0x37')]||0x0};logger[_0x0e60('0x38')](_0x0e60('0x39'),_0x482583['id'],_0x0e60('0x3a'),getIntervals(_0x37bf95[_0x0e60('0x3b')],_0x30c6a5)[_0x0e60('0x1d')]('\x20|\x20'));_0x3f2d13['push'](_0x482583);}else{logger['error'](_0x0e60('0x3c'),path['join'](__dirname,_0x0e60('0x1a'),_0x30c6a5[_0x0e60('0x1e')]+_0x0e60('0x1f')));}}_0x37bf95['rules'][_0xdb7760]=new RuleEngine(_0x3f2d13);_0x37bf95[_0x0e60('0x3d')][_0xdb7760][_0x0e60('0x3e')](_0x128887,function(_0x4ce029){logger['info'](_0x0e60('0x3f'),JSON[_0x0e60('0x40')](_0x4ce029[_0x0e60('0x41')]));if(_0x37bf95[_0x0e60('0x3d')][_0xdb7760]){_0x37bf95[_0x0e60('0x3d')][_0xdb7760][_0x0e60('0x42')]('complete');}});return _0x5ab4ba({'code':0xc8,'message':_0x128887});}else{logger[_0x0e60('0x38')](_0x0e60('0x43'));return _0x5ab4ba({'code':0xc8,'message':_0x128887});}}catch(_0x26aa19){logger[_0x0e60('0x44')](_0x26aa19[_0x0e60('0x45')]);return _0x2a8b5a(_0x170890['error'](0x1f4,_0x26aa19));}}return _0x2a8b5a('routing\x20is\x20empty');});},'AcceptMessage':function(_0x527b77){var _0x36f90e=this;return new Promise(function(_0x449f38,_0x497429){if(_0x527b77[_0x0e60('0x46')]&&_0x527b77['agent']['id']){if(_0x37bf95['agents'][_0x527b77['agent']['id']]){_0x37bf95[_0x0e60('0x47')][_0x527b77[_0x0e60('0x46')]['id']][_0x0e60('0x48')]=![];_0x37bf95[_0x0e60('0x47')][_0x527b77[_0x0e60('0x46')]['id']]['busyQueue']=undefined;}}if(_0x527b77['message']&&_0x527b77[_0x0e60('0x17')]['id']){try{var _0x3442fd=getId(_0x527b77[_0x0e60('0x16')],_0x527b77[_0x0e60('0x17')]?_0x527b77['message']['id']:0x0,_0x527b77[_0x0e60('0x18')]?_0x527b77[_0x0e60('0x18')]['id']:0x0);if(_0x37bf95[_0x0e60('0x3d')][_0x3442fd]){_0x37bf95['rules'][_0x3442fd][_0x0e60('0x42')](_0x0e60('0x49'));if(rpc[_0x527b77['channel']+_0x0e60('0x4a')]){rpc[_0x527b77['channel']+_0x0e60('0x4a')][_0x0e60('0x4b')](_0x3442fd,{'UserId':_0x527b77[_0x0e60('0x17')][_0x0e60('0x4c')]})[_0x0e60('0x4d')](function(_0x4caeed){logger[_0x0e60('0x44')](_0x0e60('0x4e'));});}}return _0x449f38({'code':0xc8,'message':_0x527b77});}catch(_0x103c30){logger[_0x0e60('0x44')](_0x103c30['stack']);return _0x497429(_0x36f90e[_0x0e60('0x44')](0x1f4,_0x103c30));}}logger[_0x0e60('0x44')](_0x0e60('0x4f'));return _0x497429(_0x36f90e[_0x0e60('0x44')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2c68f1){var _0x4c6f07=this;return new Promise(function(_0x246d3f,_0x707dc6){if(_0x2c68f1[_0x0e60('0x46')]&&_0x2c68f1[_0x0e60('0x46')]['id']){try{if(_0x37bf95[_0x0e60('0x47')][_0x2c68f1[_0x0e60('0x46')]['id']]){_0x37bf95[_0x0e60('0x47')][_0x2c68f1['agent']['id']][_0x0e60('0x48')]=![];_0x37bf95['agents'][_0x2c68f1[_0x0e60('0x46')]['id']][_0x0e60('0x50')]=undefined;}return _0x246d3f({'code':0xc8,'message':_0x2c68f1});}catch(_0x33795d){logger[_0x0e60('0x44')](_0x33795d['stack']);return _0x707dc6(_0x4c6f07['error'](0x1f4,_0x33795d));}}logger[_0x0e60('0x44')]('message\x20is\x20empty');return _0x707dc6(_0x4c6f07[_0x0e60('0x44')](0x1f4,_0x0e60('0x4f')));});},'AbandonInteraction':function(_0x313dd2){var _0x24ada9=this;return new Promise(function(_0x2bae5c,_0xd8a53f){if(_0x313dd2[_0x0e60('0x16')]&&_0x313dd2[_0x0e60('0x18')]&&_0x313dd2['interaction']['id']){try{var _0x33b560=getId(_0x313dd2[_0x0e60('0x16')],_0x313dd2[_0x0e60('0x17')]?_0x313dd2[_0x0e60('0x17')]['id']:0x0,_0x313dd2[_0x0e60('0x18')]?_0x313dd2['interaction']['id']:0x0);if(_0x37bf95[_0x0e60('0x3d')][_0x33b560]){_0x37bf95[_0x0e60('0x3d')][_0x33b560][_0x0e60('0x42')](_0x0e60('0x49'));}return _0x2bae5c({'code':0xc8,'message':_0x313dd2});}catch(_0x565eab){logger[_0x0e60('0x44')](_0x565eab['stack']);return _0xd8a53f(_0x24ada9[_0x0e60('0x44')](0x1f4,_0x565eab));}}logger[_0x0e60('0x44')](_0x0e60('0x4f'));return _0xd8a53f(_0x24ada9[_0x0e60('0x44')](0x1f4,_0x0e60('0x4f')));});},'AgentCapacity':function(_0x5a202f){var _0xd30fcd=this;return new Promise(function(_0xa55a18,_0x55d4e7){if(_0x37bf95[_0x0e60('0x47')]['hasOwnProperty'](_0x5a202f['id'])){for(var _0x4217f5 in _0x5a202f[_0x0e60('0x51')]){if(_0x5a202f['capacity']['hasOwnProperty'](_0x4217f5)){if(_0x37bf95[_0x0e60('0x47')][_0x5a202f['id']][_0x0e60('0x52')](_0x4217f5+'CurrentCapacity')){_0x37bf95['agents'][_0x5a202f['id']][_0x4217f5+_0x0e60('0x53')]=parseInt(_0x5a202f[_0x0e60('0x51')][_0x4217f5],0xa);}}}_0x37bf95[_0x0e60('0x47')][_0x5a202f['id']][_0x0e60('0x54')]();return _0xa55a18({'code':0xc8,'message':_0x37bf95['agents'][_0x5a202f['id']]});}else{return _0x55d4e7(_0xd30fcd[_0x0e60('0x44')](0x1f4,_0x0e60('0x55')));}});},'Agents':function(_0x29d3d3){return new Promise(function(_0x4db35e,_0x268f13){var _0x348993=_['values'](_0x37bf95[_0x0e60('0x47')]);_0x4db35e({'count':_0x348993[_0x0e60('0x1b')],'rows':_0x348993});});},'ChatQueues':function(_0x478bc0){return new Promise(function(_0x3feff7,_0x1cddaa){var _0x5f383e=[];for(var _0x5cc420 in _0x37bf95[_0x0e60('0x56')]){if(_0x37bf95[_0x0e60('0x56')][_0x0e60('0x52')](_0x5cc420)){var _0x234cc5=_0x37bf95[_0x0e60('0x56')][_0x5cc420];var _0xec104b={'id':_0x234cc5['id'],'available':_0x234cc5[_0x0e60('0x57')],'loggedIn':_0x234cc5[_0x0e60('0x58')],'name':_0x234cc5[_0x0e60('0x59')],'paused':_0x234cc5[_0x0e60('0x5a')],'waiting':_0x234cc5[_0x0e60('0x5b')]};_0x5f383e[_0x0e60('0x25')](_0xec104b);}}_0x3feff7({'count':_0x5f383e[_0x0e60('0x1b')],'rows':_0x5f383e});});},'MailQueues':function(_0x195628){return new Promise(function(_0x19954d,_0x200d81){var _0x635c6=[];for(var _0x51bd75 in _0x37bf95['mailQueues']){if(_0x37bf95[_0x0e60('0x5c')][_0x0e60('0x52')](_0x51bd75)){var _0x15d360=_0x37bf95['mailQueues'][_0x51bd75];var _0x1e61d4={'id':_0x15d360['id'],'available':_0x15d360[_0x0e60('0x57')],'loggedIn':_0x15d360['loggedIn'],'name':_0x15d360[_0x0e60('0x59')],'paused':_0x15d360[_0x0e60('0x5a')],'waiting':_0x15d360[_0x0e60('0x5b')]};_0x635c6['push'](_0x1e61d4);}}_0x19954d({'count':_0x635c6['length'],'rows':_0x635c6});});},'OpenchannelQueues':function(_0x116024){return new Promise(function(_0xeff209,_0x123bca){var _0x46455b=[];for(var _0x3bf971 in _0x37bf95[_0x0e60('0x5d')]){if(_0x37bf95[_0x0e60('0x5d')][_0x0e60('0x52')](_0x3bf971)){var _0x21baa9=_0x37bf95[_0x0e60('0x5d')][_0x3bf971];var _0x2e8ab5={'id':_0x21baa9['id'],'available':_0x21baa9['available'],'loggedIn':_0x21baa9[_0x0e60('0x58')],'name':_0x21baa9[_0x0e60('0x59')],'paused':_0x21baa9[_0x0e60('0x5a')],'waiting':_0x21baa9[_0x0e60('0x5b')]};_0x46455b[_0x0e60('0x25')](_0x2e8ab5);}}_0xeff209({'count':_0x46455b[_0x0e60('0x1b')],'rows':_0x46455b});});},'SmsQueues':function(_0x19af81){return new Promise(function(_0x1172cb,_0x2673e7){var _0x561a10=[];for(var _0x321afc in _0x37bf95[_0x0e60('0x5e')]){if(_0x37bf95[_0x0e60('0x5e')][_0x0e60('0x52')](_0x321afc)){var _0x3c8f3d=_0x37bf95[_0x0e60('0x5e')][_0x321afc];var _0x771b3f={'id':_0x3c8f3d['id'],'available':_0x3c8f3d['available'],'loggedIn':_0x3c8f3d[_0x0e60('0x58')],'name':_0x3c8f3d['name'],'paused':_0x3c8f3d[_0x0e60('0x5a')],'waiting':_0x3c8f3d[_0x0e60('0x5b')]};_0x561a10[_0x0e60('0x25')](_0x771b3f);}}_0x1172cb({'count':_0x561a10[_0x0e60('0x1b')],'rows':_0x561a10});});},'FaxQueues':function(_0x5ca842){return new Promise(function(_0x3ac9b5,_0xd8c436){var _0x5a20cd=[];for(var _0x1e4a62 in _0x37bf95[_0x0e60('0x5f')]){if(_0x37bf95[_0x0e60('0x5f')][_0x0e60('0x52')](_0x1e4a62)){var _0x61be9d=_0x37bf95[_0x0e60('0x5f')][_0x1e4a62];var _0x44b0ec={'id':_0x61be9d['id'],'available':_0x61be9d[_0x0e60('0x57')],'loggedIn':_0x61be9d[_0x0e60('0x58')],'name':_0x61be9d[_0x0e60('0x59')],'paused':_0x61be9d[_0x0e60('0x5a')],'waiting':_0x61be9d[_0x0e60('0x5b')]};_0x5a20cd[_0x0e60('0x25')](_0x44b0ec);}}_0x3ac9b5({'count':_0x5a20cd[_0x0e60('0x1b')],'rows':_0x5a20cd});});},'WhatsappQueues':function(_0x3ff84d){return new Promise(function(_0x2714e8,_0x3fc14b){var _0x3ca122=[];for(var _0x14d92c in _0x37bf95['whatsappQueues']){if(_0x37bf95[_0x0e60('0x60')][_0x0e60('0x52')](_0x14d92c)){var _0x328072=_0x37bf95['whatsappQueues'][_0x14d92c];var _0x1e2337={'id':_0x328072['id'],'available':_0x328072[_0x0e60('0x57')],'loggedIn':_0x328072[_0x0e60('0x58')],'name':_0x328072[_0x0e60('0x59')],'paused':_0x328072['paused'],'waiting':_0x328072[_0x0e60('0x5b')]};_0x3ca122[_0x0e60('0x25')](_0x1e2337);}}_0x2714e8({'count':_0x3ca122[_0x0e60('0x1b')],'rows':_0x3ca122});});},'ChatQueuesWaitingInteractions':function(_0x2732e5){return new Promise(function(_0x391ea9,_0x51a0d9){var _0x21350f=_['values'](_0x37bf95['chatQueuesWaitingInteractions']);_0x391ea9({'count':_0x21350f[_0x0e60('0x1b')],'rows':_0x21350f});});},'MailQueuesWaitingInteractions':function(_0x4ec4b1){return new Promise(function(_0x1e6404,_0x22d7b9){var _0xcd4916=_[_0x0e60('0x61')](_0x37bf95[_0x0e60('0x62')]);_0x1e6404({'count':_0xcd4916[_0x0e60('0x1b')],'rows':_0xcd4916});});},'OpenchannelQueuesWaitingInteractions':function(_0x7b401e){return new Promise(function(_0x25f07f,_0x1bba57){var _0x667c35=_[_0x0e60('0x61')](_0x37bf95[_0x0e60('0x63')]);_0x25f07f({'count':_0x667c35[_0x0e60('0x1b')],'rows':_0x667c35});});},'SmsQueuesWaitingInteractions':function(_0x3ae8c6){return new Promise(function(_0x4c3b4d,_0x41190a){var _0x5c2e92=_[_0x0e60('0x61')](_0x37bf95[_0x0e60('0x64')]);_0x4c3b4d({'count':_0x5c2e92['length'],'rows':_0x5c2e92});});},'FaxQueuesWaitingInteractions':function(_0x35b5a1){return new Promise(function(_0xb50c6f,_0x48e0c4){var _0x348467=_[_0x0e60('0x61')](_0x37bf95['faxQueuesWaitingInteractions']);_0xb50c6f({'count':_0x348467[_0x0e60('0x1b')],'rows':_0x348467});});},'WhatsappQueuesWaitingInteractions':function(_0x137d52){return new Promise(function(_0x1ce984,_0xf23a6d){var _0x1f9d5f=_['values'](_0x37bf95[_0x0e60('0x65')]);_0x1ce984({'count':_0x1f9d5f['length'],'rows':_0x1f9d5f});});}};var _0x543659=jayson[_0x0e60('0x66')](_0x91cd1)[_0x0e60('0x67')]();_0x543659['on']('error',function(_0x2400bf){logger[_0x0e60('0x44')](JSON[_0x0e60('0x40')](_0x2400bf));return _0x508fd0(_0x2400bf);});_0x543659[_0x0e60('0x15')](0x232c,_0x0e60('0x68'),function(){console[_0x0e60('0x69')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4192dd(_0x0e60('0x6a')+0x232c);});});};
\ No newline at end of file
index c7eb16d..6f6f09e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eae=['stack','stop','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','message','indexOf','[%s][INTERVAL]\x20%s','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when'];(function(_0x232c97,_0x1ce27f){var _0x31242f=function(_0x38fd87){while(--_0x38fd87){_0x232c97['push'](_0x232c97['shift']());}};_0x31242f(++_0x1ce27f);}(_0x3eae,0x152));var _0xe3ea=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0x3eae[_0x1d1963];return _0x3f58bb;};'use strict';var util=require(_0xe3ea('0x0'));var BPromise=require('bluebird');var jayson=require(_0xe3ea('0x1'));var _=require(_0xe3ea('0x2'));var logger=require(_0xe3ea('0x3'))(_0xe3ea('0x4'));var client=jayson[_0xe3ea('0x5')][_0xe3ea('0x6')]({'port':0x232a});function request(_0x374dc3,_0x580fc3){return new BPromise(function(_0xe5eae6,_0x24da20){return client[_0xe3ea('0x7')](_0x374dc3,_0x580fc3)[_0xe3ea('0x8')](function(_0x2a26d3){if(_0x2a26d3[_0xe3ea('0x9')]){return _0x24da20(_0x2a26d3['error']['message']);}else{return _0xe5eae6(_0x2a26d3[_0xe3ea('0xa')]);}})[_0xe3ea('0xb')](function(_0x1600f0){return _0x24da20(_0x1600f0);});});}exports[_0xe3ea('0xc')]=function(_0x4f230c,_0x464c11,_0x4003b3){return function(_0x10ab83){if(_0x4003b3[_0xe3ea('0xd')]&&!_0x4003b3[_0xe3ea('0xd')][_0x4f230c]){logger[_0xe3ea('0xe')](_0xe3ea('0xf'),_0x4f230c);return _0x10ab83['stop']();}var _0x335522=[];for(var _0x411490=0x0;_0x411490<_0x464c11[_0xe3ea('0x10')];_0x411490+=0x1){_0x335522[_0xe3ea('0x11')](request(_0xe3ea('0x12'),{'command':util['format']('iftime\x20%s',_0x464c11[_0x411490])})['then'](function(_0x45ae2c){return _0x45ae2c&&_0x45ae2c[_0xe3ea('0x13')]&&_0x45ae2c[_0xe3ea('0x13')][_0xe3ea('0x14')]('true')>=0x0?!![]:![];})[_0xe3ea('0xb')](function(_0x4942d5){logger['error'](_0xe3ea('0x15'),_0x4f230c,_0x464c11[_0x411490]);}));}BPromise['all'](_0x335522)['then'](function(_0x50e8d4){var _0x19db7e=_['some'](_0x50e8d4);logger[_0xe3ea('0xe')](_0xe3ea('0x16'),_0x4f230c,_0x464c11[_0xe3ea('0x17')](_0xe3ea('0x18')),_0x19db7e);_0x10ab83[_0xe3ea('0x19')](_0x19db7e);})['catch'](function(_0x28d7cc){console['log'](_0x28d7cc);logger[_0xe3ea('0x9')](_0xe3ea('0x16'),_0x4f230c,_0x464c11['join']('\x20|\x20'),_0x28d7cc[_0xe3ea('0x1a')]);_0x10ab83[_0xe3ea('0x1b')]();});};};
\ No newline at end of file
+var _0x4d36=['Command','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','info','[%s][INTERVAL]\x20%s\x20%s','join','when','stack','util','bluebird','lodash','../../../config/logger','routing','http','then','error','message','result','catch','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length'];(function(_0x12b650,_0x22418f){var _0x39c3d5=function(_0x1a9a43){while(--_0x1a9a43){_0x12b650['push'](_0x12b650['shift']());}};_0x39c3d5(++_0x22418f);}(_0x4d36,0xf5));var _0x64d3=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x4d36[_0x2f3848];return _0x102668;};'use strict';var util=require(_0x64d3('0x0'));var BPromise=require(_0x64d3('0x1'));var jayson=require('jayson/promise');var _=require(_0x64d3('0x2'));var logger=require(_0x64d3('0x3'))(_0x64d3('0x4'));var client=jayson['client'][_0x64d3('0x5')]({'port':0x232a});function request(_0x5a976f,_0x45cff6){return new BPromise(function(_0x181614,_0x4e692c){return client['request'](_0x5a976f,_0x45cff6)[_0x64d3('0x6')](function(_0x293260){if(_0x293260[_0x64d3('0x7')]){return _0x4e692c(_0x293260[_0x64d3('0x7')][_0x64d3('0x8')]);}else{return _0x181614(_0x293260[_0x64d3('0x9')]);}})[_0x64d3('0xa')](function(_0x444060){return _0x4e692c(_0x444060);});});}exports['condition']=function(_0x47b34f,_0x33576c,_0xad23c1){return function(_0x186cce){if(_0xad23c1['rules']&&!_0xad23c1[_0x64d3('0xb')][_0x47b34f]){logger['info'](_0x64d3('0xc'),_0x47b34f);return _0x186cce[_0x64d3('0xd')]();}var _0x449c59=[];for(var _0x47aac6=0x0;_0x47aac6<_0x33576c[_0x64d3('0xe')];_0x47aac6+=0x1){_0x449c59['push'](request(_0x64d3('0xf'),{'command':util[_0x64d3('0x10')](_0x64d3('0x11'),_0x33576c[_0x47aac6])})[_0x64d3('0x6')](function(_0xe197e){return _0xe197e&&_0xe197e['message']&&_0xe197e['message']['indexOf'](_0x64d3('0x12'))>=0x0?!![]:![];})[_0x64d3('0xa')](function(_0x44d0af){logger[_0x64d3('0x7')](_0x64d3('0x13'),_0x47b34f,_0x33576c[_0x47aac6]);}));}BPromise[_0x64d3('0x14')](_0x449c59)[_0x64d3('0x6')](function(_0x5af110){var _0x505f24=_['some'](_0x5af110);logger[_0x64d3('0x15')](_0x64d3('0x16'),_0x47b34f,_0x33576c[_0x64d3('0x17')]('\x20|\x20'),_0x505f24);_0x186cce[_0x64d3('0x18')](_0x505f24);})['catch'](function(_0xe43bc3){console['log'](_0xe43bc3);logger['error'](_0x64d3('0x16'),_0x47b34f,_0x33576c[_0x64d3('0x17')]('\x20|\x20'),_0xe43bc3[_0x64d3('0x19')]);_0x186cce[_0x64d3('0xd')]();});};};
\ No newline at end of file
index 0390d2d..b38b297 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f6=['[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','calleridname','agententerreason','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','info','format','uniqueid','channel','queue','interface','calleridnum','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','connectedlinename','membername','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','lastevent','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','[%s][agents][agentconnect]'];(function(_0x5ee61f,_0x15bf2e){var _0x89a01f=function(_0x10b7dc){while(--_0x10b7dc){_0x5ee61f['push'](_0x5ee61f['shift']());}};_0x89a01f(++_0x15bf2e);}(_0x13f6,0x124));var _0x613f=function(_0x1c17c7,_0x178043){_0x1c17c7=_0x1c17c7-0x0;var _0x4d1e9d=_0x13f6[_0x1c17c7];return _0x4d1e9d;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563492,_0xd04cfd){utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x563492[_0x613f('0x4')],_0x563492[_0x613f('0x5')],_0x563492[_0x613f('0x6')],_0x563492['membername'],_0x563492[_0x613f('0x7')],_0x563492[_0x613f('0x8')],_0x563492['connectedlinenum'],_0x563492['lastevent']));if(_0x563492['queue']){utils['getVoiceQueueByName'](_0x563492[_0x613f('0x6')])[_0x613f('0x9')](function(_0x363736){if(_0x363736){_0x563492[_0x613f('0xa')]=_0x363736['type'];_0x563492[_0x613f('0xb')]=_0x563492[_0x613f('0xc')]?_0x363736[_0x613f('0xd')]:![];_0x563492['acwtime']=_0x563492[_0x613f('0xb')]?_0x363736[_0x613f('0xe')]:0x0;}utils[_0x613f('0xf')]('CreateVoiceAgentReport',_0x563492);});}else{utils[_0x613f('0xf')](_0x613f('0x10'),_0x563492);}if(_0xd04cfd){delete transfers[_0x563492['uniqueid']];}else{delete agents[_0x563492['destuniqueid']];}}exports['agentcalled']=function(_0x38d90a){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x12'),_0x38d90a[_0x613f('0x4')]),_0x38d90a);agents[_0x38d90a[_0x613f('0x13')]]=_0x38d90a;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();agents[_0x38d90a[_0x613f('0x13')]]['lastevent']=_0x613f('0x16');agents[_0x38d90a['destuniqueid']]['connectedlinenum']=null;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x17')]=null;utils['info'](util[_0x613f('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x38d90a[_0x613f('0x4')],agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x18')],_0x38d90a[_0x613f('0x13')]));}catch(_0x3c0feb){utils[_0x613f('0x19')](util['format']('[%s][agents][agentcalled]',_0x38d90a[_0x613f('0x4')]),_0x3c0feb);}};exports['agentringnoanswer']=function(_0x48493c){try{if(!_[_0x613f('0x1a')](agents[_0x48493c[_0x613f('0x13')]])){utils['debug'](util[_0x613f('0x3')](_0x613f('0x1b'),_0x48493c[_0x613f('0x4')]),_0x48493c);utils['info'](util['format'](_0x613f('0x1c'),_0x48493c[_0x613f('0x4')],agents[_0x48493c[_0x613f('0x13')]]['membername'],_0x48493c[_0x613f('0x13')]));agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1d')]=!![];agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1e')]=utils['now']();agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1f')]='timeout';agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x20')]=_0x613f('0x21');agents[_0x48493c['destuniqueid']]['holdtime']=_0x48493c['ringtime']?parseInt(_0x48493c[_0x613f('0x22')])/0x3e8:0x0;agents[_0x48493c['destuniqueid']][_0x613f('0x23')]=0x0;unanswered[_0x613f('0x24')](_0x48493c['destuniqueid']);}}catch(_0x121241){utils[_0x613f('0x19')](util['format']('[%s][agents][agentringnoanswer]',_0x48493c['uniqueid']),_0x121241);}};exports[_0x613f('0x25')]=function(_0x7c1a94){try{_[_0x613f('0x26')](agents,function(_0x47f4af,_0x23eda8){if(_0x47f4af[_0x613f('0x4')]==_0x7c1a94[_0x613f('0x4')]&&!_[_0x613f('0x27')](unanswered,_0x47f4af['destuniqueid'])){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x7c1a94);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x7c1a94[_0x613f('0x4')],_0x47f4af[_0x613f('0x18')],_0x47f4af[_0x613f('0x13')]));_0x47f4af['agentringnoanswer']=!![];_0x47f4af[_0x613f('0x1e')]=utils['now']();_0x47f4af[_0x613f('0x1f')]=_0x613f('0x29');_0x47f4af[_0x613f('0x20')]=_0x613f('0x29');_0x47f4af[_0x613f('0x2a')]=_0x7c1a94[_0x613f('0x2a')];_0x47f4af['talktime']=0x0;writeDB(_0x47f4af);}});}catch(_0x1a18ce){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x1a18ce);}};exports['agentconnect']=function(_0x59236e){try{if(agents[_0x59236e['destuniqueid']]){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x59236e);utils['info'](util[_0x613f('0x3')](_0x613f('0x2c'),_0x59236e['uniqueid'],agents[_0x59236e[_0x613f('0x13')]]['membername'],_0x59236e[_0x613f('0x13')]));agents[_0x59236e['destuniqueid']][_0x613f('0x2d')]=utils['now']();agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2e')]=_0x59236e[_0x613f('0x2e')];agents[_0x59236e['destuniqueid']][_0x613f('0x17')]=_0x59236e[_0x613f('0x17')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x2f');_[_0x613f('0x26')](agents,function(_0x3313c1,_0x4da8d3){if(_0x3313c1[_0x613f('0x13')]!=_0x59236e[_0x613f('0x13')]&&_0x3313c1[_0x613f('0x4')]==_0x59236e[_0x613f('0x4')]){_0x3313c1[_0x613f('0x23')]=0x0;_0x3313c1[_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];_0x3313c1['agentringnoanswer']=!![];_0x3313c1[_0x613f('0x1e')]=utils[_0x613f('0x15')]();_0x3313c1[_0x613f('0x1f')]=_0x613f('0x30');_0x3313c1[_0x613f('0x20')]=_0x613f('0x30');_0x3313c1[_0x613f('0x31')]=_0x59236e['destuniqueid'];_0x3313c1[_0x613f('0x32')]=_0x59236e[_0x613f('0x18')];writeDB(_0x3313c1);}});}}catch(_0x3bb605){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x3bb605);}};exports[_0x613f('0xc')]=function(_0x403feb){try{if(!_[_0x613f('0x1a')](agents[_0x403feb[_0x613f('0x13')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][agentcomplete]',_0x403feb[_0x613f('0x4')]),_0x403feb);utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x33'),_0x403feb['uniqueid'],agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x18')],_0x403feb[_0x613f('0x13')]));agents[_0x403feb[_0x613f('0x13')]][_0x613f('0xc')]=!![];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x23')]=utils['diffTime'](agents[_0x403feb['destuniqueid']][_0x613f('0x34')],agents[_0x403feb[_0x613f('0x13')]]['agentconnectAt']);agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x20')]=_0x403feb[_0x613f('0x20')];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x35');writeDB(agents[_0x403feb[_0x613f('0x13')]]);}}catch(_0x3a7f95){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x36'),_0x403feb[_0x613f('0x4')]),_0x3a7f95);}};exports[_0x613f('0x37')]=function(_0x17f8e5){try{if(!_[_0x613f('0x1a')](agents[_0x17f8e5[_0x613f('0x38')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]',_0x17f8e5['uniqueid']),_0x17f8e5);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x17f8e5['uniqueid'],agents[_0x17f8e5[_0x613f('0x38')]]['membername'],agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x4')]));agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x39')]=!![];agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x3b');agents[_0x17f8e5['transfereruniqueid']]['transferexten']=_0x17f8e5[_0x613f('0x3c')];agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x3d')]=agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x4')];}}catch(_0x395357){utils[_0x613f('0x19')](util['format']('[%s][agents][blindtransfer]',_0x17f8e5[_0x613f('0x4')]),_0x395357);}};exports['attendedtransfer']=function(_0x5dd54e){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x3e'),_0x5dd54e['origtransfereruniqueid']),_0x5dd54e);if(_0x5dd54e[_0x613f('0x3f')]==_0x5dd54e[_0x613f('0x40')]){if(!_[_0x613f('0x1a')](agents[_0x5dd54e[_0x613f('0x41')]])){utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e[_0x613f('0x41')]]['membername']));agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x39')]=!![];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x44')]=_0x5dd54e[_0x613f('0x45')];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3d')]=_0x5dd54e[_0x613f('0x3f')];}if(_0x5dd54e[_0x613f('0x46')]&&agents[_0x5dd54e[_0x613f('0x46')]]){agents[_0x5dd54e['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x5dd54e[_0x613f('0x46')]]=_['clone'](agents[_0x5dd54e[_0x613f('0x46')]]);transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x47')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x14')]=utils['now']();transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x2d')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x46')]]['holdtime']=0x0;transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x48')]=0x2;}}else if(_0x5dd54e['secondtransfereruniqueid']==_0x5dd54e['secondtransfererlinkedid']){if(!_[_0x613f('0x1a')](agents[_0x5dd54e['origtransfereruniqueid']])){utils['info'](util['format'](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e['origtransfereruniqueid']]['membername']));agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x39')]=!![];agents[_0x5dd54e['origtransfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x44')]=_0x5dd54e['secondtransfererexten'];agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x3d')]=_0x5dd54e['secondtransfereruniqueid'];}if(_0x5dd54e[_0x613f('0x49')]&&agents[_0x5dd54e[_0x613f('0x49')]]){agents[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x1;transfers[_0x5dd54e[_0x613f('0x49')]]=_[_0x613f('0x4a')](agents[_0x5dd54e[_0x613f('0x49')]]);transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x49')]]['calleridname']=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]]['agentconnectAt']=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x2a')]=0x0;transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x2;}}}catch(_0x2ae459){utils['error'](util['format'](_0x613f('0x3e'),_0x5dd54e[_0x613f('0x3f')]),_0x2ae459);}};exports[_0x613f('0x4b')]=function(_0xddcd6){try{utils['debug'](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0xddcd6);if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6['uniqueid']][_0x613f('0x20')]===_0x613f('0x21')){if(_0xddcd6[_0x613f('0x4d')]==='21'){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x4e');agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]='rejected';}utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x18')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]));writeDB(agents[_0xddcd6['uniqueid']]);var _0x2c4b88=unanswered[_0x613f('0x50')](_0xddcd6[_0x613f('0x4')]);if(_0x2c4b88>-0x1){unanswered[_0x613f('0x51')](_0x2c4b88,0x1);}}if(transfers[_0xddcd6[_0x613f('0x4')]]){transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();transfers[_0xddcd6[_0x613f('0x4')]]['talktime']=utils[_0x613f('0x52')](transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')],transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x53');transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]=_0x613f('0x35');utils[_0x613f('0x2')](util['format'](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],transfers[_0xddcd6['uniqueid']][_0x613f('0x18')],transfers[_0xddcd6['uniqueid']][_0x613f('0x20')],transfers[_0xddcd6['uniqueid']]['lastevent']));writeDB(transfers[_0xddcd6[_0x613f('0x4')]],!![]);}if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt']=utils[_0x613f('0x15')]();agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x23')]=utils[_0x613f('0x52')](agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt'],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);agents[_0xddcd6['uniqueid']][_0x613f('0x20')]=agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x39')]?'transfer':'agent';agents[_0xddcd6['uniqueid']][_0x613f('0x1f')]=_0x613f('0x35');utils['info'](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6['uniqueid']][_0x613f('0x18')],agents[_0xddcd6['uniqueid']][_0x613f('0x20')],agents[_0xddcd6['uniqueid']]['lastevent']));writeDB(agents[_0xddcd6[_0x613f('0x4')]]);}}catch(_0x1b5f6e){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0x1b5f6e);}};
\ No newline at end of file
+var _0xb43b=['type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','format','destuniqueid','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','[%s][agents][agentcalled]','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','reason','timeout','ringtime','talktime','push','error','forIn','membername','agentringnoanswerAt','now','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','debug','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferuniqueid','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','lastevent','getVoiceQueueByName','then'];(function(_0x5e4bf1,_0x198cce){var _0x1b98d1=function(_0xe4c761){while(--_0xe4c761){_0x5e4bf1['push'](_0x5e4bf1['shift']());}};_0x1b98d1(++_0x198cce);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5467f0,_0xe1e655){_0x5467f0=_0x5467f0-0x0;var _0x5bf1ea=_0xb43b[_0x5467f0];return _0x5bf1ea;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1bdcfc,_0x1995f8){utils[_0xbb43('0x2')](util['format'](_0xbb43('0x3'),_0x1bdcfc[_0xbb43('0x4')],_0x1bdcfc[_0xbb43('0x5')],_0x1bdcfc[_0xbb43('0x6')],_0x1bdcfc['membername'],_0x1bdcfc['interface'],_0x1bdcfc[_0xbb43('0x7')],_0x1bdcfc['connectedlinenum'],_0x1bdcfc[_0xbb43('0x8')]));if(_0x1bdcfc[_0xbb43('0x6')]){utils[_0xbb43('0x9')](_0x1bdcfc[_0xbb43('0x6')])[_0xbb43('0xa')](function(_0x4a06f3){if(_0x4a06f3){_0x1bdcfc[_0xbb43('0xb')]=_0x4a06f3[_0xbb43('0xb')];_0x1bdcfc['agentacw']=_0x1bdcfc[_0xbb43('0xc')]?_0x4a06f3[_0xbb43('0xd')]:![];_0x1bdcfc[_0xbb43('0xe')]=_0x1bdcfc[_0xbb43('0xf')]?_0x4a06f3[_0xbb43('0x10')]:0x0;}utils[_0xbb43('0x11')]('CreateVoiceAgentReport',_0x1bdcfc);});}else{utils[_0xbb43('0x11')](_0xbb43('0x12'),_0x1bdcfc);}if(_0x1995f8){delete transfers[_0x1bdcfc['uniqueid']];}else{delete agents[_0x1bdcfc['destuniqueid']];}}exports[_0xbb43('0x13')]=function(_0x4a3714){try{utils['debug'](util[_0xbb43('0x14')]('[%s][agents][agentcalled]',_0x4a3714[_0xbb43('0x4')]),_0x4a3714);agents[_0x4a3714[_0xbb43('0x15')]]=_0x4a3714;agents[_0x4a3714['destuniqueid']]['agentcalledAt']=utils['now']();agents[_0x4a3714[_0xbb43('0x15')]][_0xbb43('0x8')]='called';agents[_0x4a3714['destuniqueid']][_0xbb43('0x16')]=null;agents[_0x4a3714['destuniqueid']]['connectedlinename']=null;utils[_0xbb43('0x2')](util[_0xbb43('0x14')](_0xbb43('0x17'),_0x4a3714['uniqueid'],agents[_0x4a3714[_0xbb43('0x15')]]['membername'],_0x4a3714[_0xbb43('0x15')]));}catch(_0x8e6429){utils['error'](util['format'](_0xbb43('0x18'),_0x4a3714[_0xbb43('0x4')]),_0x8e6429);}};exports[_0xbb43('0x19')]=function(_0x2bf2d4){try{if(!_['isNil'](agents[_0x2bf2d4[_0xbb43('0x15')]])){utils['debug'](util[_0xbb43('0x14')]('[%s][agents][agentringnoanswer]',_0x2bf2d4[_0xbb43('0x4')]),_0x2bf2d4);utils['info'](util[_0xbb43('0x14')](_0xbb43('0x1a'),_0x2bf2d4['uniqueid'],agents[_0x2bf2d4[_0xbb43('0x15')]]['membername'],_0x2bf2d4[_0xbb43('0x15')]));agents[_0x2bf2d4[_0xbb43('0x15')]][_0xbb43('0x19')]=!![];agents[_0x2bf2d4['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x2bf2d4[_0xbb43('0x15')]][_0xbb43('0x8')]='timeout';agents[_0x2bf2d4[_0xbb43('0x15')]][_0xbb43('0x1b')]=_0xbb43('0x1c');agents[_0x2bf2d4[_0xbb43('0x15')]]['holdtime']=_0x2bf2d4['ringtime']?parseInt(_0x2bf2d4[_0xbb43('0x1d')])/0x3e8:0x0;agents[_0x2bf2d4[_0xbb43('0x15')]][_0xbb43('0x1e')]=0x0;unanswered[_0xbb43('0x1f')](_0x2bf2d4[_0xbb43('0x15')]);}}catch(_0x40b04b){utils[_0xbb43('0x20')](util[_0xbb43('0x14')]('[%s][agents][agentringnoanswer]',_0x2bf2d4[_0xbb43('0x4')]),_0x40b04b);}};exports['queuecallerabandon']=function(_0x31fbc8){try{_[_0xbb43('0x21')](agents,function(_0x34f5b2,_0x1880cd){if(_0x34f5b2['uniqueid']==_0x31fbc8[_0xbb43('0x4')]&&!_['includes'](unanswered,_0x34f5b2['destuniqueid'])){utils['debug'](util[_0xbb43('0x14')]('[%s][agents][queuecallerabandon]',_0x31fbc8[_0xbb43('0x4')]),_0x31fbc8);utils[_0xbb43('0x2')](util[_0xbb43('0x14')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x31fbc8[_0xbb43('0x4')],_0x34f5b2[_0xbb43('0x22')],_0x34f5b2[_0xbb43('0x15')]));_0x34f5b2[_0xbb43('0x19')]=!![];_0x34f5b2[_0xbb43('0x23')]=utils[_0xbb43('0x24')]();_0x34f5b2[_0xbb43('0x8')]=_0xbb43('0x25');_0x34f5b2['reason']=_0xbb43('0x25');_0x34f5b2[_0xbb43('0x26')]=_0x31fbc8[_0xbb43('0x26')];_0x34f5b2[_0xbb43('0x1e')]=0x0;writeDB(_0x34f5b2);}});}catch(_0x4015ec){utils[_0xbb43('0x20')](util[_0xbb43('0x14')](_0xbb43('0x27'),_0x31fbc8[_0xbb43('0x4')]),_0x4015ec);}};exports[_0xbb43('0x28')]=function(_0x21346a){try{if(agents[_0x21346a[_0xbb43('0x15')]]){utils[_0xbb43('0x29')](util[_0xbb43('0x14')](_0xbb43('0x2a'),_0x21346a[_0xbb43('0x4')]),_0x21346a);utils['info'](util[_0xbb43('0x14')](_0xbb43('0x2b'),_0x21346a['uniqueid'],agents[_0x21346a[_0xbb43('0x15')]][_0xbb43('0x22')],_0x21346a[_0xbb43('0x15')]));agents[_0x21346a['destuniqueid']]['agentconnectAt']=utils['now']();agents[_0x21346a[_0xbb43('0x15')]][_0xbb43('0x16')]=_0x21346a['connectedlinenum'];agents[_0x21346a['destuniqueid']][_0xbb43('0x2c')]=_0x21346a[_0xbb43('0x2c')];agents[_0x21346a[_0xbb43('0x15')]][_0xbb43('0x26')]=_0x21346a[_0xbb43('0x1d')];agents[_0x21346a['destuniqueid']][_0xbb43('0x8')]=_0xbb43('0x2d');_[_0xbb43('0x21')](agents,function(_0x3340aa,_0x22fccc){if(_0x3340aa['destuniqueid']!=_0x21346a[_0xbb43('0x15')]&&_0x3340aa['uniqueid']==_0x21346a[_0xbb43('0x4')]){_0x3340aa[_0xbb43('0x1e')]=0x0;_0x3340aa['holdtime']=_0x21346a[_0xbb43('0x1d')];_0x3340aa['agentringnoanswer']=!![];_0x3340aa[_0xbb43('0x23')]=utils[_0xbb43('0x24')]();_0x3340aa[_0xbb43('0x8')]=_0xbb43('0x2e');_0x3340aa['reason']=_0xbb43('0x2e');_0x3340aa[_0xbb43('0x2f')]=_0x21346a['destuniqueid'];_0x3340aa[_0xbb43('0x30')]=_0x21346a['membername'];writeDB(_0x3340aa);}});}}catch(_0x42b965){utils[_0xbb43('0x20')](util[_0xbb43('0x14')](_0xbb43('0x2a'),_0x21346a[_0xbb43('0x4')]),_0x42b965);}};exports[_0xbb43('0xc')]=function(_0x4bf8ed){try{if(!_[_0xbb43('0x31')](agents[_0x4bf8ed['destuniqueid']])){utils[_0xbb43('0x29')](util[_0xbb43('0x14')](_0xbb43('0x32'),_0x4bf8ed[_0xbb43('0x4')]),_0x4bf8ed);utils['info'](util[_0xbb43('0x14')](_0xbb43('0x33'),_0x4bf8ed[_0xbb43('0x4')],agents[_0x4bf8ed[_0xbb43('0x15')]][_0xbb43('0x22')],_0x4bf8ed[_0xbb43('0x15')]));agents[_0x4bf8ed[_0xbb43('0x15')]][_0xbb43('0xc')]=!![];agents[_0x4bf8ed['destuniqueid']][_0xbb43('0x34')]=utils[_0xbb43('0x24')]();agents[_0x4bf8ed['destuniqueid']][_0xbb43('0x1e')]=utils['diffTime'](agents[_0x4bf8ed['destuniqueid']]['agentcompleteAt'],agents[_0x4bf8ed['destuniqueid']][_0xbb43('0x35')]);agents[_0x4bf8ed['destuniqueid']][_0xbb43('0x1b')]=_0x4bf8ed['reason'];agents[_0x4bf8ed[_0xbb43('0x15')]][_0xbb43('0x8')]=_0xbb43('0x36');writeDB(agents[_0x4bf8ed['destuniqueid']]);}}catch(_0x186cd6){utils['error'](util[_0xbb43('0x14')](_0xbb43('0x32'),_0x4bf8ed[_0xbb43('0x4')]),_0x186cd6);}};exports[_0xbb43('0x37')]=function(_0x417ad9){try{if(!_[_0xbb43('0x31')](agents[_0x417ad9[_0xbb43('0x38')]])){utils['debug'](util[_0xbb43('0x14')](_0xbb43('0x39'),_0x417ad9[_0xbb43('0x4')]),_0x417ad9);utils[_0xbb43('0x2')](util['format'](_0xbb43('0x3a'),_0x417ad9[_0xbb43('0x4')],agents[_0x417ad9[_0xbb43('0x38')]][_0xbb43('0x22')],agents[_0x417ad9['transfereruniqueid']][_0xbb43('0x4')]));agents[_0x417ad9[_0xbb43('0x38')]][_0xbb43('0x3b')]=!![];agents[_0x417ad9['transfereruniqueid']][_0xbb43('0x3c')]=_0xbb43('0x3d');agents[_0x417ad9[_0xbb43('0x38')]][_0xbb43('0x3e')]=_0x417ad9[_0xbb43('0x3f')];agents[_0x417ad9['transfereruniqueid']]['transferuniqueid']=agents[_0x417ad9[_0xbb43('0x38')]]['uniqueid'];}}catch(_0xf5d5c){utils[_0xbb43('0x20')](util['format'](_0xbb43('0x39'),_0x417ad9[_0xbb43('0x4')]),_0xf5d5c);}};exports[_0xbb43('0x40')]=function(_0x1a4367){try{utils[_0xbb43('0x29')](util['format'](_0xbb43('0x41'),_0x1a4367['origtransfereruniqueid']),_0x1a4367);if(_0x1a4367['origtransfereruniqueid']==_0x1a4367[_0xbb43('0x42')]){if(!_[_0xbb43('0x31')](agents[_0x1a4367[_0xbb43('0x43')]])){utils[_0xbb43('0x2')](util[_0xbb43('0x14')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1a4367['origtransfereruniqueid'],agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x22')]));agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x3b')]=!![];agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x3c')]=_0xbb43('0x44');agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x3e')]=_0x1a4367['origtransfererexten'];agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x45')]=_0x1a4367[_0xbb43('0x46')];}if(_0x1a4367[_0xbb43('0x47')]&&agents[_0x1a4367[_0xbb43('0x47')]]){agents[_0x1a4367[_0xbb43('0x47')]][_0xbb43('0x48')]=0x1;transfers[_0x1a4367[_0xbb43('0x47')]]=_[_0xbb43('0x49')](agents[_0x1a4367['transfereeuniqueid']]);transfers[_0x1a4367['transfereeuniqueid']][_0xbb43('0x7')]=agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x7')];transfers[_0x1a4367[_0xbb43('0x47')]][_0xbb43('0x4a')]=agents[_0x1a4367[_0xbb43('0x43')]][_0xbb43('0x4a')];transfers[_0x1a4367['transfereeuniqueid']][_0xbb43('0x4b')]=utils['now']();transfers[_0x1a4367['transfereeuniqueid']][_0xbb43('0x35')]=utils[_0xbb43('0x24')]();transfers[_0x1a4367[_0xbb43('0x47')]][_0xbb43('0x26')]=0x0;transfers[_0x1a4367[_0xbb43('0x47')]][_0xbb43('0x48')]=0x2;}}else if(_0x1a4367[_0xbb43('0x43')]==_0x1a4367[_0xbb43('0x4c')]){if(!_['isNil'](agents[_0x1a4367['origtransfereruniqueid']])){utils[_0xbb43('0x2')](util[_0xbb43('0x14')](_0xbb43('0x4d'),_0x1a4367[_0xbb43('0x46')],agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x22')]));agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x3b')]=!![];agents[_0x1a4367[_0xbb43('0x46')]]['transfertype']=_0xbb43('0x44');agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x3e')]=_0x1a4367[_0xbb43('0x4e')];agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x45')]=_0x1a4367['secondtransfereruniqueid'];}if(_0x1a4367[_0xbb43('0x4f')]&&agents[_0x1a4367[_0xbb43('0x4f')]]){agents[_0x1a4367[_0xbb43('0x4f')]][_0xbb43('0x48')]=0x1;transfers[_0x1a4367[_0xbb43('0x4f')]]=_['clone'](agents[_0x1a4367[_0xbb43('0x4f')]]);transfers[_0x1a4367[_0xbb43('0x4f')]][_0xbb43('0x7')]=agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x7')];transfers[_0x1a4367[_0xbb43('0x4f')]][_0xbb43('0x4a')]=agents[_0x1a4367[_0xbb43('0x46')]][_0xbb43('0x4a')];transfers[_0x1a4367[_0xbb43('0x4f')]]['agentcalledAt']=utils[_0xbb43('0x24')]();transfers[_0x1a4367['transfertargetuniqueid']][_0xbb43('0x35')]=utils[_0xbb43('0x24')]();transfers[_0x1a4367[_0xbb43('0x4f')]][_0xbb43('0x26')]=0x0;transfers[_0x1a4367[_0xbb43('0x4f')]]['agententerreason']=0x2;}}}catch(_0x59a665){utils[_0xbb43('0x20')](util[_0xbb43('0x14')]('[%s][agents][attendedtransfer]',_0x1a4367[_0xbb43('0x46')]),_0x59a665);}};exports[_0xbb43('0x50')]=function(_0x41d26a){try{utils[_0xbb43('0x29')](util[_0xbb43('0x14')](_0xbb43('0x51'),_0x41d26a[_0xbb43('0x4')]),_0x41d26a);if(agents[_0x41d26a[_0xbb43('0x4')]]&&agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1b')]===_0xbb43('0x1c')){if(_0x41d26a[_0xbb43('0x52')]==='21'){agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1b')]='rejected';agents[_0x41d26a['uniqueid']][_0xbb43('0x8')]=_0xbb43('0x53');}utils[_0xbb43('0x2')](util['format'](_0xbb43('0x54'),_0x41d26a[_0xbb43('0x4')],agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x22')],agents[_0x41d26a[_0xbb43('0x4')]]['reason'],agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x8')]));writeDB(agents[_0x41d26a[_0xbb43('0x4')]]);var _0x4c1405=unanswered[_0xbb43('0x55')](_0x41d26a[_0xbb43('0x4')]);if(_0x4c1405>-0x1){unanswered[_0xbb43('0x56')](_0x4c1405,0x1);}}if(transfers[_0x41d26a[_0xbb43('0x4')]]){transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0xc')]=!![];transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x34')]=utils[_0xbb43('0x24')]();transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1e')]=utils['diffTime'](transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x34')],transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x35')]);transfers[_0x41d26a[_0xbb43('0x4')]]['reason']='agent';transfers[_0x41d26a['uniqueid']][_0xbb43('0x8')]=_0xbb43('0x36');utils[_0xbb43('0x2')](util[_0xbb43('0x14')](_0xbb43('0x54'),_0x41d26a[_0xbb43('0x4')],transfers[_0x41d26a[_0xbb43('0x4')]]['membername'],transfers[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1b')],transfers[_0x41d26a[_0xbb43('0x4')]]['lastevent']));writeDB(transfers[_0x41d26a[_0xbb43('0x4')]],!![]);}if(agents[_0x41d26a['uniqueid']]&&agents[_0x41d26a[_0xbb43('0x4')]]['agentconnectAt']){agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0xc')]=!![];agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x34')]=utils[_0xbb43('0x24')]();agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1e')]=utils[_0xbb43('0x57')](agents[_0x41d26a['uniqueid']][_0xbb43('0x34')],agents[_0x41d26a[_0xbb43('0x4')]]['agentconnectAt']);agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x1b')]=agents[_0x41d26a[_0xbb43('0x4')]]['transfer']?_0xbb43('0x3b'):_0xbb43('0x58');agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x8')]=_0xbb43('0x36');utils[_0xbb43('0x2')](util['format'](_0xbb43('0x54'),_0x41d26a['uniqueid'],agents[_0x41d26a[_0xbb43('0x4')]][_0xbb43('0x22')],agents[_0x41d26a['uniqueid']][_0xbb43('0x1b')],agents[_0x41d26a[_0xbb43('0x4')]]['lastevent']));writeDB(agents[_0x41d26a['uniqueid']]);}}catch(_0x337154){utils[_0xbb43('0x20')](util[_0xbb43('0x14')](_0xbb43('0x51'),_0x41d26a[_0xbb43('0x4')]),_0x337154);}};
\ No newline at end of file
index 50a9b86..1ef4bb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5957=['value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','accountcode','getUserByInternal','UserId','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum'];(function(_0x3cb9d1,_0x2796a4){var _0x317ac3=function(_0xea4503){while(--_0xea4503){_0x3cb9d1['push'](_0x3cb9d1['shift']());}};_0x317ac3(++_0x2796a4);}(_0x5957,0x158));var _0x7595=function(_0x1045dd,_0x3af6c0){_0x1045dd=_0x1045dd-0x0;var _0x14ddfe=_0x5957[_0x1045dd];return _0x14ddfe;};'use strict';var _=require(_0x7595('0x0'));var util=require(_0x7595('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0x7595('0x2'),'FAILED',_0x7595('0x3'),_0x7595('0x2'),_0x7595('0x2'),_0x7595('0x2'),_0x7595('0x4'),_0x7595('0x5'),'FAILED','FAILED',_0x7595('0x3')];var channels={};function writeDB(_0x21bbac){var _0x53323d;if(transfers[_0x7595('0x6')][_0x21bbac[_0x7595('0x7')]]){_0x53323d=_0x21bbac[_0x7595('0x7')];_0x21bbac[_0x7595('0x7')]=transfers[_0x7595('0x6')][_0x21bbac[_0x7595('0x7')]]['transfereeuniqueid'];}utils[_0x7595('0x8')](util[_0x7595('0x9')](_0x7595('0xa'),_0x21bbac[_0x7595('0x7')],_0x21bbac[_0x7595('0xb')],_0x21bbac[_0x7595('0xc')],_0x21bbac[_0x7595('0xd')],_0x21bbac['interface'],_0x21bbac[_0x7595('0xe')],_0x21bbac[_0x7595('0xf')],_0x21bbac['lastevent']));if(_0x21bbac[_0x7595('0x10')]){utils[_0x7595('0x11')](_0x21bbac[_0x7595('0x10')])['then'](function(_0x8d1732){if(_0x8d1732){_0x21bbac[_0x7595('0x12')]=_0x8d1732['id'];}utils['request'](_0x7595('0x13'),_0x21bbac);});}else{utils['request']('CreateVoiceCallReport',_0x21bbac);}if(channels[_0x21bbac[_0x7595('0x7')]]){delete channels[_0x21bbac[_0x7595('0x7')]];}else if(_0x53323d&&channels[_0x53323d]){if(!transfers[_0x7595('0x6')][_0x53323d][_0x7595('0x14')])delete transfers[_0x7595('0x6')][_0x53323d];delete channels[_0x53323d];}}exports[_0x7595('0x15')]=function(_0x2efcec){try{utils['debug'](util[_0x7595('0x9')](_0x7595('0x16'),_0x2efcec[_0x7595('0x7')]),_0x2efcec);if(_0x2efcec['uniqueid']==_0x2efcec['linkedid']&&_0x2efcec[_0x7595('0xb')]!=_0x7595('0x17')){utils[_0x7595('0x8')](util['format'](_0x7595('0x18'),_0x2efcec[_0x7595('0x7')],_0x2efcec[_0x7595('0x19')],_0x2efcec['exten']));channels[_0x2efcec[_0x7595('0x7')]]={'uniqueid':_0x2efcec[_0x7595('0x7')],'accountcode':_0x2efcec[_0x7595('0x10')],'source':_0x2efcec[_0x7595('0xe')],'destination':_0x2efcec['exten'],'destinationcontext':_0x2efcec[_0x7595('0x19')],'channel':_0x2efcec[_0x7595('0xb')],'starttime':utils[_0x7595('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x7595('0x1b')};}}catch(_0x56c2f2){utils[_0x7595('0x1c')](util[_0x7595('0x9')](_0x7595('0x16'),_0x2efcec[_0x7595('0x7')]),_0x56c2f2);}};exports[_0x7595('0x1d')]=function(_0x3e498e){try{utils[_0x7595('0x1e')](util['format'](_0x7595('0x1f'),_0x3e498e[_0x7595('0x7')]),_0x3e498e);if(!_[_0x7595('0x20')](channels[_0x3e498e[_0x7595('0x7')]])&&_0x3e498e[_0x7595('0x21')]==0x6){utils[_0x7595('0x8')](util[_0x7595('0x9')](_0x7595('0x22'),_0x3e498e[_0x7595('0x7')],_0x3e498e[_0x7595('0x19')],_0x3e498e[_0x7595('0xb')]));if(_['isNil'](channels[_0x3e498e[_0x7595('0x7')]]['systemanswertime'])){channels[_0x3e498e[_0x7595('0x7')]][_0x7595('0x23')]=utils[_0x7595('0x1a')]();}}else if(!_['isNil'](channels[_0x3e498e[_0x7595('0x24')]])&&_0x3e498e['channelstate']==0x6&&_0x3e498e[_0x7595('0x19')]!=_0x7595('0x25')){utils['info'](util[_0x7595('0x9')](_0x7595('0x26'),_0x3e498e[_0x7595('0x7')],_0x3e498e[_0x7595('0x24')],_0x3e498e[_0x7595('0x19')],_0x3e498e[_0x7595('0xb')]));channels[_0x3e498e['linkedid']][_0x7595('0x10')]=_0x3e498e[_0x7595('0x10')];channels[_0x3e498e[_0x7595('0x24')]][_0x7595('0x27')]=_0x3e498e['channel'];if(_[_0x7595('0x20')](channels[_0x3e498e[_0x7595('0x24')]]['answertime'])){channels[_0x3e498e[_0x7595('0x24')]][_0x7595('0x28')]=utils['now']();}channels[_0x3e498e['linkedid']]['disposition']=dispositions[_[_0x7595('0x29')](_0x3e498e['channelstate'])]||_0x7595('0x4');}}catch(_0x255fa2){utils[_0x7595('0x1c')](util[_0x7595('0x9')](_0x7595('0x1f'),_0x3e498e['uniqueid']),_0x255fa2);}};exports[_0x7595('0x2a')]=function(_0x4e3937){try{if(!_[_0x7595('0x20')](channels[_0x4e3937['uniqueid']])){utils[_0x7595('0x1e')](util[_0x7595('0x9')](_0x7595('0x2b'),_0x4e3937[_0x7595('0x7')]),_0x4e3937);if(_[_0x7595('0x20')](channels[_0x4e3937['uniqueid']]['callerid'])){channels[_0x4e3937[_0x7595('0x7')]][_0x7595('0x2c')]=_0x4e3937[_0x7595('0x2d')]+'\x20<'+_0x4e3937[_0x7595('0xe')]+'>';}utils[_0x7595('0x8')](util[_0x7595('0x9')](_0x7595('0x2e'),_0x4e3937[_0x7595('0x7')],channels[_0x4e3937[_0x7595('0x7')]]['callerid'],_0x4e3937[_0x7595('0x2f')]));channels[_0x4e3937[_0x7595('0x7')]][_0x7595('0x30')]=utils[_0x7595('0x1a')]();channels[_0x4e3937[_0x7595('0x7')]][_0x7595('0x31')]=utils[_0x7595('0x32')](channels[_0x4e3937['uniqueid']][_0x7595('0x30')],channels[_0x4e3937[_0x7595('0x7')]][_0x7595('0x33')]);channels[_0x4e3937[_0x7595('0x7')]][_0x7595('0x34')]=channels[_0x4e3937[_0x7595('0x7')]][_0x7595('0x28')]?utils[_0x7595('0x32')](channels[_0x4e3937[_0x7595('0x7')]][_0x7595('0x30')],channels[_0x4e3937[_0x7595('0x7')]][_0x7595('0x28')]):0x0;writeDB(channels[_0x4e3937[_0x7595('0x7')]]);}}catch(_0x2ac4a9){utils[_0x7595('0x1c')](util[_0x7595('0x9')](_0x7595('0x2b'),_0x4e3937[_0x7595('0x7')]),_0x2ac4a9);}};exports[_0x7595('0x35')]=function(_0x3a4c9a){try{if(!_[_0x7595('0x20')](channels[_0x3a4c9a['localtwolinkedid']])){utils[_0x7595('0x1e')](util[_0x7595('0x9')](_0x7595('0x36'),_0x3a4c9a[_0x7595('0x37')]),_0x3a4c9a);if(channels[_0x3a4c9a['localtwolinkedid']]['channel']==_0x3a4c9a[_0x7595('0x38')]){utils[_0x7595('0x8')](util['format'](_0x7595('0x39'),_0x3a4c9a[_0x7595('0x37')],_0x3a4c9a[_0x7595('0x3a')],_0x3a4c9a[_0x7595('0x3b')]));channels[_0x3a4c9a[_0x7595('0x3a')]][_0x7595('0x27')]=_0x3a4c9a[_0x7595('0x3b')];channels[_0x3a4c9a[_0x7595('0x3a')]][_0x7595('0x3c')]=_0x7595('0x3d');}else if(channels[_0x3a4c9a[_0x7595('0x3a')]][_0x7595('0xb')]=_0x3a4c9a[_0x7595('0x3e')]){utils[_0x7595('0x8')](util[_0x7595('0x9')](_0x7595('0x39'),_0x3a4c9a['origtransfereruniqueid'],_0x3a4c9a[_0x7595('0x3a')],_0x3a4c9a[_0x7595('0x3f')]));channels[_0x3a4c9a['localtwolinkedid']][_0x7595('0x27')]=_0x3a4c9a['origtransfererchannel'];channels[_0x3a4c9a['localtwolinkedid']][_0x7595('0x3c')]='_attended';}}}catch(_0x5df399){utils['error'](util[_0x7595('0x9')](_0x7595('0x36'),_0x3a4c9a[_0x7595('0x37')]),_0x5df399);}};exports['musiconholdstart']=function(_0x15fa94){try{if(!_[_0x7595('0x20')](channels[_0x15fa94[_0x7595('0x7')]])){utils[_0x7595('0x1e')](util['format']('[%s][calls][musiconholdstart]',_0x15fa94[_0x7595('0x7')]),_0x15fa94);channels[_0x15fa94[_0x7595('0x7')]][_0x7595('0x40')]=utils[_0x7595('0x1a')]();utils[_0x7595('0x8')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x15fa94['uniqueid'],channels[_0x15fa94[_0x7595('0x7')]]['musiconholdstartAt']));}}catch(_0x5aa83d){utils['error'](util[_0x7595('0x9')](_0x7595('0x41'),_0x15fa94[_0x7595('0x7')]),_0x5aa83d);}};exports[_0x7595('0x42')]=function(_0x40df35){try{if(!_['isNil'](channels[_0x40df35[_0x7595('0x7')]])){utils[_0x7595('0x1e')](util[_0x7595('0x9')]('[%s][calls][musiconholdstop]',_0x40df35[_0x7595('0x7')]),_0x40df35);if(!_[_0x7595('0x20')](channels[_0x40df35[_0x7595('0x7')]][_0x7595('0x40')])){channels[_0x40df35[_0x7595('0x7')]][_0x7595('0x43')]+=utils['diffTime'](utils[_0x7595('0x1a')](),channels[_0x40df35[_0x7595('0x7')]][_0x7595('0x40')]);utils[_0x7595('0x8')](util[_0x7595('0x9')](_0x7595('0x44'),_0x40df35['uniqueid'],channels[_0x40df35['uniqueid']][_0x7595('0x43')]));delete channels[_0x40df35[_0x7595('0x7')]][_0x7595('0x40')];}}}catch(_0x411184){utils[_0x7595('0x1c')](util[_0x7595('0x9')]('[%s][calls][musiconholdstop]',_0x40df35['uniqueid']),_0x411184);}};exports['varset']=function(_0x128a2a){try{if(!_[_0x7595('0x20')](channels[_0x128a2a['uniqueid']])){utils[_0x7595('0x1e')](util['format'](_0x7595('0x45'),_0x128a2a[_0x7595('0x7')]),_0x128a2a);if(!_[_0x7595('0x20')](_0x128a2a[_0x7595('0x46')][_0x7595('0x47')])){utils[_0x7595('0x8')](util[_0x7595('0x9')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x128a2a[_0x7595('0x7')],_0x128a2a[_0x7595('0x48')]));channels[_0x128a2a[_0x7595('0x7')]][_0x7595('0x49')]=_0x128a2a[_0x7595('0x48')];}if(!_[_0x7595('0x20')](_0x128a2a['variable'][_0x7595('0x4a')])){utils[_0x7595('0x8')](util[_0x7595('0x9')](_0x7595('0x4b'),_0x128a2a[_0x7595('0x7')],_0x128a2a['value']));channels[_0x128a2a['uniqueid']][_0x7595('0x4c')]=_0x128a2a[_0x7595('0x48')];channels[_0x128a2a[_0x7595('0x7')]][_0x7595('0x2c')]='\x22'+_0x128a2a['value']+'\x22\x20<'+_0x128a2a[_0x7595('0x48')]+'>';}if(!_[_0x7595('0x20')](_0x128a2a[_0x7595('0x46')][_0x7595('0x4d')])||!_[_0x7595('0x20')](_0x128a2a['variable'][_0x7595('0x4e')])){utils[_0x7595('0x8')](util[_0x7595('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x128a2a[_0x7595('0x7')],!_['isNil'](_0x128a2a['variable'][_0x7595('0x4d')])?_0x7595('0x4d'):_0x7595('0x4e'),_0x128a2a[_0x7595('0x48')]));channels[_0x128a2a[_0x7595('0x7')]]['callerid']=_0x128a2a['value'];}if(!_['isNil'](_0x128a2a[_0x7595('0x46')][_0x7595('0x4f')])||!_[_0x7595('0x20')](_0x128a2a[_0x7595('0x46')][_0x7595('0x50')])){utils[_0x7595('0x8')](util[_0x7595('0x9')](_0x7595('0x51'),_0x128a2a['uniqueid'],!_[_0x7595('0x20')](_0x128a2a[_0x7595('0x46')][_0x7595('0x4f')])?_0x7595('0x4f'):_0x7595('0x50'),_0x128a2a[_0x7595('0x48')]));channels[_0x128a2a['uniqueid']][_0x7595('0x52')]='Queue';channels[_0x128a2a[_0x7595('0x7')]][_0x7595('0x53')]=_0x128a2a['value'];channels[_0x128a2a[_0x7595('0x7')]][_0x7595('0xc')]=!![];}if(!_[_0x7595('0x20')](_0x128a2a[_0x7595('0x46')]['xmd-contactid'])){utils['info'](util[_0x7595('0x9')](_0x7595('0x54'),_0x128a2a[_0x7595('0x7')],_0x128a2a[_0x7595('0x48')]));channels[_0x128a2a[_0x7595('0x7')]]['ContactId']=_0x128a2a[_0x7595('0x48')];}if(!_[_0x7595('0x20')](_0x128a2a[_0x7595('0x46')]['xmd-cdrtype'])){utils['info'](util[_0x7595('0x9')](_0x7595('0x55'),_0x128a2a[_0x7595('0x7')],_0x128a2a['value']));channels[_0x128a2a[_0x7595('0x7')]]['type']=_0x128a2a[_0x7595('0x48')];}if(!_[_0x7595('0x20')](_0x128a2a[_0x7595('0x46')][_0x7595('0x56')])){utils[_0x7595('0x8')](util['format'](_0x7595('0x57'),_0x128a2a[_0x7595('0x7')],_0x128a2a[_0x7595('0x48')]));channels[_0x128a2a[_0x7595('0x7')]]['routeid']=_0x128a2a[_0x7595('0x48')];}if(!_[_0x7595('0x20')](_0x128a2a['variable'][_0x7595('0x58')])){utils[_0x7595('0x8')](util[_0x7595('0x9')](_0x7595('0x59'),_0x128a2a[_0x7595('0x7')],_0x128a2a[_0x7595('0x48')]));channels[_0x128a2a['uniqueid']]['sipcallid']=_0x128a2a['value'];}}}catch(_0x626f52){utils[_0x7595('0x1c')](util[_0x7595('0x9')](_0x7595('0x45'),_0x128a2a[_0x7595('0x7')]),_0x626f52);}};exports[_0x7595('0x5a')]=function(_0x2636a7){try{if(!_['isNil'](channels[_0x2636a7[_0x7595('0x7')]])){utils[_0x7595('0x1e')](util[_0x7595('0x9')]('[%s][calls][newexten]',_0x2636a7[_0x7595('0x7')]),_0x2636a7);utils[_0x7595('0x8')](util[_0x7595('0x9')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2636a7[_0x7595('0x7')],_0x2636a7[_0x7595('0x5b')],_0x2636a7[_0x7595('0x5c')]));if(_0x2636a7['application'][_0x7595('0x5d')]()==_0x7595('0x5e')&&_[_0x7595('0x5f')](_0x2636a7[_0x7595('0x5c')][_0x7595('0x5d')](),_0x7595('0x60'))){var _0x4fa881=_0x2636a7[_0x7595('0x5c')][_0x7595('0x61')]('=');var _0x1f9b3c=_0x4fa881[0x0][_0x7595('0x62')](_0x4fa881[0x0][_0x7595('0x63')]('(')+0x1,_0x4fa881[0x0][_0x7595('0x63')](')'));var _0x3c8526=_0x4fa881[0x1];channels[_0x2636a7[_0x7595('0x7')]][_0x1f9b3c]=_0x3c8526;}if(!_['includes'](['hangup',_0x7595('0x64'),_0x7595('0x65'),_0x7595('0x5e'),_0x7595('0x66')],_0x2636a7[_0x7595('0x5b')][_0x7595('0x5d')]())){channels[_0x2636a7[_0x7595('0x7')]][_0x7595('0x52')]=_0x2636a7['application'];channels[_0x2636a7[_0x7595('0x7')]]['lastdata']=_0x2636a7[_0x7595('0x5c')];}}}catch(_0x4cca35){utils['error'](util['format'](_0x7595('0x67'),_0x2636a7[_0x7595('0x7')]),_0x4cca35);}};
\ No newline at end of file
+var _0x2905=['FAILED','ANSWERED','BUSY','blinds','uniqueid','info','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','context','exten','now','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','channelstate','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','error','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','varset','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER'];(function(_0x3319ec,_0x4dcb08){var _0x5a34ce=function(_0x2ef4ed){while(--_0x2ef4ed){_0x3319ec['push'](_0x3319ec['shift']());}};_0x5a34ce(++_0x4dcb08);}(_0x2905,0x19c));var _0x5290=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2905[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x5290('0x0'));var util=require(_0x5290('0x1'));var utils=require(_0x5290('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x5290('0x3'),_0x5290('0x4'),_0x5290('0x4'),_0x5290('0x3'),_0x5290('0x3'),'NO\x20ANSWER',_0x5290('0x5'),_0x5290('0x6'),_0x5290('0x4'),'FAILED','FAILED'];var channels={};function writeDB(_0x2dcc72){var _0x11ef1b;if(transfers[_0x5290('0x7')][_0x2dcc72['uniqueid']]){_0x11ef1b=_0x2dcc72['uniqueid'];_0x2dcc72[_0x5290('0x8')]=transfers[_0x5290('0x7')][_0x2dcc72[_0x5290('0x8')]]['transfereeuniqueid'];}utils[_0x5290('0x9')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2dcc72[_0x5290('0x8')],_0x2dcc72['channel'],_0x2dcc72[_0x5290('0xa')],_0x2dcc72['membername'],_0x2dcc72[_0x5290('0xb')],_0x2dcc72[_0x5290('0xc')],_0x2dcc72[_0x5290('0xd')],_0x2dcc72[_0x5290('0xe')]));if(_0x2dcc72[_0x5290('0xf')]){utils['getUserByInternal'](_0x2dcc72[_0x5290('0xf')])['then'](function(_0x13246f){if(_0x13246f){_0x2dcc72[_0x5290('0x10')]=_0x13246f['id'];}utils[_0x5290('0x11')](_0x5290('0x12'),_0x2dcc72);});}else{utils[_0x5290('0x11')](_0x5290('0x12'),_0x2dcc72);}if(channels[_0x2dcc72[_0x5290('0x8')]]){delete channels[_0x2dcc72[_0x5290('0x8')]];}else if(_0x11ef1b&&channels[_0x11ef1b]){if(!transfers[_0x5290('0x7')][_0x11ef1b]['recording'])delete transfers[_0x5290('0x7')][_0x11ef1b];delete channels[_0x11ef1b];}}exports[_0x5290('0x13')]=function(_0x540588){try{utils[_0x5290('0x14')](util[_0x5290('0x15')](_0x5290('0x16'),_0x540588[_0x5290('0x8')]),_0x540588);if(_0x540588[_0x5290('0x8')]==_0x540588[_0x5290('0x17')]&&_0x540588[_0x5290('0x18')]!=_0x5290('0x19')){utils[_0x5290('0x9')](util[_0x5290('0x15')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x540588[_0x5290('0x8')],_0x540588[_0x5290('0x1a')],_0x540588['exten']));channels[_0x540588[_0x5290('0x8')]]={'uniqueid':_0x540588[_0x5290('0x8')],'accountcode':_0x540588['accountcode'],'source':_0x540588[_0x5290('0xc')],'destination':_0x540588[_0x5290('0x1b')],'destinationcontext':_0x540588[_0x5290('0x1a')],'channel':_0x540588[_0x5290('0x18')],'starttime':utils[_0x5290('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x2a47a9){utils['error'](util[_0x5290('0x15')](_0x5290('0x16'),_0x540588[_0x5290('0x8')]),_0x2a47a9);}};exports['newstate']=function(_0x404f64){try{utils[_0x5290('0x14')](util[_0x5290('0x15')](_0x5290('0x1d'),_0x404f64[_0x5290('0x8')]),_0x404f64);if(!_[_0x5290('0x1e')](channels[_0x404f64[_0x5290('0x8')]])&&_0x404f64['channelstate']==0x6){utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x1f'),_0x404f64[_0x5290('0x8')],_0x404f64['context'],_0x404f64[_0x5290('0x18')]));if(_[_0x5290('0x1e')](channels[_0x404f64[_0x5290('0x8')]][_0x5290('0x20')])){channels[_0x404f64[_0x5290('0x8')]]['systemanswertime']=utils[_0x5290('0x1c')]();}}else if(!_['isNil'](channels[_0x404f64[_0x5290('0x17')]])&&_0x404f64['channelstate']==0x6&&_0x404f64[_0x5290('0x1a')]!=_0x5290('0x21')){utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x22'),_0x404f64[_0x5290('0x8')],_0x404f64['linkedid'],_0x404f64[_0x5290('0x1a')],_0x404f64[_0x5290('0x18')]));channels[_0x404f64['linkedid']]['accountcode']=_0x404f64[_0x5290('0xf')];channels[_0x404f64[_0x5290('0x17')]][_0x5290('0x23')]=_0x404f64['channel'];if(_[_0x5290('0x1e')](channels[_0x404f64[_0x5290('0x17')]][_0x5290('0x24')])){channels[_0x404f64[_0x5290('0x17')]]['answertime']=utils[_0x5290('0x1c')]();}channels[_0x404f64[_0x5290('0x17')]][_0x5290('0x25')]=dispositions[_['toNumber'](_0x404f64[_0x5290('0x26')])]||_0x5290('0x5');}}catch(_0x4a9587){utils['error'](util[_0x5290('0x15')](_0x5290('0x1d'),_0x404f64[_0x5290('0x8')]),_0x4a9587);}};exports[_0x5290('0x27')]=function(_0x510daf){try{if(!_[_0x5290('0x1e')](channels[_0x510daf['uniqueid']])){utils['debug'](util[_0x5290('0x15')](_0x5290('0x28'),_0x510daf[_0x5290('0x8')]),_0x510daf);if(_[_0x5290('0x1e')](channels[_0x510daf['uniqueid']][_0x5290('0x29')])){channels[_0x510daf['uniqueid']][_0x5290('0x29')]=_0x510daf['calleridname']+'\x20<'+_0x510daf[_0x5290('0xc')]+'>';}utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x2a'),_0x510daf[_0x5290('0x8')],channels[_0x510daf[_0x5290('0x8')]][_0x5290('0x29')],_0x510daf[_0x5290('0x2b')]));channels[_0x510daf[_0x5290('0x8')]][_0x5290('0x2c')]=utils['now']();channels[_0x510daf[_0x5290('0x8')]][_0x5290('0x2d')]=utils[_0x5290('0x2e')](channels[_0x510daf['uniqueid']][_0x5290('0x2c')],channels[_0x510daf[_0x5290('0x8')]][_0x5290('0x2f')]);channels[_0x510daf[_0x5290('0x8')]][_0x5290('0x30')]=channels[_0x510daf[_0x5290('0x8')]][_0x5290('0x24')]?utils[_0x5290('0x2e')](channels[_0x510daf[_0x5290('0x8')]][_0x5290('0x2c')],channels[_0x510daf[_0x5290('0x8')]]['answertime']):0x0;writeDB(channels[_0x510daf[_0x5290('0x8')]]);}}catch(_0x35efed){utils[_0x5290('0x31')](util[_0x5290('0x15')](_0x5290('0x28'),_0x510daf[_0x5290('0x8')]),_0x35efed);}};exports[_0x5290('0x32')]=function(_0xfe7993){try{if(!_[_0x5290('0x1e')](channels[_0xfe7993[_0x5290('0x33')]])){utils[_0x5290('0x14')](util['format'](_0x5290('0x34'),_0xfe7993[_0x5290('0x35')]),_0xfe7993);if(channels[_0xfe7993[_0x5290('0x33')]]['channel']==_0xfe7993[_0x5290('0x36')]){utils['info'](util[_0x5290('0x15')](_0x5290('0x37'),_0xfe7993[_0x5290('0x35')],_0xfe7993[_0x5290('0x33')],_0xfe7993[_0x5290('0x38')]));channels[_0xfe7993[_0x5290('0x33')]][_0x5290('0x23')]=_0xfe7993['secondtransfererchannel'];channels[_0xfe7993[_0x5290('0x33')]]['userfield']=_0x5290('0x39');}else if(channels[_0xfe7993['localtwolinkedid']]['channel']=_0xfe7993[_0x5290('0x3a')]){utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x37'),_0xfe7993[_0x5290('0x35')],_0xfe7993[_0x5290('0x33')],_0xfe7993[_0x5290('0x3b')]));channels[_0xfe7993[_0x5290('0x33')]][_0x5290('0x23')]=_0xfe7993['origtransfererchannel'];channels[_0xfe7993[_0x5290('0x33')]][_0x5290('0x3c')]=_0x5290('0x39');}}}catch(_0x584381){utils[_0x5290('0x31')](util[_0x5290('0x15')](_0x5290('0x34'),_0xfe7993[_0x5290('0x35')]),_0x584381);}};exports[_0x5290('0x3d')]=function(_0x3458ed){try{if(!_[_0x5290('0x1e')](channels[_0x3458ed[_0x5290('0x8')]])){utils[_0x5290('0x14')](util[_0x5290('0x15')](_0x5290('0x3e'),_0x3458ed['uniqueid']),_0x3458ed);channels[_0x3458ed[_0x5290('0x8')]]['musiconholdstartAt']=utils[_0x5290('0x1c')]();utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x3f'),_0x3458ed['uniqueid'],channels[_0x3458ed['uniqueid']]['musiconholdstartAt']));}}catch(_0x24ef55){utils[_0x5290('0x31')](util[_0x5290('0x15')]('[%s][calls][musiconholdstart]',_0x3458ed[_0x5290('0x8')]),_0x24ef55);}};exports['musiconholdstop']=function(_0x21da8e){try{if(!_[_0x5290('0x1e')](channels[_0x21da8e['uniqueid']])){utils[_0x5290('0x14')](util[_0x5290('0x15')](_0x5290('0x40'),_0x21da8e['uniqueid']),_0x21da8e);if(!_[_0x5290('0x1e')](channels[_0x21da8e[_0x5290('0x8')]][_0x5290('0x41')])){channels[_0x21da8e[_0x5290('0x8')]][_0x5290('0x42')]+=utils[_0x5290('0x2e')](utils[_0x5290('0x1c')](),channels[_0x21da8e[_0x5290('0x8')]][_0x5290('0x41')]);utils['info'](util[_0x5290('0x15')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x21da8e[_0x5290('0x8')],channels[_0x21da8e[_0x5290('0x8')]][_0x5290('0x42')]));delete channels[_0x21da8e[_0x5290('0x8')]][_0x5290('0x41')];}}}catch(_0x2dc0a1){utils[_0x5290('0x31')](util[_0x5290('0x15')](_0x5290('0x40'),_0x21da8e[_0x5290('0x8')]),_0x2dc0a1);}};exports[_0x5290('0x43')]=function(_0x58d387){try{if(!_[_0x5290('0x1e')](channels[_0x58d387[_0x5290('0x8')]])){utils[_0x5290('0x14')](util[_0x5290('0x15')]('[%s][calls][varset]',_0x58d387[_0x5290('0x8')]),_0x58d387);if(!_[_0x5290('0x1e')](_0x58d387[_0x5290('0x44')]['xmd-originatecalleridnum'])){utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x45'),_0x58d387[_0x5290('0x8')],_0x58d387[_0x5290('0x46')]));channels[_0x58d387['uniqueid']][_0x5290('0x47')]=_0x58d387[_0x5290('0x46')];}if(!_['isNil'](_0x58d387[_0x5290('0x44')][_0x5290('0x48')])){utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x49'),_0x58d387[_0x5290('0x8')],_0x58d387[_0x5290('0x46')]));channels[_0x58d387[_0x5290('0x8')]][_0x5290('0x4a')]=_0x58d387[_0x5290('0x46')];channels[_0x58d387[_0x5290('0x8')]][_0x5290('0x29')]='\x22'+_0x58d387[_0x5290('0x46')]+_0x5290('0x4b')+_0x58d387[_0x5290('0x46')]+'>';}if(!_[_0x5290('0x1e')](_0x58d387[_0x5290('0x44')][_0x5290('0x4c')])||!_['isNil'](_0x58d387[_0x5290('0x44')][_0x5290('0x4d')])){utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x4e'),_0x58d387[_0x5290('0x8')],!_[_0x5290('0x1e')](_0x58d387[_0x5290('0x44')][_0x5290('0x4c')])?_0x5290('0x4c'):_0x5290('0x4d'),_0x58d387['value']));channels[_0x58d387['uniqueid']][_0x5290('0x29')]=_0x58d387[_0x5290('0x46')];}if(!_[_0x5290('0x1e')](_0x58d387[_0x5290('0x44')][_0x5290('0x4f')])||!_[_0x5290('0x1e')](_0x58d387[_0x5290('0x44')]['xmcs-queue'])){utils['info'](util[_0x5290('0x15')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x58d387[_0x5290('0x8')],!_[_0x5290('0x1e')](_0x58d387[_0x5290('0x44')][_0x5290('0x4f')])?'xmd-queue':'xmcs-queue',_0x58d387[_0x5290('0x46')]));channels[_0x58d387[_0x5290('0x8')]][_0x5290('0x50')]=_0x5290('0x51');channels[_0x58d387['uniqueid']][_0x5290('0x52')]=_0x58d387[_0x5290('0x46')];channels[_0x58d387['uniqueid']]['queue']=!![];}if(!_[_0x5290('0x1e')](_0x58d387['variable'][_0x5290('0x53')])){utils[_0x5290('0x9')](util['format'](_0x5290('0x54'),_0x58d387[_0x5290('0x8')],_0x58d387[_0x5290('0x46')]));channels[_0x58d387[_0x5290('0x8')]]['ContactId']=_0x58d387[_0x5290('0x46')];}if(!_[_0x5290('0x1e')](_0x58d387[_0x5290('0x44')][_0x5290('0x55')])){utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x56'),_0x58d387[_0x5290('0x8')],_0x58d387[_0x5290('0x46')]));channels[_0x58d387[_0x5290('0x8')]]['type']=_0x58d387[_0x5290('0x46')];}if(!_['isNil'](_0x58d387['variable'][_0x5290('0x57')])){utils[_0x5290('0x9')](util['format'](_0x5290('0x58'),_0x58d387[_0x5290('0x8')],_0x58d387[_0x5290('0x46')]));channels[_0x58d387['uniqueid']][_0x5290('0x59')]=_0x58d387[_0x5290('0x46')];}if(!_[_0x5290('0x1e')](_0x58d387[_0x5290('0x44')][_0x5290('0x5a')])){utils[_0x5290('0x9')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x58d387[_0x5290('0x8')],_0x58d387[_0x5290('0x46')]));channels[_0x58d387[_0x5290('0x8')]][_0x5290('0x5a')]=_0x58d387[_0x5290('0x46')];}}}catch(_0x2a3427){utils[_0x5290('0x31')](util[_0x5290('0x15')]('[%s][calls][varset]',_0x58d387['uniqueid']),_0x2a3427);}};exports[_0x5290('0x5b')]=function(_0x1128e9){try{if(!_[_0x5290('0x1e')](channels[_0x1128e9[_0x5290('0x8')]])){utils[_0x5290('0x14')](util['format'](_0x5290('0x5c'),_0x1128e9[_0x5290('0x8')]),_0x1128e9);utils[_0x5290('0x9')](util[_0x5290('0x15')](_0x5290('0x5d'),_0x1128e9[_0x5290('0x8')],_0x1128e9[_0x5290('0x5e')],_0x1128e9[_0x5290('0x5f')]));if(_0x1128e9[_0x5290('0x5e')][_0x5290('0x60')]()=='set'&&_[_0x5290('0x61')](_0x1128e9['appdata'][_0x5290('0x60')](),'cdr')){var _0x10bc8e=_0x1128e9[_0x5290('0x5f')][_0x5290('0x62')]('=');var _0xf55a23=_0x10bc8e[0x0]['substring'](_0x10bc8e[0x0][_0x5290('0x63')]('(')+0x1,_0x10bc8e[0x0][_0x5290('0x63')](')'));var _0xb335e9=_0x10bc8e[0x1];channels[_0x1128e9['uniqueid']][_0xf55a23]=_0xb335e9;}if(!_[_0x5290('0x64')]([_0x5290('0x27'),_0x5290('0x65'),_0x5290('0x66'),'set',_0x5290('0x67')],_0x1128e9[_0x5290('0x5e')][_0x5290('0x60')]())){channels[_0x1128e9[_0x5290('0x8')]]['lastapplication']=_0x1128e9[_0x5290('0x5e')];channels[_0x1128e9[_0x5290('0x8')]][_0x5290('0x52')]=_0x1128e9[_0x5290('0x5f')];}}}catch(_0x1d71b6){utils['error'](util[_0x5290('0x15')]('[%s][calls][newexten]',_0x1128e9[_0x5290('0x8')]),_0x1d71b6);}};
\ No newline at end of file
index 24eaa12..73720d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe741=['connect','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20close','managerevent'];(function(_0x399e0b,_0x118a03){var _0x2b71ab=function(_0x2db343){while(--_0x2db343){_0x399e0b['push'](_0x399e0b['shift']());}};_0x2b71ab(++_0x118a03);}(_0xe741,0x1c8));var _0x1e74=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xe741[_0x1e4360];return _0x31e6b4;};'use strict';var utils=require('./utils');exports[_0x1e74('0x0')]=function(){utils[_0x1e74('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x1e74('0x1')](_0x1e74('0x2'));};exports[_0x1e74('0x3')]=function(){utils[_0x1e74('0x1')](_0x1e74('0x4'));};exports[_0x1e74('0x5')]=function(_0x23df3a){utils['error']('[core]\x20error',_0x23df3a);};exports['close']=function(){utils[_0x1e74('0x1')](_0x1e74('0x6'));};exports[_0x1e74('0x7')]=function(_0x2793ea){};
\ No newline at end of file
+var _0x4107=['connect','info','shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0x4107,0x10d));var _0x7410=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x4107[_0x39ffd1];return _0x31267e;};'use strict';var utils=require(_0x7410('0x0'));exports[_0x7410('0x1')]=function(){utils[_0x7410('0x2')]('[core]\x20connected');};exports[_0x7410('0x3')]=function(){utils[_0x7410('0x2')]('[core]\x20shutdown');};exports[_0x7410('0x4')]=function(){utils['info'](_0x7410('0x5'));};exports[_0x7410('0x6')]=function(_0x4acb3e){utils[_0x7410('0x6')]('[core]\x20error',_0x4acb3e);};exports[_0x7410('0x7')]=function(){utils['info'](_0x7410('0x8'));};exports[_0x7410('0x9')]=function(_0x4a2abd){};
\ No newline at end of file
index d16a351..34a617e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4fd=['endtime','answertime','billableseconds','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0xa4fd,0x193));var _0xda4f=function(_0x2a29ad,_0x32cf18){_0x2a29ad=_0x2a29ad-0x0;var _0x4ec194=_0xa4fd[_0x2a29ad];return _0x4ec194;};'use strict';var _=require('lodash');var util=require(_0xda4f('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x3bd5fa){utils[_0xda4f('0x1')](util[_0xda4f('0x2')](_0xda4f('0x3'),_0x3bd5fa[_0xda4f('0x4')],_0x3bd5fa['channel'],_0x3bd5fa[_0xda4f('0x5')],_0x3bd5fa[_0xda4f('0x6')],_0x3bd5fa[_0xda4f('0x7')],_0x3bd5fa[_0xda4f('0x8')]));utils[_0xda4f('0x9')](_0xda4f('0xa'),_0x3bd5fa);delete dials[_0x3bd5fa[_0xda4f('0x4')]];}exports['newexten']=function(_0x14f80a){try{utils[_0xda4f('0xb')](util[_0xda4f('0x2')](_0xda4f('0xc'),_0x14f80a['uniqueid']),_0x14f80a);utils[_0xda4f('0x1')](util[_0xda4f('0x2')](_0xda4f('0xd'),_0x14f80a[_0xda4f('0x4')],_0x14f80a[_0xda4f('0xe')],_0x14f80a[_0xda4f('0xf')]));if(_0x14f80a['application'][_0xda4f('0x10')]()=='set'&&_['startsWith'](_0x14f80a['appdata'][_0xda4f('0x10')](),_0xda4f('0x11'))){var _0x1444a3=_0x14f80a['appdata'][_0xda4f('0x12')]('=');dials[_0x14f80a[_0xda4f('0x4')]]={'routeId':_0x1444a3[0x1]};}}catch(_0x4e4720){utils[_0xda4f('0x13')](util['format'](_0xda4f('0xc'),_0x14f80a[_0xda4f('0x4')]),_0x4e4720);}};exports[_0xda4f('0x14')]=function(_0x171317){try{utils[_0xda4f('0xb')](util[_0xda4f('0x2')](_0xda4f('0x15'),_0x171317[_0xda4f('0x4')]),_0x171317);if(!_['isNil'](_0x171317[_0xda4f('0x16')][_0xda4f('0x17')])){utils[_0xda4f('0x1')](util['format'](_0xda4f('0x18'),_0x171317[_0xda4f('0x4')],_0x171317['value']));dials[_0x171317[_0xda4f('0x4')]]={'routeId':_0x171317[_0xda4f('0x19')]};}}catch(_0x1c4e76){utils[_0xda4f('0x13')](util[_0xda4f('0x2')](_0xda4f('0x15'),_0x171317[_0xda4f('0x4')]),_0x1c4e76);}};exports[_0xda4f('0x1a')]=function(_0x178c31){try{if(!_[_0xda4f('0x1b')](dials[_0x178c31[_0xda4f('0x4')]])){utils['debug'](util[_0xda4f('0x2')](_0xda4f('0x1c'),_0x178c31[_0xda4f('0x4')]),_0x178c31);dials[_0x178c31['uniqueid']]=_[_0xda4f('0x1d')](dials[_0x178c31[_0xda4f('0x4')]],_0x178c31);dials[_0x178c31['uniqueid']][_0xda4f('0x1e')]=utils[_0xda4f('0x1f')]();dials[_0x178c31[_0xda4f('0x4')]]['lastevent']=_0xda4f('0x20');utils[_0xda4f('0x1')](util[_0xda4f('0x2')](_0xda4f('0x21'),_0x178c31[_0xda4f('0x4')],dials[_0x178c31['uniqueid']][_0xda4f('0x1e')]));}}catch(_0x3ae109){utils[_0xda4f('0x13')](util[_0xda4f('0x2')](_0xda4f('0x1c'),_0x178c31[_0xda4f('0x4')]),_0x3ae109);}};exports[_0xda4f('0x22')]=function(_0x41edfb){try{if(!_[_0xda4f('0x1b')](dials[_0x41edfb[_0xda4f('0x4')]])){utils[_0xda4f('0xb')](util[_0xda4f('0x2')](_0xda4f('0x23'),_0x41edfb[_0xda4f('0x4')]),_0x41edfb);dials[_0x41edfb['uniqueid']][_0xda4f('0x8')]=_0x41edfb[_0xda4f('0x8')];if(_0x41edfb['dialstatus']==_0xda4f('0x24')){dials[_0x41edfb[_0xda4f('0x4')]]=_[_0xda4f('0x1d')](dials[_0x41edfb[_0xda4f('0x4')]],_0x41edfb);dials[_0x41edfb[_0xda4f('0x4')]]['answertime']=utils['now']();dials[_0x41edfb[_0xda4f('0x4')]][_0xda4f('0x25')]=_0xda4f('0x26');utils[_0xda4f('0x1')](util[_0xda4f('0x2')](_0xda4f('0x27'),_0x41edfb['uniqueid'],_0x41edfb[_0xda4f('0x8')],dials[_0x41edfb[_0xda4f('0x4')]]['answertime']));}else{utils[_0xda4f('0x1')](util[_0xda4f('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x41edfb[_0xda4f('0x4')],_0x41edfb[_0xda4f('0x8')]));}}}catch(_0x2c6b77){utils[_0xda4f('0x13')](util[_0xda4f('0x2')](_0xda4f('0x23'),_0x41edfb[_0xda4f('0x4')]),_0x2c6b77);}};exports[_0xda4f('0x28')]=function(_0x45d29b){try{if(!_[_0xda4f('0x1b')](dials[_0x45d29b[_0xda4f('0x4')]])){utils[_0xda4f('0xb')](util['format'](_0xda4f('0x29'),_0x45d29b[_0xda4f('0x4')]),_0x45d29b);utils['info'](util[_0xda4f('0x2')](_0xda4f('0x2a'),_0x45d29b[_0xda4f('0x4')],_0x45d29b[_0xda4f('0x6')],_0x45d29b[_0xda4f('0x2b')],_0x45d29b[_0xda4f('0x2c')]));dials[_0x45d29b[_0xda4f('0x4')]]=_['assign'](dials[_0x45d29b[_0xda4f('0x4')]],{'endtime':utils[_0xda4f('0x1f')](),'lastevent':_0xda4f('0x2d')});dials[_0x45d29b[_0xda4f('0x4')]]['duration']=utils[_0xda4f('0x2e')](dials[_0x45d29b['uniqueid']][_0xda4f('0x2f')],dials[_0x45d29b['uniqueid']][_0xda4f('0x1e')]);dials[_0x45d29b[_0xda4f('0x4')]]['holdtime']=utils[_0xda4f('0x2e')](dials[_0x45d29b[_0xda4f('0x4')]][_0xda4f('0x30')]||dials[_0x45d29b[_0xda4f('0x4')]][_0xda4f('0x2f')],dials[_0x45d29b[_0xda4f('0x4')]][_0xda4f('0x1e')]);dials[_0x45d29b[_0xda4f('0x4')]][_0xda4f('0x31')]=dials[_0x45d29b['uniqueid']][_0xda4f('0x30')]?utils['diffTime'](dials[_0x45d29b[_0xda4f('0x4')]][_0xda4f('0x2f')],dials[_0x45d29b[_0xda4f('0x4')]][_0xda4f('0x30')]):0x0;writeDB(dials[_0x45d29b['uniqueid']]);}}catch(_0x4a6be6){utils['error'](util[_0xda4f('0x2')]('[%s][dials][hangup]',_0x45d29b[_0xda4f('0x4')]),_0x4a6be6);}};
\ No newline at end of file
+var _0x0c71=['[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','diffTime','holdtime','endtime','billableseconds','util','info','format','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0c71,0x1ee));var _0x10c7=function(_0x3d47e8,_0x5cc903){_0x3d47e8=_0x3d47e8-0x0;var _0x113f5f=_0x0c71[_0x3d47e8];return _0x113f5f;};'use strict';var _=require('lodash');var util=require(_0x10c7('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x1cf501){utils[_0x10c7('0x1')](util[_0x10c7('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1cf501[_0x10c7('0x3')],_0x1cf501[_0x10c7('0x4')],_0x1cf501['dialstring'],_0x1cf501[_0x10c7('0x5')],_0x1cf501[_0x10c7('0x6')],_0x1cf501[_0x10c7('0x7')]));utils[_0x10c7('0x8')]('CreateVoiceDialReport',_0x1cf501);delete dials[_0x1cf501[_0x10c7('0x3')]];}exports[_0x10c7('0x9')]=function(_0x4b0083){try{utils[_0x10c7('0xa')](util['format'](_0x10c7('0xb'),_0x4b0083[_0x10c7('0x3')]),_0x4b0083);utils[_0x10c7('0x1')](util[_0x10c7('0x2')](_0x10c7('0xc'),_0x4b0083[_0x10c7('0x3')],_0x4b0083[_0x10c7('0xd')],_0x4b0083[_0x10c7('0xe')]));if(_0x4b0083[_0x10c7('0xd')][_0x10c7('0xf')]()==_0x10c7('0x10')&&_[_0x10c7('0x11')](_0x4b0083[_0x10c7('0xe')][_0x10c7('0xf')](),_0x10c7('0x12'))){var _0x48aca0=_0x4b0083[_0x10c7('0xe')][_0x10c7('0x13')]('=');dials[_0x4b0083[_0x10c7('0x3')]]={'routeId':_0x48aca0[0x1]};}}catch(_0x32d249){utils['error'](util[_0x10c7('0x2')](_0x10c7('0xb'),_0x4b0083[_0x10c7('0x3')]),_0x32d249);}};exports[_0x10c7('0x14')]=function(_0x39b520){try{utils[_0x10c7('0xa')](util[_0x10c7('0x2')]('[%s][dials][varset]',_0x39b520[_0x10c7('0x3')]),_0x39b520);if(!_[_0x10c7('0x15')](_0x39b520[_0x10c7('0x16')][_0x10c7('0x17')])){utils[_0x10c7('0x1')](util['format'](_0x10c7('0x18'),_0x39b520[_0x10c7('0x3')],_0x39b520[_0x10c7('0x19')]));dials[_0x39b520[_0x10c7('0x3')]]={'routeId':_0x39b520[_0x10c7('0x19')]};}}catch(_0x215df9){utils[_0x10c7('0x1a')](util[_0x10c7('0x2')]('[%s][dials][varset]',_0x39b520[_0x10c7('0x3')]),_0x215df9);}};exports[_0x10c7('0x1b')]=function(_0x2d6b2c){try{if(!_[_0x10c7('0x15')](dials[_0x2d6b2c[_0x10c7('0x3')]])){utils[_0x10c7('0xa')](util[_0x10c7('0x2')](_0x10c7('0x1c'),_0x2d6b2c[_0x10c7('0x3')]),_0x2d6b2c);dials[_0x2d6b2c[_0x10c7('0x3')]]=_[_0x10c7('0x1d')](dials[_0x2d6b2c[_0x10c7('0x3')]],_0x2d6b2c);dials[_0x2d6b2c[_0x10c7('0x3')]][_0x10c7('0x1e')]=utils[_0x10c7('0x1f')]();dials[_0x2d6b2c[_0x10c7('0x3')]][_0x10c7('0x20')]=_0x10c7('0x21');utils['info'](util['format'](_0x10c7('0x22'),_0x2d6b2c['uniqueid'],dials[_0x2d6b2c[_0x10c7('0x3')]][_0x10c7('0x1e')]));}}catch(_0x468caf){utils[_0x10c7('0x1a')](util[_0x10c7('0x2')]('[%s][dials][dialbegin]',_0x2d6b2c['uniqueid']),_0x468caf);}};exports['dialend']=function(_0x2e595d){try{if(!_['isNil'](dials[_0x2e595d[_0x10c7('0x3')]])){utils['debug'](util[_0x10c7('0x2')]('[%s][dials][dialend]',_0x2e595d[_0x10c7('0x3')]),_0x2e595d);dials[_0x2e595d['uniqueid']][_0x10c7('0x7')]=_0x2e595d[_0x10c7('0x7')];if(_0x2e595d['dialstatus']==_0x10c7('0x23')){dials[_0x2e595d[_0x10c7('0x3')]]=_['assign'](dials[_0x2e595d[_0x10c7('0x3')]],_0x2e595d);dials[_0x2e595d[_0x10c7('0x3')]][_0x10c7('0x24')]=utils[_0x10c7('0x1f')]();dials[_0x2e595d[_0x10c7('0x3')]]['lastevent']=_0x10c7('0x25');utils[_0x10c7('0x1')](util[_0x10c7('0x2')](_0x10c7('0x26'),_0x2e595d[_0x10c7('0x3')],_0x2e595d['dialstatus'],dials[_0x2e595d[_0x10c7('0x3')]][_0x10c7('0x24')]));}else{utils[_0x10c7('0x1')](util[_0x10c7('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x2e595d[_0x10c7('0x3')],_0x2e595d[_0x10c7('0x7')]));}}}catch(_0x112e16){utils[_0x10c7('0x1a')](util[_0x10c7('0x2')]('[%s][dials][dialend]',_0x2e595d[_0x10c7('0x3')]),_0x112e16);}};exports[_0x10c7('0x27')]=function(_0x491277){try{if(!_[_0x10c7('0x15')](dials[_0x491277[_0x10c7('0x3')]])){utils[_0x10c7('0xa')](util[_0x10c7('0x2')](_0x10c7('0x28'),_0x491277[_0x10c7('0x3')]),_0x491277);utils[_0x10c7('0x1')](util[_0x10c7('0x2')](_0x10c7('0x29'),_0x491277[_0x10c7('0x3')],_0x491277[_0x10c7('0x5')],_0x491277[_0x10c7('0x2a')],_0x491277['cause-txt']));dials[_0x491277[_0x10c7('0x3')]]=_[_0x10c7('0x1d')](dials[_0x491277[_0x10c7('0x3')]],{'endtime':utils[_0x10c7('0x1f')](),'lastevent':_0x10c7('0x2b')});dials[_0x491277[_0x10c7('0x3')]]['duration']=utils[_0x10c7('0x2c')](dials[_0x491277[_0x10c7('0x3')]]['endtime'],dials[_0x491277['uniqueid']][_0x10c7('0x1e')]);dials[_0x491277[_0x10c7('0x3')]][_0x10c7('0x2d')]=utils[_0x10c7('0x2c')](dials[_0x491277['uniqueid']][_0x10c7('0x24')]||dials[_0x491277['uniqueid']][_0x10c7('0x2e')],dials[_0x491277[_0x10c7('0x3')]][_0x10c7('0x1e')]);dials[_0x491277[_0x10c7('0x3')]][_0x10c7('0x2f')]=dials[_0x491277['uniqueid']]['answertime']?utils[_0x10c7('0x2c')](dials[_0x491277[_0x10c7('0x3')]]['endtime'],dials[_0x491277[_0x10c7('0x3')]][_0x10c7('0x24')]):0x0;writeDB(dials[_0x491277[_0x10c7('0x3')]]);}}catch(_0x5d95cc){utils['error'](util[_0x10c7('0x2')](_0x10c7('0x28'),_0x491277[_0x10c7('0x3')]),_0x5d95cc);}};
\ No newline at end of file
index e49e351..61287ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7a5=['devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','username','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent'];(function(_0x302ef1,_0x27511c){var _0x47a9d2=function(_0x116bec){while(--_0x116bec){_0x302ef1['push'](_0x302ef1['shift']());}};_0x47a9d2(++_0x27511c);}(_0xe7a5,0xbd));var _0x5e7a=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xe7a5[_0x50f392];return _0x5926f2;};var AsteriskManager=require(_0x5e7a('0x0'));var config=require(_0x5e7a('0x1'));var utils=require(_0x5e7a('0x2'));var util=require(_0x5e7a('0x3'));var isXDREnabled=config[_0x5e7a('0x4')]&&config['xdr']['disabled']?!config[_0x5e7a('0x4')][_0x5e7a('0x5')]:!![];var isProduction=config[_0x5e7a('0x6')]===_0x5e7a('0x7')||![];var isLocalAsterisk=config[_0x5e7a('0x4')]&&config['xdr'][_0x5e7a('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0x5e7a('0x9')]['port'],config['asterisk']['ip'],config[_0x5e7a('0x9')][_0x5e7a('0xa')],config[_0x5e7a('0x9')][_0x5e7a('0xb')],!![]);ami[_0x5e7a('0xc')]();if(!isXDREnabled){utils['info'](_0x5e7a('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x5e7a('0xe')](_0x5e7a('0xf'));}else{var agents=require(_0x5e7a('0x10'));var calls=require(_0x5e7a('0x11'));var queues=require(_0x5e7a('0x12'));var recordings=require(_0x5e7a('0x13'));var members=require(_0x5e7a('0x14'));var dials=require(_0x5e7a('0x15'));var transfers=require(_0x5e7a('0x16'));var core=require(_0x5e7a('0x17'));ami['on'](_0x5e7a('0x18'),core[_0x5e7a('0x18')]);ami['on'](_0x5e7a('0x19'),core['shutdown']);ami['on']('fullybooted',core[_0x5e7a('0x1a')]);ami['on'](_0x5e7a('0x1b'),core[_0x5e7a('0x1b')]);ami['on'](_0x5e7a('0x1c'),core['close']);ami['on'](_0x5e7a('0x1d'),core['managerevent']);ami['on'](_0x5e7a('0x1e'),function(_0x42f528){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')]('[%s][index][devicestatechange]',_0x42f528[_0x5e7a('0x21')]),_0x42f528);members[_0x5e7a('0x1e')](_0x42f528);}catch(_0x2782e4){utils[_0x5e7a('0x1b')](util['format'](_0x5e7a('0x22'),_0x42f528[_0x5e7a('0x21')]),_0x2782e4);}});ami['on'](_0x5e7a('0x23'),function(_0x19d3b4){try{utils['debug'](util['format'](_0x5e7a('0x24'),_0x19d3b4[_0x5e7a('0x25')]),_0x19d3b4);agents[_0x5e7a('0x23')](_0x19d3b4);}catch(_0x294b34){utils[_0x5e7a('0x1b')](util['format']('[%s][index][agentcalled]',_0x19d3b4[_0x5e7a('0x25')]),_0x294b34);}});ami['on'](_0x5e7a('0x26'),function(_0xa03f54){try{utils[_0x5e7a('0x1f')](util['format'](_0x5e7a('0x27'),_0xa03f54['uniqueid']),_0xa03f54);agents['agentringnoanswer'](_0xa03f54);}catch(_0x3480cb){utils[_0x5e7a('0x1b')](util['format'](_0x5e7a('0x27'),_0xa03f54[_0x5e7a('0x25')]),_0x3480cb);}});ami['on']('agentconnect',function(_0x97ec93){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')]('[%s][index][agentconnect]',_0x97ec93[_0x5e7a('0x25')]),_0x97ec93);agents['agentconnect'](_0x97ec93);queues['agentconnect'](_0x97ec93);}catch(_0x150768){utils['error'](util[_0x5e7a('0x20')](_0x5e7a('0x28'),_0x97ec93['uniqueid']),_0x150768);}});ami['on'](_0x5e7a('0x29'),function(_0x5229b6){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x2a'),_0x5229b6[_0x5e7a('0x25')]),_0x5229b6);agents[_0x5e7a('0x29')](_0x5229b6);queues[_0x5e7a('0x29')](_0x5229b6);members['agentcomplete'](_0x5229b6);}catch(_0x273cc5){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')]('[%s][index][agentcomplete]',_0x5229b6[_0x5e7a('0x25')]),_0x273cc5);}});ami['on']('queuecallerabandon',function(_0x19c6f9){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x2b'),_0x19c6f9['uniqueid']),_0x19c6f9);agents[_0x5e7a('0x2c')](_0x19c6f9);queues[_0x5e7a('0x2c')](_0x19c6f9);}catch(_0xd79184){utils[_0x5e7a('0x1b')](util['format']('[%s][index][queuecallerabandon]',_0x19c6f9[_0x5e7a('0x25')]),_0xd79184);}});ami['on'](_0x5e7a('0x2d'),function(_0x54f37d){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')]('[%s][index][queuecallerjoin]',_0x54f37d[_0x5e7a('0x25')]),_0x54f37d);queues[_0x5e7a('0x2d')](_0x54f37d);recordings[_0x5e7a('0x2d')](_0x54f37d);}catch(_0x4fe313){utils[_0x5e7a('0x1b')](util['format'](_0x5e7a('0x2e'),_0x54f37d[_0x5e7a('0x25')]),_0x4fe313);}});ami['on'](_0x5e7a('0x2f'),function(_0x34cf96){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x30'),_0x34cf96['uniqueid']),_0x34cf96);queues[_0x5e7a('0x2f')](_0x34cf96);}catch(_0x4afdfd){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')](_0x5e7a('0x30'),_0x34cf96[_0x5e7a('0x25')]),_0x4afdfd);}});ami['on'](_0x5e7a('0x31'),function(_0x10f412){try{utils['debug'](util[_0x5e7a('0x20')](_0x5e7a('0x32'),_0x10f412[_0x5e7a('0x25')]),_0x10f412);queues[_0x5e7a('0x31')](_0x10f412);calls[_0x5e7a('0x31')](_0x10f412);}catch(_0x185d51){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')]('[%s][index][musiconholdstart]',_0x10f412[_0x5e7a('0x25')]),_0x185d51);}});ami['on'](_0x5e7a('0x33'),function(_0x209069){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x34'),_0x209069[_0x5e7a('0x25')]),_0x209069);queues[_0x5e7a('0x33')](_0x209069);calls['musiconholdstop'](_0x209069);}catch(_0x2bb540){utils['error'](util[_0x5e7a('0x20')](_0x5e7a('0x34'),_0x209069[_0x5e7a('0x25')]),_0x2bb540);}});ami['on']('newstate',function(_0x562857){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x35'),_0x562857[_0x5e7a('0x25')]),_0x562857);calls['newstate'](_0x562857);recordings[_0x5e7a('0x36')](_0x562857);}catch(_0xbff482){utils[_0x5e7a('0x1b')](util['format'](_0x5e7a('0x35'),_0x562857[_0x5e7a('0x25')]),_0xbff482);}});ami['on'](_0x5e7a('0x37'),function(_0x3add10){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')]('[%s][index][hangup]',_0x3add10[_0x5e7a('0x25')]),_0x3add10);calls['hangup'](_0x3add10);recordings[_0x5e7a('0x37')](_0x3add10);dials['hangup'](_0x3add10);agents[_0x5e7a('0x37')](_0x3add10);queues[_0x5e7a('0x37')](_0x3add10);}catch(_0x39697e){utils[_0x5e7a('0x1b')](util['format']('[%s][index][hangup]',_0x3add10[_0x5e7a('0x25')]),_0x39697e);}});ami['on'](_0x5e7a('0x38'),function(_0x4e61cb){try{utils[_0x5e7a('0x1f')](util['format']('[%s][index][cdr]',_0x4e61cb[_0x5e7a('0x25')]),_0x4e61cb);members['cdr'](_0x4e61cb);}catch(_0x2eff28){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')]('[%s][index][cdr]',_0x4e61cb[_0x5e7a('0x25')]),_0x2eff28);}});ami['on'](_0x5e7a('0x39'),function(_0x473088){try{utils[_0x5e7a('0x1f')](util['format'](_0x5e7a('0x3a'),_0x473088[_0x5e7a('0x25')]),_0x473088);queues[_0x5e7a('0x39')](_0x473088);agents[_0x5e7a('0x39')](_0x473088);transfers[_0x5e7a('0x39')](_0x473088);recordings[_0x5e7a('0x39')](_0x473088);}catch(_0x1dc3b2){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')](_0x5e7a('0x3a'),_0x473088[_0x5e7a('0x25')]),_0x1dc3b2);}});ami['on'](_0x5e7a('0x3b'),function(_0x1a39b4){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x3c'),_0x1a39b4[_0x5e7a('0x3d')]),_0x1a39b4);queues['attendedtransfer'](_0x1a39b4);transfers[_0x5e7a('0x3b')](_0x1a39b4);agents['attendedtransfer'](_0x1a39b4);calls[_0x5e7a('0x3b')](_0x1a39b4);}catch(_0x1ff41e){utils['error'](util[_0x5e7a('0x20')]('[%s][index][attendedtransfer]',_0x1a39b4[_0x5e7a('0x3d')]),_0x1ff41e);}});ami['on'](_0x5e7a('0x3e'),function(_0x59631b){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')]('[%s][index][varset]',_0x59631b[_0x5e7a('0x25')]),_0x59631b);queues['varset'](_0x59631b);recordings[_0x5e7a('0x3e')](_0x59631b);calls['varset'](_0x59631b);dials[_0x5e7a('0x3e')](_0x59631b);}catch(_0x340f3f){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')](_0x5e7a('0x3f'),_0x59631b[_0x5e7a('0x25')]),_0x340f3f);}});ami['on'](_0x5e7a('0x40'),function(_0x20a4a2){try{utils[_0x5e7a('0x1f')](util['format'](_0x5e7a('0x41'),_0x20a4a2[_0x5e7a('0x25')]),_0x20a4a2);calls[_0x5e7a('0x40')](_0x20a4a2);recordings[_0x5e7a('0x40')](_0x20a4a2);dials[_0x5e7a('0x40')](_0x20a4a2);}catch(_0x1e0a8b){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')](_0x5e7a('0x41'),_0x20a4a2['uniqueid']),_0x1e0a8b);}});ami['on'](_0x5e7a('0x42'),function(_0x292eb4){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x43'),_0x292eb4[_0x5e7a('0x25')]),_0x292eb4);calls[_0x5e7a('0x42')](_0x292eb4);recordings[_0x5e7a('0x42')](_0x292eb4);}catch(_0x374e4a){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')](_0x5e7a('0x43'),_0x292eb4['uniqueid']),_0x374e4a);}});ami['on'](_0x5e7a('0x44'),function(_0x409d88){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x45'),_0x409d88[_0x5e7a('0x25')]),_0x409d88);dials['dialbegin'](_0x409d88);}catch(_0x7d4fba){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')](_0x5e7a('0x46'),_0x409d88['uniqueid']),_0x7d4fba);}});ami['on'](_0x5e7a('0x47'),function(_0x1211c9){try{utils[_0x5e7a('0x1f')](util[_0x5e7a('0x20')](_0x5e7a('0x48'),_0x1211c9[_0x5e7a('0x25')]),_0x1211c9);dials[_0x5e7a('0x47')](_0x1211c9);}catch(_0x36a367){utils[_0x5e7a('0x1b')](util[_0x5e7a('0x20')](_0x5e7a('0x48'),_0x1211c9['uniqueid']),_0x36a367);}});}
\ No newline at end of file
+var _0xcd6a=['../../config/environment','./utils','util','xdr','disabled','env','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager'];(function(_0x2c655f,_0x3ee11c){var _0x23ed33=function(_0x11b9df){while(--_0x11b9df){_0x2c655f['push'](_0x2c655f['shift']());}};_0x23ed33(++_0x3ee11c);}(_0xcd6a,0x89));var _0xacd6=function(_0x1a1458,_0x53d5a1){_0x1a1458=_0x1a1458-0x0;var _0x12b98f=_0xcd6a[_0x1a1458];return _0x12b98f;};var AsteriskManager=require(_0xacd6('0x0'));var config=require(_0xacd6('0x1'));var utils=require(_0xacd6('0x2'));var util=require(_0xacd6('0x3'));var isXDREnabled=config[_0xacd6('0x4')]&&config['xdr']['disabled']?!config[_0xacd6('0x4')][_0xacd6('0x5')]:!![];var isProduction=config[_0xacd6('0x6')]==='production'||![];var isLocalAsterisk=config[_0xacd6('0x4')]&&config[_0xacd6('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xacd6('0x7')][_0xacd6('0x8')],config[_0xacd6('0x7')]['ip'],config[_0xacd6('0x7')][_0xacd6('0x9')],config[_0xacd6('0x7')][_0xacd6('0xa')],!![]);ami[_0xacd6('0xb')]();if(!isXDREnabled){utils[_0xacd6('0xc')](_0xacd6('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xacd6('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xacd6('0xe'));var members=require(_0xacd6('0xf'));var dials=require(_0xacd6('0x10'));var transfers=require('./transfers.controller');var core=require(_0xacd6('0x11'));ami['on'](_0xacd6('0x12'),core[_0xacd6('0x12')]);ami['on'](_0xacd6('0x13'),core[_0xacd6('0x13')]);ami['on']('fullybooted',core[_0xacd6('0x14')]);ami['on'](_0xacd6('0x15'),core[_0xacd6('0x15')]);ami['on'](_0xacd6('0x16'),core['close']);ami['on'](_0xacd6('0x17'),core[_0xacd6('0x17')]);ami['on'](_0xacd6('0x18'),function(_0x357a98){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x1b'),_0x357a98[_0xacd6('0x1c')]),_0x357a98);members[_0xacd6('0x18')](_0x357a98);}catch(_0x8e919b){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')](_0xacd6('0x1b'),_0x357a98[_0xacd6('0x1c')]),_0x8e919b);}});ami['on'](_0xacd6('0x1d'),function(_0x53801f){try{utils['debug'](util[_0xacd6('0x1a')](_0xacd6('0x1e'),_0x53801f[_0xacd6('0x1f')]),_0x53801f);agents[_0xacd6('0x1d')](_0x53801f);}catch(_0x37b09c){utils['error'](util[_0xacd6('0x1a')]('[%s][index][agentcalled]',_0x53801f[_0xacd6('0x1f')]),_0x37b09c);}});ami['on'](_0xacd6('0x20'),function(_0x8f2c5){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x21'),_0x8f2c5[_0xacd6('0x1f')]),_0x8f2c5);agents[_0xacd6('0x20')](_0x8f2c5);}catch(_0x5e7558){utils['error'](util[_0xacd6('0x1a')](_0xacd6('0x21'),_0x8f2c5[_0xacd6('0x1f')]),_0x5e7558);}});ami['on'](_0xacd6('0x22'),function(_0x647c9d){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x23'),_0x647c9d[_0xacd6('0x1f')]),_0x647c9d);agents['agentconnect'](_0x647c9d);queues[_0xacd6('0x22')](_0x647c9d);}catch(_0x5816ed){utils['error'](util[_0xacd6('0x1a')](_0xacd6('0x23'),_0x647c9d[_0xacd6('0x1f')]),_0x5816ed);}});ami['on'](_0xacd6('0x24'),function(_0x44b07e){try{utils['debug'](util[_0xacd6('0x1a')](_0xacd6('0x25'),_0x44b07e[_0xacd6('0x1f')]),_0x44b07e);agents['agentcomplete'](_0x44b07e);queues[_0xacd6('0x24')](_0x44b07e);members['agentcomplete'](_0x44b07e);}catch(_0x375011){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')]('[%s][index][agentcomplete]',_0x44b07e[_0xacd6('0x1f')]),_0x375011);}});ami['on'](_0xacd6('0x26'),function(_0x5dbb0a){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x27'),_0x5dbb0a[_0xacd6('0x1f')]),_0x5dbb0a);agents[_0xacd6('0x26')](_0x5dbb0a);queues[_0xacd6('0x26')](_0x5dbb0a);}catch(_0x10185d){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')]('[%s][index][queuecallerabandon]',_0x5dbb0a['uniqueid']),_0x10185d);}});ami['on']('queuecallerjoin',function(_0x1c95d1){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x28'),_0x1c95d1['uniqueid']),_0x1c95d1);queues[_0xacd6('0x29')](_0x1c95d1);recordings[_0xacd6('0x29')](_0x1c95d1);}catch(_0x5ec028){utils[_0xacd6('0x15')](util['format'](_0xacd6('0x28'),_0x1c95d1[_0xacd6('0x1f')]),_0x5ec028);}});ami['on']('queuecallerleave',function(_0x2d9cb7){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x2a'),_0x2d9cb7[_0xacd6('0x1f')]),_0x2d9cb7);queues['queuecallerleave'](_0x2d9cb7);}catch(_0x2ee1e9){utils[_0xacd6('0x15')](util['format'](_0xacd6('0x2a'),_0x2d9cb7['uniqueid']),_0x2ee1e9);}});ami['on']('musiconholdstart',function(_0x63a427){try{utils['debug'](util[_0xacd6('0x1a')](_0xacd6('0x2b'),_0x63a427[_0xacd6('0x1f')]),_0x63a427);queues[_0xacd6('0x2c')](_0x63a427);calls[_0xacd6('0x2c')](_0x63a427);}catch(_0x25ea34){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')](_0xacd6('0x2b'),_0x63a427['uniqueid']),_0x25ea34);}});ami['on'](_0xacd6('0x2d'),function(_0x10085d){try{utils['debug'](util[_0xacd6('0x1a')](_0xacd6('0x2e'),_0x10085d[_0xacd6('0x1f')]),_0x10085d);queues[_0xacd6('0x2d')](_0x10085d);calls[_0xacd6('0x2d')](_0x10085d);}catch(_0x508818){utils['error'](util[_0xacd6('0x1a')]('[%s][index][musiconholdstop]',_0x10085d[_0xacd6('0x1f')]),_0x508818);}});ami['on'](_0xacd6('0x2f'),function(_0x1c64f6){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x30'),_0x1c64f6[_0xacd6('0x1f')]),_0x1c64f6);calls[_0xacd6('0x2f')](_0x1c64f6);recordings[_0xacd6('0x2f')](_0x1c64f6);}catch(_0x1f41b7){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')](_0xacd6('0x30'),_0x1c64f6['uniqueid']),_0x1f41b7);}});ami['on'](_0xacd6('0x31'),function(_0x164ea8){try{utils['debug'](util[_0xacd6('0x1a')]('[%s][index][hangup]',_0x164ea8[_0xacd6('0x1f')]),_0x164ea8);calls[_0xacd6('0x31')](_0x164ea8);recordings[_0xacd6('0x31')](_0x164ea8);dials[_0xacd6('0x31')](_0x164ea8);agents['hangup'](_0x164ea8);queues[_0xacd6('0x31')](_0x164ea8);}catch(_0x1cc293){utils['error'](util[_0xacd6('0x1a')](_0xacd6('0x32'),_0x164ea8[_0xacd6('0x1f')]),_0x1cc293);}});ami['on']('cdr',function(_0x380b58){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x33'),_0x380b58[_0xacd6('0x1f')]),_0x380b58);members[_0xacd6('0x34')](_0x380b58);}catch(_0x3a335c){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')](_0xacd6('0x33'),_0x380b58[_0xacd6('0x1f')]),_0x3a335c);}});ami['on'](_0xacd6('0x35'),function(_0x15999f){try{utils['debug'](util[_0xacd6('0x1a')](_0xacd6('0x36'),_0x15999f[_0xacd6('0x1f')]),_0x15999f);queues['blindtransfer'](_0x15999f);agents['blindtransfer'](_0x15999f);transfers[_0xacd6('0x35')](_0x15999f);recordings[_0xacd6('0x35')](_0x15999f);}catch(_0x24837e){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')]('[%s][index][blindtransfer]',_0x15999f[_0xacd6('0x1f')]),_0x24837e);}});ami['on'](_0xacd6('0x37'),function(_0x742c1f){try{utils['debug'](util[_0xacd6('0x1a')](_0xacd6('0x38'),_0x742c1f[_0xacd6('0x39')]),_0x742c1f);queues['attendedtransfer'](_0x742c1f);transfers['attendedtransfer'](_0x742c1f);agents[_0xacd6('0x37')](_0x742c1f);calls[_0xacd6('0x37')](_0x742c1f);}catch(_0x2e4339){utils['error'](util[_0xacd6('0x1a')](_0xacd6('0x38'),_0x742c1f[_0xacd6('0x39')]),_0x2e4339);}});ami['on']('varset',function(_0x14dffc){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x3a'),_0x14dffc[_0xacd6('0x1f')]),_0x14dffc);queues['varset'](_0x14dffc);recordings[_0xacd6('0x3b')](_0x14dffc);calls[_0xacd6('0x3b')](_0x14dffc);dials[_0xacd6('0x3b')](_0x14dffc);}catch(_0x4c91d7){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')](_0xacd6('0x3a'),_0x14dffc[_0xacd6('0x1f')]),_0x4c91d7);}});ami['on'](_0xacd6('0x3c'),function(_0x5e5527){try{utils[_0xacd6('0x19')](util['format']('[%s][index][newexten]',_0x5e5527[_0xacd6('0x1f')]),_0x5e5527);calls['newexten'](_0x5e5527);recordings[_0xacd6('0x3c')](_0x5e5527);dials[_0xacd6('0x3c')](_0x5e5527);}catch(_0x18608e){utils['error'](util[_0xacd6('0x1a')](_0xacd6('0x3d'),_0x5e5527['uniqueid']),_0x18608e);}});ami['on'](_0xacd6('0x3e'),function(_0x115c72){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x3f'),_0x115c72[_0xacd6('0x1f')]),_0x115c72);calls[_0xacd6('0x3e')](_0x115c72);recordings[_0xacd6('0x3e')](_0x115c72);}catch(_0x1a57b7){utils['error'](util[_0xacd6('0x1a')](_0xacd6('0x3f'),_0x115c72[_0xacd6('0x1f')]),_0x1a57b7);}});ami['on'](_0xacd6('0x40'),function(_0x232d3f){try{utils[_0xacd6('0x19')](util[_0xacd6('0x1a')](_0xacd6('0x41'),_0x232d3f[_0xacd6('0x1f')]),_0x232d3f);dials['dialbegin'](_0x232d3f);}catch(_0x542346){utils[_0xacd6('0x15')](util['format'](_0xacd6('0x42'),_0x232d3f[_0xacd6('0x1f')]),_0x542346);}});ami['on'](_0xacd6('0x43'),function(_0x1ca5e6){try{utils['debug'](util[_0xacd6('0x1a')]('[%s][index][dialend]',_0x1ca5e6[_0xacd6('0x1f')]),_0x1ca5e6);dials[_0xacd6('0x43')](_0x1ca5e6);}catch(_0x1594be){utils[_0xacd6('0x15')](util[_0xacd6('0x1a')](_0xacd6('0x44'),_0x1ca5e6[_0xacd6('0x1f')]),_0x1594be);}});}
\ No newline at end of file
index acf8f5c..3c07758 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63c4=['data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','state','INUSE','voice','now','agent','NOT_INUSE','exitAt','duration','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','data1','type','source'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x63c4,0x1c6));var _0x463c=function(_0xfe120,_0x566007){_0xfe120=_0xfe120-0x0;var _0x1ba277=_0x63c4[_0xfe120];return _0x1ba277;};'use strict';var _=require(_0x463c('0x0'));var util=require(_0x463c('0x1'));var utils=require(_0x463c('0x2'));var members={};var exclude=[_0x463c('0x3'),_0x463c('0x4')];function writeDB(_0x37fc1e){utils[_0x463c('0x5')](util[_0x463c('0x6')](_0x463c('0x7'),_0x37fc1e['uniqueid'],_0x37fc1e[_0x463c('0x8')],_0x37fc1e[_0x463c('0x9')],_0x37fc1e[_0x463c('0xa')],_0x37fc1e[_0x463c('0xb')],_0x37fc1e['type']));if(_0x37fc1e[_0x463c('0x8')]){utils[_0x463c('0xc')](_0x37fc1e[_0x463c('0x8')])[_0x463c('0xd')](function(_0x37d114){if(_0x37d114){_0x37fc1e['membername']=_0x37d114[_0x463c('0xe')];_0x37fc1e[_0x463c('0xf')]=_0x37d114['internal'];utils[_0x463c('0x10')](_0x463c('0x11'),_0x37fc1e);}else{utils[_0x463c('0x12')](_0x37fc1e[_0x463c('0x8')][_0x463c('0x13')]('/')[0x1])['then'](function(_0x1540c5){if(_0x1540c5){_0x37fc1e[_0x463c('0xb')]=_0x1540c5['name'];_0x37fc1e['internal']=_0x1540c5['internal'];utils[_0x463c('0x10')](_0x463c('0x11'),_0x37fc1e);}});}})['catch'](function(_0x76c843){utils[_0x463c('0x14')](util['format']('[%s][members][writeDB]',_0x37fc1e['uniqueid']),_0x76c843);});}delete members[_0x37fc1e[_0x463c('0x8')]];}function startsWith(_0x87e15f,_0xf49a35){return _[_0x463c('0x15')](_0x87e15f,function(_0x4d984e){return _[_0x463c('0x16')](_0xf49a35,_0x4d984e);});}exports[_0x463c('0x17')]=function(_0x3fec53){try{utils[_0x463c('0x18')](util[_0x463c('0x6')](_0x463c('0x19'),members[_0x3fec53[_0x463c('0x1a')]]?members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x1b')]:_0x3fec53['device']),_0x3fec53);utils['info'](util[_0x463c('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x3fec53['device']]?members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x1b')]:_0x3fec53[_0x463c('0x1a')],_0x3fec53[_0x463c('0x1c')],_0x3fec53['device']));switch(_0x3fec53['state']){case _0x463c('0x1d'):case'BUSY':if(!startsWith(exclude,_0x3fec53[_0x463c('0x1a')])){members[_0x3fec53['device']]={'channel':_0x463c('0x1e'),'interface':_0x3fec53['device'],'type':'TALKING','enterAt':utils[_0x463c('0x1f')](),'role':_0x463c('0x20')};}break;case _0x463c('0x21'):if(!_['isNil'](members[_0x3fec53[_0x463c('0x1a')]])){members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x22')]=utils['now']();members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x23')]=utils['diffTime'](members[_0x3fec53[_0x463c('0x1a')]]['exitAt'],members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x24')]);if(members[_0x3fec53[_0x463c('0x1a')]]['uniqueid']){writeDB(members[_0x3fec53[_0x463c('0x1a')]]);}}break;default:break;}}catch(_0x3f5762){utils['error'](util['format'](_0x463c('0x19'),members[_0x3fec53[_0x463c('0x1a')]]?members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x1b')]:_0x3fec53[_0x463c('0x1a')]),_0x3f5762);}};exports[_0x463c('0x25')]=function(_0x5a7ee3){try{if(!_[_0x463c('0x26')](members[_0x5a7ee3[_0x463c('0x8')]])){utils['debug'](util['format'](_0x463c('0x27'),_0x5a7ee3[_0x463c('0x1b')]),_0x5a7ee3);utils['info'](util['format'](_0x463c('0x28'),_0x5a7ee3['uniqueid'],_0x5a7ee3['interface'],_0x5a7ee3['queue']));members[_0x5a7ee3[_0x463c('0x8')]]=_[_0x463c('0x29')](members[_0x5a7ee3['interface']],{'data4':_0x5a7ee3['queue'],'uniqueid':_0x5a7ee3['uniqueid']});}}catch(_0x2543dd){utils[_0x463c('0x14')](util[_0x463c('0x6')](_0x463c('0x27'),_0x5a7ee3[_0x463c('0x1b')]),_0x2543dd);}};exports[_0x463c('0x2a')]=function(_0x1497d8){try{utils[_0x463c('0x18')](util[_0x463c('0x6')]('[%s][members][cdr]',_0x1497d8[_0x463c('0x1b')]),_0x1497d8);if(_0x1497d8[_0x463c('0x9')]){var _0x15781d=_0x1497d8[_0x463c('0x9')]['split']('-')[0x0];if(!_['isNil'](members[_0x15781d])){members[_0x15781d]=_[_0x463c('0x29')](members[_0x15781d],{'data1':members[_0x15781d][_0x463c('0x2b')]||_0x1497d8[_0x463c('0x2c')],'data2':members[_0x15781d][_0x463c('0xa')]||_0x1497d8[_0x463c('0x2d')],'data3':members[_0x15781d][_0x463c('0x2e')]||_0x1497d8['destination'],'uniqueid':members[_0x15781d][_0x463c('0x1b')]||_0x1497d8[_0x463c('0x1b')]});utils[_0x463c('0x5')](util['format'](_0x463c('0x2f'),_0x1497d8[_0x463c('0x1b')],members[_0x15781d]['data1'],members[_0x15781d][_0x463c('0xa')],members[_0x15781d][_0x463c('0x2e')]));if(members[_0x15781d][_0x463c('0x22')]){writeDB(members[_0x15781d]);}}}if(_0x1497d8[_0x463c('0x30')]){var _0x3d2a2a=_0x1497d8[_0x463c('0x30')]['split']('-')[0x0];if(!_[_0x463c('0x26')](members[_0x3d2a2a])){members[_0x3d2a2a]=_[_0x463c('0x29')](members[_0x3d2a2a],{'data1':members[_0x3d2a2a]['data1']||_0x1497d8[_0x463c('0x2c')],'data2':members[_0x3d2a2a][_0x463c('0xa')]||_0x1497d8['source'],'data3':members[_0x3d2a2a]['data3']||_0x1497d8[_0x463c('0x31')],'uniqueid':members[_0x3d2a2a][_0x463c('0x1b')]||_0x1497d8[_0x463c('0x1b')]});utils[_0x463c('0x5')](util[_0x463c('0x6')](_0x463c('0x2f'),_0x1497d8['uniqueid'],members[_0x3d2a2a]['data1'],members[_0x3d2a2a][_0x463c('0xa')],members[_0x3d2a2a][_0x463c('0x2e')]));if(members[_0x3d2a2a][_0x463c('0x22')]){writeDB(members[_0x3d2a2a]);}}}}catch(_0x13731f){utils[_0x463c('0x14')](util[_0x463c('0x6')]('[%s][members][cdr]',_0x1497d8['uniqueid']),_0x13731f);}};
\ No newline at end of file
+var _0x403a=['voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','source','destination','destinationchannel','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','some','startsWith','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY'];(function(_0x4ac449,_0x334674){var _0x4cf46a=function(_0x56874f){while(--_0x56874f){_0x4ac449['push'](_0x4ac449['shift']());}};_0x4cf46a(++_0x334674);}(_0x403a,0x19e));var _0xa403=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x403a[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0xa403('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0xa403('0x1'),'Queue:'];function writeDB(_0xc75afa){utils['info'](util[_0xa403('0x2')](_0xa403('0x3'),_0xc75afa[_0xa403('0x4')],_0xc75afa[_0xa403('0x5')],_0xc75afa[_0xa403('0x6')],_0xc75afa[_0xa403('0x7')],_0xc75afa[_0xa403('0x8')],_0xc75afa[_0xa403('0x9')]));if(_0xc75afa[_0xa403('0x5')]){utils[_0xa403('0xa')](_0xc75afa[_0xa403('0x5')])['then'](function(_0x16768e){if(_0x16768e){_0xc75afa[_0xa403('0x8')]=_0x16768e[_0xa403('0xb')];_0xc75afa[_0xa403('0xc')]=_0x16768e[_0xa403('0xc')];utils[_0xa403('0xd')](_0xa403('0xe'),_0xc75afa);}else{utils[_0xa403('0xf')](_0xc75afa[_0xa403('0x5')][_0xa403('0x10')]('/')[0x1])['then'](function(_0x512435){if(_0x512435){_0xc75afa[_0xa403('0x8')]=_0x512435[_0xa403('0xb')];_0xc75afa['internal']=_0x512435[_0xa403('0xc')];utils[_0xa403('0xd')](_0xa403('0xe'),_0xc75afa);}});}})['catch'](function(_0x2f485e){utils[_0xa403('0x11')](util[_0xa403('0x2')](_0xa403('0x12'),_0xc75afa[_0xa403('0x4')]),_0x2f485e);});}delete members[_0xc75afa['interface']];}function startsWith(_0x1fdc33,_0x40958c){return _[_0xa403('0x13')](_0x1fdc33,function(_0x3516ac){return _[_0xa403('0x14')](_0x40958c,_0x3516ac);});}exports['devicestatechange']=function(_0x329b0a){try{utils[_0xa403('0x15')](util[_0xa403('0x2')]('[%s][members][devicestatechange]',members[_0x329b0a[_0xa403('0x16')]]?members[_0x329b0a[_0xa403('0x16')]][_0xa403('0x4')]:_0x329b0a[_0xa403('0x16')]),_0x329b0a);utils['info'](util['format'](_0xa403('0x17'),members[_0x329b0a[_0xa403('0x16')]]?members[_0x329b0a[_0xa403('0x16')]][_0xa403('0x4')]:_0x329b0a[_0xa403('0x16')],_0x329b0a[_0xa403('0x18')],_0x329b0a[_0xa403('0x16')]));switch(_0x329b0a[_0xa403('0x18')]){case _0xa403('0x19'):case _0xa403('0x1a'):if(!startsWith(exclude,_0x329b0a[_0xa403('0x16')])){members[_0x329b0a[_0xa403('0x16')]]={'channel':_0xa403('0x1b'),'interface':_0x329b0a['device'],'type':_0xa403('0x1c'),'enterAt':utils[_0xa403('0x1d')](),'role':_0xa403('0x1e')};}break;case _0xa403('0x1f'):if(!_[_0xa403('0x20')](members[_0x329b0a[_0xa403('0x16')]])){members[_0x329b0a[_0xa403('0x16')]][_0xa403('0x21')]=utils['now']();members[_0x329b0a[_0xa403('0x16')]][_0xa403('0x22')]=utils['diffTime'](members[_0x329b0a['device']][_0xa403('0x21')],members[_0x329b0a['device']]['enterAt']);if(members[_0x329b0a[_0xa403('0x16')]][_0xa403('0x4')]){writeDB(members[_0x329b0a[_0xa403('0x16')]]);}}break;default:break;}}catch(_0x1fbd9c){utils[_0xa403('0x11')](util[_0xa403('0x2')](_0xa403('0x23'),members[_0x329b0a['device']]?members[_0x329b0a[_0xa403('0x16')]][_0xa403('0x4')]:_0x329b0a[_0xa403('0x16')]),_0x1fbd9c);}};exports[_0xa403('0x24')]=function(_0xeff335){try{if(!_['isNil'](members[_0xeff335[_0xa403('0x5')]])){utils[_0xa403('0x15')](util['format'](_0xa403('0x25'),_0xeff335[_0xa403('0x4')]),_0xeff335);utils[_0xa403('0x26')](util['format'](_0xa403('0x27'),_0xeff335[_0xa403('0x4')],_0xeff335[_0xa403('0x5')],_0xeff335[_0xa403('0x28')]));members[_0xeff335[_0xa403('0x5')]]=_[_0xa403('0x29')](members[_0xeff335[_0xa403('0x5')]],{'data4':_0xeff335['queue'],'uniqueid':_0xeff335['uniqueid']});}}catch(_0x50d8b0){utils[_0xa403('0x11')](util[_0xa403('0x2')](_0xa403('0x25'),_0xeff335[_0xa403('0x4')]),_0x50d8b0);}};exports['cdr']=function(_0x4582e6){try{utils[_0xa403('0x15')](util[_0xa403('0x2')](_0xa403('0x2a'),_0x4582e6['uniqueid']),_0x4582e6);if(_0x4582e6[_0xa403('0x6')]){var _0x26f173=_0x4582e6[_0xa403('0x6')][_0xa403('0x10')]('-')[0x0];if(!_[_0xa403('0x20')](members[_0x26f173])){members[_0x26f173]=_['assign'](members[_0x26f173],{'data1':members[_0x26f173][_0xa403('0x2b')]||_0x4582e6[_0xa403('0x9')],'data2':members[_0x26f173][_0xa403('0x7')]||_0x4582e6[_0xa403('0x2c')],'data3':members[_0x26f173]['data3']||_0x4582e6[_0xa403('0x2d')],'uniqueid':members[_0x26f173]['uniqueid']||_0x4582e6[_0xa403('0x4')]});utils[_0xa403('0x26')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4582e6[_0xa403('0x4')],members[_0x26f173][_0xa403('0x2b')],members[_0x26f173][_0xa403('0x7')],members[_0x26f173]['data3']));if(members[_0x26f173][_0xa403('0x21')]){writeDB(members[_0x26f173]);}}}if(_0x4582e6['destinationchannel']){var _0x4dba29=_0x4582e6[_0xa403('0x2e')]['split']('-')[0x0];if(!_[_0xa403('0x20')](members[_0x4dba29])){members[_0x4dba29]=_[_0xa403('0x29')](members[_0x4dba29],{'data1':members[_0x4dba29][_0xa403('0x2b')]||_0x4582e6[_0xa403('0x9')],'data2':members[_0x4dba29][_0xa403('0x7')]||_0x4582e6['source'],'data3':members[_0x4dba29][_0xa403('0x2f')]||_0x4582e6[_0xa403('0x2d')],'uniqueid':members[_0x4dba29]['uniqueid']||_0x4582e6[_0xa403('0x4')]});utils[_0xa403('0x26')](util[_0xa403('0x2')](_0xa403('0x30'),_0x4582e6[_0xa403('0x4')],members[_0x4dba29][_0xa403('0x2b')],members[_0x4dba29][_0xa403('0x7')],members[_0x4dba29][_0xa403('0x2f')]));if(members[_0x4dba29][_0xa403('0x21')]){writeDB(members[_0x4dba29]);}}}}catch(_0xead406){utils[_0xa403('0x11')](util[_0xa403('0x2')](_0xa403('0x2a'),_0x4582e6[_0xa403('0x4')]),_0xead406);}};
\ No newline at end of file
index fcb530d..4167cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf25=['[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','format','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','transfer','TRANSFER','COMPLETEDBY','reason','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','error','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop'];(function(_0x58c20a,_0x32b7ab){var _0x475937=function(_0x39a169){while(--_0x39a169){_0x58c20a['push'](_0x58c20a['shift']());}};_0x475937(++_0x32b7ab);}(_0xbf25,0x1b3));var _0x5bf2=function(_0x243078,_0x57c038){_0x243078=_0x243078-0x0;var _0x4695d6=_0xbf25[_0x243078];return _0x4695d6;};'use strict';var _=require(_0x5bf2('0x0'));var util=require('util');var utils=require(_0x5bf2('0x1'));var queues={};function writeDB(_0x44df4d){utils['info'](util[_0x5bf2('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x44df4d[_0x5bf2('0x3')],_0x44df4d[_0x5bf2('0x4')],_0x44df4d[_0x5bf2('0x5')],_0x44df4d[_0x5bf2('0x6')],_0x44df4d['calleridnum'],_0x44df4d[_0x5bf2('0x7')],_0x44df4d[_0x5bf2('0x8')]));if(_0x44df4d[_0x5bf2('0x5')]){utils[_0x5bf2('0x9')](_0x44df4d[_0x5bf2('0x5')])['then'](function(_0x36cc44){if(_0x36cc44){_0x44df4d['type']=_0x36cc44[_0x5bf2('0xa')];}utils['request']('CreateVoiceQueueReport',_0x44df4d);});}else{utils[_0x5bf2('0xb')](_0x5bf2('0xc'),_0x44df4d);}if(_0x44df4d[_0x5bf2('0xd')]){delete queues[_0x44df4d[_0x5bf2('0xd')]];}else{delete queues[_0x44df4d['uniqueid']];}}exports[_0x5bf2('0xe')]=function(_0x4a42cd){try{utils[_0x5bf2('0xf')](util[_0x5bf2('0x2')](_0x5bf2('0x10'),_0x4a42cd['uniqueid']),_0x4a42cd);utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x12'),_0x4a42cd[_0x5bf2('0x3')],_0x4a42cd[_0x5bf2('0x5')],_0x4a42cd[_0x5bf2('0x13')]));queues[_0x4a42cd['uniqueid']]=_[_0x5bf2('0x14')](_0x4a42cd,{'originalposition':_0x4a42cd[_0x5bf2('0x13')],'queuecallerjoinAt':utils[_0x5bf2('0x15')](),'mohtime':0x0});}catch(_0x81ed68){utils['error'](util['format'](_0x5bf2('0x10'),_0x4a42cd[_0x5bf2('0x3')]),_0x81ed68);}};exports[_0x5bf2('0x16')]=function(_0x10893c){try{if(!_[_0x5bf2('0x17')](queues[_0x10893c[_0x5bf2('0x3')]])){utils['debug'](util['format'](_0x5bf2('0x18'),_0x10893c['uniqueid']),_0x10893c);if(queues[_0x10893c[_0x5bf2('0x3')]][_0x5bf2('0x19')]){if(!queues[_0x10893c[_0x5bf2('0x3')]][_0x5bf2('0x1a')]&&!queues[_0x10893c[_0x5bf2('0x3')]][_0x5bf2('0x1b')]){queues[_0x10893c['uniqueid']][_0x5bf2('0x1c')]=!![];queues[_0x10893c[_0x5bf2('0x3')]]['queuecallercompleteAt']=utils['now']();queues[_0x10893c[_0x5bf2('0x3')]][_0x5bf2('0x8')]=_0x5bf2('0x1d');}utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x1e'),_0x10893c[_0x5bf2('0x3')],queues[_0x10893c[_0x5bf2('0x3')]][_0x5bf2('0x1f')],queues[_0x10893c[_0x5bf2('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x10893c[_0x5bf2('0x3')]]);}else if(queues[_0x10893c[_0x5bf2('0x3')]][_0x5bf2('0xd')]){utils[_0x5bf2('0x11')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x10893c[_0x5bf2('0x3')],queues[_0x10893c['uniqueid']][_0x5bf2('0x1f')],queues[_0x10893c['uniqueid']]['transfereduniqueid']));queues[queues[_0x10893c[_0x5bf2('0x3')]]['transfereduniqueid']]=queues[_0x10893c[_0x5bf2('0x3')]];queues[queues[_0x10893c[_0x5bf2('0x3')]][_0x5bf2('0xd')]][_0x5bf2('0x20')]=0x2;delete queues[_0x10893c[_0x5bf2('0x3')]];}}}catch(_0xf7109e){utils['error'](util['format'](_0x5bf2('0x18'),_0x10893c[_0x5bf2('0x3')]),_0xf7109e);}};exports[_0x5bf2('0x21')]=function(_0x4fdcf8){try{utils[_0x5bf2('0xf')](util[_0x5bf2('0x2')](_0x5bf2('0x22'),_0x4fdcf8[_0x5bf2('0x3')]),_0x4fdcf8);if(!_['isNil'](_0x4fdcf8['variable'][_0x5bf2('0x23')])&&_0x4fdcf8[_0x5bf2('0x24')]['toUpperCase']()!==_0x5bf2('0x25')){if(!_[_0x5bf2('0x17')](queues[_0x4fdcf8['uniqueid']])){queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x1a')]=![];queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x26')]=null;queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x1b')]=!![];queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x27')]=utils['now']();queues[_0x4fdcf8[_0x5bf2('0x3')]]['queuecallerexitreason']=_0x4fdcf8['value']['toUpperCase']();utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4fdcf8[_0x5bf2('0x3')],queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x1f')],_0x4fdcf8[_0x5bf2('0x24')],queues[_0x4fdcf8[_0x5bf2('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x4fdcf8[_0x5bf2('0x3')]]);}}else if(!_['isNil'](_0x4fdcf8['variable'][_0x5bf2('0x28')])){if(!_[_0x5bf2('0x17')](queues[_0x4fdcf8[_0x5bf2('0x3')]])&&!queues[_0x4fdcf8[_0x5bf2('0x3')]]['queuecallerabandon']){queues[_0x4fdcf8['uniqueid']][_0x5bf2('0x1a')]=![];queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x26')]=null;queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x1b')]=!![];queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x27')]=utils['now']();queues[_0x4fdcf8['uniqueid']]['queuecallerexitreason']=_0x5bf2('0x29');utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x2a'),_0x4fdcf8[_0x5bf2('0x3')],queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x1f')],_0x4fdcf8[_0x5bf2('0x24')],queues[_0x4fdcf8[_0x5bf2('0x3')]][_0x5bf2('0x8')]));}}}catch(_0x445dff){utils['error'](util[_0x5bf2('0x2')](_0x5bf2('0x22'),_0x4fdcf8[_0x5bf2('0x3')]),_0x445dff);}};exports['queuecallerabandon']=function(_0x28d861){try{if(!_[_0x5bf2('0x17')](queues[_0x28d861[_0x5bf2('0x3')]])){utils[_0x5bf2('0xf')](util[_0x5bf2('0x2')](_0x5bf2('0x2b'),_0x28d861[_0x5bf2('0x3')]),_0x28d861);queues[_0x28d861['uniqueid']][_0x5bf2('0x1b')]=![];queues[_0x28d861[_0x5bf2('0x3')]][_0x5bf2('0x27')]=null;queues[_0x28d861['uniqueid']]['queuecallerabandon']=!![];queues[_0x28d861[_0x5bf2('0x3')]][_0x5bf2('0x26')]=utils[_0x5bf2('0x15')]();queues[_0x28d861[_0x5bf2('0x3')]][_0x5bf2('0x8')]=_0x5bf2('0x2c');utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x2d'),_0x28d861[_0x5bf2('0x3')],queues[_0x28d861[_0x5bf2('0x3')]][_0x5bf2('0x1f')],queues[_0x28d861[_0x5bf2('0x3')]][_0x5bf2('0x8')]));}}catch(_0x565ae4){utils['error'](util['format'](_0x5bf2('0x2b'),_0x28d861[_0x5bf2('0x3')]),_0x565ae4);}};exports[_0x5bf2('0x2e')]=function(_0x289a37){try{if(!_[_0x5bf2('0x17')](queues[_0x289a37[_0x5bf2('0x3')]])){utils[_0x5bf2('0xf')](util['format'](_0x5bf2('0x2f'),_0x289a37[_0x5bf2('0x3')]),_0x289a37);utils['info'](util[_0x5bf2('0x2')](_0x5bf2('0x30'),_0x289a37['uniqueid'],queues[_0x289a37[_0x5bf2('0x3')]][_0x5bf2('0x1f')],_0x289a37[_0x5bf2('0x31')],_0x289a37[_0x5bf2('0x32')]));queues[_0x289a37[_0x5bf2('0x3')]]['queuecallerleave']=!![];queues[_0x289a37[_0x5bf2('0x3')]]['queuecallerleaveAt']=utils['now']();queues[_0x289a37[_0x5bf2('0x3')]][_0x5bf2('0x33')]=utils['diffTime'](queues[_0x289a37[_0x5bf2('0x3')]]['queuecallerleaveAt'],queues[_0x289a37[_0x5bf2('0x3')]]['queuecallerjoinAt']);queues[_0x289a37['uniqueid']]['position']=_0x289a37['position'];queues[_0x289a37['uniqueid']]['count']=_0x289a37[_0x5bf2('0x34')];queues[_0x289a37['uniqueid']][_0x5bf2('0x31')]=_0x289a37[_0x5bf2('0x31')];queues[_0x289a37[_0x5bf2('0x3')]][_0x5bf2('0x32')]=_0x289a37[_0x5bf2('0x32')];}}catch(_0x5c5e34){utils['error'](util['format']('[%s][queues][queuecallerleave]',_0x289a37['uniqueid']),_0x5c5e34);}};exports[_0x5bf2('0x35')]=function(_0x5a2bf0){try{if(!_[_0x5bf2('0x17')](queues[_0x5a2bf0['uniqueid']])){utils[_0x5bf2('0xf')](util['format'](_0x5bf2('0x36'),_0x5a2bf0[_0x5bf2('0x3')]),_0x5a2bf0);utils[_0x5bf2('0x11')](util['format'](_0x5bf2('0x37'),_0x5a2bf0['uniqueid'],queues[_0x5a2bf0['uniqueid']][_0x5bf2('0x1f')],_0x5a2bf0[_0x5bf2('0x38')],_0x5a2bf0[_0x5bf2('0x39')]));queues[_0x5a2bf0[_0x5bf2('0x3')]][_0x5bf2('0x1a')]=![];queues[_0x5a2bf0[_0x5bf2('0x3')]][_0x5bf2('0x1a')]=![];queues[_0x5a2bf0['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5a2bf0[_0x5bf2('0x3')]][_0x5bf2('0x1b')]=![];queues[_0x5a2bf0[_0x5bf2('0x3')]][_0x5bf2('0x8')]=null;queues[_0x5a2bf0['uniqueid']][_0x5bf2('0x27')]=null;queues[_0x5a2bf0[_0x5bf2('0x3')]][_0x5bf2('0x3a')]=!![];queues[_0x5a2bf0['uniqueid']][_0x5bf2('0x7')]=_0x5a2bf0[_0x5bf2('0x39')];queues[_0x5a2bf0['uniqueid']][_0x5bf2('0x6')]=_0x5a2bf0[_0x5bf2('0x38')];}}catch(_0xdf1e8b){utils['error'](util[_0x5bf2('0x2')](_0x5bf2('0x36'),_0x5a2bf0[_0x5bf2('0x3')]),_0xdf1e8b);}};exports[_0x5bf2('0x3b')]=function(_0x312acc){try{if(!_[_0x5bf2('0x17')](queues[_0x312acc[_0x5bf2('0x3')]])){if(queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x19')]){utils[_0x5bf2('0xf')](util['format'](_0x5bf2('0x3c'),_0x312acc['uniqueid']),_0x312acc);queues[_0x312acc['uniqueid']][_0x5bf2('0x1a')]=![];queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x1a')]=![];queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x26')]=null;queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x1b')]=![];queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x27')]=null;queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x3a')]=!![];queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x6')]=_0x312acc[_0x5bf2('0x38')];queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x1c')]=!![];queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x3d')]=utils[_0x5bf2('0x15')]();if(_0x312acc['reason']==_0x5bf2('0x3e')){if(!queues[_0x312acc['uniqueid']]['transfer']){queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x8')]=_0x5bf2('0x3f');}}else{queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x8')]=_0x5bf2('0x40')+_0x312acc[_0x5bf2('0x41')][_0x5bf2('0x42')]();}utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x43'),_0x312acc[_0x5bf2('0x3')],queues[_0x312acc[_0x5bf2('0x3')]][_0x5bf2('0x1f')],_0x312acc['membername'],queues[_0x312acc['uniqueid']][_0x5bf2('0x8')]));writeDB(queues[_0x312acc[_0x5bf2('0x3')]]);}}}catch(_0x3d3b31){utils[_0x5bf2('0x44')](util[_0x5bf2('0x2')](_0x5bf2('0x3c'),_0x312acc[_0x5bf2('0x3')]),_0x3d3b31);}};exports[_0x5bf2('0x45')]=function(_0x3597ae){try{if(!_[_0x5bf2('0x17')](queues[_0x3597ae['transfereeuniqueid']])){utils[_0x5bf2('0xf')](util[_0x5bf2('0x2')](_0x5bf2('0x46'),_0x3597ae[_0x5bf2('0x3')]),_0x3597ae);queues[_0x3597ae[_0x5bf2('0x47')]][_0x5bf2('0x3e')]=!![];queues[_0x3597ae['transfereeuniqueid']][_0x5bf2('0x48')]=_0x5bf2('0x49');queues[_0x3597ae['transfereeuniqueid']]['transferexten']=_0x3597ae[_0x5bf2('0x4a')];queues[_0x3597ae[_0x5bf2('0x47')]]['transferuniqueid']=_0x3597ae[_0x5bf2('0x47')];queues[_0x3597ae[_0x5bf2('0x47')]][_0x5bf2('0x8')]='BLINDTRANSFER';utils['info'](util[_0x5bf2('0x2')](_0x5bf2('0x4b'),_0x3597ae[_0x5bf2('0x3')],queues[_0x3597ae[_0x5bf2('0x47')]][_0x5bf2('0x1f')],_0x3597ae[_0x5bf2('0x47')],_0x3597ae['extension']));}}catch(_0x1c9749){utils['error'](util['format'](_0x5bf2('0x46'),_0x3597ae[_0x5bf2('0x3')]),_0x1c9749);}};exports[_0x5bf2('0x4c')]=function(_0x15a147){try{utils[_0x5bf2('0xf')](util[_0x5bf2('0x2')]('[%s][queues][attendedtransfer]',_0x15a147[_0x5bf2('0x4d')]),_0x15a147);if(_0x15a147[_0x5bf2('0x4d')]==_0x15a147[_0x5bf2('0x4e')]){if(!_[_0x5bf2('0x17')](queues[_0x15a147['secondtransfererlinkedid']])){utils[_0x5bf2('0x11')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x15a147[_0x5bf2('0x4d')],queues[_0x15a147[_0x5bf2('0x4f')]]['name'],_0x15a147['origtransfererexten']));queues[_0x15a147[_0x5bf2('0x4f')]][_0x5bf2('0x3e')]=!![];queues[_0x15a147[_0x5bf2('0x4f')]]['transfertype']=_0x5bf2('0x50');queues[_0x15a147[_0x5bf2('0x4f')]][_0x5bf2('0x51')]=_0x15a147[_0x5bf2('0x52')];queues[_0x15a147[_0x5bf2('0x4f')]][_0x5bf2('0x53')]=_0x15a147[_0x5bf2('0x4d')];queues[_0x15a147[_0x5bf2('0x4f')]]['queuecallerexitreason']=_0x5bf2('0x54');}if(!_[_0x5bf2('0x17')](queues[_0x15a147[_0x5bf2('0x4e')]])){if(_0x15a147['transfereelinkedid']&&queues[_0x15a147[_0x5bf2('0x55')]]){queues[_0x15a147[_0x5bf2('0x55')]][_0x5bf2('0x20')]=0x1;queues[_0x15a147['transfereeuniqueid']]=_['clone'](queues[_0x15a147[_0x5bf2('0x55')]]);queues[_0x15a147[_0x5bf2('0x47')]][_0x5bf2('0xd')]=_0x15a147[_0x5bf2('0x56')];queues[_0x15a147[_0x5bf2('0x47')]][_0x5bf2('0x20')]=0x2;queues[_0x15a147[_0x5bf2('0x47')]][_0x5bf2('0x57')]=queues[_0x15a147['secondtransfererlinkedid']][_0x5bf2('0x57')];queues[_0x15a147[_0x5bf2('0x47')]][_0x5bf2('0x58')]=queues[_0x15a147[_0x5bf2('0x4f')]]['calleridname'];queues[_0x15a147[_0x5bf2('0x47')]][_0x5bf2('0x59')]=utils[_0x5bf2('0x15')]();queues[_0x15a147[_0x5bf2('0x47')]]['queuecallerleaveAt']=utils[_0x5bf2('0x15')]();queues[_0x15a147[_0x5bf2('0x47')]][_0x5bf2('0x33')]=0x0;queues[_0x15a147[_0x5bf2('0x47')]][_0x5bf2('0x5a')]=0x0;utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x5b'),_0x15a147[_0x5bf2('0x4d')],queues[_0x15a147[_0x5bf2('0x47')]][_0x5bf2('0x1f')],queues[_0x15a147[_0x5bf2('0x47')]]['calleridnum'],queues[_0x15a147['transfereeuniqueid']][_0x5bf2('0x58')]));}else{utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x5c'),_0x15a147[_0x5bf2('0x4d')],queues[_0x15a147[_0x5bf2('0x4e')]]['name'],_0x15a147[_0x5bf2('0x4f')]));queues[_0x15a147[_0x5bf2('0x4e')]][_0x5bf2('0xd')]=_0x15a147[_0x5bf2('0x4f')];}}}else if(_0x15a147[_0x5bf2('0x5d')]==_0x15a147[_0x5bf2('0x4f')]){if(!_['isNil'](queues[_0x15a147[_0x5bf2('0x4e')]])){utils['info'](util[_0x5bf2('0x2')](_0x5bf2('0x5e'),_0x15a147[_0x5bf2('0x4d')],queues[_0x15a147[_0x5bf2('0x4e')]][_0x5bf2('0x1f')],_0x15a147[_0x5bf2('0x5d')],_0x15a147[_0x5bf2('0x5f')]));queues[_0x15a147[_0x5bf2('0x4e')]][_0x5bf2('0x3e')]=!![];queues[_0x15a147[_0x5bf2('0x4e')]]['transfertype']=_0x5bf2('0x50');queues[_0x15a147[_0x5bf2('0x4e')]][_0x5bf2('0x51')]=_0x15a147[_0x5bf2('0x5f')];queues[_0x15a147[_0x5bf2('0x4e')]][_0x5bf2('0x53')]=_0x15a147[_0x5bf2('0x5d')];queues[_0x15a147[_0x5bf2('0x4e')]]['queuecallerexitreason']=_0x5bf2('0x54');}if(!_['isNil'](queues[_0x15a147[_0x5bf2('0x4f')]])){if(_0x15a147[_0x5bf2('0x60')]&&queues[_0x15a147[_0x5bf2('0x60')]]){queues[_0x15a147[_0x5bf2('0x60')]][_0x5bf2('0x20')]=0x1;queues[_0x15a147[_0x5bf2('0x56')]]=_[_0x5bf2('0x61')](queues[_0x15a147[_0x5bf2('0x60')]]);queues[_0x15a147[_0x5bf2('0x56')]][_0x5bf2('0xd')]=_0x15a147[_0x5bf2('0x56')];queues[_0x15a147['transfertargetuniqueid']][_0x5bf2('0x20')]=0x2;queues[_0x15a147[_0x5bf2('0x56')]][_0x5bf2('0x57')]=queues[_0x15a147[_0x5bf2('0x4e')]][_0x5bf2('0x57')];queues[_0x15a147['transfertargetuniqueid']][_0x5bf2('0x58')]=queues[_0x15a147[_0x5bf2('0x4e')]][_0x5bf2('0x58')];queues[_0x15a147[_0x5bf2('0x56')]][_0x5bf2('0x59')]=utils[_0x5bf2('0x15')]();queues[_0x15a147[_0x5bf2('0x56')]][_0x5bf2('0x19')]=utils['now']();queues[_0x15a147['transfertargetuniqueid']][_0x5bf2('0x33')]=0x0;queues[_0x15a147[_0x5bf2('0x56')]][_0x5bf2('0x5a')]=0x0;utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x62'),_0x15a147[_0x5bf2('0x4d')],queues[_0x15a147['transfertargetuniqueid']][_0x5bf2('0x1f')],queues[_0x15a147[_0x5bf2('0x56')]]['transfereduniqueid'],queues[_0x15a147['transfertargetuniqueid']][_0x5bf2('0x57')],queues[_0x15a147[_0x5bf2('0x56')]][_0x5bf2('0x58')]));}else{utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x15a147[_0x5bf2('0x4d')],queues[_0x15a147[_0x5bf2('0x4f')]]['name'],_0x15a147['origtransfererlinkedid']));queues[_0x15a147['secondtransfererlinkedid']]['transfereduniqueid']=_0x15a147[_0x5bf2('0x4e')];}}}}catch(_0x52b6a5){utils[_0x5bf2('0x44')](util[_0x5bf2('0x2')](_0x5bf2('0x63'),_0x15a147[_0x5bf2('0x4d')]),_0x52b6a5);}};exports[_0x5bf2('0x64')]=function(_0x272d65){try{if(!_[_0x5bf2('0x17')](queues[_0x272d65[_0x5bf2('0x3')]])){utils[_0x5bf2('0xf')](util[_0x5bf2('0x2')](_0x5bf2('0x65'),_0x272d65[_0x5bf2('0x3')]),_0x272d65);queues[_0x272d65[_0x5bf2('0x3')]][_0x5bf2('0x66')]=utils[_0x5bf2('0x15')]();utils[_0x5bf2('0x11')](util[_0x5bf2('0x2')](_0x5bf2('0x67'),_0x272d65['uniqueid'],queues[_0x272d65[_0x5bf2('0x3')]]['name'],queues[_0x272d65[_0x5bf2('0x3')]]['musiconholdstartAt']));}}catch(_0x35000d){utils[_0x5bf2('0x44')](util[_0x5bf2('0x2')](_0x5bf2('0x65'),_0x272d65[_0x5bf2('0x3')]),_0x35000d);}};exports[_0x5bf2('0x68')]=function(_0x51b66c){try{if(!_['isNil'](queues[_0x51b66c['uniqueid']])){if(!_[_0x5bf2('0x17')](queues[_0x51b66c[_0x5bf2('0x3')]][_0x5bf2('0x66')])){utils['debug'](util[_0x5bf2('0x2')](_0x5bf2('0x69'),_0x51b66c['uniqueid']),_0x51b66c);queues[_0x51b66c['uniqueid']]['mohtime']+=utils[_0x5bf2('0x6a')](utils[_0x5bf2('0x15')](),queues[_0x51b66c['uniqueid']][_0x5bf2('0x66')]);utils['info'](util['format'](_0x5bf2('0x6b'),_0x51b66c[_0x5bf2('0x3')],queues[_0x51b66c['uniqueid']][_0x5bf2('0x1f')],queues[_0x51b66c[_0x5bf2('0x3')]][_0x5bf2('0x5a')]));delete queues[_0x51b66c[_0x5bf2('0x3')]]['musiconholdstartAt'];}}}catch(_0x5269cd){utils[_0x5bf2('0x44')](util['format'](_0x5bf2('0x69'),_0x51b66c[_0x5bf2('0x3')]),_0x5269cd);}};
\ No newline at end of file
+var _0x6193=['queuestatus','toUpperCase','CONTINUE','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','accountcode','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','transferuniqueid','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','[%s][queues][queuecallerjoin]','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','error','varset','[%s][queues][varset]','variable'];(function(_0x4ce87b,_0x4970bb){var _0x247a10=function(_0x2749c7){while(--_0x2749c7){_0x4ce87b['push'](_0x4ce87b['shift']());}};_0x247a10(++_0x4970bb);}(_0x6193,0xa8));var _0x3619=function(_0x2a9fcf,_0x1771c8){_0x2a9fcf=_0x2a9fcf-0x0;var _0x300545=_0x6193[_0x2a9fcf];return _0x300545;};'use strict';var _=require(_0x3619('0x0'));var util=require(_0x3619('0x1'));var utils=require(_0x3619('0x2'));var queues={};function writeDB(_0x8d148d){utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x5'),_0x8d148d[_0x3619('0x6')],_0x8d148d[_0x3619('0x7')],_0x8d148d[_0x3619('0x8')],_0x8d148d[_0x3619('0x9')],_0x8d148d[_0x3619('0xa')],_0x8d148d['accountcode'],_0x8d148d[_0x3619('0xb')]));if(_0x8d148d[_0x3619('0x8')]){utils[_0x3619('0xc')](_0x8d148d[_0x3619('0x8')])[_0x3619('0xd')](function(_0xcc4d){if(_0xcc4d){_0x8d148d[_0x3619('0xe')]=_0xcc4d[_0x3619('0xe')];}utils[_0x3619('0xf')]('CreateVoiceQueueReport',_0x8d148d);});}else{utils['request'](_0x3619('0x10'),_0x8d148d);}if(_0x8d148d['transfereduniqueid']){delete queues[_0x8d148d[_0x3619('0x11')]];}else{delete queues[_0x8d148d['uniqueid']];}}exports['queuecallerjoin']=function(_0x51d863){try{utils[_0x3619('0x12')](util[_0x3619('0x4')]('[%s][queues][queuecallerjoin]',_0x51d863[_0x3619('0x6')]),_0x51d863);utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x13'),_0x51d863['uniqueid'],_0x51d863[_0x3619('0x8')],_0x51d863['position']));queues[_0x51d863['uniqueid']]=_[_0x3619('0x14')](_0x51d863,{'originalposition':_0x51d863[_0x3619('0x15')],'queuecallerjoinAt':utils[_0x3619('0x16')](),'mohtime':0x0});}catch(_0x5cb37e){utils['error'](util[_0x3619('0x4')](_0x3619('0x17'),_0x51d863[_0x3619('0x6')]),_0x5cb37e);}};exports['hangup']=function(_0x5f1ace){try{if(!_[_0x3619('0x18')](queues[_0x5f1ace[_0x3619('0x6')]])){utils['debug'](util[_0x3619('0x4')](_0x3619('0x19'),_0x5f1ace[_0x3619('0x6')]),_0x5f1ace);if(queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x1a')]){if(!queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x1b')]&&!queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x1c')]){queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x1d')]=!![];queues[_0x5f1ace[_0x3619('0x6')]]['queuecallercompleteAt']=utils['now']();queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0xb')]='COMPLETEDBYAGENT';}utils['info'](util[_0x3619('0x4')](_0x3619('0x1e'),_0x5f1ace[_0x3619('0x6')],queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x1f')],queues[_0x5f1ace['uniqueid']][_0x3619('0xb')]));writeDB(queues[_0x5f1ace[_0x3619('0x6')]]);}else if(queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x11')]){utils['info'](util[_0x3619('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5f1ace['uniqueid'],queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x1f')],queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x11')]));queues[queues[_0x5f1ace[_0x3619('0x6')]][_0x3619('0x11')]]=queues[_0x5f1ace['uniqueid']];queues[queues[_0x5f1ace[_0x3619('0x6')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x5f1ace[_0x3619('0x6')]];}}}catch(_0x29c511){utils[_0x3619('0x20')](util[_0x3619('0x4')](_0x3619('0x19'),_0x5f1ace[_0x3619('0x6')]),_0x29c511);}};exports[_0x3619('0x21')]=function(_0x4c44ad){try{utils['debug'](util['format'](_0x3619('0x22'),_0x4c44ad[_0x3619('0x6')]),_0x4c44ad);if(!_[_0x3619('0x18')](_0x4c44ad[_0x3619('0x23')][_0x3619('0x24')])&&_0x4c44ad['value'][_0x3619('0x25')]()!==_0x3619('0x26')){if(!_[_0x3619('0x18')](queues[_0x4c44ad[_0x3619('0x6')]])){queues[_0x4c44ad[_0x3619('0x6')]]['queuecallerabandon']=![];queues[_0x4c44ad['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4c44ad[_0x3619('0x6')]]['queuecallerexit']=!![];queues[_0x4c44ad[_0x3619('0x6')]]['queuecallerexitAt']=utils[_0x3619('0x16')]();queues[_0x4c44ad['uniqueid']][_0x3619('0xb')]=_0x4c44ad[_0x3619('0x27')]['toUpperCase']();utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x28'),_0x4c44ad[_0x3619('0x6')],queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0x1f')],_0x4c44ad[_0x3619('0x27')],queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0xb')]));writeDB(queues[_0x4c44ad[_0x3619('0x6')]]);}}else if(!_['isNil'](_0x4c44ad[_0x3619('0x23')]['queueposition'])){if(!_[_0x3619('0x18')](queues[_0x4c44ad['uniqueid']])&&!queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0x1b')]){queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0x1b')]=![];queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0x29')]=null;queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0x1c')]=!![];queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0x2a')]=utils[_0x3619('0x16')]();queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0xb')]='EXITWITHKEY';utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x2b'),_0x4c44ad[_0x3619('0x6')],queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0x1f')],_0x4c44ad[_0x3619('0x27')],queues[_0x4c44ad[_0x3619('0x6')]][_0x3619('0xb')]));}}}catch(_0x4c06e3){utils[_0x3619('0x20')](util['format'](_0x3619('0x22'),_0x4c44ad['uniqueid']),_0x4c06e3);}};exports['queuecallerabandon']=function(_0x440ed7){try{if(!_[_0x3619('0x18')](queues[_0x440ed7[_0x3619('0x6')]])){utils[_0x3619('0x12')](util[_0x3619('0x4')](_0x3619('0x2c'),_0x440ed7[_0x3619('0x6')]),_0x440ed7);queues[_0x440ed7[_0x3619('0x6')]][_0x3619('0x1c')]=![];queues[_0x440ed7[_0x3619('0x6')]][_0x3619('0x2a')]=null;queues[_0x440ed7[_0x3619('0x6')]][_0x3619('0x1b')]=!![];queues[_0x440ed7[_0x3619('0x6')]][_0x3619('0x29')]=utils[_0x3619('0x16')]();queues[_0x440ed7[_0x3619('0x6')]]['queuecallerexitreason']=_0x3619('0x2d');utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x2e'),_0x440ed7[_0x3619('0x6')],queues[_0x440ed7[_0x3619('0x6')]]['name'],queues[_0x440ed7['uniqueid']][_0x3619('0xb')]));}}catch(_0x33c424){utils[_0x3619('0x20')](util[_0x3619('0x4')](_0x3619('0x2c'),_0x440ed7[_0x3619('0x6')]),_0x33c424);}};exports['queuecallerleave']=function(_0x28c429){try{if(!_[_0x3619('0x18')](queues[_0x28c429[_0x3619('0x6')]])){utils[_0x3619('0x12')](util[_0x3619('0x4')]('[%s][queues][queuecallerleave]',_0x28c429[_0x3619('0x6')]),_0x28c429);utils['info'](util[_0x3619('0x4')](_0x3619('0x2f'),_0x28c429[_0x3619('0x6')],queues[_0x28c429[_0x3619('0x6')]][_0x3619('0x1f')],_0x28c429[_0x3619('0x30')],_0x28c429[_0x3619('0x31')]));queues[_0x28c429[_0x3619('0x6')]][_0x3619('0x32')]=!![];queues[_0x28c429['uniqueid']][_0x3619('0x1a')]=utils[_0x3619('0x16')]();queues[_0x28c429['uniqueid']][_0x3619('0x33')]=utils['diffTime'](queues[_0x28c429[_0x3619('0x6')]][_0x3619('0x1a')],queues[_0x28c429[_0x3619('0x6')]][_0x3619('0x34')]);queues[_0x28c429[_0x3619('0x6')]]['position']=_0x28c429[_0x3619('0x15')];queues[_0x28c429[_0x3619('0x6')]][_0x3619('0x35')]=_0x28c429[_0x3619('0x35')];queues[_0x28c429[_0x3619('0x6')]]['connectedlinenum']=_0x28c429[_0x3619('0x30')];queues[_0x28c429[_0x3619('0x6')]][_0x3619('0x31')]=_0x28c429[_0x3619('0x31')];}}catch(_0x42819d){utils[_0x3619('0x20')](util['format'](_0x3619('0x36'),_0x28c429['uniqueid']),_0x42819d);}};exports[_0x3619('0x37')]=function(_0x2777f7){try{if(!_[_0x3619('0x18')](queues[_0x2777f7[_0x3619('0x6')]])){utils['debug'](util[_0x3619('0x4')](_0x3619('0x38'),_0x2777f7[_0x3619('0x6')]),_0x2777f7);utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x39'),_0x2777f7[_0x3619('0x6')],queues[_0x2777f7[_0x3619('0x6')]][_0x3619('0x1f')],_0x2777f7[_0x3619('0x3a')],_0x2777f7[_0x3619('0x3b')]));queues[_0x2777f7[_0x3619('0x6')]][_0x3619('0x1b')]=![];queues[_0x2777f7['uniqueid']][_0x3619('0x1b')]=![];queues[_0x2777f7['uniqueid']]['queuecallerabandonAt']=null;queues[_0x2777f7[_0x3619('0x6')]][_0x3619('0x1c')]=![];queues[_0x2777f7[_0x3619('0x6')]]['queuecallerexitreason']=null;queues[_0x2777f7[_0x3619('0x6')]][_0x3619('0x2a')]=null;queues[_0x2777f7[_0x3619('0x6')]]['assigned']=!![];queues[_0x2777f7['uniqueid']][_0x3619('0x3c')]=_0x2777f7[_0x3619('0x3b')];queues[_0x2777f7[_0x3619('0x6')]]['lastAssignedTo']=_0x2777f7['membername'];}}catch(_0xb880db){utils[_0x3619('0x20')](util['format'](_0x3619('0x38'),_0x2777f7[_0x3619('0x6')]),_0xb880db);}};exports['agentcomplete']=function(_0x32f3f2){try{if(!_['isNil'](queues[_0x32f3f2[_0x3619('0x6')]])){if(queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0x1a')]){utils[_0x3619('0x12')](util['format'](_0x3619('0x3d'),_0x32f3f2['uniqueid']),_0x32f3f2);queues[_0x32f3f2['uniqueid']][_0x3619('0x1b')]=![];queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0x1b')]=![];queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0x29')]=null;queues[_0x32f3f2['uniqueid']][_0x3619('0x1c')]=![];queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0x2a')]=null;queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0x3e')]=!![];queues[_0x32f3f2[_0x3619('0x6')]]['lastAssignedTo']=_0x32f3f2[_0x3619('0x3a')];queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0x1d')]=!![];queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0x3f')]=utils[_0x3619('0x16')]();if(_0x32f3f2[_0x3619('0x40')]==_0x3619('0x41')){if(!queues[_0x32f3f2['uniqueid']][_0x3619('0x41')]){queues[_0x32f3f2[_0x3619('0x6')]]['queuecallerexitreason']=_0x3619('0x42');}}else{queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0xb')]=_0x3619('0x43')+_0x32f3f2[_0x3619('0x40')][_0x3619('0x25')]();}utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x44'),_0x32f3f2[_0x3619('0x6')],queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0x1f')],_0x32f3f2['membername'],queues[_0x32f3f2[_0x3619('0x6')]][_0x3619('0xb')]));writeDB(queues[_0x32f3f2['uniqueid']]);}}}catch(_0x7c3f68){utils['error'](util['format'](_0x3619('0x3d'),_0x32f3f2[_0x3619('0x6')]),_0x7c3f68);}};exports[_0x3619('0x45')]=function(_0x1fa219){try{if(!_[_0x3619('0x18')](queues[_0x1fa219[_0x3619('0x46')]])){utils['debug'](util[_0x3619('0x4')](_0x3619('0x47'),_0x1fa219['uniqueid']),_0x1fa219);queues[_0x1fa219[_0x3619('0x46')]][_0x3619('0x41')]=!![];queues[_0x1fa219[_0x3619('0x46')]][_0x3619('0x48')]='BLIND';queues[_0x1fa219['transfereeuniqueid']][_0x3619('0x49')]=_0x1fa219['extension'];queues[_0x1fa219[_0x3619('0x46')]][_0x3619('0x4a')]=_0x1fa219[_0x3619('0x46')];queues[_0x1fa219[_0x3619('0x46')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0x3619('0x3')](util[_0x3619('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x1fa219['uniqueid'],queues[_0x1fa219[_0x3619('0x46')]]['name'],_0x1fa219['transfereeuniqueid'],_0x1fa219['extension']));}}catch(_0x524873){utils[_0x3619('0x20')](util[_0x3619('0x4')]('[%s][queues][blindtransfer]',_0x1fa219[_0x3619('0x6')]),_0x524873);}};exports[_0x3619('0x4b')]=function(_0x35cb6c){try{utils['debug'](util[_0x3619('0x4')](_0x3619('0x4c'),_0x35cb6c[_0x3619('0x4d')]),_0x35cb6c);if(_0x35cb6c[_0x3619('0x4d')]==_0x35cb6c[_0x3619('0x4e')]){if(!_[_0x3619('0x18')](queues[_0x35cb6c[_0x3619('0x4f')]])){utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x50'),_0x35cb6c[_0x3619('0x4d')],queues[_0x35cb6c[_0x3619('0x4f')]][_0x3619('0x1f')],_0x35cb6c[_0x3619('0x51')]));queues[_0x35cb6c[_0x3619('0x4f')]]['transfer']=!![];queues[_0x35cb6c[_0x3619('0x4f')]][_0x3619('0x48')]=_0x3619('0x52');queues[_0x35cb6c['secondtransfererlinkedid']]['transferexten']=_0x35cb6c[_0x3619('0x51')];queues[_0x35cb6c[_0x3619('0x4f')]][_0x3619('0x4a')]=_0x35cb6c[_0x3619('0x4d')];queues[_0x35cb6c[_0x3619('0x4f')]][_0x3619('0xb')]=_0x3619('0x53');}if(!_[_0x3619('0x18')](queues[_0x35cb6c[_0x3619('0x4e')]])){if(_0x35cb6c[_0x3619('0x54')]&&queues[_0x35cb6c['transfereelinkedid']]){queues[_0x35cb6c[_0x3619('0x54')]][_0x3619('0x55')]=0x1;queues[_0x35cb6c[_0x3619('0x46')]]=_['clone'](queues[_0x35cb6c['transfereelinkedid']]);queues[_0x35cb6c['transfereeuniqueid']][_0x3619('0x11')]=_0x35cb6c[_0x3619('0x56')];queues[_0x35cb6c[_0x3619('0x46')]]['queuecallerenterreason']=0x2;queues[_0x35cb6c[_0x3619('0x46')]][_0x3619('0xa')]=queues[_0x35cb6c[_0x3619('0x4f')]][_0x3619('0xa')];queues[_0x35cb6c[_0x3619('0x46')]][_0x3619('0x57')]=queues[_0x35cb6c['secondtransfererlinkedid']]['calleridname'];queues[_0x35cb6c['transfereeuniqueid']][_0x3619('0x34')]=utils[_0x3619('0x16')]();queues[_0x35cb6c[_0x3619('0x46')]]['queuecallerleaveAt']=utils['now']();queues[_0x35cb6c[_0x3619('0x46')]]['holdtime']=0x0;queues[_0x35cb6c[_0x3619('0x46')]][_0x3619('0x58')]=0x0;utils['info'](util[_0x3619('0x4')](_0x3619('0x59'),_0x35cb6c[_0x3619('0x4d')],queues[_0x35cb6c[_0x3619('0x46')]][_0x3619('0x1f')],queues[_0x35cb6c[_0x3619('0x46')]]['calleridnum'],queues[_0x35cb6c[_0x3619('0x46')]][_0x3619('0x57')]));}else{utils['info'](util[_0x3619('0x4')](_0x3619('0x5a'),_0x35cb6c[_0x3619('0x4d')],queues[_0x35cb6c[_0x3619('0x4e')]][_0x3619('0x1f')],_0x35cb6c[_0x3619('0x4f')]));queues[_0x35cb6c[_0x3619('0x4e')]][_0x3619('0x11')]=_0x35cb6c['secondtransfererlinkedid'];}}}else if(_0x35cb6c[_0x3619('0x5b')]==_0x35cb6c['secondtransfererlinkedid']){if(!_[_0x3619('0x18')](queues[_0x35cb6c[_0x3619('0x4e')]])){utils[_0x3619('0x3')](util[_0x3619('0x4')](_0x3619('0x5c'),_0x35cb6c[_0x3619('0x4d')],queues[_0x35cb6c[_0x3619('0x4e')]][_0x3619('0x1f')],_0x35cb6c[_0x3619('0x5b')],_0x35cb6c[_0x3619('0x5d')]));queues[_0x35cb6c[_0x3619('0x4e')]]['transfer']=!![];queues[_0x35cb6c[_0x3619('0x4e')]]['transfertype']='ATTENDED';queues[_0x35cb6c['origtransfererlinkedid']][_0x3619('0x49')]=_0x35cb6c[_0x3619('0x5d')];queues[_0x35cb6c[_0x3619('0x4e')]][_0x3619('0x4a')]=_0x35cb6c[_0x3619('0x5b')];queues[_0x35cb6c[_0x3619('0x4e')]][_0x3619('0xb')]=_0x3619('0x53');}if(!_[_0x3619('0x18')](queues[_0x35cb6c['secondtransfererlinkedid']])){if(_0x35cb6c[_0x3619('0x5e')]&&queues[_0x35cb6c[_0x3619('0x5e')]]){queues[_0x35cb6c[_0x3619('0x5e')]][_0x3619('0x55')]=0x1;queues[_0x35cb6c[_0x3619('0x56')]]=_[_0x3619('0x5f')](queues[_0x35cb6c[_0x3619('0x5e')]]);queues[_0x35cb6c['transfertargetuniqueid']]['transfereduniqueid']=_0x35cb6c[_0x3619('0x56')];queues[_0x35cb6c[_0x3619('0x56')]][_0x3619('0x55')]=0x2;queues[_0x35cb6c[_0x3619('0x56')]][_0x3619('0xa')]=queues[_0x35cb6c[_0x3619('0x4e')]][_0x3619('0xa')];queues[_0x35cb6c['transfertargetuniqueid']]['calleridname']=queues[_0x35cb6c[_0x3619('0x4e')]][_0x3619('0x57')];queues[_0x35cb6c[_0x3619('0x56')]][_0x3619('0x34')]=utils[_0x3619('0x16')]();queues[_0x35cb6c[_0x3619('0x56')]][_0x3619('0x1a')]=utils[_0x3619('0x16')]();queues[_0x35cb6c[_0x3619('0x56')]][_0x3619('0x33')]=0x0;queues[_0x35cb6c[_0x3619('0x56')]][_0x3619('0x58')]=0x0;utils[_0x3619('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x35cb6c['origtransfereruniqueid'],queues[_0x35cb6c['transfertargetuniqueid']][_0x3619('0x1f')],queues[_0x35cb6c[_0x3619('0x56')]][_0x3619('0x11')],queues[_0x35cb6c[_0x3619('0x56')]][_0x3619('0xa')],queues[_0x35cb6c[_0x3619('0x56')]]['calleridname']));}else{utils['info'](util[_0x3619('0x4')](_0x3619('0x5a'),_0x35cb6c[_0x3619('0x4d')],queues[_0x35cb6c[_0x3619('0x4f')]][_0x3619('0x1f')],_0x35cb6c[_0x3619('0x4e')]));queues[_0x35cb6c[_0x3619('0x4f')]]['transfereduniqueid']=_0x35cb6c[_0x3619('0x4e')];}}}}catch(_0x45cb80){utils['error'](util['format'](_0x3619('0x4c'),_0x35cb6c[_0x3619('0x4d')]),_0x45cb80);}};exports[_0x3619('0x60')]=function(_0x509045){try{if(!_[_0x3619('0x18')](queues[_0x509045[_0x3619('0x6')]])){utils[_0x3619('0x12')](util[_0x3619('0x4')](_0x3619('0x61'),_0x509045[_0x3619('0x6')]),_0x509045);queues[_0x509045['uniqueid']][_0x3619('0x62')]=utils['now']();utils[_0x3619('0x3')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x509045[_0x3619('0x6')],queues[_0x509045[_0x3619('0x6')]][_0x3619('0x1f')],queues[_0x509045[_0x3619('0x6')]][_0x3619('0x62')]));}}catch(_0x575296){utils[_0x3619('0x20')](util[_0x3619('0x4')](_0x3619('0x61'),_0x509045['uniqueid']),_0x575296);}};exports[_0x3619('0x63')]=function(_0x7b4cea){try{if(!_[_0x3619('0x18')](queues[_0x7b4cea[_0x3619('0x6')]])){if(!_[_0x3619('0x18')](queues[_0x7b4cea[_0x3619('0x6')]][_0x3619('0x62')])){utils[_0x3619('0x12')](util[_0x3619('0x4')](_0x3619('0x64'),_0x7b4cea['uniqueid']),_0x7b4cea);queues[_0x7b4cea[_0x3619('0x6')]][_0x3619('0x58')]+=utils['diffTime'](utils['now'](),queues[_0x7b4cea[_0x3619('0x6')]]['musiconholdstartAt']);utils['info'](util[_0x3619('0x4')](_0x3619('0x65'),_0x7b4cea['uniqueid'],queues[_0x7b4cea[_0x3619('0x6')]][_0x3619('0x1f')],queues[_0x7b4cea[_0x3619('0x6')]][_0x3619('0x58')]));delete queues[_0x7b4cea[_0x3619('0x6')]][_0x3619('0x62')];}}}catch(_0x32aac4){utils[_0x3619('0x20')](util[_0x3619('0x4')](_0x3619('0x64'),_0x7b4cea['uniqueid']),_0x32aac4);}};
\ No newline at end of file
index 7247c98..cf1bc4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5e5=['connectedlinenum','connectedlinename','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','[%s][recordings][queuecallerjoin]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','then','membername','UserId','CreateVoiceRecording','request','newchannel','[%s][recordings][newchannel]','linkedid','info','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','debug','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt'];(function(_0x102b9f,_0x661060){var _0x42c57d=function(_0x5500c2){while(--_0x5500c2){_0x102b9f['push'](_0x102b9f['shift']());}};_0x42c57d(++_0x661060);}(_0xc5e5,0xa7));var _0x5c5e=function(_0x1482f1,_0x49da5e){_0x1482f1=_0x1482f1-0x0;var _0x29f566=_0xc5e5[_0x1482f1];return _0x29f566;};'use strict';var _=require(_0x5c5e('0x0'));var util=require(_0x5c5e('0x1'));var utils=require(_0x5c5e('0x2'));var transfers=require(_0x5c5e('0x3'));var recordings={};function writeDB(_0x27efde){var _0x4db504;utils['info'](util['format']('[%s][recordings][writeDB]',_0x27efde[_0x5c5e('0x4')]));if(transfers[_0x5c5e('0x5')][_0x27efde['uniqueid']]){_0x4db504=_0x27efde[_0x5c5e('0x4')];_0x27efde[_0x5c5e('0x4')]=transfers[_0x5c5e('0x5')][_0x27efde[_0x5c5e('0x4')]][_0x5c5e('0x6')];}if(_0x27efde['accountcode']){utils[_0x5c5e('0x7')](_0x27efde[_0x5c5e('0x8')])[_0x5c5e('0x9')](function(_0x5a61a4){if(_0x5a61a4){_0x27efde[_0x5c5e('0xa')]=_0x5a61a4['name'];_0x27efde[_0x5c5e('0xb')]=_0x5a61a4['id'];}utils['request'](_0x5c5e('0xc'),_0x27efde);});}else{utils[_0x5c5e('0xd')](_0x5c5e('0xc'),_0x27efde);}if(_0x4db504)delete transfers[_0x5c5e('0x5')][_0x4db504];}exports[_0x5c5e('0xe')]=function(_0xab5780){try{utils['debug'](util['format'](_0x5c5e('0xf'),_0xab5780['uniqueid']),_0xab5780);if(_0xab5780[_0x5c5e('0x4')]==_0xab5780[_0x5c5e('0x10')]){utils[_0x5c5e('0x11')](util[_0x5c5e('0x12')](_0x5c5e('0x13'),_0xab5780[_0x5c5e('0x4')],_0xab5780[_0x5c5e('0x14')],_0xab5780[_0x5c5e('0x15')]));recordings[_0xab5780['uniqueid']]={'uniqueid':_0xab5780[_0x5c5e('0x4')],'accountcode':_0xab5780[_0x5c5e('0x8')],'exten':_0xab5780['exten'],'context':_0xab5780[_0x5c5e('0x14')],'channel':_0xab5780['channel'],'monitors':[]};}}catch(_0x37217a){utils[_0x5c5e('0x16')](util[_0x5c5e('0x12')](_0x5c5e('0xf'),_0xab5780[_0x5c5e('0x4')]),_0x37217a);}};exports[_0x5c5e('0x17')]=function(_0xb18798){try{utils['debug'](util[_0x5c5e('0x12')](_0x5c5e('0x18'),_0xb18798[_0x5c5e('0x4')]),_0xb18798);if(!_[_0x5c5e('0x19')](recordings[_0xb18798[_0x5c5e('0x4')]])&&_0xb18798[_0x5c5e('0x1a')]==0x6){utils[_0x5c5e('0x11')](util[_0x5c5e('0x12')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0xb18798[_0x5c5e('0x4')],_0xb18798[_0x5c5e('0x14')],_0xb18798[_0x5c5e('0x1b')]));}else if(!_[_0x5c5e('0x19')](recordings[_0xb18798['linkedid']])&&_0xb18798[_0x5c5e('0x1a')]==0x6&&_0xb18798['context']!='transfer'){utils[_0x5c5e('0x11')](util[_0x5c5e('0x12')](_0x5c5e('0x1c'),_0xb18798[_0x5c5e('0x4')],_0xb18798['linkedid'],_0xb18798[_0x5c5e('0x14')],_0xb18798[_0x5c5e('0x1b')]));recordings[_0xb18798[_0x5c5e('0x10')]]['accountcode']=_0xb18798[_0x5c5e('0x8')];}}catch(_0xbdb70e){utils['error'](util[_0x5c5e('0x12')]('[%s][recordings][newstate]',_0xb18798[_0x5c5e('0x4')]),_0xbdb70e);}};exports['varset']=function(_0x1570d7){try{if(!_[_0x5c5e('0x19')](_0x1570d7[_0x5c5e('0x1d')])&&!_[_0x5c5e('0x19')](_0x1570d7[_0x5c5e('0x1d')][_0x5c5e('0x1e')])){utils[_0x5c5e('0x1f')](util['format'](_0x5c5e('0x20'),_0x1570d7['uniqueid']),_0x1570d7);utils[_0x5c5e('0x11')](util[_0x5c5e('0x12')](_0x5c5e('0x21'),_0x1570d7[_0x5c5e('0x4')],_0x1570d7[_0x5c5e('0x1d')],_0x1570d7[_0x5c5e('0x22')]));if(_[_0x5c5e('0x23')](_0x1570d7[_0x5c5e('0x22')],_0x5c5e('0x24'))){_0x1570d7[_0x5c5e('0x22')]=_0x1570d7[_0x5c5e('0x22')][_0x5c5e('0x25')](_0x5c5e('0x24'),_0x5c5e('0x26'));}if(recordings[_0x1570d7['linkedid']]){var _0xb2716e=_[_0x5c5e('0x27')](recordings[_0x1570d7[_0x5c5e('0x10')]][_0x5c5e('0x28')],{'value':_0x1570d7[_0x5c5e('0x22')]});if(_[_0x5c5e('0x19')](_0xb2716e)){recordings[_0x1570d7[_0x5c5e('0x10')]][_0x5c5e('0x28')]['push']({'value':_0x1570d7[_0x5c5e('0x22')]});}}}}catch(_0x5903c4){utils['error'](util[_0x5c5e('0x12')](_0x5c5e('0x20'),_0x1570d7[_0x5c5e('0x4')]),_0x5903c4);}};exports['hangup']=function(_0x33f160){try{if(!_[_0x5c5e('0x19')](recordings[_0x33f160[_0x5c5e('0x4')]])){utils[_0x5c5e('0x1f')](util[_0x5c5e('0x12')](_0x5c5e('0x29'),_0x33f160[_0x5c5e('0x4')]),_0x33f160);utils[_0x5c5e('0x11')](util['format'](_0x5c5e('0x2a'),_0x33f160[_0x5c5e('0x4')],_0x33f160[_0x5c5e('0x2b')],_0x33f160[_0x5c5e('0x2c')],_0x33f160[_0x5c5e('0x2d')]));recordings[_0x33f160['uniqueid']]['calleridnum']=_0x33f160[_0x5c5e('0x2b')];recordings[_0x33f160[_0x5c5e('0x4')]][_0x5c5e('0x2c')]=_0x33f160[_0x5c5e('0x2c')];recordings[_0x33f160['uniqueid']][_0x5c5e('0x2e')]=_0x33f160[_0x5c5e('0x2e')];recordings[_0x33f160[_0x5c5e('0x4')]][_0x5c5e('0x2f')]=_0x33f160[_0x5c5e('0x2f')];if(recordings[_0x33f160[_0x5c5e('0x4')]]['type']==_0x5c5e('0x30')&&recordings[_0x33f160[_0x5c5e('0x4')]]['accountcode']){recordings[_0x33f160[_0x5c5e('0x4')]][_0x5c5e('0x2e')]=recordings[_0x33f160[_0x5c5e('0x4')]][_0x5c5e('0x8')];recordings[_0x33f160[_0x5c5e('0x4')]][_0x5c5e('0x2f')]='';}recordings[_0x33f160[_0x5c5e('0x4')]][_0x5c5e('0x28')][_0x5c5e('0x31')](function(_0x1eedc2){var _0x523900=_['clone'](recordings[_0x33f160['uniqueid']]);_0x523900[_0x5c5e('0x22')]=_0x1eedc2[_0x5c5e('0x22')];writeDB(_0x523900);});delete recordings[_0x33f160[_0x5c5e('0x4')]];}}catch(_0x55584e){utils[_0x5c5e('0x16')](util['format']('[%s][recordings][hangup]',_0x33f160['uniqueid']),_0x55584e);}};exports[_0x5c5e('0x32')]=function(_0x3e1779){try{if(!_['isNil'](recordings[_0x3e1779[_0x5c5e('0x4')]])){utils[_0x5c5e('0x1f')](util[_0x5c5e('0x12')](_0x5c5e('0x33'),_0x3e1779[_0x5c5e('0x4')]),_0x3e1779);utils[_0x5c5e('0x11')](util['format'](_0x5c5e('0x34'),_0x3e1779[_0x5c5e('0x4')],_0x3e1779['application'],_0x3e1779[_0x5c5e('0x35')]));if(_0x3e1779[_0x5c5e('0x36')]['toLowerCase']()==_0x5c5e('0x37')&&_[_0x5c5e('0x38')](_0x3e1779['appdata'][_0x5c5e('0x39')](),_0x5c5e('0x3a'))){var _0x5f04df=_0x3e1779[_0x5c5e('0x35')][_0x5c5e('0x3b')]('=');var _0x408235=_0x5f04df[0x0][_0x5c5e('0x3c')](_0x5f04df[0x0][_0x5c5e('0x3d')]('(')+0x1,_0x5f04df[0x0][_0x5c5e('0x3d')](')'));var _0x40841a=_0x5f04df[0x1];recordings[_0x3e1779[_0x5c5e('0x4')]][_0x408235]=_0x40841a;}}}catch(_0xbb95e6){utils[_0x5c5e('0x16')](util[_0x5c5e('0x12')]('[%s][recordings][newexten]',_0x3e1779[_0x5c5e('0x4')]),_0xbb95e6);}};exports[_0x5c5e('0x3e')]=function(_0x27a63d){try{if(!_['isNil'](recordings[_0x27a63d[_0x5c5e('0x4')]])){utils[_0x5c5e('0x1f')](util[_0x5c5e('0x12')]('[%s][recordings][queuecallerjoin]',_0x27a63d[_0x5c5e('0x4')]),_0x27a63d);utils[_0x5c5e('0x11')](util[_0x5c5e('0x12')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x27a63d[_0x5c5e('0x4')],_0x27a63d[_0x5c5e('0x3f')]));recordings[_0x27a63d[_0x5c5e('0x4')]]['queue']=_0x27a63d['queue'];}}catch(_0x567fa3){utils['error'](util[_0x5c5e('0x12')](_0x5c5e('0x40'),_0x27a63d[_0x5c5e('0x4')]),_0x567fa3);}};exports['blindtransfer']=function(_0x34a939){try{utils['debug'](util[_0x5c5e('0x12')]('[%s][recordings][blindtransfer]',_0x34a939[_0x5c5e('0x4')]),_0x34a939);utils[_0x5c5e('0x11')](util[_0x5c5e('0x12')](_0x5c5e('0x41'),_0x34a939['uniqueid'],_0x34a939[_0x5c5e('0x42')],_0x34a939[_0x5c5e('0x43')],_0x34a939['transfereecalleridnum'],_0x34a939[_0x5c5e('0x44')]));if(recordings[_0x34a939['transfereruniqueid']]&&transfers[_0x5c5e('0x5')][_0x34a939[_0x5c5e('0x45')]]){transfers[_0x5c5e('0x5')][_0x34a939[_0x5c5e('0x45')]]['recording']=!![];}}catch(_0x251dc5){utils[_0x5c5e('0x16')](util[_0x5c5e('0x12')](_0x5c5e('0x46'),_0x34a939[_0x5c5e('0x4')]),_0x251dc5);}};
\ No newline at end of file
+var _0x80b0=['[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','request','CreateVoiceRecording','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','application','appdata','toLowerCase','set','split','substring','lastIndexOf','queuecallerjoin'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x80b0,0x93));var _0x080b=function(_0x58fa51,_0xfd6269){_0x58fa51=_0x58fa51-0x0;var _0x2ab546=_0x80b0[_0x58fa51];return _0x2ab546;};'use strict';var _=require(_0x080b('0x0'));var util=require(_0x080b('0x1'));var utils=require(_0x080b('0x2'));var transfers=require(_0x080b('0x3'));var recordings={};function writeDB(_0x3408f8){var _0x518e35;utils[_0x080b('0x4')](util[_0x080b('0x5')]('[%s][recordings][writeDB]',_0x3408f8[_0x080b('0x6')]));if(transfers[_0x080b('0x7')][_0x3408f8[_0x080b('0x6')]]){_0x518e35=_0x3408f8[_0x080b('0x6')];_0x3408f8[_0x080b('0x6')]=transfers[_0x080b('0x7')][_0x3408f8['uniqueid']][_0x080b('0x8')];}if(_0x3408f8[_0x080b('0x9')]){utils[_0x080b('0xa')](_0x3408f8[_0x080b('0x9')])['then'](function(_0x28cc2e){if(_0x28cc2e){_0x3408f8[_0x080b('0xb')]=_0x28cc2e['name'];_0x3408f8['UserId']=_0x28cc2e['id'];}utils[_0x080b('0xc')](_0x080b('0xd'),_0x3408f8);});}else{utils[_0x080b('0xc')](_0x080b('0xd'),_0x3408f8);}if(_0x518e35)delete transfers[_0x080b('0x7')][_0x518e35];}exports['newchannel']=function(_0x2aa265){try{utils['debug'](util[_0x080b('0x5')]('[%s][recordings][newchannel]',_0x2aa265[_0x080b('0x6')]),_0x2aa265);if(_0x2aa265['uniqueid']==_0x2aa265[_0x080b('0xe')]){utils[_0x080b('0x4')](util['format'](_0x080b('0xf'),_0x2aa265[_0x080b('0x6')],_0x2aa265[_0x080b('0x10')],_0x2aa265['exten']));recordings[_0x2aa265[_0x080b('0x6')]]={'uniqueid':_0x2aa265['uniqueid'],'accountcode':_0x2aa265[_0x080b('0x9')],'exten':_0x2aa265[_0x080b('0x11')],'context':_0x2aa265[_0x080b('0x10')],'channel':_0x2aa265[_0x080b('0x12')],'monitors':[]};}}catch(_0x515940){utils[_0x080b('0x13')](util['format']('[%s][recordings][newchannel]',_0x2aa265[_0x080b('0x6')]),_0x515940);}};exports[_0x080b('0x14')]=function(_0x471d3f){try{utils[_0x080b('0x15')](util[_0x080b('0x5')](_0x080b('0x16'),_0x471d3f['uniqueid']),_0x471d3f);if(!_[_0x080b('0x17')](recordings[_0x471d3f[_0x080b('0x6')]])&&_0x471d3f['channelstate']==0x6){utils[_0x080b('0x4')](util[_0x080b('0x5')](_0x080b('0x18'),_0x471d3f[_0x080b('0x6')],_0x471d3f[_0x080b('0x10')],_0x471d3f['channel']));}else if(!_[_0x080b('0x17')](recordings[_0x471d3f[_0x080b('0xe')]])&&_0x471d3f[_0x080b('0x19')]==0x6&&_0x471d3f['context']!=_0x080b('0x1a')){utils[_0x080b('0x4')](util[_0x080b('0x5')](_0x080b('0x1b'),_0x471d3f[_0x080b('0x6')],_0x471d3f[_0x080b('0xe')],_0x471d3f[_0x080b('0x10')],_0x471d3f['channel']));recordings[_0x471d3f['linkedid']][_0x080b('0x9')]=_0x471d3f[_0x080b('0x9')];}}catch(_0x3e5c64){utils['error'](util[_0x080b('0x5')](_0x080b('0x16'),_0x471d3f[_0x080b('0x6')]),_0x3e5c64);}};exports[_0x080b('0x1c')]=function(_0x42802d){try{if(!_[_0x080b('0x17')](_0x42802d[_0x080b('0x1d')])&&!_['isNil'](_0x42802d[_0x080b('0x1d')][_0x080b('0x1e')])){utils[_0x080b('0x15')](util['format'](_0x080b('0x1f'),_0x42802d[_0x080b('0x6')]),_0x42802d);utils[_0x080b('0x4')](util['format'](_0x080b('0x20'),_0x42802d[_0x080b('0x6')],_0x42802d['variable'],_0x42802d[_0x080b('0x21')]));if(_[_0x080b('0x22')](_0x42802d[_0x080b('0x21')],'.wav49')){_0x42802d['value']=_0x42802d[_0x080b('0x21')][_0x080b('0x23')](_0x080b('0x24'),_0x080b('0x25'));}if(recordings[_0x42802d[_0x080b('0xe')]]){var _0x12d737=_[_0x080b('0x26')](recordings[_0x42802d[_0x080b('0xe')]][_0x080b('0x27')],{'value':_0x42802d[_0x080b('0x21')]});if(_[_0x080b('0x17')](_0x12d737)){recordings[_0x42802d['linkedid']][_0x080b('0x27')][_0x080b('0x28')]({'value':_0x42802d[_0x080b('0x21')]});}}}}catch(_0x38d19b){utils[_0x080b('0x13')](util[_0x080b('0x5')]('[%s][recordings][varset]',_0x42802d['uniqueid']),_0x38d19b);}};exports[_0x080b('0x29')]=function(_0x3c8a1){try{if(!_[_0x080b('0x17')](recordings[_0x3c8a1[_0x080b('0x6')]])){utils['debug'](util[_0x080b('0x5')](_0x080b('0x2a'),_0x3c8a1[_0x080b('0x6')]),_0x3c8a1);utils['info'](util[_0x080b('0x5')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3c8a1[_0x080b('0x6')],_0x3c8a1[_0x080b('0x2b')],_0x3c8a1[_0x080b('0x2c')],_0x3c8a1[_0x080b('0x2d')]));recordings[_0x3c8a1[_0x080b('0x6')]][_0x080b('0x2b')]=_0x3c8a1[_0x080b('0x2b')];recordings[_0x3c8a1['uniqueid']][_0x080b('0x2c')]=_0x3c8a1[_0x080b('0x2c')];recordings[_0x3c8a1[_0x080b('0x6')]][_0x080b('0x2e')]=_0x3c8a1[_0x080b('0x2e')];recordings[_0x3c8a1[_0x080b('0x6')]][_0x080b('0x2f')]=_0x3c8a1[_0x080b('0x2f')];if(recordings[_0x3c8a1[_0x080b('0x6')]][_0x080b('0x30')]==_0x080b('0x31')&&recordings[_0x3c8a1[_0x080b('0x6')]]['accountcode']){recordings[_0x3c8a1[_0x080b('0x6')]][_0x080b('0x2e')]=recordings[_0x3c8a1[_0x080b('0x6')]][_0x080b('0x9')];recordings[_0x3c8a1[_0x080b('0x6')]][_0x080b('0x2f')]='';}recordings[_0x3c8a1[_0x080b('0x6')]][_0x080b('0x27')][_0x080b('0x32')](function(_0x1412a4){var _0xa93f88=_['clone'](recordings[_0x3c8a1[_0x080b('0x6')]]);_0xa93f88[_0x080b('0x21')]=_0x1412a4[_0x080b('0x21')];writeDB(_0xa93f88);});delete recordings[_0x3c8a1[_0x080b('0x6')]];}}catch(_0x57fd9c){utils[_0x080b('0x13')](util['format'](_0x080b('0x2a'),_0x3c8a1[_0x080b('0x6')]),_0x57fd9c);}};exports[_0x080b('0x33')]=function(_0x379e59){try{if(!_[_0x080b('0x17')](recordings[_0x379e59[_0x080b('0x6')]])){utils[_0x080b('0x15')](util[_0x080b('0x5')]('[%s][recordings][newexten]',_0x379e59['uniqueid']),_0x379e59);utils['info'](util[_0x080b('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x379e59[_0x080b('0x6')],_0x379e59[_0x080b('0x34')],_0x379e59[_0x080b('0x35')]));if(_0x379e59[_0x080b('0x34')][_0x080b('0x36')]()==_0x080b('0x37')&&_['startsWith'](_0x379e59[_0x080b('0x35')][_0x080b('0x36')](),'cdr')){var _0x1927cf=_0x379e59[_0x080b('0x35')][_0x080b('0x38')]('=');var _0x132efb=_0x1927cf[0x0][_0x080b('0x39')](_0x1927cf[0x0][_0x080b('0x3a')]('(')+0x1,_0x1927cf[0x0][_0x080b('0x3a')](')'));var _0x6e91fe=_0x1927cf[0x1];recordings[_0x379e59['uniqueid']][_0x132efb]=_0x6e91fe;}}}catch(_0x220b07){utils['error'](util[_0x080b('0x5')]('[%s][recordings][newexten]',_0x379e59['uniqueid']),_0x220b07);}};exports[_0x080b('0x3b')]=function(_0x47633f){try{if(!_[_0x080b('0x17')](recordings[_0x47633f[_0x080b('0x6')]])){utils[_0x080b('0x15')](util[_0x080b('0x5')](_0x080b('0x3c'),_0x47633f[_0x080b('0x6')]),_0x47633f);utils[_0x080b('0x4')](util[_0x080b('0x5')](_0x080b('0x3d'),_0x47633f[_0x080b('0x6')],_0x47633f[_0x080b('0x3e')]));recordings[_0x47633f[_0x080b('0x6')]]['queue']=_0x47633f['queue'];}}catch(_0x56de5e){utils[_0x080b('0x13')](util['format'](_0x080b('0x3c'),_0x47633f[_0x080b('0x6')]),_0x56de5e);}};exports['blindtransfer']=function(_0x3941e1){try{utils['debug'](util['format'](_0x080b('0x3f'),_0x3941e1[_0x080b('0x6')]),_0x3941e1);utils[_0x080b('0x4')](util['format'](_0x080b('0x40'),_0x3941e1['uniqueid'],_0x3941e1[_0x080b('0x41')],_0x3941e1[_0x080b('0x42')],_0x3941e1['transfereecalleridnum'],_0x3941e1[_0x080b('0x43')]));if(recordings[_0x3941e1[_0x080b('0x44')]]&&transfers[_0x080b('0x7')][_0x3941e1['transfereruniqueid']]){transfers[_0x080b('0x7')][_0x3941e1[_0x080b('0x44')]]['recording']=!![];}}catch(_0x56d6d4){utils[_0x080b('0x13')](util['format'](_0x080b('0x3f'),_0x3941e1['uniqueid']),_0x56d6d4);}};
\ No newline at end of file
index 3f03f80..e924bec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fa1=['[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','uniqueid','type','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fa1,0x153));var _0x19fa=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9fa1[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x19fa('0x0'));var util=require(_0x19fa('0x1'));var utils=require(_0x19fa('0x2'));function writeDB(_0x19d5f8){utils[_0x19fa('0x3')](util[_0x19fa('0x4')](_0x19fa('0x5'),_0x19d5f8['type']==='attended'?_0x19d5f8[_0x19fa('0x6')]:_0x19d5f8[_0x19fa('0x7')],_0x19d5f8[_0x19fa('0x8')]));utils[_0x19fa('0x9')]('CreateVoiceTransferReport',_0x19d5f8);}exports[_0x19fa('0xa')]={};exports[_0x19fa('0xb')]=function(_0x3fa3c9){try{utils[_0x19fa('0xc')](util[_0x19fa('0x4')]('[%s][transfers][blindtransfer]',_0x3fa3c9[_0x19fa('0x7')]),_0x3fa3c9);utils['info'](util[_0x19fa('0x4')](_0x19fa('0xd'),_0x3fa3c9[_0x19fa('0x7')],_0x3fa3c9[_0x19fa('0xe')],_0x3fa3c9[_0x19fa('0xf')],_0x3fa3c9[_0x19fa('0x10')],_0x3fa3c9[_0x19fa('0x11')]));_0x3fa3c9[_0x19fa('0x8')]=_0x19fa('0x12');exports[_0x19fa('0xa')][_0x3fa3c9[_0x19fa('0x13')]]=_0x3fa3c9;writeDB(_0x3fa3c9);}catch(_0x137573){utils[_0x19fa('0x14')](util[_0x19fa('0x4')](_0x19fa('0x15'),_0x3fa3c9['uniqueid']),_0x137573);}};exports[_0x19fa('0x16')]=function(_0x3333d7){try{utils[_0x19fa('0xc')](util[_0x19fa('0x4')](_0x19fa('0x17'),_0x3333d7[_0x19fa('0x6')]),_0x3333d7);utils[_0x19fa('0x3')](util[_0x19fa('0x4')](_0x19fa('0x18'),_0x3333d7[_0x19fa('0x6')],_0x3333d7[_0x19fa('0x19')],_0x3333d7['origtransferercalleridname'],_0x3333d7[_0x19fa('0x1a')],_0x3333d7[_0x19fa('0x1b')]));_0x3333d7=_[_0x19fa('0x1c')](_0x3333d7,{'transfererchannel':_0x3333d7['origtransfererchannel'],'transferercalleridnum':_0x3333d7['origtransferercalleridnum'],'transferercalleridname':_0x3333d7['origtransferercalleridname'],'transfererconnectedlinenum':_0x3333d7[_0x19fa('0x1d')],'transfererconnectedlinename':_0x3333d7[_0x19fa('0x1e')],'transfereraccountcode':_0x3333d7['origtransfereraccountcode'],'transferercontext':_0x3333d7[_0x19fa('0x1f')],'transfererexten':_0x3333d7['secondtransfererexten'],'transfererlinkedid':_0x3333d7[_0x19fa('0x20')],'context':_0x3333d7[_0x19fa('0x21')],'extension':_0x3333d7[_0x19fa('0x22')],'type':_0x19fa('0x23')});if(_[_0x19fa('0x24')](_0x3333d7[_0x19fa('0x25')])){_0x3333d7=_[_0x19fa('0x1c')](_0x3333d7,{'transfereechannel':_0x3333d7[_0x19fa('0x26')],'transfereecalleridnum':_0x3333d7['transfertargetcalleridnum'],'transfereecalleridname':_0x3333d7[_0x19fa('0x1b')],'transfereeconnectedlinenum':_0x3333d7[_0x19fa('0x27')],'transfereeconnectedlinename':_0x3333d7[_0x19fa('0x28')],'transfereeaccountcode':_0x3333d7[_0x19fa('0x29')],'transfereecontext':_0x3333d7[_0x19fa('0x2a')],'transfereeexten':_0x3333d7[_0x19fa('0x2b')],'transfereelinkedid':_0x3333d7[_0x19fa('0x2c')]});}writeDB(_0x3333d7);}catch(_0xdfd326){utils[_0x19fa('0x14')](util[_0x19fa('0x4')](_0x19fa('0x17'),_0x3333d7[_0x19fa('0x6')]),_0xdfd326);}};
\ No newline at end of file
+var _0x0459=['assign','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x0459,0xcf));var _0x9045=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x0459[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x9045('0x0'));var util=require(_0x9045('0x1'));var utils=require(_0x9045('0x2'));function writeDB(_0x3d955c){utils[_0x9045('0x3')](util[_0x9045('0x4')](_0x9045('0x5'),_0x3d955c[_0x9045('0x6')]===_0x9045('0x7')?_0x3d955c[_0x9045('0x8')]:_0x3d955c['uniqueid'],_0x3d955c['type']));utils[_0x9045('0x9')](_0x9045('0xa'),_0x3d955c);}exports[_0x9045('0xb')]={};exports[_0x9045('0xc')]=function(_0x1b3b1c){try{utils[_0x9045('0xd')](util['format'](_0x9045('0xe'),_0x1b3b1c[_0x9045('0xf')]),_0x1b3b1c);utils[_0x9045('0x3')](util[_0x9045('0x4')](_0x9045('0x10'),_0x1b3b1c[_0x9045('0xf')],_0x1b3b1c[_0x9045('0x11')],_0x1b3b1c['transferercalleridname'],_0x1b3b1c['transfereecalleridnum'],_0x1b3b1c[_0x9045('0x12')]));_0x1b3b1c[_0x9045('0x6')]='blind';exports[_0x9045('0xb')][_0x1b3b1c['transfereruniqueid']]=_0x1b3b1c;writeDB(_0x1b3b1c);}catch(_0x37e8c8){utils[_0x9045('0x13')](util[_0x9045('0x4')](_0x9045('0xe'),_0x1b3b1c[_0x9045('0xf')]),_0x37e8c8);}};exports[_0x9045('0x14')]=function(_0x36c544){try{utils[_0x9045('0xd')](util[_0x9045('0x4')](_0x9045('0x15'),_0x36c544[_0x9045('0x8')]),_0x36c544);utils['info'](util[_0x9045('0x4')](_0x9045('0x16'),_0x36c544[_0x9045('0x8')],_0x36c544[_0x9045('0x17')],_0x36c544[_0x9045('0x18')],_0x36c544['transfertargetcalleridnum'],_0x36c544[_0x9045('0x19')]));_0x36c544=_['assign'](_0x36c544,{'transfererchannel':_0x36c544[_0x9045('0x1a')],'transferercalleridnum':_0x36c544[_0x9045('0x17')],'transferercalleridname':_0x36c544[_0x9045('0x18')],'transfererconnectedlinenum':_0x36c544['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x36c544['secondtransfererconnectedlinename'],'transfereraccountcode':_0x36c544['origtransfereraccountcode'],'transferercontext':_0x36c544[_0x9045('0x1b')],'transfererexten':_0x36c544[_0x9045('0x1c')],'transfererlinkedid':_0x36c544[_0x9045('0x1d')],'context':_0x36c544['origtransferercontext'],'extension':_0x36c544[_0x9045('0x1e')],'type':_0x9045('0x7')});if(_[_0x9045('0x1f')](_0x36c544[_0x9045('0x20')])){_0x36c544=_[_0x9045('0x21')](_0x36c544,{'transfereechannel':_0x36c544['transfertargetchannel'],'transfereecalleridnum':_0x36c544['transfertargetcalleridnum'],'transfereecalleridname':_0x36c544['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x36c544[_0x9045('0x22')],'transfereeconnectedlinename':_0x36c544[_0x9045('0x23')],'transfereeaccountcode':_0x36c544[_0x9045('0x24')],'transfereecontext':_0x36c544[_0x9045('0x25')],'transfereeexten':_0x36c544[_0x9045('0x26')],'transfereelinkedid':_0x36c544[_0x9045('0x27')]});}writeDB(_0x36c544);}catch(_0x40f102){utils[_0x9045('0x13')](util[_0x9045('0x4')](_0x9045('0x15'),_0x36c544[_0x9045('0x8')]),_0x40f102);}};
\ No newline at end of file
index 7057f8a..03d2403 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c45=['GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch'];(function(_0x2357fa,_0x31300a){var _0x3c956b=function(_0x36111c){while(--_0x36111c){_0x2357fa['push'](_0x2357fa['shift']());}};_0x3c956b(++_0x31300a);}(_0x6c45,0xb1));var _0x56c4=function(_0x4ba827,_0x528a4e){_0x4ba827=_0x4ba827-0x0;var _0x1b89a0=_0x6c45[_0x4ba827];return _0x1b89a0;};'use strict';var BPromise=require(_0x56c4('0x0'));var jayson=require(_0x56c4('0x1'));var moment=require('moment');var util=require(_0x56c4('0x2'));var client=jayson[_0x56c4('0x3')][_0x56c4('0x4')]({'port':0x2329});var logger=require(_0x56c4('0x5'))(_0x56c4('0x6'));exports[_0x56c4('0x7')]=function(_0x1096ce,_0x24d839){logger[_0x56c4('0x7')](_0x1096ce,_0x24d839?util[_0x56c4('0x8')](_0x24d839,{'showHidden':![],'depth':null}):'');};exports[_0x56c4('0x9')]=function(_0x330e6,_0x1d0b9b){logger[_0x56c4('0x9')](_0x330e6,_0x1d0b9b?util[_0x56c4('0x8')](_0x1d0b9b,{'showHidden':![],'depth':null}):'');};exports[_0x56c4('0xa')]=function(_0x13b767,_0x1f1f27){logger[_0x56c4('0xa')](_0x13b767,_0x1f1f27?util[_0x56c4('0x8')](_0x1f1f27,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x2533d7,_0x10feed){return client[_0x56c4('0xb')](_0x2533d7,{'body':_0x10feed})[_0x56c4('0xc')](function(_0x4ed446){logger[_0x56c4('0x9')](_0x56c4('0xd'),_0x2533d7,_0x4ed446?util[_0x56c4('0x8')](_0x4ed446,{'showHidden':![],'depth':null}):'');})[_0x56c4('0xe')](function(_0x51fb33){logger[_0x56c4('0xa')]('[utils][request]\x20name:%s',_0x2533d7,_0x51fb33?util['inspect'](_0x51fb33,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2cb56e){return client[_0x56c4('0xb')](_0x56c4('0xf'),{'options':{'raw':!![],'attributes':['id',_0x56c4('0x10'),_0x56c4('0x11'),'interface'],'where':_0x2cb56e,'limit':0x1}})[_0x56c4('0xc')](function(_0x4279ac){logger['debug'](_0x56c4('0x12'),JSON[_0x56c4('0x13')](_0x2cb56e),_0x4279ac?util[_0x56c4('0x8')](_0x4279ac,{'showHidden':![],'depth':null}):'');return _0x4279ac[_0x56c4('0x14')]['length']?_0x4279ac[_0x56c4('0x14')][0x0]:null;});}exports[_0x56c4('0x15')]=function(_0x56324c){return new BPromise(function(_0xf99c93,_0x73ebc7){if(_0x56324c){return getUser({'internal':_0x56324c})[_0x56c4('0xc')](function(_0x2a6016){logger['info'](_0x56c4('0x16'),_0x56324c,_0x2a6016?_0x56c4('0x17'):_0x56c4('0x18'));return _0xf99c93(_0x2a6016);})[_0x56c4('0xe')](function(_0x35108){logger[_0x56c4('0xa')]('[utils][getUserByInternal]',_0x35108?util['inspect'](_0x35108,{'showHidden':![],'depth':null}):'');return _0xf99c93(null);});}return _0xf99c93(null);});};exports[_0x56c4('0x19')]=function(_0x42f996){return new BPromise(function(_0x4cb83b,_0x1cf6fc){if(_0x42f996){return getUser({'interface':_0x42f996})[_0x56c4('0xc')](function(_0x10eae6){logger[_0x56c4('0x7')](_0x56c4('0x1a'),_0x42f996,_0x10eae6?_0x56c4('0x17'):_0x56c4('0x18'));return _0x4cb83b(_0x10eae6);})['catch'](function(_0x1313a4){logger[_0x56c4('0xa')](_0x56c4('0x1b'),_0x1313a4?util['inspect'](_0x1313a4,{'showHidden':![],'depth':null}):'');return _0x4cb83b(null);});}return _0x4cb83b(null);});};exports[_0x56c4('0x1c')]=function(_0x4d1d9c){return new BPromise(function(_0x213cc6,_0xecf1e7){if(_0x4d1d9c){return getUser({'name':_0x4d1d9c})['then'](function(_0x148268){logger[_0x56c4('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x4d1d9c,_0x148268?'found':'notfound');return _0x213cc6(_0x148268);})[_0x56c4('0xe')](function(_0x2ac814){logger[_0x56c4('0xa')]('[utils][getUserByName]',_0x2ac814?util[_0x56c4('0x8')](_0x2ac814,{'showHidden':![],'depth':null}):'');return _0x213cc6(null);});}return _0x213cc6(null);});};exports['getVoiceQueueByName']=function(_0x4ce20d){return new BPromise(function(_0x5f9cc,_0x461b3a){if(_0x4ce20d){return client[_0x56c4('0xb')](_0x56c4('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x56c4('0x11'),_0x56c4('0x1e'),_0x56c4('0x1f'),_0x56c4('0x20')],'where':{'name':_0x4ce20d},'limit':0x1}})['then'](function(_0x36f430){logger[_0x56c4('0x9')](_0x56c4('0x21'),_0x4ce20d,_0x36f430?util['inspect'](_0x36f430,{'showHidden':![],'depth':null}):'');logger[_0x56c4('0x7')](_0x56c4('0x22'),_0x4ce20d,_0x36f430?_0x56c4('0x17'):'notfound');return _0x5f9cc(_0x36f430[_0x56c4('0x14')][_0x56c4('0x23')]?_0x36f430['result'][0x0]:null);})[_0x56c4('0xe')](function(_0x5f1e92){logger[_0x56c4('0xa')](_0x56c4('0x24'),_0x5f1e92?util[_0x56c4('0x8')](_0x5f1e92,{'showHidden':![],'depth':null}):'');return _0x5f9cc(null);});}return _0x5f9cc(null);});};exports[_0x56c4('0x25')]=function(_0x2dfa7b,_0x4985f2){return moment(_0x2dfa7b)['add'](_0x4985f2,_0x56c4('0x26'))[_0x56c4('0x27')](_0x56c4('0x28'));};exports[_0x56c4('0x29')]=function(_0x35460d,_0x4abe0f){return moment(_0x35460d)[_0x56c4('0x2a')](_0x4abe0f,_0x56c4('0x26'))[_0x56c4('0x27')](_0x56c4('0x28'));};exports[_0x56c4('0x2b')]=function(_0xac38c5,_0x102f4e){return moment(_0xac38c5)['diff'](moment(_0x102f4e),'seconds');};exports[_0x56c4('0x2c')]=function(_0x4036d3,_0x29d3c4){return parseInt(_0x4036d3,0xa)+parseInt(_0x29d3c4,0xa);};exports[_0x56c4('0x2d')]=function(){return moment()[_0x56c4('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x382f79,_0x547a86){if(_0x547a86){return moment(_0x382f79)[_0x56c4('0x2e')](_0x547a86);}return!![];};exports[_0x56c4('0x2f')]=function(_0x311da4,_0x3e893d){if(_0x3e893d){return moment(_0x311da4)['isBefore'](_0x3e893d);}else if(_0x311da4){return!![];}return![];};
\ No newline at end of file
+var _0xbbbd=['then','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','found','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','inspect','error','request','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface'];(function(_0x4766a9,_0x23e95a){var _0x515d2b=function(_0x55a945){while(--_0x55a945){_0x4766a9['push'](_0x4766a9['shift']());}};_0x515d2b(++_0x23e95a);}(_0xbbbd,0x86));var _0xdbbb=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbbbd[_0x42cae2];return _0x5f256f;};'use strict';var BPromise=require(_0xdbbb('0x0'));var jayson=require(_0xdbbb('0x1'));var moment=require(_0xdbbb('0x2'));var util=require(_0xdbbb('0x3'));var client=jayson[_0xdbbb('0x4')][_0xdbbb('0x5')]({'port':0x2329});var logger=require(_0xdbbb('0x6'))(_0xdbbb('0x7'));exports[_0xdbbb('0x8')]=function(_0x114d3a,_0x1cd8ad){logger[_0xdbbb('0x8')](_0x114d3a,_0x1cd8ad?util['inspect'](_0x1cd8ad,{'showHidden':![],'depth':null}):'');};exports[_0xdbbb('0x9')]=function(_0x42ea38,_0x197916){logger[_0xdbbb('0x9')](_0x42ea38,_0x197916?util[_0xdbbb('0xa')](_0x197916,{'showHidden':![],'depth':null}):'');};exports[_0xdbbb('0xb')]=function(_0x335ffd,_0x3ac8a1){logger[_0xdbbb('0xb')](_0x335ffd,_0x3ac8a1?util[_0xdbbb('0xa')](_0x3ac8a1,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x1520e0,_0x5eacfc){return client[_0xdbbb('0xc')](_0x1520e0,{'body':_0x5eacfc})['then'](function(_0x4074a7){logger[_0xdbbb('0x9')](_0xdbbb('0xd'),_0x1520e0,_0x4074a7?util[_0xdbbb('0xa')](_0x4074a7,{'showHidden':![],'depth':null}):'');})[_0xdbbb('0xe')](function(_0x2b1cfb){logger[_0xdbbb('0xb')](_0xdbbb('0xd'),_0x1520e0,_0x2b1cfb?util[_0xdbbb('0xa')](_0x2b1cfb,{'showHidden':![],'depth':null}):'');});};function getUser(_0x543652){return client[_0xdbbb('0xc')](_0xdbbb('0xf'),{'options':{'raw':!![],'attributes':['id',_0xdbbb('0x10'),_0xdbbb('0x11'),_0xdbbb('0x12')],'where':_0x543652,'limit':0x1}})[_0xdbbb('0x13')](function(_0x433ffb){logger[_0xdbbb('0x9')](_0xdbbb('0x14'),JSON[_0xdbbb('0x15')](_0x543652),_0x433ffb?util[_0xdbbb('0xa')](_0x433ffb,{'showHidden':![],'depth':null}):'');return _0x433ffb[_0xdbbb('0x16')][_0xdbbb('0x17')]?_0x433ffb[_0xdbbb('0x16')][0x0]:null;});}exports['getUserByInternal']=function(_0x7d3d3a){return new BPromise(function(_0xbbf0b4,_0x50c9ec){if(_0x7d3d3a){return getUser({'internal':_0x7d3d3a})['then'](function(_0x50ede3){logger[_0xdbbb('0x8')](_0xdbbb('0x18'),_0x7d3d3a,_0x50ede3?'found':_0xdbbb('0x19'));return _0xbbf0b4(_0x50ede3);})[_0xdbbb('0xe')](function(_0x5cf6bd){logger[_0xdbbb('0xb')](_0xdbbb('0x1a'),_0x5cf6bd?util[_0xdbbb('0xa')](_0x5cf6bd,{'showHidden':![],'depth':null}):'');return _0xbbf0b4(null);});}return _0xbbf0b4(null);});};exports[_0xdbbb('0x1b')]=function(_0x4b0984){return new BPromise(function(_0x14f4e1,_0x269bcc){if(_0x4b0984){return getUser({'interface':_0x4b0984})[_0xdbbb('0x13')](function(_0xe98d9e){logger[_0xdbbb('0x8')](_0xdbbb('0x1c'),_0x4b0984,_0xe98d9e?'found':_0xdbbb('0x19'));return _0x14f4e1(_0xe98d9e);})[_0xdbbb('0xe')](function(_0x537086){logger['error'](_0xdbbb('0x1d'),_0x537086?util[_0xdbbb('0xa')](_0x537086,{'showHidden':![],'depth':null}):'');return _0x14f4e1(null);});}return _0x14f4e1(null);});};exports[_0xdbbb('0x1e')]=function(_0x582a8c){return new BPromise(function(_0x371c0b,_0x487880){if(_0x582a8c){return getUser({'name':_0x582a8c})[_0xdbbb('0x13')](function(_0x389315){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x582a8c,_0x389315?_0xdbbb('0x1f'):'notfound');return _0x371c0b(_0x389315);})['catch'](function(_0x466dd0){logger[_0xdbbb('0xb')](_0xdbbb('0x20'),_0x466dd0?util[_0xdbbb('0xa')](_0x466dd0,{'showHidden':![],'depth':null}):'');return _0x371c0b(null);});}return _0x371c0b(null);});};exports[_0xdbbb('0x21')]=function(_0x3234d6){return new BPromise(function(_0x452bea,_0x41819a){if(_0x3234d6){return client['request'](_0xdbbb('0x22'),{'options':{'raw':!![],'attributes':['id',_0xdbbb('0x11'),_0xdbbb('0x23'),'acw',_0xdbbb('0x24')],'where':{'name':_0x3234d6},'limit':0x1}})[_0xdbbb('0x13')](function(_0xcb4a46){logger[_0xdbbb('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x3234d6,_0xcb4a46?util[_0xdbbb('0xa')](_0xcb4a46,{'showHidden':![],'depth':null}):'');logger['info'](_0xdbbb('0x25'),_0x3234d6,_0xcb4a46?'found':_0xdbbb('0x19'));return _0x452bea(_0xcb4a46[_0xdbbb('0x16')][_0xdbbb('0x17')]?_0xcb4a46[_0xdbbb('0x16')][0x0]:null);})[_0xdbbb('0xe')](function(_0x356489){logger[_0xdbbb('0xb')](_0xdbbb('0x26'),_0x356489?util[_0xdbbb('0xa')](_0x356489,{'showHidden':![],'depth':null}):'');return _0x452bea(null);});}return _0x452bea(null);});};exports[_0xdbbb('0x27')]=function(_0x4ba8a9,_0xaa4e6){return moment(_0x4ba8a9)[_0xdbbb('0x28')](_0xaa4e6,_0xdbbb('0x29'))[_0xdbbb('0x2a')](_0xdbbb('0x2b'));};exports[_0xdbbb('0x2c')]=function(_0x37fa38,_0x4f992b){return moment(_0x37fa38)[_0xdbbb('0x2d')](_0x4f992b,'seconds')[_0xdbbb('0x2a')](_0xdbbb('0x2b'));};exports['diffTime']=function(_0x3c1f4f,_0x1ebee5){return moment(_0x3c1f4f)[_0xdbbb('0x2e')](moment(_0x1ebee5),_0xdbbb('0x29'));};exports[_0xdbbb('0x2f')]=function(_0x5bcd94,_0xd5b0c1){return parseInt(_0x5bcd94,0xa)+parseInt(_0xd5b0c1,0xa);};exports[_0xdbbb('0x30')]=function(){return moment()['format'](_0xdbbb('0x2b'));};exports[_0xdbbb('0x31')]=function(_0x463ff8,_0x9472a6){if(_0x9472a6){return moment(_0x463ff8)[_0xdbbb('0x31')](_0x9472a6);}return!![];};exports[_0xdbbb('0x32')]=function(_0x5ae36f,_0x3613cb){if(_0x3613cb){return moment(_0x5ae36f)[_0xdbbb('0x32')](_0x3613cb);}else if(_0x5ae36f){return!![];}return![];};
\ No newline at end of file
index ce49a2e..606139b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0086=['/var','log','client','role','name','ensureDir','join','then','catch','user','no-user','data','timestamp','error','set','client-side-logger','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','headers','remoteAddress','url','statusCode','responseTime','inspect','use','logger','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','other','agent_id','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData'];(function(_0x185369,_0x46be46){var _0x4b98ba=function(_0x40bbb4){while(--_0x40bbb4){_0x185369['push'](_0x185369['shift']());}};_0x4b98ba(++_0x46be46);}(_0x0086,0x115));var _0x6008=function(_0x2f273c,_0x2b7de7){_0x2f273c=_0x2f273c-0x0;var _0x5cd8f3=_0x0086[_0x2f273c];return _0x5cd8f3;};var fs=require(_0x6008('0x0'));var _=require(_0x6008('0x1'));var ewinston=require(_0x6008('0x2'));var path=require(_0x6008('0x3'));var util=require(_0x6008('0x4'));var fileLogger=require(_0x6008('0x5'))[_0x6008('0x6')];var safeTemplate=require(_0x6008('0x7'))[_0x6008('0x8')];var maskSensitiveData=require(_0x6008('0x9'))[_0x6008('0xa')];function ClientSideLogger(){function _0x1b6ec9(_0x17841a){var _0x3de82b=path['join'](_0x6008('0xb'),_0x6008('0xc'),'xcally');var _0x5dc35b=path['join'](_0x6008('0xd'),_0x17841a[_0x6008('0xe')]+'-'+_0x17841a[_0x6008('0xf')]);return fs[_0x6008('0x10')](path[_0x6008('0x11')](_0x3de82b,_0x5dc35b))[_0x6008('0x12')](function(){var _0x44442e=fileLogger('client',path[_0x6008('0x11')](_0x3de82b,_0x5dc35b));return _0x44442e;})[_0x6008('0x13')](function(_0x58e528){throw _0x58e528;});}this[_0x6008('0xc')]=function(_0xfd7ff6,_0x244d8e,_0x52aaad,_0x3e5ac9){return _0x1b6ec9(_0xfd7ff6[_0x6008('0x14')])['then'](function(_0x59b36e){var _0x3ec41c=_0x59b36e[_0x244d8e];return _0x3ec41c;})[_0x6008('0x12')](function(_0x28db97){var _0x17eaf0=_0xfd7ff6[_0x6008('0x14')]?_0xfd7ff6[_0x6008('0x14')]['id']:_0x6008('0x15');var _0x5df161=_0x3e5ac9[_0x6008('0x16')];var _0x4f7f98=_0x3e5ac9[_0x6008('0x17')];var _0x47a26a=new Date(Number(_0x4f7f98));return _0x28db97(_0x17eaf0,_0x47a26a,_0x52aaad,_0x5df161);})[_0x6008('0x13')](function(_0x39df80){fileLogger('client')[_0x6008('0x18')](_0x39df80);});};}function setupLoggers(_0x544d82){return new Promise(function(_0x44a22b){var _0x5e14da=new ClientSideLogger();var _0x16f0ab=fileLogger('api');var _0x5dc444=fileLogger('auth');_0x544d82[_0x6008('0x19')](_0x6008('0x1a'),_0x5e14da);_0x544d82['use'](ewinston['logger']({'winstonInstance':_0x16f0ab,'meta':![],'statusLevels':!![],'msg':function(_0x29bf82,_0x11dc65){var _0x8f37bc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x6008('0x1b')](_0x29bf82[_0x6008('0x1c')])){_0x8f37bc+=_0x6008('0x1d');var _0x22378b=_0x29bf82[_0x6008('0x1c')];maskSensitiveData(_0x22378b);}return safeTemplate(util[_0x6008('0x1e')](_0x8f37bc,_0x29bf82[_0x6008('0x1f')],_0x29bf82['headers'][_0x6008('0x20')]?_0x29bf82[_0x6008('0x21')][_0x6008('0x20')]:_0x29bf82['connection'][_0x6008('0x22')]||_0x29bf82['ip'],_0x29bf82[_0x6008('0x23')],_0x11dc65[_0x6008('0x24')],_0x11dc65[_0x6008('0x25')],_0x29bf82[_0x6008('0x14')]?_0x29bf82['user']['id']:null,_0x29bf82['user']?_0x29bf82[_0x6008('0x14')][_0x6008('0xf')]:null,_0x29bf82[_0x6008('0x14')]?_0x29bf82[_0x6008('0x14')][_0x6008('0xe')]:null,_0x22378b?util[_0x6008('0x26')](_0x22378b,![],null):''));}}));_0x544d82[_0x6008('0x27')](ewinston[_0x6008('0x28')]({'winstonInstance':_0x5dc444,'meta':![],'statusLevels':!![],'msg':function(_0x6a5d97,_0x4434cb){var _0x15ae99='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x6a5d97['body']&&_0x6a5d97['body'][_0x6008('0x29')]&&_0x6a5d97[_0x6008('0x1c')]['agent_id']){_0x15ae99=_0x6008('0x2a');}return util[_0x6008('0x1e')](_0x15ae99,_0x6a5d97[_0x6008('0x1f')],_0x6a5d97[_0x6008('0x21')]['x-forwarded-for']?_0x6a5d97['headers'][_0x6008('0x20')]:_0x6a5d97[_0x6008('0x2b')]['remoteAddress']||_0x6a5d97['ip'],_0x6a5d97[_0x6008('0x23')],_0x4434cb[_0x6008('0x24')],_0x4434cb['responseTime'],_0x6a5d97[_0x6008('0x14')]?_0x6a5d97[_0x6008('0x14')]['id']:null,_0x6a5d97[_0x6008('0x14')]?_0x6a5d97['user'][_0x6008('0xf')]:null,_0x6a5d97[_0x6008('0x14')]?_0x6a5d97[_0x6008('0x14')][_0x6008('0xe')]:null,_0x6a5d97[_0x6008('0x1c')]&&_0x6a5d97[_0x6008('0x1c')][_0x6008('0x29')]?_0x6a5d97[_0x6008('0x1c')][_0x6008('0x29')]:_0x6008('0x2c'),_0x6a5d97['body']&&_0x6a5d97[_0x6008('0x1c')][_0x6008('0x2d')]?_0x6a5d97[_0x6008('0x1c')][_0x6008('0x2d')]:'',_0x6a5d97[_0x6008('0x1c')]&&_0x6a5d97[_0x6008('0x1c')]['agent_name']?_0x6a5d97[_0x6008('0x1c')]['agent_name']:'');},'ignoreRoute':function(_0x3254a2){var _0x250a14=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x250a14[_0x6008('0x2e')](_0x3254a2[_0x6008('0x23')]);}}));return _0x44a22b();});}exports[_0x6008('0x2f')]=setupLoggers;
\ No newline at end of file
+var _0x8101=['api','auth','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','x-forwarded-for','headers','connection','remoteAddress','url','responseTime','name','inspect','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','device','other','agent_name','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','fileLogger','./safe-template','maskSensitiveData','join','log','xcally','client','role','ensureDir','then','catch','user','no-user','data','timestamp','error'];(function(_0x498db0,_0x186230){var _0x7a2998=function(_0x349a0b){while(--_0x349a0b){_0x498db0['push'](_0x498db0['shift']());}};_0x7a2998(++_0x186230);}(_0x8101,0x75));var _0x1810=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x8101[_0x5d31f3];return _0x1cc88c;};var fs=require(_0x1810('0x0'));var _=require(_0x1810('0x1'));var ewinston=require(_0x1810('0x2'));var path=require('path');var util=require(_0x1810('0x3'));var fileLogger=require(_0x1810('0x4'))[_0x1810('0x5')];var safeTemplate=require(_0x1810('0x6'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0x1810('0x7')];function ClientSideLogger(){function _0x3a0932(_0x45fb4c){var _0x1de985=path[_0x1810('0x8')]('/var',_0x1810('0x9'),_0x1810('0xa'));var _0x4f8ff9=path['join'](_0x1810('0xb'),_0x45fb4c[_0x1810('0xc')]+'-'+_0x45fb4c['name']);return fs[_0x1810('0xd')](path[_0x1810('0x8')](_0x1de985,_0x4f8ff9))[_0x1810('0xe')](function(){var _0x5cd039=fileLogger(_0x1810('0xb'),path[_0x1810('0x8')](_0x1de985,_0x4f8ff9));return _0x5cd039;})[_0x1810('0xf')](function(_0xad34eb){throw _0xad34eb;});}this['log']=function(_0x397674,_0x436bf9,_0x305f7b,_0x419040){return _0x3a0932(_0x397674['user'])[_0x1810('0xe')](function(_0x646c37){var _0x415df4=_0x646c37[_0x436bf9];return _0x415df4;})[_0x1810('0xe')](function(_0x462a77){var _0x3a7752=_0x397674[_0x1810('0x10')]?_0x397674['user']['id']:_0x1810('0x11');var _0x1be5bc=_0x419040[_0x1810('0x12')];var _0x1db8c3=_0x419040[_0x1810('0x13')];var _0xaa3f22=new Date(Number(_0x1db8c3));return _0x462a77(_0x3a7752,_0xaa3f22,_0x305f7b,_0x1be5bc);})[_0x1810('0xf')](function(_0x1643c2){fileLogger(_0x1810('0xb'))[_0x1810('0x14')](_0x1643c2);});};}function setupLoggers(_0x42c706){return new Promise(function(_0x378913){var _0x422d26=new ClientSideLogger();var _0x222adc=fileLogger(_0x1810('0x15'));var _0x100237=fileLogger(_0x1810('0x16'));_0x42c706[_0x1810('0x17')]('client-side-logger',_0x422d26);_0x42c706[_0x1810('0x18')](ewinston[_0x1810('0x19')]({'winstonInstance':_0x222adc,'meta':![],'statusLevels':!![],'msg':function(_0x3e5703,_0x542e54){var _0x4dd97a=_0x1810('0x1a');if(!_[_0x1810('0x1b')](_0x3e5703['body'])){_0x4dd97a+='\x20body=%s';var _0x419fa9=_0x3e5703[_0x1810('0x1c')];maskSensitiveData(_0x419fa9);}return safeTemplate(util[_0x1810('0x1d')](_0x4dd97a,_0x3e5703[_0x1810('0x1e')],_0x3e5703['headers'][_0x1810('0x1f')]?_0x3e5703[_0x1810('0x20')]['x-forwarded-for']:_0x3e5703[_0x1810('0x21')][_0x1810('0x22')]||_0x3e5703['ip'],_0x3e5703[_0x1810('0x23')],_0x542e54['statusCode'],_0x542e54[_0x1810('0x24')],_0x3e5703[_0x1810('0x10')]?_0x3e5703['user']['id']:null,_0x3e5703[_0x1810('0x10')]?_0x3e5703[_0x1810('0x10')][_0x1810('0x25')]:null,_0x3e5703[_0x1810('0x10')]?_0x3e5703[_0x1810('0x10')][_0x1810('0xc')]:null,_0x419fa9?util[_0x1810('0x26')](_0x419fa9,![],null):''));}}));_0x42c706[_0x1810('0x18')](ewinston['logger']({'winstonInstance':_0x100237,'meta':![],'statusLevels':!![],'msg':function(_0x3990ad,_0x3932fd){var _0x5bd7d6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x3990ad['body']&&_0x3990ad[_0x1810('0x1c')]['device']&&_0x3990ad['body'][_0x1810('0x27')]){_0x5bd7d6=_0x1810('0x28');}return util[_0x1810('0x1d')](_0x5bd7d6,_0x3990ad[_0x1810('0x1e')],_0x3990ad[_0x1810('0x20')]['x-forwarded-for']?_0x3990ad['headers'][_0x1810('0x1f')]:_0x3990ad[_0x1810('0x21')][_0x1810('0x22')]||_0x3990ad['ip'],_0x3990ad[_0x1810('0x23')],_0x3932fd[_0x1810('0x29')],_0x3932fd[_0x1810('0x24')],_0x3990ad[_0x1810('0x10')]?_0x3990ad[_0x1810('0x10')]['id']:null,_0x3990ad['user']?_0x3990ad['user']['name']:null,_0x3990ad['user']?_0x3990ad[_0x1810('0x10')]['role']:null,_0x3990ad['body']&&_0x3990ad[_0x1810('0x1c')][_0x1810('0x2a')]?_0x3990ad[_0x1810('0x1c')][_0x1810('0x2a')]:_0x1810('0x2b'),_0x3990ad[_0x1810('0x1c')]&&_0x3990ad[_0x1810('0x1c')][_0x1810('0x27')]?_0x3990ad['body']['agent_id']:'',_0x3990ad[_0x1810('0x1c')]&&_0x3990ad['body'][_0x1810('0x2c')]?_0x3990ad[_0x1810('0x1c')][_0x1810('0x2c')]:'');},'ignoreRoute':function(_0x290de1){var _0x4a2593=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4a2593['test'](_0x290de1[_0x1810('0x23')]);}}));return _0x378913();});}exports[_0x1810('0x2d')]=setupLoggers;
\ No newline at end of file
index 02c41cb..d89a233 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe828=['YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','warn','Logger','transports','File','error','%s-%s','Console','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x5df0a1,_0x4a9824){var _0x262f50=function(_0x48f06a){while(--_0x48f06a){_0x5df0a1['push'](_0x5df0a1['shift']());}};_0x262f50(++_0x4a9824);}(_0xe828,0xaa));var _0x8e82=function(_0x114f87,_0x128e6e){_0x114f87=_0x114f87-0x0;var _0xbf0eb8=_0xe828[_0x114f87];return _0xbf0eb8;};'use strict';var path=require(_0x8e82('0x0'));var util=require('util');var moment=require(_0x8e82('0x1'));var winston=require(_0x8e82('0x2'));var config=require(_0x8e82('0x3'));var debugLevel=config[_0x8e82('0x4')]?config[_0x8e82('0x4')][_0x8e82('0x5')]():_0x8e82('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x8e82('0x7'),'error':_0x8e82('0x8'),'warn':'bold\x20yellow','info':_0x8e82('0x9'),'print':_0x8e82('0xa'),'success':_0x8e82('0xb'),'http':_0x8e82('0xc'),'verbose':_0x8e82('0xd'),'debug':_0x8e82('0xe'),'silly':'bold\x20cyan'};winston[_0x8e82('0xf')](XC_LOG_COLORS);function getLogFileName(_0x21d714,_0x5325ec,_0x18ae56){var _0x2ec262=_0x21d714||_0x8e82('0x10');return path[_0x8e82('0x11')](_0x2ec262,util[_0x8e82('0x12')](_0x8e82('0x13'),_0x5325ec,_0x18ae56));}function formatter(_0x1adfbc,_0x81c844){_0x81c844[_0x8e82('0x14')]=_0x81c844[_0x8e82('0x14')][_0x8e82('0x15')](/@@{/g,_0x8e82('0x16'))['replace'](/}@@/g,_0x8e82('0x17'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x8e82('0x12')](_0x8e82('0x18'),moment()[_0x8e82('0x12')](_0x8e82('0x19')),_0x81c844['level'][_0x8e82('0x1a')](),_0x1adfbc,_0x81c844['message']);}function fileFormat(_0x377b45,_0x2362c7){_0x2362c7['message']=_0x2362c7['message']['replace'](/@@{/g,_0x8e82('0x16'))[_0x8e82('0x15')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x8e82('0x15')](/}@/g,'}}');var _0x1ae631=_0x2362c7['meta']&&Object['keys'](_0x2362c7[_0x8e82('0x1b')])[_0x8e82('0x1c')]?'\x0a\x09'+JSON[_0x8e82('0x1d')](_0x2362c7[_0x8e82('0x1b')]):'';return util[_0x8e82('0x12')](_0x8e82('0x1e'),moment()[_0x8e82('0x12')](_0x8e82('0x19')),_0x2362c7[_0x8e82('0x1f')][_0x8e82('0x1a')](),_0x377b45,_0x2362c7[_0x8e82('0x14')],_0x1ae631);}function consoleLogger(){var _0xa6d22a=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x8e82('0x20'),'json':![],'formatter':function(_0x2e7dae){return formatter('',_0x2e7dae);}})]});return _0xa6d22a;}function fileLogger(_0x262a98,_0x131d89){var _0x1fa23d=new winston[(_0x8e82('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8e82('0x22'))][(_0x8e82('0x23'))]({'name':util['format']('%s-%s',_0x262a98,_0x8e82('0x24')),'filename':getLogFileName(_0x131d89,_0x262a98,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x443ccc){return fileFormat(_0x262a98,_0x443ccc);}}),new winston[(_0x8e82('0x22'))][(_0x8e82('0x23'))]({'name':util[_0x8e82('0x12')](_0x8e82('0x25'),_0x262a98,debugLevel),'filename':getLogFileName(_0x131d89,_0x262a98,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26ea15){return fileFormat(_0x262a98,_0x26ea15);}}),new winston[(_0x8e82('0x22'))][(_0x8e82('0x26'))]({'level':_0x8e82('0x20'),'json':![],'formatter':function(_0x19d6d6){return fileFormat(_0x262a98,_0x19d6d6);}})]});return _0x1fa23d;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
+var _0x9c82=['path','moment','../config/environment','debugLevel','toLowerCase','info','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','error','%s-%s','consoleLogger','fileLogger'];(function(_0x3bf3f1,_0x5b8238){var _0x5a0c0c=function(_0x303fac){while(--_0x303fac){_0x3bf3f1['push'](_0x3bf3f1['shift']());}};_0x5a0c0c(++_0x5b8238);}(_0x9c82,0x138));var _0x29c8=function(_0x10cc1a,_0x2ba014){_0x10cc1a=_0x10cc1a-0x0;var _0x2822f5=_0x9c82[_0x10cc1a];return _0x2822f5;};'use strict';var path=require(_0x29c8('0x0'));var util=require('util');var moment=require(_0x29c8('0x1'));var winston=require('winston');var config=require(_0x29c8('0x2'));var debugLevel=config[_0x29c8('0x3')]?config[_0x29c8('0x3')][_0x29c8('0x4')]():_0x29c8('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0x29c8('0x6'),'info':_0x29c8('0x7'),'print':_0x29c8('0x8'),'success':_0x29c8('0x9'),'http':_0x29c8('0xa'),'verbose':_0x29c8('0xb'),'debug':_0x29c8('0xc'),'silly':_0x29c8('0xd')};winston[_0x29c8('0xe')](XC_LOG_COLORS);function getLogFileName(_0x3f326e,_0x26d03a,_0x35b730){var _0x1666e8=_0x3f326e||_0x29c8('0xf');return path[_0x29c8('0x10')](_0x1666e8,util[_0x29c8('0x11')](_0x29c8('0x12'),_0x26d03a,_0x35b730));}function formatter(_0x2e2b92,_0x5ebf92){_0x5ebf92[_0x29c8('0x13')]=_0x5ebf92[_0x29c8('0x13')]['replace'](/@@{/g,_0x29c8('0x14'))[_0x29c8('0x15')](/}@@/g,_0x29c8('0x16'))[_0x29c8('0x15')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x29c8('0x11')](_0x29c8('0x17'),moment()[_0x29c8('0x11')](_0x29c8('0x18')),_0x5ebf92[_0x29c8('0x19')][_0x29c8('0x1a')](),_0x2e2b92,_0x5ebf92[_0x29c8('0x13')]);}function fileFormat(_0x361bd0,_0x8144c0){_0x8144c0[_0x29c8('0x13')]=_0x8144c0['message'][_0x29c8('0x15')](/@@{/g,_0x29c8('0x14'))[_0x29c8('0x15')](/}@@/g,'}}}')[_0x29c8('0x15')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5c91af=_0x8144c0[_0x29c8('0x1b')]&&Object[_0x29c8('0x1c')](_0x8144c0[_0x29c8('0x1b')])['length']?'\x0a\x09'+JSON[_0x29c8('0x1d')](_0x8144c0['meta']):'';return util[_0x29c8('0x11')](_0x29c8('0x1e'),moment()[_0x29c8('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0x8144c0[_0x29c8('0x19')]['toUpperCase'](),_0x361bd0,_0x8144c0['message'],_0x5c91af);}function consoleLogger(){var _0x2c5081=new winston[(_0x29c8('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x29c8('0x20'))][(_0x29c8('0x21'))]({'level':_0x29c8('0x22'),'json':![],'formatter':function(_0x21633d){return formatter('',_0x21633d);}})]});return _0x2c5081;}function fileLogger(_0x29c26d,_0x49c63a){var _0x28f3ef=new winston[(_0x29c8('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x29c8('0x20'))]['File']({'name':util[_0x29c8('0x11')]('%s-%s',_0x29c26d,_0x29c8('0x23')),'filename':getLogFileName(_0x49c63a,_0x29c26d,_0x29c8('0x23')),'level':_0x29c8('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x548440){return fileFormat(_0x29c26d,_0x548440);}}),new winston['transports']['File']({'name':util['format'](_0x29c8('0x24'),_0x29c26d,debugLevel),'filename':getLogFileName(_0x49c63a,_0x29c26d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2947c8){return fileFormat(_0x29c26d,_0x2947c8);}}),new winston[(_0x29c8('0x20'))][(_0x29c8('0x21'))]({'level':'warn','json':![],'formatter':function(_0x2f8b00){return fileFormat(_0x29c26d,_0x2f8b00);}})]});return _0x28f3ef;}exports[_0x29c8('0x25')]=consoleLogger;exports[_0x29c8('0x26')]=fileLogger;
\ No newline at end of file
index 309abde..8b5148d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0x0295,0x1f0));var _0x5029=function(_0x3ecf65,_0x3bac13){_0x3ecf65=_0x3ecf65-0x0;var _0x1907df=_0x0295[_0x3ecf65];return _0x1907df;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
+var _0x14a0=['membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','code','accessKey','tenantId','accessToken'];(function(_0x36ec43,_0x3baf09){var _0x56666e=function(_0x3e161b){while(--_0x3e161b){_0x36ec43['push'](_0x36ec43['shift']());}};_0x56666e(++_0x3baf09);}(_0x14a0,0x8e));var _0x014a=function(_0x2a72dd,_0x488fa9){_0x2a72dd=_0x2a72dd-0x0;var _0x20f04e=_0x14a0[_0x2a72dd];return _0x20f04e;};var _=require('lodash');var sensitiveFields=[_0x014a('0x0'),_0x014a('0x1'),_0x014a('0x2'),_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),'phone','mobile',_0x014a('0x7'),_0x014a('0x8'),_0x014a('0x9'),'clientSecret','securityToken',_0x014a('0xa'),_0x014a('0xb'),_0x014a('0xc'),'token','channelSecret',_0x014a('0xd'),'accessTokenSecret','authToken','consumerKey','consumerSecret',_0x014a('0xe'),'calleridname',_0x014a('0xf'),_0x014a('0x10'),'vidaooApiKey',_0x014a('0x11'),_0x014a('0x12'),_0x014a('0x13'),_0x014a('0x14'),_0x014a('0x15'),_0x014a('0x16'),_0x014a('0x17'),_0x014a('0x18'),_0x014a('0x19'),_0x014a('0x1a'),_0x014a('0x1b'),_0x014a('0x1c'),'oldPassword'];function maskSensitiveData(_0x130d13){const _0x3cf92f=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x130d13)){for(const _0x3a836f in _0x130d13){if(_[_0x014a('0x1d')](_0x130d13[_0x3a836f])){for(let _0x59a4ea=0x0;_0x59a4ea<_0x130d13[_0x3a836f][_0x014a('0x1e')];_0x59a4ea++){maskSensitiveData(_0x130d13[_0x3a836f][_0x59a4ea]);}}else if(_[_0x014a('0x1f')](_0x130d13[_0x3a836f])){maskSensitiveData(_0x130d13[_0x3a836f]);}else if(_[_0x014a('0x20')](_0x130d13[_0x3a836f])){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](/{{{/g,_0x014a('0x22'))[_0x014a('0x21')](/}}}/g,_0x014a('0x23'))[_0x014a('0x21')](/{{/g,'@{')[_0x014a('0x21')](/}}/g,'}@');if(_[_0x014a('0x24')](sensitiveFields,_0x3a836f)){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](_0x3cf92f,'*');}}}}}module[_0x014a('0x25')][_0x014a('0x26')]=maskSensitiveData;
\ No newline at end of file
index 4d60f86..ee0eadb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955f=['map','isPlainObject','keys','reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x4d440f,_0x189535){var _0x123ee2=function(_0x534dff){while(--_0x534dff){_0x4d440f['push'](_0x4d440f['shift']());}};_0x123ee2(++_0x189535);}(_0x955f,0x1eb));var _0xf955=function(_0x2f9525,_0x70a593){_0x2f9525=_0x2f9525-0x0;var _0x2d600d=_0x955f[_0x2f9525];return _0x2d600d;};var _=require(_0xf955('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x471baa){return _0x471baa==='{{'?_0xf955('0x1'):_0xf955('0x2');}function safeTemplate(_0x2834f7){var _0x585f6e=_0x2834f7;if(typeof _0x2834f7===_0xf955('0x3')){_0x585f6e=_0x2834f7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x2834f7)){_0x585f6e=_0x2834f7[_0xf955('0x4')](function(_0x5a20bc){return safeTemplate(_0x5a20bc);});}else if(_[_0xf955('0x5')](_0x2834f7)){_0x585f6e=Object[_0xf955('0x6')](_0x2834f7)[_0xf955('0x7')](function(_0x59d5b3,_0x18432f){_0x59d5b3[_0x18432f]=safeTemplate(_0x2834f7[_0x18432f]);return _0x59d5b3;},{});}return _0x585f6e;}module[_0xf955('0x8')]['safeTemplate']=safeTemplate;
\ No newline at end of file
+var _0xef0f=['lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','isPlainObject','keys','reduce','safeTemplate'];(function(_0x520bcb,_0x2c0635){var _0x38b358=function(_0x411629){while(--_0x411629){_0x520bcb['push'](_0x520bcb['shift']());}};_0x38b358(++_0x2c0635);}(_0xef0f,0x168));var _0xfef0=function(_0x155ec3,_0x7c4ccc){_0x155ec3=_0x155ec3-0x0;var _0x393505=_0xef0f[_0x155ec3];return _0x393505;};var _=require(_0xfef0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x581303){return _0x581303==='{{'?_0xfef0('0x1'):_0xfef0('0x2');}function safeTemplate(_0x19f865){var _0x4d29e5=_0x19f865;if(typeof _0x19f865===_0xfef0('0x3')){_0x4d29e5=_0x19f865[_0xfef0('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfef0('0x5')](_0x19f865)){_0x4d29e5=_0x19f865['map'](function(_0x2a6fcf){return safeTemplate(_0x2a6fcf);});}else if(_[_0xfef0('0x6')](_0x19f865)){_0x4d29e5=Object[_0xfef0('0x7')](_0x19f865)[_0xfef0('0x8')](function(_0xad43e,_0x11dfd7){_0xad43e[_0x11dfd7]=safeTemplate(_0x19f865[_0x11dfd7]);return _0xad43e;},{});}return _0x4d29e5;}module['exports'][_0xfef0('0x9')]=safeTemplate;
\ No newline at end of file